From 1772c7a37cbe70f5125a1da4a413e05aec02f1ee Mon Sep 17 00:00:00 2001 From: support Date: Mon, 27 Jun 2022 11:02:02 +0000 Subject: [PATCH] Built motion from commit 18709358.|2.6.11 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- legacy-libs/aproba/LICENSE | 14 + legacy-libs/aproba/README.md | 94 + legacy-libs/aproba/index.js | 105 + legacy-libs/aproba/package.json | 97 + legacy-libs/are-we-there-yet/CHANGES.md | 37 + legacy-libs/are-we-there-yet/LICENSE | 5 + legacy-libs/are-we-there-yet/README.md | 195 + legacy-libs/are-we-there-yet/index.js | 4 + .../node_modules/readable-stream/CONTRIBUTING.md | 38 + .../node_modules/readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../readable-stream/doc/wg-meetings/2015-01-30.md | 60 + .../node_modules/readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../readable-stream/lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 +++ .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 ++ .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../readable-stream/lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 152 + .../node_modules/readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/string_decoder/LICENSE | 48 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 126 + legacy-libs/are-we-there-yet/package.json | 109 + legacy-libs/are-we-there-yet/tracker-base.js | 11 + legacy-libs/are-we-there-yet/tracker-group.js | 107 + legacy-libs/are-we-there-yet/tracker-stream.js | 36 + legacy-libs/are-we-there-yet/tracker.js | 30 + legacy-libs/console-control-strings/LICENSE | 13 + legacy-libs/console-control-strings/README.md | 145 + legacy-libs/console-control-strings/README.md~ | 140 + legacy-libs/console-control-strings/index.js | 125 + legacy-libs/console-control-strings/package.json | 96 + legacy-libs/delegates/History.md | 22 + legacy-libs/delegates/License | 20 + legacy-libs/delegates/Makefile | 8 + legacy-libs/delegates/Readme.md | 94 + legacy-libs/delegates/index.js | 121 + legacy-libs/delegates/package.json | 84 + legacy-libs/delegates/test/index.js | 94 + legacy-libs/gauge/CHANGELOG.md | 160 + legacy-libs/gauge/LICENSE | 13 + legacy-libs/gauge/README.md | 399 + legacy-libs/gauge/base-theme.js | 14 + legacy-libs/gauge/error.js | 24 + legacy-libs/gauge/has-color.js | 12 + legacy-libs/gauge/index.js | 233 + legacy-libs/gauge/package.json | 126 + legacy-libs/gauge/plumbing.js | 48 + legacy-libs/gauge/process.js | 3 + legacy-libs/gauge/progress-bar.js | 35 + legacy-libs/gauge/render-template.js | 181 + legacy-libs/gauge/set-immediate.js | 7 + legacy-libs/gauge/set-interval.js | 3 + legacy-libs/gauge/spin.js | 5 + legacy-libs/gauge/template-item.js | 73 + legacy-libs/gauge/theme-set.js | 115 + legacy-libs/gauge/themes.js | 54 + legacy-libs/gauge/wide-truncate.js | 25 + .../node_modules/protobufjs/dist/README.md | 35 + .../node_modules/protobufjs/dist/protobuf-light.js | 4275 ++++++++++ .../protobufjs/dist/protobuf-light.min.js | 94 + .../protobufjs/dist/protobuf-light.min.js.gz | Bin 0 -> 12319 bytes .../protobufjs/dist/protobuf-light.min.map | 8 + .../node_modules/protobufjs/dist/protobuf.js | 5265 ++++++++++++ .../node_modules/protobufjs/dist/protobuf.min.js | 116 + .../protobufjs/dist/protobuf.min.js.gz | Bin 0 -> 14932 bytes .../node_modules/protobufjs/dist/protobuf.min.map | 8 + legacy-libs/has-unicode/LICENSE | 14 + legacy-libs/has-unicode/README.md | 43 + legacy-libs/has-unicode/index.js | 16 + legacy-libs/has-unicode/package.json | 94 + legacy-libs/npmlog/CHANGELOG.md | 49 + legacy-libs/npmlog/LICENSE | 15 + legacy-libs/npmlog/README.md | 216 + legacy-libs/npmlog/log.js | 309 + legacy-libs/npmlog/package.json | 110 + legacy-libs/protobufjs/dist/README.md | 31 + legacy-libs/protobufjs/dist/light/README.md | 31 + legacy-libs/protobufjs/dist/light/protobuf.js | 7310 ++++++++++++++++ legacy-libs/protobufjs/dist/light/protobuf.js.map | 1 + legacy-libs/protobufjs/dist/light/protobuf.min.js | 8 + .../protobufjs/dist/light/protobuf.min.js.map | 1 + legacy-libs/protobufjs/dist/minimal/README.md | 31 + legacy-libs/protobufjs/dist/minimal/protobuf.js | 2714 ++++++ .../protobufjs/dist/minimal/protobuf.js.map | 1 + .../protobufjs/dist/minimal/protobuf.min.js | 8 + .../protobufjs/dist/minimal/protobuf.min.js.map | 1 + legacy-libs/protobufjs/dist/protobuf.js | 8919 +++++++++++++++++++ legacy-libs/protobufjs/dist/protobuf.js.map | 1 + legacy-libs/protobufjs/dist/protobuf.min.js | 8 + legacy-libs/protobufjs/dist/protobuf.min.js.map | 1 + legacy-libs/protobufjs/package-lock.json | 8922 ++++++++++++++++++++ legacy-libs/signal-exit/CHANGELOG.md | 27 + legacy-libs/signal-exit/LICENSE.txt | 16 + legacy-libs/signal-exit/README.md | 40 + legacy-libs/signal-exit/index.js | 157 + legacy-libs/signal-exit/package.json | 108 + legacy-libs/signal-exit/signals.js | 53 + legacy-libs/wide-align/LICENSE | 14 + legacy-libs/wide-align/README.md | 47 + legacy-libs/wide-align/align.js | 65 + legacy-libs/wide-align/package.json | 105 + server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1318 files changed, 47126 insertions(+), 1203 deletions(-) create mode 100644 legacy-libs/aproba/LICENSE create mode 100644 legacy-libs/aproba/README.md create mode 100644 legacy-libs/aproba/index.js create mode 100644 legacy-libs/aproba/package.json create mode 100644 legacy-libs/are-we-there-yet/CHANGES.md create mode 100644 legacy-libs/are-we-there-yet/LICENSE create mode 100644 legacy-libs/are-we-there-yet/README.md create mode 100644 legacy-libs/are-we-there-yet/index.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/LICENSE create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/README.md create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex-browser.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/package.json create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/passthrough.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/readable-browser.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/readable.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/transform.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/writable-browser.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/readable-stream/writable.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/string_decoder/LICENSE create mode 100644 legacy-libs/are-we-there-yet/node_modules/string_decoder/README.md create mode 100644 legacy-libs/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js create mode 100644 legacy-libs/are-we-there-yet/node_modules/string_decoder/package.json create mode 100644 legacy-libs/are-we-there-yet/package.json create mode 100644 legacy-libs/are-we-there-yet/tracker-base.js create mode 100644 legacy-libs/are-we-there-yet/tracker-group.js create mode 100644 legacy-libs/are-we-there-yet/tracker-stream.js create mode 100644 legacy-libs/are-we-there-yet/tracker.js create mode 100644 legacy-libs/console-control-strings/LICENSE create mode 100644 legacy-libs/console-control-strings/README.md create mode 100644 legacy-libs/console-control-strings/README.md~ create mode 100644 legacy-libs/console-control-strings/index.js create mode 100644 legacy-libs/console-control-strings/package.json create mode 100644 legacy-libs/delegates/History.md create mode 100644 legacy-libs/delegates/License create mode 100644 legacy-libs/delegates/Makefile create mode 100644 legacy-libs/delegates/Readme.md create mode 100644 legacy-libs/delegates/index.js create mode 100644 legacy-libs/delegates/package.json create mode 100644 legacy-libs/delegates/test/index.js create mode 100644 legacy-libs/gauge/CHANGELOG.md create mode 100644 legacy-libs/gauge/LICENSE create mode 100644 legacy-libs/gauge/README.md create mode 100644 legacy-libs/gauge/base-theme.js create mode 100644 legacy-libs/gauge/error.js create mode 100644 legacy-libs/gauge/has-color.js create mode 100644 legacy-libs/gauge/index.js create mode 100644 legacy-libs/gauge/package.json create mode 100644 legacy-libs/gauge/plumbing.js create mode 100644 legacy-libs/gauge/process.js create mode 100644 legacy-libs/gauge/progress-bar.js create mode 100644 legacy-libs/gauge/render-template.js create mode 100644 legacy-libs/gauge/set-immediate.js create mode 100644 legacy-libs/gauge/set-interval.js create mode 100644 legacy-libs/gauge/spin.js create mode 100644 legacy-libs/gauge/template-item.js create mode 100644 legacy-libs/gauge/theme-set.js create mode 100644 legacy-libs/gauge/themes.js create mode 100644 legacy-libs/gauge/wide-truncate.js create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/README.md create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.js create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.min.js create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.min.js.gz create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.min.map create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.js create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.js create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.js.gz create mode 100644 legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.map create mode 100644 legacy-libs/has-unicode/LICENSE create mode 100644 legacy-libs/has-unicode/README.md create mode 100644 legacy-libs/has-unicode/index.js create mode 100644 legacy-libs/has-unicode/package.json create mode 100644 legacy-libs/npmlog/CHANGELOG.md create mode 100644 legacy-libs/npmlog/LICENSE create mode 100644 legacy-libs/npmlog/README.md create mode 100644 legacy-libs/npmlog/log.js create mode 100644 legacy-libs/npmlog/package.json create mode 100644 legacy-libs/protobufjs/dist/README.md create mode 100644 legacy-libs/protobufjs/dist/light/README.md create mode 100644 legacy-libs/protobufjs/dist/light/protobuf.js create mode 100644 legacy-libs/protobufjs/dist/light/protobuf.js.map create mode 100644 legacy-libs/protobufjs/dist/light/protobuf.min.js create mode 100644 legacy-libs/protobufjs/dist/light/protobuf.min.js.map create mode 100644 legacy-libs/protobufjs/dist/minimal/README.md create mode 100644 legacy-libs/protobufjs/dist/minimal/protobuf.js create mode 100644 legacy-libs/protobufjs/dist/minimal/protobuf.js.map create mode 100644 legacy-libs/protobufjs/dist/minimal/protobuf.min.js create mode 100644 legacy-libs/protobufjs/dist/minimal/protobuf.min.js.map create mode 100644 legacy-libs/protobufjs/dist/protobuf.js create mode 100644 legacy-libs/protobufjs/dist/protobuf.js.map create mode 100644 legacy-libs/protobufjs/dist/protobuf.min.js create mode 100644 legacy-libs/protobufjs/dist/protobuf.min.js.map create mode 100644 legacy-libs/protobufjs/package-lock.json create mode 100644 legacy-libs/signal-exit/CHANGELOG.md create mode 100644 legacy-libs/signal-exit/LICENSE.txt create mode 100644 legacy-libs/signal-exit/README.md create mode 100644 legacy-libs/signal-exit/index.js create mode 100644 legacy-libs/signal-exit/package.json create mode 100644 legacy-libs/signal-exit/signals.js create mode 100644 legacy-libs/wide-align/LICENSE create mode 100644 legacy-libs/wide-align/README.md create mode 100644 legacy-libs/wide-align/align.js create mode 100644 legacy-libs/wide-align/package.json diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2db350d..752ffc7 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-23T17:21:22.585Z", + "time": "2022-06-27T10:53:29.357Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7d1bf07..93e4371 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-23T17:21:22.585Z", + "time": "2022-06-27T10:53:29.357Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/legacy-libs/aproba/LICENSE b/legacy-libs/aproba/LICENSE new file mode 100644 index 0000000..f4be44d --- /dev/null +++ b/legacy-libs/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/legacy-libs/aproba/README.md b/legacy-libs/aproba/README.md new file mode 100644 index 0000000..0bfc594 --- /dev/null +++ b/legacy-libs/aproba/README.md @@ -0,0 +1,94 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +| type | description +| :--: | :---------- +| * | matches any type +| A | `Array.isArray` OR an `arguments` object +| S | typeof == string +| N | typeof == number +| F | typeof == function +| O | typeof == object and not type A and not type E +| B | typeof == boolean +| E | `instanceof Error` OR `null` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/legacy-libs/aproba/index.js b/legacy-libs/aproba/index.js new file mode 100644 index 0000000..6f3f797 --- /dev/null +++ b/legacy-libs/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/legacy-libs/aproba/package.json b/legacy-libs/aproba/package.json new file mode 100644 index 0000000..450e7b3 --- /dev/null +++ b/legacy-libs/aproba/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + { + "raw": "aproba@^1.0.3", + "scope": null, + "escapedName": "aproba", + "name": "aproba", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/gauge" + ] + ], + "_from": "aproba@>=1.0.3 <2.0.0", + "_id": "aproba@1.2.0", + "_inCache": true, + "_location": "/aproba", + "_nodeVersion": "8.5.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/aproba-1.2.0.tgz_1505861292502_0.3447994305752218" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "5.4.2", + "_phantomChildren": {}, + "_requested": { + "raw": "aproba@^1.0.3", + "scope": null, + "escapedName": "aproba", + "name": "aproba", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gauge" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_shrinkwrap": null, + "_spec": "aproba@^1.0.3", + "_where": "/var/opt/motion2/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "dependencies": {}, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "tarball": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "ee43ce68c9992e8f9d0d925dc2b1f2e1e5c976de", + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "aproba", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/legacy-libs/are-we-there-yet/CHANGES.md b/legacy-libs/are-we-there-yet/CHANGES.md new file mode 100644 index 0000000..21f3b1c --- /dev/null +++ b/legacy-libs/are-we-there-yet/CHANGES.md @@ -0,0 +1,37 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.5 2018-05-24 + +* [#92](https://github.com/iarna/are-we-there-yet/pull/92) Fix bug where + `finish` would throw errors when including `TrackerStream` objects in + `TrackerGroup` collections. (@brianloveswords) + +## 1.1.4 2017-04-21 + +* Fix typo in package.json + +## 1.1.3 2017-04-21 + +* Improve documentation and limit files included in the distribution. + +## 1.1.2 2016-03-15 + +* Add tracker group cycle detection and tests for it + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/legacy-libs/are-we-there-yet/LICENSE b/legacy-libs/are-we-there-yet/LICENSE new file mode 100644 index 0000000..af45880 --- /dev/null +++ b/legacy-libs/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/are-we-there-yet/README.md b/legacy-libs/are-we-there-yet/README.md new file mode 100644 index 0000000..7e2b42d --- /dev/null +++ b/legacy-libs/are-we-there-yet/README.md @@ -0,0 +1,195 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +* var completed = tracker.completed() + +Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream` + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Implemented in: `Tracker`, `TrackerGroup` + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/legacy-libs/are-we-there-yet/index.js b/legacy-libs/are-we-there-yet/index.js new file mode 100644 index 0000000..57d8743 --- /dev/null +++ b/legacy-libs/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md b/legacy-libs/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 0000000..f478d58 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md b/legacy-libs/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 0000000..16ffb93 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/LICENSE b/legacy-libs/are-we-there-yet/node_modules/readable-stream/LICENSE new file mode 100644 index 0000000..2873b3b --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/README.md b/legacy-libs/are-we-there-yet/node_modules/readable-stream/README.md new file mode 100644 index 0000000..23fe3f3 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/legacy-libs/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 0000000..83275f1 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,60 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section + + diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex-browser.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 0000000..f8b2db8 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex.js new file mode 100644 index 0000000..46924cb --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 0000000..a1ca813 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 0000000..a9c8358 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 0000000..bf34ac6 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 0000000..5d1f8b8 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 0000000..b3f4e85 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 0000000..aefc68b --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 0000000..5a0a0d8 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 0000000..9332a3f --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 0000000..ce2ad5b --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/package.json b/legacy-libs/are-we-there-yet/node_modules/readable-stream/package.json new file mode 100644 index 0000000..1bccdae --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/package.json @@ -0,0 +1,152 @@ +{ + "_args": [ + [ + { + "raw": "readable-stream@^2.0.5", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "^2.0.5", + "spec": ">=2.0.5 <3.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/superagent" + ], + [ + { + "raw": "readable-stream@^2.0.6", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "^2.0.6", + "spec": ">=2.0.6 <3.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/are-we-there-yet" + ] + ], + "_from": "readable-stream@^2.0.6", + "_hasShrinkwrap": false, + "_id": "readable-stream@2.3.6", + "_inCache": true, + "_location": "/are-we-there-yet/readable-stream", + "_nodeVersion": "8.10.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/readable-stream_2.3.6_1522856414086_0.18438932255173968" + }, + "_npmUser": { + "name": "matteo.collina", + "email": "hello@matteocollina.com" + }, + "_npmVersion": "5.8.0", + "_phantomChildren": {}, + "_requested": { + "raw": "readable-stream@^2.0.6", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "^2.0.6", + "spec": ">=2.0.6 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/are-we-there-yet" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_shrinkwrap": null, + "_spec": "readable-stream@^2.0.6", + "_where": "/var/opt/motion2/node_modules/are-we-there-yet", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "directories": {}, + "dist": { + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "fileCount": 24, + "unpackedSize": 87961 + }, + "gitHead": "b3cf9b1f46eaa1865930ae03b96d7a4a570746f0", + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "matteo.collina", + "email": "hello@matteocollina.com" + }, + { + "name": "nodejs-foundation", + "email": "build@iojs.org" + }, + { + "name": "rvagg", + "email": "r@va.gg" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/passthrough.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..ffd791d --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/readable-browser.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/readable-browser.js new file mode 100644 index 0000000..e503725 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/readable.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..ec89ec5 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/transform.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..b1baba2 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/writable-browser.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/writable-browser.js new file mode 100644 index 0000000..ebdde6a --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/legacy-libs/are-we-there-yet/node_modules/readable-stream/writable.js b/legacy-libs/are-we-there-yet/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..3211a6f --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/legacy-libs/are-we-there-yet/node_modules/string_decoder/LICENSE b/legacy-libs/are-we-there-yet/node_modules/string_decoder/LICENSE new file mode 100644 index 0000000..778edb2 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/string_decoder/LICENSE @@ -0,0 +1,48 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + diff --git a/legacy-libs/are-we-there-yet/node_modules/string_decoder/README.md b/legacy-libs/are-we-there-yet/node_modules/string_decoder/README.md new file mode 100644 index 0000000..5fd5831 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/legacy-libs/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js b/legacy-libs/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 0000000..2e89e63 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/legacy-libs/are-we-there-yet/node_modules/string_decoder/package.json b/legacy-libs/are-we-there-yet/node_modules/string_decoder/package.json new file mode 100644 index 0000000..2452834 --- /dev/null +++ b/legacy-libs/are-we-there-yet/node_modules/string_decoder/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "string_decoder@~1.1.1", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~1.1.1", + "spec": ">=1.1.1 <1.2.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/superagent/node_modules/readable-stream" + ], + [ + { + "raw": "string_decoder@~1.1.1", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~1.1.1", + "spec": ">=1.1.1 <1.2.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/are-we-there-yet/node_modules/readable-stream" + ] + ], + "_from": "string_decoder@~1.1.1", + "_hasShrinkwrap": false, + "_id": "string_decoder@1.1.1", + "_inCache": true, + "_location": "/are-we-there-yet/string_decoder", + "_nodeVersion": "8.10.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/string_decoder_1.1.1_1522397654739_0.2722524344416213" + }, + "_npmUser": { + "name": "matteo.collina", + "email": "hello@matteocollina.com" + }, + "_npmVersion": "5.8.0", + "_phantomChildren": {}, + "_requested": { + "raw": "string_decoder@~1.1.1", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~1.1.1", + "spec": ">=1.1.1 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/are-we-there-yet/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "_shrinkwrap": null, + "_spec": "string_decoder@~1.1.1", + "_where": "/var/opt/motion2/node_modules/are-we-there-yet/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/nodejs/string_decoder/issues" + }, + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "description": "The string_decoder module from Node core", + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "directories": {}, + "dist": { + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", + "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "fileCount": 5, + "unpackedSize": 15298 + }, + "gitHead": "18c7f89c894ced5f610505bb006dfde9a3d1ac5e", + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "lib/string_decoder.js", + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + { + "name": "matteo.collina", + "email": "hello@matteocollina.com" + }, + { + "name": "nodejs-foundation", + "email": "build@iojs.org" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "substack", + "email": "substack@gmail.com" + } + ], + "name": "string_decoder", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "test": "tap test/parallel/*.js && node test/verify-dependencies" + }, + "version": "1.1.1" +} diff --git a/legacy-libs/are-we-there-yet/package.json b/legacy-libs/are-we-there-yet/package.json new file mode 100644 index 0000000..caa2d48 --- /dev/null +++ b/legacy-libs/are-we-there-yet/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/npmlog" + ] + ], + "_from": "are-we-there-yet@>=1.1.2 <1.2.0", + "_id": "are-we-there-yet@1.1.5", + "_inCache": true, + "_location": "/are-we-there-yet", + "_nodeVersion": "9.3.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/are-we-there-yet_1.1.5_1527199680706_0.2972836172536619" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "6.1.0", + "_phantomChildren": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "util-deprecate": "1.0.2" + }, + "_requested": { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog" + ], + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "_shasum": "4b35c2944f062a8bfcda66410760350fe9ddfc21", + "_shrinkwrap": null, + "_spec": "are-we-there-yet@~1.1.2", + "_where": "/var/opt/motion2/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "description": "Keep track of the overall completion of many disparate processes", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "directories": {}, + "dist": { + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "shasum": "4b35c2944f062a8bfcda66410760350fe9ddfc21", + "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "fileCount": 9, + "unpackedSize": 14650, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBzfBCRA9TVsSAnZWagAAtR4QAJuFZqCyX+bkCwSGz/DJ\nAXAnaUYip2Hd8sb2u28miiJwM6aE/yuu126iXLIKj4ov+LEVyiFSXNtkRc8H\nSgDvyh5WZZ8m06o78GA/0FGOxDuJHbBtTPvIFkVM9Wud3NuJ8M08mlRnZGMo\nyLzjUEOejLt5o/JjQfiftVsN9cUXt0UkfP9ZkDuqg8HrVC8k1GS0qte15sKm\nISytjUl4atLw9d6oBsWCwc7xyUSv6wSER+Fqf5vo/4+IIeOdcWFmTGrtvWdo\n8KtHUik4bmo5EE3Z3XlFfEadOd/HSkUfizFOxRaauFWpJMF24+zt1wkrZ26R\nZWc6hyIg/1xrYKgJ0uOuBhPMxcOaUZNO5h3BeQ5J/Rdzg4rAZXSA26GVe+zL\n7sZbWASLSyjquh+jiZ94ztYdS8FhfuCa12TfoHBLOu9yp3xkFHrD89FHg915\nltEo3hERMxHyQdL7Fx/V7ewNH0Y7jL0PSQyEg5Fq1F7YS2AYskAI86FCCm41\nZXP1MveV1c39oqJxpwXhr22z5ga5GDxwVr4cNT0q6hOzMJ0Yigrht+YQZLFc\n0mG6h177j8U+6Q68wK69NcGEiosZCnmMRihGvJxZ6Keq9YvGEZNcnUGdfSPJ\nxu7tGhwr78HDOPTvLzCE9H4nBsBNTMMqJkMAcqjN3u90KGPIMyl/K0S3rfnv\nIiix\r\n=Mjkz\r\n-----END PGP SIGNATURE-----\r\n" + }, + "files": [ + "index.js", + "tracker-base.js", + "tracker-group.js", + "tracker-stream.js", + "tracker.js", + "CHANGES.md" + ], + "gitHead": "b4d023b8b754b9d2d540c9db21cc7edf2962ea63", + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "are-we-there-yet", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.5" +} diff --git a/legacy-libs/are-we-there-yet/tracker-base.js b/legacy-libs/are-we-there-yet/tracker-base.js new file mode 100644 index 0000000..6f43687 --- /dev/null +++ b/legacy-libs/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/legacy-libs/are-we-there-yet/tracker-group.js b/legacy-libs/are-we-there-yet/tracker-group.js new file mode 100644 index 0000000..9759e12 --- /dev/null +++ b/legacy-libs/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/legacy-libs/are-we-there-yet/tracker-stream.js b/legacy-libs/are-we-there-yet/tracker-stream.js new file mode 100644 index 0000000..e1cf850 --- /dev/null +++ b/legacy-libs/are-we-there-yet/tracker-stream.js @@ -0,0 +1,36 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') diff --git a/legacy-libs/are-we-there-yet/tracker.js b/legacy-libs/are-we-there-yet/tracker.js new file mode 100644 index 0000000..68c2339 --- /dev/null +++ b/legacy-libs/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/legacy-libs/console-control-strings/LICENSE b/legacy-libs/console-control-strings/LICENSE new file mode 100644 index 0000000..e756052 --- /dev/null +++ b/legacy-libs/console-control-strings/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/console-control-strings/README.md b/legacy-libs/console-control-strings/README.md new file mode 100644 index 0000000..f58cc8d --- /dev/null +++ b/legacy-libs/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/legacy-libs/console-control-strings/README.md~ b/legacy-libs/console-control-strings/README.md~ new file mode 100644 index 0000000..6eb34e8 --- /dev/null +++ b/legacy-libs/console-control-strings/README.md~ @@ -0,0 +1,140 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/legacy-libs/console-control-strings/index.js b/legacy-libs/console-control-strings/index.js new file mode 100644 index 0000000..bf89034 --- /dev/null +++ b/legacy-libs/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/legacy-libs/console-control-strings/package.json b/legacy-libs/console-control-strings/package.json new file mode 100644 index 0000000..95fd006 --- /dev/null +++ b/legacy-libs/console-control-strings/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/npmlog" + ] + ], + "_from": "console-control-strings@>=1.1.0 <1.2.0", + "_id": "console-control-strings@1.1.0", + "_inCache": true, + "_location": "/console-control-strings", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/console-control-strings-1.1.0.tgz_1466033396831_0.9470485949423164" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": {}, + "_requested": { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/gauge", + "/npmlog" + ], + "_resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "_shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "_shrinkwrap": null, + "_spec": "console-control-strings@~1.1.0", + "_where": "/var/opt/motion2/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/console-control-strings/issues" + }, + "dependencies": {}, + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "tarball": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + }, + "files": [ + "LICENSE", + "index.js" + ], + "gitHead": "722439b4998d2964ac3d3f9ec175c008aa9b7b4b", + "homepage": "https://github.com/iarna/console-control-strings#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "console-control-strings", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/console-control-strings.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/legacy-libs/delegates/History.md b/legacy-libs/delegates/History.md new file mode 100644 index 0000000..25959ea --- /dev/null +++ b/legacy-libs/delegates/History.md @@ -0,0 +1,22 @@ + +1.0.0 / 2015-12-14 +================== + + * Merge pull request #12 from kasicka/master + * Add license text + +0.1.0 / 2014-10-17 +================== + + * adds `.fluent()` to api + +0.0.3 / 2014-01-13 +================== + + * fix receiver for .method() + +0.0.2 / 2014-01-13 +================== + + * Object.defineProperty() sucks + * Initial commit diff --git a/legacy-libs/delegates/License b/legacy-libs/delegates/License new file mode 100644 index 0000000..60de60a --- /dev/null +++ b/legacy-libs/delegates/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/legacy-libs/delegates/Makefile b/legacy-libs/delegates/Makefile new file mode 100644 index 0000000..a9dcfd5 --- /dev/null +++ b/legacy-libs/delegates/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/legacy-libs/delegates/Readme.md b/legacy-libs/delegates/Readme.md new file mode 100644 index 0000000..ab8cf4a --- /dev/null +++ b/legacy-libs/delegates/Readme.md @@ -0,0 +1,94 @@ + +# delegates + + Node method and accessor delegation utilty. + +## Installation + +``` +$ npm install delegates +``` + +## Example + +```js +var delegate = require('delegates'); + +... + +delegate(proto, 'request') + .method('acceptsLanguages') + .method('acceptsEncodings') + .method('acceptsCharsets') + .method('accepts') + .method('is') + .access('querystring') + .access('idempotent') + .access('socket') + .access('length') + .access('query') + .access('search') + .access('status') + .access('method') + .access('path') + .access('body') + .access('host') + .access('url') + .getter('subdomains') + .getter('protocol') + .getter('header') + .getter('stale') + .getter('fresh') + .getter('secure') + .getter('ips') + .getter('ip') +``` + +# API + +## Delegate(proto, prop) + +Creates a delegator instance used to configure using the `prop` on the given +`proto` object. (which is usually a prototype) + +## Delegate#method(name) + +Allows the given method `name` to be accessed on the host. + +## Delegate#getter(name) + +Creates a "getter" for the property with the given `name` on the delegated +object. + +## Delegate#setter(name) + +Creates a "setter" for the property with the given `name` on the delegated +object. + +## Delegate#access(name) + +Creates an "accessor" (ie: both getter *and* setter) for the property with the +given `name` on the delegated object. + +## Delegate#fluent(name) + +A unique type of "accessor" that works for a "fluent" API. When called as a +getter, the method returns the expected value. However, if the method is called +with a value, it will return itself so it can be chained. For example: + +```js +delegate(proto, 'request') + .fluent('query') + +// getter +var q = request.query(); + +// setter (chainable) +request + .query({ a: 1 }) + .query({ b: 2 }); +``` + +# License + + MIT diff --git a/legacy-libs/delegates/index.js b/legacy-libs/delegates/index.js new file mode 100644 index 0000000..17c222d --- /dev/null +++ b/legacy-libs/delegates/index.js @@ -0,0 +1,121 @@ + +/** + * Expose `Delegator`. + */ + +module.exports = Delegator; + +/** + * Initialize a delegator. + * + * @param {Object} proto + * @param {String} target + * @api public + */ + +function Delegator(proto, target) { + if (!(this instanceof Delegator)) return new Delegator(proto, target); + this.proto = proto; + this.target = target; + this.methods = []; + this.getters = []; + this.setters = []; + this.fluents = []; +} + +/** + * Delegate method `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.method = function(name){ + var proto = this.proto; + var target = this.target; + this.methods.push(name); + + proto[name] = function(){ + return this[target][name].apply(this[target], arguments); + }; + + return this; +}; + +/** + * Delegator accessor `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.access = function(name){ + return this.getter(name).setter(name); +}; + +/** + * Delegator getter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.getter = function(name){ + var proto = this.proto; + var target = this.target; + this.getters.push(name); + + proto.__defineGetter__(name, function(){ + return this[target][name]; + }); + + return this; +}; + +/** + * Delegator setter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.setter = function(name){ + var proto = this.proto; + var target = this.target; + this.setters.push(name); + + proto.__defineSetter__(name, function(val){ + return this[target][name] = val; + }); + + return this; +}; + +/** + * Delegator fluent accessor + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.fluent = function (name) { + var proto = this.proto; + var target = this.target; + this.fluents.push(name); + + proto[name] = function(val){ + if ('undefined' != typeof val) { + this[target][name] = val; + return this; + } else { + return this[target][name]; + } + }; + + return this; +}; diff --git a/legacy-libs/delegates/package.json b/legacy-libs/delegates/package.json new file mode 100644 index 0000000..0fd450e --- /dev/null +++ b/legacy-libs/delegates/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/are-we-there-yet" + ] + ], + "_from": "delegates@>=1.0.0 <2.0.0", + "_id": "delegates@1.0.0", + "_inCache": true, + "_location": "/delegates", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/are-we-there-yet" + ], + "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "_shrinkwrap": null, + "_spec": "delegates@^1.0.0", + "_where": "/var/opt/motion2/node_modules/are-we-there-yet", + "bugs": { + "url": "https://github.com/visionmedia/node-delegates/issues" + }, + "dependencies": {}, + "description": "delegate methods and accessors to another property", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "tarball": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" + }, + "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49", + "homepage": "https://github.com/visionmedia/node-delegates#readme", + "keywords": [ + "delegate", + "delegation" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" + } + ], + "name": "delegates", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-delegates.git" + }, + "scripts": {}, + "version": "1.0.0" +} diff --git a/legacy-libs/delegates/test/index.js b/legacy-libs/delegates/test/index.js new file mode 100644 index 0000000..7b6e3d4 --- /dev/null +++ b/legacy-libs/delegates/test/index.js @@ -0,0 +1,94 @@ + +var assert = require('assert'); +var delegate = require('..'); + +describe('.method(name)', function(){ + it('should delegate methods', function(){ + var obj = {}; + + obj.request = { + foo: function(bar){ + assert(this == obj.request); + return bar; + } + }; + + delegate(obj, 'request').method('foo'); + + obj.foo('something').should.equal('something'); + }) +}) + +describe('.getter(name)', function(){ + it('should delegate getters', function(){ + var obj = {}; + + obj.request = { + get type() { + return 'text/html'; + } + } + + delegate(obj, 'request').getter('type'); + + obj.type.should.equal('text/html'); + }) +}) + +describe('.setter(name)', function(){ + it('should delegate setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').setter('type'); + + obj.type = 'hey'; + obj.request.type.should.equal('HEY'); + }) +}) + +describe('.access(name)', function(){ + it('should delegate getters and setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').access('type'); + + obj.type = 'hey'; + obj.type.should.equal('HEY'); + }) +}) + +describe('.fluent(name)', function () { + it('should delegate in a fluent fashion', function () { + var obj = { + settings: { + env: 'development' + } + }; + + delegate(obj, 'settings').fluent('env'); + + obj.env().should.equal('development'); + obj.env('production').should.equal(obj); + obj.settings.env.should.equal('production'); + }) +}) diff --git a/legacy-libs/gauge/CHANGELOG.md b/legacy-libs/gauge/CHANGELOG.md new file mode 100644 index 0000000..407bc19 --- /dev/null +++ b/legacy-libs/gauge/CHANGELOG.md @@ -0,0 +1,160 @@ +### v2.7.4 + +* Reset colors prior to ending a line, to eliminate flicker when a line + is trucated between start and end color sequences. + +### v2.7.3 + +* Only create our onExit handler when we're enabled and remove it when we're + disabled. This stops us from creating multiple onExit handlers when + multiple gauge objects are being used. +* Fix bug where if a theme name were given instead of a theme object, it + would crash. +* Remove supports-color because it's not actually used. Uhm. Yes, I just + updated it. >.> + +### v2.7.2 + +* Use supports-color instead of has-color (as the module has been renamed) + +### v2.7.1 + +* Bug fix: Calls to show/pulse while the progress bar is disabled should still + update our internal representation of what would be shown should it be enabled. + +### v2.7.0 + +* New feature: Add new `isEnabled` method to allow introspection of the gauge's + "enabledness" as controlled by `.enable()` and `.disable()`. + +### v2.6.0 + +* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge + is already enabled or disabled respectively. This prevents leaking event + listeners, amongst other weirdness. +* New feature: Template items can have default values that will be used if no + value was otherwise passed in. + +### v2.5.3 + +* Default to `enabled` only if we have a tty. Users can always override + this by passing in the `enabled` option explicitly or by calling calling + `gauge.enable()`. + +### v2.5.2 + +* Externalized `./console-strings.js` into `console-control-strings`. + +### v2.5.1 + +* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the + node profiler. +* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add + a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012)) + +### v2.5.0 + +* Add way to programmatically fetch a list of theme names in a themeset + (`Themeset.getThemeNames`). + +### v2.4.0 + +* Add support for setting themesets on existing gauge objects. +* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when + your terminal is interleaving output from multiple filehandles (ie, stdout + & stderr). + +### v2.3.1 + +* Fix a refactor bug in setTheme where it wasn't accepting the various types + of args it should. + +### v2.3.0 + +#### FEATURES + +* Add setTemplate & setTheme back in. +* Add support for named themes, you can now ask for things like 'colorASCII' + and 'brailleSpinner'. Of course, you can still pass in theme objects. + Additionally you can now pass in an object with `hasUnicode`, `hasColor` and + `platform` keys in order to override our guesses as to those values when + selecting a default theme from the themeset. +* Make the output stream optional (it defaults to `process.stderr` now). +* Add `setWriteTo(stream[, tty])` to change the output stream and, + optionally, tty. + +#### BUG FIXES & REFACTORING + +* Abort the display phase early if we're supposed to be hidden and we are. +* Stop printing a bunch of spaces at the end of lines, since we're already + using an erase-to-end-of-line code anyway. +* The unicode themes were missing the subsection separator. + +### v2.2.1 + +* Fix image in readme + +### v2.2.0 + +* All new themes API– reference themes by name and pass in custom themes and + themesets (themesets get platform support autodetection done on them to + select the best theme). Theme mixins let you add features to all existing + themes. +* Much, much improved test coverage. + +### v2.1.0 + +* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks + to @yongtw123 for pointing out this had snuck in. +* Fiddled with the demo output to make it easier to see the spinner spin. Also + added prints before each platforms test output. +* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for + finding this. Then I was lazy and made a new commit instead of using his + PR. Again, thank you for your patience @KenenY. +* Drastically speed up travis testing. +* Add a small javascript demo (demo.js) for showing off the various themes + (and testing them on diff platforms). +* Change: The subsection separator from ⁄ and / (different chars) to >. +* Fix crasher: A show or pulse without a label would cause the template renderer + to complain about a missing value. +* New feature: Add the ability to disable the clean-up-on-exit behavior. + Not something I expect to be widely desirable, but important if you have + multiple distinct gauge instances in your app. +* Use our own color support detection. + The `has-color` module proved too magic for my needs, making assumptions + as to which stream we write to and reading command line arguments. + +### v2.0.0 + +This is a major rewrite of the internals. Externally there are fewer +changes: + +* On node>0.8 gauge object now prints updates at a fixed rate. This means + that when you call `show` it may wate up to `updateInterval` ms before it + actually prints an update. You override this behavior with the + `fixedFramerate` option. +* The gauge object now keeps the cursor hidden as long as it's enabled and + shown. +* The constructor's arguments have changed, now it takes a mandatory output + stream and an optional options object. The stream no longer needs to be + an `ansi`ified stream, although it can be if you want (but we won't make + use of its special features). +* Previously the gauge was disabled by default if `process.stdout` wasn't a + tty. Now it always defaults to enabled. If you want the previous + behavior set the `enabled` option to `process.stdout.isTTY`. +* The constructor's options have changed– see the docs for details. +* Themes are entirely different. If you were using a custom theme, or + referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then + you'll need to change your code. You can get the equivalent of the latter + with: + ``` + var themes = require('gauge/themes') + var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform + ``` + The default themes no longer use any ambiguous width characters, so even + if you choose to display those as wide your progress bar should still + display correctly. +* Templates are entirely different and if you were using a custom one, you + should consult the documentation to learn how to recreate it. If you were + using the default, be aware that it has changed and the result looks quite + a bit different. diff --git a/legacy-libs/gauge/LICENSE b/legacy-libs/gauge/LICENSE new file mode 100644 index 0000000..e756052 --- /dev/null +++ b/legacy-libs/gauge/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/gauge/README.md b/legacy-libs/gauge/README.md new file mode 100644 index 0000000..bdd60e3 --- /dev/null +++ b/legacy-libs/gauge/README.md @@ -0,0 +1,399 @@ +gauge +===== + +A nearly stateless terminal based horizontal gauge / progress bar. + +```javascript +var Gauge = require("gauge") + +var gauge = new Gauge() + +gauge.show("test", 0.20) + +gauge.pulse("this") + +gauge.hide() +``` + +![](gauge-demo.gif) + + +### CHANGES FROM 1.x + +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. + +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. + +Constructs a new gauge. Gauges are drawn on a single line, and are not drawn +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in verisons of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. + +**IMPORTANT:** If you prevously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. + +The **options** object can have the following properties, all of which are +optional: + +* **updateInterval**: How often gauge updates should be drawn, in miliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarly you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. + +[has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates + +#### `gauge.show(section | status, [completed])` + +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. + +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. + +#### `gauge.hide([cb])` + +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) + +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. + +#### `gauge.pulse([subsection])` + +* **subsection** – *(optional)* The specific thing that triggered this pulse + +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. + +#### `gauge.disable()` + +Hides the gauge and ignores further calls to `show` or `pulse`. + +#### `gauge.enable()` + +Shows the gauge and resumes updating when `show` or `pulse` is called. + +#### `gauge.isEnabled()` + +Returns true if the gauge is enabled. + +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. + +#### `gauge.setTheme(theme)` + +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` + +Change the active template, will be displayed with the next show or pulse + +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeset() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() + +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. + +#### themes.getTheme(name) + +Returns the theme object from this theme set named `name`. + +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. + +#### themes.setDefault([opts], themeName) + +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeset() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES + +A template is an array of objects and strings that, after being evaluated, +will be turned into the gauge line. The default template is: + +```javascript +[ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} +] +``` + +The various template elements can either be **plain strings**, in which case they will +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. +* *maxLength* – The maximum length for this element. If its value is longer it + will be truncated. +* *minLength* – The minimum length for this element. If its value is shorter it + will be padded according to the *align* value. +* *align* – (Default: left) Possible values "left", "right" and "center". Works + as you'd expect from word processors. +* *length* – Provides a single value for both *minLength* and *maxLength*. If both + *length* and *minLength or *maxLength* are specifed then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. + +### PLUMBING + +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. + +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/legacy-libs/gauge/base-theme.js b/legacy-libs/gauge/base-theme.js new file mode 100644 index 0000000..0b67638 --- /dev/null +++ b/legacy-libs/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/legacy-libs/gauge/error.js b/legacy-libs/gauge/error.js new file mode 100644 index 0000000..d9914ba --- /dev/null +++ b/legacy-libs/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/legacy-libs/gauge/has-color.js b/legacy-libs/gauge/has-color.js new file mode 100644 index 0000000..e283a25 --- /dev/null +++ b/legacy-libs/gauge/has-color.js @@ -0,0 +1,12 @@ +'use strict' + +module.exports = isWin32() || isColorTerm() + +function isWin32 () { + return process.platform === 'win32' +} + +function isColorTerm () { + var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i + return !!process.env.COLORTERM || termHasColor.test(process.env.TERM) +} diff --git a/legacy-libs/gauge/index.js b/legacy-libs/gauge/index.js new file mode 100644 index 0000000..c553240 --- /dev/null +++ b/legacy-libs/gauge/index.js @@ -0,0 +1,233 @@ +'use strict' +var Plumbing = require('./plumbing.js') +var hasUnicode = require('has-unicode') +var hasColor = require('./has-color.js') +var onExit = require('signal-exit') +var defaultThemes = require('./themes') +var setInterval = require('./set-interval.js') +var process = require('./process.js') +var setImmediate = require('./set-immediate') + +module.exports = Gauge + +function callWith (obj, method) { + return function () { + return method.call(obj) + } +} + +function Gauge (arg1, arg2) { + var options, writeTo + if (arg1 && arg1.write) { + writeTo = arg1 + options = arg2 || {} + } else if (arg2 && arg2.write) { + writeTo = arg2 + options = arg1 || {} + } else { + writeTo = process.stderr + options = arg1 || arg2 || {} + } + + this._status = { + spun: 0, + section: '', + subsection: '' + } + this._paused = false // are we paused for back pressure? + this._disabled = true // are all progress bar updates disabled? + this._showing = false // do we WANT the progress bar on screen + this._onScreen = false // IS the progress bar on screen + this._needsRedraw = false // should we print something at next tick? + this._hideCursor = options.hideCursor == null ? true : options.hideCursor + this._fixedFramerate = options.fixedFramerate == null + ? !(/^v0\.8\./.test(process.version)) + : options.fixedFramerate + this._lastUpdateAt = null + this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval + + this._themes = options.themes || defaultThemes + this._theme = options.theme + var theme = this._computeTheme(options.theme) + var template = options.template || [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} + ] + this.setWriteTo(writeTo, options.tty) + var PlumbingClass = options.Plumbing || Plumbing + this._gauge = new PlumbingClass(theme, template, this.getWidth()) + + this._$$doRedraw = callWith(this, this._doRedraw) + this._$$handleSizeChange = callWith(this, this._handleSizeChange) + + this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit + this._removeOnExit = null + + if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { + this.enable() + } else { + this.disable() + } +} +Gauge.prototype = {} + +Gauge.prototype.isEnabled = function () { + return !this._disabled +} + +Gauge.prototype.setTemplate = function (template) { + this._gauge.setTemplate(template) + if (this._showing) this._requestRedraw() +} + +Gauge.prototype._computeTheme = function (theme) { + if (!theme) theme = {} + if (typeof theme === 'string') { + theme = this._themes.getTheme(theme) + } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode + var useColor = theme.hasColor == null ? hasColor : theme.hasColor + theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + } + return theme +} + +Gauge.prototype.setThemeset = function (themes) { + this._themes = themes + this.setTheme(this._theme) +} + +Gauge.prototype.setTheme = function (theme) { + this._gauge.setTheme(this._computeTheme(theme)) + if (this._showing) this._requestRedraw() + this._theme = theme +} + +Gauge.prototype._requestRedraw = function () { + this._needsRedraw = true + if (!this._fixedFramerate) this._doRedraw() +} + +Gauge.prototype.getWidth = function () { + return ((this._tty && this._tty.columns) || 80) - 1 +} + +Gauge.prototype.setWriteTo = function (writeTo, tty) { + var enabled = !this._disabled + if (enabled) this.disable() + this._writeTo = writeTo + this._tty = tty || + (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || + (writeTo.isTTY && writeTo) || + this._tty + if (this._gauge) this._gauge.setWidth(this.getWidth()) + if (enabled) this.enable() +} + +Gauge.prototype.enable = function () { + if (!this._disabled) return + this._disabled = false + if (this._tty) this._enableEvents() + if (this._showing) this.show() +} + +Gauge.prototype.disable = function () { + if (this._disabled) return + if (this._showing) { + this._lastUpdateAt = null + this._showing = false + this._doRedraw() + this._showing = true + } + this._disabled = true + if (this._tty) this._disableEvents() +} + +Gauge.prototype._enableEvents = function () { + if (this._cleanupOnExit) { + this._removeOnExit = onExit(callWith(this, this.disable)) + } + this._tty.on('resize', this._$$handleSizeChange) + if (this._fixedFramerate) { + this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) + if (this.redrawTracker.unref) this.redrawTracker.unref() + } +} + +Gauge.prototype._disableEvents = function () { + this._tty.removeListener('resize', this._$$handleSizeChange) + if (this._fixedFramerate) clearInterval(this.redrawTracker) + if (this._removeOnExit) this._removeOnExit() +} + +Gauge.prototype.hide = function (cb) { + if (this._disabled) return cb && process.nextTick(cb) + if (!this._showing) return cb && process.nextTick(cb) + this._showing = false + this._doRedraw() + cb && setImmediate(cb) +} + +Gauge.prototype.show = function (section, completed) { + this._showing = true + if (typeof section === 'string') { + this._status.section = section + } else if (typeof section === 'object') { + var sectionKeys = Object.keys(section) + for (var ii = 0; ii < sectionKeys.length; ++ii) { + var key = sectionKeys[ii] + this._status[key] = section[key] + } + } + if (completed != null) this._status.completed = completed + if (this._disabled) return + this._requestRedraw() +} + +Gauge.prototype.pulse = function (subsection) { + this._status.subsection = subsection || '' + this._status.spun ++ + if (this._disabled) return + if (!this._showing) return + this._requestRedraw() +} + +Gauge.prototype._handleSizeChange = function () { + this._gauge.setWidth(this._tty.columns - 1) + this._requestRedraw() +} + +Gauge.prototype._doRedraw = function () { + if (this._disabled || this._paused) return + if (!this._fixedFramerate) { + var now = Date.now() + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + this._lastUpdateAt = now + } + if (!this._showing && this._onScreen) { + this._onScreen = false + var result = this._gauge.hide() + if (this._hideCursor) { + result += this._gauge.showCursor() + } + return this._writeTo.write(result) + } + if (!this._showing && !this._onScreen) return + if (this._showing && !this._onScreen) { + this._onScreen = true + this._needsRedraw = true + if (this._hideCursor) { + this._writeTo.write(this._gauge.hideCursor()) + } + } + if (!this._needsRedraw) return + if (!this._writeTo.write(this._gauge.show(this._status))) { + this._paused = true + this._writeTo.on('drain', callWith(this, function () { + this._paused = false + this._doRedraw() + })) + } +} diff --git a/legacy-libs/gauge/package.json b/legacy-libs/gauge/package.json new file mode 100644 index 0000000..ec284ce --- /dev/null +++ b/legacy-libs/gauge/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "gauge@~2.7.3", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.7.3", + "spec": ">=2.7.3 <2.8.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/npmlog" + ] + ], + "_from": "gauge@>=2.7.3 <2.8.0", + "_id": "gauge@2.7.4", + "_inCache": true, + "_location": "/gauge", + "_nodeVersion": "7.7.4", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/gauge-2.7.4.tgz_1492815975490_0.4050216095056385" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "4.5.0", + "_phantomChildren": {}, + "_requested": { + "raw": "gauge@~2.7.3", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.7.3", + "spec": ">=2.7.3 <2.8.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog" + ], + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "_shasum": "2c03405c7538c39d7eb37b317022e325fb018bf7", + "_shrinkwrap": null, + "_spec": "gauge@~2.7.3", + "_where": "/var/opt/motion2/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/gauge/issues" + }, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "description": "A terminal based horizontal guage", + "devDependencies": { + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^7.1.2", + "tap": "^5.7.2", + "through2": "^2.0.0" + }, + "directories": {}, + "dist": { + "shasum": "2c03405c7538c39d7eb37b317022e325fb018bf7", + "tarball": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" + }, + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "gitHead": "1011abf6c2cb7ae89a3ee76fb447d3182d4e8d3a", + "homepage": "https://github.com/iarna/gauge", + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "gauge", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/gauge.git" + }, + "scripts": { + "prepublish": "rm -f *~", + "test": "standard && tap test/*.js --coverage" + }, + "version": "2.7.4" +} diff --git a/legacy-libs/gauge/plumbing.js b/legacy-libs/gauge/plumbing.js new file mode 100644 index 0000000..1afb4af --- /dev/null +++ b/legacy-libs/gauge/plumbing.js @@ -0,0 +1,48 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.color('reset') + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/legacy-libs/gauge/process.js b/legacy-libs/gauge/process.js new file mode 100644 index 0000000..05e8569 --- /dev/null +++ b/legacy-libs/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/legacy-libs/gauge/progress-bar.js b/legacy-libs/gauge/progress-bar.js new file mode 100644 index 0000000..7f8dd68 --- /dev/null +++ b/legacy-libs/gauge/progress-bar.js @@ -0,0 +1,35 @@ +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} + ] + return renderTemplate(width, template, theme) +} + +// lodash's way of repeating +function repeat (string, width) { + var result = '' + var n = width + do { + if (n % 2) { + result += string + } + n = Math.floor(n / 2) + /*eslint no-self-assign: 0*/ + string += string + } while (n && stringWidth(result) < width) + + return wideTruncate(result, width) +} diff --git a/legacy-libs/gauge/render-template.js b/legacy-libs/gauge/render-template.js new file mode 100644 index 0000000..3261bfb --- /dev/null +++ b/legacy-libs/gauge/render-template.js @@ -0,0 +1,181 @@ +'use strict' +var align = require('wide-align') +var validate = require('aproba') +var objectAssign = require('object-assign') +var wideTruncate = require('./wide-truncate') +var error = require('./error') +var TemplateItem = require('./template-item') + +function renderValueWithValues (values) { + return function (item) { + return renderValue(item, values) + } +} + +var renderTemplate = module.exports = function (width, template, values) { + var items = prepareItems(width, template, values) + var rendered = items.map(renderValueWithValues(values)).join('') + return align.left(wideTruncate(rendered, width), width) +} + +function preType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'pre' + cappedTypeName +} + +function postType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'post' + cappedTypeName +} + +function hasPreOrPost (item, values) { + if (!item.type) return + return values[preType(item)] || values[postType(item)] +} + +function generatePreAndPost (baseItem, parentValues) { + var item = objectAssign({}, baseItem) + var values = Object.create(parentValues) + var template = [] + var pre = preType(item) + var post = postType(item) + if (values[pre]) { + template.push({value: values[pre]}) + values[pre] = null + } + item.minLength = null + item.length = null + item.maxLength = null + template.push(item) + values[item.type] = values[item.type] + if (values[post]) { + template.push({value: values[post]}) + values[post] = null + } + return function ($1, $2, length) { + return renderTemplate(length, template, values) + } +} + +function prepareItems (width, template, values) { + function cloneAndObjectify (item, index, arr) { + var cloned = new TemplateItem(item, width) + var type = cloned.type + if (cloned.value == null) { + if (!(type in values)) { + if (cloned.default == null) { + throw new error.MissingTemplateValue(cloned, values) + } else { + cloned.value = cloned.default + } + } else { + cloned.value = values[type] + } + } + if (cloned.value == null || cloned.value === '') return null + cloned.index = index + cloned.first = index === 0 + cloned.last = index === arr.length - 1 + if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) + return cloned + } + + var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) + + var outputLength = 0 + var remainingSpace = width + var variableCount = output.length + + function consumeSpace (length) { + if (length > remainingSpace) length = remainingSpace + outputLength += length + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/legacy-libs/gauge/set-immediate.js b/legacy-libs/gauge/set-immediate.js new file mode 100644 index 0000000..6650a48 --- /dev/null +++ b/legacy-libs/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/legacy-libs/gauge/set-interval.js b/legacy-libs/gauge/set-interval.js new file mode 100644 index 0000000..5761987 --- /dev/null +++ b/legacy-libs/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/legacy-libs/gauge/spin.js b/legacy-libs/gauge/spin.js new file mode 100644 index 0000000..34142ee --- /dev/null +++ b/legacy-libs/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/legacy-libs/gauge/template-item.js b/legacy-libs/gauge/template-item.js new file mode 100644 index 0000000..e46f447 --- /dev/null +++ b/legacy-libs/gauge/template-item.js @@ -0,0 +1,73 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} + diff --git a/legacy-libs/gauge/theme-set.js b/legacy-libs/gauge/theme-set.js new file mode 100644 index 0000000..68971d5 --- /dev/null +++ b/legacy-libs/gauge/theme-set.js @@ -0,0 +1,115 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} + diff --git a/legacy-libs/gauge/themes.js b/legacy-libs/gauge/themes.js new file mode 100644 index 0000000..eb5a4f5 --- /dev/null +++ b/legacy-libs/gauge/themes.js @@ -0,0 +1,54 @@ +'use strict' +var consoleControl = require('console-control-strings') +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '.', + postRemaining: consoleControl.color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '░', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '░', + postRemaining: consoleControl.color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/legacy-libs/gauge/wide-truncate.js b/legacy-libs/gauge/wide-truncate.js new file mode 100644 index 0000000..c531bc4 --- /dev/null +++ b/legacy-libs/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/README.md b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/README.md new file mode 100644 index 0000000..62f3fc8 --- /dev/null +++ b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/README.md @@ -0,0 +1,35 @@ +Distributions +============= + +ProtoBuf.js is available either with or without the .proto parser included. + +### Full build including .proto parser (.proto and JSON) + +* **[protobuf.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.js)** + contains the commented source code. + +* **[protobuf.min.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.min.js)** + has been compiled with Closure Compiler. + +* **[protobuf.min.js.gz](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.min.js.gz)** + has also been gzipped using `-9`. + +* **[protobuf.min.map](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf.min.map)** + is the source map generated by Closure Compiler. + +### Light build excluding .proto parser (JSON only) for use with [pbjs](https://github.com/dcodeIO/Protobuf.js/wiki/pbjs) + +* **[protobuf-light.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.js)** + contains the commented source code. + +* **[protobuf-light.min.js](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.min.js)** + has been compiled with Closure Compiler. + +* **[protobuf-light.min.js.gz](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.min.js.gz)** + has also been gzipped using `-9`. + +* **[protobuf-light.min.map](https://raw.githubusercontent.com/dcodeIO/ProtoBuf.js/master/dist/protobuf-light.min.map)** + is the source map generated by Closure Compiler. + +When sending pull requests, please note that these files have been automatically generated from the sources located in +[src/](https://github.com/dcodeIO/protobuf.js/tree/master/src). diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.js new file mode 100644 index 0000000..1696e64 --- /dev/null +++ b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.js @@ -0,0 +1,4275 @@ +/* + Copyright 2013 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +/** + * @license protobuf.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/protobuf.js for details + */ +(function(global, factory) { + + /* AMD */ if (typeof define === 'function' && define["amd"]) + define(["bytebuffer"], factory); + /* CommonJS */ else if (typeof require === "function" && typeof module === "object" && module && module["exports"]) + module["exports"] = factory(require("bytebuffer"), true); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]); + +})(this, function(ByteBuffer, isCommonJS) { + "use strict"; + + /** + * The ProtoBuf namespace. + * @exports ProtoBuf + * @namespace + * @expose + */ + var ProtoBuf = {}; + + /** + * @type {!function(new: ByteBuffer, ...[*])} + * @expose + */ + ProtoBuf.ByteBuffer = ByteBuffer; + + /** + * @type {?function(new: Long, ...[*])} + * @expose + */ + ProtoBuf.Long = ByteBuffer.Long || null; + + /** + * ProtoBuf.js version. + * @type {string} + * @const + * @expose + */ + ProtoBuf.VERSION = "5.0.3"; + + /** + * Wire types. + * @type {Object.} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES = {}; + + /** + * Varint wire type. + * @type {number} + * @expose + */ + ProtoBuf.WIRE_TYPES.VARINT = 0; + + /** + * Fixed 64 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS64 = 1; + + /** + * Length delimited wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.LDELIM = 2; + + /** + * Start group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.STARTGROUP = 3; + + /** + * End group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.ENDGROUP = 4; + + /** + * Fixed 32 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS32 = 5; + + /** + * Packable wire types. + * @type {!Array.} + * @const + * @expose + */ + ProtoBuf.PACKABLE_WIRE_TYPES = [ + ProtoBuf.WIRE_TYPES.VARINT, + ProtoBuf.WIRE_TYPES.BITS64, + ProtoBuf.WIRE_TYPES.BITS32 + ]; + + /** + * Types. + * @dict + * @type {!Object.} + * @const + * @expose + */ + ProtoBuf.TYPES = { + // According to the protobuf spec. + "int32": { + name: "int32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "uint32": { + name: "uint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "sint32": { + name: "sint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "int64": { + name: "int64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "uint64": { + name: "uint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sint64": { + name: "sint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "bool": { + name: "bool", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: false + }, + "double": { + name: "double", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: 0 + }, + "string": { + name: "string", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: "" + }, + "bytes": { + name: "bytes", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null // overridden in the code, must be a unique instance + }, + "fixed32": { + name: "fixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "sfixed32": { + name: "sfixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "fixed64": { + name: "fixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sfixed64": { + name: "sfixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "float": { + name: "float", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "enum": { + name: "enum", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "message": { + name: "message", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null + }, + "group": { + name: "group", + wireType: ProtoBuf.WIRE_TYPES.STARTGROUP, + defaultValue: null + } + }; + + /** + * Valid map key types. + * @type {!Array.>} + * @const + * @expose + */ + ProtoBuf.MAP_KEY_TYPES = [ + ProtoBuf.TYPES["int32"], + ProtoBuf.TYPES["sint32"], + ProtoBuf.TYPES["sfixed32"], + ProtoBuf.TYPES["uint32"], + ProtoBuf.TYPES["fixed32"], + ProtoBuf.TYPES["int64"], + ProtoBuf.TYPES["sint64"], + ProtoBuf.TYPES["sfixed64"], + ProtoBuf.TYPES["uint64"], + ProtoBuf.TYPES["fixed64"], + ProtoBuf.TYPES["bool"], + ProtoBuf.TYPES["string"], + ProtoBuf.TYPES["bytes"] + ]; + + /** + * Minimum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MIN = 1; + + /** + * Maximum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MAX = 0x1FFFFFFF; + + /** + * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`. + * Must be set prior to parsing. + * @type {boolean} + * @expose + */ + ProtoBuf.convertFieldsToCamelCase = false; + + /** + * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by + * setting this to `false` prior to building messages. + * @type {boolean} + * @expose + */ + ProtoBuf.populateAccessors = true; + + /** + * By default, messages are populated with default values if a field is not present on the wire. To disable + * this behavior, set this setting to `false`. + * @type {boolean} + * @expose + */ + ProtoBuf.populateDefaults = true; + + /** + * @alias ProtoBuf.Util + * @expose + */ + ProtoBuf.Util = (function() { + "use strict"; + + /** + * ProtoBuf utilities. + * @exports ProtoBuf.Util + * @namespace + */ + var Util = {}; + + /** + * Flag if running in node or not. + * @type {boolean} + * @const + * @expose + */ + Util.IS_NODE = !!( + typeof process === 'object' && process+'' === '[object process]' && !process['browser'] + ); + + /** + * Constructs a XMLHttpRequest object. + * @return {XMLHttpRequest} + * @throws {Error} If XMLHttpRequest is not supported + * @expose + */ + Util.XHR = function() { + // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html + var XMLHttpFactories = [ + function () {return new XMLHttpRequest()}, + function () {return new ActiveXObject("Msxml2.XMLHTTP")}, + function () {return new ActiveXObject("Msxml3.XMLHTTP")}, + function () {return new ActiveXObject("Microsoft.XMLHTTP")} + ]; + /** @type {?XMLHttpRequest} */ + var xhr = null; + for (var i=0;i} + * @expose + */ + ProtoBuf.Lang = { + + // Characters always ending a statement + DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g, + + // Field rules + RULE: /^(?:required|optional|repeated|map)$/, + + // Field types + TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, + + // Names + NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, + + // Type definitions + TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, + + // Type references + TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + + // Fully qualified type references + FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/, + + // All numbers + NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, + + // Decimal numbers + NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, + + // Hexadecimal numbers + NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, + + // Octal numbers + NUMBER_OCT: /^0[0-7]+$/, + + // Floating point numbers + NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, + + // Booleans + BOOL: /^(?:true|false)$/i, + + // Id numbers + ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Negative id numbers (enum values) + NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Whitespaces + WHITESPACE: /\s/, + + // All strings + STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, + + // Double quoted strings + STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + + // Single quoted strings + STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g + }; + + + /** + * @alias ProtoBuf.Reflect + * @expose + */ + ProtoBuf.Reflect = (function(ProtoBuf) { + "use strict"; + + /** + * Reflection types. + * @exports ProtoBuf.Reflect + * @namespace + */ + var Reflect = {}; + + /** + * Constructs a Reflect base class. + * @exports ProtoBuf.Reflect.T + * @constructor + * @abstract + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.T} parent Parent object + * @param {string} name Object name + */ + var T = function(builder, parent, name) { + + /** + * Builder reference. + * @type {!ProtoBuf.Builder} + * @expose + */ + this.builder = builder; + + /** + * Parent object. + * @type {?ProtoBuf.Reflect.T} + * @expose + */ + this.parent = parent; + + /** + * Object name in namespace. + * @type {string} + * @expose + */ + this.name = name; + + /** + * Fully qualified class name + * @type {string} + * @expose + */ + this.className; + }; + + /** + * @alias ProtoBuf.Reflect.T.prototype + * @inner + */ + var TPrototype = T.prototype; + + /** + * Returns the fully qualified name of this object. + * @returns {string} Fully qualified name as of ".PATH.TO.THIS" + * @expose + */ + TPrototype.fqn = function() { + var name = this.name, + ptr = this; + do { + ptr = ptr.parent; + if (ptr == null) + break; + name = ptr.name+"."+name; + } while (true); + return name; + }; + + /** + * Returns a string representation of this Reflect object (its fully qualified name). + * @param {boolean=} includeClass Set to true to include the class name. Defaults to false. + * @return String representation + * @expose + */ + TPrototype.toString = function(includeClass) { + return (includeClass ? this.className + " " : "") + this.fqn(); + }; + + /** + * Builds this type. + * @throws {Error} If this type cannot be built directly + * @expose + */ + TPrototype.build = function() { + throw Error(this.toString(true)+" cannot be built directly"); + }; + + /** + * @alias ProtoBuf.Reflect.T + * @expose + */ + Reflect.T = T; + + /** + * Constructs a new Namespace. + * @exports ProtoBuf.Reflect.Namespace + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent + * @param {string} name Namespace name + * @param {Object.=} options Namespace options + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Namespace = function(builder, parent, name, options, syntax) { + T.call(this, builder, parent, name); + + /** + * @override + */ + this.className = "Namespace"; + + /** + * Children inside the namespace. + * @type {!Array.} + */ + this.children = []; + + /** + * Options. + * @type {!Object.} + */ + this.options = options || {}; + + /** + * Syntax level (e.g., proto2 or proto3). + * @type {!string} + */ + this.syntax = syntax || "proto2"; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace.prototype + * @inner + */ + var NamespacePrototype = Namespace.prototype = Object.create(T.prototype); + + /** + * Returns an array of the namespace's children. + * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children). + * @return {Array.} + * @expose + */ + NamespacePrototype.getChildren = function(type) { + type = type || null; + if (type == null) + return this.children.slice(); + var children = []; + for (var i=0, k=this.children.length; i} qn Qualified name to resolve + * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false` + * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found + * @expose + */ + NamespacePrototype.resolve = function(qn, excludeNonNamespace) { + var part = typeof qn === 'string' ? qn.split(".") : qn, + ptr = this, + i = 0; + if (part[i] === "") { // Fully qualified name, e.g. ".My.Message' + while (ptr.parent !== null) + ptr = ptr.parent; + i++; + } + var child; + do { + do { + if (!(ptr instanceof Reflect.Namespace)) { + ptr = null; + break; + } + child = ptr.getChild(part[i]); + if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) { + ptr = null; + break; + } + ptr = child; i++; + } while (i < part.length); + if (ptr != null) + break; // Found + // Else search the parent + if (this.parent !== null) + return this.parent.resolve(qn, excludeNonNamespace); + } while (ptr != null); + return ptr; + }; + + /** + * Determines the shortest qualified name of the specified type, if any, relative to this namespace. + * @param {!ProtoBuf.Reflect.T} t Reflection type + * @returns {string} The shortest qualified name or, if there is none, the fqn + * @expose + */ + NamespacePrototype.qn = function(t) { + var part = [], ptr = t; + do { + part.unshift(ptr.name); + ptr = ptr.parent; + } while (ptr !== null); + for (var len=1; len <= part.length; len++) { + var qn = part.slice(part.length-len); + if (t === this.resolve(qn, t instanceof Reflect.Namespace)) + return qn.join("."); + } + return t.fqn(); + }; + + /** + * Builds the namespace and returns the runtime counterpart. + * @return {Object.} Runtime namespace + * @expose + */ + NamespacePrototype.build = function() { + /** @dict */ + var ns = {}; + var children = this.children; + for (var i=0, k=children.length, child; i} + */ + NamespacePrototype.buildOpt = function() { + var opt = {}, + keys = Object.keys(this.options); + for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option + */ + NamespacePrototype.getOption = function(name) { + if (typeof name === 'undefined') + return this.options; + return typeof this.options[name] !== 'undefined' ? this.options[name] : null; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace + * @expose + */ + Reflect.Namespace = Namespace; + + /** + * Constructs a new Element implementation that checks and converts values for a + * particular field type, as appropriate. + * + * An Element represents a single value: either the value of a singular field, + * or a value contained in one entry of a repeated field or map field. This + * class does not implement these higher-level concepts; it only encapsulates + * the low-level typechecking and conversion. + * + * @exports ProtoBuf.Reflect.Element + * @param {{name: string, wireType: number}} type Resolved data type + * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant + * (e.g. submessage field). + * @param {boolean} isMapKey Is this element a Map key? The value will be + * converted to string form if so. + * @param {string} syntax Syntax level of defining message type, e.g., + * proto2 or proto3. + * @param {string} name Name of the field containing this element (for error + * messages) + * @constructor + */ + var Element = function(type, resolvedType, isMapKey, syntax, name) { + + /** + * Element type, as a string (e.g., int32). + * @type {{name: string, wireType: number}} + */ + this.type = type; + + /** + * Element type reference to submessage or enum definition, if needed. + * @type {ProtoBuf.Reflect.T|null} + */ + this.resolvedType = resolvedType; + + /** + * Element is a map key. + * @type {boolean} + */ + this.isMapKey = isMapKey; + + /** + * Syntax level of defining message type, e.g., proto2 or proto3. + * @type {string} + */ + this.syntax = syntax; + + /** + * Name of the field containing this element (for error messages) + * @type {string} + */ + this.name = name; + + if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0) + throw Error("Invalid map key type: " + type.name); + }; + + var ElementPrototype = Element.prototype; + + /** + * Obtains a (new) default value for the specified type. + * @param type {string|{name: string, wireType: number}} Field type + * @returns {*} Default value + * @inner + */ + function mkDefault(type) { + if (typeof type === 'string') + type = ProtoBuf.TYPES[type]; + if (typeof type.defaultValue === 'undefined') + throw Error("default value for type "+type.name+" is not supported"); + if (type == ProtoBuf.TYPES["bytes"]) + return new ByteBuffer(0); + return type.defaultValue; + } + + /** + * Returns the default value for this field in proto3. + * @function + * @param type {string|{name: string, wireType: number}} the field type + * @returns {*} Default value + */ + Element.defaultFieldValue = mkDefault; + + /** + * Makes a Long from a value. + * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for + * strings and numbers + * @returns {!Long} + * @throws {Error} If the value cannot be converted to a Long + * @inner + */ + function mkLong(value, unsigned) { + if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' + && value.low === value.low && value.high === value.high) + return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned); + if (typeof value === 'string') + return ProtoBuf.Long.fromString(value, unsigned || false, 10); + if (typeof value === 'number') + return ProtoBuf.Long.fromNumber(value, unsigned || false); + throw Error("not convertible to Long"); + } + + ElementPrototype.toString = function() { + return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element'; + } + + /** + * Checks if the given value can be set for an element of this type (singular + * field or one element of a repeated field or map). + * @param {*} value Value to check + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be verified for this element slot + * @expose + */ + ElementPrototype.verifyValue = function(value) { + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + switch (this.type) { + // Signed 32bit + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + // Account for !NaN: value === value + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value > 4294967295 ? value | 0 : value; + + // Unsigned 32bit + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value < 0 ? value >>> 0 : value; + + // Signed 64bit + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, false); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Unsigned 64bit + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, true); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value !== 'boolean') + fail(typeof value, "not a boolean"); + return value; + + // Float + case ProtoBuf.TYPES["float"]: + case ProtoBuf.TYPES["double"]: + if (typeof value !== 'number') + fail(typeof value, "not a number"); + return value; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + if (typeof value !== 'string' && !(value && value instanceof String)) + fail(typeof value, "not a string"); + return ""+value; // Convert String object to string + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (ByteBuffer.isByteBuffer(value)) + return value; + return ByteBuffer.wrap(value, "base64"); + + // Constant enum value + case ProtoBuf.TYPES["enum"]: { + var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value); + for (i=0; i 4294967295 || value < 0) + fail(typeof value, "not in range for uint32") + return value; + } else { + // proto2 requires enum values to be valid. + fail(value, "not a valid enum value"); + } + } + // Embedded message + case ProtoBuf.TYPES["group"]: + case ProtoBuf.TYPES["message"]: { + if (!value || typeof value !== 'object') + fail(typeof value, "object expected"); + if (value instanceof this.resolvedType.clazz) + return value; + if (value instanceof ProtoBuf.Builder.Message) { + // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180) + var obj = {}; + for (var i in value) + if (value.hasOwnProperty(i)) + obj[i] = value[i]; + value = obj; + } + // Else let's try to construct one from a key-value object + return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons + } + } + + // We should never end here + throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")"); + }; + + /** + * Calculates the byte length of an element on the wire. + * @param {number} id Field number + * @param {*} value Field value + * @returns {number} Byte length + * @throws {Error} If the value cannot be calculated + * @expose + */ + ElementPrototype.calculateLength = function(id, value) { + if (value === null) return 0; // Nothing to encode + // Tag has already been written + var n; + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["uint32"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["sint32"]: + return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value)); + case ProtoBuf.TYPES["fixed32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["float"]: + return 4; + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + return ByteBuffer.calculateVarint64(value); + case ProtoBuf.TYPES["sint64"]: + return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value)); + case ProtoBuf.TYPES["fixed64"]: + case ProtoBuf.TYPES["sfixed64"]: + return 8; + case ProtoBuf.TYPES["bool"]: + return 1; + case ProtoBuf.TYPES["enum"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["double"]: + return 8; + case ProtoBuf.TYPES["string"]: + n = ByteBuffer.calculateUTF8Bytes(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining(); + case ProtoBuf.TYPES["message"]: + n = this.resolvedType.calculate(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["group"]: + n = this.resolvedType.calculate(value); + return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + } + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + }; + + /** + * Encodes a value to the specified buffer. Does not encode the key. + * @param {number} id Field number + * @param {*} value Field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the value cannot be encoded + * @expose + */ + ElementPrototype.encodeValue = function(id, value, buffer) { + if (value === null) return buffer; // Nothing to encode + // Tag has already been written + + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes + // long – it is, effectively, treated like a very large unsigned integer." (see #122) + if (value < 0) + buffer.writeVarint64(value); + else + buffer.writeVarint32(value); + break; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + buffer.writeVarint32(value); + break; + + // 32bit varint zig-zag + case ProtoBuf.TYPES["sint32"]: + buffer.writeVarint32ZigZag(value); + break; + + // Fixed unsigned 32bit + case ProtoBuf.TYPES["fixed32"]: + buffer.writeUint32(value); + break; + + // Fixed signed 32bit + case ProtoBuf.TYPES["sfixed32"]: + buffer.writeInt32(value); + break; + + // 64bit varint as-is + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + buffer.writeVarint64(value); // throws + break; + + // 64bit varint zig-zag + case ProtoBuf.TYPES["sint64"]: + buffer.writeVarint64ZigZag(value); // throws + break; + + // Fixed unsigned 64bit + case ProtoBuf.TYPES["fixed64"]: + buffer.writeUint64(value); // throws + break; + + // Fixed signed 64bit + case ProtoBuf.TYPES["sfixed64"]: + buffer.writeInt64(value); // throws + break; + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value === 'string') + buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value); + else + buffer.writeVarint32(value ? 1 : 0); + break; + + // Constant enum value + case ProtoBuf.TYPES["enum"]: + buffer.writeVarint32(value); + break; + + // 32bit float + case ProtoBuf.TYPES["float"]: + buffer.writeFloat32(value); + break; + + // 64bit float + case ProtoBuf.TYPES["double"]: + buffer.writeFloat64(value); + break; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + buffer.writeVString(value); + break; + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + var prevOffset = value.offset; + buffer.writeVarint32(value.remaining()); + buffer.append(value); + value.offset = prevOffset; + break; + + // Embedded message + case ProtoBuf.TYPES["message"]: + var bb = new ByteBuffer().LE(); + this.resolvedType.encode(value, bb); + buffer.writeVarint32(bb.offset); + buffer.append(bb.flip()); + break; + + // Legacy group + case ProtoBuf.TYPES["group"]: + this.resolvedType.encode(value, buffer); + buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + break; + + default: + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + } + return buffer; + }; + + /** + * Decode one element value from the specified buffer. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number} wireType The field wire type + * @param {number} id The field number + * @return {*} Decoded value + * @throws {Error} If the field cannot be decoded + * @expose + */ + ElementPrototype.decode = function(buffer, wireType, id) { + if (wireType != this.type.wireType) + throw Error("Unexpected wire type for element"); + + var value, nBytes; + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + return buffer.readVarint32() | 0; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + return buffer.readVarint32() >>> 0; + + // 32bit signed varint zig-zag + case ProtoBuf.TYPES["sint32"]: + return buffer.readVarint32ZigZag() | 0; + + // Fixed 32bit unsigned + case ProtoBuf.TYPES["fixed32"]: + return buffer.readUint32() >>> 0; + + case ProtoBuf.TYPES["sfixed32"]: + return buffer.readInt32() | 0; + + // 64bit signed varint + case ProtoBuf.TYPES["int64"]: + return buffer.readVarint64(); + + // 64bit unsigned varint + case ProtoBuf.TYPES["uint64"]: + return buffer.readVarint64().toUnsigned(); + + // 64bit signed varint zig-zag + case ProtoBuf.TYPES["sint64"]: + return buffer.readVarint64ZigZag(); + + // Fixed 64bit unsigned + case ProtoBuf.TYPES["fixed64"]: + return buffer.readUint64(); + + // Fixed 64bit signed + case ProtoBuf.TYPES["sfixed64"]: + return buffer.readInt64(); + + // Bool varint + case ProtoBuf.TYPES["bool"]: + return !!buffer.readVarint32(); + + // Constant enum value (varint) + case ProtoBuf.TYPES["enum"]: + // The following Builder.Message#set will already throw + return buffer.readVarint32(); + + // 32bit float + case ProtoBuf.TYPES["float"]: + return buffer.readFloat(); + + // 64bit float + case ProtoBuf.TYPES["double"]: + return buffer.readDouble(); + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + return buffer.readVString(); + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: { + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + value = buffer.clone(); // Offset already set + value.limit = value.offset+nBytes; + buffer.offset += nBytes; + return value; + } + + // Length-delimited embedded message + case ProtoBuf.TYPES["message"]: { + nBytes = buffer.readVarint32(); + return this.resolvedType.decode(buffer, nBytes); + } + + // Legacy group + case ProtoBuf.TYPES["group"]: + return this.resolvedType.decode(buffer, -1, id); + } + + // We should never end here + throw Error("[INTERNAL] Illegal decode type"); + }; + + /** + * Converts a value from a string to the canonical element type. + * + * Legal only when isMapKey is true. + * + * @param {string} str The string value + * @returns {*} The value + */ + ElementPrototype.valueFromString = function(str) { + if (!this.isMapKey) { + throw Error("valueFromString() called on non-map-key element"); + } + + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + return this.verifyValue(parseInt(str)); + + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: + // Long-based fields support conversions from string already. + return this.verifyValue(str); + + case ProtoBuf.TYPES["bool"]: + return str === "true"; + + case ProtoBuf.TYPES["string"]: + return this.verifyValue(str); + + case ProtoBuf.TYPES["bytes"]: + return ByteBuffer.fromBinary(str); + } + }; + + /** + * Converts a value from the canonical element type to a string. + * + * It should be the case that `valueFromString(valueToString(val))` returns + * a value equivalent to `verifyValue(val)` for every legal value of `val` + * according to this element type. + * + * This may be used when the element must be stored or used as a string, + * e.g., as a map key on an Object. + * + * Legal only when isMapKey is true. + * + * @param {*} val The value + * @returns {string} The string form of the value. + */ + ElementPrototype.valueToString = function(value) { + if (!this.isMapKey) { + throw Error("valueToString() called on non-map-key element"); + } + + if (this.type === ProtoBuf.TYPES["bytes"]) { + return value.toString("binary"); + } else { + return value.toString(); + } + }; + + /** + * @alias ProtoBuf.Reflect.Element + * @expose + */ + Reflect.Element = Element; + + /** + * Constructs a new Message. + * @exports ProtoBuf.Reflect.Message + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace + * @param {string} name Message name + * @param {Object.=} options Message options + * @param {boolean=} isGroup `true` if this is a legacy group + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Message = function(builder, parent, name, options, isGroup, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Message"; + + /** + * Extensions range. + * @type {!Array.|undefined} + * @expose + */ + this.extensions = undefined; + + /** + * Runtime message class. + * @type {?function(new:ProtoBuf.Builder.Message)} + * @expose + */ + this.clazz = null; + + /** + * Whether this is a legacy group or not. + * @type {boolean} + * @expose + */ + this.isGroup = !!isGroup; + + // The following cached collections are used to efficiently iterate over or look up fields when decoding. + + /** + * Cached fields. + * @type {?Array.} + * @private + */ + this._fields = null; + + /** + * Cached fields by id. + * @type {?Object.} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields by name. + * @type {?Object.} + * @private + */ + this._fieldsByName = null; + }; + + /** + * @alias ProtoBuf.Reflect.Message.prototype + * @inner + */ + var MessagePrototype = Message.prototype = Object.create(Namespace.prototype); + + /** + * Builds the message and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Message + * @param {boolean=} rebuild Whether to rebuild or not, defaults to false + * @return {ProtoBuf.Reflect.Message} Message class + * @throws {Error} If the message cannot be built + * @expose + */ + MessagePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Message class in its own scope + var clazz = (function(ProtoBuf, T) { + + var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), + oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf); + + /** + * Constructs a new runtime Message. + * @name ProtoBuf.Builder.Message + * @class Barebone of all runtime messages. + * @param {!Object.|string} values Preset values + * @param {...string} var_args + * @constructor + * @throws {Error} If the message cannot be created + */ + var Message = function(values, var_args) { + ProtoBuf.Builder.Message.call(this); + + // Create virtual oneof properties + for (var i=0, k=oneofs.length; i 0) { + var value; + // Set field values from a values object + if (arguments.length === 1 && values !== null && typeof values === 'object' && + /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) && + /* not a repeated field */ !Array.isArray(values) && + /* not a Map */ !(values instanceof ProtoBuf.Map) && + /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) && + /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) && + /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) { + this.$set(values); + } else // Set field values from arguments, in declaration order + for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false` + * @returns {!ProtoBuf.Builder.Message} this + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.set = function(keyOrObj, value, noAssert) { + if (keyOrObj && typeof keyOrObj === 'object') { + noAssert = value; + for (var ikey in keyOrObj) { + // Check if virtual oneof field - don't set these + if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined) + this.$set(ikey, value, noAssert); + } + return this; + } + var field = T._fieldsByName[keyOrObj]; + if (!noAssert) { + if (!field) + throw Error(this+"#"+keyOrObj+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true)); + this[field.name] = (value = field.verifyValue(value)); // May throw + } else + this[keyOrObj] = value; + if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = this[field.oneof.name]; // Virtual field references currently set field + if (value !== null) { + if (currentField !== null && currentField !== field.name) + this[currentField] = null; // Clear currently set field + this[field.oneof.name] = field.name; // Point virtual field at this field + } else if (/* value === null && */currentField === keyOrObj) + this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared) + } + return this; + }; + + /** + * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}. + * @name ProtoBuf.Builder.Message#$set + * @function + * @param {string|!Object.} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert the value, defaults to `false` + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.$set = MessagePrototype.set; + + /** + * Gets a field's value. + * @name ProtoBuf.Builder.Message#get + * @function + * @param {string} key Key + * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false` + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.get = function(key, noAssert) { + if (noAssert) + return this[key]; + var field = T._fieldsByName[key]; + if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: "+field.toString(true)); + return this[field.name]; + }; + + /** + * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}. + * @name ProtoBuf.Builder.Message#$get + * @function + * @param {string} key Key + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.$get = MessagePrototype.get; + + // Getters and setters + + for (var i=0; i} data Data payload + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @expose + */ + Message.encode = function(data, buffer, noVerify) { + return new Message(data).encode(buffer, noVerify); + }; + + /** + * Calculates the byte length of the message. + * @name ProtoBuf.Builder.Message#calculate + * @function + * @returns {number} Byte length + * @throws {Error} If the message cannot be calculated or if required fields are missing. + * @expose + */ + MessagePrototype.calculate = function() { + return T.calculate(this); + }; + + /** + * Encodes the varint32 length-delimited message. + * @name ProtoBuf.Builder.Message#encodeDelimited + * @function + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ByteBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeDelimited = function(buffer, noVerify) { + var isNew = false; + if (!buffer) + buffer = new ByteBuffer(), + isNew = true; + var enc = new ByteBuffer().LE(); + T.encode(this, enc, noVerify).flip(); + buffer.writeVarint32(enc.remaining()); + buffer.append(enc); + return isNew ? buffer.flip() : buffer; + }; + + /** + * Directly encodes the message to an ArrayBuffer. + * @name ProtoBuf.Builder.Message#encodeAB + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeAB = function() { + try { + return this.encode().toArrayBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer(); + throw(e); + } + }; + + /** + * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}. + * @name ProtoBuf.Builder.Message#toArrayBuffer + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB; + + /** + * Directly encodes the message to a node Buffer. + * @name ProtoBuf.Builder.Message#encodeNB + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are + * missing. The later still returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeNB = function() { + try { + return this.encode().toBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer(); + throw(e); + } + }; + + /** + * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}. + * @name ProtoBuf.Builder.Message#toBuffer + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBuffer = MessagePrototype.encodeNB; + + /** + * Directly encodes the message to a base64 encoded string. + * @name ProtoBuf.Builder.Message#encode64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encode64 = function() { + try { + return this.encode().toBase64(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBase64(); + throw(e); + } + }; + + /** + * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}. + * @name ProtoBuf.Builder.Message#toBase64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBase64 = MessagePrototype.encode64; + + /** + * Directly encodes the message to a hex encoded string. + * @name ProtoBuf.Builder.Message#encodeHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeHex = function() { + try { + return this.encode().toHex(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toHex(); + throw(e); + } + }; + + /** + * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}. + * @name ProtoBuf.Builder.Message#toHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toHex = MessagePrototype.encodeHex; + + /** + * Clones a message object or field value to a raw object. + * @param {*} obj Object to clone + * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field + * @returns {*} Cloned object + * @inner + */ + function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { + if (obj === null || typeof obj !== 'object') { + // Convert enum values to their respective names + if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { + var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj); + if (name !== null) + return name; + } + // Pass-through string, number, boolean, null... + return obj; + } + // Convert ByteBuffers to raw buffer or strings + if (ByteBuffer.isByteBuffer(obj)) + return binaryAsBase64 ? obj.toBase64() : obj.toBuffer(); + // Convert Longs to proper objects or strings + if (ProtoBuf.Long.isLong(obj)) + return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj); + var clone; + // Clone arrays + if (Array.isArray(obj)) { + clone = []; + obj.forEach(function(v, k) { + clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType); + }); + return clone; + } + clone = {}; + // Convert maps to objects + if (obj instanceof ProtoBuf.Map) { + var it = obj.entries(); + for (var e = it.next(); !e.done; e = it.next()) + clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType); + return clone; + } + // Everything else is a non-null object + var type = obj.$type, + field = undefined; + for (var i in obj) + if (obj.hasOwnProperty(i)) { + if (type && (field = type.getChild(i))) + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType); + else + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings); + } + return clone; + } + + /** + * Returns the message's raw payload. + * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false` + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @returns {Object.} Raw payload + * @expose + */ + MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) { + return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type); + }; + + /** + * Encodes a message to JSON. + * @returns {string} JSON string + * @expose + */ + MessagePrototype.encodeJSON = function() { + return JSON.stringify( + cloneRaw(this, + /* binary-as-base64 */ true, + /* longs-as-strings */ true, + this.$type + ) + ); + }; + + /** + * Decodes a message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decode + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {(number|string)=} length Message length. Defaults to decode all the remainig data. + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + * @see ProtoBuf.Builder.Message.decode64 + * @see ProtoBuf.Builder.Message.decodeHex + */ + Message.decode = function(buffer, length, enc) { + if (typeof length === 'string') + enc = length, + length = -1; + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + var le = buffer.littleEndian; + try { + var msg = T.decode(buffer.LE(), length); + buffer.LE(le); + return msg; + } catch (e) { + buffer.LE(le); + throw(e); + } + }; + + /** + * Decodes a varint32 length-delimited message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decodeDelimited + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeDelimited = function(buffer, enc) { + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + if (buffer.remaining() < 1) + return null; + var off = buffer.offset, + len = buffer.readVarint32(); + if (buffer.remaining() < len) { + buffer.offset = off; + return null; + } + try { + var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); + buffer.offset += len; + return msg; + } catch (err) { + buffer.offset += len; + throw err; + } + }; + + /** + * Decodes the message from the specified base64 encoded string. + * @name ProtoBuf.Builder.Message.decode64 + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decode64 = function(str) { + return Message.decode(str, "base64"); + }; + + /** + * Decodes the message from the specified hex encoded string. + * @name ProtoBuf.Builder.Message.decodeHex + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeHex = function(str) { + return Message.decode(str, "hex"); + }; + + /** + * Decodes the message from a JSON string. + * @name ProtoBuf.Builder.Message.decodeJSON + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are + * missing. + * @expose + */ + Message.decodeJSON = function(str) { + return new Message(JSON.parse(str)); + }; + + // Utility + + /** + * Returns a string representation of this Message. + * @name ProtoBuf.Builder.Message#toString + * @function + * @return {string} String representation as of ".Fully.Qualified.MessageName" + * @expose + */ + MessagePrototype.toString = function() { + return T.toString(); + }; + + // Properties + + /** + * Message options. + * @name ProtoBuf.Builder.Message.$options + * @type {Object.} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Message options. + * @name ProtoBuf.Builder.Message#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message.$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message#$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Message, '$options', { "value": T.buildOpt() }), + Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }), + Object.defineProperty(Message, "$type", { "value": T }), + Object.defineProperty(MessagePrototype, "$type", { "value": T }); + + return Message; + + })(ProtoBuf, this); + + // Static enums and prototyped sub-messages / cached collections + this._fields = []; + this._fieldsById = {}; + this._fieldsByName = {}; + this._oneofsByName = {}; + for (var i=0, k=this.children.length, child; i>> 3; + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + do tag = buf.readUint8(); + while ((tag & 0x80) === 0x80); + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buf.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + tag = buf.readVarint32(); // reads the varint + buf.offset += tag; // skips n bytes + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + skipTillGroupEnd(id, buf); + break; + case ProtoBuf.WIRE_TYPES.ENDGROUP: + if (id === expectedId) + return false; + else + throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)"); + case ProtoBuf.WIRE_TYPES.BITS32: + buf.offset += 4; + break; + default: + throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType); + } + return true; + } + + /** + * Decodes an encoded message and returns the decoded message. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number=} length Message length. Defaults to decode all remaining data. + * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group + * @return {ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded + * @expose + */ + MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { + if (typeof length !== 'number') + length = -1; + var start = buffer.offset, + msg = new (this.clazz)(), + tag, wireType, id, field; + while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) { + tag = buffer.readVarint32(); + wireType = tag & 0x07; + id = tag >>> 3; + if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) { + if (id !== expectedGroupEndId) + throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")"); + break; + } + if (!(field = this._fieldsById[id])) { + // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + buffer.readVarint32(); + break; + case ProtoBuf.WIRE_TYPES.BITS32: + buffer.offset += 4; + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buffer.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + var len = buffer.readVarint32(); + buffer.offset += len; + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + while (skipTillGroupEnd(id, buffer)) {} + break; + default: + throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType); + } + continue; + } + if (field.repeated && !field.options["packed"]) { + msg[field.name].push(field.decode(wireType, buffer)); + } else if (field.map) { + var keyval = field.decode(wireType, buffer); + msg[field.name].set(keyval[0], keyval[1]); + } else { + msg[field.name] = field.decode(wireType, buffer); + if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = msg[field.oneof.name]; // Virtual field references currently set field + if (currentField !== null && currentField !== field.name) + msg[currentField] = null; // Clear currently set field + msg[field.oneof.name] = field.name; // Point virtual field at this field + } + } + } + + // Check if all required fields are present and set default values for optional fields that are not + for (var i=0, k=this._fields.length; i=} options Options + * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { + T.call(this, builder, message, name); + + /** + * @override + */ + this.className = "Message.Field"; + + /** + * Message field required flag. + * @type {boolean} + * @expose + */ + this.required = rule === "required"; + + /** + * Message field repeated flag. + * @type {boolean} + * @expose + */ + this.repeated = rule === "repeated"; + + /** + * Message field map flag. + * @type {boolean} + * @expose + */ + this.map = rule === "map"; + + /** + * Message field key type. Type reference string if unresolved, protobuf + * type if resolved. Valid only if this.map === true, null otherwise. + * @type {string|{name: string, wireType: number}|null} + * @expose + */ + this.keyType = keytype || null; + + /** + * Message field type. Type reference string if unresolved, protobuf type if + * resolved. In a map field, this is the value type. + * @type {string|{name: string, wireType: number}} + * @expose + */ + this.type = type; + + /** + * Resolved type reference inside the global namespace. + * @type {ProtoBuf.Reflect.T|null} + * @expose + */ + this.resolvedType = null; + + /** + * Unique message field id. + * @type {number} + * @expose + */ + this.id = id; + + /** + * Message field options. + * @type {!Object.} + * @dict + * @expose + */ + this.options = options || {}; + + /** + * Default value. + * @type {*} + * @expose + */ + this.defaultValue = null; + + /** + * Enclosing OneOf. + * @type {?ProtoBuf.Reflect.Message.OneOf} + * @expose + */ + this.oneof = oneof || null; + + /** + * Syntax level of this definition (e.g., proto3). + * @type {string} + * @expose + */ + this.syntax = syntax || 'proto2'; + + /** + * Original field name. + * @type {string} + * @expose + */ + this.originalName = this.name; // Used to revert camelcase transformation on naming collisions + + /** + * Element implementation. Created in build() after types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.element = null; + + /** + * Key element implementation, for map fields. Created in build() after + * types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.keyElement = null; + + // Convert field names to camel case notation if the override is set + if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField)) + this.name = ProtoBuf.Util.toCamelCase(this.name); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field.prototype + * @inner + */ + var FieldPrototype = Field.prototype = Object.create(T.prototype); + + /** + * Builds the field. + * @override + * @expose + */ + FieldPrototype.build = function() { + this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name); + if (this.map) + this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name); + + // In proto3, fields do not have field presence, and every field is set to + // its type's default value ("", 0, 0.0, or false). + if (this.syntax === 'proto3' && !this.repeated && !this.map) + this.defaultValue = Element.defaultFieldValue(this.type); + + // Otherwise, default values are present when explicitly specified + else if (typeof this.options['default'] !== 'undefined') + this.defaultValue = this.verifyValue(this.options['default']); + }; + + /** + * Checks if the given value can be set for this field. + * @param {*} value Value to check + * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false. + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be set for this field + * @expose + */ + FieldPrototype.verifyValue = function(value, skipRepeated) { + skipRepeated = skipRepeated || false; + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + if (value === null) { // NULL values for optional fields + if (this.required) + fail(typeof value, "required"); + if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"]) + fail(typeof value, "proto3 field without field presence cannot be null"); + return null; + } + var i; + if (this.repeated && !skipRepeated) { // Repeated values as arrays + if (!Array.isArray(value)) + value = [value]; + var res = []; + for (i=0; i 0; + + case ProtoBuf.TYPES["bytes"]: + return value.remaining() > 0; + + case ProtoBuf.TYPES["enum"]: + return value !== 0; + + case ProtoBuf.TYPES["message"]: + return value !== null; + default: + return true; + } + }; + + /** + * Encodes the specified field value to the specified buffer. + * @param {*} value Verified field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @param {!ProtoBuf.Builder.Message} message Runtime message + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the field cannot be encoded + * @expose + */ + FieldPrototype.encode = function(value, buffer, message) { + if (this.type === null || typeof this.type !== 'object') + throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type); + if (value === null || (this.repeated && value.length == 0)) + return buffer; // Optional omitted + try { + if (this.repeated) { + var i; + // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire + // types) can be declared 'packed'." + if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { + // "All of the elements of the field are packed into a single key-value pair with wire type 2 + // (length-delimited). Each element is encoded the same way it would be normally, except without a + // tag preceding it." + buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1 + var start = buffer.offset; // Remember where the contents begin + for (i=0; i 1) { // We need to move the contents + var contents = buffer.slice(start, buffer.offset); + start += varintLen-1; + buffer.offset = start; + buffer.append(contents); + } + buffer.writeVarint32(len, start-varintLen); + } else { + // "If your message definition has repeated elements (without the [packed=true] option), the encoded + // message has zero or more key-value pairs with the same tag number" + for (i=0; i= 0) { + n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + ni = 0; + for (i=0; i= 0) { + if (!skipRepeated) { + nBytes = buffer.readVarint32(); + nBytes = buffer.offset + nBytes; // Limit + var values = []; + while (buffer.offset < nBytes) + values.push(this.decode(this.type.wireType, buffer, true)); + return values; + } + // Read the next value otherwise... + } + + // Handle maps. + if (this.map) { + // Read one (key, value) submessage, and return [key, value] + var key = Element.defaultFieldValue(this.keyType); + value = Element.defaultFieldValue(this.type); + + // Read the length + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + + // Get a sub-buffer of this key/value submessage + var msgbuf = buffer.clone(); + msgbuf.limit = msgbuf.offset + nBytes; + buffer.offset += nBytes; + + while (msgbuf.remaining() > 0) { + var tag = msgbuf.readVarint32(); + wireType = tag & 0x07; + var id = tag >>> 3; + if (id === 1) { + key = this.keyElement.decode(msgbuf, wireType, id); + } else if (id === 2) { + value = this.element.decode(msgbuf, wireType, id); + } else { + throw Error("Unexpected tag in map field key/value submessage"); + } + } + + return [key, value]; + } + + // Handle singular and non-packed repeated field values. + return this.element.decode(buffer, wireType, this.id); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field + * @expose + */ + Reflect.Message.Field = Field; + + /** + * Constructs a new Message ExtensionField. + * @exports ProtoBuf.Reflect.Message.ExtensionField + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} rule Rule, one of requried, optional, repeated + * @param {string} type Data type, e.g. int32 + * @param {string} name Field name + * @param {number} id Unique field id + * @param {!Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Message.Field + */ + var ExtensionField = function(builder, message, rule, type, name, id, options) { + Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); + + /** + * Extension reference. + * @type {!ProtoBuf.Reflect.Extension} + * @expose + */ + this.extension; + }; + + // Extends Field + ExtensionField.prototype = Object.create(Field.prototype); + + /** + * @alias ProtoBuf.Reflect.Message.ExtensionField + * @expose + */ + Reflect.Message.ExtensionField = ExtensionField; + + /** + * Constructs a new Message OneOf. + * @exports ProtoBuf.Reflect.Message.OneOf + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} name OneOf name + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var OneOf = function(builder, message, name) { + T.call(this, builder, message, name); + + /** + * Enclosed fields. + * @type {!Array.} + * @expose + */ + this.fields = []; + }; + + /** + * @alias ProtoBuf.Reflect.Message.OneOf + * @expose + */ + Reflect.Message.OneOf = OneOf; + + /** + * Constructs a new Enum. + * @exports ProtoBuf.Reflect.Enum + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object + * @param {string} name Enum name + * @param {Object.=} options Enum options + * @param {string?} syntax The syntax level (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Enum = function(builder, parent, name, options, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Enum"; + + /** + * Runtime enum object. + * @type {Object.|null} + * @expose + */ + this.object = null; + }; + + /** + * Gets the string name of an enum value. + * @param {!ProtoBuf.Builder.Enum} enm Runtime enum + * @param {number} value Enum value + * @returns {?string} Name or `null` if not present + * @expose + */ + Enum.getName = function(enm, value) { + var keys = Object.keys(enm); + for (var i=0, key; i} + * @expose + */ + EnumPrototype.build = function(rebuild) { + if (this.object && !rebuild) + return this.object; + var enm = new ProtoBuf.Builder.Enum(), + values = this.getChildren(Enum.Value); + for (var i=0, k=values.length; i=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Service = function(builder, root, name, options) { + Namespace.call(this, builder, root, name, options); + + /** + * @override + */ + this.className = "Service"; + + /** + * Built runtime service class. + * @type {?function(new:ProtoBuf.Builder.Service)} + */ + this.clazz = null; + }; + + /** + * @alias ProtoBuf.Reflect.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(Namespace.prototype); + + /** + * Builds the service and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Service + * @param {boolean=} rebuild Whether to rebuild or not + * @return {Function} Service class + * @throws {Error} If the message cannot be built + * @expose + */ + ServicePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Service class in its own scope + return this.clazz = (function(ProtoBuf, T) { + + /** + * Constructs a new runtime Service. + * @name ProtoBuf.Builder.Service + * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message + * @class Barebone of all runtime services. + * @constructor + * @throws {Error} If the service cannot be created + */ + var Service = function(rpcImpl) { + ProtoBuf.Builder.Service.call(this); + + /** + * Service implementation. + * @name ProtoBuf.Builder.Service#rpcImpl + * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} + * @expose + */ + this.rpcImpl = rpcImpl || function(name, msg, callback) { + // This is what a user has to implement: A function receiving the method name, the actual message to + // send (type checked) and the callback that's either provided with the error as its first + // argument or null and the actual response message. + setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async! + }; + }; + + /** + * @alias ProtoBuf.Builder.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); + + /** + * Asynchronously performs an RPC call using the given RPC implementation. + * @name ProtoBuf.Builder.Service.[Method] + * @function + * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + /** + * Asynchronously performs an RPC call using the instance's RPC implementation. + * @name ProtoBuf.Builder.Service#[Method] + * @function + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod); + for (var i=0; i} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Service options. + * @name ProtoBuf.Builder.Service#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service.$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service#$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Service, "$options", { "value": T.buildOpt() }), + Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }), + Object.defineProperty(Service, "$type", { "value": T }), + Object.defineProperty(ServicePrototype, "$type", { "value": T }); + + return Service; + + })(ProtoBuf, this); + }; + + /** + * @alias ProtoBuf.Reflect.Service + * @expose + */ + Reflect.Service = Service; + + /** + * Abstract service method. + * @exports ProtoBuf.Reflect.Service.Method + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Method = function(builder, svc, name, options) { + T.call(this, builder, svc, name); + + /** + * @override + */ + this.className = "Service.Method"; + + /** + * Options. + * @type {Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Reflect.Service.Method.prototype + * @inner + */ + var MethodPrototype = Method.prototype = Object.create(T.prototype); + + /** + * Builds the method's '$options' property. + * @name ProtoBuf.Reflect.Service.Method#buildOpt + * @function + * @return {Object.} + */ + MethodPrototype.buildOpt = NamespacePrototype.buildOpt; + + /** + * @alias ProtoBuf.Reflect.Service.Method + * @expose + */ + Reflect.Service.Method = Method; + + /** + * RPC service method. + * @exports ProtoBuf.Reflect.Service.RPCMethod + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {string} request Request message name + * @param {string} response Response message name + * @param {boolean} request_stream Whether requests are streamed + * @param {boolean} response_stream Whether responses are streamed + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Service.Method + */ + var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) { + Method.call(this, builder, svc, name, options); + + /** + * @override + */ + this.className = "Service.RPCMethod"; + + /** + * Request message name. + * @type {string} + * @expose + */ + this.requestName = request; + + /** + * Response message name. + * @type {string} + * @expose + */ + this.responseName = response; + + /** + * Whether requests are streamed + * @type {bool} + * @expose + */ + this.requestStream = request_stream; + + /** + * Whether responses are streamed + * @type {bool} + * @expose + */ + this.responseStream = response_stream; + + /** + * Resolved request message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedRequestType = null; + + /** + * Resolved response message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedResponseType = null; + }; + + // Extends Method + RPCMethod.prototype = Object.create(Method.prototype); + + /** + * @alias ProtoBuf.Reflect.Service.RPCMethod + * @expose + */ + Reflect.Service.RPCMethod = RPCMethod; + + return Reflect; + + })(ProtoBuf); + + /** + * @alias ProtoBuf.Builder + * @expose + */ + ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { + "use strict"; + + /** + * Constructs a new Builder. + * @exports ProtoBuf.Builder + * @class Provides the functionality to build protocol messages. + * @param {Object.=} options Options + * @constructor + */ + var Builder = function(options) { + + /** + * Namespace. + * @type {ProtoBuf.Reflect.Namespace} + * @expose + */ + this.ns = new Reflect.Namespace(this, null, ""); // Global namespace + + /** + * Namespace pointer. + * @type {ProtoBuf.Reflect.T} + * @expose + */ + this.ptr = this.ns; + + /** + * Resolved flag. + * @type {boolean} + * @expose + */ + this.resolved = false; + + /** + * The current building result. + * @type {Object.|null} + * @expose + */ + this.result = null; + + /** + * Imported files. + * @type {Array.} + * @expose + */ + this.files = {}; + + /** + * Import root override. + * @type {?string} + * @expose + */ + this.importRoot = null; + + /** + * Options. + * @type {!Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Builder.prototype + * @inner + */ + var BuilderPrototype = Builder.prototype; + + // ----- Definition tests ----- + + /** + * Tests if a definition most likely describes a message. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessage = function(def) { + // Messages require a string name + if (typeof def["name"] !== 'string') + return false; + // Messages do not contain values (enum) or rpc methods (service) + if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a message field. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessageField = function(def) { + // Message fields require a string rule, name and type and an id + if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an enum. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isEnum = function(def) { + // Enums require a string name + if (typeof def["name"] !== 'string') + return false; + // Enums require at least one value + if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a service. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isService = function(def) { + // Services require a string name and an rpc object + if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"]) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an extended message + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isExtend = function(def) { + // Extends rquire a string ref + if (typeof def["ref"] !== 'string') + return false; + return true; + }; + + // ----- Building ----- + + /** + * Resets the pointer to the root namespace. + * @returns {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.reset = function() { + this.ptr = this.ns; + return this; + }; + + /** + * Defines a namespace on top of the current pointer position and places the pointer on it. + * @param {string} namespace + * @return {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.define = function(namespace) { + if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace)) + throw Error("illegal namespace: "+namespace); + namespace.split(".").forEach(function(part) { + var ns = this.ptr.getChild(part); + if (ns === null) // Keep existing + this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part)); + this.ptr = ns; + }, this); + return this; + }; + + /** + * Creates the specified definitions at the current pointer position. + * @param {!Array.} defs Messages, enums or services to create + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If a message definition is invalid + * @expose + */ + BuilderPrototype.create = function(defs) { + if (!defs) + return this; // Nothing to create + if (!Array.isArray(defs)) + defs = [defs]; + else { + if (defs.length === 0) + return this; + defs = defs.slice(); + } + + // It's quite hard to keep track of scopes and memory here, so let's do this iteratively. + var stack = [defs]; + while (stack.length > 0) { + defs = stack.pop(); + + if (!Array.isArray(defs)) // Stack always contains entire namespaces + throw Error("not a valid namespace: "+JSON.stringify(defs)); + + while (defs.length > 0) { + var def = defs.shift(); // Namespaces always contain an array of messages, enums and services + + if (Builder.isMessage(def)) { + var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]); + + // Create OneOfs + var oneofs = {}; + if (def["oneofs"]) + Object.keys(def["oneofs"]).forEach(function(name) { + obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name)); + }, this); + + // Create fields + if (def["fields"]) + def["fields"].forEach(function(fld) { + if (obj.getChild(fld["id"]|0) !== null) + throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']); + if (fld["options"] && typeof fld["options"] !== 'object') + throw Error("illegal field options in "+obj.name+"#"+fld["name"]); + var oneof = null; + if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]])) + throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]); + fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]); + if (oneof) + oneof.fields.push(fld); + obj.addChild(fld); + }, this); + + // Push children to stack + var subObj = []; + if (def["enums"]) + def["enums"].forEach(function(enm) { + subObj.push(enm); + }); + if (def["messages"]) + def["messages"].forEach(function(msg) { + subObj.push(msg); + }); + if (def["services"]) + def["services"].forEach(function(svc) { + subObj.push(svc); + }); + + // Set extension ranges + if (def["extensions"]) { + if (typeof def["extensions"][0] === 'number') // pre 5.0.1 + obj.extensions = [ def["extensions"] ]; + else + obj.extensions = def["extensions"]; + } + + // Create on top of current namespace + this.ptr.addChild(obj); + if (subObj.length > 0) { + stack.push(defs); // Push the current level back + defs = subObj; // Continue processing sub level + subObj = null; + this.ptr = obj; // And move the pointer to this namespace + obj = null; + continue; + } + subObj = null; + + } else if (Builder.isEnum(def)) { + + obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]); + def["values"].forEach(function(val) { + obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isService(def)) { + + obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]); + Object.keys(def["rpc"]).forEach(function(name) { + var mtd = def["rpc"][name]; + obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isExtend(def)) { + + obj = this.ptr.resolve(def["ref"], true); + if (obj) { + def["fields"].forEach(function(fld) { + if (obj.getChild(fld['id']|0) !== null) + throw Error("duplicate extended field id in "+obj.name+": "+fld['id']); + // Check if field id is allowed to be extended + if (obj.extensions) { + var valid = false; + obj.extensions.forEach(function(range) { + if (fld["id"] >= range[0] && fld["id"] <= range[1]) + valid = true; + }); + if (!valid) + throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)"); + } + // Convert extension field names to camel case notation if the override is set + var name = fld["name"]; + if (this.options['convertFieldsToCamelCase']) + name = ProtoBuf.Util.toCamelCase(name); + // see #161: Extensions use their fully qualified name as their runtime key and... + var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]); + // ...are added on top of the current namespace as an extension which is used for + // resolving their type later on (the extension always keeps the original name to + // prevent naming collisions) + var ext = new Reflect.Extension(this, this.ptr, fld["name"], field); + field.extension = ext; + this.ptr.addChild(ext); + obj.addChild(field); + }, this); + + } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions + throw Error("extended message "+def["ref"]+" is not defined"); + + } else + throw Error("not a valid definition: "+JSON.stringify(def)); + + def = null; + obj = null; + } + // Break goes here + defs = null; + this.ptr = this.ptr.parent; // Namespace done, continue at parent + } + this.resolved = false; // Require re-resolve + this.result = null; // Require re-build + return this; + }; + + /** + * Propagates syntax to all children. + * @param {!Object} parent + * @inner + */ + function propagateSyntax(parent) { + if (parent['messages']) { + parent['messages'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + propagateSyntax(child); + }); + } + if (parent['enums']) { + parent['enums'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + }); + } + } + + /** + * Imports another definition into this builder. + * @param {Object.} json Parsed import + * @param {(string|{root: string, file: string})=} filename Imported file name + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If the definition or file cannot be imported + * @expose + */ + BuilderPrototype["import"] = function(json, filename) { + var delim = '/'; + + // Make sure to skip duplicate imports + + if (typeof filename === 'string') { + + if (ProtoBuf.Util.IS_NODE) + filename = require("path")['resolve'](filename); + if (this.files[filename] === true) + return this.reset(); + this.files[filename] = true; + + } else if (typeof filename === 'object') { // Object with root, file. + + var root = filename.root; + if (ProtoBuf.Util.IS_NODE) + root = require("path")['resolve'](root); + if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0) + delim = '\\'; + var fname; + if (ProtoBuf.Util.IS_NODE) + fname = require("path")['join'](root, filename.file); + else + fname = root + delim + filename.file; + if (this.files[fname] === true) + return this.reset(); + this.files[fname] = true; + } + + // Import imports + + if (json['imports'] && json['imports'].length > 0) { + var importRoot, + resetRoot = false; + + if (typeof filename === 'object') { // If an import root is specified, override + + this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards + importRoot = this.importRoot; + filename = filename["file"]; + if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) + delim = '\\'; + + } else if (typeof filename === 'string') { + + if (this.importRoot) // If import root is overridden, use it + importRoot = this.importRoot; + else { // Otherwise compute from filename + if (filename.indexOf("/") >= 0) { // Unix + importRoot = filename.replace(/\/[^\/]*$/, ""); + if (/* /file.proto */ importRoot === "") + importRoot = "/"; + } else if (filename.indexOf("\\") >= 0) { // Windows + importRoot = filename.replace(/\\[^\\]*$/, ""); + delim = '\\'; + } else + importRoot = "."; + } + + } else + importRoot = null; + + for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned. + * @returns {!ProtoBuf.Builder.Message|!Object.} + * @throws {Error} If a type could not be resolved + * @expose + */ + BuilderPrototype.build = function(path) { + this.reset(); + if (!this.resolved) + this.resolveAll(), + this.resolved = true, + this.result = null; // Require re-build + if (this.result === null) // (Re-)Build + this.result = this.ns.build(); + if (!path) + return this.result; + var part = typeof path === 'string' ? path.split(".") : path, + ptr = this.result; // Build namespace pointer (no hasChild etc.) + for (var i=0; i=} contents Initial contents + * @constructor + */ + var Map = function(field, contents) { + if (!field.map) + throw Error("field is not a map"); + + /** + * The field corresponding to this map. + * @type {!ProtoBuf.Reflect.Field} + */ + this.field = field; + + /** + * Element instance corresponding to key type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax); + + /** + * Element instance corresponding to value type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax); + + /** + * Internal map: stores mapping of (string form of key) -> (key, value) + * pair. + * + * We provide map semantics for arbitrary key types, but we build on top + * of an Object, which has only string keys. In order to avoid the need + * to convert a string key back to its native type in many situations, + * we store the native key value alongside the value. Thus, we only need + * a one-way mapping from a key type to its string form that guarantees + * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1 + * === K2). + * + * @type {!Object} + */ + this.map = {}; + + /** + * Returns the number of elements in the map. + */ + Object.defineProperty(this, "size", { + get: function() { return Object.keys(this.map).length; } + }); + + // Fill initial contents from a raw object. + if (contents) { + var keys = Object.keys(contents); + for (var i = 0; i < keys.length; i++) { + var key = this.keyElem.valueFromString(keys[i]); + var val = this.valueElem.verifyValue(contents[keys[i]]); + this.map[this.keyElem.valueToString(key)] = + { key: key, value: val }; + } + } + }; + + var MapPrototype = Map.prototype; + + /** + * Helper: return an iterator over an array. + * @param {!Array<*>} arr the array + * @returns {!Object} an iterator + * @inner + */ + function arrayIterator(arr) { + var idx = 0; + return { + next: function() { + if (idx < arr.length) + return { done: false, value: arr[idx++] }; + return { done: true }; + } + } + } + + /** + * Clears the map. + */ + MapPrototype.clear = function() { + this.map = {}; + }; + + /** + * Deletes a particular key from the map. + * @returns {boolean} Whether any entry with this key was deleted. + */ + MapPrototype["delete"] = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + var hadKey = keyValue in this.map; + delete this.map[keyValue]; + return hadKey; + }; + + /** + * Returns an iterator over [key, value] pairs in the map. + * @returns {Object} The iterator + */ + MapPrototype.entries = function() { + var entries = []; + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + entries.push([(entry=this.map[strKeys[i]]).key, entry.value]); + return arrayIterator(entries); + }; + + /** + * Returns an iterator over keys in the map. + * @returns {Object} The iterator + */ + MapPrototype.keys = function() { + var keys = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + keys.push(this.map[strKeys[i]].key); + return arrayIterator(keys); + }; + + /** + * Returns an iterator over values in the map. + * @returns {!Object} The iterator + */ + MapPrototype.values = function() { + var values = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + values.push(this.map[strKeys[i]].value); + return arrayIterator(values); + }; + + /** + * Iterates over entries in the map, calling a function on each. + * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments. + * @param {Object=} thisArg The `this` value for the callback + */ + MapPrototype.forEach = function(cb, thisArg) { + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this); + }; + + /** + * Sets a key in the map to the given value. + * @param {*} key The key + * @param {*} value The value + * @returns {!ProtoBuf.Map} The map instance + */ + MapPrototype.set = function(key, value) { + var keyValue = this.keyElem.verifyValue(key); + var valValue = this.valueElem.verifyValue(value); + this.map[this.keyElem.valueToString(keyValue)] = + { key: keyValue, value: valValue }; + return this; + }; + + /** + * Gets the value corresponding to a key in the map. + * @param {*} key The key + * @returns {*|undefined} The value, or `undefined` if key not present + */ + MapPrototype.get = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + if (!(keyValue in this.map)) + return undefined; + return this.map[keyValue].value; + }; + + /** + * Determines whether the given key is present in the map. + * @param {*} key The key + * @returns {boolean} `true` if the key is present + */ + MapPrototype.has = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + return (keyValue in this.map); + }; + + return Map; + })(ProtoBuf, ProtoBuf.Reflect); + + + /** + * Constructs a new empty Builder. + * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf + * @return {!ProtoBuf.Builder} Builder + * @expose + */ + ProtoBuf.newBuilder = function(options) { + options = options || {}; + if (typeof options['convertFieldsToCamelCase'] === 'undefined') + options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase; + if (typeof options['populateAccessors'] === 'undefined') + options['populateAccessors'] = ProtoBuf.populateAccessors; + return new ProtoBuf.Builder(options); + }; + + /** + * Loads a .json definition and returns the Builder. + * @param {!*|string} json JSON definition + * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.loadJson = function(json, builder, filename) { + if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) + filename = builder, + builder = null; + if (!builder || typeof builder !== 'object') + builder = ProtoBuf.newBuilder(); + if (typeof json === 'string') + json = JSON.parse(json); + builder["import"](json, filename); + builder.resolveAll(); + return builder; + }; + + /** + * Loads a .json file and returns the Builder. + * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.loadJsonFile = function(filename, callback, builder) { + if (callback && typeof callback === 'object') + builder = callback, + callback = null; + else if (!callback || typeof callback !== 'function') + callback = null; + if (callback) + return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { + if (contents === null) { + callback(Error("Failed to fetch file")); + return; + } + try { + callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); + } catch (e) { + callback(e); + } + }); + var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); + return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); + }; + + return ProtoBuf; +}); diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.min.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.min.js new file mode 100644 index 0000000..f2503a6 --- /dev/null +++ b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf-light.min.js @@ -0,0 +1,94 @@ +/* + protobuf.js (c) 2013 Daniel Wirtz + Released under the Apache License, Version 2.0 + see: https://github.com/dcodeIO/protobuf.js for details +*/ +var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,p,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[p]=d.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; +$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++}; +$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var p=0;return $jscomp.iteratorPrototype(function(){return p]/g,RULE:/^(?:required|optional|repeated|map)$/, +TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, +BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g};d.Reflect=function(c){function d(a,g){if(a&&"number"===typeof a.low&&"number"===typeof a.high&&"boolean"===typeof a.unsigned&&a.low===a.low&&a.high===a.high)return new c.Long(a.low,a.high,"undefined"=== +typeof g?a.unsigned:g);if("string"===typeof a)return c.Long.fromString(a,g||!1,10);if("number"===typeof a)return c.Long.fromNumber(a,g||!1);throw Error("not convertible to Long");}function z(a,g){var h=g.readVarint32(),b=h&7,h=h>>>3;switch(b){case c.WIRE_TYPES.VARINT:do h=g.readUint8();while(128===(h&128));break;case c.WIRE_TYPES.BITS64:g.offset+=8;break;case c.WIRE_TYPES.LDELIM:h=g.readVarint32();g.offset+=h;break;case c.WIRE_TYPES.STARTGROUP:z(h,g);break;case c.WIRE_TYPES.ENDGROUP:if(h===a)return!1; +throw Error("Illegal GROUPEND after unknown group: "+h+" ("+a+" expected)");case c.WIRE_TYPES.BITS32:g.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+a+": "+b);}return!0}var r={},k=function(a,g,c){this.builder=a;this.parent=g;this.name=c},l=k.prototype;l.fqn=function(){var a=this.name,g=this;do{g=g.parent;if(null==g)break;a=g.name+"."+a}while(1);return a};l.toString=function(a){return(a?this.className+" ":"")+this.fqn()};l.build=function(){throw Error(this.toString(!0)+ +" cannot be built directly");};r.T=k;var b=function(a,g,c,b,e){k.call(this,a,g,c);this.className="Namespace";this.children=[];this.options=b||{};this.syntax=e||"proto2"},l=b.prototype=Object.create(k.prototype);l.getChildren=function(a){a=a||null;if(null==a)return this.children.slice();for(var g=[],c=0,b=this.children.length;cc.MAP_KEY_TYPES.indexOf(a))throw Error("Invalid map key type: "+a.name);},f=m.prototype;m.defaultFieldValue=function(a){"string"===typeof a&&(a=c.TYPES[a]);if("undefined"===typeof a.defaultValue)throw Error("default value for type "+a.name+" is not supported");return a==c.TYPES.bytes?new e(0):a.defaultValue};f.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"};f.verifyValue=function(a){function g(a, +c){throw Error("Illegal value for "+b.toString(!0)+" of type "+b.type.name+": "+a+" ("+c+")");}var b=this;switch(this.type){case c.TYPES.int32:case c.TYPES.sint32:case c.TYPES.sfixed32:return("number"!==typeof a||a===a&&0!==a%1)&&g(typeof a,"not an integer"),4294967295a?a>>>0:a;case c.TYPES.int64:case c.TYPES.sint64:case c.TYPES.sfixed64:if(c.Long)try{return d(a,!1)}catch(w){g(typeof a, +w.message)}else g(typeof a,"requires Long.js");case c.TYPES.uint64:case c.TYPES.fixed64:if(c.Long)try{return d(a,!0)}catch(w){g(typeof a,w.message)}else g(typeof a,"requires Long.js");case c.TYPES.bool:return"boolean"!==typeof a&&g(typeof a,"not a boolean"),a;case c.TYPES["float"]:case c.TYPES["double"]:return"number"!==typeof a&&g(typeof a,"not a number"),a;case c.TYPES.string:return"string"===typeof a||a&&a instanceof String||g(typeof a,"not a string"),""+a;case c.TYPES.bytes:return e.isByteBuffer(a)? +a:e.wrap(a,"base64");case c.TYPES["enum"]:for(var v=this.resolvedType.getChildren(c.Reflect.Enum.Value),q=0;qa)&&g(typeof a,"not in range for uint32"),a;g(a,"not a valid enum value");case c.TYPES.group:case c.TYPES.message:a&&"object"===typeof a||g(typeof a,"object expected");if(a instanceof this.resolvedType.clazz)return a;if(a instanceof +c.Builder.Message){var v={},q;for(q in a)a.hasOwnProperty(q)&&(v[q]=a[q]);a=v}return new this.resolvedType.clazz(a)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+a+" (undefined type "+this.type+")");};f.calculateLength=function(a,g){if(null===g)return 0;var b;switch(this.type){case c.TYPES.int32:return 0>g?e.calculateVarint64(g):e.calculateVarint32(g);case c.TYPES.uint32:return e.calculateVarint32(g);case c.TYPES.sint32:return e.calculateVarint32(e.zigZagEncode32(g));case c.TYPES.fixed32:case c.TYPES.sfixed32:case c.TYPES["float"]:return 4; +case c.TYPES.int64:case c.TYPES.uint64:return e.calculateVarint64(g);case c.TYPES.sint64:return e.calculateVarint64(e.zigZagEncode64(g));case c.TYPES.fixed64:case c.TYPES.sfixed64:return 8;case c.TYPES.bool:return 1;case c.TYPES["enum"]:return e.calculateVarint32(g);case c.TYPES["double"]:return 8;case c.TYPES.string:return b=e.calculateUTF8Bytes(g),e.calculateVarint32(b)+b;case c.TYPES.bytes:if(0>g.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+g.remaining()+" bytes remaining"); +return e.calculateVarint32(g.remaining())+g.remaining();case c.TYPES.message:return b=this.resolvedType.calculate(g),e.calculateVarint32(b)+b;case c.TYPES.group:return b=this.resolvedType.calculate(g),b+e.calculateVarint32(a<<3|c.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+g+" (unknown type)");};f.encodeValue=function(a,g,b){if(null===g)return b;switch(this.type){case c.TYPES.int32:0>g?b.writeVarint64(g):b.writeVarint32(g);break;case c.TYPES.uint32:b.writeVarint32(g); +break;case c.TYPES.sint32:b.writeVarint32ZigZag(g);break;case c.TYPES.fixed32:b.writeUint32(g);break;case c.TYPES.sfixed32:b.writeInt32(g);break;case c.TYPES.int64:case c.TYPES.uint64:b.writeVarint64(g);break;case c.TYPES.sint64:b.writeVarint64ZigZag(g);break;case c.TYPES.fixed64:b.writeUint64(g);break;case c.TYPES.sfixed64:b.writeInt64(g);break;case c.TYPES.bool:"string"===typeof g?b.writeVarint32("false"===g.toLowerCase()?0:!!g):b.writeVarint32(g?1:0);break;case c.TYPES["enum"]:b.writeVarint32(g); +break;case c.TYPES["float"]:b.writeFloat32(g);break;case c.TYPES["double"]:b.writeFloat64(g);break;case c.TYPES.string:b.writeVString(g);break;case c.TYPES.bytes:if(0>g.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+g.remaining()+" bytes remaining");a=g.offset;b.writeVarint32(g.remaining());b.append(g);g.offset=a;break;case c.TYPES.message:a=(new e).LE();this.resolvedType.encode(g,a);b.writeVarint32(a.offset);b.append(a.flip());break;case c.TYPES.group:this.resolvedType.encode(g, +b);b.writeVarint32(a<<3|c.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+g+" (unknown type)");}return b};f.decode=function(a,b,e){if(b!=this.type.wireType)throw Error("Unexpected wire type for element");switch(this.type){case c.TYPES.int32:return a.readVarint32()|0;case c.TYPES.uint32:return a.readVarint32()>>>0;case c.TYPES.sint32:return a.readVarint32ZigZag()|0;case c.TYPES.fixed32:return a.readUint32()>>>0;case c.TYPES.sfixed32:return a.readInt32()| +0;case c.TYPES.int64:return a.readVarint64();case c.TYPES.uint64:return a.readVarint64().toUnsigned();case c.TYPES.sint64:return a.readVarint64ZigZag();case c.TYPES.fixed64:return a.readUint64();case c.TYPES.sfixed64:return a.readInt64();case c.TYPES.bool:return!!a.readVarint32();case c.TYPES["enum"]:return a.readVarint32();case c.TYPES["float"]:return a.readFloat();case c.TYPES["double"]:return a.readDouble();case c.TYPES.string:return a.readVString();case c.TYPES.bytes:e=a.readVarint32();if(a.remaining()< +e)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+e+" required but got only "+a.remaining());b=a.clone();b.limit=b.offset+e;a.offset+=e;return b;case c.TYPES.message:return e=a.readVarint32(),this.resolvedType.decode(a,e);case c.TYPES.group:return this.resolvedType.decode(a,-1,e)}throw Error("[INTERNAL] Illegal decode type");};f.valueFromString=function(a){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case c.TYPES.int32:case c.TYPES.sint32:case c.TYPES.sfixed32:case c.TYPES.uint32:case c.TYPES.fixed32:return this.verifyValue(parseInt(a)); +case c.TYPES.int64:case c.TYPES.sint64:case c.TYPES.sfixed64:case c.TYPES.uint64:case c.TYPES.fixed64:return this.verifyValue(a);case c.TYPES.bool:return"true"===a;case c.TYPES.string:return this.verifyValue(a);case c.TYPES.bytes:return e.fromBinary(a)}};f.valueToString=function(a){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===c.TYPES.bytes?a.toString("binary"):a.toString()};r.Element=m;var u=function(a,c,e,d,q,f){b.call(this,a,c,e,d,f);this.className= +"Message";this.extensions=void 0;this.clazz=null;this.isGroup=!!q;this._fieldsByName=this._fieldsById=this._fields=null},f=u.prototype=Object.create(b.prototype);f.build=function(a){if(this.clazz&&!a)return this.clazz;a=function(a,c){function b(c,g,f,d){if(null===c||"object"!==typeof c){if(d&&d instanceof a.Reflect.Enum){var h=a.Reflect.Enum.getName(d.object,c);if(null!==h)return h}return c}if(e.isByteBuffer(c))return g?c.toBase64():c.toBuffer();if(a.Long.isLong(c))return f?c.toString():a.Long.fromValue(c); +var n;if(Array.isArray(c))return n=[],c.forEach(function(a,c){n[c]=b(a,g,f,d)}),n;n={};if(c instanceof a.Map){for(var h=c.entries(),m=h.next();!m.done;m=h.next())n[c.keyElem.valueToString(m.value[0])]=b(m.value[1],g,f,c.valueElem.resolvedType);return n}var h=c.$type,m=void 0,q;for(q in c)c.hasOwnProperty(q)&&(h&&(m=h.getChild(q))?n[q]=b(c[q],g,f,m.resolvedType):n[q]=b(c[q],g,f));return n}var g=c.getChildren(a.Reflect.Message.Field),d=c.getChildren(a.Reflect.Message.OneOf),f=function(b,h){a.Builder.Message.call(this); +for(var n=0,m=d.length;na.remaining())return null;var g=a.offset, +f=a.readVarint32();if(a.remaining()>>3;if(h===c.WIRE_TYPES.ENDGROUP){if(m!==f)throw Error("Illegal group end indicator for "+ +this.toString(!0)+": "+m+" ("+(f?f+" expected":"not a group")+")");break}if(d=this._fieldsById[m])d.repeated&&!d.options.packed?e[d.name].push(d.decode(h,a)):d.map?(h=d.decode(h,a),e[d.name].set(h[0],h[1])):(e[d.name]=d.decode(h,a),d.oneof&&(h=e[d.oneof.name],null!==h&&h!==d.name&&(e[h]=null),e[d.oneof.name]=d.name));else switch(h){case c.WIRE_TYPES.VARINT:a.readVarint32();break;case c.WIRE_TYPES.BITS32:a.offset+=4;break;case c.WIRE_TYPES.BITS64:a.offset+=8;break;case c.WIRE_TYPES.LDELIM:d=a.readVarint32(); +a.offset+=d;break;case c.WIRE_TYPES.STARTGROUP:for(;z(m,a););break;default:throw Error("Illegal wire type for unknown field "+m+" in "+this.toString(!0)+"#decode: "+h);}}a=0;for(b=this._fields.length;a>>=3,1===b)g=this.keyElement.decode(d,a,b);else if(2===b)f= +this.element.decode(d,a,b);else throw Error("Unexpected tag in map field key/value submessage");return[g,f]}return this.element.decode(b,a,this.id)};r.Message.Field=p;f=function(a,b,c,f,d,e,m){p.call(this,a,b,c,null,f,d,e,m)};f.prototype=Object.create(p.prototype);r.Message.ExtensionField=f;r.Message.OneOf=function(a,b,c){k.call(this,a,b,c);this.fields=[]};var x=function(a,c,f,d,e){b.call(this,a,c,f,d,e);this.className="Enum";this.object=null};x.getName=function(a,b){for(var c=Object.keys(a),f=0, +g;f=a[0]&&b.id<=a[1]&&(f=!0)});if(!f)throw Error("illegal extended field id in "+l.name+": "+b.id+" (not within valid ranges)");}var d=b.name;this.options.convertFieldsToCamelCase&&(d=c.Util.toCamelCase(d));var d=new e.Message.ExtensionField(this,l,b.rule,b.type,this.ptr.fqn()+"."+d,b.id,b.options), +a=new e.Extension(this,this.ptr,b.name,d);d.extension=a;this.ptr.addChild(a);l.addChild(d)},this);else{if(!/\.?google\.protobuf\./.test(f.ref))throw Error("extended message "+f.ref+" is not defined");}else throw Error("not a valid definition: "+JSON.stringify(f));l=f=null}b=null;this.ptr=this.ptr.parent}this.resolved=!1;this.result=null;return this};l["import"]=function(b,d){var f="/";if("string"===typeof d){c.Util.IS_NODE&&(d=require("path").resolve(d));if(!0===this.files[d])return this.reset(); +this.files[d]=!0}else if("object"===typeof d){var e=d.root;c.Util.IS_NODE&&(e=require("path").resolve(e));if(0<=e.indexOf("\\")||0<=d.file.indexOf("\\"))f="\\";e=c.Util.IS_NODE?require("path").join(e,d.file):e+f+d.file;if(!0===this.files[e])return this.reset();this.files[e]=!0}if(b.imports&&0UYI6X*JpFgt#XsXep&#ZIWfPw7a`I4ztO^v;Abc z%TS(O?3QU5C37vH8407b@xyN8Gns4O{gndr%zc258SOr-R*vYh13C(0`fd*W^X%T$ zM~m3cU|rpHv-=rMM%sn<7xgn0Fr;a(uK&I(=Nr_TS%LWwj*P$_(`>m6?389^Hkl`P zT1@Y>Ye3(h&y%^K_pc7LAfc%iCz+NmX0v3TX)q}R9%v*EVE^p9t(y*Qy2tZ5xwqM# zk;YaF`UEwlPJ<3+LpQKLlW0NBV#k2@b(DA{atm6`hdIp_^H|68!2JYzQ||vRjDzH^ z)#9J7>(UbQCL{Zb_tsejA($e~T@ilUcY!aqs4tDj&o0E(4n|GJ}S7#qw zo%i0P_fs#4Zgi(1;len~u2^reAM;`RXq6b7gDjUuZGTQHZGAaT)pu<+HUIC2?s70*@KZ!@-crhnlM7zz7bvF+)`JD-Ox3vEXmkFYieBu(e zS`|XJotGsuq2N)D6?r>@ldmi+Ir2{K#8@YCc0}!n#^Y?#dkB&kHnb-;1ghI^4_95$ z-2s}*5>Umh5VU!3APLlci0PLM^^p#?pY_mPrx+Qyl3S$}_P9!Gxh$!f#QAETOxX#$ zWjpy8%~}|z8Hs%qrK@Zn#$&W@Z5I@ViFV+2EMIJ_L^GP+oWuN}GB;?q1^o}4)iWcr z=pY-KmN=pexV89oT4pYMHV&+*%B$pJd>hfW4O)dJA?0JiQvfJy`| zeq8~wK{0RW_|Q#<&di;GZ+B)**Ovx{o`vm5n zu=(c7Tw~dct6=~-=L98KmqPPAiN~-8ek_-$WzhFq|MKeW;;pOyXm{)b9eRF0yX@aw z|M9MW#gP6fS^vN2! zbq5EAVRW~42|6N+DEp1sn$F5vC>R!h2Suu&NdFEBnDgwgw2fzn--3XPNRNNmfA%jg zq!(h_D=;tqA?o)E?o`2@J_UEcO(8 zBHtiuZ9>8IMn$3Puo2MZG~Wp}z6Aqn`^p-HUuaNBm}qX>%)$QpW-3_HzlVm+Do$NA zA7O0c=`vNppFVAYr;3$6iV~9LQo&o_#sHnhi)oI5HNH*Pr!-B;m`V(y`R!6Mo+pc$ z#KIbza1_?N1`qm*H^=X8e(nDuZ1X@^SDRTfOSaNVQ^-%=u~5h5aHE8cnezf$xhc+B z!B%QkhtVb!lbL1~W2j~5BhF55-kiN<9uB`Ae{g?1c=r6K&d+<;1)=C?2uxpvGz!w| zn0?VvoZ@w9oNKTpzR zl$E9qt-wV=wI~EI^vD-kh(j@V$>#Tv`S_5FK!W9y%%2#aOiVJeFkaA=H>c#&3KFDd zAWCeaw5Bpc3zZrh4Ioa6Hb{iYPA~cora2uu>zoC+|51Y^%?aiBp%bUj32u0C$`=DD+B;u z?{_-bhwux~qf!HoM>y;*#+k~pQ;ur@GP?Lam&c7wbgHY-aZQ{sS+^Ft8qEe}}# zh#s{mt+Q`uCEHX8NKr6=X~0IG8oM{ffb4ud-uZKA?vBgCR7&mu-TN723$r199rM&AB~UZ(TgEqzkGk*@9zHF=yioq2g_uJ z%aLda1X18xu$+>a`Q5J7K*P*|c_6lAo_EPS#*#aZCHF5&X7`ue{4cqeSPEaVls;!E z+`&@1jV1bnC1>!G*?(O2?eQC2Rq*6yD8F=eejfe+<4DzM|5X7}3vtOHfb@@cuO5}j z1~-f$npgj-Ald-iMxx)pIq6>l;7$)f2YWCuV57^PVunj$(ouA;- z;4lWD=BRqcpihT`_Rg@!dfH~s1m2F8F^SE5nVZx8OHPxrPzm6d{s#b9TetwYczMkL z7#&6Tt8?sr3Rz{U8YdSQ=bWHyz5p>HplL7=T4$#hycoe<(oqC1RIv~8yA~M48nZ$n0W$;J=+=$IL&h z+fQQVCXj{tqj@srm0;ZPa@pLo_Bwp-`rc~hzGXmiuIVTt0|p2pWDLQAX<4G-MDSg! zoY7x7qtVSy+%fYXzmYk!Yldlg?xgjTHE|~|Uc5MP(z_7-G`e}P#6ZSc<^Z-bNAn(# zJO}%HH^D$*Z~r;$#F(_;i)lJ6%yHJy@Z_jFwv*8aTzcDmz7dqC8QpcNonrQ6X=IeqxweQu#mQZ)@#II-+mp7g z8G4(*2mLYw6`%nq&<18e_FHV{P!K6nqHgW-m{4gbGFTZ`7T4IKNP-6DN;n~k2 z^tV10x(Gsng?cRd+1?_IAfj@K!5>&JlqFn$O0>(!!5}@hq92ho zearA@dKYgeSvQaf(FCAi8!S^><|_l0ix|z0*>32XPhwOqk7_tK(*oeRpGEhmTF%_Q zc0aNE9IwJq%fqndlkJm;-x6D#&yGr_tK+}v3<4xw48hI=;E_8R@(v!iq^`$qr&w2d zA7|u?i}$bWAog`U6|XoIdA07(G14(g=VbyD#x#2=S1GfSxI~n2^W(`4kwTlDMj=FW z{N4t4KL%V7uTai% zOP15{_2mx1n4?gcCJvRa>T`uS-s(v zkAH6Gnr@m89!tZyjb9;#{Jhyx4xis@RZv`;%cb9HJsmYt#BC`(8p~^CsoqW36V^BH za7%Vy;WzJ+yk#sEh$SX@3?81rZM?3ZXd^suEf6^P7(PwHQD%5t;;a%E%V-fVvfXp{ z9Ph}@>nonT8%EvZ)<}-+cx;12YLXB^7QksB#fCLtfb?SzN1m&Jfz?gbg8~7 z*G$%FPO%k$gi|KrSQ45Ht)NT|9JN6P0b>R}fMQD-5Ixnt*lM+EyWv#y?}WS1E%8>M z@aq>dyy#b5svOv|E3p*bXd7jRglAUXA)F8H&ojxuA9%x|TL$J`%F-b57i_S`ovUGY zuBl~=>T@m$qpV4Wy-J&xEu7NXyB>4jQ`LQg^Tvx}ZY9y5Hbg`ugekxxk&KJN^bMK) zO78)c;+;!TQ-Bf)XWV(=tL1DvgiU<80C6?d8sJ$B#}@|Ll*}|>J&W?n7J6lk+-WHc zo7y5$WKM=v&=tPc7(Ns^I6X!O@P?-%wT!pRg?W`uF`_YHWA7MQJSqu=Fl=-AlDKkt zUKQ_Q7DkPZ*;Q9uIis4`FAx24HuL9bhH@x99XJU7htUV45Qs-~3T8$}tdK8-qx*Gk zqAcFmg_KOoRkGx;!$+tiW&Um<+6V_{f4}k#^;Bm#1H) zE036HsLfjAHCBZxo;pix$WPan=Xbqpj9KfG_jj!NjR~?@Dpq450upOc zqP{a9O0+cYY;hH4vSPJXrc;y{QsAp^)kVbJnZ&hj!a#r^o?d@zw_L8TA!eJF z4jNeD3%dr-gMctC-nf7@=ru@}+IMp@LkH`@#Ak;U&JOrh>#!?*=Vy1#U6j)d7=7!a}g^=_1=(BXFw-Drje0(0<4!Ik_{EW52pcD^_9%jCoLpac7?89A=`JdB3 zqihJ4OHjy~8IWtt@pgonM)7C`j~0!oI1KLGkZGE*%<75o3X0MtZ>CAz%PFFsxVW&C zH5Yz`qsYnn@jy=g^{eD5sZMD4_6aYJ*l&dXJ@A8uAnBIHsJFOr0twoLq!)K_9+lk! zi`XH$1pYA{;(lJ0%8nZ-!GufkI)k&f*Zs@4$LB+>&H-)8=+M{XPF=dB+`$MJ1g_90 zkL%`n0|Iy<;|eJW0`U5Aw%9UUxd z%jZuuTv-Ah03{R+=VnfG3&xAv%)khX#phOocg)^u?bQ=46`Cl|#+ToUc~ZK#I4idZ zih-&DZqz`hwa|Yu)!ndwv^rwW`)$Oe72vZiu$v9jIxn0JTUiHwd@IGA_gm3dfX}wT zGBdRvD^^YwIH9xqTUOo!u{%%h{2Gf==I92(0AIm_ybR&skB1={wY>NV`&{!VW76YpA!a}XB zq1GrPJG&G_c=ay%4#VK<;ohbpsZVKWIlMxD-u31T6;;-&_!WNJS3rCG8(7s z=?MRUNj~B0SAIn-*zp?m(``0ydB@F&{pR50o?%tH&H|;w6~6#-7aO0Rc;%-jqv{nZ zKbL~8R;yXL=Eq)$8P&V|{CdVSe8~4k;*VB{jL%;#*MH5xe~KKmTFSL6QOdCLZJgSR zbz5YG5!f6nzTzn^%=0INlU4py8Q+VmRb)TEV;=YL&GZSYA{%CxH8_lL9ISR9rtB?Z zF>S=AN!jU=;$0xu6rhRy*^n5K@SoF$DgOm*fh1IWhy?kaXpqmBSTlF z6+1EhOr-jDhS;D$#WnE+1Yi8582rN2ors^5JI$$$KR$PgE)&+ki)0jgRaFhq9(0B# zQX!jrLq?9zn`~a$dE|N+uOunou|L5u6*6Bg&HAQaTbiA~|43v01mo5;dok8)LA>CD zQBYa8TNyVil#GFra=pJ0DWRnNF_38mj{;uA^kQU!lI6$cSrhYtRO``&kpNMUhZDOU z;6)&B6yl?)({9J?9o8Ti#6$7mfSCh;Wz3qo<0?E;j9YgMGnkPW+=_{}wtP+B8w|U* zHW*5Fi_2sL7|AZ&ohE|u$febicNFZ+6~Cb1ug*YqZ!9sR9{kI5oyIyrlr04+|xKtDa3V&{o6m^3i!&K5H*X5{X~$IX5d z`!1Qo!54#J!JY(WfXYXz3A1x|m7Q#o4N?RVirI}LdUG$0rt&jdlA_!szzK4QBh<{v zwre^20S15tsb9dNd25H??0GkLq>Urs_De)Ap%@-eD`FwKH;bU{ z?+TwUHb5mI|C(r?71IW3h}kPiJ@0_Y-!(Fu&CDjSh9=&Dzl#9sSTHarQapnioT>Z$ zNrT{R6mx3La(rwqFPkeu4h7z+;`D+mB}#^vPehvF#8?@B7ot!Mnh#xW3#w#1?x6%) zNDa3PhmEy}2nmPCC#Aj5S*=7tb6XU{Svt9XBOLDMMfvYPrS^ao`UqEZ!WH~iFP#nS zmK*I;nQp`(5qHVWEdBX3q_0IdCy)<^Qe5xFS*;!73)uBMDvPY=x&fP5yXajo)=oRv zUF2@0ovt}}H%JBpl>X2obN5j22`w5WH?dn~Xn($mlX=z&%(NR2=x>-G9r1>uOKApj zMZm?R1c}#PU8PITN!^k7Nt!sOayT$z-T+7+<0DW6oT>*{P;p050CaB3;!{`Qx!vwu zwOe-;wc4FayCB?v@N`@#;lt6(#*cQyQ_u3|E3!PvmEg-+rsfzfo`W2fXQUX1N$RUl z4Ms#Q_xpAI`hB&`-=~)UQ7KAnK5~*a9Xd`T418jh_&6sedm~Ot--(Z0&aad2(xWlb zxd+=qyY3-SQ$zum(dIJc_WL>fD_K`d=VEKA{PpjDdlOh(_*!Y@fZ0aU z(g^==wG($4jpiX&W0Xrka)d4A>zg`22xClPZvwh{Gs!586u5Fk6f*yFrs`r57XcwLzdRlf1T(XfI(ShBQX~uTf>{ILjqFt`j8rS&#{whvXGKpMZ zVvS{qIdiDri?6T_#{hhVZV*#*f>XghM+qBj0%3!(E|&Ccth0)sQ3g3{dZ7Jf1+6FT zIWk?R9bK}{u|1E0n*Cs1Z!SLmW_RQzt@?J6 z4u^HzIN#w=4pgjXF=;Ffr;_uliMXKA_SeK?0Vpaa)!0=RR55^-+lGa?LRp?Er2Vkm z?O?zc`Thbkk)!dqHWpz5OIeV6U49@jaCH$kpgSvS|I;tRwTUN_O-G%u+nA$c_L5citza5~>y#)6pzhOmAi}raQG_ zC+#Yg*1s(>EE7<^EiNw?@TU@$TRmNfzRjzl%EU@lu3P~YCvs%8Cihe_j6Zxc&Rh8( zI`d}a=jY7`5LwSuug*!FL7~sTMjK>N@u#Jxpdb+Cd&Vo5>8#6P?F*hiN}myf1eq(d zR1xAlX-;9|dEBDIY0fi@$^V5o;_eU`mw=3wNvonO&9t7+mpfLSBC8}|D4F7G41f=#kcJ|_F*S3h}0k!;$@D;&k^KpZZ4 z|JhhL6VP9%j4#a6&&Sc#&$t1Sg zQOV~7B{!{XHYO^$c_J#gKtp-|M(IZ>I@!3`xK27onhOM@Rv2*^O9bV~ZKSKy1(uSk>e*sDS zsHV&#Z)mKghj8y@J2pG13m`*^Mw*c|~k?4s3RA2xSgz z)?p`BxSw>M0KpK7d`T-VYI>HzP!UD zl34cE@zKY`BB{RKDD7RxKu#bpfb8VlaUYG#7D_gG$g{JD-ieP*5Fh_~uw^X+z|a%S z{NV8DCYi^b(o!8b3!e>9NqcSj_xb^QW@6P zw0n9Q@(>x%&xDV_JBQ8D{+)krE?0bJF89o7?x@BM=1*`LazuKn0(yt~cQxUmk(N-y8;0VdNn;x+bh zS$wxT^(Jar1223+w~_`1fNs)`$3*@a0yXm!ftrQuFeYNK1Z!3*ShI4`YDDKe9o<&0 z4GG7PRepRX4EFL*N%8Hs-)4VE$ov#@B4(T6sTpCRL0fdcq0&v(bC!OfY*!HYKA+>} ztaT5V!0?(G!0w@tD}`jfry!utjv)nt>au_?6{CqQH8v}qv-`Ah`9g`|OG%x8kbm!K zu**c*d-*$ZmM(SZy{!)2cKGe0AB-EP}Nt=wJR39X*T0a*utO;B-Bs~bgcj;^Lm%~npKpinOR5FqAm8uCbhhda;)kmeM9uUz^z^|M|>6#4NJ z0BLwJ9Mg|y_b2Np`$)aLYSDj?`r8Bld%gYdrAeNygIj?fUp<>1Tizr{k`wbdwmR!t zS|*ypj@47(+Oc}PZQqxF+1#&D=k9Y5;QRlv+|+ju`>4DsV4r4;D7O0s^X)-R;+S=n zJbCTBRv74f!gh{}wECOgaE2pmd@RAOpe7Y02X2VKVak1f~YUjt`= ziY}k#OUdl6)U8e}-09o8{v1CZ(Z{^%8j#<@gmDMpjGL(C^2McDGTzo@y~Gne$O}8B zk&6ux2nkDUo%%wjJ;saB%|u!&qp?=Ti#Qqah1M+sDwwm7w|@yMGnOI|g*<((#j zj*45PVj|fq+A>}~Z>JPa#B6BbIteuBBmi5-%d_^e*rZQ4nbZxOs*CJpy6%urlXd*~ zvL&OgyMfm1)AF?dKEX1cc8H+$^@j6~+r{9ZQs)~GatARDM-#P0Ia{BA3TVE>dLb5!=zj}$gi z%!7{>iiZs~KtIl_4Gf4cDzrCvz9M12RaVCxM;Mtb^E|!86Nv}g=)|xjc>!lv%ORy% zuIrt4sD@qsZoB{K?#?daTn^)3&9lN>C(7r?hSp7|Y{$B*Eb5^!a`?)(visllXV{r0 z{hM)rbhLX`2c@&R-#)Cd`)2yqnfZv_2c-bt4#}i&N@-%jXBlx~J&cjUiquUhec| z-G%0+SKte9e|r7>)gHJ9ZoZBLwG>s0tQmEARbk!E(q5s3+$|!Yn%K(11Y9a*7=D)P zgOteCTBA}BtthD;f2nk={`i^8`Qz^w_VKlykOi8?Vi-MNc-9B1P-wfPQhgU0dQr>S zqN1mf5uNeQ7rOkHHCp{vZ>_81BmuXBY(MlXR(V9AtHN}}{y+dAUEe|-TB|*3VzI3< zdgZ-~Tz1odKZ<|BFO`P~ekrGqWKU5e?AEc0~fyU-_7Z8aEF5Ym3%^(;P+~qAPs^)7=*2TgEsm#FiCXuhy3T6}F)?k_szk z)!R!}u3rhR9&TP0ar^i}1Zq}0mYLl26=FKdv!>U_8?~nDdDgLH>0?J{GBzrMnd#ig zpxr@F25kWF2j-aE3Yohn+){!FO7!?qiV{*uOT5U-4u~mY>#DFwTVhkb01q9zWb<#j zHh<)s(%2En!$=&>35lasO&x2fn*2Vann~XUV*T3A=GDGr%Pu_~%_dX(#cXUp8K!2? z!`DHNZnwgW9xIK-UXg9nttD|FJ6wZAOK_9jHJwM3?Wbrq$eLk_k zP1{#S;ZL-rX+|&cBsg>%X098bSk zJjeK6dHrrjlDvAw-{oDY0X-iXEJz?O;Kf?W09Zk8)WVpjhDhbzYbW8@eHx7zRhx2FepVWt6TVegD$@fCI&dF)IVXCcP4yj)WiK2T~?t0Zvk{S z#!g@TgGw{wJ^qwSIO%Z$j^35FCb?pudZ2eB&zcWM^A_1%jDk- z#Z1l@lSt;+wq4mG5fxnGpaU`y=6Qp|JTtq(~`PMOnc=DBoZh*g~S zoFcF;G>dN^NGiFJue#d8DK%{YRd)ha$7&18YHf)gynQ=}4+nTx5diLo7!U$~Qyul7 zx|#T0(2agTmefW(u7}N#e}}M8hq2(4KqQcq#W5}TKGtY^Hz zA-<3I>Um$$FOgtKI&Rk7&xf)FH#Fk{FEm$O-10MX%xo zs(N2TbocMtDXdM@Z4`?O%?jBc8( z+4&c?L!9xIm37c6X9jrnBbMGuC9HAOEU1dP*XZpp!}v?JJyfk;?Kw;=>ib7@HH>xb z#J9VN$K!DDPBn#Li?BCRzJw6iZbx>#r^~~>BEd$UqAxxc(*gSLpwomT*W>LhvcHh3 zL;`Cf-iNlo%mNS`W8yRLB5xBZR={0o;4<8@clgp)$>PX zzz7b@vL_eE?nNzLAYO=v-+gQ)AUaJcj^1B6b9WZjJI0d*&9$u^N^uUtg%LPL7Ef4k zNuyIZ@m$nI6mZU`f@w(!U<(I{r;8XRzAi!=%d8I~c&TE_259c4@3m}Qswj|c;6OI9 zO?l%YHNJ9I)r3P#3OmFEU7E;Oa~7AG`o&_0GGcHl8k5{-eYL*3TRq&{dK62dpU6mL zE#cR(dWp5Wv%(FOd%^&1tu5Pn{D`kzGc&(ynSAlJf@gJ%Dma(?d;We7e-weC7VU@p zK69PBv=anoz*RYbN2;AiyklY9&SO_-Z{Eox-p4TR-z4Hldbn%5z`*@q+@ji4}jWbJSf3k}zfD|HboGOlehRyrXY zC;r_<5#~>aLvH3`zzL}5-n({h%Ypu?41F=9h$7|3*% z6j^Y>k_wZSrIq0*6--6R_N}QT8N~jIX$4rt>SBB{heZS%fxxz(13^dsZr@n1)gxQM z{`dN%_FKKG!>7jwi~~ZrQ}na1(Y@ZL`jY+IiX;+0GVHt}66W5MnvkyC{8sLT2BoBL zuCfy(C28q8R?K;8rINK$skPD^T@C%pO_TqdmVmlcN0Ym=i!%9hbJ*=7-#OjdWk0=d zt5-8X-h-^o2bgZ#6%R*TQX-|G!&Q00Y}Jdpzh+hEr?{)9Kz{rv@Rl88+;`@#9@<#c zFp2bmbno)&ue-bVHVM|rz2n$q;HVD=bk1tOCoOLH3o4l7`>alshCArpg_qwTUd%M0 z#MN%D#9?QaVik$2wsolhds;ivU}} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +/** + * @license protobuf.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/protobuf.js for details + */ +(function(global, factory) { + + /* AMD */ if (typeof define === 'function' && define["amd"]) + define(["bytebuffer"], factory); + /* CommonJS */ else if (typeof require === "function" && typeof module === "object" && module && module["exports"]) + module["exports"] = factory(require("bytebuffer"), true); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]); + +})(this, function(ByteBuffer, isCommonJS) { + "use strict"; + + /** + * The ProtoBuf namespace. + * @exports ProtoBuf + * @namespace + * @expose + */ + var ProtoBuf = {}; + + /** + * @type {!function(new: ByteBuffer, ...[*])} + * @expose + */ + ProtoBuf.ByteBuffer = ByteBuffer; + + /** + * @type {?function(new: Long, ...[*])} + * @expose + */ + ProtoBuf.Long = ByteBuffer.Long || null; + + /** + * ProtoBuf.js version. + * @type {string} + * @const + * @expose + */ + ProtoBuf.VERSION = "5.0.3"; + + /** + * Wire types. + * @type {Object.} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES = {}; + + /** + * Varint wire type. + * @type {number} + * @expose + */ + ProtoBuf.WIRE_TYPES.VARINT = 0; + + /** + * Fixed 64 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS64 = 1; + + /** + * Length delimited wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.LDELIM = 2; + + /** + * Start group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.STARTGROUP = 3; + + /** + * End group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.ENDGROUP = 4; + + /** + * Fixed 32 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS32 = 5; + + /** + * Packable wire types. + * @type {!Array.} + * @const + * @expose + */ + ProtoBuf.PACKABLE_WIRE_TYPES = [ + ProtoBuf.WIRE_TYPES.VARINT, + ProtoBuf.WIRE_TYPES.BITS64, + ProtoBuf.WIRE_TYPES.BITS32 + ]; + + /** + * Types. + * @dict + * @type {!Object.} + * @const + * @expose + */ + ProtoBuf.TYPES = { + // According to the protobuf spec. + "int32": { + name: "int32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "uint32": { + name: "uint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "sint32": { + name: "sint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "int64": { + name: "int64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "uint64": { + name: "uint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sint64": { + name: "sint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "bool": { + name: "bool", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: false + }, + "double": { + name: "double", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: 0 + }, + "string": { + name: "string", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: "" + }, + "bytes": { + name: "bytes", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null // overridden in the code, must be a unique instance + }, + "fixed32": { + name: "fixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "sfixed32": { + name: "sfixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "fixed64": { + name: "fixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sfixed64": { + name: "sfixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "float": { + name: "float", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "enum": { + name: "enum", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "message": { + name: "message", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null + }, + "group": { + name: "group", + wireType: ProtoBuf.WIRE_TYPES.STARTGROUP, + defaultValue: null + } + }; + + /** + * Valid map key types. + * @type {!Array.>} + * @const + * @expose + */ + ProtoBuf.MAP_KEY_TYPES = [ + ProtoBuf.TYPES["int32"], + ProtoBuf.TYPES["sint32"], + ProtoBuf.TYPES["sfixed32"], + ProtoBuf.TYPES["uint32"], + ProtoBuf.TYPES["fixed32"], + ProtoBuf.TYPES["int64"], + ProtoBuf.TYPES["sint64"], + ProtoBuf.TYPES["sfixed64"], + ProtoBuf.TYPES["uint64"], + ProtoBuf.TYPES["fixed64"], + ProtoBuf.TYPES["bool"], + ProtoBuf.TYPES["string"], + ProtoBuf.TYPES["bytes"] + ]; + + /** + * Minimum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MIN = 1; + + /** + * Maximum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MAX = 0x1FFFFFFF; + + /** + * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`. + * Must be set prior to parsing. + * @type {boolean} + * @expose + */ + ProtoBuf.convertFieldsToCamelCase = false; + + /** + * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by + * setting this to `false` prior to building messages. + * @type {boolean} + * @expose + */ + ProtoBuf.populateAccessors = true; + + /** + * By default, messages are populated with default values if a field is not present on the wire. To disable + * this behavior, set this setting to `false`. + * @type {boolean} + * @expose + */ + ProtoBuf.populateDefaults = true; + + /** + * @alias ProtoBuf.Util + * @expose + */ + ProtoBuf.Util = (function() { + "use strict"; + + /** + * ProtoBuf utilities. + * @exports ProtoBuf.Util + * @namespace + */ + var Util = {}; + + /** + * Flag if running in node or not. + * @type {boolean} + * @const + * @expose + */ + Util.IS_NODE = !!( + typeof process === 'object' && process+'' === '[object process]' && !process['browser'] + ); + + /** + * Constructs a XMLHttpRequest object. + * @return {XMLHttpRequest} + * @throws {Error} If XMLHttpRequest is not supported + * @expose + */ + Util.XHR = function() { + // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html + var XMLHttpFactories = [ + function () {return new XMLHttpRequest()}, + function () {return new ActiveXObject("Msxml2.XMLHTTP")}, + function () {return new ActiveXObject("Msxml3.XMLHTTP")}, + function () {return new ActiveXObject("Microsoft.XMLHTTP")} + ]; + /** @type {?XMLHttpRequest} */ + var xhr = null; + for (var i=0;i} + * @expose + */ + ProtoBuf.Lang = { + + // Characters always ending a statement + DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g, + + // Field rules + RULE: /^(?:required|optional|repeated|map)$/, + + // Field types + TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, + + // Names + NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, + + // Type definitions + TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, + + // Type references + TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + + // Fully qualified type references + FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/, + + // All numbers + NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, + + // Decimal numbers + NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, + + // Hexadecimal numbers + NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, + + // Octal numbers + NUMBER_OCT: /^0[0-7]+$/, + + // Floating point numbers + NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, + + // Booleans + BOOL: /^(?:true|false)$/i, + + // Id numbers + ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Negative id numbers (enum values) + NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Whitespaces + WHITESPACE: /\s/, + + // All strings + STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, + + // Double quoted strings + STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + + // Single quoted strings + STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g + }; + + /** + * @alias ProtoBuf.DotProto + * @expose + */ + ProtoBuf.DotProto = (function(ProtoBuf, Lang) { + "use strict"; + + /** + * Utilities to parse .proto files. + * @exports ProtoBuf.DotProto + * @namespace + */ + var DotProto = {}; + + /** + * Constructs a new Tokenizer. + * @exports ProtoBuf.DotProto.Tokenizer + * @class prototype tokenizer + * @param {string} proto Proto to tokenize + * @constructor + */ + var Tokenizer = function(proto) { + + /** + * Source to parse. + * @type {string} + * @expose + */ + this.source = proto+""; + + /** + * Current index. + * @type {number} + * @expose + */ + this.index = 0; + + /** + * Current line. + * @type {number} + * @expose + */ + this.line = 1; + + /** + * Token stack. + * @type {!Array.} + * @expose + */ + this.stack = []; + + /** + * Opening character of the current string read, if any. + * @type {?string} + * @private + */ + this._stringOpen = null; + }; + + /** + * @alias ProtoBuf.DotProto.Tokenizer.prototype + * @inner + */ + var TokenizerPrototype = Tokenizer.prototype; + + /** + * Reads a string beginning at the current index. + * @return {string} + * @private + */ + TokenizerPrototype._readString = function() { + var re = this._stringOpen === '"' + ? Lang.STRING_DQ + : Lang.STRING_SQ; + re.lastIndex = this.index - 1; // Include the open quote + var match = re.exec(this.source); + if (!match) + throw Error("unterminated string"); + this.index = re.lastIndex; + this.stack.push(this._stringOpen); + this._stringOpen = null; + return match[1]; + }; + + /** + * Gets the next token and advances by one. + * @return {?string} Token or `null` on EOF + * @expose + */ + TokenizerPrototype.next = function() { + if (this.stack.length > 0) + return this.stack.shift(); + if (this.index >= this.source.length) + return null; + if (this._stringOpen !== null) + return this._readString(); + + var repeat, + prev, + next; + do { + repeat = false; + + // Strip white spaces + while (Lang.WHITESPACE.test(next = this.source.charAt(this.index))) { + if (next === '\n') + ++this.line; + if (++this.index === this.source.length) + return null; + } + + // Strip comments + if (this.source.charAt(this.index) === '/') { + ++this.index; + if (this.source.charAt(this.index) === '/') { // Line + while (this.source.charAt(++this.index) !== '\n') + if (this.index == this.source.length) + return null; + ++this.index; + ++this.line; + repeat = true; + } else if ((next = this.source.charAt(this.index)) === '*') { /* Block */ + do { + if (next === '\n') + ++this.line; + if (++this.index === this.source.length) + return null; + prev = next; + next = this.source.charAt(this.index); + } while (prev !== '*' || next !== '/'); + ++this.index; + repeat = true; + } else + return '/'; + } + } while (repeat); + + if (this.index === this.source.length) + return null; + + // Read the next token + var end = this.index; + Lang.DELIM.lastIndex = 0; + var delim = Lang.DELIM.test(this.source.charAt(end++)); + if (!delim) + while(end < this.source.length && !Lang.DELIM.test(this.source.charAt(end))) + ++end; + var token = this.source.substring(this.index, this.index = end); + if (token === '"' || token === "'") + this._stringOpen = token; + return token; + }; + + /** + * Peeks for the next token. + * @return {?string} Token or `null` on EOF + * @expose + */ + TokenizerPrototype.peek = function() { + if (this.stack.length === 0) { + var token = this.next(); + if (token === null) + return null; + this.stack.push(token); + } + return this.stack[0]; + }; + + /** + * Skips a specific token and throws if it differs. + * @param {string} expected Expected token + * @throws {Error} If the actual token differs + */ + TokenizerPrototype.skip = function(expected) { + var actual = this.next(); + if (actual !== expected) + throw Error("illegal '"+actual+"', '"+expected+"' expected"); + }; + + /** + * Omits an optional token. + * @param {string} expected Expected optional token + * @returns {boolean} `true` if the token exists + */ + TokenizerPrototype.omit = function(expected) { + if (this.peek() === expected) { + this.next(); + return true; + } + return false; + }; + + /** + * Returns a string representation of this object. + * @return {string} String representation as of "Tokenizer(index/length)" + * @expose + */ + TokenizerPrototype.toString = function() { + return "Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"; + }; + + /** + * @alias ProtoBuf.DotProto.Tokenizer + * @expose + */ + DotProto.Tokenizer = Tokenizer; + + /** + * Constructs a new Parser. + * @exports ProtoBuf.DotProto.Parser + * @class prototype parser + * @param {string} source Source + * @constructor + */ + var Parser = function(source) { + + /** + * Tokenizer. + * @type {!ProtoBuf.DotProto.Tokenizer} + * @expose + */ + this.tn = new Tokenizer(source); + + /** + * Whether parsing proto3 or not. + * @type {boolean} + */ + this.proto3 = false; + }; + + /** + * @alias ProtoBuf.DotProto.Parser.prototype + * @inner + */ + var ParserPrototype = Parser.prototype; + + /** + * Parses the source. + * @returns {!Object} + * @throws {Error} If the source cannot be parsed + * @expose + */ + ParserPrototype.parse = function() { + var topLevel = { + "name": "[ROOT]", // temporary + "package": null, + "messages": [], + "enums": [], + "imports": [], + "options": {}, + "services": [] + // "syntax": undefined + }; + var token, + head = true, + weak; + try { + while (token = this.tn.next()) { + switch (token) { + case 'package': + if (!head || topLevel["package"] !== null) + throw Error("unexpected 'package'"); + token = this.tn.next(); + if (!Lang.TYPEREF.test(token)) + throw Error("illegal package name: " + token); + this.tn.skip(";"); + topLevel["package"] = token; + break; + case 'import': + if (!head) + throw Error("unexpected 'import'"); + token = this.tn.peek(); + if (token === "public" || (weak = token === "weak")) // token ignored + this.tn.next(); + token = this._readString(); + this.tn.skip(";"); + if (!weak) // import ignored + topLevel["imports"].push(token); + break; + case 'syntax': + if (!head) + throw Error("unexpected 'syntax'"); + this.tn.skip("="); + if ((topLevel["syntax"] = this._readString()) === "proto3") + this.proto3 = true; + this.tn.skip(";"); + break; + case 'message': + this._parseMessage(topLevel, null); + head = false; + break; + case 'enum': + this._parseEnum(topLevel); + head = false; + break; + case 'option': + this._parseOption(topLevel); + break; + case 'service': + this._parseService(topLevel); + break; + case 'extend': + this._parseExtend(topLevel); + break; + default: + throw Error("unexpected '" + token + "'"); + } + } + } catch (e) { + e.message = "Parse error at line "+this.tn.line+": " + e.message; + throw e; + } + delete topLevel["name"]; + return topLevel; + }; + + /** + * Parses the specified source. + * @returns {!Object} + * @throws {Error} If the source cannot be parsed + * @expose + */ + Parser.parse = function(source) { + return new Parser(source).parse(); + }; + + // ----- Conversion ------ + + /** + * Converts a numerical string to an id. + * @param {string} value + * @param {boolean=} mayBeNegative + * @returns {number} + * @inner + */ + function mkId(value, mayBeNegative) { + var id = -1, + sign = 1; + if (value.charAt(0) == '-') { + sign = -1; + value = value.substring(1); + } + if (Lang.NUMBER_DEC.test(value)) + id = parseInt(value); + else if (Lang.NUMBER_HEX.test(value)) + id = parseInt(value.substring(2), 16); + else if (Lang.NUMBER_OCT.test(value)) + id = parseInt(value.substring(1), 8); + else + throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value); + id = (sign*id)|0; // Force to 32bit + if (!mayBeNegative && id < 0) + throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value); + return id; + } + + /** + * Converts a numerical string to a number. + * @param {string} val + * @returns {number} + * @inner + */ + function mkNumber(val) { + var sign = 1; + if (val.charAt(0) == '-') { + sign = -1; + val = val.substring(1); + } + if (Lang.NUMBER_DEC.test(val)) + return sign * parseInt(val, 10); + else if (Lang.NUMBER_HEX.test(val)) + return sign * parseInt(val.substring(2), 16); + else if (Lang.NUMBER_OCT.test(val)) + return sign * parseInt(val.substring(1), 8); + else if (val === 'inf') + return sign * Infinity; + else if (val === 'nan') + return NaN; + else if (Lang.NUMBER_FLT.test(val)) + return sign * parseFloat(val); + throw Error("illegal number value: " + (sign < 0 ? '-' : '') + val); + } + + // ----- Reading ------ + + /** + * Reads a string. + * @returns {string} + * @private + */ + ParserPrototype._readString = function() { + var value = "", + token, + delim; + do { + delim = this.tn.next(); + if (delim !== "'" && delim !== '"') + throw Error("illegal string delimiter: "+delim); + value += this.tn.next(); + this.tn.skip(delim); + token = this.tn.peek(); + } while (token === '"' || token === '"'); // multi line? + return value; + }; + + /** + * Reads a value. + * @param {boolean=} mayBeTypeRef + * @returns {number|boolean|string} + * @private + */ + ParserPrototype._readValue = function(mayBeTypeRef) { + var token = this.tn.peek(), + value; + if (token === '"' || token === "'") + return this._readString(); + this.tn.next(); + if (Lang.NUMBER.test(token)) + return mkNumber(token); + if (Lang.BOOL.test(token)) + return (token.toLowerCase() === 'true'); + if (mayBeTypeRef && Lang.TYPEREF.test(token)) + return token; + throw Error("illegal value: "+token); + + }; + + // ----- Parsing constructs ----- + + /** + * Parses a namespace option. + * @param {!Object} parent Parent definition + * @param {boolean=} isList + * @private + */ + ParserPrototype._parseOption = function(parent, isList) { + var token = this.tn.next(), + custom = false; + if (token === '(') { + custom = true; + token = this.tn.next(); + } + if (!Lang.TYPEREF.test(token)) + // we can allow options of the form google.protobuf.* since they will just get ignored anyways + // if (!/google\.protobuf\./.test(token)) // FIXME: Why should that not be a valid typeref? + throw Error("illegal option name: "+token); + var name = token; + if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar + this.tn.skip(')'); + name = '('+name+')'; + token = this.tn.peek(); + if (Lang.FQTYPEREF.test(token)) { + name += token; + this.tn.next(); + } + } + this.tn.skip('='); + this._parseOptionValue(parent, name); + if (!isList) + this.tn.skip(";"); + }; + + /** + * Sets an option on the specified options object. + * @param {!Object.} options + * @param {string} name + * @param {string|number|boolean} value + * @inner + */ + function setOption(options, name, value) { + if (typeof options[name] === 'undefined') + options[name] = value; + else { + if (!Array.isArray(options[name])) + options[name] = [ options[name] ]; + options[name].push(value); + } + } + + /** + * Parses an option value. + * @param {!Object} parent + * @param {string} name + * @private + */ + ParserPrototype._parseOptionValue = function(parent, name) { + var token = this.tn.peek(); + if (token !== '{') { // Plain value + setOption(parent["options"], name, this._readValue(true)); + } else { // Aggregate options + this.tn.skip("{"); + while ((token = this.tn.next()) !== '}') { + if (!Lang.NAME.test(token)) + throw Error("illegal option name: " + name + "." + token); + if (this.tn.omit(":")) + setOption(parent["options"], name + "." + token, this._readValue(true)); + else + this._parseOptionValue(parent, name + "." + token); + } + } + }; + + /** + * Parses a service definition. + * @param {!Object} parent Parent definition + * @private + */ + ParserPrototype._parseService = function(parent) { + var token = this.tn.next(); + if (!Lang.NAME.test(token)) + throw Error("illegal service name at line "+this.tn.line+": "+token); + var name = token; + var svc = { + "name": name, + "rpc": {}, + "options": {} + }; + this.tn.skip("{"); + while ((token = this.tn.next()) !== '}') { + if (token === "option") + this._parseOption(svc); + else if (token === 'rpc') + this._parseServiceRPC(svc); + else + throw Error("illegal service token: "+token); + } + this.tn.omit(";"); + parent["services"].push(svc); + }; + + /** + * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)]. + * @param {!Object} svc Service definition + * @private + */ + ParserPrototype._parseServiceRPC = function(svc) { + var type = "rpc", + token = this.tn.next(); + if (!Lang.NAME.test(token)) + throw Error("illegal rpc service method name: "+token); + var name = token; + var method = { + "request": null, + "response": null, + "request_stream": false, + "response_stream": false, + "options": {} + }; + this.tn.skip("("); + token = this.tn.next(); + if (token.toLowerCase() === "stream") { + method["request_stream"] = true; + token = this.tn.next(); + } + if (!Lang.TYPEREF.test(token)) + throw Error("illegal rpc service request type: "+token); + method["request"] = token; + this.tn.skip(")"); + token = this.tn.next(); + if (token.toLowerCase() !== "returns") + throw Error("illegal rpc service request type delimiter: "+token); + this.tn.skip("("); + token = this.tn.next(); + if (token.toLowerCase() === "stream") { + method["response_stream"] = true; + token = this.tn.next(); + } + method["response"] = token; + this.tn.skip(")"); + token = this.tn.peek(); + if (token === '{') { + this.tn.next(); + while ((token = this.tn.next()) !== '}') { + if (token === 'option') + this._parseOption(method); + else + throw Error("illegal rpc service token: " + token); + } + this.tn.omit(";"); + } else + this.tn.skip(";"); + if (typeof svc[type] === 'undefined') + svc[type] = {}; + svc[type][name] = method; + }; + + /** + * Parses a message definition. + * @param {!Object} parent Parent definition + * @param {!Object=} fld Field definition if this is a group + * @returns {!Object} + * @private + */ + ParserPrototype._parseMessage = function(parent, fld) { + var isGroup = !!fld, + token = this.tn.next(); + var msg = { + "name": "", + "fields": [], + "enums": [], + "messages": [], + "options": {}, + "services": [], + "oneofs": {} + // "extensions": undefined + }; + if (!Lang.NAME.test(token)) + throw Error("illegal "+(isGroup ? "group" : "message")+" name: "+token); + msg["name"] = token; + if (isGroup) { + this.tn.skip("="); + fld["id"] = mkId(this.tn.next()); + msg["isGroup"] = true; + } + token = this.tn.peek(); + if (token === '[' && fld) + this._parseFieldOptions(fld); + this.tn.skip("{"); + while ((token = this.tn.next()) !== '}') { + if (Lang.RULE.test(token)) + this._parseMessageField(msg, token); + else if (token === "oneof") + this._parseMessageOneOf(msg); + else if (token === "enum") + this._parseEnum(msg); + else if (token === "message") + this._parseMessage(msg); + else if (token === "option") + this._parseOption(msg); + else if (token === "service") + this._parseService(msg); + else if (token === "extensions") + if (msg.hasOwnProperty("extensions")) { + msg["extensions"] = msg["extensions"].concat(this._parseExtensionRanges()) + } else { + msg["extensions"] = this._parseExtensionRanges(); + } + else if (token === "reserved") + this._parseIgnored(); // TODO + else if (token === "extend") + this._parseExtend(msg); + else if (Lang.TYPEREF.test(token)) { + if (!this.proto3) + throw Error("illegal field rule: "+token); + this._parseMessageField(msg, "optional", token); + } else + throw Error("illegal message token: "+token); + } + this.tn.omit(";"); + parent["messages"].push(msg); + return msg; + }; + + /** + * Parses an ignored statement. + * @private + */ + ParserPrototype._parseIgnored = function() { + while (this.tn.peek() !== ';') + this.tn.next(); + this.tn.skip(";"); + }; + + /** + * Parses a message field. + * @param {!Object} msg Message definition + * @param {string} rule Field rule + * @param {string=} type Field type if already known (never known for maps) + * @returns {!Object} Field descriptor + * @private + */ + ParserPrototype._parseMessageField = function(msg, rule, type) { + if (!Lang.RULE.test(rule)) + throw Error("illegal message field rule: "+rule); + var fld = { + "rule": rule, + "type": "", + "name": "", + "options": {}, + "id": 0 + }; + var token; + if (rule === "map") { + + if (type) + throw Error("illegal type: " + type); + this.tn.skip('<'); + token = this.tn.next(); + if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token)) + throw Error("illegal message field type: " + token); + fld["keytype"] = token; + this.tn.skip(','); + token = this.tn.next(); + if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token)) + throw Error("illegal message field: " + token); + fld["type"] = token; + this.tn.skip('>'); + token = this.tn.next(); + if (!Lang.NAME.test(token)) + throw Error("illegal message field name: " + token); + fld["name"] = token; + this.tn.skip("="); + fld["id"] = mkId(this.tn.next()); + token = this.tn.peek(); + if (token === '[') + this._parseFieldOptions(fld); + this.tn.skip(";"); + + } else { + + type = typeof type !== 'undefined' ? type : this.tn.next(); + + if (type === "group") { + + // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your + // code, you can treat this message just as if it had a Result type field called result (the latter name is + // converted to lower-case so that it does not conflict with the former)." + var grp = this._parseMessage(msg, fld); + if (!/^[A-Z]/.test(grp["name"])) + throw Error('illegal group name: '+grp["name"]); + fld["type"] = grp["name"]; + fld["name"] = grp["name"].toLowerCase(); + this.tn.omit(";"); + + } else { + + if (!Lang.TYPE.test(type) && !Lang.TYPEREF.test(type)) + throw Error("illegal message field type: " + type); + fld["type"] = type; + token = this.tn.next(); + if (!Lang.NAME.test(token)) + throw Error("illegal message field name: " + token); + fld["name"] = token; + this.tn.skip("="); + fld["id"] = mkId(this.tn.next()); + token = this.tn.peek(); + if (token === "[") + this._parseFieldOptions(fld); + this.tn.skip(";"); + + } + } + msg["fields"].push(fld); + return fld; + }; + + /** + * Parses a message oneof. + * @param {!Object} msg Message definition + * @private + */ + ParserPrototype._parseMessageOneOf = function(msg) { + var token = this.tn.next(); + if (!Lang.NAME.test(token)) + throw Error("illegal oneof name: "+token); + var name = token, + fld; + var fields = []; + this.tn.skip("{"); + while ((token = this.tn.next()) !== "}") { + fld = this._parseMessageField(msg, "optional", token); + fld["oneof"] = name; + fields.push(fld["id"]); + } + this.tn.omit(";"); + msg["oneofs"][name] = fields; + }; + + /** + * Parses a set of field option definitions. + * @param {!Object} fld Field definition + * @private + */ + ParserPrototype._parseFieldOptions = function(fld) { + this.tn.skip("["); + var token, + first = true; + while ((token = this.tn.peek()) !== ']') { + if (!first) + this.tn.skip(","); + this._parseOption(fld, true); + first = false; + } + this.tn.next(); + }; + + /** + * Parses an enum. + * @param {!Object} msg Message definition + * @private + */ + ParserPrototype._parseEnum = function(msg) { + var enm = { + "name": "", + "values": [], + "options": {} + }; + var token = this.tn.next(); + if (!Lang.NAME.test(token)) + throw Error("illegal name: "+token); + enm["name"] = token; + this.tn.skip("{"); + while ((token = this.tn.next()) !== '}') { + if (token === "option") + this._parseOption(enm); + else { + if (!Lang.NAME.test(token)) + throw Error("illegal name: "+token); + this.tn.skip("="); + var val = { + "name": token, + "id": mkId(this.tn.next(), true) + }; + token = this.tn.peek(); + if (token === "[") + this._parseFieldOptions({ "options": {} }); + this.tn.skip(";"); + enm["values"].push(val); + } + } + this.tn.omit(";"); + msg["enums"].push(enm); + }; + + /** + * Parses extension / reserved ranges. + * @returns {!Array.>} + * @private + */ + ParserPrototype._parseExtensionRanges = function() { + var ranges = []; + var token, + range, + value; + do { + range = []; + while (true) { + token = this.tn.next(); + switch (token) { + case "min": + value = ProtoBuf.ID_MIN; + break; + case "max": + value = ProtoBuf.ID_MAX; + break; + default: + value = mkNumber(token); + break; + } + range.push(value); + if (range.length === 2) + break; + if (this.tn.peek() !== "to") { + range.push(value); + break; + } + this.tn.next(); + } + ranges.push(range); + } while (this.tn.omit(",")); + this.tn.skip(";"); + return ranges; + }; + + /** + * Parses an extend block. + * @param {!Object} parent Parent object + * @private + */ + ParserPrototype._parseExtend = function(parent) { + var token = this.tn.next(); + if (!Lang.TYPEREF.test(token)) + throw Error("illegal extend reference: "+token); + var ext = { + "ref": token, + "fields": [] + }; + this.tn.skip("{"); + while ((token = this.tn.next()) !== '}') { + if (Lang.RULE.test(token)) + this._parseMessageField(ext, token); + else if (Lang.TYPEREF.test(token)) { + if (!this.proto3) + throw Error("illegal field rule: "+token); + this._parseMessageField(ext, "optional", token); + } else + throw Error("illegal extend token: "+token); + } + this.tn.omit(";"); + parent["messages"].push(ext); + return ext; + }; + + // ----- General ----- + + /** + * Returns a string representation of this parser. + * @returns {string} + */ + ParserPrototype.toString = function() { + return "Parser at line "+this.tn.line; + }; + + /** + * @alias ProtoBuf.DotProto.Parser + * @expose + */ + DotProto.Parser = Parser; + + return DotProto; + + })(ProtoBuf, ProtoBuf.Lang); + + /** + * @alias ProtoBuf.Reflect + * @expose + */ + ProtoBuf.Reflect = (function(ProtoBuf) { + "use strict"; + + /** + * Reflection types. + * @exports ProtoBuf.Reflect + * @namespace + */ + var Reflect = {}; + + /** + * Constructs a Reflect base class. + * @exports ProtoBuf.Reflect.T + * @constructor + * @abstract + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.T} parent Parent object + * @param {string} name Object name + */ + var T = function(builder, parent, name) { + + /** + * Builder reference. + * @type {!ProtoBuf.Builder} + * @expose + */ + this.builder = builder; + + /** + * Parent object. + * @type {?ProtoBuf.Reflect.T} + * @expose + */ + this.parent = parent; + + /** + * Object name in namespace. + * @type {string} + * @expose + */ + this.name = name; + + /** + * Fully qualified class name + * @type {string} + * @expose + */ + this.className; + }; + + /** + * @alias ProtoBuf.Reflect.T.prototype + * @inner + */ + var TPrototype = T.prototype; + + /** + * Returns the fully qualified name of this object. + * @returns {string} Fully qualified name as of ".PATH.TO.THIS" + * @expose + */ + TPrototype.fqn = function() { + var name = this.name, + ptr = this; + do { + ptr = ptr.parent; + if (ptr == null) + break; + name = ptr.name+"."+name; + } while (true); + return name; + }; + + /** + * Returns a string representation of this Reflect object (its fully qualified name). + * @param {boolean=} includeClass Set to true to include the class name. Defaults to false. + * @return String representation + * @expose + */ + TPrototype.toString = function(includeClass) { + return (includeClass ? this.className + " " : "") + this.fqn(); + }; + + /** + * Builds this type. + * @throws {Error} If this type cannot be built directly + * @expose + */ + TPrototype.build = function() { + throw Error(this.toString(true)+" cannot be built directly"); + }; + + /** + * @alias ProtoBuf.Reflect.T + * @expose + */ + Reflect.T = T; + + /** + * Constructs a new Namespace. + * @exports ProtoBuf.Reflect.Namespace + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent + * @param {string} name Namespace name + * @param {Object.=} options Namespace options + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Namespace = function(builder, parent, name, options, syntax) { + T.call(this, builder, parent, name); + + /** + * @override + */ + this.className = "Namespace"; + + /** + * Children inside the namespace. + * @type {!Array.} + */ + this.children = []; + + /** + * Options. + * @type {!Object.} + */ + this.options = options || {}; + + /** + * Syntax level (e.g., proto2 or proto3). + * @type {!string} + */ + this.syntax = syntax || "proto2"; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace.prototype + * @inner + */ + var NamespacePrototype = Namespace.prototype = Object.create(T.prototype); + + /** + * Returns an array of the namespace's children. + * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children). + * @return {Array.} + * @expose + */ + NamespacePrototype.getChildren = function(type) { + type = type || null; + if (type == null) + return this.children.slice(); + var children = []; + for (var i=0, k=this.children.length; i} qn Qualified name to resolve + * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false` + * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found + * @expose + */ + NamespacePrototype.resolve = function(qn, excludeNonNamespace) { + var part = typeof qn === 'string' ? qn.split(".") : qn, + ptr = this, + i = 0; + if (part[i] === "") { // Fully qualified name, e.g. ".My.Message' + while (ptr.parent !== null) + ptr = ptr.parent; + i++; + } + var child; + do { + do { + if (!(ptr instanceof Reflect.Namespace)) { + ptr = null; + break; + } + child = ptr.getChild(part[i]); + if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) { + ptr = null; + break; + } + ptr = child; i++; + } while (i < part.length); + if (ptr != null) + break; // Found + // Else search the parent + if (this.parent !== null) + return this.parent.resolve(qn, excludeNonNamespace); + } while (ptr != null); + return ptr; + }; + + /** + * Determines the shortest qualified name of the specified type, if any, relative to this namespace. + * @param {!ProtoBuf.Reflect.T} t Reflection type + * @returns {string} The shortest qualified name or, if there is none, the fqn + * @expose + */ + NamespacePrototype.qn = function(t) { + var part = [], ptr = t; + do { + part.unshift(ptr.name); + ptr = ptr.parent; + } while (ptr !== null); + for (var len=1; len <= part.length; len++) { + var qn = part.slice(part.length-len); + if (t === this.resolve(qn, t instanceof Reflect.Namespace)) + return qn.join("."); + } + return t.fqn(); + }; + + /** + * Builds the namespace and returns the runtime counterpart. + * @return {Object.} Runtime namespace + * @expose + */ + NamespacePrototype.build = function() { + /** @dict */ + var ns = {}; + var children = this.children; + for (var i=0, k=children.length, child; i} + */ + NamespacePrototype.buildOpt = function() { + var opt = {}, + keys = Object.keys(this.options); + for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option + */ + NamespacePrototype.getOption = function(name) { + if (typeof name === 'undefined') + return this.options; + return typeof this.options[name] !== 'undefined' ? this.options[name] : null; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace + * @expose + */ + Reflect.Namespace = Namespace; + + /** + * Constructs a new Element implementation that checks and converts values for a + * particular field type, as appropriate. + * + * An Element represents a single value: either the value of a singular field, + * or a value contained in one entry of a repeated field or map field. This + * class does not implement these higher-level concepts; it only encapsulates + * the low-level typechecking and conversion. + * + * @exports ProtoBuf.Reflect.Element + * @param {{name: string, wireType: number}} type Resolved data type + * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant + * (e.g. submessage field). + * @param {boolean} isMapKey Is this element a Map key? The value will be + * converted to string form if so. + * @param {string} syntax Syntax level of defining message type, e.g., + * proto2 or proto3. + * @param {string} name Name of the field containing this element (for error + * messages) + * @constructor + */ + var Element = function(type, resolvedType, isMapKey, syntax, name) { + + /** + * Element type, as a string (e.g., int32). + * @type {{name: string, wireType: number}} + */ + this.type = type; + + /** + * Element type reference to submessage or enum definition, if needed. + * @type {ProtoBuf.Reflect.T|null} + */ + this.resolvedType = resolvedType; + + /** + * Element is a map key. + * @type {boolean} + */ + this.isMapKey = isMapKey; + + /** + * Syntax level of defining message type, e.g., proto2 or proto3. + * @type {string} + */ + this.syntax = syntax; + + /** + * Name of the field containing this element (for error messages) + * @type {string} + */ + this.name = name; + + if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0) + throw Error("Invalid map key type: " + type.name); + }; + + var ElementPrototype = Element.prototype; + + /** + * Obtains a (new) default value for the specified type. + * @param type {string|{name: string, wireType: number}} Field type + * @returns {*} Default value + * @inner + */ + function mkDefault(type) { + if (typeof type === 'string') + type = ProtoBuf.TYPES[type]; + if (typeof type.defaultValue === 'undefined') + throw Error("default value for type "+type.name+" is not supported"); + if (type == ProtoBuf.TYPES["bytes"]) + return new ByteBuffer(0); + return type.defaultValue; + } + + /** + * Returns the default value for this field in proto3. + * @function + * @param type {string|{name: string, wireType: number}} the field type + * @returns {*} Default value + */ + Element.defaultFieldValue = mkDefault; + + /** + * Makes a Long from a value. + * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for + * strings and numbers + * @returns {!Long} + * @throws {Error} If the value cannot be converted to a Long + * @inner + */ + function mkLong(value, unsigned) { + if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' + && value.low === value.low && value.high === value.high) + return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned); + if (typeof value === 'string') + return ProtoBuf.Long.fromString(value, unsigned || false, 10); + if (typeof value === 'number') + return ProtoBuf.Long.fromNumber(value, unsigned || false); + throw Error("not convertible to Long"); + } + + ElementPrototype.toString = function() { + return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element'; + } + + /** + * Checks if the given value can be set for an element of this type (singular + * field or one element of a repeated field or map). + * @param {*} value Value to check + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be verified for this element slot + * @expose + */ + ElementPrototype.verifyValue = function(value) { + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + switch (this.type) { + // Signed 32bit + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + // Account for !NaN: value === value + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value > 4294967295 ? value | 0 : value; + + // Unsigned 32bit + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value < 0 ? value >>> 0 : value; + + // Signed 64bit + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, false); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Unsigned 64bit + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, true); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value !== 'boolean') + fail(typeof value, "not a boolean"); + return value; + + // Float + case ProtoBuf.TYPES["float"]: + case ProtoBuf.TYPES["double"]: + if (typeof value !== 'number') + fail(typeof value, "not a number"); + return value; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + if (typeof value !== 'string' && !(value && value instanceof String)) + fail(typeof value, "not a string"); + return ""+value; // Convert String object to string + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (ByteBuffer.isByteBuffer(value)) + return value; + return ByteBuffer.wrap(value, "base64"); + + // Constant enum value + case ProtoBuf.TYPES["enum"]: { + var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value); + for (i=0; i 4294967295 || value < 0) + fail(typeof value, "not in range for uint32") + return value; + } else { + // proto2 requires enum values to be valid. + fail(value, "not a valid enum value"); + } + } + // Embedded message + case ProtoBuf.TYPES["group"]: + case ProtoBuf.TYPES["message"]: { + if (!value || typeof value !== 'object') + fail(typeof value, "object expected"); + if (value instanceof this.resolvedType.clazz) + return value; + if (value instanceof ProtoBuf.Builder.Message) { + // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180) + var obj = {}; + for (var i in value) + if (value.hasOwnProperty(i)) + obj[i] = value[i]; + value = obj; + } + // Else let's try to construct one from a key-value object + return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons + } + } + + // We should never end here + throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")"); + }; + + /** + * Calculates the byte length of an element on the wire. + * @param {number} id Field number + * @param {*} value Field value + * @returns {number} Byte length + * @throws {Error} If the value cannot be calculated + * @expose + */ + ElementPrototype.calculateLength = function(id, value) { + if (value === null) return 0; // Nothing to encode + // Tag has already been written + var n; + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["uint32"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["sint32"]: + return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value)); + case ProtoBuf.TYPES["fixed32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["float"]: + return 4; + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + return ByteBuffer.calculateVarint64(value); + case ProtoBuf.TYPES["sint64"]: + return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value)); + case ProtoBuf.TYPES["fixed64"]: + case ProtoBuf.TYPES["sfixed64"]: + return 8; + case ProtoBuf.TYPES["bool"]: + return 1; + case ProtoBuf.TYPES["enum"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["double"]: + return 8; + case ProtoBuf.TYPES["string"]: + n = ByteBuffer.calculateUTF8Bytes(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining(); + case ProtoBuf.TYPES["message"]: + n = this.resolvedType.calculate(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["group"]: + n = this.resolvedType.calculate(value); + return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + } + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + }; + + /** + * Encodes a value to the specified buffer. Does not encode the key. + * @param {number} id Field number + * @param {*} value Field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the value cannot be encoded + * @expose + */ + ElementPrototype.encodeValue = function(id, value, buffer) { + if (value === null) return buffer; // Nothing to encode + // Tag has already been written + + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes + // long – it is, effectively, treated like a very large unsigned integer." (see #122) + if (value < 0) + buffer.writeVarint64(value); + else + buffer.writeVarint32(value); + break; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + buffer.writeVarint32(value); + break; + + // 32bit varint zig-zag + case ProtoBuf.TYPES["sint32"]: + buffer.writeVarint32ZigZag(value); + break; + + // Fixed unsigned 32bit + case ProtoBuf.TYPES["fixed32"]: + buffer.writeUint32(value); + break; + + // Fixed signed 32bit + case ProtoBuf.TYPES["sfixed32"]: + buffer.writeInt32(value); + break; + + // 64bit varint as-is + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + buffer.writeVarint64(value); // throws + break; + + // 64bit varint zig-zag + case ProtoBuf.TYPES["sint64"]: + buffer.writeVarint64ZigZag(value); // throws + break; + + // Fixed unsigned 64bit + case ProtoBuf.TYPES["fixed64"]: + buffer.writeUint64(value); // throws + break; + + // Fixed signed 64bit + case ProtoBuf.TYPES["sfixed64"]: + buffer.writeInt64(value); // throws + break; + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value === 'string') + buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value); + else + buffer.writeVarint32(value ? 1 : 0); + break; + + // Constant enum value + case ProtoBuf.TYPES["enum"]: + buffer.writeVarint32(value); + break; + + // 32bit float + case ProtoBuf.TYPES["float"]: + buffer.writeFloat32(value); + break; + + // 64bit float + case ProtoBuf.TYPES["double"]: + buffer.writeFloat64(value); + break; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + buffer.writeVString(value); + break; + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + var prevOffset = value.offset; + buffer.writeVarint32(value.remaining()); + buffer.append(value); + value.offset = prevOffset; + break; + + // Embedded message + case ProtoBuf.TYPES["message"]: + var bb = new ByteBuffer().LE(); + this.resolvedType.encode(value, bb); + buffer.writeVarint32(bb.offset); + buffer.append(bb.flip()); + break; + + // Legacy group + case ProtoBuf.TYPES["group"]: + this.resolvedType.encode(value, buffer); + buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + break; + + default: + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + } + return buffer; + }; + + /** + * Decode one element value from the specified buffer. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number} wireType The field wire type + * @param {number} id The field number + * @return {*} Decoded value + * @throws {Error} If the field cannot be decoded + * @expose + */ + ElementPrototype.decode = function(buffer, wireType, id) { + if (wireType != this.type.wireType) + throw Error("Unexpected wire type for element"); + + var value, nBytes; + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + return buffer.readVarint32() | 0; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + return buffer.readVarint32() >>> 0; + + // 32bit signed varint zig-zag + case ProtoBuf.TYPES["sint32"]: + return buffer.readVarint32ZigZag() | 0; + + // Fixed 32bit unsigned + case ProtoBuf.TYPES["fixed32"]: + return buffer.readUint32() >>> 0; + + case ProtoBuf.TYPES["sfixed32"]: + return buffer.readInt32() | 0; + + // 64bit signed varint + case ProtoBuf.TYPES["int64"]: + return buffer.readVarint64(); + + // 64bit unsigned varint + case ProtoBuf.TYPES["uint64"]: + return buffer.readVarint64().toUnsigned(); + + // 64bit signed varint zig-zag + case ProtoBuf.TYPES["sint64"]: + return buffer.readVarint64ZigZag(); + + // Fixed 64bit unsigned + case ProtoBuf.TYPES["fixed64"]: + return buffer.readUint64(); + + // Fixed 64bit signed + case ProtoBuf.TYPES["sfixed64"]: + return buffer.readInt64(); + + // Bool varint + case ProtoBuf.TYPES["bool"]: + return !!buffer.readVarint32(); + + // Constant enum value (varint) + case ProtoBuf.TYPES["enum"]: + // The following Builder.Message#set will already throw + return buffer.readVarint32(); + + // 32bit float + case ProtoBuf.TYPES["float"]: + return buffer.readFloat(); + + // 64bit float + case ProtoBuf.TYPES["double"]: + return buffer.readDouble(); + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + return buffer.readVString(); + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: { + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + value = buffer.clone(); // Offset already set + value.limit = value.offset+nBytes; + buffer.offset += nBytes; + return value; + } + + // Length-delimited embedded message + case ProtoBuf.TYPES["message"]: { + nBytes = buffer.readVarint32(); + return this.resolvedType.decode(buffer, nBytes); + } + + // Legacy group + case ProtoBuf.TYPES["group"]: + return this.resolvedType.decode(buffer, -1, id); + } + + // We should never end here + throw Error("[INTERNAL] Illegal decode type"); + }; + + /** + * Converts a value from a string to the canonical element type. + * + * Legal only when isMapKey is true. + * + * @param {string} str The string value + * @returns {*} The value + */ + ElementPrototype.valueFromString = function(str) { + if (!this.isMapKey) { + throw Error("valueFromString() called on non-map-key element"); + } + + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + return this.verifyValue(parseInt(str)); + + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: + // Long-based fields support conversions from string already. + return this.verifyValue(str); + + case ProtoBuf.TYPES["bool"]: + return str === "true"; + + case ProtoBuf.TYPES["string"]: + return this.verifyValue(str); + + case ProtoBuf.TYPES["bytes"]: + return ByteBuffer.fromBinary(str); + } + }; + + /** + * Converts a value from the canonical element type to a string. + * + * It should be the case that `valueFromString(valueToString(val))` returns + * a value equivalent to `verifyValue(val)` for every legal value of `val` + * according to this element type. + * + * This may be used when the element must be stored or used as a string, + * e.g., as a map key on an Object. + * + * Legal only when isMapKey is true. + * + * @param {*} val The value + * @returns {string} The string form of the value. + */ + ElementPrototype.valueToString = function(value) { + if (!this.isMapKey) { + throw Error("valueToString() called on non-map-key element"); + } + + if (this.type === ProtoBuf.TYPES["bytes"]) { + return value.toString("binary"); + } else { + return value.toString(); + } + }; + + /** + * @alias ProtoBuf.Reflect.Element + * @expose + */ + Reflect.Element = Element; + + /** + * Constructs a new Message. + * @exports ProtoBuf.Reflect.Message + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace + * @param {string} name Message name + * @param {Object.=} options Message options + * @param {boolean=} isGroup `true` if this is a legacy group + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Message = function(builder, parent, name, options, isGroup, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Message"; + + /** + * Extensions range. + * @type {!Array.|undefined} + * @expose + */ + this.extensions = undefined; + + /** + * Runtime message class. + * @type {?function(new:ProtoBuf.Builder.Message)} + * @expose + */ + this.clazz = null; + + /** + * Whether this is a legacy group or not. + * @type {boolean} + * @expose + */ + this.isGroup = !!isGroup; + + // The following cached collections are used to efficiently iterate over or look up fields when decoding. + + /** + * Cached fields. + * @type {?Array.} + * @private + */ + this._fields = null; + + /** + * Cached fields by id. + * @type {?Object.} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields by name. + * @type {?Object.} + * @private + */ + this._fieldsByName = null; + }; + + /** + * @alias ProtoBuf.Reflect.Message.prototype + * @inner + */ + var MessagePrototype = Message.prototype = Object.create(Namespace.prototype); + + /** + * Builds the message and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Message + * @param {boolean=} rebuild Whether to rebuild or not, defaults to false + * @return {ProtoBuf.Reflect.Message} Message class + * @throws {Error} If the message cannot be built + * @expose + */ + MessagePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Message class in its own scope + var clazz = (function(ProtoBuf, T) { + + var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), + oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf); + + /** + * Constructs a new runtime Message. + * @name ProtoBuf.Builder.Message + * @class Barebone of all runtime messages. + * @param {!Object.|string} values Preset values + * @param {...string} var_args + * @constructor + * @throws {Error} If the message cannot be created + */ + var Message = function(values, var_args) { + ProtoBuf.Builder.Message.call(this); + + // Create virtual oneof properties + for (var i=0, k=oneofs.length; i 0) { + var value; + // Set field values from a values object + if (arguments.length === 1 && values !== null && typeof values === 'object' && + /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) && + /* not a repeated field */ !Array.isArray(values) && + /* not a Map */ !(values instanceof ProtoBuf.Map) && + /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) && + /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) && + /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) { + this.$set(values); + } else // Set field values from arguments, in declaration order + for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false` + * @returns {!ProtoBuf.Builder.Message} this + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.set = function(keyOrObj, value, noAssert) { + if (keyOrObj && typeof keyOrObj === 'object') { + noAssert = value; + for (var ikey in keyOrObj) { + // Check if virtual oneof field - don't set these + if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined) + this.$set(ikey, value, noAssert); + } + return this; + } + var field = T._fieldsByName[keyOrObj]; + if (!noAssert) { + if (!field) + throw Error(this+"#"+keyOrObj+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true)); + this[field.name] = (value = field.verifyValue(value)); // May throw + } else + this[keyOrObj] = value; + if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = this[field.oneof.name]; // Virtual field references currently set field + if (value !== null) { + if (currentField !== null && currentField !== field.name) + this[currentField] = null; // Clear currently set field + this[field.oneof.name] = field.name; // Point virtual field at this field + } else if (/* value === null && */currentField === keyOrObj) + this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared) + } + return this; + }; + + /** + * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}. + * @name ProtoBuf.Builder.Message#$set + * @function + * @param {string|!Object.} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert the value, defaults to `false` + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.$set = MessagePrototype.set; + + /** + * Gets a field's value. + * @name ProtoBuf.Builder.Message#get + * @function + * @param {string} key Key + * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false` + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.get = function(key, noAssert) { + if (noAssert) + return this[key]; + var field = T._fieldsByName[key]; + if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: "+field.toString(true)); + return this[field.name]; + }; + + /** + * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}. + * @name ProtoBuf.Builder.Message#$get + * @function + * @param {string} key Key + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.$get = MessagePrototype.get; + + // Getters and setters + + for (var i=0; i} data Data payload + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @expose + */ + Message.encode = function(data, buffer, noVerify) { + return new Message(data).encode(buffer, noVerify); + }; + + /** + * Calculates the byte length of the message. + * @name ProtoBuf.Builder.Message#calculate + * @function + * @returns {number} Byte length + * @throws {Error} If the message cannot be calculated or if required fields are missing. + * @expose + */ + MessagePrototype.calculate = function() { + return T.calculate(this); + }; + + /** + * Encodes the varint32 length-delimited message. + * @name ProtoBuf.Builder.Message#encodeDelimited + * @function + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ByteBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeDelimited = function(buffer, noVerify) { + var isNew = false; + if (!buffer) + buffer = new ByteBuffer(), + isNew = true; + var enc = new ByteBuffer().LE(); + T.encode(this, enc, noVerify).flip(); + buffer.writeVarint32(enc.remaining()); + buffer.append(enc); + return isNew ? buffer.flip() : buffer; + }; + + /** + * Directly encodes the message to an ArrayBuffer. + * @name ProtoBuf.Builder.Message#encodeAB + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeAB = function() { + try { + return this.encode().toArrayBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer(); + throw(e); + } + }; + + /** + * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}. + * @name ProtoBuf.Builder.Message#toArrayBuffer + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB; + + /** + * Directly encodes the message to a node Buffer. + * @name ProtoBuf.Builder.Message#encodeNB + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are + * missing. The later still returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeNB = function() { + try { + return this.encode().toBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer(); + throw(e); + } + }; + + /** + * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}. + * @name ProtoBuf.Builder.Message#toBuffer + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBuffer = MessagePrototype.encodeNB; + + /** + * Directly encodes the message to a base64 encoded string. + * @name ProtoBuf.Builder.Message#encode64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encode64 = function() { + try { + return this.encode().toBase64(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBase64(); + throw(e); + } + }; + + /** + * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}. + * @name ProtoBuf.Builder.Message#toBase64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBase64 = MessagePrototype.encode64; + + /** + * Directly encodes the message to a hex encoded string. + * @name ProtoBuf.Builder.Message#encodeHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeHex = function() { + try { + return this.encode().toHex(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toHex(); + throw(e); + } + }; + + /** + * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}. + * @name ProtoBuf.Builder.Message#toHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toHex = MessagePrototype.encodeHex; + + /** + * Clones a message object or field value to a raw object. + * @param {*} obj Object to clone + * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field + * @returns {*} Cloned object + * @inner + */ + function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { + if (obj === null || typeof obj !== 'object') { + // Convert enum values to their respective names + if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { + var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj); + if (name !== null) + return name; + } + // Pass-through string, number, boolean, null... + return obj; + } + // Convert ByteBuffers to raw buffer or strings + if (ByteBuffer.isByteBuffer(obj)) + return binaryAsBase64 ? obj.toBase64() : obj.toBuffer(); + // Convert Longs to proper objects or strings + if (ProtoBuf.Long.isLong(obj)) + return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj); + var clone; + // Clone arrays + if (Array.isArray(obj)) { + clone = []; + obj.forEach(function(v, k) { + clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType); + }); + return clone; + } + clone = {}; + // Convert maps to objects + if (obj instanceof ProtoBuf.Map) { + var it = obj.entries(); + for (var e = it.next(); !e.done; e = it.next()) + clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType); + return clone; + } + // Everything else is a non-null object + var type = obj.$type, + field = undefined; + for (var i in obj) + if (obj.hasOwnProperty(i)) { + if (type && (field = type.getChild(i))) + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType); + else + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings); + } + return clone; + } + + /** + * Returns the message's raw payload. + * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false` + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @returns {Object.} Raw payload + * @expose + */ + MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) { + return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type); + }; + + /** + * Encodes a message to JSON. + * @returns {string} JSON string + * @expose + */ + MessagePrototype.encodeJSON = function() { + return JSON.stringify( + cloneRaw(this, + /* binary-as-base64 */ true, + /* longs-as-strings */ true, + this.$type + ) + ); + }; + + /** + * Decodes a message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decode + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {(number|string)=} length Message length. Defaults to decode all the remainig data. + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + * @see ProtoBuf.Builder.Message.decode64 + * @see ProtoBuf.Builder.Message.decodeHex + */ + Message.decode = function(buffer, length, enc) { + if (typeof length === 'string') + enc = length, + length = -1; + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + var le = buffer.littleEndian; + try { + var msg = T.decode(buffer.LE(), length); + buffer.LE(le); + return msg; + } catch (e) { + buffer.LE(le); + throw(e); + } + }; + + /** + * Decodes a varint32 length-delimited message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decodeDelimited + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeDelimited = function(buffer, enc) { + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + if (buffer.remaining() < 1) + return null; + var off = buffer.offset, + len = buffer.readVarint32(); + if (buffer.remaining() < len) { + buffer.offset = off; + return null; + } + try { + var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); + buffer.offset += len; + return msg; + } catch (err) { + buffer.offset += len; + throw err; + } + }; + + /** + * Decodes the message from the specified base64 encoded string. + * @name ProtoBuf.Builder.Message.decode64 + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decode64 = function(str) { + return Message.decode(str, "base64"); + }; + + /** + * Decodes the message from the specified hex encoded string. + * @name ProtoBuf.Builder.Message.decodeHex + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeHex = function(str) { + return Message.decode(str, "hex"); + }; + + /** + * Decodes the message from a JSON string. + * @name ProtoBuf.Builder.Message.decodeJSON + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are + * missing. + * @expose + */ + Message.decodeJSON = function(str) { + return new Message(JSON.parse(str)); + }; + + // Utility + + /** + * Returns a string representation of this Message. + * @name ProtoBuf.Builder.Message#toString + * @function + * @return {string} String representation as of ".Fully.Qualified.MessageName" + * @expose + */ + MessagePrototype.toString = function() { + return T.toString(); + }; + + // Properties + + /** + * Message options. + * @name ProtoBuf.Builder.Message.$options + * @type {Object.} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Message options. + * @name ProtoBuf.Builder.Message#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message.$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message#$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Message, '$options', { "value": T.buildOpt() }), + Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }), + Object.defineProperty(Message, "$type", { "value": T }), + Object.defineProperty(MessagePrototype, "$type", { "value": T }); + + return Message; + + })(ProtoBuf, this); + + // Static enums and prototyped sub-messages / cached collections + this._fields = []; + this._fieldsById = {}; + this._fieldsByName = {}; + this._oneofsByName = {}; + for (var i=0, k=this.children.length, child; i>> 3; + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + do tag = buf.readUint8(); + while ((tag & 0x80) === 0x80); + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buf.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + tag = buf.readVarint32(); // reads the varint + buf.offset += tag; // skips n bytes + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + skipTillGroupEnd(id, buf); + break; + case ProtoBuf.WIRE_TYPES.ENDGROUP: + if (id === expectedId) + return false; + else + throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)"); + case ProtoBuf.WIRE_TYPES.BITS32: + buf.offset += 4; + break; + default: + throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType); + } + return true; + } + + /** + * Decodes an encoded message and returns the decoded message. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number=} length Message length. Defaults to decode all remaining data. + * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group + * @return {ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded + * @expose + */ + MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { + if (typeof length !== 'number') + length = -1; + var start = buffer.offset, + msg = new (this.clazz)(), + tag, wireType, id, field; + while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) { + tag = buffer.readVarint32(); + wireType = tag & 0x07; + id = tag >>> 3; + if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) { + if (id !== expectedGroupEndId) + throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")"); + break; + } + if (!(field = this._fieldsById[id])) { + // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + buffer.readVarint32(); + break; + case ProtoBuf.WIRE_TYPES.BITS32: + buffer.offset += 4; + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buffer.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + var len = buffer.readVarint32(); + buffer.offset += len; + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + while (skipTillGroupEnd(id, buffer)) {} + break; + default: + throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType); + } + continue; + } + if (field.repeated && !field.options["packed"]) { + msg[field.name].push(field.decode(wireType, buffer)); + } else if (field.map) { + var keyval = field.decode(wireType, buffer); + msg[field.name].set(keyval[0], keyval[1]); + } else { + msg[field.name] = field.decode(wireType, buffer); + if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = msg[field.oneof.name]; // Virtual field references currently set field + if (currentField !== null && currentField !== field.name) + msg[currentField] = null; // Clear currently set field + msg[field.oneof.name] = field.name; // Point virtual field at this field + } + } + } + + // Check if all required fields are present and set default values for optional fields that are not + for (var i=0, k=this._fields.length; i=} options Options + * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { + T.call(this, builder, message, name); + + /** + * @override + */ + this.className = "Message.Field"; + + /** + * Message field required flag. + * @type {boolean} + * @expose + */ + this.required = rule === "required"; + + /** + * Message field repeated flag. + * @type {boolean} + * @expose + */ + this.repeated = rule === "repeated"; + + /** + * Message field map flag. + * @type {boolean} + * @expose + */ + this.map = rule === "map"; + + /** + * Message field key type. Type reference string if unresolved, protobuf + * type if resolved. Valid only if this.map === true, null otherwise. + * @type {string|{name: string, wireType: number}|null} + * @expose + */ + this.keyType = keytype || null; + + /** + * Message field type. Type reference string if unresolved, protobuf type if + * resolved. In a map field, this is the value type. + * @type {string|{name: string, wireType: number}} + * @expose + */ + this.type = type; + + /** + * Resolved type reference inside the global namespace. + * @type {ProtoBuf.Reflect.T|null} + * @expose + */ + this.resolvedType = null; + + /** + * Unique message field id. + * @type {number} + * @expose + */ + this.id = id; + + /** + * Message field options. + * @type {!Object.} + * @dict + * @expose + */ + this.options = options || {}; + + /** + * Default value. + * @type {*} + * @expose + */ + this.defaultValue = null; + + /** + * Enclosing OneOf. + * @type {?ProtoBuf.Reflect.Message.OneOf} + * @expose + */ + this.oneof = oneof || null; + + /** + * Syntax level of this definition (e.g., proto3). + * @type {string} + * @expose + */ + this.syntax = syntax || 'proto2'; + + /** + * Original field name. + * @type {string} + * @expose + */ + this.originalName = this.name; // Used to revert camelcase transformation on naming collisions + + /** + * Element implementation. Created in build() after types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.element = null; + + /** + * Key element implementation, for map fields. Created in build() after + * types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.keyElement = null; + + // Convert field names to camel case notation if the override is set + if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField)) + this.name = ProtoBuf.Util.toCamelCase(this.name); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field.prototype + * @inner + */ + var FieldPrototype = Field.prototype = Object.create(T.prototype); + + /** + * Builds the field. + * @override + * @expose + */ + FieldPrototype.build = function() { + this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name); + if (this.map) + this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name); + + // In proto3, fields do not have field presence, and every field is set to + // its type's default value ("", 0, 0.0, or false). + if (this.syntax === 'proto3' && !this.repeated && !this.map) + this.defaultValue = Element.defaultFieldValue(this.type); + + // Otherwise, default values are present when explicitly specified + else if (typeof this.options['default'] !== 'undefined') + this.defaultValue = this.verifyValue(this.options['default']); + }; + + /** + * Checks if the given value can be set for this field. + * @param {*} value Value to check + * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false. + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be set for this field + * @expose + */ + FieldPrototype.verifyValue = function(value, skipRepeated) { + skipRepeated = skipRepeated || false; + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + if (value === null) { // NULL values for optional fields + if (this.required) + fail(typeof value, "required"); + if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"]) + fail(typeof value, "proto3 field without field presence cannot be null"); + return null; + } + var i; + if (this.repeated && !skipRepeated) { // Repeated values as arrays + if (!Array.isArray(value)) + value = [value]; + var res = []; + for (i=0; i 0; + + case ProtoBuf.TYPES["bytes"]: + return value.remaining() > 0; + + case ProtoBuf.TYPES["enum"]: + return value !== 0; + + case ProtoBuf.TYPES["message"]: + return value !== null; + default: + return true; + } + }; + + /** + * Encodes the specified field value to the specified buffer. + * @param {*} value Verified field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @param {!ProtoBuf.Builder.Message} message Runtime message + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the field cannot be encoded + * @expose + */ + FieldPrototype.encode = function(value, buffer, message) { + if (this.type === null || typeof this.type !== 'object') + throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type); + if (value === null || (this.repeated && value.length == 0)) + return buffer; // Optional omitted + try { + if (this.repeated) { + var i; + // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire + // types) can be declared 'packed'." + if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { + // "All of the elements of the field are packed into a single key-value pair with wire type 2 + // (length-delimited). Each element is encoded the same way it would be normally, except without a + // tag preceding it." + buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1 + var start = buffer.offset; // Remember where the contents begin + for (i=0; i 1) { // We need to move the contents + var contents = buffer.slice(start, buffer.offset); + start += varintLen-1; + buffer.offset = start; + buffer.append(contents); + } + buffer.writeVarint32(len, start-varintLen); + } else { + // "If your message definition has repeated elements (without the [packed=true] option), the encoded + // message has zero or more key-value pairs with the same tag number" + for (i=0; i= 0) { + n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + ni = 0; + for (i=0; i= 0) { + if (!skipRepeated) { + nBytes = buffer.readVarint32(); + nBytes = buffer.offset + nBytes; // Limit + var values = []; + while (buffer.offset < nBytes) + values.push(this.decode(this.type.wireType, buffer, true)); + return values; + } + // Read the next value otherwise... + } + + // Handle maps. + if (this.map) { + // Read one (key, value) submessage, and return [key, value] + var key = Element.defaultFieldValue(this.keyType); + value = Element.defaultFieldValue(this.type); + + // Read the length + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + + // Get a sub-buffer of this key/value submessage + var msgbuf = buffer.clone(); + msgbuf.limit = msgbuf.offset + nBytes; + buffer.offset += nBytes; + + while (msgbuf.remaining() > 0) { + var tag = msgbuf.readVarint32(); + wireType = tag & 0x07; + var id = tag >>> 3; + if (id === 1) { + key = this.keyElement.decode(msgbuf, wireType, id); + } else if (id === 2) { + value = this.element.decode(msgbuf, wireType, id); + } else { + throw Error("Unexpected tag in map field key/value submessage"); + } + } + + return [key, value]; + } + + // Handle singular and non-packed repeated field values. + return this.element.decode(buffer, wireType, this.id); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field + * @expose + */ + Reflect.Message.Field = Field; + + /** + * Constructs a new Message ExtensionField. + * @exports ProtoBuf.Reflect.Message.ExtensionField + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} rule Rule, one of requried, optional, repeated + * @param {string} type Data type, e.g. int32 + * @param {string} name Field name + * @param {number} id Unique field id + * @param {!Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Message.Field + */ + var ExtensionField = function(builder, message, rule, type, name, id, options) { + Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); + + /** + * Extension reference. + * @type {!ProtoBuf.Reflect.Extension} + * @expose + */ + this.extension; + }; + + // Extends Field + ExtensionField.prototype = Object.create(Field.prototype); + + /** + * @alias ProtoBuf.Reflect.Message.ExtensionField + * @expose + */ + Reflect.Message.ExtensionField = ExtensionField; + + /** + * Constructs a new Message OneOf. + * @exports ProtoBuf.Reflect.Message.OneOf + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} name OneOf name + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var OneOf = function(builder, message, name) { + T.call(this, builder, message, name); + + /** + * Enclosed fields. + * @type {!Array.} + * @expose + */ + this.fields = []; + }; + + /** + * @alias ProtoBuf.Reflect.Message.OneOf + * @expose + */ + Reflect.Message.OneOf = OneOf; + + /** + * Constructs a new Enum. + * @exports ProtoBuf.Reflect.Enum + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object + * @param {string} name Enum name + * @param {Object.=} options Enum options + * @param {string?} syntax The syntax level (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Enum = function(builder, parent, name, options, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Enum"; + + /** + * Runtime enum object. + * @type {Object.|null} + * @expose + */ + this.object = null; + }; + + /** + * Gets the string name of an enum value. + * @param {!ProtoBuf.Builder.Enum} enm Runtime enum + * @param {number} value Enum value + * @returns {?string} Name or `null` if not present + * @expose + */ + Enum.getName = function(enm, value) { + var keys = Object.keys(enm); + for (var i=0, key; i} + * @expose + */ + EnumPrototype.build = function(rebuild) { + if (this.object && !rebuild) + return this.object; + var enm = new ProtoBuf.Builder.Enum(), + values = this.getChildren(Enum.Value); + for (var i=0, k=values.length; i=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Service = function(builder, root, name, options) { + Namespace.call(this, builder, root, name, options); + + /** + * @override + */ + this.className = "Service"; + + /** + * Built runtime service class. + * @type {?function(new:ProtoBuf.Builder.Service)} + */ + this.clazz = null; + }; + + /** + * @alias ProtoBuf.Reflect.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(Namespace.prototype); + + /** + * Builds the service and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Service + * @param {boolean=} rebuild Whether to rebuild or not + * @return {Function} Service class + * @throws {Error} If the message cannot be built + * @expose + */ + ServicePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Service class in its own scope + return this.clazz = (function(ProtoBuf, T) { + + /** + * Constructs a new runtime Service. + * @name ProtoBuf.Builder.Service + * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message + * @class Barebone of all runtime services. + * @constructor + * @throws {Error} If the service cannot be created + */ + var Service = function(rpcImpl) { + ProtoBuf.Builder.Service.call(this); + + /** + * Service implementation. + * @name ProtoBuf.Builder.Service#rpcImpl + * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} + * @expose + */ + this.rpcImpl = rpcImpl || function(name, msg, callback) { + // This is what a user has to implement: A function receiving the method name, the actual message to + // send (type checked) and the callback that's either provided with the error as its first + // argument or null and the actual response message. + setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async! + }; + }; + + /** + * @alias ProtoBuf.Builder.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); + + /** + * Asynchronously performs an RPC call using the given RPC implementation. + * @name ProtoBuf.Builder.Service.[Method] + * @function + * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + /** + * Asynchronously performs an RPC call using the instance's RPC implementation. + * @name ProtoBuf.Builder.Service#[Method] + * @function + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod); + for (var i=0; i} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Service options. + * @name ProtoBuf.Builder.Service#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service.$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service#$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Service, "$options", { "value": T.buildOpt() }), + Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }), + Object.defineProperty(Service, "$type", { "value": T }), + Object.defineProperty(ServicePrototype, "$type", { "value": T }); + + return Service; + + })(ProtoBuf, this); + }; + + /** + * @alias ProtoBuf.Reflect.Service + * @expose + */ + Reflect.Service = Service; + + /** + * Abstract service method. + * @exports ProtoBuf.Reflect.Service.Method + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Method = function(builder, svc, name, options) { + T.call(this, builder, svc, name); + + /** + * @override + */ + this.className = "Service.Method"; + + /** + * Options. + * @type {Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Reflect.Service.Method.prototype + * @inner + */ + var MethodPrototype = Method.prototype = Object.create(T.prototype); + + /** + * Builds the method's '$options' property. + * @name ProtoBuf.Reflect.Service.Method#buildOpt + * @function + * @return {Object.} + */ + MethodPrototype.buildOpt = NamespacePrototype.buildOpt; + + /** + * @alias ProtoBuf.Reflect.Service.Method + * @expose + */ + Reflect.Service.Method = Method; + + /** + * RPC service method. + * @exports ProtoBuf.Reflect.Service.RPCMethod + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {string} request Request message name + * @param {string} response Response message name + * @param {boolean} request_stream Whether requests are streamed + * @param {boolean} response_stream Whether responses are streamed + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Service.Method + */ + var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) { + Method.call(this, builder, svc, name, options); + + /** + * @override + */ + this.className = "Service.RPCMethod"; + + /** + * Request message name. + * @type {string} + * @expose + */ + this.requestName = request; + + /** + * Response message name. + * @type {string} + * @expose + */ + this.responseName = response; + + /** + * Whether requests are streamed + * @type {bool} + * @expose + */ + this.requestStream = request_stream; + + /** + * Whether responses are streamed + * @type {bool} + * @expose + */ + this.responseStream = response_stream; + + /** + * Resolved request message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedRequestType = null; + + /** + * Resolved response message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedResponseType = null; + }; + + // Extends Method + RPCMethod.prototype = Object.create(Method.prototype); + + /** + * @alias ProtoBuf.Reflect.Service.RPCMethod + * @expose + */ + Reflect.Service.RPCMethod = RPCMethod; + + return Reflect; + + })(ProtoBuf); + + /** + * @alias ProtoBuf.Builder + * @expose + */ + ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { + "use strict"; + + /** + * Constructs a new Builder. + * @exports ProtoBuf.Builder + * @class Provides the functionality to build protocol messages. + * @param {Object.=} options Options + * @constructor + */ + var Builder = function(options) { + + /** + * Namespace. + * @type {ProtoBuf.Reflect.Namespace} + * @expose + */ + this.ns = new Reflect.Namespace(this, null, ""); // Global namespace + + /** + * Namespace pointer. + * @type {ProtoBuf.Reflect.T} + * @expose + */ + this.ptr = this.ns; + + /** + * Resolved flag. + * @type {boolean} + * @expose + */ + this.resolved = false; + + /** + * The current building result. + * @type {Object.|null} + * @expose + */ + this.result = null; + + /** + * Imported files. + * @type {Array.} + * @expose + */ + this.files = {}; + + /** + * Import root override. + * @type {?string} + * @expose + */ + this.importRoot = null; + + /** + * Options. + * @type {!Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Builder.prototype + * @inner + */ + var BuilderPrototype = Builder.prototype; + + // ----- Definition tests ----- + + /** + * Tests if a definition most likely describes a message. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessage = function(def) { + // Messages require a string name + if (typeof def["name"] !== 'string') + return false; + // Messages do not contain values (enum) or rpc methods (service) + if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a message field. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessageField = function(def) { + // Message fields require a string rule, name and type and an id + if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an enum. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isEnum = function(def) { + // Enums require a string name + if (typeof def["name"] !== 'string') + return false; + // Enums require at least one value + if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a service. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isService = function(def) { + // Services require a string name and an rpc object + if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"]) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an extended message + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isExtend = function(def) { + // Extends rquire a string ref + if (typeof def["ref"] !== 'string') + return false; + return true; + }; + + // ----- Building ----- + + /** + * Resets the pointer to the root namespace. + * @returns {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.reset = function() { + this.ptr = this.ns; + return this; + }; + + /** + * Defines a namespace on top of the current pointer position and places the pointer on it. + * @param {string} namespace + * @return {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.define = function(namespace) { + if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace)) + throw Error("illegal namespace: "+namespace); + namespace.split(".").forEach(function(part) { + var ns = this.ptr.getChild(part); + if (ns === null) // Keep existing + this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part)); + this.ptr = ns; + }, this); + return this; + }; + + /** + * Creates the specified definitions at the current pointer position. + * @param {!Array.} defs Messages, enums or services to create + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If a message definition is invalid + * @expose + */ + BuilderPrototype.create = function(defs) { + if (!defs) + return this; // Nothing to create + if (!Array.isArray(defs)) + defs = [defs]; + else { + if (defs.length === 0) + return this; + defs = defs.slice(); + } + + // It's quite hard to keep track of scopes and memory here, so let's do this iteratively. + var stack = [defs]; + while (stack.length > 0) { + defs = stack.pop(); + + if (!Array.isArray(defs)) // Stack always contains entire namespaces + throw Error("not a valid namespace: "+JSON.stringify(defs)); + + while (defs.length > 0) { + var def = defs.shift(); // Namespaces always contain an array of messages, enums and services + + if (Builder.isMessage(def)) { + var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]); + + // Create OneOfs + var oneofs = {}; + if (def["oneofs"]) + Object.keys(def["oneofs"]).forEach(function(name) { + obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name)); + }, this); + + // Create fields + if (def["fields"]) + def["fields"].forEach(function(fld) { + if (obj.getChild(fld["id"]|0) !== null) + throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']); + if (fld["options"] && typeof fld["options"] !== 'object') + throw Error("illegal field options in "+obj.name+"#"+fld["name"]); + var oneof = null; + if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]])) + throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]); + fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]); + if (oneof) + oneof.fields.push(fld); + obj.addChild(fld); + }, this); + + // Push children to stack + var subObj = []; + if (def["enums"]) + def["enums"].forEach(function(enm) { + subObj.push(enm); + }); + if (def["messages"]) + def["messages"].forEach(function(msg) { + subObj.push(msg); + }); + if (def["services"]) + def["services"].forEach(function(svc) { + subObj.push(svc); + }); + + // Set extension ranges + if (def["extensions"]) { + if (typeof def["extensions"][0] === 'number') // pre 5.0.1 + obj.extensions = [ def["extensions"] ]; + else + obj.extensions = def["extensions"]; + } + + // Create on top of current namespace + this.ptr.addChild(obj); + if (subObj.length > 0) { + stack.push(defs); // Push the current level back + defs = subObj; // Continue processing sub level + subObj = null; + this.ptr = obj; // And move the pointer to this namespace + obj = null; + continue; + } + subObj = null; + + } else if (Builder.isEnum(def)) { + + obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]); + def["values"].forEach(function(val) { + obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isService(def)) { + + obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]); + Object.keys(def["rpc"]).forEach(function(name) { + var mtd = def["rpc"][name]; + obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isExtend(def)) { + + obj = this.ptr.resolve(def["ref"], true); + if (obj) { + def["fields"].forEach(function(fld) { + if (obj.getChild(fld['id']|0) !== null) + throw Error("duplicate extended field id in "+obj.name+": "+fld['id']); + // Check if field id is allowed to be extended + if (obj.extensions) { + var valid = false; + obj.extensions.forEach(function(range) { + if (fld["id"] >= range[0] && fld["id"] <= range[1]) + valid = true; + }); + if (!valid) + throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)"); + } + // Convert extension field names to camel case notation if the override is set + var name = fld["name"]; + if (this.options['convertFieldsToCamelCase']) + name = ProtoBuf.Util.toCamelCase(name); + // see #161: Extensions use their fully qualified name as their runtime key and... + var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]); + // ...are added on top of the current namespace as an extension which is used for + // resolving their type later on (the extension always keeps the original name to + // prevent naming collisions) + var ext = new Reflect.Extension(this, this.ptr, fld["name"], field); + field.extension = ext; + this.ptr.addChild(ext); + obj.addChild(field); + }, this); + + } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions + throw Error("extended message "+def["ref"]+" is not defined"); + + } else + throw Error("not a valid definition: "+JSON.stringify(def)); + + def = null; + obj = null; + } + // Break goes here + defs = null; + this.ptr = this.ptr.parent; // Namespace done, continue at parent + } + this.resolved = false; // Require re-resolve + this.result = null; // Require re-build + return this; + }; + + /** + * Propagates syntax to all children. + * @param {!Object} parent + * @inner + */ + function propagateSyntax(parent) { + if (parent['messages']) { + parent['messages'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + propagateSyntax(child); + }); + } + if (parent['enums']) { + parent['enums'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + }); + } + } + + /** + * Imports another definition into this builder. + * @param {Object.} json Parsed import + * @param {(string|{root: string, file: string})=} filename Imported file name + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If the definition or file cannot be imported + * @expose + */ + BuilderPrototype["import"] = function(json, filename) { + var delim = '/'; + + // Make sure to skip duplicate imports + + if (typeof filename === 'string') { + + if (ProtoBuf.Util.IS_NODE) + filename = require("path")['resolve'](filename); + if (this.files[filename] === true) + return this.reset(); + this.files[filename] = true; + + } else if (typeof filename === 'object') { // Object with root, file. + + var root = filename.root; + if (ProtoBuf.Util.IS_NODE) + root = require("path")['resolve'](root); + if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0) + delim = '\\'; + var fname; + if (ProtoBuf.Util.IS_NODE) + fname = require("path")['join'](root, filename.file); + else + fname = root + delim + filename.file; + if (this.files[fname] === true) + return this.reset(); + this.files[fname] = true; + } + + // Import imports + + if (json['imports'] && json['imports'].length > 0) { + var importRoot, + resetRoot = false; + + if (typeof filename === 'object') { // If an import root is specified, override + + this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards + importRoot = this.importRoot; + filename = filename["file"]; + if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) + delim = '\\'; + + } else if (typeof filename === 'string') { + + if (this.importRoot) // If import root is overridden, use it + importRoot = this.importRoot; + else { // Otherwise compute from filename + if (filename.indexOf("/") >= 0) { // Unix + importRoot = filename.replace(/\/[^\/]*$/, ""); + if (/* /file.proto */ importRoot === "") + importRoot = "/"; + } else if (filename.indexOf("\\") >= 0) { // Windows + importRoot = filename.replace(/\\[^\\]*$/, ""); + delim = '\\'; + } else + importRoot = "."; + } + + } else + importRoot = null; + + for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned. + * @returns {!ProtoBuf.Builder.Message|!Object.} + * @throws {Error} If a type could not be resolved + * @expose + */ + BuilderPrototype.build = function(path) { + this.reset(); + if (!this.resolved) + this.resolveAll(), + this.resolved = true, + this.result = null; // Require re-build + if (this.result === null) // (Re-)Build + this.result = this.ns.build(); + if (!path) + return this.result; + var part = typeof path === 'string' ? path.split(".") : path, + ptr = this.result; // Build namespace pointer (no hasChild etc.) + for (var i=0; i=} contents Initial contents + * @constructor + */ + var Map = function(field, contents) { + if (!field.map) + throw Error("field is not a map"); + + /** + * The field corresponding to this map. + * @type {!ProtoBuf.Reflect.Field} + */ + this.field = field; + + /** + * Element instance corresponding to key type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax); + + /** + * Element instance corresponding to value type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax); + + /** + * Internal map: stores mapping of (string form of key) -> (key, value) + * pair. + * + * We provide map semantics for arbitrary key types, but we build on top + * of an Object, which has only string keys. In order to avoid the need + * to convert a string key back to its native type in many situations, + * we store the native key value alongside the value. Thus, we only need + * a one-way mapping from a key type to its string form that guarantees + * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1 + * === K2). + * + * @type {!Object} + */ + this.map = {}; + + /** + * Returns the number of elements in the map. + */ + Object.defineProperty(this, "size", { + get: function() { return Object.keys(this.map).length; } + }); + + // Fill initial contents from a raw object. + if (contents) { + var keys = Object.keys(contents); + for (var i = 0; i < keys.length; i++) { + var key = this.keyElem.valueFromString(keys[i]); + var val = this.valueElem.verifyValue(contents[keys[i]]); + this.map[this.keyElem.valueToString(key)] = + { key: key, value: val }; + } + } + }; + + var MapPrototype = Map.prototype; + + /** + * Helper: return an iterator over an array. + * @param {!Array<*>} arr the array + * @returns {!Object} an iterator + * @inner + */ + function arrayIterator(arr) { + var idx = 0; + return { + next: function() { + if (idx < arr.length) + return { done: false, value: arr[idx++] }; + return { done: true }; + } + } + } + + /** + * Clears the map. + */ + MapPrototype.clear = function() { + this.map = {}; + }; + + /** + * Deletes a particular key from the map. + * @returns {boolean} Whether any entry with this key was deleted. + */ + MapPrototype["delete"] = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + var hadKey = keyValue in this.map; + delete this.map[keyValue]; + return hadKey; + }; + + /** + * Returns an iterator over [key, value] pairs in the map. + * @returns {Object} The iterator + */ + MapPrototype.entries = function() { + var entries = []; + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + entries.push([(entry=this.map[strKeys[i]]).key, entry.value]); + return arrayIterator(entries); + }; + + /** + * Returns an iterator over keys in the map. + * @returns {Object} The iterator + */ + MapPrototype.keys = function() { + var keys = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + keys.push(this.map[strKeys[i]].key); + return arrayIterator(keys); + }; + + /** + * Returns an iterator over values in the map. + * @returns {!Object} The iterator + */ + MapPrototype.values = function() { + var values = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + values.push(this.map[strKeys[i]].value); + return arrayIterator(values); + }; + + /** + * Iterates over entries in the map, calling a function on each. + * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments. + * @param {Object=} thisArg The `this` value for the callback + */ + MapPrototype.forEach = function(cb, thisArg) { + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this); + }; + + /** + * Sets a key in the map to the given value. + * @param {*} key The key + * @param {*} value The value + * @returns {!ProtoBuf.Map} The map instance + */ + MapPrototype.set = function(key, value) { + var keyValue = this.keyElem.verifyValue(key); + var valValue = this.valueElem.verifyValue(value); + this.map[this.keyElem.valueToString(keyValue)] = + { key: keyValue, value: valValue }; + return this; + }; + + /** + * Gets the value corresponding to a key in the map. + * @param {*} key The key + * @returns {*|undefined} The value, or `undefined` if key not present + */ + MapPrototype.get = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + if (!(keyValue in this.map)) + return undefined; + return this.map[keyValue].value; + }; + + /** + * Determines whether the given key is present in the map. + * @param {*} key The key + * @returns {boolean} `true` if the key is present + */ + MapPrototype.has = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + return (keyValue in this.map); + }; + + return Map; + })(ProtoBuf, ProtoBuf.Reflect); + + + /** + * Loads a .proto string and returns the Builder. + * @param {string} proto .proto file contents + * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.loadProto = function(proto, builder, filename) { + if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) + filename = builder, + builder = undefined; + return ProtoBuf.loadJson(ProtoBuf.DotProto.Parser.parse(proto), builder, filename); + }; + + /** + * Loads a .proto string and returns the Builder. This is an alias of {@link ProtoBuf.loadProto}. + * @function + * @param {string} proto .proto file contents + * @param {(ProtoBuf.Builder|string)=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.protoFromString = ProtoBuf.loadProto; // Legacy + + /** + * Loads a .proto file and returns the Builder. + * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.loadProtoFile = function(filename, callback, builder) { + if (callback && typeof callback === 'object') + builder = callback, + callback = null; + else if (!callback || typeof callback !== 'function') + callback = null; + if (callback) + return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { + if (contents === null) { + callback(Error("Failed to fetch file")); + return; + } + try { + callback(null, ProtoBuf.loadProto(contents, builder, filename)); + } catch (e) { + callback(e); + } + }); + var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); + return contents === null ? null : ProtoBuf.loadProto(contents, builder, filename); + }; + + /** + * Loads a .proto file and returns the Builder. This is an alias of {@link ProtoBuf.loadProtoFile}. + * @function + * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {!ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile; // Legacy + + + /** + * Constructs a new empty Builder. + * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf + * @return {!ProtoBuf.Builder} Builder + * @expose + */ + ProtoBuf.newBuilder = function(options) { + options = options || {}; + if (typeof options['convertFieldsToCamelCase'] === 'undefined') + options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase; + if (typeof options['populateAccessors'] === 'undefined') + options['populateAccessors'] = ProtoBuf.populateAccessors; + return new ProtoBuf.Builder(options); + }; + + /** + * Loads a .json definition and returns the Builder. + * @param {!*|string} json JSON definition + * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.loadJson = function(json, builder, filename) { + if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) + filename = builder, + builder = null; + if (!builder || typeof builder !== 'object') + builder = ProtoBuf.newBuilder(); + if (typeof json === 'string') + json = JSON.parse(json); + builder["import"](json, filename); + builder.resolveAll(); + return builder; + }; + + /** + * Loads a .json file and returns the Builder. + * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.loadJsonFile = function(filename, callback, builder) { + if (callback && typeof callback === 'object') + builder = callback, + callback = null; + else if (!callback || typeof callback !== 'function') + callback = null; + if (callback) + return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { + if (contents === null) { + callback(Error("Failed to fetch file")); + return; + } + try { + callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); + } catch (e) { + callback(e); + } + }); + var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); + return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); + }; + + return ProtoBuf; +}); diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.js new file mode 100644 index 0000000..245605e --- /dev/null +++ b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.js @@ -0,0 +1,116 @@ +/* + protobuf.js (c) 2013 Daniel Wirtz + Released under the Apache License, Version 2.0 + see: https://github.com/dcodeIO/protobuf.js for details +*/ +var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,p,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[p]=d.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; +$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++}; +$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var p=0;return $jscomp.iteratorPrototype(function(){return p]/g,RULE:/^(?:required|optional|repeated|map)$/, +TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, +BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g};d.DotProto=function(b,d){function e(b,c){var l,a=1;"-"==b.charAt(0)&&(a=-1,b=b.substring(1));if(d.NUMBER_DEC.test(b))l=parseInt(b);else if(d.NUMBER_HEX.test(b))l=parseInt(b.substring(2),16);else if(d.NUMBER_OCT.test(b))l= +parseInt(b.substring(1),8);else throw Error("illegal id value: "+(0>a?"-":"")+b);l=a*l|0;if(!c&&0>l)throw Error("illegal id value: "+(0>a?"-":"")+b);return l}function t(b){var c=1;"-"==b.charAt(0)&&(c=-1,b=b.substring(1));if(d.NUMBER_DEC.test(b))return c*parseInt(b,10);if(d.NUMBER_HEX.test(b))return c*parseInt(b.substring(2),16);if(d.NUMBER_OCT.test(b))return c*parseInt(b.substring(1),8);if("inf"===b)return Infinity*c;if("nan"===b)return NaN;if(d.NUMBER_FLT.test(b))return c*parseFloat(b);throw Error("illegal number value: "+ +(0>c?"-":"")+b);}function m(b,c,d){"undefined"===typeof b[c]?b[c]=d:(Array.isArray(b[c])||(b[c]=[b[c]]),b[c].push(d))}var n={},a=function(b){this.source=b+"";this.index=0;this.line=1;this.stack=[];this._stringOpen=null},g=a.prototype;g._readString=function(){var b='"'===this._stringOpen?d.STRING_DQ:d.STRING_SQ;b.lastIndex=this.index-1;var c=b.exec(this.source);if(!c)throw Error("unterminated string");this.index=b.lastIndex;this.stack.push(this._stringOpen);this._stringOpen=null;return c[1]};g.next= +function(){if(0=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var b,c;do{for(b=!1;d.WHITESPACE.test(c=this.source.charAt(this.index));)if("\n"===c&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index; +++this.line;b=!0}else if("*"===(c=this.source.charAt(this.index))){do{"\n"===c&&++this.line;if(++this.index===this.source.length)return null;b=c;c=this.source.charAt(this.index)}while("*"!==b||"/"!==c);++this.index;b=!0}else return"/"}while(b);if(this.index===this.source.length)return null;c=this.index;d.DELIM.lastIndex=0;if(!d.DELIM.test(this.source.charAt(c++)))for(;c");c=this.tn.next(); +if(!d.NAME.test(c))throw Error("illegal message field name: "+c);g.name=c;this.tn.skip("=");g.id=e(this.tn.next());c=this.tn.peek();"["===c&&this._parseFieldOptions(g);this.tn.skip(";")}else if(a="undefined"!==typeof a?a:this.tn.next(),"group"===a){c=this._parseMessage(b,g);if(!/^[A-Z]/.test(c.name))throw Error("illegal group name: "+c.name);g.type=c.name;g.name=c.name.toLowerCase();this.tn.omit(";")}else{if(!d.TYPE.test(a)&&!d.TYPEREF.test(a))throw Error("illegal message field type: "+a);g.type= +a;c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal message field name: "+c);g.name=c;this.tn.skip("=");g.id=e(this.tn.next());c=this.tn.peek();"["===c&&this._parseFieldOptions(g);this.tn.skip(";")}b.fields.push(g);return g};g._parseMessageOneOf=function(b){var c=this.tn.next();if(!d.NAME.test(c))throw Error("illegal oneof name: "+c);var a=c,g=[];for(this.tn.skip("{");"}"!==(c=this.tn.next());)c=this._parseMessageField(b,"optional",c),c.oneof=a,g.push(c.id);this.tn.omit(";");b.oneofs[a]=g}; +g._parseFieldOptions=function(b){this.tn.skip("[");for(var c=!0;"]"!==this.tn.peek();)c||this.tn.skip(","),this._parseOption(b,!0),c=!1;this.tn.next()};g._parseEnum=function(b){var c={name:"",values:[],options:{}},a=this.tn.next();if(!d.NAME.test(a))throw Error("illegal name: "+a);c.name=a;for(this.tn.skip("{");"}"!==(a=this.tn.next());)if("option"===a)this._parseOption(c);else{if(!d.NAME.test(a))throw Error("illegal name: "+a);this.tn.skip("=");var g={name:a,id:e(this.tn.next(),!0)},a=this.tn.peek(); +"["===a&&this._parseFieldOptions({options:{}});this.tn.skip(";");c.values.push(g)}this.tn.omit(";");b.enums.push(c)};g._parseExtensionRanges=function(){var a=[],c,d;do{for(d=[];;){c=this.tn.next();switch(c){case "min":c=b.ID_MIN;break;case "max":c=b.ID_MAX;break;default:c=t(c)}d.push(c);if(2===d.length)break;if("to"!==this.tn.peek()){d.push(c);break}this.tn.next()}a.push(d)}while(this.tn.omit(","));this.tn.skip(";");return a};g._parseExtend=function(b){var a=this.tn.next();if(!d.TYPEREF.test(a))throw Error("illegal extend reference: "+ +a);var g={ref:a,fields:[]};for(this.tn.skip("{");"}"!==(a=this.tn.next());)if(d.RULE.test(a))this._parseMessageField(g,a);else if(d.TYPEREF.test(a)){if(!this.proto3)throw Error("illegal field rule: "+a);this._parseMessageField(g,"optional",a)}else throw Error("illegal extend token: "+a);this.tn.omit(";");b.messages.push(g);return g};g.toString=function(){return"Parser at line "+this.tn.line};n.Parser=h;return n}(d,d.Lang);d.Reflect=function(b){function d(f,k){if(f&&"number"===typeof f.low&&"number"=== +typeof f.high&&"boolean"===typeof f.unsigned&&f.low===f.low&&f.high===f.high)return new b.Long(f.low,f.high,"undefined"===typeof k?f.unsigned:k);if("string"===typeof f)return b.Long.fromString(f,k||!1,10);if("number"===typeof f)return b.Long.fromNumber(f,k||!1);throw Error("not convertible to Long");}function y(f,k){var a=k.readVarint32(),c=a&7,a=a>>>3;switch(c){case b.WIRE_TYPES.VARINT:do a=k.readUint8();while(128===(a&128));break;case b.WIRE_TYPES.BITS64:k.offset+=8;break;case b.WIRE_TYPES.LDELIM:a= +k.readVarint32();k.offset+=a;break;case b.WIRE_TYPES.STARTGROUP:y(a,k);break;case b.WIRE_TYPES.ENDGROUP:if(a===f)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+f+" expected)");case b.WIRE_TYPES.BITS32:k.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+f+": "+c);}return!0}var r={},m=function(b,k,a){this.builder=b;this.parent=k;this.name=a},n=m.prototype;n.fqn=function(){var b=this.name,k=this;do{k=k.parent;if(null==k)break;b=k.name+"."+b}while(1);return b}; +n.toString=function(b){return(b?this.className+" ":"")+this.fqn()};n.build=function(){throw Error(this.toString(!0)+" cannot be built directly");};r.T=m;var a=function(b,k,a,c,d){m.call(this,b,k,a);this.className="Namespace";this.children=[];this.options=c||{};this.syntax=d||"proto2"},n=a.prototype=Object.create(m.prototype);n.getChildren=function(b){b=b||null;if(null==b)return this.children.slice();for(var f=[],a=0,c=this.children.length;ab.MAP_KEY_TYPES.indexOf(f))throw Error("Invalid map key type: "+f.name);},h=g.prototype;g.defaultFieldValue=function(f){"string"===typeof f&&(f=b.TYPES[f]);if("undefined"===typeof f.defaultValue)throw Error("default value for type "+f.name+" is not supported");return f==b.TYPES.bytes?new e(0):f.defaultValue}; +h.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"};h.verifyValue=function(f){function a(b,f){throw Error("Illegal value for "+c.toString(!0)+" of type "+c.type.name+": "+b+" ("+f+")");}var c=this;switch(this.type){case b.TYPES.int32:case b.TYPES.sint32:case b.TYPES.sfixed32:return("number"!==typeof f||f===f&&0!==f%1)&&a(typeof f,"not an integer"),4294967295f?f>>>0:f;case b.TYPES.int64:case b.TYPES.sint64:case b.TYPES.sfixed64:if(b.Long)try{return d(f,!1)}catch(x){a(typeof f,x.message)}else a(typeof f,"requires Long.js");case b.TYPES.uint64:case b.TYPES.fixed64:if(b.Long)try{return d(f,!0)}catch(x){a(typeof f,x.message)}else a(typeof f,"requires Long.js");case b.TYPES.bool:return"boolean"!==typeof f&&a(typeof f,"not a boolean"),f;case b.TYPES["float"]:case b.TYPES["double"]:return"number"!==typeof f&&a(typeof f,"not a number"),f;case b.TYPES.string:return"string"=== +typeof f||f&&f instanceof String||a(typeof f,"not a string"),""+f;case b.TYPES.bytes:return e.isByteBuffer(f)?f:e.wrap(f,"base64");case b.TYPES["enum"]:for(var g=this.resolvedType.getChildren(b.Reflect.Enum.Value),h=0;hf)&&a(typeof f,"not in range for uint32"),f;a(f,"not a valid enum value");case b.TYPES.group:case b.TYPES.message:f&& +"object"===typeof f||a(typeof f,"object expected");if(f instanceof this.resolvedType.clazz)return f;if(f instanceof b.Builder.Message){var g={},h;for(h in f)f.hasOwnProperty(h)&&(g[h]=f[h]);f=g}return new this.resolvedType.clazz(f)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+f+" (undefined type "+this.type+")");};h.calculateLength=function(f,a){if(null===a)return 0;var c;switch(this.type){case b.TYPES.int32:return 0>a?e.calculateVarint64(a):e.calculateVarint32(a);case b.TYPES.uint32:return e.calculateVarint32(a); +case b.TYPES.sint32:return e.calculateVarint32(e.zigZagEncode32(a));case b.TYPES.fixed32:case b.TYPES.sfixed32:case b.TYPES["float"]:return 4;case b.TYPES.int64:case b.TYPES.uint64:return e.calculateVarint64(a);case b.TYPES.sint64:return e.calculateVarint64(e.zigZagEncode64(a));case b.TYPES.fixed64:case b.TYPES.sfixed64:return 8;case b.TYPES.bool:return 1;case b.TYPES["enum"]:return e.calculateVarint32(a);case b.TYPES["double"]:return 8;case b.TYPES.string:return c=e.calculateUTF8Bytes(a),e.calculateVarint32(c)+ +c;case b.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return e.calculateVarint32(a.remaining())+a.remaining();case b.TYPES.message:return c=this.resolvedType.calculate(a),e.calculateVarint32(c)+c;case b.TYPES.group:return c=this.resolvedType.calculate(a),c+e.calculateVarint32(f<<3|b.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};h.encodeValue=function(f, +a,c){if(null===a)return c;switch(this.type){case b.TYPES.int32:0>a?c.writeVarint64(a):c.writeVarint32(a);break;case b.TYPES.uint32:c.writeVarint32(a);break;case b.TYPES.sint32:c.writeVarint32ZigZag(a);break;case b.TYPES.fixed32:c.writeUint32(a);break;case b.TYPES.sfixed32:c.writeInt32(a);break;case b.TYPES.int64:case b.TYPES.uint64:c.writeVarint64(a);break;case b.TYPES.sint64:c.writeVarint64ZigZag(a);break;case b.TYPES.fixed64:c.writeUint64(a);break;case b.TYPES.sfixed64:c.writeInt64(a);break;case b.TYPES.bool:"string"=== +typeof a?c.writeVarint32("false"===a.toLowerCase()?0:!!a):c.writeVarint32(a?1:0);break;case b.TYPES["enum"]:c.writeVarint32(a);break;case b.TYPES["float"]:c.writeFloat32(a);break;case b.TYPES["double"]:c.writeFloat64(a);break;case b.TYPES.string:c.writeVString(a);break;case b.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");f=a.offset;c.writeVarint32(a.remaining());c.append(a);a.offset=f;break;case b.TYPES.message:f=(new e).LE(); +this.resolvedType.encode(a,f);c.writeVarint32(f.offset);c.append(f.flip());break;case b.TYPES.group:this.resolvedType.encode(a,c);c.writeVarint32(f<<3|b.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");}return c};h.decode=function(a,c,d){if(c!=this.type.wireType)throw Error("Unexpected wire type for element");switch(this.type){case b.TYPES.int32:return a.readVarint32()|0;case b.TYPES.uint32:return a.readVarint32()>>> +0;case b.TYPES.sint32:return a.readVarint32ZigZag()|0;case b.TYPES.fixed32:return a.readUint32()>>>0;case b.TYPES.sfixed32:return a.readInt32()|0;case b.TYPES.int64:return a.readVarint64();case b.TYPES.uint64:return a.readVarint64().toUnsigned();case b.TYPES.sint64:return a.readVarint64ZigZag();case b.TYPES.fixed64:return a.readUint64();case b.TYPES.sfixed64:return a.readInt64();case b.TYPES.bool:return!!a.readVarint32();case b.TYPES["enum"]:return a.readVarint32();case b.TYPES["float"]:return a.readFloat(); +case b.TYPES["double"]:return a.readDouble();case b.TYPES.string:return a.readVString();case b.TYPES.bytes:d=a.readVarint32();if(a.remaining()b.remaining())return null;var c=b.offset,d=b.readVarint32();if(b.remaining()>>3;if(h===b.WIRE_TYPES.ENDGROUP){if(e!==d)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+e+" ("+(d?d+" expected":"not a group")+")");break}if(k=this._fieldsById[e])k.repeated&&!k.options.packed?g[k.name].push(k.decode(h, +a)):k.map?(h=k.decode(h,a),g[k.name].set(h[0],h[1])):(g[k.name]=k.decode(h,a),k.oneof&&(h=g[k.oneof.name],null!==h&&h!==k.name&&(g[h]=null),g[k.oneof.name]=k.name));else switch(h){case b.WIRE_TYPES.VARINT:a.readVarint32();break;case b.WIRE_TYPES.BITS32:a.offset+=4;break;case b.WIRE_TYPES.BITS64:a.offset+=8;break;case b.WIRE_TYPES.LDELIM:k=a.readVarint32();a.offset+=k;break;case b.WIRE_TYPES.STARTGROUP:for(;y(e,a););break;default:throw Error("Illegal wire type for unknown field "+e+" in "+this.toString(!0)+ +"#decode: "+h);}}a=0;for(c=this._fields.length;a>>=3,1===c)f=this.keyElement.decode(h,a,c);else if(2===c)d=this.element.decode(h,a,c);else throw Error("Unexpected tag in map field key/value submessage"); +return[f,d]}return this.element.decode(c,a,this.id)};r.Message.Field=c;h=function(a,b,d,g,h,e,l){c.call(this,a,b,d,null,g,h,e,l)};h.prototype=Object.create(c.prototype);r.Message.ExtensionField=h;r.Message.OneOf=function(a,b,c){m.call(this,a,b,c);this.fields=[]};var v=function(b,c,d,g,h){a.call(this,b,c,d,g,h);this.className="Enum";this.object=null};v.getName=function(a,b){for(var c=Object.keys(a),d=0,g;d=b[0]&&a.id<=b[1]&&(c=!0)});if(!c)throw Error("illegal extended field id in "+l.name+": "+a.id+" (not within valid ranges)");}var d=a.name;this.options.convertFieldsToCamelCase&&(d=b.Util.toCamelCase(d));var d=new e.Message.ExtensionField(this,l,a.rule,a.type,this.ptr.fqn()+"."+d,a.id,a.options),g=new e.Extension(this,this.ptr,a.name,d);d.extension=g;this.ptr.addChild(g);l.addChild(d)},this);else{if(!/\.?google\.protobuf\./.test(h.ref))throw Error("extended message "+ +h.ref+" is not defined");}else throw Error("not a valid definition: "+JSON.stringify(h));l=h=null}a=null;this.ptr=this.ptr.parent}this.resolved=!1;this.result=null;return this};n["import"]=function(a,d){var g="/";if("string"===typeof d){b.Util.IS_NODE&&(d=require("path").resolve(d));if(!0===this.files[d])return this.reset();this.files[d]=!0}else if("object"===typeof d){var e=d.root;b.Util.IS_NODE&&(e=require("path").resolve(e));if(0<=e.indexOf("\\")||0<=d.file.indexOf("\\"))g="\\";e=b.Util.IS_NODE? +require("path").join(e,d.file):e+g+d.file;if(!0===this.files[e])return this.reset();this.files[e]=!0}if(a.imports&&0Pi);d`;q{)hjyg7{@eJ7*!IDf6{u zM^b!IM1-&h3`-M6MJTd#d9Wtox9lK57O*sXR6 z=ueU)PIPi|aisY%OSLG@v~;;x#7U;XpbTW7(Z~n>`Ljg~o9#HqNkZ=|&NI^3?LwQR zMrqX9Xfbwt>kk?(nNe~Kc;AJwOGBrm)mSAgTP6{~^+0}nvXk?F8$^D5+wF>9$8p$@ z4cY*w9Ba25EyHlf5pP5BGhoX6V)6z#dNvDEqX4`3?Zd0H_t&4!Pu`w>afoQWPVeS! z99|QuuT?K7~G-#mW7Q>xPXsz?@dztUw~Mfdc&@p!RN^g45b_3LFpe8d{UK~w==`x{i$Ob!o^EL^x{Fy8FK;ge8Ws2x>ISCEhY)U1&UzUoS zsNktAE6R2OD_@&9m&m7_6TL~~;svup7EQC+aOKAlFmxap0@LmF#+!j`?gP!L2Gns^ z2-?mYXaaLq5&N2L(wfSqq{x zqmhTIbde=NG)3>$bHHG@YWq&#bR}a7&FFdy35$iw9KY9-^sj`d7kXy0Q8qSAxdfYy zYayy8`}u0fMfxKSd<~W+mxmapgM!)a=n=wn%aO|BF5>WR5`>{sjU=Ya83I}PH6w&I zWmdWfgG?tFARzwfE-0j1@V<9oyS-j60XA~Sb_O!le6V;QSa()n6260v8$dQH$Bk_l zn%UT1I1Al1?8T1b<_>ECUt&^Gyux{90O3W5lih*dm={Izan|~`F zB*Y{v{eCZ)FG7NkM=%g1l0Cdez3& z)G7}QLUFoX@oUk!KNOGph`4tdgOqN<5;BJIgSPPr`|mPH00D`4{-bowV}BV!PxaSg zUop8#ht*fmZiz})=QYfozA@05CG$+DctY=HSlj`>T25ei(PO=W@vr!JV`DT#wh(6M zgU#8#0_!k%eIG|tm;-;-YqT!;(_|2ls4{^VLAu`_C+&}^a4Y{5DPq>|Gh%8m{PtBB4a`{XagyoCkBGN0@wr9!s|y$6<~cpPxcA1Z$J{@e;xc$#KZnEm(3@t1m3iDhdYq+cp%! zZmK8<0Y<=<(}ELxc?t%!_Ki6SzB0emF!_2PGe?I_W@=c{Z$raJm8&ja9}sNk@j6w* zpFVDa$Ep>XgfYzutq^Zd698e+a$aEIFHf`eIZIPIWjO}<`gEBSW8p8`aFpJ= z1rNrG567Rb|8?@4^vxsbT`lg(%=|5_y-NKl8kW`myt|`d)q%R z%E8<+%RaO+j1i}Au0Nc9{_Q6*B{T`oH#pro{a1i z$p~a)h#dC#Bhi<)j1fpa_Xt_9<+J4`@ofqz1R(zM)44h&=J#USQ8RbL!qS%y?|;g& z#W^H2EX_7%JJd0>{lUJ7x{*#kq+jRZp@m~FFFz6EDZ`G`VV%c~3%n#w<4L9r9h<&` zifS@QVAu;+?m}#adzUP^gPo5HdlA@Rc{KB8`rN=xMixX%ws8|iZ#J+&+VN$HO_tWG z!q9?Bjg9$`rxqD3hbGN;m{FG7E_G z-v%KA#Kj!0NsW~|WID$+fDxoeA#=1@m@*C7&iCHM@Qb_1)BRiwQ7LC`z4?=BDkWPRB0V;jOR z!H$#{SRNU$RniicF5)OTfE_ua1EVpNas%iD1Wk~- zv*J-_us^y=uU1zZ#~xgbuEyprxzewU7ca+v{rvO$lfnLf^x;4%wZD!RI2{ewKoA3| z`Rh4d82{KeJLs4Nut>z#Jo2u2#8`{Ku@>=V&Hesbxc{|?5^EVt)_KfX%W$yH!^Rrp z!CDA-&HX=4`|8 z*AQ)i?IF>hKfF3Q2f)1{fQ}BJW5j#c{dIrz^$UNadz0h6x8okP^!I*%UtPfHfLfp$ z>Z21j9`*LdL*CLeh6c!XvW{qE6w_S4Ie9H;s!XH+{B-gK02&jQ0B5f+IRK}lY<~M5 zn;%1#N>%68+1YzRP?jt~O(<9zbOh$DT`VxJ4BU?qIt!Yl>@>nR;SyC)P@Gm!1^c049(><26jVwX+G!noV3L3MLkg?J-z>u4uRnTo}~b-p+ldA>ppU}<8{0Jm!a`w9MWlqn?l4$ zE*G%ZE?)0x;*}G4&r0^qgMJlWm2nGvQ`Fm}eE(n}YZyzwR55YQscy7vDH|w`L8p=zhlG1A8WBpXOLJK8(iE7(t0o;H4bAj&r0KE;xWgCblv6+ z0ZjiDQda&F0v(_g0y3lCjWZgHw`(EeGswgoxvz6*S*Nw9)-|Rf;((*M$Jiyi$XyK+ z?0rjLQ#@b%49P@D)9jR!R#LflU<S^VnbjC7*UB^s z&q9!OT8(x&JlnriK1l+dmiUkI5Q8#wTlbY zLAO(L4PN0F&?zh!yK!nhp%9ho6{NT19pX4PH*hsvaY5Gom1}GoK4sMBJ}JEk7L`aK zyl8C}4^^N&!Pq4|uSa%Ge1OQYtFf;O=7|CXP7u$7tZmE3XF%q41L+^?%9Q+YYUcol zXK^!ZNKLzpZ&(!k2|-mSic0oC1$)hf?-7k=8k&nnO4I2PgKX@`DsVZJd%#&UI%eS1 z*{w!Jgh%2rz#TbQs-HTuO1$IwK*iO|a+;`gj?T}{F2}?q3s?v&obruwUR6y8qp^ua zS^f~r`8ggwioIz%fasmFAc8ik@*jVCD;}?MjecSmMS^!bas@Q3ea6U3DZHjSB@<#gl>sWT=)pv0(z0 zA}}3Z4zmRhLNtI8ZetAci4LE zT5{op1p;d-<>_6N(XS6uF2Ht4eG&)jRzm%F?0`gjG&Xv>TF1A&aI z@(0ldd8sHKQOpX|LE=C`8F2y)XekXyp~Mx~vxPLYs*Hq+S0FD$TOAZuhedvMe%@39 z%0q*}R#^)-hE7XXAD3wN2)wkUNF4GBQELoG*S!hIlRK0SK~*lsm`i)(vyf#BZ_$9F zD>q|i(oZzKqmG^i{k9=MbYt^S7EOpq+S&{f_}bw~14Jht!&}W!geVQD4d!@5LYk!8 zt7EL_kJmISnE(`_P(Bz6>yjCMhO;gFlxEtDtKK~sY?J?d^H#W{e6a4xeyrKldI?r< z_*@W#-p99jxseyeyWOUb%cHv8X%%m=^YcVtRCQl1dB_q6tx4VFhdM+@iYPD9gUhc2 zwYp!r#r+CPEW9rjxj$^(Y?eEX!bup!fFK96_of&!m5Id?nZ8vN2=iG1$+YKCvqoZ@ zGix{lt{5PUDQMSv-EdfS`PKEPDa2Bf$O?^t8sMHR8BrmEmU<+n20tlFGZT5evLs-I z?stP&^yUKa3=Wn63%5^_e+T@J#g`#RiK&xL2E-UvXcb_s6c4rvGDp5CMJJu1s#Bs<^B&{W9wP;b zTEnDVilLYfQptvgYfWZ}aO)|LpjG;xMnN^Ob{fg0rtW+z^ zN%{*W$nLW%RdDy()<)u}XR+<&QVZ~cu=p>(56quNbnLLwB4vWx8bWqShQ+ZUBho4S*0-?f>YI0Ev771d3Ax<$1}Pp3n9Po}(eW5Cunw{(b?GoEHTQ=2xT zID}f$vjX2?wM7MftRQ`di1`j-TGt6OLXl3pT~BU`gxL7S6S1}_=2G`M?P;sV_!geR zDty;B9efUbhN(c|zPao;MJ)r)B6c>>X9_sqoz$WE4n>8^<+%lI1-4Z4X^Wbxkoh*I z4w`ReX1HH02*q6sejJtx_?b1M>Dg^mTtHVLjN!~GUmf)YF9yLbMz3#(u=55JQHsfh#D8kL{PwJ4Ro4pIq80Q>nn??)I@JE=?En9tBDj`F zjD(Av7A|ty@MJt-|KDvxd2-OU_nG2}^;7qiZ3-!(imOHy4>K!1vqR0PEc$|c+rx** z{V)dwX>_J7GHpA5ko1n^r*J|@JAIps+agM%ZUSD;Y^l29VGHaUb`ENVvvQd*Q)*eB zA^{fPVO4Y8O`|qtKejHS6r_Y@I@Eq@5vH1>(Uu&|6ZyyL8>nhpk_?(0hGJx_TNMg< z)2N!+9bsB@yJ@Wyk+xOtJ^2+}Ze^P`b>sVz{2)SE*J_?uuPIY77rcj(Uj^{dd~Bmx zVXmJo&4Y*x@Fs@1yk0$Bz+;cR@AyltIuEFkLccgPfz>$#0r~kMr~t>+&Elrg8!Nwh z+_I^uG|ex<$P#r`SSB&rL@fOltqIO=m;`;qS=cu963Mcbun9|8bJ0mUkI znwxJi2sJIF+jm-1lWtAT>9?ikbbD$(Rh=lkFEy7EDl&8Wn9RHucJ4V%=0`i*PId5z zSO7S)9AUK4eN)^u#yiL7Y!WiBdemLq=<@Z6dBa6F>2`^@3Z~R3CRT|5heGM-6g{(G zI)g5}9L#7`8MFlBokDum?Q#UrB@u~H{2d<*HIcnRDP_h=dpBZu7gRfgcxWJ_C{;!KQ`dI5_+f4_;{( z9*oLiq}%+oYj9)5lS#_5p7Y~YQ1Ow}fI6Kz*>*XcZXI5JA2qnsDac?eWd615fG6po zBXS*h0-%WdRN5T}hCv#gWMCl6=q8G9BavToJM0m>fH8re{4|x96Tvf2bt;tF7&D%DwPhwzv+T{Ox`Q?fO8*YRNNqyNe-UxuH>PD zywTvV*W#wbA;DEqu9fEh7|2WTI}Ke~F9T#SW!dX|7FCiiUS(5nM=E!xDzsT?h~>F5 z)t+EFM4h6-UI5CEx#$be?)7AyVI4D*)#rxp;c3rRGvc)ao zco*8(%yj2giXv|9wKW_<9vm^(Bj(49n0q5~Yp-oUbMW=U4QvwZKC2wptV|_LGZ(mn z=}0UTv|LOyc5(uB+^gJRLHj1l=fiag2NC-n9)lva-CVztC;Ka7j;J&~SpFv;8M z?t1%+qp-*nilps(I-lnvkjgAq1PkU#MwLUXx6PN-@7l*!N6>m4D&!Ej*RcZYS#g)4RA;x*z= zT&CJYHLjE5vIGn-qB`Bc9>=wu4CGR( zD_+0)gECZS(0n=fezVtQBKBSxwF;hM#kY4{YvB^b+DarYmFVIME!nd6?$6oHpQ<-n zj;L>E!8O%nD2%R1x$BJ2X1RZX%gKBDzSzO`t;>_E?B)bOZzQ5CMWGLI185@cY89tQ zmyBogvx?pY-Y0-^E4W8!9zbIGDH3|_tR^z7fICn1g)O)!3M28OdZNHUbvs|LQawET z^w04TR*k07%pDPUzozGTIx=wPXnG@OSLURGnGI=zqz|sP)fLd0AsQLNgK52b(*~D$ zG-Yt8RxX!l*l)XL6ry{4BjO@Mq96=X;GkR9ybAC!aIgYh{p>PmXP#doV8hHQx(k)* zP#_9E`c}55WVPR~@LB_mM9$|wE~2xuY@|QN^qkCgK%nlcnj#{7{@EWs|HBu*`|J<@ zb-9|a_S4xaafW;dOylFvVlaIQqr(HWH9m)`X+fq{ro)er^FF?iBjIb0k_dQND;w8e zqjzF5ziQ!$62r)ODhKI1dU8*GzOyep8S5edoZg8{KmJ50>W-qYT4-`A2|^3{C%Re` zyAWTf;3~_RTdD%_EcGz$O%IKtYWahx$RD~dOTq>MgMfu^hYAEXsWpi9WQ&Jz_B_B) z6dxTQ4QPiA(FN3CzM55&*SFaXY|Ai*c3*t%L3Y7r6w8^uJL|M{UC3t_?75POO;CX_ zVZsU|eVR0vwZ2dr;Bf#y>P55UYb1sB(yw)CWfLc=gvhrwd>2~084P@EziR|h6LXa{~eu&Uw*qh3Ee;)Pdb!6jm)jC?<8}>s5=O*!Xn!i6#M2|!aj!| zBJr$xo@N?EQ}!x7?$Xk2o@VpP4#k4JFFqe-(X3Vc+t1L}G<40FgBolx2wjjpO{&S; zb^Z6Oe!jz4e$uKRGiMj|asq=bNUH`uG z`Z&1=)4%?m>Afoa(HzV!p^!3<2i*cye)#c@H_d)Ub zv4rdX8m<7uP$Zn)fMyED(rqFziehnFpLvf5SzH7O){&$NX;d-6$h8iAa*7zA9W{c> z2p?7XE?D{RbaXqK7^1^%e(deutNfy;ZZ~0SgQ9CG?aGfY#kTpew|lShi=MhfrUJ~O zx2ph(A;q5|D+AZUX+E8uo`&{(eleSd1~mlmsErrQGgqhZ7~QoErIgjXVa0?~&qN)k z4p{x`sp1NN&04Oc1uSO@@HxA=L3>!3yKa-NLd!6`VM^YCRW$kbxv>;==o-_EQ3j9t z*6=Geh8TG@S#8%hqbLYGCZauK6oE0iiDsY1@1H_Kt*d=ADJ$&6l2N6=V*hqSFDE(x zrHdawT3=DCl0-DoqL%2rn8eIe^6sa7T%ce3>C>l!Y0|?3x(yVGY7OE_FI1x+?HJRf zPv)ZPzX&hD;oszR;7o^Q2OV`W*qgFL81*uVZbQB1FgWLz7Z>DHIAZgiU878PI@DaW) ziB9&C))Ee}j>UJ9Kir?x@RYvZZQuB07tK^Nctl?BXmJyAtx5}RTTmKeI!;RyZ=;v% zY%eixlRYLOKsm~&huQ3D_v8YaKFT_Bb)qqf4QrGW>+tdSpU+wcdE|D-=CiXxTNDtViCcJ;t-X z)Ao3euAmO>qMogH+3lMVx$h1XGW^g|795EQy5SLcAg4?!B43-4*)u%MX_CWeCJHe$ z=j1u}m)0aq*}6U}Wn9Nq+(hp($Bu+QG;LcFC74o{B*KA-<71opZ{Mai7LM_4JFS!@ zBAZe^dqbVNMK4OHK!r4G(ru^hNhWPi8efOX+hXT+c6OS%YJMzDGEbLp)H5q$R0gE1 z6ED8~z8#I3hpNxcYFDZ!1+gsB+oYa&wyy3G7NdH?y~df)p{JY3Xugd(EXKQa#mJde zG81MzBRTSjF+$Z*L4`?rzrG`5MBA*C2o=qQWuQ4K6rBhAa6{kOJ{r=&PvDw)o&gPW zf!d(W{YoQVbco_6X)ww)-exY$;QUxU@dhpjl@SH*g;!|E#U{R|uO^r~C$U8ljDebD z#CrFnj$ZNa#dI0rEcDL{GP8y`(@$zAFAr-Q)Ex9&KA{v+uN2b9TawLgkw4C&%$Ln> zQ8v4Qe_u%>jBOOno5dCWSPJm9%*_IY?1mH*t_vCat(VWZKnO0I@qzR>=V6!tgxm!o^yWfwz z!5l^Ofno#>vfKIrY3QA{Z-L?q?A$9igRDa20SZq?GUT__e)9uszjxFDb+q5R$7~gO zRR{+AeM_I@RioDY5o06avG#OYN<&CG2HH=5X=a~7HW8z(t&jQ#eh z?&td3Dng@{x|6cE@lR0t4ch5Rgr(=C3Zmj(F^koby#e@&t|Q+hb3FVF>oL}MCw6_x z6L8c)&fQbi+b64}j6Y)S@ZM~TRU0%vq9!n1nnx^ASzY77%NCTj-?neP^7<6r&#EpLqYS4tW)mCelqXTjq?9c|=%dFEv z6>y_i@esvaa}z)yOZX3Ws*$2(3eB%Bw+B@-f@dfxaz}wG9QD41Lx?woJqcZX4i2&C zN3vqLOPs{2K_;4?bBX<>@6+5EtM-S8GZz;nt%oWFRxahyM@%&%WHDmKU3pi zMpNGJGi`jYt<~BoO5j##*;KlAz&2ID=%;Y10FhR}NfcmO4u2ZP!y$5iE3~XMfjy`3 zMdUUauiO~YMfYSD-4lWF#`yu+AR&8PvFY6+R|q^<%`@P5y_ccH=eX`jT&epwB>Hh+ z*}Ng(KHvqhfD83wnF6^ASN#dSDNJ4b)m6Ec{no1Ax~r<_x7Pgv{|(&JVWXH2`Tjv` zzP8I#&gOh^uK3?R?}m)b}!=i>OwgyLzn=TF-!V)@k+%TEaA@w^#zV;V>;lL_@C zXLn6BpuSdtgh~%$j{?I{9JuQ*p#!z*B=_X`r7L*Lwc^0uc@kuHo?kw5oKQr<7kaw$ z=y>1+cW83pywb3KrD~S=fYE=a<}bfFyv}e_Hg0)p=VYe$-LcdA@RuC+dgO$l=7-FNnu)34fMRee`#yW^2}ZQ_5+m;E zX%7FYaCr1A7ANJ8fBVaK0h)=$N-77mcBFfn;yP+HRkm=^I(O2M)g!`g z4jY?C5udCsyYdrPR@>o;F$%k4)B#tF%<;pB!wolqhV?`jbvDECNF`zh>m9+bDqO(< zrYu5o1idDog^&bmcSKiUY)a*;5KFC_SeFx6JSdaZCA?1A@U?U+!8;>%*#BSld*}Do z`~AQ{m;ASF848V~wM)0mrk~KDsF>?k$8~s$>P%=Sm>6tbV9q}p7sDu*$_oHvDQEh5 zk(S!s#{>u}1CE1{sTND9>!=N}zdg|X8s3d%+}*K*a z=zzD63*GNFrQ*n}jhM@R7Sd&rVtbbGe3)tvE)7_PlTA`zZj$l1j$GZxqF%;Lnrn!} zr4Vr{KEIi3i6b%RB|OqKXHd)=_#q!OO$1ZRrD9>FV3wx}YJXne-C-DN48%}ncc}fX ztV)>UO7t58M{#br4H!+t?+^ySLFZ0%-4rL+0}=p`PVRV20wxDet7TGKIB`tr7N`cU zpywZ7Dlp&~+(F`{P{%gcL)K&S(l(PXRC*`r@T_&{fH}s9oA55)#7$fo9sA{KT4riv0K6K~Erx7{kielUaff{Y#{$66AZuWa3e4-? z54DP2lSbvd6fq0Xf0v{t9E~huqj8gcbJJ21E~;g;F(T8mv(t^0YGlQxD(Cfr{r#1M zbE7YGxC62%nr%pt01Fo%vM9E#P`21Crf>uo7fWa`GM~IA8zX;fQmhjYzBOlO4Y~9x zksF!nv%Jk~q3Y=H*UA*2>4}oj+T6Zy7{C2&mbD^4bVkm|j*pxXKr-8Ub4=h2@_l|Y zs!;VAya;ju4rQo)WO?DK_D3UM(o%n9nt&hqFaF54J{R!u{lr!%e8)`#U6@pG1 z?8Ho2n{}`-K>c7jm(*!sW1C4s4`Wky;15!2o_X>nYTkR}u; zMJ|P2Q)VyP)?o4JMJxaq+i4_vr*#Ns0j`1QS8aT()c9Kb(CW{odpUIuv!<3~Ia)ymbR7^~G9Ka*M1UjhUc`CCV zszc$bCs0c&Vq)m=3GYu;IN-KXjb=|1=Nli?{aymZSX@(H*k=zbY<~iqew)2MQSOh3 z0~kO+>!F=kXK0_nq&+&Eda&`~;_k)n`Xs{-(!J6Veum&dm<=!S{{fWvtJ*P%-2;Y6 z_$*5~7+Q9i?Nq#7v9Q0?HJDnetb=$>|J}Bm)6ad==z&t}=+ie^(y6ts|B!1_DLC`^bWA!8wnKwZ|# zKkoExXacl#a(}kB#Ia%Y4&^j8u~w`{8wzrL+9twb$%{!nz3>qVjKW{P{OV6%KKu6h zPlDgq!AJuB9&l1T&6nb`TK+8jV04t{iTxiPAGCH1aj-4+e)>hWlU&wX8% z*48Cx8y$R5G;#f8qoj8o3+aJg0NU}f>lW!gkh2Mxc4nl$e76dMnfOu(XilR(N4a=SF=-g2n^O z(wPnPZa?yrK*`d_MhzHOD;&Q%f=BH085@qjQtY5~77IuUi9OBIkOBW=GpXQ+I#3EA&HWX(QEor_fodUCmzCLXf-%~e#elx z0?AzVvB_NVG09xk3FybRxuY3(m_0&e$hhc(x9PZDibS-cM=8#rpXB`NlAN;NKlN03 z_0Y>IO9RfT@Qf|hThku=;L*)IIXi>jiVnJJbZEC+8K{=T|ii5AqF0&*m#XDJv<=X?m<1dy@naDnZr)JjUsad!NW14T(-kOc_)@)q379z~`^s;evNVtZy@f|c_v1h-F zi>FVYroW9z{S>L-xPstWO-WqX$o8L6?b1E^fvR0j;P)BXl^f9mMld{Q0&w?`o7`;L zcW1GR%jF>?K~Q5Bv9e)Wmyr--v(z~)l19>n+z7I__-K(LZ2Uy}Uj3c&40p&w3n>r1 z?XcU$koT^ijysjYm!e}4GmXZu;y_67OWXDDc*j5VQqzKIS_C`hCBJCbHD^{n-^V}K<@-fk%^r`qN|_I<+brK! zv(t-%D=JgFm60nbrjq%^N9I->afw473h;7=Mgdax;rEq`-?lyAG{W=sd(4Ay8Ham) z+;D?idydlAG~7cA|AW}yUbspYIP|?+0U;mW3n3*wwya4ICFl0%Obpg_w4@b9W^h(b zSNiJlwS7~(xVqV52zH->0Nwv#eN|mQU|O#n?rDaIqPyQ=#64(96tgPhle?;#oiz9N zH+Qr1^Ll;XJmiz&`s%zyTKeKI=SE=s^WFLD^=5sprgS%qqIen|4scwG9?1DCv5d%ybH;M=Rn5gArVk9@ATx9BOno`0-e3s$A1!=YULHIpqleOXV z^xdKCEA5l`t>PNrN(no*BY0{~?rn0g&&DDo11!Rff^oG&zb_}mbN5{Ld$_=nwDr`% z6*!mzz@^C4`0%mdsg>hSX_7c;6*wx1(;+4l2hi0H=r{vz8+NsZ+1Js#gYP-r*TK9T z@jV;O%2CVYi)%Aud|MUO8Xxq)FL)W6;hm5x_0(@L!i7>|9>hk9lTnJ3@s{y8DcT5> zGi4!b{{n45b(InMJin)vry1Zwtv$=04ov65`V)E@)%0S2&xr>5&ySj5Xkw3>qZYo6 zY2G`6U)8#G7sehHuSlJi{eiBGn-9AwH7Q~`G<1ywN;DFHtK;UVi!8DM)NL$vJ5M!4 zdXwy0Q?)$mjX!1d#qFB3p`XIo0_X%)GA0&$z`o=>9q-t~$cCBc?Iof}G+4sZgS*Htdb|UJx-dbQtwudQz26 zuk$lpO!L!=+3EBk2ljID_KuE8(f0d6&%^>>lt4KYxjq9fSWd~!*4Ua#>Wvrnfi{3> z>B&`j#Nm|nPsQKNPp8QL(>ydCd#|aqe7Q4D->v{}d-qfD^@F@xX$Vo~lxZ|?@nKU&z&0i+cvjhacPR1#is`ahRjKgKFgkktu=MU0efc_cP z6;Y;{nDysM#_9ur$y_VWkn?;EMr6Ti>^|>mAE*IlLs2=FRFrqLN-JWXnVe22mrGC6zY41c7yYy{4F$|IPIe*(yCR4t}b_B+i=i{ zMw2i2OT{6Azm&~KJSdR#H7X;ld4iLyLYIayVrzG~z^FFPR9H^K6WWsGT5WBkWHM)G z`mbQ;)$YQ)7i*l zrtUF!6=$SsFgTN2TuE}wt0g^R;P4A9$jm0=$|<>8qc8ua>+*-a-s#Q`h#r>XXnHt~ zRx|akp=SE;BbwRxUBK3FWjL>Pnk`v-F^!pJqFtDe;(bwlA2i$f(u>yZWCWABP zh{wUD%So%7S||2#YmF5i<34MlIAiP^OaTqZ3TdXj}Q@auB4K@^A=Oe_0%4?XiQW zX$}Vlxu|t{34dQK$=L@3^zdC;^d%*(9;4@|)WiE0O;(`-UjdXI+9=!TfOAhO#ZNXIXP#>k+9A~9J3pWEF-E=Jsb1IMv@66QkEA z=q)@_lh&N7&N)?)x`EQlD58fiUk;=F9?D9Zfcqf=c)))XaovSVNIP`rO#b+KFWtIV@3Q~m;Fbzj|HVPbQx ze}a23WMX=i%3f$InJ%4cvUFZncg5}c=KlJYNfol{R{(@7A2B=d@`_OsZtdx*gNj$c zZofNM1n`sdHB-MUw8qFMUtiyo9)||H5)jqZ7uR#(>#I~8yZ2FD@AR5_xXp=vVx!tEG$ z{7OU}6!q--RBCzM2wNPin|#Ehj$XbVN1v$cp=^yRw=fz^Aqvmi8L5=*94Jx#ELN(v3);nP%b#2~h2mNJa70T0;H7vYF|PkhprasnoA(-%Va^{lROn zP;9`R0g`SZzF5_QB=90_@R!@IpUyn9heZ!)HG-+@6@b@2NxMA(kp3uDXhQZBnZ_n2 zMu?R*>&+YyGR%48a8W0nBf63D-jO#x%H{a*xJ!tfpC(tRQ@XTVnwVWVEtB|J?ZS)|MR&IhKw;ZGH-HuG3F%b7Ss;#((S`JS_!2W6OyMjrp* zn*2wWPBrWMi&ZLMwb*EPmz2Xy%l8f|YAO*3#p^Cix!q~5THTm-aqJUIiTn&>-JYpV znCDJ3(;~mQn<&8Z=Lwjay+8I0LZCiK*pa27#bOVIwT)pIi*5?0Y}-q>EVu4!l&aX30^DvI^h$-?%6{i{Pq+IypOZ zA8Ks{;(2)ZqemhDQ9q_QV*mYq&|lkJ8OrLryP{3p+94HZCtO&9qh#@z1s960b)aBQ z+9qo4_o)W84hbNcgV>WrOk-abVU%U!gFe}+noFm#PU^8_+4tr6zBdB{tE# zXo|L)Nof^MCBN@5seHLyMtQ3KVzxu+FgO&A%r3vZzTP}I1|kC+3r<<`?F>N3bZ@2# zv3Yk?xS=vn7^1GVrCX2QVX>=b=CYQ`7mL+=t`4IzE+^k+yBhwZ5Ddj=f6i_kGYDY> zQRx`K7#)TCd51|BW`Q_%m$}wKzr%zKv(t-Mnc6I}@pyTdsp9DY{)c_udtoJUpL4n* z-IpR?b2_Fn2JUbSLUYH_j>Lzh&UgZEJRRYItRes-bEC~+H!_{^q1BLBvAh*;!fTJg zL;%Kvu-OsGE{AvPw`h1&S0T8`N0RYIP>?*ZbU2G_#%Irzx`KVFtaW2$!$V7;_{ob# zHHx5glr5X|!iy~cm6mpyi*}DDuf{f7rtjd>Y^(OXfIW_{(tF2Dq}W#3ZAu7n26jJ*>E}u$k)=5jM?F%)Lzv(2!W7}ju5^kKIY~=EFs(@%+%I_W zr_;FcNlMQ8t;MKG&45f{u)S73Eo~B4v>1X}VCU~Wg#by*g~$1VwjdGL5kFjrQ7S8hH78rQ}k>A)y0 zE$uikk&Q3ZcUDS$R!VhNs)H+`zjEW`|3gOrFExq(&Na&T&)wm$O?DRwYWjg=i&5IP3vDk-psxhIwL;xIRgT<^d81P=a{N07*u0NPd5cN%X$%4xinr_rClZKMvS S@w0`C@&5pbO`;&q+W-Ju4Ij+_ literal 0 HcmV?d00001 diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.map b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.map new file mode 100644 index 0000000..ebc412f --- /dev/null +++ b/legacy-libs/grpc-cloned/node_modules/protobufjs/dist/protobuf.min.map @@ -0,0 +1,8 @@ +{ +"version":3, +"file":"", +"lineCount":116, +"mappings":"A;;;;;AAyBA,IAAI,QAAU,CAGN,MAAQ,EAHF,CCWd,QAAA,eAAA,CACsC,UAAlC,EAAA,MAAO,OAAA,iBAAP,CACA,MAAA,eADA,CAEA,QAAQ,CAAC,CAAD,CAAS,CAAT,CAAmB,CAAnB,CAA+B,CAErC,GAAI,CAAA,IAAJ,EAAsB,CAAA,IAAtB,CACE,KAAM,KAAI,SAAJ,CAAc,2CAAd,CAAN,CAEE,CAAJ,EAAc,KAAA,UAAd,EAAiC,CAAjC,EAA2C,MAAA,UAA3C,GACA,CAAA,CAAO,CAAP,CADA,CACmB,CAAA,MADnB,CALqC,CCV3C,QAAA,UAAA,CAAoB,QAAQ,CAAC,CAAD,CAAc,CACxC,MAAyB,WAAlB,EAAC,MAAO,OAAR,EAAiC,MAAjC,GAA4C,CAA5C,CACH,CADG,CAEe,WAAlB,EAAC,MAAO,OAAR,EAA2C,IAA3C,EAAiC,MAAjC,CAAmD,MAAnD,CAA4D,CAHxB,CAc1C,QAAA,OAAA,CAAiB,OAAA,UAAA,CAAkB,IAAlB,CCvBjB,QAAA,cAAA,CAAwB,gBAOxB;OAAA,WAAA,CAAqB,QAAQ,EAAG,CAE9B,OAAA,WAAA,CAAqB,QAAQ,EAAG,EAE3B,QAAA,OAAA,OAAL,GACE,OAAA,OAAA,OADF,CAC0B,OAAA,OAD1B,CAJ8B,CAWhC,QAAA,eAAA,CAAyB,CASzB,QAAA,OAAA,CAAiB,QAAQ,CAAC,CAAD,CAAkB,CACzC,MACI,QAAA,cADJ,EAC6B,CAD7B,EACgD,EADhD,EACuD,OAAA,eAAA,EAFd,CAW3C;OAAA,mBAAA,CAA6B,QAAQ,EAAG,CACtC,OAAA,WAAA,EACA,KAAI,EAAiB,OAAA,OAAA,OAAA,SAChB,EAAL,GACE,CADF,CACmB,OAAA,OAAA,OAAA,SADnB,CAEM,OAAA,OAAA,OAAA,CAAsB,UAAtB,CAFN,CAK8C,WAA9C,EAAI,MAAO,MAAA,UAAA,CAAgB,CAAhB,CAAX,EACE,OAAA,eAAA,CACI,KAAA,UADJ,CACqB,CADrB,CACqC,CAC/B,aAAc,CAAA,CADiB,CAE/B,SAAU,CAAA,CAFqB,CAO/B,MAAO,QAAQ,EAAG,CAChB,MAAO,QAAA,cAAA,CAAsB,IAAtB,CADS,CAPa,CADrC,CAeF,QAAA,mBAAA,CAA6B,QAAQ,EAAG,EAxBF,CAkCxC,QAAA,cAAA,CAAwB,QAAQ,CAAC,CAAD,CAAQ,CACtC,IAAI,EAAQ,CACZ,OAAO,QAAA,kBAAA,CAA0B,QAAQ,EAAG,CAC1C,MAAI,EAAJ,CAAY,CAAA,OAAZ,CACS,CACL,KAAM,CAAA,CADD,CAEL,MAAO,CAAA,CAAM,CAAA,EAAN,CAFF,CADT,CAMS,CAAC,KAAM,CAAA,CAAP,CAPiC,CAArC,CAF+B,CA0BxC;OAAA,kBAAA,CAA4B,QAAQ,CAAC,CAAD,CAAO,CACzC,OAAA,mBAAA,EAEI,EAAA,CAAW,CAAC,KAAM,CAAP,CAKf,EAAA,CAAS,OAAA,OAAA,OAAA,SAAT,CAAA,CAA2C,QAAQ,EAAG,CAAE,MAAO,KAAT,CACtD,OAAyC,EATA,CChG3C,QAAA,MAAA,CAAgB,OAAA,MAAhB,EAAiC,EAWjC,QAAA,kBAAA,CAA4B,QAAQ,CAAC,CAAD,CAAQ,CAAR,CAAmB,CACrD,OAAA,mBAAA,EAEI,EAAJ,WAAqB,OAArB,GAAqC,CAArC,EAA6C,EAA7C,CACA,KAAI,EAAI,CAAR,CACI,EAAO,CACT,KAAM,QAAQ,EAAG,CACf,GAAI,CAAJ,CAAQ,CAAA,OAAR,CAAsB,CACpB,IAAI,EAAQ,CAAA,EACZ,OAAO,CAAC,MAAO,CAAA,CAAU,CAAV,CAAiB,CAAA,CAAM,CAAN,CAAjB,CAAR,CAAwC,KAAM,CAAA,CAA9C,CAFa,CAItB,CAAA,KAAA,CAAY,QAAQ,EAAG,CAAE,MAAO,CAAC,KAAM,CAAA,CAAP,CAAa,MAAO,IAAK,EAAzB,CAAT,CACvB,OAAO,EAAA,KAAA,EANQ,CADR,CAUX,EAAA,CAAK,MAAA,SAAL,CAAA,CAAwB,QAAQ,EAAG,CAAE,MAAO,EAAT,CACnC,OAAO,EAhB8C,CCJvD;OAAA,SAAA,CAAmB,QAAQ,CAAC,CAAD,CAAS,CAAT,CAAmB,CAAnB,CAA6B,CAA7B,CAAqC,CAC9D,GAAK,CAAL,CAAA,CACI,CAAA,CAAM,OAAA,OACN,EAAA,CAAQ,CAAA,MAAA,CAAa,GAAb,CACZ,KAAS,CAAT,CAAa,CAAb,CAAgB,CAAhB,CAAoB,CAAA,OAApB,CAAmC,CAAnC,CAAsC,CAAA,EAAtC,CAA2C,CACzC,IAAI,EAAM,CAAA,CAAM,CAAN,CACJ,EAAN,GAAa,EAAb,GAAmB,CAAA,CAAI,CAAJ,CAAnB,CAA8B,EAA9B,CACA,EAAA,CAAM,CAAA,CAAI,CAAJ,CAHmC,CAKvC,CAAA,CAAW,CAAA,CAAM,CAAA,OAAN,CAAqB,CAArB,CACX,EAAA,CAAO,CAAA,CAAI,CAAJ,CACP,EAAA,CAAO,CAAA,CAAS,CAAT,CACP,EAAJ,EAAY,CAAZ,EAA4B,IAA5B,EAAoB,CAApB,EACA,OAAA,eAAA,CACI,CADJ,CACS,CADT,CACmB,CAAC,aAAc,CAAA,CAAf,CAAqB,SAAU,CAAA,CAA/B,CAAqC,MAAO,CAA5C,CADnB,CAZA,CAD8D,CCVhE,QAAA,SAAA,CAAiB,sBAAjB,CAAyC,QAAQ,CAAC,CAAD,CAAO,CACtD,MAAI,EAAJ,CAAiB,CAAjB,CAQe,QAAQ,EAAG,CACxB,MAAO,QAAA,kBAAA,CAA0B,IAA1B,CAAgC,QAAQ,CAAC,CAAD,CAAI,CAAE,MAAO,EAAT,CAA5C,CADiB,CAT4B,CAAxD,CAcG,UAdH,CAce,KAdf,CCAA;OAAA,SAAA,CAAiB,yBAAjB,CAA4C,QAAQ,CAAC,CAAD,CAAO,CACzD,MAAI,EAAJ,CAAiB,CAAjB,CAUe,QAAQ,EAAG,CACxB,MAAO,QAAA,kBAAA,CACH,IADG,CACG,QAAQ,CAAC,CAAD,CAAI,CAAJ,CAAO,CAAE,MAAO,CAAC,CAAD,CAAI,CAAJ,CAAT,CADlB,CADiB,CAX+B,CAA3D,CAiBG,UAjBH,CAiBe,KAjBf,CCAA,QAAA,SAAA,CAAiB,wBAAjB,CAA2C,QAAQ,CAAC,CAAD,CAAO,CACxD,MAAI,EAAJ,CAAiB,CAAjB,CASe,QAAQ,EAAG,CACxB,MAAO,QAAA,kBAAA,CAA0B,IAA1B,CAAgC,QAAQ,CAAC,CAAD,CAAI,CAAJ,CAAO,CAAE,MAAO,EAAT,CAA/C,CADiB,CAV8B,CAA1D,CAeG,KAfH,CAeU,KAfV,CCEC;SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CAES,UAAtB,GAAI,MAAOC,OAAX,EAAoCA,MAAA,IAApC,CACNA,MAAA,CAAO,CAAC,YAAD,CAAP,CAAuBD,CAAvB,CADM,CAEiC,UAAvB,GAAI,MAAOE,QAAX,EAAuD,QAAvD,GAAqC,MAAOC,OAA5C,EAAmEA,MAAnE,EAA6EA,MAAA,QAA7E,CAChBA,MAAA,QADgB,CACIH,CAAA,CAAQE,OAAA,CAAQ,YAAR,CAAR,CAA+B,CAAA,CAA/B,CADJ,CAGhB,CAACH,CAAA,QAAD,CAAqBA,CAAA,QAArB,EAA0C,EAA1C,UAHgB,CAG4CC,CAAA,CAAQD,CAAA,QAAA,WAAR,CAPzC,CAA1B,CAAD,CASG,IATH,CASS,QAAQ,CAACK,CAAD,CAAaC,CAAb,CAAyB,CAStC,IAAIC,EAAW,EAMfA,EAAAF,WAAA,CAAsBA,CAMtBE,EAAAC,KAAA,CAAgBH,CAAAG,KAAhB,EAAmC,IAQnCD,EAAAE,QAAA,CAAmB,OAQnBF,EAAAG,WAAA,CAAsB,EAOtBH,EAAAG,WAAAC,OAAA,CAA6B,CAQ7BJ,EAAAG,WAAAE,OAAA,CAA6B,CAQ7BL,EAAAG,WAAAG,OAAA,CAA6B,CAQ7BN,EAAAG,WAAAI,WAAA,CAAiC,CAQjCP,EAAAG,WAAAK,SAAA,CAA+B,CAQ/BR,EAAAG,WAAAM,OAAA,CAA6B,CAQ7BT,EAAAU,oBAAA;AAA+B,CAC3BV,CAAAG,WAAAC,OAD2B,CAE3BJ,CAAAG,WAAAE,OAF2B,CAG3BL,CAAAG,WAAAM,OAH2B,CAa/BT,EAAAW,MAAA,CAAiB,CAEb,MAAS,CACLC,KAAM,OADD,CAELC,SAAUb,CAAAG,WAAAC,OAFL,CAGLU,aAAc,CAHT,CAFI,CAOb,OAAU,CACNF,KAAM,QADA,CAENC,SAAUb,CAAAG,WAAAC,OAFJ,CAGNU,aAAc,CAHR,CAPG,CAYb,OAAU,CACNF,KAAM,QADA,CAENC,SAAUb,CAAAG,WAAAC,OAFJ,CAGNU,aAAc,CAHR,CAZG,CAiBb,MAAS,CACLF,KAAM,OADD,CAELC,SAAUb,CAAAG,WAAAC,OAFL,CAGLU,aAAcd,CAAAC,KAAA,CAAgBD,CAAAC,KAAAc,KAAhB,CAAqCC,IAAAA,EAH9C,CAjBI,CAsBb,OAAU,CACNJ,KAAM,QADA,CAENC,SAAUb,CAAAG,WAAAC,OAFJ,CAGNU,aAAcd,CAAAC,KAAA,CAAgBD,CAAAC,KAAAgB,MAAhB,CAAsCD,IAAAA,EAH9C,CAtBG,CA2Bb,OAAU,CACNJ,KAAM,QADA,CAENC,SAAUb,CAAAG,WAAAC,OAFJ;AAGNU,aAAcd,CAAAC,KAAA,CAAgBD,CAAAC,KAAAc,KAAhB,CAAqCC,IAAAA,EAH7C,CA3BG,CAgCb,KAAQ,CACJJ,KAAM,MADF,CAEJC,SAAUb,CAAAG,WAAAC,OAFN,CAGJU,aAAc,CAAA,CAHV,CAhCK,CAqCb,SAAU,CACNF,KAAM,QADA,CAENC,SAAUb,CAAAG,WAAAE,OAFJ,CAGNS,aAAc,CAHR,CArCG,CA0Cb,OAAU,CACNF,KAAM,QADA,CAENC,SAAUb,CAAAG,WAAAG,OAFJ,CAGNQ,aAAc,EAHR,CA1CG,CA+Cb,MAAS,CACLF,KAAM,OADD,CAELC,SAAUb,CAAAG,WAAAG,OAFL,CAGLQ,aAAc,IAHT,CA/CI,CAoDb,QAAW,CACPF,KAAM,SADC,CAEPC,SAAUb,CAAAG,WAAAM,OAFH,CAGPK,aAAc,CAHP,CApDE,CAyDb,SAAY,CACRF,KAAM,UADE,CAERC,SAAUb,CAAAG,WAAAM,OAFF,CAGRK,aAAc,CAHN,CAzDC,CA8Db,QAAW,CACPF,KAAM,SADC,CAEPC,SAAUb,CAAAG,WAAAE,OAFH;AAGPS,aAAed,CAAAC,KAAA,CAAgBD,CAAAC,KAAAgB,MAAhB,CAAsCD,IAAAA,EAH9C,CA9DE,CAmEb,SAAY,CACRJ,KAAM,UADE,CAERC,SAAUb,CAAAG,WAAAE,OAFF,CAGRS,aAAcd,CAAAC,KAAA,CAAgBD,CAAAC,KAAAc,KAAhB,CAAqCC,IAAAA,EAH3C,CAnEC,CAwEb,QAAS,CACLJ,KAAM,OADD,CAELC,SAAUb,CAAAG,WAAAM,OAFL,CAGLK,aAAc,CAHT,CAxEI,CA6Eb,OAAQ,CACJF,KAAM,MADF,CAEJC,SAAUb,CAAAG,WAAAC,OAFN,CAGJU,aAAc,CAHV,CA7EK,CAkFb,QAAW,CACPF,KAAM,SADC,CAEPC,SAAUb,CAAAG,WAAAG,OAFH,CAGPQ,aAAc,IAHP,CAlFE,CAuFb,MAAS,CACLF,KAAM,OADD,CAELC,SAAUb,CAAAG,WAAAI,WAFL,CAGLO,aAAc,IAHT,CAvFI,CAoGjBd,EAAAkB,cAAA,CAAyB,CACrBlB,CAAAW,MAAA,MADqB,CAErBX,CAAAW,MAAA,OAFqB,CAGrBX,CAAAW,MAAA,SAHqB,CAIrBX,CAAAW,MAAA,OAJqB,CAKrBX,CAAAW,MAAA,QALqB;AAMrBX,CAAAW,MAAA,MANqB,CAOrBX,CAAAW,MAAA,OAPqB,CAQrBX,CAAAW,MAAA,SARqB,CASrBX,CAAAW,MAAA,OATqB,CAUrBX,CAAAW,MAAA,QAVqB,CAWrBX,CAAAW,MAAA,KAXqB,CAYrBX,CAAAW,MAAA,OAZqB,CAarBX,CAAAW,MAAA,MAbqB,CAsBzBX,EAAAmB,OAAA,CAAkB,CAQlBnB,EAAAoB,OAAA,CAAkB,SAQlBpB,EAAAqB,yBAAA,CAAoC,CAAA,CAQpCrB,EAAAsB,kBAAA,CAA6B,CAAA,CAQ7BtB,EAAAuB,iBAAA,CAA4B,CAAA,CAM5BvB,EAAAwB,KAAA,CAAiB,QAAQ,EAAG,CAQxB,IAAIA,EAAO,EAQXA,EAAAC,QAAA,CAAe,EACQ,QADR,GACX,MAAOC,QADI,EACmC,kBADnC,GACoBA,OADpB,CAC4B,EAD5B,EAC0DA,OAAA,QAD1D,CAUfF,EAAAG,IAAA,CAAWC,QAAQ,EAAG,CAUlB,IARA,IAAIC,EAAmB,CACnB,QAAS,EAAG,CAAC,MAAO,KAAIC,cAAZ,CADO,CAEnB,QAAS,EAAG,CAAC,MAAO,KAAIC,aAAJ,CAAkB,gBAAlB,CAAR,CAFO,CAGnB,QAAS,EAAG,CAAC,MAAO,KAAIA,aAAJ,CAAkB,gBAAlB,CAAR,CAHO;AAInB,QAAS,EAAG,CAAC,MAAO,KAAIA,aAAJ,CAAkB,mBAAlB,CAAR,CAJO,CAAvB,CAOIC,EAAM,IAPV,CAQSC,EAAE,CAAX,CAAaA,CAAb,CAAeJ,CAAAK,OAAf,CAAuCD,CAAA,EAAvC,CAA4C,CACxC,GAAI,CAAED,CAAA,CAAMH,CAAA,CAAiBI,CAAjB,CAAA,EAAR,CACJ,MAAOE,CAAP,CAAU,CAAE,QAAF,CACV,KAHwC,CAK5C,GAAKH,CAAAA,CAAL,CACI,KAAMI,MAAA,CAAM,iCAAN,CAAN,CACJ,MAAOJ,EAjBW,CA4BtBR,EAAAa,MAAA,CAAaC,QAAQ,CAACC,CAAD,CAAOC,CAAP,CAAiB,CAC9BA,CAAJ,EAAmC,UAAnC,EAAgB,MAAOA,EAAvB,GACIA,CADJ,CACe,IADf,CAEA,IAAIhB,CAAAC,QAAJ,CAAkB,CACd,IAAIgB,EAAK7C,OAAA,CAAQ,IAAR,CACT,IAAI4C,CAAJ,CACIC,CAAAC,SAAA,CAAYH,CAAZ,CAAkB,QAAQ,CAACI,CAAD,CAAMC,CAAN,CAAY,CAC9BD,CAAJ,CACIH,CAAA,CAAS,IAAT,CADJ,CAGIA,CAAA,CAAS,EAAT,CAAYI,CAAZ,CAJ8B,CAAtC,CADJ,KAQI,IAAI,CACA,MAAOH,EAAAI,aAAA,CAAgBN,CAAhB,CADP,CAEF,MAAOJ,CAAP,CAAU,CACR,MAAO,KADC,CAZF,CAAlB,IAeO,CACH,IAAIH,EAAMR,CAAAG,IAAA,EACVK,EAAAc,KAAA,CAAS,KAAT,CAAgBP,CAAhB,CAAsBC,CAAA,CAAW,CAAA,CAAX,CAAkB,CAAA,CAAxC,CAEAR,EAAAe,iBAAA,CAAqB,QAArB,CAA+B,YAA/B,CACoC,WAApC,GAAI,MAAOf,EAAAgB,iBAAX;AAAgDhB,CAAAgB,iBAAA,CAAqB,YAArB,CAChD,IAAIR,CAAJ,CACIR,CAAAiB,mBAOA,CAPyBC,QAAQ,EAAG,CACV,CAAtB,EAAIlB,CAAAmB,WAAJ,GAC+B,GAA/B,EAAiBnB,CAAAoB,OAAjB,EAAiE,CAAjE,EAAmDpB,CAAAoB,OAAnD,EAAkG,QAAlG,GAAsE,MAAOpB,EAAAqB,aAA7E,CACIb,CAAA,CAASR,CAAAqB,aAAT,CADJ,CAGIb,CAAA,CAAS,IAAT,CAJJ,CADgC,CAOpC,CAAsB,CAAtB,EAAIR,CAAAmB,WAAJ,EAEAnB,CAAAsB,KAAA,CAAS,IAAT,CAVJ,KAaI,OADAtB,EAAAsB,KAAA,CAAS,IAAT,CACA,CAA+B,GAA/B,EAAiBtB,CAAAoB,OAAjB,EAAiE,CAAjE,EAAmDpB,CAAAoB,OAAnD,EAAkG,QAAlG,GAAsE,MAAOpB,EAAAqB,aAA7E,CACWrB,CAAAqB,aADX,CAEO,IArBR,CAlB2B,CAkDtC7B,EAAA+B,YAAA,CAAmBC,QAAQ,CAACC,CAAD,CAAM,CAC7B,MAAOA,EAAAC,QAAA,CAAY,cAAZ,CAA4B,QAAS,CAACC,CAAD,CAAKC,CAAL,CAAS,CACjD,MAAOA,EAAAC,YAAA,EAD0C,CAA9C,CADsB,CAMjC,OAAOrC,EA9GiB,CAAZ,EAsHhBxB,EAAA8D,KAAA,CAAgB,CAGZC,MAAO,2BAHK,CAMZC,KAAM,sCANM;AASZC,KAAM,gHATM,CAYZC,KAAM,0BAZM,CAeZC,QAAS,yBAfG,CAkBZC,QAAS,8DAlBG,CAqBZC,UAAW,iCArBC,CAwBZC,OAAQ,+FAxBI,CA2BZC,WAAY,qBA3BA,CA8BZC,WAAY,qBA9BA,CAiCZC,WAAY,WAjCA,CAoCZC,WAAY,iDApCA;AAuCZC,KAAM,mBAvCM,CA0CZC,GAAI,+CA1CQ,CA6CZC,MAAO,kDA7CK,CAgDZC,WAAY,IAhDA,CAmDZC,OAAQ,gEAnDI,CAsDZC,UAAW,iCAtDC,CAyDZC,UAAW,iCAzDC,CAgEhBjF,EAAAkF,SAAA,CAAqB,QAAQ,CAAClF,CAAD,CAAW8D,CAAX,CAAiB,CA2U1CqB,QAASA,EAAI,CAACC,CAAD,CAAQC,CAAR,CAAuB,CAAA,IAC5BC,CAD4B,CAE5BC,EAAO,CACY,IAAvB,EAAIH,CAAAI,OAAA,CAAa,CAAb,CAAJ,GACID,CACA,CADQ,EACR,CAAAH,CAAA,CAAQA,CAAAK,UAAA,CAAgB,CAAhB,CAFZ,CAIA,IAAI3B,CAAAS,WAAAmB,KAAA,CAAqBN,CAArB,CAAJ,CACIE,CAAA,CAAKK,QAAA,CAASP,CAAT,CADT,KAEK,IAAItB,CAAAU,WAAAkB,KAAA,CAAqBN,CAArB,CAAJ,CACDE,CAAA,CAAKK,QAAA,CAASP,CAAAK,UAAA,CAAgB,CAAhB,CAAT,CAA6B,EAA7B,CADJ,KAEA,IAAI3B,CAAAW,WAAAiB,KAAA,CAAqBN,CAArB,CAAJ,CACDE,CAAA;AAAKK,QAAA,CAASP,CAAAK,UAAA,CAAgB,CAAhB,CAAT,CAA6B,CAA7B,CADJ,KAGD,MAAMrD,MAAA,CAAM,oBAAN,EAAqC,CAAP,CAAAmD,CAAA,CAAW,GAAX,CAAiB,EAA/C,EAAqDH,CAArD,CAAN,CACJE,CAAA,CAAMC,CAAN,CAAWD,CAAX,CAAe,CACf,IAAKD,CAAAA,CAAL,EAA2B,CAA3B,CAAsBC,CAAtB,CACI,KAAMlD,MAAA,CAAM,oBAAN,EAAqC,CAAP,CAAAmD,CAAA,CAAW,GAAX,CAAiB,EAA/C,EAAqDH,CAArD,CAAN,CACJ,MAAOE,EAlByB,CA2BpCM,QAASA,EAAQ,CAACC,CAAD,CAAM,CACnB,IAAIN,EAAO,CACU,IAArB,EAAIM,CAAAL,OAAA,CAAW,CAAX,CAAJ,GACID,CACA,CADQ,EACR,CAAAM,CAAA,CAAMA,CAAAJ,UAAA,CAAc,CAAd,CAFV,CAIA,IAAI3B,CAAAS,WAAAmB,KAAA,CAAqBG,CAArB,CAAJ,CACI,MAAON,EAAP,CAAcI,QAAA,CAASE,CAAT,CAAc,EAAd,CACb,IAAI/B,CAAAU,WAAAkB,KAAA,CAAqBG,CAArB,CAAJ,CACD,MAAON,EAAP,CAAcI,QAAA,CAASE,CAAAJ,UAAA,CAAc,CAAd,CAAT,CAA2B,EAA3B,CACb,IAAI3B,CAAAW,WAAAiB,KAAA,CAAqBG,CAArB,CAAJ,CACD,MAAON,EAAP,CAAcI,QAAA,CAASE,CAAAJ,UAAA,CAAc,CAAd,CAAT,CAA2B,CAA3B,CACb,IAAY,KAAZ,GAAII,CAAJ,CACD,MAAcC,SAAd,CAAOP,CACN,IAAY,KAAZ,GAAIM,CAAJ,CACD,MAAOE,IACN,IAAIjC,CAAAY,WAAAgB,KAAA,CAAqBG,CAArB,CAAJ,CACD,MAAON,EAAP,CAAcS,UAAA,CAAWH,CAAX,CAClB,MAAMzD,MAAA,CAAM,wBAAN;CAAyC,CAAP,CAAAmD,CAAA,CAAW,GAAX,CAAiB,EAAnD,EAAyDM,CAAzD,CAAN,CAlBmB,CA2GvBI,QAASA,EAAS,CAACC,CAAD,CAAUtF,CAAV,CAAgBwE,CAAhB,CAAuB,CACR,WAA7B,GAAI,MAAOc,EAAA,CAAQtF,CAAR,CAAX,CACIsF,CAAA,CAAQtF,CAAR,CADJ,CACoBwE,CADpB,EAGSe,KAAAC,QAAA,CAAcF,CAAA,CAAQtF,CAAR,CAAd,CAEL,GADIsF,CAAA,CAAQtF,CAAR,CACJ,CADoB,CAAEsF,CAAA,CAAQtF,CAAR,CAAF,CACpB,EAAAsF,CAAA,CAAQtF,CAAR,CAAAyF,KAAA,CAAmBjB,CAAnB,CALJ,CADqC,CAzczC,IAAIF,EAAW,EAAf,CASIoB,EAAYA,QAAQ,CAACC,CAAD,CAAQ,CAO5B,IAAAC,OAAA,CAAcD,CAAd,CAAoB,EAOpB,KAAAE,MAAA,CAAa,CAOb,KAAAC,KAAA,CAAY,CAOZ,KAAAC,MAAA,CAAa,EAOb,KAAAC,YAAA,CAAmB,IAnCS,CAThC,CAmDIC,EAAqBP,CAAAQ,UAOzBD,EAAAE,YAAA,CAAiCC,QAAQ,EAAG,CACxC,IAAIC,EAA0B,GAArB,GAAA,IAAAL,YAAA,CACH9C,CAAAkB,UADG,CAEHlB,CAAAmB,UACNgC,EAAAC,UAAA,CAAe,IAAAT,MAAf,CAA4B,CAC5B,KAAIU,EAAQF,CAAAG,KAAA,CAAQ,IAAAZ,OAAR,CACZ,IAAKW,CAAAA,CAAL,CACI,KAAM/E,MAAA,CAAM,qBAAN,CAAN,CACJ,IAAAqE,MAAA,CAAaQ,CAAAC,UACb,KAAAP,MAAAN,KAAA,CAAgB,IAAAO,YAAhB,CACA,KAAAA,YAAA,CAAmB,IACnB,OAAOO,EAAA,CAAM,CAAN,CAXiC,CAmB5CN,EAAAQ,KAAA;AAA0BC,QAAQ,EAAG,CACjC,GAAwB,CAAxB,CAAI,IAAAX,MAAAzE,OAAJ,CACI,MAAO,KAAAyE,MAAAY,MAAA,EACX,IAAI,IAAAd,MAAJ,EAAkB,IAAAD,OAAAtE,OAAlB,CACI,MAAO,KACX,IAAyB,IAAzB,GAAI,IAAA0E,YAAJ,CACI,MAAO,KAAAG,YAAA,EANsB,KAQ7BS,CAR6B,CAU7BH,CACJ,GAAG,CAIC,IAHAG,CAGA,CAHS,CAAA,CAGT,CAAO1D,CAAAgB,WAAAY,KAAA,CAAqB2B,CAArB,CAA4B,IAAAb,OAAAhB,OAAA,CAAmB,IAAAiB,MAAnB,CAA5B,CAAP,CAAA,CAGI,GAFa,IAET,GAFAY,CAEA,EADA,EAAE,IAAAX,KACF,CAAA,EAAE,IAAAD,MAAF,GAAiB,IAAAD,OAAAtE,OAArB,CACI,MAAO,KAIf,IAAuC,GAAvC,GAAI,IAAAsE,OAAAhB,OAAA,CAAmB,IAAAiB,MAAnB,CAAJ,CAEI,GADA,EAAE,IAAAA,MACE,CAAmC,GAAnC,GAAA,IAAAD,OAAAhB,OAAA,CAAmB,IAAAiB,MAAnB,CAAJ,CAA4C,CACxC,IAAA,CAA4C,IAA5C,GAAO,IAAAD,OAAAhB,OAAA,CAAmB,EAAE,IAAAiB,MAArB,CAAP,CAAA,CACI,GAAI,IAAAA,MAAJ,EAAkB,IAAAD,OAAAtE,OAAlB,CACI,MAAO,KACf,GAAE,IAAAuE,MACF;EAAE,IAAAC,KACFc,EAAA,CAAS,CAAA,CAN+B,CAA5C,IAOO,IAAgD,GAAhD,IAAKH,CAAL,CAAY,IAAAb,OAAAhB,OAAA,CAAmB,IAAAiB,MAAnB,CAAZ,EAAqD,CACxD,EAAG,CACc,IAAb,GAAIY,CAAJ,EACI,EAAE,IAAAX,KACN,IAAI,EAAE,IAAAD,MAAN,GAAqB,IAAAD,OAAAtE,OAArB,CACI,MAAO,KACXuF,EAAA,CAAOJ,CACPA,EAAA,CAAO,IAAAb,OAAAhB,OAAA,CAAmB,IAAAiB,MAAnB,CANR,CAAH,MAOkB,GAPlB,GAOSgB,CAPT,EAOkC,GAPlC,GAOyBJ,CAPzB,CAQA,GAAE,IAAAZ,MACFe,EAAA,CAAS,CAAA,CAV+C,CAArD,IAYH,OAAO,GAjChB,CAAH,MAmCSA,CAnCT,CAqCA,IAAI,IAAAf,MAAJ,GAAmB,IAAAD,OAAAtE,OAAnB,CACI,MAAO,KAGPwF,EAAAA,CAAM,IAAAjB,MACV3C,EAAAC,MAAAmD,UAAA,CAAuB,CAEvB,IADYS,CAAA7D,CAAAC,MAAA2B,KAAAiC,CAAgB,IAAAnB,OAAAhB,OAAA,CAAmBkC,CAAA,EAAnB,CAAhBC,CACZ,CACI,IAAA,CAAMD,CAAN,CAAY,IAAAlB,OAAAtE,OAAZ,EAAmC,CAAA4B,CAAAC,MAAA2B,KAAA,CAAgB,IAAAc,OAAAhB,OAAA,CAAmBkC,CAAnB,CAAhB,CAAnC,CAAA,CACI,EAAEA,CACNE,EAAAA,CAAQ,IAAApB,OAAAf,UAAA,CAAsB,IAAAgB,MAAtB,CAAkC,IAAAA,MAAlC,CAA+CiB,CAA/C,CACZ,IAAc,GAAd,GAAIE,CAAJ,EAA+B,GAA/B;AAAqBA,CAArB,CACI,IAAAhB,YAAA,CAAmBgB,CACvB,OAAOA,EA7D0B,CAqErCf,EAAAgB,KAAA,CAA0BC,QAAQ,EAAG,CACjC,GAA0B,CAA1B,GAAI,IAAAnB,MAAAzE,OAAJ,CAA6B,CACzB,IAAI0F,EAAQ,IAAAP,KAAA,EACZ,IAAc,IAAd,GAAIO,CAAJ,CACI,MAAO,KACX,KAAAjB,MAAAN,KAAA,CAAgBuB,CAAhB,CAJyB,CAM7B,MAAO,KAAAjB,MAAA,CAAW,CAAX,CAP0B,CAerCE,EAAAkB,KAAA,CAA0BC,QAAQ,CAACC,CAAD,CAAW,CACzC,IAAIC,EAAS,IAAAb,KAAA,EACb,IAAIa,CAAJ,GAAeD,CAAf,CACI,KAAM7F,MAAA,CAAM,WAAN,CAAkB8F,CAAlB,CAAyB,MAAzB,CAAgCD,CAAhC,CAAyC,YAAzC,CAAN,CAHqC,CAW7CpB,EAAAsB,KAAA,CAA0BC,QAAQ,CAACH,CAAD,CAAW,CACzC,MAAI,KAAAJ,KAAA,EAAJ,GAAoBI,CAApB,EACI,IAAAZ,KAAA,EACO,CAAA,CAAA,CAFX,EAIO,CAAA,CALkC,CAa7CR,EAAAwB,SAAA,CAA8BC,QAAQ,EAAG,CACrC,MAAO,aAAP,CAAqB,IAAA7B,MAArB,CAAgC,GAAhC,CAAoC,IAAAD,OAAAtE,OAApC,CAAuD,WAAvD,CAAmE,IAAAwE,KAAnE,CAA6E,GADxC,CAQzCxB,EAAAoB,UAAA,CAAqBA,CASrB,KAAIiC,EAASA,QAAQ,CAAC/B,CAAD,CAAS,CAO1B,IAAAgC,GAAA,CAAU,IAAIlC,CAAJ,CAAcE,CAAd,CAMV,KAAAiC,OAAA,CAAc,CAAA,CAbY,CAA9B,CAoBIC,EAAkBH,CAAAzB,UAQtB4B,EAAAC,MAAA;AAAwBC,QAAQ,EAAG,CAC/B,IAAIC,EAAW,CACX,KAAQ,QADG,CAEX,UAAW,IAFA,CAGX,SAAY,EAHD,CAIX,MAAS,EAJE,CAKX,QAAW,EALA,CAMX,QAAW,EANA,CAOX,SAAY,EAPD,CAAf,CAUIjB,CAVJ,CAWIkB,EAAO,CAAA,CAXX,CAYIC,CACJ,IAAI,CACA,IAAA,CAAOnB,CAAP,CAAe,IAAAY,GAAAnB,KAAA,EAAf,CAAA,CACI,OAAQO,CAAR,EACI,KAAK,SAAL,CACI,GAAKkB,CAAAA,CAAL,EAAqC,IAArC,GAAaD,CAAA,CAAS,SAAT,CAAb,CACI,KAAMzG,MAAA,CAAM,sBAAN,CAAN,CACJwF,CAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR,IAAK,CAAAvD,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAAL,CACI,KAAMxF,MAAA,CAAM,wBAAN,CAAiCwF,CAAjC,CAAN,CACJ,IAAAY,GAAAT,KAAA,CAAa,GAAb,CACAc,EAAA,CAAS,SAAT,CAAA,CAAsBjB,CACtB,MACJ,MAAK,QAAL,CACI,GAAKkB,CAAAA,CAAL,CACI,KAAM1G,MAAA,CAAM,qBAAN,CAAN,CACJwF,CAAA,CAAQ,IAAAY,GAAAX,KAAA,EACR,EAAc,QAAd,GAAID,CAAJ,GAA2BmB,CAA3B,CAA4C,MAA5C,GAAkCnB,CAAlC,IACI,IAAAY,GAAAnB,KAAA,EACJO,EAAA,CAAQ,IAAAb,YAAA,EACR,KAAAyB,GAAAT,KAAA,CAAa,GAAb,CACKgB;CAAL,EACIF,CAAA,QAAAxC,KAAA,CAAyBuB,CAAzB,CACJ,MACJ,MAAK,QAAL,CACI,GAAKkB,CAAAA,CAAL,CACI,KAAM1G,MAAA,CAAM,qBAAN,CAAN,CACJ,IAAAoG,GAAAT,KAAA,CAAa,GAAb,CACkD,SAAlD,IAAKc,CAAA,OAAL,CAA0B,IAAA9B,YAAA,EAA1B,IACI,IAAA0B,OADJ,CACkB,CAAA,CADlB,CAEA,KAAAD,GAAAT,KAAA,CAAa,GAAb,CACA,MACJ,MAAK,SAAL,CACI,IAAAiB,cAAA,CAAmBH,CAAnB,CAA6B,IAA7B,CACAC,EAAA,CAAO,CAAA,CACP,MACJ,MAAK,MAAL,CACI,IAAAG,WAAA,CAAgBJ,CAAhB,CACAC,EAAA,CAAO,CAAA,CACP,MACJ,MAAK,QAAL,CACI,IAAAI,aAAA,CAAkBL,CAAlB,CACA,MACJ,MAAK,SAAL,CACI,IAAAM,cAAA,CAAmBN,CAAnB,CACA,MACJ,MAAK,QAAL,CACI,IAAAO,aAAA,CAAkBP,CAAlB,CACA,MACJ,SACI,KAAMzG,MAAA,CAAM,cAAN,CAAuBwF,CAAvB,CAA+B,GAA/B,CAAN,CA/CR,CAFJ,CAoDF,MAAOzF,CAAP,CAAU,CAER,KADAA,EAAAkH,QACMlH,CADM,sBACNA,CAD6B,IAAAqG,GAAA9B,KAC7BvE;AAD0C,IAC1CA,CADiDA,CAAAkH,QACjDlH,CAAAA,CAAN,CAFQ,CAIZ,OAAO0G,CAAA,KACP,OAAOA,EAvEwB,CAgFnCN,EAAAI,MAAA,CAAeW,QAAQ,CAAC9C,CAAD,CAAS,CAC5B,MAAOmC,CAAA,IAAIJ,CAAJ,CAAW/B,CAAX,CAAAmC,OAAA,EADqB,CAoEhCD,EAAA3B,YAAA,CAA8BwC,QAAQ,EAAG,CAAA,IACjCnE,EAAQ,EADyB,CAEjCwC,CAEJ,GAAG,CACCD,CAAA,CAAQ,IAAAa,GAAAnB,KAAA,EACR,IAAc,GAAd,GAAIM,CAAJ,EAA+B,GAA/B,GAAqBA,CAArB,CACI,KAAMvF,MAAA,CAAM,4BAAN,CAAmCuF,CAAnC,CAAN,CACJvC,CAAA,EAAS,IAAAoD,GAAAnB,KAAA,EACT,KAAAmB,GAAAT,KAAA,CAAaJ,CAAb,CACAC,EAAA,CAAQ,IAAAY,GAAAX,KAAA,EANT,CAAH,MAOmB,GAPnB,GAOSD,CAPT,EAOoC,GAPpC,GAO0BA,CAP1B,CAQA,OAAOxC,EAZ8B,CAqBzCsD,EAAAc,WAAA,CAA6BC,QAAQ,CAACC,CAAD,CAAe,CAAA,IAC5C9B,EAAQ,IAAAY,GAAAX,KAAA,EAEZ,IAAc,GAAd,GAAID,CAAJ,EAA+B,GAA/B,GAAqBA,CAArB,CACI,MAAO,KAAAb,YAAA,EACX,KAAAyB,GAAAnB,KAAA,EACA,IAAIvD,CAAAQ,OAAAoB,KAAA,CAAiBkC,CAAjB,CAAJ,CACI,MAAOhC,EAAA,CAASgC,CAAT,CACX,IAAI9D,CAAAa,KAAAe,KAAA,CAAekC,CAAf,CAAJ,CACI,MAAgC,MAAhC,GAAQA,CAAA+B,YAAA,EACZ,IAAID,CAAJ,EAAoB5F,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAApB,CACI,MAAOA,EACX;KAAMxF,MAAA,CAAM,iBAAN,CAAwBwF,CAAxB,CAAN,CAZgD,CAwBpDc,EAAAQ,aAAA,CAA+BU,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAiB,CAAA,IAChDlC,EAAQ,IAAAY,GAAAnB,KAAA,EADwC,CAEhD0C,EAAS,CAAA,CACC,IAAd,GAAInC,CAAJ,GACImC,CACA,CADS,CAAA,CACT,CAAAnC,CAAA,CAAQ,IAAAY,GAAAnB,KAAA,EAFZ,CAIA,IAAK,CAAAvD,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAAL,CAGQ,KAAMxF,MAAA,CAAM,uBAAN,CAA8BwF,CAA9B,CAAN,CACR,IAAIhH,EAAOgH,CACPmC,EAAJ,GACI,IAAAvB,GAAAT,KAAA,CAAa,GAAb,CAGA,CAFAnH,CAEA,CAFO,GAEP,CAFWA,CAEX,CAFgB,GAEhB,CADAgH,CACA,CADQ,IAAAY,GAAAX,KAAA,EACR,CAAI/D,CAAAO,UAAAqB,KAAA,CAAoBkC,CAApB,CAAJ,GACIhH,CACA,EADQgH,CACR,CAAA,IAAAY,GAAAnB,KAAA,EAFJ,CAJJ,CASA,KAAAmB,GAAAT,KAAA,CAAa,GAAb,CACA,KAAAiC,kBAAA,CAAuBH,CAAvB,CAA+BjJ,CAA/B,CACKkJ,EAAL,EACI,IAAAtB,GAAAT,KAAA,CAAa,GAAb,CAxBgD,CAkDxDW,EAAAsB,kBAAA,CAAoCC,QAAQ,CAACJ,CAAD,CAASjJ,CAAT,CAAe,CACvD,IAAIgH,EAAQ,IAAAY,GAAAX,KAAA,EACZ,IAAc,GAAd,GAAID,CAAJ,CACI3B,CAAA,CAAU4D,CAAA,QAAV,CAA6BjJ,CAA7B,CAAmC,IAAA4I,WAAA,CAAgB,CAAA,CAAhB,CAAnC,CADJ,KAII,KADA,IAAAhB,GAAAT,KAAA,CAAa,GAAb,CACA,CAAoC,GAApC,IAAQH,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CAAyC,CACrC,GAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,uBAAN;AAAgCxB,CAAhC,CAAuC,GAAvC,CAA6CgH,CAA7C,CAAN,CACA,IAAAY,GAAAL,KAAA,CAAa,GAAb,CAAJ,CACIlC,CAAA,CAAU4D,CAAA,QAAV,CAA6BjJ,CAA7B,CAAoC,GAApC,CAA0CgH,CAA1C,CAAiD,IAAA4B,WAAA,CAAgB,CAAA,CAAhB,CAAjD,CADJ,CAGI,IAAAQ,kBAAA,CAAuBH,CAAvB,CAA+BjJ,CAA/B,CAAsC,GAAtC,CAA4CgH,CAA5C,CANiC,CANU,CAsB3Dc,EAAAS,cAAA,CAAgCe,QAAQ,CAACL,CAAD,CAAS,CAC7C,IAAIjC,EAAQ,IAAAY,GAAAnB,KAAA,EACZ,IAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,+BAAN,CAAsC,IAAAoG,GAAA9B,KAAtC,CAAmD,IAAnD,CAAwDkB,CAAxD,CAAN,CAEJ,IAAIuC,EAAM,CACN,KAFOvC,CACD,CAEN,IAAO,EAFD,CAGN,QAAW,EAHL,CAMV,KADA,IAAAY,GAAAT,KAAA,CAAa,GAAb,CACA,CAAoC,GAApC,IAAQH,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CACI,GAAc,QAAd,GAAIO,CAAJ,CACI,IAAAsB,aAAA,CAAkBiB,CAAlB,CADJ,KAEK,IAAc,KAAd,GAAIvC,CAAJ,CACD,IAAAwC,iBAAA,CAAsBD,CAAtB,CADC,KAGD,MAAM/H,MAAA,CAAM,yBAAN,CAAgCwF,CAAhC,CAAN,CAER,IAAAY,GAAAL,KAAA,CAAa,GAAb,CACA0B,EAAA,SAAAxD,KAAA,CAAwB8D,CAAxB,CApB6C,CA4BjDzB,EAAA0B,iBAAA;AAAmCC,QAAQ,CAACF,CAAD,CAAM,CAC7C,IACIvC,EAAQ,IAAAY,GAAAnB,KAAA,EACZ,IAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,mCAAN,CAA0CwF,CAA1C,CAAN,CACJ,IAAIhH,EAAOgH,CAAX,CACI0C,EAAS,CACT,QAAW,IADF,CAET,SAAY,IAFH,CAGT,eAAkB,CAAA,CAHT,CAIT,gBAAmB,CAAA,CAJV,CAKT,QAAW,EALF,CAOb,KAAA9B,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACoB,SAA5B,GAAIO,CAAA+B,YAAA,EAAJ,GACEW,CAAA,eACA,CAD2B,CAAA,CAC3B,CAAA1C,CAAA,CAAQ,IAAAY,GAAAnB,KAAA,EAFV,CAIA,IAAK,CAAAvD,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAAL,CACI,KAAMxF,MAAA,CAAM,oCAAN,CAA2CwF,CAA3C,CAAN,CACJ0C,CAAA,QAAA,CAAoB1C,CACpB,KAAAY,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR,IAA4B,SAA5B,GAAIO,CAAA+B,YAAA,EAAJ,CACI,KAAMvH,MAAA,CAAM,8CAAN;AAAqDwF,CAArD,CAAN,CACJ,IAAAY,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACoB,SAA5B,GAAIO,CAAA+B,YAAA,EAAJ,GACEW,CAAA,gBACA,CAD4B,CAAA,CAC5B,CAAA1C,CAAA,CAAQ,IAAAY,GAAAnB,KAAA,EAFV,CAIAiD,EAAA,SAAA,CAAqB1C,CACrB,KAAAY,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAX,KAAA,EACR,IAAc,GAAd,GAAID,CAAJ,CAAmB,CAEf,IADA,IAAAY,GAAAnB,KAAA,EACA,CAAoC,GAApC,IAAQO,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CACI,GAAc,QAAd,GAAIO,CAAJ,CACI,IAAAsB,aAAA,CAAkBoB,CAAlB,CADJ,KAGI,MAAMlI,MAAA,CAAM,6BAAN,CAAsCwF,CAAtC,CAAN,CAER,IAAAY,GAAAL,KAAA,CAAa,GAAb,CARe,CAAnB,IAUI,KAAAK,GAAAT,KAAA,CAAa,GAAb,CACqB,YAAzB,GAAI,MAAOoC,EAAA,IAAX,GACIA,CAAA,IADJ,CACgB,EADhB,CAEAA,EAAA,IAAA,CAAUvJ,CAAV,CAAA,CAAkB0J,CAhD2B,CA0DjD5B,EAAAM,cAAA,CAAgCuB,QAAQ,CAACV,CAAD,CAASW,CAAT,CAAc,CAAA,IAC9CC,EAAU,CAAED,CAAAA,CADkC,CAE9C5C,EAAQ,IAAAY,GAAAnB,KAAA,EAFsC,CAG9CqD,EAAM,CACN,KAAQ,EADF,CAEN,OAAU,EAFJ,CAGN,MAAS,EAHH,CAIN,SAAY,EAJN,CAKN,QAAW,EALL,CAMN,SAAY,EANN;AAON,OAAU,EAPJ,CAUV,IAAK,CAAA5G,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,UAAN,EAAkBqI,CAAA,CAAU,OAAV,CAAoB,SAAtC,EAAiD,SAAjD,CAA2D7C,CAA3D,CAAN,CACJ8C,CAAA,KAAA,CAAc9C,CACV6C,EAAJ,GACI,IAAAjC,GAAAT,KAAA,CAAa,GAAb,CAEA,CADAyC,CAAA,GACA,CADYrF,CAAA,CAAK,IAAAqD,GAAAnB,KAAA,EAAL,CACZ,CAAAqD,CAAA,QAAA,CAAiB,CAAA,CAHrB,CAKA9C,EAAA,CAAQ,IAAAY,GAAAX,KAAA,EACM,IAAd,GAAID,CAAJ,EAAqB4C,CAArB,EACI,IAAAG,mBAAA,CAAwBH,CAAxB,CAEJ,KADA,IAAAhC,GAAAT,KAAA,CAAa,GAAb,CACA,CAAoC,GAApC,IAAQH,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CACI,GAAIvD,CAAAE,KAAA0B,KAAA,CAAekC,CAAf,CAAJ,CACI,IAAAgD,mBAAA,CAAwBF,CAAxB,CAA6B9C,CAA7B,CADJ,KAEK,IAAc,OAAd,GAAIA,CAAJ,CACD,IAAAiD,mBAAA,CAAwBH,CAAxB,CADC,KAEA,IAAc,MAAd,GAAI9C,CAAJ,CACD,IAAAqB,WAAA,CAAgByB,CAAhB,CADC,KAEA,IAAc,SAAd,GAAI9C,CAAJ,CACD,IAAAoB,cAAA,CAAmB0B,CAAnB,CADC,KAEA,IAAc,QAAd,GAAI9C,CAAJ,CACD,IAAAsB,aAAA,CAAkBwB,CAAlB,CADC,KAEA,IAAc,SAAd,GAAI9C,CAAJ,CACD,IAAAuB,cAAA,CAAmBuB,CAAnB,CADC;IAEA,IAAc,YAAd,GAAI9C,CAAJ,CACG8C,CAAAI,eAAA,CAAmB,YAAnB,CAAJ,CACIJ,CAAA,WADJ,CACwBA,CAAA,WAAAK,OAAA,CAAyB,IAAAC,sBAAA,EAAzB,CADxB,CAGIN,CAAA,WAHJ,CAGwB,IAAAM,sBAAA,EAJvB,KAMA,IAAc,UAAd,GAAIpD,CAAJ,CACD,IAAAqD,cAAA,EADC,KAEA,IAAc,QAAd,GAAIrD,CAAJ,CACD,IAAAwB,aAAA,CAAkBsB,CAAlB,CADC,KAEA,IAAI5G,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAAJ,CAA8B,CAC/B,GAAKa,CAAA,IAAAA,OAAL,CACI,KAAMrG,MAAA,CAAM,sBAAN,CAA6BwF,CAA7B,CAAN,CACJ,IAAAgD,mBAAA,CAAwBF,CAAxB,CAA6B,UAA7B,CAAyC9C,CAAzC,CAH+B,CAA9B,IAKD,MAAMxF,MAAA,CAAM,yBAAN,CAAgCwF,CAAhC,CAAN,CAER,IAAAY,GAAAL,KAAA,CAAa,GAAb,CACA0B,EAAA,SAAAxD,KAAA,CAAwBqE,CAAxB,CACA,OAAOA,EAzD2C,CAgEtDhC,EAAAuC,cAAA,CAAgCC,QAAQ,EAAG,CACvC,IAAA,CAA0B,GAA1B,GAAO,IAAA1C,GAAAX,KAAA,EAAP,CAAA,CACI,IAAAW,GAAAnB,KAAA,EACJ;IAAAmB,GAAAT,KAAA,CAAa,GAAb,CAHuC,CAc3CW,EAAAkC,mBAAA,CAAqCO,QAAQ,CAACT,CAAD,CAAMU,CAAN,CAAYC,CAAZ,CAAkB,CAC3D,GAAK,CAAAvH,CAAAE,KAAA0B,KAAA,CAAe0F,CAAf,CAAL,CACI,KAAMhJ,MAAA,CAAM,8BAAN,CAAqCgJ,CAArC,CAAN,CACJ,IAAIZ,EAAM,CACN,KAAQY,CADF,CAEN,KAAQ,EAFF,CAGN,KAAQ,EAHF,CAIN,QAAW,EAJL,CAKN,GAAM,CALA,CAQV,IAAa,KAAb,GAAIA,CAAJ,CAAoB,CAEhB,GAAIC,CAAJ,CACI,KAAMjJ,MAAA,CAAM,gBAAN,CAAyBiJ,CAAzB,CAAN,CACJ,IAAA7C,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR,IAAK,CAAAvD,CAAAG,KAAAyB,KAAA,CAAekC,CAAf,CAAL,EAA+B,CAAA9D,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAA/B,CACI,KAAMxF,MAAA,CAAM,8BAAN,CAAuCwF,CAAvC,CAAN,CACJ4C,CAAA,QAAA,CAAiB5C,CACjB,KAAAY,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR,IAAK,CAAAvD,CAAAG,KAAAyB,KAAA,CAAekC,CAAf,CAAL,EAA+B,CAAA9D,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAA/B,CACI,KAAMxF,MAAA,CAAM,yBAAN,CAAkCwF,CAAlC,CAAN,CACJ4C,CAAA,KAAA,CAAc5C,CACd,KAAAY,GAAAT,KAAA,CAAa,GAAb,CACAH,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR;GAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,8BAAN,CAAuCwF,CAAvC,CAAN,CACJ4C,CAAA,KAAA,CAAc5C,CACd,KAAAY,GAAAT,KAAA,CAAa,GAAb,CACAyC,EAAA,GAAA,CAAYrF,CAAA,CAAK,IAAAqD,GAAAnB,KAAA,EAAL,CACZO,EAAA,CAAQ,IAAAY,GAAAX,KAAA,EACM,IAAd,GAAID,CAAJ,EACI,IAAA+C,mBAAA,CAAwBH,CAAxB,CACJ,KAAAhC,GAAAT,KAAA,CAAa,GAAb,CAxBgB,CAApB,IA8BI,IAFAsD,CAEI,CAFmB,WAAhB,GAAA,MAAOA,EAAP,CAA8BA,CAA9B,CAAqC,IAAA7C,GAAAnB,KAAA,EAExC,CAAS,OAAT,GAAAgE,CAAJ,CAAsB,CAKdC,CAAAA,CAAM,IAAAtC,cAAA,CAAmB0B,CAAnB,CAAwBF,CAAxB,CACV,IAAK,CAAA,QAAA9E,KAAA,CAAc4F,CAAA,KAAd,CAAL,CACI,KAAMlJ,MAAA,CAAM,sBAAN,CAA6BkJ,CAAA,KAA7B,CAAN,CACJd,CAAA,KAAA,CAAcc,CAAA,KACdd,EAAA,KAAA,CAAcc,CAAA,KAAA3B,YAAA,EACd,KAAAnB,GAAAL,KAAA,CAAa,GAAb,CAVkB,CAAtB,IAYO,CAEH,GAAK,CAAArE,CAAAG,KAAAyB,KAAA,CAAe2F,CAAf,CAAL,EAA8B,CAAAvH,CAAAM,QAAAsB,KAAA,CAAkB2F,CAAlB,CAA9B,CACI,KAAMjJ,MAAA,CAAM,8BAAN,CAAuCiJ,CAAvC,CAAN,CACJb,CAAA,KAAA;AAAca,CACdzD,EAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR,IAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,8BAAN,CAAuCwF,CAAvC,CAAN,CACJ4C,CAAA,KAAA,CAAc5C,CACd,KAAAY,GAAAT,KAAA,CAAa,GAAb,CACAyC,EAAA,GAAA,CAAYrF,CAAA,CAAK,IAAAqD,GAAAnB,KAAA,EAAL,CACZO,EAAA,CAAQ,IAAAY,GAAAX,KAAA,EACM,IAAd,GAAID,CAAJ,EACI,IAAA+C,mBAAA,CAAwBH,CAAxB,CACJ,KAAAhC,GAAAT,KAAA,CAAa,GAAb,CAdG,CAkBX2C,CAAA,OAAArE,KAAA,CAAmBmE,CAAnB,CACA,OAAOA,EAxEoD,CAgF/D9B,EAAAmC,mBAAA,CAAqCU,QAAQ,CAACb,CAAD,CAAM,CAC/C,IAAI9C,EAAQ,IAAAY,GAAAnB,KAAA,EACZ,IAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,sBAAN,CAA6BwF,CAA7B,CAAN,CAH2C,IAI3ChH,EAAOgH,CAJoC,CAM3C4D,EAAS,EAEb,KADA,IAAAhD,GAAAT,KAAA,CAAa,GAAb,CACA,CAAoC,GAApC,IAAQH,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CACImD,CAEA,CAFM,IAAAI,mBAAA,CAAwBF,CAAxB,CAA6B,UAA7B,CAAyC9C,CAAzC,CAEN,CADA4C,CAAA,MACA,CADe5J,CACf,CAAA4K,CAAAnF,KAAA,CAAYmE,CAAA,GAAZ,CAEJ,KAAAhC,GAAAL,KAAA,CAAa,GAAb,CACAuC,EAAA,OAAA,CAAc9J,CAAd,CAAA,CAAsB4K,CAdyB,CAsBnD9C;CAAAiC,mBAAA,CAAqCc,QAAQ,CAACjB,CAAD,CAAM,CAC/C,IAAAhC,GAAAT,KAAA,CAAa,GAAb,CAGA,KAFA,IACI2D,EAAQ,CAAA,CACZ,CAAoC,GAApC,GAAgB,IAAAlD,GAAAX,KAAA,EAAhB,CAAA,CACS6D,CAGL,EAFI,IAAAlD,GAAAT,KAAA,CAAa,GAAb,CAEJ,CADA,IAAAmB,aAAA,CAAkBsB,CAAlB,CAAuB,CAAA,CAAvB,CACA,CAAAkB,CAAA,CAAQ,CAAA,CAEZ,KAAAlD,GAAAnB,KAAA,EAV+C,CAkBnDqB,EAAAO,WAAA,CAA6B0C,QAAQ,CAACjB,CAAD,CAAM,CACvC,IAAIkB,EAAM,CACN,KAAQ,EADF,CAEN,OAAU,EAFJ,CAGN,QAAW,EAHL,CAAV,CAKIhE,EAAQ,IAAAY,GAAAnB,KAAA,EACZ,IAAK,CAAAvD,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,gBAAN,CAAuBwF,CAAvB,CAAN,CACJgE,CAAA,KAAA,CAAchE,CAEd,KADA,IAAAY,GAAAT,KAAA,CAAa,GAAb,CACA,CAAoC,GAApC,IAAQH,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CACI,GAAc,QAAd,GAAIO,CAAJ,CACI,IAAAsB,aAAA,CAAkB0C,CAAlB,CADJ,KAEK,CACD,GAAK,CAAA9H,CAAAI,KAAAwB,KAAA,CAAekC,CAAf,CAAL,CACI,KAAMxF,MAAA,CAAM,gBAAN,CAAuBwF,CAAvB,CAAN,CACJ,IAAAY,GAAAT,KAAA,CAAa,GAAb,CACA,KAAIlC,EAAM,CACN,KAAQ+B,CADF,CAEN,GAAMzC,CAAA,CAAK,IAAAqD,GAAAnB,KAAA,EAAL,CAAqB,CAAA,CAArB,CAFA,CAAV,CAIAO,EAAQ,IAAAY,GAAAX,KAAA,EACM;GAAd,GAAID,CAAJ,EACI,IAAA+C,mBAAA,CAAwB,CAAE,QAAW,EAAb,CAAxB,CACJ,KAAAnC,GAAAT,KAAA,CAAa,GAAb,CACA6D,EAAA,OAAAvF,KAAA,CAAmBR,CAAnB,CAZC,CAeT,IAAA2C,GAAAL,KAAA,CAAa,GAAb,CACAuC,EAAA,MAAArE,KAAA,CAAkBuF,CAAlB,CA9BuC,CAsC3ClD,EAAAsC,sBAAA,CAAwCa,QAAQ,EAAG,CAC/C,IAAIC,EAAS,EAAb,CACIlE,CADJ,CAEImE,CAEJ,GAAG,CAEC,IADAA,CACA,CADQ,EACR,CAAA,CAAA,CAAa,CACTnE,CAAA,CAAQ,IAAAY,GAAAnB,KAAA,EACR,QAAQO,CAAR,EACI,KAAK,KAAL,CACIxC,CAAA,CAAQpF,CAAAmB,OACR,MACJ,MAAK,KAAL,CACIiE,CAAA,CAAQpF,CAAAoB,OACR,MACJ,SACIgE,CAAA,CAAQQ,CAAA,CAASgC,CAAT,CARhB,CAWAmE,CAAA1F,KAAA,CAAWjB,CAAX,CACA,IAAqB,CAArB,GAAI2G,CAAA7J,OAAJ,CACI,KACJ,IAAuB,IAAvB,GAAI,IAAAsG,GAAAX,KAAA,EAAJ,CAA6B,CACzBkE,CAAA1F,KAAA,CAAWjB,CAAX,CACA,MAFyB,CAI7B,IAAAoD,GAAAnB,KAAA,EApBS,CAsBbyE,CAAAzF,KAAA,CAAY0F,CAAZ,CAxBD,CAAH,MAyBS,IAAAvD,GAAAL,KAAA,CAAa,GAAb,CAzBT,CA0BA,KAAAK,GAAAT,KAAA,CAAa,GAAb,CACA,OAAO+D,EAhCwC,CAwCnDpD,EAAAU,aAAA,CAA+B4C,QAAQ,CAACnC,CAAD,CAAS,CAC5C,IAAIjC,EAAQ,IAAAY,GAAAnB,KAAA,EACZ,IAAK,CAAAvD,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAAL,CACI,KAAMxF,MAAA,CAAM,4BAAN;AAAmCwF,CAAnC,CAAN,CACJ,IAAIqE,EAAM,CACN,IAAOrE,CADD,CAEN,OAAU,EAFJ,CAKV,KADA,IAAAY,GAAAT,KAAA,CAAa,GAAb,CACA,CAAoC,GAApC,IAAQH,CAAR,CAAgB,IAAAY,GAAAnB,KAAA,EAAhB,EAAA,CACI,GAAIvD,CAAAE,KAAA0B,KAAA,CAAekC,CAAf,CAAJ,CACI,IAAAgD,mBAAA,CAAwBqB,CAAxB,CAA6BrE,CAA7B,CADJ,KAEK,IAAI9D,CAAAM,QAAAsB,KAAA,CAAkBkC,CAAlB,CAAJ,CAA8B,CAC/B,GAAKa,CAAA,IAAAA,OAAL,CACI,KAAMrG,MAAA,CAAM,sBAAN,CAA6BwF,CAA7B,CAAN,CACJ,IAAAgD,mBAAA,CAAwBqB,CAAxB,CAA6B,UAA7B,CAAyCrE,CAAzC,CAH+B,CAA9B,IAKD,MAAMxF,MAAA,CAAM,wBAAN,CAA+BwF,CAA/B,CAAN,CAER,IAAAY,GAAAL,KAAA,CAAa,GAAb,CACA0B,EAAA,SAAAxD,KAAA,CAAwB4F,CAAxB,CACA,OAAOA,EArBqC,CA8BhDvD,EAAAL,SAAA,CAA2B6D,QAAQ,EAAG,CAClC,MAAO,iBAAP,CAAyB,IAAA1D,GAAA9B,KADS,CAQtCxB,EAAAqD,OAAA,CAAkBA,CAElB,OAAOrD,EAz4BmC,CAA1B,CA24BjBlF,CA34BiB,CA24BPA,CAAA8D,KA34BO,CAi5BpB9D,EAAAmM,QAAA,CAAoB,QAAQ,CAACnM,CAAD,CAAW,CAgZnCoM,QAASA,EAAM,CAAChH,CAAD,CAAQiH,CAAR,CAAkB,CAC7B,GAAIjH,CAAJ,EAAkC,QAAlC,GAAa,MAAOA,EAAAkH,IAApB,EAAoE,QAApE;AAA8C,MAAOlH,EAAAmH,KAArD,EAA0G,SAA1G,GAAgF,MAAOnH,EAAAiH,SAAvF,EACOjH,CAAAkH,IADP,GACqBlH,CAAAkH,IADrB,EACkClH,CAAAmH,KADlC,GACiDnH,CAAAmH,KADjD,CAEI,MAAO,KAAIvM,CAAAC,KAAJ,CAAkBmF,CAAAkH,IAAlB,CAA6BlH,CAAAmH,KAA7B,CAA6D,WAApB,GAAA,MAAOF,EAAP,CAAkCjH,CAAAiH,SAAlC,CAAmDA,CAA5F,CACX,IAAqB,QAArB,GAAI,MAAOjH,EAAX,CACI,MAAOpF,EAAAC,KAAAuM,WAAA,CAAyBpH,CAAzB,CAAgCiH,CAAhC,EAA4C,CAAA,CAA5C,CAAmD,EAAnD,CACX,IAAqB,QAArB,GAAI,MAAOjH,EAAX,CACI,MAAOpF,EAAAC,KAAAwM,WAAA,CAAyBrH,CAAzB,CAAgCiH,CAAhC,EAA4C,CAAA,CAA5C,CACX,MAAMjK,MAAA,CAAM,yBAAN,CAAN,CAR6B,CAy2CjCsK,QAASA,EAAgB,CAACC,CAAD,CAAaC,CAAb,CAAkB,CAAA,IACnCC,EAAMD,CAAAE,aAAA,EAD6B,CAEnCjM,EAAWgM,CAAXhM,CAAiB,CAFkB,CAGnCyE,EAAKuH,CAALvH,GAAa,CACjB,QAAQzE,CAAR,EACI,KAAKb,CAAAG,WAAAC,OAAL,CACI,EAAGyM,EAAA,CAAMD,CAAAG,UAAA,EAAT,OACwB,GADxB,IACQF,CADR,CACc,GADd,EAEA,MACJ,MAAK7M,CAAAG,WAAAE,OAAL,CACIuM,CAAAI,OAAA,EAAc,CACd,MACJ,MAAKhN,CAAAG,WAAAG,OAAL,CACIuM,CAAA;AAAMD,CAAAE,aAAA,EACNF,EAAAI,OAAA,EAAcH,CACd,MACJ,MAAK7M,CAAAG,WAAAI,WAAL,CACImM,CAAA,CAAiBpH,CAAjB,CAAqBsH,CAArB,CACA,MACJ,MAAK5M,CAAAG,WAAAK,SAAL,CACI,GAAI8E,CAAJ,GAAWqH,CAAX,CACI,MAAO,CAAA,CAEP,MAAMvK,MAAA,CAAM,wCAAN,CAA+CkD,CAA/C,CAAkD,IAAlD,CAAuDqH,CAAvD,CAAkE,YAAlE,CAAN,CACR,KAAK3M,CAAAG,WAAAM,OAAL,CACImM,CAAAI,OAAA,EAAc,CACd,MACJ,SACI,KAAM5K,MAAA,CAAM,qCAAN,CAA4CuK,CAA5C,CAAuD,IAAvD,CAA4D9L,CAA5D,CAAN,CAxBR,CA0BA,MAAO,CAAA,CA9BgC,CAjvD3C,IAAIsL,EAAU,EAAd,CAWIc,EAAIA,QAAQ,CAACC,CAAD,CAAUrD,CAAV,CAAkBjJ,CAAlB,CAAwB,CAOpC,IAAAsM,QAAA,CAAeA,CAOf,KAAArD,OAAA,CAAcA,CAOd,KAAAjJ,KAAA,CAAYA,CArBwB,CAXxC,CA8CIuM,EAAaF,CAAAnG,UAOjBqG,EAAAC,IAAA,CAAiBC,QAAQ,EAAG,CAAA,IACpBzM,EAAO,IAAAA,KADa,CAEpB0M,EAAM,IACV,GAAG,CACCA,CAAA,CAAMA,CAAAzD,OACN,IAAW,IAAX,EAAIyD,CAAJ,CACI,KACJ1M,EAAA,CAAO0M,CAAA1M,KAAP,CAAgB,GAAhB,CAAoBA,CAJrB,CAAH,MAKS,CALT,CAMA,OAAOA,EATiB,CAkB5BuM;CAAA9E,SAAA,CAAsBkF,QAAQ,CAACC,CAAD,CAAe,CACzC,OAAQA,CAAA,CAAe,IAAAC,UAAf,CAAgC,GAAhC,CAAsC,EAA9C,EAAoD,IAAAL,IAAA,EADX,CAS7CD,EAAAO,MAAA,CAAmBC,QAAQ,EAAG,CAC1B,KAAMvL,MAAA,CAAM,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAN,CAA0B,2BAA1B,CAAN,CAD0B,CAQ9B8D,EAAAc,EAAA,CAAYA,CAaZ,KAAIW,EAAYA,QAAQ,CAACV,CAAD,CAAUrD,CAAV,CAAkBjJ,CAAlB,CAAwBsF,CAAxB,CAAiC2H,CAAjC,CAAyC,CAC7DZ,CAAAa,KAAA,CAAO,IAAP,CAAaZ,CAAb,CAAsBrD,CAAtB,CAA8BjJ,CAA9B,CAKA,KAAA6M,UAAA,CAAiB,WAMjB,KAAAM,SAAA,CAAgB,EAMhB,KAAA7H,QAAA,CAAeA,CAAf,EAA0B,EAM1B,KAAA2H,OAAA,CAAcA,CAAd,EAAwB,QAxBqC,CAAjE,CA+BIG,EAAqBJ,CAAA9G,UAArBkH,CAA2CC,MAAAC,OAAA,CAAcjB,CAAAnG,UAAd,CAQ/CkH,EAAAG,YAAA,CAAiCC,QAAQ,CAAC/C,CAAD,CAAO,CAC5CA,CAAA,CAAOA,CAAP,EAAe,IACf,IAAY,IAAZ,EAAIA,CAAJ,CACI,MAAO,KAAA0C,SAAAM,MAAA,EAEX,KADA,IAAIN,EAAW,EAAf,CACS9L,EAAE,CADX,CACcqM,EAAE,IAAAP,SAAA7L,OAAhB,CAAsCD,CAAtC,CAAwCqM,CAAxC,CAA2C,EAAErM,CAA7C,CACQ,IAAA8L,SAAA,CAAc9L,CAAd,CAAJ,UAAgCoJ,EAAhC,EACI0C,CAAA1H,KAAA,CAAc,IAAA0H,SAAA,CAAc9L,CAAd,CAAd,CACR;MAAO8L,EARqC,CAiBhDC,EAAAO,SAAA,CAA8BC,QAAQ,CAACC,CAAD,CAAQ,CAC1C,IAAIC,CACJ,IAAIA,CAAJ,CAAY,IAAAC,SAAA,CAAcF,CAAA7N,KAAd,CAAZ,CAEI,GAAI8N,CAAJ,WAAqBE,EAAAC,MAArB,EAAsCH,CAAA9N,KAAtC,GAAqD8N,CAAAI,aAArD,EAAiH,IAAjH,GAA2E,IAAAH,SAAA,CAAcD,CAAAI,aAAd,CAA3E,CACIJ,CAAA9N,KAAA,CAAa8N,CAAAI,aADjB,KAEK,IAAIL,CAAJ,WAAqBG,EAAAC,MAArB,EAAsCJ,CAAA7N,KAAtC,GAAqD6N,CAAAK,aAArD,EAAiH,IAAjH,GAA2E,IAAAH,SAAA,CAAcF,CAAAK,aAAd,CAA3E,CACDL,CAAA7N,KAAA,CAAa6N,CAAAK,aADZ,KAGD,MAAM1M,MAAA,CAAM,8BAAN,CAAqC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAArC,CAAyD,IAAzD,CAA8DoG,CAAA7N,KAA9D,CAAN,CAER,IAAAmN,SAAA1H,KAAA,CAAmBoI,CAAnB,CAX0C,CAoB9CT,EAAAW,SAAA,CAA8BI,QAAQ,CAACC,CAAD,CAAW,CAE7C,IADA,IAAIC,EAA0B,QAApB,GAAA,MAAOD,EAAP,CAA+B,IAA/B,CAAsC,MAAhD,CACS/M,EAAE,CADX,CACcqM,EAAE,IAAAP,SAAA7L,OAAhB,CAAsCD,CAAtC,CAAwCqM,CAAxC,CAA2C,EAAErM,CAA7C,CACI,GAAI,IAAA8L,SAAA,CAAc9L,CAAd,CAAA,CAAiBgN,CAAjB,CAAJ;AAA8BD,CAA9B,CACI,MAAO,KAAAjB,SAAA,CAAc9L,CAAd,CACf,OAAO,KALsC,CAejD+L,EAAAkB,QAAA,CAA6BC,QAAQ,CAACC,CAAD,CAAKC,CAAL,CAA0B,CAAA,IACvDC,EAAqB,QAAd,GAAA,MAAOF,EAAP,CAAyBA,CAAAG,MAAA,CAAS,GAAT,CAAzB,CAAyCH,CADO,CAEvD9B,EAAM,IAFiD,CAGvDrL,EAAI,CACR,IAAgB,EAAhB,GAAIqN,CAAA,CAAKrN,CAAL,CAAJ,CAAoB,CAChB,IAAA,CAAsB,IAAtB,GAAOqL,CAAAzD,OAAP,CAAA,CACIyD,CAAA,CAAMA,CAAAzD,OACV5H,EAAA,EAHgB,CAMpB,EAAG,CACC,EAAG,CACC,GAAM,EAAAqL,CAAA,WAAenB,EAAAyB,UAAf,CAAN,CAAyC,CACrCN,CAAA,CAAM,IACN,MAFqC,CAIzCmB,CAAA,CAAQnB,CAAAqB,SAAA,CAAaW,CAAA,CAAKrN,CAAL,CAAb,CACR,IAAI,EAACwM,CAAD,EAAYA,CAAZ,WAA6BtC,EAAAc,EAA7B,CAAJ,EAAgDoC,CAAhD,EAAyE,EAAAZ,CAAA,WAAiBtC,EAAAyB,UAAjB,CAAzE,CAA+G,CAC3GN,CAAA,CAAM,IACN,MAF2G,CAIlGrL,CAAA,EAVd,CAAH,MAWSA,CAXT,CAWaqN,CAAApN,OAXb,CAYA,IAAW,IAAX,EAAIoL,CAAJ,CACI,KAEJ,IAAoB,IAApB,GAAI,IAAAzD,OAAJ,CACI,MAAO,KAAAA,OAAAqF,QAAA,CAAoBE,CAApB,CAAwBC,CAAxB,CAjBZ,CAAH,MAkBgB,IAlBhB,EAkBS/B,CAlBT,CAmBA,OAAOA,EA7BoD,CAsC/DU,EAAAoB,GAAA,CAAwBI,QAAQ,CAACC,CAAD,CAAI,CAAA,IAC5BH,EAAO,EADqB,CACjBhC,EAAMmC,CACrB,GACIH,EAAAI,QAAA,CAAapC,CAAA1M,KAAb,CACA,CAAA0M,CAAA,CAAMA,CAAAzD,OAFV,OAGiB,IAHjB;AAGSyD,CAHT,CAIA,KAASqC,CAAT,CAAa,CAAb,CAAgBA,CAAhB,EAAuBL,CAAApN,OAAvB,CAAoCyN,CAAA,EAApC,CAA2C,CACvC,IAAIP,EAAKE,CAAAjB,MAAA,CAAWiB,CAAApN,OAAX,CAAuByN,CAAvB,CACT,IAAIF,CAAJ,GAAU,IAAAP,QAAA,CAAaE,CAAb,CAAiBK,CAAjB,WAA8BtD,EAAAyB,UAA9B,CAAV,CACI,MAAOwB,EAAAQ,KAAA,CAAQ,GAAR,CAH4B,CAK3C,MAAOH,EAAArC,IAAA,EAXyB,CAmBpCY,EAAAN,MAAA,CAA2BmC,QAAQ,EAAG,CAIlC,IAFA,IAAIC,EAAK,EAAT,CACI/B,EAAW,IAAAA,SADf,CAES9L,EAAE,CAFX,CAEcqM,EAAEP,CAAA7L,OAFhB,CAEiCuM,CAAjC,CAAwCxM,CAAxC,CAA0CqM,CAA1C,CAA6C,EAAErM,CAA/C,CACIwM,CACA,CADQV,CAAA,CAAS9L,CAAT,CACR,CAAIwM,CAAJ,WAAqBb,EAArB,GACIkC,CAAA,CAAGrB,CAAA7N,KAAH,CADJ,CACqB6N,CAAAf,MAAA,EADrB,CAGAO,OAAA8B,eAAJ,EACI9B,MAAA8B,eAAA,CAAsBD,CAAtB,CAA0B,UAA1B,CAAsC,CAAE,MAAS,IAAAE,SAAA,EAAX,CAAtC,CACJ,OAAOF,EAX2B,CAkBtC9B,EAAAgC,SAAA,CAA8BC,QAAQ,EAAG,CAGrC,IAHqC,IACjCC,EAAM,EAD2B,CAEjCC,EAAOlC,MAAAkC,KAAA,CAAY,IAAAjK,QAAZ,CAF0B,CAG5BjE,EAAE,CAH0B,CAGvBqM,EAAE6B,CAAAjO,OAAhB,CAA6BD,CAA7B,CAA+BqM,CAA/B,CAAkC,EAAErM,CAApC,CAOIiO,CAAA,CANUC,CAAAlB,CAAKhN,CAALgN,CAMV,CAAA,CALU,IAAA/I,QAAAL,CAAasK,CAAA,CAAKlO,CAAL,CAAb4D,CAQd,OAAOqK,EAb8B,CAqBzClC,EAAAoC,UAAA,CAA+BC,QAAQ,CAACzP,CAAD,CAAO,CAC1C,MAAoB,WAApB;AAAI,MAAOA,EAAX,CACW,IAAAsF,QADX,CAEqC,WAA9B,GAAA,MAAO,KAAAA,QAAA,CAAatF,CAAb,CAAP,CAA4C,IAAAsF,QAAA,CAAatF,CAAb,CAA5C,CAAiE,IAH9B,CAU9CuL,EAAAyB,UAAA,CAAoBA,CAuBpB,KAAI0C,EAAUA,QAAQ,CAACjF,CAAD,CAAOkF,CAAP,CAAqBC,CAArB,CAA+B3C,CAA/B,CAAuCjN,CAAvC,CAA6C,CAM/D,IAAAyK,KAAA,CAAYA,CAMZ,KAAAkF,aAAA,CAAoBA,CAMpB,KAAAC,SAAA,CAAgBA,CAMhB,KAAA3C,OAAA,CAAcA,CAMd,KAAAjN,KAAA,CAAYA,CAEZ,IAAI4P,CAAJ,EAAuD,CAAvD,CAAgBxQ,CAAAkB,cAAAuP,QAAA,CAA+BpF,CAA/B,CAAhB,CACI,KAAMjJ,MAAA,CAAM,wBAAN,CAAiCiJ,CAAAzK,KAAjC,CAAN,CAjC2D,CAAnE,CAoCI8P,EAAmBJ,CAAAxJ,UAwBvBwJ,EAAAK,kBAAA,CAhBAC,QAAkB,CAACvF,CAAD,CAAO,CACD,QAApB,GAAI,MAAOA,EAAX,GACIA,CADJ,CACWrL,CAAAW,MAAA,CAAe0K,CAAf,CADX,CAEA,IAAiC,WAAjC,GAAI,MAAOA,EAAAvK,aAAX,CACI,KAAMsB,MAAA,CAAM,yBAAN,CAAgCiJ,CAAAzK,KAAhC,CAA0C,mBAA1C,CAAN,CACJ,MAAIyK,EAAJ,EAAYrL,CAAAW,MAAA,MAAZ,CACW,IAAIb,CAAJ,CAAe,CAAf,CADX,CAEOuL,CAAAvK,aAPc,CAsCzB4P;CAAArI,SAAA,CAA4BwI,QAAQ,EAAG,CACnC,OAAQ,IAAAjQ,KAAR,EAAqB,EAArB,GAA4B,IAAA4P,SAAA,CAAgB,KAAhB,CAAwB,OAApD,EAA+D,UAD5B,CAYvCE,EAAAI,YAAA,CAA+BC,QAAQ,CAAC3L,CAAD,CAAQ,CAE3C4L,QAASA,EAAI,CAACnL,CAAD,CAAM6E,CAAN,CAAW,CACpB,KAAMtI,MAAA,CAAM,oBAAN,CAA2B6O,CAAA5I,SAAA,CAAc,CAAA,CAAd,CAA3B,CAA+C,WAA/C,CAA2D4I,CAAA5F,KAAAzK,KAA3D,CAA0E,IAA1E,CAA+EiF,CAA/E,CAAmF,IAAnF,CAAwF6E,CAAxF,CAA4F,GAA5F,CAAN,CADoB,CADxB,IAAIuG,EAAO,IAIX,QAAQ,IAAA5F,KAAR,EAEI,KAAKrL,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CAII,MAAO,CAFc,QAEd,GAFH,MAAOyE,EAEJ,EAF2BA,CAE3B,GAFqCA,CAErC,EAF4D,CAE5D,GAF8CA,CAE9C,CAFsD,CAEtD,GADH4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,gBAAnB,CACG,CAAQ,UAAR,CAAAA,CAAA,CAAqBA,CAArB,CAA6B,CAA7B,CAAiCA,CAG5C,MAAKpF,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CAGI,MAAO,CAFc,QAEd,GAFH,MAAOyE,EAEJ,EAF2BA,CAE3B,GAFqCA,CAErC,EAF4D,CAE5D,GAF8CA,CAE9C,CAFsD,CAEtD,GADH4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,gBAAnB,CACG;AAAQ,CAAR,CAAAA,CAAA,CAAYA,CAAZ,GAAsB,CAAtB,CAA0BA,CAGrC,MAAKpF,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACI,GAAIX,CAAAC,KAAJ,CACI,GAAI,CACA,MAAOmM,EAAA,CAAOhH,CAAP,CAAc,CAAA,CAAd,CADP,CAEF,MAAOjD,CAAP,CAAU,CACR6O,CAAA,CAAK,MAAO5L,EAAZ,CAAmBjD,CAAAkH,QAAnB,CADQ,CAHhB,IAOI2H,EAAA,CAAK,MAAO5L,EAAZ,CAAmB,kBAAnB,CAIR,MAAKpF,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CACI,GAAIX,CAAAC,KAAJ,CACI,GAAI,CACA,MAAOmM,EAAA,CAAOhH,CAAP,CAAc,CAAA,CAAd,CADP,CAEF,MAAOjD,CAAP,CAAU,CACR6O,CAAA,CAAK,MAAO5L,EAAZ,CAAmBjD,CAAAkH,QAAnB,CADQ,CAHhB,IAOI2H,EAAA,CAAK,MAAO5L,EAAZ,CAAmB,kBAAnB,CAIR,MAAKpF,CAAAW,MAAA,KAAL,CAGI,MAFqB,SAEdyE,GAFH,MAAOA,EAEJA,EADH4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,eAAnB,CACGA,CAAAA,CAGX,MAAKpF,CAAAW,MAAA,CAAe,OAAf,CAAL,CACA,KAAKX,CAAAW,MAAA,CAAe,QAAf,CAAL,CAGI,MAFqB,QAEdyE,GAFH,MAAOA,EAEJA,EADH4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,cAAnB,CACGA,CAAAA,CAGX,MAAKpF,CAAAW,MAAA,OAAL,CAGI,MAFqB,QAEd;AAFH,MAAOyE,EAEJ,EAF4BA,CAE5B,EAFqCA,CAErC,WAFsD8L,OAEtD,EADHF,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,cAAnB,CACG,CAAA,EAAA,CAAGA,CAGd,MAAKpF,CAAAW,MAAA,MAAL,CACI,MAAIb,EAAAqR,aAAA,CAAwB/L,CAAxB,CAAJ,CACWA,CADX,CAEOtF,CAAAsR,KAAA,CAAgBhM,CAAhB,CAAuB,QAAvB,CAGX,MAAKpF,CAAAW,MAAA,CAAe,MAAf,CAAL,CAEI,IADA,IAAI0Q,EAAS,IAAAd,aAAApC,YAAA,CAA8BnO,CAAAmM,QAAAmF,KAAAC,MAA9B,CAAb,CACKtP,EAAE,CAAP,CAAUA,CAAV,CAAYoP,CAAAnP,OAAZ,CAA2BD,CAAA,EAA3B,CAGS,GAFDoP,CAAA,CAAOpP,CAAP,CAAArB,KAEC,EAFiBwE,CAEjB,EAAIiM,CAAA,CAAOpP,CAAP,CAAAqD,GAAJ,EAAoBF,CAApB,CACD,MAAOiM,EAAA,CAAOpP,CAAP,CAAAqD,GAEf,IAAoB,QAApB,GAAI,IAAAuI,OAAJ,CAMI,MAAOzI,CAJc,QAIdA,GAJH,MAAOA,EAIJA,EAJ2BA,CAI3BA,GAJqCA,CAIrCA,EAJ4D,CAI5DA,GAJ8CA,CAI9CA,CAJsD,CAItDA,GAHH4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,gBAAnB,CAGGA,EAFK,UAELA,CAFHA,CAEGA,EAF2B,CAE3BA,CAFmBA,CAEnBA,GADH4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,yBAAnB,CACGA,CAAAA,CAGP4L,EAAA,CAAK5L,CAAL,CAAY,wBAAZ,CAIR,MAAKpF,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CACSyE,CAAL;AAA+B,QAA/B,GAAc,MAAOA,EAArB,EACI4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,iBAAnB,CACJ,IAAIA,CAAJ,WAAqB,KAAAmL,aAAAiB,MAArB,CACI,MAAOpM,EACX,IAAIA,CAAJ,WAAqBpF,EAAAyR,QAAA7C,QAArB,CAA+C,CAEvC8C,IAAAA,EAAM,EAANA,CACKzP,CAAT,KAASA,CAAT,GAAcmD,EAAd,CACQA,CAAA0F,eAAA,CAAqB7I,CAArB,CAAJ,GACIyP,CAAA,CAAIzP,CAAJ,CADJ,CACamD,CAAA,CAAMnD,CAAN,CADb,CAEJmD,EAAA,CAAQsM,CANmC,CAS/C,MAAO,KAAK,IAAAnB,aAAAiB,MAAL,CAA8BpM,CAA9B,CA1Gf,CA+GA,KAAMhD,MAAA,CAAM,+BAAN,CAAsC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAtC,CAA0D,IAA1D,CAA+DjD,CAA/D,CAAqE,mBAArE,CAAyF,IAAAiG,KAAzF,CAAmG,GAAnG,CAAN,CApH2C,CA+H/CqF,EAAAiB,gBAAA,CAAmCC,QAAQ,CAACtM,CAAD,CAAKF,CAAL,CAAY,CACnD,GAAc,IAAd,GAAIA,CAAJ,CAAoB,MAAO,EAE3B,KAAIyM,CACJ,QAAQ,IAAAxG,KAAR,EACI,KAAKrL,CAAAW,MAAA,MAAL,CACI,MAAe,EAAR,CAAAyE,CAAA,CAAYtF,CAAAgS,kBAAA,CAA6B1M,CAA7B,CAAZ,CAAkDtF,CAAAiS,kBAAA,CAA6B3M,CAA7B,CAC7D,MAAKpF,CAAAW,MAAA,OAAL,CACI,MAAOb,EAAAiS,kBAAA,CAA6B3M,CAA7B,CACX;KAAKpF,CAAAW,MAAA,OAAL,CACI,MAAOb,EAAAiS,kBAAA,CAA6BjS,CAAAkS,eAAA,CAA0B5M,CAA1B,CAA7B,CACX,MAAKpF,CAAAW,MAAA,QAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACA,KAAKX,CAAAW,MAAA,CAAe,OAAf,CAAL,CACI,MAAO,EACX,MAAKX,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACI,MAAOb,EAAAgS,kBAAA,CAA6B1M,CAA7B,CACX,MAAKpF,CAAAW,MAAA,OAAL,CACI,MAAOb,EAAAgS,kBAAA,CAA6BhS,CAAAmS,eAAA,CAA0B7M,CAA1B,CAA7B,CACX,MAAKpF,CAAAW,MAAA,QAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACI,MAAO,EACX,MAAKX,CAAAW,MAAA,KAAL,CACI,MAAO,EACX,MAAKX,CAAAW,MAAA,CAAe,MAAf,CAAL,CACI,MAAOb,EAAAiS,kBAAA,CAA6B3M,CAA7B,CACX,MAAKpF,CAAAW,MAAA,CAAe,QAAf,CAAL,CACI,MAAO,EACX,MAAKX,CAAAW,MAAA,OAAL,CAEI,MADAkR,EACO,CADH/R,CAAAoS,mBAAA,CAA8B9M,CAA9B,CACG,CAAAtF,CAAAiS,kBAAA,CAA6BF,CAA7B,CAAA;AAAkCA,CAC7C,MAAK7R,CAAAW,MAAA,MAAL,CACI,GAAwB,CAAxB,CAAIyE,CAAA+M,UAAA,EAAJ,CACI,KAAM/P,MAAA,CAAM,oBAAN,CAA2B,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAA3B,CAA+C,IAA/C,CAAoDjD,CAAA+M,UAAA,EAApD,CAAsE,kBAAtE,CAAN,CACJ,MAAOrS,EAAAiS,kBAAA,CAA6B3M,CAAA+M,UAAA,EAA7B,CAAP,CAAyD/M,CAAA+M,UAAA,EAC7D,MAAKnS,CAAAW,MAAA,QAAL,CAEI,MADAkR,EACO,CADH,IAAAtB,aAAA6B,UAAA,CAA4BhN,CAA5B,CACG,CAAAtF,CAAAiS,kBAAA,CAA6BF,CAA7B,CAAA,CAAkCA,CAC7C,MAAK7R,CAAAW,MAAA,MAAL,CAEI,MADAkR,EACO,CADH,IAAAtB,aAAA6B,UAAA,CAA4BhN,CAA5B,CACG,CAAAyM,CAAA,CAAI/R,CAAAiS,kBAAA,CAA8BzM,CAA9B,EAAoC,CAApC,CAAyCtF,CAAAG,WAAAK,SAAzC,CArCnB,CAwCA,KAAM4B,MAAA,CAAM,wCAAN,CAA+C,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAA/C,CAAmE,IAAnE,CAAwEjD,CAAxE,CAA8E,iBAA9E,CAAN,CA5CmD,CAwDvDsL,EAAA2B,YAAA,CAA+BC,QAAQ,CAAChN,CAAD;AAAKF,CAAL,CAAYmN,CAAZ,CAAoB,CACvD,GAAc,IAAd,GAAInN,CAAJ,CAAoB,MAAOmN,EAG3B,QAAQ,IAAAlH,KAAR,EAEI,KAAKrL,CAAAW,MAAA,MAAL,CAGgB,CAAZ,CAAIyE,CAAJ,CACImN,CAAAC,cAAA,CAAqBpN,CAArB,CADJ,CAGImN,CAAAE,cAAA,CAAqBrN,CAArB,CACJ,MAGJ,MAAKpF,CAAAW,MAAA,OAAL,CACI4R,CAAAE,cAAA,CAAqBrN,CAArB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,OAAL,CACI4R,CAAAG,oBAAA,CAA2BtN,CAA3B,CACA,MAGJ,MAAKpF,CAAAW,MAAA,QAAL,CACI4R,CAAAI,YAAA,CAAmBvN,CAAnB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,SAAL,CACI4R,CAAAK,WAAA,CAAkBxN,CAAlB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACI4R,CAAAC,cAAA,CAAqBpN,CAArB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,OAAL,CACI4R,CAAAM,oBAAA,CAA2BzN,CAA3B,CACA,MAGJ,MAAKpF,CAAAW,MAAA,QAAL,CACI4R,CAAAO,YAAA,CAAmB1N,CAAnB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,SAAL,CACI4R,CAAAQ,WAAA,CAAkB3N,CAAlB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,KAAL,CACyB,QAArB;AAAI,MAAOyE,EAAX,CACImN,CAAAE,cAAA,CAA6C,OAAxB,GAAArN,CAAAuE,YAAA,EAAA,CAAkC,CAAlC,CAAsC,CAAEvE,CAAAA,CAA7D,CADJ,CAGImN,CAAAE,cAAA,CAAqBrN,CAAA,CAAQ,CAAR,CAAY,CAAjC,CACJ,MAGJ,MAAKpF,CAAAW,MAAA,CAAe,MAAf,CAAL,CACI4R,CAAAE,cAAA,CAAqBrN,CAArB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,CAAe,OAAf,CAAL,CACI4R,CAAAS,aAAA,CAAoB5N,CAApB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,CAAe,QAAf,CAAL,CACI4R,CAAAU,aAAA,CAAoB7N,CAApB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,OAAL,CACI4R,CAAAW,aAAA,CAAoB9N,CAApB,CACA,MAGJ,MAAKpF,CAAAW,MAAA,MAAL,CACI,GAAwB,CAAxB,CAAIyE,CAAA+M,UAAA,EAAJ,CACI,KAAM/P,MAAA,CAAM,oBAAN,CAA2B,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAA3B,CAA+C,IAA/C,CAAoDjD,CAAA+M,UAAA,EAApD,CAAsE,kBAAtE,CAAN,CACAgB,CAAAA,CAAa/N,CAAA4H,OACjBuF,EAAAE,cAAA,CAAqBrN,CAAA+M,UAAA,EAArB,CACAI,EAAAa,OAAA,CAAchO,CAAd,CACAA,EAAA4H,OAAA,CAAemG,CACf,MAGJ,MAAKnT,CAAAW,MAAA,QAAL,CACQ0S,CAAAA,CAAKC,CAAA,IAAIxT,CAAJwT,IAAA,EACT;IAAA/C,aAAAgD,OAAA,CAAyBnO,CAAzB,CAAgCiO,CAAhC,CACAd,EAAAE,cAAA,CAAqBY,CAAArG,OAArB,CACAuF,EAAAa,OAAA,CAAcC,CAAAG,KAAA,EAAd,CACA,MAGJ,MAAKxT,CAAAW,MAAA,MAAL,CACI,IAAA4P,aAAAgD,OAAA,CAAyBnO,CAAzB,CAAgCmN,CAAhC,CACAA,EAAAE,cAAA,CAAsBnN,CAAtB,EAA4B,CAA5B,CAAiCtF,CAAAG,WAAAK,SAAjC,CACA,MAEJ,SAEI,KAAM4B,MAAA,CAAM,wCAAN,CAA+C,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAA/C,CAAmE,IAAnE,CAAwEjD,CAAxE,CAA8E,iBAA9E,CAAN,CA1GR,CA4GA,MAAOmN,EAhHgD,CA4H3D7B,EAAA+C,OAAA,CAA0BC,QAAQ,CAACnB,CAAD,CAAS1R,CAAT,CAAmByE,CAAnB,CAAuB,CACrD,GAAIzE,CAAJ,EAAgB,IAAAwK,KAAAxK,SAAhB,CACI,KAAMuB,MAAA,CAAM,kCAAN,CAAN,CAGJ,OAAQ,IAAAiJ,KAAR,EAEI,KAAKrL,CAAAW,MAAA,MAAL,CACI,MAAO4R,EAAAzF,aAAA,EAAP,CAA+B,CAGnC,MAAK9M,CAAAW,MAAA,OAAL,CACI,MAAO4R,EAAAzF,aAAA,EAAP;AAAiC,CAGrC,MAAK9M,CAAAW,MAAA,OAAL,CACI,MAAO4R,EAAAoB,mBAAA,EAAP,CAAqC,CAGzC,MAAK3T,CAAAW,MAAA,QAAL,CACI,MAAO4R,EAAAqB,WAAA,EAAP,GAA+B,CAEnC,MAAK5T,CAAAW,MAAA,SAAL,CACI,MAAO4R,EAAAsB,UAAA,EAAP,CAA4B,CAGhC,MAAK7T,CAAAW,MAAA,MAAL,CACI,MAAO4R,EAAAuB,aAAA,EAGX,MAAK9T,CAAAW,MAAA,OAAL,CACI,MAAO4R,EAAAuB,aAAA,EAAAC,WAAA,EAGX,MAAK/T,CAAAW,MAAA,OAAL,CACI,MAAO4R,EAAAyB,mBAAA,EAGX,MAAKhU,CAAAW,MAAA,QAAL,CACI,MAAO4R,EAAA0B,WAAA,EAGX,MAAKjU,CAAAW,MAAA,SAAL,CACI,MAAO4R,EAAA2B,UAAA,EAGX,MAAKlU,CAAAW,MAAA,KAAL,CACI,MAAO,CAAE,CAAA4R,CAAAzF,aAAA,EAGb,MAAK9M,CAAAW,MAAA,CAAe,MAAf,CAAL,CAEI,MAAO4R,EAAAzF,aAAA,EAGX,MAAK9M,CAAAW,MAAA,CAAe,OAAf,CAAL,CACI,MAAO4R,EAAA4B,UAAA,EAGX;KAAKnU,CAAAW,MAAA,CAAe,QAAf,CAAL,CACI,MAAO4R,EAAA6B,WAAA,EAGX,MAAKpU,CAAAW,MAAA,OAAL,CACI,MAAO4R,EAAA8B,YAAA,EAGX,MAAKrU,CAAAW,MAAA,MAAL,CACI2T,CAAA,CAAS/B,CAAAzF,aAAA,EACT,IAAIyF,CAAAJ,UAAA,EAAJ,CAAyBmC,CAAzB,CACI,KAAMlS,MAAA,CAAM,8BAAN,CAAqC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAArC,CAAyD,IAAzD,CAA8DiM,CAA9D,CAAqE,yBAArE,CAA+F/B,CAAAJ,UAAA,EAA/F,CAAN,CACJ/M,CAAA,CAAQmN,CAAAgC,MAAA,EACRnP,EAAAoP,MAAA,CAAcpP,CAAA4H,OAAd,CAA2BsH,CAC3B/B,EAAAvF,OAAA,EAAiBsH,CACjB,OAAOlP,EAIX,MAAKpF,CAAAW,MAAA,QAAL,CAEI,MADA2T,EACO,CADE/B,CAAAzF,aAAA,EACF,CAAA,IAAAyD,aAAAkD,OAAA,CAAyBlB,CAAzB,CAAiC+B,CAAjC,CAIX,MAAKtU,CAAAW,MAAA,MAAL,CACI,MAAO,KAAA4P,aAAAkD,OAAA,CAAyBlB,CAAzB,CAAkC,EAAlC,CAAqCjN,CAArC,CAhFf,CAoFA,KAAMlD,MAAA,CAAM,gCAAN,CAAN,CAzFqD,CAoGzDsO,EAAA+D,gBAAA;AAAmCC,QAAQ,CAACjR,CAAD,CAAM,CAC7C,GAAK+M,CAAA,IAAAA,SAAL,CACI,KAAMpO,MAAA,CAAM,iDAAN,CAAN,CAGJ,OAAQ,IAAAiJ,KAAR,EACI,KAAKrL,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CACI,MAAO,KAAAmQ,YAAA,CAAiBnL,QAAA,CAASlC,CAAT,CAAjB,CAEX,MAAKzD,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CAEM,MAAO,KAAAmQ,YAAA,CAAiBrN,CAAjB,CAEb,MAAKzD,CAAAW,MAAA,KAAL,CACM,MAAe,MAAf,GAAO8C,CAEb,MAAKzD,CAAAW,MAAA,OAAL,CACM,MAAO,KAAAmQ,YAAA,CAAiBrN,CAAjB,CAEb,MAAKzD,CAAAW,MAAA,MAAL,CACM,MAAOb,EAAA6U,WAAA,CAAsBlR,CAAtB,CAvBjB,CAL6C,CA+CjDiN;CAAAkE,cAAA,CAAiCC,QAAQ,CAACzP,CAAD,CAAQ,CAC7C,GAAKoL,CAAA,IAAAA,SAAL,CACI,KAAMpO,MAAA,CAAM,+CAAN,CAAN,CAGJ,MAAI,KAAAiJ,KAAJ,GAAkBrL,CAAAW,MAAA,MAAlB,CACWyE,CAAAiD,SAAA,CAAe,QAAf,CADX,CAGWjD,CAAAiD,SAAA,EARkC,CAgBjD8D,EAAAmE,QAAA,CAAkBA,CAclB,KAAI1B,EAAUA,QAAQ,CAAC1B,CAAD,CAAUrD,CAAV,CAAkBjJ,CAAlB,CAAwBsF,CAAxB,CAAiCuE,CAAjC,CAA0CoD,CAA1C,CAAkD,CACpED,CAAAE,KAAA,CAAe,IAAf,CAAqBZ,CAArB,CAA8BrD,CAA9B,CAAsCjJ,CAAtC,CAA4CsF,CAA5C,CAAqD2H,CAArD,CAKA,KAAAJ,UAAA,CAAiB,SAOjB,KAAAqH,WAAA,CAAkB9T,IAAAA,EAOlB,KAAAwQ,MAAA,CAAa,IAOb,KAAA/G,QAAA,CAAe,CAAEA,CAAAA,CAuBjB,KAAAsK,cAAA,CAPA,IAAAC,YAOA,CAdA,IAAAC,QAcA,CAde,IApCqD,CAAxE,CAyDIC,EAAmBtG,CAAA9H,UAAnBoO,CAAuCjH,MAAAC,OAAA,CAAcN,CAAA9G,UAAd,CAU3CoO,EAAAxH,MAAA,CAAyByH,QAAQ,CAACC,CAAD,CAAU,CACvC,GAAI,IAAA5D,MAAJ,EAAmB4D,CAAAA,CAAnB,CACI,MAAO,KAAA5D,MAGPA,EAAAA,CAAS,QAAQ,CAACxR,CAAD,CAAWiN,CAAX,CAAc,CAqe/BoI,QAASA,EAAQ,CAAC3D,CAAD,CAAM4D,CAAN;AAAsBC,CAAtB,CAAsChF,CAAtC,CAAoD,CACjE,GAAY,IAAZ,GAAImB,CAAJ,EAAmC,QAAnC,GAAoB,MAAOA,EAA3B,CAA6C,CAEzC,GAAInB,CAAJ,EAAoBA,CAApB,WAA4CvQ,EAAAmM,QAAAmF,KAA5C,CAAmE,CAC/D,IAAI1Q,EAAOZ,CAAAmM,QAAAmF,KAAAkE,QAAA,CAA8BjF,CAAAkF,OAA9B,CAAmD/D,CAAnD,CACX,IAAa,IAAb,GAAI9Q,CAAJ,CACI,MAAOA,EAHoD,CAMnE,MAAO8Q,EARkC,CAW7C,GAAI5R,CAAAqR,aAAA,CAAwBO,CAAxB,CAAJ,CACI,MAAO4D,EAAA,CAAiB5D,CAAAgE,SAAA,EAAjB,CAAkChE,CAAAiE,SAAA,EAE7C,IAAI3V,CAAAC,KAAA2V,OAAA,CAAqBlE,CAArB,CAAJ,CACI,MAAO6D,EAAA,CAAiB7D,CAAArJ,SAAA,EAAjB,CAAkCrI,CAAAC,KAAA4V,UAAA,CAAwBnE,CAAxB,CAC7C,KAAI6C,CAEJ,IAAIpO,KAAAC,QAAA,CAAcsL,CAAd,CAAJ,CAKI,MAJA6C,EAIOA,CAJC,EAIDA,CAHP7C,CAAAoE,QAAA,CAAY,QAAQ,CAACC,CAAD,CAAIzH,CAAJ,CAAO,CACvBiG,CAAA,CAAMjG,CAAN,CAAA,CAAW+G,CAAA,CAASU,CAAT,CAAYT,CAAZ,CAA4BC,CAA5B,CAA4ChF,CAA5C,CADY,CAA3B,CAGOgE,CAAAA,CAEXA,EAAA,CAAQ,EAER,IAAI7C,CAAJ,WAAmB1R,EAAAgW,IAAnB,CAAiC,CAE7B,IADIC,IAAAA,EAAKvE,CAAAwE,QAAA,EAALD,CACK9T,EAAI8T,CAAA5O,KAAA,EAAb,CAAyB8O,CAAAhU,CAAAgU,KAAzB,CAAiChU,CAAjC,CAAqC8T,CAAA5O,KAAA,EAArC,CACIkN,CAAA,CAAM7C,CAAA0E,QAAAxB,cAAA,CAA0BzS,CAAAiD,MAAA,CAAQ,CAAR,CAA1B,CAAN,CAAA,CAA+CiQ,CAAA,CAASlT,CAAAiD,MAAA,CAAQ,CAAR,CAAT,CAAqBkQ,CAArB,CAAqCC,CAArC,CAAqD7D,CAAA2E,UAAA9F,aAArD,CACnD;MAAOgE,EAJsB,CAO7BlJ,IAAAA,EAAOqG,CAAA4E,MAAPjL,CACAkL,EAAQvV,IAAAA,EADRqK,CAEKpJ,CAAT,KAASA,CAAT,GAAcyP,EAAd,CACQA,CAAA5G,eAAA,CAAmB7I,CAAnB,CAAJ,GACQoJ,CAAJ,GAAakL,CAAb,CAAqBlL,CAAAsD,SAAA,CAAc1M,CAAd,CAArB,EACIsS,CAAA,CAAMtS,CAAN,CADJ,CACeoT,CAAA,CAAS3D,CAAA,CAAIzP,CAAJ,CAAT,CAAiBqT,CAAjB,CAAiCC,CAAjC,CAAiDgB,CAAAhG,aAAjD,CADf,CAGIgE,CAAA,CAAMtS,CAAN,CAHJ,CAGeoT,CAAA,CAAS3D,CAAA,CAAIzP,CAAJ,CAAT,CAAiBqT,CAAjB,CAAiCC,CAAjC,CAJnB,CAMJ,OAAOhB,EA5C0D,CAretC,IAE3B/I,EAASyB,CAAAkB,YAAA,CAAcnO,CAAAmM,QAAAyC,QAAAC,MAAd,CAFkB,CAG3B2H,EAASvJ,CAAAkB,YAAA,CAAcnO,CAAAmM,QAAAyC,QAAA6H,MAAd,CAHkB,CAc3B7H,EAAUA,QAAQ,CAACyC,CAAD,CAASqF,CAAT,CAAmB,CACrC1W,CAAAyR,QAAA7C,QAAAd,KAAA,CAA8B,IAA9B,CAGA,KAJqC,IAI5B7L,EAAE,CAJ0B,CAIvBqM,EAAEkI,CAAAtU,OAAhB,CAA+BD,CAA/B,CAAiCqM,CAAjC,CAAoC,EAAErM,CAAtC,CACI,IAAA,CAAKuU,CAAA,CAAOvU,CAAP,CAAArB,KAAL,CAAA,CAAuB,IAEtBqB,EAAA,CAAE,CAAP,KAAUqM,CAAV,CAAY9C,CAAAtJ,OAAZ,CAA2BD,CAA3B,CAA6BqM,CAA7B,CAAgC,EAAErM,CAAlC,CAAqC,CACjC,IAAIsU,EAAQ/K,CAAA,CAAOvJ,CAAP,CACZ,KAAA,CAAKsU,CAAA3V,KAAL,CAAA,CACI2V,CAAAI,SAAA,CAAiB,EAAjB,CACCJ,CAAAK,IAAA,CAAY,IAAI5W,CAAAgW,IAAJ,CAAiBO,CAAjB,CAAZ,CAAsC,IACtCM,EAAAN,CAAAM,SAAL,EAAoC,QAApC,GAAuB5J,CAAAY,OAAvB,EAC2B,IAD3B,GACI0I,CAAAzV,aADJ,GAEI,IAAA,CAAKyV,CAAA3V,KAAL,CAFJ,CAEuB2V,CAAAzV,aAFvB,CALiC,CAUrC,GAAuB,CAAvB;AAAIgW,SAAA5U,OAAJ,CAGI,GAAyB,CAAzB,GAAI4U,SAAA5U,OAAJ,EAAyC,IAAzC,GAA8BmP,CAA9B,EAAmE,QAAnE,GAAiD,MAAOA,EAAxD,EACiC,EAAyB,UAAzB,GAAA,MAAOA,EAAAkC,OAAP,EAAuClC,CAAvC,WAAyDzC,EAAzD,CADjC,EAEgCzI,KAAAC,QAAA,CAAciL,CAAd,CAFhC,EAGsBA,CAHtB,WAGwCrR,EAAAgW,IAHxC,EAI4BlW,CAAAqR,aAAA,CAAwBE,CAAxB,CAJ5B,EAK+BA,CAL/B,WAKiD0F,YALjD,EAMuB/W,CAAAC,KANvB,EAMwCoR,CANxC,WAM0DrR,EAAAC,KAN1D,CASI,IAAKgC,CAAK,CAAH,CAAG,CAAAqM,CAAA,CAAEwI,SAAA5U,OAAZ,CAA8BD,CAA9B,CAAgCqM,CAAhC,CAAmC,EAAErM,CAArC,CAC0C,WAAtC,GAAI,OAAQmD,CAAR,CAAgB0R,SAAA,CAAU7U,CAAV,CAAhB,CAAJ,EACI,IAAA+U,KAAA,CAAUxL,CAAA,CAAOvJ,CAAP,CAAArB,KAAV,CAA0BwE,CAA1B,CAXZ,KAOI,KAAA4R,KAAA,CAAU3F,CAAV,CA3B6B,CAdV,CAqD3B6D,EAAmBtG,CAAA9H,UAAnBoO,CAAuCjH,MAAAC,OAAA,CAAclO,CAAAyR,QAAA7C,QAAA9H,UAAd,CAa3CoO,EAAA+B,IAAA,CAAuBC,QAAQ,CAACjI,CAAD,CAAM7J,CAAN,CAAa+R,CAAb,CAAuB,CAClD,IAAIZ,EAAQtJ,CAAA8H,cAAA,CAAgB9F,CAAhB,CACZ,IAAKkI,CAAAA,CAAL,CAAe,CACX,GAAKZ,CAAAA,CAAL,CACI,KAAMnU,MAAA,CAAM,IAAN,CAAW,GAAX,CAAe6M,CAAf,CAAmB,eAAnB,CAAN;AACJ,GAAM,EAAAsH,CAAA,WAAiBvW,EAAAmM,QAAAyC,QAAAC,MAAjB,CAAN,CACI,KAAMzM,MAAA,CAAM,IAAN,CAAW,GAAX,CAAe6M,CAAf,CAAmB,mBAAnB,CAAuCsH,CAAAlO,SAAA,CAAe,CAAA,CAAf,CAAvC,CAAN,CACJ,GAAKsO,CAAAJ,CAAAI,SAAL,CACI,KAAMvU,MAAA,CAAM,IAAN,CAAW,GAAX,CAAe6M,CAAf,CAAmB,0BAAnB,CAAN,CACJ7J,CAAA,CAAQmR,CAAAzF,YAAA,CAAkB1L,CAAlB,CAAyB,CAAA,CAAzB,CAPG,CASG,IAAlB,GAAI,IAAA,CAAK6J,CAAL,CAAJ,GACI,IAAA,CAAKA,CAAL,CADJ,CACgB,EADhB,CAEA,KAAA,CAAKA,CAAL,CAAA5I,KAAA,CAAejB,CAAf,CACA,OAAO,KAd2C,CA4BtD8P,EAAAkC,KAAA,CAAwBlC,CAAA+B,IAaxB/B,EAAAmC,IAAA,CAAuBC,QAAQ,CAACC,CAAD,CAAWnS,CAAX,CAAkB+R,CAAlB,CAA4B,CACvD,GAAII,CAAJ,EAAoC,QAApC,GAAgB,MAAOA,EAAvB,CAA8C,CAC1CJ,CAAA,CAAW/R,CACX,KAAKoS,IAAIA,CAAT,GAAiBD,EAAjB,CAEQA,CAAAzM,eAAA,CAAwB0M,CAAxB,CAAJ,EAAyE,WAAzE,GAAqC,OAAQpS,CAAR,CAAgBmS,CAAA,CAASC,CAAT,CAAhB,CAArC,EAAkHxW,IAAAA,EAAlH,GAAwFiM,CAAAwK,cAAA,CAAgBD,CAAhB,CAAxF,EACI,IAAAR,KAAA,CAAUQ,CAAV,CAAgBpS,CAAhB,CAAuB+R,CAAvB,CAER,OAAO,KAPmC,CAS1CZ,CAAAA,CAAQtJ,CAAA8H,cAAA,CAAgBwC,CAAhB,CACZ,IAAKJ,CAAL,CAOI,IAAA,CAAKI,CAAL,CAAA,CAAiBnS,CAPrB,KAAe,CACX,GAAKmR,CAAAA,CAAL,CACI,KAAMnU,MAAA,CAAM,IAAN;AAAW,GAAX,CAAemV,CAAf,CAAwB,4BAAxB,CAAN,CACJ,GAAM,EAAAhB,CAAA,WAAiBvW,EAAAmM,QAAAyC,QAAAC,MAAjB,CAAN,CACI,KAAMzM,MAAA,CAAM,IAAN,CAAW,GAAX,CAAemV,CAAf,CAAwB,mBAAxB,CAA4ChB,CAAAlO,SAAA,CAAe,CAAA,CAAf,CAA5C,CAAN,CACJ,IAAA,CAAKkO,CAAA3V,KAAL,CAAA,CAAoBwE,CAApB,CAA4BmR,CAAAzF,YAAA,CAAkB1L,CAAlB,CALjB,CAQXmR,CAAJ,EAAaA,CAAAmB,MAAb,GACQC,CACJ,CADmB,IAAA,CAAKpB,CAAAmB,MAAA9W,KAAL,CACnB,CAAc,IAAd,GAAIwE,CAAJ,EACyB,IAErB,GAFIuS,CAEJ,EAF6BA,CAE7B,GAF8CpB,CAAA3V,KAE9C,GADI,IAAA,CAAK+W,CAAL,CACJ,CADyB,IACzB,EAAA,IAAA,CAAKpB,CAAAmB,MAAA9W,KAAL,CAAA,CAAyB2V,CAAA3V,KAH7B,EAIkC+W,CAJlC,GAImDJ,CAJnD,GAKI,IAAA,CAAKhB,CAAAmB,MAAA9W,KAAL,CALJ,CAK6B,IAL7B,CAFJ,CASA,OAAO,KA5BgD,CAyC3DsU,EAAA8B,KAAA,CAAwB9B,CAAAmC,IAYxBnC,EAAA0C,IAAA,CAAuBC,QAAQ,CAAC5I,CAAD,CAAMkI,CAAN,CAAgB,CAC3C,GAAIA,CAAJ,CACI,MAAO,KAAA,CAAKlI,CAAL,CACX,KAAIsH,EAAQtJ,CAAA8H,cAAA,CAAgB9F,CAAhB,CACZ,IAAI,EAACsH,CAAD,EAAYA,CAAZ,WAA6BvW,EAAAmM,QAAAyC,QAAAC,MAA7B,CAAJ,CACI,KAAMzM,MAAA,CAAM,IAAN,CAAW,GAAX,CAAe6M,CAAf,CAAmB,4BAAnB,CAAN;AACJ,GAAM,EAAAsH,CAAA,WAAiBvW,EAAAmM,QAAAyC,QAAAC,MAAjB,CAAN,CACI,KAAMzM,MAAA,CAAM,IAAN,CAAW,GAAX,CAAe6M,CAAf,CAAmB,mBAAnB,CAAuCsH,CAAAlO,SAAA,CAAe,CAAA,CAAf,CAAvC,CAAN,CACJ,MAAO,KAAA,CAAKkO,CAAA3V,KAAL,CARoC,CAoB/CsU,EAAA4C,KAAA,CAAwB5C,CAAA0C,IAIxB,KAAK,IAAI3V,EAAE,CAAX,CAAcA,CAAd,CAAgBuJ,CAAAtJ,OAAhB,CAA+BD,CAAA,EAA/B,CAAoC,CAChC,IAAIsU,EAAQ/K,CAAA,CAAOvJ,CAAP,CAERsU,EAAJ,WAAqBvW,EAAAmM,QAAAyC,QAAAmJ,eAArB,EAGI9K,CAAAC,QAAAhH,QAAA,kBAHJ,EAIK,QAAQ,CAACqQ,CAAD,CAAQ,CAEb,IAAIyB,EAAOzB,CAAAzH,aAAApL,QAAA,CAA2B,cAA3B,CAA2C,QAAQ,CAACyD,CAAD,CAAQ,CAClE,MAAOA,EAAAtD,YAAA,EAAAH,QAAA,CAA4B,GAA5B,CAAgC,EAAhC,CAD2D,CAA3D,CAAX,CAGAsU,EAAOA,CAAAvS,UAAA,CAAe,CAAf,CAAiB,CAAjB,CAAA5B,YAAA,EAAPmU,CAA2CA,CAAAvS,UAAA,CAAe,CAAf,CAH3C,CAMI7E,EAAO2V,CAAAzH,aAAApL,QAAA,CAA2B,UAA3B,CAAuC,QAAQ,CAACyD,CAAD,CAAQ,CAC9D,MAAO,GAAP,CAAWA,CADmD,CAAvD,CANX,CAkBI8Q,EAASA,QAAQ,CAAC7S,CAAD,CAAQ+R,CAAR,CAAkB,CACnC,IAAA,CAAKZ,CAAA3V,KAAL,CAAA;AAAmBuW,CAAA,CAAW/R,CAAX,CAAmBmR,CAAAzF,YAAA,CAAkB1L,CAAlB,CACtC,OAAO,KAF4B,CAlBvC,CA6BI8S,EAASA,QAAQ,EAAG,CACpB,MAAO,KAAA,CAAK3B,CAAA3V,KAAL,CADa,CAIO,KAA/B,GAAIqM,CAAA0B,SAAA,CAAW,KAAX,CAAiBqJ,CAAjB,CAAJ,GAYI9C,CAAA,CAAiB,KAAjB,CAAuB8C,CAAvB,CAZJ,CAYmCC,CAZnC,CAcgC,KAAhC,GAAIhL,CAAA0B,SAAA,CAAW,MAAX,CAAkB/N,CAAlB,CAAJ,GAYIsU,CAAA,CAAiB,MAAjB,CAAwBtU,CAAxB,CAZJ,CAYoCqX,CAZpC,CAc+B,KAA/B,GAAIhL,CAAA0B,SAAA,CAAW,KAAX,CAAiBqJ,CAAjB,CAAJ,GASI9C,CAAA,CAAiB,KAAjB,CAAuB8C,CAAvB,CATJ,CASmCE,CATnC,CAWgC,KAAhC,GAAIjL,CAAA0B,SAAA,CAAW,MAAX,CAAkB/N,CAAlB,CAAJ,GASIsU,CAAA,CAAiB,MAAjB,CAAwBtU,CAAxB,CATJ,CASoCsX,CATpC,CA1Ea,CAAjB,CAqFG3B,CArFH,CAP4B,CA+GpCrB,CAAA3B,OAAA,CAA0B4E,QAAQ,CAAC5F,CAAD,CAAS6F,CAAT,CAAmB,CAC3B,SAAtB,GAAI,MAAO7F,EAAX,GACI6F,CACA,CADW7F,CACX,CAAAA,CAAA,CAASvR,IAAAA,EAFb,CAGA,KAAIqX,EAAQ,CAAA,CACP9F,EAAL,GACIA,CACA,CADS,IAAIzS,CACb,CAAAuY,CAAA,CAAQ,CAAA,CAFZ,CAGA,KAAIC,EAAK/F,CAAAgG,aACT,IAAI,CAEA,MADAtL,EAAAsG,OAAA,CAAS,IAAT,CAAehB,CAAAe,GAAA,EAAf,CAA4B8E,CAA5B,CACO,CAAA9E,CAAC+E,CAAA,CAAQ9F,CAAAiB,KAAA,EAAR,CAAwBjB,CAAzBe,IAAA,CAAoCgF,CAApC,CAFP,CAGF,MAAOnW,CAAP,CAAU,CAER,KADAoQ,EAAAe,GAAA,CAAUgF,CAAV,CACMnW,CAAAA,CAAN,CAFQ,CAZqC,CA0BrDyM,EAAA2E,OAAA,CAAiBiF,QAAQ,CAAC5V,CAAD,CAAO2P,CAAP,CAAe6F,CAAf,CAAyB,CAC9C,MAAO7E,CAAA,IAAI3E,CAAJ,CAAYhM,CAAZ,CAAA2Q,QAAA,CAAyBhB,CAAzB,CAAiC6F,CAAjC,CADuC,CAYlDlD,EAAA9C,UAAA;AAA6BqG,QAAQ,EAAG,CACpC,MAAOxL,EAAAmF,UAAA,CAAY,IAAZ,CAD6B,CAexC8C,EAAAwD,gBAAA,CAAmCC,QAAQ,CAACpG,CAAD,CAAS6F,CAAT,CAAmB,CAC1D,IAAIC,EAAQ,CAAA,CACP9F,EAAL,GACIA,CACA,CADS,IAAIzS,CACb,CAAAuY,CAAA,CAAQ,CAAA,CAFZ,CAGA,KAAIO,EAAMtF,CAAA,IAAIxT,CAAJwT,IAAA,EACVrG,EAAAsG,OAAA,CAAS,IAAT,CAAeqF,CAAf,CAAoBR,CAApB,CAAA5E,KAAA,EACAjB,EAAAE,cAAA,CAAqBmG,CAAAzG,UAAA,EAArB,CACAI,EAAAa,OAAA,CAAcwF,CAAd,CACA,OAAOP,EAAA,CAAQ9F,CAAAiB,KAAA,EAAR,CAAwBjB,CAT2B,CAqB9D2C,EAAA2D,SAAA,CAA4BC,QAAQ,EAAG,CACnC,GAAI,CACA,MAAO,KAAAvF,OAAA,EAAAwF,cAAA,EADP,CAEF,MAAO5W,CAAP,CAAU,CAER,KADIA,EAAA,QACEA,GADYA,CAAA,QACZA,CAD2BA,CAAA,QAAA4W,cAAA,EAC3B5W,EAAAA,CAAN,CAFQ,CAHuB,CAkBvC+S,EAAA6D,cAAA,CAAiC7D,CAAA2D,SAWjC3D,EAAA8D,SAAA,CAA4BC,QAAQ,EAAG,CACnC,GAAI,CACA,MAAO,KAAA1F,OAAA,EAAAoC,SAAA,EADP,CAEF,MAAOxT,CAAP,CAAU,CAER,KADIA,EAAA,QACEA,GADYA,CAAA,QACZA,CAD2BA,CAAA,QAAAwT,SAAA,EAC3BxT,EAAAA,CAAN,CAFQ,CAHuB,CAkBvC+S,EAAAS,SAAA,CAA4BT,CAAA8D,SAW5B9D;CAAAgE,SAAA,CAA4BC,QAAQ,EAAG,CACnC,GAAI,CACA,MAAO,KAAA5F,OAAA,EAAAmC,SAAA,EADP,CAEF,MAAOvT,CAAP,CAAU,CAER,KADIA,EAAA,QACEA,GADYA,CAAA,QACZA,CAD2BA,CAAA,QAAAuT,SAAA,EAC3BvT,EAAAA,CAAN,CAFQ,CAHuB,CAkBvC+S,EAAAQ,SAAA,CAA4BR,CAAAgE,SAW5BhE,EAAAkE,UAAA,CAA6BC,QAAQ,EAAG,CACpC,GAAI,CACA,MAAO,KAAA9F,OAAA,EAAA+F,MAAA,EADP,CAEF,MAAOnX,CAAP,CAAU,CAER,KADIA,EAAA,QACEA,GADYA,CAAA,QACZA,CAD2BA,CAAA,QAAAmX,MAAA,EAC3BnX,EAAAA,CAAN,CAFQ,CAHwB,CAkBxC+S,EAAAoE,MAAA,CAAyBpE,CAAAkE,UAiEzBlE,EAAAqE,MAAA,CAAyBC,QAAQ,CAAClE,CAAD,CAAiBC,CAAjB,CAAiC,CAC9D,MAAOF,EAAA,CAAS,IAAT,CAAe,CAAEC,CAAAA,CAAjB,CAAiC,CAAEC,CAAAA,CAAnC,CAAmD,IAAAe,MAAnD,CADuD,CASlEpB,EAAAuE,WAAA,CAA8BC,QAAQ,EAAG,CACrC,MAAOC,KAAAC,UAAA,CACHvE,CAAA,CAAS,IAAT,CAC4B,CAAA,CAD5B,CAE4B,CAAA,CAF5B,CAGK,IAAAiB,MAHL,CADG,CAD8B,CAwBzC1H,EAAA6E,OAAA,CAAiBoG,QAAQ,CAACtH,CAAD,CAASrQ,CAAT,CAAiB0W,CAAjB,CAAsB,CACrB,QAAtB,GAAI,MAAO1W,EAAX,GACI0W,CACA,CADM1W,CACN,CAAAA,CAAA,CAAU,EAFd,CAGsB,SAAtB,GAAI,MAAOqQ,EAAX,CACIA,CADJ,CACazS,CAAAsR,KAAA,CAAgBmB,CAAhB,CAAwBqG,CAAA;AAAMA,CAAN,CAAY,QAApC,CADb,CAEU9Y,CAAAqR,aAAA,CAAwBoB,CAAxB,CAFV,GAGIA,CAHJ,CAGazS,CAAAsR,KAAA,CAAgBmB,CAAhB,CAHb,CAII+F,EAAAA,CAAK/F,CAAAgG,aACT,IAAI,CACA,IAAI7N,EAAMuC,CAAAwG,OAAA,CAASlB,CAAAe,GAAA,EAAT,CAAsBpR,CAAtB,CACVqQ,EAAAe,GAAA,CAAUgF,CAAV,CACA,OAAO5N,EAHP,CAIF,MAAOvI,CAAP,CAAU,CAER,KADAoQ,EAAAe,GAAA,CAAUgF,CAAV,CACMnW,CAAAA,CAAN,CAFQ,CAb+B,CA8B/CyM,EAAAkL,gBAAA,CAA0BC,QAAQ,CAACxH,CAAD,CAASqG,CAAT,CAAc,CACtB,QAAtB,GAAI,MAAOrG,EAAX,CACIA,CADJ,CACazS,CAAAsR,KAAA,CAAgBmB,CAAhB,CAAwBqG,CAAA,CAAMA,CAAN,CAAY,QAApC,CADb,CAEU9Y,CAAAqR,aAAA,CAAwBoB,CAAxB,CAFV,GAGIA,CAHJ,CAGazS,CAAAsR,KAAA,CAAgBmB,CAAhB,CAHb,CAIA,IAAyB,CAAzB,CAAIA,CAAAJ,UAAA,EAAJ,CACI,MAAO,KANiC,KAOxC6H,EAAMzH,CAAAvF,OAPkC,CAQxC2C,EAAM4C,CAAAzF,aAAA,EACV,IAAIyF,CAAAJ,UAAA,EAAJ,CAAyBxC,CAAzB,CAEI,MADA4C,EAAAvF,OACO,CADSgN,CACT,CAAA,IAEX,IAAI,CACA,IAAItP,EAAMuC,CAAAwG,OAAA,CAASlB,CAAAlE,MAAA,CAAakE,CAAAvF,OAAb,CAA4BuF,CAAAvF,OAA5B,CAA4C2C,CAA5C,CAAA2D,GAAA,EAAT,CACVf,EAAAvF,OAAA,EAAiB2C,CACjB,OAAOjF,EAHP,CAIF,MAAO/H,CAAP,CAAY,CAEV,KADA4P,EAAAvF,OACMrK,EADWgN,CACXhN,CAAAA,CAAN,CAFU,CAjB8B,CAiChDiM,EAAAqL,SAAA,CAAmBC,QAAQ,CAACzW,CAAD,CAAM,CAC7B,MAAOmL,EAAA6E,OAAA,CAAehQ,CAAf;AAAoB,QAApB,CADsB,CAcjCmL,EAAAuL,UAAA,CAAoBC,QAAQ,CAAC3W,CAAD,CAAM,CAC9B,MAAOmL,EAAA6E,OAAA,CAAehQ,CAAf,CAAoB,KAApB,CADuB,CAclCmL,EAAAyL,WAAA,CAAqBC,QAAQ,CAAC7W,CAAD,CAAM,CAC/B,MAAO,KAAImL,CAAJ,CAAY+K,IAAAhR,MAAA,CAAWlF,CAAX,CAAZ,CADwB,CAanCyR,EAAA7M,SAAA,CAA4BkS,QAAQ,EAAG,CACnC,MAAOtN,EAAA5E,SAAA,EAD4B,CAsCnC4F,OAAA8B,eAAJ,GACI9B,MAAA8B,eAAA,CAAsBnB,CAAtB,CAA+B,UAA/B,CAA2C,CAAE,MAAS3B,CAAA+C,SAAA,EAAX,CAA3C,CAGA,CAFA/B,MAAA8B,eAAA,CAAsBmF,CAAtB,CAAwC,UAAxC,CAAoD,CAAE,MAAStG,CAAA,SAAX,CAApD,CAEA,CADAX,MAAA8B,eAAA,CAAsBnB,CAAtB,CAA+B,OAA/B,CAAwC,CAAE,MAAS3B,CAAX,CAAxC,CACA,CAAAgB,MAAA8B,eAAA,CAAsBmF,CAAtB,CAAwC,OAAxC,CAAiD,CAAE,MAASjI,CAAX,CAAjD,CAJJ,CAMA,OAAO2B,EAhtBwB,CAAvB,CAktBT5O,CAltBS,CAktBC,IAltBD,CAqtBZ,KAAAiV,QAAA,CAAe,EACf,KAAAD,YAAA,CAAmB,EACnB,KAAAD,cAAA,CAAqB,EACrB,KAAA0C,cAAA,CAAqB,EACrB,KA9tBuC,IA8tB9BxV,EAAE,CA9tB4B,CA8tBzBqM,EAAE,IAAAP,SAAA7L,OA9tBuB;AA8tBDuM,CAAtC,CAA6CxM,CAA7C,CAA+CqM,CAA/C,CAAkDrM,CAAA,EAAlD,CAEI,GADAwM,CACI,CADI,IAAAV,SAAA,CAAc9L,CAAd,CACJ,CAAAwM,CAAA,WAAiB6C,EAAjB,EAAyB7C,CAAzB,WAA0CG,EAA1C,EAAqDH,CAArD,WAAsE+L,EAA1E,CAAmF,CAC/E,GAAIhJ,CAAA1G,eAAA,CAAqB2D,CAAA7N,KAArB,CAAJ,CACI,KAAMwB,MAAA,CAAM,2BAAN,CAAkC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAlC,CAAsD,IAAtD,CAA2DoG,CAAApG,SAAA,CAAe,CAAA,CAAf,CAA3D,CAAgF,oCAAhF,CAAqHoG,CAAA7N,KAArH,CAAgI,GAAhI,CAAN,CACJ4Q,CAAA,CAAM/C,CAAA7N,KAAN,CAAA,CAAoB6N,CAAAf,MAAA,EAH2D,CAAnF,IAIO,IAAIe,CAAJ,WAAqBG,EAAAC,MAArB,CACHJ,CAAAf,MAAA,EAGA,CAFA,IAAAuH,QAAA5O,KAAA,CAAkBoI,CAAlB,CAEA,CADA,IAAAuG,YAAA,CAAiBvG,CAAAnJ,GAAjB,CACA,CAD6BmJ,CAC7B,CAAA,IAAAsG,cAAA,CAAmBtG,CAAA7N,KAAnB,CAAA,CAAiC6N,CAJ9B,KAKF,IAAIA,CAAJ,WAAqBG,EAAA6H,MAArB,CACD,IAAAgB,cAAA,CAAmBhJ,CAAA7N,KAAnB,CAAA,CAAiC6N,CADhC,KAGA,IAAI,EAAEA,CAAF,WAAmBG,EAAA6H,MAAnB,EAAuChI,CAAvC,WAAwDgM,EAAxD,CAAJ,CACD,KAAMrY,MAAA,CAAM,2BAAN;AAAkC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAlC,CAAsD,IAAtD,CAA2D,IAAA0F,SAAA,CAAc9L,CAAd,CAAAoG,SAAA,CAA0B,CAAA,CAA1B,CAA3D,CAAN,CAGR,MAAO,KAAAmJ,MAAP,CAAoBA,CAhvBmB,CA4vB3C0D,EAAA3B,OAAA,CAA0B4E,QAAQ,CAAC9O,CAAD,CAAUkJ,CAAV,CAAkB6F,CAAlB,CAA4B,CAG1D,IAH0D,IACtDsC,EAAe,IADuC,CAEtDnE,CAFsD,CAGjDtU,EAAE,CAH+C,CAG5CqM,EAAE,IAAA2G,QAAA/S,OAH0C,CAGrB2D,CAArC,CAA0C5D,CAA1C,CAA4CqM,CAA5C,CAA+C,EAAErM,CAAjD,CACIsU,CAEA,CAFQ,IAAAtB,QAAA,CAAahT,CAAb,CAER,CADA4D,CACA,CADMwD,CAAA,CAAQkN,CAAA3V,KAAR,CACN,CAAI2V,CAAAM,SAAJ,EAA8B,IAA9B,GAAsBhR,CAAtB,CACyB,IADzB,GACQ6U,CADR,GAEQA,CAFR,CAEuBnE,CAFvB,EAIIA,CAAAhD,OAAA,CAAa6E,CAAA,CAAWvS,CAAX,CAAiB0Q,CAAAzF,YAAA,CAAkBjL,CAAlB,CAA9B,CAAsD0M,CAAtD,CAA8DlJ,CAA9D,CAER,IAAqB,IAArB,GAAIqR,CAAJ,CAGI,KAFI/X,EAEEA,CAFIP,KAAA,CAAM,0CAAN,CAAiD,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAjD,CAAqE,IAArE,CAA0EqS,CAA1E,CAEJ/X,CADNA,CAAA,QACMA,CADW4P,CACX5P,CAAAA,CAAN,CAEJ,MAAO4P,EAjBmD,CA2B9D2C,EAAA9C,UAAA,CAA6BqG,QAAQ,CAACpP,CAAD,CAAU,CAC3C,IAD2C,IAClCwI,EAAE,CADgC,CAC7B5P,EAAE,CAD2B,CACxBqM,EAAE,IAAA2G,QAAA/S,OADsB,CACDqU,CADC,CACM1Q,CAAjD,CAAsD5D,CAAtD,CAAwDqM,CAAxD,CAA2D,EAAErM,CAA7D,CAAgE,CAC5DsU,CAAA,CAAQ,IAAAtB,QAAA,CAAahT,CAAb,CACR4D,EAAA,CAAMwD,CAAA,CAAQkN,CAAA3V,KAAR,CACN,IAAI2V,CAAAM,SAAJ,EAA8B,IAA9B;AAAsBhR,CAAtB,CACG,KAAMzD,MAAA,CAAM,0CAAN,CAAiD,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAjD,CAAqE,IAArE,CAA0EkO,CAA1E,CAAN,CAEC1E,CAAA,EAAK0E,CAAAnE,UAAA,CAAgBvM,CAAhB,CAAqBwD,CAArB,CANmD,CAQhE,MAAOwI,EAToC,CA8D/CqD,EAAAzB,OAAA,CAA0BkH,QAAQ,CAACpI,CAAD,CAASrQ,CAAT,CAAiB0Y,CAAjB,CAAqC,CAC7C,QAAtB,GAAI,MAAO1Y,EAAX,GACIA,CADJ,CACc,EADd,CAKA,KANmE,IAG/D2Y,EAAQtI,CAAAvF,OAHuD,CAI/DtC,EAAM,IAAK,IAAA8G,MAJoD,CAK/D3E,CAL+D,CAK1DhM,CAL0D,CAKhDyE,CACnB,CAAOiN,CAAAvF,OAAP,CAAuB6N,CAAvB,CAA6B3Y,CAA7B,EAAoD,EAApD,GAAwCA,CAAxC,EAA8E,CAA9E,CAAyDqQ,CAAAJ,UAAA,EAAzD,CAAA,CAAkF,CAC9EtF,CAAA,CAAM0F,CAAAzF,aAAA,EACNjM,EAAA,CAAWgM,CAAX,CAAiB,CACjBvH,EAAA,CAAKuH,CAAL,GAAa,CACb,IAAIhM,CAAJ,GAAiBb,CAAAG,WAAAK,SAAjB,CAA+C,CAC3C,GAAI8E,CAAJ,GAAWsV,CAAX,CACI,KAAMxY,MAAA,CAAM,kCAAN,CAAyC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAzC,CAA6D,IAA7D,CAAkE/C,CAAlE,CAAqE,IAArE,EAA2EsV,CAAA,CAAqBA,CAArB,CAAwC,WAAxC,CAAsD,aAAjI,EAAgJ,GAAhJ,CAAN,CACJ,KAH2C,CAK/C,GAAMrE,CAAN,CAAc,IAAAvB,YAAA,CAAiB1P,CAAjB,CAAd,CAwBIiR,CAAAI,SAAJ,EAAuB,CAAAJ,CAAArQ,QAAA,OAAvB,CACIwE,CAAA,CAAI6L,CAAA3V,KAAJ,CAAAyF,KAAA,CAAqBkQ,CAAA9C,OAAA,CAAa5S,CAAb;AAAuB0R,CAAvB,CAArB,CADJ,CAEWgE,CAAAK,IAAJ,EACCkE,CACJ,CADavE,CAAA9C,OAAA,CAAa5S,CAAb,CAAuB0R,CAAvB,CACb,CAAA7H,CAAA,CAAI6L,CAAA3V,KAAJ,CAAAyW,IAAA,CAAoByD,CAAA,CAAO,CAAP,CAApB,CAA+BA,CAAA,CAAO,CAAP,CAA/B,CAFG,GAIHpQ,CAAA,CAAI6L,CAAA3V,KAAJ,CACA,CADkB2V,CAAA9C,OAAA,CAAa5S,CAAb,CAAuB0R,CAAvB,CAClB,CAAIgE,CAAAmB,MAAJ,GACQC,CAGJ,CAHmBjN,CAAA,CAAI6L,CAAAmB,MAAA9W,KAAJ,CAGnB,CAFqB,IAErB,GAFI+W,CAEJ,EAF6BA,CAE7B,GAF8CpB,CAAA3V,KAE9C,GADI8J,CAAA,CAAIiN,CAAJ,CACJ,CADwB,IACxB,EAAAjN,CAAA,CAAI6L,CAAAmB,MAAA9W,KAAJ,CAAA,CAAwB2V,CAAA3V,KAJ5B,CALG,CA1BP,KAEI,QAAQC,CAAR,EACI,KAAKb,CAAAG,WAAAC,OAAL,CACImS,CAAAzF,aAAA,EACA,MACJ,MAAK9M,CAAAG,WAAAM,OAAL,CACI8R,CAAAvF,OAAA,EAAiB,CACjB,MACJ,MAAKhN,CAAAG,WAAAE,OAAL,CACIkS,CAAAvF,OAAA,EAAiB,CACjB,MACJ,MAAKhN,CAAAG,WAAAG,OAAL,CACQqP,CAAAA,CAAM4C,CAAAzF,aAAA,EACVyF,EAAAvF,OAAA,EAAiB2C,CACjB,MACJ,MAAK3P,CAAAG,WAAAI,WAAL,CACI,IAAA,CAAOmM,CAAA,CAAiBpH,CAAjB,CAAqBiN,CAArB,CAAP,CAAA,EACA,KACJ,SACI,KAAMnQ,MAAA,CAAM,sCAAN,CAA6CkD,CAA7C,CAAgD,MAAhD,CAAuD,IAAA+C,SAAA,CAAc,CAAA,CAAd,CAAvD;AAA2E,WAA3E,CAAuFxH,CAAvF,CAAN,CAlBR,CAX0E,CAkDzEoB,CAAAA,CAAE,CAAX,KAAcqM,CAAd,CAAgB,IAAA2G,QAAA/S,OAAhB,CAAqCD,CAArC,CAAuCqM,CAAvC,CAA0C,EAAErM,CAA5C,CAEI,GADAsU,CACI,CADI,IAAAtB,QAAA,CAAahT,CAAb,CACJ,CAAoB,IAApB,GAAAyI,CAAA,CAAI6L,CAAA3V,KAAJ,CAAJ,CACI,GAAoB,QAApB,GAAI,IAAAiN,OAAJ,CACInD,CAAA,CAAI6L,CAAA3V,KAAJ,CAAA,CAAkB2V,CAAAzV,aADtB,KAEO,CAAA,GAAIyV,CAAAM,SAAJ,CAGH,KAFIlU,EAEEA,CAFIP,KAAA,CAAM,0CAAN,CAAmD,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAnD,CAAyE,IAAzE,CAAgFkO,CAAA3V,KAAhF,CAEJ+B,CADNA,CAAA,QACMA,CADW+H,CACX/H,CAAAA,CAAN,CACO3C,CAAAuB,iBAAJ,EAAwD,IAAxD,GAAiCgV,CAAAzV,aAAjC,GACH4J,CAAA,CAAI6L,CAAA3V,KAAJ,CADG,CACe2V,CAAAzV,aADf,CAJA,CAQf,MAAO4J,EArE4D,CA4EvEyB,EAAAyC,QAAA,CAAkBA,CAkBlB,KAAIC,EAAQA,QAAQ,CAAC3B,CAAD,CAAU7D,CAAV,CAAmB+B,CAAnB,CAAyB2P,CAAzB,CAAkC1P,CAAlC,CAAwCzK,CAAxC,CAA8C0E,CAA9C,CAAkDY,CAAlD,CAA2DwR,CAA3D,CAAkE7J,CAAlE,CAA0E,CAC1FZ,CAAAa,KAAA,CAAO,IAAP,CAAaZ,CAAb,CAAsB7D,CAAtB,CAA+BzI,CAA/B,CAKA,KAAA6M,UAAA,CAAiB,eAOjB,KAAAoJ,SAAA,CAAyB,UAAzB,GAAgBzL,CAOhB,KAAAuL,SAAA,CAAyB,UAAzB,GAAgBvL,CAOhB;IAAAwL,IAAA,CAAoB,KAApB,GAAWxL,CAQX,KAAA4P,QAAA,CAAeD,CAAf,EAA0B,IAQ1B,KAAA1P,KAAA,CAAYA,CAOZ,KAAAkF,aAAA,CAAoB,IAOpB,KAAAjL,GAAA,CAAUA,CAQV,KAAAY,QAAA,CAAeA,CAAf,EAA0B,EAO1B,KAAApF,aAAA,CAAoB,IAOpB,KAAA4W,MAAA,CAAaA,CAAb,EAAsB,IAOtB,KAAA7J,OAAA,CAAcA,CAAd,EAAwB,QAOxB,KAAAiB,aAAA,CAAoB,IAAAlO,KAepB,KAAAqa,WAAA,CARA,IAAAC,QAQA,CARe,IAWX,EAAA,IAAAhO,QAAAhH,QAAA,yBAAJ,EAA0D,IAA1D,WAA0E0I,EAAAmJ,eAA1E,GACI,IAAAnX,KADJ,CACgBZ,CAAAwB,KAAA+B,YAAA,CAA0B,IAAA3C,KAA1B,CADhB,CA/G0F,CAA9F,CAuHIua,EAAiBtM,CAAA/H,UAAjBqU,CAAmClN,MAAAC,OAAA,CAAcjB,CAAAnG,UAAd,CAOvCqU,EAAAzN,MAAA,CAAuB0N,QAAQ,EAAG,CAC9B,IAAAF,QAAA,CAAe,IAAI5K,CAAJ,CAAY,IAAAjF,KAAZ,CAAuB,IAAAkF,aAAvB,CAA0C,CAAA,CAA1C,CAAiD,IAAA1C,OAAjD,CAA8D,IAAAjN,KAA9D,CACX,KAAAgW,IAAJ,GACI,IAAAqE,WADJ;AACsB,IAAI3K,CAAJ,CAAY,IAAA0K,QAAZ,CAA0Bha,IAAAA,EAA1B,CAAqC,CAAA,CAArC,CAA2C,IAAA6M,OAA3C,CAAwD,IAAAjN,KAAxD,CADtB,CAKoB,SAApB,GAAI,IAAAiN,OAAJ,EAAiC,IAAA8I,SAAjC,EAAmD,IAAAC,IAAnD,CAI4C,WAJ5C,GAIS,MAAO,KAAA1Q,QAAA,CAAa,SAAb,CAJhB,GAKI,IAAApF,aALJ,CAKwB,IAAAgQ,YAAA,CAAiB,IAAA5K,QAAA,CAAa,SAAb,CAAjB,CALxB,EACI,IAAApF,aADJ,CACwBwP,CAAAK,kBAAA,CAA0B,IAAAtF,KAA1B,CARM,CAuBlC8P,EAAArK,YAAA,CAA6BuK,QAAQ,CAACjW,CAAD,CAAQkW,CAAR,CAAsB,CAGvDtK,QAASA,EAAI,CAACnL,CAAD,CAAM6E,CAAN,CAAW,CACpB,KAAMtI,MAAA,CAAM,oBAAN,CAA2B6O,CAAA5I,SAAA,CAAc,CAAA,CAAd,CAA3B,CAA+C,WAA/C,CAA2D4I,CAAA5F,KAAAzK,KAA3D,CAA0E,IAA1E,CAA+EiF,CAA/E,CAAmF,IAAnF,CAAwF6E,CAAxF,CAA4F,GAA5F,CAAN,CADoB,CAFxB4Q,CAAA,CAAeA,CAAf,EAA+B,CAAA,CAC/B,KAAIrK,EAAO,IAIX,IAAc,IAAd,GAAI7L,CAAJ,CAKI,MAJI,KAAAyR,SAIG,EAHH7F,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,UAAnB,CAGG,CAFa,QAEb,GAFH,IAAAyI,OAEG,EAFyB,IAAAxC,KAEzB;AAFuCrL,CAAAW,MAAA,QAEvC,EADHqQ,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,oDAAnB,CACG,CAAA,IAEX,KAAInD,CACJ,IAAI,IAAA0U,SAAJ,EAAsB2E,CAAAA,CAAtB,CAAoC,CAC3BnV,KAAAC,QAAA,CAAchB,CAAd,CAAL,GACIA,CADJ,CACY,CAACA,CAAD,CADZ,CAEA,KAAImW,EAAM,EACV,KAAKtZ,CAAL,CAAO,CAAP,CAAUA,CAAV,CAAYmD,CAAAlD,OAAZ,CAA0BD,CAAA,EAA1B,CACIsZ,CAAAlV,KAAA,CAAS,IAAA6U,QAAApK,YAAA,CAAyB1L,CAAA,CAAMnD,CAAN,CAAzB,CAAT,CACJ,OAAOsZ,EANyB,CAQpC,GAAI,IAAA3E,IAAJ,EAAiB0E,CAAAA,CAAjB,CAA+B,CAC3B,GAAMlW,CAAN,WAAuBpF,EAAAgW,IAAvB,CAQI,MAAO5Q,EANDA,EAAN,WAAuB6I,OAAvB,EACI+C,CAAA,CAAK,MAAO5L,EAAZ,CACK,mDADL,CAGJ,OAAO,KAAIpF,CAAAgW,IAAJ,CAAiB,IAAjB,CAAuB5Q,CAAvB,CAPgB,CAa1BuR,CAAA,IAAAA,SAAL,EAAsBxQ,KAAAC,QAAA,CAAchB,CAAd,CAAtB,EACI4L,CAAA,CAAK,MAAO5L,EAAZ,CAAmB,mBAAnB,CAEJ,OAAO,KAAA8V,QAAApK,YAAA,CAAyB1L,CAAzB,CAtCgD,CAgD3D+V,EAAAK,gBAAA,CAAiCC,QAAQ,CAACrW,CAAD;AAAQiE,CAAR,CAAiB,CACtD,GAAoB,QAApB,GAAI,IAAAwE,OAAJ,CACI,MAAkB,KAAlB,GAAQzI,CACZ,IAAI,IAAAsS,MAAJ,EAAkBrO,CAAA,CAAQ,IAAAqO,MAAA9W,KAAR,CAAlB,GAA+C,IAAAA,KAA/C,CACI,MAAO,CAAA,CACX,QAAQ,IAAAyK,KAAR,EACI,KAAKrL,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CACI,MAAiB,EAAjB,GAAOyE,CAEX,MAAKpF,CAAAW,MAAA,MAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,SAAL,CACA,KAAKX,CAAAW,MAAA,OAAL,CACA,KAAKX,CAAAW,MAAA,QAAL,CACI,MAAqB,EAArB,GAAOyE,CAAAkH,IAAP,EAAyC,CAAzC,GAA0BlH,CAAAmH,KAE9B,MAAKvM,CAAAW,MAAA,KAAL,CACI,MAAOyE,EAEX,MAAKpF,CAAAW,MAAA,CAAe,OAAf,CAAL,CACA,KAAKX,CAAAW,MAAA,CAAe,QAAf,CAAL,CACI,MAAiB,EAAjB,GAAOyE,CAEX,MAAKpF,CAAAW,MAAA,OAAL,CACI,MAAsB,EAAtB,CAAOyE,CAAAlD,OAEX,MAAKlC,CAAAW,MAAA,MAAL,CACI,MAA2B,EAA3B;AAAOyE,CAAA+M,UAAA,EAEX,MAAKnS,CAAAW,MAAA,CAAe,MAAf,CAAL,CACI,MAAiB,EAAjB,GAAOyE,CAEX,MAAKpF,CAAAW,MAAA,QAAL,CACI,MAAiB,KAAjB,GAAOyE,CACX,SACI,MAAO,CAAA,CAlCf,CALsD,CAoD1D+V,EAAA5H,OAAA,CAAwBmI,QAAQ,CAACtW,CAAD,CAAQmN,CAAR,CAAgBlJ,CAAhB,CAAyB,CACrD,GAAkB,IAAlB,GAAI,IAAAgC,KAAJ,EAA+C,QAA/C,GAA0B,MAAO,KAAAA,KAAjC,CACI,KAAMjJ,MAAA,CAAM,gCAAN,CAAuC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAvC,CAA2D,IAA3D,CAAgE,IAAAgD,KAAhE,CAAN,CACJ,GAAc,IAAd,GAAIjG,CAAJ,EAAuB,IAAAuR,SAAvB,EAAwD,CAAxD,EAAwCvR,CAAAlD,OAAxC,CACI,MAAOqQ,EACX,IAAI,CACA,GAAI,IAAAoE,SAAJ,CAAmB,CACf,IAAI1U,CAGJ,IAAI,IAAAiE,QAAA,OAAJ,EAA0F,CAA1F,EAA8BlG,CAAAU,oBAAA+P,QAAA,CAAqC,IAAApF,KAAAxK,SAArC,CAA9B,CAA6F,CAIzF0R,CAAAE,cAAA,CAAsB,IAAAnN,GAAtB,EAAiC,CAAjC,CAAsCtF,CAAAG,WAAAG,OAAtC,CACAiS,EAAAoJ,eAAA,CAAsBpJ,CAAAvF,OAAtB,EAAuC,CAAvC,CACA,KAAI6N,EAAQtI,CAAAvF,OACZ;IAAK/K,CAAL,CAAO,CAAP,CAAUA,CAAV,CAAYmD,CAAAlD,OAAZ,CAA0BD,CAAA,EAA1B,CACI,IAAAiZ,QAAA7I,YAAA,CAAyB,IAAA/M,GAAzB,CAAkCF,CAAA,CAAMnD,CAAN,CAAlC,CAA4CsQ,CAA5C,CARqF,KASrF5C,EAAM4C,CAAAvF,OAAN2C,CAAoBkL,CATiE,CAUrFe,EAAY9b,CAAAiS,kBAAA,CAA6BpC,CAA7B,CAChB,IAAgB,CAAhB,CAAIiM,CAAJ,CAAmB,CACf,IAAIC,EAAWtJ,CAAAlE,MAAA,CAAawM,CAAb,CAAoBtI,CAAAvF,OAApB,CAAf,CACA6N,EAAAA,CAAAA,EAASe,CAATf,CAAmB,CAAnBA,CACAtI,EAAAvF,OAAA,CAAgB6N,CAChBtI,EAAAa,OAAA,CAAcyI,CAAd,CAJe,CAMnBtJ,CAAAE,cAAA,CAAqB9C,CAArB,CAA0BkL,CAA1B,CAAgCe,CAAhC,CAjByF,CAA7F,IAqBI,KAAK3Z,CAAL,CAAO,CAAP,CAAUA,CAAV,CAAYmD,CAAAlD,OAAZ,CAA0BD,CAAA,EAA1B,CACIsQ,CAAAE,cAAA,CAAsB,IAAAnN,GAAtB,EAAiC,CAAjC,CAAsC,IAAA+F,KAAAxK,SAAtC,CACA,CAAA,IAAAqa,QAAA7I,YAAA,CAAyB,IAAA/M,GAAzB,CAAkCF,CAAA,CAAMnD,CAAN,CAAlC,CAA4CsQ,CAA5C,CA3BO,CAAnB,IA6BW,KAAAqE,IAAJ,CAEHxR,CAAA0Q,QAAA,CAAc,QAAQ,CAACjQ,CAAD,CAAMoJ,CAAN,CAAW6M,CAAX,CAAc,CAE5B5Z,CAAAA,CACApC,CAAAiS,kBAAA,CAA8B,CAA9B,CAAwC,IAAAiJ,QAAAna,SAAxC,CADAqB,CAEA,IAAA+Y,WAAAtJ,gBAAA,CAAgC,CAAhC,CAAmC1C,CAAnC,CAFA/M,CAGApC,CAAAiS,kBAAA,CAA8B,EAA9B,CAAwC,IAAA1G,KAAAxK,SAAxC,CAHAqB,CAIA,IAAAgZ,QAAAvJ,gBAAA,CAA6B,CAA7B;AAAgC9L,CAAhC,CAGJ0M,EAAAE,cAAA,CAAsB,IAAAnN,GAAtB,EAAiC,CAAjC,CAAsCtF,CAAAG,WAAAG,OAAtC,CACAiS,EAAAE,cAAA,CAAqBvQ,CAArB,CAGAqQ,EAAAE,cAAA,CAAsB,CAAtB,CAAgC,IAAAuI,QAAAna,SAAhC,CACA,KAAAoa,WAAA5I,YAAA,CAA4B,CAA5B,CAA+BpD,CAA/B,CAAoCsD,CAApC,CACAA,EAAAE,cAAA,CAAsB,EAAtB,CAAgC,IAAApH,KAAAxK,SAAhC,CACA,KAAAqa,QAAA7I,YAAA,CAAyB,CAAzB,CAA4BxM,CAA5B,CAAiC0M,CAAjC,CAhBgC,CAApC,CAiBG,IAjBH,CAFG,CAqBC,IAAAiJ,gBAAA,CAAqBpW,CAArB,CAA4BiE,CAA5B,CArBD,GAsBCkJ,CAAAE,cAAA,CAAsB,IAAAnN,GAAtB,EAAiC,CAAjC,CAAsC,IAAA+F,KAAAxK,SAAtC,CACA,CAAA,IAAAqa,QAAA7I,YAAA,CAAyB,IAAA/M,GAAzB,CAAkCF,CAAlC,CAAyCmN,CAAzC,CAvBD,CA9BP,CAwDF,MAAOpQ,CAAP,CAAU,CACR,KAAMC,MAAA,CAAM,oBAAN,CAA2B,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAA3B,CAA+C,IAA/C,CAAoDjD,CAApD,CAA0D,IAA1D,CAA+DjD,CAA/D,CAAiE,GAAjE,CAAN,CADQ,CAGZ,MAAOoQ,EAhE8C,CA0EzD4I,EAAA/I,UAAA,CAA2B2J,QAAQ,CAAC3W,CAAD,CAAQiE,CAAR,CAAiB,CAChDjE,CAAA,CAAQ,IAAA0L,YAAA,CAAiB1L,CAAjB,CACR,IAAkB,IAAlB,GAAI,IAAAiG,KAAJ,EAA+C,QAA/C;AAA0B,MAAO,KAAAA,KAAjC,CACI,KAAMjJ,MAAA,CAAM,gCAAN,CAAuC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAAvC,CAA2D,IAA3D,CAAgE,IAAAgD,KAAhE,CAAN,CACJ,GAAc,IAAd,GAAIjG,CAAJ,EAAuB,IAAAuR,SAAvB,EAAwD,CAAxD,EAAwCvR,CAAAlD,OAAxC,CACI,MAAO,EACX,KAAI2P,EAAI,CACR,IAAI,CACA,GAAI,IAAA8E,SAAJ,CAAmB,CAAA,IACX1U,CADW,CACR+Z,CACP,IAAI,IAAA9V,QAAA,OAAJ,EAA0F,CAA1F,EAA8BlG,CAAAU,oBAAA+P,QAAA,CAAqC,IAAApF,KAAAxK,SAArC,CAA9B,CAA6F,CACzFgR,CAAA,EAAK/R,CAAAiS,kBAAA,CAA8B,IAAAzM,GAA9B,EAAyC,CAAzC,CAA8CtF,CAAAG,WAAAG,OAA9C,CAEL,KAAK2B,CAAL,CADA+Z,CACA,CADK,CACL,CAAU/Z,CAAV,CAAYmD,CAAAlD,OAAZ,CAA0BD,CAAA,EAA1B,CACI+Z,CAAA,EAAM,IAAAd,QAAAvJ,gBAAA,CAA6B,IAAArM,GAA7B,CAAsCF,CAAA,CAAMnD,CAAN,CAAtC,CACV4P,EAAA,EAAK/R,CAAAiS,kBAAA,CAA6BiK,CAA7B,CACLnK,EAAA,EAAKmK,CANoF,CAA7F,IAQI,KAAK/Z,CAAL,CAAO,CAAP,CAAUA,CAAV,CAAYmD,CAAAlD,OAAZ,CAA0BD,CAAA,EAA1B,CACI4P,CACA,EADK/R,CAAAiS,kBAAA,CAA8B,IAAAzM,GAA9B,EAAyC,CAAzC,CAA8C,IAAA+F,KAAAxK,SAA9C,CACL,CAAAgR,CAAA;AAAK,IAAAqJ,QAAAvJ,gBAAA,CAA6B,IAAArM,GAA7B,CAAsCF,CAAA,CAAMnD,CAAN,CAAtC,CAZE,CAAnB,IAcW,KAAA2U,IAAJ,CAEHxR,CAAA0Q,QAAA,CAAc,QAAQ,CAACjQ,CAAD,CAAMoJ,CAAN,CAAW6M,CAAX,CAAc,CAE5B5Z,CAAAA,CACApC,CAAAiS,kBAAA,CAA8B,CAA9B,CAAwC,IAAAiJ,QAAAna,SAAxC,CADAqB,CAEA,IAAA+Y,WAAAtJ,gBAAA,CAAgC,CAAhC,CAAmC1C,CAAnC,CAFA/M,CAGApC,CAAAiS,kBAAA,CAA8B,EAA9B,CAAwC,IAAA1G,KAAAxK,SAAxC,CAHAqB,CAIA,IAAAgZ,QAAAvJ,gBAAA,CAA6B,CAA7B,CAAgC9L,CAAhC,CAEJgM,EAAA,EAAK/R,CAAAiS,kBAAA,CAA8B,IAAAzM,GAA9B,EAAyC,CAAzC,CAA8CtF,CAAAG,WAAAG,OAA9C,CACLuR,EAAA,EAAK/R,CAAAiS,kBAAA,CAA6B7P,CAA7B,CACL2P,EAAA,EAAK3P,CAV2B,CAApC,CAWG,IAXH,CAFG,CAeC,IAAAsZ,gBAAA,CAAqBpW,CAArB,CAA4BiE,CAA5B,CAfD,GAgBCwI,CACA,EADK/R,CAAAiS,kBAAA,CAA8B,IAAAzM,GAA9B,EAAyC,CAAzC,CAA8C,IAAA+F,KAAAxK,SAA9C,CACL,CAAAgR,CAAA,EAAK,IAAAqJ,QAAAvJ,gBAAA,CAA6B,IAAArM,GAA7B,CAAsCF,CAAtC,CAjBN,CAfP,CAmCF,MAAOjD,CAAP,CAAU,CACR,KAAMC,MAAA,CAAM,oBAAN;AAA2B,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAA3B,CAA+C,IAA/C,CAAoDjD,CAApD,CAA0D,IAA1D,CAA+DjD,CAA/D,CAAiE,GAAjE,CAAN,CADQ,CAGZ,MAAO0P,EA7CyC,CA0DpDsJ,EAAA1H,OAAA,CAAwBwI,QAAQ,CAACpb,CAAD,CAAW0R,CAAX,CAAmB+I,CAAnB,CAAiC,CAU7D,GAJIY,EAAEtF,CAAA,IAAAA,IAAFsF,EAAcrb,CAAdqb,EAA0B,IAAA7Q,KAAAxK,SAA1Bqb,EACEZ,CAAAA,CADFY,EACkB,IAAAvF,SADlBuF,EACmC,IAAAhW,QAAA,OADnCgW,EAECrb,CAFDqb,EAEalc,CAAAG,WAAAG,OAFb4b,EAGC,IAAAtF,IAHDsF,EAGarb,CAHbqb,EAGyBlc,CAAAG,WAAAG,OAHzB4b,CAIJ,CACI,KAAM9Z,MAAA,CAAM,8BAAN,CAAqC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAArC,CAAyD,IAAzD,CAA8DxH,CAA9D,CAAuE,IAAvE,CAA4E,IAAAwK,KAAAxK,SAA5E,CAA+F,YAA/F,CAAN,CAGJ,GAAIA,CAAJ,EAAgBb,CAAAG,WAAAG,OAAhB,EAA8C,IAAAqW,SAA9C,EAA+D,IAAAzQ,QAAA,OAA/D,EAAqJ,CAArJ,EAAyFlG,CAAAU,oBAAA+P,QAAA,CAAqC,IAAApF,KAAAxK,SAArC,CAAzF,EACSya,CAAAA,CADT,CACuB,CACfhH,CAAA,CAAS/B,CAAAzF,aAAA,EACTwH,EAAA,CAAS/B,CAAAvF,OAAT,CAAyBsH,CAEzB,KADIjD,CACJ,CADa,EACb,CAAOkB,CAAAvF,OAAP,CAAuBsH,CAAvB,CAAA,CACIjD,CAAAhL,KAAA,CAAY,IAAAoN,OAAA,CAAY,IAAApI,KAAAxK,SAAZ;AAAgC0R,CAAhC,CAAwC,CAAA,CAAxC,CAAZ,CACJ,OAAOlB,EANQ,CAYvB,GAAI,IAAAuF,IAAJ,CAAc,CAEV,IAAI3H,EAAMqB,CAAAK,kBAAA,CAA0B,IAAAqK,QAA1B,CACV5V,EAAA,CAAQkL,CAAAK,kBAAA,CAA0B,IAAAtF,KAA1B,CAGRiJ,EAAA,CAAS/B,CAAAzF,aAAA,EACT,IAAIyF,CAAAJ,UAAA,EAAJ,CAAyBmC,CAAzB,CACI,KAAMlS,MAAA,CAAM,8BAAN,CAAqC,IAAAiG,SAAA,CAAc,CAAA,CAAd,CAArC,CAAyD,IAAzD,CAA8DiM,CAA9D,CAAqE,yBAArE,CAA+F/B,CAAAJ,UAAA,EAA/F,CAAN,CAGJ,IAAIgK,EAAS5J,CAAAgC,MAAA,EACb4H,EAAA3H,MAAA,CAAe2H,CAAAnP,OAAf,CAA+BsH,CAG/B,KAFA/B,CAAAvF,OAEA,EAFiBsH,CAEjB,CAA4B,CAA5B,CAAO6H,CAAAhK,UAAA,EAAP,CAAA,CAII,GAHItF,CAGA,CAHMsP,CAAArP,aAAA,EAGN,CAFJjM,CAEI,CAFOgM,CAEP,CAFa,CAEb,CADKA,CACL,IADa,CACb,CAAO,CAAP,GAAAvH,CAAJ,CACI2J,CAAA,CAAM,IAAAgM,WAAAxH,OAAA,CAAuB0I,CAAvB,CAA+Btb,CAA/B,CAAyCyE,CAAzC,CADV,KAEO,IAAW,CAAX,GAAIA,CAAJ,CACHF,CAAA,CAAQ,IAAA8V,QAAAzH,OAAA,CAAoB0I,CAApB,CAA4Btb,CAA5B,CAAsCyE,CAAtC,CADL,KAGH,MAAMlD,MAAA,CAAM,kDAAN,CAAN;AAIR,MAAO,CAAC6M,CAAD,CAAM7J,CAAN,CA5BG,CAgCd,MAAO,KAAA8V,QAAAzH,OAAA,CAAoBlB,CAApB,CAA4B1R,CAA5B,CAAsC,IAAAyE,GAAtC,CA3DsD,CAkEjE6G,EAAAyC,QAAAC,MAAA,CAAwBA,CAepBkJ,EAAAA,CAAiBA,QAAQ,CAAC7K,CAAD,CAAU7D,CAAV,CAAmB+B,CAAnB,CAAyBC,CAAzB,CAA+BzK,CAA/B,CAAqC0E,CAArC,CAAyCY,CAAzC,CAAkD,CAC3E2I,CAAAf,KAAA,CAAW,IAAX,CAAiBZ,CAAjB,CAA0B7D,CAA1B,CAAmC+B,CAAnC,CAAyD,IAAzD,CAA+DC,CAA/D,CAAqEzK,CAArE,CAA2E0E,CAA3E,CAA+EY,CAA/E,CAD2E,CAY/E6R,EAAAjR,UAAA,CAA2BmH,MAAAC,OAAA,CAAcW,CAAA/H,UAAd,CAM3BqF,EAAAyC,QAAAmJ,eAAA,CAAiCA,CA0BjC5L,EAAAyC,QAAA6H,MAAA,CAfYA,QAAQ,CAACvJ,CAAD,CAAU7D,CAAV,CAAmBzI,CAAnB,CAAyB,CACzCqM,CAAAa,KAAA,CAAO,IAAP,CAAaZ,CAAb,CAAsB7D,CAAtB,CAA+BzI,CAA/B,CAOA,KAAA4K,OAAA,CAAc,EAR2B,CA4B7C,KAAI8F,EAAOA,QAAQ,CAACpE,CAAD,CAAUrD,CAAV,CAAkBjJ,CAAlB,CAAwBsF,CAAxB,CAAiC2H,CAAjC,CAAyC,CACxDD,CAAAE,KAAA,CAAe,IAAf,CAAqBZ,CAArB,CAA8BrD,CAA9B,CAAsCjJ,CAAtC,CAA4CsF,CAA5C,CAAqD2H,CAArD,CAKA,KAAAJ,UAAA,CAAiB,MAOjB,KAAAgI,OAAA,CAAc,IAb0C,CAuB5DnE,EAAAkE,QAAA,CAAe4G,QAAQ,CAACxQ,CAAD,CAAMxG,CAAN,CAAa,CAEhC,IADA,IAAI+K,EAAOlC,MAAAkC,KAAA,CAAYvE,CAAZ,CAAX,CACS3J,EAAE,CADX,CACcgN,CAAd,CAAmBhN,CAAnB,CAAqBkO,CAAAjO,OAArB,CAAkC,EAAED,CAApC,CACI,GAAI2J,CAAA,CAAIqD,CAAJ,CAAUkB,CAAA,CAAKlO,CAAL,CAAV,CAAJ,GAA2BmD,CAA3B,CACI,MAAO6J,EACf,OAAO,KALyB,CAoBpCvB,EARoB4D,CAAAxK,UAQpB4G,CARqCO,MAAAC,OAAA,CAAcN,CAAA9G,UAAd,CAQrC4G,OAAA;AAAsB2O,QAAQ,CAACjH,CAAD,CAAU,CACpC,GAAI,IAAAK,OAAJ,EAAoBL,CAAAA,CAApB,CACI,MAAO,KAAAK,OACP7J,EAAAA,CAAM,IAAI5L,CAAAyR,QAAAH,KAEd,KAFA,IACID,EAAS,IAAAlD,YAAA,CAAiBmD,CAAAC,MAAjB,CADb,CAEStP,EAAE,CAFX,CAEcqM,EAAE+C,CAAAnP,OAAhB,CAA+BD,CAA/B,CAAiCqM,CAAjC,CAAoC,EAAErM,CAAtC,CACI2J,CAAA,CAAIyF,CAAA,CAAOpP,CAAP,CAAA,KAAJ,CAAA,CAAyBoP,CAAA,CAAOpP,CAAP,CAAA,GACzBgM,OAAA8B,eAAJ,EACI9B,MAAA8B,eAAA,CAAsBnE,CAAtB,CAA2B,UAA3B,CAAuC,CACnC,MAAS,IAAAoE,SAAA,EAD0B,CAEnC,WAAc,CAAA,CAFqB,CAAvC,CAIJ,OAAO,KAAAyF,OAAP,CAAqB7J,CAZe,CAmBxCO,EAAAmF,KAAA,CAAeA,CAYXC,EAAAA,CAAQA,QAAQ,CAACrE,CAAD,CAAUtB,CAAV,CAAehL,CAAf,CAAqB0E,CAArB,CAAyB,CACzC2H,CAAAa,KAAA,CAAO,IAAP,CAAaZ,CAAb,CAAsBtB,CAAtB,CAA2BhL,CAA3B,CAKA,KAAA6M,UAAA,CAAiB,YAOjB,KAAAnI,GAAA,CAAUA,CAb+B,CAiB7CiM,EAAAzK,UAAA,CAAkBmH,MAAAC,OAAA,CAAcjB,CAAAnG,UAAd,CAMlBqF,EAAAmF,KAAAC,MAAA,CAAqBA,CAWrB,KAAIkJ,EAAYA,QAAQ,CAACvN,CAAD,CAAUrD,CAAV,CAAkBjJ,CAAlB,CAAwB2V,CAAxB,CAA+B,CACnDtJ,CAAAa,KAAA,CAAO,IAAP,CAAaZ,CAAb,CAAsBrD,CAAtB,CAA8BjJ,CAA9B,CAOA,KAAA2V,MAAA,CAAaA,CARsC,CAYvDkE,EAAA3T,UAAA,CAAsBmH,MAAAC,OAAA,CAAcjB,CAAAnG,UAAd,CAMtBqF;CAAAsO,UAAA,CAAoBA,CAYpB,KAAID,EAAUA,QAAQ,CAACtN,CAAD,CAAUoP,CAAV,CAAgB1b,CAAhB,CAAsBsF,CAAtB,CAA+B,CACjD0H,CAAAE,KAAA,CAAe,IAAf,CAAqBZ,CAArB,CAA8BoP,CAA9B,CAAoC1b,CAApC,CAA0CsF,CAA1C,CAKA,KAAAuH,UAAA,CAAiB,SAMjB,KAAA+D,MAAA,CAAa,IAZoC,CA6BrD9D,EAVuB8M,CAAA1T,UAUvB4G,CAV2CO,MAAAC,OAAA,CAAcN,CAAA9G,UAAd,CAU3C4G,OAAA,CAAyB6O,QAAQ,CAACnH,CAAD,CAAU,CACvC,MAAI,KAAA5D,MAAJ,EAAmB4D,CAAAA,CAAnB,CACW,IAAA5D,MADX,CAIO,IAAAA,MAJP,CAIqB,QAAQ,CAACxR,CAAD,CAAWiN,CAAX,CAAc,CAuDvC,IA7CA,IAAIuN,EAAUA,QAAQ,CAACgC,CAAD,CAAU,CAC5Bxc,CAAAyR,QAAA+I,QAAA1M,KAAA,CAA8B,IAA9B,CAQA,KAAA0O,QAAA,CAAeA,CAAf,EAA0B,QAAQ,CAAC5b,CAAD,CAAO8J,CAAP,CAAYlI,CAAZ,CAAsB,CAIpDia,UAAA,CAAWja,CAAAka,KAAA,CAAc,IAAd,CAAoBta,KAAA,CAAM,4EAAN,CAApB,CAAX,CAAqH,CAArH,CAJoD,CAT5B,CAAhC,CAqBIua,EAAmBnC,CAAA1T,UAAnB6V,CAAuC1O,MAAAC,OAAA,CAAclO,CAAAyR,QAAA+I,QAAA1T,UAAd,CArB3C,CA4CI8V,EAAM3P,CAAAkB,YAAA,CAAcnO,CAAAmM,QAAAqO,QAAAqC,UAAd,CA5CV;AA6CS5a,EAAE,CAAX,CAAcA,CAAd,CAAgB2a,CAAA1a,OAAhB,CAA4BD,CAAA,EAA5B,CACK,SAAQ,CAACqI,CAAD,CAAS,CAGdqS,CAAA,CAAiBrS,CAAA1J,KAAjB,CAAA,CAAgC,QAAQ,CAACkc,CAAD,CAAMta,CAAN,CAAgB,CACpD,GAAI,CACA,GAAI,CAEAsa,CAAA,CAAMxS,CAAAyS,oBAAAvL,MAAAiC,OAAA,CAAwC3T,CAAAsR,KAAA,CAAgB0L,CAAhB,CAAxC,CAFN,CAGF,MAAOna,CAAP,CAAY,CACV,GAAM,EAAAA,CAAA,WAAeqa,UAAf,CAAN,CACI,KAAMra,EAAN,CAFM,CAId,GAAY,IAAZ,GAAIma,CAAJ,EAAmC,QAAnC,GAAoB,MAAOA,EAA3B,CACI,KAAM1a,MAAA,CAAM,mBAAN,CAAN,CACE0a,CAAN,WAAqBxS,EAAAyS,oBAAAvL,MAArB,GACIsL,CADJ,CACU,IAAIxS,CAAAyS,oBAAAvL,MAAJ,CAAqCsL,CAArC,CADV,CAEA,KAAAN,QAAA,CAAalS,CAAA8C,IAAA,EAAb,CAA2B0P,CAA3B,CAAgC,QAAQ,CAACna,CAAD,CAAM4Y,CAAN,CAAW,CAC/C,GAAI5Y,CAAJ,CACIH,CAAA,CAASG,CAAT,CADJ,KAAA,CAKY,IAAZ,GAAI4Y,CAAJ,GACIA,CADJ,CACU,EADV,CAEA,IAAI,CAAEA,CAAA,CAAMjR,CAAA2S,qBAAAzL,MAAAiC,OAAA,CAAyC8H,CAAzC,CAAR,CAAyD,MAAO2B,CAAP,CAAmB,EAC3E3B,CAAL,EAAcA,CAAd,WAA6BjR,EAAA2S,qBAAAzL,MAA7B,CAIAhP,CAAA,CAAS,IAAT,CAAe+Y,CAAf,CAJA,CACI/Y,CAAA,CAASJ,KAAA,CAAM,mDAAN;AAA2D6K,CAAArM,KAA3D,CAAkE,GAAlE,CAAsE0J,CAAA1J,KAAtE,CAAT,CATJ,CAD+C,CAAnD,CAZA,CA2BF,MAAO+B,CAAP,CAAY,CACV8Z,UAAA,CAAWja,CAAAka,KAAA,CAAc,IAAd,CAAoB/Z,CAApB,CAAX,CAAqC,CAArC,CADU,CA5BsC,CAkCxD6X,EAAA,CAAQlQ,CAAA1J,KAAR,CAAA,CAAuB,QAAQ,CAAC4b,CAAD,CAAUM,CAAV,CAAeta,CAAf,CAAyB,CACpD,CAAA,IAAIgY,CAAJ,CAAYgC,CAAZ,CAAA,EAAqBlS,CAAA1J,KAArB,CAAA,CAAkCkc,CAAlC,CAAuCta,CAAvC,CADoD,CAIpDyL,OAAA8B,eAAJ,GACI9B,MAAA8B,eAAA,CAAsByK,CAAA,CAAQlQ,CAAA1J,KAAR,CAAtB,CAA4C,UAA5C,CAAwD,CAAE,MAAS0J,CAAA0F,SAAA,EAAX,CAAxD,CACA,CAAA/B,MAAA8B,eAAA,CAAsB4M,CAAA,CAAiBrS,CAAA1J,KAAjB,CAAtB,CAAqD,UAArD,CAAiE,CAAE,MAAS4Z,CAAA,CAAQlQ,CAAA1J,KAAR,CAAA,SAAX,CAAjE,CAFJ,CAzCc,CAAjB,CAAD,CA4CGgc,CAAA,CAAI3a,CAAJ,CA5CH,CAiFAgM,OAAA8B,eAAJ,GACI9B,MAAA8B,eAAA,CAAsByK,CAAtB,CAA+B,UAA/B,CAA2C,CAAE,MAASvN,CAAA+C,SAAA,EAAX,CAA3C,CAGA,CAFA/B,MAAA8B,eAAA,CAAsB4M,CAAtB,CAAwC,UAAxC,CAAoD,CAAE,MAASnC,CAAA,SAAX,CAApD,CAEA,CADAvM,MAAA8B,eAAA,CAAsByK,CAAtB,CAA+B,OAA/B,CAAwC,CAAE,MAASvN,CAAX,CAAxC,CACA,CAAAgB,MAAA8B,eAAA,CAAsB4M,CAAtB,CAAwC,OAAxC,CAAiD,CAAE,MAAS1P,CAAX,CAAjD,CAJJ,CAMA;MAAOuN,EA/IgC,CAAvB,CAiJjBxa,CAjJiB,CAiJP,IAjJO,CALmB,CA6J3CmM,EAAAqO,QAAA,CAAkBA,CAYlB,KAAI2C,EAASA,QAAQ,CAACjQ,CAAD,CAAU/C,CAAV,CAAevJ,CAAf,CAAqBsF,CAArB,CAA8B,CAC/C+G,CAAAa,KAAA,CAAO,IAAP,CAAaZ,CAAb,CAAsB/C,CAAtB,CAA2BvJ,CAA3B,CAKA,KAAA6M,UAAA,CAAiB,gBAOjB,KAAAvH,QAAA,CAAeA,CAAf,EAA0B,EAbqB,CA4BnD8J,EARsBmN,CAAArW,UAQtBkJ,CARyC/B,MAAAC,OAAA,CAAcjB,CAAAnG,UAAd,CAQzCkJ,UAAA,CAA2BhC,CAAAgC,SAM3B7D,EAAAqO,QAAA2C,OAAA,CAAyBA,CAgBrBN,EAAAA,CAAYA,QAAQ,CAAC3P,CAAD,CAAU/C,CAAV,CAAevJ,CAAf,CAAqBwc,CAArB,CAA8BC,CAA9B,CAAwCC,CAAxC,CAAwDC,CAAxD,CAAyErX,CAAzE,CAAkF,CACtGiX,CAAArP,KAAA,CAAY,IAAZ,CAAkBZ,CAAlB,CAA2B/C,CAA3B,CAAgCvJ,CAAhC,CAAsCsF,CAAtC,CAKA,KAAAuH,UAAA,CAAiB,mBAOjB,KAAA+P,YAAA,CAAmBJ,CAOnB,KAAAK,aAAA,CAAoBJ,CAOpB,KAAAK,cAAA,CAAqBJ,CAOrB,KAAAK,eAAA,CAAsBJ,CActB,KAAAN,qBAAA,CAPA,IAAAF,oBAOA,CAP2B,IAzC2E,CAoD1GF,EAAA/V,UAAA,CAAsBmH,MAAAC,OAAA,CAAciP,CAAArW,UAAd,CAMtBqF,EAAAqO,QAAAqC,UAAA,CAA4BA,CAE5B,OAAO1Q,EAt0F4B,CAApB,CAw0FhBnM,CAx0FgB,CA80FnBA;CAAAyR,QAAA,CAAoB,QAAQ,CAACzR,CAAD,CAAW8D,CAAX,CAAiBqI,CAAjB,CAA0B,CA6UlDyR,QAASA,EAAe,CAAC/T,CAAD,CAAS,CACzBA,CAAA,SAAJ,EACIA,CAAA,SAAAiM,QAAA,CAA2B,QAAQ,CAACrH,CAAD,CAAQ,CACvCA,CAAA,OAAA,CAAkB5E,CAAA,OAClB+T,EAAA,CAAgBnP,CAAhB,CAFuC,CAA3C,CAKA5E,EAAA,MAAJ,EACIA,CAAA,MAAAiM,QAAA,CAAwB,QAAQ,CAACrH,CAAD,CAAQ,CACpCA,CAAA,OAAA,CAAkB5E,CAAA,OADkB,CAAxC,CARyB,CAnUjC,IAAI4H,EAAUA,QAAQ,CAACvL,CAAD,CAAU,CAc5B,IAAAoH,IAAA,CAPA,IAAAwC,GAOA,CAPU,IAAI3D,CAAAyB,UAAJ,CAAsB,IAAtB,CAA4B,IAA5B,CAAkC,EAAlC,CAcV,KAAAiQ,SAAA,CAAgB,CAAA,CAOhB,KAAAC,OAAA,CAAc,IAOd,KAAAC,MAAA,CAAa,EAOb,KAAAC,WAAA,CAAkB,IAOlB,KAAA9X,QAAA,CAAeA,CAAf,EAA0B,EAjDE,CAAhC,CAwDI+X,EAAmBxM,CAAA3K,UAUvB2K,EAAAyM,UAAA,CAAoBC,QAAQ,CAACC,CAAD,CAAM,CAK9B,MAH2B,QAG3B,GAHI,MAAOA,EAAA,KAGX,EAA6B,WAA7B,GAAI,MAAOA,EAAA,OAAX,EAAkE,WAAlE,GAA4C,MAAOA,EAAA,IAAnD,CACW,CAAA,CADX,CAEO,CAAA,CAPuB,CAgBlC3M,EAAA4M,eAAA,CAAyBC,QAAQ,CAACF,CAAD,CAAM,CAEnC,MAA2B,QAA3B,GAAI,MAAOA,EAAA,KAAX;AAA8D,QAA9D,GAAuC,MAAOA,EAAA,KAA9C,EAAiG,QAAjG,GAA0E,MAAOA,EAAA,KAAjF,EAAkI,WAAlI,GAA6G,MAAOA,EAAA,GAApH,CACW,CAAA,CADX,CAEO,CAAA,CAJ4B,CAavC3M,EAAA8M,OAAA,CAAiBC,QAAQ,CAACJ,CAAD,CAAM,CAK3B,MAH2B,QAG3B,GAHI,MAAOA,EAAA,KAGX,EAA6B,WAA7B,GAAI,MAAOA,EAAA,OAAX,EAA6CjY,KAAAC,QAAA,CAAcgY,CAAA,OAAd,CAA7C,EAAsG,CAAtG,GAA6EA,CAAA,OAAAlc,OAA7E,CAEO,CAAA,CAFP,CACW,CAAA,CANgB,CAgB/BuP,EAAAgN,UAAA,CAAoBC,QAAQ,CAACN,CAAD,CAAM,CAE9B,MAA2B,QAA3B,GAAI,MAAOA,EAAA,KAAX,EAA6D,QAA7D,GAAuC,MAAOA,EAAA,IAA9C,EAA0EA,CAAA,IAA1E,CAEO,CAAA,CAFP,CACW,CAAA,CAHmB,CAalC3M,EAAAkN,SAAA,CAAmBC,QAAQ,CAACR,CAAD,CAAM,CAE7B,MAA0B,QAA1B,GAAI,MAAOA,EAAA,IAAX,CACW,CAAA,CADX,CAEO,CAAA,CAJsB,CAcjCH,EAAAY,MAAA,CAAyBC,QAAQ,EAAG,CAChC,IAAAxR,IAAA,CAAW,IAAAwC,GACX,OAAO,KAFyB,CAWpCmO,EAAAte,OAAA,CAA0Bof,QAAQ,CAACC,CAAD,CAAY,CAC1C,GAAyB,QAAzB,GAAI,MAAOA,EAAX,EAAsC,CAAAlb,CAAAM,QAAAsB,KAAA,CAAkBsZ,CAAlB,CAAtC,CACI,KAAM5c,MAAA,CAAM,qBAAN;AAA4B4c,CAA5B,CAAN,CACJA,CAAAzP,MAAA,CAAgB,GAAhB,CAAAuG,QAAA,CAA6B,QAAQ,CAACxG,CAAD,CAAO,CACxC,IAAIQ,EAAK,IAAAxC,IAAAqB,SAAA,CAAkBW,CAAlB,CACE,KAAX,GAAIQ,CAAJ,EACI,IAAAxC,IAAAiB,SAAA,CAAkBuB,CAAlB,CAAuB,IAAI3D,CAAAyB,UAAJ,CAAsB,IAAtB,CAA4B,IAAAN,IAA5B,CAAsCgC,CAAtC,CAAvB,CACJ,KAAAhC,IAAA,CAAWwC,CAJ6B,CAA5C,CAKG,IALH,CAMA,OAAO,KATmC,CAmB9CmO,EAAA/P,OAAA,CAA0B+Q,QAAQ,CAACC,CAAD,CAAO,CACrC,GAAKA,CAAAA,CAAL,CACI,MAAO,KACX,IAAK/Y,KAAAC,QAAA,CAAc8Y,CAAd,CAAL,CAEK,CACD,GAAoB,CAApB,GAAIA,CAAAhd,OAAJ,CACI,MAAO,KACXgd,EAAA,CAAOA,CAAA7Q,MAAA,EAHN,CAFL,IACI6Q,EAAA,CAAO,CAACA,CAAD,CASX,KADA,IAAIvY,EAAQ,CAACuY,CAAD,CACZ,CAAsB,CAAtB,CAAOvY,CAAAzE,OAAP,CAAA,CAAyB,CACrBgd,CAAA,CAAOvY,CAAAwY,IAAA,EAEP,IAAK,CAAAhZ,KAAAC,QAAA,CAAc8Y,CAAd,CAAL,CACI,KAAM9c,MAAA,CAAM,yBAAN,CAAgCuX,IAAAC,UAAA,CAAesF,CAAf,CAAhC,CAAN,CAEJ,IAAA,CAAqB,CAArB,CAAOA,CAAAhd,OAAP,CAAA,CAAwB,CACpB,IAAIkc,EAAMc,CAAA3X,MAAA,EAEV,IAAIkK,CAAAyM,UAAA,CAAkBE,CAAlB,CAAJ,CAA4B,CACxB,IAAI1M,EAAM,IAAIvF,CAAAyC,QAAJ,CAAoB,IAApB,CAA0B,IAAAtB,IAA1B,CAAoC8Q,CAAA,KAApC,CAAiDA,CAAA,QAAjD,CAAiEA,CAAA,QAAjE,CAAiFA,CAAA,OAAjF,CAAV;AAGI5H,EAAS,EACT4H,EAAA,OAAJ,EACInQ,MAAAkC,KAAA,CAAYiO,CAAA,OAAZ,CAAAtI,QAAA,CAAmC,QAAQ,CAAClV,CAAD,CAAO,CAC9C8Q,CAAAnD,SAAA,CAAaiI,CAAA,CAAO5V,CAAP,CAAb,CAA4B,IAAIuL,CAAAyC,QAAA6H,MAAJ,CAA0B,IAA1B,CAAgC/E,CAAhC,CAAqC9Q,CAArC,CAA5B,CAD8C,CAAlD,CAEG,IAFH,CAKAwd,EAAA,OAAJ,EACIA,CAAA,OAAAtI,QAAA,CAAsB,QAAQ,CAACtL,CAAD,CAAM,CAChC,GAAkC,IAAlC,GAAIkH,CAAA/C,SAAA,CAAanE,CAAA,GAAb,CAAuB,CAAvB,CAAJ,CACI,KAAMpI,MAAA,CAAM,mCAAN,CAA0CsP,CAAA9Q,KAA1C,CAAmD,IAAnD,CAAwD4J,CAAA,GAAxD,CAAN,CACJ,GAAIA,CAAA,QAAJ,EAAgD,QAAhD,GAAsB,MAAOA,EAAA,QAA7B,CACI,KAAMpI,MAAA,CAAM,2BAAN,CAAkCsP,CAAA9Q,KAAlC,CAA2C,GAA3C,CAA+C4J,CAAA,KAA/C,CAAN,CACJ,IAAIkN,EAAQ,IACZ,IAA4B,QAA5B,GAAI,MAAOlN,EAAA,MAAX,EAA0C,EAAAkN,CAAA,CAAQlB,CAAA,CAAOhM,CAAA,MAAP,CAAR,CAA1C,CACI,KAAMpI,MAAA,CAAM,mBAAN,CAA0BsP,CAAA9Q,KAA1B,CAAmC,GAAnC,CAAuC4J,CAAA,KAAvC,CAAmD,IAAnD,CAAwDA,CAAA,MAAxD,CAAN,CACJA,CAAA,CAAM,IAAI2B,CAAAyC,QAAAC,MAAJ,CAA0B,IAA1B,CAAgC6C,CAAhC,CAAqClH,CAAA,KAArC;AAAkDA,CAAA,QAAlD,CAAkEA,CAAA,KAAlE,CAA+EA,CAAA,KAA/E,CAA4FA,CAAA,GAA5F,CAAuGA,CAAA,QAAvG,CAAuHkN,CAAvH,CAA8H0G,CAAA,OAA9H,CACF1G,EAAJ,EACIA,CAAAlM,OAAAnF,KAAA,CAAkBmE,CAAlB,CACJkH,EAAAnD,SAAA,CAAa/D,CAAb,CAXgC,CAApC,CAYG,IAZH,CAeJ,KAAI4U,EAAS,EACThB,EAAA,MAAJ,EACIA,CAAA,MAAAtI,QAAA,CAAqB,QAAQ,CAAClK,CAAD,CAAM,CAC/BwT,CAAA/Y,KAAA,CAAYuF,CAAZ,CAD+B,CAAnC,CAGAwS,EAAA,SAAJ,EACIA,CAAA,SAAAtI,QAAA,CAAwB,QAAQ,CAACpL,CAAD,CAAM,CAClC0U,CAAA/Y,KAAA,CAAYqE,CAAZ,CADkC,CAAtC,CAGA0T,EAAA,SAAJ,EACIA,CAAA,SAAAtI,QAAA,CAAwB,QAAQ,CAAC3L,CAAD,CAAM,CAClCiV,CAAA/Y,KAAA,CAAY8D,CAAZ,CADkC,CAAtC,CAKAiU,EAAA,WAAJ,GAEQ1M,CAAAoD,WAFR,CACwC,QAApC,GAAI,MAAOsJ,EAAA,WAAA,CAAkB,CAAlB,CAAX,CACqB,CAAEA,CAAA,WAAF,CADrB,CAGqBA,CAAA,WAJzB,CAQA,KAAA9Q,IAAAiB,SAAA,CAAkBmD,CAAlB,CACA,IAAoB,CAApB,CAAI0N,CAAAld,OAAJ,CAAuB,CACnByE,CAAAN,KAAA,CAAW6Y,CAAX,CACAA,EAAA,CAAOE,CACPA,EAAA,CAAS,IACT,KAAA9R,IAAA,CAAWoE,CACXA,EAAA,CAAM,IACN,SANmB,CAQvB0N,CAAA,CAAS,IA3De,CAA5B,IA6DO,IAAI3N,CAAA8M,OAAA,CAAeH,CAAf,CAAJ,CAEH1M,CAIA,CAJM,IAAIvF,CAAAmF,KAAJ,CAAiB,IAAjB,CAAuB,IAAAhE,IAAvB,CAAiC8Q,CAAA,KAAjC,CAA8CA,CAAA,QAA9C;AAA8DA,CAAA,OAA9D,CAIN,CAHAA,CAAA,OAAAtI,QAAA,CAAsB,QAAQ,CAACjQ,CAAD,CAAM,CAChC6L,CAAAnD,SAAA,CAAa,IAAIpC,CAAAmF,KAAAC,MAAJ,CAAuB,IAAvB,CAA6BG,CAA7B,CAAkC7L,CAAA,KAAlC,CAA+CA,CAAA,GAA/C,CAAb,CADgC,CAApC,CAEG,IAFH,CAGA,CAAA,IAAAyH,IAAAiB,SAAA,CAAkBmD,CAAlB,CANG,KAQA,IAAID,CAAAgN,UAAA,CAAkBL,CAAlB,CAAJ,CAEH1M,CAKA,CALM,IAAIvF,CAAAqO,QAAJ,CAAoB,IAApB,CAA0B,IAAAlN,IAA1B,CAAoC8Q,CAAA,KAApC,CAAiDA,CAAA,QAAjD,CAKN,CAJAnQ,MAAAkC,KAAA,CAAYiO,CAAA,IAAZ,CAAAtI,QAAA,CAAgC,QAAQ,CAAClV,CAAD,CAAO,CAC3C,IAAIye,EAAMjB,CAAA,IAAA,CAAWxd,CAAX,CACV8Q,EAAAnD,SAAA,CAAa,IAAIpC,CAAAqO,QAAAqC,UAAJ,CAA8B,IAA9B,CAAoCnL,CAApC,CAAyC9Q,CAAzC,CAA+Cye,CAAA,QAA/C,CAA+DA,CAAA,SAA/D,CAAgF,CAAE,CAAAA,CAAA,eAAlF,CAAyG,CAAE,CAAAA,CAAA,gBAA3G,CAAmIA,CAAA,QAAnI,CAAb,CAF2C,CAA/C,CAGG,IAHH,CAIA,CAAA,IAAA/R,IAAAiB,SAAA,CAAkBmD,CAAlB,CAPG,KASA,IAAID,CAAAkN,SAAA,CAAiBP,CAAjB,CAAJ,CAGH,GADA1M,CACA,CADM,IAAApE,IAAA4B,QAAA,CAAiBkP,CAAA,IAAjB,CAA6B,CAAA,CAA7B,CACN,CACIA,CAAA,OAAAtI,QAAA,CAAsB,QAAQ,CAACtL,CAAD,CAAM,CAChC,GAAkC,IAAlC,GAAIkH,CAAA/C,SAAA,CAAanE,CAAA,GAAb,CAAuB,CAAvB,CAAJ,CACI,KAAMpI,MAAA,CAAM,iCAAN;AAAwCsP,CAAA9Q,KAAxC,CAAiD,IAAjD,CAAsD4J,CAAA,GAAtD,CAAN,CAEJ,GAAIkH,CAAAoD,WAAJ,CAAoB,CAChB,IAAIwK,EAAQ,CAAA,CACZ5N,EAAAoD,WAAAgB,QAAA,CAAuB,QAAQ,CAAC/J,CAAD,CAAQ,CAC/BvB,CAAA,GAAJ,EAAiBuB,CAAA,CAAM,CAAN,CAAjB,EAA6BvB,CAAA,GAA7B,EAA0CuB,CAAA,CAAM,CAAN,CAA1C,GACIuT,CADJ,CACY,CAAA,CADZ,CADmC,CAAvC,CAIA,IAAKA,CAAAA,CAAL,CACI,KAAMld,MAAA,CAAM,+BAAN,CAAsCsP,CAAA9Q,KAAtC,CAA+C,IAA/C,CAAoD4J,CAAA,GAApD,CAA8D,4BAA9D,CAAN,CAPY,CAUpB,IAAI5J,EAAO4J,CAAA,KACP,KAAAtE,QAAA,yBAAJ,GACItF,CADJ,CACWZ,CAAAwB,KAAA+B,YAAA,CAA0B3C,CAA1B,CADX,CAGI2V,KAAAA,EAAQ,IAAIpK,CAAAyC,QAAAmJ,eAAJ,CAAmC,IAAnC,CAAyCrG,CAAzC,CAA8ClH,CAAA,KAA9C,CAA2DA,CAAA,KAA3D,CAAwE,IAAA8C,IAAAF,IAAA,EAAxE,CAAuF,GAAvF,CAA2FxM,CAA3F,CAAiG4J,CAAA,GAAjG,CAA4GA,CAAA,QAA5G,CAAR+L,CAIAtK,EAAM,IAAIE,CAAAsO,UAAJ,CAAsB,IAAtB,CAA4B,IAAAnN,IAA5B,CAAsC9C,CAAA,KAAtC,CAAmD+L,CAAnD,CACVA,EAAAgJ,UAAA,CAAkBtT,CAClB,KAAAqB,IAAAiB,SAAA,CAAkBtC,CAAlB,CACAyF,EAAAnD,SAAA,CAAagI,CAAb,CAzBgC,CAApC,CA0BG,IA1BH,CADJ,KA6BO,IAAK,CAAA,uBAAA7Q,KAAA,CAA6B0Y,CAAA,IAA7B,CAAL,CACH,KAAMhc,MAAA,CAAM,mBAAN;AAA0Bgc,CAAA,IAA1B,CAAqC,iBAArC,CAAN,CADG,CAhCJ,IAoCH,MAAMhc,MAAA,CAAM,0BAAN,CAAiCuX,IAAAC,UAAA,CAAewE,CAAf,CAAjC,CAAN,CAGJ1M,CAAA,CADA0M,CACA,CADM,IAvHc,CA2HxBc,CAAA,CAAO,IACP,KAAA5R,IAAA,CAAW,IAAAA,IAAAzD,OAlIU,CAoIzB,IAAAgU,SAAA,CAAgB,CAAA,CAChB,KAAAC,OAAA,CAAc,IACd,OAAO,KAnJ8B,CAiLzCG,EAAA,CAAiB,QAAjB,CAAA,CAA6B,QAAQ,CAACuB,CAAD,CAAOC,CAAP,CAAiB,CAClD,IAAI9X,EAAQ,GAIZ,IAAwB,QAAxB,GAAI,MAAO8X,EAAX,CAAkC,CAE1Bzf,CAAAwB,KAAAC,QAAJ,GACIge,CADJ,CACe7f,OAAA,CAAQ,MAAR,CAAA,QAAA,CAA2B6f,CAA3B,CADf,CAEA,IAA6B,CAAA,CAA7B,GAAI,IAAA1B,MAAA,CAAW0B,CAAX,CAAJ,CACI,MAAO,KAAAZ,MAAA,EACX,KAAAd,MAAA,CAAW0B,CAAX,CAAA,CAAuB,CAAA,CANO,CAAlC,IAQO,IAAwB,QAAxB,GAAI,MAAOA,EAAX,CAAkC,CAErC,IAAInD,EAAOmD,CAAAnD,KACPtc,EAAAwB,KAAAC,QAAJ,GACI6a,CADJ,CACW1c,OAAA,CAAQ,MAAR,CAAA,QAAA,CAA2B0c,CAA3B,CADX,CAEA,IAA0B,CAA1B,EAAIA,CAAA7L,QAAA,CAAa,IAAb,CAAJ,EAA8D,CAA9D,EAA+BgP,CAAAC,KAAAjP,QAAA,CAAsB,IAAtB,CAA/B,CACI9I,CAAA,CAAQ,IAGRgY,EAAA,CADA3f,CAAAwB,KAAAC,QAAJ;AACY7B,OAAA,CAAQ,MAAR,CAAA,KAAA,CAAwB0c,CAAxB,CAA8BmD,CAAAC,KAA9B,CADZ,CAGYpD,CAHZ,CAGmB3U,CAHnB,CAG2B8X,CAAAC,KAC3B,IAA0B,CAAA,CAA1B,GAAI,IAAA3B,MAAA,CAAW4B,CAAX,CAAJ,CACI,MAAO,KAAAd,MAAA,EACX,KAAAd,MAAA,CAAW4B,CAAX,CAAA,CAAoB,CAAA,CAdiB,CAmBzC,GAAIH,CAAA,QAAJ,EAAgD,CAAhD,CAAuBA,CAAA,QAAAtd,OAAvB,CAAmD,CAC/C,IACI0d,EAAY,CAAA,CAEhB,IAAwB,QAAxB,GAAI,MAAOH,EAAX,CAKI,IAHA,IAAAzB,WAGI,CAHcyB,CAAA,KAGd,CAHgCG,CAGhC,CAH4C,CAAA,CAG5C,CAFJ5B,CAEI,CAFS,IAAAA,WAET,CADJyB,CACI,CADOA,CAAA,KACP,CAA4B,CAA5B,EAAAzB,CAAAvN,QAAA,CAAmB,IAAnB,CAAA,EAA2D,CAA3D,EAAiCgP,CAAAhP,QAAA,CAAiB,IAAjB,CAArC,CACI9I,CAAA,CAAQ,IADZ,CALJ,IAQ+B,QAAxB,GAAI,MAAO8X,EAAX,CAEC,IAAAzB,WAAJ,CACIA,CADJ,CACiB,IAAAA,WADjB,CAGiC,CAA7B,EAAIyB,CAAAhP,QAAA,CAAiB,GAAjB,CAAJ,EACIuN,CACA,CADayB,CAAA/b,QAAA,CAAiB,WAAjB,CAA8B,EAA9B,CACb,CAAqC,EAArC,GAAsBsa,CAAtB,GACIA,CADJ,CACiB,GADjB,CAFJ,EAIqC,CAA9B,EAAIyB,CAAAhP,QAAA,CAAiB,IAAjB,CAAJ,EACHuN,CACA,CADayB,CAAA/b,QAAA,CAAiB,WAAjB,CAA8B,EAA9B,CACb,CAAAiE,CAAA,CAAQ,IAFL,EAIHqW,CAJG,CAIU,GAblB,CAiBHA,CAjBG,CAiBU,IAEjB,KAAK,IAAI/b,EAAE,CAAX,CAAcA,CAAd,CAAgBud,CAAA,QAAAtd,OAAhB,CAAwCD,CAAA,EAAxC,CACI,GAAkC,QAAlC;AAAI,MAAOud,EAAA,QAAA,CAAgBvd,CAAhB,CAAX,CAA4C,CACxC,GAAK+b,CAAAA,CAAL,CACI,KAAM5b,MAAA,CAAM,8BAAN,CAAN,CACJ,IAAIyd,EAAiBL,CAAA,QAAA,CAAgBvd,CAAhB,CACrB,IAAuB,kCAAvB,GAAI4d,CAAJ,GAGIA,CAGA,CAJA7f,CAAAwB,KAAAC,QAAJ,CACqB7B,OAAA,CAAQ,MAAR,CAAA,KAAA,CAAwBoe,CAAxB,CAAoC6B,CAApC,CADrB,CAGqB7B,CAHrB,CAGkCrW,CAHlC,CAG0CkY,CACtC,CAA+B,CAAA,CAA/B,GAAA,IAAA9B,MAAA,CAAW8B,CAAX,CANJ,EAMA,CAEI,WAAAna,KAAA,CAAiBma,CAAjB,CAAJ,EAAyC3a,CAAAlF,CAAAkF,SAAzC,GACI2a,CADJ,CACqBA,CAAAnc,QAAA,CAAuB,UAAvB,CAAmC,OAAnC,CADrB,CAEA,KAAImY,EAAW7b,CAAAwB,KAAAa,MAAA,CAAoBwd,CAApB,CACf,IAAiB,IAAjB,GAAIhE,CAAJ,CACI,KAAMzZ,MAAA,CAAM,oBAAN,CAA2Byd,CAA3B,CAA0C,QAA1C,CAAmDJ,CAAnD,CAA4D,mBAA5D,CAAN,CACJ,GAAI,UAAA/Z,KAAA,CAAgBma,CAAhB,CAAJ,CACI,IAAA,CAAK,QAAL,CAAA,CAAelG,IAAAhR,MAAA,CAAWkT,CAAX,CAAoB,EAApB,CAAf,CAAwCgE,CAAxC,CADJ,KAGI,KAAA,CAAK,QAAL,CAAA,CAAe7f,CAAAkF,SAAAqD,OAAAI,MAAA,CAA+BkT,CAA/B,CAAf,CAAyDgE,CAAzD,CAVJ,CAVwC,CAA5C,IAsBI,IAAKJ,CAAL,CAEK,GAAI,UAAA/Z,KAAA,CAAgB+Z,CAAhB,CAAJ,CACD,IAAA,CAAK,QAAL,CAAA,CAAeD,CAAA,QAAA,CAAgBvd,CAAhB,CAAf;AAAmCwd,CAAA/b,QAAA,CAAiB,eAAjB,CAAkC,QAAQ,CAACC,CAAD,CAAKC,CAAL,CAASkc,CAAT,CAAa,CAAE,MAAOlc,EAAP,CAAU,SAAV,CAAoB3B,CAApB,CAAsB,GAAtB,CAA0B6d,CAA5B,CAAvD,CAAnC,CADC,KAGD,KAAA,CAAK,QAAL,CAAA,CAAeN,CAAA,QAAA,CAAgBvd,CAAhB,CAAf,CAAmCwd,CAAnC,CAA4C,SAA5C,CAAsDxd,CAAtD,CALJ,KACI,KAAA,CAAK,QAAL,CAAA,CAAeud,CAAA,QAAA,CAAgBvd,CAAhB,CAAf,CAMR2d,EAAJ,GACI,IAAA5B,WADJ,CACsB,IADtB,CA7D+C,CAmE/CwB,CAAA,CAAK,SAAL,CAAJ,EACI,IAAA7f,OAAA,CAAY6f,CAAA,CAAK,SAAL,CAAZ,CACAA,EAAA,OAAJ,EACI5B,CAAA,CAAgB4B,CAAhB,CACJ,KAAIO,EAAO,IAAAzS,IACPkS,EAAA,QAAJ,EACIvR,MAAAkC,KAAA,CAAYqP,CAAA,QAAZ,CAAA1J,QAAA,CAAqC,QAAQ,CAAC7G,CAAD,CAAM,CAC/C8Q,CAAA7Z,QAAA,CAAa+I,CAAb,CAAA,CAAoBuQ,CAAA,QAAA,CAAgBvQ,CAAhB,CAD2B,CAAnD,CAGAuQ,EAAA,SAAJ,GACI,IAAAtR,OAAA,CAAYsR,CAAA,SAAZ,CACA,CAAA,IAAAlS,IAAA,CAAWyS,CAFf,CAGIP,EAAA,MAAJ,GACI,IAAAtR,OAAA,CAAYsR,CAAA,MAAZ,CACA,CAAA,IAAAlS,IAAA,CAAWyS,CAFf,CAGIP,EAAA,SAAJ,GACI,IAAAtR,OAAA,CAAYsR,CAAA,SAAZ,CACA,CAAA,IAAAlS,IAAA,CAAWyS,CAFf,CAGIP,EAAA,CAAK,SAAL,CAAJ,EACI,IAAAtR,OAAA,CAAYsR,CAAA,CAAK,SAAL,CAAZ,CAEJ;MAAO,KAAAX,MAAA,EAxH2C,CAiItDZ,EAAA+B,WAAA,CAA8BC,QAAQ,EAAG,CAErC,IAAI1E,CACJ,IAAgB,IAAhB,EAAI,IAAAjO,IAAJ,EAAiD,QAAjD,GAAwB,MAAO,KAAAA,IAAAjC,KAA/B,CACI,MAAO,KAEX,IAAI,IAAAiC,IAAJ,WAAwBnB,EAAAyB,UAAxB,CAEI,IAAAN,IAAAS,SAAA+H,QAAA,CAA0B,QAAQ,CAACrH,CAAD,CAAQ,CACtC,IAAAnB,IAAA,CAAWmB,CACX,KAAAuR,WAAA,EAFsC,CAA1C,CAGG,IAHH,CAFJ,KAOO,IAAI,IAAA1S,IAAJ,WAAwBnB,EAAAyC,QAAAC,MAAxB,CAA+C,CAElD,GAAK/K,CAAAG,KAAAyB,KAAA,CAAe,IAAA4H,IAAAjC,KAAf,CAAL,CAiBI,IAAAiC,IAAAjC,KAAA,CAAgBrL,CAAAW,MAAA,CAAe,IAAA2M,IAAAjC,KAAf,CAjBpB,KAAoC,CAChC,GAAK,CAAAvH,CAAAM,QAAAsB,KAAA,CAAkB,IAAA4H,IAAAjC,KAAlB,CAAL,CACI,KAAMjJ,MAAA,CAAM,4BAAN,CAAmC,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAAnC,CAA2D,IAA3D,CAAgE,IAAAiF,IAAAjC,KAAhE,CAAN,CACJkQ,CAAA,CAAMrM,CAAC,IAAA5B,IAAA,WAAoBnB,EAAAyC,QAAAmJ,eAApB;AAAqD,IAAAzK,IAAAiS,UAAA1V,OAArD,CAAiF,IAAAyD,IAAAzD,OAAlFqF,SAAA,CAA2G,IAAA5B,IAAAjC,KAA3G,CAA0H,CAAA,CAA1H,CACN,IAAKkQ,CAAAA,CAAL,CACI,KAAMnZ,MAAA,CAAM,iCAAN,CAAwC,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAAxC,CAAgE,IAAhE,CAAqE,IAAAiF,IAAAjC,KAArE,CAAN,CACJ,IAAAiC,IAAAiD,aAAA,CAAwBgL,CACxB,IAAIA,CAAJ,WAAmBpP,EAAAmF,KAAnB,CAEI,IADA,IAAAhE,IAAAjC,KACI,CADYrL,CAAAW,MAAA,CAAe,MAAf,CACZ,CAAoB,QAApB,GAAA,IAAA2M,IAAAO,OAAA,EAA+C,QAA/C,GAAgC0N,CAAA1N,OAApC,CACI,KAAMzL,MAAA,CAAM,6CAAN,CAAN,CADJ,CAFJ,IAKK,IAAImZ,CAAJ,WAAmBpP,EAAAyC,QAAnB,CACD,IAAAtB,IAAAjC,KAAA,CAAgBkQ,CAAA9Q,QAAA,CAAczK,CAAAW,MAAA,MAAd,CAAwCX,CAAAW,MAAA,QADvD,KAGD,MAAMyB,MAAA,CAAM,4BAAN,CAAmC,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAAnC;AAA2D,IAA3D,CAAgE,IAAAiF,IAAAjC,KAAhE,CAAN,CAf4B,CAqBpC,GAAI,IAAAiC,IAAAsJ,IAAJ,CAAkB,CACd,GAAK,CAAA9S,CAAAG,KAAAyB,KAAA,CAAe,IAAA4H,IAAA0N,QAAf,CAAL,CACI,KAAM5Y,MAAA,CAAM,oCAAN,CAA2C,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAA3C,CAAmE,IAAnE,CAAwE,IAAAiF,IAAA0N,QAAxE,CAAN,CACJ,IAAA1N,IAAA0N,QAAA,CAAmBhb,CAAAW,MAAA,CAAe,IAAA2M,IAAA0N,QAAf,CAHL,CASI,QADtB,GACE,IAAA1N,IAAAO,OADF,EAEE,IAAAP,IAAAqJ,SAFF,EAEmD3V,IAAAA,EAFnD,GAEuB,IAAAsM,IAAApH,QAAAga,OAFvB,EAGoE,EAHpE,GAGElgB,CAAAU,oBAAA+P,QAAA,CAAqC,IAAAnD,IAAAjC,KAAAxK,SAArC,CAHF,GAKE,IAAAyM,IAAApH,QAAAga,OALF,CAK4B,CAAA,CAL5B,CA/BkD,CAA/C,IAuCA,IAAI,IAAA5S,IAAJ,WAAwBtN,EAAAmM,QAAAqO,QAAA2C,OAAxB,CAEH,GAAI,IAAA7P,IAAJ,WAAwBtN,EAAAmM,QAAAqO,QAAAqC,UAAxB,CAA4D,CACxDtB,CAAA,CAAM,IAAAjO,IAAAzD,OAAAqF,QAAA,CAAwB,IAAA5B,IAAAkQ,YAAxB;AAA8C,CAAA,CAA9C,CACN,IAAI,EAACjC,CAAD,EAAUA,CAAV,WAAyBvb,EAAAmM,QAAAyC,QAAzB,CAAJ,CACI,KAAMxM,MAAA,CAAM,4BAAN,CAAmC,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAAnC,CAA2D,IAA3D,CAAgE,IAAAiF,IAAAkQ,YAAhE,CAAN,CACJ,IAAAlQ,IAAAyP,oBAAA,CAA+BxB,CAC/BA,EAAA,CAAM,IAAAjO,IAAAzD,OAAAqF,QAAA,CAAwB,IAAA5B,IAAAmQ,aAAxB,CAA+C,CAAA,CAA/C,CACN,IAAI,EAAClC,CAAD,EAAUA,CAAV,WAAyBvb,EAAAmM,QAAAyC,QAAzB,CAAJ,CACI,KAAMxM,MAAA,CAAM,4BAAN,CAAmC,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAAnC,CAA2D,IAA3D,CAAgE,IAAAiF,IAAAmQ,aAAhE,CAAN,CACJ,IAAAnQ,IAAA2P,qBAAA,CAAgC1B,CARwB,CAA5D,IAUI,MAAMnZ,MAAA,CAAM,0BAAN,CAAiC,IAAAkL,IAAAjF,SAAA,CAAkB,CAAA,CAAlB,CAAjC,CAAN,CAZD,IAcA,IACH,EAAE,IAAAiF,IAAF,WAAsBtN,EAAAmM,QAAAyC,QAAA6H,MAAtB;AACE,IAAAnJ,IADF,WACsBtN,EAAAmM,QAAAsO,UADtB,EAEE,IAAAnN,IAFF,WAEsBtN,EAAAmM,QAAAmF,KAAAC,MAFtB,CADG,CAKH,KAAMnP,MAAA,CAAM,+BAAN,CAAsC,MAAO,KAAAkL,IAA7C,CAAuD,IAAvD,CAA4D,IAAAA,IAA5D,CAAN,CAEJ,MAAO,KAAAuR,MAAA,EAzE8B,CAoFzCZ,EAAAvQ,MAAA,CAAyByS,QAAQ,CAAC5d,CAAD,CAAO,CACpC,IAAAsc,MAAA,EACK,KAAAhB,SAAL,GACI,IAAAmC,WAAA,EAEA,CADA,IAAAnC,SACA,CADgB,CAAA,CAChB,CAAA,IAAAC,OAAA,CAAc,IAHlB,CAIoB,KAApB,GAAI,IAAAA,OAAJ,GACI,IAAAA,OADJ,CACkB,IAAAhO,GAAApC,MAAA,EADlB,CAEA,IAAKnL,CAAAA,CAAL,CACI,MAAO,KAAAub,OACPxO,EAAAA,CAAuB,QAAhB,GAAA,MAAO/M,EAAP,CAA2BA,CAAAgN,MAAA,CAAW,GAAX,CAA3B,CAA6ChN,CAExD,KAFA,IACI+K,EAAM,IAAAwQ,OADV,CAES7b,EAAE,CAAX,CAAcA,CAAd,CAAgBqN,CAAApN,OAAhB,CAA6BD,CAAA,EAA7B,CACI,GAAIqL,CAAA,CAAIgC,CAAA,CAAKrN,CAAL,CAAJ,CAAJ,CACIqL,CAAA,CAAMA,CAAA,CAAIgC,CAAA,CAAKrN,CAAL,CAAJ,CADV,KAEK,CACDqL,CAAA,CAAM,IACN,MAFC,CAIT,MAAOA,EAnB6B,CA4BxC2Q,EAAAmC,OAAA,CAA0BC,QAAQ,CAAC9d,CAAD;AAAO8M,CAAP,CAA4B,CAC1D,MAAO9M,EAAA,CAAO,IAAAuN,GAAAZ,QAAA,CAAgB3M,CAAhB,CAAsB8M,CAAtB,CAAP,CAAoD,IAAAS,GADD,CAS9DmO,EAAA5V,SAAA,CAA4BiY,QAAQ,EAAG,CACnC,MAAO,SAD4B,CAUvC7O,EAAA7C,QAAA,CAAkB2R,QAAQ,EAAG,EAK7B9O,EAAAH,KAAA,CAAekP,QAAQ,EAAG,EAK1B/O,EAAA+I,QAAA,CAAkBiG,QAAQ,EAAG,EAE7B,OAAOhP,EAnnB2C,CAAnC,CAqnBhBzR,CArnBgB,CAqnBNA,CAAA8D,KArnBM,CAqnBS9D,CAAAmM,QArnBT,CA2nBnBnM,EAAAgW,IAAA,CAAgB,QAAQ,CAAChW,CAAD,CAAWmM,CAAX,CAAoB,CA+ExCuU,QAASA,EAAa,CAACC,CAAD,CAAM,CACxB,IAAIC,EAAM,CACV,OAAO,CACHvZ,KAAMA,QAAQ,EAAG,CACb,MAAIuZ,EAAJ,CAAUD,CAAAze,OAAV,CACW,CAAEiU,KAAM,CAAA,CAAR,CAAe/Q,MAAOub,CAAA,CAAIC,CAAA,EAAJ,CAAtB,CADX,CAEO,CAAEzK,KAAM,CAAA,CAAR,CAHM,CADd,CAFiB,CAjE5B,IAAIH,EAAMA,QAAQ,CAACO,CAAD,CAAQsF,CAAR,CAAkB,CAChC,GAAKjF,CAAAL,CAAAK,IAAL,CACI,KAAMxU,MAAA,CAAM,oBAAN,CAAN,CAMJ,IAAAmU,MAAA,CAAaA,CAMb,KAAAH,QAAA,CAAe,IAAIjK,CAAAmE,QAAJ,CAAoBiG,CAAAyE,QAApB,CAAmC,IAAnC,CAAyC,CAAA,CAAzC,CAA+CzE,CAAA1I,OAA/C,CAMf,KAAAwI,UAAA,CAAiB,IAAIlK,CAAAmE,QAAJ,CAAoBiG,CAAAlL,KAApB,CAAgCkL,CAAAhG,aAAhC,CAAoD,CAAA,CAApD,CAA2DgG,CAAA1I,OAA3D,CAgBjB,KAAA+I,IAAA,CAAW,EAKX3I;MAAA8B,eAAA,CAAsB,IAAtB,CAA4B,MAA5B,CAAoC,CAChC6H,IAAKA,QAAQ,EAAG,CAAE,MAAO3J,OAAAkC,KAAA,CAAY,IAAAyG,IAAZ,CAAA1U,OAAT,CADgB,CAApC,CAKA,IAAI2Z,CAAJ,CAEI,IADA,IAAI1L,EAAOlC,MAAAkC,KAAA,CAAY0L,CAAZ,CAAX,CACS5Z,EAAI,CAAb,CAAgBA,CAAhB,CAAoBkO,CAAAjO,OAApB,CAAiCD,CAAA,EAAjC,CAAsC,CAClC,IAAIgN,EAAM,IAAAmH,QAAA3B,gBAAA,CAA6BtE,CAAA,CAAKlO,CAAL,CAA7B,CAAV,CACI4D,EAAM,IAAAwQ,UAAAvF,YAAA,CAA2B+K,CAAA,CAAS1L,CAAA,CAAKlO,CAAL,CAAT,CAA3B,CACV,KAAA2U,IAAA,CAAS,IAAAR,QAAAxB,cAAA,CAA2B3F,CAA3B,CAAT,CAAA,CACI,CAAEA,IAAKA,CAAP,CAAY7J,MAAOS,CAAnB,CAJ8B,CAhDV,CAApC,CAyDIgb,EAAe7K,CAAAlP,UAsBnB+Z,EAAAC,MAAA,CAAqBC,QAAQ,EAAG,CAC5B,IAAAnK,IAAA,CAAW,EADiB,CAQhCiK,EAAA,CAAa,QAAb,CAAA,CAAyB,QAAQ,CAAC5R,CAAD,CAAM,CAC/B+R,CAAAA,CAAW,IAAA5K,QAAAxB,cAAA,CAA2B,IAAAwB,QAAAtF,YAAA,CAAyB7B,CAAzB,CAA3B,CACf,KAAIgS,EAASD,CAATC,GAAqB,KAAArK,IACzB,QAAO,IAAAA,IAAA,CAASoK,CAAT,CACP,OAAOC,EAJ4B,CAWvCJ,EAAA3K,QAAA,CAAuBgL,QAAQ,EAAG,CAG9B,IAFA,IAAIhL,EAAU,EAAd,CACIiL,EAAUlT,MAAAkC,KAAA,CAAY,IAAAyG,IAAZ,CADd;AAES3U,EAAI,CAFb,CAEgBmf,CAAhB,CAAuBnf,CAAvB,CAA2Bkf,CAAAjf,OAA3B,CAA2CD,CAAA,EAA3C,CACIiU,CAAA7P,KAAA,CAAa,CAAC4I,CAACmS,CAADnS,CAAO,IAAA2H,IAAA,CAASuK,CAAA,CAAQlf,CAAR,CAAT,CAAPgN,KAAD,CAAmCmS,CAAAhc,MAAnC,CAAb,CACJ,OAAOsb,EAAA,CAAcxK,CAAd,CALuB,CAYlC2K,EAAA1Q,KAAA,CAAoBkR,QAAQ,EAAG,CAG3B,IAFA,IAAIlR,EAAO,EAAX,CACIgR,EAAUlT,MAAAkC,KAAA,CAAY,IAAAyG,IAAZ,CADd,CAES3U,EAAI,CAAb,CAAgBA,CAAhB,CAAoBkf,CAAAjf,OAApB,CAAoCD,CAAA,EAApC,CACIkO,CAAA9J,KAAA,CAAU,IAAAuQ,IAAA,CAASuK,CAAA,CAAQlf,CAAR,CAAT,CAAAgN,IAAV,CACJ,OAAOyR,EAAA,CAAcvQ,CAAd,CALoB,CAY/B0Q,EAAAxP,OAAA,CAAsBiQ,QAAQ,EAAG,CAG7B,IAFA,IAAIjQ,EAAS,EAAb,CACI8P,EAAUlT,MAAAkC,KAAA,CAAY,IAAAyG,IAAZ,CADd,CAES3U,EAAI,CAAb,CAAgBA,CAAhB,CAAoBkf,CAAAjf,OAApB,CAAoCD,CAAA,EAApC,CACIoP,CAAAhL,KAAA,CAAY,IAAAuQ,IAAA,CAASuK,CAAA,CAAQlf,CAAR,CAAT,CAAAmD,MAAZ,CACJ,OAAOsb,EAAA,CAAcrP,CAAd,CALsB,CAajCwP,EAAA/K,QAAA,CAAuByL,QAAQ,CAACC,CAAD,CAAKC,CAAL,CAAc,CAEzC,IADA,IAAIN,EAAUlT,MAAAkC,KAAA,CAAY,IAAAyG,IAAZ,CAAd,CACS3U,EAAI,CADb,CACgBmf,CAAhB,CAAuBnf,CAAvB,CAA2Bkf,CAAAjf,OAA3B,CAA2CD,CAAA,EAA3C,CACIuf,CAAA1T,KAAA,CAAQ2T,CAAR,CAAiBrc,CAACgc,CAADhc,CAAO,IAAAwR,IAAA,CAASuK,CAAA,CAAQlf,CAAR,CAAT,CAAPmD,OAAjB,CAAqDgc,CAAAnS,IAArD,CAAgE,IAAhE,CAHqC,CAY7C4R,EAAAxJ,IAAA,CAAmBqK,QAAQ,CAACzS,CAAD,CAAM7J,CAAN,CAAa,CACpC,IAAI4b,EAAW,IAAA5K,QAAAtF,YAAA,CAAyB7B,CAAzB,CAAf,CACI0S,EAAW,IAAAtL,UAAAvF,YAAA,CAA2B1L,CAA3B,CACf;IAAAwR,IAAA,CAAS,IAAAR,QAAAxB,cAAA,CAA2BoM,CAA3B,CAAT,CAAA,CACI,CAAE/R,IAAK+R,CAAP,CAAiB5b,MAAOuc,CAAxB,CACJ,OAAO,KAL6B,CAaxCd,EAAAjJ,IAAA,CAAmBgK,QAAQ,CAAC3S,CAAD,CAAM,CACzB+R,CAAAA,CAAW,IAAA5K,QAAAxB,cAAA,CAA2B,IAAAwB,QAAAtF,YAAA,CAAyB7B,CAAzB,CAA3B,CACf,IAAM+R,CAAN,GAAkB,KAAApK,IAAlB,CAEA,MAAO,KAAAA,IAAA,CAASoK,CAAT,CAAA5b,MAJsB,CAYjCyb,EAAAgB,IAAA,CAAmBC,QAAQ,CAAC7S,CAAD,CAAM,CAE7B,MADe,KAAAmH,QAAAxB,cAAAoM,CAA2B,IAAA5K,QAAAtF,YAAA,CAAyB7B,CAAzB,CAA3B+R,CACf,EAAoB,KAAApK,IAFS,CAKjC,OAAOZ,EA/LiC,CAA7B,CAgMZhW,CAhMY,CAgMFA,CAAAmM,QAhME,CA4MfnM,EAAA+hB,UAAA,CAAqBC,QAAQ,CAACzb,CAAD,CAAQ2G,CAAR,CAAiBuS,CAAjB,CAA2B,CACpD,GAAuB,QAAvB,GAAI,MAAOvS,EAAX,EAAoCA,CAApC,EAA0E,QAA1E,GAA+C,MAAOA,EAAA,KAAtD,EAAiH,QAAjH,GAAsF,MAAOA,EAAA,KAA7F,CACIuS,CACA,CADWvS,CACX,CAAAA,CAAA,CAAUlM,IAAAA,EACd,OAAOhB,EAAAiiB,SAAA,CAAkBjiB,CAAAkF,SAAAqD,OAAAI,MAAA,CAA+BpC,CAA/B,CAAlB,CAAyD2G,CAAzD,CAAkEuS,CAAlE,CAJ6C,CAiBxDzf,EAAAkiB,gBAAA,CAA2BliB,CAAA+hB,UAc3B/hB;CAAAmiB,cAAA,CAAyBC,QAAQ,CAAC3C,CAAD,CAAWjd,CAAX,CAAqB0K,CAArB,CAA8B,CACvD1K,CAAJ,EAAoC,QAApC,GAAgB,MAAOA,EAAvB,EACI0K,CACA,CADU1K,CACV,CAAAA,CAAA,CAAW,IAFf,EAGUA,CAHV,EAG0C,UAH1C,GAGsB,MAAOA,EAH7B,GAIIA,CAJJ,CAIe,IAJf,CAKA,IAAIA,CAAJ,CACI,MAAOxC,EAAAwB,KAAAa,MAAA,CAAwC,QAApB,GAAA,MAAOod,EAAP,CAA+BA,CAA/B,CAA0CA,CAAA,KAA1C,CAA2D,GAA3D,CAA+DA,CAAA,KAAnF,CAAqG,QAAQ,CAAC5D,CAAD,CAAW,CAC3H,GAAiB,IAAjB,GAAIA,CAAJ,CACIrZ,CAAA,CAASJ,KAAA,CAAM,sBAAN,CAAT,CADJ,KAIA,IAAI,CACAI,CAAA,CAAS,IAAT,CAAexC,CAAA+hB,UAAA,CAAmBlG,CAAnB,CAA6B3O,CAA7B,CAAsCuS,CAAtC,CAAf,CADA,CAEF,MAAOtd,CAAP,CAAU,CACRK,CAAA,CAASL,CAAT,CADQ,CAP+G,CAAxH,CAWX,KAAI0Z,EAAW7b,CAAAwB,KAAAa,MAAA,CAAwC,QAApB,GAAA,MAAOod,EAAP,CAA+BA,CAAA,KAA/B,CAAgD,GAAhD,CAAoDA,CAAA,KAApD,CAAuEA,CAA3F,CACf,OAAoB,KAAb,GAAA5D,CAAA,CAAoB,IAApB,CAA2B7b,CAAA+hB,UAAA,CAAmBlG,CAAnB,CAA6B3O,CAA7B,CAAsCuS,CAAtC,CAnByB,CAmC/Dzf,EAAAqiB,cAAA,CAAyBriB,CAAAmiB,cASzBniB,EAAAsiB,WAAA,CAAsBC,QAAQ,CAACrc,CAAD,CAAU,CACpCA,CAAA,CAAUA,CAAV,EAAqB,EAC8B,YAAnD,GAAI,MAAOA,EAAA,yBAAX,GACIA,CAAA,yBADJ;AAC0ClG,CAAAqB,yBAD1C,CAE4C,YAA5C,GAAI,MAAO6E,EAAA,kBAAX,GACIA,CAAA,kBADJ,CACmClG,CAAAsB,kBADnC,CAEA,OAAO,KAAItB,CAAAyR,QAAJ,CAAqBvL,CAArB,CAN6B,CAkBxClG,EAAAiiB,SAAA,CAAoBO,QAAQ,CAAChD,CAAD,CAAOtS,CAAP,CAAgBuS,CAAhB,CAA0B,CAClD,GAAuB,QAAvB,GAAI,MAAOvS,EAAX,EAAoCA,CAApC,EAA0E,QAA1E,GAA+C,MAAOA,EAAA,KAAtD,EAAiH,QAAjH,GAAsF,MAAOA,EAAA,KAA7F,CACIuS,CACA,CADWvS,CACX,CAAAA,CAAA,CAAU,IACTA,EAAL,EAAmC,QAAnC,GAAgB,MAAOA,EAAvB,GACIA,CADJ,CACclN,CAAAsiB,WAAA,EADd,CAEoB,SAApB,GAAI,MAAO9C,EAAX,GACIA,CADJ,CACW7F,IAAAhR,MAAA,CAAW6W,CAAX,CADX,CAEAtS,EAAA,CAAQ,QAAR,CAAA,CAAkBsS,CAAlB,CAAwBC,CAAxB,CACAvS,EAAA8S,WAAA,EACA,OAAO9S,EAV2C,CAyBtDlN,EAAAyiB,aAAA,CAAwBC,QAAQ,CAACjD,CAAD,CAAWjd,CAAX,CAAqB0K,CAArB,CAA8B,CACtD1K,CAAJ,EAAoC,QAApC,GAAgB,MAAOA,EAAvB,EACI0K,CACA,CADU1K,CACV,CAAAA,CAAA,CAAW,IAFf,EAGUA,CAHV,EAG0C,UAH1C,GAGsB,MAAOA,EAH7B,GAIIA,CAJJ,CAIe,IAJf,CAKA,IAAIA,CAAJ,CACI,MAAOxC,EAAAwB,KAAAa,MAAA,CAAwC,QAApB;AAAA,MAAOod,EAAP,CAA+BA,CAA/B,CAA0CA,CAAA,KAA1C,CAA2D,GAA3D,CAA+DA,CAAA,KAAnF,CAAqG,QAAQ,CAAC5D,CAAD,CAAW,CAC3H,GAAiB,IAAjB,GAAIA,CAAJ,CACIrZ,CAAA,CAASJ,KAAA,CAAM,sBAAN,CAAT,CADJ,KAIA,IAAI,CACAI,CAAA,CAAS,IAAT,CAAexC,CAAAiiB,SAAA,CAAkBtI,IAAAhR,MAAA,CAAWkT,CAAX,CAAlB,CAAwC3O,CAAxC,CAAiDuS,CAAjD,CAAf,CADA,CAEF,MAAOtd,CAAP,CAAU,CACRK,CAAA,CAASL,CAAT,CADQ,CAP+G,CAAxH,CAWX,KAAI0Z,EAAW7b,CAAAwB,KAAAa,MAAA,CAAwC,QAApB,GAAA,MAAOod,EAAP,CAA+BA,CAAA,KAA/B,CAAgD,GAAhD,CAAoDA,CAAA,KAApD,CAAuEA,CAA3F,CACf,OAAoB,KAAb,GAAA5D,CAAA,CAAoB,IAApB,CAA2B7b,CAAAiiB,SAAA,CAAkBtI,IAAAhR,MAAA,CAAWkT,CAAX,CAAlB,CAAwC3O,CAAxC,CAAiDuS,CAAjD,CAnBwB,CAsB9D,OAAOzf,EAjnK+B,CAT1C;", +"sources":[" [synthetic:base] "," [synthetic:util/defineproperty] "," [synthetic:util/global] "," [synthetic:es6/symbol] "," [synthetic:es6/util/iteratorfromarray] "," [synthetic:util/polyfill] "," [synthetic:es6/array/keys] "," [synthetic:es6/array/entries] "," [synthetic:es6/array/values] ","dist/protobuf.js"], +"names":["global","factory","define","require","module","ByteBuffer","isCommonJS","ProtoBuf","Long","VERSION","WIRE_TYPES","VARINT","BITS64","LDELIM","STARTGROUP","ENDGROUP","BITS32","PACKABLE_WIRE_TYPES","TYPES","name","wireType","defaultValue","ZERO","undefined","UZERO","MAP_KEY_TYPES","ID_MIN","ID_MAX","convertFieldsToCamelCase","populateAccessors","populateDefaults","Util","IS_NODE","process","XHR","Util.XHR","XMLHttpFactories","XMLHttpRequest","ActiveXObject","xhr","i","length","e","Error","fetch","Util.fetch","path","callback","fs","readFile","err","data","readFileSync","open","setRequestHeader","overrideMimeType","onreadystatechange","xhr.onreadystatechange","readyState","status","responseText","send","toCamelCase","Util.toCamelCase","str","replace","$0","$1","toUpperCase","Lang","DELIM","RULE","TYPE","NAME","TYPEDEF","TYPEREF","FQTYPEREF","NUMBER","NUMBER_DEC","NUMBER_HEX","NUMBER_OCT","NUMBER_FLT","BOOL","ID","NEGID","WHITESPACE","STRING","STRING_DQ","STRING_SQ","DotProto","mkId","value","mayBeNegative","id","sign","charAt","substring","test","parseInt","mkNumber","val","Infinity","NaN","parseFloat","setOption","options","Array","isArray","push","Tokenizer","proto","source","index","line","stack","_stringOpen","TokenizerPrototype","prototype","_readString","TokenizerPrototype._readString","re","lastIndex","match","exec","next","TokenizerPrototype.next","shift","repeat","prev","end","delim","token","peek","TokenizerPrototype.peek","skip","TokenizerPrototype.skip","expected","actual","omit","TokenizerPrototype.omit","toString","TokenizerPrototype.toString","Parser","tn","proto3","ParserPrototype","parse","ParserPrototype.parse","topLevel","head","weak","_parseMessage","_parseEnum","_parseOption","_parseService","_parseExtend","message","Parser.parse","ParserPrototype._readString","_readValue","ParserPrototype._readValue","mayBeTypeRef","toLowerCase","ParserPrototype._parseOption","parent","isList","custom","_parseOptionValue","ParserPrototype._parseOptionValue","ParserPrototype._parseService","svc","_parseServiceRPC","ParserPrototype._parseServiceRPC","method","ParserPrototype._parseMessage","fld","isGroup","msg","_parseFieldOptions","_parseMessageField","_parseMessageOneOf","hasOwnProperty","concat","_parseExtensionRanges","_parseIgnored","ParserPrototype._parseIgnored","ParserPrototype._parseMessageField","rule","type","grp","ParserPrototype._parseMessageOneOf","fields","ParserPrototype._parseFieldOptions","first","ParserPrototype._parseEnum","enm","ParserPrototype._parseExtensionRanges","ranges","range","ParserPrototype._parseExtend","ext","ParserPrototype.toString","Reflect","mkLong","unsigned","low","high","fromString","fromNumber","skipTillGroupEnd","expectedId","buf","tag","readVarint32","readUint8","offset","T","builder","TPrototype","fqn","TPrototype.fqn","ptr","TPrototype.toString","includeClass","className","build","TPrototype.build","Namespace","syntax","call","children","NamespacePrototype","Object","create","getChildren","NamespacePrototype.getChildren","slice","k","addChild","NamespacePrototype.addChild","child","other","getChild","Message","Field","originalName","NamespacePrototype.getChild","nameOrId","key","resolve","NamespacePrototype.resolve","qn","excludeNonNamespace","part","split","NamespacePrototype.qn","t","unshift","len","join","NamespacePrototype.build","ns","defineProperty","buildOpt","NamespacePrototype.buildOpt","opt","keys","getOption","NamespacePrototype.getOption","Element","resolvedType","isMapKey","indexOf","ElementPrototype","defaultFieldValue","mkDefault","ElementPrototype.toString","verifyValue","ElementPrototype.verifyValue","fail","self","String","isByteBuffer","wrap","values","Enum","Value","clazz","Builder","obj","calculateLength","ElementPrototype.calculateLength","n","calculateVarint64","calculateVarint32","zigZagEncode32","zigZagEncode64","calculateUTF8Bytes","remaining","calculate","encodeValue","ElementPrototype.encodeValue","buffer","writeVarint64","writeVarint32","writeVarint32ZigZag","writeUint32","writeInt32","writeVarint64ZigZag","writeUint64","writeInt64","writeFloat32","writeFloat64","writeVString","prevOffset","append","bb","LE","encode","flip","decode","ElementPrototype.decode","readVarint32ZigZag","readUint32","readInt32","readVarint64","toUnsigned","readVarint64ZigZag","readUint64","readInt64","readFloat","readDouble","readVString","nBytes","clone","limit","valueFromString","ElementPrototype.valueFromString","fromBinary","valueToString","ElementPrototype.valueToString","extensions","_fieldsByName","_fieldsById","_fields","MessagePrototype","MessagePrototype.build","rebuild","cloneRaw","binaryAsBase64","longsAsStrings","getName","object","toBase64","toBuffer","isLong","fromValue","forEach","v","Map","it","entries","done","keyElem","valueElem","$type","field","oneofs","OneOf","var_args","repeated","map","required","arguments","ArrayBuffer","$set","add","MessagePrototype.add","noAssert","$add","set","MessagePrototype.set","keyOrObj","ikey","_oneofsByName","oneof","currentField","get","MessagePrototype.get","$get","ExtensionField","Name","setter","getter","MessagePrototype.encode","noVerify","isNew","le","littleEndian","Message.encode","MessagePrototype.calculate","encodeDelimited","MessagePrototype.encodeDelimited","enc","encodeAB","MessagePrototype.encodeAB","toArrayBuffer","encodeNB","MessagePrototype.encodeNB","encode64","MessagePrototype.encode64","encodeHex","MessagePrototype.encodeHex","toHex","toRaw","MessagePrototype.toRaw","encodeJSON","MessagePrototype.encodeJSON","JSON","stringify","Message.decode","decodeDelimited","Message.decodeDelimited","off","decode64","Message.decode64","decodeHex","Message.decodeHex","decodeJSON","Message.decodeJSON","MessagePrototype.toString","Service","Extension","fieldMissing","MessagePrototype.decode","expectedGroupEndId","start","keyval","keytype","keyType","keyElement","element","FieldPrototype","FieldPrototype.build","FieldPrototype.verifyValue","skipRepeated","res","hasWirePresence","FieldPrototype.hasWirePresence","FieldPrototype.encode","ensureCapacity","varintLen","contents","m","FieldPrototype.calculate","ni","FieldPrototype.decode","wireTypeOK","msgbuf","Enum.getName","EnumPrototype.build","root","ServicePrototype.build","rpcImpl","setTimeout","bind","ServicePrototype","rpc","RPCMethod","req","resolvedRequestType","TypeError","resolvedResponseType","notABuffer","Method","request","response","request_stream","response_stream","requestName","responseName","requestStream","responseStream","propagateSyntax","resolved","result","files","importRoot","BuilderPrototype","isMessage","Builder.isMessage","def","isMessageField","Builder.isMessageField","isEnum","Builder.isEnum","isService","Builder.isService","isExtend","Builder.isExtend","reset","BuilderPrototype.reset","BuilderPrototype.define","namespace","BuilderPrototype.create","defs","pop","subObj","mtd","valid","extension","json","filename","file","fname","resetRoot","importFilename","$2","base","resolveAll","BuilderPrototype.resolveAll","packed","BuilderPrototype.build","lookup","BuilderPrototype.lookup","BuilderPrototype.toString","Builder.Message","Builder.Enum","Builder.Service","arrayIterator","arr","idx","MapPrototype","clear","MapPrototype.clear","keyValue","hadKey","MapPrototype.entries","strKeys","entry","MapPrototype.keys","MapPrototype.values","MapPrototype.forEach","cb","thisArg","MapPrototype.set","valValue","MapPrototype.get","has","MapPrototype.has","loadProto","ProtoBuf.loadProto","loadJson","protoFromString","loadProtoFile","ProtoBuf.loadProtoFile","protoFromFile","newBuilder","ProtoBuf.newBuilder","ProtoBuf.loadJson","loadJsonFile","ProtoBuf.loadJsonFile"] +} diff --git a/legacy-libs/has-unicode/LICENSE b/legacy-libs/has-unicode/LICENSE new file mode 100644 index 0000000..d42e25e --- /dev/null +++ b/legacy-libs/has-unicode/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/legacy-libs/has-unicode/README.md b/legacy-libs/has-unicode/README.md new file mode 100644 index 0000000..5a03e59 --- /dev/null +++ b/legacy-libs/has-unicode/README.md @@ -0,0 +1,43 @@ +has-unicode +=========== + +Try to guess if your terminal supports unicode + +```javascript +var hasUnicode = require("has-unicode") + +if (hasUnicode()) { + // the terminal probably has unicode support +} +``` +```javascript +var hasUnicode = require("has-unicode").tryHarder +hasUnicode(function(unicodeSupported) { + if (unicodeSupported) { + // the terminal probably has unicode support + } +}) +``` + +## Detecting Unicode + +What we actually detect is UTF-8 support, as that's what Node itself supports. +If you have a UTF-16 locale then you won't be detected as unicode capable. + +### Windows + +Since at least Windows 7, `cmd` and `powershell` have been unicode capable, +but unfortunately even then it's not guaranteed. In many localizations it +still uses legacy code pages and there's no facility short of running +programs or linking C++ that will let us detect this. As such, we +report any Windows installation as NOT unicode capable, and recommend +that you encourage your users to override this via config. + +### Unix Like Operating Systems + +We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient +for most POSIX systems. While locale data can be put in `/etc/locale.conf` +as well, AFAIK it's always copied into the environment. + diff --git a/legacy-libs/has-unicode/index.js b/legacy-libs/has-unicode/index.js new file mode 100644 index 0000000..9b0fe44 --- /dev/null +++ b/legacy-libs/has-unicode/index.js @@ -0,0 +1,16 @@ +"use strict" +var os = require("os") + +var hasUnicode = module.exports = function () { + // Recent Win32 platforms (>XP) CAN support unicode in the console but + // don't have to, and in non-english locales often use traditional local + // code pages. There's no way, short of windows system calls or execing + // the chcp command line program to figure this out. As such, we default + // this to false and encourage your users to override it via config if + // appropriate. + if (os.type() == "Windows_NT") { return false } + + var isUTF8 = /UTF-?8$/i + var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG + return isUTF8.test(ctype) +} diff --git a/legacy-libs/has-unicode/package.json b/legacy-libs/has-unicode/package.json new file mode 100644 index 0000000..ec290a1 --- /dev/null +++ b/legacy-libs/has-unicode/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "has-unicode@^2.0.0", + "scope": null, + "escapedName": "has-unicode", + "name": "has-unicode", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/gauge" + ] + ], + "_from": "has-unicode@>=2.0.0 <3.0.0", + "_id": "has-unicode@2.0.1", + "_inCache": true, + "_location": "/has-unicode", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/has-unicode-2.0.1.tgz_1466719828333_0.48896647873334587" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.10.2", + "_phantomChildren": {}, + "_requested": { + "raw": "has-unicode@^2.0.0", + "scope": null, + "escapedName": "has-unicode", + "name": "has-unicode", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gauge" + ], + "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "_shasum": "e0e6fe6a28cf51138855e086d1691e771de2a8b9", + "_shrinkwrap": null, + "_spec": "has-unicode@^2.0.0", + "_where": "/var/opt/motion2/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/has-unicode/issues" + }, + "dependencies": {}, + "description": "Try to guess if your terminal supports unicode", + "devDependencies": { + "require-inject": "^1.3.0", + "tap": "^2.3.1" + }, + "directories": {}, + "dist": { + "shasum": "e0e6fe6a28cf51138855e086d1691e771de2a8b9", + "tarball": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "0a05df154e8d89a7fb9798da60b68c78c2df6646", + "homepage": "https://github.com/iarna/has-unicode", + "keywords": [ + "unicode", + "terminal" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "has-unicode", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/has-unicode.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.0.1" +} diff --git a/legacy-libs/npmlog/CHANGELOG.md b/legacy-libs/npmlog/CHANGELOG.md new file mode 100644 index 0000000..51e4abc --- /dev/null +++ b/legacy-libs/npmlog/CHANGELOG.md @@ -0,0 +1,49 @@ +### v4.0.2 + +* Added installation instructions. + +### v4.0.1 + +* Fix bugs where `log.progressEnabled` got out of sync with how `gauge` kept + track of these things resulting in a progressbar that couldn't be disabled. + +### v4.0.0 + +* Allow creating log levels that are an empty string or 0. + +### v3.1.2 + +* Update to `gauge@1.6.0` adding support for default values for template + items. + +### v3.1.1 + +* Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to + when a progress bar is enabled. In `1.x` if you didn't have a TTY the + progress bar was never shown. In `2.x` it merely defaults to disabled, + but you can enable it explicitly if you still want progress updates. + +### v3.1.0 + +* Update to `gauge@2.5.2`: + * Updates the `signal-exit` dependency which fixes an incompatibility with + the node profiler. + * Uses externalizes its ansi code generation in `console-control-strings` +* Make the default progress bar include the last line printed, colored as it + would be when printing to a tty. + +### v3.0.0 + +* Switch to `gauge@2.0.0`, for better performance, better look. +* Set stderr/stdout blocking if they're tty's, so that we can hide a + progress bar going to stderr and then safely print to stdout. Without + this the two can end up overlapping producing confusing and sometimes + corrupted output. + +### v2.0.0 + +* Make the `error` event non-fatal so that folks can use it as a prefix. + +### v1.0.0 + +* Add progress bar with `gauge@1.1.0` diff --git a/legacy-libs/npmlog/LICENSE b/legacy-libs/npmlog/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/legacy-libs/npmlog/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/npmlog/README.md b/legacy-libs/npmlog/README.md new file mode 100644 index 0000000..268a4af --- /dev/null +++ b/legacy-libs/npmlog/README.md @@ -0,0 +1,216 @@ +# npmlog + +The logger util that npm uses. + +This logger is very basic. It does the logging for npm. It supports +custom levels and colored output. + +By default, logs are written to stderr. If you want to send log messages +to outputs other than streams, then you can change the `log.stream` +member, or you can just listen to the events that it emits, and do +whatever you want with them. + +# Installation + +```console +npm install npmlog --save +``` + +# Basic Usage + +```javascript +var log = require('npmlog') + +// additional stuff ---------------------------+ +// message ----------+ | +// prefix ----+ | | +// level -+ | | | +// v v v v + log.info('fyi', 'I have a kitty cat: %j', myKittyCat) +``` + +## log.level + +* {String} + +The level to display logs at. Any logs at or above this level will be +displayed. The special level `silent` will prevent anything from being +displayed ever. + +## log.record + +* {Array} + +An array of all the log messages that have been entered. + +## log.maxRecordSize + +* {Number} + +The maximum number of records to keep. If log.record gets bigger than +10% over this value, then it is sliced down to 90% of this value. + +The reason for the 10% window is so that it doesn't have to resize a +large array on every log entry. + +## log.prefixStyle + +* {Object} + +A style object that specifies how prefixes are styled. (See below) + +## log.headingStyle + +* {Object} + +A style object that specifies how the heading is styled. (See below) + +## log.heading + +* {String} Default: "" + +If set, a heading that is printed at the start of every line. + +## log.stream + +* {Stream} Default: `process.stderr` + +The stream where output is written. + +## log.enableColor() + +Force colors to be used on all messages, regardless of the output +stream. + +## log.disableColor() + +Disable colors on all messages. + +## log.enableProgress() + +Enable the display of log activity spinner and progress bar + +## log.disableProgress() + +Disable the display of a progress bar + +## log.enableUnicode() + +Force the unicode theme to be used for the progress bar. + +## log.disableUnicode() + +Disable the use of unicode in the progress bar. + +## log.setGaugeTemplate(template) + +Set a template for outputting the progress bar. See the [gauge documentation] for details. + +[gauge documentation]: https://npmjs.com/package/gauge + +## log.setGaugeThemeset(themes) + +Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details. + +## log.pause() + +Stop emitting messages to the stream, but do not drop them. + +## log.resume() + +Emit all buffered messages that were written while paused. + +## log.log(level, prefix, message, ...) + +* `level` {String} The level to emit the message at +* `prefix` {String} A string prefix. Set to "" to skip. +* `message...` Arguments to `util.format` + +Emit a log message at the specified level. + +## log\[level](prefix, message, ...) + +For example, + +* log.silly(prefix, message, ...) +* log.verbose(prefix, message, ...) +* log.info(prefix, message, ...) +* log.http(prefix, message, ...) +* log.warn(prefix, message, ...) +* log.error(prefix, message, ...) + +Like `log.log(level, prefix, message, ...)`. In this way, each level is +given a shorthand, so you can do `log.info(prefix, message)`. + +## log.addLevel(level, n, style, disp) + +* `level` {String} Level indicator +* `n` {Number} The numeric level +* `style` {Object} Object with fg, bg, inverse, etc. +* `disp` {String} Optional replacement for `level` in the output. + +Sets up a new level with a shorthand function and so forth. + +Note that if the number is `Infinity`, then setting the level to that +will cause all log messages to be suppressed. If the number is +`-Infinity`, then the only way to show it is to enable all log messages. + +## log.newItem(name, todo, weight) + +* `name` {String} Optional; progress item name. +* `todo` {Number} Optional; total amount of work to be done. Default 0. +* `weight` {Number} Optional; the weight of this item relative to others. Default 1. + +This adds a new `are-we-there-yet` item tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `Tracker` object. + +## log.newStream(name, todo, weight) + +This adds a new `are-we-there-yet` stream tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerStream` object. + +## log.newGroup(name, weight) + +This adds a new `are-we-there-yet` tracker group to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerGroup` object. + +# Events + +Events are all emitted with the message object. + +* `log` Emitted for all messages +* `log.` Emitted for all messages with the `` level. +* `` Messages with prefixes also emit their prefix as an event. + +# Style Objects + +Style objects can have the following fields: + +* `fg` {String} Color for the foreground text +* `bg` {String} Color for the background +* `bold`, `inverse`, `underline` {Boolean} Set the associated property +* `bell` {Boolean} Make a noise (This is pretty annoying, probably.) + +# Message Objects + +Every log event is emitted with a message object, and the `log.record` +list contains all of them that have been created. They have the +following fields: + +* `id` {Number} +* `level` {String} +* `prefix` {String} +* `message` {String} Result of `util.format()` +* `messageRaw` {Array} Arguments to `util.format()` + +# Blocking TTYs + +We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set +stderr and stdout blocking if they are tty's and have the setBlocking call. +This is a work around for an issue in early versions of Node.js 6.x, which +made stderr and stdout non-blocking on OSX. (They are always blocking +Windows and were never blocking on Linux.) `npmlog` needs them to be blocking +so that it can allow output to stdout and stderr to be interlaced. diff --git a/legacy-libs/npmlog/log.js b/legacy-libs/npmlog/log.js new file mode 100644 index 0000000..341f331 --- /dev/null +++ b/legacy-libs/npmlog/log.js @@ -0,0 +1,309 @@ +'use strict' +var Progress = require('are-we-there-yet') +var Gauge = require('gauge') +var EE = require('events').EventEmitter +var log = exports = module.exports = new EE() +var util = require('util') + +var setBlocking = require('set-blocking') +var consoleControl = require('console-control-strings') + +setBlocking(true) +var stream = process.stderr +Object.defineProperty(log, 'stream', { + set: function (newStream) { + stream = newStream + if (this.gauge) this.gauge.setWriteTo(stream, stream) + }, + get: function () { + return stream + } +}) + +// by default, decide based on tty-ness. +var colorEnabled +log.useColor = function () { + return colorEnabled != null ? colorEnabled : stream.isTTY +} + +log.enableColor = function () { + colorEnabled = true + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} +log.disableColor = function () { + colorEnabled = false + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} + +// default level +log.level = 'info' + +log.gauge = new Gauge(stream, { + enabled: false, // no progress bars unless asked + theme: {hasColor: log.useColor()}, + template: [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', default: ''}, + ':', + {type: 'logline', kerning: 1, default: ''} + ] +}) + +log.tracker = new Progress.TrackerGroup() + +// we track this separately as we may need to temporarily disable the +// display of the status bar for our own loggy purposes. +log.progressEnabled = log.gauge.isEnabled() + +var unicodeEnabled + +log.enableUnicode = function () { + unicodeEnabled = true + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.disableUnicode = function () { + unicodeEnabled = false + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.setGaugeThemeset = function (themes) { + this.gauge.setThemeset(themes) +} + +log.setGaugeTemplate = function (template) { + this.gauge.setTemplate(template) +} + +log.enableProgress = function () { + if (this.progressEnabled) return + this.progressEnabled = true + this.tracker.on('change', this.showProgress) + if (this._pause) return + this.gauge.enable() +} + +log.disableProgress = function () { + if (!this.progressEnabled) return + this.progressEnabled = false + this.tracker.removeListener('change', this.showProgress) + this.gauge.disable() +} + +var trackerConstructors = ['newGroup', 'newItem', 'newStream'] + +var mixinLog = function (tracker) { + // mixin the public methods from log into the tracker + // (except: conflicts and one's we handle specially) + Object.keys(log).forEach(function (P) { + if (P[0] === '_') return + if (trackerConstructors.filter(function (C) { return C === P }).length) return + if (tracker[P]) return + if (typeof log[P] !== 'function') return + var func = log[P] + tracker[P] = function () { + return func.apply(log, arguments) + } + }) + // if the new tracker is a group, make sure any subtrackers get + // mixed in too + if (tracker instanceof Progress.TrackerGroup) { + trackerConstructors.forEach(function (C) { + var func = tracker[C] + tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) } + }) + } + return tracker +} + +// Add tracker constructors to the top level log object +trackerConstructors.forEach(function (C) { + log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } +}) + +log.clearProgress = function (cb) { + if (!this.progressEnabled) return cb && process.nextTick(cb) + this.gauge.hide(cb) +} + +log.showProgress = function (name, completed) { + if (!this.progressEnabled) return + var values = {} + if (name) values.section = name + var last = log.record[log.record.length - 1] + if (last) { + values.subsection = last.prefix + var disp = log.disp[last.level] || last.level + var logline = this._format(disp, log.style[last.level]) + if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle) + logline += ' ' + last.message.split(/\r?\n/)[0] + values.logline = logline + } + values.completed = completed || this.tracker.completed() + this.gauge.show(values) +}.bind(log) // bind for use in tracker's on-change listener + +// temporarily stop emitting, but don't drop +log.pause = function () { + this._paused = true + if (this.progressEnabled) this.gauge.disable() +} + +log.resume = function () { + if (!this._paused) return + this._paused = false + + var b = this._buffer + this._buffer = [] + b.forEach(function (m) { + this.emitLog(m) + }, this) + if (this.progressEnabled) this.gauge.enable() +} + +log._buffer = [] + +var id = 0 +log.record = [] +log.maxRecordSize = 10000 +log.log = function (lvl, prefix, message) { + var l = this.levels[lvl] + if (l === undefined) { + return this.emit('error', new Error(util.format( + 'Undefined log level: %j', lvl))) + } + + var a = new Array(arguments.length - 2) + var stack = null + for (var i = 2; i < arguments.length; i++) { + var arg = a[i - 2] = arguments[i] + + // resolve stack traces to a plain string. + if (typeof arg === 'object' && arg && + (arg instanceof Error) && arg.stack) { + + Object.defineProperty(arg, 'stack', { + value: stack = arg.stack + '', + enumerable: true, + writable: true + }) + } + } + if (stack) a.unshift(stack + '\n') + message = util.format.apply(util, a) + + var m = { id: id++, + level: lvl, + prefix: String(prefix || ''), + message: message, + messageRaw: a } + + this.emit('log', m) + this.emit('log.' + lvl, m) + if (m.prefix) this.emit(m.prefix, m) + + this.record.push(m) + var mrs = this.maxRecordSize + var n = this.record.length - mrs + if (n > mrs / 10) { + var newSize = Math.floor(mrs * 0.9) + this.record = this.record.slice(-1 * newSize) + } + + this.emitLog(m) +}.bind(log) + +log.emitLog = function (m) { + if (this._paused) { + this._buffer.push(m) + return + } + if (this.progressEnabled) this.gauge.pulse(m.prefix) + var l = this.levels[m.level] + if (l === undefined) return + if (l < this.levels[this.level]) return + if (l > 0 && !isFinite(l)) return + + // If 'disp' is null or undefined, use the lvl as a default + // Allows: '', 0 as valid disp + var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level + this.clearProgress() + m.message.split(/\r?\n/).forEach(function (line) { + if (this.heading) { + this.write(this.heading, this.headingStyle) + this.write(' ') + } + this.write(disp, log.style[m.level]) + var p = m.prefix || '' + if (p) this.write(' ') + this.write(p, this.prefixStyle) + this.write(' ' + line + '\n') + }, this) + this.showProgress() +} + +log._format = function (msg, style) { + if (!stream) return + + var output = '' + if (this.useColor()) { + style = style || {} + var settings = [] + if (style.fg) settings.push(style.fg) + if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) + if (style.bold) settings.push('bold') + if (style.underline) settings.push('underline') + if (style.inverse) settings.push('inverse') + if (settings.length) output += consoleControl.color(settings) + if (style.beep) output += consoleControl.beep() + } + output += msg + if (this.useColor()) { + output += consoleControl.color('reset') + } + return output +} + +log.write = function (msg, style) { + if (!stream) return + + stream.write(this._format(msg, style)) +} + +log.addLevel = function (lvl, n, style, disp) { + // If 'disp' is null or undefined, use the lvl as a default + if (disp == null) disp = lvl + this.levels[lvl] = n + this.style[lvl] = style + if (!this[lvl]) { + this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i++) { + a[i + 1] = arguments[i] + } + return this.log.apply(this, a) + }.bind(this) + } + this.disp[lvl] = disp +} + +log.prefixStyle = { fg: 'magenta' } +log.headingStyle = { fg: 'white', bg: 'black' } + +log.style = {} +log.levels = {} +log.disp = {} +log.addLevel('silly', -Infinity, { inverse: true }, 'sill') +log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb') +log.addLevel('info', 2000, { fg: 'green' }) +log.addLevel('timing', 2500, { fg: 'green', bg: 'black' }) +log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) +log.addLevel('notice', 3500, { fg: 'blue', bg: 'black' }) +log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') +log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') +log.addLevel('silent', Infinity) + +// allow 'error' prefix +log.on('error', function () {}) diff --git a/legacy-libs/npmlog/package.json b/legacy-libs/npmlog/package.json new file mode 100644 index 0000000..9e2f317 --- /dev/null +++ b/legacy-libs/npmlog/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + { + "raw": "npmlog@^4.0.0", + "scope": null, + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-sass" + ] + ], + "_from": "npmlog@>=4.0.0 <5.0.0", + "_id": "npmlog@4.1.2", + "_inCache": true, + "_location": "/npmlog", + "_nodeVersion": "8.1.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/npmlog-4.1.2.tgz_1498519394438_0.33615764300338924" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "5.0.4", + "_phantomChildren": {}, + "_requested": { + "raw": "npmlog@^4.0.0", + "scope": null, + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp", + "/node-sass" + ], + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "_shasum": "08a7f2a8bf734604779a9efa4ad5cc717abb954b", + "_shrinkwrap": null, + "_spec": "npmlog@^4.0.0", + "_where": "/var/opt/motion2/node_modules/node-sass", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/npmlog/issues" + }, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + }, + "description": "logger for npm", + "devDependencies": { + "standard": "~7.1.2", + "tap": "~5.7.3" + }, + "directories": {}, + "dist": { + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "shasum": "08a7f2a8bf734604779a9efa4ad5cc717abb954b", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" + }, + "files": [ + "log.js" + ], + "gitHead": "f7f9516d35b873c4e45b1aaeb78cff4e43b72c31", + "homepage": "https://github.com/npm/npmlog#readme", + "license": "ISC", + "main": "log.js", + "maintainers": [ + { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "npmlog", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npmlog.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "4.1.2" +} diff --git a/legacy-libs/protobufjs/dist/README.md b/legacy-libs/protobufjs/dist/README.md new file mode 100644 index 0000000..93a54cc --- /dev/null +++ b/legacy-libs/protobufjs/dist/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the full library. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/legacy-libs/protobufjs/dist/light/README.md b/legacy-libs/protobufjs/dist/light/README.md new file mode 100644 index 0000000..2122c3f --- /dev/null +++ b/legacy-libs/protobufjs/dist/light/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the light library suitable for use with reflection, static code and JSON descriptors / modules. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/legacy-libs/protobufjs/dist/light/protobuf.js b/legacy-libs/protobufjs/dist/light/protobuf.js new file mode 100644 index 0000000..7769f81 --- /dev/null +++ b/legacy-libs/protobufjs/dist/light/protobuf.js @@ -0,0 +1,7310 @@ +/*! + * protobuf.js v6.10.0 (c) 2016, daniel wirtz + * compiled wed, 15 jul 2020 23:34:13 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +},{}],4:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = fetch; + +var asPromise = require(1), + inquire = require(7); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + +},{"1":1,"7":7}],6:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],7:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],8:[function(require,module,exports){ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + +},{}],9:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],10:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],11:[function(require,module,exports){ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require(14), + util = require(33); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(d%s){", prop); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=d%s>>>0", prop, prop); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=d%s|0", prop, prop); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) + ("else if(typeof d%s===\"string\")", prop) + ("m%s=parseInt(d%s,10)", prop, prop) + ("else if(typeof d%s===\"number\")", prop) + ("m%s=d%s", prop, prop) + ("else if(typeof d%s===\"object\")", prop) + ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof d%s===\"string\")", prop) + ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) + ("else if(d%s.length)", prop) + ("m%s=d%s", prop, prop); + break; + case "string": gen + ("m%s=String(d%s)", prop, prop); + break; + case "bool": gen + ("m%s=Boolean(d%s)", prop, prop); + break; + /* default: gen + ("m%s=d%s", prop, prop); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("var c2 = r.uint32()+r.pos"); + + if (types.defaults[field.keyType] !== undefined) gen + ("k=%j", types.defaults[field.keyType]); + else gen + ("k=null"); + + if (types.defaults[type] !== undefined) gen + ("value=%j", types.defaults[type]); + else gen + ("value=null"); + + gen + ("while(r.pos>>3){") + ("case 1: k=r.%s(); break", field.keyType) + ("case 2:"); + + if (types.basic[type] === undefined) gen + ("value=types[%i].decode(r,r.uint32())", i); // can't be groups + else gen + ("value=r.%s()", type); + + gen + ("break") + ("default:") + ("r.skipType(tag2&7)") + ("break") + ("}") + ("}"); + + if (types.long[field.keyType] !== undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); + else gen + ("%s[k]=value", ref); + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) + : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { gen + ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null + + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", ref) + ("w.%s(%s[i])", type, ref) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", ref); + if (wireType === undefined) + genTypePartial(gen, field, index, ref + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +},{"14":14,"32":32,"33":33}],14:[function(require,module,exports){ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require(21), + util = require(33); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +},{"21":21,"22":22,"33":33}],15:[function(require,module,exports){ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require(14), + types = require(32), + util = require(33); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; + +},{"14":14,"22":22,"32":32,"33":33}],16:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(17); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require(13); +protobuf.decoder = require(12); +protobuf.verifier = require(36); +protobuf.converter = require(11); + +// Reflection +protobuf.ReflectionObject = require(22); +protobuf.Namespace = require(21); +protobuf.Root = require(26); +protobuf.Enum = require(14); +protobuf.Type = require(31); +protobuf.Field = require(15); +protobuf.OneOf = require(23); +protobuf.MapField = require(18); +protobuf.Service = require(30); +protobuf.Method = require(20); + +// Runtime +protobuf.Message = require(19); +protobuf.wrappers = require(37); + +// Utility +protobuf.types = require(32); +protobuf.util = require(33); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"36":36,"37":37}],17:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(38); +protobuf.BufferWriter = require(39); +protobuf.Reader = require(24); +protobuf.BufferReader = require(25); + +// Utility +protobuf.util = require(35); +protobuf.rpc = require(28); +protobuf.roots = require(27); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); +} + +// Set up buffer utility according to the environment +configure(); + +},{"24":24,"25":25,"27":27,"28":28,"35":35,"38":38,"39":39}],18:[function(require,module,exports){ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require(15); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require(32), + util = require(33); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; + +},{"15":15,"32":32,"33":33}],19:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +var util = require(35); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ +},{"35":35}],20:[function(require,module,exports){ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require(33); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; + +},{"22":22,"33":33}],21:[function(require,module,exports){ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require(15), + util = require(33); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; + +},{"15":15,"22":22,"33":33}],22:[function(require,module,exports){ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require(33); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Parsed Options. + * @type {Array.>|undefined} + */ + this.parsedOptions = null; + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets a parsed option. + * @param {string} name parsed Option name + * @param {*} value Option value + * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { + if (!this.parsedOptions) { + this.parsedOptions = []; + } + var parsedOptions = this.parsedOptions; + if (propName) { + // If setting a sub property of an option then try to merge it + // with an existing option + var opt = parsedOptions.find(function (opt) { + return Object.prototype.hasOwnProperty.call(opt, name); + }); + if (opt) { + // If we found an existing option - just merge the property value + var newValue = opt[name]; + util.setProperty(newValue, propName, value); + } else { + // otherwise, create a new option, set it's property and add it to the list + opt = {}; + opt[name] = util.setProperty({}, propName, value); + parsedOptions.push(opt); + } + } else { + // Always create a new option when setting the value of the option itself + var newOpt = {}; + newOpt[name] = value; + parsedOptions.push(newOpt); + } + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; + +},{"33":33}],23:[function(require,module,exports){ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require(22); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require(15), + util = require(33); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; + +},{"15":15,"22":22,"33":33}],24:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(35); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +var create = function create() { + return util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; +}; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = create(); + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"35":35}],25:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(24); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(35); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +BufferReader._configure = function () { + /* istanbul ignore else */ + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; +}; + + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice + ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) + : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +BufferReader._configure(); + +},{"24":24,"35":35}],26:[function(require,module,exports){ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require(21); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require(15), + Enum = require(14), + OneOf = require(23), + util = require(33); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +/** + * Fetch content from file path or url + * This method exists so you can override it with your own logic. + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.fetch = util.fetch; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Bundled definition existence checking + function getBundledFileName(filename) { + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) return altname; + } + return null; + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + self.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; + +},{"14":14,"15":15,"21":21,"23":23,"33":33}],27:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],28:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(29); + +},{"29":29}],29:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(35); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"35":35}],30:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require(21); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require(20), + util = require(33), + rpc = require(28); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; + +},{"20":20,"21":21,"28":28,"33":33}],31:[function(require,module,exports){ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require(21); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require(14), + OneOf = require(23), + Field = require(15), + MapField = require(18), + Service = require(30), + Message = require(19), + Reader = require(24), + Writer = require(38), + util = require(33), + encoder = require(13), + decoder = require(12), + verifier = require(36), + converter = require(11), + wrappers = require(37); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"36":36,"37":37,"38":38}],32:[function(require,module,exports){ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require(33); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); + +},{"33":33}],33:[function(require,module,exports){ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require(35); + +var roots = require(27); + +var Type, // cyclic + Enum; + +util.codegen = require(3); +util.fetch = require(5); +util.path = require(8); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require(31); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require(14); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + + +/** + * Sets the value of a property by property path. If a value already exists, it is turned to an array + * @param {Object.} dst Destination object + * @param {string} path dot '.' delimited path of the property to set + * @param {Object} value the value to set + * @returns {Object.} Destination object + */ +util.setProperty = function setProperty(dst, path, value) { + function setProp(dst, path, value) { + var part = path.shift(); + if (path.length > 0) { + dst[part] = setProp(dst[part] || {}, path, value); + } else { + var prevValue = dst[part]; + if (prevValue) + value = [].concat(prevValue).concat(value); + dst[part] = value; + } + return dst; + } + + if (typeof dst !== "object") + throw TypeError("dst must be an object"); + if (!path) + throw TypeError("path must be specified"); + + path = path.split("."); + return setProp(dst, path, value); +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require(26))()); + } +}); + +},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"5":5,"8":8}],34:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(35); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"35":35}],35:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(4); + +// float handling accross browsers +util.float = require(6); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(7); + +// converts to / from utf8 encoded strings +util.utf8 = require(10); + +// provides a node-like buffer pool in the browser +util.pool = require(9); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(34); + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + */ +util.isNode = Boolean(typeof global !== "undefined" + && global + && global.process + && global.process.versions + && global.process.versions.node); + +/** + * Global object reference. + * @memberof util + * @type {Object} + */ +util.global = util.isNode && global + || typeof window !== "undefined" && window + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"10":10,"2":2,"34":34,"4":4,"6":6,"7":7,"9":9}],36:[function(require,module,exports){ +"use strict"; +module.exports = verifier; + +var Enum = require(14), + util = require(33); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require(19); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + // Only use fully qualified type name after the last '/' + var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + if (type_url.indexOf("/") === -1) { + type_url = "/" + type_url; + } + return this.create({ + type_url: type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // Default prefix + var googleApi = "type.googleapis.com/"; + var prefix = ""; + var name = ""; + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + // Separate the prefix used + prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + var messageName = message.$type.fullName[0] === "." ? + message.$type.fullName.substr(1) : message.$type.fullName; + // Default to type.googleapis.com prefix if no prefix is used + if (prefix === "") { + prefix = googleApi; + } + name = prefix + messageName; + object["@type"] = name; + return object; + } + + return this.toObject(message, options); + } +}; + +},{"19":19}],38:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(35); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +var create = function create() { + return util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; +}; + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = create(); + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); +}; + +},{"35":35}],39:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(38); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(35); + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +BufferWriter._configure = function () { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter.alloc = util._Buffer_allocUnsafe; + + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; +}; + + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +BufferWriter._configure(); + +},{"35":35,"38":38}]},{},[16]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/legacy-libs/protobufjs/dist/light/protobuf.js.map b/legacy-libs/protobufjs/dist/light/protobuf.js.map new file mode 100644 index 0000000..f6538ed --- /dev/null +++ b/legacy-libs/protobufjs/dist/light/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light","../src/index-minimal.js","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(14),\n util = require(33);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(d%s){\", prop);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=d%s>>>0\", prop, prop);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=d%s|0\", prop, prop);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\n (\"m%s=parseInt(d%s,10)\", prop, prop)\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\n (\"m%s=d%s\", prop, prop)\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof d%s===\\\"string\\\")\", prop)\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n (\"else if(d%s.length)\", prop)\n (\"m%s=d%s\", prop, prop);\n break;\n case \"string\": gen\n (\"m%s=String(d%s)\", prop, prop);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(d%s)\", prop, prop);\n break;\n /* default: gen\n (\"m%s=d%s\", prop, prop);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"var c2 = r.uint32()+r.pos\");\n\n if (types.defaults[field.keyType] !== undefined) gen\n (\"k=%j\", types.defaults[field.keyType]);\n else gen\n (\"k=null\");\n\n if (types.defaults[type] !== undefined) gen\n (\"value=%j\", types.defaults[type]);\n else gen\n (\"value=null\");\n\n gen\n (\"while(r.pos>>3){\")\n (\"case 1: k=r.%s(); break\", field.keyType)\n (\"case 2:\");\n\n if (types.basic[type] === undefined) gen\n (\"value=types[%i].decode(r,r.uint32())\", i); // can't be groups\n else gen\n (\"value=r.%s()\", type);\n\n gen\n (\"break\")\n (\"default:\")\n (\"r.skipType(tag2&7)\")\n (\"break\")\n (\"}\")\n (\"}\");\n\n if (types.long[field.keyType] !== undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=value\", ref);\n else gen\n (\"%s[k]=value\", ref);\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) { gen\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\n\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", ref)\n (\"w.%s(%s[i])\", type, ref)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", ref);\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(21),\n util = require(33);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(14),\n types = require(32),\n util = require(33);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(13);\nprotobuf.decoder = require(12);\nprotobuf.verifier = require(36);\nprotobuf.converter = require(11);\n\n// Reflection\nprotobuf.ReflectionObject = require(22);\nprotobuf.Namespace = require(21);\nprotobuf.Root = require(26);\nprotobuf.Enum = require(14);\nprotobuf.Type = require(31);\nprotobuf.Field = require(15);\nprotobuf.OneOf = require(23);\nprotobuf.MapField = require(18);\nprotobuf.Service = require(30);\nprotobuf.Method = require(20);\n\n// Runtime\nprotobuf.Message = require(19);\nprotobuf.wrappers = require(37);\n\n// Utility\nprotobuf.types = require(32);\nprotobuf.util = require(33);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(38);\nprotobuf.BufferWriter = require(39);\nprotobuf.Reader = require(24);\nprotobuf.BufferReader = require(25);\n\n// Utility\nprotobuf.util = require(35);\nprotobuf.rpc = require(28);\nprotobuf.roots = require(27);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(15);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(32),\n util = require(33);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(35);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(33);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(15),\n util = require(33);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(33);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Parsed Options.\n * @type {Array.>|undefined}\n */\n this.parsedOptions = null;\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets a parsed option.\n * @param {string} name parsed Option name\n * @param {*} value Option value\n * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {\n if (!this.parsedOptions) {\n this.parsedOptions = [];\n }\n var parsedOptions = this.parsedOptions;\n if (propName) {\n // If setting a sub property of an option then try to merge it\n // with an existing option\n var opt = parsedOptions.find(function (opt) {\n return Object.prototype.hasOwnProperty.call(opt, name);\n });\n if (opt) {\n // If we found an existing option - just merge the property value\n var newValue = opt[name];\n util.setProperty(newValue, propName, value);\n } else {\n // otherwise, create a new option, set it's property and add it to the list\n opt = {};\n opt[name] = util.setProperty({}, propName, value);\n parsedOptions.push(opt);\n }\n } else {\n // Always create a new option when setting the value of the option itself\n var newOpt = {};\n newOpt[name] = value;\n parsedOptions.push(newOpt);\n }\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(15),\n util = require(33);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(35);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(24);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(35);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(21);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(15),\n Enum = require(14),\n OneOf = require(23),\n util = require(33);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(29);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(35);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(21);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(20),\n util = require(33),\n rpc = require(28);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(21);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(14),\n OneOf = require(23),\n Field = require(15),\n MapField = require(18),\n Service = require(30),\n Message = require(19),\n Reader = require(24),\n Writer = require(38),\n util = require(33),\n encoder = require(13),\n decoder = require(12),\n verifier = require(36),\n converter = require(11),\n wrappers = require(37);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(33);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(35);\n\nvar roots = require(27);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(31);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(14);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n\n/**\n * Sets the value of a property by property path. If a value already exists, it is turned to an array\n * @param {Object.} dst Destination object\n * @param {string} path dot '.' delimited path of the property to set\n * @param {Object} value the value to set\n * @returns {Object.} Destination object\n */\nutil.setProperty = function setProperty(dst, path, value) {\n function setProp(dst, path, value) {\n var part = path.shift();\n if (path.length > 0) {\n dst[part] = setProp(dst[part] || {}, path, value);\n } else {\n var prevValue = dst[part];\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n dst[part] = value;\n }\n return dst;\n }\n\n if (typeof dst !== \"object\")\n throw TypeError(\"dst must be an object\");\n if (!path)\n throw TypeError(\"path must be specified\");\n\n path = path.split(\".\");\n return setProp(dst, path, value);\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(26))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(35);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(34);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(14),\n util = require(33);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(19);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n // Only use fully qualified type name after the last '/'\n var name = object[\"@type\"].substring(object[\"@type\"].lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n if (type_url.indexOf(\"/\") === -1) {\n type_url = \"/\" + type_url;\n }\n return this.create({\n type_url: type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // Default prefix\n var googleApi = \"type.googleapis.com/\";\n var prefix = \"\";\n var name = \"\";\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n // Separate the prefix used\n prefix = message.type_url.substring(0, message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n var messageName = message.$type.fullName[0] === \".\" ?\n message.$type.fullName.substr(1) : message.$type.fullName;\n // Default to type.googleapis.com prefix if no prefix is used\n if (prefix === \"\") {\n prefix = googleApi;\n }\n name = prefix + messageName;\n object[\"@type\"] = name;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(35);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(38);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(35);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/legacy-libs/protobufjs/dist/light/protobuf.min.js b/legacy-libs/protobufjs/dist/light/protobuf.min.js new file mode 100644 index 0000000..cefb63d --- /dev/null +++ b/legacy-libs/protobufjs/dist/light/protobuf.min.js @@ -0,0 +1,8 @@ +/*! + * protobuf.js v6.10.0 (c) 2016, daniel wirtz + * compiled wed, 15 jul 2020 23:34:14 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +!function(g){"use strict";var r,e,t,i;r={1:[function(t,i){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&f)<<4,o=1;break;case 1:s[u++]=h[r|f>>4],r=(15&f)<<2,o=2;break;case 2:s[u++]=h[r|f>>6],s[u++]=h[63&f],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(c);return n-e},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i){function a(i,n){"string"==typeof i&&(n=i,i=g);var f=[];function h(t){if("string"!=typeof t){var i=c();if(a.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0,n,r);else if(i<11754943508222875e-54)t((e<<31|Math.round(i/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(i)/Math.LN2);t((e<<31|127+s<<23|8388607&Math.round(i*Math.pow(2,-s)*8388608))>>>0,n,r)}}function n(t,i,n){var r=t(i,n),e=2*(r>>31)+1,s=r>>>23&255,u=8388607&r;return 255==s?u?NaN:1/0*e:0==s?1401298464324817e-60*e*u:e*Math.pow(2,s-150)*(8388608+u)}function r(t,i,n){o[0]=t,i[n]=f[0],i[n+1]=f[1],i[n+2]=f[2],i[n+3]=f[3]}function e(t,i,n){o[0]=t,i[n]=f[3],i[n+1]=f[2],i[n+2]=f[1],i[n+3]=f[0]}function s(t,i){return f[0]=t[i],f[1]=t[i+1],f[2]=t[i+2],f[3]=t[i+3],o[0]}function u(t,i){return f[3]=t[i],f[2]=t[i+1],f[1]=t[i+2],f[0]=t[i+3],o[0]}var o,f,h,c,a,l;function v(t,i,n,r,e,s){var u=r<0?1:0;if(u&&(r=-r),0===r)t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n);else if(isNaN(r))t(0,e,s+i),t(2146959360,e,s+n);else if(17976931348623157e292>>0,e,s+n);else{var o;if(r<22250738585072014e-324)t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(o=r*Math.pow(2,-f))>>>0,e,s+i),t((u<<31|f+1023<<20|1048576*o&1048575)>>>0,e,s+n)}}}function d(t,i,n,r,e){var s=t(r,e+i),u=t(r,e+n),o=2*(u>>31)+1,f=u>>>20&2047,h=4294967296*(1048575&u)+s;return 2047==f?h?NaN:1/0*o:0==f?5e-324*o*h:o*Math.pow(2,f-1075)*(h+4503599627370496)}function b(t,i,n){c[0]=t,i[n]=a[0],i[n+1]=a[1],i[n+2]=a[2],i[n+3]=a[3],i[n+4]=a[4],i[n+5]=a[5],i[n+6]=a[6],i[n+7]=a[7]}function y(t,i,n){c[0]=t,i[n]=a[7],i[n+1]=a[6],i[n+2]=a[5],i[n+3]=a[4],i[n+4]=a[3],i[n+5]=a[2],i[n+6]=a[1],i[n+7]=a[0]}function p(t,i){return a[0]=t[i],a[1]=t[i+1],a[2]=t[i+2],a[3]=t[i+3],a[4]=t[i+4],a[5]=t[i+5],a[6]=t[i+6],a[7]=t[i+7],c[0]}function m(t,i){return a[7]=t[i],a[6]=t[i+1],a[5]=t[i+2],a[4]=t[i+3],a[3]=t[i+4],a[2]=t[i+5],a[1]=t[i+6],a[0]=t[i+7],c[0]}return"undefined"!=typeof Float32Array?(o=new Float32Array([-0]),f=new Uint8Array(o.buffer),h=128===f[3],t.writeFloatLE=h?r:e,t.writeFloatBE=h?e:r,t.readFloatLE=h?s:u,t.readFloatBE=h?u:s):(t.writeFloatLE=i.bind(null,w),t.writeFloatBE=i.bind(null,g),t.readFloatLE=n.bind(null,j),t.readFloatBE=n.bind(null,k)),"undefined"!=typeof Float64Array?(c=new Float64Array([-0]),a=new Uint8Array(c.buffer),l=128===a[7],t.writeDoubleLE=l?b:y,t.writeDoubleBE=l?y:b,t.readDoubleLE=l?p:m,t.readDoubleBE=l?m:p):(t.writeDoubleLE=v.bind(null,w,0,4),t.writeDoubleBE=v.bind(null,g,4,0),t.readDoubleLE=d.bind(null,j,0,4),t.readDoubleBE=d.bind(null,k,4,0)),t}function w(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function g(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function j(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function k(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var r=n,s=r.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},e=r.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=s(t),r="";n&&(r=i.shift()+"/");for(var e=0;e>>1,u=null,o=e;return function(t){if(t<1||s>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(r=65536+((1023&r)<<10)+(1023&e),++u,i[n++]=r>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i,n){var r=n,l=t(14),v=t(33);function u(t,i,n,r){if(i.resolvedType)if(i.resolvedType instanceof l){t("switch(d%s){",r);for(var e=i.resolvedType.values,s=Object.keys(e),u=0;u>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,o)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,o?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function d(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}r.fromObject=function(t){var i=t.fieldsArray,n=v.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>3){")("case 1: k=r.%s(); break",r.keyType)("case 2:"),f.basic[e]===g?i("value=types[%i].decode(r,r.uint32())",n):i("value=r.%s()",e),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),f.long[r.keyType]!==g?i('%s[typeof k==="object"?util.longToHash(k):k]=value',s):i("%s[k]=value",s)):r.repeated?(i("if(!(%s&&%s.length))",s,s)("%s=[]",s),f.packed[e]!==g&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0,8|c.mapKey[s.keyType],s.keyType),f===g?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,o,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&c.packed[o]!==g?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",o,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),f===g?l(n,s,u,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,o,i)),n("}")):(s.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),f===g?l(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,o,i))}return n("return w")};var h=t(14),c=t(32),a=t(33);function l(t,i,n,r){return i.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{14:14,32:32,33:33}],14:[function(t,i){i.exports=e;var o=t(22);((e.prototype=Object.create(o.prototype)).constructor=e).className="Enum";var n=t(21),r=t(33);function e(t,i,n,r,e){if(o.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.reserved=g,i)for(var s=Object.keys(i),u=0;ui)return!0;return!1},h.isReservedName=function(t,i){if(t)for(var n=0;n "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return r.Buffer?function(t){return(o.create=function(t){return r.Buffer.isBuffer(t)?new n(t):c(t)})(t)}:c}var h,c="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function a(){var t=new e(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function l(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw u(this,8);return new e(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}o.create=f(),o.prototype.f=r.Array.prototype.subarray||r.Array.prototype.slice,o.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return h;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return h}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return l(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|l(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.f.call(this.buf,i,n)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.r=function(t){n=t,o.create=f(),n.r();var i=r.Long?"toLong":"toNumber";r.merge(o.prototype,{int64:function(){return a.call(this)[i](!1)},uint64:function(){return a.call(this)[i](!0)},sint64:function(){return a.call(this).zzDecode()[i](!1)},fixed64:function(){return v.call(this)[i](!0)},sfixed64:function(){return v.call(this)[i](!1)}})}},{35:35}],25:[function(t,i){i.exports=e;var n=t(24);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(35);function e(t){n.call(this,t)}e.r=function(){r.Buffer&&(e.prototype.f=r.Buffer.prototype.slice)},e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},e.r()},{24:24,35:35}],26:[function(t,i){i.exports=n;var r=t(21);((n.prototype=Object.create(r.prototype)).constructor=n).className="Root";var e,v,d,s=t(15),u=t(14),o=t(23),b=t(33);function n(t){r.call(this,"",t),this.deferred=[],this.files=[]}function y(){}n.fromJSON=function(t,i){return i=i||new n,t.options&&i.setOptions(t.options),i.addJSON(t.nested)},n.prototype.resolvePath=b.path.resolve,n.prototype.fetch=b.fetch,n.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=g);var u=this;if(!e)return b.asPromise(t,u,i,s);var o=e===y;function f(t,i){if(e){var n=e;if(e=null,o)throw t;n(t,i)}}function h(t){var i=t.lastIndexOf("google/protobuf/");if(-1>>0,this.hi=i>>>0}var s=e.zero=new e(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var r=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(0===t)return s;var i=t<0;i&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++r&&(r=0))),new e(n,r)},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(n.isString(t)){if(!n.Long)return e.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+4294967296*n)}return this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;e.fromHash=function(t){return t===r?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0==n?0==i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{35:35}],35:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function b(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}c.create=a(),c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype.y=function(t,i,n){return this.tail=this.tail.next=new o(t,i,n),this.len+=i,this},(v.prototype=Object.create(o.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.y(d,10,e.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){var i=e.from(t);return this.y(d,i.length(),i)},c.prototype.sint64=function(t){var i=e.from(t).zzEncode();return this.y(d,i.length(),i)},c.prototype.bool=function(t){return this.y(l,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.y(b,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){var i=e.from(t);return this.y(b,4,i.lo).y(b,4,i.hi)},c.prototype.float=function(t){return this.y(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.y(r.float.writeDoubleLE,8,t)};var y=r.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;if(!i)return this.y(l,1,0);if(r.isString(t)){var n=c.alloc(i=s.length(t));s.decode(t,n,0),t=n}return this.uint32(i).y(y,i,t)},c.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).y(u.write,i,t):this.y(l,1,0)},c.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new o(f,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},c.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},c.r=function(t){n=t,c.create=a(),n.r()}},{35:35}],39:[function(t,i){i.exports=e;var n=t(38);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(35);function e(){n.call(this)}function s(t,i,n){t.length<40?r.utf8.write(t,i,n):i.utf8Write?i.utf8Write(t,n):i.write(t,n)}e.r=function(){e.alloc=r.b,e.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.y(e.writeBytesBuffer,i,t),this},e.prototype.string=function(t){var i=r.Buffer.byteLength(t);return this.uint32(i),i&&this.y(s,i,t),this},e.r()},{35:35,38:38}]},e={},t=[16],i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]),i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/legacy-libs/protobufjs/dist/light/protobuf.min.js.map b/legacy-libs/protobufjs/dist/light/protobuf.min.js.map new file mode 100644 index 0000000..7b1576d --- /dev/null +++ b/legacy-libs/protobufjs/dist/light/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light","../src/index-minimal.js","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","codegen","functionParams","functionName","body","Codegen","formatStringOrScope","source","toString","verbose","console","log","scopeKeys","Object","keys","scopeParams","scopeValues","scopeOffset","Function","formatParams","formatOffset","replace","$0","$1","value","floor","JSON","stringify","functionNameOverride","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","fetch","asPromise","fs","inquire","filename","options","callback","xhr","readFile","contents","XMLHttpRequest","binary","onreadystatechange","readyState","status","response","responseText","Uint8Array","overrideMimeType","responseType","open","send","factory","writeFloat_ieee754","writeUint","val","buf","pos","sign","isNaN","round","exponent","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","writeFloat_f32_cpy","f32","f8b","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","le","f64","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","Float32Array","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","moduleName","mod","eval","e","path","isAbsolute","normalize","split","absolute","prefix","shift","originPath","includePath","alreadyNormalized","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","converter","Enum","util","genValuePartial_fromObject","gen","field","fieldIndex","prop","resolvedType","values","repeated","typeDefault","fullName","isUnsigned","type","genValuePartial_toObject","fromObject","mtype","fields","fieldsArray","name","safeProp","map","toObject","sort","compareFieldsById","repeatedFields","mapFields","normalFields","partOf","valuesById","long","low","high","unsigned","toNumber","bytes","arrayDefault","hasKs2","_fieldsArray","indexOf","filter","group","ref","id","types","defaults","keyType","basic","packed","rfield","required","wireType","mapKey","genTypePartial","optional","ReflectionObject","create","constructor","className","Namespace","comment","comments","TypeError","reserved","fromJSON","json","enm","toJSON","toJSONOptions","keepComments","add","isString","isInteger","isReservedId","isReservedName","allow_alias","remove","Field","Type","ruleRe","rule","extend","isObject","toLowerCase","message","defaultValue","Long","extensionField","declaringField","_packed","defineProperty","get","getOption","setOption","ifNotSet","resolved","parent","lookupTypeOrEnum","fromNumber","freeze","newBuffer","emptyObject","emptyArray","ctor","d","fieldId","fieldType","fieldRule","decorateType","decorateEnum","fieldName","default","_configure","Type_","build","load","root","Root","loadSync","encoder","decoder","verifier","OneOf","MapField","Service","Method","Message","wrappers","configure","Writer","BufferWriter","Reader","BufferReader","rpc","roots","resolvedKeyType","fieldKeyType","fieldValueType","properties","$type","writer","encodeDelimited","reader","decodeDelimited","verify","object","requestType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","lookupType","arrayToJSON","array","obj","nested","_nestedArray","clearCache","namespace","addJSON","toArray","nestedArray","nestedJson","names","methods","getEnum","prev","setOptions","onAdd","onRemove","define","isArray","ptr","part","resolveAll","lookup","filterTypes","parentAlreadyChecked","found","lookupEnum","lookupService","Service_","Enum_","parsedOptions","defineProperties","unshift","_handleAdd","_handleRemove","setParsedOption","propName","opt","find","hasOwnProperty","newValue","setProperty","newOpt","Root_","fieldNames","oneof","addFieldsToParent","oneofName","oneOfGetter","set","oneOfSetter","LongBits","indexOutOfRange","writeLength","RangeError","Buffer","isBuffer","create_array","readLongVarint","bits","readFixed32_end","readFixed64","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","skip","skipType","BufferReader_","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","parse","common","deferred","files","SYNC","resolvePath","self","sync","finish","cb","getBundledFileName","idx","lastIndexOf","altname","substring","process","parsed","imports","weakImports","queued","weak","setTimeout","readFileSync","isNode","exposeRe","tryHandleExtension","extendedType","sisterField","parse_","common_","rpcImpl","requestDelimited","responseDelimited","rpcCall","method","requestCtor","responseCtor","request","endedByRPC","_methodsArray","service","inherited","methodsArray","rpcService","methodName","lcFirst","isReserved","m","q","s","oneofs","extensions","_fieldsById","_oneofsArray","_ctor","fieldsById","oneofsArray","generateConstructor","ctorProperties","setup","wrapper","originalThis","fork","ldelim","typeName","target","bake","o","key","safePropBackslashRe","safePropQuoteRe","ucFirst","str","toUpperCase","camelCaseRe","camelCase","a","decorateRoot","enumerable","decorateEnumIndex","dst","setProp","prevValue","concat","zero","zzEncode","zeroHash","from","parseInt","fromString","toLong","fromHash","hash","toHash","mask","part0","part1","part2","src","newError","CustomError","captureStackTrace","stack","pool","global","versions","node","window","Number","isFinite","isset","isSet","utf8Write","_Buffer_from","_Buffer_allocUnsafe","sizeOrArray","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","ProtocolError","fieldMap","longs","enums","encoding","allocUnsafe","seenFirstField","invalid","genVerifyKey","genVerifyValue","oneofProp","expected","type_url","substr","Op","next","noop","State","head","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","reset","BufferWriter_","writeStringBuffer","writeBytesBuffer","copy","byteLength","$require","$module","amd","isLong"],"mappings":";;;;;;CAAA,SAAAA,GAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCCxCA,IAAAE,EAAAf,EAOAe,EAAAT,OAAA,SAAAU,GACA,IAAAC,EAAAD,EAAAV,OACA,IAAAW,EACA,OAAA,EAEA,IADA,IAAAC,EAAA,EACA,IAAAD,EAAA,GAAA,KAAAD,EAAAA,EAAAC,MACAC,EACA,OAAAC,KAAAC,KAAA,EAAAJ,EAAAV,QAAA,EAAAY,GAUA,IANA,IAAAG,EAAAjB,MAAA,IAGAkB,EAAAlB,MAAA,KAGAmB,EAAA,EAAAA,EAAA,IACAD,EAAAD,EAAAE,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,EAAAA,EAAA,GAAA,IAAAA,IASAR,EAAAS,OAAA,SAAAC,EAAAC,EAAAC,GAMA,IALA,IAIAC,EAJAC,EAAA,KACAC,EAAA,GACAP,EAAA,EACAQ,EAAA,EAEAL,EAAAC,GAAA,CACA,IAAAK,EAAAP,EAAAC,KACA,OAAAK,GACA,KAAA,EACAD,EAAAP,KAAAF,EAAAW,GAAA,GACAJ,GAAA,EAAAI,IAAA,EACAD,EAAA,EACA,MACA,KAAA,EACAD,EAAAP,KAAAF,EAAAO,EAAAI,GAAA,GACAJ,GAAA,GAAAI,IAAA,EACAD,EAAA,EACA,MACA,KAAA,EACAD,EAAAP,KAAAF,EAAAO,EAAAI,GAAA,GACAF,EAAAP,KAAAF,EAAA,GAAAW,GACAD,EAAA,EAGA,KAAAR,KACAM,EAAAA,GAAA,IAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,IACAP,EAAA,GASA,OANAQ,IACAD,EAAAP,KAAAF,EAAAO,GACAE,EAAAP,KAAA,GACA,IAAAQ,IACAD,EAAAP,KAAA,KAEAM,GACAN,GACAM,EAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KACAM,EAAAQ,KAAA,KAEAH,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KAGA,IAAAe,EAAA,mBAUAvB,EAAAwB,OAAA,SAAAvB,EAAAS,EAAAlB,GAIA,IAHA,IAEAqB,EAFAF,EAAAnB,EACAwB,EAAA,EAEAR,EAAA,EAAAA,EAAAP,EAAAV,QAAA,CACA,IAAAkC,EAAAxB,EAAAyB,WAAAlB,KACA,GAAA,KAAAiB,GAAA,EAAAT,EACA,MACA,IAAAS,EAAAlB,EAAAkB,MAAAhD,EACA,MAAAkD,MAAAJ,GACA,OAAAP,GACA,KAAA,EACAH,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,KAAAqB,GAAA,GAAA,GAAAY,IAAA,EACAZ,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,MAAA,GAAAqB,IAAA,GAAA,GAAAY,IAAA,EACAZ,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,MAAA,EAAAqB,IAAA,EAAAY,EACAT,EAAA,GAIA,GAAA,IAAAA,EACA,MAAAW,MAAAJ,GACA,OAAA/B,EAAAmB,GAQAX,EAAA4B,KAAA,SAAA3B,GACA,MAAA,mEAAA2B,KAAA3B,0BC/HA,SAAA4B,EAAAC,EAAAC,GAGA,iBAAAD,IACAC,EAAAD,EACAA,EAAArD,GAGA,IAAAuD,EAAA,GAYA,SAAAC,EAAAC,GAIA,GAAA,iBAAAA,EAAA,CACA,IAAAC,EAAAC,IAIA,GAHAP,EAAAQ,SACAC,QAAAC,IAAA,YAAAJ,GACAA,EAAA,UAAAA,EACAD,EAAA,CAKA,IAJA,IAAAM,EAAAC,OAAAC,KAAAR,GACAS,EAAAtD,MAAAmD,EAAAjD,OAAA,GACAqD,EAAAvD,MAAAmD,EAAAjD,QACAsD,EAAA,EACAA,EAAAL,EAAAjD,QACAoD,EAAAE,GAAAL,EAAAK,GACAD,EAAAC,GAAAX,EAAAM,EAAAK,MAGA,OADAF,EAAAE,GAAAV,EACAW,SAAA/C,MAAA,KAAA4C,GAAA5C,MAAA,KAAA6C,GAEA,OAAAE,SAAAX,EAAAW,GAMA,IAFA,IAAAC,EAAA1D,MAAAC,UAAAC,OAAA,GACAyD,EAAA,EACAA,EAAAD,EAAAxD,QACAwD,EAAAC,GAAA1D,YAAA0D,GAYA,GAXAA,EAAA,EACAd,EAAAA,EAAAe,QAAA,eAAA,SAAAC,EAAAC,GACA,IAAAC,EAAAL,EAAAC,KACA,OAAAG,GACA,IAAA,IAAA,IAAA,IAAA,OAAAC,EAAAjC,GACA,IAAA,IAAA,OAAAf,KAAAiD,MAAAD,GAAAjC,GACA,IAAA,IAAA,OAAAmC,KAAAC,UAAAH,GACA,IAAA,IAAA,OAAAA,EAAAjC,GAEA,MAAA,MAEA6B,IAAAD,EAAAxD,OACA,MAAAoC,MAAA,4BAEA,OADAK,EAAAd,KAAAgB,GACAD,EAGA,SAAAG,EAAAoB,GACA,MAAA,aAAAA,GAAAzB,GAAA,IAAA,KAAAD,GAAAA,EAAAR,KAAA,MAAA,IAAA,SAAAU,EAAAV,KAAA,QAAA,MAIA,OADAW,EAAAG,SAAAA,EACAH,GAhFAjD,EAAAC,QAAA4C,GAiGAQ,SAAA,wBCzFA,SAAAoB,IAOAC,KAAAC,EAAA,IAfA3E,EAAAC,QAAAwE,GAyBAG,UAAAC,GAAA,SAAAC,EAAA5E,EAAAC,GAKA,OAJAuE,KAAAC,EAAAG,KAAAJ,KAAAC,EAAAG,GAAA,KAAA5C,KAAA,CACAhC,GAAAA,EACAC,IAAAA,GAAAuE,OAEAA,MASAD,EAAAG,UAAAG,IAAA,SAAAD,EAAA5E,GACA,GAAA4E,IAAArF,EACAiF,KAAAC,EAAA,QAEA,GAAAzE,IAAAT,EACAiF,KAAAC,EAAAG,GAAA,QAGA,IADA,IAAAE,EAAAN,KAAAC,EAAAG,GACAtD,EAAA,EAAAA,EAAAwD,EAAAzE,QACAyE,EAAAxD,GAAAtB,KAAAA,EACA8E,EAAAC,OAAAzD,EAAA,KAEAA,EAGA,OAAAkD,MASAD,EAAAG,UAAAM,KAAA,SAAAJ,GACA,IAAAE,EAAAN,KAAAC,EAAAG,GACA,GAAAE,EAAA,CAGA,IAFA,IAAAG,EAAA,GACA3D,EAAA,EACAA,EAAAlB,UAAAC,QACA4E,EAAAjD,KAAA5B,UAAAkB,MACA,IAAAA,EAAA,EAAAA,EAAAwD,EAAAzE,QACAyE,EAAAxD,GAAAtB,GAAAa,MAAAiE,EAAAxD,KAAArB,IAAAgF,GAEA,OAAAT,4BCzEA1E,EAAAC,QAAAmF,EAEA,IAAAC,EAAAtF,EAAA,GAGAuF,EAFAvF,EAAA,EAEAwF,CAAA,MA2BA,SAAAH,EAAAI,EAAAC,EAAAC,GAOA,OAJAD,EAFA,mBAAAA,GACAC,EAAAD,EACA,IACAA,GACA,GAEAC,GAIAD,EAAAE,KAAAL,GAAAA,EAAAM,SACAN,EAAAM,SAAAJ,EAAA,SAAA1E,EAAA+E,GACA,OAAA/E,GAAA,oBAAAgF,eACAV,EAAAO,IAAAH,EAAAC,EAAAC,GACA5E,EACA4E,EAAA5E,GACA4E,EAAA,KAAAD,EAAAM,OAAAF,EAAAA,EAAAzC,SAAA,WAIAgC,EAAAO,IAAAH,EAAAC,EAAAC,GAbAL,EAAAD,EAAAV,KAAAc,EAAAC,GAqCAL,EAAAO,IAAA,SAAAH,EAAAC,EAAAC,GACA,IAAAC,EAAA,IAAAG,eACAH,EAAAK,mBAAA,WAEA,GAAA,IAAAL,EAAAM,WACA,OAAAxG,EAKA,GAAA,IAAAkG,EAAAO,QAAA,MAAAP,EAAAO,OACA,OAAAR,EAAA/C,MAAA,UAAAgD,EAAAO,SAIA,GAAAT,EAAAM,OAAA,CACA,IAAArE,EAAAiE,EAAAQ,SACA,IAAAzE,EAAA,CACAA,EAAA,GACA,IAAA,IAAAF,EAAA,EAAAA,EAAAmE,EAAAS,aAAA7F,SAAAiB,EACAE,EAAAQ,KAAA,IAAAyD,EAAAS,aAAA1D,WAAAlB,IAEA,OAAAkE,EAAA,KAAA,oBAAAW,WAAA,IAAAA,WAAA3E,GAAAA,GAEA,OAAAgE,EAAA,KAAAC,EAAAS,eAGAX,EAAAM,SAEA,qBAAAJ,GACAA,EAAAW,iBAAA,sCACAX,EAAAY,aAAA,eAGAZ,EAAAa,KAAA,MAAAhB,GACAG,EAAAc,qCC1BA,SAAAC,EAAAzG,GAsDA,SAAA0G,EAAAC,EAAAC,EAAAC,EAAAC,GACA,IAAAC,EAAAH,EAAA,EAAA,EAAA,EAGA,GAFAG,IACAH,GAAAA,GACA,IAAAA,EACAD,EAAA,EAAA,EAAAC,EAAA,EAAA,WAAAC,EAAAC,QACA,GAAAE,MAAAJ,GACAD,EAAA,WAAAE,EAAAC,QACA,GAAA,qBAAAF,EACAD,GAAAI,GAAA,GAAA,cAAA,EAAAF,EAAAC,QACA,GAAAF,EAAA,sBACAD,GAAAI,GAAA,GAAA5F,KAAA8F,MAAAL,EAAA,yBAAA,EAAAC,EAAAC,OACA,CACA,IAAAI,EAAA/F,KAAAiD,MAAAjD,KAAAmC,IAAAsD,GAAAzF,KAAAgG,KAEAR,GAAAI,GAAA,GAAA,IAAAG,GAAA,GADA,QAAA/F,KAAA8F,MAAAL,EAAAzF,KAAAiG,IAAA,GAAAF,GAAA,YACA,EAAAL,EAAAC,IAOA,SAAAO,EAAAC,EAAAT,EAAAC,GACA,IAAAS,EAAAD,EAAAT,EAAAC,GACAC,EAAA,GAAAQ,GAAA,IAAA,EACAL,EAAAK,IAAA,GAAA,IACAC,EAAA,QAAAD,EACA,OAAA,KAAAL,EACAM,EACAC,IACAC,EAAAA,EAAAX,EACA,GAAAG,EACA,qBAAAH,EAAAS,EACAT,EAAA5F,KAAAiG,IAAA,EAAAF,EAAA,MAAA,QAAAM,GA9EA,SAAAG,EAAAf,EAAAC,EAAAC,GACAc,EAAA,GAAAhB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAGA,SAAAC,EAAAlB,EAAAC,EAAAC,GACAc,EAAA,GAAAhB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAQA,SAAAE,EAAAlB,EAAAC,GAKA,OAJAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAc,EAAA,GAGA,SAAAI,EAAAnB,EAAAC,GAKA,OAJAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAc,EAAA,GAxCA,IAEAA,EACAC,EACAI,EA2FAC,EACAL,EACAI,EA+DA,SAAAE,EAAAxB,EAAAyB,EAAAC,EAAAzB,EAAAC,EAAAC,GACA,IAAAC,EAAAH,EAAA,EAAA,EAAA,EAGA,GAFAG,IACAH,GAAAA,GACA,IAAAA,EACAD,EAAA,EAAAE,EAAAC,EAAAsB,GACAzB,EAAA,EAAA,EAAAC,EAAA,EAAA,WAAAC,EAAAC,EAAAuB,QACA,GAAArB,MAAAJ,GACAD,EAAA,EAAAE,EAAAC,EAAAsB,GACAzB,EAAA,WAAAE,EAAAC,EAAAuB,QACA,GAAA,sBAAAzB,EACAD,EAAA,EAAAE,EAAAC,EAAAsB,GACAzB,GAAAI,GAAA,GAAA,cAAA,EAAAF,EAAAC,EAAAuB,OACA,CACA,IAAAb,EACA,GAAAZ,EAAA,uBAEAD,GADAa,EAAAZ,EAAA,UACA,EAAAC,EAAAC,EAAAsB,GACAzB,GAAAI,GAAA,GAAAS,EAAA,cAAA,EAAAX,EAAAC,EAAAuB,OACA,CACA,IAAAnB,EAAA/F,KAAAiD,MAAAjD,KAAAmC,IAAAsD,GAAAzF,KAAAgG,KACA,OAAAD,IACAA,EAAA,MAEAP,EAAA,kBADAa,EAAAZ,EAAAzF,KAAAiG,IAAA,GAAAF,MACA,EAAAL,EAAAC,EAAAsB,GACAzB,GAAAI,GAAA,GAAAG,EAAA,MAAA,GAAA,QAAAM,EAAA,WAAA,EAAAX,EAAAC,EAAAuB,KAQA,SAAAC,EAAAhB,EAAAc,EAAAC,EAAAxB,EAAAC,GACA,IAAAyB,EAAAjB,EAAAT,EAAAC,EAAAsB,GACAI,EAAAlB,EAAAT,EAAAC,EAAAuB,GACAtB,EAAA,GAAAyB,GAAA,IAAA,EACAtB,EAAAsB,IAAA,GAAA,KACAhB,EAAA,YAAA,QAAAgB,GAAAD,EACA,OAAA,MAAArB,EACAM,EACAC,IACAC,EAAAA,EAAAX,EACA,GAAAG,EACA,OAAAH,EAAAS,EACAT,EAAA5F,KAAAiG,IAAA,EAAAF,EAAA,OAAAM,EAAA,kBA1GA,SAAAiB,EAAA7B,EAAAC,EAAAC,GACAoB,EAAA,GAAAtB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAGA,SAAAa,EAAA9B,EAAAC,EAAAC,GACAoB,EAAA,GAAAtB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAQA,SAAAc,EAAA9B,EAAAC,GASA,OARAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAoB,EAAA,GAGA,SAAAU,EAAA/B,EAAAC,GASA,OARAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAoB,EAAA,GAgEA,MArNA,oBAAAW,cAEAjB,EAAA,IAAAiB,aAAA,EAAA,IACAhB,EAAA,IAAAzB,WAAAwB,EAAAnG,QACAwG,EAAA,MAAAJ,EAAA,GAmBA7H,EAAA8I,aAAAb,EAAAN,EAAAG,EAEA9H,EAAA+I,aAAAd,EAAAH,EAAAH,EAmBA3H,EAAAgJ,YAAAf,EAAAF,EAAAC,EAEAhI,EAAAiJ,YAAAhB,EAAAD,EAAAD,IAwBA/H,EAAA8I,aAAApC,EAAAwC,KAAA,KAAAC,GACAnJ,EAAA+I,aAAArC,EAAAwC,KAAA,KAAAE,GAgBApJ,EAAAgJ,YAAA3B,EAAA6B,KAAA,KAAAG,GACArJ,EAAAiJ,YAAA5B,EAAA6B,KAAA,KAAAI,IAKA,oBAAAC,cAEArB,EAAA,IAAAqB,aAAA,EAAA,IACA1B,EAAA,IAAAzB,WAAA8B,EAAAzG,QACAwG,EAAA,MAAAJ,EAAA,GA2BA7H,EAAAwJ,cAAAvB,EAAAQ,EAAAC,EAEA1I,EAAAyJ,cAAAxB,EAAAS,EAAAD,EA2BAzI,EAAA0J,aAAAzB,EAAAU,EAAAC,EAEA5I,EAAA2J,aAAA1B,EAAAW,EAAAD,IAmCA3I,EAAAwJ,cAAArB,EAAAe,KAAA,KAAAC,EAAA,EAAA,GACAnJ,EAAAyJ,cAAAtB,EAAAe,KAAA,KAAAE,EAAA,EAAA,GAiBApJ,EAAA0J,aAAApB,EAAAY,KAAA,KAAAG,EAAA,EAAA,GACArJ,EAAA2J,aAAArB,EAAAY,KAAA,KAAAI,EAAA,EAAA,IAIAtJ,EAKA,SAAAmJ,EAAAvC,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAGA,SAAAwC,EAAAxC,EAAAC,EAAAC,GACAD,EAAAC,GAAAF,IAAA,GACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAA,IAAAF,EAGA,SAAAyC,EAAAxC,EAAAC,GACA,OAAAD,EAAAC,GACAD,EAAAC,EAAA,IAAA,EACAD,EAAAC,EAAA,IAAA,GACAD,EAAAC,EAAA,IAAA,MAAA,EAGA,SAAAwC,EAAAzC,EAAAC,GACA,OAAAD,EAAAC,IAAA,GACAD,EAAAC,EAAA,IAAA,GACAD,EAAAC,EAAA,IAAA,EACAD,EAAAC,EAAA,MAAA,EA3UA/G,EAAAC,QAAAyG,EAAAA,2BCOA,SAAAnB,EAAAsE,GACA,IACA,IAAAC,EAAAC,KAAA,UAAAA,CAAAF,GACA,GAAAC,IAAAA,EAAAvJ,QAAAkD,OAAAC,KAAAoG,GAAAvJ,QACA,OAAAuJ,EACA,MAAAE,IACA,OAAA,KAdAhK,EAAAC,QAAAsF,0BCMA,IAAA0E,EAAAhK,EAEAiK,EAMAD,EAAAC,WAAA,SAAAD,GACA,MAAA,eAAArH,KAAAqH,IAGAE,EAMAF,EAAAE,UAAA,SAAAF,GAGA,IAAAnI,GAFAmI,EAAAA,EAAAhG,QAAA,MAAA,KACAA,QAAA,UAAA,MACAmG,MAAA,KACAC,EAAAH,EAAAD,GACAK,EAAA,GACAD,IACAC,EAAAxI,EAAAyI,QAAA,KACA,IAAA,IAAA/I,EAAA,EAAAA,EAAAM,EAAAvB,QACA,OAAAuB,EAAAN,GACA,EAAAA,GAAA,OAAAM,EAAAN,EAAA,GACAM,EAAAmD,SAAAzD,EAAA,GACA6I,EACAvI,EAAAmD,OAAAzD,EAAA,KAEAA,EACA,MAAAM,EAAAN,GACAM,EAAAmD,OAAAzD,EAAA,KAEAA,EAEA,OAAA8I,EAAAxI,EAAAQ,KAAA,MAUA2H,EAAArJ,QAAA,SAAA4J,EAAAC,EAAAC,GAGA,OAFAA,IACAD,EAAAN,EAAAM,IACAP,EAAAO,GACAA,GACAC,IACAF,EAAAL,EAAAK,KACAA,EAAAA,EAAAvG,QAAA,iBAAA,KAAA1D,OAAA4J,EAAAK,EAAA,IAAAC,GAAAA,0BC9DAzK,EAAAC,QA6BA,SAAA0K,EAAAtI,EAAAuI,GACA,IAAAC,EAAAD,GAAA,KACAE,EAAAD,IAAA,EACAE,EAAA,KACAvK,EAAAqK,EACA,OAAA,SAAAD,GACA,GAAAA,EAAA,GAAAE,EAAAF,EACA,OAAAD,EAAAC,GACAC,EAAArK,EAAAoK,IACAG,EAAAJ,EAAAE,GACArK,EAAA,GAEA,IAAAsG,EAAAzE,EAAA2I,KAAAD,EAAAvK,EAAAA,GAAAoK,GAGA,OAFA,EAAApK,IACAA,EAAA,GAAA,EAAAA,IACAsG,6BCtCA,IAAAmE,EAAAhL,EAOAgL,EAAA1K,OAAA,SAAAU,GAGA,IAFA,IAAAiK,EAAA,EACAzI,EAAA,EACAjB,EAAA,EAAAA,EAAAP,EAAAV,SAAAiB,GACAiB,EAAAxB,EAAAyB,WAAAlB,IACA,IACA0J,GAAA,EACAzI,EAAA,KACAyI,GAAA,EACA,QAAA,MAAAzI,IAAA,QAAA,MAAAxB,EAAAyB,WAAAlB,EAAA,OACAA,EACA0J,GAAA,GAEAA,GAAA,EAEA,OAAAA,GAUAD,EAAAE,KAAA,SAAAzJ,EAAAC,EAAAC,GAEA,GADAA,EAAAD,EACA,EACA,MAAA,GAKA,IAJA,IAGAE,EAHAC,EAAA,KACAC,EAAA,GACAP,EAAA,EAEAG,EAAAC,IACAC,EAAAH,EAAAC,MACA,IACAI,EAAAP,KAAAK,EACA,IAAAA,GAAAA,EAAA,IACAE,EAAAP,MAAA,GAAAK,IAAA,EAAA,GAAAH,EAAAC,KACA,IAAAE,GAAAA,EAAA,KACAA,IAAA,EAAAA,IAAA,IAAA,GAAAH,EAAAC,OAAA,IAAA,GAAAD,EAAAC,OAAA,EAAA,GAAAD,EAAAC,MAAA,MACAI,EAAAP,KAAA,OAAAK,GAAA,IACAE,EAAAP,KAAA,OAAA,KAAAK,IAEAE,EAAAP,MAAA,GAAAK,IAAA,IAAA,GAAAH,EAAAC,OAAA,EAAA,GAAAD,EAAAC,KACA,KAAAH,KACAM,EAAAA,GAAA,IAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,IACAP,EAAA,GAGA,OAAAM,GACAN,GACAM,EAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KACAM,EAAAQ,KAAA,KAEAH,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KAUAyJ,EAAAG,MAAA,SAAAnK,EAAAS,EAAAlB,GAIA,IAHA,IACA6K,EACAC,EAFA3J,EAAAnB,EAGAgB,EAAA,EAAAA,EAAAP,EAAAV,SAAAiB,GACA6J,EAAApK,EAAAyB,WAAAlB,IACA,IACAE,EAAAlB,KAAA6K,GACAA,EAAA,KACA3J,EAAAlB,KAAA6K,GAAA,EAAA,KAEA,QAAA,MAAAA,IAAA,QAAA,OAAAC,EAAArK,EAAAyB,WAAAlB,EAAA,MACA6J,EAAA,QAAA,KAAAA,IAAA,KAAA,KAAAC,KACA9J,EACAE,EAAAlB,KAAA6K,GAAA,GAAA,IACA3J,EAAAlB,KAAA6K,GAAA,GAAA,GAAA,KAIA3J,EAAAlB,KAAA6K,GAAA,GAAA,IAHA3J,EAAAlB,KAAA6K,GAAA,EAAA,GAAA,KANA3J,EAAAlB,KAAA,GAAA6K,EAAA,KAcA,OAAA7K,EAAAmB,4BClGA,IAAA4J,EAAAtL,EAEAuL,EAAAzL,EAAA,IACA0L,EAAA1L,EAAA,IAWA,SAAA2L,EAAAC,EAAAC,EAAAC,EAAAC,GAEA,GAAAF,EAAAG,aACA,GAAAH,EAAAG,wBAAAP,EAAA,CAAAG,EACA,eAAAG,GACA,IAAA,IAAAE,EAAAJ,EAAAG,aAAAC,OAAAtI,EAAAD,OAAAC,KAAAsI,GAAAxK,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAoK,EAAAK,UAAAD,EAAAtI,EAAAlC,MAAAoK,EAAAM,aAAAP,EACA,YACAA,EACA,UAAAjI,EAAAlC,GADAmK,CAEA,WAAAK,EAAAtI,EAAAlC,IAFAmK,CAGA,SAAAG,EAAAE,EAAAtI,EAAAlC,IAHAmK,CAIA,SACAA,EACA,UACAA,EACA,4BAAAG,EADAH,CAEA,sBAAAC,EAAAO,SAAA,oBAFAR,CAGA,gCAAAG,EAAAD,EAAAC,OACA,CACA,IAAAM,GAAA,EACA,OAAAR,EAAAS,MACA,IAAA,SACA,IAAA,QAAAV,EACA,kBAAAG,EAAAA,GACA,MACA,IAAA,SACA,IAAA,UAAAH,EACA,cAAAG,EAAAA,GACA,MACA,IAAA,QACA,IAAA,SACA,IAAA,WAAAH,EACA,YAAAG,EAAAA,GACA,MACA,IAAA,SACAM,GAAA,EAEA,IAAA,QACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAT,EACA,gBADAA,CAEA,6CAAAG,EAAAA,EAAAM,EAFAT,CAGA,iCAAAG,EAHAH,CAIA,uBAAAG,EAAAA,EAJAH,CAKA,iCAAAG,EALAH,CAMA,UAAAG,EAAAA,EANAH,CAOA,iCAAAG,EAPAH,CAQA,+DAAAG,EAAAA,EAAAA,EAAAM,EAAA,OAAA,IACA,MACA,IAAA,QAAAT,EACA,4BAAAG,EADAH,CAEA,wEAAAG,EAAAA,EAAAA,EAFAH,CAGA,sBAAAG,EAHAH,CAIA,UAAAG,EAAAA,GACA,MACA,IAAA,SAAAH,EACA,kBAAAG,EAAAA,GACA,MACA,IAAA,OAAAH,EACA,mBAAAG,EAAAA,IAOA,OAAAH,EAmEA,SAAAW,EAAAX,EAAAC,EAAAC,EAAAC,GAEA,GAAAF,EAAAG,aACAH,EAAAG,wBAAAP,EAAAG,EACA,iDAAAG,EAAAD,EAAAC,EAAAA,GACAH,EACA,gCAAAG,EAAAD,EAAAC,OACA,CACA,IAAAM,GAAA,EACA,OAAAR,EAAAS,MACA,IAAA,SACA,IAAA,QAAAV,EACA,6CAAAG,EAAAA,EAAAA,EAAAA,GACA,MACA,IAAA,SACAM,GAAA,EAEA,IAAA,QACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAT,EACA,4BAAAG,EADAH,CAEA,uCAAAG,EAAAA,EAAAA,EAFAH,CAGA,OAHAA,CAIA,4IAAAG,EAAAA,EAAAA,EAAAA,EAAAM,EAAA,OAAA,GAAAN,GACA,MACA,IAAA,QAAAH,EACA,gHAAAG,EAAAA,EAAAA,EAAAA,EAAAA,GACA,MACA,QAAAH,EACA,UAAAG,EAAAA,IAIA,OAAAH,EA5FAJ,EAAAgB,WAAA,SAAAC,GAEA,IAAAC,EAAAD,EAAAE,YACAf,EAAAF,EAAA5I,QAAA,CAAA,KAAA2J,EAAAG,KAAA,cAAAlB,CACA,6BADAA,CAEA,YACA,IAAAgB,EAAAlM,OAAA,OAAAoL,EACA,wBACAA,EACA,uBACA,IAAA,IAAAnK,EAAA,EAAAA,EAAAiL,EAAAlM,SAAAiB,EAAA,CACA,IAAAoK,EAAAa,EAAAjL,GAAAZ,UACAkL,EAAAL,EAAAmB,SAAAhB,EAAAe,MAGAf,EAAAiB,KAAAlB,EACA,WAAAG,EADAH,CAEA,4BAAAG,EAFAH,CAGA,sBAAAC,EAAAO,SAAA,oBAHAR,CAIA,SAAAG,EAJAH,CAKA,oDAAAG,GACAJ,EAAAC,EAAAC,EAAApK,EAAAsK,EAAA,UAAAJ,CACA,IADAA,CAEA,MAGAE,EAAAK,UAAAN,EACA,WAAAG,EADAH,CAEA,0BAAAG,EAFAH,CAGA,sBAAAC,EAAAO,SAAA,mBAHAR,CAIA,SAAAG,EAJAH,CAKA,iCAAAG,GACAJ,EAAAC,EAAAC,EAAApK,EAAAsK,EAAA,MAAAJ,CACA,IADAA,CAEA,OAIAE,EAAAG,wBAAAP,GAAAG,EACA,iBAAAG,GACAJ,EAAAC,EAAAC,EAAApK,EAAAsK,GACAF,EAAAG,wBAAAP,GAAAG,EACA,MAEA,OAAAA,EACA,aAwDAJ,EAAAuB,SAAA,SAAAN,GAEA,IAAAC,EAAAD,EAAAE,YAAArK,QAAA0K,KAAAtB,EAAAuB,mBACA,IAAAP,EAAAlM,OACA,OAAAkL,EAAA5I,SAAA4I,CAAA,aAUA,IATA,IAAAE,EAAAF,EAAA5I,QAAA,CAAA,IAAA,KAAA2J,EAAAG,KAAA,YAAAlB,CACA,SADAA,CAEA,OAFAA,CAGA,YAEAwB,EAAA,GACAC,EAAA,GACAC,EAAA,GACA3L,EAAA,EACAA,EAAAiL,EAAAlM,SAAAiB,EACAiL,EAAAjL,GAAA4L,SACAX,EAAAjL,GAAAZ,UAAAqL,SAAAgB,EACAR,EAAAjL,GAAAqL,IAAAK,EACAC,GAAAjL,KAAAuK,EAAAjL,IAEA,GAAAyL,EAAA1M,OAAA,CAEA,IAFAoL,EACA,6BACAnK,EAAA,EAAAA,EAAAyL,EAAA1M,SAAAiB,EAAAmK,EACA,SAAAF,EAAAmB,SAAAK,EAAAzL,GAAAmL,OACAhB,EACA,KAGA,GAAAuB,EAAA3M,OAAA,CAEA,IAFAoL,EACA,8BACAnK,EAAA,EAAAA,EAAA0L,EAAA3M,SAAAiB,EAAAmK,EACA,SAAAF,EAAAmB,SAAAM,EAAA1L,GAAAmL,OACAhB,EACA,KAGA,GAAAwB,EAAA5M,OAAA,CAEA,IAFAoL,EACA,mBACAnK,EAAA,EAAAA,EAAA2L,EAAA5M,SAAAiB,EAAA,CACA,IAAAoK,EAAAuB,EAAA3L,GACAsK,EAAAL,EAAAmB,SAAAhB,EAAAe,MACA,GAAAf,EAAAG,wBAAAP,EAAAG,EACA,6BAAAG,EAAAF,EAAAG,aAAAsB,WAAAzB,EAAAM,aAAAN,EAAAM,kBACA,GAAAN,EAAA0B,KAAA3B,EACA,iBADAA,CAEA,gCAAAC,EAAAM,YAAAqB,IAAA3B,EAAAM,YAAAsB,KAAA5B,EAAAM,YAAAuB,SAFA9B,CAGA,oEAAAG,EAHAH,CAIA,QAJAA,CAKA,6BAAAG,EAAAF,EAAAM,YAAA9I,WAAAwI,EAAAM,YAAAwB,iBACA,GAAA9B,EAAA+B,MAAA,CACA,IAAAC,EAAA,IAAAvN,MAAAuE,UAAAvC,MAAA2I,KAAAY,EAAAM,aAAA5J,KAAA,KAAA,IACAqJ,EACA,6BAAAG,EAAA3J,OAAAC,aAAArB,MAAAoB,OAAAyJ,EAAAM,aADAP,CAEA,QAFAA,CAGA,SAAAG,EAAA8B,EAHAjC,CAIA,6CAAAG,EAAAA,EAJAH,CAKA,UACAA,EACA,SAAAG,EAAAF,EAAAM,aACAP,EACA,KAEA,IAAAkC,GAAA,EACA,IAAArM,EAAA,EAAAA,EAAAiL,EAAAlM,SAAAiB,EAAA,CACAoK,EAAAa,EAAAjL,GAAA,IACAf,EAAA+L,EAAAsB,EAAAC,QAAAnC,GACAE,EAAAL,EAAAmB,SAAAhB,EAAAe,MACAf,EAAAiB,KACAgB,IAAAA,GAAA,EAAAlC,EACA,YACAA,EACA,0CAAAG,EAAAA,EADAH,CAEA,SAAAG,EAFAH,CAGA,kCACAW,EAAAX,EAAAC,EAAAnL,EAAAqL,EAAA,WAAAQ,CACA,MACAV,EAAAK,UAAAN,EACA,uBAAAG,EAAAA,EADAH,CAEA,SAAAG,EAFAH,CAGA,iCAAAG,GACAQ,EAAAX,EAAAC,EAAAnL,EAAAqL,EAAA,MAAAQ,CACA,OACAX,EACA,uCAAAG,EAAAF,EAAAe,MACAL,EAAAX,EAAAC,EAAAnL,EAAAqL,GACAF,EAAAwB,QAAAzB,EACA,eADAA,CAEA,SAAAF,EAAAmB,SAAAhB,EAAAwB,OAAAT,MAAAf,EAAAe,OAEAhB,EACA,KAEA,OAAAA,EACA,+CCjSA3L,EAAAC,QAeA,SAAAuM,GAEA,IAAAb,EAAAF,EAAA5I,QAAA,CAAA,IAAA,KAAA2J,EAAAG,KAAA,UAAAlB,CACA,6BADAA,CAEA,qBAFAA,CAGA,qDAAAe,EAAAE,YAAAsB,OAAA,SAAApC,GAAA,OAAAA,EAAAiB,MAAAtM,OAAA,WAAA,IAHAkL,CAIA,kBAJAA,CAKA,oBACAe,EAAAyB,OAAAtC,EACA,gBADAA,CAEA,SACAA,EACA,kBAGA,IADA,IAAAnK,EAAA,EACAA,EAAAgL,EAAAE,YAAAnM,SAAAiB,EAAA,CACA,IAAAoK,EAAAY,EAAAsB,EAAAtM,GAAAZ,UACAyL,EAAAT,EAAAG,wBAAAP,EAAA,QAAAI,EAAAS,KACA6B,EAAA,IAAAzC,EAAAmB,SAAAhB,EAAAe,MAAAhB,EACA,WAAAC,EAAAuC,IAGAvC,EAAAiB,KAAAlB,EACA,4BAAAuC,EADAvC,CAEA,QAAAuC,EAFAvC,CAGA,6BAEAyC,EAAAC,SAAAzC,EAAA0C,WAAA7O,EAAAkM,EACA,OAAAyC,EAAAC,SAAAzC,EAAA0C,UACA3C,EACA,UAEAyC,EAAAC,SAAAhC,KAAA5M,EAAAkM,EACA,WAAAyC,EAAAC,SAAAhC,IACAV,EACA,cAEAA,EACA,mBADAA,CAEA,sBAFAA,CAGA,oBAHAA,CAIA,0BAAAC,EAAA0C,QAJA3C,CAKA,WAEAyC,EAAAG,MAAAlC,KAAA5M,EAAAkM,EACA,uCAAAnK,GACAmK,EACA,eAAAU,GAEAV,EACA,QADAA,CAEA,WAFAA,CAGA,qBAHAA,CAIA,QAJAA,CAKA,IALAA,CAMA,KAEAyC,EAAAd,KAAA1B,EAAA0C,WAAA7O,EAAAkM,EACA,qDAAAuC,GACAvC,EACA,cAAAuC,IAGAtC,EAAAK,UAAAN,EAEA,uBAAAuC,EAAAA,EAFAvC,CAGA,QAAAuC,GAGAE,EAAAI,OAAAnC,KAAA5M,GAAAkM,EACA,iBADAA,CAEA,0BAFAA,CAGA,kBAHAA,CAIA,kBAAAuC,EAAA7B,EAJAV,CAKA,SAGAyC,EAAAG,MAAAlC,KAAA5M,EAAAkM,EAAAC,EAAAG,aAAAkC,MACA,+BACA,0CAAAC,EAAA1M,GACAmK,EACA,kBAAAuC,EAAA7B,IAGA+B,EAAAG,MAAAlC,KAAA5M,EAAAkM,EAAAC,EAAAG,aAAAkC,MACA,yBACA,oCAAAC,EAAA1M,GACAmK,EACA,YAAAuC,EAAA7B,GACAV,EACA,SAWA,IATAA,EACA,WADAA,CAEA,kBAFAA,CAGA,QAHAA,CAKA,IALAA,CAMA,KAGAnK,EAAA,EAAAA,EAAAgL,EAAAsB,EAAAvN,SAAAiB,EAAA,CACA,IAAAiN,EAAAjC,EAAAsB,EAAAtM,GACAiN,EAAAC,UAAA/C,EACA,4BAAA8C,EAAA9B,KADAhB,CAEA,4CAjHA,qBAiHA8C,EAjHA9B,KAAA,KAoHA,OAAAhB,EACA,aA1HA,IAAAH,EAAAzL,EAAA,IACAqO,EAAArO,EAAA,IACA0L,EAAA1L,EAAA,4CCJAC,EAAAC,QA0BA,SAAAuM,GAWA,IATA,IAIA0B,EAJAvC,EAAAF,EAAA5I,QAAA,CAAA,IAAA,KAAA2J,EAAAG,KAAA,UAAAlB,CACA,SADAA,CAEA,qBAKAgB,EAAAD,EAAAE,YAAArK,QAAA0K,KAAAtB,EAAAuB,mBAEAxL,EAAA,EAAAA,EAAAiL,EAAAlM,SAAAiB,EAAA,CACA,IAAAoK,EAAAa,EAAAjL,GAAAZ,UACAH,EAAA+L,EAAAsB,EAAAC,QAAAnC,GACAS,EAAAT,EAAAG,wBAAAP,EAAA,QAAAI,EAAAS,KACAsC,EAAAP,EAAAG,MAAAlC,GACA6B,EAAA,IAAAzC,EAAAmB,SAAAhB,EAAAe,MAGAf,EAAAiB,KACAlB,EACA,kDAAAuC,EAAAtC,EAAAe,KADAhB,CAEA,mDAAAuC,EAFAvC,CAGA,4CAAAC,EAAAuC,IAAA,EAAA,KAAA,EAAA,EAAAC,EAAAQ,OAAAhD,EAAA0C,SAAA1C,EAAA0C,SACAK,IAAAlP,EAAAkM,EACA,oEAAAlL,EAAAyN,GACAvC,EACA,qCAAA,GAAAgD,EAAAtC,EAAA6B,GACAvC,EACA,IADAA,CAEA,MAGAC,EAAAK,UAAAN,EACA,2BAAAuC,EAAAA,GAGAtC,EAAA4C,QAAAJ,EAAAI,OAAAnC,KAAA5M,EAAAkM,EAEA,uBAAAC,EAAAuC,IAAA,EAAA,KAAA,EAFAxC,CAGA,+BAAAuC,EAHAvC,CAIA,cAAAU,EAAA6B,EAJAvC,CAKA,eAGAA,EAEA,+BAAAuC,GACAS,IAAAlP,EACAoP,EAAAlD,EAAAC,EAAAnL,EAAAyN,EAAA,OACAvC,EACA,0BAAAC,EAAAuC,IAAA,EAAAQ,KAAA,EAAAtC,EAAA6B,IAEAvC,EACA,OAIAC,EAAAkD,UAAAnD,EACA,iDAAAuC,EAAAtC,EAAAe,MAEAgC,IAAAlP,EACAoP,EAAAlD,EAAAC,EAAAnL,EAAAyN,GACAvC,EACA,uBAAAC,EAAAuC,IAAA,EAAAQ,KAAA,EAAAtC,EAAA6B,IAKA,OAAAvC,EACA,aA9FA,IAAAH,EAAAzL,EAAA,IACAqO,EAAArO,EAAA,IACA0L,EAAA1L,EAAA,IAWA,SAAA8O,EAAAlD,EAAAC,EAAAC,EAAAqC,GACA,OAAAtC,EAAAG,aAAAkC,MACAtC,EAAA,+CAAAE,EAAAqC,GAAAtC,EAAAuC,IAAA,EAAA,KAAA,GAAAvC,EAAAuC,IAAA,EAAA,KAAA,GACAxC,EAAA,oDAAAE,EAAAqC,GAAAtC,EAAAuC,IAAA,EAAA,KAAA,4CClBAnO,EAAAC,QAAAuL,EAGA,IAAAuD,EAAAhP,EAAA,MACAyL,EAAA5G,UAAAnB,OAAAuL,OAAAD,EAAAnK,YAAAqK,YAAAzD,GAAA0D,UAAA,OAEA,IAAAC,EAAApP,EAAA,IACA0L,EAAA1L,EAAA,IAaA,SAAAyL,EAAAmB,EAAAX,EAAAvG,EAAA2J,EAAAC,GAGA,GAFAN,EAAA/D,KAAAtG,KAAAiI,EAAAlH,GAEAuG,GAAA,iBAAAA,EACA,MAAAsD,UAAA,4BAoCA,GA9BA5K,KAAA2I,WAAA,GAMA3I,KAAAsH,OAAAvI,OAAAuL,OAAAtK,KAAA2I,YAMA3I,KAAA0K,QAAAA,EAMA1K,KAAA2K,SAAAA,GAAA,GAMA3K,KAAA6K,SAAA9P,EAMAuM,EACA,IAAA,IAAAtI,EAAAD,OAAAC,KAAAsI,GAAAxK,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACA,iBAAAwK,EAAAtI,EAAAlC,MACAkD,KAAA2I,WAAA3I,KAAAsH,OAAAtI,EAAAlC,IAAAwK,EAAAtI,EAAAlC,KAAAkC,EAAAlC,IAiBAgK,EAAAgE,SAAA,SAAA7C,EAAA8C,GACA,IAAAC,EAAA,IAAAlE,EAAAmB,EAAA8C,EAAAzD,OAAAyD,EAAAhK,QAAAgK,EAAAL,QAAAK,EAAAJ,UAEA,OADAK,EAAAH,SAAAE,EAAAF,SACAG,GAQAlE,EAAA5G,UAAA+K,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,UAAApI,KAAAe,QACA,SAAAf,KAAAsH,OACA,WAAAtH,KAAA6K,UAAA7K,KAAA6K,SAAAhP,OAAAmE,KAAA6K,SAAA9P,EACA,UAAAoQ,EAAAnL,KAAA0K,QAAA3P,EACA,WAAAoQ,EAAAnL,KAAA2K,SAAA5P,KAaA+L,EAAA5G,UAAAkL,IAAA,SAAAnD,EAAAwB,EAAAiB,GAGA,IAAA3D,EAAAsE,SAAApD,GACA,MAAA2C,UAAA,yBAEA,IAAA7D,EAAAuE,UAAA7B,GACA,MAAAmB,UAAA,yBAEA,GAAA5K,KAAAsH,OAAAW,KAAAlN,EACA,MAAAkD,MAAA,mBAAAgK,EAAA,QAAAjI,MAEA,GAAAA,KAAAuL,aAAA9B,GACA,MAAAxL,MAAA,MAAAwL,EAAA,mBAAAzJ,MAEA,GAAAA,KAAAwL,eAAAvD,GACA,MAAAhK,MAAA,SAAAgK,EAAA,oBAAAjI,MAEA,GAAAA,KAAA2I,WAAAc,KAAA1O,EAAA,CACA,IAAAiF,KAAAe,UAAAf,KAAAe,QAAA0K,YACA,MAAAxN,MAAA,gBAAAwL,EAAA,OAAAzJ,MACAA,KAAAsH,OAAAW,GAAAwB,OAEAzJ,KAAA2I,WAAA3I,KAAAsH,OAAAW,GAAAwB,GAAAxB,EAGA,OADAjI,KAAA2K,SAAA1C,GAAAyC,GAAA,KACA1K,MAUA8G,EAAA5G,UAAAwL,OAAA,SAAAzD,GAEA,IAAAlB,EAAAsE,SAAApD,GACA,MAAA2C,UAAA,yBAEA,IAAAzI,EAAAnC,KAAAsH,OAAAW,GACA,GAAA,MAAA9F,EACA,MAAAlE,MAAA,SAAAgK,EAAA,uBAAAjI,MAMA,cAJAA,KAAA2I,WAAAxG,UACAnC,KAAAsH,OAAAW,UACAjI,KAAA2K,SAAA1C,GAEAjI,MAQA8G,EAAA5G,UAAAqL,aAAA,SAAA9B,GACA,OAAAgB,EAAAc,aAAAvL,KAAA6K,SAAApB,IAQA3C,EAAA5G,UAAAsL,eAAA,SAAAvD,GACA,OAAAwC,EAAAe,eAAAxL,KAAA6K,SAAA5C,4CClLA3M,EAAAC,QAAAoQ,EAGA,IAAAtB,EAAAhP,EAAA,MACAsQ,EAAAzL,UAAAnB,OAAAuL,OAAAD,EAAAnK,YAAAqK,YAAAoB,GAAAnB,UAAA,QAEA,IAIAoB,EAJA9E,EAAAzL,EAAA,IACAqO,EAAArO,EAAA,IACA0L,EAAA1L,EAAA,IAIAwQ,EAAA,+BAyCA,SAAAF,EAAA1D,EAAAwB,EAAA9B,EAAAmE,EAAAC,EAAAhL,EAAA2J,GAcA,GAZA3D,EAAAiF,SAAAF,IACApB,EAAAqB,EACAhL,EAAA+K,EACAA,EAAAC,EAAAhR,GACAgM,EAAAiF,SAAAD,KACArB,EAAA3J,EACAA,EAAAgL,EACAA,EAAAhR,GAGAsP,EAAA/D,KAAAtG,KAAAiI,EAAAlH,IAEAgG,EAAAuE,UAAA7B,IAAAA,EAAA,EACA,MAAAmB,UAAA,qCAEA,IAAA7D,EAAAsE,SAAA1D,GACA,MAAAiD,UAAA,yBAEA,GAAAkB,IAAA/Q,IAAA8Q,EAAA3N,KAAA4N,EAAAA,EAAApN,WAAAuN,eACA,MAAArB,UAAA,8BAEA,GAAAmB,IAAAhR,IAAAgM,EAAAsE,SAAAU,GACA,MAAAnB,UAAA,2BAMA5K,KAAA8L,KAAAA,GAAA,aAAAA,EAAAA,EAAA/Q,EAMAiF,KAAA2H,KAAAA,EAMA3H,KAAAyJ,GAAAA,EAMAzJ,KAAA+L,OAAAA,GAAAhR,EAMAiF,KAAAgK,SAAA,aAAA8B,EAMA9L,KAAAoK,UAAApK,KAAAgK,SAMAhK,KAAAuH,SAAA,aAAAuE,EAMA9L,KAAAmI,KAAA,EAMAnI,KAAAkM,QAAA,KAMAlM,KAAA0I,OAAA,KAMA1I,KAAAwH,YAAA,KAMAxH,KAAAmM,aAAA,KAMAnM,KAAA4I,OAAA7B,EAAAqF,MAAA1C,EAAAd,KAAAjB,KAAA5M,EAMAiF,KAAAiJ,MAAA,UAAAtB,EAMA3H,KAAAqH,aAAA,KAMArH,KAAAqM,eAAA,KAMArM,KAAAsM,eAAA,KAOAtM,KAAAuM,EAAA,KAMAvM,KAAA0K,QAAAA,EA7JAiB,EAAAb,SAAA,SAAA7C,EAAA8C,GACA,OAAA,IAAAY,EAAA1D,EAAA8C,EAAAtB,GAAAsB,EAAApD,KAAAoD,EAAAe,KAAAf,EAAAgB,OAAAhB,EAAAhK,QAAAgK,EAAAL,UAqKA3L,OAAAyN,eAAAb,EAAAzL,UAAA,SAAA,CACAuM,IAAA,WAIA,OAFA,OAAAzM,KAAAuM,IACAvM,KAAAuM,GAAA,IAAAvM,KAAA0M,UAAA,WACA1M,KAAAuM,KAOAZ,EAAAzL,UAAAyM,UAAA,SAAA1E,EAAAvI,EAAAkN,GAGA,MAFA,WAAA3E,IACAjI,KAAAuM,EAAA,MACAlC,EAAAnK,UAAAyM,UAAArG,KAAAtG,KAAAiI,EAAAvI,EAAAkN,IAwBAjB,EAAAzL,UAAA+K,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,OAAA,aAAApI,KAAA8L,MAAA9L,KAAA8L,MAAA/Q,EACA,OAAAiF,KAAA2H,KACA,KAAA3H,KAAAyJ,GACA,SAAAzJ,KAAA+L,OACA,UAAA/L,KAAAe,QACA,UAAAoK,EAAAnL,KAAA0K,QAAA3P,KASA4Q,EAAAzL,UAAAhE,QAAA,WAEA,GAAA8D,KAAA6M,SACA,OAAA7M,KA0BA,IAxBAA,KAAAwH,YAAAkC,EAAAC,SAAA3J,KAAA2H,SAAA5M,IACAiF,KAAAqH,cAAArH,KAAAsM,eAAAtM,KAAAsM,eAAAQ,OAAA9M,KAAA8M,QAAAC,iBAAA/M,KAAA2H,MACA3H,KAAAqH,wBAAAuE,EACA5L,KAAAwH,YAAA,KAEAxH,KAAAwH,YAAAxH,KAAAqH,aAAAC,OAAAvI,OAAAC,KAAAgB,KAAAqH,aAAAC,QAAA,KAIAtH,KAAAe,SAAA,MAAAf,KAAAe,QAAA,UACAf,KAAAwH,YAAAxH,KAAAe,QAAA,QACAf,KAAAqH,wBAAAP,GAAA,iBAAA9G,KAAAwH,cACAxH,KAAAwH,YAAAxH,KAAAqH,aAAAC,OAAAtH,KAAAwH,eAIAxH,KAAAe,WACA,IAAAf,KAAAe,QAAA+I,SAAA9J,KAAAe,QAAA+I,SAAA/O,IAAAiF,KAAAqH,cAAArH,KAAAqH,wBAAAP,WACA9G,KAAAe,QAAA+I,OACA/K,OAAAC,KAAAgB,KAAAe,SAAAlF,SACAmE,KAAAe,QAAAhG,IAIAiF,KAAA4I,KACA5I,KAAAwH,YAAAT,EAAAqF,KAAAY,WAAAhN,KAAAwH,YAAA,KAAAxH,KAAA2H,KAAA,IAGA5I,OAAAkO,QACAlO,OAAAkO,OAAAjN,KAAAwH,kBAEA,GAAAxH,KAAAiJ,OAAA,iBAAAjJ,KAAAwH,YAAA,CACA,IAAApF,EACA2E,EAAAzK,OAAA4B,KAAA8B,KAAAwH,aACAT,EAAAzK,OAAAwB,OAAAkC,KAAAwH,YAAApF,EAAA2E,EAAAmG,UAAAnG,EAAAzK,OAAAT,OAAAmE,KAAAwH,cAAA,GAEAT,EAAAR,KAAAG,MAAA1G,KAAAwH,YAAApF,EAAA2E,EAAAmG,UAAAnG,EAAAR,KAAA1K,OAAAmE,KAAAwH,cAAA,GACAxH,KAAAwH,YAAApF,EAeA,OAXApC,KAAAmI,IACAnI,KAAAmM,aAAApF,EAAAoG,YACAnN,KAAAuH,SACAvH,KAAAmM,aAAApF,EAAAqG,WAEApN,KAAAmM,aAAAnM,KAAAwH,YAGAxH,KAAA8M,kBAAAlB,IACA5L,KAAA8M,OAAAO,KAAAnN,UAAAF,KAAAiI,MAAAjI,KAAAmM,cAEA9B,EAAAnK,UAAAhE,QAAAoK,KAAAtG,OAuBA2L,EAAA2B,EAAA,SAAAC,EAAAC,EAAAC,EAAAtB,GAUA,MAPA,mBAAAqB,EACAA,EAAAzG,EAAA2G,aAAAF,GAAAvF,KAGAuF,GAAA,iBAAAA,IACAA,EAAAzG,EAAA4G,aAAAH,GAAAvF,MAEA,SAAA/H,EAAA0N,GACA7G,EAAA2G,aAAAxN,EAAAqK,aACAa,IAAA,IAAAO,EAAAiC,EAAAL,EAAAC,EAAAC,EAAA,CAAAI,QAAA1B,OAkBAR,EAAAmC,EAAA,SAAAC,GACAnC,EAAAmC,iDChXA,IAAA5S,EAAAG,EAAAC,QAAAF,EAAA,IAEAF,EAAA6S,MAAA,QAoDA7S,EAAA8S,KAjCA,SAAAnN,EAAAoN,EAAAlN,GAMA,OAHAkN,EAFA,mBAAAA,GACAlN,EAAAkN,EACA,IAAA/S,EAAAgT,MACAD,GACA,IAAA/S,EAAAgT,MACAF,KAAAnN,EAAAE,IA2CA7F,EAAAiT,SANA,SAAAtN,EAAAoN,GAGA,OADAA,EADAA,GACA,IAAA/S,EAAAgT,MACAC,SAAAtN,IAMA3F,EAAAkT,QAAAhT,EAAA,IACAF,EAAAmT,QAAAjT,EAAA,IACAF,EAAAoT,SAAAlT,EAAA,IACAF,EAAA0L,UAAAxL,EAAA,IAGAF,EAAAkP,iBAAAhP,EAAA,IACAF,EAAAsP,UAAApP,EAAA,IACAF,EAAAgT,KAAA9S,EAAA,IACAF,EAAA2L,KAAAzL,EAAA,IACAF,EAAAyQ,KAAAvQ,EAAA,IACAF,EAAAwQ,MAAAtQ,EAAA,IACAF,EAAAqT,MAAAnT,EAAA,IACAF,EAAAsT,SAAApT,EAAA,IACAF,EAAAuT,QAAArT,EAAA,IACAF,EAAAwT,OAAAtT,EAAA,IAGAF,EAAAyT,QAAAvT,EAAA,IACAF,EAAA0T,SAAAxT,EAAA,IAGAF,EAAAuO,MAAArO,EAAA,IACAF,EAAA4L,KAAA1L,EAAA,IAGAF,EAAAkP,iBAAAyD,EAAA3S,EAAAgT,MACAhT,EAAAsP,UAAAqD,EAAA3S,EAAAyQ,KAAAzQ,EAAAuT,QAAAvT,EAAA2L,MACA3L,EAAAgT,KAAAL,EAAA3S,EAAAyQ,MACAzQ,EAAAwQ,MAAAmC,EAAA3S,EAAAyQ,gJCtGA,IAAAzQ,EAAAI,EA2BA,SAAAuT,IACA3T,EAAA4L,KAAA+G,IACA3S,EAAA4T,OAAAjB,EAAA3S,EAAA6T,cACA7T,EAAA8T,OAAAnB,EAAA3S,EAAA+T,cAtBA/T,EAAA6S,MAAA,UAGA7S,EAAA4T,OAAA1T,EAAA,IACAF,EAAA6T,aAAA3T,EAAA,IACAF,EAAA8T,OAAA5T,EAAA,IACAF,EAAA+T,aAAA7T,EAAA,IAGAF,EAAA4L,KAAA1L,EAAA,IACAF,EAAAgU,IAAA9T,EAAA,IACAF,EAAAiU,MAAA/T,EAAA,KACAF,EAAA2T,UAAAA,qECpBAxT,EAAAC,QAAAkT,EAGA,IAAA9C,EAAAtQ,EAAA,MACAoT,EAAAvO,UAAAnB,OAAAuL,OAAAqB,EAAAzL,YAAAqK,YAAAkE,GAAAjE,UAAA,WAEA,IAAAd,EAAArO,EAAA,IACA0L,EAAA1L,EAAA,IAcA,SAAAoT,EAAAxG,EAAAwB,EAAAG,EAAAjC,EAAA5G,EAAA2J,GAIA,GAHAiB,EAAArF,KAAAtG,KAAAiI,EAAAwB,EAAA9B,EAAA5M,EAAAA,EAAAgG,EAAA2J,IAGA3D,EAAAsE,SAAAzB,GACA,MAAAgB,UAAA,4BAMA5K,KAAA4J,QAAAA,EAMA5J,KAAAqP,gBAAA,KAGArP,KAAAmI,KAAA,EAwBAsG,EAAA3D,SAAA,SAAA7C,EAAA8C,GACA,OAAA,IAAA0D,EAAAxG,EAAA8C,EAAAtB,GAAAsB,EAAAnB,QAAAmB,EAAApD,KAAAoD,EAAAhK,QAAAgK,EAAAL,UAQA+D,EAAAvO,UAAA+K,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,UAAApI,KAAA4J,QACA,OAAA5J,KAAA2H,KACA,KAAA3H,KAAAyJ,GACA,SAAAzJ,KAAA+L,OACA,UAAA/L,KAAAe,QACA,UAAAoK,EAAAnL,KAAA0K,QAAA3P,KAOA0T,EAAAvO,UAAAhE,QAAA,WACA,GAAA8D,KAAA6M,SACA,OAAA7M,KAGA,GAAA0J,EAAAQ,OAAAlK,KAAA4J,WAAA7O,EACA,MAAAkD,MAAA,qBAAA+B,KAAA4J,SAEA,OAAA+B,EAAAzL,UAAAhE,QAAAoK,KAAAtG,OAaAyO,EAAAnB,EAAA,SAAAC,EAAA+B,EAAAC,GAUA,MAPA,mBAAAA,EACAA,EAAAxI,EAAA2G,aAAA6B,GAAAtH,KAGAsH,GAAA,iBAAAA,IACAA,EAAAxI,EAAA4G,aAAA4B,GAAAtH,MAEA,SAAA/H,EAAA0N,GACA7G,EAAA2G,aAAAxN,EAAAqK,aACAa,IAAA,IAAAqD,EAAAb,EAAAL,EAAA+B,EAAAC,8CC1HAjU,EAAAC,QAAAqT,EAEA,IAAA7H,EAAA1L,EAAA,IASA,SAAAuT,EAAAY,GAEA,GAAAA,EACA,IAAA,IAAAxQ,EAAAD,OAAAC,KAAAwQ,GAAA1S,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAkD,KAAAhB,EAAAlC,IAAA0S,EAAAxQ,EAAAlC,IA0BA8R,EAAAtE,OAAA,SAAAkF,GACA,OAAAxP,KAAAyP,MAAAnF,OAAAkF,IAWAZ,EAAA7R,OAAA,SAAAmP,EAAAwD,GACA,OAAA1P,KAAAyP,MAAA1S,OAAAmP,EAAAwD,IAWAd,EAAAe,gBAAA,SAAAzD,EAAAwD,GACA,OAAA1P,KAAAyP,MAAAE,gBAAAzD,EAAAwD,IAYAd,EAAA9Q,OAAA,SAAA8R,GACA,OAAA5P,KAAAyP,MAAA3R,OAAA8R,IAYAhB,EAAAiB,gBAAA,SAAAD,GACA,OAAA5P,KAAAyP,MAAAI,gBAAAD,IAUAhB,EAAAkB,OAAA,SAAA5D,GACA,OAAAlM,KAAAyP,MAAAK,OAAA5D,IAUA0C,EAAA/G,WAAA,SAAAkI,GACA,OAAA/P,KAAAyP,MAAA5H,WAAAkI,IAWAnB,EAAAxG,SAAA,SAAA8D,EAAAnL,GACA,OAAAf,KAAAyP,MAAArH,SAAA8D,EAAAnL,IAOA6N,EAAA1O,UAAA+K,OAAA,WACA,OAAAjL,KAAAyP,MAAArH,SAAApI,KAAA+G,EAAAmE,4CCtIA5P,EAAAC,QAAAoT,EAGA,IAAAtE,EAAAhP,EAAA,MACAsT,EAAAzO,UAAAnB,OAAAuL,OAAAD,EAAAnK,YAAAqK,YAAAoE,GAAAnE,UAAA,SAEA,IAAAzD,EAAA1L,EAAA,IAgBA,SAAAsT,EAAA1G,EAAAN,EAAAqI,EAAAnO,EAAAoO,EAAAC,EAAAnP,EAAA2J,GAYA,GATA3D,EAAAiF,SAAAiE,IACAlP,EAAAkP,EACAA,EAAAC,EAAAnV,GACAgM,EAAAiF,SAAAkE,KACAnP,EAAAmP,EACAA,EAAAnV,GAIA4M,IAAA5M,IAAAgM,EAAAsE,SAAA1D,GACA,MAAAiD,UAAA,yBAGA,IAAA7D,EAAAsE,SAAA2E,GACA,MAAApF,UAAA,gCAGA,IAAA7D,EAAAsE,SAAAxJ,GACA,MAAA+I,UAAA,iCAEAP,EAAA/D,KAAAtG,KAAAiI,EAAAlH,GAMAf,KAAA2H,KAAAA,GAAA,MAMA3H,KAAAgQ,YAAAA,EAMAhQ,KAAAiQ,gBAAAA,GAAAlV,EAMAiF,KAAA6B,aAAAA,EAMA7B,KAAAkQ,iBAAAA,GAAAnV,EAMAiF,KAAAmQ,oBAAA,KAMAnQ,KAAAoQ,qBAAA,KAMApQ,KAAA0K,QAAAA,EAqBAiE,EAAA7D,SAAA,SAAA7C,EAAA8C,GACA,OAAA,IAAA4D,EAAA1G,EAAA8C,EAAApD,KAAAoD,EAAAiF,YAAAjF,EAAAlJ,aAAAkJ,EAAAkF,cAAAlF,EAAAmF,eAAAnF,EAAAhK,QAAAgK,EAAAL,UAQAiE,EAAAzO,UAAA+K,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,OAAA,QAAApI,KAAA2H,MAAA3H,KAAA2H,MAAA5M,EACA,cAAAiF,KAAAgQ,YACA,gBAAAhQ,KAAAiQ,cACA,eAAAjQ,KAAA6B,aACA,iBAAA7B,KAAAkQ,eACA,UAAAlQ,KAAAe,QACA,UAAAoK,EAAAnL,KAAA0K,QAAA3P,KAOA4T,EAAAzO,UAAAhE,QAAA,WAGA,OAAA8D,KAAA6M,SACA7M,MAEAA,KAAAmQ,oBAAAnQ,KAAA8M,OAAAuD,WAAArQ,KAAAgQ,aACAhQ,KAAAoQ,qBAAApQ,KAAA8M,OAAAuD,WAAArQ,KAAA6B,cAEAwI,EAAAnK,UAAAhE,QAAAoK,KAAAtG,0CCpJA1E,EAAAC,QAAAkP,EAGA,IAAAJ,EAAAhP,EAAA,MACAoP,EAAAvK,UAAAnB,OAAAuL,OAAAD,EAAAnK,YAAAqK,YAAAE,GAAAD,UAAA,YAEA,IAGAoB,EACA8C,EACA5H,EALA6E,EAAAtQ,EAAA,IACA0L,EAAA1L,EAAA,IAoCA,SAAAiV,EAAAC,EAAArF,GACA,IAAAqF,IAAAA,EAAA1U,OACA,OAAAd,EAEA,IADA,IAAAyV,EAAA,GACA1T,EAAA,EAAAA,EAAAyT,EAAA1U,SAAAiB,EACA0T,EAAAD,EAAAzT,GAAAmL,MAAAsI,EAAAzT,GAAAmO,OAAAC,GACA,OAAAsF,EA4CA,SAAA/F,EAAAxC,EAAAlH,GACAsJ,EAAA/D,KAAAtG,KAAAiI,EAAAlH,GAMAf,KAAAyQ,OAAA1V,EAOAiF,KAAA0Q,EAAA,KAGA,SAAAC,EAAAC,GAEA,OADAA,EAAAF,EAAA,KACAE,EAhFAnG,EAAAK,SAAA,SAAA7C,EAAA8C,GACA,OAAA,IAAAN,EAAAxC,EAAA8C,EAAAhK,SAAA8P,QAAA9F,EAAA0F,SAmBAhG,EAAA6F,YAAAA,EAQA7F,EAAAc,aAAA,SAAAV,EAAApB,GACA,GAAAoB,EACA,IAAA,IAAA/N,EAAA,EAAAA,EAAA+N,EAAAhP,SAAAiB,EACA,GAAA,iBAAA+N,EAAA/N,IAAA+N,EAAA/N,GAAA,IAAA2M,GAAAoB,EAAA/N,GAAA,GAAA2M,EACA,OAAA,EACA,OAAA,GASAgB,EAAAe,eAAA,SAAAX,EAAA5C,GACA,GAAA4C,EACA,IAAA,IAAA/N,EAAA,EAAAA,EAAA+N,EAAAhP,SAAAiB,EACA,GAAA+N,EAAA/N,KAAAmL,EACA,OAAA,EACA,OAAA,GA0CAlJ,OAAAyN,eAAA/B,EAAAvK,UAAA,cAAA,CACAuM,IAAA,WACA,OAAAzM,KAAA0Q,IAAA1Q,KAAA0Q,EAAA3J,EAAA+J,QAAA9Q,KAAAyQ,YA6BAhG,EAAAvK,UAAA+K,OAAA,SAAAC,GACA,OAAAnE,EAAAqB,SAAA,CACA,UAAApI,KAAAe,QACA,SAAAuP,EAAAtQ,KAAA+Q,YAAA7F,MASAT,EAAAvK,UAAA2Q,QAAA,SAAAG,GAGA,GAAAA,EACA,IAAA,IAAAP,EAAAQ,EAAAlS,OAAAC,KAAAgS,GAAAlU,EAAA,EAAAA,EAAAmU,EAAApV,SAAAiB,EACA2T,EAAAO,EAAAC,EAAAnU,IAJAkD,KAKAoL,KACAqF,EAAA1I,SAAAhN,EACA6Q,EAAAd,SACA2F,EAAAnJ,SAAAvM,EACA+L,EAAAgE,SACA2F,EAAAS,UAAAnW,EACA2T,EAAA5D,SACA2F,EAAAhH,KAAA1O,EACA4Q,EAAAb,SACAL,EAAAK,UAAAmG,EAAAnU,GAAA2T,IAIA,OAAAzQ,MAQAyK,EAAAvK,UAAAuM,IAAA,SAAAxE,GACA,OAAAjI,KAAAyQ,QAAAzQ,KAAAyQ,OAAAxI,IACA,MAUAwC,EAAAvK,UAAAiR,QAAA,SAAAlJ,GACA,GAAAjI,KAAAyQ,QAAAzQ,KAAAyQ,OAAAxI,aAAAnB,EACA,OAAA9G,KAAAyQ,OAAAxI,GAAAX,OACA,MAAArJ,MAAA,iBAAAgK,IAUAwC,EAAAvK,UAAAkL,IAAA,SAAA2E,GAEA,KAAAA,aAAApE,GAAAoE,EAAAhE,SAAAhR,GAAAgV,aAAAnE,GAAAmE,aAAAjJ,GAAAiJ,aAAArB,GAAAqB,aAAAtF,GACA,MAAAG,UAAA,wCAEA,GAAA5K,KAAAyQ,OAEA,CACA,IAAAW,EAAApR,KAAAyM,IAAAsD,EAAA9H,MACA,GAAAmJ,EAAA,CACA,KAAAA,aAAA3G,GAAAsF,aAAAtF,IAAA2G,aAAAxF,GAAAwF,aAAA1C,EAWA,MAAAzQ,MAAA,mBAAA8R,EAAA9H,KAAA,QAAAjI,MARA,IADA,IAAAyQ,EAAAW,EAAAL,YACAjU,EAAA,EAAAA,EAAA2T,EAAA5U,SAAAiB,EACAiT,EAAA3E,IAAAqF,EAAA3T,IACAkD,KAAA0L,OAAA0F,GACApR,KAAAyQ,SACAzQ,KAAAyQ,OAAA,IACAV,EAAAsB,WAAAD,EAAArQ,SAAA,SAZAf,KAAAyQ,OAAA,GAoBA,OAFAzQ,KAAAyQ,OAAAV,EAAA9H,MAAA8H,GACAuB,MAAAtR,MACA2Q,EAAA3Q,OAUAyK,EAAAvK,UAAAwL,OAAA,SAAAqE,GAEA,KAAAA,aAAA1F,GACA,MAAAO,UAAA,qCACA,GAAAmF,EAAAjD,SAAA9M,KACA,MAAA/B,MAAA8R,EAAA,uBAAA/P,MAOA,cALAA,KAAAyQ,OAAAV,EAAA9H,MACAlJ,OAAAC,KAAAgB,KAAAyQ,QAAA5U,SACAmE,KAAAyQ,OAAA1V,GAEAgV,EAAAwB,SAAAvR,MACA2Q,EAAA3Q,OASAyK,EAAAvK,UAAAsR,OAAA,SAAAjM,EAAAwF,GAEA,GAAAhE,EAAAsE,SAAA9F,GACAA,EAAAA,EAAAG,MAAA,UACA,IAAA/J,MAAA8V,QAAAlM,GACA,MAAAqF,UAAA,gBACA,GAAArF,GAAAA,EAAA1J,QAAA,KAAA0J,EAAA,GACA,MAAAtH,MAAA,yBAGA,IADA,IAAAyT,EAAA1R,KACA,EAAAuF,EAAA1J,QAAA,CACA,IAAA8V,EAAApM,EAAAM,QACA,GAAA6L,EAAAjB,QAAAiB,EAAAjB,OAAAkB,IAEA,MADAD,EAAAA,EAAAjB,OAAAkB,cACAlH,GACA,MAAAxM,MAAA,kDAEAyT,EAAAtG,IAAAsG,EAAA,IAAAjH,EAAAkH,IAIA,OAFA5G,GACA2G,EAAAb,QAAA9F,GACA2G,GAOAjH,EAAAvK,UAAA0R,WAAA,WAEA,IADA,IAAAnB,EAAAzQ,KAAA+Q,YAAAjU,EAAA,EACAA,EAAA2T,EAAA5U,QACA4U,EAAA3T,aAAA2N,EACAgG,EAAA3T,KAAA8U,aAEAnB,EAAA3T,KAAAZ,UACA,OAAA8D,KAAA9D,WAUAuO,EAAAvK,UAAA2R,OAAA,SAAAtM,EAAAuM,EAAAC,GASA,GANA,kBAAAD,GACAC,EAAAD,EACAA,EAAA/W,GACA+W,IAAAnW,MAAA8V,QAAAK,KACAA,EAAA,CAAAA,IAEA/K,EAAAsE,SAAA9F,IAAAA,EAAA1J,OAAA,CACA,GAAA,MAAA0J,EACA,OAAAvF,KAAAkO,KACA3I,EAAAA,EAAAG,MAAA,UACA,IAAAH,EAAA1J,OACA,OAAAmE,KAGA,GAAA,KAAAuF,EAAA,GACA,OAAAvF,KAAAkO,KAAA2D,OAAAtM,EAAA5H,MAAA,GAAAmU,GAGA,IAAAE,EAAAhS,KAAAyM,IAAAlH,EAAA,IACA,GAAAyM,GACA,GAAA,IAAAzM,EAAA1J,QACA,IAAAiW,IAAAA,EAAAzI,QAAA2I,EAAAzH,aACA,OAAAyH,OACA,GAAAA,aAAAvH,IAAAuH,EAAAA,EAAAH,OAAAtM,EAAA5H,MAAA,GAAAmU,GAAA,IACA,OAAAE,OAIA,IAAA,IAAAlV,EAAA,EAAAA,EAAAkD,KAAA+Q,YAAAlV,SAAAiB,EACA,GAAAkD,KAAA0Q,EAAA5T,aAAA2N,IAAAuH,EAAAhS,KAAA0Q,EAAA5T,GAAA+U,OAAAtM,EAAAuM,GAAA,IACA,OAAAE,EAGA,OAAA,OAAAhS,KAAA8M,QAAAiF,EACA,KACA/R,KAAA8M,OAAA+E,OAAAtM,EAAAuM,IAqBArH,EAAAvK,UAAAmQ,WAAA,SAAA9K,GACA,IAAAyM,EAAAhS,KAAA6R,OAAAtM,EAAA,CAAAqG,IACA,IAAAoG,EACA,MAAA/T,MAAA,iBAAAsH,GACA,OAAAyM,GAUAvH,EAAAvK,UAAA+R,WAAA,SAAA1M,GACA,IAAAyM,EAAAhS,KAAA6R,OAAAtM,EAAA,CAAAuB,IACA,IAAAkL,EACA,MAAA/T,MAAA,iBAAAsH,EAAA,QAAAvF,MACA,OAAAgS,GAUAvH,EAAAvK,UAAA6M,iBAAA,SAAAxH,GACA,IAAAyM,EAAAhS,KAAA6R,OAAAtM,EAAA,CAAAqG,EAAA9E,IACA,IAAAkL,EACA,MAAA/T,MAAA,yBAAAsH,EAAA,QAAAvF,MACA,OAAAgS,GAUAvH,EAAAvK,UAAAgS,cAAA,SAAA3M,GACA,IAAAyM,EAAAhS,KAAA6R,OAAAtM,EAAA,CAAAmJ,IACA,IAAAsD,EACA,MAAA/T,MAAA,oBAAAsH,EAAA,QAAAvF,MACA,OAAAgS,GAIAvH,EAAAqD,EAAA,SAAAC,EAAAoE,EAAAC,GACAxG,EAAAmC,EACAW,EAAAyD,EACArL,EAAAsL,4CC9aA9W,EAAAC,QAAA8O,GAEAG,UAAA,mBAEA,IAEA2D,EAFApH,EAAA1L,EAAA,IAYA,SAAAgP,EAAApC,EAAAlH,GAEA,IAAAgG,EAAAsE,SAAApD,GACA,MAAA2C,UAAA,yBAEA,GAAA7J,IAAAgG,EAAAiF,SAAAjL,GACA,MAAA6J,UAAA,6BAMA5K,KAAAe,QAAAA,EAMAf,KAAAqS,cAAA,KAMArS,KAAAiI,KAAAA,EAMAjI,KAAA8M,OAAA,KAMA9M,KAAA6M,UAAA,EAMA7M,KAAA0K,QAAA,KAMA1K,KAAAc,SAAA,KAGA/B,OAAAuT,iBAAAjI,EAAAnK,UAAA,CAQAgO,KAAA,CACAzB,IAAA,WAEA,IADA,IAAAiF,EAAA1R,KACA,OAAA0R,EAAA5E,QACA4E,EAAAA,EAAA5E,OACA,OAAA4E,IAUAjK,SAAA,CACAgF,IAAA,WAGA,IAFA,IAAAlH,EAAA,CAAAvF,KAAAiI,MACAyJ,EAAA1R,KAAA8M,OACA4E,GACAnM,EAAAgN,QAAAb,EAAAzJ,MACAyJ,EAAAA,EAAA5E,OAEA,OAAAvH,EAAA3H,KAAA,SAUAyM,EAAAnK,UAAA+K,OAAA,WACA,MAAAhN,SAQAoM,EAAAnK,UAAAoR,MAAA,SAAAxE,GACA9M,KAAA8M,QAAA9M,KAAA8M,SAAAA,GACA9M,KAAA8M,OAAApB,OAAA1L,MACAA,KAAA8M,OAAAA,EACA9M,KAAA6M,UAAA,EACA,IAAAqB,EAAApB,EAAAoB,KACAA,aAAAC,GACAD,EAAAsE,EAAAxS,OAQAqK,EAAAnK,UAAAqR,SAAA,SAAAzE,GACA,IAAAoB,EAAApB,EAAAoB,KACAA,aAAAC,GACAD,EAAAuE,EAAAzS,MACAA,KAAA8M,OAAA,KACA9M,KAAA6M,UAAA,GAOAxC,EAAAnK,UAAAhE,QAAA,WACA,OAAA8D,KAAA6M,UAEA7M,KAAAkO,gBAAAC,IACAnO,KAAA6M,UAAA,GAFA7M,MAWAqK,EAAAnK,UAAAwM,UAAA,SAAAzE,GACA,OAAAjI,KAAAe,QACAf,KAAAe,QAAAkH,GACAlN,GAUAsP,EAAAnK,UAAAyM,UAAA,SAAA1E,EAAAvI,EAAAkN,GAGA,OAFAA,GAAA5M,KAAAe,SAAAf,KAAAe,QAAAkH,KAAAlN,KACAiF,KAAAe,UAAAf,KAAAe,QAAA,KAAAkH,GAAAvI,GACAM,MAUAqK,EAAAnK,UAAAwS,gBAAA,SAAAzK,EAAAvI,EAAAiT,GACA3S,KAAAqS,gBACArS,KAAAqS,cAAA,IAEA,IAAAA,EAAArS,KAAAqS,cACA,GAAAM,EAAA,CAGA,IAAAC,EAAAP,EAAAQ,KAAA,SAAAD,GACA,OAAA7T,OAAAmB,UAAA4S,eAAAxM,KAAAsM,EAAA3K,KAEA,GAAA2K,EAAA,CAEA,IAAAG,EAAAH,EAAA3K,GACAlB,EAAAiM,YAAAD,EAAAJ,EAAAjT,QAGAkT,EAAA,IACA3K,GAAAlB,EAAAiM,YAAA,GAAAL,EAAAjT,GACA2S,EAAA7U,KAAAoV,OAEA,CAEA,IAAAK,EAAA,GACAA,EAAAhL,GAAAvI,EACA2S,EAAA7U,KAAAyV,GAEA,OAAAjT,MASAqK,EAAAnK,UAAAmR,WAAA,SAAAtQ,EAAA6L,GACA,GAAA7L,EACA,IAAA,IAAA/B,EAAAD,OAAAC,KAAA+B,GAAAjE,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAkD,KAAA2M,UAAA3N,EAAAlC,GAAAiE,EAAA/B,EAAAlC,IAAA8P,GACA,OAAA5M,MAOAqK,EAAAnK,UAAAxB,SAAA,WACA,IAAA8L,EAAAxK,KAAAuK,YAAAC,UACA/C,EAAAzH,KAAAyH,SACA,OAAAA,EAAA5L,OACA2O,EAAA,IAAA/C,EACA+C,GAIAH,EAAAyD,EAAA,SAAAoF,GACA/E,EAAA+E,+BChPA5X,EAAAC,QAAAiT,EAGA,IAAAnE,EAAAhP,EAAA,MACAmT,EAAAtO,UAAAnB,OAAAuL,OAAAD,EAAAnK,YAAAqK,YAAAiE,GAAAhE,UAAA,QAEA,IAAAmB,EAAAtQ,EAAA,IACA0L,EAAA1L,EAAA,IAYA,SAAAmT,EAAAvG,EAAAkL,EAAApS,EAAA2J,GAQA,GAPA/O,MAAA8V,QAAA0B,KACApS,EAAAoS,EACAA,EAAApY,GAEAsP,EAAA/D,KAAAtG,KAAAiI,EAAAlH,GAGAoS,IAAApY,IAAAY,MAAA8V,QAAA0B,GACA,MAAAvI,UAAA,+BAMA5K,KAAAoT,MAAAD,GAAA,GAOAnT,KAAAgI,YAAA,GAMAhI,KAAA0K,QAAAA,EA0CA,SAAA2I,EAAAD,GACA,GAAAA,EAAAtG,OACA,IAAA,IAAAhQ,EAAA,EAAAA,EAAAsW,EAAApL,YAAAnM,SAAAiB,EACAsW,EAAApL,YAAAlL,GAAAgQ,QACAsG,EAAAtG,OAAA1B,IAAAgI,EAAApL,YAAAlL,IA7BA0R,EAAA1D,SAAA,SAAA7C,EAAA8C,GACA,OAAA,IAAAyD,EAAAvG,EAAA8C,EAAAqI,MAAArI,EAAAhK,QAAAgK,EAAAL,UAQA8D,EAAAtO,UAAA+K,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,UAAApI,KAAAe,QACA,QAAAf,KAAAoT,MACA,UAAAjI,EAAAnL,KAAA0K,QAAA3P,KAuBAyT,EAAAtO,UAAAkL,IAAA,SAAAlE,GAGA,KAAAA,aAAAyE,GACA,MAAAf,UAAA,yBAQA,OANA1D,EAAA4F,QAAA5F,EAAA4F,SAAA9M,KAAA8M,QACA5F,EAAA4F,OAAApB,OAAAxE,GACAlH,KAAAoT,MAAA5V,KAAA0J,EAAAe,MACAjI,KAAAgI,YAAAxK,KAAA0J,GAEAmM,EADAnM,EAAAwB,OAAA1I,MAEAA,MAQAwO,EAAAtO,UAAAwL,OAAA,SAAAxE,GAGA,KAAAA,aAAAyE,GACA,MAAAf,UAAA,yBAEA,IAAA7O,EAAAiE,KAAAgI,YAAAqB,QAAAnC,GAGA,GAAAnL,EAAA,EACA,MAAAkC,MAAAiJ,EAAA,uBAAAlH,MAUA,OARAA,KAAAgI,YAAAzH,OAAAxE,EAAA,IAIA,GAHAA,EAAAiE,KAAAoT,MAAA/J,QAAAnC,EAAAe,QAIAjI,KAAAoT,MAAA7S,OAAAxE,EAAA,GAEAmL,EAAAwB,OAAA,KACA1I,MAMAwO,EAAAtO,UAAAoR,MAAA,SAAAxE,GACAzC,EAAAnK,UAAAoR,MAAAhL,KAAAtG,KAAA8M,GAGA,IAFA,IAEAhQ,EAAA,EAAAA,EAAAkD,KAAAoT,MAAAvX,SAAAiB,EAAA,CACA,IAAAoK,EAAA4F,EAAAL,IAAAzM,KAAAoT,MAAAtW,IACAoK,IAAAA,EAAAwB,SACAxB,EAAAwB,OALA1I,MAMAgI,YAAAxK,KAAA0J,GAIAmM,EAAArT,OAMAwO,EAAAtO,UAAAqR,SAAA,SAAAzE,GACA,IAAA,IAAA5F,EAAApK,EAAA,EAAAA,EAAAkD,KAAAgI,YAAAnM,SAAAiB,GACAoK,EAAAlH,KAAAgI,YAAAlL,IAAAgQ,QACA5F,EAAA4F,OAAApB,OAAAxE,GACAmD,EAAAnK,UAAAqR,SAAAjL,KAAAtG,KAAA8M,IAmBA0B,EAAAlB,EAAA,WAGA,IAFA,IAAA6F,EAAAxX,MAAAC,UAAAC,QACAE,EAAA,EACAA,EAAAH,UAAAC,QACAsX,EAAApX,GAAAH,UAAAG,KACA,OAAA,SAAAmE,EAAAoT,GACAvM,EAAA2G,aAAAxN,EAAAqK,aACAa,IAAA,IAAAoD,EAAA8E,EAAAH,IACApU,OAAAyN,eAAAtM,EAAAoT,EAAA,CACA7G,IAAA1F,EAAAwM,YAAAJ,GACAK,IAAAzM,EAAA0M,YAAAN,+CCtMA7X,EAAAC,QAAA0T,EAEA,IAEAC,EAFAnI,EAAA1L,EAAA,IAIAqY,EAAA3M,EAAA2M,SACAnN,EAAAQ,EAAAR,KAGA,SAAAoN,EAAA/D,EAAAgE,GACA,OAAAC,WAAA,uBAAAjE,EAAAvN,IAAA,OAAAuR,GAAA,GAAA,MAAAhE,EAAApJ,KASA,SAAAyI,EAAAjS,GAMAgD,KAAAoC,IAAApF,EAMAgD,KAAAqC,IAAA,EAMArC,KAAAwG,IAAAxJ,EAAAnB,OAgBA,SAAAyO,IACA,OAAAvD,EAAA+M,OACA,SAAA9W,GACA,OAAAiS,EAAA3E,OAAA,SAAAtN,GACA,OAAA+J,EAAA+M,OAAAC,SAAA/W,GACA,IAAAkS,EAAAlS,GAEAgX,EAAAhX,KACAA,IAGAgX,EAxBA,IA4CAtU,EA5CAsU,EAAA,oBAAArS,WACA,SAAA3E,GACA,GAAAA,aAAA2E,YAAAhG,MAAA8V,QAAAzU,GACA,OAAA,IAAAiS,EAAAjS,GACA,MAAAiB,MAAA,mBAGA,SAAAjB,GACA,GAAArB,MAAA8V,QAAAzU,GACA,OAAA,IAAAiS,EAAAjS,GACA,MAAAiB,MAAA,mBAsEA,SAAAgW,IAEA,IAAAC,EAAA,IAAAR,EAAA,EAAA,GACA5W,EAAA,EACA,KAAA,EAAAkD,KAAAwG,IAAAxG,KAAAqC,KAaA,CACA,KAAAvF,EAAA,IAAAA,EAAA,CAEA,GAAAkD,KAAAqC,KAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,MAGA,GADAkU,EAAApQ,IAAAoQ,EAAApQ,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAA6R,EAIA,OADAA,EAAApQ,IAAAoQ,EAAApQ,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,SAAA,EAAAvF,KAAA,EACAoX,EAxBA,KAAApX,EAAA,IAAAA,EAGA,GADAoX,EAAApQ,IAAAoQ,EAAApQ,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAA6R,EAKA,GAFAA,EAAApQ,IAAAoQ,EAAApQ,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EACA6R,EAAAnQ,IAAAmQ,EAAAnQ,IAAA,IAAA/D,KAAAoC,IAAApC,KAAAqC,OAAA,KAAA,EACArC,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAA6R,EAgBA,GAfApX,EAAA,EAeA,EAAAkD,KAAAwG,IAAAxG,KAAAqC,KACA,KAAAvF,EAAA,IAAAA,EAGA,GADAoX,EAAAnQ,IAAAmQ,EAAAnQ,IAAA,IAAA/D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,EAAA,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAA6R,OAGA,KAAApX,EAAA,IAAAA,EAAA,CAEA,GAAAkD,KAAAqC,KAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,MAGA,GADAkU,EAAAnQ,IAAAmQ,EAAAnQ,IAAA,IAAA/D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,EAAA,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAA6R,EAIA,MAAAjW,MAAA,2BAkCA,SAAAkW,EAAA/R,EAAAlF,GACA,OAAAkF,EAAAlF,EAAA,GACAkF,EAAAlF,EAAA,IAAA,EACAkF,EAAAlF,EAAA,IAAA,GACAkF,EAAAlF,EAAA,IAAA,MAAA,EA+BA,SAAAkX,IAGA,GAAApU,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,KAAA,GAEA,OAAA,IAAA0T,EAAAS,EAAAnU,KAAAoC,IAAApC,KAAAqC,KAAA,GAAA8R,EAAAnU,KAAAoC,IAAApC,KAAAqC,KAAA,IA3KA4M,EAAA3E,OAAAA,IAEA2E,EAAA/O,UAAAmU,EAAAtN,EAAApL,MAAAuE,UAAAoU,UAAAvN,EAAApL,MAAAuE,UAAAvC,MAOAsR,EAAA/O,UAAAqU,QACA7U,EAAA,WACA,WACA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,QAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,KAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,GAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EAGA,IAAAM,KAAAqC,KAAA,GAAArC,KAAAwG,IAEA,MADAxG,KAAAqC,IAAArC,KAAAwG,IACAmN,EAAA3T,KAAA,IAEA,OAAAN,IAQAuP,EAAA/O,UAAAsU,MAAA,WACA,OAAA,EAAAxU,KAAAuU,UAOAtF,EAAA/O,UAAAuU,OAAA,WACA,IAAA/U,EAAAM,KAAAuU,SACA,OAAA7U,IAAA,IAAA,EAAAA,GAAA,GAqFAuP,EAAA/O,UAAAwU,KAAA,WACA,OAAA,IAAA1U,KAAAuU,UAcAtF,EAAA/O,UAAAyU,QAAA,WAGA,GAAA3U,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,KAAA,GAEA,OAAAmU,EAAAnU,KAAAoC,IAAApC,KAAAqC,KAAA,IAOA4M,EAAA/O,UAAA0U,SAAA,WAGA,GAAA5U,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,KAAA,GAEA,OAAA,EAAAmU,EAAAnU,KAAAoC,IAAApC,KAAAqC,KAAA,IAmCA4M,EAAA/O,UAAA2U,MAAA,WAGA,GAAA7U,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,KAAA,GAEA,IAAAN,EAAAqH,EAAA8N,MAAAtQ,YAAAvE,KAAAoC,IAAApC,KAAAqC,KAEA,OADArC,KAAAqC,KAAA,EACA3C,GAQAuP,EAAA/O,UAAA4U,OAAA,WAGA,GAAA9U,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,KAAA,GAEA,IAAAN,EAAAqH,EAAA8N,MAAA5P,aAAAjF,KAAAoC,IAAApC,KAAAqC,KAEA,OADArC,KAAAqC,KAAA,EACA3C,GAOAuP,EAAA/O,UAAA+I,MAAA,WACA,IAAApN,EAAAmE,KAAAuU,SACAtX,EAAA+C,KAAAqC,IACAnF,EAAA8C,KAAAqC,IAAAxG,EAGA,GAAAqB,EAAA8C,KAAAwG,IACA,MAAAmN,EAAA3T,KAAAnE,GAGA,OADAmE,KAAAqC,KAAAxG,EACAF,MAAA8V,QAAAzR,KAAAoC,KACApC,KAAAoC,IAAAzE,MAAAV,EAAAC,GACAD,IAAAC,EACA,IAAA8C,KAAAoC,IAAAmI,YAAA,GACAvK,KAAAqU,EAAA/N,KAAAtG,KAAAoC,IAAAnF,EAAAC,IAOA+R,EAAA/O,UAAA3D,OAAA,WACA,IAAA0M,EAAAjJ,KAAAiJ,QACA,OAAA1C,EAAAE,KAAAwC,EAAA,EAAAA,EAAApN,SAQAoT,EAAA/O,UAAA6U,KAAA,SAAAlZ,GACA,GAAA,iBAAAA,EAAA,CAEA,GAAAmE,KAAAqC,IAAAxG,EAAAmE,KAAAwG,IACA,MAAAmN,EAAA3T,KAAAnE,GACAmE,KAAAqC,KAAAxG,OAEA,GAEA,GAAAmE,KAAAqC,KAAArC,KAAAwG,IACA,MAAAmN,EAAA3T,YACA,IAAAA,KAAAoC,IAAApC,KAAAqC,QAEA,OAAArC,MAQAiP,EAAA/O,UAAA8U,SAAA,SAAA/K,GACA,OAAAA,GACA,KAAA,EACAjK,KAAA+U,OACA,MACA,KAAA,EACA/U,KAAA+U,KAAA,GACA,MACA,KAAA,EACA/U,KAAA+U,KAAA/U,KAAAuU,UACA,MACA,KAAA,EACA,KAAA,IAAAtK,EAAA,EAAAjK,KAAAuU,WACAvU,KAAAgV,SAAA/K,GAEA,MACA,KAAA,EACAjK,KAAA+U,KAAA,GACA,MAGA,QACA,MAAA9W,MAAA,qBAAAgM,EAAA,cAAAjK,KAAAqC,KAEA,OAAArC,MAGAiP,EAAAnB,EAAA,SAAAmH,GACA/F,EAAA+F,EACAhG,EAAA3E,OAAAA,IACA4E,EAAApB,IAEA,IAAAtS,EAAAuL,EAAAqF,KAAA,SAAA,WACArF,EAAAmO,MAAAjG,EAAA/O,UAAA,CAEAiV,MAAA,WACA,OAAAlB,EAAA3N,KAAAtG,MAAAxE,IAAA,IAGA4Z,OAAA,WACA,OAAAnB,EAAA3N,KAAAtG,MAAAxE,IAAA,IAGA6Z,OAAA,WACA,OAAApB,EAAA3N,KAAAtG,MAAAsV,WAAA9Z,IAAA,IAGA+Z,QAAA,WACA,OAAAnB,EAAA9N,KAAAtG,MAAAxE,IAAA,IAGAga,SAAA,WACA,OAAApB,EAAA9N,KAAAtG,MAAAxE,IAAA,mCCrZAF,EAAAC,QAAA2T,EAGA,IAAAD,EAAA5T,EAAA,KACA6T,EAAAhP,UAAAnB,OAAAuL,OAAA2E,EAAA/O,YAAAqK,YAAA2E,EAEA,IAAAnI,EAAA1L,EAAA,IASA,SAAA6T,EAAAlS,GACAiS,EAAA3I,KAAAtG,KAAAhD,GASAkS,EAAApB,EAAA,WAEA/G,EAAA+M,SACA5E,EAAAhP,UAAAmU,EAAAtN,EAAA+M,OAAA5T,UAAAvC,QAOAuR,EAAAhP,UAAA3D,OAAA,WACA,IAAAiK,EAAAxG,KAAAuU,SACA,OAAAvU,KAAAoC,IAAAqT,UACAzV,KAAAoC,IAAAqT,UAAAzV,KAAAqC,IAAArC,KAAAqC,IAAA3F,KAAAgZ,IAAA1V,KAAAqC,IAAAmE,EAAAxG,KAAAwG,MACAxG,KAAAoC,IAAA1D,SAAA,QAAAsB,KAAAqC,IAAArC,KAAAqC,IAAA3F,KAAAgZ,IAAA1V,KAAAqC,IAAAmE,EAAAxG,KAAAwG,OAUA0I,EAAApB,sCCjDAxS,EAAAC,QAAA4S,EAGA,IAAA1D,EAAApP,EAAA,MACA8S,EAAAjO,UAAAnB,OAAAuL,OAAAG,EAAAvK,YAAAqK,YAAA4D,GAAA3D,UAAA,OAEA,IAKAoB,EACA+J,EACAC,EAPAjK,EAAAtQ,EAAA,IACAyL,EAAAzL,EAAA,IACAmT,EAAAnT,EAAA,IACA0L,EAAA1L,EAAA,IAaA,SAAA8S,EAAApN,GACA0J,EAAAnE,KAAAtG,KAAA,GAAAe,GAMAf,KAAA6V,SAAA,GAMA7V,KAAA8V,MAAA,GAuCA,SAAAC,KA9BA5H,EAAArD,SAAA,SAAAC,EAAAmD,GAKA,OAHAA,EADAA,GACA,IAAAC,EACApD,EAAAhK,SACAmN,EAAAmD,WAAAtG,EAAAhK,SACAmN,EAAA2C,QAAA9F,EAAA0F,SAWAtC,EAAAjO,UAAA8V,YAAAjP,EAAAxB,KAAArJ,QAUAiS,EAAAjO,UAAAQ,MAAAqG,EAAArG,MAaAyN,EAAAjO,UAAA+N,KAAA,SAAAA,EAAAnN,EAAAC,EAAAC,GACA,mBAAAD,IACAC,EAAAD,EACAA,EAAAhG,GAEA,IAAAkb,EAAAjW,KACA,IAAAgB,EACA,OAAA+F,EAAApG,UAAAsN,EAAAgI,EAAAnV,EAAAC,GAEA,IAAAmV,EAAAlV,IAAA+U,EAGA,SAAAI,EAAA/Z,EAAA8R,GAEA,GAAAlN,EAAA,CAEA,IAAAoV,EAAApV,EAEA,GADAA,EAAA,KACAkV,EACA,MAAA9Z,EACAga,EAAAha,EAAA8R,IAIA,SAAAmI,EAAAvV,GACA,IAAAwV,EAAAxV,EAAAyV,YAAA,oBACA,IAAA,EAAAD,EAAA,CACA,IAAAE,EAAA1V,EAAA2V,UAAAH,GACA,GAAAE,KAAAZ,EAAA,OAAAY,EAEA,OAAA,KAIA,SAAAE,EAAA5V,EAAArC,GACA,IAGA,GAFAsI,EAAAsE,SAAA5M,IAAA,KAAAA,EAAA,KACAA,EAAAmB,KAAA+V,MAAAlX,IACAsI,EAAAsE,SAAA5M,GAEA,CACAkX,EAAA7U,SAAAA,EACA,IACA+L,EADA8J,EAAAhB,EAAAlX,EAAAwX,EAAAlV,GAEAjE,EAAA,EACA,GAAA6Z,EAAAC,QACA,KAAA9Z,EAAA6Z,EAAAC,QAAA/a,SAAAiB,GACA+P,EAAAwJ,EAAAM,EAAAC,QAAA9Z,KAAAmZ,EAAAD,YAAAlV,EAAA6V,EAAAC,QAAA9Z,MACA4D,EAAAmM,GACA,GAAA8J,EAAAE,YACA,IAAA/Z,EAAA,EAAAA,EAAA6Z,EAAAE,YAAAhb,SAAAiB,GACA+P,EAAAwJ,EAAAM,EAAAE,YAAA/Z,KAAAmZ,EAAAD,YAAAlV,EAAA6V,EAAAE,YAAA/Z,MACA4D,EAAAmM,GAAA,QAbAoJ,EAAA5E,WAAA5S,EAAAsC,SAAA8P,QAAApS,EAAAgS,QAeA,MAAArU,GACA+Z,EAAA/Z,GAEA8Z,GAAAY,GACAX,EAAA,KAAAF,GAIA,SAAAvV,EAAAI,EAAAiW,GAGA,KAAAd,EAAAH,MAAAzM,QAAAvI,GAKA,GAHAmV,EAAAH,MAAAtY,KAAAsD,GAGAA,KAAA8U,EACAM,EACAQ,EAAA5V,EAAA8U,EAAA9U,OAEAgW,EACAE,WAAA,aACAF,EACAJ,EAAA5V,EAAA8U,EAAA9U,YAOA,GAAAoV,EAAA,CACA,IAAAzX,EACA,IACAA,EAAAsI,EAAAnG,GAAAqW,aAAAnW,GAAApC,SAAA,QACA,MAAAtC,GAGA,YAFA2a,GACAZ,EAAA/Z,IAGAsa,EAAA5V,EAAArC,SAEAqY,EACAb,EAAAvV,MAAAI,EAAA,SAAA1E,EAAAqC,KACAqY,EAEA9V,IAEA5E,EAEA2a,EAEAD,GACAX,EAAA,KAAAF,GAFAE,EAAA/Z,GAKAsa,EAAA5V,EAAArC,MAIA,IAAAqY,EAAA,EAIA/P,EAAAsE,SAAAvK,KACAA,EAAA,CAAAA,IACA,IAAA,IAAA+L,EAAA/P,EAAA,EAAAA,EAAAgE,EAAAjF,SAAAiB,GACA+P,EAAAoJ,EAAAD,YAAA,GAAAlV,EAAAhE,MACA4D,EAAAmM,GAEA,OAAAqJ,EACAD,GACAa,GACAX,EAAA,KAAAF,GACAlb,IAgCAoT,EAAAjO,UAAAkO,SAAA,SAAAtN,EAAAC,GACA,IAAAgG,EAAAmQ,OACA,MAAAjZ,MAAA,iBACA,OAAA+B,KAAAiO,KAAAnN,EAAAC,EAAAgV,IAMA5H,EAAAjO,UAAA0R,WAAA,WACA,GAAA5R,KAAA6V,SAAAha,OACA,MAAAoC,MAAA,4BAAA+B,KAAA6V,SAAA1N,IAAA,SAAAjB,GACA,MAAA,WAAAA,EAAA6E,OAAA,QAAA7E,EAAA4F,OAAArF,WACA7J,KAAA,OACA,OAAA6M,EAAAvK,UAAA0R,WAAAtL,KAAAtG,OAIA,IAAAmX,EAAA,SAUA,SAAAC,EAAAlJ,EAAAhH,GACA,IAAAmQ,EAAAnQ,EAAA4F,OAAA+E,OAAA3K,EAAA6E,QACA,GAAAsL,EAAA,CACA,IAAAC,EAAA,IAAA3L,EAAAzE,EAAAO,SAAAP,EAAAuC,GAAAvC,EAAAS,KAAAT,EAAA4E,KAAA/Q,EAAAmM,EAAAnG,SAIA,OAHAuW,EAAAhL,eAAApF,GACAmF,eAAAiL,EACAD,EAAAjM,IAAAkM,GACA,GAWAnJ,EAAAjO,UAAAsS,EAAA,SAAAzC,GACA,GAAAA,aAAApE,EAEAoE,EAAAhE,SAAAhR,GAAAgV,EAAA1D,gBACA+K,EAAApX,EAAA+P,IACA/P,KAAA6V,SAAArY,KAAAuS,QAEA,GAAAA,aAAAjJ,EAEAqQ,EAAAjZ,KAAA6R,EAAA9H,QACA8H,EAAAjD,OAAAiD,EAAA9H,MAAA8H,EAAAzI,aAEA,KAAAyI,aAAAvB,GAAA,CAEA,GAAAuB,aAAAnE,EACA,IAAA,IAAA9O,EAAA,EAAAA,EAAAkD,KAAA6V,SAAAha,QACAub,EAAApX,EAAAA,KAAA6V,SAAA/Y,IACAkD,KAAA6V,SAAAtV,OAAAzD,EAAA,KAEAA,EACA,IAAA,IAAAQ,EAAA,EAAAA,EAAAyS,EAAAgB,YAAAlV,SAAAyB,EACA0C,KAAAwS,EAAAzC,EAAAW,EAAApT,IACA6Z,EAAAjZ,KAAA6R,EAAA9H,QACA8H,EAAAjD,OAAAiD,EAAA9H,MAAA8H,KAcA5B,EAAAjO,UAAAuS,EAAA,SAAA1C,GACA,GAAAA,aAAApE,GAEA,GAAAoE,EAAAhE,SAAAhR,EACA,GAAAgV,EAAA1D,eACA0D,EAAA1D,eAAAS,OAAApB,OAAAqE,EAAA1D,gBACA0D,EAAA1D,eAAA,SACA,CACA,IAAAtQ,EAAAiE,KAAA6V,SAAAxM,QAAA0G,IAEA,EAAAhU,GACAiE,KAAA6V,SAAAtV,OAAAxE,EAAA,SAIA,GAAAgU,aAAAjJ,EAEAqQ,EAAAjZ,KAAA6R,EAAA9H,cACA8H,EAAAjD,OAAAiD,EAAA9H,WAEA,GAAA8H,aAAAtF,EAAA,CAEA,IAAA,IAAA3N,EAAA,EAAAA,EAAAiT,EAAAgB,YAAAlV,SAAAiB,EACAkD,KAAAyS,EAAA1C,EAAAW,EAAA5T,IAEAqa,EAAAjZ,KAAA6R,EAAA9H,cACA8H,EAAAjD,OAAAiD,EAAA9H,QAMAkG,EAAAL,EAAA,SAAAC,EAAAwJ,EAAAC,GACA5L,EAAAmC,EACA4H,EAAA4B,EACA3B,EAAA4B,uDCxWAlc,EAAAC,QAAA,4BCKAA,EA6BAmT,QAAArT,EAAA,gCClCAC,EAAAC,QAAAmT,EAEA,IAAA3H,EAAA1L,EAAA,IAsCA,SAAAqT,EAAA+I,EAAAC,EAAAC,GAEA,GAAA,mBAAAF,EACA,MAAA7M,UAAA,8BAEA7D,EAAAhH,aAAAuG,KAAAtG,MAMAA,KAAAyX,QAAAA,EAMAzX,KAAA0X,mBAAAA,EAMA1X,KAAA2X,oBAAAA,IA1DAjJ,EAAAxO,UAAAnB,OAAAuL,OAAAvD,EAAAhH,aAAAG,YAAAqK,YAAAmE,GAwEAxO,UAAA0X,QAAA,SAAAA,EAAAC,EAAAC,EAAAC,EAAAC,EAAAhX,GAEA,IAAAgX,EACA,MAAApN,UAAA,6BAEA,IAAAqL,EAAAjW,KACA,IAAAgB,EACA,OAAA+F,EAAApG,UAAAiX,EAAA3B,EAAA4B,EAAAC,EAAAC,EAAAC,GAEA,IAAA/B,EAAAwB,QAEA,OADAT,WAAA,WAAAhW,EAAA/C,MAAA,mBAAA,GACAlD,EAGA,IACA,OAAAkb,EAAAwB,QACAI,EACAC,EAAA7B,EAAAyB,iBAAA,kBAAA,UAAAM,GAAA7B,SACA,SAAA/Z,EAAAqF,GAEA,GAAArF,EAEA,OADA6Z,EAAAzV,KAAA,QAAApE,EAAAyb,GACA7W,EAAA5E,GAGA,GAAA,OAAAqF,EAEA,OADAwU,EAAA/Y,KAAA,GACAnC,EAGA,KAAA0G,aAAAsW,GACA,IACAtW,EAAAsW,EAAA9B,EAAA0B,kBAAA,kBAAA,UAAAlW,GACA,MAAArF,GAEA,OADA6Z,EAAAzV,KAAA,QAAApE,EAAAyb,GACA7W,EAAA5E,GAKA,OADA6Z,EAAAzV,KAAA,OAAAiB,EAAAoW,GACA7W,EAAA,KAAAS,KAGA,MAAArF,GAGA,OAFA6Z,EAAAzV,KAAA,QAAApE,EAAAyb,GACAb,WAAA,WAAAhW,EAAA5E,IAAA,GACArB,IASA2T,EAAAxO,UAAAhD,IAAA,SAAA+a,GAOA,OANAjY,KAAAyX,UACAQ,GACAjY,KAAAyX,QAAA,KAAA,KAAA,MACAzX,KAAAyX,QAAA,KACAzX,KAAAQ,KAAA,OAAAH,OAEAL,kCC3IA1E,EAAAC,QAAAmT,EAGA,IAAAjE,EAAApP,EAAA,MACAqT,EAAAxO,UAAAnB,OAAAuL,OAAAG,EAAAvK,YAAAqK,YAAAmE,GAAAlE,UAAA,UAEA,IAAAmE,EAAAtT,EAAA,IACA0L,EAAA1L,EAAA,IACA8T,EAAA9T,EAAA,IAWA,SAAAqT,EAAAzG,EAAAlH,GACA0J,EAAAnE,KAAAtG,KAAAiI,EAAAlH,GAMAf,KAAAkR,QAAA,GAOAlR,KAAAkY,EAAA,KAyDA,SAAAvH,EAAAwH,GAEA,OADAA,EAAAD,EAAA,KACAC,EA1CAzJ,EAAA5D,SAAA,SAAA7C,EAAA8C,GACA,IAAAoN,EAAA,IAAAzJ,EAAAzG,EAAA8C,EAAAhK,SAEA,GAAAgK,EAAAmG,QACA,IAAA,IAAAD,EAAAlS,OAAAC,KAAA+L,EAAAmG,SAAApU,EAAA,EAAAA,EAAAmU,EAAApV,SAAAiB,EACAqb,EAAA/M,IAAAuD,EAAA7D,SAAAmG,EAAAnU,GAAAiO,EAAAmG,QAAAD,EAAAnU,MAIA,OAHAiO,EAAA0F,QACA0H,EAAAtH,QAAA9F,EAAA0F,QACA0H,EAAAzN,QAAAK,EAAAL,QACAyN,GAQAzJ,EAAAxO,UAAA+K,OAAA,SAAAC,GACA,IAAAkN,EAAA3N,EAAAvK,UAAA+K,OAAA3E,KAAAtG,KAAAkL,GACAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,UAAAgQ,GAAAA,EAAArX,SAAAhG,EACA,UAAA0P,EAAA6F,YAAAtQ,KAAAqY,aAAAnN,IAAA,GACA,SAAAkN,GAAAA,EAAA3H,QAAA1V,EACA,UAAAoQ,EAAAnL,KAAA0K,QAAA3P,KAUAgE,OAAAyN,eAAAkC,EAAAxO,UAAA,eAAA,CACAuM,IAAA,WACA,OAAAzM,KAAAkY,IAAAlY,KAAAkY,EAAAnR,EAAA+J,QAAA9Q,KAAAkR,aAYAxC,EAAAxO,UAAAuM,IAAA,SAAAxE,GACA,OAAAjI,KAAAkR,QAAAjJ,IACAwC,EAAAvK,UAAAuM,IAAAnG,KAAAtG,KAAAiI,IAMAyG,EAAAxO,UAAA0R,WAAA,WAEA,IADA,IAAAV,EAAAlR,KAAAqY,aACAvb,EAAA,EAAAA,EAAAoU,EAAArV,SAAAiB,EACAoU,EAAApU,GAAAZ,UACA,OAAAuO,EAAAvK,UAAAhE,QAAAoK,KAAAtG,OAMA0O,EAAAxO,UAAAkL,IAAA,SAAA2E,GAGA,GAAA/P,KAAAyM,IAAAsD,EAAA9H,MACA,MAAAhK,MAAA,mBAAA8R,EAAA9H,KAAA,QAAAjI,MAEA,OAAA+P,aAAApB,EAGAgC,GAFA3Q,KAAAkR,QAAAnB,EAAA9H,MAAA8H,GACAjD,OAAA9M,MAGAyK,EAAAvK,UAAAkL,IAAA9E,KAAAtG,KAAA+P,IAMArB,EAAAxO,UAAAwL,OAAA,SAAAqE,GACA,GAAAA,aAAApB,EAAA,CAGA,GAAA3O,KAAAkR,QAAAnB,EAAA9H,QAAA8H,EACA,MAAA9R,MAAA8R,EAAA,uBAAA/P,MAIA,cAFAA,KAAAkR,QAAAnB,EAAA9H,MACA8H,EAAAjD,OAAA,KACA6D,EAAA3Q,MAEA,OAAAyK,EAAAvK,UAAAwL,OAAApF,KAAAtG,KAAA+P,IAUArB,EAAAxO,UAAAoK,OAAA,SAAAmN,EAAAC,EAAAC,GAEA,IADA,IACAE,EADAS,EAAA,IAAAnJ,EAAAT,QAAA+I,EAAAC,EAAAC,GACA7a,EAAA,EAAAA,EAAAkD,KAAAqY,aAAAxc,SAAAiB,EAAA,CACA,IAAAyb,EAAAxR,EAAAyR,SAAAX,EAAA7X,KAAAkY,EAAApb,IAAAZ,UAAA+L,MAAA1I,QAAA,WAAA,IACA+Y,EAAAC,GAAAxR,EAAA5I,QAAA,CAAA,IAAA,KAAA4I,EAAA0R,WAAAF,GAAAA,EAAA,IAAAA,EAAAxR,CAAA,iCAAAA,CAAA,CACA2R,EAAAb,EACAc,EAAAd,EAAA1H,oBAAA9C,KACAuL,EAAAf,EAAAzH,qBAAA/C,OAGA,OAAAiL,iDCpKAhd,EAAAC,QAAAqQ,EAGA,IAAAnB,EAAApP,EAAA,MACAuQ,EAAA1L,UAAAnB,OAAAuL,OAAAG,EAAAvK,YAAAqK,YAAAqB,GAAApB,UAAA,OAEA,IAAA1D,EAAAzL,EAAA,IACAmT,EAAAnT,EAAA,IACAsQ,EAAAtQ,EAAA,IACAoT,EAAApT,EAAA,IACAqT,EAAArT,EAAA,IACAuT,EAAAvT,EAAA,IACA4T,EAAA5T,EAAA,IACA0T,EAAA1T,EAAA,IACA0L,EAAA1L,EAAA,IACAgT,EAAAhT,EAAA,IACAiT,EAAAjT,EAAA,IACAkT,EAAAlT,EAAA,IACAwL,EAAAxL,EAAA,IACAwT,EAAAxT,EAAA,IAUA,SAAAuQ,EAAA3D,EAAAlH,GACA0J,EAAAnE,KAAAtG,KAAAiI,EAAAlH,GAMAf,KAAA+H,OAAA,GAMA/H,KAAA6Y,OAAA9d,EAMAiF,KAAA8Y,WAAA/d,EAMAiF,KAAA6K,SAAA9P,EAMAiF,KAAAuJ,MAAAxO,EAOAiF,KAAA+Y,EAAA,KAOA/Y,KAAAoJ,EAAA,KAOApJ,KAAAgZ,EAAA,KAOAhZ,KAAAiZ,EAAA,KA0HA,SAAAtI,EAAAhJ,GAKA,OAJAA,EAAAoR,EAAApR,EAAAyB,EAAAzB,EAAAqR,EAAA,YACArR,EAAA5K,cACA4K,EAAA7J,cACA6J,EAAAmI,OACAnI,EA5HA5I,OAAAuT,iBAAA1G,EAAA1L,UAAA,CAQAgZ,WAAA,CACAzM,IAAA,WAGA,GAAAzM,KAAA+Y,EACA,OAAA/Y,KAAA+Y,EAEA/Y,KAAA+Y,EAAA,GACA,IAAA,IAAA9H,EAAAlS,OAAAC,KAAAgB,KAAA+H,QAAAjL,EAAA,EAAAA,EAAAmU,EAAApV,SAAAiB,EAAA,CACA,IAAAoK,EAAAlH,KAAA+H,OAAAkJ,EAAAnU,IACA2M,EAAAvC,EAAAuC,GAGA,GAAAzJ,KAAA+Y,EAAAtP,GACA,MAAAxL,MAAA,gBAAAwL,EAAA,OAAAzJ,MAEAA,KAAA+Y,EAAAtP,GAAAvC,EAEA,OAAAlH,KAAA+Y,IAUA/Q,YAAA,CACAyE,IAAA,WACA,OAAAzM,KAAAoJ,IAAApJ,KAAAoJ,EAAArC,EAAA+J,QAAA9Q,KAAA+H,WAUAoR,YAAA,CACA1M,IAAA,WACA,OAAAzM,KAAAgZ,IAAAhZ,KAAAgZ,EAAAjS,EAAA+J,QAAA9Q,KAAA6Y,WAUAxL,KAAA,CACAZ,IAAA,WACA,OAAAzM,KAAAiZ,IAAAjZ,KAAAqN,KAAAzB,EAAAwN,oBAAApZ,KAAA4L,KAEA4H,IAAA,SAAAnG,GAGA,IAAAnN,EAAAmN,EAAAnN,UACAA,aAAA0O,KACAvB,EAAAnN,UAAA,IAAA0O,GAAArE,YAAA8C,EACAtG,EAAAmO,MAAA7H,EAAAnN,UAAAA,IAIAmN,EAAAoC,MAAApC,EAAAnN,UAAAuP,MAAAzP,KAGA+G,EAAAmO,MAAA7H,EAAAuB,GAAA,GAEA5O,KAAAiZ,EAAA5L,EAIA,IADA,IAAAvQ,EAAA,EACAA,EAAAkD,KAAAgI,YAAAnM,SAAAiB,EACAkD,KAAAoJ,EAAAtM,GAAAZ,UAGA,IAAAmd,EAAA,GACA,IAAAvc,EAAA,EAAAA,EAAAkD,KAAAmZ,YAAAtd,SAAAiB,EACAuc,EAAArZ,KAAAgZ,EAAAlc,GAAAZ,UAAA+L,MAAA,CACAwE,IAAA1F,EAAAwM,YAAAvT,KAAAgZ,EAAAlc,GAAAsW,OACAI,IAAAzM,EAAA0M,YAAAzT,KAAAgZ,EAAAlc,GAAAsW,QAEAtW,GACAiC,OAAAuT,iBAAAjF,EAAAnN,UAAAmZ,OAUAzN,EAAAwN,oBAAA,SAAAtR,GAIA,IAFA,IAEAZ,EAFAD,EAAAF,EAAA5I,QAAA,CAAA,KAAA2J,EAAAG,MAEAnL,EAAA,EAAAA,EAAAgL,EAAAE,YAAAnM,SAAAiB,GACAoK,EAAAY,EAAAsB,EAAAtM,IAAAqL,IAAAlB,EACA,YAAAF,EAAAmB,SAAAhB,EAAAe,OACAf,EAAAK,UAAAN,EACA,YAAAF,EAAAmB,SAAAhB,EAAAe,OACA,OAAAhB,EACA,wEADAA,CAEA,yBA6BA2E,EAAAd,SAAA,SAAA7C,EAAA8C,GACA,IAAApD,EAAA,IAAAiE,EAAA3D,EAAA8C,EAAAhK,SACA4G,EAAAmR,WAAA/N,EAAA+N,WACAnR,EAAAkD,SAAAE,EAAAF,SAGA,IAFA,IAAAoG,EAAAlS,OAAAC,KAAA+L,EAAAhD,QACAjL,EAAA,EACAA,EAAAmU,EAAApV,SAAAiB,EACA6K,EAAAyD,UACA,IAAAL,EAAAhD,OAAAkJ,EAAAnU,IAAA8M,QACA6E,EAAA3D,SACAa,EAAAb,UAAAmG,EAAAnU,GAAAiO,EAAAhD,OAAAkJ,EAAAnU,MAEA,GAAAiO,EAAA8N,OACA,IAAA5H,EAAAlS,OAAAC,KAAA+L,EAAA8N,QAAA/b,EAAA,EAAAA,EAAAmU,EAAApV,SAAAiB,EACA6K,EAAAyD,IAAAoD,EAAA1D,SAAAmG,EAAAnU,GAAAiO,EAAA8N,OAAA5H,EAAAnU,MACA,GAAAiO,EAAA0F,OACA,IAAAQ,EAAAlS,OAAAC,KAAA+L,EAAA0F,QAAA3T,EAAA,EAAAA,EAAAmU,EAAApV,SAAAiB,EAAA,CACA,IAAA2T,EAAA1F,EAAA0F,OAAAQ,EAAAnU,IACA6K,EAAAyD,KACAqF,EAAAhH,KAAA1O,EACA4Q,EAAAb,SACA2F,EAAA1I,SAAAhN,EACA6Q,EAAAd,SACA2F,EAAAnJ,SAAAvM,EACA+L,EAAAgE,SACA2F,EAAAS,UAAAnW,EACA2T,EAAA5D,SACAL,EAAAK,UAAAmG,EAAAnU,GAAA2T,IAWA,OARA1F,EAAA+N,YAAA/N,EAAA+N,WAAAjd,SACA8L,EAAAmR,WAAA/N,EAAA+N,YACA/N,EAAAF,UAAAE,EAAAF,SAAAhP,SACA8L,EAAAkD,SAAAE,EAAAF,UACAE,EAAAxB,QACA5B,EAAA4B,OAAA,GACAwB,EAAAL,UACA/C,EAAA+C,QAAAK,EAAAL,SACA/C,GAQAiE,EAAA1L,UAAA+K,OAAA,SAAAC,GACA,IAAAkN,EAAA3N,EAAAvK,UAAA+K,OAAA3E,KAAAtG,KAAAkL,GACAC,IAAAD,KAAAA,EAAAC,aACA,OAAApE,EAAAqB,SAAA,CACA,UAAAgQ,GAAAA,EAAArX,SAAAhG,EACA,SAAA0P,EAAA6F,YAAAtQ,KAAAmZ,YAAAjO,GACA,SAAAT,EAAA6F,YAAAtQ,KAAAgI,YAAAsB,OAAA,SAAAkH,GAAA,OAAAA,EAAAlE,iBAAApB,IAAA,GACA,aAAAlL,KAAA8Y,YAAA9Y,KAAA8Y,WAAAjd,OAAAmE,KAAA8Y,WAAA/d,EACA,WAAAiF,KAAA6K,UAAA7K,KAAA6K,SAAAhP,OAAAmE,KAAA6K,SAAA9P,EACA,QAAAiF,KAAAuJ,OAAAxO,EACA,SAAAqd,GAAAA,EAAA3H,QAAA1V,EACA,UAAAoQ,EAAAnL,KAAA0K,QAAA3P,KAOA6Q,EAAA1L,UAAA0R,WAAA,WAEA,IADA,IAAA7J,EAAA/H,KAAAgI,YAAAlL,EAAA,EACAA,EAAAiL,EAAAlM,QACAkM,EAAAjL,KAAAZ,UACA,IAAA2c,EAAA7Y,KAAAmZ,YACA,IADArc,EAAA,EACAA,EAAA+b,EAAAhd,QACAgd,EAAA/b,KAAAZ,UACA,OAAAuO,EAAAvK,UAAA0R,WAAAtL,KAAAtG,OAMA4L,EAAA1L,UAAAuM,IAAA,SAAAxE,GACA,OAAAjI,KAAA+H,OAAAE,IACAjI,KAAA6Y,QAAA7Y,KAAA6Y,OAAA5Q,IACAjI,KAAAyQ,QAAAzQ,KAAAyQ,OAAAxI,IACA,MAUA2D,EAAA1L,UAAAkL,IAAA,SAAA2E,GAEA,GAAA/P,KAAAyM,IAAAsD,EAAA9H,MACA,MAAAhK,MAAA,mBAAA8R,EAAA9H,KAAA,QAAAjI,MAEA,GAAA+P,aAAApE,GAAAoE,EAAAhE,SAAAhR,EAAA,CAMA,GAAAiF,KAAA+Y,EAAA/Y,KAAA+Y,EAAAhJ,EAAAtG,IAAAzJ,KAAAkZ,WAAAnJ,EAAAtG,IACA,MAAAxL,MAAA,gBAAA8R,EAAAtG,GAAA,OAAAzJ,MACA,GAAAA,KAAAuL,aAAAwE,EAAAtG,IACA,MAAAxL,MAAA,MAAA8R,EAAAtG,GAAA,mBAAAzJ,MACA,GAAAA,KAAAwL,eAAAuE,EAAA9H,MACA,MAAAhK,MAAA,SAAA8R,EAAA9H,KAAA,oBAAAjI,MAOA,OALA+P,EAAAjD,QACAiD,EAAAjD,OAAApB,OAAAqE,IACA/P,KAAA+H,OAAAgI,EAAA9H,MAAA8H,GACA7D,QAAAlM,KACA+P,EAAAuB,MAAAtR,MACA2Q,EAAA3Q,MAEA,OAAA+P,aAAAvB,GACAxO,KAAA6Y,SACA7Y,KAAA6Y,OAAA,KACA7Y,KAAA6Y,OAAA9I,EAAA9H,MAAA8H,GACAuB,MAAAtR,MACA2Q,EAAA3Q,OAEAyK,EAAAvK,UAAAkL,IAAA9E,KAAAtG,KAAA+P,IAUAnE,EAAA1L,UAAAwL,OAAA,SAAAqE,GACA,GAAAA,aAAApE,GAAAoE,EAAAhE,SAAAhR,EAAA,CAIA,IAAAiF,KAAA+H,QAAA/H,KAAA+H,OAAAgI,EAAA9H,QAAA8H,EACA,MAAA9R,MAAA8R,EAAA,uBAAA/P,MAKA,cAHAA,KAAA+H,OAAAgI,EAAA9H,MACA8H,EAAAjD,OAAA,KACAiD,EAAAwB,SAAAvR,MACA2Q,EAAA3Q,MAEA,GAAA+P,aAAAvB,EAAA,CAGA,IAAAxO,KAAA6Y,QAAA7Y,KAAA6Y,OAAA9I,EAAA9H,QAAA8H,EACA,MAAA9R,MAAA8R,EAAA,uBAAA/P,MAKA,cAHAA,KAAA6Y,OAAA9I,EAAA9H,MACA8H,EAAAjD,OAAA,KACAiD,EAAAwB,SAAAvR,MACA2Q,EAAA3Q,MAEA,OAAAyK,EAAAvK,UAAAwL,OAAApF,KAAAtG,KAAA+P,IAQAnE,EAAA1L,UAAAqL,aAAA,SAAA9B,GACA,OAAAgB,EAAAc,aAAAvL,KAAA6K,SAAApB,IAQAmC,EAAA1L,UAAAsL,eAAA,SAAAvD,GACA,OAAAwC,EAAAe,eAAAxL,KAAA6K,SAAA5C,IAQA2D,EAAA1L,UAAAoK,OAAA,SAAAkF,GACA,OAAA,IAAAxP,KAAAqN,KAAAmC,IAOA5D,EAAA1L,UAAAoZ,MAAA,WAMA,IAFA,IAAA7R,EAAAzH,KAAAyH,SACAiC,EAAA,GACA5M,EAAA,EAAAA,EAAAkD,KAAAgI,YAAAnM,SAAAiB,EACA4M,EAAAlM,KAAAwC,KAAAoJ,EAAAtM,GAAAZ,UAAAmL,cAGArH,KAAAjD,OAAAsR,EAAArO,KAAAqO,CAAA,CACAU,OAAAA,EACArF,MAAAA,EACA3C,KAAAA,IAEA/G,KAAAlC,OAAAwQ,EAAAtO,KAAAsO,CAAA,CACAW,OAAAA,EACAvF,MAAAA,EACA3C,KAAAA,IAEA/G,KAAA8P,OAAAvB,EAAAvO,KAAAuO,CAAA,CACA7E,MAAAA,EACA3C,KAAAA,IAEA/G,KAAA6H,WAAAhB,EAAAgB,WAAA7H,KAAA6G,CAAA,CACA6C,MAAAA,EACA3C,KAAAA,IAEA/G,KAAAoI,SAAAvB,EAAAuB,SAAApI,KAAA6G,CAAA,CACA6C,MAAAA,EACA3C,KAAAA,IAIA,IAAAwS,EAAA1K,EAAApH,GACA,GAAA8R,EAAA,CACA,IAAAC,EAAAza,OAAAuL,OAAAtK,MAEAwZ,EAAA3R,WAAA7H,KAAA6H,WACA7H,KAAA6H,WAAA0R,EAAA1R,WAAApD,KAAA+U,GAGAA,EAAApR,SAAApI,KAAAoI,SACApI,KAAAoI,SAAAmR,EAAAnR,SAAA3D,KAAA+U,GAIA,OAAAxZ,MASA4L,EAAA1L,UAAAnD,OAAA,SAAAmP,EAAAwD,GACA,OAAA1P,KAAAsZ,QAAAvc,OAAAmP,EAAAwD,IASA9D,EAAA1L,UAAAyP,gBAAA,SAAAzD,EAAAwD,GACA,OAAA1P,KAAAjD,OAAAmP,EAAAwD,GAAAA,EAAAlJ,IAAAkJ,EAAA+J,OAAA/J,GAAAgK,UAWA9N,EAAA1L,UAAApC,OAAA,SAAA8R,EAAA/T,GACA,OAAAmE,KAAAsZ,QAAAxb,OAAA8R,EAAA/T,IAUA+P,EAAA1L,UAAA2P,gBAAA,SAAAD,GAGA,OAFAA,aAAAX,IACAW,EAAAX,EAAA3E,OAAAsF,IACA5P,KAAAlC,OAAA8R,EAAAA,EAAA2E,WAQA3I,EAAA1L,UAAA4P,OAAA,SAAA5D,GACA,OAAAlM,KAAAsZ,QAAAxJ,OAAA5D,IAQAN,EAAA1L,UAAA2H,WAAA,SAAAkI,GACA,OAAA/P,KAAAsZ,QAAAzR,WAAAkI,IA4BAnE,EAAA1L,UAAAkI,SAAA,SAAA8D,EAAAnL,GACA,OAAAf,KAAAsZ,QAAAlR,SAAA8D,EAAAnL,IAkBA6K,EAAA0B,EAAA,SAAAqM,GACA,OAAA,SAAAC,GACA7S,EAAA2G,aAAAkM,EAAAD,uHCpkBA,IAAAjQ,EAAAnO,EAEAwL,EAAA1L,EAAA,IAEAud,EAAA,CACA,SACA,QACA,QACA,SACA,SACA,UACA,WACA,QACA,SACA,SACA,UACA,WACA,OACA,SACA,SAGA,SAAAiB,EAAAvS,EAAAxL,GACA,IAAAgB,EAAA,EAAAgd,EAAA,GAEA,IADAhe,GAAA,EACAgB,EAAAwK,EAAAzL,QAAAie,EAAAlB,EAAA9b,EAAAhB,IAAAwL,EAAAxK,KACA,OAAAgd,EAuBApQ,EAAAG,MAAAgQ,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IAwBAnQ,EAAAC,SAAAkQ,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,EACA,GACA9S,EAAAqG,WACA,OAaA1D,EAAAd,KAAAiR,EAAA,CACA,EACA,EACA,EACA,EACA,GACA,GAmBAnQ,EAAAQ,OAAA2P,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GAoBAnQ,EAAAI,OAAA+P,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,gCC5LA,IAIAjO,EACA9E,EALAC,EAAAzL,EAAAC,QAAAF,EAAA,IAEA+T,EAAA/T,EAAA,IAKA0L,EAAA5I,QAAA9C,EAAA,GACA0L,EAAArG,MAAArF,EAAA,GACA0L,EAAAxB,KAAAlK,EAAA,GAMA0L,EAAAnG,GAAAmG,EAAAlG,QAAA,MAOAkG,EAAA+J,QAAA,SAAAf,GACA,GAAAA,EAAA,CAIA,IAHA,IAAA/Q,EAAAD,OAAAC,KAAA+Q,GACAQ,EAAA5U,MAAAqD,EAAAnD,QACAE,EAAA,EACAA,EAAAiD,EAAAnD,QACA0U,EAAAxU,GAAAgU,EAAA/Q,EAAAjD,MACA,OAAAwU,EAEA,MAAA,IAQAxJ,EAAAqB,SAAA,SAAAmI,GAGA,IAFA,IAAAR,EAAA,GACAhU,EAAA,EACAA,EAAAwU,EAAA1U,QAAA,CACA,IAAAke,EAAAxJ,EAAAxU,KACAoG,EAAAoO,EAAAxU,KACAoG,IAAApH,IACAgV,EAAAgK,GAAA5X,GAEA,OAAA4N,GAGA,IAAAiK,EAAA,MACAC,EAAA,KAOAlT,EAAA0R,WAAA,SAAAxQ,GACA,MAAA,uTAAA/J,KAAA+J,IAQAlB,EAAAmB,SAAA,SAAAd,GACA,OAAA,YAAAlJ,KAAAkJ,IAAAL,EAAA0R,WAAArR,GACA,KAAAA,EAAA7H,QAAAya,EAAA,QAAAza,QAAA0a,EAAA,OAAA,KACA,IAAA7S,GAQAL,EAAAmT,QAAA,SAAAC,GACA,OAAAA,EAAA,GAAAC,cAAAD,EAAA1D,UAAA,IAGA,IAAA4D,EAAA,YAOAtT,EAAAuT,UAAA,SAAAH,GACA,OAAAA,EAAA1D,UAAA,EAAA,GACA0D,EAAA1D,UAAA,GACAlX,QAAA8a,EAAA,SAAA7a,EAAAC,GAAA,OAAAA,EAAA2a,iBASArT,EAAAuB,kBAAA,SAAAiS,EAAAhd,GACA,OAAAgd,EAAA9Q,GAAAlM,EAAAkM,IAWA1C,EAAA2G,aAAA,SAAAL,EAAAsM,GAGA,GAAAtM,EAAAoC,MAMA,OALAkK,GAAAtM,EAAAoC,MAAAxH,OAAA0R,IACA5S,EAAAyT,aAAA9O,OAAA2B,EAAAoC,OACApC,EAAAoC,MAAAxH,KAAA0R,EACA5S,EAAAyT,aAAApP,IAAAiC,EAAAoC,QAEApC,EAAAoC,MAOA,IAAA9H,EAAA,IAFAiE,EADAA,GACAvQ,EAAA,KAEAse,GAAAtM,EAAApF,MAKA,OAJAlB,EAAAyT,aAAApP,IAAAzD,GACAA,EAAA0F,KAAAA,EACAtO,OAAAyN,eAAAa,EAAA,QAAA,CAAA3N,MAAAiI,EAAA8S,YAAA,IACA1b,OAAAyN,eAAAa,EAAAnN,UAAA,QAAA,CAAAR,MAAAiI,EAAA8S,YAAA,IACA9S,GAGA,IAAA+S,EAAA,EAOA3T,EAAA4G,aAAA,SAAAoC,GAGA,GAAAA,EAAAN,MACA,OAAAM,EAAAN,MAMA,IAAAzE,EAAA,IAFAlE,EADAA,GACAzL,EAAA,KAEA,OAAAqf,IAAA3K,GAGA,OAFAhJ,EAAAyT,aAAApP,IAAAJ,GACAjM,OAAAyN,eAAAuD,EAAA,QAAA,CAAArQ,MAAAsL,EAAAyP,YAAA,IACAzP,GAWAjE,EAAAiM,YAAA,SAAA2H,EAAApV,EAAA7F,GAcA,GAAA,iBAAAib,EACA,MAAA/P,UAAA,yBACA,IAAArF,EACA,MAAAqF,UAAA,0BAGA,OAnBA,SAAAgQ,EAAAD,EAAApV,EAAA7F,GACA,IAAAiS,EAAApM,EAAAM,QACA,GAAA,EAAAN,EAAA1J,OACA8e,EAAAhJ,GAAAiJ,EAAAD,EAAAhJ,IAAA,GAAApM,EAAA7F,OACA,CACA,IAAAmb,EAAAF,EAAAhJ,GACAkJ,IACAnb,EAAA,GAAAob,OAAAD,GAAAC,OAAApb,IACAib,EAAAhJ,GAAAjS,EAEA,OAAAib,EASAC,CAAAD,EADApV,EAAAA,EAAAG,MAAA,KACAhG,IASAX,OAAAyN,eAAAzF,EAAA,eAAA,CACA0F,IAAA,WACA,OAAA2C,EAAA,YAAAA,EAAA,UAAA,IAAA/T,EAAA,yEC7MAC,EAAAC,QAAAmY,EAEA,IAAA3M,EAAA1L,EAAA,IAUA,SAAAqY,EAAA5P,EAAAC,GASA/D,KAAA8D,GAAAA,IAAA,EAMA9D,KAAA+D,GAAAA,IAAA,EAQA,IAAAgX,EAAArH,EAAAqH,KAAA,IAAArH,EAAA,EAAA,GAEAqH,EAAA/R,SAAA,WAAA,OAAA,GACA+R,EAAAC,SAAAD,EAAAzF,SAAA,WAAA,OAAAtV,MACA+a,EAAAlf,OAAA,WAAA,OAAA,GAOA,IAAAof,EAAAvH,EAAAuH,SAAA,mBAOAvH,EAAA1G,WAAA,SAAAtN,GACA,GAAA,IAAAA,EACA,OAAAqb,EACA,IAAAzY,EAAA5C,EAAA,EACA4C,IACA5C,GAAAA,GACA,IAAAoE,EAAApE,IAAA,EACAqE,GAAArE,EAAAoE,GAAA,aAAA,EAUA,OATAxB,IACAyB,GAAAA,IAAA,EACAD,GAAAA,IAAA,EACA,aAAAA,IACAA,EAAA,EACA,aAAAC,IACAA,EAAA,KAGA,IAAA2P,EAAA5P,EAAAC,IAQA2P,EAAAwH,KAAA,SAAAxb,GACA,GAAA,iBAAAA,EACA,OAAAgU,EAAA1G,WAAAtN,GACA,GAAAqH,EAAAsE,SAAA3L,GAAA,CAEA,IAAAqH,EAAAqF,KAGA,OAAAsH,EAAA1G,WAAAmO,SAAAzb,EAAA,KAFAA,EAAAqH,EAAAqF,KAAAgP,WAAA1b,GAIA,OAAAA,EAAAmJ,KAAAnJ,EAAAoJ,KAAA,IAAA4K,EAAAhU,EAAAmJ,MAAA,EAAAnJ,EAAAoJ,OAAA,GAAAiS,GAQArH,EAAAxT,UAAA8I,SAAA,SAAAD,GACA,IAAAA,GAAA/I,KAAA+D,KAAA,GAAA,CACA,IAAAD,EAAA,GAAA9D,KAAA8D,KAAA,EACAC,GAAA/D,KAAA+D,KAAA,EAGA,OAFAD,IACAC,EAAAA,EAAA,IAAA,KACAD,EAAA,WAAAC,GAEA,OAAA/D,KAAA8D,GAAA,WAAA9D,KAAA+D,IAQA2P,EAAAxT,UAAAmb,OAAA,SAAAtS,GACA,OAAAhC,EAAAqF,KACA,IAAArF,EAAAqF,KAAA,EAAApM,KAAA8D,GAAA,EAAA9D,KAAA+D,KAAAgF,GAEA,CAAAF,IAAA,EAAA7I,KAAA8D,GAAAgF,KAAA,EAAA9I,KAAA+D,GAAAgF,WAAAA,IAGA,IAAA/K,EAAAP,OAAAyC,UAAAlC,WAOA0V,EAAA4H,SAAA,SAAAC,GACA,OAAAA,IAAAN,EACAF,EACA,IAAArH,GACA1V,EAAAsI,KAAAiV,EAAA,GACAvd,EAAAsI,KAAAiV,EAAA,IAAA,EACAvd,EAAAsI,KAAAiV,EAAA,IAAA,GACAvd,EAAAsI,KAAAiV,EAAA,IAAA,MAAA,GAEAvd,EAAAsI,KAAAiV,EAAA,GACAvd,EAAAsI,KAAAiV,EAAA,IAAA,EACAvd,EAAAsI,KAAAiV,EAAA,IAAA,GACAvd,EAAAsI,KAAAiV,EAAA,IAAA,MAAA,IAQA7H,EAAAxT,UAAAsb,OAAA,WACA,OAAA/d,OAAAC,aACA,IAAAsC,KAAA8D,GACA9D,KAAA8D,KAAA,EAAA,IACA9D,KAAA8D,KAAA,GAAA,IACA9D,KAAA8D,KAAA,GACA,IAAA9D,KAAA+D,GACA/D,KAAA+D,KAAA,EAAA,IACA/D,KAAA+D,KAAA,GAAA,IACA/D,KAAA+D,KAAA,KAQA2P,EAAAxT,UAAA8a,SAAA,WACA,IAAAS,EAAAzb,KAAA+D,IAAA,GAGA,OAFA/D,KAAA+D,KAAA/D,KAAA+D,IAAA,EAAA/D,KAAA8D,KAAA,IAAA2X,KAAA,EACAzb,KAAA8D,IAAA9D,KAAA8D,IAAA,EAAA2X,KAAA,EACAzb,MAOA0T,EAAAxT,UAAAoV,SAAA,WACA,IAAAmG,IAAA,EAAAzb,KAAA8D,IAGA,OAFA9D,KAAA8D,KAAA9D,KAAA8D,KAAA,EAAA9D,KAAA+D,IAAA,IAAA0X,KAAA,EACAzb,KAAA+D,IAAA/D,KAAA+D,KAAA,EAAA0X,KAAA,EACAzb,MAOA0T,EAAAxT,UAAArE,OAAA,WACA,IAAA6f,EAAA1b,KAAA8D,GACA6X,GAAA3b,KAAA8D,KAAA,GAAA9D,KAAA+D,IAAA,KAAA,EACA6X,EAAA5b,KAAA+D,KAAA,GACA,OAAA,GAAA6X,EACA,GAAAD,EACAD,EAAA,MACAA,EAAA,IAAA,EAAA,EACAA,EAAA,QAAA,EAAA,EACAC,EAAA,MACAA,EAAA,IAAA,EAAA,EACAA,EAAA,QAAA,EAAA,EACAC,EAAA,IAAA,EAAA,kCCrMA,IAAA7U,EAAAxL,EA2OA,SAAA2Z,EAAAyF,EAAAkB,EAAAjP,GACA,IAAA,IAAA5N,EAAAD,OAAAC,KAAA6c,GAAA/e,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACA6d,EAAA3b,EAAAlC,MAAA/B,GAAA6R,IACA+N,EAAA3b,EAAAlC,IAAA+e,EAAA7c,EAAAlC,KACA,OAAA6d,EAoBA,SAAAmB,EAAA7T,GAEA,SAAA8T,EAAA7P,EAAAsD,GAEA,KAAAxP,gBAAA+b,GACA,OAAA,IAAAA,EAAA7P,EAAAsD,GAKAzQ,OAAAyN,eAAAxM,KAAA,UAAA,CAAAyM,IAAA,WAAA,OAAAP,KAGAjO,MAAA+d,kBACA/d,MAAA+d,kBAAAhc,KAAA+b,GAEAhd,OAAAyN,eAAAxM,KAAA,QAAA,CAAAN,MAAAzB,QAAAge,OAAA,KAEAzM,GACA0F,EAAAlV,KAAAwP,GAWA,OARAuM,EAAA7b,UAAAnB,OAAAuL,OAAArM,MAAAiC,YAAAqK,YAAAwR,EAEAhd,OAAAyN,eAAAuP,EAAA7b,UAAA,OAAA,CAAAuM,IAAA,WAAA,OAAAxE,KAEA8T,EAAA7b,UAAAxB,SAAA,WACA,OAAAsB,KAAAiI,KAAA,KAAAjI,KAAAkM,SAGA6P,EA9RAhV,EAAApG,UAAAtF,EAAA,GAGA0L,EAAAzK,OAAAjB,EAAA,GAGA0L,EAAAhH,aAAA1E,EAAA,GAGA0L,EAAA8N,MAAAxZ,EAAA,GAGA0L,EAAAlG,QAAAxF,EAAA,GAGA0L,EAAAR,KAAAlL,EAAA,IAGA0L,EAAAmV,KAAA7gB,EAAA,GAGA0L,EAAA2M,SAAArY,EAAA,IAOA0L,EAAAmQ,UAAA,oBAAAiF,QACAA,QACAA,OAAAzF,SACAyF,OAAAzF,QAAA0F,UACAD,OAAAzF,QAAA0F,SAAAC,MAOAtV,EAAAoV,OAAApV,EAAAmQ,QAAAiF,QACA,oBAAAG,QAAAA,QACA,oBAAArG,MAAAA,MACAjW,KAQA+G,EAAAqG,WAAArO,OAAAkO,OAAAlO,OAAAkO,OAAA,IAAA,GAOAlG,EAAAoG,YAAApO,OAAAkO,OAAAlO,OAAAkO,OAAA,IAAA,GAQAlG,EAAAuE,UAAAiR,OAAAjR,WAAA,SAAA5L,GACA,MAAA,iBAAAA,GAAA8c,SAAA9c,IAAAhD,KAAAiD,MAAAD,KAAAA,GAQAqH,EAAAsE,SAAA,SAAA3L,GACA,MAAA,iBAAAA,GAAAA,aAAAjC,QAQAsJ,EAAAiF,SAAA,SAAAtM,GACA,OAAAA,GAAA,iBAAAA,GAWAqH,EAAA0V,MAQA1V,EAAA2V,MAAA,SAAAlM,EAAApJ,GACA,IAAA1H,EAAA8Q,EAAApJ,GACA,OAAA,MAAA1H,GAAA8Q,EAAAsC,eAAA1L,KACA,iBAAA1H,GAAA,GAAA/D,MAAA8V,QAAA/R,GAAAA,EAAA7D,OAAAkD,OAAAC,KAAAU,GAAA7D,UAeAkL,EAAA+M,OAAA,WACA,IACA,IAAAA,EAAA/M,EAAAlG,QAAA,UAAAiT,OAEA,OAAAA,EAAA5T,UAAAyc,UAAA7I,EAAA,KACA,MAAAxO,GAEA,OAAA,MAPA,GAYAyB,EAAA6V,EAAA,KAGA7V,EAAA8V,EAAA,KAOA9V,EAAAmG,UAAA,SAAA4P,GAEA,MAAA,iBAAAA,EACA/V,EAAA+M,OACA/M,EAAA8V,EAAAC,GACA,IAAA/V,EAAApL,MAAAmhB,GACA/V,EAAA+M,OACA/M,EAAA6V,EAAAE,GACA,oBAAAnb,WACAmb,EACA,IAAAnb,WAAAmb,IAOA/V,EAAApL,MAAA,oBAAAgG,WAAAA,WAAAhG,MAeAoL,EAAAqF,KAAArF,EAAAoV,OAAAY,SAAAhW,EAAAoV,OAAAY,QAAA3Q,MACArF,EAAAoV,OAAA/P,MACArF,EAAAlG,QAAA,QAOAkG,EAAAiW,OAAA,mBAOAjW,EAAAkW,QAAA,wBAOAlW,EAAAmW,QAAA,6CAOAnW,EAAAoW,WAAA,SAAAzd,GACA,OAAAA,EACAqH,EAAA2M,SAAAwH,KAAAxb,GAAA8b,SACAzU,EAAA2M,SAAAuH,UASAlU,EAAAqW,aAAA,SAAA7B,EAAAxS,GACA,IAAAmL,EAAAnN,EAAA2M,SAAA4H,SAAAC,GACA,OAAAxU,EAAAqF,KACArF,EAAAqF,KAAAiR,SAAAnJ,EAAApQ,GAAAoQ,EAAAnQ,GAAAgF,GACAmL,EAAAlL,WAAAD,IAkBAhC,EAAAmO,MAAAA,EAOAnO,EAAAyR,QAAA,SAAA2B,GACA,OAAAA,EAAA,GAAAlO,cAAAkO,EAAA1D,UAAA,IA0CA1P,EAAA+U,SAAAA,EAmBA/U,EAAAuW,cAAAxB,EAAA,iBAoBA/U,EAAAwM,YAAA,SAAAJ,GAEA,IADA,IAAAoK,EAAA,GACAzgB,EAAA,EAAAA,EAAAqW,EAAAtX,SAAAiB,EACAygB,EAAApK,EAAArW,IAAA,EAOA,OAAA,WACA,IAAA,IAAAkC,EAAAD,OAAAC,KAAAgB,MAAAlD,EAAAkC,EAAAnD,OAAA,GAAA,EAAAiB,IAAAA,EACA,GAAA,IAAAygB,EAAAve,EAAAlC,KAAAkD,KAAAhB,EAAAlC,MAAA/B,GAAA,OAAAiF,KAAAhB,EAAAlC,IACA,OAAAkC,EAAAlC,KAiBAiK,EAAA0M,YAAA,SAAAN,GAQA,OAAA,SAAAlL,GACA,IAAA,IAAAnL,EAAA,EAAAA,EAAAqW,EAAAtX,SAAAiB,EACAqW,EAAArW,KAAAmL,UACAjI,KAAAmT,EAAArW,MAoBAiK,EAAAmE,cAAA,CACAsS,MAAA/f,OACAggB,MAAAhgB,OACAwL,MAAAxL,OACAsN,MAAA,GAIAhE,EAAA+G,EAAA,WACA,IAAAgG,EAAA/M,EAAA+M,OAEAA,GAMA/M,EAAA6V,EAAA9I,EAAAoH,OAAAvZ,WAAAuZ,MAAApH,EAAAoH,MAEA,SAAAxb,EAAAge,GACA,OAAA,IAAA5J,EAAApU,EAAAge,IAEA3W,EAAA8V,EAAA/I,EAAA6J,aAEA,SAAAzX,GACA,OAAA,IAAA4N,EAAA5N,KAbAa,EAAA6V,EAAA7V,EAAA8V,EAAA,gECpZAvhB,EAAAC,QAwHA,SAAAuM,GAGA,IAAAb,EAAAF,EAAA5I,QAAA,CAAA,KAAA2J,EAAAG,KAAA,UAAAlB,CACA,oCADAA,CAEA,WAAA,mBACA8R,EAAA/Q,EAAAqR,YACAyE,EAAA,GACA/E,EAAAhd,QAAAoL,EACA,YAEA,IAAA,IAAAnK,EAAA,EAAAA,EAAAgL,EAAAE,YAAAnM,SAAAiB,EAAA,CACA,IAAAoK,EAAAY,EAAAsB,EAAAtM,GAAAZ,UACAsN,EAAA,IAAAzC,EAAAmB,SAAAhB,EAAAe,MAMA,GAJAf,EAAAkD,UAAAnD,EACA,sCAAAuC,EAAAtC,EAAAe,MAGAf,EAAAiB,IAAAlB,EACA,yBAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,UAFAD,CAGA,wBAAAuC,EAHAvC,CAIA,gCACA6W,EAAA7W,EAAAC,EAAA,QACA6W,EAAA9W,EAAAC,EAAApK,EAAA0M,EAAA,SAAAuU,CACA,UAGA,GAAA7W,EAAAK,SAAAN,EACA,yBAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,SAFAD,CAGA,gCAAAuC,GACAuU,EAAA9W,EAAAC,EAAApK,EAAA0M,EAAA,MAAAuU,CACA,SAGA,CACA,GAAA7W,EAAAwB,OAAA,CACA,IAAAsV,EAAAjX,EAAAmB,SAAAhB,EAAAwB,OAAAT,MACA,IAAA2V,EAAA1W,EAAAwB,OAAAT,OAAAhB,EACA,cAAA+W,EADA/W,CAEA,WAAAC,EAAAwB,OAAAT,KAAA,qBACA2V,EAAA1W,EAAAwB,OAAAT,MAAA,EACAhB,EACA,QAAA+W,GAEAD,EAAA9W,EAAAC,EAAApK,EAAA0M,GAEAtC,EAAAkD,UAAAnD,EACA,KAEA,OAAAA,EACA,gBA3KA,IAAAH,EAAAzL,EAAA,IACA0L,EAAA1L,EAAA,IAEA,SAAAwiB,EAAA3W,EAAA+W,GACA,OAAA/W,EAAAe,KAAA,KAAAgW,GAAA/W,EAAAK,UAAA,UAAA0W,EAAA,KAAA/W,EAAAiB,KAAA,WAAA8V,EAAA,MAAA/W,EAAA0C,QAAA,IAAA,IAAA,YAYA,SAAAmU,EAAA9W,EAAAC,EAAAC,EAAAqC,GAEA,GAAAtC,EAAAG,aACA,GAAAH,EAAAG,wBAAAP,EAAA,CAAAG,EACA,cAAAuC,EADAvC,CAEA,WAFAA,CAGA,WAAA4W,EAAA3W,EAAA,eACA,IAAA,IAAAlI,EAAAD,OAAAC,KAAAkI,EAAAG,aAAAC,QAAAhK,EAAA,EAAAA,EAAA0B,EAAAnD,SAAAyB,EAAA2J,EACA,WAAAC,EAAAG,aAAAC,OAAAtI,EAAA1B,KACA2J,EACA,QADAA,CAEA,UAEAA,EACA,IADAA,CAEA,8BAAAE,EAAAqC,EAFAvC,CAGA,QAHAA,CAIA,aAAAC,EAAAe,KAAA,IAJAhB,CAKA,UAGA,OAAAC,EAAAS,MACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAV,EACA,0BAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,YACA,MACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAD,EACA,kFAAAuC,EAAAA,EAAAA,EAAAA,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,iBACA,MACA,IAAA,QACA,IAAA,SAAAD,EACA,2BAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,WACA,MACA,IAAA,OAAAD,EACA,4BAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,YACA,MACA,IAAA,SAAAD,EACA,yBAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,WACA,MACA,IAAA,QAAAD,EACA,4DAAAuC,EAAAA,EAAAA,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,WAIA,OAAAD,EAYA,SAAA6W,EAAA7W,EAAAC,EAAAsC,GAEA,OAAAtC,EAAA0C,SACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAA3C,EACA,6BAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,gBACA,MACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAD,EACA,6BAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,qBACA,MACA,IAAA,OAAAD,EACA,4BAAAuC,EADAvC,CAEA,WAAA4W,EAAA3W,EAAA,gBAGA,OAAAD,uCCzGA,IAAA4H,EAAAtT,EAEAqT,EAAAvT,EAAA,IA6BAwT,EAAA,wBAAA,CAEAhH,WAAA,SAAAkI,GAGA,GAAAA,GAAAA,EAAA,SAAA,CAEA,IAAA9H,EAAA8H,EAAA,SAAA0G,UAAA,EAAA1G,EAAA,SAAAwG,YAAA,MACA5O,EAAA3H,KAAA6R,OAAA5J,GAEA,GAAAN,EAAA,CAEA,IAAAuW,EAAA,KAAAnO,EAAA,SAAA,GACAA,EAAA,SAAAoO,OAAA,GAAApO,EAAA,SAKA,OAHAmO,EAAA7U,QAAA,OACA6U,EAAA,IAAAA,GAEAle,KAAAsK,OAAA,CACA4T,SAAAA,EACAxe,MAAAiI,EAAA5K,OAAA4K,EAAAE,WAAAkI,IAAAoG,YAKA,OAAAnW,KAAA6H,WAAAkI,IAGA3H,SAAA,SAAA8D,EAAAnL,GAGA,IACA6E,EAAA,GACAqC,EAAA,GAGA,GAAAlH,GAAAA,EAAAgK,MAAAmB,EAAAgS,UAAAhS,EAAAxM,MAAA,CAEAuI,EAAAiE,EAAAgS,SAAAzH,UAAA,EAAAvK,EAAAgS,SAAA3H,YAAA,MAEA3Q,EAAAsG,EAAAgS,SAAAzH,UAAA,EAAA,EAAAvK,EAAAgS,SAAA3H,YAAA,MACA,IAAA5O,EAAA3H,KAAA6R,OAAA5J,GAEAN,IACAuE,EAAAvE,EAAA7J,OAAAoO,EAAAxM,QAIA,GAAAwM,aAAAlM,KAAAqN,QAAAnB,aAAA0C,GAaA,OAAA5O,KAAAoI,SAAA8D,EAAAnL,GAZA,IAAAgP,EAAA7D,EAAAuD,MAAArH,SAAA8D,EAAAnL,GASA,MALA,KAAA6E,IACAA,EAvBA,wBAyBAqC,EAAArC,GANA,MAAAsG,EAAAuD,MAAAhI,SAAA,GACAyE,EAAAuD,MAAAhI,SAAA0W,OAAA,GAAAjS,EAAAuD,MAAAhI,UAMAsI,EAAA,SAAA9H,EACA8H,gCC/FAzU,EAAAC,QAAAwT,EAEA,IAEAC,EAFAjI,EAAA1L,EAAA,IAIAqY,EAAA3M,EAAA2M,SACApX,EAAAyK,EAAAzK,OACAiK,EAAAQ,EAAAR,KAWA,SAAA6X,EAAA5iB,EAAAgL,EAAArE,GAMAnC,KAAAxE,GAAAA,EAMAwE,KAAAwG,IAAAA,EAMAxG,KAAAqe,KAAAtjB,EAMAiF,KAAAmC,IAAAA,EAIA,SAAAmc,KAUA,SAAAC,EAAA7O,GAMA1P,KAAAwe,KAAA9O,EAAA8O,KAMAxe,KAAAye,KAAA/O,EAAA+O,KAMAze,KAAAwG,IAAAkJ,EAAAlJ,IAMAxG,KAAAqe,KAAA3O,EAAAgP,OAQA,SAAA3P,IAMA/O,KAAAwG,IAAA,EAMAxG,KAAAwe,KAAA,IAAAJ,EAAAE,EAAA,EAAA,GAMAte,KAAAye,KAAAze,KAAAwe,KAMAxe,KAAA0e,OAAA,KASA,SAAApU,IACA,OAAAvD,EAAA+M,OACA,WACA,OAAA/E,EAAAzE,OAAA,WACA,OAAA,IAAA0E,OAIA,WACA,OAAA,IAAAD,GAuCA,SAAA4P,EAAAxc,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EAoBA,SAAAyc,EAAApY,EAAArE,GACAnC,KAAAwG,IAAAA,EACAxG,KAAAqe,KAAAtjB,EACAiF,KAAAmC,IAAAA,EA8CA,SAAA0c,EAAA1c,EAAAC,EAAAC,GACA,KAAAF,EAAA4B,IACA3B,EAAAC,KAAA,IAAAF,EAAA2B,GAAA,IACA3B,EAAA2B,IAAA3B,EAAA2B,KAAA,EAAA3B,EAAA4B,IAAA,MAAA,EACA5B,EAAA4B,MAAA,EAEA,KAAA,IAAA5B,EAAA2B,IACA1B,EAAAC,KAAA,IAAAF,EAAA2B,GAAA,IACA3B,EAAA2B,GAAA3B,EAAA2B,KAAA,EAEA1B,EAAAC,KAAAF,EAAA2B,GA2CA,SAAAgb,EAAA3c,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GA7JA4M,EAAAzE,OAAAA,IAOAyE,EAAA9I,MAAA,SAAAC,GACA,OAAA,IAAAa,EAAApL,MAAAuK,IAKAa,EAAApL,QAAAA,QACAoT,EAAA9I,MAAAc,EAAAmV,KAAAnN,EAAA9I,MAAAc,EAAApL,MAAAuE,UAAAoU,WAUAvF,EAAA7O,UAAA6e,EAAA,SAAAvjB,EAAAgL,EAAArE,GAGA,OAFAnC,KAAAye,KAAAze,KAAAye,KAAAJ,KAAA,IAAAD,EAAA5iB,EAAAgL,EAAArE,GACAnC,KAAAwG,KAAAA,EACAxG,OA8BA4e,EAAA1e,UAAAnB,OAAAuL,OAAA8T,EAAAle,YACA1E,GAxBA,SAAA2G,EAAAC,EAAAC,GACA,KAAA,IAAAF,GACAC,EAAAC,KAAA,IAAAF,EAAA,IACAA,KAAA,EAEAC,EAAAC,GAAAF,GA0BA4M,EAAA7O,UAAAqU,OAAA,SAAA7U,GAWA,OARAM,KAAAwG,MAAAxG,KAAAye,KAAAze,KAAAye,KAAAJ,KAAA,IAAAO,GACAlf,KAAA,GACA,IAAA,EACAA,EAAA,MAAA,EACAA,EAAA,QAAA,EACAA,EAAA,UAAA,EACA,EACAA,IAAA8G,IACAxG,MASA+O,EAAA7O,UAAAsU,MAAA,SAAA9U,GACA,OAAAA,EAAA,EACAM,KAAA+e,EAAAF,EAAA,GAAAnL,EAAA1G,WAAAtN,IACAM,KAAAuU,OAAA7U,IAQAqP,EAAA7O,UAAAuU,OAAA,SAAA/U,GACA,OAAAM,KAAAuU,QAAA7U,GAAA,EAAAA,GAAA,MAAA,IAkCAqP,EAAA7O,UAAAiV,MAZApG,EAAA7O,UAAAkV,OAAA,SAAA1V,GACA,IAAAwU,EAAAR,EAAAwH,KAAAxb,GACA,OAAAM,KAAA+e,EAAAF,EAAA3K,EAAArY,SAAAqY,IAkBAnF,EAAA7O,UAAAmV,OAAA,SAAA3V,GACA,IAAAwU,EAAAR,EAAAwH,KAAAxb,GAAAsb,WACA,OAAAhb,KAAA+e,EAAAF,EAAA3K,EAAArY,SAAAqY,IAQAnF,EAAA7O,UAAAwU,KAAA,SAAAhV,GACA,OAAAM,KAAA+e,EAAAJ,EAAA,EAAAjf,EAAA,EAAA,IAyBAqP,EAAA7O,UAAA0U,SAVA7F,EAAA7O,UAAAyU,QAAA,SAAAjV,GACA,OAAAM,KAAA+e,EAAAD,EAAA,EAAApf,IAAA,IA6BAqP,EAAA7O,UAAAsV,SAZAzG,EAAA7O,UAAAqV,QAAA,SAAA7V,GACA,IAAAwU,EAAAR,EAAAwH,KAAAxb,GACA,OAAAM,KAAA+e,EAAAD,EAAA,EAAA5K,EAAApQ,IAAAib,EAAAD,EAAA,EAAA5K,EAAAnQ,KAkBAgL,EAAA7O,UAAA2U,MAAA,SAAAnV,GACA,OAAAM,KAAA+e,EAAAhY,EAAA8N,MAAAxQ,aAAA,EAAA3E,IASAqP,EAAA7O,UAAA4U,OAAA,SAAApV,GACA,OAAAM,KAAA+e,EAAAhY,EAAA8N,MAAA9P,cAAA,EAAArF,IAGA,IAAAsf,EAAAjY,EAAApL,MAAAuE,UAAAsT,IACA,SAAArR,EAAAC,EAAAC,GACAD,EAAAoR,IAAArR,EAAAE,IAGA,SAAAF,EAAAC,EAAAC,GACA,IAAA,IAAAvF,EAAA,EAAAA,EAAAqF,EAAAtG,SAAAiB,EACAsF,EAAAC,EAAAvF,GAAAqF,EAAArF,IAQAiS,EAAA7O,UAAA+I,MAAA,SAAAvJ,GACA,IAAA8G,EAAA9G,EAAA7D,SAAA,EACA,IAAA2K,EACA,OAAAxG,KAAA+e,EAAAJ,EAAA,EAAA,GACA,GAAA5X,EAAAsE,SAAA3L,GAAA,CACA,IAAA0C,EAAA2M,EAAA9I,MAAAO,EAAAlK,EAAAT,OAAA6D,IACApD,EAAAwB,OAAA4B,EAAA0C,EAAA,GACA1C,EAAA0C,EAEA,OAAApC,KAAAuU,OAAA/N,GAAAuY,EAAAC,EAAAxY,EAAA9G,IAQAqP,EAAA7O,UAAA3D,OAAA,SAAAmD,GACA,IAAA8G,EAAAD,EAAA1K,OAAA6D,GACA,OAAA8G,EACAxG,KAAAuU,OAAA/N,GAAAuY,EAAAxY,EAAAG,MAAAF,EAAA9G,GACAM,KAAA+e,EAAAJ,EAAA,EAAA,IAQA5P,EAAA7O,UAAAuZ,KAAA,WAIA,OAHAzZ,KAAA0e,OAAA,IAAAH,EAAAve,MACAA,KAAAwe,KAAAxe,KAAAye,KAAA,IAAAL,EAAAE,EAAA,EAAA,GACAte,KAAAwG,IAAA,EACAxG,MAOA+O,EAAA7O,UAAA+e,MAAA,WAUA,OATAjf,KAAA0e,QACA1e,KAAAwe,KAAAxe,KAAA0e,OAAAF,KACAxe,KAAAye,KAAAze,KAAA0e,OAAAD,KACAze,KAAAwG,IAAAxG,KAAA0e,OAAAlY,IACAxG,KAAA0e,OAAA1e,KAAA0e,OAAAL,OAEAre,KAAAwe,KAAAxe,KAAAye,KAAA,IAAAL,EAAAE,EAAA,EAAA,GACAte,KAAAwG,IAAA,GAEAxG,MAOA+O,EAAA7O,UAAAwZ,OAAA,WACA,IAAA8E,EAAAxe,KAAAwe,KACAC,EAAAze,KAAAye,KACAjY,EAAAxG,KAAAwG,IAOA,OANAxG,KAAAif,QAAA1K,OAAA/N,GACAA,IACAxG,KAAAye,KAAAJ,KAAAG,EAAAH,KACAre,KAAAye,KAAAA,EACAze,KAAAwG,KAAAA,GAEAxG,MAOA+O,EAAA7O,UAAAiW,OAAA,WAIA,IAHA,IAAAqI,EAAAxe,KAAAwe,KAAAH,KACAjc,EAAApC,KAAAuK,YAAAtE,MAAAjG,KAAAwG,KACAnE,EAAA,EACAmc,GACAA,EAAAhjB,GAAAgjB,EAAArc,IAAAC,EAAAC,GACAA,GAAAmc,EAAAhY,IACAgY,EAAAA,EAAAH,KAGA,OAAAjc,GAGA2M,EAAAjB,EAAA,SAAAoR,GACAlQ,EAAAkQ,EACAnQ,EAAAzE,OAAAA,IACA0E,EAAAlB,iCC9cAxS,EAAAC,QAAAyT,EAGA,IAAAD,EAAA1T,EAAA,KACA2T,EAAA9O,UAAAnB,OAAAuL,OAAAyE,EAAA7O,YAAAqK,YAAAyE,EAEA,IAAAjI,EAAA1L,EAAA,IAQA,SAAA2T,IACAD,EAAAzI,KAAAtG,MAwCA,SAAAmf,EAAAhd,EAAAC,EAAAC,GACAF,EAAAtG,OAAA,GACAkL,EAAAR,KAAAG,MAAAvE,EAAAC,EAAAC,GACAD,EAAAua,UACAva,EAAAua,UAAAxa,EAAAE,GAEAD,EAAAsE,MAAAvE,EAAAE,GA3CA2M,EAAAlB,EAAA,WAOAkB,EAAA/I,MAAAc,EAAA8V,EAEA7N,EAAAoQ,iBAAArY,EAAA+M,QAAA/M,EAAA+M,OAAA5T,qBAAAyB,YAAA,QAAAoF,EAAA+M,OAAA5T,UAAAsT,IAAAvL,KACA,SAAA9F,EAAAC,EAAAC,GACAD,EAAAoR,IAAArR,EAAAE,IAIA,SAAAF,EAAAC,EAAAC,GACA,GAAAF,EAAAkd,KACAld,EAAAkd,KAAAjd,EAAAC,EAAA,EAAAF,EAAAtG,aACA,IAAA,IAAAiB,EAAA,EAAAA,EAAAqF,EAAAtG,QACAuG,EAAAC,KAAAF,EAAArF,OAQAkS,EAAA9O,UAAA+I,MAAA,SAAAvJ,GACAqH,EAAAsE,SAAA3L,KACAA,EAAAqH,EAAA6V,EAAAld,EAAA,WACA,IAAA8G,EAAA9G,EAAA7D,SAAA,EAIA,OAHAmE,KAAAuU,OAAA/N,GACAA,GACAxG,KAAA+e,EAAA/P,EAAAoQ,iBAAA5Y,EAAA9G,GACAM,MAeAgP,EAAA9O,UAAA3D,OAAA,SAAAmD,GACA,IAAA8G,EAAAO,EAAA+M,OAAAwL,WAAA5f,GAIA,OAHAM,KAAAuU,OAAA/N,GACAA,GACAxG,KAAA+e,EAAAI,EAAA3Y,EAAA9G,GACAM,MAWAgP,EAAAlB,qBvCpFA7S,KAAAC,OAcAC,EAPA,SAAAokB,EAAAtX,GACA,IAAAuX,EAAAvkB,EAAAgN,GAGA,OAFAuX,GACAxkB,EAAAiN,GAAA,GAAA3B,KAAAkZ,EAAAvkB,EAAAgN,GAAA,CAAA1M,QAAA,IAAAgkB,EAAAC,EAAAA,EAAAjkB,SACAikB,EAAAjkB,QAGAgkB,CAAArkB,EAAA,IAGAC,EAAA4L,KAAAoV,OAAAhhB,SAAAA,EAGA,mBAAAqW,QAAAA,OAAAiO,KACAjO,OAAA,CAAA,QAAA,SAAApF,GAKA,OAJAA,GAAAA,EAAAsT,SACAvkB,EAAA4L,KAAAqF,KAAAA,EACAjR,EAAA2T,aAEA3T,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(14),\n util = require(33);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(d%s){\", prop);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=d%s>>>0\", prop, prop);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=d%s|0\", prop, prop);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\n (\"m%s=parseInt(d%s,10)\", prop, prop)\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\n (\"m%s=d%s\", prop, prop)\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof d%s===\\\"string\\\")\", prop)\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n (\"else if(d%s.length)\", prop)\n (\"m%s=d%s\", prop, prop);\n break;\n case \"string\": gen\n (\"m%s=String(d%s)\", prop, prop);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(d%s)\", prop, prop);\n break;\n /* default: gen\n (\"m%s=d%s\", prop, prop);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"var c2 = r.uint32()+r.pos\");\n\n if (types.defaults[field.keyType] !== undefined) gen\n (\"k=%j\", types.defaults[field.keyType]);\n else gen\n (\"k=null\");\n\n if (types.defaults[type] !== undefined) gen\n (\"value=%j\", types.defaults[type]);\n else gen\n (\"value=null\");\n\n gen\n (\"while(r.pos>>3){\")\n (\"case 1: k=r.%s(); break\", field.keyType)\n (\"case 2:\");\n\n if (types.basic[type] === undefined) gen\n (\"value=types[%i].decode(r,r.uint32())\", i); // can't be groups\n else gen\n (\"value=r.%s()\", type);\n\n gen\n (\"break\")\n (\"default:\")\n (\"r.skipType(tag2&7)\")\n (\"break\")\n (\"}\")\n (\"}\");\n\n if (types.long[field.keyType] !== undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=value\", ref);\n else gen\n (\"%s[k]=value\", ref);\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) { gen\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\n\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", ref)\n (\"w.%s(%s[i])\", type, ref)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", ref);\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(21),\n util = require(33);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(14),\n types = require(32),\n util = require(33);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(13);\nprotobuf.decoder = require(12);\nprotobuf.verifier = require(36);\nprotobuf.converter = require(11);\n\n// Reflection\nprotobuf.ReflectionObject = require(22);\nprotobuf.Namespace = require(21);\nprotobuf.Root = require(26);\nprotobuf.Enum = require(14);\nprotobuf.Type = require(31);\nprotobuf.Field = require(15);\nprotobuf.OneOf = require(23);\nprotobuf.MapField = require(18);\nprotobuf.Service = require(30);\nprotobuf.Method = require(20);\n\n// Runtime\nprotobuf.Message = require(19);\nprotobuf.wrappers = require(37);\n\n// Utility\nprotobuf.types = require(32);\nprotobuf.util = require(33);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(38);\nprotobuf.BufferWriter = require(39);\nprotobuf.Reader = require(24);\nprotobuf.BufferReader = require(25);\n\n// Utility\nprotobuf.util = require(35);\nprotobuf.rpc = require(28);\nprotobuf.roots = require(27);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(15);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(32),\n util = require(33);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(35);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(33);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(15),\n util = require(33);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(33);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Parsed Options.\n * @type {Array.>|undefined}\n */\n this.parsedOptions = null;\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets a parsed option.\n * @param {string} name parsed Option name\n * @param {*} value Option value\n * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {\n if (!this.parsedOptions) {\n this.parsedOptions = [];\n }\n var parsedOptions = this.parsedOptions;\n if (propName) {\n // If setting a sub property of an option then try to merge it\n // with an existing option\n var opt = parsedOptions.find(function (opt) {\n return Object.prototype.hasOwnProperty.call(opt, name);\n });\n if (opt) {\n // If we found an existing option - just merge the property value\n var newValue = opt[name];\n util.setProperty(newValue, propName, value);\n } else {\n // otherwise, create a new option, set it's property and add it to the list\n opt = {};\n opt[name] = util.setProperty({}, propName, value);\n parsedOptions.push(opt);\n }\n } else {\n // Always create a new option when setting the value of the option itself\n var newOpt = {};\n newOpt[name] = value;\n parsedOptions.push(newOpt);\n }\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(15),\n util = require(33);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(35);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(24);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(35);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(21);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(15),\n Enum = require(14),\n OneOf = require(23),\n util = require(33);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(29);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(35);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(21);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(20),\n util = require(33),\n rpc = require(28);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(21);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(14),\n OneOf = require(23),\n Field = require(15),\n MapField = require(18),\n Service = require(30),\n Message = require(19),\n Reader = require(24),\n Writer = require(38),\n util = require(33),\n encoder = require(13),\n decoder = require(12),\n verifier = require(36),\n converter = require(11),\n wrappers = require(37);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(33);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(35);\n\nvar roots = require(27);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(31);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(14);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n\n/**\n * Sets the value of a property by property path. If a value already exists, it is turned to an array\n * @param {Object.} dst Destination object\n * @param {string} path dot '.' delimited path of the property to set\n * @param {Object} value the value to set\n * @returns {Object.} Destination object\n */\nutil.setProperty = function setProperty(dst, path, value) {\n function setProp(dst, path, value) {\n var part = path.shift();\n if (path.length > 0) {\n dst[part] = setProp(dst[part] || {}, path, value);\n } else {\n var prevValue = dst[part];\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n dst[part] = value;\n }\n return dst;\n }\n\n if (typeof dst !== \"object\")\n throw TypeError(\"dst must be an object\");\n if (!path)\n throw TypeError(\"path must be specified\");\n\n path = path.split(\".\");\n return setProp(dst, path, value);\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(26))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(35);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(34);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(14),\n util = require(33);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(19);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n // Only use fully qualified type name after the last '/'\n var name = object[\"@type\"].substring(object[\"@type\"].lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n if (type_url.indexOf(\"/\") === -1) {\n type_url = \"/\" + type_url;\n }\n return this.create({\n type_url: type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // Default prefix\n var googleApi = \"type.googleapis.com/\";\n var prefix = \"\";\n var name = \"\";\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n // Separate the prefix used\n prefix = message.type_url.substring(0, message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n var messageName = message.$type.fullName[0] === \".\" ?\n message.$type.fullName.substr(1) : message.$type.fullName;\n // Default to type.googleapis.com prefix if no prefix is used\n if (prefix === \"\") {\n prefix = googleApi;\n }\n name = prefix + messageName;\n object[\"@type\"] = name;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(35);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(38);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(35);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/legacy-libs/protobufjs/dist/minimal/README.md b/legacy-libs/protobufjs/dist/minimal/README.md new file mode 100644 index 0000000..5eeb571 --- /dev/null +++ b/legacy-libs/protobufjs/dist/minimal/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the minimal library suitable for use with statically generated code only. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/legacy-libs/protobufjs/dist/minimal/protobuf.js b/legacy-libs/protobufjs/dist/minimal/protobuf.js new file mode 100644 index 0000000..a447672 --- /dev/null +++ b/legacy-libs/protobufjs/dist/minimal/protobuf.js @@ -0,0 +1,2714 @@ +/*! + * protobuf.js v6.10.0 (c) 2016, daniel wirtz + * compiled wed, 15 jul 2020 23:34:13 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],4:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],6:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],7:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],8:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(16); +protobuf.BufferWriter = require(17); +protobuf.Reader = require(9); +protobuf.BufferReader = require(10); + +// Utility +protobuf.util = require(15); +protobuf.rpc = require(12); +protobuf.roots = require(11); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); +} + +// Set up buffer utility according to the environment +configure(); + +},{"10":10,"11":11,"12":12,"15":15,"16":16,"17":17,"9":9}],9:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(15); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +var create = function create() { + return util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; +}; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = create(); + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"15":15}],10:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(9); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(15); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +BufferReader._configure = function () { + /* istanbul ignore else */ + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; +}; + + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice + ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) + : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +BufferReader._configure(); + +},{"15":15,"9":9}],11:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],12:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(13); + +},{"13":13}],13:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(15); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"15":15}],14:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(15); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"15":15}],15:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(3); + +// float handling accross browsers +util.float = require(4); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(5); + +// converts to / from utf8 encoded strings +util.utf8 = require(7); + +// provides a node-like buffer pool in the browser +util.pool = require(6); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(14); + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + */ +util.isNode = Boolean(typeof global !== "undefined" + && global + && global.process + && global.process.versions + && global.process.versions.node); + +/** + * Global object reference. + * @memberof util + * @type {Object} + */ +util.global = util.isNode && global + || typeof window !== "undefined" && window + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"14":14,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7}],16:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(15); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +var create = function create() { + return util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; +}; + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = create(); + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); +}; + +},{"15":15}],17:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(16); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(15); + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +BufferWriter._configure = function () { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter.alloc = util._Buffer_allocUnsafe; + + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; +}; + + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +BufferWriter._configure(); + +},{"15":15,"16":16}]},{},[8]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/legacy-libs/protobufjs/dist/minimal/protobuf.js.map b/legacy-libs/protobufjs/dist/minimal/protobuf.js.map new file mode 100644 index 0000000..4554b75 --- /dev/null +++ b/legacy-libs/protobufjs/dist/minimal/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/index-minimal","../src/reader.js","../src/reader_buffer.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/util/longbits.js","../src/util/minimal.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(16);\nprotobuf.BufferWriter = require(17);\nprotobuf.Reader = require(9);\nprotobuf.BufferReader = require(10);\n\n// Utility\nprotobuf.util = require(15);\nprotobuf.rpc = require(12);\nprotobuf.roots = require(11);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(15);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(9);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(13);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(15);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(15);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(3);\n\n// float handling accross browsers\nutil.float = require(4);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(5);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(7);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(6);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(14);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(15);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(16);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/legacy-libs/protobufjs/dist/minimal/protobuf.min.js b/legacy-libs/protobufjs/dist/minimal/protobuf.min.js new file mode 100644 index 0000000..16dba94 --- /dev/null +++ b/legacy-libs/protobufjs/dist/minimal/protobuf.min.js @@ -0,0 +1,8 @@ +/*! + * protobuf.js v6.10.0 (c) 2016, daniel wirtz + * compiled wed, 15 jul 2020 23:34:14 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +!function(d){"use strict";var r,u,t,n;r={1:[function(t,n){n.exports=function(t,n){var i=Array(arguments.length-1),e=0,r=2,s=!0;for(;r>2],r=(3&f)<<4,h=1;break;case 1:e[s++]=o[r|f>>4],r=(15&f)<<2,h=2;break;case 2:e[s++]=o[r|f>>6],e[s++]=o[63&f],h=0}8191>4,r=h,e=2;break;case 2:n[i++]=(15&r)<<4|(60&h)>>2,r=h,e=3;break;case 3:n[i++]=(3&r)<<6|h,e=0}}if(1===e)throw Error(c);return i-u},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,n){function i(){this.t={}}(n.exports=i).prototype.on=function(t,n,i){return(this.t[t]||(this.t[t]=[])).push({fn:n,ctx:i||this}),this},i.prototype.off=function(t,n){if(t===d)this.t={};else if(n===d)this.t[t]=[];else for(var i=this.t[t],r=0;r>>0,i,r);else if(n<11754943508222875e-54)t((u<<31|Math.round(n/1401298464324817e-60))>>>0,i,r);else{var e=Math.floor(Math.log(n)/Math.LN2);t((u<<31|127+e<<23|8388607&Math.round(n*Math.pow(2,-e)*8388608))>>>0,i,r)}}function i(t,n,i){var r=t(n,i),u=2*(r>>31)+1,e=r>>>23&255,s=8388607&r;return 255==e?s?NaN:1/0*u:0==e?1401298464324817e-60*u*s:u*Math.pow(2,e-150)*(8388608+s)}function r(t,n,i){h[0]=t,n[i]=f[0],n[i+1]=f[1],n[i+2]=f[2],n[i+3]=f[3]}function u(t,n,i){h[0]=t,n[i]=f[3],n[i+1]=f[2],n[i+2]=f[1],n[i+3]=f[0]}function e(t,n){return f[0]=t[n],f[1]=t[n+1],f[2]=t[n+2],f[3]=t[n+3],h[0]}function s(t,n){return f[3]=t[n],f[2]=t[n+1],f[1]=t[n+2],f[0]=t[n+3],h[0]}var h,f,o,c,a,l;function v(t,n,i,r,u,e){var s=r<0?1:0;if(s&&(r=-r),0===r)t(0,u,e+n),t(0<1/r?0:2147483648,u,e+i);else if(isNaN(r))t(0,u,e+n),t(2146959360,u,e+i);else if(17976931348623157e292>>0,u,e+i);else{var h;if(r<22250738585072014e-324)t((h=r/5e-324)>>>0,u,e+n),t((s<<31|h/4294967296)>>>0,u,e+i);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(h=r*Math.pow(2,-f))>>>0,u,e+n),t((s<<31|f+1023<<20|1048576*h&1048575)>>>0,u,e+i)}}}function w(t,n,i,r,u){var e=t(r,u+n),s=t(r,u+i),h=2*(s>>31)+1,f=s>>>20&2047,o=4294967296*(1048575&s)+e;return 2047==f?o?NaN:1/0*h:0==f?5e-324*h*o:h*Math.pow(2,f-1075)*(o+4503599627370496)}function y(t,n,i){c[0]=t,n[i]=a[0],n[i+1]=a[1],n[i+2]=a[2],n[i+3]=a[3],n[i+4]=a[4],n[i+5]=a[5],n[i+6]=a[6],n[i+7]=a[7]}function b(t,n,i){c[0]=t,n[i]=a[7],n[i+1]=a[6],n[i+2]=a[5],n[i+3]=a[4],n[i+4]=a[3],n[i+5]=a[2],n[i+6]=a[1],n[i+7]=a[0]}function d(t,n){return a[0]=t[n],a[1]=t[n+1],a[2]=t[n+2],a[3]=t[n+3],a[4]=t[n+4],a[5]=t[n+5],a[6]=t[n+6],a[7]=t[n+7],c[0]}function g(t,n){return a[7]=t[n],a[6]=t[n+1],a[5]=t[n+2],a[4]=t[n+3],a[3]=t[n+4],a[2]=t[n+5],a[1]=t[n+6],a[0]=t[n+7],c[0]}return"undefined"!=typeof Float32Array?(h=new Float32Array([-0]),f=new Uint8Array(h.buffer),o=128===f[3],t.writeFloatLE=o?r:u,t.writeFloatBE=o?u:r,t.readFloatLE=o?e:s,t.readFloatBE=o?s:e):(t.writeFloatLE=n.bind(null,A),t.writeFloatBE=n.bind(null,p),t.readFloatLE=i.bind(null,m),t.readFloatBE=i.bind(null,j)),"undefined"!=typeof Float64Array?(c=new Float64Array([-0]),a=new Uint8Array(c.buffer),l=128===a[7],t.writeDoubleLE=l?y:b,t.writeDoubleBE=l?b:y,t.readDoubleLE=l?d:g,t.readDoubleBE=l?g:d):(t.writeDoubleLE=v.bind(null,A,0,4),t.writeDoubleBE=v.bind(null,p,4,0),t.readDoubleLE=w.bind(null,m,0,4),t.readDoubleBE=w.bind(null,j,4,0)),t}function A(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}function p(t,n,i){n[i]=t>>>24,n[i+1]=t>>>16&255,n[i+2]=t>>>8&255,n[i+3]=255&t}function m(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function j(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}n.exports=i(i)},{}],5:[function(t,n,i){function r(t){try{var n=eval("require")(t);if(n&&(n.length||Object.keys(n).length))return n}catch(t){}return null}n.exports=r},{}],6:[function(t,n){n.exports=function(i,r,t){var u=t||8192,e=u>>>1,s=null,h=u;return function(t){if(t<1||e>10),e[s++]=56320+(1023&r)):e[s++]=(15&r)<<12|(63&t[n++])<<6|63&t[n++],8191>6|192:(55296==(64512&r)&&56320==(64512&(u=t.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&u),++s,n[i++]=r>>18|240,n[i++]=r>>12&63|128):n[i++]=r>>12|224,n[i++]=r>>6&63|128),n[i++]=63&r|128);return i-e}},{}],8:[function(t,n,i){var r=i;function u(){r.util.n(),r.Writer.n(r.BufferWriter),r.Reader.n(r.BufferReader)}r.build="minimal",r.Writer=t(16),r.BufferWriter=t(17),r.Reader=t(9),r.BufferReader=t(10),r.util=t(15),r.rpc=t(12),r.roots=t(11),(r.configure=u)()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(t,n){n.exports=h;var i,r=t(15),u=r.LongBits,e=r.utf8;function s(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function h(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return r.Buffer?function(t){return(h.create=function(t){return r.Buffer.isBuffer(t)?new i(t):c(t)})(t)}:c}var o,c="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new h(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new h(t);throw Error("illegal buffer")};function a(){var t=new u(0,0),n=0;if(!(4=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function l(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw s(this,8);return new u(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}h.create=f(),h.prototype.i=r.Array.prototype.subarray||r.Array.prototype.slice,h.prototype.uint32=(o=4294967295,function(){if(o=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return o;if(o=(o|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return o;if(o=(o|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return o;if(o=(o|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return o;if(o=(o|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return o;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return o}),h.prototype.int32=function(){return 0|this.uint32()},h.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},h.prototype.bool=function(){return 0!==this.uint32()},h.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return l(this.buf,this.pos+=4)},h.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|l(this.buf,this.pos+=4)},h.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},h.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},h.prototype.bytes=function(){var t=this.uint32(),n=this.pos,i=this.pos+t;if(i>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,i):n===i?new this.buf.constructor(0):this.i.call(this.buf,n,i)},h.prototype.string=function(){var t=this.bytes();return e.read(t,0,t.length)},h.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},h.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},h.n=function(t){i=t,h.create=f(),i.n();var n=r.Long?"toLong":"toNumber";r.merge(h.prototype,{int64:function(){return a.call(this)[n](!1)},uint64:function(){return a.call(this)[n](!0)},sint64:function(){return a.call(this).zzDecode()[n](!1)},fixed64:function(){return v.call(this)[n](!0)},sfixed64:function(){return v.call(this)[n](!1)}})}},{15:15}],10:[function(t,n){n.exports=u;var i=t(9);(u.prototype=Object.create(i.prototype)).constructor=u;var r=t(15);function u(t){i.call(this,t)}u.n=function(){r.Buffer&&(u.prototype.i=r.Buffer.prototype.slice)},u.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},u.n()},{15:15,9:9}],11:[function(t,n){n.exports={}},{}],12:[function(t,n,i){i.Service=t(13)},{13:13}],13:[function(t,n){n.exports=i;var h=t(15);function i(t,n,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");h.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!n,this.responseDelimited=!!i}((i.prototype=Object.create(h.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(i,n,r,u,e){if(!u)throw TypeError("request must be specified");var s=this;if(!e)return h.asPromise(t,s,i,n,r,u);if(!s.rpcImpl)return setTimeout(function(){e(Error("already ended"))},0),d;try{return s.rpcImpl(i,n[s.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(t,n){if(t)return s.emit("error",t,i),e(t);if(null===n)return s.end(!0),d;if(!(n instanceof r))try{n=r[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,i),e(t)}return s.emit("data",n,i),e(null,n)})}catch(t){return s.emit("error",t,i),setTimeout(function(){e(t)},0),d}},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(t,n){n.exports=u;var i=t(15);function u(t,n){this.lo=t>>>0,this.hi=n>>>0}var e=u.zero=new u(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=u.zeroHash="\0\0\0\0\0\0\0\0";u.fromNumber=function(t){if(0===t)return e;var n=t<0;n&&(t=-t);var i=t>>>0,r=(t-i)/4294967296>>>0;return n&&(r=~r>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++r&&(r=0))),new u(i,r)},u.from=function(t){if("number"==typeof t)return u.fromNumber(t);if(i.isString(t)){if(!i.Long)return u.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new u(t.low>>>0,t.high>>>0):e},u.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=1+~this.lo>>>0,i=~this.hi>>>0;return n||(i=i+1>>>0),-(n+4294967296*i)}return this.lo+4294967296*this.hi},u.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var s=String.prototype.charCodeAt;u.fromHash=function(t){return t===r?e:new u((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},u.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},u.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},u.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},u.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:i<128?9:10}},{15:15}],15:[function(t,n,i){var r=i;function u(t,n,i){for(var r=Object.keys(n),u=0;u>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;n[i++]=t.lo}function y(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}c.create=a(),c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype.e=function(t,n,i){return this.tail=this.tail.next=new h(t,n,i),this.len+=n,this},(v.prototype=Object.create(h.prototype)).fn=function(t,n,i){for(;127>>=7;n[i]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.e(w,10,u.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){var n=u.from(t);return this.e(w,n.length(),n)},c.prototype.sint64=function(t){var n=u.from(t).zzEncode();return this.e(w,n.length(),n)},c.prototype.bool=function(t){return this.e(l,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.e(y,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){var n=u.from(t);return this.e(y,4,n.lo).e(y,4,n.hi)},c.prototype.float=function(t){return this.e(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.e(r.float.writeDoubleLE,8,t)};var b=r.Array.prototype.set?function(t,n,i){n.set(t,i)}:function(t,n,i){for(var r=0;r>>0;if(!n)return this.e(l,1,0);if(r.isString(t)){var i=c.alloc(n=e.length(t));e.decode(t,i,0),t=i}return this.uint32(n).e(b,n,t)},c.prototype.string=function(t){var n=s.length(t);return n?this.uint32(n).e(s.write,n,t):this.e(l,1,0)},c.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new h(f,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new h(f,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,n=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=n,this.len+=i),this},c.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,n,i),i+=t.len,t=t.next;return n},c.n=function(t){i=t,c.create=a(),i.n()}},{15:15}],17:[function(t,n){n.exports=u;var i=t(16);(u.prototype=Object.create(i.prototype)).constructor=u;var r=t(15);function u(){i.call(this)}function e(t,n,i){t.length<40?r.utf8.write(t,n,i):n.utf8Write?n.utf8Write(t,i):n.write(t,i)}u.n=function(){u.alloc=r.u,u.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,n,i){n.set(t,i)}:function(t,n,i){if(t.copy)t.copy(n,i,0,t.length);else for(var r=0;r>>0;return this.uint32(n),n&&this.e(u.writeBytesBuffer,n,t),this},u.prototype.string=function(t){var n=r.Buffer.byteLength(t);return this.uint32(n),n&&this.e(e,n,t),this},u.n()},{15:15,16:16}]},u={},t=[8],n=function t(n){var i=u[n];return i||r[n][0].call(i=u[n]={exports:{}},t,i,i.exports),i.exports}(t[0]),n.util.global.protobuf=n,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(n.util.Long=t,n.configure()),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/legacy-libs/protobufjs/dist/minimal/protobuf.min.js.map b/legacy-libs/protobufjs/dist/minimal/protobuf.min.js.map new file mode 100644 index 0000000..c373c9a --- /dev/null +++ b/legacy-libs/protobufjs/dist/minimal/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/index-minimal","../src/reader.js","../src/reader_buffer.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/util/longbits.js","../src/util/minimal.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","factory","writeFloat_ieee754","writeUint","val","buf","pos","sign","isNaN","round","exponent","floor","log","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","writeFloat_f32_cpy","f32","f8b","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","le","f64","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","Float32Array","Uint8Array","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","inquire","moduleName","mod","eval","Object","keys","e","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","configure","util","_configure","Writer","BufferWriter","Reader","BufferReader","build","rpc","roots","LongBits","indexOutOfRange","reader","writeLength","RangeError","create","Buffer","isBuffer","create_array","value","isArray","readLongVarint","bits","readFixed32_end","readFixed64","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","bytes","constructor","skip","skipType","wireType","BufferReader_","Long","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","toString","Service","rpcImpl","requestDelimited","responseDelimited","TypeError","rpcCall","method","requestCtor","responseCtor","request","callback","self","asPromise","setTimeout","finish","response","endedByRPC","zero","toNumber","zzEncode","zeroHash","fromNumber","from","isString","parseInt","fromString","low","high","unsigned","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","ifNotSet","newError","name","CustomError","message","properties","defineProperty","get","captureStackTrace","stack","pool","isNode","global","process","versions","node","window","emptyArray","freeze","emptyObject","isInteger","Number","isFinite","isObject","isset","isSet","obj","prop","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","newBuffer","sizeOrArray","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","lcFirst","str","toLowerCase","substring","ProtocolError","oneOfGetter","fieldNames","fieldMap","oneOfSetter","toJSONOptions","longs","enums","json","encoding","allocUnsafe","Op","next","noop","State","writer","head","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","set","fork","reset","ldelim","BufferWriter_","writeStringBuffer","writeBytesBuffer","copy","byteLength","$require","$module","define","amd","isLong"],"mappings":";;;;;;CAAA,SAAAA,GAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCCxCA,IAAAE,EAAAf,EAOAe,EAAAT,OAAA,SAAAU,GACA,IAAAC,EAAAD,EAAAV,OACA,IAAAW,EACA,OAAA,EAEA,IADA,IAAAC,EAAA,EACA,IAAAD,EAAA,GAAA,KAAAD,EAAAA,EAAAC,MACAC,EACA,OAAAC,KAAAC,KAAA,EAAAJ,EAAAV,QAAA,EAAAY,GAUA,IANA,IAAAG,EAAAjB,MAAA,IAGAkB,EAAAlB,MAAA,KAGAmB,EAAA,EAAAA,EAAA,IACAD,EAAAD,EAAAE,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,EAAAA,EAAA,GAAA,IAAAA,IASAR,EAAAS,OAAA,SAAAC,EAAAC,EAAAC,GAMA,IALA,IAIAC,EAJAC,EAAA,KACAC,EAAA,GACAP,EAAA,EACAQ,EAAA,EAEAL,EAAAC,GAAA,CACA,IAAAK,EAAAP,EAAAC,KACA,OAAAK,GACA,KAAA,EACAD,EAAAP,KAAAF,EAAAW,GAAA,GACAJ,GAAA,EAAAI,IAAA,EACAD,EAAA,EACA,MACA,KAAA,EACAD,EAAAP,KAAAF,EAAAO,EAAAI,GAAA,GACAJ,GAAA,GAAAI,IAAA,EACAD,EAAA,EACA,MACA,KAAA,EACAD,EAAAP,KAAAF,EAAAO,EAAAI,GAAA,GACAF,EAAAP,KAAAF,EAAA,GAAAW,GACAD,EAAA,EAGA,KAAAR,KACAM,EAAAA,GAAA,IAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,IACAP,EAAA,GASA,OANAQ,IACAD,EAAAP,KAAAF,EAAAO,GACAE,EAAAP,KAAA,GACA,IAAAQ,IACAD,EAAAP,KAAA,KAEAM,GACAN,GACAM,EAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KACAM,EAAAQ,KAAA,KAEAH,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KAGA,IAAAe,EAAA,mBAUAvB,EAAAwB,OAAA,SAAAvB,EAAAS,EAAAlB,GAIA,IAHA,IAEAqB,EAFAF,EAAAnB,EACAwB,EAAA,EAEAR,EAAA,EAAAA,EAAAP,EAAAV,QAAA,CACA,IAAAkC,EAAAxB,EAAAyB,WAAAlB,KACA,GAAA,KAAAiB,GAAA,EAAAT,EACA,MACA,IAAAS,EAAAlB,EAAAkB,MAAAhD,EACA,MAAAkD,MAAAJ,GACA,OAAAP,GACA,KAAA,EACAH,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,KAAAqB,GAAA,GAAA,GAAAY,IAAA,EACAZ,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,MAAA,GAAAqB,IAAA,GAAA,GAAAY,IAAA,EACAZ,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,MAAA,EAAAqB,IAAA,EAAAY,EACAT,EAAA,GAIA,GAAA,IAAAA,EACA,MAAAW,MAAAJ,GACA,OAAA/B,EAAAmB,GAQAX,EAAA4B,KAAA,SAAA3B,GACA,MAAA,mEAAA2B,KAAA3B,0BChIA,SAAA4B,IAOAC,KAAAC,EAAA,IAfA/C,EAAAC,QAAA4C,GAyBAG,UAAAC,GAAA,SAAAC,EAAAhD,EAAAC,GAKA,OAJA2C,KAAAC,EAAAG,KAAAJ,KAAAC,EAAAG,GAAA,KAAAhB,KAAA,CACAhC,GAAAA,EACAC,IAAAA,GAAA2C,OAEAA,MASAD,EAAAG,UAAAG,IAAA,SAAAD,EAAAhD,GACA,GAAAgD,IAAAzD,EACAqD,KAAAC,EAAA,QAEA,GAAA7C,IAAAT,EACAqD,KAAAC,EAAAG,GAAA,QAGA,IADA,IAAAE,EAAAN,KAAAC,EAAAG,GACA1B,EAAA,EAAAA,EAAA4B,EAAA7C,QACA6C,EAAA5B,GAAAtB,KAAAA,EACAkD,EAAAC,OAAA7B,EAAA,KAEAA,EAGA,OAAAsB,MASAD,EAAAG,UAAAM,KAAA,SAAAJ,GACA,IAAAE,EAAAN,KAAAC,EAAAG,GACA,GAAAE,EAAA,CAGA,IAFA,IAAAG,EAAA,GACA/B,EAAA,EACAA,EAAAlB,UAAAC,QACAgD,EAAArB,KAAA5B,UAAAkB,MACA,IAAAA,EAAA,EAAAA,EAAA4B,EAAA7C,QACA6C,EAAA5B,GAAAtB,GAAAa,MAAAqC,EAAA5B,KAAArB,IAAAoD,GAEA,OAAAT,4BCaA,SAAAU,EAAAvD,GAsDA,SAAAwD,EAAAC,EAAAC,EAAAC,EAAAC,GACA,IAAAC,EAAAH,EAAA,EAAA,EAAA,EAGA,GAFAG,IACAH,GAAAA,GACA,IAAAA,EACAD,EAAA,EAAA,EAAAC,EAAA,EAAA,WAAAC,EAAAC,QACA,GAAAE,MAAAJ,GACAD,EAAA,WAAAE,EAAAC,QACA,GAAA,qBAAAF,EACAD,GAAAI,GAAA,GAAA,cAAA,EAAAF,EAAAC,QACA,GAAAF,EAAA,sBACAD,GAAAI,GAAA,GAAA1C,KAAA4C,MAAAL,EAAA,yBAAA,EAAAC,EAAAC,OACA,CACA,IAAAI,EAAA7C,KAAA8C,MAAA9C,KAAA+C,IAAAR,GAAAvC,KAAAgD,KAEAV,GAAAI,GAAA,GAAA,IAAAG,GAAA,GADA,QAAA7C,KAAA4C,MAAAL,EAAAvC,KAAAiD,IAAA,GAAAJ,GAAA,YACA,EAAAL,EAAAC,IAOA,SAAAS,EAAAC,EAAAX,EAAAC,GACA,IAAAW,EAAAD,EAAAX,EAAAC,GACAC,EAAA,GAAAU,GAAA,IAAA,EACAP,EAAAO,IAAA,GAAA,IACAC,EAAA,QAAAD,EACA,OAAA,KAAAP,EACAQ,EACAC,IACAC,EAAAA,EAAAb,EACA,GAAAG,EACA,qBAAAH,EAAAW,EACAX,EAAA1C,KAAAiD,IAAA,EAAAJ,EAAA,MAAA,QAAAQ,GA9EA,SAAAG,EAAAjB,EAAAC,EAAAC,GACAgB,EAAA,GAAAlB,EACAC,EAAAC,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GAGA,SAAAC,EAAApB,EAAAC,EAAAC,GACAgB,EAAA,GAAAlB,EACAC,EAAAC,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GAQA,SAAAE,EAAApB,EAAAC,GAKA,OAJAiB,EAAA,GAAAlB,EAAAC,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAgB,EAAA,GAGA,SAAAI,EAAArB,EAAAC,GAKA,OAJAiB,EAAA,GAAAlB,EAAAC,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAgB,EAAA,GAxCA,IAEAA,EACAC,EACAI,EA2FAC,EACAL,EACAI,EA+DA,SAAAE,EAAA1B,EAAA2B,EAAAC,EAAA3B,EAAAC,EAAAC,GACA,IAAAC,EAAAH,EAAA,EAAA,EAAA,EAGA,GAFAG,IACAH,GAAAA,GACA,IAAAA,EACAD,EAAA,EAAAE,EAAAC,EAAAwB,GACA3B,EAAA,EAAA,EAAAC,EAAA,EAAA,WAAAC,EAAAC,EAAAyB,QACA,GAAAvB,MAAAJ,GACAD,EAAA,EAAAE,EAAAC,EAAAwB,GACA3B,EAAA,WAAAE,EAAAC,EAAAyB,QACA,GAAA,sBAAA3B,EACAD,EAAA,EAAAE,EAAAC,EAAAwB,GACA3B,GAAAI,GAAA,GAAA,cAAA,EAAAF,EAAAC,EAAAyB,OACA,CACA,IAAAb,EACA,GAAAd,EAAA,uBAEAD,GADAe,EAAAd,EAAA,UACA,EAAAC,EAAAC,EAAAwB,GACA3B,GAAAI,GAAA,GAAAW,EAAA,cAAA,EAAAb,EAAAC,EAAAyB,OACA,CACA,IAAArB,EAAA7C,KAAA8C,MAAA9C,KAAA+C,IAAAR,GAAAvC,KAAAgD,KACA,OAAAH,IACAA,EAAA,MAEAP,EAAA,kBADAe,EAAAd,EAAAvC,KAAAiD,IAAA,GAAAJ,MACA,EAAAL,EAAAC,EAAAwB,GACA3B,GAAAI,GAAA,GAAAG,EAAA,MAAA,GAAA,QAAAQ,EAAA,WAAA,EAAAb,EAAAC,EAAAyB,KAQA,SAAAC,EAAAhB,EAAAc,EAAAC,EAAA1B,EAAAC,GACA,IAAA2B,EAAAjB,EAAAX,EAAAC,EAAAwB,GACAI,EAAAlB,EAAAX,EAAAC,EAAAyB,GACAxB,EAAA,GAAA2B,GAAA,IAAA,EACAxB,EAAAwB,IAAA,GAAA,KACAhB,EAAA,YAAA,QAAAgB,GAAAD,EACA,OAAA,MAAAvB,EACAQ,EACAC,IACAC,EAAAA,EAAAb,EACA,GAAAG,EACA,OAAAH,EAAAW,EACAX,EAAA1C,KAAAiD,IAAA,EAAAJ,EAAA,OAAAQ,EAAA,kBA1GA,SAAAiB,EAAA/B,EAAAC,EAAAC,GACAsB,EAAA,GAAAxB,EACAC,EAAAC,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GAGA,SAAAa,EAAAhC,EAAAC,EAAAC,GACAsB,EAAA,GAAAxB,EACAC,EAAAC,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GACAlB,EAAAC,EAAA,GAAAiB,EAAA,GAQA,SAAAc,EAAAhC,EAAAC,GASA,OARAiB,EAAA,GAAAlB,EAAAC,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAsB,EAAA,GAGA,SAAAU,EAAAjC,EAAAC,GASA,OARAiB,EAAA,GAAAlB,EAAAC,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAiB,EAAA,GAAAlB,EAAAC,EAAA,GACAsB,EAAA,GAgEA,MArNA,oBAAAW,cAEAjB,EAAA,IAAAiB,aAAA,EAAA,IACAhB,EAAA,IAAAiB,WAAAlB,EAAAnD,QACAwD,EAAA,MAAAJ,EAAA,GAmBA7E,EAAA+F,aAAAd,EAAAN,EAAAG,EAEA9E,EAAAgG,aAAAf,EAAAH,EAAAH,EAmBA3E,EAAAiG,YAAAhB,EAAAF,EAAAC,EAEAhF,EAAAkG,YAAAjB,EAAAD,EAAAD,IAwBA/E,EAAA+F,aAAAvC,EAAA2C,KAAA,KAAAC,GACApG,EAAAgG,aAAAxC,EAAA2C,KAAA,KAAAE,GAgBArG,EAAAiG,YAAA5B,EAAA8B,KAAA,KAAAG,GACAtG,EAAAkG,YAAA7B,EAAA8B,KAAA,KAAAI,IAKA,oBAAAC,cAEAtB,EAAA,IAAAsB,aAAA,EAAA,IACA3B,EAAA,IAAAiB,WAAAZ,EAAAzD,QACAwD,EAAA,MAAAJ,EAAA,GA2BA7E,EAAAyG,cAAAxB,EAAAQ,EAAAC,EAEA1F,EAAA0G,cAAAzB,EAAAS,EAAAD,EA2BAzF,EAAA2G,aAAA1B,EAAAU,EAAAC,EAEA5F,EAAA4G,aAAA3B,EAAAW,EAAAD,IAmCA3F,EAAAyG,cAAAtB,EAAAgB,KAAA,KAAAC,EAAA,EAAA,GACApG,EAAA0G,cAAAvB,EAAAgB,KAAA,KAAAE,EAAA,EAAA,GAiBArG,EAAA2G,aAAArB,EAAAa,KAAA,KAAAG,EAAA,EAAA,GACAtG,EAAA4G,aAAAtB,EAAAa,KAAA,KAAAI,EAAA,EAAA,IAIAvG,EAKA,SAAAoG,EAAA1C,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAGA,SAAA2C,EAAA3C,EAAAC,EAAAC,GACAD,EAAAC,GAAAF,IAAA,GACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAA,IAAAF,EAGA,SAAA4C,EAAA3C,EAAAC,GACA,OAAAD,EAAAC,GACAD,EAAAC,EAAA,IAAA,EACAD,EAAAC,EAAA,IAAA,GACAD,EAAAC,EAAA,IAAA,MAAA,EAGA,SAAA2C,EAAA5C,EAAAC,GACA,OAAAD,EAAAC,IAAA,GACAD,EAAAC,EAAA,IAAA,GACAD,EAAAC,EAAA,IAAA,EACAD,EAAAC,EAAA,MAAA,EA3UA7D,EAAAC,QAAAuD,EAAAA,2BCOA,SAAAsD,EAAAC,GACA,IACA,IAAAC,EAAAC,KAAA,UAAAA,CAAAF,GACA,GAAAC,IAAAA,EAAAzG,QAAA2G,OAAAC,KAAAH,GAAAzG,QACA,OAAAyG,EACA,MAAAI,IACA,OAAA,KAdApH,EAAAC,QAAA6G,wBCAA9G,EAAAC,QA6BA,SAAAoH,EAAAhF,EAAAiF,GACA,IAAAC,EAAAD,GAAA,KACAE,EAAAD,IAAA,EACAE,EAAA,KACAjH,EAAA+G,EACA,OAAA,SAAAD,GACA,GAAAA,EAAA,GAAAE,EAAAF,EACA,OAAAD,EAAAC,GACAC,EAAA/G,EAAA8G,IACAG,EAAAJ,EAAAE,GACA/G,EAAA,GAEA,IAAAoD,EAAAvB,EAAAqF,KAAAD,EAAAjH,EAAAA,GAAA8G,GAGA,OAFA,EAAA9G,IACAA,EAAA,GAAA,EAAAA,IACAoD,4BCtCA,IAAA+D,EAAA1H,EAOA0H,EAAApH,OAAA,SAAAU,GAGA,IAFA,IAAA2G,EAAA,EACAnF,EAAA,EACAjB,EAAA,EAAAA,EAAAP,EAAAV,SAAAiB,GACAiB,EAAAxB,EAAAyB,WAAAlB,IACA,IACAoG,GAAA,EACAnF,EAAA,KACAmF,GAAA,EACA,QAAA,MAAAnF,IAAA,QAAA,MAAAxB,EAAAyB,WAAAlB,EAAA,OACAA,EACAoG,GAAA,GAEAA,GAAA,EAEA,OAAAA,GAUAD,EAAAE,KAAA,SAAAnG,EAAAC,EAAAC,GAEA,GADAA,EAAAD,EACA,EACA,MAAA,GAKA,IAJA,IAGAE,EAHAC,EAAA,KACAC,EAAA,GACAP,EAAA,EAEAG,EAAAC,IACAC,EAAAH,EAAAC,MACA,IACAI,EAAAP,KAAAK,EACA,IAAAA,GAAAA,EAAA,IACAE,EAAAP,MAAA,GAAAK,IAAA,EAAA,GAAAH,EAAAC,KACA,IAAAE,GAAAA,EAAA,KACAA,IAAA,EAAAA,IAAA,IAAA,GAAAH,EAAAC,OAAA,IAAA,GAAAD,EAAAC,OAAA,EAAA,GAAAD,EAAAC,MAAA,MACAI,EAAAP,KAAA,OAAAK,GAAA,IACAE,EAAAP,KAAA,OAAA,KAAAK,IAEAE,EAAAP,MAAA,GAAAK,IAAA,IAAA,GAAAH,EAAAC,OAAA,EAAA,GAAAD,EAAAC,KACA,KAAAH,KACAM,EAAAA,GAAA,IAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,IACAP,EAAA,GAGA,OAAAM,GACAN,GACAM,EAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KACAM,EAAAQ,KAAA,KAEAH,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KAUAmG,EAAAG,MAAA,SAAA7G,EAAAS,EAAAlB,GAIA,IAHA,IACAuH,EACAC,EAFArG,EAAAnB,EAGAgB,EAAA,EAAAA,EAAAP,EAAAV,SAAAiB,GACAuG,EAAA9G,EAAAyB,WAAAlB,IACA,IACAE,EAAAlB,KAAAuH,GACAA,EAAA,KACArG,EAAAlB,KAAAuH,GAAA,EAAA,KAEA,QAAA,MAAAA,IAAA,QAAA,OAAAC,EAAA/G,EAAAyB,WAAAlB,EAAA,MACAuG,EAAA,QAAA,KAAAA,IAAA,KAAA,KAAAC,KACAxG,EACAE,EAAAlB,KAAAuH,GAAA,GAAA,IACArG,EAAAlB,KAAAuH,GAAA,GAAA,GAAA,KAIArG,EAAAlB,KAAAuH,GAAA,GAAA,IAHArG,EAAAlB,KAAAuH,GAAA,EAAA,GAAA,KANArG,EAAAlB,KAAA,GAAAuH,EAAA,KAcA,OAAAvH,EAAAmB,2BCtGA,IAAA9B,EAAAI,EA2BA,SAAAgI,IACApI,EAAAqI,KAAAC,IACAtI,EAAAuI,OAAAD,EAAAtI,EAAAwI,cACAxI,EAAAyI,OAAAH,EAAAtI,EAAA0I,cAtBA1I,EAAA2I,MAAA,UAGA3I,EAAAuI,OAAArI,EAAA,IACAF,EAAAwI,aAAAtI,EAAA,IACAF,EAAAyI,OAAAvI,EAAA,GACAF,EAAA0I,aAAAxI,EAAA,IAGAF,EAAAqI,KAAAnI,EAAA,IACAF,EAAA4I,IAAA1I,EAAA,IACAF,EAAA6I,MAAA3I,EAAA,KACAF,EAAAoI,UAAAA,kECpBAjI,EAAAC,QAAAqI,EAEA,IAEAC,EAFAL,EAAAnI,EAAA,IAIA4I,EAAAT,EAAAS,SACAhB,EAAAO,EAAAP,KAGA,SAAAiB,EAAAC,EAAAC,GACA,OAAAC,WAAA,uBAAAF,EAAAhF,IAAA,OAAAiF,GAAA,GAAA,MAAAD,EAAAjB,KASA,SAAAU,EAAA5G,GAMAoB,KAAAc,IAAAlC,EAMAoB,KAAAe,IAAA,EAMAf,KAAA8E,IAAAlG,EAAAnB,OAgBA,SAAAyI,IACA,OAAAd,EAAAe,OACA,SAAAvH,GACA,OAAA4G,EAAAU,OAAA,SAAAtH,GACA,OAAAwG,EAAAe,OAAAC,SAAAxH,GACA,IAAA6G,EAAA7G,GAEAyH,EAAAzH,KACAA,IAGAyH,EAxBA,IA4CAC,EA5CAD,EAAA,oBAAApD,WACA,SAAArE,GACA,GAAAA,aAAAqE,YAAA1F,MAAAgJ,QAAA3H,GACA,OAAA,IAAA4G,EAAA5G,GACA,MAAAiB,MAAA,mBAGA,SAAAjB,GACA,GAAArB,MAAAgJ,QAAA3H,GACA,OAAA,IAAA4G,EAAA5G,GACA,MAAAiB,MAAA,mBAsEA,SAAA2G,IAEA,IAAAC,EAAA,IAAAZ,EAAA,EAAA,GACAnH,EAAA,EACA,KAAA,EAAAsB,KAAA8E,IAAA9E,KAAAe,KAaA,CACA,KAAArC,EAAA,IAAAA,EAAA,CAEA,GAAAsB,KAAAe,KAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,MAGA,GADAyG,EAAA/D,IAAA+D,EAAA/D,IAAA,IAAA1C,KAAAc,IAAAd,KAAAe,OAAA,EAAArC,KAAA,EACAsB,KAAAc,IAAAd,KAAAe,OAAA,IACA,OAAA0F,EAIA,OADAA,EAAA/D,IAAA+D,EAAA/D,IAAA,IAAA1C,KAAAc,IAAAd,KAAAe,SAAA,EAAArC,KAAA,EACA+H,EAxBA,KAAA/H,EAAA,IAAAA,EAGA,GADA+H,EAAA/D,IAAA+D,EAAA/D,IAAA,IAAA1C,KAAAc,IAAAd,KAAAe,OAAA,EAAArC,KAAA,EACAsB,KAAAc,IAAAd,KAAAe,OAAA,IACA,OAAA0F,EAKA,GAFAA,EAAA/D,IAAA+D,EAAA/D,IAAA,IAAA1C,KAAAc,IAAAd,KAAAe,OAAA,MAAA,EACA0F,EAAA9D,IAAA8D,EAAA9D,IAAA,IAAA3C,KAAAc,IAAAd,KAAAe,OAAA,KAAA,EACAf,KAAAc,IAAAd,KAAAe,OAAA,IACA,OAAA0F,EAgBA,GAfA/H,EAAA,EAeA,EAAAsB,KAAA8E,IAAA9E,KAAAe,KACA,KAAArC,EAAA,IAAAA,EAGA,GADA+H,EAAA9D,IAAA8D,EAAA9D,IAAA,IAAA3C,KAAAc,IAAAd,KAAAe,OAAA,EAAArC,EAAA,KAAA,EACAsB,KAAAc,IAAAd,KAAAe,OAAA,IACA,OAAA0F,OAGA,KAAA/H,EAAA,IAAAA,EAAA,CAEA,GAAAsB,KAAAe,KAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,MAGA,GADAyG,EAAA9D,IAAA8D,EAAA9D,IAAA,IAAA3C,KAAAc,IAAAd,KAAAe,OAAA,EAAArC,EAAA,KAAA,EACAsB,KAAAc,IAAAd,KAAAe,OAAA,IACA,OAAA0F,EAIA,MAAA5G,MAAA,2BAkCA,SAAA6G,EAAA5F,EAAAhC,GACA,OAAAgC,EAAAhC,EAAA,GACAgC,EAAAhC,EAAA,IAAA,EACAgC,EAAAhC,EAAA,IAAA,GACAgC,EAAAhC,EAAA,IAAA,MAAA,EA+BA,SAAA6H,IAGA,GAAA3G,KAAAe,IAAA,EAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,KAAA,GAEA,OAAA,IAAA6F,EAAAa,EAAA1G,KAAAc,IAAAd,KAAAe,KAAA,GAAA2F,EAAA1G,KAAAc,IAAAd,KAAAe,KAAA,IA3KAyE,EAAAU,OAAAA,IAEAV,EAAAtF,UAAA0G,EAAAxB,EAAA7H,MAAA2C,UAAA2G,UAAAzB,EAAA7H,MAAA2C,UAAAX,MAOAiG,EAAAtF,UAAA4G,QACAR,EAAA,WACA,WACA,GAAAA,GAAA,IAAAtG,KAAAc,IAAAd,KAAAe,QAAA,EAAAf,KAAAc,IAAAd,KAAAe,OAAA,IAAA,OAAAuF,EACA,GAAAA,GAAAA,GAAA,IAAAtG,KAAAc,IAAAd,KAAAe,OAAA,KAAA,EAAAf,KAAAc,IAAAd,KAAAe,OAAA,IAAA,OAAAuF,EACA,GAAAA,GAAAA,GAAA,IAAAtG,KAAAc,IAAAd,KAAAe,OAAA,MAAA,EAAAf,KAAAc,IAAAd,KAAAe,OAAA,IAAA,OAAAuF,EACA,GAAAA,GAAAA,GAAA,IAAAtG,KAAAc,IAAAd,KAAAe,OAAA,MAAA,EAAAf,KAAAc,IAAAd,KAAAe,OAAA,IAAA,OAAAuF,EACA,GAAAA,GAAAA,GAAA,GAAAtG,KAAAc,IAAAd,KAAAe,OAAA,MAAA,EAAAf,KAAAc,IAAAd,KAAAe,OAAA,IAAA,OAAAuF,EAGA,IAAAtG,KAAAe,KAAA,GAAAf,KAAA8E,IAEA,MADA9E,KAAAe,IAAAf,KAAA8E,IACAgB,EAAA9F,KAAA,IAEA,OAAAsG,IAQAd,EAAAtF,UAAA6G,MAAA,WACA,OAAA,EAAA/G,KAAA8G,UAOAtB,EAAAtF,UAAA8G,OAAA,WACA,IAAAV,EAAAtG,KAAA8G,SACA,OAAAR,IAAA,IAAA,EAAAA,GAAA,GAqFAd,EAAAtF,UAAA+G,KAAA,WACA,OAAA,IAAAjH,KAAA8G,UAcAtB,EAAAtF,UAAAgH,QAAA,WAGA,GAAAlH,KAAAe,IAAA,EAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,KAAA,GAEA,OAAA0G,EAAA1G,KAAAc,IAAAd,KAAAe,KAAA,IAOAyE,EAAAtF,UAAAiH,SAAA,WAGA,GAAAnH,KAAAe,IAAA,EAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,KAAA,GAEA,OAAA,EAAA0G,EAAA1G,KAAAc,IAAAd,KAAAe,KAAA,IAmCAyE,EAAAtF,UAAAkH,MAAA,WAGA,GAAApH,KAAAe,IAAA,EAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,KAAA,GAEA,IAAAsG,EAAAlB,EAAAgC,MAAAhE,YAAApD,KAAAc,IAAAd,KAAAe,KAEA,OADAf,KAAAe,KAAA,EACAuF,GAQAd,EAAAtF,UAAAmH,OAAA,WAGA,GAAArH,KAAAe,IAAA,EAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,KAAA,GAEA,IAAAsG,EAAAlB,EAAAgC,MAAAtD,aAAA9D,KAAAc,IAAAd,KAAAe,KAEA,OADAf,KAAAe,KAAA,EACAuF,GAOAd,EAAAtF,UAAAoH,MAAA,WACA,IAAA7J,EAAAuC,KAAA8G,SACAjI,EAAAmB,KAAAe,IACAjC,EAAAkB,KAAAe,IAAAtD,EAGA,GAAAqB,EAAAkB,KAAA8E,IACA,MAAAgB,EAAA9F,KAAAvC,GAGA,OADAuC,KAAAe,KAAAtD,EACAF,MAAAgJ,QAAAvG,KAAAc,KACAd,KAAAc,IAAAvB,MAAAV,EAAAC,GACAD,IAAAC,EACA,IAAAkB,KAAAc,IAAAyG,YAAA,GACAvH,KAAA4G,EAAAhC,KAAA5E,KAAAc,IAAAjC,EAAAC,IAOA0G,EAAAtF,UAAA/B,OAAA,WACA,IAAAmJ,EAAAtH,KAAAsH,QACA,OAAAzC,EAAAE,KAAAuC,EAAA,EAAAA,EAAA7J,SAQA+H,EAAAtF,UAAAsH,KAAA,SAAA/J,GACA,GAAA,iBAAAA,EAAA,CAEA,GAAAuC,KAAAe,IAAAtD,EAAAuC,KAAA8E,IACA,MAAAgB,EAAA9F,KAAAvC,GACAuC,KAAAe,KAAAtD,OAEA,GAEA,GAAAuC,KAAAe,KAAAf,KAAA8E,IACA,MAAAgB,EAAA9F,YACA,IAAAA,KAAAc,IAAAd,KAAAe,QAEA,OAAAf,MAQAwF,EAAAtF,UAAAuH,SAAA,SAAAC,GACA,OAAAA,GACA,KAAA,EACA1H,KAAAwH,OACA,MACA,KAAA,EACAxH,KAAAwH,KAAA,GACA,MACA,KAAA,EACAxH,KAAAwH,KAAAxH,KAAA8G,UACA,MACA,KAAA,EACA,KAAA,IAAAY,EAAA,EAAA1H,KAAA8G,WACA9G,KAAAyH,SAAAC,GAEA,MACA,KAAA,EACA1H,KAAAwH,KAAA,GACA,MAGA,QACA,MAAA3H,MAAA,qBAAA6H,EAAA,cAAA1H,KAAAe,KAEA,OAAAf,MAGAwF,EAAAH,EAAA,SAAAsC,GACAlC,EAAAkC,EACAnC,EAAAU,OAAAA,IACAT,EAAAJ,IAEA,IAAAjI,EAAAgI,EAAAwC,KAAA,SAAA,WACAxC,EAAAyC,MAAArC,EAAAtF,UAAA,CAEA4H,MAAA,WACA,OAAAtB,EAAA5B,KAAA5E,MAAA5C,IAAA,IAGA2K,OAAA,WACA,OAAAvB,EAAA5B,KAAA5E,MAAA5C,IAAA,IAGA4K,OAAA,WACA,OAAAxB,EAAA5B,KAAA5E,MAAAiI,WAAA7K,IAAA,IAGA8K,QAAA,WACA,OAAAvB,EAAA/B,KAAA5E,MAAA5C,IAAA,IAGA+K,SAAA,WACA,OAAAxB,EAAA/B,KAAA5E,MAAA5C,IAAA,mCCrZAF,EAAAC,QAAAsI,EAGA,IAAAD,EAAAvI,EAAA,IACAwI,EAAAvF,UAAAkE,OAAA8B,OAAAV,EAAAtF,YAAAqH,YAAA9B,EAEA,IAAAL,EAAAnI,EAAA,IASA,SAAAwI,EAAA7G,GACA4G,EAAAZ,KAAA5E,KAAApB,GASA6G,EAAAJ,EAAA,WAEAD,EAAAe,SACAV,EAAAvF,UAAA0G,EAAAxB,EAAAe,OAAAjG,UAAAX,QAOAkG,EAAAvF,UAAA/B,OAAA,WACA,IAAA2G,EAAA9E,KAAA8G,SACA,OAAA9G,KAAAc,IAAAsH,UACApI,KAAAc,IAAAsH,UAAApI,KAAAe,IAAAf,KAAAe,IAAAzC,KAAA+J,IAAArI,KAAAe,IAAA+D,EAAA9E,KAAA8E,MACA9E,KAAAc,IAAAwH,SAAA,QAAAtI,KAAAe,IAAAf,KAAAe,IAAAzC,KAAA+J,IAAArI,KAAAe,IAAA+D,EAAA9E,KAAA8E,OAUAW,EAAAJ,oCCjDAnI,EAAAC,QAAA,4BCKAA,EA6BAoL,QAAAtL,EAAA,gCClCAC,EAAAC,QAAAoL,EAEA,IAAAnD,EAAAnI,EAAA,IAsCA,SAAAsL,EAAAC,EAAAC,EAAAC,GAEA,GAAA,mBAAAF,EACA,MAAAG,UAAA,8BAEAvD,EAAArF,aAAA6E,KAAA5E,MAMAA,KAAAwI,QAAAA,EAMAxI,KAAAyI,mBAAAA,EAMAzI,KAAA0I,oBAAAA,IA1DAH,EAAArI,UAAAkE,OAAA8B,OAAAd,EAAArF,aAAAG,YAAAqH,YAAAgB,GAwEArI,UAAA0I,QAAA,SAAAA,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAEA,IAAAD,EACA,MAAAL,UAAA,6BAEA,IAAAO,EAAAlJ,KACA,IAAAiJ,EACA,OAAA7D,EAAA+D,UAAAP,EAAAM,EAAAL,EAAAC,EAAAC,EAAAC,GAEA,IAAAE,EAAAV,QAEA,OADAY,WAAA,WAAAH,EAAApJ,MAAA,mBAAA,GACAlD,EAGA,IACA,OAAAuM,EAAAV,QACAK,EACAC,EAAAI,EAAAT,iBAAA,kBAAA,UAAAO,GAAAK,SACA,SAAArL,EAAAsL,GAEA,GAAAtL,EAEA,OADAkL,EAAA1I,KAAA,QAAAxC,EAAA6K,GACAI,EAAAjL,GAGA,GAAA,OAAAsL,EAEA,OADAJ,EAAApK,KAAA,GACAnC,EAGA,KAAA2M,aAAAP,GACA,IACAO,EAAAP,EAAAG,EAAAR,kBAAA,kBAAA,UAAAY,GACA,MAAAtL,GAEA,OADAkL,EAAA1I,KAAA,QAAAxC,EAAA6K,GACAI,EAAAjL,GAKA,OADAkL,EAAA1I,KAAA,OAAA8I,EAAAT,GACAI,EAAA,KAAAK,KAGA,MAAAtL,GAGA,OAFAkL,EAAA1I,KAAA,QAAAxC,EAAA6K,GACAO,WAAA,WAAAH,EAAAjL,IAAA,GACArB,IASA4L,EAAArI,UAAApB,IAAA,SAAAyK,GAOA,OANAvJ,KAAAwI,UACAe,GACAvJ,KAAAwI,QAAA,KAAA,KAAA,MACAxI,KAAAwI,QAAA,KACAxI,KAAAQ,KAAA,OAAAH,OAEAL,kCC3IA9C,EAAAC,QAAA0I,EAEA,IAAAT,EAAAnI,EAAA,IAUA,SAAA4I,EAAAnD,EAAAC,GASA3C,KAAA0C,GAAAA,IAAA,EAMA1C,KAAA2C,GAAAA,IAAA,EAQA,IAAA6G,EAAA3D,EAAA2D,KAAA,IAAA3D,EAAA,EAAA,GAEA2D,EAAAC,SAAA,WAAA,OAAA,GACAD,EAAAE,SAAAF,EAAAvB,SAAA,WAAA,OAAAjI,MACAwJ,EAAA/L,OAAA,WAAA,OAAA,GAOA,IAAAkM,EAAA9D,EAAA8D,SAAA,mBAOA9D,EAAA+D,WAAA,SAAAtD,GACA,GAAA,IAAAA,EACA,OAAAkD,EACA,IAAAxI,EAAAsF,EAAA,EACAtF,IACAsF,GAAAA,GACA,IAAA5D,EAAA4D,IAAA,EACA3D,GAAA2D,EAAA5D,GAAA,aAAA,EAUA,OATA1B,IACA2B,GAAAA,IAAA,EACAD,GAAAA,IAAA,EACA,aAAAA,IACAA,EAAA,EACA,aAAAC,IACAA,EAAA,KAGA,IAAAkD,EAAAnD,EAAAC,IAQAkD,EAAAgE,KAAA,SAAAvD,GACA,GAAA,iBAAAA,EACA,OAAAT,EAAA+D,WAAAtD,GACA,GAAAlB,EAAA0E,SAAAxD,GAAA,CAEA,IAAAlB,EAAAwC,KAGA,OAAA/B,EAAA+D,WAAAG,SAAAzD,EAAA,KAFAA,EAAAlB,EAAAwC,KAAAoC,WAAA1D,GAIA,OAAAA,EAAA2D,KAAA3D,EAAA4D,KAAA,IAAArE,EAAAS,EAAA2D,MAAA,EAAA3D,EAAA4D,OAAA,GAAAV,GAQA3D,EAAA3F,UAAAuJ,SAAA,SAAAU,GACA,IAAAA,GAAAnK,KAAA2C,KAAA,GAAA,CACA,IAAAD,EAAA,GAAA1C,KAAA0C,KAAA,EACAC,GAAA3C,KAAA2C,KAAA,EAGA,OAFAD,IACAC,EAAAA,EAAA,IAAA,KACAD,EAAA,WAAAC,GAEA,OAAA3C,KAAA0C,GAAA,WAAA1C,KAAA2C,IAQAkD,EAAA3F,UAAAkK,OAAA,SAAAD,GACA,OAAA/E,EAAAwC,KACA,IAAAxC,EAAAwC,KAAA,EAAA5H,KAAA0C,GAAA,EAAA1C,KAAA2C,KAAAwH,GAEA,CAAAF,IAAA,EAAAjK,KAAA0C,GAAAwH,KAAA,EAAAlK,KAAA2C,GAAAwH,WAAAA,IAGA,IAAAvK,EAAAP,OAAAa,UAAAN,WAOAiG,EAAAwE,SAAA,SAAAC,GACA,OAAAA,IAAAX,EACAH,EACA,IAAA3D,GACAjG,EAAAgF,KAAA0F,EAAA,GACA1K,EAAAgF,KAAA0F,EAAA,IAAA,EACA1K,EAAAgF,KAAA0F,EAAA,IAAA,GACA1K,EAAAgF,KAAA0F,EAAA,IAAA,MAAA,GAEA1K,EAAAgF,KAAA0F,EAAA,GACA1K,EAAAgF,KAAA0F,EAAA,IAAA,EACA1K,EAAAgF,KAAA0F,EAAA,IAAA,GACA1K,EAAAgF,KAAA0F,EAAA,IAAA,MAAA,IAQAzE,EAAA3F,UAAAqK,OAAA,WACA,OAAAlL,OAAAC,aACA,IAAAU,KAAA0C,GACA1C,KAAA0C,KAAA,EAAA,IACA1C,KAAA0C,KAAA,GAAA,IACA1C,KAAA0C,KAAA,GACA,IAAA1C,KAAA2C,GACA3C,KAAA2C,KAAA,EAAA,IACA3C,KAAA2C,KAAA,GAAA,IACA3C,KAAA2C,KAAA,KAQAkD,EAAA3F,UAAAwJ,SAAA,WACA,IAAAc,EAAAxK,KAAA2C,IAAA,GAGA,OAFA3C,KAAA2C,KAAA3C,KAAA2C,IAAA,EAAA3C,KAAA0C,KAAA,IAAA8H,KAAA,EACAxK,KAAA0C,IAAA1C,KAAA0C,IAAA,EAAA8H,KAAA,EACAxK,MAOA6F,EAAA3F,UAAA+H,SAAA,WACA,IAAAuC,IAAA,EAAAxK,KAAA0C,IAGA,OAFA1C,KAAA0C,KAAA1C,KAAA0C,KAAA,EAAA1C,KAAA2C,IAAA,IAAA6H,KAAA,EACAxK,KAAA2C,IAAA3C,KAAA2C,KAAA,EAAA6H,KAAA,EACAxK,MAOA6F,EAAA3F,UAAAzC,OAAA,WACA,IAAAgN,EAAAzK,KAAA0C,GACAgI,GAAA1K,KAAA0C,KAAA,GAAA1C,KAAA2C,IAAA,KAAA,EACAgI,EAAA3K,KAAA2C,KAAA,GACA,OAAA,GAAAgI,EACA,GAAAD,EACAD,EAAA,MACAA,EAAA,IAAA,EAAA,EACAA,EAAA,QAAA,EAAA,EACAC,EAAA,MACAA,EAAA,IAAA,EAAA,EACAA,EAAA,QAAA,EAAA,EACAC,EAAA,IAAA,EAAA,kCCrMA,IAAAvF,EAAAjI,EA2OA,SAAA0K,EAAA+C,EAAAC,EAAAC,GACA,IAAA,IAAAzG,EAAAD,OAAAC,KAAAwG,GAAAnM,EAAA,EAAAA,EAAA2F,EAAA5G,SAAAiB,EACAkM,EAAAvG,EAAA3F,MAAA/B,GAAAmO,IACAF,EAAAvG,EAAA3F,IAAAmM,EAAAxG,EAAA3F,KACA,OAAAkM,EAoBA,SAAAG,EAAAC,GAEA,SAAAC,EAAAC,EAAAC,GAEA,KAAAnL,gBAAAiL,GACA,OAAA,IAAAA,EAAAC,EAAAC,GAKA/G,OAAAgH,eAAApL,KAAA,UAAA,CAAAqL,IAAA,WAAA,OAAAH,KAGArL,MAAAyL,kBACAzL,MAAAyL,kBAAAtL,KAAAiL,GAEA7G,OAAAgH,eAAApL,KAAA,QAAA,CAAAsG,MAAAzG,QAAA0L,OAAA,KAEAJ,GACAtD,EAAA7H,KAAAmL,GAWA,OARAF,EAAA/K,UAAAkE,OAAA8B,OAAArG,MAAAK,YAAAqH,YAAA0D,EAEA7G,OAAAgH,eAAAH,EAAA/K,UAAA,OAAA,CAAAmL,IAAA,WAAA,OAAAL,KAEAC,EAAA/K,UAAAoI,SAAA,WACA,OAAAtI,KAAAgL,KAAA,KAAAhL,KAAAkL,SAGAD,EA9RA7F,EAAA+D,UAAAlM,EAAA,GAGAmI,EAAAlH,OAAAjB,EAAA,GAGAmI,EAAArF,aAAA9C,EAAA,GAGAmI,EAAAgC,MAAAnK,EAAA,GAGAmI,EAAApB,QAAA/G,EAAA,GAGAmI,EAAAP,KAAA5H,EAAA,GAGAmI,EAAAoG,KAAAvO,EAAA,GAGAmI,EAAAS,SAAA5I,EAAA,IAOAmI,EAAAqG,UAAA,oBAAAC,QACAA,QACAA,OAAAC,SACAD,OAAAC,QAAAC,UACAF,OAAAC,QAAAC,SAAAC,MAOAzG,EAAAsG,OAAAtG,EAAAqG,QAAAC,QACA,oBAAAI,QAAAA,QACA,oBAAA5C,MAAAA,MACAlJ,KAQAoF,EAAA2G,WAAA3H,OAAA4H,OAAA5H,OAAA4H,OAAA,IAAA,GAOA5G,EAAA6G,YAAA7H,OAAA4H,OAAA5H,OAAA4H,OAAA,IAAA,GAQA5G,EAAA8G,UAAAC,OAAAD,WAAA,SAAA5F,GACA,MAAA,iBAAAA,GAAA8F,SAAA9F,IAAAhI,KAAA8C,MAAAkF,KAAAA,GAQAlB,EAAA0E,SAAA,SAAAxD,GACA,MAAA,iBAAAA,GAAAA,aAAAjH,QAQA+F,EAAAiH,SAAA,SAAA/F,GACA,OAAAA,GAAA,iBAAAA,GAWAlB,EAAAkH,MAQAlH,EAAAmH,MAAA,SAAAC,EAAAC,GACA,IAAAnG,EAAAkG,EAAAC,GACA,OAAA,MAAAnG,GAAAkG,EAAAE,eAAAD,KACA,iBAAAnG,GAAA,GAAA/I,MAAAgJ,QAAAD,GAAAA,EAAA7I,OAAA2G,OAAAC,KAAAiC,GAAA7I,UAeA2H,EAAAe,OAAA,WACA,IACA,IAAAA,EAAAf,EAAApB,QAAA,UAAAmC,OAEA,OAAAA,EAAAjG,UAAAyM,UAAAxG,EAAA,KACA,MAAA7B,GAEA,OAAA,MAPA,GAYAc,EAAAwH,EAAA,KAGAxH,EAAAyH,EAAA,KAOAzH,EAAA0H,UAAA,SAAAC,GAEA,MAAA,iBAAAA,EACA3H,EAAAe,OACAf,EAAAyH,EAAAE,GACA,IAAA3H,EAAA7H,MAAAwP,GACA3H,EAAAe,OACAf,EAAAwH,EAAAG,GACA,oBAAA9J,WACA8J,EACA,IAAA9J,WAAA8J,IAOA3H,EAAA7H,MAAA,oBAAA0F,WAAAA,WAAA1F,MAeA6H,EAAAwC,KAAAxC,EAAAsG,OAAAsB,SAAA5H,EAAAsG,OAAAsB,QAAApF,MACAxC,EAAAsG,OAAA9D,MACAxC,EAAApB,QAAA,QAOAoB,EAAA6H,OAAA,mBAOA7H,EAAA8H,QAAA,wBAOA9H,EAAA+H,QAAA,6CAOA/H,EAAAgI,WAAA,SAAA9G,GACA,OAAAA,EACAlB,EAAAS,SAAAgE,KAAAvD,GAAAiE,SACAnF,EAAAS,SAAA8D,UASAvE,EAAAiI,aAAA,SAAA/C,EAAAH,GACA,IAAA1D,EAAArB,EAAAS,SAAAwE,SAAAC,GACA,OAAAlF,EAAAwC,KACAxC,EAAAwC,KAAA0F,SAAA7G,EAAA/D,GAAA+D,EAAA9D,GAAAwH,GACA1D,EAAAgD,WAAAU,IAkBA/E,EAAAyC,MAAAA,EAOAzC,EAAAmI,QAAA,SAAAC,GACA,OAAAA,EAAA,GAAAC,cAAAD,EAAAE,UAAA,IA0CAtI,EAAA2F,SAAAA,EAmBA3F,EAAAuI,cAAA5C,EAAA,iBAoBA3F,EAAAwI,YAAA,SAAAC,GAEA,IADA,IAAAC,EAAA,GACApP,EAAA,EAAAA,EAAAmP,EAAApQ,SAAAiB,EACAoP,EAAAD,EAAAnP,IAAA,EAOA,OAAA,WACA,IAAA,IAAA2F,EAAAD,OAAAC,KAAArE,MAAAtB,EAAA2F,EAAA5G,OAAA,GAAA,EAAAiB,IAAAA,EACA,GAAA,IAAAoP,EAAAzJ,EAAA3F,KAAAsB,KAAAqE,EAAA3F,MAAA/B,GAAA,OAAAqD,KAAAqE,EAAA3F,IACA,OAAA2F,EAAA3F,KAiBA0G,EAAA2I,YAAA,SAAAF,GAQA,OAAA,SAAA7C,GACA,IAAA,IAAAtM,EAAA,EAAAA,EAAAmP,EAAApQ,SAAAiB,EACAmP,EAAAnP,KAAAsM,UACAhL,KAAA6N,EAAAnP,MAoBA0G,EAAA4I,cAAA,CACAC,MAAA5O,OACA6O,MAAA7O,OACAiI,MAAAjI,OACA8O,MAAA,GAIA/I,EAAAC,EAAA,WACA,IAAAc,EAAAf,EAAAe,OAEAA,GAMAf,EAAAwH,EAAAzG,EAAA0D,OAAA5G,WAAA4G,MAAA1D,EAAA0D,MAEA,SAAAvD,EAAA8H,GACA,OAAA,IAAAjI,EAAAG,EAAA8H,IAEAhJ,EAAAyH,EAAA1G,EAAAkI,aAEA,SAAA7J,GACA,OAAA,IAAA2B,EAAA3B,KAbAY,EAAAwH,EAAAxH,EAAAyH,EAAA,8DCpZA3P,EAAAC,QAAAmI,EAEA,IAEAC,EAFAH,EAAAnI,EAAA,IAIA4I,EAAAT,EAAAS,SACA3H,EAAAkH,EAAAlH,OACA2G,EAAAO,EAAAP,KAWA,SAAAyJ,EAAAlR,EAAA0H,EAAAjE,GAMAb,KAAA5C,GAAAA,EAMA4C,KAAA8E,IAAAA,EAMA9E,KAAAuO,KAAA5R,EAMAqD,KAAAa,IAAAA,EAIA,SAAA2N,KAUA,SAAAC,EAAAC,GAMA1O,KAAA2O,KAAAD,EAAAC,KAMA3O,KAAA4O,KAAAF,EAAAE,KAMA5O,KAAA8E,IAAA4J,EAAA5J,IAMA9E,KAAAuO,KAAAG,EAAAG,OAQA,SAAAvJ,IAMAtF,KAAA8E,IAAA,EAMA9E,KAAA2O,KAAA,IAAAL,EAAAE,EAAA,EAAA,GAMAxO,KAAA4O,KAAA5O,KAAA2O,KAMA3O,KAAA6O,OAAA,KASA,SAAA3I,IACA,OAAAd,EAAAe,OACA,WACA,OAAAb,EAAAY,OAAA,WACA,OAAA,IAAAX,OAIA,WACA,OAAA,IAAAD,GAuCA,SAAAwJ,EAAAjO,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EAoBA,SAAAkO,EAAAjK,EAAAjE,GACAb,KAAA8E,IAAAA,EACA9E,KAAAuO,KAAA5R,EACAqD,KAAAa,IAAAA,EA8CA,SAAAmO,EAAAnO,EAAAC,EAAAC,GACA,KAAAF,EAAA8B,IACA7B,EAAAC,KAAA,IAAAF,EAAA6B,GAAA,IACA7B,EAAA6B,IAAA7B,EAAA6B,KAAA,EAAA7B,EAAA8B,IAAA,MAAA,EACA9B,EAAA8B,MAAA,EAEA,KAAA,IAAA9B,EAAA6B,IACA5B,EAAAC,KAAA,IAAAF,EAAA6B,GAAA,IACA7B,EAAA6B,GAAA7B,EAAA6B,KAAA,EAEA5B,EAAAC,KAAAF,EAAA6B,GA2CA,SAAAuM,EAAApO,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GA7JAyE,EAAAY,OAAAA,IAOAZ,EAAAf,MAAA,SAAAC,GACA,OAAA,IAAAY,EAAA7H,MAAAiH,IAKAY,EAAA7H,QAAAA,QACA+H,EAAAf,MAAAa,EAAAoG,KAAAlG,EAAAf,MAAAa,EAAA7H,MAAA2C,UAAA2G,WAUAvB,EAAApF,UAAAgP,EAAA,SAAA9R,EAAA0H,EAAAjE,GAGA,OAFAb,KAAA4O,KAAA5O,KAAA4O,KAAAL,KAAA,IAAAD,EAAAlR,EAAA0H,EAAAjE,GACAb,KAAA8E,KAAAA,EACA9E,OA8BA+O,EAAA7O,UAAAkE,OAAA8B,OAAAoI,EAAApO,YACA9C,GAxBA,SAAAyD,EAAAC,EAAAC,GACA,KAAA,IAAAF,GACAC,EAAAC,KAAA,IAAAF,EAAA,IACAA,KAAA,EAEAC,EAAAC,GAAAF,GA0BAyE,EAAApF,UAAA4G,OAAA,SAAAR,GAWA,OARAtG,KAAA8E,MAAA9E,KAAA4O,KAAA5O,KAAA4O,KAAAL,KAAA,IAAAQ,GACAzI,KAAA,GACA,IAAA,EACAA,EAAA,MAAA,EACAA,EAAA,QAAA,EACAA,EAAA,UAAA,EACA,EACAA,IAAAxB,IACA9E,MASAsF,EAAApF,UAAA6G,MAAA,SAAAT,GACA,OAAAA,EAAA,EACAtG,KAAAkP,EAAAF,EAAA,GAAAnJ,EAAA+D,WAAAtD,IACAtG,KAAA8G,OAAAR,IAQAhB,EAAApF,UAAA8G,OAAA,SAAAV,GACA,OAAAtG,KAAA8G,QAAAR,GAAA,EAAAA,GAAA,MAAA,IAkCAhB,EAAApF,UAAA4H,MAZAxC,EAAApF,UAAA6H,OAAA,SAAAzB,GACA,IAAAG,EAAAZ,EAAAgE,KAAAvD,GACA,OAAAtG,KAAAkP,EAAAF,EAAAvI,EAAAhJ,SAAAgJ,IAkBAnB,EAAApF,UAAA8H,OAAA,SAAA1B,GACA,IAAAG,EAAAZ,EAAAgE,KAAAvD,GAAAoD,WACA,OAAA1J,KAAAkP,EAAAF,EAAAvI,EAAAhJ,SAAAgJ,IAQAnB,EAAApF,UAAA+G,KAAA,SAAAX,GACA,OAAAtG,KAAAkP,EAAAJ,EAAA,EAAAxI,EAAA,EAAA,IAyBAhB,EAAApF,UAAAiH,SAVA7B,EAAApF,UAAAgH,QAAA,SAAAZ,GACA,OAAAtG,KAAAkP,EAAAD,EAAA,EAAA3I,IAAA,IA6BAhB,EAAApF,UAAAiI,SAZA7C,EAAApF,UAAAgI,QAAA,SAAA5B,GACA,IAAAG,EAAAZ,EAAAgE,KAAAvD,GACA,OAAAtG,KAAAkP,EAAAD,EAAA,EAAAxI,EAAA/D,IAAAwM,EAAAD,EAAA,EAAAxI,EAAA9D,KAkBA2C,EAAApF,UAAAkH,MAAA,SAAAd,GACA,OAAAtG,KAAAkP,EAAA9J,EAAAgC,MAAAlE,aAAA,EAAAoD,IASAhB,EAAApF,UAAAmH,OAAA,SAAAf,GACA,OAAAtG,KAAAkP,EAAA9J,EAAAgC,MAAAxD,cAAA,EAAA0C,IAGA,IAAA6I,EAAA/J,EAAA7H,MAAA2C,UAAAkP,IACA,SAAAvO,EAAAC,EAAAC,GACAD,EAAAsO,IAAAvO,EAAAE,IAGA,SAAAF,EAAAC,EAAAC,GACA,IAAA,IAAArC,EAAA,EAAAA,EAAAmC,EAAApD,SAAAiB,EACAoC,EAAAC,EAAArC,GAAAmC,EAAAnC,IAQA4G,EAAApF,UAAAoH,MAAA,SAAAhB,GACA,IAAAxB,EAAAwB,EAAA7I,SAAA,EACA,IAAAqH,EACA,OAAA9E,KAAAkP,EAAAJ,EAAA,EAAA,GACA,GAAA1J,EAAA0E,SAAAxD,GAAA,CACA,IAAAxF,EAAAwE,EAAAf,MAAAO,EAAA5G,EAAAT,OAAA6I,IACApI,EAAAwB,OAAA4G,EAAAxF,EAAA,GACAwF,EAAAxF,EAEA,OAAAd,KAAA8G,OAAAhC,GAAAoK,EAAAC,EAAArK,EAAAwB,IAQAhB,EAAApF,UAAA/B,OAAA,SAAAmI,GACA,IAAAxB,EAAAD,EAAApH,OAAA6I,GACA,OAAAxB,EACA9E,KAAA8G,OAAAhC,GAAAoK,EAAArK,EAAAG,MAAAF,EAAAwB,GACAtG,KAAAkP,EAAAJ,EAAA,EAAA,IAQAxJ,EAAApF,UAAAmP,KAAA,WAIA,OAHArP,KAAA6O,OAAA,IAAAJ,EAAAzO,MACAA,KAAA2O,KAAA3O,KAAA4O,KAAA,IAAAN,EAAAE,EAAA,EAAA,GACAxO,KAAA8E,IAAA,EACA9E,MAOAsF,EAAApF,UAAAoP,MAAA,WAUA,OATAtP,KAAA6O,QACA7O,KAAA2O,KAAA3O,KAAA6O,OAAAF,KACA3O,KAAA4O,KAAA5O,KAAA6O,OAAAD,KACA5O,KAAA8E,IAAA9E,KAAA6O,OAAA/J,IACA9E,KAAA6O,OAAA7O,KAAA6O,OAAAN,OAEAvO,KAAA2O,KAAA3O,KAAA4O,KAAA,IAAAN,EAAAE,EAAA,EAAA,GACAxO,KAAA8E,IAAA,GAEA9E,MAOAsF,EAAApF,UAAAqP,OAAA,WACA,IAAAZ,EAAA3O,KAAA2O,KACAC,EAAA5O,KAAA4O,KACA9J,EAAA9E,KAAA8E,IAOA,OANA9E,KAAAsP,QAAAxI,OAAAhC,GACAA,IACA9E,KAAA4O,KAAAL,KAAAI,EAAAJ,KACAvO,KAAA4O,KAAAA,EACA5O,KAAA8E,KAAAA,GAEA9E,MAOAsF,EAAApF,UAAAmJ,OAAA,WAIA,IAHA,IAAAsF,EAAA3O,KAAA2O,KAAAJ,KACAzN,EAAAd,KAAAuH,YAAAhD,MAAAvE,KAAA8E,KACA/D,EAAA,EACA4N,GACAA,EAAAvR,GAAAuR,EAAA9N,IAAAC,EAAAC,GACAA,GAAA4N,EAAA7J,IACA6J,EAAAA,EAAAJ,KAGA,OAAAzN,GAGAwE,EAAAD,EAAA,SAAAmK,GACAjK,EAAAiK,EACAlK,EAAAY,OAAAA,IACAX,EAAAF,iCC9cAnI,EAAAC,QAAAoI,EAGA,IAAAD,EAAArI,EAAA,KACAsI,EAAArF,UAAAkE,OAAA8B,OAAAZ,EAAApF,YAAAqH,YAAAhC,EAEA,IAAAH,EAAAnI,EAAA,IAQA,SAAAsI,IACAD,EAAAV,KAAA5E,MAwCA,SAAAyP,EAAA5O,EAAAC,EAAAC,GACAF,EAAApD,OAAA,GACA2H,EAAAP,KAAAG,MAAAnE,EAAAC,EAAAC,GACAD,EAAA6L,UACA7L,EAAA6L,UAAA9L,EAAAE,GAEAD,EAAAkE,MAAAnE,EAAAE,GA3CAwE,EAAAF,EAAA,WAOAE,EAAAhB,MAAAa,EAAAyH,EAEAtH,EAAAmK,iBAAAtK,EAAAe,QAAAf,EAAAe,OAAAjG,qBAAA+C,YAAA,QAAAmC,EAAAe,OAAAjG,UAAAkP,IAAApE,KACA,SAAAnK,EAAAC,EAAAC,GACAD,EAAAsO,IAAAvO,EAAAE,IAIA,SAAAF,EAAAC,EAAAC,GACA,GAAAF,EAAA8O,KACA9O,EAAA8O,KAAA7O,EAAAC,EAAA,EAAAF,EAAApD,aACA,IAAA,IAAAiB,EAAA,EAAAA,EAAAmC,EAAApD,QACAqD,EAAAC,KAAAF,EAAAnC,OAQA6G,EAAArF,UAAAoH,MAAA,SAAAhB,GACAlB,EAAA0E,SAAAxD,KACAA,EAAAlB,EAAAwH,EAAAtG,EAAA,WACA,IAAAxB,EAAAwB,EAAA7I,SAAA,EAIA,OAHAuC,KAAA8G,OAAAhC,GACAA,GACA9E,KAAAkP,EAAA3J,EAAAmK,iBAAA5K,EAAAwB,GACAtG,MAeAuF,EAAArF,UAAA/B,OAAA,SAAAmI,GACA,IAAAxB,EAAAM,EAAAe,OAAAyJ,WAAAtJ,GAIA,OAHAtG,KAAA8G,OAAAhC,GACAA,GACA9E,KAAAkP,EAAAO,EAAA3K,EAAAwB,GACAtG,MAWAuF,EAAAF,qBjBpFAxI,KAAAC,MAcAC,EAPA,SAAA8S,EAAA7E,GACA,IAAA8E,EAAAjT,EAAAmO,GAGA,OAFA8E,GACAlT,EAAAoO,GAAA,GAAApG,KAAAkL,EAAAjT,EAAAmO,GAAA,CAAA7N,QAAA,IAAA0S,EAAAC,EAAAA,EAAA3S,SACA2S,EAAA3S,QAGA0S,CAAA/S,EAAA,IAGAC,EAAAqI,KAAAsG,OAAA3O,SAAAA,EAGA,mBAAAgT,QAAAA,OAAAC,KACAD,OAAA,CAAA,QAAA,SAAAnI,GAKA,OAJAA,GAAAA,EAAAqI,SACAlT,EAAAqI,KAAAwC,KAAAA,EACA7K,EAAAoI,aAEApI,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(16);\nprotobuf.BufferWriter = require(17);\nprotobuf.Reader = require(9);\nprotobuf.BufferReader = require(10);\n\n// Utility\nprotobuf.util = require(15);\nprotobuf.rpc = require(12);\nprotobuf.roots = require(11);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(15);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(9);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(13);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(15);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(15);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(3);\n\n// float handling accross browsers\nutil.float = require(4);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(5);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(7);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(6);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(14);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(15);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(16);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/legacy-libs/protobufjs/dist/protobuf.js b/legacy-libs/protobufjs/dist/protobuf.js new file mode 100644 index 0000000..bd7e4da --- /dev/null +++ b/legacy-libs/protobufjs/dist/protobuf.js @@ -0,0 +1,8919 @@ +/*! + * protobuf.js v6.10.0 (c) 2016, daniel wirtz + * compiled wed, 15 jul 2020 23:34:13 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +},{}],4:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = fetch; + +var asPromise = require(1), + inquire = require(7); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + +},{"1":1,"7":7}],6:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],7:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],8:[function(require,module,exports){ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + +},{}],9:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],10:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],11:[function(require,module,exports){ +"use strict"; +module.exports = common; + +var commonRe = /\/|\./; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {INamespace} google/protobuf/any.proto Any + * @property {INamespace} google/protobuf/duration.proto Duration + * @property {INamespace} google/protobuf/empty.proto Empty + * @property {INamespace} google/protobuf/field_mask.proto FieldMask + * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {INamespace} google/protobuf/timestamp.proto Timestamp + * @property {INamespace} google/protobuf/wrappers.proto Wrappers + * @example + * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) + * protobuf.common("descriptor", descriptorJson); + * + * // manually provides a custom definition (uses my.foo namespace) + * protobuf.common("my/foo/bar.proto", myFooBarJson); + */ +function common(name, json) { + if (!commonRe.test(name)) { + name = "google/protobuf/" + name + ".proto"; + json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; + } + common[name] = json; +} + +// Not provided because of limited use (feel free to discuss or to provide yourself): +// +// google/protobuf/descriptor.proto +// google/protobuf/source_context.proto +// google/protobuf/type.proto +// +// Stripped and pre-parsed versions of these non-bundled files are instead available as part of +// the repository or package within the google/protobuf directory. + +common("any", { + + /** + * Properties of a google.protobuf.Any message. + * @interface IAny + * @type {Object} + * @property {string} [typeUrl] + * @property {Uint8Array} [bytes] + * @memberof common + */ + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 + } + } + } +}); + +var timeType; + +common("duration", { + + /** + * Properties of a google.protobuf.Duration message. + * @interface IDuration + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } +}); + +common("timestamp", { + + /** + * Properties of a google.protobuf.Timestamp message. + * @interface ITimestamp + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Timestamp: timeType +}); + +common("empty", { + + /** + * Properties of a google.protobuf.Empty message. + * @interface IEmpty + * @memberof common + */ + Empty: { + fields: {} + } +}); + +common("struct", { + + /** + * Properties of a google.protobuf.Struct message. + * @interface IStruct + * @type {Object} + * @property {Object.} [fields] + * @memberof common + */ + Struct: { + fields: { + fields: { + keyType: "string", + type: "Value", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Value message. + * @interface IValue + * @type {Object} + * @property {string} [kind] + * @property {0} [nullValue] + * @property {number} [numberValue] + * @property {string} [stringValue] + * @property {boolean} [boolValue] + * @property {IStruct} [structValue] + * @property {IListValue} [listValue] + * @memberof common + */ + Value: { + oneofs: { + kind: { + oneof: [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + fields: { + nullValue: { + type: "NullValue", + id: 1 + }, + numberValue: { + type: "double", + id: 2 + }, + stringValue: { + type: "string", + id: 3 + }, + boolValue: { + type: "bool", + id: 4 + }, + structValue: { + type: "Struct", + id: 5 + }, + listValue: { + type: "ListValue", + id: 6 + } + } + }, + + NullValue: { + values: { + NULL_VALUE: 0 + } + }, + + /** + * Properties of a google.protobuf.ListValue message. + * @interface IListValue + * @type {Object} + * @property {Array.} [values] + * @memberof common + */ + ListValue: { + fields: { + values: { + rule: "repeated", + type: "Value", + id: 1 + } + } + } +}); + +common("wrappers", { + + /** + * Properties of a google.protobuf.DoubleValue message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.FloatValue message. + * @interface IFloatValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int64Value message. + * @interface IInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt64Value message. + * @interface IUInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int32Value message. + * @interface IInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt32Value message. + * @interface IUInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BoolValue message. + * @interface IBoolValue + * @type {Object} + * @property {boolean} [value] + * @memberof common + */ + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.StringValue message. + * @interface IStringValue + * @type {Object} + * @property {string} [value] + * @memberof common + */ + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BytesValue message. + * @interface IBytesValue + * @type {Object} + * @property {Uint8Array} [value] + * @memberof common + */ + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } +}); + +common("field_mask", { + + /** + * Properties of a google.protobuf.FieldMask message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FieldMask: { + fields: { + paths: { + rule: "repeated", + type: "string", + id: 1 + } + } + } +}); + +/** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param {string} file Proto file name + * @returns {INamespace|null} Root definition or `null` if not defined + */ +common.get = function get(file) { + return common[file] || null; +}; + +},{}],12:[function(require,module,exports){ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require(15), + util = require(37); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(d%s){", prop); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=d%s>>>0", prop, prop); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=d%s|0", prop, prop); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) + ("else if(typeof d%s===\"string\")", prop) + ("m%s=parseInt(d%s,10)", prop, prop) + ("else if(typeof d%s===\"number\")", prop) + ("m%s=d%s", prop, prop) + ("else if(typeof d%s===\"object\")", prop) + ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof d%s===\"string\")", prop) + ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) + ("else if(d%s.length)", prop) + ("m%s=d%s", prop, prop); + break; + case "string": gen + ("m%s=String(d%s)", prop, prop); + break; + case "bool": gen + ("m%s=Boolean(d%s)", prop, prop); + break; + /* default: gen + ("m%s=d%s", prop, prop); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("var c2 = r.uint32()+r.pos"); + + if (types.defaults[field.keyType] !== undefined) gen + ("k=%j", types.defaults[field.keyType]); + else gen + ("k=null"); + + if (types.defaults[type] !== undefined) gen + ("value=%j", types.defaults[type]); + else gen + ("value=null"); + + gen + ("while(r.pos>>3){") + ("case 1: k=r.%s(); break", field.keyType) + ("case 2:"); + + if (types.basic[type] === undefined) gen + ("value=types[%i].decode(r,r.uint32())", i); // can't be groups + else gen + ("value=r.%s()", type); + + gen + ("break") + ("default:") + ("r.skipType(tag2&7)") + ("break") + ("}") + ("}"); + + if (types.long[field.keyType] !== undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); + else gen + ("%s[k]=value", ref); + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) + : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { gen + ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null + + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", ref) + ("w.%s(%s[i])", type, ref) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", ref); + if (wireType === undefined) + genTypePartial(gen, field, index, ref + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +},{"15":15,"36":36,"37":37}],15:[function(require,module,exports){ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require(23), + util = require(37); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +},{"23":23,"24":24,"37":37}],16:[function(require,module,exports){ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require(15), + types = require(36), + util = require(37); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; + +},{"15":15,"24":24,"36":36,"37":37}],17:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(18); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require(14); +protobuf.decoder = require(13); +protobuf.verifier = require(40); +protobuf.converter = require(12); + +// Reflection +protobuf.ReflectionObject = require(24); +protobuf.Namespace = require(23); +protobuf.Root = require(29); +protobuf.Enum = require(15); +protobuf.Type = require(35); +protobuf.Field = require(16); +protobuf.OneOf = require(25); +protobuf.MapField = require(20); +protobuf.Service = require(33); +protobuf.Method = require(22); + +// Runtime +protobuf.Message = require(21); +protobuf.wrappers = require(41); + +// Utility +protobuf.types = require(36); +protobuf.util = require(37); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); + +},{"12":12,"13":13,"14":14,"15":15,"16":16,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"29":29,"33":33,"35":35,"36":36,"37":37,"40":40,"41":41}],18:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(42); +protobuf.BufferWriter = require(43); +protobuf.Reader = require(27); +protobuf.BufferReader = require(28); + +// Utility +protobuf.util = require(39); +protobuf.rpc = require(31); +protobuf.roots = require(30); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); +} + +// Set up buffer utility according to the environment +configure(); + +},{"27":27,"28":28,"30":30,"31":31,"39":39,"42":42,"43":43}],19:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(17); + +protobuf.build = "full"; + +// Parser +protobuf.tokenize = require(34); +protobuf.parse = require(26); +protobuf.common = require(11); + +// Configure parser +protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); + +},{"11":11,"17":17,"26":26,"34":34}],20:[function(require,module,exports){ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require(16); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require(36), + util = require(37); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; + +},{"16":16,"36":36,"37":37}],21:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +var util = require(39); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ +},{"39":39}],22:[function(require,module,exports){ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require(37); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; + +},{"24":24,"37":37}],23:[function(require,module,exports){ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require(16), + util = require(37); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; + +},{"16":16,"24":24,"37":37}],24:[function(require,module,exports){ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require(37); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Parsed Options. + * @type {Array.>|undefined} + */ + this.parsedOptions = null; + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets a parsed option. + * @param {string} name parsed Option name + * @param {*} value Option value + * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { + if (!this.parsedOptions) { + this.parsedOptions = []; + } + var parsedOptions = this.parsedOptions; + if (propName) { + // If setting a sub property of an option then try to merge it + // with an existing option + var opt = parsedOptions.find(function (opt) { + return Object.prototype.hasOwnProperty.call(opt, name); + }); + if (opt) { + // If we found an existing option - just merge the property value + var newValue = opt[name]; + util.setProperty(newValue, propName, value); + } else { + // otherwise, create a new option, set it's property and add it to the list + opt = {}; + opt[name] = util.setProperty({}, propName, value); + parsedOptions.push(opt); + } + } else { + // Always create a new option when setting the value of the option itself + var newOpt = {}; + newOpt[name] = value; + parsedOptions.push(newOpt); + } + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; + +},{"37":37}],25:[function(require,module,exports){ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require(24); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require(16), + util = require(37); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; + +},{"16":16,"24":24,"37":37}],26:[function(require,module,exports){ +"use strict"; +module.exports = parse; + +parse.filename = null; +parse.defaults = { keepCase: false }; + +var tokenize = require(34), + Root = require(29), + Type = require(35), + Field = require(16), + MapField = require(20), + OneOf = require(25), + Enum = require(15), + Service = require(33), + Method = require(22), + types = require(36), + util = require(37); + +var base10Re = /^[1-9][0-9]*$/, + base10NegRe = /^-?[1-9][0-9]*$/, + base16Re = /^0[x][0-9a-fA-F]+$/, + base16NegRe = /^-?0[x][0-9a-fA-F]+$/, + base8Re = /^0[0-7]+$/, + base8NegRe = /^-?0[0-7]+$/, + numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, + nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, + typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; + +/** + * Result object returned from {@link parse}. + * @interface IParserResult + * @property {string|undefined} package Package name, if declared + * @property {string[]|undefined} imports Imports, if any + * @property {string[]|undefined} weakImports Weak imports, if any + * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) + * @property {Root} root Populated root instance + */ + +/** + * Options modifying the behavior of {@link parse}. + * @interface IParseOptions + * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case + * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. + * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist. + */ + +/** + * Options modifying the behavior of JSON serialization. + * @interface IToJSONOptions + * @property {boolean} [keepComments=false] Serializes comments. + */ + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param {string} source Source contents + * @param {Root} root Root to populate + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + */ +function parse(source, root, options) { + /* eslint-disable callback-return */ + if (!(root instanceof Root)) { + options = root; + root = new Root(); + } + if (!options) + options = parse.defaults; + + var preferTrailingComment = options.preferTrailingComment || false; + var tn = tokenize(source, options.alternateCommentMode || false), + next = tn.next, + push = tn.push, + peek = tn.peek, + skip = tn.skip, + cmnt = tn.cmnt; + + var head = true, + pkg, + imports, + weakImports, + syntax, + isProto3 = false; + + var ptr = root; + + var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; + + /* istanbul ignore next */ + function illegal(token, name, insideTryCatch) { + var filename = parse.filename; + if (!insideTryCatch) + parse.filename = null; + return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); + } + + function readString() { + var values = [], + token; + do { + /* istanbul ignore if */ + if ((token = next()) !== "\"" && token !== "'") + throw illegal(token); + + values.push(next()); + skip(token); + token = peek(); + } while (token === "\"" || token === "'"); + return values.join(""); + } + + function readValue(acceptTypeRef) { + var token = next(); + switch (token) { + case "'": + case "\"": + push(token); + return readString(); + case "true": case "TRUE": + return true; + case "false": case "FALSE": + return false; + } + try { + return parseNumber(token, /* insideTryCatch */ true); + } catch (e) { + + /* istanbul ignore else */ + if (acceptTypeRef && typeRefRe.test(token)) + return token; + + /* istanbul ignore next */ + throw illegal(token, "value"); + } + } + + function readRanges(target, acceptStrings) { + var token, start; + do { + if (acceptStrings && ((token = peek()) === "\"" || token === "'")) + target.push(readString()); + else + target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); + } while (skip(",", true)); + skip(";"); + } + + function parseNumber(token, insideTryCatch) { + var sign = 1; + if (token.charAt(0) === "-") { + sign = -1; + token = token.substring(1); + } + switch (token) { + case "inf": case "INF": case "Inf": + return sign * Infinity; + case "nan": case "NAN": case "Nan": case "NaN": + return NaN; + case "0": + return 0; + } + if (base10Re.test(token)) + return sign * parseInt(token, 10); + if (base16Re.test(token)) + return sign * parseInt(token, 16); + if (base8Re.test(token)) + return sign * parseInt(token, 8); + + /* istanbul ignore else */ + if (numberRe.test(token)) + return sign * parseFloat(token); + + /* istanbul ignore next */ + throw illegal(token, "number", insideTryCatch); + } + + function parseId(token, acceptNegative) { + switch (token) { + case "max": case "MAX": case "Max": + return 536870911; + case "0": + return 0; + } + + /* istanbul ignore if */ + if (!acceptNegative && token.charAt(0) === "-") + throw illegal(token, "id"); + + if (base10NegRe.test(token)) + return parseInt(token, 10); + if (base16NegRe.test(token)) + return parseInt(token, 16); + + /* istanbul ignore else */ + if (base8NegRe.test(token)) + return parseInt(token, 8); + + /* istanbul ignore next */ + throw illegal(token, "id"); + } + + function parsePackage() { + + /* istanbul ignore if */ + if (pkg !== undefined) + throw illegal("package"); + + pkg = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(pkg)) + throw illegal(pkg, "name"); + + ptr = ptr.define(pkg); + skip(";"); + } + + function parseImport() { + var token = peek(); + var whichImports; + switch (token) { + case "weak": + whichImports = weakImports || (weakImports = []); + next(); + break; + case "public": + next(); + // eslint-disable-line no-fallthrough + default: + whichImports = imports || (imports = []); + break; + } + token = readString(); + skip(";"); + whichImports.push(token); + } + + function parseSyntax() { + skip("="); + syntax = readString(); + isProto3 = syntax === "proto3"; + + /* istanbul ignore if */ + if (!isProto3 && syntax !== "proto2") + throw illegal(syntax, "syntax"); + + skip(";"); + } + + function parseCommon(parent, token) { + switch (token) { + + case "option": + parseOption(parent, token); + skip(";"); + return true; + + case "message": + parseType(parent, token); + return true; + + case "enum": + parseEnum(parent, token); + return true; + + case "service": + parseService(parent, token); + return true; + + case "extend": + parseExtension(parent, token); + return true; + } + return false; + } + + function ifBlock(obj, fnIf, fnElse) { + var trailingLine = tn.line; + if (obj) { + if(typeof obj.comment !== "string") { + obj.comment = cmnt(); // try block-type comment + } + obj.filename = parse.filename; + } + if (skip("{", true)) { + var token; + while ((token = next()) !== "}") + fnIf(token); + skip(";", true); + } else { + if (fnElse) + fnElse(); + skip(";"); + if (obj && (typeof obj.comment !== "string" || preferTrailingComment)) + obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment + } + } + + function parseType(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "type name"); + + var type = new Type(token); + ifBlock(type, function parseType_block(token) { + if (parseCommon(type, token)) + return; + + switch (token) { + + case "map": + parseMapField(type, token); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + case "oneof": + parseOneOf(type, token); + break; + + case "extensions": + readRanges(type.extensions || (type.extensions = [])); + break; + + case "reserved": + readRanges(type.reserved || (type.reserved = []), true); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + + push(token); + parseField(type, "optional"); + break; + } + }); + parent.add(type); + } + + function parseField(parent, rule, extend) { + var type = next(); + if (type === "group") { + parseGroup(parent, rule); + return; + } + + /* istanbul ignore if */ + if (!typeRefRe.test(type)) + throw illegal(type, "type"); + + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + name = applyCase(name); + skip("="); + + var field = new Field(name, parseId(next()), type, rule, extend); + ifBlock(field, function parseField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseField_line() { + parseInlineOptions(field); + }); + parent.add(field); + + // JSON defaults to packed=true if not set so we have to set packed=false explicity when + // parsing proto2 descriptors without the option, where applicable. This must be done for + // all known packable types and anything that could be an enum (= is not a basic type). + if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) + field.setOption("packed", false, /* ifNotSet */ true); + } + + function parseGroup(parent, rule) { + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + var fieldName = util.lcFirst(name); + if (name === fieldName) + name = util.ucFirst(name); + skip("="); + var id = parseId(next()); + var type = new Type(name); + type.group = true; + var field = new Field(fieldName, id, name, rule); + field.filename = parse.filename; + ifBlock(type, function parseGroup_block(token) { + switch (token) { + + case "option": + parseOption(type, token); + skip(";"); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + /* istanbul ignore next */ + default: + throw illegal(token); // there are no groups with proto3 semantics + } + }); + parent.add(type) + .add(field); + } + + function parseMapField(parent) { + skip("<"); + var keyType = next(); + + /* istanbul ignore if */ + if (types.mapKey[keyType] === undefined) + throw illegal(keyType, "type"); + + skip(","); + var valueType = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(valueType)) + throw illegal(valueType, "type"); + + skip(">"); + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + skip("="); + var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); + ifBlock(field, function parseMapField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseMapField_line() { + parseInlineOptions(field); + }); + parent.add(field); + } + + function parseOneOf(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var oneof = new OneOf(applyCase(token)); + ifBlock(oneof, function parseOneOf_block(token) { + if (token === "option") { + parseOption(oneof, token); + skip(";"); + } else { + push(token); + parseField(oneof, "optional"); + } + }); + parent.add(oneof); + } + + function parseEnum(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var enm = new Enum(token); + ifBlock(enm, function parseEnum_block(token) { + switch(token) { + case "option": + parseOption(enm, token); + skip(";"); + break; + + case "reserved": + readRanges(enm.reserved || (enm.reserved = []), true); + break; + + default: + parseEnumValue(enm, token); + } + }); + parent.add(enm); + } + + function parseEnumValue(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token)) + throw illegal(token, "name"); + + skip("="); + var value = parseId(next(), true), + dummy = {}; + ifBlock(dummy, function parseEnumValue_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(dummy, token); // skip + skip(";"); + } else + throw illegal(token); + + }, function parseEnumValue_line() { + parseInlineOptions(dummy); // skip + }); + parent.add(token, value, dummy.comment); + } + + function parseOption(parent, token) { + var isCustom = skip("(", true); + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "name"); + + var name = token; + var option = name; + var propName; + + if (isCustom) { + skip(")"); + name = "(" + name + ")"; + option = name; + token = peek(); + if (fqTypeRefRe.test(token)) { + propName = token.substr(1); //remove '.' before property name + name += token; + next(); + } + } + skip("="); + var optionValue = parseOptionValue(parent, name); + setParsedOption(parent, option, optionValue, propName); + } + + function parseOptionValue(parent, name) { + if (skip("{", true)) { // { a: "foo" b { c: "bar" } } + var result = {}; + while (!skip("}", true)) { + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var value; + var propName = token; + if (peek() === "{") + value = parseOptionValue(parent, name + "." + token); + else { + skip(":"); + if (peek() === "{") + value = parseOptionValue(parent, name + "." + token); + else { + value = readValue(true); + setOption(parent, name + "." + token, value); + } + } + var prevValue = result[propName]; + if (prevValue) + value = [].concat(prevValue).concat(value); + result[propName] = value; + skip(",", true); + } + return result; + } + + var simpleValue = readValue(true); + setOption(parent, name, simpleValue); + return simpleValue; + // Does not enforce a delimiter to be universal + } + + function setOption(parent, name, value) { + if (parent.setOption) + parent.setOption(name, value); + } + + function setParsedOption(parent, name, value, propName) { + if (parent.setParsedOption) + parent.setParsedOption(name, value, propName); + } + + function parseInlineOptions(parent) { + if (skip("[", true)) { + do { + parseOption(parent, "option"); + } while (skip(",", true)); + skip("]"); + } + return parent; + } + + function parseService(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "service name"); + + var service = new Service(token); + ifBlock(service, function parseService_block(token) { + if (parseCommon(service, token)) + return; + + /* istanbul ignore else */ + if (token === "rpc") + parseMethod(service, token); + else + throw illegal(token); + }); + parent.add(service); + } + + function parseMethod(parent, token) { + // Get the comment of the preceding line now (if one exists) in case the + // method is defined across multiple lines. + var commentText = cmnt(); + + var type = token; + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var name = token, + requestType, requestStream, + responseType, responseStream; + + skip("("); + if (skip("stream", true)) + requestStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + requestType = token; + skip(")"); skip("returns"); skip("("); + if (skip("stream", true)) + responseStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + responseType = token; + skip(")"); + + var method = new Method(name, type, requestType, responseType, requestStream, responseStream); + method.comment = commentText; + ifBlock(method, function parseMethod_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(method, token); + skip(";"); + } else + throw illegal(token); + + }); + parent.add(method); + } + + function parseExtension(parent, token) { + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "reference"); + + var reference = token; + ifBlock(null, function parseExtension_block(token) { + switch (token) { + + case "required": + case "repeated": + case "optional": + parseField(parent, token, reference); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + push(token); + parseField(parent, "optional", reference); + break; + } + }); + } + + var token; + while ((token = next()) !== null) { + switch (token) { + + case "package": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parsePackage(); + break; + + case "import": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseImport(); + break; + + case "syntax": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseSyntax(); + break; + + case "option": + + parseOption(ptr, token); + skip(";"); + break; + + default: + + /* istanbul ignore else */ + if (parseCommon(ptr, token)) { + head = false; + continue; + } + + /* istanbul ignore next */ + throw illegal(token); + } + } + + parse.filename = null; + return { + "package" : pkg, + "imports" : imports, + weakImports : weakImports, + syntax : syntax, + root : root + }; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @name parse + * @function + * @param {string} source Source contents + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + * @variation 2 + */ + +},{"15":15,"16":16,"20":20,"22":22,"25":25,"29":29,"33":33,"34":34,"35":35,"36":36,"37":37}],27:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(39); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +var create = function create() { + return util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; +}; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = create(); + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"39":39}],28:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(27); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(39); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +BufferReader._configure = function () { + /* istanbul ignore else */ + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; +}; + + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice + ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) + : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +BufferReader._configure(); + +},{"27":27,"39":39}],29:[function(require,module,exports){ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require(23); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require(16), + Enum = require(15), + OneOf = require(25), + util = require(37); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +/** + * Fetch content from file path or url + * This method exists so you can override it with your own logic. + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.fetch = util.fetch; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Bundled definition existence checking + function getBundledFileName(filename) { + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) return altname; + } + return null; + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + self.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; + +},{"15":15,"16":16,"23":23,"25":25,"37":37}],30:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],31:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(32); + +},{"32":32}],32:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(39); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"39":39}],33:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require(23); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require(22), + util = require(37), + rpc = require(31); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; + +},{"22":22,"23":23,"31":31,"37":37}],34:[function(require,module,exports){ +"use strict"; +module.exports = tokenize; + +var delimRe = /[\s{}=;:[\],'"()<>]/g, + stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; + +var setCommentRe = /^ *[*/]+ */, + setCommentAltRe = /^\s*\*?\/*/, + setCommentSplitRe = /\n/g, + whitespaceRe = /\s/, + unescapeRe = /\\(.?)/g; + +var unescapeMap = { + "0": "\0", + "r": "\r", + "n": "\n", + "t": "\t" +}; + +/** + * Unescapes a string. + * @param {string} str String to unescape + * @returns {string} Unescaped string + * @property {Object.} map Special characters map + * @memberof tokenize + */ +function unescape(str) { + return str.replace(unescapeRe, function($0, $1) { + switch ($1) { + case "\\": + case "": + return $1; + default: + return unescapeMap[$1] || ""; + } + }); +} + +tokenize.unescape = unescape; + +/** + * Gets the next token and advances. + * @typedef TokenizerHandleNext + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Peeks for the next token. + * @typedef TokenizerHandlePeek + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Pushes a token back to the stack. + * @typedef TokenizerHandlePush + * @type {function} + * @param {string} token Token + * @returns {undefined} + */ + +/** + * Skips the next token. + * @typedef TokenizerHandleSkip + * @type {function} + * @param {string} expected Expected token + * @param {boolean} [optional=false] If optional + * @returns {boolean} Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @typedef TokenizerHandleCmnt + * @type {function} + * @param {number} [line] Line number + * @returns {string|null} Comment text or `null` if none + */ + +/** + * Handle object returned from {@link tokenize}. + * @interface ITokenizerHandle + * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) + * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) + * @property {TokenizerHandlePush} push Pushes a token back to the stack + * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws + * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any + * @property {number} line Current line number + */ + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param {string} source Source contents + * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns {ITokenizerHandle} Tokenizer handle + */ +function tokenize(source, alternateCommentMode) { + /* eslint-disable callback-return */ + source = source.toString(); + + var offset = 0, + length = source.length, + line = 1, + commentType = null, + commentText = null, + commentLine = 0, + commentLineEmpty = false, + commentIsLeading = false; + + var stack = []; + + var stringDelim = null; + + /* istanbul ignore next */ + /** + * Creates an error for illegal syntax. + * @param {string} subject Subject + * @returns {Error} Error created + * @inner + */ + function illegal(subject) { + return Error("illegal " + subject + " (line " + line + ")"); + } + + /** + * Reads a string till its end. + * @returns {string} String read + * @inner + */ + function readString() { + var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; + re.lastIndex = offset - 1; + var match = re.exec(source); + if (!match) + throw illegal("string"); + offset = re.lastIndex; + push(stringDelim); + stringDelim = null; + return unescape(match[1]); + } + + /** + * Gets the character at `pos` within the source. + * @param {number} pos Position + * @returns {string} Character + * @inner + */ + function charAt(pos) { + return source.charAt(pos); + } + + /** + * Sets the current comment text. + * @param {number} start Start offset + * @param {number} end End offset + * @param {boolean} isLeading set if a leading comment + * @returns {undefined} + * @inner + */ + function setComment(start, end, isLeading) { + commentType = source.charAt(start++); + commentLine = line; + commentLineEmpty = false; + commentIsLeading = isLeading; + var lookback; + if (alternateCommentMode) { + lookback = 2; // alternate comment parsing: "//" or "/*" + } else { + lookback = 3; // "///" or "/**" + } + var commentOffset = start - lookback, + c; + do { + if (--commentOffset < 0 || + (c = source.charAt(commentOffset)) === "\n") { + commentLineEmpty = true; + break; + } + } while (c === " " || c === "\t"); + var lines = source + .substring(start, end) + .split(setCommentSplitRe); + for (var i = 0; i < lines.length; ++i) + lines[i] = lines[i] + .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") + .trim(); + commentText = lines + .join("\n") + .trim(); + } + + function isDoubleSlashCommentLine(startOffset) { + var endOffset = findEndOfLine(startOffset); + + // see if remaining line matches comment pattern + var lineText = source.substring(startOffset, endOffset); + // look for 1 or 2 slashes since startOffset would already point past + // the first slash that started the comment. + var isComment = /^\s*\/{1,2}/.test(lineText); + return isComment; + } + + function findEndOfLine(cursor) { + // find end of cursor's line + var endOffset = cursor; + while (endOffset < length && charAt(endOffset) !== "\n") { + endOffset++; + } + return endOffset; + } + + /** + * Obtains the next token. + * @returns {string|null} Next token or `null` on eof + * @inner + */ + function next() { + if (stack.length > 0) + return stack.shift(); + if (stringDelim) + return readString(); + var repeat, + prev, + curr, + start, + isDoc, + isLeadingComment = offset === 0; + do { + if (offset === length) + return null; + repeat = false; + while (whitespaceRe.test(curr = charAt(offset))) { + if (curr === "\n") { + isLeadingComment = true; + ++line; + } + if (++offset === length) + return null; + } + + if (charAt(offset) === "/") { + if (++offset === length) { + throw illegal("comment"); + } + if (charAt(offset) === "/") { // Line + if (!alternateCommentMode) { + // check for triple-slash comment + isDoc = charAt(start = offset + 1) === "/"; + + while (charAt(++offset) !== "\n") { + if (offset === length) { + return null; + } + } + ++offset; + if (isDoc) { + setComment(start, offset - 1, isLeadingComment); + } + ++line; + repeat = true; + } else { + // check for double-slash comments, consolidating consecutive lines + start = offset; + isDoc = false; + if (isDoubleSlashCommentLine(offset)) { + isDoc = true; + do { + offset = findEndOfLine(offset); + if (offset === length) { + break; + } + offset++; + } while (isDoubleSlashCommentLine(offset)); + } else { + offset = Math.min(length, findEndOfLine(offset) + 1); + } + if (isDoc) { + setComment(start, offset, isLeadingComment); + } + line++; + repeat = true; + } + } else if ((curr = charAt(offset)) === "*") { /* Block */ + // check for /** (regular comment mode) or /* (alternate comment mode) + start = offset + 1; + isDoc = alternateCommentMode || charAt(start) === "*"; + do { + if (curr === "\n") { + ++line; + } + if (++offset === length) { + throw illegal("comment"); + } + prev = curr; + curr = charAt(offset); + } while (prev !== "*" || curr !== "/"); + ++offset; + if (isDoc) { + setComment(start, offset - 2, isLeadingComment); + } + repeat = true; + } else { + return "/"; + } + } + } while (repeat); + + // offset !== length if we got here + + var end = offset; + delimRe.lastIndex = 0; + var delim = delimRe.test(charAt(end++)); + if (!delim) + while (end < length && !delimRe.test(charAt(end))) + ++end; + var token = source.substring(offset, offset = end); + if (token === "\"" || token === "'") + stringDelim = token; + return token; + } + + /** + * Pushes a token back to the stack. + * @param {string} token Token + * @returns {undefined} + * @inner + */ + function push(token) { + stack.push(token); + } + + /** + * Peeks for the next token. + * @returns {string|null} Token or `null` on eof + * @inner + */ + function peek() { + if (!stack.length) { + var token = next(); + if (token === null) + return null; + push(token); + } + return stack[0]; + } + + /** + * Skips a token. + * @param {string} expected Expected token + * @param {boolean} [optional=false] Whether the token is optional + * @returns {boolean} `true` when skipped, `false` if not + * @throws {Error} When a required token is not present + * @inner + */ + function skip(expected, optional) { + var actual = peek(), + equals = actual === expected; + if (equals) { + next(); + return true; + } + if (!optional) + throw illegal("token '" + actual + "', '" + expected + "' expected"); + return false; + } + + /** + * Gets a comment. + * @param {number} [trailingLine] Line number if looking for a trailing comment + * @returns {string|null} Comment text + * @inner + */ + function cmnt(trailingLine) { + var ret = null; + if (trailingLine === undefined) { + if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) { + ret = commentIsLeading ? commentText : null; + } + } else { + /* istanbul ignore else */ + if (commentLine < trailingLine) { + peek(); + } + if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) { + ret = commentIsLeading ? null : commentText; + } + } + return ret; + } + + return Object.defineProperty({ + next: next, + peek: peek, + push: push, + skip: skip, + cmnt: cmnt + }, "line", { + get: function() { return line; } + }); + /* eslint-enable callback-return */ +} + +},{}],35:[function(require,module,exports){ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require(23); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require(15), + OneOf = require(25), + Field = require(16), + MapField = require(20), + Service = require(33), + Message = require(21), + Reader = require(27), + Writer = require(42), + util = require(37), + encoder = require(14), + decoder = require(13), + verifier = require(40), + converter = require(12), + wrappers = require(41); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; + +},{"12":12,"13":13,"14":14,"15":15,"16":16,"20":20,"21":21,"23":23,"25":25,"27":27,"33":33,"37":37,"40":40,"41":41,"42":42}],36:[function(require,module,exports){ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require(37); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); + +},{"37":37}],37:[function(require,module,exports){ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require(39); + +var roots = require(30); + +var Type, // cyclic + Enum; + +util.codegen = require(3); +util.fetch = require(5); +util.path = require(8); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require(35); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require(15); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + + +/** + * Sets the value of a property by property path. If a value already exists, it is turned to an array + * @param {Object.} dst Destination object + * @param {string} path dot '.' delimited path of the property to set + * @param {Object} value the value to set + * @returns {Object.} Destination object + */ +util.setProperty = function setProperty(dst, path, value) { + function setProp(dst, path, value) { + var part = path.shift(); + if (path.length > 0) { + dst[part] = setProp(dst[part] || {}, path, value); + } else { + var prevValue = dst[part]; + if (prevValue) + value = [].concat(prevValue).concat(value); + dst[part] = value; + } + return dst; + } + + if (typeof dst !== "object") + throw TypeError("dst must be an object"); + if (!path) + throw TypeError("path must be specified"); + + path = path.split("."); + return setProp(dst, path, value); +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require(29))()); + } +}); + +},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"5":5,"8":8}],38:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(39); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"39":39}],39:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(4); + +// float handling accross browsers +util.float = require(6); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(7); + +// converts to / from utf8 encoded strings +util.utf8 = require(10); + +// provides a node-like buffer pool in the browser +util.pool = require(9); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(38); + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + */ +util.isNode = Boolean(typeof global !== "undefined" + && global + && global.process + && global.process.versions + && global.process.versions.node); + +/** + * Global object reference. + * @memberof util + * @type {Object} + */ +util.global = util.isNode && global + || typeof window !== "undefined" && window + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){ +"use strict"; +module.exports = verifier; + +var Enum = require(15), + util = require(37); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require(21); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + // Only use fully qualified type name after the last '/' + var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + if (type_url.indexOf("/") === -1) { + type_url = "/" + type_url; + } + return this.create({ + type_url: type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // Default prefix + var googleApi = "type.googleapis.com/"; + var prefix = ""; + var name = ""; + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + // Separate the prefix used + prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + var messageName = message.$type.fullName[0] === "." ? + message.$type.fullName.substr(1) : message.$type.fullName; + // Default to type.googleapis.com prefix if no prefix is used + if (prefix === "") { + prefix = googleApi; + } + name = prefix + messageName; + object["@type"] = name; + return object; + } + + return this.toObject(message, options); + } +}; + +},{"21":21}],42:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(39); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +var create = function create() { + return util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; +}; + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = create(); + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); +}; + +},{"39":39}],43:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(42); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(39); + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +BufferWriter._configure = function () { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter.alloc = util._Buffer_allocUnsafe; + + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; +}; + + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +BufferWriter._configure(); + +},{"39":39,"42":42}]},{},[19]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/legacy-libs/protobufjs/dist/protobuf.js.map b/legacy-libs/protobufjs/dist/protobuf.js.map new file mode 100644 index 0000000..b85d9aa --- /dev/null +++ b/legacy-libs/protobufjs/dist/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/common.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light.js","../src/index-minimal.js","../src/index","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/parse.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/tokenize.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n if (!commonRe.test(name)) {\n name = \"google/protobuf/\" + name + \".proto\";\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n }\n common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n /**\n * Properties of a google.protobuf.Any message.\n * @interface IAny\n * @type {Object}\n * @property {string} [typeUrl]\n * @property {Uint8Array} [bytes]\n * @memberof common\n */\n Any: {\n fields: {\n type_url: {\n type: \"string\",\n id: 1\n },\n value: {\n type: \"bytes\",\n id: 2\n }\n }\n }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n /**\n * Properties of a google.protobuf.Duration message.\n * @interface IDuration\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Duration: timeType = {\n fields: {\n seconds: {\n type: \"int64\",\n id: 1\n },\n nanos: {\n type: \"int32\",\n id: 2\n }\n }\n }\n});\n\ncommon(\"timestamp\", {\n\n /**\n * Properties of a google.protobuf.Timestamp message.\n * @interface ITimestamp\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n /**\n * Properties of a google.protobuf.Empty message.\n * @interface IEmpty\n * @memberof common\n */\n Empty: {\n fields: {}\n }\n});\n\ncommon(\"struct\", {\n\n /**\n * Properties of a google.protobuf.Struct message.\n * @interface IStruct\n * @type {Object}\n * @property {Object.} [fields]\n * @memberof common\n */\n Struct: {\n fields: {\n fields: {\n keyType: \"string\",\n type: \"Value\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Value message.\n * @interface IValue\n * @type {Object}\n * @property {string} [kind]\n * @property {0} [nullValue]\n * @property {number} [numberValue]\n * @property {string} [stringValue]\n * @property {boolean} [boolValue]\n * @property {IStruct} [structValue]\n * @property {IListValue} [listValue]\n * @memberof common\n */\n Value: {\n oneofs: {\n kind: {\n oneof: [\n \"nullValue\",\n \"numberValue\",\n \"stringValue\",\n \"boolValue\",\n \"structValue\",\n \"listValue\"\n ]\n }\n },\n fields: {\n nullValue: {\n type: \"NullValue\",\n id: 1\n },\n numberValue: {\n type: \"double\",\n id: 2\n },\n stringValue: {\n type: \"string\",\n id: 3\n },\n boolValue: {\n type: \"bool\",\n id: 4\n },\n structValue: {\n type: \"Struct\",\n id: 5\n },\n listValue: {\n type: \"ListValue\",\n id: 6\n }\n }\n },\n\n NullValue: {\n values: {\n NULL_VALUE: 0\n }\n },\n\n /**\n * Properties of a google.protobuf.ListValue message.\n * @interface IListValue\n * @type {Object}\n * @property {Array.} [values]\n * @memberof common\n */\n ListValue: {\n fields: {\n values: {\n rule: \"repeated\",\n type: \"Value\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"wrappers\", {\n\n /**\n * Properties of a google.protobuf.DoubleValue message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n DoubleValue: {\n fields: {\n value: {\n type: \"double\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.FloatValue message.\n * @interface IFloatValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FloatValue: {\n fields: {\n value: {\n type: \"float\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int64Value message.\n * @interface IInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n Int64Value: {\n fields: {\n value: {\n type: \"int64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt64Value message.\n * @interface IUInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n UInt64Value: {\n fields: {\n value: {\n type: \"uint64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int32Value message.\n * @interface IInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int32Value: {\n fields: {\n value: {\n type: \"int32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt32Value message.\n * @interface IUInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt32Value: {\n fields: {\n value: {\n type: \"uint32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BoolValue message.\n * @interface IBoolValue\n * @type {Object}\n * @property {boolean} [value]\n * @memberof common\n */\n BoolValue: {\n fields: {\n value: {\n type: \"bool\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.StringValue message.\n * @interface IStringValue\n * @type {Object}\n * @property {string} [value]\n * @memberof common\n */\n StringValue: {\n fields: {\n value: {\n type: \"string\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BytesValue message.\n * @interface IBytesValue\n * @type {Object}\n * @property {Uint8Array} [value]\n * @memberof common\n */\n BytesValue: {\n fields: {\n value: {\n type: \"bytes\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"field_mask\", {\n\n /**\n * Properties of a google.protobuf.FieldMask message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FieldMask: {\n fields: {\n paths: {\n rule: \"repeated\",\n type: \"string\",\n id: 1\n }\n }\n }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n return common[file] || null;\n};\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(15),\n util = require(37);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(d%s){\", prop);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=d%s>>>0\", prop, prop);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=d%s|0\", prop, prop);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\n (\"m%s=parseInt(d%s,10)\", prop, prop)\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\n (\"m%s=d%s\", prop, prop)\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof d%s===\\\"string\\\")\", prop)\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n (\"else if(d%s.length)\", prop)\n (\"m%s=d%s\", prop, prop);\n break;\n case \"string\": gen\n (\"m%s=String(d%s)\", prop, prop);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(d%s)\", prop, prop);\n break;\n /* default: gen\n (\"m%s=d%s\", prop, prop);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"var c2 = r.uint32()+r.pos\");\n\n if (types.defaults[field.keyType] !== undefined) gen\n (\"k=%j\", types.defaults[field.keyType]);\n else gen\n (\"k=null\");\n\n if (types.defaults[type] !== undefined) gen\n (\"value=%j\", types.defaults[type]);\n else gen\n (\"value=null\");\n\n gen\n (\"while(r.pos>>3){\")\n (\"case 1: k=r.%s(); break\", field.keyType)\n (\"case 2:\");\n\n if (types.basic[type] === undefined) gen\n (\"value=types[%i].decode(r,r.uint32())\", i); // can't be groups\n else gen\n (\"value=r.%s()\", type);\n\n gen\n (\"break\")\n (\"default:\")\n (\"r.skipType(tag2&7)\")\n (\"break\")\n (\"}\")\n (\"}\");\n\n if (types.long[field.keyType] !== undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=value\", ref);\n else gen\n (\"%s[k]=value\", ref);\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) { gen\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\n\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", ref)\n (\"w.%s(%s[i])\", type, ref)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", ref);\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(23),\n util = require(37);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(15),\n types = require(36),\n util = require(37);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(18);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(14);\nprotobuf.decoder = require(13);\nprotobuf.verifier = require(40);\nprotobuf.converter = require(12);\n\n// Reflection\nprotobuf.ReflectionObject = require(24);\nprotobuf.Namespace = require(23);\nprotobuf.Root = require(29);\nprotobuf.Enum = require(15);\nprotobuf.Type = require(35);\nprotobuf.Field = require(16);\nprotobuf.OneOf = require(25);\nprotobuf.MapField = require(20);\nprotobuf.Service = require(33);\nprotobuf.Method = require(22);\n\n// Runtime\nprotobuf.Message = require(21);\nprotobuf.wrappers = require(41);\n\n// Utility\nprotobuf.types = require(36);\nprotobuf.util = require(37);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(42);\nprotobuf.BufferWriter = require(43);\nprotobuf.Reader = require(27);\nprotobuf.BufferReader = require(28);\n\n// Utility\nprotobuf.util = require(39);\nprotobuf.rpc = require(31);\nprotobuf.roots = require(30);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"full\";\n\n// Parser\nprotobuf.tokenize = require(34);\nprotobuf.parse = require(26);\nprotobuf.common = require(11);\n\n// Configure parser\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(16);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(36),\n util = require(37);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(39);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(37);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(16),\n util = require(37);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(37);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Parsed Options.\n * @type {Array.>|undefined}\n */\n this.parsedOptions = null;\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets a parsed option.\n * @param {string} name parsed Option name\n * @param {*} value Option value\n * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {\n if (!this.parsedOptions) {\n this.parsedOptions = [];\n }\n var parsedOptions = this.parsedOptions;\n if (propName) {\n // If setting a sub property of an option then try to merge it\n // with an existing option\n var opt = parsedOptions.find(function (opt) {\n return Object.prototype.hasOwnProperty.call(opt, name);\n });\n if (opt) {\n // If we found an existing option - just merge the property value\n var newValue = opt[name];\n util.setProperty(newValue, propName, value);\n } else {\n // otherwise, create a new option, set it's property and add it to the list\n opt = {};\n opt[name] = util.setProperty({}, propName, value);\n parsedOptions.push(opt);\n }\n } else {\n // Always create a new option when setting the value of the option itself\n var newOpt = {};\n newOpt[name] = value;\n parsedOptions.push(newOpt);\n }\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(16),\n util = require(37);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = require(34),\n Root = require(29),\n Type = require(35),\n Field = require(16),\n MapField = require(20),\n OneOf = require(25),\n Enum = require(15),\n Service = require(33),\n Method = require(22),\n types = require(36),\n util = require(37);\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var preferTrailingComment = options.preferTrailingComment || false;\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n syntax,\n isProto3 = false;\n\n var ptr = root;\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\n target.push(readString());\n else\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } while (skip(\",\", true));\n skip(\";\");\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n syntax = readString();\n isProto3 = syntax === \"proto3\";\n\n /* istanbul ignore if */\n if (!isProto3 && syntax !== \"proto2\")\n throw illegal(syntax, \"syntax\");\n\n skip(\";\");\n }\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && (typeof obj.comment !== \"string\" || preferTrailingComment))\n obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\n // parsing proto2 descriptors without the option, where applicable. This must be done for\n // all known packable types and anything that could be an enum (= is not a basic type).\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\n field.setOption(\"packed\", false, /* ifNotSet */ true);\n }\n\n function parseGroup(parent, rule) {\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {};\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment);\n }\n\n function parseOption(parent, token) {\n var isCustom = skip(\"(\", true);\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token;\n var option = name;\n var propName;\n\n if (isCustom) {\n skip(\")\");\n name = \"(\" + name + \")\";\n option = name;\n token = peek();\n if (fqTypeRefRe.test(token)) {\n propName = token.substr(1); //remove '.' before property name\n name += token;\n next();\n }\n }\n skip(\"=\");\n var optionValue = parseOptionValue(parent, name);\n setParsedOption(parent, option, optionValue, propName);\n }\n\n function parseOptionValue(parent, name) {\n if (skip(\"{\", true)) { // { a: \"foo\" b { c: \"bar\" } }\n var result = {};\n while (!skip(\"}\", true)) {\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var value;\n var propName = token;\n if (peek() === \"{\")\n value = parseOptionValue(parent, name + \".\" + token);\n else {\n skip(\":\");\n if (peek() === \"{\")\n value = parseOptionValue(parent, name + \".\" + token);\n else {\n value = readValue(true);\n setOption(parent, name + \".\" + token, value);\n }\n }\n var prevValue = result[propName];\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n result[propName] = value;\n skip(\",\", true);\n }\n return result;\n }\n\n var simpleValue = readValue(true);\n setOption(parent, name, simpleValue);\n return simpleValue;\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function setParsedOption(parent, name, value, propName) {\n if (parent.setParsedOption)\n parent.setParsedOption(name, value, propName);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token))\n return;\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n case \"optional\":\n parseField(parent, token, reference);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"option\":\n\n parseOption(ptr, token);\n skip(\";\");\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n syntax : syntax,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(39);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(27);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(39);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(23);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(16),\n Enum = require(15),\n OneOf = require(25),\n util = require(37);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(32);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(39);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(23);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(22),\n util = require(37),\n rpc = require(31);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = tokenize;\n\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\n\nvar setCommentRe = /^ *[*/]+ */,\n setCommentAltRe = /^\\s*\\*?\\/*/,\n setCommentSplitRe = /\\n/g,\n whitespaceRe = /\\s/,\n unescapeRe = /\\\\(.?)/g;\n\nvar unescapeMap = {\n \"0\": \"\\0\",\n \"r\": \"\\r\",\n \"n\": \"\\n\",\n \"t\": \"\\t\"\n};\n\n/**\n * Unescapes a string.\n * @param {string} str String to unescape\n * @returns {string} Unescaped string\n * @property {Object.} map Special characters map\n * @memberof tokenize\n */\nfunction unescape(str) {\n return str.replace(unescapeRe, function($0, $1) {\n switch ($1) {\n case \"\\\\\":\n case \"\":\n return $1;\n default:\n return unescapeMap[$1] || \"\";\n }\n });\n}\n\ntokenize.unescape = unescape;\n\n/**\n * Gets the next token and advances.\n * @typedef TokenizerHandleNext\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Peeks for the next token.\n * @typedef TokenizerHandlePeek\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Pushes a token back to the stack.\n * @typedef TokenizerHandlePush\n * @type {function}\n * @param {string} token Token\n * @returns {undefined}\n */\n\n/**\n * Skips the next token.\n * @typedef TokenizerHandleSkip\n * @type {function}\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] If optional\n * @returns {boolean} Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @typedef TokenizerHandleCmnt\n * @type {function}\n * @param {number} [line] Line number\n * @returns {string|null} Comment text or `null` if none\n */\n\n/**\n * Handle object returned from {@link tokenize}.\n * @interface ITokenizerHandle\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\n * @property {number} line Current line number\n */\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param {string} source Source contents\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns {ITokenizerHandle} Tokenizer handle\n */\nfunction tokenize(source, alternateCommentMode) {\n /* eslint-disable callback-return */\n source = source.toString();\n\n var offset = 0,\n length = source.length,\n line = 1,\n commentType = null,\n commentText = null,\n commentLine = 0,\n commentLineEmpty = false,\n commentIsLeading = false;\n\n var stack = [];\n\n var stringDelim = null;\n\n /* istanbul ignore next */\n /**\n * Creates an error for illegal syntax.\n * @param {string} subject Subject\n * @returns {Error} Error created\n * @inner\n */\n function illegal(subject) {\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\n }\n\n /**\n * Reads a string till its end.\n * @returns {string} String read\n * @inner\n */\n function readString() {\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\n re.lastIndex = offset - 1;\n var match = re.exec(source);\n if (!match)\n throw illegal(\"string\");\n offset = re.lastIndex;\n push(stringDelim);\n stringDelim = null;\n return unescape(match[1]);\n }\n\n /**\n * Gets the character at `pos` within the source.\n * @param {number} pos Position\n * @returns {string} Character\n * @inner\n */\n function charAt(pos) {\n return source.charAt(pos);\n }\n\n /**\n * Sets the current comment text.\n * @param {number} start Start offset\n * @param {number} end End offset\n * @param {boolean} isLeading set if a leading comment\n * @returns {undefined}\n * @inner\n */\n function setComment(start, end, isLeading) {\n commentType = source.charAt(start++);\n commentLine = line;\n commentLineEmpty = false;\n commentIsLeading = isLeading;\n var lookback;\n if (alternateCommentMode) {\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\n } else {\n lookback = 3; // \"///\" or \"/**\"\n }\n var commentOffset = start - lookback,\n c;\n do {\n if (--commentOffset < 0 ||\n (c = source.charAt(commentOffset)) === \"\\n\") {\n commentLineEmpty = true;\n break;\n }\n } while (c === \" \" || c === \"\\t\");\n var lines = source\n .substring(start, end)\n .split(setCommentSplitRe);\n for (var i = 0; i < lines.length; ++i)\n lines[i] = lines[i]\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\n .trim();\n commentText = lines\n .join(\"\\n\")\n .trim();\n }\n\n function isDoubleSlashCommentLine(startOffset) {\n var endOffset = findEndOfLine(startOffset);\n\n // see if remaining line matches comment pattern\n var lineText = source.substring(startOffset, endOffset);\n // look for 1 or 2 slashes since startOffset would already point past\n // the first slash that started the comment.\n var isComment = /^\\s*\\/{1,2}/.test(lineText);\n return isComment;\n }\n\n function findEndOfLine(cursor) {\n // find end of cursor's line\n var endOffset = cursor;\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\n endOffset++;\n }\n return endOffset;\n }\n\n /**\n * Obtains the next token.\n * @returns {string|null} Next token or `null` on eof\n * @inner\n */\n function next() {\n if (stack.length > 0)\n return stack.shift();\n if (stringDelim)\n return readString();\n var repeat,\n prev,\n curr,\n start,\n isDoc,\n isLeadingComment = offset === 0;\n do {\n if (offset === length)\n return null;\n repeat = false;\n while (whitespaceRe.test(curr = charAt(offset))) {\n if (curr === \"\\n\") {\n isLeadingComment = true;\n ++line;\n }\n if (++offset === length)\n return null;\n }\n\n if (charAt(offset) === \"/\") {\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n if (charAt(offset) === \"/\") { // Line\n if (!alternateCommentMode) {\n // check for triple-slash comment\n isDoc = charAt(start = offset + 1) === \"/\";\n\n while (charAt(++offset) !== \"\\n\") {\n if (offset === length) {\n return null;\n }\n }\n ++offset;\n if (isDoc) {\n setComment(start, offset - 1, isLeadingComment);\n }\n ++line;\n repeat = true;\n } else {\n // check for double-slash comments, consolidating consecutive lines\n start = offset;\n isDoc = false;\n if (isDoubleSlashCommentLine(offset)) {\n isDoc = true;\n do {\n offset = findEndOfLine(offset);\n if (offset === length) {\n break;\n }\n offset++;\n } while (isDoubleSlashCommentLine(offset));\n } else {\n offset = Math.min(length, findEndOfLine(offset) + 1);\n }\n if (isDoc) {\n setComment(start, offset, isLeadingComment);\n }\n line++;\n repeat = true;\n }\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\n // check for /** (regular comment mode) or /* (alternate comment mode)\n start = offset + 1;\n isDoc = alternateCommentMode || charAt(start) === \"*\";\n do {\n if (curr === \"\\n\") {\n ++line;\n }\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n prev = curr;\n curr = charAt(offset);\n } while (prev !== \"*\" || curr !== \"/\");\n ++offset;\n if (isDoc) {\n setComment(start, offset - 2, isLeadingComment);\n }\n repeat = true;\n } else {\n return \"/\";\n }\n }\n } while (repeat);\n\n // offset !== length if we got here\n\n var end = offset;\n delimRe.lastIndex = 0;\n var delim = delimRe.test(charAt(end++));\n if (!delim)\n while (end < length && !delimRe.test(charAt(end)))\n ++end;\n var token = source.substring(offset, offset = end);\n if (token === \"\\\"\" || token === \"'\")\n stringDelim = token;\n return token;\n }\n\n /**\n * Pushes a token back to the stack.\n * @param {string} token Token\n * @returns {undefined}\n * @inner\n */\n function push(token) {\n stack.push(token);\n }\n\n /**\n * Peeks for the next token.\n * @returns {string|null} Token or `null` on eof\n * @inner\n */\n function peek() {\n if (!stack.length) {\n var token = next();\n if (token === null)\n return null;\n push(token);\n }\n return stack[0];\n }\n\n /**\n * Skips a token.\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] Whether the token is optional\n * @returns {boolean} `true` when skipped, `false` if not\n * @throws {Error} When a required token is not present\n * @inner\n */\n function skip(expected, optional) {\n var actual = peek(),\n equals = actual === expected;\n if (equals) {\n next();\n return true;\n }\n if (!optional)\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\n return false;\n }\n\n /**\n * Gets a comment.\n * @param {number} [trailingLine] Line number if looking for a trailing comment\n * @returns {string|null} Comment text\n * @inner\n */\n function cmnt(trailingLine) {\n var ret = null;\n if (trailingLine === undefined) {\n if (commentLine === line - 1 && (alternateCommentMode || commentType === \"*\" || commentLineEmpty)) {\n ret = commentIsLeading ? commentText : null;\n }\n } else {\n /* istanbul ignore else */\n if (commentLine < trailingLine) {\n peek();\n }\n if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === \"/\")) {\n ret = commentIsLeading ? null : commentText;\n }\n }\n return ret;\n }\n\n return Object.defineProperty({\n next: next,\n peek: peek,\n push: push,\n skip: skip,\n cmnt: cmnt\n }, \"line\", {\n get: function() { return line; }\n });\n /* eslint-enable callback-return */\n}\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(23);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(15),\n OneOf = require(25),\n Field = require(16),\n MapField = require(20),\n Service = require(33),\n Message = require(21),\n Reader = require(27),\n Writer = require(42),\n util = require(37),\n encoder = require(14),\n decoder = require(13),\n verifier = require(40),\n converter = require(12),\n wrappers = require(41);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(37);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(39);\n\nvar roots = require(30);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(35);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(15);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n\n/**\n * Sets the value of a property by property path. If a value already exists, it is turned to an array\n * @param {Object.} dst Destination object\n * @param {string} path dot '.' delimited path of the property to set\n * @param {Object} value the value to set\n * @returns {Object.} Destination object\n */\nutil.setProperty = function setProperty(dst, path, value) {\n function setProp(dst, path, value) {\n var part = path.shift();\n if (path.length > 0) {\n dst[part] = setProp(dst[part] || {}, path, value);\n } else {\n var prevValue = dst[part];\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n dst[part] = value;\n }\n return dst;\n }\n\n if (typeof dst !== \"object\")\n throw TypeError(\"dst must be an object\");\n if (!path)\n throw TypeError(\"path must be specified\");\n\n path = path.split(\".\");\n return setProp(dst, path, value);\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(29))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(39);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(38);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(15),\n util = require(37);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(21);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n // Only use fully qualified type name after the last '/'\n var name = object[\"@type\"].substring(object[\"@type\"].lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n if (type_url.indexOf(\"/\") === -1) {\n type_url = \"/\" + type_url;\n }\n return this.create({\n type_url: type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // Default prefix\n var googleApi = \"type.googleapis.com/\";\n var prefix = \"\";\n var name = \"\";\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n // Separate the prefix used\n prefix = message.type_url.substring(0, message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n var messageName = message.$type.fullName[0] === \".\" ?\n message.$type.fullName.substr(1) : message.$type.fullName;\n // Default to type.googleapis.com prefix if no prefix is used\n if (prefix === \"\") {\n prefix = googleApi;\n }\n name = prefix + messageName;\n object[\"@type\"] = name;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(39);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(42);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(39);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/legacy-libs/protobufjs/dist/protobuf.min.js b/legacy-libs/protobufjs/dist/protobuf.min.js new file mode 100644 index 0000000..6e0f89e --- /dev/null +++ b/legacy-libs/protobufjs/dist/protobuf.min.js @@ -0,0 +1,8 @@ +/*! + * protobuf.js v6.10.0 (c) 2016, daniel wirtz + * compiled wed, 15 jul 2020 23:34:15 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */ +!function(it){"use strict";var r,e,t,i;r={1:[function(t,i){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&f)<<4,o=1;break;case 1:s[u++]=h[r|f>>4],r=(15&f)<<2,o=2;break;case 2:s[u++]=h[r|f>>6],s[u++]=h[63&f],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(a);return n-e},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i){function c(i,n){"string"==typeof i&&(n=i,i=it);var f=[];function h(t){if("string"!=typeof t){var i=a();if(c.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0,n,r);else if(i<11754943508222875e-54)t((e<<31|Math.round(i/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(i)/Math.LN2);t((e<<31|127+s<<23|8388607&Math.round(i*Math.pow(2,-s)*8388608))>>>0,n,r)}}function n(t,i,n){var r=t(i,n),e=2*(r>>31)+1,s=r>>>23&255,u=8388607&r;return 255==s?u?NaN:1/0*e:0==s?1401298464324817e-60*e*u:e*Math.pow(2,s-150)*(8388608+u)}function r(t,i,n){o[0]=t,i[n]=f[0],i[n+1]=f[1],i[n+2]=f[2],i[n+3]=f[3]}function e(t,i,n){o[0]=t,i[n]=f[3],i[n+1]=f[2],i[n+2]=f[1],i[n+3]=f[0]}function s(t,i){return f[0]=t[i],f[1]=t[i+1],f[2]=t[i+2],f[3]=t[i+3],o[0]}function u(t,i){return f[3]=t[i],f[2]=t[i+1],f[1]=t[i+2],f[0]=t[i+3],o[0]}var o,f,h,a,c,l;function v(t,i,n,r,e,s){var u=r<0?1:0;if(u&&(r=-r),0===r)t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n);else if(isNaN(r))t(0,e,s+i),t(2146959360,e,s+n);else if(17976931348623157e292>>0,e,s+n);else{var o;if(r<22250738585072014e-324)t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(o=r*Math.pow(2,-f))>>>0,e,s+i),t((u<<31|f+1023<<20|1048576*o&1048575)>>>0,e,s+n)}}}function d(t,i,n,r,e){var s=t(r,e+i),u=t(r,e+n),o=2*(u>>31)+1,f=u>>>20&2047,h=4294967296*(1048575&u)+s;return 2047==f?h?NaN:1/0*o:0==f?5e-324*o*h:o*Math.pow(2,f-1075)*(h+4503599627370496)}function p(t,i,n){a[0]=t,i[n]=c[0],i[n+1]=c[1],i[n+2]=c[2],i[n+3]=c[3],i[n+4]=c[4],i[n+5]=c[5],i[n+6]=c[6],i[n+7]=c[7]}function w(t,i,n){a[0]=t,i[n]=c[7],i[n+1]=c[6],i[n+2]=c[5],i[n+3]=c[4],i[n+4]=c[3],i[n+5]=c[2],i[n+6]=c[1],i[n+7]=c[0]}function b(t,i){return c[0]=t[i],c[1]=t[i+1],c[2]=t[i+2],c[3]=t[i+3],c[4]=t[i+4],c[5]=t[i+5],c[6]=t[i+6],c[7]=t[i+7],a[0]}function y(t,i){return c[7]=t[i],c[6]=t[i+1],c[5]=t[i+2],c[4]=t[i+3],c[3]=t[i+4],c[2]=t[i+5],c[1]=t[i+6],c[0]=t[i+7],a[0]}return"undefined"!=typeof Float32Array?(o=new Float32Array([-0]),f=new Uint8Array(o.buffer),h=128===f[3],t.writeFloatLE=h?r:e,t.writeFloatBE=h?e:r,t.readFloatLE=h?s:u,t.readFloatBE=h?u:s):(t.writeFloatLE=i.bind(null,m),t.writeFloatBE=i.bind(null,g),t.readFloatLE=n.bind(null,j),t.readFloatBE=n.bind(null,k)),"undefined"!=typeof Float64Array?(a=new Float64Array([-0]),c=new Uint8Array(a.buffer),l=128===c[7],t.writeDoubleLE=l?p:w,t.writeDoubleBE=l?w:p,t.readDoubleLE=l?b:y,t.readDoubleBE=l?y:b):(t.writeDoubleLE=v.bind(null,m,0,4),t.writeDoubleBE=v.bind(null,g,4,0),t.readDoubleLE=d.bind(null,j,0,4),t.readDoubleBE=d.bind(null,k,4,0)),t}function m(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function g(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function j(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function k(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var r=n,s=r.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},e=r.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=s(t),r="";n&&(r=i.shift()+"/");for(var e=0;e>>1,u=null,o=e;return function(t){if(t<1||s>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(r=65536+((1023&r)<<10)+(1023&e),++u,i[n++]=r>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i){i.exports=e;var n,r=/\/|\./;function e(t,i){r.test(t)||(t="google/protobuf/"+t+".proto",i={nested:{google:{nested:{protobuf:{nested:i}}}}}),e[t]=i}e("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),e("duration",{Duration:n={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),e("timestamp",{Timestamp:n}),e("empty",{Empty:{fields:{}}}),e("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),e("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),e("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),e.get=function(t){return e[t]||null}},{}],12:[function(t,i,n){var r=n,l=t(15),v=t(37);function u(t,i,n,r){if(i.resolvedType)if(i.resolvedType instanceof l){t("switch(d%s){",r);for(var e=i.resolvedType.values,s=Object.keys(e),u=0;u>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,o)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,o?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function d(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}r.fromObject=function(t){var i=t.fieldsArray,n=v.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>3){")("case 1: k=r.%s(); break",r.keyType)("case 2:"),f.basic[e]===it?i("value=types[%i].decode(r,r.uint32())",n):i("value=r.%s()",e),i("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),f.long[r.keyType]!==it?i('%s[typeof k==="object"?util.longToHash(k):k]=value',s):i("%s[k]=value",s)):r.repeated?(i("if(!(%s&&%s.length))",s,s)("%s=[]",s),f.packed[e]!==it&&i("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0,8|a.mapKey[s.keyType],s.keyType),f===it?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,o,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&a.packed[o]!==it?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",o,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),f===it?l(n,s,u,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,o,i)),n("}")):(s.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),f===it?l(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,o,i))}return n("return w")};var h=t(15),a=t(36),c=t(37);function l(t,i,n,r){return i.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{15:15,36:36,37:37}],15:[function(t,i){i.exports=e;var o=t(24);((e.prototype=Object.create(o.prototype)).constructor=e).className="Enum";var n=t(23),r=t(37);function e(t,i,n,r,e){if(o.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.reserved=it,i)for(var s=Object.keys(i),u=0;ui)return!0;return!1},h.isReservedName=function(t,i){if(t)for(var n=0;n");var r=l();if(!K.test(r))throw m(r,"name");d("=");var e=new _(y(r),E(l()),i,n);S(e,function(t){if("option"!==t)throw m(t);V(e,t),d(";")},function(){M(e)}),t.add(e)}(n);break;case"required":case"optional":case"repeated":N(n,t);break;case"oneof":!function(t,i){if(!K.test(i=l()))throw m(i,"name");var n=new q(y(i));S(n,function(t){"option"===t?(V(n,t),d(";")):(h(t),N(n,"optional"))}),t.add(n)}(n,t);break;case"extensions":k(n.extensions||(n.extensions=[]));break;case"reserved":k(n.reserved||(n.reserved=[]),!0);break;default:if(!w||!Q.test(t))throw m(t);h(t),N(n,"optional")}}),t.add(n)}(t,i),1;case"enum":return function(t,i){if(!K.test(i=l()))throw m(i,"name");var n=new R(i);S(n,function(t){switch(t){case"option":V(n,t),d(";");break;case"reserved":k(n.reserved||(n.reserved=[]),!0);break;default:!function(t,i){if(!K.test(i))throw m(i,"name");d("=");var n=E(l(),!0),r={};S(r,function(t){if("option"!==t)throw m(t);V(r,t),d(";")},function(){M(r)}),t.add(i,n,r.comment)}(n,t)}}),t.add(n)}(t,i),1;case"service":return function(t,i){if(!K.test(i=l()))throw m(i,"service name");var n=new z(i);S(n,function(t){if(!T(n,t)){if("rpc"!==t)throw m(t);!function(t,i){var n=a(),r=i;if(!K.test(i=l()))throw m(i,"name");var e,s,u,o,f=i;d("("),d("stream",!0)&&(s=!0);if(!Q.test(i=l()))throw m(i);e=i,d(")"),d("returns"),d("("),d("stream",!0)&&(o=!0);if(!Q.test(i=l()))throw m(i);u=i,d(")");var h=new Z(f,r,e,u,s,o);h.comment=n,S(h,function(t){if("option"!==t)throw m(t);V(h,t),d(";")}),t.add(h)}(n,t)}}),t.add(n)}(t,i),1;case"extend":return function(i,t){if(!Q.test(t=l()))throw m(t,"reference");var n=t;S(null,function(t){switch(t){case"required":case"repeated":case"optional":N(i,t,n);break;default:if(!w||!Q.test(t))throw m(t);h(t),N(i,"optional",n)}})}(t,i),1}}function S(t,i,n){var r=f.line;if(t&&("string"!=typeof t.comment&&(t.comment=a()),t.filename=tt.filename),d("{",!0)){for(var e;"}"!==(e=l());)i(e);d(";",!0)}else n&&n(),d(";"),t&&("string"!=typeof t.comment||o)&&(t.comment=a(r)||t.comment)}function N(t,i,n){var r=l();if("group"!==r){if(!Q.test(r))throw m(r,"type");var e=l();if(!K.test(e))throw m(e,"name");e=y(e),d("=");var s=new U(e,E(l()),r,i,n);S(s,function(t){if("option"!==t)throw m(t);V(s,t),d(";")},function(){M(s)}),t.add(s),w||!s.repeated||B.packed[r]===it&&B.basic[r]!==it||s.setOption("packed",!1,!0)}else!function(t,i){var n=l();if(!K.test(n))throw m(n,"name");var r=P.lcFirst(n);n===r&&(n=P.ucFirst(n));d("=");var e=E(l()),s=new L(n);s.group=!0;var u=new U(r,e,n,i);u.filename=tt.filename,S(s,function(t){switch(t){case"option":V(s,t),d(";");break;case"required":case"optional":case"repeated":N(s,t);break;default:throw m(t)}}),t.add(s).add(u)}(t,i)}function V(t,i){var n=d("(",!0);if(!Q.test(i=l()))throw m(i,"name");var r,e=i,s=e;n&&(d(")"),s=e="("+e+")",i=v(),Y.test(i)&&(r=i.substr(1),e+=i,l())),d("=");var u,o,f,h,a=function t(i,n){if(d("{",!0)){for(var r={};!d("}",!0);){if(!K.test(c=l()))throw m(c,"name");var e,s=c;"{"===v()?e=t(i,n+"."+c):(d(":"),"{"===v()?e=t(i,n+"."+c):(e=j(!0),$(i,n+"."+c,e)));var u=r[s];u&&(e=[].concat(u).concat(e)),r[s]=e,d(",",!0)}return r}var o=j(!0);$(i,n,o);return o}(t,e);o=s,f=a,h=r,(u=t).setParsedOption&&u.setParsedOption(o,f,h)}function $(t,i,n){t.setOption&&t.setOption(i,n)}function M(t){if(d("[",!0)){for(;V(t,"option"),d(",",!0););d("]")}return t}for(;null!==(c=l());)switch(c){case"package":if(!p)throw m(c);O();break;case"import":if(!p)throw m(c);A();break;case"syntax":if(!p)throw m(c);x();break;case"option":V(b,c),d(";");break;default:if(T(b,c)){p=!1;continue}throw m(c)}return tt.filename=null,{package:r,imports:e,weakImports:s,syntax:u,root:i}}},{15:15,16:16,20:20,22:22,25:25,29:29,33:33,34:34,35:35,36:36,37:37}],27:[function(t,i){i.exports=o;var n,r=t(39),e=r.LongBits,s=r.utf8;function u(t,i){return RangeError("index out of range: "+t.pos+" + "+(i||1)+" > "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return r.Buffer?function(t){return(o.create=function(t){return r.Buffer.isBuffer(t)?new n(t):a(t)})(t)}:a}var h,a="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function c(){var t=new e(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function l(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw u(this,8);return new e(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}o.create=f(),o.prototype.c=r.Array.prototype.subarray||r.Array.prototype.slice,o.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return h;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return h}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return l(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|l(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.c.call(this.buf,i,n)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.o=function(t){n=t,o.create=f(),n.o();var i=r.Long?"toLong":"toNumber";r.merge(o.prototype,{int64:function(){return c.call(this)[i](!1)},uint64:function(){return c.call(this)[i](!0)},sint64:function(){return c.call(this).zzDecode()[i](!1)},fixed64:function(){return v.call(this)[i](!0)},sfixed64:function(){return v.call(this)[i](!1)}})}},{39:39}],28:[function(t,i){i.exports=e;var n=t(27);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(39);function e(t){n.call(this,t)}e.o=function(){r.Buffer&&(e.prototype.c=r.Buffer.prototype.slice)},e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},e.o()},{27:27,39:39}],29:[function(t,i){i.exports=n;var r=t(23);((n.prototype=Object.create(r.prototype)).constructor=n).className="Root";var e,v,d,s=t(16),u=t(15),o=t(25),p=t(37);function n(t){r.call(this,"",t),this.deferred=[],this.files=[]}function w(){}n.fromJSON=function(t,i){return i=i||new n,t.options&&i.setOptions(t.options),i.addJSON(t.nested)},n.prototype.resolvePath=p.path.resolve,n.prototype.fetch=p.fetch,n.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=it);var u=this;if(!e)return p.asPromise(t,u,i,s);var o=e===w;function f(t,i){if(e){var n=e;if(e=null,o)throw t;n(t,i)}}function h(t){var i=t.lastIndexOf("google/protobuf/");if(-1]/g,x=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,T=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,S=/^ *[*/]+ */,N=/^\s*\*?\/*/,V=/\n/g,$=/\s/,n=/\\(.?)/g,r={0:"\0",r:"\r",n:"\n",t:"\t"};function M(t){return t.replace(n,function(t,i){switch(i){case"\\":case"":return i;default:return r[i]||""}})}function e(f,h){f=f.toString();var a=0,c=f.length,l=1,o=null,v=null,d=0,p=!1,w=!1,b=[],y=null;function m(t){return Error("illegal "+t+" (line "+l+")")}function g(t){return f[0|t]}function j(t,i,n){o=f[0|t++],d=l,p=!1,w=n;var r,e=t-(h?2:3);do{if(--e<0||"\n"==(r=f[0|e])){p=!0;break}}while(" "===r||"\t"===r);for(var s=f.substring(t,i).split(V),u=0;u>>0,this.hi=i>>>0}var s=e.zero=new e(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var r=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(0===t)return s;var i=t<0;i&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++r&&(r=0))),new e(n,r)},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(n.isString(t)){if(!n.Long)return e.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+4294967296*n)}return this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;e.fromHash=function(t){return t===r?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0==n?0==i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{39:39}],39:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function p(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}a.create=c(),a.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(a.alloc=r.pool(a.alloc,r.Array.prototype.subarray)),a.prototype.g=function(t,i,n){return this.tail=this.tail.next=new o(t,i,n),this.len+=i,this},(v.prototype=Object.create(o.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},a.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},a.prototype.int32=function(t){return t<0?this.g(d,10,e.fromNumber(t)):this.uint32(t)},a.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},a.prototype.int64=a.prototype.uint64=function(t){var i=e.from(t);return this.g(d,i.length(),i)},a.prototype.sint64=function(t){var i=e.from(t).zzEncode();return this.g(d,i.length(),i)},a.prototype.bool=function(t){return this.g(l,1,t?1:0)},a.prototype.sfixed32=a.prototype.fixed32=function(t){return this.g(p,4,t>>>0)},a.prototype.sfixed64=a.prototype.fixed64=function(t){var i=e.from(t);return this.g(p,4,i.lo).g(p,4,i.hi)},a.prototype.float=function(t){return this.g(r.float.writeFloatLE,4,t)},a.prototype.double=function(t){return this.g(r.float.writeDoubleLE,8,t)};var w=r.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;if(!i)return this.g(l,1,0);if(r.isString(t)){var n=a.alloc(i=s.length(t));s.decode(t,n,0),t=n}return this.uint32(i).g(w,i,t)},a.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).g(u.write,i,t):this.g(l,1,0)},a.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new o(f,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},a.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},a.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},a.o=function(t){n=t,a.create=c(),n.o()}},{39:39}],43:[function(t,i){i.exports=e;var n=t(42);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(39);function e(){n.call(this)}function s(t,i,n){t.length<40?r.utf8.write(t,i,n):i.utf8Write?i.utf8Write(t,n):i.write(t,n)}e.o=function(){e.alloc=r.y,e.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.g(e.writeBytesBuffer,i,t),this},e.prototype.string=function(t){var i=r.Buffer.byteLength(t);return this.uint32(i),i&&this.g(s,i,t),this},e.o()},{39:39,42:42}]},e={},t=[19],i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]),i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/legacy-libs/protobufjs/dist/protobuf.min.js.map b/legacy-libs/protobufjs/dist/protobuf.min.js.map new file mode 100644 index 0000000..4e3b71d --- /dev/null +++ b/legacy-libs/protobufjs/dist/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/common.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light.js","../src/index-minimal.js","../src/index","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/parse.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/tokenize.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","codegen","functionParams","functionName","body","Codegen","formatStringOrScope","source","toString","verbose","console","log","scopeKeys","Object","keys","scopeParams","scopeValues","scopeOffset","Function","formatParams","formatOffset","replace","$0","$1","value","floor","JSON","stringify","functionNameOverride","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","fetch","asPromise","fs","inquire","filename","options","callback","xhr","readFile","contents","XMLHttpRequest","binary","onreadystatechange","readyState","status","response","responseText","Uint8Array","overrideMimeType","responseType","open","send","factory","writeFloat_ieee754","writeUint","val","buf","pos","sign","isNaN","round","exponent","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","writeFloat_f32_cpy","f32","f8b","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","le","f64","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","Float32Array","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","moduleName","mod","eval","e","path","isAbsolute","normalize","split","absolute","prefix","shift","originPath","includePath","alreadyNormalized","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","common","timeType","commonRe","name","json","nested","google","Any","fields","type_url","type","id","Duration","seconds","nanos","Timestamp","Empty","Struct","keyType","Value","oneofs","kind","oneof","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","values","NULL_VALUE","ListValue","rule","DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue","FieldMask","paths","get","file","converter","Enum","util","genValuePartial_fromObject","gen","field","fieldIndex","prop","resolvedType","repeated","typeDefault","fullName","isUnsigned","genValuePartial_toObject","fromObject","mtype","fieldsArray","safeProp","map","toObject","sort","compareFieldsById","repeatedFields","mapFields","normalFields","partOf","valuesById","long","low","high","unsigned","toNumber","bytes","arrayDefault","hasKs2","_fieldsArray","indexOf","filter","group","ref","types","defaults","basic","packed","rfield","required","wireType","mapKey","genTypePartial","optional","ReflectionObject","create","constructor","className","Namespace","comment","comments","TypeError","reserved","fromJSON","enm","toJSON","toJSONOptions","keepComments","add","isString","isInteger","isReservedId","isReservedName","allow_alias","remove","Field","Type","ruleRe","extend","isObject","toLowerCase","message","defaultValue","Long","extensionField","declaringField","_packed","defineProperty","getOption","setOption","ifNotSet","resolved","parent","lookupTypeOrEnum","fromNumber","freeze","newBuffer","emptyObject","emptyArray","ctor","d","fieldId","fieldType","fieldRule","decorateType","decorateEnum","fieldName","default","_configure","Type_","build","load","root","Root","loadSync","encoder","decoder","verifier","OneOf","MapField","Service","Method","Message","wrappers","configure","Writer","BufferWriter","Reader","BufferReader","rpc","roots","tokenize","parse","resolvedKeyType","fieldKeyType","fieldValueType","properties","$type","writer","encodeDelimited","reader","decodeDelimited","verify","object","requestType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","lookupType","arrayToJSON","array","obj","_nestedArray","clearCache","namespace","addJSON","toArray","nestedArray","nestedJson","names","methods","getEnum","prev","setOptions","onAdd","onRemove","define","isArray","ptr","part","resolveAll","lookup","filterTypes","parentAlreadyChecked","found","lookupEnum","lookupService","Service_","Enum_","parsedOptions","defineProperties","unshift","_handleAdd","_handleRemove","setParsedOption","propName","opt","find","hasOwnProperty","newValue","setProperty","newOpt","Root_","fieldNames","addFieldsToParent","oneofName","oneOfGetter","set","oneOfSetter","keepCase","base10Re","base10NegRe","base16Re","base16NegRe","base8Re","base8NegRe","numberRe","nameRe","typeRefRe","fqTypeRefRe","pkg","imports","weakImports","syntax","token","preferTrailingComment","tn","alternateCommentMode","next","peek","skip","cmnt","head","isProto3","applyCase","camelCase","illegal","insideTryCatch","line","readString","readValue","acceptTypeRef","substring","parseInt","parseFloat","parseNumber","readRanges","target","acceptStrings","parseId","acceptNegative","parsePackage","parseImport","whichImports","parseSyntax","parseCommon","parseOption","ifBlock","valueType","parseInlineOptions","parseMapField","parseField","parseOneOf","extensions","parseType","dummy","parseEnumValue","parseEnum","service","commentText","method","parseMethod","parseService","reference","parseExtension","fnIf","fnElse","trailingLine","lcFirst","ucFirst","parseGroup","isCustom","option","substr","optionValue","parseOptionValue","result","prevValue","concat","simpleValue","package","LongBits","indexOutOfRange","writeLength","RangeError","Buffer","isBuffer","create_array","readLongVarint","bits","readFixed32_end","readFixed64","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","skipType","BufferReader_","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","deferred","files","SYNC","resolvePath","self","sync","finish","cb","getBundledFileName","idx","lastIndexOf","altname","process","parsed","queued","weak","setTimeout","readFileSync","isNode","exposeRe","tryHandleExtension","extendedType","sisterField","parse_","common_","rpcImpl","requestDelimited","responseDelimited","rpcCall","requestCtor","responseCtor","request","endedByRPC","_methodsArray","inherited","methodsArray","rpcService","methodName","isReserved","m","q","s","delimRe","stringDoubleRe","stringSingleRe","setCommentRe","setCommentAltRe","setCommentSplitRe","whitespaceRe","unescapeRe","unescapeMap","0","r","unescape","str","commentType","commentLine","commentLineEmpty","commentIsLeading","stack","stringDelim","subject","charAt","setComment","isLeading","commentOffset","lines","trim","isDoubleSlashCommentLine","startOffset","endOffset","findEndOfLine","lineText","cursor","re","lastIndex","match","exec","repeat","curr","isDoc","isLeadingComment","expected","actual","ret","_fieldsById","_oneofsArray","_ctor","fieldsById","oneofsArray","generateConstructor","ctorProperties","setup","wrapper","originalThis","fork","ldelim","typeName","bake","o","key","safePropBackslashRe","safePropQuoteRe","toUpperCase","camelCaseRe","a","decorateRoot","enumerable","decorateEnumIndex","dst","setProp","zero","zzEncode","zeroHash","from","fromString","toLong","fromHash","hash","toHash","mask","part0","part1","part2","src","newError","CustomError","captureStackTrace","pool","global","versions","node","window","Number","isFinite","isset","isSet","utf8Write","_Buffer_from","_Buffer_allocUnsafe","sizeOrArray","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","ProtocolError","fieldMap","longs","enums","encoding","allocUnsafe","seenFirstField","invalid","genVerifyKey","genVerifyValue","oneofProp","Op","noop","State","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","reset","BufferWriter_","writeStringBuffer","writeBytesBuffer","copy","byteLength","$require","$module","amd","isLong"],"mappings":";;;;;;CAAA,SAAAA,IAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCCxCA,IAAAE,EAAAf,EAOAe,EAAAT,OAAA,SAAAU,GACA,IAAAC,EAAAD,EAAAV,OACA,IAAAW,EACA,OAAA,EAEA,IADA,IAAAC,EAAA,EACA,IAAAD,EAAA,GAAA,KAAAD,EAAAA,EAAAC,MACAC,EACA,OAAAC,KAAAC,KAAA,EAAAJ,EAAAV,QAAA,EAAAY,GAUA,IANA,IAAAG,EAAAjB,MAAA,IAGAkB,EAAAlB,MAAA,KAGAmB,EAAA,EAAAA,EAAA,IACAD,EAAAD,EAAAE,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,EAAAA,EAAA,GAAA,IAAAA,IASAR,EAAAS,OAAA,SAAAC,EAAAC,EAAAC,GAMA,IALA,IAIAC,EAJAC,EAAA,KACAC,EAAA,GACAP,EAAA,EACAQ,EAAA,EAEAL,EAAAC,GAAA,CACA,IAAAK,EAAAP,EAAAC,KACA,OAAAK,GACA,KAAA,EACAD,EAAAP,KAAAF,EAAAW,GAAA,GACAJ,GAAA,EAAAI,IAAA,EACAD,EAAA,EACA,MACA,KAAA,EACAD,EAAAP,KAAAF,EAAAO,EAAAI,GAAA,GACAJ,GAAA,GAAAI,IAAA,EACAD,EAAA,EACA,MACA,KAAA,EACAD,EAAAP,KAAAF,EAAAO,EAAAI,GAAA,GACAF,EAAAP,KAAAF,EAAA,GAAAW,GACAD,EAAA,EAGA,KAAAR,KACAM,EAAAA,GAAA,IAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,IACAP,EAAA,GASA,OANAQ,IACAD,EAAAP,KAAAF,EAAAO,GACAE,EAAAP,KAAA,GACA,IAAAQ,IACAD,EAAAP,KAAA,KAEAM,GACAN,GACAM,EAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KACAM,EAAAQ,KAAA,KAEAH,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KAGA,IAAAe,EAAA,mBAUAvB,EAAAwB,OAAA,SAAAvB,EAAAS,EAAAlB,GAIA,IAHA,IAEAqB,EAFAF,EAAAnB,EACAwB,EAAA,EAEAR,EAAA,EAAAA,EAAAP,EAAAV,QAAA,CACA,IAAAkC,EAAAxB,EAAAyB,WAAAlB,KACA,GAAA,KAAAiB,GAAA,EAAAT,EACA,MACA,IAAAS,EAAAlB,EAAAkB,MAAAhD,GACA,MAAAkD,MAAAJ,GACA,OAAAP,GACA,KAAA,EACAH,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,KAAAqB,GAAA,GAAA,GAAAY,IAAA,EACAZ,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,MAAA,GAAAqB,IAAA,GAAA,GAAAY,IAAA,EACAZ,EAAAY,EACAT,EAAA,EACA,MACA,KAAA,EACAN,EAAAlB,MAAA,EAAAqB,IAAA,EAAAY,EACAT,EAAA,GAIA,GAAA,IAAAA,EACA,MAAAW,MAAAJ,GACA,OAAA/B,EAAAmB,GAQAX,EAAA4B,KAAA,SAAA3B,GACA,MAAA,mEAAA2B,KAAA3B,0BC/HA,SAAA4B,EAAAC,EAAAC,GAGA,iBAAAD,IACAC,EAAAD,EACAA,EAAArD,IAGA,IAAAuD,EAAA,GAYA,SAAAC,EAAAC,GAIA,GAAA,iBAAAA,EAAA,CACA,IAAAC,EAAAC,IAIA,GAHAP,EAAAQ,SACAC,QAAAC,IAAA,YAAAJ,GACAA,EAAA,UAAAA,EACAD,EAAA,CAKA,IAJA,IAAAM,EAAAC,OAAAC,KAAAR,GACAS,EAAAtD,MAAAmD,EAAAjD,OAAA,GACAqD,EAAAvD,MAAAmD,EAAAjD,QACAsD,EAAA,EACAA,EAAAL,EAAAjD,QACAoD,EAAAE,GAAAL,EAAAK,GACAD,EAAAC,GAAAX,EAAAM,EAAAK,MAGA,OADAF,EAAAE,GAAAV,EACAW,SAAA/C,MAAA,KAAA4C,GAAA5C,MAAA,KAAA6C,GAEA,OAAAE,SAAAX,EAAAW,GAMA,IAFA,IAAAC,EAAA1D,MAAAC,UAAAC,OAAA,GACAyD,EAAA,EACAA,EAAAD,EAAAxD,QACAwD,EAAAC,GAAA1D,YAAA0D,GAYA,GAXAA,EAAA,EACAd,EAAAA,EAAAe,QAAA,eAAA,SAAAC,EAAAC,GACA,IAAAC,EAAAL,EAAAC,KACA,OAAAG,GACA,IAAA,IAAA,IAAA,IAAA,OAAAC,EAAAjC,GACA,IAAA,IAAA,OAAAf,KAAAiD,MAAAD,GAAAjC,GACA,IAAA,IAAA,OAAAmC,KAAAC,UAAAH,GACA,IAAA,IAAA,OAAAA,EAAAjC,GAEA,MAAA,MAEA6B,IAAAD,EAAAxD,OACA,MAAAoC,MAAA,4BAEA,OADAK,EAAAd,KAAAgB,GACAD,EAGA,SAAAG,EAAAoB,GACA,MAAA,aAAAA,GAAAzB,GAAA,IAAA,KAAAD,GAAAA,EAAAR,KAAA,MAAA,IAAA,SAAAU,EAAAV,KAAA,QAAA,MAIA,OADAW,EAAAG,SAAAA,EACAH,GAhFAjD,EAAAC,QAAA4C,GAiGAQ,SAAA,wBCzFA,SAAAoB,IAOAC,KAAAC,EAAA,IAfA3E,EAAAC,QAAAwE,GAyBAG,UAAAC,GAAA,SAAAC,EAAA5E,EAAAC,GAKA,OAJAuE,KAAAC,EAAAG,KAAAJ,KAAAC,EAAAG,GAAA,KAAA5C,KAAA,CACAhC,GAAAA,EACAC,IAAAA,GAAAuE,OAEAA,MASAD,EAAAG,UAAAG,IAAA,SAAAD,EAAA5E,GACA,GAAA4E,IAAArF,GACAiF,KAAAC,EAAA,QAEA,GAAAzE,IAAAT,GACAiF,KAAAC,EAAAG,GAAA,QAGA,IADA,IAAAE,EAAAN,KAAAC,EAAAG,GACAtD,EAAA,EAAAA,EAAAwD,EAAAzE,QACAyE,EAAAxD,GAAAtB,KAAAA,EACA8E,EAAAC,OAAAzD,EAAA,KAEAA,EAGA,OAAAkD,MASAD,EAAAG,UAAAM,KAAA,SAAAJ,GACA,IAAAE,EAAAN,KAAAC,EAAAG,GACA,GAAAE,EAAA,CAGA,IAFA,IAAAG,EAAA,GACA3D,EAAA,EACAA,EAAAlB,UAAAC,QACA4E,EAAAjD,KAAA5B,UAAAkB,MACA,IAAAA,EAAA,EAAAA,EAAAwD,EAAAzE,QACAyE,EAAAxD,GAAAtB,GAAAa,MAAAiE,EAAAxD,KAAArB,IAAAgF,GAEA,OAAAT,4BCzEA1E,EAAAC,QAAAmF,EAEA,IAAAC,EAAAtF,EAAA,GAGAuF,EAFAvF,EAAA,EAEAwF,CAAA,MA2BA,SAAAH,EAAAI,EAAAC,EAAAC,GAOA,OAJAD,EAFA,mBAAAA,GACAC,EAAAD,EACA,IACAA,GACA,GAEAC,GAIAD,EAAAE,KAAAL,GAAAA,EAAAM,SACAN,EAAAM,SAAAJ,EAAA,SAAA1E,EAAA+E,GACA,OAAA/E,GAAA,oBAAAgF,eACAV,EAAAO,IAAAH,EAAAC,EAAAC,GACA5E,EACA4E,EAAA5E,GACA4E,EAAA,KAAAD,EAAAM,OAAAF,EAAAA,EAAAzC,SAAA,WAIAgC,EAAAO,IAAAH,EAAAC,EAAAC,GAbAL,EAAAD,EAAAV,KAAAc,EAAAC,GAqCAL,EAAAO,IAAA,SAAAH,EAAAC,EAAAC,GACA,IAAAC,EAAA,IAAAG,eACAH,EAAAK,mBAAA,WAEA,GAAA,IAAAL,EAAAM,WACA,OAAAxG,GAKA,GAAA,IAAAkG,EAAAO,QAAA,MAAAP,EAAAO,OACA,OAAAR,EAAA/C,MAAA,UAAAgD,EAAAO,SAIA,GAAAT,EAAAM,OAAA,CACA,IAAArE,EAAAiE,EAAAQ,SACA,IAAAzE,EAAA,CACAA,EAAA,GACA,IAAA,IAAAF,EAAA,EAAAA,EAAAmE,EAAAS,aAAA7F,SAAAiB,EACAE,EAAAQ,KAAA,IAAAyD,EAAAS,aAAA1D,WAAAlB,IAEA,OAAAkE,EAAA,KAAA,oBAAAW,WAAA,IAAAA,WAAA3E,GAAAA,GAEA,OAAAgE,EAAA,KAAAC,EAAAS,eAGAX,EAAAM,SAEA,qBAAAJ,GACAA,EAAAW,iBAAA,sCACAX,EAAAY,aAAA,eAGAZ,EAAAa,KAAA,MAAAhB,GACAG,EAAAc,qCC1BA,SAAAC,EAAAzG,GAsDA,SAAA0G,EAAAC,EAAAC,EAAAC,EAAAC,GACA,IAAAC,EAAAH,EAAA,EAAA,EAAA,EAGA,GAFAG,IACAH,GAAAA,GACA,IAAAA,EACAD,EAAA,EAAA,EAAAC,EAAA,EAAA,WAAAC,EAAAC,QACA,GAAAE,MAAAJ,GACAD,EAAA,WAAAE,EAAAC,QACA,GAAA,qBAAAF,EACAD,GAAAI,GAAA,GAAA,cAAA,EAAAF,EAAAC,QACA,GAAAF,EAAA,sBACAD,GAAAI,GAAA,GAAA5F,KAAA8F,MAAAL,EAAA,yBAAA,EAAAC,EAAAC,OACA,CACA,IAAAI,EAAA/F,KAAAiD,MAAAjD,KAAAmC,IAAAsD,GAAAzF,KAAAgG,KAEAR,GAAAI,GAAA,GAAA,IAAAG,GAAA,GADA,QAAA/F,KAAA8F,MAAAL,EAAAzF,KAAAiG,IAAA,GAAAF,GAAA,YACA,EAAAL,EAAAC,IAOA,SAAAO,EAAAC,EAAAT,EAAAC,GACA,IAAAS,EAAAD,EAAAT,EAAAC,GACAC,EAAA,GAAAQ,GAAA,IAAA,EACAL,EAAAK,IAAA,GAAA,IACAC,EAAA,QAAAD,EACA,OAAA,KAAAL,EACAM,EACAC,IACAC,EAAAA,EAAAX,EACA,GAAAG,EACA,qBAAAH,EAAAS,EACAT,EAAA5F,KAAAiG,IAAA,EAAAF,EAAA,MAAA,QAAAM,GA9EA,SAAAG,EAAAf,EAAAC,EAAAC,GACAc,EAAA,GAAAhB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAGA,SAAAC,EAAAlB,EAAAC,EAAAC,GACAc,EAAA,GAAAhB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAQA,SAAAE,EAAAlB,EAAAC,GAKA,OAJAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAc,EAAA,GAGA,SAAAI,EAAAnB,EAAAC,GAKA,OAJAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAc,EAAA,GAxCA,IAEAA,EACAC,EACAI,EA2FAC,EACAL,EACAI,EA+DA,SAAAE,EAAAxB,EAAAyB,EAAAC,EAAAzB,EAAAC,EAAAC,GACA,IAAAC,EAAAH,EAAA,EAAA,EAAA,EAGA,GAFAG,IACAH,GAAAA,GACA,IAAAA,EACAD,EAAA,EAAAE,EAAAC,EAAAsB,GACAzB,EAAA,EAAA,EAAAC,EAAA,EAAA,WAAAC,EAAAC,EAAAuB,QACA,GAAArB,MAAAJ,GACAD,EAAA,EAAAE,EAAAC,EAAAsB,GACAzB,EAAA,WAAAE,EAAAC,EAAAuB,QACA,GAAA,sBAAAzB,EACAD,EAAA,EAAAE,EAAAC,EAAAsB,GACAzB,GAAAI,GAAA,GAAA,cAAA,EAAAF,EAAAC,EAAAuB,OACA,CACA,IAAAb,EACA,GAAAZ,EAAA,uBAEAD,GADAa,EAAAZ,EAAA,UACA,EAAAC,EAAAC,EAAAsB,GACAzB,GAAAI,GAAA,GAAAS,EAAA,cAAA,EAAAX,EAAAC,EAAAuB,OACA,CACA,IAAAnB,EAAA/F,KAAAiD,MAAAjD,KAAAmC,IAAAsD,GAAAzF,KAAAgG,KACA,OAAAD,IACAA,EAAA,MAEAP,EAAA,kBADAa,EAAAZ,EAAAzF,KAAAiG,IAAA,GAAAF,MACA,EAAAL,EAAAC,EAAAsB,GACAzB,GAAAI,GAAA,GAAAG,EAAA,MAAA,GAAA,QAAAM,EAAA,WAAA,EAAAX,EAAAC,EAAAuB,KAQA,SAAAC,EAAAhB,EAAAc,EAAAC,EAAAxB,EAAAC,GACA,IAAAyB,EAAAjB,EAAAT,EAAAC,EAAAsB,GACAI,EAAAlB,EAAAT,EAAAC,EAAAuB,GACAtB,EAAA,GAAAyB,GAAA,IAAA,EACAtB,EAAAsB,IAAA,GAAA,KACAhB,EAAA,YAAA,QAAAgB,GAAAD,EACA,OAAA,MAAArB,EACAM,EACAC,IACAC,EAAAA,EAAAX,EACA,GAAAG,EACA,OAAAH,EAAAS,EACAT,EAAA5F,KAAAiG,IAAA,EAAAF,EAAA,OAAAM,EAAA,kBA1GA,SAAAiB,EAAA7B,EAAAC,EAAAC,GACAoB,EAAA,GAAAtB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAGA,SAAAa,EAAA9B,EAAAC,EAAAC,GACAoB,EAAA,GAAAtB,EACAC,EAAAC,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GACAhB,EAAAC,EAAA,GAAAe,EAAA,GAQA,SAAAc,EAAA9B,EAAAC,GASA,OARAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAoB,EAAA,GAGA,SAAAU,EAAA/B,EAAAC,GASA,OARAe,EAAA,GAAAhB,EAAAC,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAe,EAAA,GAAAhB,EAAAC,EAAA,GACAoB,EAAA,GAgEA,MArNA,oBAAAW,cAEAjB,EAAA,IAAAiB,aAAA,EAAA,IACAhB,EAAA,IAAAzB,WAAAwB,EAAAnG,QACAwG,EAAA,MAAAJ,EAAA,GAmBA7H,EAAA8I,aAAAb,EAAAN,EAAAG,EAEA9H,EAAA+I,aAAAd,EAAAH,EAAAH,EAmBA3H,EAAAgJ,YAAAf,EAAAF,EAAAC,EAEAhI,EAAAiJ,YAAAhB,EAAAD,EAAAD,IAwBA/H,EAAA8I,aAAApC,EAAAwC,KAAA,KAAAC,GACAnJ,EAAA+I,aAAArC,EAAAwC,KAAA,KAAAE,GAgBApJ,EAAAgJ,YAAA3B,EAAA6B,KAAA,KAAAG,GACArJ,EAAAiJ,YAAA5B,EAAA6B,KAAA,KAAAI,IAKA,oBAAAC,cAEArB,EAAA,IAAAqB,aAAA,EAAA,IACA1B,EAAA,IAAAzB,WAAA8B,EAAAzG,QACAwG,EAAA,MAAAJ,EAAA,GA2BA7H,EAAAwJ,cAAAvB,EAAAQ,EAAAC,EAEA1I,EAAAyJ,cAAAxB,EAAAS,EAAAD,EA2BAzI,EAAA0J,aAAAzB,EAAAU,EAAAC,EAEA5I,EAAA2J,aAAA1B,EAAAW,EAAAD,IAmCA3I,EAAAwJ,cAAArB,EAAAe,KAAA,KAAAC,EAAA,EAAA,GACAnJ,EAAAyJ,cAAAtB,EAAAe,KAAA,KAAAE,EAAA,EAAA,GAiBApJ,EAAA0J,aAAApB,EAAAY,KAAA,KAAAG,EAAA,EAAA,GACArJ,EAAA2J,aAAArB,EAAAY,KAAA,KAAAI,EAAA,EAAA,IAIAtJ,EAKA,SAAAmJ,EAAAvC,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAGA,SAAAwC,EAAAxC,EAAAC,EAAAC,GACAD,EAAAC,GAAAF,IAAA,GACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAA,IAAAF,EAGA,SAAAyC,EAAAxC,EAAAC,GACA,OAAAD,EAAAC,GACAD,EAAAC,EAAA,IAAA,EACAD,EAAAC,EAAA,IAAA,GACAD,EAAAC,EAAA,IAAA,MAAA,EAGA,SAAAwC,EAAAzC,EAAAC,GACA,OAAAD,EAAAC,IAAA,GACAD,EAAAC,EAAA,IAAA,GACAD,EAAAC,EAAA,IAAA,EACAD,EAAAC,EAAA,MAAA,EA3UA/G,EAAAC,QAAAyG,EAAAA,2BCOA,SAAAnB,EAAAsE,GACA,IACA,IAAAC,EAAAC,KAAA,UAAAA,CAAAF,GACA,GAAAC,IAAAA,EAAAvJ,QAAAkD,OAAAC,KAAAoG,GAAAvJ,QACA,OAAAuJ,EACA,MAAAE,IACA,OAAA,KAdAhK,EAAAC,QAAAsF,0BCMA,IAAA0E,EAAAhK,EAEAiK,EAMAD,EAAAC,WAAA,SAAAD,GACA,MAAA,eAAArH,KAAAqH,IAGAE,EAMAF,EAAAE,UAAA,SAAAF,GAGA,IAAAnI,GAFAmI,EAAAA,EAAAhG,QAAA,MAAA,KACAA,QAAA,UAAA,MACAmG,MAAA,KACAC,EAAAH,EAAAD,GACAK,EAAA,GACAD,IACAC,EAAAxI,EAAAyI,QAAA,KACA,IAAA,IAAA/I,EAAA,EAAAA,EAAAM,EAAAvB,QACA,OAAAuB,EAAAN,GACA,EAAAA,GAAA,OAAAM,EAAAN,EAAA,GACAM,EAAAmD,SAAAzD,EAAA,GACA6I,EACAvI,EAAAmD,OAAAzD,EAAA,KAEAA,EACA,MAAAM,EAAAN,GACAM,EAAAmD,OAAAzD,EAAA,KAEAA,EAEA,OAAA8I,EAAAxI,EAAAQ,KAAA,MAUA2H,EAAArJ,QAAA,SAAA4J,EAAAC,EAAAC,GAGA,OAFAA,IACAD,EAAAN,EAAAM,IACAP,EAAAO,GACAA,GACAC,IACAF,EAAAL,EAAAK,KACAA,EAAAA,EAAAvG,QAAA,iBAAA,KAAA1D,OAAA4J,EAAAK,EAAA,IAAAC,GAAAA,0BC9DAzK,EAAAC,QA6BA,SAAA0K,EAAAtI,EAAAuI,GACA,IAAAC,EAAAD,GAAA,KACAE,EAAAD,IAAA,EACAE,EAAA,KACAvK,EAAAqK,EACA,OAAA,SAAAD,GACA,GAAAA,EAAA,GAAAE,EAAAF,EACA,OAAAD,EAAAC,GACAC,EAAArK,EAAAoK,IACAG,EAAAJ,EAAAE,GACArK,EAAA,GAEA,IAAAsG,EAAAzE,EAAA2I,KAAAD,EAAAvK,EAAAA,GAAAoK,GAGA,OAFA,EAAApK,IACAA,EAAA,GAAA,EAAAA,IACAsG,6BCtCA,IAAAmE,EAAAhL,EAOAgL,EAAA1K,OAAA,SAAAU,GAGA,IAFA,IAAAiK,EAAA,EACAzI,EAAA,EACAjB,EAAA,EAAAA,EAAAP,EAAAV,SAAAiB,GACAiB,EAAAxB,EAAAyB,WAAAlB,IACA,IACA0J,GAAA,EACAzI,EAAA,KACAyI,GAAA,EACA,QAAA,MAAAzI,IAAA,QAAA,MAAAxB,EAAAyB,WAAAlB,EAAA,OACAA,EACA0J,GAAA,GAEAA,GAAA,EAEA,OAAAA,GAUAD,EAAAE,KAAA,SAAAzJ,EAAAC,EAAAC,GAEA,GADAA,EAAAD,EACA,EACA,MAAA,GAKA,IAJA,IAGAE,EAHAC,EAAA,KACAC,EAAA,GACAP,EAAA,EAEAG,EAAAC,IACAC,EAAAH,EAAAC,MACA,IACAI,EAAAP,KAAAK,EACA,IAAAA,GAAAA,EAAA,IACAE,EAAAP,MAAA,GAAAK,IAAA,EAAA,GAAAH,EAAAC,KACA,IAAAE,GAAAA,EAAA,KACAA,IAAA,EAAAA,IAAA,IAAA,GAAAH,EAAAC,OAAA,IAAA,GAAAD,EAAAC,OAAA,EAAA,GAAAD,EAAAC,MAAA,MACAI,EAAAP,KAAA,OAAAK,GAAA,IACAE,EAAAP,KAAA,OAAA,KAAAK,IAEAE,EAAAP,MAAA,GAAAK,IAAA,IAAA,GAAAH,EAAAC,OAAA,EAAA,GAAAD,EAAAC,KACA,KAAAH,KACAM,EAAAA,GAAA,IAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,IACAP,EAAA,GAGA,OAAAM,GACAN,GACAM,EAAAI,KAAAC,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KACAM,EAAAQ,KAAA,KAEAH,OAAAC,aAAArB,MAAAoB,OAAAJ,EAAAM,MAAA,EAAAb,KAUAyJ,EAAAG,MAAA,SAAAnK,EAAAS,EAAAlB,GAIA,IAHA,IACA6K,EACAC,EAFA3J,EAAAnB,EAGAgB,EAAA,EAAAA,EAAAP,EAAAV,SAAAiB,GACA6J,EAAApK,EAAAyB,WAAAlB,IACA,IACAE,EAAAlB,KAAA6K,GACAA,EAAA,KACA3J,EAAAlB,KAAA6K,GAAA,EAAA,KAEA,QAAA,MAAAA,IAAA,QAAA,OAAAC,EAAArK,EAAAyB,WAAAlB,EAAA,MACA6J,EAAA,QAAA,KAAAA,IAAA,KAAA,KAAAC,KACA9J,EACAE,EAAAlB,KAAA6K,GAAA,GAAA,IACA3J,EAAAlB,KAAA6K,GAAA,GAAA,GAAA,KAIA3J,EAAAlB,KAAA6K,GAAA,GAAA,IAHA3J,EAAAlB,KAAA6K,GAAA,EAAA,GAAA,KANA3J,EAAAlB,KAAA,GAAA6K,EAAA,KAcA,OAAA7K,EAAAmB,0BCtGA3B,EAAAC,QAAAsL,EAEA,IA+DAC,EA/DAC,EAAA,QAsBA,SAAAF,EAAAG,EAAAC,GACAF,EAAA7I,KAAA8I,KACAA,EAAA,mBAAAA,EAAA,SACAC,EAAA,CAAAC,OAAA,CAAAC,OAAA,CAAAD,OAAA,CAAA/L,SAAA,CAAA+L,OAAAD,QAEAJ,EAAAG,GAAAC,EAYAJ,EAAA,MAAA,CAUAO,IAAA,CACAC,OAAA,CACAC,SAAA,CACAC,KAAA,SACAC,GAAA,GAEA9H,MAAA,CACA6H,KAAA,QACAC,GAAA,OAQAX,EAAA,WAAA,CAUAY,SAAAX,EAAA,CACAO,OAAA,CACAK,QAAA,CACAH,KAAA,QACAC,GAAA,GAEAG,MAAA,CACAJ,KAAA,QACAC,GAAA,OAMAX,EAAA,YAAA,CAUAe,UAAAd,IAGAD,EAAA,QAAA,CAOAgB,MAAA,CACAR,OAAA,MAIAR,EAAA,SAAA,CASAiB,OAAA,CACAT,OAAA,CACAA,OAAA,CACAU,QAAA,SACAR,KAAA,QACAC,GAAA,KAkBAQ,MAAA,CACAC,OAAA,CACAC,KAAA,CACAC,MAAA,CACA,YACA,cACA,cACA,YACA,cACA,eAIAd,OAAA,CACAe,UAAA,CACAb,KAAA,YACAC,GAAA,GAEAa,YAAA,CACAd,KAAA,SACAC,GAAA,GAEAc,YAAA,CACAf,KAAA,SACAC,GAAA,GAEAe,UAAA,CACAhB,KAAA,OACAC,GAAA,GAEAgB,YAAA,CACAjB,KAAA,SACAC,GAAA,GAEAiB,UAAA,CACAlB,KAAA,YACAC,GAAA,KAKAkB,UAAA,CACAC,OAAA,CACAC,WAAA,IAWAC,UAAA,CACAxB,OAAA,CACAsB,OAAA,CACAG,KAAA,WACAvB,KAAA,QACAC,GAAA,OAMAX,EAAA,WAAA,CASAkC,YAAA,CACA1B,OAAA,CACA3H,MAAA,CACA6H,KAAA,SACAC,GAAA,KAYAwB,WAAA,CACA3B,OAAA,CACA3H,MAAA,CACA6H,KAAA,QACAC,GAAA,KAYAyB,WAAA,CACA5B,OAAA,CACA3H,MAAA,CACA6H,KAAA,QACAC,GAAA,KAYA0B,YAAA,CACA7B,OAAA,CACA3H,MAAA,CACA6H,KAAA,SACAC,GAAA,KAYA2B,WAAA,CACA9B,OAAA,CACA3H,MAAA,CACA6H,KAAA,QACAC,GAAA,KAYA4B,YAAA,CACA/B,OAAA,CACA3H,MAAA,CACA6H,KAAA,SACAC,GAAA,KAYA6B,UAAA,CACAhC,OAAA,CACA3H,MAAA,CACA6H,KAAA,OACAC,GAAA,KAYA8B,YAAA,CACAjC,OAAA,CACA3H,MAAA,CACA6H,KAAA,SACAC,GAAA,KAYA+B,WAAA,CACAlC,OAAA,CACA3H,MAAA,CACA6H,KAAA,QACAC,GAAA,OAMAX,EAAA,aAAA,CASA2C,UAAA,CACAnC,OAAA,CACAoC,MAAA,CACAX,KAAA,WACAvB,KAAA,SACAC,GAAA,OAqBAX,EAAA6C,IAAA,SAAAC,GACA,OAAA9C,EAAA8C,IAAA,+BCxYA,IAAAC,EAAArO,EAEAsO,EAAAxO,EAAA,IACAyO,EAAAzO,EAAA,IAWA,SAAA0O,EAAAC,EAAAC,EAAAC,EAAAC,GAEA,GAAAF,EAAAG,aACA,GAAAH,EAAAG,wBAAAP,EAAA,CAAAG,EACA,eAAAG,GACA,IAAA,IAAAxB,EAAAsB,EAAAG,aAAAzB,OAAA3J,EAAAD,OAAAC,KAAA2J,GAAA7L,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAmN,EAAAI,UAAA1B,EAAA3J,EAAAlC,MAAAmN,EAAAK,aAAAN,EACA,YACAA,EACA,UAAAhL,EAAAlC,GADAkN,CAEA,WAAArB,EAAA3J,EAAAlC,IAFAkN,CAGA,SAAAG,EAAAxB,EAAA3J,EAAAlC,IAHAkN,CAIA,SACAA,EACA,UACAA,EACA,4BAAAG,EADAH,CAEA,sBAAAC,EAAAM,SAAA,oBAFAP,CAGA,gCAAAG,EAAAD,EAAAC,OACA,CACA,IAAAK,GAAA,EACA,OAAAP,EAAA1C,MACA,IAAA,SACA,IAAA,QAAAyC,EACA,kBAAAG,EAAAA,GACA,MACA,IAAA,SACA,IAAA,UAAAH,EACA,cAAAG,EAAAA,GACA,MACA,IAAA,QACA,IAAA,SACA,IAAA,WAAAH,EACA,YAAAG,EAAAA,GACA,MACA,IAAA,SACAK,GAAA,EAEA,IAAA,QACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAR,EACA,gBADAA,CAEA,6CAAAG,EAAAA,EAAAK,EAFAR,CAGA,iCAAAG,EAHAH,CAIA,uBAAAG,EAAAA,EAJAH,CAKA,iCAAAG,EALAH,CAMA,UAAAG,EAAAA,EANAH,CAOA,iCAAAG,EAPAH,CAQA,+DAAAG,EAAAA,EAAAA,EAAAK,EAAA,OAAA,IACA,MACA,IAAA,QAAAR,EACA,4BAAAG,EADAH,CAEA,wEAAAG,EAAAA,EAAAA,EAFAH,CAGA,sBAAAG,EAHAH,CAIA,UAAAG,EAAAA,GACA,MACA,IAAA,SAAAH,EACA,kBAAAG,EAAAA,GACA,MACA,IAAA,OAAAH,EACA,mBAAAG,EAAAA,IAOA,OAAAH,EAmEA,SAAAS,EAAAT,EAAAC,EAAAC,EAAAC,GAEA,GAAAF,EAAAG,aACAH,EAAAG,wBAAAP,EAAAG,EACA,iDAAAG,EAAAD,EAAAC,EAAAA,GACAH,EACA,gCAAAG,EAAAD,EAAAC,OACA,CACA,IAAAK,GAAA,EACA,OAAAP,EAAA1C,MACA,IAAA,SACA,IAAA,QAAAyC,EACA,6CAAAG,EAAAA,EAAAA,EAAAA,GACA,MACA,IAAA,SACAK,GAAA,EAEA,IAAA,QACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAR,EACA,4BAAAG,EADAH,CAEA,uCAAAG,EAAAA,EAAAA,EAFAH,CAGA,OAHAA,CAIA,4IAAAG,EAAAA,EAAAA,EAAAA,EAAAK,EAAA,OAAA,GAAAL,GACA,MACA,IAAA,QAAAH,EACA,gHAAAG,EAAAA,EAAAA,EAAAA,EAAAA,GACA,MACA,QAAAH,EACA,UAAAG,EAAAA,IAIA,OAAAH,EA5FAJ,EAAAc,WAAA,SAAAC,GAEA,IAAAtD,EAAAsD,EAAAC,YACAZ,EAAAF,EAAA3L,QAAA,CAAA,KAAAwM,EAAA3D,KAAA,cAAA8C,CACA,6BADAA,CAEA,YACA,IAAAzC,EAAAxL,OAAA,OAAAmO,EACA,wBACAA,EACA,uBACA,IAAA,IAAAlN,EAAA,EAAAA,EAAAuK,EAAAxL,SAAAiB,EAAA,CACA,IAAAmN,EAAA5C,EAAAvK,GAAAZ,UACAiO,EAAAL,EAAAe,SAAAZ,EAAAjD,MAGAiD,EAAAa,KAAAd,EACA,WAAAG,EADAH,CAEA,4BAAAG,EAFAH,CAGA,sBAAAC,EAAAM,SAAA,oBAHAP,CAIA,SAAAG,EAJAH,CAKA,oDAAAG,GACAJ,EAAAC,EAAAC,EAAAnN,EAAAqN,EAAA,UAAAJ,CACA,IADAA,CAEA,MAGAE,EAAAI,UAAAL,EACA,WAAAG,EADAH,CAEA,0BAAAG,EAFAH,CAGA,sBAAAC,EAAAM,SAAA,mBAHAP,CAIA,SAAAG,EAJAH,CAKA,iCAAAG,GACAJ,EAAAC,EAAAC,EAAAnN,EAAAqN,EAAA,MAAAJ,CACA,IADAA,CAEA,OAIAE,EAAAG,wBAAAP,GAAAG,EACA,iBAAAG,GACAJ,EAAAC,EAAAC,EAAAnN,EAAAqN,GACAF,EAAAG,wBAAAP,GAAAG,EACA,MAEA,OAAAA,EACA,aAwDAJ,EAAAmB,SAAA,SAAAJ,GAEA,IAAAtD,EAAAsD,EAAAC,YAAAjN,QAAAqN,KAAAlB,EAAAmB,mBACA,IAAA5D,EAAAxL,OACA,OAAAiO,EAAA3L,SAAA2L,CAAA,aAUA,IATA,IAAAE,EAAAF,EAAA3L,QAAA,CAAA,IAAA,KAAAwM,EAAA3D,KAAA,YAAA8C,CACA,SADAA,CAEA,OAFAA,CAGA,YAEAoB,EAAA,GACAC,EAAA,GACAC,EAAA,GACAtO,EAAA,EACAA,EAAAuK,EAAAxL,SAAAiB,EACAuK,EAAAvK,GAAAuO,SACAhE,EAAAvK,GAAAZ,UAAAmO,SAAAa,EACA7D,EAAAvK,GAAAgO,IAAAK,EACAC,GAAA5N,KAAA6J,EAAAvK,IAEA,GAAAoO,EAAArP,OAAA,CAEA,IAFAmO,EACA,6BACAlN,EAAA,EAAAA,EAAAoO,EAAArP,SAAAiB,EAAAkN,EACA,SAAAF,EAAAe,SAAAK,EAAApO,GAAAkK,OACAgD,EACA,KAGA,GAAAmB,EAAAtP,OAAA,CAEA,IAFAmO,EACA,8BACAlN,EAAA,EAAAA,EAAAqO,EAAAtP,SAAAiB,EAAAkN,EACA,SAAAF,EAAAe,SAAAM,EAAArO,GAAAkK,OACAgD,EACA,KAGA,GAAAoB,EAAAvP,OAAA,CAEA,IAFAmO,EACA,mBACAlN,EAAA,EAAAA,EAAAsO,EAAAvP,SAAAiB,EAAA,CACA,IAAAmN,EAAAmB,EAAAtO,GACAqN,EAAAL,EAAAe,SAAAZ,EAAAjD,MACA,GAAAiD,EAAAG,wBAAAP,EAAAG,EACA,6BAAAG,EAAAF,EAAAG,aAAAkB,WAAArB,EAAAK,aAAAL,EAAAK,kBACA,GAAAL,EAAAsB,KAAAvB,EACA,iBADAA,CAEA,gCAAAC,EAAAK,YAAAkB,IAAAvB,EAAAK,YAAAmB,KAAAxB,EAAAK,YAAAoB,SAFA1B,CAGA,oEAAAG,EAHAH,CAIA,QAJAA,CAKA,6BAAAG,EAAAF,EAAAK,YAAA5L,WAAAuL,EAAAK,YAAAqB,iBACA,GAAA1B,EAAA2B,MAAA,CACA,IAAAC,EAAA,IAAAlQ,MAAAuE,UAAAvC,MAAA2I,KAAA2D,EAAAK,aAAA1M,KAAA,KAAA,IACAoM,EACA,6BAAAG,EAAA1M,OAAAC,aAAArB,MAAAoB,OAAAwM,EAAAK,aADAN,CAEA,QAFAA,CAGA,SAAAG,EAAA0B,EAHA7B,CAIA,6CAAAG,EAAAA,EAJAH,CAKA,UACAA,EACA,SAAAG,EAAAF,EAAAK,aACAN,EACA,KAEA,IAAA8B,GAAA,EACA,IAAAhP,EAAA,EAAAA,EAAAuK,EAAAxL,SAAAiB,EAAA,CACAmN,EAAA5C,EAAAvK,GAAA,IACAf,EAAA4O,EAAAoB,EAAAC,QAAA/B,GACAE,EAAAL,EAAAe,SAAAZ,EAAAjD,MACAiD,EAAAa,KACAgB,IAAAA,GAAA,EAAA9B,EACA,YACAA,EACA,0CAAAG,EAAAA,EADAH,CAEA,SAAAG,EAFAH,CAGA,kCACAS,EAAAT,EAAAC,EAAAlO,EAAAoO,EAAA,WAAAM,CACA,MACAR,EAAAI,UAAAL,EACA,uBAAAG,EAAAA,EADAH,CAEA,SAAAG,EAFAH,CAGA,iCAAAG,GACAM,EAAAT,EAAAC,EAAAlO,EAAAoO,EAAA,MAAAM,CACA,OACAT,EACA,uCAAAG,EAAAF,EAAAjD,MACAyD,EAAAT,EAAAC,EAAAlO,EAAAoO,GACAF,EAAAoB,QAAArB,EACA,eADAA,CAEA,SAAAF,EAAAe,SAAAZ,EAAAoB,OAAArE,MAAAiD,EAAAjD,OAEAgD,EACA,KAEA,OAAAA,EACA,+CCjSA1O,EAAAC,QAeA,SAAAoP,GAEA,IAAAX,EAAAF,EAAA3L,QAAA,CAAA,IAAA,KAAAwM,EAAA3D,KAAA,UAAA8C,CACA,6BADAA,CAEA,qBAFAA,CAGA,qDAAAa,EAAAC,YAAAqB,OAAA,SAAAhC,GAAA,OAAAA,EAAAa,MAAAjP,OAAA,WAAA,IAHAiO,CAIA,kBAJAA,CAKA,oBACAa,EAAAuB,OAAAlC,EACA,gBADAA,CAEA,SACAA,EACA,kBAGA,IADA,IAAAlN,EAAA,EACAA,EAAA6N,EAAAC,YAAA/O,SAAAiB,EAAA,CACA,IAAAmN,EAAAU,EAAAoB,EAAAjP,GAAAZ,UACAqL,EAAA0C,EAAAG,wBAAAP,EAAA,QAAAI,EAAA1C,KACA4E,EAAA,IAAArC,EAAAe,SAAAZ,EAAAjD,MAAAgD,EACA,WAAAC,EAAAzC,IAGAyC,EAAAa,KAAAd,EACA,4BAAAmC,EADAnC,CAEA,QAAAmC,EAFAnC,CAGA,6BAEAoC,EAAAC,SAAApC,EAAAlC,WAAAhN,GAAAiP,EACA,OAAAoC,EAAAC,SAAApC,EAAAlC,UACAiC,EACA,UAEAoC,EAAAC,SAAA9E,KAAAxM,GAAAiP,EACA,WAAAoC,EAAAC,SAAA9E,IACAyC,EACA,cAEAA,EACA,mBADAA,CAEA,sBAFAA,CAGA,oBAHAA,CAIA,0BAAAC,EAAAlC,QAJAiC,CAKA,WAEAoC,EAAAE,MAAA/E,KAAAxM,GAAAiP,EACA,uCAAAlN,GACAkN,EACA,eAAAzC,GAEAyC,EACA,QADAA,CAEA,WAFAA,CAGA,qBAHAA,CAIA,QAJAA,CAKA,IALAA,CAMA,KAEAoC,EAAAb,KAAAtB,EAAAlC,WAAAhN,GAAAiP,EACA,qDAAAmC,GACAnC,EACA,cAAAmC,IAGAlC,EAAAI,UAAAL,EAEA,uBAAAmC,EAAAA,EAFAnC,CAGA,QAAAmC,GAGAC,EAAAG,OAAAhF,KAAAxM,IAAAiP,EACA,iBADAA,CAEA,0BAFAA,CAGA,kBAHAA,CAIA,kBAAAmC,EAAA5E,EAJAyC,CAKA,SAGAoC,EAAAE,MAAA/E,KAAAxM,GAAAiP,EAAAC,EAAAG,aAAA8B,MACA,+BACA,0CAAAC,EAAArP,GACAkN,EACA,kBAAAmC,EAAA5E,IAGA6E,EAAAE,MAAA/E,KAAAxM,GAAAiP,EAAAC,EAAAG,aAAA8B,MACA,yBACA,oCAAAC,EAAArP,GACAkN,EACA,YAAAmC,EAAA5E,GACAyC,EACA,SAWA,IATAA,EACA,WADAA,CAEA,kBAFAA,CAGA,QAHAA,CAKA,IALAA,CAMA,KAGAlN,EAAA,EAAAA,EAAA6N,EAAAoB,EAAAlQ,SAAAiB,EAAA,CACA,IAAA0P,EAAA7B,EAAAoB,EAAAjP,GACA0P,EAAAC,UAAAzC,EACA,4BAAAwC,EAAAxF,KADAgD,CAEA,4CAjHA,qBAiHAwC,EAjHAxF,KAAA,KAoHA,OAAAgD,EACA,aA1HA,IAAAH,EAAAxO,EAAA,IACA+Q,EAAA/Q,EAAA,IACAyO,EAAAzO,EAAA,4CCJAC,EAAAC,QA0BA,SAAAoP,GAWA,IATA,IAIAwB,EAJAnC,EAAAF,EAAA3L,QAAA,CAAA,IAAA,KAAAwM,EAAA3D,KAAA,UAAA8C,CACA,SADAA,CAEA,qBAKAzC,EAAAsD,EAAAC,YAAAjN,QAAAqN,KAAAlB,EAAAmB,mBAEAnO,EAAA,EAAAA,EAAAuK,EAAAxL,SAAAiB,EAAA,CACA,IAAAmN,EAAA5C,EAAAvK,GAAAZ,UACAH,EAAA4O,EAAAoB,EAAAC,QAAA/B,GACA1C,EAAA0C,EAAAG,wBAAAP,EAAA,QAAAI,EAAA1C,KACAmF,EAAAN,EAAAE,MAAA/E,GACA4E,EAAA,IAAArC,EAAAe,SAAAZ,EAAAjD,MAGAiD,EAAAa,KACAd,EACA,kDAAAmC,EAAAlC,EAAAjD,KADAgD,CAEA,mDAAAmC,EAFAnC,CAGA,4CAAAC,EAAAzC,IAAA,EAAA,KAAA,EAAA,EAAA4E,EAAAO,OAAA1C,EAAAlC,SAAAkC,EAAAlC,SACA2E,IAAA3R,GAAAiP,EACA,oEAAAjO,EAAAoQ,GACAnC,EACA,qCAAA,GAAA0C,EAAAnF,EAAA4E,GACAnC,EACA,IADAA,CAEA,MAGAC,EAAAI,UAAAL,EACA,2BAAAmC,EAAAA,GAGAlC,EAAAsC,QAAAH,EAAAG,OAAAhF,KAAAxM,GAAAiP,EAEA,uBAAAC,EAAAzC,IAAA,EAAA,KAAA,EAFAwC,CAGA,+BAAAmC,EAHAnC,CAIA,cAAAzC,EAAA4E,EAJAnC,CAKA,eAGAA,EAEA,+BAAAmC,GACAO,IAAA3R,GACA6R,EAAA5C,EAAAC,EAAAlO,EAAAoQ,EAAA,OACAnC,EACA,0BAAAC,EAAAzC,IAAA,EAAAkF,KAAA,EAAAnF,EAAA4E,IAEAnC,EACA,OAIAC,EAAA4C,UAAA7C,EACA,iDAAAmC,EAAAlC,EAAAjD,MAEA0F,IAAA3R,GACA6R,EAAA5C,EAAAC,EAAAlO,EAAAoQ,GACAnC,EACA,uBAAAC,EAAAzC,IAAA,EAAAkF,KAAA,EAAAnF,EAAA4E,IAKA,OAAAnC,EACA,aA9FA,IAAAH,EAAAxO,EAAA,IACA+Q,EAAA/Q,EAAA,IACAyO,EAAAzO,EAAA,IAWA,SAAAuR,EAAA5C,EAAAC,EAAAC,EAAAiC,GACA,OAAAlC,EAAAG,aAAA8B,MACAlC,EAAA,+CAAAE,EAAAiC,GAAAlC,EAAAzC,IAAA,EAAA,KAAA,GAAAyC,EAAAzC,IAAA,EAAA,KAAA,GACAwC,EAAA,oDAAAE,EAAAiC,GAAAlC,EAAAzC,IAAA,EAAA,KAAA,4CClBAlM,EAAAC,QAAAsO,EAGA,IAAAiD,EAAAzR,EAAA,MACAwO,EAAA3J,UAAAnB,OAAAgO,OAAAD,EAAA5M,YAAA8M,YAAAnD,GAAAoD,UAAA,OAEA,IAAAC,EAAA7R,EAAA,IACAyO,EAAAzO,EAAA,IAaA,SAAAwO,EAAA7C,EAAA2B,EAAA5H,EAAAoM,EAAAC,GAGA,GAFAN,EAAAxG,KAAAtG,KAAAgH,EAAAjG,GAEA4H,GAAA,iBAAAA,EACA,MAAA0E,UAAA,4BAoCA,GA9BArN,KAAAsL,WAAA,GAMAtL,KAAA2I,OAAA5J,OAAAgO,OAAA/M,KAAAsL,YAMAtL,KAAAmN,QAAAA,EAMAnN,KAAAoN,SAAAA,GAAA,GAMApN,KAAAsN,SAAAvS,GAMA4N,EACA,IAAA,IAAA3J,EAAAD,OAAAC,KAAA2J,GAAA7L,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACA,iBAAA6L,EAAA3J,EAAAlC,MACAkD,KAAAsL,WAAAtL,KAAA2I,OAAA3J,EAAAlC,IAAA6L,EAAA3J,EAAAlC,KAAAkC,EAAAlC,IAiBA+M,EAAA0D,SAAA,SAAAvG,EAAAC,GACA,IAAAuG,EAAA,IAAA3D,EAAA7C,EAAAC,EAAA0B,OAAA1B,EAAAlG,QAAAkG,EAAAkG,QAAAlG,EAAAmG,UAEA,OADAI,EAAAF,SAAArG,EAAAqG,SACAE,GAQA3D,EAAA3J,UAAAuN,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,UAAA/K,KAAAe,QACA,SAAAf,KAAA2I,OACA,WAAA3I,KAAAsN,UAAAtN,KAAAsN,SAAAzR,OAAAmE,KAAAsN,SAAAvS,GACA,UAAA4S,EAAA3N,KAAAmN,QAAApS,GACA,WAAA4S,EAAA3N,KAAAoN,SAAArS,MAaA8O,EAAA3J,UAAA0N,IAAA,SAAA5G,EAAAQ,EAAA2F,GAGA,IAAArD,EAAA+D,SAAA7G,GACA,MAAAqG,UAAA,yBAEA,IAAAvD,EAAAgE,UAAAtG,GACA,MAAA6F,UAAA,yBAEA,GAAArN,KAAA2I,OAAA3B,KAAAjM,GACA,MAAAkD,MAAA,mBAAA+I,EAAA,QAAAhH,MAEA,GAAAA,KAAA+N,aAAAvG,GACA,MAAAvJ,MAAA,MAAAuJ,EAAA,mBAAAxH,MAEA,GAAAA,KAAAgO,eAAAhH,GACA,MAAA/I,MAAA,SAAA+I,EAAA,oBAAAhH,MAEA,GAAAA,KAAAsL,WAAA9D,KAAAzM,GAAA,CACA,IAAAiF,KAAAe,UAAAf,KAAAe,QAAAkN,YACA,MAAAhQ,MAAA,gBAAAuJ,EAAA,OAAAxH,MACAA,KAAA2I,OAAA3B,GAAAQ,OAEAxH,KAAAsL,WAAAtL,KAAA2I,OAAA3B,GAAAQ,GAAAR,EAGA,OADAhH,KAAAoN,SAAApG,GAAAmG,GAAA,KACAnN,MAUA6J,EAAA3J,UAAAgO,OAAA,SAAAlH,GAEA,IAAA8C,EAAA+D,SAAA7G,GACA,MAAAqG,UAAA,yBAEA,IAAAlL,EAAAnC,KAAA2I,OAAA3B,GACA,GAAA,MAAA7E,EACA,MAAAlE,MAAA,SAAA+I,EAAA,uBAAAhH,MAMA,cAJAA,KAAAsL,WAAAnJ,UACAnC,KAAA2I,OAAA3B,UACAhH,KAAAoN,SAAApG,GAEAhH,MAQA6J,EAAA3J,UAAA6N,aAAA,SAAAvG,GACA,OAAA0F,EAAAa,aAAA/N,KAAAsN,SAAA9F,IAQAqC,EAAA3J,UAAA8N,eAAA,SAAAhH,GACA,OAAAkG,EAAAc,eAAAhO,KAAAsN,SAAAtG,4CClLA1L,EAAAC,QAAA4S,EAGA,IAAArB,EAAAzR,EAAA,MACA8S,EAAAjO,UAAAnB,OAAAgO,OAAAD,EAAA5M,YAAA8M,YAAAmB,GAAAlB,UAAA,QAEA,IAIAmB,EAJAvE,EAAAxO,EAAA,IACA+Q,EAAA/Q,EAAA,IACAyO,EAAAzO,EAAA,IAIAgT,EAAA,+BAyCA,SAAAF,EAAAnH,EAAAQ,EAAAD,EAAAuB,EAAAwF,EAAAvN,EAAAoM,GAcA,GAZArD,EAAAyE,SAAAzF,IACAqE,EAAAmB,EACAvN,EAAA+H,EACAA,EAAAwF,EAAAvT,IACA+O,EAAAyE,SAAAD,KACAnB,EAAApM,EACAA,EAAAuN,EACAA,EAAAvT,IAGA+R,EAAAxG,KAAAtG,KAAAgH,EAAAjG,IAEA+I,EAAAgE,UAAAtG,IAAAA,EAAA,EACA,MAAA6F,UAAA,qCAEA,IAAAvD,EAAA+D,SAAAtG,GACA,MAAA8F,UAAA,yBAEA,GAAAvE,IAAA/N,KAAAsT,EAAAnQ,KAAA4K,EAAAA,EAAApK,WAAA8P,eACA,MAAAnB,UAAA,8BAEA,GAAAiB,IAAAvT,KAAA+O,EAAA+D,SAAAS,GACA,MAAAjB,UAAA,2BAMArN,KAAA8I,KAAAA,GAAA,aAAAA,EAAAA,EAAA/N,GAMAiF,KAAAuH,KAAAA,EAMAvH,KAAAwH,GAAAA,EAMAxH,KAAAsO,OAAAA,GAAAvT,GAMAiF,KAAAyM,SAAA,aAAA3D,EAMA9I,KAAA6M,UAAA7M,KAAAyM,SAMAzM,KAAAqK,SAAA,aAAAvB,EAMA9I,KAAA8K,KAAA,EAMA9K,KAAAyO,QAAA,KAMAzO,KAAAqL,OAAA,KAMArL,KAAAsK,YAAA,KAMAtK,KAAA0O,aAAA,KAMA1O,KAAAuL,OAAAzB,EAAA6E,MAAAvC,EAAAb,KAAAhE,KAAAxM,GAMAiF,KAAA4L,MAAA,UAAArE,EAMAvH,KAAAoK,aAAA,KAMApK,KAAA4O,eAAA,KAMA5O,KAAA6O,eAAA,KAOA7O,KAAA8O,EAAA,KAMA9O,KAAAmN,QAAAA,EA7JAgB,EAAAZ,SAAA,SAAAvG,EAAAC,GACA,OAAA,IAAAkH,EAAAnH,EAAAC,EAAAO,GAAAP,EAAAM,KAAAN,EAAA6B,KAAA7B,EAAAqH,OAAArH,EAAAlG,QAAAkG,EAAAkG,UAqKApO,OAAAgQ,eAAAZ,EAAAjO,UAAA,SAAA,CACAwJ,IAAA,WAIA,OAFA,OAAA1J,KAAA8O,IACA9O,KAAA8O,GAAA,IAAA9O,KAAAgP,UAAA,WACAhP,KAAA8O,KAOAX,EAAAjO,UAAA+O,UAAA,SAAAjI,EAAAtH,EAAAwP,GAGA,MAFA,WAAAlI,IACAhH,KAAA8O,EAAA,MACAhC,EAAA5M,UAAA+O,UAAA3I,KAAAtG,KAAAgH,EAAAtH,EAAAwP,IAwBAf,EAAAjO,UAAAuN,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,OAAA,aAAA/K,KAAA8I,MAAA9I,KAAA8I,MAAA/N,GACA,OAAAiF,KAAAuH,KACA,KAAAvH,KAAAwH,GACA,SAAAxH,KAAAsO,OACA,UAAAtO,KAAAe,QACA,UAAA4M,EAAA3N,KAAAmN,QAAApS,MASAoT,EAAAjO,UAAAhE,QAAA,WAEA,GAAA8D,KAAAmP,SACA,OAAAnP,KA0BA,IAxBAA,KAAAsK,YAAA8B,EAAAC,SAAArM,KAAAuH,SAAAxM,KACAiF,KAAAoK,cAAApK,KAAA6O,eAAA7O,KAAA6O,eAAAO,OAAApP,KAAAoP,QAAAC,iBAAArP,KAAAuH,MACAvH,KAAAoK,wBAAAgE,EACApO,KAAAsK,YAAA,KAEAtK,KAAAsK,YAAAtK,KAAAoK,aAAAzB,OAAA5J,OAAAC,KAAAgB,KAAAoK,aAAAzB,QAAA,KAIA3I,KAAAe,SAAA,MAAAf,KAAAe,QAAA,UACAf,KAAAsK,YAAAtK,KAAAe,QAAA,QACAf,KAAAoK,wBAAAP,GAAA,iBAAA7J,KAAAsK,cACAtK,KAAAsK,YAAAtK,KAAAoK,aAAAzB,OAAA3I,KAAAsK,eAIAtK,KAAAe,WACA,IAAAf,KAAAe,QAAAwL,SAAAvM,KAAAe,QAAAwL,SAAAxR,KAAAiF,KAAAoK,cAAApK,KAAAoK,wBAAAP,WACA7J,KAAAe,QAAAwL,OACAxN,OAAAC,KAAAgB,KAAAe,SAAAlF,SACAmE,KAAAe,QAAAhG,KAIAiF,KAAAuL,KACAvL,KAAAsK,YAAAR,EAAA6E,KAAAW,WAAAtP,KAAAsK,YAAA,KAAAtK,KAAAuH,KAAA,IAGAxI,OAAAwQ,QACAxQ,OAAAwQ,OAAAvP,KAAAsK,kBAEA,GAAAtK,KAAA4L,OAAA,iBAAA5L,KAAAsK,YAAA,CACA,IAAAlI,EACA0H,EAAAxN,OAAA4B,KAAA8B,KAAAsK,aACAR,EAAAxN,OAAAwB,OAAAkC,KAAAsK,YAAAlI,EAAA0H,EAAA0F,UAAA1F,EAAAxN,OAAAT,OAAAmE,KAAAsK,cAAA,GAEAR,EAAAvD,KAAAG,MAAA1G,KAAAsK,YAAAlI,EAAA0H,EAAA0F,UAAA1F,EAAAvD,KAAA1K,OAAAmE,KAAAsK,cAAA,GACAtK,KAAAsK,YAAAlI,EAeA,OAXApC,KAAA8K,IACA9K,KAAA0O,aAAA5E,EAAA2F,YACAzP,KAAAqK,SACArK,KAAA0O,aAAA5E,EAAA4F,WAEA1P,KAAA0O,aAAA1O,KAAAsK,YAGAtK,KAAAoP,kBAAAhB,IACApO,KAAAoP,OAAAO,KAAAzP,UAAAF,KAAAgH,MAAAhH,KAAA0O,cAEA5B,EAAA5M,UAAAhE,QAAAoK,KAAAtG,OAuBAmO,EAAAyB,EAAA,SAAAC,EAAAC,EAAAC,EAAArB,GAUA,MAPA,mBAAAoB,EACAA,EAAAhG,EAAAkG,aAAAF,GAAA9I,KAGA8I,GAAA,iBAAAA,IACAA,EAAAhG,EAAAmG,aAAAH,GAAA9I,MAEA,SAAA9G,EAAAgQ,GACApG,EAAAkG,aAAA9P,EAAA8M,aACAY,IAAA,IAAAO,EAAA+B,EAAAL,EAAAC,EAAAC,EAAA,CAAAI,QAAAzB,OAkBAP,EAAAiC,EAAA,SAAAC,GACAjC,EAAAiC,iDChXA,IAAAlV,EAAAG,EAAAC,QAAAF,EAAA,IAEAF,EAAAmV,MAAA,QAoDAnV,EAAAoV,KAjCA,SAAAzP,EAAA0P,EAAAxP,GAMA,OAHAwP,EAFA,mBAAAA,GACAxP,EAAAwP,EACA,IAAArV,EAAAsV,MACAD,GACA,IAAArV,EAAAsV,MACAF,KAAAzP,EAAAE,IA2CA7F,EAAAuV,SANA,SAAA5P,EAAA0P,GAGA,OADAA,EADAA,GACA,IAAArV,EAAAsV,MACAC,SAAA5P,IAMA3F,EAAAwV,QAAAtV,EAAA,IACAF,EAAAyV,QAAAvV,EAAA,IACAF,EAAA0V,SAAAxV,EAAA,IACAF,EAAAyO,UAAAvO,EAAA,IAGAF,EAAA2R,iBAAAzR,EAAA,IACAF,EAAA+R,UAAA7R,EAAA,IACAF,EAAAsV,KAAApV,EAAA,IACAF,EAAA0O,KAAAxO,EAAA,IACAF,EAAAiT,KAAA/S,EAAA,IACAF,EAAAgT,MAAA9S,EAAA,IACAF,EAAA2V,MAAAzV,EAAA,IACAF,EAAA4V,SAAA1V,EAAA,IACAF,EAAA6V,QAAA3V,EAAA,IACAF,EAAA8V,OAAA5V,EAAA,IAGAF,EAAA+V,QAAA7V,EAAA,IACAF,EAAAgW,SAAA9V,EAAA,IAGAF,EAAAiR,MAAA/Q,EAAA,IACAF,EAAA2O,KAAAzO,EAAA,IAGAF,EAAA2R,iBAAAsD,EAAAjV,EAAAsV,MACAtV,EAAA+R,UAAAkD,EAAAjV,EAAAiT,KAAAjT,EAAA6V,QAAA7V,EAAA0O,MACA1O,EAAAsV,KAAAL,EAAAjV,EAAAiT,MACAjT,EAAAgT,MAAAiC,EAAAjV,EAAAiT,gJCtGA,IAAAjT,EAAAI,EA2BA,SAAA6V,IACAjW,EAAA2O,KAAAsG,IACAjV,EAAAkW,OAAAjB,EAAAjV,EAAAmW,cACAnW,EAAAoW,OAAAnB,EAAAjV,EAAAqW,cAtBArW,EAAAmV,MAAA,UAGAnV,EAAAkW,OAAAhW,EAAA,IACAF,EAAAmW,aAAAjW,EAAA,IACAF,EAAAoW,OAAAlW,EAAA,IACAF,EAAAqW,aAAAnW,EAAA,IAGAF,EAAA2O,KAAAzO,EAAA,IACAF,EAAAsW,IAAApW,EAAA,IACAF,EAAAuW,MAAArW,EAAA,KACAF,EAAAiW,UAAAA,qECpBA,IAAAjW,EAAAG,EAAAC,QAAAF,EAAA,IAEAF,EAAAmV,MAAA,OAGAnV,EAAAwW,SAAAtW,EAAA,IACAF,EAAAyW,MAAAvW,EAAA,IACAF,EAAA0L,OAAAxL,EAAA,IAGAF,EAAAsV,KAAAL,EAAAjV,EAAAiT,KAAAjT,EAAAyW,MAAAzW,EAAA0L,sDCVAvL,EAAAC,QAAAwV,EAGA,IAAA5C,EAAA9S,EAAA,MACA0V,EAAA7Q,UAAAnB,OAAAgO,OAAAoB,EAAAjO,YAAA8M,YAAA+D,GAAA9D,UAAA,WAEA,IAAAb,EAAA/Q,EAAA,IACAyO,EAAAzO,EAAA,IAcA,SAAA0V,EAAA/J,EAAAQ,EAAAO,EAAAR,EAAAxG,EAAAoM,GAIA,GAHAgB,EAAA7H,KAAAtG,KAAAgH,EAAAQ,EAAAD,EAAAxM,GAAAA,GAAAgG,EAAAoM,IAGArD,EAAA+D,SAAA9F,GACA,MAAAsF,UAAA,4BAMArN,KAAA+H,QAAAA,EAMA/H,KAAA6R,gBAAA,KAGA7R,KAAA8K,KAAA,EAwBAiG,EAAAxD,SAAA,SAAAvG,EAAAC,GACA,OAAA,IAAA8J,EAAA/J,EAAAC,EAAAO,GAAAP,EAAAc,QAAAd,EAAAM,KAAAN,EAAAlG,QAAAkG,EAAAkG,UAQA4D,EAAA7Q,UAAAuN,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,UAAA/K,KAAA+H,QACA,OAAA/H,KAAAuH,KACA,KAAAvH,KAAAwH,GACA,SAAAxH,KAAAsO,OACA,UAAAtO,KAAAe,QACA,UAAA4M,EAAA3N,KAAAmN,QAAApS,MAOAgW,EAAA7Q,UAAAhE,QAAA,WACA,GAAA8D,KAAAmP,SACA,OAAAnP,KAGA,GAAAoM,EAAAO,OAAA3M,KAAA+H,WAAAhN,GACA,MAAAkD,MAAA,qBAAA+B,KAAA+H,SAEA,OAAAoG,EAAAjO,UAAAhE,QAAAoK,KAAAtG,OAaA+Q,EAAAnB,EAAA,SAAAC,EAAAiC,EAAAC,GAUA,MAPA,mBAAAA,EACAA,EAAAjI,EAAAkG,aAAA+B,GAAA/K,KAGA+K,GAAA,iBAAAA,IACAA,EAAAjI,EAAAmG,aAAA8B,GAAA/K,MAEA,SAAA9G,EAAAgQ,GACApG,EAAAkG,aAAA9P,EAAA8M,aACAY,IAAA,IAAAmD,EAAAb,EAAAL,EAAAiC,EAAAC,8CC1HAzW,EAAAC,QAAA2V,EAEA,IAAApH,EAAAzO,EAAA,IASA,SAAA6V,EAAAc,GAEA,GAAAA,EACA,IAAA,IAAAhT,EAAAD,OAAAC,KAAAgT,GAAAlV,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAkD,KAAAhB,EAAAlC,IAAAkV,EAAAhT,EAAAlC,IA0BAoU,EAAAnE,OAAA,SAAAiF,GACA,OAAAhS,KAAAiS,MAAAlF,OAAAiF,IAWAd,EAAAnU,OAAA,SAAA0R,EAAAyD,GACA,OAAAlS,KAAAiS,MAAAlV,OAAA0R,EAAAyD,IAWAhB,EAAAiB,gBAAA,SAAA1D,EAAAyD,GACA,OAAAlS,KAAAiS,MAAAE,gBAAA1D,EAAAyD,IAYAhB,EAAApT,OAAA,SAAAsU,GACA,OAAApS,KAAAiS,MAAAnU,OAAAsU,IAYAlB,EAAAmB,gBAAA,SAAAD,GACA,OAAApS,KAAAiS,MAAAI,gBAAAD,IAUAlB,EAAAoB,OAAA,SAAA7D,GACA,OAAAzO,KAAAiS,MAAAK,OAAA7D,IAUAyC,EAAAxG,WAAA,SAAA6H,GACA,OAAAvS,KAAAiS,MAAAvH,WAAA6H,IAWArB,EAAAnG,SAAA,SAAA0D,EAAA1N,GACA,OAAAf,KAAAiS,MAAAlH,SAAA0D,EAAA1N,IAOAmQ,EAAAhR,UAAAuN,OAAA,WACA,OAAAzN,KAAAiS,MAAAlH,SAAA/K,KAAA8J,EAAA4D,4CCtIApS,EAAAC,QAAA0V,EAGA,IAAAnE,EAAAzR,EAAA,MACA4V,EAAA/Q,UAAAnB,OAAAgO,OAAAD,EAAA5M,YAAA8M,YAAAiE,GAAAhE,UAAA,SAEA,IAAAnD,EAAAzO,EAAA,IAgBA,SAAA4V,EAAAjK,EAAAO,EAAAiL,EAAA3Q,EAAA4Q,EAAAC,EAAA3R,EAAAoM,GAYA,GATArD,EAAAyE,SAAAkE,IACA1R,EAAA0R,EACAA,EAAAC,EAAA3X,IACA+O,EAAAyE,SAAAmE,KACA3R,EAAA2R,EACAA,EAAA3X,IAIAwM,IAAAxM,KAAA+O,EAAA+D,SAAAtG,GACA,MAAA8F,UAAA,yBAGA,IAAAvD,EAAA+D,SAAA2E,GACA,MAAAnF,UAAA,gCAGA,IAAAvD,EAAA+D,SAAAhM,GACA,MAAAwL,UAAA,iCAEAP,EAAAxG,KAAAtG,KAAAgH,EAAAjG,GAMAf,KAAAuH,KAAAA,GAAA,MAMAvH,KAAAwS,YAAAA,EAMAxS,KAAAyS,gBAAAA,GAAA1X,GAMAiF,KAAA6B,aAAAA,EAMA7B,KAAA0S,iBAAAA,GAAA3X,GAMAiF,KAAA2S,oBAAA,KAMA3S,KAAA4S,qBAAA,KAMA5S,KAAAmN,QAAAA,EAqBA8D,EAAA1D,SAAA,SAAAvG,EAAAC,GACA,OAAA,IAAAgK,EAAAjK,EAAAC,EAAAM,KAAAN,EAAAuL,YAAAvL,EAAApF,aAAAoF,EAAAwL,cAAAxL,EAAAyL,eAAAzL,EAAAlG,QAAAkG,EAAAkG,UAQA8D,EAAA/Q,UAAAuN,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,OAAA,QAAA/K,KAAAuH,MAAAvH,KAAAuH,MAAAxM,GACA,cAAAiF,KAAAwS,YACA,gBAAAxS,KAAAyS,cACA,eAAAzS,KAAA6B,aACA,iBAAA7B,KAAA0S,eACA,UAAA1S,KAAAe,QACA,UAAA4M,EAAA3N,KAAAmN,QAAApS,MAOAkW,EAAA/Q,UAAAhE,QAAA,WAGA,OAAA8D,KAAAmP,SACAnP,MAEAA,KAAA2S,oBAAA3S,KAAAoP,OAAAyD,WAAA7S,KAAAwS,aACAxS,KAAA4S,qBAAA5S,KAAAoP,OAAAyD,WAAA7S,KAAA6B,cAEAiL,EAAA5M,UAAAhE,QAAAoK,KAAAtG,0CCpJA1E,EAAAC,QAAA2R,EAGA,IAAAJ,EAAAzR,EAAA,MACA6R,EAAAhN,UAAAnB,OAAAgO,OAAAD,EAAA5M,YAAA8M,YAAAE,GAAAD,UAAA,YAEA,IAGAmB,EACA4C,EACAnH,EALAsE,EAAA9S,EAAA,IACAyO,EAAAzO,EAAA,IAoCA,SAAAyX,EAAAC,EAAArF,GACA,IAAAqF,IAAAA,EAAAlX,OACA,OAAAd,GAEA,IADA,IAAAiY,EAAA,GACAlW,EAAA,EAAAA,EAAAiW,EAAAlX,SAAAiB,EACAkW,EAAAD,EAAAjW,GAAAkK,MAAA+L,EAAAjW,GAAA2Q,OAAAC,GACA,OAAAsF,EA4CA,SAAA9F,EAAAlG,EAAAjG,GACA+L,EAAAxG,KAAAtG,KAAAgH,EAAAjG,GAMAf,KAAAkH,OAAAnM,GAOAiF,KAAAiT,EAAA,KAGA,SAAAC,EAAAC,GAEA,OADAA,EAAAF,EAAA,KACAE,EAhFAjG,EAAAK,SAAA,SAAAvG,EAAAC,GACA,OAAA,IAAAiG,EAAAlG,EAAAC,EAAAlG,SAAAqS,QAAAnM,EAAAC,SAmBAgG,EAAA4F,YAAAA,EAQA5F,EAAAa,aAAA,SAAAT,EAAA9F,GACA,GAAA8F,EACA,IAAA,IAAAxQ,EAAA,EAAAA,EAAAwQ,EAAAzR,SAAAiB,EACA,GAAA,iBAAAwQ,EAAAxQ,IAAAwQ,EAAAxQ,GAAA,IAAA0K,GAAA8F,EAAAxQ,GAAA,GAAA0K,EACA,OAAA,EACA,OAAA,GASA0F,EAAAc,eAAA,SAAAV,EAAAtG,GACA,GAAAsG,EACA,IAAA,IAAAxQ,EAAA,EAAAA,EAAAwQ,EAAAzR,SAAAiB,EACA,GAAAwQ,EAAAxQ,KAAAkK,EACA,OAAA,EACA,OAAA,GA0CAjI,OAAAgQ,eAAA7B,EAAAhN,UAAA,cAAA,CACAwJ,IAAA,WACA,OAAA1J,KAAAiT,IAAAjT,KAAAiT,EAAAnJ,EAAAuJ,QAAArT,KAAAkH,YA6BAgG,EAAAhN,UAAAuN,OAAA,SAAAC,GACA,OAAA5D,EAAAiB,SAAA,CACA,UAAA/K,KAAAe,QACA,SAAA+R,EAAA9S,KAAAsT,YAAA5F,MASAR,EAAAhN,UAAAkT,QAAA,SAAAG,GAGA,GAAAA,EACA,IAAA,IAAArM,EAAAsM,EAAAzU,OAAAC,KAAAuU,GAAAzW,EAAA,EAAAA,EAAA0W,EAAA3X,SAAAiB,EACAoK,EAAAqM,EAAAC,EAAA1W,IAJAkD,KAKA4N,KACA1G,EAAAG,SAAAtM,GACAqT,EAAAb,SACArG,EAAAyB,SAAA5N,GACA8O,EAAA0D,SACArG,EAAAuM,UAAA1Y,GACAiW,EAAAzD,SACArG,EAAAM,KAAAzM,GACAoT,EAAAZ,SACAL,EAAAK,UAAAiG,EAAA1W,GAAAoK,IAIA,OAAAlH,MAQAkN,EAAAhN,UAAAwJ,IAAA,SAAA1C,GACA,OAAAhH,KAAAkH,QAAAlH,KAAAkH,OAAAF,IACA,MAUAkG,EAAAhN,UAAAwT,QAAA,SAAA1M,GACA,GAAAhH,KAAAkH,QAAAlH,KAAAkH,OAAAF,aAAA6C,EACA,OAAA7J,KAAAkH,OAAAF,GAAA2B,OACA,MAAA1K,MAAA,iBAAA+I,IAUAkG,EAAAhN,UAAA0N,IAAA,SAAA2E,GAEA,KAAAA,aAAApE,GAAAoE,EAAAjE,SAAAvT,IAAAwX,aAAAnE,GAAAmE,aAAA1I,GAAA0I,aAAAvB,GAAAuB,aAAArF,GACA,MAAAG,UAAA,wCAEA,GAAArN,KAAAkH,OAEA,CACA,IAAAyM,EAAA3T,KAAA0J,IAAA6I,EAAAvL,MACA,GAAA2M,EAAA,CACA,KAAAA,aAAAzG,GAAAqF,aAAArF,IAAAyG,aAAAvF,GAAAuF,aAAA3C,EAWA,MAAA/S,MAAA,mBAAAsU,EAAAvL,KAAA,QAAAhH,MARA,IADA,IAAAkH,EAAAyM,EAAAL,YACAxW,EAAA,EAAAA,EAAAoK,EAAArL,SAAAiB,EACAyV,EAAA3E,IAAA1G,EAAApK,IACAkD,KAAAkO,OAAAyF,GACA3T,KAAAkH,SACAlH,KAAAkH,OAAA,IACAqL,EAAAqB,WAAAD,EAAA5S,SAAA,SAZAf,KAAAkH,OAAA,GAoBA,OAFAlH,KAAAkH,OAAAqL,EAAAvL,MAAAuL,GACAsB,MAAA7T,MACAkT,EAAAlT,OAUAkN,EAAAhN,UAAAgO,OAAA,SAAAqE,GAEA,KAAAA,aAAAzF,GACA,MAAAO,UAAA,qCACA,GAAAkF,EAAAnD,SAAApP,KACA,MAAA/B,MAAAsU,EAAA,uBAAAvS,MAOA,cALAA,KAAAkH,OAAAqL,EAAAvL,MACAjI,OAAAC,KAAAgB,KAAAkH,QAAArL,SACAmE,KAAAkH,OAAAnM,IAEAwX,EAAAuB,SAAA9T,MACAkT,EAAAlT,OASAkN,EAAAhN,UAAA6T,OAAA,SAAAxO,EAAA0B,GAEA,GAAA6C,EAAA+D,SAAAtI,GACAA,EAAAA,EAAAG,MAAA,UACA,IAAA/J,MAAAqY,QAAAzO,GACA,MAAA8H,UAAA,gBACA,GAAA9H,GAAAA,EAAA1J,QAAA,KAAA0J,EAAA,GACA,MAAAtH,MAAA,yBAGA,IADA,IAAAgW,EAAAjU,KACA,EAAAuF,EAAA1J,QAAA,CACA,IAAAqY,EAAA3O,EAAAM,QACA,GAAAoO,EAAA/M,QAAA+M,EAAA/M,OAAAgN,IAEA,MADAD,EAAAA,EAAA/M,OAAAgN,cACAhH,GACA,MAAAjP,MAAA,kDAEAgW,EAAArG,IAAAqG,EAAA,IAAA/G,EAAAgH,IAIA,OAFAjN,GACAgN,EAAAb,QAAAnM,GACAgN,GAOA/G,EAAAhN,UAAAiU,WAAA,WAEA,IADA,IAAAjN,EAAAlH,KAAAsT,YAAAxW,EAAA,EACAA,EAAAoK,EAAArL,QACAqL,EAAApK,aAAAoQ,EACAhG,EAAApK,KAAAqX,aAEAjN,EAAApK,KAAAZ,UACA,OAAA8D,KAAA9D,WAUAgR,EAAAhN,UAAAkU,OAAA,SAAA7O,EAAA8O,EAAAC,GASA,GANA,kBAAAD,GACAC,EAAAD,EACAA,EAAAtZ,IACAsZ,IAAA1Y,MAAAqY,QAAAK,KACAA,EAAA,CAAAA,IAEAvK,EAAA+D,SAAAtI,IAAAA,EAAA1J,OAAA,CACA,GAAA,MAAA0J,EACA,OAAAvF,KAAAwQ,KACAjL,EAAAA,EAAAG,MAAA,UACA,IAAAH,EAAA1J,OACA,OAAAmE,KAGA,GAAA,KAAAuF,EAAA,GACA,OAAAvF,KAAAwQ,KAAA4D,OAAA7O,EAAA5H,MAAA,GAAA0W,GAGA,IAAAE,EAAAvU,KAAA0J,IAAAnE,EAAA,IACA,GAAAgP,GACA,GAAA,IAAAhP,EAAA1J,QACA,IAAAwY,IAAAA,EAAArI,QAAAuI,EAAAvH,aACA,OAAAuH,OACA,GAAAA,aAAArH,IAAAqH,EAAAA,EAAAH,OAAA7O,EAAA5H,MAAA,GAAA0W,GAAA,IACA,OAAAE,OAIA,IAAA,IAAAzX,EAAA,EAAAA,EAAAkD,KAAAsT,YAAAzX,SAAAiB,EACA,GAAAkD,KAAAiT,EAAAnW,aAAAoQ,IAAAqH,EAAAvU,KAAAiT,EAAAnW,GAAAsX,OAAA7O,EAAA8O,GAAA,IACA,OAAAE,EAGA,OAAA,OAAAvU,KAAAoP,QAAAkF,EACA,KACAtU,KAAAoP,OAAAgF,OAAA7O,EAAA8O,IAqBAnH,EAAAhN,UAAA2S,WAAA,SAAAtN,GACA,IAAAgP,EAAAvU,KAAAoU,OAAA7O,EAAA,CAAA6I,IACA,IAAAmG,EACA,MAAAtW,MAAA,iBAAAsH,GACA,OAAAgP,GAUArH,EAAAhN,UAAAsU,WAAA,SAAAjP,GACA,IAAAgP,EAAAvU,KAAAoU,OAAA7O,EAAA,CAAAsE,IACA,IAAA0K,EACA,MAAAtW,MAAA,iBAAAsH,EAAA,QAAAvF,MACA,OAAAuU,GAUArH,EAAAhN,UAAAmP,iBAAA,SAAA9J,GACA,IAAAgP,EAAAvU,KAAAoU,OAAA7O,EAAA,CAAA6I,EAAAvE,IACA,IAAA0K,EACA,MAAAtW,MAAA,yBAAAsH,EAAA,QAAAvF,MACA,OAAAuU,GAUArH,EAAAhN,UAAAuU,cAAA,SAAAlP,GACA,IAAAgP,EAAAvU,KAAAoU,OAAA7O,EAAA,CAAAyL,IACA,IAAAuD,EACA,MAAAtW,MAAA,oBAAAsH,EAAA,QAAAvF,MACA,OAAAuU,GAIArH,EAAAkD,EAAA,SAAAC,EAAAqE,EAAAC,GACAvG,EAAAiC,EACAW,EAAA0D,EACA7K,EAAA8K,4CC9aArZ,EAAAC,QAAAuR,GAEAG,UAAA,mBAEA,IAEAwD,EAFA3G,EAAAzO,EAAA,IAYA,SAAAyR,EAAA9F,EAAAjG,GAEA,IAAA+I,EAAA+D,SAAA7G,GACA,MAAAqG,UAAA,yBAEA,GAAAtM,IAAA+I,EAAAyE,SAAAxN,GACA,MAAAsM,UAAA,6BAMArN,KAAAe,QAAAA,EAMAf,KAAA4U,cAAA,KAMA5U,KAAAgH,KAAAA,EAMAhH,KAAAoP,OAAA,KAMApP,KAAAmP,UAAA,EAMAnP,KAAAmN,QAAA,KAMAnN,KAAAc,SAAA,KAGA/B,OAAA8V,iBAAA/H,EAAA5M,UAAA,CAQAsQ,KAAA,CACA9G,IAAA,WAEA,IADA,IAAAuK,EAAAjU,KACA,OAAAiU,EAAA7E,QACA6E,EAAAA,EAAA7E,OACA,OAAA6E,IAUA1J,SAAA,CACAb,IAAA,WAGA,IAFA,IAAAnE,EAAA,CAAAvF,KAAAgH,MACAiN,EAAAjU,KAAAoP,OACA6E,GACA1O,EAAAuP,QAAAb,EAAAjN,MACAiN,EAAAA,EAAA7E,OAEA,OAAA7J,EAAA3H,KAAA,SAUAkP,EAAA5M,UAAAuN,OAAA,WACA,MAAAxP,SAQA6O,EAAA5M,UAAA2T,MAAA,SAAAzE,GACApP,KAAAoP,QAAApP,KAAAoP,SAAAA,GACApP,KAAAoP,OAAAlB,OAAAlO,MACAA,KAAAoP,OAAAA,EACApP,KAAAmP,UAAA,EACA,IAAAqB,EAAApB,EAAAoB,KACAA,aAAAC,GACAD,EAAAuE,EAAA/U,OAQA8M,EAAA5M,UAAA4T,SAAA,SAAA1E,GACA,IAAAoB,EAAApB,EAAAoB,KACAA,aAAAC,GACAD,EAAAwE,EAAAhV,MACAA,KAAAoP,OAAA,KACApP,KAAAmP,UAAA,GAOArC,EAAA5M,UAAAhE,QAAA,WACA,OAAA8D,KAAAmP,UAEAnP,KAAAwQ,gBAAAC,IACAzQ,KAAAmP,UAAA,GAFAnP,MAWA8M,EAAA5M,UAAA8O,UAAA,SAAAhI,GACA,OAAAhH,KAAAe,QACAf,KAAAe,QAAAiG,GACAjM,IAUA+R,EAAA5M,UAAA+O,UAAA,SAAAjI,EAAAtH,EAAAwP,GAGA,OAFAA,GAAAlP,KAAAe,SAAAf,KAAAe,QAAAiG,KAAAjM,MACAiF,KAAAe,UAAAf,KAAAe,QAAA,KAAAiG,GAAAtH,GACAM,MAUA8M,EAAA5M,UAAA+U,gBAAA,SAAAjO,EAAAtH,EAAAwV,GACAlV,KAAA4U,gBACA5U,KAAA4U,cAAA,IAEA,IAAAA,EAAA5U,KAAA4U,cACA,GAAAM,EAAA,CAGA,IAAAC,EAAAP,EAAAQ,KAAA,SAAAD,GACA,OAAApW,OAAAmB,UAAAmV,eAAA/O,KAAA6O,EAAAnO,KAEA,GAAAmO,EAAA,CAEA,IAAAG,EAAAH,EAAAnO,GACA8C,EAAAyL,YAAAD,EAAAJ,EAAAxV,QAGAyV,EAAA,IACAnO,GAAA8C,EAAAyL,YAAA,GAAAL,EAAAxV,GACAkV,EAAApX,KAAA2X,OAEA,CAEA,IAAAK,EAAA,GACAA,EAAAxO,GAAAtH,EACAkV,EAAApX,KAAAgY,GAEA,OAAAxV,MASA8M,EAAA5M,UAAA0T,WAAA,SAAA7S,EAAAmO,GACA,GAAAnO,EACA,IAAA,IAAA/B,EAAAD,OAAAC,KAAA+B,GAAAjE,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAkD,KAAAiP,UAAAjQ,EAAAlC,GAAAiE,EAAA/B,EAAAlC,IAAAoS,GACA,OAAAlP,MAOA8M,EAAA5M,UAAAxB,SAAA,WACA,IAAAuO,EAAAjN,KAAAgN,YAAAC,UACA1C,EAAAvK,KAAAuK,SACA,OAAAA,EAAA1O,OACAoR,EAAA,IAAA1C,EACA0C,GAIAH,EAAAsD,EAAA,SAAAqF,GACAhF,EAAAgF,+BChPAna,EAAAC,QAAAuV,EAGA,IAAAhE,EAAAzR,EAAA,MACAyV,EAAA5Q,UAAAnB,OAAAgO,OAAAD,EAAA5M,YAAA8M,YAAA8D,GAAA7D,UAAA,QAEA,IAAAkB,EAAA9S,EAAA,IACAyO,EAAAzO,EAAA,IAYA,SAAAyV,EAAA9J,EAAA0O,EAAA3U,EAAAoM,GAQA,GAPAxR,MAAAqY,QAAA0B,KACA3U,EAAA2U,EACAA,EAAA3a,IAEA+R,EAAAxG,KAAAtG,KAAAgH,EAAAjG,GAGA2U,IAAA3a,KAAAY,MAAAqY,QAAA0B,GACA,MAAArI,UAAA,+BAMArN,KAAAmI,MAAAuN,GAAA,GAOA1V,KAAA4K,YAAA,GAMA5K,KAAAmN,QAAAA,EA0CA,SAAAwI,EAAAxN,GACA,GAAAA,EAAAiH,OACA,IAAA,IAAAtS,EAAA,EAAAA,EAAAqL,EAAAyC,YAAA/O,SAAAiB,EACAqL,EAAAyC,YAAA9N,GAAAsS,QACAjH,EAAAiH,OAAAxB,IAAAzF,EAAAyC,YAAA9N,IA7BAgU,EAAAvD,SAAA,SAAAvG,EAAAC,GACA,OAAA,IAAA6J,EAAA9J,EAAAC,EAAAkB,MAAAlB,EAAAlG,QAAAkG,EAAAkG,UAQA2D,EAAA5Q,UAAAuN,OAAA,SAAAC,GACA,IAAAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,UAAA/K,KAAAe,QACA,QAAAf,KAAAmI,MACA,UAAAwF,EAAA3N,KAAAmN,QAAApS,MAuBA+V,EAAA5Q,UAAA0N,IAAA,SAAA3D,GAGA,KAAAA,aAAAkE,GACA,MAAAd,UAAA,yBAQA,OANApD,EAAAmF,QAAAnF,EAAAmF,SAAApP,KAAAoP,QACAnF,EAAAmF,OAAAlB,OAAAjE,GACAjK,KAAAmI,MAAA3K,KAAAyM,EAAAjD,MACAhH,KAAA4K,YAAApN,KAAAyM,GAEA0L,EADA1L,EAAAoB,OAAArL,MAEAA,MAQA8Q,EAAA5Q,UAAAgO,OAAA,SAAAjE,GAGA,KAAAA,aAAAkE,GACA,MAAAd,UAAA,yBAEA,IAAAtR,EAAAiE,KAAA4K,YAAAoB,QAAA/B,GAGA,GAAAlO,EAAA,EACA,MAAAkC,MAAAgM,EAAA,uBAAAjK,MAUA,OARAA,KAAA4K,YAAArK,OAAAxE,EAAA,IAIA,GAHAA,EAAAiE,KAAAmI,MAAA6D,QAAA/B,EAAAjD,QAIAhH,KAAAmI,MAAA5H,OAAAxE,EAAA,GAEAkO,EAAAoB,OAAA,KACArL,MAMA8Q,EAAA5Q,UAAA2T,MAAA,SAAAzE,GACAtC,EAAA5M,UAAA2T,MAAAvN,KAAAtG,KAAAoP,GAGA,IAFA,IAEAtS,EAAA,EAAAA,EAAAkD,KAAAmI,MAAAtM,SAAAiB,EAAA,CACA,IAAAmN,EAAAmF,EAAA1F,IAAA1J,KAAAmI,MAAArL,IACAmN,IAAAA,EAAAoB,SACApB,EAAAoB,OALArL,MAMA4K,YAAApN,KAAAyM,GAIA0L,EAAA3V,OAMA8Q,EAAA5Q,UAAA4T,SAAA,SAAA1E,GACA,IAAA,IAAAnF,EAAAnN,EAAA,EAAAA,EAAAkD,KAAA4K,YAAA/O,SAAAiB,GACAmN,EAAAjK,KAAA4K,YAAA9N,IAAAsS,QACAnF,EAAAmF,OAAAlB,OAAAjE,GACA6C,EAAA5M,UAAA4T,SAAAxN,KAAAtG,KAAAoP,IAmBA0B,EAAAlB,EAAA,WAGA,IAFA,IAAA8F,EAAA/Z,MAAAC,UAAAC,QACAE,EAAA,EACAA,EAAAH,UAAAC,QACA6Z,EAAA3Z,GAAAH,UAAAG,KACA,OAAA,SAAAmE,EAAA0V,GACA9L,EAAAkG,aAAA9P,EAAA8M,aACAY,IAAA,IAAAkD,EAAA8E,EAAAF,IACA3W,OAAAgQ,eAAA7O,EAAA0V,EAAA,CACAlM,IAAAI,EAAA+L,YAAAH,GACAI,IAAAhM,EAAAiM,YAAAL,gDCtMApa,EAAAC,QAAAqW,IAEA9Q,SAAA,KACA8Q,GAAAvF,SAAA,CAAA2J,UAAA,GAEA,IAAArE,EAAAtW,EAAA,IACAoV,EAAApV,EAAA,IACA+S,EAAA/S,EAAA,IACA8S,EAAA9S,EAAA,IACA0V,EAAA1V,EAAA,IACAyV,EAAAzV,EAAA,IACAwO,EAAAxO,EAAA,IACA2V,EAAA3V,EAAA,IACA4V,EAAA5V,EAAA,IACA+Q,EAAA/Q,EAAA,IACAyO,EAAAzO,EAAA,IAEA4a,EAAA,gBACAC,EAAA,kBACAC,EAAA,qBACAC,EAAA,uBACAC,EAAA,YACAC,EAAA,cACAC,EAAA,oDACAC,EAAA,2BACAC,EAAA,+DACAC,EAAA,kCAmCA,SAAA9E,GAAAnT,EAAA+R,EAAAzP,GAEAyP,aAAAC,IACA1P,EAAAyP,EACAA,EAAA,IAAAC,GAKA,IASAkG,EACAC,EACAC,EACAC,EAynBAC,EAroBAC,GAFAjW,EADAA,GACA6Q,GAAAvF,UAEA2K,wBAAA,EACAC,EAAAtF,EAAAlT,EAAAsC,EAAAmW,uBAAA,GACAC,EAAAF,EAAAE,KACA3Z,EAAAyZ,EAAAzZ,KACA4Z,EAAAH,EAAAG,KACAC,EAAAJ,EAAAI,KACAC,EAAAL,EAAAK,KAEAC,GAAA,EAKAC,GAAA,EAEAvD,EAAAzD,EAEAiH,EAAA1W,EAAAiV,SAAA,SAAAhP,GAAA,OAAAA,GAAA8C,EAAA4N,UAGA,SAAAC,EAAAZ,EAAA/P,EAAA4Q,GACA,IAAA9W,EAAA8Q,GAAA9Q,SAGA,OAFA8W,IACAhG,GAAA9Q,SAAA,MACA7C,MAAA,YAAA+I,GAAA,SAAA,KAAA+P,EAAA,OAAAjW,EAAAA,EAAA,KAAA,IAAA,QAAAmW,EAAAY,KAAA,KAGA,SAAAC,IACA,IACAf,EADApO,EAAA,GAEA,EAAA,CAEA,GAAA,OAAAoO,EAAAI,MAAA,MAAAJ,EACA,MAAAY,EAAAZ,GAEApO,EAAAnL,KAAA2Z,KACAE,EAAAN,GACAA,EAAAK,UACA,MAAAL,GAAA,MAAAA,GACA,OAAApO,EAAA/K,KAAA,IAGA,SAAAma,EAAAC,GACA,IAAAjB,EAAAI,IACA,OAAAJ,GACA,IAAA,IACA,IAAA,IAEA,OADAvZ,EAAAuZ,GACAe,IACA,IAAA,OAAA,IAAA,OACA,OAAA,EACA,IAAA,QAAA,IAAA,QACA,OAAA,EAEA,IACA,OAuBA,SAAAf,EAAAa,GACA,IAAAtV,EAAA,EACA,KAAAyU,EAAA,KACAzU,GAAA,EACAyU,EAAAA,EAAAkB,UAAA,IAEA,OAAAlB,GACA,IAAA,MAAA,IAAA,MAAA,IAAA,MACA,OAAAzU,GAAAW,EAAAA,GACA,IAAA,MAAA,IAAA,MAAA,IAAA,MAAA,IAAA,MACA,OAAAD,IACA,IAAA,IACA,OAAA,EAEA,GAAAiT,EAAA/X,KAAA6Y,GACA,OAAAzU,EAAA4V,SAAAnB,EAAA,IACA,GAAAZ,EAAAjY,KAAA6Y,GACA,OAAAzU,EAAA4V,SAAAnB,EAAA,IACA,GAAAV,EAAAnY,KAAA6Y,GACA,OAAAzU,EAAA4V,SAAAnB,EAAA,GAGA,GAAAR,EAAArY,KAAA6Y,GACA,OAAAzU,EAAA6V,WAAApB,GAGA,MAAAY,EAAAZ,EAAA,SAAAa,GAjDAQ,CAAArB,GAAA,GACA,MAAAzR,GAGA,GAAA0S,GAAAvB,EAAAvY,KAAA6Y,GACA,OAAAA,EAGA,MAAAY,EAAAZ,EAAA,UAIA,SAAAsB,EAAAC,EAAAC,GAEA,IADA,IAAAxB,EAAA9Z,GAEAsb,GAAA,OAAAxB,EAAAK,MAAA,MAAAL,EAGAuB,EAAA9a,KAAA,CAAAP,EAAAub,EAAArB,KAAAE,EAAA,MAAA,GAAAmB,EAAArB,KAAAla,IAFAqb,EAAA9a,KAAAsa,KAGAT,EAAA,KAAA,KACAA,EAAA,KAgCA,SAAAmB,EAAAzB,EAAA0B,GACA,OAAA1B,GACA,IAAA,MAAA,IAAA,MAAA,IAAA,MACA,OAAA,UACA,IAAA,IACA,OAAA,EAIA,IAAA0B,GAAA,KAAA1B,EAAA,GACA,MAAAY,EAAAZ,EAAA,MAEA,GAAAb,EAAAhY,KAAA6Y,GACA,OAAAmB,SAAAnB,EAAA,IACA,GAAAX,EAAAlY,KAAA6Y,GACA,OAAAmB,SAAAnB,EAAA,IAGA,GAAAT,EAAApY,KAAA6Y,GACA,OAAAmB,SAAAnB,EAAA,GAGA,MAAAY,EAAAZ,EAAA,MAGA,SAAA2B,IAGA,GAAA/B,IAAA5b,GACA,MAAA4c,EAAA,WAKA,GAHAhB,EAAAQ,KAGAV,EAAAvY,KAAAyY,GACA,MAAAgB,EAAAhB,EAAA,QAEA1C,EAAAA,EAAAF,OAAA4C,GACAU,EAAA,KAGA,SAAAsB,IACA,IACAC,EADA7B,EAAAK,IAEA,OAAAL,GACA,IAAA,OACA6B,EAAA/B,EAAAA,GAAA,GACAM,IACA,MACA,IAAA,SACAA,IAEA,QACAyB,EAAAhC,EAAAA,GAAA,GAGAG,EAAAe,IACAT,EAAA,KACAuB,EAAApb,KAAAuZ,GAGA,SAAA8B,IAMA,GALAxB,EAAA,KACAP,EAAAgB,MACAN,EAAA,WAAAV,IAGA,WAAAA,EACA,MAAAa,EAAAb,EAAA,UAEAO,EAAA,KAGA,SAAAyB,EAAA1J,EAAA2H,GACA,OAAAA,GAEA,IAAA,SAGA,OAFAgC,EAAA3J,EAAA2H,GACAM,EAAA,KACA,EAEA,IAAA,UAEA,OAuCA,SAAAjI,EAAA2H,GAGA,IAAAP,EAAAtY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,aAEA,IAAAxP,EAAA,IAAA6G,EAAA2I,GACAiC,EAAAzR,EAAA,SAAAwP,GACA,IAAA+B,EAAAvR,EAAAwP,GAGA,OAAAA,GAEA,IAAA,OAoHA,SAAA3H,GACAiI,EAAA,KACA,IAAAtP,EAAAoP,IAGA,GAAA/K,EAAAO,OAAA5E,KAAAhN,GACA,MAAA4c,EAAA5P,EAAA,QAEAsP,EAAA,KACA,IAAA4B,EAAA9B,IAGA,IAAAV,EAAAvY,KAAA+a,GACA,MAAAtB,EAAAsB,EAAA,QAEA5B,EAAA,KACA,IAAArQ,EAAAmQ,IAGA,IAAAX,EAAAtY,KAAA8I,GACA,MAAA2Q,EAAA3Q,EAAA,QAEAqQ,EAAA,KACA,IAAApN,EAAA,IAAA8G,EAAA0G,EAAAzQ,GAAAwR,EAAArB,KAAApP,EAAAkR,GACAD,EAAA/O,EAAA,SAAA8M,GAGA,GAAA,WAAAA,EAIA,MAAAY,EAAAZ,GAHAgC,EAAA9O,EAAA8M,GACAM,EAAA,MAIA,WACA6B,EAAAjP,KAEAmF,EAAAxB,IAAA3D,GAvJAkP,CAAA5R,GACA,MAEA,IAAA,WACA,IAAA,WACA,IAAA,WACA6R,EAAA7R,EAAAwP,GACA,MAEA,IAAA,SAiJA,SAAA3H,EAAA2H,GAGA,IAAAP,EAAAtY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,QAEA,IAAA5O,EAAA,IAAA2I,EAAA2G,EAAAV,IACAiC,EAAA7Q,EAAA,SAAA4O,GACA,WAAAA,GACAgC,EAAA5Q,EAAA4O,GACAM,EAAA,OAEA7Z,EAAAuZ,GACAqC,EAAAjR,EAAA,eAGAiH,EAAAxB,IAAAzF,GAhKAkR,CAAA9R,EAAAwP,GACA,MAEA,IAAA,aACAsB,EAAA9Q,EAAA+R,aAAA/R,EAAA+R,WAAA,KACA,MAEA,IAAA,WACAjB,EAAA9Q,EAAA+F,WAAA/F,EAAA+F,SAAA,KAAA,GACA,MAEA,QAEA,IAAAkK,IAAAf,EAAAvY,KAAA6Y,GACA,MAAAY,EAAAZ,GAEAvZ,EAAAuZ,GACAqC,EAAA7R,EAAA,eAIA6H,EAAAxB,IAAArG,GArFAgS,CAAAnK,EAAA2H,GACA,EAEA,IAAA,OAEA,OA8NA,SAAA3H,EAAA2H,GAGA,IAAAP,EAAAtY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,QAEA,IAAAvJ,EAAA,IAAA3D,EAAAkN,GACAiC,EAAAxL,EAAA,SAAAuJ,GACA,OAAAA,GACA,IAAA,SACAgC,EAAAvL,EAAAuJ,GACAM,EAAA,KACA,MAEA,IAAA,WACAgB,EAAA7K,EAAAF,WAAAE,EAAAF,SAAA,KAAA,GACA,MAEA,SAOA,SAAA8B,EAAA2H,GAGA,IAAAP,EAAAtY,KAAA6Y,GACA,MAAAY,EAAAZ,EAAA,QAEAM,EAAA,KACA,IAAA3X,EAAA8Y,EAAArB,KAAA,GACAqC,EAAA,GACAR,EAAAQ,EAAA,SAAAzC,GAGA,GAAA,WAAAA,EAIA,MAAAY,EAAAZ,GAHAgC,EAAAS,EAAAzC,GACAM,EAAA,MAIA,WACA6B,EAAAM,KAEApK,EAAAxB,IAAAmJ,EAAArX,EAAA8Z,EAAArM,SA3BAsM,CAAAjM,EAAAuJ,MAGA3H,EAAAxB,IAAAJ,GArPAkM,CAAAtK,EAAA2H,GACA,EAEA,IAAA,UAEA,OA8VA,SAAA3H,EAAA2H,GAGA,IAAAP,EAAAtY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,gBAEA,IAAA4C,EAAA,IAAA3I,EAAA+F,GACAiC,EAAAW,EAAA,SAAA5C,GACA,IAAA+B,EAAAa,EAAA5C,GAAA,CAIA,GAAA,QAAAA,EAGA,MAAAY,EAAAZ,IAKA,SAAA3H,EAAA2H,GAGA,IAAA6C,EAAAtC,IAEA/P,EAAAwP,EAGA,IAAAP,EAAAtY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,QAEA,IACAvE,EAAAC,EACA5Q,EAAA6Q,EAFA1L,EAAA+P,EAIAM,EAAA,KACAA,EAAA,UAAA,KACA5E,GAAA,GAGA,IAAAgE,EAAAvY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,GAEAvE,EAAAuE,EACAM,EAAA,KAAAA,EAAA,WAAAA,EAAA,KACAA,EAAA,UAAA,KACA3E,GAAA,GAGA,IAAA+D,EAAAvY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,GAEAlV,EAAAkV,EACAM,EAAA,KAEA,IAAAwC,EAAA,IAAA5I,EAAAjK,EAAAO,EAAAiL,EAAA3Q,EAAA4Q,EAAAC,GACAmH,EAAA1M,QAAAyM,EACAZ,EAAAa,EAAA,SAAA9C,GAGA,GAAA,WAAAA,EAIA,MAAAY,EAAAZ,GAHAgC,EAAAc,EAAA9C,GACAM,EAAA,OAKAjI,EAAAxB,IAAAiM,GAtDAC,CAAAH,EAAA5C,MAIA3H,EAAAxB,IAAA+L,GAhXAI,CAAA3K,EAAA2H,GACA,EAEA,IAAA,SAEA,OAgaA,SAAA3H,EAAA2H,GAGA,IAAAN,EAAAvY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,aAEA,IAAAiD,EAAAjD,EACAiC,EAAA,KAAA,SAAAjC,GACA,OAAAA,GAEA,IAAA,WACA,IAAA,WACA,IAAA,WACAqC,EAAAhK,EAAA2H,EAAAiD,GACA,MAEA,QAEA,IAAAxC,IAAAf,EAAAvY,KAAA6Y,GACA,MAAAY,EAAAZ,GACAvZ,EAAAuZ,GACAqC,EAAAhK,EAAA,WAAA4K,MAtbAC,CAAA7K,EAAA2H,GACA,GAKA,SAAAiC,EAAAhG,EAAAkH,EAAAC,GACA,IAAAC,EAAAnD,EAAAY,KAOA,GANA7E,IACA,iBAAAA,EAAA7F,UACA6F,EAAA7F,QAAAmK,KAEAtE,EAAAlS,SAAA8Q,GAAA9Q,UAEAuW,EAAA,KAAA,GAAA,CAEA,IADA,IAAAN,EACA,OAAAA,EAAAI,MACA+C,EAAAnD,GACAM,EAAA,KAAA,QAEA8C,GACAA,IACA9C,EAAA,KACArE,IAAA,iBAAAA,EAAA7F,SAAA6J,KACAhE,EAAA7F,QAAAmK,EAAA8C,IAAApH,EAAA7F,SAoDA,SAAAiM,EAAAhK,EAAAtG,EAAAwF,GACA,IAAA/G,EAAA4P,IACA,GAAA,UAAA5P,EAAA,CAMA,IAAAkP,EAAAvY,KAAAqJ,GACA,MAAAoQ,EAAApQ,EAAA,QAEA,IAAAP,EAAAmQ,IAGA,IAAAX,EAAAtY,KAAA8I,GACA,MAAA2Q,EAAA3Q,EAAA,QAEAA,EAAAyQ,EAAAzQ,GACAqQ,EAAA,KAEA,IAAApN,EAAA,IAAAkE,EAAAnH,EAAAwR,EAAArB,KAAA5P,EAAAuB,EAAAwF,GACA0K,EAAA/O,EAAA,SAAA8M,GAGA,GAAA,WAAAA,EAIA,MAAAY,EAAAZ,GAHAgC,EAAA9O,EAAA8M,GACAM,EAAA,MAIA,WACA6B,EAAAjP,KAEAmF,EAAAxB,IAAA3D,GAKAuN,IAAAvN,EAAAI,UAAA+B,EAAAG,OAAAhF,KAAAxM,IAAAqR,EAAAE,MAAA/E,KAAAxM,IACAkP,EAAAgF,UAAA,UAAA,GAAA,QAGA,SAAAG,EAAAtG,GACA,IAAA9B,EAAAmQ,IAGA,IAAAX,EAAAtY,KAAA8I,GACA,MAAA2Q,EAAA3Q,EAAA,QAEA,IAAAkJ,EAAApG,EAAAuQ,QAAArT,GACAA,IAAAkJ,IACAlJ,EAAA8C,EAAAwQ,QAAAtT,IACAqQ,EAAA,KACA,IAAA7P,EAAAgR,EAAArB,KACA5P,EAAA,IAAA6G,EAAApH,GACAO,EAAA2E,OAAA,EACA,IAAAjC,EAAA,IAAAkE,EAAA+B,EAAA1I,EAAAR,EAAA8B,GACAmB,EAAAnJ,SAAA8Q,GAAA9Q,SACAkY,EAAAzR,EAAA,SAAAwP,GACA,OAAAA,GAEA,IAAA,SACAgC,EAAAxR,EAAAwP,GACAM,EAAA,KACA,MAEA,IAAA,WACA,IAAA,WACA,IAAA,WACA+B,EAAA7R,EAAAwP,GACA,MAGA,QACA,MAAAY,EAAAZ,MAGA3H,EAAAxB,IAAArG,GACAqG,IAAA3D,GA3EAsQ,CAAAnL,EAAAtG,GAyLA,SAAAiQ,EAAA3J,EAAA2H,GACA,IAAAyD,EAAAnD,EAAA,KAAA,GAGA,IAAAZ,EAAAvY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,QAEA,IAEA7B,EAFAlO,EAAA+P,EACA0D,EAAAzT,EAGAwT,IACAnD,EAAA,KAEAoD,EADAzT,EAAA,IAAAA,EAAA,IAEA+P,EAAAK,IACAV,EAAAxY,KAAA6Y,KACA7B,EAAA6B,EAAA2D,OAAA,GACA1T,GAAA+P,EACAI,MAGAE,EAAA,KACA,IA6CAjI,EAAApI,EAAAtH,EAAAwV,EA7CAyF,EAIA,SAAAC,EAAAxL,EAAApI,GACA,GAAAqQ,EAAA,KAAA,GAAA,CAEA,IADA,IAAAwD,EAAA,IACAxD,EAAA,KAAA,IAAA,CAEA,IAAAb,EAAAtY,KAAA6Y,EAAAI,KACA,MAAAQ,EAAAZ,EAAA,QAEA,IAAArX,EACAwV,EAAA6B,EACA,MAAAK,IACA1X,EAAAkb,EAAAxL,EAAApI,EAAA,IAAA+P,IAEAM,EAAA,KACA,MAAAD,IACA1X,EAAAkb,EAAAxL,EAAApI,EAAA,IAAA+P,IAEArX,EAAAqY,GAAA,GACA9I,EAAAG,EAAApI,EAAA,IAAA+P,EAAArX,KAGA,IAAAob,EAAAD,EAAA3F,GACA4F,IACApb,EAAA,GAAAqb,OAAAD,GAAAC,OAAArb,IACAmb,EAAA3F,GAAAxV,EACA2X,EAAA,KAAA,GAEA,OAAAwD,EAGA,IAAAG,EAAAjD,GAAA,GACA9I,EAAAG,EAAApI,EAAAgU,GACA,OAAAA,EApCAJ,CAAAxL,EAAApI,GA6CAA,EA5CAyT,EA4CA/a,EA5CAib,EA4CAzF,EA5CAA,GA4CA9F,EA5CAA,GA6CA6F,iBACA7F,EAAA6F,gBAAAjO,EAAAtH,EAAAwV,GAPA,SAAAjG,EAAAG,EAAApI,EAAAtH,GACA0P,EAAAH,WACAG,EAAAH,UAAAjI,EAAAtH,GAQA,SAAAwZ,EAAA9J,GACA,GAAAiI,EAAA,KAAA,GAAA,CACA,KACA0B,EAAA3J,EAAA,UACAiI,EAAA,KAAA,KACAA,EAAA,KAEA,OAAAjI,EAqGA,KAAA,QAAA2H,EAAAI,MACA,OAAAJ,GAEA,IAAA,UAGA,IAAAQ,EACA,MAAAI,EAAAZ,GAEA2B,IACA,MAEA,IAAA,SAGA,IAAAnB,EACA,MAAAI,EAAAZ,GAEA4B,IACA,MAEA,IAAA,SAGA,IAAApB,EACA,MAAAI,EAAAZ,GAEA8B,IACA,MAEA,IAAA,SAEAE,EAAA9E,EAAA8C,GACAM,EAAA,KACA,MAEA,QAGA,GAAAyB,EAAA7E,EAAA8C,GAAA,CACAQ,GAAA,EACA,SAIA,MAAAI,EAAAZ,GAKA,OADAnF,GAAA9Q,SAAA,KACA,CACAma,QAAAtE,EACAC,QAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAtG,KAAAA,4FCnwBAlV,EAAAC,QAAAgW,EAEA,IAEAC,EAFA1H,EAAAzO,EAAA,IAIA6f,EAAApR,EAAAoR,SACA3U,EAAAuD,EAAAvD,KAGA,SAAA4U,EAAA/I,EAAAgJ,GACA,OAAAC,WAAA,uBAAAjJ,EAAA/P,IAAA,OAAA+Y,GAAA,GAAA,MAAAhJ,EAAA5L,KASA,SAAA+K,EAAAvU,GAMAgD,KAAAoC,IAAApF,EAMAgD,KAAAqC,IAAA,EAMArC,KAAAwG,IAAAxJ,EAAAnB,OAgBA,SAAAkR,IACA,OAAAjD,EAAAwR,OACA,SAAAte,GACA,OAAAuU,EAAAxE,OAAA,SAAA/P,GACA,OAAA8M,EAAAwR,OAAAC,SAAAve,GACA,IAAAwU,EAAAxU,GAEAwe,EAAAxe,KACAA,IAGAwe,EAxBA,IA4CA9b,EA5CA8b,EAAA,oBAAA7Z,WACA,SAAA3E,GACA,GAAAA,aAAA2E,YAAAhG,MAAAqY,QAAAhX,GACA,OAAA,IAAAuU,EAAAvU,GACA,MAAAiB,MAAA,mBAGA,SAAAjB,GACA,GAAArB,MAAAqY,QAAAhX,GACA,OAAA,IAAAuU,EAAAvU,GACA,MAAAiB,MAAA,mBAsEA,SAAAwd,IAEA,IAAAC,EAAA,IAAAR,EAAA,EAAA,GACApe,EAAA,EACA,KAAA,EAAAkD,KAAAwG,IAAAxG,KAAAqC,KAaA,CACA,KAAAvF,EAAA,IAAAA,EAAA,CAEA,GAAAkD,KAAAqC,KAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,MAGA,GADA0b,EAAA5X,IAAA4X,EAAA5X,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAAqZ,EAIA,OADAA,EAAA5X,IAAA4X,EAAA5X,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,SAAA,EAAAvF,KAAA,EACA4e,EAxBA,KAAA5e,EAAA,IAAAA,EAGA,GADA4e,EAAA5X,IAAA4X,EAAA5X,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAAqZ,EAKA,GAFAA,EAAA5X,IAAA4X,EAAA5X,IAAA,IAAA9D,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EACAqZ,EAAA3X,IAAA2X,EAAA3X,IAAA,IAAA/D,KAAAoC,IAAApC,KAAAqC,OAAA,KAAA,EACArC,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAAqZ,EAgBA,GAfA5e,EAAA,EAeA,EAAAkD,KAAAwG,IAAAxG,KAAAqC,KACA,KAAAvF,EAAA,IAAAA,EAGA,GADA4e,EAAA3X,IAAA2X,EAAA3X,IAAA,IAAA/D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,EAAA,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAAqZ,OAGA,KAAA5e,EAAA,IAAAA,EAAA,CAEA,GAAAkD,KAAAqC,KAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,MAGA,GADA0b,EAAA3X,IAAA2X,EAAA3X,IAAA,IAAA/D,KAAAoC,IAAApC,KAAAqC,OAAA,EAAAvF,EAAA,KAAA,EACAkD,KAAAoC,IAAApC,KAAAqC,OAAA,IACA,OAAAqZ,EAIA,MAAAzd,MAAA,2BAkCA,SAAA0d,EAAAvZ,EAAAlF,GACA,OAAAkF,EAAAlF,EAAA,GACAkF,EAAAlF,EAAA,IAAA,EACAkF,EAAAlF,EAAA,IAAA,GACAkF,EAAAlF,EAAA,IAAA,MAAA,EA+BA,SAAA0e,IAGA,GAAA5b,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,KAAA,GAEA,OAAA,IAAAkb,EAAAS,EAAA3b,KAAAoC,IAAApC,KAAAqC,KAAA,GAAAsZ,EAAA3b,KAAAoC,IAAApC,KAAAqC,KAAA,IA3KAkP,EAAAxE,OAAAA,IAEAwE,EAAArR,UAAA2b,EAAA/R,EAAAnO,MAAAuE,UAAA4b,UAAAhS,EAAAnO,MAAAuE,UAAAvC,MAOA4T,EAAArR,UAAA6b,QACArc,EAAA,WACA,WACA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,QAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,KAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,IAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EACA,GAAAA,GAAAA,GAAA,GAAAM,KAAAoC,IAAApC,KAAAqC,OAAA,MAAA,EAAArC,KAAAoC,IAAApC,KAAAqC,OAAA,IAAA,OAAA3C,EAGA,IAAAM,KAAAqC,KAAA,GAAArC,KAAAwG,IAEA,MADAxG,KAAAqC,IAAArC,KAAAwG,IACA2U,EAAAnb,KAAA,IAEA,OAAAN,IAQA6R,EAAArR,UAAA8b,MAAA,WACA,OAAA,EAAAhc,KAAA+b,UAOAxK,EAAArR,UAAA+b,OAAA,WACA,IAAAvc,EAAAM,KAAA+b,SACA,OAAArc,IAAA,IAAA,EAAAA,GAAA,GAqFA6R,EAAArR,UAAAgc,KAAA,WACA,OAAA,IAAAlc,KAAA+b,UAcAxK,EAAArR,UAAAic,QAAA,WAGA,GAAAnc,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,KAAA,GAEA,OAAA2b,EAAA3b,KAAAoC,IAAApC,KAAAqC,KAAA,IAOAkP,EAAArR,UAAAkc,SAAA,WAGA,GAAApc,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,KAAA,GAEA,OAAA,EAAA2b,EAAA3b,KAAAoC,IAAApC,KAAAqC,KAAA,IAmCAkP,EAAArR,UAAAmc,MAAA,WAGA,GAAArc,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,KAAA,GAEA,IAAAN,EAAAoK,EAAAuS,MAAA9X,YAAAvE,KAAAoC,IAAApC,KAAAqC,KAEA,OADArC,KAAAqC,KAAA,EACA3C,GAQA6R,EAAArR,UAAAoc,OAAA,WAGA,GAAAtc,KAAAqC,IAAA,EAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,KAAA,GAEA,IAAAN,EAAAoK,EAAAuS,MAAApX,aAAAjF,KAAAoC,IAAApC,KAAAqC,KAEA,OADArC,KAAAqC,KAAA,EACA3C,GAOA6R,EAAArR,UAAA0L,MAAA,WACA,IAAA/P,EAAAmE,KAAA+b,SACA9e,EAAA+C,KAAAqC,IACAnF,EAAA8C,KAAAqC,IAAAxG,EAGA,GAAAqB,EAAA8C,KAAAwG,IACA,MAAA2U,EAAAnb,KAAAnE,GAGA,OADAmE,KAAAqC,KAAAxG,EACAF,MAAAqY,QAAAhU,KAAAoC,KACApC,KAAAoC,IAAAzE,MAAAV,EAAAC,GACAD,IAAAC,EACA,IAAA8C,KAAAoC,IAAA4K,YAAA,GACAhN,KAAA6b,EAAAvV,KAAAtG,KAAAoC,IAAAnF,EAAAC,IAOAqU,EAAArR,UAAA3D,OAAA,WACA,IAAAqP,EAAA5L,KAAA4L,QACA,OAAArF,EAAAE,KAAAmF,EAAA,EAAAA,EAAA/P,SAQA0V,EAAArR,UAAAmX,KAAA,SAAAxb,GACA,GAAA,iBAAAA,EAAA,CAEA,GAAAmE,KAAAqC,IAAAxG,EAAAmE,KAAAwG,IACA,MAAA2U,EAAAnb,KAAAnE,GACAmE,KAAAqC,KAAAxG,OAEA,GAEA,GAAAmE,KAAAqC,KAAArC,KAAAwG,IACA,MAAA2U,EAAAnb,YACA,IAAAA,KAAAoC,IAAApC,KAAAqC,QAEA,OAAArC,MAQAuR,EAAArR,UAAAqc,SAAA,SAAA7P,GACA,OAAAA,GACA,KAAA,EACA1M,KAAAqX,OACA,MACA,KAAA,EACArX,KAAAqX,KAAA,GACA,MACA,KAAA,EACArX,KAAAqX,KAAArX,KAAA+b,UACA,MACA,KAAA,EACA,KAAA,IAAArP,EAAA,EAAA1M,KAAA+b,WACA/b,KAAAuc,SAAA7P,GAEA,MACA,KAAA,EACA1M,KAAAqX,KAAA,GACA,MAGA,QACA,MAAApZ,MAAA,qBAAAyO,EAAA,cAAA1M,KAAAqC,KAEA,OAAArC,MAGAuR,EAAAnB,EAAA,SAAAoM,GACAhL,EAAAgL,EACAjL,EAAAxE,OAAAA,IACAyE,EAAApB,IAEA,IAAA5U,EAAAsO,EAAA6E,KAAA,SAAA,WACA7E,EAAA2S,MAAAlL,EAAArR,UAAA,CAEAwc,MAAA,WACA,OAAAjB,EAAAnV,KAAAtG,MAAAxE,IAAA,IAGAmhB,OAAA,WACA,OAAAlB,EAAAnV,KAAAtG,MAAAxE,IAAA,IAGAohB,OAAA,WACA,OAAAnB,EAAAnV,KAAAtG,MAAA6c,WAAArhB,IAAA,IAGAshB,QAAA,WACA,OAAAlB,EAAAtV,KAAAtG,MAAAxE,IAAA,IAGAuhB,SAAA,WACA,OAAAnB,EAAAtV,KAAAtG,MAAAxE,IAAA,mCCrZAF,EAAAC,QAAAiW,EAGA,IAAAD,EAAAlW,EAAA,KACAmW,EAAAtR,UAAAnB,OAAAgO,OAAAwE,EAAArR,YAAA8M,YAAAwE,EAEA,IAAA1H,EAAAzO,EAAA,IASA,SAAAmW,EAAAxU,GACAuU,EAAAjL,KAAAtG,KAAAhD,GASAwU,EAAApB,EAAA,WAEAtG,EAAAwR,SACA9J,EAAAtR,UAAA2b,EAAA/R,EAAAwR,OAAApb,UAAAvC,QAOA6T,EAAAtR,UAAA3D,OAAA,WACA,IAAAiK,EAAAxG,KAAA+b,SACA,OAAA/b,KAAAoC,IAAA4a,UACAhd,KAAAoC,IAAA4a,UAAAhd,KAAAqC,IAAArC,KAAAqC,IAAA3F,KAAAugB,IAAAjd,KAAAqC,IAAAmE,EAAAxG,KAAAwG,MACAxG,KAAAoC,IAAA1D,SAAA,QAAAsB,KAAAqC,IAAArC,KAAAqC,IAAA3F,KAAAugB,IAAAjd,KAAAqC,IAAAmE,EAAAxG,KAAAwG,OAUAgL,EAAApB,sCCjDA9U,EAAAC,QAAAkV,EAGA,IAAAvD,EAAA7R,EAAA,MACAoV,EAAAvQ,UAAAnB,OAAAgO,OAAAG,EAAAhN,YAAA8M,YAAAyD,GAAAxD,UAAA,OAEA,IAKAmB,EACAwD,EACA/K,EAPAsH,EAAA9S,EAAA,IACAwO,EAAAxO,EAAA,IACAyV,EAAAzV,EAAA,IACAyO,EAAAzO,EAAA,IAaA,SAAAoV,EAAA1P,GACAmM,EAAA5G,KAAAtG,KAAA,GAAAe,GAMAf,KAAAkd,SAAA,GAMAld,KAAAmd,MAAA,GAuCA,SAAAC,KA9BA3M,EAAAlD,SAAA,SAAAtG,EAAAuJ,GAKA,OAHAA,EADAA,GACA,IAAAC,EACAxJ,EAAAlG,SACAyP,EAAAoD,WAAA3M,EAAAlG,SACAyP,EAAA4C,QAAAnM,EAAAC,SAWAuJ,EAAAvQ,UAAAmd,YAAAvT,EAAAvE,KAAArJ,QAUAuU,EAAAvQ,UAAAQ,MAAAoJ,EAAApJ,MAaA+P,EAAAvQ,UAAAqQ,KAAA,SAAAA,EAAAzP,EAAAC,EAAAC,GACA,mBAAAD,IACAC,EAAAD,EACAA,EAAAhG,IAEA,IAAAuiB,EAAAtd,KACA,IAAAgB,EACA,OAAA8I,EAAAnJ,UAAA4P,EAAA+M,EAAAxc,EAAAC,GAEA,IAAAwc,EAAAvc,IAAAoc,EAGA,SAAAI,EAAAphB,EAAAoU,GAEA,GAAAxP,EAAA,CAEA,IAAAyc,EAAAzc,EAEA,GADAA,EAAA,KACAuc,EACA,MAAAnhB,EACAqhB,EAAArhB,EAAAoU,IAIA,SAAAkN,EAAA5c,GACA,IAAA6c,EAAA7c,EAAA8c,YAAA,oBACA,IAAA,EAAAD,EAAA,CACA,IAAAE,EAAA/c,EAAAmX,UAAA0F,GACA,GAAAE,KAAAhX,EAAA,OAAAgX,EAEA,OAAA,KAIA,SAAAC,EAAAhd,EAAArC,GACA,IAGA,GAFAqL,EAAA+D,SAAApP,IAAA,KAAAA,EAAA,KACAA,EAAAmB,KAAAgS,MAAAnT,IACAqL,EAAA+D,SAAApP,GAEA,CACAmT,EAAA9Q,SAAAA,EACA,IACAqO,EADA4O,EAAAnM,EAAAnT,EAAA6e,EAAAvc,GAEAjE,EAAA,EACA,GAAAihB,EAAAnH,QACA,KAAA9Z,EAAAihB,EAAAnH,QAAA/a,SAAAiB,GACAqS,EAAAuO,EAAAK,EAAAnH,QAAA9Z,KAAAwgB,EAAAD,YAAAvc,EAAAid,EAAAnH,QAAA9Z,MACA4D,EAAAyO,GACA,GAAA4O,EAAAlH,YACA,IAAA/Z,EAAA,EAAAA,EAAAihB,EAAAlH,YAAAhb,SAAAiB,GACAqS,EAAAuO,EAAAK,EAAAlH,YAAA/Z,KAAAwgB,EAAAD,YAAAvc,EAAAid,EAAAlH,YAAA/Z,MACA4D,EAAAyO,GAAA,QAbAmO,EAAA1J,WAAAnV,EAAAsC,SAAAqS,QAAA3U,EAAAyI,QAeA,MAAA9K,GACAohB,EAAAphB,GAEAmhB,GAAAS,GACAR,EAAA,KAAAF,GAIA,SAAA5c,EAAAI,EAAAmd,GAGA,KAAAX,EAAAH,MAAAnR,QAAAlL,GAKA,GAHAwc,EAAAH,MAAA3f,KAAAsD,GAGAA,KAAA+F,EACA0W,EACAO,EAAAhd,EAAA+F,EAAA/F,OAEAkd,EACAE,WAAA,aACAF,EACAF,EAAAhd,EAAA+F,EAAA/F,YAOA,GAAAyc,EAAA,CACA,IAAA9e,EACA,IACAA,EAAAqL,EAAAlJ,GAAAud,aAAArd,GAAApC,SAAA,QACA,MAAAtC,GAGA,YAFA6hB,GACAT,EAAAphB,IAGA0hB,EAAAhd,EAAArC,SAEAuf,EACAV,EAAA5c,MAAAI,EAAA,SAAA1E,EAAAqC,KACAuf,EAEAhd,IAEA5E,EAEA6hB,EAEAD,GACAR,EAAA,KAAAF,GAFAE,EAAAphB,GAKA0hB,EAAAhd,EAAArC,MAIA,IAAAuf,EAAA,EAIAlU,EAAA+D,SAAA/M,KACAA,EAAA,CAAAA,IACA,IAAA,IAAAqO,EAAArS,EAAA,EAAAA,EAAAgE,EAAAjF,SAAAiB,GACAqS,EAAAmO,EAAAD,YAAA,GAAAvc,EAAAhE,MACA4D,EAAAyO,GAEA,OAAAoO,EACAD,GACAU,GACAR,EAAA,KAAAF,GACAviB,KAgCA0V,EAAAvQ,UAAAwQ,SAAA,SAAA5P,EAAAC,GACA,IAAA+I,EAAAsU,OACA,MAAAngB,MAAA,iBACA,OAAA+B,KAAAuQ,KAAAzP,EAAAC,EAAAqc,IAMA3M,EAAAvQ,UAAAiU,WAAA,WACA,GAAAnU,KAAAkd,SAAArhB,OACA,MAAAoC,MAAA,4BAAA+B,KAAAkd,SAAApS,IAAA,SAAAb,GACA,MAAA,WAAAA,EAAAqE,OAAA,QAAArE,EAAAmF,OAAA7E,WACA3M,KAAA,OACA,OAAAsP,EAAAhN,UAAAiU,WAAA7N,KAAAtG,OAIA,IAAAqe,EAAA,SAUA,SAAAC,EAAA9N,EAAAvG,GACA,IAAAsU,EAAAtU,EAAAmF,OAAAgF,OAAAnK,EAAAqE,QACA,GAAAiQ,EAAA,CACA,IAAAC,EAAA,IAAArQ,EAAAlE,EAAAM,SAAAN,EAAAzC,GAAAyC,EAAA1C,KAAA0C,EAAAnB,KAAA/N,GAAAkP,EAAAlJ,SAIA,OAHAyd,EAAA3P,eAAA5E,GACA2E,eAAA4P,EACAD,EAAA3Q,IAAA4Q,GACA,GAWA/N,EAAAvQ,UAAA6U,EAAA,SAAAxC,GACA,GAAAA,aAAApE,EAEAoE,EAAAjE,SAAAvT,IAAAwX,EAAA3D,gBACA0P,EAAAte,EAAAuS,IACAvS,KAAAkd,SAAA1f,KAAA+U,QAEA,GAAAA,aAAA1I,EAEAwU,EAAAngB,KAAAqU,EAAAvL,QACAuL,EAAAnD,OAAAmD,EAAAvL,MAAAuL,EAAA5J,aAEA,KAAA4J,aAAAzB,GAAA,CAEA,GAAAyB,aAAAnE,EACA,IAAA,IAAAtR,EAAA,EAAAA,EAAAkD,KAAAkd,SAAArhB,QACAyiB,EAAAte,EAAAA,KAAAkd,SAAApgB,IACAkD,KAAAkd,SAAA3c,OAAAzD,EAAA,KAEAA,EACA,IAAA,IAAAQ,EAAA,EAAAA,EAAAiV,EAAAe,YAAAzX,SAAAyB,EACA0C,KAAA+U,EAAAxC,EAAAU,EAAA3V,IACA+gB,EAAAngB,KAAAqU,EAAAvL,QACAuL,EAAAnD,OAAAmD,EAAAvL,MAAAuL,KAcA9B,EAAAvQ,UAAA8U,EAAA,SAAAzC,GACA,GAAAA,aAAApE,GAEA,GAAAoE,EAAAjE,SAAAvT,GACA,GAAAwX,EAAA3D,eACA2D,EAAA3D,eAAAQ,OAAAlB,OAAAqE,EAAA3D,gBACA2D,EAAA3D,eAAA,SACA,CACA,IAAA7S,EAAAiE,KAAAkd,SAAAlR,QAAAuG,IAEA,EAAAxW,GACAiE,KAAAkd,SAAA3c,OAAAxE,EAAA,SAIA,GAAAwW,aAAA1I,EAEAwU,EAAAngB,KAAAqU,EAAAvL,cACAuL,EAAAnD,OAAAmD,EAAAvL,WAEA,GAAAuL,aAAArF,EAAA,CAEA,IAAA,IAAApQ,EAAA,EAAAA,EAAAyV,EAAAe,YAAAzX,SAAAiB,EACAkD,KAAAgV,EAAAzC,EAAAU,EAAAnW,IAEAuhB,EAAAngB,KAAAqU,EAAAvL,cACAuL,EAAAnD,OAAAmD,EAAAvL,QAMAyJ,EAAAL,EAAA,SAAAC,EAAAoO,EAAAC,GACAtQ,EAAAiC,EACAuB,EAAA6M,EACA5X,EAAA6X,uDCxWApjB,EAAAC,QAAA,4BCKAA,EA6BAyV,QAAA3V,EAAA,gCClCAC,EAAAC,QAAAyV,EAEA,IAAAlH,EAAAzO,EAAA,IAsCA,SAAA2V,EAAA2N,EAAAC,EAAAC,GAEA,GAAA,mBAAAF,EACA,MAAAtR,UAAA,8BAEAvD,EAAA/J,aAAAuG,KAAAtG,MAMAA,KAAA2e,QAAAA,EAMA3e,KAAA4e,mBAAAA,EAMA5e,KAAA6e,oBAAAA,IA1DA7N,EAAA9Q,UAAAnB,OAAAgO,OAAAjD,EAAA/J,aAAAG,YAAA8M,YAAAgE,GAwEA9Q,UAAA4e,QAAA,SAAAA,EAAAjF,EAAAkF,EAAAC,EAAAC,EAAAje,GAEA,IAAAie,EACA,MAAA5R,UAAA,6BAEA,IAAAiQ,EAAAtd,KACA,IAAAgB,EACA,OAAA8I,EAAAnJ,UAAAme,EAAAxB,EAAAzD,EAAAkF,EAAAC,EAAAC,GAEA,IAAA3B,EAAAqB,QAEA,OADAT,WAAA,WAAAld,EAAA/C,MAAA,mBAAA,GACAlD,GAGA,IACA,OAAAuiB,EAAAqB,QACA9E,EACAkF,EAAAzB,EAAAsB,iBAAA,kBAAA,UAAAK,GAAAzB,SACA,SAAAphB,EAAAqF,GAEA,GAAArF,EAEA,OADAkhB,EAAA9c,KAAA,QAAApE,EAAAyd,GACA7Y,EAAA5E,GAGA,GAAA,OAAAqF,EAEA,OADA6b,EAAApgB,KAAA,GACAnC,GAGA,KAAA0G,aAAAud,GACA,IACAvd,EAAAud,EAAA1B,EAAAuB,kBAAA,kBAAA,UAAApd,GACA,MAAArF,GAEA,OADAkhB,EAAA9c,KAAA,QAAApE,EAAAyd,GACA7Y,EAAA5E,GAKA,OADAkhB,EAAA9c,KAAA,OAAAiB,EAAAoY,GACA7Y,EAAA,KAAAS,KAGA,MAAArF,GAGA,OAFAkhB,EAAA9c,KAAA,QAAApE,EAAAyd,GACAqE,WAAA,WAAAld,EAAA5E,IAAA,GACArB,KASAiW,EAAA9Q,UAAAhD,IAAA,SAAAgiB,GAOA,OANAlf,KAAA2e,UACAO,GACAlf,KAAA2e,QAAA,KAAA,KAAA,MACA3e,KAAA2e,QAAA,KACA3e,KAAAQ,KAAA,OAAAH,OAEAL,kCC3IA1E,EAAAC,QAAAyV,EAGA,IAAA9D,EAAA7R,EAAA,MACA2V,EAAA9Q,UAAAnB,OAAAgO,OAAAG,EAAAhN,YAAA8M,YAAAgE,GAAA/D,UAAA,UAEA,IAAAgE,EAAA5V,EAAA,IACAyO,EAAAzO,EAAA,IACAoW,EAAApW,EAAA,IAWA,SAAA2V,EAAAhK,EAAAjG,GACAmM,EAAA5G,KAAAtG,KAAAgH,EAAAjG,GAMAf,KAAAyT,QAAA,GAOAzT,KAAAmf,EAAA,KAyDA,SAAAjM,EAAAyG,GAEA,OADAA,EAAAwF,EAAA,KACAxF,EA1CA3I,EAAAzD,SAAA,SAAAvG,EAAAC,GACA,IAAA0S,EAAA,IAAA3I,EAAAhK,EAAAC,EAAAlG,SAEA,GAAAkG,EAAAwM,QACA,IAAA,IAAAD,EAAAzU,OAAAC,KAAAiI,EAAAwM,SAAA3W,EAAA,EAAAA,EAAA0W,EAAA3X,SAAAiB,EACA6c,EAAA/L,IAAAqD,EAAA1D,SAAAiG,EAAA1W,GAAAmK,EAAAwM,QAAAD,EAAA1W,MAIA,OAHAmK,EAAAC,QACAyS,EAAAvG,QAAAnM,EAAAC,QACAyS,EAAAxM,QAAAlG,EAAAkG,QACAwM,GAQA3I,EAAA9Q,UAAAuN,OAAA,SAAAC,GACA,IAAA0R,EAAAlS,EAAAhN,UAAAuN,OAAAnH,KAAAtG,KAAA0N,GACAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,UAAAqU,GAAAA,EAAAre,SAAAhG,GACA,UAAAmS,EAAA4F,YAAA9S,KAAAqf,aAAA3R,IAAA,GACA,SAAA0R,GAAAA,EAAAlY,QAAAnM,GACA,UAAA4S,EAAA3N,KAAAmN,QAAApS,MAUAgE,OAAAgQ,eAAAiC,EAAA9Q,UAAA,eAAA,CACAwJ,IAAA,WACA,OAAA1J,KAAAmf,IAAAnf,KAAAmf,EAAArV,EAAAuJ,QAAArT,KAAAyT,aAYAzC,EAAA9Q,UAAAwJ,IAAA,SAAA1C,GACA,OAAAhH,KAAAyT,QAAAzM,IACAkG,EAAAhN,UAAAwJ,IAAApD,KAAAtG,KAAAgH,IAMAgK,EAAA9Q,UAAAiU,WAAA,WAEA,IADA,IAAAV,EAAAzT,KAAAqf,aACAviB,EAAA,EAAAA,EAAA2W,EAAA5X,SAAAiB,EACA2W,EAAA3W,GAAAZ,UACA,OAAAgR,EAAAhN,UAAAhE,QAAAoK,KAAAtG,OAMAgR,EAAA9Q,UAAA0N,IAAA,SAAA2E,GAGA,GAAAvS,KAAA0J,IAAA6I,EAAAvL,MACA,MAAA/I,MAAA,mBAAAsU,EAAAvL,KAAA,QAAAhH,MAEA,OAAAuS,aAAAtB,EAGAiC,GAFAlT,KAAAyT,QAAAlB,EAAAvL,MAAAuL,GACAnD,OAAApP,MAGAkN,EAAAhN,UAAA0N,IAAAtH,KAAAtG,KAAAuS,IAMAvB,EAAA9Q,UAAAgO,OAAA,SAAAqE,GACA,GAAAA,aAAAtB,EAAA,CAGA,GAAAjR,KAAAyT,QAAAlB,EAAAvL,QAAAuL,EACA,MAAAtU,MAAAsU,EAAA,uBAAAvS,MAIA,cAFAA,KAAAyT,QAAAlB,EAAAvL,MACAuL,EAAAnD,OAAA,KACA8D,EAAAlT,MAEA,OAAAkN,EAAAhN,UAAAgO,OAAA5H,KAAAtG,KAAAuS,IAUAvB,EAAA9Q,UAAA6M,OAAA,SAAA4R,EAAAC,EAAAC,GAEA,IADA,IACAhF,EADAyF,EAAA,IAAA7N,EAAAT,QAAA2N,EAAAC,EAAAC,GACA/hB,EAAA,EAAAA,EAAAkD,KAAAqf,aAAAxjB,SAAAiB,EAAA,CACA,IAAAyiB,EAAAzV,EAAAuQ,SAAAR,EAAA7Z,KAAAmf,EAAAriB,IAAAZ,UAAA8K,MAAAzH,QAAA,WAAA,IACA+f,EAAAC,GAAAzV,EAAA3L,QAAA,CAAA,IAAA,KAAA2L,EAAA0V,WAAAD,GAAAA,EAAA,IAAAA,EAAAzV,CAAA,iCAAAA,CAAA,CACA2V,EAAA5F,EACA6F,EAAA7F,EAAAlH,oBAAAhD,KACAgQ,EAAA9F,EAAAjH,qBAAAjD,OAGA,OAAA2P,iDCpKAhkB,EAAAC,QAAAoW,EAEA,IAAAiO,EAAA,uBACAC,EAAA,kCACAC,EAAA,kCAEAC,EAAA,aACAC,EAAA,aACAC,EAAA,MACAC,EAAA,KACAC,EAAA,UAEAC,EAAA,CACAC,EAAA,KACAC,EAAA,KACA7jB,EAAA,KACAU,EAAA,MAUA,SAAAojB,EAAAC,GACA,OAAAA,EAAAjhB,QAAA4gB,EAAA,SAAA3gB,EAAAC,GACA,OAAAA,GACA,IAAA,KACA,IAAA,GACA,OAAAA,EACA,QACA,OAAA2gB,EAAA3gB,IAAA,MAgEA,SAAAkS,EAAAlT,EAAAyY,GAEAzY,EAAAA,EAAAC,WAEA,IAAA5C,EAAA,EACAD,EAAA4C,EAAA5C,OACAgc,EAAA,EACA4I,EAAA,KACA7G,EAAA,KACA8G,EAAA,EACAC,GAAA,EACAC,GAAA,EAEAC,EAAA,GAEAC,EAAA,KASA,SAAAnJ,EAAAoJ,GACA,OAAA9iB,MAAA,WAAA8iB,EAAA,UAAAlJ,EAAA,KA0BA,SAAAmJ,EAAA3e,GACA,OAAA5D,EAAAA,EAAA4D,GAWA,SAAA4e,EAAAhkB,EAAAC,EAAAgkB,GACAT,EAAAhiB,EAAAA,EAAAxB,KACAyjB,EAAA7I,EACA8I,GAAA,EACAC,EAAAM,EAOA,IACAnjB,EADAojB,EAAAlkB,GALAia,EACA,EAEA,GAIA,GACA,KAAAiK,EAAA,GACA,OAAApjB,EAAAU,EAAAA,EAAA0iB,IAAA,CACAR,GAAA,EACA,aAEA,MAAA5iB,GAAA,OAAAA,GAIA,IAHA,IAAAqjB,EAAA3iB,EACAwZ,UAAAhb,EAAAC,GACAwI,MAAAua,GACAnjB,EAAA,EAAAA,EAAAskB,EAAAvlB,SAAAiB,EACAskB,EAAAtkB,GAAAskB,EAAAtkB,GACAyC,QAAA2X,EAAA8I,EAAAD,EAAA,IACAsB,OACAzH,EAAAwH,EACAxjB,KAAA,MACAyjB,OAGA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,EAAAF,GAGAG,EAAAjjB,EAAAwZ,UAAAsJ,EAAAC,GAIA,MADA,cAAAtjB,KAAAwjB,GAIA,SAAAD,EAAAE,GAGA,IADA,IAAAH,EAAAG,EACAH,EAAA3lB,GAAA,OAAAmlB,EAAAQ,IACAA,IAEA,OAAAA,EAQA,SAAArK,IACA,GAAA,EAAA0J,EAAAhlB,OACA,OAAAglB,EAAAhb,QACA,GAAAib,EACA,OA3FA,WACA,IAAAc,EAAA,MAAAd,EAAAhB,EAAAD,EACA+B,EAAAC,UAAA/lB,EAAA,EACA,IAAAgmB,EAAAF,EAAAG,KAAAtjB,GACA,IAAAqjB,EACA,MAAAnK,EAAA,UAIA,OAHA7b,EAAA8lB,EAAAC,UACArkB,EAAAsjB,GACAA,EAAA,KACAP,EAAAuB,EAAA,IAkFAhK,GACA,IAAAkK,EACArO,EACAsO,EACAhlB,EACAilB,EACAC,EAAA,IAAArmB,EACA,EAAA,CACA,GAAAA,IAAAD,EACA,OAAA,KAEA,IADAmmB,GAAA,EACA9B,EAAAhiB,KAAA+jB,EAAAjB,EAAAllB,KAKA,GAJA,OAAAmmB,IACAE,GAAA,IACAtK,KAEA/b,IAAAD,EACA,OAAA,KAGA,GAAA,MAAAmlB,EAAAllB,GAAA,CACA,KAAAA,IAAAD,EACA,MAAA8b,EAAA,WAEA,GAAA,MAAAqJ,EAAAllB,GACA,GAAAob,EAeA,CAIA,GADAgL,GAAA,EACAZ,EAFArkB,EAAAnB,GAEA,CACAomB,GAAA,EACA,EAAA,CAEA,IADApmB,EAAA2lB,EAAA3lB,MACAD,EACA,MAEAC,UACAwlB,EAAAxlB,SAEAA,EAAAY,KAAAugB,IAAAphB,EAAA4lB,EAAA3lB,GAAA,GAEAomB,GACAjB,EAAAhkB,EAAAnB,EAAAqmB,GAEAtK,IACAmK,GAAA,MAnCA,CAIA,IAFAE,EAAA,MAAAlB,EAAA/jB,EAAAnB,EAAA,GAEA,OAAAklB,IAAAllB,IACA,GAAAA,IAAAD,EACA,OAAA,OAGAC,EACAomB,GACAjB,EAAAhkB,EAAAnB,EAAA,EAAAqmB,KAEAtK,EACAmK,GAAA,MAuBA,CAAA,GAAA,OAAAC,EAAAjB,EAAAllB,IAoBA,MAAA,IAlBAmB,EAAAnB,EAAA,EACAomB,EAAAhL,GAAA,MAAA8J,EAAA/jB,GACA,EAAA,CAIA,GAHA,OAAAglB,KACApK,IAEA/b,IAAAD,EACA,MAAA8b,EAAA,WAEAhE,EAAAsO,EACAA,EAAAjB,EAAAllB,SACA,MAAA6X,GAAA,MAAAsO,KACAnmB,EACAomB,GACAjB,EAAAhkB,EAAAnB,EAAA,EAAAqmB,GAEAH,GAAA,UAKAA,GAIA,IAAA9kB,EAAApB,EAGA,GAFA8jB,EAAAiC,UAAA,GACAjC,EAAA1hB,KAAA8iB,EAAA9jB,MAEA,KAAAA,EAAArB,IAAA+jB,EAAA1hB,KAAA8iB,EAAA9jB,OACAA,EACA,IAAA6Z,EAAAtY,EAAAwZ,UAAAnc,EAAAA,EAAAoB,GAGA,MAFA,KAAA6Z,GAAA,KAAAA,IACA+J,EAAA/J,GACAA,EASA,SAAAvZ,EAAAuZ,GACA8J,EAAArjB,KAAAuZ,GAQA,SAAAK,IACA,IAAAyJ,EAAAhlB,OAAA,CACA,IAAAkb,EAAAI,IACA,GAAA,OAAAJ,EACA,OAAA,KACAvZ,EAAAuZ,GAEA,OAAA8J,EAAA,GA+CA,OAAA9hB,OAAAgQ,eAAA,CACAoI,KAAAA,EACAC,KAAAA,EACA5Z,KAAAA,EACA6Z,KAxCA,SAAA+K,EAAAvV,GACA,IAAAwV,EAAAjL,IAEA,GADAiL,IAAAD,EAGA,OADAjL,KACA,EAEA,IAAAtK,EACA,MAAA8K,EAAA,UAAA0K,EAAA,OAAAD,EAAA,cACA,OAAA,GAgCA9K,KAvBA,SAAA8C,GACA,IAAAkI,EAAA,KAcA,OAbAlI,IAAArf,GACA2lB,IAAA7I,EAAA,IAAAX,GAAA,MAAAuJ,GAAAE,KACA2B,EAAA1B,EAAAhH,EAAA,OAIA8G,EAAAtG,GACAhD,IAEAsJ,IAAAtG,GAAAuG,IAAAzJ,GAAA,MAAAuJ,IACA6B,EAAA1B,EAAA,KAAAhH,IAGA0I,IASA,OAAA,CACA5Y,IAAA,WAAA,OAAAmO,KAxWAlG,EAAA4O,SAAAA,yBCtCAjlB,EAAAC,QAAA6S,EAGA,IAAAlB,EAAA7R,EAAA,MACA+S,EAAAlO,UAAAnB,OAAAgO,OAAAG,EAAAhN,YAAA8M,YAAAoB,GAAAnB,UAAA,OAEA,IAAApD,EAAAxO,EAAA,IACAyV,EAAAzV,EAAA,IACA8S,EAAA9S,EAAA,IACA0V,EAAA1V,EAAA,IACA2V,EAAA3V,EAAA,IACA6V,EAAA7V,EAAA,IACAkW,EAAAlW,EAAA,IACAgW,EAAAhW,EAAA,IACAyO,EAAAzO,EAAA,IACAsV,EAAAtV,EAAA,IACAuV,EAAAvV,EAAA,IACAwV,EAAAxV,EAAA,IACAuO,EAAAvO,EAAA,IACA8V,EAAA9V,EAAA,IAUA,SAAA+S,EAAApH,EAAAjG,GACAmM,EAAA5G,KAAAtG,KAAAgH,EAAAjG,GAMAf,KAAAqH,OAAA,GAMArH,KAAAiI,OAAAlN,GAMAiF,KAAAsZ,WAAAve,GAMAiF,KAAAsN,SAAAvS,GAMAiF,KAAAkM,MAAAnR,GAOAiF,KAAAuiB,EAAA,KAOAviB,KAAA+L,EAAA,KAOA/L,KAAAwiB,EAAA,KAOAxiB,KAAAyiB,EAAA,KA0HA,SAAAvP,EAAA3L,GAKA,OAJAA,EAAAgb,EAAAhb,EAAAwE,EAAAxE,EAAAib,EAAA,YACAjb,EAAAxK,cACAwK,EAAAzJ,cACAyJ,EAAA+K,OACA/K,EA5HAxI,OAAA8V,iBAAAzG,EAAAlO,UAAA,CAQAwiB,WAAA,CACAhZ,IAAA,WAGA,GAAA1J,KAAAuiB,EACA,OAAAviB,KAAAuiB,EAEAviB,KAAAuiB,EAAA,GACA,IAAA,IAAA/O,EAAAzU,OAAAC,KAAAgB,KAAAqH,QAAAvK,EAAA,EAAAA,EAAA0W,EAAA3X,SAAAiB,EAAA,CACA,IAAAmN,EAAAjK,KAAAqH,OAAAmM,EAAA1W,IACA0K,EAAAyC,EAAAzC,GAGA,GAAAxH,KAAAuiB,EAAA/a,GACA,MAAAvJ,MAAA,gBAAAuJ,EAAA,OAAAxH,MAEAA,KAAAuiB,EAAA/a,GAAAyC,EAEA,OAAAjK,KAAAuiB,IAUA3X,YAAA,CACAlB,IAAA,WACA,OAAA1J,KAAA+L,IAAA/L,KAAA+L,EAAAjC,EAAAuJ,QAAArT,KAAAqH,WAUAsb,YAAA,CACAjZ,IAAA,WACA,OAAA1J,KAAAwiB,IAAAxiB,KAAAwiB,EAAA1Y,EAAAuJ,QAAArT,KAAAiI,WAUA0H,KAAA,CACAjG,IAAA,WACA,OAAA1J,KAAAyiB,IAAAziB,KAAA2P,KAAAvB,EAAAwU,oBAAA5iB,KAAAoO,KAEA0H,IAAA,SAAAnG,GAGA,IAAAzP,EAAAyP,EAAAzP,UACAA,aAAAgR,KACAvB,EAAAzP,UAAA,IAAAgR,GAAAlE,YAAA2C,EACA7F,EAAA2S,MAAA9M,EAAAzP,UAAAA,IAIAyP,EAAAsC,MAAAtC,EAAAzP,UAAA+R,MAAAjS,KAGA8J,EAAA2S,MAAA9M,EAAAuB,GAAA,GAEAlR,KAAAyiB,EAAA9S,EAIA,IADA,IAAA7S,EAAA,EACAA,EAAAkD,KAAA4K,YAAA/O,SAAAiB,EACAkD,KAAA+L,EAAAjP,GAAAZ,UAGA,IAAA2mB,EAAA,GACA,IAAA/lB,EAAA,EAAAA,EAAAkD,KAAA2iB,YAAA9mB,SAAAiB,EACA+lB,EAAA7iB,KAAAwiB,EAAA1lB,GAAAZ,UAAA8K,MAAA,CACA0C,IAAAI,EAAA+L,YAAA7V,KAAAwiB,EAAA1lB,GAAAqL,OACA2N,IAAAhM,EAAAiM,YAAA/V,KAAAwiB,EAAA1lB,GAAAqL,QAEArL,GACAiC,OAAA8V,iBAAAlF,EAAAzP,UAAA2iB,OAUAzU,EAAAwU,oBAAA,SAAAjY,GAIA,IAFA,IAEAV,EAFAD,EAAAF,EAAA3L,QAAA,CAAA,KAAAwM,EAAA3D,MAEAlK,EAAA,EAAAA,EAAA6N,EAAAC,YAAA/O,SAAAiB,GACAmN,EAAAU,EAAAoB,EAAAjP,IAAAgO,IAAAd,EACA,YAAAF,EAAAe,SAAAZ,EAAAjD,OACAiD,EAAAI,UAAAL,EACA,YAAAF,EAAAe,SAAAZ,EAAAjD,OACA,OAAAgD,EACA,wEADAA,CAEA,yBA6BAoE,EAAAb,SAAA,SAAAvG,EAAAC,GACA,IAAAM,EAAA,IAAA6G,EAAApH,EAAAC,EAAAlG,SACAwG,EAAA+R,WAAArS,EAAAqS,WACA/R,EAAA+F,SAAArG,EAAAqG,SAGA,IAFA,IAAAkG,EAAAzU,OAAAC,KAAAiI,EAAAI,QACAvK,EAAA,EACAA,EAAA0W,EAAA3X,SAAAiB,EACAyK,EAAAqG,UACA,IAAA3G,EAAAI,OAAAmM,EAAA1W,IAAAiL,QACAgJ,EAAAxD,SACAY,EAAAZ,UAAAiG,EAAA1W,GAAAmK,EAAAI,OAAAmM,EAAA1W,MAEA,GAAAmK,EAAAgB,OACA,IAAAuL,EAAAzU,OAAAC,KAAAiI,EAAAgB,QAAAnL,EAAA,EAAAA,EAAA0W,EAAA3X,SAAAiB,EACAyK,EAAAqG,IAAAkD,EAAAvD,SAAAiG,EAAA1W,GAAAmK,EAAAgB,OAAAuL,EAAA1W,MACA,GAAAmK,EAAAC,OACA,IAAAsM,EAAAzU,OAAAC,KAAAiI,EAAAC,QAAApK,EAAA,EAAAA,EAAA0W,EAAA3X,SAAAiB,EAAA,CACA,IAAAoK,EAAAD,EAAAC,OAAAsM,EAAA1W,IACAyK,EAAAqG,KACA1G,EAAAM,KAAAzM,GACAoT,EAAAZ,SACArG,EAAAG,SAAAtM,GACAqT,EAAAb,SACArG,EAAAyB,SAAA5N,GACA8O,EAAA0D,SACArG,EAAAuM,UAAA1Y,GACAiW,EAAAzD,SACAL,EAAAK,UAAAiG,EAAA1W,GAAAoK,IAWA,OARAD,EAAAqS,YAAArS,EAAAqS,WAAAzd,SACA0L,EAAA+R,WAAArS,EAAAqS,YACArS,EAAAqG,UAAArG,EAAAqG,SAAAzR,SACA0L,EAAA+F,SAAArG,EAAAqG,UACArG,EAAAiF,QACA3E,EAAA2E,OAAA,GACAjF,EAAAkG,UACA5F,EAAA4F,QAAAlG,EAAAkG,SACA5F,GAQA6G,EAAAlO,UAAAuN,OAAA,SAAAC,GACA,IAAA0R,EAAAlS,EAAAhN,UAAAuN,OAAAnH,KAAAtG,KAAA0N,GACAC,IAAAD,KAAAA,EAAAC,aACA,OAAA7D,EAAAiB,SAAA,CACA,UAAAqU,GAAAA,EAAAre,SAAAhG,GACA,SAAAmS,EAAA4F,YAAA9S,KAAA2iB,YAAAjV,GACA,SAAAR,EAAA4F,YAAA9S,KAAA4K,YAAAqB,OAAA,SAAA+G,GAAA,OAAAA,EAAAnE,iBAAAnB,IAAA,GACA,aAAA1N,KAAAsZ,YAAAtZ,KAAAsZ,WAAAzd,OAAAmE,KAAAsZ,WAAAve,GACA,WAAAiF,KAAAsN,UAAAtN,KAAAsN,SAAAzR,OAAAmE,KAAAsN,SAAAvS,GACA,QAAAiF,KAAAkM,OAAAnR,GACA,SAAAqkB,GAAAA,EAAAlY,QAAAnM,GACA,UAAA4S,EAAA3N,KAAAmN,QAAApS,MAOAqT,EAAAlO,UAAAiU,WAAA,WAEA,IADA,IAAA9M,EAAArH,KAAA4K,YAAA9N,EAAA,EACAA,EAAAuK,EAAAxL,QACAwL,EAAAvK,KAAAZ,UACA,IAAA+L,EAAAjI,KAAA2iB,YACA,IADA7lB,EAAA,EACAA,EAAAmL,EAAApM,QACAoM,EAAAnL,KAAAZ,UACA,OAAAgR,EAAAhN,UAAAiU,WAAA7N,KAAAtG,OAMAoO,EAAAlO,UAAAwJ,IAAA,SAAA1C,GACA,OAAAhH,KAAAqH,OAAAL,IACAhH,KAAAiI,QAAAjI,KAAAiI,OAAAjB,IACAhH,KAAAkH,QAAAlH,KAAAkH,OAAAF,IACA,MAUAoH,EAAAlO,UAAA0N,IAAA,SAAA2E,GAEA,GAAAvS,KAAA0J,IAAA6I,EAAAvL,MACA,MAAA/I,MAAA,mBAAAsU,EAAAvL,KAAA,QAAAhH,MAEA,GAAAuS,aAAApE,GAAAoE,EAAAjE,SAAAvT,GAAA,CAMA,GAAAiF,KAAAuiB,EAAAviB,KAAAuiB,EAAAhQ,EAAA/K,IAAAxH,KAAA0iB,WAAAnQ,EAAA/K,IACA,MAAAvJ,MAAA,gBAAAsU,EAAA/K,GAAA,OAAAxH,MACA,GAAAA,KAAA+N,aAAAwE,EAAA/K,IACA,MAAAvJ,MAAA,MAAAsU,EAAA/K,GAAA,mBAAAxH,MACA,GAAAA,KAAAgO,eAAAuE,EAAAvL,MACA,MAAA/I,MAAA,SAAAsU,EAAAvL,KAAA,oBAAAhH,MAOA,OALAuS,EAAAnD,QACAmD,EAAAnD,OAAAlB,OAAAqE,IACAvS,KAAAqH,OAAAkL,EAAAvL,MAAAuL,GACA9D,QAAAzO,KACAuS,EAAAsB,MAAA7T,MACAkT,EAAAlT,MAEA,OAAAuS,aAAAzB,GACA9Q,KAAAiI,SACAjI,KAAAiI,OAAA,KACAjI,KAAAiI,OAAAsK,EAAAvL,MAAAuL,GACAsB,MAAA7T,MACAkT,EAAAlT,OAEAkN,EAAAhN,UAAA0N,IAAAtH,KAAAtG,KAAAuS,IAUAnE,EAAAlO,UAAAgO,OAAA,SAAAqE,GACA,GAAAA,aAAApE,GAAAoE,EAAAjE,SAAAvT,GAAA,CAIA,IAAAiF,KAAAqH,QAAArH,KAAAqH,OAAAkL,EAAAvL,QAAAuL,EACA,MAAAtU,MAAAsU,EAAA,uBAAAvS,MAKA,cAHAA,KAAAqH,OAAAkL,EAAAvL,MACAuL,EAAAnD,OAAA,KACAmD,EAAAuB,SAAA9T,MACAkT,EAAAlT,MAEA,GAAAuS,aAAAzB,EAAA,CAGA,IAAA9Q,KAAAiI,QAAAjI,KAAAiI,OAAAsK,EAAAvL,QAAAuL,EACA,MAAAtU,MAAAsU,EAAA,uBAAAvS,MAKA,cAHAA,KAAAiI,OAAAsK,EAAAvL,MACAuL,EAAAnD,OAAA,KACAmD,EAAAuB,SAAA9T,MACAkT,EAAAlT,MAEA,OAAAkN,EAAAhN,UAAAgO,OAAA5H,KAAAtG,KAAAuS,IAQAnE,EAAAlO,UAAA6N,aAAA,SAAAvG,GACA,OAAA0F,EAAAa,aAAA/N,KAAAsN,SAAA9F,IAQA4G,EAAAlO,UAAA8N,eAAA,SAAAhH,GACA,OAAAkG,EAAAc,eAAAhO,KAAAsN,SAAAtG,IAQAoH,EAAAlO,UAAA6M,OAAA,SAAAiF,GACA,OAAA,IAAAhS,KAAA2P,KAAAqC,IAOA5D,EAAAlO,UAAA4iB,MAAA,WAMA,IAFA,IAAAvY,EAAAvK,KAAAuK,SACA6B,EAAA,GACAtP,EAAA,EAAAA,EAAAkD,KAAA4K,YAAA/O,SAAAiB,EACAsP,EAAA5O,KAAAwC,KAAA+L,EAAAjP,GAAAZ,UAAAkO,cAGApK,KAAAjD,OAAA4T,EAAA3Q,KAAA2Q,CAAA,CACAU,OAAAA,EACAjF,MAAAA,EACAtC,KAAAA,IAEA9J,KAAAlC,OAAA8S,EAAA5Q,KAAA4Q,CAAA,CACAW,OAAAA,EACAnF,MAAAA,EACAtC,KAAAA,IAEA9J,KAAAsS,OAAAzB,EAAA7Q,KAAA6Q,CAAA,CACAzE,MAAAA,EACAtC,KAAAA,IAEA9J,KAAA0K,WAAAd,EAAAc,WAAA1K,KAAA4J,CAAA,CACAwC,MAAAA,EACAtC,KAAAA,IAEA9J,KAAA+K,SAAAnB,EAAAmB,SAAA/K,KAAA4J,CAAA,CACAwC,MAAAA,EACAtC,KAAAA,IAIA,IAAAiZ,EAAA5R,EAAA5G,GACA,GAAAwY,EAAA,CACA,IAAAC,EAAAjkB,OAAAgO,OAAA/M,MAEAgjB,EAAAtY,WAAA1K,KAAA0K,WACA1K,KAAA0K,WAAAqY,EAAArY,WAAAjG,KAAAue,GAGAA,EAAAjY,SAAA/K,KAAA+K,SACA/K,KAAA+K,SAAAgY,EAAAhY,SAAAtG,KAAAue,GAIA,OAAAhjB,MASAoO,EAAAlO,UAAAnD,OAAA,SAAA0R,EAAAyD,GACA,OAAAlS,KAAA8iB,QAAA/lB,OAAA0R,EAAAyD,IASA9D,EAAAlO,UAAAiS,gBAAA,SAAA1D,EAAAyD,GACA,OAAAlS,KAAAjD,OAAA0R,EAAAyD,GAAAA,EAAA1L,IAAA0L,EAAA+Q,OAAA/Q,GAAAgR,UAWA9U,EAAAlO,UAAApC,OAAA,SAAAsU,EAAAvW,GACA,OAAAmE,KAAA8iB,QAAAhlB,OAAAsU,EAAAvW,IAUAuS,EAAAlO,UAAAmS,gBAAA,SAAAD,GAGA,OAFAA,aAAAb,IACAa,EAAAb,EAAAxE,OAAAqF,IACApS,KAAAlC,OAAAsU,EAAAA,EAAA2J,WAQA3N,EAAAlO,UAAAoS,OAAA,SAAA7D,GACA,OAAAzO,KAAA8iB,QAAAxQ,OAAA7D,IAQAL,EAAAlO,UAAAwK,WAAA,SAAA6H,GACA,OAAAvS,KAAA8iB,QAAApY,WAAA6H,IA4BAnE,EAAAlO,UAAA6K,SAAA,SAAA0D,EAAA1N,GACA,OAAAf,KAAA8iB,QAAA/X,SAAA0D,EAAA1N,IAkBAqN,EAAAwB,EAAA,SAAAuT,GACA,OAAA,SAAA7K,GACAxO,EAAAkG,aAAAsI,EAAA6K,uHCpkBA,IAAA/W,EAAA7Q,EAEAuO,EAAAzO,EAAA,IAEAskB,EAAA,CACA,SACA,QACA,QACA,SACA,SACA,UACA,WACA,QACA,SACA,SACA,UACA,WACA,OACA,SACA,SAGA,SAAAyD,EAAAza,EAAA7M,GACA,IAAAgB,EAAA,EAAAumB,EAAA,GAEA,IADAvnB,GAAA,EACAgB,EAAA6L,EAAA9M,QAAAwnB,EAAA1D,EAAA7iB,EAAAhB,IAAA6M,EAAA7L,KACA,OAAAumB,EAuBAjX,EAAAE,MAAA8W,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,IAwBAhX,EAAAC,SAAA+W,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,EACA,GACAtZ,EAAA4F,WACA,OAaAtD,EAAAb,KAAA6X,EAAA,CACA,EACA,EACA,EACA,EACA,GACA,GAmBAhX,EAAAO,OAAAyW,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GAoBAhX,EAAAG,OAAA6W,EAAA,CACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,gCC5LA,IAIAhV,EACAvE,EALAC,EAAAxO,EAAAC,QAAAF,EAAA,IAEAqW,EAAArW,EAAA,IAKAyO,EAAA3L,QAAA9C,EAAA,GACAyO,EAAApJ,MAAArF,EAAA,GACAyO,EAAAvE,KAAAlK,EAAA,GAMAyO,EAAAlJ,GAAAkJ,EAAAjJ,QAAA,MAOAiJ,EAAAuJ,QAAA,SAAAd,GACA,GAAAA,EAAA,CAIA,IAHA,IAAAvT,EAAAD,OAAAC,KAAAuT,GACAQ,EAAApX,MAAAqD,EAAAnD,QACAE,EAAA,EACAA,EAAAiD,EAAAnD,QACAkX,EAAAhX,GAAAwW,EAAAvT,EAAAjD,MACA,OAAAgX,EAEA,MAAA,IAQAjJ,EAAAiB,SAAA,SAAAgI,GAGA,IAFA,IAAAR,EAAA,GACAxW,EAAA,EACAA,EAAAgX,EAAAlX,QAAA,CACA,IAAAynB,EAAAvQ,EAAAhX,KACAoG,EAAA4Q,EAAAhX,KACAoG,IAAApH,KACAwX,EAAA+Q,GAAAnhB,GAEA,OAAAoQ,GAGA,IAAAgR,EAAA,MACAC,EAAA,KAOA1Z,EAAA0V,WAAA,SAAAxY,GACA,MAAA,uTAAA9I,KAAA8I,IAQA8C,EAAAe,SAAA,SAAAV,GACA,OAAA,YAAAjM,KAAAiM,IAAAL,EAAA0V,WAAArV,GACA,KAAAA,EAAA5K,QAAAgkB,EAAA,QAAAhkB,QAAAikB,EAAA,OAAA,KACA,IAAArZ,GAQAL,EAAAwQ,QAAA,SAAAkG,GACA,OAAAA,EAAA,GAAAiD,cAAAjD,EAAAvI,UAAA,IAGA,IAAAyL,EAAA,YAOA5Z,EAAA4N,UAAA,SAAA8I,GACA,OAAAA,EAAAvI,UAAA,EAAA,GACAuI,EAAAvI,UAAA,GACA1Y,QAAAmkB,EAAA,SAAAlkB,EAAAC,GAAA,OAAAA,EAAAgkB,iBASA3Z,EAAAmB,kBAAA,SAAA0Y,EAAApmB,GACA,OAAAomB,EAAAnc,GAAAjK,EAAAiK,IAWAsC,EAAAkG,aAAA,SAAAL,EAAAwT,GAGA,GAAAxT,EAAAsC,MAMA,OALAkR,GAAAxT,EAAAsC,MAAAjL,OAAAmc,IACArZ,EAAA8Z,aAAA1V,OAAAyB,EAAAsC,OACAtC,EAAAsC,MAAAjL,KAAAmc,EACArZ,EAAA8Z,aAAAhW,IAAA+B,EAAAsC,QAEAtC,EAAAsC,MAOA,IAAA1K,EAAA,IAFA6G,EADAA,GACA/S,EAAA,KAEA8nB,GAAAxT,EAAA3I,MAKA,OAJA8C,EAAA8Z,aAAAhW,IAAArG,GACAA,EAAAoI,KAAAA,EACA5Q,OAAAgQ,eAAAY,EAAA,QAAA,CAAAjQ,MAAA6H,EAAAsc,YAAA,IACA9kB,OAAAgQ,eAAAY,EAAAzP,UAAA,QAAA,CAAAR,MAAA6H,EAAAsc,YAAA,IACAtc,GAGA,IAAAuc,EAAA,EAOAha,EAAAmG,aAAA,SAAAsC,GAGA,GAAAA,EAAAN,MACA,OAAAM,EAAAN,MAMA,IAAAzE,EAAA,IAFA3D,EADAA,GACAxO,EAAA,KAEA,OAAAyoB,IAAAvR,GAGA,OAFAzI,EAAA8Z,aAAAhW,IAAAJ,GACAzO,OAAAgQ,eAAAwD,EAAA,QAAA,CAAA7S,MAAA8N,EAAAqW,YAAA,IACArW,GAWA1D,EAAAyL,YAAA,SAAAwO,EAAAxe,EAAA7F,GAcA,GAAA,iBAAAqkB,EACA,MAAA1W,UAAA,yBACA,IAAA9H,EACA,MAAA8H,UAAA,0BAGA,OAnBA,SAAA2W,EAAAD,EAAAxe,EAAA7F,GACA,IAAAwU,EAAA3O,EAAAM,QACA,GAAA,EAAAN,EAAA1J,OACAkoB,EAAA7P,GAAA8P,EAAAD,EAAA7P,IAAA,GAAA3O,EAAA7F,OACA,CACA,IAAAob,EAAAiJ,EAAA7P,GACA4G,IACApb,EAAA,GAAAqb,OAAAD,GAAAC,OAAArb,IACAqkB,EAAA7P,GAAAxU,EAEA,OAAAqkB,EASAC,CAAAD,EADAxe,EAAAA,EAAAG,MAAA,KACAhG,IASAX,OAAAgQ,eAAAjF,EAAA,eAAA,CACAJ,IAAA,WACA,OAAAgI,EAAA,YAAAA,EAAA,UAAA,IAAArW,EAAA,yEC7MAC,EAAAC,QAAA2f,EAEA,IAAApR,EAAAzO,EAAA,IAUA,SAAA6f,EAAApX,EAAAC,GASA/D,KAAA8D,GAAAA,IAAA,EAMA9D,KAAA+D,GAAAA,IAAA,EAQA,IAAAkgB,EAAA/I,EAAA+I,KAAA,IAAA/I,EAAA,EAAA,GAEA+I,EAAAtY,SAAA,WAAA,OAAA,GACAsY,EAAAC,SAAAD,EAAApH,SAAA,WAAA,OAAA7c,MACAikB,EAAApoB,OAAA,WAAA,OAAA,GAOA,IAAAsoB,EAAAjJ,EAAAiJ,SAAA,mBAOAjJ,EAAA5L,WAAA,SAAA5P,GACA,GAAA,IAAAA,EACA,OAAAukB,EACA,IAAA3hB,EAAA5C,EAAA,EACA4C,IACA5C,GAAAA,GACA,IAAAoE,EAAApE,IAAA,EACAqE,GAAArE,EAAAoE,GAAA,aAAA,EAUA,OATAxB,IACAyB,GAAAA,IAAA,EACAD,GAAAA,IAAA,EACA,aAAAA,IACAA,EAAA,EACA,aAAAC,IACAA,EAAA,KAGA,IAAAmX,EAAApX,EAAAC,IAQAmX,EAAAkJ,KAAA,SAAA1kB,GACA,GAAA,iBAAAA,EACA,OAAAwb,EAAA5L,WAAA5P,GACA,GAAAoK,EAAA+D,SAAAnO,GAAA,CAEA,IAAAoK,EAAA6E,KAGA,OAAAuM,EAAA5L,WAAA4I,SAAAxY,EAAA,KAFAA,EAAAoK,EAAA6E,KAAA0V,WAAA3kB,GAIA,OAAAA,EAAA8L,KAAA9L,EAAA+L,KAAA,IAAAyP,EAAAxb,EAAA8L,MAAA,EAAA9L,EAAA+L,OAAA,GAAAwY,GAQA/I,EAAAhb,UAAAyL,SAAA,SAAAD,GACA,IAAAA,GAAA1L,KAAA+D,KAAA,GAAA,CACA,IAAAD,EAAA,GAAA9D,KAAA8D,KAAA,EACAC,GAAA/D,KAAA+D,KAAA,EAGA,OAFAD,IACAC,EAAAA,EAAA,IAAA,KACAD,EAAA,WAAAC,GAEA,OAAA/D,KAAA8D,GAAA,WAAA9D,KAAA+D,IAQAmX,EAAAhb,UAAAokB,OAAA,SAAA5Y,GACA,OAAA5B,EAAA6E,KACA,IAAA7E,EAAA6E,KAAA,EAAA3O,KAAA8D,GAAA,EAAA9D,KAAA+D,KAAA2H,GAEA,CAAAF,IAAA,EAAAxL,KAAA8D,GAAA2H,KAAA,EAAAzL,KAAA+D,GAAA2H,WAAAA,IAGA,IAAA1N,EAAAP,OAAAyC,UAAAlC,WAOAkd,EAAAqJ,SAAA,SAAAC,GACA,OAAAA,IAAAL,EACAF,EACA,IAAA/I,GACAld,EAAAsI,KAAAke,EAAA,GACAxmB,EAAAsI,KAAAke,EAAA,IAAA,EACAxmB,EAAAsI,KAAAke,EAAA,IAAA,GACAxmB,EAAAsI,KAAAke,EAAA,IAAA,MAAA,GAEAxmB,EAAAsI,KAAAke,EAAA,GACAxmB,EAAAsI,KAAAke,EAAA,IAAA,EACAxmB,EAAAsI,KAAAke,EAAA,IAAA,GACAxmB,EAAAsI,KAAAke,EAAA,IAAA,MAAA,IAQAtJ,EAAAhb,UAAAukB,OAAA,WACA,OAAAhnB,OAAAC,aACA,IAAAsC,KAAA8D,GACA9D,KAAA8D,KAAA,EAAA,IACA9D,KAAA8D,KAAA,GAAA,IACA9D,KAAA8D,KAAA,GACA,IAAA9D,KAAA+D,GACA/D,KAAA+D,KAAA,EAAA,IACA/D,KAAA+D,KAAA,GAAA,IACA/D,KAAA+D,KAAA,KAQAmX,EAAAhb,UAAAgkB,SAAA,WACA,IAAAQ,EAAA1kB,KAAA+D,IAAA,GAGA,OAFA/D,KAAA+D,KAAA/D,KAAA+D,IAAA,EAAA/D,KAAA8D,KAAA,IAAA4gB,KAAA,EACA1kB,KAAA8D,IAAA9D,KAAA8D,IAAA,EAAA4gB,KAAA,EACA1kB,MAOAkb,EAAAhb,UAAA2c,SAAA,WACA,IAAA6H,IAAA,EAAA1kB,KAAA8D,IAGA,OAFA9D,KAAA8D,KAAA9D,KAAA8D,KAAA,EAAA9D,KAAA+D,IAAA,IAAA2gB,KAAA,EACA1kB,KAAA+D,IAAA/D,KAAA+D,KAAA,EAAA2gB,KAAA,EACA1kB,MAOAkb,EAAAhb,UAAArE,OAAA,WACA,IAAA8oB,EAAA3kB,KAAA8D,GACA8gB,GAAA5kB,KAAA8D,KAAA,GAAA9D,KAAA+D,IAAA,KAAA,EACA8gB,EAAA7kB,KAAA+D,KAAA,GACA,OAAA,GAAA8gB,EACA,GAAAD,EACAD,EAAA,MACAA,EAAA,IAAA,EAAA,EACAA,EAAA,QAAA,EAAA,EACAC,EAAA,MACAA,EAAA,IAAA,EAAA,EACAA,EAAA,QAAA,EAAA,EACAC,EAAA,IAAA,EAAA,kCCrMA,IAAA/a,EAAAvO,EA2OA,SAAAkhB,EAAAsH,EAAAe,EAAA5V,GACA,IAAA,IAAAlQ,EAAAD,OAAAC,KAAA8lB,GAAAhoB,EAAA,EAAAA,EAAAkC,EAAAnD,SAAAiB,EACAinB,EAAA/kB,EAAAlC,MAAA/B,IAAAmU,IACA6U,EAAA/kB,EAAAlC,IAAAgoB,EAAA9lB,EAAAlC,KACA,OAAAinB,EAoBA,SAAAgB,EAAA/d,GAEA,SAAAge,EAAAvW,EAAAuD,GAEA,KAAAhS,gBAAAglB,GACA,OAAA,IAAAA,EAAAvW,EAAAuD,GAKAjT,OAAAgQ,eAAA/O,KAAA,UAAA,CAAA0J,IAAA,WAAA,OAAA+E,KAGAxQ,MAAAgnB,kBACAhnB,MAAAgnB,kBAAAjlB,KAAAglB,GAEAjmB,OAAAgQ,eAAA/O,KAAA,QAAA,CAAAN,MAAAzB,QAAA4iB,OAAA,KAEA7O,GACAyK,EAAAzc,KAAAgS,GAWA,OARAgT,EAAA9kB,UAAAnB,OAAAgO,OAAA9O,MAAAiC,YAAA8M,YAAAgY,EAEAjmB,OAAAgQ,eAAAiW,EAAA9kB,UAAA,OAAA,CAAAwJ,IAAA,WAAA,OAAA1C,KAEAge,EAAA9kB,UAAAxB,SAAA,WACA,OAAAsB,KAAAgH,KAAA,KAAAhH,KAAAyO,SAGAuW,EA9RAlb,EAAAnJ,UAAAtF,EAAA,GAGAyO,EAAAxN,OAAAjB,EAAA,GAGAyO,EAAA/J,aAAA1E,EAAA,GAGAyO,EAAAuS,MAAAhhB,EAAA,GAGAyO,EAAAjJ,QAAAxF,EAAA,GAGAyO,EAAAvD,KAAAlL,EAAA,IAGAyO,EAAAob,KAAA7pB,EAAA,GAGAyO,EAAAoR,SAAA7f,EAAA,IAOAyO,EAAAsU,UAAA,oBAAA+G,QACAA,QACAA,OAAArH,SACAqH,OAAArH,QAAAsH,UACAD,OAAArH,QAAAsH,SAAAC,MAOAvb,EAAAqb,OAAArb,EAAAsU,QAAA+G,QACA,oBAAAG,QAAAA,QACA,oBAAAhI,MAAAA,MACAtd,KAQA8J,EAAA4F,WAAA3Q,OAAAwQ,OAAAxQ,OAAAwQ,OAAA,IAAA,GAOAzF,EAAA2F,YAAA1Q,OAAAwQ,OAAAxQ,OAAAwQ,OAAA,IAAA,GAQAzF,EAAAgE,UAAAyX,OAAAzX,WAAA,SAAApO,GACA,MAAA,iBAAAA,GAAA8lB,SAAA9lB,IAAAhD,KAAAiD,MAAAD,KAAAA,GAQAoK,EAAA+D,SAAA,SAAAnO,GACA,MAAA,iBAAAA,GAAAA,aAAAjC,QAQAqM,EAAAyE,SAAA,SAAA7O,GACA,OAAAA,GAAA,iBAAAA,GAWAoK,EAAA2b,MAQA3b,EAAA4b,MAAA,SAAA1S,EAAA7I,GACA,IAAAzK,EAAAsT,EAAA7I,GACA,OAAA,MAAAzK,GAAAsT,EAAAqC,eAAAlL,KACA,iBAAAzK,GAAA,GAAA/D,MAAAqY,QAAAtU,GAAAA,EAAA7D,OAAAkD,OAAAC,KAAAU,GAAA7D,UAeAiO,EAAAwR,OAAA,WACA,IACA,IAAAA,EAAAxR,EAAAjJ,QAAA,UAAAya,OAEA,OAAAA,EAAApb,UAAAylB,UAAArK,EAAA,KACA,MAAAhW,GAEA,OAAA,MAPA,GAYAwE,EAAA8b,EAAA,KAGA9b,EAAA+b,EAAA,KAOA/b,EAAA0F,UAAA,SAAAsW,GAEA,MAAA,iBAAAA,EACAhc,EAAAwR,OACAxR,EAAA+b,EAAAC,GACA,IAAAhc,EAAAnO,MAAAmqB,GACAhc,EAAAwR,OACAxR,EAAA8b,EAAAE,GACA,oBAAAnkB,WACAmkB,EACA,IAAAnkB,WAAAmkB,IAOAhc,EAAAnO,MAAA,oBAAAgG,WAAAA,WAAAhG,MAeAmO,EAAA6E,KAAA7E,EAAAqb,OAAAY,SAAAjc,EAAAqb,OAAAY,QAAApX,MACA7E,EAAAqb,OAAAxW,MACA7E,EAAAjJ,QAAA,QAOAiJ,EAAAkc,OAAA,mBAOAlc,EAAAmc,QAAA,wBAOAnc,EAAAoc,QAAA,6CAOApc,EAAAqc,WAAA,SAAAzmB,GACA,OAAAA,EACAoK,EAAAoR,SAAAkJ,KAAA1kB,GAAA+kB,SACA3a,EAAAoR,SAAAiJ,UASAra,EAAAsc,aAAA,SAAA5B,EAAA9Y,GACA,IAAAgQ,EAAA5R,EAAAoR,SAAAqJ,SAAAC,GACA,OAAA1a,EAAA6E,KACA7E,EAAA6E,KAAA0X,SAAA3K,EAAA5X,GAAA4X,EAAA3X,GAAA2H,GACAgQ,EAAA/P,WAAAD,IAkBA5B,EAAA2S,MAAAA,EAOA3S,EAAAuQ,QAAA,SAAAmG,GACA,OAAAA,EAAA,GAAAhS,cAAAgS,EAAAvI,UAAA,IA0CAnO,EAAAib,SAAAA,EAmBAjb,EAAAwc,cAAAvB,EAAA,iBAoBAjb,EAAA+L,YAAA,SAAAH,GAEA,IADA,IAAA6Q,EAAA,GACAzpB,EAAA,EAAAA,EAAA4Y,EAAA7Z,SAAAiB,EACAypB,EAAA7Q,EAAA5Y,IAAA,EAOA,OAAA,WACA,IAAA,IAAAkC,EAAAD,OAAAC,KAAAgB,MAAAlD,EAAAkC,EAAAnD,OAAA,GAAA,EAAAiB,IAAAA,EACA,GAAA,IAAAypB,EAAAvnB,EAAAlC,KAAAkD,KAAAhB,EAAAlC,MAAA/B,IAAA,OAAAiF,KAAAhB,EAAAlC,IACA,OAAAkC,EAAAlC,KAiBAgN,EAAAiM,YAAA,SAAAL,GAQA,OAAA,SAAA1O,GACA,IAAA,IAAAlK,EAAA,EAAAA,EAAA4Y,EAAA7Z,SAAAiB,EACA4Y,EAAA5Y,KAAAkK,UACAhH,KAAA0V,EAAA5Y,MAoBAgN,EAAA4D,cAAA,CACA8Y,MAAA/oB,OACAgpB,MAAAhpB,OACAmO,MAAAnO,OACAwJ,MAAA,GAIA6C,EAAAsG,EAAA,WACA,IAAAkL,EAAAxR,EAAAwR,OAEAA,GAMAxR,EAAA8b,EAAAtK,EAAA8I,OAAAziB,WAAAyiB,MAAA9I,EAAA8I,MAEA,SAAA1kB,EAAAgnB,GACA,OAAA,IAAApL,EAAA5b,EAAAgnB,IAEA5c,EAAA+b,EAAAvK,EAAAqL,aAEA,SAAAzgB,GACA,OAAA,IAAAoV,EAAApV,KAbA4D,EAAA8b,EAAA9b,EAAA+b,EAAA,gECpZAvqB,EAAAC,QAwHA,SAAAoP,GAGA,IAAAX,EAAAF,EAAA3L,QAAA,CAAA,KAAAwM,EAAA3D,KAAA,UAAA8C,CACA,oCADAA,CAEA,WAAA,mBACA7B,EAAA0C,EAAAgY,YACAiE,EAAA,GACA3e,EAAApM,QAAAmO,EACA,YAEA,IAAA,IAAAlN,EAAA,EAAAA,EAAA6N,EAAAC,YAAA/O,SAAAiB,EAAA,CACA,IAAAmN,EAAAU,EAAAoB,EAAAjP,GAAAZ,UACAiQ,EAAA,IAAArC,EAAAe,SAAAZ,EAAAjD,MAMA,GAJAiD,EAAA4C,UAAA7C,EACA,sCAAAmC,EAAAlC,EAAAjD,MAGAiD,EAAAa,IAAAd,EACA,yBAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,UAFAD,CAGA,wBAAAmC,EAHAnC,CAIA,gCACA8c,EAAA9c,EAAAC,EAAA,QACA8c,EAAA/c,EAAAC,EAAAnN,EAAAqP,EAAA,SAAA4a,CACA,UAGA,GAAA9c,EAAAI,SAAAL,EACA,yBAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,SAFAD,CAGA,gCAAAmC,GACA4a,EAAA/c,EAAAC,EAAAnN,EAAAqP,EAAA,MAAA4a,CACA,SAGA,CACA,GAAA9c,EAAAoB,OAAA,CACA,IAAA2b,EAAAld,EAAAe,SAAAZ,EAAAoB,OAAArE,MACA,IAAA4f,EAAA3c,EAAAoB,OAAArE,OAAAgD,EACA,cAAAgd,EADAhd,CAEA,WAAAC,EAAAoB,OAAArE,KAAA,qBACA4f,EAAA3c,EAAAoB,OAAArE,MAAA,EACAgD,EACA,QAAAgd,GAEAD,EAAA/c,EAAAC,EAAAnN,EAAAqP,GAEAlC,EAAA4C,UAAA7C,EACA,KAEA,OAAAA,EACA,gBA3KA,IAAAH,EAAAxO,EAAA,IACAyO,EAAAzO,EAAA,IAEA,SAAAwrB,EAAA5c,EAAAmY,GACA,OAAAnY,EAAAjD,KAAA,KAAAob,GAAAnY,EAAAI,UAAA,UAAA+X,EAAA,KAAAnY,EAAAa,KAAA,WAAAsX,EAAA,MAAAnY,EAAAlC,QAAA,IAAA,IAAA,YAYA,SAAAgf,EAAA/c,EAAAC,EAAAC,EAAAiC,GAEA,GAAAlC,EAAAG,aACA,GAAAH,EAAAG,wBAAAP,EAAA,CAAAG,EACA,cAAAmC,EADAnC,CAEA,WAFAA,CAGA,WAAA6c,EAAA5c,EAAA,eACA,IAAA,IAAAjL,EAAAD,OAAAC,KAAAiL,EAAAG,aAAAzB,QAAArL,EAAA,EAAAA,EAAA0B,EAAAnD,SAAAyB,EAAA0M,EACA,WAAAC,EAAAG,aAAAzB,OAAA3J,EAAA1B,KACA0M,EACA,QADAA,CAEA,UAEAA,EACA,IADAA,CAEA,8BAAAE,EAAAiC,EAFAnC,CAGA,QAHAA,CAIA,aAAAC,EAAAjD,KAAA,IAJAgD,CAKA,UAGA,OAAAC,EAAA1C,MACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAyC,EACA,0BAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,YACA,MACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAD,EACA,kFAAAmC,EAAAA,EAAAA,EAAAA,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,iBACA,MACA,IAAA,QACA,IAAA,SAAAD,EACA,2BAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,WACA,MACA,IAAA,OAAAD,EACA,4BAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,YACA,MACA,IAAA,SAAAD,EACA,yBAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,WACA,MACA,IAAA,QAAAD,EACA,4DAAAmC,EAAAA,EAAAA,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,WAIA,OAAAD,EAYA,SAAA8c,EAAA9c,EAAAC,EAAAkC,GAEA,OAAAlC,EAAAlC,SACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAiC,EACA,6BAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,gBACA,MACA,IAAA,QACA,IAAA,SACA,IAAA,SACA,IAAA,UACA,IAAA,WAAAD,EACA,6BAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,qBACA,MACA,IAAA,OAAAD,EACA,4BAAAmC,EADAnC,CAEA,WAAA6c,EAAA5c,EAAA,gBAGA,OAAAD,uCCzGA,IAAAmH,EAAA5V,EAEA2V,EAAA7V,EAAA,IA6BA8V,EAAA,wBAAA,CAEAzG,WAAA,SAAA6H,GAGA,GAAAA,GAAAA,EAAA,SAAA,CAEA,IAAAvL,EAAAuL,EAAA,SAAA0F,UAAA,EAAA1F,EAAA,SAAAqL,YAAA,MACArW,EAAAvH,KAAAoU,OAAApN,GAEA,GAAAO,EAAA,CAEA,IAAAD,EAAA,KAAAiL,EAAA,SAAA,GACAA,EAAA,SAAAmI,OAAA,GAAAnI,EAAA,SAKA,OAHAjL,EAAA0E,QAAA,OACA1E,EAAA,IAAAA,GAEAtH,KAAA+M,OAAA,CACAzF,SAAAA,EACA5H,MAAA6H,EAAAxK,OAAAwK,EAAAmD,WAAA6H,IAAAiL,YAKA,OAAAxd,KAAA0K,WAAA6H,IAGAxH,SAAA,SAAA0D,EAAA1N,GAGA,IACA6E,EAAA,GACAoB,EAAA,GAGA,GAAAjG,GAAAA,EAAAkG,MAAAwH,EAAAnH,UAAAmH,EAAA/O,MAAA,CAEAsH,EAAAyH,EAAAnH,SAAA2Q,UAAA,EAAAxJ,EAAAnH,SAAAsW,YAAA,MAEAhY,EAAA6I,EAAAnH,SAAA2Q,UAAA,EAAA,EAAAxJ,EAAAnH,SAAAsW,YAAA,MACA,IAAArW,EAAAvH,KAAAoU,OAAApN,GAEAO,IACAkH,EAAAlH,EAAAzJ,OAAA2Q,EAAA/O,QAIA,GAAA+O,aAAAzO,KAAA2P,QAAAlB,aAAAyC,GAaA,OAAAlR,KAAA+K,SAAA0D,EAAA1N,GAZA,IAAAwR,EAAA9D,EAAAwD,MAAAlH,SAAA0D,EAAA1N,GASA,MALA,KAAA6E,IACAA,EAvBA,wBAyBAoB,EAAApB,GANA,MAAA6I,EAAAwD,MAAA1H,SAAA,GACAkE,EAAAwD,MAAA1H,SAAAmQ,OAAA,GAAAjM,EAAAwD,MAAA1H,UAMAgI,EAAA,SAAAvL,EACAuL,gCC/FAjX,EAAAC,QAAA8V,EAEA,IAEAC,EAFAxH,EAAAzO,EAAA,IAIA6f,EAAApR,EAAAoR,SACA5e,EAAAwN,EAAAxN,OACAiK,EAAAuD,EAAAvD,KAWA,SAAA0gB,EAAAzrB,EAAAgL,EAAArE,GAMAnC,KAAAxE,GAAAA,EAMAwE,KAAAwG,IAAAA,EAMAxG,KAAAmX,KAAApc,GAMAiF,KAAAmC,IAAAA,EAIA,SAAA+kB,KAUA,SAAAC,EAAAjV,GAMAlS,KAAAuX,KAAArF,EAAAqF,KAMAvX,KAAAonB,KAAAlV,EAAAkV,KAMApnB,KAAAwG,IAAA0L,EAAA1L,IAMAxG,KAAAmX,KAAAjF,EAAAmV,OAQA,SAAAhW,IAMArR,KAAAwG,IAAA,EAMAxG,KAAAuX,KAAA,IAAA0P,EAAAC,EAAA,EAAA,GAMAlnB,KAAAonB,KAAApnB,KAAAuX,KAMAvX,KAAAqnB,OAAA,KASA,SAAAta,IACA,OAAAjD,EAAAwR,OACA,WACA,OAAAjK,EAAAtE,OAAA,WACA,OAAA,IAAAuE,OAIA,WACA,OAAA,IAAAD,GAuCA,SAAAiW,EAAAnlB,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EAoBA,SAAAolB,EAAA/gB,EAAArE,GACAnC,KAAAwG,IAAAA,EACAxG,KAAAmX,KAAApc,GACAiF,KAAAmC,IAAAA,EA8CA,SAAAqlB,EAAArlB,EAAAC,EAAAC,GACA,KAAAF,EAAA4B,IACA3B,EAAAC,KAAA,IAAAF,EAAA2B,GAAA,IACA3B,EAAA2B,IAAA3B,EAAA2B,KAAA,EAAA3B,EAAA4B,IAAA,MAAA,EACA5B,EAAA4B,MAAA,EAEA,KAAA,IAAA5B,EAAA2B,IACA1B,EAAAC,KAAA,IAAAF,EAAA2B,GAAA,IACA3B,EAAA2B,GAAA3B,EAAA2B,KAAA,EAEA1B,EAAAC,KAAAF,EAAA2B,GA2CA,SAAA2jB,EAAAtlB,EAAAC,EAAAC,GACAD,EAAAC,GAAA,IAAAF,EACAC,EAAAC,EAAA,GAAAF,IAAA,EAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GAAA,IACAC,EAAAC,EAAA,GAAAF,IAAA,GA7JAkP,EAAAtE,OAAAA,IAOAsE,EAAApL,MAAA,SAAAC,GACA,OAAA,IAAA4D,EAAAnO,MAAAuK,IAKA4D,EAAAnO,QAAAA,QACA0V,EAAApL,MAAA6D,EAAAob,KAAA7T,EAAApL,MAAA6D,EAAAnO,MAAAuE,UAAA4b,WAUAzK,EAAAnR,UAAAwnB,EAAA,SAAAlsB,EAAAgL,EAAArE,GAGA,OAFAnC,KAAAonB,KAAApnB,KAAAonB,KAAAjQ,KAAA,IAAA8P,EAAAzrB,EAAAgL,EAAArE,GACAnC,KAAAwG,KAAAA,EACAxG,OA8BAunB,EAAArnB,UAAAnB,OAAAgO,OAAAka,EAAA/mB,YACA1E,GAxBA,SAAA2G,EAAAC,EAAAC,GACA,KAAA,IAAAF,GACAC,EAAAC,KAAA,IAAAF,EAAA,IACAA,KAAA,EAEAC,EAAAC,GAAAF,GA0BAkP,EAAAnR,UAAA6b,OAAA,SAAArc,GAWA,OARAM,KAAAwG,MAAAxG,KAAAonB,KAAApnB,KAAAonB,KAAAjQ,KAAA,IAAAoQ,GACA7nB,KAAA,GACA,IAAA,EACAA,EAAA,MAAA,EACAA,EAAA,QAAA,EACAA,EAAA,UAAA,EACA,EACAA,IAAA8G,IACAxG,MASAqR,EAAAnR,UAAA8b,MAAA,SAAAtc,GACA,OAAAA,EAAA,EACAM,KAAA0nB,EAAAF,EAAA,GAAAtM,EAAA5L,WAAA5P,IACAM,KAAA+b,OAAArc,IAQA2R,EAAAnR,UAAA+b,OAAA,SAAAvc,GACA,OAAAM,KAAA+b,QAAArc,GAAA,EAAAA,GAAA,MAAA,IAkCA2R,EAAAnR,UAAAwc,MAZArL,EAAAnR,UAAAyc,OAAA,SAAAjd,GACA,IAAAgc,EAAAR,EAAAkJ,KAAA1kB,GACA,OAAAM,KAAA0nB,EAAAF,EAAA9L,EAAA7f,SAAA6f,IAkBArK,EAAAnR,UAAA0c,OAAA,SAAAld,GACA,IAAAgc,EAAAR,EAAAkJ,KAAA1kB,GAAAwkB,WACA,OAAAlkB,KAAA0nB,EAAAF,EAAA9L,EAAA7f,SAAA6f,IAQArK,EAAAnR,UAAAgc,KAAA,SAAAxc,GACA,OAAAM,KAAA0nB,EAAAJ,EAAA,EAAA5nB,EAAA,EAAA,IAyBA2R,EAAAnR,UAAAkc,SAVA/K,EAAAnR,UAAAic,QAAA,SAAAzc,GACA,OAAAM,KAAA0nB,EAAAD,EAAA,EAAA/nB,IAAA,IA6BA2R,EAAAnR,UAAA6c,SAZA1L,EAAAnR,UAAA4c,QAAA,SAAApd,GACA,IAAAgc,EAAAR,EAAAkJ,KAAA1kB,GACA,OAAAM,KAAA0nB,EAAAD,EAAA,EAAA/L,EAAA5X,IAAA4jB,EAAAD,EAAA,EAAA/L,EAAA3X,KAkBAsN,EAAAnR,UAAAmc,MAAA,SAAA3c,GACA,OAAAM,KAAA0nB,EAAA5d,EAAAuS,MAAAhY,aAAA,EAAA3E,IASA2R,EAAAnR,UAAAoc,OAAA,SAAA5c,GACA,OAAAM,KAAA0nB,EAAA5d,EAAAuS,MAAAtX,cAAA,EAAArF,IAGA,IAAAioB,EAAA7d,EAAAnO,MAAAuE,UAAA4V,IACA,SAAA3T,EAAAC,EAAAC,GACAD,EAAA0T,IAAA3T,EAAAE,IAGA,SAAAF,EAAAC,EAAAC,GACA,IAAA,IAAAvF,EAAA,EAAAA,EAAAqF,EAAAtG,SAAAiB,EACAsF,EAAAC,EAAAvF,GAAAqF,EAAArF,IAQAuU,EAAAnR,UAAA0L,MAAA,SAAAlM,GACA,IAAA8G,EAAA9G,EAAA7D,SAAA,EACA,IAAA2K,EACA,OAAAxG,KAAA0nB,EAAAJ,EAAA,EAAA,GACA,GAAAxd,EAAA+D,SAAAnO,GAAA,CACA,IAAA0C,EAAAiP,EAAApL,MAAAO,EAAAlK,EAAAT,OAAA6D,IACApD,EAAAwB,OAAA4B,EAAA0C,EAAA,GACA1C,EAAA0C,EAEA,OAAApC,KAAA+b,OAAAvV,GAAAkhB,EAAAC,EAAAnhB,EAAA9G,IAQA2R,EAAAnR,UAAA3D,OAAA,SAAAmD,GACA,IAAA8G,EAAAD,EAAA1K,OAAA6D,GACA,OAAA8G,EACAxG,KAAA+b,OAAAvV,GAAAkhB,EAAAnhB,EAAAG,MAAAF,EAAA9G,GACAM,KAAA0nB,EAAAJ,EAAA,EAAA,IAQAjW,EAAAnR,UAAA+iB,KAAA,WAIA,OAHAjjB,KAAAqnB,OAAA,IAAAF,EAAAnnB,MACAA,KAAAuX,KAAAvX,KAAAonB,KAAA,IAAAH,EAAAC,EAAA,EAAA,GACAlnB,KAAAwG,IAAA,EACAxG,MAOAqR,EAAAnR,UAAA0nB,MAAA,WAUA,OATA5nB,KAAAqnB,QACArnB,KAAAuX,KAAAvX,KAAAqnB,OAAA9P,KACAvX,KAAAonB,KAAApnB,KAAAqnB,OAAAD,KACApnB,KAAAwG,IAAAxG,KAAAqnB,OAAA7gB,IACAxG,KAAAqnB,OAAArnB,KAAAqnB,OAAAlQ,OAEAnX,KAAAuX,KAAAvX,KAAAonB,KAAA,IAAAH,EAAAC,EAAA,EAAA,GACAlnB,KAAAwG,IAAA,GAEAxG,MAOAqR,EAAAnR,UAAAgjB,OAAA,WACA,IAAA3L,EAAAvX,KAAAuX,KACA6P,EAAApnB,KAAAonB,KACA5gB,EAAAxG,KAAAwG,IAOA,OANAxG,KAAA4nB,QAAA7L,OAAAvV,GACAA,IACAxG,KAAAonB,KAAAjQ,KAAAI,EAAAJ,KACAnX,KAAAonB,KAAAA,EACApnB,KAAAwG,KAAAA,GAEAxG,MAOAqR,EAAAnR,UAAAsd,OAAA,WAIA,IAHA,IAAAjG,EAAAvX,KAAAuX,KAAAJ,KACA/U,EAAApC,KAAAgN,YAAA/G,MAAAjG,KAAAwG,KACAnE,EAAA,EACAkV,GACAA,EAAA/b,GAAA+b,EAAApV,IAAAC,EAAAC,GACAA,GAAAkV,EAAA/Q,IACA+Q,EAAAA,EAAAJ,KAGA,OAAA/U,GAGAiP,EAAAjB,EAAA,SAAAyX,GACAvW,EAAAuW,EACAxW,EAAAtE,OAAAA,IACAuE,EAAAlB,iCC9cA9U,EAAAC,QAAA+V,EAGA,IAAAD,EAAAhW,EAAA,KACAiW,EAAApR,UAAAnB,OAAAgO,OAAAsE,EAAAnR,YAAA8M,YAAAsE,EAEA,IAAAxH,EAAAzO,EAAA,IAQA,SAAAiW,IACAD,EAAA/K,KAAAtG,MAwCA,SAAA8nB,EAAA3lB,EAAAC,EAAAC,GACAF,EAAAtG,OAAA,GACAiO,EAAAvD,KAAAG,MAAAvE,EAAAC,EAAAC,GACAD,EAAAujB,UACAvjB,EAAAujB,UAAAxjB,EAAAE,GAEAD,EAAAsE,MAAAvE,EAAAE,GA3CAiP,EAAAlB,EAAA,WAOAkB,EAAArL,MAAA6D,EAAA+b,EAEAvU,EAAAyW,iBAAAje,EAAAwR,QAAAxR,EAAAwR,OAAApb,qBAAAyB,YAAA,QAAAmI,EAAAwR,OAAApb,UAAA4V,IAAA9O,KACA,SAAA7E,EAAAC,EAAAC,GACAD,EAAA0T,IAAA3T,EAAAE,IAIA,SAAAF,EAAAC,EAAAC,GACA,GAAAF,EAAA6lB,KACA7lB,EAAA6lB,KAAA5lB,EAAAC,EAAA,EAAAF,EAAAtG,aACA,IAAA,IAAAiB,EAAA,EAAAA,EAAAqF,EAAAtG,QACAuG,EAAAC,KAAAF,EAAArF,OAQAwU,EAAApR,UAAA0L,MAAA,SAAAlM,GACAoK,EAAA+D,SAAAnO,KACAA,EAAAoK,EAAA8b,EAAAlmB,EAAA,WACA,IAAA8G,EAAA9G,EAAA7D,SAAA,EAIA,OAHAmE,KAAA+b,OAAAvV,GACAA,GACAxG,KAAA0nB,EAAApW,EAAAyW,iBAAAvhB,EAAA9G,GACAM,MAeAsR,EAAApR,UAAA3D,OAAA,SAAAmD,GACA,IAAA8G,EAAAsD,EAAAwR,OAAA2M,WAAAvoB,GAIA,OAHAM,KAAA+b,OAAAvV,GACAA,GACAxG,KAAA0nB,EAAAI,EAAAthB,EAAA9G,GACAM,MAWAsR,EAAAlB,qB3CpFAnV,KAAAC,OAcAC,EAPA,SAAA+sB,EAAAlhB,GACA,IAAAmhB,EAAAltB,EAAA+L,GAGA,OAFAmhB,GACAntB,EAAAgM,GAAA,GAAAV,KAAA6hB,EAAAltB,EAAA+L,GAAA,CAAAzL,QAAA,IAAA2sB,EAAAC,EAAAA,EAAA5sB,SACA4sB,EAAA5sB,QAGA2sB,CAAAhtB,EAAA,IAGAC,EAAA2O,KAAAqb,OAAAhqB,SAAAA,EAGA,mBAAA4Y,QAAAA,OAAAqU,KACArU,OAAA,CAAA,QAAA,SAAApF,GAKA,OAJAA,GAAAA,EAAA0Z,SACAltB,EAAA2O,KAAA6E,KAAAA,EACAxT,EAAAiW,aAEAjW,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n if (!commonRe.test(name)) {\n name = \"google/protobuf/\" + name + \".proto\";\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n }\n common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n /**\n * Properties of a google.protobuf.Any message.\n * @interface IAny\n * @type {Object}\n * @property {string} [typeUrl]\n * @property {Uint8Array} [bytes]\n * @memberof common\n */\n Any: {\n fields: {\n type_url: {\n type: \"string\",\n id: 1\n },\n value: {\n type: \"bytes\",\n id: 2\n }\n }\n }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n /**\n * Properties of a google.protobuf.Duration message.\n * @interface IDuration\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Duration: timeType = {\n fields: {\n seconds: {\n type: \"int64\",\n id: 1\n },\n nanos: {\n type: \"int32\",\n id: 2\n }\n }\n }\n});\n\ncommon(\"timestamp\", {\n\n /**\n * Properties of a google.protobuf.Timestamp message.\n * @interface ITimestamp\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n /**\n * Properties of a google.protobuf.Empty message.\n * @interface IEmpty\n * @memberof common\n */\n Empty: {\n fields: {}\n }\n});\n\ncommon(\"struct\", {\n\n /**\n * Properties of a google.protobuf.Struct message.\n * @interface IStruct\n * @type {Object}\n * @property {Object.} [fields]\n * @memberof common\n */\n Struct: {\n fields: {\n fields: {\n keyType: \"string\",\n type: \"Value\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Value message.\n * @interface IValue\n * @type {Object}\n * @property {string} [kind]\n * @property {0} [nullValue]\n * @property {number} [numberValue]\n * @property {string} [stringValue]\n * @property {boolean} [boolValue]\n * @property {IStruct} [structValue]\n * @property {IListValue} [listValue]\n * @memberof common\n */\n Value: {\n oneofs: {\n kind: {\n oneof: [\n \"nullValue\",\n \"numberValue\",\n \"stringValue\",\n \"boolValue\",\n \"structValue\",\n \"listValue\"\n ]\n }\n },\n fields: {\n nullValue: {\n type: \"NullValue\",\n id: 1\n },\n numberValue: {\n type: \"double\",\n id: 2\n },\n stringValue: {\n type: \"string\",\n id: 3\n },\n boolValue: {\n type: \"bool\",\n id: 4\n },\n structValue: {\n type: \"Struct\",\n id: 5\n },\n listValue: {\n type: \"ListValue\",\n id: 6\n }\n }\n },\n\n NullValue: {\n values: {\n NULL_VALUE: 0\n }\n },\n\n /**\n * Properties of a google.protobuf.ListValue message.\n * @interface IListValue\n * @type {Object}\n * @property {Array.} [values]\n * @memberof common\n */\n ListValue: {\n fields: {\n values: {\n rule: \"repeated\",\n type: \"Value\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"wrappers\", {\n\n /**\n * Properties of a google.protobuf.DoubleValue message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n DoubleValue: {\n fields: {\n value: {\n type: \"double\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.FloatValue message.\n * @interface IFloatValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FloatValue: {\n fields: {\n value: {\n type: \"float\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int64Value message.\n * @interface IInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n Int64Value: {\n fields: {\n value: {\n type: \"int64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt64Value message.\n * @interface IUInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n UInt64Value: {\n fields: {\n value: {\n type: \"uint64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int32Value message.\n * @interface IInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int32Value: {\n fields: {\n value: {\n type: \"int32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt32Value message.\n * @interface IUInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt32Value: {\n fields: {\n value: {\n type: \"uint32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BoolValue message.\n * @interface IBoolValue\n * @type {Object}\n * @property {boolean} [value]\n * @memberof common\n */\n BoolValue: {\n fields: {\n value: {\n type: \"bool\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.StringValue message.\n * @interface IStringValue\n * @type {Object}\n * @property {string} [value]\n * @memberof common\n */\n StringValue: {\n fields: {\n value: {\n type: \"string\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BytesValue message.\n * @interface IBytesValue\n * @type {Object}\n * @property {Uint8Array} [value]\n * @memberof common\n */\n BytesValue: {\n fields: {\n value: {\n type: \"bytes\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"field_mask\", {\n\n /**\n * Properties of a google.protobuf.FieldMask message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FieldMask: {\n fields: {\n paths: {\n rule: \"repeated\",\n type: \"string\",\n id: 1\n }\n }\n }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n return common[file] || null;\n};\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(15),\n util = require(37);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(d%s){\", prop);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=d%s>>>0\", prop, prop);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=d%s|0\", prop, prop);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\n (\"m%s=parseInt(d%s,10)\", prop, prop)\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\n (\"m%s=d%s\", prop, prop)\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof d%s===\\\"string\\\")\", prop)\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n (\"else if(d%s.length)\", prop)\n (\"m%s=d%s\", prop, prop);\n break;\n case \"string\": gen\n (\"m%s=String(d%s)\", prop, prop);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(d%s)\", prop, prop);\n break;\n /* default: gen\n (\"m%s=d%s\", prop, prop);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"var c2 = r.uint32()+r.pos\");\n\n if (types.defaults[field.keyType] !== undefined) gen\n (\"k=%j\", types.defaults[field.keyType]);\n else gen\n (\"k=null\");\n\n if (types.defaults[type] !== undefined) gen\n (\"value=%j\", types.defaults[type]);\n else gen\n (\"value=null\");\n\n gen\n (\"while(r.pos>>3){\")\n (\"case 1: k=r.%s(); break\", field.keyType)\n (\"case 2:\");\n\n if (types.basic[type] === undefined) gen\n (\"value=types[%i].decode(r,r.uint32())\", i); // can't be groups\n else gen\n (\"value=r.%s()\", type);\n\n gen\n (\"break\")\n (\"default:\")\n (\"r.skipType(tag2&7)\")\n (\"break\")\n (\"}\")\n (\"}\");\n\n if (types.long[field.keyType] !== undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=value\", ref);\n else gen\n (\"%s[k]=value\", ref);\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0)\n : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) { gen\n (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\n\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", ref)\n (\"w.%s(%s[i])\", type, ref)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", ref);\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(23),\n util = require(37);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(15),\n types = require(36),\n util = require(37);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(18);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(14);\nprotobuf.decoder = require(13);\nprotobuf.verifier = require(40);\nprotobuf.converter = require(12);\n\n// Reflection\nprotobuf.ReflectionObject = require(24);\nprotobuf.Namespace = require(23);\nprotobuf.Root = require(29);\nprotobuf.Enum = require(15);\nprotobuf.Type = require(35);\nprotobuf.Field = require(16);\nprotobuf.OneOf = require(25);\nprotobuf.MapField = require(20);\nprotobuf.Service = require(33);\nprotobuf.Method = require(22);\n\n// Runtime\nprotobuf.Message = require(21);\nprotobuf.wrappers = require(41);\n\n// Utility\nprotobuf.types = require(36);\nprotobuf.util = require(37);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(42);\nprotobuf.BufferWriter = require(43);\nprotobuf.Reader = require(27);\nprotobuf.BufferReader = require(28);\n\n// Utility\nprotobuf.util = require(39);\nprotobuf.rpc = require(31);\nprotobuf.roots = require(30);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"full\";\n\n// Parser\nprotobuf.tokenize = require(34);\nprotobuf.parse = require(26);\nprotobuf.common = require(11);\n\n// Configure parser\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(16);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(36),\n util = require(37);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(39);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(37);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(16),\n util = require(37);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(37);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Parsed Options.\n * @type {Array.>|undefined}\n */\n this.parsedOptions = null;\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets a parsed option.\n * @param {string} name parsed Option name\n * @param {*} value Option value\n * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {\n if (!this.parsedOptions) {\n this.parsedOptions = [];\n }\n var parsedOptions = this.parsedOptions;\n if (propName) {\n // If setting a sub property of an option then try to merge it\n // with an existing option\n var opt = parsedOptions.find(function (opt) {\n return Object.prototype.hasOwnProperty.call(opt, name);\n });\n if (opt) {\n // If we found an existing option - just merge the property value\n var newValue = opt[name];\n util.setProperty(newValue, propName, value);\n } else {\n // otherwise, create a new option, set it's property and add it to the list\n opt = {};\n opt[name] = util.setProperty({}, propName, value);\n parsedOptions.push(opt);\n }\n } else {\n // Always create a new option when setting the value of the option itself\n var newOpt = {};\n newOpt[name] = value;\n parsedOptions.push(newOpt);\n }\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(16),\n util = require(37);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = require(34),\n Root = require(29),\n Type = require(35),\n Field = require(16),\n MapField = require(20),\n OneOf = require(25),\n Enum = require(15),\n Service = require(33),\n Method = require(22),\n types = require(36),\n util = require(37);\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var preferTrailingComment = options.preferTrailingComment || false;\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n syntax,\n isProto3 = false;\n\n var ptr = root;\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\n target.push(readString());\n else\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } while (skip(\",\", true));\n skip(\";\");\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n syntax = readString();\n isProto3 = syntax === \"proto3\";\n\n /* istanbul ignore if */\n if (!isProto3 && syntax !== \"proto2\")\n throw illegal(syntax, \"syntax\");\n\n skip(\";\");\n }\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && (typeof obj.comment !== \"string\" || preferTrailingComment))\n obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\n // parsing proto2 descriptors without the option, where applicable. This must be done for\n // all known packable types and anything that could be an enum (= is not a basic type).\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\n field.setOption(\"packed\", false, /* ifNotSet */ true);\n }\n\n function parseGroup(parent, rule) {\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {};\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment);\n }\n\n function parseOption(parent, token) {\n var isCustom = skip(\"(\", true);\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token;\n var option = name;\n var propName;\n\n if (isCustom) {\n skip(\")\");\n name = \"(\" + name + \")\";\n option = name;\n token = peek();\n if (fqTypeRefRe.test(token)) {\n propName = token.substr(1); //remove '.' before property name\n name += token;\n next();\n }\n }\n skip(\"=\");\n var optionValue = parseOptionValue(parent, name);\n setParsedOption(parent, option, optionValue, propName);\n }\n\n function parseOptionValue(parent, name) {\n if (skip(\"{\", true)) { // { a: \"foo\" b { c: \"bar\" } }\n var result = {};\n while (!skip(\"}\", true)) {\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var value;\n var propName = token;\n if (peek() === \"{\")\n value = parseOptionValue(parent, name + \".\" + token);\n else {\n skip(\":\");\n if (peek() === \"{\")\n value = parseOptionValue(parent, name + \".\" + token);\n else {\n value = readValue(true);\n setOption(parent, name + \".\" + token, value);\n }\n }\n var prevValue = result[propName];\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n result[propName] = value;\n skip(\",\", true);\n }\n return result;\n }\n\n var simpleValue = readValue(true);\n setOption(parent, name, simpleValue);\n return simpleValue;\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function setParsedOption(parent, name, value, propName) {\n if (parent.setParsedOption)\n parent.setParsedOption(name, value, propName);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token))\n return;\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n case \"optional\":\n parseField(parent, token, reference);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"option\":\n\n parseOption(ptr, token);\n skip(\";\");\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n syntax : syntax,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(39);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(27);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(39);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(23);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(16),\n Enum = require(15),\n OneOf = require(25),\n util = require(37);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(32);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(39);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(23);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(22),\n util = require(37),\n rpc = require(31);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = tokenize;\n\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\n\nvar setCommentRe = /^ *[*/]+ */,\n setCommentAltRe = /^\\s*\\*?\\/*/,\n setCommentSplitRe = /\\n/g,\n whitespaceRe = /\\s/,\n unescapeRe = /\\\\(.?)/g;\n\nvar unescapeMap = {\n \"0\": \"\\0\",\n \"r\": \"\\r\",\n \"n\": \"\\n\",\n \"t\": \"\\t\"\n};\n\n/**\n * Unescapes a string.\n * @param {string} str String to unescape\n * @returns {string} Unescaped string\n * @property {Object.} map Special characters map\n * @memberof tokenize\n */\nfunction unescape(str) {\n return str.replace(unescapeRe, function($0, $1) {\n switch ($1) {\n case \"\\\\\":\n case \"\":\n return $1;\n default:\n return unescapeMap[$1] || \"\";\n }\n });\n}\n\ntokenize.unescape = unescape;\n\n/**\n * Gets the next token and advances.\n * @typedef TokenizerHandleNext\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Peeks for the next token.\n * @typedef TokenizerHandlePeek\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Pushes a token back to the stack.\n * @typedef TokenizerHandlePush\n * @type {function}\n * @param {string} token Token\n * @returns {undefined}\n */\n\n/**\n * Skips the next token.\n * @typedef TokenizerHandleSkip\n * @type {function}\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] If optional\n * @returns {boolean} Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @typedef TokenizerHandleCmnt\n * @type {function}\n * @param {number} [line] Line number\n * @returns {string|null} Comment text or `null` if none\n */\n\n/**\n * Handle object returned from {@link tokenize}.\n * @interface ITokenizerHandle\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\n * @property {number} line Current line number\n */\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param {string} source Source contents\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns {ITokenizerHandle} Tokenizer handle\n */\nfunction tokenize(source, alternateCommentMode) {\n /* eslint-disable callback-return */\n source = source.toString();\n\n var offset = 0,\n length = source.length,\n line = 1,\n commentType = null,\n commentText = null,\n commentLine = 0,\n commentLineEmpty = false,\n commentIsLeading = false;\n\n var stack = [];\n\n var stringDelim = null;\n\n /* istanbul ignore next */\n /**\n * Creates an error for illegal syntax.\n * @param {string} subject Subject\n * @returns {Error} Error created\n * @inner\n */\n function illegal(subject) {\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\n }\n\n /**\n * Reads a string till its end.\n * @returns {string} String read\n * @inner\n */\n function readString() {\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\n re.lastIndex = offset - 1;\n var match = re.exec(source);\n if (!match)\n throw illegal(\"string\");\n offset = re.lastIndex;\n push(stringDelim);\n stringDelim = null;\n return unescape(match[1]);\n }\n\n /**\n * Gets the character at `pos` within the source.\n * @param {number} pos Position\n * @returns {string} Character\n * @inner\n */\n function charAt(pos) {\n return source.charAt(pos);\n }\n\n /**\n * Sets the current comment text.\n * @param {number} start Start offset\n * @param {number} end End offset\n * @param {boolean} isLeading set if a leading comment\n * @returns {undefined}\n * @inner\n */\n function setComment(start, end, isLeading) {\n commentType = source.charAt(start++);\n commentLine = line;\n commentLineEmpty = false;\n commentIsLeading = isLeading;\n var lookback;\n if (alternateCommentMode) {\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\n } else {\n lookback = 3; // \"///\" or \"/**\"\n }\n var commentOffset = start - lookback,\n c;\n do {\n if (--commentOffset < 0 ||\n (c = source.charAt(commentOffset)) === \"\\n\") {\n commentLineEmpty = true;\n break;\n }\n } while (c === \" \" || c === \"\\t\");\n var lines = source\n .substring(start, end)\n .split(setCommentSplitRe);\n for (var i = 0; i < lines.length; ++i)\n lines[i] = lines[i]\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\n .trim();\n commentText = lines\n .join(\"\\n\")\n .trim();\n }\n\n function isDoubleSlashCommentLine(startOffset) {\n var endOffset = findEndOfLine(startOffset);\n\n // see if remaining line matches comment pattern\n var lineText = source.substring(startOffset, endOffset);\n // look for 1 or 2 slashes since startOffset would already point past\n // the first slash that started the comment.\n var isComment = /^\\s*\\/{1,2}/.test(lineText);\n return isComment;\n }\n\n function findEndOfLine(cursor) {\n // find end of cursor's line\n var endOffset = cursor;\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\n endOffset++;\n }\n return endOffset;\n }\n\n /**\n * Obtains the next token.\n * @returns {string|null} Next token or `null` on eof\n * @inner\n */\n function next() {\n if (stack.length > 0)\n return stack.shift();\n if (stringDelim)\n return readString();\n var repeat,\n prev,\n curr,\n start,\n isDoc,\n isLeadingComment = offset === 0;\n do {\n if (offset === length)\n return null;\n repeat = false;\n while (whitespaceRe.test(curr = charAt(offset))) {\n if (curr === \"\\n\") {\n isLeadingComment = true;\n ++line;\n }\n if (++offset === length)\n return null;\n }\n\n if (charAt(offset) === \"/\") {\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n if (charAt(offset) === \"/\") { // Line\n if (!alternateCommentMode) {\n // check for triple-slash comment\n isDoc = charAt(start = offset + 1) === \"/\";\n\n while (charAt(++offset) !== \"\\n\") {\n if (offset === length) {\n return null;\n }\n }\n ++offset;\n if (isDoc) {\n setComment(start, offset - 1, isLeadingComment);\n }\n ++line;\n repeat = true;\n } else {\n // check for double-slash comments, consolidating consecutive lines\n start = offset;\n isDoc = false;\n if (isDoubleSlashCommentLine(offset)) {\n isDoc = true;\n do {\n offset = findEndOfLine(offset);\n if (offset === length) {\n break;\n }\n offset++;\n } while (isDoubleSlashCommentLine(offset));\n } else {\n offset = Math.min(length, findEndOfLine(offset) + 1);\n }\n if (isDoc) {\n setComment(start, offset, isLeadingComment);\n }\n line++;\n repeat = true;\n }\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\n // check for /** (regular comment mode) or /* (alternate comment mode)\n start = offset + 1;\n isDoc = alternateCommentMode || charAt(start) === \"*\";\n do {\n if (curr === \"\\n\") {\n ++line;\n }\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n prev = curr;\n curr = charAt(offset);\n } while (prev !== \"*\" || curr !== \"/\");\n ++offset;\n if (isDoc) {\n setComment(start, offset - 2, isLeadingComment);\n }\n repeat = true;\n } else {\n return \"/\";\n }\n }\n } while (repeat);\n\n // offset !== length if we got here\n\n var end = offset;\n delimRe.lastIndex = 0;\n var delim = delimRe.test(charAt(end++));\n if (!delim)\n while (end < length && !delimRe.test(charAt(end)))\n ++end;\n var token = source.substring(offset, offset = end);\n if (token === \"\\\"\" || token === \"'\")\n stringDelim = token;\n return token;\n }\n\n /**\n * Pushes a token back to the stack.\n * @param {string} token Token\n * @returns {undefined}\n * @inner\n */\n function push(token) {\n stack.push(token);\n }\n\n /**\n * Peeks for the next token.\n * @returns {string|null} Token or `null` on eof\n * @inner\n */\n function peek() {\n if (!stack.length) {\n var token = next();\n if (token === null)\n return null;\n push(token);\n }\n return stack[0];\n }\n\n /**\n * Skips a token.\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] Whether the token is optional\n * @returns {boolean} `true` when skipped, `false` if not\n * @throws {Error} When a required token is not present\n * @inner\n */\n function skip(expected, optional) {\n var actual = peek(),\n equals = actual === expected;\n if (equals) {\n next();\n return true;\n }\n if (!optional)\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\n return false;\n }\n\n /**\n * Gets a comment.\n * @param {number} [trailingLine] Line number if looking for a trailing comment\n * @returns {string|null} Comment text\n * @inner\n */\n function cmnt(trailingLine) {\n var ret = null;\n if (trailingLine === undefined) {\n if (commentLine === line - 1 && (alternateCommentMode || commentType === \"*\" || commentLineEmpty)) {\n ret = commentIsLeading ? commentText : null;\n }\n } else {\n /* istanbul ignore else */\n if (commentLine < trailingLine) {\n peek();\n }\n if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === \"/\")) {\n ret = commentIsLeading ? null : commentText;\n }\n }\n return ret;\n }\n\n return Object.defineProperty({\n next: next,\n peek: peek,\n push: push,\n skip: skip,\n cmnt: cmnt\n }, \"line\", {\n get: function() { return line; }\n });\n /* eslint-enable callback-return */\n}\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(23);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(15),\n OneOf = require(25),\n Field = require(16),\n MapField = require(20),\n Service = require(33),\n Message = require(21),\n Reader = require(27),\n Writer = require(42),\n util = require(37),\n encoder = require(14),\n decoder = require(13),\n verifier = require(40),\n converter = require(12),\n wrappers = require(41);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(37);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(39);\n\nvar roots = require(30);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(35);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(15);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n\n/**\n * Sets the value of a property by property path. If a value already exists, it is turned to an array\n * @param {Object.} dst Destination object\n * @param {string} path dot '.' delimited path of the property to set\n * @param {Object} value the value to set\n * @returns {Object.} Destination object\n */\nutil.setProperty = function setProperty(dst, path, value) {\n function setProp(dst, path, value) {\n var part = path.shift();\n if (path.length > 0) {\n dst[part] = setProp(dst[part] || {}, path, value);\n } else {\n var prevValue = dst[part];\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n dst[part] = value;\n }\n return dst;\n }\n\n if (typeof dst !== \"object\")\n throw TypeError(\"dst must be an object\");\n if (!path)\n throw TypeError(\"path must be specified\");\n\n path = path.split(\".\");\n return setProp(dst, path, value);\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(29))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(39);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(38);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(15),\n util = require(37);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(21);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n // Only use fully qualified type name after the last '/'\n var name = object[\"@type\"].substring(object[\"@type\"].lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n if (type_url.indexOf(\"/\") === -1) {\n type_url = \"/\" + type_url;\n }\n return this.create({\n type_url: type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // Default prefix\n var googleApi = \"type.googleapis.com/\";\n var prefix = \"\";\n var name = \"\";\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n // Separate the prefix used\n prefix = message.type_url.substring(0, message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n var messageName = message.$type.fullName[0] === \".\" ?\n message.$type.fullName.substr(1) : message.$type.fullName;\n // Default to type.googleapis.com prefix if no prefix is used\n if (prefix === \"\") {\n prefix = googleApi;\n }\n name = prefix + messageName;\n object[\"@type\"] = name;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(39);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(42);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(39);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/legacy-libs/protobufjs/package-lock.json b/legacy-libs/protobufjs/package-lock.json new file mode 100644 index 0000000..6224c88 --- /dev/null +++ b/legacy-libs/protobufjs/package-lock.json @@ -0,0 +1,8922 @@ +{ + "name": "protobufjs", + "version": "6.10.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/core": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", + "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.9.5", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", + "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.9.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-replace-supers": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/helpers": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", + "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0" + } + }, + "@babel/highlight": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", + "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true + }, + "@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/traverse": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", + "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.5", + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.9.0", + "@babel/types": "^7.9.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@gulp-sourcemaps/identity-map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.2.tgz", + "integrity": "sha512-ciiioYMLdo16ShmfHBXJBOFm3xPC4AuwO4xeRpFeHz7WK9PYsWCmigagG2XyzZpubK4a3qNKoUBDhbzHfa50LQ==", + "dev": true, + "requires": { + "acorn": "^5.0.3", + "css": "^2.2.1", + "normalize-path": "^2.1.1", + "source-map": "^0.6.0", + "through2": "^2.0.3" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, + "requires": { + "normalize-path": "^2.0.1", + "through2": "^2.0.3" + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", + "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/long": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, + "@types/node": { + "version": "13.11.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.1.tgz", + "integrity": "sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g==" + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, + "acorn-node": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", + "dev": true, + "requires": { + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" + }, + "dependencies": { + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + } + } + }, + "acorn-walk": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.0.0.tgz", + "integrity": "sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg==", + "dev": true + }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "requires": { + "ansi-wrap": "^0.1.0" + } + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "requires": { + "buffer-equal": "^1.0.0" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-initial": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "dev": true, + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", + "dev": true, + "requires": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + } + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "dev": true, + "requires": { + "async-done": "^1.2.2" + } + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", + "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "dev": true, + "requires": { + "array-filter": "^1.0.0" + } + }, + "bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "dev": true, + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + } + }, + "browser-resolve": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", + "dev": true, + "requires": { + "resolve": "^1.17.0" + }, + "dependencies": { + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "browser-unpack": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/browser-unpack/-/browser-unpack-1.4.2.tgz", + "integrity": "sha512-uHkiY4bmXjjBBWoKH1aRnEGTQxUUCCcVtoJfH9w1lmGGjETY4u93Zk+GRYkCE/SRMrdoMTINQ/1/manr/3aMVA==", + "dev": true, + "requires": { + "acorn-node": "^1.5.2", + "concat-stream": "^1.5.0", + "minimist": "^1.1.1" + } + }, + "browserify": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", + "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^2.0.0", + "browserify-zlib": "~0.2.0", + "buffer": "~5.2.1", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.1", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^3.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.2.1", + "labeled-stream-splicer": "^2.0.0", + "mkdirp-classic": "^0.5.2", + "module-deps": "^6.2.3", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "^1.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum-object": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^3.0.0", + "stream-http": "^3.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.12.0", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "browserify-wrap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-wrap/-/browserify-wrap-1.0.2.tgz", + "integrity": "sha1-DvJ3xnxplAkVnt8hraPchQF/lqo=", + "dev": true + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true + }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bundle-collapser": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/bundle-collapser/-/bundle-collapser-1.4.0.tgz", + "integrity": "sha512-Gd3K3+3KI1Utuk+gwAvuOVOjT/2XLGL8tU6FwDKk04LlOZkYfT0pwQllsG1Dv8RRhgcjNxZSDmmSXb0AOkwSwg==", + "dev": true, + "requires": { + "browser-pack": "^6.0.2", + "browser-unpack": "^1.1.0", + "concat-stream": "^1.5.0", + "falafel": "^2.1.0", + "minimist": "^1.1.1", + "through2": "^2.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cached-path-relative": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", + "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", + "dev": true + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "catharsis": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", + "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "fsevents": { + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", + "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1", + "node-pre-gyp": "*" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "3.2.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.9.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mkdirp": { + "version": "0.5.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.14.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + } + }, + "nopt": { + "version": "4.0.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "readable-stream": { + "version": "2.3.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.7.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.1", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.13", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.1.1", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "dev": true, + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-props": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", + "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", + "dev": true, + "requires": { + "each-props": "^1.3.0", + "is-plain-object": "^2.0.1" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dargs": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-fabulous": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", + "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", + "dev": true, + "requires": { + "debug": "3.X", + "memoizee": "0.4.X", + "object-assign": "4.X" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-equal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.3.tgz", + "integrity": "sha512-Spqdl4H+ky45I9ByyJtXteOm9CaIrPmnIPmOhrkKGNYWeDgCvJ8jNYVCTjChxW4FqGuZnLHADc8EKRMX6+CgvA==", + "dev": true, + "requires": { + "es-abstract": "^1.17.5", + "es-get-iterator": "^1.1.0", + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.2", + "is-regex": "^1.0.5", + "isarray": "^2.0.5", + "object-is": "^1.1.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.2", + "which-boxed-primitive": "^1.0.1", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.2" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, + "requires": { + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "^2.0.5", + "object-keys": "^1.0.8" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "deps-sort": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", + "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "shasum-object": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + } + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "detective": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", + "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", + "dev": true, + "requires": { + "acorn-node": "^1.6.1", + "defined": "^1.0.0", + "minimist": "^1.1.1" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + } + } + }, + "each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "email-addresses": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", + "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "eslint": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.1.0.tgz", + "integrity": "sha512-DfS3b8iHMK5z/YLSme8K5cge168I8j8o1uiVmFCgnnjxZQbCGyraF8bMl7Ju4yfBmCuxD7shOF7eqGkcuIHfsA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.1.0", + "espree": "^7.0.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + } + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.0.0.tgz", + "integrity": "sha512-/r2XEx5Mw4pgKdyb7GNLQNsu++asx/dltf/CI8RFi9oGHxmQFgvLbc5Op4U6i8Oaj+kdslhJtVlEZeAqH5qOTw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "dependencies": { + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "falafel": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.2.4.tgz", + "integrity": "sha512-0HXjo8XASWRmsS0X1EkhwEMZaD3Qvp7FfURwjLKjG1ghfRm/MGZl2r4cWUTv41KdNghTw4OUMmVtdGQp3+H+uQ==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "foreach": "^2.0.5", + "isarray": "^2.0.1", + "object-keys": "^1.0.6" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "dev": true, + "requires": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + } + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "filename-reserved-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz", + "integrity": "sha1-5hz4BfDeHJhFZ9A4bcXfUO5a9+Q=", + "dev": true + }, + "filenamify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-1.2.1.tgz", + "integrity": "sha1-qfL/0RxQO+0wABUCknI3jx8TZaU=", + "dev": true, + "requires": { + "filename-reserved-regex": "^1.0.0", + "strip-outer": "^1.0.0", + "trim-repeated": "^1.0.0" + } + }, + "filenamify-url": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/filenamify-url/-/filenamify-url-1.0.0.tgz", + "integrity": "sha1-syvYExnvWGO3MHi+1Q9GpPeXX1A=", + "dev": true, + "requires": { + "filenamify": "^1.0.0", + "humanize-url": "^1.0.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "dependencies": { + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + } + } + }, + "fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "fork-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/fork-stream/-/fork-stream-0.0.4.tgz", + "integrity": "sha1-24Sfznf2cIpfjzhq5TOgkHtUrnA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "gh-pages": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.0.0.tgz", + "integrity": "sha512-oaOfVcrSwnqoWUgZ6cmCDM6mUuWyOSG+SHjqxGBawN0F3SKaF5NwbeYDG+w2RNXO2HJ/5Iam4o7dP5NAtoHuwQ==", + "dev": true, + "requires": { + "async": "^2.6.1", + "commander": "^2.18.0", + "email-addresses": "^3.0.1", + "filenamify-url": "^1.0.0", + "fs-extra": "^8.1.0", + "globby": "^6.1.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + } + } + }, + "git-raw-commits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.3.tgz", + "integrity": "sha512-SoSsFL5lnixVzctGEi2uykjA7B5I0AhO9x6kdzvGRHbxsa6JSEgrgy1esRKsfOKE1cgyOJ/KDR2Trxu157sb8w==", + "dev": true, + "requires": { + "dargs": "^4.0.1", + "lodash.template": "^4.0.2", + "meow": "^5.0.0", + "split2": "^2.0.0", + "through2": "^3.0.0" + }, + "dependencies": { + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "git-semver-tags": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.0.0.tgz", + "integrity": "sha512-LajaAWLYVBff+1NVircURJFL8TQ3EMIcLAfHisWYX/nPoMwnTYfWAznQDmMujlLqoD12VtLmoSrF1sQ5MhimEQ==", + "dev": true, + "requires": { + "meow": "^7.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "camelcase": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, + "meow": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", + "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "arrify": "^2.0.1", + "camelcase": "^6.0.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + } + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + } + } + }, + "glob-watcher": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", + "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "object.defaults": "^1.1.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "glogg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "google-protobuf": { + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.11.4.tgz", + "integrity": "sha512-lL6b04rDirurUBOgsY2+LalI6Evq8eH5TcNzi7TYQ3BsIWelT0KSOQSBsXuavEkNf+odQU6c0lgz3UsZXeNX9Q==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "gulp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "dev": true, + "requires": { + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", + "vinyl-fs": "^3.0.0" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "gulp-cli": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", + "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", + "dev": true, + "requires": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.1.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.0.1", + "yargs": "^7.1.0" + } + } + } + }, + "gulp-header": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-2.0.9.tgz", + "integrity": "sha512-LMGiBx+qH8giwrOuuZXSGvswcIUh0OiioNkUpLhNyvaC6/Ga8X6cfAeme2L5PqsbXMhL8o8b/OmVqIQdxprhcQ==", + "dev": true, + "requires": { + "concat-with-sourcemaps": "^1.1.0", + "lodash.template": "^4.5.0", + "map-stream": "0.0.7", + "through2": "^2.0.0" + }, + "dependencies": { + "lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + } + } + }, + "gulp-if": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-if/-/gulp-if-3.0.0.tgz", + "integrity": "sha512-fCUEngzNiEZEK2YuPm+sdMpO6ukb8+/qzbGfJBXyNOXz85bCG7yBI+pPSl+N90d7gnLvMsarthsAImx0qy7BAw==", + "dev": true, + "requires": { + "gulp-match": "^1.1.0", + "ternary-stream": "^3.0.0", + "through2": "^3.0.1" + }, + "dependencies": { + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "gulp-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-1.1.0.tgz", + "integrity": "sha512-DlyVxa1Gj24DitY2OjEsS+X6tDpretuxD6wTfhXE/Rw2hweqc1f6D/XtsJmoiCwLWfXgR87W9ozEityPCVzGtQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.3" + } + }, + "gulp-sourcemaps": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-2.6.5.tgz", + "integrity": "sha512-SYLBRzPTew8T5Suh2U8jCSDKY+4NARua4aqjj8HOysBh2tSgT9u4jc1FYirAdPx1akUxxDeK++fqw6Jg0LkQRg==", + "dev": true, + "requires": { + "@gulp-sourcemaps/identity-map": "1.X", + "@gulp-sourcemaps/map-sources": "1.X", + "acorn": "5.X", + "convert-source-map": "1.X", + "css": "2.X", + "debug-fabulous": "1.X", + "detect-newline": "2.X", + "graceful-fs": "4.X", + "source-map": "~0.6.0", + "strip-bom-string": "1.X", + "through2": "2.X" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "gulp-uglify": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.2.tgz", + "integrity": "sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg==", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "extend-shallow": "^3.0.2", + "gulplog": "^1.0.0", + "has-gulplog": "^0.1.0", + "isobject": "^3.0.1", + "make-error-cause": "^1.1.1", + "safe-buffer": "^5.1.2", + "through2": "^2.0.0", + "uglify-js": "^3.0.5", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "^1.0.0" + } + }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "humanize-url": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/humanize-url/-/humanize-url-1.0.1.tgz", + "integrity": "sha1-9KuZ4NKIF0yk4eUEB8VfuuRk7/8=", + "dev": true, + "requires": { + "normalize-url": "^1.0.0", + "strip-url-auth": "^1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "~0.5.3" + } + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "insert-module-globals": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", + "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" + } + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.0.tgz", + "integrity": "sha512-t5mGUXC/xRheCK431ylNiSkGGpBp8bHENBcENTkDT6ppwPzEVxNGZRvgvmOEfbWkFhA7D2GEuE2mmQTr78sl2g==", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-boolean-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.0.1.tgz", + "integrity": "sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ==", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-number-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } + } + }, + "is-typed-array": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", + "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.0", + "es-abstract": "^1.17.4", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true + }, + "is-weakset": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.1.tgz", + "integrity": "sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw==", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", + "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@babel/parser": "^7.7.5", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jaguarjs-jsdoc": { + "version": "github:dcodeIO/jaguarjs-jsdoc#ade85ac841f5ca8be40c60d506102039a036a8fa", + "from": "github:dcodeIO/jaguarjs-jsdoc", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "js2xmlparser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", + "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", + "dev": true, + "requires": { + "xmlcreate": "^2.0.3" + } + }, + "jsdoc": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz", + "integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==", + "dev": true, + "requires": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.8.11", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^0.8.2", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.10.2" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "just-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", + "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "labeled-stream-splicer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", + "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "stream-splicer": "^2.0.0" + } + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "dev": true, + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "liftoff": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^3.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "~3.0.0" + } + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "requires": { + "es5-ext": "~0.10.2" + } + }, + "make-dir": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", + "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true + }, + "make-error-cause": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", + "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", + "dev": true, + "requires": { + "make-error": "^1.2.0" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.7.tgz", + "integrity": "sha512-REFmIaSS6szaD1bye80DMbp7ePwsPNvLTR5HunsUcZ0SG0rWJQ+Pz24R4UlTKtjKBPhxo0v0tOBDYjZQQknW8Q==", + "dev": true + }, + "marked": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", + "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==", + "dev": true + }, + "matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", + "dev": true, + "requires": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + }, + "dependencies": { + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + } + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, + "module-deps": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", + "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "browser-resolve": "^2.0.0", + "cached-path-relative": "^1.0.2", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.2.0", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stdout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", + "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "prepend-http": "^1.0.0", + "query-string": "^4.1.0", + "sort-keys": "^1.0.0" + } + }, + "now-and-later": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.0.tgz", + "integrity": "sha1-vGHLtFbXnLMiB85HygUTb/Ln1u4=", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", + "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + } + }, + "yargs-parser": { + "version": "18.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.2.tgz", + "integrity": "sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-is": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", + "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + } + } + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "~0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "platform": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz", + "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.0.tgz", + "integrity": "sha512-UWi0klDoq8xtVzlMRgENV9F7iCTZExaJQSQL187UXsxpk9NnrKGqTqqUNYAKGOzucSOxs2+jUnRNI+rLviPhJg==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", + "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", + "dev": true, + "requires": { + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + } + } + }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "requires": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "resolve": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "requires": { + "value-or-function": "^3.0.0" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "dev": true, + "requires": { + "through": "~2.3.4" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", + "dev": true, + "requires": { + "sver-compat": "^1.5.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shasum-object": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", + "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", + "dev": true, + "requires": { + "fast-safe-stringify": "^2.0.7" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shell-quote": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", + "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "dev": true + }, + "side-channel": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.2.tgz", + "integrity": "sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA==", + "dev": true, + "requires": { + "es-abstract": "^1.17.0-next.1", + "object-inspect": "^1.7.0" + } + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "dev": true + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "^2.0.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "requires": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "stream-http": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.1.1.tgz", + "integrity": "sha512-S7OqaYu0EkFpgeGFb/NPOoPLxFko7TPqtEeFg5DXPB4v/KETHG0Ln6fRFrNezoelpaDKmycEmmZ81cC9DAwgYg==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + } + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", + "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.prototype.trim": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz", + "integrity": "sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, + "strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, + "strip-url-auth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-url-auth/-/strip-url-auth-1.0.1.tgz", + "integrity": "sha1-IrD6OkE4WzO+PzMVUbu4N/oM164=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", + "dev": true, + "requires": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "^1.2.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "tape": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.0.1.tgz", + "integrity": "sha512-wVsOl2shKPcjdJdc8a+PwacvrOdJZJ57cLUXlxW4TQ2R6aihXwG0m0bKm4mA4wjtQNTaLMCrYNEb4f9fjHKUYQ==", + "dev": true, + "requires": { + "deep-equal": "^2.0.3", + "defined": "^1.0.0", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "function-bind": "^1.1.1", + "glob": "^7.1.6", + "has": "^1.0.3", + "inherits": "^2.0.4", + "is-regex": "^1.0.5", + "minimist": "^1.2.5", + "object-inspect": "^1.7.0", + "object-is": "^1.1.2", + "object.assign": "^4.1.0", + "resolve": "^1.17.0", + "resumer": "^0.0.0", + "string.prototype.trim": "^1.2.1", + "through": "^2.3.8" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "ternary-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ternary-stream/-/ternary-stream-3.0.0.tgz", + "integrity": "sha512-oIzdi+UL/JdktkT+7KU5tSIQjj8pbShj3OASuvDEhm0NT5lppsm7aXWAmAq4/QMaBIyfuEcNLbAQA+HpaISobQ==", + "dev": true, + "requires": { + "duplexify": "^4.1.1", + "fork-stream": "^0.0.4", + "merge-stream": "^2.0.0", + "through2": "^3.0.1" + }, + "dependencies": { + "duplexify": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz", + "integrity": "sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==", + "dev": true, + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "through2-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", + "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", + "dev": true, + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "~0.11.0" + } + }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "dev": true, + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "requires": { + "rimraf": "^3.0.0" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "requires": { + "through2": "^2.0.3" + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "tslint": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", + "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.3", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.13.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + } + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "uglify-js": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", + "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", + "dev": true, + "requires": { + "commander": "~2.20.3" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + } + } + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "undeclared-identifiers": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", + "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "dash-ast": "^1.0.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "underscore": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", + "dev": true + }, + "undertaker": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-stream": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", + "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", + "dev": true, + "requires": { + "json-stable-stringify": "^1.0.0", + "through2-filter": "^2.0.0" + }, + "dependencies": { + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + } + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", + "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, + "v8flags": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", + "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + } + } + }, + "vinyl-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.1.tgz", + "integrity": "sha1-lsGjR5uMU5JULGEgKQE7Wyf4i78=", + "dev": true, + "requires": { + "bl": "^1.2.1", + "through2": "^2.0.3" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + } + }, + "vinyl-source-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz", + "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=", + "dev": true, + "requires": { + "through2": "^2.0.3", + "vinyl": "^2.1.0" + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "requires": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "dependencies": { + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + } + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + } + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz", + "integrity": "sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ==", + "dev": true, + "requires": { + "is-bigint": "^1.0.0", + "is-boolean-object": "^1.0.0", + "is-number-object": "^1.0.3", + "is-string": "^1.0.4", + "is-symbol": "^1.0.2" + } + }, + "which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "requires": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "which-typed-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", + "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "es-abstract": "^1.17.5", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xmlcreate": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", + "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + } + } +} diff --git a/legacy-libs/signal-exit/CHANGELOG.md b/legacy-libs/signal-exit/CHANGELOG.md new file mode 100644 index 0000000..e2f70d2 --- /dev/null +++ b/legacy-libs/signal-exit/CHANGELOG.md @@ -0,0 +1,27 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [3.0.1](https://github.com/tapjs/signal-exit/compare/v3.0.0...v3.0.1) (2016-09-08) + + +### Bug Fixes + +* do not listen on SIGBUS, SIGFPE, SIGSEGV and SIGILL ([#40](https://github.com/tapjs/signal-exit/issues/40)) ([5b105fb](https://github.com/tapjs/signal-exit/commit/5b105fb)) + + + + +# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) + + +### Bug Fixes + +* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) +* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) + + +### BREAKING CHANGES + +* signal-exit no longer wires into SIGPROF diff --git a/legacy-libs/signal-exit/LICENSE.txt b/legacy-libs/signal-exit/LICENSE.txt new file mode 100644 index 0000000..eead04a --- /dev/null +++ b/legacy-libs/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/signal-exit/README.md b/legacy-libs/signal-exit/README.md new file mode 100644 index 0000000..8ebccab --- /dev/null +++ b/legacy-libs/signal-exit/README.md @@ -0,0 +1,40 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the proces to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/legacy-libs/signal-exit/index.js b/legacy-libs/signal-exit/index.js new file mode 100644 index 0000000..337f691 --- /dev/null +++ b/legacy-libs/signal-exit/index.js @@ -0,0 +1,157 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = require('assert') +var signals = require('./signals.js') + +var EE = require('events') +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter +} + +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} +} + +// Because this emitter is a global, we have to check to see if a +// previous version of this library failed to enable infinite listeners. +// I know what you're about to say. But literally everything about +// signal-exit is a compromise with evil. Get used to it. +if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true +} + +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove +} + +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} + +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} + +// { : , ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } +}) + +module.exports.signals = function () { + return signals +} + +module.exports.load = load + +var loaded = false + +function load () { + if (loaded) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit +} + +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} + +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } +} diff --git a/legacy-libs/signal-exit/package.json b/legacy-libs/signal-exit/package.json new file mode 100644 index 0000000..671387f --- /dev/null +++ b/legacy-libs/signal-exit/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "signal-exit@^3.0.2", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/restore-cursor" + ] + ], + "_from": "signal-exit@>=3.0.2 <4.0.0", + "_id": "signal-exit@3.0.2", + "_inCache": true, + "_location": "/signal-exit", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/signal-exit-3.0.2.tgz_1480821660838_0.6809983775019646" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "signal-exit@^3.0.2", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gauge", + "/loud-rejection", + "/restore-cursor" + ], + "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "_shasum": "b5fdc08f1287ea1178628e415e25132b73646c6d", + "_shrinkwrap": null, + "_spec": "signal-exit@^3.0.2", + "_where": "/var/opt/motion2/node_modules/restore-cursor", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "dependencies": {}, + "description": "when you want to fire an event no matter how a process exits.", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.10", + "nyc": "^8.1.0", + "standard": "^7.1.2", + "standard-version": "^2.3.0", + "tap": "^8.0.1" + }, + "directories": {}, + "dist": { + "shasum": "b5fdc08f1287ea1178628e415e25132b73646c6d", + "tarball": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz" + }, + "files": [ + "index.js", + "signals.js" + ], + "gitHead": "9c5ad9809fe6135ef22e2623989deaffe2a4fa8a", + "homepage": "https://github.com/tapjs/signal-exit", + "keywords": [ + "signal", + "exit" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "signal-exit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/signal-exit.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "tap --timeout=240 ./test/*.js --cov" + }, + "version": "3.0.2" +} diff --git a/legacy-libs/signal-exit/signals.js b/legacy-libs/signal-exit/signals.js new file mode 100644 index 0000000..3bd67a8 --- /dev/null +++ b/legacy-libs/signal-exit/signals.js @@ -0,0 +1,53 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/legacy-libs/wide-align/LICENSE b/legacy-libs/wide-align/LICENSE new file mode 100644 index 0000000..f4be44d --- /dev/null +++ b/legacy-libs/wide-align/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/legacy-libs/wide-align/README.md b/legacy-libs/wide-align/README.md new file mode 100644 index 0000000..32f1be0 --- /dev/null +++ b/legacy-libs/wide-align/README.md @@ -0,0 +1,47 @@ +wide-align +---------- + +A wide-character aware text alignment function for use in terminals / on the +console. + +### Usage + +``` +var align = require('wide-align') + +// Note that if you view this on a unicode console, all of the slashes are +// aligned. This is because on a console, all narrow characters are +// an en wide and all wide characters are an em. In browsers, this isn't +// held to and wide characters like "古" can be less than two narrow +// characters even with a fixed width font. + +console.log(align.center('abc', 10)) // ' abc ' +console.log(align.center('古古古', 10)) // ' 古古古 ' +console.log(align.left('abc', 10)) // 'abc ' +console.log(align.left('古古古', 10)) // '古古古 ' +console.log(align.right('abc', 10)) // ' abc' +console.log(align.right('古古古', 10)) // ' 古古古' +``` + +### Functions + +#### `align.center(str, length)` → `str` + +Returns *str* with spaces added to both sides such that that it is *length* +chars long and centered in the spaces. + +#### `align.left(str, length)` → `str` + +Returns *str* with spaces to the right such that it is *length* chars long. + +### `align.right(str, length)` → `str` + +Returns *str* with spaces to the left such that it is *length* chars long. + +### Origins + +These functions were originally taken from +[cliui](https://npmjs.com/package/cliui). Changes include switching to the +MUCH faster pad generation function from +[lodash](https://npmjs.com/package/lodash), making center alignment pad +both sides and adding left alignment. diff --git a/legacy-libs/wide-align/align.js b/legacy-libs/wide-align/align.js new file mode 100644 index 0000000..4f94ca4 --- /dev/null +++ b/legacy-libs/wide-align/align.js @@ -0,0 +1,65 @@ +'use strict' +var stringWidth = require('string-width') + +exports.center = alignCenter +exports.left = alignLeft +exports.right = alignRight + +// lodash's way of generating pad characters. + +function createPadding (width) { + var result = '' + var string = ' ' + var n = width + do { + if (n % 2) { + result += string; + } + n = Math.floor(n / 2); + string += string; + } while (n); + + return result; +} + +function alignLeft (str, width) { + var trimmed = str.trimRight() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return trimmed + padding +} + +function alignRight (str, width) { + var trimmed = str.trimLeft() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return padding + trimmed +} + +function alignCenter (str, width) { + var trimmed = str.trim() + if (trimmed.length === 0 && str.length >= width) return str + var padLeft = '' + var padRight = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + var padLeftBy = parseInt((width - strWidth) / 2, 10) + padLeft = createPadding(padLeftBy) + padRight = createPadding(width - (strWidth + padLeftBy)) + } + + return padLeft + trimmed + padRight +} diff --git a/legacy-libs/wide-align/package.json b/legacy-libs/wide-align/package.json new file mode 100644 index 0000000..c65f09c --- /dev/null +++ b/legacy-libs/wide-align/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/gauge" + ] + ], + "_from": "wide-align@>=1.1.0 <2.0.0", + "_id": "wide-align@1.1.3", + "_inCache": true, + "_location": "/wide-align", + "_nodeVersion": "9.3.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/wide-align_1.1.3_1527197810643_0.006292446790612027" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "6.1.0", + "_phantomChildren": {}, + "_requested": { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gauge" + ], + "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "_shasum": "ae074e6bdc0c14a431e804e624549c633b000457", + "_shrinkwrap": null, + "_spec": "wide-align@^1.1.0", + "_where": "/var/opt/motion2/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/wide-align/issues" + }, + "dependencies": { + "string-width": "^1.0.2 || 2" + }, + "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", + "devDependencies": { + "tap": "10 || 11 || 12" + }, + "directories": {}, + "dist": { + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "shasum": "ae074e6bdc0c14a431e804e624549c633b000457", + "tarball": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "fileCount": 4, + "unpackedSize": 4551, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBzBzCRA9TVsSAnZWagAAxeYP/1L3tYrqfB/llIclGJJM\ns3DfFOyKiZgjsOMKrRXJcqEryc1YPQWJ3BqMj0viqaYNXOoOpMihGVFqGP6b\nb+PlmX9INOi7hU7q6Wb/ICXnLDVOn83Ye8uQN/aKlCJ/s1cIz27A6dL7u2d2\nmP5a/Eaxok9JjgFipBwxm5d93ZiZ1rOoILaiXCTlvzSCNpbdsZVDbOuEC9Bz\nkLRRXuG3dd8t8g9xi24VT5VFEiztVlvTgTGfcain+dZccQpNUtgDdFxX0Zco\niAjwt0n1L1lip3n40GHEz8lzPYULz3qAvt07bBFevSWNfPDGF4+n9eN91TAQ\nTqpY1kIgqhwz+QsTVC/w13yL4RKbuRqmWNshIAz7xqM2gvyzU/Zawead3MsC\naP3tdu6PA5KZxosBzozwzw1KRBmkg4EFQZTj+3yu6tL4En5jVS2VzznyLlrM\n1/J7NWeCub+yoKCUTNNnr1pGTMMEOIzsfU8NhvjHb3TxVcFkabdITveOVPf+\n5cElAiJ3yvxY/I1V/0hXl0EAgQEsghdRuDcXN3E1PsE0TwAyreOl4QJWyHU5\nILJhOb2wk9IL0aPKlun6tacPehAqu2EWV5TiGISM9HNgaArY9D3mU0iHmnTy\nADsKuTPcnY00KHtxuZT6a3QgCvrvtmxHL6zm1521mru3V1+7oGkrk5c6Hlzk\nYbx2\r\n=w9c6\r\n-----END PGP SIGNATURE-----\r\n" + }, + "files": [ + "align.js" + ], + "gitHead": "6b766c9874a1e5157eda2ac75b90ccc01b313620", + "homepage": "https://github.com/iarna/wide-align#readme", + "keywords": [ + "wide", + "double", + "unicode", + "cjkv", + "pad", + "align" + ], + "license": "ISC", + "main": "align.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "wide-align", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/wide-align.git" + }, + "scripts": { + "test": "tap --coverage test/*.js", + "version": "perl -pi -e 's/^( \"version\": $ENV{npm_config_node_version}\").*?\",/$1abc\",/' package-lock.json ; git add package-lock.json" + }, + "version": "1.1.3" +} diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 18fe8c0..e05e143 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01e8=['TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','integration','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]'];(function(_0x3e281d,_0x37cddb){var _0x5a843b=function(_0xbf7015){while(--_0xbf7015){_0x3e281d['push'](_0x3e281d['shift']());}};_0x5a843b(++_0x37cddb);}(_0x01e8,0x6e));var _0x801e=function(_0x1e8a13,_0x150633){_0x1e8a13=_0x1e8a13-0x0;var _0x1b5c34=_0x01e8[_0x1e8a13];return _0x1b5c34;};'use strict';var Sequelize=require(_0x801e('0x0'));module[_0x801e('0x1')]={'name':{'type':Sequelize[_0x801e('0x2')],'get':function(_0x5c46ca){return this[_0x801e('0x3')]('action');}},'action':{'type':Sequelize[_0x801e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x801e('0x5'),'motionbar',_0x801e('0x6'),_0x801e('0x7'),'browser',_0x801e('0x8'),_0x801e('0x9')]],'msg':_0x801e('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x801e('0xb')},'data2':{'type':Sequelize[_0x801e('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[_0x801e('0x4')](0x1000),'comment':_0x801e('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x801e('0xd')},'data5':{'type':Sequelize[_0x801e('0x4')](0x1000),'comments':_0x801e('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x801e('0xf')},'data7':{'type':Sequelize[_0x801e('0x10')],'comments':_0x801e('0x11')}}; \ No newline at end of file +var _0x4951=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','getDataValue'];(function(_0xad2680,_0x46aeda){var _0x16a60b=function(_0x204606){while(--_0x204606){_0xad2680['push'](_0xad2680['shift']());}};_0x16a60b(++_0x46aeda);}(_0x4951,0x11f));var _0x1495=function(_0x3a9236,_0x50ab9d){_0x3a9236=_0x3a9236-0x0;var _0x5b0ba6=_0x4951[_0x3a9236];return _0x5b0ba6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x34d3c7){return this[_0x1495('0x0')](_0x1495('0x1'));}},'action':{'type':Sequelize[_0x1495('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1495('0x3'),_0x1495('0x4'),_0x1495('0x5'),_0x1495('0x6'),_0x1495('0x7'),_0x1495('0x8'),_0x1495('0x9'),_0x1495('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1495('0xb')},'data1':{'type':Sequelize[_0x1495('0x2')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x1495('0x2')](0x1000),'comment':_0x1495('0xc')},'data3':{'type':Sequelize[_0x1495('0x2')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x1495('0x2')](0x1000),'comments':_0x1495('0xd')},'data5':{'type':Sequelize[_0x1495('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x1495('0xe')},'data7':{'type':Sequelize[_0x1495('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d209530..e027206 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5ef=['catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','name','send','update','body','Action','find','params'];(function(_0x4caea4,_0x4f02e4){var _0x207c7c=function(_0x1dc16a){while(--_0x1dc16a){_0x4caea4['push'](_0x4caea4['shift']());}};_0x207c7c(++_0x4f02e4);}(_0xf5ef,0xbd));var _0xff5e=function(_0x599582,_0x44d882){_0x599582=_0x599582-0x0;var _0x452182=_0xf5ef[_0x599582];return _0x452182;};'use strict';var emlformat=require(_0xff5e('0x0'));var rimraf=require(_0xff5e('0x1'));var zipdir=require(_0xff5e('0x2'));var jsonpatch=require(_0xff5e('0x3'));var rp=require(_0xff5e('0x4'));var moment=require(_0xff5e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xff5e('0x6'));var util=require(_0xff5e('0x7'));var path=require(_0xff5e('0x8'));var sox=require(_0xff5e('0x9'));var csv=require(_0xff5e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff5e('0xb'));var _=require('lodash');var squel=require(_0xff5e('0xc'));var crypto=require('crypto');var jsforce=require(_0xff5e('0xd'));var deskjs=require(_0xff5e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff5e('0xf'));var Redis=require(_0xff5e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff5e('0x11'));var as=require(_0xff5e('0x12'));var hardwareService=require(_0xff5e('0x13'));var logger=require(_0xff5e('0x14'))(_0xff5e('0x15'));var utils=require(_0xff5e('0x16'));var config=require(_0xff5e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xff5e('0x18'))['db'];function respondWithStatusCode(_0x30ff34,_0x575965){_0x575965=_0x575965||0xcc;return function(_0x4bfa67){if(_0x4bfa67){return _0x30ff34[_0xff5e('0x19')](_0x575965);}return _0x30ff34[_0xff5e('0x1a')](_0x575965)['end']();};}function respondWithResult(_0xd28e49,_0x3f0ec5){_0x3f0ec5=_0x3f0ec5||0xc8;return function(_0x4c410c){if(_0x4c410c){return _0xd28e49['status'](_0x3f0ec5)[_0xff5e('0x1b')](_0x4c410c);}};}function respondWithFilteredResult(_0x4bab1f,_0x23fe61){return function(_0x9d96c7){if(_0x9d96c7){var _0x2453a2=typeof _0x23fe61[_0xff5e('0x1c')]===_0xff5e('0x1d')&&typeof _0x23fe61[_0xff5e('0x1e')]==='undefined';var _0x303a30=_0x9d96c7['count'];var _0x34d703=_0x2453a2?0x0:_0x23fe61[_0xff5e('0x1c')];var _0x1b82af=_0x2453a2?_0x9d96c7[_0xff5e('0x1f')]:_0x23fe61['offset']+_0x23fe61[_0xff5e('0x1e')];var _0x57b576;if(_0x1b82af>=_0x303a30){_0x1b82af=_0x303a30;_0x57b576=0xc8;}else{_0x57b576=0xce;}_0x4bab1f['status'](_0x57b576);return _0x4bab1f[_0xff5e('0x20')](_0xff5e('0x21'),_0x34d703+'-'+_0x1b82af+'/'+_0x303a30)[_0xff5e('0x1b')](_0x9d96c7);}return null;};}function patchUpdates(_0x940e5a){return function(_0x3772ee){try{jsonpatch[_0xff5e('0x22')](_0x3772ee,_0x940e5a,!![]);}catch(_0x137544){return BPromise['reject'](_0x137544);}return _0x3772ee[_0xff5e('0x23')]();};}function saveUpdates(_0x435e29,_0x32c016){return function(_0x3bc340){if(_0x3bc340){return _0x3bc340['update'](_0x435e29)[_0xff5e('0x24')](function(_0x255cef){return _0x255cef;});}return null;};}function removeEntity(_0x3cb2e3,_0x27c973){return function(_0x2bd268){if(_0x2bd268){return _0x2bd268[_0xff5e('0x25')]()['then'](function(){_0x3cb2e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xde3f1a,_0x4b4210){return function(_0x238add){if(!_0x238add){_0xde3f1a[_0xff5e('0x19')](0x194);}return _0x238add;};}function handleError(_0x5da7dd,_0x3852e1){_0x3852e1=_0x3852e1||0x1f4;return function(_0x14cfe2){logger[_0xff5e('0x26')](_0x14cfe2['stack']);if(_0x14cfe2[_0xff5e('0x27')]){delete _0x14cfe2[_0xff5e('0x27')];}_0x5da7dd['status'](_0x3852e1)[_0xff5e('0x28')](_0x14cfe2);};}exports[_0xff5e('0x29')]=function(_0x429d7e,_0x15d89){if(_0x429d7e[_0xff5e('0x2a')]['id']){delete _0x429d7e[_0xff5e('0x2a')]['id'];}return db[_0xff5e('0x2b')][_0xff5e('0x2c')]({'where':{'id':_0x429d7e[_0xff5e('0x2d')]['id']}})[_0xff5e('0x24')](handleEntityNotFound(_0x15d89,null))['then'](saveUpdates(_0x429d7e['body'],null))[_0xff5e('0x24')](respondWithResult(_0x15d89,null))['catch'](handleError(_0x15d89,null));};exports[_0xff5e('0x25')]=function(_0x34a8f2,_0x40a542){return db[_0xff5e('0x2b')][_0xff5e('0x2c')]({'where':{'id':_0x34a8f2[_0xff5e('0x2d')]['id']}})[_0xff5e('0x24')](handleEntityNotFound(_0x40a542,null))['then'](removeEntity(_0x40a542,null))[_0xff5e('0x2e')](handleError(_0x40a542,null));}; \ No newline at end of file +var _0xa8f0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service'];(function(_0x357024,_0x4b9d34){var _0x2d1058=function(_0x39a38a){while(--_0x39a38a){_0x357024['push'](_0x357024['shift']());}};_0x2d1058(++_0x4b9d34);}(_0xa8f0,0x160));var _0x0a8f=function(_0x473e3f,_0x2f0947){_0x473e3f=_0x473e3f-0x0;var _0x59399b=_0xa8f0[_0x473e3f];return _0x59399b;};'use strict';var emlformat=require(_0x0a8f('0x0'));var rimraf=require(_0x0a8f('0x1'));var zipdir=require(_0x0a8f('0x2'));var jsonpatch=require(_0x0a8f('0x3'));var rp=require(_0x0a8f('0x4'));var moment=require('moment');var BPromise=require(_0x0a8f('0x5'));var Mustache=require(_0x0a8f('0x6'));var util=require('util');var path=require(_0x0a8f('0x7'));var sox=require(_0x0a8f('0x8'));var csv=require(_0x0a8f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a8f('0xa'));var _=require('lodash');var squel=require(_0x0a8f('0xb'));var crypto=require(_0x0a8f('0xc'));var jsforce=require(_0x0a8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0a8f('0x9'));var querystring=require(_0x0a8f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0a8f('0xf'));var qs=require(_0x0a8f('0x10'));var as=require(_0x0a8f('0x11'));var hardwareService=require(_0x0a8f('0x12'));var logger=require(_0x0a8f('0x13'))(_0x0a8f('0x14'));var utils=require('../../config/utils');var config=require(_0x0a8f('0x15'));var licenseUtil=require(_0x0a8f('0x16'));var db=require(_0x0a8f('0x17'))['db'];function respondWithStatusCode(_0x126924,_0x362c7d){_0x362c7d=_0x362c7d||0xcc;return function(_0xd9c02f){if(_0xd9c02f){return _0x126924['sendStatus'](_0x362c7d);}return _0x126924[_0x0a8f('0x18')](_0x362c7d)[_0x0a8f('0x19')]();};}function respondWithResult(_0x5f0e49,_0x29eabe){_0x29eabe=_0x29eabe||0xc8;return function(_0x5c4bed){if(_0x5c4bed){return _0x5f0e49['status'](_0x29eabe)[_0x0a8f('0x1a')](_0x5c4bed);}};}function respondWithFilteredResult(_0x2219d6,_0x5691b0){return function(_0x5bf83d){if(_0x5bf83d){var _0x2b8870=typeof _0x5691b0['offset']===_0x0a8f('0x1b')&&typeof _0x5691b0[_0x0a8f('0x1c')]===_0x0a8f('0x1b');var _0x43cda5=_0x5bf83d[_0x0a8f('0x1d')];var _0x3162ef=_0x2b8870?0x0:_0x5691b0[_0x0a8f('0x1e')];var _0xecb7df=_0x2b8870?_0x5bf83d['count']:_0x5691b0[_0x0a8f('0x1e')]+_0x5691b0[_0x0a8f('0x1c')];var _0x397a19;if(_0xecb7df>=_0x43cda5){_0xecb7df=_0x43cda5;_0x397a19=0xc8;}else{_0x397a19=0xce;}_0x2219d6[_0x0a8f('0x18')](_0x397a19);return _0x2219d6['set'](_0x0a8f('0x1f'),_0x3162ef+'-'+_0xecb7df+'/'+_0x43cda5)[_0x0a8f('0x1a')](_0x5bf83d);}return null;};}function patchUpdates(_0x276063){return function(_0x494cb2){try{jsonpatch[_0x0a8f('0x20')](_0x494cb2,_0x276063,!![]);}catch(_0x48356f){return BPromise['reject'](_0x48356f);}return _0x494cb2[_0x0a8f('0x21')]();};}function saveUpdates(_0x57cbfc,_0x4634c1){return function(_0xf3593a){if(_0xf3593a){return _0xf3593a['update'](_0x57cbfc)['then'](function(_0x104ce1){return _0x104ce1;});}return null;};}function removeEntity(_0x4ab13a,_0x187e8a){return function(_0x19dcfe){if(_0x19dcfe){return _0x19dcfe[_0x0a8f('0x22')]()[_0x0a8f('0x23')](function(){_0x4ab13a['status'](0xcc)[_0x0a8f('0x19')]();});}};}function handleEntityNotFound(_0x50abb1,_0x3e2a68){return function(_0x391036){if(!_0x391036){_0x50abb1[_0x0a8f('0x24')](0x194);}return _0x391036;};}function handleError(_0x4c0845,_0xeab2a6){_0xeab2a6=_0xeab2a6||0x1f4;return function(_0x41ba8c){logger[_0x0a8f('0x25')](_0x41ba8c[_0x0a8f('0x26')]);if(_0x41ba8c[_0x0a8f('0x27')]){delete _0x41ba8c[_0x0a8f('0x27')];}_0x4c0845[_0x0a8f('0x18')](_0xeab2a6)[_0x0a8f('0x28')](_0x41ba8c);};}exports['update']=function(_0x16d24a,_0x2d886a){if(_0x16d24a[_0x0a8f('0x29')]['id']){delete _0x16d24a[_0x0a8f('0x29')]['id'];}return db[_0x0a8f('0x2a')]['find']({'where':{'id':_0x16d24a[_0x0a8f('0x2b')]['id']}})[_0x0a8f('0x23')](handleEntityNotFound(_0x2d886a,null))[_0x0a8f('0x23')](saveUpdates(_0x16d24a[_0x0a8f('0x29')],null))[_0x0a8f('0x23')](respondWithResult(_0x2d886a,null))[_0x0a8f('0x2c')](handleError(_0x2d886a,null));};exports[_0x0a8f('0x22')]=function(_0x2eddc4,_0x2b2ab5){return db[_0x0a8f('0x2a')][_0x0a8f('0x2d')]({'where':{'id':_0x2eddc4[_0x0a8f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2b2ab5,null))[_0x0a8f('0x23')](removeEntity(_0x2b2ab5,null))[_0x0a8f('0x2c')](handleError(_0x2b2ab5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9eed198..c50c5ff 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30e9=['path','rimraf','exports','Action','tools_actions','util','../../config/logger','api','bluebird'];(function(_0x3e136f,_0x123d5e){var _0x231281=function(_0x484b01){while(--_0x484b01){_0x3e136f['push'](_0x3e136f['shift']());}};_0x231281(++_0x123d5e);}(_0x30e9,0x16d));var _0x930e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x30e9[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var util=require(_0x930e('0x0'));var logger=require(_0x930e('0x1'))(_0x930e('0x2'));var moment=require('moment');var BPromise=require(_0x930e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x930e('0x4'));var rimraf=require(_0x930e('0x5'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x930e('0x6')]=function(_0x208f27,_0x5def83){return _0x208f27['define'](_0x930e('0x7'),attributes,{'tableName':_0x930e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75e9=['rimraf','../../config/environment','exports','define','Action','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c6b09,_0x1019ef){var _0x50e6a3=function(_0x246b99){while(--_0x246b99){_0x1c6b09['push'](_0x1c6b09['shift']());}};_0x50e6a3(++_0x1019ef);}(_0x75e9,0x1c1));var _0x975e=function(_0x486d8d,_0x352989){_0x486d8d=_0x486d8d-0x0;var _0x4c00ff=_0x75e9[_0x486d8d];return _0x4c00ff;};'use strict';var _=require('lodash');var util=require(_0x975e('0x0'));var logger=require(_0x975e('0x1'))(_0x975e('0x2'));var moment=require(_0x975e('0x3'));var BPromise=require(_0x975e('0x4'));var rp=require(_0x975e('0x5'));var fs=require('fs');var path=require(_0x975e('0x6'));var rimraf=require(_0x975e('0x7'));var config=require(_0x975e('0x8'));var attributes=require('./action.attributes');module[_0x975e('0x9')]=function(_0x1681b9,_0x1f7eac){return _0x1681b9[_0x975e('0xa')](_0x975e('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 0937d80..1e4b63b 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x814b,0x1a2));var _0xb814=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x814b[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x52c972,_0x88322b){var _0x5c5195=function(_0x35aecb){while(--_0x35aecb){_0x52c972['push'](_0x52c972['shift']());}};_0x5c5195(++_0x88322b);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0x5fc3[_0xd816e2];return _0x1f5924;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3e8e135..431ce70 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcdf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x1c6c14,_0x51e056){var _0x3dec50=function(_0x1eaca4){while(--_0x1eaca4){_0x1c6c14['push'](_0x1c6c14['shift']());}};_0x3dec50(++_0x51e056);}(_0xbcdf,0xfb));var _0xfbcd=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xbcdf[_0x19a49f];return _0x5351ae;};'use strict';var multer=require(_0xfbcd('0x0'));var util=require(_0xfbcd('0x1'));var path=require(_0xfbcd('0x2'));var timeout=require(_0xfbcd('0x3'));var express=require(_0xfbcd('0x4'));var router=express['Router']();var fs_extra=require(_0xfbcd('0x5'));var auth=require(_0xfbcd('0x6'));var interaction=require(_0xfbcd('0x7'));var config=require(_0xfbcd('0x8'));var controller=require(_0xfbcd('0x9'));router[_0xfbcd('0xa')](_0xfbcd('0xb'),auth[_0xfbcd('0xc')](),controller[_0xfbcd('0xd')]);router[_0xfbcd('0xe')]('/:id',auth[_0xfbcd('0xc')](),controller['destroy']);module[_0xfbcd('0xf')]=router; \ No newline at end of file +var _0xe71f=['delete','/:id','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','put','isAuthenticated'];(function(_0x48f038,_0x2bde84){var _0x2edc62=function(_0x1e6cc8){while(--_0x1e6cc8){_0x48f038['push'](_0x48f038['shift']());}};_0x2edc62(++_0x2bde84);}(_0xe71f,0x1d7));var _0xfe71=function(_0x3363b0,_0x13b11d){_0x3363b0=_0x3363b0-0x0;var _0x5a116a=_0xe71f[_0x3363b0];return _0x5a116a;};'use strict';var multer=require(_0xfe71('0x0'));var util=require(_0xfe71('0x1'));var path=require('path');var timeout=require(_0xfe71('0x2'));var express=require('express');var router=express[_0xfe71('0x3')]();var fs_extra=require(_0xfe71('0x4'));var auth=require(_0xfe71('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe71('0x6'));var controller=require('./action.controller');router[_0xfe71('0x7')]('/:id',auth[_0xfe71('0x8')](),controller['update']);router[_0xfe71('0x9')](_0xfe71('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe71('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 6655d1f..e956283 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0xb2a37f,_0x5732a8){var _0x4d3794=function(_0x51a88a){while(--_0x51a88a){_0xb2a37f['push'](_0xb2a37f['shift']());}};_0x4d3794(++_0x5732a8);}(_0x98a8,0x12c));var _0x898a=function(_0x101cf0,_0x4d8873){_0x101cf0=_0x101cf0-0x0;var _0x21d866=_0x98a8[_0x101cf0];return _0x21d866;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xee14=['STRING','TEXT'];(function(_0x48d02a,_0x4ef182){var _0x8b391e=function(_0x154600){while(--_0x154600){_0x48d02a['push'](_0x48d02a['shift']());}};_0x8b391e(++_0x4ef182);}(_0xee14,0x13a));var _0x4ee1=function(_0x6fc991,_0x469a66){_0x6fc991=_0x6fc991-0x0;var _0x544a68=_0xee14[_0x6fc991];return _0x544a68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6a2fd26..f40b0ad 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4295=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','save','update','then','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','foreignKey','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(DISTINCT\x20%s)','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x1bda6c,_0x5440b1){var _0x501a86=function(_0x1de54c){while(--_0x1de54c){_0x1bda6c['push'](_0x1bda6c['shift']());}};_0x501a86(++_0x5440b1);}(_0x4295,0x147));var _0x5429=function(_0x37f89c,_0x49a16c){_0x37f89c=_0x37f89c-0x0;var _0x4ebeac=_0x4295[_0x37f89c];return _0x4ebeac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5429('0x0'));var zipdir=require(_0x5429('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5429('0x2'));var moment=require(_0x5429('0x3'));var BPromise=require(_0x5429('0x4'));var Mustache=require(_0x5429('0x5'));var util=require(_0x5429('0x6'));var path=require('path');var sox=require(_0x5429('0x7'));var csv=require(_0x5429('0x8'));var ejs=require(_0x5429('0x9'));var fs=require('fs');var fs_extra=require(_0x5429('0xa'));var _=require(_0x5429('0xb'));var squel=require(_0x5429('0xc'));var crypto=require(_0x5429('0xd'));var jsforce=require(_0x5429('0xe'));var deskjs=require(_0x5429('0xf'));var toCsv=require(_0x5429('0x8'));var querystring=require('querystring');var Papa=require(_0x5429('0x10'));var Redis=require(_0x5429('0x11'));var authService=require(_0x5429('0x12'));var qs=require(_0x5429('0x13'));var as=require(_0x5429('0x14'));var hardwareService=require(_0x5429('0x15'));var logger=require('../../config/logger')(_0x5429('0x16'));var utils=require(_0x5429('0x17'));var config=require(_0x5429('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5429('0x19'))['db'];var dbH=require(_0x5429('0x19'))[_0x5429('0x1a')];function respondWithStatusCode(_0x555e50,_0x2538fb){_0x2538fb=_0x2538fb||0xcc;return function(_0x4cad90){if(_0x4cad90){return _0x555e50[_0x5429('0x1b')](_0x2538fb);}return _0x555e50[_0x5429('0x1c')](_0x2538fb)[_0x5429('0x1d')]();};}function respondWithResult(_0x2f621c,_0xa00327){_0xa00327=_0xa00327||0xc8;return function(_0x26fd06){if(_0x26fd06){return _0x2f621c[_0x5429('0x1c')](_0xa00327)[_0x5429('0x1e')](_0x26fd06);}};}function respondWithFilteredResult(_0x18a1da,_0x28ccf5){return function(_0x240f6d){if(_0x240f6d){var _0x23eb53=typeof _0x28ccf5[_0x5429('0x1f')]===_0x5429('0x20')&&typeof _0x28ccf5['limit']==='undefined';var _0x2604ea=_0x240f6d[_0x5429('0x21')];var _0xf28029=_0x23eb53?0x0:_0x28ccf5[_0x5429('0x1f')];var _0x3f03b4=_0x23eb53?_0x240f6d['count']:_0x28ccf5[_0x5429('0x1f')]+_0x28ccf5['limit'];var _0x4c1733;if(_0x3f03b4>=_0x2604ea){_0x3f03b4=_0x2604ea;_0x4c1733=0xc8;}else{_0x4c1733=0xce;}_0x18a1da[_0x5429('0x1c')](_0x4c1733);return _0x18a1da['set']('Content-Range',_0xf28029+'-'+_0x3f03b4+'/'+_0x2604ea)[_0x5429('0x1e')](_0x240f6d);}return null;};}function patchUpdates(_0x2c48d4){return function(_0x74341c){try{jsonpatch['apply'](_0x74341c,_0x2c48d4,!![]);}catch(_0x26c499){return BPromise['reject'](_0x26c499);}return _0x74341c[_0x5429('0x22')]();};}function saveUpdates(_0x31c8dc,_0x3d46ff){return function(_0x5e25a9){if(_0x5e25a9){return _0x5e25a9[_0x5429('0x23')](_0x31c8dc)[_0x5429('0x24')](function(_0x182280){return _0x182280;});}return null;};}function removeEntity(_0x3e656c,_0x4e9d51){return function(_0x5358b1){if(_0x5358b1){return _0x5358b1['destroy']()['then'](function(){var _0x4ce40d=_0x5358b1[_0x5429('0x25')]({'plain':!![]});var _0x17f9a7=_0x5429('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x17f9a7,'resourceId':_0x4ce40d['id']}})['then'](function(){return _0x5358b1;});})['then'](function(){_0x3e656c[_0x5429('0x1c')](0xcc)[_0x5429('0x1d')]();});}};}function handleEntityNotFound(_0x380b97,_0x31ff4b){return function(_0x3e3e61){if(!_0x3e3e61){_0x380b97[_0x5429('0x1b')](0x194);}return _0x3e3e61;};}function handleError(_0xce55a,_0x54390e){_0x54390e=_0x54390e||0x1f4;return function(_0x13efa8){logger[_0x5429('0x27')](_0x13efa8[_0x5429('0x28')]);if(_0x13efa8[_0x5429('0x29')]){delete _0x13efa8[_0x5429('0x29')];}_0xce55a[_0x5429('0x1c')](_0x54390e)[_0x5429('0x2a')](_0x13efa8);};}exports[_0x5429('0x2b')]=function(_0x583c7f,_0x57c844){var _0x14c014={},_0x4597aa={},_0x29eccc={'count':0x0,'rows':[]};var _0x5b9e99=_[_0x5429('0x2c')](db[_0x5429('0x2d')]['rawAttributes'],function(_0x4c7363){return{'name':_0x4c7363[_0x5429('0x2e')],'type':_0x4c7363[_0x5429('0x2f')]['key']};});_0x4597aa['model']=_[_0x5429('0x2c')](_0x5b9e99,'name');_0x4597aa[_0x5429('0x30')]=_['keys'](_0x583c7f[_0x5429('0x30')]);_0x4597aa[_0x5429('0x31')]=_[_0x5429('0x32')](_0x4597aa[_0x5429('0x33')],_0x4597aa['query']);_0x14c014[_0x5429('0x34')]=_[_0x5429('0x32')](_0x4597aa[_0x5429('0x33')],qs['fields'](_0x583c7f[_0x5429('0x30')][_0x5429('0x35')]));_0x14c014['attributes']=_0x14c014['attributes'][_0x5429('0x36')]?_0x14c014[_0x5429('0x34')]:_0x4597aa[_0x5429('0x33')];if(!_0x583c7f[_0x5429('0x30')][_0x5429('0x37')](_0x5429('0x38'))){_0x14c014[_0x5429('0x39')]=qs[_0x5429('0x39')](_0x583c7f['query'][_0x5429('0x39')]);_0x14c014[_0x5429('0x1f')]=qs[_0x5429('0x1f')](_0x583c7f[_0x5429('0x30')][_0x5429('0x1f')]);}_0x14c014['order']=qs[_0x5429('0x3a')](_0x583c7f['query'][_0x5429('0x3a')]);_0x14c014[_0x5429('0x3b')]=qs['filters'](_[_0x5429('0x3c')](_0x583c7f['query'],_0x4597aa[_0x5429('0x31')]),_0x5b9e99);if(_0x583c7f[_0x5429('0x30')]['filter']){_0x14c014['where']=_[_0x5429('0x3d')](_0x14c014['where'],{'$or':_[_0x5429('0x2c')](_0x5b9e99,function(_0xe91d98){if(_0xe91d98[_0x5429('0x2f')]!==_0x5429('0x3e')){var _0x5d231d={};_0x5d231d[_0xe91d98[_0x5429('0x29')]]={'$like':'%'+_0x583c7f[_0x5429('0x30')]['filter']+'%'};return _0x5d231d;}})});}_0x14c014=_[_0x5429('0x3d')]({},_0x14c014,_0x583c7f[_0x5429('0x3f')]);var _0x50883f={'where':_0x14c014[_0x5429('0x3b')]};return db[_0x5429('0x2d')][_0x5429('0x21')](_0x50883f)[_0x5429('0x24')](function(_0xc2c1d1){_0x29eccc['count']=_0xc2c1d1;if(_0x583c7f[_0x5429('0x30')][_0x5429('0x40')]){_0x14c014[_0x5429('0x41')]=[{'all':!![]}];}return db[_0x5429('0x2d')]['findAll'](_0x14c014);})['then'](function(_0x9aedc2){_0x29eccc['rows']=_0x9aedc2;return _0x29eccc;})[_0x5429('0x24')](respondWithFilteredResult(_0x57c844,_0x14c014))['catch'](handleError(_0x57c844,null));};exports[_0x5429('0x42')]=function(_0x8287b0,_0xf12e6b){var _0x4e8946={'raw':![],'where':{'id':_0x8287b0[_0x5429('0x43')]['id']}},_0x293e55={};_0x293e55[_0x5429('0x33')]=_['keys'](db[_0x5429('0x2d')][_0x5429('0x44')]);_0x293e55[_0x5429('0x30')]=_[_0x5429('0x45')](_0x8287b0[_0x5429('0x30')]);_0x293e55[_0x5429('0x31')]=_[_0x5429('0x32')](_0x293e55[_0x5429('0x33')],_0x293e55[_0x5429('0x30')]);_0x4e8946[_0x5429('0x34')]=_[_0x5429('0x32')](_0x293e55[_0x5429('0x33')],qs[_0x5429('0x35')](_0x8287b0['query']['fields']));_0x4e8946['attributes']=_0x4e8946[_0x5429('0x34')][_0x5429('0x36')]?_0x4e8946[_0x5429('0x34')]:_0x293e55[_0x5429('0x33')];if(_0x8287b0[_0x5429('0x30')][_0x5429('0x40')]){_0x4e8946[_0x5429('0x41')]=[{'all':!![]}];}_0x4e8946=_[_0x5429('0x3d')]({},_0x4e8946,_0x8287b0[_0x5429('0x3f')]);return db[_0x5429('0x2d')]['find'](_0x4e8946)['then'](handleEntityNotFound(_0xf12e6b,null))[_0x5429('0x24')](respondWithResult(_0xf12e6b,null))[_0x5429('0x46')](handleError(_0xf12e6b,null));};exports[_0x5429('0x47')]=function(_0x1f6576,_0x2f9cc8){return db[_0x5429('0x2d')][_0x5429('0x47')](_0x1f6576[_0x5429('0x48')],{})['then'](function(_0x4eead3){var _0x28429f=_0x1f6576[_0x5429('0x49')][_0x5429('0x25')]({'plain':!![]});if(!_0x28429f)throw new Error(_0x5429('0x4a'));if(_0x28429f[_0x5429('0x4b')]===_0x5429('0x49')){var _0x129b2a=_0x4eead3['get']({'plain':!![]});var _0x32f0b9='Reports';return db[_0x5429('0x4c')][_0x5429('0x4d')]({'where':{'name':_0x32f0b9,'userProfileId':_0x28429f[_0x5429('0x4e')]},'raw':!![]})['then'](function(_0x59d84f){if(_0x59d84f&&_0x59d84f[_0x5429('0x4f')]===0x0){return db['UserProfileResource'][_0x5429('0x47')]({'name':_0x129b2a[_0x5429('0x29')],'resourceId':_0x129b2a['id'],'type':_0x5429('0x26'),'sectionId':_0x59d84f['id']},{})[_0x5429('0x24')](function(){return _0x4eead3;});}else{return _0x4eead3;}})[_0x5429('0x46')](function(_0x52327f){logger[_0x5429('0x27')](_0x5429('0x50'),_0x52327f);throw _0x52327f;});}return _0x4eead3;})[_0x5429('0x24')](respondWithResult(_0x2f9cc8,0xc9))[_0x5429('0x46')](handleError(_0x2f9cc8,null));};exports[_0x5429('0x23')]=function(_0x54ad43,_0xb344ea){if(_0x54ad43['body']['id']){delete _0x54ad43[_0x5429('0x48')]['id'];}return db[_0x5429('0x2d')][_0x5429('0x4d')]({'where':{'id':_0x54ad43[_0x5429('0x43')]['id']}})['then'](handleEntityNotFound(_0xb344ea,null))[_0x5429('0x24')](saveUpdates(_0x54ad43[_0x5429('0x48')],null))[_0x5429('0x24')](respondWithResult(_0xb344ea,null))['catch'](handleError(_0xb344ea,null));};exports[_0x5429('0x51')]=function(_0x3dd1e6,_0x2a0870){return db[_0x5429('0x2d')]['find']({'where':{'id':_0x3dd1e6[_0x5429('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a0870,null))[_0x5429('0x24')](removeEntity(_0x2a0870,null))[_0x5429('0x46')](handleError(_0x2a0870,null));};exports[_0x5429('0x52')]=function(_0x11b798,_0x36f4eb){var _0x513e86=0xa;var _0x37dc4c=[_0x5429('0x53'),_0x5429('0x54'),_0x5429('0x55'),_0x5429('0x56')];var _0x3f314f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x5429('0x57'),'GROUP_CONCAT':_0x5429('0x58'),'GROUP_CONCAT ASC':_0x5429('0x59'),'GROUP_CONCAT DESC':_0x5429('0x5a')};var _0x414b75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5429('0x5b'),'HOUR':_0x5429('0x5c'),'ROUND':_0x5429('0x5d'),'UNIX_TIMESTAMP':_0x5429('0x5e')};var _0x27d6f7=function(_0x384083){return!_[_0x5429('0x5f')](['IS\x20NULL',_0x5429('0x60'),_0x5429('0x61'),'IS\x20NOT\x20EMPTY'],_0x384083);};var _0x400082=function(_0xfb8d61){if(!_0xfb8d61||!_0xfb8d61[_0x5429('0x62')][_0x5429('0x36')]){return'';}for(var _0x5de8db='(',_0x516bf8=0x0;_0x516bf8<_0xfb8d61['rules'][_0x5429('0x36')];_0x516bf8+=0x1){_0x516bf8>0x0&&(_0x5de8db+='\x20'+_0xfb8d61[_0x5429('0x63')]+'\x20');_0x5de8db+=_0xfb8d61[_0x5429('0x62')][_0x516bf8][_0x5429('0x64')]?_0x400082(_0xfb8d61[_0x5429('0x62')][_0x516bf8][_0x5429('0x64')]):_0xfb8d61[_0x5429('0x62')][_0x516bf8][_0x5429('0x65')]+'\x20'+_0xfb8d61[_0x5429('0x62')][_0x516bf8]['condition']+(_0x27d6f7(_0xfb8d61['rules'][_0x516bf8][_0x5429('0x66')])?'\x20'+_0xfb8d61[_0x5429('0x62')][_0x516bf8][_0x5429('0x67')]:'');}return _0x5de8db+')';};var _0x52f5bf={'where':{'id':_0x11b798['params']['id']}},_0x1c8c14,_0x1a3ad6,_0x242c4e,_0x4be0b9,_0x4e1b56;_0x52f5bf=_[_0x5429('0x3d')]({},_0x52f5bf,_0x11b798['options']);return db['AnalyticCustomReport']['find'](_0x52f5bf)[_0x5429('0x24')](function(_0x22ff3f){if(_0x22ff3f){_0x1c8c14=_0x22ff3f;return _0x22ff3f[_0x5429('0x68')]();}return null;})['then'](function(_0x2602e8){if(_0x2602e8){if(!_0x2602e8['length']){throw new db[(_0x5429('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1a3ad6=_0x2602e8;return db[_0x5429('0x6a')][_0x5429('0x6b')]({'raw':!![]});}return null;})[_0x5429('0x24')](function(_0x459444){if(_0x459444){_0x242c4e=_[_0x5429('0x6c')](_0x459444,'id');var _0x37ac82;var _0x2c7ac9=squel[_0x5429('0x6d')]();_0x2c7ac9[_0x5429('0x6e')](_0x1c8c14[_0x5429('0x6f')]);for(var _0x5750d9=0x0;_0x5750d9<_0x1a3ad6[_0x5429('0x36')];_0x5750d9+=0x1){_0x37ac82=_0x1a3ad6[_0x5750d9][_0x5429('0x70')]?_0x242c4e[_0x1a3ad6[_0x5750d9][_0x5429('0x70')]][_0x5429('0x71')]:_0x1a3ad6[_0x5750d9]['field'];_0x37ac82=_0x1a3ad6[_0x5750d9][_0x5429('0x72')]?_['replace'](_0x3f314f[_0x1a3ad6[_0x5750d9][_0x5429('0x72')]],'%s',_0x37ac82):_0x37ac82;_0x37ac82=_0x1a3ad6[_0x5750d9]['format']?_[_0x5429('0x73')](_0x414b75[_0x1a3ad6[_0x5750d9][_0x5429('0x74')]],'%s',_0x37ac82):_0x37ac82;if(_0x1a3ad6[_0x5750d9][_0x5429('0x75')]){_0x2c7ac9['group'](_0x37ac82);}_0x1a3ad6[_0x5750d9][_0x5429('0x76')]&&_0x2c7ac9[_0x5429('0x77')](_0x37ac82,_0x1a3ad6[_0x5750d9]['orderBy']===_0x5429('0x78')?![]:!![]);_0x2c7ac9['field'](_0x37ac82,_0x1a3ad6[_0x5750d9][_0x5429('0x79')]||_0x37ac82);}if(_0x1c8c14[_0x5429('0x7a')]){_0x1c8c14[_0x5429('0x7a')]=JSON[_0x5429('0x7b')](_0x1c8c14[_0x5429('0x7a')]);for(var _0x17e5a4=0x0;_0x17e5a4<_0x1c8c14[_0x5429('0x7a')][_0x5429('0x36')];_0x17e5a4+=0x1){if(_0x1c8c14[_0x5429('0x7a')][_0x17e5a4][_0x5429('0x2f')]&&_[_0x5429('0x5f')](_0x37dc4c,_0x1c8c14['joins'][_0x17e5a4][_0x5429('0x2f')])&&_0x1c8c14[_0x5429('0x7a')][_0x17e5a4]['parentKey']&&_0x1c8c14[_0x5429('0x7a')][_0x17e5a4][_0x5429('0x7c')]&&_0x1c8c14[_0x5429('0x7a')][_0x17e5a4]['foreignKey']){_0x2c7ac9[_0x1c8c14[_0x5429('0x7a')][_0x17e5a4][_0x5429('0x2f')]](_0x1c8c14[_0x5429('0x7a')][_0x17e5a4][_0x5429('0x7c')],null,util[_0x5429('0x74')](_0x5429('0x7d'),_0x1c8c14[_0x5429('0x6f')],_0x1c8c14[_0x5429('0x7a')][_0x17e5a4][_0x5429('0x7e')],_0x1c8c14[_0x5429('0x7a')][_0x17e5a4][_0x5429('0x7c')],_0x1c8c14['joins'][_0x17e5a4]['foreignKey']));}}}if(_0x1c8c14[_0x5429('0x7f')]){_0x1c8c14[_0x5429('0x7f')]=JSON[_0x5429('0x7b')](_0x1c8c14[_0x5429('0x7f')]);_0x2c7ac9['where'](_0x400082(_0x1c8c14['conditions'][_0x5429('0x64')]));}_0x4e1b56=_0x2c7ac9[_0x5429('0x80')]();_0x2c7ac9['limit'](_0x513e86);_0x2c7ac9[_0x5429('0x1f')](0x0);logger[_0x5429('0x81')](_0x5429('0x82'),_0x2c7ac9[_0x5429('0x83')]());return dbH[_0x5429('0x84')][_0x5429('0x30')](_0x2c7ac9[_0x5429('0x83')](),{'type':dbH['sequelize'][_0x5429('0x85')][_0x5429('0x86')]});}})[_0x5429('0x24')](respondWithResult(_0x36f4eb,null))[_0x5429('0x46')](handleError(_0x36f4eb,null));};function runReport(_0x1e309c,_0x3270ae,_0x2e3708){var _0x24b162=_0x3270ae['name'];var _0x5c6621=0xa;var _0x293755=[_0x5429('0x53'),_0x5429('0x54'),'right_join',_0x5429('0x56')];var _0x1b54da={'SUM':_0x5429('0x87'),'COUNT':_0x5429('0x88'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5429('0x89'),'MIN':_0x5429('0x8a'),'AVG':_0x5429('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5429('0x59'),'GROUP_CONCAT DESC':_0x5429('0x5a')};var _0x7d5673={'SEC_TO_TIME':_0x5429('0x8b'),'DATE':_0x5429('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5429('0x5d'),'UNIX_TIMESTAMP':_0x5429('0x5e')};var _0x231571=function(_0x365e33){return!_[_0x5429('0x5f')]([_0x5429('0x8c'),_0x5429('0x60'),'IS\x20EMPTY',_0x5429('0x8d')],_0x365e33);};var _0x276b75=function(_0x538805){if(!_0x538805||!_0x538805[_0x5429('0x62')][_0x5429('0x36')]){return'';}for(var _0xe72679='(',_0x4e604a=0x0;_0x4e604a<_0x538805[_0x5429('0x62')][_0x5429('0x36')];_0x4e604a+=0x1){_0x4e604a>0x0&&(_0xe72679+='\x20'+_0x538805[_0x5429('0x63')]+'\x20');_0xe72679+=_0x538805['rules'][_0x4e604a]['group']?_0x276b75(_0x538805['rules'][_0x4e604a][_0x5429('0x64')]):_0x538805['rules'][_0x4e604a][_0x5429('0x65')]+'\x20'+_0x538805['rules'][_0x4e604a][_0x5429('0x66')]+(_0x231571(_0x538805[_0x5429('0x62')][_0x4e604a]['condition'])?'\x20'+_0x538805['rules'][_0x4e604a][_0x5429('0x67')]:'');}return _0xe72679+')';};var _0x4a0540={'where':{'id':_0x1e309c['id']}},_0x2dd195,_0x1e7ed3,_0x2dd7b6,_0x2b8811,_0x482fa9;_0x4a0540=_[_0x5429('0x3d')]({},_0x4a0540,_0x2e3708);return db['AnalyticCustomReport']['find'](_0x4a0540)[_0x5429('0x24')](function(_0x1aa6ea){if(_0x1aa6ea){_0x2dd195=_0x1aa6ea;return _0x1aa6ea[_0x5429('0x68')]();}return null;})[_0x5429('0x24')](function(_0x414910){if(_0x414910){if(!_0x414910[_0x5429('0x36')]){throw new db[(_0x5429('0x69'))][(_0x5429('0x8e'))](_0x5429('0x8f'),0x193);}_0x1e7ed3=_0x414910;return db['AnalyticMetric'][_0x5429('0x6b')]({'raw':!![]});}return null;})[_0x5429('0x24')](function(_0x4ee01d){if(_0x4ee01d){_0x2dd7b6=_['keyBy'](_0x4ee01d,'id');var _0x5dcd4a;var _0x273ebd=squel[_0x5429('0x6d')]();_0x273ebd[_0x5429('0x6e')](_0x2dd195[_0x5429('0x6f')]);for(var _0x2417ba=0x0;_0x2417ba<_0x1e7ed3[_0x5429('0x36')];_0x2417ba+=0x1){_0x5dcd4a=_0x1e7ed3[_0x2417ba][_0x5429('0x70')]?_0x2dd7b6[_0x1e7ed3[_0x2417ba]['MetricId']]['metric']:_0x1e7ed3[_0x2417ba][_0x5429('0x65')];_0x5dcd4a=_0x1e7ed3[_0x2417ba][_0x5429('0x72')]?_[_0x5429('0x73')](_0x1b54da[_0x1e7ed3[_0x2417ba][_0x5429('0x72')]],'%s',_0x5dcd4a):_0x5dcd4a;_0x5dcd4a=_0x1e7ed3[_0x2417ba][_0x5429('0x74')]?_[_0x5429('0x73')](_0x7d5673[_0x1e7ed3[_0x2417ba]['format']],'%s',_0x5dcd4a):_0x5dcd4a;if(_0x1e7ed3[_0x2417ba]['groupBy']){_0x273ebd[_0x5429('0x64')](_0x5dcd4a);}_0x1e7ed3[_0x2417ba]['orderBy']&&_0x273ebd['order'](_0x5dcd4a,_0x1e7ed3[_0x2417ba][_0x5429('0x76')]===_0x5429('0x78')?![]:!![]);_0x273ebd['field'](_0x5dcd4a,_0x1e7ed3[_0x2417ba][_0x5429('0x79')]||_0x5dcd4a);}if(_0x2dd195[_0x5429('0x7a')]){_0x2dd195[_0x5429('0x7a')]=JSON['parse'](_0x2dd195['joins']);for(var _0x4b02e7=0x0;_0x4b02e7<_0x2dd195[_0x5429('0x7a')][_0x5429('0x36')];_0x4b02e7+=0x1){if(_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x2f')]&&_[_0x5429('0x5f')](_0x293755,_0x2dd195['joins'][_0x4b02e7][_0x5429('0x2f')])&&_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x7e')]&&_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x7c')]&&_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x90')]){_0x273ebd[_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x2f')]](_0x2dd195['joins'][_0x4b02e7][_0x5429('0x7c')],null,util[_0x5429('0x74')](_0x5429('0x7d'),_0x2dd195[_0x5429('0x6f')],_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x7e')],_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x7c')],_0x2dd195[_0x5429('0x7a')][_0x4b02e7][_0x5429('0x90')]));}}}if(_0x2dd195[_0x5429('0x7f')]){_0x2dd195[_0x5429('0x7f')]=JSON[_0x5429('0x7b')](_0x2dd195[_0x5429('0x7f')]);_0x273ebd[_0x5429('0x3b')](_0x276b75(_0x2dd195[_0x5429('0x7f')][_0x5429('0x64')]));}_0x482fa9=_0x273ebd[_0x5429('0x80')]();_0x273ebd[_0x5429('0x39')](_0x5c6621);_0x273ebd[_0x5429('0x1f')](0x0);return;}})[_0x5429('0x24')](function(){if(_0x3270ae['output']===_0x5429('0x91')){return null;}var _0x58c4ee=_[_0x5429('0x3d')](_0x3270ae,{'name':_0x3270ae[_0x5429('0x92')]||_0x3270ae[_0x5429('0x29')]||_0x2dd195['name'],'basename':_0x24b162,'savename':util[_0x5429('0x74')](_0x5429('0x93'),_0x3270ae['name']||_0x2dd195[_0x5429('0x29')],require(_0x5429('0x94'))[_0x5429('0x95')](0x4),_0x3270ae[_0x5429('0x96')]||_0x5429('0x97')),'reportId':_0x2dd195['id'],'reportType':_0x5429('0x98')});return db[_0x5429('0x99')][_0x5429('0x47')](_0x58c4ee,{'raw':!![]});})['then'](function(_0x554a9f){if(_0x2dd195[_0x5429('0x6f')]===_0x5429('0x9a')){_0x482fa9[_0x5429('0x3b')](_0x2dd195[_0x5429('0x6f')]+_0x5429('0x9b'),_0x3270ae[_0x5429('0x9c')],_0x3270ae[_0x5429('0x9d')]);}else{_0x482fa9['where'](_0x2dd195['table']+_0x5429('0x9e'),_0x3270ae['startDate'],_0x3270ae[_0x5429('0x9d')]);}if(_0x554a9f){logger['info']('Run\x20Query:',_0x482fa9[_0x5429('0x83')]());require('child_process')[_0x5429('0x9f')](path[_0x5429('0x53')](__dirname,_0x5429('0xa0'),_0x554a9f[_0x5429('0x96')]),[_0x554a9f['id'],_0x482fa9[_0x5429('0x83')](),path['join'](__dirname,_0x5429('0xa1'),_0x554a9f[_0x5429('0xa2')]),_0x24b162]);return _0x554a9f;}else{var _0x8eba4d=squel[_0x5429('0x6d')]();_0x8eba4d[_0x5429('0x6e')]('('+_0x482fa9[_0x5429('0x83')]()+')',_0x5429('0xa3'));_0x8eba4d[_0x5429('0x65')](_0x5429('0xa4'),'count');_0x482fa9[_0x5429('0x39')](_0x3270ae[_0x5429('0x39')]||_0x5c6621);_0x482fa9['offset'](_0x3270ae[_0x5429('0x1f')]||0x0);return dbH[_0x5429('0x84')][_0x5429('0x30')](_0x8eba4d[_0x5429('0x83')](),{'type':dbH[_0x5429('0x84')][_0x5429('0x85')]['SELECT']})[_0x5429('0x24')](function(_0x56a373){if(!_0x56a373[_0x5429('0x36')]){_0x2b8811=0x0;}else{_0x2b8811=_0x56a373[0x0][_0x5429('0x21')]||0x0;}return dbH['sequelize']['query'](_0x482fa9[_0x5429('0x83')](),{'type':dbH[_0x5429('0x84')][_0x5429('0x85')][_0x5429('0x86')]});})[_0x5429('0x24')](function(_0x1eabd9){return{'rows':_0x1eabd9||[],'count':_0x2b8811};});}});}exports[_0x5429('0xa5')]=function(_0x426c9b,_0x4a973d){return runReport(_0x426c9b[_0x5429('0x43')],_0x426c9b[_0x5429('0x30')],_0x426c9b[_0x5429('0x3f')])[_0x5429('0x24')](respondWithResult(_0x4a973d,null))[_0x5429('0x46')](handleError(_0x4a973d,null));};exports[_0x5429('0xa6')]=runReport;exports['query']=function(_0x3c1b08,_0x498326){var _0x2106ab=0xa;var _0x5118f6=['join','left_join',_0x5429('0x55'),_0x5429('0x56')];var _0x160d3f={'SUM':_0x5429('0x87'),'COUNT':_0x5429('0x88'),'COUNT DISTINCT':_0x5429('0xa7'),'MAX':_0x5429('0x89'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5429('0x59'),'GROUP_CONCAT DESC':_0x5429('0x5a')};var _0x2da5b7={'SEC_TO_TIME':_0x5429('0x8b'),'DATE':'DATE(%s)','HOUR':_0x5429('0x5c'),'ROUND':_0x5429('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x326e30=function(_0x10a2dc){return!_[_0x5429('0x5f')]([_0x5429('0x8c'),_0x5429('0x60'),_0x5429('0x61'),'IS\x20NOT\x20EMPTY'],_0x10a2dc);};var _0x51c654=function(_0x523c8f){if(!_0x523c8f||!_0x523c8f[_0x5429('0x62')]['length']){return'';}for(var _0x242568='(',_0x35a6c7=0x0;_0x35a6c7<_0x523c8f[_0x5429('0x62')]['length'];_0x35a6c7+=0x1){_0x35a6c7>0x0&&(_0x242568+='\x20'+_0x523c8f[_0x5429('0x63')]+'\x20');_0x242568+=_0x523c8f[_0x5429('0x62')][_0x35a6c7][_0x5429('0x64')]?_0x51c654(_0x523c8f[_0x5429('0x62')][_0x35a6c7]['group']):_0x523c8f[_0x5429('0x62')][_0x35a6c7][_0x5429('0x65')]+'\x20'+_0x523c8f[_0x5429('0x62')][_0x35a6c7][_0x5429('0x66')]+(_0x326e30(_0x523c8f['rules'][_0x35a6c7][_0x5429('0x66')])?'\x20'+_0x523c8f[_0x5429('0x62')][_0x35a6c7]['value']:'');}return _0x242568+')';};var _0x4f73a1={'where':{'id':_0x3c1b08[_0x5429('0x43')]['id']}},_0x501fca,_0x262407,_0x2803d4,_0x14e723,_0x2bc7b8;_0x4f73a1=_['merge']({},_0x4f73a1,_0x3c1b08[_0x5429('0x3f')]);return db[_0x5429('0x2d')][_0x5429('0x4d')](_0x4f73a1)[_0x5429('0x24')](function(_0x4f63c7){if(_0x4f63c7){_0x501fca=_0x4f63c7;return _0x4f63c7[_0x5429('0x68')]();}return null;})['then'](function(_0x2698ed){if(_0x2698ed){if(!_0x2698ed['length']){throw new db[(_0x5429('0x69'))][(_0x5429('0x8e'))](_0x5429('0x8f'),0x193);}_0x262407=_0x2698ed;return db[_0x5429('0x6a')][_0x5429('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x252aa1){if(_0x252aa1){_0x2803d4=_[_0x5429('0x6c')](_0x252aa1,'id');var _0x1bb8f9;var _0x3759b9=squel['select']();_0x3759b9[_0x5429('0x6e')](_0x501fca['table']);for(var _0x1b12c8=0x0;_0x1b12c8<_0x262407[_0x5429('0x36')];_0x1b12c8+=0x1){_0x1bb8f9=_0x262407[_0x1b12c8][_0x5429('0x70')]?_0x2803d4[_0x262407[_0x1b12c8][_0x5429('0x70')]][_0x5429('0x71')]:_0x262407[_0x1b12c8]['field'];_0x1bb8f9=_0x262407[_0x1b12c8]['function']?_['replace'](_0x160d3f[_0x262407[_0x1b12c8][_0x5429('0x72')]],'%s',_0x1bb8f9):_0x1bb8f9;_0x1bb8f9=_0x262407[_0x1b12c8][_0x5429('0x74')]?_[_0x5429('0x73')](_0x2da5b7[_0x262407[_0x1b12c8][_0x5429('0x74')]],'%s',_0x1bb8f9):_0x1bb8f9;if(_0x262407[_0x1b12c8][_0x5429('0x75')]){_0x3759b9[_0x5429('0x64')](_0x1bb8f9);}_0x262407[_0x1b12c8][_0x5429('0x76')]&&_0x3759b9['order'](_0x1bb8f9,_0x262407[_0x1b12c8][_0x5429('0x76')]===_0x5429('0x78')?![]:!![]);_0x3759b9[_0x5429('0x65')](_0x1bb8f9,_0x262407[_0x1b12c8][_0x5429('0x79')]||_0x1bb8f9);}if(_0x501fca[_0x5429('0x7a')]){_0x501fca[_0x5429('0x7a')]=JSON[_0x5429('0x7b')](_0x501fca['joins']);for(var _0x48f84e=0x0;_0x48f84e<_0x501fca[_0x5429('0x7a')][_0x5429('0x36')];_0x48f84e+=0x1){if(_0x501fca[_0x5429('0x7a')][_0x48f84e][_0x5429('0x2f')]&&_[_0x5429('0x5f')](_0x5118f6,_0x501fca[_0x5429('0x7a')][_0x48f84e][_0x5429('0x2f')])&&_0x501fca[_0x5429('0x7a')][_0x48f84e]['parentKey']&&_0x501fca[_0x5429('0x7a')][_0x48f84e]['foreignTable']&&_0x501fca[_0x5429('0x7a')][_0x48f84e]['foreignKey']){_0x3759b9[_0x501fca[_0x5429('0x7a')][_0x48f84e][_0x5429('0x2f')]](_0x501fca['joins'][_0x48f84e][_0x5429('0x7c')],null,util['format'](_0x5429('0x7d'),_0x501fca[_0x5429('0x6f')],_0x501fca[_0x5429('0x7a')][_0x48f84e][_0x5429('0x7e')],_0x501fca[_0x5429('0x7a')][_0x48f84e][_0x5429('0x7c')],_0x501fca[_0x5429('0x7a')][_0x48f84e][_0x5429('0x90')]));}}}if(_0x501fca[_0x5429('0x7f')]){_0x501fca[_0x5429('0x7f')]=JSON[_0x5429('0x7b')](_0x501fca['conditions']);_0x3759b9[_0x5429('0x3b')](_0x51c654(_0x501fca[_0x5429('0x7f')][_0x5429('0x64')]));}_0x2bc7b8=_0x3759b9[_0x5429('0x80')]();_0x3759b9['limit'](_0x2106ab);_0x3759b9['offset'](0x0);logger[_0x5429('0x81')]('Limited\x20Query:',_0x3759b9['toString']());return dbH[_0x5429('0x84')][_0x5429('0x30')](_0x3759b9[_0x5429('0x83')](),{'type':dbH[_0x5429('0x84')][_0x5429('0x85')][_0x5429('0x86')]});}})[_0x5429('0x24')](function(){return{'sql':_0x2bc7b8['toString']()};})['then'](respondWithResult(_0x498326,null))['catch'](handleError(_0x498326,null));}; \ No newline at end of file +var _0xd92a=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','CustomReports','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','keyBy','select','from','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20NULL','Sequelize','ValidationErrorItem','table','DESC','output','web','%s-%s.%s','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../files/reports','savename','countTable','COUNT(*)','cross_join','Please\x20insert\x20at\x20least\x20one\x20field','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd92a,0x1bc));var _0xad92=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd92a[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad92('0x0'));var zipdir=require(_0xad92('0x1'));var jsonpatch=require(_0xad92('0x2'));var rp=require('request-promise');var moment=require(_0xad92('0x3'));var BPromise=require(_0xad92('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xad92('0x5'));var csv=require(_0xad92('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad92('0x7'));var _=require(_0xad92('0x8'));var squel=require(_0xad92('0x9'));var crypto=require(_0xad92('0xa'));var jsforce=require(_0xad92('0xb'));var deskjs=require(_0xad92('0xc'));var toCsv=require(_0xad92('0x6'));var querystring=require(_0xad92('0xd'));var Papa=require('papaparse');var Redis=require(_0xad92('0xe'));var authService=require(_0xad92('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xad92('0x10'));var hardwareService=require(_0xad92('0x11'));var logger=require(_0xad92('0x12'))('api');var utils=require(_0xad92('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xad92('0x14'));var db=require(_0xad92('0x15'))['db'];var dbH=require(_0xad92('0x15'))[_0xad92('0x16')];function respondWithStatusCode(_0x13184f,_0x336550){_0x336550=_0x336550||0xcc;return function(_0x46073a){if(_0x46073a){return _0x13184f['sendStatus'](_0x336550);}return _0x13184f[_0xad92('0x17')](_0x336550)[_0xad92('0x18')]();};}function respondWithResult(_0x2e8c01,_0x200a3d){_0x200a3d=_0x200a3d||0xc8;return function(_0xe5dbe4){if(_0xe5dbe4){return _0x2e8c01[_0xad92('0x17')](_0x200a3d)[_0xad92('0x19')](_0xe5dbe4);}};}function respondWithFilteredResult(_0x1f9ec4,_0x566ded){return function(_0x5936e3){if(_0x5936e3){var _0x4d8009=typeof _0x566ded[_0xad92('0x1a')]===_0xad92('0x1b')&&typeof _0x566ded[_0xad92('0x1c')]===_0xad92('0x1b');var _0x12a544=_0x5936e3[_0xad92('0x1d')];var _0x5e87ca=_0x4d8009?0x0:_0x566ded[_0xad92('0x1a')];var _0x5965dc=_0x4d8009?_0x5936e3['count']:_0x566ded['offset']+_0x566ded[_0xad92('0x1c')];var _0x264de9;if(_0x5965dc>=_0x12a544){_0x5965dc=_0x12a544;_0x264de9=0xc8;}else{_0x264de9=0xce;}_0x1f9ec4[_0xad92('0x17')](_0x264de9);return _0x1f9ec4[_0xad92('0x1e')]('Content-Range',_0x5e87ca+'-'+_0x5965dc+'/'+_0x12a544)[_0xad92('0x19')](_0x5936e3);}return null;};}function patchUpdates(_0x4ea1d0){return function(_0x301b7a){try{jsonpatch[_0xad92('0x1f')](_0x301b7a,_0x4ea1d0,!![]);}catch(_0x223fbf){return BPromise['reject'](_0x223fbf);}return _0x301b7a[_0xad92('0x20')]();};}function saveUpdates(_0x5bcaa3,_0x5342e8){return function(_0x579444){if(_0x579444){return _0x579444['update'](_0x5bcaa3)[_0xad92('0x21')](function(_0x157796){return _0x157796;});}return null;};}function removeEntity(_0x5e92cf,_0x56307a){return function(_0x591a05){if(_0x591a05){return _0x591a05[_0xad92('0x22')]()['then'](function(){var _0x10945a=_0x591a05[_0xad92('0x23')]({'plain':!![]});var _0xd1e056=_0xad92('0x24');return db['UserProfileResource'][_0xad92('0x22')]({'where':{'type':_0xd1e056,'resourceId':_0x10945a['id']}})[_0xad92('0x21')](function(){return _0x591a05;});})['then'](function(){_0x5e92cf['status'](0xcc)[_0xad92('0x18')]();});}};}function handleEntityNotFound(_0x418e54,_0x5e53d4){return function(_0x4780db){if(!_0x4780db){_0x418e54['sendStatus'](0x194);}return _0x4780db;};}function handleError(_0x49d7b2,_0x4031d2){_0x4031d2=_0x4031d2||0x1f4;return function(_0x3a4f0d){logger['error'](_0x3a4f0d['stack']);if(_0x3a4f0d[_0xad92('0x25')]){delete _0x3a4f0d['name'];}_0x49d7b2[_0xad92('0x17')](_0x4031d2)[_0xad92('0x26')](_0x3a4f0d);};}exports['index']=function(_0x2a322f,_0x3e6a4b){var _0x10f5b0={},_0x34831b={},_0x32d1c2={'count':0x0,'rows':[]};var _0x37b358=_[_0xad92('0x27')](db[_0xad92('0x28')][_0xad92('0x29')],function(_0x279683){return{'name':_0x279683[_0xad92('0x2a')],'type':_0x279683['type'][_0xad92('0x2b')]};});_0x34831b[_0xad92('0x2c')]=_[_0xad92('0x27')](_0x37b358,_0xad92('0x25'));_0x34831b[_0xad92('0x2d')]=_[_0xad92('0x2e')](_0x2a322f[_0xad92('0x2d')]);_0x34831b[_0xad92('0x2f')]=_[_0xad92('0x30')](_0x34831b[_0xad92('0x2c')],_0x34831b[_0xad92('0x2d')]);_0x10f5b0['attributes']=_[_0xad92('0x30')](_0x34831b[_0xad92('0x2c')],qs[_0xad92('0x31')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x31')]));_0x10f5b0[_0xad92('0x32')]=_0x10f5b0[_0xad92('0x32')][_0xad92('0x33')]?_0x10f5b0[_0xad92('0x32')]:_0x34831b[_0xad92('0x2c')];if(!_0x2a322f[_0xad92('0x2d')][_0xad92('0x34')](_0xad92('0x35'))){_0x10f5b0[_0xad92('0x1c')]=qs['limit'](_0x2a322f[_0xad92('0x2d')][_0xad92('0x1c')]);_0x10f5b0[_0xad92('0x1a')]=qs[_0xad92('0x1a')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x1a')]);}_0x10f5b0[_0xad92('0x36')]=qs[_0xad92('0x37')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x37')]);_0x10f5b0['where']=qs[_0xad92('0x2f')](_['pick'](_0x2a322f[_0xad92('0x2d')],_0x34831b['filters']),_0x37b358);if(_0x2a322f[_0xad92('0x2d')][_0xad92('0x38')]){_0x10f5b0['where']=_[_0xad92('0x39')](_0x10f5b0[_0xad92('0x3a')],{'$or':_[_0xad92('0x27')](_0x37b358,function(_0x1444f8){if(_0x1444f8[_0xad92('0x3b')]!==_0xad92('0x3c')){var _0x4cb5cd={};_0x4cb5cd[_0x1444f8['name']]={'$like':'%'+_0x2a322f['query'][_0xad92('0x38')]+'%'};return _0x4cb5cd;}})});}_0x10f5b0=_[_0xad92('0x39')]({},_0x10f5b0,_0x2a322f[_0xad92('0x3d')]);var _0x2232a8={'where':_0x10f5b0[_0xad92('0x3a')]};return db[_0xad92('0x28')][_0xad92('0x1d')](_0x2232a8)['then'](function(_0x66c006){_0x32d1c2[_0xad92('0x1d')]=_0x66c006;if(_0x2a322f[_0xad92('0x2d')][_0xad92('0x3e')]){_0x10f5b0[_0xad92('0x3f')]=[{'all':!![]}];}return db[_0xad92('0x28')][_0xad92('0x40')](_0x10f5b0);})[_0xad92('0x21')](function(_0xdfca06){_0x32d1c2[_0xad92('0x41')]=_0xdfca06;return _0x32d1c2;})['then'](respondWithFilteredResult(_0x3e6a4b,_0x10f5b0))[_0xad92('0x42')](handleError(_0x3e6a4b,null));};exports[_0xad92('0x43')]=function(_0x475b7f,_0x136ec9){var _0x304ccc={'raw':![],'where':{'id':_0x475b7f[_0xad92('0x44')]['id']}},_0x1f324c={};_0x1f324c[_0xad92('0x2c')]=_[_0xad92('0x2e')](db['AnalyticCustomReport'][_0xad92('0x29')]);_0x1f324c[_0xad92('0x2d')]=_[_0xad92('0x2e')](_0x475b7f[_0xad92('0x2d')]);_0x1f324c['filters']=_[_0xad92('0x30')](_0x1f324c['model'],_0x1f324c['query']);_0x304ccc['attributes']=_[_0xad92('0x30')](_0x1f324c[_0xad92('0x2c')],qs[_0xad92('0x31')](_0x475b7f[_0xad92('0x2d')][_0xad92('0x31')]));_0x304ccc[_0xad92('0x32')]=_0x304ccc[_0xad92('0x32')][_0xad92('0x33')]?_0x304ccc[_0xad92('0x32')]:_0x1f324c[_0xad92('0x2c')];if(_0x475b7f[_0xad92('0x2d')]['includeAll']){_0x304ccc[_0xad92('0x3f')]=[{'all':!![]}];}_0x304ccc=_['merge']({},_0x304ccc,_0x475b7f['options']);return db[_0xad92('0x28')][_0xad92('0x45')](_0x304ccc)[_0xad92('0x21')](handleEntityNotFound(_0x136ec9,null))[_0xad92('0x21')](respondWithResult(_0x136ec9,null))[_0xad92('0x42')](handleError(_0x136ec9,null));};exports['create']=function(_0xb09a79,_0x58cb06){return db['AnalyticCustomReport'][_0xad92('0x46')](_0xb09a79[_0xad92('0x47')],{})[_0xad92('0x21')](function(_0x231cb7){var _0x711246=_0xb09a79[_0xad92('0x48')][_0xad92('0x23')]({'plain':!![]});if(!_0x711246)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x711246['role']==='user'){var _0xad41af=_0x231cb7[_0xad92('0x23')]({'plain':!![]});var _0x128196=_0xad92('0x49');return db[_0xad92('0x4a')][_0xad92('0x45')]({'where':{'name':_0x128196,'userProfileId':_0x711246[_0xad92('0x4b')]},'raw':!![]})['then'](function(_0x476b8e){if(_0x476b8e&&_0x476b8e[_0xad92('0x4c')]===0x0){return db['UserProfileResource'][_0xad92('0x46')]({'name':_0xad41af[_0xad92('0x25')],'resourceId':_0xad41af['id'],'type':_0xad92('0x24'),'sectionId':_0x476b8e['id']},{})[_0xad92('0x21')](function(){return _0x231cb7;});}else{return _0x231cb7;}})[_0xad92('0x42')](function(_0x4d34d8){logger[_0xad92('0x4d')](_0xad92('0x4e'),_0x4d34d8);throw _0x4d34d8;});}return _0x231cb7;})[_0xad92('0x21')](respondWithResult(_0x58cb06,0xc9))[_0xad92('0x42')](handleError(_0x58cb06,null));};exports['update']=function(_0x383209,_0x842790){if(_0x383209[_0xad92('0x47')]['id']){delete _0x383209[_0xad92('0x47')]['id'];}return db[_0xad92('0x28')][_0xad92('0x45')]({'where':{'id':_0x383209[_0xad92('0x44')]['id']}})['then'](handleEntityNotFound(_0x842790,null))[_0xad92('0x21')](saveUpdates(_0x383209[_0xad92('0x47')],null))['then'](respondWithResult(_0x842790,null))['catch'](handleError(_0x842790,null));};exports[_0xad92('0x22')]=function(_0x9276e8,_0x407121){return db['AnalyticCustomReport'][_0xad92('0x45')]({'where':{'id':_0x9276e8['params']['id']}})[_0xad92('0x21')](handleEntityNotFound(_0x407121,null))[_0xad92('0x21')](removeEntity(_0x407121,null))[_0xad92('0x42')](handleError(_0x407121,null));};exports[_0xad92('0x4f')]=function(_0x38f373,_0x194fc0){var _0x5b3577=0xa;var _0x423ecf=['join',_0xad92('0x50'),_0xad92('0x51'),'cross_join'];var _0x4fe1a2={'SUM':_0xad92('0x52'),'COUNT':_0xad92('0x53'),'COUNT DISTINCT':_0xad92('0x54'),'MAX':_0xad92('0x55'),'MIN':_0xad92('0x56'),'AVG':_0xad92('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xad92('0x58'),'GROUP_CONCAT DESC':_0xad92('0x59')};var _0x4641a0={'SEC_TO_TIME':_0xad92('0x5a'),'DATE':_0xad92('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x39fe2c=function(_0x364747){return!_[_0xad92('0x5e')]([_0xad92('0x5f'),'IS\x20NOT\x20NULL',_0xad92('0x60'),_0xad92('0x61')],_0x364747);};var _0x49169d=function(_0x11daad){if(!_0x11daad||!_0x11daad['rules']['length']){return'';}for(var _0x12648b='(',_0xe4f719=0x0;_0xe4f719<_0x11daad[_0xad92('0x62')][_0xad92('0x33')];_0xe4f719+=0x1){_0xe4f719>0x0&&(_0x12648b+='\x20'+_0x11daad[_0xad92('0x63')]+'\x20');_0x12648b+=_0x11daad['rules'][_0xe4f719][_0xad92('0x64')]?_0x49169d(_0x11daad[_0xad92('0x62')][_0xe4f719]['group']):_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x65')]+'\x20'+_0x11daad[_0xad92('0x62')][_0xe4f719]['condition']+(_0x39fe2c(_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x66')])?'\x20'+_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x67')]:'');}return _0x12648b+')';};var _0x393490={'where':{'id':_0x38f373[_0xad92('0x44')]['id']}},_0x2e6915,_0x18ec47,_0x5204ac,_0x355064,_0x23c56d;_0x393490=_[_0xad92('0x39')]({},_0x393490,_0x38f373[_0xad92('0x3d')]);return db['AnalyticCustomReport'][_0xad92('0x45')](_0x393490)[_0xad92('0x21')](function(_0x102a54){if(_0x102a54){_0x2e6915=_0x102a54;return _0x102a54[_0xad92('0x68')]();}return null;})[_0xad92('0x21')](function(_0x2d289d){if(_0x2d289d){if(!_0x2d289d[_0xad92('0x33')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x18ec47=_0x2d289d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xad92('0x21')](function(_0x25e57e){if(_0x25e57e){_0x5204ac=_[_0xad92('0x69')](_0x25e57e,'id');var _0x5af894;var _0x424daa=squel[_0xad92('0x6a')]();_0x424daa[_0xad92('0x6b')](_0x2e6915['table']);for(var _0x40494f=0x0;_0x40494f<_0x18ec47[_0xad92('0x33')];_0x40494f+=0x1){_0x5af894=_0x18ec47[_0x40494f]['MetricId']?_0x5204ac[_0x18ec47[_0x40494f][_0xad92('0x6c')]][_0xad92('0x6d')]:_0x18ec47[_0x40494f][_0xad92('0x65')];_0x5af894=_0x18ec47[_0x40494f]['function']?_[_0xad92('0x6e')](_0x4fe1a2[_0x18ec47[_0x40494f][_0xad92('0x6f')]],'%s',_0x5af894):_0x5af894;_0x5af894=_0x18ec47[_0x40494f][_0xad92('0x70')]?_['replace'](_0x4641a0[_0x18ec47[_0x40494f][_0xad92('0x70')]],'%s',_0x5af894):_0x5af894;if(_0x18ec47[_0x40494f][_0xad92('0x71')]){_0x424daa['group'](_0x5af894);}_0x18ec47[_0x40494f][_0xad92('0x72')]&&_0x424daa[_0xad92('0x36')](_0x5af894,_0x18ec47[_0x40494f][_0xad92('0x72')]==='DESC'?![]:!![]);_0x424daa[_0xad92('0x65')](_0x5af894,_0x18ec47[_0x40494f][_0xad92('0x73')]||_0x5af894);}if(_0x2e6915[_0xad92('0x74')]){_0x2e6915[_0xad92('0x74')]=JSON['parse'](_0x2e6915[_0xad92('0x74')]);for(var _0x51c066=0x0;_0x51c066<_0x2e6915[_0xad92('0x74')][_0xad92('0x33')];_0x51c066+=0x1){if(_0x2e6915['joins'][_0x51c066][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x423ecf,_0x2e6915[_0xad92('0x74')][_0x51c066]['type'])&&_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x75')]&&_0x2e6915['joins'][_0x51c066][_0xad92('0x76')]&&_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x77')]){_0x424daa[_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x3b')]](_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x76')],null,util[_0xad92('0x70')](_0xad92('0x78'),_0x2e6915['table'],_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x75')],_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x76')],_0x2e6915['joins'][_0x51c066][_0xad92('0x77')]));}}}if(_0x2e6915[_0xad92('0x79')]){_0x2e6915['conditions']=JSON[_0xad92('0x7a')](_0x2e6915[_0xad92('0x79')]);_0x424daa[_0xad92('0x3a')](_0x49169d(_0x2e6915[_0xad92('0x79')][_0xad92('0x64')]));}_0x23c56d=_0x424daa['clone']();_0x424daa[_0xad92('0x1c')](_0x5b3577);_0x424daa['offset'](0x0);logger[_0xad92('0x7b')](_0xad92('0x7c'),_0x424daa['toString']());return dbH[_0xad92('0x7d')][_0xad92('0x2d')](_0x424daa[_0xad92('0x7e')](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]});}})['then'](respondWithResult(_0x194fc0,null))[_0xad92('0x42')](handleError(_0x194fc0,null));};function runReport(_0x3fb951,_0x432753,_0x4d103e){var _0xda3146=_0x432753[_0xad92('0x25')];var _0x176efd=0xa;var _0x6221cb=[_0xad92('0x81'),_0xad92('0x50'),_0xad92('0x51'),'cross_join'];var _0x2eb007={'SUM':'SUM(%s)','COUNT':_0xad92('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xad92('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xad92('0x82'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xad92('0x59')};var _0x1e5e15={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xad92('0x83'),'ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x5ca5dd=function(_0x2b8e44){return!_[_0xad92('0x5e')]([_0xad92('0x5f'),_0xad92('0x84'),_0xad92('0x60'),'IS\x20NOT\x20EMPTY'],_0x2b8e44);};var _0x1a4290=function(_0x1538e9){if(!_0x1538e9||!_0x1538e9[_0xad92('0x62')][_0xad92('0x33')]){return'';}for(var _0x4c82df='(',_0x1e30bc=0x0;_0x1e30bc<_0x1538e9[_0xad92('0x62')][_0xad92('0x33')];_0x1e30bc+=0x1){_0x1e30bc>0x0&&(_0x4c82df+='\x20'+_0x1538e9[_0xad92('0x63')]+'\x20');_0x4c82df+=_0x1538e9['rules'][_0x1e30bc][_0xad92('0x64')]?_0x1a4290(_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x64')]):_0x1538e9[_0xad92('0x62')][_0x1e30bc]['field']+'\x20'+_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x66')]+(_0x5ca5dd(_0x1538e9[_0xad92('0x62')][_0x1e30bc]['condition'])?'\x20'+_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x67')]:'');}return _0x4c82df+')';};var _0xc431f0={'where':{'id':_0x3fb951['id']}},_0x1f4a96,_0x150aac,_0x23ad34,_0x2bd71a,_0x20fcbb;_0xc431f0=_[_0xad92('0x39')]({},_0xc431f0,_0x4d103e);return db[_0xad92('0x28')]['find'](_0xc431f0)['then'](function(_0x10870f){if(_0x10870f){_0x1f4a96=_0x10870f;return _0x10870f[_0xad92('0x68')]();}return null;})[_0xad92('0x21')](function(_0x4fab5f){if(_0x4fab5f){if(!_0x4fab5f[_0xad92('0x33')]){throw new db[(_0xad92('0x85'))][(_0xad92('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x150aac=_0x4fab5f;return db['AnalyticMetric'][_0xad92('0x40')]({'raw':!![]});}return null;})[_0xad92('0x21')](function(_0x51d37e){if(_0x51d37e){_0x23ad34=_[_0xad92('0x69')](_0x51d37e,'id');var _0x4e63e6;var _0xcd406f=squel[_0xad92('0x6a')]();_0xcd406f[_0xad92('0x6b')](_0x1f4a96[_0xad92('0x87')]);for(var _0x38ab35=0x0;_0x38ab35<_0x150aac[_0xad92('0x33')];_0x38ab35+=0x1){_0x4e63e6=_0x150aac[_0x38ab35][_0xad92('0x6c')]?_0x23ad34[_0x150aac[_0x38ab35]['MetricId']]['metric']:_0x150aac[_0x38ab35][_0xad92('0x65')];_0x4e63e6=_0x150aac[_0x38ab35][_0xad92('0x6f')]?_[_0xad92('0x6e')](_0x2eb007[_0x150aac[_0x38ab35][_0xad92('0x6f')]],'%s',_0x4e63e6):_0x4e63e6;_0x4e63e6=_0x150aac[_0x38ab35]['format']?_[_0xad92('0x6e')](_0x1e5e15[_0x150aac[_0x38ab35][_0xad92('0x70')]],'%s',_0x4e63e6):_0x4e63e6;if(_0x150aac[_0x38ab35][_0xad92('0x71')]){_0xcd406f['group'](_0x4e63e6);}_0x150aac[_0x38ab35]['orderBy']&&_0xcd406f['order'](_0x4e63e6,_0x150aac[_0x38ab35][_0xad92('0x72')]===_0xad92('0x88')?![]:!![]);_0xcd406f[_0xad92('0x65')](_0x4e63e6,_0x150aac[_0x38ab35]['alias']||_0x4e63e6);}if(_0x1f4a96[_0xad92('0x74')]){_0x1f4a96[_0xad92('0x74')]=JSON[_0xad92('0x7a')](_0x1f4a96[_0xad92('0x74')]);for(var _0x191862=0x0;_0x191862<_0x1f4a96[_0xad92('0x74')][_0xad92('0x33')];_0x191862+=0x1){if(_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x6221cb,_0x1f4a96['joins'][_0x191862][_0xad92('0x3b')])&&_0x1f4a96[_0xad92('0x74')][_0x191862]['parentKey']&&_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')]&&_0x1f4a96[_0xad92('0x74')][_0x191862]['foreignKey']){_0xcd406f[_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x3b')]](_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')],null,util[_0xad92('0x70')](_0xad92('0x78'),_0x1f4a96['table'],_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x75')],_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')],_0x1f4a96[_0xad92('0x74')][_0x191862]['foreignKey']));}}}if(_0x1f4a96[_0xad92('0x79')]){_0x1f4a96[_0xad92('0x79')]=JSON[_0xad92('0x7a')](_0x1f4a96[_0xad92('0x79')]);_0xcd406f[_0xad92('0x3a')](_0x1a4290(_0x1f4a96[_0xad92('0x79')][_0xad92('0x64')]));}_0x20fcbb=_0xcd406f['clone']();_0xcd406f[_0xad92('0x1c')](_0x176efd);_0xcd406f[_0xad92('0x1a')](0x0);return;}})[_0xad92('0x21')](function(){if(_0x432753[_0xad92('0x89')]===_0xad92('0x8a')){return null;}var _0x1067a3=_[_0xad92('0x39')](_0x432753,{'name':_0x432753['fullPath']||_0x432753[_0xad92('0x25')]||_0x1f4a96['name'],'basename':_0xda3146,'savename':util[_0xad92('0x70')](_0xad92('0x8b'),_0x432753[_0xad92('0x25')]||_0x1f4a96[_0xad92('0x25')],require('randomstring')['generate'](0x4),_0x432753['output']||'csv'),'reportId':_0x1f4a96['id'],'reportType':_0xad92('0x8c')});return db[_0xad92('0x8d')][_0xad92('0x46')](_0x1067a3,{'raw':!![]});})['then'](function(_0x499449){if(_0x1f4a96['table']==='cdr'){_0x20fcbb[_0xad92('0x3a')](_0x1f4a96[_0xad92('0x87')]+_0xad92('0x8e'),_0x432753[_0xad92('0x8f')],_0x432753[_0xad92('0x90')]);}else{_0x20fcbb['where'](_0x1f4a96[_0xad92('0x87')]+_0xad92('0x91'),_0x432753[_0xad92('0x8f')],_0x432753[_0xad92('0x90')]);}if(_0x499449){logger[_0xad92('0x92')]('Run\x20Query:',_0x20fcbb[_0xad92('0x7e')]());require(_0xad92('0x93'))['fork'](path['join'](__dirname,'../../components/export/',_0x499449[_0xad92('0x89')]),[_0x499449['id'],_0x20fcbb['toString'](),path['join'](__dirname,_0xad92('0x94'),_0x499449[_0xad92('0x95')]),_0xda3146]);return _0x499449;}else{var _0x3dabf5=squel[_0xad92('0x6a')]();_0x3dabf5['from']('('+_0x20fcbb[_0xad92('0x7e')]()+')',_0xad92('0x96'));_0x3dabf5['field'](_0xad92('0x97'),'count');_0x20fcbb[_0xad92('0x1c')](_0x432753[_0xad92('0x1c')]||_0x176efd);_0x20fcbb[_0xad92('0x1a')](_0x432753[_0xad92('0x1a')]||0x0);return dbH[_0xad92('0x7d')][_0xad92('0x2d')](_0x3dabf5['toString'](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]})[_0xad92('0x21')](function(_0x3d7798){if(!_0x3d7798[_0xad92('0x33')]){_0x2bd71a=0x0;}else{_0x2bd71a=_0x3d7798[0x0][_0xad92('0x1d')]||0x0;}return dbH['sequelize'][_0xad92('0x2d')](_0x20fcbb[_0xad92('0x7e')](),{'type':dbH[_0xad92('0x7d')][_0xad92('0x7f')][_0xad92('0x80')]});})['then'](function(_0x3d56aa){return{'rows':_0x3d56aa||[],'count':_0x2bd71a};});}});}exports['run']=function(_0x5a2190,_0x448e8f){return runReport(_0x5a2190[_0xad92('0x44')],_0x5a2190[_0xad92('0x2d')],_0x5a2190[_0xad92('0x3d')])[_0xad92('0x21')](respondWithResult(_0x448e8f,null))[_0xad92('0x42')](handleError(_0x448e8f,null));};exports['runReport']=runReport;exports['query']=function(_0xe64601,_0x54eb4d){var _0x8cb7f7=0xa;var _0x12d2ed=[_0xad92('0x81'),'left_join','right_join',_0xad92('0x98')];var _0x5d2d72={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xad92('0x54'),'MAX':'MAX(%s)','MIN':_0xad92('0x56'),'AVG':_0xad92('0x57'),'GROUP_CONCAT':_0xad92('0x82'),'GROUP_CONCAT ASC':_0xad92('0x58'),'GROUP_CONCAT DESC':_0xad92('0x59')};var _0x462417={'SEC_TO_TIME':_0xad92('0x5a'),'DATE':_0xad92('0x5b'),'HOUR':_0xad92('0x83'),'ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x3c3223=function(_0x1da28a){return!_[_0xad92('0x5e')](['IS\x20NULL',_0xad92('0x84'),_0xad92('0x60'),_0xad92('0x61')],_0x1da28a);};var _0x5472b0=function(_0xb0b5f3){if(!_0xb0b5f3||!_0xb0b5f3['rules']['length']){return'';}for(var _0x592ec2='(',_0x1167d1=0x0;_0x1167d1<_0xb0b5f3[_0xad92('0x62')][_0xad92('0x33')];_0x1167d1+=0x1){_0x1167d1>0x0&&(_0x592ec2+='\x20'+_0xb0b5f3[_0xad92('0x63')]+'\x20');_0x592ec2+=_0xb0b5f3[_0xad92('0x62')][_0x1167d1]['group']?_0x5472b0(_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x64')]):_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x65')]+'\x20'+_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x66')]+(_0x3c3223(_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x66')])?'\x20'+_0xb0b5f3[_0xad92('0x62')][_0x1167d1]['value']:'');}return _0x592ec2+')';};var _0x1fc9a6={'where':{'id':_0xe64601[_0xad92('0x44')]['id']}},_0x5aec4e,_0x4c1e67,_0x32e228,_0x5494dd,_0xfa4c4;_0x1fc9a6=_[_0xad92('0x39')]({},_0x1fc9a6,_0xe64601['options']);return db[_0xad92('0x28')]['find'](_0x1fc9a6)[_0xad92('0x21')](function(_0x54f978){if(_0x54f978){_0x5aec4e=_0x54f978;return _0x54f978[_0xad92('0x68')]();}return null;})['then'](function(_0x530e4b){if(_0x530e4b){if(!_0x530e4b[_0xad92('0x33')]){throw new db['Sequelize'][(_0xad92('0x86'))](_0xad92('0x99'),0x193);}_0x4c1e67=_0x530e4b;return db['AnalyticMetric'][_0xad92('0x40')]({'raw':!![]});}return null;})['then'](function(_0x52e130){if(_0x52e130){_0x32e228=_[_0xad92('0x69')](_0x52e130,'id');var _0x11ae45;var _0x48450c=squel[_0xad92('0x6a')]();_0x48450c['from'](_0x5aec4e[_0xad92('0x87')]);for(var _0x2c5a48=0x0;_0x2c5a48<_0x4c1e67[_0xad92('0x33')];_0x2c5a48+=0x1){_0x11ae45=_0x4c1e67[_0x2c5a48]['MetricId']?_0x32e228[_0x4c1e67[_0x2c5a48][_0xad92('0x6c')]][_0xad92('0x6d')]:_0x4c1e67[_0x2c5a48][_0xad92('0x65')];_0x11ae45=_0x4c1e67[_0x2c5a48]['function']?_[_0xad92('0x6e')](_0x5d2d72[_0x4c1e67[_0x2c5a48]['function']],'%s',_0x11ae45):_0x11ae45;_0x11ae45=_0x4c1e67[_0x2c5a48]['format']?_[_0xad92('0x6e')](_0x462417[_0x4c1e67[_0x2c5a48][_0xad92('0x70')]],'%s',_0x11ae45):_0x11ae45;if(_0x4c1e67[_0x2c5a48][_0xad92('0x71')]){_0x48450c[_0xad92('0x64')](_0x11ae45);}_0x4c1e67[_0x2c5a48][_0xad92('0x72')]&&_0x48450c[_0xad92('0x36')](_0x11ae45,_0x4c1e67[_0x2c5a48][_0xad92('0x72')]==='DESC'?![]:!![]);_0x48450c[_0xad92('0x65')](_0x11ae45,_0x4c1e67[_0x2c5a48][_0xad92('0x73')]||_0x11ae45);}if(_0x5aec4e[_0xad92('0x74')]){_0x5aec4e['joins']=JSON[_0xad92('0x7a')](_0x5aec4e[_0xad92('0x74')]);for(var _0x336dc0=0x0;_0x336dc0<_0x5aec4e[_0xad92('0x74')]['length'];_0x336dc0+=0x1){if(_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x12d2ed,_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')])&&_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x75')]&&_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x76')]&&_0x5aec4e['joins'][_0x336dc0][_0xad92('0x77')]){_0x48450c[_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')]](_0x5aec4e['joins'][_0x336dc0]['foreignTable'],null,util[_0xad92('0x70')]('%s.%s\x20=\x20%s.%s',_0x5aec4e['table'],_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x75')],_0x5aec4e['joins'][_0x336dc0][_0xad92('0x76')],_0x5aec4e['joins'][_0x336dc0]['foreignKey']));}}}if(_0x5aec4e['conditions']){_0x5aec4e[_0xad92('0x79')]=JSON[_0xad92('0x7a')](_0x5aec4e[_0xad92('0x79')]);_0x48450c[_0xad92('0x3a')](_0x5472b0(_0x5aec4e[_0xad92('0x79')][_0xad92('0x64')]));}_0xfa4c4=_0x48450c['clone']();_0x48450c[_0xad92('0x1c')](_0x8cb7f7);_0x48450c[_0xad92('0x1a')](0x0);logger[_0xad92('0x7b')](_0xad92('0x7c'),_0x48450c[_0xad92('0x7e')]());return dbH['sequelize']['query'](_0x48450c[_0xad92('0x7e')](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]});}})['then'](function(){return{'sql':_0xfa4c4[_0xad92('0x7e')]()};})[_0xad92('0x21')](respondWithResult(_0x54eb4d,null))[_0xad92('0x42')](handleError(_0x54eb4d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 56dc4f4..c521735 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9685=['./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment','request-promise','path','../../config/environment'];(function(_0xc9d60b,_0x4f4208){var _0x382273=function(_0x2d18b5){while(--_0x2d18b5){_0xc9d60b['push'](_0xc9d60b['shift']());}};_0x382273(++_0x4f4208);}(_0x9685,0x72));var _0x5968=function(_0xa59806,_0x4be614){_0xa59806=_0xa59806-0x0;var _0x94d9a9=_0x9685[_0xa59806];return _0x94d9a9;};'use strict';var _=require('lodash');var util=require(_0x5968('0x0'));var logger=require('../../config/logger')(_0x5968('0x1'));var moment=require(_0x5968('0x2'));var BPromise=require('bluebird');var rp=require(_0x5968('0x3'));var fs=require('fs');var path=require(_0x5968('0x4'));var rimraf=require('rimraf');var config=require(_0x5968('0x5'));var attributes=require(_0x5968('0x6'));module['exports']=function(_0x86f3f,_0x4da796){return _0x86f3f[_0x5968('0x7')](_0x5968('0x8'),attributes,{'tableName':_0x5968('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c50=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x2c50,0x158));var _0x02c5=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x2c50[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0x02c5('0x0'));var util=require(_0x02c5('0x1'));var logger=require(_0x02c5('0x2'))(_0x02c5('0x3'));var moment=require(_0x02c5('0x4'));var BPromise=require(_0x02c5('0x5'));var rp=require(_0x02c5('0x6'));var fs=require('fs');var path=require(_0x02c5('0x7'));var rimraf=require('rimraf');var config=require(_0x02c5('0x8'));var attributes=require(_0x02c5('0x9'));module[_0x02c5('0xa')]=function(_0x72f6f9,_0x46fa5a){return _0x72f6f9[_0x02c5('0xb')](_0x02c5('0xc'),attributes,{'tableName':_0x02c5('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 17a1e77..267c02d 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf016=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xf016,0xa1));var _0x6f01=function(_0x19c447,_0x2469f8){_0x19c447=_0x19c447-0x0;var _0x4e7034=_0xf016[_0x19c447];return _0x4e7034;};'use strict';var _=require(_0x6f01('0x0'));var util=require(_0x6f01('0x1'));var moment=require(_0x6f01('0x2'));var BPromise=require(_0x6f01('0x3'));var rs=require(_0x6f01('0x4'));var fs=require('fs');var Redis=require(_0x6f01('0x5'));var db=require(_0x6f01('0x6'))['db'];var utils=require(_0x6f01('0x7'));var logger=require(_0x6f01('0x8'))(_0x6f01('0x9'));var config=require(_0x6f01('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6f01('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56cdc1,_0x13861d,_0x4b52d9){return new BPromise(function(_0x39a62f,_0x41f4fd){return client['request'](_0x56cdc1,_0x4b52d9)[_0x6f01('0xc')](function(_0x2a633a){logger[_0x6f01('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13861d,'request\x20sent');logger[_0x6f01('0xe')](_0x6f01('0xf'),_0x13861d,'request\x20sent',JSON[_0x6f01('0x10')](_0x2a633a));if(_0x2a633a['error']){if(_0x2a633a['error'][_0x6f01('0x11')]===0x1f4){logger[_0x6f01('0x12')](_0x6f01('0x13'),_0x13861d,_0x2a633a['error'][_0x6f01('0x14')]);return _0x41f4fd(_0x2a633a[_0x6f01('0x12')][_0x6f01('0x14')]);}logger['error'](_0x6f01('0x13'),_0x13861d,_0x2a633a['error'][_0x6f01('0x14')]);return _0x39a62f(_0x2a633a[_0x6f01('0x12')][_0x6f01('0x14')]);}else{logger[_0x6f01('0xd')](_0x6f01('0x13'),_0x13861d,_0x6f01('0x15'));_0x39a62f(_0x2a633a[_0x6f01('0x16')][_0x6f01('0x14')]);}})['catch'](function(_0x1f799e){logger[_0x6f01('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13861d,_0x1f799e);_0x41f4fd(_0x1f799e);});});} \ No newline at end of file +var _0x08d3=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x803ae0,_0x5c5f30){var _0x3c38b1=function(_0x59b091){while(--_0x59b091){_0x803ae0['push'](_0x803ae0['shift']());}};_0x3c38b1(++_0x5c5f30);}(_0x08d3,0x6b));var _0x308d=function(_0x5776cb,_0x579eb7){_0x5776cb=_0x5776cb-0x0;var _0x46349f=_0x08d3[_0x5776cb];return _0x46349f;};'use strict';var _=require(_0x308d('0x0'));var util=require('util');var moment=require(_0x308d('0x1'));var BPromise=require(_0x308d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x308d('0x3'));var db=require(_0x308d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x308d('0x5'))(_0x308d('0x6'));var config=require(_0x308d('0x7'));var jayson=require(_0x308d('0x8'));var client=jayson[_0x308d('0x9')][_0x308d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431dcb,_0x8f13b8,_0x4b8901){return new BPromise(function(_0x3e5a61,_0x5ed568){return client['request'](_0x431dcb,_0x4b8901)['then'](function(_0x2dbccc){logger['info'](_0x308d('0xb'),_0x8f13b8,_0x308d('0xc'));logger[_0x308d('0xd')](_0x308d('0xe'),_0x8f13b8,_0x308d('0xc'),JSON['stringify'](_0x2dbccc));if(_0x2dbccc[_0x308d('0xf')]){if(_0x2dbccc[_0x308d('0xf')][_0x308d('0x10')]===0x1f4){logger[_0x308d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x2dbccc[_0x308d('0xf')]['message']);return _0x5ed568(_0x2dbccc[_0x308d('0xf')]['message']);}logger[_0x308d('0xf')](_0x308d('0xb'),_0x8f13b8,_0x2dbccc[_0x308d('0xf')]['message']);return _0x3e5a61(_0x2dbccc[_0x308d('0xf')]['message']);}else{logger[_0x308d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x308d('0xc'));_0x3e5a61(_0x2dbccc[_0x308d('0x12')]['message']);}})[_0x308d('0x13')](function(_0x356abd){logger[_0x308d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x356abd);_0x5ed568(_0x356abd);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 88e9b4b..1b8b136 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bab=['query','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0x40dcdb,_0x106713){var _0xdedf25=function(_0x5c3420){while(--_0x5c3420){_0x40dcdb['push'](_0x40dcdb['shift']());}};_0xdedf25(++_0x106713);}(_0x3bab,0xf8));var _0xb3ba=function(_0x55394d,_0x51c4f7){_0x55394d=_0x55394d-0x0;var _0x114bc5=_0x3bab[_0x55394d];return _0x114bc5;};'use strict';var multer=require(_0xb3ba('0x0'));var util=require(_0xb3ba('0x1'));var path=require(_0xb3ba('0x2'));var timeout=require(_0xb3ba('0x3'));var express=require(_0xb3ba('0x4'));var router=express[_0xb3ba('0x5')]();var fs_extra=require(_0xb3ba('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb3ba('0x7'));var config=require(_0xb3ba('0x8'));var controller=require(_0xb3ba('0x9'));router[_0xb3ba('0xa')]('/',auth[_0xb3ba('0xb')](),controller['index']);router[_0xb3ba('0xa')](_0xb3ba('0xc'),auth['isAuthenticated'](),controller[_0xb3ba('0xd')]);router['get'](_0xb3ba('0xe'),auth[_0xb3ba('0xb')](),controller[_0xb3ba('0xf')]);router[_0xb3ba('0xa')]('/:id/run',auth[_0xb3ba('0xb')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0xb3ba('0x10')]);router[_0xb3ba('0x11')]('/',auth[_0xb3ba('0xb')](),controller['create']);router[_0xb3ba('0x12')](_0xb3ba('0xc'),auth[_0xb3ba('0xb')](),controller[_0xb3ba('0x13')]);router[_0xb3ba('0x14')](_0xb3ba('0xc'),auth[_0xb3ba('0xb')](),controller[_0xb3ba('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0981=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','post','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x15cc03,_0x10fd48){var _0x3cc81f=function(_0x42be7b){while(--_0x42be7b){_0x15cc03['push'](_0x15cc03['shift']());}};_0x3cc81f(++_0x10fd48);}(_0x0981,0x9c));var _0x1098=function(_0x1aa41f,_0x1e1ea4){_0x1aa41f=_0x1aa41f-0x0;var _0x1f8890=_0x0981[_0x1aa41f];return _0x1f8890;};'use strict';var multer=require(_0x1098('0x0'));var util=require(_0x1098('0x1'));var path=require(_0x1098('0x2'));var timeout=require(_0x1098('0x3'));var express=require(_0x1098('0x4'));var router=express[_0x1098('0x5')]();var fs_extra=require(_0x1098('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1098('0x7'));var config=require(_0x1098('0x8'));var controller=require(_0x1098('0x9'));router[_0x1098('0xa')]('/',auth[_0x1098('0xb')](),controller[_0x1098('0xc')]);router[_0x1098('0xa')](_0x1098('0xd'),auth[_0x1098('0xb')](),controller[_0x1098('0xe')]);router[_0x1098('0xa')]('/:id/preview',auth[_0x1098('0xb')](),controller[_0x1098('0xf')]);router[_0x1098('0xa')](_0x1098('0x10'),auth[_0x1098('0xb')](),controller[_0x1098('0x11')]);router[_0x1098('0xa')](_0x1098('0x12'),auth[_0x1098('0xb')](),controller['query']);router[_0x1098('0x13')]('/',auth[_0x1098('0xb')](),controller['create']);router[_0x1098('0x14')](_0x1098('0xd'),auth['isAuthenticated'](),controller[_0x1098('0x15')]);router[_0x1098('0x16')]('/:id',auth[_0x1098('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 9165676..0d37c9d 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x46ed,0x168));var _0xd46e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x46ed[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b4f48b7..7762ef7 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x403a19,_0x1d9327){var _0x5f4938=function(_0x4bb9f5){while(--_0x4bb9f5){_0x403a19['push'](_0x403a19['shift']());}};_0x5f4938(++_0x1d9327);}(_0x187d,0x93));var _0xd187=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x187d[_0x4c7fb5];return _0x2e10ac;};'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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','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)'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2fea77,_0x579420){_0x2fea77=_0x2fea77-0x0;var _0x2171df=_0xdbf5[_0x2fea77];return _0x2171df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index fbdb0c1..f5a6b78 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b30=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d6f18,_0xa215b9){var _0x24981c=function(_0xe44d93){while(--_0xe44d93){_0x3d6f18['push'](_0x3d6f18['shift']());}};_0x24981c(++_0xa215b9);}(_0x1b30,0x1f0));var _0x01b3=function(_0x4eec6a,_0x41af19){_0x4eec6a=_0x4eec6a-0x0;var _0x157316=_0x1b30[_0x4eec6a];return _0x157316;};'use strict';var _=require('lodash');var util=require(_0x01b3('0x0'));var logger=require('../../config/logger')(_0x01b3('0x1'));var moment=require(_0x01b3('0x2'));var BPromise=require(_0x01b3('0x3'));var rp=require(_0x01b3('0x4'));var fs=require('fs');var path=require(_0x01b3('0x5'));var rimraf=require(_0x01b3('0x6'));var config=require(_0x01b3('0x7'));var attributes=require(_0x01b3('0x8'));module[_0x01b3('0x9')]=function(_0x2fd6b7,_0xa4fe59){return _0x2fd6b7['define'](_0x01b3('0xa'),attributes,{'tableName':_0x01b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c78=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x481773,_0x1bf206){var _0x3920d5=function(_0x1071d2){while(--_0x1071d2){_0x481773['push'](_0x481773['shift']());}};_0x3920d5(++_0x1bf206);}(_0x0c78,0x176));var _0x80c7=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x0c78[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x80c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x80c7('0x1'));var moment=require(_0x80c7('0x2'));var BPromise=require(_0x80c7('0x3'));var rp=require(_0x80c7('0x4'));var fs=require('fs');var path=require(_0x80c7('0x5'));var rimraf=require(_0x80c7('0x6'));var config=require(_0x80c7('0x7'));var attributes=require(_0x80c7('0x8'));module['exports']=function(_0x16e593,_0x595e39){return _0x16e593[_0x80c7('0x9')](_0x80c7('0xa'),attributes,{'tableName':_0x80c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 8cbd33c..2d00f7a 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ec=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x196327,_0xa1d43a){var _0x2ea847=function(_0xd7cf3d){while(--_0xd7cf3d){_0x196327['push'](_0x196327['shift']());}};_0x2ea847(++_0xa1d43a);}(_0x36ec,0x86));var _0xc36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc36e('0x0'));var util=require(_0xc36e('0x1'));var moment=require(_0xc36e('0x2'));var BPromise=require(_0xc36e('0x3'));var rs=require(_0xc36e('0x4'));var fs=require('fs');var Redis=require(_0xc36e('0x5'));var db=require(_0xc36e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc36e('0x7'))(_0xc36e('0x8'));var config=require(_0xc36e('0x9'));var jayson=require(_0xc36e('0xa'));var client=jayson[_0xc36e('0xb')][_0xc36e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a57f8,_0x57c6f0,_0x58fb4c){return new BPromise(function(_0x61752a,_0x5dcd85){return client[_0xc36e('0xd')](_0x3a57f8,_0x58fb4c)[_0xc36e('0xe')](function(_0xa112e5){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x57c6f0,_0xc36e('0xf'));logger[_0xc36e('0x10')](_0xc36e('0x11'),_0x57c6f0,'request\x20sent',JSON[_0xc36e('0x12')](_0xa112e5));if(_0xa112e5[_0xc36e('0x13')]){if(_0xa112e5[_0xc36e('0x13')][_0xc36e('0x14')]===0x1f4){logger[_0xc36e('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57c6f0,_0xa112e5[_0xc36e('0x13')]['message']);return _0x5dcd85(_0xa112e5[_0xc36e('0x13')]['message']);}logger[_0xc36e('0x13')](_0xc36e('0x15'),_0x57c6f0,_0xa112e5['error'][_0xc36e('0x16')]);return _0x61752a(_0xa112e5[_0xc36e('0x13')][_0xc36e('0x16')]);}else{logger[_0xc36e('0x17')](_0xc36e('0x15'),_0x57c6f0,_0xc36e('0xf'));_0x61752a(_0xa112e5[_0xc36e('0x18')]['message']);}})['catch'](function(_0x18b4c4){logger[_0xc36e('0x13')](_0xc36e('0x15'),_0x57c6f0,_0x18b4c4);_0x5dcd85(_0x18b4c4);});});} \ No newline at end of file +var _0xc10e=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x26ccd0,_0x433234){var _0x115921=function(_0x19183e){while(--_0x19183e){_0x26ccd0['push'](_0x26ccd0['shift']());}};_0x115921(++_0x433234);}(_0xc10e,0xe5));var _0xec10=function(_0x262ff6,_0x158799){_0x262ff6=_0x262ff6-0x0;var _0x4c9b82=_0xc10e[_0x262ff6];return _0x4c9b82;};'use strict';var _=require(_0xec10('0x0'));var util=require(_0xec10('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec10('0x2'))['db'];var utils=require(_0xec10('0x3'));var logger=require(_0xec10('0x4'))(_0xec10('0x5'));var config=require('../../config/environment');var jayson=require(_0xec10('0x6'));var client=jayson[_0xec10('0x7')][_0xec10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bcf3b,_0xf33939,_0x45d102){return new BPromise(function(_0x25a2c4,_0x3f623b){return client[_0xec10('0x9')](_0x2bcf3b,_0x45d102)[_0xec10('0xa')](function(_0x1f8706){logger['info'](_0xec10('0xb'),_0xf33939,_0xec10('0xc'));logger[_0xec10('0xd')](_0xec10('0xe'),_0xf33939,_0xec10('0xc'),JSON[_0xec10('0xf')](_0x1f8706));if(_0x1f8706[_0xec10('0x10')]){if(_0x1f8706['error'][_0xec10('0x11')]===0x1f4){logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0x1f8706['error'][_0xec10('0x12')]);return _0x3f623b(_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);}logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);return _0x25a2c4(_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);}else{logger[_0xec10('0x13')](_0xec10('0xb'),_0xf33939,_0xec10('0xc'));_0x25a2c4(_0x1f8706[_0xec10('0x14')][_0xec10('0x12')]);}})[_0xec10('0x15')](function(_0xe5b808){logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0xe5b808);_0x3f623b(_0xe5b808);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index efd0df4..68d79dd 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf503=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4d5308,_0x268d72){var _0x56635a=function(_0xf2aa38){while(--_0xf2aa38){_0x4d5308['push'](_0x4d5308['shift']());}};_0x56635a(++_0x268d72);}(_0xf503,0x11a));var _0x3f50=function(_0xc5775d,_0x3701ab){_0xc5775d=_0xc5775d-0x0;var _0x3b4edd=_0xf503[_0xc5775d];return _0x3b4edd;};'use strict';var multer=require(_0x3f50('0x0'));var util=require(_0x3f50('0x1'));var path=require(_0x3f50('0x2'));var timeout=require(_0x3f50('0x3'));var express=require(_0x3f50('0x4'));var router=express[_0x3f50('0x5')]();var fs_extra=require(_0x3f50('0x6'));var auth=require(_0x3f50('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3f50('0x8'));var controller=require(_0x3f50('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3f50('0xa')](_0x3f50('0xb'),auth[_0x3f50('0xc')](),controller[_0x3f50('0xd')]);router[_0x3f50('0xa')](_0x3f50('0xe'),auth['isAuthenticated'](),controller[_0x3f50('0xf')]);router['get'](_0x3f50('0x10'),auth[_0x3f50('0xc')](),controller['run']);router[_0x3f50('0xa')](_0x3f50('0x11'),auth['isAuthenticated'](),controller[_0x3f50('0x12')]);router[_0x3f50('0x13')]('/',auth[_0x3f50('0xc')](),controller[_0x3f50('0x14')]);router[_0x3f50('0x15')](_0x3f50('0xb'),auth[_0x3f50('0xc')](),controller[_0x3f50('0x16')]);router[_0x3f50('0x17')]('/:id',auth[_0x3f50('0xc')](),controller[_0x3f50('0x18')]);module[_0x3f50('0x19')]=router; \ No newline at end of file +var _0xab1a=['preview','/:id/run','run','query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview'];(function(_0x575247,_0x31e54c){var _0x452fcc=function(_0x42a6b7){while(--_0x42a6b7){_0x575247['push'](_0x575247['shift']());}};_0x452fcc(++_0x31e54c);}(_0xab1a,0xf4));var _0xaab1=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xab1a[_0x2053ea];return _0x2232c4;};'use strict';var multer=require(_0xaab1('0x0'));var util=require(_0xaab1('0x1'));var path=require(_0xaab1('0x2'));var timeout=require(_0xaab1('0x3'));var express=require(_0xaab1('0x4'));var router=express[_0xaab1('0x5')]();var fs_extra=require(_0xaab1('0x6'));var auth=require(_0xaab1('0x7'));var interaction=require(_0xaab1('0x8'));var config=require(_0xaab1('0x9'));var controller=require(_0xaab1('0xa'));router[_0xaab1('0xb')]('/',auth['isAuthenticated'](),controller[_0xaab1('0xc')]);router[_0xaab1('0xb')](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller['show']);router['get'](_0xaab1('0xf'),auth['isAuthenticated'](),controller[_0xaab1('0x10')]);router[_0xaab1('0xb')](_0xaab1('0x11'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x12')]);router[_0xaab1('0xb')]('/:id/query',auth[_0xaab1('0xe')](),controller[_0xaab1('0x13')]);router[_0xaab1('0x14')]('/',auth[_0xaab1('0xe')](),controller[_0xaab1('0x15')]);router[_0xaab1('0x16')](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x17')]);router['delete'](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x18')]);module[_0xaab1('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e8b63ae..504b3f9 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46cf=['xlsx','DATE','Loading','scheduled','INTEGER','exports','STRING'];(function(_0x22ccff,_0x3b9a53){var _0x593172=function(_0x36a256){while(--_0x36a256){_0x22ccff['push'](_0x22ccff['shift']());}};_0x593172(++_0x3b9a53);}(_0x46cf,0x14e));var _0xf46c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x46cf[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf46c('0x0')]={'name':{'type':Sequelize[_0xf46c('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xf46c('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xf46c('0x2')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xf46c('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf46c('0x3')]},'endDate':{'type':Sequelize[_0xf46c('0x3')]},'status':{'type':Sequelize[_0xf46c('0x1')],'defaultValue':_0xf46c('0x4')},'type':{'type':Sequelize['ENUM']('manual',_0xf46c('0x5')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf46c('0x6')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf02=['DATE','Loading','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xaf02,0x17a));var _0x2af0=function(_0x51c426,_0x50ffe6){_0x51c426=_0x51c426-0x0;var _0x38e613=_0xaf02[_0x51c426];return _0x38e613;};'use strict';var Sequelize=require(_0x2af0('0x0'));var moment=require(_0x2af0('0x1'));module[_0x2af0('0x2')]={'name':{'type':Sequelize[_0x2af0('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2af0('0x4')](_0x2af0('0x5'),_0x2af0('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x2af0('0x5')},'savename':{'type':Sequelize[_0x2af0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x2af0('0x7')]},'status':{'type':Sequelize[_0x2af0('0x3')],'defaultValue':_0x2af0('0x8')},'type':{'type':Sequelize[_0x2af0('0x4')]('manual',_0x2af0('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2af0('0xa')]},'reportType':{'type':Sequelize[_0x2af0('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 889717a..6a526b2 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b4d=['where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','user','get','UserProfileSection','userProfileId','UserProfileResource','error','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','exists','format','%s.%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','ExtractedReports','name','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','order','sort'];(function(_0x5c93f4,_0x406fa1){var _0x4470a1=function(_0x3555fd){while(--_0x3555fd){_0x5c93f4['push'](_0x5c93f4['shift']());}};_0x4470a1(++_0x406fa1);}(_0x4b4d,0xd9));var _0xd4b4=function(_0x172d70,_0x29f71a){_0x172d70=_0x172d70-0x0;var _0x2741ca=_0x4b4d[_0x172d70];return _0x2741ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd4b4('0x0'));var zipdir=require(_0xd4b4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4b4('0x2'));var moment=require(_0xd4b4('0x3'));var BPromise=require(_0xd4b4('0x4'));var Mustache=require(_0xd4b4('0x5'));var util=require(_0xd4b4('0x6'));var path=require(_0xd4b4('0x7'));var sox=require(_0xd4b4('0x8'));var csv=require(_0xd4b4('0x9'));var ejs=require(_0xd4b4('0xa'));var fs=require('fs');var fs_extra=require(_0xd4b4('0xb'));var _=require(_0xd4b4('0xc'));var squel=require(_0xd4b4('0xd'));var crypto=require(_0xd4b4('0xe'));var jsforce=require(_0xd4b4('0xf'));var deskjs=require(_0xd4b4('0x10'));var toCsv=require(_0xd4b4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4b4('0x11'));var qs=require(_0xd4b4('0x12'));var as=require(_0xd4b4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4b4('0x14'))('api');var utils=require(_0xd4b4('0x15'));var config=require(_0xd4b4('0x16'));var licenseUtil=require(_0xd4b4('0x17'));var db=require(_0xd4b4('0x18'))['db'];function respondWithStatusCode(_0x4c247f,_0x1e40db){_0x1e40db=_0x1e40db||0xcc;return function(_0x193906){if(_0x193906){return _0x4c247f[_0xd4b4('0x19')](_0x1e40db);}return _0x4c247f[_0xd4b4('0x1a')](_0x1e40db)['end']();};}function respondWithResult(_0x324fe8,_0x1d4f32){_0x1d4f32=_0x1d4f32||0xc8;return function(_0x253497){if(_0x253497){return _0x324fe8[_0xd4b4('0x1a')](_0x1d4f32)[_0xd4b4('0x1b')](_0x253497);}};}function respondWithFilteredResult(_0x461f18,_0x72c131){return function(_0x365445){if(_0x365445){var _0x1d7b34=typeof _0x72c131[_0xd4b4('0x1c')]===_0xd4b4('0x1d')&&typeof _0x72c131[_0xd4b4('0x1e')]==='undefined';var _0x437b51=_0x365445[_0xd4b4('0x1f')];var _0x59f07c=_0x1d7b34?0x0:_0x72c131[_0xd4b4('0x1c')];var _0x2f0d6c=_0x1d7b34?_0x365445['count']:_0x72c131['offset']+_0x72c131[_0xd4b4('0x1e')];var _0xc26b4d;if(_0x2f0d6c>=_0x437b51){_0x2f0d6c=_0x437b51;_0xc26b4d=0xc8;}else{_0xc26b4d=0xce;}_0x461f18['status'](_0xc26b4d);return _0x461f18[_0xd4b4('0x20')]('Content-Range',_0x59f07c+'-'+_0x2f0d6c+'/'+_0x437b51)[_0xd4b4('0x1b')](_0x365445);}return null;};}function patchUpdates(_0x163ba5){return function(_0x14b996){try{jsonpatch[_0xd4b4('0x21')](_0x14b996,_0x163ba5,!![]);}catch(_0x103b0f){return BPromise[_0xd4b4('0x22')](_0x103b0f);}return _0x14b996[_0xd4b4('0x23')]();};}function saveUpdates(_0x20680e,_0x1ffb7a){return function(_0x26cbbe){if(_0x26cbbe){return _0x26cbbe[_0xd4b4('0x24')](_0x20680e)[_0xd4b4('0x25')](function(_0x35a73e){return _0x35a73e;});}return null;};}function removeEntity(_0x484902,_0x30dd39){return function(_0x221e5e){if(_0x221e5e){return _0x221e5e[_0xd4b4('0x26')]()['then'](function(){var _0xa69745=_0x221e5e['get']({'plain':!![]});var _0x5f59f6=_0xd4b4('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5f59f6,'resourceId':_0xa69745['id']}})[_0xd4b4('0x25')](function(){return _0x221e5e;});})[_0xd4b4('0x25')](function(){_0x484902[_0xd4b4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb3ffe,_0x170eed){return function(_0x3afaa0){if(!_0x3afaa0){_0xcb3ffe['sendStatus'](0x194);}return _0x3afaa0;};}function handleError(_0x28766a,_0x8120b3){_0x8120b3=_0x8120b3||0x1f4;return function(_0x23ee88){logger['error'](_0x23ee88['stack']);if(_0x23ee88[_0xd4b4('0x28')]){delete _0x23ee88['name'];}_0x28766a[_0xd4b4('0x1a')](_0x8120b3)['send'](_0x23ee88);};}exports[_0xd4b4('0x29')]=function(_0x53ab78,_0x35b983){var _0x48edf7={},_0x5cd713={},_0x5167eb={'count':0x0,'rows':[]};var _0x1e0e6f=_[_0xd4b4('0x2a')](db[_0xd4b4('0x2b')][_0xd4b4('0x2c')],function(_0x198347){return{'name':_0x198347['fieldName'],'type':_0x198347[_0xd4b4('0x2d')][_0xd4b4('0x2e')]};});_0x5cd713[_0xd4b4('0x2f')]=_['map'](_0x1e0e6f,'name');_0x5cd713[_0xd4b4('0x30')]=_[_0xd4b4('0x31')](_0x53ab78['query']);_0x5cd713[_0xd4b4('0x32')]=_['intersection'](_0x5cd713[_0xd4b4('0x2f')],_0x5cd713[_0xd4b4('0x30')]);_0x48edf7[_0xd4b4('0x33')]=_['intersection'](_0x5cd713['model'],qs[_0xd4b4('0x34')](_0x53ab78[_0xd4b4('0x30')]['fields']));_0x48edf7['attributes']=_0x48edf7[_0xd4b4('0x33')][_0xd4b4('0x35')]?_0x48edf7[_0xd4b4('0x33')]:_0x5cd713[_0xd4b4('0x2f')];if(!_0x53ab78['query']['hasOwnProperty']('nolimit')){_0x48edf7[_0xd4b4('0x1e')]=qs[_0xd4b4('0x1e')](_0x53ab78[_0xd4b4('0x30')][_0xd4b4('0x1e')]);_0x48edf7[_0xd4b4('0x1c')]=qs['offset'](_0x53ab78[_0xd4b4('0x30')]['offset']);}_0x48edf7[_0xd4b4('0x36')]=qs[_0xd4b4('0x37')](_0x53ab78[_0xd4b4('0x30')][_0xd4b4('0x37')]);_0x48edf7[_0xd4b4('0x38')]=qs[_0xd4b4('0x32')](_[_0xd4b4('0x39')](_0x53ab78[_0xd4b4('0x30')],_0x5cd713[_0xd4b4('0x32')]),_0x1e0e6f);if(_0x53ab78['query'][_0xd4b4('0x3a')]){_0x48edf7[_0xd4b4('0x38')]=_[_0xd4b4('0x3b')](_0x48edf7['where'],{'$or':_[_0xd4b4('0x2a')](_0x1e0e6f,function(_0x38d1b3){if(_0x38d1b3[_0xd4b4('0x2d')]!==_0xd4b4('0x3c')){var _0x3f1e3d={};_0x3f1e3d[_0x38d1b3[_0xd4b4('0x28')]]={'$like':'%'+_0x53ab78[_0xd4b4('0x30')]['filter']+'%'};return _0x3f1e3d;}})});}_0x48edf7=_[_0xd4b4('0x3b')]({},_0x48edf7,_0x53ab78[_0xd4b4('0x3d')]);var _0x4a4b95={'where':_0x48edf7[_0xd4b4('0x38')]};return db[_0xd4b4('0x2b')][_0xd4b4('0x1f')](_0x4a4b95)[_0xd4b4('0x25')](function(_0x2d5f3e){_0x5167eb[_0xd4b4('0x1f')]=_0x2d5f3e;if(_0x53ab78['query']['includeAll']){_0x48edf7[_0xd4b4('0x3e')]=[{'all':!![]}];}return db[_0xd4b4('0x2b')][_0xd4b4('0x3f')](_0x48edf7);})[_0xd4b4('0x25')](function(_0x2d2228){_0x5167eb[_0xd4b4('0x40')]=_0x2d2228;return _0x5167eb;})[_0xd4b4('0x25')](respondWithFilteredResult(_0x35b983,_0x48edf7))[_0xd4b4('0x41')](handleError(_0x35b983,null));};exports[_0xd4b4('0x42')]=function(_0x5e65bf,_0x41721b){var _0x2662ef={'raw':!![],'where':{'id':_0x5e65bf[_0xd4b4('0x43')]['id']}},_0x234faa={};_0x234faa[_0xd4b4('0x2f')]=_[_0xd4b4('0x31')](db[_0xd4b4('0x2b')]['rawAttributes']);_0x234faa[_0xd4b4('0x30')]=_[_0xd4b4('0x31')](_0x5e65bf['query']);_0x234faa[_0xd4b4('0x32')]=_[_0xd4b4('0x44')](_0x234faa['model'],_0x234faa['query']);_0x2662ef['attributes']=_[_0xd4b4('0x44')](_0x234faa[_0xd4b4('0x2f')],qs[_0xd4b4('0x34')](_0x5e65bf[_0xd4b4('0x30')][_0xd4b4('0x34')]));_0x2662ef['attributes']=_0x2662ef[_0xd4b4('0x33')][_0xd4b4('0x35')]?_0x2662ef[_0xd4b4('0x33')]:_0x234faa[_0xd4b4('0x2f')];if(_0x5e65bf[_0xd4b4('0x30')][_0xd4b4('0x45')]){_0x2662ef[_0xd4b4('0x3e')]=[{'all':!![]}];}_0x2662ef=_[_0xd4b4('0x3b')]({},_0x2662ef,_0x5e65bf[_0xd4b4('0x3d')]);return db[_0xd4b4('0x2b')][_0xd4b4('0x46')](_0x2662ef)[_0xd4b4('0x25')](handleEntityNotFound(_0x41721b,null))[_0xd4b4('0x25')](respondWithResult(_0x41721b,null))[_0xd4b4('0x41')](handleError(_0x41721b,null));};exports[_0xd4b4('0x47')]=function(_0x4e12d1,_0x38e19c){return db[_0xd4b4('0x2b')][_0xd4b4('0x47')](_0x4e12d1[_0xd4b4('0x48')],{})[_0xd4b4('0x25')](function(_0x122e8b){var _0x3720a9=_0x4e12d1[_0xd4b4('0x49')]['get']({'plain':!![]});if(!_0x3720a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3720a9['role']===_0xd4b4('0x49')){var _0x2a5ff1=_0x122e8b[_0xd4b4('0x4a')]({'plain':!![]});var _0x31f157=_0xd4b4('0x27');return db[_0xd4b4('0x4b')][_0xd4b4('0x46')]({'where':{'name':_0x31f157,'userProfileId':_0x3720a9[_0xd4b4('0x4c')]},'raw':!![]})[_0xd4b4('0x25')](function(_0x447c0d){if(_0x447c0d&&_0x447c0d['autoAssociation']===0x0){return db[_0xd4b4('0x4d')][_0xd4b4('0x47')]({'name':_0x2a5ff1[_0xd4b4('0x28')],'resourceId':_0x2a5ff1['id'],'type':_0x447c0d[_0xd4b4('0x28')],'sectionId':_0x447c0d['id']},{})[_0xd4b4('0x25')](function(){return _0x122e8b;});}else{return _0x122e8b;}})['catch'](function(_0x1bc5ad){logger[_0xd4b4('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bc5ad);throw _0x1bc5ad;});}return _0x122e8b;})[_0xd4b4('0x25')](respondWithResult(_0x38e19c,0xc9))[_0xd4b4('0x41')](handleError(_0x38e19c,null));};exports[_0xd4b4('0x24')]=function(_0x21d5a9,_0x4fe793){if(_0x21d5a9['body']['id']){delete _0x21d5a9[_0xd4b4('0x48')]['id'];}return db[_0xd4b4('0x2b')][_0xd4b4('0x46')]({'where':{'id':_0x21d5a9['params']['id']}})[_0xd4b4('0x25')](handleEntityNotFound(_0x4fe793,null))[_0xd4b4('0x25')](saveUpdates(_0x21d5a9['body'],null))[_0xd4b4('0x25')](respondWithResult(_0x4fe793,null))[_0xd4b4('0x41')](handleError(_0x4fe793,null));};exports[_0xd4b4('0x26')]=function(_0xb719fc,_0x5f49d7){return db[_0xd4b4('0x2b')][_0xd4b4('0x46')]({'where':{'id':_0xb719fc[_0xd4b4('0x43')]['id']}})[_0xd4b4('0x25')](handleEntityNotFound(_0x5f49d7,null))['then'](removeEntity(_0x5f49d7,null))[_0xd4b4('0x41')](handleError(_0x5f49d7,null));};exports[_0xd4b4('0x4f')]=function(_0x494f7f,_0x2ae440,_0x4995fa){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x494f7f[_0xd4b4('0x43')]['id']},'attributes':[_0xd4b4('0x28'),_0xd4b4('0x50'),_0xd4b4('0x51'),_0xd4b4('0x52')],'raw':!![]})[_0xd4b4('0x25')](handleEntityNotFound(_0x2ae440,null))['then'](function(_0x9a726d){if(_0x9a726d){if(!fs[_0xd4b4('0x53')](path[_0xd4b4('0x54')](config[_0xd4b4('0x55')],_0xd4b4('0x56'),_0x9a726d[_0xd4b4('0x51')]))){throw new db['Sequelize'][(_0xd4b4('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x494f7f[_0xd4b4('0x30')][_0xd4b4('0x58')]){return _0x2ae440[_0xd4b4('0x19')](0xc8);}return _0x2ae440[_0xd4b4('0x4f')](path['join'](config[_0xd4b4('0x55')],_0xd4b4('0x56'),_0x9a726d[_0xd4b4('0x51')]),util[_0xd4b4('0x59')](_0xd4b4('0x5a'),_0x9a726d[_0xd4b4('0x50')]||_0x9a726d['name'],_0x9a726d[_0xd4b4('0x52')]['toLowerCase']()));}})[_0xd4b4('0x41')](handleError(_0x2ae440,null));}; \ No newline at end of file +var _0x890e=['util','path','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','catch','params','keys','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','output','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x890e,0x1e3));var _0xe890=function(_0xfaef23,_0x5c62cb){_0xfaef23=_0xfaef23-0x0;var _0x27c2ed=_0x890e[_0xfaef23];return _0x27c2ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe890('0x0'));var zipdir=require(_0xe890('0x1'));var jsonpatch=require(_0xe890('0x2'));var rp=require(_0xe890('0x3'));var moment=require(_0xe890('0x4'));var BPromise=require(_0xe890('0x5'));var Mustache=require(_0xe890('0x6'));var util=require(_0xe890('0x7'));var path=require(_0xe890('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe890('0x9'));var fs=require('fs');var fs_extra=require(_0xe890('0xa'));var _=require('lodash');var squel=require(_0xe890('0xb'));var crypto=require(_0xe890('0xc'));var jsforce=require(_0xe890('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe890('0xe'));var Papa=require(_0xe890('0xf'));var Redis=require(_0xe890('0x10'));var authService=require(_0xe890('0x11'));var qs=require(_0xe890('0x12'));var as=require(_0xe890('0x13'));var hardwareService=require(_0xe890('0x14'));var logger=require(_0xe890('0x15'))(_0xe890('0x16'));var utils=require(_0xe890('0x17'));var config=require(_0xe890('0x18'));var licenseUtil=require(_0xe890('0x19'));var db=require(_0xe890('0x1a'))['db'];function respondWithStatusCode(_0x16df94,_0x18eccb){_0x18eccb=_0x18eccb||0xcc;return function(_0x4a7249){if(_0x4a7249){return _0x16df94[_0xe890('0x1b')](_0x18eccb);}return _0x16df94[_0xe890('0x1c')](_0x18eccb)[_0xe890('0x1d')]();};}function respondWithResult(_0x4dcdeb,_0xe8572b){_0xe8572b=_0xe8572b||0xc8;return function(_0x2c5ea8){if(_0x2c5ea8){return _0x4dcdeb[_0xe890('0x1c')](_0xe8572b)[_0xe890('0x1e')](_0x2c5ea8);}};}function respondWithFilteredResult(_0x2f01f0,_0x1d7e9d){return function(_0x1998e6){if(_0x1998e6){var _0x1c6563=typeof _0x1d7e9d[_0xe890('0x1f')]===_0xe890('0x20')&&typeof _0x1d7e9d[_0xe890('0x21')]==='undefined';var _0x17633d=_0x1998e6[_0xe890('0x22')];var _0x542470=_0x1c6563?0x0:_0x1d7e9d['offset'];var _0xf9f335=_0x1c6563?_0x1998e6[_0xe890('0x22')]:_0x1d7e9d[_0xe890('0x1f')]+_0x1d7e9d[_0xe890('0x21')];var _0x5cb490;if(_0xf9f335>=_0x17633d){_0xf9f335=_0x17633d;_0x5cb490=0xc8;}else{_0x5cb490=0xce;}_0x2f01f0[_0xe890('0x1c')](_0x5cb490);return _0x2f01f0[_0xe890('0x23')](_0xe890('0x24'),_0x542470+'-'+_0xf9f335+'/'+_0x17633d)[_0xe890('0x1e')](_0x1998e6);}return null;};}function patchUpdates(_0x188f29){return function(_0x94ac31){try{jsonpatch[_0xe890('0x25')](_0x94ac31,_0x188f29,!![]);}catch(_0x3e934c){return BPromise[_0xe890('0x26')](_0x3e934c);}return _0x94ac31[_0xe890('0x27')]();};}function saveUpdates(_0xcc8933,_0x47f108){return function(_0x321968){if(_0x321968){return _0x321968[_0xe890('0x28')](_0xcc8933)['then'](function(_0x2af7c0){return _0x2af7c0;});}return null;};}function removeEntity(_0x18f7c0,_0x2c0818){return function(_0x2fb825){if(_0x2fb825){return _0x2fb825[_0xe890('0x29')]()[_0xe890('0x2a')](function(){var _0x40af43=_0x2fb825[_0xe890('0x2b')]({'plain':!![]});var _0x16a093=_0xe890('0x2c');return db['UserProfileResource'][_0xe890('0x29')]({'where':{'type':_0x16a093,'resourceId':_0x40af43['id']}})[_0xe890('0x2a')](function(){return _0x2fb825;});})['then'](function(){_0x18f7c0[_0xe890('0x1c')](0xcc)[_0xe890('0x1d')]();});}};}function handleEntityNotFound(_0x44541b,_0x402396){return function(_0x593121){if(!_0x593121){_0x44541b[_0xe890('0x1b')](0x194);}return _0x593121;};}function handleError(_0x2c0b6f,_0x2277b8){_0x2277b8=_0x2277b8||0x1f4;return function(_0x1dcfd3){logger[_0xe890('0x2d')](_0x1dcfd3[_0xe890('0x2e')]);if(_0x1dcfd3[_0xe890('0x2f')]){delete _0x1dcfd3[_0xe890('0x2f')];}_0x2c0b6f[_0xe890('0x1c')](_0x2277b8)[_0xe890('0x30')](_0x1dcfd3);};}exports[_0xe890('0x31')]=function(_0x1a3400,_0x279dbf){var _0x540512={},_0x315994={},_0x1afe58={'count':0x0,'rows':[]};var _0x37c660=_['map'](db['AnalyticExtractedReport'][_0xe890('0x32')],function(_0x32369f){return{'name':_0x32369f['fieldName'],'type':_0x32369f[_0xe890('0x33')][_0xe890('0x34')]};});_0x315994[_0xe890('0x35')]=_[_0xe890('0x36')](_0x37c660,_0xe890('0x2f'));_0x315994[_0xe890('0x37')]=_['keys'](_0x1a3400['query']);_0x315994[_0xe890('0x38')]=_['intersection'](_0x315994['model'],_0x315994[_0xe890('0x37')]);_0x540512[_0xe890('0x39')]=_[_0xe890('0x3a')](_0x315994[_0xe890('0x35')],qs[_0xe890('0x3b')](_0x1a3400['query']['fields']));_0x540512[_0xe890('0x39')]=_0x540512['attributes']['length']?_0x540512[_0xe890('0x39')]:_0x315994[_0xe890('0x35')];if(!_0x1a3400[_0xe890('0x37')]['hasOwnProperty'](_0xe890('0x3c'))){_0x540512[_0xe890('0x21')]=qs[_0xe890('0x21')](_0x1a3400[_0xe890('0x37')][_0xe890('0x21')]);_0x540512[_0xe890('0x1f')]=qs[_0xe890('0x1f')](_0x1a3400[_0xe890('0x37')][_0xe890('0x1f')]);}_0x540512[_0xe890('0x3d')]=qs[_0xe890('0x3e')](_0x1a3400['query'][_0xe890('0x3e')]);_0x540512[_0xe890('0x3f')]=qs['filters'](_[_0xe890('0x40')](_0x1a3400[_0xe890('0x37')],_0x315994['filters']),_0x37c660);if(_0x1a3400[_0xe890('0x37')][_0xe890('0x41')]){_0x540512[_0xe890('0x3f')]=_['merge'](_0x540512['where'],{'$or':_[_0xe890('0x36')](_0x37c660,function(_0x435dd3){if(_0x435dd3['type']!==_0xe890('0x42')){var _0x487010={};_0x487010[_0x435dd3[_0xe890('0x2f')]]={'$like':'%'+_0x1a3400[_0xe890('0x37')][_0xe890('0x41')]+'%'};return _0x487010;}})});}_0x540512=_['merge']({},_0x540512,_0x1a3400['options']);var _0x2acbc2={'where':_0x540512[_0xe890('0x3f')]};return db[_0xe890('0x43')]['count'](_0x2acbc2)[_0xe890('0x2a')](function(_0x12a2f1){_0x1afe58[_0xe890('0x22')]=_0x12a2f1;if(_0x1a3400[_0xe890('0x37')][_0xe890('0x44')]){_0x540512[_0xe890('0x45')]=[{'all':!![]}];}return db[_0xe890('0x43')][_0xe890('0x46')](_0x540512);})['then'](function(_0x3e33ae){_0x1afe58['rows']=_0x3e33ae;return _0x1afe58;})[_0xe890('0x2a')](respondWithFilteredResult(_0x279dbf,_0x540512))[_0xe890('0x47')](handleError(_0x279dbf,null));};exports['show']=function(_0x3939ff,_0x472e78){var _0x4743fb={'raw':!![],'where':{'id':_0x3939ff[_0xe890('0x48')]['id']}},_0x3e04c9={};_0x3e04c9[_0xe890('0x35')]=_[_0xe890('0x49')](db[_0xe890('0x43')]['rawAttributes']);_0x3e04c9[_0xe890('0x37')]=_[_0xe890('0x49')](_0x3939ff['query']);_0x3e04c9[_0xe890('0x38')]=_[_0xe890('0x3a')](_0x3e04c9[_0xe890('0x35')],_0x3e04c9[_0xe890('0x37')]);_0x4743fb[_0xe890('0x39')]=_[_0xe890('0x3a')](_0x3e04c9[_0xe890('0x35')],qs[_0xe890('0x3b')](_0x3939ff[_0xe890('0x37')][_0xe890('0x3b')]));_0x4743fb[_0xe890('0x39')]=_0x4743fb[_0xe890('0x39')]['length']?_0x4743fb['attributes']:_0x3e04c9[_0xe890('0x35')];if(_0x3939ff['query'][_0xe890('0x44')]){_0x4743fb['include']=[{'all':!![]}];}_0x4743fb=_[_0xe890('0x4a')]({},_0x4743fb,_0x3939ff[_0xe890('0x4b')]);return db[_0xe890('0x43')][_0xe890('0x4c')](_0x4743fb)[_0xe890('0x2a')](handleEntityNotFound(_0x472e78,null))['then'](respondWithResult(_0x472e78,null))['catch'](handleError(_0x472e78,null));};exports[_0xe890('0x4d')]=function(_0x4ac1c4,_0x179df4){return db['AnalyticExtractedReport'][_0xe890('0x4d')](_0x4ac1c4['body'],{})['then'](function(_0x58a7be){var _0x2d9b79=_0x4ac1c4[_0xe890('0x4e')][_0xe890('0x2b')]({'plain':!![]});if(!_0x2d9b79)throw new Error(_0xe890('0x4f'));if(_0x2d9b79['role']===_0xe890('0x4e')){var _0x5f1a4f=_0x58a7be[_0xe890('0x2b')]({'plain':!![]});var _0x2bd4d3=_0xe890('0x2c');return db[_0xe890('0x50')][_0xe890('0x4c')]({'where':{'name':_0x2bd4d3,'userProfileId':_0x2d9b79[_0xe890('0x51')]},'raw':!![]})[_0xe890('0x2a')](function(_0x485fd0){if(_0x485fd0&&_0x485fd0[_0xe890('0x52')]===0x0){return db['UserProfileResource'][_0xe890('0x4d')]({'name':_0x5f1a4f[_0xe890('0x2f')],'resourceId':_0x5f1a4f['id'],'type':_0x485fd0[_0xe890('0x2f')],'sectionId':_0x485fd0['id']},{})[_0xe890('0x2a')](function(){return _0x58a7be;});}else{return _0x58a7be;}})[_0xe890('0x47')](function(_0x14cac9){logger[_0xe890('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14cac9);throw _0x14cac9;});}return _0x58a7be;})['then'](respondWithResult(_0x179df4,0xc9))['catch'](handleError(_0x179df4,null));};exports[_0xe890('0x28')]=function(_0x2bda1f,_0xea61cd){if(_0x2bda1f[_0xe890('0x53')]['id']){delete _0x2bda1f[_0xe890('0x53')]['id'];}return db['AnalyticExtractedReport'][_0xe890('0x4c')]({'where':{'id':_0x2bda1f[_0xe890('0x48')]['id']}})[_0xe890('0x2a')](handleEntityNotFound(_0xea61cd,null))[_0xe890('0x2a')](saveUpdates(_0x2bda1f['body'],null))[_0xe890('0x2a')](respondWithResult(_0xea61cd,null))[_0xe890('0x47')](handleError(_0xea61cd,null));};exports[_0xe890('0x29')]=function(_0x2c5aad,_0x1d53d6){return db[_0xe890('0x43')]['find']({'where':{'id':_0x2c5aad[_0xe890('0x48')]['id']}})[_0xe890('0x2a')](handleEntityNotFound(_0x1d53d6,null))['then'](removeEntity(_0x1d53d6,null))[_0xe890('0x47')](handleError(_0x1d53d6,null));};exports[_0xe890('0x54')]=function(_0x4bdeef,_0x1fa98c,_0x29ac62){return db[_0xe890('0x43')][_0xe890('0x4c')]({'where':{'id':_0x4bdeef[_0xe890('0x48')]['id']},'attributes':[_0xe890('0x2f'),_0xe890('0x55'),_0xe890('0x56'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1fa98c,null))[_0xe890('0x2a')](function(_0x3be125){if(_0x3be125){if(!fs[_0xe890('0x57')](path[_0xe890('0x58')](config[_0xe890('0x59')],_0xe890('0x5a'),_0x3be125[_0xe890('0x56')]))){throw new db[(_0xe890('0x5b'))][(_0xe890('0x5c'))](_0xe890('0x5d'));}if(_0x4bdeef[_0xe890('0x37')][_0xe890('0x5e')]){return _0x1fa98c[_0xe890('0x1b')](0xc8);}return _0x1fa98c[_0xe890('0x54')](path['join'](config['root'],_0xe890('0x5a'),_0x3be125[_0xe890('0x56')]),util[_0xe890('0x5f')]('%s.%s',_0x3be125[_0xe890('0x55')]||_0x3be125[_0xe890('0x2f')],_0x3be125[_0xe890('0x60')][_0xe890('0x61')]()));}})['catch'](handleError(_0x1fa98c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index d35e8a6..6a665a3 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x163b=['rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x163b,0x16d));var _0xb163=function(_0x3f4ac8,_0x57a8fe){_0x3f4ac8=_0x3f4ac8-0x0;var _0x48cc0e=_0x163b[_0x3f4ac8];return _0x48cc0e;};'use strict';var _=require(_0xb163('0x0'));var util=require('util');var logger=require(_0xb163('0x1'))(_0xb163('0x2'));var moment=require('moment');var BPromise=require(_0xb163('0x3'));var rp=require(_0xb163('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb163('0x5'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xb163('0x6')]=function(_0x2210b2,_0x17e668){return _0x2210b2[_0xb163('0x7')](_0xb163('0x8'),attributes,{'tableName':_0xb163('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65dc=['lodash','util','api','moment','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x65dc,0xfa));var _0xc65d=function(_0x4f57e4,_0x18914d){_0x4f57e4=_0x4f57e4-0x0;var _0x4a584c=_0x65dc[_0x4f57e4];return _0x4a584c;};'use strict';var _=require(_0xc65d('0x0'));var util=require(_0xc65d('0x1'));var logger=require('../../config/logger')(_0xc65d('0x2'));var moment=require(_0xc65d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc65d('0x4'));var rimraf=require(_0xc65d('0x5'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xc65d('0x6')]=function(_0x1beb06,_0x1c6d6b){return _0x1beb06[_0xc65d('0x7')](_0xc65d('0x8'),attributes,{'tableName':_0xc65d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 2a68370..a3d1e26 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d25=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x21c69c,_0x1b7535){var _0x2acd03=function(_0x4c70f0){while(--_0x4c70f0){_0x21c69c['push'](_0x21c69c['shift']());}};_0x2acd03(++_0x1b7535);}(_0x7d25,0x8a));var _0x57d2=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x7d25[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});} \ No newline at end of file +var _0x8bd2=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x26bd8e,_0x2a9fdf){var _0x3a659d=function(_0x1b82cd){while(--_0x1b82cd){_0x26bd8e['push'](_0x26bd8e['shift']());}};_0x3a659d(++_0x2a9fdf);}(_0x8bd2,0x1d3));var _0x28bd=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x8bd2[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require('lodash');var util=require(_0x28bd('0x0'));var moment=require(_0x28bd('0x1'));var BPromise=require(_0x28bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28bd('0x3'));var db=require(_0x28bd('0x4'))['db'];var utils=require(_0x28bd('0x5'));var logger=require(_0x28bd('0x6'))(_0x28bd('0x7'));var config=require(_0x28bd('0x8'));var jayson=require(_0x28bd('0x9'));var client=jayson['client'][_0x28bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeb39f1,_0x47399c,_0x4eae0f){return new BPromise(function(_0x3f244f,_0x4ebb56){return client[_0x28bd('0xb')](_0xeb39f1,_0x4eae0f)[_0x28bd('0xc')](function(_0x520b94){logger[_0x28bd('0xd')](_0x28bd('0xe'),_0x47399c,_0x28bd('0xf'));logger['debug'](_0x28bd('0x10'),_0x47399c,_0x28bd('0xf'),JSON[_0x28bd('0x11')](_0x520b94));if(_0x520b94[_0x28bd('0x12')]){if(_0x520b94['error']['code']===0x1f4){logger['error'](_0x28bd('0xe'),_0x47399c,_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);return _0x4ebb56(_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);}logger[_0x28bd('0x12')](_0x28bd('0xe'),_0x47399c,_0x520b94[_0x28bd('0x12')]['message']);return _0x3f244f(_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);}else{logger[_0x28bd('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47399c,'request\x20sent');_0x3f244f(_0x520b94[_0x28bd('0x14')][_0x28bd('0x13')]);}})[_0x28bd('0x15')](function(_0xfb1d07){logger[_0x28bd('0x12')](_0x28bd('0xe'),_0x47399c,_0xfb1d07);_0x4ebb56(_0xfb1d07);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index a3e617d..765fbff 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6399=['create','update','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','get','download','post'];(function(_0x57b4f2,_0x582a17){var _0x421370=function(_0x4c7c7c){while(--_0x4c7c7c){_0x57b4f2['push'](_0x57b4f2['shift']());}};_0x421370(++_0x582a17);}(_0x6399,0x189));var _0x9639=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6399[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9639('0x0'));var express=require(_0x9639('0x1'));var router=express[_0x9639('0x2')]();var fs_extra=require(_0x9639('0x3'));var auth=require(_0x9639('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9639('0x5'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x9639('0x6')](),controller[_0x9639('0x7')]);router['get'](_0x9639('0x8'),auth[_0x9639('0x6')](),controller['show']);router[_0x9639('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x9639('0xa')]);router[_0x9639('0xb')]('/',auth[_0x9639('0x6')](),controller[_0x9639('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9639('0xd')]);router[_0x9639('0xe')](_0x9639('0x8'),auth[_0x9639('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x00b2=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00b2,0x64));var _0x200b=function(_0x66afb6,_0x56a8c7){_0x66afb6=_0x66afb6-0x0;var _0x122bc3=_0x00b2[_0x66afb6];return _0x122bc3;};'use strict';var multer=require('multer');var util=require(_0x200b('0x0'));var path=require(_0x200b('0x1'));var timeout=require(_0x200b('0x2'));var express=require(_0x200b('0x3'));var router=express[_0x200b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x200b('0x5'));var interaction=require(_0x200b('0x6'));var config=require(_0x200b('0x7'));var controller=require(_0x200b('0x8'));router[_0x200b('0x9')]('/',auth[_0x200b('0xa')](),controller['index']);router['get'](_0x200b('0xb'),auth[_0x200b('0xa')](),controller['show']);router['get'](_0x200b('0xc'),auth[_0x200b('0xa')](),controller['download']);router[_0x200b('0xd')]('/',auth[_0x200b('0xa')](),controller[_0x200b('0xe')]);router[_0x200b('0xf')](_0x200b('0xb'),auth[_0x200b('0xa')](),controller[_0x200b('0x10')]);router[_0x200b('0x11')](_0x200b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x200b('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 09e1b02..9be27b6 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0860=['STRING','BOOLEAN','sequelize'];(function(_0x46c6b7,_0x48f8bb){var _0x561506=function(_0x46450a){while(--_0x46450a){_0x46c6b7['push'](_0x46c6b7['shift']());}};_0x561506(++_0x48f8bb);}(_0x0860,0x15b));var _0x0086=function(_0x156da8,_0x4be248){_0x156da8=_0x156da8-0x0;var _0xa96a29=_0x0860[_0x156da8];return _0xa96a29;};'use strict';var Sequelize=require(_0x0086('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0086('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x0086('0x1')]},'groupBy':{'type':Sequelize[_0x0086('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0086('0x1')]},'custom':{'type':Sequelize[_0x0086('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c38=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x122805,_0x226082){var _0xce7e6b=function(_0x2be392){while(--_0x2be392){_0x122805['push'](_0x122805['shift']());}};_0xce7e6b(++_0x226082);}(_0x3c38,0x1ca));var _0x83c3=function(_0x4cae4a,_0x25396a){_0x4cae4a=_0x4cae4a-0x0;var _0x5c7e62=_0x3c38[_0x4cae4a];return _0x5c7e62;};'use strict';var Sequelize=require(_0x83c3('0x0'));module['exports']={'field':{'type':Sequelize[_0x83c3('0x1')]},'alias':{'type':Sequelize[_0x83c3('0x2')]},'function':{'type':Sequelize[_0x83c3('0x2')]},'format':{'type':Sequelize[_0x83c3('0x2')]},'groupBy':{'type':Sequelize[_0x83c3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x83c3('0x2')]},'custom':{'type':Sequelize[_0x83c3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 3afaaba..473038a 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0962=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','update','then','destroy','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2ba3ee,_0x34a4a1){var _0x572417=function(_0x41bf37){while(--_0x41bf37){_0x2ba3ee['push'](_0x2ba3ee['shift']());}};_0x572417(++_0x34a4a1);}(_0x0962,0x1d1));var _0x2096=function(_0x2c30c5,_0x59d67f){_0x2c30c5=_0x2c30c5-0x0;var _0x42bd4b=_0x0962[_0x2c30c5];return _0x42bd4b;};'use strict';var emlformat=require(_0x2096('0x0'));var rimraf=require(_0x2096('0x1'));var zipdir=require(_0x2096('0x2'));var jsonpatch=require(_0x2096('0x3'));var rp=require(_0x2096('0x4'));var moment=require(_0x2096('0x5'));var BPromise=require(_0x2096('0x6'));var Mustache=require(_0x2096('0x7'));var util=require(_0x2096('0x8'));var path=require(_0x2096('0x9'));var sox=require(_0x2096('0xa'));var csv=require(_0x2096('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2096('0xc'));var _=require('lodash');var squel=require(_0x2096('0xd'));var crypto=require(_0x2096('0xe'));var jsforce=require(_0x2096('0xf'));var deskjs=require(_0x2096('0x10'));var toCsv=require(_0x2096('0xb'));var querystring=require('querystring');var Papa=require(_0x2096('0x11'));var Redis=require(_0x2096('0x12'));var authService=require(_0x2096('0x13'));var qs=require(_0x2096('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2096('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2096('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2096('0x17'))['db'];function respondWithStatusCode(_0x3aac0f,_0x4daf53){_0x4daf53=_0x4daf53||0xcc;return function(_0x3fd69e){if(_0x3fd69e){return _0x3aac0f[_0x2096('0x18')](_0x4daf53);}return _0x3aac0f['status'](_0x4daf53)[_0x2096('0x19')]();};}function respondWithResult(_0x405698,_0x293fe7){_0x293fe7=_0x293fe7||0xc8;return function(_0x528575){if(_0x528575){return _0x405698[_0x2096('0x1a')](_0x293fe7)[_0x2096('0x1b')](_0x528575);}};}function respondWithFilteredResult(_0x1a5568,_0x1c38ab){return function(_0x3f3806){if(_0x3f3806){var _0x462885=typeof _0x1c38ab['offset']===_0x2096('0x1c')&&typeof _0x1c38ab['limit']===_0x2096('0x1c');var _0x5e9f01=_0x3f3806[_0x2096('0x1d')];var _0x4a9b85=_0x462885?0x0:_0x1c38ab['offset'];var _0x1f6f7f=_0x462885?_0x3f3806[_0x2096('0x1d')]:_0x1c38ab[_0x2096('0x1e')]+_0x1c38ab[_0x2096('0x1f')];var _0x23a76b;if(_0x1f6f7f>=_0x5e9f01){_0x1f6f7f=_0x5e9f01;_0x23a76b=0xc8;}else{_0x23a76b=0xce;}_0x1a5568['status'](_0x23a76b);return _0x1a5568['set']('Content-Range',_0x4a9b85+'-'+_0x1f6f7f+'/'+_0x5e9f01)[_0x2096('0x1b')](_0x3f3806);}return null;};}function patchUpdates(_0x217db2){return function(_0x168ead){try{jsonpatch[_0x2096('0x20')](_0x168ead,_0x217db2,!![]);}catch(_0x3014a4){return BPromise[_0x2096('0x21')](_0x3014a4);}return _0x168ead['save']();};}function saveUpdates(_0x413a66,_0x55c8db){return function(_0x1c6c41){if(_0x1c6c41){return _0x1c6c41[_0x2096('0x22')](_0x413a66)[_0x2096('0x23')](function(_0x17df46){return _0x17df46;});}return null;};}function removeEntity(_0x50ab17,_0x5ca4a6){return function(_0x162e7e){if(_0x162e7e){return _0x162e7e[_0x2096('0x24')]()['then'](function(){_0x50ab17[_0x2096('0x1a')](0xcc)[_0x2096('0x19')]();});}};}function handleEntityNotFound(_0x43ce2c,_0x1e97bd){return function(_0x2a5260){if(!_0x2a5260){_0x43ce2c[_0x2096('0x18')](0x194);}return _0x2a5260;};}function handleError(_0x4d1570,_0x16829c){_0x16829c=_0x16829c||0x1f4;return function(_0x36cbf8){logger['error'](_0x36cbf8['stack']);if(_0x36cbf8[_0x2096('0x25')]){delete _0x36cbf8[_0x2096('0x25')];}_0x4d1570[_0x2096('0x1a')](_0x16829c)[_0x2096('0x26')](_0x36cbf8);};}exports[_0x2096('0x27')]=function(_0x148fae,_0x3b5c03){var _0x13b84d={},_0x395645={},_0x2fde9b={'count':0x0,'rows':[]};var _0x308979=_[_0x2096('0x28')](db[_0x2096('0x29')][_0x2096('0x2a')],function(_0x5beffc){return{'name':_0x5beffc[_0x2096('0x2b')],'type':_0x5beffc[_0x2096('0x2c')][_0x2096('0x2d')]};});_0x395645['model']=_[_0x2096('0x28')](_0x308979,'name');_0x395645[_0x2096('0x2e')]=_[_0x2096('0x2f')](_0x148fae[_0x2096('0x2e')]);_0x395645['filters']=_[_0x2096('0x30')](_0x395645[_0x2096('0x31')],_0x395645[_0x2096('0x2e')]);_0x13b84d['attributes']=_[_0x2096('0x30')](_0x395645[_0x2096('0x31')],qs[_0x2096('0x32')](_0x148fae['query'][_0x2096('0x32')]));_0x13b84d[_0x2096('0x33')]=_0x13b84d[_0x2096('0x33')][_0x2096('0x34')]?_0x13b84d[_0x2096('0x33')]:_0x395645[_0x2096('0x31')];if(!_0x148fae[_0x2096('0x2e')]['hasOwnProperty'](_0x2096('0x35'))){_0x13b84d[_0x2096('0x1f')]=qs[_0x2096('0x1f')](_0x148fae[_0x2096('0x2e')][_0x2096('0x1f')]);_0x13b84d[_0x2096('0x1e')]=qs[_0x2096('0x1e')](_0x148fae[_0x2096('0x2e')][_0x2096('0x1e')]);}_0x13b84d[_0x2096('0x36')]=qs[_0x2096('0x37')](_0x148fae[_0x2096('0x2e')]['sort']);_0x13b84d[_0x2096('0x38')]=qs[_0x2096('0x39')](_[_0x2096('0x3a')](_0x148fae['query'],_0x395645[_0x2096('0x39')]),_0x308979);if(_0x148fae[_0x2096('0x2e')][_0x2096('0x3b')]){_0x13b84d[_0x2096('0x38')]=_['merge'](_0x13b84d[_0x2096('0x38')],{'$or':_[_0x2096('0x28')](_0x308979,function(_0x24e852){if(_0x24e852[_0x2096('0x2c')]!==_0x2096('0x3c')){var _0x7279bf={};_0x7279bf[_0x24e852[_0x2096('0x25')]]={'$like':'%'+_0x148fae[_0x2096('0x2e')][_0x2096('0x3b')]+'%'};return _0x7279bf;}})});}_0x13b84d=_[_0x2096('0x3d')]({},_0x13b84d,_0x148fae[_0x2096('0x3e')]);var _0x40dee4={'where':_0x13b84d[_0x2096('0x38')]};return db[_0x2096('0x29')][_0x2096('0x1d')](_0x40dee4)[_0x2096('0x23')](function(_0x54f9cd){_0x2fde9b[_0x2096('0x1d')]=_0x54f9cd;if(_0x148fae[_0x2096('0x2e')]['includeAll']){_0x13b84d[_0x2096('0x3f')]=[{'all':!![]}];}return db[_0x2096('0x29')][_0x2096('0x40')](_0x13b84d);})[_0x2096('0x23')](function(_0x29e700){_0x2fde9b['rows']=_0x29e700;return _0x2fde9b;})[_0x2096('0x23')](respondWithFilteredResult(_0x3b5c03,_0x13b84d))[_0x2096('0x41')](handleError(_0x3b5c03,null));};exports[_0x2096('0x42')]=function(_0x3d2160,_0x3319e6){var _0x4c892d={'raw':![],'where':{'id':_0x3d2160[_0x2096('0x43')]['id']}},_0x431412={};_0x431412[_0x2096('0x31')]=_[_0x2096('0x2f')](db[_0x2096('0x29')][_0x2096('0x2a')]);_0x431412[_0x2096('0x2e')]=_[_0x2096('0x2f')](_0x3d2160[_0x2096('0x2e')]);_0x431412[_0x2096('0x39')]=_['intersection'](_0x431412['model'],_0x431412[_0x2096('0x2e')]);_0x4c892d[_0x2096('0x33')]=_[_0x2096('0x30')](_0x431412[_0x2096('0x31')],qs[_0x2096('0x32')](_0x3d2160[_0x2096('0x2e')]['fields']));_0x4c892d['attributes']=_0x4c892d['attributes']['length']?_0x4c892d[_0x2096('0x33')]:_0x431412[_0x2096('0x31')];if(_0x3d2160[_0x2096('0x2e')][_0x2096('0x44')]){_0x4c892d[_0x2096('0x3f')]=[{'all':!![]}];}_0x4c892d=_['merge']({},_0x4c892d,_0x3d2160[_0x2096('0x3e')]);return db['AnalyticFieldReport'][_0x2096('0x45')](_0x4c892d)[_0x2096('0x23')](handleEntityNotFound(_0x3319e6,null))[_0x2096('0x23')](respondWithResult(_0x3319e6,null))[_0x2096('0x41')](handleError(_0x3319e6,null));};exports[_0x2096('0x46')]=function(_0xa0a0e,_0x4f3863){return db[_0x2096('0x29')][_0x2096('0x46')](_0xa0a0e[_0x2096('0x47')],{})[_0x2096('0x23')](respondWithResult(_0x4f3863,0xc9))[_0x2096('0x41')](handleError(_0x4f3863,null));};exports[_0x2096('0x48')]=function(_0x5657e0,_0x55acf3){return db[_0x2096('0x29')][_0x2096('0x48')](_0x5657e0[_0x2096('0x47')],{'raw':![],'individualHooks':!![]})[_0x2096('0x23')](respondWithResult(_0x55acf3,0xc9))[_0x2096('0x41')](handleError(_0x55acf3,null));};exports[_0x2096('0x22')]=function(_0x9fbd3f,_0xc84c32){if(_0x9fbd3f[_0x2096('0x47')]['id']){delete _0x9fbd3f[_0x2096('0x47')]['id'];}return db['AnalyticFieldReport'][_0x2096('0x45')]({'where':{'id':_0x9fbd3f['params']['id']}})[_0x2096('0x23')](handleEntityNotFound(_0xc84c32,null))[_0x2096('0x23')](saveUpdates(_0x9fbd3f['body'],null))[_0x2096('0x23')](respondWithResult(_0xc84c32,null))['catch'](handleError(_0xc84c32,null));};exports[_0x2096('0x24')]=function(_0x2c6dfb,_0x5d5f66){return db[_0x2096('0x29')][_0x2096('0x45')]({'where':{'id':_0x2c6dfb['params']['id']}})[_0x2096('0x23')](handleEntityNotFound(_0x5d5f66,null))[_0x2096('0x23')](removeEntity(_0x5d5f66,null))['catch'](handleError(_0x5d5f66,null));};exports[_0x2096('0x49')]=function(_0x2d3b88,_0x52e963){return db[_0x2096('0x29')][_0x2096('0x24')]({'where':{'id':_0x2d3b88[_0x2096('0x2e')][_0x2096('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x2096('0x23')](respondWithResult(_0x52e963,0xcc))[_0x2096('0x41')](handleError(_0x52e963,null));};exports['addFields']=function(_0xa4317e,_0x20b062,_0x2a4098){return db[_0x2096('0x4b')][_0x2096('0x4c')]({'where':{'id':_0xa4317e[_0x2096('0x43')]['id']}})['then'](handleEntityNotFound(_0x20b062,null))['then'](function(_0x57279b){if(_0x57279b){return db['sequelize'][_0x2096('0x4d')](function(_0x4482b8){return db[_0x2096('0x29')][_0x2096('0x24')]({'where':{'CustomReportId':_0xa4317e['params']['id']},'transaction':_0x4482b8})[_0x2096('0x23')](function(_0x1c8a3c){var _0x12274f=_[_0x2096('0x28')](_0xa4317e[_0x2096('0x47')],function(_0x5dbdea){delete _0x5dbdea['id'];_0x5dbdea[_0x2096('0x4e')]=_0xa4317e['params']['id'];return _0x5dbdea;});return db['AnalyticFieldReport'][_0x2096('0x48')](_0x12274f,{'transaction':_0x4482b8});});})[_0x2096('0x23')](function(){return db[_0x2096('0x29')][_0x2096('0x40')]({'where':{'CustomReportId':_0xa4317e['params']['id']}});});}})[_0x2096('0x23')](respondWithResult(_0x20b062,null))[_0x2096('0x41')](handleError(_0x20b062,null));}; \ No newline at end of file +var _0x5c7c=['util','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','params','rawAttributes','length','includeAll','include','create','body','catch','bulkCreate','find','destroy','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x146214,_0x13482f){var _0x2c2acb=function(_0xb0ad23){while(--_0xb0ad23){_0x146214['push'](_0x146214['shift']());}};_0x2c2acb(++_0x13482f);}(_0x5c7c,0xfe));var _0xc5c7=function(_0x22c13b,_0x26a0a0){_0x22c13b=_0x22c13b-0x0;var _0x3894c1=_0x5c7c[_0x22c13b];return _0x3894c1;};'use strict';var emlformat=require(_0xc5c7('0x0'));var rimraf=require(_0xc5c7('0x1'));var zipdir=require(_0xc5c7('0x2'));var jsonpatch=require(_0xc5c7('0x3'));var rp=require(_0xc5c7('0x4'));var moment=require(_0xc5c7('0x5'));var BPromise=require(_0xc5c7('0x6'));var Mustache=require('mustache');var util=require(_0xc5c7('0x7'));var path=require('path');var sox=require(_0xc5c7('0x8'));var csv=require(_0xc5c7('0x9'));var ejs=require(_0xc5c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc5c7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc5c7('0xc'));var jsforce=require(_0xc5c7('0xd'));var deskjs=require(_0xc5c7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c7('0xf'));var Papa=require('papaparse');var Redis=require(_0xc5c7('0x10'));var authService=require(_0xc5c7('0x11'));var qs=require(_0xc5c7('0x12'));var as=require(_0xc5c7('0x13'));var hardwareService=require(_0xc5c7('0x14'));var logger=require(_0xc5c7('0x15'))(_0xc5c7('0x16'));var utils=require(_0xc5c7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5c7('0x18'));var db=require(_0xc5c7('0x19'))['db'];function respondWithStatusCode(_0x43ebd0,_0x3d96f2){_0x3d96f2=_0x3d96f2||0xcc;return function(_0x479bb9){if(_0x479bb9){return _0x43ebd0[_0xc5c7('0x1a')](_0x3d96f2);}return _0x43ebd0[_0xc5c7('0x1b')](_0x3d96f2)[_0xc5c7('0x1c')]();};}function respondWithResult(_0x240543,_0x50ddf1){_0x50ddf1=_0x50ddf1||0xc8;return function(_0x342e93){if(_0x342e93){return _0x240543['status'](_0x50ddf1)[_0xc5c7('0x1d')](_0x342e93);}};}function respondWithFilteredResult(_0x130c49,_0x4bbc89){return function(_0x4ae0f2){if(_0x4ae0f2){var _0x486360=typeof _0x4bbc89['offset']===_0xc5c7('0x1e')&&typeof _0x4bbc89[_0xc5c7('0x1f')]===_0xc5c7('0x1e');var _0x517870=_0x4ae0f2[_0xc5c7('0x20')];var _0x4d0053=_0x486360?0x0:_0x4bbc89[_0xc5c7('0x21')];var _0xf440f5=_0x486360?_0x4ae0f2[_0xc5c7('0x20')]:_0x4bbc89['offset']+_0x4bbc89[_0xc5c7('0x1f')];var _0x449f0e;if(_0xf440f5>=_0x517870){_0xf440f5=_0x517870;_0x449f0e=0xc8;}else{_0x449f0e=0xce;}_0x130c49[_0xc5c7('0x1b')](_0x449f0e);return _0x130c49[_0xc5c7('0x22')](_0xc5c7('0x23'),_0x4d0053+'-'+_0xf440f5+'/'+_0x517870)['json'](_0x4ae0f2);}return null;};}function patchUpdates(_0x23f128){return function(_0x5cac87){try{jsonpatch[_0xc5c7('0x24')](_0x5cac87,_0x23f128,!![]);}catch(_0x59a374){return BPromise[_0xc5c7('0x25')](_0x59a374);}return _0x5cac87[_0xc5c7('0x26')]();};}function saveUpdates(_0x1387ea,_0x4defdd){return function(_0x375504){if(_0x375504){return _0x375504[_0xc5c7('0x27')](_0x1387ea)['then'](function(_0x3d780b){return _0x3d780b;});}return null;};}function removeEntity(_0x119818,_0x17cbf3){return function(_0x26d210){if(_0x26d210){return _0x26d210['destroy']()[_0xc5c7('0x28')](function(){_0x119818['status'](0xcc)[_0xc5c7('0x1c')]();});}};}function handleEntityNotFound(_0x3eca4e,_0x402ed3){return function(_0x4f8699){if(!_0x4f8699){_0x3eca4e[_0xc5c7('0x1a')](0x194);}return _0x4f8699;};}function handleError(_0x36abda,_0x151fa2){_0x151fa2=_0x151fa2||0x1f4;return function(_0x4521cc){logger[_0xc5c7('0x29')](_0x4521cc[_0xc5c7('0x2a')]);if(_0x4521cc[_0xc5c7('0x2b')]){delete _0x4521cc['name'];}_0x36abda[_0xc5c7('0x1b')](_0x151fa2)['send'](_0x4521cc);};}exports[_0xc5c7('0x2c')]=function(_0x446bbb,_0x14ab5a){var _0x3fa6ab={},_0x3300f8={},_0x5e046a={'count':0x0,'rows':[]};var _0x233451=_[_0xc5c7('0x2d')](db[_0xc5c7('0x2e')]['rawAttributes'],function(_0x2d1c07){return{'name':_0x2d1c07[_0xc5c7('0x2f')],'type':_0x2d1c07[_0xc5c7('0x30')][_0xc5c7('0x31')]};});_0x3300f8[_0xc5c7('0x32')]=_['map'](_0x233451,_0xc5c7('0x2b'));_0x3300f8['query']=_[_0xc5c7('0x33')](_0x446bbb[_0xc5c7('0x34')]);_0x3300f8[_0xc5c7('0x35')]=_[_0xc5c7('0x36')](_0x3300f8[_0xc5c7('0x32')],_0x3300f8[_0xc5c7('0x34')]);_0x3fa6ab['attributes']=_[_0xc5c7('0x36')](_0x3300f8[_0xc5c7('0x32')],qs[_0xc5c7('0x37')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x37')]));_0x3fa6ab['attributes']=_0x3fa6ab['attributes']['length']?_0x3fa6ab[_0xc5c7('0x38')]:_0x3300f8[_0xc5c7('0x32')];if(!_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x39')](_0xc5c7('0x3a'))){_0x3fa6ab['limit']=qs[_0xc5c7('0x1f')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x1f')]);_0x3fa6ab[_0xc5c7('0x21')]=qs[_0xc5c7('0x21')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x21')]);}_0x3fa6ab[_0xc5c7('0x3b')]=qs['sort'](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x3c')]);_0x3fa6ab[_0xc5c7('0x3d')]=qs[_0xc5c7('0x35')](_[_0xc5c7('0x3e')](_0x446bbb[_0xc5c7('0x34')],_0x3300f8[_0xc5c7('0x35')]),_0x233451);if(_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x3f')]){_0x3fa6ab[_0xc5c7('0x3d')]=_[_0xc5c7('0x40')](_0x3fa6ab[_0xc5c7('0x3d')],{'$or':_[_0xc5c7('0x2d')](_0x233451,function(_0x1e48da){if(_0x1e48da[_0xc5c7('0x30')]!==_0xc5c7('0x41')){var _0x4f2cc8={};_0x4f2cc8[_0x1e48da[_0xc5c7('0x2b')]]={'$like':'%'+_0x446bbb['query'][_0xc5c7('0x3f')]+'%'};return _0x4f2cc8;}})});}_0x3fa6ab=_[_0xc5c7('0x40')]({},_0x3fa6ab,_0x446bbb[_0xc5c7('0x42')]);var _0x1b7157={'where':_0x3fa6ab['where']};return db[_0xc5c7('0x2e')][_0xc5c7('0x20')](_0x1b7157)[_0xc5c7('0x28')](function(_0x2b907){_0x5e046a[_0xc5c7('0x20')]=_0x2b907;if(_0x446bbb[_0xc5c7('0x34')]['includeAll']){_0x3fa6ab['include']=[{'all':!![]}];}return db[_0xc5c7('0x2e')]['findAll'](_0x3fa6ab);})[_0xc5c7('0x28')](function(_0xe4226f){_0x5e046a[_0xc5c7('0x43')]=_0xe4226f;return _0x5e046a;})[_0xc5c7('0x28')](respondWithFilteredResult(_0x14ab5a,_0x3fa6ab))['catch'](handleError(_0x14ab5a,null));};exports[_0xc5c7('0x44')]=function(_0x2d6898,_0x198701){var _0x5a8e5c={'raw':![],'where':{'id':_0x2d6898[_0xc5c7('0x45')]['id']}},_0x3e5f64={};_0x3e5f64[_0xc5c7('0x32')]=_[_0xc5c7('0x33')](db['AnalyticFieldReport'][_0xc5c7('0x46')]);_0x3e5f64[_0xc5c7('0x34')]=_[_0xc5c7('0x33')](_0x2d6898[_0xc5c7('0x34')]);_0x3e5f64[_0xc5c7('0x35')]=_[_0xc5c7('0x36')](_0x3e5f64[_0xc5c7('0x32')],_0x3e5f64[_0xc5c7('0x34')]);_0x5a8e5c[_0xc5c7('0x38')]=_[_0xc5c7('0x36')](_0x3e5f64[_0xc5c7('0x32')],qs[_0xc5c7('0x37')](_0x2d6898['query'][_0xc5c7('0x37')]));_0x5a8e5c[_0xc5c7('0x38')]=_0x5a8e5c['attributes'][_0xc5c7('0x47')]?_0x5a8e5c['attributes']:_0x3e5f64[_0xc5c7('0x32')];if(_0x2d6898[_0xc5c7('0x34')][_0xc5c7('0x48')]){_0x5a8e5c[_0xc5c7('0x49')]=[{'all':!![]}];}_0x5a8e5c=_[_0xc5c7('0x40')]({},_0x5a8e5c,_0x2d6898[_0xc5c7('0x42')]);return db[_0xc5c7('0x2e')]['find'](_0x5a8e5c)['then'](handleEntityNotFound(_0x198701,null))[_0xc5c7('0x28')](respondWithResult(_0x198701,null))['catch'](handleError(_0x198701,null));};exports['create']=function(_0x3a1071,_0x59329f){return db[_0xc5c7('0x2e')][_0xc5c7('0x4a')](_0x3a1071[_0xc5c7('0x4b')],{})[_0xc5c7('0x28')](respondWithResult(_0x59329f,0xc9))[_0xc5c7('0x4c')](handleError(_0x59329f,null));};exports[_0xc5c7('0x4d')]=function(_0x26159a,_0x52a2a4){return db[_0xc5c7('0x2e')][_0xc5c7('0x4d')](_0x26159a[_0xc5c7('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x52a2a4,0xc9))[_0xc5c7('0x4c')](handleError(_0x52a2a4,null));};exports['update']=function(_0x567b4a,_0x5385fb){if(_0x567b4a['body']['id']){delete _0x567b4a[_0xc5c7('0x4b')]['id'];}return db['AnalyticFieldReport'][_0xc5c7('0x4e')]({'where':{'id':_0x567b4a[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x5385fb,null))[_0xc5c7('0x28')](saveUpdates(_0x567b4a[_0xc5c7('0x4b')],null))[_0xc5c7('0x28')](respondWithResult(_0x5385fb,null))[_0xc5c7('0x4c')](handleError(_0x5385fb,null));};exports[_0xc5c7('0x4f')]=function(_0x3740f2,_0x31f7b3){return db[_0xc5c7('0x2e')][_0xc5c7('0x4e')]({'where':{'id':_0x3740f2[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x31f7b3,null))[_0xc5c7('0x28')](removeEntity(_0x31f7b3,null))[_0xc5c7('0x4c')](handleError(_0x31f7b3,null));};exports[_0xc5c7('0x50')]=function(_0x5d3f98,_0x38cea4){return db[_0xc5c7('0x2e')]['destroy']({'where':{'id':_0x5d3f98[_0xc5c7('0x34')][_0xc5c7('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xc5c7('0x28')](respondWithResult(_0x38cea4,0xcc))[_0xc5c7('0x4c')](handleError(_0x38cea4,null));};exports[_0xc5c7('0x52')]=function(_0x4d111a,_0x2f0bea,_0x25b383){return db['AnalyticCustomReport'][_0xc5c7('0x53')]({'where':{'id':_0x4d111a[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x2f0bea,null))[_0xc5c7('0x28')](function(_0x473770){if(_0x473770){return db['sequelize'][_0xc5c7('0x54')](function(_0x468501){return db['AnalyticFieldReport'][_0xc5c7('0x4f')]({'where':{'CustomReportId':_0x4d111a['params']['id']},'transaction':_0x468501})[_0xc5c7('0x28')](function(_0x454c90){var _0x1c6206=_[_0xc5c7('0x2d')](_0x4d111a['body'],function(_0x540715){delete _0x540715['id'];_0x540715[_0xc5c7('0x55')]=_0x4d111a[_0xc5c7('0x45')]['id'];return _0x540715;});return db[_0xc5c7('0x2e')][_0xc5c7('0x4d')](_0x1c6206,{'transaction':_0x468501});});})['then'](function(){return db[_0xc5c7('0x2e')][_0xc5c7('0x56')]({'where':{'CustomReportId':_0x4d111a[_0xc5c7('0x45')]['id']}});});}})[_0xc5c7('0x28')](respondWithResult(_0x2f0bea,null))['catch'](handleError(_0x2f0bea,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 826f3fb..a98ad31 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6388=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x6388,0xa9));var _0x8638=function(_0x12b16b,_0x55a909){_0x12b16b=_0x12b16b-0x0;var _0x3401e6=_0x6388[_0x12b16b];return _0x3401e6;};'use strict';var _=require(_0x8638('0x0'));var util=require(_0x8638('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8638('0x2'));var rp=require(_0x8638('0x3'));var fs=require('fs');var path=require(_0x8638('0x4'));var rimraf=require(_0x8638('0x5'));var config=require(_0x8638('0x6'));var attributes=require(_0x8638('0x7'));module[_0x8638('0x8')]=function(_0x9c6344,_0x580c9e){return _0x9c6344['define'](_0x8638('0x9'),attributes,{'tableName':_0x8638('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3054=['exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x45ce90,_0x114609){var _0x313c45=function(_0x55102a){while(--_0x55102a){_0x45ce90['push'](_0x45ce90['shift']());}};_0x313c45(++_0x114609);}(_0x3054,0x10c));var _0x4305=function(_0x5d1e6e,_0x16aca4){_0x5d1e6e=_0x5d1e6e-0x0;var _0x1f0dfe=_0x3054[_0x5d1e6e];return _0x1f0dfe;};'use strict';var _=require('lodash');var util=require(_0x4305('0x0'));var logger=require(_0x4305('0x1'))(_0x4305('0x2'));var moment=require(_0x4305('0x3'));var BPromise=require(_0x4305('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4305('0x5'));var rimraf=require('rimraf');var config=require(_0x4305('0x6'));var attributes=require(_0x4305('0x7'));module[_0x4305('0x8')]=function(_0x4cff36,_0x16255f){return _0x4cff36[_0x4305('0x9')](_0x4305('0xa'),attributes,{'tableName':_0x4305('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index a716757..d2743f4 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72b3=['../../config/environment','jayson/promise','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x52a7e1,_0x189bf3){var _0x4f4495=function(_0x5d1915){while(--_0x5d1915){_0x52a7e1['push'](_0x52a7e1['shift']());}};_0x4f4495(++_0x189bf3);}(_0x72b3,0x1c0));var _0x372b=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x72b3[_0x193e28];return _0x20ef59;};'use strict';var _=require(_0x372b('0x0'));var util=require(_0x372b('0x1'));var moment=require(_0x372b('0x2'));var BPromise=require(_0x372b('0x3'));var rs=require(_0x372b('0x4'));var fs=require('fs');var Redis=require(_0x372b('0x5'));var db=require(_0x372b('0x6'))['db'];var utils=require(_0x372b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x372b('0x8'));var jayson=require(_0x372b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x491a79,_0x35363c,_0x3db14f){return new BPromise(function(_0x5b0220,_0x20fe59){return client[_0x372b('0xa')](_0x491a79,_0x3db14f)['then'](function(_0x2e4fd3){logger[_0x372b('0xb')](_0x372b('0xc'),_0x35363c,_0x372b('0xd'));logger[_0x372b('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x35363c,_0x372b('0xd'),JSON['stringify'](_0x2e4fd3));if(_0x2e4fd3[_0x372b('0xf')]){if(_0x2e4fd3[_0x372b('0xf')]['code']===0x1f4){logger[_0x372b('0xf')](_0x372b('0xc'),_0x35363c,_0x2e4fd3[_0x372b('0xf')][_0x372b('0x10')]);return _0x20fe59(_0x2e4fd3[_0x372b('0xf')][_0x372b('0x10')]);}logger['error'](_0x372b('0xc'),_0x35363c,_0x2e4fd3[_0x372b('0xf')][_0x372b('0x10')]);return _0x5b0220(_0x2e4fd3[_0x372b('0xf')]['message']);}else{logger['info'](_0x372b('0xc'),_0x35363c,_0x372b('0xd'));_0x5b0220(_0x2e4fd3[_0x372b('0x11')][_0x372b('0x10')]);}})[_0x372b('0x12')](function(_0x60b8d5){logger[_0x372b('0xf')](_0x372b('0xc'),_0x35363c,_0x60b8d5);_0x20fe59(_0x60b8d5);});});} \ No newline at end of file +var _0x77b1=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0xe34133,_0x5a7691){var _0x27ebab=function(_0x3a42ba){while(--_0x3a42ba){_0xe34133['push'](_0xe34133['shift']());}};_0x27ebab(++_0x5a7691);}(_0x77b1,0x19f));var _0x177b=function(_0x23af58,_0x3d45df){_0x23af58=_0x23af58-0x0;var _0xdf23b2=_0x77b1[_0x23af58];return _0xdf23b2;};'use strict';var _=require(_0x177b('0x0'));var util=require('util');var moment=require(_0x177b('0x1'));var BPromise=require('bluebird');var rs=require(_0x177b('0x2'));var fs=require('fs');var Redis=require(_0x177b('0x3'));var db=require(_0x177b('0x4'))['db'];var utils=require(_0x177b('0x5'));var logger=require(_0x177b('0x6'))(_0x177b('0x7'));var config=require('../../config/environment');var jayson=require(_0x177b('0x8'));var client=jayson[_0x177b('0x9')][_0x177b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x117e81,_0x426d35,_0x34b79d){return new BPromise(function(_0x1df58c,_0x297186){return client[_0x177b('0xb')](_0x117e81,_0x34b79d)['then'](function(_0x124ec8){logger[_0x177b('0xc')](_0x177b('0xd'),_0x426d35,_0x177b('0xe'));logger['debug'](_0x177b('0xf'),_0x426d35,_0x177b('0xe'),JSON[_0x177b('0x10')](_0x124ec8));if(_0x124ec8['error']){if(_0x124ec8[_0x177b('0x11')]['code']===0x1f4){logger[_0x177b('0x11')](_0x177b('0xd'),_0x426d35,_0x124ec8['error']['message']);return _0x297186(_0x124ec8[_0x177b('0x11')][_0x177b('0x12')]);}logger[_0x177b('0x11')](_0x177b('0xd'),_0x426d35,_0x124ec8[_0x177b('0x11')][_0x177b('0x12')]);return _0x1df58c(_0x124ec8[_0x177b('0x11')]['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x426d35,_0x177b('0xe'));_0x1df58c(_0x124ec8[_0x177b('0x13')]['message']);}})['catch'](function(_0x3fa952){logger['error'](_0x177b('0xd'),_0x426d35,_0x3fa952);_0x297186(_0x3fa952);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index d8c8f5f..4d0ae90 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x77ccb,_0x1ff5ee){var _0x2a7869=function(_0x36e374){while(--_0x36e374){_0x77ccb['push'](_0x77ccb['shift']());}};_0x2a7869(++_0x1ff5ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x5dc120,_0x3e4683){var _0x37aa08=function(_0x176f47){while(--_0x176f47){_0x5dc120['push'](_0x5dc120['shift']());}};_0x37aa08(++_0x3e4683);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 39a2b35..2aaf585 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa769=['STRING','name','sequelize'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xa769,0xfb));var _0x9a76=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa769[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x9a76('0x0'));module['exports']={'name':{'type':Sequelize[_0x9a76('0x1')],'allowNull':![],'unique':_0x9a76('0x2')},'table':{'type':Sequelize[_0x9a76('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x9a76('0x1')]}}; \ No newline at end of file +var _0xd732=['STRING','TEXT','sequelize'];(function(_0x4e9f7a,_0xcd51d8){var _0x433a29=function(_0x1c4de3){while(--_0x1c4de3){_0x4e9f7a['push'](_0x4e9f7a['shift']());}};_0x433a29(++_0xcd51d8);}(_0xd732,0x18e));var _0x2d73=function(_0x4f00ab,_0x574771){_0x4f00ab=_0x4f00ab-0x0;var _0x25d7d4=_0xd732[_0x4f00ab];return _0x25d7d4;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d73('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x2d73('0x2')]},'description':{'type':Sequelize[_0x2d73('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b83c5cf..11a9c34 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x3514fa,_0xb3a0a){var _0x1c9222=function(_0x247caa){while(--_0x247caa){_0x3514fa['push'](_0x3514fa['shift']());}};_0x1c9222(++_0xb3a0a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0x24ca[_0x37c07d];return _0x10dadc;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x456c80,_0x41a353){var _0x4dc31a=function(_0x379085){while(--_0x379085){_0x456c80['push'](_0x456c80['shift']());}};_0x4dc31a(++_0x41a353);}(_0x5fc3,0xa8));var _0x35fc=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0x5fc3[_0x23be51];return _0x47a26d;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index fcface3..8bd46c1 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa751=['analytics_metrics','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0xa751,0x175));var _0x1a75=function(_0x5affb0,_0x36501a){_0x5affb0=_0x5affb0-0x0;var _0x2bf391=_0xa751[_0x5affb0];return _0x2bf391;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var logger=require(_0x1a75('0x2'))(_0x1a75('0x3'));var moment=require('moment');var BPromise=require(_0x1a75('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a75('0x5'));var rimraf=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x1a75('0x8')]=function(_0x220b14,_0x1719c1){return _0x220b14[_0x1a75('0x9')](_0x1a75('0xa'),attributes,{'tableName':_0x1a75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13fe=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics'];(function(_0x1a7e14,_0x100435){var _0x53abf8=function(_0x4767ab){while(--_0x4767ab){_0x1a7e14['push'](_0x1a7e14['shift']());}};_0x53abf8(++_0x100435);}(_0x13fe,0x138));var _0xe13f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x13fe[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xe13f('0x0'));var util=require(_0xe13f('0x1'));var logger=require(_0xe13f('0x2'))(_0xe13f('0x3'));var moment=require(_0xe13f('0x4'));var BPromise=require(_0xe13f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe13f('0x6'));var rimraf=require(_0xe13f('0x7'));var config=require(_0xe13f('0x8'));var attributes=require(_0xe13f('0x9'));module[_0xe13f('0xa')]=function(_0x1ddbff,_0x2832ce){return _0x1ddbff['define']('AnalyticMetric',attributes,{'tableName':_0xe13f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index b464fe4..360e01b 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4cd=['client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x219065,_0x5dd293){var _0x11b4c7=function(_0x5c6662){while(--_0x5c6662){_0x219065['push'](_0x219065['shift']());}};_0x11b4c7(++_0x5dd293);}(_0xd4cd,0x110));var _0xdd4c=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0xd4cd[_0x3f25b2];return _0xd8caeb;};'use strict';var _=require(_0xdd4c('0x0'));var util=require(_0xdd4c('0x1'));var moment=require(_0xdd4c('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd4c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd4c('0x5'));var config=require(_0xdd4c('0x6'));var jayson=require(_0xdd4c('0x7'));var client=jayson[_0xdd4c('0x8')][_0xdd4c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10b5b0,_0x45291c,_0x4a45db){return new BPromise(function(_0xe3c10a,_0x24b856){return client[_0xdd4c('0xa')](_0x10b5b0,_0x4a45db)[_0xdd4c('0xb')](function(_0x87eb2f){logger[_0xdd4c('0xc')](_0xdd4c('0xd'),_0x45291c,_0xdd4c('0xe'));logger['debug'](_0xdd4c('0xf'),_0x45291c,_0xdd4c('0xe'),JSON[_0xdd4c('0x10')](_0x87eb2f));if(_0x87eb2f['error']){if(_0x87eb2f[_0xdd4c('0x11')][_0xdd4c('0x12')]===0x1f4){logger['error'](_0xdd4c('0xd'),_0x45291c,_0x87eb2f[_0xdd4c('0x11')][_0xdd4c('0x13')]);return _0x24b856(_0x87eb2f[_0xdd4c('0x11')]['message']);}logger[_0xdd4c('0x11')](_0xdd4c('0xd'),_0x45291c,_0x87eb2f['error'][_0xdd4c('0x13')]);return _0xe3c10a(_0x87eb2f[_0xdd4c('0x11')][_0xdd4c('0x13')]);}else{logger[_0xdd4c('0xc')](_0xdd4c('0xd'),_0x45291c,_0xdd4c('0xe'));_0xe3c10a(_0x87eb2f['result'][_0xdd4c('0x13')]);}})['catch'](function(_0x8e7464){logger[_0xdd4c('0x11')](_0xdd4c('0xd'),_0x45291c,_0x8e7464);_0x24b856(_0x8e7464);});});} \ No newline at end of file +var _0xf450=['stringify','error','code','message','result','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf450,0xc2));var _0x0f45=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf450[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0f45('0x0'));var util=require(_0x0f45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0f45('0x3'));var logger=require(_0x0f45('0x4'))(_0x0f45('0x5'));var config=require(_0x0f45('0x6'));var jayson=require(_0x0f45('0x7'));var client=jayson[_0x0f45('0x8')][_0x0f45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f642f,_0x257cb8,_0x5a059d){return new BPromise(function(_0x32d1de,_0x493a2b){return client[_0x0f45('0xa')](_0x4f642f,_0x5a059d)[_0x0f45('0xb')](function(_0x49d884){logger[_0x0f45('0xc')](_0x0f45('0xd'),_0x257cb8,'request\x20sent');logger[_0x0f45('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x257cb8,_0x0f45('0xf'),JSON[_0x0f45('0x10')](_0x49d884));if(_0x49d884[_0x0f45('0x11')]){if(_0x49d884[_0x0f45('0x11')][_0x0f45('0x12')]===0x1f4){logger['error'](_0x0f45('0xd'),_0x257cb8,_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);return _0x493a2b(_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);}logger[_0x0f45('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x257cb8,_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);return _0x32d1de(_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);}else{logger['info'](_0x0f45('0xd'),_0x257cb8,_0x0f45('0xf'));_0x32d1de(_0x49d884[_0x0f45('0x14')][_0x0f45('0x13')]);}})['catch'](function(_0x3fe328){logger[_0x0f45('0x11')](_0x0f45('0xd'),_0x257cb8,_0x3fe328);_0x493a2b(_0x3fe328);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 40c11a2..5eabb43 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a88=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6a88,0xa9));var _0x86a8=function(_0x2c26a0,_0x2b9577){_0x2c26a0=_0x2c26a0-0x0;var _0x3e26d2=_0x6a88[_0x2c26a0];return _0x3e26d2;};'use strict';var multer=require(_0x86a8('0x0'));var util=require(_0x86a8('0x1'));var path=require(_0x86a8('0x2'));var timeout=require(_0x86a8('0x3'));var express=require(_0x86a8('0x4'));var router=express[_0x86a8('0x5')]();var fs_extra=require(_0x86a8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x86a8('0x7'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x86a8('0x8')]('/',auth[_0x86a8('0x9')](),controller['index']);router[_0x86a8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x86a8('0xa')]);router[_0x86a8('0xb')]('/',auth['isAuthenticated'](),controller[_0x86a8('0xc')]);router[_0x86a8('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86a8('0xe')]);router[_0x86a8('0xf')](_0x86a8('0x10'),auth[_0x86a8('0x9')](),controller[_0x86a8('0x11')]);module[_0x86a8('0x12')]=router; \ No newline at end of file +var _0x7edb=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x7edb,0x158));var _0xb7ed=function(_0x40d287,_0x42f496){_0x40d287=_0x40d287-0x0;var _0x379218=_0x7edb[_0x40d287];return _0x379218;};'use strict';var multer=require('multer');var util=require(_0xb7ed('0x0'));var path=require(_0xb7ed('0x1'));var timeout=require(_0xb7ed('0x2'));var express=require(_0xb7ed('0x3'));var router=express[_0xb7ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7ed('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb7ed('0x6'));router[_0xb7ed('0x7')]('/',auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x9')]);router[_0xb7ed('0x7')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xb')]);router[_0xb7ed('0xc')]('/',auth[_0xb7ed('0x8')](),controller['create']);router[_0xb7ed('0xd')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xe')]);router[_0xb7ed('0xf')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller['destroy']);module[_0xb7ed('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index b841427..6ad17b1 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf839=['TEXT','sequelize','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf839,0x9a));var _0x9f83=function(_0x2b55b8,_0x59bc1){_0x2b55b8=_0x2b55b8-0x0;var _0x3da2a5=_0xf839[_0x2b55b8];return _0x3da2a5;};'use strict';var Sequelize=require(_0x9f83('0x0'));module[_0x9f83('0x1')]={'tree':{'type':Sequelize[_0x9f83('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6d66=['sequelize','exports','TEXT'];(function(_0xdf13c9,_0x5da43f){var _0x302aaa=function(_0x42cc73){while(--_0x42cc73){_0xdf13c9['push'](_0xdf13c9['shift']());}};_0x302aaa(++_0x5da43f);}(_0x6d66,0x9c));var _0x66d6=function(_0x56fe43,_0x53383b){_0x56fe43=_0x56fe43-0x0;var _0x50ef2e=_0x6d66[_0x56fe43];return _0x50ef2e;};'use strict';var Sequelize=require(_0x66d6('0x0'));module[_0x66d6('0x1')]={'tree':{'type':Sequelize[_0x66d6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4b09281..a885040 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cfc=['VIRTUAL','options','includeAll','include','rows','show','params','length','find','catch','create','body','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','update','destroy','then','error','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map'];(function(_0x28168c,_0x426c46){var _0x590141=function(_0x2a4639){while(--_0x2a4639){_0x28168c['push'](_0x28168c['shift']());}};_0x590141(++_0x426c46);}(_0x3cfc,0x11c));var _0xc3cf=function(_0x5af488,_0x5a7edf){_0x5af488=_0x5af488-0x0;var _0x1bf2f2=_0x3cfc[_0x5af488];return _0x1bf2f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3cf('0x0'));var jsonpatch=require(_0xc3cf('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3cf('0x2'));var Mustache=require(_0xc3cf('0x3'));var util=require(_0xc3cf('0x4'));var path=require(_0xc3cf('0x5'));var sox=require('sox');var csv=require(_0xc3cf('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3cf('0x7'));var _=require(_0xc3cf('0x8'));var squel=require(_0xc3cf('0x9'));var crypto=require(_0xc3cf('0xa'));var jsforce=require(_0xc3cf('0xb'));var deskjs=require(_0xc3cf('0xc'));var toCsv=require(_0xc3cf('0x6'));var querystring=require(_0xc3cf('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3cf('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3cf('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3cf('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xc3cf('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xc3cf('0x12'))['db'];function respondWithStatusCode(_0x506373,_0x54d2cb){_0x54d2cb=_0x54d2cb||0xcc;return function(_0x2d6ad3){if(_0x2d6ad3){return _0x506373[_0xc3cf('0x13')](_0x54d2cb);}return _0x506373['status'](_0x54d2cb)[_0xc3cf('0x14')]();};}function respondWithResult(_0x187ce3,_0x4e327a){_0x4e327a=_0x4e327a||0xc8;return function(_0x31772f){if(_0x31772f){return _0x187ce3[_0xc3cf('0x15')](_0x4e327a)[_0xc3cf('0x16')](_0x31772f);}};}function respondWithFilteredResult(_0x1a0721,_0xc317e1){return function(_0xfe60f2){if(_0xfe60f2){var _0x44e6b6=typeof _0xc317e1[_0xc3cf('0x17')]===_0xc3cf('0x18')&&typeof _0xc317e1['limit']===_0xc3cf('0x18');var _0x3fbcfb=_0xfe60f2[_0xc3cf('0x19')];var _0x377815=_0x44e6b6?0x0:_0xc317e1[_0xc3cf('0x17')];var _0x156ffb=_0x44e6b6?_0xfe60f2[_0xc3cf('0x19')]:_0xc317e1[_0xc3cf('0x17')]+_0xc317e1['limit'];var _0x169946;if(_0x156ffb>=_0x3fbcfb){_0x156ffb=_0x3fbcfb;_0x169946=0xc8;}else{_0x169946=0xce;}_0x1a0721[_0xc3cf('0x15')](_0x169946);return _0x1a0721[_0xc3cf('0x1a')](_0xc3cf('0x1b'),_0x377815+'-'+_0x156ffb+'/'+_0x3fbcfb)[_0xc3cf('0x16')](_0xfe60f2);}return null;};}function patchUpdates(_0xa9949e){return function(_0x2f8639){try{jsonpatch['apply'](_0x2f8639,_0xa9949e,!![]);}catch(_0x1dda92){return BPromise[_0xc3cf('0x1c')](_0x1dda92);}return _0x2f8639['save']();};}function saveUpdates(_0x5cabfe,_0x30efc1){return function(_0x1d7242){if(_0x1d7242){return _0x1d7242[_0xc3cf('0x1d')](_0x5cabfe)['then'](function(_0x417a74){return _0x417a74;});}return null;};}function removeEntity(_0x4a1ab4,_0x20f691){return function(_0x4e31b6){if(_0x4e31b6){return _0x4e31b6[_0xc3cf('0x1e')]()[_0xc3cf('0x1f')](function(){_0x4a1ab4['status'](0xcc)[_0xc3cf('0x14')]();});}};}function handleEntityNotFound(_0x4d9f34,_0x3ff05a){return function(_0x18b9fe){if(!_0x18b9fe){_0x4d9f34['sendStatus'](0x194);}return _0x18b9fe;};}function handleError(_0x39fac3,_0x3798e2){_0x3798e2=_0x3798e2||0x1f4;return function(_0x2e9098){logger[_0xc3cf('0x20')](_0x2e9098['stack']);if(_0x2e9098[_0xc3cf('0x21')]){delete _0x2e9098[_0xc3cf('0x21')];}_0x39fac3[_0xc3cf('0x15')](_0x3798e2)[_0xc3cf('0x22')](_0x2e9098);};}exports[_0xc3cf('0x23')]=function(_0x5c073c,_0x1db264){var _0x4ebd3c={},_0x2b1bca={},_0x1b3dc5={'count':0x0,'rows':[]};var _0x40df6c=_['map'](db[_0xc3cf('0x24')][_0xc3cf('0x25')],function(_0x5523ee){return{'name':_0x5523ee[_0xc3cf('0x26')],'type':_0x5523ee[_0xc3cf('0x27')]['key']};});_0x2b1bca[_0xc3cf('0x28')]=_['map'](_0x40df6c,_0xc3cf('0x21'));_0x2b1bca[_0xc3cf('0x29')]=_[_0xc3cf('0x2a')](_0x5c073c[_0xc3cf('0x29')]);_0x2b1bca[_0xc3cf('0x2b')]=_[_0xc3cf('0x2c')](_0x2b1bca['model'],_0x2b1bca['query']);_0x4ebd3c[_0xc3cf('0x2d')]=_['intersection'](_0x2b1bca[_0xc3cf('0x28')],qs[_0xc3cf('0x2e')](_0x5c073c['query'][_0xc3cf('0x2e')]));_0x4ebd3c[_0xc3cf('0x2d')]=_0x4ebd3c[_0xc3cf('0x2d')]['length']?_0x4ebd3c[_0xc3cf('0x2d')]:_0x2b1bca[_0xc3cf('0x28')];if(!_0x5c073c[_0xc3cf('0x29')][_0xc3cf('0x2f')](_0xc3cf('0x30'))){_0x4ebd3c[_0xc3cf('0x31')]=qs[_0xc3cf('0x31')](_0x5c073c[_0xc3cf('0x29')][_0xc3cf('0x31')]);_0x4ebd3c[_0xc3cf('0x17')]=qs[_0xc3cf('0x17')](_0x5c073c['query'][_0xc3cf('0x17')]);}_0x4ebd3c[_0xc3cf('0x32')]=qs[_0xc3cf('0x33')](_0x5c073c[_0xc3cf('0x29')][_0xc3cf('0x33')]);_0x4ebd3c['where']=qs['filters'](_['pick'](_0x5c073c[_0xc3cf('0x29')],_0x2b1bca['filters']),_0x40df6c);if(_0x5c073c['query'][_0xc3cf('0x34')]){_0x4ebd3c[_0xc3cf('0x35')]=_[_0xc3cf('0x36')](_0x4ebd3c['where'],{'$or':_[_0xc3cf('0x37')](_0x40df6c,function(_0x21a206){if(_0x21a206['type']!==_0xc3cf('0x38')){var _0x36ddb5={};_0x36ddb5[_0x21a206[_0xc3cf('0x21')]]={'$like':'%'+_0x5c073c[_0xc3cf('0x29')][_0xc3cf('0x34')]+'%'};return _0x36ddb5;}})});}_0x4ebd3c=_[_0xc3cf('0x36')]({},_0x4ebd3c,_0x5c073c[_0xc3cf('0x39')]);var _0x1575ff={'where':_0x4ebd3c[_0xc3cf('0x35')]};return db[_0xc3cf('0x24')][_0xc3cf('0x19')](_0x1575ff)[_0xc3cf('0x1f')](function(_0x3fd6fa){_0x1b3dc5[_0xc3cf('0x19')]=_0x3fd6fa;if(_0x5c073c[_0xc3cf('0x29')][_0xc3cf('0x3a')]){_0x4ebd3c[_0xc3cf('0x3b')]=[{'all':!![]}];}return db[_0xc3cf('0x24')]['findAll'](_0x4ebd3c);})[_0xc3cf('0x1f')](function(_0x1e814a){_0x1b3dc5[_0xc3cf('0x3c')]=_0x1e814a;return _0x1b3dc5;})['then'](respondWithFilteredResult(_0x1db264,_0x4ebd3c))['catch'](handleError(_0x1db264,null));};exports[_0xc3cf('0x3d')]=function(_0x202957,_0x5177dd){var _0x53e1b0={'raw':!![],'where':{'id':_0x202957[_0xc3cf('0x3e')]['id']}},_0x275a34={};_0x275a34[_0xc3cf('0x28')]=_[_0xc3cf('0x2a')](db[_0xc3cf('0x24')]['rawAttributes']);_0x275a34[_0xc3cf('0x29')]=_[_0xc3cf('0x2a')](_0x202957[_0xc3cf('0x29')]);_0x275a34[_0xc3cf('0x2b')]=_[_0xc3cf('0x2c')](_0x275a34[_0xc3cf('0x28')],_0x275a34[_0xc3cf('0x29')]);_0x53e1b0[_0xc3cf('0x2d')]=_[_0xc3cf('0x2c')](_0x275a34[_0xc3cf('0x28')],qs[_0xc3cf('0x2e')](_0x202957['query'][_0xc3cf('0x2e')]));_0x53e1b0[_0xc3cf('0x2d')]=_0x53e1b0[_0xc3cf('0x2d')][_0xc3cf('0x3f')]?_0x53e1b0[_0xc3cf('0x2d')]:_0x275a34['model'];if(_0x202957[_0xc3cf('0x29')][_0xc3cf('0x3a')]){_0x53e1b0['include']=[{'all':!![]}];}_0x53e1b0=_['merge']({},_0x53e1b0,_0x202957[_0xc3cf('0x39')]);return db[_0xc3cf('0x24')][_0xc3cf('0x40')](_0x53e1b0)[_0xc3cf('0x1f')](handleEntityNotFound(_0x5177dd,null))['then'](respondWithResult(_0x5177dd,null))[_0xc3cf('0x41')](handleError(_0x5177dd,null));};exports['create']=function(_0x2b5f06,_0x34606e){return db[_0xc3cf('0x24')][_0xc3cf('0x42')](_0x2b5f06[_0xc3cf('0x43')],{})[_0xc3cf('0x1f')](respondWithResult(_0x34606e,0xc9))[_0xc3cf('0x41')](handleError(_0x34606e,null));};exports[_0xc3cf('0x1d')]=function(_0x25a2ad,_0x309696){if(_0x25a2ad[_0xc3cf('0x43')]['id']){delete _0x25a2ad[_0xc3cf('0x43')]['id'];}return db[_0xc3cf('0x24')][_0xc3cf('0x40')]({'where':{'id':_0x25a2ad['params']['id']}})[_0xc3cf('0x1f')](handleEntityNotFound(_0x309696,null))[_0xc3cf('0x1f')](saveUpdates(_0x25a2ad['body'],null))[_0xc3cf('0x1f')](respondWithResult(_0x309696,null))[_0xc3cf('0x41')](handleError(_0x309696,null));};exports[_0xc3cf('0x1e')]=function(_0x773234,_0x5186fc){return db['AnalyticTreeReport'][_0xc3cf('0x40')]({'where':{'id':_0x773234['params']['id']}})[_0xc3cf('0x1f')](handleEntityNotFound(_0x5186fc,null))[_0xc3cf('0x1f')](removeEntity(_0x5186fc,null))[_0xc3cf('0x41')](handleError(_0x5186fc,null));}; \ No newline at end of file +var _0x210e=['then','destroy','sendStatus','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x210e,0x1e9));var _0xe210=function(_0x44d88c,_0x4e0cb4){_0x44d88c=_0x44d88c-0x0;var _0x508da7=_0x210e[_0x44d88c];return _0x508da7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe210('0x0'));var zipdir=require(_0xe210('0x1'));var jsonpatch=require(_0xe210('0x2'));var rp=require(_0xe210('0x3'));var moment=require(_0xe210('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe210('0x5'));var util=require('util');var path=require(_0xe210('0x6'));var sox=require(_0xe210('0x7'));var csv=require(_0xe210('0x8'));var ejs=require(_0xe210('0x9'));var fs=require('fs');var fs_extra=require(_0xe210('0xa'));var _=require(_0xe210('0xb'));var squel=require(_0xe210('0xc'));var crypto=require(_0xe210('0xd'));var jsforce=require(_0xe210('0xe'));var deskjs=require(_0xe210('0xf'));var toCsv=require(_0xe210('0x8'));var querystring=require('querystring');var Papa=require(_0xe210('0x10'));var Redis=require(_0xe210('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe210('0x12'));var as=require(_0xe210('0x13'));var hardwareService=require(_0xe210('0x14'));var logger=require(_0xe210('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe210('0x16'));var licenseUtil=require(_0xe210('0x17'));var db=require(_0xe210('0x18'))['db'];function respondWithStatusCode(_0x243c44,_0x3bba66){_0x3bba66=_0x3bba66||0xcc;return function(_0x577e9d){if(_0x577e9d){return _0x243c44['sendStatus'](_0x3bba66);}return _0x243c44[_0xe210('0x19')](_0x3bba66)[_0xe210('0x1a')]();};}function respondWithResult(_0x13c3f5,_0x43f30f){_0x43f30f=_0x43f30f||0xc8;return function(_0x1c5d11){if(_0x1c5d11){return _0x13c3f5[_0xe210('0x19')](_0x43f30f)[_0xe210('0x1b')](_0x1c5d11);}};}function respondWithFilteredResult(_0x1cc418,_0x17bcd6){return function(_0x2cb917){if(_0x2cb917){var _0x2df8db=typeof _0x17bcd6[_0xe210('0x1c')]===_0xe210('0x1d')&&typeof _0x17bcd6[_0xe210('0x1e')]===_0xe210('0x1d');var _0xd5eab1=_0x2cb917[_0xe210('0x1f')];var _0x50de63=_0x2df8db?0x0:_0x17bcd6[_0xe210('0x1c')];var _0x5447d8=_0x2df8db?_0x2cb917[_0xe210('0x1f')]:_0x17bcd6[_0xe210('0x1c')]+_0x17bcd6['limit'];var _0x4d3e86;if(_0x5447d8>=_0xd5eab1){_0x5447d8=_0xd5eab1;_0x4d3e86=0xc8;}else{_0x4d3e86=0xce;}_0x1cc418['status'](_0x4d3e86);return _0x1cc418[_0xe210('0x20')]('Content-Range',_0x50de63+'-'+_0x5447d8+'/'+_0xd5eab1)[_0xe210('0x1b')](_0x2cb917);}return null;};}function patchUpdates(_0x4aad1c){return function(_0x24a890){try{jsonpatch[_0xe210('0x21')](_0x24a890,_0x4aad1c,!![]);}catch(_0x277324){return BPromise[_0xe210('0x22')](_0x277324);}return _0x24a890[_0xe210('0x23')]();};}function saveUpdates(_0x3caea8,_0x27cca6){return function(_0x46c121){if(_0x46c121){return _0x46c121['update'](_0x3caea8)[_0xe210('0x24')](function(_0x24ee94){return _0x24ee94;});}return null;};}function removeEntity(_0x32d468,_0xe71a81){return function(_0x4b109e){if(_0x4b109e){return _0x4b109e[_0xe210('0x25')]()[_0xe210('0x24')](function(){_0x32d468[_0xe210('0x19')](0xcc)[_0xe210('0x1a')]();});}};}function handleEntityNotFound(_0x59c384,_0x5166ee){return function(_0xa7d1d5){if(!_0xa7d1d5){_0x59c384[_0xe210('0x26')](0x194);}return _0xa7d1d5;};}function handleError(_0x4e725a,_0xe0d0a4){_0xe0d0a4=_0xe0d0a4||0x1f4;return function(_0x34e971){logger['error'](_0x34e971[_0xe210('0x27')]);if(_0x34e971['name']){delete _0x34e971[_0xe210('0x28')];}_0x4e725a[_0xe210('0x19')](_0xe0d0a4)[_0xe210('0x29')](_0x34e971);};}exports[_0xe210('0x2a')]=function(_0x3213d1,_0x410aab){var _0xcf7a34={},_0x3b13dd={},_0x38d623={'count':0x0,'rows':[]};var _0xcb21c4=_[_0xe210('0x2b')](db[_0xe210('0x2c')][_0xe210('0x2d')],function(_0x88c865){return{'name':_0x88c865[_0xe210('0x2e')],'type':_0x88c865[_0xe210('0x2f')][_0xe210('0x30')]};});_0x3b13dd['model']=_['map'](_0xcb21c4,'name');_0x3b13dd['query']=_['keys'](_0x3213d1[_0xe210('0x31')]);_0x3b13dd[_0xe210('0x32')]=_[_0xe210('0x33')](_0x3b13dd[_0xe210('0x34')],_0x3b13dd[_0xe210('0x31')]);_0xcf7a34[_0xe210('0x35')]=_[_0xe210('0x33')](_0x3b13dd[_0xe210('0x34')],qs[_0xe210('0x36')](_0x3213d1['query'][_0xe210('0x36')]));_0xcf7a34[_0xe210('0x35')]=_0xcf7a34[_0xe210('0x35')][_0xe210('0x37')]?_0xcf7a34[_0xe210('0x35')]:_0x3b13dd['model'];if(!_0x3213d1[_0xe210('0x31')][_0xe210('0x38')](_0xe210('0x39'))){_0xcf7a34['limit']=qs['limit'](_0x3213d1[_0xe210('0x31')][_0xe210('0x1e')]);_0xcf7a34[_0xe210('0x1c')]=qs[_0xe210('0x1c')](_0x3213d1[_0xe210('0x31')][_0xe210('0x1c')]);}_0xcf7a34[_0xe210('0x3a')]=qs[_0xe210('0x3b')](_0x3213d1[_0xe210('0x31')][_0xe210('0x3b')]);_0xcf7a34[_0xe210('0x3c')]=qs[_0xe210('0x32')](_[_0xe210('0x3d')](_0x3213d1['query'],_0x3b13dd['filters']),_0xcb21c4);if(_0x3213d1[_0xe210('0x31')][_0xe210('0x3e')]){_0xcf7a34['where']=_[_0xe210('0x3f')](_0xcf7a34['where'],{'$or':_['map'](_0xcb21c4,function(_0x41380a){if(_0x41380a[_0xe210('0x2f')]!==_0xe210('0x40')){var _0x36bc9b={};_0x36bc9b[_0x41380a[_0xe210('0x28')]]={'$like':'%'+_0x3213d1[_0xe210('0x31')][_0xe210('0x3e')]+'%'};return _0x36bc9b;}})});}_0xcf7a34=_['merge']({},_0xcf7a34,_0x3213d1[_0xe210('0x41')]);var _0x339db8={'where':_0xcf7a34[_0xe210('0x3c')]};return db[_0xe210('0x2c')][_0xe210('0x1f')](_0x339db8)[_0xe210('0x24')](function(_0x259a09){_0x38d623['count']=_0x259a09;if(_0x3213d1[_0xe210('0x31')][_0xe210('0x42')]){_0xcf7a34[_0xe210('0x43')]=[{'all':!![]}];}return db[_0xe210('0x2c')][_0xe210('0x44')](_0xcf7a34);})['then'](function(_0x1346c4){_0x38d623[_0xe210('0x45')]=_0x1346c4;return _0x38d623;})[_0xe210('0x24')](respondWithFilteredResult(_0x410aab,_0xcf7a34))[_0xe210('0x46')](handleError(_0x410aab,null));};exports['show']=function(_0x2ec39f,_0x178a4a){var _0x4926b8={'raw':!![],'where':{'id':_0x2ec39f[_0xe210('0x47')]['id']}},_0x435a7e={};_0x435a7e['model']=_[_0xe210('0x48')](db['AnalyticTreeReport'][_0xe210('0x2d')]);_0x435a7e[_0xe210('0x31')]=_['keys'](_0x2ec39f[_0xe210('0x31')]);_0x435a7e[_0xe210('0x32')]=_[_0xe210('0x33')](_0x435a7e['model'],_0x435a7e[_0xe210('0x31')]);_0x4926b8[_0xe210('0x35')]=_['intersection'](_0x435a7e[_0xe210('0x34')],qs[_0xe210('0x36')](_0x2ec39f[_0xe210('0x31')][_0xe210('0x36')]));_0x4926b8[_0xe210('0x35')]=_0x4926b8[_0xe210('0x35')][_0xe210('0x37')]?_0x4926b8[_0xe210('0x35')]:_0x435a7e['model'];if(_0x2ec39f[_0xe210('0x31')][_0xe210('0x42')]){_0x4926b8[_0xe210('0x43')]=[{'all':!![]}];}_0x4926b8=_['merge']({},_0x4926b8,_0x2ec39f[_0xe210('0x41')]);return db['AnalyticTreeReport'][_0xe210('0x49')](_0x4926b8)['then'](handleEntityNotFound(_0x178a4a,null))[_0xe210('0x24')](respondWithResult(_0x178a4a,null))[_0xe210('0x46')](handleError(_0x178a4a,null));};exports['create']=function(_0x12c0a0,_0x383795){return db[_0xe210('0x2c')]['create'](_0x12c0a0[_0xe210('0x4a')],{})[_0xe210('0x24')](respondWithResult(_0x383795,0xc9))[_0xe210('0x46')](handleError(_0x383795,null));};exports['update']=function(_0x404b11,_0x514d48){if(_0x404b11['body']['id']){delete _0x404b11[_0xe210('0x4a')]['id'];}return db[_0xe210('0x2c')][_0xe210('0x49')]({'where':{'id':_0x404b11[_0xe210('0x47')]['id']}})['then'](handleEntityNotFound(_0x514d48,null))['then'](saveUpdates(_0x404b11[_0xe210('0x4a')],null))[_0xe210('0x24')](respondWithResult(_0x514d48,null))[_0xe210('0x46')](handleError(_0x514d48,null));};exports[_0xe210('0x25')]=function(_0x634f3f,_0x44e7d5){return db[_0xe210('0x2c')]['find']({'where':{'id':_0x634f3f['params']['id']}})[_0xe210('0x24')](handleEntityNotFound(_0x44e7d5,null))[_0xe210('0x24')](removeEntity(_0x44e7d5,null))[_0xe210('0x46')](handleError(_0x44e7d5,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 280a26a..7d6fb38 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd16=['moment','bluebird','request-promise','path','../../config/environment','define','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0xbd16,0xc2));var _0x6bd1=function(_0x2a2c72,_0x3f5a4a){_0x2a2c72=_0x2a2c72-0x0;var _0x354f0e=_0xbd16[_0x2a2c72];return _0x354f0e;};'use strict';var _=require(_0x6bd1('0x0'));var util=require(_0x6bd1('0x1'));var logger=require(_0x6bd1('0x2'))(_0x6bd1('0x3'));var moment=require(_0x6bd1('0x4'));var BPromise=require(_0x6bd1('0x5'));var rp=require(_0x6bd1('0x6'));var fs=require('fs');var path=require(_0x6bd1('0x7'));var rimraf=require('rimraf');var config=require(_0x6bd1('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1693d5,_0x26fb01){return _0x1693d5[_0x6bd1('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x6bd1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dd1=['bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','lodash','util','../../config/logger','moment'];(function(_0x13ced3,_0x529a2a){var _0x43897f=function(_0x135f1c){while(--_0x135f1c){_0x13ced3['push'](_0x13ced3['shift']());}};_0x43897f(++_0x529a2a);}(_0x1dd1,0x1eb));var _0x11dd=function(_0x3c834d,_0x4f9feb){_0x3c834d=_0x3c834d-0x0;var _0x508ff4=_0x1dd1[_0x3c834d];return _0x508ff4;};'use strict';var _=require(_0x11dd('0x0'));var util=require(_0x11dd('0x1'));var logger=require(_0x11dd('0x2'))('api');var moment=require(_0x11dd('0x3'));var BPromise=require(_0x11dd('0x4'));var rp=require(_0x11dd('0x5'));var fs=require('fs');var path=require(_0x11dd('0x6'));var rimraf=require(_0x11dd('0x7'));var config=require(_0x11dd('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0xd3434b,_0x55e37f){return _0xd3434b[_0x11dd('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x11dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 857e1b0..9d2af9d 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xba0394,_0x2c6844){var _0x1789dd=function(_0x437c00){while(--_0x437c00){_0xba0394['push'](_0xba0394['shift']());}};_0x1789dd(++_0x2c6844);}(_0xadb5,0xad));var _0x5adb=function(_0x5dcbf3,_0xfbebb9){_0x5dcbf3=_0x5dcbf3-0x0;var _0x37cd27=_0xadb5[_0x5dcbf3];return _0x37cd27;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x156734,_0x14351b){var _0x3565a3=function(_0xc7e906){while(--_0xc7e906){_0x156734['push'](_0x156734['shift']());}};_0x3565a3(++_0x14351b);}(_0xdb28,0x106));var _0x8db2=function(_0x46bfe0,_0x55b1ca){_0x46bfe0=_0x46bfe0-0x0;var _0x9a062f=_0xdb28[_0x46bfe0];return _0x9a062f;};'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')]('AnalyticTreeReport,\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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c810899..4382dc3 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69e5=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1c1c5e,_0x270b07){var _0x236279=function(_0x331dda){while(--_0x331dda){_0x1c1c5e['push'](_0x1c1c5e['shift']());}};_0x236279(++_0x270b07);}(_0x69e5,0x1d8));var _0x569e=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0x69e5[_0x3b594b];return _0x1ea5f8;};'use strict';var multer=require(_0x569e('0x0'));var util=require(_0x569e('0x1'));var path=require(_0x569e('0x2'));var timeout=require(_0x569e('0x3'));var express=require(_0x569e('0x4'));var router=express[_0x569e('0x5')]();var fs_extra=require(_0x569e('0x6'));var auth=require(_0x569e('0x7'));var interaction=require(_0x569e('0x8'));var config=require(_0x569e('0x9'));var controller=require(_0x569e('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x569e('0xb')]);router[_0x569e('0xc')](_0x569e('0xd'),auth[_0x569e('0xe')](),controller['show']);router[_0x569e('0xf')]('/',auth[_0x569e('0xe')](),controller[_0x569e('0x10')]);router['put'](_0x569e('0xd'),auth[_0x569e('0xe')](),controller[_0x569e('0x11')]);router[_0x569e('0x12')]('/:id',auth[_0x569e('0xe')](),controller[_0x569e('0x13')]);module['exports']=router; \ No newline at end of file +var _0xcf97=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x5ada9e,_0x2ef5a7){var _0x48f5a8=function(_0x45d089){while(--_0x45d089){_0x5ada9e['push'](_0x5ada9e['shift']());}};_0x48f5a8(++_0x2ef5a7);}(_0xcf97,0x1d7));var _0x7cf9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xcf97[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x7cf9('0x0'));var util=require(_0x7cf9('0x1'));var path=require(_0x7cf9('0x2'));var timeout=require(_0x7cf9('0x3'));var express=require(_0x7cf9('0x4'));var router=express[_0x7cf9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7cf9('0x6'));var interaction=require(_0x7cf9('0x7'));var config=require('../../config/environment');var controller=require(_0x7cf9('0x8'));router[_0x7cf9('0x9')]('/',auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xb')]);router[_0x7cf9('0x9')](_0x7cf9('0xc'),auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xd')]);router[_0x7cf9('0xe')]('/',auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xf')]);router[_0x7cf9('0x10')](_0x7cf9('0xc'),auth[_0x7cf9('0xa')](),controller[_0x7cf9('0x11')]);router[_0x7cf9('0x12')](_0x7cf9('0xc'),auth['isAuthenticated'](),controller[_0x7cf9('0x13')]);module[_0x7cf9('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 8ec1310..c047319 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcabc=['exports','STRING'];(function(_0x4b13ce,_0x339cb0){var _0x427d4b=function(_0x26aaad){while(--_0x26aaad){_0x4b13ce['push'](_0x4b13ce['shift']());}};_0x427d4b(++_0x339cb0);}(_0xcabc,0x16a));var _0xccab=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcabc[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module[_0xccab('0x0')]={'name':{'type':Sequelize[_0xccab('0x1')]},'basename':{'type':Sequelize[_0xccab('0x1')]},'type':{'type':Sequelize[_0xccab('0x1')]}}; \ No newline at end of file +var _0x05b0=['STRING'];(function(_0x2471c0,_0x87358){var _0x3843c1=function(_0xcdf8ed){while(--_0xcdf8ed){_0x2471c0['push'](_0x2471c0['shift']());}};_0x3843c1(++_0x87358);}(_0x05b0,0x188));var _0x005b=function(_0x5c64d3,_0x47d863){_0x5c64d3=_0x5c64d3-0x0;var _0x4ead44=_0x05b0[_0x5c64d3];return _0x4ead44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x005b('0x0')]},'basename':{'type':Sequelize[_0x005b('0x0')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 3d0207c..6af4ecb 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f61=['model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','Attachment','includeAll','include','rows','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','body','create','update','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection'];(function(_0x1fcc1e,_0x39efee){var _0x13497a=function(_0x56d1fe){while(--_0x56d1fe){_0x1fcc1e['push'](_0x1fcc1e['shift']());}};_0x13497a(++_0x39efee);}(_0x6f61,0x13b));var _0x16f6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f61[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x16f6('0x0'));var rimraf=require(_0x16f6('0x1'));var zipdir=require(_0x16f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16f6('0x3'));var moment=require(_0x16f6('0x4'));var BPromise=require(_0x16f6('0x5'));var Mustache=require('mustache');var util=require(_0x16f6('0x6'));var path=require(_0x16f6('0x7'));var sox=require(_0x16f6('0x8'));var csv=require(_0x16f6('0x9'));var ejs=require(_0x16f6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16f6('0xb'));var squel=require(_0x16f6('0xc'));var crypto=require(_0x16f6('0xd'));var jsforce=require(_0x16f6('0xe'));var deskjs=require(_0x16f6('0xf'));var toCsv=require(_0x16f6('0x9'));var querystring=require(_0x16f6('0x10'));var Papa=require(_0x16f6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x16f6('0x12'));var hardwareService=require(_0x16f6('0x13'));var logger=require(_0x16f6('0x14'))(_0x16f6('0x15'));var utils=require(_0x16f6('0x16'));var config=require(_0x16f6('0x17'));var licenseUtil=require(_0x16f6('0x18'));var db=require(_0x16f6('0x19'))['db'];function respondWithStatusCode(_0x1ed179,_0x1bbac7){_0x1bbac7=_0x1bbac7||0xcc;return function(_0x5e111f){if(_0x5e111f){return _0x1ed179['sendStatus'](_0x1bbac7);}return _0x1ed179['status'](_0x1bbac7)['end']();};}function respondWithResult(_0x60103,_0xf89fda){_0xf89fda=_0xf89fda||0xc8;return function(_0x46f76e){if(_0x46f76e){return _0x60103[_0x16f6('0x1a')](_0xf89fda)['json'](_0x46f76e);}};}function respondWithFilteredResult(_0x5c84b0,_0x1f34e9){return function(_0x10582c){if(_0x10582c){var _0x46078c=typeof _0x1f34e9[_0x16f6('0x1b')]===_0x16f6('0x1c')&&typeof _0x1f34e9[_0x16f6('0x1d')]===_0x16f6('0x1c');var _0x5a528a=_0x10582c['count'];var _0x578e30=_0x46078c?0x0:_0x1f34e9[_0x16f6('0x1b')];var _0x35fedb=_0x46078c?_0x10582c[_0x16f6('0x1e')]:_0x1f34e9['offset']+_0x1f34e9[_0x16f6('0x1d')];var _0x541619;if(_0x35fedb>=_0x5a528a){_0x35fedb=_0x5a528a;_0x541619=0xc8;}else{_0x541619=0xce;}_0x5c84b0[_0x16f6('0x1a')](_0x541619);return _0x5c84b0[_0x16f6('0x1f')](_0x16f6('0x20'),_0x578e30+'-'+_0x35fedb+'/'+_0x5a528a)[_0x16f6('0x21')](_0x10582c);}return null;};}function patchUpdates(_0x370332){return function(_0x16a56c){try{jsonpatch[_0x16f6('0x22')](_0x16a56c,_0x370332,!![]);}catch(_0x44e8a0){return BPromise[_0x16f6('0x23')](_0x44e8a0);}return _0x16a56c[_0x16f6('0x24')]();};}function saveUpdates(_0x5748be,_0x4b9d8c){return function(_0x3c74cb){if(_0x3c74cb){return _0x3c74cb['update'](_0x5748be)['then'](function(_0x4a43c7){return _0x4a43c7;});}return null;};}function removeEntity(_0x59bc70,_0x31c161){return function(_0x325c50){if(_0x325c50){return _0x325c50[_0x16f6('0x25')]()[_0x16f6('0x26')](function(){_0x59bc70[_0x16f6('0x1a')](0xcc)[_0x16f6('0x27')]();});}};}function handleEntityNotFound(_0x468091,_0x5be2be){return function(_0x406487){if(!_0x406487){_0x468091[_0x16f6('0x28')](0x194);}return _0x406487;};}function handleError(_0x4ad045,_0x478599){_0x478599=_0x478599||0x1f4;return function(_0x38dc02){logger[_0x16f6('0x29')](_0x38dc02[_0x16f6('0x2a')]);if(_0x38dc02[_0x16f6('0x2b')]){delete _0x38dc02[_0x16f6('0x2b')];}_0x4ad045['status'](_0x478599)['send'](_0x38dc02);};}exports[_0x16f6('0x2c')]=function(_0x2954ca,_0x42cba7){var _0x34c46d={},_0x55ecc9={},_0x569928={'count':0x0,'rows':[]};var _0x4f510d=_[_0x16f6('0x2d')](db['Attachment'][_0x16f6('0x2e')],function(_0x2d4c0a){return{'name':_0x2d4c0a[_0x16f6('0x2f')],'type':_0x2d4c0a[_0x16f6('0x30')][_0x16f6('0x31')]};});_0x55ecc9['model']=_['map'](_0x4f510d,_0x16f6('0x2b'));_0x55ecc9[_0x16f6('0x32')]=_['keys'](_0x2954ca['query']);_0x55ecc9[_0x16f6('0x33')]=_[_0x16f6('0x34')](_0x55ecc9[_0x16f6('0x35')],_0x55ecc9[_0x16f6('0x32')]);_0x34c46d[_0x16f6('0x36')]=_[_0x16f6('0x34')](_0x55ecc9['model'],qs[_0x16f6('0x37')](_0x2954ca[_0x16f6('0x32')][_0x16f6('0x37')]));_0x34c46d[_0x16f6('0x36')]=_0x34c46d[_0x16f6('0x36')][_0x16f6('0x38')]?_0x34c46d[_0x16f6('0x36')]:_0x55ecc9[_0x16f6('0x35')];if(!_0x2954ca['query'][_0x16f6('0x39')]('nolimit')){_0x34c46d[_0x16f6('0x1d')]=qs['limit'](_0x2954ca[_0x16f6('0x32')][_0x16f6('0x1d')]);_0x34c46d[_0x16f6('0x1b')]=qs[_0x16f6('0x1b')](_0x2954ca['query'][_0x16f6('0x1b')]);}_0x34c46d[_0x16f6('0x3a')]=qs['sort'](_0x2954ca[_0x16f6('0x32')][_0x16f6('0x3b')]);_0x34c46d[_0x16f6('0x3c')]=qs['filters'](_[_0x16f6('0x3d')](_0x2954ca['query'],_0x55ecc9[_0x16f6('0x33')]),_0x4f510d);if(_0x2954ca[_0x16f6('0x32')]['filter']){_0x34c46d[_0x16f6('0x3c')]=_[_0x16f6('0x3e')](_0x34c46d[_0x16f6('0x3c')],{'$or':_['map'](_0x4f510d,function(_0x414509){if(_0x414509[_0x16f6('0x30')]!=='VIRTUAL'){var _0x5a52f7={};_0x5a52f7[_0x414509[_0x16f6('0x2b')]]={'$like':'%'+_0x2954ca[_0x16f6('0x32')]['filter']+'%'};return _0x5a52f7;}})});}_0x34c46d=_[_0x16f6('0x3e')]({},_0x34c46d,_0x2954ca[_0x16f6('0x3f')]);var _0xef0a0a={'where':_0x34c46d['where']};return db[_0x16f6('0x40')][_0x16f6('0x1e')](_0xef0a0a)[_0x16f6('0x26')](function(_0x13a2f7){_0x569928['count']=_0x13a2f7;if(_0x2954ca['query'][_0x16f6('0x41')]){_0x34c46d[_0x16f6('0x42')]=[{'all':!![]}];}return db[_0x16f6('0x40')]['findAll'](_0x34c46d);})['then'](function(_0x256bc3){_0x569928[_0x16f6('0x43')]=_0x256bc3;return _0x569928;})[_0x16f6('0x26')](respondWithFilteredResult(_0x42cba7,_0x34c46d))[_0x16f6('0x44')](handleError(_0x42cba7,null));};exports[_0x16f6('0x45')]=function(_0x169371,_0x478ee0){var _0x27ed48={'raw':!![],'where':{'id':_0x169371[_0x16f6('0x46')]['id']}},_0x219d7d={};_0x219d7d[_0x16f6('0x35')]=_[_0x16f6('0x47')](db[_0x16f6('0x40')][_0x16f6('0x2e')]);_0x219d7d['query']=_['keys'](_0x169371[_0x16f6('0x32')]);_0x219d7d[_0x16f6('0x33')]=_['intersection'](_0x219d7d[_0x16f6('0x35')],_0x219d7d['query']);_0x27ed48[_0x16f6('0x36')]=_[_0x16f6('0x34')](_0x219d7d[_0x16f6('0x35')],qs[_0x16f6('0x37')](_0x169371[_0x16f6('0x32')][_0x16f6('0x37')]));_0x27ed48['attributes']=_0x27ed48[_0x16f6('0x36')]['length']?_0x27ed48[_0x16f6('0x36')]:_0x219d7d[_0x16f6('0x35')];if(_0x169371[_0x16f6('0x32')]['includeAll']){_0x27ed48[_0x16f6('0x42')]=[{'all':!![]}];}_0x27ed48=_[_0x16f6('0x3e')]({},_0x27ed48,_0x169371[_0x16f6('0x3f')]);return db[_0x16f6('0x40')][_0x16f6('0x48')](_0x27ed48)[_0x16f6('0x26')](handleEntityNotFound(_0x478ee0,null))[_0x16f6('0x26')](respondWithResult(_0x478ee0,null))[_0x16f6('0x44')](handleError(_0x478ee0,null));};exports[_0x16f6('0x49')]=function(_0x176840,_0x4aa7c1){var _0x746270={'where':{'id':_0x176840['params']['id']}},_0x3da469={};_0x3da469[_0x16f6('0x35')]=_[_0x16f6('0x47')](db[_0x16f6('0x40')]['rawAttributes']);_0x746270[_0x16f6('0x36')]=_[_0x16f6('0x34')](_0x3da469['model'],qs[_0x16f6('0x37')](_0x176840['query'][_0x16f6('0x37')]));_0x746270[_0x16f6('0x36')]=_0x746270[_0x16f6('0x36')]['length']?_0x746270[_0x16f6('0x36')]:_0x3da469['model'];if(_0x176840['query'][_0x16f6('0x41')]){_0x746270[_0x16f6('0x42')]=[{'all':!![]}];}_0x746270=_[_0x16f6('0x3e')]({},_0x746270,_0x176840['options']);return db[_0x16f6('0x40')][_0x16f6('0x48')](_0x746270)[_0x16f6('0x26')](handleEntityNotFound(_0x4aa7c1,null))[_0x16f6('0x26')](function(_0x34038e){if(_0x34038e){var _0x1a612f=_0x34038e[_0x16f6('0x4a')]({'plain':!![]});_0x1a612f=qs[_0x16f6('0x4b')](_0x1a612f,['id',_0x16f6('0x4c'),_0x16f6('0x4d')]);_0x176840[_0x16f6('0x4e')]=_[_0x16f6('0x4b')](_0x176840[_0x16f6('0x4e')],['id','createdAt',_0x16f6('0x4d')]);return db[_0x16f6('0x40')][_0x16f6('0x4f')](_[_0x16f6('0x3e')](_0x1a612f,_0x176840[_0x16f6('0x4e')]),{'include':_0x176840[_0x16f6('0x32')][_0x16f6('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4aa7c1,0xc9))[_0x16f6('0x44')](handleError(_0x4aa7c1,null));};exports[_0x16f6('0x50')]=function(_0x53ea72,_0x3a637a){if(_0x53ea72[_0x16f6('0x4e')]['id']){delete _0x53ea72[_0x16f6('0x4e')]['id'];}return db['Attachment'][_0x16f6('0x48')]({'where':{'id':_0x53ea72[_0x16f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a637a,null))[_0x16f6('0x26')](saveUpdates(_0x53ea72[_0x16f6('0x4e')],null))[_0x16f6('0x26')](respondWithResult(_0x3a637a,null))[_0x16f6('0x44')](handleError(_0x3a637a,null));};exports['destroy']=function(_0x216154,_0x41b142){return db[_0x16f6('0x40')][_0x16f6('0x48')]({'where':{'id':_0x216154[_0x16f6('0x46')]['id']}})[_0x16f6('0x26')](handleEntityNotFound(_0x41b142,null))[_0x16f6('0x26')](removeEntity(_0x41b142,null))['catch'](handleError(_0x41b142,null));};exports['create']=function(_0x19b252,_0x3b4fd5,_0x183d5e){_0x19b252[_0x16f6('0x4e')][_0x16f6('0x2b')]=_0x19b252['file']['originalname'];_0x19b252[_0x16f6('0x4e')][_0x16f6('0x51')]=_0x19b252[_0x16f6('0x52')][_0x16f6('0x53')];_0x19b252[_0x16f6('0x4e')][_0x16f6('0x30')]=_0x19b252[_0x16f6('0x52')][_0x16f6('0x54')];return db[_0x16f6('0x40')][_0x16f6('0x4f')](_0x19b252[_0x16f6('0x4e')])[_0x16f6('0x26')](respondWithResult(_0x3b4fd5,0xc9))[_0x16f6('0x44')](handleError(_0x3b4fd5,null));};exports[_0x16f6('0x55')]=function(_0x24e851,_0x2e8699,_0x5efe4d){return db[_0x16f6('0x40')][_0x16f6('0x56')]({'where':{'id':_0x24e851[_0x16f6('0x46')]['id']},'raw':!![]})[_0x16f6('0x26')](handleEntityNotFound(_0x2e8699,null))[_0x16f6('0x26')](function(_0x395d4b){if(_0x395d4b){var _0x21c608=_0x395d4b[_0x16f6('0x57')]!==null;var _0x160ca3=path[_0x16f6('0x58')](config[_0x16f6('0x59')],_0x16f6('0x5a'));if(_0x21c608){_0x160ca3=path[_0x16f6('0x58')](_0x160ca3,_0x16f6('0x5b'));}var _0x1b39a3=path['join'](_0x160ca3,_0x395d4b[_0x16f6('0x51')]);return _0x2e8699[_0x16f6('0x55')](_0x1b39a3);}})['catch'](handleError(_0x2e8699,null));}; \ No newline at end of file +var _0xd9fc=['mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Attachment','include','findAll','catch','show','keys','includeAll','find','params','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','offline-chat/','join','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x1376d9,_0x55674d){var _0x52ef9c=function(_0x43265a){while(--_0x43265a){_0x1376d9['push'](_0x1376d9['shift']());}};_0x52ef9c(++_0x55674d);}(_0xd9fc,0x1a4));var _0xcd9f=function(_0x5ac654,_0x117532){_0x5ac654=_0x5ac654-0x0;var _0x3a47e7=_0xd9fc[_0x5ac654];return _0x3a47e7;};'use strict';var emlformat=require(_0xcd9f('0x0'));var rimraf=require(_0xcd9f('0x1'));var zipdir=require(_0xcd9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9f('0x3'));var moment=require(_0xcd9f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd9f('0x5'));var util=require('util');var path=require(_0xcd9f('0x6'));var sox=require(_0xcd9f('0x7'));var csv=require(_0xcd9f('0x8'));var ejs=require(_0xcd9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9f('0xa'));var squel=require(_0xcd9f('0xb'));var crypto=require(_0xcd9f('0xc'));var jsforce=require(_0xcd9f('0xd'));var deskjs=require(_0xcd9f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd9f('0xf'));var authService=require(_0xcd9f('0x10'));var qs=require(_0xcd9f('0x11'));var as=require(_0xcd9f('0x12'));var hardwareService=require(_0xcd9f('0x13'));var logger=require(_0xcd9f('0x14'))(_0xcd9f('0x15'));var utils=require(_0xcd9f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9f('0x17'));var db=require(_0xcd9f('0x18'))['db'];function respondWithStatusCode(_0x458c1c,_0x4fbce6){_0x4fbce6=_0x4fbce6||0xcc;return function(_0x405a32){if(_0x405a32){return _0x458c1c[_0xcd9f('0x19')](_0x4fbce6);}return _0x458c1c[_0xcd9f('0x1a')](_0x4fbce6)[_0xcd9f('0x1b')]();};}function respondWithResult(_0x401c4a,_0x47a119){_0x47a119=_0x47a119||0xc8;return function(_0x4e7571){if(_0x4e7571){return _0x401c4a['status'](_0x47a119)[_0xcd9f('0x1c')](_0x4e7571);}};}function respondWithFilteredResult(_0x7130fe,_0x50d27c){return function(_0x53c78b){if(_0x53c78b){var _0x29ee11=typeof _0x50d27c[_0xcd9f('0x1d')]===_0xcd9f('0x1e')&&typeof _0x50d27c[_0xcd9f('0x1f')]==='undefined';var _0x2d1fd7=_0x53c78b[_0xcd9f('0x20')];var _0xb8a7c1=_0x29ee11?0x0:_0x50d27c[_0xcd9f('0x1d')];var _0xed956b=_0x29ee11?_0x53c78b[_0xcd9f('0x20')]:_0x50d27c[_0xcd9f('0x1d')]+_0x50d27c[_0xcd9f('0x1f')];var _0x3b05dc;if(_0xed956b>=_0x2d1fd7){_0xed956b=_0x2d1fd7;_0x3b05dc=0xc8;}else{_0x3b05dc=0xce;}_0x7130fe[_0xcd9f('0x1a')](_0x3b05dc);return _0x7130fe[_0xcd9f('0x21')]('Content-Range',_0xb8a7c1+'-'+_0xed956b+'/'+_0x2d1fd7)['json'](_0x53c78b);}return null;};}function patchUpdates(_0x2f36c1){return function(_0x188407){try{jsonpatch[_0xcd9f('0x22')](_0x188407,_0x2f36c1,!![]);}catch(_0x3d5e5f){return BPromise['reject'](_0x3d5e5f);}return _0x188407['save']();};}function saveUpdates(_0x3d4d24,_0x2b826d){return function(_0xc9df26){if(_0xc9df26){return _0xc9df26[_0xcd9f('0x23')](_0x3d4d24)[_0xcd9f('0x24')](function(_0x4ddc1b){return _0x4ddc1b;});}return null;};}function removeEntity(_0x561057,_0x3d5552){return function(_0x5c1736){if(_0x5c1736){return _0x5c1736[_0xcd9f('0x25')]()[_0xcd9f('0x24')](function(){_0x561057[_0xcd9f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5398a2,_0x56c2da){return function(_0x1fe495){if(!_0x1fe495){_0x5398a2[_0xcd9f('0x19')](0x194);}return _0x1fe495;};}function handleError(_0x357592,_0x3cf628){_0x3cf628=_0x3cf628||0x1f4;return function(_0xd7b2a8){logger[_0xcd9f('0x26')](_0xd7b2a8[_0xcd9f('0x27')]);if(_0xd7b2a8[_0xcd9f('0x28')]){delete _0xd7b2a8['name'];}_0x357592[_0xcd9f('0x1a')](_0x3cf628)['send'](_0xd7b2a8);};}exports[_0xcd9f('0x29')]=function(_0xbdcf09,_0x30193d){var _0x40c1a6={},_0x347b52={},_0x5ca88a={'count':0x0,'rows':[]};var _0xc1785=_[_0xcd9f('0x2a')](db['Attachment'][_0xcd9f('0x2b')],function(_0xb3ace4){return{'name':_0xb3ace4['fieldName'],'type':_0xb3ace4[_0xcd9f('0x2c')]['key']};});_0x347b52[_0xcd9f('0x2d')]=_[_0xcd9f('0x2a')](_0xc1785,_0xcd9f('0x28'));_0x347b52['query']=_['keys'](_0xbdcf09[_0xcd9f('0x2e')]);_0x347b52['filters']=_[_0xcd9f('0x2f')](_0x347b52[_0xcd9f('0x2d')],_0x347b52[_0xcd9f('0x2e')]);_0x40c1a6[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0x347b52['model'],qs[_0xcd9f('0x31')](_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x31')]));_0x40c1a6[_0xcd9f('0x30')]=_0x40c1a6[_0xcd9f('0x30')][_0xcd9f('0x32')]?_0x40c1a6[_0xcd9f('0x30')]:_0x347b52['model'];if(!_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x33')](_0xcd9f('0x34'))){_0x40c1a6[_0xcd9f('0x1f')]=qs[_0xcd9f('0x1f')](_0xbdcf09[_0xcd9f('0x2e')]['limit']);_0x40c1a6[_0xcd9f('0x1d')]=qs['offset'](_0xbdcf09['query'][_0xcd9f('0x1d')]);}_0x40c1a6[_0xcd9f('0x35')]=qs[_0xcd9f('0x36')](_0xbdcf09['query'][_0xcd9f('0x36')]);_0x40c1a6[_0xcd9f('0x37')]=qs[_0xcd9f('0x38')](_[_0xcd9f('0x39')](_0xbdcf09['query'],_0x347b52['filters']),_0xc1785);if(_0xbdcf09['query'][_0xcd9f('0x3a')]){_0x40c1a6['where']=_[_0xcd9f('0x3b')](_0x40c1a6['where'],{'$or':_[_0xcd9f('0x2a')](_0xc1785,function(_0x30a01c){if(_0x30a01c[_0xcd9f('0x2c')]!==_0xcd9f('0x3c')){var _0x4eb31d={};_0x4eb31d[_0x30a01c[_0xcd9f('0x28')]]={'$like':'%'+_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x3a')]+'%'};return _0x4eb31d;}})});}_0x40c1a6=_['merge']({},_0x40c1a6,_0xbdcf09[_0xcd9f('0x3d')]);var _0x1e3dc1={'where':_0x40c1a6[_0xcd9f('0x37')]};return db[_0xcd9f('0x3e')][_0xcd9f('0x20')](_0x1e3dc1)[_0xcd9f('0x24')](function(_0x48ad4d){_0x5ca88a[_0xcd9f('0x20')]=_0x48ad4d;if(_0xbdcf09['query']['includeAll']){_0x40c1a6[_0xcd9f('0x3f')]=[{'all':!![]}];}return db[_0xcd9f('0x3e')][_0xcd9f('0x40')](_0x40c1a6);})[_0xcd9f('0x24')](function(_0x2049be){_0x5ca88a['rows']=_0x2049be;return _0x5ca88a;})[_0xcd9f('0x24')](respondWithFilteredResult(_0x30193d,_0x40c1a6))[_0xcd9f('0x41')](handleError(_0x30193d,null));};exports[_0xcd9f('0x42')]=function(_0x47b740,_0x331c7e){var _0x4d0d61={'raw':!![],'where':{'id':_0x47b740['params']['id']}},_0x4f1d50={};_0x4f1d50[_0xcd9f('0x2d')]=_[_0xcd9f('0x43')](db[_0xcd9f('0x3e')][_0xcd9f('0x2b')]);_0x4f1d50[_0xcd9f('0x2e')]=_['keys'](_0x47b740[_0xcd9f('0x2e')]);_0x4f1d50[_0xcd9f('0x38')]=_[_0xcd9f('0x2f')](_0x4f1d50[_0xcd9f('0x2d')],_0x4f1d50['query']);_0x4d0d61[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0x4f1d50[_0xcd9f('0x2d')],qs[_0xcd9f('0x31')](_0x47b740['query']['fields']));_0x4d0d61[_0xcd9f('0x30')]=_0x4d0d61[_0xcd9f('0x30')]['length']?_0x4d0d61[_0xcd9f('0x30')]:_0x4f1d50['model'];if(_0x47b740[_0xcd9f('0x2e')][_0xcd9f('0x44')]){_0x4d0d61[_0xcd9f('0x3f')]=[{'all':!![]}];}_0x4d0d61=_['merge']({},_0x4d0d61,_0x47b740[_0xcd9f('0x3d')]);return db[_0xcd9f('0x3e')][_0xcd9f('0x45')](_0x4d0d61)[_0xcd9f('0x24')](handleEntityNotFound(_0x331c7e,null))['then'](respondWithResult(_0x331c7e,null))[_0xcd9f('0x41')](handleError(_0x331c7e,null));};exports['clone']=function(_0x503c31,_0x3ed8ec){var _0x3d6e53={'where':{'id':_0x503c31[_0xcd9f('0x46')]['id']}},_0xe17dbd={};_0xe17dbd['model']=_[_0xcd9f('0x43')](db[_0xcd9f('0x3e')][_0xcd9f('0x2b')]);_0x3d6e53[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0xe17dbd[_0xcd9f('0x2d')],qs[_0xcd9f('0x31')](_0x503c31[_0xcd9f('0x2e')][_0xcd9f('0x31')]));_0x3d6e53['attributes']=_0x3d6e53[_0xcd9f('0x30')][_0xcd9f('0x32')]?_0x3d6e53[_0xcd9f('0x30')]:_0xe17dbd[_0xcd9f('0x2d')];if(_0x503c31[_0xcd9f('0x2e')][_0xcd9f('0x44')]){_0x3d6e53['include']=[{'all':!![]}];}_0x3d6e53=_[_0xcd9f('0x3b')]({},_0x3d6e53,_0x503c31[_0xcd9f('0x3d')]);return db[_0xcd9f('0x3e')]['find'](_0x3d6e53)['then'](handleEntityNotFound(_0x3ed8ec,null))[_0xcd9f('0x24')](function(_0x3c98aa){if(_0x3c98aa){var _0x1b993c=_0x3c98aa['get']({'plain':!![]});_0x1b993c=qs['omit'](_0x1b993c,['id',_0xcd9f('0x47'),_0xcd9f('0x48')]);_0x503c31[_0xcd9f('0x49')]=_['omit'](_0x503c31[_0xcd9f('0x49')],['id','createdAt',_0xcd9f('0x48')]);return db[_0xcd9f('0x3e')][_0xcd9f('0x4a')](_['merge'](_0x1b993c,_0x503c31[_0xcd9f('0x49')]),{'include':_0x503c31['query'][_0xcd9f('0x44')]?[{'all':!![]}]:undefined});}})[_0xcd9f('0x24')](respondWithResult(_0x3ed8ec,0xc9))[_0xcd9f('0x41')](handleError(_0x3ed8ec,null));};exports['update']=function(_0x54e6d0,_0x4ca296){if(_0x54e6d0[_0xcd9f('0x49')]['id']){delete _0x54e6d0['body']['id'];}return db[_0xcd9f('0x3e')][_0xcd9f('0x45')]({'where':{'id':_0x54e6d0[_0xcd9f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ca296,null))[_0xcd9f('0x24')](saveUpdates(_0x54e6d0[_0xcd9f('0x49')],null))['then'](respondWithResult(_0x4ca296,null))[_0xcd9f('0x41')](handleError(_0x4ca296,null));};exports[_0xcd9f('0x25')]=function(_0x56ac17,_0x5b2367){return db['Attachment'][_0xcd9f('0x45')]({'where':{'id':_0x56ac17[_0xcd9f('0x46')]['id']}})[_0xcd9f('0x24')](handleEntityNotFound(_0x5b2367,null))[_0xcd9f('0x24')](removeEntity(_0x5b2367,null))[_0xcd9f('0x41')](handleError(_0x5b2367,null));};exports[_0xcd9f('0x4a')]=function(_0x7e0795,_0x6bda16,_0x2c866e){_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x28')]=_0x7e0795['file'][_0xcd9f('0x4b')];_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x4c')]=_0x7e0795[_0xcd9f('0x4d')][_0xcd9f('0x4e')];_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x2c')]=_0x7e0795[_0xcd9f('0x4d')][_0xcd9f('0x4f')];return db['Attachment'][_0xcd9f('0x4a')](_0x7e0795['body'])[_0xcd9f('0x24')](respondWithResult(_0x6bda16,0xc9))['catch'](handleError(_0x6bda16,null));};exports[_0xcd9f('0x50')]=function(_0x51aeca,_0x88162,_0xcdda62){return db[_0xcd9f('0x3e')][_0xcd9f('0x51')]({'where':{'id':_0x51aeca[_0xcd9f('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x88162,null))[_0xcd9f('0x24')](function(_0x1d997c){if(_0x1d997c){var _0xe3c944=_0x1d997c[_0xcd9f('0x52')]!==null;var _0x3b7681=path['join'](config['root'],'server/files/attachments/');if(_0xe3c944){_0x3b7681=path['join'](_0x3b7681,_0xcd9f('0x53'));}var _0x1b5b5f=path[_0xcd9f('0x54')](_0x3b7681,_0x1d997c[_0xcd9f('0x4c')]);return _0x88162[_0xcd9f('0x50')](_0x1b5b5f);}})[_0xcd9f('0x41')](handleError(_0x88162,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0f786b3..eb98b8c 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b67=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x26910e,_0x40184a){var _0x2c35bd=function(_0x42c9c7){while(--_0x42c9c7){_0x26910e['push'](_0x26910e['shift']());}};_0x2c35bd(++_0x40184a);}(_0x2b67,0x160));var _0x72b6=function(_0x5298f9,_0x4284b3){_0x5298f9=_0x5298f9-0x0;var _0x110fc1=_0x2b67[_0x5298f9];return _0x110fc1;};'use strict';var _=require(_0x72b6('0x0'));var util=require(_0x72b6('0x1'));var logger=require(_0x72b6('0x2'))(_0x72b6('0x3'));var moment=require(_0x72b6('0x4'));var BPromise=require(_0x72b6('0x5'));var rp=require(_0x72b6('0x6'));var fs=require('fs');var path=require(_0x72b6('0x7'));var rimraf=require(_0x72b6('0x8'));var config=require(_0x72b6('0x9'));var attributes=require(_0x72b6('0xa'));module[_0x72b6('0xb')]=function(_0x3075c1,_0xff31af){return _0x3075c1['define'](_0x72b6('0xc'),attributes,{'tableName':_0x72b6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbafb=['./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1a50e5,_0x14accb){var _0x53b463=function(_0x12df94){while(--_0x12df94){_0x1a50e5['push'](_0x1a50e5['shift']());}};_0x53b463(++_0x14accb);}(_0xbafb,0xbb));var _0xbbaf=function(_0x4a487f,_0x1b575c){_0x4a487f=_0x4a487f-0x0;var _0x446541=_0xbafb[_0x4a487f];return _0x446541;};'use strict';var _=require(_0xbbaf('0x0'));var util=require('util');var logger=require(_0xbbaf('0x1'))(_0xbbaf('0x2'));var moment=require(_0xbbaf('0x3'));var BPromise=require(_0xbbaf('0x4'));var rp=require(_0xbbaf('0x5'));var fs=require('fs');var path=require(_0xbbaf('0x6'));var rimraf=require('rimraf');var config=require(_0xbbaf('0x7'));var attributes=require(_0xbbaf('0x8'));module[_0xbbaf('0x9')]=function(_0x64d333,_0x577ccb){return _0x64d333[_0xbbaf('0xa')](_0xbbaf('0xb'),attributes,{'tableName':_0xbbaf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 9bc12ae..cd0181f 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dc2=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27dc('0x0'));var BPromise=require(_0x27dc('0x1'));var rs=require(_0x27dc('0x2'));var fs=require('fs');var Redis=require(_0x27dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27dc('0x4'));var logger=require(_0x27dc('0x5'))('rpc');var config=require(_0x27dc('0x6'));var jayson=require(_0x27dc('0x7'));var client=jayson['client'][_0x27dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2e10,_0x95bbb6,_0x3b3eee){return new BPromise(function(_0x5181ab,_0x45aa07){return client[_0x27dc('0x9')](_0x4d2e10,_0x3b3eee)[_0x27dc('0xa')](function(_0x242997){logger['info'](_0x27dc('0xb'),_0x95bbb6,'request\x20sent');logger[_0x27dc('0xc')](_0x27dc('0xd'),_0x95bbb6,_0x27dc('0xe'),JSON['stringify'](_0x242997));if(_0x242997['error']){if(_0x242997[_0x27dc('0xf')][_0x27dc('0x10')]===0x1f4){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x242997['error'][_0x27dc('0x11')]);return _0x45aa07(_0x242997['error'][_0x27dc('0x11')]);}logger['error'](_0x27dc('0xb'),_0x95bbb6,_0x242997[_0x27dc('0xf')][_0x27dc('0x11')]);return _0x5181ab(_0x242997[_0x27dc('0xf')]['message']);}else{logger[_0x27dc('0x12')](_0x27dc('0xb'),_0x95bbb6,_0x27dc('0xe'));_0x5181ab(_0x242997[_0x27dc('0x13')][_0x27dc('0x11')]);}})['catch'](function(_0x3ff8f8){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x3ff8f8);_0x45aa07(_0x3ff8f8);});});}exports[_0x27dc('0x14')]=function(_0x5d308b){var _0x5ecb19=this;return new Promise(function(_0x1ff9a2,_0x225b2c){return db[_0x27dc('0x15')][_0x27dc('0x16')](_0x5d308b[_0x27dc('0x17')],{'raw':_0x5d308b[_0x27dc('0x18')]?_0x5d308b[_0x27dc('0x18')][_0x27dc('0x19')]===undefined?!![]:![]:!![]})[_0x27dc('0xa')](function(_0x5064d5){logger[_0x27dc('0x12')](_0x27dc('0x14'),_0x5d308b);logger['debug'](_0x27dc('0x14'),_0x5d308b,JSON['stringify'](_0x5064d5));_0x1ff9a2(_0x5064d5);})['catch'](function(_0x2843b1){logger['error'](_0x27dc('0x14'),_0x2843b1['message'],_0x5d308b);_0x225b2c(_0x5ecb19['error'](0x1f4,_0x2843b1[_0x27dc('0x11')]));});});}; \ No newline at end of file +var _0x1ddc=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','CreateAttachment','util','moment'];(function(_0x6b8671,_0x23fdb0){var _0x33c700=function(_0x52c831){while(--_0x52c831){_0x6b8671['push'](_0x6b8671['shift']());}};_0x33c700(++_0x23fdb0);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x5934be,_0x2007e0){_0x5934be=_0x5934be-0x0;var _0x2a9489=_0x1ddc[_0x5934be];return _0x2a9489;};'use strict';var _=require('lodash');var util=require(_0xc1dd('0x0'));var moment=require(_0xc1dd('0x1'));var BPromise=require(_0xc1dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dd('0x3'));var db=require(_0xc1dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1dd('0x5'))(_0xc1dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1dd('0x7'));var client=jayson[_0xc1dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3938ff,_0x25c543,_0x593de5){return new BPromise(function(_0x54819b,_0x411452){return client[_0xc1dd('0x9')](_0x3938ff,_0x593de5)[_0xc1dd('0xa')](function(_0x217d07){logger['info'](_0xc1dd('0xb'),_0x25c543,_0xc1dd('0xc'));logger[_0xc1dd('0xd')](_0xc1dd('0xe'),_0x25c543,'request\x20sent',JSON[_0xc1dd('0xf')](_0x217d07));if(_0x217d07[_0xc1dd('0x10')]){if(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x11')]===0x1f4){logger[_0xc1dd('0x10')](_0xc1dd('0xb'),_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x411452(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}logger[_0xc1dd('0x10')]('Attachment,\x20%s,\x20%s',_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x54819b(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}else{logger[_0xc1dd('0x13')]('Attachment,\x20%s,\x20%s',_0x25c543,_0xc1dd('0xc'));_0x54819b(_0x217d07[_0xc1dd('0x14')][_0xc1dd('0x12')]);}})[_0xc1dd('0x15')](function(_0x5815d3){logger['error'](_0xc1dd('0xb'),_0x25c543,_0x5815d3);_0x411452(_0x5815d3);});});}exports['CreateAttachment']=function(_0x35139a){var _0x4c3114=this;return new Promise(function(_0x6198a7,_0x24446f){return db[_0xc1dd('0x16')][_0xc1dd('0x17')](_0x35139a[_0xc1dd('0x18')],{'raw':_0x35139a[_0xc1dd('0x19')]?_0x35139a['options'][_0xc1dd('0x1a')]===undefined?!![]:![]:!![]})[_0xc1dd('0xa')](function(_0x5e99a6){logger[_0xc1dd('0x13')](_0xc1dd('0x1b'),_0x35139a);logger[_0xc1dd('0xd')](_0xc1dd('0x1b'),_0x35139a,JSON[_0xc1dd('0xf')](_0x5e99a6));_0x6198a7(_0x5e99a6);})[_0xc1dd('0x15')](function(_0x228626){logger[_0xc1dd('0x10')]('CreateAttachment',_0x228626[_0xc1dd('0x12')],_0x35139a);_0x24446f(_0x4c3114[_0xc1dd('0x10')](0x1f4,_0x228626[_0xc1dd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1d34e74..2da8622 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3789b9,_0x5c2f00){_0x3789b9=_0x3789b9-0x0;var _0x4d020d=_0x0b0e[_0x3789b9];return _0x4d020d;};'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['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=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(_0x4742c0,_0x2ddc6c){var _0x168d97=function(_0x48b24e){while(--_0x48b24e){_0x4742c0['push'](_0x4742c0['shift']());}};_0x168d97(++_0x2ddc6c);}(_0x2032,0xd9));var _0x2203=function(_0x53ad28,_0x3bfd56){_0x53ad28=_0x53ad28-0x0;var _0x4d7c13=_0x2032[_0x53ad28];return _0x4d7c13;};'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 diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 6d9e07f..cf1b682 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60f5=['error','Error\x20authenticate\x20%s:\x20%s','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','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','blockDuration','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','Strategy','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','activedirectory','undefined','baseDN','url','domain','authenticate'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x60f5,0x8b));var _0x560f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x60f5[_0x3b380d];return _0x54502b;};'use strict';var passport=require(_0x560f('0x0'));var LocalStrategy=require(_0x560f('0x1'))[_0x560f('0x2')];var moment=require(_0x560f('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x560f('0x4'));var db=require(_0x560f('0x5'))['db'];var authService=require(_0x560f('0x6'));var utils=require(_0x560f('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x25eb71){var _0x7ec0bc=![];if(typeof _0x25eb71[_0x560f('0x8')]!==_0x560f('0x9')){_0x7ec0bc=_0x25eb71['activedirectory'][_0x560f('0xa')]&&_0x25eb71[_0x560f('0x8')][_0x560f('0xb')]&&_0x25eb71['activedirectory'][_0x560f('0xc')];}return _0x7ec0bc;}function adAuthenticate(_0x11cbf8,_0x292a57,_0x676d75){return new BPromise(function(_0x5ae83d,_0x604a6b){try{var _0x4780bc=new ActiveDirectory(_0x11cbf8);_0x4780bc[_0x560f('0xd')](_0x292a57,_0x676d75,function(_0x504dee,_0x5645a2){if(_0x504dee){logger[_0x560f('0xe')](_0x560f('0xf'),_0x292a57,util[_0x560f('0x10')](_0x504dee,{'showHidden':![],'depth':null}));_0x604a6b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5645a2){logger[_0x560f('0xe')](_0x560f('0x11'),_0x292a57);_0x604a6b(_0x560f('0x12'));}else{_0x5ae83d(_0x5645a2);}});}catch(_0x40a2aa){_0x604a6b(_0x40a2aa);}});}function ActiveDirectoryAuthenticate(_0x33f246,_0x15a162,_0x2c3eb6,_0xea5fa5){var _0x1640d6,_0x4c4897;if(!isActiveDirectoryConfigured(config)){logger[_0x560f('0xe')](_0x560f('0x13'),_0x15a162);return _0xea5fa5(null,![],{'message':_0x560f('0x12')});}return db[_0x560f('0x14')][_0x560f('0x15')]({'where':{'id':0x1},'attributes':[_0x560f('0x16'),'blockDuration'],'raw':!![]})[_0x560f('0x17')](function(_0x45f811){_0x1640d6=_0x45f811;if(!_0x1640d6['adSsoEnabled']){logger[_0x560f('0xe')](_0x560f('0x18'),_0x15a162);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x33f246[_0x560f('0x15')]({'attributes':['id',_0x560f('0x19'),_0x560f('0x1a'),_0x560f('0x1b'),_0x560f('0x1c'),_0x560f('0x1d'),_0x560f('0x1e'),_0x560f('0x1f'),_0x560f('0x20')],'where':{'name':_0x15a162,'role':{'$or':[_0x560f('0x21'),_0x560f('0x22'),_0x560f('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x5aeef9){if(!_0x5aeef9||_0x5aeef9&&_0x5aeef9['name']!==_0x15a162){throw new Error(_0x560f('0x12'));}_0x4c4897=_0x5aeef9;var _0x29ff51=_0x4c4897[_0x560f('0x19')]+'@'+config[_0x560f('0x8')][_0x560f('0xc')];return adAuthenticate(config['activedirectory'],_0x29ff51,_0x2c3eb6);})[_0x560f('0x17')](function(_0x3642cc){if(_0x4c4897[_0x560f('0x1d')]){throw new Error(_0x560f('0x12'));}if(_0x1640d6[_0x560f('0x24')]>0x0){if(_0x4c4897[_0x560f('0x1e')]){if(moment(_0x4c4897[_0x560f('0x1f')])[_0x560f('0x25')](_0x1640d6[_0x560f('0x24')],_0x560f('0x26'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x560f('0x27')](_0x4c4897,0x0,![],null)[_0x560f('0x17')](function(){return utils[_0x560f('0x28')](_0x4c4897);})[_0x560f('0x17')](function(){return _0xea5fa5(null,_0x4c4897);});}else{return utils[_0x560f('0x28')](_0x4c4897)['then'](function(){return _0xea5fa5(null,_0x4c4897);});}}else{return utils[_0x560f('0x28')](_0x4c4897)[_0x560f('0x17')](function(){return _0xea5fa5(null,_0x4c4897);});}})[_0x560f('0x29')](function(_0x16ec18){return _0xea5fa5(null,![],_0x16ec18);});}function handleError(_0x2d48ab,_0x355a6a,_0x3d6d04){return _0x2d48ab[_0x560f('0x2a')](_0x355a6a||0x1f4)[_0x560f('0x2b')]({'message':_0x3d6d04?_0x3d6d04[_0x560f('0x2c')]||_0x3d6d04:''});}exports[_0x560f('0x2d')]=function(_0x331591,_0x334f6f,_0x1823d7){passport['authenticate'](_0x560f('0x2e'),function(_0x1633f5,_0x3511f3,_0xfb8b01){var _0x5e7df3=_0x1633f5||_0xfb8b01;if(_0x5e7df3){return handleError(_0x334f6f,0x191,_0x5e7df3);}if(!_0x3511f3){return handleError(_0x334f6f,0x194,{'message':_0x560f('0x2f')});}else{var _0x436976={'payload':{'id':_0x3511f3['id'],'role':_0x3511f3[_0x560f('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x560f('0x30')](_0x436976)['then'](function(_0x95e6da){_0x334f6f['json']({'id':_0x3511f3['id'],'token':_0x95e6da,'statusCall':'','isAlreadyLogged':_0x3511f3['online']});});}})(_0x331591,_0x334f6f,_0x1823d7);};passport[_0x560f('0x31')](_0x560f('0x2e'),new LocalStrategy({'usernameField':_0x560f('0x19'),'passwordField':_0x560f('0x1a')},function(_0xc7cab3,_0x4b44e5,_0x411078){return ActiveDirectoryAuthenticate(db[_0x560f('0x32')],_0xc7cab3,_0x4b44e5,_0x411078);})); \ No newline at end of file +var _0x8d01=['moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','api','activedirectory','undefined','baseDN','domain','authenticate','error','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local'];(function(_0x53f1ee,_0x29cff6){var _0x3638da=function(_0x3986a5){while(--_0x3986a5){_0x53f1ee['push'](_0x53f1ee['shift']());}};_0x3638da(++_0x29cff6);}(_0x8d01,0x193));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x18d0('0x0'));var LocalStrategy=require(_0x18d0('0x1'))['Strategy'];var moment=require(_0x18d0('0x2'));var ActiveDirectory=require(_0x18d0('0x3'));var BPromise=require(_0x18d0('0x4'));var util=require(_0x18d0('0x5'));var db=require(_0x18d0('0x6'))['db'];var authService=require(_0x18d0('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x18d0('0x8'));function isActiveDirectoryConfigured(_0x5211ca){var _0x3de2d8=![];if(typeof _0x5211ca[_0x18d0('0x9')]!==_0x18d0('0xa')){_0x3de2d8=_0x5211ca[_0x18d0('0x9')][_0x18d0('0xb')]&&_0x5211ca[_0x18d0('0x9')]['url']&&_0x5211ca[_0x18d0('0x9')][_0x18d0('0xc')];}return _0x3de2d8;}function adAuthenticate(_0x1ed66a,_0x14557f,_0x3319c6){return new BPromise(function(_0x1fc404,_0x4874b1){try{var _0x3f59f7=new ActiveDirectory(_0x1ed66a);_0x3f59f7[_0x18d0('0xd')](_0x14557f,_0x3319c6,function(_0x1375fb,_0x5a2817){if(_0x1375fb){logger[_0x18d0('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x14557f,util['inspect'](_0x1375fb,{'showHidden':![],'depth':null}));_0x4874b1(_0x18d0('0xf'));}else if(!_0x5a2817){logger[_0x18d0('0xe')](_0x18d0('0x10'),_0x14557f);_0x4874b1(_0x18d0('0xf'));}else{_0x1fc404(_0x5a2817);}});}catch(_0x309cef){_0x4874b1(_0x309cef);}});}function ActiveDirectoryAuthenticate(_0x49c6e7,_0x200df5,_0x418374,_0x4bdca5){var _0x278153,_0x5aac21;if(!isActiveDirectoryConfigured(config)){logger[_0x18d0('0xe')](_0x18d0('0x11'),_0x200df5);return _0x4bdca5(null,![],{'message':_0x18d0('0xf')});}return db[_0x18d0('0x12')][_0x18d0('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x18d0('0x14')],'raw':!![]})[_0x18d0('0x15')](function(_0x2d36bd){_0x278153=_0x2d36bd;if(!_0x278153['adSsoEnabled']){logger[_0x18d0('0xe')](_0x18d0('0x16'),_0x200df5);throw new Error(_0x18d0('0xf'));}return _0x49c6e7[_0x18d0('0x13')]({'attributes':['id',_0x18d0('0x17'),_0x18d0('0x18'),_0x18d0('0x19'),_0x18d0('0x1a'),'disabled',_0x18d0('0x1b'),'blockedAt','online'],'where':{'name':_0x200df5,'role':{'$or':['admin',_0x18d0('0x1c'),_0x18d0('0x1d')]},'adSsoEnabled':!![]}});})[_0x18d0('0x15')](function(_0x4bec6a){if(!_0x4bec6a||_0x4bec6a&&_0x4bec6a[_0x18d0('0x17')]!==_0x200df5){throw new Error(_0x18d0('0xf'));}_0x5aac21=_0x4bec6a;var _0x1c164e=_0x5aac21[_0x18d0('0x17')]+'@'+config[_0x18d0('0x9')][_0x18d0('0xc')];return adAuthenticate(config[_0x18d0('0x9')],_0x1c164e,_0x418374);})[_0x18d0('0x15')](function(_0x2c1a76){if(_0x5aac21['disabled']){throw new Error(_0x18d0('0xf'));}if(_0x278153['blockDuration']>0x0){if(_0x5aac21[_0x18d0('0x1b')]){if(moment(_0x5aac21[_0x18d0('0x1e')])[_0x18d0('0x1f')](_0x278153[_0x18d0('0x14')],_0x18d0('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x18d0('0x21')](_0x5aac21,0x0,![],null)[_0x18d0('0x15')](function(){return utils[_0x18d0('0x22')](_0x5aac21);})[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}else{return utils['getLicense'](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}}else{return utils[_0x18d0('0x22')](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}})[_0x18d0('0x23')](function(_0xfdc08f){return _0x4bdca5(null,![],_0xfdc08f);});}function handleError(_0x5c5b78,_0x3dfa94,_0x4cf86e){return _0x5c5b78[_0x18d0('0x24')](_0x3dfa94||0x1f4)['send']({'message':_0x4cf86e?_0x4cf86e[_0x18d0('0x25')]||_0x4cf86e:''});}exports[_0x18d0('0x26')]=function(_0x4fc99e,_0x3f540b,_0x2c94ec){passport[_0x18d0('0xd')](_0x18d0('0x27'),function(_0x224d6a,_0xc0bf90,_0x448507){var _0x132e87=_0x224d6a||_0x448507;if(_0x132e87){return handleError(_0x3f540b,0x191,_0x132e87);}if(!_0xc0bf90){return handleError(_0x3f540b,0x194,{'message':_0x18d0('0x28')});}else{var _0xfa8aa={'payload':{'id':_0xc0bf90['id'],'role':_0xc0bf90[_0x18d0('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x18d0('0x29')](_0xfa8aa)[_0x18d0('0x15')](function(_0x47ec8f){_0x3f540b[_0x18d0('0x2a')]({'id':_0xc0bf90['id'],'token':_0x47ec8f,'statusCall':'','isAlreadyLogged':_0xc0bf90['online']});});}})(_0x4fc99e,_0x3f540b,_0x2c94ec);};passport[_0x18d0('0x2b')](_0x18d0('0x27'),new LocalStrategy({'usernameField':_0x18d0('0x17'),'passwordField':_0x18d0('0x18')},function(_0x2579a1,_0x261d75,_0x30d4c8){return ActiveDirectoryAuthenticate(db[_0x18d0('0x2c')],_0x2579a1,_0x261d75,_0x30d4c8);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 4ac226d..5e88e24 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x034f=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x3c1e23,_0x470bf7){var _0x3a4f60=function(_0x3180b9){while(--_0x3180b9){_0x3c1e23['push'](_0x3c1e23['shift']());}};_0x3a4f60(++_0x470bf7);}(_0x034f,0xc2));var _0xf034=function(_0x4cfb6f,_0x230c48){_0x4cfb6f=_0x4cfb6f-0x0;var _0x29ca2d=_0x034f[_0x4cfb6f];return _0x29ca2d;};'use strict';var express=require(_0xf034('0x0'));var router=express[_0xf034('0x1')]();var controller=require(_0xf034('0x2'));router[_0xf034('0x3')]('/',controller[_0xf034('0x4')]);module[_0xf034('0x5')]=router; \ No newline at end of file +var _0x2e52=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x15f9f8,_0x5d4f86){var _0x49fb6d=function(_0x5e8eb8){while(--_0x5e8eb8){_0x15f9f8['push'](_0x15f9f8['shift']());}};_0x49fb6d(++_0x5d4f86);}(_0x2e52,0x12f));var _0x22e5=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x2e52[_0x45d3f0];return _0x314b79;};'use strict';var express=require(_0x22e5('0x0'));var router=express[_0x22e5('0x1')]();var controller=require(_0x22e5('0x2'));router[_0x22e5('0x3')]('/',controller[_0x22e5('0x4')]);module[_0x22e5('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1913b99..f38ab3d 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xda53f8,_0x2f7376){var _0x1613a1=function(_0x7eb1c3){while(--_0x7eb1c3){_0xda53f8['push'](_0xda53f8['shift']());}};_0x1613a1(++_0x2f7376);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8f73,_0x1a821a){_0x5a8f73=_0x5a8f73-0x0;var _0x1d4f23=_0x7a54[_0x5a8f73];return _0x1d4f23;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6cfb1de..b99c69e 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5327=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','exports','express','passport'];(function(_0x575280,_0x25d860){var _0x11faae=function(_0x369433){while(--_0x369433){_0x575280['push'](_0x575280['shift']());}};_0x11faae(++_0x25d860);}(_0x5327,0x1d2));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x7532('0x0'));var passport=require(_0x7532('0x1'));var router=express['Router']();var controller=require(_0x7532('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x7532('0x3'));router[_0x7532('0x4')]('/',controller[_0x7532('0x5')]);router[_0x7532('0x4')](_0x7532('0x6'),controller[_0x7532('0x7')],authService['isMiddleware'],userController[_0x7532('0x5')],authService['setTokenCookie']);module[_0x7532('0x8')]=router; \ No newline at end of file +var _0x196e=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x8c19a7,_0x5fb122){var _0x1e70cc=function(_0x4d099b){while(--_0x4d099b){_0x8c19a7['push'](_0x8c19a7['shift']());}};_0x1e70cc(++_0x5fb122);}(_0x196e,0xcc));var _0xe196=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0x196e[_0x4c2dfc];return _0xfd728d;};'use strict';var express=require(_0xe196('0x0'));var passport=require(_0xe196('0x1'));var router=express[_0xe196('0x2')]();var controller=require(_0xe196('0x3'));var userController=require(_0xe196('0x4'));var authService=require(_0xe196('0x5'));router['get']('/',controller[_0xe196('0x6')]);router[_0xe196('0x7')](_0xe196('0x8'),controller[_0xe196('0x9')],authService[_0xe196('0xa')],userController[_0xe196('0x6')],authService[_0xe196('0xb')]);module[_0xe196('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d90bd1e..cb43756 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19ba=['catch','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','name','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','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','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','Password\x20reset!','local-login','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19ba,0x125));var _0xa19b=function(_0x192f6d,_0x3d8296){_0x192f6d=_0x192f6d-0x0;var _0x5b6f0f=_0x19ba[_0x192f6d];return _0x5b6f0f;};'use strict';var util=require('util');var passport=require(_0xa19b('0x0'));var LocalStrategy=require(_0xa19b('0x1'))['Strategy'];var jayson=require(_0xa19b('0x2'));var _=require(_0xa19b('0x3'));var rs=require(_0xa19b('0x4'));var moment=require(_0xa19b('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xa19b('0x6'));var utils=require(_0xa19b('0x7'));var client=jayson[_0xa19b('0x8')][_0xa19b('0x9')]({'port':0x232b});function localAuthenticate(_0x5471e2,_0x77e785,_0x2527d4,_0x307251){var _0x3e7dfc,_0x1aefac;return db[_0xa19b('0xa')][_0xa19b('0xb')]({'where':{'id':0x1},'attributes':[_0xa19b('0xc'),'blockDuration'],'raw':!![]})[_0xa19b('0xd')](function(_0x2e88b0){_0x3e7dfc=_0x2e88b0;return _0x5471e2[_0xa19b('0xb')]({'attributes':['id','name',_0xa19b('0xe'),_0xa19b('0xf'),_0xa19b('0x10'),_0xa19b('0x11'),_0xa19b('0x12'),'blockedAt',_0xa19b('0x13')],'where':{'name':_0x77e785,'role':{'$or':[_0xa19b('0x14'),_0xa19b('0x15'),_0xa19b('0x16')]}}});})[_0xa19b('0xd')](function(_0x23b5cb){if(!_0x23b5cb||_0x23b5cb&&_0x23b5cb['name']!==_0x77e785){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1aefac=_0x23b5cb;return _0x1aefac;}})[_0xa19b('0xd')](function(){_0x1aefac[_0xa19b('0x17')](_0x2527d4,function(_0x58475e,_0x32b129){var _0x37617d=_0x1aefac[_0xa19b('0x13')]+0x1;if(_0x58475e){return _0x307251(_0x58475e);}else if(!_0x32b129){if(_0x1aefac[_0xa19b('0x11')]){return _0x307251(null,![],{'message':_0xa19b('0x18')});}else if(_0x3e7dfc[_0xa19b('0xc')]>0x0){if(_0x1aefac['blocked']){if(_0x3e7dfc[_0xa19b('0x19')]>0x0){if(moment(_0x1aefac[_0xa19b('0x1a')])[_0xa19b('0x1b')](_0x3e7dfc[_0xa19b('0x19')],_0xa19b('0x1c'))>moment()){return _0x307251(null,![],{'message':_0xa19b('0x18')});}else{return utils['clearBlockUser'](_0x1aefac,_0x37617d,![],null)[_0xa19b('0xd')](function(){return _0x307251(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x307251(null,![],{'message':_0xa19b('0x18')});}}else{if(_0x37617d>=_0x3e7dfc[_0xa19b('0xc')]){return utils[_0xa19b('0x1d')](_0x1aefac,0x0,!![],moment())[_0xa19b('0xd')](function(){return _0x307251(null,![],{'message':_0xa19b('0x18')});});}else{return utils[_0xa19b('0x1d')](_0x1aefac,_0x37617d,![],null)[_0xa19b('0xd')](function(){return _0x307251(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x307251(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1aefac[_0xa19b('0x11')]){return _0x307251(null,![],{'message':_0xa19b('0x18')});}else if(_0x3e7dfc[_0xa19b('0xc')]>0x0){if(_0x1aefac['blocked']){if(_0x3e7dfc['blockDuration']>0x0){if(moment(_0x1aefac[_0xa19b('0x1a')])[_0xa19b('0x1b')](_0x3e7dfc[_0xa19b('0x19')],_0xa19b('0x1c'))>moment()){return _0x307251(null,![],{'message':_0xa19b('0x18')});}else{return utils[_0xa19b('0x1d')](_0x1aefac,0x0,![],null)[_0xa19b('0xd')](function(){return utils['getLicense'](_0x1aefac);})[_0xa19b('0xd')](function(){return _0x307251(null,_0x1aefac);});}}else{return _0x307251(null,![],{'message':_0xa19b('0x18')});}}else{return utils[_0xa19b('0x1d')](_0x1aefac,0x0,![],null)['then'](function(){return utils[_0xa19b('0x1e')](_0x1aefac);})['then'](function(){return _0x307251(null,_0x1aefac);})[_0xa19b('0x1f')](function(_0x72d42d){return _0x307251(null,![],_0x72d42d);});}}else{if(_0x1aefac[_0xa19b('0x12')]){return _0x307251(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa19b('0x1e')](_0x1aefac)[_0xa19b('0xd')](function(){return _0x307251(null,_0x1aefac);});}}}});})[_0xa19b('0x1f')](function(_0x1adfa2){return _0x307251(null,![],_0x1adfa2);});}function sendServiceMail(_0x4dce8e){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0xa19b('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xa19b('0x21'),'include':[{'model':db[_0xa19b('0x22')],'as':_0xa19b('0x22')}]}]})[_0xa19b('0xd')](function(_0x1a0fff){if(!_0x1a0fff){throw new Error(_0xa19b('0x23'));}var _0x3ec813=_0x1a0fff[_0xa19b('0x24')]();var _0x29cba6={'account':_0x3ec813,'message':_[_0xa19b('0x25')]({'from':util[_0xa19b('0x26')](_0xa19b('0x27'),_0x1a0fff[_0xa19b('0x28')],_0x1a0fff[_0xa19b('0x20')]||_0x1a0fff['Smtp']['user'])},_0x4dce8e)};return client['request'](_0xa19b('0x29'),_0x29cba6);})['then'](function(_0x52e3ae){if(_0x52e3ae[_0xa19b('0x2a')]){throw new Error(util['format'](_0xa19b('0x2b'),_0x52e3ae['error']['message']||JSON[_0xa19b('0x2c')](_0x52e3ae[_0xa19b('0x2a')])));}return!![];});}function handleError(_0x1e3821,_0x5c50ea,_0x5b886c){return _0x1e3821[_0xa19b('0x2d')](_0x5c50ea||0x1f4)[_0xa19b('0x2e')]({'message':_0x5b886c?_0x5b886c[_0xa19b('0x2f')]||_0x5b886c:''});}exports[_0xa19b('0x30')]=function(_0x58900d,_0x35071e,_0x4d464d){passport[_0xa19b('0x17')]('local-login',function(_0x1ad11a,_0x3428cd,_0x2a79d6){var _0x44f543=_0x1ad11a||_0x2a79d6;if(_0x44f543){return handleError(_0x35071e,0x191,_0x44f543);}if(!_0x3428cd){return handleError(_0x35071e,0x194,{'message':_0xa19b('0x31')});}else{var _0x3298a7={'payload':{'id':_0x3428cd['id'],'role':_0x3428cd['role']},'options':{'expiresIn':0x15180}};return authService[_0xa19b('0x32')](_0x3298a7)[_0xa19b('0xd')](function(_0x23c4bd){_0x35071e['json']({'id':_0x3428cd['id'],'token':_0x23c4bd,'statusCall':'','isAlreadyLogged':_0x3428cd[_0xa19b('0x33')]});});}})(_0x58900d,_0x35071e,_0x4d464d);};exports['forgot']=function(_0xeee20e,_0x1d53e8){if(!_0xeee20e[_0xa19b('0x34')][_0xa19b('0x20')]){return handleError(_0x1d53e8,0x1f4,{'message':_0xa19b('0x35')});}var _0x1a1400=rs[_0xa19b('0x36')]();_0xeee20e['body'][_0xa19b('0x20')]=_0xeee20e[_0xa19b('0x34')][_0xa19b('0x20')][_0xa19b('0x37')]()[_0xa19b('0x38')]();var _0x5199c0;return db['Setting'][_0xa19b('0xb')]({'where':{'id':0x1},'attributes':[_0xa19b('0xc'),_0xa19b('0x19')],'raw':!![]})['then'](function(_0x3c711b){_0x5199c0=_0x3c711b;return db[_0xa19b('0x39')]['find']({'where':{'email':_0xeee20e['body'][_0xa19b('0x20')]}});})[_0xa19b('0xd')](function(_0x4b6c44){if(!_0x4b6c44){throw new Error(_0xa19b('0x3a'));}if(_0x4b6c44[_0xa19b('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4b6c44[_0xa19b('0x12')]){if(moment(_0x4b6c44['blockedAt'])[_0xa19b('0x1b')](_0x5199c0['blockDuration'],_0xa19b('0x1c'))>moment()){throw new Error(_0xa19b('0x3b'));}else{_0x4b6c44[_0xa19b('0x12')]=![];_0x4b6c44[_0xa19b('0x1a')]=null;}}_0x4b6c44[_0xa19b('0x3c')]=_0x1a1400;_0x4b6c44[_0xa19b('0x3d')]=Date['now']()+0x36ee80;return _0x4b6c44[_0xa19b('0x3e')]();})[_0xa19b('0xd')](function(){return sendServiceMail({'to':_0xeee20e['body'][_0xa19b('0x20')],'subject':_0xa19b('0x3f'),'text':_0xa19b('0x40')+_0xa19b('0x41')+'https://'+_0xeee20e['headers'][_0xa19b('0x42')]+_0xa19b('0x43')+_0x1a1400+'\x0a\x0a'+_0xa19b('0x44')});})[_0xa19b('0xd')](function(){_0x1d53e8[_0xa19b('0x2d')](0xc8)[_0xa19b('0x2e')]({'message':_0xa19b('0x45')});})['catch'](function(_0x20b29d){return handleError(_0x1d53e8,0x1f4,_0x20b29d);});};exports[_0xa19b('0x46')]=function(_0xde01c9,_0x882552){return db[_0xa19b('0x39')]['find']({'where':{'resetPasswordToken':_0xde01c9[_0xa19b('0x47')][_0xa19b('0x48')],'resetPasswordExpires':{'$gt':Date[_0xa19b('0x49')]()}}})['then'](function(_0x4b579c){if(!_0x4b579c){throw new Error(_0xa19b('0x4a'));}return db[_0xa19b('0xa')]['findOne']({'attributes':['id',_0xa19b('0x4b'),_0xa19b('0x4c'),_0xa19b('0x4d')]})[_0xa19b('0xd')](function(_0x4a2d52){if(_0x4a2d52[_0xa19b('0x4b')])authService['validatePasswordPattern'](_0xde01c9[_0xa19b('0x34')][_0xa19b('0xe')]);if(!_0x4a2d52[_0xa19b('0x4c')]||!_0x4b579c[_0xa19b('0x4e')])return _0x4b579c;authService['validatePasswordHistory'](_0xde01c9[_0xa19b('0x34')][_0xa19b('0xe')],_0x4b579c[_0xa19b('0x4e')],_0x4a2d52['passwordHistoryLimit']);return _0x4b579c;})[_0xa19b('0xd')](function(){_0x4b579c[_0xa19b('0xe')]=_0xde01c9[_0xa19b('0x34')][_0xa19b('0xe')];_0x4b579c['resetPasswordToken']=null;_0x4b579c['resetPasswordExpires']=null;return _0x4b579c[_0xa19b('0x3e')]();});})[_0xa19b('0xd')](function(){_0x882552[_0xa19b('0x2d')](0xc8)[_0xa19b('0x2e')]({'message':_0xa19b('0x4f')});})[_0xa19b('0x1f')](function(_0x12afa9){return handleError(_0x882552,0x1f4,_0x12afa9);});};passport['use'](_0xa19b('0x50'),new LocalStrategy({'usernameField':_0xa19b('0x28'),'passwordField':_0xa19b('0xe')},function(_0x47cbde,_0x5ca4a1,_0x24a48b){return localAuthenticate(db['User'],_0x47cbde,_0x5ca4a1,_0x24a48b);})); \ No newline at end of file +var _0xa1b6=['blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','format','error','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','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','status','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked'];(function(_0x4f091d,_0x5ab76d){var _0x254ce6=function(_0x408597){while(--_0x408597){_0x4f091d['push'](_0x4f091d['shift']());}};_0x254ce6(++_0x5ab76d);}(_0xa1b6,0x137));var _0x6a1b=function(_0xbd65ad,_0x13272c){_0xbd65ad=_0xbd65ad-0x0;var _0x2d6957=_0xa1b6[_0xbd65ad];return _0x2d6957;};'use strict';var util=require(_0x6a1b('0x0'));var passport=require(_0x6a1b('0x1'));var LocalStrategy=require(_0x6a1b('0x2'))[_0x6a1b('0x3')];var jayson=require(_0x6a1b('0x4'));var _=require('lodash');var rs=require(_0x6a1b('0x5'));var moment=require('moment');var db=require(_0x6a1b('0x6'))['db'];var authService=require(_0x6a1b('0x7'));var utils=require(_0x6a1b('0x8'));var client=jayson[_0x6a1b('0x9')][_0x6a1b('0xa')]({'port':0x232b});function localAuthenticate(_0x5bcb0e,_0x35ef30,_0x423070,_0x5dc1d2){var _0x509922,_0x523e18;return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'where':{'id':0x1},'attributes':[_0x6a1b('0xd'),'blockDuration'],'raw':!![]})[_0x6a1b('0xe')](function(_0xcf2bbc){_0x509922=_0xcf2bbc;return _0x5bcb0e[_0x6a1b('0xc')]({'attributes':['id',_0x6a1b('0xf'),_0x6a1b('0x10'),_0x6a1b('0x11'),_0x6a1b('0x12'),_0x6a1b('0x13'),_0x6a1b('0x14'),_0x6a1b('0x15'),_0x6a1b('0x16')],'where':{'name':_0x35ef30,'role':{'$or':['admin',_0x6a1b('0x17'),_0x6a1b('0x18')]}}});})[_0x6a1b('0xe')](function(_0x5353d4){if(!_0x5353d4||_0x5353d4&&_0x5353d4[_0x6a1b('0xf')]!==_0x35ef30){throw new Error(_0x6a1b('0x19'));}else{_0x523e18=_0x5353d4;return _0x523e18;}})[_0x6a1b('0xe')](function(){_0x523e18[_0x6a1b('0x1a')](_0x423070,function(_0x2569c5,_0x411272){var _0xcf7a3b=_0x523e18['loginAttempts']+0x1;if(_0x2569c5){return _0x5dc1d2(_0x2569c5);}else if(!_0x411272){if(_0x523e18[_0x6a1b('0x13')]){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else if(_0x509922[_0x6a1b('0xd')]>0x0){if(_0x523e18[_0x6a1b('0x14')]){if(_0x509922[_0x6a1b('0x1b')]>0x0){if(moment(_0x523e18[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x509922[_0x6a1b('0x1b')],_0x6a1b('0x1d'))>moment()){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else{return utils[_0x6a1b('0x1e')](_0x523e18,_0xcf7a3b,![],null)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}}else{return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}}else{if(_0xcf7a3b>=_0x509922[_0x6a1b('0xd')]){return utils[_0x6a1b('0x1e')](_0x523e18,0x0,!![],moment())[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}else{return utils[_0x6a1b('0x1e')](_0x523e18,_0xcf7a3b,![],null)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}}}else{return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}}else{if(_0x523e18['disabled']){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else if(_0x509922[_0x6a1b('0xd')]>0x0){if(_0x523e18['blocked']){if(_0x509922[_0x6a1b('0x1b')]>0x0){if(moment(_0x523e18[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x509922['blockDuration'],_0x6a1b('0x1d'))>moment()){return _0x5dc1d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x523e18,0x0,![],null)[_0x6a1b('0xe')](function(){return utils[_0x6a1b('0x1f')](_0x523e18);})[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);});}}else{return _0x5dc1d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x523e18,0x0,![],null)['then'](function(){return utils[_0x6a1b('0x1f')](_0x523e18);})[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);})[_0x6a1b('0x20')](function(_0x40e151){return _0x5dc1d2(null,![],_0x40e151);});}}else{if(_0x523e18[_0x6a1b('0x14')]){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else{return utils[_0x6a1b('0x1f')](_0x523e18)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);});}}}});})['catch'](function(_0xc66b12){return _0x5dc1d2(null,![],_0xc66b12);});}function sendServiceMail(_0x4dbc84){return db[_0x6a1b('0x21')][_0x6a1b('0x22')]({'where':{'service':!![]},'attributes':['id',_0x6a1b('0xf'),_0x6a1b('0x23')],'include':[{'model':db[_0x6a1b('0x24')],'as':_0x6a1b('0x25'),'include':[{'model':db[_0x6a1b('0x26')],'as':_0x6a1b('0x26')}]}]})[_0x6a1b('0xe')](function(_0x3b11e0){if(!_0x3b11e0){throw new Error(_0x6a1b('0x27'));}var _0x25fa63=_0x3b11e0[_0x6a1b('0x28')]();var _0x5490ce={'account':_0x25fa63,'message':_[_0x6a1b('0x29')]({'from':util['format'](_0x6a1b('0x2a'),_0x3b11e0[_0x6a1b('0xf')],_0x3b11e0[_0x6a1b('0x23')]||_0x3b11e0[_0x6a1b('0x25')][_0x6a1b('0x17')])},_0x4dbc84)};return client[_0x6a1b('0x2b')](_0x6a1b('0x2c'),_0x5490ce);})[_0x6a1b('0xe')](function(_0x750f86){if(_0x750f86['error']){throw new Error(util[_0x6a1b('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x750f86[_0x6a1b('0x2e')]['message']||JSON[_0x6a1b('0x2f')](_0x750f86[_0x6a1b('0x2e')])));}return!![];});}function handleError(_0x3e27a4,_0x24865d,_0x20b4ea){return _0x3e27a4['status'](_0x24865d||0x1f4)[_0x6a1b('0x30')]({'message':_0x20b4ea?_0x20b4ea['message']||_0x20b4ea:''});}exports[_0x6a1b('0x31')]=function(_0x150d08,_0xbb992b,_0x53b90b){passport[_0x6a1b('0x1a')]('local-login',function(_0xc85a4c,_0x44bf08,_0x2f857e){var _0x4ecf6b=_0xc85a4c||_0x2f857e;if(_0x4ecf6b){return handleError(_0xbb992b,0x191,_0x4ecf6b);}if(!_0x44bf08){return handleError(_0xbb992b,0x194,{'message':_0x6a1b('0x32')});}else{var _0x196b45={'payload':{'id':_0x44bf08['id'],'role':_0x44bf08[_0x6a1b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x6a1b('0x33')](_0x196b45)['then'](function(_0x38e970){_0xbb992b[_0x6a1b('0x34')]({'id':_0x44bf08['id'],'token':_0x38e970,'statusCall':'','isAlreadyLogged':_0x44bf08['online']});});}})(_0x150d08,_0xbb992b,_0x53b90b);};exports['forgot']=function(_0x338342,_0x3ca645){if(!_0x338342[_0x6a1b('0x35')]['email']){return handleError(_0x3ca645,0x1f4,{'message':_0x6a1b('0x36')});}var _0x4f25b0=rs[_0x6a1b('0x37')]();_0x338342[_0x6a1b('0x35')]['email']=_0x338342[_0x6a1b('0x35')][_0x6a1b('0x23')][_0x6a1b('0x38')]()['toLowerCase']();var _0x245dc6;return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'where':{'id':0x1},'attributes':[_0x6a1b('0xd'),'blockDuration'],'raw':!![]})[_0x6a1b('0xe')](function(_0x58d982){_0x245dc6=_0x58d982;return db[_0x6a1b('0x39')][_0x6a1b('0x22')]({'where':{'email':_0x338342[_0x6a1b('0x35')][_0x6a1b('0x23')]}});})[_0x6a1b('0xe')](function(_0x2238c6){if(!_0x2238c6){throw new Error(_0x6a1b('0x3a'));}if(_0x2238c6[_0x6a1b('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2238c6[_0x6a1b('0x14')]){if(moment(_0x2238c6[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x245dc6[_0x6a1b('0x1b')],'minutes')>moment()){throw new Error(_0x6a1b('0x3b'));}else{_0x2238c6[_0x6a1b('0x14')]=![];_0x2238c6[_0x6a1b('0x15')]=null;}}_0x2238c6[_0x6a1b('0x3c')]=_0x4f25b0;_0x2238c6['resetPasswordExpires']=Date[_0x6a1b('0x3d')]()+0x36ee80;return _0x2238c6[_0x6a1b('0x3e')]();})[_0x6a1b('0xe')](function(){return sendServiceMail({'to':_0x338342['body'][_0x6a1b('0x23')],'subject':_0x6a1b('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6a1b('0x40')+_0x6a1b('0x41')+_0x338342[_0x6a1b('0x42')][_0x6a1b('0x43')]+_0x6a1b('0x44')+_0x4f25b0+'\x0a\x0a'+_0x6a1b('0x45')});})[_0x6a1b('0xe')](function(){_0x3ca645[_0x6a1b('0x46')](0xc8)[_0x6a1b('0x30')]({'message':_0x6a1b('0x47')});})[_0x6a1b('0x20')](function(_0x2dddff){return handleError(_0x3ca645,0x1f4,_0x2dddff);});};exports[_0x6a1b('0x48')]=function(_0x371f31,_0x290a4f){return db[_0x6a1b('0x39')][_0x6a1b('0x22')]({'where':{'resetPasswordToken':_0x371f31[_0x6a1b('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x6a1b('0x3d')]()}}})[_0x6a1b('0xe')](function(_0x7cfad3){if(!_0x7cfad3){throw new Error(_0x6a1b('0x4a'));}return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'attributes':['id','securePassword',_0x6a1b('0x4b'),_0x6a1b('0x4c')]})[_0x6a1b('0xe')](function(_0x285c9c){if(_0x285c9c['securePassword'])authService['validatePasswordPattern'](_0x371f31[_0x6a1b('0x35')][_0x6a1b('0x10')]);if(!_0x285c9c[_0x6a1b('0x4b')]||!_0x7cfad3[_0x6a1b('0x4d')])return _0x7cfad3;authService[_0x6a1b('0x4e')](_0x371f31['body'][_0x6a1b('0x10')],_0x7cfad3[_0x6a1b('0x4d')],_0x285c9c[_0x6a1b('0x4c')]);return _0x7cfad3;})['then'](function(){_0x7cfad3[_0x6a1b('0x10')]=_0x371f31[_0x6a1b('0x35')][_0x6a1b('0x10')];_0x7cfad3['resetPasswordToken']=null;_0x7cfad3[_0x6a1b('0x4f')]=null;return _0x7cfad3[_0x6a1b('0x3e')]();});})['then'](function(){_0x290a4f[_0x6a1b('0x46')](0xc8)[_0x6a1b('0x30')]({'message':_0x6a1b('0x50')});})['catch'](function(_0x311005){return handleError(_0x290a4f,0x1f4,_0x311005);});};passport[_0x6a1b('0x51')](_0x6a1b('0x52'),new LocalStrategy({'usernameField':_0x6a1b('0xf'),'passwordField':_0x6a1b('0x10')},function(_0x40fbf9,_0x14a211,_0x24772b){return localAuthenticate(db[_0x6a1b('0x39')],_0x40fbf9,_0x14a211,_0x24772b);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index a5a47f6..a3b8c02 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fa0=['exports','Router','./authLocal.controller','post','login','/forgot','reset'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0x2fa0,0x71));var _0x02fa=function(_0x1f7661,_0x415f89){_0x1f7661=_0x1f7661-0x0;var _0x5605ea=_0x2fa0[_0x1f7661];return _0x5605ea;};'use strict';var express=require('express');var router=express[_0x02fa('0x0')]();var controller=require(_0x02fa('0x1'));router[_0x02fa('0x2')]('/',controller[_0x02fa('0x3')]);router[_0x02fa('0x2')](_0x02fa('0x4'),controller['forgot']);router[_0x02fa('0x2')]('/reset/:token',controller[_0x02fa('0x5')]);module[_0x02fa('0x6')]=router; \ No newline at end of file +var _0xd0a3=['reset','exports','express','./authLocal.controller','login','post','/forgot','forgot','/reset/:token'];(function(_0x40640c,_0x3b92e9){var _0x27c8cc=function(_0x5e9c32){while(--_0x5e9c32){_0x40640c['push'](_0x40640c['shift']());}};_0x27c8cc(++_0x3b92e9);}(_0xd0a3,0x80));var _0x3d0a=function(_0xb01ded,_0x57ef66){_0xb01ded=_0xb01ded-0x0;var _0x541634=_0xd0a3[_0xb01ded];return _0x541634;};'use strict';var express=require(_0x3d0a('0x0'));var router=express['Router']();var controller=require(_0x3d0a('0x1'));router['post']('/',controller[_0x3d0a('0x2')]);router[_0x3d0a('0x3')](_0x3d0a('0x4'),controller[_0x3d0a('0x5')]);router[_0x3d0a('0x3')](_0x3d0a('0x6'),controller[_0x3d0a('0x7')]);module[_0x3d0a('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 0a6d4df..77d6580 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2400=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x53a763,_0x1cb5ee){var _0x4ca7a2=function(_0x252483){while(--_0x252483){_0x53a763['push'](_0x53a763['shift']());}};_0x4ca7a2(++_0x1cb5ee);}(_0x2400,0xb3));var _0x0240=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x2400[_0x2a55f8];return _0x245efd;};'use strict';var Sequelize=require(_0x0240('0x0'));module[_0x0240('0x1')]={'name':{'type':Sequelize[_0x0240('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0240('0x2')]},'description':{'type':Sequelize[_0x0240('0x2')]},'status':{'type':Sequelize[_0x0240('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0240('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xff82=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xff82,0x13c));var _0x2ff8=function(_0x8d57ff,_0x262930){_0x8d57ff=_0x8d57ff-0x0;var _0x3d42c7=_0xff82[_0x8d57ff];return _0x3d42c7;};'use strict';var Sequelize=require(_0x2ff8('0x0'));module[_0x2ff8('0x1')]={'name':{'type':Sequelize[_0x2ff8('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2ff8('0x2')]},'description':{'type':Sequelize[_0x2ff8('0x2')]},'status':{'type':Sequelize[_0x2ff8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2ff8('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 278e11a..85d2ba6 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebed=['end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','omit','ids','getConditions','findOne','Condition','Action','addActions','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x21586f,_0x4bcf74){var _0x620124=function(_0x50f2eb){while(--_0x50f2eb){_0x21586f['push'](_0x21586f['shift']());}};_0x620124(++_0x4bcf74);}(_0xebed,0x143));var _0xdebe=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xebed[_0xc67528];return _0x38e26d;};'use strict';var emlformat=require(_0xdebe('0x0'));var rimraf=require(_0xdebe('0x1'));var zipdir=require(_0xdebe('0x2'));var jsonpatch=require(_0xdebe('0x3'));var rp=require('request-promise');var moment=require(_0xdebe('0x4'));var BPromise=require(_0xdebe('0x5'));var Mustache=require(_0xdebe('0x6'));var util=require(_0xdebe('0x7'));var path=require(_0xdebe('0x8'));var sox=require(_0xdebe('0x9'));var csv=require(_0xdebe('0xa'));var ejs=require(_0xdebe('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdebe('0xc'));var squel=require('squel');var crypto=require(_0xdebe('0xd'));var jsforce=require(_0xdebe('0xe'));var deskjs=require(_0xdebe('0xf'));var toCsv=require(_0xdebe('0xa'));var querystring=require(_0xdebe('0x10'));var Papa=require('papaparse');var Redis=require(_0xdebe('0x11'));var authService=require(_0xdebe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdebe('0x13'));var hardwareService=require(_0xdebe('0x14'));var logger=require(_0xdebe('0x15'))(_0xdebe('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdebe('0x17'));var db=require(_0xdebe('0x18'))['db'];function respondWithStatusCode(_0x4744d9,_0x4b4b67){_0x4b4b67=_0x4b4b67||0xcc;return function(_0x4d0b2f){if(_0x4d0b2f){return _0x4744d9['sendStatus'](_0x4b4b67);}return _0x4744d9['status'](_0x4b4b67)[_0xdebe('0x19')]();};}function respondWithResult(_0x58fe6c,_0x3bd8c9){_0x3bd8c9=_0x3bd8c9||0xc8;return function(_0x1bf1ae){if(_0x1bf1ae){return _0x58fe6c[_0xdebe('0x1a')](_0x3bd8c9)[_0xdebe('0x1b')](_0x1bf1ae);}};}function respondWithFilteredResult(_0x14dfe7,_0x2ed283){return function(_0x147f74){if(_0x147f74){var _0x59b43a=typeof _0x2ed283[_0xdebe('0x1c')]==='undefined'&&typeof _0x2ed283['limit']===_0xdebe('0x1d');var _0x178b2a=_0x147f74[_0xdebe('0x1e')];var _0x3dd14f=_0x59b43a?0x0:_0x2ed283[_0xdebe('0x1c')];var _0x32c772=_0x59b43a?_0x147f74[_0xdebe('0x1e')]:_0x2ed283['offset']+_0x2ed283[_0xdebe('0x1f')];var _0x829dcf;if(_0x32c772>=_0x178b2a){_0x32c772=_0x178b2a;_0x829dcf=0xc8;}else{_0x829dcf=0xce;}_0x14dfe7['status'](_0x829dcf);return _0x14dfe7[_0xdebe('0x20')](_0xdebe('0x21'),_0x3dd14f+'-'+_0x32c772+'/'+_0x178b2a)[_0xdebe('0x1b')](_0x147f74);}return null;};}function patchUpdates(_0x23e4fd){return function(_0x2f7376){try{jsonpatch[_0xdebe('0x22')](_0x2f7376,_0x23e4fd,!![]);}catch(_0x526928){return BPromise[_0xdebe('0x23')](_0x526928);}return _0x2f7376[_0xdebe('0x24')]();};}function saveUpdates(_0xed1af6,_0x41d589){return function(_0x4af8a1){if(_0x4af8a1){return _0x4af8a1[_0xdebe('0x25')](_0xed1af6)[_0xdebe('0x26')](function(_0x25b0c6){return _0x25b0c6;});}return null;};}function removeEntity(_0x5b10f6,_0x24e6ec){return function(_0x5df31f){if(_0x5df31f){return _0x5df31f[_0xdebe('0x27')]()['then'](function(){_0x5b10f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32527c,_0x4d54a3){return function(_0x187691){if(!_0x187691){_0x32527c['sendStatus'](0x194);}return _0x187691;};}function handleError(_0x6088b4,_0xfcc0b5){_0xfcc0b5=_0xfcc0b5||0x1f4;return function(_0x316ded){logger[_0xdebe('0x28')](_0x316ded[_0xdebe('0x29')]);if(_0x316ded[_0xdebe('0x2a')]){delete _0x316ded[_0xdebe('0x2a')];}_0x6088b4[_0xdebe('0x1a')](_0xfcc0b5)[_0xdebe('0x2b')](_0x316ded);};}exports[_0xdebe('0x2c')]=function(_0x1122b5,_0x52e80a){var _0x10843c={},_0x243100={},_0x10a6a6={'count':0x0,'rows':[]};var _0x218cec=_['map'](db[_0xdebe('0x2d')][_0xdebe('0x2e')],function(_0x3a284f){return{'name':_0x3a284f[_0xdebe('0x2f')],'type':_0x3a284f['type'][_0xdebe('0x30')]};});_0x243100['model']=_['map'](_0x218cec,_0xdebe('0x2a'));_0x243100[_0xdebe('0x31')]=_[_0xdebe('0x32')](_0x1122b5[_0xdebe('0x31')]);_0x243100[_0xdebe('0x33')]=_['intersection'](_0x243100['model'],_0x243100['query']);_0x10843c[_0xdebe('0x34')]=_[_0xdebe('0x35')](_0x243100[_0xdebe('0x36')],qs[_0xdebe('0x37')](_0x1122b5[_0xdebe('0x31')][_0xdebe('0x37')]));_0x10843c[_0xdebe('0x34')]=_0x10843c['attributes']['length']?_0x10843c['attributes']:_0x243100[_0xdebe('0x36')];if(!_0x1122b5['query'][_0xdebe('0x38')](_0xdebe('0x39'))){_0x10843c[_0xdebe('0x1f')]=qs['limit'](_0x1122b5[_0xdebe('0x31')][_0xdebe('0x1f')]);_0x10843c[_0xdebe('0x1c')]=qs['offset'](_0x1122b5['query']['offset']);}_0x10843c['order']=qs[_0xdebe('0x3a')](_0x1122b5[_0xdebe('0x31')][_0xdebe('0x3a')]);_0x10843c['where']=qs[_0xdebe('0x33')](_[_0xdebe('0x3b')](_0x1122b5[_0xdebe('0x31')],_0x243100['filters']),_0x218cec);if(_0x1122b5['query'][_0xdebe('0x3c')]){_0x10843c[_0xdebe('0x3d')]=_[_0xdebe('0x3e')](_0x10843c[_0xdebe('0x3d')],{'$or':_[_0xdebe('0x3f')](_0x218cec,function(_0x379079){if(_0x379079[_0xdebe('0x40')]!==_0xdebe('0x41')){var _0x585855={};_0x585855[_0x379079[_0xdebe('0x2a')]]={'$like':'%'+_0x1122b5[_0xdebe('0x31')][_0xdebe('0x3c')]+'%'};return _0x585855;}})});}_0x10843c=_[_0xdebe('0x3e')]({},_0x10843c,_0x1122b5[_0xdebe('0x42')]);var _0x3e3866={'where':_0x10843c[_0xdebe('0x3d')]};return db[_0xdebe('0x2d')][_0xdebe('0x1e')](_0x3e3866)['then'](function(_0x5d7028){_0x10a6a6[_0xdebe('0x1e')]=_0x5d7028;if(_0x1122b5[_0xdebe('0x31')][_0xdebe('0x43')]){_0x10843c[_0xdebe('0x44')]=[{'all':!![]}];}return db[_0xdebe('0x2d')][_0xdebe('0x45')](_0x10843c);})[_0xdebe('0x26')](function(_0x2c60f6){_0x10a6a6[_0xdebe('0x46')]=_0x2c60f6;return _0x10a6a6;})['then'](respondWithFilteredResult(_0x52e80a,_0x10843c))[_0xdebe('0x47')](handleError(_0x52e80a,null));};exports[_0xdebe('0x48')]=function(_0xd4e7cf,_0x2165d3){var _0x46fc8d={'raw':![],'where':{'id':_0xd4e7cf[_0xdebe('0x49')]['id']}},_0x38b086={};_0x38b086[_0xdebe('0x36')]=_[_0xdebe('0x32')](db['Automation'][_0xdebe('0x2e')]);_0x38b086[_0xdebe('0x31')]=_['keys'](_0xd4e7cf[_0xdebe('0x31')]);_0x38b086[_0xdebe('0x33')]=_[_0xdebe('0x35')](_0x38b086[_0xdebe('0x36')],_0x38b086[_0xdebe('0x31')]);_0x46fc8d[_0xdebe('0x34')]=_[_0xdebe('0x35')](_0x38b086[_0xdebe('0x36')],qs['fields'](_0xd4e7cf['query'][_0xdebe('0x37')]));_0x46fc8d['attributes']=_0x46fc8d[_0xdebe('0x34')][_0xdebe('0x4a')]?_0x46fc8d[_0xdebe('0x34')]:_0x38b086[_0xdebe('0x36')];if(_0xd4e7cf[_0xdebe('0x31')][_0xdebe('0x43')]){_0x46fc8d[_0xdebe('0x44')]=[{'all':!![]}];}_0x46fc8d=_[_0xdebe('0x3e')]({},_0x46fc8d,_0xd4e7cf['options']);return db['Automation'][_0xdebe('0x4b')](_0x46fc8d)[_0xdebe('0x26')](handleEntityNotFound(_0x2165d3,null))[_0xdebe('0x26')](respondWithResult(_0x2165d3,null))['catch'](handleError(_0x2165d3,null));};exports[_0xdebe('0x4c')]=function(_0x43bd56,_0x13e30c){return db[_0xdebe('0x2d')][_0xdebe('0x4c')](_0x43bd56[_0xdebe('0x4d')],{})[_0xdebe('0x26')](respondWithResult(_0x13e30c,0xc9))[_0xdebe('0x47')](handleError(_0x13e30c,null));};exports[_0xdebe('0x25')]=function(_0x44612c,_0x36214f){if(_0x44612c[_0xdebe('0x4d')]['id']){delete _0x44612c['body']['id'];}return db['Automation'][_0xdebe('0x4b')]({'where':{'id':_0x44612c[_0xdebe('0x49')]['id']}})[_0xdebe('0x26')](handleEntityNotFound(_0x36214f,null))[_0xdebe('0x26')](saveUpdates(_0x44612c[_0xdebe('0x4d')],null))[_0xdebe('0x26')](respondWithResult(_0x36214f,null))[_0xdebe('0x47')](handleError(_0x36214f,null));};exports[_0xdebe('0x27')]=function(_0x387c9b,_0x32d998){return db[_0xdebe('0x2d')][_0xdebe('0x4b')]({'where':{'id':_0x387c9b['params']['id']}})[_0xdebe('0x26')](handleEntityNotFound(_0x32d998,null))[_0xdebe('0x26')](removeEntity(_0x32d998,null))[_0xdebe('0x47')](handleError(_0x32d998,null));};exports['addConditions']=function(_0x5f1dff,_0x1bd56b,_0x476a1c){return db['Condition'][_0xdebe('0x4b')]({'where':{'id':_0x5f1dff[_0xdebe('0x49')]['id']}})[_0xdebe('0x26')](handleEntityNotFound(_0x1bd56b,null))[_0xdebe('0x26')](function(_0x42aad6){if(_0x42aad6){return _0x42aad6['addConditions'](_0x5f1dff[_0xdebe('0x4d')]['ids'],_[_0xdebe('0x4e')](_0x5f1dff['body'],[_0xdebe('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1bd56b,null))[_0xdebe('0x47')](handleError(_0x1bd56b,null));};exports[_0xdebe('0x50')]=function(_0x36b548,_0x114bee,_0x3e9e0a){var _0x47bb48={};var _0x5d414d={};var _0xe2e3c3;var _0x5af77f;return db[_0xdebe('0x2d')][_0xdebe('0x51')]({'where':{'id':_0x36b548[_0xdebe('0x49')]['id']}})[_0xdebe('0x26')](handleEntityNotFound(_0x114bee,null))[_0xdebe('0x26')](function(_0x1054e5){if(_0x1054e5){_0xe2e3c3=_0x1054e5;_0x5d414d[_0xdebe('0x36')]=_[_0xdebe('0x32')](db[_0xdebe('0x52')][_0xdebe('0x2e')]);_0x5d414d[_0xdebe('0x31')]=_[_0xdebe('0x32')](_0x36b548['query']);_0x5d414d[_0xdebe('0x33')]=_['intersection'](_0x5d414d[_0xdebe('0x36')],_0x5d414d[_0xdebe('0x31')]);_0x47bb48['attributes']=_[_0xdebe('0x35')](_0x5d414d[_0xdebe('0x36')],qs[_0xdebe('0x37')](_0x36b548[_0xdebe('0x31')][_0xdebe('0x37')]));_0x47bb48[_0xdebe('0x34')]=_0x47bb48[_0xdebe('0x34')][_0xdebe('0x4a')]?_0x47bb48['attributes']:_0x5d414d['model'];_0x47bb48['order']=qs[_0xdebe('0x3a')](_0x36b548[_0xdebe('0x31')][_0xdebe('0x3a')]);_0x47bb48[_0xdebe('0x3d')]=qs[_0xdebe('0x33')](_[_0xdebe('0x3b')](_0x36b548[_0xdebe('0x31')],_0x5d414d[_0xdebe('0x33')]));if(_0x36b548[_0xdebe('0x31')][_0xdebe('0x3c')]){_0x47bb48[_0xdebe('0x3d')]=_[_0xdebe('0x3e')](_0x47bb48['where'],{'$or':_['map'](_0x47bb48[_0xdebe('0x34')],function(_0x518633){var _0x337b3b={};_0x337b3b[_0x518633]={'$like':'%'+_0x36b548[_0xdebe('0x31')][_0xdebe('0x3c')]+'%'};return _0x337b3b;})});}_0x47bb48=_[_0xdebe('0x3e')]({},_0x47bb48,_0x36b548[_0xdebe('0x42')]);return _0xe2e3c3[_0xdebe('0x50')](_0x47bb48);}})[_0xdebe('0x26')](function(_0x1e276a){if(_0x1e276a){_0x5af77f=_0x1e276a['length'];if(!_0x36b548[_0xdebe('0x31')][_0xdebe('0x38')](_0xdebe('0x39'))){_0x47bb48['limit']=qs[_0xdebe('0x1f')](_0x36b548[_0xdebe('0x31')]['limit']);_0x47bb48[_0xdebe('0x1c')]=qs[_0xdebe('0x1c')](_0x36b548[_0xdebe('0x31')][_0xdebe('0x1c')]);}return _0xe2e3c3[_0xdebe('0x50')](_0x47bb48);}})[_0xdebe('0x26')](function(_0x25b4d8){if(_0x25b4d8){return _0x25b4d8?{'count':_0x5af77f,'rows':_0x25b4d8}:null;}})[_0xdebe('0x26')](respondWithResult(_0x114bee,null))[_0xdebe('0x47')](handleError(_0x114bee,null));};exports['addActions']=function(_0x458d0f,_0xda183d,_0xeabe37){return db[_0xdebe('0x53')][_0xdebe('0x4b')]({'where':{'id':_0x458d0f[_0xdebe('0x49')]['id']}})['then'](handleEntityNotFound(_0xda183d,null))[_0xdebe('0x26')](function(_0x436b38){if(_0x436b38){return _0x436b38[_0xdebe('0x54')](_0x458d0f[_0xdebe('0x4d')][_0xdebe('0x4f')],_[_0xdebe('0x4e')](_0x458d0f[_0xdebe('0x4d')],[_0xdebe('0x4f'),'id'])||{});}})['then'](respondWithResult(_0xda183d,null))[_0xdebe('0x47')](handleError(_0xda183d,null));};exports[_0xdebe('0x55')]=function(_0x16cf61,_0x4b0de3,_0x5dd01c){var _0x6631fd={};var _0x3a008f={};var _0x431b30;var _0x1078fc;return db[_0xdebe('0x2d')][_0xdebe('0x51')]({'where':{'id':_0x16cf61[_0xdebe('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b0de3,null))[_0xdebe('0x26')](function(_0x49dd9c){if(_0x49dd9c){_0x431b30=_0x49dd9c;_0x3a008f[_0xdebe('0x36')]=_['keys'](db[_0xdebe('0x53')]['rawAttributes']);_0x3a008f[_0xdebe('0x31')]=_[_0xdebe('0x32')](_0x16cf61[_0xdebe('0x31')]);_0x3a008f[_0xdebe('0x33')]=_[_0xdebe('0x35')](_0x3a008f[_0xdebe('0x36')],_0x3a008f[_0xdebe('0x31')]);_0x6631fd[_0xdebe('0x34')]=_[_0xdebe('0x35')](_0x3a008f['model'],qs[_0xdebe('0x37')](_0x16cf61[_0xdebe('0x31')][_0xdebe('0x37')]));_0x6631fd[_0xdebe('0x34')]=_0x6631fd[_0xdebe('0x34')][_0xdebe('0x4a')]?_0x6631fd['attributes']:_0x3a008f[_0xdebe('0x36')];_0x6631fd[_0xdebe('0x56')]=qs[_0xdebe('0x3a')](_0x16cf61[_0xdebe('0x31')]['sort']);_0x6631fd[_0xdebe('0x3d')]=qs[_0xdebe('0x33')](_[_0xdebe('0x3b')](_0x16cf61['query'],_0x3a008f['filters']));if(_0x16cf61[_0xdebe('0x31')][_0xdebe('0x3c')]){_0x6631fd[_0xdebe('0x3d')]=_[_0xdebe('0x3e')](_0x6631fd[_0xdebe('0x3d')],{'$or':_[_0xdebe('0x3f')](_0x6631fd[_0xdebe('0x34')],function(_0x3a6de8){var _0x4c6788={};_0x4c6788[_0x3a6de8]={'$like':'%'+_0x16cf61['query']['filter']+'%'};return _0x4c6788;})});}_0x6631fd=_[_0xdebe('0x3e')]({},_0x6631fd,_0x16cf61[_0xdebe('0x42')]);return _0x431b30[_0xdebe('0x55')](_0x6631fd);}})[_0xdebe('0x26')](function(_0x4ce5ae){if(_0x4ce5ae){_0x1078fc=_0x4ce5ae[_0xdebe('0x4a')];if(!_0x16cf61[_0xdebe('0x31')][_0xdebe('0x38')]('nolimit')){_0x6631fd[_0xdebe('0x1f')]=qs[_0xdebe('0x1f')](_0x16cf61[_0xdebe('0x31')][_0xdebe('0x1f')]);_0x6631fd[_0xdebe('0x1c')]=qs['offset'](_0x16cf61[_0xdebe('0x31')][_0xdebe('0x1c')]);}return _0x431b30[_0xdebe('0x55')](_0x6631fd);}})[_0xdebe('0x26')](function(_0x98c123){if(_0x98c123){return _0x98c123?{'count':_0x1078fc,'rows':_0x98c123}:null;}})['then'](respondWithResult(_0x4b0de3,null))[_0xdebe('0x47')](handleError(_0x4b0de3,null));}; \ No newline at end of file +var _0x7284=['map','Automation','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','options','find','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x44f0fd,_0x363ca8){var _0x5e28de=function(_0x218086){while(--_0x218086){_0x44f0fd['push'](_0x44f0fd['shift']());}};_0x5e28de(++_0x363ca8);}(_0x7284,0x1c7));var _0x4728=function(_0x375a24,_0x1c1fb6){_0x375a24=_0x375a24-0x0;var _0x38d80e=_0x7284[_0x375a24];return _0x38d80e;};'use strict';var emlformat=require(_0x4728('0x0'));var rimraf=require(_0x4728('0x1'));var zipdir=require(_0x4728('0x2'));var jsonpatch=require(_0x4728('0x3'));var rp=require(_0x4728('0x4'));var moment=require(_0x4728('0x5'));var BPromise=require(_0x4728('0x6'));var Mustache=require('mustache');var util=require(_0x4728('0x7'));var path=require(_0x4728('0x8'));var sox=require('sox');var csv=require(_0x4728('0x9'));var ejs=require(_0x4728('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4728('0xb'));var crypto=require('crypto');var jsforce=require(_0x4728('0xc'));var deskjs=require(_0x4728('0xd'));var toCsv=require(_0x4728('0x9'));var querystring=require(_0x4728('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4728('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4728('0x10'));var hardwareService=require(_0x4728('0x11'));var logger=require('../../config/logger')(_0x4728('0x12'));var utils=require(_0x4728('0x13'));var config=require(_0x4728('0x14'));var licenseUtil=require(_0x4728('0x15'));var db=require(_0x4728('0x16'))['db'];function respondWithStatusCode(_0x6d6442,_0x49ce5b){_0x49ce5b=_0x49ce5b||0xcc;return function(_0x307afe){if(_0x307afe){return _0x6d6442['sendStatus'](_0x49ce5b);}return _0x6d6442[_0x4728('0x17')](_0x49ce5b)[_0x4728('0x18')]();};}function respondWithResult(_0x2a5269,_0x3f1ba7){_0x3f1ba7=_0x3f1ba7||0xc8;return function(_0x276b4f){if(_0x276b4f){return _0x2a5269[_0x4728('0x17')](_0x3f1ba7)[_0x4728('0x19')](_0x276b4f);}};}function respondWithFilteredResult(_0x15b9f2,_0x37ddfb){return function(_0xdbb6fd){if(_0xdbb6fd){var _0x3ff388=typeof _0x37ddfb[_0x4728('0x1a')]==='undefined'&&typeof _0x37ddfb[_0x4728('0x1b')]===_0x4728('0x1c');var _0x5b50b6=_0xdbb6fd['count'];var _0x54c200=_0x3ff388?0x0:_0x37ddfb['offset'];var _0x2f63a2=_0x3ff388?_0xdbb6fd['count']:_0x37ddfb[_0x4728('0x1a')]+_0x37ddfb[_0x4728('0x1b')];var _0x53546d;if(_0x2f63a2>=_0x5b50b6){_0x2f63a2=_0x5b50b6;_0x53546d=0xc8;}else{_0x53546d=0xce;}_0x15b9f2[_0x4728('0x17')](_0x53546d);return _0x15b9f2[_0x4728('0x1d')](_0x4728('0x1e'),_0x54c200+'-'+_0x2f63a2+'/'+_0x5b50b6)[_0x4728('0x19')](_0xdbb6fd);}return null;};}function patchUpdates(_0x287280){return function(_0x31c1f6){try{jsonpatch[_0x4728('0x1f')](_0x31c1f6,_0x287280,!![]);}catch(_0x586a11){return BPromise[_0x4728('0x20')](_0x586a11);}return _0x31c1f6[_0x4728('0x21')]();};}function saveUpdates(_0xd65cc9,_0x4cfa15){return function(_0x973e14){if(_0x973e14){return _0x973e14[_0x4728('0x22')](_0xd65cc9)[_0x4728('0x23')](function(_0x434a9e){return _0x434a9e;});}return null;};}function removeEntity(_0x1e865b,_0x1d8bd6){return function(_0x24d995){if(_0x24d995){return _0x24d995[_0x4728('0x24')]()[_0x4728('0x23')](function(){_0x1e865b[_0x4728('0x17')](0xcc)[_0x4728('0x18')]();});}};}function handleEntityNotFound(_0x57b6df,_0x85ebd8){return function(_0x55a248){if(!_0x55a248){_0x57b6df[_0x4728('0x25')](0x194);}return _0x55a248;};}function handleError(_0x42936a,_0x3a3c76){_0x3a3c76=_0x3a3c76||0x1f4;return function(_0x3e679c){logger[_0x4728('0x26')](_0x3e679c[_0x4728('0x27')]);if(_0x3e679c[_0x4728('0x28')]){delete _0x3e679c[_0x4728('0x28')];}_0x42936a[_0x4728('0x17')](_0x3a3c76)[_0x4728('0x29')](_0x3e679c);};}exports[_0x4728('0x2a')]=function(_0x4d90eb,_0x29eafc){var _0x57d7b8={},_0x11c4da={},_0x49bde5={'count':0x0,'rows':[]};var _0x433d4e=_[_0x4728('0x2b')](db[_0x4728('0x2c')][_0x4728('0x2d')],function(_0x4684f6){return{'name':_0x4684f6['fieldName'],'type':_0x4684f6[_0x4728('0x2e')][_0x4728('0x2f')]};});_0x11c4da['model']=_[_0x4728('0x2b')](_0x433d4e,_0x4728('0x28'));_0x11c4da[_0x4728('0x30')]=_[_0x4728('0x31')](_0x4d90eb['query']);_0x11c4da[_0x4728('0x32')]=_[_0x4728('0x33')](_0x11c4da[_0x4728('0x34')],_0x11c4da['query']);_0x57d7b8[_0x4728('0x35')]=_[_0x4728('0x33')](_0x11c4da[_0x4728('0x34')],qs['fields'](_0x4d90eb['query'][_0x4728('0x36')]));_0x57d7b8[_0x4728('0x35')]=_0x57d7b8['attributes'][_0x4728('0x37')]?_0x57d7b8[_0x4728('0x35')]:_0x11c4da['model'];if(!_0x4d90eb['query'][_0x4728('0x38')](_0x4728('0x39'))){_0x57d7b8[_0x4728('0x1b')]=qs['limit'](_0x4d90eb[_0x4728('0x30')][_0x4728('0x1b')]);_0x57d7b8[_0x4728('0x1a')]=qs[_0x4728('0x1a')](_0x4d90eb[_0x4728('0x30')][_0x4728('0x1a')]);}_0x57d7b8[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0x4d90eb[_0x4728('0x30')][_0x4728('0x3b')]);_0x57d7b8[_0x4728('0x3c')]=qs['filters'](_['pick'](_0x4d90eb['query'],_0x11c4da[_0x4728('0x32')]),_0x433d4e);if(_0x4d90eb[_0x4728('0x30')][_0x4728('0x3d')]){_0x57d7b8['where']=_[_0x4728('0x3e')](_0x57d7b8['where'],{'$or':_[_0x4728('0x2b')](_0x433d4e,function(_0x44ecc9){if(_0x44ecc9[_0x4728('0x2e')]!==_0x4728('0x3f')){var _0x284857={};_0x284857[_0x44ecc9['name']]={'$like':'%'+_0x4d90eb['query'][_0x4728('0x3d')]+'%'};return _0x284857;}})});}_0x57d7b8=_[_0x4728('0x3e')]({},_0x57d7b8,_0x4d90eb['options']);var _0xa549c9={'where':_0x57d7b8[_0x4728('0x3c')]};return db['Automation']['count'](_0xa549c9)[_0x4728('0x23')](function(_0x218a07){_0x49bde5['count']=_0x218a07;if(_0x4d90eb[_0x4728('0x30')]['includeAll']){_0x57d7b8[_0x4728('0x40')]=[{'all':!![]}];}return db[_0x4728('0x2c')][_0x4728('0x41')](_0x57d7b8);})[_0x4728('0x23')](function(_0x1dbe45){_0x49bde5[_0x4728('0x42')]=_0x1dbe45;return _0x49bde5;})[_0x4728('0x23')](respondWithFilteredResult(_0x29eafc,_0x57d7b8))[_0x4728('0x43')](handleError(_0x29eafc,null));};exports[_0x4728('0x44')]=function(_0x26874c,_0x5c030d){var _0x2ee9ca={'raw':![],'where':{'id':_0x26874c['params']['id']}},_0x16820e={};_0x16820e[_0x4728('0x34')]=_[_0x4728('0x31')](db[_0x4728('0x2c')][_0x4728('0x2d')]);_0x16820e['query']=_['keys'](_0x26874c[_0x4728('0x30')]);_0x16820e[_0x4728('0x32')]=_[_0x4728('0x33')](_0x16820e[_0x4728('0x34')],_0x16820e[_0x4728('0x30')]);_0x2ee9ca['attributes']=_[_0x4728('0x33')](_0x16820e['model'],qs[_0x4728('0x36')](_0x26874c[_0x4728('0x30')][_0x4728('0x36')]));_0x2ee9ca['attributes']=_0x2ee9ca[_0x4728('0x35')][_0x4728('0x37')]?_0x2ee9ca[_0x4728('0x35')]:_0x16820e['model'];if(_0x26874c[_0x4728('0x30')]['includeAll']){_0x2ee9ca['include']=[{'all':!![]}];}_0x2ee9ca=_[_0x4728('0x3e')]({},_0x2ee9ca,_0x26874c[_0x4728('0x45')]);return db[_0x4728('0x2c')][_0x4728('0x46')](_0x2ee9ca)[_0x4728('0x23')](handleEntityNotFound(_0x5c030d,null))['then'](respondWithResult(_0x5c030d,null))[_0x4728('0x43')](handleError(_0x5c030d,null));};exports[_0x4728('0x47')]=function(_0x47b6eb,_0x587881){return db[_0x4728('0x2c')][_0x4728('0x47')](_0x47b6eb[_0x4728('0x48')],{})['then'](respondWithResult(_0x587881,0xc9))[_0x4728('0x43')](handleError(_0x587881,null));};exports[_0x4728('0x22')]=function(_0x3d993a,_0x9858b7){if(_0x3d993a[_0x4728('0x48')]['id']){delete _0x3d993a['body']['id'];}return db[_0x4728('0x2c')][_0x4728('0x46')]({'where':{'id':_0x3d993a[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x9858b7,null))[_0x4728('0x23')](saveUpdates(_0x3d993a[_0x4728('0x48')],null))[_0x4728('0x23')](respondWithResult(_0x9858b7,null))['catch'](handleError(_0x9858b7,null));};exports[_0x4728('0x24')]=function(_0x535aff,_0x57dd2b){return db[_0x4728('0x2c')]['find']({'where':{'id':_0x535aff[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x57dd2b,null))[_0x4728('0x23')](removeEntity(_0x57dd2b,null))['catch'](handleError(_0x57dd2b,null));};exports[_0x4728('0x4a')]=function(_0xe87fc9,_0x29ed73,_0x4ecb11){return db['Condition'][_0x4728('0x46')]({'where':{'id':_0xe87fc9[_0x4728('0x49')]['id']}})['then'](handleEntityNotFound(_0x29ed73,null))[_0x4728('0x23')](function(_0xc02e0){if(_0xc02e0){return _0xc02e0[_0x4728('0x4a')](_0xe87fc9[_0x4728('0x48')][_0x4728('0x4b')],_[_0x4728('0x4c')](_0xe87fc9[_0x4728('0x48')],[_0x4728('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x29ed73,null))[_0x4728('0x43')](handleError(_0x29ed73,null));};exports[_0x4728('0x4d')]=function(_0x1e2c0a,_0x2e9209,_0x2c7beb){var _0x300961={};var _0x240f14={};var _0x4b43f5;var _0x1e9724;return db[_0x4728('0x2c')][_0x4728('0x4e')]({'where':{'id':_0x1e2c0a[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x2e9209,null))['then'](function(_0x873498){if(_0x873498){_0x4b43f5=_0x873498;_0x240f14['model']=_[_0x4728('0x31')](db[_0x4728('0x4f')][_0x4728('0x2d')]);_0x240f14[_0x4728('0x30')]=_[_0x4728('0x31')](_0x1e2c0a[_0x4728('0x30')]);_0x240f14[_0x4728('0x32')]=_['intersection'](_0x240f14[_0x4728('0x34')],_0x240f14[_0x4728('0x30')]);_0x300961[_0x4728('0x35')]=_[_0x4728('0x33')](_0x240f14['model'],qs[_0x4728('0x36')](_0x1e2c0a[_0x4728('0x30')][_0x4728('0x36')]));_0x300961[_0x4728('0x35')]=_0x300961[_0x4728('0x35')][_0x4728('0x37')]?_0x300961[_0x4728('0x35')]:_0x240f14['model'];_0x300961[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0x1e2c0a[_0x4728('0x30')]['sort']);_0x300961['where']=qs[_0x4728('0x32')](_['pick'](_0x1e2c0a[_0x4728('0x30')],_0x240f14[_0x4728('0x32')]));if(_0x1e2c0a[_0x4728('0x30')][_0x4728('0x3d')]){_0x300961[_0x4728('0x3c')]=_['merge'](_0x300961['where'],{'$or':_[_0x4728('0x2b')](_0x300961['attributes'],function(_0x36ebe2){var _0x16f014={};_0x16f014[_0x36ebe2]={'$like':'%'+_0x1e2c0a[_0x4728('0x30')][_0x4728('0x3d')]+'%'};return _0x16f014;})});}_0x300961=_[_0x4728('0x3e')]({},_0x300961,_0x1e2c0a[_0x4728('0x45')]);return _0x4b43f5['getConditions'](_0x300961);}})[_0x4728('0x23')](function(_0x2a5681){if(_0x2a5681){_0x1e9724=_0x2a5681['length'];if(!_0x1e2c0a[_0x4728('0x30')][_0x4728('0x38')](_0x4728('0x39'))){_0x300961[_0x4728('0x1b')]=qs[_0x4728('0x1b')](_0x1e2c0a['query'][_0x4728('0x1b')]);_0x300961['offset']=qs[_0x4728('0x1a')](_0x1e2c0a['query'][_0x4728('0x1a')]);}return _0x4b43f5['getConditions'](_0x300961);}})[_0x4728('0x23')](function(_0x28f2fc){if(_0x28f2fc){return _0x28f2fc?{'count':_0x1e9724,'rows':_0x28f2fc}:null;}})[_0x4728('0x23')](respondWithResult(_0x2e9209,null))[_0x4728('0x43')](handleError(_0x2e9209,null));};exports['addActions']=function(_0x4c7d6e,_0x452de6,_0x337b4c){return db[_0x4728('0x50')][_0x4728('0x46')]({'where':{'id':_0x4c7d6e['params']['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x452de6,null))[_0x4728('0x23')](function(_0x22a95f){if(_0x22a95f){return _0x22a95f['addActions'](_0x4c7d6e[_0x4728('0x48')][_0x4728('0x4b')],_['omit'](_0x4c7d6e[_0x4728('0x48')],[_0x4728('0x4b'),'id'])||{});}})[_0x4728('0x23')](respondWithResult(_0x452de6,null))[_0x4728('0x43')](handleError(_0x452de6,null));};exports[_0x4728('0x51')]=function(_0xaa29f6,_0x1b5758,_0x376614){var _0x5146d9={};var _0x284cf6={};var _0x47626a;var _0x46c2fb;return db[_0x4728('0x2c')][_0x4728('0x4e')]({'where':{'id':_0xaa29f6['params']['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x1b5758,null))[_0x4728('0x23')](function(_0x5c79c5){if(_0x5c79c5){_0x47626a=_0x5c79c5;_0x284cf6[_0x4728('0x34')]=_['keys'](db['Action'][_0x4728('0x2d')]);_0x284cf6[_0x4728('0x30')]=_[_0x4728('0x31')](_0xaa29f6[_0x4728('0x30')]);_0x284cf6[_0x4728('0x32')]=_[_0x4728('0x33')](_0x284cf6['model'],_0x284cf6['query']);_0x5146d9[_0x4728('0x35')]=_[_0x4728('0x33')](_0x284cf6[_0x4728('0x34')],qs[_0x4728('0x36')](_0xaa29f6[_0x4728('0x30')][_0x4728('0x36')]));_0x5146d9[_0x4728('0x35')]=_0x5146d9[_0x4728('0x35')][_0x4728('0x37')]?_0x5146d9[_0x4728('0x35')]:_0x284cf6[_0x4728('0x34')];_0x5146d9[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0xaa29f6['query'][_0x4728('0x3b')]);_0x5146d9['where']=qs[_0x4728('0x32')](_[_0x4728('0x52')](_0xaa29f6[_0x4728('0x30')],_0x284cf6['filters']));if(_0xaa29f6[_0x4728('0x30')][_0x4728('0x3d')]){_0x5146d9[_0x4728('0x3c')]=_['merge'](_0x5146d9[_0x4728('0x3c')],{'$or':_[_0x4728('0x2b')](_0x5146d9[_0x4728('0x35')],function(_0x45d7ef){var _0x35cd28={};_0x35cd28[_0x45d7ef]={'$like':'%'+_0xaa29f6[_0x4728('0x30')][_0x4728('0x3d')]+'%'};return _0x35cd28;})});}_0x5146d9=_[_0x4728('0x3e')]({},_0x5146d9,_0xaa29f6['options']);return _0x47626a[_0x4728('0x51')](_0x5146d9);}})[_0x4728('0x23')](function(_0x283280){if(_0x283280){_0x46c2fb=_0x283280[_0x4728('0x37')];if(!_0xaa29f6[_0x4728('0x30')][_0x4728('0x38')](_0x4728('0x39'))){_0x5146d9[_0x4728('0x1b')]=qs[_0x4728('0x1b')](_0xaa29f6[_0x4728('0x30')][_0x4728('0x1b')]);_0x5146d9['offset']=qs['offset'](_0xaa29f6[_0x4728('0x30')][_0x4728('0x1a')]);}return _0x47626a['getActions'](_0x5146d9);}})['then'](function(_0x21bd1a){if(_0x21bd1a){return _0x21bd1a?{'count':_0x46c2fb,'rows':_0x21bd1a}:null;}})[_0x4728('0x23')](respondWithResult(_0x1b5758,null))[_0x4728('0x43')](handleError(_0x1b5758,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 0736479..00d4ed2 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90d9=['exports','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./automation.attributes'];(function(_0x41a154,_0x15c5d2){var _0x5b9819=function(_0x1d8ce5){while(--_0x1d8ce5){_0x41a154['push'](_0x41a154['shift']());}};_0x5b9819(++_0x15c5d2);}(_0x90d9,0x1d7));var _0x990d=function(_0x18b374,_0x371c93){_0x18b374=_0x18b374-0x0;var _0x50a999=_0x90d9[_0x18b374];return _0x50a999;};'use strict';var _=require(_0x990d('0x0'));var util=require(_0x990d('0x1'));var logger=require(_0x990d('0x2'))(_0x990d('0x3'));var moment=require(_0x990d('0x4'));var BPromise=require(_0x990d('0x5'));var rp=require(_0x990d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x990d('0x7'));var config=require('../../config/environment');var attributes=require(_0x990d('0x8'));module[_0x990d('0x9')]=function(_0x22955a,_0x306f1d){return _0x22955a[_0x990d('0xa')]('Automation',attributes,{'tableName':_0x990d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1bd=['define','Automation','tools_automations','lodash','util','../../config/logger','api','rimraf','../../config/environment','./automation.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1bd,0x7b));var _0xdc1b=function(_0x1c4854,_0x3b968d){_0x1c4854=_0x1c4854-0x0;var _0x5029db=_0xc1bd[_0x1c4854];return _0x5029db;};'use strict';var _=require(_0xdc1b('0x0'));var util=require(_0xdc1b('0x1'));var logger=require(_0xdc1b('0x2'))(_0xdc1b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1b('0x4'));var config=require(_0xdc1b('0x5'));var attributes=require(_0xdc1b('0x6'));module['exports']=function(_0x7ba2b9,_0x279276){return _0x7ba2b9[_0xdc1b('0x7')](_0xdc1b('0x8'),attributes,{'tableName':_0xdc1b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 9c8a34d..b65cb0a 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf55c=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56babc,_0x363e8e){var _0x2168be=function(_0x1b4ce0){while(--_0x1b4ce0){_0x56babc['push'](_0x56babc['shift']());}};_0x2168be(++_0x363e8e);}(_0xf55c,0x1e7));var _0xcf55=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xf55c[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xcf55('0x0'));var util=require('util');var moment=require(_0xcf55('0x1'));var BPromise=require(_0xcf55('0x2'));var rs=require(_0xcf55('0x3'));var fs=require('fs');var Redis=require(_0xcf55('0x4'));var db=require(_0xcf55('0x5'))['db'];var utils=require(_0xcf55('0x6'));var logger=require(_0xcf55('0x7'))('rpc');var config=require(_0xcf55('0x8'));var jayson=require(_0xcf55('0x9'));var client=jayson[_0xcf55('0xa')][_0xcf55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b3453,_0x29566b,_0x53deb4){return new BPromise(function(_0x7003f1,_0x3018aa){return client['request'](_0x4b3453,_0x53deb4)[_0xcf55('0xc')](function(_0x3ce5d2){logger[_0xcf55('0xd')](_0xcf55('0xe'),_0x29566b,_0xcf55('0xf'));logger[_0xcf55('0x10')](_0xcf55('0x11'),_0x29566b,'request\x20sent',JSON[_0xcf55('0x12')](_0x3ce5d2));if(_0x3ce5d2[_0xcf55('0x13')]){if(_0x3ce5d2['error']['code']===0x1f4){logger[_0xcf55('0x13')](_0xcf55('0xe'),_0x29566b,_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);return _0x3018aa(_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);}logger[_0xcf55('0x13')](_0xcf55('0xe'),_0x29566b,_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);return _0x7003f1(_0x3ce5d2[_0xcf55('0x13')][_0xcf55('0x14')]);}else{logger['info'](_0xcf55('0xe'),_0x29566b,_0xcf55('0xf'));_0x7003f1(_0x3ce5d2[_0xcf55('0x15')][_0xcf55('0x14')]);}})[_0xcf55('0x16')](function(_0x4b0c1a){logger[_0xcf55('0x13')](_0xcf55('0xe'),_0x29566b,_0x4b0c1a);_0x3018aa(_0x4b0c1a);});});} \ No newline at end of file +var _0xf61e=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x103aa7,_0x148425){var _0x1aa8a8=function(_0x360436){while(--_0x360436){_0x103aa7['push'](_0x103aa7['shift']());}};_0x1aa8a8(++_0x148425);}(_0xf61e,0x191));var _0xef61=function(_0xd3fef4,_0x5b25e2){_0xd3fef4=_0xd3fef4-0x0;var _0x160e69=_0xf61e[_0xd3fef4];return _0x160e69;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f88b328..c3db990 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c5b=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','/:id/actions','getActions','post','/:id/conditions','addConditions','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2ac3cf,_0x465bb6){var _0x27dcca=function(_0x33f954){while(--_0x33f954){_0x2ac3cf['push'](_0x2ac3cf['shift']());}};_0x27dcca(++_0x465bb6);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x59c874,_0x4a487e){_0x59c874=_0x59c874-0x0;var _0x407a5c=_0x9c5b[_0x59c874];return _0x407a5c;};'use strict';var multer=require(_0xb9c5('0x0'));var util=require('util');var path=require(_0xb9c5('0x1'));var timeout=require('connect-timeout');var express=require(_0xb9c5('0x2'));var router=express[_0xb9c5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb9c5('0x4'));var interaction=require(_0xb9c5('0x5'));var config=require(_0xb9c5('0x6'));var controller=require(_0xb9c5('0x7'));router[_0xb9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xb9c5('0x9')]);router[_0xb9c5('0x8')]('/:id',auth[_0xb9c5('0xa')](),controller[_0xb9c5('0xb')]);router[_0xb9c5('0x8')]('/:id/conditions',auth[_0xb9c5('0xa')](),controller['getConditions']);router['get'](_0xb9c5('0xc'),auth['isAuthenticated'](),controller[_0xb9c5('0xd')]);router[_0xb9c5('0xe')]('/',auth[_0xb9c5('0xa')](),controller['create']);router[_0xb9c5('0xe')](_0xb9c5('0xf'),auth[_0xb9c5('0xa')](),controller[_0xb9c5('0x10')]);router[_0xb9c5('0xe')]('/:id/actions',auth[_0xb9c5('0xa')](),controller['addActions']);router[_0xb9c5('0x11')](_0xb9c5('0x12'),auth[_0xb9c5('0xa')](),controller[_0xb9c5('0x13')]);router[_0xb9c5('0x14')](_0xb9c5('0x12'),auth['isAuthenticated'](),controller[_0xb9c5('0x15')]);module[_0xb9c5('0x16')]=router; \ No newline at end of file +var _0xef89=['/:id/actions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','show','get','/:id/conditions','getConditions','create','addConditions','post'];(function(_0x26e7e4,_0x4d671a){var _0x4a79d7=function(_0x49f05e){while(--_0x49f05e){_0x26e7e4['push'](_0x26e7e4['shift']());}};_0x4a79d7(++_0x4d671a);}(_0xef89,0xf6));var _0x9ef8=function(_0x5b6434,_0x51ba52){_0x5b6434=_0x5b6434-0x0;var _0x20a90c=_0xef89[_0x5b6434];return _0x20a90c;};'use strict';var multer=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var path=require(_0x9ef8('0x2'));var timeout=require(_0x9ef8('0x3'));var express=require(_0x9ef8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ef8('0x5'));var auth=require(_0x9ef8('0x6'));var interaction=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var controller=require(_0x9ef8('0x9'));router['get']('/',auth[_0x9ef8('0xa')](),controller['index']);router['get']('/:id',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xb')]);router[_0x9ef8('0xc')](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xe')]);router[_0x9ef8('0xc')]('/:id/actions',auth[_0x9ef8('0xa')](),controller['getActions']);router['post']('/',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xf')]);router['post'](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x10')]);router[_0x9ef8('0x11')](_0x9ef8('0x12'),auth[_0x9ef8('0xa')](),controller['addActions']);router['put'](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x14')]);router[_0x9ef8('0x15')](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x16')]);module[_0x9ef8('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 516cbc4..f121221 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8880=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x213756,_0x56dbfd){var _0x5518f5=function(_0x120c6a){while(--_0x120c6a){_0x213756['push'](_0x213756['shift']());}};_0x5518f5(++_0x56dbfd);}(_0x8880,0xb5));var _0x0888=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0x8880[_0xd4636c];return _0x5ee17d;};'use strict';var Sequelize=require('sequelize');module[_0x0888('0x0')]={'name':{'type':Sequelize[_0x0888('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0888('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x0888('0x3')},'description':{'type':Sequelize[_0x0888('0x1')]},'active':{'type':Sequelize[_0x0888('0x4')],'defaultValue':0x0,'comment':_0x0888('0x5')},'limitCalls':{'type':Sequelize[_0x0888('0x6')](0x4)[_0x0888('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0888('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0888('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0888('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0888('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0888('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0888('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0888('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0888('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0888('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0888('0x6')](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0888('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0888('0x6')](0x3)[_0x0888('0x7')],'defaultValue':0x3,'comment':_0x0888('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0888('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0888('0xf')},'dialTimezone':{'type':Sequelize[_0x0888('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0888('0x1')],'defaultValue':_0x0888('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x0888('0x2')](_0x0888('0x11'),'never',_0x0888('0x12')),'defaultValue':_0x0888('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0888('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0888('0x6')](0x9)[_0x0888('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0888('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0888('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0888('0x6')](0x9)[_0x0888('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0888('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x0888('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0888('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0888('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0888('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0888('0x6')](0x9)[_0x0888('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0888('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0888('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0888('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0888('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0888('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0888('0x2')](_0x0888('0x1a'),_0x0888('0x1b')),'defaultValue':_0x0888('0x1a')},'dialPrefix':{'type':Sequelize[_0x0888('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x0888('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0888('0x1c')},'dialCutDigit':{'type':Sequelize[_0x0888('0x6')](0x3)[_0x0888('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0888('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0888('0x6')](0x3)[_0x0888('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0888('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0888('0x6')](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0888('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0888('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x0888('0x6')](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0888('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0888('0x6')](0x3)[_0x0888('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0888('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0888('0x6')](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0888('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0888('0x6')](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0888('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0888('0x6')](0x5)[_0x0888('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0888('0x22')}}; \ No newline at end of file +var _0x63bf=['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)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#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)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x58c30e,_0x55a97b){var _0x570768=function(_0x40c1f9){while(--_0x40c1f9){_0x58c30e['push'](_0x58c30e['shift']());}};_0x570768(++_0x55a97b);}(_0x63bf,0xd7));var _0xf63b=function(_0x25ff74,_0x37864c){_0x25ff74=_0x25ff74-0x0;var _0x3e9649=_0x63bf[_0x25ff74];return _0x3e9649;};'use strict';var Sequelize=require('sequelize');module[_0xf63b('0x0')]={'name':{'type':Sequelize[_0xf63b('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x3')),'allowNull':![],'defaultValue':_0xf63b('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf63b('0x4')],'defaultValue':0x0,'comment':_0xf63b('0x5')},'limitCalls':{'type':Sequelize[_0xf63b('0x6')](0x4)[_0xf63b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf63b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf63b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'comment':_0xf63b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf63b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xf63b('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x11'),'never',_0xf63b('0x12')),'defaultValue':_0xf63b('0x11')},'dialAMDActive':{'type':Sequelize[_0xf63b('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf63b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf63b('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf63b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf63b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf63b('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf63b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf63b('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf63b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf63b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf63b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf63b('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x1a'),_0xf63b('0x1b')),'defaultValue':_0xf63b('0x1a')},'dialPrefix':{'type':Sequelize[_0xf63b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf63b('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf63b('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9af7fdd..922946e 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xceb0=['options','includeAll','rows','params','rawAttributes','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','nolimit','order','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','insert','ListId','NOW()','cm_contacts','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL'];(function(_0x95fa9d,_0x1e3ed6){var _0x3140a2=function(_0x2f8f0f){while(--_0x2f8f0f){_0x95fa9d['push'](_0x95fa9d['shift']());}};_0x3140a2(++_0x1e3ed6);}(_0xceb0,0x173));var _0x0ceb=function(_0x2233e1,_0x4aaf7e){_0x2233e1=_0x2233e1-0x0;var _0x364661=_0xceb0[_0x2233e1];return _0x364661;};'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(_0x0ceb('0x0'));var moment=require('moment');var BPromise=require(_0x0ceb('0x1'));var Mustache=require(_0x0ceb('0x2'));var util=require(_0x0ceb('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x0ceb('0x4'));var ejs=require(_0x0ceb('0x5'));var fs=require('fs');var fs_extra=require(_0x0ceb('0x6'));var _=require('lodash');var squel=require(_0x0ceb('0x7'));var crypto=require(_0x0ceb('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0ceb('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0ceb('0xa'));var Papa=require(_0x0ceb('0xb'));var Redis=require(_0x0ceb('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ceb('0xd'));var hardwareService=require(_0x0ceb('0xe'));var logger=require(_0x0ceb('0xf'))(_0x0ceb('0x10'));var utils=require(_0x0ceb('0x11'));var config=require(_0x0ceb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ceb('0x13'))['db'];function respondWithStatusCode(_0xe19006,_0x358801){_0x358801=_0x358801||0xcc;return function(_0x26cb7a){if(_0x26cb7a){return _0xe19006[_0x0ceb('0x14')](_0x358801);}return _0xe19006[_0x0ceb('0x15')](_0x358801)[_0x0ceb('0x16')]();};}function respondWithResult(_0x54f34e,_0x416fbb){_0x416fbb=_0x416fbb||0xc8;return function(_0x54a173){if(_0x54a173){return _0x54f34e['status'](_0x416fbb)[_0x0ceb('0x17')](_0x54a173);}};}function respondWithFilteredResult(_0x2e6128,_0x218d6e){return function(_0x536bdd){if(_0x536bdd){var _0x33a190=typeof _0x218d6e[_0x0ceb('0x18')]==='undefined'&&typeof _0x218d6e[_0x0ceb('0x19')]===_0x0ceb('0x1a');var _0x2046b6=_0x536bdd[_0x0ceb('0x1b')];var _0x18bed1=_0x33a190?0x0:_0x218d6e[_0x0ceb('0x18')];var _0x2c5a89=_0x33a190?_0x536bdd[_0x0ceb('0x1b')]:_0x218d6e[_0x0ceb('0x18')]+_0x218d6e[_0x0ceb('0x19')];var _0x9aaa59;if(_0x2c5a89>=_0x2046b6){_0x2c5a89=_0x2046b6;_0x9aaa59=0xc8;}else{_0x9aaa59=0xce;}_0x2e6128[_0x0ceb('0x15')](_0x9aaa59);return _0x2e6128[_0x0ceb('0x1c')](_0x0ceb('0x1d'),_0x18bed1+'-'+_0x2c5a89+'/'+_0x2046b6)[_0x0ceb('0x17')](_0x536bdd);}return null;};}function patchUpdates(_0x3dd970){return function(_0x241c07){try{jsonpatch['apply'](_0x241c07,_0x3dd970,!![]);}catch(_0x4eb712){return BPromise[_0x0ceb('0x1e')](_0x4eb712);}return _0x241c07[_0x0ceb('0x1f')]();};}function saveUpdates(_0x5d1235,_0x2fd374){return function(_0x54fce7){if(_0x54fce7){return _0x54fce7[_0x0ceb('0x20')](_0x5d1235)[_0x0ceb('0x21')](function(_0x28fb61){return _0x28fb61;});}return null;};}function removeEntity(_0x17efd7,_0x27e058){return function(_0x4a2b69){if(_0x4a2b69){return _0x4a2b69['destroy']()['then'](function(){var _0x1a1ab3=_0x4a2b69['get']({'plain':!![]});var _0x336ce9='IvrCampaigns';return db[_0x0ceb('0x22')][_0x0ceb('0x23')]({'where':{'type':_0x336ce9,'resourceId':_0x1a1ab3['id']}})[_0x0ceb('0x21')](function(){return _0x4a2b69;});})[_0x0ceb('0x21')](function(){_0x17efd7['status'](0xcc)[_0x0ceb('0x16')]();});}};}function handleEntityNotFound(_0x9246e1,_0x15a556){return function(_0x1451d3){if(!_0x1451d3){_0x9246e1[_0x0ceb('0x14')](0x194);}return _0x1451d3;};}function handleError(_0x4aa831,_0x2de4f3){_0x2de4f3=_0x2de4f3||0x1f4;return function(_0x3792bb){logger[_0x0ceb('0x24')](_0x3792bb[_0x0ceb('0x25')]);if(_0x3792bb[_0x0ceb('0x26')]){delete _0x3792bb[_0x0ceb('0x26')];}_0x4aa831['status'](_0x2de4f3)[_0x0ceb('0x27')](_0x3792bb);};}exports[_0x0ceb('0x28')]=function(_0x1b5337,_0x385d68){var _0x331e98={},_0x128102={},_0x1b97b4={'count':0x0,'rows':[]};var _0x293d4d=_[_0x0ceb('0x29')](db[_0x0ceb('0x2a')]['rawAttributes'],function(_0x503d0c){return{'name':_0x503d0c[_0x0ceb('0x2b')],'type':_0x503d0c['type'][_0x0ceb('0x2c')]};});_0x128102[_0x0ceb('0x2d')]=_[_0x0ceb('0x29')](_0x293d4d,'name');_0x128102[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x1b5337[_0x0ceb('0x2e')]);_0x128102[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x128102[_0x0ceb('0x2d')],_0x128102[_0x0ceb('0x2e')]);_0x331e98[_0x0ceb('0x32')]=_[_0x0ceb('0x31')](_0x128102[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x331e98['attributes']=_0x331e98[_0x0ceb('0x32')][_0x0ceb('0x34')]?_0x331e98[_0x0ceb('0x32')]:_0x128102[_0x0ceb('0x2d')];if(!_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x35')]('nolimit')){_0x331e98[_0x0ceb('0x19')]=qs['limit'](_0x1b5337['query']['limit']);_0x331e98[_0x0ceb('0x18')]=qs['offset'](_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x18')]);}_0x331e98['order']=qs[_0x0ceb('0x36')](_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x36')]);_0x331e98['where']=qs[_0x0ceb('0x30')](_[_0x0ceb('0x37')](_0x1b5337[_0x0ceb('0x2e')],_0x128102[_0x0ceb('0x30')]),_0x293d4d);if(_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x331e98[_0x0ceb('0x39')]=_[_0x0ceb('0x3a')](_0x331e98[_0x0ceb('0x39')],{'$or':_[_0x0ceb('0x29')](_0x293d4d,function(_0x10772c){if(_0x10772c[_0x0ceb('0x3b')]!==_0x0ceb('0x3c')){var _0x44099a={};_0x44099a[_0x10772c[_0x0ceb('0x26')]]={'$like':'%'+_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x44099a;}})});}_0x331e98=_[_0x0ceb('0x3a')]({},_0x331e98,_0x1b5337[_0x0ceb('0x3d')]);var _0x1368c5={'where':_0x331e98[_0x0ceb('0x39')]};return db[_0x0ceb('0x2a')][_0x0ceb('0x1b')](_0x1368c5)[_0x0ceb('0x21')](function(_0xe65a48){_0x1b97b4[_0x0ceb('0x1b')]=_0xe65a48;if(_0x1b5337[_0x0ceb('0x2e')][_0x0ceb('0x3e')]){_0x331e98['include']=[{'all':!![]}];}return db[_0x0ceb('0x2a')]['findAll'](_0x331e98);})['then'](function(_0x3d2607){_0x1b97b4[_0x0ceb('0x3f')]=_0x3d2607;return _0x1b97b4;})[_0x0ceb('0x21')](respondWithFilteredResult(_0x385d68,_0x331e98))['catch'](handleError(_0x385d68,null));};exports['show']=function(_0x13072a,_0x2f2f71){var _0x2cb999={'raw':![],'where':{'id':_0x13072a[_0x0ceb('0x40')]['id']}},_0x17ab4a={};_0x17ab4a[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db[_0x0ceb('0x2a')][_0x0ceb('0x41')]);_0x17ab4a['query']=_[_0x0ceb('0x2f')](_0x13072a[_0x0ceb('0x2e')]);_0x17ab4a[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x17ab4a['model'],_0x17ab4a[_0x0ceb('0x2e')]);_0x2cb999['attributes']=_[_0x0ceb('0x31')](_0x17ab4a['model'],qs[_0x0ceb('0x33')](_0x13072a[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x2cb999[_0x0ceb('0x32')]=_0x2cb999[_0x0ceb('0x32')][_0x0ceb('0x34')]?_0x2cb999[_0x0ceb('0x32')]:_0x17ab4a[_0x0ceb('0x2d')];if(_0x13072a['query'][_0x0ceb('0x3e')]){_0x2cb999[_0x0ceb('0x42')]=[{'all':!![]}];}_0x2cb999=_['merge']({},_0x2cb999,_0x13072a[_0x0ceb('0x3d')]);return db[_0x0ceb('0x2a')][_0x0ceb('0x43')](_0x2cb999)[_0x0ceb('0x21')](handleEntityNotFound(_0x2f2f71,null))[_0x0ceb('0x21')](respondWithResult(_0x2f2f71,null))['catch'](handleError(_0x2f2f71,null));};exports[_0x0ceb('0x44')]=function(_0x256760,_0x1a7c52){return db[_0x0ceb('0x2a')][_0x0ceb('0x44')](_0x256760[_0x0ceb('0x45')],{})[_0x0ceb('0x21')](function(_0x410e42){var _0x16e90f=_0x256760['user'][_0x0ceb('0x46')]({'plain':!![]});if(!_0x16e90f)throw new Error(_0x0ceb('0x47'));if(_0x16e90f[_0x0ceb('0x48')]===_0x0ceb('0x49')){var _0x51a9c8=_0x410e42['get']({'plain':!![]});var _0x34a427=_0x0ceb('0x4a');return db[_0x0ceb('0x4b')][_0x0ceb('0x43')]({'where':{'name':_0x34a427,'userProfileId':_0x16e90f[_0x0ceb('0x4c')]},'raw':!![]})['then'](function(_0x1afcd6){if(_0x1afcd6&&_0x1afcd6[_0x0ceb('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x51a9c8['name'],'resourceId':_0x51a9c8['id'],'type':_0x1afcd6[_0x0ceb('0x26')],'sectionId':_0x1afcd6['id']},{})[_0x0ceb('0x21')](function(){return _0x410e42;});}else{return _0x410e42;}})[_0x0ceb('0x4e')](function(_0x47c4d6){logger[_0x0ceb('0x24')](_0x0ceb('0x4f'),_0x47c4d6);throw _0x47c4d6;});}return _0x410e42;})['then'](respondWithResult(_0x1a7c52,0xc9))[_0x0ceb('0x4e')](handleError(_0x1a7c52,null));};exports[_0x0ceb('0x50')]=function(_0x2d4947,_0x51addf){var _0x3fe549={'where':{'id':_0x2d4947[_0x0ceb('0x40')]['id']}},_0x4d057f={};_0x4d057f[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db[_0x0ceb('0x2a')][_0x0ceb('0x41')]);_0x3fe549['attributes']=_[_0x0ceb('0x31')](_0x4d057f[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x2d4947[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x3fe549[_0x0ceb('0x32')]=_0x3fe549[_0x0ceb('0x32')][_0x0ceb('0x34')]?_0x3fe549[_0x0ceb('0x32')]:_0x4d057f[_0x0ceb('0x2d')];if(_0x2d4947['query'][_0x0ceb('0x3e')]){_0x3fe549[_0x0ceb('0x42')]=[{'all':!![]}];}_0x3fe549=_[_0x0ceb('0x3a')]({},_0x3fe549,_0x2d4947[_0x0ceb('0x3d')]);return db[_0x0ceb('0x2a')][_0x0ceb('0x43')](_0x3fe549)[_0x0ceb('0x21')](handleEntityNotFound(_0x51addf,null))['then'](function(_0x107a37){if(_0x107a37){var _0x391e2e=_0x107a37[_0x0ceb('0x46')]({'plain':!![]});_0x391e2e=qs[_0x0ceb('0x51')](_0x391e2e,['id',_0x0ceb('0x52'),_0x0ceb('0x53')]);_0x2d4947[_0x0ceb('0x45')]=_[_0x0ceb('0x51')](_0x2d4947[_0x0ceb('0x45')],['id',_0x0ceb('0x52'),_0x0ceb('0x53')]);return db['Campaign'][_0x0ceb('0x44')](_[_0x0ceb('0x3a')](_0x391e2e,_0x2d4947[_0x0ceb('0x45')]),{'include':_0x2d4947[_0x0ceb('0x2e')][_0x0ceb('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x5afd08){var _0x38da0b=_0x2d4947['user'][_0x0ceb('0x46')]({'plain':!![]});if(!_0x38da0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38da0b[_0x0ceb('0x48')]===_0x0ceb('0x49')){var _0x3dba7d=_0x5afd08[_0x0ceb('0x46')]({'plain':!![]});var _0x1b2ba9='IvrCampaigns';return db[_0x0ceb('0x4b')][_0x0ceb('0x43')]({'where':{'name':_0x1b2ba9,'userProfileId':_0x38da0b[_0x0ceb('0x4c')]},'raw':!![]})[_0x0ceb('0x21')](function(_0x4412f0){if(_0x4412f0&&_0x4412f0[_0x0ceb('0x4d')]===0x0){return db['UserProfileResource'][_0x0ceb('0x44')]({'name':_0x3dba7d[_0x0ceb('0x26')],'resourceId':_0x3dba7d['id'],'type':_0x4412f0[_0x0ceb('0x26')],'sectionId':_0x4412f0['id']},{})[_0x0ceb('0x21')](function(){return _0x5afd08;});}else{return _0x5afd08;}})['catch'](function(_0x5e53f8){logger[_0x0ceb('0x24')](_0x0ceb('0x4f'),_0x5e53f8);throw _0x5e53f8;});}return _0x5afd08;});}})[_0x0ceb('0x21')](respondWithResult(_0x51addf,0xc9))[_0x0ceb('0x4e')](handleError(_0x51addf,null));};exports[_0x0ceb('0x20')]=function(_0x27bc5e,_0x3c4fbe){if(_0x27bc5e['body']['id']){delete _0x27bc5e[_0x0ceb('0x45')]['id'];}return db[_0x0ceb('0x2a')][_0x0ceb('0x43')]({'where':{'id':_0x27bc5e[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x3c4fbe,null))[_0x0ceb('0x21')](saveUpdates(_0x27bc5e[_0x0ceb('0x45')],null))[_0x0ceb('0x21')](respondWithResult(_0x3c4fbe,null))[_0x0ceb('0x4e')](handleError(_0x3c4fbe,null));};exports[_0x0ceb('0x23')]=function(_0x5be1a1,_0x56e3a8){return db[_0x0ceb('0x2a')][_0x0ceb('0x43')]({'where':{'id':_0x5be1a1[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x56e3a8,null))[_0x0ceb('0x21')](removeEntity(_0x56e3a8,null))[_0x0ceb('0x4e')](handleError(_0x56e3a8,null));};exports[_0x0ceb('0x54')]=function(_0x58ebb8,_0x2af2b,_0x1b2a48){var _0x21945c={'raw':!![],'where':{}};var _0x53025d={};var _0x3f5c74={'count':0x0,'rows':[]};return db[_0x0ceb('0x2a')][_0x0ceb('0x55')]({'where':{'id':_0x58ebb8[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x2af2b,null))[_0x0ceb('0x21')](function(_0x1146f3){if(_0x1146f3){_0x53025d[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db[_0x0ceb('0x56')]['rawAttributes']);_0x53025d[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x58ebb8[_0x0ceb('0x2e')]);_0x53025d['filters']=_[_0x0ceb('0x31')](_0x53025d[_0x0ceb('0x2d')],_0x53025d[_0x0ceb('0x2e')]);_0x21945c['attributes']=_[_0x0ceb('0x31')](_0x53025d[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x58ebb8[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x21945c['attributes']=_0x21945c['attributes']['length']?_0x21945c[_0x0ceb('0x32')]:_0x53025d['model'];if(!_0x58ebb8[_0x0ceb('0x2e')][_0x0ceb('0x35')](_0x0ceb('0x57'))){_0x21945c[_0x0ceb('0x19')]=qs['limit'](_0x58ebb8[_0x0ceb('0x2e')][_0x0ceb('0x19')]);_0x21945c['offset']=qs[_0x0ceb('0x18')](_0x58ebb8['query'][_0x0ceb('0x18')]);}_0x21945c[_0x0ceb('0x58')]=qs[_0x0ceb('0x36')](_0x58ebb8[_0x0ceb('0x2e')]['sort']);_0x21945c[_0x0ceb('0x39')]=qs[_0x0ceb('0x30')](_[_0x0ceb('0x37')](_0x58ebb8['query'],_0x53025d[_0x0ceb('0x30')]));_0x21945c['where'][_0x0ceb('0x59')]=_0x1146f3['id'];if(_0x58ebb8[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x21945c[_0x0ceb('0x39')]=_[_0x0ceb('0x3a')](_0x21945c[_0x0ceb('0x39')],{'$or':_['map'](_0x21945c[_0x0ceb('0x32')],function(_0x1097f9){var _0x30b653={};_0x30b653[_0x1097f9]={'$like':'%'+_0x58ebb8[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x30b653;})});}_0x21945c=_[_0x0ceb('0x3a')]({},_0x21945c,_0x58ebb8[_0x0ceb('0x3d')]);return db[_0x0ceb('0x56')]['count']({'where':_0x21945c[_0x0ceb('0x39')]})[_0x0ceb('0x21')](function(_0x225735){_0x3f5c74['count']=_0x225735;if(_0x58ebb8[_0x0ceb('0x2e')][_0x0ceb('0x3e')]){_0x21945c[_0x0ceb('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0ceb('0x5a')](_0x21945c);})['then'](function(_0x5b7511){_0x3f5c74[_0x0ceb('0x3f')]=_0x5b7511;return _0x3f5c74;});}})[_0x0ceb('0x21')](respondWithFilteredResult(_0x2af2b,_0x21945c))['catch'](handleError(_0x2af2b,null));};exports[_0x0ceb('0x5b')]=function(_0x86891b,_0x593ae0,_0x1c08a6){var _0x22585c={'raw':!![],'where':{}};var _0x517162={};var _0x5efd29={'count':0x0,'rows':[]};return db[_0x0ceb('0x2a')][_0x0ceb('0x55')]({'where':{'id':_0x86891b[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x593ae0,null))[_0x0ceb('0x21')](function(_0x3b952a){if(_0x3b952a){_0x517162[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db['CmHopperHistory'][_0x0ceb('0x41')]);_0x517162[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x86891b[_0x0ceb('0x2e')]);_0x517162[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x517162[_0x0ceb('0x2d')],_0x517162['query']);_0x22585c[_0x0ceb('0x32')]=_[_0x0ceb('0x31')](_0x517162[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x86891b[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x22585c['attributes']=_0x22585c[_0x0ceb('0x32')][_0x0ceb('0x34')]?_0x22585c[_0x0ceb('0x32')]:_0x517162[_0x0ceb('0x2d')];if(!_0x86891b[_0x0ceb('0x2e')][_0x0ceb('0x35')]('nolimit')){_0x22585c[_0x0ceb('0x19')]=qs[_0x0ceb('0x19')](_0x86891b[_0x0ceb('0x2e')][_0x0ceb('0x19')]);_0x22585c[_0x0ceb('0x18')]=qs['offset'](_0x86891b[_0x0ceb('0x2e')]['offset']);}_0x22585c[_0x0ceb('0x58')]=qs[_0x0ceb('0x36')](_0x86891b[_0x0ceb('0x2e')][_0x0ceb('0x36')]);_0x22585c[_0x0ceb('0x39')]=qs[_0x0ceb('0x30')](_[_0x0ceb('0x37')](_0x86891b[_0x0ceb('0x2e')],_0x517162[_0x0ceb('0x30')]));_0x22585c['where'][_0x0ceb('0x59')]=_0x3b952a['id'];if(_0x86891b[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x22585c[_0x0ceb('0x39')]=_[_0x0ceb('0x3a')](_0x22585c['where'],{'$or':_[_0x0ceb('0x29')](_0x22585c[_0x0ceb('0x32')],function(_0x5bfc47){var _0x48a44e={};_0x48a44e[_0x5bfc47]={'$like':'%'+_0x86891b[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x48a44e;})});}_0x22585c=_[_0x0ceb('0x3a')]({},_0x22585c,_0x86891b[_0x0ceb('0x3d')]);return db[_0x0ceb('0x5c')][_0x0ceb('0x1b')]({'where':_0x22585c[_0x0ceb('0x39')]})[_0x0ceb('0x21')](function(_0x3e20bc){_0x5efd29[_0x0ceb('0x1b')]=_0x3e20bc;if(_0x86891b[_0x0ceb('0x2e')]['includeAll']){_0x22585c['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0ceb('0x5a')](_0x22585c);})[_0x0ceb('0x21')](function(_0x2f9e99){_0x5efd29[_0x0ceb('0x3f')]=_0x2f9e99;return _0x5efd29;});}})['then'](respondWithFilteredResult(_0x593ae0,_0x22585c))[_0x0ceb('0x4e')](handleError(_0x593ae0,null));};exports[_0x0ceb('0x5d')]=function(_0x354cc9,_0x88170a,_0xbc0ec8){var _0x254a8a={'raw':!![],'where':{}};var _0x7021e9={};var _0x3dd13d={'count':0x0,'rows':[]};return db[_0x0ceb('0x2a')][_0x0ceb('0x55')]({'where':{'id':_0x354cc9[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x88170a,null))[_0x0ceb('0x21')](function(_0x480465){if(_0x480465){_0x7021e9[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db[_0x0ceb('0x5e')][_0x0ceb('0x41')]);_0x7021e9[_0x0ceb('0x2e')]=_['keys'](_0x354cc9[_0x0ceb('0x2e')]);_0x7021e9['filters']=_[_0x0ceb('0x31')](_0x7021e9[_0x0ceb('0x2d')],_0x7021e9[_0x0ceb('0x2e')]);_0x254a8a[_0x0ceb('0x32')]=_['intersection'](_0x7021e9[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x354cc9[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x254a8a['attributes']=_0x254a8a[_0x0ceb('0x32')]['length']?_0x254a8a[_0x0ceb('0x32')]:_0x7021e9['model'];if(!_0x354cc9[_0x0ceb('0x2e')]['hasOwnProperty'](_0x0ceb('0x57'))){_0x254a8a[_0x0ceb('0x19')]=qs['limit'](_0x354cc9[_0x0ceb('0x2e')]['limit']);_0x254a8a[_0x0ceb('0x18')]=qs[_0x0ceb('0x18')](_0x354cc9[_0x0ceb('0x2e')][_0x0ceb('0x18')]);}_0x254a8a[_0x0ceb('0x58')]=qs[_0x0ceb('0x36')](_0x354cc9[_0x0ceb('0x2e')][_0x0ceb('0x36')]);_0x254a8a['where']=qs[_0x0ceb('0x30')](_['pick'](_0x354cc9[_0x0ceb('0x2e')],_0x7021e9[_0x0ceb('0x30')]));_0x254a8a['where'][_0x0ceb('0x59')]=_0x480465['id'];if(_0x354cc9[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x254a8a[_0x0ceb('0x39')]=_[_0x0ceb('0x3a')](_0x254a8a[_0x0ceb('0x39')],{'$or':_[_0x0ceb('0x29')](_0x254a8a[_0x0ceb('0x32')],function(_0x38bc57){var _0x428c2b={};_0x428c2b[_0x38bc57]={'$like':'%'+_0x354cc9['query'][_0x0ceb('0x38')]+'%'};return _0x428c2b;})});}_0x254a8a=_[_0x0ceb('0x3a')]({},_0x254a8a,_0x354cc9[_0x0ceb('0x3d')]);return db[_0x0ceb('0x5e')][_0x0ceb('0x1b')]({'where':_0x254a8a['where']})[_0x0ceb('0x21')](function(_0x39b0ba){_0x3dd13d[_0x0ceb('0x1b')]=_0x39b0ba;if(_0x354cc9[_0x0ceb('0x2e')][_0x0ceb('0x3e')]){_0x254a8a[_0x0ceb('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0ceb('0x5a')](_0x254a8a);})[_0x0ceb('0x21')](function(_0x342d36){_0x3dd13d[_0x0ceb('0x3f')]=_0x342d36;return _0x3dd13d;});}})['then'](respondWithFilteredResult(_0x88170a,_0x254a8a))['catch'](handleError(_0x88170a,null));};exports[_0x0ceb('0x5f')]=function(_0x87a23d,_0x2ae363,_0x52ebc8){var _0x1af90b={'raw':!![],'where':{}};var _0x803210={};var _0xeb1c83={'count':0x0,'rows':[]};return db[_0x0ceb('0x2a')]['findOne']({'where':{'id':_0x87a23d[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x2ae363,null))[_0x0ceb('0x21')](function(_0xb9f7db){if(_0xb9f7db){_0x803210['model']=_[_0x0ceb('0x2f')](db[_0x0ceb('0x60')]['rawAttributes']);_0x803210[_0x0ceb('0x2e')]=_['keys'](_0x87a23d[_0x0ceb('0x2e')]);_0x803210[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x803210[_0x0ceb('0x2d')],_0x803210[_0x0ceb('0x2e')]);_0x1af90b[_0x0ceb('0x32')]=_['intersection'](_0x803210[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x87a23d['query'][_0x0ceb('0x33')]));_0x1af90b[_0x0ceb('0x32')]=_0x1af90b['attributes'][_0x0ceb('0x34')]?_0x1af90b[_0x0ceb('0x32')]:_0x803210[_0x0ceb('0x2d')];if(!_0x87a23d[_0x0ceb('0x2e')][_0x0ceb('0x35')](_0x0ceb('0x57'))){_0x1af90b['limit']=qs[_0x0ceb('0x19')](_0x87a23d[_0x0ceb('0x2e')][_0x0ceb('0x19')]);_0x1af90b[_0x0ceb('0x18')]=qs[_0x0ceb('0x18')](_0x87a23d['query'][_0x0ceb('0x18')]);}_0x1af90b['order']=qs[_0x0ceb('0x36')](_0x87a23d['query'][_0x0ceb('0x36')]);_0x1af90b[_0x0ceb('0x39')]=qs[_0x0ceb('0x30')](_[_0x0ceb('0x37')](_0x87a23d['query'],_0x803210[_0x0ceb('0x30')]));_0x1af90b[_0x0ceb('0x39')]['CampaignId']=_0xb9f7db['id'];if(_0x87a23d['query'][_0x0ceb('0x38')]){_0x1af90b[_0x0ceb('0x39')]=_[_0x0ceb('0x3a')](_0x1af90b[_0x0ceb('0x39')],{'$or':_[_0x0ceb('0x29')](_0x1af90b[_0x0ceb('0x32')],function(_0x1fe92e){var _0x3595e8={};_0x3595e8[_0x1fe92e]={'$like':'%'+_0x87a23d['query'][_0x0ceb('0x38')]+'%'};return _0x3595e8;})});}_0x1af90b=_[_0x0ceb('0x3a')]({},_0x1af90b,_0x87a23d[_0x0ceb('0x3d')]);return db[_0x0ceb('0x60')][_0x0ceb('0x1b')]({'where':_0x1af90b['where']})[_0x0ceb('0x21')](function(_0x393e70){_0xeb1c83['count']=_0x393e70;if(_0x87a23d[_0x0ceb('0x2e')][_0x0ceb('0x3e')]){_0x1af90b[_0x0ceb('0x42')]=[{'all':!![]}];}return db[_0x0ceb('0x60')]['findAll'](_0x1af90b);})['then'](function(_0x44c57b){_0xeb1c83[_0x0ceb('0x3f')]=_0x44c57b;return _0xeb1c83;});}})[_0x0ceb('0x21')](respondWithFilteredResult(_0x2ae363,_0x1af90b))['catch'](handleError(_0x2ae363,null));};exports[_0x0ceb('0x61')]=function(_0xba3a34,_0x41c049,_0x499869){var _0x2078f5={};var _0x44447e={};var _0x752d67;var _0x321f22;return db[_0x0ceb('0x2a')]['findOne']({'where':{'id':_0xba3a34[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x41c049,null))[_0x0ceb('0x21')](function(_0x1daf76){if(_0x1daf76){_0x752d67=_0x1daf76;_0x44447e[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db[_0x0ceb('0x62')][_0x0ceb('0x41')]);_0x44447e[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0xba3a34[_0x0ceb('0x2e')]);_0x44447e[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x44447e['model'],_0x44447e[_0x0ceb('0x2e')]);_0x2078f5[_0x0ceb('0x32')]=_['intersection'](_0x44447e['model'],qs[_0x0ceb('0x33')](_0xba3a34[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x2078f5[_0x0ceb('0x32')]=_0x2078f5[_0x0ceb('0x32')]['length']?_0x2078f5[_0x0ceb('0x32')]:_0x44447e[_0x0ceb('0x2d')];_0x2078f5[_0x0ceb('0x58')]=qs['sort'](_0xba3a34[_0x0ceb('0x2e')]['sort']);_0x2078f5[_0x0ceb('0x39')]=qs[_0x0ceb('0x30')](_[_0x0ceb('0x37')](_0xba3a34[_0x0ceb('0x2e')],_0x44447e[_0x0ceb('0x30')]));if(_0xba3a34[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x2078f5[_0x0ceb('0x39')]=_['merge'](_0x2078f5[_0x0ceb('0x39')],{'$or':_[_0x0ceb('0x29')](_0x2078f5[_0x0ceb('0x32')],function(_0x11e8e0){var _0x1bac42={};_0x1bac42[_0x11e8e0]={'$like':'%'+_0xba3a34[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x1bac42;})});}_0x2078f5=_[_0x0ceb('0x3a')]({},_0x2078f5,_0xba3a34[_0x0ceb('0x3d')]);return _0x752d67['getLists'](_0x2078f5);}})[_0x0ceb('0x21')](function(_0xde54b5){if(_0xde54b5){_0x321f22=_0xde54b5[_0x0ceb('0x34')];if(!_0xba3a34['query'][_0x0ceb('0x35')]('nolimit')){_0x2078f5[_0x0ceb('0x19')]=qs[_0x0ceb('0x19')](_0xba3a34['query'][_0x0ceb('0x19')]);_0x2078f5[_0x0ceb('0x18')]=qs[_0x0ceb('0x18')](_0xba3a34[_0x0ceb('0x2e')]['offset']);}return _0x752d67[_0x0ceb('0x61')](_0x2078f5);}})[_0x0ceb('0x21')](function(_0x16920a){if(_0x16920a){return _0x16920a?{'count':_0x321f22,'rows':_0x16920a}:null;}})['then'](respondWithResult(_0x41c049,null))[_0x0ceb('0x4e')](handleError(_0x41c049,null));};exports[_0x0ceb('0x63')]=function(_0x5244ea,_0x1a0ff6,_0x4319c5){var _0x42dfe2,_0x4b98cf;var _0xa64391=[];var _0x507155=moment()[_0x0ceb('0x64')](_0x0ceb('0x65'));return db[_0x0ceb('0x2a')]['find']({'where':{'id':_0x5244ea[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x1a0ff6,null))['then'](function(_0x453dc9){if(_0x453dc9){_0x4b98cf=_0x453dc9;return _0x453dc9['addLists'](_0x5244ea[_0x0ceb('0x45')]['ids'],_['omit'](_0x5244ea[_0x0ceb('0x45')],[_0x0ceb('0x66'),'id'])||{});}return null;})[_0x0ceb('0x67')](function(_0x4d780c){var _0x35e0af;var _0x49493f;_0x42dfe2=_0x4d780c||[];var _0x4be157=[];if(_0x4d780c){for(var _0x274912=0x0;_0x274912<_0x4d780c[_0x0ceb('0x34')];_0x274912+=0x1){var _0x4375d6=_0x4d780c[_0x274912]['get']({'plain':!![]});_0x4b98cf[_0x0ceb('0x68')]=_0x5244ea[_0x0ceb('0x45')][_0x0ceb('0x68')]?_0x5244ea['body'][_0x0ceb('0x68')]:_0x4b98cf[_0x0ceb('0x68')];switch(_0x4b98cf[_0x0ceb('0x68')]){case _0x0ceb('0x69'):_0x35e0af=squel['insert']()[_0x0ceb('0x6a')](_0x0ceb('0x6b'))[_0x0ceb('0x6c')]([_0x0ceb('0x6d'),_0x0ceb('0x6e'),_0x0ceb('0x6f'),'ListId',_0x0ceb('0x59'),_0x0ceb('0x52'),'updatedAt'],squel[_0x0ceb('0x70')]()['field'](_0x0ceb('0x6d'),'phone')['field']('NOW()',_0x0ceb('0x6e'))[_0x0ceb('0x71')]('id',_0x0ceb('0x6f'))[_0x0ceb('0x71')](_0x4375d6['CmListId'][_0x0ceb('0x72')](),'ListId')[_0x0ceb('0x71')](_0x5244ea['params']['id'][_0x0ceb('0x72')](),_0x0ceb('0x59'))[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27',_0x0ceb('0x52'))[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27',_0x0ceb('0x53'))[_0x0ceb('0x73')]('cm_contacts')[_0x0ceb('0x39')](_0x0ceb('0x74'))[_0x0ceb('0x39')](_0x0ceb('0x75'),_0x4375d6[_0x0ceb('0x76')]['toString']())[_0x0ceb('0x39')](_0x0ceb('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0ceb('0x70')]()[_0x0ceb('0x71')](_0x0ceb('0x78'))[_0x0ceb('0x73')](_0x0ceb('0x79'))[_0x0ceb('0x39')](_0x0ceb('0x7a'),_0x5244ea[_0x0ceb('0x40')]['id']['toString']()))[_0x0ceb('0x39')](_0x0ceb('0x7b'),squel[_0x0ceb('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x0ceb('0x73')](_0x0ceb('0x6b'))[_0x0ceb('0x39')](_0x0ceb('0x7a'),_0x5244ea[_0x0ceb('0x40')]['id'][_0x0ceb('0x72')]())))[_0x0ceb('0x72')]();break;case'onlyIfOpen':_0x35e0af=squel[_0x0ceb('0x7c')]()[_0x0ceb('0x6a')](_0x0ceb('0x6b'))[_0x0ceb('0x6c')]([_0x0ceb('0x6d'),'scheduledAt',_0x0ceb('0x6f'),_0x0ceb('0x7d'),_0x0ceb('0x59'),'createdAt',_0x0ceb('0x53')],squel[_0x0ceb('0x70')]()['field']('phone',_0x0ceb('0x6d'))['field'](_0x0ceb('0x7e'),_0x0ceb('0x6e'))[_0x0ceb('0x71')]('id',_0x0ceb('0x6f'))[_0x0ceb('0x71')](_0x4375d6[_0x0ceb('0x76')]['toString'](),_0x0ceb('0x7d'))[_0x0ceb('0x71')](_0x5244ea[_0x0ceb('0x40')]['id'][_0x0ceb('0x72')](),'CampaignId')[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27','createdAt')[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27','updatedAt')[_0x0ceb('0x73')](_0x0ceb('0x7f'))[_0x0ceb('0x39')](_0x0ceb('0x74'))['where'](_0x0ceb('0x75'),_0x4375d6[_0x0ceb('0x76')][_0x0ceb('0x72')]())[_0x0ceb('0x39')](_0x0ceb('0x77'))[_0x0ceb('0x39')](_0x0ceb('0x7b'),squel[_0x0ceb('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x0ceb('0x73')](_0x0ceb('0x6b'))['where'](_0x0ceb('0x7a'),_0x5244ea[_0x0ceb('0x40')]['id'][_0x0ceb('0x72')]())))[_0x0ceb('0x72')]();break;default:_0x35e0af=squel[_0x0ceb('0x7c')]()[_0x0ceb('0x6a')](_0x0ceb('0x6b'))[_0x0ceb('0x6c')](['phone',_0x0ceb('0x6e'),_0x0ceb('0x6f'),_0x0ceb('0x7d'),_0x0ceb('0x59'),_0x0ceb('0x52'),_0x0ceb('0x53')],squel[_0x0ceb('0x70')]()[_0x0ceb('0x71')](_0x0ceb('0x6d'),'phone')[_0x0ceb('0x71')]('NOW()',_0x0ceb('0x6e'))[_0x0ceb('0x71')]('id',_0x0ceb('0x6f'))[_0x0ceb('0x71')](_0x4375d6[_0x0ceb('0x76')][_0x0ceb('0x72')](),_0x0ceb('0x7d'))['field'](_0x5244ea['params']['id']['toString'](),_0x0ceb('0x59'))[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27',_0x0ceb('0x52'))[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27',_0x0ceb('0x53'))[_0x0ceb('0x73')](_0x0ceb('0x7f'))[_0x0ceb('0x39')](_0x0ceb('0x74'))[_0x0ceb('0x39')](_0x0ceb('0x75'),_0x4375d6[_0x0ceb('0x76')][_0x0ceb('0x72')]())[_0x0ceb('0x39')](_0x0ceb('0x77')))[_0x0ceb('0x72')]();}_0x49493f=squel['insert']()[_0x0ceb('0x6a')]('cm_hopper_additional_phones')[_0x0ceb('0x6c')]([_0x0ceb('0x80'),'scheduledAt',_0x0ceb('0x6d'),'OrderBy','createdAt',_0x0ceb('0x53')],squel[_0x0ceb('0x70')]()[_0x0ceb('0x71')](_0x0ceb('0x81'),'id')['field'](_0x0ceb('0x7e'),_0x0ceb('0x6e'))[_0x0ceb('0x71')](_0x0ceb('0x82'),_0x0ceb('0x6d'))[_0x0ceb('0x71')](_0x0ceb('0x83'),'OrderBy')[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27',_0x0ceb('0x52'))[_0x0ceb('0x71')]('\x27'+_0x507155+'\x27','updatedAt')[_0x0ceb('0x73')](_0x0ceb('0x84'),'ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x0ceb('0x85'),_0x4375d6[_0x0ceb('0x76')][_0x0ceb('0x72')]())[_0x0ceb('0x39')](_0x0ceb('0x86'),_0x5244ea[_0x0ceb('0x40')]['id'][_0x0ceb('0x72')]())[_0x0ceb('0x39')](_0x0ceb('0x87'),_0x507155))['toString']();_0x4be157[_0x0ceb('0x88')](db[_0x0ceb('0x89')][_0x0ceb('0x2e')](_0x35e0af));_0xa64391[_0x0ceb('0x88')](db['sequelize'][_0x0ceb('0x2e')](_0x49493f));}return BPromise['all'](_0x4be157);}})[_0x0ceb('0x21')](function(){return BPromise[_0x0ceb('0x8a')](_0xa64391);})[_0x0ceb('0x21')](function(){return _0x42dfe2;})[_0x0ceb('0x21')](respondWithResult(_0x1a0ff6,null))[_0x0ceb('0x4e')](handleError(_0x1a0ff6,null));};exports[_0x0ceb('0x8b')]=function(_0x54bef7,_0x87130a,_0x5306ed){return db[_0x0ceb('0x2a')]['find']({'where':{'id':_0x54bef7['params']['id']}})['then'](handleEntityNotFound(_0x87130a,null))[_0x0ceb('0x21')](function(_0x302513){if(_0x302513){return _0x302513['removeLists'](_0x54bef7[_0x0ceb('0x2e')][_0x0ceb('0x66')]);}})[_0x0ceb('0x21')](function(_0x21b9ee){if(_0x21b9ee){return db[_0x0ceb('0x56')][_0x0ceb('0x23')]({'where':{'ListId':_0x54bef7[_0x0ceb('0x2e')][_0x0ceb('0x66')],'CampaignId':_0x54bef7[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](function(){return _0x21b9ee;});}})[_0x0ceb('0x21')](respondWithStatusCode(_0x87130a,null))[_0x0ceb('0x4e')](handleError(_0x87130a,null));};exports['getBlackLists']=function(_0x594501,_0x18f12d,_0x5cd778){var _0x450b5b={};var _0x344a9d={};var _0x8ccc83;var _0x2f8e58;return db[_0x0ceb('0x2a')]['findOne']({'where':{'id':_0x594501[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x18f12d,null))[_0x0ceb('0x21')](function(_0x507355){if(_0x507355){_0x8ccc83=_0x507355;_0x344a9d[_0x0ceb('0x2d')]=_[_0x0ceb('0x2f')](db['CmList']['rawAttributes']);_0x344a9d[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x594501[_0x0ceb('0x2e')]);_0x344a9d[_0x0ceb('0x30')]=_['intersection'](_0x344a9d[_0x0ceb('0x2d')],_0x344a9d[_0x0ceb('0x2e')]);_0x450b5b[_0x0ceb('0x32')]=_[_0x0ceb('0x31')](_0x344a9d[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x594501[_0x0ceb('0x2e')]['fields']));_0x450b5b['attributes']=_0x450b5b[_0x0ceb('0x32')][_0x0ceb('0x34')]?_0x450b5b['attributes']:_0x344a9d[_0x0ceb('0x2d')];_0x450b5b[_0x0ceb('0x58')]=qs['sort'](_0x594501[_0x0ceb('0x2e')]['sort']);_0x450b5b[_0x0ceb('0x39')]=qs['filters'](_[_0x0ceb('0x37')](_0x594501[_0x0ceb('0x2e')],_0x344a9d[_0x0ceb('0x30')]));if(_0x594501[_0x0ceb('0x2e')]['filter']){_0x450b5b[_0x0ceb('0x39')]=_[_0x0ceb('0x3a')](_0x450b5b['where'],{'$or':_[_0x0ceb('0x29')](_0x450b5b[_0x0ceb('0x32')],function(_0x3e7851){var _0x965ab={};_0x965ab[_0x3e7851]={'$like':'%'+_0x594501[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x965ab;})});}_0x450b5b=_[_0x0ceb('0x3a')]({},_0x450b5b,_0x594501[_0x0ceb('0x3d')]);return _0x8ccc83[_0x0ceb('0x8c')](_0x450b5b);}})[_0x0ceb('0x21')](function(_0x2464c9){if(_0x2464c9){_0x2f8e58=_0x2464c9[_0x0ceb('0x34')];if(!_0x594501['query'][_0x0ceb('0x35')]('nolimit')){_0x450b5b[_0x0ceb('0x19')]=qs['limit'](_0x594501['query'][_0x0ceb('0x19')]);_0x450b5b['offset']=qs[_0x0ceb('0x18')](_0x594501[_0x0ceb('0x2e')][_0x0ceb('0x18')]);}return _0x8ccc83[_0x0ceb('0x8c')](_0x450b5b);}})['then'](function(_0xad87ab){if(_0xad87ab){return _0xad87ab?{'count':_0x2f8e58,'rows':_0xad87ab}:null;}})[_0x0ceb('0x21')](respondWithResult(_0x18f12d,null))[_0x0ceb('0x4e')](handleError(_0x18f12d,null));};exports[_0x0ceb('0x8d')]=function(_0x2d9202,_0x24cd9b,_0x55ad74){var _0x266aba,_0x3bf9fa;var _0x511498=[];var _0x24d8f2=moment()[_0x0ceb('0x64')](_0x0ceb('0x65'));return db[_0x0ceb('0x2a')][_0x0ceb('0x43')]({'where':{'id':_0x2d9202[_0x0ceb('0x40')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x24cd9b,null))[_0x0ceb('0x21')](function(_0x4f436a){if(_0x4f436a){_0x3bf9fa=_0x4f436a;return _0x4f436a[_0x0ceb('0x8d')](_0x2d9202[_0x0ceb('0x45')]['ids'],_[_0x0ceb('0x51')](_0x2d9202[_0x0ceb('0x45')],['ids','id'])||{});}return null;})[_0x0ceb('0x67')](function(_0x4838a5){var _0x368d5d;var _0x511352;_0x266aba=_0x4838a5||[];var _0xba946a=[];if(_0x4838a5){for(var _0x191d74=0x0;_0x191d74<_0x4838a5[_0x0ceb('0x34')];_0x191d74+=0x1){var _0x3c4736=_0x4838a5[_0x191d74][_0x0ceb('0x46')]({'plain':!![]});_0x368d5d=squel[_0x0ceb('0x7c')]()['into'](_0x0ceb('0x8e'))['fromQuery']([_0x0ceb('0x6d'),'ContactId','ListId','CampaignId',_0x0ceb('0x52'),'updatedAt'],squel[_0x0ceb('0x70')]()[_0x0ceb('0x71')](_0x0ceb('0x6d'),'phone')[_0x0ceb('0x71')]('id',_0x0ceb('0x6f'))[_0x0ceb('0x71')](_0x3c4736[_0x0ceb('0x76')][_0x0ceb('0x72')](),'ListId')[_0x0ceb('0x71')](_0x2d9202['params']['id'][_0x0ceb('0x72')](),'CampaignId')[_0x0ceb('0x71')]('NOW()',_0x0ceb('0x52'))[_0x0ceb('0x71')](_0x0ceb('0x7e'),_0x0ceb('0x53'))[_0x0ceb('0x73')](_0x0ceb('0x7f'))[_0x0ceb('0x39')]('deletedAt\x20IS\x20NULL')[_0x0ceb('0x39')](_0x0ceb('0x75'),_0x3c4736[_0x0ceb('0x76')][_0x0ceb('0x72')]())['where'](_0x0ceb('0x77')))['toString']();_0xba946a[_0x0ceb('0x88')](db[_0x0ceb('0x89')]['query'](_0x368d5d));}return BPromise[_0x0ceb('0x8a')](_0xba946a);}})[_0x0ceb('0x21')](function(){return _0x266aba;})['then'](respondWithResult(_0x24cd9b,null))[_0x0ceb('0x4e')](handleError(_0x24cd9b,null));};exports[_0x0ceb('0x8f')]=function(_0x4f9611,_0x47be26,_0xaa334f){return db['Campaign'][_0x0ceb('0x43')]({'where':{'id':_0x4f9611['params']['id']}})['then'](handleEntityNotFound(_0x47be26,null))[_0x0ceb('0x21')](function(_0x333757){if(_0x333757){return _0x333757[_0x0ceb('0x8f')](_0x4f9611['query'][_0x0ceb('0x66')]);}})[_0x0ceb('0x21')](function(_0x2a0571){if(_0x2a0571){return db[_0x0ceb('0x60')][_0x0ceb('0x23')]({'where':{'ListId':_0x4f9611[_0x0ceb('0x2e')]['ids'],'CampaignId':_0x4f9611['params']['id']}})[_0x0ceb('0x21')](function(){return _0x2a0571;});}})[_0x0ceb('0x21')](respondWithStatusCode(_0x47be26,null))[_0x0ceb('0x4e')](handleError(_0x47be26,null));}; \ No newline at end of file +var _0x3077=['toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','destroy','end','error','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','sort','where','pick','filter','merge','options','Campaign','include','findAll','rows','show','params','keys','filters','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','createdAt','updatedAt','omit','autoAssociation','UserProfileResource','getHoppers','findOne','CmHopper','rawAttributes','hasOwnProperty','order','CampaignId','CmHopperHistory','nolimit','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ListId','select','field','phone','NOW()','scheduledAt','ContactId','CmListId'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3077,0x144));var _0x7307=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x3077[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x7307('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7307('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7307('0x2'));var moment=require('moment');var BPromise=require(_0x7307('0x3'));var Mustache=require(_0x7307('0x4'));var util=require(_0x7307('0x5'));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('fs-extra');var _=require(_0x7307('0x6'));var squel=require(_0x7307('0x7'));var crypto=require(_0x7307('0x8'));var jsforce=require(_0x7307('0x9'));var deskjs=require(_0x7307('0xa'));var toCsv=require(_0x7307('0xb'));var querystring=require(_0x7307('0xc'));var Papa=require(_0x7307('0xd'));var Redis=require(_0x7307('0xe'));var authService=require(_0x7307('0xf'));var qs=require(_0x7307('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7307('0x11'))(_0x7307('0x12'));var utils=require(_0x7307('0x13'));var config=require(_0x7307('0x14'));var licenseUtil=require(_0x7307('0x15'));var db=require(_0x7307('0x16'))['db'];function respondWithStatusCode(_0x2ef5b5,_0x337903){_0x337903=_0x337903||0xcc;return function(_0x18268c){if(_0x18268c){return _0x2ef5b5[_0x7307('0x17')](_0x337903);}return _0x2ef5b5[_0x7307('0x18')](_0x337903)['end']();};}function respondWithResult(_0x588727,_0x235dd7){_0x235dd7=_0x235dd7||0xc8;return function(_0x486b19){if(_0x486b19){return _0x588727[_0x7307('0x18')](_0x235dd7)[_0x7307('0x19')](_0x486b19);}};}function respondWithFilteredResult(_0x573a6f,_0x2e9794){return function(_0x5badd9){if(_0x5badd9){var _0x754da0=typeof _0x2e9794[_0x7307('0x1a')]===_0x7307('0x1b')&&typeof _0x2e9794[_0x7307('0x1c')]===_0x7307('0x1b');var _0x528472=_0x5badd9[_0x7307('0x1d')];var _0x554997=_0x754da0?0x0:_0x2e9794['offset'];var _0x5e04c9=_0x754da0?_0x5badd9[_0x7307('0x1d')]:_0x2e9794[_0x7307('0x1a')]+_0x2e9794[_0x7307('0x1c')];var _0x55750a;if(_0x5e04c9>=_0x528472){_0x5e04c9=_0x528472;_0x55750a=0xc8;}else{_0x55750a=0xce;}_0x573a6f[_0x7307('0x18')](_0x55750a);return _0x573a6f[_0x7307('0x1e')](_0x7307('0x1f'),_0x554997+'-'+_0x5e04c9+'/'+_0x528472)[_0x7307('0x19')](_0x5badd9);}return null;};}function patchUpdates(_0x589e4f){return function(_0x42740e){try{jsonpatch['apply'](_0x42740e,_0x589e4f,!![]);}catch(_0x643fef){return BPromise[_0x7307('0x20')](_0x643fef);}return _0x42740e[_0x7307('0x21')]();};}function saveUpdates(_0x23624e,_0x353c4a){return function(_0x9dc4d){if(_0x9dc4d){return _0x9dc4d[_0x7307('0x22')](_0x23624e)[_0x7307('0x23')](function(_0x550e5f){return _0x550e5f;});}return null;};}function removeEntity(_0xb31856,_0xb61a0){return function(_0x206532){if(_0x206532){return _0x206532['destroy']()['then'](function(){var _0x16ffb0=_0x206532[_0x7307('0x24')]({'plain':!![]});var _0x1f1c86='IvrCampaigns';return db['UserProfileResource'][_0x7307('0x25')]({'where':{'type':_0x1f1c86,'resourceId':_0x16ffb0['id']}})[_0x7307('0x23')](function(){return _0x206532;});})['then'](function(){_0xb31856[_0x7307('0x18')](0xcc)[_0x7307('0x26')]();});}};}function handleEntityNotFound(_0xca10ee,_0x10d6c9){return function(_0x3e2a78){if(!_0x3e2a78){_0xca10ee[_0x7307('0x17')](0x194);}return _0x3e2a78;};}function handleError(_0x1ecb0d,_0x5eefea){_0x5eefea=_0x5eefea||0x1f4;return function(_0x102078){logger[_0x7307('0x27')](_0x102078['stack']);if(_0x102078[_0x7307('0x28')]){delete _0x102078['name'];}_0x1ecb0d['status'](_0x5eefea)[_0x7307('0x29')](_0x102078);};}exports[_0x7307('0x2a')]=function(_0x232b96,_0x2f768d){var _0x276943={},_0x1ce495={},_0x55954b={'count':0x0,'rows':[]};var _0x243cc6=_[_0x7307('0x2b')](db['Campaign']['rawAttributes'],function(_0x475c06){return{'name':_0x475c06[_0x7307('0x2c')],'type':_0x475c06[_0x7307('0x2d')][_0x7307('0x2e')]};});_0x1ce495[_0x7307('0x2f')]=_[_0x7307('0x2b')](_0x243cc6,_0x7307('0x28'));_0x1ce495[_0x7307('0x30')]=_['keys'](_0x232b96[_0x7307('0x30')]);_0x1ce495['filters']=_[_0x7307('0x31')](_0x1ce495['model'],_0x1ce495['query']);_0x276943[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1ce495['model'],qs[_0x7307('0x33')](_0x232b96[_0x7307('0x30')][_0x7307('0x33')]));_0x276943[_0x7307('0x32')]=_0x276943[_0x7307('0x32')]['length']?_0x276943[_0x7307('0x32')]:_0x1ce495[_0x7307('0x2f')];if(!_0x232b96[_0x7307('0x30')]['hasOwnProperty']('nolimit')){_0x276943[_0x7307('0x1c')]=qs['limit'](_0x232b96[_0x7307('0x30')][_0x7307('0x1c')]);_0x276943['offset']=qs[_0x7307('0x1a')](_0x232b96[_0x7307('0x30')][_0x7307('0x1a')]);}_0x276943['order']=qs[_0x7307('0x34')](_0x232b96[_0x7307('0x30')][_0x7307('0x34')]);_0x276943[_0x7307('0x35')]=qs['filters'](_[_0x7307('0x36')](_0x232b96[_0x7307('0x30')],_0x1ce495['filters']),_0x243cc6);if(_0x232b96[_0x7307('0x30')][_0x7307('0x37')]){_0x276943['where']=_[_0x7307('0x38')](_0x276943['where'],{'$or':_[_0x7307('0x2b')](_0x243cc6,function(_0x232ced){if(_0x232ced['type']!=='VIRTUAL'){var _0x389bc9={};_0x389bc9[_0x232ced[_0x7307('0x28')]]={'$like':'%'+_0x232b96['query'][_0x7307('0x37')]+'%'};return _0x389bc9;}})});}_0x276943=_[_0x7307('0x38')]({},_0x276943,_0x232b96[_0x7307('0x39')]);var _0x2fe32f={'where':_0x276943[_0x7307('0x35')]};return db[_0x7307('0x3a')][_0x7307('0x1d')](_0x2fe32f)[_0x7307('0x23')](function(_0x494e25){_0x55954b['count']=_0x494e25;if(_0x232b96[_0x7307('0x30')]['includeAll']){_0x276943[_0x7307('0x3b')]=[{'all':!![]}];}return db[_0x7307('0x3a')][_0x7307('0x3c')](_0x276943);})[_0x7307('0x23')](function(_0x2edacf){_0x55954b[_0x7307('0x3d')]=_0x2edacf;return _0x55954b;})[_0x7307('0x23')](respondWithFilteredResult(_0x2f768d,_0x276943))['catch'](handleError(_0x2f768d,null));};exports[_0x7307('0x3e')]=function(_0x45517a,_0x52ed35){var _0x1cdc28={'raw':![],'where':{'id':_0x45517a[_0x7307('0x3f')]['id']}},_0x53581d={};_0x53581d[_0x7307('0x2f')]=_['keys'](db[_0x7307('0x3a')]['rawAttributes']);_0x53581d['query']=_[_0x7307('0x40')](_0x45517a['query']);_0x53581d[_0x7307('0x41')]=_[_0x7307('0x31')](_0x53581d[_0x7307('0x2f')],_0x53581d[_0x7307('0x30')]);_0x1cdc28[_0x7307('0x32')]=_[_0x7307('0x31')](_0x53581d[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x45517a['query'][_0x7307('0x33')]));_0x1cdc28['attributes']=_0x1cdc28[_0x7307('0x32')][_0x7307('0x42')]?_0x1cdc28['attributes']:_0x53581d[_0x7307('0x2f')];if(_0x45517a[_0x7307('0x30')][_0x7307('0x43')]){_0x1cdc28[_0x7307('0x3b')]=[{'all':!![]}];}_0x1cdc28=_[_0x7307('0x38')]({},_0x1cdc28,_0x45517a[_0x7307('0x39')]);return db[_0x7307('0x3a')][_0x7307('0x44')](_0x1cdc28)[_0x7307('0x23')](handleEntityNotFound(_0x52ed35,null))[_0x7307('0x23')](respondWithResult(_0x52ed35,null))[_0x7307('0x45')](handleError(_0x52ed35,null));};exports[_0x7307('0x46')]=function(_0x9e861e,_0x581e1b){return db[_0x7307('0x3a')]['create'](_0x9e861e[_0x7307('0x47')],{})[_0x7307('0x23')](function(_0x104198){var _0x38b4d9=_0x9e861e[_0x7307('0x48')][_0x7307('0x24')]({'plain':!![]});if(!_0x38b4d9)throw new Error(_0x7307('0x49'));if(_0x38b4d9[_0x7307('0x4a')]==='user'){var _0x8a65b3=_0x104198['get']({'plain':!![]});var _0x5562ed=_0x7307('0x4b');return db[_0x7307('0x4c')][_0x7307('0x44')]({'where':{'name':_0x5562ed,'userProfileId':_0x38b4d9[_0x7307('0x4d')]},'raw':!![]})[_0x7307('0x23')](function(_0x5009fc){if(_0x5009fc&&_0x5009fc['autoAssociation']===0x0){return db['UserProfileResource'][_0x7307('0x46')]({'name':_0x8a65b3[_0x7307('0x28')],'resourceId':_0x8a65b3['id'],'type':_0x5009fc[_0x7307('0x28')],'sectionId':_0x5009fc['id']},{})[_0x7307('0x23')](function(){return _0x104198;});}else{return _0x104198;}})[_0x7307('0x45')](function(_0x548f49){logger[_0x7307('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x548f49);throw _0x548f49;});}return _0x104198;})[_0x7307('0x23')](respondWithResult(_0x581e1b,0xc9))[_0x7307('0x45')](handleError(_0x581e1b,null));};exports['clone']=function(_0x1acd2d,_0x407c40){var _0x17030a={'where':{'id':_0x1acd2d[_0x7307('0x3f')]['id']}},_0x4b2bf3={};_0x4b2bf3[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x3a')]['rawAttributes']);_0x17030a['attributes']=_[_0x7307('0x31')](_0x4b2bf3['model'],qs['fields'](_0x1acd2d[_0x7307('0x30')]['fields']));_0x17030a[_0x7307('0x32')]=_0x17030a[_0x7307('0x32')][_0x7307('0x42')]?_0x17030a[_0x7307('0x32')]:_0x4b2bf3[_0x7307('0x2f')];if(_0x1acd2d[_0x7307('0x30')][_0x7307('0x43')]){_0x17030a[_0x7307('0x3b')]=[{'all':!![]}];}_0x17030a=_[_0x7307('0x38')]({},_0x17030a,_0x1acd2d[_0x7307('0x39')]);return db[_0x7307('0x3a')][_0x7307('0x44')](_0x17030a)[_0x7307('0x23')](handleEntityNotFound(_0x407c40,null))[_0x7307('0x23')](function(_0x6cce90){if(_0x6cce90){var _0x5f0965=_0x6cce90['get']({'plain':!![]});_0x5f0965=qs['omit'](_0x5f0965,['id',_0x7307('0x4e'),_0x7307('0x4f')]);_0x1acd2d['body']=_[_0x7307('0x50')](_0x1acd2d[_0x7307('0x47')],['id',_0x7307('0x4e'),_0x7307('0x4f')]);return db[_0x7307('0x3a')][_0x7307('0x46')](_[_0x7307('0x38')](_0x5f0965,_0x1acd2d[_0x7307('0x47')]),{'include':_0x1acd2d[_0x7307('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x7307('0x23')](function(_0x28c301){var _0x333c9c=_0x1acd2d[_0x7307('0x48')][_0x7307('0x24')]({'plain':!![]});if(!_0x333c9c)throw new Error(_0x7307('0x49'));if(_0x333c9c[_0x7307('0x4a')]===_0x7307('0x48')){var _0x2412c2=_0x28c301['get']({'plain':!![]});var _0x4cfadc=_0x7307('0x4b');return db[_0x7307('0x4c')]['find']({'where':{'name':_0x4cfadc,'userProfileId':_0x333c9c[_0x7307('0x4d')]},'raw':!![]})['then'](function(_0x184842){if(_0x184842&&_0x184842[_0x7307('0x51')]===0x0){return db[_0x7307('0x52')][_0x7307('0x46')]({'name':_0x2412c2[_0x7307('0x28')],'resourceId':_0x2412c2['id'],'type':_0x184842['name'],'sectionId':_0x184842['id']},{})[_0x7307('0x23')](function(){return _0x28c301;});}else{return _0x28c301;}})[_0x7307('0x45')](function(_0x339df5){logger[_0x7307('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x339df5);throw _0x339df5;});}return _0x28c301;});}})[_0x7307('0x23')](respondWithResult(_0x407c40,0xc9))[_0x7307('0x45')](handleError(_0x407c40,null));};exports['update']=function(_0x2caed7,_0x5d22fc){if(_0x2caed7['body']['id']){delete _0x2caed7['body']['id'];}return db['Campaign'][_0x7307('0x44')]({'where':{'id':_0x2caed7['params']['id']}})['then'](handleEntityNotFound(_0x5d22fc,null))[_0x7307('0x23')](saveUpdates(_0x2caed7[_0x7307('0x47')],null))[_0x7307('0x23')](respondWithResult(_0x5d22fc,null))[_0x7307('0x45')](handleError(_0x5d22fc,null));};exports[_0x7307('0x25')]=function(_0x4fd8e6,_0x1c5934){return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x4fd8e6['params']['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x1c5934,null))[_0x7307('0x23')](removeEntity(_0x1c5934,null))['catch'](handleError(_0x1c5934,null));};exports[_0x7307('0x53')]=function(_0x54c255,_0x47e04c,_0x1a4cee){var _0x3be4c0={'raw':!![],'where':{}};var _0x79d26c={};var _0x30bdf4={'count':0x0,'rows':[]};return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x54c255[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x47e04c,null))[_0x7307('0x23')](function(_0x3cb697){if(_0x3cb697){_0x79d26c[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x55')][_0x7307('0x56')]);_0x79d26c['query']=_[_0x7307('0x40')](_0x54c255[_0x7307('0x30')]);_0x79d26c[_0x7307('0x41')]=_[_0x7307('0x31')](_0x79d26c[_0x7307('0x2f')],_0x79d26c[_0x7307('0x30')]);_0x3be4c0['attributes']=_[_0x7307('0x31')](_0x79d26c[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x54c255[_0x7307('0x30')][_0x7307('0x33')]));_0x3be4c0['attributes']=_0x3be4c0[_0x7307('0x32')]['length']?_0x3be4c0['attributes']:_0x79d26c['model'];if(!_0x54c255['query'][_0x7307('0x57')]('nolimit')){_0x3be4c0[_0x7307('0x1c')]=qs['limit'](_0x54c255[_0x7307('0x30')]['limit']);_0x3be4c0['offset']=qs[_0x7307('0x1a')](_0x54c255['query'][_0x7307('0x1a')]);}_0x3be4c0[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x54c255['query']['sort']);_0x3be4c0[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x54c255[_0x7307('0x30')],_0x79d26c[_0x7307('0x41')]));_0x3be4c0['where'][_0x7307('0x59')]=_0x3cb697['id'];if(_0x54c255['query'][_0x7307('0x37')]){_0x3be4c0['where']=_[_0x7307('0x38')](_0x3be4c0[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x3be4c0[_0x7307('0x32')],function(_0x4f7dc3){var _0x4218fb={};_0x4218fb[_0x4f7dc3]={'$like':'%'+_0x54c255[_0x7307('0x30')]['filter']+'%'};return _0x4218fb;})});}_0x3be4c0=_['merge']({},_0x3be4c0,_0x54c255[_0x7307('0x39')]);return db[_0x7307('0x55')][_0x7307('0x1d')]({'where':_0x3be4c0['where']})[_0x7307('0x23')](function(_0x14c3c8){_0x30bdf4[_0x7307('0x1d')]=_0x14c3c8;if(_0x54c255[_0x7307('0x30')][_0x7307('0x43')]){_0x3be4c0[_0x7307('0x3b')]=[{'all':!![]}];}return db[_0x7307('0x55')][_0x7307('0x3c')](_0x3be4c0);})[_0x7307('0x23')](function(_0x1d2ef1){_0x30bdf4['rows']=_0x1d2ef1;return _0x30bdf4;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x47e04c,_0x3be4c0))['catch'](handleError(_0x47e04c,null));};exports['getHopperHistories']=function(_0x5070f5,_0x293f68,_0x358452){var _0xa04be4={'raw':!![],'where':{}};var _0x1239b9={};var _0x7f1837={'count':0x0,'rows':[]};return db[_0x7307('0x3a')]['findOne']({'where':{'id':_0x5070f5[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x293f68,null))[_0x7307('0x23')](function(_0xadbf77){if(_0xadbf77){_0x1239b9[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x5a')][_0x7307('0x56')]);_0x1239b9['query']=_[_0x7307('0x40')](_0x5070f5[_0x7307('0x30')]);_0x1239b9[_0x7307('0x41')]=_[_0x7307('0x31')](_0x1239b9[_0x7307('0x2f')],_0x1239b9[_0x7307('0x30')]);_0xa04be4[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1239b9[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x5070f5[_0x7307('0x30')][_0x7307('0x33')]));_0xa04be4[_0x7307('0x32')]=_0xa04be4[_0x7307('0x32')][_0x7307('0x42')]?_0xa04be4[_0x7307('0x32')]:_0x1239b9[_0x7307('0x2f')];if(!_0x5070f5[_0x7307('0x30')][_0x7307('0x57')](_0x7307('0x5b'))){_0xa04be4['limit']=qs[_0x7307('0x1c')](_0x5070f5[_0x7307('0x30')]['limit']);_0xa04be4[_0x7307('0x1a')]=qs['offset'](_0x5070f5[_0x7307('0x30')]['offset']);}_0xa04be4['order']=qs[_0x7307('0x34')](_0x5070f5['query'][_0x7307('0x34')]);_0xa04be4['where']=qs[_0x7307('0x41')](_['pick'](_0x5070f5['query'],_0x1239b9['filters']));_0xa04be4['where']['CampaignId']=_0xadbf77['id'];if(_0x5070f5['query'][_0x7307('0x37')]){_0xa04be4[_0x7307('0x35')]=_[_0x7307('0x38')](_0xa04be4[_0x7307('0x35')],{'$or':_['map'](_0xa04be4[_0x7307('0x32')],function(_0x448716){var _0x5c7875={};_0x5c7875[_0x448716]={'$like':'%'+_0x5070f5[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x5c7875;})});}_0xa04be4=_['merge']({},_0xa04be4,_0x5070f5[_0x7307('0x39')]);return db[_0x7307('0x5a')]['count']({'where':_0xa04be4[_0x7307('0x35')]})['then'](function(_0x49ad6e){_0x7f1837[_0x7307('0x1d')]=_0x49ad6e;if(_0x5070f5['query'][_0x7307('0x43')]){_0xa04be4['include']=[{'all':!![]}];}return db[_0x7307('0x5a')]['findAll'](_0xa04be4);})[_0x7307('0x23')](function(_0x1d262f){_0x7f1837[_0x7307('0x3d')]=_0x1d262f;return _0x7f1837;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x293f68,_0xa04be4))['catch'](handleError(_0x293f68,null));};exports['getHopperFinals']=function(_0x28ca75,_0x482e8d,_0x2e30bf){var _0x6c627e={'raw':!![],'where':{}};var _0x48f713={};var _0x5ed711={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28ca75[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x482e8d,null))[_0x7307('0x23')](function(_0x3a8e91){if(_0x3a8e91){_0x48f713[_0x7307('0x2f')]=_[_0x7307('0x40')](db['CmHopperFinal'][_0x7307('0x56')]);_0x48f713[_0x7307('0x30')]=_[_0x7307('0x40')](_0x28ca75[_0x7307('0x30')]);_0x48f713['filters']=_[_0x7307('0x31')](_0x48f713[_0x7307('0x2f')],_0x48f713[_0x7307('0x30')]);_0x6c627e[_0x7307('0x32')]=_['intersection'](_0x48f713['model'],qs[_0x7307('0x33')](_0x28ca75[_0x7307('0x30')][_0x7307('0x33')]));_0x6c627e[_0x7307('0x32')]=_0x6c627e[_0x7307('0x32')][_0x7307('0x42')]?_0x6c627e[_0x7307('0x32')]:_0x48f713[_0x7307('0x2f')];if(!_0x28ca75['query'][_0x7307('0x57')](_0x7307('0x5b'))){_0x6c627e[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x28ca75[_0x7307('0x30')][_0x7307('0x1c')]);_0x6c627e['offset']=qs[_0x7307('0x1a')](_0x28ca75[_0x7307('0x30')][_0x7307('0x1a')]);}_0x6c627e[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x28ca75[_0x7307('0x30')][_0x7307('0x34')]);_0x6c627e[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x28ca75[_0x7307('0x30')],_0x48f713[_0x7307('0x41')]));_0x6c627e['where'][_0x7307('0x59')]=_0x3a8e91['id'];if(_0x28ca75[_0x7307('0x30')][_0x7307('0x37')]){_0x6c627e['where']=_[_0x7307('0x38')](_0x6c627e[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x6c627e['attributes'],function(_0x36ae04){var _0x5f048d={};_0x5f048d[_0x36ae04]={'$like':'%'+_0x28ca75['query']['filter']+'%'};return _0x5f048d;})});}_0x6c627e=_[_0x7307('0x38')]({},_0x6c627e,_0x28ca75[_0x7307('0x39')]);return db[_0x7307('0x5c')][_0x7307('0x1d')]({'where':_0x6c627e[_0x7307('0x35')]})[_0x7307('0x23')](function(_0x4b8ed2){_0x5ed711['count']=_0x4b8ed2;if(_0x28ca75['query']['includeAll']){_0x6c627e[_0x7307('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x6c627e);})['then'](function(_0xab7277){_0x5ed711[_0x7307('0x3d')]=_0xab7277;return _0x5ed711;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x482e8d,_0x6c627e))[_0x7307('0x45')](handleError(_0x482e8d,null));};exports[_0x7307('0x5d')]=function(_0x52a39b,_0x4ddf97,_0x32361f){var _0x476b2e={'raw':!![],'where':{}};var _0x5d2449={};var _0x33b624={'count':0x0,'rows':[]};return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x52a39b[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x4ddf97,null))['then'](function(_0x577ad9){if(_0x577ad9){_0x5d2449[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x5e')][_0x7307('0x56')]);_0x5d2449['query']=_[_0x7307('0x40')](_0x52a39b['query']);_0x5d2449[_0x7307('0x41')]=_[_0x7307('0x31')](_0x5d2449['model'],_0x5d2449[_0x7307('0x30')]);_0x476b2e[_0x7307('0x32')]=_['intersection'](_0x5d2449[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x52a39b[_0x7307('0x30')][_0x7307('0x33')]));_0x476b2e[_0x7307('0x32')]=_0x476b2e['attributes'][_0x7307('0x42')]?_0x476b2e[_0x7307('0x32')]:_0x5d2449[_0x7307('0x2f')];if(!_0x52a39b[_0x7307('0x30')]['hasOwnProperty'](_0x7307('0x5b'))){_0x476b2e[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x52a39b[_0x7307('0x30')][_0x7307('0x1c')]);_0x476b2e[_0x7307('0x1a')]=qs['offset'](_0x52a39b['query'][_0x7307('0x1a')]);}_0x476b2e[_0x7307('0x58')]=qs['sort'](_0x52a39b[_0x7307('0x30')]['sort']);_0x476b2e[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x52a39b['query'],_0x5d2449[_0x7307('0x41')]));_0x476b2e[_0x7307('0x35')][_0x7307('0x59')]=_0x577ad9['id'];if(_0x52a39b[_0x7307('0x30')][_0x7307('0x37')]){_0x476b2e[_0x7307('0x35')]=_['merge'](_0x476b2e[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x476b2e[_0x7307('0x32')],function(_0x4ada99){var _0x43641b={};_0x43641b[_0x4ada99]={'$like':'%'+_0x52a39b[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x43641b;})});}_0x476b2e=_[_0x7307('0x38')]({},_0x476b2e,_0x52a39b[_0x7307('0x39')]);return db[_0x7307('0x5e')][_0x7307('0x1d')]({'where':_0x476b2e[_0x7307('0x35')]})[_0x7307('0x23')](function(_0x1a7182){_0x33b624[_0x7307('0x1d')]=_0x1a7182;if(_0x52a39b['query'][_0x7307('0x43')]){_0x476b2e['include']=[{'all':!![]}];}return db[_0x7307('0x5e')][_0x7307('0x3c')](_0x476b2e);})[_0x7307('0x23')](function(_0x58d1c6){_0x33b624[_0x7307('0x3d')]=_0x58d1c6;return _0x33b624;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x4ddf97,_0x476b2e))[_0x7307('0x45')](handleError(_0x4ddf97,null));};exports['getLists']=function(_0x4b5f16,_0x755b21,_0x2dd041){var _0xdc58ce={};var _0x348e88={};var _0x5a0878;var _0x156c6b;return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x4b5f16[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x755b21,null))['then'](function(_0x1607a0){if(_0x1607a0){_0x5a0878=_0x1607a0;_0x348e88[_0x7307('0x2f')]=_['keys'](db['CmList'][_0x7307('0x56')]);_0x348e88[_0x7307('0x30')]=_[_0x7307('0x40')](_0x4b5f16[_0x7307('0x30')]);_0x348e88[_0x7307('0x41')]=_[_0x7307('0x31')](_0x348e88[_0x7307('0x2f')],_0x348e88[_0x7307('0x30')]);_0xdc58ce['attributes']=_['intersection'](_0x348e88[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x33')]));_0xdc58ce['attributes']=_0xdc58ce[_0x7307('0x32')][_0x7307('0x42')]?_0xdc58ce[_0x7307('0x32')]:_0x348e88[_0x7307('0x2f')];_0xdc58ce[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x34')]);_0xdc58ce[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x4b5f16[_0x7307('0x30')],_0x348e88[_0x7307('0x41')]));if(_0x4b5f16[_0x7307('0x30')][_0x7307('0x37')]){_0xdc58ce['where']=_[_0x7307('0x38')](_0xdc58ce[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0xdc58ce['attributes'],function(_0x43a62f){var _0x355814={};_0x355814[_0x43a62f]={'$like':'%'+_0x4b5f16[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x355814;})});}_0xdc58ce=_[_0x7307('0x38')]({},_0xdc58ce,_0x4b5f16[_0x7307('0x39')]);return _0x5a0878[_0x7307('0x5f')](_0xdc58ce);}})[_0x7307('0x23')](function(_0x378434){if(_0x378434){_0x156c6b=_0x378434['length'];if(!_0x4b5f16[_0x7307('0x30')][_0x7307('0x57')]('nolimit')){_0xdc58ce[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x1c')]);_0xdc58ce[_0x7307('0x1a')]=qs[_0x7307('0x1a')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x1a')]);}return _0x5a0878[_0x7307('0x5f')](_0xdc58ce);}})[_0x7307('0x23')](function(_0x46ff82){if(_0x46ff82){return _0x46ff82?{'count':_0x156c6b,'rows':_0x46ff82}:null;}})[_0x7307('0x23')](respondWithResult(_0x755b21,null))[_0x7307('0x45')](handleError(_0x755b21,null));};exports[_0x7307('0x60')]=function(_0x185a23,_0x4fcf81,_0x1dfadf){var _0x44cc86,_0x49bebd;var _0x4557f5=[];var _0x2be6f1=moment()[_0x7307('0x61')](_0x7307('0x62'));return db['Campaign'][_0x7307('0x44')]({'where':{'id':_0x185a23['params']['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x4fcf81,null))['then'](function(_0x5610ba){if(_0x5610ba){_0x49bebd=_0x5610ba;return _0x5610ba[_0x7307('0x60')](_0x185a23[_0x7307('0x47')][_0x7307('0x63')],_[_0x7307('0x50')](_0x185a23[_0x7307('0x47')],[_0x7307('0x63'),'id'])||{});}return null;})['spread'](function(_0x5f3e2b){var _0x326c93;var _0x1f0eb3;_0x44cc86=_0x5f3e2b||[];var _0x2f9dac=[];if(_0x5f3e2b){for(var _0x3832cf=0x0;_0x3832cf<_0x5f3e2b[_0x7307('0x42')];_0x3832cf+=0x1){var _0x3df95e=_0x5f3e2b[_0x3832cf][_0x7307('0x24')]({'plain':!![]});_0x49bebd[_0x7307('0x64')]=_0x185a23[_0x7307('0x47')][_0x7307('0x64')]?_0x185a23[_0x7307('0x47')][_0x7307('0x64')]:_0x49bebd[_0x7307('0x64')];switch(_0x49bebd[_0x7307('0x64')]){case _0x7307('0x65'):_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')](_0x7307('0x68'))[_0x7307('0x69')](['phone','scheduledAt','ContactId',_0x7307('0x6a'),_0x7307('0x59'),_0x7307('0x4e'),_0x7307('0x4f')],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field'](_0x7307('0x6e'),_0x7307('0x6f'))['field']('id',_0x7307('0x70'))[_0x7307('0x6c')](_0x3df95e[_0x7307('0x71')]['toString'](),_0x7307('0x6a'))[_0x7307('0x6c')](_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')](),'CampaignId')['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4f'))[_0x7307('0x73')](_0x7307('0x74'))['where'](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77'))['where'](_0x7307('0x78'),squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x79'))[_0x7307('0x73')](_0x7307('0x7a'))[_0x7307('0x35')]('CampaignId\x20=\x20?',_0x185a23['params']['id'][_0x7307('0x72')]()))[_0x7307('0x35')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7307('0x6c')](_0x7307('0x7b'))[_0x7307('0x73')](_0x7307('0x68'))['where']('CampaignId\x20=\x20?',_0x185a23[_0x7307('0x3f')]['id']['toString']())))['toString']();break;case _0x7307('0x7c'):_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')]('cm_hopper')[_0x7307('0x69')]([_0x7307('0x6d'),'scheduledAt',_0x7307('0x70'),_0x7307('0x6a'),'CampaignId',_0x7307('0x4e'),'updatedAt'],squel['select']()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))[_0x7307('0x6c')](_0x7307('0x6e'),_0x7307('0x6f'))['field']('id','ContactId')[_0x7307('0x6c')](_0x3df95e[_0x7307('0x71')][_0x7307('0x72')](),'ListId')['field'](_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')](),'CampaignId')[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27','updatedAt')[_0x7307('0x73')](_0x7307('0x74'))[_0x7307('0x35')](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77'))[_0x7307('0x35')](_0x7307('0x78'),squel[_0x7307('0x6b')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x7307('0x68'))[_0x7307('0x35')]('CampaignId\x20=\x20?',_0x185a23['params']['id'][_0x7307('0x72')]())))[_0x7307('0x72')]();break;default:_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')]('cm_hopper')[_0x7307('0x69')]([_0x7307('0x6d'),_0x7307('0x6f'),_0x7307('0x70'),_0x7307('0x6a'),_0x7307('0x59'),_0x7307('0x4e'),'updatedAt'],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field'](_0x7307('0x6e'),_0x7307('0x6f'))[_0x7307('0x6c')]('id','ContactId')['field'](_0x3df95e['CmListId'][_0x7307('0x72')](),'ListId')[_0x7307('0x6c')](_0x185a23['params']['id']['toString'](),_0x7307('0x59'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27','updatedAt')['from']('cm_contacts')[_0x7307('0x35')](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77')))['toString']();}_0x1f0eb3=squel[_0x7307('0x66')]()[_0x7307('0x67')](_0x7307('0x7d'))[_0x7307('0x69')]([_0x7307('0x7e'),_0x7307('0x6f'),'phone',_0x7307('0x7f'),_0x7307('0x4e'),'updatedAt'],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x80'),'id')[_0x7307('0x6c')](_0x7307('0x6e'),'scheduledAt')['field'](_0x7307('0x81'),_0x7307('0x6d'))[_0x7307('0x6c')]('ci.OrderBY',_0x7307('0x7f'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4f'))['from'](_0x7307('0x82'),'ci')[_0x7307('0x83')](_0x7307('0x68'),'h',_0x7307('0x84'))[_0x7307('0x35')](_0x7307('0x85'),_0x3df95e[_0x7307('0x71')][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x86'),_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x87'),_0x2be6f1))[_0x7307('0x72')]();_0x2f9dac['push'](db[_0x7307('0x88')]['query'](_0x326c93));_0x4557f5['push'](db[_0x7307('0x88')]['query'](_0x1f0eb3));}return BPromise[_0x7307('0x89')](_0x2f9dac);}})[_0x7307('0x23')](function(){return BPromise[_0x7307('0x89')](_0x4557f5);})[_0x7307('0x23')](function(){return _0x44cc86;})[_0x7307('0x23')](respondWithResult(_0x4fcf81,null))[_0x7307('0x45')](handleError(_0x4fcf81,null));};exports[_0x7307('0x8a')]=function(_0x3e85d2,_0x74a590,_0x2598da){return db[_0x7307('0x3a')]['find']({'where':{'id':_0x3e85d2[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x74a590,null))[_0x7307('0x23')](function(_0x2e1e9f){if(_0x2e1e9f){return _0x2e1e9f[_0x7307('0x8a')](_0x3e85d2[_0x7307('0x30')]['ids']);}})[_0x7307('0x23')](function(_0x5d9e6d){if(_0x5d9e6d){return db[_0x7307('0x55')][_0x7307('0x25')]({'where':{'ListId':_0x3e85d2[_0x7307('0x30')]['ids'],'CampaignId':_0x3e85d2[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](function(){return _0x5d9e6d;});}})[_0x7307('0x23')](respondWithStatusCode(_0x74a590,null))['catch'](handleError(_0x74a590,null));};exports[_0x7307('0x8b')]=function(_0xc21630,_0x56fabe,_0xabedb3){var _0x3cbf8b={};var _0x1d60db={};var _0x16a2d0;var _0x589db2;return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0xc21630[_0x7307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x56fabe,null))[_0x7307('0x23')](function(_0xc63622){if(_0xc63622){_0x16a2d0=_0xc63622;_0x1d60db['model']=_['keys'](db[_0x7307('0x8c')][_0x7307('0x56')]);_0x1d60db[_0x7307('0x30')]=_[_0x7307('0x40')](_0xc21630[_0x7307('0x30')]);_0x1d60db['filters']=_[_0x7307('0x31')](_0x1d60db[_0x7307('0x2f')],_0x1d60db[_0x7307('0x30')]);_0x3cbf8b[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1d60db[_0x7307('0x2f')],qs[_0x7307('0x33')](_0xc21630[_0x7307('0x30')][_0x7307('0x33')]));_0x3cbf8b[_0x7307('0x32')]=_0x3cbf8b[_0x7307('0x32')][_0x7307('0x42')]?_0x3cbf8b[_0x7307('0x32')]:_0x1d60db[_0x7307('0x2f')];_0x3cbf8b[_0x7307('0x58')]=qs[_0x7307('0x34')](_0xc21630[_0x7307('0x30')][_0x7307('0x34')]);_0x3cbf8b[_0x7307('0x35')]=qs['filters'](_[_0x7307('0x36')](_0xc21630[_0x7307('0x30')],_0x1d60db[_0x7307('0x41')]));if(_0xc21630[_0x7307('0x30')][_0x7307('0x37')]){_0x3cbf8b[_0x7307('0x35')]=_[_0x7307('0x38')](_0x3cbf8b['where'],{'$or':_['map'](_0x3cbf8b[_0x7307('0x32')],function(_0x32831){var _0x10789b={};_0x10789b[_0x32831]={'$like':'%'+_0xc21630['query'][_0x7307('0x37')]+'%'};return _0x10789b;})});}_0x3cbf8b=_[_0x7307('0x38')]({},_0x3cbf8b,_0xc21630[_0x7307('0x39')]);return _0x16a2d0[_0x7307('0x8b')](_0x3cbf8b);}})[_0x7307('0x23')](function(_0x1a39f4){if(_0x1a39f4){_0x589db2=_0x1a39f4['length'];if(!_0xc21630[_0x7307('0x30')][_0x7307('0x57')]('nolimit')){_0x3cbf8b['limit']=qs[_0x7307('0x1c')](_0xc21630[_0x7307('0x30')][_0x7307('0x1c')]);_0x3cbf8b['offset']=qs[_0x7307('0x1a')](_0xc21630[_0x7307('0x30')][_0x7307('0x1a')]);}return _0x16a2d0[_0x7307('0x8b')](_0x3cbf8b);}})[_0x7307('0x23')](function(_0x1e26c3){if(_0x1e26c3){return _0x1e26c3?{'count':_0x589db2,'rows':_0x1e26c3}:null;}})[_0x7307('0x23')](respondWithResult(_0x56fabe,null))[_0x7307('0x45')](handleError(_0x56fabe,null));};exports[_0x7307('0x8d')]=function(_0x1ee45d,_0x573bf5,_0x4ac577){var _0xfa57f8,_0x891f06;var _0x8c9a3b=[];var _0x513650=moment()[_0x7307('0x61')](_0x7307('0x62'));return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x1ee45d[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x573bf5,null))[_0x7307('0x23')](function(_0x2b5d48){if(_0x2b5d48){_0x891f06=_0x2b5d48;return _0x2b5d48[_0x7307('0x8d')](_0x1ee45d[_0x7307('0x47')][_0x7307('0x63')],_['omit'](_0x1ee45d[_0x7307('0x47')],[_0x7307('0x63'),'id'])||{});}return null;})[_0x7307('0x8e')](function(_0x528b29){var _0x5574a2;var _0x2fd52b;_0xfa57f8=_0x528b29||[];var _0x452bd4=[];if(_0x528b29){for(var _0x33d957=0x0;_0x33d957<_0x528b29[_0x7307('0x42')];_0x33d957+=0x1){var _0x46d6dd=_0x528b29[_0x33d957][_0x7307('0x24')]({'plain':!![]});_0x5574a2=squel['insert']()[_0x7307('0x67')](_0x7307('0x8f'))[_0x7307('0x69')]([_0x7307('0x6d'),'ContactId',_0x7307('0x6a'),'CampaignId',_0x7307('0x4e'),_0x7307('0x4f')],squel['select']()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field']('id','ContactId')['field'](_0x46d6dd['CmListId'][_0x7307('0x72')](),_0x7307('0x6a'))[_0x7307('0x6c')](_0x1ee45d[_0x7307('0x3f')]['id'][_0x7307('0x72')](),_0x7307('0x59'))[_0x7307('0x6c')]('NOW()','createdAt')['field'](_0x7307('0x6e'),_0x7307('0x4f'))['from'](_0x7307('0x74'))[_0x7307('0x35')](_0x7307('0x75'))['where']('ListId\x20=\x20?',_0x46d6dd[_0x7307('0x71')][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x77')))[_0x7307('0x72')]();_0x452bd4[_0x7307('0x90')](db[_0x7307('0x88')][_0x7307('0x30')](_0x5574a2));}return BPromise[_0x7307('0x89')](_0x452bd4);}})[_0x7307('0x23')](function(){return _0xfa57f8;})[_0x7307('0x23')](respondWithResult(_0x573bf5,null))[_0x7307('0x45')](handleError(_0x573bf5,null));};exports[_0x7307('0x91')]=function(_0x524e2c,_0x3f0337,_0x433a12){return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x524e2c[_0x7307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f0337,null))['then'](function(_0x305342){if(_0x305342){return _0x305342[_0x7307('0x91')](_0x524e2c[_0x7307('0x30')][_0x7307('0x63')]);}})[_0x7307('0x23')](function(_0x43dd22){if(_0x43dd22){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x524e2c[_0x7307('0x30')]['ids'],'CampaignId':_0x524e2c[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](function(){return _0x43dd22;});}})['then'](respondWithStatusCode(_0x3f0337,null))['catch'](handleError(_0x3f0337,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index ed908a6..82842d3 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x469056,_0x4f46e1){var _0xba97aa=function(_0x217722){while(--_0x217722){_0x469056['push'](_0x469056['shift']());}};_0xba97aa(++_0x4f46e1);}(_0x7a54,0x106));var _0x47a5=function(_0x672ee4,_0x1ab74c){_0x672ee4=_0x672ee4-0x0;var _0x55bdd8=_0x7a54[_0x672ee4];return _0x55bdd8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x178b4e,_0x3810c2){var _0x176a81=function(_0x490fc4){while(--_0x490fc4){_0x178b4e['push'](_0x178b4e['shift']());}};_0x176a81(++_0x3810c2);}(_0x7a54,0x106));var _0x47a5=function(_0x40bc2d,_0x54a2c8){_0x40bc2d=_0x40bc2d-0x0;var _0x114b87=_0x7a54[_0x40bc2d];return _0x114b87;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index be04642..5f635b1 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc73=['jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCampaign','Campaign','findAll','options','where','limit','include','attributes','map','model','stringify','util','moment','ioredis','../../config/utils','../../config/environment'];(function(_0x1a37e3,_0x5db8f6){var _0x4db78a=function(_0x15e6c1){while(--_0x15e6c1){_0x1a37e3['push'](_0x1a37e3['shift']());}};_0x4db78a(++_0x5db8f6);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xcc73[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var moment=require(_0x3cc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cc7('0x4'));var jayson=require(_0x3cc7('0x5'));var client=jayson[_0x3cc7('0x6')][_0x3cc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x127590,_0x5604df,_0x416c48){return new BPromise(function(_0x37c184,_0x3f2dd7){return client[_0x3cc7('0x8')](_0x127590,_0x416c48)['then'](function(_0x2ff7ba){logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));logger[_0x3cc7('0xc')](_0x3cc7('0xd'),_0x5604df,_0x3cc7('0xb'),JSON['stringify'](_0x2ff7ba));if(_0x2ff7ba['error']){if(_0x2ff7ba[_0x3cc7('0xe')]['code']===0x1f4){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x3f2dd7(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x37c184(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}else{logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));_0x37c184(_0x2ff7ba[_0x3cc7('0x10')][_0x3cc7('0xf')]);}})[_0x3cc7('0x11')](function(_0x386a31){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x386a31);_0x3f2dd7(_0x386a31);});});}exports[_0x3cc7('0x12')]=function(_0x2a4ddf){var _0xff4317=this;return new Promise(function(_0x118aa0,_0x2f196a){return db[_0x3cc7('0x13')][_0x3cc7('0x14')]({'raw':_0x2a4ddf[_0x3cc7('0x15')]?_0x2a4ddf['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a4ddf[_0x3cc7('0x15')]?_0x2a4ddf['options'][_0x3cc7('0x16')]||null:null,'attributes':_0x2a4ddf[_0x3cc7('0x15')]?_0x2a4ddf[_0x3cc7('0x15')]['attributes']||null:null,'limit':_0x2a4ddf['options']?_0x2a4ddf[_0x3cc7('0x15')][_0x3cc7('0x17')]||null:null,'include':_0x2a4ddf['options']?_0x2a4ddf[_0x3cc7('0x15')][_0x3cc7('0x18')]?_['map'](_0x2a4ddf[_0x3cc7('0x15')]['include'],function(_0x338cd3){return{'model':db[_0x338cd3['model']],'as':_0x338cd3['as'],'attributes':_0x338cd3[_0x3cc7('0x19')],'include':_0x338cd3[_0x3cc7('0x18')]?_[_0x3cc7('0x1a')](_0x338cd3[_0x3cc7('0x18')],function(_0x29d2c8){return{'model':db[_0x29d2c8[_0x3cc7('0x1b')]],'as':_0x29d2c8['as'],'attributes':_0x29d2c8['attributes'],'include':_0x29d2c8[_0x3cc7('0x18')]?_[_0x3cc7('0x1a')](_0x29d2c8[_0x3cc7('0x18')],function(_0x5f0a09){return{'model':db[_0x5f0a09[_0x3cc7('0x1b')]],'as':_0x5f0a09['as'],'attributes':_0x5f0a09['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd571){logger[_0x3cc7('0x9')](_0x3cc7('0x12'),_0x2a4ddf);logger['debug'](_0x3cc7('0x12'),_0x2a4ddf,JSON[_0x3cc7('0x1c')](_0x4bd571));_0x118aa0(_0x4bd571);})[_0x3cc7('0x11')](function(_0x17aa73){logger[_0x3cc7('0xe')](_0x3cc7('0x12'),_0x17aa73[_0x3cc7('0xf')],_0x2a4ddf);_0x2f196a(_0xff4317[_0x3cc7('0xe')](0x1f4,_0x17aa73[_0x3cc7('0xf')]));});});}; \ No newline at end of file +var _0x6c96=['GetCampaign','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','Campaign','findAll','options','raw','attributes','map','include','model','info'];(function(_0x5e5c2c,_0x4c6068){var _0x318346=function(_0x3ff218){while(--_0x3ff218){_0x5e5c2c['push'](_0x5e5c2c['shift']());}};_0x318346(++_0x4c6068);}(_0x6c96,0x1c1));var _0x66c9=function(_0x1d2e06,_0x2927f8){_0x1d2e06=_0x1d2e06-0x0;var _0x2ef575=_0x6c96[_0x1d2e06];return _0x2ef575;};'use strict';var _=require(_0x66c9('0x0'));var util=require('util');var moment=require(_0x66c9('0x1'));var BPromise=require(_0x66c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66c9('0x3'));var db=require(_0x66c9('0x4'))['db'];var utils=require(_0x66c9('0x5'));var logger=require(_0x66c9('0x6'))(_0x66c9('0x7'));var config=require(_0x66c9('0x8'));var jayson=require(_0x66c9('0x9'));var client=jayson['client'][_0x66c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6baa,_0xb03819,_0x4d7692){return new BPromise(function(_0x55b488,_0xfc41a4){return client[_0x66c9('0xb')](_0x4c6baa,_0x4d7692)[_0x66c9('0xc')](function(_0x2e8ad5){logger['info']('Campaign,\x20%s,\x20%s',_0xb03819,'request\x20sent');logger['debug'](_0x66c9('0xd'),_0xb03819,_0x66c9('0xe'),JSON[_0x66c9('0xf')](_0x2e8ad5));if(_0x2e8ad5['error']){if(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x11')]===0x1f4){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5['error'][_0x66c9('0x13')]);return _0xfc41a4(_0x2e8ad5['error'][_0x66c9('0x13')]);}logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5[_0x66c9('0x10')]['message']);return _0x55b488(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x13')]);}else{logger['info'](_0x66c9('0x12'),_0xb03819,_0x66c9('0xe'));_0x55b488(_0x2e8ad5[_0x66c9('0x14')][_0x66c9('0x13')]);}})[_0x66c9('0x15')](function(_0x14d989){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x14d989);_0xfc41a4(_0x14d989);});});}exports['GetCampaign']=function(_0x11242a){var _0x578245=this;return new Promise(function(_0x4b4a50,_0x30c5fa){return db[_0x66c9('0x16')][_0x66c9('0x17')]({'raw':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')][_0x66c9('0x19')]===undefined?!![]:![]:!![],'where':_0x11242a[_0x66c9('0x18')]?_0x11242a['options']['where']||null:null,'attributes':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')][_0x66c9('0x1a')]||null:null,'limit':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')]['limit']||null:null,'include':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')]['include']?_[_0x66c9('0x1b')](_0x11242a[_0x66c9('0x18')][_0x66c9('0x1c')],function(_0x3f3be1){return{'model':db[_0x3f3be1[_0x66c9('0x1d')]],'as':_0x3f3be1['as'],'attributes':_0x3f3be1[_0x66c9('0x1a')],'include':_0x3f3be1[_0x66c9('0x1c')]?_['map'](_0x3f3be1[_0x66c9('0x1c')],function(_0x5bb599){return{'model':db[_0x5bb599['model']],'as':_0x5bb599['as'],'attributes':_0x5bb599[_0x66c9('0x1a')],'include':_0x5bb599['include']?_[_0x66c9('0x1b')](_0x5bb599['include'],function(_0x95ce9f){return{'model':db[_0x95ce9f['model']],'as':_0x95ce9f['as'],'attributes':_0x95ce9f[_0x66c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x66c9('0xc')](function(_0x1f9d01){logger[_0x66c9('0x1e')](_0x66c9('0x1f'),_0x11242a);logger['debug'](_0x66c9('0x1f'),_0x11242a,JSON[_0x66c9('0xf')](_0x1f9d01));_0x4b4a50(_0x1f9d01);})[_0x66c9('0x15')](function(_0x1279e5){logger['error'](_0x66c9('0x1f'),_0x1279e5['message'],_0x11242a);_0x30c5fa(_0x578245[_0x66c9('0x10')](0x1f4,_0x1279e5[_0x66c9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ce5ae19..e30b4e5 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e68=['./campaign.controller','get','index','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','removeLists','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4946fd,_0x234158){var _0x3a3637=function(_0x5180d6){while(--_0x5180d6){_0x4946fd['push'](_0x4946fd['shift']());}};_0x3a3637(++_0x234158);}(_0x7e68,0xd8));var _0x87e6=function(_0x4b3649,_0x1c7125){_0x4b3649=_0x4b3649-0x0;var _0x3deada=_0x7e68[_0x4b3649];return _0x3deada;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x87e6('0x0'));var timeout=require(_0x87e6('0x1'));var express=require(_0x87e6('0x2'));var router=express[_0x87e6('0x3')]();var fs_extra=require(_0x87e6('0x4'));var auth=require(_0x87e6('0x5'));var interaction=require(_0x87e6('0x6'));var config=require(_0x87e6('0x7'));var controller=require(_0x87e6('0x8'));router[_0x87e6('0x9')]('/',auth['isAuthenticated'](),controller[_0x87e6('0xa')]);router['get'](_0x87e6('0xb'),auth[_0x87e6('0xc')](),controller['show']);router[_0x87e6('0x9')](_0x87e6('0xd'),auth[_0x87e6('0xc')](),controller[_0x87e6('0xe')]);router['get'](_0x87e6('0xf'),auth[_0x87e6('0xc')](),controller['getHopperHistories']);router['get'](_0x87e6('0x10'),auth[_0x87e6('0xc')](),controller[_0x87e6('0x11')]);router[_0x87e6('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x87e6('0x12')]);router[_0x87e6('0x9')](_0x87e6('0x13'),auth[_0x87e6('0xc')](),controller['getLists']);router[_0x87e6('0x9')](_0x87e6('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x87e6('0x15')]('/',auth[_0x87e6('0xc')](),controller[_0x87e6('0x16')]);router[_0x87e6('0x15')](_0x87e6('0x17'),auth[_0x87e6('0xc')](),controller[_0x87e6('0x18')]);router['post'](_0x87e6('0x13'),auth[_0x87e6('0xc')](),controller[_0x87e6('0x19')]);router['post'](_0x87e6('0x14'),auth[_0x87e6('0xc')](),controller[_0x87e6('0x1a')]);router[_0x87e6('0x1b')](_0x87e6('0xb'),auth['isAuthenticated'](),controller[_0x87e6('0x1c')]);router[_0x87e6('0x1d')](_0x87e6('0xb'),auth[_0x87e6('0xc')](),controller['destroy']);router[_0x87e6('0x1d')](_0x87e6('0x13'),auth[_0x87e6('0xc')](),controller[_0x87e6('0x1e')]);router[_0x87e6('0x1d')](_0x87e6('0x14'),auth[_0x87e6('0xc')](),controller['removeBlackLists']);module[_0x87e6('0x1f')]=router; \ No newline at end of file +var _0x1294=['put','update','destroy','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x1294,0xb8));var _0x4129=function(_0x21f8a8,_0x1d7071){_0x21f8a8=_0x21f8a8-0x0;var _0x21d3d5=_0x1294[_0x21f8a8];return _0x21d3d5;};'use strict';var multer=require(_0x4129('0x0'));var util=require('util');var path=require(_0x4129('0x1'));var timeout=require('connect-timeout');var express=require(_0x4129('0x2'));var router=express[_0x4129('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4129('0x4'));var interaction=require(_0x4129('0x5'));var config=require(_0x4129('0x6'));var controller=require(_0x4129('0x7'));router[_0x4129('0x8')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0xa')]);router[_0x4129('0x8')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0xc')]);router[_0x4129('0x8')]('/:id/hoppers',auth[_0x4129('0x9')](),controller[_0x4129('0xd')]);router[_0x4129('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x4129('0xe')]);router[_0x4129('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x4129('0xf')]);router['get'](_0x4129('0x10'),auth[_0x4129('0x9')](),controller[_0x4129('0x11')]);router[_0x4129('0x8')](_0x4129('0x12'),auth[_0x4129('0x9')](),controller[_0x4129('0x13')]);router[_0x4129('0x14')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0x15')]);router['post'](_0x4129('0x16'),auth['isAuthenticated'](),controller[_0x4129('0x17')]);router[_0x4129('0x14')](_0x4129('0x10'),auth[_0x4129('0x9')](),controller[_0x4129('0x18')]);router[_0x4129('0x14')](_0x4129('0x12'),auth['isAuthenticated'](),controller[_0x4129('0x19')]);router[_0x4129('0x1a')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0x1b')]);router['delete'](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0x1c')]);router[_0x4129('0x1d')](_0x4129('0x10'),auth[_0x4129('0x9')](),controller['removeLists']);router[_0x4129('0x1d')](_0x4129('0x12'),auth[_0x4129('0x9')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ac3491c..734eff4 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5334=['STRING','TEXT','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x4e185e,_0x49e5f3){var _0x1ff433=function(_0x858807){while(--_0x858807){_0x4e185e['push'](_0x4e185e['shift']());}};_0x1ff433(++_0x49e5f3);}(_0x5334,0x64));var _0x4533=function(_0x2eb1f4,_0xcedd8c){_0x2eb1f4=_0x2eb1f4-0x0;var _0x353022=_0x5334[_0x2eb1f4];return _0x353022;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'key':{'type':Sequelize[_0x4533('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x4533('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4533('0x4')],'get':function(){return this[_0x4533('0x5')]('key');}}}; \ No newline at end of file +var _0x9a14=['key','sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x2c3737,_0x20b109){var _0x103a77=function(_0x519d7f){while(--_0x519d7f){_0x2c3737['push'](_0x2c3737['shift']());}};_0x103a77(++_0x20b109);}(_0x9a14,0x1b7));var _0x49a1=function(_0x2a6710,_0x4949c0){_0x2a6710=_0x2a6710-0x0;var _0x88f714=_0x9a14[_0x2a6710];return _0x88f714;};'use strict';var Sequelize=require(_0x49a1('0x0'));module[_0x49a1('0x1')]={'key':{'type':Sequelize[_0x49a1('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x49a1('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x49a1('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49a1('0x4')](_0x49a1('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 14cfdc7..f228829 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a11=['CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','status','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','CannedAnswer','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','catch','show','params','keys','rawAttributes','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x8883a7,_0x26d1ec){var _0x439aed=function(_0x121444){while(--_0x121444){_0x8883a7['push'](_0x8883a7['shift']());}};_0x439aed(++_0x26d1ec);}(_0x3a11,0xa9));var _0x13a1=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x3a11[_0x492af5];return _0x59f529;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x13a1('0x0'));var jsonpatch=require(_0x13a1('0x1'));var rp=require(_0x13a1('0x2'));var moment=require(_0x13a1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x13a1('0x4'));var util=require(_0x13a1('0x5'));var path=require('path');var sox=require(_0x13a1('0x6'));var csv=require(_0x13a1('0x7'));var ejs=require(_0x13a1('0x8'));var fs=require('fs');var fs_extra=require(_0x13a1('0x9'));var _=require('lodash');var squel=require(_0x13a1('0xa'));var crypto=require(_0x13a1('0xb'));var jsforce=require(_0x13a1('0xc'));var deskjs=require(_0x13a1('0xd'));var toCsv=require(_0x13a1('0x7'));var querystring=require('querystring');var Papa=require(_0x13a1('0xe'));var Redis=require(_0x13a1('0xf'));var authService=require(_0x13a1('0x10'));var qs=require(_0x13a1('0x11'));var as=require(_0x13a1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13a1('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x13a1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c0fb,_0x2ae50a){_0x2ae50a=_0x2ae50a||0xcc;return function(_0x5d470f){if(_0x5d470f){return _0x45c0fb[_0x13a1('0x15')](_0x2ae50a);}return _0x45c0fb[_0x13a1('0x16')](_0x2ae50a)['end']();};}function respondWithResult(_0x2ecf51,_0x45b9d7){_0x45b9d7=_0x45b9d7||0xc8;return function(_0x306b1d){if(_0x306b1d){return _0x2ecf51[_0x13a1('0x16')](_0x45b9d7)['json'](_0x306b1d);}};}function respondWithFilteredResult(_0x2fdd3a,_0x545757){return function(_0x3179f4){if(_0x3179f4){var _0x17fb77=typeof _0x545757['offset']==='undefined'&&typeof _0x545757['limit']===_0x13a1('0x17');var _0x62f52f=_0x3179f4[_0x13a1('0x18')];var _0xde6840=_0x17fb77?0x0:_0x545757[_0x13a1('0x19')];var _0x7132c8=_0x17fb77?_0x3179f4['count']:_0x545757[_0x13a1('0x19')]+_0x545757[_0x13a1('0x1a')];var _0x3c93f4;if(_0x7132c8>=_0x62f52f){_0x7132c8=_0x62f52f;_0x3c93f4=0xc8;}else{_0x3c93f4=0xce;}_0x2fdd3a[_0x13a1('0x16')](_0x3c93f4);return _0x2fdd3a['set'](_0x13a1('0x1b'),_0xde6840+'-'+_0x7132c8+'/'+_0x62f52f)['json'](_0x3179f4);}return null;};}function patchUpdates(_0x3b7bcb){return function(_0x2a1897){try{jsonpatch['apply'](_0x2a1897,_0x3b7bcb,!![]);}catch(_0x36100a){return BPromise[_0x13a1('0x1c')](_0x36100a);}return _0x2a1897[_0x13a1('0x1d')]();};}function saveUpdates(_0x488afd,_0x58a9d4){return function(_0x3c67da){if(_0x3c67da){return _0x3c67da[_0x13a1('0x1e')](_0x488afd)[_0x13a1('0x1f')](function(_0x44e03c){return _0x44e03c;});}return null;};}function removeEntity(_0x2f4b6a,_0x1eacd5){return function(_0x43b3f0){if(_0x43b3f0){return _0x43b3f0[_0x13a1('0x20')]()[_0x13a1('0x1f')](function(){var _0x48e104=_0x43b3f0[_0x13a1('0x21')]({'plain':!![]});var _0x56d74d='CannedAnswers';return db[_0x13a1('0x22')][_0x13a1('0x20')]({'where':{'type':_0x56d74d,'resourceId':_0x48e104['id']}})[_0x13a1('0x1f')](function(){return _0x43b3f0;});})[_0x13a1('0x1f')](function(){_0x2f4b6a[_0x13a1('0x16')](0xcc)[_0x13a1('0x23')]();});}};}function handleEntityNotFound(_0xc0e89b,_0x180775){return function(_0x48748a){if(!_0x48748a){_0xc0e89b[_0x13a1('0x15')](0x194);}return _0x48748a;};}function handleError(_0x1e1a0b,_0x2e0f58){_0x2e0f58=_0x2e0f58||0x1f4;return function(_0x1bd3e4){logger[_0x13a1('0x24')](_0x1bd3e4[_0x13a1('0x25')]);if(_0x1bd3e4[_0x13a1('0x26')]){delete _0x1bd3e4[_0x13a1('0x26')];}_0x1e1a0b[_0x13a1('0x16')](_0x2e0f58)['send'](_0x1bd3e4);};}exports[_0x13a1('0x27')]=function(_0x41799b,_0x2c42b1){var _0x196db4={},_0x30ce82={},_0xfc0399={'count':0x0,'rows':[]};var _0x5263ae=_[_0x13a1('0x28')](db[_0x13a1('0x29')]['rawAttributes'],function(_0x23d740){return{'name':_0x23d740[_0x13a1('0x2a')],'type':_0x23d740['type'][_0x13a1('0x2b')]};});_0x30ce82[_0x13a1('0x2c')]=_[_0x13a1('0x28')](_0x5263ae,_0x13a1('0x26'));_0x30ce82[_0x13a1('0x2d')]=_['keys'](_0x41799b[_0x13a1('0x2d')]);_0x30ce82[_0x13a1('0x2e')]=_[_0x13a1('0x2f')](_0x30ce82[_0x13a1('0x2c')],_0x30ce82[_0x13a1('0x2d')]);_0x196db4[_0x13a1('0x30')]=_[_0x13a1('0x2f')](_0x30ce82[_0x13a1('0x2c')],qs[_0x13a1('0x31')](_0x41799b['query'][_0x13a1('0x31')]));_0x196db4[_0x13a1('0x30')]=_0x196db4['attributes'][_0x13a1('0x32')]?_0x196db4[_0x13a1('0x30')]:_0x30ce82[_0x13a1('0x2c')];if(!_0x41799b[_0x13a1('0x2d')][_0x13a1('0x33')]('nolimit')){_0x196db4[_0x13a1('0x1a')]=qs[_0x13a1('0x1a')](_0x41799b[_0x13a1('0x2d')][_0x13a1('0x1a')]);_0x196db4['offset']=qs['offset'](_0x41799b[_0x13a1('0x2d')]['offset']);}_0x196db4[_0x13a1('0x34')]=qs[_0x13a1('0x35')](_0x41799b['query'][_0x13a1('0x35')]);_0x196db4[_0x13a1('0x36')]=qs[_0x13a1('0x2e')](_[_0x13a1('0x37')](_0x41799b[_0x13a1('0x2d')],_0x30ce82[_0x13a1('0x2e')]),_0x5263ae);if(_0x41799b[_0x13a1('0x2d')][_0x13a1('0x38')]){_0x196db4[_0x13a1('0x36')]=_[_0x13a1('0x39')](_0x196db4[_0x13a1('0x36')],{'$or':[{'key':{'$like':'%'+_0x41799b['query'][_0x13a1('0x38')]+'%'}},{'value':{'$like':'%'+_0x41799b[_0x13a1('0x2d')][_0x13a1('0x38')]+'%'}}]});}_0x196db4=_[_0x13a1('0x39')]({},_0x196db4,_0x41799b['options']);var _0x3351fc={'where':_0x196db4[_0x13a1('0x36')]};return db[_0x13a1('0x29')][_0x13a1('0x18')](_0x3351fc)[_0x13a1('0x1f')](function(_0xaa0ede){_0xfc0399['count']=_0xaa0ede;if(_0x41799b[_0x13a1('0x2d')]['includeAll']){_0x196db4[_0x13a1('0x3a')]=[{'all':!![]}];}return db[_0x13a1('0x29')][_0x13a1('0x3b')](_0x196db4);})[_0x13a1('0x1f')](function(_0x508837){_0xfc0399['rows']=_0x508837;return _0xfc0399;})[_0x13a1('0x1f')](respondWithFilteredResult(_0x2c42b1,_0x196db4))[_0x13a1('0x3c')](handleError(_0x2c42b1,null));};exports[_0x13a1('0x3d')]=function(_0x2f40df,_0x3cfd4e){var _0x40747d={'raw':!![],'where':{'id':_0x2f40df[_0x13a1('0x3e')]['id']}},_0xc857b9={};_0xc857b9[_0x13a1('0x2c')]=_[_0x13a1('0x3f')](db[_0x13a1('0x29')][_0x13a1('0x40')]);_0xc857b9[_0x13a1('0x2d')]=_['keys'](_0x2f40df[_0x13a1('0x2d')]);_0xc857b9[_0x13a1('0x2e')]=_[_0x13a1('0x2f')](_0xc857b9[_0x13a1('0x2c')],_0xc857b9[_0x13a1('0x2d')]);_0x40747d[_0x13a1('0x30')]=_['intersection'](_0xc857b9[_0x13a1('0x2c')],qs[_0x13a1('0x31')](_0x2f40df['query'][_0x13a1('0x31')]));_0x40747d['attributes']=_0x40747d['attributes'][_0x13a1('0x32')]?_0x40747d['attributes']:_0xc857b9['model'];if(_0x2f40df['query']['includeAll']){_0x40747d[_0x13a1('0x3a')]=[{'all':!![]}];}_0x40747d=_[_0x13a1('0x39')]({},_0x40747d,_0x2f40df[_0x13a1('0x41')]);return db[_0x13a1('0x29')][_0x13a1('0x42')](_0x40747d)[_0x13a1('0x1f')](handleEntityNotFound(_0x3cfd4e,null))[_0x13a1('0x1f')](respondWithResult(_0x3cfd4e,null))['catch'](handleError(_0x3cfd4e,null));};exports['update']=function(_0x40db05,_0x40600c){if(_0x40db05[_0x13a1('0x43')]['id']){delete _0x40db05['body']['id'];}return db['CannedAnswer'][_0x13a1('0x42')]({'where':{'id':_0x40db05[_0x13a1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x40600c,null))[_0x13a1('0x1f')](saveUpdates(_0x40db05[_0x13a1('0x43')],null))[_0x13a1('0x1f')](respondWithResult(_0x40600c,null))['catch'](handleError(_0x40600c,null));};exports[_0x13a1('0x20')]=function(_0x503514,_0x495ca3){return db[_0x13a1('0x29')][_0x13a1('0x42')]({'where':{'id':_0x503514[_0x13a1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x495ca3,null))[_0x13a1('0x1f')](removeEntity(_0x495ca3,null))[_0x13a1('0x3c')](handleError(_0x495ca3,null));};exports[_0x13a1('0x44')]=function(_0x48709b,_0x37733c){var _0x21b44c={'key':_0x48709b[_0x13a1('0x43')][_0x13a1('0x2b')]};if(_0x48709b[_0x13a1('0x43')][_0x13a1('0x45')]){_0x21b44c[_0x13a1('0x45')]=_0x48709b[_0x13a1('0x43')][_0x13a1('0x45')];}else if(_0x48709b[_0x13a1('0x43')][_0x13a1('0x46')]){_0x21b44c[_0x13a1('0x46')]=_0x48709b['body']['SmsAccountId'];}else if(_0x48709b[_0x13a1('0x43')][_0x13a1('0x47')]){_0x21b44c[_0x13a1('0x47')]=_0x48709b[_0x13a1('0x43')][_0x13a1('0x47')];}else if(_0x48709b[_0x13a1('0x43')][_0x13a1('0x48')]){_0x21b44c['ChatWebsiteId']=_0x48709b[_0x13a1('0x43')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x21b44c})[_0x13a1('0x1f')](function(_0x40253e){if(_0x40253e){throw new db[(_0x13a1('0x49'))][(_0x13a1('0x4a'))](_0x13a1('0x4b'));}return db[_0x13a1('0x29')][_0x13a1('0x44')](_0x48709b[_0x13a1('0x43')]);})[_0x13a1('0x1f')](function(_0x285e2a){var _0x186ae0=_0x48709b['user'][_0x13a1('0x21')]({'plain':!![]});if(!_0x186ae0)throw new Error(_0x13a1('0x4c'));if(_0x186ae0[_0x13a1('0x4d')]===_0x13a1('0x4e')){var _0x5e1b8e=_0x285e2a[_0x13a1('0x21')]({'plain':!![]});return db[_0x13a1('0x4f')][_0x13a1('0x42')]({'where':{'name':_0x13a1('0x50'),'userProfileId':_0x186ae0['userProfileId']},'raw':!![]})[_0x13a1('0x1f')](function(_0x9a9a1f){if(_0x9a9a1f&&_0x9a9a1f[_0x13a1('0x51')]===0x0){return db['UserProfileResource'][_0x13a1('0x44')]({'name':_0x5e1b8e[_0x13a1('0x26')],'resourceId':_0x5e1b8e['id'],'type':_0x9a9a1f[_0x13a1('0x26')],'sectionId':_0x9a9a1f['id']},{})['then'](function(){return _0x285e2a;});}else{return _0x285e2a;}})[_0x13a1('0x3c')](function(_0x453930){logger['error'](_0x13a1('0x52'),_0x453930);throw _0x453930;});}return _0x285e2a;})[_0x13a1('0x1f')](respondWithResult(_0x37733c,0xc9))[_0x13a1('0x3c')](handleError(_0x37733c,null));}; \ No newline at end of file +var _0x8cb7=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x43a929,_0x4b70a6){var _0x394281=function(_0x1830b7){while(--_0x1830b7){_0x43a929['push'](_0x43a929['shift']());}};_0x394281(++_0x4b70a6);}(_0x8cb7,0x1a9));var _0x78cb=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x8cb7[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x78cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78cb('0x1'));var jsonpatch=require(_0x78cb('0x2'));var rp=require('request-promise');var moment=require(_0x78cb('0x3'));var BPromise=require(_0x78cb('0x4'));var Mustache=require('mustache');var util=require(_0x78cb('0x5'));var path=require(_0x78cb('0x6'));var sox=require('sox');var csv=require(_0x78cb('0x7'));var ejs=require(_0x78cb('0x8'));var fs=require('fs');var fs_extra=require(_0x78cb('0x9'));var _=require(_0x78cb('0xa'));var squel=require(_0x78cb('0xb'));var crypto=require(_0x78cb('0xc'));var jsforce=require(_0x78cb('0xd'));var deskjs=require(_0x78cb('0xe'));var toCsv=require(_0x78cb('0x7'));var querystring=require(_0x78cb('0xf'));var Papa=require(_0x78cb('0x10'));var Redis=require(_0x78cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x78cb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78cb('0x13'));var logger=require(_0x78cb('0x14'))('api');var utils=require(_0x78cb('0x15'));var config=require(_0x78cb('0x16'));var licenseUtil=require(_0x78cb('0x17'));var db=require(_0x78cb('0x18'))['db'];function respondWithStatusCode(_0x140606,_0x1e9430){_0x1e9430=_0x1e9430||0xcc;return function(_0xcc074){if(_0xcc074){return _0x140606[_0x78cb('0x19')](_0x1e9430);}return _0x140606['status'](_0x1e9430)[_0x78cb('0x1a')]();};}function respondWithResult(_0x19a368,_0x16c1e9){_0x16c1e9=_0x16c1e9||0xc8;return function(_0x33b4a3){if(_0x33b4a3){return _0x19a368[_0x78cb('0x1b')](_0x16c1e9)[_0x78cb('0x1c')](_0x33b4a3);}};}function respondWithFilteredResult(_0x10cfc9,_0x70b58b){return function(_0x194c16){if(_0x194c16){var _0x263b96=typeof _0x70b58b[_0x78cb('0x1d')]===_0x78cb('0x1e')&&typeof _0x70b58b[_0x78cb('0x1f')]===_0x78cb('0x1e');var _0x17ceb4=_0x194c16['count'];var _0xc3804b=_0x263b96?0x0:_0x70b58b[_0x78cb('0x1d')];var _0x334951=_0x263b96?_0x194c16[_0x78cb('0x20')]:_0x70b58b['offset']+_0x70b58b['limit'];var _0x19166e;if(_0x334951>=_0x17ceb4){_0x334951=_0x17ceb4;_0x19166e=0xc8;}else{_0x19166e=0xce;}_0x10cfc9[_0x78cb('0x1b')](_0x19166e);return _0x10cfc9['set'](_0x78cb('0x21'),_0xc3804b+'-'+_0x334951+'/'+_0x17ceb4)[_0x78cb('0x1c')](_0x194c16);}return null;};}function patchUpdates(_0x447df4){return function(_0x3b4ea9){try{jsonpatch[_0x78cb('0x22')](_0x3b4ea9,_0x447df4,!![]);}catch(_0x50e8c0){return BPromise[_0x78cb('0x23')](_0x50e8c0);}return _0x3b4ea9[_0x78cb('0x24')]();};}function saveUpdates(_0x492fb0,_0xd81628){return function(_0x13e3f0){if(_0x13e3f0){return _0x13e3f0[_0x78cb('0x25')](_0x492fb0)[_0x78cb('0x26')](function(_0x18bb72){return _0x18bb72;});}return null;};}function removeEntity(_0x10205c,_0x515b41){return function(_0x32d78b){if(_0x32d78b){return _0x32d78b[_0x78cb('0x27')]()[_0x78cb('0x26')](function(){var _0x34dbbb=_0x32d78b[_0x78cb('0x28')]({'plain':!![]});var _0x385b4a=_0x78cb('0x29');return db[_0x78cb('0x2a')][_0x78cb('0x27')]({'where':{'type':_0x385b4a,'resourceId':_0x34dbbb['id']}})[_0x78cb('0x26')](function(){return _0x32d78b;});})['then'](function(){_0x10205c['status'](0xcc)[_0x78cb('0x1a')]();});}};}function handleEntityNotFound(_0x506231,_0x3b9f5c){return function(_0x4d8324){if(!_0x4d8324){_0x506231['sendStatus'](0x194);}return _0x4d8324;};}function handleError(_0x5d84ca,_0x57c060){_0x57c060=_0x57c060||0x1f4;return function(_0x4d71de){logger[_0x78cb('0x2b')](_0x4d71de[_0x78cb('0x2c')]);if(_0x4d71de[_0x78cb('0x2d')]){delete _0x4d71de[_0x78cb('0x2d')];}_0x5d84ca[_0x78cb('0x1b')](_0x57c060)[_0x78cb('0x2e')](_0x4d71de);};}exports[_0x78cb('0x2f')]=function(_0x2b3c58,_0xd9864b){var _0xd4d970={},_0xc1186b={},_0x1287e7={'count':0x0,'rows':[]};var _0x146db7=_['map'](db[_0x78cb('0x30')][_0x78cb('0x31')],function(_0x3ead4b){return{'name':_0x3ead4b[_0x78cb('0x32')],'type':_0x3ead4b[_0x78cb('0x33')][_0x78cb('0x34')]};});_0xc1186b[_0x78cb('0x35')]=_[_0x78cb('0x36')](_0x146db7,_0x78cb('0x2d'));_0xc1186b[_0x78cb('0x37')]=_[_0x78cb('0x38')](_0x2b3c58[_0x78cb('0x37')]);_0xc1186b['filters']=_[_0x78cb('0x39')](_0xc1186b[_0x78cb('0x35')],_0xc1186b['query']);_0xd4d970[_0x78cb('0x3a')]=_[_0x78cb('0x39')](_0xc1186b['model'],qs[_0x78cb('0x3b')](_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x3b')]));_0xd4d970[_0x78cb('0x3a')]=_0xd4d970['attributes'][_0x78cb('0x3c')]?_0xd4d970[_0x78cb('0x3a')]:_0xc1186b[_0x78cb('0x35')];if(!_0x2b3c58[_0x78cb('0x37')]['hasOwnProperty'](_0x78cb('0x3d'))){_0xd4d970[_0x78cb('0x1f')]=qs[_0x78cb('0x1f')](_0x2b3c58[_0x78cb('0x37')]['limit']);_0xd4d970[_0x78cb('0x1d')]=qs[_0x78cb('0x1d')](_0x2b3c58[_0x78cb('0x37')]['offset']);}_0xd4d970[_0x78cb('0x3e')]=qs['sort'](_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x3f')]);_0xd4d970['where']=qs[_0x78cb('0x40')](_['pick'](_0x2b3c58['query'],_0xc1186b[_0x78cb('0x40')]),_0x146db7);if(_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]){_0xd4d970[_0x78cb('0x42')]=_['merge'](_0xd4d970[_0x78cb('0x42')],{'$or':[{'key':{'$like':'%'+_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]+'%'}},{'value':{'$like':'%'+_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]+'%'}}]});}_0xd4d970=_[_0x78cb('0x43')]({},_0xd4d970,_0x2b3c58[_0x78cb('0x44')]);var _0x46fc6c={'where':_0xd4d970[_0x78cb('0x42')]};return db[_0x78cb('0x30')]['count'](_0x46fc6c)[_0x78cb('0x26')](function(_0x51dac0){_0x1287e7['count']=_0x51dac0;if(_0x2b3c58['query'][_0x78cb('0x45')]){_0xd4d970[_0x78cb('0x46')]=[{'all':!![]}];}return db[_0x78cb('0x30')][_0x78cb('0x47')](_0xd4d970);})['then'](function(_0x55a81b){_0x1287e7[_0x78cb('0x48')]=_0x55a81b;return _0x1287e7;})[_0x78cb('0x26')](respondWithFilteredResult(_0xd9864b,_0xd4d970))[_0x78cb('0x49')](handleError(_0xd9864b,null));};exports['show']=function(_0x21ed79,_0x972706){var _0x331d61={'raw':!![],'where':{'id':_0x21ed79[_0x78cb('0x4a')]['id']}},_0x599bdb={};_0x599bdb[_0x78cb('0x35')]=_['keys'](db[_0x78cb('0x30')]['rawAttributes']);_0x599bdb[_0x78cb('0x37')]=_[_0x78cb('0x38')](_0x21ed79[_0x78cb('0x37')]);_0x599bdb['filters']=_[_0x78cb('0x39')](_0x599bdb['model'],_0x599bdb[_0x78cb('0x37')]);_0x331d61[_0x78cb('0x3a')]=_[_0x78cb('0x39')](_0x599bdb[_0x78cb('0x35')],qs[_0x78cb('0x3b')](_0x21ed79[_0x78cb('0x37')][_0x78cb('0x3b')]));_0x331d61['attributes']=_0x331d61['attributes'][_0x78cb('0x3c')]?_0x331d61[_0x78cb('0x3a')]:_0x599bdb['model'];if(_0x21ed79['query'][_0x78cb('0x45')]){_0x331d61['include']=[{'all':!![]}];}_0x331d61=_[_0x78cb('0x43')]({},_0x331d61,_0x21ed79['options']);return db[_0x78cb('0x30')][_0x78cb('0x4b')](_0x331d61)['then'](handleEntityNotFound(_0x972706,null))[_0x78cb('0x26')](respondWithResult(_0x972706,null))[_0x78cb('0x49')](handleError(_0x972706,null));};exports[_0x78cb('0x25')]=function(_0x3ca5a5,_0x8c3700){if(_0x3ca5a5[_0x78cb('0x4c')]['id']){delete _0x3ca5a5[_0x78cb('0x4c')]['id'];}return db[_0x78cb('0x30')][_0x78cb('0x4b')]({'where':{'id':_0x3ca5a5['params']['id']}})['then'](handleEntityNotFound(_0x8c3700,null))[_0x78cb('0x26')](saveUpdates(_0x3ca5a5[_0x78cb('0x4c')],null))[_0x78cb('0x26')](respondWithResult(_0x8c3700,null))[_0x78cb('0x49')](handleError(_0x8c3700,null));};exports[_0x78cb('0x27')]=function(_0xfeceee,_0x252b0e){return db['CannedAnswer'][_0x78cb('0x4b')]({'where':{'id':_0xfeceee[_0x78cb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x252b0e,null))[_0x78cb('0x26')](removeEntity(_0x252b0e,null))['catch'](handleError(_0x252b0e,null));};exports[_0x78cb('0x4d')]=function(_0x14f478,_0x118082){var _0x188041={'key':_0x14f478[_0x78cb('0x4c')]['key']};if(_0x14f478['body'][_0x78cb('0x4e')]){_0x188041['MailAccountId']=_0x14f478['body']['MailAccountId'];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x4f')]){_0x188041[_0x78cb('0x4f')]=_0x14f478['body'][_0x78cb('0x4f')];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x50')]){_0x188041[_0x78cb('0x50')]=_0x14f478[_0x78cb('0x4c')][_0x78cb('0x50')];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x51')]){_0x188041[_0x78cb('0x51')]=_0x14f478['body'][_0x78cb('0x51')];}return db['CannedAnswer']['find']({'where':_0x188041})[_0x78cb('0x26')](function(_0x1539d4){if(_0x1539d4){throw new db[(_0x78cb('0x52'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x78cb('0x4d')](_0x14f478[_0x78cb('0x4c')]);})[_0x78cb('0x26')](function(_0x4a048a){var _0x546fe0=_0x14f478[_0x78cb('0x53')][_0x78cb('0x28')]({'plain':!![]});if(!_0x546fe0)throw new Error(_0x78cb('0x54'));if(_0x546fe0['role']===_0x78cb('0x53')){var _0x121b92=_0x4a048a[_0x78cb('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x78cb('0x4b')]({'where':{'name':_0x78cb('0x29'),'userProfileId':_0x546fe0[_0x78cb('0x55')]},'raw':!![]})['then'](function(_0x4f83a2){if(_0x4f83a2&&_0x4f83a2[_0x78cb('0x56')]===0x0){return db[_0x78cb('0x2a')][_0x78cb('0x4d')]({'name':_0x121b92[_0x78cb('0x2d')],'resourceId':_0x121b92['id'],'type':_0x4f83a2[_0x78cb('0x2d')],'sectionId':_0x4f83a2['id']},{})[_0x78cb('0x26')](function(){return _0x4a048a;});}else{return _0x4a048a;}})[_0x78cb('0x49')](function(_0x2ec44a){logger[_0x78cb('0x2b')](_0x78cb('0x57'),_0x2ec44a);throw _0x2ec44a;});}return _0x4a048a;})['then'](respondWithResult(_0x118082,0xc9))[_0x78cb('0x49')](handleError(_0x118082,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 07a85dc..d560cea 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ed3=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x8ce514,_0x468ecc){var _0x20afe9=function(_0x1bf3a8){while(--_0x1bf3a8){_0x8ce514['push'](_0x8ce514['shift']());}};_0x20afe9(++_0x468ecc);}(_0x2ed3,0xfa));var _0x32ed=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x2ed3[_0x64aff8];return _0x5488a3;};'use strict';var _=require(_0x32ed('0x0'));var util=require(_0x32ed('0x1'));var logger=require(_0x32ed('0x2'))('api');var moment=require(_0x32ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x32ed('0x4'));var fs=require('fs');var path=require(_0x32ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x32ed('0x6'));module[_0x32ed('0x7')]=function(_0x2d1a93,_0x1a4152){return _0x2d1a93[_0x32ed('0x8')](_0x32ed('0x9'),attributes,{'tableName':_0x32ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x32ed('0xb'),'collate':_0x32ed('0xc')});}; \ No newline at end of file +var _0x1614=['lodash','util','api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x266d22,_0x4665f4){var _0x520d3c=function(_0x545232){while(--_0x545232){_0x266d22['push'](_0x266d22['shift']());}};_0x520d3c(++_0x4665f4);}(_0x1614,0x1ee));var _0x4161=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x1614[_0x3f0b30];return _0x2748a5;};'use strict';var _=require(_0x4161('0x0'));var util=require(_0x4161('0x1'));var logger=require('../../config/logger')(_0x4161('0x2'));var moment=require(_0x4161('0x3'));var BPromise=require('bluebird');var rp=require(_0x4161('0x4'));var fs=require('fs');var path=require(_0x4161('0x5'));var rimraf=require(_0x4161('0x6'));var config=require('../../config/environment');var attributes=require(_0x4161('0x7'));module[_0x4161('0x8')]=function(_0x5d3d2,_0x433af9){return _0x5d3d2[_0x4161('0x9')](_0x4161('0xa'),attributes,{'tableName':_0x4161('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4161('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3262203..14ba0b5 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1aa2e4,_0xbc7bde){var _0x329820=function(_0x945e1){while(--_0x945e1){_0x1aa2e4['push'](_0x1aa2e4['shift']());}};_0x329820(++_0xbc7bde);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x3a9a71,_0x3c58a1){var _0x5f1b1e=function(_0x337598){while(--_0x337598){_0x3a9a71['push'](_0x3a9a71['shift']());}};_0x5f1b1e(++_0x3c58a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 7fc0a13..4933be2 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b09=['put','/:id','exports','util','path','express','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','show','post','create'];(function(_0x55b79c,_0x39d43a){var _0x4e8743=function(_0x25a620){while(--_0x25a620){_0x55b79c['push'](_0x55b79c['shift']());}};_0x4e8743(++_0x39d43a);}(_0x3b09,0x137));var _0x93b0=function(_0xb5fb77,_0x2ec122){_0xb5fb77=_0xb5fb77-0x0;var _0x3f4101=_0x3b09[_0xb5fb77];return _0x3f4101;};'use strict';var multer=require('multer');var util=require(_0x93b0('0x0'));var path=require(_0x93b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x93b0('0x2'));var router=express['Router']();var fs_extra=require(_0x93b0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x93b0('0x4'));var config=require('../../config/environment');var controller=require(_0x93b0('0x5'));router[_0x93b0('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x93b0('0x7')](),controller[_0x93b0('0x8')]);router[_0x93b0('0x9')]('/',auth[_0x93b0('0x7')](),controller[_0x93b0('0xa')]);router[_0x93b0('0xb')](_0x93b0('0xc'),auth[_0x93b0('0x7')](),controller['update']);router['delete'](_0x93b0('0xc'),auth[_0x93b0('0x7')](),controller['destroy']);module[_0x93b0('0xd')]=router; \ No newline at end of file +var _0xd0b7=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd0b7,0x9a));var _0x7d0b=function(_0x52f712,_0x36667){_0x52f712=_0x52f712-0x0;var _0x121636=_0xd0b7[_0x52f712];return _0x121636;};'use strict';var multer=require(_0x7d0b('0x0'));var util=require(_0x7d0b('0x1'));var path=require(_0x7d0b('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d0b('0x3'));var router=express[_0x7d0b('0x4')]();var fs_extra=require(_0x7d0b('0x5'));var auth=require(_0x7d0b('0x6'));var interaction=require(_0x7d0b('0x7'));var config=require(_0x7d0b('0x8'));var controller=require(_0x7d0b('0x9'));router[_0x7d0b('0xa')]('/',auth[_0x7d0b('0xb')](),controller['index']);router[_0x7d0b('0xa')](_0x7d0b('0xc'),auth[_0x7d0b('0xb')](),controller[_0x7d0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7d0b('0xc'),auth[_0x7d0b('0xb')](),controller[_0x7d0b('0xe')]);router[_0x7d0b('0xf')]('/:id',auth[_0x7d0b('0xb')](),controller[_0x7d0b('0x10')]);module[_0x7d0b('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index bccad78..846957d 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd634=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0xe9e8f9,_0xa250b8){var _0x28768e=function(_0x59087a){while(--_0x59087a){_0xe9e8f9['push'](_0xe9e8f9['shift']());}};_0x28768e(++_0xa250b8);}(_0xd634,0x151));var _0x4d63=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xd634[_0x43b06b];return _0x2c555b;};'use strict';var Sequelize=require(_0x4d63('0x0'));module[_0x4d63('0x1')]={'calldate':{'type':Sequelize[_0x4d63('0x2')],'allowNull':![],'defaultValue':_0x4d63('0x3')},'clid':{'type':Sequelize[_0x4d63('0x4')]},'src':{'type':Sequelize[_0x4d63('0x4')]},'dst':{'type':Sequelize[_0x4d63('0x4')]},'dcontext':{'type':Sequelize[_0x4d63('0x4')]},'channel':{'type':Sequelize[_0x4d63('0x4')]},'dstchannel':{'type':Sequelize[_0x4d63('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x4d63('0x4')]},'duration':{'type':Sequelize[_0x4d63('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4d63('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4d63('0x4')]},'amaflags':{'type':Sequelize[_0x4d63('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4d63('0x4')]},'userfield':{'type':Sequelize[_0x4d63('0x4')]},'uniqueid':{'type':Sequelize[_0x4d63('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x4d63('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x4d63('0x4')]}}; \ No newline at end of file +var _0x9780=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x5ec548,_0xf21387){var _0x4093fb=function(_0xa22522){while(--_0xa22522){_0x5ec548['push'](_0x5ec548['shift']());}};_0x4093fb(++_0xf21387);}(_0x9780,0x1d4));var _0x0978=function(_0xd79494,_0x1fcda7){_0xd79494=_0xd79494-0x0;var _0x1c1698=_0x9780[_0xd79494];return _0x1c1698;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0978('0x0')],'allowNull':![],'defaultValue':_0x0978('0x1')},'clid':{'type':Sequelize[_0x0978('0x2')]},'src':{'type':Sequelize[_0x0978('0x2')]},'dst':{'type':Sequelize[_0x0978('0x2')]},'dcontext':{'type':Sequelize[_0x0978('0x2')]},'channel':{'type':Sequelize[_0x0978('0x2')]},'dstchannel':{'type':Sequelize[_0x0978('0x2')]},'lastapp':{'type':Sequelize[_0x0978('0x2')]},'lastdata':{'type':Sequelize[_0x0978('0x2')]},'duration':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0978('0x2')]},'amaflags':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0978('0x2')]},'userfield':{'type':Sequelize[_0x0978('0x2')]},'uniqueid':{'type':Sequelize[_0x0978('0x2')]},'linkedid':{'type':Sequelize[_0x0978('0x2')]},'sequence':{'type':Sequelize[_0x0978('0x2')]},'peeraccount':{'type':Sequelize[_0x0978('0x2')]},'type':{'type':Sequelize[_0x0978('0x2')]},'tag':{'type':Sequelize[_0x0978('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 2c21878..d0b933b 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b67=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort'];(function(_0x5d28e0,_0x4bb9d8){var _0x53a924=function(_0x28b506){while(--_0x28b506){_0x5d28e0['push'](_0x5d28e0['shift']());}};_0x53a924(++_0x4bb9d8);}(_0x9b67,0xf6));var _0x79b6=function(_0x16c71e,_0x1759df){_0x16c71e=_0x16c71e-0x0;var _0x446a33=_0x9b67[_0x16c71e];return _0x446a33;};'use strict';var emlformat=require(_0x79b6('0x0'));var rimraf=require(_0x79b6('0x1'));var zipdir=require(_0x79b6('0x2'));var jsonpatch=require(_0x79b6('0x3'));var rp=require(_0x79b6('0x4'));var moment=require('moment');var BPromise=require(_0x79b6('0x5'));var Mustache=require(_0x79b6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x79b6('0x7'));var csv=require(_0x79b6('0x8'));var ejs=require(_0x79b6('0x9'));var fs=require('fs');var fs_extra=require(_0x79b6('0xa'));var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x8'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var licenseUtil=require(_0x79b6('0x17'));var db=require(_0x79b6('0x18'))['db'];function respondWithStatusCode(_0x526727,_0xc05a77){_0xc05a77=_0xc05a77||0xcc;return function(_0x2df08d){if(_0x2df08d){return _0x526727[_0x79b6('0x19')](_0xc05a77);}return _0x526727[_0x79b6('0x1a')](_0xc05a77)[_0x79b6('0x1b')]();};}function respondWithResult(_0x40478d,_0x19d5b2){_0x19d5b2=_0x19d5b2||0xc8;return function(_0x3ef1fa){if(_0x3ef1fa){return _0x40478d[_0x79b6('0x1a')](_0x19d5b2)[_0x79b6('0x1c')](_0x3ef1fa);}};}function respondWithFilteredResult(_0x2ac966,_0x3563cc){return function(_0x1e8bf1){if(_0x1e8bf1){var _0x4cf491=typeof _0x3563cc[_0x79b6('0x1d')]===_0x79b6('0x1e')&&typeof _0x3563cc[_0x79b6('0x1f')]===_0x79b6('0x1e');var _0x2a8788=_0x1e8bf1[_0x79b6('0x20')];var _0x131bc5=_0x4cf491?0x0:_0x3563cc[_0x79b6('0x1d')];var _0x3ff583=_0x4cf491?_0x1e8bf1[_0x79b6('0x20')]:_0x3563cc[_0x79b6('0x1d')]+_0x3563cc[_0x79b6('0x1f')];var _0x1361f6;if(_0x3ff583>=_0x2a8788){_0x3ff583=_0x2a8788;_0x1361f6=0xc8;}else{_0x1361f6=0xce;}_0x2ac966['status'](_0x1361f6);return _0x2ac966[_0x79b6('0x21')]('Content-Range',_0x131bc5+'-'+_0x3ff583+'/'+_0x2a8788)[_0x79b6('0x1c')](_0x1e8bf1);}return null;};}function patchUpdates(_0x532e65){return function(_0x28b9c2){try{jsonpatch[_0x79b6('0x22')](_0x28b9c2,_0x532e65,!![]);}catch(_0x299bed){return BPromise['reject'](_0x299bed);}return _0x28b9c2[_0x79b6('0x23')]();};}function saveUpdates(_0x30dc0b,_0x53208a){return function(_0x565f86){if(_0x565f86){return _0x565f86[_0x79b6('0x24')](_0x30dc0b)[_0x79b6('0x25')](function(_0x9bd2cc){return _0x9bd2cc;});}return null;};}function removeEntity(_0x268826,_0x3b2a2a){return function(_0x488102){if(_0x488102){return _0x488102[_0x79b6('0x26')]()[_0x79b6('0x25')](function(){_0x268826[_0x79b6('0x1a')](0xcc)[_0x79b6('0x1b')]();});}};}function handleEntityNotFound(_0x4c275d,_0x53c03c){return function(_0x40ef76){if(!_0x40ef76){_0x4c275d[_0x79b6('0x19')](0x194);}return _0x40ef76;};}function handleError(_0x37b01b,_0xc25c99){_0xc25c99=_0xc25c99||0x1f4;return function(_0x4adf15){logger[_0x79b6('0x27')](_0x4adf15['stack']);if(_0x4adf15[_0x79b6('0x28')]){delete _0x4adf15[_0x79b6('0x28')];}_0x37b01b[_0x79b6('0x1a')](_0xc25c99)[_0x79b6('0x29')](_0x4adf15);};}exports['index']=function(_0x1484e5,_0x310832){var _0x53b463={},_0x158221={},_0x2d219c={'count':0x0,'rows':[]};var _0x1b1f2b=_[_0x79b6('0x2a')](db[_0x79b6('0x2b')][_0x79b6('0x2c')],function(_0x53b2f5){return{'name':_0x53b2f5[_0x79b6('0x2d')],'type':_0x53b2f5[_0x79b6('0x2e')][_0x79b6('0x2f')]};});_0x158221[_0x79b6('0x30')]=_[_0x79b6('0x2a')](_0x1b1f2b,_0x79b6('0x28'));_0x158221['query']=_[_0x79b6('0x31')](_0x1484e5[_0x79b6('0x32')]);_0x158221[_0x79b6('0x33')]=_['intersection'](_0x158221['model'],_0x158221[_0x79b6('0x32')]);_0x53b463[_0x79b6('0x34')]=_[_0x79b6('0x35')](_0x158221[_0x79b6('0x30')],qs[_0x79b6('0x36')](_0x1484e5[_0x79b6('0x32')]['fields']));_0x53b463['attributes']=_0x53b463[_0x79b6('0x34')]['length']?_0x53b463[_0x79b6('0x34')]:_0x158221['model'];if(!_0x1484e5[_0x79b6('0x32')][_0x79b6('0x37')]('nolimit')){_0x53b463[_0x79b6('0x1f')]=qs[_0x79b6('0x1f')](_0x1484e5['query'][_0x79b6('0x1f')]);_0x53b463['offset']=qs[_0x79b6('0x1d')](_0x1484e5[_0x79b6('0x32')][_0x79b6('0x1d')]);}_0x53b463[_0x79b6('0x38')]=qs[_0x79b6('0x39')](_0x1484e5[_0x79b6('0x32')][_0x79b6('0x39')]);_0x53b463[_0x79b6('0x3a')]=qs[_0x79b6('0x33')](_[_0x79b6('0x3b')](_0x1484e5['query'],_0x158221['filters']),_0x1b1f2b);if(_0x1484e5['query'][_0x79b6('0x3c')]){_0x53b463[_0x79b6('0x3a')]=_['merge'](_0x53b463[_0x79b6('0x3a')],{'$or':_['map'](_0x1b1f2b,function(_0x179a98){if(_0x179a98[_0x79b6('0x2e')]!==_0x79b6('0x3d')){var _0x53db1d={};_0x53db1d[_0x179a98[_0x79b6('0x28')]]={'$like':'%'+_0x1484e5['query'][_0x79b6('0x3c')]+'%'};return _0x53db1d;}})});}_0x53b463=_[_0x79b6('0x3e')]({},_0x53b463,_0x1484e5[_0x79b6('0x3f')]);var _0x2feeeb={'where':_0x53b463[_0x79b6('0x3a')]};return db['Cdr']['count'](_0x2feeeb)[_0x79b6('0x25')](function(_0x48ae49){_0x2d219c[_0x79b6('0x20')]=_0x48ae49;if(_0x1484e5[_0x79b6('0x32')][_0x79b6('0x40')]){_0x53b463[_0x79b6('0x41')]=[{'all':!![]}];}return db[_0x79b6('0x2b')][_0x79b6('0x42')](_0x53b463);})[_0x79b6('0x25')](function(_0x4a7f90){_0x2d219c[_0x79b6('0x43')]=_0x4a7f90;return _0x2d219c;})[_0x79b6('0x25')](respondWithFilteredResult(_0x310832,_0x53b463))[_0x79b6('0x44')](handleError(_0x310832,null));};exports[_0x79b6('0x45')]=function(_0x568f6b,_0x12ea22){var _0x4f803c={'raw':!![],'where':{'id':_0x568f6b[_0x79b6('0x46')]['id']}},_0x4ba212={};_0x4ba212[_0x79b6('0x30')]=_[_0x79b6('0x31')](db[_0x79b6('0x2b')][_0x79b6('0x2c')]);_0x4ba212[_0x79b6('0x32')]=_[_0x79b6('0x31')](_0x568f6b[_0x79b6('0x32')]);_0x4ba212['filters']=_[_0x79b6('0x35')](_0x4ba212['model'],_0x4ba212['query']);_0x4f803c[_0x79b6('0x34')]=_[_0x79b6('0x35')](_0x4ba212[_0x79b6('0x30')],qs[_0x79b6('0x36')](_0x568f6b[_0x79b6('0x32')][_0x79b6('0x36')]));_0x4f803c[_0x79b6('0x34')]=_0x4f803c[_0x79b6('0x34')][_0x79b6('0x47')]?_0x4f803c['attributes']:_0x4ba212[_0x79b6('0x30')];if(_0x568f6b[_0x79b6('0x32')][_0x79b6('0x40')]){_0x4f803c[_0x79b6('0x41')]=[{'all':!![]}];}_0x4f803c=_[_0x79b6('0x3e')]({},_0x4f803c,_0x568f6b['options']);return db[_0x79b6('0x2b')][_0x79b6('0x48')](_0x4f803c)['then'](handleEntityNotFound(_0x12ea22,null))['then'](respondWithResult(_0x12ea22,null))[_0x79b6('0x44')](handleError(_0x12ea22,null));};exports[_0x79b6('0x49')]=function(_0x247c79,_0xa0c396){return db[_0x79b6('0x2b')][_0x79b6('0x49')](_0x247c79[_0x79b6('0x4a')],{})[_0x79b6('0x25')](respondWithResult(_0xa0c396,0xc9))[_0x79b6('0x44')](handleError(_0xa0c396,null));};exports[_0x79b6('0x24')]=function(_0x15c795,_0x39972b){if(_0x15c795[_0x79b6('0x4a')]['id']){delete _0x15c795[_0x79b6('0x4a')]['id'];}return db[_0x79b6('0x2b')][_0x79b6('0x48')]({'where':{'id':_0x15c795[_0x79b6('0x46')]['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x39972b,null))[_0x79b6('0x25')](saveUpdates(_0x15c795['body'],null))['then'](respondWithResult(_0x39972b,null))['catch'](handleError(_0x39972b,null));};exports['destroy']=function(_0x56deb2,_0x412c1e){return db[_0x79b6('0x2b')][_0x79b6('0x48')]({'where':{'id':_0x56deb2[_0x79b6('0x46')]['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x412c1e,null))[_0x79b6('0x25')](removeEntity(_0x412c1e,null))['catch'](handleError(_0x412c1e,null));};exports[_0x79b6('0x4b')]=function(_0xa2ba0e,_0x58232b){return db[_0x79b6('0x2b')]['describe']()[_0x79b6('0x25')](respondWithResult(_0x58232b,null))['catch'](handleError(_0x58232b,null));}; \ No newline at end of file +var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x5292,0xf7));var _0x2529=function(_0x4b23b0,_0xf3d9b4){_0x4b23b0=_0x4b23b0-0x0;var _0x1440d7=_0x5292[_0x4b23b0];return _0x1440d7;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 4b50c20..caa8d5b 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2289f9,_0x6bef86){var _0x6514aa=function(_0x57210b){while(--_0x57210b){_0x2289f9['push'](_0x2289f9['shift']());}};_0x6514aa(++_0x6bef86);}(_0x7a54,0x106));var _0x47a5=function(_0x7f89d4,_0x22bcdf){_0x7f89d4=_0x7f89d4-0x0;var _0x581da3=_0x7a54[_0x7f89d4];return _0x581da3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2cd08a,_0x541694){var _0x5bfd5c=function(_0x1becdf){while(--_0x1becdf){_0x2cd08a['push'](_0x2cd08a['shift']());}};_0x5bfd5c(++_0x541694);}(_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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index e60c381..46bb02e 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd96=['stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x259d09,_0xbe1403){var _0x205ca8=function(_0x6286aa){while(--_0x6286aa){_0x259d09['push'](_0x259d09['shift']());}};_0x205ca8(++_0xbe1403);}(_0xdd96,0x16e));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6dd9('0x0'));var util=require('util');var moment=require(_0x6dd9('0x1'));var BPromise=require(_0x6dd9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dd9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6dd9('0x4'));var logger=require(_0x6dd9('0x5'))('rpc');var config=require(_0x6dd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6dd9('0x7')][_0x6dd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33e6cf,_0x4c22c1,_0x1b1115){return new BPromise(function(_0x2adfc2,_0x2863f5){return client[_0x6dd9('0x9')](_0x33e6cf,_0x1b1115)[_0x6dd9('0xa')](function(_0x16ecdc){logger[_0x6dd9('0xb')](_0x6dd9('0xc'),_0x4c22c1,_0x6dd9('0xd'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x4c22c1,_0x6dd9('0xd'),JSON[_0x6dd9('0xe')](_0x16ecdc));if(_0x16ecdc[_0x6dd9('0xf')]){if(_0x16ecdc[_0x6dd9('0xf')][_0x6dd9('0x10')]===0x1f4){logger[_0x6dd9('0xf')](_0x6dd9('0xc'),_0x4c22c1,_0x16ecdc[_0x6dd9('0xf')]['message']);return _0x2863f5(_0x16ecdc[_0x6dd9('0xf')][_0x6dd9('0x11')]);}logger[_0x6dd9('0xf')](_0x6dd9('0xc'),_0x4c22c1,_0x16ecdc['error'][_0x6dd9('0x11')]);return _0x2adfc2(_0x16ecdc[_0x6dd9('0xf')]['message']);}else{logger[_0x6dd9('0xb')](_0x6dd9('0xc'),_0x4c22c1,_0x6dd9('0xd'));_0x2adfc2(_0x16ecdc['result'][_0x6dd9('0x11')]);}})[_0x6dd9('0x12')](function(_0x2a72a){logger[_0x6dd9('0xf')](_0x6dd9('0xc'),_0x4c22c1,_0x2a72a);_0x2863f5(_0x2a72a);});});} \ No newline at end of file +var _0x5a7b=['client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x5a7b,0x19b));var _0xb5a7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a7b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xb5a7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5a7('0x1'));var fs=require('fs');var Redis=require(_0xb5a7('0x2'));var db=require(_0xb5a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5a7('0x4'))('rpc');var config=require(_0xb5a7('0x5'));var jayson=require(_0xb5a7('0x6'));var client=jayson[_0xb5a7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe483a1,_0x17824f,_0x580473){return new BPromise(function(_0x25b14c,_0x16510b){return client[_0xb5a7('0x8')](_0xe483a1,_0x580473)[_0xb5a7('0x9')](function(_0x3fdd44){logger[_0xb5a7('0xa')](_0xb5a7('0xb'),_0x17824f,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x17824f,_0xb5a7('0xc'),JSON[_0xb5a7('0xd')](_0x3fdd44));if(_0x3fdd44[_0xb5a7('0xe')]){if(_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0xf')]===0x1f4){logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);return _0x16510b(_0x3fdd44[_0xb5a7('0xe')]['message']);}logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);return _0x25b14c(_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);}else{logger[_0xb5a7('0xa')]('Cdr,\x20%s,\x20%s',_0x17824f,_0xb5a7('0xc'));_0x25b14c(_0x3fdd44[_0xb5a7('0x11')]['message']);}})[_0xb5a7('0x12')](function(_0x117949){logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x117949);_0x16510b(_0x117949);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 22960ba..7d523c7 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x246426,_0x505c21){var _0x320fcf=function(_0x5f50dc){while(--_0x5f50dc){_0x246426['push'](_0x246426['shift']());}};_0x320fcf(++_0x505c21);}(_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(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 018627b..affdb73 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa89=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x189134,_0x3e6d13){var _0x282983=function(_0x43ab29){while(--_0x43ab29){_0x189134['push'](_0x189134['shift']());}};_0x282983(++_0x3e6d13);}(_0xfa89,0xa9));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9fa8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9fa8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9fa8('0x2')],'allowNull':![],'defaultValue':_0x9fa8('0x3')},'appdata':{'type':Sequelize[_0x9fa8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9fa8('0x5')}}; \ No newline at end of file +var _0x2363=['STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2363,0xdb));var _0x3236=function(_0x5d7e1b,_0x338596){_0x5d7e1b=_0x5d7e1b-0x0;var _0x35b11e=_0x2363[_0x5d7e1b];return _0x35b11e;};'use strict';var Sequelize=require(_0x3236('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3236('0x1')],'allowNull':![],'defaultValue':_0x3236('0x2')},'appdata':{'type':Sequelize[_0x3236('0x3')]()},'description':{'type':Sequelize[_0x3236('0x1')]},'interval':{'type':Sequelize[_0x3236('0x1')],'defaultValue':_0x3236('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 298131d..4cb700e 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['name','status','send','show','params','keys','ChatApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x51c287,_0x4f9382){var _0x25ed09=function(_0x3ae048){while(--_0x3ae048){_0x51c287['push'](_0x51c287['shift']());}};_0x25ed09(++_0x4f9382);}(_0xb43b,0x1b2));var _0xbb43=function(_0x503804,_0x17d0ec){_0x503804=_0x503804-0x0;var _0x358787=_0xb43b[_0x503804];return _0x358787;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['ChatApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file +var _0x3451=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis'];(function(_0x236691,_0x14a3e6){var _0x591821=function(_0x47f032){while(--_0x47f032){_0x236691['push'](_0x236691['shift']());}};_0x591821(++_0x14a3e6);}(_0x3451,0x19a));var _0x1345=function(_0x45bd8a,_0x4fd0e5){_0x45bd8a=_0x45bd8a-0x0;var _0x10f1a9=_0x3451[_0x45bd8a];return _0x10f1a9;};'use strict';var emlformat=require(_0x1345('0x0'));var rimraf=require(_0x1345('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1345('0x2'));var rp=require(_0x1345('0x3'));var moment=require(_0x1345('0x4'));var BPromise=require(_0x1345('0x5'));var Mustache=require(_0x1345('0x6'));var util=require(_0x1345('0x7'));var path=require(_0x1345('0x8'));var sox=require(_0x1345('0x9'));var csv=require(_0x1345('0xa'));var ejs=require(_0x1345('0xb'));var fs=require('fs');var fs_extra=require(_0x1345('0xc'));var _=require(_0x1345('0xd'));var squel=require('squel');var crypto=require(_0x1345('0xe'));var jsforce=require(_0x1345('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1345('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1345('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1345('0x11'));var as=require(_0x1345('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1345('0x13'));var utils=require('../../config/utils');var config=require(_0x1345('0x14'));var licenseUtil=require(_0x1345('0x15'));var db=require(_0x1345('0x16'))['db'];function respondWithStatusCode(_0x3e1362,_0x528692){_0x528692=_0x528692||0xcc;return function(_0x3fdff0){if(_0x3fdff0){return _0x3e1362[_0x1345('0x17')](_0x528692);}return _0x3e1362[_0x1345('0x18')](_0x528692)[_0x1345('0x19')]();};}function respondWithResult(_0x4ea08a,_0x181a2b){_0x181a2b=_0x181a2b||0xc8;return function(_0x426e00){if(_0x426e00){return _0x4ea08a[_0x1345('0x18')](_0x181a2b)[_0x1345('0x1a')](_0x426e00);}};}function respondWithFilteredResult(_0x347591,_0x959544){return function(_0x3cd49e){if(_0x3cd49e){var _0x520e6c=typeof _0x959544[_0x1345('0x1b')]===_0x1345('0x1c')&&typeof _0x959544[_0x1345('0x1d')]==='undefined';var _0x5b4d04=_0x3cd49e[_0x1345('0x1e')];var _0x1afc89=_0x520e6c?0x0:_0x959544[_0x1345('0x1b')];var _0x1db636=_0x520e6c?_0x3cd49e['count']:_0x959544[_0x1345('0x1b')]+_0x959544[_0x1345('0x1d')];var _0x1f3746;if(_0x1db636>=_0x5b4d04){_0x1db636=_0x5b4d04;_0x1f3746=0xc8;}else{_0x1f3746=0xce;}_0x347591[_0x1345('0x18')](_0x1f3746);return _0x347591[_0x1345('0x1f')](_0x1345('0x20'),_0x1afc89+'-'+_0x1db636+'/'+_0x5b4d04)[_0x1345('0x1a')](_0x3cd49e);}return null;};}function patchUpdates(_0x43d209){return function(_0x3bc681){try{jsonpatch[_0x1345('0x21')](_0x3bc681,_0x43d209,!![]);}catch(_0x265ea8){return BPromise['reject'](_0x265ea8);}return _0x3bc681[_0x1345('0x22')]();};}function saveUpdates(_0x4855d7,_0xaf6ecc){return function(_0x217712){if(_0x217712){return _0x217712[_0x1345('0x23')](_0x4855d7)[_0x1345('0x24')](function(_0x422dd9){return _0x422dd9;});}return null;};}function removeEntity(_0x2fd7ca,_0x26c2a6){return function(_0x339ea9){if(_0x339ea9){return _0x339ea9[_0x1345('0x25')]()[_0x1345('0x24')](function(){_0x2fd7ca[_0x1345('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346054,_0x4a390c){return function(_0xd08b03){if(!_0xd08b03){_0x346054[_0x1345('0x17')](0x194);}return _0xd08b03;};}function handleError(_0x11827a,_0x32f9a3){_0x32f9a3=_0x32f9a3||0x1f4;return function(_0x44aa74){logger[_0x1345('0x26')](_0x44aa74[_0x1345('0x27')]);if(_0x44aa74[_0x1345('0x28')]){delete _0x44aa74[_0x1345('0x28')];}_0x11827a[_0x1345('0x18')](_0x32f9a3)[_0x1345('0x29')](_0x44aa74);};}exports[_0x1345('0x2a')]=function(_0x483e75,_0x3ffbdc){var _0x50533b={'raw':!![],'where':{'id':_0x483e75[_0x1345('0x2b')]['id']}},_0x5ac56d={};_0x5ac56d[_0x1345('0x2c')]=_[_0x1345('0x2d')](db[_0x1345('0x2e')][_0x1345('0x2f')]);_0x5ac56d['query']=_[_0x1345('0x2d')](_0x483e75[_0x1345('0x30')]);_0x5ac56d[_0x1345('0x31')]=_['intersection'](_0x5ac56d[_0x1345('0x2c')],_0x5ac56d['query']);_0x50533b['attributes']=_[_0x1345('0x32')](_0x5ac56d[_0x1345('0x2c')],qs[_0x1345('0x33')](_0x483e75[_0x1345('0x30')]['fields']));_0x50533b[_0x1345('0x34')]=_0x50533b[_0x1345('0x34')][_0x1345('0x35')]?_0x50533b[_0x1345('0x34')]:_0x5ac56d[_0x1345('0x2c')];if(_0x483e75[_0x1345('0x30')][_0x1345('0x36')]){_0x50533b[_0x1345('0x37')]=[{'all':!![]}];}_0x50533b=_[_0x1345('0x38')]({},_0x50533b,_0x483e75[_0x1345('0x39')]);return db[_0x1345('0x2e')]['find'](_0x50533b)[_0x1345('0x24')](handleEntityNotFound(_0x3ffbdc,null))[_0x1345('0x24')](respondWithResult(_0x3ffbdc,null))[_0x1345('0x3a')](handleError(_0x3ffbdc,null));};exports[_0x1345('0x23')]=function(_0xdff44a,_0x4c0890){if(_0xdff44a[_0x1345('0x3b')]['id']){delete _0xdff44a['body']['id'];}return db['ChatApplication'][_0x1345('0x3c')]({'where':{'id':_0xdff44a[_0x1345('0x2b')]['id']}})[_0x1345('0x24')](handleEntityNotFound(_0x4c0890,null))['then'](saveUpdates(_0xdff44a[_0x1345('0x3b')],null))[_0x1345('0x24')](respondWithResult(_0x4c0890,null))[_0x1345('0x3a')](handleError(_0x4c0890,null));};exports[_0x1345('0x25')]=function(_0x3cf188,_0x358e97){return db[_0x1345('0x2e')]['find']({'where':{'id':_0x3cf188['params']['id']}})['then'](handleEntityNotFound(_0x358e97,null))['then'](removeEntity(_0x358e97,null))['catch'](handleError(_0x358e97,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 1a89f94..7d28ce9 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabca=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','lodash'];(function(_0x3cc6f3,_0x470176){var _0x2f7115=function(_0x4b687c){while(--_0x4b687c){_0x3cc6f3['push'](_0x3cc6f3['shift']());}};_0x2f7115(++_0x470176);}(_0xabca,0x1af));var _0xaabc=function(_0xf0c8af,_0x4ceef4){_0xf0c8af=_0xf0c8af-0x0;var _0x2ceabf=_0xabca[_0xf0c8af];return _0x2ceabf;};'use strict';var _=require(_0xaabc('0x0'));var util=require(_0xaabc('0x1'));var logger=require('../../config/logger')(_0xaabc('0x2'));var moment=require(_0xaabc('0x3'));var BPromise=require(_0xaabc('0x4'));var rp=require(_0xaabc('0x5'));var fs=require('fs');var path=require(_0xaabc('0x6'));var rimraf=require(_0xaabc('0x7'));var config=require(_0xaabc('0x8'));var attributes=require(_0xaabc('0x9'));module[_0xaabc('0xa')]=function(_0x4bd5f6,_0x22cc90){return _0x4bd5f6['define'](_0xaabc('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x193f=['ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatApplication.attributes','exports','define'];(function(_0x2b6fb8,_0x32dde8){var _0x1e0bfa=function(_0x24db53){while(--_0x24db53){_0x2b6fb8['push'](_0x2b6fb8['shift']());}};_0x1e0bfa(++_0x32dde8);}(_0x193f,0x9f));var _0xf193=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x193f[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xf193('0x0'));var util=require(_0xf193('0x1'));var logger=require(_0xf193('0x2'))(_0xf193('0x3'));var moment=require('moment');var BPromise=require(_0xf193('0x4'));var rp=require(_0xf193('0x5'));var fs=require('fs');var path=require(_0xf193('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf193('0x7'));module[_0xf193('0x8')]=function(_0x453dd9,_0x11133d){return _0x453dd9[_0xf193('0x9')](_0xf193('0xa'),attributes,{'tableName':_0xf193('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf193('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 0794b99..db93bf8 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4ee=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3efc43,_0x1d1c91){var _0x3ddfbd=function(_0x54b175){while(--_0x54b175){_0x3efc43['push'](_0x3efc43['shift']());}};_0x3ddfbd(++_0x1d1c91);}(_0xa4ee,0x84));var _0xea4e=function(_0x4c1f1f,_0x3aa18d){_0x4c1f1f=_0x4c1f1f-0x0;var _0x4f9e3c=_0xa4ee[_0x4c1f1f];return _0x4f9e3c;};'use strict';var _=require(_0xea4e('0x0'));var util=require(_0xea4e('0x1'));var moment=require(_0xea4e('0x2'));var BPromise=require(_0xea4e('0x3'));var rs=require(_0xea4e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea4e('0x5'))['db'];var utils=require(_0xea4e('0x6'));var logger=require('../../config/logger')(_0xea4e('0x7'));var config=require(_0xea4e('0x8'));var jayson=require(_0xea4e('0x9'));var client=jayson[_0xea4e('0xa')][_0xea4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd811,_0x1ff28a,_0x5f2b74){return new BPromise(function(_0x40006d,_0x2d4543){return client[_0xea4e('0xc')](_0x5bd811,_0x5f2b74)[_0xea4e('0xd')](function(_0x1ee7ad){logger['info'](_0xea4e('0xe'),_0x1ff28a,_0xea4e('0xf'));logger[_0xea4e('0x10')](_0xea4e('0x11'),_0x1ff28a,_0xea4e('0xf'),JSON[_0xea4e('0x12')](_0x1ee7ad));if(_0x1ee7ad[_0xea4e('0x13')]){if(_0x1ee7ad[_0xea4e('0x13')]['code']===0x1f4){logger[_0xea4e('0x13')](_0xea4e('0xe'),_0x1ff28a,_0x1ee7ad[_0xea4e('0x13')]['message']);return _0x2d4543(_0x1ee7ad[_0xea4e('0x13')][_0xea4e('0x14')]);}logger[_0xea4e('0x13')](_0xea4e('0xe'),_0x1ff28a,_0x1ee7ad[_0xea4e('0x13')][_0xea4e('0x14')]);return _0x40006d(_0x1ee7ad[_0xea4e('0x13')][_0xea4e('0x14')]);}else{logger[_0xea4e('0x15')](_0xea4e('0xe'),_0x1ff28a,_0xea4e('0xf'));_0x40006d(_0x1ee7ad[_0xea4e('0x16')]['message']);}})['catch'](function(_0x11cd8a){logger['error'](_0xea4e('0xe'),_0x1ff28a,_0x11cd8a);_0x2d4543(_0x11cd8a);});});} \ No newline at end of file +var _0x5e3f=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','http','request','then'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0x5e3f,0x8e));var _0xf5e3=function(_0x1b027d,_0x3f3822){_0x1b027d=_0x1b027d-0x0;var _0x41f54a=_0x5e3f[_0x1b027d];return _0x41f54a;};'use strict';var _=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var moment=require(_0xf5e3('0x2'));var BPromise=require(_0xf5e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5e3('0x4'));var db=require(_0xf5e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf5e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb1f50a,_0x36c42a,_0xc9ce0){return new BPromise(function(_0x864b7f,_0x3ef200){return client[_0xf5e3('0x8')](_0xb1f50a,_0xc9ce0)[_0xf5e3('0x9')](function(_0x54ebfe){logger[_0xf5e3('0xa')](_0xf5e3('0xb'),_0x36c42a,_0xf5e3('0xc'));logger['debug'](_0xf5e3('0xd'),_0x36c42a,_0xf5e3('0xc'),JSON[_0xf5e3('0xe')](_0x54ebfe));if(_0x54ebfe['error']){if(_0x54ebfe['error'][_0xf5e3('0xf')]===0x1f4){logger['error'](_0xf5e3('0xb'),_0x36c42a,_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);return _0x3ef200(_0x54ebfe['error']['message']);}logger['error'](_0xf5e3('0xb'),_0x36c42a,_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);return _0x864b7f(_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);}else{logger['info'](_0xf5e3('0xb'),_0x36c42a,_0xf5e3('0xc'));_0x864b7f(_0x54ebfe['result'][_0xf5e3('0x11')]);}})[_0xf5e3('0x12')](function(_0x3a3dcc){logger[_0xf5e3('0x10')](_0xf5e3('0xb'),_0x36c42a,_0x3a3dcc);_0x3ef200(_0x3a3dcc);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index d355964..abd5c81 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f9e=['./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment'];(function(_0x350b3f,_0x38b101){var _0x24a447=function(_0x72ca6){while(--_0x72ca6){_0x350b3f['push'](_0x350b3f['shift']());}};_0x24a447(++_0x38b101);}(_0x2f9e,0xbe));var _0xe2f9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2f9e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe2f9('0x0'));var util=require(_0xe2f9('0x1'));var path=require(_0xe2f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe2f9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe2f9('0x4'));var config=require(_0xe2f9('0x5'));var controller=require(_0xe2f9('0x6'));router['get'](_0xe2f9('0x7'),auth[_0xe2f9('0x8')](),controller[_0xe2f9('0x9')]);router[_0xe2f9('0xa')]('/:id',auth[_0xe2f9('0x8')](),controller[_0xe2f9('0xb')]);router[_0xe2f9('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xe2f9('0xd')]);module['exports']=router; \ No newline at end of file +var _0xea67=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x20ed10,_0x2d62b3){var _0x5dfa78=function(_0x28d2e8){while(--_0x28d2e8){_0x20ed10['push'](_0x20ed10['shift']());}};_0x5dfa78(++_0x2d62b3);}(_0xea67,0x133));var _0x7ea6=function(_0x56e813,_0x2f7fe0){_0x56e813=_0x56e813-0x0;var _0x2ae2a4=_0xea67[_0x56e813];return _0x2ae2a4;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require(_0x7ea6('0x4'));var router=express['Router']();var fs_extra=require(_0x7ea6('0x5'));var auth=require(_0x7ea6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ea6('0x7'));var controller=require(_0x7ea6('0x8'));router[_0x7ea6('0x9')]('/:id',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xb')]);router[_0x7ea6('0xc')](_0x7ea6('0xd'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xe')]);router[_0x7ea6('0xf')](_0x7ea6('0xd'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x10')]);module[_0x7ea6('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index d37b2e4..1ffb2d7 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc7c=['STRING','BOOLEAN','sequelize'];(function(_0x2bcf2a,_0x534b7f){var _0x2907cb=function(_0x1e36d8){while(--_0x1e36d8){_0x2bcf2a['push'](_0x2bcf2a['shift']());}};_0x2907cb(++_0x534b7f);}(_0xdc7c,0xf2));var _0xcdc7=function(_0x57b2f4,_0x52046a){_0x57b2f4=_0x57b2f4-0x0;var _0xa8d0c0=_0xdc7c[_0x57b2f4];return _0xa8d0c0;};'use strict';var Sequelize=require(_0xcdc7('0x0'));module['exports']={'name':{'type':Sequelize[_0xcdc7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcdc7('0x1')]},'write':{'type':Sequelize[_0xcdc7('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x14c5=['STRING','BOOLEAN','sequelize','exports'];(function(_0x46a6f4,_0x86f0a5){var _0x3ad8f7=function(_0x2fabd2){while(--_0x2fabd2){_0x46a6f4['push'](_0x46a6f4['shift']());}};_0x3ad8f7(++_0x86f0a5);}(_0x14c5,0x1de));var _0x514c=function(_0x33556a,_0x1a5894){_0x33556a=_0x33556a-0x0;var _0x5f3384=_0x14c5[_0x33556a];return _0x5f3384;};'use strict';var Sequelize=require(_0x514c('0x0'));module[_0x514c('0x1')]={'name':{'type':Sequelize[_0x514c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x514c('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index fa685f7..4bf2f2e 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6189=['count','set','apply','then','error','stack','name','index','map','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','catch','body','find','params','destroy','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','ChatInternalMessage','create','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x19ab90,_0x23773c){var _0x45b682=function(_0x21ae73){while(--_0x21ae73){_0x19ab90['push'](_0x19ab90['shift']());}};_0x45b682(++_0x23773c);}(_0x6189,0xec));var _0x9618=function(_0x15c59a,_0x3e1c89){_0x15c59a=_0x15c59a-0x0;var _0x5e8b4e=_0x6189[_0x15c59a];return _0x5e8b4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9618('0x0'));var zipdir=require(_0x9618('0x1'));var jsonpatch=require(_0x9618('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9618('0x3'));var Mustache=require('mustache');var util=require(_0x9618('0x4'));var path=require(_0x9618('0x5'));var sox=require(_0x9618('0x6'));var csv=require(_0x9618('0x7'));var ejs=require(_0x9618('0x8'));var fs=require('fs');var fs_extra=require(_0x9618('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9618('0xa'));var jsforce=require(_0x9618('0xb'));var deskjs=require(_0x9618('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9618('0xd'));var Redis=require(_0x9618('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9618('0xf'));var as=require(_0x9618('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9618('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x9618('0x12'));var db=require(_0x9618('0x13'))['db'];config[_0x9618('0x14')]=_['defaults'](config['redis'],{'host':_0x9618('0x15'),'port':0x18eb});var socket=require(_0x9618('0x16'))(new Redis(config[_0x9618('0x14')]));require(_0x9618('0x17'))['register'](socket);function respondWithStatusCode(_0x53076e,_0x13d99e){_0x13d99e=_0x13d99e||0xcc;return function(_0x5a9a70){if(_0x5a9a70){return _0x53076e[_0x9618('0x18')](_0x13d99e);}return _0x53076e[_0x9618('0x19')](_0x13d99e)[_0x9618('0x1a')]();};}function respondWithResult(_0x13644c,_0x13a20b){_0x13a20b=_0x13a20b||0xc8;return function(_0xcfdc61){if(_0xcfdc61){return _0x13644c[_0x9618('0x19')](_0x13a20b)[_0x9618('0x1b')](_0xcfdc61);}};}function respondWithFilteredResult(_0x5cfbd8,_0xa607a1){return function(_0x314f2f){if(_0x314f2f){var _0x29b2f1=typeof _0xa607a1[_0x9618('0x1c')]===_0x9618('0x1d')&&typeof _0xa607a1[_0x9618('0x1e')]===_0x9618('0x1d');var _0x4bf6a1=_0x314f2f[_0x9618('0x1f')];var _0x1a1996=_0x29b2f1?0x0:_0xa607a1[_0x9618('0x1c')];var _0x2aac8c=_0x29b2f1?_0x314f2f[_0x9618('0x1f')]:_0xa607a1[_0x9618('0x1c')]+_0xa607a1[_0x9618('0x1e')];var _0x5c0f6b;if(_0x2aac8c>=_0x4bf6a1){_0x2aac8c=_0x4bf6a1;_0x5c0f6b=0xc8;}else{_0x5c0f6b=0xce;}_0x5cfbd8['status'](_0x5c0f6b);return _0x5cfbd8[_0x9618('0x20')]('Content-Range',_0x1a1996+'-'+_0x2aac8c+'/'+_0x4bf6a1)[_0x9618('0x1b')](_0x314f2f);}return null;};}function patchUpdates(_0x2d48f6){return function(_0x2653eb){try{jsonpatch[_0x9618('0x21')](_0x2653eb,_0x2d48f6,!![]);}catch(_0x4ce153){return BPromise['reject'](_0x4ce153);}return _0x2653eb['save']();};}function saveUpdates(_0x348c3a,_0x4c0bfc){return function(_0x2cfbbc){if(_0x2cfbbc){return _0x2cfbbc['update'](_0x348c3a)[_0x9618('0x22')](function(_0x56c52f){return _0x56c52f;});}return null;};}function removeEntity(_0x201cca,_0x5e3d56){return function(_0x4b41a2){if(_0x4b41a2){return _0x4b41a2['destroy']()[_0x9618('0x22')](function(){_0x201cca[_0x9618('0x19')](0xcc)[_0x9618('0x1a')]();});}};}function handleEntityNotFound(_0x13f1b2,_0x335bf7){return function(_0x1d5cbc){if(!_0x1d5cbc){_0x13f1b2[_0x9618('0x18')](0x194);}return _0x1d5cbc;};}function handleError(_0x4b5a8b,_0x238e4a){_0x238e4a=_0x238e4a||0x1f4;return function(_0x8b1ef4){logger[_0x9618('0x23')](_0x8b1ef4[_0x9618('0x24')]);if(_0x8b1ef4[_0x9618('0x25')]){delete _0x8b1ef4[_0x9618('0x25')];}_0x4b5a8b[_0x9618('0x19')](_0x238e4a)['send'](_0x8b1ef4);};}exports[_0x9618('0x26')]=function(_0x405331,_0x793f7e){var _0x14779c={},_0x5c9257={},_0x4d25f6={'count':0x0,'rows':[]};var _0x474caf=_[_0x9618('0x27')](db[_0x9618('0x28')][_0x9618('0x29')],function(_0x4e57f1){return{'name':_0x4e57f1['fieldName'],'type':_0x4e57f1[_0x9618('0x2a')]['key']};});_0x5c9257[_0x9618('0x2b')]=_[_0x9618('0x27')](_0x474caf,_0x9618('0x25'));_0x5c9257[_0x9618('0x2c')]=_[_0x9618('0x2d')](_0x405331[_0x9618('0x2c')]);_0x5c9257[_0x9618('0x2e')]=_[_0x9618('0x2f')](_0x5c9257[_0x9618('0x2b')],_0x5c9257['query']);_0x14779c[_0x9618('0x30')]=_[_0x9618('0x2f')](_0x5c9257['model'],qs[_0x9618('0x31')](_0x405331[_0x9618('0x2c')]['fields']));_0x14779c['attributes']=_0x14779c['attributes'][_0x9618('0x32')]?_0x14779c[_0x9618('0x30')]:_0x5c9257[_0x9618('0x2b')];if(!_0x405331[_0x9618('0x2c')][_0x9618('0x33')](_0x9618('0x34'))){_0x14779c[_0x9618('0x1e')]=qs['limit'](_0x405331[_0x9618('0x2c')][_0x9618('0x1e')]);_0x14779c[_0x9618('0x1c')]=qs['offset'](_0x405331['query'][_0x9618('0x1c')]);}_0x14779c[_0x9618('0x35')]=qs[_0x9618('0x36')](_0x405331['query'][_0x9618('0x36')]);_0x14779c[_0x9618('0x37')]=qs['filters'](_[_0x9618('0x38')](_0x405331[_0x9618('0x2c')],_0x5c9257[_0x9618('0x2e')]),_0x474caf);if(_0x405331[_0x9618('0x2c')][_0x9618('0x39')]){_0x14779c[_0x9618('0x37')]=_['merge'](_0x14779c['where'],{'$or':_[_0x9618('0x27')](_0x474caf,function(_0x1536c2){if(_0x1536c2[_0x9618('0x2a')]!==_0x9618('0x3a')){var _0x355d93={};_0x355d93[_0x1536c2[_0x9618('0x25')]]={'$like':'%'+_0x405331['query'][_0x9618('0x39')]+'%'};return _0x355d93;}})});}_0x14779c=_[_0x9618('0x3b')]({},_0x14779c,_0x405331[_0x9618('0x3c')]);var _0x38b307={'where':_0x14779c[_0x9618('0x37')]};return db[_0x9618('0x28')][_0x9618('0x1f')](_0x38b307)[_0x9618('0x22')](function(_0x4b7c87){_0x4d25f6[_0x9618('0x1f')]=_0x4b7c87;if(_0x405331[_0x9618('0x2c')][_0x9618('0x3d')]){_0x14779c[_0x9618('0x3e')]=[{'all':!![]}];}return db[_0x9618('0x28')][_0x9618('0x3f')](_0x14779c);})[_0x9618('0x22')](function(_0x33ddd4){_0x4d25f6[_0x9618('0x40')]=_0x33ddd4;return _0x4d25f6;})[_0x9618('0x22')](respondWithFilteredResult(_0x793f7e,_0x14779c))['catch'](handleError(_0x793f7e,null));};exports[_0x9618('0x41')]=function(_0x324aa2,_0x4766ca){var _0x573377={'raw':!![],'where':{'id':_0x324aa2['params']['id']}},_0x2cc6c1={};_0x2cc6c1['model']=_['keys'](db['ChatGroup'][_0x9618('0x29')]);_0x2cc6c1[_0x9618('0x2c')]=_[_0x9618('0x2d')](_0x324aa2[_0x9618('0x2c')]);_0x2cc6c1['filters']=_['intersection'](_0x2cc6c1[_0x9618('0x2b')],_0x2cc6c1['query']);_0x573377[_0x9618('0x30')]=_[_0x9618('0x2f')](_0x2cc6c1['model'],qs['fields'](_0x324aa2[_0x9618('0x2c')][_0x9618('0x31')]));_0x573377[_0x9618('0x30')]=_0x573377[_0x9618('0x30')]['length']?_0x573377['attributes']:_0x2cc6c1[_0x9618('0x2b')];if(_0x324aa2[_0x9618('0x2c')][_0x9618('0x3d')]){_0x573377[_0x9618('0x3e')]=[{'all':!![]}];}_0x573377=_[_0x9618('0x3b')]({},_0x573377,_0x324aa2[_0x9618('0x3c')]);return db[_0x9618('0x28')]['find'](_0x573377)[_0x9618('0x22')](handleEntityNotFound(_0x4766ca,null))[_0x9618('0x22')](respondWithResult(_0x4766ca,null))[_0x9618('0x42')](handleError(_0x4766ca,null));};exports['create']=function(_0x55c67f,_0x22dc95){return db[_0x9618('0x28')]['create'](_0x55c67f['body'],{})['then'](respondWithResult(_0x22dc95,0xc9))[_0x9618('0x42')](handleError(_0x22dc95,null));};exports['update']=function(_0x3beef6,_0x2cec85){if(_0x3beef6['body']['id']){delete _0x3beef6[_0x9618('0x43')]['id'];}return db['ChatGroup'][_0x9618('0x44')]({'where':{'id':_0x3beef6[_0x9618('0x45')]['id']}})[_0x9618('0x22')](handleEntityNotFound(_0x2cec85,null))['then'](saveUpdates(_0x3beef6[_0x9618('0x43')],null))['then'](respondWithResult(_0x2cec85,null))[_0x9618('0x42')](handleError(_0x2cec85,null));};exports[_0x9618('0x46')]=function(_0x22812b,_0x8c3277){return db[_0x9618('0x28')]['find']({'where':{'id':_0x22812b[_0x9618('0x45')]['id']}})['then'](handleEntityNotFound(_0x8c3277,null))['then'](removeEntity(_0x8c3277,null))[_0x9618('0x42')](handleError(_0x8c3277,null));};exports['describe']=function(_0x3e5d6f,_0x1feb26){return db[_0x9618('0x28')]['describe']()[_0x9618('0x22')](respondWithResult(_0x1feb26,null))['catch'](handleError(_0x1feb26,null));};exports[_0x9618('0x47')]=function(_0x15b794,_0x451c73,_0x29ef86){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x15b794['params']['id'],'ToId':_0x15b794[_0x9618('0x48')]['id'],'read':![]}})[_0x9618('0x22')](function(_0x326b53){return{'id':_[_0x9618('0x49')](_0x15b794[_0x9618('0x45')]['id']),'count':_0x326b53};})[_0x9618('0x22')](respondWithResult(_0x451c73,null))['catch'](handleError(_0x451c73,null));};exports[_0x9618('0x4a')]=function(_0x5e3e24,_0x47acec,_0x20fa62){return db[_0x9618('0x28')]['find']({'where':{'id':_0x5e3e24['params']['id']}})['then'](handleEntityNotFound(_0x47acec,null))['then'](function(_0x6abe24){if(_0x6abe24){return _0x6abe24[_0x9618('0x4a')](_0x5e3e24[_0x9618('0x43')][_0x9618('0x4b')],_[_0x9618('0x4c')](_0x5e3e24[_0x9618('0x43')],[_0x9618('0x4b'),'id'])||{});}})[_0x9618('0x22')](respondWithResult(_0x47acec,null))[_0x9618('0x42')](handleError(_0x47acec,null));};exports[_0x9618('0x4d')]=function(_0x512d60,_0x4690ec,_0x57f077){var _0x3a440a={};var _0x1259e3={};var _0x497ec7;var _0xd6b7f;return db[_0x9618('0x28')][_0x9618('0x4e')]({'where':{'id':_0x512d60[_0x9618('0x45')]['id']}})['then'](handleEntityNotFound(_0x4690ec,null))[_0x9618('0x22')](function(_0x359569){if(_0x359569){_0x497ec7=_0x359569;_0x1259e3[_0x9618('0x2b')]=_[_0x9618('0x2d')](db[_0x9618('0x4f')][_0x9618('0x29')]);_0x1259e3[_0x9618('0x2c')]=_[_0x9618('0x2d')](_0x512d60[_0x9618('0x2c')]);_0x1259e3[_0x9618('0x2e')]=_[_0x9618('0x2f')](_0x1259e3['model'],_0x1259e3[_0x9618('0x2c')]);_0x3a440a[_0x9618('0x30')]=_[_0x9618('0x2f')](_0x1259e3[_0x9618('0x2b')],qs[_0x9618('0x31')](_0x512d60[_0x9618('0x2c')][_0x9618('0x31')]));_0x3a440a[_0x9618('0x30')]=_0x3a440a[_0x9618('0x30')][_0x9618('0x32')]?_0x3a440a[_0x9618('0x30')]:_0x1259e3[_0x9618('0x2b')];_0x3a440a[_0x9618('0x35')]=qs[_0x9618('0x36')](_0x512d60['query']['sort']);_0x3a440a['where']=qs['filters'](_[_0x9618('0x38')](_0x512d60[_0x9618('0x2c')],_0x1259e3[_0x9618('0x2e')]));if(_0x512d60[_0x9618('0x2c')]['filter']){_0x3a440a[_0x9618('0x37')]=_[_0x9618('0x3b')](_0x3a440a[_0x9618('0x37')],{'$or':_['map'](_0x3a440a[_0x9618('0x30')],function(_0x1eba63){var _0x280672={};_0x280672[_0x1eba63]={'$like':'%'+_0x512d60['query'][_0x9618('0x39')]+'%'};return _0x280672;})});}_0x3a440a=_[_0x9618('0x3b')]({},_0x3a440a,_0x512d60['options']);return _0x497ec7['getMembers'](_0x3a440a);}})['then'](function(_0x9b57d9){if(_0x9b57d9){_0xd6b7f=_0x9b57d9['length'];if(!_0x512d60[_0x9618('0x2c')]['hasOwnProperty'](_0x9618('0x34'))){_0x3a440a[_0x9618('0x1e')]=qs[_0x9618('0x1e')](_0x512d60[_0x9618('0x2c')]['limit']);_0x3a440a[_0x9618('0x1c')]=qs[_0x9618('0x1c')](_0x512d60['query']['offset']);}return _0x497ec7['getMembers'](_0x3a440a);}})[_0x9618('0x22')](function(_0x3e2108){if(_0x3e2108){return _0x3e2108?{'count':_0xd6b7f,'rows':_0x3e2108}:null;}})[_0x9618('0x22')](respondWithResult(_0x4690ec,null))[_0x9618('0x42')](handleError(_0x4690ec,null));};exports[_0x9618('0x50')]=function(_0x1068fd,_0x29d9c5,_0x2e89ca){return db[_0x9618('0x28')][_0x9618('0x44')]({'where':{'id':_0x1068fd[_0x9618('0x45')]['id']}})[_0x9618('0x22')](handleEntityNotFound(_0x29d9c5,null))[_0x9618('0x22')](function(_0x1f02b7){if(_0x1f02b7){return _0x1f02b7[_0x9618('0x50')](_0x1068fd['query'][_0x9618('0x4b')]);}})[_0x9618('0x22')](respondWithStatusCode(_0x29d9c5,null))[_0x9618('0x42')](handleError(_0x29d9c5,null));};exports['addMessage']=function(_0x45afa9,_0x3eff59,_0x21117e){if(_0x45afa9['body']['id']){delete _0x45afa9[_0x9618('0x43')]['id'];}return db[_0x9618('0x28')][_0x9618('0x44')]({'where':{'id':_0x45afa9[_0x9618('0x45')]['id']}})[_0x9618('0x22')](handleEntityNotFound(_0x3eff59,null))[_0x9618('0x22')](function(_0x3823e1){if(_0x3823e1){_0x45afa9[_0x9618('0x43')][_0x9618('0x51')]=_0x3823e1['id'];return db[_0x9618('0x52')][_0x9618('0x53')](_0x45afa9[_0x9618('0x43')]);}})[_0x9618('0x22')](respondWithResult(_0x3eff59,null))[_0x9618('0x42')](handleError(_0x3eff59,null));};exports[_0x9618('0x54')]=function(_0x3e398a,_0x19efdf,_0x21d94a){var _0x722a57={};var _0x2459db={};var _0x5461bc;var _0x3d515f;return db[_0x9618('0x28')][_0x9618('0x4e')]({'where':{'id':_0x3e398a[_0x9618('0x45')]['id']}})[_0x9618('0x22')](handleEntityNotFound(_0x19efdf,null))['then'](function(_0xabc8bb){if(_0xabc8bb){_0x5461bc=_0xabc8bb;_0x2459db[_0x9618('0x2b')]=_[_0x9618('0x2d')](db['ChatInternalMessage'][_0x9618('0x29')]);_0x2459db[_0x9618('0x2c')]=_[_0x9618('0x2d')](_0x3e398a[_0x9618('0x2c')]);_0x2459db[_0x9618('0x2e')]=_[_0x9618('0x2f')](_0x2459db[_0x9618('0x2b')],_0x2459db[_0x9618('0x2c')]);_0x722a57[_0x9618('0x30')]=_[_0x9618('0x2f')](_0x2459db[_0x9618('0x2b')],qs[_0x9618('0x31')](_0x3e398a[_0x9618('0x2c')][_0x9618('0x31')]));_0x722a57['attributes']=_0x722a57[_0x9618('0x30')][_0x9618('0x32')]?_0x722a57[_0x9618('0x30')]:_0x2459db[_0x9618('0x2b')];_0x722a57[_0x9618('0x35')]=qs['sort'](_0x3e398a[_0x9618('0x2c')]['sort']);_0x722a57['where']=qs[_0x9618('0x2e')](_[_0x9618('0x38')](_0x3e398a[_0x9618('0x2c')],_0x2459db[_0x9618('0x2e')]));if(_0x3e398a['query'][_0x9618('0x39')]){_0x722a57[_0x9618('0x37')]=_[_0x9618('0x3b')](_0x722a57[_0x9618('0x37')],{'$or':_[_0x9618('0x27')](_0x722a57[_0x9618('0x30')],function(_0x54badb){var _0xce00e1={};_0xce00e1[_0x54badb]={'$like':'%'+_0x3e398a['query']['filter']+'%'};return _0xce00e1;})});}if(_0x3e398a[_0x9618('0x2c')][_0x9618('0x55')]){var _0x328777=_0x3e398a[_0x9618('0x2c')][_0x9618('0x55')][_0x9618('0x56')](',');var _0x1ba786={};_0x1ba786[_0x328777[0x0]]={'$gte':moment(_0x328777[0x1])[_0x9618('0x57')](_0x9618('0x58'))};_0x722a57[_0x9618('0x37')]=_[_0x9618('0x3b')](_0x722a57[_0x9618('0x37')],_0x1ba786);}_0x722a57=_[_0x9618('0x3b')]({},_0x722a57,_0x3e398a[_0x9618('0x3c')]);return _0x5461bc['getMessages'](_0x722a57);}})[_0x9618('0x22')](function(_0x4a584b){if(_0x4a584b){_0x3d515f=_0x4a584b[_0x9618('0x32')];if(!_0x3e398a[_0x9618('0x2c')][_0x9618('0x33')](_0x9618('0x34'))){_0x722a57[_0x9618('0x1e')]=qs[_0x9618('0x1e')](_0x3e398a['query'][_0x9618('0x1e')]);_0x722a57[_0x9618('0x1c')]=qs['offset'](_0x3e398a[_0x9618('0x2c')][_0x9618('0x1c')]);}return _0x5461bc['getMessages'](_0x722a57);}})[_0x9618('0x22')](function(_0x53c653){if(_0x53c653){return _0x53c653?{'count':_0x3d515f,'rows':_0x53c653}:null;}})[_0x9618('0x22')](respondWithResult(_0x19efdf,null))[_0x9618('0x42')](handleError(_0x19efdf,null));}; \ No newline at end of file +var _0x95eb=['filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where'];(function(_0x3ddb52,_0x7790cf){var _0x378940=function(_0x49dbbb){while(--_0x49dbbb){_0x3ddb52['push'](_0x3ddb52['shift']());}};_0x378940(++_0x7790cf);}(_0x95eb,0xe7));var _0xb95e=function(_0x30764f,_0x548374){_0x30764f=_0x30764f-0x0;var _0x11d9f7=_0x95eb[_0x30764f];return _0x11d9f7;};'use strict';var emlformat=require(_0xb95e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb95e('0x1'));var rp=require(_0xb95e('0x2'));var moment=require('moment');var BPromise=require(_0xb95e('0x3'));var Mustache=require(_0xb95e('0x4'));var util=require(_0xb95e('0x5'));var path=require('path');var sox=require(_0xb95e('0x6'));var csv=require(_0xb95e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb95e('0x8'));var _=require(_0xb95e('0x9'));var squel=require(_0xb95e('0xa'));var crypto=require(_0xb95e('0xb'));var jsforce=require(_0xb95e('0xc'));var deskjs=require(_0xb95e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb95e('0xe'));var Papa=require(_0xb95e('0xf'));var Redis=require(_0xb95e('0x10'));var authService=require(_0xb95e('0x11'));var qs=require(_0xb95e('0x12'));var as=require(_0xb95e('0x13'));var hardwareService=require(_0xb95e('0x14'));var logger=require(_0xb95e('0x15'))('api');var utils=require(_0xb95e('0x16'));var config=require(_0xb95e('0x17'));var licenseUtil=require(_0xb95e('0x18'));var db=require(_0xb95e('0x19'))['db'];config[_0xb95e('0x1a')]=_[_0xb95e('0x1b')](config[_0xb95e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb95e('0x1c'))(new Redis(config[_0xb95e('0x1a')]));require('./chatGroup.socket')[_0xb95e('0x1d')](socket);function respondWithStatusCode(_0x4431d4,_0x4fbf5d){_0x4fbf5d=_0x4fbf5d||0xcc;return function(_0x42d963){if(_0x42d963){return _0x4431d4['sendStatus'](_0x4fbf5d);}return _0x4431d4[_0xb95e('0x1e')](_0x4fbf5d)[_0xb95e('0x1f')]();};}function respondWithResult(_0x3988e0,_0x2ec8b0){_0x2ec8b0=_0x2ec8b0||0xc8;return function(_0x5275c5){if(_0x5275c5){return _0x3988e0[_0xb95e('0x1e')](_0x2ec8b0)[_0xb95e('0x20')](_0x5275c5);}};}function respondWithFilteredResult(_0x5ea699,_0x5c9cec){return function(_0x16675d){if(_0x16675d){var _0x4d7b95=typeof _0x5c9cec[_0xb95e('0x21')]===_0xb95e('0x22')&&typeof _0x5c9cec['limit']===_0xb95e('0x22');var _0x15354f=_0x16675d['count'];var _0x3cd013=_0x4d7b95?0x0:_0x5c9cec['offset'];var _0x2505a4=_0x4d7b95?_0x16675d[_0xb95e('0x23')]:_0x5c9cec[_0xb95e('0x21')]+_0x5c9cec[_0xb95e('0x24')];var _0x19907d;if(_0x2505a4>=_0x15354f){_0x2505a4=_0x15354f;_0x19907d=0xc8;}else{_0x19907d=0xce;}_0x5ea699[_0xb95e('0x1e')](_0x19907d);return _0x5ea699[_0xb95e('0x25')](_0xb95e('0x26'),_0x3cd013+'-'+_0x2505a4+'/'+_0x15354f)[_0xb95e('0x20')](_0x16675d);}return null;};}function patchUpdates(_0x5af847){return function(_0x2560e4){try{jsonpatch[_0xb95e('0x27')](_0x2560e4,_0x5af847,!![]);}catch(_0x3e17ef){return BPromise['reject'](_0x3e17ef);}return _0x2560e4[_0xb95e('0x28')]();};}function saveUpdates(_0x5d1b82,_0x5ce931){return function(_0x28b953){if(_0x28b953){return _0x28b953[_0xb95e('0x29')](_0x5d1b82)[_0xb95e('0x2a')](function(_0x548dcb){return _0x548dcb;});}return null;};}function removeEntity(_0x4fadf6,_0x2c444a){return function(_0x3f9955){if(_0x3f9955){return _0x3f9955[_0xb95e('0x2b')]()[_0xb95e('0x2a')](function(){_0x4fadf6[_0xb95e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e118a,_0x36bcbf){return function(_0x576856){if(!_0x576856){_0x3e118a['sendStatus'](0x194);}return _0x576856;};}function handleError(_0x1c59d2,_0x11364a){_0x11364a=_0x11364a||0x1f4;return function(_0x1afd60){logger[_0xb95e('0x2c')](_0x1afd60[_0xb95e('0x2d')]);if(_0x1afd60['name']){delete _0x1afd60[_0xb95e('0x2e')];}_0x1c59d2[_0xb95e('0x1e')](_0x11364a)['send'](_0x1afd60);};}exports['index']=function(_0x9bf7d5,_0x598423){var _0x35f9d2={},_0x495b6d={},_0x9a9047={'count':0x0,'rows':[]};var _0x2a72b2=_[_0xb95e('0x2f')](db[_0xb95e('0x30')][_0xb95e('0x31')],function(_0x5022c9){return{'name':_0x5022c9[_0xb95e('0x32')],'type':_0x5022c9[_0xb95e('0x33')][_0xb95e('0x34')]};});_0x495b6d[_0xb95e('0x35')]=_[_0xb95e('0x2f')](_0x2a72b2,_0xb95e('0x2e'));_0x495b6d['query']=_[_0xb95e('0x36')](_0x9bf7d5[_0xb95e('0x37')]);_0x495b6d['filters']=_['intersection'](_0x495b6d['model'],_0x495b6d['query']);_0x35f9d2[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x495b6d[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x9bf7d5[_0xb95e('0x37')]['fields']));_0x35f9d2['attributes']=_0x35f9d2[_0xb95e('0x38')][_0xb95e('0x3b')]?_0x35f9d2[_0xb95e('0x38')]:_0x495b6d[_0xb95e('0x35')];if(!_0x9bf7d5[_0xb95e('0x37')]['hasOwnProperty'](_0xb95e('0x3c'))){_0x35f9d2[_0xb95e('0x24')]=qs[_0xb95e('0x24')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x24')]);_0x35f9d2[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x21')]);}_0x35f9d2['order']=qs[_0xb95e('0x3d')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x35f9d2[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_[_0xb95e('0x40')](_0x9bf7d5['query'],_0x495b6d[_0xb95e('0x3f')]),_0x2a72b2);if(_0x9bf7d5['query'][_0xb95e('0x41')]){_0x35f9d2['where']=_[_0xb95e('0x42')](_0x35f9d2[_0xb95e('0x3e')],{'$or':_[_0xb95e('0x2f')](_0x2a72b2,function(_0x29fe79){if(_0x29fe79[_0xb95e('0x33')]!==_0xb95e('0x43')){var _0x2e35af={};_0x2e35af[_0x29fe79[_0xb95e('0x2e')]]={'$like':'%'+_0x9bf7d5['query'][_0xb95e('0x41')]+'%'};return _0x2e35af;}})});}_0x35f9d2=_[_0xb95e('0x42')]({},_0x35f9d2,_0x9bf7d5[_0xb95e('0x44')]);var _0x266108={'where':_0x35f9d2[_0xb95e('0x3e')]};return db['ChatGroup'][_0xb95e('0x23')](_0x266108)[_0xb95e('0x2a')](function(_0x5d7b4a){_0x9a9047[_0xb95e('0x23')]=_0x5d7b4a;if(_0x9bf7d5[_0xb95e('0x37')]['includeAll']){_0x35f9d2['include']=[{'all':!![]}];}return db[_0xb95e('0x30')][_0xb95e('0x45')](_0x35f9d2);})[_0xb95e('0x2a')](function(_0x2a48f2){_0x9a9047[_0xb95e('0x46')]=_0x2a48f2;return _0x9a9047;})['then'](respondWithFilteredResult(_0x598423,_0x35f9d2))[_0xb95e('0x47')](handleError(_0x598423,null));};exports[_0xb95e('0x48')]=function(_0x408174,_0x18481a){var _0x425649={'raw':!![],'where':{'id':_0x408174[_0xb95e('0x49')]['id']}},_0x566571={};_0x566571[_0xb95e('0x35')]=_['keys'](db['ChatGroup'][_0xb95e('0x31')]);_0x566571[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x408174[_0xb95e('0x37')]);_0x566571['filters']=_['intersection'](_0x566571[_0xb95e('0x35')],_0x566571[_0xb95e('0x37')]);_0x425649[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x566571[_0xb95e('0x35')],qs['fields'](_0x408174['query']['fields']));_0x425649['attributes']=_0x425649['attributes'][_0xb95e('0x3b')]?_0x425649[_0xb95e('0x38')]:_0x566571['model'];if(_0x408174['query'][_0xb95e('0x4a')]){_0x425649[_0xb95e('0x4b')]=[{'all':!![]}];}_0x425649=_[_0xb95e('0x42')]({},_0x425649,_0x408174[_0xb95e('0x44')]);return db[_0xb95e('0x30')][_0xb95e('0x4c')](_0x425649)[_0xb95e('0x2a')](handleEntityNotFound(_0x18481a,null))['then'](respondWithResult(_0x18481a,null))[_0xb95e('0x47')](handleError(_0x18481a,null));};exports[_0xb95e('0x4d')]=function(_0x5827e3,_0x2cea8f){return db[_0xb95e('0x30')][_0xb95e('0x4d')](_0x5827e3['body'],{})[_0xb95e('0x2a')](respondWithResult(_0x2cea8f,0xc9))[_0xb95e('0x47')](handleError(_0x2cea8f,null));};exports[_0xb95e('0x29')]=function(_0x434acb,_0x2a28d9){if(_0x434acb[_0xb95e('0x4e')]['id']){delete _0x434acb[_0xb95e('0x4e')]['id'];}return db[_0xb95e('0x30')]['find']({'where':{'id':_0x434acb['params']['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x2a28d9,null))[_0xb95e('0x2a')](saveUpdates(_0x434acb[_0xb95e('0x4e')],null))[_0xb95e('0x2a')](respondWithResult(_0x2a28d9,null))[_0xb95e('0x47')](handleError(_0x2a28d9,null));};exports[_0xb95e('0x2b')]=function(_0x25e9aa,_0x17d3d9){return db['ChatGroup']['find']({'where':{'id':_0x25e9aa[_0xb95e('0x49')]['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x17d3d9,null))['then'](removeEntity(_0x17d3d9,null))[_0xb95e('0x47')](handleError(_0x17d3d9,null));};exports[_0xb95e('0x4f')]=function(_0x2771ec,_0x398026){return db['ChatGroup'][_0xb95e('0x4f')]()['then'](respondWithResult(_0x398026,null))[_0xb95e('0x47')](handleError(_0x398026,null));};exports[_0xb95e('0x50')]=function(_0x469f12,_0x2144df,_0x14c520){return db['ChatInternalMessage'][_0xb95e('0x23')]({'where':{'ChatGroupId':_0x469f12[_0xb95e('0x49')]['id'],'ToId':_0x469f12[_0xb95e('0x51')]['id'],'read':![]}})[_0xb95e('0x2a')](function(_0x154145){return{'id':_[_0xb95e('0x52')](_0x469f12['params']['id']),'count':_0x154145};})[_0xb95e('0x2a')](respondWithResult(_0x2144df,null))[_0xb95e('0x47')](handleError(_0x2144df,null));};exports[_0xb95e('0x53')]=function(_0xb1533d,_0x1ae9ee,_0x18f8c9){return db[_0xb95e('0x30')]['find']({'where':{'id':_0xb1533d['params']['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x1ae9ee,null))['then'](function(_0x455f43){if(_0x455f43){return _0x455f43[_0xb95e('0x53')](_0xb1533d['body'][_0xb95e('0x54')],_[_0xb95e('0x55')](_0xb1533d[_0xb95e('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ae9ee,null))['catch'](handleError(_0x1ae9ee,null));};exports[_0xb95e('0x56')]=function(_0x26fffd,_0x368a4c,_0xeb4539){var _0x5daf09={};var _0x33a570={};var _0x482768;var _0x5c41cd;return db[_0xb95e('0x30')][_0xb95e('0x57')]({'where':{'id':_0x26fffd[_0xb95e('0x49')]['id']}})['then'](handleEntityNotFound(_0x368a4c,null))[_0xb95e('0x2a')](function(_0x30f5da){if(_0x30f5da){_0x482768=_0x30f5da;_0x33a570[_0xb95e('0x35')]=_[_0xb95e('0x36')](db[_0xb95e('0x58')][_0xb95e('0x31')]);_0x33a570[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x26fffd['query']);_0x33a570[_0xb95e('0x3f')]=_[_0xb95e('0x39')](_0x33a570[_0xb95e('0x35')],_0x33a570['query']);_0x5daf09[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x33a570[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x3a')]));_0x5daf09['attributes']=_0x5daf09[_0xb95e('0x38')][_0xb95e('0x3b')]?_0x5daf09[_0xb95e('0x38')]:_0x33a570[_0xb95e('0x35')];_0x5daf09[_0xb95e('0x59')]=qs[_0xb95e('0x3d')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x5daf09[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_[_0xb95e('0x40')](_0x26fffd[_0xb95e('0x37')],_0x33a570[_0xb95e('0x3f')]));if(_0x26fffd[_0xb95e('0x37')][_0xb95e('0x41')]){_0x5daf09[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x5daf09[_0xb95e('0x3e')],{'$or':_[_0xb95e('0x2f')](_0x5daf09[_0xb95e('0x38')],function(_0x354e1c){var _0xb89dbe={};_0xb89dbe[_0x354e1c]={'$like':'%'+_0x26fffd['query'][_0xb95e('0x41')]+'%'};return _0xb89dbe;})});}_0x5daf09=_[_0xb95e('0x42')]({},_0x5daf09,_0x26fffd[_0xb95e('0x44')]);return _0x482768[_0xb95e('0x56')](_0x5daf09);}})[_0xb95e('0x2a')](function(_0x37d2d5){if(_0x37d2d5){_0x5c41cd=_0x37d2d5['length'];if(!_0x26fffd[_0xb95e('0x37')]['hasOwnProperty']('nolimit')){_0x5daf09[_0xb95e('0x24')]=qs[_0xb95e('0x24')](_0x26fffd[_0xb95e('0x37')]['limit']);_0x5daf09[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x21')]);}return _0x482768[_0xb95e('0x56')](_0x5daf09);}})['then'](function(_0x4cc383){if(_0x4cc383){return _0x4cc383?{'count':_0x5c41cd,'rows':_0x4cc383}:null;}})[_0xb95e('0x2a')](respondWithResult(_0x368a4c,null))[_0xb95e('0x47')](handleError(_0x368a4c,null));};exports[_0xb95e('0x5a')]=function(_0x24d8ae,_0x490d23,_0x58d3be){return db[_0xb95e('0x30')][_0xb95e('0x4c')]({'where':{'id':_0x24d8ae[_0xb95e('0x49')]['id']}})['then'](handleEntityNotFound(_0x490d23,null))[_0xb95e('0x2a')](function(_0x30c277){if(_0x30c277){return _0x30c277['removeMembers'](_0x24d8ae[_0xb95e('0x37')][_0xb95e('0x54')]);}})[_0xb95e('0x2a')](respondWithStatusCode(_0x490d23,null))[_0xb95e('0x47')](handleError(_0x490d23,null));};exports[_0xb95e('0x5b')]=function(_0x4d4b87,_0x302556,_0xbf81ab){if(_0x4d4b87[_0xb95e('0x4e')]['id']){delete _0x4d4b87[_0xb95e('0x4e')]['id'];}return db[_0xb95e('0x30')][_0xb95e('0x4c')]({'where':{'id':_0x4d4b87[_0xb95e('0x49')]['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x302556,null))['then'](function(_0x133d75){if(_0x133d75){_0x4d4b87[_0xb95e('0x4e')]['ChatGroupId']=_0x133d75['id'];return db[_0xb95e('0x5c')][_0xb95e('0x4d')](_0x4d4b87[_0xb95e('0x4e')]);}})[_0xb95e('0x2a')](respondWithResult(_0x302556,null))[_0xb95e('0x47')](handleError(_0x302556,null));};exports[_0xb95e('0x5d')]=function(_0x4c4204,_0x2a9849,_0x578957){var _0x2ce07d={};var _0x5707e9={};var _0x3e56ce;var _0x3d2a81;return db[_0xb95e('0x30')]['findOne']({'where':{'id':_0x4c4204['params']['id']}})['then'](handleEntityNotFound(_0x2a9849,null))[_0xb95e('0x2a')](function(_0x3746f6){if(_0x3746f6){_0x3e56ce=_0x3746f6;_0x5707e9['model']=_['keys'](db['ChatInternalMessage'][_0xb95e('0x31')]);_0x5707e9[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x4c4204[_0xb95e('0x37')]);_0x5707e9['filters']=_[_0xb95e('0x39')](_0x5707e9[_0xb95e('0x35')],_0x5707e9[_0xb95e('0x37')]);_0x2ce07d[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x5707e9[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x4c4204[_0xb95e('0x37')][_0xb95e('0x3a')]));_0x2ce07d[_0xb95e('0x38')]=_0x2ce07d['attributes'][_0xb95e('0x3b')]?_0x2ce07d[_0xb95e('0x38')]:_0x5707e9[_0xb95e('0x35')];_0x2ce07d[_0xb95e('0x59')]=qs[_0xb95e('0x3d')](_0x4c4204[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x2ce07d[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_['pick'](_0x4c4204[_0xb95e('0x37')],_0x5707e9[_0xb95e('0x3f')]));if(_0x4c4204['query'][_0xb95e('0x41')]){_0x2ce07d[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x2ce07d['where'],{'$or':_[_0xb95e('0x2f')](_0x2ce07d[_0xb95e('0x38')],function(_0x3cf901){var _0x379738={};_0x379738[_0x3cf901]={'$like':'%'+_0x4c4204[_0xb95e('0x37')][_0xb95e('0x41')]+'%'};return _0x379738;})});}if(_0x4c4204['query'][_0xb95e('0x5e')]){var _0xaa5f19=_0x4c4204[_0xb95e('0x37')][_0xb95e('0x5e')][_0xb95e('0x5f')](',');var _0x46eff8={};_0x46eff8[_0xaa5f19[0x0]]={'$gte':moment(_0xaa5f19[0x1])[_0xb95e('0x60')](_0xb95e('0x61'))};_0x2ce07d[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x2ce07d[_0xb95e('0x3e')],_0x46eff8);}_0x2ce07d=_[_0xb95e('0x42')]({},_0x2ce07d,_0x4c4204['options']);return _0x3e56ce[_0xb95e('0x5d')](_0x2ce07d);}})[_0xb95e('0x2a')](function(_0x5d0f2e){if(_0x5d0f2e){_0x3d2a81=_0x5d0f2e[_0xb95e('0x3b')];if(!_0x4c4204[_0xb95e('0x37')]['hasOwnProperty'](_0xb95e('0x3c'))){_0x2ce07d['limit']=qs['limit'](_0x4c4204['query'][_0xb95e('0x24')]);_0x2ce07d[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x4c4204['query']['offset']);}return _0x3e56ce['getMessages'](_0x2ce07d);}})[_0xb95e('0x2a')](function(_0x2b8870){if(_0x2b8870){return _0x2b8870?{'count':_0x3d2a81,'rows':_0x2b8870}:null;}})[_0xb95e('0x2a')](respondWithResult(_0x2a9849,null))['catch'](handleError(_0x2a9849,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1ac7449..e4a3432 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9341=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x3ef8a9,_0x59a7c2){var _0x424f63=function(_0x7c1873){while(--_0x7c1873){_0x3ef8a9['push'](_0x3ef8a9['shift']());}};_0x424f63(++_0x59a7c2);}(_0x9341,0xff));var _0x1934=function(_0x2e4da7,_0x27958b){_0x2e4da7=_0x2e4da7-0x0;var _0x4f7a14=_0x9341[_0x2e4da7];return _0x4f7a14;};'use strict';var EventEmitter=require(_0x1934('0x0'));var ChatGroup=require(_0x1934('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1934('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1934('0x3'),'afterDestroy':_0x1934('0x4')};function emitEvent(_0x32935b){return function(_0x19f4ef,_0x26f28b,_0xa5db53){ChatGroupEvents[_0x1934('0x5')](_0x32935b+':'+_0x19f4ef['id'],_0x19f4ef);ChatGroupEvents[_0x1934('0x5')](_0x32935b,_0x19f4ef);_0xa5db53(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x1934('0x6')](e,emitEvent(event));}}module[_0x1934('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xc274=['exports','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a23a9,_0x17a2c0){var _0x18c27f=function(_0x3414e3){while(--_0x3414e3){_0x4a23a9['push'](_0x4a23a9['shift']());}};_0x18c27f(++_0x17a2c0);}(_0xc274,0x151));var _0x4c27=function(_0x164273,_0x44790d){_0x164273=_0x164273-0x0;var _0x2597f9=_0xc274[_0x164273];return _0x2597f9;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x4c27('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c27('0x1'),'afterUpdate':_0x4c27('0x2'),'afterDestroy':_0x4c27('0x3')};function emitEvent(_0x15133d){return function(_0x2771df,_0x17970c,_0x534d34){ChatGroupEvents[_0x4c27('0x4')](_0x15133d+':'+_0x2771df['id'],_0x2771df);ChatGroupEvents['emit'](_0x15133d,_0x2771df);_0x534d34(null);};}for(var e in events){if(events[_0x4c27('0x5')](e)){var event=events[e];ChatGroup[_0x4c27('0x6')](e,emitEvent(event));}}module[_0x4c27('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 3e9bdca..53d1476 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd1a=['api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xdd1a,0x1c5));var _0xadd1=function(_0x37d53b,_0x2b76e3){_0x37d53b=_0x37d53b-0x0;var _0x4d4c8d=_0xdd1a[_0x37d53b];return _0x4d4c8d;};'use strict';var _=require(_0xadd1('0x0'));var util=require(_0xadd1('0x1'));var logger=require(_0xadd1('0x2'))(_0xadd1('0x3'));var moment=require('moment');var BPromise=require(_0xadd1('0x4'));var rp=require(_0xadd1('0x5'));var fs=require('fs');var path=require(_0xadd1('0x6'));var rimraf=require(_0xadd1('0x7'));var config=require('../../config/environment');var attributes=require(_0xadd1('0x8'));module['exports']=function(_0x30ebb4,_0x26649e){return _0x30ebb4[_0xadd1('0x9')](_0xadd1('0xa'),attributes,{'tableName':_0xadd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa867=['chat_groups','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa867,0x1a5));var _0x7a86=function(_0x9649dd,_0x210d04){_0x9649dd=_0x9649dd-0x0;var _0x2b9b59=_0xa867[_0x9649dd];return _0x2b9b59;};'use strict';var _=require(_0x7a86('0x0'));var util=require('util');var logger=require(_0x7a86('0x1'))(_0x7a86('0x2'));var moment=require(_0x7a86('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a86('0x4'));var fs=require('fs');var path=require(_0x7a86('0x5'));var rimraf=require(_0x7a86('0x6'));var config=require(_0x7a86('0x7'));var attributes=require(_0x7a86('0x8'));module[_0x7a86('0x9')]=function(_0x57c614,_0x53eb13){return _0x57c614[_0x7a86('0xa')]('ChatGroup',attributes,{'tableName':_0x7a86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 51e15c1..7d53d4c 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62c8=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x2bd6fd,_0x296b2f){var _0x448ff7=function(_0x216dbb){while(--_0x216dbb){_0x2bd6fd['push'](_0x2bd6fd['shift']());}};_0x448ff7(++_0x296b2f);}(_0x62c8,0x1ad));var _0x862c=function(_0x19d0b3,_0x3a1c83){_0x19d0b3=_0x19d0b3-0x0;var _0x321228=_0x62c8[_0x19d0b3];return _0x321228;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x862c('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x862c('0x1'));var db=require(_0x862c('0x2'))['db'];var utils=require(_0x862c('0x3'));var logger=require(_0x862c('0x4'))(_0x862c('0x5'));var config=require(_0x862c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x862c('0x7')][_0x862c('0x8')]({'port':0x232a});config[_0x862c('0x9')]=_[_0x862c('0xa')](config[_0x862c('0x9')],{'host':_0x862c('0xb'),'port':0x18eb});var socket=require(_0x862c('0xc'))(new Redis(config[_0x862c('0x9')]));require(_0x862c('0xd'))[_0x862c('0xe')](socket);function respondWithRpcPromise(_0x355d4f,_0x52ec01,_0x602913){return new BPromise(function(_0x38eac3,_0xaca82b){return client[_0x862c('0xf')](_0x355d4f,_0x602913)[_0x862c('0x10')](function(_0x5cf76c){logger[_0x862c('0x11')](_0x862c('0x12'),_0x52ec01,_0x862c('0x13'));logger[_0x862c('0x14')](_0x862c('0x15'),_0x52ec01,_0x862c('0x13'),JSON[_0x862c('0x16')](_0x5cf76c));if(_0x5cf76c[_0x862c('0x17')]){if(_0x5cf76c[_0x862c('0x17')][_0x862c('0x18')]===0x1f4){logger[_0x862c('0x17')](_0x862c('0x12'),_0x52ec01,_0x5cf76c[_0x862c('0x17')][_0x862c('0x19')]);return _0xaca82b(_0x5cf76c[_0x862c('0x17')]['message']);}logger[_0x862c('0x17')]('ChatGroup,\x20%s,\x20%s',_0x52ec01,_0x5cf76c['error'][_0x862c('0x19')]);return _0x38eac3(_0x5cf76c['error'][_0x862c('0x19')]);}else{logger[_0x862c('0x11')](_0x862c('0x12'),_0x52ec01,_0x862c('0x13'));_0x38eac3(_0x5cf76c[_0x862c('0x1a')][_0x862c('0x19')]);}})[_0x862c('0x1b')](function(_0x34e930){logger[_0x862c('0x17')](_0x862c('0x12'),_0x52ec01,_0x34e930);_0xaca82b(_0x34e930);});});} \ No newline at end of file +var _0xf29c=['request','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatGroup.socket','register'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xf29c,0xc7));var _0xcf29=function(_0x115e86,_0x1a216b){_0x115e86=_0x115e86-0x0;var _0x4d9dd0=_0xf29c[_0x115e86];return _0x4d9dd0;};'use strict';var _=require('lodash');var util=require(_0xcf29('0x0'));var moment=require(_0xcf29('0x1'));var BPromise=require(_0xcf29('0x2'));var rs=require(_0xcf29('0x3'));var fs=require('fs');var Redis=require(_0xcf29('0x4'));var db=require(_0xcf29('0x5'))['db'];var utils=require(_0xcf29('0x6'));var logger=require(_0xcf29('0x7'))(_0xcf29('0x8'));var config=require(_0xcf29('0x9'));var jayson=require(_0xcf29('0xa'));var client=jayson[_0xcf29('0xb')][_0xcf29('0xc')]({'port':0x232a});config[_0xcf29('0xd')]=_[_0xcf29('0xe')](config[_0xcf29('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf29('0xd')]));require(_0xcf29('0xf'))[_0xcf29('0x10')](socket);function respondWithRpcPromise(_0x18bfa3,_0x4268c6,_0x2f3bd5){return new BPromise(function(_0x2ed7fa,_0x38b122){return client[_0xcf29('0x11')](_0x18bfa3,_0x2f3bd5)[_0xcf29('0x12')](function(_0xb13a72){logger[_0xcf29('0x13')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'));logger[_0xcf29('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'),JSON['stringify'](_0xb13a72));if(_0xb13a72[_0xcf29('0x16')]){if(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x17')]===0x1f4){logger[_0xcf29('0x16')](_0xcf29('0x18'),_0x4268c6,_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);return _0x38b122(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);}logger['error'](_0xcf29('0x18'),_0x4268c6,_0xb13a72['error'][_0xcf29('0x19')]);return _0x2ed7fa(_0xb13a72['error'][_0xcf29('0x19')]);}else{logger['info'](_0xcf29('0x18'),_0x4268c6,'request\x20sent');_0x2ed7fa(_0xb13a72[_0xcf29('0x1a')][_0xcf29('0x19')]);}})['catch'](function(_0xe2b5b1){logger[_0xcf29('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xe2b5b1);_0x38b122(_0xe2b5b1);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6cd93f7..466deeb 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c8=['emit','removeListener','chatGroup:','./chatGroup.events','remove'];(function(_0x4a6c4d,_0x455768){var _0x31800b=function(_0x203513){while(--_0x203513){_0x4a6c4d['push'](_0x4a6c4d['shift']());}};_0x31800b(++_0x455768);}(_0x34c8,0xa3));var _0x834c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x34c8[_0x4e676e];return _0x336a3c;};'use strict';var ChatGroupEvents=require(_0x834c('0x0'));var events=['save',_0x834c('0x1'),'update'];function createListener(_0x2addba,_0x7ab27d){return function(_0x56b2bd){_0x7ab27d[_0x834c('0x2')](_0x2addba,_0x56b2bd);};}function removeListener(_0x198818,_0x388562){return function(){ChatGroupEvents[_0x834c('0x3')](_0x198818,_0x388562);};}exports['register']=function(_0x2a85f){for(var _0x4929f6=0x0,_0x25102f=events['length'];_0x4929f6<_0x25102f;_0x4929f6++){var _0x5e2910=events[_0x4929f6];var _0xea0550=createListener(_0x834c('0x4')+_0x5e2910,_0x2a85f);ChatGroupEvents['on'](_0x5e2910,_0xea0550);}}; \ No newline at end of file +var _0xb28a=['emit','register','length','chatGroup:','remove','update'];(function(_0x3054a6,_0x3b172e){var _0x5141a0=function(_0x420436){while(--_0x420436){_0x3054a6['push'](_0x3054a6['shift']());}};_0x5141a0(++_0x3b172e);}(_0xb28a,0x1ae));var _0xab28=function(_0x3d8027,_0x2c6d46){_0x3d8027=_0x3d8027-0x0;var _0x468866=_0xb28a[_0x3d8027];return _0x468866;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xab28('0x0'),_0xab28('0x1')];function createListener(_0x1dc488,_0x3fafae){return function(_0x4a4d1e){_0x3fafae[_0xab28('0x2')](_0x1dc488,_0x4a4d1e);};}function removeListener(_0x4b1e73,_0x4c3485){return function(){ChatGroupEvents['removeListener'](_0x4b1e73,_0x4c3485);};}exports[_0xab28('0x3')]=function(_0x5a8729){for(var _0xc435d4=0x0,_0x237085=events[_0xab28('0x4')];_0xc435d4<_0x237085;_0xc435d4++){var _0x2978e1=events[_0xc435d4];var _0x5b6835=createListener(_0xab28('0x5')+_0x2978e1,_0x5a8729);ChatGroupEvents['on'](_0x2978e1,_0x5b6835);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index f656808..05c5995 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05f9=['./chatGroup.controller','get','isAuthenticated','index','/:id','/:id/unread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util','express','../../components/auth/service','../../config/environment'];(function(_0x2f813a,_0x362815){var _0x53f830=function(_0xbcaa21){while(--_0xbcaa21){_0x2f813a['push'](_0x2f813a['shift']());}};_0x53f830(++_0x362815);}(_0x05f9,0x73));var _0x905f=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x05f9[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x905f('0x0'));var util=require(_0x905f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x905f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x905f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x905f('0x4'));var controller=require(_0x905f('0x5'));router[_0x905f('0x6')]('/',auth[_0x905f('0x7')](),controller[_0x905f('0x8')]);router[_0x905f('0x6')]('/describe',auth[_0x905f('0x7')](),controller['describe']);router[_0x905f('0x6')](_0x905f('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x905f('0xa'),auth[_0x905f('0x7')](),controller['getUnread']);router[_0x905f('0x6')]('/:id/members',auth[_0x905f('0x7')](),controller[_0x905f('0xb')]);router['get'](_0x905f('0xc'),auth[_0x905f('0x7')](),controller[_0x905f('0xd')]);router[_0x905f('0xe')]('/',auth[_0x905f('0x7')](),controller[_0x905f('0xf')]);router['post'](_0x905f('0x10'),auth[_0x905f('0x7')](),controller[_0x905f('0x11')]);router['post'](_0x905f('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x905f('0x12')]('/:id',auth[_0x905f('0x7')](),controller[_0x905f('0x13')]);router[_0x905f('0x14')](_0x905f('0x9'),auth['isAuthenticated'](),controller[_0x905f('0x15')]);router['delete']('/:id/members',auth[_0x905f('0x7')](),controller[_0x905f('0x16')]);module[_0x905f('0x17')]=router; \ No newline at end of file +var _0x8fa7=['put','update','delete','destroy','/:id/members','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','/:id','getUnread','getMembers','/:id/messages','create','post','addMembers'];(function(_0x2f995b,_0x1af525){var _0x5e84e4=function(_0x234bff){while(--_0x234bff){_0x2f995b['push'](_0x2f995b['shift']());}};_0x5e84e4(++_0x1af525);}(_0x8fa7,0x157));var _0x78fa=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x8fa7[_0x3e6d5d];return _0x238923;};'use strict';var multer=require(_0x78fa('0x0'));var util=require(_0x78fa('0x1'));var path=require(_0x78fa('0x2'));var timeout=require(_0x78fa('0x3'));var express=require(_0x78fa('0x4'));var router=express[_0x78fa('0x5')]();var fs_extra=require(_0x78fa('0x6'));var auth=require(_0x78fa('0x7'));var interaction=require(_0x78fa('0x8'));var config=require(_0x78fa('0x9'));var controller=require(_0x78fa('0xa'));router[_0x78fa('0xb')]('/',auth['isAuthenticated'](),controller[_0x78fa('0xc')]);router[_0x78fa('0xb')]('/describe',auth[_0x78fa('0xd')](),controller['describe']);router['get'](_0x78fa('0xe'),auth[_0x78fa('0xd')](),controller['show']);router[_0x78fa('0xb')]('/:id/unread',auth[_0x78fa('0xd')](),controller[_0x78fa('0xf')]);router[_0x78fa('0xb')]('/:id/members',auth[_0x78fa('0xd')](),controller[_0x78fa('0x10')]);router[_0x78fa('0xb')](_0x78fa('0x11'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0x78fa('0xd')](),controller[_0x78fa('0x12')]);router[_0x78fa('0x13')]('/:id/members',auth['isAuthenticated'](),controller[_0x78fa('0x14')]);router[_0x78fa('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x78fa('0x15')]('/:id',auth[_0x78fa('0xd')](),controller[_0x78fa('0x16')]);router[_0x78fa('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x78fa('0x18')]);router['delete'](_0x78fa('0x19'),auth[_0x78fa('0xd')](),controller[_0x78fa('0x1a')]);module[_0x78fa('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 26c0f24..c0cd909 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','BOOLEAN'];(function(_0xa650d8,_0x6d01ef){var _0x79ce97=function(_0x5ee62b){while(--_0x5ee62b){_0xa650d8['push'](_0xa650d8['shift']());}};_0x79ce97(++_0x6d01ef);}(_0xb688,0xcf));var _0x8b68=function(_0xa049a8,_0x40d684){_0xa049a8=_0xa049a8-0x0;var _0x582917=_0xb688[_0xa049a8];return _0x582917;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'closed':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8b68('0x2')]},'ratingType':{'type':Sequelize[_0x8b68('0x3')](_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8b68('0x6')]},'pathTranscript':{'type':Sequelize[_0x8b68('0x6')]},'mailTranscript':{'type':Sequelize[_0x8b68('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8b68('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b68('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8b68('0x7')]},'browserName':{'type':Sequelize[_0x8b68('0x7')]},'browserVersion':{'type':Sequelize[_0x8b68('0x7')]},'osName':{'type':Sequelize[_0x8b68('0x7')]},'osVersion':{'type':Sequelize[_0x8b68('0x7')]},'deviceModel':{'type':Sequelize[_0x8b68('0x7')]},'deviceVendor':{'type':Sequelize[_0x8b68('0x7')]},'deviceType':{'type':Sequelize[_0x8b68('0x7')]},'referer':{'type':Sequelize[_0x8b68('0x6')]},'customerIp':{'type':Sequelize[_0x8b68('0x7')]},'formData':{'type':Sequelize[_0x8b68('0x6')](_0x8b68('0x9'))},'read1stAt':{'type':Sequelize[_0x8b68('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8b68('0x3')]('in',_0x8b68('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8b68('0x7')]},'customerPort':{'type':Sequelize[_0x8b68('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x8b68('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xbee3=['TEXT','DATE','STRING','long','BOOLEAN','exports','ENUM','star'];(function(_0x844a95,_0x5a3ae6){var _0x57f74d=function(_0x149f31){while(--_0x149f31){_0x844a95['push'](_0x844a95['shift']());}};_0x57f74d(++_0x5a3ae6);}(_0xbee3,0xd5));var _0x3bee=function(_0x7c5d6a,_0x3c9f62){_0x7c5d6a=_0x7c5d6a-0x0;var _0x3e6de7=_0xbee3[_0x7c5d6a];return _0x3e6de7;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x3bee('0x1')](_0x3bee('0x2'),'thumb'),'defaultValue':_0x3bee('0x2')},'ratingMessage':{'type':Sequelize[_0x3bee('0x3')]},'pathTranscript':{'type':Sequelize[_0x3bee('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3bee('0x4')]},'disposition':{'type':Sequelize[_0x3bee('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3bee('0x5')]},'note':{'type':Sequelize[_0x3bee('0x5')]},'browserName':{'type':Sequelize[_0x3bee('0x5')]},'browserVersion':{'type':Sequelize[_0x3bee('0x5')]},'osName':{'type':Sequelize[_0x3bee('0x5')]},'osVersion':{'type':Sequelize[_0x3bee('0x5')]},'deviceModel':{'type':Sequelize[_0x3bee('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3bee('0x5')]},'referer':{'type':Sequelize[_0x3bee('0x3')]},'customerIp':{'type':Sequelize[_0x3bee('0x5')]},'formData':{'type':Sequelize[_0x3bee('0x3')](_0x3bee('0x6'))},'read1stAt':{'type':Sequelize[_0x3bee('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3bee('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3bee('0x5')]},'customerPort':{'type':Sequelize[_0x3bee('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x3bee('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x3bee('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7d319f1..2b11372 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca5=['transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../mysqldb','defaults','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','stack','name','render','merge','body','contact','agent','index','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','destroy','describe','createVidaooSession','params','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','type','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','CmContact','ContactId','Messages','%s%d','agentAlias','UserId','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','includeAgent','push','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','direction','read','Account','Owner','mkdirSync','Chat','closedAt','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7ca5,0x19c));var _0x57ca=function(_0x274fde,_0x34ef0b){_0x274fde=_0x274fde-0x0;var _0x280d4a=_0x7ca5[_0x274fde];return _0x280d4a;};'use strict';var rimraf=require(_0x57ca('0x0'));var zipdir=require(_0x57ca('0x1'));var rp=require(_0x57ca('0x2'));var moment=require(_0x57ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x57ca('0x4'));var util=require(_0x57ca('0x5'));var path=require(_0x57ca('0x6'));var ejs=require(_0x57ca('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x57ca('0x8'));var interaction=require(_0x57ca('0x9'));var qs=require(_0x57ca('0xa'));var pdf=require(_0x57ca('0xb'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x57ca('0xc'))['db'];config['redis']=_[_0x57ca('0xd')](config['redis'],{'host':_0x57ca('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x57ca('0xf'))['register'](socket);var jayson=require(_0x57ca('0x10'));var client=jayson[_0x57ca('0x11')][_0x57ca('0x12')]({'port':0x232b});var client9004=jayson[_0x57ca('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x19f3bf,_0x771f3d,_0x4f9449,_0x7b7ff0){return new BPromise(function(_0x1d00d5,_0x1f51c3){var _0x186d81=_0x7b7ff0||client;return _0x186d81[_0x57ca('0x13')](_0x19f3bf,_0x4f9449)[_0x57ca('0x14')](function(_0x167458){logger[_0x57ca('0x15')](_0x57ca('0x16'),_0x771f3d,_0x57ca('0x17'));logger['debug'](_0x57ca('0x18'),_0x771f3d,'request\x20sent',JSON[_0x57ca('0x19')](_0x167458));if(_0x167458[_0x57ca('0x1a')]){if(_0x167458[_0x57ca('0x1a')][_0x57ca('0x1b')]===0x1f4){logger[_0x57ca('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x771f3d,_0x167458[_0x57ca('0x1a')][_0x57ca('0x1c')]);return _0x1f51c3(_0x167458[_0x57ca('0x1a')][_0x57ca('0x1c')]);}logger[_0x57ca('0x1a')](_0x57ca('0x16'),_0x771f3d,_0x167458[_0x57ca('0x1a')][_0x57ca('0x1c')]);return _0x1d00d5(_0x167458[_0x57ca('0x1a')][_0x57ca('0x1c')]);}else{logger['info'](_0x57ca('0x16'),_0x771f3d,_0x57ca('0x17'));_0x1d00d5(_0x167458[_0x57ca('0x1d')][_0x57ca('0x1c')]);}})[_0x57ca('0x1e')](function(_0x2a8c22){logger['error'](_0x57ca('0x16'),_0x771f3d,_0x2a8c22);_0x1f51c3(_0x2a8c22);});});}function respondWithStatusCode(_0x3daeed,_0x6b645a){_0x6b645a=_0x6b645a||0xcc;return function(_0x343528){if(_0x343528){return _0x3daeed[_0x57ca('0x1f')](_0x6b645a);}return _0x3daeed[_0x57ca('0x20')](_0x6b645a)[_0x57ca('0x21')]();};}function respondWithResult(_0x4edee2,_0x5d6411){_0x5d6411=_0x5d6411||0xc8;return function(_0x1f3527){if(_0x1f3527){return _0x4edee2['status'](_0x5d6411)[_0x57ca('0x22')](_0x1f3527);}};}function respondWithFilteredResult(_0x13a7d9,_0x614c4e){return function(_0x605eeb){if(_0x605eeb){var _0x59f68a=typeof _0x614c4e[_0x57ca('0x23')]===_0x57ca('0x24')&&typeof _0x614c4e['limit']===_0x57ca('0x24');var _0x9b6e24=_0x605eeb[_0x57ca('0x25')];var _0x31303e=_0x59f68a?0x0:_0x614c4e['offset'];var _0x5e40c0=_0x59f68a?_0x605eeb[_0x57ca('0x25')]:_0x614c4e[_0x57ca('0x23')]+_0x614c4e[_0x57ca('0x26')];var _0x3be0af;if(_0x5e40c0>=_0x9b6e24){_0x5e40c0=_0x9b6e24;_0x3be0af=0xc8;}else{_0x3be0af=0xce;}_0x13a7d9['status'](_0x3be0af);return _0x13a7d9[_0x57ca('0x27')](_0x57ca('0x28'),_0x31303e+'-'+_0x5e40c0+'/'+_0x9b6e24)[_0x57ca('0x22')](_0x605eeb);}return null;};}function saveUpdates(_0x474492){return function(_0x4eadc8){if(_0x4eadc8){return _0x4eadc8[_0x57ca('0x29')](_0x474492)[_0x57ca('0x14')](function(_0x5c155c){return _0x5c155c;});}return null;};}function removeEntity(_0x5e0e8f){return function(_0x30ae02){if(_0x30ae02){return _0x30ae02['destroy']()[_0x57ca('0x14')](function(){_0x5e0e8f[_0x57ca('0x20')](0xcc)[_0x57ca('0x21')]();});}};}function handleEntityNotFound(_0x4407d3){return function(_0x295da3){if(!_0x295da3){_0x4407d3['sendStatus'](0x194);}return _0x295da3;};}function handleError(_0x201d54,_0x26c36a){_0x26c36a=_0x26c36a||0x1f4;return function(_0x194469){logger[_0x57ca('0x1a')](_0x194469[_0x57ca('0x2a')]);if(_0x194469[_0x57ca('0x2b')]){delete _0x194469[_0x57ca('0x2b')];}_0x201d54[_0x57ca('0x20')](_0x26c36a)['send'](_0x194469);};}function getMustacheRender(_0x59b668,_0x256007){return Mustache[_0x57ca('0x2c')](_0x59b668,_[_0x57ca('0x2d')](_0x256007[_0x57ca('0x2e')],{'contact':_0x256007[_0x57ca('0x2f')],'message':_0x256007[_0x57ca('0x1c')],'agent':_0x256007[_0x57ca('0x30')],'interaction':_0x256007['interaction'],'account':_0x256007['account']}))||'';}exports[_0x57ca('0x31')]=function(_0x233d07,_0x5b621f){var _0x42fa30={};var _0x4a10a9=_[_0x57ca('0x32')](db[_0x57ca('0x33')]['rawAttributes'],function(_0x565eb6){return{'name':_0x565eb6[_0x57ca('0x34')],'type':_0x565eb6['type'][_0x57ca('0x35')]};});_0x42fa30=qs[_0x57ca('0x36')](_0x4a10a9,_0x233d07);return interaction[_0x57ca('0x37')](_0x57ca('0x38'),_0x233d07[_0x57ca('0x39')],_0x233d07['user'],_0x42fa30,_0x4a10a9)['then'](respondWithFilteredResult(_0x5b621f,_0x42fa30))[_0x57ca('0x1e')](handleError(_0x5b621f,null));};exports['show']=function(_0x5ac10c,_0x4dd903){var _0x10fd26={'raw':![],'where':{'id':_0x5ac10c['params']['id']}},_0x49bbf2={};_0x49bbf2[_0x57ca('0x3a')]=_[_0x57ca('0x3b')](db['ChatInteraction']['rawAttributes']);_0x49bbf2['query']=_[_0x57ca('0x3b')](_0x5ac10c[_0x57ca('0x39')]);_0x49bbf2[_0x57ca('0x3c')]=_[_0x57ca('0x3d')](_0x49bbf2[_0x57ca('0x3a')],_0x49bbf2[_0x57ca('0x39')]);_0x10fd26[_0x57ca('0x3e')]=_['intersection'](_0x49bbf2[_0x57ca('0x3a')],qs[_0x57ca('0x3f')](_0x5ac10c[_0x57ca('0x39')]['fields']));_0x10fd26[_0x57ca('0x3e')]=_0x10fd26[_0x57ca('0x3e')][_0x57ca('0x40')]?_0x10fd26[_0x57ca('0x3e')]:_0x49bbf2['model'];if(_0x5ac10c['query'][_0x57ca('0x41')]){_0x10fd26[_0x57ca('0x42')]=[{'all':!![]}];}_0x10fd26=_[_0x57ca('0x2d')]({},_0x10fd26,_0x5ac10c['options']);return db[_0x57ca('0x33')][_0x57ca('0x43')](_0x10fd26)['then'](handleEntityNotFound(_0x4dd903,null))[_0x57ca('0x14')](respondWithResult(_0x4dd903,null))[_0x57ca('0x1e')](handleError(_0x4dd903,null));};exports[_0x57ca('0x44')]=function(_0x5cdc41,_0x29d6ad){return db[_0x57ca('0x33')]['create'](_0x5cdc41[_0x57ca('0x2e')],{})[_0x57ca('0x14')](respondWithResult(_0x29d6ad,0xc9))[_0x57ca('0x1e')](handleError(_0x29d6ad,null));};exports['update']=function(_0x48d2d6,_0x23277b){if(_0x48d2d6[_0x57ca('0x2e')]['id']){delete _0x48d2d6[_0x57ca('0x2e')]['id'];}return db[_0x57ca('0x33')][_0x57ca('0x43')]({'where':{'id':_0x48d2d6['params']['id']}})[_0x57ca('0x14')](handleEntityNotFound(_0x23277b,null))[_0x57ca('0x14')](saveUpdates(_0x48d2d6['body'],null))[_0x57ca('0x14')](respondWithResult(_0x23277b,null))[_0x57ca('0x1e')](handleError(_0x23277b,null));};exports[_0x57ca('0x45')]=function(_0xa204ab,_0x5162ef){return db['ChatInteraction'][_0x57ca('0x43')]({'where':{'id':_0xa204ab['params']['id']}})[_0x57ca('0x14')](handleEntityNotFound(_0x5162ef,null))['then'](removeEntity(_0x5162ef,null))[_0x57ca('0x1e')](handleError(_0x5162ef,null));};exports[_0x57ca('0x46')]=function(_0x1553f9,_0x5f372d){return db[_0x57ca('0x33')][_0x57ca('0x46')]()[_0x57ca('0x14')](respondWithResult(_0x5f372d,null))[_0x57ca('0x1e')](handleError(_0x5f372d,null));};exports[_0x57ca('0x47')]=function(_0x1dc62e,_0x5860b1){var _0x2b0f03=_0x1dc62e[_0x57ca('0x48')]['id'];var _0x1f3a6d;var _0x48ede6;var _0x1f871f;return db[_0x57ca('0x33')][_0x57ca('0x49')]({'where':{'id':_0x2b0f03}})['then'](function(_0x4510c2){_0x1f3a6d=_0x4510c2;return db[_0x57ca('0x4a')]['findOne']({'where':{'id':_0x4510c2['ChatWebsiteId']},'attributes':['id',_0x57ca('0x4b'),_0x57ca('0x4c'),_0x57ca('0x4d'),_0x57ca('0x4e'),_0x57ca('0x4f')],'raw':!![]});})['then'](function(_0x6315e5){if(_0x6315e5&&_0x6315e5[_0x57ca('0x4b')]&&_0x6315e5[_0x57ca('0x4c')]){_0x48ede6=_0x6315e5;var _0x59c256={'interaction':{'id':_0x2b0f03},'agent':{'id':_0x1dc62e[_0x57ca('0x50')]['id'],'name':_0x1dc62e[_0x57ca('0x50')]['name'],'fullname':_0x1dc62e[_0x57ca('0x50')][_0x57ca('0x51')],'email':_0x1dc62e[_0x57ca('0x50')][_0x57ca('0x52')]},'contact':_0x1dc62e[_0x57ca('0x2e')][_0x57ca('0x2f')],'account':_0x1dc62e[_0x57ca('0x2e')]['account']};var _0x467dac={'rejectUnauthorized':![],'method':_0x57ca('0x53'),'url':_0x57ca('0x54'),'headers':{'X-APIKEY':_0x6315e5['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1dc62e[_0x57ca('0x50')][_0x57ca('0x52')]],'buttons':null,'topic':_0x48ede6[_0x57ca('0x4d')],'note':_[_0x57ca('0x55')](_0x48ede6['vidaooNote'])?null:getMustacheRender(_0x48ede6['vidaooNote'],_0x59c256),'metadata':null},'redirect':_0x57ca('0x56'),'json':!![]};try{if(!_[_0x57ca('0x55')](_0x48ede6[_0x57ca('0x4f')])){var _0x55329f=getMustacheRender(_0x48ede6[_0x57ca('0x4f')],_0x59c256);var _0x1a442b=JSON[_0x57ca('0x57')](_0x55329f);_0x467dac[_0x57ca('0x2e')][_0x57ca('0x58')]=_0x1a442b;}}catch(_0x501b5d){throw new db[(_0x57ca('0x59'))][(_0x57ca('0x5a'))](_0x57ca('0x5b'));}return rp(_0x467dac);}else{throw new db[(_0x57ca('0x59'))][(_0x57ca('0x5a'))](_0x57ca('0x5c'));}})[_0x57ca('0x14')](function(_0x53aaac){_0x1f871f=_0x53aaac;if(_0x1f871f['id']){var _0x4078a6={'body':_0x1f871f['join_url'],'ChatWebsiteId':_0x48ede6['id'],'ChatInteractionId':_0x1f3a6d['id'],'direction':_0x57ca('0x5d'),'UserId':_0x1dc62e[_0x57ca('0x50')]['id']};return db[_0x57ca('0x5e')][_0x57ca('0x44')](_0x4078a6,{});}else{throw new db['Sequelize']['ValidationError'](_0x57ca('0x5f'));}})['then'](function(){return _0x1f3a6d[_0x57ca('0x60')]({'vidaooSessionId':_0x1f871f['id']});})[_0x57ca('0x14')](respondWithResult(_0x5860b1,null))[_0x57ca('0x1e')](handleError(_0x5860b1,null));};exports[_0x57ca('0x61')]=function(_0x4c7073,_0x3742eb){if(_0x4c7073['body']['id']){delete _0x4c7073[_0x57ca('0x2e')]['id'];}return db[_0x57ca('0x33')][_0x57ca('0x43')]({'where':{'id':_0x4c7073[_0x57ca('0x48')]['id']},'include':[{'model':db['CmContact'],'as':_0x57ca('0x62')}]})[_0x57ca('0x14')](handleEntityNotFound(_0x3742eb,null))[_0x57ca('0x14')](saveUpdates(_0x4c7073[_0x57ca('0x2e')],null))[_0x57ca('0x14')](respondWithResult(_0x3742eb,null))['catch'](handleError(_0x3742eb,null));};exports[_0x57ca('0x63')]=function(_0x5b418a,_0x39fcf){if(_0x5b418a[_0x57ca('0x2e')]['id']){delete _0x5b418a[_0x57ca('0x2e')]['id'];}return db[_0x57ca('0x33')][_0x57ca('0x43')]({'where':{'id':_0x5b418a['params']['id']}})[_0x57ca('0x14')](function(_0x41ac8a){if(!_0x41ac8a){logger[_0x57ca('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x57ca('0x63'),0x194,_0x57ca('0x64'));_0x39fcf['sendStatus'](0x194);}else{if(_0x41ac8a['UserId']){throw new db[(_0x57ca('0x59'))][(_0x57ca('0x5a'))](_0x57ca('0x65'));}}return _0x41ac8a;})[_0x57ca('0x14')](function(_0x5c27e4){if(_0x5c27e4){return _0x5c27e4['update']({'closed':_0x5b418a['body'][_0x57ca('0x66')],'disposition':_0x5b418a['body'][_0x57ca('0x67')]})[_0x57ca('0x14')](function(_0x4895ed){return _0x4895ed;});}})[_0x57ca('0x14')](function(){return respondWithRpcPromise(_0x57ca('0x68'),_0x57ca('0x63'),_0x5b418a[_0x57ca('0x2e')],client9004);})[_0x57ca('0x14')](respondWithResult(_0x39fcf,null))[_0x57ca('0x1e')](handleError(_0x39fcf,null));};exports[_0x57ca('0x69')]=function(_0x5276b7,_0x5b66cf){_0x5276b7['body'][_0x57ca('0x2b')]=_0x5276b7[_0x57ca('0x6a')][_0x57ca('0x6b')];_0x5276b7[_0x57ca('0x2e')]['basename']=_0x5276b7[_0x57ca('0x6a')][_0x57ca('0x6c')];_0x5276b7['body'][_0x57ca('0x6d')]=_0x5276b7[_0x57ca('0x6a')][_0x57ca('0x6e')];return db[_0x57ca('0x6f')][_0x57ca('0x44')](_0x5276b7['body'])['then'](respondWithResult(_0x5b66cf,0xc9))['catch'](handleError(_0x5b66cf,null));};exports[_0x57ca('0x70')]=function(_0x4137e5,_0x4a6931){return db['ChatInteraction'][_0x57ca('0x49')]({'where':{'id':_0x4137e5[_0x57ca('0x48')]['id']},'raw':!![]})[_0x57ca('0x14')](handleEntityNotFound(_0x4a6931,null))[_0x57ca('0x14')](function(_0x3e0e09){if(_0x3e0e09){if(_0x3e0e09[_0x57ca('0x66')]){return _0x4a6931['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x57ca('0x6f')][_0x57ca('0x49')]({'where':{'id':_0x4137e5[_0x57ca('0x39')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x4a6931,null));}})[_0x57ca('0x14')](function(_0x164060){if(_0x164060){var _0x4fc4de=_0x164060[_0x57ca('0x71')]!==null;var _0x5b6879=path[_0x57ca('0x72')](config[_0x57ca('0x73')],_0x57ca('0x74'));if(_0x4fc4de){_0x5b6879=path[_0x57ca('0x72')](_0x5b6879,_0x57ca('0x75'));}var _0x2f1941=path['join'](_0x5b6879,_0x164060[_0x57ca('0x76')]);return _0x4a6931[_0x57ca('0x77')](_0x2f1941);}})[_0x57ca('0x1e')](handleError(_0x4a6931,null));};exports[_0x57ca('0x78')]=function(_0x2a174b,_0x17b178){var _0x2cbdcd=null;var _0x397a69=null;var _0x156a59=null;if(_0x2a174b['body']['id']){delete _0x2a174b['body']['id'];}if(_0x2a174b[_0x57ca('0x2e')][_0x57ca('0x79')]){_0x156a59=path[_0x57ca('0x72')](config[_0x57ca('0x73')],'server/files/chat/upload/',util[_0x57ca('0x7a')](_0x57ca('0x7b'),Date[_0x57ca('0x7c')]()));_0x2a174b[_0x57ca('0x2e')][_0x57ca('0x7d')]=_0x156a59;}return db['ChatInteraction']['find']({'where':{'id':_0x2a174b[_0x57ca('0x48')]['id']},'include':[{'model':db[_0x57ca('0x5e')],'as':'Messages','include':[{'model':db[_0x57ca('0x7e')],'as':'User'}]}]})[_0x57ca('0x14')](handleEntityNotFound(_0x17b178,null))[_0x57ca('0x14')](saveUpdates(_0x2a174b[_0x57ca('0x2e')],null))['then'](function(_0x2abccd){if(_0x2abccd){_0x2cbdcd=_0x2abccd;return db[_0x57ca('0x4a')]['find']({'where':{'id':_0x2cbdcd['ChatWebsiteId']}});}})[_0x57ca('0x14')](function(_0x2d98d1){if(_0x2d98d1){_0x397a69=_0x2d98d1;return db[_0x57ca('0x7f')][_0x57ca('0x43')]({'where':{'id':_0x2cbdcd[_0x57ca('0x80')]}});}})[_0x57ca('0x14')](function(_0x5e26d2){if(_0x5e26d2){if(_0x156a59){var _0x14dc84=null;for(var _0x4e6452=0x1;_0x4e6452<_0x2cbdcd[_0x57ca('0x81')]['length'];++_0x4e6452){_0x14dc84=_0x2cbdcd[_0x57ca('0x81')][_0x4e6452];var _0xe29bcb=_0x14dc84['UserId']?util[_0x57ca('0x7a')](_0x57ca('0x82'),_0x397a69[_0x57ca('0x83')],_0x14dc84[_0x57ca('0x84')]):_0x57ca('0x85');var _0x81371f=_0x2a174b[_0x57ca('0x2e')][_0x57ca('0x86')]||util[_0x57ca('0x7a')](_0x57ca('0x82'),_0x57ca('0x87'),_0x14dc84[_0x57ca('0x80')]);switch(_0x397a69[_0x57ca('0x88')]){case _0x57ca('0x89'):_0xe29bcb=_0x14dc84[_0x57ca('0x84')]?util[_0x57ca('0x7a')](_0x57ca('0x82'),_0x397a69['agentAlias'],_0x14dc84[_0x57ca('0x84')]):'System';break;case _0x57ca('0x8a'):_0xe29bcb=_0x14dc84['UserId']?_0x14dc84[_0x57ca('0x7e')][_0x57ca('0x8b')]||_0x14dc84[_0x57ca('0x7e')][_0x57ca('0x51')]:_0x57ca('0x85');break;case'agent_fullname':_0xe29bcb=_0x14dc84[_0x57ca('0x84')]?_0x14dc84[_0x57ca('0x7e')][_0x57ca('0x51')]:'System';break;default:_0xe29bcb=_0x14dc84[_0x57ca('0x84')]?util['format'](_0x57ca('0x82'),_0x397a69['agentAlias'],_0x14dc84[_0x57ca('0x84')]):_0x57ca('0x85');}var _0xeb144f=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x14dc84['createdAt'])[_0x57ca('0x7a')]('MM/DD/YYYY\x20HH:mm:ss'),_0x14dc84['direction']==='in'?_0x81371f:_0xe29bcb,_0x14dc84[_0x57ca('0x2e')]);if(!_0x14dc84[_0x57ca('0x8c')]){fs[_0x57ca('0x8d')](_0x156a59,_0xeb144f);}}return db[_0x57ca('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x57ca('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x57ca('0x90')],'as':_0x57ca('0x90'),'raw':!![]}]}]});}}})[_0x57ca('0x14')](function(_0x3fbf73){if(!_0x3fbf73||!_0x3fbf73[_0x57ca('0x91')]||!_0x2a174b[_0x57ca('0x2e')])return _0x2cbdcd;var _0x5f3cf4=_0x3fbf73[_0x57ca('0x92')]();return respondWithRpcPromise(_0x57ca('0x93'),'sendMail',{'account':_0x5f3cf4,'message':{'from':util[_0x57ca('0x7a')](_0x57ca('0x94'),_0x3fbf73[_0x57ca('0x2b')],_0x3fbf73['email']||_0x3fbf73['Smtp'][_0x57ca('0x50')]),'to':_0x2a174b[_0x57ca('0x2e')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2a174b[_0x57ca('0x2e')][_0x57ca('0x79')]),'attachments':[{'path':_0x156a59}]}})['then'](function(){return _0x2cbdcd;})[_0x57ca('0x1e')](function(_0x10418d){logger[_0x57ca('0x1a')](_0x10418d);});})[_0x57ca('0x14')](respondWithStatusCode(_0x17b178,0xc8))[_0x57ca('0x1e')](handleError(_0x17b178,null));};exports[_0x57ca('0x95')]=function(_0x1b0426,_0x37a04d){return db[_0x57ca('0x5e')][_0x57ca('0x43')]({'where':{'id':_0x1b0426[_0x57ca('0x48')]['id']}})[_0x57ca('0x14')](handleEntityNotFound(_0x37a04d,null))['then'](function(_0x5bdb1c){if(_0x5bdb1c){return _0x5bdb1c[_0x57ca('0x95')](_0x1b0426[_0x57ca('0x2e')][_0x57ca('0x96')],_[_0x57ca('0x97')](_0x1b0426['body'],[_0x57ca('0x96'),'id'])||{});}})['then'](respondWithResult(_0x37a04d,null))[_0x57ca('0x1e')](handleError(_0x37a04d,null));};exports['getMessages']=function(_0x3dd2aa,_0x40293e){var _0x18b2da={'raw':![],'where':{}};var _0x3cb979={};var _0x407592={'count':0x0,'rows':[]};return db[_0x57ca('0x33')][_0x57ca('0x49')]({'where':{'id':_0x3dd2aa[_0x57ca('0x48')]['id']}})[_0x57ca('0x14')](handleEntityNotFound(_0x40293e,null))['then'](function(_0x1b7cd3){if(_0x1b7cd3){_0x3cb979[_0x57ca('0x3a')]=_[_0x57ca('0x3b')](db[_0x57ca('0x5e')][_0x57ca('0x98')]);_0x3cb979[_0x57ca('0x39')]=_[_0x57ca('0x3b')](_0x3dd2aa[_0x57ca('0x39')]);_0x3cb979[_0x57ca('0x3c')]=_[_0x57ca('0x3d')](_0x3cb979['model'],_0x3cb979[_0x57ca('0x39')]);_0x18b2da[_0x57ca('0x3e')]=_['intersection'](_0x3cb979['model'],qs[_0x57ca('0x3f')](_0x3dd2aa['query'][_0x57ca('0x3f')]));_0x18b2da['attributes']=_0x18b2da['attributes'][_0x57ca('0x40')]?_0x18b2da[_0x57ca('0x3e')]:_0x3cb979[_0x57ca('0x3a')];if(!_0x3dd2aa[_0x57ca('0x39')][_0x57ca('0x99')](_0x57ca('0x9a'))){_0x18b2da[_0x57ca('0x26')]=qs['limit'](_0x3dd2aa['query'][_0x57ca('0x26')]);_0x18b2da[_0x57ca('0x23')]=qs[_0x57ca('0x23')](_0x3dd2aa[_0x57ca('0x39')]['offset']);}_0x18b2da[_0x57ca('0x9b')]=qs[_0x57ca('0x9c')](_0x3dd2aa[_0x57ca('0x39')][_0x57ca('0x9c')]);_0x18b2da['where']=qs[_0x57ca('0x3c')](_[_0x57ca('0x9d')](_0x3dd2aa['query'],_0x3cb979[_0x57ca('0x3c')]));_0x18b2da[_0x57ca('0x9e')][_0x57ca('0x9f')]=_0x1b7cd3['id'];if(_0x3dd2aa['query'][_0x57ca('0xa0')]){_0x18b2da[_0x57ca('0x9e')]=_[_0x57ca('0x2d')](_0x18b2da[_0x57ca('0x9e')],{'$or':_[_0x57ca('0x32')](_0x18b2da[_0x57ca('0x3e')],function(_0x4f7196){var _0x22bb50={};_0x22bb50[_0x4f7196]={'$like':'%'+_0x3dd2aa[_0x57ca('0x39')][_0x57ca('0xa0')]+'%'};return _0x22bb50;})});}if(_0x3dd2aa['query'][_0x57ca('0xa1')]){var _0x5508b7=_0x3dd2aa[_0x57ca('0x39')][_0x57ca('0xa1')][_0x57ca('0xa2')](',');var _0x89f541={};_0x89f541[_0x5508b7[0x0]]={'$gte':moment(_0x5508b7[0x1])[_0x57ca('0x7a')](_0x57ca('0xa3'))};_0x18b2da[_0x57ca('0x9e')]=_[_0x57ca('0x2d')](_0x18b2da['where'],_0x89f541);}_0x18b2da=_[_0x57ca('0x2d')]({},_0x18b2da,_0x3dd2aa[_0x57ca('0xa4')]);return db['ChatMessage'][_0x57ca('0x25')]({'where':_0x18b2da['where']})[_0x57ca('0x14')](function(_0x344f6f){_0x407592[_0x57ca('0x25')]=_0x344f6f;if(_0x3dd2aa[_0x57ca('0x39')][_0x57ca('0x41')]){_0x18b2da['include']=[{'all':!![]}];}return db['ChatMessage'][_0x57ca('0x37')](_0x18b2da);})[_0x57ca('0x14')](function(_0x3fdb03){_0x407592[_0x57ca('0xa5')]=_0x3fdb03;return _0x407592;});}})['then'](respondWithFilteredResult(_0x40293e,_0x18b2da))[_0x57ca('0x1e')](handleError(_0x40293e,null));};exports[_0x57ca('0xa6')]=function(_0x3f71f2,_0x1fb929){var _0x40ce50={'where':{}},_0x50869d={},_0xafa3fe={'count':0x0,'rows':[]};return db[_0x57ca('0x33')][_0x57ca('0x49')]({'where':{'id':_0x3f71f2[_0x57ca('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fb929,null))[_0x57ca('0x14')](function(_0x31007e){if(_0x31007e){_0x50869d['model']=_[_0x57ca('0x3b')](db[_0x57ca('0x5e')][_0x57ca('0x98')]);_0x50869d['query']=_[_0x57ca('0x3b')](_0x3f71f2[_0x57ca('0x39')]);_0x50869d[_0x57ca('0x3c')]=_[_0x57ca('0x3d')](_0x50869d[_0x57ca('0x3a')],_0x50869d[_0x57ca('0x39')]);_0x40ce50[_0x57ca('0x3e')]=_['intersection'](_0x50869d[_0x57ca('0x3a')],qs[_0x57ca('0x3f')](_0x3f71f2[_0x57ca('0x39')][_0x57ca('0x3f')]));_0x40ce50['attributes']=_0x40ce50[_0x57ca('0x3e')][_0x57ca('0x40')]?_0x40ce50[_0x57ca('0x3e')]:_0x50869d['model'];if(!_0x3f71f2[_0x57ca('0x39')][_0x57ca('0x99')](_0x57ca('0x9a'))){_0x40ce50[_0x57ca('0x26')]=qs[_0x57ca('0x26')](_0x3f71f2[_0x57ca('0x39')][_0x57ca('0x26')]);_0x40ce50['offset']=qs['offset'](_0x3f71f2[_0x57ca('0x39')][_0x57ca('0x23')]);}_0x40ce50['order']=qs[_0x57ca('0x9c')](_0x3f71f2[_0x57ca('0x39')][_0x57ca('0x9c')]);_0x40ce50['where']=qs[_0x57ca('0x3c')](_[_0x57ca('0x9d')](_0x3f71f2[_0x57ca('0x39')],_0x50869d[_0x57ca('0x3c')]));_0x40ce50['where']['ChatInteractionId']=_0x31007e['id'];if(_0x3f71f2[_0x57ca('0x39')][_0x57ca('0xa0')]){_0x40ce50[_0x57ca('0x9e')]=_[_0x57ca('0x2d')](_0x40ce50['where'],{'$or':_[_0x57ca('0x32')](_0x40ce50[_0x57ca('0x3e')],function(_0x27b455){var _0x313c9e={};_0x313c9e[_0x27b455]={'$like':'%'+_0x3f71f2['query']['filter']+'%'};return _0x313c9e;})});}_0x40ce50[_0x57ca('0x9e')][_0x57ca('0x8c')]=![];if(_0x3f71f2[_0x57ca('0x39')]['id']){_0x40ce50[_0x57ca('0x9e')]['id']={'$gt':_0x3f71f2['query']['id']};}_0x40ce50=_[_0x57ca('0x2d')]({},_0x40ce50,_0x3f71f2[_0x57ca('0xa4')]);return db['ChatMessage'][_0x57ca('0x25')]({'where':_0x40ce50['where']})[_0x57ca('0x14')](function(_0x1be26a){_0xafa3fe[_0x57ca('0x25')]=_0x1be26a;_0x40ce50[_0x57ca('0x42')]=[];if(_0x3f71f2[_0x57ca('0x39')][_0x57ca('0xa7')]){_0x40ce50[_0x57ca('0x42')][_0x57ca('0xa8')]({'model':db[_0x57ca('0x7e')],'as':_0x57ca('0x7e'),'attributes':['id',_0x57ca('0x51'),'alias']});}if(_0x3f71f2['query']['includeAll']){_0x40ce50[_0x57ca('0x42')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x40ce50);})[_0x57ca('0x14')](function(_0x1af4a2){_0xafa3fe[_0x57ca('0xa5')]=_0x1af4a2;return _0xafa3fe;});}})['then'](respondWithFilteredResult(_0x1fb929,_0x40ce50))[_0x57ca('0x1e')](handleError(_0x1fb929,null));};exports[_0x57ca('0xa9')]=function(_0x262b23,_0x318adf){return db['ChatInteraction'][_0x57ca('0x43')]({'where':{'id':_0x262b23[_0x57ca('0x48')]['id']}})['then'](handleEntityNotFound(_0x318adf,null))[_0x57ca('0x14')](function(_0x20f504){if(_0x20f504){return _0x20f504[_0x57ca('0xaa')](_0x262b23[_0x57ca('0x2e')]['ids'],_['omit'](_0x262b23[_0x57ca('0x2e')],[_0x57ca('0x96'),'id'])||{})['spread'](function(){return db['Tag'][_0x57ca('0x37')]({'attributes':['id',_0x57ca('0x2b'),_0x57ca('0xab')],'where':{'id':_0x262b23[_0x57ca('0x2e')]['ids']}});})[_0x57ca('0x14')](function(_0x5e51e7){socket[_0x57ca('0xac')](_0x57ca('0xad'),{'id':Number(_0x262b23[_0x57ca('0x48')]['id']),'tags':_0x5e51e7||[]});return{'id':Number(_0x262b23[_0x57ca('0x48')]['id']),'tags':_0x5e51e7||[]};});}})['then'](respondWithResult(_0x318adf,null))[_0x57ca('0x1e')](handleError(_0x318adf,null));};exports[_0x57ca('0xae')]=function(_0x56b284,_0x4c86b1){return db[_0x57ca('0x33')]['find']({'where':{'id':_0x56b284[_0x57ca('0x48')]['id']}})[_0x57ca('0x14')](handleEntityNotFound(_0x4c86b1,null))['then'](function(_0x5809e4){if(_0x5809e4){return _0x5809e4['removeTags'](_0x56b284[_0x57ca('0x39')][_0x57ca('0x96')]);}})[_0x57ca('0x14')](respondWithStatusCode(_0x4c86b1,null))[_0x57ca('0x1e')](handleError(_0x4c86b1,null));};exports[_0x57ca('0x77')]=function(_0x4340a7,_0x3ac217){var _0x3d2771=moment()['unix']()[_0x57ca('0xaf')]();var _0x158349=path[_0x57ca('0x72')](config[_0x57ca('0x73')],_0x57ca('0xb0'),_0x57ca('0xb1'),_0x57ca('0xb2'));var _0x43585b=path[_0x57ca('0x72')](config[_0x57ca('0x73')],_0x57ca('0xb0'),_0x57ca('0xb1'),_0x57ca('0xb3'));var _0xf92680=path[_0x57ca('0x72')](_0x158349,_0x3d2771);var _0x2e895d=util[_0x57ca('0x7a')](_0x57ca('0xb4'),_0x4340a7[_0x57ca('0x48')]['id'],_0x3d2771);var _0x458c97=path[_0x57ca('0x72')](_0x158349,_0x2e895d);var _0x4fc78e=[];_0x4fc78e[_0x57ca('0xa8')]({'model':db[_0x57ca('0x7e')],'as':_0x57ca('0x7e'),'attributes':['id',_0x57ca('0x51')],'raw':!![]});_0x4fc78e[_0x57ca('0xa8')]({'model':db[_0x57ca('0x7f')],'as':_0x57ca('0x62'),'attributes':['id',_0x57ca('0xb5'),_0x57ca('0xb6')],'raw':!![]});if(_0x4340a7[_0x57ca('0x39')]['attachments']){_0x4fc78e[_0x57ca('0xa8')]({'model':db[_0x57ca('0x6f')],'as':_0x57ca('0x6f'),'raw':!![]});}var _0x4d27da=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x57ca('0x2e'),_0x57ca('0xb7'),_0x57ca('0xb8'),_0x57ca('0x8c'),_0x57ca('0xb9')],'include':_0x4fc78e}];_0x4d27da[_0x57ca('0xa8')]({'model':db[_0x57ca('0x4a')],'as':_0x57ca('0xba'),'attributes':['id',_0x57ca('0x2b')]});_0x4d27da[_0x57ca('0xa8')]({'model':db[_0x57ca('0x7e')],'as':_0x57ca('0xbb'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x57ca('0x43')]({'where':{'id':_0x4340a7[_0x57ca('0x48')]['id']},'include':_0x4d27da})[_0x57ca('0x14')](handleEntityNotFound(_0x3ac217,null))['then'](function(_0x227bb0){if(_0x227bb0){var _0x28fb12=_0x227bb0['get']({'plain':!![]});fs[_0x57ca('0xbc')](_0xf92680);var _0x648547={'channel':_0x57ca('0xbd'),'account':_0x28fb12[_0x57ca('0xba')]['name'],'agent':_0x28fb12[_0x57ca('0xbb')]?_0x28fb12[_0x57ca('0xbb')]['fullname']:'N.A.','createdAt':moment(_0x28fb12['createdAt'])[_0x57ca('0x7a')](_0x57ca('0xa3'))[_0x57ca('0xaf')](),'closedAt':_0x28fb12[_0x57ca('0x66')]?moment(_0x28fb12[_0x57ca('0xbe')])[_0x57ca('0x7a')](_0x57ca('0xa3'))[_0x57ca('0xaf')]():'','disposition':_0x28fb12['disposition'],'chatInfo':{'browser':_0x28fb12['browserName'],'os':_0x28fb12['osName'],'referer':_0x28fb12['referer'],'customerIp':_0x28fb12[_0x57ca('0xbf')],'customerPort':_0x28fb12[_0x57ca('0xc0')]?_0x28fb12[_0x57ca('0xc0')]:'N.A.'},'messages':_(_0x28fb12[_0x57ca('0x81')])['tail']()['filter']({'secret':![]})[_0x57ca('0x32')](function(_0x43260b){if(_0x43260b[_0x57ca('0x6f')]){var _0x57c6e6=path[_0x57ca('0x72')](_0x43585b,_0x43260b[_0x57ca('0x6f')][_0x57ca('0x76')]);if(fs[_0x57ca('0xc1')](_0x57c6e6)){fs[_0x57ca('0xc2')](_0x57c6e6)[_0x57ca('0xc3')](fs[_0x57ca('0xc4')](path[_0x57ca('0x72')](_0xf92680,_0x43260b[_0x57ca('0x6f')][_0x57ca('0x76')])));}}return{'date':moment(_0x43260b['createdAt'])[_0x57ca('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x57ca('0xaf')](),'sender':_0x43260b[_0x57ca('0xb8')]==='out'?_0x43260b['User']?_0x43260b[_0x57ca('0x7e')][_0x57ca('0x51')]:'System':_0x43260b[_0x57ca('0x62')][_0x57ca('0xb5')]+(_0x43260b['Contact'][_0x57ca('0xb6')]?'\x20'+_0x43260b['Contact'][_0x57ca('0xb6')]:''),'body':_0x43260b['Attachment']?_0x43260b[_0x57ca('0x6f')][_0x57ca('0x76')]:_0x43260b[_0x57ca('0x2e')],'direction':_0x43260b[_0x57ca('0xb8')]===_0x57ca('0x5d')?'A':'C','secret':_0x43260b[_0x57ca('0x8c')],'read':_0x43260b[_0x57ca('0xb9')],'attachment':_0x43260b['Attachment']};})[_0x57ca('0xc5')]()};return ejs[_0x57ca('0xc6')](path[_0x57ca('0x72')](config['root'],_0x57ca('0xb0'),_0x57ca('0xc7'),'downloadInteraction.ejs'),{'interaction':_0x648547})[_0x57ca('0x14')](function(_0x410707){var _0x15b2d7=path[_0x57ca('0x72')](_0xf92680,_0x57ca('0xc8')+_0x28fb12['id']+'-'+_0x3d2771+_0x57ca('0xc9'));var _0x4ceb9f={'path':_0x15b2d7,'channel':'Chat','interactionId':_0x28fb12['id']};return pdf['createPdfFromHTML'](_0x410707,_0x4ceb9f);})[_0x57ca('0x14')](function(){return new Promise(function(_0x38f951,_0x359364){zipdir(_0xf92680,{'saveTo':_0x458c97},function(_0x28705d,_0x463919){if(_0x28705d)return _0x359364(_0x28705d);return _0x38f951(_0x463919);});})[_0x57ca('0x14')](function(){return new BPromise(function(_0x1b8dd9,_0xc747cf){rimraf(_0xf92680,function(_0x36bde0){if(_0x36bde0)_0xc747cf(_0x36bde0);return _0x1b8dd9();});});})[_0x57ca('0x14')](function(){return _0x3ac217['download'](_0x458c97,_0x2e895d,function(_0x2276bd){if(_0x2276bd){logger[_0x57ca('0x1a')](_0x57ca('0xca'),_0x2276bd);}else{fs[_0x57ca('0xcb')](_0x458c97);}});});});}else{return _0x3ac217[_0x57ca('0x1f')](0xc8);}})[_0x57ca('0x1e')](handleError(_0x3ac217,null));}; \ No newline at end of file +var _0x5ff6=['ids','omit','hasOwnProperty','nolimit','order','sort','where','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','filter','includeAgent','push','addTags','setTags','spread','Tag','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','mkdirSync','Chat','toString','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','render','merge','contact','account','index','ChatInteraction','rawAttributes','fieldName','type','getOptions','chat','query','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','user','fullname','email','isNull','vidaooNote','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','ContactId','%s%d','System','agentIdentifier','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage'];(function(_0x56e2ed,_0x1c4781){var _0x5237b2=function(_0x587150){while(--_0x587150){_0x56e2ed['push'](_0x56e2ed['shift']());}};_0x5237b2(++_0x1c4781);}(_0x5ff6,0x106));var _0x65ff=function(_0x4dcf1c,_0x3bbf55){_0x4dcf1c=_0x4dcf1c-0x0;var _0x20fa53=_0x5ff6[_0x4dcf1c];return _0x20fa53;};'use strict';var rimraf=require(_0x65ff('0x0'));var zipdir=require('zip-dir');var rp=require(_0x65ff('0x1'));var moment=require(_0x65ff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x65ff('0x3'));var util=require(_0x65ff('0x4'));var path=require(_0x65ff('0x5'));var ejs=require(_0x65ff('0x6'));var fs=require('fs');var _=require(_0x65ff('0x7'));var Redis=require(_0x65ff('0x8'));var interaction=require(_0x65ff('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x65ff('0xa'));var logger=require(_0x65ff('0xb'))(_0x65ff('0xc'));var config=require(_0x65ff('0xd'));var db=require(_0x65ff('0xe'))['db'];config[_0x65ff('0xf')]=_[_0x65ff('0x10')](config[_0x65ff('0xf')],{'host':_0x65ff('0x11'),'port':0x18eb});var socket=require(_0x65ff('0x12'))(new Redis(config[_0x65ff('0xf')]));require(_0x65ff('0x13'))[_0x65ff('0x14')](socket);var jayson=require(_0x65ff('0x15'));var client=jayson['client'][_0x65ff('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x65ff('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x5a080d,_0x1f66f3,_0x29e2c5,_0x2b65af){return new BPromise(function(_0x53bad3,_0x57d024){var _0x4aed26=_0x2b65af||client;return _0x4aed26[_0x65ff('0x17')](_0x5a080d,_0x29e2c5)['then'](function(_0x14eab5){logger[_0x65ff('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0x65ff('0x19'));logger[_0x65ff('0x1a')](_0x65ff('0x1b'),_0x1f66f3,_0x65ff('0x19'),JSON[_0x65ff('0x1c')](_0x14eab5));if(_0x14eab5[_0x65ff('0x1d')]){if(_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1e')]===0x1f4){logger[_0x65ff('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);return _0x57d024(_0x14eab5[_0x65ff('0x1d')]['message']);}logger[_0x65ff('0x1d')](_0x65ff('0x20'),_0x1f66f3,_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);return _0x53bad3(_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);}else{logger[_0x65ff('0x18')](_0x65ff('0x20'),_0x1f66f3,'request\x20sent');_0x53bad3(_0x14eab5[_0x65ff('0x21')]['message']);}})[_0x65ff('0x22')](function(_0xb54ea){logger[_0x65ff('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0xb54ea);_0x57d024(_0xb54ea);});});}function respondWithStatusCode(_0x315db4,_0x3981e6){_0x3981e6=_0x3981e6||0xcc;return function(_0x44d125){if(_0x44d125){return _0x315db4[_0x65ff('0x23')](_0x3981e6);}return _0x315db4[_0x65ff('0x24')](_0x3981e6)[_0x65ff('0x25')]();};}function respondWithResult(_0x53cba9,_0x1fa38e){_0x1fa38e=_0x1fa38e||0xc8;return function(_0x3d9a22){if(_0x3d9a22){return _0x53cba9['status'](_0x1fa38e)[_0x65ff('0x26')](_0x3d9a22);}};}function respondWithFilteredResult(_0x328f9c,_0x1a85c4){return function(_0x4cdadb){if(_0x4cdadb){var _0x238d58=typeof _0x1a85c4[_0x65ff('0x27')]===_0x65ff('0x28')&&typeof _0x1a85c4[_0x65ff('0x29')]===_0x65ff('0x28');var _0x496e95=_0x4cdadb[_0x65ff('0x2a')];var _0x398386=_0x238d58?0x0:_0x1a85c4['offset'];var _0xbfb1d2=_0x238d58?_0x4cdadb[_0x65ff('0x2a')]:_0x1a85c4[_0x65ff('0x27')]+_0x1a85c4[_0x65ff('0x29')];var _0x33dadd;if(_0xbfb1d2>=_0x496e95){_0xbfb1d2=_0x496e95;_0x33dadd=0xc8;}else{_0x33dadd=0xce;}_0x328f9c['status'](_0x33dadd);return _0x328f9c[_0x65ff('0x2b')]('Content-Range',_0x398386+'-'+_0xbfb1d2+'/'+_0x496e95)['json'](_0x4cdadb);}return null;};}function saveUpdates(_0x141a72){return function(_0x41e6b3){if(_0x41e6b3){return _0x41e6b3[_0x65ff('0x2c')](_0x141a72)[_0x65ff('0x2d')](function(_0x2bca0c){return _0x2bca0c;});}return null;};}function removeEntity(_0x2f7660){return function(_0x4c3eb7){if(_0x4c3eb7){return _0x4c3eb7[_0x65ff('0x2e')]()[_0x65ff('0x2d')](function(){_0x2f7660['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5aee){return function(_0x16a8e8){if(!_0x16a8e8){_0x4b5aee[_0x65ff('0x23')](0x194);}return _0x16a8e8;};}function handleError(_0xb51a6d,_0x37624c){_0x37624c=_0x37624c||0x1f4;return function(_0x5cd695){logger[_0x65ff('0x1d')](_0x5cd695[_0x65ff('0x2f')]);if(_0x5cd695[_0x65ff('0x30')]){delete _0x5cd695[_0x65ff('0x30')];}_0xb51a6d[_0x65ff('0x24')](_0x37624c)['send'](_0x5cd695);};}function getMustacheRender(_0x3abec3,_0x2acdc4){return Mustache[_0x65ff('0x31')](_0x3abec3,_[_0x65ff('0x32')](_0x2acdc4['body'],{'contact':_0x2acdc4[_0x65ff('0x33')],'message':_0x2acdc4[_0x65ff('0x1f')],'agent':_0x2acdc4['agent'],'interaction':_0x2acdc4['interaction'],'account':_0x2acdc4[_0x65ff('0x34')]}))||'';}exports[_0x65ff('0x35')]=function(_0x59fe7e,_0x8255ab){var _0x273a96={};var _0x389352=_['map'](db[_0x65ff('0x36')][_0x65ff('0x37')],function(_0x445d28){return{'name':_0x445d28[_0x65ff('0x38')],'type':_0x445d28[_0x65ff('0x39')]['key']};});_0x273a96=qs[_0x65ff('0x3a')](_0x389352,_0x59fe7e);return interaction['findAll'](_0x65ff('0x3b'),_0x59fe7e[_0x65ff('0x3c')],_0x59fe7e['user'],_0x273a96,_0x389352)[_0x65ff('0x2d')](respondWithFilteredResult(_0x8255ab,_0x273a96))['catch'](handleError(_0x8255ab,null));};exports[_0x65ff('0x3d')]=function(_0x56c069,_0xb54c14){var _0x1a4058={'raw':![],'where':{'id':_0x56c069[_0x65ff('0x3e')]['id']}},_0x45017e={};_0x45017e[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db['ChatInteraction'][_0x65ff('0x37')]);_0x45017e[_0x65ff('0x3c')]=_[_0x65ff('0x40')](_0x56c069[_0x65ff('0x3c')]);_0x45017e[_0x65ff('0x41')]=_[_0x65ff('0x42')](_0x45017e[_0x65ff('0x3f')],_0x45017e[_0x65ff('0x3c')]);_0x1a4058['attributes']=_[_0x65ff('0x42')](_0x45017e[_0x65ff('0x3f')],qs[_0x65ff('0x43')](_0x56c069[_0x65ff('0x3c')][_0x65ff('0x43')]));_0x1a4058[_0x65ff('0x44')]=_0x1a4058[_0x65ff('0x44')][_0x65ff('0x45')]?_0x1a4058[_0x65ff('0x44')]:_0x45017e[_0x65ff('0x3f')];if(_0x56c069['query'][_0x65ff('0x46')]){_0x1a4058[_0x65ff('0x47')]=[{'all':!![]}];}_0x1a4058=_['merge']({},_0x1a4058,_0x56c069[_0x65ff('0x48')]);return db[_0x65ff('0x36')][_0x65ff('0x49')](_0x1a4058)['then'](handleEntityNotFound(_0xb54c14,null))[_0x65ff('0x2d')](respondWithResult(_0xb54c14,null))[_0x65ff('0x22')](handleError(_0xb54c14,null));};exports[_0x65ff('0x4a')]=function(_0x464bc3,_0x438753){return db[_0x65ff('0x36')][_0x65ff('0x4a')](_0x464bc3[_0x65ff('0x4b')],{})[_0x65ff('0x2d')](respondWithResult(_0x438753,0xc9))[_0x65ff('0x22')](handleError(_0x438753,null));};exports[_0x65ff('0x2c')]=function(_0x115335,_0x4697fe){if(_0x115335[_0x65ff('0x4b')]['id']){delete _0x115335['body']['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x115335[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x4697fe,null))[_0x65ff('0x2d')](saveUpdates(_0x115335[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](respondWithResult(_0x4697fe,null))[_0x65ff('0x22')](handleError(_0x4697fe,null));};exports[_0x65ff('0x2e')]=function(_0x302906,_0x54c566){return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x302906[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x54c566,null))[_0x65ff('0x2d')](removeEntity(_0x54c566,null))[_0x65ff('0x22')](handleError(_0x54c566,null));};exports[_0x65ff('0x4c')]=function(_0x3be640,_0x321f15){return db[_0x65ff('0x36')]['describe']()[_0x65ff('0x2d')](respondWithResult(_0x321f15,null))['catch'](handleError(_0x321f15,null));};exports[_0x65ff('0x4d')]=function(_0x1c44ad,_0x4c71d8){var _0x550b01=_0x1c44ad[_0x65ff('0x3e')]['id'];var _0x1e8da8;var _0x35647b;var _0x562c6e;return db['ChatInteraction'][_0x65ff('0x4e')]({'where':{'id':_0x550b01}})[_0x65ff('0x2d')](function(_0x30b85b){_0x1e8da8=_0x30b85b;return db['ChatWebsite'][_0x65ff('0x4e')]({'where':{'id':_0x30b85b[_0x65ff('0x4f')]},'attributes':['id',_0x65ff('0x50'),_0x65ff('0x51'),'vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x65ff('0x2d')](function(_0x423743){if(_0x423743&&_0x423743[_0x65ff('0x50')]&&_0x423743[_0x65ff('0x51')]){_0x35647b=_0x423743;var _0x59002f={'interaction':{'id':_0x550b01},'agent':{'id':_0x1c44ad[_0x65ff('0x52')]['id'],'name':_0x1c44ad[_0x65ff('0x52')]['name'],'fullname':_0x1c44ad[_0x65ff('0x52')][_0x65ff('0x53')],'email':_0x1c44ad[_0x65ff('0x52')][_0x65ff('0x54')]},'contact':_0x1c44ad['body'][_0x65ff('0x33')],'account':_0x1c44ad[_0x65ff('0x4b')][_0x65ff('0x34')]};var _0x236b79={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x423743['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c44ad['user'][_0x65ff('0x54')]],'buttons':null,'topic':_0x35647b['vidaooTopic'],'note':_[_0x65ff('0x55')](_0x35647b['vidaooNote'])?null:getMustacheRender(_0x35647b[_0x65ff('0x56')],_0x59002f),'metadata':null},'redirect':_0x65ff('0x57'),'json':!![]};try{if(!_['isNull'](_0x35647b['vidaooMetadata'])){var _0x5a7b7a=getMustacheRender(_0x35647b[_0x65ff('0x58')],_0x59002f);var _0x73b22=JSON['parse'](_0x5a7b7a);_0x236b79[_0x65ff('0x4b')][_0x65ff('0x59')]=_0x73b22;}}catch(_0x47a63c){throw new db[(_0x65ff('0x5a'))][(_0x65ff('0x5b'))](_0x65ff('0x5c'));}return rp(_0x236b79);}else{throw new db['Sequelize']['ValidationError'](_0x65ff('0x5d'));}})['then'](function(_0x26923a){_0x562c6e=_0x26923a;if(_0x562c6e['id']){var _0x30be4c={'body':_0x562c6e[_0x65ff('0x5e')],'ChatWebsiteId':_0x35647b['id'],'ChatInteractionId':_0x1e8da8['id'],'direction':_0x65ff('0x5f'),'UserId':_0x1c44ad[_0x65ff('0x52')]['id']};return db[_0x65ff('0x60')][_0x65ff('0x4a')](_0x30be4c,{});}else{throw new db['Sequelize'][(_0x65ff('0x5b'))](_0x65ff('0x61'));}})[_0x65ff('0x2d')](function(){return _0x1e8da8['updateAttributes']({'vidaooSessionId':_0x562c6e['id']});})[_0x65ff('0x2d')](respondWithResult(_0x4c71d8,null))[_0x65ff('0x22')](handleError(_0x4c71d8,null));};exports[_0x65ff('0x62')]=function(_0x395fd5,_0x38fa78){if(_0x395fd5[_0x65ff('0x4b')]['id']){delete _0x395fd5[_0x65ff('0x4b')]['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x395fd5[_0x65ff('0x3e')]['id']},'include':[{'model':db[_0x65ff('0x63')],'as':_0x65ff('0x64')}]})['then'](handleEntityNotFound(_0x38fa78,null))[_0x65ff('0x2d')](saveUpdates(_0x395fd5[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](respondWithResult(_0x38fa78,null))['catch'](handleError(_0x38fa78,null));};exports['abandon']=function(_0x2f2185,_0x546a71){if(_0x2f2185[_0x65ff('0x4b')]['id']){delete _0x2f2185[_0x65ff('0x4b')]['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x2f2185[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](function(_0x3000f9){if(!_0x3000f9){logger[_0x65ff('0x1d')](_0x65ff('0x65'),_0x65ff('0x66'),0x194,'entity\x20not\x20found');_0x546a71[_0x65ff('0x23')](0x194);}else{if(_0x3000f9[_0x65ff('0x67')]){throw new db[(_0x65ff('0x5a'))][(_0x65ff('0x5b'))](_0x65ff('0x68'));}}return _0x3000f9;})[_0x65ff('0x2d')](function(_0x4c021a){if(_0x4c021a){return _0x4c021a[_0x65ff('0x2c')]({'closed':_0x2f2185[_0x65ff('0x4b')]['closed'],'disposition':_0x2f2185['body'][_0x65ff('0x69')]})[_0x65ff('0x2d')](function(_0x2348b3){return _0x2348b3;});}})[_0x65ff('0x2d')](function(){return respondWithRpcPromise('AbandonInteraction',_0x65ff('0x66'),_0x2f2185['body'],client9004);})[_0x65ff('0x2d')](respondWithResult(_0x546a71,null))['catch'](handleError(_0x546a71,null));};exports['attachmentUpload']=function(_0x4f3ad0,_0x514ddd){_0x4f3ad0[_0x65ff('0x4b')][_0x65ff('0x30')]=_0x4f3ad0[_0x65ff('0x6a')][_0x65ff('0x6b')];_0x4f3ad0[_0x65ff('0x4b')][_0x65ff('0x6c')]=_0x4f3ad0['file'][_0x65ff('0x6d')];_0x4f3ad0['body'][_0x65ff('0x39')]=_0x4f3ad0['file'][_0x65ff('0x6e')];return db[_0x65ff('0x6f')][_0x65ff('0x4a')](_0x4f3ad0[_0x65ff('0x4b')])[_0x65ff('0x2d')](respondWithResult(_0x514ddd,0xc9))[_0x65ff('0x22')](handleError(_0x514ddd,null));};exports[_0x65ff('0x70')]=function(_0x41641a,_0x23e99a){return db[_0x65ff('0x36')][_0x65ff('0x4e')]({'where':{'id':_0x41641a[_0x65ff('0x3e')]['id']},'raw':!![]})[_0x65ff('0x2d')](handleEntityNotFound(_0x23e99a,null))['then'](function(_0xafcdcd){if(_0xafcdcd){if(_0xafcdcd[_0x65ff('0x71')]){return _0x23e99a[_0x65ff('0x24')](0x193)[_0x65ff('0x26')]({'status':0x193,'message':_0x65ff('0x72')});}return db['Attachment']['findOne']({'where':{'id':_0x41641a[_0x65ff('0x3c')][_0x65ff('0x73')]},'raw':!![]})[_0x65ff('0x2d')](handleEntityNotFound(_0x23e99a,null));}})[_0x65ff('0x2d')](function(_0x529b49){if(_0x529b49){var _0x2a0e86=_0x529b49['ChatOfflineMessageId']!==null;var _0x34d33c=path['join'](config[_0x65ff('0x74')],_0x65ff('0x75'));if(_0x2a0e86){_0x34d33c=path[_0x65ff('0x76')](_0x34d33c,_0x65ff('0x77'));}var _0x46f32a=path[_0x65ff('0x76')](_0x34d33c,_0x529b49[_0x65ff('0x6c')]);return _0x23e99a[_0x65ff('0x78')](_0x46f32a);}})[_0x65ff('0x22')](handleError(_0x23e99a,null));};exports[_0x65ff('0x79')]=function(_0x335210,_0x45f629){var _0x5a3f85=null;var _0x5da9c2=null;var _0x34a7c1=null;if(_0x335210['body']['id']){delete _0x335210[_0x65ff('0x4b')]['id'];}if(_0x335210[_0x65ff('0x4b')][_0x65ff('0x7a')]){_0x34a7c1=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0x7b'),util[_0x65ff('0x7c')](_0x65ff('0x7d'),Date[_0x65ff('0x7e')]()));_0x335210[_0x65ff('0x4b')][_0x65ff('0x7f')]=_0x34a7c1;}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x335210[_0x65ff('0x3e')]['id']},'include':[{'model':db[_0x65ff('0x60')],'as':_0x65ff('0x80'),'include':[{'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81')}]}]})[_0x65ff('0x2d')](handleEntityNotFound(_0x45f629,null))['then'](saveUpdates(_0x335210[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](function(_0x241c4a){if(_0x241c4a){_0x5a3f85=_0x241c4a;return db[_0x65ff('0x82')][_0x65ff('0x49')]({'where':{'id':_0x5a3f85['ChatWebsiteId']}});}})['then'](function(_0x47b687){if(_0x47b687){_0x5da9c2=_0x47b687;return db['CmContact']['find']({'where':{'id':_0x5a3f85[_0x65ff('0x83')]}});}})[_0x65ff('0x2d')](function(_0x5215ba){if(_0x5215ba){if(_0x34a7c1){var _0x34e4de=null;for(var _0x5370b2=0x1;_0x5370b2<_0x5a3f85[_0x65ff('0x80')][_0x65ff('0x45')];++_0x5370b2){_0x34e4de=_0x5a3f85[_0x65ff('0x80')][_0x5370b2];var _0xf44d8c=_0x34e4de['UserId']?util['format'](_0x65ff('0x84'),_0x5da9c2['agentAlias'],_0x34e4de['UserId']):_0x65ff('0x85');var _0x4d3276=_0x335210[_0x65ff('0x4b')]['customer']||util[_0x65ff('0x7c')](_0x65ff('0x84'),'Visitor',_0x34e4de[_0x65ff('0x83')]);switch(_0x5da9c2[_0x65ff('0x86')]){case'website_alias':_0xf44d8c=_0x34e4de['UserId']?util[_0x65ff('0x7c')](_0x65ff('0x84'),_0x5da9c2[_0x65ff('0x87')],_0x34e4de['UserId']):'System';break;case _0x65ff('0x88'):_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?_0x34e4de['User'][_0x65ff('0x89')]||_0x34e4de[_0x65ff('0x81')][_0x65ff('0x53')]:'System';break;case _0x65ff('0x8a'):_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?_0x34e4de[_0x65ff('0x81')][_0x65ff('0x53')]:_0x65ff('0x85');break;default:_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?util[_0x65ff('0x7c')](_0x65ff('0x84'),_0x5da9c2[_0x65ff('0x87')],_0x34e4de[_0x65ff('0x67')]):'System';}var _0x3ccf34=util[_0x65ff('0x7c')](_0x65ff('0x8b'),moment(_0x34e4de[_0x65ff('0x8c')])['format'](_0x65ff('0x8d')),_0x34e4de[_0x65ff('0x8e')]==='in'?_0x4d3276:_0xf44d8c,_0x34e4de[_0x65ff('0x4b')]);if(!_0x34e4de[_0x65ff('0x8f')]){fs[_0x65ff('0x90')](_0x34a7c1,_0x3ccf34);}}return db[_0x65ff('0x91')][_0x65ff('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x65ff('0x92')],'as':_0x65ff('0x93'),'raw':!![],'include':[{'model':db[_0x65ff('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x65ff('0x2d')](function(_0x57a2f3){if(!_0x57a2f3||!_0x57a2f3['Smtp']||!_0x335210[_0x65ff('0x4b')])return _0x5a3f85;var _0x31773f=_0x57a2f3[_0x65ff('0x95')]();return respondWithRpcPromise('SendMail',_0x65ff('0x96'),{'account':_0x31773f,'message':{'from':util['format'](_0x65ff('0x97'),_0x57a2f3[_0x65ff('0x30')],_0x57a2f3[_0x65ff('0x54')]||_0x57a2f3[_0x65ff('0x93')][_0x65ff('0x52')]),'to':_0x335210[_0x65ff('0x4b')][_0x65ff('0x7a')],'subject':_0x65ff('0x98'),'text':util[_0x65ff('0x7c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x335210['body'][_0x65ff('0x7a')]),'attachments':[{'path':_0x34a7c1}]}})['then'](function(){return _0x5a3f85;})[_0x65ff('0x22')](function(_0x592bdc){logger[_0x65ff('0x1d')](_0x592bdc);});})[_0x65ff('0x2d')](respondWithStatusCode(_0x45f629,0xc8))['catch'](handleError(_0x45f629,null));};exports['addMessage']=function(_0x39e4a2,_0x59b75a){return db['ChatMessage'][_0x65ff('0x49')]({'where':{'id':_0x39e4a2[_0x65ff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59b75a,null))[_0x65ff('0x2d')](function(_0x1441c){if(_0x1441c){return _0x1441c[_0x65ff('0x99')](_0x39e4a2[_0x65ff('0x4b')][_0x65ff('0x9a')],_[_0x65ff('0x9b')](_0x39e4a2[_0x65ff('0x4b')],['ids','id'])||{});}})[_0x65ff('0x2d')](respondWithResult(_0x59b75a,null))[_0x65ff('0x22')](handleError(_0x59b75a,null));};exports['getMessages']=function(_0x1ebc73,_0x26099d){var _0x179f06={'raw':![],'where':{}};var _0x4e5641={};var _0x587450={'count':0x0,'rows':[]};return db[_0x65ff('0x36')]['findOne']({'where':{'id':_0x1ebc73[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x26099d,null))['then'](function(_0x3ac77e){if(_0x3ac77e){_0x4e5641[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db[_0x65ff('0x60')][_0x65ff('0x37')]);_0x4e5641['query']=_[_0x65ff('0x40')](_0x1ebc73['query']);_0x4e5641['filters']=_[_0x65ff('0x42')](_0x4e5641[_0x65ff('0x3f')],_0x4e5641[_0x65ff('0x3c')]);_0x179f06['attributes']=_[_0x65ff('0x42')](_0x4e5641[_0x65ff('0x3f')],qs['fields'](_0x1ebc73['query'][_0x65ff('0x43')]));_0x179f06[_0x65ff('0x44')]=_0x179f06[_0x65ff('0x44')][_0x65ff('0x45')]?_0x179f06[_0x65ff('0x44')]:_0x4e5641[_0x65ff('0x3f')];if(!_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x9c')](_0x65ff('0x9d'))){_0x179f06['limit']=qs[_0x65ff('0x29')](_0x1ebc73['query'][_0x65ff('0x29')]);_0x179f06['offset']=qs['offset'](_0x1ebc73[_0x65ff('0x3c')]['offset']);}_0x179f06[_0x65ff('0x9e')]=qs[_0x65ff('0x9f')](_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x9f')]);_0x179f06[_0x65ff('0xa0')]=qs['filters'](_['pick'](_0x1ebc73[_0x65ff('0x3c')],_0x4e5641[_0x65ff('0x41')]));_0x179f06[_0x65ff('0xa0')]['ChatInteractionId']=_0x3ac77e['id'];if(_0x1ebc73[_0x65ff('0x3c')]['filter']){_0x179f06['where']=_[_0x65ff('0x32')](_0x179f06['where'],{'$or':_[_0x65ff('0xa1')](_0x179f06[_0x65ff('0x44')],function(_0x4f6353){var _0x5903fd={};_0x5903fd[_0x4f6353]={'$like':'%'+_0x1ebc73[_0x65ff('0x3c')]['filter']+'%'};return _0x5903fd;})});}if(_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0xa2')]){var _0x2be3db=_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0xa2')][_0x65ff('0xa3')](',');var _0x593585={};_0x593585[_0x2be3db[0x0]]={'$gte':moment(_0x2be3db[0x1])['format'](_0x65ff('0xa4'))};_0x179f06[_0x65ff('0xa0')]=_[_0x65ff('0x32')](_0x179f06[_0x65ff('0xa0')],_0x593585);}_0x179f06=_[_0x65ff('0x32')]({},_0x179f06,_0x1ebc73[_0x65ff('0x48')]);return db[_0x65ff('0x60')]['count']({'where':_0x179f06['where']})[_0x65ff('0x2d')](function(_0x2349a2){_0x587450['count']=_0x2349a2;if(_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x46')]){_0x179f06['include']=[{'all':!![]}];}return db[_0x65ff('0x60')][_0x65ff('0xa5')](_0x179f06);})[_0x65ff('0x2d')](function(_0x15a540){_0x587450[_0x65ff('0xa6')]=_0x15a540;return _0x587450;});}})[_0x65ff('0x2d')](respondWithFilteredResult(_0x26099d,_0x179f06))[_0x65ff('0x22')](handleError(_0x26099d,null));};exports[_0x65ff('0xa7')]=function(_0x33d98c,_0x1670fd){var _0x9ae205={'where':{}},_0x10bf52={},_0x522e6a={'count':0x0,'rows':[]};return db[_0x65ff('0x36')][_0x65ff('0x4e')]({'where':{'id':_0x33d98c[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x1670fd,null))['then'](function(_0x46cbe3){if(_0x46cbe3){_0x10bf52[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db[_0x65ff('0x60')][_0x65ff('0x37')]);_0x10bf52[_0x65ff('0x3c')]=_[_0x65ff('0x40')](_0x33d98c[_0x65ff('0x3c')]);_0x10bf52[_0x65ff('0x41')]=_[_0x65ff('0x42')](_0x10bf52[_0x65ff('0x3f')],_0x10bf52[_0x65ff('0x3c')]);_0x9ae205[_0x65ff('0x44')]=_['intersection'](_0x10bf52[_0x65ff('0x3f')],qs[_0x65ff('0x43')](_0x33d98c['query'][_0x65ff('0x43')]));_0x9ae205[_0x65ff('0x44')]=_0x9ae205['attributes'][_0x65ff('0x45')]?_0x9ae205[_0x65ff('0x44')]:_0x10bf52['model'];if(!_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x9c')](_0x65ff('0x9d'))){_0x9ae205[_0x65ff('0x29')]=qs[_0x65ff('0x29')](_0x33d98c['query'][_0x65ff('0x29')]);_0x9ae205['offset']=qs['offset'](_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x27')]);}_0x9ae205[_0x65ff('0x9e')]=qs[_0x65ff('0x9f')](_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x9f')]);_0x9ae205[_0x65ff('0xa0')]=qs[_0x65ff('0x41')](_[_0x65ff('0xa8')](_0x33d98c['query'],_0x10bf52[_0x65ff('0x41')]));_0x9ae205[_0x65ff('0xa0')]['ChatInteractionId']=_0x46cbe3['id'];if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xa9')]){_0x9ae205[_0x65ff('0xa0')]=_[_0x65ff('0x32')](_0x9ae205[_0x65ff('0xa0')],{'$or':_['map'](_0x9ae205[_0x65ff('0x44')],function(_0xe56200){var _0x16cdff={};_0x16cdff[_0xe56200]={'$like':'%'+_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xa9')]+'%'};return _0x16cdff;})});}_0x9ae205[_0x65ff('0xa0')][_0x65ff('0x8f')]=![];if(_0x33d98c[_0x65ff('0x3c')]['id']){_0x9ae205[_0x65ff('0xa0')]['id']={'$gt':_0x33d98c[_0x65ff('0x3c')]['id']};}_0x9ae205=_[_0x65ff('0x32')]({},_0x9ae205,_0x33d98c['options']);return db['ChatMessage'][_0x65ff('0x2a')]({'where':_0x9ae205[_0x65ff('0xa0')]})[_0x65ff('0x2d')](function(_0x212766){_0x522e6a[_0x65ff('0x2a')]=_0x212766;_0x9ae205['include']=[];if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xaa')]){_0x9ae205[_0x65ff('0x47')][_0x65ff('0xab')]({'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81'),'attributes':['id',_0x65ff('0x53'),_0x65ff('0x89')]});}if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x46')]){_0x9ae205[_0x65ff('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x65ff('0xa5')](_0x9ae205);})['then'](function(_0x438804){_0x522e6a[_0x65ff('0xa6')]=_0x438804;return _0x522e6a;});}})[_0x65ff('0x2d')](respondWithFilteredResult(_0x1670fd,_0x9ae205))[_0x65ff('0x22')](handleError(_0x1670fd,null));};exports[_0x65ff('0xac')]=function(_0x1ea5b5,_0x3fdfc5){return db[_0x65ff('0x36')]['find']({'where':{'id':_0x1ea5b5[_0x65ff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0x65ff('0x2d')](function(_0xa26331){if(_0xa26331){return _0xa26331[_0x65ff('0xad')](_0x1ea5b5[_0x65ff('0x4b')][_0x65ff('0x9a')],_[_0x65ff('0x9b')](_0x1ea5b5[_0x65ff('0x4b')],[_0x65ff('0x9a'),'id'])||{})[_0x65ff('0xae')](function(){return db[_0x65ff('0xaf')][_0x65ff('0xa5')]({'attributes':['id','name','color'],'where':{'id':_0x1ea5b5[_0x65ff('0x4b')][_0x65ff('0x9a')]}});})[_0x65ff('0x2d')](function(_0x1f1b64){socket[_0x65ff('0xb0')]('chatInteractionTags:save',{'id':Number(_0x1ea5b5['params']['id']),'tags':_0x1f1b64||[]});return{'id':Number(_0x1ea5b5['params']['id']),'tags':_0x1f1b64||[]};});}})[_0x65ff('0x2d')](respondWithResult(_0x3fdfc5,null))[_0x65ff('0x22')](handleError(_0x3fdfc5,null));};exports[_0x65ff('0xb1')]=function(_0x3534c1,_0x33f14f){return db['ChatInteraction'][_0x65ff('0x49')]({'where':{'id':_0x3534c1[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x33f14f,null))[_0x65ff('0x2d')](function(_0x1ed4b9){if(_0x1ed4b9){return _0x1ed4b9[_0x65ff('0xb1')](_0x3534c1['query'][_0x65ff('0x9a')]);}})[_0x65ff('0x2d')](respondWithStatusCode(_0x33f14f,null))[_0x65ff('0x22')](handleError(_0x33f14f,null));};exports[_0x65ff('0x78')]=function(_0x448cb7,_0x40427e){var _0x3e7fc9=moment()[_0x65ff('0xb2')]()['toString']();var _0x197f54=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0xb3'),'files',_0x65ff('0xb4'));var _0x3fa5b7=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0xb3'),_0x65ff('0xb5'),_0x65ff('0xb6'));var _0x488ce7=path[_0x65ff('0x76')](_0x197f54,_0x3e7fc9);var _0x24ae9f=util[_0x65ff('0x7c')](_0x65ff('0xb7'),_0x448cb7['params']['id'],_0x3e7fc9);var _0x55cbf9=path['join'](_0x197f54,_0x24ae9f);var _0x383fe9=[];_0x383fe9['push']({'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81'),'attributes':['id','fullname'],'raw':!![]});_0x383fe9[_0x65ff('0xab')]({'model':db[_0x65ff('0x63')],'as':_0x65ff('0x64'),'attributes':['id',_0x65ff('0xb8'),_0x65ff('0xb9')],'raw':!![]});if(_0x448cb7['query']['attachments']){_0x383fe9[_0x65ff('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x592cde=[{'model':db[_0x65ff('0x60')],'as':_0x65ff('0x80'),'attributes':['id',_0x65ff('0x4b'),_0x65ff('0x8c'),_0x65ff('0x8e'),_0x65ff('0x8f'),_0x65ff('0xba')],'include':_0x383fe9}];_0x592cde[_0x65ff('0xab')]({'model':db[_0x65ff('0x82')],'as':_0x65ff('0xbb'),'attributes':['id','name']});_0x592cde[_0x65ff('0xab')]({'model':db[_0x65ff('0x81')],'as':_0x65ff('0xbc'),'attributes':['id',_0x65ff('0x53')]});return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x448cb7[_0x65ff('0x3e')]['id']},'include':_0x592cde})[_0x65ff('0x2d')](handleEntityNotFound(_0x40427e,null))['then'](function(_0x37a3f2){if(_0x37a3f2){var _0x44f66a=_0x37a3f2['get']({'plain':!![]});fs[_0x65ff('0xbd')](_0x488ce7);var _0x3e74f2={'channel':_0x65ff('0xbe'),'account':_0x44f66a[_0x65ff('0xbb')][_0x65ff('0x30')],'agent':_0x44f66a[_0x65ff('0xbc')]?_0x44f66a[_0x65ff('0xbc')]['fullname']:'N.A.','createdAt':moment(_0x44f66a[_0x65ff('0x8c')])[_0x65ff('0x7c')](_0x65ff('0xa4'))[_0x65ff('0xbf')](),'closedAt':_0x44f66a[_0x65ff('0x71')]?moment(_0x44f66a['closedAt'])['format'](_0x65ff('0xa4'))[_0x65ff('0xbf')]():'','disposition':_0x44f66a[_0x65ff('0x69')],'chatInfo':{'browser':_0x44f66a[_0x65ff('0xc0')],'os':_0x44f66a[_0x65ff('0xc1')],'referer':_0x44f66a[_0x65ff('0xc2')],'customerIp':_0x44f66a[_0x65ff('0xc3')],'customerPort':_0x44f66a['customerPort']?_0x44f66a[_0x65ff('0xc4')]:_0x65ff('0xc5')},'messages':_(_0x44f66a['Messages'])[_0x65ff('0xc6')]()['filter']({'secret':![]})['map'](function(_0x433eea){if(_0x433eea[_0x65ff('0x6f')]){var _0x16e893=path[_0x65ff('0x76')](_0x3fa5b7,_0x433eea['Attachment']['basename']);if(fs[_0x65ff('0xc7')](_0x16e893)){fs['createReadStream'](_0x16e893)[_0x65ff('0xc8')](fs['createWriteStream'](path['join'](_0x488ce7,_0x433eea[_0x65ff('0x6f')][_0x65ff('0x6c')])));}}return{'date':moment(_0x433eea[_0x65ff('0x8c')])[_0x65ff('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x65ff('0xbf')](),'sender':_0x433eea[_0x65ff('0x8e')]===_0x65ff('0x5f')?_0x433eea['User']?_0x433eea[_0x65ff('0x81')][_0x65ff('0x53')]:_0x65ff('0x85'):_0x433eea['Contact'][_0x65ff('0xb8')]+(_0x433eea[_0x65ff('0x64')][_0x65ff('0xb9')]?'\x20'+_0x433eea[_0x65ff('0x64')][_0x65ff('0xb9')]:''),'body':_0x433eea['Attachment']?_0x433eea[_0x65ff('0x6f')][_0x65ff('0x6c')]:_0x433eea[_0x65ff('0x4b')],'direction':_0x433eea[_0x65ff('0x8e')]===_0x65ff('0x5f')?'A':'C','secret':_0x433eea[_0x65ff('0x8f')],'read':_0x433eea[_0x65ff('0xba')],'attachment':_0x433eea[_0x65ff('0x6f')]};})[_0x65ff('0xc9')]()};return ejs[_0x65ff('0xca')](path[_0x65ff('0x76')](config['root'],'server',_0x65ff('0xcb'),_0x65ff('0xcc')),{'interaction':_0x3e74f2})[_0x65ff('0x2d')](function(_0x465dad){var _0x411545=path[_0x65ff('0x76')](_0x488ce7,_0x65ff('0xcd')+_0x44f66a['id']+'-'+_0x3e7fc9+'.pdf');var _0x1f7569={'path':_0x411545,'channel':'Chat','interactionId':_0x44f66a['id']};return pdf[_0x65ff('0xce')](_0x465dad,_0x1f7569);})[_0x65ff('0x2d')](function(){return new Promise(function(_0x34d1d3,_0x5e6d2b){zipdir(_0x488ce7,{'saveTo':_0x55cbf9},function(_0x666c8a,_0x8e4709){if(_0x666c8a)return _0x5e6d2b(_0x666c8a);return _0x34d1d3(_0x8e4709);});})['then'](function(){return new BPromise(function(_0x51c634,_0x2f7be8){rimraf(_0x488ce7,function(_0xce3ee8){if(_0xce3ee8)_0x2f7be8(_0xce3ee8);return _0x51c634();});});})[_0x65ff('0x2d')](function(){return _0x40427e[_0x65ff('0x78')](_0x55cbf9,_0x24ae9f,function(_0x2cf379){if(_0x2cf379){logger[_0x65ff('0x1d')](_0x65ff('0xcf'),_0x2cf379);}else{fs['unlinkSync'](_0x55cbf9);}});});});}else{return _0x40427e[_0x65ff('0x23')](0xc8);}})[_0x65ff('0x22')](handleError(_0x40427e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 79c9557..a204d16 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5b5=['remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','catch','hasOwnProperty','exports','../../mysqldb','ChatInteraction','setMaxListeners','save','update'];(function(_0xe93def,_0x3c2c71){var _0x3f688a=function(_0x5a0bac){while(--_0x5a0bac){_0xe93def['push'](_0xe93def['shift']());}};_0x3f688a(++_0x3c2c71);}(_0xb5b5,0x15b));var _0x5b5b=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0xb5b5[_0x35ef6b];return _0x3ad145;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5b5b('0x0'))['db'][_0x5b5b('0x1')];var ChatMessage=require(_0x5b5b('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5b5b('0x2')](0x0);var events={'afterCreate':_0x5b5b('0x3'),'afterUpdate':_0x5b5b('0x4'),'afterDestroy':_0x5b5b('0x5')};function emitEvent(_0x38dc0c){return function(_0x2536d2,_0x15d8c0,_0x25d0f1){_0x2536d2[_0x5b5b('0x6')]({'attributes':['id'],'raw':!![]})[_0x5b5b('0x7')](function(_0x8b3f05){_0x2536d2[_0x5b5b('0x8')]('Users',_0x8b3f05[_0x5b5b('0x9')](function(_0x122d55){return{'id':_0x122d55['id']};}));return ChatMessage[_0x5b5b('0xa')]({'where':{'ChatInteractionId':_0x2536d2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b5b('0x7')](function(_0x1d1a13){_0x2536d2['setDataValue'](_0x5b5b('0xb'),_0x1d1a13[_0x5b5b('0xc')]);ChatInteractionEvents['emit'](_0x38dc0c+':'+_0x2536d2['id'],_0x2536d2);ChatInteractionEvents['emit'](_0x38dc0c,_0x2536d2);_0x25d0f1(null);})[_0x5b5b('0xd')](_0x25d0f1(null));};}for(var e in events){if(events[_0x5b5b('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x5b5b('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0xf9bc=['then','setDataValue','Users','map','length','emit','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xf9bc,0x159));var _0xcf9b=function(_0x156c95,_0x1760cf){_0x156c95=_0x156c95-0x0;var _0x1a8cf5=_0xf9bc[_0x156c95];return _0x1a8cf5;};'use strict';var EventEmitter=require(_0xcf9b('0x0'));var ChatInteraction=require(_0xcf9b('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xcf9b('0x1'))['db'][_0xcf9b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xcf9b('0x3')](0x0);var events={'afterCreate':_0xcf9b('0x4'),'afterUpdate':'update','afterDestroy':_0xcf9b('0x5')};function emitEvent(_0x4ce308){return function(_0x4f6890,_0xb60177,_0x957c0d){_0x4f6890[_0xcf9b('0x6')]({'attributes':['id'],'raw':!![]})[_0xcf9b('0x7')](function(_0x1fd958){_0x4f6890[_0xcf9b('0x8')](_0xcf9b('0x9'),_0x1fd958[_0xcf9b('0xa')](function(_0x42461a){return{'id':_0x42461a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4f6890['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcf9b('0x7')](function(_0x44b003){_0x4f6890['setDataValue']('unreadMessages',_0x44b003[_0xcf9b('0xb')]);ChatInteractionEvents[_0xcf9b('0xc')](_0x4ce308+':'+_0x4f6890['id'],_0x4f6890);ChatInteractionEvents[_0xcf9b('0xc')](_0x4ce308,_0x4f6890);_0x957c0d(null);})[_0xcf9b('0xd')](_0x957c0d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xcf9b('0xe')](e,emitEvent(event));}}module[_0xcf9b('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 4447401..274391f 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb902=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xbd4254,_0x31c08b){var _0x46c0f3=function(_0xd0dce7){while(--_0xd0dce7){_0xbd4254['push'](_0xbd4254['shift']());}};_0x46c0f3(++_0x31c08b);}(_0xb902,0x1e8));var _0x2b90=function(_0x379062,_0x25a617){_0x379062=_0x379062-0x0;var _0x4f9acd=_0xb902[_0x379062];return _0x4f9acd;};'use strict';var _=require(_0x2b90('0x0'));var util=require('util');var logger=require(_0x2b90('0x1'))(_0x2b90('0x2'));var moment=require(_0x2b90('0x3'));var BPromise=require(_0x2b90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b90('0x5'));var rimraf=require(_0x2b90('0x6'));var config=require(_0x2b90('0x7'));var attributes=require(_0x2b90('0x8'));module[_0x2b90('0x9')]=function(_0xb6bff4,_0x407032){return _0xb6bff4['define'](_0x2b90('0xa'),attributes,{'tableName':_0x2b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xdbef19,_0x533906,_0x356523){if(_0xdbef19[_0x2b90('0xc')]('closed')){_0xdbef19[_0x2b90('0xd')]=moment()[_0x2b90('0xe')](_0x2b90('0xf'));}_0x356523(null,_0xdbef19);}},'charset':_0x2b90('0x10'),'collate':_0x2b90('0x11')});}; \ No newline at end of file +var _0x1646=['rimraf','../../config/environment','exports','define','ChatInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','moment','bluebird','path'];(function(_0x447f05,_0x1b4295){var _0x4861ff=function(_0x2495f9){while(--_0x2495f9){_0x447f05['push'](_0x447f05['shift']());}};_0x4861ff(++_0x1b4295);}(_0x1646,0x13d));var _0x6164=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x1646[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6164('0x2'));var BPromise=require(_0x6164('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6164('0x4'));var rimraf=require(_0x6164('0x5'));var config=require(_0x6164('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x6164('0x7')]=function(_0x13b233,_0x41df49){return _0x13b233[_0x6164('0x8')](_0x6164('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x435bcd,_0x3df6ec,_0x2a9365){if(_0x435bcd[_0x6164('0xa')]('closed')){_0x435bcd[_0x6164('0xb')]=moment()['format'](_0x6164('0xc'));}_0x2a9365(null,_0x435bcd);}},'charset':_0x6164('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b659e2c..a8f568e 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf068=['redis','defaults','localhost','socket.io-emitter','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateChatInteraction','options','raw','where','attributes','limit','debug','stringify','catch','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19e317,_0x40333e){var _0x1d8b22=function(_0x51f241){while(--_0x51f241){_0x19e317['push'](_0x19e317['shift']());}};_0x1d8b22(++_0x40333e);}(_0xf068,0x153));var _0x8f06=function(_0x26d1ec,_0x35a1dd){_0x26d1ec=_0x26d1ec-0x0;var _0x1beb07=_0xf068[_0x26d1ec];return _0x1beb07;};'use strict';var _=require(_0x8f06('0x0'));var util=require(_0x8f06('0x1'));var moment=require(_0x8f06('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f06('0x3'));var fs=require('fs');var Redis=require(_0x8f06('0x4'));var db=require(_0x8f06('0x5'))['db'];var utils=require(_0x8f06('0x6'));var logger=require(_0x8f06('0x7'))(_0x8f06('0x8'));var config=require(_0x8f06('0x9'));var jayson=require(_0x8f06('0xa'));var client=jayson[_0x8f06('0xb')][_0x8f06('0xc')]({'port':0x232a});config[_0x8f06('0xd')]=_[_0x8f06('0xe')](config['redis'],{'host':_0x8f06('0xf'),'port':0x18eb});var socket=require(_0x8f06('0x10'))(new Redis(config[_0x8f06('0xd')]));require('./chatInteraction.socket')[_0x8f06('0x11')](socket);function respondWithRpcPromise(_0x5ee25d,_0x35cd92,_0x47f7c8){return new BPromise(function(_0x5c73dd,_0x4a57c1){return client['request'](_0x5ee25d,_0x47f7c8)[_0x8f06('0x12')](function(_0x13f129){logger['info'](_0x8f06('0x13'),_0x35cd92,_0x8f06('0x14'));logger['debug'](_0x8f06('0x15'),_0x35cd92,_0x8f06('0x14'),JSON['stringify'](_0x13f129));if(_0x13f129[_0x8f06('0x16')]){if(_0x13f129[_0x8f06('0x16')][_0x8f06('0x17')]===0x1f4){logger[_0x8f06('0x16')](_0x8f06('0x13'),_0x35cd92,_0x13f129[_0x8f06('0x16')]['message']);return _0x4a57c1(_0x13f129[_0x8f06('0x16')][_0x8f06('0x18')]);}logger[_0x8f06('0x16')](_0x8f06('0x13'),_0x35cd92,_0x13f129[_0x8f06('0x16')]['message']);return _0x5c73dd(_0x13f129[_0x8f06('0x16')]['message']);}else{logger[_0x8f06('0x19')](_0x8f06('0x13'),_0x35cd92,'request\x20sent');_0x5c73dd(_0x13f129[_0x8f06('0x1a')]['message']);}})['catch'](function(_0x1dd23c){logger[_0x8f06('0x16')](_0x8f06('0x13'),_0x35cd92,_0x1dd23c);_0x4a57c1(_0x1dd23c);});});}exports[_0x8f06('0x1b')]=function(_0x4088bd){var _0x3b1036=this;return new Promise(function(_0x257ea2,_0x411f6e){return db['ChatInteraction']['update'](_0x4088bd['body'],{'raw':_0x4088bd[_0x8f06('0x1c')]?_0x4088bd['options'][_0x8f06('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4088bd[_0x8f06('0x1c')]?_0x4088bd['options'][_0x8f06('0x1e')]||null:null,'attributes':_0x4088bd['options']?_0x4088bd[_0x8f06('0x1c')][_0x8f06('0x1f')]||null:null,'limit':_0x4088bd[_0x8f06('0x1c')]?_0x4088bd[_0x8f06('0x1c')][_0x8f06('0x20')]||null:null})['then'](function(_0x5b5847){logger[_0x8f06('0x19')]('UpdateChatInteraction',_0x4088bd);logger[_0x8f06('0x21')](_0x8f06('0x1b'),_0x4088bd,JSON[_0x8f06('0x22')](_0x5b5847));_0x257ea2(_0x5b5847);})[_0x8f06('0x23')](function(_0x546dfa){logger[_0x8f06('0x16')](_0x8f06('0x1b'),_0x546dfa[_0x8f06('0x18')],_0x4088bd);_0x411f6e(_0x3b1036[_0x8f06('0x16')](0x1f4,_0x546dfa[_0x8f06('0x18')]));});});};exports[_0x8f06('0x24')]=function(_0x25e02f){return new Promise(function(_0x113fb5,_0x460198){return db[_0x8f06('0x25')][_0x8f06('0x26')]({'where':_0x25e02f[_0x8f06('0x1c')]?_0x25e02f[_0x8f06('0x1c')][_0x8f06('0x1e')]||null:null})[_0x8f06('0x12')](function(_0x3a1d4c){if(_0x3a1d4c){return _0x3a1d4c[_0x8f06('0x27')](_0x25e02f['body'][_0x8f06('0x28')],_[_0x8f06('0x29')](_0x25e02f['body'],[_0x8f06('0x28'),'id'])||{});}})[_0x8f06('0x2a')](function(_0x2045b0){logger[_0x8f06('0x19')](_0x8f06('0x2b'),_0x25e02f);logger[_0x8f06('0x21')]('AddTags',_0x25e02f,JSON[_0x8f06('0x22')](_0x2045b0));_0x113fb5(_0x2045b0);})['catch'](function(_0x3021a8){logger[_0x8f06('0x16')](_0x8f06('0x2b'),_0x3021a8['message'],_0x25e02f);_0x460198(_this[_0x8f06('0x16')](0x1f4,_0x3021a8[_0x8f06('0x18')]));});});}; \ No newline at end of file +var _0x1e24=['ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34a61d,_0x1b9ab0){var _0x101e4d=function(_0x11495c){while(--_0x11495c){_0x34a61d['push'](_0x34a61d['shift']());}};_0x101e4d(++_0x1b9ab0);}(_0x1e24,0x8c));var _0x41e2=function(_0x3eb4ae,_0x493c5b){_0x3eb4ae=_0x3eb4ae-0x0;var _0x1aa0d4=_0x1e24[_0x3eb4ae];return _0x1aa0d4;};'use strict';var _=require(_0x41e2('0x0'));var util=require(_0x41e2('0x1'));var moment=require(_0x41e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x41e2('0x3'));var fs=require('fs');var Redis=require(_0x41e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41e2('0x5'));var logger=require(_0x41e2('0x6'))('rpc');var config=require(_0x41e2('0x7'));var jayson=require(_0x41e2('0x8'));var client=jayson[_0x41e2('0x9')][_0x41e2('0xa')]({'port':0x232a});config[_0x41e2('0xb')]=_['defaults'](config[_0x41e2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41e2('0xb')]));require(_0x41e2('0xc'))[_0x41e2('0xd')](socket);function respondWithRpcPromise(_0x4fd220,_0x308c49,_0xd06c3c){return new BPromise(function(_0x1e1785,_0x10113c){return client[_0x41e2('0xe')](_0x4fd220,_0xd06c3c)[_0x41e2('0xf')](function(_0x3153ed){logger[_0x41e2('0x10')](_0x41e2('0x11'),_0x308c49,_0x41e2('0x12'));logger[_0x41e2('0x13')](_0x41e2('0x14'),_0x308c49,_0x41e2('0x12'),JSON['stringify'](_0x3153ed));if(_0x3153ed[_0x41e2('0x15')]){if(_0x3153ed[_0x41e2('0x15')][_0x41e2('0x16')]===0x1f4){logger['error'](_0x41e2('0x11'),_0x308c49,_0x3153ed[_0x41e2('0x15')][_0x41e2('0x17')]);return _0x10113c(_0x3153ed[_0x41e2('0x15')]['message']);}logger[_0x41e2('0x15')](_0x41e2('0x11'),_0x308c49,_0x3153ed[_0x41e2('0x15')]['message']);return _0x1e1785(_0x3153ed['error'][_0x41e2('0x17')]);}else{logger['info'](_0x41e2('0x11'),_0x308c49,'request\x20sent');_0x1e1785(_0x3153ed[_0x41e2('0x18')]['message']);}})[_0x41e2('0x19')](function(_0x1eed85){logger['error'](_0x41e2('0x11'),_0x308c49,_0x1eed85);_0x10113c(_0x1eed85);});});}exports[_0x41e2('0x1a')]=function(_0xda20ba){var _0x471394=this;return new Promise(function(_0x309153,_0xeddbed){return db[_0x41e2('0x1b')]['update'](_0xda20ba[_0x41e2('0x1c')],{'raw':_0xda20ba['options']?_0xda20ba[_0x41e2('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba['options'][_0x41e2('0x1e')]||null:null,'attributes':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba['options'][_0x41e2('0x1f')]||null:null,'limit':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba[_0x41e2('0x1d')]['limit']||null:null})[_0x41e2('0xf')](function(_0x18d9ba){logger[_0x41e2('0x10')](_0x41e2('0x1a'),_0xda20ba);logger[_0x41e2('0x13')](_0x41e2('0x1a'),_0xda20ba,JSON[_0x41e2('0x20')](_0x18d9ba));_0x309153(_0x18d9ba);})[_0x41e2('0x19')](function(_0x5fec0f){logger[_0x41e2('0x15')](_0x41e2('0x1a'),_0x5fec0f[_0x41e2('0x17')],_0xda20ba);_0xeddbed(_0x471394[_0x41e2('0x15')](0x1f4,_0x5fec0f[_0x41e2('0x17')]));});});};exports[_0x41e2('0x21')]=function(_0x2ebf27){return new Promise(function(_0x4b3a27,_0x123fc0){return db[_0x41e2('0x1b')][_0x41e2('0x22')]({'where':_0x2ebf27[_0x41e2('0x1d')]?_0x2ebf27[_0x41e2('0x1d')][_0x41e2('0x1e')]||null:null})[_0x41e2('0xf')](function(_0x12dd4f){if(_0x12dd4f){return _0x12dd4f[_0x41e2('0x23')](_0x2ebf27[_0x41e2('0x1c')][_0x41e2('0x24')],_[_0x41e2('0x25')](_0x2ebf27[_0x41e2('0x1c')],['ids','id'])||{});}})[_0x41e2('0x26')](function(_0x331bcd){logger[_0x41e2('0x10')](_0x41e2('0x27'),_0x2ebf27);logger['debug'](_0x41e2('0x27'),_0x2ebf27,JSON[_0x41e2('0x20')](_0x331bcd));_0x4b3a27(_0x331bcd);})[_0x41e2('0x19')](function(_0xadcfdf){logger[_0x41e2('0x15')](_0x41e2('0x27'),_0xadcfdf[_0x41e2('0x17')],_0x2ebf27);_0x123fc0(_this[_0x41e2('0x15')](0x1f4,_0xadcfdf['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b06abfd..3daa133 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x447b=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update','emit'];(function(_0x19c59b,_0x559eb4){var _0x32d2f7=function(_0x492074){while(--_0x492074){_0x19c59b['push'](_0x19c59b['shift']());}};_0x32d2f7(++_0x559eb4);}(_0x447b,0xe4));var _0xb447=function(_0x3991de,_0x2ffbd1){_0x3991de=_0x3991de-0x0;var _0x24d193=_0x447b[_0x3991de];return _0x24d193;};'use strict';var ChatInteractionEvents=require(_0xb447('0x0'));var events=[_0xb447('0x1'),'remove',_0xb447('0x2')];function createListener(_0x253864,_0x2a45d2){return function(_0x2108f4){_0x2a45d2[_0xb447('0x3')](_0x253864,_0x2108f4);};}function removeListener(_0xf8a88b,_0x161c5d){return function(){ChatInteractionEvents[_0xb447('0x4')](_0xf8a88b,_0x161c5d);};}exports[_0xb447('0x5')]=function(_0x1f132a){for(var _0x514a91=0x0,_0x4e0f42=events[_0xb447('0x6')];_0x514a91<_0x4e0f42;_0x514a91++){var _0x588700=events[_0x514a91];var _0x3ea00b=createListener(_0xb447('0x7')+_0x588700,_0x1f132a);ChatInteractionEvents['on'](_0x588700,_0x3ea00b);}}; \ No newline at end of file +var _0x4992=['chatInteraction:','remove','emit','removeListener','register'];(function(_0xf94618,_0x114c5e){var _0x3b550f=function(_0xb2f0a1){while(--_0xb2f0a1){_0xf94618['push'](_0xf94618['shift']());}};_0x3b550f(++_0x114c5e);}(_0x4992,0xf1));var _0x2499=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4992[_0x413feb];return _0x40ee88;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x2499('0x0'),'update'];function createListener(_0xa4d8d8,_0x495d2b){return function(_0x491517){_0x495d2b[_0x2499('0x1')](_0xa4d8d8,_0x491517);};}function removeListener(_0x144673,_0x515056){return function(){ChatInteractionEvents[_0x2499('0x2')](_0x144673,_0x515056);};}exports[_0x2499('0x3')]=function(_0x111536){for(var _0x3a8ada=0x0,_0x41d7b2=events['length'];_0x3a8ada<_0x41d7b2;_0x3a8ada++){var _0x4f693f=events[_0x3a8ada];var _0x385f87=createListener(_0x2499('0x4')+_0x4f693f,_0x111536);ChatInteractionEvents['on'](_0x4f693f,_0x385f87);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ca6ab82..88b6668 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x037e=['/:id/tags','removeTags','multer','path','Router','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','/:id/messages','tracked','chat','addTags','put','/:id','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy'];(function(_0x2e2d89,_0x4bb615){var _0x3aba90=function(_0x9daf58){while(--_0x9daf58){_0x2e2d89['push'](_0x2e2d89['shift']());}};_0x3aba90(++_0x4bb615);}(_0x037e,0x1a0));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe037('0x0'));var util=require('util');var path=require(_0xe037('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe037('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe037('0x3'));var controller=require(_0xe037('0x4'));router[_0xe037('0x5')]('/',auth[_0xe037('0x6')](),controller[_0xe037('0x7')]);router[_0xe037('0x5')](_0xe037('0x8'),auth[_0xe037('0x6')](),controller['describe']);router[_0xe037('0x5')]('/:id',auth[_0xe037('0x9')](),controller[_0xe037('0xa')]);router[_0xe037('0x5')](_0xe037('0xb'),auth[_0xe037('0x9')](),controller[_0xe037('0xc')]);router[_0xe037('0x5')]('/:id/messages',auth[_0xe037('0x6')](),controller[_0xe037('0xd')]);router['get'](_0xe037('0xe'),auth[_0xe037('0x9')](),controller[_0xe037('0xf')]);router[_0xe037('0x5')]('/:id/download',auth['isAuthenticated'](),controller[_0xe037('0x10')]);router[_0xe037('0x11')]('/',auth[_0xe037('0x6')](),controller[_0xe037('0x12')]);router[_0xe037('0x11')](_0xe037('0x13'),auth['isAuthenticated'](),controller[_0xe037('0x14')]);var upload=multer({'storage':multer[_0xe037('0x15')]({'destination':function(_0x5ef600,_0x394259,_0x566611){_0x566611(null,path[_0xe037('0x16')](config['root'],'server/files/attachments/'));},'filename':function(_0x14fe06,_0x3161d8,_0x24b57b){_0x24b57b(null,util[_0xe037('0x17')](_0xe037('0x18'),Date[_0xe037('0x19')](),_0x3161d8[_0xe037('0x1a')][_0xe037('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe037('0x11')]('/:id/attachment_upload',upload[_0xe037('0x1c')](_0xe037('0x1d')),controller[_0xe037('0x1e')]);router[_0xe037('0x11')](_0xe037('0x1f'),auth[_0xe037('0x9')](),controller['addMessage']);router[_0xe037('0x11')]('/:id/tags',auth[_0xe037('0x6')](),interaction[_0xe037('0x20')](_0xe037('0x21'),'chatinteraction:addtags'),controller[_0xe037('0x22')]);router[_0xe037('0x23')](_0xe037('0x24'),auth[_0xe037('0x6')](),interaction[_0xe037('0x20')](_0xe037('0x21'),_0xe037('0x25')),controller['update']);router[_0xe037('0x23')](_0xe037('0x26'),controller['customUpdate']);router[_0xe037('0x23')](_0xe037('0x27'),auth['isChatInteractionAuthorized'](),controller[_0xe037('0x28')]);router[_0xe037('0x23')](_0xe037('0x29'),controller['close']);router[_0xe037('0x2a')]('/:id',auth[_0xe037('0x6')](),interaction['tracked']('chat',_0xe037('0x2b')),controller['destroy']);router['delete'](_0xe037('0x2c'),auth[_0xe037('0x6')](),controller[_0xe037('0x2d')]);module['exports']=router; \ No newline at end of file +var _0x8f68=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','tracked','delete'];(function(_0x35a19c,_0xf88bc8){var _0x25c4b5=function(_0x1a88ec){while(--_0x1a88ec){_0x35a19c['push'](_0x35a19c['shift']());}};_0x25c4b5(++_0xf88bc8);}(_0x8f68,0x145));var _0x88f6=function(_0x20bcaf,_0x26c94a){_0x20bcaf=_0x20bcaf-0x0;var _0x79f764=_0x8f68[_0x20bcaf];return _0x79f764;};'use strict';var multer=require(_0x88f6('0x0'));var util=require(_0x88f6('0x1'));var path=require(_0x88f6('0x2'));var timeout=require(_0x88f6('0x3'));var express=require(_0x88f6('0x4'));var router=express[_0x88f6('0x5')]();var fs_extra=require(_0x88f6('0x6'));var auth=require(_0x88f6('0x7'));var interaction=require(_0x88f6('0x8'));var config=require(_0x88f6('0x9'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x88f6('0xa')]);router[_0x88f6('0xb')](_0x88f6('0xc'),auth[_0x88f6('0xd')](),controller[_0x88f6('0xe')]);router[_0x88f6('0xb')](_0x88f6('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x10')]);router[_0x88f6('0xb')](_0x88f6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x12')]);router[_0x88f6('0xb')](_0x88f6('0x13'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x14')]);router[_0x88f6('0xb')](_0x88f6('0x15'),auth[_0x88f6('0x16')](),controller['getMyMessages']);router[_0x88f6('0xb')](_0x88f6('0x17'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x18')]);router[_0x88f6('0x19')]('/',auth[_0x88f6('0xd')](),controller[_0x88f6('0x1a')]);router[_0x88f6('0x19')](_0x88f6('0x1b'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x1c')]);var upload=multer({'storage':multer[_0x88f6('0x1d')]({'destination':function(_0x847c9a,_0x4d8c78,_0x3aa919){_0x3aa919(null,path[_0x88f6('0x1e')](config[_0x88f6('0x1f')],'server/files/attachments/'));},'filename':function(_0x3fc66c,_0xbd1fb7,_0xcdc50b){_0xcdc50b(null,util[_0x88f6('0x20')]('%s-%s',Date[_0x88f6('0x21')](),_0xbd1fb7['originalname'][_0x88f6('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x88f6('0x23'),upload[_0x88f6('0x24')](_0x88f6('0x25')),controller[_0x88f6('0x26')]);router[_0x88f6('0x19')](_0x88f6('0x13'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x88f6('0x19')](_0x88f6('0x27'),auth[_0x88f6('0xd')](),interaction['tracked'](_0x88f6('0x28'),_0x88f6('0x29')),controller[_0x88f6('0x2a')]);router[_0x88f6('0x2b')](_0x88f6('0xf'),auth[_0x88f6('0xd')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x88f6('0x2c')]);router[_0x88f6('0x2b')](_0x88f6('0x2d'),controller[_0x88f6('0x2e')]);router['put'](_0x88f6('0x2f'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x30')]);router[_0x88f6('0x2b')](_0x88f6('0x31'),controller[_0x88f6('0x32')]);router['delete'](_0x88f6('0xf'),auth[_0x88f6('0xd')](),interaction[_0x88f6('0x33')](_0x88f6('0x28'),'chatinteraction:destroy'),controller['destroy']);router[_0x88f6('0x34')](_0x88f6('0x27'),auth[_0x88f6('0xd')](),controller['removeTags']);module[_0x88f6('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ca5ba88..ca8dd08 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8ee=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x441fec,_0x2cba40){var _0x3ca07b=function(_0x307c67){while(--_0x307c67){_0x441fec['push'](_0x441fec['shift']());}};_0x3ca07b(++_0x2cba40);}(_0xc8ee,0x14b));var _0xec8e=function(_0x1c882f,_0x3786f6){_0x1c882f=_0x1c882f-0x0;var _0x5e01e9=_0xc8ee[_0x1c882f];return _0x5e01e9;};'use strict';var Sequelize=require(_0xec8e('0x0'));module[_0xec8e('0x1')]={'body':{'type':Sequelize['TEXT'](_0xec8e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xec8e('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xec8e('0x4')]}}; \ No newline at end of file +var _0xf78d=['TEXT','INTEGER','exports'];(function(_0x1f8d29,_0x295837){var _0x5e5adf=function(_0x533cf5){while(--_0x533cf5){_0x1f8d29['push'](_0x1f8d29['shift']());}};_0x5e5adf(++_0x295837);}(_0xf78d,0x1d0));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdf78('0x0')]={'body':{'type':Sequelize[_0xdf78('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdf78('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 081f6a8..6c7dfce 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc63e=['../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatInternalMessage','includeAll','findAll','rows','show','length','include','find','catch','create','body','params','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','user','fullname','role','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xc63e,0x130));var _0xec63=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0xc63e[_0x45346d];return _0x5ce7ca;};'use strict';var emlformat=require(_0xec63('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec63('0x1'));var jsonpatch=require(_0xec63('0x2'));var rp=require(_0xec63('0x3'));var moment=require(_0xec63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec63('0x5'));var util=require(_0xec63('0x6'));var path=require(_0xec63('0x7'));var sox=require(_0xec63('0x8'));var csv=require(_0xec63('0x9'));var ejs=require(_0xec63('0xa'));var fs=require('fs');var fs_extra=require(_0xec63('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec63('0xc'));var jsforce=require(_0xec63('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xec63('0xe'));var Papa=require('papaparse');var Redis=require(_0xec63('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec63('0x10'));var as=require(_0xec63('0x11'));var hardwareService=require(_0xec63('0x12'));var logger=require(_0xec63('0x13'))(_0xec63('0x14'));var utils=require('../../config/utils');var config=require(_0xec63('0x15'));var licenseUtil=require(_0xec63('0x16'));var db=require(_0xec63('0x17'))['db'];config[_0xec63('0x18')]=_['defaults'](config[_0xec63('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xec63('0x19'))(new Redis(config[_0xec63('0x18')]));require(_0xec63('0x1a'))[_0xec63('0x1b')](socket);function respondWithStatusCode(_0x24ed21,_0x40e2db){_0x40e2db=_0x40e2db||0xcc;return function(_0x69374b){if(_0x69374b){return _0x24ed21['sendStatus'](_0x40e2db);}return _0x24ed21['status'](_0x40e2db)['end']();};}function respondWithResult(_0x5ed4a7,_0x265f79){_0x265f79=_0x265f79||0xc8;return function(_0x40a183){if(_0x40a183){return _0x5ed4a7[_0xec63('0x1c')](_0x265f79)[_0xec63('0x1d')](_0x40a183);}};}function respondWithFilteredResult(_0x44f0c6,_0x3930ab){return function(_0x44afc1){if(_0x44afc1){var _0x375e44=typeof _0x3930ab[_0xec63('0x1e')]===_0xec63('0x1f')&&typeof _0x3930ab[_0xec63('0x20')]===_0xec63('0x1f');var _0x235f6f=_0x44afc1[_0xec63('0x21')];var _0x1b65c3=_0x375e44?0x0:_0x3930ab['offset'];var _0x3a50f4=_0x375e44?_0x44afc1[_0xec63('0x21')]:_0x3930ab[_0xec63('0x1e')]+_0x3930ab['limit'];var _0x4a6589;if(_0x3a50f4>=_0x235f6f){_0x3a50f4=_0x235f6f;_0x4a6589=0xc8;}else{_0x4a6589=0xce;}_0x44f0c6[_0xec63('0x1c')](_0x4a6589);return _0x44f0c6[_0xec63('0x22')](_0xec63('0x23'),_0x1b65c3+'-'+_0x3a50f4+'/'+_0x235f6f)[_0xec63('0x1d')](_0x44afc1);}return null;};}function patchUpdates(_0x30b186){return function(_0x25fc8f){try{jsonpatch[_0xec63('0x24')](_0x25fc8f,_0x30b186,!![]);}catch(_0x7620f5){return BPromise[_0xec63('0x25')](_0x7620f5);}return _0x25fc8f[_0xec63('0x26')]();};}function saveUpdates(_0x3b1dbd,_0x22cde2){return function(_0x4a4c6d){if(_0x4a4c6d){return _0x4a4c6d[_0xec63('0x27')](_0x3b1dbd)[_0xec63('0x28')](function(_0x26752b){return _0x26752b;});}return null;};}function removeEntity(_0x1489d6,_0x4eb3ae){return function(_0x32ae57){if(_0x32ae57){return _0x32ae57[_0xec63('0x29')]()['then'](function(){_0x1489d6[_0xec63('0x1c')](0xcc)[_0xec63('0x2a')]();});}};}function handleEntityNotFound(_0x536f45,_0x2b5852){return function(_0x45dd92){if(!_0x45dd92){_0x536f45['sendStatus'](0x194);}return _0x45dd92;};}function handleError(_0x2b4704,_0x163637){_0x163637=_0x163637||0x1f4;return function(_0x815625){logger[_0xec63('0x2b')](_0x815625[_0xec63('0x2c')]);if(_0x815625[_0xec63('0x2d')]){delete _0x815625['name'];}_0x2b4704['status'](_0x163637)[_0xec63('0x2e')](_0x815625);};}exports[_0xec63('0x2f')]=function(_0x10b21d,_0x1c9b72){var _0x52f31f={},_0x386b9e={},_0x363a01={'count':0x0,'rows':[]};var _0x58fa74=_[_0xec63('0x30')](db['ChatInternalMessage'][_0xec63('0x31')],function(_0x58266b){return{'name':_0x58266b[_0xec63('0x32')],'type':_0x58266b[_0xec63('0x33')]['key']};});_0x386b9e[_0xec63('0x34')]=_[_0xec63('0x30')](_0x58fa74,_0xec63('0x2d'));_0x386b9e[_0xec63('0x35')]=_[_0xec63('0x36')](_0x10b21d['query']);_0x386b9e[_0xec63('0x37')]=_[_0xec63('0x38')](_0x386b9e[_0xec63('0x34')],_0x386b9e['query']);_0x52f31f['attributes']=_[_0xec63('0x38')](_0x386b9e['model'],qs[_0xec63('0x39')](_0x10b21d[_0xec63('0x35')][_0xec63('0x39')]));_0x52f31f['attributes']=_0x52f31f[_0xec63('0x3a')]['length']?_0x52f31f[_0xec63('0x3a')]:_0x386b9e[_0xec63('0x34')];if(!_0x10b21d['query'][_0xec63('0x3b')](_0xec63('0x3c'))){_0x52f31f[_0xec63('0x20')]=qs[_0xec63('0x20')](_0x10b21d[_0xec63('0x35')]['limit']);_0x52f31f['offset']=qs[_0xec63('0x1e')](_0x10b21d[_0xec63('0x35')]['offset']);}_0x52f31f['order']=qs['sort'](_0x10b21d[_0xec63('0x35')][_0xec63('0x3d')]);_0x52f31f[_0xec63('0x3e')]=qs['filters'](_[_0xec63('0x3f')](_0x10b21d[_0xec63('0x35')],_0x386b9e[_0xec63('0x37')]),_0x58fa74);if(_0x10b21d[_0xec63('0x35')][_0xec63('0x40')]){_0x52f31f[_0xec63('0x3e')]=_[_0xec63('0x41')](_0x52f31f[_0xec63('0x3e')],{'$or':_[_0xec63('0x30')](_0x58fa74,function(_0x457d15){if(_0x457d15[_0xec63('0x33')]!=='VIRTUAL'){var _0x4e39c0={};_0x4e39c0[_0x457d15[_0xec63('0x2d')]]={'$like':'%'+_0x10b21d['query'][_0xec63('0x40')]+'%'};return _0x4e39c0;}})});}_0x52f31f=_['merge']({},_0x52f31f,_0x10b21d[_0xec63('0x42')]);var _0x546f02={'where':_0x52f31f[_0xec63('0x3e')]};return db[_0xec63('0x43')][_0xec63('0x21')](_0x546f02)['then'](function(_0x2d97e9){_0x363a01['count']=_0x2d97e9;if(_0x10b21d[_0xec63('0x35')][_0xec63('0x44')]){_0x52f31f['include']=[{'all':!![]}];}return db[_0xec63('0x43')][_0xec63('0x45')](_0x52f31f);})[_0xec63('0x28')](function(_0x34faf1){_0x363a01[_0xec63('0x46')]=_0x34faf1;return _0x363a01;})[_0xec63('0x28')](respondWithFilteredResult(_0x1c9b72,_0x52f31f))['catch'](handleError(_0x1c9b72,null));};exports[_0xec63('0x47')]=function(_0x3de545,_0x489146){var _0x1dfff0={'raw':!![],'where':{'id':_0x3de545['params']['id']}},_0xeec5da={};_0xeec5da[_0xec63('0x34')]=_['keys'](db[_0xec63('0x43')][_0xec63('0x31')]);_0xeec5da[_0xec63('0x35')]=_[_0xec63('0x36')](_0x3de545[_0xec63('0x35')]);_0xeec5da[_0xec63('0x37')]=_[_0xec63('0x38')](_0xeec5da['model'],_0xeec5da['query']);_0x1dfff0[_0xec63('0x3a')]=_[_0xec63('0x38')](_0xeec5da[_0xec63('0x34')],qs['fields'](_0x3de545[_0xec63('0x35')]['fields']));_0x1dfff0[_0xec63('0x3a')]=_0x1dfff0[_0xec63('0x3a')][_0xec63('0x48')]?_0x1dfff0['attributes']:_0xeec5da[_0xec63('0x34')];if(_0x3de545['query'][_0xec63('0x44')]){_0x1dfff0[_0xec63('0x49')]=[{'all':!![]}];}_0x1dfff0=_[_0xec63('0x41')]({},_0x1dfff0,_0x3de545['options']);return db[_0xec63('0x43')][_0xec63('0x4a')](_0x1dfff0)[_0xec63('0x28')](handleEntityNotFound(_0x489146,null))[_0xec63('0x28')](respondWithResult(_0x489146,null))[_0xec63('0x4b')](handleError(_0x489146,null));};exports[_0xec63('0x4c')]=function(_0x296745,_0x78e929){return db['ChatInternalMessage'][_0xec63('0x4c')](_0x296745[_0xec63('0x4d')],{})['then'](respondWithResult(_0x78e929,0xc9))[_0xec63('0x4b')](handleError(_0x78e929,null));};exports[_0xec63('0x27')]=function(_0x42d4fc,_0x4b308c){if(_0x42d4fc['body']['id']){delete _0x42d4fc[_0xec63('0x4d')]['id'];}return db[_0xec63('0x43')][_0xec63('0x4a')]({'where':{'id':_0x42d4fc[_0xec63('0x4e')]['id']}})[_0xec63('0x28')](handleEntityNotFound(_0x4b308c,null))[_0xec63('0x28')](saveUpdates(_0x42d4fc[_0xec63('0x4d')],null))['then'](respondWithResult(_0x4b308c,null))['catch'](handleError(_0x4b308c,null));};exports[_0xec63('0x29')]=function(_0x14971a,_0x35fc79){return db['ChatInternalMessage']['find']({'where':{'id':_0x14971a[_0xec63('0x4e')]['id']}})[_0xec63('0x28')](handleEntityNotFound(_0x35fc79,null))[_0xec63('0x28')](removeEntity(_0x35fc79,null))['catch'](handleError(_0x35fc79,null));};exports['describe']=function(_0x592be0,_0x599c9a){return db['ChatInternalMessage'][_0xec63('0x4f')]()[_0xec63('0x28')](respondWithResult(_0x599c9a,null))['catch'](handleError(_0x599c9a,null));};function wrapUser(_0x46eef4){return function(_0x53d306){var _0x4b4a62=_0x46eef4['get']({'plain':!![]});_0x4b4a62[_0xec63('0x50')]=[];if(_0x53d306){_0x4b4a62[_0xec63('0x51')]=_0x53d306['createdAt'];_0x4b4a62['lastMessage']=_0x53d306;}else{_0x4b4a62['lastMessageAt']=moment(0x0)[_0xec63('0x52')](_0xec63('0x53'));_0x4b4a62[_0xec63('0x54')]={};}return _0x4b4a62;};}exports[_0xec63('0x55')]=function(_0x4db48d,_0x2344db,_0x2b065e){var _0x253f56=[];return db['User']['findAll']({'where':{'role':['agent','admin',_0xec63('0x56')]},'attributes':['id',_0xec63('0x57'),_0xec63('0x2d'),_0xec63('0x58'),'userpic',_0xec63('0x59'),_0xec63('0x5a'),_0xec63('0x5b'),'allowmessenger',_0xec63('0x5c')],'order':qs[_0xec63('0x3d')]('-online'),'include':[{'model':db[_0xec63('0x5d')],'as':_0xec63('0x5e'),'attributes':['id',_0xec63('0x2d'),'type'],'through':{'attributes':[]}}]})[_0xec63('0x28')](function(_0x320477){if(_0x320477){var _0x24d4b8=_0x4db48d[_0xec63('0x56')][_0xec63('0x5f')]({'plain':!![]});if(!_0x24d4b8)throw new Error(_0xec63('0x60'));if(_0x24d4b8[_0xec63('0x58')]===_0xec63('0x56')){return db[_0xec63('0x61')]['find']({'where':{'name':_0xec63('0x62'),'userProfileId':_0x24d4b8['userProfileId']},'raw':!![]})['then'](function(_0x3b6a0f){if(_0x3b6a0f){if(_0x3b6a0f[_0xec63('0x63')]===0x0){return db[_0xec63('0x64')]['findAll']({'where':{'sectionId':_0x3b6a0f['id']},'raw':!![]})[_0xec63('0x28')](function(_0x4d8579){var _0x18f71f=[];if(_[_0xec63('0x65')](_0x4d8579)){_0x18f71f=_['filter'](_0x320477,function(_0x15e82d){if(_0x15e82d[_0xec63('0x58')]!==_0xec63('0x66')){return _0x15e82d;}});return _0x18f71f;}else{for(var _0x527976=0x0;_0x527976<_0x320477['length'];_0x527976++){var _0xd5957a=_0x320477[_0x527976];if(_0xd5957a[_0xec63('0x58')]===_0xec63('0x66')){var _0x2e304f=_[_0xec63('0x4a')](_0x4d8579,function(_0x159e39){return _0x159e39[_0xec63('0x67')]===_0xd5957a['id'];});if(_0x2e304f)_0x18f71f['push'](_0xd5957a);}else{_0x18f71f[_0xec63('0x68')](_0xd5957a);}}return _0x18f71f;}});}else{return _0x320477;}}else{var _0x562272=_['filter'](_0x320477,function(_0x346e2f){if(_0x346e2f['role']!=='agent'){return _0x346e2f;}});return _0x562272;}});}else{return _0x320477;}}})[_0xec63('0x28')](function(_0xba3826){var _0x2d1971=[];if(_0xba3826){_0x253f56=_0xba3826;for(var _0x38d731=0x0;_0x38d731<_0xba3826[_0xec63('0x48')];_0x38d731+=0x1){_0x253f56[_0x38d731][_0xec63('0x50')]=[];_0x2d1971[_0xec63('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x4db48d[_0xec63('0x56')]['id'],_0xba3826[_0x38d731]['id']],'ToId':[_0x4db48d['user']['id'],_0xba3826[_0x38d731]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xec63('0x69'),_0xec63('0x6a'),_0xec63('0x4d')],'order':qs['sort'](_0xec63('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xec63('0x28')](wrapUser(_0xba3826[_0x38d731])));}return BPromise[_0xec63('0x6c')](_0x2d1971);}return[];})['then'](function(_0x4bd79d){return{'rows':_0x4bd79d,'count':_0x4bd79d[_0xec63('0x48')]};})['then'](respondWithResult(_0x2344db,null))[_0xec63('0x4b')](handleError(_0x2344db,null));}; \ No newline at end of file +var _0xe0c5=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','get','role','UserProfileSection','Agents','isEmpty','resourceId','push','FromId','ToId','read','sort','-createdAt','all','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','error','name','map','ChatInternalMessage','fieldName','type','key'];(function(_0x2036d2,_0x57e925){var _0x1d8e18=function(_0x28d3e6){while(--_0x28d3e6){_0x2036d2['push'](_0x2036d2['shift']());}};_0x1d8e18(++_0x57e925);}(_0xe0c5,0x1dc));var _0x5e0c=function(_0x26fcfd,_0x2af46f){_0x26fcfd=_0x26fcfd-0x0;var _0x234f68=_0xe0c5[_0x26fcfd];return _0x234f68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e0c('0x0'));var rp=require(_0x5e0c('0x1'));var moment=require(_0x5e0c('0x2'));var BPromise=require(_0x5e0c('0x3'));var Mustache=require(_0x5e0c('0x4'));var util=require('util');var path=require(_0x5e0c('0x5'));var sox=require(_0x5e0c('0x6'));var csv=require('to-csv');var ejs=require(_0x5e0c('0x7'));var fs=require('fs');var fs_extra=require(_0x5e0c('0x8'));var _=require(_0x5e0c('0x9'));var squel=require(_0x5e0c('0xa'));var crypto=require('crypto');var jsforce=require(_0x5e0c('0xb'));var deskjs=require(_0x5e0c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5e0c('0xd'));var Papa=require(_0x5e0c('0xe'));var Redis=require(_0x5e0c('0xf'));var authService=require(_0x5e0c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e0c('0x11'));var hardwareService=require(_0x5e0c('0x12'));var logger=require(_0x5e0c('0x13'))('api');var utils=require(_0x5e0c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5e0c('0x15'));var db=require('../../mysqldb')['db'];config[_0x5e0c('0x16')]=_[_0x5e0c('0x17')](config[_0x5e0c('0x16')],{'host':_0x5e0c('0x18'),'port':0x18eb});var socket=require(_0x5e0c('0x19'))(new Redis(config[_0x5e0c('0x16')]));require(_0x5e0c('0x1a'))[_0x5e0c('0x1b')](socket);function respondWithStatusCode(_0x3c16a1,_0x15d46e){_0x15d46e=_0x15d46e||0xcc;return function(_0x1c043b){if(_0x1c043b){return _0x3c16a1[_0x5e0c('0x1c')](_0x15d46e);}return _0x3c16a1[_0x5e0c('0x1d')](_0x15d46e)[_0x5e0c('0x1e')]();};}function respondWithResult(_0x586adc,_0x1ff2ec){_0x1ff2ec=_0x1ff2ec||0xc8;return function(_0x54885d){if(_0x54885d){return _0x586adc['status'](_0x1ff2ec)[_0x5e0c('0x1f')](_0x54885d);}};}function respondWithFilteredResult(_0x239004,_0x559c59){return function(_0x214f87){if(_0x214f87){var _0x182d16=typeof _0x559c59[_0x5e0c('0x20')]==='undefined'&&typeof _0x559c59[_0x5e0c('0x21')]===_0x5e0c('0x22');var _0xdb6533=_0x214f87[_0x5e0c('0x23')];var _0x24293f=_0x182d16?0x0:_0x559c59['offset'];var _0xe80815=_0x182d16?_0x214f87['count']:_0x559c59[_0x5e0c('0x20')]+_0x559c59['limit'];var _0x223d80;if(_0xe80815>=_0xdb6533){_0xe80815=_0xdb6533;_0x223d80=0xc8;}else{_0x223d80=0xce;}_0x239004[_0x5e0c('0x1d')](_0x223d80);return _0x239004[_0x5e0c('0x24')]('Content-Range',_0x24293f+'-'+_0xe80815+'/'+_0xdb6533)[_0x5e0c('0x1f')](_0x214f87);}return null;};}function patchUpdates(_0x35d159){return function(_0x3afc5e){try{jsonpatch[_0x5e0c('0x25')](_0x3afc5e,_0x35d159,!![]);}catch(_0x263f4c){return BPromise[_0x5e0c('0x26')](_0x263f4c);}return _0x3afc5e['save']();};}function saveUpdates(_0x3df838,_0x5b475a){return function(_0x22dbcf){if(_0x22dbcf){return _0x22dbcf[_0x5e0c('0x27')](_0x3df838)['then'](function(_0x47bb1f){return _0x47bb1f;});}return null;};}function removeEntity(_0xb3b4f4,_0x3c55f0){return function(_0x548149){if(_0x548149){return _0x548149[_0x5e0c('0x28')]()[_0x5e0c('0x29')](function(){_0xb3b4f4[_0x5e0c('0x1d')](0xcc)[_0x5e0c('0x1e')]();});}};}function handleEntityNotFound(_0x3ed0fd,_0x4b802e){return function(_0x4ef4d3){if(!_0x4ef4d3){_0x3ed0fd[_0x5e0c('0x1c')](0x194);}return _0x4ef4d3;};}function handleError(_0x26a4f5,_0x32674d){_0x32674d=_0x32674d||0x1f4;return function(_0x167a39){logger[_0x5e0c('0x2a')](_0x167a39['stack']);if(_0x167a39[_0x5e0c('0x2b')]){delete _0x167a39[_0x5e0c('0x2b')];}_0x26a4f5[_0x5e0c('0x1d')](_0x32674d)['send'](_0x167a39);};}exports['index']=function(_0x2d41e4,_0x5e3ae3){var _0xb2161f={},_0x2d1d9b={},_0x3724f5={'count':0x0,'rows':[]};var _0x4a94fd=_[_0x5e0c('0x2c')](db[_0x5e0c('0x2d')]['rawAttributes'],function(_0x2b1041){return{'name':_0x2b1041[_0x5e0c('0x2e')],'type':_0x2b1041[_0x5e0c('0x2f')][_0x5e0c('0x30')]};});_0x2d1d9b[_0x5e0c('0x31')]=_[_0x5e0c('0x2c')](_0x4a94fd,_0x5e0c('0x2b'));_0x2d1d9b['query']=_[_0x5e0c('0x32')](_0x2d41e4[_0x5e0c('0x33')]);_0x2d1d9b[_0x5e0c('0x34')]=_[_0x5e0c('0x35')](_0x2d1d9b[_0x5e0c('0x31')],_0x2d1d9b[_0x5e0c('0x33')]);_0xb2161f[_0x5e0c('0x36')]=_[_0x5e0c('0x35')](_0x2d1d9b[_0x5e0c('0x31')],qs['fields'](_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x37')]));_0xb2161f[_0x5e0c('0x36')]=_0xb2161f[_0x5e0c('0x36')][_0x5e0c('0x38')]?_0xb2161f[_0x5e0c('0x36')]:_0x2d1d9b[_0x5e0c('0x31')];if(!_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x39')]('nolimit')){_0xb2161f[_0x5e0c('0x21')]=qs[_0x5e0c('0x21')](_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x21')]);_0xb2161f[_0x5e0c('0x20')]=qs['offset'](_0x2d41e4[_0x5e0c('0x33')]['offset']);}_0xb2161f['order']=qs['sort'](_0x2d41e4[_0x5e0c('0x33')]['sort']);_0xb2161f[_0x5e0c('0x3a')]=qs['filters'](_[_0x5e0c('0x3b')](_0x2d41e4[_0x5e0c('0x33')],_0x2d1d9b[_0x5e0c('0x34')]),_0x4a94fd);if(_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x3c')]){_0xb2161f[_0x5e0c('0x3a')]=_[_0x5e0c('0x3d')](_0xb2161f[_0x5e0c('0x3a')],{'$or':_[_0x5e0c('0x2c')](_0x4a94fd,function(_0x2a25cf){if(_0x2a25cf[_0x5e0c('0x2f')]!==_0x5e0c('0x3e')){var _0x12ff65={};_0x12ff65[_0x2a25cf[_0x5e0c('0x2b')]]={'$like':'%'+_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x3c')]+'%'};return _0x12ff65;}})});}_0xb2161f=_['merge']({},_0xb2161f,_0x2d41e4[_0x5e0c('0x3f')]);var _0x4d1de1={'where':_0xb2161f['where']};return db['ChatInternalMessage'][_0x5e0c('0x23')](_0x4d1de1)[_0x5e0c('0x29')](function(_0x2ebf17){_0x3724f5[_0x5e0c('0x23')]=_0x2ebf17;if(_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x40')]){_0xb2161f[_0x5e0c('0x41')]=[{'all':!![]}];}return db[_0x5e0c('0x2d')][_0x5e0c('0x42')](_0xb2161f);})['then'](function(_0x1e28a4){_0x3724f5[_0x5e0c('0x43')]=_0x1e28a4;return _0x3724f5;})[_0x5e0c('0x29')](respondWithFilteredResult(_0x5e3ae3,_0xb2161f))[_0x5e0c('0x44')](handleError(_0x5e3ae3,null));};exports[_0x5e0c('0x45')]=function(_0x2c80a3,_0x3fc5d8){var _0x27103f={'raw':!![],'where':{'id':_0x2c80a3['params']['id']}},_0x51fb51={};_0x51fb51[_0x5e0c('0x31')]=_[_0x5e0c('0x32')](db[_0x5e0c('0x2d')]['rawAttributes']);_0x51fb51[_0x5e0c('0x33')]=_[_0x5e0c('0x32')](_0x2c80a3[_0x5e0c('0x33')]);_0x51fb51[_0x5e0c('0x34')]=_['intersection'](_0x51fb51['model'],_0x51fb51[_0x5e0c('0x33')]);_0x27103f[_0x5e0c('0x36')]=_['intersection'](_0x51fb51[_0x5e0c('0x31')],qs[_0x5e0c('0x37')](_0x2c80a3[_0x5e0c('0x33')][_0x5e0c('0x37')]));_0x27103f[_0x5e0c('0x36')]=_0x27103f[_0x5e0c('0x36')]['length']?_0x27103f['attributes']:_0x51fb51[_0x5e0c('0x31')];if(_0x2c80a3[_0x5e0c('0x33')]['includeAll']){_0x27103f[_0x5e0c('0x41')]=[{'all':!![]}];}_0x27103f=_['merge']({},_0x27103f,_0x2c80a3[_0x5e0c('0x3f')]);return db[_0x5e0c('0x2d')][_0x5e0c('0x46')](_0x27103f)[_0x5e0c('0x29')](handleEntityNotFound(_0x3fc5d8,null))[_0x5e0c('0x29')](respondWithResult(_0x3fc5d8,null))['catch'](handleError(_0x3fc5d8,null));};exports[_0x5e0c('0x47')]=function(_0x568df2,_0x3c5f10){return db['ChatInternalMessage'][_0x5e0c('0x47')](_0x568df2[_0x5e0c('0x48')],{})[_0x5e0c('0x29')](respondWithResult(_0x3c5f10,0xc9))['catch'](handleError(_0x3c5f10,null));};exports[_0x5e0c('0x27')]=function(_0x2c3a0a,_0x506e3b){if(_0x2c3a0a[_0x5e0c('0x48')]['id']){delete _0x2c3a0a['body']['id'];}return db[_0x5e0c('0x2d')][_0x5e0c('0x46')]({'where':{'id':_0x2c3a0a[_0x5e0c('0x49')]['id']}})[_0x5e0c('0x29')](handleEntityNotFound(_0x506e3b,null))['then'](saveUpdates(_0x2c3a0a[_0x5e0c('0x48')],null))[_0x5e0c('0x29')](respondWithResult(_0x506e3b,null))['catch'](handleError(_0x506e3b,null));};exports[_0x5e0c('0x28')]=function(_0x25986a,_0x7553d9){return db[_0x5e0c('0x2d')]['find']({'where':{'id':_0x25986a[_0x5e0c('0x49')]['id']}})[_0x5e0c('0x29')](handleEntityNotFound(_0x7553d9,null))[_0x5e0c('0x29')](removeEntity(_0x7553d9,null))['catch'](handleError(_0x7553d9,null));};exports[_0x5e0c('0x4a')]=function(_0x22699c,_0xf09940){return db[_0x5e0c('0x2d')][_0x5e0c('0x4a')]()[_0x5e0c('0x29')](respondWithResult(_0xf09940,null))[_0x5e0c('0x44')](handleError(_0xf09940,null));};function wrapUser(_0x11852c){return function(_0x381cef){var _0x244cfb=_0x11852c['get']({'plain':!![]});_0x244cfb[_0x5e0c('0x4b')]=[];if(_0x381cef){_0x244cfb['lastMessageAt']=_0x381cef[_0x5e0c('0x4c')];_0x244cfb['lastMessage']=_0x381cef;}else{_0x244cfb[_0x5e0c('0x4d')]=moment(0x0)[_0x5e0c('0x4e')](_0x5e0c('0x4f'));_0x244cfb[_0x5e0c('0x50')]={};}return _0x244cfb;};}exports[_0x5e0c('0x51')]=function(_0x4cd955,_0x14bb70,_0x50f440){var _0x1b5f23=[];return db[_0x5e0c('0x52')][_0x5e0c('0x42')]({'where':{'role':[_0x5e0c('0x53'),_0x5e0c('0x54'),_0x5e0c('0x55')]},'attributes':['id','fullname',_0x5e0c('0x2b'),'role','userpic',_0x5e0c('0x56'),_0x5e0c('0x57'),_0x5e0c('0x58'),_0x5e0c('0x59'),_0x5e0c('0x5a')],'order':qs['sort']('-online'),'include':[{'model':db[_0x5e0c('0x5b')],'as':'VoiceQueues','attributes':['id',_0x5e0c('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x5e0c('0x29')](function(_0x26c95d){if(_0x26c95d){var _0x39f97a=_0x4cd955['user'][_0x5e0c('0x5c')]({'plain':!![]});if(!_0x39f97a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39f97a[_0x5e0c('0x5d')]===_0x5e0c('0x55')){return db[_0x5e0c('0x5e')][_0x5e0c('0x46')]({'where':{'name':_0x5e0c('0x5f'),'userProfileId':_0x39f97a['userProfileId']},'raw':!![]})[_0x5e0c('0x29')](function(_0x46e4a5){if(_0x46e4a5){if(_0x46e4a5['autoAssociation']===0x0){return db['UserProfileResource'][_0x5e0c('0x42')]({'where':{'sectionId':_0x46e4a5['id']},'raw':!![]})['then'](function(_0x31c19){var _0x436670=[];if(_[_0x5e0c('0x60')](_0x31c19)){_0x436670=_['filter'](_0x26c95d,function(_0x2ff586){if(_0x2ff586[_0x5e0c('0x5d')]!==_0x5e0c('0x53')){return _0x2ff586;}});return _0x436670;}else{for(var _0x19a5fd=0x0;_0x19a5fd<_0x26c95d['length'];_0x19a5fd++){var _0x2b79ba=_0x26c95d[_0x19a5fd];if(_0x2b79ba[_0x5e0c('0x5d')]===_0x5e0c('0x53')){var _0x9b7452=_['find'](_0x31c19,function(_0x315dd7){return _0x315dd7[_0x5e0c('0x61')]===_0x2b79ba['id'];});if(_0x9b7452)_0x436670['push'](_0x2b79ba);}else{_0x436670['push'](_0x2b79ba);}}return _0x436670;}});}else{return _0x26c95d;}}else{var _0x1403c7=_[_0x5e0c('0x3c')](_0x26c95d,function(_0x22665d){if(_0x22665d[_0x5e0c('0x5d')]!==_0x5e0c('0x53')){return _0x22665d;}});return _0x1403c7;}});}else{return _0x26c95d;}}})['then'](function(_0x2de3c9){var _0x2b291a=[];if(_0x2de3c9){_0x1b5f23=_0x2de3c9;for(var _0x5df3b1=0x0;_0x5df3b1<_0x2de3c9['length'];_0x5df3b1+=0x1){_0x1b5f23[_0x5df3b1]['messages']=[];_0x2b291a[_0x5e0c('0x62')](db[_0x5e0c('0x2d')][_0x5e0c('0x46')]({'where':{'FromId':[_0x4cd955[_0x5e0c('0x55')]['id'],_0x2de3c9[_0x5df3b1]['id']],'ToId':[_0x4cd955[_0x5e0c('0x55')]['id'],_0x2de3c9[_0x5df3b1]['id']],'ChatGroupId':null},'attributes':['id',_0x5e0c('0x4c'),_0x5e0c('0x63'),_0x5e0c('0x64'),_0x5e0c('0x65'),_0x5e0c('0x48')],'order':qs[_0x5e0c('0x66')](_0x5e0c('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5e0c('0x29')](wrapUser(_0x2de3c9[_0x5df3b1])));}return BPromise[_0x5e0c('0x68')](_0x2b291a);}return[];})[_0x5e0c('0x29')](function(_0xb4ceea){return{'rows':_0xb4ceea,'count':_0xb4ceea[_0x5e0c('0x38')]};})['then'](respondWithResult(_0x14bb70,null))[_0x5e0c('0x44')](handleError(_0x14bb70,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f5ce002..873b0a3 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6b0=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','hasOwnProperty','hook','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd6b0,0x13b));var _0x0d6b=function(_0x3f8e06,_0x21d03f){_0x3f8e06=_0x3f8e06-0x0;var _0x209adf=_0xd6b0[_0x3f8e06];return _0x209adf;};'use strict';var EventEmitter=require(_0x0d6b('0x0'));var ChatInternalMessage=require(_0x0d6b('0x1'))['db'][_0x0d6b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0d6b('0x3')](0x0);var events={'afterCreate':_0x0d6b('0x4'),'afterUpdate':'update','afterDestroy':_0x0d6b('0x5')};function emitEvent(_0x5ae368){return function(_0x227e7c,_0x15ef52,_0x49211f){ChatInternalMessageEvents['emit'](_0x5ae368+':'+_0x227e7c['id'],_0x227e7c);ChatInternalMessageEvents['emit'](_0x5ae368,_0x227e7c);_0x49211f(null);};}for(var e in events){if(events[_0x0d6b('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0d6b('0x7')](e,emitEvent(event));}}module[_0x0d6b('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3a00=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f3195,_0xd55489){var _0x5a16fb=function(_0x3d1aad){while(--_0x3d1aad){_0x2f3195['push'](_0x2f3195['shift']());}};_0x5a16fb(++_0xd55489);}(_0x3a00,0xe0));var _0x03a0=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x3a00[_0x587dd0];return _0x56f153;};'use strict';var EventEmitter=require(_0x03a0('0x0'));var ChatInternalMessage=require(_0x03a0('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03a0('0x2')](0x0);var events={'afterCreate':_0x03a0('0x3'),'afterUpdate':'update','afterDestroy':_0x03a0('0x4')};function emitEvent(_0x479cc7){return function(_0x2b6f3a,_0x36a480,_0x3769ca){ChatInternalMessageEvents[_0x03a0('0x5')](_0x479cc7+':'+_0x2b6f3a['id'],_0x2b6f3a);ChatInternalMessageEvents['emit'](_0x479cc7,_0x2b6f3a);_0x3769ca(null);};}for(var e in events){if(events[_0x03a0('0x6')](e)){var event=events[e];ChatInternalMessage[_0x03a0('0x7')](e,emitEvent(event));}}module[_0x03a0('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 19c98c0..74d4c32 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c34=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7c34,0xdb));var _0x47c3=function(_0x29e637,_0x13f9f0){_0x29e637=_0x29e637-0x0;var _0x5bd3a4=_0x7c34[_0x29e637];return _0x5bd3a4;};'use strict';var _=require(_0x47c3('0x0'));var util=require(_0x47c3('0x1'));var logger=require('../../config/logger')(_0x47c3('0x2'));var moment=require(_0x47c3('0x3'));var BPromise=require(_0x47c3('0x4'));var rp=require(_0x47c3('0x5'));var fs=require('fs');var path=require(_0x47c3('0x6'));var rimraf=require(_0x47c3('0x7'));var config=require(_0x47c3('0x8'));var attributes=require(_0x47c3('0x9'));module[_0x47c3('0xa')]=function(_0x386cc6,_0x16bde3){return _0x386cc6[_0x47c3('0xb')](_0x47c3('0xc'),attributes,{'tableName':_0x47c3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x47c3('0xe')});}; \ No newline at end of file +var _0xa580=['util','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash'];(function(_0x531ad4,_0x4fdd92){var _0x37fa11=function(_0x2d9e9d){while(--_0x2d9e9d){_0x531ad4['push'](_0x531ad4['shift']());}};_0x37fa11(++_0x4fdd92);}(_0xa580,0x107));var _0x0a58=function(_0x13d6ac,_0x3cc744){_0x13d6ac=_0x13d6ac-0x0;var _0x5f2e28=_0xa580[_0x13d6ac];return _0x5f2e28;};'use strict';var _=require(_0x0a58('0x0'));var util=require(_0x0a58('0x1'));var logger=require('../../config/logger')(_0x0a58('0x2'));var moment=require('moment');var BPromise=require(_0x0a58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a58('0x4'));var rimraf=require(_0x0a58('0x5'));var config=require(_0x0a58('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x0a58('0x7')]=function(_0x235cb3,_0x3f4883){return _0x235cb3[_0x0a58('0x8')](_0x0a58('0x9'),attributes,{'tableName':_0x0a58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a58('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index c1bafc2..3ba2dea 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabcb=['http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x37f03a,_0x568501){var _0x4f6ad3=function(_0x4e6422){while(--_0x4e6422){_0x37f03a['push'](_0x37f03a['shift']());}};_0x4f6ad3(++_0x568501);}(_0xabcb,0xf9));var _0xbabc=function(_0x64c2e7,_0x4f757c){_0x64c2e7=_0x64c2e7-0x0;var _0x3ecb19=_0xabcb[_0x64c2e7];return _0x3ecb19;};'use strict';var _=require('lodash');var util=require(_0xbabc('0x0'));var moment=require(_0xbabc('0x1'));var BPromise=require(_0xbabc('0x2'));var rs=require(_0xbabc('0x3'));var fs=require('fs');var Redis=require(_0xbabc('0x4'));var db=require(_0xbabc('0x5'))['db'];var utils=require(_0xbabc('0x6'));var logger=require(_0xbabc('0x7'))(_0xbabc('0x8'));var config=require(_0xbabc('0x9'));var jayson=require(_0xbabc('0xa'));var client=jayson[_0xbabc('0xb')][_0xbabc('0xc')]({'port':0x232a});config[_0xbabc('0xd')]=_[_0xbabc('0xe')](config[_0xbabc('0xd')],{'host':_0xbabc('0xf'),'port':0x18eb});var socket=require(_0xbabc('0x10'))(new Redis(config[_0xbabc('0xd')]));require(_0xbabc('0x11'))['register'](socket);function respondWithRpcPromise(_0x290cb8,_0xf6ac41,_0xa4305c){return new BPromise(function(_0x4bd932,_0x3d5240){return client[_0xbabc('0x12')](_0x290cb8,_0xa4305c)[_0xbabc('0x13')](function(_0x41d379){logger['info'](_0xbabc('0x14'),_0xf6ac41,_0xbabc('0x15'));logger[_0xbabc('0x16')](_0xbabc('0x17'),_0xf6ac41,_0xbabc('0x15'),JSON[_0xbabc('0x18')](_0x41d379));if(_0x41d379[_0xbabc('0x19')]){if(_0x41d379['error'][_0xbabc('0x1a')]===0x1f4){logger[_0xbabc('0x19')](_0xbabc('0x14'),_0xf6ac41,_0x41d379['error'][_0xbabc('0x1b')]);return _0x3d5240(_0x41d379[_0xbabc('0x19')][_0xbabc('0x1b')]);}logger[_0xbabc('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6ac41,_0x41d379[_0xbabc('0x19')]['message']);return _0x4bd932(_0x41d379[_0xbabc('0x19')][_0xbabc('0x1b')]);}else{logger['info'](_0xbabc('0x14'),_0xf6ac41,'request\x20sent');_0x4bd932(_0x41d379[_0xbabc('0x1c')][_0xbabc('0x1b')]);}})['catch'](function(_0x9ea880){logger['error'](_0xbabc('0x14'),_0xf6ac41,_0x9ea880);_0x3d5240(_0x9ea880);});});} \ No newline at end of file +var _0xf3aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment'];(function(_0x58674c,_0x3c35a6){var _0x4102a3=function(_0x2d7031){while(--_0x2d7031){_0x58674c['push'](_0x58674c['shift']());}};_0x4102a3(++_0x3c35a6);}(_0xf3aa,0x16a));var _0xaf3a=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xf3aa[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0xaf3a('0x0'));var util=require('util');var moment=require(_0xaf3a('0x1'));var BPromise=require(_0xaf3a('0x2'));var rs=require(_0xaf3a('0x3'));var fs=require('fs');var Redis=require(_0xaf3a('0x4'));var db=require(_0xaf3a('0x5'))['db'];var utils=require(_0xaf3a('0x6'));var logger=require(_0xaf3a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf3a('0x8')][_0xaf3a('0x9')]({'port':0x232a});config[_0xaf3a('0xa')]=_[_0xaf3a('0xb')](config['redis'],{'host':_0xaf3a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf3a('0xa')]));require(_0xaf3a('0xd'))[_0xaf3a('0xe')](socket);function respondWithRpcPromise(_0x11d0dc,_0x403a69,_0x449086){return new BPromise(function(_0x35be54,_0x452123){return client[_0xaf3a('0xf')](_0x11d0dc,_0x449086)[_0xaf3a('0x10')](function(_0x2083f9){logger['info'](_0xaf3a('0x11'),_0x403a69,'request\x20sent');logger['debug'](_0xaf3a('0x12'),_0x403a69,_0xaf3a('0x13'),JSON['stringify'](_0x2083f9));if(_0x2083f9[_0xaf3a('0x14')]){if(_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x15')]===0x1f4){logger['error'](_0xaf3a('0x11'),_0x403a69,_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x16')]);return _0x452123(_0x2083f9['error'][_0xaf3a('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x403a69,_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x16')]);return _0x35be54(_0x2083f9[_0xaf3a('0x14')]['message']);}else{logger[_0xaf3a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x403a69,_0xaf3a('0x13'));_0x35be54(_0x2083f9[_0xaf3a('0x18')]['message']);}})[_0xaf3a('0x19')](function(_0x178183){logger['error'](_0xaf3a('0x11'),_0x403a69,_0x178183);_0x452123(_0x178183);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 618e049..f34e170 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef78=['chatInternalMessage:','./chatInternalMessage.events','removeListener','length'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xef78,0x75));var _0x8ef7=function(_0x1bf0c9,_0x5bc860){_0x1bf0c9=_0x1bf0c9-0x0;var _0x44093a=_0xef78[_0x1bf0c9];return _0x44093a;};'use strict';var ChatInternalMessageEvents=require(_0x8ef7('0x0'));var events=['save','remove','update'];function createListener(_0x206f1f,_0x4c919d){return function(_0x5a151b){_0x4c919d['emit'](_0x206f1f,_0x5a151b);};}function removeListener(_0x2c0585,_0xab20a9){return function(){ChatInternalMessageEvents[_0x8ef7('0x1')](_0x2c0585,_0xab20a9);};}exports['register']=function(_0x5e5e33){for(var _0x551b63=0x0,_0x2714a4=events[_0x8ef7('0x2')];_0x551b63<_0x2714a4;_0x551b63++){var _0x5ca6fb=events[_0x551b63];var _0xb8cb40=createListener(_0x8ef7('0x3')+_0x5ca6fb,_0x5e5e33);ChatInternalMessageEvents['on'](_0x5ca6fb,_0xb8cb40);}}; \ No newline at end of file +var _0x84a7=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x84a7,0x137));var _0x784a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x84a7[_0x122ef9];return _0x42fba0;};'use strict';var ChatInternalMessageEvents=require(_0x784a('0x0'));var events=['save',_0x784a('0x1'),_0x784a('0x2')];function createListener(_0x54ff97,_0x58ba95){return function(_0xf6d0e6){_0x58ba95[_0x784a('0x3')](_0x54ff97,_0xf6d0e6);};}function removeListener(_0x3ae353,_0x4a31cd){return function(){ChatInternalMessageEvents[_0x784a('0x4')](_0x3ae353,_0x4a31cd);};}exports['register']=function(_0x287db9){for(var _0x1d3ac7=0x0,_0x5562e=events[_0x784a('0x5')];_0x1d3ac7<_0x5562e;_0x1d3ac7++){var _0x4d6e30=events[_0x1d3ac7];var _0x3c8ea1=createListener(_0x784a('0x6')+_0x4d6e30,_0x287db9);ChatInternalMessageEvents['on'](_0x4d6e30,_0x3c8ea1);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 1810f67..5b94e03 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49dc=['exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','destroy'];(function(_0x21ff2d,_0x1b4383){var _0x5823d4=function(_0x2adecf){while(--_0x2adecf){_0x21ff2d['push'](_0x21ff2d['shift']());}};_0x5823d4(++_0x1b4383);}(_0x49dc,0x1ee));var _0xc49d=function(_0x1737e5,_0x544887){_0x1737e5=_0x1737e5-0x0;var _0x610e07=_0x49dc[_0x1737e5];return _0x610e07;};'use strict';var multer=require(_0xc49d('0x0'));var util=require('util');var path=require(_0xc49d('0x1'));var timeout=require('connect-timeout');var express=require(_0xc49d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc49d('0x3'));var interaction=require(_0xc49d('0x4'));var config=require('../../config/environment');var controller=require(_0xc49d('0x5'));router['get']('/',auth[_0xc49d('0x6')](),controller[_0xc49d('0x7')]);router[_0xc49d('0x8')]('/describe',auth[_0xc49d('0x6')](),controller[_0xc49d('0x9')]);router['get']('/users',auth[_0xc49d('0x6')](),controller['getUsers']);router[_0xc49d('0x8')](_0xc49d('0xa'),auth[_0xc49d('0x6')](),controller[_0xc49d('0xb')]);router[_0xc49d('0xc')]('/',auth[_0xc49d('0x6')](),controller[_0xc49d('0xd')]);router[_0xc49d('0xe')](_0xc49d('0xa'),controller['update']);router['delete'](_0xc49d('0xa'),auth[_0xc49d('0x6')](),controller[_0xc49d('0xf')]);module[_0xc49d('0x10')]=router; \ No newline at end of file +var _0x7bd7=['isAuthenticated','index','/describe','describe','/users','show','post','create','put','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x7bd7,0x1c4));var _0x77bd=function(_0x528ef8,_0x1b1681){_0x528ef8=_0x528ef8-0x0;var _0x68c11b=_0x7bd7[_0x528ef8];return _0x68c11b;};'use strict';var multer=require(_0x77bd('0x0'));var util=require(_0x77bd('0x1'));var path=require(_0x77bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x77bd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x77bd('0x4'));var interaction=require(_0x77bd('0x5'));var config=require(_0x77bd('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x77bd('0x7')]('/',auth[_0x77bd('0x8')](),controller[_0x77bd('0x9')]);router[_0x77bd('0x7')](_0x77bd('0xa'),auth[_0x77bd('0x8')](),controller[_0x77bd('0xb')]);router[_0x77bd('0x7')](_0x77bd('0xc'),auth[_0x77bd('0x8')](),controller['getUsers']);router['get']('/:id',auth[_0x77bd('0x8')](),controller[_0x77bd('0xd')]);router[_0x77bd('0xe')]('/',auth['isAuthenticated'](),controller[_0x77bd('0xf')]);router[_0x77bd('0x10')]('/:id',controller['update']);router['delete'](_0x77bd('0x11'),auth[_0x77bd('0x8')](),controller[_0x77bd('0x12')]);module[_0x77bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b86b93e..2062bbb 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1707=['BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x1707,0x1df));var _0x7170=function(_0x4c1842,_0x10bd93){_0x4c1842=_0x4c1842-0x0;var _0x5d2791=_0x1707[_0x4c1842];return _0x5d2791;};'use strict';var Sequelize=require(_0x7170('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7170('0x2')),'defaultValue':_0x7170('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7170('0x3')]},'providerName':{'type':Sequelize[_0x7170('0x4')]},'providerResponse':{'type':Sequelize[_0x7170('0x5')]}}; \ No newline at end of file +var _0x33d2=['STRING','sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x33d2,0x7f));var _0x233d=function(_0x333160,_0x4c1df7){_0x333160=_0x333160-0x0;var _0x256d5a=_0x33d2[_0x333160];return _0x256d5a;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'body':{'type':Sequelize[_0x233d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x233d('0x4')),'defaultValue':_0x233d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x233d('0x5')]},'providerName':{'type':Sequelize[_0x233d('0x6')]},'providerResponse':{'type':Sequelize[_0x233d('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index a927a56..eae0b93 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x685f=['motionChannel','acceptmessage','merge','formData','params','ChatInteractionId','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','event','parse','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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','apply','reject','update','end','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','VIRTUAL','options','count','includeAll','findAll','rows','show','keys','find','create','body','destroy','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel'];(function(_0x28df99,_0x17d032){var _0x5978bf=function(_0x6606bd){while(--_0x6606bd){_0x28df99['push'](_0x28df99['shift']());}};_0x5978bf(++_0x17d032);}(_0x685f,0x120));var _0xf685=function(_0x3b4ed1,_0xf2ca19){_0x3b4ed1=_0x3b4ed1-0x0;var _0x23497e=_0x685f[_0x3b4ed1];return _0x23497e;};'use strict';var emlformat=require(_0xf685('0x0'));var rimraf=require(_0xf685('0x1'));var zipdir=require(_0xf685('0x2'));var jsonpatch=require(_0xf685('0x3'));var rp=require(_0xf685('0x4'));var moment=require(_0xf685('0x5'));var BPromise=require(_0xf685('0x6'));var Mustache=require(_0xf685('0x7'));var util=require(_0xf685('0x8'));var path=require(_0xf685('0x9'));var sox=require(_0xf685('0xa'));var csv=require(_0xf685('0xb'));var ejs=require(_0xf685('0xc'));var fs=require('fs');var fs_extra=require(_0xf685('0xd'));var _=require(_0xf685('0xe'));var squel=require(_0xf685('0xf'));var crypto=require(_0xf685('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf685('0x11'));var toCsv=require(_0xf685('0xb'));var querystring=require(_0xf685('0x12'));var Papa=require(_0xf685('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf685('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf685('0x15'));var logger=require(_0xf685('0x16'))(_0xf685('0x17'));var utils=require(_0xf685('0x18'));var config=require(_0xf685('0x19'));var licenseUtil=require(_0xf685('0x1a'));var db=require(_0xf685('0x1b'))['db'];config['redis']=_[_0xf685('0x1c')](config[_0xf685('0x1d')],{'host':_0xf685('0x1e'),'port':0x18eb});var socket=require(_0xf685('0x1f'))(new Redis(config[_0xf685('0x1d')]));require('./chatMessage.socket')[_0xf685('0x20')](socket);var jayson=require(_0xf685('0x21'));var client=jayson[_0xf685('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xf685('0x22')][_0xf685('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x3da4a9,_0x42df89,_0x111a65,_0x26c72c){return new BPromise(function(_0xd29a0f,_0x1e6957){var _0x4d3057=_0x26c72c||client;return _0x4d3057[_0xf685('0x24')](_0x3da4a9,_0x111a65)[_0xf685('0x25')](function(_0x12c94f){logger[_0xf685('0x26')](_0xf685('0x27'),_0x42df89,_0xf685('0x28'));logger[_0xf685('0x29')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x42df89,_0xf685('0x28'),JSON[_0xf685('0x2a')](_0x12c94f));if(_0x12c94f['error']){if(_0x12c94f[_0xf685('0x2b')][_0xf685('0x2c')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x42df89,_0x12c94f[_0xf685('0x2b')]['message']);return _0x1e6957(_0x12c94f['error'][_0xf685('0x2d')]);}logger[_0xf685('0x2b')](_0xf685('0x27'),_0x42df89,_0x12c94f[_0xf685('0x2b')][_0xf685('0x2d')]);return _0xd29a0f(_0x12c94f[_0xf685('0x2b')][_0xf685('0x2d')]);}else{logger[_0xf685('0x26')](_0xf685('0x27'),_0x42df89,_0xf685('0x28'));_0xd29a0f(_0x12c94f[_0xf685('0x2e')][_0xf685('0x2d')]);}})[_0xf685('0x2f')](function(_0x452224){logger['error'](_0xf685('0x27'),_0x42df89,_0x452224);_0x1e6957(_0x452224);});});}function respondWithStatusCode(_0x28bb1d,_0x4872f2){_0x4872f2=_0x4872f2||0xcc;return function(_0x328d85){if(_0x328d85){return _0x28bb1d[_0xf685('0x30')](_0x4872f2);}return _0x28bb1d[_0xf685('0x31')](_0x4872f2)['end']();};}function respondWithResult(_0x2ccfb5,_0x2290b8){_0x2290b8=_0x2290b8||0xc8;return function(_0x52d27e){if(_0x52d27e){return _0x2ccfb5[_0xf685('0x31')](_0x2290b8)[_0xf685('0x32')](_0x52d27e);}};}function respondWithFilteredResult(_0xf150fb,_0x5ad969){return function(_0x165775){if(_0x165775){var _0x121220=typeof _0x5ad969[_0xf685('0x33')]==='undefined'&&typeof _0x5ad969['limit']===_0xf685('0x34');var _0x4e9d6d=_0x165775['count'];var _0x1c1ae8=_0x121220?0x0:_0x5ad969[_0xf685('0x33')];var _0x4bb3bf=_0x121220?_0x165775['count']:_0x5ad969[_0xf685('0x33')]+_0x5ad969['limit'];var _0x94df1;if(_0x4bb3bf>=_0x4e9d6d){_0x4bb3bf=_0x4e9d6d;_0x94df1=0xc8;}else{_0x94df1=0xce;}_0xf150fb[_0xf685('0x31')](_0x94df1);return _0xf150fb['set']('Content-Range',_0x1c1ae8+'-'+_0x4bb3bf+'/'+_0x4e9d6d)[_0xf685('0x32')](_0x165775);}return null;};}function patchUpdates(_0x549ad7){return function(_0x4f4ed8){try{jsonpatch[_0xf685('0x35')](_0x4f4ed8,_0x549ad7,!![]);}catch(_0x171097){return BPromise[_0xf685('0x36')](_0x171097);}return _0x4f4ed8['save']();};}function saveUpdates(_0xbddf16,_0xb24ce4){return function(_0x1378e5){if(_0x1378e5){return _0x1378e5[_0xf685('0x37')](_0xbddf16)[_0xf685('0x25')](function(_0x43afaf){return _0x43afaf;});}return null;};}function removeEntity(_0x5105bf,_0x405986){return function(_0x44c09b){if(_0x44c09b){return _0x44c09b['destroy']()[_0xf685('0x25')](function(){_0x5105bf[_0xf685('0x31')](0xcc)[_0xf685('0x38')]();});}};}function handleEntityNotFound(_0x1575ac,_0x2754a6){return function(_0x51e23b){if(!_0x51e23b){_0x1575ac[_0xf685('0x30')](0x194);}return _0x51e23b;};}function handleError(_0x47674c,_0x5db033){_0x5db033=_0x5db033||0x1f4;return function(_0x547d60){logger[_0xf685('0x2b')](_0x547d60[_0xf685('0x39')]);if(_0x547d60[_0xf685('0x3a')]){delete _0x547d60['name'];}_0x47674c[_0xf685('0x31')](_0x5db033)[_0xf685('0x3b')](_0x547d60);};}exports[_0xf685('0x3c')]=function(_0x4ec810,_0x4fefdd){var _0x741f24={},_0x2076f6={},_0x2296e7={'count':0x0,'rows':[]};var _0x5224da=_['map'](db[_0xf685('0x3d')][_0xf685('0x3e')],function(_0x59a94f){return{'name':_0x59a94f[_0xf685('0x3f')],'type':_0x59a94f[_0xf685('0x40')][_0xf685('0x41')]};});_0x2076f6[_0xf685('0x42')]=_[_0xf685('0x43')](_0x5224da,_0xf685('0x3a'));_0x2076f6[_0xf685('0x44')]=_['keys'](_0x4ec810[_0xf685('0x44')]);_0x2076f6['filters']=_[_0xf685('0x45')](_0x2076f6['model'],_0x2076f6[_0xf685('0x44')]);_0x741f24[_0xf685('0x46')]=_[_0xf685('0x45')](_0x2076f6[_0xf685('0x42')],qs[_0xf685('0x47')](_0x4ec810['query'][_0xf685('0x47')]));_0x741f24[_0xf685('0x46')]=_0x741f24[_0xf685('0x46')][_0xf685('0x48')]?_0x741f24['attributes']:_0x2076f6[_0xf685('0x42')];if(!_0x4ec810['query'][_0xf685('0x49')](_0xf685('0x4a'))){_0x741f24[_0xf685('0x4b')]=qs[_0xf685('0x4b')](_0x4ec810[_0xf685('0x44')][_0xf685('0x4b')]);_0x741f24[_0xf685('0x33')]=qs[_0xf685('0x33')](_0x4ec810[_0xf685('0x44')][_0xf685('0x33')]);}_0x741f24[_0xf685('0x4c')]=qs['sort'](_0x4ec810[_0xf685('0x44')][_0xf685('0x4d')]);_0x741f24['where']=qs[_0xf685('0x4e')](_[_0xf685('0x4f')](_0x4ec810[_0xf685('0x44')],_0x2076f6[_0xf685('0x4e')]),_0x5224da);if(_0x4ec810[_0xf685('0x44')][_0xf685('0x50')]){_0x741f24[_0xf685('0x51')]=_['merge'](_0x741f24[_0xf685('0x51')],{'$or':_[_0xf685('0x43')](_0x5224da,function(_0x42d76b){if(_0x42d76b[_0xf685('0x40')]!==_0xf685('0x52')){var _0x5e763d={};_0x5e763d[_0x42d76b[_0xf685('0x3a')]]={'$like':'%'+_0x4ec810[_0xf685('0x44')]['filter']+'%'};return _0x5e763d;}})});}_0x741f24=_['merge']({},_0x741f24,_0x4ec810[_0xf685('0x53')]);var _0x349ee4={'where':_0x741f24[_0xf685('0x51')]};return db[_0xf685('0x3d')][_0xf685('0x54')](_0x349ee4)['then'](function(_0x1773af){_0x2296e7[_0xf685('0x54')]=_0x1773af;if(_0x4ec810[_0xf685('0x44')][_0xf685('0x55')]){_0x741f24['include']=[{'all':!![]}];}return db[_0xf685('0x3d')][_0xf685('0x56')](_0x741f24);})['then'](function(_0xcd5a5a){_0x2296e7[_0xf685('0x57')]=_0xcd5a5a;return _0x2296e7;})[_0xf685('0x25')](respondWithFilteredResult(_0x4fefdd,_0x741f24))[_0xf685('0x2f')](handleError(_0x4fefdd,null));};exports[_0xf685('0x58')]=function(_0x5ea657,_0x444ee4){var _0x1d86d0={'raw':!![],'where':{'id':_0x5ea657['params']['id']}},_0x5c5a17={};_0x5c5a17[_0xf685('0x42')]=_[_0xf685('0x59')](db['ChatMessage'][_0xf685('0x3e')]);_0x5c5a17[_0xf685('0x44')]=_[_0xf685('0x59')](_0x5ea657[_0xf685('0x44')]);_0x5c5a17[_0xf685('0x4e')]=_[_0xf685('0x45')](_0x5c5a17['model'],_0x5c5a17['query']);_0x1d86d0['attributes']=_[_0xf685('0x45')](_0x5c5a17['model'],qs[_0xf685('0x47')](_0x5ea657[_0xf685('0x44')][_0xf685('0x47')]));_0x1d86d0[_0xf685('0x46')]=_0x1d86d0[_0xf685('0x46')]['length']?_0x1d86d0['attributes']:_0x5c5a17[_0xf685('0x42')];if(_0x5ea657[_0xf685('0x44')]['includeAll']){_0x1d86d0['include']=[{'all':!![]}];}_0x1d86d0=_['merge']({},_0x1d86d0,_0x5ea657[_0xf685('0x53')]);return db['ChatMessage'][_0xf685('0x5a')](_0x1d86d0)['then'](handleEntityNotFound(_0x444ee4,null))[_0xf685('0x25')](respondWithResult(_0x444ee4,null))[_0xf685('0x2f')](handleError(_0x444ee4,null));};exports[_0xf685('0x5b')]=function(_0x197b78,_0x26ffff){return db[_0xf685('0x3d')]['create'](_0x197b78[_0xf685('0x5c')],{})[_0xf685('0x25')](respondWithResult(_0x26ffff,0xc9))['catch'](handleError(_0x26ffff,null));};exports[_0xf685('0x37')]=function(_0x760a4b,_0x5efe9a){if(_0x760a4b[_0xf685('0x5c')]['id']){delete _0x760a4b[_0xf685('0x5c')]['id'];}return db[_0xf685('0x3d')][_0xf685('0x5a')]({'where':{'id':_0x760a4b['params']['id']}})['then'](handleEntityNotFound(_0x5efe9a,null))['then'](saveUpdates(_0x760a4b['body'],null))[_0xf685('0x25')](respondWithResult(_0x5efe9a,null))['catch'](handleError(_0x5efe9a,null));};exports[_0xf685('0x5d')]=function(_0x513fd4,_0x462382){return db[_0xf685('0x3d')][_0xf685('0x5a')]({'where':{'id':_0x513fd4['params']['id']}})[_0xf685('0x25')](handleEntityNotFound(_0x462382,null))[_0xf685('0x25')](removeEntity(_0x462382,null))[_0xf685('0x2f')](handleError(_0x462382,null));};exports[_0xf685('0x5e')]=function(_0xd59889,_0x31d8a0){return db[_0xf685('0x3d')][_0xf685('0x5e')]()['then'](respondWithResult(_0x31d8a0,null))[_0xf685('0x2f')](handleError(_0x31d8a0,null));};var interaction_log=require('../../config/logger')(_0xf685('0x5f'));exports[_0xf685('0x60')]=function(_0x1e2731,_0x504715,_0x1d62d5){var _0x305b2b={'agent':{},'channel':_0xf685('0x61')};if(_0x1e2731[_0xf685('0x5c')]['id']){delete _0x1e2731[_0xf685('0x5c')]['id'];}_0x1e2731[_0xf685('0x5c')][_0xf685('0x62')]=!![];_0x1e2731['body'][_0xf685('0x63')]=moment()[_0xf685('0x64')](_0xf685('0x65'));_0x1e2731[_0xf685('0x5c')][_0xf685('0x66')]=_0x1e2731['body'][_0xf685('0x66')]||_0x1e2731[_0xf685('0x67')]['id'];_0x305b2b['agent']['id']=_0x1e2731[_0xf685('0x5c')][_0xf685('0x66')];return db[_0xf685('0x3d')]['find']({'where':{'id':_0x1e2731['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x504715,null))[_0xf685('0x25')](saveUpdates(_0x1e2731[_0xf685('0x5c')],null))[_0xf685('0x25')](function(_0x432d67){if(_0x432d67){_0x305b2b['message']=_0x432d67['get']({'plain':!![]});return db[_0xf685('0x68')][_0xf685('0x5a')]({'where':{'id':_0x432d67['ChatInteractionId']}});}return null;})[_0xf685('0x25')](handleEntityNotFound(_0x504715,null))[_0xf685('0x25')](function(_0x49b241){if(_0x49b241){return _0x49b241[_0xf685('0x37')]({'UserId':_0x1e2731[_0xf685('0x5c')][_0xf685('0x66')],'read1stAt':_['isNil'](_0x49b241[_0xf685('0x69')])?moment()[_0xf685('0x64')](_0xf685('0x65')):undefined});}return null;})[_0xf685('0x25')](function(_0x227f49){if(_0x227f49){_0x305b2b['interaction']=_0x227f49['get']({'plain':!![]});interaction_log['info'](_0xf685('0x6a'),_0x1e2731['user']['id'],_0x1e2731[_0xf685('0x67')][_0xf685('0x3a')],_0x1e2731[_0xf685('0x67')][_0xf685('0x6b')],_0x305b2b[_0xf685('0x6c')]['id'],_0x1e2731[_0xf685('0x5c')]?JSON[_0xf685('0x2a')](_0x1e2731[_0xf685('0x5c')]):_0xf685('0x6d'));return respondWithRpcPromise(_0xf685('0x6e'),_0xf685('0x6f'),_0x305b2b);}return null;})[_0xf685('0x25')](function(_0xc536d2){var _0x4f0e2f=_0xf685('0x70')+_0xc536d2[_0xf685('0x2d')][_0xf685('0x71')];return db[_0xf685('0x72')][_0xf685('0x44')](_0x4f0e2f,{'type':db[_0xf685('0x73')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf685('0x25')](function(_0x5d6b2f){return _0x5d6b2f;});})[_0xf685('0x25')](function(_0x1e132e){if(_0x1e132e){_0x305b2b['message'][_0xf685('0x74')]=_0x1e132e[0x0];if(!_0x1e2731['body']['UserId'])return;return db[_0xf685('0x75')][_0xf685('0x5a')]({'where':{'id':_0x1e2731[_0xf685('0x5c')][_0xf685('0x66')],'role':_0xf685('0x76')},'attributes':['id',_0xf685('0x3a'),_0xf685('0x77'),_0xf685('0x78'),_0xf685('0x79')],'raw':!![]});}return null;})['then'](function(_0x2d6943){if(!_0x2d6943)return null;_0x305b2b[_0xf685('0x2d')][_0xf685('0x76')]=_0x2d6943;return _0x305b2b;})[_0xf685('0x25')](function(_0x16defb){if(_0x16defb){if(_0x1e2731[_0xf685('0x5c')][_0xf685('0x7a')]){_0x305b2b[_0xf685('0x2d')][_0xf685('0x7b')]=util[_0xf685('0x64')](_0xf685('0x7c'),_0x1e2731[_0xf685('0x67')][_0xf685('0x3a')]);_0x305b2b['message'][_0xf685('0x7d')]=_0x305b2b[_0xf685('0x7d')];_0x305b2b['message'][_0xf685('0x7e')]=_0x305b2b[_0xf685('0x7d')];_0x305b2b['message']['event']=_0xf685('0x60');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xf685('0x7f'),'message':_[_0xf685('0x80')](_0x305b2b[_0xf685('0x2d')],JSON['parse'](_0x305b2b[_0xf685('0x6c')][_0xf685('0x81')]))},client9002)['then'](function(){return _0x305b2b;});}return _0x305b2b;}return null;})[_0xf685('0x25')](respondWithResult(_0x504715,null))['catch'](handleError(_0x504715,null));};var interaction_log=require('../../config/logger')(_0xf685('0x5f'));exports[_0xf685('0x36')]=function(_0x1750c8,_0x32f4bd,_0x71b3ef){var _0x1cae38={'agent':{},'channel':'chat'};if(_0x1750c8[_0xf685('0x5c')]['id']){delete _0x1750c8['body']['id'];}_0x1750c8[_0xf685('0x5c')][_0xf685('0x66')]=_0x1750c8['body'][_0xf685('0x66')]||_0x1750c8[_0xf685('0x67')]['id'];_0x1cae38[_0xf685('0x76')]['id']=_0x1750c8['body'][_0xf685('0x66')];return db['ChatMessage'][_0xf685('0x5a')]({'where':{'id':_0x1750c8[_0xf685('0x82')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32f4bd,null))[_0xf685('0x25')](function(_0x26f014){if(_0x26f014){_0x1cae38[_0xf685('0x2d')]=_0x26f014['get']({'plain':!![]});return db[_0xf685('0x68')][_0xf685('0x5a')]({'where':{'id':_0x26f014[_0xf685('0x83')]}});}return null;})[_0xf685('0x25')](handleEntityNotFound(_0x32f4bd,null))[_0xf685('0x25')](function(_0x5b17ed){if(_0x5b17ed){_0x1cae38[_0xf685('0x6c')]=_0x5b17ed[_0xf685('0x84')]({'plain':!![]});interaction_log[_0xf685('0x26')](_0xf685('0x85'),_0x1750c8[_0xf685('0x67')]['id'],_0x1750c8[_0xf685('0x67')][_0xf685('0x3a')],_0x1750c8[_0xf685('0x67')][_0xf685('0x6b')],_0x1cae38['interaction']['id'],_0x1750c8[_0xf685('0x5c')]?JSON[_0xf685('0x2a')](_0x1750c8[_0xf685('0x5c')]):_0xf685('0x6d'));return respondWithRpcPromise(_0xf685('0x86'),'rejectMessage',_0x1cae38);}return null;})[_0xf685('0x25')](function(_0xf97e77){var _0x337e94=_0xf685('0x70')+_0xf97e77[_0xf685('0x2d')]['ContactId'];return db[_0xf685('0x72')][_0xf685('0x44')](_0x337e94,{'type':db[_0xf685('0x73')]['QueryTypes'][_0xf685('0x87')],'raw':!![]})[_0xf685('0x25')](function(_0x188a88){return _0x188a88;});})[_0xf685('0x25')](function(_0x1c133c){if(_0x1c133c){_0x1cae38['message'][_0xf685('0x74')]=_0x1c133c[0x0];if(!_0x1750c8[_0xf685('0x5c')]['UserId'])return;return db[_0xf685('0x75')]['find']({'where':{'id':_0x1750c8['body'][_0xf685('0x66')],'role':_0xf685('0x76')},'attributes':['id','name',_0xf685('0x77'),_0xf685('0x78'),'internal'],'raw':!![]});}return null;})[_0xf685('0x25')](function(_0x92b678){if(!_0x92b678)return null;_0x1cae38['message'][_0xf685('0x76')]=_0x92b678;return _0x1cae38;})[_0xf685('0x25')](function(_0x276720){if(_0x276720){_0x276720[_0xf685('0x2d')][_0xf685('0x7b')]=util[_0xf685('0x64')](_0xf685('0x7c'),_0x1750c8[_0xf685('0x67')]['name']);_0x276720['message'][_0xf685('0x7d')]=_0x1cae38['channel'];_0x276720[_0xf685('0x2d')][_0xf685('0x7e')]=_0x1cae38['channel'];_0x276720[_0xf685('0x2d')][_0xf685('0x88')]=_0xf685('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0xf685('0x80')](_0x1cae38[_0xf685('0x2d')],JSON[_0xf685('0x89')](_0x1cae38[_0xf685('0x6c')]['formData']))},client9002);return _0x1cae38;}return null;})[_0xf685('0x25')](respondWithResult(_0x32f4bd,null))['catch'](handleError(_0x32f4bd,null));}; \ No newline at end of file +var _0x4dab=['jayson/promise','client','http','request','info','request\x20sent','debug','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','reject','save','then','end','stack','name','send','index','ChatMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','show','rawAttributes','find','create','body','update','params','destroy','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','AcceptMessage','ContactId','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','interaction','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','interface','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register'];(function(_0x391fda,_0x39a798){var _0x2540fc=function(_0x2aa516){while(--_0x2aa516){_0x391fda['push'](_0x391fda['shift']());}};_0x2540fc(++_0x39a798);}(_0x4dab,0x66));var _0xb4da=function(_0x31bb4e,_0x2d4db0){_0x31bb4e=_0x31bb4e-0x0;var _0x37defa=_0x4dab[_0x31bb4e];return _0x37defa;};'use strict';var emlformat=require(_0xb4da('0x0'));var rimraf=require(_0xb4da('0x1'));var zipdir=require(_0xb4da('0x2'));var jsonpatch=require(_0xb4da('0x3'));var rp=require(_0xb4da('0x4'));var moment=require('moment');var BPromise=require(_0xb4da('0x5'));var Mustache=require(_0xb4da('0x6'));var util=require('util');var path=require(_0xb4da('0x7'));var sox=require(_0xb4da('0x8'));var csv=require(_0xb4da('0x9'));var ejs=require(_0xb4da('0xa'));var fs=require('fs');var fs_extra=require(_0xb4da('0xb'));var _=require(_0xb4da('0xc'));var squel=require('squel');var crypto=require(_0xb4da('0xd'));var jsforce=require(_0xb4da('0xe'));var deskjs=require(_0xb4da('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb4da('0x10'));var Papa=require(_0xb4da('0x11'));var Redis=require(_0xb4da('0x12'));var authService=require(_0xb4da('0x13'));var qs=require(_0xb4da('0x14'));var as=require(_0xb4da('0x15'));var hardwareService=require(_0xb4da('0x16'));var logger=require(_0xb4da('0x17'))('api');var utils=require(_0xb4da('0x18'));var config=require(_0xb4da('0x19'));var licenseUtil=require(_0xb4da('0x1a'));var db=require(_0xb4da('0x1b'))['db'];config['redis']=_[_0xb4da('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb4da('0x1d'))(new Redis(config[_0xb4da('0x1e')]));require('./chatMessage.socket')[_0xb4da('0x1f')](socket);var jayson=require(_0xb4da('0x20'));var client=jayson[_0xb4da('0x21')][_0xb4da('0x22')]({'port':0x232c});var client9002=jayson[_0xb4da('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3d5a,_0x459e82,_0x13f491,_0x4a42a9){return new BPromise(function(_0x4ed159,_0x6f7150){var _0x4cfc86=_0x4a42a9||client;return _0x4cfc86[_0xb4da('0x23')](_0x5f3d5a,_0x13f491)['then'](function(_0x191ab7){logger[_0xb4da('0x24')]('ChatMessage,\x20%s,\x20%s',_0x459e82,_0xb4da('0x25'));logger[_0xb4da('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x459e82,_0xb4da('0x25'),JSON[_0xb4da('0x27')](_0x191ab7));if(_0x191ab7['error']){if(_0x191ab7['error'][_0xb4da('0x28')]===0x1f4){logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);return _0x6f7150(_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);}logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);return _0x4ed159(_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);}else{logger[_0xb4da('0x24')](_0xb4da('0x2a'),_0x459e82,_0xb4da('0x25'));_0x4ed159(_0x191ab7[_0xb4da('0x2c')][_0xb4da('0x2b')]);}})[_0xb4da('0x2d')](function(_0x446053){logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x446053);_0x6f7150(_0x446053);});});}function respondWithStatusCode(_0x5a0f18,_0x4825a0){_0x4825a0=_0x4825a0||0xcc;return function(_0x377d4f){if(_0x377d4f){return _0x5a0f18['sendStatus'](_0x4825a0);}return _0x5a0f18[_0xb4da('0x2e')](_0x4825a0)['end']();};}function respondWithResult(_0x5a6d5f,_0x2c146c){_0x2c146c=_0x2c146c||0xc8;return function(_0x91d489){if(_0x91d489){return _0x5a6d5f[_0xb4da('0x2e')](_0x2c146c)[_0xb4da('0x2f')](_0x91d489);}};}function respondWithFilteredResult(_0x145ab5,_0x53e51d){return function(_0x4db505){if(_0x4db505){var _0x4c1fff=typeof _0x53e51d[_0xb4da('0x30')]===_0xb4da('0x31')&&typeof _0x53e51d[_0xb4da('0x32')]===_0xb4da('0x31');var _0x157757=_0x4db505[_0xb4da('0x33')];var _0x454fad=_0x4c1fff?0x0:_0x53e51d[_0xb4da('0x30')];var _0x325def=_0x4c1fff?_0x4db505[_0xb4da('0x33')]:_0x53e51d[_0xb4da('0x30')]+_0x53e51d[_0xb4da('0x32')];var _0x1a4333;if(_0x325def>=_0x157757){_0x325def=_0x157757;_0x1a4333=0xc8;}else{_0x1a4333=0xce;}_0x145ab5['status'](_0x1a4333);return _0x145ab5[_0xb4da('0x34')]('Content-Range',_0x454fad+'-'+_0x325def+'/'+_0x157757)[_0xb4da('0x2f')](_0x4db505);}return null;};}function patchUpdates(_0x57163e){return function(_0x10aed8){try{jsonpatch['apply'](_0x10aed8,_0x57163e,!![]);}catch(_0x5dbac7){return BPromise[_0xb4da('0x35')](_0x5dbac7);}return _0x10aed8[_0xb4da('0x36')]();};}function saveUpdates(_0x3978b7,_0x31ba57){return function(_0x20b726){if(_0x20b726){return _0x20b726['update'](_0x3978b7)[_0xb4da('0x37')](function(_0x6d2414){return _0x6d2414;});}return null;};}function removeEntity(_0x4a2d76,_0x386971){return function(_0xa0efb2){if(_0xa0efb2){return _0xa0efb2['destroy']()['then'](function(){_0x4a2d76[_0xb4da('0x2e')](0xcc)[_0xb4da('0x38')]();});}};}function handleEntityNotFound(_0x4252c8,_0x4b872c){return function(_0x20380c){if(!_0x20380c){_0x4252c8['sendStatus'](0x194);}return _0x20380c;};}function handleError(_0x2ec9f1,_0x4863b){_0x4863b=_0x4863b||0x1f4;return function(_0x150e53){logger[_0xb4da('0x29')](_0x150e53[_0xb4da('0x39')]);if(_0x150e53[_0xb4da('0x3a')]){delete _0x150e53['name'];}_0x2ec9f1[_0xb4da('0x2e')](_0x4863b)[_0xb4da('0x3b')](_0x150e53);};}exports[_0xb4da('0x3c')]=function(_0x5b9b62,_0x5b3b0d){var _0x2d618d={},_0x3c9920={},_0x15f376={'count':0x0,'rows':[]};var _0x2ad279=_['map'](db[_0xb4da('0x3d')]['rawAttributes'],function(_0x22aaf7){return{'name':_0x22aaf7['fieldName'],'type':_0x22aaf7[_0xb4da('0x3e')][_0xb4da('0x3f')]};});_0x3c9920[_0xb4da('0x40')]=_[_0xb4da('0x41')](_0x2ad279,_0xb4da('0x3a'));_0x3c9920[_0xb4da('0x42')]=_[_0xb4da('0x43')](_0x5b9b62[_0xb4da('0x42')]);_0x3c9920[_0xb4da('0x44')]=_[_0xb4da('0x45')](_0x3c9920['model'],_0x3c9920[_0xb4da('0x42')]);_0x2d618d[_0xb4da('0x46')]=_[_0xb4da('0x45')](_0x3c9920[_0xb4da('0x40')],qs[_0xb4da('0x47')](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x47')]));_0x2d618d['attributes']=_0x2d618d[_0xb4da('0x46')][_0xb4da('0x48')]?_0x2d618d[_0xb4da('0x46')]:_0x3c9920[_0xb4da('0x40')];if(!_0x5b9b62[_0xb4da('0x42')]['hasOwnProperty'](_0xb4da('0x49'))){_0x2d618d[_0xb4da('0x32')]=qs['limit'](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x32')]);_0x2d618d[_0xb4da('0x30')]=qs[_0xb4da('0x30')](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x30')]);}_0x2d618d[_0xb4da('0x4a')]=qs['sort'](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4b')]);_0x2d618d[_0xb4da('0x4c')]=qs[_0xb4da('0x44')](_['pick'](_0x5b9b62[_0xb4da('0x42')],_0x3c9920[_0xb4da('0x44')]),_0x2ad279);if(_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4d')]){_0x2d618d[_0xb4da('0x4c')]=_['merge'](_0x2d618d[_0xb4da('0x4c')],{'$or':_['map'](_0x2ad279,function(_0x4c1ca9){if(_0x4c1ca9[_0xb4da('0x3e')]!==_0xb4da('0x4e')){var _0x51158b={};_0x51158b[_0x4c1ca9[_0xb4da('0x3a')]]={'$like':'%'+_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4d')]+'%'};return _0x51158b;}})});}_0x2d618d=_[_0xb4da('0x4f')]({},_0x2d618d,_0x5b9b62[_0xb4da('0x50')]);var _0x20e785={'where':_0x2d618d['where']};return db['ChatMessage'][_0xb4da('0x33')](_0x20e785)[_0xb4da('0x37')](function(_0x56752d){_0x15f376['count']=_0x56752d;if(_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x51')]){_0x2d618d[_0xb4da('0x52')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2d618d);})[_0xb4da('0x37')](function(_0x40cda3){_0x15f376[_0xb4da('0x53')]=_0x40cda3;return _0x15f376;})[_0xb4da('0x37')](respondWithFilteredResult(_0x5b3b0d,_0x2d618d))['catch'](handleError(_0x5b3b0d,null));};exports[_0xb4da('0x54')]=function(_0x1bd859,_0x576b26){var _0x388eab={'raw':!![],'where':{'id':_0x1bd859['params']['id']}},_0x3745fd={};_0x3745fd[_0xb4da('0x40')]=_[_0xb4da('0x43')](db[_0xb4da('0x3d')][_0xb4da('0x55')]);_0x3745fd[_0xb4da('0x42')]=_[_0xb4da('0x43')](_0x1bd859[_0xb4da('0x42')]);_0x3745fd[_0xb4da('0x44')]=_[_0xb4da('0x45')](_0x3745fd[_0xb4da('0x40')],_0x3745fd[_0xb4da('0x42')]);_0x388eab[_0xb4da('0x46')]=_['intersection'](_0x3745fd[_0xb4da('0x40')],qs[_0xb4da('0x47')](_0x1bd859[_0xb4da('0x42')]['fields']));_0x388eab[_0xb4da('0x46')]=_0x388eab[_0xb4da('0x46')][_0xb4da('0x48')]?_0x388eab['attributes']:_0x3745fd[_0xb4da('0x40')];if(_0x1bd859[_0xb4da('0x42')][_0xb4da('0x51')]){_0x388eab[_0xb4da('0x52')]=[{'all':!![]}];}_0x388eab=_[_0xb4da('0x4f')]({},_0x388eab,_0x1bd859[_0xb4da('0x50')]);return db[_0xb4da('0x3d')][_0xb4da('0x56')](_0x388eab)['then'](handleEntityNotFound(_0x576b26,null))[_0xb4da('0x37')](respondWithResult(_0x576b26,null))[_0xb4da('0x2d')](handleError(_0x576b26,null));};exports[_0xb4da('0x57')]=function(_0x437da9,_0x5f2ce9){return db[_0xb4da('0x3d')][_0xb4da('0x57')](_0x437da9[_0xb4da('0x58')],{})[_0xb4da('0x37')](respondWithResult(_0x5f2ce9,0xc9))[_0xb4da('0x2d')](handleError(_0x5f2ce9,null));};exports[_0xb4da('0x59')]=function(_0x3ac8de,_0x595e6){if(_0x3ac8de[_0xb4da('0x58')]['id']){delete _0x3ac8de[_0xb4da('0x58')]['id'];}return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x3ac8de[_0xb4da('0x5a')]['id']}})['then'](handleEntityNotFound(_0x595e6,null))[_0xb4da('0x37')](saveUpdates(_0x3ac8de['body'],null))[_0xb4da('0x37')](respondWithResult(_0x595e6,null))[_0xb4da('0x2d')](handleError(_0x595e6,null));};exports[_0xb4da('0x5b')]=function(_0x273f6d,_0x3e06d9){return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x273f6d[_0xb4da('0x5a')]['id']}})[_0xb4da('0x37')](handleEntityNotFound(_0x3e06d9,null))[_0xb4da('0x37')](removeEntity(_0x3e06d9,null))['catch'](handleError(_0x3e06d9,null));};exports[_0xb4da('0x5c')]=function(_0x2a3ad2,_0x258ecc){return db[_0xb4da('0x3d')]['describe']()[_0xb4da('0x37')](respondWithResult(_0x258ecc,null))[_0xb4da('0x2d')](handleError(_0x258ecc,null));};var interaction_log=require(_0xb4da('0x17'))('chat-interactions');exports['accept']=function(_0x19ef33,_0xcf7d46,_0x419082){var _0x4777d8={'agent':{},'channel':_0xb4da('0x5d')};if(_0x19ef33[_0xb4da('0x58')]['id']){delete _0x19ef33[_0xb4da('0x58')]['id'];}_0x19ef33[_0xb4da('0x58')][_0xb4da('0x5e')]=!![];_0x19ef33['body'][_0xb4da('0x5f')]=moment()[_0xb4da('0x60')](_0xb4da('0x61'));_0x19ef33['body'][_0xb4da('0x62')]=_0x19ef33['body'][_0xb4da('0x62')]||_0x19ef33[_0xb4da('0x63')]['id'];_0x4777d8[_0xb4da('0x64')]['id']=_0x19ef33[_0xb4da('0x58')][_0xb4da('0x62')];return db[_0xb4da('0x3d')][_0xb4da('0x56')]({'where':{'id':_0x19ef33[_0xb4da('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xcf7d46,null))['then'](saveUpdates(_0x19ef33[_0xb4da('0x58')],null))[_0xb4da('0x37')](function(_0x5d6cd9){if(_0x5d6cd9){_0x4777d8[_0xb4da('0x2b')]=_0x5d6cd9[_0xb4da('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xb4da('0x56')]({'where':{'id':_0x5d6cd9[_0xb4da('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xcf7d46,null))[_0xb4da('0x37')](function(_0x55b188){if(_0x55b188){return _0x55b188[_0xb4da('0x59')]({'UserId':_0x19ef33[_0xb4da('0x58')][_0xb4da('0x62')],'read1stAt':_['isNil'](_0x55b188[_0xb4da('0x67')])?moment()[_0xb4da('0x60')](_0xb4da('0x61')):undefined});}return null;})['then'](function(_0x555a36){if(_0x555a36){_0x4777d8['interaction']=_0x555a36[_0xb4da('0x65')]({'plain':!![]});interaction_log[_0xb4da('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19ef33[_0xb4da('0x63')]['id'],_0x19ef33['user'][_0xb4da('0x3a')],_0x19ef33['user']['role'],_0x4777d8['interaction']['id'],_0x19ef33['body']?JSON[_0xb4da('0x27')](_0x19ef33['body']):'null');return respondWithRpcPromise(_0xb4da('0x68'),'acceptMessage',_0x4777d8);}return null;})['then'](function(_0x37829f){var _0x59a8ce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x37829f[_0xb4da('0x2b')][_0xb4da('0x69')];return db['sequelize'][_0xb4da('0x42')](_0x59a8ce,{'type':db['Sequelize']['QueryTypes'][_0xb4da('0x6a')],'raw':!![]})[_0xb4da('0x37')](function(_0x125480){return _0x125480;});})['then'](function(_0x41473a){if(_0x41473a){_0x4777d8['message'][_0xb4da('0x6b')]=_0x41473a[0x0];if(!_0x19ef33['body'][_0xb4da('0x62')])return;return db[_0xb4da('0x6c')][_0xb4da('0x56')]({'where':{'id':_0x19ef33['body'][_0xb4da('0x62')],'role':_0xb4da('0x64')},'attributes':['id',_0xb4da('0x3a'),'fullname',_0xb4da('0x6d'),_0xb4da('0x6e')],'raw':!![]});}return null;})['then'](function(_0x1d02d9){if(!_0x1d02d9)return null;_0x4777d8[_0xb4da('0x2b')][_0xb4da('0x64')]=_0x1d02d9;return _0x4777d8;})[_0xb4da('0x37')](function(_0x5b35cc){if(_0x5b35cc){if(_0x19ef33[_0xb4da('0x58')][_0xb4da('0x6f')]){_0x4777d8[_0xb4da('0x2b')]['interface']=util[_0xb4da('0x60')](_0xb4da('0x70'),_0x19ef33['user'][_0xb4da('0x3a')]);_0x4777d8[_0xb4da('0x2b')]['channel']=_0x4777d8[_0xb4da('0x71')];_0x4777d8['message'][_0xb4da('0x72')]=_0x4777d8['channel'];_0x4777d8[_0xb4da('0x2b')][_0xb4da('0x73')]=_0xb4da('0x74');return respondWithRpcPromise(_0xb4da('0x75'),_0xb4da('0x75'),{'event':_0xb4da('0x76'),'message':_[_0xb4da('0x4f')](_0x4777d8[_0xb4da('0x2b')],JSON['parse'](_0x4777d8[_0xb4da('0x77')]['formData']))},client9002)[_0xb4da('0x37')](function(){return _0x4777d8;});}return _0x4777d8;}return null;})['then'](respondWithResult(_0xcf7d46,null))['catch'](handleError(_0xcf7d46,null));};var interaction_log=require('../../config/logger')(_0xb4da('0x78'));exports[_0xb4da('0x35')]=function(_0x3a0b1f,_0x5c0542,_0x20781a){var _0x4d2054={'agent':{},'channel':_0xb4da('0x5d')};if(_0x3a0b1f[_0xb4da('0x58')]['id']){delete _0x3a0b1f[_0xb4da('0x58')]['id'];}_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')]=_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')]||_0x3a0b1f[_0xb4da('0x63')]['id'];_0x4d2054[_0xb4da('0x64')]['id']=_0x3a0b1f['body'][_0xb4da('0x62')];return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x3a0b1f[_0xb4da('0x5a')]['id'],'UserId':null}})[_0xb4da('0x37')](handleEntityNotFound(_0x5c0542,null))['then'](function(_0x169bd5){if(_0x169bd5){_0x4d2054[_0xb4da('0x2b')]=_0x169bd5['get']({'plain':!![]});return db[_0xb4da('0x79')]['find']({'where':{'id':_0x169bd5['ChatInteractionId']}});}return null;})[_0xb4da('0x37')](handleEntityNotFound(_0x5c0542,null))[_0xb4da('0x37')](function(_0x26634c){if(_0x26634c){_0x4d2054[_0xb4da('0x77')]=_0x26634c[_0xb4da('0x65')]({'plain':!![]});interaction_log[_0xb4da('0x24')](_0xb4da('0x7a'),_0x3a0b1f[_0xb4da('0x63')]['id'],_0x3a0b1f[_0xb4da('0x63')]['name'],_0x3a0b1f['user'][_0xb4da('0x7b')],_0x4d2054[_0xb4da('0x77')]['id'],_0x3a0b1f[_0xb4da('0x58')]?JSON['stringify'](_0x3a0b1f[_0xb4da('0x58')]):_0xb4da('0x7c'));return respondWithRpcPromise(_0xb4da('0x7d'),_0xb4da('0x7e'),_0x4d2054);}return null;})[_0xb4da('0x37')](function(_0xcf607b){var _0x4454dd=_0xb4da('0x7f')+_0xcf607b['message'][_0xb4da('0x69')];return db[_0xb4da('0x80')][_0xb4da('0x42')](_0x4454dd,{'type':db[_0xb4da('0x81')][_0xb4da('0x82')][_0xb4da('0x6a')],'raw':!![]})[_0xb4da('0x37')](function(_0x5c93cb){return _0x5c93cb;});})[_0xb4da('0x37')](function(_0x412725){if(_0x412725){_0x4d2054[_0xb4da('0x2b')][_0xb4da('0x6b')]=_0x412725[0x0];if(!_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')])return;return db['User'][_0xb4da('0x56')]({'where':{'id':_0x3a0b1f['body'][_0xb4da('0x62')],'role':_0xb4da('0x64')},'attributes':['id','name','fullname',_0xb4da('0x6d'),_0xb4da('0x6e')],'raw':!![]});}return null;})['then'](function(_0x5a283a){if(!_0x5a283a)return null;_0x4d2054['message'][_0xb4da('0x64')]=_0x5a283a;return _0x4d2054;})[_0xb4da('0x37')](function(_0x813b54){if(_0x813b54){_0x813b54['message'][_0xb4da('0x83')]=util['format'](_0xb4da('0x70'),_0x3a0b1f[_0xb4da('0x63')][_0xb4da('0x3a')]);_0x813b54['message'][_0xb4da('0x71')]=_0x4d2054[_0xb4da('0x71')];_0x813b54['message']['motionChannel']=_0x4d2054[_0xb4da('0x71')];_0x813b54[_0xb4da('0x2b')][_0xb4da('0x73')]='reject';respondWithRpcPromise('EventManager',_0xb4da('0x75'),{'event':_0xb4da('0x84'),'message':_[_0xb4da('0x4f')](_0x4d2054[_0xb4da('0x2b')],JSON['parse'](_0x4d2054['interaction'][_0xb4da('0x85')]))},client9002);return _0x4d2054;}return null;})[_0xb4da('0x37')](respondWithResult(_0x5c0542,null))[_0xb4da('0x2d')](handleError(_0x5c0542,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ed15448..c0c81eb 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1853=['exports','ChatMessage','save','update','emit'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x1853,0x1aa));var _0x3185=function(_0x466091,_0xcdc0f7){_0x466091=_0x466091-0x0;var _0xfc1ee0=_0x1853[_0x466091];return _0xfc1ee0;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x3185('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3185('0x1'),'afterUpdate':_0x3185('0x2'),'afterDestroy':'remove'};function emitEvent(_0x38839d){return function(_0x2294a0,_0x1bf603,_0x5677e8){ChatMessageEvents[_0x3185('0x3')](_0x38839d+':'+_0x2294a0['id'],_0x2294a0);ChatMessageEvents[_0x3185('0x3')](_0x38839d,_0x2294a0);_0x5677e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3185('0x4')]=ChatMessageEvents; \ No newline at end of file +var _0x0e9a=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','update','remove','emit'];(function(_0x2b8764,_0x3f6442){var _0x5010ee=function(_0x2cf0fe){while(--_0x2cf0fe){_0x2b8764['push'](_0x2b8764['shift']());}};_0x5010ee(++_0x3f6442);}(_0x0e9a,0x1c5));var _0xa0e9=function(_0x5d63aa,_0x3278fe){_0x5d63aa=_0x5d63aa-0x0;var _0x5b463f=_0x0e9a[_0x5d63aa];return _0x5b463f;};'use strict';var EventEmitter=require(_0xa0e9('0x0'));var ChatMessage=require(_0xa0e9('0x1'))['db'][_0xa0e9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0e9('0x3'),'afterDestroy':_0xa0e9('0x4')};function emitEvent(_0x4e837b){return function(_0x2b8a11,_0x4b1c3d,_0x392f6c){ChatMessageEvents[_0xa0e9('0x5')](_0x4e837b+':'+_0x2b8a11['id'],_0x2b8a11);ChatMessageEvents['emit'](_0x4e837b,_0x2b8a11);_0x392f6c(null);};}for(var e in events){if(events[_0xa0e9('0x6')](e)){var event=events[e];ChatMessage[_0xa0e9('0x7')](e,emitEvent(event));}}module[_0xa0e9('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index ab7211d..008726f 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3999=['error','utf8mb4','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','then','update','createdAt'];(function(_0x584b87,_0x3542b8){var _0x3e7b7e=function(_0xe8964d){while(--_0xe8964d){_0x584b87['push'](_0x584b87['shift']());}};_0x3e7b7e(++_0x3542b8);}(_0x3999,0x18a));var _0x9399=function(_0x456107,_0x5a3c97){_0x456107=_0x456107-0x0;var _0x205010=_0x3999[_0x456107];return _0x205010;};'use strict';var _=require(_0x9399('0x0'));var util=require('util');var logger=require(_0x9399('0x1'))(_0x9399('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9399('0x3'));var fs=require('fs');var path=require(_0x9399('0x4'));var rimraf=require(_0x9399('0x5'));var config=require(_0x9399('0x6'));var attributes=require(_0x9399('0x7'));module[_0x9399('0x8')]=function(_0xbe96e6,_0x82a508){return _0xbe96e6[_0x9399('0x9')]('ChatMessage',attributes,{'tableName':_0x9399('0xa'),'paranoid':![],'indexes':[{'name':_0x9399('0xb'),'fields':[_0x9399('0xc')],'type':_0x9399('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x182cce,_0x11b121,_0x5b68a7){var _0x3b1d12=_0xbe96e6[_0x9399('0xe')];var _0xded2a8=_0x182cce[_0x9399('0xf')]({'plain':!![]});if(_0xded2a8[_0x9399('0x10')][_0x9399('0x11')]()==='in'||_0xded2a8[_0x9399('0x10')]['toLowerCase']()===_0x9399('0x12')&&!_0xded2a8[_0x9399('0x13')]&&!_[_0x9399('0x14')](_0xded2a8[_0x9399('0x15')])){_0x3b1d12[_0x9399('0x16')]['findOne']({'where':{'id':_0xded2a8['ChatInteractionId']}})[_0x9399('0x17')](function(_0x2bac60){if(_0x2bac60){_0x2bac60[_0x9399('0x18')]({'lastMsgAt':_0xded2a8[_0x9399('0x19')],'lastMsgDirection':_0xded2a8[_0x9399('0x10')][_0x9399('0x11')]()});}})['catch'](function(_0x23f26a){console[_0x9399('0x1a')](_0x23f26a);});}_0x5b68a7();}},'charset':_0x9399('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf5c0=['chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage'];(function(_0x31799d,_0x440446){var _0x4ea463=function(_0x39ab3e){while(--_0x39ab3e){_0x31799d['push'](_0x31799d['shift']());}};_0x4ea463(++_0x440446);}(_0xf5c0,0x71));var _0x0f5c=function(_0x17a057,_0x51ef19){_0x17a057=_0x17a057-0x0;var _0x5b34d2=_0xf5c0[_0x17a057];return _0x5b34d2;};'use strict';var _=require('lodash');var util=require(_0x0f5c('0x0'));var logger=require('../../config/logger')(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var BPromise=require(_0x0f5c('0x3'));var rp=require(_0x0f5c('0x4'));var fs=require('fs');var path=require(_0x0f5c('0x5'));var rimraf=require(_0x0f5c('0x6'));var config=require(_0x0f5c('0x7'));var attributes=require(_0x0f5c('0x8'));module[_0x0f5c('0x9')]=function(_0x1c69da,_0x2752d2){return _0x1c69da['define'](_0x0f5c('0xa'),attributes,{'tableName':_0x0f5c('0xb'),'paranoid':![],'indexes':[{'name':_0x0f5c('0xc'),'fields':['body'],'type':_0x0f5c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e3edc,_0x569568,_0x385542){var _0x2beb54=_0x1c69da[_0x0f5c('0xe')];var _0x36480d=_0x3e3edc[_0x0f5c('0xf')]({'plain':!![]});if(_0x36480d[_0x0f5c('0x10')][_0x0f5c('0x11')]()==='in'||_0x36480d[_0x0f5c('0x10')][_0x0f5c('0x11')]()===_0x0f5c('0x12')&&!_0x36480d[_0x0f5c('0x13')]&&!_[_0x0f5c('0x14')](_0x36480d[_0x0f5c('0x15')])){_0x2beb54['ChatInteraction'][_0x0f5c('0x16')]({'where':{'id':_0x36480d[_0x0f5c('0x17')]}})[_0x0f5c('0x18')](function(_0x2602c1){if(_0x2602c1){_0x2602c1[_0x0f5c('0x19')]({'lastMsgAt':_0x36480d[_0x0f5c('0x1a')],'lastMsgDirection':_0x36480d[_0x0f5c('0x10')]['toLowerCase']()});}})[_0x0f5c('0x1b')](function(_0x7a90cd){console[_0x0f5c('0x1c')](_0x7a90cd);});}_0x385542();}},'charset':_0x0f5c('0x1d'),'collate':_0x0f5c('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index d4ca0c0..5f12509 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52aa=['moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateChatMessage','create','body','options','raw','debug','stringify','lodash'];(function(_0x2f6411,_0x406e6e){var _0x310728=function(_0x290466){while(--_0x290466){_0x2f6411['push'](_0x2f6411['shift']());}};_0x310728(++_0x406e6e);}(_0x52aa,0x1c1));var _0xa52a=function(_0x1ac48e,_0x5c2868){_0x1ac48e=_0x1ac48e-0x0;var _0x222ddd=_0x52aa[_0x1ac48e];return _0x222ddd;};'use strict';var _=require(_0xa52a('0x0'));var util=require('util');var moment=require(_0xa52a('0x1'));var BPromise=require('bluebird');var rs=require(_0xa52a('0x2'));var fs=require('fs');var Redis=require(_0xa52a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa52a('0x4'));var logger=require('../../config/logger')(_0xa52a('0x5'));var config=require('../../config/environment');var jayson=require(_0xa52a('0x6'));var client=jayson[_0xa52a('0x7')]['http']({'port':0x232a});config[_0xa52a('0x8')]=_[_0xa52a('0x9')](config['redis'],{'host':_0xa52a('0xa'),'port':0x18eb});var socket=require(_0xa52a('0xb'))(new Redis(config['redis']));require(_0xa52a('0xc'))[_0xa52a('0xd')](socket);function respondWithRpcPromise(_0x4b81e5,_0x55f1b7,_0x2d19c5){return new BPromise(function(_0x2b3bb6,_0x377bce){return client['request'](_0x4b81e5,_0x2d19c5)[_0xa52a('0xe')](function(_0x2fb649){logger[_0xa52a('0xf')](_0xa52a('0x10'),_0x55f1b7,'request\x20sent');logger['debug'](_0xa52a('0x11'),_0x55f1b7,_0xa52a('0x12'),JSON['stringify'](_0x2fb649));if(_0x2fb649['error']){if(_0x2fb649[_0xa52a('0x13')]['code']===0x1f4){logger['error'](_0xa52a('0x10'),_0x55f1b7,_0x2fb649[_0xa52a('0x13')][_0xa52a('0x14')]);return _0x377bce(_0x2fb649['error']['message']);}logger[_0xa52a('0x13')](_0xa52a('0x10'),_0x55f1b7,_0x2fb649[_0xa52a('0x13')]['message']);return _0x2b3bb6(_0x2fb649['error'][_0xa52a('0x14')]);}else{logger[_0xa52a('0xf')](_0xa52a('0x10'),_0x55f1b7,_0xa52a('0x12'));_0x2b3bb6(_0x2fb649[_0xa52a('0x15')][_0xa52a('0x14')]);}})[_0xa52a('0x16')](function(_0x95a9d6){logger[_0xa52a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x55f1b7,_0x95a9d6);_0x377bce(_0x95a9d6);});});}exports[_0xa52a('0x17')]=function(_0x3c6c09){var _0x575eeb=this;return new Promise(function(_0x5e6215,_0x215801){return db['ChatMessage'][_0xa52a('0x18')](_0x3c6c09[_0xa52a('0x19')],{'raw':_0x3c6c09[_0xa52a('0x1a')]?_0x3c6c09[_0xa52a('0x1a')][_0xa52a('0x1b')]===undefined?!![]:![]:!![]})[_0xa52a('0xe')](function(_0x31935f){logger['info'](_0xa52a('0x17'),_0x3c6c09);logger[_0xa52a('0x1c')]('CreateChatMessage',_0x3c6c09,JSON[_0xa52a('0x1d')](_0x31935f));_0x5e6215(_0x31935f);})[_0xa52a('0x16')](function(_0x360992){logger[_0xa52a('0x13')]('CreateChatMessage',_0x360992[_0xa52a('0x14')],_0x3c6c09);_0x215801(_0x575eeb[_0xa52a('0x13')](0x1f4,_0x360992[_0xa52a('0x14')]));});});}; \ No newline at end of file +var _0xf82c=['message','info','result','catch','CreateChatMessage','create','body','options','raw','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x43bf86,_0x1f4f3e){var _0x223364=function(_0x210204){while(--_0x210204){_0x43bf86['push'](_0x43bf86['shift']());}};_0x223364(++_0x1f4f3e);}(_0xf82c,0x19c));var _0xcf82=function(_0x4e6bfd,_0x38102c){_0x4e6bfd=_0x4e6bfd-0x0;var _0x356bea=_0xf82c[_0x4e6bfd];return _0x356bea;};'use strict';var _=require('lodash');var util=require(_0xcf82('0x0'));var moment=require(_0xcf82('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf82('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf82('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf82('0x4'))(_0xcf82('0x5'));var config=require(_0xcf82('0x6'));var jayson=require(_0xcf82('0x7'));var client=jayson['client'][_0xcf82('0x8')]({'port':0x232a});config[_0xcf82('0x9')]=_[_0xcf82('0xa')](config[_0xcf82('0x9')],{'host':_0xcf82('0xb'),'port':0x18eb});var socket=require(_0xcf82('0xc'))(new Redis(config[_0xcf82('0x9')]));require(_0xcf82('0xd'))[_0xcf82('0xe')](socket);function respondWithRpcPromise(_0x5e29b4,_0x4fb437,_0x42b68f){return new BPromise(function(_0x85b5e,_0x3c129e){return client[_0xcf82('0xf')](_0x5e29b4,_0x42b68f)[_0xcf82('0x10')](function(_0x547ea7){logger['info'](_0xcf82('0x11'),_0x4fb437,_0xcf82('0x12'));logger['debug'](_0xcf82('0x13'),_0x4fb437,_0xcf82('0x12'),JSON['stringify'](_0x547ea7));if(_0x547ea7['error']){if(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x15')]===0x1f4){logger[_0xcf82('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fb437,_0x547ea7['error'][_0xcf82('0x16')]);return _0x3c129e(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);}logger['error'](_0xcf82('0x11'),_0x4fb437,_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);return _0x85b5e(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);}else{logger[_0xcf82('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4fb437,_0xcf82('0x12'));_0x85b5e(_0x547ea7[_0xcf82('0x18')][_0xcf82('0x16')]);}})[_0xcf82('0x19')](function(_0x37e4a6){logger[_0xcf82('0x14')](_0xcf82('0x11'),_0x4fb437,_0x37e4a6);_0x3c129e(_0x37e4a6);});});}exports[_0xcf82('0x1a')]=function(_0x5a4288){var _0x1fd496=this;return new Promise(function(_0x3d9c37,_0x5c54c9){return db['ChatMessage'][_0xcf82('0x1b')](_0x5a4288[_0xcf82('0x1c')],{'raw':_0x5a4288[_0xcf82('0x1d')]?_0x5a4288[_0xcf82('0x1d')][_0xcf82('0x1e')]===undefined?!![]:![]:!![]})[_0xcf82('0x10')](function(_0x2adb88){logger[_0xcf82('0x17')]('CreateChatMessage',_0x5a4288);logger['debug'](_0xcf82('0x1a'),_0x5a4288,JSON['stringify'](_0x2adb88));_0x3d9c37(_0x2adb88);})[_0xcf82('0x19')](function(_0x57f201){logger[_0xcf82('0x14')](_0xcf82('0x1a'),_0x57f201[_0xcf82('0x16')],_0x5a4288);_0x5c54c9(_0x1fd496[_0xcf82('0x14')](0x1f4,_0x57f201[_0xcf82('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4e4635f..cf55f1e 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33c5=['remove','emit','removeListener','register','length','chatMessage:','save'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x33c5,0xe6));var _0x533c=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x33c5[_0x20c9b2];return _0x2c6030;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x533c('0x0'),_0x533c('0x1'),'update'];function createListener(_0x9dafa,_0x26b916){return function(_0x221e43){_0x26b916[_0x533c('0x2')](_0x9dafa,_0x221e43);};}function removeListener(_0x358127,_0x49609e){return function(){ChatMessageEvents[_0x533c('0x3')](_0x358127,_0x49609e);};}exports[_0x533c('0x4')]=function(_0x31d912){for(var _0x151732=0x0,_0x34ca89=events[_0x533c('0x5')];_0x151732<_0x34ca89;_0x151732++){var _0x3a009b=events[_0x151732];var _0x36d74e=createListener(_0x533c('0x6')+_0x3a009b,_0x31d912);ChatMessageEvents['on'](_0x3a009b,_0x36d74e);}}; \ No newline at end of file +var _0x7c1f=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x3c253e,_0x98d7d2){var _0x2438d9=function(_0x3a6ad7){while(--_0x3a6ad7){_0x3c253e['push'](_0x3c253e['shift']());}};_0x2438d9(++_0x98d7d2);}(_0x7c1f,0x194));var _0xf7c1=function(_0x233d1f,_0x421885){_0x233d1f=_0x233d1f-0x0;var _0x43d3c9=_0x7c1f[_0x233d1f];return _0x43d3c9;};'use strict';var ChatMessageEvents=require(_0xf7c1('0x0'));var events=[_0xf7c1('0x1'),_0xf7c1('0x2'),_0xf7c1('0x3')];function createListener(_0x3ca7b6,_0x568116){return function(_0x1e3254){_0x568116[_0xf7c1('0x4')](_0x3ca7b6,_0x1e3254);};}function removeListener(_0x18f5a9,_0x485d8d){return function(){ChatMessageEvents[_0xf7c1('0x5')](_0x18f5a9,_0x485d8d);};}exports[_0xf7c1('0x6')]=function(_0x3c21cf){for(var _0x136e1e=0x0,_0x5423bf=events[_0xf7c1('0x7')];_0x136e1e<_0x5423bf;_0x136e1e++){var _0x1a342b=events[_0x136e1e];var _0x329050=createListener(_0xf7c1('0x8')+_0x1a342b,_0x3c21cf);ChatMessageEvents['on'](_0x1a342b,_0x329050);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a3502c3..dc51526 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3634=['util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','show','post','tracked','chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','delete','destroy'];(function(_0x3c0048,_0x5cd773){var _0x30cc52=function(_0x4f664d){while(--_0x4f664d){_0x3c0048['push'](_0x3c0048['shift']());}};_0x30cc52(++_0x5cd773);}(_0x3634,0x1ce));var _0x4363=function(_0x235e3c,_0x4f2c6f){_0x235e3c=_0x235e3c-0x0;var _0x390498=_0x3634[_0x235e3c];return _0x390498;};'use strict';var multer=require('multer');var util=require(_0x4363('0x0'));var path=require(_0x4363('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4363('0x2')]();var fs_extra=require(_0x4363('0x3'));var auth=require(_0x4363('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4363('0x5'));var controller=require('./chatMessage.controller');router[_0x4363('0x6')]('/',auth[_0x4363('0x7')](),controller['index']);router[_0x4363('0x6')]('/describe',auth[_0x4363('0x7')](),controller[_0x4363('0x8')]);router[_0x4363('0x6')]('/:id',auth[_0x4363('0x7')](),controller[_0x4363('0x9')]);router[_0x4363('0xa')]('/',auth[_0x4363('0x7')](),interaction[_0x4363('0xb')]('chat',_0x4363('0xc')),controller[_0x4363('0xd')]);router[_0x4363('0xe')](_0x4363('0xf'),controller['update']);router[_0x4363('0xe')](_0x4363('0x10'),auth[_0x4363('0x7')](),controller['accept']);router[_0x4363('0xe')](_0x4363('0x11'),auth[_0x4363('0x7')](),controller[_0x4363('0x12')]);router[_0x4363('0x13')](_0x4363('0xf'),auth[_0x4363('0x7')](),controller[_0x4363('0x14')]);module['exports']=router; \ No newline at end of file +var _0xef40=['chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xef40,0xc0));var _0x0ef4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xef40[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x0ef4('0x0'));var util=require('util');var path=require(_0x0ef4('0x1'));var timeout=require(_0x0ef4('0x2'));var express=require(_0x0ef4('0x3'));var router=express[_0x0ef4('0x4')]();var fs_extra=require(_0x0ef4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0ef4('0x6'));var controller=require(_0x0ef4('0x7'));router[_0x0ef4('0x8')]('/',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xa')]);router[_0x0ef4('0x8')]('/describe',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xb')]);router[_0x0ef4('0x8')](_0x0ef4('0xc'),auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xd')]);router[_0x0ef4('0xe')]('/',auth[_0x0ef4('0x9')](),interaction[_0x0ef4('0xf')](_0x0ef4('0x10'),_0x0ef4('0x11')),controller[_0x0ef4('0x12')]);router[_0x0ef4('0x13')]('/:id',controller[_0x0ef4('0x14')]);router['put'](_0x0ef4('0x15'),auth[_0x0ef4('0x9')](),controller['accept']);router[_0x0ef4('0x13')]('/:id/reject',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0x16')]);router[_0x0ef4('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0ef4('0x18')]);module[_0x0ef4('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6681334..b2fe331 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1d1e67,_0x332843){var _0x2caf87=function(_0x2b1bd1){while(--_0x2b1bd1){_0x1d1e67['push'](_0x1d1e67['shift']());}};_0x2caf87(++_0x332843);}(_0xdb28,0x106));var _0x8db2=function(_0x488642,_0x4bebd2){_0x488642=_0x488642-0x0;var _0x3d209c=_0xdb28[_0x488642];return _0x3d209c;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x2d3285,_0x62b9b6){var _0x1b0c7e=function(_0x2adbe4){while(--_0x2adbe4){_0x2d3285['push'](_0x2d3285['shift']());}};_0x1b0c7e(++_0x62b9b6);}(_0x2032,0xd9));var _0x2203=function(_0x376438,_0x2d62c9){_0x376438=_0x376438-0x0;var _0x2b3bfa=_0x2032[_0x376438];return _0x2b3bfa;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 3499459..84c04a4 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x23d19d,_0x56fe71){var _0x139eee=function(_0xdb7f74){while(--_0xdb7f74){_0x23d19d['push'](_0x23d19d['shift']());}};_0x139eee(++_0x56fe71);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x5d39ea,_0x107836){_0x5d39ea=_0x5d39ea-0x0;var _0x4a6f35=_0x7a54[_0x5d39ea];return _0x4a6f35;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 6387894..5994aa6 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaec7=['emit','hasOwnProperty','hook','events','ChatOfflineMessage','setMaxListeners','save','remove'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaec7,0x8b));var _0x7aec=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xaec7[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require(_0x7aec('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x7aec('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7aec('0x2')](0x0);var events={'afterCreate':_0x7aec('0x3'),'afterUpdate':'update','afterDestroy':_0x7aec('0x4')};function emitEvent(_0x5dc44d){return function(_0x2c552f,_0x59871a,_0x15b9f7){ChatOfflineMessageEvents[_0x7aec('0x5')](_0x5dc44d+':'+_0x2c552f['id'],_0x2c552f);ChatOfflineMessageEvents[_0x7aec('0x5')](_0x5dc44d,_0x2c552f);_0x15b9f7(null);};}for(var e in events){if(events[_0x7aec('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x7aec('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x39f8=['hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2751d8,_0x26bbcb){var _0x2fce41=function(_0x2cb549){while(--_0x2cb549){_0x2751d8['push'](_0x2751d8['shift']());}};_0x2fce41(++_0x26bbcb);}(_0x39f8,0x161));var _0x839f=function(_0x44b433,_0x5498bd){_0x44b433=_0x44b433-0x0;var _0x2e7362=_0x39f8[_0x44b433];return _0x2e7362;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x839f('0x0'))['db'][_0x839f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x839f('0x2')](0x0);var events={'afterCreate':_0x839f('0x3'),'afterUpdate':'update','afterDestroy':_0x839f('0x4')};function emitEvent(_0x2e43ac){return function(_0x50817c,_0x3cb754,_0x4d5611){ChatOfflineMessageEvents[_0x839f('0x5')](_0x2e43ac+':'+_0x50817c['id'],_0x50817c);ChatOfflineMessageEvents[_0x839f('0x5')](_0x2e43ac,_0x50817c);_0x4d5611(null);};}for(var e in events){if(events[_0x839f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x839f('0x7')](e,emitEvent(event));}}module[_0x839f('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 43f4d60..3fd15ea 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb24b=['define','ChatOfflineMessage','chat_offline_messages','exports'];(function(_0x14c3e7,_0xb0e43b){var _0x26925b=function(_0xcaf04a){while(--_0xcaf04a){_0x14c3e7['push'](_0x14c3e7['shift']());}};_0x26925b(++_0xb0e43b);}(_0xb24b,0x1cb));var _0xbb24=function(_0x433be9,_0x23ab52){_0x433be9=_0x433be9-0x0;var _0x58a05f=_0xb24b[_0x433be9];return _0x58a05f;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xbb24('0x0')]=function(_0x2cf7e5){return _0x2cf7e5[_0xbb24('0x1')](_0xbb24('0x2'),attributes,{'tableName':_0xbb24('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x17b8=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x17b8,0x179));var _0x817b=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0x17b8[_0x2be240];return _0x123543;};'use strict';var attributes=require(_0x817b('0x0'));module[_0x817b('0x1')]=function(_0x7d8c53){return _0x7d8c53[_0x817b('0x2')](_0x817b('0x3'),attributes,{'tableName':_0x817b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x817b('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7055551..d3a3f39 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c2=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0xd070f5,_0x13fefd){var _0xf8dc56=function(_0x4a6223){while(--_0x4a6223){_0xd070f5['push'](_0xd070f5['shift']());}};_0xf8dc56(++_0x13fefd);}(_0x49c2,0x176));var _0x249c=function(_0x7ef709,_0x12cdce){_0x7ef709=_0x7ef709-0x0;var _0x502b71=_0x49c2[_0x7ef709];return _0x502b71;};'use strict';var _=require(_0x249c('0x0'));var util=require(_0x249c('0x1'));var moment=require(_0x249c('0x2'));var BPromise=require(_0x249c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x249c('0x4'));var db=require(_0x249c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x249c('0x6'))(_0x249c('0x7'));var config=require('../../config/environment');var jayson=require(_0x249c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x559ced,_0x4e6e24,_0xbe365c){return new BPromise(function(_0x2d2d00,_0xfd28c0){return client[_0x249c('0x9')](_0x559ced,_0xbe365c)[_0x249c('0xa')](function(_0x3d61a2){logger[_0x249c('0xb')](_0x249c('0xc'),_0x4e6e24,_0x249c('0xd'));logger[_0x249c('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4e6e24,_0x249c('0xd'),JSON[_0x249c('0xf')](_0x3d61a2));if(_0x3d61a2['error']){if(_0x3d61a2['error'][_0x249c('0x10')]===0x1f4){logger[_0x249c('0x11')](_0x249c('0xc'),_0x4e6e24,_0x3d61a2[_0x249c('0x11')][_0x249c('0x12')]);return _0xfd28c0(_0x3d61a2[_0x249c('0x11')][_0x249c('0x12')]);}logger[_0x249c('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4e6e24,_0x3d61a2[_0x249c('0x11')][_0x249c('0x12')]);return _0x2d2d00(_0x3d61a2[_0x249c('0x11')][_0x249c('0x12')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x4e6e24,_0x249c('0xd'));_0x2d2d00(_0x3d61a2[_0x249c('0x13')][_0x249c('0x12')]);}})[_0x249c('0x14')](function(_0x2d294a){logger[_0x249c('0x11')](_0x249c('0xc'),_0x4e6e24,_0x2d294a);_0xfd28c0(_0x2d294a);});});} \ No newline at end of file +var _0x73f9=['../../config/environment','http','request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xf4dfa4,_0x2f9143){var _0x3a5ac1=function(_0x4a1671){while(--_0x4a1671){_0xf4dfa4['push'](_0xf4dfa4['shift']());}};_0x3a5ac1(++_0x2f9143);}(_0x73f9,0x1c6));var _0x973f=function(_0x45c5c5,_0x31fb9b){_0x45c5c5=_0x45c5c5-0x0;var _0x25a41e=_0x73f9[_0x45c5c5];return _0x25a41e;};'use strict';var _=require('lodash');var util=require(_0x973f('0x0'));var moment=require(_0x973f('0x1'));var BPromise=require(_0x973f('0x2'));var rs=require(_0x973f('0x3'));var fs=require('fs');var Redis=require(_0x973f('0x4'));var db=require(_0x973f('0x5'))['db'];var utils=require(_0x973f('0x6'));var logger=require('../../config/logger')(_0x973f('0x7'));var config=require(_0x973f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x973f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f09c1,_0x12b109,_0x48feb6){return new BPromise(function(_0x5cd408,_0x470a73){return client[_0x973f('0xa')](_0x4f09c1,_0x48feb6)['then'](function(_0x3c1d59){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x973f('0xb'));logger[_0x973f('0xc')](_0x973f('0xd'),_0x12b109,_0x973f('0xb'),JSON[_0x973f('0xe')](_0x3c1d59));if(_0x3c1d59[_0x973f('0xf')]){if(_0x3c1d59[_0x973f('0xf')][_0x973f('0x10')]===0x1f4){logger[_0x973f('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);return _0x470a73(_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);}logger[_0x973f('0xf')](_0x973f('0x12'),_0x12b109,_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);return _0x5cd408(_0x3c1d59[_0x973f('0xf')]['message']);}else{logger[_0x973f('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x973f('0xb'));_0x5cd408(_0x3c1d59[_0x973f('0x14')]['message']);}})[_0x973f('0x15')](function(_0x2a4bb6){logger[_0x973f('0xf')](_0x973f('0x12'),_0x12b109,_0x2a4bb6);_0x470a73(_0x2a4bb6);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b34c412..f7f4e56 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf99c=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x3f62b8,_0x3ed080){var _0x59cd53=function(_0x33409e){while(--_0x33409e){_0x3f62b8['push'](_0x3f62b8['shift']());}};_0x59cd53(++_0x3ed080);}(_0xf99c,0x1b9));var _0xcf99=function(_0x33d10a,_0x42d7e7){_0x33d10a=_0x33d10a-0x0;var _0x4b625d=_0xf99c[_0x33d10a];return _0x4b625d;};'use strict';var multer=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var path=require(_0xcf99('0x2'));var timeout=require(_0xcf99('0x3'));var express=require(_0xcf99('0x4'));var router=express[_0xcf99('0x5')]();var fs_extra=require(_0xcf99('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcf99('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0xcf99('0x8')]('/',auth['isAuthenticated'](),controller[_0xcf99('0x9')]);router[_0xcf99('0x8')](_0xcf99('0xa'),auth[_0xcf99('0xb')](),controller['describe']);router[_0xcf99('0x8')](_0xcf99('0xc'),auth[_0xcf99('0xb')](),controller[_0xcf99('0xd')]);router[_0xcf99('0xe')]('/',auth[_0xcf99('0xb')](),controller['create']);router[_0xcf99('0xf')](_0xcf99('0xc'),auth[_0xcf99('0xb')](),controller[_0xcf99('0x10')]);router[_0xcf99('0x11')](_0xcf99('0xc'),auth[_0xcf99('0xb')](),controller[_0xcf99('0x12')]);module[_0xcf99('0x13')]=router; \ No newline at end of file +var _0xc3a3=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x56c1c6,_0x3fb809){var _0x5674a7=function(_0x40232f){while(--_0x40232f){_0x56c1c6['push'](_0x56c1c6['shift']());}};_0x5674a7(++_0x3fb809);}(_0xc3a3,0x75));var _0x3c3a=function(_0x1e2fd2,_0x44bde1){_0x1e2fd2=_0x1e2fd2-0x0;var _0x3872c6=_0xc3a3[_0x1e2fd2];return _0x3872c6;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require(_0x3c3a('0x2'));var timeout=require(_0x3c3a('0x3'));var express=require(_0x3c3a('0x4'));var router=express[_0x3c3a('0x5')]();var fs_extra=require(_0x3c3a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3c3a('0x7'));var config=require(_0x3c3a('0x8'));var controller=require(_0x3c3a('0x9'));router[_0x3c3a('0xa')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0xb')]);router['get'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0xe')]);router[_0x3c3a('0xa')](_0x3c3a('0xf'),auth[_0x3c3a('0xd')](),controller['show']);router[_0x3c3a('0x10')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x11')]);router[_0x3c3a('0x12')](_0x3c3a('0xf'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x13')]);router[_0x3c3a('0x14')]('/:id',auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x15')]);module[_0x3c3a('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 4b7b191..1282354 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcf5=['sequelize','exports','STRING','ENUM','mouseOver','INTEGER'];(function(_0x5ee456,_0x5bf330){var _0x2cfafc=function(_0x3d0af5){while(--_0x3d0af5){_0x5ee456['push'](_0x5ee456['shift']());}};_0x2cfafc(++_0x5bf330);}(_0xdcf5,0xcc));var _0x5dcf=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xdcf5[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x5dcf('0x0'));module[_0x5dcf('0x1')]={'name':{'type':Sequelize[_0x5dcf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5dcf('0x3')](_0x5dcf('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5dcf('0x2')]},'timeout':{'type':Sequelize[_0x5dcf('0x5')]}}; \ No newline at end of file +var _0x5d84=['STRING','sequelize','exports','ENUM','mouseOver'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x5d84,0x18c));var _0x45d8=function(_0x39b07f,_0x4ef1dd){_0x39b07f=_0x39b07f-0x0;var _0xe5ae78=_0x5d84[_0x39b07f];return _0xe5ae78;};'use strict';var Sequelize=require(_0x45d8('0x0'));module[_0x45d8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x45d8('0x2')](_0x45d8('0x3'),'timeout'),'defaultValue':_0x45d8('0x3')},'selector':{'type':Sequelize[_0x45d8('0x4')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 96397d3..011587b 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ef=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','ChatProactiveAction','create','catch','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util'];(function(_0x1d7827,_0x42b0db){var _0xb449f1=function(_0x482ebc){while(--_0x482ebc){_0x1d7827['push'](_0x1d7827['shift']());}};_0xb449f1(++_0x42b0db);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x597e5a,_0x529d8c){_0x597e5a=_0x597e5a-0x0;var _0x51e3f6=_0xb2ef[_0x597e5a];return _0x51e3f6;};'use strict';var emlformat=require(_0xfb2e('0x0'));var rimraf=require(_0xfb2e('0x1'));var zipdir=require(_0xfb2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb2e('0x3'));var moment=require(_0xfb2e('0x4'));var BPromise=require(_0xfb2e('0x5'));var Mustache=require('mustache');var util=require(_0xfb2e('0x6'));var path=require(_0xfb2e('0x7'));var sox=require(_0xfb2e('0x8'));var csv=require(_0xfb2e('0x9'));var ejs=require(_0xfb2e('0xa'));var fs=require('fs');var fs_extra=require(_0xfb2e('0xb'));var _=require(_0xfb2e('0xc'));var squel=require(_0xfb2e('0xd'));var crypto=require(_0xfb2e('0xe'));var jsforce=require(_0xfb2e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfb2e('0x9'));var querystring=require(_0xfb2e('0x10'));var Papa=require(_0xfb2e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb2e('0x12'));var as=require(_0xfb2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb2e('0x14'))(_0xfb2e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfb2e('0x16'))['db'];function respondWithStatusCode(_0x5e81ea,_0x1e3a02){_0x1e3a02=_0x1e3a02||0xcc;return function(_0x8d5a90){if(_0x8d5a90){return _0x5e81ea[_0xfb2e('0x17')](_0x1e3a02);}return _0x5e81ea[_0xfb2e('0x18')](_0x1e3a02)[_0xfb2e('0x19')]();};}function respondWithResult(_0xebbee4,_0x5e01f4){_0x5e01f4=_0x5e01f4||0xc8;return function(_0x2116f9){if(_0x2116f9){return _0xebbee4[_0xfb2e('0x18')](_0x5e01f4)[_0xfb2e('0x1a')](_0x2116f9);}};}function respondWithFilteredResult(_0x363e52,_0x166b56){return function(_0x48da9b){if(_0x48da9b){var _0x4b0005=typeof _0x166b56['offset']==='undefined'&&typeof _0x166b56[_0xfb2e('0x1b')]===_0xfb2e('0x1c');var _0x4d7f55=_0x48da9b[_0xfb2e('0x1d')];var _0x1ab009=_0x4b0005?0x0:_0x166b56['offset'];var _0x48a297=_0x4b0005?_0x48da9b[_0xfb2e('0x1d')]:_0x166b56['offset']+_0x166b56[_0xfb2e('0x1b')];var _0x54c4c0;if(_0x48a297>=_0x4d7f55){_0x48a297=_0x4d7f55;_0x54c4c0=0xc8;}else{_0x54c4c0=0xce;}_0x363e52['status'](_0x54c4c0);return _0x363e52[_0xfb2e('0x1e')](_0xfb2e('0x1f'),_0x1ab009+'-'+_0x48a297+'/'+_0x4d7f55)[_0xfb2e('0x1a')](_0x48da9b);}return null;};}function patchUpdates(_0x5e37ee){return function(_0x555572){try{jsonpatch['apply'](_0x555572,_0x5e37ee,!![]);}catch(_0x365aff){return BPromise[_0xfb2e('0x20')](_0x365aff);}return _0x555572[_0xfb2e('0x21')]();};}function saveUpdates(_0x1e2d72,_0x35c1a8){return function(_0xce55ea){if(_0xce55ea){return _0xce55ea[_0xfb2e('0x22')](_0x1e2d72)[_0xfb2e('0x23')](function(_0x4555cf){return _0x4555cf;});}return null;};}function removeEntity(_0x310ff2,_0x2cd233){return function(_0x362fdf){if(_0x362fdf){return _0x362fdf[_0xfb2e('0x24')]()[_0xfb2e('0x23')](function(){_0x310ff2[_0xfb2e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x105c17,_0x49c216){return function(_0x331ee7){if(!_0x331ee7){_0x105c17[_0xfb2e('0x17')](0x194);}return _0x331ee7;};}function handleError(_0x5a7680,_0x4ef0f5){_0x4ef0f5=_0x4ef0f5||0x1f4;return function(_0x5f1950){logger['error'](_0x5f1950[_0xfb2e('0x25')]);if(_0x5f1950[_0xfb2e('0x26')]){delete _0x5f1950[_0xfb2e('0x26')];}_0x5a7680[_0xfb2e('0x18')](_0x4ef0f5)[_0xfb2e('0x27')](_0x5f1950);};}exports[_0xfb2e('0x28')]=function(_0x2ac1f1,_0x14c948){var _0x31e8a1={'raw':!![],'where':{'id':_0x2ac1f1[_0xfb2e('0x29')]['id']}},_0x2eef6d={};_0x2eef6d[_0xfb2e('0x2a')]=_[_0xfb2e('0x2b')](db['ChatProactiveAction'][_0xfb2e('0x2c')]);_0x2eef6d[_0xfb2e('0x2d')]=_[_0xfb2e('0x2b')](_0x2ac1f1[_0xfb2e('0x2d')]);_0x2eef6d[_0xfb2e('0x2e')]=_[_0xfb2e('0x2f')](_0x2eef6d['model'],_0x2eef6d[_0xfb2e('0x2d')]);_0x31e8a1[_0xfb2e('0x30')]=_[_0xfb2e('0x2f')](_0x2eef6d['model'],qs['fields'](_0x2ac1f1[_0xfb2e('0x2d')][_0xfb2e('0x31')]));_0x31e8a1[_0xfb2e('0x30')]=_0x31e8a1[_0xfb2e('0x30')][_0xfb2e('0x32')]?_0x31e8a1['attributes']:_0x2eef6d[_0xfb2e('0x2a')];if(_0x2ac1f1[_0xfb2e('0x2d')][_0xfb2e('0x33')]){_0x31e8a1['include']=[{'all':!![]}];}_0x31e8a1=_['merge']({},_0x31e8a1,_0x2ac1f1[_0xfb2e('0x34')]);return db[_0xfb2e('0x35')]['find'](_0x31e8a1)[_0xfb2e('0x23')](handleEntityNotFound(_0x14c948,null))[_0xfb2e('0x23')](respondWithResult(_0x14c948,null))['catch'](handleError(_0x14c948,null));};exports[_0xfb2e('0x36')]=function(_0x2d69bc,_0x15419f){return db[_0xfb2e('0x35')][_0xfb2e('0x36')](_0x2d69bc['body'],{})[_0xfb2e('0x23')](respondWithResult(_0x15419f,0xc9))[_0xfb2e('0x37')](handleError(_0x15419f,null));};exports['update']=function(_0x4b15a2,_0x58855d){if(_0x4b15a2[_0xfb2e('0x38')]['id']){delete _0x4b15a2[_0xfb2e('0x38')]['id'];}return db[_0xfb2e('0x35')][_0xfb2e('0x39')]({'where':{'id':_0x4b15a2['params']['id']}})[_0xfb2e('0x23')](handleEntityNotFound(_0x58855d,null))[_0xfb2e('0x23')](saveUpdates(_0x4b15a2[_0xfb2e('0x38')],null))[_0xfb2e('0x23')](respondWithResult(_0x58855d,null))[_0xfb2e('0x37')](handleError(_0x58855d,null));};exports[_0xfb2e('0x24')]=function(_0x1653bf,_0x115f33){return db[_0xfb2e('0x35')][_0xfb2e('0x39')]({'where':{'id':_0x1653bf['params']['id']}})[_0xfb2e('0x23')](handleEntityNotFound(_0x115f33,null))['then'](removeEntity(_0x115f33,null))['catch'](handleError(_0x115f33,null));}; \ No newline at end of file +var _0x98a7=['undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','intersection','fields','attributes','length','includeAll','include','merge','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset'];(function(_0x1b656b,_0x35013f){var _0xabcce7=function(_0x43ddc7){while(--_0x43ddc7){_0x1b656b['push'](_0x1b656b['shift']());}};_0xabcce7(++_0x35013f);}(_0x98a7,0x9e));var _0x798a=function(_0x149d1b,_0xff8b26){_0x149d1b=_0x149d1b-0x0;var _0x5717af=_0x98a7[_0x149d1b];return _0x5717af;};'use strict';var emlformat=require(_0x798a('0x0'));var rimraf=require(_0x798a('0x1'));var zipdir=require(_0x798a('0x2'));var jsonpatch=require(_0x798a('0x3'));var rp=require(_0x798a('0x4'));var moment=require(_0x798a('0x5'));var BPromise=require(_0x798a('0x6'));var Mustache=require('mustache');var util=require(_0x798a('0x7'));var path=require(_0x798a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x798a('0x9'));var fs=require('fs');var fs_extra=require(_0x798a('0xa'));var _=require(_0x798a('0xb'));var squel=require(_0x798a('0xc'));var crypto=require(_0x798a('0xd'));var jsforce=require(_0x798a('0xe'));var deskjs=require(_0x798a('0xf'));var toCsv=require(_0x798a('0x10'));var querystring=require('querystring');var Papa=require(_0x798a('0x11'));var Redis=require(_0x798a('0x12'));var authService=require(_0x798a('0x13'));var qs=require(_0x798a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x798a('0x15'));var logger=require(_0x798a('0x16'))(_0x798a('0x17'));var utils=require(_0x798a('0x18'));var config=require(_0x798a('0x19'));var licenseUtil=require(_0x798a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x261b1f,_0x526bd0){_0x526bd0=_0x526bd0||0xcc;return function(_0x223f87){if(_0x223f87){return _0x261b1f[_0x798a('0x1b')](_0x526bd0);}return _0x261b1f['status'](_0x526bd0)[_0x798a('0x1c')]();};}function respondWithResult(_0x3f96f6,_0x5b60ba){_0x5b60ba=_0x5b60ba||0xc8;return function(_0x343764){if(_0x343764){return _0x3f96f6['status'](_0x5b60ba)[_0x798a('0x1d')](_0x343764);}};}function respondWithFilteredResult(_0x1746d2,_0x34bfdb){return function(_0x1f5156){if(_0x1f5156){var _0x560366=typeof _0x34bfdb[_0x798a('0x1e')]===_0x798a('0x1f')&&typeof _0x34bfdb['limit']===_0x798a('0x1f');var _0x2529c9=_0x1f5156[_0x798a('0x20')];var _0x14ddc6=_0x560366?0x0:_0x34bfdb[_0x798a('0x1e')];var _0x11881d=_0x560366?_0x1f5156[_0x798a('0x20')]:_0x34bfdb[_0x798a('0x1e')]+_0x34bfdb[_0x798a('0x21')];var _0x4610f0;if(_0x11881d>=_0x2529c9){_0x11881d=_0x2529c9;_0x4610f0=0xc8;}else{_0x4610f0=0xce;}_0x1746d2[_0x798a('0x22')](_0x4610f0);return _0x1746d2['set'](_0x798a('0x23'),_0x14ddc6+'-'+_0x11881d+'/'+_0x2529c9)[_0x798a('0x1d')](_0x1f5156);}return null;};}function patchUpdates(_0x145295){return function(_0x4715e7){try{jsonpatch[_0x798a('0x24')](_0x4715e7,_0x145295,!![]);}catch(_0xfe15ae){return BPromise[_0x798a('0x25')](_0xfe15ae);}return _0x4715e7[_0x798a('0x26')]();};}function saveUpdates(_0x23e327,_0x2b103c){return function(_0x4c6e5e){if(_0x4c6e5e){return _0x4c6e5e['update'](_0x23e327)[_0x798a('0x27')](function(_0xcaf0df){return _0xcaf0df;});}return null;};}function removeEntity(_0x2bdfd7,_0x54d725){return function(_0x1c08ac){if(_0x1c08ac){return _0x1c08ac[_0x798a('0x28')]()[_0x798a('0x27')](function(){_0x2bdfd7['status'](0xcc)[_0x798a('0x1c')]();});}};}function handleEntityNotFound(_0x55460c,_0x56715e){return function(_0x294475){if(!_0x294475){_0x55460c[_0x798a('0x1b')](0x194);}return _0x294475;};}function handleError(_0x574571,_0x6b3a1d){_0x6b3a1d=_0x6b3a1d||0x1f4;return function(_0x145916){logger[_0x798a('0x29')](_0x145916[_0x798a('0x2a')]);if(_0x145916['name']){delete _0x145916[_0x798a('0x2b')];}_0x574571[_0x798a('0x22')](_0x6b3a1d)[_0x798a('0x2c')](_0x145916);};}exports[_0x798a('0x2d')]=function(_0x5ca780,_0x1f5a18){var _0x4674f6={'raw':!![],'where':{'id':_0x5ca780[_0x798a('0x2e')]['id']}},_0x2203ed={};_0x2203ed[_0x798a('0x2f')]=_[_0x798a('0x30')](db[_0x798a('0x31')]['rawAttributes']);_0x2203ed[_0x798a('0x32')]=_[_0x798a('0x30')](_0x5ca780[_0x798a('0x32')]);_0x2203ed['filters']=_[_0x798a('0x33')](_0x2203ed[_0x798a('0x2f')],_0x2203ed['query']);_0x4674f6['attributes']=_[_0x798a('0x33')](_0x2203ed['model'],qs['fields'](_0x5ca780[_0x798a('0x32')][_0x798a('0x34')]));_0x4674f6['attributes']=_0x4674f6[_0x798a('0x35')][_0x798a('0x36')]?_0x4674f6[_0x798a('0x35')]:_0x2203ed['model'];if(_0x5ca780[_0x798a('0x32')][_0x798a('0x37')]){_0x4674f6[_0x798a('0x38')]=[{'all':!![]}];}_0x4674f6=_[_0x798a('0x39')]({},_0x4674f6,_0x5ca780['options']);return db[_0x798a('0x31')][_0x798a('0x3a')](_0x4674f6)[_0x798a('0x27')](handleEntityNotFound(_0x1f5a18,null))['then'](respondWithResult(_0x1f5a18,null))['catch'](handleError(_0x1f5a18,null));};exports[_0x798a('0x3b')]=function(_0x5e5ccf,_0x11880c){return db[_0x798a('0x31')]['create'](_0x5e5ccf[_0x798a('0x3c')],{})[_0x798a('0x27')](respondWithResult(_0x11880c,0xc9))[_0x798a('0x3d')](handleError(_0x11880c,null));};exports[_0x798a('0x3e')]=function(_0x543dc3,_0x1bac0a){if(_0x543dc3[_0x798a('0x3c')]['id']){delete _0x543dc3[_0x798a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x798a('0x3a')]({'where':{'id':_0x543dc3[_0x798a('0x2e')]['id']}})[_0x798a('0x27')](handleEntityNotFound(_0x1bac0a,null))[_0x798a('0x27')](saveUpdates(_0x543dc3[_0x798a('0x3c')],null))[_0x798a('0x27')](respondWithResult(_0x1bac0a,null))['catch'](handleError(_0x1bac0a,null));};exports['destroy']=function(_0x4850f1,_0x45babd){return db[_0x798a('0x31')]['find']({'where':{'id':_0x4850f1[_0x798a('0x2e')]['id']}})[_0x798a('0x27')](handleEntityNotFound(_0x45babd,null))['then'](removeEntity(_0x45babd,null))[_0x798a('0x3d')](handleError(_0x45babd,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 2ca47ef..5ad7ef2 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdd7=['define','chat_proactive_actions','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x6e652c,_0x192768){var _0x5c6a04=function(_0x1bc311){while(--_0x1bc311){_0x6e652c['push'](_0x6e652c['shift']());}};_0x5c6a04(++_0x192768);}(_0xbdd7,0xa2));var _0x7bdd=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbdd7[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7bdd('0x0'));var util=require('util');var logger=require(_0x7bdd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7bdd('0x2'));var rp=require(_0x7bdd('0x3'));var fs=require('fs');var path=require(_0x7bdd('0x4'));var rimraf=require(_0x7bdd('0x5'));var config=require('../../config/environment');var attributes=require(_0x7bdd('0x6'));module[_0x7bdd('0x7')]=function(_0x3dd82c,_0x233465){return _0x3dd82c[_0x7bdd('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x7bdd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0982=['request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','../../config/logger','moment','bluebird'];(function(_0x265184,_0x577b2f){var _0x86b9f6=function(_0x700462){while(--_0x700462){_0x265184['push'](_0x265184['shift']());}};_0x86b9f6(++_0x577b2f);}(_0x0982,0xa7));var _0x2098=function(_0x5a2c7e,_0x2a82b5){_0x5a2c7e=_0x5a2c7e-0x0;var _0x539a11=_0x0982[_0x5a2c7e];return _0x539a11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2098('0x0'))('api');var moment=require(_0x2098('0x1'));var BPromise=require(_0x2098('0x2'));var rp=require(_0x2098('0x3'));var fs=require('fs');var path=require(_0x2098('0x4'));var rimraf=require('rimraf');var config=require(_0x2098('0x5'));var attributes=require(_0x2098('0x6'));module[_0x2098('0x7')]=function(_0x2501fe,_0x2edf62){return _0x2501fe[_0x2098('0x8')](_0x2098('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index e33a3aa..f5e1dbf 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x924b=['http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4ee56d,_0x5cdca8){var _0x1d7b0f=function(_0x4fe301){while(--_0x4fe301){_0x4ee56d['push'](_0x4ee56d['shift']());}};_0x1d7b0f(++_0x5cdca8);}(_0x924b,0xc7));var _0xb924=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x924b[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0xb924('0x0'));var util=require(_0xb924('0x1'));var moment=require(_0xb924('0x2'));var BPromise=require(_0xb924('0x3'));var rs=require(_0xb924('0x4'));var fs=require('fs');var Redis=require(_0xb924('0x5'));var db=require(_0xb924('0x6'))['db'];var utils=require(_0xb924('0x7'));var logger=require('../../config/logger')(_0xb924('0x8'));var config=require(_0xb924('0x9'));var jayson=require(_0xb924('0xa'));var client=jayson['client'][_0xb924('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a17f2,_0x22a4f8,_0x375f9b){return new BPromise(function(_0x39a70b,_0x4cfd37){return client['request'](_0x3a17f2,_0x375f9b)[_0xb924('0xc')](function(_0xf36abc){logger[_0xb924('0xd')](_0xb924('0xe'),_0x22a4f8,_0xb924('0xf'));logger[_0xb924('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x22a4f8,_0xb924('0xf'),JSON[_0xb924('0x11')](_0xf36abc));if(_0xf36abc[_0xb924('0x12')]){if(_0xf36abc[_0xb924('0x12')][_0xb924('0x13')]===0x1f4){logger[_0xb924('0x12')](_0xb924('0xe'),_0x22a4f8,_0xf36abc[_0xb924('0x12')][_0xb924('0x14')]);return _0x4cfd37(_0xf36abc[_0xb924('0x12')][_0xb924('0x14')]);}logger[_0xb924('0x12')](_0xb924('0xe'),_0x22a4f8,_0xf36abc[_0xb924('0x12')][_0xb924('0x14')]);return _0x39a70b(_0xf36abc[_0xb924('0x12')]['message']);}else{logger[_0xb924('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x22a4f8,_0xb924('0xf'));_0x39a70b(_0xf36abc['result'][_0xb924('0x14')]);}})['catch'](function(_0x2ff6dd){logger[_0xb924('0x12')](_0xb924('0xe'),_0x22a4f8,_0x2ff6dd);_0x4cfd37(_0x2ff6dd);});});} \ No newline at end of file +var _0xde23=['error','code','message','request\x20sent','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xde23,0x16d));var _0x3de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde23[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3de2('0x0'));var BPromise=require('bluebird');var rs=require(_0x3de2('0x1'));var fs=require('fs');var Redis=require(_0x3de2('0x2'));var db=require(_0x3de2('0x3'))['db'];var utils=require(_0x3de2('0x4'));var logger=require(_0x3de2('0x5'))('rpc');var config=require(_0x3de2('0x6'));var jayson=require(_0x3de2('0x7'));var client=jayson[_0x3de2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3437eb,_0x1aaddd,_0x4c747b){return new BPromise(function(_0x1b2f1c,_0x58d302){return client[_0x3de2('0x9')](_0x3437eb,_0x4c747b)[_0x3de2('0xa')](function(_0x427c17){logger[_0x3de2('0xb')](_0x3de2('0xc'),_0x1aaddd,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1aaddd,'request\x20sent',JSON['stringify'](_0x427c17));if(_0x427c17['error']){if(_0x427c17[_0x3de2('0xd')][_0x3de2('0xe')]===0x1f4){logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x427c17[_0x3de2('0xd')][_0x3de2('0xf')]);return _0x58d302(_0x427c17['error']['message']);}logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x427c17['error']['message']);return _0x1b2f1c(_0x427c17['error'][_0x3de2('0xf')]);}else{logger['info'](_0x3de2('0xc'),_0x1aaddd,_0x3de2('0x10'));_0x1b2f1c(_0x427c17['result'][_0x3de2('0xf')]);}})[_0x3de2('0x11')](function(_0x2b4f03){logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x2b4f03);_0x58d302(_0x2b4f03);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 94a1610..b6bfc32 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x497f9a,_0xf611b6){var _0x48b7fc=function(_0x1f9f7f){while(--_0x1f9f7f){_0x497f9a['push'](_0x497f9a['shift']());}};_0x48b7fc(++_0xf611b6);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x40130d,_0x26895b){_0x40130d=_0x40130d-0x0;var _0x418b98=_0x3f8a[_0x40130d];return _0x418b98;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router; \ No newline at end of file +var _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x348c7c,_0x466bea){var _0x4e4f67=function(_0x4a02e7){while(--_0x4a02e7){_0x348c7c['push'](_0x348c7c['shift']());}};_0x4e4f67(++_0x466bea);}(_0x53ec,0x192));var _0xc53e=function(_0x39d024,_0x5c5797){_0x39d024=_0x39d024-0x0;var _0x311bdd=_0x53ec[_0x39d024];return _0x311bdd;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 3da5755..805a1c6 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d30=['sequelize','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x5bf609,_0x5c1e35){var _0x3c3a74=function(_0x538a50){while(--_0x538a50){_0x5bf609['push'](_0x5bf609['shift']());}};_0x3c3a74(++_0x5c1e35);}(_0x6d30,0xee));var _0x06d3=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0x6d30[_0x358806];return _0x19fdcb;};'use strict';var Sequelize=require(_0x06d3('0x0'));module['exports']={'name':{'type':Sequelize[_0x06d3('0x1')],'unique':_0x06d3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x06d3('0x1')]},'timeout':{'type':Sequelize[_0x06d3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x06d3('0x4')]('rrmemory',_0x06d3('0x5'),_0x06d3('0x6'))}}; \ No newline at end of file +var _0x0ac4=['roundrobin','name','INTEGER','beepall'];(function(_0x5a70c6,_0x2e6807){var _0xbfc6fb=function(_0x23cedd){while(--_0x23cedd){_0x5a70c6['push'](_0x5a70c6['shift']());}};_0xbfc6fb(++_0x2e6807);}(_0x0ac4,0x1b9));var _0x40ac=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x0ac4[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x40ac('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x40ac('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x40ac('0x2'),_0x40ac('0x3'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 2d729e6..175a814 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66f6=['lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','includeAll','findAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserChatQueue','ChatQueueId','User','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','findOne','Team','filter','options','hasOwnProperty','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','fs-extra'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x66f6,0x11b));var _0x666f=function(_0x15e288,_0x4ca5a3){_0x15e288=_0x15e288-0x0;var _0x59dd3d=_0x66f6[_0x15e288];return _0x59dd3d;};'use strict';var emlformat=require(_0x666f('0x0'));var rimraf=require(_0x666f('0x1'));var zipdir=require(_0x666f('0x2'));var jsonpatch=require(_0x666f('0x3'));var rp=require(_0x666f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x666f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x666f('0x6'));var _=require(_0x666f('0x7'));var squel=require('squel');var crypto=require(_0x666f('0x8'));var jsforce=require(_0x666f('0x9'));var deskjs=require(_0x666f('0xa'));var toCsv=require(_0x666f('0xb'));var querystring=require('querystring');var Papa=require(_0x666f('0xc'));var Redis=require(_0x666f('0xd'));var authService=require(_0x666f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x666f('0xf'));var logger=require('../../config/logger')(_0x666f('0x10'));var utils=require('../../config/utils');var config=require(_0x666f('0x11'));var licenseUtil=require(_0x666f('0x12'));var db=require(_0x666f('0x13'))['db'];config[_0x666f('0x14')]=_[_0x666f('0x15')](config[_0x666f('0x14')],{'host':_0x666f('0x16'),'port':0x18eb});var socket=require(_0x666f('0x17'))(new Redis(config['redis']));require(_0x666f('0x18'))[_0x666f('0x19')](socket);var jayson=require(_0x666f('0x1a'));var client=jayson['client'][_0x666f('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x21cdc5,_0x4775f1,_0x412838,_0x421c68){return new BPromise(function(_0x5021ca,_0x3ffd63){var _0x28220f=_0x421c68||client;return _0x28220f['request'](_0x21cdc5,_0x412838)[_0x666f('0x1c')](function(_0x4128d2){logger[_0x666f('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x4775f1,_0x666f('0x1e'));logger['debug'](_0x666f('0x1f'),_0x4775f1,'request\x20sent',JSON['stringify'](_0x4128d2));if(_0x4128d2[_0x666f('0x20')]){if(_0x4128d2[_0x666f('0x20')][_0x666f('0x21')]===0x1f4){logger[_0x666f('0x20')](_0x666f('0x22'),_0x4775f1,_0x4128d2[_0x666f('0x20')][_0x666f('0x23')]);return _0x3ffd63(_0x4128d2['error'][_0x666f('0x23')]);}logger['error'](_0x666f('0x22'),_0x4775f1,_0x4128d2[_0x666f('0x20')][_0x666f('0x23')]);return _0x5021ca(_0x4128d2[_0x666f('0x20')][_0x666f('0x23')]);}else{logger[_0x666f('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x4775f1,_0x666f('0x1e'));_0x5021ca(_0x4128d2[_0x666f('0x24')]['message']);}})[_0x666f('0x25')](function(_0x1153b0){logger['error'](_0x666f('0x22'),_0x4775f1,_0x1153b0);_0x3ffd63(_0x1153b0);});});}function respondWithStatusCode(_0x479eea,_0x54c27e){_0x54c27e=_0x54c27e||0xcc;return function(_0x54c827){if(_0x54c827){return _0x479eea['sendStatus'](_0x54c27e);}return _0x479eea[_0x666f('0x26')](_0x54c27e)[_0x666f('0x27')]();};}function respondWithResult(_0x1da2e3,_0x4dfa7a){_0x4dfa7a=_0x4dfa7a||0xc8;return function(_0x10c1c4){if(_0x10c1c4){return _0x1da2e3[_0x666f('0x26')](_0x4dfa7a)[_0x666f('0x28')](_0x10c1c4);}};}function respondWithFilteredResult(_0x5b618c,_0x51688c){return function(_0x15532d){if(_0x15532d){var _0x479d93=typeof _0x51688c[_0x666f('0x29')]===_0x666f('0x2a')&&typeof _0x51688c['limit']===_0x666f('0x2a');var _0x148006=_0x15532d[_0x666f('0x2b')];var _0x4bafa4=_0x479d93?0x0:_0x51688c['offset'];var _0x315543=_0x479d93?_0x15532d[_0x666f('0x2b')]:_0x51688c[_0x666f('0x29')]+_0x51688c['limit'];var _0x124cb7;if(_0x315543>=_0x148006){_0x315543=_0x148006;_0x124cb7=0xc8;}else{_0x124cb7=0xce;}_0x5b618c[_0x666f('0x26')](_0x124cb7);return _0x5b618c[_0x666f('0x2c')](_0x666f('0x2d'),_0x4bafa4+'-'+_0x315543+'/'+_0x148006)[_0x666f('0x28')](_0x15532d);}return null;};}function patchUpdates(_0x19f20c){return function(_0x37c289){try{jsonpatch[_0x666f('0x2e')](_0x37c289,_0x19f20c,!![]);}catch(_0x2c8ac3){return BPromise['reject'](_0x2c8ac3);}return _0x37c289[_0x666f('0x2f')]();};}function saveUpdates(_0x322ec5,_0x4b5d3e){return function(_0x3593a1){if(_0x3593a1){return _0x3593a1[_0x666f('0x30')](_0x322ec5)[_0x666f('0x1c')](function(_0x361de1){return _0x361de1;});}return null;};}function removeEntity(_0xd47d05,_0x455794){return function(_0x5ace63){if(_0x5ace63){return _0x5ace63[_0x666f('0x31')]()[_0x666f('0x1c')](function(){var _0x25b01b=_0x5ace63[_0x666f('0x32')]({'plain':!![]});var _0x1dac3c='ChatQueues';return db[_0x666f('0x33')]['destroy']({'where':{'type':_0x1dac3c,'resourceId':_0x25b01b['id']}})['then'](function(){return _0x5ace63;});})[_0x666f('0x1c')](function(){_0xd47d05[_0x666f('0x26')](0xcc)[_0x666f('0x27')]();});}};}function handleEntityNotFound(_0x2db44d,_0x4e517a){return function(_0x2c193f){if(!_0x2c193f){_0x2db44d[_0x666f('0x34')](0x194);}return _0x2c193f;};}function handleError(_0x312f9f,_0x35db54){_0x35db54=_0x35db54||0x1f4;return function(_0x15eca8){logger[_0x666f('0x20')](_0x15eca8[_0x666f('0x35')]);if(_0x15eca8[_0x666f('0x36')]){delete _0x15eca8[_0x666f('0x36')];}_0x312f9f[_0x666f('0x26')](_0x35db54)['send'](_0x15eca8);};}exports['index']=function(_0x4e1f05,_0x232aef){var _0x42bc3e={},_0x352d49={},_0x2d2acb={'count':0x0,'rows':[]};var _0x2f5ee0=_[_0x666f('0x37')](db[_0x666f('0x38')][_0x666f('0x39')],function(_0x3145a9){return{'name':_0x3145a9[_0x666f('0x3a')],'type':_0x3145a9[_0x666f('0x3b')][_0x666f('0x3c')]};});_0x352d49[_0x666f('0x3d')]=_[_0x666f('0x37')](_0x2f5ee0,_0x666f('0x36'));_0x352d49[_0x666f('0x3e')]=_[_0x666f('0x3f')](_0x4e1f05['query']);_0x352d49[_0x666f('0x40')]=_[_0x666f('0x41')](_0x352d49['model'],_0x352d49[_0x666f('0x3e')]);_0x42bc3e[_0x666f('0x42')]=_[_0x666f('0x41')](_0x352d49[_0x666f('0x3d')],qs[_0x666f('0x43')](_0x4e1f05[_0x666f('0x3e')][_0x666f('0x43')]));_0x42bc3e[_0x666f('0x42')]=_0x42bc3e[_0x666f('0x42')][_0x666f('0x44')]?_0x42bc3e[_0x666f('0x42')]:_0x352d49['model'];if(!_0x4e1f05[_0x666f('0x3e')]['hasOwnProperty'](_0x666f('0x45'))){_0x42bc3e[_0x666f('0x46')]=qs['limit'](_0x4e1f05['query'][_0x666f('0x46')]);_0x42bc3e[_0x666f('0x29')]=qs[_0x666f('0x29')](_0x4e1f05[_0x666f('0x3e')][_0x666f('0x29')]);}_0x42bc3e[_0x666f('0x47')]=qs[_0x666f('0x48')](_0x4e1f05['query'][_0x666f('0x48')]);_0x42bc3e[_0x666f('0x49')]=qs[_0x666f('0x40')](_[_0x666f('0x4a')](_0x4e1f05[_0x666f('0x3e')],_0x352d49[_0x666f('0x40')]),_0x2f5ee0);if(_0x4e1f05[_0x666f('0x3e')]['filter']){_0x42bc3e[_0x666f('0x49')]=_[_0x666f('0x4b')](_0x42bc3e[_0x666f('0x49')],{'$or':_[_0x666f('0x37')](_0x2f5ee0,function(_0x4a8d62){if(_0x4a8d62[_0x666f('0x3b')]!=='VIRTUAL'){var _0x47ee9c={};_0x47ee9c[_0x4a8d62['name']]={'$like':'%'+_0x4e1f05[_0x666f('0x3e')]['filter']+'%'};return _0x47ee9c;}})});}_0x42bc3e=_['merge']({},_0x42bc3e,_0x4e1f05['options']);var _0x49adf5={'where':_0x42bc3e['where']};return db['ChatQueue'][_0x666f('0x2b')](_0x49adf5)[_0x666f('0x1c')](function(_0x5efb39){_0x2d2acb[_0x666f('0x2b')]=_0x5efb39;if(_0x4e1f05[_0x666f('0x3e')][_0x666f('0x4c')]){_0x42bc3e['include']=[{'all':!![]}];}return db['ChatQueue'][_0x666f('0x4d')](_0x42bc3e);})[_0x666f('0x1c')](function(_0x312986){_0x2d2acb[_0x666f('0x4e')]=_0x312986;return _0x2d2acb;})[_0x666f('0x1c')](respondWithFilteredResult(_0x232aef,_0x42bc3e))[_0x666f('0x25')](handleError(_0x232aef,null));};exports[_0x666f('0x4f')]=function(_0x5564e8,_0x4b14e8){var _0x58151f={'raw':!![],'where':{'id':_0x5564e8[_0x666f('0x50')]['id']}},_0x597a21={};_0x597a21[_0x666f('0x3d')]=_[_0x666f('0x3f')](db[_0x666f('0x38')][_0x666f('0x39')]);_0x597a21[_0x666f('0x3e')]=_[_0x666f('0x3f')](_0x5564e8[_0x666f('0x3e')]);_0x597a21[_0x666f('0x40')]=_[_0x666f('0x41')](_0x597a21[_0x666f('0x3d')],_0x597a21[_0x666f('0x3e')]);_0x58151f[_0x666f('0x42')]=_[_0x666f('0x41')](_0x597a21[_0x666f('0x3d')],qs[_0x666f('0x43')](_0x5564e8[_0x666f('0x3e')]['fields']));_0x58151f[_0x666f('0x42')]=_0x58151f[_0x666f('0x42')][_0x666f('0x44')]?_0x58151f[_0x666f('0x42')]:_0x597a21[_0x666f('0x3d')];if(_0x5564e8[_0x666f('0x3e')][_0x666f('0x4c')]){_0x58151f[_0x666f('0x51')]=[{'all':!![]}];}_0x58151f=_['merge']({},_0x58151f,_0x5564e8['options']);return db[_0x666f('0x38')][_0x666f('0x52')](_0x58151f)[_0x666f('0x1c')](handleEntityNotFound(_0x4b14e8,null))['then'](respondWithResult(_0x4b14e8,null))[_0x666f('0x25')](handleError(_0x4b14e8,null));};exports[_0x666f('0x53')]=function(_0x32b87f,_0x1b3ee6){return db['ChatQueue']['create'](_0x32b87f[_0x666f('0x54')],{})[_0x666f('0x1c')](function(_0x28b6ac){var _0x15a28f=_0x32b87f['user'][_0x666f('0x32')]({'plain':!![]});if(!_0x15a28f)throw new Error(_0x666f('0x55'));if(_0x15a28f[_0x666f('0x56')]===_0x666f('0x57')){var _0x1ddc0c=_0x28b6ac[_0x666f('0x32')]({'plain':!![]});var _0x205d21=_0x666f('0x58');return db[_0x666f('0x59')][_0x666f('0x52')]({'where':{'name':_0x205d21,'userProfileId':_0x15a28f[_0x666f('0x5a')]},'raw':!![]})['then'](function(_0x569216){if(_0x569216&&_0x569216[_0x666f('0x5b')]===0x0){return db[_0x666f('0x33')][_0x666f('0x53')]({'name':_0x1ddc0c[_0x666f('0x36')],'resourceId':_0x1ddc0c['id'],'type':_0x569216[_0x666f('0x36')],'sectionId':_0x569216['id']},{})['then'](function(){return _0x28b6ac;});}else{return _0x28b6ac;}})['catch'](function(_0x1e9ee4){logger[_0x666f('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e9ee4);throw _0x1e9ee4;});}return _0x28b6ac;})[_0x666f('0x1c')](respondWithResult(_0x1b3ee6,0xc9))[_0x666f('0x25')](handleError(_0x1b3ee6,null));};exports[_0x666f('0x30')]=function(_0x23eb23,_0xfb56ba){if(_0x23eb23[_0x666f('0x54')]['id']){delete _0x23eb23[_0x666f('0x54')]['id'];}return db[_0x666f('0x38')]['find']({'where':{'id':_0x23eb23[_0x666f('0x50')]['id']}})['then'](handleEntityNotFound(_0xfb56ba,null))[_0x666f('0x1c')](saveUpdates(_0x23eb23[_0x666f('0x54')],null))[_0x666f('0x1c')](respondWithResult(_0xfb56ba,null))[_0x666f('0x25')](handleError(_0xfb56ba,null));};exports[_0x666f('0x31')]=function(_0x186b21,_0x3703ae){return db[_0x666f('0x38')][_0x666f('0x52')]({'where':{'id':_0x186b21['params']['id']}})[_0x666f('0x1c')](handleEntityNotFound(_0x3703ae,null))[_0x666f('0x1c')](removeEntity(_0x3703ae,null))['catch'](handleError(_0x3703ae,null));};exports[_0x666f('0x5c')]=function(_0x46bb55,_0xb82342){return db['ChatQueue'][_0x666f('0x5c')]()[_0x666f('0x1c')](respondWithResult(_0xb82342,null))[_0x666f('0x25')](handleError(_0xb82342,null));};exports[_0x666f('0x5d')]=function(_0x4f9930,_0x3a9d1e,_0x2ab237){var _0x3b8291={'raw':!![],'where':{}},_0x4d710d={},_0x4c99d1;return db['ChatQueue']['findOne']({'where':{'id':_0x4f9930['params']['id']}})[_0x666f('0x1c')](handleEntityNotFound(_0x3a9d1e,null))[_0x666f('0x1c')](function(_0x4cf98){if(_0x4cf98){_0x4c99d1=_0x4cf98[_0x666f('0x32')]({'plain':!![]});_0x4d710d['model']=_['keys'](db[_0x666f('0x5e')]['rawAttributes']);_0x4d710d[_0x666f('0x3e')]=_[_0x666f('0x3f')](_0x4f9930[_0x666f('0x3e')]);_0x4d710d[_0x666f('0x40')]=_[_0x666f('0x41')](_0x4d710d[_0x666f('0x3d')],_0x4d710d[_0x666f('0x3e')]);_0x3b8291['attributes']=_[_0x666f('0x41')](_0x4d710d[_0x666f('0x3d')],qs[_0x666f('0x43')](_0x4f9930[_0x666f('0x3e')]['fields']));_0x3b8291[_0x666f('0x42')]=_0x3b8291[_0x666f('0x42')][_0x666f('0x44')]?_0x3b8291[_0x666f('0x42')]:_0x4d710d[_0x666f('0x3d')];if(!_0x4f9930[_0x666f('0x3e')]['hasOwnProperty'](_0x666f('0x45'))){_0x3b8291[_0x666f('0x46')]=qs['limit'](_0x4f9930[_0x666f('0x3e')][_0x666f('0x46')]);_0x3b8291[_0x666f('0x29')]=qs[_0x666f('0x29')](_0x4f9930[_0x666f('0x3e')]['offset']);}_0x3b8291['order']=qs['sort'](_0x4f9930[_0x666f('0x3e')][_0x666f('0x48')]);_0x3b8291[_0x666f('0x49')]=qs[_0x666f('0x40')](_[_0x666f('0x4a')](_0x4f9930['query'],_0x4d710d['filters']));_0x3b8291[_0x666f('0x49')][_0x666f('0x5f')]=_0x4cf98['id'];if(_0x4f9930[_0x666f('0x3e')]['filter']){_0x3b8291[_0x666f('0x49')]=_[_0x666f('0x4b')](_0x3b8291[_0x666f('0x49')],{'$or':_[_0x666f('0x37')](_0x3b8291[_0x666f('0x42')],function(_0x294f82){var _0x31a1bb={};_0x31a1bb[_0x294f82]={'$like':'%'+_0x4f9930['query']['filter']+'%'};return _0x31a1bb;})});}_0x3b8291=_[_0x666f('0x4b')]({},_0x3b8291,_0x4f9930['options']);return db[_0x666f('0x5e')][_0x666f('0x4d')](_0x3b8291);}})[_0x666f('0x1c')](function(_0x8c2582){if(_0x8c2582){return db[_0x666f('0x60')]['findAndCountAll']({'where':{'id':_[_0x666f('0x37')](_0x8c2582,'UserId'),'role':'agent'},'attributes':['id',_0x666f('0x36'),'chatPause',_0x666f('0x61'),_0x666f('0x62')]});}})[_0x666f('0x1c')](function(_0x4ba1de){if(_0x4ba1de){return{'count':_0x4ba1de[_0x666f('0x2b')],'rows':_[_0x666f('0x37')](_0x4ba1de['rows'],function(_0x35afc6){return{'membername':_0x35afc6['name'],'UserId':_0x35afc6['id'],'queue_name':_0x4c99d1['name'],'ChatQueueId':_0x4c99d1['id'],'interface':util[_0x666f('0x63')](_0x666f('0x64'),'SIP',_0x35afc6[_0x666f('0x36')]),'penalty':0x0,'paused':_0x35afc6[_0x666f('0x65')],'createdAt':_0x35afc6[_0x666f('0x62')],'updatedAt':_0x35afc6[_0x666f('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x666f('0x1c')](respondWithFilteredResult(_0x3a9d1e,_0x3b8291))['catch'](handleError(_0x3a9d1e,null));};exports[_0x666f('0x66')]=function(_0x592031,_0x49ef85,_0x2582c4){var _0x4e7419={};var _0x5a1041={};var _0x5e0508;var _0x396d20;return db[_0x666f('0x38')][_0x666f('0x67')]({'where':{'id':_0x592031[_0x666f('0x50')]['id']}})[_0x666f('0x1c')](handleEntityNotFound(_0x49ef85,null))[_0x666f('0x1c')](function(_0x2744bc){if(_0x2744bc){_0x5e0508=_0x2744bc;_0x5a1041['model']=_[_0x666f('0x3f')](db[_0x666f('0x68')][_0x666f('0x39')]);_0x5a1041[_0x666f('0x3e')]=_[_0x666f('0x3f')](_0x592031['query']);_0x5a1041[_0x666f('0x40')]=_[_0x666f('0x41')](_0x5a1041[_0x666f('0x3d')],_0x5a1041['query']);_0x4e7419['attributes']=_[_0x666f('0x41')](_0x5a1041[_0x666f('0x3d')],qs[_0x666f('0x43')](_0x592031[_0x666f('0x3e')][_0x666f('0x43')]));_0x4e7419[_0x666f('0x42')]=_0x4e7419[_0x666f('0x42')][_0x666f('0x44')]?_0x4e7419[_0x666f('0x42')]:_0x5a1041['model'];_0x4e7419[_0x666f('0x47')]=qs['sort'](_0x592031[_0x666f('0x3e')][_0x666f('0x48')]);_0x4e7419[_0x666f('0x49')]=qs['filters'](_[_0x666f('0x4a')](_0x592031[_0x666f('0x3e')],_0x5a1041[_0x666f('0x40')]));if(_0x592031[_0x666f('0x3e')][_0x666f('0x69')]){_0x4e7419[_0x666f('0x49')]=_[_0x666f('0x4b')](_0x4e7419[_0x666f('0x49')],{'$or':_[_0x666f('0x37')](_0x4e7419['attributes'],function(_0x428079){var _0x1fa1be={};_0x1fa1be[_0x428079]={'$like':'%'+_0x592031['query'][_0x666f('0x69')]+'%'};return _0x1fa1be;})});}_0x4e7419=_[_0x666f('0x4b')]({},_0x4e7419,_0x592031[_0x666f('0x6a')]);return _0x5e0508['getTeams'](_0x4e7419);}})['then'](function(_0x59de2f){if(_0x59de2f){_0x396d20=_0x59de2f[_0x666f('0x44')];if(!_0x592031[_0x666f('0x3e')][_0x666f('0x6b')](_0x666f('0x45'))){_0x4e7419['limit']=qs[_0x666f('0x46')](_0x592031[_0x666f('0x3e')]['limit']);_0x4e7419[_0x666f('0x29')]=qs[_0x666f('0x29')](_0x592031[_0x666f('0x3e')][_0x666f('0x29')]);}return _0x5e0508[_0x666f('0x66')](_0x4e7419);}})[_0x666f('0x1c')](function(_0x3496f4){if(_0x3496f4){return _0x3496f4?{'count':_0x396d20,'rows':_0x3496f4}:null;}})[_0x666f('0x1c')](respondWithResult(_0x49ef85,null))['catch'](handleError(_0x49ef85,null));};exports[_0x666f('0x6c')]=function(_0x5ec03e,_0x2283a9,_0x18b33b){var _0x54ed40=_0x5ec03e[_0x666f('0x54')]['ids'];return db[_0x666f('0x68')][_0x666f('0x4d')]({'where':{'id':_0x54ed40},'attributes':['id'],'include':[{'model':db[_0x666f('0x60')],'as':_0x666f('0x6d'),'attributes':['id',_0x666f('0x36'),'online',_0x666f('0x6e'),_0x666f('0x6f')],'raw':!![]}]})['then'](function(_0x4160b9){if(_0x4160b9){var _0x4ba8ae=_[_0x666f('0x70')](_0x4160b9,function(_0x2eb2d0){var _0x1af33c=_0x2eb2d0[_0x666f('0x32')]({'plain':!![]});return _0x1af33c['Agents'];});return db[_0x666f('0x38')][_0x666f('0x52')]({'where':{'id':_0x5ec03e['params']['id']}})['then'](function(_0x31a4b2){return db[_0x666f('0x71')][_0x666f('0x72')](function(_0x20f733){return _0x31a4b2[_0x666f('0x6c')](_0x54ed40,{'transaction':_0x20f733})[_0x666f('0x1c')](function(){return BPromise[_0x666f('0x73')](_0x4ba8ae,function(_0x5b4d1f){return db['UserChatQueue'][_0x666f('0x74')]({'where':{'UserId':_0x5b4d1f['id'],'ChatQueueId':_0x5ec03e[_0x666f('0x50')]['id']},'transaction':_0x20f733});});})[_0x666f('0x1c')](function(){_0x4ba8ae[_0x666f('0x75')](function(_0x208090){socket[_0x666f('0x76')](_0x666f('0x77'),{'UserId':_0x208090['id'],'ChatQueueId':_0x31a4b2['id']});});});});});}})['then'](respondWithStatusCode(_0x2283a9,null))[_0x666f('0x25')](handleError(_0x2283a9,null));};exports[_0x666f('0x78')]=function(_0x59a687,_0x5acc0a,_0x42f4aa){return db[_0x666f('0x68')]['findAll']({'where':{'id':_0x59a687[_0x666f('0x3e')][_0x666f('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x666f('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x666f('0x1c')](handleEntityNotFound(_0x5acc0a,null))[_0x666f('0x1c')](function(_0x5e0048){var _0x418dc8=_['map'](_0x5e0048,'id');var _0x22391f=[];var _0x1034e4=[];var _0x32c37f=squel[_0x666f('0x7a')]();_0x32c37f['field'](_0x666f('0x7b'))[_0x666f('0x7c')]('team_has_chat_queues','tq')[_0x666f('0x7d')](_0x666f('0x7e'),'ut',_0x666f('0x7f'))[_0x666f('0x49')](_0x666f('0x80'),_0x59a687[_0x666f('0x50')]['id']);for(var _0x4937b6=0x0;_0x4937b6<_0x5e0048[_0x666f('0x44')];_0x4937b6+=0x1){let _0x5a0ac4=_0x5e0048[_0x4937b6];for(var _0xec33f=0x0;_0xec33f<_0x5a0ac4[_0x666f('0x6d')][_0x666f('0x44')];_0xec33f+=0x1){let _0x1848b1=_0x5a0ac4[_0x666f('0x6d')][_0xec33f];var _0xaf92d7=_0x32c37f['clone']();_0xaf92d7[_0x666f('0x49')](_0x666f('0x81'),_0x1848b1['id']);_0x1034e4[_0x666f('0x82')](db[_0x666f('0x71')][_0x666f('0x3e')](_0xaf92d7[_0x666f('0x83')](),{'type':db[_0x666f('0x71')]['QueryTypes'][_0x666f('0x84')]})[_0x666f('0x1c')](function(_0x1fd7d3){if(_0x1fd7d3[_0x666f('0x44')]===0x1){return _0x1848b1['id'];}else{var _0x5290d5=_['every'](_[_0x666f('0x37')](_0x1fd7d3,_0x666f('0x85')),function(_0x21db56){return _[_0x666f('0x86')](_0x418dc8,_0x21db56);});if(_0x5290d5){return _0x1848b1['id'];}}}));}}return BPromise['all'](_0x1034e4)[_0x666f('0x1c')](function(_0x323bf1){_0x22391f=_(_0x22391f)['union'](_0x323bf1)[_0x666f('0x87')]()[_0x666f('0x88')]();return db[_0x666f('0x38')][_0x666f('0x52')]({'where':{'id':_0x59a687['params']['id']}})[_0x666f('0x1c')](function(_0x88a9b3){return db[_0x666f('0x71')][_0x666f('0x72')](function(_0x52c91d){return _0x88a9b3['removeTeams'](_0x59a687[_0x666f('0x3e')][_0x666f('0x79')],{'transaction':_0x52c91d})['then'](function(){if(!_[_0x666f('0x89')](_0x22391f)){return _0x88a9b3[_0x666f('0x8a')](_0x22391f,{'transaction':_0x52c91d});}})['then'](function(){_0x22391f[_0x666f('0x75')](function(_0x1c6168){socket['emit'](_0x666f('0x8b'),{'UserId':_0x1c6168,'ChatQueueId':_0x88a9b3['id']});});});});});});})['then'](respondWithStatusCode(_0x5acc0a,null))[_0x666f('0x25')](handleError(_0x5acc0a,null));};exports[_0x666f('0x8c')]=function(_0xe19015,_0x54f9aa,_0x305020){return db[_0x666f('0x38')][_0x666f('0x52')]({'where':{'id':_0xe19015[_0x666f('0x50')]['id']}})[_0x666f('0x1c')](handleEntityNotFound(_0x54f9aa,null))['then'](function(_0x47424f){if(_0x47424f){return _0x47424f[_0x666f('0x8c')](_0xe19015[_0x666f('0x54')]['ids'],_[_0x666f('0x8d')](_0xe19015[_0x666f('0x54')],[_0x666f('0x79'),'id'])||{})[_0x666f('0x8e')](function(_0x355831){for(var _0x4a16da=0x0;_0x4a16da<_0xe19015['body'][_0x666f('0x79')][_0x666f('0x44')];_0x4a16da+=0x1){socket[_0x666f('0x76')](_0x666f('0x77'),{'UserId':Number(_0xe19015[_0x666f('0x54')][_0x666f('0x79')][_0x4a16da]),'ChatQueueId':Number(_0xe19015[_0x666f('0x50')]['id'])});}return _0x355831;});}})[_0x666f('0x1c')](respondWithResult(_0x54f9aa,null))[_0x666f('0x25')](handleError(_0x54f9aa,null));};exports[_0x666f('0x8a')]=function(_0x931fae,_0x2d0425,_0x20c953){return db[_0x666f('0x38')][_0x666f('0x52')]({'where':{'id':_0x931fae[_0x666f('0x50')]['id']}})[_0x666f('0x1c')](handleEntityNotFound(_0x2d0425,null))[_0x666f('0x1c')](function(_0x3217a3){if(_0x3217a3){return _0x3217a3[_0x666f('0x8a')](_0x931fae[_0x666f('0x3e')]['ids'])['then'](function(){if(_[_0x666f('0x8f')](_0x931fae['query'][_0x666f('0x79')])){for(var _0x3cf794=0x0;_0x3cf794<_0x931fae[_0x666f('0x3e')][_0x666f('0x79')]['length'];_0x3cf794+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x931fae[_0x666f('0x3e')][_0x666f('0x79')][_0x3cf794]),'ChatQueueId':Number(_0x931fae[_0x666f('0x50')]['id'])});}}else{socket[_0x666f('0x76')](_0x666f('0x8b'),{'UserId':Number(_0x931fae[_0x666f('0x3e')]['ids']),'ChatQueueId':Number(_0x931fae[_0x666f('0x50')]['id'])});}});}})[_0x666f('0x1c')](respondWithStatusCode(_0x2d0425,null))[_0x666f('0x25')](handleError(_0x2d0425,null));};exports[_0x666f('0x90')]=function(_0x179d05,_0x2f4219,_0x5b9436){var _0x35d8d1={};var _0x5be08b={};var _0x50da5b;var _0x4f4d71;return db['ChatQueue'][_0x666f('0x67')]({'where':{'id':_0x179d05[_0x666f('0x50')]['id']}})[_0x666f('0x1c')](handleEntityNotFound(_0x2f4219,null))['then'](function(_0x3e50a9){if(_0x3e50a9){_0x50da5b=_0x3e50a9;_0x5be08b['model']=_['keys'](db[_0x666f('0x60')][_0x666f('0x39')]);_0x5be08b[_0x666f('0x3e')]=_[_0x666f('0x3f')](_0x179d05['query']);_0x5be08b[_0x666f('0x40')]=_[_0x666f('0x41')](_0x5be08b['model'],_0x5be08b['query']);_0x35d8d1[_0x666f('0x42')]=_['intersection'](_0x5be08b[_0x666f('0x3d')],qs[_0x666f('0x43')](_0x179d05[_0x666f('0x3e')][_0x666f('0x43')]));_0x35d8d1[_0x666f('0x42')]=_0x35d8d1['attributes'][_0x666f('0x44')]?_0x35d8d1['attributes']:_0x5be08b[_0x666f('0x3d')];_0x35d8d1[_0x666f('0x47')]=qs['sort'](_0x179d05[_0x666f('0x3e')]['sort']);_0x35d8d1[_0x666f('0x49')]=qs[_0x666f('0x40')](_[_0x666f('0x4a')](_0x179d05[_0x666f('0x3e')],_0x5be08b[_0x666f('0x40')]));if(_0x179d05['query'][_0x666f('0x69')]){_0x35d8d1[_0x666f('0x49')]=_[_0x666f('0x4b')](_0x35d8d1[_0x666f('0x49')],{'$or':_[_0x666f('0x37')](_0x35d8d1['attributes'],function(_0x3fa3e2){var _0x3bd21a={};_0x3bd21a[_0x3fa3e2]={'$like':'%'+_0x179d05[_0x666f('0x3e')][_0x666f('0x69')]+'%'};return _0x3bd21a;})});}_0x35d8d1=_['merge']({},_0x35d8d1,_0x179d05[_0x666f('0x6a')]);return _0x50da5b[_0x666f('0x90')](_0x35d8d1);}})[_0x666f('0x1c')](function(_0x99b838){if(_0x99b838){_0x4f4d71=_0x99b838[_0x666f('0x44')];if(!_0x179d05[_0x666f('0x3e')][_0x666f('0x6b')](_0x666f('0x45'))){_0x35d8d1[_0x666f('0x46')]=qs[_0x666f('0x46')](_0x179d05[_0x666f('0x3e')][_0x666f('0x46')]);_0x35d8d1[_0x666f('0x29')]=qs['offset'](_0x179d05['query'][_0x666f('0x29')]);}return _0x50da5b[_0x666f('0x90')](_0x35d8d1);}})[_0x666f('0x1c')](function(_0x158280){if(_0x158280){return _0x158280?{'count':_0x4f4d71,'rows':_0x158280}:null;}})[_0x666f('0x1c')](respondWithResult(_0x2f4219,null))[_0x666f('0x25')](handleError(_0x2f4219,null));}; \ No newline at end of file +var _0x4112=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserChatQueue','nolimit','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','userChatQueue:remove','omit','spread','removeAgents','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x4112,0xd6));var _0x2411=function(_0x2e2ec3,_0x19ee9b){_0x2e2ec3=_0x2e2ec3-0x0;var _0x5f4db4=_0x4112[_0x2e2ec3];return _0x5f4db4;};'use strict';var emlformat=require(_0x2411('0x0'));var rimraf=require(_0x2411('0x1'));var zipdir=require(_0x2411('0x2'));var jsonpatch=require(_0x2411('0x3'));var rp=require(_0x2411('0x4'));var moment=require(_0x2411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2411('0x6'));var util=require(_0x2411('0x7'));var path=require(_0x2411('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2411('0x9'));var fs=require('fs');var fs_extra=require(_0x2411('0xa'));var _=require(_0x2411('0xb'));var squel=require(_0x2411('0xc'));var crypto=require(_0x2411('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2411('0xe'));var toCsv=require(_0x2411('0xf'));var querystring=require(_0x2411('0x10'));var Papa=require('papaparse');var Redis=require(_0x2411('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2411('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2411('0x13'));var logger=require(_0x2411('0x14'))(_0x2411('0x15'));var utils=require(_0x2411('0x16'));var config=require(_0x2411('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2411('0x18'))['db'];config[_0x2411('0x19')]=_[_0x2411('0x1a')](config[_0x2411('0x19')],{'host':_0x2411('0x1b'),'port':0x18eb});var socket=require(_0x2411('0x1c'))(new Redis(config[_0x2411('0x19')]));require(_0x2411('0x1d'))[_0x2411('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2411('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b41c,_0x25f000,_0x4f96e3,_0x21b82e){return new BPromise(function(_0x2765f6,_0x195efe){var _0x5c8b67=_0x21b82e||client;return _0x5c8b67['request'](_0x45b41c,_0x4f96e3)[_0x2411('0x20')](function(_0x5e3795){logger[_0x2411('0x21')](_0x2411('0x22'),_0x25f000,_0x2411('0x23'));logger[_0x2411('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x25f000,_0x2411('0x23'),JSON['stringify'](_0x5e3795));if(_0x5e3795['error']){if(_0x5e3795[_0x2411('0x25')][_0x2411('0x26')]===0x1f4){logger[_0x2411('0x25')](_0x2411('0x22'),_0x25f000,_0x5e3795[_0x2411('0x25')][_0x2411('0x27')]);return _0x195efe(_0x5e3795['error'][_0x2411('0x27')]);}logger[_0x2411('0x25')](_0x2411('0x22'),_0x25f000,_0x5e3795[_0x2411('0x25')][_0x2411('0x27')]);return _0x2765f6(_0x5e3795['error'][_0x2411('0x27')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x25f000,'request\x20sent');_0x2765f6(_0x5e3795[_0x2411('0x28')][_0x2411('0x27')]);}})[_0x2411('0x29')](function(_0x92d66a){logger['error']('ChatQueue,\x20%s,\x20%s',_0x25f000,_0x92d66a);_0x195efe(_0x92d66a);});});}function respondWithStatusCode(_0x5ef5e3,_0x346eb4){_0x346eb4=_0x346eb4||0xcc;return function(_0x4075ca){if(_0x4075ca){return _0x5ef5e3[_0x2411('0x2a')](_0x346eb4);}return _0x5ef5e3[_0x2411('0x2b')](_0x346eb4)[_0x2411('0x2c')]();};}function respondWithResult(_0x5a60d4,_0x17ccbf){_0x17ccbf=_0x17ccbf||0xc8;return function(_0x51a377){if(_0x51a377){return _0x5a60d4['status'](_0x17ccbf)[_0x2411('0x2d')](_0x51a377);}};}function respondWithFilteredResult(_0x3be135,_0x598c63){return function(_0x1cc07b){if(_0x1cc07b){var _0x53663e=typeof _0x598c63[_0x2411('0x2e')]===_0x2411('0x2f')&&typeof _0x598c63[_0x2411('0x30')]===_0x2411('0x2f');var _0x265f8f=_0x1cc07b[_0x2411('0x31')];var _0x5e5a7c=_0x53663e?0x0:_0x598c63[_0x2411('0x2e')];var _0x43f578=_0x53663e?_0x1cc07b[_0x2411('0x31')]:_0x598c63[_0x2411('0x2e')]+_0x598c63[_0x2411('0x30')];var _0x45664f;if(_0x43f578>=_0x265f8f){_0x43f578=_0x265f8f;_0x45664f=0xc8;}else{_0x45664f=0xce;}_0x3be135['status'](_0x45664f);return _0x3be135[_0x2411('0x32')](_0x2411('0x33'),_0x5e5a7c+'-'+_0x43f578+'/'+_0x265f8f)[_0x2411('0x2d')](_0x1cc07b);}return null;};}function patchUpdates(_0x4b4cab){return function(_0xac8eb6){try{jsonpatch[_0x2411('0x34')](_0xac8eb6,_0x4b4cab,!![]);}catch(_0x545147){return BPromise['reject'](_0x545147);}return _0xac8eb6[_0x2411('0x35')]();};}function saveUpdates(_0x2ffa76,_0xfe257c){return function(_0x373b85){if(_0x373b85){return _0x373b85[_0x2411('0x36')](_0x2ffa76)['then'](function(_0x3b983d){return _0x3b983d;});}return null;};}function removeEntity(_0x304a02,_0x3f53da){return function(_0x2ed81f){if(_0x2ed81f){return _0x2ed81f[_0x2411('0x37')]()[_0x2411('0x20')](function(){var _0x4fca70=_0x2ed81f[_0x2411('0x38')]({'plain':!![]});var _0x3ea38a='ChatQueues';return db[_0x2411('0x39')]['destroy']({'where':{'type':_0x3ea38a,'resourceId':_0x4fca70['id']}})[_0x2411('0x20')](function(){return _0x2ed81f;});})[_0x2411('0x20')](function(){_0x304a02['status'](0xcc)[_0x2411('0x2c')]();});}};}function handleEntityNotFound(_0x41b66c,_0x20c64d){return function(_0x53d089){if(!_0x53d089){_0x41b66c[_0x2411('0x2a')](0x194);}return _0x53d089;};}function handleError(_0x343142,_0x9fee2a){_0x9fee2a=_0x9fee2a||0x1f4;return function(_0x2bb229){logger[_0x2411('0x25')](_0x2bb229[_0x2411('0x3a')]);if(_0x2bb229[_0x2411('0x3b')]){delete _0x2bb229[_0x2411('0x3b')];}_0x343142[_0x2411('0x2b')](_0x9fee2a)[_0x2411('0x3c')](_0x2bb229);};}exports[_0x2411('0x3d')]=function(_0x2dfb7c,_0x56ad97){var _0x545b19={},_0x110f1f={},_0x1af7ae={'count':0x0,'rows':[]};var _0x1c13c0=_[_0x2411('0x3e')](db[_0x2411('0x3f')][_0x2411('0x40')],function(_0xe21d9){return{'name':_0xe21d9['fieldName'],'type':_0xe21d9[_0x2411('0x41')][_0x2411('0x42')]};});_0x110f1f[_0x2411('0x43')]=_[_0x2411('0x3e')](_0x1c13c0,'name');_0x110f1f[_0x2411('0x44')]=_[_0x2411('0x45')](_0x2dfb7c[_0x2411('0x44')]);_0x110f1f[_0x2411('0x46')]=_[_0x2411('0x47')](_0x110f1f['model'],_0x110f1f[_0x2411('0x44')]);_0x545b19[_0x2411('0x48')]=_[_0x2411('0x47')](_0x110f1f[_0x2411('0x43')],qs[_0x2411('0x49')](_0x2dfb7c[_0x2411('0x44')]['fields']));_0x545b19['attributes']=_0x545b19[_0x2411('0x48')][_0x2411('0x4a')]?_0x545b19[_0x2411('0x48')]:_0x110f1f['model'];if(!_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4b')]('nolimit')){_0x545b19[_0x2411('0x30')]=qs[_0x2411('0x30')](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x30')]);_0x545b19[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x2e')]);}_0x545b19['order']=qs['sort'](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4c')]);_0x545b19[_0x2411('0x4d')]=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x2dfb7c['query'],_0x110f1f[_0x2411('0x46')]),_0x1c13c0);if(_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4f')]){_0x545b19[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x545b19['where'],{'$or':_['map'](_0x1c13c0,function(_0x4e7d6f){if(_0x4e7d6f[_0x2411('0x41')]!==_0x2411('0x51')){var _0x3cedb2={};_0x3cedb2[_0x4e7d6f[_0x2411('0x3b')]]={'$like':'%'+_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x3cedb2;}})});}_0x545b19=_[_0x2411('0x50')]({},_0x545b19,_0x2dfb7c[_0x2411('0x52')]);var _0x442960={'where':_0x545b19['where']};return db[_0x2411('0x3f')][_0x2411('0x31')](_0x442960)[_0x2411('0x20')](function(_0x2fee29){_0x1af7ae[_0x2411('0x31')]=_0x2fee29;if(_0x2dfb7c[_0x2411('0x44')][_0x2411('0x53')]){_0x545b19[_0x2411('0x54')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x545b19);})[_0x2411('0x20')](function(_0x3b7324){_0x1af7ae['rows']=_0x3b7324;return _0x1af7ae;})[_0x2411('0x20')](respondWithFilteredResult(_0x56ad97,_0x545b19))[_0x2411('0x29')](handleError(_0x56ad97,null));};exports[_0x2411('0x55')]=function(_0x124816,_0x118d3e){var _0x557e0a={'raw':!![],'where':{'id':_0x124816['params']['id']}},_0x8d5b21={};_0x8d5b21['model']=_[_0x2411('0x45')](db[_0x2411('0x3f')]['rawAttributes']);_0x8d5b21[_0x2411('0x44')]=_[_0x2411('0x45')](_0x124816[_0x2411('0x44')]);_0x8d5b21[_0x2411('0x46')]=_[_0x2411('0x47')](_0x8d5b21['model'],_0x8d5b21[_0x2411('0x44')]);_0x557e0a['attributes']=_[_0x2411('0x47')](_0x8d5b21['model'],qs['fields'](_0x124816['query']['fields']));_0x557e0a[_0x2411('0x48')]=_0x557e0a[_0x2411('0x48')][_0x2411('0x4a')]?_0x557e0a[_0x2411('0x48')]:_0x8d5b21['model'];if(_0x124816['query']['includeAll']){_0x557e0a['include']=[{'all':!![]}];}_0x557e0a=_[_0x2411('0x50')]({},_0x557e0a,_0x124816[_0x2411('0x52')]);return db[_0x2411('0x3f')][_0x2411('0x56')](_0x557e0a)[_0x2411('0x20')](handleEntityNotFound(_0x118d3e,null))[_0x2411('0x20')](respondWithResult(_0x118d3e,null))[_0x2411('0x29')](handleError(_0x118d3e,null));};exports[_0x2411('0x57')]=function(_0x232eb2,_0x38c2d2){return db[_0x2411('0x3f')]['create'](_0x232eb2['body'],{})[_0x2411('0x20')](function(_0x435cb8){var _0x411296=_0x232eb2['user']['get']({'plain':!![]});if(!_0x411296)throw new Error(_0x2411('0x58'));if(_0x411296['role']===_0x2411('0x59')){var _0x12f591=_0x435cb8[_0x2411('0x38')]({'plain':!![]});var _0x288ed7=_0x2411('0x5a');return db[_0x2411('0x5b')]['find']({'where':{'name':_0x288ed7,'userProfileId':_0x411296[_0x2411('0x5c')]},'raw':!![]})[_0x2411('0x20')](function(_0x397dfe){if(_0x397dfe&&_0x397dfe['autoAssociation']===0x0){return db[_0x2411('0x39')]['create']({'name':_0x12f591[_0x2411('0x3b')],'resourceId':_0x12f591['id'],'type':_0x397dfe[_0x2411('0x3b')],'sectionId':_0x397dfe['id']},{})[_0x2411('0x20')](function(){return _0x435cb8;});}else{return _0x435cb8;}})[_0x2411('0x29')](function(_0x1429bc){logger[_0x2411('0x25')](_0x2411('0x5d'),_0x1429bc);throw _0x1429bc;});}return _0x435cb8;})[_0x2411('0x20')](respondWithResult(_0x38c2d2,0xc9))[_0x2411('0x29')](handleError(_0x38c2d2,null));};exports['update']=function(_0x3fc42d,_0x278e90){if(_0x3fc42d[_0x2411('0x5e')]['id']){delete _0x3fc42d['body']['id'];}return db[_0x2411('0x3f')][_0x2411('0x56')]({'where':{'id':_0x3fc42d[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x278e90,null))[_0x2411('0x20')](saveUpdates(_0x3fc42d['body'],null))[_0x2411('0x20')](respondWithResult(_0x278e90,null))[_0x2411('0x29')](handleError(_0x278e90,null));};exports[_0x2411('0x37')]=function(_0x1cb32d,_0x4856fc){return db[_0x2411('0x3f')][_0x2411('0x56')]({'where':{'id':_0x1cb32d['params']['id']}})['then'](handleEntityNotFound(_0x4856fc,null))['then'](removeEntity(_0x4856fc,null))[_0x2411('0x29')](handleError(_0x4856fc,null));};exports[_0x2411('0x60')]=function(_0x4ca85a,_0x245eb9){return db[_0x2411('0x3f')]['describe']()[_0x2411('0x20')](respondWithResult(_0x245eb9,null))[_0x2411('0x29')](handleError(_0x245eb9,null));};exports[_0x2411('0x61')]=function(_0x348778,_0x497496,_0x4a4677){var _0x27d2df={'raw':!![],'where':{}},_0x52cb3b={},_0x145f08;return db['ChatQueue']['findOne']({'where':{'id':_0x348778[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x497496,null))[_0x2411('0x20')](function(_0x3a826e){if(_0x3a826e){_0x145f08=_0x3a826e['get']({'plain':!![]});_0x52cb3b[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x62')]['rawAttributes']);_0x52cb3b[_0x2411('0x44')]=_[_0x2411('0x45')](_0x348778[_0x2411('0x44')]);_0x52cb3b[_0x2411('0x46')]=_['intersection'](_0x52cb3b[_0x2411('0x43')],_0x52cb3b[_0x2411('0x44')]);_0x27d2df[_0x2411('0x48')]=_['intersection'](_0x52cb3b[_0x2411('0x43')],qs[_0x2411('0x49')](_0x348778['query'][_0x2411('0x49')]));_0x27d2df[_0x2411('0x48')]=_0x27d2df[_0x2411('0x48')]['length']?_0x27d2df['attributes']:_0x52cb3b['model'];if(!_0x348778[_0x2411('0x44')][_0x2411('0x4b')](_0x2411('0x63'))){_0x27d2df[_0x2411('0x30')]=qs[_0x2411('0x30')](_0x348778[_0x2411('0x44')][_0x2411('0x30')]);_0x27d2df[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x348778[_0x2411('0x44')][_0x2411('0x2e')]);}_0x27d2df['order']=qs['sort'](_0x348778[_0x2411('0x44')]['sort']);_0x27d2df['where']=qs['filters'](_[_0x2411('0x4e')](_0x348778['query'],_0x52cb3b[_0x2411('0x46')]));_0x27d2df[_0x2411('0x4d')]['ChatQueueId']=_0x3a826e['id'];if(_0x348778[_0x2411('0x44')]['filter']){_0x27d2df[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x27d2df[_0x2411('0x4d')],{'$or':_[_0x2411('0x3e')](_0x27d2df[_0x2411('0x48')],function(_0x147f59){var _0x2819f0={};_0x2819f0[_0x147f59]={'$like':'%'+_0x348778[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x2819f0;})});}_0x27d2df=_['merge']({},_0x27d2df,_0x348778[_0x2411('0x52')]);return db[_0x2411('0x62')][_0x2411('0x64')](_0x27d2df);}})[_0x2411('0x20')](function(_0x5084d5){if(_0x5084d5){return db[_0x2411('0x65')][_0x2411('0x66')]({'where':{'id':_[_0x2411('0x3e')](_0x5084d5,_0x2411('0x67')),'role':_0x2411('0x68')},'attributes':['id',_0x2411('0x3b'),_0x2411('0x69'),_0x2411('0x6a'),_0x2411('0x6b')]});}})['then'](function(_0x15f9e4){if(_0x15f9e4){return{'count':_0x15f9e4[_0x2411('0x31')],'rows':_[_0x2411('0x3e')](_0x15f9e4[_0x2411('0x6c')],function(_0x2fc18b){return{'membername':_0x2fc18b['name'],'UserId':_0x2fc18b['id'],'queue_name':_0x145f08[_0x2411('0x3b')],'ChatQueueId':_0x145f08['id'],'interface':util[_0x2411('0x6d')](_0x2411('0x6e'),'SIP',_0x2fc18b[_0x2411('0x3b')]),'penalty':0x0,'paused':_0x2fc18b['chatPause'],'createdAt':_0x2fc18b[_0x2411('0x6b')],'updatedAt':_0x2fc18b[_0x2411('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2411('0x20')](respondWithFilteredResult(_0x497496,_0x27d2df))[_0x2411('0x29')](handleError(_0x497496,null));};exports[_0x2411('0x6f')]=function(_0x35958a,_0x3e8be5,_0xffa8a7){var _0x38bee3={};var _0x59cf21={};var _0x751de7;var _0x23281b;return db['ChatQueue']['findOne']({'where':{'id':_0x35958a[_0x2411('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e8be5,null))[_0x2411('0x20')](function(_0x13d31e){if(_0x13d31e){_0x751de7=_0x13d31e;_0x59cf21[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x70')]['rawAttributes']);_0x59cf21[_0x2411('0x44')]=_[_0x2411('0x45')](_0x35958a[_0x2411('0x44')]);_0x59cf21[_0x2411('0x46')]=_[_0x2411('0x47')](_0x59cf21[_0x2411('0x43')],_0x59cf21[_0x2411('0x44')]);_0x38bee3['attributes']=_[_0x2411('0x47')](_0x59cf21[_0x2411('0x43')],qs[_0x2411('0x49')](_0x35958a[_0x2411('0x44')][_0x2411('0x49')]));_0x38bee3[_0x2411('0x48')]=_0x38bee3[_0x2411('0x48')][_0x2411('0x4a')]?_0x38bee3['attributes']:_0x59cf21['model'];_0x38bee3[_0x2411('0x71')]=qs[_0x2411('0x4c')](_0x35958a['query'][_0x2411('0x4c')]);_0x38bee3['where']=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x35958a[_0x2411('0x44')],_0x59cf21['filters']));if(_0x35958a[_0x2411('0x44')][_0x2411('0x4f')]){_0x38bee3[_0x2411('0x4d')]=_['merge'](_0x38bee3[_0x2411('0x4d')],{'$or':_[_0x2411('0x3e')](_0x38bee3[_0x2411('0x48')],function(_0x39fcd2){var _0x389197={};_0x389197[_0x39fcd2]={'$like':'%'+_0x35958a['query']['filter']+'%'};return _0x389197;})});}_0x38bee3=_[_0x2411('0x50')]({},_0x38bee3,_0x35958a[_0x2411('0x52')]);return _0x751de7[_0x2411('0x6f')](_0x38bee3);}})[_0x2411('0x20')](function(_0x3c4320){if(_0x3c4320){_0x23281b=_0x3c4320[_0x2411('0x4a')];if(!_0x35958a[_0x2411('0x44')][_0x2411('0x4b')](_0x2411('0x63'))){_0x38bee3['limit']=qs[_0x2411('0x30')](_0x35958a[_0x2411('0x44')][_0x2411('0x30')]);_0x38bee3[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x35958a[_0x2411('0x44')][_0x2411('0x2e')]);}return _0x751de7[_0x2411('0x6f')](_0x38bee3);}})[_0x2411('0x20')](function(_0x5850ff){if(_0x5850ff){return _0x5850ff?{'count':_0x23281b,'rows':_0x5850ff}:null;}})['then'](respondWithResult(_0x3e8be5,null))[_0x2411('0x29')](handleError(_0x3e8be5,null));};exports[_0x2411('0x72')]=function(_0x6ea3e6,_0x2c8f0a,_0x1a4782){var _0x1b5447=_0x6ea3e6[_0x2411('0x5e')][_0x2411('0x73')];return db[_0x2411('0x70')][_0x2411('0x64')]({'where':{'id':_0x1b5447},'attributes':['id'],'include':[{'model':db[_0x2411('0x65')],'as':_0x2411('0x74'),'attributes':['id',_0x2411('0x3b'),_0x2411('0x75'),_0x2411('0x76'),_0x2411('0x77')],'raw':!![]}]})['then'](function(_0x2a3c96){if(_0x2a3c96){var _0x22d980=_['flatMap'](_0x2a3c96,function(_0x1cc1b7){var _0x64e80a=_0x1cc1b7[_0x2411('0x38')]({'plain':!![]});return _0x64e80a['Agents'];});return db[_0x2411('0x3f')]['find']({'where':{'id':_0x6ea3e6['params']['id']}})[_0x2411('0x20')](function(_0x428082){return db[_0x2411('0x78')][_0x2411('0x79')](function(_0x127403){return _0x428082[_0x2411('0x72')](_0x1b5447,{'transaction':_0x127403})[_0x2411('0x20')](function(){return BPromise[_0x2411('0x7a')](_0x22d980,function(_0x29b03a){return db[_0x2411('0x62')][_0x2411('0x7b')]({'where':{'UserId':_0x29b03a['id'],'ChatQueueId':_0x6ea3e6[_0x2411('0x5f')]['id']},'transaction':_0x127403});});})[_0x2411('0x20')](function(){_0x22d980[_0x2411('0x7c')](function(_0x1e9121){socket[_0x2411('0x7d')](_0x2411('0x7e'),{'UserId':_0x1e9121['id'],'ChatQueueId':_0x428082['id']});});});});});}})[_0x2411('0x20')](respondWithStatusCode(_0x2c8f0a,null))[_0x2411('0x29')](handleError(_0x2c8f0a,null));};exports[_0x2411('0x7f')]=function(_0x5c8ec1,_0x479c65,_0xda5f05){return db[_0x2411('0x70')]['findAll']({'where':{'id':_0x5c8ec1[_0x2411('0x44')][_0x2411('0x73')]},'attributes':['id'],'include':[{'model':db[_0x2411('0x65')],'as':_0x2411('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2411('0x20')](handleEntityNotFound(_0x479c65,null))[_0x2411('0x20')](function(_0x52773b){var _0x1050ae=_[_0x2411('0x3e')](_0x52773b,'id');var _0x1f8b3f=[];var _0xbebaea=[];var _0x136d7b=squel[_0x2411('0x80')]();_0x136d7b[_0x2411('0x81')](_0x2411('0x82'))['from'](_0x2411('0x83'),'tq')['join'](_0x2411('0x84'),'ut',_0x2411('0x85'))[_0x2411('0x4d')](_0x2411('0x86'),_0x5c8ec1[_0x2411('0x5f')]['id']);for(var _0x4da8df=0x0;_0x4da8df<_0x52773b['length'];_0x4da8df+=0x1){let _0x45b26e=_0x52773b[_0x4da8df];for(var _0x3eee04=0x0;_0x3eee04<_0x45b26e[_0x2411('0x74')][_0x2411('0x4a')];_0x3eee04+=0x1){let _0x46dc75=_0x45b26e[_0x2411('0x74')][_0x3eee04];var _0x4e9990=_0x136d7b[_0x2411('0x87')]();_0x4e9990[_0x2411('0x4d')](_0x2411('0x88'),_0x46dc75['id']);_0xbebaea[_0x2411('0x89')](db['sequelize'][_0x2411('0x44')](_0x4e9990[_0x2411('0x8a')](),{'type':db['sequelize'][_0x2411('0x8b')]['SELECT']})[_0x2411('0x20')](function(_0x466ed1){if(_0x466ed1['length']===0x1){return _0x46dc75['id'];}else{var _0x4cec58=_[_0x2411('0x8c')](_['map'](_0x466ed1,_0x2411('0x8d')),function(_0x3f053e){return _['includes'](_0x1050ae,_0x3f053e);});if(_0x4cec58){return _0x46dc75['id'];}}}));}}return BPromise[_0x2411('0x8e')](_0xbebaea)[_0x2411('0x20')](function(_0x3e171d){_0x1f8b3f=_(_0x1f8b3f)[_0x2411('0x8f')](_0x3e171d)[_0x2411('0x90')]()[_0x2411('0x91')]();return db['ChatQueue'][_0x2411('0x56')]({'where':{'id':_0x5c8ec1[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](function(_0x1fcc1f){return db[_0x2411('0x78')][_0x2411('0x79')](function(_0x383fac){return _0x1fcc1f[_0x2411('0x7f')](_0x5c8ec1[_0x2411('0x44')][_0x2411('0x73')],{'transaction':_0x383fac})['then'](function(){if(!_['isEmpty'](_0x1f8b3f)){return _0x1fcc1f['removeAgents'](_0x1f8b3f,{'transaction':_0x383fac});}})[_0x2411('0x20')](function(){_0x1f8b3f['forEach'](function(_0x2c4ba1){socket[_0x2411('0x7d')](_0x2411('0x92'),{'UserId':_0x2c4ba1,'ChatQueueId':_0x1fcc1f['id']});});});});});});})[_0x2411('0x20')](respondWithStatusCode(_0x479c65,null))[_0x2411('0x29')](handleError(_0x479c65,null));};exports['addAgents']=function(_0x173fe6,_0x261441,_0x3e021f){return db[_0x2411('0x3f')]['find']({'where':{'id':_0x173fe6['params']['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x261441,null))[_0x2411('0x20')](function(_0x162131){if(_0x162131){return _0x162131['addAgents'](_0x173fe6['body']['ids'],_[_0x2411('0x93')](_0x173fe6[_0x2411('0x5e')],[_0x2411('0x73'),'id'])||{})[_0x2411('0x94')](function(_0x403662){for(var _0x3c3a20=0x0;_0x3c3a20<_0x173fe6['body']['ids']['length'];_0x3c3a20+=0x1){socket[_0x2411('0x7d')](_0x2411('0x7e'),{'UserId':Number(_0x173fe6['body']['ids'][_0x3c3a20]),'ChatQueueId':Number(_0x173fe6[_0x2411('0x5f')]['id'])});}return _0x403662;});}})['then'](respondWithResult(_0x261441,null))[_0x2411('0x29')](handleError(_0x261441,null));};exports[_0x2411('0x95')]=function(_0x156c56,_0x8081c0,_0x4baa76){return db['ChatQueue'][_0x2411('0x56')]({'where':{'id':_0x156c56[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x8081c0,null))[_0x2411('0x20')](function(_0x11fbbe){if(_0x11fbbe){return _0x11fbbe[_0x2411('0x95')](_0x156c56[_0x2411('0x44')]['ids'])[_0x2411('0x20')](function(){if(_[_0x2411('0x96')](_0x156c56['query'][_0x2411('0x73')])){for(var _0x458045=0x0;_0x458045<_0x156c56[_0x2411('0x44')][_0x2411('0x73')][_0x2411('0x4a')];_0x458045+=0x1){socket['emit'](_0x2411('0x92'),{'UserId':Number(_0x156c56[_0x2411('0x44')][_0x2411('0x73')][_0x458045]),'ChatQueueId':Number(_0x156c56[_0x2411('0x5f')]['id'])});}}else{socket[_0x2411('0x7d')](_0x2411('0x92'),{'UserId':Number(_0x156c56[_0x2411('0x44')][_0x2411('0x73')]),'ChatQueueId':Number(_0x156c56['params']['id'])});}});}})[_0x2411('0x20')](respondWithStatusCode(_0x8081c0,null))[_0x2411('0x29')](handleError(_0x8081c0,null));};exports['getAgents']=function(_0x2e753f,_0x11e330,_0x39e4e2){var _0x5d4cf1={};var _0xdca24c={};var _0x1c637a;var _0x56de17;return db[_0x2411('0x3f')][_0x2411('0x97')]({'where':{'id':_0x2e753f[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x11e330,null))['then'](function(_0x9f85c0){if(_0x9f85c0){_0x1c637a=_0x9f85c0;_0xdca24c[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x65')][_0x2411('0x40')]);_0xdca24c[_0x2411('0x44')]=_['keys'](_0x2e753f[_0x2411('0x44')]);_0xdca24c['filters']=_[_0x2411('0x47')](_0xdca24c[_0x2411('0x43')],_0xdca24c['query']);_0x5d4cf1['attributes']=_[_0x2411('0x47')](_0xdca24c[_0x2411('0x43')],qs['fields'](_0x2e753f[_0x2411('0x44')][_0x2411('0x49')]));_0x5d4cf1[_0x2411('0x48')]=_0x5d4cf1[_0x2411('0x48')][_0x2411('0x4a')]?_0x5d4cf1['attributes']:_0xdca24c[_0x2411('0x43')];_0x5d4cf1['order']=qs[_0x2411('0x4c')](_0x2e753f[_0x2411('0x44')]['sort']);_0x5d4cf1[_0x2411('0x4d')]=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x2e753f[_0x2411('0x44')],_0xdca24c[_0x2411('0x46')]));if(_0x2e753f['query'][_0x2411('0x4f')]){_0x5d4cf1[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x5d4cf1['where'],{'$or':_[_0x2411('0x3e')](_0x5d4cf1[_0x2411('0x48')],function(_0x115a1d){var _0x25d525={};_0x25d525[_0x115a1d]={'$like':'%'+_0x2e753f[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x25d525;})});}_0x5d4cf1=_[_0x2411('0x50')]({},_0x5d4cf1,_0x2e753f['options']);return _0x1c637a[_0x2411('0x98')](_0x5d4cf1);}})['then'](function(_0x3f82bb){if(_0x3f82bb){_0x56de17=_0x3f82bb[_0x2411('0x4a')];if(!_0x2e753f['query'][_0x2411('0x4b')](_0x2411('0x63'))){_0x5d4cf1['limit']=qs['limit'](_0x2e753f[_0x2411('0x44')][_0x2411('0x30')]);_0x5d4cf1[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x2e753f[_0x2411('0x44')][_0x2411('0x2e')]);}return _0x1c637a[_0x2411('0x98')](_0x5d4cf1);}})[_0x2411('0x20')](function(_0x4b3793){if(_0x4b3793){return _0x4b3793?{'count':_0x56de17,'rows':_0x4b3793}:null;}})[_0x2411('0x20')](respondWithResult(_0x11e330,null))[_0x2411('0x29')](handleError(_0x11e330,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 9f3652c..386e0d4 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0d9=['events','ChatQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x21bfaf,_0x32fd3e){var _0x1f2eef=function(_0x3b58f8){while(--_0x3b58f8){_0x21bfaf['push'](_0x21bfaf['shift']());}};_0x1f2eef(++_0x32fd3e);}(_0xb0d9,0x78));var _0x9b0d=function(_0x18b7bb,_0x2278e2){_0x18b7bb=_0x18b7bb-0x0;var _0x250e8c=_0xb0d9[_0x18b7bb];return _0x250e8c;};'use strict';var EventEmitter=require(_0x9b0d('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x9b0d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9b0d('0x2')](0x0);var events={'afterCreate':_0x9b0d('0x3'),'afterUpdate':'update','afterDestroy':_0x9b0d('0x4')};function emitEvent(_0x55adee){return function(_0x394a0e,_0x1c4f45,_0x4b80a7){ChatQueueEvents[_0x9b0d('0x5')](_0x55adee+':'+_0x394a0e['id'],_0x394a0e);ChatQueueEvents[_0x9b0d('0x5')](_0x55adee,_0x394a0e);_0x4b80a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x9b0d('0x6')](e,emitEvent(event));}}module[_0x9b0d('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x37cb=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x2440df,_0x453be8){var _0x1fa6fb=function(_0x1e0417){while(--_0x1e0417){_0x2440df['push'](_0x2440df['shift']());}};_0x1fa6fb(++_0x453be8);}(_0x37cb,0x12d));var _0xb37c=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x37cb[_0x9fd887];return _0x1a54ab;};'use strict';var EventEmitter=require(_0xb37c('0x0'));var ChatQueue=require(_0xb37c('0x1'))['db'][_0xb37c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb37c('0x3')](0x0);var events={'afterCreate':_0xb37c('0x4'),'afterUpdate':_0xb37c('0x5'),'afterDestroy':_0xb37c('0x6')};function emitEvent(_0x599668){return function(_0x4afd86,_0xe3fad,_0x2ebee6){ChatQueueEvents[_0xb37c('0x7')](_0x599668+':'+_0x4afd86['id'],_0x4afd86);ChatQueueEvents[_0xb37c('0x7')](_0x599668,_0x4afd86);_0x2ebee6(null);};}for(var e in events){if(events[_0xb37c('0x8')](e)){var event=events[e];ChatQueue[_0xb37c('0x9')](e,emitEvent(event));}}module[_0xb37c('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 2104481..47e2b85 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72fa=['api','bluebird','request-promise','./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger'];(function(_0x47c8d5,_0x5879ea){var _0xc00ac1=function(_0x3a7096){while(--_0x3a7096){_0x47c8d5['push'](_0x47c8d5['shift']());}};_0xc00ac1(++_0x5879ea);}(_0x72fa,0x1c9));var _0xa72f=function(_0x59ce68,_0x98d1b5){_0x59ce68=_0x59ce68-0x0;var _0x37c816=_0x72fa[_0x59ce68];return _0x37c816;};'use strict';var _=require('lodash');var util=require(_0xa72f('0x0'));var logger=require(_0xa72f('0x1'))(_0xa72f('0x2'));var moment=require('moment');var BPromise=require(_0xa72f('0x3'));var rp=require(_0xa72f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa72f('0x5'));module[_0xa72f('0x6')]=function(_0x16e607,_0x492321){return _0x16e607[_0xa72f('0x7')](_0xa72f('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x380f=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','bluebird','rimraf'];(function(_0x43d06a,_0x2d46b6){var _0x4bd34f=function(_0x33a70b){while(--_0x33a70b){_0x43d06a['push'](_0x43d06a['shift']());}};_0x4bd34f(++_0x2d46b6);}(_0x380f,0x1c5));var _0xf380=function(_0x10f76a,_0x49542e){_0x10f76a=_0x10f76a-0x0;var _0x48540c=_0x380f[_0x10f76a];return _0x48540c;};'use strict';var _=require(_0xf380('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf380('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf380('0x2'));var config=require(_0xf380('0x3'));var attributes=require(_0xf380('0x4'));module[_0xf380('0x5')]=function(_0x1cce88,_0x4d1598){return _0x1cce88[_0xf380('0x6')](_0xf380('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 30d14f6..304e3ab 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c19=['stringify','error','code','message','result','catch','GetChatQueue','findAll','options','include','map','model','attributes','ShowChatQueue','ChatQueue','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3755a4,_0x4d0c5d){var _0x15024f=function(_0x4e5b20){while(--_0x4e5b20){_0x3755a4['push'](_0x3755a4['shift']());}};_0x15024f(++_0x4d0c5d);}(_0x0c19,0xf5));var _0x90c1=function(_0xffc83e,_0x9e1b3d){_0xffc83e=_0xffc83e-0x0;var _0x1b9119=_0x0c19[_0xffc83e];return _0x1b9119;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var moment=require(_0x90c1('0x2'));var BPromise=require(_0x90c1('0x3'));var rs=require(_0x90c1('0x4'));var fs=require('fs');var Redis=require(_0x90c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x90c1('0x6'));var logger=require(_0x90c1('0x7'))(_0x90c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x90c1('0x9'));var client=jayson[_0x90c1('0xa')]['http']({'port':0x232a});config[_0x90c1('0xb')]=_[_0x90c1('0xc')](config[_0x90c1('0xb')],{'host':_0x90c1('0xd'),'port':0x18eb});var socket=require(_0x90c1('0xe'))(new Redis(config[_0x90c1('0xb')]));require(_0x90c1('0xf'))['register'](socket);function respondWithRpcPromise(_0x1cca46,_0x31f5fd,_0x47effd){return new BPromise(function(_0x12684e,_0x4e291e){return client['request'](_0x1cca46,_0x47effd)[_0x90c1('0x10')](function(_0x4d7a69){logger[_0x90c1('0x11')](_0x90c1('0x12'),_0x31f5fd,_0x90c1('0x13'));logger[_0x90c1('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x31f5fd,'request\x20sent',JSON[_0x90c1('0x15')](_0x4d7a69));if(_0x4d7a69[_0x90c1('0x16')]){if(_0x4d7a69[_0x90c1('0x16')][_0x90c1('0x17')]===0x1f4){logger['error'](_0x90c1('0x12'),_0x31f5fd,_0x4d7a69[_0x90c1('0x16')][_0x90c1('0x18')]);return _0x4e291e(_0x4d7a69[_0x90c1('0x16')][_0x90c1('0x18')]);}logger[_0x90c1('0x16')]('ChatQueue,\x20%s,\x20%s',_0x31f5fd,_0x4d7a69[_0x90c1('0x16')][_0x90c1('0x18')]);return _0x12684e(_0x4d7a69[_0x90c1('0x16')][_0x90c1('0x18')]);}else{logger[_0x90c1('0x11')](_0x90c1('0x12'),_0x31f5fd,_0x90c1('0x13'));_0x12684e(_0x4d7a69[_0x90c1('0x19')][_0x90c1('0x18')]);}})[_0x90c1('0x1a')](function(_0x2e6ecb){logger['error'](_0x90c1('0x12'),_0x31f5fd,_0x2e6ecb);_0x4e291e(_0x2e6ecb);});});}exports[_0x90c1('0x1b')]=function(_0x37e21b){var _0x1cd1f6=this;return new Promise(function(_0x242331,_0x3c8cc6){return db['ChatQueue'][_0x90c1('0x1c')]({'raw':_0x37e21b['options']?_0x37e21b[_0x90c1('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x37e21b['options']?_0x37e21b[_0x90c1('0x1d')]['where']||null:null,'attributes':_0x37e21b['options']?_0x37e21b[_0x90c1('0x1d')]['attributes']||null:null,'limit':_0x37e21b['options']?_0x37e21b[_0x90c1('0x1d')]['limit']||null:null,'include':_0x37e21b[_0x90c1('0x1d')]?_0x37e21b['options'][_0x90c1('0x1e')]?_[_0x90c1('0x1f')](_0x37e21b[_0x90c1('0x1d')][_0x90c1('0x1e')],function(_0x174506){return{'model':db[_0x174506[_0x90c1('0x20')]],'as':_0x174506['as'],'attributes':_0x174506[_0x90c1('0x21')],'include':_0x174506['include']?_[_0x90c1('0x1f')](_0x174506[_0x90c1('0x1e')],function(_0x18d8ab){return{'model':db[_0x18d8ab[_0x90c1('0x20')]],'as':_0x18d8ab['as'],'attributes':_0x18d8ab[_0x90c1('0x21')],'include':_0x18d8ab[_0x90c1('0x1e')]?_[_0x90c1('0x1f')](_0x18d8ab[_0x90c1('0x1e')],function(_0x40c45d){return{'model':db[_0x40c45d[_0x90c1('0x20')]],'as':_0x40c45d['as'],'attributes':_0x40c45d[_0x90c1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0x10')](function(_0x46c65b){logger[_0x90c1('0x11')](_0x90c1('0x1b'),_0x37e21b);logger['debug'](_0x90c1('0x1b'),_0x37e21b,JSON[_0x90c1('0x15')](_0x46c65b));_0x242331(_0x46c65b);})[_0x90c1('0x1a')](function(_0x5be73c){logger[_0x90c1('0x16')](_0x90c1('0x1b'),_0x5be73c[_0x90c1('0x18')],_0x37e21b);_0x3c8cc6(_0x1cd1f6[_0x90c1('0x16')](0x1f4,_0x5be73c[_0x90c1('0x18')]));});});};exports[_0x90c1('0x22')]=function(_0x25a721){var _0x4d7a09=this;return new Promise(function(_0x2366b4,_0x41f885){return db[_0x90c1('0x23')]['find']({'raw':_0x25a721[_0x90c1('0x1d')]?_0x25a721[_0x90c1('0x1d')][_0x90c1('0x24')]===undefined?!![]:![]:!![],'where':_0x25a721[_0x90c1('0x1d')]?_0x25a721[_0x90c1('0x1d')][_0x90c1('0x25')]||null:null,'attributes':_0x25a721[_0x90c1('0x1d')]?_0x25a721[_0x90c1('0x1d')][_0x90c1('0x21')]||null:null,'include':_0x25a721[_0x90c1('0x1d')]?_0x25a721[_0x90c1('0x1d')][_0x90c1('0x1e')]?_[_0x90c1('0x1f')](_0x25a721[_0x90c1('0x1d')]['include'],function(_0x253e92){return{'model':db[_0x253e92[_0x90c1('0x20')]],'as':_0x253e92['as'],'attributes':_0x253e92[_0x90c1('0x21')],'include':_0x253e92[_0x90c1('0x1e')]?_['map'](_0x253e92['include'],function(_0x173dae){return{'model':db[_0x173dae[_0x90c1('0x20')]],'as':_0x173dae['as'],'attributes':_0x173dae[_0x90c1('0x21')],'include':_0x173dae[_0x90c1('0x1e')]?_['map'](_0x173dae['include'],function(_0x244800){return{'model':db[_0x244800[_0x90c1('0x20')]],'as':_0x244800['as'],'attributes':_0x244800[_0x90c1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0x10')](function(_0x295b4b){logger['info']('ShowChatQueue',_0x25a721);logger['debug'](_0x90c1('0x22'),_0x25a721,JSON[_0x90c1('0x15')](_0x295b4b));_0x2366b4(_0x295b4b);})[_0x90c1('0x1a')](function(_0x4e1dc5){logger[_0x90c1('0x16')]('ShowChatQueue',_0x4e1dc5['message'],_0x25a721);_0x41f885(_0x4d7a09[_0x90c1('0x16')](0x1f4,_0x4e1dc5[_0x90c1('0x18')]));});});}; \ No newline at end of file +var _0x2f56=['request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f56,0xb5));var _0x62f5=function(_0x376edd,_0x320a46){_0x376edd=_0x376edd-0x0;var _0x123ee3=_0x2f56[_0x376edd];return _0x123ee3;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))(_0x62f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});config[_0x62f5('0xc')]=_['defaults'](config[_0x62f5('0xc')],{'host':_0x62f5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62f5('0xc')]));require(_0x62f5('0xe'))['register'](socket);function respondWithRpcPromise(_0x2150bd,_0x1be97f,_0xceb497){return new BPromise(function(_0x58323f,_0x576754){return client[_0x62f5('0xf')](_0x2150bd,_0xceb497)[_0x62f5('0x10')](function(_0x151753){logger[_0x62f5('0x11')](_0x62f5('0x12'),_0x1be97f,_0x62f5('0x13'));logger[_0x62f5('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1be97f,_0x62f5('0x13'),JSON['stringify'](_0x151753));if(_0x151753[_0x62f5('0x15')]){if(_0x151753[_0x62f5('0x15')][_0x62f5('0x16')]===0x1f4){logger[_0x62f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x151753[_0x62f5('0x15')]['message']);return _0x576754(_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);}logger[_0x62f5('0x15')](_0x62f5('0x12'),_0x1be97f,_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);return _0x58323f(_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x62f5('0x13'));_0x58323f(_0x151753[_0x62f5('0x18')]['message']);}})[_0x62f5('0x19')](function(_0x29754f){logger[_0x62f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x29754f);_0x576754(_0x29754f);});});}exports[_0x62f5('0x1a')]=function(_0x160129){var _0x15a397=this;return new Promise(function(_0x5de28a,_0x52fdf6){return db[_0x62f5('0x1b')][_0x62f5('0x1c')]({'raw':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x1e')]===undefined?!![]:![]:!![],'where':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x1f')]||null:null,'attributes':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x20')]||null:null,'limit':_0x160129['options']?_0x160129['options'][_0x62f5('0x21')]||null:null,'include':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x22')]?_[_0x62f5('0x23')](_0x160129[_0x62f5('0x1d')]['include'],function(_0x28e94a){return{'model':db[_0x28e94a['model']],'as':_0x28e94a['as'],'attributes':_0x28e94a[_0x62f5('0x20')],'include':_0x28e94a['include']?_[_0x62f5('0x23')](_0x28e94a[_0x62f5('0x22')],function(_0x131832){return{'model':db[_0x131832[_0x62f5('0x24')]],'as':_0x131832['as'],'attributes':_0x131832[_0x62f5('0x20')],'include':_0x131832[_0x62f5('0x22')]?_[_0x62f5('0x23')](_0x131832['include'],function(_0x21d2c1){return{'model':db[_0x21d2c1['model']],'as':_0x21d2c1['as'],'attributes':_0x21d2c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2426c7){logger[_0x62f5('0x11')](_0x62f5('0x1a'),_0x160129);logger[_0x62f5('0x14')](_0x62f5('0x1a'),_0x160129,JSON[_0x62f5('0x25')](_0x2426c7));_0x5de28a(_0x2426c7);})['catch'](function(_0x12f805){logger[_0x62f5('0x15')](_0x62f5('0x1a'),_0x12f805[_0x62f5('0x17')],_0x160129);_0x52fdf6(_0x15a397[_0x62f5('0x15')](0x1f4,_0x12f805[_0x62f5('0x17')]));});});};exports['ShowChatQueue']=function(_0x177f89){var _0x511421=this;return new Promise(function(_0x1d2541,_0xa08740){return db['ChatQueue'][_0x62f5('0x26')]({'raw':_0x177f89['options']?_0x177f89['options'][_0x62f5('0x1e')]===undefined?!![]:![]:!![],'where':_0x177f89['options']?_0x177f89[_0x62f5('0x1d')][_0x62f5('0x1f')]||null:null,'attributes':_0x177f89[_0x62f5('0x1d')]?_0x177f89['options']['attributes']||null:null,'include':_0x177f89[_0x62f5('0x1d')]?_0x177f89['options']['include']?_[_0x62f5('0x23')](_0x177f89[_0x62f5('0x1d')]['include'],function(_0x1a277f){return{'model':db[_0x1a277f[_0x62f5('0x24')]],'as':_0x1a277f['as'],'attributes':_0x1a277f[_0x62f5('0x20')],'include':_0x1a277f[_0x62f5('0x22')]?_['map'](_0x1a277f[_0x62f5('0x22')],function(_0x4f6e7d){return{'model':db[_0x4f6e7d[_0x62f5('0x24')]],'as':_0x4f6e7d['as'],'attributes':_0x4f6e7d[_0x62f5('0x20')],'include':_0x4f6e7d[_0x62f5('0x22')]?_['map'](_0x4f6e7d[_0x62f5('0x22')],function(_0x2e4712){return{'model':db[_0x2e4712['model']],'as':_0x2e4712['as'],'attributes':_0x2e4712['attributes']};}):[]};}):[]};}):[]:[]})[_0x62f5('0x10')](function(_0x5ad95d){logger['info']('ShowChatQueue',_0x177f89);logger[_0x62f5('0x14')](_0x62f5('0x27'),_0x177f89,JSON[_0x62f5('0x25')](_0x5ad95d));_0x1d2541(_0x5ad95d);})[_0x62f5('0x19')](function(_0x23edf0){logger['error'](_0x62f5('0x27'),_0x23edf0['message'],_0x177f89);_0xa08740(_0x511421[_0x62f5('0x15')](0x1f4,_0x23edf0[_0x62f5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ca9efa9..ed411f8 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x425d=['./chatQueue.events','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x425d,0x1e0));var _0xd425=function(_0x25eee5,_0x397933){_0x25eee5=_0x25eee5-0x0;var _0x49a41f=_0x425d[_0x25eee5];return _0x49a41f;};'use strict';var ChatQueueEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatQueueEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatQueueEvents['on'](_0x50b061,_0xb6ba8e);}}; \ No newline at end of file +var _0xbd50=['length','./chatQueue.events','save','remove','emit'];(function(_0x529111,_0x5988fd){var _0x5afa9a=function(_0x46a0bc){while(--_0x46a0bc){_0x529111['push'](_0x529111['shift']());}};_0x5afa9a(++_0x5988fd);}(_0xbd50,0x196));var _0x0bd5=function(_0x523b6c,_0x1f102c){_0x523b6c=_0x523b6c-0x0;var _0x4f6771=_0xbd50[_0x523b6c];return _0x4f6771;};'use strict';var ChatQueueEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatQueueEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatQueue:'+_0x1b99f3,_0x376024);ChatQueueEvents['on'](_0x1b99f3,_0x5ebe64);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 2e2017a..ec61e33 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x304e2a,_0x21653e){var _0x1e409c=function(_0x56dd08){while(--_0x56dd08){_0x304e2a['push'](_0x304e2a['shift']());}};_0x1e409c(++_0x21653e);}(_0xe14b,0x93));var _0xbe14=function(_0xdcbf1c,_0x438874){_0xdcbf1c=_0xdcbf1c-0x0;var _0x57116e=_0xe14b[_0xdcbf1c];return _0x57116e;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x189ba7,_0x46a2cf){_0x189ba7=_0x189ba7-0x0;var _0x574ebe=_0x3e74[_0x189ba7];return _0x574ebe;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 34c67f6..bf4d5e6 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x770a=['exports','STRING','DATE','moment','sequelize'];(function(_0x194047,_0x3d8da4){var _0x486b52=function(_0x1ecbcc){while(--_0x1ecbcc){_0x194047['push'](_0x194047['shift']());}};_0x486b52(++_0x3d8da4);}(_0x770a,0x1d9));var _0xa770=function(_0x3034d3,_0x22dd61){_0x3034d3=_0x3034d3-0x0;var _0x29fbec=_0x770a[_0x3034d3];return _0x29fbec;};'use strict';var moment=require(_0xa770('0x0'));var Sequelize=require(_0xa770('0x1'));module[_0xa770('0x2')]={'uniqueid':{'type':Sequelize[_0xa770('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa770('0x4')]},'acceptAt':{'type':Sequelize[_0xa770('0x4')]},'exitAt':{'type':Sequelize[_0xa770('0x4')]},'reason':{'type':Sequelize[_0xa770('0x3')]}}; \ No newline at end of file +var _0x4fed=['STRING','DATE','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4fed,0x107));var _0xd4fe=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x4fed[_0x946518];return _0x909b69;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd4fe('0x0')]={'uniqueid':{'type':Sequelize[_0xd4fe('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd4fe('0x2')]},'leaveAt':{'type':Sequelize[_0xd4fe('0x2')]},'acceptAt':{'type':Sequelize[_0xd4fe('0x2')]},'exitAt':{'type':Sequelize[_0xd4fe('0x2')]},'reason':{'type':Sequelize[_0xd4fe('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8e2e4a8..7a34795 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3e3=['rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatQueueReport','include','findAll','rows','show','params','find','catch','body','describe','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3e3,0xdd));var _0x3d3e=function(_0xe92588,_0x6d773c){_0xe92588=_0xe92588-0x0;var _0x29025e=_0xd3e3[_0xe92588];return _0x29025e;};'use strict';var emlformat=require(_0x3d3e('0x0'));var rimraf=require(_0x3d3e('0x1'));var zipdir=require(_0x3d3e('0x2'));var jsonpatch=require(_0x3d3e('0x3'));var rp=require('request-promise');var moment=require(_0x3d3e('0x4'));var BPromise=require(_0x3d3e('0x5'));var Mustache=require('mustache');var util=require(_0x3d3e('0x6'));var path=require(_0x3d3e('0x7'));var sox=require('sox');var csv=require(_0x3d3e('0x8'));var ejs=require(_0x3d3e('0x9'));var fs=require('fs');var fs_extra=require(_0x3d3e('0xa'));var _=require(_0x3d3e('0xb'));var squel=require(_0x3d3e('0xc'));var crypto=require('crypto');var jsforce=require(_0x3d3e('0xd'));var deskjs=require(_0x3d3e('0xe'));var toCsv=require(_0x3d3e('0x8'));var querystring=require('querystring');var Papa=require(_0x3d3e('0xf'));var Redis=require(_0x3d3e('0x10'));var authService=require(_0x3d3e('0x11'));var qs=require(_0x3d3e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d3e('0x13'));var logger=require('../../config/logger')(_0x3d3e('0x14'));var utils=require(_0x3d3e('0x15'));var config=require(_0x3d3e('0x16'));var licenseUtil=require(_0x3d3e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bab27,_0xc50a22){_0xc50a22=_0xc50a22||0xcc;return function(_0x59a93b){if(_0x59a93b){return _0x3bab27[_0x3d3e('0x18')](_0xc50a22);}return _0x3bab27[_0x3d3e('0x19')](_0xc50a22)[_0x3d3e('0x1a')]();};}function respondWithResult(_0xa72f73,_0x3c44cb){_0x3c44cb=_0x3c44cb||0xc8;return function(_0x27ac04){if(_0x27ac04){return _0xa72f73[_0x3d3e('0x19')](_0x3c44cb)[_0x3d3e('0x1b')](_0x27ac04);}};}function respondWithFilteredResult(_0xaa17,_0x5850b4){return function(_0x3856e9){if(_0x3856e9){var _0x2e664b=typeof _0x5850b4[_0x3d3e('0x1c')]==='undefined'&&typeof _0x5850b4['limit']===_0x3d3e('0x1d');var _0x5c19bf=_0x3856e9[_0x3d3e('0x1e')];var _0x3f661c=_0x2e664b?0x0:_0x5850b4[_0x3d3e('0x1c')];var _0x1fa3cc=_0x2e664b?_0x3856e9['count']:_0x5850b4['offset']+_0x5850b4[_0x3d3e('0x1f')];var _0x27c782;if(_0x1fa3cc>=_0x5c19bf){_0x1fa3cc=_0x5c19bf;_0x27c782=0xc8;}else{_0x27c782=0xce;}_0xaa17['status'](_0x27c782);return _0xaa17[_0x3d3e('0x20')](_0x3d3e('0x21'),_0x3f661c+'-'+_0x1fa3cc+'/'+_0x5c19bf)[_0x3d3e('0x1b')](_0x3856e9);}return null;};}function patchUpdates(_0x22083a){return function(_0x3c2c41){try{jsonpatch['apply'](_0x3c2c41,_0x22083a,!![]);}catch(_0x4a1354){return BPromise[_0x3d3e('0x22')](_0x4a1354);}return _0x3c2c41[_0x3d3e('0x23')]();};}function saveUpdates(_0x10314e,_0x326c3d){return function(_0x434949){if(_0x434949){return _0x434949[_0x3d3e('0x24')](_0x10314e)[_0x3d3e('0x25')](function(_0x18efd3){return _0x18efd3;});}return null;};}function removeEntity(_0x4f5377,_0x4c62af){return function(_0x5b9037){if(_0x5b9037){return _0x5b9037[_0x3d3e('0x26')]()[_0x3d3e('0x25')](function(){_0x4f5377[_0x3d3e('0x19')](0xcc)[_0x3d3e('0x1a')]();});}};}function handleEntityNotFound(_0x1e4116,_0x3860d6){return function(_0x42bd39){if(!_0x42bd39){_0x1e4116[_0x3d3e('0x18')](0x194);}return _0x42bd39;};}function handleError(_0x4e77d9,_0x353b74){_0x353b74=_0x353b74||0x1f4;return function(_0x41e53d){logger[_0x3d3e('0x27')](_0x41e53d[_0x3d3e('0x28')]);if(_0x41e53d[_0x3d3e('0x29')]){delete _0x41e53d[_0x3d3e('0x29')];}_0x4e77d9[_0x3d3e('0x19')](_0x353b74)['send'](_0x41e53d);};}exports[_0x3d3e('0x2a')]=function(_0x470030,_0x16e7d9){var _0xb50dfa={},_0x4498f0={},_0x5cffd0={'count':0x0,'rows':[]};var _0x2d78a3=_[_0x3d3e('0x2b')](db['ChatQueueReport'][_0x3d3e('0x2c')],function(_0x2b643b){return{'name':_0x2b643b[_0x3d3e('0x2d')],'type':_0x2b643b[_0x3d3e('0x2e')][_0x3d3e('0x2f')]};});_0x4498f0['model']=_[_0x3d3e('0x2b')](_0x2d78a3,'name');_0x4498f0['query']=_[_0x3d3e('0x30')](_0x470030[_0x3d3e('0x31')]);_0x4498f0[_0x3d3e('0x32')]=_[_0x3d3e('0x33')](_0x4498f0[_0x3d3e('0x34')],_0x4498f0[_0x3d3e('0x31')]);_0xb50dfa['attributes']=_[_0x3d3e('0x33')](_0x4498f0[_0x3d3e('0x34')],qs[_0x3d3e('0x35')](_0x470030['query'][_0x3d3e('0x35')]));_0xb50dfa[_0x3d3e('0x36')]=_0xb50dfa['attributes'][_0x3d3e('0x37')]?_0xb50dfa['attributes']:_0x4498f0['model'];if(!_0x470030['query'][_0x3d3e('0x38')](_0x3d3e('0x39'))){_0xb50dfa['limit']=qs['limit'](_0x470030[_0x3d3e('0x31')][_0x3d3e('0x1f')]);_0xb50dfa['offset']=qs['offset'](_0x470030['query'][_0x3d3e('0x1c')]);}_0xb50dfa['order']=qs[_0x3d3e('0x3a')](_0x470030[_0x3d3e('0x31')][_0x3d3e('0x3a')]);_0xb50dfa[_0x3d3e('0x3b')]=qs['filters'](_[_0x3d3e('0x3c')](_0x470030[_0x3d3e('0x31')],_0x4498f0[_0x3d3e('0x32')]),_0x2d78a3);if(_0x470030[_0x3d3e('0x31')][_0x3d3e('0x3d')]){_0xb50dfa['where']=_[_0x3d3e('0x3e')](_0xb50dfa[_0x3d3e('0x3b')],{'$or':_[_0x3d3e('0x2b')](_0x2d78a3,function(_0x2fc45c){if(_0x2fc45c['type']!=='VIRTUAL'){var _0x447da0={};_0x447da0[_0x2fc45c[_0x3d3e('0x29')]]={'$like':'%'+_0x470030['query'][_0x3d3e('0x3d')]+'%'};return _0x447da0;}})});}_0xb50dfa=_['merge']({},_0xb50dfa,_0x470030[_0x3d3e('0x3f')]);var _0x152ac6={'where':_0xb50dfa[_0x3d3e('0x3b')]};return db[_0x3d3e('0x40')]['count'](_0x152ac6)[_0x3d3e('0x25')](function(_0xd459b2){_0x5cffd0[_0x3d3e('0x1e')]=_0xd459b2;if(_0x470030[_0x3d3e('0x31')]['includeAll']){_0xb50dfa[_0x3d3e('0x41')]=[{'all':!![]}];}return db[_0x3d3e('0x40')][_0x3d3e('0x42')](_0xb50dfa);})[_0x3d3e('0x25')](function(_0x2fd4b4){_0x5cffd0[_0x3d3e('0x43')]=_0x2fd4b4;return _0x5cffd0;})[_0x3d3e('0x25')](respondWithFilteredResult(_0x16e7d9,_0xb50dfa))['catch'](handleError(_0x16e7d9,null));};exports[_0x3d3e('0x44')]=function(_0x4c157a,_0x1c15ff){var _0x2c1189={'raw':!![],'where':{'id':_0x4c157a[_0x3d3e('0x45')]['id']}},_0x259002={};_0x259002['model']=_[_0x3d3e('0x30')](db['ChatQueueReport'][_0x3d3e('0x2c')]);_0x259002[_0x3d3e('0x31')]=_['keys'](_0x4c157a['query']);_0x259002[_0x3d3e('0x32')]=_[_0x3d3e('0x33')](_0x259002[_0x3d3e('0x34')],_0x259002['query']);_0x2c1189[_0x3d3e('0x36')]=_['intersection'](_0x259002[_0x3d3e('0x34')],qs[_0x3d3e('0x35')](_0x4c157a['query']['fields']));_0x2c1189['attributes']=_0x2c1189[_0x3d3e('0x36')][_0x3d3e('0x37')]?_0x2c1189[_0x3d3e('0x36')]:_0x259002[_0x3d3e('0x34')];if(_0x4c157a[_0x3d3e('0x31')]['includeAll']){_0x2c1189[_0x3d3e('0x41')]=[{'all':!![]}];}_0x2c1189=_[_0x3d3e('0x3e')]({},_0x2c1189,_0x4c157a[_0x3d3e('0x3f')]);return db[_0x3d3e('0x40')][_0x3d3e('0x46')](_0x2c1189)[_0x3d3e('0x25')](handleEntityNotFound(_0x1c15ff,null))[_0x3d3e('0x25')](respondWithResult(_0x1c15ff,null))[_0x3d3e('0x47')](handleError(_0x1c15ff,null));};exports['create']=function(_0x6ffe29,_0x25d58e){return db[_0x3d3e('0x40')]['create'](_0x6ffe29[_0x3d3e('0x48')],{})['then'](respondWithResult(_0x25d58e,0xc9))[_0x3d3e('0x47')](handleError(_0x25d58e,null));};exports['update']=function(_0x333412,_0x3eca54){if(_0x333412['body']['id']){delete _0x333412[_0x3d3e('0x48')]['id'];}return db[_0x3d3e('0x40')][_0x3d3e('0x46')]({'where':{'id':_0x333412[_0x3d3e('0x45')]['id']}})[_0x3d3e('0x25')](handleEntityNotFound(_0x3eca54,null))[_0x3d3e('0x25')](saveUpdates(_0x333412[_0x3d3e('0x48')],null))['then'](respondWithResult(_0x3eca54,null))[_0x3d3e('0x47')](handleError(_0x3eca54,null));};exports[_0x3d3e('0x26')]=function(_0x39b425,_0x55f61d){return db['ChatQueueReport']['find']({'where':{'id':_0x39b425[_0x3d3e('0x45')]['id']}})[_0x3d3e('0x25')](handleEntityNotFound(_0x55f61d,null))[_0x3d3e('0x25')](removeEntity(_0x55f61d,null))['catch'](handleError(_0x55f61d,null));};exports[_0x3d3e('0x49')]=function(_0x538e5f,_0xdaaa84){return db['ChatQueueReport'][_0x3d3e('0x49')]()[_0x3d3e('0x25')](respondWithResult(_0xdaaa84,null))[_0x3d3e('0x47')](handleError(_0xdaaa84,null));}; \ No newline at end of file +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(_0x48aca4,_0x470f4f){var _0x39af1b=function(_0x53cf6f){while(--_0x53cf6f){_0x48aca4['push'](_0x48aca4['shift']());}};_0x39af1b(++_0x470f4f);}(_0x0024,0xa8));var _0x4002=function(_0x373d0a,_0x3075d6){_0x373d0a=_0x373d0a-0x0;var _0x2b9b88=_0x0024[_0x373d0a];return _0x2b9b88;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e3561ce..12af40a 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x5bad8f,_0x3a51ef){var _0x2f643a=function(_0x23e4ed){while(--_0x23e4ed){_0x5bad8f['push'](_0x5bad8f['shift']());}};_0x2f643a(++_0x3a51ef);}(_0xe706,0xa3));var _0x6e70=function(_0x201043,_0x57e46b){_0x201043=_0x201043-0x0;var _0x29e5f2=_0xe706[_0x201043];return _0x29e5f2;};'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 +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5cf63c,_0x1bb2a6){var _0xe54df4=function(_0x3b5feb){while(--_0x3b5feb){_0x5cf63c['push'](_0x5cf63c['shift']());}};_0xe54df4(++_0x1bb2a6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 08b4535..e0ecf51 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf248=['code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28d200,_0x3ad73c){var _0x273bf2=function(_0x2c10a6){while(--_0x2c10a6){_0x28d200['push'](_0x28d200['shift']());}};_0x273bf2(++_0x3ad73c);}(_0xf248,0xfc));var _0x8f24=function(_0x3e3d08,_0x5439be){_0x3e3d08=_0x3e3d08-0x0;var _0x44751a=_0xf248[_0x3e3d08];return _0x44751a;};'use strict';var _=require(_0x8f24('0x0'));var util=require(_0x8f24('0x1'));var moment=require(_0x8f24('0x2'));var BPromise=require(_0x8f24('0x3'));var rs=require(_0x8f24('0x4'));var fs=require('fs');var Redis=require(_0x8f24('0x5'));var db=require(_0x8f24('0x6'))['db'];var utils=require(_0x8f24('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x8f24('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8f24('0x9')][_0x8f24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x435869,_0x4f8d83,_0x52d7dd){return new BPromise(function(_0x120961,_0xc463be){return client[_0x8f24('0xb')](_0x435869,_0x52d7dd)[_0x8f24('0xc')](function(_0x3f229f){logger[_0x8f24('0xd')](_0x8f24('0xe'),_0x4f8d83,_0x8f24('0xf'));logger[_0x8f24('0x10')](_0x8f24('0x11'),_0x4f8d83,_0x8f24('0xf'),JSON[_0x8f24('0x12')](_0x3f229f));if(_0x3f229f['error']){if(_0x3f229f[_0x8f24('0x13')][_0x8f24('0x14')]===0x1f4){logger[_0x8f24('0x13')](_0x8f24('0xe'),_0x4f8d83,_0x3f229f[_0x8f24('0x13')][_0x8f24('0x15')]);return _0xc463be(_0x3f229f[_0x8f24('0x13')]['message']);}logger[_0x8f24('0x13')](_0x8f24('0xe'),_0x4f8d83,_0x3f229f['error'][_0x8f24('0x15')]);return _0x120961(_0x3f229f[_0x8f24('0x13')]['message']);}else{logger[_0x8f24('0xd')](_0x8f24('0xe'),_0x4f8d83,_0x8f24('0xf'));_0x120961(_0x3f229f[_0x8f24('0x16')][_0x8f24('0x15')]);}})[_0x8f24('0x17')](function(_0x1d1913){logger[_0x8f24('0x13')](_0x8f24('0xe'),_0x4f8d83,_0x1d1913);_0xc463be(_0x1d1913);});});}exports[_0x8f24('0x18')]=function(_0x6a91e6){var _0xc076a5=this;return new Promise(function(_0x4ca9e3,_0x4c98a8){return db[_0x8f24('0x19')][_0x8f24('0x1a')](_0x6a91e6['body'],{'raw':_0x6a91e6[_0x8f24('0x1b')]?_0x6a91e6[_0x8f24('0x1b')][_0x8f24('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3c66fd){logger['info']('CreateChatQueueReport',_0x6a91e6);logger['debug'](_0x8f24('0x18'),_0x6a91e6,JSON['stringify'](_0x3c66fd));_0x4ca9e3(_0x3c66fd);})[_0x8f24('0x17')](function(_0x11e407){logger[_0x8f24('0x13')](_0x8f24('0x18'),_0x11e407[_0x8f24('0x15')],_0x6a91e6);_0x4c98a8(_0xc076a5[_0x8f24('0x13')](0x1f4,_0x11e407[_0x8f24('0x15')]));});});};exports[_0x8f24('0x1d')]=function(_0x26fb67){var _0x4781f1=this;return new Promise(function(_0x1f61eb,_0x29cc88){return db['ChatQueueReport'][_0x8f24('0x1e')](_0x26fb67[_0x8f24('0x1f')],{'raw':_0x26fb67['options']?_0x26fb67[_0x8f24('0x1b')][_0x8f24('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26fb67[_0x8f24('0x1b')]?_0x26fb67[_0x8f24('0x1b')][_0x8f24('0x20')]||null:null,'attributes':_0x26fb67[_0x8f24('0x1b')]?_0x26fb67[_0x8f24('0x1b')]['attributes']||null:null,'limit':_0x26fb67['options']?_0x26fb67[_0x8f24('0x1b')][_0x8f24('0x21')]||null:null})[_0x8f24('0xc')](function(_0x4c5656){logger['info'](_0x8f24('0x1d'),_0x26fb67);logger[_0x8f24('0x10')](_0x8f24('0x1d'),_0x26fb67,JSON[_0x8f24('0x12')](_0x4c5656));_0x1f61eb(_0x4c5656);})[_0x8f24('0x17')](function(_0x120fb3){logger['error']('UpdateChatQueueReport',_0x120fb3[_0x8f24('0x15')],_0x26fb67);_0x29cc88(_0x4781f1[_0x8f24('0x13')](0x1f4,_0x120fb3[_0x8f24('0x15')]));});});}; \ No newline at end of file +var _0x4f6f=['body','options','raw','debug','stringify','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport'];(function(_0x40e83f,_0x4f467a){var _0x17207f=function(_0xbeb1f0){while(--_0xbeb1f0){_0x40e83f['push'](_0x40e83f['shift']());}};_0x17207f(++_0x4f467a);}(_0x4f6f,0x17e));var _0xf4f6=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x4f6f[_0x15fc3c];return _0x94c5c8;};'use strict';var _=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var moment=require(_0xf4f6('0x2'));var BPromise=require(_0xf4f6('0x3'));var rs=require(_0xf4f6('0x4'));var fs=require('fs');var Redis=require(_0xf4f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4f6('0x6'));var logger=require(_0xf4f6('0x7'))('rpc');var config=require(_0xf4f6('0x8'));var jayson=require(_0xf4f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5764d8,_0x589c2a,_0x4f286b){return new BPromise(function(_0x8d4ffc,_0x44066c){return client['request'](_0x5764d8,_0x4f286b)[_0xf4f6('0xa')](function(_0x337807){logger[_0xf4f6('0xb')](_0xf4f6('0xc'),_0x589c2a,_0xf4f6('0xd'));logger['debug'](_0xf4f6('0xe'),_0x589c2a,'request\x20sent',JSON['stringify'](_0x337807));if(_0x337807[_0xf4f6('0xf')]){if(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x10')]===0x1f4){logger[_0xf4f6('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x589c2a,_0x337807['error']['message']);return _0x44066c(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x11')]);}logger[_0xf4f6('0xf')](_0xf4f6('0xc'),_0x589c2a,_0x337807['error'][_0xf4f6('0x11')]);return _0x8d4ffc(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x11')]);}else{logger[_0xf4f6('0xb')](_0xf4f6('0xc'),_0x589c2a,'request\x20sent');_0x8d4ffc(_0x337807[_0xf4f6('0x12')][_0xf4f6('0x11')]);}})[_0xf4f6('0x13')](function(_0x295806){logger['error'](_0xf4f6('0xc'),_0x589c2a,_0x295806);_0x44066c(_0x295806);});});}exports[_0xf4f6('0x14')]=function(_0x10f445){var _0x3501d7=this;return new Promise(function(_0x1668d9,_0x372d2b){return db['ChatQueueReport']['create'](_0x10f445[_0xf4f6('0x15')],{'raw':_0x10f445['options']?_0x10f445[_0xf4f6('0x16')][_0xf4f6('0x17')]===undefined?!![]:![]:!![]})[_0xf4f6('0xa')](function(_0x40357a){logger['info'](_0xf4f6('0x14'),_0x10f445);logger[_0xf4f6('0x18')](_0xf4f6('0x14'),_0x10f445,JSON[_0xf4f6('0x19')](_0x40357a));_0x1668d9(_0x40357a);})[_0xf4f6('0x13')](function(_0x2a1eaa){logger[_0xf4f6('0xf')](_0xf4f6('0x14'),_0x2a1eaa['message'],_0x10f445);_0x372d2b(_0x3501d7['error'](0x1f4,_0x2a1eaa['message']));});});};exports[_0xf4f6('0x1a')]=function(_0x1926bd){var _0x1ebc1a=this;return new Promise(function(_0x238212,_0x1efef3){return db[_0xf4f6('0x1b')][_0xf4f6('0x1c')](_0x1926bd[_0xf4f6('0x15')],{'raw':_0x1926bd['options']?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1926bd['options']?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x1d')]||null:null,'attributes':_0x1926bd[_0xf4f6('0x16')]?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x1e')]||null:null,'limit':_0x1926bd[_0xf4f6('0x16')]?_0x1926bd['options']['limit']||null:null})[_0xf4f6('0xa')](function(_0x2080ad){logger[_0xf4f6('0xb')](_0xf4f6('0x1a'),_0x1926bd);logger[_0xf4f6('0x18')](_0xf4f6('0x1a'),_0x1926bd,JSON['stringify'](_0x2080ad));_0x238212(_0x2080ad);})['catch'](function(_0x400b83){logger[_0xf4f6('0xf')](_0xf4f6('0x1a'),_0x400b83['message'],_0x1926bd);_0x1efef3(_0x1ebc1a[_0xf4f6('0xf')](0x1f4,_0x400b83[_0xf4f6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index f96d7af..0f80fb8 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8734=['path','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','create','put','delete','destroy','exports','util'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8734,0xdc));var _0x4873=function(_0x51b7c5,_0x218969){_0x51b7c5=_0x51b7c5-0x0;var _0x3355d7=_0x8734[_0x51b7c5];return _0x3355d7;};'use strict';var multer=require('multer');var util=require(_0x4873('0x0'));var path=require(_0x4873('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4873('0x2')]();var fs_extra=require(_0x4873('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4873('0x4'));var config=require(_0x4873('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x4873('0x6')](),controller[_0x4873('0x7')]);router[_0x4873('0x8')](_0x4873('0x9'),auth['isAuthenticated'](),controller[_0x4873('0xa')]);router['get'](_0x4873('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4873('0xc')]);router[_0x4873('0xd')](_0x4873('0xb'),auth[_0x4873('0x6')](),controller['update']);router[_0x4873('0xe')](_0x4873('0xb'),auth[_0x4873('0x6')](),controller[_0x4873('0xf')]);module[_0x4873('0x10')]=router; \ No newline at end of file +var _0x3793=['isAuthenticated','index','/describe','/:id','show','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x29c3b9,_0x4adaf7){var _0x637286=function(_0x36b4f3){while(--_0x36b4f3){_0x29c3b9['push'](_0x29c3b9['shift']());}};_0x637286(++_0x4adaf7);}(_0x3793,0xa1));var _0x3379=function(_0x569c5a,_0x9ef4b6){_0x569c5a=_0x569c5a-0x0;var _0x1676d0=_0x3793[_0x569c5a];return _0x1676d0;};'use strict';var multer=require(_0x3379('0x0'));var util=require(_0x3379('0x1'));var path=require('path');var timeout=require(_0x3379('0x2'));var express=require(_0x3379('0x3'));var router=express[_0x3379('0x4')]();var fs_extra=require(_0x3379('0x5'));var auth=require(_0x3379('0x6'));var interaction=require(_0x3379('0x7'));var config=require('../../config/environment');var controller=require(_0x3379('0x8'));router[_0x3379('0x9')]('/',auth[_0x3379('0xa')](),controller[_0x3379('0xb')]);router['get'](_0x3379('0xc'),auth[_0x3379('0xa')](),controller['describe']);router[_0x3379('0x9')](_0x3379('0xd'),auth[_0x3379('0xa')](),controller[_0x3379('0xe')]);router[_0x3379('0xf')]('/',auth[_0x3379('0xa')](),controller['create']);router['put'](_0x3379('0xd'),auth['isAuthenticated'](),controller[_0x3379('0x10')]);router['delete'](_0x3379('0xd'),auth[_0x3379('0xa')](),controller[_0x3379('0x11')]);module[_0x3379('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d24375e..4b60d7c 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5c804e,_0x583316){var _0x317514=function(_0x266b66){while(--_0x266b66){_0x5c804e['push'](_0x5c804e['shift']());}};_0x317514(++_0x583316);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3c231b,_0xf13470){var _0x394e62=function(_0x226d6f){while(--_0x226d6f){_0x3c231b['push'](_0x3c231b['shift']());}};_0x394e62(++_0xf13470);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xf3cd[_0x564821];return _0x2b604d;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 417a6b8..deda079 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ea1=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','limit','status','set','apply','reject','save','destroy','then','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','ChatTransferReport','includeAll','findAll','rows','catch','show','params','options','find','create','body','update','describe','eml-format'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5ea1,0x97));var _0x15ea=function(_0x1246d7,_0x350673){_0x1246d7=_0x1246d7-0x0;var _0x5b41a3=_0x5ea1[_0x1246d7];return _0x5b41a3;};'use strict';var emlformat=require(_0x15ea('0x0'));var rimraf=require(_0x15ea('0x1'));var zipdir=require(_0x15ea('0x2'));var jsonpatch=require(_0x15ea('0x3'));var rp=require(_0x15ea('0x4'));var moment=require(_0x15ea('0x5'));var BPromise=require(_0x15ea('0x6'));var Mustache=require(_0x15ea('0x7'));var util=require(_0x15ea('0x8'));var path=require(_0x15ea('0x9'));var sox=require('sox');var csv=require(_0x15ea('0xa'));var ejs=require(_0x15ea('0xb'));var fs=require('fs');var fs_extra=require(_0x15ea('0xc'));var _=require('lodash');var squel=require(_0x15ea('0xd'));var crypto=require(_0x15ea('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x15ea('0xa'));var querystring=require(_0x15ea('0xf'));var Papa=require('papaparse');var Redis=require(_0x15ea('0x10'));var authService=require(_0x15ea('0x11'));var qs=require(_0x15ea('0x12'));var as=require(_0x15ea('0x13'));var hardwareService=require(_0x15ea('0x14'));var logger=require('../../config/logger')(_0x15ea('0x15'));var utils=require('../../config/utils');var config=require(_0x15ea('0x16'));var licenseUtil=require(_0x15ea('0x17'));var db=require(_0x15ea('0x18'))['db'];function respondWithStatusCode(_0x24f84f,_0x17fba6){_0x17fba6=_0x17fba6||0xcc;return function(_0x139a02){if(_0x139a02){return _0x24f84f[_0x15ea('0x19')](_0x17fba6);}return _0x24f84f['status'](_0x17fba6)[_0x15ea('0x1a')]();};}function respondWithResult(_0x46b888,_0x5165d0){_0x5165d0=_0x5165d0||0xc8;return function(_0x5087c8){if(_0x5087c8){return _0x46b888['status'](_0x5165d0)[_0x15ea('0x1b')](_0x5087c8);}};}function respondWithFilteredResult(_0x556af6,_0x1cff01){return function(_0x4780f8){if(_0x4780f8){var _0x316864=typeof _0x1cff01[_0x15ea('0x1c')]==='undefined'&&typeof _0x1cff01['limit']==='undefined';var _0x3aa2b4=_0x4780f8['count'];var _0x57a8f8=_0x316864?0x0:_0x1cff01[_0x15ea('0x1c')];var _0x228f6f=_0x316864?_0x4780f8[_0x15ea('0x1d')]:_0x1cff01[_0x15ea('0x1c')]+_0x1cff01[_0x15ea('0x1e')];var _0x274ecb;if(_0x228f6f>=_0x3aa2b4){_0x228f6f=_0x3aa2b4;_0x274ecb=0xc8;}else{_0x274ecb=0xce;}_0x556af6[_0x15ea('0x1f')](_0x274ecb);return _0x556af6[_0x15ea('0x20')]('Content-Range',_0x57a8f8+'-'+_0x228f6f+'/'+_0x3aa2b4)[_0x15ea('0x1b')](_0x4780f8);}return null;};}function patchUpdates(_0x3eeadd){return function(_0x5b9ccf){try{jsonpatch[_0x15ea('0x21')](_0x5b9ccf,_0x3eeadd,!![]);}catch(_0x5017ad){return BPromise[_0x15ea('0x22')](_0x5017ad);}return _0x5b9ccf[_0x15ea('0x23')]();};}function saveUpdates(_0x2b458b,_0x55f866){return function(_0x428f6a){if(_0x428f6a){return _0x428f6a['update'](_0x2b458b)['then'](function(_0x5a684b){return _0x5a684b;});}return null;};}function removeEntity(_0x48e7a0,_0x1d3f36){return function(_0x431bdc){if(_0x431bdc){return _0x431bdc[_0x15ea('0x24')]()[_0x15ea('0x25')](function(){_0x48e7a0[_0x15ea('0x1f')](0xcc)[_0x15ea('0x1a')]();});}};}function handleEntityNotFound(_0x5f45f3,_0x18aebd){return function(_0x2a5b90){if(!_0x2a5b90){_0x5f45f3[_0x15ea('0x19')](0x194);}return _0x2a5b90;};}function handleError(_0x51a42f,_0x413529){_0x413529=_0x413529||0x1f4;return function(_0x46cf53){logger[_0x15ea('0x26')](_0x46cf53[_0x15ea('0x27')]);if(_0x46cf53['name']){delete _0x46cf53['name'];}_0x51a42f['status'](_0x413529)[_0x15ea('0x28')](_0x46cf53);};}exports[_0x15ea('0x29')]=function(_0x4de4f6,_0x4b0899){var _0x3b5926={},_0x5bd588={},_0x2ec7a0={'count':0x0,'rows':[]};var _0xdd3c94=_['map'](db['ChatTransferReport'][_0x15ea('0x2a')],function(_0x2a05a0){return{'name':_0x2a05a0[_0x15ea('0x2b')],'type':_0x2a05a0[_0x15ea('0x2c')][_0x15ea('0x2d')]};});_0x5bd588[_0x15ea('0x2e')]=_[_0x15ea('0x2f')](_0xdd3c94,_0x15ea('0x30'));_0x5bd588[_0x15ea('0x31')]=_[_0x15ea('0x32')](_0x4de4f6[_0x15ea('0x31')]);_0x5bd588[_0x15ea('0x33')]=_[_0x15ea('0x34')](_0x5bd588[_0x15ea('0x2e')],_0x5bd588[_0x15ea('0x31')]);_0x3b5926['attributes']=_[_0x15ea('0x34')](_0x5bd588['model'],qs['fields'](_0x4de4f6['query'][_0x15ea('0x35')]));_0x3b5926[_0x15ea('0x36')]=_0x3b5926[_0x15ea('0x36')]['length']?_0x3b5926[_0x15ea('0x36')]:_0x5bd588[_0x15ea('0x2e')];if(!_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x37')](_0x15ea('0x38'))){_0x3b5926[_0x15ea('0x1e')]=qs['limit'](_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x1e')]);_0x3b5926['offset']=qs[_0x15ea('0x1c')](_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x1c')]);}_0x3b5926[_0x15ea('0x39')]=qs[_0x15ea('0x3a')](_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x3a')]);_0x3b5926[_0x15ea('0x3b')]=qs[_0x15ea('0x33')](_[_0x15ea('0x3c')](_0x4de4f6[_0x15ea('0x31')],_0x5bd588['filters']),_0xdd3c94);if(_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x3d')]){_0x3b5926['where']=_[_0x15ea('0x3e')](_0x3b5926[_0x15ea('0x3b')],{'$or':_['map'](_0xdd3c94,function(_0x1f6f03){if(_0x1f6f03[_0x15ea('0x2c')]!=='VIRTUAL'){var _0x11f1e1={};_0x11f1e1[_0x1f6f03[_0x15ea('0x30')]]={'$like':'%'+_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x3d')]+'%'};return _0x11f1e1;}})});}_0x3b5926=_['merge']({},_0x3b5926,_0x4de4f6['options']);var _0x13cfa4={'where':_0x3b5926[_0x15ea('0x3b')]};return db[_0x15ea('0x3f')]['count'](_0x13cfa4)[_0x15ea('0x25')](function(_0x41d587){_0x2ec7a0[_0x15ea('0x1d')]=_0x41d587;if(_0x4de4f6[_0x15ea('0x31')][_0x15ea('0x40')]){_0x3b5926['include']=[{'all':!![]}];}return db[_0x15ea('0x3f')][_0x15ea('0x41')](_0x3b5926);})[_0x15ea('0x25')](function(_0x536eb1){_0x2ec7a0[_0x15ea('0x42')]=_0x536eb1;return _0x2ec7a0;})['then'](respondWithFilteredResult(_0x4b0899,_0x3b5926))[_0x15ea('0x43')](handleError(_0x4b0899,null));};exports[_0x15ea('0x44')]=function(_0x57284e,_0x3c9d08){var _0x35d501={'raw':!![],'where':{'id':_0x57284e[_0x15ea('0x45')]['id']}},_0x339a4b={};_0x339a4b['model']=_[_0x15ea('0x32')](db[_0x15ea('0x3f')]['rawAttributes']);_0x339a4b[_0x15ea('0x31')]=_['keys'](_0x57284e[_0x15ea('0x31')]);_0x339a4b['filters']=_['intersection'](_0x339a4b[_0x15ea('0x2e')],_0x339a4b[_0x15ea('0x31')]);_0x35d501['attributes']=_[_0x15ea('0x34')](_0x339a4b[_0x15ea('0x2e')],qs['fields'](_0x57284e[_0x15ea('0x31')][_0x15ea('0x35')]));_0x35d501[_0x15ea('0x36')]=_0x35d501[_0x15ea('0x36')]['length']?_0x35d501[_0x15ea('0x36')]:_0x339a4b[_0x15ea('0x2e')];if(_0x57284e[_0x15ea('0x31')][_0x15ea('0x40')]){_0x35d501['include']=[{'all':!![]}];}_0x35d501=_[_0x15ea('0x3e')]({},_0x35d501,_0x57284e[_0x15ea('0x46')]);return db[_0x15ea('0x3f')][_0x15ea('0x47')](_0x35d501)['then'](handleEntityNotFound(_0x3c9d08,null))[_0x15ea('0x25')](respondWithResult(_0x3c9d08,null))[_0x15ea('0x43')](handleError(_0x3c9d08,null));};exports[_0x15ea('0x48')]=function(_0x4677da,_0x3d8595){return db[_0x15ea('0x3f')][_0x15ea('0x48')](_0x4677da[_0x15ea('0x49')],{})[_0x15ea('0x25')](respondWithResult(_0x3d8595,0xc9))[_0x15ea('0x43')](handleError(_0x3d8595,null));};exports[_0x15ea('0x4a')]=function(_0x2b4eb7,_0x3a9200){if(_0x2b4eb7[_0x15ea('0x49')]['id']){delete _0x2b4eb7[_0x15ea('0x49')]['id'];}return db[_0x15ea('0x3f')][_0x15ea('0x47')]({'where':{'id':_0x2b4eb7[_0x15ea('0x45')]['id']}})[_0x15ea('0x25')](handleEntityNotFound(_0x3a9200,null))[_0x15ea('0x25')](saveUpdates(_0x2b4eb7[_0x15ea('0x49')],null))[_0x15ea('0x25')](respondWithResult(_0x3a9200,null))[_0x15ea('0x43')](handleError(_0x3a9200,null));};exports[_0x15ea('0x24')]=function(_0xc8e72b,_0x2a13ef){return db[_0x15ea('0x3f')][_0x15ea('0x47')]({'where':{'id':_0xc8e72b['params']['id']}})[_0x15ea('0x25')](handleEntityNotFound(_0x2a13ef,null))[_0x15ea('0x25')](removeEntity(_0x2a13ef,null))[_0x15ea('0x43')](handleError(_0x2a13ef,null));};exports[_0x15ea('0x4b')]=function(_0x5958c1,_0x322213){return db[_0x15ea('0x3f')][_0x15ea('0x4b')]()[_0x15ea('0x25')](respondWithResult(_0x322213,null))[_0x15ea('0x43')](handleError(_0x322213,null));}; \ No newline at end of file +var _0x6136=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','include','findAll','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x3dfc68,_0x304d60){var _0x245084=function(_0x3c1e0a){while(--_0x3c1e0a){_0x3dfc68['push'](_0x3dfc68['shift']());}};_0x245084(++_0x304d60);}(_0x6136,0x111));var _0x6613=function(_0x5cfd2a,_0x44a11c){_0x5cfd2a=_0x5cfd2a-0x0;var _0x3a4582=_0x6136[_0x5cfd2a];return _0x3a4582;};'use strict';var emlformat=require(_0x6613('0x0'));var rimraf=require(_0x6613('0x1'));var zipdir=require(_0x6613('0x2'));var jsonpatch=require(_0x6613('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6613('0x4'));var Mustache=require(_0x6613('0x5'));var util=require(_0x6613('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6613('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6613('0x8'));var _=require(_0x6613('0x9'));var squel=require(_0x6613('0xa'));var crypto=require('crypto');var jsforce=require(_0x6613('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6613('0x7'));var querystring=require(_0x6613('0xc'));var Papa=require(_0x6613('0xd'));var Redis=require('ioredis');var authService=require(_0x6613('0xe'));var qs=require(_0x6613('0xf'));var as=require(_0x6613('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6613('0x11'))('api');var utils=require(_0x6613('0x12'));var config=require(_0x6613('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6613('0x14'))['db'];function respondWithStatusCode(_0x1abe66,_0x46e81c){_0x46e81c=_0x46e81c||0xcc;return function(_0x11cf74){if(_0x11cf74){return _0x1abe66[_0x6613('0x15')](_0x46e81c);}return _0x1abe66[_0x6613('0x16')](_0x46e81c)[_0x6613('0x17')]();};}function respondWithResult(_0xfff29c,_0xa3e2ae){_0xa3e2ae=_0xa3e2ae||0xc8;return function(_0x13bc2e){if(_0x13bc2e){return _0xfff29c[_0x6613('0x16')](_0xa3e2ae)[_0x6613('0x18')](_0x13bc2e);}};}function respondWithFilteredResult(_0xb7c796,_0x21f9c7){return function(_0x5180b1){if(_0x5180b1){var _0x4bcac0=typeof _0x21f9c7[_0x6613('0x19')]===_0x6613('0x1a')&&typeof _0x21f9c7[_0x6613('0x1b')]===_0x6613('0x1a');var _0x10f5c5=_0x5180b1['count'];var _0x5b9ab2=_0x4bcac0?0x0:_0x21f9c7[_0x6613('0x19')];var _0x580112=_0x4bcac0?_0x5180b1['count']:_0x21f9c7[_0x6613('0x19')]+_0x21f9c7[_0x6613('0x1b')];var _0x1b1bad;if(_0x580112>=_0x10f5c5){_0x580112=_0x10f5c5;_0x1b1bad=0xc8;}else{_0x1b1bad=0xce;}_0xb7c796[_0x6613('0x16')](_0x1b1bad);return _0xb7c796[_0x6613('0x1c')](_0x6613('0x1d'),_0x5b9ab2+'-'+_0x580112+'/'+_0x10f5c5)[_0x6613('0x18')](_0x5180b1);}return null;};}function patchUpdates(_0x27f83e){return function(_0x4707c0){try{jsonpatch[_0x6613('0x1e')](_0x4707c0,_0x27f83e,!![]);}catch(_0x39c0fe){return BPromise[_0x6613('0x1f')](_0x39c0fe);}return _0x4707c0[_0x6613('0x20')]();};}function saveUpdates(_0x109abb,_0x5cef72){return function(_0x387a0c){if(_0x387a0c){return _0x387a0c['update'](_0x109abb)[_0x6613('0x21')](function(_0x20b373){return _0x20b373;});}return null;};}function removeEntity(_0x37fef1,_0x300179){return function(_0x62ed55){if(_0x62ed55){return _0x62ed55[_0x6613('0x22')]()['then'](function(){_0x37fef1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e892,_0xc15507){return function(_0x23254b){if(!_0x23254b){_0x39e892[_0x6613('0x15')](0x194);}return _0x23254b;};}function handleError(_0x4a2448,_0x30fcc4){_0x30fcc4=_0x30fcc4||0x1f4;return function(_0x281488){logger[_0x6613('0x23')](_0x281488[_0x6613('0x24')]);if(_0x281488['name']){delete _0x281488[_0x6613('0x25')];}_0x4a2448[_0x6613('0x16')](_0x30fcc4)['send'](_0x281488);};}exports[_0x6613('0x26')]=function(_0x20e4f0,_0x2a85e6){var _0x433827={},_0x2ed167={},_0xc33d23={'count':0x0,'rows':[]};var _0x196bbf=_['map'](db[_0x6613('0x27')][_0x6613('0x28')],function(_0x4a4822){return{'name':_0x4a4822[_0x6613('0x29')],'type':_0x4a4822[_0x6613('0x2a')][_0x6613('0x2b')]};});_0x2ed167['model']=_[_0x6613('0x2c')](_0x196bbf,_0x6613('0x25'));_0x2ed167[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x20e4f0[_0x6613('0x2d')]);_0x2ed167[_0x6613('0x2f')]=_[_0x6613('0x30')](_0x2ed167[_0x6613('0x31')],_0x2ed167[_0x6613('0x2d')]);_0x433827[_0x6613('0x32')]=_['intersection'](_0x2ed167[_0x6613('0x31')],qs[_0x6613('0x33')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x33')]));_0x433827[_0x6613('0x32')]=_0x433827[_0x6613('0x32')][_0x6613('0x34')]?_0x433827[_0x6613('0x32')]:_0x2ed167[_0x6613('0x31')];if(!_0x20e4f0[_0x6613('0x2d')][_0x6613('0x35')]('nolimit')){_0x433827['limit']=qs[_0x6613('0x1b')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x1b')]);_0x433827[_0x6613('0x19')]=qs['offset'](_0x20e4f0[_0x6613('0x2d')]['offset']);}_0x433827[_0x6613('0x36')]=qs[_0x6613('0x37')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x37')]);_0x433827[_0x6613('0x38')]=qs[_0x6613('0x2f')](_[_0x6613('0x39')](_0x20e4f0[_0x6613('0x2d')],_0x2ed167['filters']),_0x196bbf);if(_0x20e4f0[_0x6613('0x2d')][_0x6613('0x3a')]){_0x433827[_0x6613('0x38')]=_[_0x6613('0x3b')](_0x433827[_0x6613('0x38')],{'$or':_[_0x6613('0x2c')](_0x196bbf,function(_0x56519a){if(_0x56519a['type']!=='VIRTUAL'){var _0x2512f7={};_0x2512f7[_0x56519a[_0x6613('0x25')]]={'$like':'%'+_0x20e4f0['query'][_0x6613('0x3a')]+'%'};return _0x2512f7;}})});}_0x433827=_[_0x6613('0x3b')]({},_0x433827,_0x20e4f0[_0x6613('0x3c')]);var _0x30061a={'where':_0x433827['where']};return db[_0x6613('0x27')][_0x6613('0x3d')](_0x30061a)['then'](function(_0x34f61c){_0xc33d23[_0x6613('0x3d')]=_0x34f61c;if(_0x20e4f0[_0x6613('0x2d')]['includeAll']){_0x433827[_0x6613('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6613('0x3f')](_0x433827);})[_0x6613('0x21')](function(_0x2466cd){_0xc33d23['rows']=_0x2466cd;return _0xc33d23;})[_0x6613('0x21')](respondWithFilteredResult(_0x2a85e6,_0x433827))[_0x6613('0x40')](handleError(_0x2a85e6,null));};exports[_0x6613('0x41')]=function(_0x53db74,_0x1c0828){var _0xd421b8={'raw':!![],'where':{'id':_0x53db74[_0x6613('0x42')]['id']}},_0x4d142c={};_0x4d142c['model']=_[_0x6613('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x4d142c['query']=_[_0x6613('0x2e')](_0x53db74[_0x6613('0x2d')]);_0x4d142c['filters']=_[_0x6613('0x30')](_0x4d142c[_0x6613('0x31')],_0x4d142c[_0x6613('0x2d')]);_0xd421b8['attributes']=_[_0x6613('0x30')](_0x4d142c['model'],qs[_0x6613('0x33')](_0x53db74[_0x6613('0x2d')]['fields']));_0xd421b8[_0x6613('0x32')]=_0xd421b8[_0x6613('0x32')][_0x6613('0x34')]?_0xd421b8['attributes']:_0x4d142c[_0x6613('0x31')];if(_0x53db74[_0x6613('0x2d')][_0x6613('0x43')]){_0xd421b8['include']=[{'all':!![]}];}_0xd421b8=_[_0x6613('0x3b')]({},_0xd421b8,_0x53db74['options']);return db[_0x6613('0x27')][_0x6613('0x44')](_0xd421b8)[_0x6613('0x21')](handleEntityNotFound(_0x1c0828,null))['then'](respondWithResult(_0x1c0828,null))[_0x6613('0x40')](handleError(_0x1c0828,null));};exports[_0x6613('0x45')]=function(_0x14f3b8,_0x58d500){return db[_0x6613('0x27')]['create'](_0x14f3b8[_0x6613('0x46')],{})['then'](respondWithResult(_0x58d500,0xc9))[_0x6613('0x40')](handleError(_0x58d500,null));};exports[_0x6613('0x47')]=function(_0x5860e0,_0x5af460){if(_0x5860e0[_0x6613('0x46')]['id']){delete _0x5860e0[_0x6613('0x46')]['id'];}return db[_0x6613('0x27')][_0x6613('0x44')]({'where':{'id':_0x5860e0['params']['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x5af460,null))[_0x6613('0x21')](saveUpdates(_0x5860e0['body'],null))[_0x6613('0x21')](respondWithResult(_0x5af460,null))[_0x6613('0x40')](handleError(_0x5af460,null));};exports['destroy']=function(_0x595cd6,_0x4fd625){return db[_0x6613('0x27')][_0x6613('0x44')]({'where':{'id':_0x595cd6['params']['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x4fd625,null))[_0x6613('0x21')](removeEntity(_0x4fd625,null))['catch'](handleError(_0x4fd625,null));};exports[_0x6613('0x48')]=function(_0x2f13c4,_0x23855d){return db[_0x6613('0x27')]['describe']()['then'](respondWithResult(_0x23855d,null))[_0x6613('0x40')](handleError(_0x23855d,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 5b50921..1e0edb0 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf83f=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0xf83f,0x1b0));var _0xff83=function(_0x471562,_0x2818be){_0x471562=_0x471562-0x0;var _0x6d3b98=_0xf83f[_0x471562];return _0x6d3b98;};'use strict';var _=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var logger=require(_0xff83('0x2'))('api');var moment=require(_0xff83('0x3'));var BPromise=require(_0xff83('0x4'));var rp=require(_0xff83('0x5'));var fs=require('fs');var path=require(_0xff83('0x6'));var rimraf=require(_0xff83('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xff83('0x8')]=function(_0x35b14c,_0x2f3874){return _0x35b14c[_0xff83('0x9')](_0xff83('0xa'),attributes,{'tableName':_0xff83('0xb'),'paranoid':![],'indexes':[{'name':_0xff83('0xc'),'fields':[_0xff83('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf40b=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x13bb95,_0x5e079f){var _0x58a3f1=function(_0x3fe115){while(--_0x3fe115){_0x13bb95['push'](_0x13bb95['shift']());}};_0x58a3f1(++_0x5e079f);}(_0xf40b,0x7f));var _0xbf40=function(_0xc4a608,_0x45fecd){_0xc4a608=_0xc4a608-0x0;var _0x5e2730=_0xf40b[_0xc4a608];return _0x5e2730;};'use strict';var _=require(_0xbf40('0x0'));var util=require('util');var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require(_0xbf40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module[_0xbf40('0x9')]=function(_0x56b19e,_0x13707e){return _0x56b19e[_0xbf40('0xa')](_0xbf40('0xb'),attributes,{'tableName':_0xbf40('0xc'),'paranoid':![],'indexes':[{'name':_0xbf40('0xd'),'fields':[_0xbf40('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 471b944..5dae12d 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c1=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3b9d37,_0xfcd761){var _0x50fd97=function(_0x2873b0){while(--_0x2873b0){_0x3b9d37['push'](_0x3b9d37['shift']());}};_0x50fd97(++_0xfcd761);}(_0xe6c1,0x1a4));var _0x1e6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe6c1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1e6c('0x0'));var util=require(_0x1e6c('0x1'));var moment=require('moment');var BPromise=require(_0x1e6c('0x2'));var rs=require(_0x1e6c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6c('0x4'))['db'];var utils=require(_0x1e6c('0x5'));var logger=require('../../config/logger')(_0x1e6c('0x6'));var config=require(_0x1e6c('0x7'));var jayson=require(_0x1e6c('0x8'));var client=jayson['client'][_0x1e6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c9ba2,_0x36e958,_0x23b942){return new BPromise(function(_0x1b0212,_0x20c350){return client['request'](_0x2c9ba2,_0x23b942)[_0x1e6c('0xa')](function(_0x3a1a79){logger[_0x1e6c('0xb')](_0x1e6c('0xc'),_0x36e958,_0x1e6c('0xd'));logger['debug'](_0x1e6c('0xe'),_0x36e958,_0x1e6c('0xd'),JSON[_0x1e6c('0xf')](_0x3a1a79));if(_0x3a1a79[_0x1e6c('0x10')]){if(_0x3a1a79[_0x1e6c('0x10')][_0x1e6c('0x11')]===0x1f4){logger['error'](_0x1e6c('0xc'),_0x36e958,_0x3a1a79[_0x1e6c('0x10')][_0x1e6c('0x12')]);return _0x20c350(_0x3a1a79[_0x1e6c('0x10')][_0x1e6c('0x12')]);}logger[_0x1e6c('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x36e958,_0x3a1a79['error']['message']);return _0x1b0212(_0x3a1a79[_0x1e6c('0x10')][_0x1e6c('0x12')]);}else{logger[_0x1e6c('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x36e958,_0x1e6c('0xd'));_0x1b0212(_0x3a1a79[_0x1e6c('0x13')][_0x1e6c('0x12')]);}})[_0x1e6c('0x14')](function(_0xda7ed5){logger[_0x1e6c('0x10')](_0x1e6c('0xc'),_0x36e958,_0xda7ed5);_0x20c350(_0xda7ed5);});});} \ No newline at end of file +var _0x976c=['bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x312b25,_0xc2aa){var _0x5818f6=function(_0x1bfc44){while(--_0x1bfc44){_0x312b25['push'](_0x312b25['shift']());}};_0x5818f6(++_0xc2aa);}(_0x976c,0x67));var _0xc976=function(_0x4ddec0,_0x4d6267){_0x4ddec0=_0x4ddec0-0x0;var _0xc20418=_0x976c[_0x4ddec0];return _0xc20418;};'use strict';var _=require(_0xc976('0x0'));var util=require('util');var moment=require(_0xc976('0x1'));var BPromise=require(_0xc976('0x2'));var rs=require(_0xc976('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc976('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc976('0x5'));var jayson=require(_0xc976('0x6'));var client=jayson[_0xc976('0x7')][_0xc976('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f1bf,_0x5efa21,_0x2a19b9){return new BPromise(function(_0x5324ac,_0x471107){return client[_0xc976('0x9')](_0x26f1bf,_0x2a19b9)[_0xc976('0xa')](function(_0xe17884){logger[_0xc976('0xb')](_0xc976('0xc'),_0x5efa21,_0xc976('0xd'));logger[_0xc976('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5efa21,'request\x20sent',JSON[_0xc976('0xf')](_0xe17884));if(_0xe17884[_0xc976('0x10')]){if(_0xe17884[_0xc976('0x10')][_0xc976('0x11')]===0x1f4){logger['error'](_0xc976('0xc'),_0x5efa21,_0xe17884['error']['message']);return _0x471107(_0xe17884[_0xc976('0x10')][_0xc976('0x12')]);}logger[_0xc976('0x10')](_0xc976('0xc'),_0x5efa21,_0xe17884[_0xc976('0x10')]['message']);return _0x5324ac(_0xe17884['error']['message']);}else{logger[_0xc976('0xb')](_0xc976('0xc'),_0x5efa21,_0xc976('0xd'));_0x5324ac(_0xe17884[_0xc976('0x13')]['message']);}})[_0xc976('0x14')](function(_0x5e09c8){logger[_0xc976('0x10')](_0xc976('0xc'),_0x5efa21,_0x5e09c8);_0x471107(_0x5e09c8);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 18a4cb1..f9cc0a7 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc282=['put','/:id','update','delete','destroy','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','show','post','create'];(function(_0x4f297e,_0x5b1e53){var _0x5deafe=function(_0x2092e1){while(--_0x2092e1){_0x4f297e['push'](_0x4f297e['shift']());}};_0x5deafe(++_0x5b1e53);}(_0xc282,0x8a));var _0x2c28=function(_0x55e53d,_0xd6c766){_0x55e53d=_0x55e53d-0x0;var _0x5af639=_0xc282[_0x55e53d];return _0x5af639;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2c28('0x0'));var express=require(_0x2c28('0x1'));var router=express[_0x2c28('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2c28('0x3'));var interaction=require(_0x2c28('0x4'));var config=require(_0x2c28('0x5'));var controller=require(_0x2c28('0x6'));router[_0x2c28('0x7')]('/',auth['isAuthenticated'](),controller[_0x2c28('0x8')]);router['get']('/describe',auth[_0x2c28('0x9')](),controller[_0x2c28('0xa')]);router[_0x2c28('0x7')]('/:id',auth[_0x2c28('0x9')](),controller[_0x2c28('0xb')]);router[_0x2c28('0xc')]('/',auth[_0x2c28('0x9')](),controller[_0x2c28('0xd')]);router[_0x2c28('0xe')](_0x2c28('0xf'),auth['isAuthenticated'](),controller[_0x2c28('0x10')]);router[_0x2c28('0x11')](_0x2c28('0xf'),auth['isAuthenticated'](),controller[_0x2c28('0x12')]);module['exports']=router; \ No newline at end of file +var _0x86b2=['describe','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x1fc55d,_0x37e2f5){var _0x1652d4=function(_0x268ee0){while(--_0x268ee0){_0x1fc55d['push'](_0x1fc55d['shift']());}};_0x1652d4(++_0x37e2f5);}(_0x86b2,0xb1));var _0x286b=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x86b2[_0x486f4a];return _0x135d99;};'use strict';var multer=require('multer');var util=require(_0x286b('0x0'));var path=require(_0x286b('0x1'));var timeout=require(_0x286b('0x2'));var express=require(_0x286b('0x3'));var router=express['Router']();var fs_extra=require(_0x286b('0x4'));var auth=require(_0x286b('0x5'));var interaction=require(_0x286b('0x6'));var config=require(_0x286b('0x7'));var controller=require(_0x286b('0x8'));router[_0x286b('0x9')]('/',auth[_0x286b('0xa')](),controller['index']);router[_0x286b('0x9')](_0x286b('0xb'),auth[_0x286b('0xa')](),controller[_0x286b('0xc')]);router[_0x286b('0x9')](_0x286b('0xd'),auth[_0x286b('0xa')](),controller[_0x286b('0xe')]);router[_0x286b('0xf')]('/',auth[_0x286b('0xa')](),controller[_0x286b('0x10')]);router['put'](_0x286b('0xd'),auth[_0x286b('0xa')](),controller[_0x286b('0x11')]);router[_0x286b('0x12')]('/:id',auth[_0x286b('0xa')](),controller[_0x286b('0x13')]);module[_0x286b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index d42d447..7e115cb 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17ba=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','onlineForm','parse','getDataValue','setDataValue','textarea','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x1c6865,_0x56ba7a){var _0x4a6290=function(_0x2806ac){while(--_0x2806ac){_0x1c6865['push'](_0x1c6865['shift']());}};_0x4a6290(++_0x56ba7a);}(_0x17ba,0xab));var _0xa17b=function(_0x332644,_0x33ff4){_0x332644=_0x332644-0x0;var _0x4eeb34=_0x17ba[_0x332644];return _0x4eeb34;};'use strict';var Sequelize=require(_0xa17b('0x0'));var rs=require(_0xa17b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'unique':_0xa17b('0x3')},'description':{'type':Sequelize[_0xa17b('0x2')]},'mapKey':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'key':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x5')},'customerAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa17b('0x2')]},'animation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0xb'),_0xa17b('0xc')),'defaultValue':_0xa17b('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xd')},'start_chat_button':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'header_offline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x10')},'download_transcript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa17b('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'skipMessageButton':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'conditionAgreement':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x16')},'ratingType':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0x17'),'thumb'),'defaultValue':_0xa17b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':function(){return JSON[_0xa17b('0x18')]({'items':[{'type':_0xa17b('0x19'),'variable':null,'config':{'placeholder':_0xa17b('0x1a'),'type':'text','required':!![]},'props':{'title':_0xa17b('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xa17b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa17b('0x1b'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x1b'))):{};},'set':function(_0x3c32a5){return this[_0xa17b('0x1e')]('onlineForm',JSON['stringify'](_0x3c32a5));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa17b('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null},{'type':_0xa17b('0x1f'),'config':{'placeholder':_0xa17b('0x20')},'props':{'title':_0xa17b('0x20'),'helpText':_0xa17b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xa17b('0x1d')](_0xa17b('0x22'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x22'))):{};},'set':function(_0x2dc1f2){return this[_0xa17b('0x1e')]('offlineForm',JSON['stringify'](_0x2dc1f2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa17b('0x23')]();}},'autoclose':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa17b('0x2')]},'forwardOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa17b('0x2')]},'waitingTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x24')},'offlineMessageBody':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa17b('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa17b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa17b('0x26');}},'notificationSound':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x27')},'verticalAlignment':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa17b('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x28')},'systemAvatar':{'type':Sequelize[_0xa17b('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa17b('0x8')],'comment':_0xa17b('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x468c92){if(!_0x468c92)this[_0xa17b('0x1e')]('mandatoryDispositionPauseId',null);this[_0xa17b('0x1e')](_0xa17b('0x2a'),_0x468c92);}},'vidaooEscalation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa17b('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xa17b('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x22fb=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','stringify','input','name','text','getDataValue','parse','setDataValue','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address'];(function(_0x50b0bb,_0x4afe99){var _0x2002be=function(_0x59d745){while(--_0x59d745){_0x50b0bb['push'](_0x50b0bb['shift']());}};_0x2002be(++_0x4afe99);}(_0x22fb,0x192));var _0xb22f=function(_0x44690f,_0x1306b8){_0x44690f=_0x44690f-0x0;var _0x13d2a7=_0x22fb[_0x44690f];return _0x13d2a7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb22f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'unique':_0xb22f('0x2')},'description':{'type':Sequelize[_0xb22f('0x1')]},'mapKey':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x3')},'key':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x4')},'customerAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb22f('0x1')]},'animation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xc')},'header_offline':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xd')},'download_transcript':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xf')},'noteTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x10')},'closingMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'skipMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x12')},'ratingType':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0x13'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'variable':null,'config':{'placeholder':_0xb22f('0x17'),'type':_0xb22f('0x18'),'required':!![]},'props':{'title':_0xb22f('0x17'),'helpText':''}},{'type':_0xb22f('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb22f('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb22f('0x19')]('onlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')]('onlineForm')):{};},'set':function(_0x4687f2){return this[_0xb22f('0x1b')]('onlineForm',JSON[_0xb22f('0x15')](_0x4687f2));}},'offlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'props':{'title':_0xb22f('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb22f('0x3'),'type':_0xb22f('0x3')},'variable':null},{'type':_0xb22f('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb22f('0x19')]('offlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')](_0xb22f('0x1d'))):{};},'set':function(_0x413575){return this[_0xb22f('0x1b')]('offlineForm',JSON['stringify'](_0x413575));}},'token':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return rs[_0xb22f('0x1e')]();}},'autoclose':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb22f('0x1')]},'forwardOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x1f')},'waitingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x22')},'skipUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'sendUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return _0xb22f('0x23');}},'notificationSound':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb22f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x25')},'verticalAlignment':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xb22f('0x1')]},'customerAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb22f('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22f('0x7')],'comment':_0xb22f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb22f('0x29'),'set':function(_0x2d265c){if(!_0x2d265c)this[_0xb22f('0x1b')]('mandatoryDispositionPauseId',null);this[_0xb22f('0x1b')](_0xb22f('0x2a'),_0x2d265c);}},'vidaooEscalation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb22f('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x2b')},'vidaooNote':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return _0xb22f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4313466..0985ff2 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7254=['contact','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','ListId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccount','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','push','server/files/chat/iframe.ejs','URL','origin','3.1.0','x-real-ip','connection','remoteAddress','replace','alignment','backgroundColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','end','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','name','rows','show','params','includeAll','include','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','findOne','keys','Disposition','pick','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','isNil','server/files/images/logos/','existsSync','agentAvatar','download','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','notify','user-agent-parser','setUA','headers','chat','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','applications','Applications','orderBy','priority','account'];(function(_0x143f3c,_0x719fc0){var _0x16b449=function(_0x5af8f7){while(--_0x5af8f7){_0x143f3c['push'](_0x143f3c['shift']());}};_0x16b449(++_0x719fc0);}(_0x7254,0x1c2));var _0x4725=function(_0x3753b9,_0xf5eff5){_0x3753b9=_0x3753b9-0x0;var _0x18cdf1=_0x7254[_0x3753b9];return _0x18cdf1;};'use strict';var BPromise=require(_0x4725('0x0'));var Mustache=require(_0x4725('0x1'));var util=require(_0x4725('0x2'));var path=require(_0x4725('0x3'));var ejs=require(_0x4725('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4725('0x5'));var querystring=require(_0x4725('0x6'));var Redis=require(_0x4725('0x7'));var qs=require(_0x4725('0x8'));var logger=require('../../config/logger')(_0x4725('0x9'));var config=require(_0x4725('0xa'));var url=require('url');var db=require(_0x4725('0xb'))['db'];config[_0x4725('0xc')]=_[_0x4725('0xd')](config[_0x4725('0xc')],{'host':_0x4725('0xe'),'port':0x18eb});var socket=require(_0x4725('0xf'))(new Redis(config['redis']));require(_0x4725('0x10'))['register'](socket);var htmlToText=require(_0x4725('0x11'));var jayson=require(_0x4725('0x12'));var client=jayson[_0x4725('0x13')][_0x4725('0x14')]({'port':0x232c});var client9002=jayson[_0x4725('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x4725('0x13')][_0x4725('0x14')]({'port':0x232b});var client9001=jayson['client'][_0x4725('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x1c43eb,_0x36a4d7,_0x84c436,_0x28a798){return new BPromise(function(_0x3ca092,_0x5d5566){var _0x322712=_0x28a798||client;return _0x322712[_0x4725('0x15')](_0x1c43eb,_0x84c436)[_0x4725('0x16')](function(_0x1dd828){logger['info'](_0x4725('0x17'),_0x36a4d7,_0x4725('0x18'));logger[_0x4725('0x19')](_0x4725('0x1a'),_0x36a4d7,_0x4725('0x18'),JSON['stringify'](_0x1dd828));if(_0x1dd828[_0x4725('0x1b')]){if(_0x1dd828[_0x4725('0x1b')][_0x4725('0x1c')]===0x1f4){logger[_0x4725('0x1b')](_0x4725('0x17'),_0x36a4d7,_0x1dd828[_0x4725('0x1b')][_0x4725('0x1d')]);return _0x5d5566(_0x1dd828['error'][_0x4725('0x1d')]);}logger[_0x4725('0x1b')](_0x4725('0x17'),_0x36a4d7,_0x1dd828['error'][_0x4725('0x1d')]);return _0x3ca092(_0x1dd828['error'][_0x4725('0x1d')]);}else{logger[_0x4725('0x1e')](_0x4725('0x17'),_0x36a4d7,'request\x20sent');_0x3ca092(_0x1dd828['result'][_0x4725('0x1d')]);}})[_0x4725('0x1f')](function(_0x383a22){logger['error'](_0x4725('0x17'),_0x36a4d7,_0x383a22);_0x5d5566(_0x383a22);});});}function respondWithStatusCode(_0x940cd6,_0xc39cb4){_0xc39cb4=_0xc39cb4||0xcc;return function(_0x217276){if(_0x217276){return _0x940cd6[_0x4725('0x20')](_0xc39cb4);}return _0x940cd6[_0x4725('0x21')](_0xc39cb4)['end']();};}function respondWithResult(_0x356e5c,_0x9459){_0x9459=_0x9459||0xc8;return function(_0x4cf357){if(_0x4cf357){return _0x356e5c['status'](_0x9459)[_0x4725('0x22')](_0x4cf357);}};}function respondWithFilteredResult(_0x1c920d,_0x39af79){return function(_0x734a8a){if(_0x734a8a){var _0x173e49=typeof _0x39af79[_0x4725('0x23')]===_0x4725('0x24')&&typeof _0x39af79[_0x4725('0x25')]===_0x4725('0x24');var _0x41672b=_0x734a8a[_0x4725('0x26')];var _0x3ceaee=_0x173e49?0x0:_0x39af79[_0x4725('0x23')];var _0x21a492=_0x173e49?_0x734a8a[_0x4725('0x26')]:_0x39af79[_0x4725('0x23')]+_0x39af79[_0x4725('0x25')];var _0x430a44;if(_0x21a492>=_0x41672b){_0x21a492=_0x41672b;_0x430a44=0xc8;}else{_0x430a44=0xce;}_0x1c920d[_0x4725('0x21')](_0x430a44);return _0x1c920d[_0x4725('0x27')](_0x4725('0x28'),_0x3ceaee+'-'+_0x21a492+'/'+_0x41672b)['json'](_0x734a8a);}return null;};}function saveUpdates(_0x491d6d){return function(_0x2db1f7){if(_0x2db1f7){return _0x2db1f7[_0x4725('0x29')](_0x491d6d)[_0x4725('0x16')](function(_0x362b30){return _0x362b30;});}return null;};}function removeEntity(_0x130d25){return function(_0x52bd97){if(_0x52bd97){return _0x52bd97[_0x4725('0x2a')]()[_0x4725('0x16')](function(){var _0x5a69c6=_0x52bd97[_0x4725('0x2b')]({'plain':!![]});var _0x36c6be=_0x4725('0x2c');return db['UserProfileResource'][_0x4725('0x2a')]({'where':{'type':_0x36c6be,'resourceId':_0x5a69c6['id']}})[_0x4725('0x16')](function(){return _0x52bd97;});})['then'](function(){_0x130d25['status'](0xcc)[_0x4725('0x2d')]();});}};}function handleEntityNotFound(_0x1ae19c){return function(_0x35779b){if(!_0x35779b){_0x1ae19c[_0x4725('0x20')](0x194);}return _0x35779b;};}function handleError(_0x44236a,_0x1ac9be){_0x1ac9be=_0x1ac9be||0x1f4;return function(_0x4fb76a){logger['error'](_0x4fb76a['stack']);if(_0x4fb76a['name']){delete _0x4fb76a['name'];}_0x44236a[_0x4725('0x21')](_0x1ac9be)[_0x4725('0x2e')](_0x4fb76a);};}exports[_0x4725('0x2f')]=function(_0x53607a,_0x5879d5){var _0x40d83f={'include':[{'model':db[_0x4725('0x30')],'as':_0x4725('0x31')}]},_0xf71a2f={},_0xf250c1={'count':0x0,'rows':[]};var _0x55094f=_['map'](db[_0x4725('0x32')][_0x4725('0x33')],function(_0x2e54f9){return{'name':_0x2e54f9[_0x4725('0x34')],'type':_0x2e54f9['type'][_0x4725('0x35')]};});_0xf71a2f[_0x4725('0x36')]=_[_0x4725('0x37')](_0x55094f,'name');_0xf71a2f[_0x4725('0x38')]=_['keys'](_0x53607a[_0x4725('0x38')]);_0xf71a2f['filters']=_[_0x4725('0x39')](_0xf71a2f['model'],_0xf71a2f[_0x4725('0x38')]);_0x40d83f[_0x4725('0x3a')]=_['intersection'](_0xf71a2f['model'],qs[_0x4725('0x3b')](_0x53607a[_0x4725('0x38')]['fields']));_0x40d83f[_0x4725('0x3a')]=_0x40d83f[_0x4725('0x3a')][_0x4725('0x3c')]?_0x40d83f['attributes']:_0xf71a2f['model'];if(!_0x53607a['query'][_0x4725('0x3d')](_0x4725('0x3e'))){_0x40d83f[_0x4725('0x25')]=qs[_0x4725('0x25')](_0x53607a[_0x4725('0x38')][_0x4725('0x25')]);_0x40d83f[_0x4725('0x23')]=qs[_0x4725('0x23')](_0x53607a[_0x4725('0x38')][_0x4725('0x23')]);}_0x40d83f[_0x4725('0x3f')]=qs[_0x4725('0x40')](_0x53607a['query'][_0x4725('0x40')]);_0x40d83f[_0x4725('0x41')]=qs[_0x4725('0x42')](_['pick'](_0x53607a[_0x4725('0x38')],_0xf71a2f[_0x4725('0x42')]),_0x55094f);if(_0x53607a[_0x4725('0x38')][_0x4725('0x43')]){_0x40d83f['where']=_[_0x4725('0x44')](_0x40d83f[_0x4725('0x41')],{'$or':_['map'](_0x55094f,function(_0x3ca57c){if(_0x3ca57c[_0x4725('0x45')]!==_0x4725('0x46')){var _0x1a858a={};_0x1a858a[_0x3ca57c[_0x4725('0x47')]]={'$like':'%'+_0x53607a[_0x4725('0x38')]['filter']+'%'};return _0x1a858a;}})});}_0x40d83f=_['merge']({},_0x40d83f,_0x53607a['options']);var _0x2e2ba8={'where':_0x40d83f[_0x4725('0x41')]};return db[_0x4725('0x32')][_0x4725('0x26')](_0x2e2ba8)['then'](function(_0x3829a0){_0xf250c1[_0x4725('0x26')]=_0x3829a0;if(_0x53607a[_0x4725('0x38')]['includeAll']){_0x40d83f['include']=[{'all':!![]}];}return db[_0x4725('0x32')]['findAll'](_0x40d83f);})[_0x4725('0x16')](function(_0x246a2a){_0xf250c1[_0x4725('0x48')]=_0x246a2a;return _0xf250c1;})['then'](respondWithFilteredResult(_0x5879d5,_0x40d83f))['catch'](handleError(_0x5879d5,null));};exports[_0x4725('0x49')]=function(_0x325e3d,_0x55cf4d){var _0x14f4f3={'raw':![],'where':{'id':_0x325e3d[_0x4725('0x4a')]['id']},'include':[{'model':db[_0x4725('0x30')],'as':_0x4725('0x31')}]},_0x46208c={};_0x46208c['model']=_['keys'](db[_0x4725('0x32')][_0x4725('0x33')]);_0x46208c[_0x4725('0x38')]=_['keys'](_0x325e3d[_0x4725('0x38')]);_0x46208c[_0x4725('0x42')]=_['intersection'](_0x46208c[_0x4725('0x36')],_0x46208c[_0x4725('0x38')]);_0x14f4f3[_0x4725('0x3a')]=_[_0x4725('0x39')](_0x46208c['model'],qs[_0x4725('0x3b')](_0x325e3d[_0x4725('0x38')][_0x4725('0x3b')]));_0x14f4f3['attributes']=_0x14f4f3[_0x4725('0x3a')][_0x4725('0x3c')]?_0x14f4f3[_0x4725('0x3a')]:_0x46208c[_0x4725('0x36')];if(_0x325e3d['query'][_0x4725('0x4b')]){_0x14f4f3[_0x4725('0x4c')]=[{'all':!![]}];}_0x14f4f3=_[_0x4725('0x44')]({},_0x14f4f3,_0x325e3d[_0x4725('0x4d')]);return db[_0x4725('0x32')]['find'](_0x14f4f3)[_0x4725('0x16')](handleEntityNotFound(_0x55cf4d,null))['then'](respondWithResult(_0x55cf4d,null))['catch'](handleError(_0x55cf4d,null));};exports['create']=function(_0x33ea79,_0x17c3ab){return db[_0x4725('0x32')]['create'](_0x33ea79['body'],{})[_0x4725('0x16')](function(_0x1461af){var _0x2a27ff=_0x33ea79[_0x4725('0x4e')]['get']({'plain':!![]});if(!_0x2a27ff)throw new Error(_0x4725('0x4f'));if(_0x2a27ff['role']===_0x4725('0x4e')){var _0x4fdcf6=_0x1461af[_0x4725('0x2b')]({'plain':!![]});var _0x304789=_0x4725('0x2c');return db[_0x4725('0x50')][_0x4725('0x51')]({'where':{'name':_0x304789,'userProfileId':_0x2a27ff[_0x4725('0x52')]},'raw':!![]})[_0x4725('0x16')](function(_0xfb8656){if(_0xfb8656&&_0xfb8656['autoAssociation']===0x0){return db[_0x4725('0x53')][_0x4725('0x54')]({'name':_0x4fdcf6[_0x4725('0x47')],'resourceId':_0x4fdcf6['id'],'type':_0xfb8656['name'],'sectionId':_0xfb8656['id']},{})['then'](function(){return _0x1461af;});}else{return _0x1461af;}})[_0x4725('0x1f')](function(_0x3a7d57){logger[_0x4725('0x1b')](_0x4725('0x55'),_0x3a7d57);throw _0x3a7d57;});}return _0x1461af;})['then'](respondWithResult(_0x17c3ab,0xc9))['catch'](handleError(_0x17c3ab,null));};exports[_0x4725('0x29')]=function(_0x299e66,_0x1a625c){if(_0x299e66[_0x4725('0x56')]['id']){delete _0x299e66[_0x4725('0x56')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x299e66[_0x4725('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x4725('0x31')}]})[_0x4725('0x16')](handleEntityNotFound(_0x1a625c,null))[_0x4725('0x16')](saveUpdates(_0x299e66['body'],null))[_0x4725('0x16')](respondWithResult(_0x1a625c,null))[_0x4725('0x1f')](handleError(_0x1a625c,null));};exports[_0x4725('0x2a')]=function(_0x48d980,_0x10f0b6){return db[_0x4725('0x32')][_0x4725('0x51')]({'where':{'id':_0x48d980[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x10f0b6,null))[_0x4725('0x16')](removeEntity(_0x10f0b6,null))[_0x4725('0x1f')](handleError(_0x10f0b6,null));};exports[_0x4725('0x57')]=function(_0x508f0f,_0x342051){return db[_0x4725('0x32')][_0x4725('0x57')]()['then'](respondWithResult(_0x342051,null))['catch'](handleError(_0x342051,null));};exports[_0x4725('0x58')]=function(_0x397416,_0x5ee5ad){if(_0x397416[_0x4725('0x56')]['id']){delete _0x397416[_0x4725('0x56')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x397416['params']['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x5ee5ad,null))['then'](function(_0x5dbc5d){if(_0x5dbc5d){_0x397416['body'][_0x4725('0x59')]=_0x5dbc5d['id'];return db['Disposition'][_0x4725('0x54')](_0x397416[_0x4725('0x56')]);}})[_0x4725('0x16')](respondWithResult(_0x5ee5ad,null))[_0x4725('0x1f')](handleError(_0x5ee5ad,null));};exports['getDispositions']=function(_0x2c6e9e,_0x2a7f6a){var _0x8b739d={'raw':![],'where':{}};var _0x3b8e0f={};var _0x5533d7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4725('0x5a')]({'where':{'id':_0x2c6e9e[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x2a7f6a,null))[_0x4725('0x16')](function(_0x55e36b){if(_0x55e36b){_0x3b8e0f[_0x4725('0x36')]=_[_0x4725('0x5b')](db[_0x4725('0x5c')][_0x4725('0x33')]);_0x3b8e0f[_0x4725('0x38')]=_[_0x4725('0x5b')](_0x2c6e9e[_0x4725('0x38')]);_0x3b8e0f['filters']=_[_0x4725('0x39')](_0x3b8e0f[_0x4725('0x36')],_0x3b8e0f[_0x4725('0x38')]);_0x8b739d[_0x4725('0x3a')]=_['intersection'](_0x3b8e0f['model'],qs['fields'](_0x2c6e9e[_0x4725('0x38')]['fields']));_0x8b739d[_0x4725('0x3a')]=_0x8b739d[_0x4725('0x3a')][_0x4725('0x3c')]?_0x8b739d[_0x4725('0x3a')]:_0x3b8e0f[_0x4725('0x36')];if(!_0x2c6e9e[_0x4725('0x38')][_0x4725('0x3d')]('nolimit')){_0x8b739d[_0x4725('0x25')]=qs['limit'](_0x2c6e9e[_0x4725('0x38')][_0x4725('0x25')]);_0x8b739d['offset']=qs[_0x4725('0x23')](_0x2c6e9e[_0x4725('0x38')][_0x4725('0x23')]);}_0x8b739d[_0x4725('0x3f')]=qs[_0x4725('0x40')](_0x2c6e9e[_0x4725('0x38')]['sort']);_0x8b739d['where']=qs[_0x4725('0x42')](_[_0x4725('0x5d')](_0x2c6e9e[_0x4725('0x38')],_0x3b8e0f[_0x4725('0x42')]));_0x8b739d[_0x4725('0x41')][_0x4725('0x59')]=_0x55e36b['id'];if(_0x2c6e9e[_0x4725('0x38')][_0x4725('0x43')]){_0x8b739d[_0x4725('0x41')]=_[_0x4725('0x44')](_0x8b739d[_0x4725('0x41')],{'$or':_['map'](_0x8b739d[_0x4725('0x3a')],function(_0x475d11){var _0xdbf213={};_0xdbf213[_0x475d11]={'$like':'%'+_0x2c6e9e[_0x4725('0x38')][_0x4725('0x43')]+'%'};return _0xdbf213;})});}_0x8b739d=_['merge']({},_0x8b739d,_0x2c6e9e['options']);return db[_0x4725('0x5c')][_0x4725('0x26')]({'where':_0x8b739d[_0x4725('0x41')]})[_0x4725('0x16')](function(_0x15a13d){_0x5533d7[_0x4725('0x26')]=_0x15a13d;if(_0x2c6e9e['query'][_0x4725('0x4b')]){_0x8b739d[_0x4725('0x4c')]=[{'all':!![]}];}return db[_0x4725('0x5c')][_0x4725('0x5e')](_0x8b739d);})['then'](function(_0x5c7a80){_0x5533d7['rows']=_0x5c7a80;return _0x5533d7;});}})[_0x4725('0x16')](respondWithFilteredResult(_0x2a7f6a,_0x8b739d))[_0x4725('0x1f')](handleError(_0x2a7f6a,null));};exports[_0x4725('0x5f')]=function(_0x5cf0f0,_0x2ff059){return db['ChatWebsite'][_0x4725('0x51')]({'where':{'id':_0x5cf0f0[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x2ff059,null))['then'](function(_0xeda86e){if(_0xeda86e){return _0xeda86e[_0x4725('0x5f')](_0x5cf0f0[_0x4725('0x38')][_0x4725('0x60')]);}})[_0x4725('0x16')](respondWithStatusCode(_0x2ff059,null))[_0x4725('0x1f')](handleError(_0x2ff059,null));};exports['addAnswer']=function(_0x1ca652,_0x3a62a7){if(_0x1ca652[_0x4725('0x56')]['id']){delete _0x1ca652[_0x4725('0x56')]['id'];}return db[_0x4725('0x32')][_0x4725('0x51')]({'where':{'id':_0x1ca652['params']['id']}})['then'](handleEntityNotFound(_0x3a62a7,null))[_0x4725('0x16')](function(_0x395e10){if(_0x395e10){_0x1ca652[_0x4725('0x56')]['ChatWebsiteId']=_0x395e10['id'];return db[_0x4725('0x61')][_0x4725('0x54')](_0x1ca652[_0x4725('0x56')]);}})[_0x4725('0x16')](respondWithResult(_0x3a62a7,null))['catch'](handleError(_0x3a62a7,null));};exports[_0x4725('0x62')]=function(_0x179d9a,_0x5221f4){var _0x511bc9={'raw':![],'where':{}};var _0x25c10c={};var _0x5c662e={'count':0x0,'rows':[]};return db[_0x4725('0x32')][_0x4725('0x5a')]({'where':{'id':_0x179d9a['params']['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x5221f4,null))['then'](function(_0xb0f567){if(_0xb0f567){_0x25c10c[_0x4725('0x36')]=_[_0x4725('0x5b')](db[_0x4725('0x61')][_0x4725('0x33')]);_0x25c10c[_0x4725('0x38')]=_[_0x4725('0x5b')](_0x179d9a[_0x4725('0x38')]);_0x25c10c[_0x4725('0x42')]=_['intersection'](_0x25c10c[_0x4725('0x36')],_0x25c10c[_0x4725('0x38')]);_0x511bc9[_0x4725('0x3a')]=_['intersection'](_0x25c10c[_0x4725('0x36')],qs[_0x4725('0x3b')](_0x179d9a[_0x4725('0x38')][_0x4725('0x3b')]));_0x511bc9[_0x4725('0x3a')]=_0x511bc9[_0x4725('0x3a')][_0x4725('0x3c')]?_0x511bc9[_0x4725('0x3a')]:_0x25c10c[_0x4725('0x36')];if(!_0x179d9a[_0x4725('0x38')][_0x4725('0x3d')](_0x4725('0x3e'))){_0x511bc9['limit']=qs[_0x4725('0x25')](_0x179d9a[_0x4725('0x38')][_0x4725('0x25')]);_0x511bc9[_0x4725('0x23')]=qs['offset'](_0x179d9a[_0x4725('0x38')][_0x4725('0x23')]);}_0x511bc9[_0x4725('0x3f')]=qs[_0x4725('0x40')](_0x179d9a[_0x4725('0x38')][_0x4725('0x40')]);_0x511bc9[_0x4725('0x41')]=qs[_0x4725('0x42')](_[_0x4725('0x5d')](_0x179d9a[_0x4725('0x38')],_0x25c10c[_0x4725('0x42')]));_0x511bc9[_0x4725('0x41')][_0x4725('0x59')]=_0xb0f567['id'];if(_0x179d9a['query'][_0x4725('0x43')]){_0x511bc9[_0x4725('0x41')]=_[_0x4725('0x44')](_0x511bc9[_0x4725('0x41')],{'$or':_[_0x4725('0x37')](_0x511bc9[_0x4725('0x3a')],function(_0x1166d7){var _0x2fad29={};_0x2fad29[_0x1166d7]={'$like':'%'+_0x179d9a[_0x4725('0x38')][_0x4725('0x43')]+'%'};return _0x2fad29;})});}_0x511bc9=_[_0x4725('0x44')]({},_0x511bc9,_0x179d9a[_0x4725('0x4d')]);return db[_0x4725('0x61')][_0x4725('0x26')]({'where':_0x511bc9[_0x4725('0x41')]})['then'](function(_0x3d89a9){_0x5c662e['count']=_0x3d89a9;if(_0x179d9a[_0x4725('0x38')][_0x4725('0x4b')]){_0x511bc9[_0x4725('0x4c')]=[{'all':!![]}];}return db[_0x4725('0x61')]['findAll'](_0x511bc9);})[_0x4725('0x16')](function(_0x484139){_0x5c662e[_0x4725('0x48')]=_0x484139;return _0x5c662e;});}})[_0x4725('0x16')](respondWithFilteredResult(_0x5221f4,_0x511bc9))[_0x4725('0x1f')](handleError(_0x5221f4,null));};exports[_0x4725('0x63')]=function(_0x375e13,_0x32a143){return db['ChatWebsite'][_0x4725('0x51')]({'where':{'id':_0x375e13[_0x4725('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32a143,null))[_0x4725('0x16')](function(_0x475044){if(_0x475044){return _0x475044['removeAnswers'](_0x375e13[_0x4725('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x32a143,null))[_0x4725('0x1f')](handleError(_0x32a143,null));};exports[_0x4725('0x64')]=function(_0xe26fd1,_0x4d6ee1){_0xe26fd1[_0x4725('0x56')][_0x4725('0x65')]=_0xe26fd1[_0x4725('0x66')][_0x4725('0x67')];return db[_0x4725('0x32')][_0x4725('0x51')]({'where':{'id':_0xe26fd1[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x4d6ee1,null))['then'](saveUpdates(_0xe26fd1[_0x4725('0x56')],null))[_0x4725('0x16')](respondWithResult(_0x4d6ee1,null))[_0x4725('0x1f')](handleError(_0x4d6ee1,null));};exports[_0x4725('0x68')]=function(_0x1f661d,_0x2b521e){_0x1f661d[_0x4725('0x56')]['agentAvatar']=_0x1f661d[_0x4725('0x66')][_0x4725('0x67')];return db[_0x4725('0x32')]['find']({'where':{'id':_0x1f661d[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x2b521e,null))[_0x4725('0x16')](saveUpdates(_0x1f661d[_0x4725('0x56')],null))[_0x4725('0x16')](respondWithResult(_0x2b521e,null))['catch'](handleError(_0x2b521e,null));};exports['addCustomerAvatar']=function(_0x413b65,_0x1b77af){_0x413b65[_0x4725('0x56')][_0x4725('0x69')]=_0x413b65['file'][_0x4725('0x67')];return db[_0x4725('0x32')][_0x4725('0x51')]({'where':{'id':_0x413b65['params']['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x1b77af,null))['then'](saveUpdates(_0x413b65['body'],null))[_0x4725('0x16')](respondWithResult(_0x1b77af,null))[_0x4725('0x1f')](handleError(_0x1b77af,null));};exports[_0x4725('0x6a')]=function(_0x73a70d,_0x55a1f8){_0x73a70d[_0x4725('0x56')][_0x4725('0x6b')]=_0x73a70d['file'][_0x4725('0x67')];return db[_0x4725('0x32')][_0x4725('0x51')]({'where':{'id':_0x73a70d[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x55a1f8,null))[_0x4725('0x16')](saveUpdates(_0x73a70d[_0x4725('0x56')],null))['then'](respondWithResult(_0x55a1f8,null))[_0x4725('0x1f')](handleError(_0x55a1f8,null));};exports[_0x4725('0x6c')]=function(_0x4e3436,_0x3fdd45){var _0x31bf35=path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0x6f'));var _0x10d08c={'where':{'id':_0x4e3436[_0x4725('0x4a')]['id']},'attributes':['id',_0x4725('0x65')],'raw':!![]};var _0x5c54bb=![];return require('../../config/license/util')['getLicense']()[_0x4725('0x16')](function(_0x3ce0b7){if(_0x3ce0b7){_0x5c54bb=_0x3ce0b7[_0x4725('0x70')];}})['then'](function(){return db[_0x4725('0x32')][_0x4725('0x51')](_0x10d08c);})[_0x4725('0x16')](handleEntityNotFound(_0x3fdd45,null))[_0x4725('0x16')](function(_0x3170b0){if(_0x3170b0){if(!_[_0x4725('0x71')](_0x3170b0[_0x4725('0x65')])){if(fs['existsSync'](path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0x72'),_0x3170b0[_0x4725('0x65')]))&&_0x5c54bb){_0x31bf35=path[_0x4725('0x6d')](config['root'],_0x4725('0x72'),_0x3170b0[_0x4725('0x65')]);}}return _0x3fdd45['download'](_0x31bf35);}})[_0x4725('0x1f')](handleError(_0x3fdd45,null));};exports['getAvatar']=function(_0x2c280f,_0x5e87b0){var _0x520094=path['join'](config[_0x4725('0x6e')],'server/files/images/avatars/default_avatar.png');var _0x40ebd6={'where':{'id':_0x2c280f[_0x4725('0x4a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x4725('0x32')][_0x4725('0x51')](_0x40ebd6)[_0x4725('0x16')](handleEntityNotFound(_0x5e87b0,null))['then'](function(_0x2fe035){if(_0x2fe035){if(!_[_0x4725('0x71')](_0x2fe035['agentAvatar'])){if(fs[_0x4725('0x73')](path[_0x4725('0x6d')](config[_0x4725('0x6e')],'server/files/images/avatars/',_0x2fe035[_0x4725('0x74')]))){_0x520094=path[_0x4725('0x6d')](config['root'],'server/files/images/avatars/',_0x2fe035['agentAvatar']);}}return _0x5e87b0[_0x4725('0x75')](_0x520094);}})[_0x4725('0x1f')](handleError(_0x5e87b0,null));};exports['getCustomerAvatar']=function(_0x11de55,_0x547d68){var _0x1e0715=path[_0x4725('0x6d')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0xccc3d8={'where':{'id':_0x11de55[_0x4725('0x4a')]['id']},'attributes':['id',_0x4725('0x69'),_0x4725('0x76')],'raw':!![]};return db[_0x4725('0x32')][_0x4725('0x51')](_0xccc3d8)['then'](handleEntityNotFound(_0x547d68,null))[_0x4725('0x16')](function(_0x14c4e7){if(_0x14c4e7){if(!_[_0x4725('0x71')](_0x14c4e7[_0x4725('0x69')])){if(fs[_0x4725('0x73')](path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0x77'),_0x14c4e7[_0x4725('0x69')]))&&_0x14c4e7['showCustomerAvatar']){_0x1e0715=path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0x77'),_0x14c4e7[_0x4725('0x69')]);}}return _0x547d68['download'](_0x1e0715);}})[_0x4725('0x1f')](handleError(_0x547d68,null));};exports[_0x4725('0x78')]=function(_0x117163,_0xaa175a){var _0x43674d=path[_0x4725('0x6d')](config[_0x4725('0x6e')],'server/files/images/avatars/system_avatar.png');var _0x4a5c7e={'where':{'id':_0x117163['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4725('0x32')][_0x4725('0x51')](_0x4a5c7e)[_0x4725('0x16')](handleEntityNotFound(_0xaa175a,null))['then'](function(_0x2f83bf){if(_0x2f83bf){if(!_['isNil'](_0x2f83bf['systemAvatar'])){if(fs[_0x4725('0x73')](path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0x77'),_0x2f83bf[_0x4725('0x6b')]))){_0x43674d=path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0x77'),_0x2f83bf['systemAvatar']);}}return _0xaa175a[_0x4725('0x75')](_0x43674d);}})[_0x4725('0x1f')](handleError(_0xaa175a,null));};exports[_0x4725('0x79')]=function(_0x22c098,_0x1e244e){var _0x449e79=require(_0x4725('0x7a'));var _0x46de53=new _0x449e79();var _0x55bcc3=_0x46de53[_0x4725('0x7b')](_0x22c098[_0x4725('0x7c')]['user-agent'])['getResult']();var _0x2446d7={'body':_0x22c098[_0x4725('0x56')],'channel':_0x4725('0x7d')};var _0x269501=[];var _0x152a95=[];var _0x267c8e={};var _0x39a6ca=![];return db['CmContact'][_0x4725('0x57')]()[_0x4725('0x16')](function(_0x56d6e2){if(!_0x56d6e2){throw new db[(_0x4725('0x7e'))]['ValidationError'](_0x4725('0x7f'));}_0x269501=_['difference'](_[_0x4725('0x5b')](_0x56d6e2),[_0x4725('0x80'),_0x4725('0x81')]);_0x152a95=_['difference'](_[_0x4725('0x5b')](_0x56d6e2),[_0x4725('0x80'),'updatedAt',_0x4725('0x82'),'ListId']);if(_0x22c098[_0x4725('0x56')]['id']){delete _0x22c098[_0x4725('0x56')]['id'];}if(_[_0x4725('0x71')](_0x22c098['body'][_0x4725('0x83')])){throw new db[(_0x4725('0x7e'))][(_0x4725('0x84'))]('from\x20is\x20mandatory');}if(_[_0x4725('0x71')](_0x22c098[_0x4725('0x56')][_0x4725('0x56')])||_0x22c098['body'][_0x4725('0x56')]===''){throw new db[(_0x4725('0x7e'))]['ValidationError'](_0x4725('0x85'));}if(_[_0x4725('0x71')](_0x22c098['body'][_0x4725('0x86')])){throw new db[(_0x4725('0x7e'))][(_0x4725('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x152a95);}if(!_[_0x4725('0x87')](_0x152a95,_0x22c098[_0x4725('0x56')][_0x4725('0x86')])){throw new db[(_0x4725('0x7e'))]['ValidationError'](_0x4725('0x88')+_0x152a95);}_0x267c8e[_0x22c098[_0x4725('0x56')][_0x4725('0x86')]]=_0x22c098[_0x4725('0x56')][_0x4725('0x83')];})[_0x4725('0x16')](function(){return db[_0x4725('0x32')][_0x4725('0x51')]({'where':{'id':_0x22c098[_0x4725('0x4a')]['id']},'include':[{'model':db[_0x4725('0x89')],'as':_0x4725('0x8a'),'include':[{'model':db[_0x4725('0x8b')],'as':_0x4725('0x8c'),'where':_0x267c8e,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1e244e,null))['then'](function(_0x425a2f){if(_0x425a2f&&_0x425a2f[_0x4725('0x8a')]){_0x2446d7['account']=_0x425a2f;_0x2446d7[_0x4725('0x8d')]=_0x425a2f[_0x4725('0x8e')];_0x2446d7['list']=_0x425a2f[_0x4725('0x8a')];_0x2446d7['applications']=_[_0x4725('0x8f')](_0x2446d7[_0x4725('0x8d')],[_0x4725('0x90')],['asc']);if(_0x2446d7['account']['Applications']){delete _0x2446d7['account'][_0x4725('0x8e')];}if(_0x2446d7[_0x4725('0x91')][_0x4725('0x8a')]&&_0x2446d7[_0x4725('0x91')]['List'][_0x4725('0x8c')][_0x4725('0x3c')]){return _0x2446d7['account'][_0x4725('0x8a')]['Contacts'][0x0];}var _0x4afae8=_[_0x4725('0xd')](_0x22c098[_0x4725('0x56')],{'firstName':_0x22c098[_0x4725('0x56')][_0x4725('0x83')],'ListId':_0x425a2f['ListId']});_0x4afae8[_0x22c098[_0x4725('0x56')][_0x4725('0x86')]]=_0x22c098[_0x4725('0x56')][_0x4725('0x83')];return db['CmContact'][_0x4725('0x54')](_0x4afae8,{'fields':_0x269501,'raw':!![]});}})[_0x4725('0x16')](handleEntityNotFound(_0x1e244e,null))[_0x4725('0x16')](function(_0x4a6d6a){_0x2446d7[_0x4725('0x92')]=_0x4a6d6a;var _0x431f27=_0x22c098[_0x4725('0x56')]['customerIp'];if(_0x22c098[_0x4725('0x7c')]['cf-connecting-ip']){_0x431f27=_0x22c098['headers'][_0x4725('0x93')];}else if(_0x22c098[_0x4725('0x7c')][_0x4725('0x94')]){_0x431f27=_['first'](_0x22c098[_0x4725('0x7c')][_0x4725('0x94')][_0x4725('0x95')](','));}if(_0x4a6d6a){var _0x1a77d5={'ContactId':_0x4a6d6a['id'],'ChatWebsiteId':_0x22c098['params']['id'],'from':(_0x4a6d6a[_0x4725('0x96')]||'')+'\x20'+(_0x4a6d6a[_0x4725('0x97')]||''),'customerIp':_0x431f27,'customerPort':_0x22c098['headers'][_0x4725('0x98')]?_0x22c098[_0x4725('0x7c')][_0x4725('0x98')]:null,'referer':_0x22c098['body'][_0x4725('0x99')],'browserName':_0x55bcc3[_0x4725('0x9a')]['name']&&_0x55bcc3['browser'][_0x4725('0x9b')]?util['format'](_0x4725('0x9c'),_0x55bcc3['browser']['name'],_0x55bcc3[_0x4725('0x9a')][_0x4725('0x9b')]):_0x4725('0x9d'),'browserVersion':_0x55bcc3[_0x4725('0x9a')]['version']||_0x4725('0x9d'),'osName':util[_0x4725('0x9e')](_0x4725('0x9c'),_0x55bcc3['os'][_0x4725('0x47')],_0x55bcc3['os'][_0x4725('0x9b')]),'osVersion':_0x55bcc3['os'][_0x4725('0x9b')],'deviceModel':_0x55bcc3[_0x4725('0x9f')][_0x4725('0x36')]&&_0x55bcc3[_0x4725('0x9f')]['vendor']?util['format']('%s\x20%s\x20%s',_0x55bcc3[_0x4725('0x9f')][_0x4725('0x36')],_0x55bcc3[_0x4725('0x9f')][_0x4725('0xa0')],_0x55bcc3[_0x4725('0x9f')][_0x4725('0x45')]):null,'deviceVendor':_0x55bcc3['device']['vendor'],'deviceType':_0x55bcc3[_0x4725('0x9f')][_0x4725('0x45')],'formData':JSON[_0x4725('0xa1')](_0x22c098[_0x4725('0x56')])};var _0x15fca4={'ChatWebsiteId':_0x22c098['params']['id'],'closed':![]};if(_0x22c098[_0x4725('0x56')]['threadId']){_0x15fca4[_0x4725('0xa2')]=_0x22c098['body'][_0x4725('0xa2')];return db['ChatInteraction']['find']({'where':_0x15fca4})[_0x4725('0x16')](function(_0x41c087){if(_0x41c087){return[_0x41c087,![]];}_0x1a77d5[_0x4725('0xa2')]=_0x22c098['body'][_0x4725('0xa2')];_0x1a77d5[_0x4725('0xa3')]=_0x22c098[_0x4725('0x56')]['externalUrl'];return db[_0x4725('0xa4')][_0x4725('0x54')](_0x1a77d5)['then'](function(_0x3a9e17){return[_0x3a9e17,!![]];});});}_0x15fca4[_0x4725('0xa5')]=_0x4a6d6a['id'];if(_0x22c098[_0x4725('0x56')][_0x4725('0xa6')]&&_0x22c098[_0x4725('0x56')]['interaction']['id']){_0x15fca4['id']=_0x22c098['body'][_0x4725('0xa6')]['id'];return db[_0x4725('0xa4')]['find']({'where':_0x15fca4})[_0x4725('0x16')](function(_0x3e4237){if(_0x3e4237){return[_0x3e4237,![]];}return db[_0x4725('0xa4')]['create'](_0x1a77d5)[_0x4725('0x16')](function(_0x3ae973){return[_0x3ae973,!![]];});});}return db['ChatInteraction']['create'](_0x1a77d5)['then'](function(_0x517edc){return[_0x517edc,!![]];});}})['spread'](function(_0x1e0db4,_0x4317e2){if(_0x1e0db4){_0x39a6ca=_0x4317e2;if(!_0x4317e2){var _0x231192={'from':(_0x2446d7[_0x4725('0x92')]['firstName']||'')+'\x20'+(_0x2446d7[_0x4725('0x92')][_0x4725('0x97')]||'')};if(_0x22c098[_0x4725('0x56')]['threadId']&&_0x22c098[_0x4725('0x56')][_0x4725('0xa7')]&&_0x22c098[_0x4725('0x56')][_0x4725('0xa2')]!=_0x22c098[_0x4725('0x56')][_0x4725('0xa7')]){_0x231192[_0x4725('0xa2')]=_0x22c098[_0x4725('0x56')][_0x4725('0xa7')];}return _0x1e0db4[_0x4725('0x29')](_0x231192);}else{return _0x1e0db4;}}})[_0x4725('0x16')](function(_0x1aa4da){_0x2446d7[_0x4725('0xa6')]=_0x1aa4da[_0x4725('0x2b')]({'plain':!![]});_0x2446d7[_0x4725('0xa6')][_0x4725('0xa8')]=_0x39a6ca;if(_0x2446d7['interaction']['created']){if(_0x2446d7[_0x4725('0x91')][_0x4725('0xa9')]){_0x2446d7['applications']['push']({'id':0x0,'priority':_0x2446d7[_0x4725('0x8d')][_0x4725('0x3c')]+0x1,'app':_0x4725('0xaa'),'appdata':_0x4725('0xab'),'interval':_0x4725('0xac')});}}return db[_0x4725('0xad')][_0x4725('0x54')]({'body':_0x22c098['body']['body'],'ChatWebsiteId':_0x22c098[_0x4725('0x4a')]['id'],'ChatInteractionId':_0x1aa4da['id'],'direction':'in','ContactId':_0x2446d7['contact']['id'],'AttachmentId':_0x22c098[_0x4725('0x56')][_0x4725('0xae')]});})['then'](function(_0x436928){_0x2446d7[_0x4725('0x1d')]=_0x436928;if(_0x2446d7['interaction'][_0x4725('0xaf')]){return db['User'][_0x4725('0x51')]({'attributes':['id',_0x4725('0x47')],'where':{'id':_0x2446d7[_0x4725('0xa6')][_0x4725('0xaf')]}})[_0x4725('0x16')](function(_0x116cfb){if(_0x116cfb){_0x2446d7[_0x4725('0x8d')][_0x4725('0xb0')]({'id':0x0,'priority':0x0,'app':_0x4725('0xb1'),'appdata':_0x116cfb[_0x4725('0x47')]+','+(_0x2446d7['account'][_0x4725('0xb2')]||0xa),'interval':_0x4725('0xac')});_0x2446d7[_0x4725('0xb3')]=!![];}return respondWithRpcPromise(_0x4725('0xb4'),_0x4725('0xb5'),_0x2446d7);});}return respondWithRpcPromise('Start','startRouting',_0x2446d7);})[_0x4725('0x16')](function(_0xc74e9a){respondWithRpcPromise(_0x4725('0xb6'),'EventManager',{'event':_0x4725('0x79'),'message':_0xc74e9a},client9002);return _0xc74e9a;})['then'](respondWithResult(_0x1e244e,null))['catch'](handleError(_0x1e244e,null));};exports[_0x4725('0xb7')]=function(_0x47fc01,_0x21a2a1){var _0x2dcc8f,_0x4c454c,_0x6f8a07;var _0x38a6c3=[];var _0xb2f5ed={};var _0x4e8567=_0x47fc01[_0x4725('0xb8')]||[];var _0x1737a2=[];var _0x2f7081;return db['CmContact'][_0x4725('0x57')]()[_0x4725('0x16')](function(_0x12fbab){if(!_0x12fbab){throw new db[(_0x4725('0x7e'))][(_0x4725('0x84'))](_0x4725('0x7f'));}_0x38a6c3=_[_0x4725('0xb9')](_['keys'](_0x12fbab),[_0x4725('0x80'),_0x4725('0x81'),'CompanyId',_0x4725('0xba')]);if(_0x47fc01[_0x4725('0x56')]['id']){delete _0x47fc01[_0x4725('0x56')]['id'];}if(_[_0x4725('0x71')](_0x47fc01[_0x4725('0x56')][_0x4725('0x83')])){throw _0x21a2a1[_0x4725('0x21')](0x1f4)[_0x4725('0x2e')](new db[(_0x4725('0x7e'))][(_0x4725('0x84'))](_0x4725('0xbb')));}if(_[_0x4725('0x71')](_0x47fc01['body'][_0x4725('0x56')])||_0x47fc01[_0x4725('0x56')][_0x4725('0x56')]===''){throw _0x21a2a1[_0x4725('0x21')](0x1f4)[_0x4725('0x2e')](new db[(_0x4725('0x7e'))]['ValidationError'](_0x4725('0x85')));}if(_[_0x4725('0x71')](_0x47fc01[_0x4725('0x56')][_0x4725('0xbc')])){throw _0x21a2a1[_0x4725('0x21')](0x1f4)[_0x4725('0x2e')](new db['Sequelize']['ValidationError'](_0x4725('0xbd')+_0x38a6c3));}if(!_[_0x4725('0x87')](_0x38a6c3,_0x47fc01[_0x4725('0x56')][_0x4725('0xbc')])){throw _0x21a2a1[_0x4725('0x21')](0x1f4)[_0x4725('0x2e')](new db['Sequelize'][(_0x4725('0x84'))](_0x4725('0xbe')+_0x38a6c3));}_0xb2f5ed[_0x47fc01['body'][_0x4725('0xbc')]]=_0x47fc01['body']['from'];})[_0x4725('0x16')](function(){return db[_0x4725('0x32')]['find']({'where':{'id':_0x47fc01[_0x4725('0x4a')]['id']},'include':[{'model':db[_0x4725('0x89')],'as':_0x4725('0x8a')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x4725('0x16')](handleEntityNotFound(_0x21a2a1,null))[_0x4725('0x16')](function(_0x11783d){if(_0x11783d&&_0x11783d[_0x4725('0x8a')]){_0x4c454c=_0x11783d;var _0x3ad05a=_[_0x4725('0xd')](_0x47fc01[_0x4725('0x56')],{'firstName':_0x47fc01[_0x4725('0x56')][_0x4725('0x83')],'phone':_0x47fc01[_0x4725('0x56')][_0x4725('0x83')],'ListId':_0x11783d[_0x4725('0xba')]});_0x3ad05a[_0x47fc01[_0x4725('0x56')][_0x4725('0xbc')]]=_0x47fc01[_0x4725('0x56')][_0x4725('0x83')];return db[_0x4725('0x8b')][_0x4725('0xbf')]({'where':_0xb2f5ed,'defaults':_0x3ad05a});}})[_0x4725('0xc0')](function(_0x400dbe){if(_0x400dbe){_0x6f8a07=_0x400dbe;var _0x5c7aca=fs[_0x4725('0xc1')](path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0xc2')),_0x4725('0xc3'));var _0x51c7c5=ejs[_0x4725('0xc4')](_0x5c7aca,{'body':_[_0x4725('0xc5')](_0x47fc01[_0x4725('0x56')]['body']),'bodyTitle':_0x4c454c[_0x4725('0xc6')]});return db[_0x4725('0xc7')][_0x4725('0x54')]({'body':_0x51c7c5,'plainBody':htmlToText[_0x4725('0xc8')](_0x51c7c5),'ContactId':_0x400dbe['id'],'ChatWebsiteId':_0x4c454c['id']});}})[_0x4725('0x16')](function(_0x865260){_0x2f7081=_0x865260;if(_0x4e8567[_0x4725('0x3c')]){var _0x405f12=_0x4e8567['map'](function(_0x4b73cf){return{'name':_0x4b73cf[_0x4725('0xc9')],'basename':_0x4b73cf[_0x4725('0x67')],'type':_0x4b73cf[_0x4725('0xca')],'ChatOfflineMessageId':_0x865260['id']};});_0x1737a2=_0x405f12['map'](_0xd1a18=>{var _0x221c47={'filename':_0xd1a18[_0x4725('0x47')],'path':path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0xcb'),_0x4725('0xb8'),_0x4725('0xcc'),_0x4725('0xcd'),_0xd1a18['basename'])};return _0x221c47;});if(!_0x4c454c[_0x4725('0xce')]){return db[_0x4725('0xcf')][_0x4725('0xd0')](function(_0x114543){return db['Attachment'][_0x4725('0xd1')](_0x405f12,{'transaction':_0x114543});});}}})['then'](function(){if(_0x2f7081){_0x2dcc8f=_0x2f7081;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4725('0xd2')],'as':_0x4725('0xd3'),'raw':!![],'include':[{'model':db[_0x4725('0xd4')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x4f210d){if(_0x4f210d&&_0x4f210d['Smtp']&&_0x4c454c[_0x4725('0xd5')]&&_0x4c454c[_0x4725('0xd6')]){var _0x5be7e5=_0x4f210d['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x4725('0xd7'),{'account':_0x5be7e5,'message':{'from':util[_0x4725('0x9e')](_0x4725('0xd8'),_0x4f210d[_0x4725('0x47')],_0x4f210d[_0x4725('0xd9')]||_0x4f210d[_0x4725('0xd3')][_0x4725('0x4e')]),'to':_0x4c454c['forwardOfflineAddress'],'subject':_0x4c454c['offlineMessageSubject'],'html':_0x2dcc8f[_0x4725('0x56')],'attachments':_0x1737a2}},client9003)[_0x4725('0x16')](function(){return _0x2dcc8f;})[_0x4725('0x1f')](function(_0x19a0a3){logger[_0x4725('0x1b')](_0x19a0a3);});}})[_0x4725('0x16')](function(){if(_0x4c454c&&_0x4c454c[_0x4725('0xce')]&&_0x4c454c[_0x4725('0xda')]){var _0x21992e=[];if(_0x4e8567[_0x4725('0x3c')]){_0x21992e=_0x4e8567[_0x4725('0x37')](function(_0x25ad91){return{'name':_0x25ad91[_0x4725('0xc9')],'basename':_0x25ad91[_0x4725('0x67')],'type':_0x25ad91['mimetype'],'ChatOfflineMessageId':_0x2f7081['id']};});}var _0x1f8842;if(!_[_0x4725('0x71')](_0x4c454c[_0x4725('0xdb')])){var _0x36ebe9=_[_0x4725('0x37')](_0x47fc01[_0x4725('0x56')],function(_0x190ef5){return _0x190ef5;});var _0x37fc4f=_[_0x4725('0xdc')](_0x36ebe9)[0x0];var _0x3c3992=_[_0x4725('0xdd')](_0x37fc4f,function(_0x1bb001){return _0x1bb001;});_0x1f8842=_0x3c3992[0x1][_0x4c454c[_0x4725('0xdb')]];}var _0x1eb0e0={'from':_0x6f8a07[_0x4725('0xd9')],'firstName':_0x6f8a07[_0x4725('0x96')],'lastName':_0x6f8a07[_0x4725('0x97')],'mapKey':_0x4725('0xd9'),'message':{'from':_0x6f8a07[_0x4725('0xd9')],'to':_0x4c454c['MailAccount'][_0x4725('0xd9')],'cc':'','subject':_['isNil'](_0x1f8842)?_0x4c454c[_0x4725('0xde')]:_0x1f8842,'messageId':'','sentAt':new Date(),'attach':_0x21992e[_0x4725('0x3c')],'attachments':_0x21992e,'originChannel':_0x4725('0xdf'),'ChatWebsiteId':_0x4c454c['id'],'ChatOfflineMessageId':_0x2dcc8f['id'],'originTo':_0x4c454c[_0x4725('0xe0')][_0x4725('0xd9')]},'body':_0x2dcc8f[_0x4725('0x56')]};var _0x5a1ac9={'account':{'id':_0x4c454c['MailAccountId']},'body':_0x1eb0e0,'log':_0x4725('0xe1')};return respondWithRpcPromise('NotifyMailAccount',_0x4725('0xe2'),_0x5a1ac9,client9001)[_0x4725('0x16')](function(){return _0x2dcc8f;})['catch'](function(_0x34cea9){logger[_0x4725('0x1b')](_0x34cea9);});}return;})[_0x4725('0x16')](function(){if(_0x2dcc8f){return _0x2dcc8f;}})[_0x4725('0x16')](respondWithResult(_0x21a2a1,null))['catch'](function(_0x5b219c){logger['error'](_0x4725('0x1f'),_0x5b219c);for(var _0x21c3ca of _0x4e8567){var _0x44cb64=path[_0x4725('0x6d')](config[_0x4725('0x6e')],_0x4725('0xcb'),_0x4725('0xb8'),'attachments',_0x4725('0xcd'),_0x21c3ca[_0x4725('0x67')]);fs_extra[_0x4725('0xe3')](_0x44cb64)[_0x4725('0x1f')](function(_0x56c65a){logger[_0x4725('0x1b')](_0x4725('0xe4'),_0x44cb64,_0x56c65a);});}});};exports['addInteraction']=function(_0x4a4548,_0x4defea){return db['ChatInteraction'][_0x4725('0x51')]({'where':{'id':_0x4a4548['params']['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x4defea,null))[_0x4725('0x16')](function(_0x3ebab6){if(_0x3ebab6){return _0x3ebab6[_0x4725('0xe5')](_0x4a4548[_0x4725('0x56')]['ids'],_[_0x4725('0xe6')](_0x4a4548[_0x4725('0x56')],[_0x4725('0x60'),'id'])||{});}})['then'](respondWithResult(_0x4defea,null))['catch'](handleError(_0x4defea,null));};exports[_0x4725('0xe7')]=function(_0x37bd01,_0x45ea55){var _0x5d411c={'raw':![],'where':{}};var _0x2e1d7c={};var _0x43ce61={'count':0x0,'rows':[]};return db[_0x4725('0x32')][_0x4725('0x5a')]({'where':{'id':_0x37bd01[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x45ea55,null))[_0x4725('0x16')](function(_0xb2237c){if(_0xb2237c){_0x2e1d7c[_0x4725('0x36')]=_[_0x4725('0x5b')](db[_0x4725('0xa4')][_0x4725('0x33')]);_0x2e1d7c['query']=_[_0x4725('0x5b')](_0x37bd01[_0x4725('0x38')]);_0x2e1d7c[_0x4725('0x42')]=_['intersection'](_0x2e1d7c[_0x4725('0x36')],_0x2e1d7c[_0x4725('0x38')]);_0x5d411c[_0x4725('0x3a')]=_[_0x4725('0x39')](_0x2e1d7c['model'],qs[_0x4725('0x3b')](_0x37bd01[_0x4725('0x38')][_0x4725('0x3b')]));_0x5d411c['attributes']=_0x5d411c[_0x4725('0x3a')][_0x4725('0x3c')]?_0x5d411c['attributes']:_0x2e1d7c[_0x4725('0x36')];if(!_0x37bd01[_0x4725('0x38')][_0x4725('0x3d')](_0x4725('0x3e'))){_0x5d411c[_0x4725('0x25')]=qs[_0x4725('0x25')](_0x37bd01[_0x4725('0x38')][_0x4725('0x25')]);_0x5d411c[_0x4725('0x23')]=qs[_0x4725('0x23')](_0x37bd01['query'][_0x4725('0x23')]);}_0x5d411c[_0x4725('0x3f')]=qs['sort'](_0x37bd01[_0x4725('0x38')][_0x4725('0x40')]);_0x5d411c[_0x4725('0x41')]=qs['filters'](_[_0x4725('0x5d')](_0x37bd01[_0x4725('0x38')],_0x2e1d7c[_0x4725('0x42')]));_0x5d411c['where'][_0x4725('0x59')]=_0xb2237c['id'];if(_0x37bd01['query'][_0x4725('0x43')]){_0x5d411c[_0x4725('0x41')]=_[_0x4725('0x44')](_0x5d411c[_0x4725('0x41')],{'$or':_[_0x4725('0x37')](_0x5d411c[_0x4725('0x3a')],function(_0x573f56){var _0xd63070={};_0xd63070[_0x573f56]={'$like':'%'+_0x37bd01[_0x4725('0x38')][_0x4725('0x43')]+'%'};return _0xd63070;})});}_0x5d411c=_[_0x4725('0x44')]({},_0x5d411c,_0x37bd01['options']);return db[_0x4725('0xa4')][_0x4725('0x26')]({'where':_0x5d411c['where']})[_0x4725('0x16')](function(_0x4a942f){_0x43ce61['count']=_0x4a942f;if(_0x37bd01[_0x4725('0x38')][_0x4725('0x4b')]){_0x5d411c[_0x4725('0x4c')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4725('0xe8')],'as':_0x4725('0xe9'),'attributes':[_0x4725('0x47'),_0x4725('0xea'),_0x4725('0xeb')],'required':![]},{'model':db[_0x4725('0xec')],'as':_0x4725('0xed'),'attributes':['id',_0x4725('0x47'),_0x4725('0xee')],'where':_0x37bd01[_0x4725('0x38')][_0x4725('0xef')]?{'id':_0x37bd01['query'][_0x4725('0xef')]}:undefined,'required':_0x37bd01[_0x4725('0x38')][_0x4725('0xef')]?!![]:![]}];}return db[_0x4725('0xa4')]['findAll'](_0x5d411c);})[_0x4725('0x16')](function(_0xfe5f59){_0x43ce61['rows']=_0xfe5f59;return _0x43ce61;});}})['then'](respondWithFilteredResult(_0x45ea55,_0x5d411c))[_0x4725('0x1f')](handleError(_0x45ea55,null));};function iftimePromise(_0x4be39f,_0x2a0da6){return respondWithRpcPromise(_0x4725('0xf0'),_0x4725('0xf1'),{'command':_0x2a0da6[_0x4725('0xf2')]?util['format'](_0x4725('0xf3'),_0x4be39f[_0x4725('0xf4')],_0x2a0da6[_0x4725('0xf2')]):util[_0x4725('0x9e')](_0x4725('0xf5'),_0x4be39f['interval'])},client9002)[_0x4725('0x16')](function(_0x20c62a){var _0x31081a=_0x20c62a&&_0x20c62a[_0x4725('0xf6')](_0x4725('0xf7'))>=0x0?!![]:![];logger[_0x4725('0x1e')](_0x4725('0xf8'),_0x2a0da6['id'],_0x4be39f['id'],_0x4be39f[_0x4725('0xf4')],_0x31081a?'ONLINE':_0x4725('0xf9'),_0x2a0da6[_0x4725('0xf2')]?_0x2a0da6['timezone']:_0x4725('0xfa'));return _0x31081a;})['catch'](function(_0x3faef4){logger['error'](_0x4725('0xf8'),_0x2a0da6['id'],_0x4be39f['id'],_0x4be39f[_0x4725('0xf4')],util[_0x4725('0xfb')](_0x3faef4,{'showHidden':![],'depth':null}),_0x2a0da6[_0x4725('0xf2')]?_0x2a0da6[_0x4725('0xf2')]:_0x4725('0xfa'));return![];});}exports[_0x4725('0xf1')]=function(_0x9ce227,_0x44ecd6){var _0x3a1f86=0x0;var _0x3922f5=0x0;var _0x23a09f=![];var _0x34fe09;var _0x16d71f;return db[_0x4725('0x32')]['find']({'where':{'id':_0x9ce227[_0x4725('0x4a')]['id']},'include':[{'model':db['Interval'],'as':_0x4725('0xfc'),'include':[{'model':db[_0x4725('0xfc')],'as':_0x4725('0xfd'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x4725('0x16')](handleEntityNotFound(_0x44ecd6,null))[_0x4725('0x16')](function(_0x44785d){if(_0x44785d){_0x34fe09=_0x44785d;return _0x44785d[_0x4725('0xfe')]({'raw':!![]});}})[_0x4725('0x16')](function(_0x4016c4){if(_0x34fe09){if(_0x4016c4){_0x16d71f=_0x4016c4;}}return require(_0x4725('0xff'))['getLicense']();})['then'](function(_0xc1b6ab){if(_0xc1b6ab){_0x3922f5=_0xc1b6ab[_0x4725('0x100')];_0x23a09f=_0xc1b6ab[_0x4725('0x70')];}})[_0x4725('0x16')](function(){return db[_0x4725('0xa4')][_0x4725('0x26')]({'where':{'closed':![]}});})[_0x4725('0x16')](function(_0x3c5c71){_0x3a1f86=_0x3c5c71;if(_0x3922f5&&_0x3c5c71>_0x3922f5){return db[_0x4725('0x101')][_0x4725('0x5a')]({'where':{'id':0x1}})[_0x4725('0x16')](function(_0x4f3ab0){if(_0x4f3ab0){_0x4f3ab0[_0x4725('0x102')](_0x4725('0x103'));}});}})[_0x4725('0x16')](function(){if(_0x34fe09[_0x4725('0xfc')]&&_0x34fe09[_0x4725('0xfc')][_0x4725('0xfd')]){var _0x198e13=[];for(var _0x2d0aab=0x0;_0x2d0aab<_0x34fe09[_0x4725('0xfc')][_0x4725('0xfd')][_0x4725('0x3c')];_0x2d0aab++){var _0xe4ce75=_0x34fe09[_0x4725('0xfc')]['Intervals'][_0x2d0aab][_0x4725('0x2b')]({'plain':!![]});_0x198e13[_0x4725('0x104')](iftimePromise(_0xe4ce75,_0x34fe09));}return BPromise['all'](_0x198e13)[_0x4725('0x16')](function(_0x59926d){return _['some'](_0x59926d);});}else{return!![];}})[_0x4725('0x16')](function(_0x1301f5){var _0x519ac5=fs[_0x4725('0xc1')](path[_0x4725('0x6d')](config['root'],_0x4725('0x105')),_0x4725('0xc3'));var _0x455632=new url[(_0x4725('0x106'))](_0x34fe09['address'])[_0x4725('0x107')];var _0xe9b37a=_0x4725('0x108');var _0x561651=![];var _0x2ab7b6={'chatVersion':_0xe9b37a,'chatWebsiteAddressOrigin':_0x455632,'remote':_0x34fe09['remote'],'query':querystring['stringify'](_[_0x4725('0x44')](_0x34fe09['get']({'plain':!![]}),{'customerIp':_0x9ce227[_0x4725('0x7c')][_0x4725('0x94')]||_0x9ce227[_0x4725('0x7c')][_0x4725('0x109')]||_0x9ce227[_0x4725('0x10a')][_0x4725('0x10b')]||_0x9ce227['ip'],'referer':_0x9ce227[_0x4725('0x7c')]['referer'],'openedInteractions':_0x3a1f86,'maxInteractions':_0x3922f5,'virtual':_0x23a09f[_0x4725('0x100')],'online':_0x1301f5,'custom':_0x23a09f}))[_0x4725('0x10c')](/'/g,'\x5c\x27')};_0x44ecd6[_0x4725('0x2e')](ejs[_0x4725('0xc4')](Mustache[_0x4725('0xc4')](_0x519ac5,_0x2ab7b6),{'proactiveActions':_0x16d71f,'alignment':_0x34fe09[_0x4725('0x10d')],'verticalAlignment':_0x34fe09['verticalAlignment'],'div_color':_0x34fe09[_0x4725('0xee')],'labelText':_0x34fe09['labelText'],'text_color':_0x34fe09['textColor'],'text_button_color':_0x34fe09['textButtonColor'],'button_color':_0x34fe09['color_button'],'background_color':_0x34fe09[_0x4725('0x10e')],'hideWhenOffline':_0x34fe09[_0x4725('0x10f')],'intervalId':_0x34fe09[_0x4725('0x110')],'isDevelopment':_0x561651,'chatVersion':_0xe9b37a}));})[_0x4725('0x1f')](handleError(_0x44ecd6,null));};exports['addApplications']=function(_0x2ddc6d,_0x396c05){var _0x530c89=_0x2ddc6d['params']['id'];var _0x3daa60=_0x2ddc6d[_0x4725('0x56')];var _0x56dd9d=0xc8;var _0x1e3259=null;return db[_0x4725('0xcf')]['transaction']({'isolationLevel':db[_0x4725('0xcf')]['Transaction'][_0x4725('0x111')][_0x4725('0x112')]},function(_0x529e1e){return db[_0x4725('0x32')][_0x4725('0x5a')]({'where':{'id':_0x530c89},'transaction':_0x529e1e})[_0x4725('0x16')](function(_0x3901fd){if(_0x3901fd){return db[_0x4725('0x113')][_0x4725('0x2a')]({'where':{'ChatWebsiteId':_0x530c89},'transaction':_0x529e1e})[_0x4725('0x16')](function(){var _0x2c0012=_[_0x4725('0x37')](_0x3daa60,function(_0x3ba148){_0x3ba148[_0x4725('0x59')]=_0x530c89;return _0x3ba148;});return db['ChatApplication'][_0x4725('0xd1')](_0x2c0012,{'transaction':_0x529e1e});});}else{_0x56dd9d=0x194;_0x1e3259=[];}});})[_0x4725('0x16')](function(){if(_0x56dd9d!==0x194){return db['ChatApplication'][_0x4725('0x114')]({'where':{'ChatWebsiteId':_0x530c89},'order':_0x4725('0x90')})[_0x4725('0x16')](function(_0x490fdb){_0x1e3259=_0x490fdb;});}})['catch'](function(_0x8b3613){_0x56dd9d=0x1f4;logger[_0x4725('0x1b')](_0x8b3613['stack']);if(_0x8b3613[_0x4725('0x47')]){delete _0x8b3613[_0x4725('0x47')];}_0x1e3259=_0x8b3613;})[_0x4725('0x115')](function(){if(_0x1e3259===null){_0x396c05[_0x4725('0x20')](_0x56dd9d);}else{if(_0x56dd9d===0x1f4){_0x396c05[_0x4725('0x21')](_0x56dd9d)['send'](_0x1e3259);}else{_0x396c05['status'](_0x56dd9d)[_0x4725('0x22')](_0x1e3259);}}});};exports['getApplications']=function(_0x144ef5,_0xd3229c){var _0x41acf7={};var _0x62fac7={};var _0x486f1b;var _0x34ee40;return db[_0x4725('0x32')]['findOne']({'where':{'id':_0x144ef5[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0xd3229c,null))[_0x4725('0x16')](function(_0x250fa9){if(_0x250fa9){_0x486f1b=_0x250fa9;_0x62fac7['model']=_[_0x4725('0x5b')](db[_0x4725('0x113')][_0x4725('0x33')]);_0x62fac7[_0x4725('0x38')]=_[_0x4725('0x5b')](_0x144ef5[_0x4725('0x38')]);_0x62fac7['filters']=_[_0x4725('0x39')](_0x62fac7[_0x4725('0x36')],_0x62fac7[_0x4725('0x38')]);_0x41acf7[_0x4725('0x3a')]=_['intersection'](_0x62fac7[_0x4725('0x36')],qs[_0x4725('0x3b')](_0x144ef5[_0x4725('0x38')]['fields']));_0x41acf7[_0x4725('0x3a')]=_0x41acf7['attributes'][_0x4725('0x3c')]?_0x41acf7['attributes']:_0x62fac7[_0x4725('0x36')];_0x41acf7['order']=qs['sort'](_0x144ef5['query'][_0x4725('0x40')]);_0x41acf7['where']=qs['filters'](_[_0x4725('0x5d')](_0x144ef5['query'],_0x62fac7[_0x4725('0x42')]));if(_0x144ef5[_0x4725('0x38')][_0x4725('0x43')]){_0x41acf7[_0x4725('0x41')]=_['merge'](_0x41acf7['where'],{'$or':_[_0x4725('0x37')](_0x41acf7[_0x4725('0x3a')],function(_0x45593b){var _0x207398={};_0x207398[_0x45593b]={'$like':'%'+_0x144ef5[_0x4725('0x38')][_0x4725('0x43')]+'%'};return _0x207398;})});}_0x41acf7=_[_0x4725('0x44')]({},_0x41acf7,_0x144ef5[_0x4725('0x4d')]);return _0x486f1b[_0x4725('0x116')](_0x41acf7);}})[_0x4725('0x16')](function(_0xd080eb){if(_0xd080eb){_0x34ee40=_0xd080eb[_0x4725('0x3c')];if(!_0x144ef5[_0x4725('0x38')][_0x4725('0x3d')]('nolimit')){_0x41acf7['limit']=qs[_0x4725('0x25')](_0x144ef5[_0x4725('0x38')][_0x4725('0x25')]);_0x41acf7[_0x4725('0x23')]=qs[_0x4725('0x23')](_0x144ef5['query'][_0x4725('0x23')]);}return _0x486f1b[_0x4725('0x116')](_0x41acf7);}})[_0x4725('0x16')](function(_0x2513f6){if(_0x2513f6){return _0x2513f6?{'count':_0x34ee40,'rows':_0x2513f6}:null;}})[_0x4725('0x16')](respondWithResult(_0xd3229c,null))[_0x4725('0x1f')](handleError(_0xd3229c,null));};exports[_0x4725('0x117')]=function(_0x4d4547,_0x2094ac){return db[_0x4725('0x118')]['find']({'where':{'id':_0x4d4547[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x2094ac,null))['then'](function(_0x204cbb){if(_0x204cbb){return _0x204cbb[_0x4725('0x117')](_0x4d4547[_0x4725('0x56')][_0x4725('0x60')],_['omit'](_0x4d4547[_0x4725('0x56')],[_0x4725('0x60'),'id'])||{});}})['then'](respondWithResult(_0x2094ac,null))[_0x4725('0x1f')](handleError(_0x2094ac,null));};exports[_0x4725('0xfe')]=function(_0x2b46a4,_0x7ca344){var _0x285439={};var _0x34d4c2={};var _0x22ea7f;var _0x466386;return db['ChatWebsite'][_0x4725('0x5a')]({'where':{'id':_0x2b46a4['params']['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x7ca344,null))[_0x4725('0x16')](function(_0x4ed9fb){if(_0x4ed9fb){_0x22ea7f=_0x4ed9fb;_0x34d4c2['model']=_[_0x4725('0x5b')](db[_0x4725('0x119')][_0x4725('0x33')]);_0x34d4c2[_0x4725('0x38')]=_['keys'](_0x2b46a4[_0x4725('0x38')]);_0x34d4c2[_0x4725('0x42')]=_[_0x4725('0x39')](_0x34d4c2[_0x4725('0x36')],_0x34d4c2[_0x4725('0x38')]);_0x285439['attributes']=_['intersection'](_0x34d4c2['model'],qs[_0x4725('0x3b')](_0x2b46a4[_0x4725('0x38')][_0x4725('0x3b')]));_0x285439['attributes']=_0x285439[_0x4725('0x3a')][_0x4725('0x3c')]?_0x285439[_0x4725('0x3a')]:_0x34d4c2[_0x4725('0x36')];_0x285439[_0x4725('0x3f')]=qs[_0x4725('0x40')](_0x2b46a4[_0x4725('0x38')][_0x4725('0x40')]);_0x285439[_0x4725('0x41')]=qs[_0x4725('0x42')](_[_0x4725('0x5d')](_0x2b46a4[_0x4725('0x38')],_0x34d4c2[_0x4725('0x42')]));if(_0x2b46a4['query'][_0x4725('0x43')]){_0x285439[_0x4725('0x41')]=_['merge'](_0x285439[_0x4725('0x41')],{'$or':_[_0x4725('0x37')](_0x285439[_0x4725('0x3a')],function(_0xceeaf3){var _0x5637bb={};_0x5637bb[_0xceeaf3]={'$like':'%'+_0x2b46a4[_0x4725('0x38')][_0x4725('0x43')]+'%'};return _0x5637bb;})});}_0x285439=_[_0x4725('0x44')]({},_0x285439,_0x2b46a4['options']);return _0x22ea7f[_0x4725('0xfe')](_0x285439);}})[_0x4725('0x16')](function(_0x1819b5){if(_0x1819b5){_0x466386=_0x1819b5['length'];if(!_0x2b46a4['query'][_0x4725('0x3d')](_0x4725('0x3e'))){_0x285439[_0x4725('0x25')]=qs[_0x4725('0x25')](_0x2b46a4[_0x4725('0x38')]['limit']);_0x285439[_0x4725('0x23')]=qs[_0x4725('0x23')](_0x2b46a4['query'][_0x4725('0x23')]);}return _0x22ea7f[_0x4725('0xfe')](_0x285439);}})[_0x4725('0x16')](function(_0x39dacb){if(_0x39dacb){return _0x39dacb?{'count':_0x466386,'rows':_0x39dacb}:null;}})['then'](respondWithResult(_0x7ca344,null))[_0x4725('0x1f')](handleError(_0x7ca344,null));};exports[_0x4725('0x11a')]=function(_0x4952d7,_0xc5dd48){var _0x4769bd=_0x4952d7[_0x4725('0x38')][_0x4725('0x11b')]==='false'?_0x4725('0x11c'):_0x4725('0x11d');return db[_0x4725('0x32')]['find']({'attributes':['id',_0x4769bd],'where':{'id':_0x4952d7[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0xc5dd48,null))['then'](function(_0xb5a80e){if(_0xb5a80e){var _0xe12afb=_0xb5a80e[_0x4769bd];var _0x7619d5=_0xe12afb&&_0xe12afb[_0x4725('0x11e')]?_0xe12afb[_0x4725('0x11e')]:[];_0xc5dd48[_0x4725('0x2e')]({'fromKey':_[_0x4725('0x71')](_0xe12afb['fromKey'])?undefined:_0xe12afb[_0x4725('0x11f')],'count':_0x7619d5[_0x4725('0x3c')],'rows':_0x7619d5});}})[_0x4725('0x1f')](handleError(_0xc5dd48,null));};exports[_0x4725('0x120')]=function(_0x2fb6c8,_0x1a63f8){var _0x3b5345={'raw':![],'where':{}};var _0x58274e={};var _0x54d9c7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4725('0x5a')]({'where':{'id':_0x2fb6c8[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x1a63f8,null))[_0x4725('0x16')](function(_0x4d01e1){if(_0x4d01e1){_0x58274e[_0x4725('0x36')]=_[_0x4725('0x5b')](db[_0x4725('0xc7')][_0x4725('0x33')]);_0x58274e[_0x4725('0x38')]=_['keys'](_0x2fb6c8['query']);_0x58274e[_0x4725('0x42')]=_[_0x4725('0x39')](_0x58274e[_0x4725('0x36')],_0x58274e[_0x4725('0x38')]);_0x3b5345['attributes']=_['intersection'](_0x58274e[_0x4725('0x36')],qs[_0x4725('0x3b')](_0x2fb6c8[_0x4725('0x38')][_0x4725('0x3b')]));_0x3b5345['attributes']=_0x3b5345[_0x4725('0x3a')][_0x4725('0x3c')]?_0x3b5345[_0x4725('0x3a')]:_0x58274e['model'];if(!_0x2fb6c8[_0x4725('0x38')][_0x4725('0x3d')]('nolimit')){_0x3b5345['limit']=qs['limit'](_0x2fb6c8[_0x4725('0x38')]['limit']);_0x3b5345['offset']=qs[_0x4725('0x23')](_0x2fb6c8[_0x4725('0x38')][_0x4725('0x23')]);}_0x3b5345[_0x4725('0x3f')]=qs[_0x4725('0x40')](_0x2fb6c8[_0x4725('0x38')][_0x4725('0x40')]);_0x3b5345[_0x4725('0x41')]=qs['filters'](_[_0x4725('0x5d')](_0x2fb6c8[_0x4725('0x38')],_0x58274e[_0x4725('0x42')]));_0x3b5345[_0x4725('0x41')]['ChatWebsiteId']=_0x4d01e1['id'];if(_0x2fb6c8[_0x4725('0x38')]['filter']){_0x3b5345['where']=_[_0x4725('0x44')](_0x3b5345[_0x4725('0x41')],{'$or':_['map'](_0x3b5345[_0x4725('0x3a')],function(_0x5433cf){var _0x2fd736={};_0x2fd736[_0x5433cf]={'$like':'%'+_0x2fb6c8[_0x4725('0x38')][_0x4725('0x43')]+'%'};return _0x2fd736;})});}_0x3b5345=_[_0x4725('0x44')]({},_0x3b5345,_0x2fb6c8[_0x4725('0x4d')]);return db[_0x4725('0xc7')][_0x4725('0x26')]({'where':_0x3b5345[_0x4725('0x41')]})['then'](function(_0x1b96b6){_0x54d9c7[_0x4725('0x26')]=_0x1b96b6;if(_0x2fb6c8['query'][_0x4725('0x4b')]){_0x3b5345['include']=[{'all':!![]}];}else{_0x3b5345[_0x4725('0x4c')]=[{'model':db[_0x4725('0x8b')],'as':_0x4725('0x121'),'required':![]},{'model':db[_0x4725('0x122')],'as':'Attachments','required':![]}];}return db[_0x4725('0xc7')][_0x4725('0x5e')](_0x3b5345);})[_0x4725('0x16')](function(_0x2237df){_0x54d9c7[_0x4725('0x48')]=_0x2237df;return _0x54d9c7;});}})['then'](respondWithFilteredResult(_0x1a63f8,_0x3b5345))[_0x4725('0x1f')](handleError(_0x1a63f8,null));};exports[_0x4725('0x123')]=function(_0x2ad27c,_0x461171){return db['ChatWebsite'][_0x4725('0x51')]({'where':{'id':_0x2ad27c[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x461171,null))[_0x4725('0x16')](function(_0x210ad8){if(_0x210ad8){return _0x210ad8[_0x4725('0x123')](_0x2ad27c['body'][_0x4725('0x60')],_[_0x4725('0xe6')](_0x2ad27c[_0x4725('0x56')],[_0x4725('0x60'),'id'])||{})[_0x4725('0xc0')](function(_0x27c893){for(var _0x388d55=0x0;_0x388d55<_0x2ad27c[_0x4725('0x56')][_0x4725('0x60')][_0x4725('0x3c')];_0x388d55+=0x1){socket[_0x4725('0x124')](_0x4725('0x125'),{'UserId':Number(_0x2ad27c[_0x4725('0x56')][_0x4725('0x60')][_0x388d55]),'ChatWebsiteId':Number(_0x2ad27c[_0x4725('0x4a')]['id'])});}return _0x27c893;});}})[_0x4725('0x16')](respondWithResult(_0x461171,null))['catch'](handleError(_0x461171,null));};exports[_0x4725('0x126')]=function(_0x10afab,_0x3cd5fa){return db['ChatWebsite']['find']({'where':{'id':_0x10afab[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x3cd5fa,null))[_0x4725('0x16')](function(_0x2a7c96){if(_0x2a7c96){return _0x2a7c96[_0x4725('0x126')](_0x10afab['query']['ids'])[_0x4725('0x16')](function(){if(_[_0x4725('0x127')](_0x10afab['query'][_0x4725('0x60')])){for(var _0x3eff5a=0x0;_0x3eff5a<_0x10afab[_0x4725('0x38')][_0x4725('0x60')][_0x4725('0x3c')];_0x3eff5a+=0x1){socket['emit'](_0x4725('0x128'),{'UserId':Number(_0x10afab[_0x4725('0x38')][_0x4725('0x60')][_0x3eff5a]),'ChatWebsiteId':Number(_0x10afab[_0x4725('0x4a')]['id'])});}}else{socket[_0x4725('0x124')](_0x4725('0x128'),{'UserId':Number(_0x10afab['query'][_0x4725('0x60')]),'ChatWebsiteId':Number(_0x10afab[_0x4725('0x4a')]['id'])});}});}})[_0x4725('0x16')](respondWithStatusCode(_0x3cd5fa,null))[_0x4725('0x1f')](handleError(_0x3cd5fa,null));};exports['getAgents']=function(_0x57555d,_0x93362e){var _0x8ead0a={};var _0x4cf039={};var _0xeae4d1;var _0x59a719;return db[_0x4725('0x32')][_0x4725('0x5a')]({'where':{'id':_0x57555d[_0x4725('0x4a')]['id']}})[_0x4725('0x16')](handleEntityNotFound(_0x93362e,null))[_0x4725('0x16')](function(_0x57a0cc){if(_0x57a0cc){_0xeae4d1=_0x57a0cc;_0x4cf039[_0x4725('0x36')]=_[_0x4725('0x5b')](db['User'][_0x4725('0x33')]);_0x4cf039[_0x4725('0x38')]=_[_0x4725('0x5b')](_0x57555d[_0x4725('0x38')]);_0x4cf039['filters']=_[_0x4725('0x39')](_0x4cf039['model'],_0x4cf039['query']);_0x8ead0a[_0x4725('0x3a')]=_[_0x4725('0x39')](_0x4cf039[_0x4725('0x36')],qs['fields'](_0x57555d['query'][_0x4725('0x3b')]));_0x8ead0a[_0x4725('0x3a')]=_0x8ead0a['attributes'][_0x4725('0x3c')]?_0x8ead0a[_0x4725('0x3a')]:_0x4cf039['model'];_0x8ead0a[_0x4725('0x3f')]=qs['sort'](_0x57555d[_0x4725('0x38')]['sort']);_0x8ead0a[_0x4725('0x41')]=qs[_0x4725('0x42')](_[_0x4725('0x5d')](_0x57555d['query'],_0x4cf039[_0x4725('0x42')]));if(_0x57555d['query'][_0x4725('0x43')]){_0x8ead0a[_0x4725('0x41')]=_[_0x4725('0x44')](_0x8ead0a[_0x4725('0x41')],{'$or':_[_0x4725('0x37')](_0x8ead0a[_0x4725('0x3a')],function(_0x3d627c){var _0x3d4638={};_0x3d4638[_0x3d627c]={'$like':'%'+_0x57555d[_0x4725('0x38')]['filter']+'%'};return _0x3d4638;})});}_0x8ead0a=_[_0x4725('0x44')]({},_0x8ead0a,_0x57555d[_0x4725('0x4d')]);return _0xeae4d1[_0x4725('0x129')](_0x8ead0a);}})[_0x4725('0x16')](function(_0x568d09){if(_0x568d09){_0x59a719=_0x568d09[_0x4725('0x3c')];if(!_0x57555d[_0x4725('0x38')][_0x4725('0x3d')](_0x4725('0x3e'))){_0x8ead0a['limit']=qs[_0x4725('0x25')](_0x57555d[_0x4725('0x38')][_0x4725('0x25')]);_0x8ead0a[_0x4725('0x23')]=qs[_0x4725('0x23')](_0x57555d[_0x4725('0x38')]['offset']);}return _0xeae4d1[_0x4725('0x129')](_0x8ead0a);}})['then'](function(_0x440670){if(_0x440670){return _0x440670?{'count':_0x59a719,'rows':_0x440670}:null;}})['then'](respondWithResult(_0x93362e,null))[_0x4725('0x1f')](handleError(_0x93362e,null));}; \ No newline at end of file +var _0xb6bc=['push','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','MailAccountId','subjectOffline','offlineMessageSubject','NotifyMailAccount','remove','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','../../config/license/util','virtual','custom','License','increment','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','length','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','filename','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','sitepic','download','getAvatar','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','account','applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','autoclose'];(function(_0x3537ba,_0x2d30d8){var _0x393f1e=function(_0x45aba0){while(--_0x45aba0){_0x3537ba['push'](_0x3537ba['shift']());}};_0x393f1e(++_0x2d30d8);}(_0xb6bc,0x70));var _0xcb6b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb6bc[_0x13e741];return _0x3f8bb3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcb6b('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xcb6b('0x1'));var fs=require('fs');var fs_extra=require(_0xcb6b('0x2'));var _=require(_0xcb6b('0x3'));var querystring=require(_0xcb6b('0x4'));var Redis=require(_0xcb6b('0x5'));var qs=require(_0xcb6b('0x6'));var logger=require(_0xcb6b('0x7'))(_0xcb6b('0x8'));var config=require(_0xcb6b('0x9'));var url=require(_0xcb6b('0xa'));var db=require(_0xcb6b('0xb'))['db'];config[_0xcb6b('0xc')]=_[_0xcb6b('0xd')](config[_0xcb6b('0xc')],{'host':_0xcb6b('0xe'),'port':0x18eb});var socket=require(_0xcb6b('0xf'))(new Redis(config[_0xcb6b('0xc')]));require('./chatWebsite.socket')[_0xcb6b('0x10')](socket);var htmlToText=require(_0xcb6b('0x11'));var jayson=require(_0xcb6b('0x12'));var client=jayson[_0xcb6b('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xcb6b('0x13')][_0xcb6b('0x14')]({'port':0x232a});var client9003=jayson['client'][_0xcb6b('0x14')]({'port':0x232b});var client9001=jayson[_0xcb6b('0x13')][_0xcb6b('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x34b262,_0x322e16,_0x4e31fd,_0x44a21a){return new BPromise(function(_0x76a4c,_0x34dad0){var _0x1e0cf1=_0x44a21a||client;return _0x1e0cf1['request'](_0x34b262,_0x4e31fd)[_0xcb6b('0x15')](function(_0x2e7d15){logger[_0xcb6b('0x16')](_0xcb6b('0x17'),_0x322e16,_0xcb6b('0x18'));logger[_0xcb6b('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x322e16,_0xcb6b('0x18'),JSON[_0xcb6b('0x1a')](_0x2e7d15));if(_0x2e7d15[_0xcb6b('0x1b')]){if(_0x2e7d15['error'][_0xcb6b('0x1c')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x322e16,_0x2e7d15[_0xcb6b('0x1b')]['message']);return _0x34dad0(_0x2e7d15[_0xcb6b('0x1b')][_0xcb6b('0x1d')]);}logger[_0xcb6b('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x322e16,_0x2e7d15[_0xcb6b('0x1b')]['message']);return _0x76a4c(_0x2e7d15[_0xcb6b('0x1b')][_0xcb6b('0x1d')]);}else{logger[_0xcb6b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x322e16,'request\x20sent');_0x76a4c(_0x2e7d15['result'][_0xcb6b('0x1d')]);}})[_0xcb6b('0x1e')](function(_0x13b3e4){logger[_0xcb6b('0x1b')](_0xcb6b('0x17'),_0x322e16,_0x13b3e4);_0x34dad0(_0x13b3e4);});});}function respondWithStatusCode(_0x326aee,_0x3394a8){_0x3394a8=_0x3394a8||0xcc;return function(_0x433809){if(_0x433809){return _0x326aee[_0xcb6b('0x1f')](_0x3394a8);}return _0x326aee[_0xcb6b('0x20')](_0x3394a8)[_0xcb6b('0x21')]();};}function respondWithResult(_0x54947b,_0x14bfb0){_0x14bfb0=_0x14bfb0||0xc8;return function(_0x5397ce){if(_0x5397ce){return _0x54947b[_0xcb6b('0x20')](_0x14bfb0)[_0xcb6b('0x22')](_0x5397ce);}};}function respondWithFilteredResult(_0x20bfe5,_0x31ccf5){return function(_0xd8ba2b){if(_0xd8ba2b){var _0x2719d1=typeof _0x31ccf5[_0xcb6b('0x23')]===_0xcb6b('0x24')&&typeof _0x31ccf5['limit']===_0xcb6b('0x24');var _0x1ba8d6=_0xd8ba2b['count'];var _0x3386e3=_0x2719d1?0x0:_0x31ccf5[_0xcb6b('0x23')];var _0xc2652e=_0x2719d1?_0xd8ba2b[_0xcb6b('0x25')]:_0x31ccf5[_0xcb6b('0x23')]+_0x31ccf5[_0xcb6b('0x26')];var _0x3ee695;if(_0xc2652e>=_0x1ba8d6){_0xc2652e=_0x1ba8d6;_0x3ee695=0xc8;}else{_0x3ee695=0xce;}_0x20bfe5['status'](_0x3ee695);return _0x20bfe5[_0xcb6b('0x27')](_0xcb6b('0x28'),_0x3386e3+'-'+_0xc2652e+'/'+_0x1ba8d6)[_0xcb6b('0x22')](_0xd8ba2b);}return null;};}function saveUpdates(_0x3da9a7){return function(_0x5a193f){if(_0x5a193f){return _0x5a193f['update'](_0x3da9a7)[_0xcb6b('0x15')](function(_0x59539f){return _0x59539f;});}return null;};}function removeEntity(_0x2e7399){return function(_0x528c5e){if(_0x528c5e){return _0x528c5e[_0xcb6b('0x29')]()[_0xcb6b('0x15')](function(){var _0x42e4e8=_0x528c5e[_0xcb6b('0x2a')]({'plain':!![]});var _0x3317a7=_0xcb6b('0x2b');return db['UserProfileResource'][_0xcb6b('0x29')]({'where':{'type':_0x3317a7,'resourceId':_0x42e4e8['id']}})[_0xcb6b('0x15')](function(){return _0x528c5e;});})[_0xcb6b('0x15')](function(){_0x2e7399[_0xcb6b('0x20')](0xcc)[_0xcb6b('0x21')]();});}};}function handleEntityNotFound(_0xc8d9fa){return function(_0x5928f3){if(!_0x5928f3){_0xc8d9fa[_0xcb6b('0x1f')](0x194);}return _0x5928f3;};}function handleError(_0x298609,_0x2ed878){_0x2ed878=_0x2ed878||0x1f4;return function(_0x2f654a){logger['error'](_0x2f654a[_0xcb6b('0x2c')]);if(_0x2f654a[_0xcb6b('0x2d')]){delete _0x2f654a[_0xcb6b('0x2d')];}_0x298609['status'](_0x2ed878)[_0xcb6b('0x2e')](_0x2f654a);};}exports[_0xcb6b('0x2f')]=function(_0x17ee5f,_0x3fb597){var _0xd39505={'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]},_0x226ab2={},_0x5a77cb={'count':0x0,'rows':[]};var _0x3aa1de=_[_0xcb6b('0x32')](db[_0xcb6b('0x33')][_0xcb6b('0x34')],function(_0x5eb3a8){return{'name':_0x5eb3a8['fieldName'],'type':_0x5eb3a8[_0xcb6b('0x35')][_0xcb6b('0x36')]};});_0x226ab2[_0xcb6b('0x37')]=_['map'](_0x3aa1de,_0xcb6b('0x2d'));_0x226ab2[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x17ee5f['query']);_0x226ab2[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x226ab2[_0xcb6b('0x37')],_0x226ab2[_0xcb6b('0x38')]);_0xd39505['attributes']=_[_0xcb6b('0x3b')](_0x226ab2[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0xd39505[_0xcb6b('0x3d')]=_0xd39505[_0xcb6b('0x3d')]['length']?_0xd39505[_0xcb6b('0x3d')]:_0x226ab2[_0xcb6b('0x37')];if(!_0x17ee5f[_0xcb6b('0x38')]['hasOwnProperty'](_0xcb6b('0x3e'))){_0xd39505['limit']=qs[_0xcb6b('0x26')](_0x17ee5f['query'][_0xcb6b('0x26')]);_0xd39505[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x17ee5f[_0xcb6b('0x38')]['offset']);}_0xd39505[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0xd39505[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x17ee5f['query'],_0x226ab2[_0xcb6b('0x3a')]),_0x3aa1de);if(_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0xd39505[_0xcb6b('0x41')]=_[_0xcb6b('0x44')](_0xd39505['where'],{'$or':_['map'](_0x3aa1de,function(_0x162381){if(_0x162381[_0xcb6b('0x35')]!==_0xcb6b('0x45')){var _0x5033bb={};_0x5033bb[_0x162381[_0xcb6b('0x2d')]]={'$like':'%'+_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x5033bb;}})});}_0xd39505=_[_0xcb6b('0x44')]({},_0xd39505,_0x17ee5f[_0xcb6b('0x46')]);var _0x253f48={'where':_0xd39505[_0xcb6b('0x41')]};return db[_0xcb6b('0x33')][_0xcb6b('0x25')](_0x253f48)[_0xcb6b('0x15')](function(_0x282d9e){_0x5a77cb['count']=_0x282d9e;if(_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0xd39505['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xcb6b('0x48')](_0xd39505);})['then'](function(_0x59b960){_0x5a77cb[_0xcb6b('0x49')]=_0x59b960;return _0x5a77cb;})[_0xcb6b('0x15')](respondWithFilteredResult(_0x3fb597,_0xd39505))[_0xcb6b('0x1e')](handleError(_0x3fb597,null));};exports[_0xcb6b('0x4a')]=function(_0x32f23a,_0x41bbf4){var _0x44957f={'raw':![],'where':{'id':_0x32f23a['params']['id']},'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]},_0x9bc740={};_0x9bc740[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatWebsite'][_0xcb6b('0x34')]);_0x9bc740[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x32f23a[_0xcb6b('0x38')]);_0x9bc740['filters']=_[_0xcb6b('0x3b')](_0x9bc740[_0xcb6b('0x37')],_0x9bc740[_0xcb6b('0x38')]);_0x44957f[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x9bc740[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x32f23a[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x44957f[_0xcb6b('0x3d')]=_0x44957f['attributes'][_0xcb6b('0x4b')]?_0x44957f['attributes']:_0x9bc740[_0xcb6b('0x37')];if(_0x32f23a[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x44957f[_0xcb6b('0x4c')]=[{'all':!![]}];}_0x44957f=_[_0xcb6b('0x44')]({},_0x44957f,_0x32f23a[_0xcb6b('0x46')]);return db[_0xcb6b('0x33')][_0xcb6b('0x4d')](_0x44957f)[_0xcb6b('0x15')](handleEntityNotFound(_0x41bbf4,null))[_0xcb6b('0x15')](respondWithResult(_0x41bbf4,null))['catch'](handleError(_0x41bbf4,null));};exports[_0xcb6b('0x4e')]=function(_0x39222e,_0x2a8b26){return db[_0xcb6b('0x33')][_0xcb6b('0x4e')](_0x39222e[_0xcb6b('0x4f')],{})[_0xcb6b('0x15')](function(_0x640dbc){var _0x599255=_0x39222e[_0xcb6b('0x50')][_0xcb6b('0x2a')]({'plain':!![]});if(!_0x599255)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x599255['role']===_0xcb6b('0x50')){var _0x5bf453=_0x640dbc['get']({'plain':!![]});var _0x1d0b0b='ChatWebsites';return db[_0xcb6b('0x51')][_0xcb6b('0x4d')]({'where':{'name':_0x1d0b0b,'userProfileId':_0x599255[_0xcb6b('0x52')]},'raw':!![]})['then'](function(_0x387017){if(_0x387017&&_0x387017[_0xcb6b('0x53')]===0x0){return db['UserProfileResource'][_0xcb6b('0x4e')]({'name':_0x5bf453[_0xcb6b('0x2d')],'resourceId':_0x5bf453['id'],'type':_0x387017[_0xcb6b('0x2d')],'sectionId':_0x387017['id']},{})[_0xcb6b('0x15')](function(){return _0x640dbc;});}else{return _0x640dbc;}})[_0xcb6b('0x1e')](function(_0x5b7333){logger[_0xcb6b('0x1b')](_0xcb6b('0x54'),_0x5b7333);throw _0x5b7333;});}return _0x640dbc;})[_0xcb6b('0x15')](respondWithResult(_0x2a8b26,0xc9))[_0xcb6b('0x1e')](handleError(_0x2a8b26,null));};exports[_0xcb6b('0x55')]=function(_0x125869,_0x1c9978){if(_0x125869[_0xcb6b('0x4f')]['id']){delete _0x125869[_0xcb6b('0x4f')]['id'];}return db['ChatWebsite'][_0xcb6b('0x4d')]({'where':{'id':_0x125869[_0xcb6b('0x56')]['id']},'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]})[_0xcb6b('0x15')](handleEntityNotFound(_0x1c9978,null))[_0xcb6b('0x15')](saveUpdates(_0x125869[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x1c9978,null))[_0xcb6b('0x1e')](handleError(_0x1c9978,null));};exports[_0xcb6b('0x29')]=function(_0x4c3194,_0x14ad23){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4c3194[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x14ad23,null))[_0xcb6b('0x15')](removeEntity(_0x14ad23,null))[_0xcb6b('0x1e')](handleError(_0x14ad23,null));};exports['describe']=function(_0x5293e1,_0xf71291){return db[_0xcb6b('0x33')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](respondWithResult(_0xf71291,null))[_0xcb6b('0x1e')](handleError(_0xf71291,null));};exports[_0xcb6b('0x58')]=function(_0x3a4bd9,_0x1c60e7){if(_0x3a4bd9[_0xcb6b('0x4f')]['id']){delete _0x3a4bd9[_0xcb6b('0x4f')]['id'];}return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x3a4bd9['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1c60e7,null))[_0xcb6b('0x15')](function(_0x3c7c8e){if(_0x3c7c8e){_0x3a4bd9['body']['ChatWebsiteId']=_0x3c7c8e['id'];return db[_0xcb6b('0x59')][_0xcb6b('0x4e')](_0x3a4bd9[_0xcb6b('0x4f')]);}})['then'](respondWithResult(_0x1c60e7,null))[_0xcb6b('0x1e')](handleError(_0x1c60e7,null));};exports[_0xcb6b('0x5a')]=function(_0x1821f3,_0x408dc8){var _0x531ffe={'raw':![],'where':{}};var _0x502f85={};var _0x5399ac={'count':0x0,'rows':[]};return db[_0xcb6b('0x33')][_0xcb6b('0x5b')]({'where':{'id':_0x1821f3[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x408dc8,null))[_0xcb6b('0x15')](function(_0x1a4623){if(_0x1a4623){_0x502f85[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db[_0xcb6b('0x59')][_0xcb6b('0x34')]);_0x502f85[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x1821f3[_0xcb6b('0x38')]);_0x502f85[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x502f85[_0xcb6b('0x37')],_0x502f85[_0xcb6b('0x38')]);_0x531ffe[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x502f85['model'],qs[_0xcb6b('0x3c')](_0x1821f3['query'][_0xcb6b('0x3c')]));_0x531ffe[_0xcb6b('0x3d')]=_0x531ffe[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x531ffe[_0xcb6b('0x3d')]:_0x502f85[_0xcb6b('0x37')];if(!_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x531ffe[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x531ffe[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x1821f3['query'][_0xcb6b('0x23')]);}_0x531ffe[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x1821f3[_0xcb6b('0x38')]['sort']);_0x531ffe[_0xcb6b('0x41')]=qs['filters'](_[_0xcb6b('0x42')](_0x1821f3[_0xcb6b('0x38')],_0x502f85['filters']));_0x531ffe['where']['ChatWebsiteId']=_0x1a4623['id'];if(_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x531ffe[_0xcb6b('0x41')]=_['merge'](_0x531ffe[_0xcb6b('0x41')],{'$or':_['map'](_0x531ffe['attributes'],function(_0x5d9c79){var _0x21ba25={};_0x21ba25[_0x5d9c79]={'$like':'%'+_0x1821f3['query']['filter']+'%'};return _0x21ba25;})});}_0x531ffe=_[_0xcb6b('0x44')]({},_0x531ffe,_0x1821f3[_0xcb6b('0x46')]);return db[_0xcb6b('0x59')][_0xcb6b('0x25')]({'where':_0x531ffe[_0xcb6b('0x41')]})[_0xcb6b('0x15')](function(_0x1a6039){_0x5399ac['count']=_0x1a6039;if(_0x1821f3['query'][_0xcb6b('0x47')]){_0x531ffe[_0xcb6b('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0xcb6b('0x48')](_0x531ffe);})['then'](function(_0x1f6aa5){_0x5399ac[_0xcb6b('0x49')]=_0x1f6aa5;return _0x5399ac;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x408dc8,_0x531ffe))[_0xcb6b('0x1e')](handleError(_0x408dc8,null));};exports[_0xcb6b('0x5d')]=function(_0x55bd84,_0x1bd80b){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x55bd84['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1bd80b,null))['then'](function(_0x3c5ebe){if(_0x3c5ebe){return _0x3c5ebe['removeDispositions'](_0x55bd84[_0xcb6b('0x38')][_0xcb6b('0x5e')]);}})[_0xcb6b('0x15')](respondWithStatusCode(_0x1bd80b,null))[_0xcb6b('0x1e')](handleError(_0x1bd80b,null));};exports['addAnswer']=function(_0x49501d,_0x37b4ad){if(_0x49501d[_0xcb6b('0x4f')]['id']){delete _0x49501d[_0xcb6b('0x4f')]['id'];}return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x49501d[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x37b4ad,null))[_0xcb6b('0x15')](function(_0x266acb){if(_0x266acb){_0x49501d['body'][_0xcb6b('0x5f')]=_0x266acb['id'];return db[_0xcb6b('0x60')]['create'](_0x49501d[_0xcb6b('0x4f')]);}})[_0xcb6b('0x15')](respondWithResult(_0x37b4ad,null))[_0xcb6b('0x1e')](handleError(_0x37b4ad,null));};exports[_0xcb6b('0x61')]=function(_0x4e584c,_0x42bec8){var _0x4d741a={'raw':![],'where':{}};var _0x113097={};var _0x123473={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x4e584c[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x42bec8,null))[_0xcb6b('0x15')](function(_0x1adb9b){if(_0x1adb9b){_0x113097[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0x60')][_0xcb6b('0x34')]);_0x113097[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x4e584c[_0xcb6b('0x38')]);_0x113097[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x113097[_0xcb6b('0x37')],_0x113097[_0xcb6b('0x38')]);_0x4d741a[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x113097[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x4e584c[_0xcb6b('0x38')]['fields']));_0x4d741a[_0xcb6b('0x3d')]=_0x4d741a['attributes'][_0xcb6b('0x4b')]?_0x4d741a[_0xcb6b('0x3d')]:_0x113097[_0xcb6b('0x37')];if(!_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x5c')]('nolimit')){_0x4d741a[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x4e584c['query']['limit']);_0x4d741a[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x4e584c['query'][_0xcb6b('0x23')]);}_0x4d741a['order']=qs[_0xcb6b('0x40')](_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x4d741a[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x4e584c['query'],_0x113097[_0xcb6b('0x3a')]));_0x4d741a[_0xcb6b('0x41')][_0xcb6b('0x5f')]=_0x1adb9b['id'];if(_0x4e584c['query']['filter']){_0x4d741a[_0xcb6b('0x41')]=_[_0xcb6b('0x44')](_0x4d741a[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x4d741a[_0xcb6b('0x3d')],function(_0x5196e7){var _0x5931b4={};_0x5931b4[_0x5196e7]={'$like':'%'+_0x4e584c['query']['filter']+'%'};return _0x5931b4;})});}_0x4d741a=_['merge']({},_0x4d741a,_0x4e584c[_0xcb6b('0x46')]);return db[_0xcb6b('0x60')]['count']({'where':_0x4d741a['where']})[_0xcb6b('0x15')](function(_0x16e496){_0x123473[_0xcb6b('0x25')]=_0x16e496;if(_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x4d741a[_0xcb6b('0x4c')]=[{'all':!![]}];}return db[_0xcb6b('0x60')]['findAll'](_0x4d741a);})['then'](function(_0x61ddad){_0x123473[_0xcb6b('0x49')]=_0x61ddad;return _0x123473;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x42bec8,_0x4d741a))['catch'](handleError(_0x42bec8,null));};exports[_0xcb6b('0x62')]=function(_0x5544ea,_0x56c4f6){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x5544ea[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x56c4f6,null))[_0xcb6b('0x15')](function(_0x56a002){if(_0x56a002){return _0x56a002[_0xcb6b('0x62')](_0x5544ea[_0xcb6b('0x38')][_0xcb6b('0x5e')]);}})[_0xcb6b('0x15')](respondWithStatusCode(_0x56c4f6,null))[_0xcb6b('0x1e')](handleError(_0x56c4f6,null));};exports[_0xcb6b('0x63')]=function(_0x4a7615,_0x383992){_0x4a7615[_0xcb6b('0x4f')]['sitepic']=_0x4a7615['file'][_0xcb6b('0x64')];return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x4a7615[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x383992,null))[_0xcb6b('0x15')](saveUpdates(_0x4a7615[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x383992,null))[_0xcb6b('0x1e')](handleError(_0x383992,null));};exports['addAvatar']=function(_0x4e9e35,_0x24ce74){_0x4e9e35[_0xcb6b('0x4f')][_0xcb6b('0x65')]=_0x4e9e35[_0xcb6b('0x66')][_0xcb6b('0x64')];return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4e9e35[_0xcb6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x24ce74,null))[_0xcb6b('0x15')](saveUpdates(_0x4e9e35['body'],null))['then'](respondWithResult(_0x24ce74,null))[_0xcb6b('0x1e')](handleError(_0x24ce74,null));};exports[_0xcb6b('0x67')]=function(_0x5b2633,_0x5b4a56){_0x5b2633[_0xcb6b('0x4f')][_0xcb6b('0x68')]=_0x5b2633[_0xcb6b('0x66')][_0xcb6b('0x64')];return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x5b2633[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x5b4a56,null))[_0xcb6b('0x15')](saveUpdates(_0x5b2633['body'],null))[_0xcb6b('0x15')](respondWithResult(_0x5b4a56,null))[_0xcb6b('0x1e')](handleError(_0x5b4a56,null));};exports[_0xcb6b('0x69')]=function(_0x23549f,_0x414932){_0x23549f['body']['systemAvatar']=_0x23549f[_0xcb6b('0x66')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x23549f['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x414932,null))[_0xcb6b('0x15')](saveUpdates(_0x23549f[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x414932,null))['catch'](handleError(_0x414932,null));};exports[_0xcb6b('0x6a')]=function(_0x5b57d2,_0x5650a6){var _0x44959d=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x6d'));var _0x12a87a={'where':{'id':_0x5b57d2['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5cf140=![];return require('../../config/license/util')[_0xcb6b('0x6e')]()[_0xcb6b('0x15')](function(_0x162e0e){if(_0x162e0e){_0x5cf140=_0x162e0e['custom'];}})['then'](function(){return db[_0xcb6b('0x33')]['find'](_0x12a87a);})[_0xcb6b('0x15')](handleEntityNotFound(_0x5650a6,null))[_0xcb6b('0x15')](function(_0x5e6c66){if(_0x5e6c66){if(!_[_0xcb6b('0x6f')](_0x5e6c66[_0xcb6b('0x70')])){if(fs['existsSync'](path['join'](config[_0xcb6b('0x6c')],'server/files/images/logos/',_0x5e6c66[_0xcb6b('0x70')]))&&_0x5cf140){_0x44959d=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/logos/',_0x5e6c66['sitepic']);}}return _0x5650a6[_0xcb6b('0x71')](_0x44959d);}})[_0xcb6b('0x1e')](handleError(_0x5650a6,null));};exports[_0xcb6b('0x72')]=function(_0x354d9b,_0x50f977){var _0x9d8b67=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/default_avatar.png');var _0x4dbdd2={'where':{'id':_0x354d9b[_0xcb6b('0x56')]['id']},'attributes':['id',_0xcb6b('0x65')],'raw':!![]};return db[_0xcb6b('0x33')]['find'](_0x4dbdd2)[_0xcb6b('0x15')](handleEntityNotFound(_0x50f977,null))['then'](function(_0x102acb){if(_0x102acb){if(!_['isNil'](_0x102acb[_0xcb6b('0x65')])){if(fs[_0xcb6b('0x73')](path['join'](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x102acb['agentAvatar']))){_0x9d8b67=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/',_0x102acb[_0xcb6b('0x65')]);}}return _0x50f977[_0xcb6b('0x71')](_0x9d8b67);}})['catch'](handleError(_0x50f977,null));};exports['getCustomerAvatar']=function(_0x23c4d4,_0x5c5418){var _0x3674ad=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x75'));var _0x418e71={'where':{'id':_0x23c4d4[_0xcb6b('0x56')]['id']},'attributes':['id',_0xcb6b('0x68'),_0xcb6b('0x76')],'raw':!![]};return db[_0xcb6b('0x33')]['find'](_0x418e71)['then'](handleEntityNotFound(_0x5c5418,null))[_0xcb6b('0x15')](function(_0x1186ce){if(_0x1186ce){if(!_[_0xcb6b('0x6f')](_0x1186ce[_0xcb6b('0x68')])){if(fs['existsSync'](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/',_0x1186ce['customerAvatar']))&&_0x1186ce[_0xcb6b('0x76')]){_0x3674ad=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x1186ce[_0xcb6b('0x68')]);}}return _0x5c5418[_0xcb6b('0x71')](_0x3674ad);}})[_0xcb6b('0x1e')](handleError(_0x5c5418,null));};exports[_0xcb6b('0x77')]=function(_0x4cb1b0,_0x98e193){var _0x725003=path['join'](config[_0xcb6b('0x6c')],_0xcb6b('0x78'));var _0x3b4087={'where':{'id':_0x4cb1b0[_0xcb6b('0x56')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xcb6b('0x33')][_0xcb6b('0x4d')](_0x3b4087)[_0xcb6b('0x15')](handleEntityNotFound(_0x98e193,null))[_0xcb6b('0x15')](function(_0x2d4bbc){if(_0x2d4bbc){if(!_['isNil'](_0x2d4bbc[_0xcb6b('0x79')])){if(fs[_0xcb6b('0x73')](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x2d4bbc[_0xcb6b('0x79')]))){_0x725003=path[_0xcb6b('0x6b')](config['root'],'server/files/images/avatars/',_0x2d4bbc['systemAvatar']);}}return _0x98e193['download'](_0x725003);}})['catch'](handleError(_0x98e193,null));};exports['notify']=function(_0x213f41,_0x26af19){var _0x53d0e1=require(_0xcb6b('0x7a'));var _0x6af048=new _0x53d0e1();var _0xdb70d9=_0x6af048[_0xcb6b('0x7b')](_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x7d')])['getResult']();var _0x5dcd41={'body':_0x213f41['body'],'channel':_0xcb6b('0x7e')};var _0x1db364=[];var _0x228733=[];var _0x8dad9b={};var _0x197341=![];return db[_0xcb6b('0x7f')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](function(_0x1c8895){if(!_0x1c8895){throw new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x82'));}_0x1db364=_[_0xcb6b('0x83')](_[_0xcb6b('0x39')](_0x1c8895),['createdAt','updatedAt']);_0x228733=_[_0xcb6b('0x83')](_[_0xcb6b('0x39')](_0x1c8895),[_0xcb6b('0x84'),_0xcb6b('0x85'),_0xcb6b('0x86'),_0xcb6b('0x87')]);if(_0x213f41[_0xcb6b('0x4f')]['id']){delete _0x213f41[_0xcb6b('0x4f')]['id'];}if(_[_0xcb6b('0x6f')](_0x213f41['body'][_0xcb6b('0x88')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xcb6b('0x6f')](_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x4f')])||_0x213f41[_0xcb6b('0x4f')]['body']===''){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x89'));}if(_['isNil'](_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')])){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x8b')+_0x228733);}if(!_[_0xcb6b('0x8c')](_0x228733,_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')])){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x8d')+_0x228733);}_0x8dad9b[_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')]]=_0x213f41['body']['from'];})[_0xcb6b('0x15')](function(){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x213f41[_0xcb6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb6b('0x8e'),'include':[{'model':db['CmContact'],'as':_0xcb6b('0x8f'),'where':_0x8dad9b,'limit':0x1,'order':[[_0xcb6b('0x85'),'DESC']]}]},{'model':db[_0xcb6b('0x90')],'as':_0xcb6b('0x91')}]});})[_0xcb6b('0x15')](handleEntityNotFound(_0x26af19,null))[_0xcb6b('0x15')](function(_0x368fc8){if(_0x368fc8&&_0x368fc8[_0xcb6b('0x8e')]){_0x5dcd41[_0xcb6b('0x92')]=_0x368fc8;_0x5dcd41[_0xcb6b('0x93')]=_0x368fc8[_0xcb6b('0x91')];_0x5dcd41['list']=_0x368fc8[_0xcb6b('0x8e')];_0x5dcd41[_0xcb6b('0x93')]=_[_0xcb6b('0x94')](_0x5dcd41[_0xcb6b('0x93')],[_0xcb6b('0x95')],[_0xcb6b('0x96')]);if(_0x5dcd41['account'][_0xcb6b('0x91')]){delete _0x5dcd41[_0xcb6b('0x92')]['Applications'];}if(_0x5dcd41['account'][_0xcb6b('0x8e')]&&_0x5dcd41[_0xcb6b('0x92')]['List']['Contacts'][_0xcb6b('0x4b')]){return _0x5dcd41[_0xcb6b('0x92')][_0xcb6b('0x8e')][_0xcb6b('0x8f')][0x0];}var _0xcbd5af=_[_0xcb6b('0xd')](_0x213f41[_0xcb6b('0x4f')],{'firstName':_0x213f41['body'][_0xcb6b('0x88')],'ListId':_0x368fc8[_0xcb6b('0x87')]});_0xcbd5af[_0x213f41['body'][_0xcb6b('0x8a')]]=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x88')];return db[_0xcb6b('0x7f')][_0xcb6b('0x4e')](_0xcbd5af,{'fields':_0x1db364,'raw':!![]});}})[_0xcb6b('0x15')](handleEntityNotFound(_0x26af19,null))[_0xcb6b('0x15')](function(_0x51aff8){_0x5dcd41[_0xcb6b('0x97')]=_0x51aff8;var _0x17e057=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x98')];if(_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x99')]){_0x17e057=_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x99')];}else if(_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x9a')]){_0x17e057=_[_0xcb6b('0x9b')](_0x213f41['headers'][_0xcb6b('0x9a')][_0xcb6b('0x9c')](','));}if(_0x51aff8){var _0x52fffb={'ContactId':_0x51aff8['id'],'ChatWebsiteId':_0x213f41['params']['id'],'from':(_0x51aff8[_0xcb6b('0x9d')]||'')+'\x20'+(_0x51aff8[_0xcb6b('0x9e')]||''),'customerIp':_0x17e057,'customerPort':_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x9f')]?_0x213f41[_0xcb6b('0x7c')]['x-real-port']:null,'referer':_0x213f41[_0xcb6b('0x4f')]['referer'],'browserName':_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0x2d')]&&_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0xa1')]?util['format']('%s\x20%s',_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0x2d')],_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0xa1')]):_0xcb6b('0xa2'),'browserVersion':_0xdb70d9['browser']['version']||_0xcb6b('0xa2'),'osName':util[_0xcb6b('0xa3')](_0xcb6b('0xa4'),_0xdb70d9['os'][_0xcb6b('0x2d')],_0xdb70d9['os']['version']),'osVersion':_0xdb70d9['os'][_0xcb6b('0xa1')],'deviceModel':_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x37')]&&_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0xa6')]?util[_0xcb6b('0xa3')](_0xcb6b('0xa7'),_0xdb70d9['device'][_0xcb6b('0x37')],_0xdb70d9[_0xcb6b('0xa5')]['vendor'],_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x35')]):null,'deviceVendor':_0xdb70d9['device'][_0xcb6b('0xa6')],'deviceType':_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x35')],'formData':JSON[_0xcb6b('0x1a')](_0x213f41[_0xcb6b('0x4f')])};var _0x5830ba={'ChatWebsiteId':_0x213f41['params']['id'],'closed':![]};if(_0x213f41[_0xcb6b('0x4f')]['threadId']){_0x5830ba[_0xcb6b('0xa8')]=_0x213f41[_0xcb6b('0x4f')]['threadId'];return db[_0xcb6b('0xa9')][_0xcb6b('0x4d')]({'where':_0x5830ba})[_0xcb6b('0x15')](function(_0x22d1d7){if(_0x22d1d7){return[_0x22d1d7,![]];}_0x52fffb[_0xcb6b('0xa8')]=_0x213f41[_0xcb6b('0x4f')]['threadId'];_0x52fffb[_0xcb6b('0xaa')]=_0x213f41['body'][_0xcb6b('0xaa')];return db[_0xcb6b('0xa9')][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x12b7b1){return[_0x12b7b1,!![]];});});}_0x5830ba[_0xcb6b('0xab')]=_0x51aff8['id'];if(_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xac')]&&_0x213f41['body'][_0xcb6b('0xac')]['id']){_0x5830ba['id']=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xac')]['id'];return db[_0xcb6b('0xa9')][_0xcb6b('0x4d')]({'where':_0x5830ba})[_0xcb6b('0x15')](function(_0x3ef06a){if(_0x3ef06a){return[_0x3ef06a,![]];}return db['ChatInteraction'][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x4a5a20){return[_0x4a5a20,!![]];});});}return db['ChatInteraction'][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x316e4b){return[_0x316e4b,!![]];});}})[_0xcb6b('0xad')](function(_0x1143fb,_0xc23e2f){if(_0x1143fb){_0x197341=_0xc23e2f;if(!_0xc23e2f){var _0x1753a8={'from':(_0x5dcd41[_0xcb6b('0x97')][_0xcb6b('0x9d')]||'')+'\x20'+(_0x5dcd41[_0xcb6b('0x97')]['lastName']||'')};if(_0x213f41['body'][_0xcb6b('0xa8')]&&_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xae')]&&_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xa8')]!=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xae')]){_0x1753a8['threadId']=_0x213f41['body'][_0xcb6b('0xae')];}return _0x1143fb[_0xcb6b('0x55')](_0x1753a8);}else{return _0x1143fb;}}})['then'](function(_0x24a5f3){_0x5dcd41[_0xcb6b('0xac')]=_0x24a5f3['get']({'plain':!![]});_0x5dcd41[_0xcb6b('0xac')]['created']=_0x197341;if(_0x5dcd41[_0xcb6b('0xac')]['created']){if(_0x5dcd41[_0xcb6b('0x92')][_0xcb6b('0xaf')]){_0x5dcd41['applications'][_0xcb6b('0xb0')]({'id':0x0,'priority':_0x5dcd41['applications'][_0xcb6b('0x4b')]+0x1,'app':_0xcb6b('0xb1'),'appdata':'unmanaged','interval':_0xcb6b('0xb2')});}}return db['ChatMessage']['create']({'body':_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x4f')],'ChatWebsiteId':_0x213f41[_0xcb6b('0x56')]['id'],'ChatInteractionId':_0x24a5f3['id'],'direction':'in','ContactId':_0x5dcd41[_0xcb6b('0x97')]['id'],'AttachmentId':_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xb3')]});})['then'](function(_0x59bbd7){_0x5dcd41[_0xcb6b('0x1d')]=_0x59bbd7;if(_0x5dcd41[_0xcb6b('0xac')][_0xcb6b('0xb4')]){return db[_0xcb6b('0xb5')]['find']({'attributes':['id','name'],'where':{'id':_0x5dcd41[_0xcb6b('0xac')][_0xcb6b('0xb4')]}})[_0xcb6b('0x15')](function(_0x18380e){if(_0x18380e){_0x5dcd41['applications'][_0xcb6b('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x18380e[_0xcb6b('0x2d')]+','+(_0x5dcd41['account'][_0xcb6b('0xb7')]||0xa),'interval':'*,*,*,*'});_0x5dcd41[_0xcb6b('0xb8')]=!![];}return respondWithRpcPromise(_0xcb6b('0xb9'),_0xcb6b('0xba'),_0x5dcd41);});}return respondWithRpcPromise(_0xcb6b('0xb9'),'startRouting',_0x5dcd41);})[_0xcb6b('0x15')](function(_0xe64709){respondWithRpcPromise('EventManager',_0xcb6b('0xbb'),{'event':_0xcb6b('0xbc'),'message':_0xe64709},client9002);return _0xe64709;})[_0xcb6b('0x15')](respondWithResult(_0x26af19,null))[_0xcb6b('0x1e')](handleError(_0x26af19,null));};exports[_0xcb6b('0xbd')]=function(_0x3475c8,_0x37f5a3){var _0x2a9a26,_0x4945c2,_0x4e4324;var _0xea7466=[];var _0x1c923d={};var _0x219d06=_0x3475c8[_0xcb6b('0xbe')]||[];var _0x19f79b=[];var _0x2e6b98;return db[_0xcb6b('0x7f')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](function(_0x7a05a6){if(!_0x7a05a6){throw new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x82'));}_0xea7466=_['difference'](_[_0xcb6b('0x39')](_0x7a05a6),['createdAt',_0xcb6b('0x85'),_0xcb6b('0x86'),_0xcb6b('0x87')]);if(_0x3475c8[_0xcb6b('0x4f')]['id']){delete _0x3475c8[_0xcb6b('0x4f')]['id'];}if(_['isNil'](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xcb6b('0x6f')](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')])||_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')]===''){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)['send'](new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x89')));}if(_['isNil'](_0x3475c8['body']['mapKeyOffline'])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0xbf')+_0xea7466));}if(!_[_0xcb6b('0x8c')](_0xea7466,_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0xc1')+_0xea7466));}_0x1c923d[_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')]]=_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')];})[_0xcb6b('0x15')](function(){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x3475c8[_0xcb6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb6b('0x8e')},{'model':db[_0xcb6b('0xc2')],'as':'MailAccount'}]});})[_0xcb6b('0x15')](handleEntityNotFound(_0x37f5a3,null))[_0xcb6b('0x15')](function(_0x511521){if(_0x511521&&_0x511521[_0xcb6b('0x8e')]){_0x4945c2=_0x511521;var _0x136fbc=_['defaults'](_0x3475c8[_0xcb6b('0x4f')],{'firstName':_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')],'phone':_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')],'ListId':_0x511521['ListId']});_0x136fbc[_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')]]=_0x3475c8['body'][_0xcb6b('0x88')];return db[_0xcb6b('0x7f')][_0xcb6b('0xc3')]({'where':_0x1c923d,'defaults':_0x136fbc});}})['spread'](function(_0x20ac01){if(_0x20ac01){_0x4e4324=_0x20ac01;var _0x3bc481=fs[_0xcb6b('0xc4')](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/templates/chatOfflineMessage.ejs'),_0xcb6b('0xc5'));var _0x10912e=ejs[_0xcb6b('0xc6')](_0x3bc481,{'body':_[_0xcb6b('0xc7')](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')]),'bodyTitle':_0x4945c2['offlineMessageBody']});return db[_0xcb6b('0xc8')][_0xcb6b('0x4e')]({'body':_0x10912e,'plainBody':htmlToText[_0xcb6b('0xc9')](_0x10912e),'ContactId':_0x20ac01['id'],'ChatWebsiteId':_0x4945c2['id']});}})[_0xcb6b('0x15')](function(_0x54af07){_0x2e6b98=_0x54af07;if(_0x219d06[_0xcb6b('0x4b')]){var _0x562ca5=_0x219d06[_0xcb6b('0x32')](function(_0x35bb9d){return{'name':_0x35bb9d[_0xcb6b('0xca')],'basename':_0x35bb9d[_0xcb6b('0x64')],'type':_0x35bb9d[_0xcb6b('0xcb')],'ChatOfflineMessageId':_0x54af07['id']};});_0x19f79b=_0x562ca5[_0xcb6b('0x32')](_0x15fa4a=>{var _0x5c85f2={'filename':_0x15fa4a[_0xcb6b('0x2d')],'path':path[_0xcb6b('0x6b')](config['root'],_0xcb6b('0xcc'),'files',_0xcb6b('0xcd'),_0xcb6b('0xce'),_0x15fa4a[_0xcb6b('0xcf')])};return _0x5c85f2;});if(!_0x4945c2[_0xcb6b('0xd0')]){return db[_0xcb6b('0xd1')]['transaction'](function(_0x5c29ee){return db['Attachment'][_0xcb6b('0xd2')](_0x562ca5,{'transaction':_0x5c29ee});});}}})[_0xcb6b('0x15')](function(){if(_0x2e6b98){_0x2a9a26=_0x2e6b98;return db[_0xcb6b('0xc2')][_0xcb6b('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xcb6b('0xd3'),'raw':!![],'include':[{'model':db[_0xcb6b('0xd4')],'as':_0xcb6b('0xd4'),'raw':!![]}]}]});}})[_0xcb6b('0x15')](function(_0x436b0f){if(_0x436b0f&&_0x436b0f[_0xcb6b('0xd3')]&&_0x4945c2[_0xcb6b('0xd5')]&&_0x4945c2['forwardOfflineAddress']){var _0x3b0d70=_0x436b0f[_0xcb6b('0xd6')]();return respondWithRpcPromise(_0xcb6b('0xd7'),_0xcb6b('0xd8'),{'account':_0x3b0d70,'message':{'from':util[_0xcb6b('0xa3')]('\x22%s\x22\x20<%s>',_0x436b0f[_0xcb6b('0x2d')],_0x436b0f[_0xcb6b('0xd9')]||_0x436b0f[_0xcb6b('0xd3')]['user']),'to':_0x4945c2[_0xcb6b('0xda')],'subject':_0x4945c2['offlineMessageSubject'],'html':_0x2a9a26['body'],'attachments':_0x19f79b}},client9003)[_0xcb6b('0x15')](function(){return _0x2a9a26;})['catch'](function(_0x3da4e9){logger['error'](_0x3da4e9);});}})[_0xcb6b('0x15')](function(){if(_0x4945c2&&_0x4945c2[_0xcb6b('0xd0')]&&_0x4945c2[_0xcb6b('0xdb')]){var _0xb16c65=[];if(_0x219d06[_0xcb6b('0x4b')]){_0xb16c65=_0x219d06['map'](function(_0x101d65){return{'name':_0x101d65[_0xcb6b('0xca')],'basename':_0x101d65['filename'],'type':_0x101d65[_0xcb6b('0xcb')],'ChatOfflineMessageId':_0x2e6b98['id']};});}var _0x1b3e27;if(!_[_0xcb6b('0x6f')](_0x4945c2['subjectOffline'])){var _0x3ae418=_[_0xcb6b('0x32')](_0x3475c8[_0xcb6b('0x4f')],function(_0x15f252){return _0x15f252;});var _0x178fb8=_['toPairsIn'](_0x3ae418)[0x0];var _0x476a9c=_['mapValues'](_0x178fb8,function(_0x560650){return _0x560650;});_0x1b3e27=_0x476a9c[0x1][_0x4945c2[_0xcb6b('0xdc')]];}var _0x22c977={'from':_0x4e4324['email'],'firstName':_0x4e4324[_0xcb6b('0x9d')],'lastName':_0x4e4324[_0xcb6b('0x9e')],'mapKey':'email','message':{'from':_0x4e4324[_0xcb6b('0xd9')],'to':_0x4945c2[_0xcb6b('0xc2')][_0xcb6b('0xd9')],'cc':'','subject':_[_0xcb6b('0x6f')](_0x1b3e27)?_0x4945c2[_0xcb6b('0xdd')]:_0x1b3e27,'messageId':'','sentAt':new Date(),'attach':_0xb16c65[_0xcb6b('0x4b')],'attachments':_0xb16c65,'originChannel':'Chat','ChatWebsiteId':_0x4945c2['id'],'ChatOfflineMessageId':_0x2a9a26['id'],'originTo':_0x4945c2[_0xcb6b('0xc2')]['email']},'body':_0x2a9a26[_0xcb6b('0x4f')]};var _0xf3fa27={'account':{'id':_0x4945c2[_0xcb6b('0xdb')]},'body':_0x22c977,'log':_0xcb6b('0xde')};return respondWithRpcPromise(_0xcb6b('0xde'),'notifyMail',_0xf3fa27,client9001)[_0xcb6b('0x15')](function(){return _0x2a9a26;})[_0xcb6b('0x1e')](function(_0x2e4c0b){logger[_0xcb6b('0x1b')](_0x2e4c0b);});}return;})[_0xcb6b('0x15')](function(){if(_0x2a9a26){return _0x2a9a26;}})[_0xcb6b('0x15')](respondWithResult(_0x37f5a3,null))[_0xcb6b('0x1e')](function(_0x16be04){logger[_0xcb6b('0x1b')](_0xcb6b('0x1e'),_0x16be04);for(var _0x134b46 of _0x219d06){var _0x38aa77=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0xcc'),'files',_0xcb6b('0xcd'),_0xcb6b('0xce'),_0x134b46[_0xcb6b('0x64')]);fs_extra[_0xcb6b('0xdf')](_0x38aa77)[_0xcb6b('0x1e')](function(_0x35f529){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x38aa77,_0x35f529);});}});};exports[_0xcb6b('0xe0')]=function(_0x4c6339,_0x2e7151){return db[_0xcb6b('0xa9')]['find']({'where':{'id':_0x4c6339[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x2e7151,null))[_0xcb6b('0x15')](function(_0x121fd0){if(_0x121fd0){return _0x121fd0[_0xcb6b('0xe0')](_0x4c6339[_0xcb6b('0x4f')][_0xcb6b('0x5e')],_[_0xcb6b('0xe1')](_0x4c6339[_0xcb6b('0x4f')],[_0xcb6b('0x5e'),'id'])||{});}})[_0xcb6b('0x15')](respondWithResult(_0x2e7151,null))[_0xcb6b('0x1e')](handleError(_0x2e7151,null));};exports['getInteractions']=function(_0x4380e6,_0x1205de){var _0x129df8={'raw':![],'where':{}};var _0x5093d6={};var _0x2f63d0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x4380e6['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1205de,null))[_0xcb6b('0x15')](function(_0x26a54e){if(_0x26a54e){_0x5093d6['model']=_[_0xcb6b('0x39')](db[_0xcb6b('0xa9')][_0xcb6b('0x34')]);_0x5093d6[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x4380e6['query']);_0x5093d6['filters']=_[_0xcb6b('0x3b')](_0x5093d6[_0xcb6b('0x37')],_0x5093d6[_0xcb6b('0x38')]);_0x129df8[_0xcb6b('0x3d')]=_['intersection'](_0x5093d6[_0xcb6b('0x37')],qs['fields'](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x129df8['attributes']=_0x129df8['attributes'][_0xcb6b('0x4b')]?_0x129df8[_0xcb6b('0x3d')]:_0x5093d6[_0xcb6b('0x37')];if(!_0x4380e6['query'][_0xcb6b('0x5c')]('nolimit')){_0x129df8[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x4380e6['query'][_0xcb6b('0x26')]);_0x129df8[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x23')]);}_0x129df8[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x129df8[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x4380e6[_0xcb6b('0x38')],_0x5093d6['filters']));_0x129df8[_0xcb6b('0x41')][_0xcb6b('0x5f')]=_0x26a54e['id'];if(_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x129df8[_0xcb6b('0x41')]=_['merge'](_0x129df8['where'],{'$or':_[_0xcb6b('0x32')](_0x129df8[_0xcb6b('0x3d')],function(_0x1b2223){var _0x3112dc={};_0x3112dc[_0x1b2223]={'$like':'%'+_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x3112dc;})});}_0x129df8=_[_0xcb6b('0x44')]({},_0x129df8,_0x4380e6['options']);return db[_0xcb6b('0xa9')]['count']({'where':_0x129df8[_0xcb6b('0x41')]})['then'](function(_0x50b9c2){_0x2f63d0[_0xcb6b('0x25')]=_0x50b9c2;if(_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x129df8[_0xcb6b('0x4c')]=[{'model':db[_0xcb6b('0x7f')],'as':_0xcb6b('0xe2'),'required':![]},{'model':db[_0xcb6b('0xb5')],'as':_0xcb6b('0xe3'),'attributes':[_0xcb6b('0x2d'),_0xcb6b('0xe4'),_0xcb6b('0xe5')],'required':![]},{'model':db[_0xcb6b('0xe6')],'as':'Tags','attributes':['id',_0xcb6b('0x2d'),_0xcb6b('0xe7')],'where':_0x4380e6[_0xcb6b('0x38')]['tag']?{'id':_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0xe8')]}:undefined,'required':_0x4380e6[_0xcb6b('0x38')]['tag']?!![]:![]}];}return db[_0xcb6b('0xa9')][_0xcb6b('0x48')](_0x129df8);})[_0xcb6b('0x15')](function(_0x2b064b){_0x2f63d0[_0xcb6b('0x49')]=_0x2b064b;return _0x2f63d0;});}})['then'](respondWithFilteredResult(_0x1205de,_0x129df8))['catch'](handleError(_0x1205de,null));};function iftimePromise(_0xe1f1de,_0x529295){return respondWithRpcPromise(_0xcb6b('0xe9'),_0xcb6b('0xea'),{'command':_0x529295[_0xcb6b('0xeb')]?util[_0xcb6b('0xa3')]('iftime\x20%s,%s',_0xe1f1de['interval'],_0x529295[_0xcb6b('0xeb')]):util['format'](_0xcb6b('0xec'),_0xe1f1de[_0xcb6b('0xed')])},client9002)['then'](function(_0x24ca97){var _0x38efc9=_0x24ca97&&_0x24ca97[_0xcb6b('0xee')]('true')>=0x0?!![]:![];logger[_0xcb6b('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x529295['id'],_0xe1f1de['id'],_0xe1f1de['interval'],_0x38efc9?_0xcb6b('0xef'):_0xcb6b('0xf0'),_0x529295[_0xcb6b('0xeb')]?_0x529295[_0xcb6b('0xeb')]:_0xcb6b('0xf1'));return _0x38efc9;})['catch'](function(_0x57c0b9){logger[_0xcb6b('0x1b')](_0xcb6b('0xf2'),_0x529295['id'],_0xe1f1de['id'],_0xe1f1de[_0xcb6b('0xed')],util[_0xcb6b('0xf3')](_0x57c0b9,{'showHidden':![],'depth':null}),_0x529295[_0xcb6b('0xeb')]?_0x529295[_0xcb6b('0xeb')]:_0xcb6b('0xf1'));return![];});}exports['getSnippet']=function(_0x30f305,_0x44431e){var _0x25afd6=0x0;var _0x1fe8f0=0x0;var _0x116cda=![];var _0x363052;var _0x25310f;return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x30f305[_0xcb6b('0x56')]['id']},'include':[{'model':db[_0xcb6b('0xf4')],'as':'Interval','include':[{'model':db[_0xcb6b('0xf4')],'as':_0xcb6b('0xf5'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xcb6b('0x15')](handleEntityNotFound(_0x44431e,null))[_0xcb6b('0x15')](function(_0x23fe0a){if(_0x23fe0a){_0x363052=_0x23fe0a;return _0x23fe0a['getProactiveActions']({'raw':!![]});}})[_0xcb6b('0x15')](function(_0x13874e){if(_0x363052){if(_0x13874e){_0x25310f=_0x13874e;}}return require(_0xcb6b('0xf6'))[_0xcb6b('0x6e')]();})[_0xcb6b('0x15')](function(_0x5c7273){if(_0x5c7273){_0x1fe8f0=_0x5c7273[_0xcb6b('0xf7')];_0x116cda=_0x5c7273[_0xcb6b('0xf8')];}})['then'](function(){return db[_0xcb6b('0xa9')][_0xcb6b('0x25')]({'where':{'closed':![]}});})['then'](function(_0x3b85f8){_0x25afd6=_0x3b85f8;if(_0x1fe8f0&&_0x3b85f8>_0x1fe8f0){return db[_0xcb6b('0xf9')][_0xcb6b('0x5b')]({'where':{'id':0x1}})[_0xcb6b('0x15')](function(_0x1191d2){if(_0x1191d2){_0x1191d2[_0xcb6b('0xfa')]('chatLicenseExceeded');}});}})[_0xcb6b('0x15')](function(){if(_0x363052[_0xcb6b('0xf4')]&&_0x363052[_0xcb6b('0xf4')]['Intervals']){var _0x302697=[];for(var _0x528369=0x0;_0x528369<_0x363052[_0xcb6b('0xf4')][_0xcb6b('0xf5')]['length'];_0x528369++){var _0x4186ec=_0x363052[_0xcb6b('0xf4')]['Intervals'][_0x528369][_0xcb6b('0x2a')]({'plain':!![]});_0x302697['push'](iftimePromise(_0x4186ec,_0x363052));}return BPromise['all'](_0x302697)[_0xcb6b('0x15')](function(_0x305f61){return _[_0xcb6b('0xfb')](_0x305f61);});}else{return!![];}})[_0xcb6b('0x15')](function(_0x4727a3){var _0x5082e4=fs['readFileSync'](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0xfc')),_0xcb6b('0xc5'));var _0x39b3e1=new url[(_0xcb6b('0xfd'))](_0x363052[_0xcb6b('0xfe')])[_0xcb6b('0xff')];var _0x25d05d=_0xcb6b('0x100');var _0x52762a=![];var _0xd0e91b={'chatVersion':_0x25d05d,'chatWebsiteAddressOrigin':_0x39b3e1,'remote':_0x363052[_0xcb6b('0x101')],'query':querystring['stringify'](_['merge'](_0x363052[_0xcb6b('0x2a')]({'plain':!![]}),{'customerIp':_0x30f305['headers'][_0xcb6b('0x9a')]||_0x30f305[_0xcb6b('0x7c')][_0xcb6b('0x102')]||_0x30f305[_0xcb6b('0x103')][_0xcb6b('0x104')]||_0x30f305['ip'],'referer':_0x30f305[_0xcb6b('0x7c')]['referer'],'openedInteractions':_0x25afd6,'maxInteractions':_0x1fe8f0,'virtual':_0x116cda['virtual'],'online':_0x4727a3,'custom':_0x116cda}))[_0xcb6b('0x105')](/'/g,'\x5c\x27')};_0x44431e[_0xcb6b('0x2e')](ejs[_0xcb6b('0xc6')](Mustache[_0xcb6b('0xc6')](_0x5082e4,_0xd0e91b),{'proactiveActions':_0x25310f,'alignment':_0x363052['alignment'],'verticalAlignment':_0x363052['verticalAlignment'],'div_color':_0x363052[_0xcb6b('0xe7')],'labelText':_0x363052['labelText'],'text_color':_0x363052[_0xcb6b('0x106')],'text_button_color':_0x363052[_0xcb6b('0x107')],'button_color':_0x363052[_0xcb6b('0x108')],'background_color':_0x363052['backgroundColor'],'hideWhenOffline':_0x363052[_0xcb6b('0x109')],'intervalId':_0x363052[_0xcb6b('0x10a')],'isDevelopment':_0x52762a,'chatVersion':_0x25d05d}));})[_0xcb6b('0x1e')](handleError(_0x44431e,null));};exports[_0xcb6b('0x10b')]=function(_0xa22435,_0x4fe803){var _0x536ea1=_0xa22435[_0xcb6b('0x56')]['id'];var _0x139a40=_0xa22435[_0xcb6b('0x4f')];var _0x9a923a=0xc8;var _0x2c14fe=null;return db[_0xcb6b('0xd1')][_0xcb6b('0x10c')]({'isolationLevel':db['sequelize']['Transaction'][_0xcb6b('0x10d')]['READ_COMMITTED']},function(_0x1c5415){return db[_0xcb6b('0x33')]['findOne']({'where':{'id':_0x536ea1},'transaction':_0x1c5415})[_0xcb6b('0x15')](function(_0x4d6fd7){if(_0x4d6fd7){return db[_0xcb6b('0x90')][_0xcb6b('0x29')]({'where':{'ChatWebsiteId':_0x536ea1},'transaction':_0x1c5415})[_0xcb6b('0x15')](function(){var _0x3842c2=_[_0xcb6b('0x32')](_0x139a40,function(_0x57ebeb){_0x57ebeb[_0xcb6b('0x5f')]=_0x536ea1;return _0x57ebeb;});return db[_0xcb6b('0x90')][_0xcb6b('0xd2')](_0x3842c2,{'transaction':_0x1c5415});});}else{_0x9a923a=0x194;_0x2c14fe=[];}});})['then'](function(){if(_0x9a923a!==0x194){return db[_0xcb6b('0x90')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x536ea1},'order':_0xcb6b('0x95')})[_0xcb6b('0x15')](function(_0x2421bd){_0x2c14fe=_0x2421bd;});}})[_0xcb6b('0x1e')](function(_0x32aabe){_0x9a923a=0x1f4;logger[_0xcb6b('0x1b')](_0x32aabe[_0xcb6b('0x2c')]);if(_0x32aabe['name']){delete _0x32aabe[_0xcb6b('0x2d')];}_0x2c14fe=_0x32aabe;})[_0xcb6b('0x10e')](function(){if(_0x2c14fe===null){_0x4fe803[_0xcb6b('0x1f')](_0x9a923a);}else{if(_0x9a923a===0x1f4){_0x4fe803['status'](_0x9a923a)['send'](_0x2c14fe);}else{_0x4fe803['status'](_0x9a923a)[_0xcb6b('0x22')](_0x2c14fe);}}});};exports[_0xcb6b('0x10f')]=function(_0x470997,_0x5d88ed){var _0x18f6cf={};var _0x3e56ea={};var _0x4374d6;var _0x1b800a;return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x470997['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x5d88ed,null))[_0xcb6b('0x15')](function(_0xe760cc){if(_0xe760cc){_0x4374d6=_0xe760cc;_0x3e56ea[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatApplication'][_0xcb6b('0x34')]);_0x3e56ea[_0xcb6b('0x38')]=_['keys'](_0x470997[_0xcb6b('0x38')]);_0x3e56ea[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x3e56ea['model'],_0x3e56ea[_0xcb6b('0x38')]);_0x18f6cf['attributes']=_[_0xcb6b('0x3b')](_0x3e56ea[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x470997[_0xcb6b('0x38')]['fields']));_0x18f6cf[_0xcb6b('0x3d')]=_0x18f6cf[_0xcb6b('0x3d')]['length']?_0x18f6cf[_0xcb6b('0x3d')]:_0x3e56ea['model'];_0x18f6cf['order']=qs[_0xcb6b('0x40')](_0x470997[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x18f6cf[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_['pick'](_0x470997[_0xcb6b('0x38')],_0x3e56ea[_0xcb6b('0x3a')]));if(_0x470997['query'][_0xcb6b('0x43')]){_0x18f6cf[_0xcb6b('0x41')]=_['merge'](_0x18f6cf[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x18f6cf[_0xcb6b('0x3d')],function(_0x5180f6){var _0x1cfae5={};_0x1cfae5[_0x5180f6]={'$like':'%'+_0x470997['query'][_0xcb6b('0x43')]+'%'};return _0x1cfae5;})});}_0x18f6cf=_[_0xcb6b('0x44')]({},_0x18f6cf,_0x470997[_0xcb6b('0x46')]);return _0x4374d6['getApplications'](_0x18f6cf);}})[_0xcb6b('0x15')](function(_0x5c06fe){if(_0x5c06fe){_0x1b800a=_0x5c06fe[_0xcb6b('0x4b')];if(!_0x470997[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x18f6cf[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x470997['query']['limit']);_0x18f6cf['offset']=qs['offset'](_0x470997[_0xcb6b('0x38')]['offset']);}return _0x4374d6['getApplications'](_0x18f6cf);}})[_0xcb6b('0x15')](function(_0x429158){if(_0x429158){return _0x429158?{'count':_0x1b800a,'rows':_0x429158}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x5d88ed,null))[_0xcb6b('0x1e')](handleError(_0x5d88ed,null));};exports['addProactiveActions']=function(_0x2cbe1e,_0x3a1654){return db[_0xcb6b('0x110')][_0xcb6b('0x4d')]({'where':{'id':_0x2cbe1e['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x3a1654,null))[_0xcb6b('0x15')](function(_0x1af52b){if(_0x1af52b){return _0x1af52b[_0xcb6b('0x111')](_0x2cbe1e['body'][_0xcb6b('0x5e')],_['omit'](_0x2cbe1e[_0xcb6b('0x4f')],['ids','id'])||{});}})[_0xcb6b('0x15')](respondWithResult(_0x3a1654,null))[_0xcb6b('0x1e')](handleError(_0x3a1654,null));};exports['getProactiveActions']=function(_0x2a7966,_0x5ef03e){var _0x233716={};var _0x299ea4={};var _0x27e6ae;var _0x4b4af2;return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x2a7966[_0xcb6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ef03e,null))[_0xcb6b('0x15')](function(_0x50dd58){if(_0x50dd58){_0x27e6ae=_0x50dd58;_0x299ea4[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatProactiveAction'][_0xcb6b('0x34')]);_0x299ea4[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x2a7966[_0xcb6b('0x38')]);_0x299ea4[_0xcb6b('0x3a')]=_['intersection'](_0x299ea4['model'],_0x299ea4['query']);_0x233716[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x299ea4[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x2a7966['query'][_0xcb6b('0x3c')]));_0x233716[_0xcb6b('0x3d')]=_0x233716[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x233716['attributes']:_0x299ea4[_0xcb6b('0x37')];_0x233716[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x233716[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x2a7966['query'],_0x299ea4['filters']));if(_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x233716['where']=_[_0xcb6b('0x44')](_0x233716['where'],{'$or':_[_0xcb6b('0x32')](_0x233716['attributes'],function(_0x12c015){var _0x2e7dee={};_0x2e7dee[_0x12c015]={'$like':'%'+_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x2e7dee;})});}_0x233716=_[_0xcb6b('0x44')]({},_0x233716,_0x2a7966['options']);return _0x27e6ae[_0xcb6b('0x112')](_0x233716);}})['then'](function(_0x47d06b){if(_0x47d06b){_0x4b4af2=_0x47d06b[_0xcb6b('0x4b')];if(!_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x5c')]('nolimit')){_0x233716[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x2a7966['query'][_0xcb6b('0x26')]);_0x233716[_0xcb6b('0x23')]=qs['offset'](_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x23')]);}return _0x27e6ae[_0xcb6b('0x112')](_0x233716);}})[_0xcb6b('0x15')](function(_0x549741){if(_0x549741){return _0x549741?{'count':_0x4b4af2,'rows':_0x549741}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x5ef03e,null))['catch'](handleError(_0x5ef03e,null));};exports[_0xcb6b('0x113')]=function(_0xea4e91,_0x3bca24){var _0x5e2a57=_0xea4e91[_0xcb6b('0x38')][_0xcb6b('0x114')]==='false'?_0xcb6b('0x115'):'onlineForm';return db[_0xcb6b('0x33')]['find']({'attributes':['id',_0x5e2a57],'where':{'id':_0xea4e91[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x3bca24,null))['then'](function(_0x279e55){if(_0x279e55){var _0x2614c9=_0x279e55[_0x5e2a57];var _0x13eeb6=_0x2614c9&&_0x2614c9['items']?_0x2614c9[_0xcb6b('0x116')]:[];_0x3bca24[_0xcb6b('0x2e')]({'fromKey':_[_0xcb6b('0x6f')](_0x2614c9[_0xcb6b('0x117')])?undefined:_0x2614c9[_0xcb6b('0x117')],'count':_0x13eeb6[_0xcb6b('0x4b')],'rows':_0x13eeb6});}})[_0xcb6b('0x1e')](handleError(_0x3bca24,null));};exports[_0xcb6b('0x118')]=function(_0x3f39b0,_0x2e0d03){var _0x1201a4={'raw':![],'where':{}};var _0xeedc59={};var _0x3e70c3={'count':0x0,'rows':[]};return db[_0xcb6b('0x33')]['findOne']({'where':{'id':_0x3f39b0[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x2e0d03,null))[_0xcb6b('0x15')](function(_0x147cef){if(_0x147cef){_0xeedc59[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0xc8')]['rawAttributes']);_0xeedc59['query']=_[_0xcb6b('0x39')](_0x3f39b0[_0xcb6b('0x38')]);_0xeedc59[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0xeedc59['model'],_0xeedc59[_0xcb6b('0x38')]);_0x1201a4[_0xcb6b('0x3d')]=_['intersection'](_0xeedc59['model'],qs[_0xcb6b('0x3c')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x1201a4[_0xcb6b('0x3d')]=_0x1201a4['attributes']['length']?_0x1201a4['attributes']:_0xeedc59['model'];if(!_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x1201a4[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x1201a4[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x23')]);}_0x1201a4[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x1201a4[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x3f39b0['query'],_0xeedc59['filters']));_0x1201a4[_0xcb6b('0x41')]['ChatWebsiteId']=_0x147cef['id'];if(_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x1201a4['where']=_[_0xcb6b('0x44')](_0x1201a4[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x1201a4[_0xcb6b('0x3d')],function(_0x115c10){var _0x553848={};_0x553848[_0x115c10]={'$like':'%'+_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x553848;})});}_0x1201a4=_[_0xcb6b('0x44')]({},_0x1201a4,_0x3f39b0['options']);return db[_0xcb6b('0xc8')][_0xcb6b('0x25')]({'where':_0x1201a4[_0xcb6b('0x41')]})[_0xcb6b('0x15')](function(_0x549be0){_0x3e70c3[_0xcb6b('0x25')]=_0x549be0;if(_0x3f39b0[_0xcb6b('0x38')]['includeAll']){_0x1201a4[_0xcb6b('0x4c')]=[{'all':!![]}];}else{_0x1201a4[_0xcb6b('0x4c')]=[{'model':db[_0xcb6b('0x7f')],'as':'Contact','required':![]},{'model':db[_0xcb6b('0x119')],'as':_0xcb6b('0x11a'),'required':![]}];}return db[_0xcb6b('0xc8')]['findAll'](_0x1201a4);})[_0xcb6b('0x15')](function(_0x37e7c8){_0x3e70c3[_0xcb6b('0x49')]=_0x37e7c8;return _0x3e70c3;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x2e0d03,_0x1201a4))[_0xcb6b('0x1e')](handleError(_0x2e0d03,null));};exports[_0xcb6b('0x11b')]=function(_0x4d873e,_0x1ace33){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4d873e[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1ace33,null))['then'](function(_0xaf382){if(_0xaf382){return _0xaf382[_0xcb6b('0x11b')](_0x4d873e['body'][_0xcb6b('0x5e')],_[_0xcb6b('0xe1')](_0x4d873e[_0xcb6b('0x4f')],[_0xcb6b('0x5e'),'id'])||{})[_0xcb6b('0xad')](function(_0x1252cb){for(var _0x46a072=0x0;_0x46a072<_0x4d873e[_0xcb6b('0x4f')][_0xcb6b('0x5e')][_0xcb6b('0x4b')];_0x46a072+=0x1){socket[_0xcb6b('0x11c')]('userChatWebsite:save',{'UserId':Number(_0x4d873e['body'][_0xcb6b('0x5e')][_0x46a072]),'ChatWebsiteId':Number(_0x4d873e[_0xcb6b('0x56')]['id'])});}return _0x1252cb;});}})['then'](respondWithResult(_0x1ace33,null))['catch'](handleError(_0x1ace33,null));};exports[_0xcb6b('0x11d')]=function(_0x5428c9,_0x349b6a){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x5428c9['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x349b6a,null))['then'](function(_0x4af03c){if(_0x4af03c){return _0x4af03c['removeAgents'](_0x5428c9[_0xcb6b('0x38')][_0xcb6b('0x5e')])['then'](function(){if(_['isArray'](_0x5428c9['query'][_0xcb6b('0x5e')])){for(var _0x2663f9=0x0;_0x2663f9<_0x5428c9[_0xcb6b('0x38')]['ids'][_0xcb6b('0x4b')];_0x2663f9+=0x1){socket[_0xcb6b('0x11c')](_0xcb6b('0x11e'),{'UserId':Number(_0x5428c9[_0xcb6b('0x38')][_0xcb6b('0x5e')][_0x2663f9]),'ChatWebsiteId':Number(_0x5428c9[_0xcb6b('0x56')]['id'])});}}else{socket['emit'](_0xcb6b('0x11e'),{'UserId':Number(_0x5428c9['query'][_0xcb6b('0x5e')]),'ChatWebsiteId':Number(_0x5428c9[_0xcb6b('0x56')]['id'])});}});}})[_0xcb6b('0x15')](respondWithStatusCode(_0x349b6a,null))['catch'](handleError(_0x349b6a,null));};exports[_0xcb6b('0x11f')]=function(_0x5f3c08,_0x367382){var _0x16294f={};var _0x3a5783={};var _0x1b4c8e;var _0x197a40;return db['ChatWebsite']['findOne']({'where':{'id':_0x5f3c08['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x367382,null))[_0xcb6b('0x15')](function(_0x2e2a4f){if(_0x2e2a4f){_0x1b4c8e=_0x2e2a4f;_0x3a5783[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0xb5')][_0xcb6b('0x34')]);_0x3a5783[_0xcb6b('0x38')]=_['keys'](_0x5f3c08[_0xcb6b('0x38')]);_0x3a5783[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x3a5783[_0xcb6b('0x37')],_0x3a5783[_0xcb6b('0x38')]);_0x16294f[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x3a5783[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x16294f[_0xcb6b('0x3d')]=_0x16294f[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x16294f['attributes']:_0x3a5783[_0xcb6b('0x37')];_0x16294f[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x16294f['where']=qs['filters'](_['pick'](_0x5f3c08[_0xcb6b('0x38')],_0x3a5783[_0xcb6b('0x3a')]));if(_0x5f3c08['query'][_0xcb6b('0x43')]){_0x16294f['where']=_[_0xcb6b('0x44')](_0x16294f['where'],{'$or':_[_0xcb6b('0x32')](_0x16294f[_0xcb6b('0x3d')],function(_0x5871ac){var _0x4522e0={};_0x4522e0[_0x5871ac]={'$like':'%'+_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x4522e0;})});}_0x16294f=_[_0xcb6b('0x44')]({},_0x16294f,_0x5f3c08[_0xcb6b('0x46')]);return _0x1b4c8e[_0xcb6b('0x11f')](_0x16294f);}})[_0xcb6b('0x15')](function(_0x580d99){if(_0x580d99){_0x197a40=_0x580d99[_0xcb6b('0x4b')];if(!_0x5f3c08['query']['hasOwnProperty'](_0xcb6b('0x3e'))){_0x16294f[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x16294f[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x5f3c08[_0xcb6b('0x38')]['offset']);}return _0x1b4c8e[_0xcb6b('0x11f')](_0x16294f);}})[_0xcb6b('0x15')](function(_0x44b508){if(_0x44b508){return _0x44b508?{'count':_0x197a40,'rows':_0x44b508}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x367382,null))[_0xcb6b('0x1e')](handleError(_0x367382,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 89acc85..6dc3993 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0a4=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc0a4,0x147));var _0x4c0a=function(_0x79037b,_0x3f1007){_0x79037b=_0x79037b-0x0;var _0x10c6b8=_0xc0a4[_0x79037b];return _0x10c6b8;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x4c0a('0x0'))['db'][_0x4c0a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4c0a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4c0a('0x3'),'afterDestroy':_0x4c0a('0x4')};function emitEvent(_0x4540ae){return function(_0x23a18d,_0x44b0e7,_0x5d2401){ChatWebsiteEvents[_0x4c0a('0x5')](_0x4540ae+':'+_0x23a18d['id'],_0x23a18d);ChatWebsiteEvents[_0x4c0a('0x5')](_0x4540ae,_0x23a18d);_0x5d2401(null);};}for(var e in events){if(events[_0x4c0a('0x6')](e)){var event=events[e];ChatWebsite[_0x4c0a('0x7')](e,emitEvent(event));}}module[_0x4c0a('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5eb8=['exports','../../mysqldb','ChatWebsite','update','remove','emit','hasOwnProperty','hook'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5eb8,0x1d1));var _0x85eb=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x5eb8[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x85eb('0x0'))['db'][_0x85eb('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85eb('0x2'),'afterDestroy':_0x85eb('0x3')};function emitEvent(_0x4aa372){return function(_0x41b11e,_0x30ac6a,_0x3174ce){ChatWebsiteEvents[_0x85eb('0x4')](_0x4aa372+':'+_0x41b11e['id'],_0x41b11e);ChatWebsiteEvents['emit'](_0x4aa372,_0x41b11e);_0x3174ce(null);};}for(var e in events){if(events[_0x85eb('0x5')](e)){var event=events[e];ChatWebsite[_0x85eb('0x6')](e,emitEvent(event));}}module[_0x85eb('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c24a77a..0a72a6d 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0186=['moment','bluebird','request-promise','path','../../config/environment','define','ChatWebsite','chat_websites','util','../../config/logger'];(function(_0x3d4c73,_0x577100){var _0x16aed3=function(_0x265264){while(--_0x265264){_0x3d4c73['push'](_0x3d4c73['shift']());}};_0x16aed3(++_0x577100);}(_0x0186,0x1ac));var _0x6018=function(_0x344c94,_0xa0fa32){_0x344c94=_0x344c94-0x0;var _0x44e5d4=_0x0186[_0x344c94];return _0x44e5d4;};'use strict';var _=require('lodash');var util=require(_0x6018('0x0'));var logger=require(_0x6018('0x1'))('api');var moment=require(_0x6018('0x2'));var BPromise=require(_0x6018('0x3'));var rp=require(_0x6018('0x4'));var fs=require('fs');var path=require(_0x6018('0x5'));var rimraf=require('rimraf');var config=require(_0x6018('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x4f6d68,_0x40f50b){return _0x4f6d68[_0x6018('0x7')](_0x6018('0x8'),attributes,{'tableName':_0x6018('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5930=['api','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','define','lodash'];(function(_0x117260,_0x14e08f){var _0x4d32f7=function(_0x1c5446){while(--_0x1c5446){_0x117260['push'](_0x117260['shift']());}};_0x4d32f7(++_0x14e08f);}(_0x5930,0x1af));var _0x0593=function(_0x5ad8dd,_0x27ec37){_0x5ad8dd=_0x5ad8dd-0x0;var _0x51d484=_0x5930[_0x5ad8dd];return _0x51d484;};'use strict';var _=require(_0x0593('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0593('0x1'));var moment=require(_0x0593('0x2'));var BPromise=require(_0x0593('0x3'));var rp=require(_0x0593('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0593('0x5'));var attributes=require(_0x0593('0x6'));module[_0x0593('0x7')]=function(_0x3e070a,_0x1bf28b){return _0x3e070a[_0x0593('0x8')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 7a0d570..66900d5 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8c5=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','defaults','redis','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x10e8ed,_0x384a0d){var _0x4aea4a=function(_0x486ad1){while(--_0x486ad1){_0x10e8ed['push'](_0x10e8ed['shift']());}};_0x4aea4a(++_0x384a0d);}(_0xc8c5,0xbe));var _0x5c8c=function(_0x2c0b5c,_0x2de2b0){_0x2c0b5c=_0x2c0b5c-0x0;var _0x331c54=_0xc8c5[_0x2c0b5c];return _0x331c54;};'use strict';var _=require(_0x5c8c('0x0'));var util=require(_0x5c8c('0x1'));var moment=require(_0x5c8c('0x2'));var BPromise=require(_0x5c8c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c8c('0x4'));var db=require(_0x5c8c('0x5'))['db'];var utils=require(_0x5c8c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5c8c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5c8c('0x8')]['http']({'port':0x232a});config['redis']=_[_0x5c8c('0x9')](config[_0x5c8c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c8c('0xb'))(new Redis(config[_0x5c8c('0xa')]));require(_0x5c8c('0xc'))['register'](socket);function respondWithRpcPromise(_0x1fcf5e,_0x39555f,_0xf3b31f){return new BPromise(function(_0x1cdb94,_0x59b50a){return client[_0x5c8c('0xd')](_0x1fcf5e,_0xf3b31f)['then'](function(_0xe13a25){logger[_0x5c8c('0xe')](_0x5c8c('0xf'),_0x39555f,_0x5c8c('0x10'));logger[_0x5c8c('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x39555f,_0x5c8c('0x10'),JSON[_0x5c8c('0x12')](_0xe13a25));if(_0xe13a25[_0x5c8c('0x13')]){if(_0xe13a25[_0x5c8c('0x13')][_0x5c8c('0x14')]===0x1f4){logger[_0x5c8c('0x13')](_0x5c8c('0xf'),_0x39555f,_0xe13a25[_0x5c8c('0x13')][_0x5c8c('0x15')]);return _0x59b50a(_0xe13a25[_0x5c8c('0x13')][_0x5c8c('0x15')]);}logger[_0x5c8c('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x39555f,_0xe13a25[_0x5c8c('0x13')][_0x5c8c('0x15')]);return _0x1cdb94(_0xe13a25['error'][_0x5c8c('0x15')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x39555f,'request\x20sent');_0x1cdb94(_0xe13a25[_0x5c8c('0x16')]['message']);}})[_0x5c8c('0x17')](function(_0x53a074){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x39555f,_0x53a074);_0x59b50a(_0x53a074);});});} \ No newline at end of file +var _0x511d=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./chatWebsite.socket','request','then','info'];(function(_0x5671c9,_0x15f47e){var _0x24c8de=function(_0x533836){while(--_0x533836){_0x5671c9['push'](_0x5671c9['shift']());}};_0x24c8de(++_0x15f47e);}(_0x511d,0x165));var _0xd511=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x511d[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd511('0x0'));var util=require(_0xd511('0x1'));var moment=require(_0xd511('0x2'));var BPromise=require(_0xd511('0x3'));var rs=require(_0xd511('0x4'));var fs=require('fs');var Redis=require(_0xd511('0x5'));var db=require(_0xd511('0x6'))['db'];var utils=require(_0xd511('0x7'));var logger=require(_0xd511('0x8'))(_0xd511('0x9'));var config=require(_0xd511('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd511('0xb')]({'port':0x232a});config[_0xd511('0xc')]=_['defaults'](config[_0xd511('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd511('0xd'))(new Redis(config[_0xd511('0xc')]));require(_0xd511('0xe'))['register'](socket);function respondWithRpcPromise(_0x515808,_0x24112d,_0x14758e){return new BPromise(function(_0x56b990,_0x279e05){return client[_0xd511('0xf')](_0x515808,_0x14758e)[_0xd511('0x10')](function(_0x5181cd){logger[_0xd511('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x24112d,_0xd511('0x12'));logger[_0xd511('0x13')](_0xd511('0x14'),_0x24112d,'request\x20sent',JSON[_0xd511('0x15')](_0x5181cd));if(_0x5181cd[_0xd511('0x16')]){if(_0x5181cd[_0xd511('0x16')]['code']===0x1f4){logger[_0xd511('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x24112d,_0x5181cd[_0xd511('0x16')]['message']);return _0x279e05(_0x5181cd[_0xd511('0x16')][_0xd511('0x17')]);}logger['error'](_0xd511('0x18'),_0x24112d,_0x5181cd['error']['message']);return _0x56b990(_0x5181cd['error'][_0xd511('0x17')]);}else{logger[_0xd511('0x11')](_0xd511('0x18'),_0x24112d,'request\x20sent');_0x56b990(_0x5181cd['result'][_0xd511('0x17')]);}})['catch'](function(_0xd9daae){logger[_0xd511('0x16')](_0xd511('0x18'),_0x24112d,_0xd9daae);_0x279e05(_0xd9daae);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fd114da..67049ce 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcaa=['chatWebsite:','remove','update','emit','removeListener','register','length'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xdcaa,0x1dd));var _0xadca=function(_0x2d1904,_0x28d286){_0x2d1904=_0x2d1904-0x0;var _0x464c5b=_0xdcaa[_0x2d1904];return _0x464c5b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xadca('0x0'),_0xadca('0x1')];function createListener(_0xe8de4c,_0x46110c){return function(_0xf4d57){_0x46110c[_0xadca('0x2')](_0xe8de4c,_0xf4d57);};}function removeListener(_0x269e60,_0x448ac6){return function(){ChatWebsiteEvents[_0xadca('0x3')](_0x269e60,_0x448ac6);};}exports[_0xadca('0x4')]=function(_0x5398fe){for(var _0x1850e0=0x0,_0x1eab6d=events[_0xadca('0x5')];_0x1850e0<_0x1eab6d;_0x1850e0++){var _0x1f624c=events[_0x1850e0];var _0x4c530a=createListener(_0xadca('0x6')+_0x1f624c,_0x5398fe);ChatWebsiteEvents['on'](_0x1f624c,_0x4c530a);}}; \ No newline at end of file +var _0x48f8=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x48f8,0x15d));var _0x848f=function(_0x2b58d4,_0x2685bd){_0x2b58d4=_0x2b58d4-0x0;var _0x148fcd=_0x48f8[_0x2b58d4];return _0x148fcd;};'use strict';var ChatWebsiteEvents=require(_0x848f('0x0'));var events=['save',_0x848f('0x1'),_0x848f('0x2')];function createListener(_0x4536f8,_0x1c30e8){return function(_0x1da110){_0x1c30e8[_0x848f('0x3')](_0x4536f8,_0x1da110);};}function removeListener(_0x43aeea,_0x16e587){return function(){ChatWebsiteEvents[_0x848f('0x4')](_0x43aeea,_0x16e587);};}exports['register']=function(_0x61d051){for(var _0x3a8a27=0x0,_0x104d96=events[_0x848f('0x5')];_0x3a8a27<_0x104d96;_0x3a8a27++){var _0x4e6e01=events[_0x3a8a27];var _0x16188f=createListener(_0x848f('0x6')+_0x4e6e01,_0x61d051);ChatWebsiteEvents['on'](_0x4e6e01,_0x16188f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4fe6567..5470ac7 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4733=['getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','file','addLogo','single','addAvatar','diskStorage','server/files/images/avatars/','/:id/notify','notify','attachments','offline-chat','replace','extname','/:id/offline','offline','addProactiveActions','/:id','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x5391f9,_0x49b38b){var _0x9e3a1f=function(_0x5d046b){while(--_0x5d046b){_0x5391f9['push'](_0x5391f9['shift']());}};_0x9e3a1f(++_0x49b38b);}(_0x4733,0x158));var _0x3473=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x4733[_0x133277];return _0x5b4a22;};'use strict';var multer=require(_0x3473('0x0'));var util=require(_0x3473('0x1'));var path=require(_0x3473('0x2'));var timeout=require(_0x3473('0x3'));var express=require(_0x3473('0x4'));var router=express[_0x3473('0x5')]();var fs_extra=require(_0x3473('0x6'));var auth=require(_0x3473('0x7'));var interaction=require(_0x3473('0x8'));var config=require(_0x3473('0x9'));var controller=require(_0x3473('0xa'));router[_0x3473('0xb')]('/',auth[_0x3473('0xc')](),controller[_0x3473('0xd')]);router[_0x3473('0xb')](_0x3473('0xe'),auth['isAuthenticated'](),controller[_0x3473('0xf')]);router['get']('/:id',auth[_0x3473('0xc')](),controller[_0x3473('0x10')]);router[_0x3473('0xb')](_0x3473('0x11'),auth[_0x3473('0xc')](),controller[_0x3473('0x12')]);router['get'](_0x3473('0x13'),auth['isAuthenticated'](),controller[_0x3473('0x14')]);router[_0x3473('0xb')]('/:id/logo',controller[_0x3473('0x15')]);router[_0x3473('0xb')](_0x3473('0x16'),controller[_0x3473('0x17')]);router[_0x3473('0xb')](_0x3473('0x18'),controller[_0x3473('0x19')]);router[_0x3473('0xb')](_0x3473('0x1a'),controller['getSystemAvatar']);router['get'](_0x3473('0x1b'),auth[_0x3473('0xc')](),controller[_0x3473('0x1c')]);router[_0x3473('0xb')]('/:id/snippet',controller[_0x3473('0x1d')]);router[_0x3473('0xb')](_0x3473('0x1e'),auth[_0x3473('0xc')](),controller[_0x3473('0x1f')]);router[_0x3473('0xb')](_0x3473('0x20'),auth[_0x3473('0xc')](),controller[_0x3473('0x21')]);router[_0x3473('0xb')](_0x3473('0x22'),controller[_0x3473('0x23')]);router['get'](_0x3473('0x24'),auth[_0x3473('0xc')](),controller[_0x3473('0x25')]);router['get'](_0x3473('0x26'),auth[_0x3473('0xc')](),controller[_0x3473('0x27')]);router['post']('/',auth[_0x3473('0xc')](),controller[_0x3473('0x28')]);router[_0x3473('0x29')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3473('0x2a')]);router[_0x3473('0x29')](_0x3473('0x13'),auth[_0x3473('0xc')](),controller[_0x3473('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x345785,_0x24c3aa,_0x133227){_0x133227(null,path[_0x3473('0x2c')](config[_0x3473('0x2d')],_0x3473('0x2e')));},'filename':function(_0x1c4911,_0x3fbb76,_0x12ada7){_0x12ada7(null,util[_0x3473('0x2f')](_0x3473('0x30'),Date[_0x3473('0x31')](),_0x3fbb76[_0x3473('0x32')]));}})});router[_0x3473('0x29')](_0x3473('0x33'),upload['single'](_0x3473('0x34')),controller[_0x3473('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x265e40,_0x30efc4,_0xdcbb80){_0xdcbb80(null,path[_0x3473('0x2c')](config[_0x3473('0x2d')],'server/files/images/avatars/'));},'filename':function(_0x3f78bf,_0x5c3915,_0x27e8dc){_0x27e8dc(null,util[_0x3473('0x2f')](_0x3473('0x30'),Date[_0x3473('0x31')](),_0x5c3915['originalname']));}})});router['post'](_0x3473('0x16'),upload[_0x3473('0x36')](_0x3473('0x34')),controller[_0x3473('0x37')]);var upload=multer({'storage':multer[_0x3473('0x38')]({'destination':function(_0x1b7b02,_0x661cee,_0xbd84f1){_0xbd84f1(null,path['join'](config['root'],_0x3473('0x39')));},'filename':function(_0x1070b6,_0x4a7f64,_0x3c5fd7){_0x3c5fd7(null,util[_0x3473('0x2f')]('%s-%s',Date[_0x3473('0x31')](),_0x4a7f64[_0x3473('0x32')]));}})});router['post'](_0x3473('0x18'),upload[_0x3473('0x36')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3473('0x38')]({'destination':function(_0x40269d,_0x3f2dd6,_0x544b6f){_0x544b6f(null,path[_0x3473('0x2c')](config[_0x3473('0x2d')],_0x3473('0x39')));},'filename':function(_0x11fd08,_0x9b650e,_0x2f9d9a){_0x2f9d9a(null,util[_0x3473('0x2f')](_0x3473('0x30'),Date[_0x3473('0x31')](),_0x9b650e[_0x3473('0x32')]));}})});router[_0x3473('0x29')](_0x3473('0x1a'),upload[_0x3473('0x36')]('file'),controller['addSystemAvatar']);router['post'](_0x3473('0x3a'),controller[_0x3473('0x3b')]);const offlineUploadMulter=multer({'storage':multer[_0x3473('0x38')]({'destination':function(_0x4ad279,_0x3a8af5,_0x129497){const _0x40f659=path[_0x3473('0x2c')](config[_0x3473('0x2d')],'server/files',_0x3473('0x3c'),_0x3473('0x3d'));fs_extra['ensureDir'](_0x40f659,function(){_0x129497(null,_0x40f659);});},'filename':function(_0xcd463b,_0x1ff000,_0x1c2297){const _0x2af036=_0x1ff000[_0x3473('0x32')][_0x3473('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ff1f4=path[_0x3473('0x3f')](_0x2af036);const _0x3a10eb=Date[_0x3473('0x31')]()+'-'+_0x2af036[_0x3473('0x3e')](_0x1ff1f4,'')+_0x1ff1f4;_0x1c2297(null,_0x3a10eb);}})});router[_0x3473('0x29')](_0x3473('0x40'),offlineUploadMulter['any'](),controller[_0x3473('0x41')]);router[_0x3473('0x29')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x3473('0x29')](_0x3473('0x1e'),auth[_0x3473('0xc')](),controller['addApplications']);router[_0x3473('0x29')](_0x3473('0x20'),auth[_0x3473('0xc')](),controller[_0x3473('0x42')]);router[_0x3473('0x29')](_0x3473('0x26'),auth[_0x3473('0xc')](),controller['addAgents']);router['put'](_0x3473('0x43'),auth['isAuthenticated'](),controller[_0x3473('0x44')]);router[_0x3473('0x45')](_0x3473('0x43'),auth[_0x3473('0xc')](),controller[_0x3473('0x46')]);router[_0x3473('0x45')](_0x3473('0x11'),auth[_0x3473('0xc')](),controller['removeDispositions']);router[_0x3473('0x45')]('/:id/canned_answers',auth[_0x3473('0xc')](),controller[_0x3473('0x47')]);router[_0x3473('0x45')]('/:id/users',auth[_0x3473('0xc')](),controller[_0x3473('0x48')]);module['exports']=router; \ No newline at end of file +var _0xa61b=['/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','diskStorage','root','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','join','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa61b,0x1e8));var _0xba61=function(_0x9d2283,_0x451e89){_0x9d2283=_0x9d2283-0x0;var _0x1466d9=_0xa61b[_0x9d2283];return _0x1466d9;};'use strict';var multer=require(_0xba61('0x0'));var util=require(_0xba61('0x1'));var path=require(_0xba61('0x2'));var timeout=require('connect-timeout');var express=require(_0xba61('0x3'));var router=express[_0xba61('0x4')]();var fs_extra=require(_0xba61('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xba61('0x6'));var config=require(_0xba61('0x7'));var controller=require(_0xba61('0x8'));router[_0xba61('0x9')]('/',auth[_0xba61('0xa')](),controller[_0xba61('0xb')]);router[_0xba61('0x9')](_0xba61('0xc'),auth['isAuthenticated'](),controller[_0xba61('0xd')]);router[_0xba61('0x9')](_0xba61('0xe'),auth[_0xba61('0xa')](),controller[_0xba61('0xf')]);router['get'](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x11')]);router[_0xba61('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xba61('0x9')](_0xba61('0x12'),controller[_0xba61('0x13')]);router['get'](_0xba61('0x14'),controller[_0xba61('0x15')]);router['get'](_0xba61('0x16'),controller['getCustomerAvatar']);router[_0xba61('0x9')]('/:id/system_avatar',controller[_0xba61('0x17')]);router[_0xba61('0x9')](_0xba61('0x18'),auth[_0xba61('0xa')](),controller['getInteractions']);router[_0xba61('0x9')](_0xba61('0x19'),controller[_0xba61('0x1a')]);router[_0xba61('0x9')](_0xba61('0x1b'),auth[_0xba61('0xa')](),controller[_0xba61('0x1c')]);router[_0xba61('0x9')](_0xba61('0x1d'),auth[_0xba61('0xa')](),controller['getProactiveActions']);router[_0xba61('0x9')](_0xba61('0x1e'),controller[_0xba61('0x1f')]);router[_0xba61('0x9')](_0xba61('0x20'),auth[_0xba61('0xa')](),controller[_0xba61('0x21')]);router[_0xba61('0x9')](_0xba61('0x22'),auth[_0xba61('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xba61('0x23')]);router[_0xba61('0x24')](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x25')]);router[_0xba61('0x24')]('/:id/canned_answers',auth[_0xba61('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x482c12,_0x2a5808,_0x2a5965){_0x2a5965(null,path['join'](config[_0xba61('0x27')],'server/files/images/logos/'));},'filename':function(_0x176eee,_0x5e306c,_0x591dc9){_0x591dc9(null,util[_0xba61('0x28')]('%s-%s',Date[_0xba61('0x29')](),_0x5e306c[_0xba61('0x2a')]));}})});router['post'](_0xba61('0x12'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller[_0xba61('0x2d')]);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x393cb0,_0x128d0a,_0x37d8a7){_0x37d8a7(null,path['join'](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x288d6d,_0x1960db,_0x4a16ea){_0x4a16ea(null,util['format'](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x1960db['originalname']));}})});router[_0xba61('0x24')](_0xba61('0x14'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller[_0xba61('0x30')]);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x3e0fbc,_0x426d16,_0x4c025b){_0x4c025b(null,path[_0xba61('0x31')](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x8ae8e3,_0x3a4875,_0x5a8308){_0x5a8308(null,util[_0xba61('0x28')](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x3a4875['originalname']));}})});router[_0xba61('0x24')](_0xba61('0x16'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x14c672,_0x43d810,_0x515904){_0x515904(null,path['join'](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x76816f,_0x307938,_0x12c2d9){_0x12c2d9(null,util[_0xba61('0x28')](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x307938[_0xba61('0x2a')]));}})});router[_0xba61('0x24')](_0xba61('0x32'),upload[_0xba61('0x2b')]('file'),controller[_0xba61('0x33')]);router[_0xba61('0x24')](_0xba61('0x34'),controller[_0xba61('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x48a265,_0x19b0d4,_0x353cd0){const _0xad53a1=path['join'](config[_0xba61('0x27')],'server/files',_0xba61('0x36'),'offline-chat');fs_extra[_0xba61('0x37')](_0xad53a1,function(){_0x353cd0(null,_0xad53a1);});},'filename':function(_0x5ab8bb,_0x39d21a,_0x461cfe){const _0x3d0471=_0x39d21a[_0xba61('0x2a')][_0xba61('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ac680=path[_0xba61('0x39')](_0x3d0471);const _0x32f431=Date[_0xba61('0x29')]()+'-'+_0x3d0471[_0xba61('0x38')](_0x1ac680,'')+_0x1ac680;_0x461cfe(null,_0x32f431);}})});router[_0xba61('0x24')](_0xba61('0x3a'),offlineUploadMulter[_0xba61('0x3b')](),controller[_0xba61('0x3c')]);router[_0xba61('0x24')]('/:id/interactions',auth[_0xba61('0xa')](),controller[_0xba61('0x3d')]);router[_0xba61('0x24')](_0xba61('0x1b'),auth[_0xba61('0xa')](),controller[_0xba61('0x3e')]);router[_0xba61('0x24')](_0xba61('0x1d'),auth[_0xba61('0xa')](),controller['addProactiveActions']);router['post'](_0xba61('0x22'),auth[_0xba61('0xa')](),controller[_0xba61('0x3f')]);router[_0xba61('0x40')](_0xba61('0xe'),auth[_0xba61('0xa')](),controller['update']);router[_0xba61('0x41')](_0xba61('0xe'),auth['isAuthenticated'](),controller[_0xba61('0x42')]);router['delete'](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x43')]);router[_0xba61('0x41')](_0xba61('0x44'),auth[_0xba61('0xa')](),controller[_0xba61('0x45')]);router[_0xba61('0x41')](_0xba61('0x22'),auth[_0xba61('0xa')](),controller[_0xba61('0x46')]);module[_0xba61('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index dcc2450..838ecb8 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750d=['Router','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../config/environment'];(function(_0x2db1c2,_0x1e09a3){var _0x56a44c=function(_0x38df32){while(--_0x38df32){_0x2db1c2['push'](_0x2db1c2['shift']());}};_0x56a44c(++_0x1e09a3);}(_0x750d,0x7c));var _0xd750=function(_0x5341ce,_0x2551e4){_0x5341ce=_0x5341ce-0x0;var _0x3b3f98=_0x750d[_0x5341ce];return _0x3b3f98;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd750('0x0'));var auth=require('../components/auth/service');var config=require(_0xd750('0x1'));var router=express[_0xd750('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x15332d,_0x18ed36,_0x435eb4){var _0x36093e=_0x15332d['app']['get'](_0xd750('0x3'));if(!_0x36093e){throw new Error(_0xd750('0x4'));}return beaverLogger[_0xd750('0x5')]({'uri':_0xd750('0x6'),'logger':_0x36093e,'enableCors':!isProduction})(_0x15332d,_0x18ed36,_0x435eb4);}router['use'](auth[_0xd750('0x7')](),clientSideLogs);module[_0xd750('0x8')]=router; \ No newline at end of file +var _0x80e6=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../config/environment','env','production','get'];(function(_0x116a96,_0xb3cb8c){var _0x57ad04=function(_0x556765){while(--_0x556765){_0x116a96['push'](_0x116a96['shift']());}};_0x57ad04(++_0xb3cb8c);}(_0x80e6,0xb5));var _0x680e=function(_0x2f534f,_0x3a4391){_0x2f534f=_0x2f534f-0x0;var _0x3ac9b8=_0x80e6[_0x2f534f];return _0x3ac9b8;};var beaverLogger=require(_0x680e('0x0'));var express=require(_0x680e('0x1'));var auth=require('../components/auth/service');var config=require(_0x680e('0x2'));var router=express['Router']();var isProduction=config[_0x680e('0x3')]===_0x680e('0x4')||![];function clientSideLogs(_0x47ee7b,_0x7cafb4,_0x36d976){var _0x2f1984=_0x47ee7b['app'][_0x680e('0x5')]('client-side-logger');if(!_0x2f1984){throw new Error(_0x680e('0x6'));}return beaverLogger[_0x680e('0x7')]({'uri':_0x680e('0x8'),'logger':_0x2f1984,'enableCors':!isProduction})(_0x47ee7b,_0x7cafb4,_0x36d976);}router[_0x680e('0x9')](auth[_0x680e('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 408bc4f..a2bd237 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd27a=['ENUM','Google','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xd27a,0x99));var _0xad27=function(_0x408e16,_0x5a35d5){_0x408e16=_0x408e16-0x0;var _0x556ae4=_0xd27a[_0x408e16];return _0x556ae4;};'use strict';var Sequelize=require(_0xad27('0x0'));module[_0xad27('0x1')]={'name':{'type':Sequelize[_0xad27('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xad27('0x3')]('AmazonAWS',_0xad27('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xad27('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xad27('0x2')],'comment':_0xad27('0x6')},'data2':{'type':Sequelize['STRING'],'comment':_0xad27('0x7')},'data3':{'type':Sequelize[_0xad27('0x2')],'comment':_0xad27('0x8')},'data4':{'type':Sequelize[_0xad27('0x2')],'comment':_0xad27('0x9')},'data5':{'type':Sequelize[_0xad27('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xad27('0xa')],'comment':_0xad27('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xad27('0xc')}}; \ No newline at end of file +var _0xffed=['exports','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0xffed,0x1a4));var _0xdffe=function(_0xf20de,_0x297b52){_0xf20de=_0xf20de-0x0;var _0x172295=_0xffed[_0xf20de];return _0x172295;};'use strict';var Sequelize=require('sequelize');module[_0xdffe('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdffe('0x1')](_0xdffe('0x2'),_0xdffe('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdffe('0x1')](_0xdffe('0x4'),_0xdffe('0x5'))},'data1':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xdffe('0x6')],'comment':_0xdffe('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':_0xdffe('0x8')},'data6':{'type':Sequelize[_0xdffe('0x9')],'comment':_0xdffe('0xa')},'data7':{'type':Sequelize[_0xdffe('0x9')],'comment':_0xdffe('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9c94271..fad38c8 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6f2=['toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','limit','count','offset','set','Content-Range','update','then','destroy','error','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','MicrosoftAzure','decryptString','data3','catch','show','keys','length','include','find','service','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64'];(function(_0x99004e,_0x20aec4){var _0x3f79ad=function(_0x3428c3){while(--_0x3428c3){_0x99004e['push'](_0x99004e['shift']());}};_0x3f79ad(++_0x20aec4);}(_0xb6f2,0xce));var _0x2b6f=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb6f2[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x2b6f('0x0'));var Redis=require(_0x2b6f('0x1'));var qs=require(_0x2b6f('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x2b6f('0x3'));var db=require(_0x2b6f('0x4'))['db'];var oauth=require(_0x2b6f('0x5'));config[_0x2b6f('0x6')]=_[_0x2b6f('0x7')](config[_0x2b6f('0x6')],{'host':_0x2b6f('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b6f('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1e23c2,_0x3d5767){_0x3d5767=_0x3d5767||0xcc;return function(_0x82ba69){if(_0x82ba69){return _0x1e23c2[_0x2b6f('0x9')](_0x3d5767);}return _0x1e23c2[_0x2b6f('0xa')](_0x3d5767)[_0x2b6f('0xb')]();};}function respondWithResult(_0x264226,_0x500cc8){_0x500cc8=_0x500cc8||0xc8;return function(_0x48bbc){if(_0x48bbc){return _0x264226[_0x2b6f('0xa')](_0x500cc8)[_0x2b6f('0xc')](_0x48bbc);}};}function respondWithFilteredResult(_0x20cb41,_0x61dcbd){return function(_0x519ad2){if(_0x519ad2){var _0x3df854=typeof _0x61dcbd['offset']==='undefined'&&typeof _0x61dcbd[_0x2b6f('0xd')]==='undefined';var _0x54f8c8=_0x519ad2[_0x2b6f('0xe')];var _0x143f60=_0x3df854?0x0:_0x61dcbd[_0x2b6f('0xf')];var _0x17ee5f=_0x3df854?_0x519ad2[_0x2b6f('0xe')]:_0x61dcbd['offset']+_0x61dcbd[_0x2b6f('0xd')];var _0x4379dd;if(_0x17ee5f>=_0x54f8c8){_0x17ee5f=_0x54f8c8;_0x4379dd=0xc8;}else{_0x4379dd=0xce;}_0x20cb41[_0x2b6f('0xa')](_0x4379dd);return _0x20cb41[_0x2b6f('0x10')](_0x2b6f('0x11'),_0x143f60+'-'+_0x17ee5f+'/'+_0x54f8c8)[_0x2b6f('0xc')](_0x519ad2);}return null;};}function saveUpdates(_0x308211){return function(_0x331cd1){if(_0x331cd1){return _0x331cd1[_0x2b6f('0x12')](_0x308211)[_0x2b6f('0x13')](function(_0x31e31f){return _0x31e31f;});}return null;};}function removeEntity(_0x43092a){return function(_0x380dca){if(_0x380dca){return _0x380dca[_0x2b6f('0x14')]()[_0x2b6f('0x13')](function(){_0x43092a[_0x2b6f('0xa')](0xcc)[_0x2b6f('0xb')]();});}};}function handleEntityNotFound(_0xadbecc){return function(_0x4a12cc){if(!_0x4a12cc){_0xadbecc[_0x2b6f('0x9')](0x194);}return _0x4a12cc;};}function handleError(_0x34c74f,_0x28c5c2){_0x28c5c2=_0x28c5c2||0x1f4;return function(_0x1dfc00){logger[_0x2b6f('0x15')](_0x1dfc00['stack']);if(_0x1dfc00[_0x2b6f('0x16')]){delete _0x1dfc00[_0x2b6f('0x16')];}_0x34c74f[_0x2b6f('0xa')](_0x28c5c2)['send'](_0x1dfc00);};}function maskClientSecret(_0x33f1eb){return _['padEnd'](_0x33f1eb[_0x2b6f('0x17')](0x0,0x3),0x14,'*');}exports[_0x2b6f('0x18')]=function(_0x5814b4,_0x124883){var _0x4af4b8={},_0x158f6e={},_0x1f4d61={'count':0x0,'rows':[]};var _0x186269=_[_0x2b6f('0x19')](db[_0x2b6f('0x1a')][_0x2b6f('0x1b')],function(_0x56dbe3){return{'name':_0x56dbe3[_0x2b6f('0x1c')],'type':_0x56dbe3[_0x2b6f('0x1d')][_0x2b6f('0x1e')]};});_0x158f6e[_0x2b6f('0x1f')]=_[_0x2b6f('0x19')](_0x186269,_0x2b6f('0x16'));_0x158f6e['query']=_['keys'](_0x5814b4[_0x2b6f('0x20')]);_0x158f6e[_0x2b6f('0x21')]=_[_0x2b6f('0x22')](_0x158f6e['model'],_0x158f6e[_0x2b6f('0x20')]);_0x4af4b8[_0x2b6f('0x23')]=_[_0x2b6f('0x22')](_0x158f6e[_0x2b6f('0x1f')],qs[_0x2b6f('0x24')](_0x5814b4[_0x2b6f('0x20')][_0x2b6f('0x24')]));_0x4af4b8['attributes']=_0x4af4b8[_0x2b6f('0x23')]['length']?_0x4af4b8[_0x2b6f('0x23')]:_0x158f6e[_0x2b6f('0x1f')];if(!_0x5814b4[_0x2b6f('0x20')][_0x2b6f('0x25')](_0x2b6f('0x26'))){_0x4af4b8[_0x2b6f('0xd')]=qs[_0x2b6f('0xd')](_0x5814b4[_0x2b6f('0x20')][_0x2b6f('0xd')]);_0x4af4b8[_0x2b6f('0xf')]=qs[_0x2b6f('0xf')](_0x5814b4['query'][_0x2b6f('0xf')]);}_0x4af4b8[_0x2b6f('0x27')]=qs[_0x2b6f('0x28')](_0x5814b4[_0x2b6f('0x20')][_0x2b6f('0x28')]);_0x4af4b8[_0x2b6f('0x29')]=qs[_0x2b6f('0x21')](_[_0x2b6f('0x2a')](_0x5814b4['query'],_0x158f6e[_0x2b6f('0x21')]),_0x186269);if(_0x5814b4[_0x2b6f('0x20')][_0x2b6f('0x2b')]){_0x4af4b8['where']=_[_0x2b6f('0x2c')](_0x4af4b8[_0x2b6f('0x29')],{'$or':_[_0x2b6f('0x19')](_0x186269,function(_0x43b9f2){if(_0x43b9f2['type']!==_0x2b6f('0x2d')){var _0x1e55c9={};_0x1e55c9[_0x43b9f2['name']]={'$like':'%'+_0x5814b4['query'][_0x2b6f('0x2b')]+'%'};return _0x1e55c9;}})});}_0x4af4b8=_['merge']({},_0x4af4b8,_0x5814b4[_0x2b6f('0x2e')]);var _0x1a877a={'where':_0x4af4b8[_0x2b6f('0x29')]};return db[_0x2b6f('0x1a')][_0x2b6f('0xe')](_0x1a877a)['then'](function(_0x19b50c){_0x1f4d61[_0x2b6f('0xe')]=_0x19b50c;if(_0x5814b4[_0x2b6f('0x20')][_0x2b6f('0x2f')]){_0x4af4b8['include']=[{'all':!![]}];}return db[_0x2b6f('0x1a')][_0x2b6f('0x30')](_0x4af4b8);})['then'](function(_0x256d12){_0x1f4d61['rows']=_[_0x2b6f('0x19')](_0x256d12,function(_0x1a130e){if(_0x1a130e['service']===_0x2b6f('0x31')){var _0x1ac914=encryptor[_0x2b6f('0x32')](_0x1a130e['data3']);_0x1a130e[_0x2b6f('0x33')]=maskClientSecret(_0x1ac914);}return _0x1a130e;});return _0x1f4d61;})[_0x2b6f('0x13')](respondWithFilteredResult(_0x124883,_0x4af4b8))[_0x2b6f('0x34')](handleError(_0x124883,null));};exports[_0x2b6f('0x35')]=function(_0xca9842,_0x4bc6c3){var _0x3e8ede={'raw':!![],'where':{'id':_0xca9842['params']['id']}},_0x46f837={};_0x46f837[_0x2b6f('0x1f')]=_[_0x2b6f('0x36')](db[_0x2b6f('0x1a')]['rawAttributes']);_0x46f837['query']=_[_0x2b6f('0x36')](_0xca9842['query']);_0x46f837[_0x2b6f('0x21')]=_['intersection'](_0x46f837[_0x2b6f('0x1f')],_0x46f837[_0x2b6f('0x20')]);_0x3e8ede[_0x2b6f('0x23')]=_[_0x2b6f('0x22')](_0x46f837['model'],qs[_0x2b6f('0x24')](_0xca9842[_0x2b6f('0x20')][_0x2b6f('0x24')]));_0x3e8ede[_0x2b6f('0x23')]=_0x3e8ede[_0x2b6f('0x23')][_0x2b6f('0x37')]?_0x3e8ede[_0x2b6f('0x23')]:_0x46f837['model'];if(_0xca9842[_0x2b6f('0x20')][_0x2b6f('0x2f')]){_0x3e8ede[_0x2b6f('0x38')]=[{'all':!![]}];}_0x3e8ede=_[_0x2b6f('0x2c')]({},_0x3e8ede,_0xca9842[_0x2b6f('0x2e')]);return db[_0x2b6f('0x1a')][_0x2b6f('0x39')](_0x3e8ede)['then'](handleEntityNotFound(_0x4bc6c3,null))[_0x2b6f('0x13')](function(_0x5632ba){if(_0x5632ba[_0x2b6f('0x3a')]===_0x2b6f('0x31')){var _0x472f0a=encryptor[_0x2b6f('0x32')](_0x5632ba[_0x2b6f('0x33')]);_0x5632ba['data3']=maskClientSecret(_0x472f0a);}return _0x5632ba;})[_0x2b6f('0x13')](respondWithResult(_0x4bc6c3,null))[_0x2b6f('0x34')](handleError(_0x4bc6c3,null));};exports[_0x2b6f('0x3b')]=function(_0x15afc9,_0x2c60b1){if(!_0x15afc9[_0x2b6f('0x3c')][_0x2b6f('0x16')])throw new Error(_0x2b6f('0x3d'));if(!_0x15afc9['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0xa361e9=db['CloudProvider'][_0x2b6f('0x1b')][_0x2b6f('0x3a')][_0x2b6f('0x3e')];if(!_0xa361e9[_0x2b6f('0x3f')](_0x15afc9[_0x2b6f('0x3c')][_0x2b6f('0x3a')]))throw new Error(_0x2b6f('0x40')+_0xa361e9[_0x2b6f('0x41')](',\x20'));if(_0x15afc9[_0x2b6f('0x3c')]['service']===_0x2b6f('0x31')&&_0x15afc9[_0x2b6f('0x3c')][_0x2b6f('0x33')]){_0x15afc9[_0x2b6f('0x3c')]['data3']=encryptor[_0x2b6f('0x42')](_0x15afc9[_0x2b6f('0x3c')]['data3']);}return db[_0x2b6f('0x1a')][_0x2b6f('0x3b')](_0x15afc9['body'],{})['then'](respondWithResult(_0x2c60b1,0xc9))[_0x2b6f('0x34')](handleError(_0x2c60b1,null));};exports['update']=function(_0x4d7a02,_0x37be4a){if(_0x4d7a02['body']['id']){delete _0x4d7a02[_0x2b6f('0x3c')]['id'];}return db[_0x2b6f('0x1a')][_0x2b6f('0x39')]({'where':{'id':_0x4d7a02[_0x2b6f('0x43')]['id']}})[_0x2b6f('0x13')](handleEntityNotFound(_0x37be4a,null))[_0x2b6f('0x13')](function(_0x515bad){if(_0x515bad[_0x2b6f('0x3a')]===_0x2b6f('0x31')&&_0x4d7a02[_0x2b6f('0x3c')][_0x2b6f('0x33')]){_0x4d7a02[_0x2b6f('0x3c')][_0x2b6f('0x33')]=encryptor[_0x2b6f('0x42')](_0x4d7a02[_0x2b6f('0x3c')]['data3']);}return _0x515bad;})[_0x2b6f('0x13')](saveUpdates(_0x4d7a02[_0x2b6f('0x3c')],null))[_0x2b6f('0x13')](respondWithResult(_0x37be4a,null))['catch'](handleError(_0x37be4a,null));};exports['destroy']=function(_0x515fe3,_0x3dd3fe){return db[_0x2b6f('0x1a')][_0x2b6f('0x39')]({'where':{'id':_0x515fe3[_0x2b6f('0x43')]['id']}})[_0x2b6f('0x13')](handleEntityNotFound(_0x3dd3fe,null))['then'](removeEntity(_0x3dd3fe,null))[_0x2b6f('0x34')](handleError(_0x3dd3fe,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4c855f,_0x278715){return db['CloudProvider'][_0x2b6f('0x44')]({'where':{'id':_0x4c855f[_0x2b6f('0x43')]['id']},'raw':!![]})[_0x2b6f('0x13')](function(_0x3c1076){if(!_0x3c1076)return _0x278715[_0x2b6f('0x9')](0x194);return{'url':oauth[_0x2b6f('0x45')](_0x3c1076,_0x4c855f['user']['id'])};})['then'](respondWithResult(_0x278715,null))[_0x2b6f('0x34')](handleError(_0x278715,null));};exports[_0x2b6f('0x46')]=function(_0x3541ea,_0x579b53){var _0x10198e=_0x3541ea[_0x2b6f('0x3c')];var _0x1d293d;var _0x4ade4e;if(_0x10198e['error'])throw _0x10198e;redis[_0x2b6f('0x47')](_0x10198e[_0x2b6f('0x48')])[_0x2b6f('0x13')](function(_0xc5e55a){if(!_0xc5e55a)throw new Error(_0x2b6f('0x49'));_0x1d293d=JSON['parse'](_0xc5e55a);var _0x1f8b7f=Buffer[_0x2b6f('0x4a')](_0x10198e[_0x2b6f('0x48')],_0x2b6f('0x4b'))[_0x2b6f('0x4c')](_0x2b6f('0x4d'));_0x4ade4e=JSON[_0x2b6f('0x4e')](_0x1f8b7f);if(!oauth[_0x2b6f('0x4f')](_0x10198e[_0x2b6f('0x50')],_0x1d293d[_0x2b6f('0x51')]))throw new Error(_0x2b6f('0x52'));redis['del'](_0x10198e[_0x2b6f('0x48')]);return oauth[_0x2b6f('0x53')](_0x10198e[_0x2b6f('0x54')],_0x1d293d);})[_0x2b6f('0x13')](function(_0x337e97){_0x1d293d[_0x2b6f('0x55')]=_0x337e97['access_token'];_0x1d293d[_0x2b6f('0x56')]=_0x337e97[_0x2b6f('0x57')];return db[_0x2b6f('0x1a')]['update']({'data5':_0x1d293d[_0x2b6f('0x55')],'data6':_0x1d293d[_0x2b6f('0x56')]},{'where':{'id':_0x1d293d['id']}});})[_0x2b6f('0x13')](function(){oauth[_0x2b6f('0x58')](_0x1d293d);socket[_0x2b6f('0x59')](_0x2b6f('0x5a'),{'id':_0x4ade4e['id']});return;})[_0x2b6f('0x13')](respondWithStatusCode(_0x579b53,null))[_0x2b6f('0x34')](function(_0xaf8971){if(_0x4ade4e){socket[_0x2b6f('0x59')](_0x2b6f('0x5b'),{'id':_0x4ade4e['id']});}if(!_0x1d293d){logger[_0x2b6f('0x15')](_0x2b6f('0x5c'),_0xaf8971);return _0x579b53['status'](0x1f4)['send'](_0xaf8971[_0x2b6f('0x5d')]);}logger[_0x2b6f('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1d293d['id'],JSON['stringify'](_0xaf8971));});}; \ No newline at end of file +var _0x2d9c=['from','toString','id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','end','offset','count','limit','status','set','Content-Range','json','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','data3','catch','show','params','keys','filters','includeAll','find','service','MicrosoftAzure','decryptString','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse'];(function(_0x310cfb,_0x10b5ac){var _0x33735a=function(_0x1e1ae4){while(--_0x1e1ae4){_0x310cfb['push'](_0x310cfb['shift']());}};_0x33735a(++_0x10b5ac);}(_0x2d9c,0x1db));var _0xc2d9=function(_0x2d97d1,_0x5cc175){_0x2d97d1=_0x2d97d1-0x0;var _0xb912ef=_0x2d9c[_0x2d97d1];return _0xb912ef;};'use strict';var _=require('lodash');var Redis=require(_0xc2d9('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc2d9('0x1'));var config=require(_0xc2d9('0x2'));var logger=require('../../config/logger')(_0xc2d9('0x3'));var db=require(_0xc2d9('0x4'))['db'];var oauth=require(_0xc2d9('0x5'));config[_0xc2d9('0x6')]=_[_0xc2d9('0x7')](config[_0xc2d9('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2d9('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0xc2d9('0x6')]);function respondWithStatusCode(_0x108faa,_0x169f14){_0x169f14=_0x169f14||0xcc;return function(_0x2cc8ad){if(_0x2cc8ad){return _0x108faa[_0xc2d9('0x9')](_0x169f14);}return _0x108faa['status'](_0x169f14)[_0xc2d9('0xa')]();};}function respondWithResult(_0x51354f,_0x37da75){_0x37da75=_0x37da75||0xc8;return function(_0x5ebe70){if(_0x5ebe70){return _0x51354f['status'](_0x37da75)['json'](_0x5ebe70);}};}function respondWithFilteredResult(_0x3d2756,_0x1c0d9c){return function(_0x484d0c){if(_0x484d0c){var _0x35027b=typeof _0x1c0d9c[_0xc2d9('0xb')]==='undefined'&&typeof _0x1c0d9c['limit']==='undefined';var _0x380137=_0x484d0c['count'];var _0x407f57=_0x35027b?0x0:_0x1c0d9c['offset'];var _0x5c1d29=_0x35027b?_0x484d0c[_0xc2d9('0xc')]:_0x1c0d9c[_0xc2d9('0xb')]+_0x1c0d9c[_0xc2d9('0xd')];var _0x52a5d1;if(_0x5c1d29>=_0x380137){_0x5c1d29=_0x380137;_0x52a5d1=0xc8;}else{_0x52a5d1=0xce;}_0x3d2756[_0xc2d9('0xe')](_0x52a5d1);return _0x3d2756[_0xc2d9('0xf')](_0xc2d9('0x10'),_0x407f57+'-'+_0x5c1d29+'/'+_0x380137)[_0xc2d9('0x11')](_0x484d0c);}return null;};}function saveUpdates(_0x1ad084){return function(_0x32d9b7){if(_0x32d9b7){return _0x32d9b7[_0xc2d9('0x12')](_0x1ad084)[_0xc2d9('0x13')](function(_0x80edda){return _0x80edda;});}return null;};}function removeEntity(_0x2bc4a9){return function(_0x88b13d){if(_0x88b13d){return _0x88b13d[_0xc2d9('0x14')]()[_0xc2d9('0x13')](function(){_0x2bc4a9[_0xc2d9('0xe')](0xcc)[_0xc2d9('0xa')]();});}};}function handleEntityNotFound(_0x188d37){return function(_0xebd15b){if(!_0xebd15b){_0x188d37[_0xc2d9('0x9')](0x194);}return _0xebd15b;};}function handleError(_0x14d60b,_0x5b0b85){_0x5b0b85=_0x5b0b85||0x1f4;return function(_0x3d974d){logger[_0xc2d9('0x15')](_0x3d974d['stack']);if(_0x3d974d[_0xc2d9('0x16')]){delete _0x3d974d[_0xc2d9('0x16')];}_0x14d60b[_0xc2d9('0xe')](_0x5b0b85)[_0xc2d9('0x17')](_0x3d974d);};}function maskClientSecret(_0xfba82b){return _[_0xc2d9('0x18')](_0xfba82b[_0xc2d9('0x19')](0x0,0x3),0x14,'*');}exports[_0xc2d9('0x1a')]=function(_0x2db643,_0x110060){var _0x1dff47={},_0x3a20a3={},_0x7876aa={'count':0x0,'rows':[]};var _0x13f678=_[_0xc2d9('0x1b')](db[_0xc2d9('0x1c')][_0xc2d9('0x1d')],function(_0x324ae3){return{'name':_0x324ae3[_0xc2d9('0x1e')],'type':_0x324ae3[_0xc2d9('0x1f')][_0xc2d9('0x20')]};});_0x3a20a3[_0xc2d9('0x21')]=_[_0xc2d9('0x1b')](_0x13f678,_0xc2d9('0x16'));_0x3a20a3[_0xc2d9('0x22')]=_['keys'](_0x2db643[_0xc2d9('0x22')]);_0x3a20a3['filters']=_[_0xc2d9('0x23')](_0x3a20a3[_0xc2d9('0x21')],_0x3a20a3[_0xc2d9('0x22')]);_0x1dff47[_0xc2d9('0x24')]=_[_0xc2d9('0x23')](_0x3a20a3[_0xc2d9('0x21')],qs[_0xc2d9('0x25')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x25')]));_0x1dff47[_0xc2d9('0x24')]=_0x1dff47[_0xc2d9('0x24')][_0xc2d9('0x26')]?_0x1dff47[_0xc2d9('0x24')]:_0x3a20a3['model'];if(!_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x27')](_0xc2d9('0x28'))){_0x1dff47[_0xc2d9('0xd')]=qs[_0xc2d9('0xd')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0xd')]);_0x1dff47[_0xc2d9('0xb')]=qs[_0xc2d9('0xb')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0xb')]);}_0x1dff47[_0xc2d9('0x29')]=qs[_0xc2d9('0x2a')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x2a')]);_0x1dff47[_0xc2d9('0x2b')]=qs['filters'](_[_0xc2d9('0x2c')](_0x2db643['query'],_0x3a20a3['filters']),_0x13f678);if(_0x2db643[_0xc2d9('0x22')]['filter']){_0x1dff47[_0xc2d9('0x2b')]=_[_0xc2d9('0x2d')](_0x1dff47[_0xc2d9('0x2b')],{'$or':_[_0xc2d9('0x1b')](_0x13f678,function(_0x7089d5){if(_0x7089d5['type']!==_0xc2d9('0x2e')){var _0x242e07={};_0x242e07[_0x7089d5[_0xc2d9('0x16')]]={'$like':'%'+_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x2f')]+'%'};return _0x242e07;}})});}_0x1dff47=_['merge']({},_0x1dff47,_0x2db643[_0xc2d9('0x30')]);var _0x4e363b={'where':_0x1dff47[_0xc2d9('0x2b')]};return db['CloudProvider']['count'](_0x4e363b)['then'](function(_0x102587){_0x7876aa['count']=_0x102587;if(_0x2db643[_0xc2d9('0x22')]['includeAll']){_0x1dff47['include']=[{'all':!![]}];}return db[_0xc2d9('0x1c')][_0xc2d9('0x31')](_0x1dff47);})[_0xc2d9('0x13')](function(_0x4a6243){_0x7876aa['rows']=_[_0xc2d9('0x1b')](_0x4a6243,function(_0x28f516){if(_0x28f516['service']==='MicrosoftAzure'){var _0x3bf291=encryptor['decryptString'](_0x28f516[_0xc2d9('0x32')]);_0x28f516[_0xc2d9('0x32')]=maskClientSecret(_0x3bf291);}return _0x28f516;});return _0x7876aa;})[_0xc2d9('0x13')](respondWithFilteredResult(_0x110060,_0x1dff47))[_0xc2d9('0x33')](handleError(_0x110060,null));};exports[_0xc2d9('0x34')]=function(_0x4a586c,_0x578303){var _0x1c1bad={'raw':!![],'where':{'id':_0x4a586c[_0xc2d9('0x35')]['id']}},_0x449f4e={};_0x449f4e[_0xc2d9('0x21')]=_[_0xc2d9('0x36')](db[_0xc2d9('0x1c')]['rawAttributes']);_0x449f4e[_0xc2d9('0x22')]=_[_0xc2d9('0x36')](_0x4a586c['query']);_0x449f4e[_0xc2d9('0x37')]=_[_0xc2d9('0x23')](_0x449f4e[_0xc2d9('0x21')],_0x449f4e[_0xc2d9('0x22')]);_0x1c1bad[_0xc2d9('0x24')]=_[_0xc2d9('0x23')](_0x449f4e[_0xc2d9('0x21')],qs[_0xc2d9('0x25')](_0x4a586c[_0xc2d9('0x22')][_0xc2d9('0x25')]));_0x1c1bad['attributes']=_0x1c1bad[_0xc2d9('0x24')][_0xc2d9('0x26')]?_0x1c1bad[_0xc2d9('0x24')]:_0x449f4e[_0xc2d9('0x21')];if(_0x4a586c[_0xc2d9('0x22')][_0xc2d9('0x38')]){_0x1c1bad['include']=[{'all':!![]}];}_0x1c1bad=_[_0xc2d9('0x2d')]({},_0x1c1bad,_0x4a586c[_0xc2d9('0x30')]);return db[_0xc2d9('0x1c')][_0xc2d9('0x39')](_0x1c1bad)[_0xc2d9('0x13')](handleEntityNotFound(_0x578303,null))[_0xc2d9('0x13')](function(_0x321e35){if(_0x321e35[_0xc2d9('0x3a')]===_0xc2d9('0x3b')){var _0x3a5a2a=encryptor[_0xc2d9('0x3c')](_0x321e35['data3']);_0x321e35['data3']=maskClientSecret(_0x3a5a2a);}return _0x321e35;})[_0xc2d9('0x13')](respondWithResult(_0x578303,null))['catch'](handleError(_0x578303,null));};exports[_0xc2d9('0x3d')]=function(_0x10e3ab,_0x1aa50a){if(!_0x10e3ab['body'][_0xc2d9('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x3a')])throw new Error(_0xc2d9('0x3f'));var _0xe35171=db[_0xc2d9('0x1c')][_0xc2d9('0x1d')][_0xc2d9('0x3a')][_0xc2d9('0x40')];if(!_0xe35171[_0xc2d9('0x41')](_0x10e3ab['body'][_0xc2d9('0x3a')]))throw new Error(_0xc2d9('0x42')+_0xe35171[_0xc2d9('0x43')](',\x20'));if(_0x10e3ab[_0xc2d9('0x3e')]['service']===_0xc2d9('0x3b')&&_0x10e3ab[_0xc2d9('0x3e')]['data3']){_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x32')]=encryptor[_0xc2d9('0x44')](_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x32')]);}return db['CloudProvider'][_0xc2d9('0x3d')](_0x10e3ab[_0xc2d9('0x3e')],{})[_0xc2d9('0x13')](respondWithResult(_0x1aa50a,0xc9))[_0xc2d9('0x33')](handleError(_0x1aa50a,null));};exports[_0xc2d9('0x12')]=function(_0x1c9a02,_0x999125){if(_0x1c9a02['body']['id']){delete _0x1c9a02[_0xc2d9('0x3e')]['id'];}return db[_0xc2d9('0x1c')][_0xc2d9('0x39')]({'where':{'id':_0x1c9a02['params']['id']}})[_0xc2d9('0x13')](handleEntityNotFound(_0x999125,null))['then'](function(_0x3d611e){if(_0x3d611e[_0xc2d9('0x3a')]===_0xc2d9('0x3b')&&_0x1c9a02['body'][_0xc2d9('0x32')]){_0x1c9a02[_0xc2d9('0x3e')][_0xc2d9('0x32')]=encryptor[_0xc2d9('0x44')](_0x1c9a02[_0xc2d9('0x3e')][_0xc2d9('0x32')]);}return _0x3d611e;})[_0xc2d9('0x13')](saveUpdates(_0x1c9a02['body'],null))[_0xc2d9('0x13')](respondWithResult(_0x999125,null))[_0xc2d9('0x33')](handleError(_0x999125,null));};exports[_0xc2d9('0x14')]=function(_0x206055,_0x1bb2ab){return db[_0xc2d9('0x1c')][_0xc2d9('0x39')]({'where':{'id':_0x206055[_0xc2d9('0x35')]['id']}})['then'](handleEntityNotFound(_0x1bb2ab,null))['then'](removeEntity(_0x1bb2ab,null))['catch'](handleError(_0x1bb2ab,null));};exports[_0xc2d9('0x45')]=function(_0x155eb2,_0x5695d4){return db[_0xc2d9('0x1c')][_0xc2d9('0x46')]({'where':{'id':_0x155eb2['params']['id']},'raw':!![]})[_0xc2d9('0x13')](function(_0x3d361f){if(!_0x3d361f)return _0x5695d4[_0xc2d9('0x9')](0x194);return{'url':oauth[_0xc2d9('0x47')](_0x3d361f,_0x155eb2[_0xc2d9('0x48')]['id'])};})[_0xc2d9('0x13')](respondWithResult(_0x5695d4,null))[_0xc2d9('0x33')](handleError(_0x5695d4,null));};exports['oauth2MicrosoftCallback']=function(_0x36723e,_0x15b328){var _0x35bcf2=_0x36723e[_0xc2d9('0x3e')];var _0x28e773;var _0xe4a535;if(_0x35bcf2[_0xc2d9('0x15')])throw _0x35bcf2;redis[_0xc2d9('0x49')](_0x35bcf2[_0xc2d9('0x4a')])[_0xc2d9('0x13')](function(_0x37997f){if(!_0x37997f)throw new Error(_0xc2d9('0x4b'));_0x28e773=JSON[_0xc2d9('0x4c')](_0x37997f);var _0x1b5338=Buffer[_0xc2d9('0x4d')](_0x35bcf2['state'],'base64')[_0xc2d9('0x4e')]('ascii');_0xe4a535=JSON[_0xc2d9('0x4c')](_0x1b5338);if(!oauth['isValidIdToken'](_0x35bcf2[_0xc2d9('0x4f')],_0x28e773['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x35bcf2['state']);return oauth[_0xc2d9('0x50')](_0x35bcf2['code'],_0x28e773);})['then'](function(_0x3111a0){_0x28e773[_0xc2d9('0x51')]=_0x3111a0[_0xc2d9('0x52')];_0x28e773[_0xc2d9('0x53')]=_0x3111a0['refresh_token'];return db[_0xc2d9('0x1c')][_0xc2d9('0x12')]({'data5':_0x28e773[_0xc2d9('0x51')],'data6':_0x28e773['data6']},{'where':{'id':_0x28e773['id']}});})[_0xc2d9('0x13')](function(){oauth[_0xc2d9('0x54')](_0x28e773);socket[_0xc2d9('0x55')](_0xc2d9('0x56'),{'id':_0xe4a535['id']});return;})['then'](respondWithStatusCode(_0x15b328,null))['catch'](function(_0x58181e){if(_0xe4a535){socket[_0xc2d9('0x55')](_0xc2d9('0x57'),{'id':_0xe4a535['id']});}if(!_0x28e773){logger[_0xc2d9('0x15')](_0xc2d9('0x58'),_0x58181e);return _0x15b328[_0xc2d9('0xe')](0x1f4)[_0xc2d9('0x17')](_0x58181e[_0xc2d9('0x59')]);}logger['error'](_0xc2d9('0x5a'),_0x28e773['id'],JSON[_0xc2d9('0x5b')](_0x58181e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 66ae21e..bb8e51d 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2658=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x234d62,_0x39aafc){var _0x4f5ae3=function(_0x4816a9){while(--_0x4816a9){_0x234d62['push'](_0x234d62['shift']());}};_0x4f5ae3(++_0x39aafc);}(_0x2658,0xa8));var _0x8265=function(_0x489959,_0x55c7d5){_0x489959=_0x489959-0x0;var _0x43f533=_0x2658[_0x489959];return _0x43f533;};'use strict';var _=require(_0x8265('0x0'));var util=require(_0x8265('0x1'));var logger=require(_0x8265('0x2'))(_0x8265('0x3'));var moment=require(_0x8265('0x4'));var BPromise=require('bluebird');var rp=require(_0x8265('0x5'));var fs=require('fs');var path=require(_0x8265('0x6'));var rimraf=require(_0x8265('0x7'));var config=require(_0x8265('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x8265('0x9')]=function(_0x44a05e,_0xb00032){return _0x44a05e[_0x8265('0xa')](_0x8265('0xb'),attributes,{'tableName':_0x8265('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf920=['cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x59117e,_0x444da3){var _0x59cf49=function(_0x53f9ba){while(--_0x53f9ba){_0x59117e['push'](_0x59117e['shift']());}};_0x59cf49(++_0x444da3);}(_0xf920,0x1b9));var _0x0f92=function(_0x4c1ad8,_0x55e28d){_0x4c1ad8=_0x4c1ad8-0x0;var _0x2c617b=_0xf920[_0x4c1ad8];return _0x2c617b;};'use strict';var _=require(_0x0f92('0x0'));var util=require(_0x0f92('0x1'));var logger=require(_0x0f92('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f92('0x3'));var rp=require(_0x0f92('0x4'));var fs=require('fs');var path=require(_0x0f92('0x5'));var rimraf=require(_0x0f92('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f92('0x7'));module[_0x0f92('0x8')]=function(_0x4d50e0,_0x58570a){return _0x4d50e0['define'](_0x0f92('0x9'),attributes,{'tableName':_0x0f92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 2d6c077..dcdac19 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb70c=['openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','redirect_uri','scope','state','nonce','prompt','login','map','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','data4','decryptString','data5','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x5847,_0xa770eb){var _0x273c96=function(_0x396df9){while(--_0x396df9){_0x5847['push'](_0x5847['shift']());}};_0x273c96(++_0xa770eb);}(_0xb70c,0x1d4));var _0xcb70=function(_0x3cb21e,_0x11849a){_0x3cb21e=_0x3cb21e-0x0;var _0xeacd6a=_0xb70c[_0x3cb21e];return _0xeacd6a;};'use strict';var _=require('lodash');var crypto=require(_0xcb70('0x0'));var jwt=require(_0xcb70('0x1'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xcb70('0x2'));var util=require(_0xcb70('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0xcb70('0x4'));var logger=require(_0xcb70('0x5'))(_0xcb70('0x6'));var schedule=require(_0xcb70('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcb70('0x8')](config[_0xcb70('0x9')],{'host':_0xcb70('0xa'),'port':0x18eb});var redis=new Redis(config[_0xcb70('0x9')]);var MICROSOFT_AUTH_URL=_0xcb70('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xcb70('0xc'),'profile',_0xcb70('0xd'),'offline_access',_0xcb70('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0xcb70('0xf')],'Dynamics365':['openid',_0xcb70('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xcb70('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x237e2f){var _0x45dbca=_['map'](AZURE_AUTH_SCOPES[_0x237e2f[_0xcb70('0x12')]]);if(_0x237e2f[_0xcb70('0x12')]===_0xcb70('0x13'))_0x45dbca['push'](_0x237e2f[_0xcb70('0x14')]+_0xcb70('0x15'));return _0x45dbca[_0xcb70('0x16')]('\x20');}function getAccessTokenScope(_0x2c7d76){if(_0x2c7d76[_0xcb70('0x12')]===_0xcb70('0x17'))return _0xcb70('0xe');if(_0x2c7d76[_0xcb70('0x12')]===_0xcb70('0x13'))return _0x2c7d76[_0xcb70('0x14')]+_0xcb70('0x15');}function generateMicrosoftAuthorizationUrl(_0xda8786,_0x3bd582){var _0x45fe1b=MICROSOFT_AUTH_URL[_0xcb70('0x18')](_0xcb70('0x19'),_0xda8786[_0xcb70('0x1a')]);var _0xb2f8b5=[_0xcb70('0x1b'),_0xcb70('0x1c')];var _0x5cdf27=Buffer[_0xcb70('0x1d')](JSON[_0xcb70('0x1e')]({'id':_0x3bd582}))['toString'](_0xcb70('0x1f'));var _0x34dfd8=crypto[_0xcb70('0x20')](0x10)[_0xcb70('0x21')](_0xcb70('0x22'));var _0x3ddee7=getAuthorizationScopes(_0xda8786);var _0x18df9b=[{'key':_0xcb70('0x23'),'value':_0xda8786[_0xcb70('0x24')]},{'key':'response_type','value':encodeURIComponent(_0xb2f8b5['join']('\x20'))},{'key':_0xcb70('0x25'),'value':_0xda8786['data4']},{'key':'response_mode','value':'form_post'},{'key':_0xcb70('0x26'),'value':encodeURIComponent(_0x3ddee7)},{'key':_0xcb70('0x27'),'value':_0x5cdf27},{'key':_0xcb70('0x28'),'value':_0x34dfd8},{'key':_0xcb70('0x29'),'value':_0xcb70('0x2a')}];var _0x19c29f=_0x45fe1b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xcb70('0x2b')](_0x18df9b,function(_0x52876b){return _0x52876b[_0xcb70('0x2c')]+'='+_0x52876b[_0xcb70('0x2d')];})[_0xcb70('0x16')]('&');_0xda8786[_0xcb70('0x2e')]={'issuer':_0x45fe1b[_0xcb70('0x18')](_0xcb70('0x2f'),''),'audience':_0xda8786[_0xcb70('0x24')],'state':_0x5cdf27,'nonce':_0x34dfd8};redis['set'](_0x5cdf27,JSON['stringify'](_0xda8786));return _0x19c29f;}function isValidIdToken(_0x200747,_0x371e9d){try{var _0x19ef7a=jwt[_0xcb70('0x30')](_0x200747,{'complete':!![]});var _0x419100=_0x19ef7a[_0xcb70('0x31')];if(_0x419100[_0xcb70('0x32')]!==_0x371e9d[_0xcb70('0x33')])return![];if(_0x419100[_0xcb70('0x34')]!==_0x371e9d[_0xcb70('0x35')])return![];if(_0x419100[_0xcb70('0x28')]!==_0x371e9d[_0xcb70('0x28')])return![];if(moment()[_0xcb70('0x36')](moment[_0xcb70('0x37')](_0x419100[_0xcb70('0x38')])))return![];return!![];}catch(_0x1b4ba7){throw _0x1b4ba7;}}function refreshOauth2MicrosoftAccessToken(_0xa8d181){return Promise[_0xcb70('0x39')]()[_0xcb70('0x3a')](function(){if(_0xa8d181[_0xcb70('0x3b')])return _0xa8d181;return db[_0xcb70('0x3c')][_0xcb70('0x3d')]({'where':{'id':_0xa8d181['id']},'raw':!![]});})[_0xcb70('0x3a')](function(_0x5640a4){var _0x45664={'grant_type':'refresh_token','refresh_token':_0x5640a4[_0xcb70('0x3e')],'scope':getAccessTokenScope(_0x5640a4),'redirect_uri':_0x5640a4[_0xcb70('0x3f')],'client_id':_0x5640a4[_0xcb70('0x24')],'client_secret':encryptor[_0xcb70('0x40')](_0x5640a4[_0xcb70('0x3b')])};var _0x2bbb3e={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xcb70('0x18')](_0xcb70('0x19'),_0x5640a4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x45664,'json':!![]};return rp(_0x2bbb3e);})[_0xcb70('0x3a')](function(_0x224dd8){_0xa8d181[_0xcb70('0x41')]=_0x224dd8[_0xcb70('0x42')];_0xa8d181[_0xcb70('0x3e')]=_0x224dd8[_0xcb70('0x43')];return db['CloudProvider'][_0xcb70('0x44')]({'data5':_0xa8d181['data5'],'data6':_0xa8d181['data6']},{'where':{'id':_0xa8d181['id']}});})[_0xcb70('0x3a')](function(){return _0xa8d181;})[_0xcb70('0x45')](function(_0x5240a8){logger[_0xcb70('0x46')](_0xcb70('0x47'),_0xa8d181['id'],_0x5240a8);});}function getOauth2MicrosoftAccessToken(_0x346be6,_0x4ba0f8){var _0x2db970={'grant_type':_0xcb70('0x48'),'code':_0x346be6,'scope':getAccessTokenScope(_0x4ba0f8),'redirect_uri':_0x4ba0f8[_0xcb70('0x3f')],'client_id':_0x4ba0f8[_0xcb70('0x24')],'client_secret':encryptor['decryptString'](_0x4ba0f8[_0xcb70('0x3b')])};var _0x2124b2={'method':_0xcb70('0x49'),'uri':MICROSOFT_AUTH_URL[_0xcb70('0x18')](_0xcb70('0x19'),_0x4ba0f8[_0xcb70('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2db970,'json':!![]};return rp(_0x2124b2);}function startRefreshInterval(_0x34cff8){var _0x58e08c=schedule[_0xcb70('0x4a')];if(_0x58e08c[_0x34cff8['id']])clearInterval(_0x58e08c[_0x34cff8['id']]);_0x58e08c[_0x34cff8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xcb70('0x4b')](this,{'id':_0x34cff8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x58e08c;}function startAllRefreshIntervals(){return db[_0xcb70('0x3c')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xcb70('0x3a')](function(_0x32a0bb){var _0x222752=_0x32a0bb[_0xcb70('0x2b')](function(_0xf33627){return refreshOauth2MicrosoftAccessToken(_0xf33627)[_0xcb70('0x3a')](function(_0x22f8ea){startRefreshInterval(_0x22f8ea);});});return Promise[_0xcb70('0x4c')](_0x222752);})[_0xcb70('0x45')](function(_0x3cd8b8){var _0x189dad=_0x3cd8b8?util[_0xcb70('0x4d')](_0x3cd8b8,{'showHidden':![],'depth':null}):'';logger[_0xcb70('0x46')](_0xcb70('0x4e'),_0x189dad);});}module[_0xcb70('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x028d=['../../components/encryptor','../../config/logger','../../mysqldb','defaults','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','data7','/.default','join','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','code','from','stringify','toString','base64','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','map','value','oauth2/','set','iss','issuer','aud','audience','exp','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util'];(function(_0x4525fc,_0x1ef6d7){var _0x2be4de=function(_0x5b0757){while(--_0x5b0757){_0x4525fc['push'](_0x4525fc['shift']());}};_0x2be4de(++_0x1ef6d7);}(_0x028d,0x1b6));var _0xd028=function(_0x3d9390,_0x4e6d7b){_0x3d9390=_0x3d9390-0x0;var _0x4e4cb4=_0x028d[_0x3d9390];return _0x4e4cb4;};'use strict';var _=require('lodash');var crypto=require(_0xd028('0x0'));var jwt=require(_0xd028('0x1'));var moment=require(_0xd028('0x2'));var Redis=require(_0xd028('0x3'));var rp=require(_0xd028('0x4'));var util=require(_0xd028('0x5'));var encryptor=require(_0xd028('0x6'));var config=require('../../config/environment');var logger=require(_0xd028('0x7'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xd028('0x8'))['db'];config['redis']=_[_0xd028('0x9')](config['redis'],{'host':_0xd028('0xa'),'port':0x18eb});var redis=new Redis(config[_0xd028('0xb')]);var MICROSOFT_AUTH_URL=_0xd028('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd028('0xd'),_0xd028('0xe'),_0xd028('0xf'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xd028('0x10'),_0xd028('0x11')],'Dynamics365':[_0xd028('0xd'),_0xd028('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xd028('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xd028('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2283b3){var _0x5cfb34=_['map'](AZURE_AUTH_SCOPES[_0x2283b3['type']]);if(_0x2283b3[_0xd028('0x15')]===_0xd028('0x16'))_0x5cfb34[_0xd028('0x17')](_0x2283b3[_0xd028('0x18')]+_0xd028('0x19'));return _0x5cfb34[_0xd028('0x1a')]('\x20');}function getAccessTokenScope(_0x27fbd2){if(_0x27fbd2[_0xd028('0x15')]==='Outlook365')return _0xd028('0x1b');if(_0x27fbd2['type']===_0xd028('0x16'))return _0x27fbd2[_0xd028('0x18')]+_0xd028('0x19');}function generateMicrosoftAuthorizationUrl(_0x3fd50e,_0x4ad8c3){var _0x5e831e=MICROSOFT_AUTH_URL[_0xd028('0x1c')](_0xd028('0x1d'),_0x3fd50e['data2']);var _0x20d1c7=[_0xd028('0x1e'),'id_token'];var _0x2d9648=Buffer[_0xd028('0x1f')](JSON[_0xd028('0x20')]({'id':_0x4ad8c3}))[_0xd028('0x21')](_0xd028('0x22'));var _0x529455=crypto['randomBytes'](0x10)['toString']('hex');var _0x4405f3=getAuthorizationScopes(_0x3fd50e);var _0x4e6b1=[{'key':_0xd028('0x23'),'value':_0x3fd50e[_0xd028('0x24')]},{'key':_0xd028('0x25'),'value':encodeURIComponent(_0x20d1c7[_0xd028('0x1a')]('\x20'))},{'key':_0xd028('0x26'),'value':_0x3fd50e[_0xd028('0x27')]},{'key':_0xd028('0x28'),'value':'form_post'},{'key':_0xd028('0x29'),'value':encodeURIComponent(_0x4405f3)},{'key':_0xd028('0x2a'),'value':_0x2d9648},{'key':_0xd028('0x2b'),'value':_0x529455},{'key':_0xd028('0x2c'),'value':'login'}];var _0x90e917=_0x5e831e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd028('0x2d')](_0x4e6b1,function(_0x1845c3){return _0x1845c3['key']+'='+_0x1845c3[_0xd028('0x2e')];})[_0xd028('0x1a')]('&');_0x3fd50e['oauth2Claims']={'issuer':_0x5e831e[_0xd028('0x1c')](_0xd028('0x2f'),''),'audience':_0x3fd50e[_0xd028('0x24')],'state':_0x2d9648,'nonce':_0x529455};redis[_0xd028('0x30')](_0x2d9648,JSON[_0xd028('0x20')](_0x3fd50e));return _0x90e917;}function isValidIdToken(_0xa6ddd0,_0x210454){try{var _0x24b44f=jwt['decode'](_0xa6ddd0,{'complete':!![]});var _0x3aa511=_0x24b44f['payload'];if(_0x3aa511[_0xd028('0x31')]!==_0x210454[_0xd028('0x32')])return![];if(_0x3aa511[_0xd028('0x33')]!==_0x210454[_0xd028('0x34')])return![];if(_0x3aa511['nonce']!==_0x210454[_0xd028('0x2b')])return![];if(moment()['isAfter'](moment['unix'](_0x3aa511[_0xd028('0x35')])))return![];return!![];}catch(_0x2504d5){throw _0x2504d5;}}function refreshOauth2MicrosoftAccessToken(_0x47c9a6){return Promise['resolve']()[_0xd028('0x36')](function(){if(_0x47c9a6[_0xd028('0x37')])return _0x47c9a6;return db[_0xd028('0x38')]['findOne']({'where':{'id':_0x47c9a6['id']},'raw':!![]});})[_0xd028('0x36')](function(_0xa09c4e){var _0x55c3ef={'grant_type':_0xd028('0x39'),'refresh_token':_0xa09c4e[_0xd028('0x3a')],'scope':getAccessTokenScope(_0xa09c4e),'redirect_uri':_0xa09c4e[_0xd028('0x27')],'client_id':_0xa09c4e[_0xd028('0x24')],'client_secret':encryptor[_0xd028('0x3b')](_0xa09c4e[_0xd028('0x37')])};var _0xdc9589={'method':_0xd028('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd028('0x1d'),_0xa09c4e[_0xd028('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55c3ef,'json':!![]};return rp(_0xdc9589);})[_0xd028('0x36')](function(_0xa17273){_0x47c9a6[_0xd028('0x3e')]=_0xa17273[_0xd028('0x3f')];_0x47c9a6[_0xd028('0x3a')]=_0xa17273[_0xd028('0x39')];return db[_0xd028('0x38')][_0xd028('0x40')]({'data5':_0x47c9a6[_0xd028('0x3e')],'data6':_0x47c9a6['data6']},{'where':{'id':_0x47c9a6['id']}});})[_0xd028('0x36')](function(){return _0x47c9a6;})[_0xd028('0x41')](function(_0x325adc){logger[_0xd028('0x42')](_0xd028('0x43'),_0x47c9a6['id'],_0x325adc);});}function getOauth2MicrosoftAccessToken(_0x5bc529,_0x35bf33){var _0x192138={'grant_type':_0xd028('0x44'),'code':_0x5bc529,'scope':getAccessTokenScope(_0x35bf33),'redirect_uri':_0x35bf33[_0xd028('0x27')],'client_id':_0x35bf33[_0xd028('0x24')],'client_secret':encryptor[_0xd028('0x3b')](_0x35bf33[_0xd028('0x37')])};var _0x3ebd9a={'method':_0xd028('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd028('0x1c')]('{TENANT_ID}',_0x35bf33[_0xd028('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x192138,'json':!![]};return rp(_0x3ebd9a);}function startRefreshInterval(_0x5638f1){var _0x3404a8=schedule[_0xd028('0x45')];if(_0x3404a8[_0x5638f1['id']])clearInterval(_0x3404a8[_0x5638f1['id']]);_0x3404a8[_0x5638f1['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5638f1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3404a8;}function startAllRefreshIntervals(){return db[_0xd028('0x38')][_0xd028('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd028('0x36')](function(_0x54742){var _0x44e220=_0x54742[_0xd028('0x2d')](function(_0x1365d4){return refreshOauth2MicrosoftAccessToken(_0x1365d4)[_0xd028('0x36')](function(_0x15c1cd){startRefreshInterval(_0x15c1cd);});});return Promise['all'](_0x44e220);})[_0xd028('0x41')](function(_0x5f0ea8){var _0x151a73=_0x5f0ea8?util[_0xd028('0x47')](_0x5f0ea8,{'showHidden':![],'depth':null}):'';logger[_0xd028('0x42')](_0xd028('0x48'),_0x151a73);});}module[_0xd028('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 81cfb65..0909705 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3646=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','info','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3646,0x15f));var _0x6364=function(_0x4cb655,_0x2db09f){_0x4cb655=_0x4cb655-0x0;var _0x406fb0=_0x3646[_0x4cb655];return _0x406fb0;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var moment=require(_0x6364('0x2'));var BPromise=require(_0x6364('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))(_0x6364('0x8'));var config=require(_0x6364('0x9'));var jayson=require(_0x6364('0xa'));var client=jayson[_0x6364('0xb')][_0x6364('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x681d9c,_0x256949,_0x520a3d){return new BPromise(function(_0x1be238,_0x24706f){return client[_0x6364('0xd')](_0x681d9c,_0x520a3d)[_0x6364('0xe')](function(_0x4945cd){logger['info']('CloudProvider,\x20%s,\x20%s',_0x256949,_0x6364('0xf'));logger[_0x6364('0x10')](_0x6364('0x11'),_0x256949,_0x6364('0xf'),JSON[_0x6364('0x12')](_0x4945cd));if(_0x4945cd[_0x6364('0x13')]){if(_0x4945cd[_0x6364('0x13')]['code']===0x1f4){logger[_0x6364('0x13')](_0x6364('0x14'),_0x256949,_0x4945cd[_0x6364('0x13')]['message']);return _0x24706f(_0x4945cd[_0x6364('0x13')][_0x6364('0x15')]);}logger[_0x6364('0x13')](_0x6364('0x14'),_0x256949,_0x4945cd['error'][_0x6364('0x15')]);return _0x1be238(_0x4945cd['error'][_0x6364('0x15')]);}else{logger[_0x6364('0x16')](_0x6364('0x14'),_0x256949,'request\x20sent');_0x1be238(_0x4945cd[_0x6364('0x17')][_0x6364('0x15')]);}})[_0x6364('0x18')](function(_0x363fd7){logger[_0x6364('0x13')](_0x6364('0x14'),_0x256949,_0x363fd7);_0x24706f(_0x363fd7);});});} \ No newline at end of file +var _0xb6a6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x5c3649,_0x51f4e3){_0x5c3649=_0x5c3649-0x0;var _0x57ce71=_0xb6a6[_0x5c3649];return _0x57ce71;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b6a('0x2'));var fs=require('fs');var Redis=require(_0x6b6a('0x3'));var db=require(_0x6b6a('0x4'))['db'];var utils=require(_0x6b6a('0x5'));var logger=require(_0x6b6a('0x6'))('rpc');var config=require(_0x6b6a('0x7'));var jayson=require(_0x6b6a('0x8'));var client=jayson[_0x6b6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad201,_0x1895f7,_0x59e90c){return new BPromise(function(_0x43f878,_0x15ccc9){return client['request'](_0x3ad201,_0x59e90c)[_0x6b6a('0xa')](function(_0x58ff98){logger[_0x6b6a('0xb')](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1895f7,_0x6b6a('0xd'),JSON[_0x6b6a('0xe')](_0x58ff98));if(_0x58ff98['error']){if(_0x58ff98['error'][_0x6b6a('0xf')]===0x1f4){logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x15ccc9(_0x58ff98['error'][_0x6b6a('0x11')]);}logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x43f878(_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);}else{logger['info'](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));_0x43f878(_0x58ff98['result'][_0x6b6a('0x11')]);}})[_0x6b6a('0x12')](function(_0x126189){logger[_0x6b6a('0x10')](_0x6b6a('0xc'),_0x1895f7,_0x126189);_0x15ccc9(_0x126189);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index efadbfd..5be8123 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1e70b0,_0x47c603){var _0x5e86d7=function(_0x1c17e1){while(--_0x1c17e1){_0x1e70b0['push'](_0x1e70b0['shift']());}};_0x5e86d7(++_0x47c603);}(_0xadb5,0xad));var _0x5adb=function(_0x514a50,_0x22e173){_0x514a50=_0x514a50-0x0;var _0x4b086f=_0xadb5[_0x514a50];return _0x4b086f;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x1261,0x144));var _0x1126=function(_0x165718,_0x49ae0b){_0x165718=_0x165718-0x0;var _0x2e57b2=_0x1261[_0x165718];return _0x2e57b2;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 222e58f..ddff57d 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x238f=['sequelize','exports','STRING','name'];(function(_0x3fe0ec,_0x51e29e){var _0x1ce57b=function(_0x3635f3){while(--_0x3635f3){_0x3fe0ec['push'](_0x3fe0ec['shift']());}};_0x1ce57b(++_0x51e29e);}(_0x238f,0x1d4));var _0xf238=function(_0xa40d71,_0x4098b4){_0xa40d71=_0xa40d71-0x0;var _0x26a223=_0x238f[_0xa40d71];return _0x26a223;};'use strict';var Sequelize=require(_0xf238('0x0'));module[_0xf238('0x1')]={'name':{'type':Sequelize[_0xf238('0x2')],'unique':_0xf238('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf238('0x2')]},'companyId':{'type':Sequelize[_0xf238('0x2')]},'website':{'type':Sequelize[_0xf238('0x2')]},'phone':{'type':Sequelize[_0xf238('0x2')]},'fax':{'type':Sequelize[_0xf238('0x2')]},'type':{'type':Sequelize[_0xf238('0x2')]},'street':{'type':Sequelize[_0xf238('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf238('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf238('0x2')]},'sStreet':{'type':Sequelize[_0xf238('0x2')]},'sPostalCode':{'type':Sequelize[_0xf238('0x2')]},'sCity':{'type':Sequelize[_0xf238('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf238('0x2')]}}; \ No newline at end of file +var _0x5b7c=['STRING','name','exports'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x5b7c,0x107));var _0xc5b7=function(_0x4036aa,_0x514bb5){_0x4036aa=_0x4036aa-0x0;var _0x429d34=_0x5b7c[_0x4036aa];return _0x429d34;};'use strict';var Sequelize=require('sequelize');module[_0xc5b7('0x0')]={'name':{'type':Sequelize[_0xc5b7('0x1')],'unique':_0xc5b7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc5b7('0x1')]},'companyId':{'type':Sequelize[_0xc5b7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc5b7('0x1')]},'type':{'type':Sequelize[_0xc5b7('0x1')]},'street':{'type':Sequelize[_0xc5b7('0x1')]},'postalCode':{'type':Sequelize[_0xc5b7('0x1')]},'city':{'type':Sequelize[_0xc5b7('0x1')]},'country':{'type':Sequelize[_0xc5b7('0x1')]},'email':{'type':Sequelize[_0xc5b7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc5b7('0x1')]},'sStreet':{'type':Sequelize[_0xc5b7('0x1')]},'sPostalCode':{'type':Sequelize[_0xc5b7('0x1')]},'sCity':{'type':Sequelize[_0xc5b7('0x1')]},'sCountry':{'type':Sequelize[_0xc5b7('0x1')]},'description':{'type':Sequelize[_0xc5b7('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index dc9378a..fefc468 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfd3=['model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','params','CmContact','addContacts','getContacts','findOne','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','Companies','UserProfileResource','destroy','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection'];(function(_0x372de8,_0x186bf2){var _0x598aa5=function(_0xba495f){while(--_0xba495f){_0x372de8['push'](_0x372de8['shift']());}};_0x598aa5(++_0x186bf2);}(_0xcfd3,0xca));var _0x3cfd=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xcfd3[_0x25701b];return _0x3a8a2c;};'use strict';var emlformat=require(_0x3cfd('0x0'));var rimraf=require(_0x3cfd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3cfd('0x2'));var rp=require(_0x3cfd('0x3'));var moment=require(_0x3cfd('0x4'));var BPromise=require(_0x3cfd('0x5'));var Mustache=require(_0x3cfd('0x6'));var util=require(_0x3cfd('0x7'));var path=require(_0x3cfd('0x8'));var sox=require(_0x3cfd('0x9'));var csv=require(_0x3cfd('0xa'));var ejs=require(_0x3cfd('0xb'));var fs=require('fs');var fs_extra=require(_0x3cfd('0xc'));var _=require(_0x3cfd('0xd'));var squel=require(_0x3cfd('0xe'));var crypto=require('crypto');var jsforce=require(_0x3cfd('0xf'));var deskjs=require(_0x3cfd('0x10'));var toCsv=require(_0x3cfd('0xa'));var querystring=require(_0x3cfd('0x11'));var Papa=require('papaparse');var Redis=require(_0x3cfd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3cfd('0x13'));var as=require(_0x3cfd('0x14'));var hardwareService=require(_0x3cfd('0x15'));var logger=require(_0x3cfd('0x16'))(_0x3cfd('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3cfd('0x18'));var db=require(_0x3cfd('0x19'))['db'];function respondWithStatusCode(_0x40c4c0,_0x47ef97){_0x47ef97=_0x47ef97||0xcc;return function(_0x2c59c8){if(_0x2c59c8){return _0x40c4c0['sendStatus'](_0x47ef97);}return _0x40c4c0[_0x3cfd('0x1a')](_0x47ef97)[_0x3cfd('0x1b')]();};}function respondWithResult(_0x5d2502,_0x50282e){_0x50282e=_0x50282e||0xc8;return function(_0x575d63){if(_0x575d63){return _0x5d2502[_0x3cfd('0x1a')](_0x50282e)[_0x3cfd('0x1c')](_0x575d63);}};}function respondWithFilteredResult(_0x55b15a,_0x200f6c){return function(_0x1c671e){if(_0x1c671e){var _0x27a3b1=typeof _0x200f6c[_0x3cfd('0x1d')]===_0x3cfd('0x1e')&&typeof _0x200f6c[_0x3cfd('0x1f')]===_0x3cfd('0x1e');var _0x5e03b7=_0x1c671e[_0x3cfd('0x20')];var _0x2f908c=_0x27a3b1?0x0:_0x200f6c[_0x3cfd('0x1d')];var _0x4c68da=_0x27a3b1?_0x1c671e[_0x3cfd('0x20')]:_0x200f6c[_0x3cfd('0x1d')]+_0x200f6c['limit'];var _0x288931;if(_0x4c68da>=_0x5e03b7){_0x4c68da=_0x5e03b7;_0x288931=0xc8;}else{_0x288931=0xce;}_0x55b15a['status'](_0x288931);return _0x55b15a[_0x3cfd('0x21')]('Content-Range',_0x2f908c+'-'+_0x4c68da+'/'+_0x5e03b7)['json'](_0x1c671e);}return null;};}function patchUpdates(_0x3dc9ae){return function(_0x695f8e){try{jsonpatch[_0x3cfd('0x22')](_0x695f8e,_0x3dc9ae,!![]);}catch(_0x57f8bc){return BPromise[_0x3cfd('0x23')](_0x57f8bc);}return _0x695f8e['save']();};}function saveUpdates(_0xe172b4,_0x5bcc7b){return function(_0x3883b9){if(_0x3883b9){return _0x3883b9[_0x3cfd('0x24')](_0xe172b4)[_0x3cfd('0x25')](function(_0x3c2676){return _0x3c2676;});}return null;};}function removeEntity(_0x44b5b1,_0x3aafc3){return function(_0x610514){if(_0x610514){return _0x610514['destroy']()[_0x3cfd('0x25')](function(){var _0x2c4bb0=_0x610514[_0x3cfd('0x26')]({'plain':!![]});var _0xa0b486=_0x3cfd('0x27');return db[_0x3cfd('0x28')][_0x3cfd('0x29')]({'where':{'type':_0xa0b486,'resourceId':_0x2c4bb0['id']}})['then'](function(){return _0x610514;});})[_0x3cfd('0x25')](function(){_0x44b5b1[_0x3cfd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353b59,_0x47f0fd){return function(_0x3cdaad){if(!_0x3cdaad){_0x353b59['sendStatus'](0x194);}return _0x3cdaad;};}function handleError(_0x19bd98,_0x117484){_0x117484=_0x117484||0x1f4;return function(_0x10a7d0){logger[_0x3cfd('0x2a')](_0x10a7d0[_0x3cfd('0x2b')]);if(_0x10a7d0[_0x3cfd('0x2c')]){delete _0x10a7d0['name'];}_0x19bd98[_0x3cfd('0x1a')](_0x117484)[_0x3cfd('0x2d')](_0x10a7d0);};}exports[_0x3cfd('0x2e')]=function(_0x16aea7,_0x575361){var _0x22f1db={},_0x49e67d={},_0x579675={'count':0x0,'rows':[]};return db[_0x3cfd('0x2f')][_0x3cfd('0x30')]()[_0x3cfd('0x25')](function(_0x51b608){_0x49e67d['model']=_[_0x3cfd('0x31')](_0x51b608);_0x49e67d['query']=_[_0x3cfd('0x31')](_0x16aea7[_0x3cfd('0x32')]);_0x49e67d[_0x3cfd('0x33')]=_[_0x3cfd('0x34')](_0x49e67d[_0x3cfd('0x35')],_0x49e67d['query']);_0x22f1db['attributes']=_[_0x3cfd('0x34')](_0x49e67d[_0x3cfd('0x35')],qs['fields'](_0x16aea7[_0x3cfd('0x32')][_0x3cfd('0x36')]));_0x22f1db[_0x3cfd('0x37')]=_0x22f1db['attributes'][_0x3cfd('0x38')]?_0x22f1db[_0x3cfd('0x37')]:_0x49e67d['model'];if(!_0x16aea7['query'][_0x3cfd('0x39')](_0x3cfd('0x3a'))){_0x22f1db[_0x3cfd('0x1f')]=qs[_0x3cfd('0x1f')](_0x16aea7[_0x3cfd('0x32')]['limit']);_0x22f1db[_0x3cfd('0x1d')]=qs[_0x3cfd('0x1d')](_0x16aea7[_0x3cfd('0x32')][_0x3cfd('0x1d')]);}_0x22f1db[_0x3cfd('0x3b')]=qs[_0x3cfd('0x3c')](_0x16aea7['query'][_0x3cfd('0x3c')]);_0x22f1db['where']=qs[_0x3cfd('0x33')](_[_0x3cfd('0x3d')](_0x16aea7[_0x3cfd('0x32')],_0x49e67d[_0x3cfd('0x33')]),_0x51b608);if(_0x16aea7[_0x3cfd('0x32')][_0x3cfd('0x3e')]){_0x22f1db[_0x3cfd('0x3f')]=_[_0x3cfd('0x40')](_0x22f1db[_0x3cfd('0x3f')],{'$or':_[_0x3cfd('0x41')](_0x22f1db[_0x3cfd('0x37')],function(_0x52b9a4){var _0x4802fb={};_0x4802fb[_0x52b9a4]={'$like':'%'+_0x16aea7[_0x3cfd('0x32')][_0x3cfd('0x3e')]+'%'};return _0x4802fb;})});}_0x22f1db=_[_0x3cfd('0x40')]({},_0x22f1db,_0x16aea7[_0x3cfd('0x42')]);var _0xd1cf7={'where':_0x22f1db[_0x3cfd('0x3f')]};return db[_0x3cfd('0x2f')][_0x3cfd('0x20')](_0xd1cf7)[_0x3cfd('0x25')](function(_0x3f8844){_0x579675[_0x3cfd('0x20')]=_0x3f8844;if(_0x16aea7[_0x3cfd('0x32')][_0x3cfd('0x43')]){_0x22f1db[_0x3cfd('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0x3cfd('0x45')](_0x22f1db);})['then'](function(_0x16f364){_0x579675[_0x3cfd('0x46')]=_0x16f364;return _0x579675;})['then'](respondWithFilteredResult(_0x575361,_0x22f1db))[_0x3cfd('0x47')](handleError(_0x575361,null));})['catch'](handleError(_0x575361,null));};exports[_0x3cfd('0x48')]=function(_0x54079f,_0x29e5a6){var _0x5b810e={'raw':![],'where':{'id':_0x54079f['params']['id']}},_0xc0eb3e={};_0xc0eb3e[_0x3cfd('0x35')]=_[_0x3cfd('0x31')](db['CmCompany']['rawAttributes']);_0xc0eb3e[_0x3cfd('0x32')]=_[_0x3cfd('0x31')](_0x54079f[_0x3cfd('0x32')]);_0xc0eb3e[_0x3cfd('0x33')]=_['intersection'](_0xc0eb3e['model'],_0xc0eb3e[_0x3cfd('0x32')]);_0x5b810e[_0x3cfd('0x37')]=_[_0x3cfd('0x34')](_0xc0eb3e['model'],qs[_0x3cfd('0x36')](_0x54079f['query']['fields']));_0x5b810e[_0x3cfd('0x37')]=_0x5b810e[_0x3cfd('0x37')]['length']?_0x5b810e[_0x3cfd('0x37')]:_0xc0eb3e[_0x3cfd('0x35')];if(_0x54079f['query'][_0x3cfd('0x43')]){_0x5b810e[_0x3cfd('0x44')]=[{'all':!![]}];}_0x5b810e=_[_0x3cfd('0x40')]({},_0x5b810e,_0x54079f['options']);return db[_0x3cfd('0x2f')]['find'](_0x5b810e)['then'](handleEntityNotFound(_0x29e5a6,null))['then'](respondWithResult(_0x29e5a6,null))[_0x3cfd('0x47')](handleError(_0x29e5a6,null));};exports['create']=function(_0x4c5463,_0x20cf95){return db[_0x3cfd('0x2f')][_0x3cfd('0x49')](_0x4c5463[_0x3cfd('0x4a')],{})[_0x3cfd('0x25')](function(_0x108fef){var _0x5a324c=_0x4c5463[_0x3cfd('0x4b')][_0x3cfd('0x26')]({'plain':!![]});if(!_0x5a324c)throw new Error(_0x3cfd('0x4c'));if(_0x5a324c[_0x3cfd('0x4d')]==='user'){var _0x390409=_0x108fef[_0x3cfd('0x26')]({'plain':!![]});var _0x27e414=_0x3cfd('0x27');return db[_0x3cfd('0x4e')][_0x3cfd('0x4f')]({'where':{'name':_0x27e414,'userProfileId':_0x5a324c['userProfileId']},'raw':!![]})[_0x3cfd('0x25')](function(_0x4a9e2e){if(_0x4a9e2e&&_0x4a9e2e['autoAssociation']===0x0){return db[_0x3cfd('0x28')][_0x3cfd('0x49')]({'name':_0x390409[_0x3cfd('0x2c')],'resourceId':_0x390409['id'],'type':_0x4a9e2e[_0x3cfd('0x2c')],'sectionId':_0x4a9e2e['id']},{})[_0x3cfd('0x25')](function(){return _0x108fef;});}else{return _0x108fef;}})[_0x3cfd('0x47')](function(_0x27f379){logger[_0x3cfd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27f379);throw _0x27f379;});}return _0x108fef;})[_0x3cfd('0x25')](respondWithResult(_0x20cf95,0xc9))[_0x3cfd('0x47')](handleError(_0x20cf95,null));};exports[_0x3cfd('0x24')]=function(_0x198d31,_0x36febe){if(_0x198d31[_0x3cfd('0x4a')]['id']){delete _0x198d31[_0x3cfd('0x4a')]['id'];}return db[_0x3cfd('0x2f')][_0x3cfd('0x4f')]({'where':{'id':_0x198d31['params']['id']}})[_0x3cfd('0x25')](handleEntityNotFound(_0x36febe,null))[_0x3cfd('0x25')](saveUpdates(_0x198d31[_0x3cfd('0x4a')],null))[_0x3cfd('0x25')](respondWithResult(_0x36febe,null))[_0x3cfd('0x47')](handleError(_0x36febe,null));};exports[_0x3cfd('0x29')]=function(_0x370221,_0x1141d7){return db[_0x3cfd('0x2f')][_0x3cfd('0x4f')]({'where':{'id':_0x370221[_0x3cfd('0x50')]['id']}})[_0x3cfd('0x25')](handleEntityNotFound(_0x1141d7,null))['then'](removeEntity(_0x1141d7,null))[_0x3cfd('0x47')](handleError(_0x1141d7,null));};exports['describe']=function(_0x3853e7,_0x483f26){return db[_0x3cfd('0x2f')][_0x3cfd('0x30')]()[_0x3cfd('0x25')](respondWithResult(_0x483f26,null))[_0x3cfd('0x47')](handleError(_0x483f26,null));};exports['addContacts']=function(_0x1d317d,_0x5a364d,_0x1eac6e){return db[_0x3cfd('0x51')]['find']({'where':{'id':_0x1d317d[_0x3cfd('0x50')]['id']}})[_0x3cfd('0x25')](handleEntityNotFound(_0x5a364d,null))[_0x3cfd('0x25')](function(_0x5c3dbd){if(_0x5c3dbd){return _0x5c3dbd[_0x3cfd('0x52')](_0x1d317d[_0x3cfd('0x4a')]['ids'],_['omit'](_0x1d317d[_0x3cfd('0x4a')],['ids','id'])||{});}})[_0x3cfd('0x25')](respondWithResult(_0x5a364d,null))['catch'](handleError(_0x5a364d,null));};exports[_0x3cfd('0x53')]=function(_0x5127ba,_0x1519cc,_0x4e980b){var _0x69a72a={};var _0x53150b={};var _0x225bbd;var _0x2874ec;return db['CmCompany'][_0x3cfd('0x54')]({'where':{'id':_0x5127ba['params']['id']}})[_0x3cfd('0x25')](handleEntityNotFound(_0x1519cc,null))['then'](function(_0x1b62b2){if(_0x1b62b2){_0x225bbd=_0x1b62b2;_0x53150b[_0x3cfd('0x35')]=_[_0x3cfd('0x31')](db[_0x3cfd('0x51')]['rawAttributes']);_0x53150b[_0x3cfd('0x32')]=_[_0x3cfd('0x31')](_0x5127ba[_0x3cfd('0x32')]);_0x53150b[_0x3cfd('0x33')]=_[_0x3cfd('0x34')](_0x53150b[_0x3cfd('0x35')],_0x53150b[_0x3cfd('0x32')]);_0x69a72a[_0x3cfd('0x37')]=_[_0x3cfd('0x34')](_0x53150b[_0x3cfd('0x35')],qs[_0x3cfd('0x36')](_0x5127ba[_0x3cfd('0x32')][_0x3cfd('0x36')]));_0x69a72a['attributes']=_0x69a72a[_0x3cfd('0x37')][_0x3cfd('0x38')]?_0x69a72a[_0x3cfd('0x37')]:_0x53150b[_0x3cfd('0x35')];_0x69a72a[_0x3cfd('0x3b')]=qs[_0x3cfd('0x3c')](_0x5127ba['query']['sort']);_0x69a72a[_0x3cfd('0x3f')]=qs[_0x3cfd('0x33')](_[_0x3cfd('0x3d')](_0x5127ba['query'],_0x53150b[_0x3cfd('0x33')]));if(_0x5127ba[_0x3cfd('0x32')][_0x3cfd('0x3e')]){_0x69a72a['where']=_[_0x3cfd('0x40')](_0x69a72a[_0x3cfd('0x3f')],{'$or':_[_0x3cfd('0x41')](_0x69a72a[_0x3cfd('0x37')],function(_0x18cb29){var _0x195a8d={};_0x195a8d[_0x18cb29]={'$like':'%'+_0x5127ba[_0x3cfd('0x32')]['filter']+'%'};return _0x195a8d;})});}_0x69a72a=_[_0x3cfd('0x40')]({},_0x69a72a,_0x5127ba[_0x3cfd('0x42')]);return _0x225bbd[_0x3cfd('0x53')](_0x69a72a);}})[_0x3cfd('0x25')](function(_0x57661c){if(_0x57661c){_0x2874ec=_0x57661c[_0x3cfd('0x38')];if(!_0x5127ba[_0x3cfd('0x32')][_0x3cfd('0x39')](_0x3cfd('0x3a'))){_0x69a72a[_0x3cfd('0x1f')]=qs['limit'](_0x5127ba['query'][_0x3cfd('0x1f')]);_0x69a72a[_0x3cfd('0x1d')]=qs['offset'](_0x5127ba[_0x3cfd('0x32')][_0x3cfd('0x1d')]);}return _0x225bbd[_0x3cfd('0x53')](_0x69a72a);}})['then'](function(_0x590223){if(_0x590223){return _0x590223?{'count':_0x2874ec,'rows':_0x590223}:null;}})[_0x3cfd('0x25')](respondWithResult(_0x1519cc,null))['catch'](handleError(_0x1519cc,null));}; \ No newline at end of file +var _0x12eb=['request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','Companies','destroy','error','stack','name','send','describe','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','rawAttributes','getContacts','rimraf','zip-dir','fast-json-patch'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x12eb,0x1a6));var _0xb12e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x12eb[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb12e('0x0'));var zipdir=require(_0xb12e('0x1'));var jsonpatch=require(_0xb12e('0x2'));var rp=require(_0xb12e('0x3'));var moment=require('moment');var BPromise=require(_0xb12e('0x4'));var Mustache=require(_0xb12e('0x5'));var util=require(_0xb12e('0x6'));var path=require('path');var sox=require(_0xb12e('0x7'));var csv=require(_0xb12e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb12e('0x9'));var _=require('lodash');var squel=require(_0xb12e('0xa'));var crypto=require(_0xb12e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb12e('0xc'));var toCsv=require(_0xb12e('0x8'));var querystring=require(_0xb12e('0xd'));var Papa=require(_0xb12e('0xe'));var Redis=require(_0xb12e('0xf'));var authService=require(_0xb12e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb12e('0x11'));var hardwareService=require(_0xb12e('0x12'));var logger=require(_0xb12e('0x13'))(_0xb12e('0x14'));var utils=require(_0xb12e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb12e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cac3f,_0x52d2fe){_0x52d2fe=_0x52d2fe||0xcc;return function(_0x44641c){if(_0x44641c){return _0x5cac3f[_0xb12e('0x17')](_0x52d2fe);}return _0x5cac3f[_0xb12e('0x18')](_0x52d2fe)[_0xb12e('0x19')]();};}function respondWithResult(_0x17ec95,_0x1227bb){_0x1227bb=_0x1227bb||0xc8;return function(_0x1215a0){if(_0x1215a0){return _0x17ec95[_0xb12e('0x18')](_0x1227bb)[_0xb12e('0x1a')](_0x1215a0);}};}function respondWithFilteredResult(_0xa4dc7d,_0x460c38){return function(_0x312ec0){if(_0x312ec0){var _0x5891f0=typeof _0x460c38[_0xb12e('0x1b')]===_0xb12e('0x1c')&&typeof _0x460c38[_0xb12e('0x1d')]===_0xb12e('0x1c');var _0x33f09e=_0x312ec0[_0xb12e('0x1e')];var _0x21fd27=_0x5891f0?0x0:_0x460c38[_0xb12e('0x1b')];var _0x5a7ed1=_0x5891f0?_0x312ec0[_0xb12e('0x1e')]:_0x460c38['offset']+_0x460c38['limit'];var _0x538bbf;if(_0x5a7ed1>=_0x33f09e){_0x5a7ed1=_0x33f09e;_0x538bbf=0xc8;}else{_0x538bbf=0xce;}_0xa4dc7d[_0xb12e('0x18')](_0x538bbf);return _0xa4dc7d['set'](_0xb12e('0x1f'),_0x21fd27+'-'+_0x5a7ed1+'/'+_0x33f09e)[_0xb12e('0x1a')](_0x312ec0);}return null;};}function patchUpdates(_0x4707a3){return function(_0x1537f6){try{jsonpatch[_0xb12e('0x20')](_0x1537f6,_0x4707a3,!![]);}catch(_0x2faad5){return BPromise['reject'](_0x2faad5);}return _0x1537f6[_0xb12e('0x21')]();};}function saveUpdates(_0x16508b,_0x4cb3fb){return function(_0x77d349){if(_0x77d349){return _0x77d349['update'](_0x16508b)[_0xb12e('0x22')](function(_0x19984d){return _0x19984d;});}return null;};}function removeEntity(_0x4e5af4,_0x27b7e1){return function(_0x488269){if(_0x488269){return _0x488269['destroy']()[_0xb12e('0x22')](function(){var _0x136a8a=_0x488269[_0xb12e('0x23')]({'plain':!![]});var _0x489650=_0xb12e('0x24');return db['UserProfileResource'][_0xb12e('0x25')]({'where':{'type':_0x489650,'resourceId':_0x136a8a['id']}})[_0xb12e('0x22')](function(){return _0x488269;});})[_0xb12e('0x22')](function(){_0x4e5af4[_0xb12e('0x18')](0xcc)[_0xb12e('0x19')]();});}};}function handleEntityNotFound(_0x5c77bf,_0x49d2db){return function(_0x31420b){if(!_0x31420b){_0x5c77bf[_0xb12e('0x17')](0x194);}return _0x31420b;};}function handleError(_0x251d19,_0xc41455){_0xc41455=_0xc41455||0x1f4;return function(_0x5dd180){logger[_0xb12e('0x26')](_0x5dd180[_0xb12e('0x27')]);if(_0x5dd180[_0xb12e('0x28')]){delete _0x5dd180['name'];}_0x251d19[_0xb12e('0x18')](_0xc41455)[_0xb12e('0x29')](_0x5dd180);};}exports['index']=function(_0xbec460,_0x3f79fd){var _0x4d826c={},_0x5a38c8={},_0xee58e4={'count':0x0,'rows':[]};return db['CmCompany'][_0xb12e('0x2a')]()[_0xb12e('0x22')](function(_0x14dbe9){_0x5a38c8['model']=_['keys'](_0x14dbe9);_0x5a38c8['query']=_['keys'](_0xbec460[_0xb12e('0x2b')]);_0x5a38c8['filters']=_[_0xb12e('0x2c')](_0x5a38c8[_0xb12e('0x2d')],_0x5a38c8[_0xb12e('0x2b')]);_0x4d826c[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0x5a38c8[_0xb12e('0x2d')],qs[_0xb12e('0x2f')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x2f')]));_0x4d826c[_0xb12e('0x2e')]=_0x4d826c[_0xb12e('0x2e')][_0xb12e('0x30')]?_0x4d826c['attributes']:_0x5a38c8[_0xb12e('0x2d')];if(!_0xbec460['query'][_0xb12e('0x31')](_0xb12e('0x32'))){_0x4d826c[_0xb12e('0x1d')]=qs[_0xb12e('0x1d')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x1d')]);_0x4d826c['offset']=qs[_0xb12e('0x1b')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x1b')]);}_0x4d826c[_0xb12e('0x33')]=qs[_0xb12e('0x34')](_0xbec460['query'][_0xb12e('0x34')]);_0x4d826c[_0xb12e('0x35')]=qs[_0xb12e('0x36')](_[_0xb12e('0x37')](_0xbec460[_0xb12e('0x2b')],_0x5a38c8[_0xb12e('0x36')]),_0x14dbe9);if(_0xbec460[_0xb12e('0x2b')][_0xb12e('0x38')]){_0x4d826c[_0xb12e('0x35')]=_[_0xb12e('0x39')](_0x4d826c[_0xb12e('0x35')],{'$or':_[_0xb12e('0x3a')](_0x4d826c[_0xb12e('0x2e')],function(_0x34bee9){var _0x3940d9={};_0x3940d9[_0x34bee9]={'$like':'%'+_0xbec460[_0xb12e('0x2b')][_0xb12e('0x38')]+'%'};return _0x3940d9;})});}_0x4d826c=_['merge']({},_0x4d826c,_0xbec460[_0xb12e('0x3b')]);var _0x259056={'where':_0x4d826c[_0xb12e('0x35')]};return db[_0xb12e('0x3c')]['count'](_0x259056)[_0xb12e('0x22')](function(_0xe765e2){_0xee58e4[_0xb12e('0x1e')]=_0xe765e2;if(_0xbec460[_0xb12e('0x2b')][_0xb12e('0x3d')]){_0x4d826c[_0xb12e('0x3e')]=[{'all':!![]}];}return db[_0xb12e('0x3c')][_0xb12e('0x3f')](_0x4d826c);})[_0xb12e('0x22')](function(_0x517432){_0xee58e4['rows']=_0x517432;return _0xee58e4;})[_0xb12e('0x22')](respondWithFilteredResult(_0x3f79fd,_0x4d826c))[_0xb12e('0x40')](handleError(_0x3f79fd,null));})[_0xb12e('0x40')](handleError(_0x3f79fd,null));};exports[_0xb12e('0x41')]=function(_0x472c8b,_0x4f7ef7){var _0x4e4633={'raw':![],'where':{'id':_0x472c8b[_0xb12e('0x42')]['id']}},_0xa3e1ff={};_0xa3e1ff[_0xb12e('0x2d')]=_[_0xb12e('0x43')](db[_0xb12e('0x3c')]['rawAttributes']);_0xa3e1ff['query']=_['keys'](_0x472c8b['query']);_0xa3e1ff['filters']=_[_0xb12e('0x2c')](_0xa3e1ff[_0xb12e('0x2d')],_0xa3e1ff['query']);_0x4e4633[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0xa3e1ff['model'],qs[_0xb12e('0x2f')](_0x472c8b[_0xb12e('0x2b')][_0xb12e('0x2f')]));_0x4e4633[_0xb12e('0x2e')]=_0x4e4633[_0xb12e('0x2e')]['length']?_0x4e4633[_0xb12e('0x2e')]:_0xa3e1ff[_0xb12e('0x2d')];if(_0x472c8b['query'][_0xb12e('0x3d')]){_0x4e4633[_0xb12e('0x3e')]=[{'all':!![]}];}_0x4e4633=_[_0xb12e('0x39')]({},_0x4e4633,_0x472c8b[_0xb12e('0x3b')]);return db[_0xb12e('0x3c')][_0xb12e('0x44')](_0x4e4633)[_0xb12e('0x22')](handleEntityNotFound(_0x4f7ef7,null))[_0xb12e('0x22')](respondWithResult(_0x4f7ef7,null))[_0xb12e('0x40')](handleError(_0x4f7ef7,null));};exports['create']=function(_0x2e7506,_0x4a3e1f){return db[_0xb12e('0x3c')][_0xb12e('0x45')](_0x2e7506[_0xb12e('0x46')],{})[_0xb12e('0x22')](function(_0x28584e){var _0x11fee8=_0x2e7506[_0xb12e('0x47')][_0xb12e('0x23')]({'plain':!![]});if(!_0x11fee8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11fee8[_0xb12e('0x48')]===_0xb12e('0x47')){var _0x55065b=_0x28584e[_0xb12e('0x23')]({'plain':!![]});var _0xd5d1f6='Companies';return db[_0xb12e('0x49')]['find']({'where':{'name':_0xd5d1f6,'userProfileId':_0x11fee8[_0xb12e('0x4a')]},'raw':!![]})[_0xb12e('0x22')](function(_0x8f02a8){if(_0x8f02a8&&_0x8f02a8['autoAssociation']===0x0){return db[_0xb12e('0x4b')][_0xb12e('0x45')]({'name':_0x55065b[_0xb12e('0x28')],'resourceId':_0x55065b['id'],'type':_0x8f02a8[_0xb12e('0x28')],'sectionId':_0x8f02a8['id']},{})['then'](function(){return _0x28584e;});}else{return _0x28584e;}})[_0xb12e('0x40')](function(_0x2a2e7c){logger[_0xb12e('0x26')](_0xb12e('0x4c'),_0x2a2e7c);throw _0x2a2e7c;});}return _0x28584e;})[_0xb12e('0x22')](respondWithResult(_0x4a3e1f,0xc9))['catch'](handleError(_0x4a3e1f,null));};exports[_0xb12e('0x4d')]=function(_0x1e7f1d,_0x1a1920){if(_0x1e7f1d[_0xb12e('0x46')]['id']){delete _0x1e7f1d[_0xb12e('0x46')]['id'];}return db[_0xb12e('0x3c')][_0xb12e('0x44')]({'where':{'id':_0x1e7f1d['params']['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x1a1920,null))[_0xb12e('0x22')](saveUpdates(_0x1e7f1d[_0xb12e('0x46')],null))['then'](respondWithResult(_0x1a1920,null))[_0xb12e('0x40')](handleError(_0x1a1920,null));};exports[_0xb12e('0x25')]=function(_0x54312e,_0x2aecf8){return db['CmCompany'][_0xb12e('0x44')]({'where':{'id':_0x54312e[_0xb12e('0x42')]['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x2aecf8,null))[_0xb12e('0x22')](removeEntity(_0x2aecf8,null))[_0xb12e('0x40')](handleError(_0x2aecf8,null));};exports['describe']=function(_0x202c1c,_0x165466){return db[_0xb12e('0x3c')][_0xb12e('0x2a')]()['then'](respondWithResult(_0x165466,null))[_0xb12e('0x40')](handleError(_0x165466,null));};exports[_0xb12e('0x4e')]=function(_0x122e0d,_0x3220e3,_0x5b4c8b){return db[_0xb12e('0x4f')][_0xb12e('0x44')]({'where':{'id':_0x122e0d[_0xb12e('0x42')]['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x3220e3,null))[_0xb12e('0x22')](function(_0x128b58){if(_0x128b58){return _0x128b58[_0xb12e('0x4e')](_0x122e0d['body'][_0xb12e('0x50')],_[_0xb12e('0x51')](_0x122e0d[_0xb12e('0x46')],['ids','id'])||{});}})[_0xb12e('0x22')](respondWithResult(_0x3220e3,null))['catch'](handleError(_0x3220e3,null));};exports['getContacts']=function(_0x56e621,_0x391c57,_0xb1be65){var _0x3af7f4={};var _0xaf364f={};var _0x1b2111;var _0x5aeecd;return db[_0xb12e('0x3c')][_0xb12e('0x52')]({'where':{'id':_0x56e621['params']['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x391c57,null))[_0xb12e('0x22')](function(_0x4f7692){if(_0x4f7692){_0x1b2111=_0x4f7692;_0xaf364f[_0xb12e('0x2d')]=_[_0xb12e('0x43')](db[_0xb12e('0x4f')][_0xb12e('0x53')]);_0xaf364f[_0xb12e('0x2b')]=_['keys'](_0x56e621['query']);_0xaf364f[_0xb12e('0x36')]=_['intersection'](_0xaf364f[_0xb12e('0x2d')],_0xaf364f[_0xb12e('0x2b')]);_0x3af7f4[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0xaf364f[_0xb12e('0x2d')],qs['fields'](_0x56e621[_0xb12e('0x2b')]['fields']));_0x3af7f4[_0xb12e('0x2e')]=_0x3af7f4[_0xb12e('0x2e')][_0xb12e('0x30')]?_0x3af7f4[_0xb12e('0x2e')]:_0xaf364f['model'];_0x3af7f4[_0xb12e('0x33')]=qs[_0xb12e('0x34')](_0x56e621[_0xb12e('0x2b')]['sort']);_0x3af7f4['where']=qs[_0xb12e('0x36')](_[_0xb12e('0x37')](_0x56e621[_0xb12e('0x2b')],_0xaf364f[_0xb12e('0x36')]));if(_0x56e621[_0xb12e('0x2b')][_0xb12e('0x38')]){_0x3af7f4[_0xb12e('0x35')]=_[_0xb12e('0x39')](_0x3af7f4[_0xb12e('0x35')],{'$or':_[_0xb12e('0x3a')](_0x3af7f4[_0xb12e('0x2e')],function(_0x11accb){var _0x517660={};_0x517660[_0x11accb]={'$like':'%'+_0x56e621['query'][_0xb12e('0x38')]+'%'};return _0x517660;})});}_0x3af7f4=_[_0xb12e('0x39')]({},_0x3af7f4,_0x56e621['options']);return _0x1b2111['getContacts'](_0x3af7f4);}})[_0xb12e('0x22')](function(_0x18a594){if(_0x18a594){_0x5aeecd=_0x18a594[_0xb12e('0x30')];if(!_0x56e621[_0xb12e('0x2b')][_0xb12e('0x31')](_0xb12e('0x32'))){_0x3af7f4[_0xb12e('0x1d')]=qs[_0xb12e('0x1d')](_0x56e621[_0xb12e('0x2b')]['limit']);_0x3af7f4['offset']=qs[_0xb12e('0x1b')](_0x56e621[_0xb12e('0x2b')]['offset']);}return _0x1b2111[_0xb12e('0x54')](_0x3af7f4);}})[_0xb12e('0x22')](function(_0x2f3103){if(_0x2f3103){return _0x2f3103?{'count':_0x5aeecd,'rows':_0x2f3103}:null;}})[_0xb12e('0x22')](respondWithResult(_0x391c57,null))[_0xb12e('0x40')](handleError(_0x391c57,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 783c29f..f79404e 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6046=['./cmCompany.attributes','CmCompany','cm_companies','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x2d864b,_0x30532d){var _0x3c10f4=function(_0x24a085){while(--_0x24a085){_0x2d864b['push'](_0x2d864b['shift']());}};_0x3c10f4(++_0x30532d);}(_0x6046,0x17d));var _0x6604=function(_0x19e035,_0x1b1986){_0x19e035=_0x19e035-0x0;var _0x13e159=_0x6046[_0x19e035];return _0x13e159;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6604('0x0'))(_0x6604('0x1'));var moment=require(_0x6604('0x2'));var BPromise=require(_0x6604('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6604('0x4'));var rimraf=require('rimraf');var config=require(_0x6604('0x5'));var attributes=require(_0x6604('0x6'));module['exports']=function(_0x357707,_0x768cea){return _0x357707['define'](_0x6604('0x7'),attributes,{'tableName':_0x6604('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x420d=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','request-promise'];(function(_0xb4f705,_0x39327b){var _0x48e5b6=function(_0x37527e){while(--_0x37527e){_0xb4f705['push'](_0xb4f705['shift']());}};_0x48e5b6(++_0x39327b);}(_0x420d,0x126));var _0xd420=function(_0x5f1e00,_0x32a120){_0x5f1e00=_0x5f1e00-0x0;var _0x5d1743=_0x420d[_0x5f1e00];return _0x5d1743;};'use strict';var _=require(_0xd420('0x0'));var util=require('util');var logger=require(_0xd420('0x1'))(_0xd420('0x2'));var moment=require(_0xd420('0x3'));var BPromise=require('bluebird');var rp=require(_0xd420('0x4'));var fs=require('fs');var path=require(_0xd420('0x5'));var rimraf=require(_0xd420('0x6'));var config=require(_0xd420('0x7'));var attributes=require(_0xd420('0x8'));module[_0xd420('0x9')]=function(_0x44f838,_0x2cb500){return _0x44f838[_0xd420('0xa')](_0xd420('0xb'),attributes,{'tableName':_0xd420('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 4c83174..b12a161 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d29=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3d9e47,_0x50dca9){var _0x435436=function(_0x17abb4){while(--_0x17abb4){_0x3d9e47['push'](_0x3d9e47['shift']());}};_0x435436(++_0x50dca9);}(_0x2d29,0x186));var _0x92d2=function(_0x1c8afd,_0x28037c){_0x1c8afd=_0x1c8afd-0x0;var _0x599c76=_0x2d29[_0x1c8afd];return _0x599c76;};'use strict';var _=require(_0x92d2('0x0'));var util=require(_0x92d2('0x1'));var moment=require(_0x92d2('0x2'));var BPromise=require(_0x92d2('0x3'));var rs=require(_0x92d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92d2('0x5'))['db'];var utils=require(_0x92d2('0x6'));var logger=require('../../config/logger')(_0x92d2('0x7'));var config=require(_0x92d2('0x8'));var jayson=require(_0x92d2('0x9'));var client=jayson[_0x92d2('0xa')][_0x92d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492360,_0x16b97d,_0x140e9a){return new BPromise(function(_0x4f5df1,_0x35d7af){return client['request'](_0x492360,_0x140e9a)['then'](function(_0x260889){logger[_0x92d2('0xc')](_0x92d2('0xd'),_0x16b97d,_0x92d2('0xe'));logger[_0x92d2('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x16b97d,'request\x20sent',JSON[_0x92d2('0x10')](_0x260889));if(_0x260889['error']){if(_0x260889[_0x92d2('0x11')][_0x92d2('0x12')]===0x1f4){logger['error'](_0x92d2('0xd'),_0x16b97d,_0x260889['error'][_0x92d2('0x13')]);return _0x35d7af(_0x260889['error'][_0x92d2('0x13')]);}logger[_0x92d2('0x11')]('CmCompany,\x20%s,\x20%s',_0x16b97d,_0x260889[_0x92d2('0x11')][_0x92d2('0x13')]);return _0x4f5df1(_0x260889[_0x92d2('0x11')][_0x92d2('0x13')]);}else{logger[_0x92d2('0xc')](_0x92d2('0xd'),_0x16b97d,_0x92d2('0xe'));_0x4f5df1(_0x260889[_0x92d2('0x14')]['message']);}})[_0x92d2('0x15')](function(_0x2c81e2){logger['error'](_0x92d2('0xd'),_0x16b97d,_0x2c81e2);_0x35d7af(_0x2c81e2);});});} \ No newline at end of file +var _0x1894=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x2f82e7,_0x50f448){var _0x483927=function(_0x1f9d9c){while(--_0x1f9d9c){_0x2f82e7['push'](_0x2f82e7['shift']());}};_0x483927(++_0x50f448);}(_0x1894,0x1ce));var _0x4189=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x1894[_0x8a30cf];return _0x20f439;};'use strict';var _=require(_0x4189('0x0'));var util=require('util');var moment=require(_0x4189('0x1'));var BPromise=require(_0x4189('0x2'));var rs=require(_0x4189('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4189('0x4'))['db'];var utils=require(_0x4189('0x5'));var logger=require('../../config/logger')(_0x4189('0x6'));var config=require(_0x4189('0x7'));var jayson=require(_0x4189('0x8'));var client=jayson[_0x4189('0x9')][_0x4189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448b,_0x342614,_0x4d4d43){return new BPromise(function(_0x2c7f64,_0x56bebd){return client[_0x4189('0xb')](_0x448b,_0x4d4d43)[_0x4189('0xc')](function(_0xb69e81){logger['info'](_0x4189('0xd'),_0x342614,_0x4189('0xe'));logger[_0x4189('0xf')](_0x4189('0x10'),_0x342614,_0x4189('0xe'),JSON['stringify'](_0xb69e81));if(_0xb69e81[_0x4189('0x11')]){if(_0xb69e81[_0x4189('0x11')][_0x4189('0x12')]===0x1f4){logger[_0x4189('0x11')](_0x4189('0xd'),_0x342614,_0xb69e81['error']['message']);return _0x56bebd(_0xb69e81[_0x4189('0x11')][_0x4189('0x13')]);}logger[_0x4189('0x11')]('CmCompany,\x20%s,\x20%s',_0x342614,_0xb69e81['error'][_0x4189('0x13')]);return _0x2c7f64(_0xb69e81[_0x4189('0x11')][_0x4189('0x13')]);}else{logger[_0x4189('0x14')]('CmCompany,\x20%s,\x20%s',_0x342614,_0x4189('0xe'));_0x2c7f64(_0xb69e81[_0x4189('0x15')][_0x4189('0x13')]);}})[_0x4189('0x16')](function(_0xa7730b){logger['error'](_0x4189('0xd'),_0x342614,_0xa7730b);_0x56bebd(_0xa7730b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 62b2183..4f83709 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3051=['show','post','create','/:id/contacts','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe'];(function(_0x96c2f6,_0x5e66be){var _0x2fd9f6=function(_0x4a1e1f){while(--_0x4a1e1f){_0x96c2f6['push'](_0x96c2f6['shift']());}};_0x2fd9f6(++_0x5e66be);}(_0x3051,0x179));var _0x1305=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3051[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1305('0x0'));var util=require(_0x1305('0x1'));var path=require(_0x1305('0x2'));var timeout=require(_0x1305('0x3'));var express=require(_0x1305('0x4'));var router=express[_0x1305('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1305('0x6'));var interaction=require(_0x1305('0x7'));var config=require(_0x1305('0x8'));var controller=require(_0x1305('0x9'));router[_0x1305('0xa')]('/',auth[_0x1305('0xb')](),controller[_0x1305('0xc')]);router[_0x1305('0xa')]('/describe',auth[_0x1305('0xb')](),controller[_0x1305('0xd')]);router[_0x1305('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1305('0xe')]);router[_0x1305('0xa')]('/:id/contacts',auth[_0x1305('0xb')](),controller['getContacts']);router[_0x1305('0xf')]('/',auth[_0x1305('0xb')](),controller[_0x1305('0x10')]);router[_0x1305('0xf')](_0x1305('0x11'),auth[_0x1305('0xb')](),controller['addContacts']);router['put']('/:id',auth[_0x1305('0xb')](),controller[_0x1305('0x12')]);router[_0x1305('0x13')](_0x1305('0x14'),auth[_0x1305('0xb')](),controller[_0x1305('0x15')]);module[_0x1305('0x16')]=router; \ No newline at end of file +var _0xb48e=['getContacts','post','create','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x1e22c0,_0x1b0aec){var _0x2b9f0b=function(_0x25403d){while(--_0x25403d){_0x1e22c0['push'](_0x1e22c0['shift']());}};_0x2b9f0b(++_0x1b0aec);}(_0xb48e,0x1d1));var _0xeb48=function(_0x52ac2f,_0x1d478a){_0x52ac2f=_0x52ac2f-0x0;var _0x58e4ec=_0xb48e[_0x52ac2f];return _0x58e4ec;};'use strict';var multer=require('multer');var util=require(_0xeb48('0x0'));var path=require(_0xeb48('0x1'));var timeout=require(_0xeb48('0x2'));var express=require(_0xeb48('0x3'));var router=express[_0xeb48('0x4')]();var fs_extra=require(_0xeb48('0x5'));var auth=require(_0xeb48('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb48('0x7'));var controller=require('./cmCompany.controller');router[_0xeb48('0x8')]('/',auth['isAuthenticated'](),controller[_0xeb48('0x9')]);router['get'](_0xeb48('0xa'),auth[_0xeb48('0xb')](),controller[_0xeb48('0xc')]);router[_0xeb48('0x8')](_0xeb48('0xd'),auth[_0xeb48('0xb')](),controller[_0xeb48('0xe')]);router[_0xeb48('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xeb48('0xf')]);router[_0xeb48('0x10')]('/',auth[_0xeb48('0xb')](),controller[_0xeb48('0x11')]);router[_0xeb48('0x10')]('/:id/contacts',auth[_0xeb48('0xb')](),controller[_0xeb48('0x12')]);router[_0xeb48('0x13')]('/:id',auth[_0xeb48('0xb')](),controller[_0xeb48('0x14')]);router[_0xeb48('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xeb48('0x16')]);module[_0xeb48('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index ce505b3..7afc6a3 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4420=['TEXT','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x18272f,_0x12cd11){var _0xc3c64b=function(_0x542a4a){while(--_0x542a4a){_0x18272f['push'](_0x18272f['shift']());}};_0xc3c64b(++_0x12cd11);}(_0x4420,0x141));var _0x0442=function(_0x164d60,_0x4ebaf5){_0x164d60=_0x164d60-0x0;var _0x293a58=_0x4420[_0x164d60];return _0x293a58;};'use strict';var _=require('lodash');var Sequelize=require(_0x0442('0x0'));module[_0x0442('0x1')]={'firstName':{'type':Sequelize[_0x0442('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0442('0x2')]},'street':{'type':Sequelize[_0x0442('0x2')]},'postalCode':{'type':Sequelize[_0x0442('0x2')]},'city':{'type':Sequelize[_0x0442('0x2')]},'country':{'type':Sequelize[_0x0442('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0442('0x2')]},'description':{'type':Sequelize[_0x0442('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0442('0x2')]},'fax':{'type':Sequelize[_0x0442('0x2')]},'email':{'type':Sequelize[_0x0442('0x2')]},'url':{'type':Sequelize[_0x0442('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x0442('0x2')]},'twitter':{'type':Sequelize[_0x0442('0x2')]},'skype':{'type':Sequelize[_0x0442('0x2')]},'teams':{'type':Sequelize[_0x0442('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x0442('0x2')]},'wechat':{'type':Sequelize[_0x0442('0x2')]},'telegram':{'type':Sequelize[_0x0442('0x2')]},'UserId':{'type':Sequelize[_0x0442('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x0442('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0442('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x0442('0x2')]},'utcOffset':{'type':Sequelize[_0x0442('0x4')]}}; \ No newline at end of file +var _0x1101=['NOW','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x4fb528,_0xc63eda){var _0x531ede=function(_0x8ee2c5){while(--_0x8ee2c5){_0x4fb528['push'](_0x4fb528['shift']());}};_0x531ede(++_0xc63eda);}(_0x1101,0x1b3));var _0x1110=function(_0x402fc0,_0x2f2b08){_0x402fc0=_0x402fc0-0x0;var _0xef0202=_0x1101[_0x402fc0];return _0xef0202;};'use strict';var _=require('lodash');var Sequelize=require(_0x1110('0x0'));module[_0x1110('0x1')]={'firstName':{'type':Sequelize[_0x1110('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1110('0x2')]},'city':{'type':Sequelize[_0x1110('0x2')]},'country':{'type':Sequelize[_0x1110('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1110('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1110('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1110('0x2')]},'email':{'type':Sequelize[_0x1110('0x2')]},'url':{'type':Sequelize[_0x1110('0x2')]},'facebook':{'type':Sequelize[_0x1110('0x2')]},'fb_data':{'type':Sequelize[_0x1110('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1110('0x2')]},'viber':{'type':Sequelize[_0x1110('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1110('0x2')]},'UserId':{'type':Sequelize[_0x1110('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x1110('0x2')]},'priority':{'type':Sequelize[_0x1110('0x3')](0x2)[_0x1110('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1110('0x5')],'defaultValue':Sequelize[_0x1110('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7a91538..2a5b88c 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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;_0x11c3b60x0){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 diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 452b7c8..0b507c7 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc493=['../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x186222,_0x3bdfb0){var _0x226a38=function(_0x3b071f){while(--_0x3b071f){_0x186222['push'](_0x186222['shift']());}};_0x226a38(++_0x3bdfb0);}(_0xc493,0x15f));var _0x3c49=function(_0xe86b03,_0x4f1d99){_0xe86b03=_0xe86b03-0x0;var _0x2711d6=_0xc493[_0xe86b03];return _0x2711d6;};'use strict';var EventEmitter=require(_0x3c49('0x0'));var CmContact=require(_0x3c49('0x1'))['db'][_0x3c49('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3c49('0x3')](0x0);var events={'afterCreate':_0x3c49('0x4'),'afterUpdate':_0x3c49('0x5'),'afterDestroy':_0x3c49('0x6')};function emitEvent(_0x2b2e20){return function(_0x27ba5d,_0x4f9e6f,_0x3aba76){CmContactEvents[_0x3c49('0x7')](_0x2b2e20+':'+_0x27ba5d['id'],_0x27ba5d);CmContactEvents[_0x3c49('0x7')](_0x2b2e20,_0x27ba5d);_0x3aba76(null);};}for(var e in events){if(events[_0x3c49('0x8')](e)){var event=events[e];CmContact[_0x3c49('0x9')](e,emitEvent(event));}}module[_0x3c49('0xa')]=CmContactEvents; \ No newline at end of file +var _0x7a9b=['save','update','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x19f53e,_0x567042){var _0x45c7d8=function(_0x3c62dd){while(--_0x3c62dd){_0x19f53e['push'](_0x19f53e['shift']());}};_0x45c7d8(++_0x567042);}(_0x7a9b,0xde));var _0xb7a9=function(_0x589dbb,_0x54338d){_0x589dbb=_0x589dbb-0x0;var _0x3972ab=_0x7a9b[_0x589dbb];return _0x3972ab;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xb7a9('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb7a9('0x1')](0x0);var events={'afterCreate':_0xb7a9('0x2'),'afterUpdate':_0xb7a9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5d45e0){return function(_0x2f4dc7,_0x2dd9aa,_0x3bec92){CmContactEvents['emit'](_0x5d45e0+':'+_0x2f4dc7['id'],_0x2f4dc7);CmContactEvents['emit'](_0x5d45e0,_0x2f4dc7);_0x3bec92(null);};}for(var e in events){if(events[_0xb7a9('0x4')](e)){var event=events[e];CmContact[_0xb7a9('0x5')](e,emitEvent(event));}}module[_0xb7a9('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 3052564..41a02ad 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x810e=['format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','callbackUniqueid','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','priority','catch','error','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','CmList','Lists','length','get','dialCheckDuplicateType','always','onlyIfOpen','cmContact,\x20%s,\x20%s','message','BlackLists','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','cmContact','afterCreate','inspect','scheduledat'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x810e,0x7d));var _0xe810=function(_0x3b7cc2,_0x41ac85){_0x3b7cc2=_0x3b7cc2-0x0;var _0x3b1f4=_0x810e[_0x3b7cc2];return _0x3b1f4;};'use strict';var _=require(_0xe810('0x0'));var util=require(_0xe810('0x1'));var logger=require(_0xe810('0x2'))(_0xe810('0x3'));var moment=require(_0xe810('0x4'));var BPromise=require('bluebird');var rp=require(_0xe810('0x5'));var fs=require('fs');var path=require(_0xe810('0x6'));var rimraf=require('rimraf');var config=require(_0xe810('0x7'));var shared=require(_0xe810('0x8'));var attributes=require(_0xe810('0x9'));module[_0xe810('0xa')]=function(_0x527f30,_0x45c624){return _0x527f30['define']('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xe810('0xb'),'fields':['phone']},{'name':_0xe810('0xc'),'fields':[_0xe810('0xd'),_0xe810('0xe'),'phone',_0xe810('0xf'),'fax',_0xe810('0x10')],'type':_0xe810('0x11')}],'timestamps':!![],'charset':_0xe810('0x12'),'collate':_0xe810('0x13'),'hooks':{'afterCreate':function(_0x377623,_0x111202,_0x322f09){var _0x1f954a=_0x527f30[_0xe810('0x14')];var _0x46ddfa=_0x377623['get']({'plain':!![]});function _0x69c0b5(){return function(_0x5f3e66){logger['error'](_0xe810('0x15'),_0xe810('0x16'),util[_0xe810('0x17')](_0x5f3e66,{'showHidden':![],'depth':null}));};}function _0x2eb918(_0x480565,_0x144e99){var _0x5bc7e3=_0x144e99[_0xe810('0x18')]?_0x144e99[_0xe810('0x18')]:moment()[_0xe810('0x19')](_0xe810('0x1a'));return new BPromise(function(_0x50fc30,_0x1b76dc){if(_[_0xe810('0x1b')](_0x144e99[_0xe810('0x1c')])){_0x50fc30({'ret':_0x5bc7e3});}else{_0x1f954a[_0xe810('0x1d')][_0xe810('0x1e')]({'where':{'id':_0x480565['id']}})[_0xe810('0x1f')](function(_0x4d3b24){if(!_['isNil'](_0x4d3b24)){var _0x261640=_0x4d3b24[_0xe810('0x1c')];if(!_[_0xe810('0x1b')](_0x261640)){var _0x5501fa=shared[_0xe810('0x20')];var _0x3318d0=_0x5501fa[_0x261640];var _0xce05bc=_0x5501fa[_0x144e99[_0xe810('0x1c')]];if(!_[_0xe810('0x1b')](_0x3318d0)&&!_[_0xe810('0x1b')](_0xce05bc)){var _0x3c00c6=_0x3318d0['utcOffset']-_0xce05bc[_0xe810('0x21')];_0x5bc7e3=_0x144e99[_0xe810('0x18')]?_0x144e99['scheduledat']:moment();var _0x2ade87=moment(_0x5bc7e3)[_0xe810('0x22')](_0x3c00c6,_0xe810('0x23'));_0x50fc30({'ret':_0x2ade87[_0xe810('0x19')](_0xe810('0x1a'))});}else _0x50fc30({'ret':_0x5bc7e3});}else _0x50fc30({'ret':_0x5bc7e3});}else{_0x50fc30({'ret':_0x5bc7e3});}});}});return 0xa;}var _0x4c1168=function(_0x3e7949){return new BPromise(function(_0x1da5e7,_0x17d91c){_0x2eb918(_0x3e7949,_0x46ddfa)[_0xe810('0x1f')](function(_0x2bbb32){_0x46ddfa['scheduledat']=_0x2bbb32[_0xe810('0x24')];_0x1f954a[_0xe810('0x25')][_0xe810('0x1e')]({'where':{'phone':_0x46ddfa['phone'],'VoiceQueueId':_0x3e7949['id']}})[_0xe810('0x1f')](function(_0x4aeffb){if(!_['isNil'](_0x4aeffb)){throw new Error('cmContact,\x20afterCreate\x20'+_0x46ddfa[_0xe810('0xb')]+_0xe810('0x26')+_0x3e7949['id']);}return _0x1f954a[_0xe810('0x25')][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa[_0xe810('0x28')],'priority':_0x46ddfa['priority']?_0x46ddfa['priority']:0x2,'scheduledat':_0x46ddfa[_0xe810('0x18')]?_0x46ddfa['scheduledat']:moment()[_0xe810('0x19')](_0xe810('0x1a')),'callback':_0x46ddfa[_0xe810('0x29')]?!![]:![],'callbackuniqueid':_0x46ddfa['callbackUniqueid']?_0x46ddfa[_0xe810('0x29')]:undefined,'callbackat':_0x46ddfa[_0xe810('0x29')]?moment()['format'](_0xe810('0x1a')):undefined,'VoiceQueueId':_0x3e7949['id']});})['catch'](function(_0x39f69d){_0x17d91c(_0x39f69d);});});});};var _0x1327ce=function(_0x502a41){return new BPromise(function(_0x79696,_0x347349){_0x2eb918(_0x502a41,_0x46ddfa)[_0xe810('0x1f')](function(_0xccfc86){_0x46ddfa[_0xe810('0x18')]=_0xccfc86[_0xe810('0x24')];_0x1f954a[_0xe810('0x25')][_0xe810('0x1e')]({'where':{'phone':_0x46ddfa[_0xe810('0xb')],'VoiceQueueId':_0x502a41['id']}})[_0xe810('0x1f')](function(_0x4d7547){if(!_[_0xe810('0x1b')](_0x4d7547)){throw new Error(_0xe810('0x2a')+_0x46ddfa[_0xe810('0xb')]+_0xe810('0x2b')+_0x502a41['id']);}return _0x1f954a['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x46ddfa[_0xe810('0xb')],'VoiceQueueId':_0x502a41['id']}});})[_0xe810('0x1f')](function(_0x318bf3){if(!_[_0xe810('0x1b')](_0x318bf3)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x46ddfa[_0xe810('0xb')]+_0xe810('0x2c')+_0x502a41['id']);}return _0x1f954a[_0xe810('0x25')][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa[_0xe810('0x28')],'priority':_0x46ddfa[_0xe810('0x2d')]?_0x46ddfa['priority']:0x2,'scheduledat':_0x46ddfa[_0xe810('0x18')]?_0x46ddfa['scheduledat']:moment()[_0xe810('0x19')](_0xe810('0x1a')),'callback':_0x46ddfa['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x46ddfa[_0xe810('0x29')]?_0x46ddfa[_0xe810('0x29')]:undefined,'callbackat':_0x46ddfa[_0xe810('0x29')]?moment()[_0xe810('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x502a41['id']});})[_0xe810('0x2e')](function(_0x1027f9){_0x347349(_0x1027f9);});});});};function _0x4fe80a(){return function(_0x866d0a){logger[_0xe810('0x2f')](_0xe810('0x15'),'afterCreate',util[_0xe810('0x17')](_0x866d0a,{'showHidden':![],'depth':null}));};}function _0x118b29(_0x33b456,_0x343766){var _0x15f278=_0x343766[_0xe810('0x18')]?_0x343766[_0xe810('0x18')]:moment()['format'](_0xe810('0x1a'));return new BPromise(function(_0x110ea6,_0x592497){if(_['isNil'](_0x343766[_0xe810('0x1c')])){_0x110ea6({'ret':_0x15f278});}else{_0x1f954a[_0xe810('0x30')][_0xe810('0x1e')]({'where':{'id':_0x33b456['id']}})[_0xe810('0x1f')](function(_0x7540bd){if(!_[_0xe810('0x1b')](_0x7540bd)){var _0x48a383=_0x7540bd[_0xe810('0x1c')];if(!_[_0xe810('0x1b')](_0x48a383)){var _0x24bb82=shared[_0xe810('0x20')];var _0xdcd560=_0x24bb82[_0x48a383];var _0x46f95b=_0x24bb82[_0x343766[_0xe810('0x1c')]];if(!_['isNil'](_0xdcd560)&&!_[_0xe810('0x1b')](_0x46f95b)){var _0x4ac418=_0xdcd560['utcOffset']-_0x46f95b[_0xe810('0x21')];_0x15f278=_0x343766[_0xe810('0x18')]?_0x343766[_0xe810('0x18')]:moment();var _0x4142fd=moment(_0x15f278)[_0xe810('0x22')](_0x4ac418,'minutes');_0x110ea6({'ret':_0x4142fd[_0xe810('0x19')](_0xe810('0x1a'))});}else _0x110ea6({'ret':_0x15f278});}else _0x110ea6({'ret':_0x15f278});}else{_0x110ea6({'ret':_0x15f278});}});}});return 0xa;}var _0x310a9b=function(_0x72ead){return new BPromise(function(_0x219287,_0x5aa948){_0x118b29(_0x72ead,_0x46ddfa)['then'](function(_0x54b393){_0x46ddfa[_0xe810('0x18')]=_0x54b393[_0xe810('0x24')];_0x1f954a['CmHopper'][_0xe810('0x1e')]({'where':{'phone':_0x46ddfa[_0xe810('0xb')],'CampaignId':_0x72ead['id']}})[_0xe810('0x1f')](function(_0x4a31c8){if(!_['isNil'](_0x4a31c8)){throw new Error(_0xe810('0x2a')+_0x46ddfa['phone']+_0xe810('0x31')+_0x72ead['id']);}return _0x1f954a[_0xe810('0x25')][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa['ListId'],'priority':_0x46ddfa[_0xe810('0x2d')]?_0x46ddfa['priority']:0x2,'scheduledat':_0x46ddfa['scheduledat']?_0x46ddfa[_0xe810('0x18')]:moment()[_0xe810('0x19')](_0xe810('0x1a')),'callback':_0x46ddfa[_0xe810('0x29')]?!![]:![],'callbackuniqueid':_0x46ddfa[_0xe810('0x29')]?_0x46ddfa[_0xe810('0x29')]:undefined,'callbackat':_0x46ddfa[_0xe810('0x29')]?moment()[_0xe810('0x19')](_0xe810('0x1a')):undefined,'CampaignId':_0x72ead['id']});})[_0xe810('0x2e')](function(_0x11bef5){_0x5aa948(_0x11bef5);});});});};var _0x2fceca=function(_0x2b053d){return new BPromise(function(_0x38a011,_0x5b4ae8){_0x118b29(_0x2b053d,_0x46ddfa)[_0xe810('0x1f')](function(_0x239e55){_0x46ddfa[_0xe810('0x18')]=_0x239e55['ret'];_0x1f954a['CmHopper'][_0xe810('0x1e')]({'where':{'phone':_0x46ddfa['phone'],'CampaignId':_0x2b053d['id']}})['then'](function(_0xb48770){if(!_[_0xe810('0x1b')](_0xb48770)){throw new Error(_0xe810('0x2a')+_0x46ddfa['phone']+_0xe810('0x32')+_0x2b053d['id']);}return _0x1f954a[_0xe810('0x33')][_0xe810('0x1e')]({'where':{'calleridnum':_0x46ddfa['phone'],'CampaignId':_0x2b053d['id']}});})[_0xe810('0x1f')](function(_0x60990b){if(!_[_0xe810('0x1b')](_0x60990b)){throw new Error(_0xe810('0x34')+_0x46ddfa[_0xe810('0xb')]+_0xe810('0x35')+_0x2b053d['id']);}return _0x1f954a[_0xe810('0x25')][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa['ListId'],'priority':_0x46ddfa[_0xe810('0x2d')]?_0x46ddfa[_0xe810('0x2d')]:0x2,'scheduledat':_0x46ddfa['scheduledat']?_0x46ddfa[_0xe810('0x18')]:moment()[_0xe810('0x19')](_0xe810('0x1a')),'callback':_0x46ddfa[_0xe810('0x29')]?!![]:![],'callbackuniqueid':_0x46ddfa[_0xe810('0x29')]?_0x46ddfa['callbackUniqueid']:undefined,'callbackat':_0x46ddfa[_0xe810('0x29')]?moment()[_0xe810('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x2b053d['id']});})[_0xe810('0x2e')](function(_0x1deb40){_0x5b4ae8(_0x1deb40);});});});};if(_0x46ddfa[_0xe810('0x28')]){_0x1f954a[_0xe810('0x1d')][_0xe810('0x36')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0xe810('0x1c')],'include':[{'model':_0x1f954a[_0xe810('0x37')],'as':_0xe810('0x38'),'where':{'id':_0x46ddfa[_0xe810('0x28')]}}]})[_0xe810('0x1f')](function(_0x328639){if(_0x328639){var _0xeee8c7=[];for(var _0x1e7eae=0x0,_0x2f0142;_0x1e7eae<_0x328639[_0xe810('0x39')];_0x1e7eae+=0x1){_0x2f0142=_0x328639[_0x1e7eae][_0xe810('0x3a')]({'plain':!![]});switch(_0x2f0142[_0xe810('0x3b')]){case _0xe810('0x3c'):_0x1327ce(_0x2f0142)[_0xe810('0x2e')](_0x69c0b5());break;case _0xe810('0x3d'):_0x4c1168(_0x2f0142)['catch'](_0x69c0b5());break;default:_0x118b29(_0x2f0142,_0x46ddfa)[_0xe810('0x1f')](function(_0x8b41d8){_0x46ddfa[_0xe810('0x18')]=_0x8b41d8[_0xe810('0x24')];_0x1f954a[_0xe810('0x25')][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa['ListId'],'scheduledat':_0x46ddfa['scheduledat']?_0x46ddfa[_0xe810('0x18')]:moment()[_0xe810('0x19')](_0xe810('0x1a')),'priority':_0x46ddfa[_0xe810('0x2d')]?_0x46ddfa[_0xe810('0x2d')]:0x2,'callback':_0x46ddfa['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x46ddfa[_0xe810('0x29')]?_0x46ddfa[_0xe810('0x29')]:undefined,'callbackat':_0x46ddfa['callbackUniqueid']?moment()['format'](_0xe810('0x1a')):undefined,'VoiceQueueId':_0x2f0142['id']})[_0xe810('0x2e')](_0x69c0b5());});}}}})[_0xe810('0x1f')](function(){return _0x1f954a[_0xe810('0x1d')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1f954a[_0xe810('0x37')],'as':'BlackLists','where':{'id':_0x46ddfa[_0xe810('0x28')]}}]})[_0xe810('0x1f')](function(_0xd9c781){if(_0xd9c781){var _0x24bd63=[];for(var _0x5cbc29=0x0,_0x2e98b2;_0x5cbc29<_0xd9c781[_0xe810('0x39')];_0x5cbc29+=0x1){_0x2e98b2=_0xd9c781[_0x5cbc29][_0xe810('0x3a')]({'plain':!![]});_0x1f954a['CmHopperBlack'][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa['ListId'],'VoiceQueueId':_0x2e98b2['id']})[_0xe810('0x2e')](function(_0x1f380a){logger[_0xe810('0x2f')](_0xe810('0x3e'),_0xe810('0x16'),_0x1f380a[_0xe810('0x3f')]);});}}});})[_0xe810('0x1f')](function(){return _0x1f954a[_0xe810('0x30')][_0xe810('0x36')]({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x1f954a['CmList'],'as':'Lists','where':{'id':_0x46ddfa[_0xe810('0x28')]}}]})['then'](function(_0x582435){if(_0x582435){var _0x457121=[];for(var _0x22e5fe=0x0,_0x514d8b;_0x22e5fe<_0x582435['length'];_0x22e5fe+=0x1){_0x514d8b=_0x582435[_0x22e5fe][_0xe810('0x3a')]({'plain':!![]});switch(_0x514d8b[_0xe810('0x3b')]){case _0xe810('0x3c'):_0x2fceca(_0x514d8b)[_0xe810('0x2e')](_0x4fe80a());break;case _0xe810('0x3d'):_0x310a9b(_0x514d8b)[_0xe810('0x2e')](_0x4fe80a());break;default:_0x1f954a[_0xe810('0x25')]['create']({'phone':_0x46ddfa['phone'],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa[_0xe810('0x28')],'scheduledat':_0x46ddfa['scheduledat']?_0x46ddfa[_0xe810('0x18')]:moment()[_0xe810('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x46ddfa[_0xe810('0x2d')]?_0x46ddfa[_0xe810('0x2d')]:0x2,'callback':_0x46ddfa[_0xe810('0x29')]?!![]:![],'callbackuniqueid':_0x46ddfa[_0xe810('0x29')]?_0x46ddfa[_0xe810('0x29')]:undefined,'callbackat':_0x46ddfa[_0xe810('0x29')]?moment()['format'](_0xe810('0x1a')):undefined,'CampaignId':_0x514d8b['id']})['catch'](_0x4fe80a());}}}});})[_0xe810('0x1f')](function(){return _0x1f954a[_0xe810('0x30')]['findAll']({'attributes':['id'],'include':[{'model':_0x1f954a['CmList'],'as':_0xe810('0x40'),'where':{'id':_0x46ddfa[_0xe810('0x28')]}}]})['then'](function(_0x2acc36){if(_0x2acc36){var _0x4e432f=[];for(var _0x4f985d=0x0,_0x5b75f4;_0x4f985d<_0x2acc36[_0xe810('0x39')];_0x4f985d+=0x1){_0x5b75f4=_0x2acc36[_0x4f985d][_0xe810('0x3a')]({'plain':!![]});_0x1f954a[_0xe810('0x41')][_0xe810('0x27')]({'phone':_0x46ddfa[_0xe810('0xb')],'ContactId':_0x46ddfa['id'],'ListId':_0x46ddfa[_0xe810('0x28')],'CampaignId':_0x5b75f4['id']})[_0xe810('0x2e')](function(_0x6494ba){logger[_0xe810('0x2f')](_0xe810('0x3e'),_0xe810('0x16'),_0x6494ba[_0xe810('0x3f')]);});}}});})[_0xe810('0x1f')](function(){_0x322f09();})[_0xe810('0x2e')](function(_0x3d9998){logger[_0xe810('0x2f')](_0xe810('0x3e'),_0xe810('0x16'),_0x3d9998[_0xe810('0x3f')]);_0x322f09(_0x3d9998);});}else{_0x322f09(new Error(_0xe810('0x42')));}},'afterDestroy':function(_0x4a4036,_0x434fa1,_0x587a35){var _0x17437a=_0x527f30[_0xe810('0x14')];var _0x387679=_0x4a4036['get']({'plain':!![]});return _0x17437a[_0xe810('0x25')][_0xe810('0x36')]({'raw':!![],'where':{'ListId':_0x387679[_0xe810('0x28')],'ContactId':_0x387679['id']}})[_0xe810('0x1f')](function(_0x4f855d){if(!_[_0xe810('0x43')](_0x4f855d)){var _0x36b8b1=[];for(var _0x4b1cca=0x0;_0x4b1cca<_0x4f855d[_0xe810('0x39')];_0x4b1cca+=0x1){var _0x53b101=_0x17437a[_0xe810('0x25')][_0xe810('0x44')]({'where':{'ListId':_0x4f855d[_0x4b1cca][_0xe810('0x28')],'ContactId':_0x4f855d[_0x4b1cca][_0xe810('0x45')],'VoiceQueueId':_0x4f855d[_0x4b1cca]['VoiceQueueId'],'CampaignId':_0x4f855d[_0x4b1cca][_0xe810('0x46')]}});_0x36b8b1[_0xe810('0x47')](_0x53b101);}return BPromise[_0xe810('0x48')](_0x36b8b1);}})['then'](function(_0x2a329f){logger[_0xe810('0x49')](_0xe810('0x4a'),util[_0xe810('0x17')](_0x2a329f,{'showHidden':![],'depth':null}));_0x587a35();})[_0xe810('0x2e')](function(_0x360ab5){logger['error']('[CmContact][afterDestroy][Error]',util[_0xe810('0x17')](_0x360ab5,{'showHidden':![],'depth':null}));_0x587a35(_0x360ab5);});}}});}; \ No newline at end of file +var _0x67ce=['api','moment','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','Lists','length','findAll','BlackLists','get','CmHopperBlack','cmContact,\x20%s,\x20%s','afterCreate','message','always','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger'];(function(_0x4c8f01,_0x170514){var _0x30c1f7=function(_0x2aae01){while(--_0x2aae01){_0x4c8f01['push'](_0x4c8f01['shift']());}};_0x30c1f7(++_0x170514);}(_0x67ce,0x93));var _0xe67c=function(_0x3b08cf,_0x274018){_0x3b08cf=_0x3b08cf-0x0;var _0x8d8103=_0x67ce[_0x3b08cf];return _0x8d8103;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe67c('0x0'))(_0xe67c('0x1'));var moment=require(_0xe67c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe67c('0x3'));var rimraf=require(_0xe67c('0x4'));var config=require(_0xe67c('0x5'));var shared=require(_0xe67c('0x6'));var attributes=require(_0xe67c('0x7'));module[_0xe67c('0x8')]=function(_0xcad6d3,_0x2c27c8){return _0xcad6d3[_0xe67c('0x9')](_0xe67c('0xa'),attributes,{'tableName':_0xe67c('0xb'),'paranoid':!![],'indexes':[{'name':_0xe67c('0xc'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0xe67c('0xd'),_0xe67c('0xe'),_0xe67c('0xc'),'mobile',_0xe67c('0xf'),_0xe67c('0x10')],'type':_0xe67c('0x11')}],'timestamps':!![],'charset':_0xe67c('0x12'),'collate':_0xe67c('0x13'),'hooks':{'afterCreate':function(_0xd950dc,_0xe6874c,_0x24e71e){var _0x475370=_0xcad6d3[_0xe67c('0x14')];var _0x2cad1c=_0xd950dc['get']({'plain':!![]});function _0x1ce207(){return function(_0x1c7d63){logger[_0xe67c('0x15')]('cmContact','afterCreate',util[_0xe67c('0x16')](_0x1c7d63,{'showHidden':![],'depth':null}));};}function _0x1d2de1(_0x1f827b,_0x2df5fd){var _0x4a70fb=_0x2df5fd[_0xe67c('0x17')]?_0x2df5fd['scheduledat']:moment()[_0xe67c('0x18')](_0xe67c('0x19'));return new BPromise(function(_0x45d135,_0x1e622d){if(_[_0xe67c('0x1a')](_0x2df5fd[_0xe67c('0x1b')])){_0x45d135({'ret':_0x4a70fb});}else{_0x475370[_0xe67c('0x1c')][_0xe67c('0x1d')]({'where':{'id':_0x1f827b['id']}})[_0xe67c('0x1e')](function(_0x47a46){if(!_[_0xe67c('0x1a')](_0x47a46)){var _0x2e2e40=_0x47a46[_0xe67c('0x1b')];if(!_[_0xe67c('0x1a')](_0x2e2e40)){var _0x23c013=shared[_0xe67c('0x1f')];var _0x5292e0=_0x23c013[_0x2e2e40];var _0xd2db3f=_0x23c013[_0x2df5fd['dialTimezone']];if(!_[_0xe67c('0x1a')](_0x5292e0)&&!_[_0xe67c('0x1a')](_0xd2db3f)){var _0x301bb3=_0x5292e0[_0xe67c('0x20')]-_0xd2db3f[_0xe67c('0x20')];_0x4a70fb=_0x2df5fd[_0xe67c('0x17')]?_0x2df5fd[_0xe67c('0x17')]:moment();var _0x17d38=moment(_0x4a70fb)['add'](_0x301bb3,_0xe67c('0x21'));_0x45d135({'ret':_0x17d38[_0xe67c('0x18')](_0xe67c('0x19'))});}else _0x45d135({'ret':_0x4a70fb});}else _0x45d135({'ret':_0x4a70fb});}else{_0x45d135({'ret':_0x4a70fb});}});}});return 0xa;}var _0x5f0851=function(_0x20883c){return new BPromise(function(_0x56245d,_0x4e0182){_0x1d2de1(_0x20883c,_0x2cad1c)[_0xe67c('0x1e')](function(_0x795cf0){_0x2cad1c['scheduledat']=_0x795cf0['ret'];_0x475370[_0xe67c('0x22')][_0xe67c('0x1d')]({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'VoiceQueueId':_0x20883c['id']}})[_0xe67c('0x1e')](function(_0x5091d6){if(!_[_0xe67c('0x1a')](_0x5091d6)){throw new Error(_0xe67c('0x23')+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x24')+_0x20883c['id']);}return _0x475370[_0xe67c('0x22')][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c['priority']?_0x2cad1c[_0xe67c('0x27')]:0x2,'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()['format'](_0xe67c('0x19')),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'VoiceQueueId':_0x20883c['id']});})[_0xe67c('0x29')](function(_0x406b66){_0x4e0182(_0x406b66);});});});};var _0x32bcf4=function(_0x363132){return new BPromise(function(_0x5ea542,_0x1864d7){_0x1d2de1(_0x363132,_0x2cad1c)[_0xe67c('0x1e')](function(_0x8c6a5e){_0x2cad1c[_0xe67c('0x17')]=_0x8c6a5e[_0xe67c('0x2a')];_0x475370[_0xe67c('0x22')][_0xe67c('0x1d')]({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'VoiceQueueId':_0x363132['id']}})['then'](function(_0x2898e0){if(!_['isNil'](_0x2898e0)){throw new Error(_0xe67c('0x23')+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x2b')+_0x363132['id']);}return _0x475370[_0xe67c('0x2c')]['findOne']({'where':{'calleridnum':_0x2cad1c[_0xe67c('0xc')],'VoiceQueueId':_0x363132['id']}});})['then'](function(_0x43bc3c){if(!_['isNil'](_0x43bc3c)){throw new Error(_0xe67c('0x2d')+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x2e')+_0x363132['id']);}return _0x475370[_0xe67c('0x22')]['create']({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19')),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c['callbackUniqueid']?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'VoiceQueueId':_0x363132['id']});})[_0xe67c('0x29')](function(_0x21a120){_0x1864d7(_0x21a120);});});});};function _0x32e49b(){return function(_0x59461d){logger[_0xe67c('0x15')](_0xe67c('0x2f'),'afterCreate',util['inspect'](_0x59461d,{'showHidden':![],'depth':null}));};}function _0x8230ca(_0x19b806,_0x3a516e){var _0x3c848e=_0x3a516e[_0xe67c('0x17')]?_0x3a516e[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19'));return new BPromise(function(_0x1ecc67,_0x1b922a){if(_['isNil'](_0x3a516e[_0xe67c('0x1b')])){_0x1ecc67({'ret':_0x3c848e});}else{_0x475370[_0xe67c('0x30')]['findOne']({'where':{'id':_0x19b806['id']}})['then'](function(_0x166172){if(!_[_0xe67c('0x1a')](_0x166172)){var _0x481082=_0x166172[_0xe67c('0x1b')];if(!_['isNil'](_0x481082)){var _0x35ded9=shared[_0xe67c('0x1f')];var _0x5803d7=_0x35ded9[_0x481082];var _0x501338=_0x35ded9[_0x3a516e[_0xe67c('0x1b')]];if(!_['isNil'](_0x5803d7)&&!_[_0xe67c('0x1a')](_0x501338)){var _0x5125a3=_0x5803d7[_0xe67c('0x20')]-_0x501338[_0xe67c('0x20')];_0x3c848e=_0x3a516e[_0xe67c('0x17')]?_0x3a516e['scheduledat']:moment();var _0x4b60bb=moment(_0x3c848e)[_0xe67c('0x31')](_0x5125a3,_0xe67c('0x21'));_0x1ecc67({'ret':_0x4b60bb[_0xe67c('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1ecc67({'ret':_0x3c848e});}else _0x1ecc67({'ret':_0x3c848e});}else{_0x1ecc67({'ret':_0x3c848e});}});}});return 0xa;}var _0x55241a=function(_0x17a985){return new BPromise(function(_0x27373a,_0x5aa697){_0x8230ca(_0x17a985,_0x2cad1c)[_0xe67c('0x1e')](function(_0x3c3d96){_0x2cad1c[_0xe67c('0x17')]=_0x3c3d96['ret'];_0x475370[_0xe67c('0x22')]['findOne']({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'CampaignId':_0x17a985['id']}})['then'](function(_0x513076){if(!_[_0xe67c('0x1a')](_0x513076)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x32')+_0x17a985['id']);}return _0x475370['CmHopper'][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c['priority']:0x2,'scheduledat':_0x2cad1c['scheduledat']?_0x2cad1c['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c['callbackUniqueid']?_0x2cad1c['callbackUniqueid']:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()['format'](_0xe67c('0x19')):undefined,'CampaignId':_0x17a985['id']});})[_0xe67c('0x29')](function(_0x58ea52){_0x5aa697(_0x58ea52);});});});};var _0x44d148=function(_0x40024f){return new BPromise(function(_0x11e39e,_0x3e1469){_0x8230ca(_0x40024f,_0x2cad1c)[_0xe67c('0x1e')](function(_0x31ad99){_0x2cad1c[_0xe67c('0x17')]=_0x31ad99[_0xe67c('0x2a')];_0x475370['CmHopper']['findOne']({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'CampaignId':_0x40024f['id']}})['then'](function(_0x2cc262){if(!_[_0xe67c('0x1a')](_0x2cc262)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x33')+_0x40024f['id']);}return _0x475370[_0xe67c('0x2c')][_0xe67c('0x1d')]({'where':{'calleridnum':_0x2cad1c[_0xe67c('0xc')],'CampaignId':_0x40024f['id']}});})[_0xe67c('0x1e')](function(_0x2b8c4f){if(!_[_0xe67c('0x1a')](_0x2b8c4f)){throw new Error(_0xe67c('0x2d')+_0x2cad1c['phone']+_0xe67c('0x34')+_0x40024f['id']);}return _0x475370[_0xe67c('0x22')]['create']({'phone':_0x2cad1c['phone'],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19')),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c['callbackUniqueid']?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'CampaignId':_0x40024f['id']});})[_0xe67c('0x29')](function(_0x5b73cb){_0x3e1469(_0x5b73cb);});});});};if(_0x2cad1c[_0xe67c('0x26')]){_0x475370['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xe67c('0x35'),_0xe67c('0x1b')],'include':[{'model':_0x475370[_0xe67c('0x36')],'as':_0xe67c('0x37'),'where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x41bd34){if(_0x41bd34){var _0x18eb34=[];for(var _0x8110d6=0x0,_0x126907;_0x8110d6<_0x41bd34[_0xe67c('0x38')];_0x8110d6+=0x1){_0x126907=_0x41bd34[_0x8110d6]['get']({'plain':!![]});switch(_0x126907[_0xe67c('0x35')]){case'always':_0x32bcf4(_0x126907)['catch'](_0x1ce207());break;case'onlyIfOpen':_0x5f0851(_0x126907)[_0xe67c('0x29')](_0x1ce207());break;default:_0x8230ca(_0x126907,_0x2cad1c)[_0xe67c('0x1e')](function(_0x3b40f5){_0x2cad1c[_0xe67c('0x17')]=_0x3b40f5[_0xe67c('0x2a')];_0x475370[_0xe67c('0x22')]['create']({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19')),'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c['callbackUniqueid']:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'VoiceQueueId':_0x126907['id']})[_0xe67c('0x29')](_0x1ce207());});}}}})[_0xe67c('0x1e')](function(){return _0x475370[_0xe67c('0x1c')][_0xe67c('0x39')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x475370[_0xe67c('0x36')],'as':_0xe67c('0x3a'),'where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x40633f){if(_0x40633f){var _0x29ac8d=[];for(var _0x3f9b52=0x0,_0x2ae13c;_0x3f9b52<_0x40633f[_0xe67c('0x38')];_0x3f9b52+=0x1){_0x2ae13c=_0x40633f[_0x3f9b52][_0xe67c('0x3b')]({'plain':!![]});_0x475370[_0xe67c('0x3c')][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'VoiceQueueId':_0x2ae13c['id']})[_0xe67c('0x29')](function(_0x4c3c36){logger[_0xe67c('0x15')](_0xe67c('0x3d'),_0xe67c('0x3e'),_0x4c3c36[_0xe67c('0x3f')]);});}}});})[_0xe67c('0x1e')](function(){return _0x475370['Campaign'][_0xe67c('0x39')]({'attributes':['id',_0xe67c('0x35'),_0xe67c('0x1b')],'include':[{'model':_0x475370['CmList'],'as':'Lists','where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x4ddf42){if(_0x4ddf42){var _0x16ac4f=[];for(var _0x4a18c3=0x0,_0x32f3ab;_0x4a18c3<_0x4ddf42[_0xe67c('0x38')];_0x4a18c3+=0x1){_0x32f3ab=_0x4ddf42[_0x4a18c3][_0xe67c('0x3b')]({'plain':!![]});switch(_0x32f3ab[_0xe67c('0x35')]){case _0xe67c('0x40'):_0x44d148(_0x32f3ab)[_0xe67c('0x29')](_0x32e49b());break;case'onlyIfOpen':_0x55241a(_0x32f3ab)[_0xe67c('0x29')](_0x32e49b());break;default:_0x475370['CmHopper'][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c['ListId'],'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()['format'](_0xe67c('0x19')),'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()['format'](_0xe67c('0x19')):undefined,'CampaignId':_0x32f3ab['id']})['catch'](_0x32e49b());}}}});})[_0xe67c('0x1e')](function(){return _0x475370[_0xe67c('0x30')][_0xe67c('0x39')]({'attributes':['id'],'include':[{'model':_0x475370['CmList'],'as':_0xe67c('0x3a'),'where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x4fad37){if(_0x4fad37){var _0x1de6d9=[];for(var _0x395192=0x0,_0xd793d0;_0x395192<_0x4fad37[_0xe67c('0x38')];_0x395192+=0x1){_0xd793d0=_0x4fad37[_0x395192]['get']({'plain':!![]});_0x475370[_0xe67c('0x3c')]['create']({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'CampaignId':_0xd793d0['id']})['catch'](function(_0x58e7cf){logger[_0xe67c('0x15')](_0xe67c('0x3d'),_0xe67c('0x3e'),_0x58e7cf[_0xe67c('0x3f')]);});}}});})[_0xe67c('0x1e')](function(){_0x24e71e();})[_0xe67c('0x29')](function(_0x713c08){logger[_0xe67c('0x15')](_0xe67c('0x3d'),'afterCreate',_0x713c08[_0xe67c('0x3f')]);_0x24e71e(_0x713c08);});}else{_0x24e71e(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x179b35,_0x2ebb44,_0x1ab2ae){var _0x307e9b=_0xcad6d3['models'];var _0x12691b=_0x179b35[_0xe67c('0x3b')]({'plain':!![]});return _0x307e9b[_0xe67c('0x22')][_0xe67c('0x39')]({'raw':!![],'where':{'ListId':_0x12691b['ListId'],'ContactId':_0x12691b['id']}})[_0xe67c('0x1e')](function(_0x419303){if(!_[_0xe67c('0x41')](_0x419303)){var _0x224911=[];for(var _0x19419c=0x0;_0x19419c<_0x419303[_0xe67c('0x38')];_0x19419c+=0x1){var _0x789841=_0x307e9b['CmHopper'][_0xe67c('0x42')]({'where':{'ListId':_0x419303[_0x19419c][_0xe67c('0x26')],'ContactId':_0x419303[_0x19419c][_0xe67c('0x43')],'VoiceQueueId':_0x419303[_0x19419c][_0xe67c('0x44')],'CampaignId':_0x419303[_0x19419c]['CampaignId']}});_0x224911[_0xe67c('0x45')](_0x789841);}return BPromise[_0xe67c('0x46')](_0x224911);}})[_0xe67c('0x1e')](function(_0x2d520b){logger[_0xe67c('0x47')](_0xe67c('0x48'),util[_0xe67c('0x16')](_0x2d520b,{'showHidden':![],'depth':null}));_0x1ab2ae();})['catch'](function(_0x56f77a){logger[_0xe67c('0x15')](_0xe67c('0x49'),util['inspect'](_0x56f77a,{'showHidden':![],'depth':null}));_0x1ab2ae(_0x56f77a);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index a0acd54..1705669 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -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(_0x412336,_0x580f47){var _0x2ddc25=function(_0x373637){while(--_0x373637){_0x412336['push'](_0x412336['shift']());}};_0x2ddc25(++_0x580f47);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x3cdef4,_0x2af657){var _0x5a3dde=function(_0x2a5b6e){while(--_0x2a5b6e){_0x3cdef4['push'](_0x3cdef4['shift']());}};_0x5a3dde(++_0x2af657);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 208cad3..4068afb 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4876=['INTEGER','STRING'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x6487('0x0')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6487('0x1')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x6487('0x0')],'defaultValue':null},'description':{'type':Sequelize[_0x6487('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0x3e25=['sequelize','exports','INTEGER','PHONE','STRING'];(function(_0x3653e7,_0x26c282){var _0x123183=function(_0xeab97f){while(--_0xeab97f){_0x3653e7['push'](_0x3653e7['shift']());}};_0x123183(++_0x26c282);}(_0x3e25,0x14f));var _0x53e2=function(_0x528038,_0x5474b6){_0x528038=_0x528038-0x0;var _0x190ae1=_0x3e25[_0x528038];return _0x190ae1;};'use strict';var Sequelize=require(_0x53e2('0x0'));module[_0x53e2('0x1')]={'CmContactId':{'type':Sequelize[_0x53e2('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x53e2('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x53e2('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x53e2('0x4')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index c693472..7953090 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x287f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','catch','rawAttributes','intersection','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x217214,_0x5133d8){var _0x5a4889=function(_0x3a7dbd){while(--_0x3a7dbd){_0x217214['push'](_0x217214['shift']());}};_0x5a4889(++_0x5133d8);}(_0x287f,0x13a));var _0xf287=function(_0x3fbcaf,_0x4cb505){_0x3fbcaf=_0x3fbcaf-0x0;var _0x37d09e=_0x287f[_0x3fbcaf];return _0x37d09e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf287('0x0'));var zipdir=require(_0xf287('0x1'));var jsonpatch=require(_0xf287('0x2'));var rp=require(_0xf287('0x3'));var moment=require('moment');var BPromise=require(_0xf287('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf287('0x5'));var csv=require(_0xf287('0x6'));var ejs=require(_0xf287('0x7'));var fs=require('fs');var fs_extra=require(_0xf287('0x8'));var _=require(_0xf287('0x9'));var squel=require(_0xf287('0xa'));var crypto=require('crypto');var jsforce=require(_0xf287('0xb'));var deskjs=require(_0xf287('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf287('0xd'));var Papa=require(_0xf287('0xe'));var Redis=require(_0xf287('0xf'));var authService=require(_0xf287('0x10'));var qs=require(_0xf287('0x11'));var as=require(_0xf287('0x12'));var hardwareService=require(_0xf287('0x13'));var logger=require(_0xf287('0x14'))(_0xf287('0x15'));var utils=require('../../config/utils');var config=require(_0xf287('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x212ed1,_0x286884){_0x286884=_0x286884||0xcc;return function(_0x3a7769){if(_0x3a7769){return _0x212ed1[_0xf287('0x17')](_0x286884);}return _0x212ed1[_0xf287('0x18')](_0x286884)[_0xf287('0x19')]();};}function respondWithResult(_0x5ca320,_0x436432){_0x436432=_0x436432||0xc8;return function(_0x2f0e19){if(_0x2f0e19){return _0x5ca320['status'](_0x436432)[_0xf287('0x1a')](_0x2f0e19);}};}function respondWithFilteredResult(_0x1771b2,_0x31dc75){return function(_0x465d6e){if(_0x465d6e){var _0x473685=typeof _0x31dc75[_0xf287('0x1b')]===_0xf287('0x1c')&&typeof _0x31dc75[_0xf287('0x1d')]===_0xf287('0x1c');var _0x1d224c=_0x465d6e[_0xf287('0x1e')];var _0x25b210=_0x473685?0x0:_0x31dc75[_0xf287('0x1b')];var _0x5b416f=_0x473685?_0x465d6e[_0xf287('0x1e')]:_0x31dc75['offset']+_0x31dc75[_0xf287('0x1d')];var _0x12ca8a;if(_0x5b416f>=_0x1d224c){_0x5b416f=_0x1d224c;_0x12ca8a=0xc8;}else{_0x12ca8a=0xce;}_0x1771b2[_0xf287('0x18')](_0x12ca8a);return _0x1771b2[_0xf287('0x1f')](_0xf287('0x20'),_0x25b210+'-'+_0x5b416f+'/'+_0x1d224c)[_0xf287('0x1a')](_0x465d6e);}return null;};}function patchUpdates(_0x50932b){return function(_0x2effe6){try{jsonpatch[_0xf287('0x21')](_0x2effe6,_0x50932b,!![]);}catch(_0x128ec8){return BPromise[_0xf287('0x22')](_0x128ec8);}return _0x2effe6[_0xf287('0x23')]();};}function saveUpdates(_0x4663e9,_0x4b5076){return function(_0x25504b){if(_0x25504b){return _0x25504b[_0xf287('0x24')](_0x4663e9)[_0xf287('0x25')](function(_0x35ae93){return _0x35ae93;});}return null;};}function removeEntity(_0x4348dc,_0x3f4c52){return function(_0x341c25){if(_0x341c25){return _0x341c25[_0xf287('0x26')]()['then'](function(){var _0x366b77=_0x341c25[_0xf287('0x27')]({'plain':!![]});var _0x394466=_0xf287('0x28');return db[_0xf287('0x29')][_0xf287('0x26')]({'where':{'type':_0x394466,'resourceId':_0x366b77['id']}})[_0xf287('0x25')](function(){return _0x341c25;});})[_0xf287('0x25')](function(){_0x4348dc[_0xf287('0x18')](0xcc)[_0xf287('0x19')]();});}};}function handleEntityNotFound(_0x4689e5,_0x2d4476){return function(_0x5e9bf6){if(!_0x5e9bf6){_0x4689e5[_0xf287('0x17')](0x194);}return _0x5e9bf6;};}function handleError(_0x17b2bb,_0x57211a){_0x57211a=_0x57211a||0x1f4;return function(_0x394604){logger[_0xf287('0x2a')](_0x394604[_0xf287('0x2b')]);if(_0x394604[_0xf287('0x2c')]){delete _0x394604[_0xf287('0x2c')];}_0x17b2bb[_0xf287('0x18')](_0x57211a)[_0xf287('0x2d')](_0x394604);};}exports[_0xf287('0x2e')]=function(_0x55421,_0x33975e){var _0x57ef46={},_0x21eacd={},_0x41b074={'count':0x0,'rows':[]};var _0xdbc8c5=_[_0xf287('0x2f')](db[_0xf287('0x30')]['rawAttributes'],function(_0x2c2bfb){return{'name':_0x2c2bfb[_0xf287('0x31')],'type':_0x2c2bfb[_0xf287('0x32')][_0xf287('0x33')]};});_0x21eacd[_0xf287('0x34')]=_[_0xf287('0x2f')](_0xdbc8c5,_0xf287('0x2c'));_0x21eacd['query']=_[_0xf287('0x35')](_0x55421[_0xf287('0x36')]);_0x21eacd[_0xf287('0x37')]=_['intersection'](_0x21eacd[_0xf287('0x34')],_0x21eacd[_0xf287('0x36')]);_0x57ef46[_0xf287('0x38')]=_['intersection'](_0x21eacd[_0xf287('0x34')],qs[_0xf287('0x39')](_0x55421[_0xf287('0x36')]['fields']));_0x57ef46[_0xf287('0x38')]=_0x57ef46[_0xf287('0x38')][_0xf287('0x3a')]?_0x57ef46[_0xf287('0x38')]:_0x21eacd[_0xf287('0x34')];if(!_0x55421['query'][_0xf287('0x3b')](_0xf287('0x3c'))){_0x57ef46[_0xf287('0x1d')]=qs[_0xf287('0x1d')](_0x55421[_0xf287('0x36')][_0xf287('0x1d')]);_0x57ef46[_0xf287('0x1b')]=qs['offset'](_0x55421[_0xf287('0x36')][_0xf287('0x1b')]);}_0x57ef46['order']=qs[_0xf287('0x3d')](_0x55421[_0xf287('0x36')][_0xf287('0x3d')]);_0x57ef46['where']=qs[_0xf287('0x37')](_[_0xf287('0x3e')](_0x55421['query'],_0x21eacd[_0xf287('0x37')]),_0xdbc8c5);if(_0x55421['query'][_0xf287('0x3f')]){_0x57ef46[_0xf287('0x40')]=_[_0xf287('0x41')](_0x57ef46['where'],{'$or':_['map'](_0xdbc8c5,function(_0x2ef5ba){if(_0x2ef5ba[_0xf287('0x32')]!=='VIRTUAL'){var _0x39afeb={};_0x39afeb[_0x2ef5ba[_0xf287('0x2c')]]={'$like':'%'+_0x55421[_0xf287('0x36')][_0xf287('0x3f')]+'%'};return _0x39afeb;}})});}_0x57ef46=_[_0xf287('0x41')]({},_0x57ef46,_0x55421[_0xf287('0x42')]);var _0x27b74e={'where':_0x57ef46[_0xf287('0x40')]};return db[_0xf287('0x30')]['count'](_0x27b74e)[_0xf287('0x25')](function(_0x2648e7){_0x41b074[_0xf287('0x1e')]=_0x2648e7;if(_0x55421[_0xf287('0x36')]['includeAll']){_0x57ef46[_0xf287('0x43')]=[{'all':!![]}];}return db[_0xf287('0x30')][_0xf287('0x44')](_0x57ef46);})['then'](function(_0x5d8888){_0x41b074['rows']=_0x5d8888;return _0x41b074;})[_0xf287('0x25')](respondWithFilteredResult(_0x33975e,_0x57ef46))[_0xf287('0x45')](handleError(_0x33975e,null));};exports['show']=function(_0x5f0e5f,_0x2566bf){var _0xcdbb6a={'raw':!![],'where':{'id':_0x5f0e5f['params']['id']}},_0x453002={};_0x453002['model']=_[_0xf287('0x35')](db[_0xf287('0x30')][_0xf287('0x46')]);_0x453002[_0xf287('0x36')]=_[_0xf287('0x35')](_0x5f0e5f[_0xf287('0x36')]);_0x453002[_0xf287('0x37')]=_[_0xf287('0x47')](_0x453002[_0xf287('0x34')],_0x453002[_0xf287('0x36')]);_0xcdbb6a['attributes']=_[_0xf287('0x47')](_0x453002[_0xf287('0x34')],qs[_0xf287('0x39')](_0x5f0e5f['query'][_0xf287('0x39')]));_0xcdbb6a[_0xf287('0x38')]=_0xcdbb6a[_0xf287('0x38')][_0xf287('0x3a')]?_0xcdbb6a[_0xf287('0x38')]:_0x453002[_0xf287('0x34')];if(_0x5f0e5f[_0xf287('0x36')][_0xf287('0x48')]){_0xcdbb6a[_0xf287('0x43')]=[{'all':!![]}];}_0xcdbb6a=_[_0xf287('0x41')]({},_0xcdbb6a,_0x5f0e5f[_0xf287('0x42')]);return db[_0xf287('0x30')][_0xf287('0x49')](_0xcdbb6a)[_0xf287('0x25')](handleEntityNotFound(_0x2566bf,null))[_0xf287('0x25')](respondWithResult(_0x2566bf,null))[_0xf287('0x45')](handleError(_0x2566bf,null));};exports['create']=function(_0x689cc1,_0x3c3fd1){return db[_0xf287('0x30')][_0xf287('0x4a')](_0x689cc1['body'],{})['then'](function(_0x18ed8e){var _0xed18cf=_0x689cc1[_0xf287('0x4b')][_0xf287('0x27')]({'plain':!![]});if(!_0xed18cf)throw new Error(_0xf287('0x4c'));if(_0xed18cf['role']===_0xf287('0x4b')){var _0x189c7a=_0x18ed8e[_0xf287('0x27')]({'plain':!![]});var _0x4f8a7a=_0xf287('0x28');return db[_0xf287('0x4d')]['find']({'where':{'name':_0x4f8a7a,'userProfileId':_0xed18cf[_0xf287('0x4e')]},'raw':!![]})[_0xf287('0x25')](function(_0x2adef8){if(_0x2adef8&&_0x2adef8['autoAssociation']===0x0){return db[_0xf287('0x29')]['create']({'name':_0x189c7a[_0xf287('0x2c')],'resourceId':_0x189c7a['id'],'type':_0x2adef8[_0xf287('0x2c')],'sectionId':_0x2adef8['id']},{})[_0xf287('0x25')](function(){return _0x18ed8e;});}else{return _0x18ed8e;}})[_0xf287('0x45')](function(_0x15ede0){logger['error'](_0xf287('0x4f'),_0x15ede0);throw _0x15ede0;});}return _0x18ed8e;})[_0xf287('0x25')](respondWithResult(_0x3c3fd1,0xc9))[_0xf287('0x45')](handleError(_0x3c3fd1,null));};exports['update']=function(_0x1daeb4,_0x59f959){if(_0x1daeb4[_0xf287('0x50')]['id']){delete _0x1daeb4[_0xf287('0x50')]['id'];}return db[_0xf287('0x30')][_0xf287('0x49')]({'where':{'id':_0x1daeb4[_0xf287('0x51')]['id']}})[_0xf287('0x25')](handleEntityNotFound(_0x59f959,null))['then'](saveUpdates(_0x1daeb4[_0xf287('0x50')],null))['then'](respondWithResult(_0x59f959,null))[_0xf287('0x45')](handleError(_0x59f959,null));};exports[_0xf287('0x26')]=function(_0x2e9e4c,_0x26364a){return db['CmContactHasItem'][_0xf287('0x49')]({'where':{'id':_0x2e9e4c[_0xf287('0x51')]['id']}})[_0xf287('0x25')](handleEntityNotFound(_0x26364a,null))['then'](removeEntity(_0x26364a,null))[_0xf287('0x45')](handleError(_0x26364a,null));}; \ No newline at end of file +var _0x0046=['type','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','then','get','CmContactHasItems','UserProfileResource','destroy','stack','name','send','map','CmContactHasItem','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x4b3b17,_0x1a0000){var _0x1f1bbe=function(_0x4c2326){while(--_0x4c2326){_0x4b3b17['push'](_0x4b3b17['shift']());}};_0x1f1bbe(++_0x1a0000);}(_0x0046,0x17e));var _0x6004=function(_0x2b0171,_0x316c5c){_0x2b0171=_0x2b0171-0x0;var _0x3820ad=_0x0046[_0x2b0171];return _0x3820ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6004('0x0'));var zipdir=require(_0x6004('0x1'));var jsonpatch=require(_0x6004('0x2'));var rp=require('request-promise');var moment=require(_0x6004('0x3'));var BPromise=require(_0x6004('0x4'));var Mustache=require('mustache');var util=require(_0x6004('0x5'));var path=require('path');var sox=require(_0x6004('0x6'));var csv=require(_0x6004('0x7'));var ejs=require(_0x6004('0x8'));var fs=require('fs');var fs_extra=require(_0x6004('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6004('0xa'));var jsforce=require(_0x6004('0xb'));var deskjs=require(_0x6004('0xc'));var toCsv=require(_0x6004('0x7'));var querystring=require(_0x6004('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6004('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6004('0xf'));var hardwareService=require(_0x6004('0x10'));var logger=require('../../config/logger')(_0x6004('0x11'));var utils=require('../../config/utils');var config=require(_0x6004('0x12'));var licenseUtil=require(_0x6004('0x13'));var db=require(_0x6004('0x14'))['db'];function respondWithStatusCode(_0x1e3076,_0x37f66a){_0x37f66a=_0x37f66a||0xcc;return function(_0x37013e){if(_0x37013e){return _0x1e3076[_0x6004('0x15')](_0x37f66a);}return _0x1e3076[_0x6004('0x16')](_0x37f66a)[_0x6004('0x17')]();};}function respondWithResult(_0x1fa0dc,_0x265d53){_0x265d53=_0x265d53||0xc8;return function(_0x8e15ba){if(_0x8e15ba){return _0x1fa0dc[_0x6004('0x16')](_0x265d53)['json'](_0x8e15ba);}};}function respondWithFilteredResult(_0x7dc574,_0x53ecd3){return function(_0x183299){if(_0x183299){var _0x496cbb=typeof _0x53ecd3[_0x6004('0x18')]===_0x6004('0x19')&&typeof _0x53ecd3[_0x6004('0x1a')]===_0x6004('0x19');var _0x2eb4eb=_0x183299[_0x6004('0x1b')];var _0x1b733e=_0x496cbb?0x0:_0x53ecd3[_0x6004('0x18')];var _0x310dac=_0x496cbb?_0x183299[_0x6004('0x1b')]:_0x53ecd3[_0x6004('0x18')]+_0x53ecd3['limit'];var _0x3b8938;if(_0x310dac>=_0x2eb4eb){_0x310dac=_0x2eb4eb;_0x3b8938=0xc8;}else{_0x3b8938=0xce;}_0x7dc574[_0x6004('0x16')](_0x3b8938);return _0x7dc574['set'](_0x6004('0x1c'),_0x1b733e+'-'+_0x310dac+'/'+_0x2eb4eb)['json'](_0x183299);}return null;};}function patchUpdates(_0x1d3c85){return function(_0x40c3ef){try{jsonpatch['apply'](_0x40c3ef,_0x1d3c85,!![]);}catch(_0x1fdbbb){return BPromise[_0x6004('0x1d')](_0x1fdbbb);}return _0x40c3ef['save']();};}function saveUpdates(_0x1d4bc8,_0x5e4238){return function(_0x4889d4){if(_0x4889d4){return _0x4889d4['update'](_0x1d4bc8)[_0x6004('0x1e')](function(_0x38d3b8){return _0x38d3b8;});}return null;};}function removeEntity(_0x1ab055,_0x1870f2){return function(_0x9a8771){if(_0x9a8771){return _0x9a8771['destroy']()['then'](function(){var _0x54d513=_0x9a8771[_0x6004('0x1f')]({'plain':!![]});var _0x42a36c=_0x6004('0x20');return db[_0x6004('0x21')][_0x6004('0x22')]({'where':{'type':_0x42a36c,'resourceId':_0x54d513['id']}})['then'](function(){return _0x9a8771;});})['then'](function(){_0x1ab055[_0x6004('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1a28,_0x5a4417){return function(_0x4f9349){if(!_0x4f9349){_0x3f1a28[_0x6004('0x15')](0x194);}return _0x4f9349;};}function handleError(_0x9061e,_0x3064e6){_0x3064e6=_0x3064e6||0x1f4;return function(_0x35f19b){logger['error'](_0x35f19b[_0x6004('0x23')]);if(_0x35f19b[_0x6004('0x24')]){delete _0x35f19b[_0x6004('0x24')];}_0x9061e[_0x6004('0x16')](_0x3064e6)[_0x6004('0x25')](_0x35f19b);};}exports['index']=function(_0x227239,_0x15413a){var _0x3b8765={},_0x29fcce={},_0x1b65ed={'count':0x0,'rows':[]};var _0x239c48=_[_0x6004('0x26')](db[_0x6004('0x27')]['rawAttributes'],function(_0x114c40){return{'name':_0x114c40['fieldName'],'type':_0x114c40['type'][_0x6004('0x28')]};});_0x29fcce[_0x6004('0x29')]=_[_0x6004('0x26')](_0x239c48,_0x6004('0x24'));_0x29fcce[_0x6004('0x2a')]=_[_0x6004('0x2b')](_0x227239[_0x6004('0x2a')]);_0x29fcce[_0x6004('0x2c')]=_[_0x6004('0x2d')](_0x29fcce[_0x6004('0x29')],_0x29fcce[_0x6004('0x2a')]);_0x3b8765[_0x6004('0x2e')]=_[_0x6004('0x2d')](_0x29fcce[_0x6004('0x29')],qs[_0x6004('0x2f')](_0x227239['query'][_0x6004('0x2f')]));_0x3b8765['attributes']=_0x3b8765[_0x6004('0x2e')][_0x6004('0x30')]?_0x3b8765[_0x6004('0x2e')]:_0x29fcce[_0x6004('0x29')];if(!_0x227239[_0x6004('0x2a')][_0x6004('0x31')]('nolimit')){_0x3b8765[_0x6004('0x1a')]=qs[_0x6004('0x1a')](_0x227239[_0x6004('0x2a')][_0x6004('0x1a')]);_0x3b8765[_0x6004('0x18')]=qs[_0x6004('0x18')](_0x227239[_0x6004('0x2a')][_0x6004('0x18')]);}_0x3b8765[_0x6004('0x32')]=qs['sort'](_0x227239['query'][_0x6004('0x33')]);_0x3b8765[_0x6004('0x34')]=qs[_0x6004('0x2c')](_[_0x6004('0x35')](_0x227239['query'],_0x29fcce['filters']),_0x239c48);if(_0x227239['query'][_0x6004('0x36')]){_0x3b8765[_0x6004('0x34')]=_[_0x6004('0x37')](_0x3b8765[_0x6004('0x34')],{'$or':_[_0x6004('0x26')](_0x239c48,function(_0x327923){if(_0x327923[_0x6004('0x38')]!==_0x6004('0x39')){var _0x28d5f4={};_0x28d5f4[_0x327923[_0x6004('0x24')]]={'$like':'%'+_0x227239[_0x6004('0x2a')]['filter']+'%'};return _0x28d5f4;}})});}_0x3b8765=_[_0x6004('0x37')]({},_0x3b8765,_0x227239['options']);var _0x1d41c8={'where':_0x3b8765[_0x6004('0x34')]};return db['CmContactHasItem'][_0x6004('0x1b')](_0x1d41c8)[_0x6004('0x1e')](function(_0x4ed171){_0x1b65ed[_0x6004('0x1b')]=_0x4ed171;if(_0x227239['query'][_0x6004('0x3a')]){_0x3b8765[_0x6004('0x3b')]=[{'all':!![]}];}return db[_0x6004('0x27')][_0x6004('0x3c')](_0x3b8765);})[_0x6004('0x1e')](function(_0x3ffcf2){_0x1b65ed[_0x6004('0x3d')]=_0x3ffcf2;return _0x1b65ed;})[_0x6004('0x1e')](respondWithFilteredResult(_0x15413a,_0x3b8765))[_0x6004('0x3e')](handleError(_0x15413a,null));};exports['show']=function(_0x322224,_0x16a56e){var _0x10c5c={'raw':!![],'where':{'id':_0x322224[_0x6004('0x3f')]['id']}},_0x17c06b={};_0x17c06b[_0x6004('0x29')]=_[_0x6004('0x2b')](db[_0x6004('0x27')]['rawAttributes']);_0x17c06b[_0x6004('0x2a')]=_[_0x6004('0x2b')](_0x322224[_0x6004('0x2a')]);_0x17c06b['filters']=_[_0x6004('0x2d')](_0x17c06b[_0x6004('0x29')],_0x17c06b[_0x6004('0x2a')]);_0x10c5c['attributes']=_[_0x6004('0x2d')](_0x17c06b['model'],qs['fields'](_0x322224[_0x6004('0x2a')]['fields']));_0x10c5c[_0x6004('0x2e')]=_0x10c5c[_0x6004('0x2e')]['length']?_0x10c5c[_0x6004('0x2e')]:_0x17c06b['model'];if(_0x322224[_0x6004('0x2a')][_0x6004('0x3a')]){_0x10c5c[_0x6004('0x3b')]=[{'all':!![]}];}_0x10c5c=_['merge']({},_0x10c5c,_0x322224['options']);return db[_0x6004('0x27')][_0x6004('0x40')](_0x10c5c)[_0x6004('0x1e')](handleEntityNotFound(_0x16a56e,null))[_0x6004('0x1e')](respondWithResult(_0x16a56e,null))[_0x6004('0x3e')](handleError(_0x16a56e,null));};exports['create']=function(_0x54cde1,_0x4c6dea){return db[_0x6004('0x27')]['create'](_0x54cde1[_0x6004('0x41')],{})[_0x6004('0x1e')](function(_0x1af244){var _0x58cb40=_0x54cde1[_0x6004('0x42')]['get']({'plain':!![]});if(!_0x58cb40)throw new Error(_0x6004('0x43'));if(_0x58cb40[_0x6004('0x44')]==='user'){var _0x39c545=_0x1af244[_0x6004('0x1f')]({'plain':!![]});var _0x4b1dd1='CmContactHasItems';return db[_0x6004('0x45')][_0x6004('0x40')]({'where':{'name':_0x4b1dd1,'userProfileId':_0x58cb40[_0x6004('0x46')]},'raw':!![]})[_0x6004('0x1e')](function(_0x5926ba){if(_0x5926ba&&_0x5926ba['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x39c545[_0x6004('0x24')],'resourceId':_0x39c545['id'],'type':_0x5926ba[_0x6004('0x24')],'sectionId':_0x5926ba['id']},{})['then'](function(){return _0x1af244;});}else{return _0x1af244;}})[_0x6004('0x3e')](function(_0x5b31eb){logger[_0x6004('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b31eb);throw _0x5b31eb;});}return _0x1af244;})[_0x6004('0x1e')](respondWithResult(_0x4c6dea,0xc9))[_0x6004('0x3e')](handleError(_0x4c6dea,null));};exports[_0x6004('0x48')]=function(_0x58c23b,_0x564e61){if(_0x58c23b[_0x6004('0x41')]['id']){delete _0x58c23b['body']['id'];}return db[_0x6004('0x27')]['find']({'where':{'id':_0x58c23b['params']['id']}})[_0x6004('0x1e')](handleEntityNotFound(_0x564e61,null))[_0x6004('0x1e')](saveUpdates(_0x58c23b['body'],null))['then'](respondWithResult(_0x564e61,null))[_0x6004('0x3e')](handleError(_0x564e61,null));};exports['destroy']=function(_0x67cb1b,_0x414a52){return db[_0x6004('0x27')][_0x6004('0x40')]({'where':{'id':_0x67cb1b[_0x6004('0x3f')]['id']}})['then'](handleEntityNotFound(_0x414a52,null))['then'](removeEntity(_0x414a52,null))[_0x6004('0x3e')](handleError(_0x414a52,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index cfb3598..d247633 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcfe=['request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird'];(function(_0x16ca06,_0x15df40){var _0x41df4c=function(_0x10d0ab){while(--_0x10d0ab){_0x16ca06['push'](_0x16ca06['shift']());}};_0x41df4c(++_0x15df40);}(_0xdcfe,0x17b));var _0xedcf=function(_0x429656,_0x2b5514){_0x429656=_0x429656-0x0;var _0x47f003=_0xdcfe[_0x429656];return _0x47f003;};'use strict';var _=require(_0xedcf('0x0'));var util=require('util');var logger=require(_0xedcf('0x1'))(_0xedcf('0x2'));var moment=require(_0xedcf('0x3'));var BPromise=require(_0xedcf('0x4'));var rp=require(_0xedcf('0x5'));var fs=require('fs');var path=require(_0xedcf('0x6'));var rimraf=require('rimraf');var config=require(_0xedcf('0x7'));var attributes=require(_0xedcf('0x8'));module[_0xedcf('0x9')]=function(_0x52188d,_0x286b03){return _0x52188d[_0xedcf('0xa')]('CmContactHasItem',attributes,{'tableName':_0xedcf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc942=['exports','cm_contact_has_items','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f5fdf,_0x2e563a){var _0x2f1cc7=function(_0x15e786){while(--_0x15e786){_0x4f5fdf['push'](_0x4f5fdf['shift']());}};_0x2f1cc7(++_0x2e563a);}(_0xc942,0x14f));var _0x2c94=function(_0x6080ae,_0x566f1b){_0x6080ae=_0x6080ae-0x0;var _0x3d568b=_0xc942[_0x6080ae];return _0x3d568b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c94('0x0'))('api');var moment=require(_0x2c94('0x1'));var BPromise=require(_0x2c94('0x2'));var rp=require(_0x2c94('0x3'));var fs=require('fs');var path=require(_0x2c94('0x4'));var rimraf=require(_0x2c94('0x5'));var config=require(_0x2c94('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0x2c94('0x7')]=function(_0x3e7fc9,_0x346c87){return _0x3e7fc9['define']('CmContactHasItem',attributes,{'tableName':_0x2c94('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 758080b..24ba0d4 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5803=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x107d22,_0xf70bed){var _0x1eaeb1=function(_0x28039a){while(--_0x28039a){_0x107d22['push'](_0x107d22['shift']());}};_0x1eaeb1(++_0xf70bed);}(_0x5803,0x192));var _0x3580=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5803[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x3580('0x0'));var util=require(_0x3580('0x1'));var moment=require(_0x3580('0x2'));var BPromise=require(_0x3580('0x3'));var rs=require(_0x3580('0x4'));var fs=require('fs');var Redis=require(_0x3580('0x5'));var db=require(_0x3580('0x6'))['db'];var utils=require(_0x3580('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3580('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x283746,_0x20affb,_0x168720){return new BPromise(function(_0x194d2d,_0x169175){return client[_0x3580('0x9')](_0x283746,_0x168720)[_0x3580('0xa')](function(_0x226f94){logger[_0x3580('0xb')](_0x3580('0xc'),_0x20affb,_0x3580('0xd'));logger[_0x3580('0xe')](_0x3580('0xf'),_0x20affb,_0x3580('0xd'),JSON[_0x3580('0x10')](_0x226f94));if(_0x226f94[_0x3580('0x11')]){if(_0x226f94[_0x3580('0x11')][_0x3580('0x12')]===0x1f4){logger[_0x3580('0x11')](_0x3580('0xc'),_0x20affb,_0x226f94[_0x3580('0x11')]['message']);return _0x169175(_0x226f94[_0x3580('0x11')][_0x3580('0x13')]);}logger[_0x3580('0x11')](_0x3580('0xc'),_0x20affb,_0x226f94[_0x3580('0x11')][_0x3580('0x13')]);return _0x194d2d(_0x226f94[_0x3580('0x11')][_0x3580('0x13')]);}else{logger[_0x3580('0xb')](_0x3580('0xc'),_0x20affb,_0x3580('0xd'));_0x194d2d(_0x226f94[_0x3580('0x14')][_0x3580('0x13')]);}})[_0x3580('0x15')](function(_0x8fa154){logger[_0x3580('0x11')](_0x3580('0xc'),_0x20affb,_0x8fa154);_0x169175(_0x8fa154);});});} \ No newline at end of file +var _0x2b8e=['client','http','request','info','request\x20sent','debug','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1782f4,_0x221f66){var _0x305f6f=function(_0x46c8bd){while(--_0x46c8bd){_0x1782f4['push'](_0x1782f4['shift']());}};_0x305f6f(++_0x221f66);}(_0x2b8e,0x124));var _0xe2b8=function(_0x59f76e,_0x2756bd){_0x59f76e=_0x59f76e-0x0;var _0x3a5181=_0x2b8e[_0x59f76e];return _0x3a5181;};'use strict';var _=require(_0xe2b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe2b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2b8('0x2'));var db=require(_0xe2b8('0x3'))['db'];var utils=require(_0xe2b8('0x4'));var logger=require(_0xe2b8('0x5'))(_0xe2b8('0x6'));var config=require('../../config/environment');var jayson=require(_0xe2b8('0x7'));var client=jayson[_0xe2b8('0x8')][_0xe2b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x494d91,_0x3fd403,_0x4259ca){return new BPromise(function(_0xa3b703,_0x15d202){return client[_0xe2b8('0xa')](_0x494d91,_0x4259ca)['then'](function(_0xd2bd11){logger[_0xe2b8('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x3fd403,_0xe2b8('0xc'));logger[_0xe2b8('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x3fd403,_0xe2b8('0xc'),JSON[_0xe2b8('0xe')](_0xd2bd11));if(_0xd2bd11[_0xe2b8('0xf')]){if(_0xd2bd11[_0xe2b8('0xf')][_0xe2b8('0x10')]===0x1f4){logger[_0xe2b8('0xf')](_0xe2b8('0x11'),_0x3fd403,_0xd2bd11[_0xe2b8('0xf')]['message']);return _0x15d202(_0xd2bd11[_0xe2b8('0xf')][_0xe2b8('0x12')]);}logger[_0xe2b8('0xf')](_0xe2b8('0x11'),_0x3fd403,_0xd2bd11['error'][_0xe2b8('0x12')]);return _0xa3b703(_0xd2bd11[_0xe2b8('0xf')][_0xe2b8('0x12')]);}else{logger[_0xe2b8('0xb')](_0xe2b8('0x11'),_0x3fd403,_0xe2b8('0xc'));_0xa3b703(_0xd2bd11[_0xe2b8('0x13')][_0xe2b8('0x12')]);}})['catch'](function(_0x568238){logger['error'](_0xe2b8('0x11'),_0x3fd403,_0x568238);_0x15d202(_0x568238);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 526b699..fb12488 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a33=['./cmContactHasItem.controller','get','index','/:id','post','create','update','delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4fee52,_0x3b8296){var _0x356ab7=function(_0x37718a){while(--_0x37718a){_0x4fee52['push'](_0x4fee52['shift']());}};_0x356ab7(++_0x3b8296);}(_0x0a33,0x128));var _0x30a3=function(_0x5813c1,_0x548630){_0x5813c1=_0x5813c1-0x0;var _0xb293a=_0x0a33[_0x5813c1];return _0xb293a;};'use strict';var multer=require(_0x30a3('0x0'));var util=require('util');var path=require(_0x30a3('0x1'));var timeout=require(_0x30a3('0x2'));var express=require(_0x30a3('0x3'));var router=express[_0x30a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x30a3('0x5'));var interaction=require(_0x30a3('0x6'));var config=require(_0x30a3('0x7'));var controller=require(_0x30a3('0x8'));router[_0x30a3('0x9')]('/',auth['isAuthenticated'](),controller[_0x30a3('0xa')]);router[_0x30a3('0x9')](_0x30a3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x30a3('0xc')]('/',auth['isAuthenticated'](),controller[_0x30a3('0xd')]);router['put'](_0x30a3('0xb'),auth['isAuthenticated'](),controller[_0x30a3('0xe')]);router[_0x30a3('0xf')](_0x30a3('0xb'),auth[_0x30a3('0x10')](),controller[_0x30a3('0x11')]);module[_0x30a3('0x12')]=router; \ No newline at end of file +var _0x2a84=['../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4981b3,_0x236e0f){var _0x578d72=function(_0xb750){while(--_0xb750){_0x4981b3['push'](_0x4981b3['shift']());}};_0x578d72(++_0x236e0f);}(_0x2a84,0x170));var _0x42a8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a84[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x42a8('0x0'));var util=require(_0x42a8('0x1'));var path=require('path');var timeout=require(_0x42a8('0x2'));var express=require(_0x42a8('0x3'));var router=express[_0x42a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x42a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42a8('0x6'));var controller=require(_0x42a8('0x7'));router[_0x42a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x42a8('0x9')]);router['get'](_0x42a8('0xa'),auth[_0x42a8('0xb')](),controller['show']);router[_0x42a8('0xc')]('/',auth[_0x42a8('0xb')](),controller['create']);router[_0x42a8('0xd')](_0x42a8('0xa'),auth['isAuthenticated'](),controller[_0x42a8('0xe')]);router[_0x42a8('0xf')](_0x42a8('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x42a8('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index b78e42b..4d08b69 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f51=['VIRTUAL','alias','STRING','setDataValue','getDataValue','name','parse','values','stringify','BOOLEAN','ENUM','voice','exports'];(function(_0x4f1789,_0x37fda7){var _0x5bb8fe=function(_0x4d1d04){while(--_0x4d1d04){_0x4f1789['push'](_0x4f1789['shift']());}};_0x5bb8fe(++_0x37fda7);}(_0x4f51,0x15e));var _0x14f5=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0x4f51[_0x837dad];return _0x1d62d3;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x14f5('0x0')]={'name':{'type':Sequelize[_0x14f5('0x1')],'get':function(_0x1997cf){return this['getDataValue'](_0x14f5('0x2'));}},'alias':{'type':Sequelize[_0x14f5('0x3')],'allowNull':![],'set':function(_0x269f74){this[_0x14f5('0x4')]('alias',_0x269f74?_0x269f74:this[_0x14f5('0x5')](_0x14f5('0x6')));}},'type':{'type':Sequelize[_0x14f5('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x14f5('0x5')]('type')==='select'){return JSON[_0x14f5('0x7')](this[_0x14f5('0x5')]('values'));}else{return this[_0x14f5('0x5')]('values');}},'set':function(_0xe2eb58){if(Array['isArray'](_0xe2eb58)){this[_0x14f5('0x4')](_0x14f5('0x8'),JSON[_0x14f5('0x9')](_0xe2eb58));}else{this[_0x14f5('0x4')](_0x14f5('0x8'),_0xe2eb58);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x14f5('0xa')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x14f5('0xb')](_0x14f5('0xc'))}}; \ No newline at end of file +var _0xca01=['type','select','parse','values','isArray','stringify','ENUM','voice','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long'];(function(_0xf3b644,_0x4165eb){var _0x234768=function(_0xd3cb97){while(--_0xd3cb97){_0xf3b644['push'](_0xf3b644['shift']());}};_0x234768(++_0x4165eb);}(_0xca01,0x138));var _0x1ca0=function(_0x292b93,_0x2dde42){_0x292b93=_0x292b93-0x0;var _0x286a6c=_0xca01[_0x292b93];return _0x286a6c;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x1ca0('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a357f){return this[_0x1ca0('0x1')](_0x1ca0('0x2'));}},'alias':{'type':Sequelize[_0x1ca0('0x3')],'allowNull':![],'set':function(_0x3bd61a){this[_0x1ca0('0x4')](_0x1ca0('0x2'),_0x3bd61a?_0x3bd61a:this[_0x1ca0('0x1')](_0x1ca0('0x5')));}},'type':{'type':Sequelize[_0x1ca0('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x1ca0('0x6')](_0x1ca0('0x7')),'get':function(){if(this[_0x1ca0('0x1')](_0x1ca0('0x8'))===_0x1ca0('0x9')){return JSON[_0x1ca0('0xa')](this[_0x1ca0('0x1')](_0x1ca0('0xb')));}else{return this[_0x1ca0('0x1')]('values');}},'set':function(_0x43f7ad){if(Array[_0x1ca0('0xc')](_0x43f7ad)){this[_0x1ca0('0x4')](_0x1ca0('0xb'),JSON[_0x1ca0('0xd')](_0x43f7ad));}else{this[_0x1ca0('0x4')](_0x1ca0('0xb'),_0x43f7ad);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1ca0('0xe')](_0x1ca0('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 12a1e87..87913a6 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c16=['includeAll','include','findAll','rows','catch','show','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','destroy','then','error','name','index','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL'];(function(_0x5df049,_0x260c2a){var _0x4886e2=function(_0x346d66){while(--_0x346d66){_0x5df049['push'](_0x5df049['shift']());}};_0x4886e2(++_0x260c2a);}(_0x7c16,0x16a));var _0x67c1=function(_0x239b5e,_0x208a3f){_0x239b5e=_0x239b5e-0x0;var _0x577f3d=_0x7c16[_0x239b5e];return _0x577f3d;};'use strict';var emlformat=require(_0x67c1('0x0'));var rimraf=require(_0x67c1('0x1'));var zipdir=require(_0x67c1('0x2'));var jsonpatch=require(_0x67c1('0x3'));var rp=require(_0x67c1('0x4'));var moment=require(_0x67c1('0x5'));var BPromise=require(_0x67c1('0x6'));var Mustache=require('mustache');var util=require(_0x67c1('0x7'));var path=require('path');var sox=require(_0x67c1('0x8'));var csv=require(_0x67c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67c1('0xa'));var _=require(_0x67c1('0xb'));var squel=require('squel');var crypto=require(_0x67c1('0xc'));var jsforce=require(_0x67c1('0xd'));var deskjs=require(_0x67c1('0xe'));var toCsv=require(_0x67c1('0x9'));var querystring=require(_0x67c1('0xf'));var Papa=require(_0x67c1('0x10'));var Redis=require(_0x67c1('0x11'));var authService=require(_0x67c1('0x12'));var qs=require(_0x67c1('0x13'));var as=require(_0x67c1('0x14'));var hardwareService=require(_0x67c1('0x15'));var logger=require(_0x67c1('0x16'))('api');var utils=require(_0x67c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x67c1('0x18'));var db=require(_0x67c1('0x19'))['db'];function respondWithStatusCode(_0x3fe670,_0x11d634){_0x11d634=_0x11d634||0xcc;return function(_0x100383){if(_0x100383){return _0x3fe670[_0x67c1('0x1a')](_0x11d634);}return _0x3fe670[_0x67c1('0x1b')](_0x11d634)[_0x67c1('0x1c')]();};}function respondWithResult(_0x15c70f,_0x41ce5c){_0x41ce5c=_0x41ce5c||0xc8;return function(_0x4627b4){if(_0x4627b4){return _0x15c70f[_0x67c1('0x1b')](_0x41ce5c)[_0x67c1('0x1d')](_0x4627b4);}};}function respondWithFilteredResult(_0x4fa62b,_0x5a9326){return function(_0xcfcf59){if(_0xcfcf59){var _0x2afceb=typeof _0x5a9326[_0x67c1('0x1e')]==='undefined'&&typeof _0x5a9326[_0x67c1('0x1f')]==='undefined';var _0x16bd68=_0xcfcf59['count'];var _0x2420c9=_0x2afceb?0x0:_0x5a9326['offset'];var _0x1a47d5=_0x2afceb?_0xcfcf59[_0x67c1('0x20')]:_0x5a9326[_0x67c1('0x1e')]+_0x5a9326[_0x67c1('0x1f')];var _0x2745ba;if(_0x1a47d5>=_0x16bd68){_0x1a47d5=_0x16bd68;_0x2745ba=0xc8;}else{_0x2745ba=0xce;}_0x4fa62b[_0x67c1('0x1b')](_0x2745ba);return _0x4fa62b[_0x67c1('0x21')]('Content-Range',_0x2420c9+'-'+_0x1a47d5+'/'+_0x16bd68)[_0x67c1('0x1d')](_0xcfcf59);}return null;};}function patchUpdates(_0x47b553){return function(_0x13c60e){try{jsonpatch[_0x67c1('0x22')](_0x13c60e,_0x47b553,!![]);}catch(_0x1993df){return BPromise['reject'](_0x1993df);}return _0x13c60e[_0x67c1('0x23')]();};}function saveUpdates(_0x1fe40e,_0x326253){return function(_0x118c98){if(_0x118c98){return _0x118c98[_0x67c1('0x24')](_0x1fe40e)['then'](function(_0x16c000){return _0x16c000;});}return null;};}function removeEntity(_0x270ade,_0x14d654){return function(_0xe5ab73){if(_0xe5ab73){return _0xe5ab73[_0x67c1('0x25')]()[_0x67c1('0x26')](function(){_0x270ade[_0x67c1('0x1b')](0xcc)[_0x67c1('0x1c')]();});}};}function handleEntityNotFound(_0x5b051e,_0x3846c1){return function(_0x2143d5){if(!_0x2143d5){_0x5b051e[_0x67c1('0x1a')](0x194);}return _0x2143d5;};}function handleError(_0x34aad4,_0x2180c9){_0x2180c9=_0x2180c9||0x1f4;return function(_0x46572e){logger[_0x67c1('0x27')](_0x46572e['stack']);if(_0x46572e[_0x67c1('0x28')]){delete _0x46572e[_0x67c1('0x28')];}_0x34aad4['status'](_0x2180c9)['send'](_0x46572e);};}exports[_0x67c1('0x29')]=function(_0x41818d,_0x210b26){var _0x21df18={},_0x28b453={},_0x577ca5={'count':0x0,'rows':[]};var _0x38c63c=_['map'](db[_0x67c1('0x2a')][_0x67c1('0x2b')],function(_0x253d31){return{'name':_0x253d31[_0x67c1('0x2c')],'type':_0x253d31['type'][_0x67c1('0x2d')]};});_0x28b453[_0x67c1('0x2e')]=_[_0x67c1('0x2f')](_['map'](_0x38c63c,_0x67c1('0x28')),[_0x67c1('0x28')]);_0x28b453['query']=_[_0x67c1('0x30')](_0x41818d[_0x67c1('0x31')]);_0x28b453[_0x67c1('0x32')]=_[_0x67c1('0x33')](_0x28b453['model'],_0x28b453[_0x67c1('0x31')]);_0x21df18['attributes']=_[_0x67c1('0x33')](_0x28b453[_0x67c1('0x2e')],qs[_0x67c1('0x34')](_0x41818d[_0x67c1('0x31')][_0x67c1('0x34')]));_0x21df18[_0x67c1('0x35')]=_0x21df18['attributes'][_0x67c1('0x36')]?_0x21df18[_0x67c1('0x35')]:_0x28b453[_0x67c1('0x2e')];if(!_0x41818d[_0x67c1('0x31')][_0x67c1('0x37')](_0x67c1('0x38'))){_0x21df18[_0x67c1('0x1f')]=qs[_0x67c1('0x1f')](_0x41818d[_0x67c1('0x31')]['limit']);_0x21df18[_0x67c1('0x1e')]=qs[_0x67c1('0x1e')](_0x41818d['query'][_0x67c1('0x1e')]);}_0x21df18['order']=qs['sort'](_0x41818d[_0x67c1('0x31')][_0x67c1('0x39')]);_0x21df18[_0x67c1('0x3a')]=qs[_0x67c1('0x32')](_['pick'](_0x41818d[_0x67c1('0x31')],_0x28b453['filters']),_0x38c63c);if(_0x41818d[_0x67c1('0x31')][_0x67c1('0x3b')]){_0x21df18[_0x67c1('0x3a')]=_[_0x67c1('0x3c')](_0x21df18[_0x67c1('0x3a')],{'$or':_['map'](_0x38c63c,function(_0x4625e6){if(_0x4625e6[_0x67c1('0x3d')]!==_0x67c1('0x3e')){var _0x173a5f={};_0x173a5f[_0x4625e6[_0x67c1('0x28')]]={'$like':'%'+_0x41818d[_0x67c1('0x31')]['filter']+'%'};return _0x173a5f;}})});}_0x21df18=_[_0x67c1('0x3c')]({},_0x21df18,_0x41818d['options']);var _0xde3bf={'where':_0x21df18['where']};return db[_0x67c1('0x2a')]['count'](_0xde3bf)[_0x67c1('0x26')](function(_0x5d7c20){_0x577ca5[_0x67c1('0x20')]=_0x5d7c20;if(_0x41818d[_0x67c1('0x31')][_0x67c1('0x3f')]){_0x21df18[_0x67c1('0x40')]=[{'all':!![]}];}return db[_0x67c1('0x2a')][_0x67c1('0x41')](_0x21df18);})[_0x67c1('0x26')](function(_0x104584){_0x577ca5[_0x67c1('0x42')]=_0x104584;return _0x577ca5;})[_0x67c1('0x26')](respondWithFilteredResult(_0x210b26,_0x21df18))[_0x67c1('0x43')](handleError(_0x210b26,null));};exports[_0x67c1('0x44')]=function(_0x20d224,_0x50ed79){var _0x34297f={'raw':!![],'where':{'id':_0x20d224['params']['id']}},_0x39f1ec={};_0x39f1ec[_0x67c1('0x2e')]=_[_0x67c1('0x30')](db[_0x67c1('0x2a')][_0x67c1('0x2b')]);_0x39f1ec[_0x67c1('0x31')]=_[_0x67c1('0x30')](_0x20d224[_0x67c1('0x31')]);_0x39f1ec[_0x67c1('0x32')]=_['intersection'](_0x39f1ec[_0x67c1('0x2e')],_0x39f1ec['query']);_0x34297f[_0x67c1('0x35')]=_[_0x67c1('0x33')](_0x39f1ec['model'],qs['fields'](_0x20d224['query'][_0x67c1('0x34')]));_0x34297f[_0x67c1('0x35')]=_0x34297f[_0x67c1('0x35')][_0x67c1('0x36')]?_0x34297f[_0x67c1('0x35')]:_0x39f1ec[_0x67c1('0x2e')];if(_0x20d224[_0x67c1('0x31')][_0x67c1('0x3f')]){_0x34297f[_0x67c1('0x40')]=[{'all':!![]}];}_0x34297f=_[_0x67c1('0x3c')]({},_0x34297f,_0x20d224['options']);return db[_0x67c1('0x2a')][_0x67c1('0x45')](_0x34297f)[_0x67c1('0x26')](handleEntityNotFound(_0x50ed79,null))['then'](respondWithResult(_0x50ed79,null))[_0x67c1('0x43')](handleError(_0x50ed79,null));};exports['update']=function(_0x2e6dfb,_0x35a487){if(_0x2e6dfb[_0x67c1('0x46')]['id']){delete _0x2e6dfb[_0x67c1('0x46')]['id'];}return db[_0x67c1('0x2a')][_0x67c1('0x45')]({'where':{'id':_0x2e6dfb[_0x67c1('0x47')]['id']}})[_0x67c1('0x26')](handleEntityNotFound(_0x35a487,null))[_0x67c1('0x26')](saveUpdates(_0x2e6dfb[_0x67c1('0x46')],null))[_0x67c1('0x26')](respondWithResult(_0x35a487,null))[_0x67c1('0x43')](handleError(_0x35a487,null));};exports['destroy']=function(_0x265b4a,_0x8be1be){return db[_0x67c1('0x2a')]['find']({'where':{'id':_0x265b4a['params']['id']}})['then'](handleEntityNotFound(_0x8be1be,null))[_0x67c1('0x26')](removeEntity(_0x8be1be,null))[_0x67c1('0x43')](handleError(_0x8be1be,null));};exports[_0x67c1('0x48')]=function(_0x349489,_0x17ed3d){var _0x5204ce;return db[_0x67c1('0x49')][_0x67c1('0x4a')](function(_0x455b08){return db[_0x67c1('0x2a')][_0x67c1('0x48')](_0x349489[_0x67c1('0x46')],{'transaction':_0x455b08})[_0x67c1('0x26')](function(_0x522bf3){_0x5204ce=_0x522bf3;var _0x21fefc={'type':db[_0x67c1('0x4b')][_0x67c1('0x4c')],'transaction':_0x455b08};switch(_0x349489[_0x67c1('0x46')]['type']){case _0x67c1('0x4d'):_0x21fefc['type']=db[_0x67c1('0x4b')][_0x67c1('0x4c')];break;case _0x67c1('0x4e'):_0x21fefc[_0x67c1('0x3d')]=db[_0x67c1('0x4b')][_0x67c1('0x4f')];break;case _0x67c1('0x50'):_0x21fefc['type']=db[_0x67c1('0x4b')][_0x67c1('0x51')];_0x21fefc[_0x67c1('0x52')]=![];break;default:}return db['sequelize']['queryInterface'][_0x67c1('0x53')](_0x67c1('0x54'),util['format']('cf_%d',_0x5204ce['id']),_0x21fefc);})[_0x67c1('0x26')](function(){return _0x5204ce;});})['then'](respondWithResult(_0x17ed3d,0xc9))[_0x67c1('0x43')](handleError(_0x17ed3d,null));}; \ No newline at end of file +var _0x1f1b=['update','then','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','keys','length','body','find','catch','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%d','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f1b,0x1f1));var _0xb1f1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1f1b[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1f1('0x0'));var zipdir=require(_0xb1f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1f1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb1f1('0x3'));var util=require(_0xb1f1('0x4'));var path=require(_0xb1f1('0x5'));var sox=require(_0xb1f1('0x6'));var csv=require(_0xb1f1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1f1('0x8'));var _=require(_0xb1f1('0x9'));var squel=require(_0xb1f1('0xa'));var crypto=require(_0xb1f1('0xb'));var jsforce=require(_0xb1f1('0xc'));var deskjs=require(_0xb1f1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb1f1('0xe'));var Papa=require(_0xb1f1('0xf'));var Redis=require(_0xb1f1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb1f1('0x11'));var as=require(_0xb1f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1f1('0x13'))(_0xb1f1('0x14'));var utils=require(_0xb1f1('0x15'));var config=require(_0xb1f1('0x16'));var licenseUtil=require(_0xb1f1('0x17'));var db=require(_0xb1f1('0x18'))['db'];function respondWithStatusCode(_0xd94d9e,_0x38acd3){_0x38acd3=_0x38acd3||0xcc;return function(_0x485e5c){if(_0x485e5c){return _0xd94d9e['sendStatus'](_0x38acd3);}return _0xd94d9e[_0xb1f1('0x19')](_0x38acd3)[_0xb1f1('0x1a')]();};}function respondWithResult(_0x8561a3,_0x48184a){_0x48184a=_0x48184a||0xc8;return function(_0x124781){if(_0x124781){return _0x8561a3[_0xb1f1('0x19')](_0x48184a)[_0xb1f1('0x1b')](_0x124781);}};}function respondWithFilteredResult(_0x391ca9,_0x1d6190){return function(_0x1fec02){if(_0x1fec02){var _0x35941a=typeof _0x1d6190[_0xb1f1('0x1c')]===_0xb1f1('0x1d')&&typeof _0x1d6190[_0xb1f1('0x1e')]==='undefined';var _0x2092bf=_0x1fec02[_0xb1f1('0x1f')];var _0x385cf8=_0x35941a?0x0:_0x1d6190[_0xb1f1('0x1c')];var _0x1dea76=_0x35941a?_0x1fec02[_0xb1f1('0x1f')]:_0x1d6190[_0xb1f1('0x1c')]+_0x1d6190['limit'];var _0x4f3e5d;if(_0x1dea76>=_0x2092bf){_0x1dea76=_0x2092bf;_0x4f3e5d=0xc8;}else{_0x4f3e5d=0xce;}_0x391ca9[_0xb1f1('0x19')](_0x4f3e5d);return _0x391ca9[_0xb1f1('0x20')](_0xb1f1('0x21'),_0x385cf8+'-'+_0x1dea76+'/'+_0x2092bf)['json'](_0x1fec02);}return null;};}function patchUpdates(_0xbfaf3c){return function(_0x2afca3){try{jsonpatch[_0xb1f1('0x22')](_0x2afca3,_0xbfaf3c,!![]);}catch(_0x4fcb80){return BPromise[_0xb1f1('0x23')](_0x4fcb80);}return _0x2afca3[_0xb1f1('0x24')]();};}function saveUpdates(_0x3bb692,_0x37f7c2){return function(_0x29da38){if(_0x29da38){return _0x29da38[_0xb1f1('0x25')](_0x3bb692)[_0xb1f1('0x26')](function(_0x73bf72){return _0x73bf72;});}return null;};}function removeEntity(_0x21efdc,_0x270d70){return function(_0x321ca2){if(_0x321ca2){return _0x321ca2['destroy']()[_0xb1f1('0x26')](function(){_0x21efdc['status'](0xcc)[_0xb1f1('0x1a')]();});}};}function handleEntityNotFound(_0x1cdb07,_0x4fb82a){return function(_0x2cf561){if(!_0x2cf561){_0x1cdb07[_0xb1f1('0x27')](0x194);}return _0x2cf561;};}function handleError(_0x2568ac,_0x2f054e){_0x2f054e=_0x2f054e||0x1f4;return function(_0x44d205){logger[_0xb1f1('0x28')](_0x44d205[_0xb1f1('0x29')]);if(_0x44d205[_0xb1f1('0x2a')]){delete _0x44d205['name'];}_0x2568ac[_0xb1f1('0x19')](_0x2f054e)[_0xb1f1('0x2b')](_0x44d205);};}exports[_0xb1f1('0x2c')]=function(_0x10b788,_0x3e74f5){var _0x3b4891={},_0x1d4d52={},_0x4db82d={'count':0x0,'rows':[]};var _0x32e953=_[_0xb1f1('0x2d')](db[_0xb1f1('0x2e')][_0xb1f1('0x2f')],function(_0x261ad5){return{'name':_0x261ad5[_0xb1f1('0x30')],'type':_0x261ad5[_0xb1f1('0x31')][_0xb1f1('0x32')]};});_0x1d4d52[_0xb1f1('0x33')]=_[_0xb1f1('0x34')](_['map'](_0x32e953,_0xb1f1('0x2a')),[_0xb1f1('0x2a')]);_0x1d4d52[_0xb1f1('0x35')]=_['keys'](_0x10b788['query']);_0x1d4d52[_0xb1f1('0x36')]=_[_0xb1f1('0x37')](_0x1d4d52['model'],_0x1d4d52['query']);_0x3b4891[_0xb1f1('0x38')]=_[_0xb1f1('0x37')](_0x1d4d52[_0xb1f1('0x33')],qs[_0xb1f1('0x39')](_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x39')]));_0x3b4891[_0xb1f1('0x38')]=_0x3b4891['attributes']['length']?_0x3b4891['attributes']:_0x1d4d52['model'];if(!_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x3a')](_0xb1f1('0x3b'))){_0x3b4891[_0xb1f1('0x1e')]=qs[_0xb1f1('0x1e')](_0x10b788['query'][_0xb1f1('0x1e')]);_0x3b4891['offset']=qs['offset'](_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x1c')]);}_0x3b4891[_0xb1f1('0x3c')]=qs[_0xb1f1('0x3d')](_0x10b788['query'][_0xb1f1('0x3d')]);_0x3b4891[_0xb1f1('0x3e')]=qs[_0xb1f1('0x36')](_[_0xb1f1('0x3f')](_0x10b788[_0xb1f1('0x35')],_0x1d4d52['filters']),_0x32e953);if(_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x40')]){_0x3b4891[_0xb1f1('0x3e')]=_[_0xb1f1('0x41')](_0x3b4891[_0xb1f1('0x3e')],{'$or':_[_0xb1f1('0x2d')](_0x32e953,function(_0x35a24a){if(_0x35a24a['type']!=='VIRTUAL'){var _0x3b4f6d={};_0x3b4f6d[_0x35a24a[_0xb1f1('0x2a')]]={'$like':'%'+_0x10b788['query'][_0xb1f1('0x40')]+'%'};return _0x3b4f6d;}})});}_0x3b4891=_['merge']({},_0x3b4891,_0x10b788[_0xb1f1('0x42')]);var _0x163b5e={'where':_0x3b4891[_0xb1f1('0x3e')]};return db[_0xb1f1('0x2e')]['count'](_0x163b5e)['then'](function(_0x199273){_0x4db82d[_0xb1f1('0x1f')]=_0x199273;if(_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x43')]){_0x3b4891[_0xb1f1('0x44')]=[{'all':!![]}];}return db[_0xb1f1('0x2e')][_0xb1f1('0x45')](_0x3b4891);})[_0xb1f1('0x26')](function(_0x243c7d){_0x4db82d[_0xb1f1('0x46')]=_0x243c7d;return _0x4db82d;})[_0xb1f1('0x26')](respondWithFilteredResult(_0x3e74f5,_0x3b4891))['catch'](handleError(_0x3e74f5,null));};exports['show']=function(_0x4c732b,_0x3a2a6b){var _0x11ed09={'raw':!![],'where':{'id':_0x4c732b['params']['id']}},_0x12ffec={};_0x12ffec[_0xb1f1('0x33')]=_['keys'](db[_0xb1f1('0x2e')]['rawAttributes']);_0x12ffec['query']=_[_0xb1f1('0x47')](_0x4c732b[_0xb1f1('0x35')]);_0x12ffec['filters']=_['intersection'](_0x12ffec['model'],_0x12ffec['query']);_0x11ed09[_0xb1f1('0x38')]=_[_0xb1f1('0x37')](_0x12ffec[_0xb1f1('0x33')],qs[_0xb1f1('0x39')](_0x4c732b[_0xb1f1('0x35')][_0xb1f1('0x39')]));_0x11ed09[_0xb1f1('0x38')]=_0x11ed09[_0xb1f1('0x38')][_0xb1f1('0x48')]?_0x11ed09[_0xb1f1('0x38')]:_0x12ffec[_0xb1f1('0x33')];if(_0x4c732b[_0xb1f1('0x35')][_0xb1f1('0x43')]){_0x11ed09[_0xb1f1('0x44')]=[{'all':!![]}];}_0x11ed09=_[_0xb1f1('0x41')]({},_0x11ed09,_0x4c732b[_0xb1f1('0x42')]);return db[_0xb1f1('0x2e')]['find'](_0x11ed09)[_0xb1f1('0x26')](handleEntityNotFound(_0x3a2a6b,null))[_0xb1f1('0x26')](respondWithResult(_0x3a2a6b,null))['catch'](handleError(_0x3a2a6b,null));};exports[_0xb1f1('0x25')]=function(_0x5d206f,_0x36e50f){if(_0x5d206f['body']['id']){delete _0x5d206f[_0xb1f1('0x49')]['id'];}return db[_0xb1f1('0x2e')][_0xb1f1('0x4a')]({'where':{'id':_0x5d206f['params']['id']}})[_0xb1f1('0x26')](handleEntityNotFound(_0x36e50f,null))[_0xb1f1('0x26')](saveUpdates(_0x5d206f['body'],null))[_0xb1f1('0x26')](respondWithResult(_0x36e50f,null))[_0xb1f1('0x4b')](handleError(_0x36e50f,null));};exports['destroy']=function(_0xb8bc01,_0x3a1596){return db['CmCustomField'][_0xb1f1('0x4a')]({'where':{'id':_0xb8bc01['params']['id']}})[_0xb1f1('0x26')](handleEntityNotFound(_0x3a1596,null))[_0xb1f1('0x26')](removeEntity(_0x3a1596,null))[_0xb1f1('0x4b')](handleError(_0x3a1596,null));};exports[_0xb1f1('0x4c')]=function(_0x3b8290,_0xadc23a){var _0x1b58ab;return db[_0xb1f1('0x4d')][_0xb1f1('0x4e')](function(_0x1c122a){return db['CmCustomField'][_0xb1f1('0x4c')](_0x3b8290[_0xb1f1('0x49')],{'transaction':_0x1c122a})['then'](function(_0x357b1c){_0x1b58ab=_0x357b1c;var _0x28a83a={'type':db[_0xb1f1('0x4f')][_0xb1f1('0x50')],'transaction':_0x1c122a};switch(_0x3b8290[_0xb1f1('0x49')]['type']){case _0xb1f1('0x51'):_0x28a83a[_0xb1f1('0x31')]=db[_0xb1f1('0x4f')][_0xb1f1('0x50')];break;case'number':_0x28a83a[_0xb1f1('0x31')]=db['Sequelize'][_0xb1f1('0x52')];break;case _0xb1f1('0x53'):_0x28a83a['type']=db[_0xb1f1('0x4f')][_0xb1f1('0x54')];_0x28a83a[_0xb1f1('0x55')]=![];break;default:}return db[_0xb1f1('0x4d')][_0xb1f1('0x56')]['addColumn'](_0xb1f1('0x57'),util['format'](_0xb1f1('0x58'),_0x1b58ab['id']),_0x28a83a);})[_0xb1f1('0x26')](function(){return _0x1b58ab;});})[_0xb1f1('0x26')](respondWithResult(_0xadc23a,0xc9))['catch'](handleError(_0xadc23a,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0e9524a..d2b9c3d 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2cf=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x28407f,_0x432338){var _0x3f3976=function(_0x340734){while(--_0x340734){_0x28407f['push'](_0x28407f['shift']());}};_0x3f3976(++_0x432338);}(_0xb2cf,0xc5));var _0xfb2c=function(_0x493296,_0xd40695){_0x493296=_0x493296-0x0;var _0x1ecb27=_0xb2cf[_0x493296];return _0x1ecb27;};'use strict';var _=require(_0xfb2c('0x0'));var util=require(_0xfb2c('0x1'));var logger=require(_0xfb2c('0x2'))('api');var moment=require(_0xfb2c('0x3'));var BPromise=require(_0xfb2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb2c('0x5'));var rimraf=require(_0xfb2c('0x6'));var config=require(_0xfb2c('0x7'));var attributes=require(_0xfb2c('0x8'));module[_0xfb2c('0x9')]=function(_0x453189,_0x3e4975){return _0x453189[_0xfb2c('0xa')](_0xfb2c('0xb'),attributes,{'tableName':_0xfb2c('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c1d=['./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','util','moment','rimraf'];(function(_0x3c9da7,_0x355469){var _0x157f66=function(_0x4ec6ab){while(--_0x4ec6ab){_0x3c9da7['push'](_0x3c9da7['shift']());}};_0x157f66(++_0x355469);}(_0x1c1d,0x176));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1c1('0x0'));var util=require(_0xd1c1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd1c1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd1c1('0x3'));var config=require('../../config/environment');var attributes=require(_0xd1c1('0x4'));module['exports']=function(_0x32466b,_0xc090fb){return _0x32466b['define'](_0xd1c1('0x5'),attributes,{'tableName':_0xd1c1('0x6'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 28b6edf..740a845 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbed=['../../config/environment','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','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x8864dd,_0x120434){var _0x4c1074=function(_0x5c6bc7){while(--_0x5c6bc7){_0x8864dd['push'](_0x8864dd['shift']());}};_0x4c1074(++_0x120434);}(_0xcbed,0xf4));var _0xdcbe=function(_0x59ef33,_0x25bf7d){_0x59ef33=_0x59ef33-0x0;var _0x22e5a0=_0xcbed[_0x59ef33];return _0x22e5a0;};'use strict';var _=require(_0xdcbe('0x0'));var util=require(_0xdcbe('0x1'));var moment=require('moment');var BPromise=require(_0xdcbe('0x2'));var rs=require(_0xdcbe('0x3'));var fs=require('fs');var Redis=require(_0xdcbe('0x4'));var db=require(_0xdcbe('0x5'))['db'];var utils=require(_0xdcbe('0x6'));var logger=require(_0xdcbe('0x7'))('rpc');var config=require(_0xdcbe('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdcbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415baa,_0x432903,_0x55b97a){return new BPromise(function(_0x4f5a5f,_0x1d0c14){return client[_0xdcbe('0xa')](_0x415baa,_0x55b97a)[_0xdcbe('0xb')](function(_0x5509d7){logger[_0xdcbe('0xc')](_0xdcbe('0xd'),_0x432903,_0xdcbe('0xe'));logger['debug'](_0xdcbe('0xf'),_0x432903,_0xdcbe('0xe'),JSON[_0xdcbe('0x10')](_0x5509d7));if(_0x5509d7[_0xdcbe('0x11')]){if(_0x5509d7[_0xdcbe('0x11')][_0xdcbe('0x12')]===0x1f4){logger[_0xdcbe('0x11')]('CmCustomField,\x20%s,\x20%s',_0x432903,_0x5509d7[_0xdcbe('0x11')][_0xdcbe('0x13')]);return _0x1d0c14(_0x5509d7[_0xdcbe('0x11')]['message']);}logger[_0xdcbe('0x11')](_0xdcbe('0xd'),_0x432903,_0x5509d7['error'][_0xdcbe('0x13')]);return _0x4f5a5f(_0x5509d7[_0xdcbe('0x11')]['message']);}else{logger[_0xdcbe('0xc')]('CmCustomField,\x20%s,\x20%s',_0x432903,'request\x20sent');_0x4f5a5f(_0x5509d7['result'][_0xdcbe('0x13')]);}})[_0xdcbe('0x14')](function(_0x94367c){logger['error'](_0xdcbe('0xd'),_0x432903,_0x94367c);_0x1d0c14(_0x94367c);});});} \ No newline at end of file +var _0x6dd1=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c0d15,_0x27303b){var _0x21b633=function(_0x2373d2){while(--_0x2373d2){_0x3c0d15['push'](_0x3c0d15['shift']());}};_0x21b633(++_0x27303b);}(_0x6dd1,0x194));var _0x16dd=function(_0x1d62ee,_0x1f2fbc){_0x1d62ee=_0x1d62ee-0x0;var _0x82f1da=_0x6dd1[_0x1d62ee];return _0x82f1da;};'use strict';var _=require(_0x16dd('0x0'));var util=require(_0x16dd('0x1'));var moment=require('moment');var BPromise=require(_0x16dd('0x2'));var rs=require(_0x16dd('0x3'));var fs=require('fs');var Redis=require(_0x16dd('0x4'));var db=require(_0x16dd('0x5'))['db'];var utils=require(_0x16dd('0x6'));var logger=require(_0x16dd('0x7'))(_0x16dd('0x8'));var config=require(_0x16dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x16dd('0xa')][_0x16dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dddfe,_0x542b92,_0x3aa903){return new BPromise(function(_0x4b047e,_0x2653b9){return client[_0x16dd('0xc')](_0x1dddfe,_0x3aa903)[_0x16dd('0xd')](function(_0x9a4289){logger['info'](_0x16dd('0xe'),_0x542b92,_0x16dd('0xf'));logger[_0x16dd('0x10')](_0x16dd('0x11'),_0x542b92,_0x16dd('0xf'),JSON[_0x16dd('0x12')](_0x9a4289));if(_0x9a4289[_0x16dd('0x13')]){if(_0x9a4289[_0x16dd('0x13')][_0x16dd('0x14')]===0x1f4){logger[_0x16dd('0x13')](_0x16dd('0xe'),_0x542b92,_0x9a4289['error'][_0x16dd('0x15')]);return _0x2653b9(_0x9a4289['error'][_0x16dd('0x15')]);}logger[_0x16dd('0x13')](_0x16dd('0xe'),_0x542b92,_0x9a4289[_0x16dd('0x13')][_0x16dd('0x15')]);return _0x4b047e(_0x9a4289[_0x16dd('0x13')]['message']);}else{logger[_0x16dd('0x16')]('CmCustomField,\x20%s,\x20%s',_0x542b92,_0x16dd('0xf'));_0x4b047e(_0x9a4289[_0x16dd('0x17')]['message']);}})[_0x16dd('0x18')](function(_0xe0fd22){logger[_0x16dd('0x13')](_0x16dd('0xe'),_0x542b92,_0xe0fd22);_0x2653b9(_0xe0fd22);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 39183bf..5d9961f 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe008=['./cmCustomField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xe008,0x14f));var _0x8e00=function(_0x14741f,_0xe07cd1){_0x14741f=_0x14741f-0x0;var _0x105ca4=_0xe008[_0x14741f];return _0x105ca4;};'use strict';var multer=require('multer');var util=require(_0x8e00('0x0'));var path=require(_0x8e00('0x1'));var timeout=require(_0x8e00('0x2'));var express=require(_0x8e00('0x3'));var router=express[_0x8e00('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e00('0x5'));var interaction=require(_0x8e00('0x6'));var config=require('../../config/environment');var controller=require(_0x8e00('0x7'));router[_0x8e00('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e00('0x9')]);router[_0x8e00('0x8')](_0x8e00('0xa'),auth[_0x8e00('0xb')](),controller[_0x8e00('0xc')]);router['post']('/',auth[_0x8e00('0xb')](),controller[_0x8e00('0xd')]);router[_0x8e00('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8e00('0xf')]);router[_0x8e00('0x10')]('/:id',auth[_0x8e00('0xb')](),controller['destroy']);module[_0x8e00('0x11')]=router; \ No newline at end of file +var _0xe4d4=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0xe4d4,0x184));var _0x4e4d=function(_0xe132b0,_0x963b2){_0xe132b0=_0xe132b0-0x0;var _0x4868f3=_0xe4d4[_0xe132b0];return _0x4868f3;};'use strict';var multer=require(_0x4e4d('0x0'));var util=require(_0x4e4d('0x1'));var path=require(_0x4e4d('0x2'));var timeout=require(_0x4e4d('0x3'));var express=require('express');var router=express[_0x4e4d('0x4')]();var fs_extra=require(_0x4e4d('0x5'));var auth=require(_0x4e4d('0x6'));var interaction=require(_0x4e4d('0x7'));var config=require(_0x4e4d('0x8'));var controller=require(_0x4e4d('0x9'));router[_0x4e4d('0xa')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xc')]);router[_0x4e4d('0xa')](_0x4e4d('0xd'),auth[_0x4e4d('0xb')](),controller['show']);router[_0x4e4d('0xe')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xf')]);router[_0x4e4d('0x10')]('/:id',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0x11')]);router[_0x4e4d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4e4d('0x13')]);module[_0x4e4d('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index dbeca1e..d9f5fc4 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d10=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3d10,0x67));var _0x03d1=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x3d10[_0x5e238b];return _0x389bea;};'use strict';var moment=require(_0x03d1('0x0'));var Sequelize=require(_0x03d1('0x1'));module['exports']={'phone':{'type':Sequelize[_0x03d1('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x03d1('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x03d1('0x4')],'defaultValue':moment()[_0x03d1('0x5')](_0x03d1('0x6'))},'countbusyretry':{'type':Sequelize[_0x03d1('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x03d1('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x03d1('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x03d1('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x03d1('0x7')],'unique':_0x03d1('0x8')},'ListId':{'type':Sequelize[_0x03d1('0x7')],'unique':_0x03d1('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x03d1('0x7')],'unique':_0x03d1('0x8')},'CampaignId':{'type':Sequelize[_0x03d1('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x03d1('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x03d1('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x03d1('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x03d1('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x03d1('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x03d1('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x0a11=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0a11,0x135));var _0x10a1=function(_0x4a310d,_0x33322d){_0x4a310d=_0x4a310d-0x0;var _0x5eaf36=_0x0a11[_0x4a310d];return _0x5eaf36;};'use strict';var moment=require(_0x10a1('0x0'));var Sequelize=require(_0x10a1('0x1'));module[_0x10a1('0x2')]={'phone':{'type':Sequelize[_0x10a1('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x10a1('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x10a1('0x5')](_0x10a1('0x6'))},'countbusyretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x10a1('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x10a1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x10a1('0x8')]},'priority':{'type':Sequelize[_0x10a1('0x7')](0x2)[_0x10a1('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x10a1('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x10a1('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x10a1('0xa')},'UserId':{'type':Sequelize[_0x10a1('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x10a1('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x10a1('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x10a1('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x10a1('0x8')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 21a3ee2..ea96fb1 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['error','stack','name','send','map','CmHopper','fieldName','type','model','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$eq','$in','$notIn','$like','$notLike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','order','sort','pick','filter','merge','where','options','then','includeAll','include','rows','catch','show','params','rawAttributes','create','body','describe','destroy','find','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','CmContact','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','findOne','LOCK','UPDATE','getOpenContacts','preview','isNumber','entity\x20not\x20found','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','update','sendStatus'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x8ef6,0xf2));var _0x68ef=function(_0x25310e,_0x505198){_0x25310e=_0x25310e-0x0;var _0x2f7837=_0x8ef6[_0x25310e];return _0x2f7837;};'use strict';var moment=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var qs=require(_0x68ef('0x2'));var logger=require(_0x68ef('0x3'))(_0x68ef('0x4'));var shared=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];function respondWithResult(_0x4a72b8,_0x27d0af){_0x27d0af=_0x27d0af||0xc8;return function(_0x129ce){if(_0x129ce){return _0x4a72b8[_0x68ef('0x7')](_0x27d0af)[_0x68ef('0x8')](_0x129ce);}};}function respondWithFilteredResult(_0x4d26e3,_0x4f77f3){return function(_0x3c2ff3){if(_0x3c2ff3){var _0x4740e8=typeof _0x4f77f3[_0x68ef('0x9')]==='undefined'&&typeof _0x4f77f3[_0x68ef('0xa')]===_0x68ef('0xb');var _0x1bee73=_0x3c2ff3[_0x68ef('0xc')];var _0x112b18=_0x4740e8?0x0:_0x4f77f3[_0x68ef('0x9')];var _0x304a60=_0x4740e8?_0x3c2ff3[_0x68ef('0xc')]:_0x4f77f3[_0x68ef('0x9')]+_0x4f77f3[_0x68ef('0xa')];var _0x3afc1d;if(_0x304a60>=_0x1bee73){_0x304a60=_0x1bee73;_0x3afc1d=0xc8;}else{_0x3afc1d=0xce;}_0x4d26e3[_0x68ef('0x7')](_0x3afc1d);return _0x4d26e3['set'](_0x68ef('0xd'),_0x112b18+'-'+_0x304a60+'/'+_0x1bee73)[_0x68ef('0x8')](_0x3c2ff3);}return null;};}function saveUpdates(_0x1e117a,_0x454ef4){return function(_0x40f253){if(_0x40f253){return _0x40f253[_0x68ef('0xe')](_0x1e117a)['then'](function(_0x3b48dd){return _0x3b48dd;});}return null;};}function handleEntityNotFound(_0xc50cce,_0x2657c5){return function(_0x47fbb5){if(!_0x47fbb5){_0xc50cce[_0x68ef('0xf')](0x194);}return _0x47fbb5;};}function handleError(_0x1764de,_0x24682d){_0x24682d=_0x24682d||0x1f4;return function(_0x5005ba){logger[_0x68ef('0x10')](_0x5005ba[_0x68ef('0x11')]);if(_0x5005ba[_0x68ef('0x12')]){delete _0x5005ba[_0x68ef('0x12')];}_0x1764de['status'](_0x24682d)[_0x68ef('0x13')](_0x5005ba);};}exports['index']=function(_0x5cbb78,_0x2633c1){var _0x404870={},_0x4ade0d={},_0x527870={'count':0x0,'rows':[]};var _0x3c4c1f=_[_0x68ef('0x14')](db[_0x68ef('0x15')]['rawAttributes'],function(_0x1dc49c){return{'name':_0x1dc49c[_0x68ef('0x16')],'type':_0x1dc49c[_0x68ef('0x17')]['key']};});_0x4ade0d[_0x68ef('0x18')]=_[_0x68ef('0x14')](_0x3c4c1f,'name');_0x4ade0d[_0x68ef('0x19')]=_[_0x68ef('0x1a')](_0x5cbb78[_0x68ef('0x19')]);_0x4ade0d['filters']=_['intersection'](_0x4ade0d['model'],_0x4ade0d[_0x68ef('0x19')]);_0x4ade0d[_0x68ef('0x1b')]=_[_0x68ef('0x1c')](_0x4ade0d[_0x68ef('0x1b')],[_0x68ef('0x1d'),_0x68ef('0x1e'),_0x68ef('0x1f'),_0x68ef('0x20'),_0x68ef('0x21'),_0x68ef('0x22'),'$ne',_0x68ef('0x23'),'$not','$between','$notBetween',_0x68ef('0x24'),_0x68ef('0x25'),_0x68ef('0x26'),_0x68ef('0x27'),'$iLike','$notILike',_0x68ef('0x26'),_0x68ef('0x28'),_0x68ef('0x29'),_0x68ef('0x2a'),_0x68ef('0x2b')]);_0x404870[_0x68ef('0x2c')]=_[_0x68ef('0x2d')](_0x4ade0d[_0x68ef('0x18')],qs['fields'](_0x5cbb78[_0x68ef('0x19')][_0x68ef('0x2e')]));_0x404870[_0x68ef('0x2c')]=_0x404870['attributes'][_0x68ef('0x2f')]?_0x404870['attributes']:_0x4ade0d[_0x68ef('0x18')];if(!_0x5cbb78[_0x68ef('0x19')]['hasOwnProperty']('nolimit')){_0x404870[_0x68ef('0xa')]=qs[_0x68ef('0xa')](_0x5cbb78['query'][_0x68ef('0xa')]);_0x404870[_0x68ef('0x9')]=qs[_0x68ef('0x9')](_0x5cbb78[_0x68ef('0x19')]['offset']);}_0x404870[_0x68ef('0x30')]=qs[_0x68ef('0x31')](_0x5cbb78['query'][_0x68ef('0x31')]);_0x404870['where']=qs[_0x68ef('0x1b')](_[_0x68ef('0x32')](_0x5cbb78['query'],_0x4ade0d[_0x68ef('0x1b')]),_0x3c4c1f);if(_0x5cbb78['query'][_0x68ef('0x33')]){_0x404870['where']=_[_0x68ef('0x34')](_0x404870[_0x68ef('0x35')],{'$or':_[_0x68ef('0x14')](_0x3c4c1f,function(_0x569949){if(_0x569949[_0x68ef('0x17')]!=='VIRTUAL'){var _0x476938={};_0x476938[_0x569949['name']]={'$like':'%'+_0x5cbb78[_0x68ef('0x19')][_0x68ef('0x33')]+'%'};return _0x476938;}})});}_0x404870=_[_0x68ef('0x34')]({},_0x404870,_0x5cbb78[_0x68ef('0x36')]);var _0x2181d9={'where':_0x404870[_0x68ef('0x35')]};return db['CmHopper'][_0x68ef('0xc')](_0x2181d9)[_0x68ef('0x37')](function(_0x32074a){_0x527870['count']=_0x32074a;if(_0x5cbb78[_0x68ef('0x19')][_0x68ef('0x38')]){_0x404870[_0x68ef('0x39')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x404870);})[_0x68ef('0x37')](function(_0xec7de3){_0x527870[_0x68ef('0x3a')]=_0xec7de3;return _0x527870;})[_0x68ef('0x37')](respondWithFilteredResult(_0x2633c1,_0x404870))[_0x68ef('0x3b')](handleError(_0x2633c1,null));};exports[_0x68ef('0x3c')]=function(_0x41ffe0,_0x5b1246){var _0xaf7df1={'raw':!![],'where':{'id':_0x41ffe0[_0x68ef('0x3d')]['id']}},_0xd7f9ca={};_0xd7f9ca[_0x68ef('0x18')]=_['keys'](db[_0x68ef('0x15')][_0x68ef('0x3e')]);_0xd7f9ca[_0x68ef('0x19')]=_[_0x68ef('0x1a')](_0x41ffe0[_0x68ef('0x19')]);_0xd7f9ca[_0x68ef('0x1b')]=_['intersection'](_0xd7f9ca[_0x68ef('0x18')],_0xd7f9ca[_0x68ef('0x19')]);_0xaf7df1[_0x68ef('0x2c')]=_[_0x68ef('0x2d')](_0xd7f9ca[_0x68ef('0x18')],qs[_0x68ef('0x2e')](_0x41ffe0[_0x68ef('0x19')][_0x68ef('0x2e')]));_0xaf7df1[_0x68ef('0x2c')]=_0xaf7df1['attributes'][_0x68ef('0x2f')]?_0xaf7df1[_0x68ef('0x2c')]:_0xd7f9ca[_0x68ef('0x18')];if(_0x41ffe0[_0x68ef('0x19')][_0x68ef('0x38')]){_0xaf7df1[_0x68ef('0x39')]=[{'all':!![]}];}_0xaf7df1=_[_0x68ef('0x34')]({},_0xaf7df1,_0x41ffe0['options']);return db[_0x68ef('0x15')]['find'](_0xaf7df1)[_0x68ef('0x37')](handleEntityNotFound(_0x5b1246,null))[_0x68ef('0x37')](respondWithResult(_0x5b1246,null))[_0x68ef('0x3b')](handleError(_0x5b1246,null));};exports[_0x68ef('0x3f')]=function(_0x5a1330,_0x428456){return db['CmHopper'][_0x68ef('0x3f')](_0x5a1330['body'],{})[_0x68ef('0x37')](respondWithResult(_0x428456,0xc9))[_0x68ef('0x3b')](handleError(_0x428456,null));};exports[_0x68ef('0xe')]=function(_0x5c4a66,_0x59b148){if(_0x5c4a66[_0x68ef('0x40')]['id']){delete _0x5c4a66[_0x68ef('0x40')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x5c4a66['params']['id']}})[_0x68ef('0x37')](handleEntityNotFound(_0x59b148,null))[_0x68ef('0x37')](saveUpdates(_0x5c4a66[_0x68ef('0x40')],null))[_0x68ef('0x37')](respondWithResult(_0x59b148,null))[_0x68ef('0x3b')](handleError(_0x59b148,null));};exports['describe']=function(_0x55f385,_0xc39f5b){return db[_0x68ef('0x15')][_0x68ef('0x41')]()[_0x68ef('0x37')](respondWithResult(_0xc39f5b,null))['catch'](handleError(_0xc39f5b,null));};exports[_0x68ef('0x42')]=function(_0x474e5a,_0x1c9b6f){var _0x14142a;var _0x53880c=_0x474e5a['params']['id'];return db[_0x68ef('0x15')][_0x68ef('0x43')]({'where':{'id':_0x474e5a['params']['id']}})[_0x68ef('0x37')](handleEntityNotFound(_0x1c9b6f,null))[_0x68ef('0x37')](function(_0x3a82a0){if(_0x3a82a0){return _0x3a82a0[_0x68ef('0x42')]()[_0x68ef('0x37')](function(_0x4f0f77){return _0x4f0f77;});}})[_0x68ef('0x37')](function(_0x3984ca){_0x14142a=_0x3984ca;if(_0x3984ca){if(_0x3984ca[_0x68ef('0x44')]||_0x3984ca['CampaignId']){return db[_0x3984ca[_0x68ef('0x44')]?_0x68ef('0x45'):_0x68ef('0x46')]['find']({'where':{'id':_0x3984ca[_0x68ef('0x44')]?_0x3984ca['VoiceQueueId']:_0x3984ca['CampaignId']},'attributes':['id',_0x68ef('0x12')],'raw':!![]});}}})['then'](function(_0x39dd21){var _0xb33afd={};if(_0x39dd21){_[_0x68ef('0x34')](_0xb33afd,_[_0x68ef('0x47')](_0x14142a[_0x68ef('0x48')],[_0x68ef('0x49'),_0x68ef('0x4a'),'id']));_0xb33afd[_0x68ef('0x4b')]=0x15;_0xb33afd[_0x68ef('0x4c')]=_0x68ef('0x4d');_0xb33afd['campaign']=_0x39dd21['name'];_0xb33afd[_0x68ef('0x4e')]=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x12')];_0xb33afd[_0x68ef('0x50')]=_0x474e5a[_0x68ef('0x4f')]['id'];_0xb33afd[_0x68ef('0x4d')]=!![];_0xb33afd[_0x68ef('0x51')]=moment()[_0x68ef('0x52')](_0x68ef('0x53'));_0xb33afd['calleridnum']=_0x14142a['phone'];_0xb33afd[_0x68ef('0x54')]=_0x14142a['VoiceQueueId']?_0x68ef('0x55'):'ivr';return db[_0x68ef('0x56')][_0x68ef('0x43')]({'where':{'id':_0xb33afd['ContactId']},'attributes':[_0x68ef('0x57'),'lastName']})[_0x68ef('0x37')](function(_0x15c1ee){if(!_[_0x68ef('0x58')](_0x1c9b6f)&&!_[_0x68ef('0x58')](_0x15c1ee[_0x68ef('0x57')])){_0xb33afd[_0x68ef('0x59')]=_0x15c1ee['firstName'];if(!_[_0x68ef('0x58')](_0x15c1ee[_0x68ef('0x5a')])){_0xb33afd[_0x68ef('0x59')]+='\x20'+_0x15c1ee[_0x68ef('0x5a')];}}})[_0x68ef('0x5b')](function(){return db[_0x68ef('0x5c')]['create'](_0xb33afd);});}})[_0x68ef('0x37')](function(_0x42d2a3){return db['CmHopperAdditionalPhone'][_0x68ef('0x42')]({'where':{'CmHopperId':_0x53880c}});})[_0x68ef('0x37')](function(){return _0x1c9b6f[_0x68ef('0x7')](0xcc)['end']();})[_0x68ef('0x3b')](handleError(_0x1c9b6f,null));};exports['getPreview']=function(_0x5412ea,_0x3e5cca){var _0x540da5=[];return db[_0x68ef('0x56')]['describe']()[_0x68ef('0x37')](function(_0x9e8554){_0x540da5=_[_0x68ef('0x1a')](_0x9e8554);return _0x5412ea[_0x68ef('0x4f')][_0x68ef('0x5d')]({'where':{'type':_0x68ef('0x5e'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x68ef('0x5f'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x68ef('0x37')](function(_0x4b0c3e){if(_0x4b0c3e&&_0x4b0c3e[_0x68ef('0x2f')]){return db[_0x68ef('0x60')][_0x68ef('0x61')](function(_0xf0a40f){var _0x2f409c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x68ef('0x52')](_0x68ef('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x4b0c3e,'id')},'$or':[{'UserId':null},{'UserId':_0x5412ea[_0x68ef('0x4f')]['id']}]};var _0x11bab3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4b0c3e)[_0x68ef('0x33')]([_0x68ef('0x62'),0x0])[_0x68ef('0x14')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x5412ea[_0x68ef('0x4f')]['id']}]};var _0x561e8d={'$or':[_0x2f409c,_0x11bab3]};var _0x1ed172=[];if(_0x5412ea['body']['direction']&&_0x5412ea[_0x68ef('0x40')][_0x68ef('0x63')]===_0x68ef('0x64')){if(!_[_0x68ef('0x65')](_0x5412ea['body'][_0x68ef('0x66')])){_0x561e8d['id']={'$in':_0x5412ea['body'][_0x68ef('0x66')]};}_0x1ed172=[[_0x68ef('0x67'),_0x68ef('0x68')],['scheduledAt',_0x4b0c3e[0x0]['dialOrderByScheduledAt']===_0x68ef('0x68')?_0x68ef('0x69'):_0x68ef('0x68')],db[_0x68ef('0x60')]['literal'](_0x68ef('0x6a')),['id',_0x68ef('0x69')]];}else{if(!_[_0x68ef('0x65')](_0x5412ea[_0x68ef('0x40')]['hopperIds'])){_0x561e8d['id']={'$notIn':_0x5412ea[_0x68ef('0x40')]['hopperIds']};}_0x1ed172=[[_0x68ef('0x67'),_0x68ef('0x69')],[_0x68ef('0x6b'),_0x4b0c3e[0x0][_0x68ef('0x5f')]],db[_0x68ef('0x60')]['literal'](_0x68ef('0x6c')),['id',_0x68ef('0x68')]];}return db[_0x68ef('0x15')]['findOne']({'attributes':['id',_0x68ef('0x6d'),'phone',_0x68ef('0x6e')],'where':_0x561e8d,'order':_0x1ed172,'transaction':_0xf0a40f,'lock':_0xf0a40f['LOCK']['UPDATE'],'include':[{'model':db[_0x68ef('0x56')],'as':_0x68ef('0x6f'),'attributes':_0x540da5,'include':[{'model':db[_0x68ef('0x70')],'as':_0x68ef('0x71'),'attributes':['id','name']}]},{'model':db[_0x68ef('0x72')],'as':_0x68ef('0x73'),'attributes':['id',_0x68ef('0x12')]},{'model':db['VoiceQueue'],'as':_0x68ef('0x74'),'attributes':['id',_0x68ef('0x12'),_0x68ef('0x75')]}]})[_0x68ef('0x37')](function(_0x2f551d){if(_0x2f551d){return _0x2f551d[_0x68ef('0xe')]({'UserId':_0x5412ea[_0x68ef('0x4f')]['id']},{'transaction':_0xf0a40f});}});});}})[_0x68ef('0x37')](handleEntityNotFound(_0x3e5cca,null))[_0x68ef('0x37')](respondWithResult(_0x3e5cca,null))[_0x68ef('0x3b')](handleError(_0x3e5cca,null));};exports[_0x68ef('0x76')]=function(_0x6a48ad,_0x50e298,_0x15378c){var _0x391a81=[];var _0x5db443=_0x6a48ad['params']['id'];var _0x12942d=_0x6a48ad['user']['id'];return db[_0x68ef('0x56')][_0x68ef('0x41')]()['then'](function(_0x4e0874){_0x391a81=_[_0x68ef('0x1a')](_0x4e0874);return db['sequelize'][_0x68ef('0x61')](function(_0x5e61af){const _0x34fa4a={'id':_0x5db443};return db['CmHopper'][_0x68ef('0x77')]({'attributes':['id',_0x68ef('0x6d'),'recallme'],'where':_0x34fa4a,'transaction':_0x5e61af,'lock':_0x5e61af[_0x68ef('0x78')][_0x68ef('0x79')],'include':[{'model':db[_0x68ef('0x56')],'as':_0x68ef('0x6f'),'attributes':_0x391a81,'include':[{'model':db['CmCompany'],'as':_0x68ef('0x71'),'attributes':['id',_0x68ef('0x12')]}]},{'model':db['CmList'],'as':_0x68ef('0x73'),'attributes':['id',_0x68ef('0x12')]},{'model':db[_0x68ef('0x45')],'as':'Queue','attributes':['id',_0x68ef('0x12'),'dialActive']}]})[_0x68ef('0x37')](function(_0x36c109){if(_0x36c109){return _0x36c109['update']({'UserId':_0x12942d},{'transaction':_0x5e61af});}});});})['then'](handleEntityNotFound(_0x50e298,null))['then'](respondWithResult(_0x50e298,null))['catch'](handleError(_0x50e298,null));};exports[_0x68ef('0x7a')]=function(_0x28ad22,_0x1217f9){return _0x28ad22[_0x68ef('0x4f')][_0x68ef('0x5d')]({'where':{'type':_0x68ef('0x5e'),'dialActive':!![],'dialMethod':_0x68ef('0x7b')},'attributes':['id'],'raw':!![]})[_0x68ef('0x37')](function(_0x24ba34){if(_0x24ba34&&_0x24ba34[_0x68ef('0x2f')]){return db[_0x68ef('0x15')][_0x68ef('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x68ef('0x52')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x68ef('0x14')](_0x24ba34,'id')},'$or':[{'UserId':null},{'UserId':_0x28ad22['user']['id']}]}});}return 0x0;})[_0x68ef('0x37')](function(_0x5b39a8){if(!_['isNil'](_0x5b39a8)&&_[_0x68ef('0x7c')](_0x5b39a8)){return _0x1217f9[_0x68ef('0x7')](0xc8)[_0x68ef('0x8')]({'contacts':_0x5b39a8});}else{logger[_0x68ef('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x68ef('0x7d'));_0x1217f9[_0x68ef('0xf')](0x194);}})[_0x68ef('0x3b')](handleError(_0x1217f9,null));};exports['getTimezones']=function(_0x3b5078,_0x23c69e){var _0x20c185=shared[_0x68ef('0x7e')];var _0x4dc885=[];_[_0x68ef('0x14')](_0x20c185,function(_0x1d158f){_0x4dc885[_0x68ef('0x7f')]({'id':_0x1d158f[_0x68ef('0x12')],'name':_0x1d158f[_0x68ef('0x12')],'utcOffset':_0x1d158f[_0x68ef('0x80')]});});return _0x23c69e['status'](0xc8)[_0x68ef('0x8')]({'tz':_0x4dc885});};exports['getTimezone']=function(_0xea97f4,_0x9b55f7){var _0x37da0a=shared[_0x68ef('0x7e')];var _0x58067b={};if(!_[_0x68ef('0x58')](_0x37da0a[_0xea97f4['body']['id']]))_0x58067b=_0x37da0a[_0xea97f4[_0x68ef('0x40')]['id']];return _0x9b55f7[_0x68ef('0x7')](0xc8)['json'](_0x58067b);}; \ No newline at end of file +var _0x56e7=['index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contained','$any','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','direction','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','List','VoiceQueue','dialActive','getPreviewRecall','transaction','CmCompany','Company','CmList','Queue','getOpenContacts','isNumber','json','error','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','undefined','count','offset','limit','set','update','then','sendStatus','stack','name','send'];(function(_0x215c81,_0x5839dc){var _0x848f90=function(_0x322a3f){while(--_0x322a3f){_0x215c81['push'](_0x215c81['shift']());}};_0x848f90(++_0x5839dc);}(_0x56e7,0x7b));var _0x756e=function(_0x5b57c1,_0x5c1b07){_0x5b57c1=_0x5b57c1-0x0;var _0x551c14=_0x56e7[_0x5b57c1];return _0x551c14;};'use strict';var moment=require('moment');var _=require(_0x756e('0x0'));var qs=require(_0x756e('0x1'));var logger=require('../../config/logger')(_0x756e('0x2'));var shared=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];function respondWithResult(_0xb850c9,_0x11ce5f){_0x11ce5f=_0x11ce5f||0xc8;return function(_0x38546a){if(_0x38546a){return _0xb850c9[_0x756e('0x5')](_0x11ce5f)['json'](_0x38546a);}};}function respondWithFilteredResult(_0x3b3b8f,_0x404189){return function(_0x26519d){if(_0x26519d){var _0xcf58ec=typeof _0x404189['offset']===_0x756e('0x6')&&typeof _0x404189['limit']===_0x756e('0x6');var _0x401181=_0x26519d[_0x756e('0x7')];var _0x4738dc=_0xcf58ec?0x0:_0x404189['offset'];var _0x5d5b90=_0xcf58ec?_0x26519d[_0x756e('0x7')]:_0x404189[_0x756e('0x8')]+_0x404189[_0x756e('0x9')];var _0x4c4d7c;if(_0x5d5b90>=_0x401181){_0x5d5b90=_0x401181;_0x4c4d7c=0xc8;}else{_0x4c4d7c=0xce;}_0x3b3b8f[_0x756e('0x5')](_0x4c4d7c);return _0x3b3b8f[_0x756e('0xa')]('Content-Range',_0x4738dc+'-'+_0x5d5b90+'/'+_0x401181)['json'](_0x26519d);}return null;};}function saveUpdates(_0x1b68ef,_0x569e8f){return function(_0x459237){if(_0x459237){return _0x459237[_0x756e('0xb')](_0x1b68ef)[_0x756e('0xc')](function(_0x136052){return _0x136052;});}return null;};}function handleEntityNotFound(_0x252333,_0x4ae32a){return function(_0x4b3660){if(!_0x4b3660){_0x252333[_0x756e('0xd')](0x194);}return _0x4b3660;};}function handleError(_0x11f37b,_0xccccd4){_0xccccd4=_0xccccd4||0x1f4;return function(_0x59956f){logger['error'](_0x59956f[_0x756e('0xe')]);if(_0x59956f[_0x756e('0xf')]){delete _0x59956f[_0x756e('0xf')];}_0x11f37b[_0x756e('0x5')](_0xccccd4)[_0x756e('0x10')](_0x59956f);};}exports[_0x756e('0x11')]=function(_0x124ac0,_0x1a8614){var _0xb17214={},_0x4da91f={},_0x216ffd={'count':0x0,'rows':[]};var _0x47c3c4=_['map'](db[_0x756e('0x12')][_0x756e('0x13')],function(_0x30bc11){return{'name':_0x30bc11[_0x756e('0x14')],'type':_0x30bc11[_0x756e('0x15')][_0x756e('0x16')]};});_0x4da91f[_0x756e('0x17')]=_[_0x756e('0x18')](_0x47c3c4,_0x756e('0xf'));_0x4da91f[_0x756e('0x19')]=_[_0x756e('0x1a')](_0x124ac0[_0x756e('0x19')]);_0x4da91f[_0x756e('0x1b')]=_[_0x756e('0x1c')](_0x4da91f[_0x756e('0x17')],_0x4da91f[_0x756e('0x19')]);_0x4da91f['filters']=_[_0x756e('0x1d')](_0x4da91f['filters'],[_0x756e('0x1e'),_0x756e('0x1f'),_0x756e('0x20'),_0x756e('0x21'),'$lt',_0x756e('0x22'),_0x756e('0x23'),_0x756e('0x24'),'$not',_0x756e('0x25'),_0x756e('0x26'),_0x756e('0x27'),'$notIn',_0x756e('0x28'),_0x756e('0x29'),'$iLike',_0x756e('0x2a'),_0x756e('0x28'),_0x756e('0x2b'),'$contains',_0x756e('0x2c'),_0x756e('0x2d')]);_0xb17214['attributes']=_[_0x756e('0x1c')](_0x4da91f[_0x756e('0x17')],qs['fields'](_0x124ac0[_0x756e('0x19')][_0x756e('0x2e')]));_0xb17214[_0x756e('0x2f')]=_0xb17214[_0x756e('0x2f')][_0x756e('0x30')]?_0xb17214['attributes']:_0x4da91f[_0x756e('0x17')];if(!_0x124ac0['query']['hasOwnProperty'](_0x756e('0x31'))){_0xb17214['limit']=qs[_0x756e('0x9')](_0x124ac0[_0x756e('0x19')][_0x756e('0x9')]);_0xb17214[_0x756e('0x8')]=qs[_0x756e('0x8')](_0x124ac0[_0x756e('0x19')][_0x756e('0x8')]);}_0xb17214[_0x756e('0x32')]=qs[_0x756e('0x33')](_0x124ac0[_0x756e('0x19')][_0x756e('0x33')]);_0xb17214[_0x756e('0x34')]=qs['filters'](_['pick'](_0x124ac0[_0x756e('0x19')],_0x4da91f[_0x756e('0x1b')]),_0x47c3c4);if(_0x124ac0[_0x756e('0x19')][_0x756e('0x35')]){_0xb17214[_0x756e('0x34')]=_[_0x756e('0x36')](_0xb17214[_0x756e('0x34')],{'$or':_['map'](_0x47c3c4,function(_0x5b2b59){if(_0x5b2b59['type']!==_0x756e('0x37')){var _0xa63bf={};_0xa63bf[_0x5b2b59[_0x756e('0xf')]]={'$like':'%'+_0x124ac0['query'][_0x756e('0x35')]+'%'};return _0xa63bf;}})});}_0xb17214=_[_0x756e('0x36')]({},_0xb17214,_0x124ac0['options']);var _0x3ece0f={'where':_0xb17214[_0x756e('0x34')]};return db[_0x756e('0x12')][_0x756e('0x7')](_0x3ece0f)[_0x756e('0xc')](function(_0x26965c){_0x216ffd[_0x756e('0x7')]=_0x26965c;if(_0x124ac0[_0x756e('0x19')]['includeAll']){_0xb17214[_0x756e('0x38')]=[{'all':!![]}];}return db[_0x756e('0x12')][_0x756e('0x39')](_0xb17214);})[_0x756e('0xc')](function(_0x36b7de){_0x216ffd[_0x756e('0x3a')]=_0x36b7de;return _0x216ffd;})[_0x756e('0xc')](respondWithFilteredResult(_0x1a8614,_0xb17214))[_0x756e('0x3b')](handleError(_0x1a8614,null));};exports[_0x756e('0x3c')]=function(_0x64b70d,_0x5bb3bd){var _0x41a100={'raw':!![],'where':{'id':_0x64b70d['params']['id']}},_0x38274c={};_0x38274c[_0x756e('0x17')]=_[_0x756e('0x1a')](db[_0x756e('0x12')]['rawAttributes']);_0x38274c[_0x756e('0x19')]=_[_0x756e('0x1a')](_0x64b70d[_0x756e('0x19')]);_0x38274c['filters']=_[_0x756e('0x1c')](_0x38274c[_0x756e('0x17')],_0x38274c[_0x756e('0x19')]);_0x41a100[_0x756e('0x2f')]=_[_0x756e('0x1c')](_0x38274c[_0x756e('0x17')],qs['fields'](_0x64b70d[_0x756e('0x19')][_0x756e('0x2e')]));_0x41a100['attributes']=_0x41a100[_0x756e('0x2f')][_0x756e('0x30')]?_0x41a100[_0x756e('0x2f')]:_0x38274c[_0x756e('0x17')];if(_0x64b70d[_0x756e('0x19')][_0x756e('0x3d')]){_0x41a100[_0x756e('0x38')]=[{'all':!![]}];}_0x41a100=_[_0x756e('0x36')]({},_0x41a100,_0x64b70d[_0x756e('0x3e')]);return db['CmHopper'][_0x756e('0x3f')](_0x41a100)['then'](handleEntityNotFound(_0x5bb3bd,null))[_0x756e('0xc')](respondWithResult(_0x5bb3bd,null))[_0x756e('0x3b')](handleError(_0x5bb3bd,null));};exports[_0x756e('0x40')]=function(_0x54248c,_0x3fc697){return db[_0x756e('0x12')][_0x756e('0x40')](_0x54248c['body'],{})['then'](respondWithResult(_0x3fc697,0xc9))[_0x756e('0x3b')](handleError(_0x3fc697,null));};exports[_0x756e('0xb')]=function(_0x5a6d3e,_0x499da2){if(_0x5a6d3e[_0x756e('0x41')]['id']){delete _0x5a6d3e[_0x756e('0x41')]['id'];}return db[_0x756e('0x12')]['find']({'where':{'id':_0x5a6d3e[_0x756e('0x42')]['id']}})['then'](handleEntityNotFound(_0x499da2,null))[_0x756e('0xc')](saveUpdates(_0x5a6d3e[_0x756e('0x41')],null))[_0x756e('0xc')](respondWithResult(_0x499da2,null))['catch'](handleError(_0x499da2,null));};exports[_0x756e('0x43')]=function(_0x5224f2,_0x5064a3){return db[_0x756e('0x12')]['describe']()[_0x756e('0xc')](respondWithResult(_0x5064a3,null))[_0x756e('0x3b')](handleError(_0x5064a3,null));};exports[_0x756e('0x44')]=function(_0x2512d3,_0x95061c){var _0x2fb384;var _0x50b86e=_0x2512d3[_0x756e('0x42')]['id'];return db['CmHopper'][_0x756e('0x3f')]({'where':{'id':_0x2512d3['params']['id']}})[_0x756e('0xc')](handleEntityNotFound(_0x95061c,null))['then'](function(_0x2f08d5){if(_0x2f08d5){return _0x2f08d5['destroy']()[_0x756e('0xc')](function(_0x37ddd0){return _0x37ddd0;});}})[_0x756e('0xc')](function(_0x52c976){_0x2fb384=_0x52c976;if(_0x52c976){if(_0x52c976[_0x756e('0x45')]||_0x52c976[_0x756e('0x46')]){return db[_0x52c976['VoiceQueueId']?'VoiceQueue':_0x756e('0x47')][_0x756e('0x3f')]({'where':{'id':_0x52c976[_0x756e('0x45')]?_0x52c976[_0x756e('0x45')]:_0x52c976[_0x756e('0x46')]},'attributes':['id',_0x756e('0xf')],'raw':!![]});}}})[_0x756e('0xc')](function(_0x9e8559){var _0x33f923={};if(_0x9e8559){_['merge'](_0x33f923,_[_0x756e('0x48')](_0x2fb384[_0x756e('0x49')],[_0x756e('0x4a'),_0x756e('0x4b'),'id']));_0x33f923[_0x756e('0x4c')]=0x15;_0x33f923[_0x756e('0x4d')]=_0x756e('0x4e');_0x33f923[_0x756e('0x4f')]=_0x9e8559['name'];_0x33f923[_0x756e('0x50')]=_0x2512d3[_0x756e('0x51')]['name'];_0x33f923[_0x756e('0x52')]=_0x2512d3['user']['id'];_0x33f923[_0x756e('0x4e')]=!![];_0x33f923[_0x756e('0x53')]=moment()[_0x756e('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x33f923[_0x756e('0x55')]=_0x2fb384[_0x756e('0x56')];_0x33f923[_0x756e('0x57')]=_0x2fb384['VoiceQueueId']?_0x756e('0x58'):'ivr';return db[_0x756e('0x59')][_0x756e('0x3f')]({'where':{'id':_0x33f923[_0x756e('0x5a')]},'attributes':[_0x756e('0x5b'),_0x756e('0x5c')]})[_0x756e('0xc')](function(_0x1f0be1){if(!_[_0x756e('0x5d')](_0x95061c)&&!_['isNil'](_0x1f0be1[_0x756e('0x5b')])){_0x33f923[_0x756e('0x5e')]=_0x1f0be1[_0x756e('0x5b')];if(!_[_0x756e('0x5d')](_0x1f0be1[_0x756e('0x5c')])){_0x33f923[_0x756e('0x5e')]+='\x20'+_0x1f0be1[_0x756e('0x5c')];}}})[_0x756e('0x5f')](function(){return db[_0x756e('0x60')][_0x756e('0x40')](_0x33f923);});}})[_0x756e('0xc')](function(_0x176d84){return db[_0x756e('0x61')][_0x756e('0x44')]({'where':{'CmHopperId':_0x50b86e}});})['then'](function(){return _0x95061c[_0x756e('0x5')](0xcc)[_0x756e('0x62')]();})[_0x756e('0x3b')](handleError(_0x95061c,null));};exports[_0x756e('0x63')]=function(_0x674b74,_0xe91378){var _0x58198e=[];return db[_0x756e('0x59')][_0x756e('0x43')]()[_0x756e('0xc')](function(_0x3c5976){_0x58198e=_['keys'](_0x3c5976);return _0x674b74['user'][_0x756e('0x64')]({'where':{'type':_0x756e('0x65'),'dialActive':!![],'dialMethod':_0x756e('0x66')},'attributes':['id',_0x756e('0x67'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x756e('0xc')](function(_0x312715){if(_0x312715&&_0x312715[_0x756e('0x30')]){return db[_0x756e('0x68')]['transaction'](function(_0x5c580b){var _0x207228={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x756e('0x54')](_0x756e('0x69'))},'VoiceQueueId':{'$in':_[_0x756e('0x18')](_0x312715,'id')},'$or':[{'UserId':null},{'UserId':_0x674b74[_0x756e('0x51')]['id']}]};var _0x366dfe={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x312715)[_0x756e('0x35')]([_0x756e('0x6a'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x674b74[_0x756e('0x51')]['id']}]};var _0x86477e={'$or':[_0x207228,_0x366dfe]};var _0x4740ae=[];if(_0x674b74[_0x756e('0x41')][_0x756e('0x6b')]&&_0x674b74[_0x756e('0x41')][_0x756e('0x6b')]==='prev'){if(!_[_0x756e('0x6c')](_0x674b74['body'][_0x756e('0x6d')])){_0x86477e['id']={'$in':_0x674b74['body'][_0x756e('0x6d')]};}_0x4740ae=[[_0x756e('0x6e'),_0x756e('0x6f')],['scheduledAt',_0x312715[0x0][_0x756e('0x67')]===_0x756e('0x6f')?_0x756e('0x70'):_0x756e('0x6f')],db[_0x756e('0x68')][_0x756e('0x71')](_0x756e('0x72')),['id','DESC']];}else{if(!_['isEmpty'](_0x674b74[_0x756e('0x41')][_0x756e('0x6d')])){_0x86477e['id']={'$notIn':_0x674b74[_0x756e('0x41')][_0x756e('0x6d')]};}_0x4740ae=[[_0x756e('0x6e'),_0x756e('0x70')],['scheduledAt',_0x312715[0x0][_0x756e('0x67')]],db[_0x756e('0x68')][_0x756e('0x71')](_0x756e('0x73')),['id',_0x756e('0x6f')]];}return db[_0x756e('0x12')][_0x756e('0x74')]({'attributes':['id',_0x756e('0x75'),'phone',_0x756e('0x76')],'where':_0x86477e,'order':_0x4740ae,'transaction':_0x5c580b,'lock':_0x5c580b[_0x756e('0x77')][_0x756e('0x78')],'include':[{'model':db[_0x756e('0x59')],'as':_0x756e('0x79'),'attributes':_0x58198e,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x756e('0xf')]}]},{'model':db['CmList'],'as':_0x756e('0x7a'),'attributes':['id','name']},{'model':db[_0x756e('0x7b')],'as':'Queue','attributes':['id',_0x756e('0xf'),_0x756e('0x7c')]}]})[_0x756e('0xc')](function(_0x4afbc4){if(_0x4afbc4){return _0x4afbc4[_0x756e('0xb')]({'UserId':_0x674b74['user']['id']},{'transaction':_0x5c580b});}});});}})[_0x756e('0xc')](handleEntityNotFound(_0xe91378,null))[_0x756e('0xc')](respondWithResult(_0xe91378,null))[_0x756e('0x3b')](handleError(_0xe91378,null));};exports[_0x756e('0x7d')]=function(_0x53b551,_0x3b5d8e,_0x38c0c7){var _0x5b087a=[];var _0xe3e3b6=_0x53b551[_0x756e('0x42')]['id'];var _0x5d690a=_0x53b551[_0x756e('0x51')]['id'];return db['CmContact']['describe']()[_0x756e('0xc')](function(_0x50728b){_0x5b087a=_[_0x756e('0x1a')](_0x50728b);return db['sequelize'][_0x756e('0x7e')](function(_0x51a2ec){const _0x4456c0={'id':_0xe3e3b6};return db[_0x756e('0x12')][_0x756e('0x74')]({'attributes':['id',_0x756e('0x75'),_0x756e('0x76')],'where':_0x4456c0,'transaction':_0x51a2ec,'lock':_0x51a2ec[_0x756e('0x77')][_0x756e('0x78')],'include':[{'model':db[_0x756e('0x59')],'as':_0x756e('0x79'),'attributes':_0x5b087a,'include':[{'model':db[_0x756e('0x7f')],'as':_0x756e('0x80'),'attributes':['id',_0x756e('0xf')]}]},{'model':db[_0x756e('0x81')],'as':'List','attributes':['id','name']},{'model':db[_0x756e('0x7b')],'as':_0x756e('0x82'),'attributes':['id',_0x756e('0xf'),_0x756e('0x7c')]}]})[_0x756e('0xc')](function(_0x18df88){if(_0x18df88){return _0x18df88[_0x756e('0xb')]({'UserId':_0x5d690a},{'transaction':_0x51a2ec});}});});})['then'](handleEntityNotFound(_0x3b5d8e,null))[_0x756e('0xc')](respondWithResult(_0x3b5d8e,null))[_0x756e('0x3b')](handleError(_0x3b5d8e,null));};exports[_0x756e('0x83')]=function(_0x421a80,_0xcfaaba){return _0x421a80['user'][_0x756e('0x64')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x756e('0xc')](function(_0x48b8e8){if(_0x48b8e8&&_0x48b8e8[_0x756e('0x30')]){return db[_0x756e('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x756e('0x54')](_0x756e('0x69'))},'VoiceQueueId':{'$in':_[_0x756e('0x18')](_0x48b8e8,'id')},'$or':[{'UserId':null},{'UserId':_0x421a80[_0x756e('0x51')]['id']}]}});}return 0x0;})[_0x756e('0xc')](function(_0x5aeb07){if(!_[_0x756e('0x5d')](_0x5aeb07)&&_[_0x756e('0x84')](_0x5aeb07)){return _0xcfaaba[_0x756e('0x5')](0xc8)[_0x756e('0x85')]({'contacts':_0x5aeb07});}else{logger[_0x756e('0x86')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,'entity\x20not\x20found');_0xcfaaba[_0x756e('0xd')](0x194);}})['catch'](handleError(_0xcfaaba,null));};exports[_0x756e('0x87')]=function(_0x1e5942,_0x23127a){var _0x4e31a8=shared[_0x756e('0x88')];var _0x5d7bd8=[];_[_0x756e('0x18')](_0x4e31a8,function(_0x59cdd4){_0x5d7bd8[_0x756e('0x89')]({'id':_0x59cdd4[_0x756e('0xf')],'name':_0x59cdd4[_0x756e('0xf')],'utcOffset':_0x59cdd4[_0x756e('0x8a')]});});return _0x23127a[_0x756e('0x5')](0xc8)[_0x756e('0x85')]({'tz':_0x5d7bd8});};exports[_0x756e('0x8b')]=function(_0x3e72d6,_0x3b1b92){var _0x51dc21=shared[_0x756e('0x88')];var _0x3b4d66={};if(!_[_0x756e('0x5d')](_0x51dc21[_0x3e72d6[_0x756e('0x41')]['id']]))_0x3b4d66=_0x51dc21[_0x3e72d6[_0x756e('0x41')]['id']];return _0x3b1b92[_0x756e('0x5')](0xc8)[_0x756e('0x85')](_0x3b4d66);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a1ea7a7..1cc4e32 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x37d5a8,_0x5d5b9d){var _0x56c600=function(_0x513474){while(--_0x513474){_0x37d5a8['push'](_0x37d5a8['shift']());}};_0x56c600(++_0x5d5b9d);}(_0x1883,0xab));var _0x3188=function(_0x42f27f,_0xec4e1e){_0x42f27f=_0x42f27f-0x0;var _0x30aa82=_0x1883[_0x42f27f];return _0x30aa82;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['phone']},{'name':_0x3188('0x11'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x571de9,_0x1babf0){var _0x4f9c8f=function(_0x12eee3){while(--_0x12eee3){_0x571de9['push'](_0x571de9['shift']());}};_0x4f9c8f(++_0x1babf0);}(_0x2542,0x169));var _0x2254=function(_0x5ec9d6,_0x10760e){_0x5ec9d6=_0x5ec9d6-0x0;var _0x39bea5=_0x2542[_0x5ec9d6];return _0x39bea5;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 4fd9cc9..e5bb95c 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0727=['length','UserId','push','update','includes','all','dataValues','ContactId','GetContactDialer','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','options','raw','where','attributes','limit','include','map','model','info','GetCmHopper','stringify','catch','message','error','ShowCmHopper','then','debug','body','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','findAll','order','UPDATE','Contact','keys','User','Agent','name','voicePause'];(function(_0x263160,_0x5a4bea){var _0x4b599b=function(_0x1f2777){while(--_0x1f2777){_0x263160['push'](_0x263160['shift']());}};_0x4b599b(++_0x5a4bea);}(_0x0727,0x110));var _0x7072=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x0727[_0xd8aad0];return _0x570860;};'use strict';var _=require('lodash');var util=require(_0x7072('0x0'));var moment=require(_0x7072('0x1'));var BPromise=require(_0x7072('0x2'));var db=require(_0x7072('0x3'))['db'];var logger=require(_0x7072('0x4'))(_0x7072('0x5'));exports['GetCmHopper']=function(_0x4131a5){var _0x137e31=this;return new Promise(function(_0x461a50,_0x2df17b){return db[_0x7072('0x6')]['findAll']({'raw':_0x4131a5[_0x7072('0x7')]?_0x4131a5['options'][_0x7072('0x8')]===undefined?!![]:![]:!![],'where':_0x4131a5['options']?_0x4131a5[_0x7072('0x7')][_0x7072('0x9')]||null:null,'attributes':_0x4131a5[_0x7072('0x7')]?_0x4131a5[_0x7072('0x7')][_0x7072('0xa')]||null:null,'limit':_0x4131a5[_0x7072('0x7')]?_0x4131a5[_0x7072('0x7')][_0x7072('0xb')]||null:null,'include':_0x4131a5[_0x7072('0x7')]?_0x4131a5[_0x7072('0x7')][_0x7072('0xc')]?_[_0x7072('0xd')](_0x4131a5[_0x7072('0x7')][_0x7072('0xc')],function(_0x7aa9e3){return{'model':db[_0x7aa9e3[_0x7072('0xe')]],'as':_0x7aa9e3['as'],'attributes':_0x7aa9e3['attributes'],'include':_0x7aa9e3[_0x7072('0xc')]?_[_0x7072('0xd')](_0x7aa9e3[_0x7072('0xc')],function(_0x309b5d){return{'model':db[_0x309b5d['model']],'as':_0x309b5d['as'],'attributes':_0x309b5d[_0x7072('0xa')],'include':_0x309b5d[_0x7072('0xc')]?_['map'](_0x309b5d[_0x7072('0xc')],function(_0x573bda){return{'model':db[_0x573bda[_0x7072('0xe')]],'as':_0x573bda['as'],'attributes':_0x573bda['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41a886){logger[_0x7072('0xf')](_0x7072('0x10'),_0x4131a5);logger['debug'](_0x7072('0x10'),_0x4131a5,JSON[_0x7072('0x11')](_0x41a886));_0x461a50(_0x41a886);})[_0x7072('0x12')](function(_0x1db64f){logger['error'](_0x7072('0x10'),_0x1db64f[_0x7072('0x13')],_0x4131a5);_0x2df17b(_0x137e31[_0x7072('0x14')](0x1f4,_0x1db64f[_0x7072('0x13')]));});});};exports[_0x7072('0x15')]=function(_0x2c1df8){var _0xde92e6=this;return new Promise(function(_0x5253a3,_0x4caa75){return db['CmHopper']['find']({'raw':_0x2c1df8[_0x7072('0x7')]?_0x2c1df8[_0x7072('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x2c1df8[_0x7072('0x7')]?_0x2c1df8[_0x7072('0x7')]['where']||null:null,'attributes':_0x2c1df8['options']?_0x2c1df8[_0x7072('0x7')]['attributes']||null:null,'include':_0x2c1df8[_0x7072('0x7')]?_0x2c1df8['options'][_0x7072('0xc')]?_[_0x7072('0xd')](_0x2c1df8['options'][_0x7072('0xc')],function(_0x320733){return{'model':db[_0x320733['model']],'as':_0x320733['as'],'attributes':_0x320733[_0x7072('0xa')],'include':_0x320733[_0x7072('0xc')]?_['map'](_0x320733['include'],function(_0x422052){return{'model':db[_0x422052['model']],'as':_0x422052['as'],'attributes':_0x422052[_0x7072('0xa')],'include':_0x422052[_0x7072('0xc')]?_[_0x7072('0xd')](_0x422052[_0x7072('0xc')],function(_0xa78551){return{'model':db[_0xa78551['model']],'as':_0xa78551['as'],'attributes':_0xa78551[_0x7072('0xa')]};}):[]};}):[]};}):[]:[]})[_0x7072('0x16')](function(_0x3fad4a){logger[_0x7072('0xf')]('ShowCmHopper',_0x2c1df8);logger[_0x7072('0x17')](_0x7072('0x15'),_0x2c1df8,JSON[_0x7072('0x11')](_0x3fad4a));_0x5253a3(_0x3fad4a);})[_0x7072('0x12')](function(_0x50890f){logger[_0x7072('0x14')]('ShowCmHopper',_0x50890f[_0x7072('0x13')],_0x2c1df8);_0x4caa75(_0xde92e6[_0x7072('0x14')](0x1f4,_0x50890f[_0x7072('0x13')]));});});};exports['CreateCmHopper']=function(_0x479941){var _0x155fd6=this;return new Promise(function(_0x25da43,_0xb1765f){return db[_0x7072('0x6')]['create'](_0x479941[_0x7072('0x18')],{'raw':_0x479941[_0x7072('0x7')]?_0x479941['options'][_0x7072('0x8')]===undefined?!![]:![]:!![]})['then'](function(_0x181a68){logger['info'](_0x7072('0x19'),_0x479941);logger[_0x7072('0x17')](_0x7072('0x19'),_0x479941,JSON['stringify'](_0x181a68));_0x25da43(_0x181a68);})[_0x7072('0x12')](function(_0x1c06e3){logger[_0x7072('0x14')](_0x7072('0x19'),_0x1c06e3[_0x7072('0x13')],_0x479941);_0xb1765f(_0x155fd6['error'](0x1f4,_0x1c06e3['message']));});});};exports[_0x7072('0x1a')]=function(_0x3e0120){var _0x42fa43=this;return new Promise(function(_0x9dd707,_0x32b263){return db[_0x7072('0x6')]['update'](_0x3e0120['body'],{'raw':_0x3e0120[_0x7072('0x7')]?_0x3e0120[_0x7072('0x7')][_0x7072('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e0120[_0x7072('0x7')]?_0x3e0120[_0x7072('0x7')][_0x7072('0x9')]||null:null,'attributes':_0x3e0120[_0x7072('0x7')]?_0x3e0120[_0x7072('0x7')]['attributes']||null:null,'limit':_0x3e0120[_0x7072('0x7')]?_0x3e0120[_0x7072('0x7')][_0x7072('0xb')]||null:null})[_0x7072('0x16')](function(_0x3d4c74){logger[_0x7072('0xf')]('UpdateCmHopper',_0x3e0120);logger[_0x7072('0xf')](_0x7072('0x1b'),JSON[_0x7072('0x11')](_0x3e0120[_0x7072('0x7')][_0x7072('0x9')]),_0x3e0120[_0x7072('0x18')][_0x7072('0x1c')]);logger[_0x7072('0x17')](_0x7072('0x1a'),_0x3e0120,JSON['stringify'](_0x3d4c74));_0x9dd707(_0x3d4c74);})['catch'](function(_0xc5c3a1){logger[_0x7072('0x14')](_0x7072('0x1a'),_0xc5c3a1[_0x7072('0x13')],_0x3e0120);_0x32b263(_0x42fa43[_0x7072('0x14')](0x1f4,_0xc5c3a1[_0x7072('0x13')]));});});};exports[_0x7072('0x1d')]=function(_0x570e63){var _0x8fd4c=this;return new Promise(function(_0x5e7df1,_0x19e39e){return db[_0x7072('0x6')][_0x7072('0x1e')]({'where':_0x570e63[_0x7072('0x7')]?_0x570e63[_0x7072('0x7')][_0x7072('0x9')]||null:null})[_0x7072('0x16')](function(_0x291340){logger[_0x7072('0xf')](_0x7072('0x1d'),_0x570e63);logger[_0x7072('0x17')](_0x7072('0x1d'),_0x570e63,JSON['stringify'](_0x291340));_0x5e7df1(_0x291340);})[_0x7072('0x12')](function(_0x15aea6){logger[_0x7072('0x14')](_0x7072('0x1d'),_0x15aea6[_0x7072('0x13')],_0x570e63);_0x19e39e(_0x8fd4c[_0x7072('0x14')](0x1f4,_0x15aea6[_0x7072('0x13')]));});});};exports['GetContactDialer']=function(_0x3ac65e){var _0x4cad3c=this;return new Promise(function(_0x1145d9,_0x6b2778){return db[_0x7072('0x1f')][_0x7072('0x20')]()[_0x7072('0x16')](function(_0x402a4e){return db[_0x7072('0x21')][_0x7072('0x22')](function(_0x3e0ee8){return db[_0x7072('0x6')][_0x7072('0x23')]({'where':_0x3ac65e[_0x7072('0x7')]?_0x3ac65e[_0x7072('0x7')][_0x7072('0x9')]||null:null,'attributes':_0x3ac65e[_0x7072('0x7')]?_0x3ac65e[_0x7072('0x7')][_0x7072('0xa')]||null:null,'limit':_0x3ac65e[_0x7072('0x7')]?_0x3ac65e['options'][_0x7072('0xb')]||null:null,'order':_0x3ac65e['options']?_0x3ac65e['options'][_0x7072('0x24')]||null:null,'transaction':_0x3e0ee8,'lock':_0x3e0ee8['LOCK'][_0x7072('0x25')],'include':[{'model':db[_0x7072('0x1f')],'as':_0x7072('0x26'),'attributes':_[_0x7072('0x27')](_0x402a4e)},{'model':db[_0x7072('0x28')],'as':_0x7072('0x29'),'attributes':['id',_0x7072('0x2a'),_0x7072('0x2b')]}]})['then'](function(_0xdcabe3){var _0x20085e=[];var _0xe71d3a=[];for(var _0x23b744=0x0;_0x23b744<_0xdcabe3[_0x7072('0x2c')];_0x23b744+=0x1){var _0x4a8101=_0xdcabe3[_0x23b744][_0x7072('0x2d')];if(_0x4a8101===null){_0x20085e[_0x7072('0x2e')](_0xdcabe3[_0x23b744][_0x7072('0x2f')](_0x3ac65e['body'],{'transaction':_0x3e0ee8}));}else if(!_0xe71d3a[_0x7072('0x30')](_0x4a8101)){_0xe71d3a[_0x7072('0x2e')](_0x4a8101);_0x20085e[_0x7072('0x2e')](_0xdcabe3[_0x23b744][_0x7072('0x2f')](_0x3ac65e['body'],{'transaction':_0x3e0ee8}));}}return BPromise[_0x7072('0x31')](_0x20085e);});})[_0x7072('0x16')](function(_0x47225a){logger[_0x7072('0xf')]('GetContactDialer',_0x3ac65e);if(_0x47225a[_0x7072('0x2c')]>0x0){logger[_0x7072('0xf')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x47225a[0x0]['dataValues']['id'],_0x47225a[0x0][_0x7072('0x32')][_0x7072('0x33')],_0x47225a[0x0][_0x7072('0x32')]['active']);}logger[_0x7072('0x17')]('GetContactDialer',_0x3ac65e,JSON[_0x7072('0x11')](_0x47225a));_0x1145d9(_0x47225a);})[_0x7072('0x12')](function(_0x282867){logger[_0x7072('0x14')](_0x7072('0x34'),_0x282867['message'],_0x3ac65e);_0x6b2778(_0x4cad3c[_0x7072('0x14')](0x1f4,_0x282867[_0x7072('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x258cb9){var _0xe1c4c4=this;return new Promise(function(_0x5cdb1f,_0x76a630){return db[_0x7072('0x21')][_0x7072('0x22')](function(_0xc4d49){return db['CmHopperFinal'][_0x7072('0x35')](_0x258cb9[_0x7072('0x18')],{'raw':_0x258cb9[_0x7072('0x7')]?_0x258cb9[_0x7072('0x7')][_0x7072('0x8')]===undefined?!![]:![]:!![],'transaction':_0xc4d49})[_0x7072('0x16')](function(){logger[_0x7072('0xf')](_0x7072('0x36'),JSON[_0x7072('0x11')](_0x258cb9[_0x7072('0x7')][_0x7072('0x9')]),_0x258cb9['options'][_0x7072('0x9')]['active']);return db[_0x7072('0x6')][_0x7072('0x1e')]({'where':_0x258cb9['options']?_0x258cb9[_0x7072('0x7')][_0x7072('0x9')]||null:null,'transaction':_0xc4d49});});})[_0x7072('0x16')](function(_0x21893f){logger['info'](_0x7072('0x37'),_0x258cb9);logger[_0x7072('0x17')]('MoveContactManagedDialer',_0x258cb9,JSON[_0x7072('0x11')](_0x21893f));_0x5cdb1f(_0x21893f);})[_0x7072('0x12')](function(_0x5ad3e5){logger[_0x7072('0x14')](_0x7072('0x37'),_0x5ad3e5['message'],_0x258cb9);_0x76a630(_0xe1c4c4[_0x7072('0x14')](0x1f4,_0x5ad3e5[_0x7072('0x13')]));});});};exports[_0x7072('0x38')]=function(_0x30d64f){var _0x103bdd=this;return new Promise(function(_0x58d375,_0x274b49){return db[_0x7072('0x6')][_0x7072('0x23')]({'raw':_0x30d64f[_0x7072('0x7')]?_0x30d64f['options'][_0x7072('0x8')]===undefined?!![]:![]:!![],'where':_0x30d64f[_0x7072('0x7')]?_0x30d64f[_0x7072('0x7')][_0x7072('0x9')]||null:null,'attributes':[[db['sequelize']['fn'](_0x7072('0x39'),db[_0x7072('0x21')]['fn']('IF',db[_0x7072('0x21')][_0x7072('0x3a')](_0x7072('0x3b')+util[_0x7072('0x3c')]('\x22%s\x22',moment()[_0x7072('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x7072('0x3d')))),_0x7072('0x3e')]]})[_0x7072('0x16')](function(_0x4ebb28){logger[_0x7072('0xf')]('CountReScheduled',_0x30d64f);logger['debug']('CountReScheduled',_0x30d64f,JSON[_0x7072('0x11')](_0x4ebb28));_0x58d375(_0x4ebb28);})[_0x7072('0x12')](function(_0x41c801){logger[_0x7072('0x14')]('CountReScheduled',_0x41c801[_0x7072('0x13')],_0x30d64f);_0x274b49(_0x103bdd[_0x7072('0x14')](0x1f4,_0x41c801['message']));});});};exports[_0x7072('0x3f')]=function(_0x7de2c8){var _0x14f842=this;return new Promise(function(_0x2d81ca,_0x3f7299){return db[_0x7072('0x1f')][_0x7072('0x20')]()[_0x7072('0x16')](function(){return db[_0x7072('0x21')][_0x7072('0x22')](function(_0x320fce){return db[_0x7072('0x6')][_0x7072('0x23')]({'where':_0x7de2c8[_0x7072('0x7')]?_0x7de2c8[_0x7072('0x7')]['where']||null:null,'attributes':_0x7de2c8[_0x7072('0x7')]?_0x7de2c8[_0x7072('0x7')][_0x7072('0xa')]||null:null,'limit':0x1,'order':_0x7de2c8[_0x7072('0x7')]?_0x7de2c8[_0x7072('0x7')]['order']||null:null,'group':db[_0x7072('0x6')][_0x7072('0x2d')],'transaction':_0x320fce,'lock':_0x320fce['LOCK'][_0x7072('0x25')],'include':_0x7de2c8['options']?_0x7de2c8[_0x7072('0x7')][_0x7072('0xc')]?_['map'](_0x7de2c8[_0x7072('0x7')][_0x7072('0xc')],function(_0x11c349){return{'model':db[_0x11c349[_0x7072('0xe')]],'as':_0x11c349['as'],'attributes':_0x11c349['attributes'],'include':_0x11c349['include']?_['map'](_0x11c349['include'],function(_0x52f3c9){return{'model':db[_0x52f3c9['model']],'as':_0x52f3c9['as'],'attributes':_0x52f3c9[_0x7072('0xa')],'include':_0x52f3c9[_0x7072('0xc')]?_[_0x7072('0xd')](_0x52f3c9[_0x7072('0xc')],function(_0x4d6d22){return{'model':db[_0x4d6d22[_0x7072('0xe')]],'as':_0x4d6d22['as'],'attributes':_0x4d6d22[_0x7072('0xa')]};}):[]};}):[]};}):[]:[]})[_0x7072('0x16')](function(_0x5d4273){var _0x2d8923=[];for(var _0x4f2f5f=0x0;_0x4f2f5f<_0x5d4273[_0x7072('0x2c')];_0x4f2f5f+=0x1){_0x2d8923['push'](_0x5d4273[_0x4f2f5f][_0x7072('0x2f')](_0x7de2c8[_0x7072('0x18')],{'transaction':_0x320fce}));}return BPromise[_0x7072('0x31')](_0x2d8923);});})[_0x7072('0x16')](function(_0x5aacda){logger['info']('GetContactRecallMe',_0x7de2c8);logger[_0x7072('0x17')](_0x7072('0x3f'),_0x7de2c8,JSON[_0x7072('0x11')](_0x5aacda));_0x2d81ca(_0x5aacda);})[_0x7072('0x12')](function(_0x548e47){logger[_0x7072('0x14')]('GetContactRecallMe',_0x548e47[_0x7072('0x13')],_0x7de2c8);_0x3f7299(_0x14f842[_0x7072('0x14')](0x1f4,_0x548e47[_0x7072('0x13')]));});});});};exports[_0x7072('0x40')]=function(_0x4c42b2){var _0xaf7a0=this;return new Promise(function(_0x4218af,_0x2f0c95){db[_0x7072('0x1f')][_0x7072('0x20')]()[_0x7072('0x16')](function(_0x43b29d){return db[_0x7072('0x6')]['findAll']({'raw':_0x4c42b2[_0x7072('0x7')]?_0x4c42b2[_0x7072('0x7')][_0x7072('0x8')]===undefined?!![]:![]:!![],'where':_0x4c42b2['options']?_0x4c42b2[_0x7072('0x7')][_0x7072('0x9')]||null:null,'attributes':_0x4c42b2['options']?_0x4c42b2[_0x7072('0x7')]['attributes']||null:null,'limit':_0x4c42b2['options']?_0x4c42b2[_0x7072('0x7')][_0x7072('0xb')]||null:null,'include':_0x4c42b2[_0x7072('0x7')]?_0x4c42b2[_0x7072('0x7')][_0x7072('0xc')]?_[_0x7072('0xd')](_0x4c42b2[_0x7072('0x7')][_0x7072('0xc')],function(_0x5922d0){return{'model':db[_0x5922d0['model']],'as':_0x5922d0['as'],'attributes':_0x5922d0['as']==='Contact'?_[_0x7072('0x27')](_0x43b29d):_0x5922d0[_0x7072('0xa')],'include':_0x5922d0[_0x7072('0xc')]?_[_0x7072('0xd')](_0x5922d0[_0x7072('0xc')],function(_0x22e51a){return{'model':db[_0x22e51a['model']],'as':_0x22e51a['as'],'attributes':_0x22e51a[_0x7072('0xa')],'include':_0x22e51a['include']?_[_0x7072('0xd')](_0x22e51a[_0x7072('0xc')],function(_0x40cc60){return{'model':db[_0x40cc60[_0x7072('0xe')]],'as':_0x40cc60['as'],'attributes':_0x40cc60[_0x7072('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5be927){logger[_0x7072('0xf')](_0x7072('0x10'),_0x4c42b2);logger[_0x7072('0x17')](_0x7072('0x10'),_0x4c42b2,JSON[_0x7072('0x11')](_0x5be927));_0x4218af(_0x5be927);})[_0x7072('0x12')](function(_0x3cabfe){logger[_0x7072('0x14')](_0x7072('0x10'),_0x3cabfe[_0x7072('0x13')],_0x4c42b2);_0x2f0c95(_0xaf7a0['error'](0x1f4,_0x3cabfe[_0x7072('0x13')]));});});});};exports[_0x7072('0x41')]=function(_0xf4f151){var _0x3baf69=this;return new Promise(function(_0x4ae4e5,_0x559ce2){return db['CmContact']['findOne']({'raw':!![],'where':{'phone':_0xf4f151[_0x7072('0x7')][_0x7072('0x9')][_0x7072('0x42')]},'attributes':['id',_0x7072('0x43')],'order':[['id',_0x7072('0x44')]]})['then'](function(_0x5a8fb6){logger[_0x7072('0xf')](_0x7072('0x45'),_0xf4f151);logger[_0x7072('0x17')](_0x7072('0x45'),_0xf4f151,JSON[_0x7072('0x11')](_0x5a8fb6));_0x4ae4e5(_0x5a8fb6);})[_0x7072('0x12')](function(_0x59d9f2){logger[_0x7072('0x14')](_0x7072('0x45'),_0x59d9f2[_0x7072('0x13')],_0xf4f151);_0x559ce2(_0x3baf69[_0x7072('0x14')](0x1f4,_0x59d9f2[_0x7072('0x13')]));});});};exports[_0x7072('0x46')]=function(_0x3044eb){var _0x206068=this;return new Promise(function(_0x5bc4e9,_0x4c98aa){return db[_0x7072('0x21')][_0x7072('0x22')](function(_0x3e353e){var _0x5a1ae7=_0x3044eb[_0x7072('0x7')]&&_0x3044eb[_0x7072('0x7')][_0x7072('0x9')]?_0x3044eb[_0x7072('0x7')]['where']:{};return db[_0x7072('0x6')][_0x7072('0x2f')](_0x3044eb[_0x7072('0x18')],{'where':_0x5a1ae7,'transaction':_0x3e353e})[_0x7072('0x16')](function(_0x2f29f6){logger[_0x7072('0xf')](_0x7072('0x46'),_0x3044eb);logger[_0x7072('0x17')](_0x7072('0x46'),_0x3044eb,JSON['stringify'](_0x2f29f6));_0x5bc4e9(_0x2f29f6);})['catch'](function(_0xc8c016){logger[_0x7072('0x14')](_0x7072('0x46'),_0xc8c016['message'],_0x3044eb);_0x4c98aa(_0x206068[_0x7072('0x14')](0x1f4,_0xc8c016[_0x7072('0x13')]));});});});};exports[_0x7072('0x47')]=function(_0x35f9fd){var _0x12b868=this;var _0x575d76=_0x35f9fd[_0x7072('0x18')]['where'][_0x7072('0x48')];var _0xb83bf6=_0x35f9fd[_0x7072('0x18')][_0x7072('0x9')]['interval'];var _0x3d15f9=_0x35f9fd['body'][_0x7072('0x9')][_0x7072('0x49')];return new Promise(function(_0x2f3a27,_0x426b4b){return db[_0x7072('0x6')][_0x7072('0x23')]({'where':{'voiceQueueId':{'$in':_0x575d76},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7072('0x21')][_0x7072('0x3a')](_0x7072('0x4a')+_0xb83bf6+_0x7072('0x4b')),'$gt':db[_0x7072('0x21')][_0x7072('0x3a')](_0x7072('0x4c'))}},'UserId':{'$in':_0x3d15f9}},'include':[{'model':db[_0x7072('0x1f')],'as':'Contact'},{'model':db[_0x7072('0x28')],'as':_0x7072('0x29'),'attributes':['id',_0x7072('0x2a'),'voicePause']},{'model':db[_0x7072('0x4d')],'as':_0x7072('0x4e')}]})['then'](function(_0x283d86){if(_0x283d86[_0x7072('0x2c')]>0x0){return db[_0x7072('0x21')][_0x7072('0x22')](function(_0x4b84d9){return db[_0x7072('0x6')][_0x7072('0x2f')]({'recallmeNotifiedDate':db[_0x7072('0x21')][_0x7072('0x3a')](_0x7072('0x4c'))},{'where':{'id':{'$in':_[_0x7072('0xd')](_0x283d86,'id')}},'transaction':_0x4b84d9})[_0x7072('0x16')](function(){_0x2f3a27(_0x283d86);})[_0x7072('0x12')](function(_0x5388fc){logger[_0x7072('0x14')](_0x7072('0x47'),_0x5388fc[_0x7072('0x13')],_0x35f9fd);_0x426b4b(_0x12b868[_0x7072('0x14')](0x1f4,_0x5388fc[_0x7072('0x13')]));});})['catch'](function(_0x4d9f2a){logger['error'](_0x7072('0x47'),_0x4d9f2a[_0x7072('0x13')],_0x35f9fd);_0x426b4b(_0x12b868[_0x7072('0x14')](0x1f4,_0x4d9f2a['message']));});}else{_0x2f3a27(_0x283d86);}});});}; \ No newline at end of file +var _0xf4d6=['Agent','name','voicePause','length','UserId','push','update','includes','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','literal','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','LOCK','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Contact','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','info','debug','stringify','error','message','find','ShowCmHopper','catch','create','CreateCmHopper','UpdateCmHopper','body','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','describe','sequelize','UPDATE','CmContact'];(function(_0x343b56,_0x27ebbf){var _0x4bdc57=function(_0x46cccd){while(--_0x46cccd){_0x343b56['push'](_0x343b56['shift']());}};_0x4bdc57(++_0x27ebbf);}(_0xf4d6,0xc6));var _0x6f4d=function(_0x589864,_0x28fb68){_0x589864=_0x589864-0x0;var _0x1a1448=_0xf4d6[_0x589864];return _0x1a1448;};'use strict';var _=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var moment=require(_0x6f4d('0x2'));var BPromise=require(_0x6f4d('0x3'));var db=require(_0x6f4d('0x4'))['db'];var logger=require(_0x6f4d('0x5'))(_0x6f4d('0x6'));exports[_0x6f4d('0x7')]=function(_0x362f2d){var _0x465e7c=this;return new Promise(function(_0x2e05e0,_0x5dc513){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'raw':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d['options'][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x362f2d['options']?_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xd')]||null:null,'limit':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d[_0x6f4d('0xa')]['limit']||null:null,'include':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xe')],function(_0x525724){return{'model':db[_0x525724[_0x6f4d('0x10')]],'as':_0x525724['as'],'attributes':_0x525724[_0x6f4d('0xd')],'include':_0x525724[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x525724[_0x6f4d('0xe')],function(_0x2734af){return{'model':db[_0x2734af[_0x6f4d('0x10')]],'as':_0x2734af['as'],'attributes':_0x2734af[_0x6f4d('0xd')],'include':_0x2734af[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x2734af['include'],function(_0x430e32){return{'model':db[_0x430e32[_0x6f4d('0x10')]],'as':_0x430e32['as'],'attributes':_0x430e32[_0x6f4d('0xd')]};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x11')](function(_0x595334){logger[_0x6f4d('0x12')]('GetCmHopper',_0x362f2d);logger[_0x6f4d('0x13')]('GetCmHopper',_0x362f2d,JSON[_0x6f4d('0x14')](_0x595334));_0x2e05e0(_0x595334);})['catch'](function(_0x6b63f8){logger[_0x6f4d('0x15')](_0x6f4d('0x7'),_0x6b63f8['message'],_0x362f2d);_0x5dc513(_0x465e7c[_0x6f4d('0x15')](0x1f4,_0x6b63f8[_0x6f4d('0x16')]));});});};exports['ShowCmHopper']=function(_0x4df258){var _0x128df0=this;return new Promise(function(_0x232ede,_0x3285cd){return db[_0x6f4d('0x8')][_0x6f4d('0x17')]({'raw':_0x4df258[_0x6f4d('0xa')]?_0x4df258[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x4df258[_0x6f4d('0xa')]?_0x4df258['options']['where']||null:null,'attributes':_0x4df258['options']?_0x4df258[_0x6f4d('0xa')]['attributes']||null:null,'include':_0x4df258['options']?_0x4df258[_0x6f4d('0xa')][_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x4df258['options'][_0x6f4d('0xe')],function(_0x497af5){return{'model':db[_0x497af5[_0x6f4d('0x10')]],'as':_0x497af5['as'],'attributes':_0x497af5[_0x6f4d('0xd')],'include':_0x497af5[_0x6f4d('0xe')]?_['map'](_0x497af5['include'],function(_0x24157a){return{'model':db[_0x24157a[_0x6f4d('0x10')]],'as':_0x24157a['as'],'attributes':_0x24157a[_0x6f4d('0xd')],'include':_0x24157a[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x24157a[_0x6f4d('0xe')],function(_0x27d103){return{'model':db[_0x27d103['model']],'as':_0x27d103['as'],'attributes':_0x27d103['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x11')](function(_0xb3015b){logger['info'](_0x6f4d('0x18'),_0x4df258);logger[_0x6f4d('0x13')](_0x6f4d('0x18'),_0x4df258,JSON[_0x6f4d('0x14')](_0xb3015b));_0x232ede(_0xb3015b);})[_0x6f4d('0x19')](function(_0x523c3c){logger[_0x6f4d('0x15')](_0x6f4d('0x18'),_0x523c3c[_0x6f4d('0x16')],_0x4df258);_0x3285cd(_0x128df0[_0x6f4d('0x15')](0x1f4,_0x523c3c[_0x6f4d('0x16')]));});});};exports['CreateCmHopper']=function(_0x13ca12){var _0x24ff5d=this;return new Promise(function(_0x50168a,_0x96d437){return db[_0x6f4d('0x8')][_0x6f4d('0x1a')](_0x13ca12['body'],{'raw':_0x13ca12[_0x6f4d('0xa')]?_0x13ca12[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![]})[_0x6f4d('0x11')](function(_0x3abd0b){logger[_0x6f4d('0x12')](_0x6f4d('0x1b'),_0x13ca12);logger['debug'](_0x6f4d('0x1b'),_0x13ca12,JSON[_0x6f4d('0x14')](_0x3abd0b));_0x50168a(_0x3abd0b);})[_0x6f4d('0x19')](function(_0x4ed8f2){logger[_0x6f4d('0x15')](_0x6f4d('0x1b'),_0x4ed8f2[_0x6f4d('0x16')],_0x13ca12);_0x96d437(_0x24ff5d[_0x6f4d('0x15')](0x1f4,_0x4ed8f2[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x1c')]=function(_0x5e4a3f){var _0x22d690=this;return new Promise(function(_0x54dc92,_0x3c9759){return db['CmHopper']['update'](_0x5e4a3f[_0x6f4d('0x1d')],{'raw':_0x5e4a3f[_0x6f4d('0xa')]?_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e4a3f['options']?_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x5e4a3f[_0x6f4d('0xa')]?_0x5e4a3f[_0x6f4d('0xa')]['attributes']||null:null,'limit':_0x5e4a3f[_0x6f4d('0xa')]?_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0x1e')]||null:null})[_0x6f4d('0x11')](function(_0x3aa59a){logger[_0x6f4d('0x12')]('UpdateCmHopper',_0x5e4a3f);logger['info'](_0x6f4d('0x1f'),JSON[_0x6f4d('0x14')](_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0xc')]),_0x5e4a3f[_0x6f4d('0x1d')][_0x6f4d('0x20')]);logger[_0x6f4d('0x13')]('UpdateCmHopper',_0x5e4a3f,JSON[_0x6f4d('0x14')](_0x3aa59a));_0x54dc92(_0x3aa59a);})['catch'](function(_0x26c7d4){logger[_0x6f4d('0x15')]('UpdateCmHopper',_0x26c7d4[_0x6f4d('0x16')],_0x5e4a3f);_0x3c9759(_0x22d690[_0x6f4d('0x15')](0x1f4,_0x26c7d4[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x21')]=function(_0x584d98){var _0x9758ad=this;return new Promise(function(_0x37783f,_0x5a87df){return db[_0x6f4d('0x8')]['destroy']({'where':_0x584d98[_0x6f4d('0xa')]?_0x584d98[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null})[_0x6f4d('0x11')](function(_0x30c058){logger[_0x6f4d('0x12')](_0x6f4d('0x21'),_0x584d98);logger[_0x6f4d('0x13')]('DestroyCmHopper',_0x584d98,JSON['stringify'](_0x30c058));_0x37783f(_0x30c058);})[_0x6f4d('0x19')](function(_0x50bc24){logger['error'](_0x6f4d('0x21'),_0x50bc24[_0x6f4d('0x16')],_0x584d98);_0x5a87df(_0x9758ad[_0x6f4d('0x15')](0x1f4,_0x50bc24[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x22')]=function(_0x2bd41d){var _0x2ca438=this;return new Promise(function(_0x3f404c,_0x1c12ef){return db['CmContact'][_0x6f4d('0x23')]()[_0x6f4d('0x11')](function(_0x4a678b){return db[_0x6f4d('0x24')]['transaction'](function(_0x501e3c){return db[_0x6f4d('0x8')]['findAll']({'where':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d[_0x6f4d('0xa')][_0x6f4d('0xd')]||null:null,'limit':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d['options'][_0x6f4d('0x1e')]||null:null,'order':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d[_0x6f4d('0xa')]['order']||null:null,'transaction':_0x501e3c,'lock':_0x501e3c['LOCK'][_0x6f4d('0x25')],'include':[{'model':db[_0x6f4d('0x26')],'as':'Contact','attributes':_['keys'](_0x4a678b)},{'model':db['User'],'as':_0x6f4d('0x27'),'attributes':['id',_0x6f4d('0x28'),_0x6f4d('0x29')]}]})[_0x6f4d('0x11')](function(_0x21099b){var _0x3e7d80=[];var _0x3c3709=[];for(var _0x19a686=0x0;_0x19a686<_0x21099b[_0x6f4d('0x2a')];_0x19a686+=0x1){var _0x3d27c3=_0x21099b[_0x19a686][_0x6f4d('0x2b')];if(_0x3d27c3===null){_0x3e7d80[_0x6f4d('0x2c')](_0x21099b[_0x19a686][_0x6f4d('0x2d')](_0x2bd41d[_0x6f4d('0x1d')],{'transaction':_0x501e3c}));}else if(!_0x3c3709[_0x6f4d('0x2e')](_0x3d27c3)){_0x3c3709[_0x6f4d('0x2c')](_0x3d27c3);_0x3e7d80[_0x6f4d('0x2c')](_0x21099b[_0x19a686]['update'](_0x2bd41d[_0x6f4d('0x1d')],{'transaction':_0x501e3c}));}}return BPromise['all'](_0x3e7d80);});})[_0x6f4d('0x11')](function(_0x37aee0){logger['info']('GetContactDialer',_0x2bd41d);if(_0x37aee0[_0x6f4d('0x2a')]>0x0){logger[_0x6f4d('0x12')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x37aee0[0x0]['dataValues']['id'],_0x37aee0[0x0][_0x6f4d('0x2f')][_0x6f4d('0x30')],_0x37aee0[0x0][_0x6f4d('0x2f')]['active']);}logger[_0x6f4d('0x13')](_0x6f4d('0x22'),_0x2bd41d,JSON[_0x6f4d('0x14')](_0x37aee0));_0x3f404c(_0x37aee0);})[_0x6f4d('0x19')](function(_0x31f287){logger[_0x6f4d('0x15')](_0x6f4d('0x22'),_0x31f287[_0x6f4d('0x16')],_0x2bd41d);_0x1c12ef(_0x2ca438[_0x6f4d('0x15')](0x1f4,_0x31f287[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x31')]=function(_0x1d8a17){var _0x56ee19=this;return new Promise(function(_0x266765,_0x4b2998){return db[_0x6f4d('0x24')][_0x6f4d('0x32')](function(_0x19208f){return db[_0x6f4d('0x33')]['create'](_0x1d8a17['body'],{'raw':_0x1d8a17['options']?_0x1d8a17['options'][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'transaction':_0x19208f})[_0x6f4d('0x11')](function(){logger[_0x6f4d('0x12')](_0x6f4d('0x34'),JSON[_0x6f4d('0x14')](_0x1d8a17['options'][_0x6f4d('0xc')]),_0x1d8a17[_0x6f4d('0xa')][_0x6f4d('0xc')][_0x6f4d('0x20')]);return db[_0x6f4d('0x8')][_0x6f4d('0x35')]({'where':_0x1d8a17[_0x6f4d('0xa')]?_0x1d8a17[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'transaction':_0x19208f});});})[_0x6f4d('0x11')](function(_0x4d1060){logger[_0x6f4d('0x12')](_0x6f4d('0x31'),_0x1d8a17);logger[_0x6f4d('0x13')](_0x6f4d('0x31'),_0x1d8a17,JSON[_0x6f4d('0x14')](_0x4d1060));_0x266765(_0x4d1060);})[_0x6f4d('0x19')](function(_0x59ca15){logger['error'](_0x6f4d('0x31'),_0x59ca15[_0x6f4d('0x16')],_0x1d8a17);_0x4b2998(_0x56ee19[_0x6f4d('0x15')](0x1f4,_0x59ca15['message']));});});};exports[_0x6f4d('0x36')]=function(_0x44f597){var _0x2b78f1=this;return new Promise(function(_0x3fec94,_0xa4d739){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'raw':_0x44f597[_0x6f4d('0xa')]?_0x44f597[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x44f597[_0x6f4d('0xa')]?_0x44f597[_0x6f4d('0xa')]['where']||null:null,'attributes':[[db[_0x6f4d('0x24')]['fn']('COUNT',db[_0x6f4d('0x24')]['fn']('IF',db[_0x6f4d('0x24')][_0x6f4d('0x37')]('`scheduledat`\x20>=\x20'+util['format'](_0x6f4d('0x38'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x6f4d('0x39')))),_0x6f4d('0x3a')]]})[_0x6f4d('0x11')](function(_0x9f0e24){logger[_0x6f4d('0x12')](_0x6f4d('0x36'),_0x44f597);logger[_0x6f4d('0x13')](_0x6f4d('0x36'),_0x44f597,JSON[_0x6f4d('0x14')](_0x9f0e24));_0x3fec94(_0x9f0e24);})['catch'](function(_0x8ee292){logger['error'](_0x6f4d('0x36'),_0x8ee292[_0x6f4d('0x16')],_0x44f597);_0xa4d739(_0x2b78f1['error'](0x1f4,_0x8ee292[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x3b')]=function(_0x23b9c4){var _0x460c37=this;return new Promise(function(_0x28e766,_0x1e09a8){return db[_0x6f4d('0x26')][_0x6f4d('0x23')]()[_0x6f4d('0x11')](function(){return db[_0x6f4d('0x24')]['transaction'](function(_0x39c919){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'where':_0x23b9c4['options']?_0x23b9c4['options']['where']||null:null,'attributes':_0x23b9c4['options']?_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0xd')]||null:null,'limit':0x1,'order':_0x23b9c4[_0x6f4d('0xa')]?_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0x3c')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x39c919,'lock':_0x39c919[_0x6f4d('0x3d')][_0x6f4d('0x25')],'include':_0x23b9c4[_0x6f4d('0xa')]?_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0xe')]?_['map'](_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0xe')],function(_0x37b01){return{'model':db[_0x37b01[_0x6f4d('0x10')]],'as':_0x37b01['as'],'attributes':_0x37b01[_0x6f4d('0xd')],'include':_0x37b01[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x37b01['include'],function(_0x2c23b6){return{'model':db[_0x2c23b6[_0x6f4d('0x10')]],'as':_0x2c23b6['as'],'attributes':_0x2c23b6['attributes'],'include':_0x2c23b6[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x2c23b6[_0x6f4d('0xe')],function(_0x4d72db){return{'model':db[_0x4d72db['model']],'as':_0x4d72db['as'],'attributes':_0x4d72db[_0x6f4d('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5632d5){var _0x2bcf46=[];for(var _0x551430=0x0;_0x551430<_0x5632d5[_0x6f4d('0x2a')];_0x551430+=0x1){_0x2bcf46[_0x6f4d('0x2c')](_0x5632d5[_0x551430]['update'](_0x23b9c4[_0x6f4d('0x1d')],{'transaction':_0x39c919}));}return BPromise['all'](_0x2bcf46);});})[_0x6f4d('0x11')](function(_0xf256d3){logger[_0x6f4d('0x12')](_0x6f4d('0x3b'),_0x23b9c4);logger[_0x6f4d('0x13')](_0x6f4d('0x3b'),_0x23b9c4,JSON[_0x6f4d('0x14')](_0xf256d3));_0x28e766(_0xf256d3);})['catch'](function(_0x2dbdcf){logger[_0x6f4d('0x15')](_0x6f4d('0x3b'),_0x2dbdcf['message'],_0x23b9c4);_0x1e09a8(_0x460c37[_0x6f4d('0x15')](0x1f4,_0x2dbdcf[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x3e')]=function(_0x3e1376){var _0x49f19e=this;return new Promise(function(_0x48c3ae,_0x2b04ef){db[_0x6f4d('0x26')][_0x6f4d('0x23')]()[_0x6f4d('0x11')](function(_0x330500){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'raw':_0x3e1376[_0x6f4d('0xa')]?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x3e1376['options']?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x3e1376[_0x6f4d('0xa')]?_0x3e1376['options'][_0x6f4d('0xd')]||null:null,'limit':_0x3e1376[_0x6f4d('0xa')]?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0x1e')]||null:null,'include':_0x3e1376['options']?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xe')],function(_0x21ab8c){return{'model':db[_0x21ab8c[_0x6f4d('0x10')]],'as':_0x21ab8c['as'],'attributes':_0x21ab8c['as']==='Contact'?_[_0x6f4d('0x3f')](_0x330500):_0x21ab8c['attributes'],'include':_0x21ab8c[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x21ab8c[_0x6f4d('0xe')],function(_0x263dfa){return{'model':db[_0x263dfa[_0x6f4d('0x10')]],'as':_0x263dfa['as'],'attributes':_0x263dfa[_0x6f4d('0xd')],'include':_0x263dfa[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x263dfa['include'],function(_0x23dac0){return{'model':db[_0x23dac0['model']],'as':_0x23dac0['as'],'attributes':_0x23dac0[_0x6f4d('0xd')]};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x11')](function(_0x3fc587){logger[_0x6f4d('0x12')]('GetCmHopper',_0x3e1376);logger[_0x6f4d('0x13')](_0x6f4d('0x7'),_0x3e1376,JSON[_0x6f4d('0x14')](_0x3fc587));_0x48c3ae(_0x3fc587);})[_0x6f4d('0x19')](function(_0x2fa361){logger['error']('GetCmHopper',_0x2fa361[_0x6f4d('0x16')],_0x3e1376);_0x2b04ef(_0x49f19e[_0x6f4d('0x15')](0x1f4,_0x2fa361[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x40')]=function(_0x22105f){var _0x4a3447=this;return new Promise(function(_0x18ca91,_0x104b66){return db[_0x6f4d('0x26')][_0x6f4d('0x41')]({'raw':!![],'where':{'phone':_0x22105f[_0x6f4d('0xa')]['where']['phone']},'attributes':['id',_0x6f4d('0x42')],'order':[['id',_0x6f4d('0x43')]]})[_0x6f4d('0x11')](function(_0x56ef2e){logger[_0x6f4d('0x12')](_0x6f4d('0x44'),_0x22105f);logger[_0x6f4d('0x13')](_0x6f4d('0x44'),_0x22105f,JSON[_0x6f4d('0x14')](_0x56ef2e));_0x18ca91(_0x56ef2e);})[_0x6f4d('0x19')](function(_0x2ed89c){logger[_0x6f4d('0x15')](_0x6f4d('0x44'),_0x2ed89c['message'],_0x22105f);_0x104b66(_0x4a3447[_0x6f4d('0x15')](0x1f4,_0x2ed89c[_0x6f4d('0x16')]));});});};exports['ResetActiveCalls']=function(_0x4f620c){var _0x1c3845=this;return new Promise(function(_0x195569,_0x413e1e){return db[_0x6f4d('0x24')][_0x6f4d('0x32')](function(_0x273b10){var _0x24d801=_0x4f620c[_0x6f4d('0xa')]&&_0x4f620c[_0x6f4d('0xa')][_0x6f4d('0xc')]?_0x4f620c[_0x6f4d('0xa')]['where']:{};return db[_0x6f4d('0x8')][_0x6f4d('0x2d')](_0x4f620c['body'],{'where':_0x24d801,'transaction':_0x273b10})['then'](function(_0x24eb46){logger['info'](_0x6f4d('0x45'),_0x4f620c);logger[_0x6f4d('0x13')]('ResetActiveCalls',_0x4f620c,JSON[_0x6f4d('0x14')](_0x24eb46));_0x195569(_0x24eb46);})[_0x6f4d('0x19')](function(_0x187681){logger[_0x6f4d('0x15')](_0x6f4d('0x45'),_0x187681[_0x6f4d('0x16')],_0x4f620c);_0x413e1e(_0x1c3845[_0x6f4d('0x15')](0x1f4,_0x187681[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x46')]=function(_0x10db7c){var _0x4fe6c0=this;var _0x5872b9=_0x10db7c[_0x6f4d('0x1d')][_0x6f4d('0xc')]['voiceQueueIds'];var _0x5441d8=_0x10db7c[_0x6f4d('0x1d')][_0x6f4d('0xc')][_0x6f4d('0x47')];var _0x5ef9b7=_0x10db7c[_0x6f4d('0x1d')][_0x6f4d('0xc')][_0x6f4d('0x48')];return new Promise(function(_0x11bbe1,_0x59c7b1){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'where':{'voiceQueueId':{'$in':_0x5872b9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x6f4d('0x37')](_0x6f4d('0x49')+_0x5441d8+_0x6f4d('0x4a')),'$gt':db['sequelize'][_0x6f4d('0x37')](_0x6f4d('0x4b'))}},'UserId':{'$in':_0x5ef9b7}},'include':[{'model':db['CmContact'],'as':_0x6f4d('0x4c')},{'model':db['User'],'as':_0x6f4d('0x27'),'attributes':['id','name',_0x6f4d('0x29')]},{'model':db[_0x6f4d('0x4d')],'as':_0x6f4d('0x4e')}]})['then'](function(_0x330be6){if(_0x330be6['length']>0x0){return db[_0x6f4d('0x24')][_0x6f4d('0x32')](function(_0x338859){return db[_0x6f4d('0x8')][_0x6f4d('0x2d')]({'recallmeNotifiedDate':db[_0x6f4d('0x24')][_0x6f4d('0x37')](_0x6f4d('0x4b'))},{'where':{'id':{'$in':_[_0x6f4d('0xf')](_0x330be6,'id')}},'transaction':_0x338859})[_0x6f4d('0x11')](function(){_0x11bbe1(_0x330be6);})['catch'](function(_0x3b1d99){logger['error'](_0x6f4d('0x46'),_0x3b1d99['message'],_0x10db7c);_0x59c7b1(_0x4fe6c0[_0x6f4d('0x15')](0x1f4,_0x3b1d99[_0x6f4d('0x16')]));});})[_0x6f4d('0x19')](function(_0x2f3f4e){logger[_0x6f4d('0x15')]('CmHopperHandlePreviewRecallNotifications',_0x2f3f4e[_0x6f4d('0x16')],_0x10db7c);_0x59c7b1(_0x4fe6c0[_0x6f4d('0x15')](0x1f4,_0x2f3f4e[_0x6f4d('0x16')]));});}else{_0x11bbe1(_0x330be6);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 9f6fea5..2a5f651 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe479=['destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','update','delete','/:id'];(function(_0x14a2e4,_0x9133cd){var _0x41e761=function(_0x549347){while(--_0x549347){_0x14a2e4['push'](_0x14a2e4['shift']());}};_0x41e761(++_0x9133cd);}(_0xe479,0xda));var _0x9e47=function(_0x223fee,_0x558b1f){_0x223fee=_0x223fee-0x0;var _0x5eb032=_0xe479[_0x223fee];return _0x5eb032;};'use strict';var express=require(_0x9e47('0x0'));var router=express[_0x9e47('0x1')]();var auth=require(_0x9e47('0x2'));var controller=require(_0x9e47('0x3'));router[_0x9e47('0x4')]('/',auth[_0x9e47('0x5')](),controller['index']);router[_0x9e47('0x4')]('/describe',auth[_0x9e47('0x5')](),controller[_0x9e47('0x6')]);router[_0x9e47('0x4')](_0x9e47('0x7'),auth[_0x9e47('0x5')](),controller[_0x9e47('0x8')]);router[_0x9e47('0x4')](_0x9e47('0x9'),auth[_0x9e47('0x5')](),controller[_0x9e47('0xa')]);router[_0x9e47('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x9e47('0xb')]);router[_0x9e47('0x4')](_0x9e47('0xc'),auth[_0x9e47('0x5')](),controller[_0x9e47('0xd')]);router[_0x9e47('0xe')]('/',auth[_0x9e47('0x5')](),controller[_0x9e47('0xf')]);router[_0x9e47('0xe')]('/preview',auth['isAuthenticated'](),controller[_0x9e47('0x10')]);router[_0x9e47('0xe')](_0x9e47('0x11'),auth['isAuthenticated'](),controller[_0x9e47('0x12')]);router['put']('/:id',auth[_0x9e47('0x5')](),controller[_0x9e47('0x13')]);router[_0x9e47('0x14')](_0x9e47('0x15'),auth[_0x9e47('0x5')](),controller[_0x9e47('0x16')]);module[_0x9e47('0x17')]=router; \ No newline at end of file +var _0x5f33=['./cmHopper.controller','get','isAuthenticated','describe','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','update','delete','destroy','exports','express'];(function(_0x46647b,_0x4e8678){var _0x2bef5d=function(_0x336266){while(--_0x336266){_0x46647b['push'](_0x46647b['shift']());}};_0x2bef5d(++_0x4e8678);}(_0x5f33,0x18f));var _0x35f3=function(_0x548af0,_0x2f9fd8){_0x548af0=_0x548af0-0x0;var _0x595aeb=_0x5f33[_0x548af0];return _0x595aeb;};'use strict';var express=require(_0x35f3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x35f3('0x1'));router[_0x35f3('0x2')]('/',auth[_0x35f3('0x3')](),controller['index']);router[_0x35f3('0x2')]('/describe',auth[_0x35f3('0x3')](),controller[_0x35f3('0x4')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x35f3('0x2')](_0x35f3('0x5'),auth[_0x35f3('0x3')](),controller['getTimezones']);router['get'](_0x35f3('0x6'),auth['isAuthenticated'](),controller[_0x35f3('0x7')]);router['get'](_0x35f3('0x8'),auth['isAuthenticated'](),controller[_0x35f3('0x9')]);router[_0x35f3('0xa')]('/',auth[_0x35f3('0x3')](),controller[_0x35f3('0xb')]);router[_0x35f3('0xa')](_0x35f3('0xc'),auth[_0x35f3('0x3')](),controller[_0x35f3('0xd')]);router[_0x35f3('0xa')]('/timezone',auth['isAuthenticated'](),controller[_0x35f3('0xe')]);router[_0x35f3('0xf')](_0x35f3('0x6'),auth[_0x35f3('0x3')](),controller[_0x35f3('0x10')]);router[_0x35f3('0x11')](_0x35f3('0x6'),auth[_0x35f3('0x3')](),controller[_0x35f3('0x12')]);module[_0x35f3('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 0cba5e9..7ec6e06 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd277=['sequelize','exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0xd277,0xbc));var _0x7d27=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd277[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7d27('0x0'));var Sequelize=require(_0x7d27('0x1'));module[_0x7d27('0x2')]={'CmHopperId':{'type':Sequelize[_0x7d27('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x7d27('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x7d27('0x4')],'defaultValue':moment()[_0x7d27('0x5')](_0x7d27('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7d27('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7d27('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x7d27('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7d27('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7d27('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x87a0=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','format'];(function(_0x1c5152,_0x252e48){var _0x171edd=function(_0x255ce6){while(--_0x255ce6){_0x1c5152['push'](_0x1c5152['shift']());}};_0x171edd(++_0x252e48);}(_0x87a0,0x122));var _0x087a=function(_0x16abe4,_0x55558f){_0x16abe4=_0x16abe4-0x0;var _0x55e2e3=_0x87a0[_0x16abe4];return _0x55e2e3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x087a('0x0')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x087a('0x1')](_0x087a('0x2'))},'countbusyretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 0177d51..099ad35 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x573e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x30319c,_0x322bf7){var _0x175099=function(_0x1af694){while(--_0x1af694){_0x30319c['push'](_0x30319c['shift']());}};_0x175099(++_0x322bf7);}(_0x573e,0x1e9));var _0xe573=function(_0x14ec37,_0x11118c){_0x14ec37=_0x14ec37-0x0;var _0x10bf3b=_0x573e[_0x14ec37];return _0x10bf3b;};'use strict';var emlformat=require(_0xe573('0x0'));var rimraf=require(_0xe573('0x1'));var zipdir=require(_0xe573('0x2'));var jsonpatch=require(_0xe573('0x3'));var rp=require(_0xe573('0x4'));var moment=require(_0xe573('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe573('0x6'));var util=require('util');var path=require(_0xe573('0x7'));var sox=require('sox');var csv=require(_0xe573('0x8'));var ejs=require(_0xe573('0x9'));var fs=require('fs');var fs_extra=require(_0xe573('0xa'));var _=require('lodash');var squel=require(_0xe573('0xb'));var crypto=require(_0xe573('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe573('0xd'));var toCsv=require(_0xe573('0x8'));var querystring=require(_0xe573('0xe'));var Papa=require(_0xe573('0xf'));var Redis=require(_0xe573('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe573('0x11'));var as=require(_0xe573('0x12'));var hardwareService=require(_0xe573('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe573('0x14'));var config=require(_0xe573('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe573('0x16'))['db'];function respondWithStatusCode(_0x31a1d2,_0x5ea37c){_0x5ea37c=_0x5ea37c||0xcc;return function(_0x3291f9){if(_0x3291f9){return _0x31a1d2[_0xe573('0x17')](_0x5ea37c);}return _0x31a1d2[_0xe573('0x18')](_0x5ea37c)[_0xe573('0x19')]();};}function respondWithResult(_0x20dd23,_0x5547ff){_0x5547ff=_0x5547ff||0xc8;return function(_0x4eb606){if(_0x4eb606){return _0x20dd23[_0xe573('0x18')](_0x5547ff)[_0xe573('0x1a')](_0x4eb606);}};}function respondWithFilteredResult(_0x1581b8,_0x276920){return function(_0x4cd32b){if(_0x4cd32b){var _0x34268d=typeof _0x276920[_0xe573('0x1b')]===_0xe573('0x1c')&&typeof _0x276920[_0xe573('0x1d')]===_0xe573('0x1c');var _0x1d30f0=_0x4cd32b[_0xe573('0x1e')];var _0x3986b9=_0x34268d?0x0:_0x276920[_0xe573('0x1b')];var _0x124f72=_0x34268d?_0x4cd32b[_0xe573('0x1e')]:_0x276920[_0xe573('0x1b')]+_0x276920[_0xe573('0x1d')];var _0x20f8d8;if(_0x124f72>=_0x1d30f0){_0x124f72=_0x1d30f0;_0x20f8d8=0xc8;}else{_0x20f8d8=0xce;}_0x1581b8[_0xe573('0x18')](_0x20f8d8);return _0x1581b8[_0xe573('0x1f')](_0xe573('0x20'),_0x3986b9+'-'+_0x124f72+'/'+_0x1d30f0)[_0xe573('0x1a')](_0x4cd32b);}return null;};}function patchUpdates(_0x43b012){return function(_0x33a302){try{jsonpatch[_0xe573('0x21')](_0x33a302,_0x43b012,!![]);}catch(_0x1411f1){return BPromise[_0xe573('0x22')](_0x1411f1);}return _0x33a302[_0xe573('0x23')]();};}function saveUpdates(_0x25c233,_0x3e4e1b){return function(_0x4ba1ba){if(_0x4ba1ba){return _0x4ba1ba['update'](_0x25c233)[_0xe573('0x24')](function(_0x358670){return _0x358670;});}return null;};}function removeEntity(_0x20cb77,_0x385aa3){return function(_0xbc3add){if(_0xbc3add){return _0xbc3add[_0xe573('0x25')]()[_0xe573('0x24')](function(){var _0x3573c2=_0xbc3add[_0xe573('0x26')]({'plain':!![]});var _0x9d3dd9=_0xe573('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x9d3dd9,'resourceId':_0x3573c2['id']}})[_0xe573('0x24')](function(){return _0xbc3add;});})[_0xe573('0x24')](function(){_0x20cb77[_0xe573('0x18')](0xcc)[_0xe573('0x19')]();});}};}function handleEntityNotFound(_0x3914ac,_0x47abb7){return function(_0x96ad0f){if(!_0x96ad0f){_0x3914ac[_0xe573('0x17')](0x194);}return _0x96ad0f;};}function handleError(_0x2717a4,_0x56c577){_0x56c577=_0x56c577||0x1f4;return function(_0x464399){logger[_0xe573('0x28')](_0x464399['stack']);if(_0x464399[_0xe573('0x29')]){delete _0x464399[_0xe573('0x29')];}_0x2717a4[_0xe573('0x18')](_0x56c577)[_0xe573('0x2a')](_0x464399);};}exports[_0xe573('0x2b')]=function(_0x228853,_0x295607){var _0x1366ab={},_0x462674={},_0x46f57b={'count':0x0,'rows':[]};var _0x2dd890=_[_0xe573('0x2c')](db[_0xe573('0x2d')][_0xe573('0x2e')],function(_0x43a1f0){return{'name':_0x43a1f0[_0xe573('0x2f')],'type':_0x43a1f0[_0xe573('0x30')][_0xe573('0x31')]};});_0x462674[_0xe573('0x32')]=_['map'](_0x2dd890,_0xe573('0x29'));_0x462674['query']=_[_0xe573('0x33')](_0x228853[_0xe573('0x34')]);_0x462674[_0xe573('0x35')]=_[_0xe573('0x36')](_0x462674[_0xe573('0x32')],_0x462674[_0xe573('0x34')]);_0x1366ab[_0xe573('0x37')]=_[_0xe573('0x36')](_0x462674[_0xe573('0x32')],qs[_0xe573('0x38')](_0x228853[_0xe573('0x34')]['fields']));_0x1366ab[_0xe573('0x37')]=_0x1366ab[_0xe573('0x37')][_0xe573('0x39')]?_0x1366ab[_0xe573('0x37')]:_0x462674['model'];if(!_0x228853['query']['hasOwnProperty'](_0xe573('0x3a'))){_0x1366ab[_0xe573('0x1d')]=qs[_0xe573('0x1d')](_0x228853[_0xe573('0x34')][_0xe573('0x1d')]);_0x1366ab[_0xe573('0x1b')]=qs[_0xe573('0x1b')](_0x228853[_0xe573('0x34')][_0xe573('0x1b')]);}_0x1366ab[_0xe573('0x3b')]=qs[_0xe573('0x3c')](_0x228853[_0xe573('0x34')][_0xe573('0x3c')]);_0x1366ab[_0xe573('0x3d')]=qs[_0xe573('0x35')](_['pick'](_0x228853['query'],_0x462674['filters']),_0x2dd890);if(_0x228853[_0xe573('0x34')][_0xe573('0x3e')]){_0x1366ab[_0xe573('0x3d')]=_[_0xe573('0x3f')](_0x1366ab[_0xe573('0x3d')],{'$or':_[_0xe573('0x2c')](_0x2dd890,function(_0x553fa1){if(_0x553fa1[_0xe573('0x30')]!==_0xe573('0x40')){var _0x26fb30={};_0x26fb30[_0x553fa1[_0xe573('0x29')]]={'$like':'%'+_0x228853[_0xe573('0x34')]['filter']+'%'};return _0x26fb30;}})});}_0x1366ab=_[_0xe573('0x3f')]({},_0x1366ab,_0x228853[_0xe573('0x41')]);var _0x557aae={'where':_0x1366ab[_0xe573('0x3d')]};return db[_0xe573('0x2d')][_0xe573('0x1e')](_0x557aae)[_0xe573('0x24')](function(_0x839bb2){_0x46f57b[_0xe573('0x1e')]=_0x839bb2;if(_0x228853[_0xe573('0x34')][_0xe573('0x42')]){_0x1366ab[_0xe573('0x43')]=[{'all':!![]}];}return db[_0xe573('0x2d')]['findAll'](_0x1366ab);})['then'](function(_0x2fd89e){_0x46f57b[_0xe573('0x44')]=_0x2fd89e;return _0x46f57b;})[_0xe573('0x24')](respondWithFilteredResult(_0x295607,_0x1366ab))['catch'](handleError(_0x295607,null));};exports[_0xe573('0x45')]=function(_0x22e887,_0x40ee2e){var _0x4785b3={'raw':!![],'where':{'id':_0x22e887[_0xe573('0x46')]['id']}},_0x346bf5={};_0x346bf5[_0xe573('0x32')]=_[_0xe573('0x33')](db[_0xe573('0x2d')]['rawAttributes']);_0x346bf5['query']=_['keys'](_0x22e887['query']);_0x346bf5[_0xe573('0x35')]=_['intersection'](_0x346bf5['model'],_0x346bf5[_0xe573('0x34')]);_0x4785b3[_0xe573('0x37')]=_[_0xe573('0x36')](_0x346bf5['model'],qs[_0xe573('0x38')](_0x22e887['query'][_0xe573('0x38')]));_0x4785b3[_0xe573('0x37')]=_0x4785b3[_0xe573('0x37')][_0xe573('0x39')]?_0x4785b3[_0xe573('0x37')]:_0x346bf5['model'];if(_0x22e887[_0xe573('0x34')][_0xe573('0x42')]){_0x4785b3['include']=[{'all':!![]}];}_0x4785b3=_['merge']({},_0x4785b3,_0x22e887[_0xe573('0x41')]);return db[_0xe573('0x2d')][_0xe573('0x47')](_0x4785b3)[_0xe573('0x24')](handleEntityNotFound(_0x40ee2e,null))[_0xe573('0x24')](respondWithResult(_0x40ee2e,null))[_0xe573('0x48')](handleError(_0x40ee2e,null));};exports[_0xe573('0x49')]=function(_0x41d82a,_0x306f4e){return db[_0xe573('0x2d')]['create'](_0x41d82a['body'],{})[_0xe573('0x24')](function(_0x6e1c46){var _0x36245e=_0x41d82a['user']['get']({'plain':!![]});if(!_0x36245e)throw new Error(_0xe573('0x4a'));if(_0x36245e[_0xe573('0x4b')]===_0xe573('0x4c')){var _0x5bb3c4=_0x6e1c46[_0xe573('0x26')]({'plain':!![]});var _0x25db4e=_0xe573('0x27');return db[_0xe573('0x4d')][_0xe573('0x47')]({'where':{'name':_0x25db4e,'userProfileId':_0x36245e['userProfileId']},'raw':!![]})[_0xe573('0x24')](function(_0x2628e1){if(_0x2628e1&&_0x2628e1['autoAssociation']===0x0){return db['UserProfileResource'][_0xe573('0x49')]({'name':_0x5bb3c4[_0xe573('0x29')],'resourceId':_0x5bb3c4['id'],'type':_0x2628e1[_0xe573('0x29')],'sectionId':_0x2628e1['id']},{})[_0xe573('0x24')](function(){return _0x6e1c46;});}else{return _0x6e1c46;}})['catch'](function(_0x1aa5db){logger['error'](_0xe573('0x4e'),_0x1aa5db);throw _0x1aa5db;});}return _0x6e1c46;})['then'](respondWithResult(_0x306f4e,0xc9))[_0xe573('0x48')](handleError(_0x306f4e,null));};exports[_0xe573('0x4f')]=function(_0x2892d9,_0x374365){if(_0x2892d9[_0xe573('0x50')]['id']){delete _0x2892d9[_0xe573('0x50')]['id'];}return db[_0xe573('0x2d')]['find']({'where':{'id':_0x2892d9['params']['id']}})[_0xe573('0x24')](handleEntityNotFound(_0x374365,null))[_0xe573('0x24')](saveUpdates(_0x2892d9['body'],null))[_0xe573('0x24')](respondWithResult(_0x374365,null))['catch'](handleError(_0x374365,null));};exports[_0xe573('0x25')]=function(_0x1fa334,_0x43047d){return db['CmHopperAdditionalPhone'][_0xe573('0x47')]({'where':{'id':_0x1fa334[_0xe573('0x46')]['id']}})[_0xe573('0x24')](handleEntityNotFound(_0x43047d,null))[_0xe573('0x24')](removeEntity(_0x43047d,null))['catch'](handleError(_0x43047d,null));}; \ No newline at end of file +var _0xfdb7=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','apply','then','destroy','UserProfileResource','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x31d387,_0x4a30d7){var _0x382a79=function(_0x143510){while(--_0x143510){_0x31d387['push'](_0x31d387['shift']());}};_0x382a79(++_0x4a30d7);}(_0xfdb7,0x1d3));var _0x7fdb=function(_0x4111b6,_0x44fccd){_0x4111b6=_0x4111b6-0x0;var _0x306158=_0xfdb7[_0x4111b6];return _0x306158;};'use strict';var emlformat=require(_0x7fdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fdb('0x1'));var jsonpatch=require(_0x7fdb('0x2'));var rp=require(_0x7fdb('0x3'));var moment=require(_0x7fdb('0x4'));var BPromise=require(_0x7fdb('0x5'));var Mustache=require(_0x7fdb('0x6'));var util=require(_0x7fdb('0x7'));var path=require(_0x7fdb('0x8'));var sox=require('sox');var csv=require(_0x7fdb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fdb('0xa'));var _=require(_0x7fdb('0xb'));var squel=require(_0x7fdb('0xc'));var crypto=require(_0x7fdb('0xd'));var jsforce=require(_0x7fdb('0xe'));var deskjs=require(_0x7fdb('0xf'));var toCsv=require(_0x7fdb('0x9'));var querystring=require(_0x7fdb('0x10'));var Papa=require(_0x7fdb('0x11'));var Redis=require(_0x7fdb('0x12'));var authService=require(_0x7fdb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7fdb('0x14'));var hardwareService=require(_0x7fdb('0x15'));var logger=require(_0x7fdb('0x16'))(_0x7fdb('0x17'));var utils=require(_0x7fdb('0x18'));var config=require(_0x7fdb('0x19'));var licenseUtil=require(_0x7fdb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x422092,_0x30c066){_0x30c066=_0x30c066||0xcc;return function(_0x1a7c48){if(_0x1a7c48){return _0x422092['sendStatus'](_0x30c066);}return _0x422092[_0x7fdb('0x1b')](_0x30c066)['end']();};}function respondWithResult(_0xda5abd,_0x2e630e){_0x2e630e=_0x2e630e||0xc8;return function(_0x1530a0){if(_0x1530a0){return _0xda5abd[_0x7fdb('0x1b')](_0x2e630e)[_0x7fdb('0x1c')](_0x1530a0);}};}function respondWithFilteredResult(_0x504a6a,_0x426bfa){return function(_0x851819){if(_0x851819){var _0x4b10fb=typeof _0x426bfa[_0x7fdb('0x1d')]===_0x7fdb('0x1e')&&typeof _0x426bfa['limit']===_0x7fdb('0x1e');var _0x5c55ba=_0x851819[_0x7fdb('0x1f')];var _0x25edd1=_0x4b10fb?0x0:_0x426bfa[_0x7fdb('0x1d')];var _0x2b993c=_0x4b10fb?_0x851819[_0x7fdb('0x1f')]:_0x426bfa[_0x7fdb('0x1d')]+_0x426bfa[_0x7fdb('0x20')];var _0x56a375;if(_0x2b993c>=_0x5c55ba){_0x2b993c=_0x5c55ba;_0x56a375=0xc8;}else{_0x56a375=0xce;}_0x504a6a['status'](_0x56a375);return _0x504a6a['set']('Content-Range',_0x25edd1+'-'+_0x2b993c+'/'+_0x5c55ba)['json'](_0x851819);}return null;};}function patchUpdates(_0x332c5e){return function(_0x896abe){try{jsonpatch[_0x7fdb('0x21')](_0x896abe,_0x332c5e,!![]);}catch(_0x3163a0){return BPromise['reject'](_0x3163a0);}return _0x896abe['save']();};}function saveUpdates(_0x5ae9d5,_0x6d2a8c){return function(_0x271641){if(_0x271641){return _0x271641['update'](_0x5ae9d5)[_0x7fdb('0x22')](function(_0x32af99){return _0x32af99;});}return null;};}function removeEntity(_0x33eac2,_0x258441){return function(_0x46c8b2){if(_0x46c8b2){return _0x46c8b2[_0x7fdb('0x23')]()[_0x7fdb('0x22')](function(){var _0x3675ed=_0x46c8b2['get']({'plain':!![]});var _0x2ac93e='CmHopperAdditionalPhones';return db[_0x7fdb('0x24')][_0x7fdb('0x23')]({'where':{'type':_0x2ac93e,'resourceId':_0x3675ed['id']}})[_0x7fdb('0x22')](function(){return _0x46c8b2;});})[_0x7fdb('0x22')](function(){_0x33eac2[_0x7fdb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192a8e,_0x15989b){return function(_0x358a90){if(!_0x358a90){_0x192a8e['sendStatus'](0x194);}return _0x358a90;};}function handleError(_0x52025b,_0x13ecc2){_0x13ecc2=_0x13ecc2||0x1f4;return function(_0x2eba49){logger[_0x7fdb('0x25')](_0x2eba49['stack']);if(_0x2eba49[_0x7fdb('0x26')]){delete _0x2eba49[_0x7fdb('0x26')];}_0x52025b['status'](_0x13ecc2)['send'](_0x2eba49);};}exports[_0x7fdb('0x27')]=function(_0x4cecf7,_0x36d013){var _0xcd7cb3={},_0x2e0ea2={},_0x4d67a2={'count':0x0,'rows':[]};var _0x1a98f0=_[_0x7fdb('0x28')](db[_0x7fdb('0x29')][_0x7fdb('0x2a')],function(_0x3e51b9){return{'name':_0x3e51b9[_0x7fdb('0x2b')],'type':_0x3e51b9[_0x7fdb('0x2c')][_0x7fdb('0x2d')]};});_0x2e0ea2['model']=_[_0x7fdb('0x28')](_0x1a98f0,_0x7fdb('0x26'));_0x2e0ea2[_0x7fdb('0x2e')]=_[_0x7fdb('0x2f')](_0x4cecf7['query']);_0x2e0ea2[_0x7fdb('0x30')]=_[_0x7fdb('0x31')](_0x2e0ea2[_0x7fdb('0x32')],_0x2e0ea2[_0x7fdb('0x2e')]);_0xcd7cb3['attributes']=_['intersection'](_0x2e0ea2[_0x7fdb('0x32')],qs[_0x7fdb('0x33')](_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x33')]));_0xcd7cb3[_0x7fdb('0x34')]=_0xcd7cb3[_0x7fdb('0x34')][_0x7fdb('0x35')]?_0xcd7cb3[_0x7fdb('0x34')]:_0x2e0ea2['model'];if(!_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x36')](_0x7fdb('0x37'))){_0xcd7cb3[_0x7fdb('0x20')]=qs[_0x7fdb('0x20')](_0x4cecf7[_0x7fdb('0x2e')]['limit']);_0xcd7cb3[_0x7fdb('0x1d')]=qs['offset'](_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x1d')]);}_0xcd7cb3[_0x7fdb('0x38')]=qs[_0x7fdb('0x39')](_0x4cecf7['query'][_0x7fdb('0x39')]);_0xcd7cb3['where']=qs[_0x7fdb('0x30')](_[_0x7fdb('0x3a')](_0x4cecf7[_0x7fdb('0x2e')],_0x2e0ea2[_0x7fdb('0x30')]),_0x1a98f0);if(_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x3b')]){_0xcd7cb3[_0x7fdb('0x3c')]=_[_0x7fdb('0x3d')](_0xcd7cb3[_0x7fdb('0x3c')],{'$or':_['map'](_0x1a98f0,function(_0x37cffa){if(_0x37cffa[_0x7fdb('0x2c')]!==_0x7fdb('0x3e')){var _0x4de381={};_0x4de381[_0x37cffa['name']]={'$like':'%'+_0x4cecf7['query'][_0x7fdb('0x3b')]+'%'};return _0x4de381;}})});}_0xcd7cb3=_[_0x7fdb('0x3d')]({},_0xcd7cb3,_0x4cecf7[_0x7fdb('0x3f')]);var _0x2da46e={'where':_0xcd7cb3[_0x7fdb('0x3c')]};return db[_0x7fdb('0x29')][_0x7fdb('0x1f')](_0x2da46e)[_0x7fdb('0x22')](function(_0x5504eb){_0x4d67a2[_0x7fdb('0x1f')]=_0x5504eb;if(_0x4cecf7['query'][_0x7fdb('0x40')]){_0xcd7cb3[_0x7fdb('0x41')]=[{'all':!![]}];}return db[_0x7fdb('0x29')][_0x7fdb('0x42')](_0xcd7cb3);})[_0x7fdb('0x22')](function(_0x5bfe69){_0x4d67a2['rows']=_0x5bfe69;return _0x4d67a2;})[_0x7fdb('0x22')](respondWithFilteredResult(_0x36d013,_0xcd7cb3))[_0x7fdb('0x43')](handleError(_0x36d013,null));};exports[_0x7fdb('0x44')]=function(_0xf429ef,_0xeadcdf){var _0x288f37={'raw':!![],'where':{'id':_0xf429ef[_0x7fdb('0x45')]['id']}},_0x12a593={};_0x12a593[_0x7fdb('0x32')]=_[_0x7fdb('0x2f')](db['CmHopperAdditionalPhone'][_0x7fdb('0x2a')]);_0x12a593['query']=_['keys'](_0xf429ef['query']);_0x12a593['filters']=_['intersection'](_0x12a593[_0x7fdb('0x32')],_0x12a593[_0x7fdb('0x2e')]);_0x288f37['attributes']=_[_0x7fdb('0x31')](_0x12a593['model'],qs[_0x7fdb('0x33')](_0xf429ef['query']['fields']));_0x288f37['attributes']=_0x288f37[_0x7fdb('0x34')][_0x7fdb('0x35')]?_0x288f37[_0x7fdb('0x34')]:_0x12a593['model'];if(_0xf429ef[_0x7fdb('0x2e')]['includeAll']){_0x288f37[_0x7fdb('0x41')]=[{'all':!![]}];}_0x288f37=_[_0x7fdb('0x3d')]({},_0x288f37,_0xf429ef['options']);return db['CmHopperAdditionalPhone'][_0x7fdb('0x46')](_0x288f37)[_0x7fdb('0x22')](handleEntityNotFound(_0xeadcdf,null))[_0x7fdb('0x22')](respondWithResult(_0xeadcdf,null))['catch'](handleError(_0xeadcdf,null));};exports[_0x7fdb('0x47')]=function(_0x16ca4a,_0x3ea1a1){return db[_0x7fdb('0x29')]['create'](_0x16ca4a[_0x7fdb('0x48')],{})['then'](function(_0x5a04a8){var _0x5160ac=_0x16ca4a[_0x7fdb('0x49')][_0x7fdb('0x4a')]({'plain':!![]});if(!_0x5160ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5160ac[_0x7fdb('0x4b')]===_0x7fdb('0x49')){var _0x4a9ed0=_0x5a04a8[_0x7fdb('0x4a')]({'plain':!![]});var _0x270d62='CmHopperAdditionalPhones';return db[_0x7fdb('0x4c')][_0x7fdb('0x46')]({'where':{'name':_0x270d62,'userProfileId':_0x5160ac[_0x7fdb('0x4d')]},'raw':!![]})[_0x7fdb('0x22')](function(_0x493165){if(_0x493165&&_0x493165[_0x7fdb('0x4e')]===0x0){return db[_0x7fdb('0x24')]['create']({'name':_0x4a9ed0[_0x7fdb('0x26')],'resourceId':_0x4a9ed0['id'],'type':_0x493165[_0x7fdb('0x26')],'sectionId':_0x493165['id']},{})['then'](function(){return _0x5a04a8;});}else{return _0x5a04a8;}})['catch'](function(_0x3e0b13){logger[_0x7fdb('0x25')](_0x7fdb('0x4f'),_0x3e0b13);throw _0x3e0b13;});}return _0x5a04a8;})[_0x7fdb('0x22')](respondWithResult(_0x3ea1a1,0xc9))[_0x7fdb('0x43')](handleError(_0x3ea1a1,null));};exports[_0x7fdb('0x50')]=function(_0x36ad3d,_0x34fa2e){if(_0x36ad3d[_0x7fdb('0x48')]['id']){delete _0x36ad3d[_0x7fdb('0x48')]['id'];}return db[_0x7fdb('0x29')][_0x7fdb('0x46')]({'where':{'id':_0x36ad3d[_0x7fdb('0x45')]['id']}})[_0x7fdb('0x22')](handleEntityNotFound(_0x34fa2e,null))[_0x7fdb('0x22')](saveUpdates(_0x36ad3d[_0x7fdb('0x48')],null))[_0x7fdb('0x22')](respondWithResult(_0x34fa2e,null))[_0x7fdb('0x43')](handleError(_0x34fa2e,null));};exports[_0x7fdb('0x23')]=function(_0x44b741,_0x2dc4b2){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x44b741[_0x7fdb('0x45')]['id']}})[_0x7fdb('0x22')](handleEntityNotFound(_0x2dc4b2,null))[_0x7fdb('0x22')](removeEntity(_0x2dc4b2,null))[_0x7fdb('0x43')](handleError(_0x2dc4b2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 6b6d9c6..361f537 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec3f=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec3f,0x1ee));var _0xfec3=function(_0x1df951,_0x405a24){_0x1df951=_0x1df951-0x0;var _0xcd27a8=_0xec3f[_0x1df951];return _0xcd27a8;};'use strict';var _=require(_0xfec3('0x0'));var util=require(_0xfec3('0x1'));var logger=require(_0xfec3('0x2'))(_0xfec3('0x3'));var moment=require(_0xfec3('0x4'));var BPromise=require(_0xfec3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfec3('0x6'));var config=require(_0xfec3('0x7'));var attributes=require(_0xfec3('0x8'));module[_0xfec3('0x9')]=function(_0x29dfe9,_0x21fd87){return _0x29dfe9[_0xfec3('0xa')](_0xfec3('0xb'),attributes,{'tableName':_0xfec3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fed=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x54c5bb,_0x398bf4){var _0x12f42d=function(_0x915a6f){while(--_0x915a6f){_0x54c5bb['push'](_0x54c5bb['shift']());}};_0x12f42d(++_0x398bf4);}(_0x3fed,0x1a4));var _0xd3fe=function(_0x28d91b,_0x2c8709){_0x28d91b=_0x28d91b-0x0;var _0x1f364b=_0x3fed[_0x28d91b];return _0x1f364b;};'use strict';var _=require(_0xd3fe('0x0'));var util=require(_0xd3fe('0x1'));var logger=require(_0xd3fe('0x2'))(_0xd3fe('0x3'));var moment=require(_0xd3fe('0x4'));var BPromise=require(_0xd3fe('0x5'));var rp=require(_0xd3fe('0x6'));var fs=require('fs');var path=require(_0xd3fe('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3fe('0x8'));module['exports']=function(_0x693071,_0x2d44d2){return _0x693071[_0xd3fe('0x9')](_0xd3fe('0xa'),attributes,{'tableName':_0xd3fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 6a41ed5..8ceb0c3 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x539e=['isNil','add','countabandonedretry','createdAt','updatedAt','phone','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countcongestionretry','entity','duration','waitTime','scheduledat','minutes'];(function(_0x3ed07c,_0x414025){var _0x5c32bc=function(_0x322d47){while(--_0x322d47){_0x3ed07c['push'](_0x3ed07c['shift']());}};_0x5c32bc(++_0x414025);}(_0x539e,0x127));var _0xe539=function(_0x372c7c,_0x61b580){_0x372c7c=_0x372c7c-0x0;var _0x2ab5f7=_0x539e[_0x372c7c];return _0x2ab5f7;};'use strict';var _=require(_0xe539('0x0'));var util=require(_0xe539('0x1'));var moment=require(_0xe539('0x2'));var BPromise=require(_0xe539('0x3'));var rs=require(_0xe539('0x4'));var fs=require('fs');var Redis=require(_0xe539('0x5'));var db=require(_0xe539('0x6'))['db'];var utils=require(_0xe539('0x7'));var logger=require('../../config/logger')(_0xe539('0x8'));var config=require(_0xe539('0x9'));var jayson=require(_0xe539('0xa'));var client=jayson[_0xe539('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x167ab5,_0x4fdb8a,_0x4a2c4f){return new BPromise(function(_0xbdd3e7,_0x46c0fd){return client[_0xe539('0xc')](_0x167ab5,_0x4a2c4f)['then'](function(_0x2e24d7){logger[_0xe539('0xd')](_0xe539('0xe'),_0x4fdb8a,'request\x20sent');logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x4fdb8a,'request\x20sent',JSON[_0xe539('0xf')](_0x2e24d7));if(_0x2e24d7[_0xe539('0x10')]){if(_0x2e24d7[_0xe539('0x10')][_0xe539('0x11')]===0x1f4){logger[_0xe539('0x10')](_0xe539('0xe'),_0x4fdb8a,_0x2e24d7[_0xe539('0x10')][_0xe539('0x12')]);return _0x46c0fd(_0x2e24d7[_0xe539('0x10')][_0xe539('0x12')]);}logger[_0xe539('0x10')](_0xe539('0xe'),_0x4fdb8a,_0x2e24d7['error']['message']);return _0xbdd3e7(_0x2e24d7[_0xe539('0x10')][_0xe539('0x12')]);}else{logger['info'](_0xe539('0xe'),_0x4fdb8a,_0xe539('0x13'));_0xbdd3e7(_0x2e24d7[_0xe539('0x14')][_0xe539('0x12')]);}})[_0xe539('0x15')](function(_0x43682b){logger[_0xe539('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4fdb8a,_0x43682b);_0x46c0fd(_0x43682b);});});}exports[_0xe539('0x16')]=function(_0xf7d046){var _0x13f97d=this;return new Promise(function(_0x80ed12,_0x905790){return db[_0xe539('0x17')][_0xe539('0x18')]({'raw':!![],'where':{'ContactId':_0xf7d046[_0xe539('0x19')][_0xe539('0x1a')],'ListId':_0xf7d046[_0xe539('0x19')][_0xe539('0x1b')],'VoiceQueueId':_0xf7d046['body'][_0xe539('0x1c')]===undefined?null:_0xf7d046[_0xe539('0x19')][_0xe539('0x1c')],'CampaignId':_0xf7d046[_0xe539('0x19')][_0xe539('0x1d')]===undefined?null:_0xf7d046[_0xe539('0x19')][_0xe539('0x1d')]}})['then'](function(_0x2f4291){if(_0x2f4291!=null){return db[_0xe539('0x1e')][_0xe539('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2f4291['id'],'OrderBy':{'$gt':_0x2f4291[_0xe539('0x1f')]}},'order':[[_0xe539('0x1f'),_0xe539('0x20')]]})[_0xe539('0x21')](function(_0x2bbdb4){var _0x533f94=0x0;if(_0x2bbdb4){if(_0x2bbdb4[_0xe539('0x22')]+_0x2bbdb4['countcongestionretry']+_0x2bbdb4[_0xe539('0x23')]+_0x2bbdb4[_0xe539('0x24')]+_0x2bbdb4[_0xe539('0x25')]+_0x2bbdb4['countabandonedretry']+_0x2bbdb4[_0xe539('0x26')]+_0x2bbdb4[_0xe539('0x27')]<_0xf7d046['entity'][_0xe539('0x28')])_0x533f94=0x1;_0x80ed12({'additional':_0x533f94});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2f4291['id']},'order':[[_0xe539('0x1f'),'ASC']]})[_0xe539('0x21')](function(_0xec43c3){var _0x27730b=0x0;if(_0xec43c3){if(_0xec43c3[_0xe539('0x22')]+_0xec43c3[_0xe539('0x29')]+_0xec43c3[_0xe539('0x23')]+_0xec43c3['countnosuchnumberretry']+_0xec43c3[_0xe539('0x25')]+_0xec43c3['countabandonedretry']+_0xec43c3[_0xe539('0x26')]+_0xec43c3[_0xe539('0x27')]<_0xf7d046[_0xe539('0x2a')][_0xe539('0x28')])_0x27730b=0x1;_0x80ed12({'additional':_0x27730b});}else{_0x80ed12({'additional':0x0});}})[_0xe539('0x15')](function(_0x8f662e){logger[_0xe539('0x10')](_0xe539('0x16'),_0x8f662e[_0xe539('0x12')]);_0x905790(_0x13f97d[_0xe539('0x10')](0x1f4,_0x8f662e['message']));});}})[_0xe539('0x15')](function(_0x487044){logger['error'](_0xe539('0x16'),_0x487044['message']);_0x905790(_0x13f97d[_0xe539('0x10')](0x1f4,_0x487044[_0xe539('0x12')]));});}else _0x80ed12({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x9335cf){var _0x1a4b3f=this;return new Promise(function(_0xc9509f,_0x11d04e){return db['CmHopper'][_0xe539('0x18')]({'raw':!![],'where':{'ContactId':_0x9335cf[_0xe539('0x19')][_0xe539('0x1a')],'ListId':_0x9335cf['body'][_0xe539('0x1b')],'VoiceQueueId':_0x9335cf[_0xe539('0x19')]['VoiceQueueId']===undefined?null:_0x9335cf['body'][_0xe539('0x1c')],'CampaignId':_0x9335cf['body']['CampaignId']===undefined?null:_0x9335cf[_0xe539('0x19')]['CampaignId']}})['then'](function(_0xa1a4){if(_0xa1a4!=null){return db[_0xe539('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xa1a4['id'],'OrderBy':{'$gte':_0xa1a4['OrderBy']}},'order':[['OrderBy',_0xe539('0x20')]]})[_0xe539('0x21')](function(_0x5a62e5){if(_0x5a62e5)return activateAdditionalPhone(_0xa1a4,_0x9335cf[_0xe539('0x19')],_0x5a62e5,_0x9335cf[_0xe539('0x2b')],_0x9335cf[_0xe539('0x2c')])[_0xe539('0x21')](function(_0x3b59cb){_0xc9509f(_0x3b59cb);});else{return db[_0xe539('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xa1a4['id']},'order':[['OrderBy',_0xe539('0x20')]]})[_0xe539('0x21')](function(_0x49e0a4){if(_0x49e0a4)return activateAdditionalPhone(_0xa1a4,_0x9335cf[_0xe539('0x19')],_0x49e0a4,_0x9335cf[_0xe539('0x2b')],_0x9335cf[_0xe539('0x2c')])[_0xe539('0x21')](function(_0x1eb612){_0xc9509f(_0x1eb612);});else{_0xc9509f({'id':_0xa1a4['id'],'phone':''});}})[_0xe539('0x15')](function(_0x4b15f5){logger[_0xe539('0x10')](_0xe539('0x16'),_0x4b15f5[_0xe539('0x12')]);_0x11d04e(_0x1a4b3f[_0xe539('0x10')](0x1f4,_0x4b15f5['message']));});}})['catch'](function(_0x2bdf5c){logger[_0xe539('0x10')](_0xe539('0x16'),_0x2bdf5c['message']);_0x11d04e(_0x1a4b3f[_0xe539('0x10')](0x1f4,_0x2bdf5c[_0xe539('0x12')]));});}else _0xc9509f(0x1);});});};function activateAdditionalPhone(_0x8a1462,_0x5853ab,_0x3628b0,_0x4897ff,_0x28c3b8){return new Promise(function(_0x3493b5,_0x5cd65a){var _0x395d89;if(_['isNil'](_0x3628b0[_0xe539('0x2d')])){_0x3628b0[_0xe539('0x2d')]=moment();}if(moment()>moment(_0x3628b0[_0xe539('0x2d')])){_0x395d89=moment()['add'](_0x28c3b8||0x3,_0xe539('0x2e'));}else{if(_0x3628b0[_0xe539('0x1f')]==0x0){_0x395d89=moment(_0x3628b0[_0xe539('0x2d')]);}else{_0x395d89=moment()['add'](_0x28c3b8||0x3,_0xe539('0x2e'));}}if(_[_0xe539('0x2f')](_0x395d89)){_0x395d89=moment()[_0xe539('0x30')](_0x28c3b8||0x3,_0xe539('0x2e'));}var _0x5a1ebb={'phone':_0x8a1462['phone'],'active':0x0,'OrderBy':_['isNil'](_0x8a1462[_0xe539('0x1f')])?0x0:_0x8a1462[_0xe539('0x1f')],'scheduledat':moment()[_0xe539('0x30')](_0x4897ff||0x1,'minutes'),'countbusyretry':_0x5853ab[_0xe539('0x22')],'countcongestionretry':_0x5853ab[_0xe539('0x29')],'countnoanswerretry':_0x5853ab[_0xe539('0x23')],'countnosuchnumberretry':_0x5853ab[_0xe539('0x24')],'countdropretry':_0x5853ab[_0xe539('0x25')],'countabandonedretry':_0x5853ab[_0xe539('0x31')],'countmachineretry':_0x5853ab[_0xe539('0x26')],'countagentrejectretry':_0x5853ab[_0xe539('0x27')],'createdAt':_0x5853ab[_0xe539('0x32')],'updatedAt':_0x5853ab[_0xe539('0x33')]};var _0x840685={'CmHopperId':_0x8a1462['id'],'phone':_0x3628b0[_0xe539('0x34')],'active':0x0,'OrderBy':_[_0xe539('0x2f')](_0x3628b0[_0xe539('0x1f')])?0x0:_0x3628b0[_0xe539('0x1f')],'scheduledat':_0x395d89,'countbusyretry':_0x3628b0[_0xe539('0x22')],'countcongestionretry':_0x3628b0[_0xe539('0x29')],'countnoanswerretry':_0x3628b0[_0xe539('0x23')],'countnosuchnumberretry':_0x3628b0[_0xe539('0x24')],'countdropretry':_0x3628b0[_0xe539('0x25')],'countabandonedretry':_0x3628b0['countabandonedretry'],'countmachineretry':_0x3628b0[_0xe539('0x26')],'countagentrejectretry':_0x3628b0[_0xe539('0x27')],'createdAt':_0x3628b0['createdAt'],'updatedAt':_0x3628b0[_0xe539('0x33')]};return db['sequelize'][_0xe539('0x35')](function(_0x56c8da){return db['CmHopperAdditionalPhone'][_0xe539('0x36')](_0x5a1ebb,{'where':{'id':_0x3628b0['id']}},{'transaction':_0x56c8da})[_0xe539('0x21')](function(){return db['CmHopper'][_0xe539('0x36')](_0x840685,{'where':{'id':_0x8a1462['id']}},{'transaction':_0x56c8da});});})[_0xe539('0x21')](function(_0x2f9303){_0x3493b5({'id':_0x8a1462['id'],'phone':_0x3628b0[_0xe539('0x34')]});})['catch'](function(_0x2530ba){logger['error']('activateAdditionalPhone',_0x2530ba[_0xe539('0x12')]);_0x5cd65a({'error':_0x2530ba[_0xe539('0x12')]});});});}exports[_0xe539('0x37')]=function(_0x4244e9){var _0x3f6c03=this;return new Promise(function(_0x2cc54e,_0x48856b){return db[_0xe539('0x17')][_0xe539('0x36')](_0x4244e9[_0xe539('0x19')][_0xe539('0x38')],{'where':{'id':_0x4244e9[_0xe539('0x19')]['id']}})[_0xe539('0x21')](function(_0x34ebd9){_0x2cc54e(_0x34ebd9);})['catch'](function(_0x4522f1){logger[_0xe539('0x10')](_0xe539('0x37'),_0x4522f1['message']);_0x48856b(_0x3f6c03[_0xe539('0x10')](0x1f4,_0x4522f1[_0xe539('0x12')]));});});}; \ No newline at end of file +var _0xb6f3=['then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','OrderBy','ASC','countagentrejectretry','duration','waitTime','scheduledat','add','minutes','phone','createdAt','updatedAt','countcongestionretry','sequelize','transaction','IncrementPreviewCounters','update','field','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2f3d0c,_0x25c4ad){var _0x551819=function(_0x58a7e8){while(--_0x58a7e8){_0x2f3d0c['push'](_0x2f3d0c['shift']());}};_0x551819(++_0x25c4ad);}(_0xb6f3,0x146));var _0x3b6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb6f3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3b6f('0x0'));var util=require(_0x3b6f('0x1'));var moment=require(_0x3b6f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b6f('0x4'));var logger=require(_0x3b6f('0x5'))('rpc');var config=require(_0x3b6f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3b6f('0x7')][_0x3b6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b1a2d,_0x5091dc,_0x15c266){return new BPromise(function(_0x489a3a,_0x170328){return client[_0x3b6f('0x9')](_0x3b1a2d,_0x15c266)[_0x3b6f('0xa')](function(_0x345919){logger['info'](_0x3b6f('0xb'),_0x5091dc,_0x3b6f('0xc'));logger[_0x3b6f('0xd')](_0x3b6f('0xe'),_0x5091dc,_0x3b6f('0xc'),JSON[_0x3b6f('0xf')](_0x345919));if(_0x345919[_0x3b6f('0x10')]){if(_0x345919['error'][_0x3b6f('0x11')]===0x1f4){logger[_0x3b6f('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5091dc,_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);return _0x170328(_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);}logger[_0x3b6f('0x10')](_0x3b6f('0xb'),_0x5091dc,_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);return _0x489a3a(_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);}else{logger[_0x3b6f('0x13')](_0x3b6f('0xb'),_0x5091dc,_0x3b6f('0xc'));_0x489a3a(_0x345919[_0x3b6f('0x14')][_0x3b6f('0x12')]);}})[_0x3b6f('0x15')](function(_0x1d541d){logger[_0x3b6f('0x10')](_0x3b6f('0xb'),_0x5091dc,_0x1d541d);_0x170328(_0x1d541d);});});}exports[_0x3b6f('0x16')]=function(_0x58c650){var _0x4e36f0=this;return new Promise(function(_0x3622a8,_0x56cd69){return db[_0x3b6f('0x17')][_0x3b6f('0x18')]({'raw':!![],'where':{'ContactId':_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1a')],'ListId':_0x58c650['body'][_0x3b6f('0x1b')],'VoiceQueueId':_0x58c650[_0x3b6f('0x19')]['VoiceQueueId']===undefined?null:_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1c')],'CampaignId':_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1d')]===undefined?null:_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1d')]}})[_0x3b6f('0xa')](function(_0x413d27){if(_0x413d27!=null){return db[_0x3b6f('0x1e')][_0x3b6f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x413d27['id'],'OrderBy':{'$gt':_0x413d27['OrderBy']}},'order':[['OrderBy','ASC']]})[_0x3b6f('0xa')](function(_0x5f5168){var _0x1587c7=0x0;if(_0x5f5168){if(_0x5f5168[_0x3b6f('0x1f')]+_0x5f5168['countcongestionretry']+_0x5f5168[_0x3b6f('0x20')]+_0x5f5168[_0x3b6f('0x21')]+_0x5f5168[_0x3b6f('0x22')]+_0x5f5168[_0x3b6f('0x23')]+_0x5f5168[_0x3b6f('0x24')]+_0x5f5168['countagentrejectretry']<_0x58c650[_0x3b6f('0x25')][_0x3b6f('0x26')])_0x1587c7=0x1;_0x3622a8({'additional':_0x1587c7});}else{return db[_0x3b6f('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x413d27['id']},'order':[[_0x3b6f('0x27'),_0x3b6f('0x28')]]})[_0x3b6f('0xa')](function(_0x43bc8b){var _0x13a804=0x0;if(_0x43bc8b){if(_0x43bc8b[_0x3b6f('0x1f')]+_0x43bc8b['countcongestionretry']+_0x43bc8b['countnoanswerretry']+_0x43bc8b[_0x3b6f('0x21')]+_0x43bc8b['countdropretry']+_0x43bc8b[_0x3b6f('0x23')]+_0x43bc8b[_0x3b6f('0x24')]+_0x43bc8b[_0x3b6f('0x29')]<_0x58c650[_0x3b6f('0x25')][_0x3b6f('0x26')])_0x13a804=0x1;_0x3622a8({'additional':_0x13a804});}else{_0x3622a8({'additional':0x0});}})[_0x3b6f('0x15')](function(_0x71be1d){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x71be1d['message']);_0x56cd69(_0x4e36f0[_0x3b6f('0x10')](0x1f4,_0x71be1d[_0x3b6f('0x12')]));});}})[_0x3b6f('0x15')](function(_0x49ab74){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x49ab74['message']);_0x56cd69(_0x4e36f0[_0x3b6f('0x10')](0x1f4,_0x49ab74[_0x3b6f('0x12')]));});}else _0x3622a8({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x431c94){var _0x358ea8=this;return new Promise(function(_0x454ad9,_0x44592d){return db[_0x3b6f('0x17')][_0x3b6f('0x18')]({'raw':!![],'where':{'ContactId':_0x431c94[_0x3b6f('0x19')][_0x3b6f('0x1a')],'ListId':_0x431c94['body'][_0x3b6f('0x1b')],'VoiceQueueId':_0x431c94['body'][_0x3b6f('0x1c')]===undefined?null:_0x431c94[_0x3b6f('0x19')][_0x3b6f('0x1c')],'CampaignId':_0x431c94['body'][_0x3b6f('0x1d')]===undefined?null:_0x431c94[_0x3b6f('0x19')][_0x3b6f('0x1d')]}})['then'](function(_0xb9420a){if(_0xb9420a!=null){return db['CmHopperAdditionalPhone'][_0x3b6f('0x18')]({'raw':!![],'where':{'CmHopperId':_0xb9420a['id'],'OrderBy':{'$gte':_0xb9420a[_0x3b6f('0x27')]}},'order':[['OrderBy','ASC']]})[_0x3b6f('0xa')](function(_0x1f7250){if(_0x1f7250)return activateAdditionalPhone(_0xb9420a,_0x431c94[_0x3b6f('0x19')],_0x1f7250,_0x431c94[_0x3b6f('0x2a')],_0x431c94[_0x3b6f('0x2b')])[_0x3b6f('0xa')](function(_0x6a5211){_0x454ad9(_0x6a5211);});else{return db['CmHopperAdditionalPhone'][_0x3b6f('0x18')]({'raw':!![],'where':{'CmHopperId':_0xb9420a['id']},'order':[[_0x3b6f('0x27'),'ASC']]})[_0x3b6f('0xa')](function(_0x545dc2){if(_0x545dc2)return activateAdditionalPhone(_0xb9420a,_0x431c94[_0x3b6f('0x19')],_0x545dc2,_0x431c94['duration'],_0x431c94['waitTime'])[_0x3b6f('0xa')](function(_0x150301){_0x454ad9(_0x150301);});else{_0x454ad9({'id':_0xb9420a['id'],'phone':''});}})['catch'](function(_0x4ed107){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x4ed107[_0x3b6f('0x12')]);_0x44592d(_0x358ea8[_0x3b6f('0x10')](0x1f4,_0x4ed107[_0x3b6f('0x12')]));});}})[_0x3b6f('0x15')](function(_0x5c6cb6){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x5c6cb6[_0x3b6f('0x12')]);_0x44592d(_0x358ea8[_0x3b6f('0x10')](0x1f4,_0x5c6cb6[_0x3b6f('0x12')]));});}else _0x454ad9(0x1);});});};function activateAdditionalPhone(_0x369ab0,_0x2e8bc1,_0x213478,_0x4367a9,_0xb5b4f9){return new Promise(function(_0x2ba88,_0x2f5404){var _0x538e37;if(_['isNil'](_0x213478[_0x3b6f('0x2c')])){_0x213478['scheduledat']=moment();}if(moment()>moment(_0x213478[_0x3b6f('0x2c')])){_0x538e37=moment()[_0x3b6f('0x2d')](_0xb5b4f9||0x3,'minutes');}else{if(_0x213478[_0x3b6f('0x27')]==0x0){_0x538e37=moment(_0x213478['scheduledat']);}else{_0x538e37=moment()['add'](_0xb5b4f9||0x3,'minutes');}}if(_['isNil'](_0x538e37)){_0x538e37=moment()[_0x3b6f('0x2d')](_0xb5b4f9||0x3,_0x3b6f('0x2e'));}var _0x31224b={'phone':_0x369ab0[_0x3b6f('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x369ab0[_0x3b6f('0x27')])?0x0:_0x369ab0[_0x3b6f('0x27')],'scheduledat':moment()[_0x3b6f('0x2d')](_0x4367a9||0x1,'minutes'),'countbusyretry':_0x2e8bc1[_0x3b6f('0x1f')],'countcongestionretry':_0x2e8bc1['countcongestionretry'],'countnoanswerretry':_0x2e8bc1[_0x3b6f('0x20')],'countnosuchnumberretry':_0x2e8bc1[_0x3b6f('0x21')],'countdropretry':_0x2e8bc1['countdropretry'],'countabandonedretry':_0x2e8bc1[_0x3b6f('0x23')],'countmachineretry':_0x2e8bc1['countmachineretry'],'countagentrejectretry':_0x2e8bc1[_0x3b6f('0x29')],'createdAt':_0x2e8bc1[_0x3b6f('0x30')],'updatedAt':_0x2e8bc1[_0x3b6f('0x31')]};var _0x54c94b={'CmHopperId':_0x369ab0['id'],'phone':_0x213478[_0x3b6f('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x213478[_0x3b6f('0x27')])?0x0:_0x213478['OrderBy'],'scheduledat':_0x538e37,'countbusyretry':_0x213478[_0x3b6f('0x1f')],'countcongestionretry':_0x213478[_0x3b6f('0x32')],'countnoanswerretry':_0x213478[_0x3b6f('0x20')],'countnosuchnumberretry':_0x213478[_0x3b6f('0x21')],'countdropretry':_0x213478[_0x3b6f('0x22')],'countabandonedretry':_0x213478[_0x3b6f('0x23')],'countmachineretry':_0x213478[_0x3b6f('0x24')],'countagentrejectretry':_0x213478[_0x3b6f('0x29')],'createdAt':_0x213478['createdAt'],'updatedAt':_0x213478[_0x3b6f('0x31')]};return db[_0x3b6f('0x33')][_0x3b6f('0x34')](function(_0x5ed6f0){return db[_0x3b6f('0x1e')]['update'](_0x31224b,{'where':{'id':_0x213478['id']}},{'transaction':_0x5ed6f0})[_0x3b6f('0xa')](function(){return db[_0x3b6f('0x17')]['update'](_0x54c94b,{'where':{'id':_0x369ab0['id']}},{'transaction':_0x5ed6f0});});})[_0x3b6f('0xa')](function(_0x184ecf){_0x2ba88({'id':_0x369ab0['id'],'phone':_0x213478['phone']});})['catch'](function(_0x2354df){logger[_0x3b6f('0x10')]('activateAdditionalPhone',_0x2354df[_0x3b6f('0x12')]);_0x2f5404({'error':_0x2354df['message']});});});}exports[_0x3b6f('0x35')]=function(_0x44569d){var _0x3ba97a=this;return new Promise(function(_0x5e34a1,_0x3254d7){return db['CmHopper'][_0x3b6f('0x36')](_0x44569d['body'][_0x3b6f('0x37')],{'where':{'id':_0x44569d[_0x3b6f('0x19')]['id']}})[_0x3b6f('0xa')](function(_0x1e7e6f){_0x5e34a1(_0x1e7e6f);})['catch'](function(_0x13e51e){logger[_0x3b6f('0x10')](_0x3b6f('0x35'),_0x13e51e[_0x3b6f('0x12')]);_0x3254d7(_0x3ba97a[_0x3b6f('0x10')](0x1f4,_0x13e51e[_0x3b6f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index b1a76db..d330d54 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bd6=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show'];(function(_0x60bc8b,_0x3510a5){var _0x519412=function(_0x5c854f){while(--_0x5c854f){_0x60bc8b['push'](_0x60bc8b['shift']());}};_0x519412(++_0x3510a5);}(_0x8bd6,0x144));var _0x68bd=function(_0x2fa7ee,_0x14c4a7){_0x2fa7ee=_0x2fa7ee-0x0;var _0x2ec7e3=_0x8bd6[_0x2fa7ee];return _0x2ec7e3;};'use strict';var multer=require(_0x68bd('0x0'));var util=require(_0x68bd('0x1'));var path=require(_0x68bd('0x2'));var timeout=require(_0x68bd('0x3'));var express=require(_0x68bd('0x4'));var router=express[_0x68bd('0x5')]();var fs_extra=require(_0x68bd('0x6'));var auth=require(_0x68bd('0x7'));var interaction=require(_0x68bd('0x8'));var config=require(_0x68bd('0x9'));var controller=require(_0x68bd('0xa'));router[_0x68bd('0xb')]('/',auth[_0x68bd('0xc')](),controller[_0x68bd('0xd')]);router[_0x68bd('0xb')](_0x68bd('0xe'),auth[_0x68bd('0xc')](),controller[_0x68bd('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x68bd('0x10')]('/:id',auth[_0x68bd('0xc')](),controller[_0x68bd('0x11')]);router[_0x68bd('0x12')](_0x68bd('0xe'),auth[_0x68bd('0xc')](),controller['destroy']);module[_0x68bd('0x13')]=router; \ No newline at end of file +var _0xecac=['multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports'];(function(_0x4a3240,_0x3a3cb6){var _0x3e8e83=function(_0x592703){while(--_0x592703){_0x4a3240['push'](_0x4a3240['shift']());}};_0x3e8e83(++_0x3a3cb6);}(_0xecac,0x100));var _0xceca=function(_0xc932c3,_0x1ebbcc){_0xc932c3=_0xc932c3-0x0;var _0x331fd1=_0xecac[_0xc932c3];return _0x331fd1;};'use strict';var multer=require(_0xceca('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xceca('0x1'));var router=express[_0xceca('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xceca('0x3'));var interaction=require(_0xceca('0x4'));var config=require(_0xceca('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0xceca('0x6')](),controller[_0xceca('0x7')]);router['get']('/:id',auth[_0xceca('0x6')](),controller[_0xceca('0x8')]);router[_0xceca('0x9')]('/',auth[_0xceca('0x6')](),controller[_0xceca('0xa')]);router['put'](_0xceca('0xb'),auth[_0xceca('0x6')](),controller[_0xceca('0xc')]);router[_0xceca('0xd')](_0xceca('0xb'),auth[_0xceca('0x6')](),controller[_0xceca('0xe')]);module[_0xceca('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index fc2a47e..419a879 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eab=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x12c040,_0x3e4161){var _0x11f212=function(_0x1049d4){while(--_0x1049d4){_0x12c040['push'](_0x12c040['shift']());}};_0x11f212(++_0x3e4161);}(_0x0eab,0x1d4));var _0xb0ea=function(_0x587181,_0x5e017f){_0x587181=_0x587181-0x0;var _0x5e4b12=_0x0eab[_0x587181];return _0x5e4b12;};'use strict';var moment=require(_0xb0ea('0x0'));var Sequelize=require(_0xb0ea('0x1'));module[_0xb0ea('0x2')]={'phone':{'type':Sequelize[_0xb0ea('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb0ea('0x4')],'unique':_0xb0ea('0x5')},'ListId':{'type':Sequelize[_0xb0ea('0x4')],'unique':_0xb0ea('0x5')},'VoiceQueueId':{'type':Sequelize[_0xb0ea('0x4')],'unique':_0xb0ea('0x5')}}; \ No newline at end of file +var _0x4873=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x25a392,_0x5c88c7){var _0x1b1e67=function(_0x219417){while(--_0x219417){_0x25a392['push'](_0x25a392['shift']());}};_0x1b1e67(++_0x5c88c7);}(_0x4873,0x1df));var _0x3487=function(_0x2785f9,_0xdc7878){_0x2785f9=_0x2785f9-0x0;var _0x435e59=_0x4873[_0x2785f9];return _0x435e59;};'use strict';var moment=require(_0x3487('0x0'));var Sequelize=require(_0x3487('0x1'));module[_0x3487('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3487('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3487('0x4')},'VoiceQueueId':{'type':Sequelize[_0x3487('0x3')],'unique':_0x3487('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index dbecfa1..3d1b420 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa201=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','include','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x22d68a,_0x3f6978){var _0x131c53=function(_0x1781dc){while(--_0x1781dc){_0x22d68a['push'](_0x22d68a['shift']());}};_0x131c53(++_0x3f6978);}(_0xa201,0x1eb));var _0x1a20=function(_0x7aedef,_0x3aadd8){_0x7aedef=_0x7aedef-0x0;var _0x34ea60=_0xa201[_0x7aedef];return _0x34ea60;};'use strict';var emlformat=require(_0x1a20('0x0'));var rimraf=require(_0x1a20('0x1'));var zipdir=require(_0x1a20('0x2'));var jsonpatch=require(_0x1a20('0x3'));var rp=require(_0x1a20('0x4'));var moment=require('moment');var BPromise=require(_0x1a20('0x5'));var Mustache=require(_0x1a20('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1a20('0x7'));var csv=require(_0x1a20('0x8'));var ejs=require(_0x1a20('0x9'));var fs=require('fs');var fs_extra=require(_0x1a20('0xa'));var _=require(_0x1a20('0xb'));var squel=require(_0x1a20('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a20('0xd'));var deskjs=require(_0x1a20('0xe'));var toCsv=require(_0x1a20('0x8'));var querystring=require('querystring');var Papa=require(_0x1a20('0xf'));var Redis=require(_0x1a20('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a20('0x11'));var hardwareService=require(_0x1a20('0x12'));var logger=require('../../config/logger')(_0x1a20('0x13'));var utils=require(_0x1a20('0x14'));var config=require(_0x1a20('0x15'));var licenseUtil=require(_0x1a20('0x16'));var db=require(_0x1a20('0x17'))['db'];function respondWithStatusCode(_0x5a3131,_0x169f78){_0x169f78=_0x169f78||0xcc;return function(_0x4275aa){if(_0x4275aa){return _0x5a3131['sendStatus'](_0x169f78);}return _0x5a3131['status'](_0x169f78)[_0x1a20('0x18')]();};}function respondWithResult(_0x406a82,_0x20fff6){_0x20fff6=_0x20fff6||0xc8;return function(_0x2df74b){if(_0x2df74b){return _0x406a82['status'](_0x20fff6)[_0x1a20('0x19')](_0x2df74b);}};}function respondWithFilteredResult(_0x2e8241,_0x18b4ef){return function(_0xcd73d2){if(_0xcd73d2){var _0x1ae80f=typeof _0x18b4ef[_0x1a20('0x1a')]==='undefined'&&typeof _0x18b4ef[_0x1a20('0x1b')]===_0x1a20('0x1c');var _0x9ee6a7=_0xcd73d2[_0x1a20('0x1d')];var _0x490c8d=_0x1ae80f?0x0:_0x18b4ef[_0x1a20('0x1a')];var _0x3b2ea0=_0x1ae80f?_0xcd73d2[_0x1a20('0x1d')]:_0x18b4ef[_0x1a20('0x1a')]+_0x18b4ef[_0x1a20('0x1b')];var _0x446a72;if(_0x3b2ea0>=_0x9ee6a7){_0x3b2ea0=_0x9ee6a7;_0x446a72=0xc8;}else{_0x446a72=0xce;}_0x2e8241[_0x1a20('0x1e')](_0x446a72);return _0x2e8241[_0x1a20('0x1f')]('Content-Range',_0x490c8d+'-'+_0x3b2ea0+'/'+_0x9ee6a7)[_0x1a20('0x19')](_0xcd73d2);}return null;};}function patchUpdates(_0x46ec9e){return function(_0x2604d7){try{jsonpatch['apply'](_0x2604d7,_0x46ec9e,!![]);}catch(_0x7ece1f){return BPromise[_0x1a20('0x20')](_0x7ece1f);}return _0x2604d7[_0x1a20('0x21')]();};}function saveUpdates(_0x1005f5,_0x367da5){return function(_0xe1038d){if(_0xe1038d){return _0xe1038d[_0x1a20('0x22')](_0x1005f5)[_0x1a20('0x23')](function(_0x32b5ea){return _0x32b5ea;});}return null;};}function removeEntity(_0x1e5c3f,_0xa43b9c){return function(_0x302382){if(_0x302382){return _0x302382[_0x1a20('0x24')]()[_0x1a20('0x23')](function(){_0x1e5c3f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x548a52,_0x1417e2){return function(_0x55b650){if(!_0x55b650){_0x548a52[_0x1a20('0x25')](0x194);}return _0x55b650;};}function handleError(_0x36168c,_0x3f2b53){_0x3f2b53=_0x3f2b53||0x1f4;return function(_0x897e71){logger[_0x1a20('0x26')](_0x897e71[_0x1a20('0x27')]);if(_0x897e71[_0x1a20('0x28')]){delete _0x897e71[_0x1a20('0x28')];}_0x36168c[_0x1a20('0x1e')](_0x3f2b53)['send'](_0x897e71);};}exports[_0x1a20('0x29')]=function(_0x1695c4,_0x346df2){var _0x400eaf={},_0x426977={},_0x4daaec={'count':0x0,'rows':[]};var _0x240a7d=_[_0x1a20('0x2a')](db[_0x1a20('0x2b')][_0x1a20('0x2c')],function(_0x4fa405){return{'name':_0x4fa405['fieldName'],'type':_0x4fa405[_0x1a20('0x2d')][_0x1a20('0x2e')]};});_0x426977[_0x1a20('0x2f')]=_['map'](_0x240a7d,'name');_0x426977[_0x1a20('0x30')]=_[_0x1a20('0x31')](_0x1695c4[_0x1a20('0x30')]);_0x426977['filters']=_[_0x1a20('0x32')](_0x426977[_0x1a20('0x2f')],_0x426977['query']);_0x400eaf[_0x1a20('0x33')]=_[_0x1a20('0x32')](_0x426977[_0x1a20('0x2f')],qs['fields'](_0x1695c4[_0x1a20('0x30')][_0x1a20('0x34')]));_0x400eaf['attributes']=_0x400eaf[_0x1a20('0x33')][_0x1a20('0x35')]?_0x400eaf['attributes']:_0x426977[_0x1a20('0x2f')];if(!_0x1695c4[_0x1a20('0x30')][_0x1a20('0x36')](_0x1a20('0x37'))){_0x400eaf[_0x1a20('0x1b')]=qs[_0x1a20('0x1b')](_0x1695c4[_0x1a20('0x30')][_0x1a20('0x1b')]);_0x400eaf[_0x1a20('0x1a')]=qs['offset'](_0x1695c4[_0x1a20('0x30')]['offset']);}_0x400eaf[_0x1a20('0x38')]=qs[_0x1a20('0x39')](_0x1695c4['query'][_0x1a20('0x39')]);_0x400eaf[_0x1a20('0x3a')]=qs[_0x1a20('0x3b')](_[_0x1a20('0x3c')](_0x1695c4[_0x1a20('0x30')],_0x426977[_0x1a20('0x3b')]),_0x240a7d);if(_0x1695c4[_0x1a20('0x30')][_0x1a20('0x3d')]){_0x400eaf['where']=_[_0x1a20('0x3e')](_0x400eaf[_0x1a20('0x3a')],{'$or':_[_0x1a20('0x2a')](_0x240a7d,function(_0x3fffe8){if(_0x3fffe8['type']!==_0x1a20('0x3f')){var _0x19b8ef={};_0x19b8ef[_0x3fffe8['name']]={'$like':'%'+_0x1695c4[_0x1a20('0x30')][_0x1a20('0x3d')]+'%'};return _0x19b8ef;}})});}_0x400eaf=_[_0x1a20('0x3e')]({},_0x400eaf,_0x1695c4[_0x1a20('0x40')]);var _0x1b96ae={'where':_0x400eaf[_0x1a20('0x3a')]};return db[_0x1a20('0x2b')][_0x1a20('0x1d')](_0x1b96ae)[_0x1a20('0x23')](function(_0x46e17c){_0x4daaec[_0x1a20('0x1d')]=_0x46e17c;if(_0x1695c4['query'][_0x1a20('0x41')]){_0x400eaf['include']=[{'all':!![]}];}return db[_0x1a20('0x2b')]['findAll'](_0x400eaf);})[_0x1a20('0x23')](function(_0x4473c3){_0x4daaec['rows']=_0x4473c3;return _0x4daaec;})['then'](respondWithFilteredResult(_0x346df2,_0x400eaf))[_0x1a20('0x42')](handleError(_0x346df2,null));};exports[_0x1a20('0x43')]=function(_0x59396b,_0x14a5ba){var _0x370026={'raw':!![],'where':{'id':_0x59396b['params']['id']}},_0x2fcfe4={};_0x2fcfe4[_0x1a20('0x2f')]=_[_0x1a20('0x31')](db['CmHopperBlack'][_0x1a20('0x2c')]);_0x2fcfe4['query']=_[_0x1a20('0x31')](_0x59396b['query']);_0x2fcfe4[_0x1a20('0x3b')]=_[_0x1a20('0x32')](_0x2fcfe4[_0x1a20('0x2f')],_0x2fcfe4[_0x1a20('0x30')]);_0x370026['attributes']=_[_0x1a20('0x32')](_0x2fcfe4[_0x1a20('0x2f')],qs[_0x1a20('0x34')](_0x59396b[_0x1a20('0x30')][_0x1a20('0x34')]));_0x370026['attributes']=_0x370026['attributes'][_0x1a20('0x35')]?_0x370026['attributes']:_0x2fcfe4[_0x1a20('0x2f')];if(_0x59396b[_0x1a20('0x30')]['includeAll']){_0x370026[_0x1a20('0x44')]=[{'all':!![]}];}_0x370026=_['merge']({},_0x370026,_0x59396b['options']);return db[_0x1a20('0x2b')][_0x1a20('0x45')](_0x370026)[_0x1a20('0x23')](handleEntityNotFound(_0x14a5ba,null))[_0x1a20('0x23')](respondWithResult(_0x14a5ba,null))[_0x1a20('0x42')](handleError(_0x14a5ba,null));};exports[_0x1a20('0x22')]=function(_0x4d83e7,_0x1a5e7e){if(_0x4d83e7[_0x1a20('0x46')]['id']){delete _0x4d83e7['body']['id'];}return db[_0x1a20('0x2b')][_0x1a20('0x45')]({'where':{'id':_0x4d83e7[_0x1a20('0x47')]['id']}})[_0x1a20('0x23')](handleEntityNotFound(_0x1a5e7e,null))[_0x1a20('0x23')](saveUpdates(_0x4d83e7[_0x1a20('0x46')],null))[_0x1a20('0x23')](respondWithResult(_0x1a5e7e,null))[_0x1a20('0x42')](handleError(_0x1a5e7e,null));};exports['destroy']=function(_0x13ef2f,_0x2a18d9){return db['CmHopperBlack'][_0x1a20('0x45')]({'where':{'id':_0x13ef2f['params']['id']}})[_0x1a20('0x23')](handleEntityNotFound(_0x2a18d9,null))[_0x1a20('0x23')](removeEntity(_0x2a18d9,null))[_0x1a20('0x42')](handleError(_0x2a18d9,null));};exports[_0x1a20('0x48')]=function(_0xb470ed,_0x4e9734){return db[_0x1a20('0x2b')][_0x1a20('0x48')]()[_0x1a20('0x23')](respondWithResult(_0x4e9734,null))['catch'](handleError(_0x4e9734,null));}; \ No newline at end of file +var _0xbade=['fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','end','stack','name','send','index','map','CmHopperBlack','rawAttributes'];(function(_0x40f5ba,_0x3efba3){var _0x5197b7=function(_0x4e032b){while(--_0x4e032b){_0x40f5ba['push'](_0x40f5ba['shift']());}};_0x5197b7(++_0x3efba3);}(_0xbade,0x1ce));var _0xebad=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xbade[_0x5f5cce];return _0x705ecf;};'use strict';var emlformat=require(_0xebad('0x0'));var rimraf=require(_0xebad('0x1'));var zipdir=require(_0xebad('0x2'));var jsonpatch=require(_0xebad('0x3'));var rp=require('request-promise');var moment=require(_0xebad('0x4'));var BPromise=require(_0xebad('0x5'));var Mustache=require(_0xebad('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xebad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xebad('0x8'));var crypto=require(_0xebad('0x9'));var jsforce=require(_0xebad('0xa'));var deskjs=require(_0xebad('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xebad('0xc'));var Redis=require(_0xebad('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xebad('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xebad('0xf'))(_0xebad('0x10'));var utils=require(_0xebad('0x11'));var config=require(_0xebad('0x12'));var licenseUtil=require(_0xebad('0x13'));var db=require(_0xebad('0x14'))['db'];function respondWithStatusCode(_0x24618a,_0x371738){_0x371738=_0x371738||0xcc;return function(_0x55e571){if(_0x55e571){return _0x24618a[_0xebad('0x15')](_0x371738);}return _0x24618a[_0xebad('0x16')](_0x371738)['end']();};}function respondWithResult(_0x630e5f,_0x599c02){_0x599c02=_0x599c02||0xc8;return function(_0x25dd13){if(_0x25dd13){return _0x630e5f[_0xebad('0x16')](_0x599c02)['json'](_0x25dd13);}};}function respondWithFilteredResult(_0x28f1d3,_0x57067e){return function(_0x364436){if(_0x364436){var _0x5c98f2=typeof _0x57067e[_0xebad('0x17')]===_0xebad('0x18')&&typeof _0x57067e[_0xebad('0x19')]===_0xebad('0x18');var _0x4f5807=_0x364436[_0xebad('0x1a')];var _0xb28f3=_0x5c98f2?0x0:_0x57067e['offset'];var _0x2dfc2a=_0x5c98f2?_0x364436[_0xebad('0x1a')]:_0x57067e[_0xebad('0x17')]+_0x57067e['limit'];var _0x483283;if(_0x2dfc2a>=_0x4f5807){_0x2dfc2a=_0x4f5807;_0x483283=0xc8;}else{_0x483283=0xce;}_0x28f1d3[_0xebad('0x16')](_0x483283);return _0x28f1d3[_0xebad('0x1b')](_0xebad('0x1c'),_0xb28f3+'-'+_0x2dfc2a+'/'+_0x4f5807)[_0xebad('0x1d')](_0x364436);}return null;};}function patchUpdates(_0x4854b3){return function(_0xdf20f5){try{jsonpatch[_0xebad('0x1e')](_0xdf20f5,_0x4854b3,!![]);}catch(_0x42dbdf){return BPromise['reject'](_0x42dbdf);}return _0xdf20f5[_0xebad('0x1f')]();};}function saveUpdates(_0x5ad594,_0x28c87b){return function(_0x146515){if(_0x146515){return _0x146515['update'](_0x5ad594)[_0xebad('0x20')](function(_0x5a241d){return _0x5a241d;});}return null;};}function removeEntity(_0x1c6577,_0x2d9c7a){return function(_0x30fa50){if(_0x30fa50){return _0x30fa50[_0xebad('0x21')]()[_0xebad('0x20')](function(){_0x1c6577[_0xebad('0x16')](0xcc)[_0xebad('0x22')]();});}};}function handleEntityNotFound(_0x12c181,_0x2809f7){return function(_0x329552){if(!_0x329552){_0x12c181[_0xebad('0x15')](0x194);}return _0x329552;};}function handleError(_0xdf1bee,_0x47d28a){_0x47d28a=_0x47d28a||0x1f4;return function(_0x223bf8){logger['error'](_0x223bf8[_0xebad('0x23')]);if(_0x223bf8['name']){delete _0x223bf8[_0xebad('0x24')];}_0xdf1bee['status'](_0x47d28a)[_0xebad('0x25')](_0x223bf8);};}exports[_0xebad('0x26')]=function(_0x39cd9f,_0x4a6009){var _0x5103a1={},_0x564826={},_0x45f9be={'count':0x0,'rows':[]};var _0x1380a3=_[_0xebad('0x27')](db[_0xebad('0x28')][_0xebad('0x29')],function(_0x10aa41){return{'name':_0x10aa41[_0xebad('0x2a')],'type':_0x10aa41[_0xebad('0x2b')][_0xebad('0x2c')]};});_0x564826['model']=_[_0xebad('0x27')](_0x1380a3,'name');_0x564826[_0xebad('0x2d')]=_[_0xebad('0x2e')](_0x39cd9f[_0xebad('0x2d')]);_0x564826['filters']=_[_0xebad('0x2f')](_0x564826[_0xebad('0x30')],_0x564826[_0xebad('0x2d')]);_0x5103a1[_0xebad('0x31')]=_[_0xebad('0x2f')](_0x564826[_0xebad('0x30')],qs[_0xebad('0x32')](_0x39cd9f[_0xebad('0x2d')][_0xebad('0x32')]));_0x5103a1['attributes']=_0x5103a1[_0xebad('0x31')][_0xebad('0x33')]?_0x5103a1[_0xebad('0x31')]:_0x564826[_0xebad('0x30')];if(!_0x39cd9f[_0xebad('0x2d')][_0xebad('0x34')](_0xebad('0x35'))){_0x5103a1[_0xebad('0x19')]=qs[_0xebad('0x19')](_0x39cd9f[_0xebad('0x2d')][_0xebad('0x19')]);_0x5103a1['offset']=qs[_0xebad('0x17')](_0x39cd9f[_0xebad('0x2d')][_0xebad('0x17')]);}_0x5103a1[_0xebad('0x36')]=qs[_0xebad('0x37')](_0x39cd9f['query'][_0xebad('0x37')]);_0x5103a1['where']=qs[_0xebad('0x38')](_[_0xebad('0x39')](_0x39cd9f[_0xebad('0x2d')],_0x564826[_0xebad('0x38')]),_0x1380a3);if(_0x39cd9f[_0xebad('0x2d')][_0xebad('0x3a')]){_0x5103a1[_0xebad('0x3b')]=_[_0xebad('0x3c')](_0x5103a1['where'],{'$or':_[_0xebad('0x27')](_0x1380a3,function(_0x4feaba){if(_0x4feaba[_0xebad('0x2b')]!==_0xebad('0x3d')){var _0x11433c={};_0x11433c[_0x4feaba['name']]={'$like':'%'+_0x39cd9f[_0xebad('0x2d')][_0xebad('0x3a')]+'%'};return _0x11433c;}})});}_0x5103a1=_[_0xebad('0x3c')]({},_0x5103a1,_0x39cd9f['options']);var _0x3e85bd={'where':_0x5103a1[_0xebad('0x3b')]};return db[_0xebad('0x28')][_0xebad('0x1a')](_0x3e85bd)[_0xebad('0x20')](function(_0x168f14){_0x45f9be[_0xebad('0x1a')]=_0x168f14;if(_0x39cd9f[_0xebad('0x2d')][_0xebad('0x3e')]){_0x5103a1['include']=[{'all':!![]}];}return db[_0xebad('0x28')]['findAll'](_0x5103a1);})[_0xebad('0x20')](function(_0x508ae7){_0x45f9be[_0xebad('0x3f')]=_0x508ae7;return _0x45f9be;})['then'](respondWithFilteredResult(_0x4a6009,_0x5103a1))[_0xebad('0x40')](handleError(_0x4a6009,null));};exports[_0xebad('0x41')]=function(_0x19ab22,_0x2dfd5e){var _0xd6ae04={'raw':!![],'where':{'id':_0x19ab22[_0xebad('0x42')]['id']}},_0x38496a={};_0x38496a['model']=_['keys'](db['CmHopperBlack'][_0xebad('0x29')]);_0x38496a[_0xebad('0x2d')]=_[_0xebad('0x2e')](_0x19ab22[_0xebad('0x2d')]);_0x38496a[_0xebad('0x38')]=_[_0xebad('0x2f')](_0x38496a[_0xebad('0x30')],_0x38496a[_0xebad('0x2d')]);_0xd6ae04[_0xebad('0x31')]=_[_0xebad('0x2f')](_0x38496a[_0xebad('0x30')],qs['fields'](_0x19ab22[_0xebad('0x2d')]['fields']));_0xd6ae04['attributes']=_0xd6ae04[_0xebad('0x31')]['length']?_0xd6ae04[_0xebad('0x31')]:_0x38496a[_0xebad('0x30')];if(_0x19ab22[_0xebad('0x2d')][_0xebad('0x3e')]){_0xd6ae04[_0xebad('0x43')]=[{'all':!![]}];}_0xd6ae04=_[_0xebad('0x3c')]({},_0xd6ae04,_0x19ab22['options']);return db[_0xebad('0x28')]['find'](_0xd6ae04)[_0xebad('0x20')](handleEntityNotFound(_0x2dfd5e,null))[_0xebad('0x20')](respondWithResult(_0x2dfd5e,null))[_0xebad('0x40')](handleError(_0x2dfd5e,null));};exports[_0xebad('0x44')]=function(_0x5cc982,_0x45d025){if(_0x5cc982[_0xebad('0x45')]['id']){delete _0x5cc982[_0xebad('0x45')]['id'];}return db['CmHopperBlack'][_0xebad('0x46')]({'where':{'id':_0x5cc982[_0xebad('0x42')]['id']}})[_0xebad('0x20')](handleEntityNotFound(_0x45d025,null))[_0xebad('0x20')](saveUpdates(_0x5cc982[_0xebad('0x45')],null))['then'](respondWithResult(_0x45d025,null))[_0xebad('0x40')](handleError(_0x45d025,null));};exports['destroy']=function(_0x53f638,_0x46279a){return db[_0xebad('0x28')][_0xebad('0x46')]({'where':{'id':_0x53f638[_0xebad('0x42')]['id']}})[_0xebad('0x20')](handleEntityNotFound(_0x46279a,null))[_0xebad('0x20')](removeEntity(_0x46279a,null))['catch'](handleError(_0x46279a,null));};exports[_0xebad('0x47')]=function(_0x9c740a,_0x51a650){return db['CmHopperBlack'][_0xebad('0x47')]()[_0xebad('0x20')](respondWithResult(_0x51a650,null))[_0xebad('0x40')](handleError(_0x51a650,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1f96bcf..c546de5 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80da=['exports','define','CmHopperBlack','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x15e47f,_0x9799d){var _0x41f7b1=function(_0x2d7abc){while(--_0x2d7abc){_0x15e47f['push'](_0x15e47f['shift']());}};_0x41f7b1(++_0x9799d);}(_0x80da,0x85));var _0xa80d=function(_0x1b31d5,_0x112bb2){_0x1b31d5=_0x1b31d5-0x0;var _0x6084e9=_0x80da[_0x1b31d5];return _0x6084e9;};'use strict';var _=require(_0xa80d('0x0'));var util=require('util');var logger=require(_0xa80d('0x1'))(_0xa80d('0x2'));var moment=require(_0xa80d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa80d('0x4'));var rimraf=require(_0xa80d('0x5'));var config=require(_0xa80d('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0xa80d('0x7')]=function(_0x58f404,_0xbfaeb6){return _0x58f404[_0xa80d('0x8')](_0xa80d('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd27b=['cm_hopper_black','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xd27b,0x161));var _0xbd27=function(_0x328ac9,_0x2f7225){_0x328ac9=_0x328ac9-0x0;var _0x2b3a0a=_0xd27b[_0x328ac9];return _0x2b3a0a;};'use strict';var _=require(_0xbd27('0x0'));var util=require('util');var logger=require(_0xbd27('0x1'))('api');var moment=require(_0xbd27('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd27('0x3'));var rimraf=require(_0xbd27('0x4'));var config=require(_0xbd27('0x5'));var attributes=require(_0xbd27('0x6'));module[_0xbd27('0x7')]=function(_0x1c22ff,_0x2be0b7){return _0x1c22ff[_0xbd27('0x8')](_0xbd27('0x9'),attributes,{'tableName':_0xbd27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 6c9bfd9..49e7514 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c06=['attributes','limit','include','map','model','then','info','catch','GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperBlack','findAll','options','raw','where'];(function(_0x5ecb9d,_0x19de24){var _0x275238=function(_0x13d009){while(--_0x13d009){_0x5ecb9d['push'](_0x5ecb9d['shift']());}};_0x275238(++_0x19de24);}(_0x3c06,0x80));var _0x63c0=function(_0x5b2a20,_0x53a830){_0x5b2a20=_0x5b2a20-0x0;var _0x9d623a=_0x3c06[_0x5b2a20];return _0x9d623a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63c0('0x0'));var BPromise=require(_0x63c0('0x1'));var rs=require(_0x63c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63c0('0x3'))['db'];var utils=require(_0x63c0('0x4'));var logger=require('../../config/logger')(_0x63c0('0x5'));var config=require(_0x63c0('0x6'));var jayson=require(_0x63c0('0x7'));var client=jayson[_0x63c0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x120e3f,_0x344dde,_0x5542e2){return new BPromise(function(_0x39dbd9,_0x2e0267){return client[_0x63c0('0x9')](_0x120e3f,_0x5542e2)['then'](function(_0x4516d1){logger['info'](_0x63c0('0xa'),_0x344dde,_0x63c0('0xb'));logger[_0x63c0('0xc')](_0x63c0('0xd'),_0x344dde,'request\x20sent',JSON[_0x63c0('0xe')](_0x4516d1));if(_0x4516d1['error']){if(_0x4516d1[_0x63c0('0xf')][_0x63c0('0x10')]===0x1f4){logger[_0x63c0('0xf')](_0x63c0('0xa'),_0x344dde,_0x4516d1['error'][_0x63c0('0x11')]);return _0x2e0267(_0x4516d1[_0x63c0('0xf')][_0x63c0('0x11')]);}logger[_0x63c0('0xf')](_0x63c0('0xa'),_0x344dde,_0x4516d1['error'][_0x63c0('0x11')]);return _0x39dbd9(_0x4516d1['error'][_0x63c0('0x11')]);}else{logger['info'](_0x63c0('0xa'),_0x344dde,_0x63c0('0xb'));_0x39dbd9(_0x4516d1[_0x63c0('0x12')][_0x63c0('0x11')]);}})['catch'](function(_0x551a6f){logger[_0x63c0('0xf')](_0x63c0('0xa'),_0x344dde,_0x551a6f);_0x2e0267(_0x551a6f);});});}exports['GetCmHopperBlack']=function(_0x2057b0){var _0x36fad7=this;return new Promise(function(_0x2e1bcb,_0x35fd9a){return db[_0x63c0('0x13')][_0x63c0('0x14')]({'raw':_0x2057b0[_0x63c0('0x15')]?_0x2057b0['options'][_0x63c0('0x16')]===undefined?!![]:![]:!![],'where':_0x2057b0[_0x63c0('0x15')]?_0x2057b0['options'][_0x63c0('0x17')]||null:null,'attributes':_0x2057b0[_0x63c0('0x15')]?_0x2057b0[_0x63c0('0x15')][_0x63c0('0x18')]||null:null,'limit':_0x2057b0[_0x63c0('0x15')]?_0x2057b0['options'][_0x63c0('0x19')]||null:null,'include':_0x2057b0[_0x63c0('0x15')]?_0x2057b0[_0x63c0('0x15')][_0x63c0('0x1a')]?_[_0x63c0('0x1b')](_0x2057b0[_0x63c0('0x15')][_0x63c0('0x1a')],function(_0x22b0a1){return{'model':db[_0x22b0a1[_0x63c0('0x1c')]],'as':_0x22b0a1['as'],'attributes':_0x22b0a1[_0x63c0('0x18')],'include':_0x22b0a1[_0x63c0('0x1a')]?_[_0x63c0('0x1b')](_0x22b0a1[_0x63c0('0x1a')],function(_0x128f15){return{'model':db[_0x128f15[_0x63c0('0x1c')]],'as':_0x128f15['as'],'attributes':_0x128f15[_0x63c0('0x18')],'include':_0x128f15[_0x63c0('0x1a')]?_['map'](_0x128f15[_0x63c0('0x1a')],function(_0x12b2e5){return{'model':db[_0x12b2e5[_0x63c0('0x1c')]],'as':_0x12b2e5['as'],'attributes':_0x12b2e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x63c0('0x1d')](function(_0x234fd1){logger[_0x63c0('0x1e')]('GetCmHopperBlack',_0x2057b0);logger[_0x63c0('0xc')]('GetCmHopperBlack',_0x2057b0,JSON[_0x63c0('0xe')](_0x234fd1));_0x2e1bcb(_0x234fd1);})[_0x63c0('0x1f')](function(_0x55d1f8){logger['error'](_0x63c0('0x20'),_0x55d1f8[_0x63c0('0x11')],_0x2057b0);_0x35fd9a(_0x36fad7[_0x63c0('0xf')](0x1f4,_0x55d1f8['message']));});});};exports[_0x63c0('0x21')]=function(_0x16f9ad){var _0x48a96a=this;return new Promise(function(_0x36e217,_0x10e94c){return db[_0x63c0('0x13')][_0x63c0('0x22')](_0x16f9ad[_0x63c0('0x23')],{'raw':_0x16f9ad[_0x63c0('0x15')]?_0x16f9ad['options'][_0x63c0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16f9ad['options']?_0x16f9ad['options']['where']||null:null,'attributes':_0x16f9ad[_0x63c0('0x15')]?_0x16f9ad['options'][_0x63c0('0x18')]||null:null,'limit':_0x16f9ad[_0x63c0('0x15')]?_0x16f9ad['options'][_0x63c0('0x19')]||null:null})[_0x63c0('0x1d')](function(_0x94fc80){logger[_0x63c0('0x1e')](_0x63c0('0x21'),_0x16f9ad);logger[_0x63c0('0xc')](_0x63c0('0x21'),_0x16f9ad,JSON[_0x63c0('0xe')](_0x94fc80));_0x36e217(_0x94fc80);})[_0x63c0('0x1f')](function(_0x44d02f){logger['error'](_0x63c0('0x21'),_0x44d02f['message'],_0x16f9ad);_0x10e94c(_0x48a96a[_0x63c0('0xf')](0x1f4,_0x44d02f[_0x63c0('0x11')]));});});};exports[_0x63c0('0x24')]=function(_0x1b051a){var _0x2623e5=this;return new Promise(function(_0x22b0fc,_0x4a3290){return db[_0x63c0('0x13')][_0x63c0('0x25')]({'where':_0x1b051a[_0x63c0('0x15')]?_0x1b051a[_0x63c0('0x15')][_0x63c0('0x17')]||null:null})[_0x63c0('0x1d')](function(_0x5bb6d0){logger[_0x63c0('0x1e')](_0x63c0('0x24'),_0x1b051a);logger['debug']('DestroyCmHopperBlack',_0x1b051a,JSON[_0x63c0('0xe')](_0x5bb6d0));_0x22b0fc(_0x5bb6d0);})[_0x63c0('0x1f')](function(_0x20b9eb){logger['error'](_0x63c0('0x24'),_0x20b9eb[_0x63c0('0x11')],_0x1b051a);_0x4a3290(_0x2623e5[_0x63c0('0xf')](0x1f4,_0x20b9eb['message']));});});}; \ No newline at end of file +var _0xac77=['limit','include','map','model','attributes','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where'];(function(_0x30e4e5,_0x313702){var _0x17ebb1=function(_0x2dba30){while(--_0x2dba30){_0x30e4e5['push'](_0x30e4e5['shift']());}};_0x17ebb1(++_0x313702);}(_0xac77,0x121));var _0x7ac7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xac77[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0x7ac7('0x0'));var moment=require(_0x7ac7('0x1'));var BPromise=require(_0x7ac7('0x2'));var rs=require(_0x7ac7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ac7('0x4'));var logger=require(_0x7ac7('0x5'))(_0x7ac7('0x6'));var config=require(_0x7ac7('0x7'));var jayson=require(_0x7ac7('0x8'));var client=jayson['client'][_0x7ac7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d20d8,_0x272f54,_0x961701){return new BPromise(function(_0x126de9,_0x2ec9c8){return client[_0x7ac7('0xa')](_0x3d20d8,_0x961701)['then'](function(_0x38a47d){logger[_0x7ac7('0xb')](_0x7ac7('0xc'),_0x272f54,_0x7ac7('0xd'));logger[_0x7ac7('0xe')](_0x7ac7('0xf'),_0x272f54,_0x7ac7('0xd'),JSON[_0x7ac7('0x10')](_0x38a47d));if(_0x38a47d['error']){if(_0x38a47d[_0x7ac7('0x11')]['code']===0x1f4){logger[_0x7ac7('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x272f54,_0x38a47d['error']['message']);return _0x2ec9c8(_0x38a47d[_0x7ac7('0x11')][_0x7ac7('0x12')]);}logger[_0x7ac7('0x11')](_0x7ac7('0xc'),_0x272f54,_0x38a47d['error'][_0x7ac7('0x12')]);return _0x126de9(_0x38a47d[_0x7ac7('0x11')][_0x7ac7('0x12')]);}else{logger['info'](_0x7ac7('0xc'),_0x272f54,_0x7ac7('0xd'));_0x126de9(_0x38a47d['result'][_0x7ac7('0x12')]);}})[_0x7ac7('0x13')](function(_0x4785f6){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x272f54,_0x4785f6);_0x2ec9c8(_0x4785f6);});});}exports[_0x7ac7('0x14')]=function(_0x2b822f){var _0x3a7298=this;return new Promise(function(_0x5476ac,_0x2b7736){return db[_0x7ac7('0x15')][_0x7ac7('0x16')]({'raw':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x18')]===undefined?!![]:![]:!![],'where':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x19')]||null:null,'attributes':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')]['attributes']||null:null,'limit':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x1a')]||null:null,'include':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x1b')]?_[_0x7ac7('0x1c')](_0x2b822f[_0x7ac7('0x17')]['include'],function(_0x4554da){return{'model':db[_0x4554da[_0x7ac7('0x1d')]],'as':_0x4554da['as'],'attributes':_0x4554da[_0x7ac7('0x1e')],'include':_0x4554da[_0x7ac7('0x1b')]?_[_0x7ac7('0x1c')](_0x4554da[_0x7ac7('0x1b')],function(_0x40005f){return{'model':db[_0x40005f['model']],'as':_0x40005f['as'],'attributes':_0x40005f[_0x7ac7('0x1e')],'include':_0x40005f['include']?_['map'](_0x40005f[_0x7ac7('0x1b')],function(_0x25d1dd){return{'model':db[_0x25d1dd[_0x7ac7('0x1d')]],'as':_0x25d1dd['as'],'attributes':_0x25d1dd[_0x7ac7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7ac7('0x1f')](function(_0x505020){logger[_0x7ac7('0xb')](_0x7ac7('0x14'),_0x2b822f);logger[_0x7ac7('0xe')]('GetCmHopperBlack',_0x2b822f,JSON['stringify'](_0x505020));_0x5476ac(_0x505020);})['catch'](function(_0x231490){logger[_0x7ac7('0x11')]('GetCmHopperBlack',_0x231490['message'],_0x2b822f);_0x2b7736(_0x3a7298[_0x7ac7('0x11')](0x1f4,_0x231490[_0x7ac7('0x12')]));});});};exports[_0x7ac7('0x20')]=function(_0x520191){var _0x2d3d8b=this;return new Promise(function(_0x6ba91d,_0x5319a4){return db[_0x7ac7('0x15')]['update'](_0x520191['body'],{'raw':_0x520191[_0x7ac7('0x17')]?_0x520191['options'][_0x7ac7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x520191['options']?_0x520191[_0x7ac7('0x17')][_0x7ac7('0x19')]||null:null,'attributes':_0x520191['options']?_0x520191[_0x7ac7('0x17')][_0x7ac7('0x1e')]||null:null,'limit':_0x520191[_0x7ac7('0x17')]?_0x520191[_0x7ac7('0x17')][_0x7ac7('0x1a')]||null:null})['then'](function(_0xc078d4){logger[_0x7ac7('0xb')]('UpdateCmHopperBlack',_0x520191);logger[_0x7ac7('0xe')]('UpdateCmHopperBlack',_0x520191,JSON[_0x7ac7('0x10')](_0xc078d4));_0x6ba91d(_0xc078d4);})['catch'](function(_0xe7b5e0){logger['error'](_0x7ac7('0x20'),_0xe7b5e0['message'],_0x520191);_0x5319a4(_0x2d3d8b['error'](0x1f4,_0xe7b5e0[_0x7ac7('0x12')]));});});};exports[_0x7ac7('0x21')]=function(_0x173bdd){var _0x5107df=this;return new Promise(function(_0x5b470e,_0x1863d4){return db[_0x7ac7('0x15')][_0x7ac7('0x22')]({'where':_0x173bdd[_0x7ac7('0x17')]?_0x173bdd['options'][_0x7ac7('0x19')]||null:null})[_0x7ac7('0x1f')](function(_0x4d9f26){logger[_0x7ac7('0xb')](_0x7ac7('0x21'),_0x173bdd);logger[_0x7ac7('0xe')](_0x7ac7('0x21'),_0x173bdd,JSON[_0x7ac7('0x10')](_0x4d9f26));_0x5b470e(_0x4d9f26);})[_0x7ac7('0x13')](function(_0x3c6ce4){logger[_0x7ac7('0x11')](_0x7ac7('0x21'),_0x3c6ce4[_0x7ac7('0x12')],_0x173bdd);_0x1863d4(_0x5107df[_0x7ac7('0x11')](0x1f4,_0x3c6ce4[_0x7ac7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index d880019..ccac2c6 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['/describe','describe','/:id','put','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'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('./cmHopperBlack.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')](_0xee2f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1261=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','index','get','isAuthenticated','describe','/:id','put','delete','destroy'];(function(_0x4815dd,_0x3abac5){var _0x2c4c6a=function(_0x382cc){while(--_0x382cc){_0x4815dd['push'](_0x4815dd['shift']());}};_0x2c4c6a(++_0x3abac5);}(_0x1261,0x144));var _0x1126=function(_0x2384bb,_0x12f81b){_0x2384bb=_0x2384bb-0x0;var _0x3f2bac=_0x1261[_0x2384bb];return _0x3f2bac;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['update']);router[_0x1126('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7a65f24..2540198 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9540=['INTEGER','STRING','DATE','endtime','followuptime','diff','seconds','BOOLEAN','moment'];(function(_0x47eac6,_0x2851e7){var _0x591170=function(_0x192155){while(--_0x192155){_0x47eac6['push'](_0x47eac6['shift']());}};_0x591170(++_0x2851e7);}(_0x9540,0x8f));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0954('0x0'));module['exports']={'state':{'type':Sequelize[_0x0954('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0954('0x2')]},'scheduledat':{'type':Sequelize[_0x0954('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0954('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x0954('0x2')]},'calleridnum':{'type':Sequelize[_0x0954('0x2')]},'calleridname':{'type':Sequelize[_0x0954('0x2')]},'starttime':{'type':Sequelize[_0x0954('0x3')]},'responsetime':{'type':Sequelize[_0x0954('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0954('0x3')]},'ringtime':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0954('0x2')]},'campaign':{'type':Sequelize[_0x0954('0x2')]},'campaigntype':{'type':Sequelize[_0x0954('0x2')]},'membername':{'type':Sequelize[_0x0954('0x2')]},'reason':{'type':Sequelize[_0x0954('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0954('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0954('0x2')]},'dispositionat':{'type':Sequelize[_0x0954('0x3')],'set':function(_0x5138ad){var _0x29fbde=this['getDataValue'](_0x0954('0x4'));if(_0x29fbde&&_0x5138ad){this['setDataValue'](_0x0954('0x5'),moment(_0x5138ad)[_0x0954('0x6')](moment(_0x29fbde),_0x0954('0x7')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0954('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0954('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0954('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0954('0x3')]},'callback':{'type':Sequelize[_0x0954('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0954('0x3')]},'deleted':{'type':Sequelize[_0x0954('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0954('0x3')]},'recallme':{'type':Sequelize[_0x0954('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0954('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0954('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x761f=['DATE','endtime','setDataValue','followuptime','diff','BOOLEAN','moment','INTEGER','STRING'];(function(_0x31f15b,_0xa486f7){var _0x15e504=function(_0x137b00){while(--_0x137b00){_0x31f15b['push'](_0x31f15b['shift']());}};_0x15e504(++_0xa486f7);}(_0x761f,0xb1));var _0xf761=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0x761f[_0x127c7b];return _0x1708eb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf761('0x0'));module['exports']={'state':{'type':Sequelize[_0xf761('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf761('0x2')]},'scheduledat':{'type':Sequelize[_0xf761('0x3')]},'countbusyretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf761('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf761('0x2')]},'calleridnum':{'type':Sequelize[_0xf761('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf761('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf761('0x3')]},'droptime':{'type':Sequelize[_0xf761('0x3')]},'endtime':{'type':Sequelize[_0xf761('0x3')]},'ringtime':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf761('0x2')]},'campaign':{'type':Sequelize[_0xf761('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf761('0x2')]},'reason':{'type':Sequelize[_0xf761('0x2')]},'disposition':{'type':Sequelize[_0xf761('0x2')]},'secondDisposition':{'type':Sequelize[_0xf761('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf761('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x2747b3){var _0x3fea37=this['getDataValue'](_0xf761('0x4'));if(_0x3fea37&&_0x2747b3){this[_0xf761('0x5')](_0xf761('0x6'),moment(_0x2747b3)[_0xf761('0x7')](moment(_0x3fea37),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xf761('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf761('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf761('0x3')]},'callback':{'type':Sequelize[_0xf761('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf761('0x3')]},'deleted':{'type':Sequelize[_0xf761('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf761('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf761('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 92ea3ad..903e204 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x5d17,0x114));var _0x75d1=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x5d17[_0x366388];return _0x41c97e;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));}; \ No newline at end of file +var _0xadb5=['`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','VoiceQueue','find','insert','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','Campaign','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','VoiceQueueId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`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'];(function(_0x3d6570,_0x482f5f){var _0x30b1c5=function(_0x3b81f6){while(--_0x3b81f6){_0x3d6570['push'](_0x3d6570['shift']());}};_0x30b1c5(++_0x482f5f);}(_0xadb5,0xad));var _0x5adb=function(_0x3849e7,_0x1eb83c){_0x3849e7=_0x3849e7-0x0;var _0x3557fd=_0xadb5[_0x3849e7];return _0x3557fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CmHopperFinal']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')]()['then'](respondWithResult(_0x3a5409,null))[_0x5adb('0x42')](handleError(_0x3a5409,null));};exports['update']=function(_0x51bc49,_0x5015ee){if(_0x51bc49[_0x5adb('0x47')][_0x5adb('0x48')]){delete _0x51bc49[_0x5adb('0x47')]['uniqueid'];}return db[_0x5adb('0x2a')]['find']({'where':{'uniqueid':_0x51bc49[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x5015ee,null))[_0x5adb('0x22')](saveUpdates(_0x51bc49['body'],null))[_0x5adb('0x22')](respondWithResult(_0x5015ee,null))['catch'](handleError(_0x5015ee,null));};exports[_0x5adb('0x49')]=function(_0x6dc067,_0x55c535,_0x2402a3){return db[_0x5adb('0x2a')][_0x5adb('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x6dc067[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x4c')))),'noSuchContacts'],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize'][_0x5adb('0x4b')](_0x5adb('0x4e')))),_0x5adb('0x4f')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x52')))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),_0x5adb('0x58')],[db[_0x5adb('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})['then'](handleEntityNotFound(_0x55c535,null))[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x42')](handleError(_0x55c535,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5cb50e,_0x476e62,_0x1505f7){return db['CmHopperFinal'][_0x5adb('0x40')]({'raw':![],'where':{'CampaignId':_0x5cb50e[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x4c')))),_0x5adb('0x5b')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x5adb('0x4f')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})[_0x5adb('0x22')](handleEntityNotFound(_0x476e62,null))[_0x5adb('0x22')](respondWithResult(_0x476e62,null))[_0x5adb('0x42')](handleError(_0x476e62,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5e55c2,_0x1fc73b,_0x56df90){return db[_0x5adb('0x5c')][_0x5adb('0x5d')]({'where':{'id':_0x5e55c2[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x1fc73b,null))[_0x5adb('0x22')](function(_0x236f59){var _0x338aee;if(_0x236f59){_0x338aee=squel[_0x5adb('0x5e')]()['into'](_0x5adb('0x5f'))[_0x5adb('0x60')]([_0x5adb('0x61'),'scheduledAt',_0x5adb('0x62'),_0x5adb('0x63'),'VoiceQueueId',_0x5adb('0x64'),'updatedAt'],squel[_0x5adb('0x65')]()[_0x5adb('0x66')]('ANY_VALUE(calleridnum)',_0x5adb('0x61'))[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')]('ANY_VALUE(ListId)',_0x5adb('0x63'))[_0x5adb('0x66')](_0x5adb('0x6a'),'VoiceQueueId')['field'](_0x5adb('0x67'),'createdAt')[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x6b'))['from'](_0x5adb('0x6c'))[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())['where'](_0x5adb('0x6f'),_0x5e55c2[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())['where'](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x61'))[_0x5adb('0x73')]('cm_hopper')[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2['params']['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5adb('0x65')]()['field'](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')]('VoiceQueueId\x20=\x20?',_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')]('ContactId'))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')][_0x5adb('0x2f')](_0x338aee);}return[];})[_0x5adb('0x22')](respondWithResult(_0x1fc73b,null))['catch'](handleError(_0x1fc73b,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x3f3db9,_0x461a07,_0x2e5c96){return db[_0x5adb('0x77')][_0x5adb('0x5d')]({'where':{'id':_0x3f3db9[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x461a07,null))['then'](function(_0xda26cc){var _0x14bada;if(_0xda26cc){_0x14bada=squel[_0x5adb('0x5e')]()[_0x5adb('0x78')]('cm_hopper')[_0x5adb('0x60')]([_0x5adb('0x61'),_0x5adb('0x68'),_0x5adb('0x62'),_0x5adb('0x63'),_0x5adb('0x79'),_0x5adb('0x64'),_0x5adb('0x6b')],squel[_0x5adb('0x65')]()['field'](_0x5adb('0x7a'),_0x5adb('0x61'))['field'](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')](_0x5adb('0x7b'),_0x5adb('0x63'))['field'](_0x5adb('0x7c'),_0x5adb('0x79'))['field'](_0x5adb('0x67'),_0x5adb('0x64'))[_0x5adb('0x66')]('NOW()','updatedAt')[_0x5adb('0x73')](_0x5adb('0x6c'))[_0x5adb('0x37')]('CampaignId\x20=\x20?',_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x6f'),_0x3f3db9[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()['field']('phone')[_0x5adb('0x73')](_0x5adb('0x5f'))['where'](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id']['toString']())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')](_0x5adb('0x62')))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')]['query'](_0x14bada);}return[];})[_0x5adb('0x22')](respondWithResult(_0x461a07,null))[_0x5adb('0x42')](handleError(_0x461a07,null));};exports[_0x5adb('0x7e')]=function(_0x1e5532,_0x2c3af8,_0x3a201a){return db[_0x5adb('0x7f')][_0x5adb('0x80')]({'where':{'VoiceQueueId':_0x1e5532[_0x5adb('0x47')][_0x5adb('0x81')],'CampaignId':_0x1e5532['body'][_0x5adb('0x79')],'ContactId':_0x1e5532['body'][_0x5adb('0x62')]}})[_0x5adb('0x22')](handleEntityNotFound(_0x2c3af8,null))[_0x5adb('0x22')](function(_0x193a29){if(_0x193a29){return _0x193a29;}return null;})[_0x5adb('0x22')](respondWithResult(_0x2c3af8,null))['catch'](handleError(_0x2c3af8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 64f38d7..8ee973c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f6a=['CmHopperFinal','cm_hopper_final','calleridnum','lodash','util','api','moment','bluebird','request-promise','rimraf','./cmHopperFinal.attributes','exports','define'];(function(_0x14b7fa,_0x321343){var _0x17831c=function(_0x19d79c){while(--_0x19d79c){_0x14b7fa['push'](_0x14b7fa['shift']());}};_0x17831c(++_0x321343);}(_0x8f6a,0x78));var _0xa8f6=function(_0x2d21af,_0x37c57e){_0x2d21af=_0x2d21af-0x0;var _0x14ddd3=_0x8f6a[_0x2d21af];return _0x14ddd3;};'use strict';var _=require(_0xa8f6('0x0'));var util=require(_0xa8f6('0x1'));var logger=require('../../config/logger')(_0xa8f6('0x2'));var moment=require(_0xa8f6('0x3'));var BPromise=require(_0xa8f6('0x4'));var rp=require(_0xa8f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8f6('0x6'));var config=require('../../config/environment');var attributes=require(_0xa8f6('0x7'));module[_0xa8f6('0x8')]=function(_0x180ced,_0x1cded4){return _0x180ced[_0xa8f6('0x9')](_0xa8f6('0xa'),attributes,{'tableName':_0xa8f6('0xb'),'paranoid':![],'indexes':[{'name':_0xa8f6('0xc'),'fields':[_0xa8f6('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcec3=['define','CmHopperFinal','cm_hopper_final','calleridnum','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x25a6cc,_0x3af539){var _0x58d054=function(_0x2d8096){while(--_0x2d8096){_0x25a6cc['push'](_0x25a6cc['shift']());}};_0x58d054(++_0x3af539);}(_0xcec3,0x197));var _0x3cec=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcec3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3cec('0x0'));var util=require('util');var logger=require(_0x3cec('0x1'))(_0x3cec('0x2'));var moment=require(_0x3cec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3cec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cec('0x5'));var config=require(_0x3cec('0x6'));var attributes=require(_0x3cec('0x7'));module[_0x3cec('0x8')]=function(_0x32e1ad,_0x5b70ad){return _0x32e1ad[_0x3cec('0x9')](_0x3cec('0xa'),attributes,{'tableName':_0x3cec('0xb'),'paranoid':![],'indexes':[{'name':_0x3cec('0xc'),'fields':[_0x3cec('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index bbaafb9..16b1381 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x455ef9,_0x1ab9e0){var _0x28f66b=function(_0x10b66c){while(--_0x10b66c){_0x455ef9['push'](_0x455ef9['shift']());}};_0x28f66b(++_0x1ab9e0);}(_0x7a54,0x106));var _0x47a5=function(_0x480839,_0x513c4a){_0x480839=_0x480839-0x0;var _0x3abb26=_0x7a54[_0x480839];return _0x3abb26;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x947959,_0xe60e92){var _0xf2b815=function(_0x1e9f1b){while(--_0x1e9f1b){_0x947959['push'](_0x947959['shift']());}};_0xf2b815(++_0xe60e92);}(_0xb10b,0x12a));var _0xbb10=function(_0x24b3fd,_0x3d7922){_0x24b3fd=_0x24b3fd-0x0;var _0x5bebf4=_0xb10b[_0x24b3fd];return _0x5bebf4;};'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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e4466a9..23bb7d9 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7f8=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x2e353f,_0x15d70a){var _0x4b0700=function(_0x2140ee){while(--_0x2140ee){_0x2e353f['push'](_0x2e353f['shift']());}};_0x4b0700(++_0x15d70a);}(_0xc7f8,0xcf));var _0x8c7f=function(_0x3bb6e3,_0x1fa3f7){_0x3bb6e3=_0x3bb6e3-0x0;var _0x1ff46c=_0xc7f8[_0x3bb6e3];return _0x1ff46c;};'use strict';var multer=require(_0x8c7f('0x0'));var util=require(_0x8c7f('0x1'));var path=require(_0x8c7f('0x2'));var timeout=require(_0x8c7f('0x3'));var express=require(_0x8c7f('0x4'));var router=express['Router']();var fs_extra=require(_0x8c7f('0x5'));var auth=require(_0x8c7f('0x6'));var interaction=require(_0x8c7f('0x7'));var config=require(_0x8c7f('0x8'));var controller=require(_0x8c7f('0x9'));router[_0x8c7f('0xa')]('/',auth[_0x8c7f('0xb')](),controller['index']);router[_0x8c7f('0xa')]('/describe',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0xc')]);router['get'](_0x8c7f('0xd'),auth[_0x8c7f('0xb')](),controller[_0x8c7f('0xe')]);router[_0x8c7f('0xa')](_0x8c7f('0xf'),auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x10')]);router[_0x8c7f('0xa')](_0x8c7f('0x11'),auth['isAuthenticated'](),controller[_0x8c7f('0x12')]);router[_0x8c7f('0x13')](_0x8c7f('0x14'),auth['isAuthenticated'](),controller[_0x8c7f('0x15')]);router[_0x8c7f('0x13')](_0x8c7f('0x16'),auth['isAuthenticated'](),controller[_0x8c7f('0x17')]);router[_0x8c7f('0x13')](_0x8c7f('0x18'),auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x19')]);router['put'](_0x8c7f('0xd'),auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x1a')]);module[_0x8c7f('0x1b')]=router; \ No newline at end of file +var _0x9169=['checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x16ed87,_0x1be1a2){var _0xc1a1d8=function(_0x3c0fcf){while(--_0x3c0fcf){_0x16ed87['push'](_0x16ed87['shift']());}};_0xc1a1d8(++_0x1be1a2);}(_0x9169,0xdd));var _0x9916=function(_0x59e537,_0x139c12){_0x59e537=_0x59e537-0x0;var _0x3b9cc6=_0x9169[_0x59e537];return _0x3b9cc6;};'use strict';var multer=require(_0x9916('0x0'));var util=require(_0x9916('0x1'));var path=require(_0x9916('0x2'));var timeout=require(_0x9916('0x3'));var express=require(_0x9916('0x4'));var router=express[_0x9916('0x5')]();var fs_extra=require(_0x9916('0x6'));var auth=require(_0x9916('0x7'));var interaction=require(_0x9916('0x8'));var config=require(_0x9916('0x9'));var controller=require(_0x9916('0xa'));router['get']('/',auth[_0x9916('0xb')](),controller[_0x9916('0xc')]);router[_0x9916('0xd')](_0x9916('0xe'),auth[_0x9916('0xb')](),controller[_0x9916('0xf')]);router[_0x9916('0xd')](_0x9916('0x10'),auth['isAuthenticated'](),controller[_0x9916('0x11')]);router[_0x9916('0xd')](_0x9916('0x12'),auth[_0x9916('0xb')](),controller[_0x9916('0x13')]);router[_0x9916('0xd')](_0x9916('0x14'),auth[_0x9916('0xb')](),controller[_0x9916('0x15')]);router[_0x9916('0x16')](_0x9916('0x17'),auth[_0x9916('0xb')](),controller[_0x9916('0x18')]);router['post'](_0x9916('0x19'),auth[_0x9916('0xb')](),controller[_0x9916('0x1a')]);router[_0x9916('0x16')]('/checkContactHopper',auth[_0x9916('0xb')](),controller[_0x9916('0x1b')]);router[_0x9916('0x1c')](_0x9916('0x10'),auth[_0x9916('0xb')](),controller[_0x9916('0x1d')]);module[_0x9916('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 4b3278e..13694a2 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x14d6d7,_0x3ca897){var _0x2ac32b=function(_0x3bf20a){while(--_0x3bf20a){_0x14d6d7['push'](_0x14d6d7['shift']());}};_0x2ac32b(++_0x3ca897);}(_0x2a07,0x74));var _0x72a0=function(_0x580cee,_0x189c97){_0x580cee=_0x580cee-0x0;var _0x47dfe9=_0x2a07[_0x580cee];return _0x47dfe9;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'state':{'type':Sequelize[_0x72a0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x72a0('0x3')]},'scheduledat':{'type':Sequelize[_0x72a0('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x72a0('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x72a0('0x3')]},'originatecalleridname':{'type':Sequelize[_0x72a0('0x3')]},'calleridnum':{'type':Sequelize[_0x72a0('0x3')]},'calleridname':{'type':Sequelize[_0x72a0('0x3')]},'starttime':{'type':Sequelize[_0x72a0('0x4')]},'responsetime':{'type':Sequelize[_0x72a0('0x4')]},'answertime':{'type':Sequelize[_0x72a0('0x4')]},'droptime':{'type':Sequelize[_0x72a0('0x4')]},'endtime':{'type':Sequelize[_0x72a0('0x4')]},'ringtime':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x72a0('0x3')]},'campaign':{'type':Sequelize[_0x72a0('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x72a0('0x3')]},'reason':{'type':Sequelize[_0x72a0('0x3')]},'amd':{'type':Sequelize[_0x72a0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x72a0('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x72a0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x72a0('0x4')]},'recallme':{'type':Sequelize[_0x72a0('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x72a0('0x4')]},'edited':{'type':Sequelize[_0x72a0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x72a0('0x3')]}}; \ No newline at end of file +var _0xdbc6=['DATE','STRING','BOOLEAN','INTEGER'];(function(_0x5efe23,_0x5c9338){var _0x351a7e=function(_0x2d24ac){while(--_0x2d24ac){_0x5efe23['push'](_0x5efe23['shift']());}};_0x351a7e(++_0x5c9338);}(_0xdbc6,0x13b));var _0x6dbc=function(_0xe42513,_0x24ac6b){_0xe42513=_0xe42513-0x0;var _0x2ad4af=_0xdbc6[_0xe42513];return _0x2ad4af;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x6dbc('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6dbc('0x1')]},'countbusyretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6dbc('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6dbc('0x2')]},'calleridnum':{'type':Sequelize[_0x6dbc('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6dbc('0x1')]},'responsetime':{'type':Sequelize[_0x6dbc('0x1')]},'answertime':{'type':Sequelize[_0x6dbc('0x1')]},'droptime':{'type':Sequelize[_0x6dbc('0x1')]},'endtime':{'type':Sequelize[_0x6dbc('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6dbc('0x2')]},'campaign':{'type':Sequelize[_0x6dbc('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6dbc('0x2')]},'reason':{'type':Sequelize[_0x6dbc('0x2')]},'amd':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6dbc('0x1')]},'edited':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6dbc('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index fbb39c3..edd5e46 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc1a=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','options','includeAll','include','findAll','show','params','catch','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','CmHopperHistory','rawAttributes'];(function(_0x5481df,_0x4c6063){var _0x95c09a=function(_0x122167){while(--_0x122167){_0x5481df['push'](_0x5481df['shift']());}};_0x95c09a(++_0x4c6063);}(_0xbc1a,0x1d8));var _0xabc1=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xbc1a[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0xabc1('0x0'));var rimraf=require(_0xabc1('0x1'));var zipdir=require(_0xabc1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabc1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xabc1('0x4'));var util=require(_0xabc1('0x5'));var path=require('path');var sox=require(_0xabc1('0x6'));var csv=require(_0xabc1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabc1('0x8'));var squel=require(_0xabc1('0x9'));var crypto=require(_0xabc1('0xa'));var jsforce=require(_0xabc1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xabc1('0x7'));var querystring=require(_0xabc1('0xc'));var Papa=require(_0xabc1('0xd'));var Redis=require(_0xabc1('0xe'));var authService=require(_0xabc1('0xf'));var qs=require(_0xabc1('0x10'));var as=require(_0xabc1('0x11'));var hardwareService=require(_0xabc1('0x12'));var logger=require(_0xabc1('0x13'))(_0xabc1('0x14'));var utils=require(_0xabc1('0x15'));var config=require(_0xabc1('0x16'));var licenseUtil=require(_0xabc1('0x17'));var db=require(_0xabc1('0x18'))['db'];function respondWithStatusCode(_0x3bf283,_0x5c3e9f){_0x5c3e9f=_0x5c3e9f||0xcc;return function(_0x4e06b3){if(_0x4e06b3){return _0x3bf283[_0xabc1('0x19')](_0x5c3e9f);}return _0x3bf283['status'](_0x5c3e9f)[_0xabc1('0x1a')]();};}function respondWithResult(_0x270284,_0x2f19fa){_0x2f19fa=_0x2f19fa||0xc8;return function(_0x59c2f5){if(_0x59c2f5){return _0x270284[_0xabc1('0x1b')](_0x2f19fa)[_0xabc1('0x1c')](_0x59c2f5);}};}function respondWithFilteredResult(_0x25c554,_0x2b18e7){return function(_0xa2f5fb){if(_0xa2f5fb){var _0x44f117=typeof _0x2b18e7[_0xabc1('0x1d')]===_0xabc1('0x1e')&&typeof _0x2b18e7[_0xabc1('0x1f')]===_0xabc1('0x1e');var _0x1cc6be=_0xa2f5fb['count'];var _0x55901b=_0x44f117?0x0:_0x2b18e7[_0xabc1('0x1d')];var _0xf1732d=_0x44f117?_0xa2f5fb[_0xabc1('0x20')]:_0x2b18e7[_0xabc1('0x1d')]+_0x2b18e7[_0xabc1('0x1f')];var _0x20c83c;if(_0xf1732d>=_0x1cc6be){_0xf1732d=_0x1cc6be;_0x20c83c=0xc8;}else{_0x20c83c=0xce;}_0x25c554[_0xabc1('0x1b')](_0x20c83c);return _0x25c554[_0xabc1('0x21')](_0xabc1('0x22'),_0x55901b+'-'+_0xf1732d+'/'+_0x1cc6be)[_0xabc1('0x1c')](_0xa2f5fb);}return null;};}function patchUpdates(_0x2e7017){return function(_0x52e8a7){try{jsonpatch[_0xabc1('0x23')](_0x52e8a7,_0x2e7017,!![]);}catch(_0x5a81b0){return BPromise[_0xabc1('0x24')](_0x5a81b0);}return _0x52e8a7[_0xabc1('0x25')]();};}function saveUpdates(_0xc1db6,_0x51506c){return function(_0x1cab22){if(_0x1cab22){return _0x1cab22[_0xabc1('0x26')](_0xc1db6)[_0xabc1('0x27')](function(_0x35c788){return _0x35c788;});}return null;};}function removeEntity(_0x18edff,_0x572651){return function(_0x4b9438){if(_0x4b9438){return _0x4b9438[_0xabc1('0x28')]()[_0xabc1('0x27')](function(){_0x18edff[_0xabc1('0x1b')](0xcc)[_0xabc1('0x1a')]();});}};}function handleEntityNotFound(_0x3a16f3,_0x4d99b1){return function(_0x480a43){if(!_0x480a43){_0x3a16f3[_0xabc1('0x19')](0x194);}return _0x480a43;};}function handleError(_0x5719ba,_0x129a3f){_0x129a3f=_0x129a3f||0x1f4;return function(_0x29e99a){logger['error'](_0x29e99a[_0xabc1('0x29')]);if(_0x29e99a[_0xabc1('0x2a')]){delete _0x29e99a[_0xabc1('0x2a')];}_0x5719ba[_0xabc1('0x1b')](_0x129a3f)[_0xabc1('0x2b')](_0x29e99a);};}exports['index']=function(_0x19c817,_0x56244d){var _0x1df625={},_0x7a94d9={},_0x2b8520={'count':0x0,'rows':[]};var _0x492884=_['map'](db[_0xabc1('0x2c')][_0xabc1('0x2d')],function(_0x53b332){return{'name':_0x53b332[_0xabc1('0x2e')],'type':_0x53b332[_0xabc1('0x2f')][_0xabc1('0x30')]};});_0x7a94d9[_0xabc1('0x31')]=_[_0xabc1('0x32')](_0x492884,_0xabc1('0x2a'));_0x7a94d9[_0xabc1('0x33')]=_[_0xabc1('0x34')](_0x19c817[_0xabc1('0x33')]);_0x7a94d9[_0xabc1('0x35')]=_[_0xabc1('0x36')](_0x7a94d9[_0xabc1('0x31')],_0x7a94d9[_0xabc1('0x33')]);_0x1df625[_0xabc1('0x37')]=_[_0xabc1('0x36')](_0x7a94d9['model'],qs[_0xabc1('0x38')](_0x19c817['query']['fields']));_0x1df625[_0xabc1('0x37')]=_0x1df625['attributes'][_0xabc1('0x39')]?_0x1df625[_0xabc1('0x37')]:_0x7a94d9[_0xabc1('0x31')];if(!_0x19c817[_0xabc1('0x33')]['hasOwnProperty']('nolimit')){_0x1df625['limit']=qs[_0xabc1('0x1f')](_0x19c817[_0xabc1('0x33')][_0xabc1('0x1f')]);_0x1df625[_0xabc1('0x1d')]=qs[_0xabc1('0x1d')](_0x19c817['query'][_0xabc1('0x1d')]);}_0x1df625[_0xabc1('0x3a')]=qs[_0xabc1('0x3b')](_0x19c817[_0xabc1('0x33')]['sort']);_0x1df625[_0xabc1('0x3c')]=qs['filters'](_[_0xabc1('0x3d')](_0x19c817['query'],_0x7a94d9[_0xabc1('0x35')]),_0x492884);if(_0x19c817[_0xabc1('0x33')]['filter']){_0x1df625[_0xabc1('0x3c')]=_[_0xabc1('0x3e')](_0x1df625[_0xabc1('0x3c')],{'$or':_[_0xabc1('0x32')](_0x492884,function(_0x137e90){if(_0x137e90['type']!=='VIRTUAL'){var _0x360a45={};_0x360a45[_0x137e90[_0xabc1('0x2a')]]={'$like':'%'+_0x19c817['query']['filter']+'%'};return _0x360a45;}})});}_0x1df625=_['merge']({},_0x1df625,_0x19c817[_0xabc1('0x3f')]);var _0x2b782b={'where':_0x1df625['where']};return db[_0xabc1('0x2c')]['count'](_0x2b782b)['then'](function(_0x18904b){_0x2b8520[_0xabc1('0x20')]=_0x18904b;if(_0x19c817[_0xabc1('0x33')][_0xabc1('0x40')]){_0x1df625[_0xabc1('0x41')]=[{'all':!![]}];}return db[_0xabc1('0x2c')][_0xabc1('0x42')](_0x1df625);})[_0xabc1('0x27')](function(_0x48d1fa){_0x2b8520['rows']=_0x48d1fa;return _0x2b8520;})[_0xabc1('0x27')](respondWithFilteredResult(_0x56244d,_0x1df625))['catch'](handleError(_0x56244d,null));};exports[_0xabc1('0x43')]=function(_0x2a20a1,_0x33a678){var _0x29044a={'raw':!![],'where':{'id':_0x2a20a1[_0xabc1('0x44')]['id']}},_0x65955f={};_0x65955f['model']=_['keys'](db[_0xabc1('0x2c')]['rawAttributes']);_0x65955f[_0xabc1('0x33')]=_[_0xabc1('0x34')](_0x2a20a1[_0xabc1('0x33')]);_0x65955f[_0xabc1('0x35')]=_[_0xabc1('0x36')](_0x65955f[_0xabc1('0x31')],_0x65955f[_0xabc1('0x33')]);_0x29044a[_0xabc1('0x37')]=_[_0xabc1('0x36')](_0x65955f['model'],qs[_0xabc1('0x38')](_0x2a20a1[_0xabc1('0x33')][_0xabc1('0x38')]));_0x29044a['attributes']=_0x29044a[_0xabc1('0x37')]['length']?_0x29044a[_0xabc1('0x37')]:_0x65955f['model'];if(_0x2a20a1[_0xabc1('0x33')][_0xabc1('0x40')]){_0x29044a['include']=[{'all':!![]}];}_0x29044a=_[_0xabc1('0x3e')]({},_0x29044a,_0x2a20a1[_0xabc1('0x3f')]);return db[_0xabc1('0x2c')]['find'](_0x29044a)[_0xabc1('0x27')](handleEntityNotFound(_0x33a678,null))['then'](respondWithResult(_0x33a678,null))[_0xabc1('0x45')](handleError(_0x33a678,null));};exports[_0xabc1('0x46')]=function(_0x5631a5,_0x134765){return db[_0xabc1('0x2c')][_0xabc1('0x46')](_0x5631a5['body'],{})['then'](respondWithResult(_0x134765,0xc9))[_0xabc1('0x45')](handleError(_0x134765,null));};exports['describe']=function(_0x4b730b,_0x2db814){return db['CmHopperHistory'][_0xabc1('0x47')]()[_0xabc1('0x27')](respondWithResult(_0x2db814,null))[_0xabc1('0x45')](handleError(_0x2db814,null));};exports[_0xabc1('0x26')]=function(_0x416242,_0x39644c){if(_0x416242[_0xabc1('0x48')][_0xabc1('0x49')]){delete _0x416242[_0xabc1('0x48')]['uniqueid'];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x416242[_0xabc1('0x44')]['id']}})['then'](handleEntityNotFound(_0x39644c,null))[_0xabc1('0x27')](saveUpdates(_0x416242['body'],null))['then'](respondWithResult(_0x39644c,null))[_0xabc1('0x45')](handleError(_0x39644c,null));}; \ No newline at end of file +var _0xa4dc=['reject','save','update','then','end','error','name','send','index','CmHopperHistory','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','describe','uniqueid','body','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply'];(function(_0x4bd40e,_0x7701b4){var _0x544e09=function(_0x2288de){while(--_0x2288de){_0x4bd40e['push'](_0x4bd40e['shift']());}};_0x544e09(++_0x7701b4);}(_0xa4dc,0xc0));var _0xca4d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xa4dc[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0xca4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca4d('0x1'));var jsonpatch=require(_0xca4d('0x2'));var rp=require(_0xca4d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca4d('0x4'));var path=require(_0xca4d('0x5'));var sox=require(_0xca4d('0x6'));var csv=require(_0xca4d('0x7'));var ejs=require(_0xca4d('0x8'));var fs=require('fs');var fs_extra=require(_0xca4d('0x9'));var _=require(_0xca4d('0xa'));var squel=require(_0xca4d('0xb'));var crypto=require(_0xca4d('0xc'));var jsforce=require(_0xca4d('0xd'));var deskjs=require(_0xca4d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xca4d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca4d('0x10'));var as=require(_0xca4d('0x11'));var hardwareService=require(_0xca4d('0x12'));var logger=require(_0xca4d('0x13'))('api');var utils=require(_0xca4d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xca4d('0x15'));var db=require(_0xca4d('0x16'))['db'];function respondWithStatusCode(_0x45d629,_0x1d79c7){_0x1d79c7=_0x1d79c7||0xcc;return function(_0x15908b){if(_0x15908b){return _0x45d629[_0xca4d('0x17')](_0x1d79c7);}return _0x45d629['status'](_0x1d79c7)['end']();};}function respondWithResult(_0x37fb67,_0x4c42f8){_0x4c42f8=_0x4c42f8||0xc8;return function(_0x4e38dd){if(_0x4e38dd){return _0x37fb67[_0xca4d('0x18')](_0x4c42f8)['json'](_0x4e38dd);}};}function respondWithFilteredResult(_0x9652a9,_0x202f4f){return function(_0x40dab2){if(_0x40dab2){var _0x47af13=typeof _0x202f4f[_0xca4d('0x19')]==='undefined'&&typeof _0x202f4f[_0xca4d('0x1a')]===_0xca4d('0x1b');var _0x537c7c=_0x40dab2['count'];var _0x35e4ec=_0x47af13?0x0:_0x202f4f[_0xca4d('0x19')];var _0x4a1494=_0x47af13?_0x40dab2[_0xca4d('0x1c')]:_0x202f4f[_0xca4d('0x19')]+_0x202f4f[_0xca4d('0x1a')];var _0x1645b0;if(_0x4a1494>=_0x537c7c){_0x4a1494=_0x537c7c;_0x1645b0=0xc8;}else{_0x1645b0=0xce;}_0x9652a9[_0xca4d('0x18')](_0x1645b0);return _0x9652a9[_0xca4d('0x1d')](_0xca4d('0x1e'),_0x35e4ec+'-'+_0x4a1494+'/'+_0x537c7c)[_0xca4d('0x1f')](_0x40dab2);}return null;};}function patchUpdates(_0x21dd7e){return function(_0x16b300){try{jsonpatch[_0xca4d('0x20')](_0x16b300,_0x21dd7e,!![]);}catch(_0x494db4){return BPromise[_0xca4d('0x21')](_0x494db4);}return _0x16b300[_0xca4d('0x22')]();};}function saveUpdates(_0x4d6aa8,_0x3af6bc){return function(_0x5ed272){if(_0x5ed272){return _0x5ed272[_0xca4d('0x23')](_0x4d6aa8)[_0xca4d('0x24')](function(_0x30bace){return _0x30bace;});}return null;};}function removeEntity(_0x3fd2b7,_0x242681){return function(_0x537bc0){if(_0x537bc0){return _0x537bc0['destroy']()['then'](function(){_0x3fd2b7[_0xca4d('0x18')](0xcc)[_0xca4d('0x25')]();});}};}function handleEntityNotFound(_0x136e3e,_0x99afa9){return function(_0x37412a){if(!_0x37412a){_0x136e3e['sendStatus'](0x194);}return _0x37412a;};}function handleError(_0x442a2d,_0x37b272){_0x37b272=_0x37b272||0x1f4;return function(_0x451c95){logger[_0xca4d('0x26')](_0x451c95['stack']);if(_0x451c95[_0xca4d('0x27')]){delete _0x451c95['name'];}_0x442a2d[_0xca4d('0x18')](_0x37b272)[_0xca4d('0x28')](_0x451c95);};}exports[_0xca4d('0x29')]=function(_0x582545,_0x1f62e0){var _0x398a77={},_0x28ac90={},_0x4b701b={'count':0x0,'rows':[]};var _0x129a29=_['map'](db[_0xca4d('0x2a')][_0xca4d('0x2b')],function(_0x105e0b){return{'name':_0x105e0b[_0xca4d('0x2c')],'type':_0x105e0b['type'][_0xca4d('0x2d')]};});_0x28ac90['model']=_[_0xca4d('0x2e')](_0x129a29,_0xca4d('0x27'));_0x28ac90[_0xca4d('0x2f')]=_['keys'](_0x582545['query']);_0x28ac90[_0xca4d('0x30')]=_[_0xca4d('0x31')](_0x28ac90[_0xca4d('0x32')],_0x28ac90[_0xca4d('0x2f')]);_0x398a77[_0xca4d('0x33')]=_[_0xca4d('0x31')](_0x28ac90[_0xca4d('0x32')],qs[_0xca4d('0x34')](_0x582545[_0xca4d('0x2f')][_0xca4d('0x34')]));_0x398a77[_0xca4d('0x33')]=_0x398a77[_0xca4d('0x33')][_0xca4d('0x35')]?_0x398a77[_0xca4d('0x33')]:_0x28ac90[_0xca4d('0x32')];if(!_0x582545[_0xca4d('0x2f')]['hasOwnProperty'](_0xca4d('0x36'))){_0x398a77[_0xca4d('0x1a')]=qs['limit'](_0x582545['query'][_0xca4d('0x1a')]);_0x398a77['offset']=qs[_0xca4d('0x19')](_0x582545[_0xca4d('0x2f')]['offset']);}_0x398a77[_0xca4d('0x37')]=qs[_0xca4d('0x38')](_0x582545[_0xca4d('0x2f')][_0xca4d('0x38')]);_0x398a77[_0xca4d('0x39')]=qs[_0xca4d('0x30')](_['pick'](_0x582545[_0xca4d('0x2f')],_0x28ac90[_0xca4d('0x30')]),_0x129a29);if(_0x582545[_0xca4d('0x2f')][_0xca4d('0x3a')]){_0x398a77['where']=_['merge'](_0x398a77[_0xca4d('0x39')],{'$or':_[_0xca4d('0x2e')](_0x129a29,function(_0x2c46dd){if(_0x2c46dd[_0xca4d('0x3b')]!==_0xca4d('0x3c')){var _0x3c3a87={};_0x3c3a87[_0x2c46dd['name']]={'$like':'%'+_0x582545[_0xca4d('0x2f')][_0xca4d('0x3a')]+'%'};return _0x3c3a87;}})});}_0x398a77=_[_0xca4d('0x3d')]({},_0x398a77,_0x582545[_0xca4d('0x3e')]);var _0x21680d={'where':_0x398a77[_0xca4d('0x39')]};return db[_0xca4d('0x2a')][_0xca4d('0x1c')](_0x21680d)['then'](function(_0x29e4f9){_0x4b701b[_0xca4d('0x1c')]=_0x29e4f9;if(_0x582545[_0xca4d('0x2f')][_0xca4d('0x3f')]){_0x398a77['include']=[{'all':!![]}];}return db[_0xca4d('0x2a')][_0xca4d('0x40')](_0x398a77);})[_0xca4d('0x24')](function(_0x230cca){_0x4b701b[_0xca4d('0x41')]=_0x230cca;return _0x4b701b;})[_0xca4d('0x24')](respondWithFilteredResult(_0x1f62e0,_0x398a77))[_0xca4d('0x42')](handleError(_0x1f62e0,null));};exports['show']=function(_0x46e985,_0x198fbf){var _0x10cf82={'raw':!![],'where':{'id':_0x46e985[_0xca4d('0x43')]['id']}},_0xe7061e={};_0xe7061e['model']=_['keys'](db[_0xca4d('0x2a')][_0xca4d('0x2b')]);_0xe7061e[_0xca4d('0x2f')]=_[_0xca4d('0x44')](_0x46e985[_0xca4d('0x2f')]);_0xe7061e[_0xca4d('0x30')]=_[_0xca4d('0x31')](_0xe7061e[_0xca4d('0x32')],_0xe7061e['query']);_0x10cf82[_0xca4d('0x33')]=_[_0xca4d('0x31')](_0xe7061e[_0xca4d('0x32')],qs[_0xca4d('0x34')](_0x46e985[_0xca4d('0x2f')][_0xca4d('0x34')]));_0x10cf82[_0xca4d('0x33')]=_0x10cf82[_0xca4d('0x33')][_0xca4d('0x35')]?_0x10cf82[_0xca4d('0x33')]:_0xe7061e[_0xca4d('0x32')];if(_0x46e985[_0xca4d('0x2f')][_0xca4d('0x3f')]){_0x10cf82[_0xca4d('0x45')]=[{'all':!![]}];}_0x10cf82=_[_0xca4d('0x3d')]({},_0x10cf82,_0x46e985[_0xca4d('0x3e')]);return db['CmHopperHistory'][_0xca4d('0x46')](_0x10cf82)[_0xca4d('0x24')](handleEntityNotFound(_0x198fbf,null))[_0xca4d('0x24')](respondWithResult(_0x198fbf,null))[_0xca4d('0x42')](handleError(_0x198fbf,null));};exports[_0xca4d('0x47')]=function(_0x275e67,_0x554efb){return db[_0xca4d('0x2a')][_0xca4d('0x47')](_0x275e67['body'],{})[_0xca4d('0x24')](respondWithResult(_0x554efb,0xc9))[_0xca4d('0x42')](handleError(_0x554efb,null));};exports[_0xca4d('0x48')]=function(_0x4f3561,_0xa20c36){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0xa20c36,null))[_0xca4d('0x42')](handleError(_0xa20c36,null));};exports['update']=function(_0x20bc1e,_0x264d17){if(_0x20bc1e['body'][_0xca4d('0x49')]){delete _0x20bc1e[_0xca4d('0x4a')][_0xca4d('0x49')];}return db[_0xca4d('0x2a')][_0xca4d('0x46')]({'where':{'uniqueid':_0x20bc1e[_0xca4d('0x43')]['id']}})[_0xca4d('0x24')](handleEntityNotFound(_0x264d17,null))[_0xca4d('0x24')](saveUpdates(_0x20bc1e['body'],null))['then'](respondWithResult(_0x264d17,null))[_0xca4d('0x42')](handleError(_0x264d17,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2d08253..601cc7d 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc113=['path','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xc113,0x1ab));var _0x3c11=function(_0x4cd578,_0x40a350){_0x4cd578=_0x4cd578-0x0;var _0x59d511=_0xc113[_0x4cd578];return _0x59d511;};'use strict';var _=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var logger=require(_0x3c11('0x2'))(_0x3c11('0x3'));var moment=require(_0x3c11('0x4'));var BPromise=require(_0x3c11('0x5'));var rp=require(_0x3c11('0x6'));var fs=require('fs');var path=require(_0x3c11('0x7'));var rimraf=require(_0x3c11('0x8'));var config=require('../../config/environment');var attributes=require(_0x3c11('0x9'));module[_0x3c11('0xa')]=function(_0x595e66,_0x3dd753){return _0x595e66[_0x3c11('0xb')](_0x3c11('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x3c11('0xd'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea9=['endtime','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','cm_hopper_history'];(function(_0x19a03e,_0x17b45e){var _0x50e88a=function(_0x5b0e1a){while(--_0x5b0e1a){_0x19a03e['push'](_0x19a03e['shift']());}};_0x50e88a(++_0x17b45e);}(_0x7ea9,0xec));var _0x97ea=function(_0x34e0e0,_0x201475){_0x34e0e0=_0x34e0e0-0x0;var _0x4b612c=_0x7ea9[_0x34e0e0];return _0x4b612c;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var logger=require(_0x97ea('0x1'))(_0x97ea('0x2'));var moment=require(_0x97ea('0x3'));var BPromise=require(_0x97ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97ea('0x5'));var rimraf=require(_0x97ea('0x6'));var config=require(_0x97ea('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x97ea('0x8')]=function(_0x112297,_0x74638c){return _0x112297[_0x97ea('0x9')]('CmHopperHistory',attributes,{'tableName':_0x97ea('0xa'),'paranoid':![],'indexes':[{'name':_0x97ea('0xb'),'fields':['endtime']},{'name':_0x97ea('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 40271b7..04760b2 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeffd=['body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','COUNT','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CmHopperHistory','create'];(function(_0x192f8a,_0x5c4a7c){var _0x2d43f4=function(_0x5269d8){while(--_0x5269d8){_0x192f8a['push'](_0x192f8a['shift']());}};_0x2d43f4(++_0x5c4a7c);}(_0xeffd,0x6b));var _0xdeff=function(_0xa5b643,_0x36c023){_0xa5b643=_0xa5b643-0x0;var _0x51969b=_0xeffd[_0xa5b643];return _0x51969b;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['CreateCmHopperHistory']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')](_0x5c9837[_0xdeff('0x1b')],{'raw':_0x5c9837[_0xdeff('0x1c')]?_0x5c9837[_0xdeff('0x1c')][_0xdeff('0x1d')]===undefined?!![]:![]:!![]})[_0xdeff('0xd')](function(_0x919c93){logger['info']('CreateCmHopperHistory',_0x5c9837);logger['debug'](_0xdeff('0x1e'),_0x5c9837,JSON['stringify'](_0x919c93));_0x369e13(_0x919c93);})[_0xdeff('0x18')](function(_0x91c0b4){logger['error'](_0xdeff('0x1e'),_0x91c0b4[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f['error'](0x1f4,_0x91c0b4['message']));});});};exports[_0xdeff('0x1f')]=function(_0x15c425){var _0x253eed=this;return new Promise(function(_0x31510c,_0x32add9){return db['CmHopperHistory'][_0xdeff('0x20')]({'raw':_0x15c425[_0xdeff('0x1c')]?_0x15c425[_0xdeff('0x1c')][_0xdeff('0x1d')]===undefined?!![]:![]:!![],'where':_0x15c425[_0xdeff('0x1c')]?_0x15c425[_0xdeff('0x1c')][_0xdeff('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')](_0xdeff('0x25')))),_0xdeff('0x26')],[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xdeff('0x27')],[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')]['literal'](_0xdeff('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xdeff('0x29'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xdeff('0x2a')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x29'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')](_0xdeff('0x2b')))),'predictiveIntervalAvgTalktime']]})[_0xdeff('0xd')](function(_0x5cef77){logger[_0xdeff('0xe')](_0xdeff('0x1f'),_0x15c425);logger[_0xdeff('0x10')](_0xdeff('0x1f'),_0x15c425,JSON[_0xdeff('0x12')](_0x5cef77));_0x31510c(_0x5cef77);})[_0xdeff('0x18')](function(_0x52baf5){logger[_0xdeff('0x13')](_0xdeff('0x1f'),_0x52baf5['message'],_0x15c425);_0x32add9(_0x253eed[_0xdeff('0x13')](0x1f4,_0x52baf5[_0xdeff('0x16')]));});});};exports[_0xdeff('0x2c')]=function(_0x387c19){var _0x233479=this;return new Promise(function(_0xe511b2,_0x4268e4){return db[_0xdeff('0x19')]['findAll']({'raw':_0x387c19[_0xdeff('0x1c')]?_0x387c19['options'][_0xdeff('0x1d')]===undefined?!![]:![]:!![],'where':_0x387c19[_0xdeff('0x1c')]?_0x387c19[_0xdeff('0x1c')]['where']||null:null,'attributes':[[_0xdeff('0x2d'),_0xdeff('0x2e')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db['sequelize'][_0xdeff('0x24')]('`state`\x20=\x200,\x201,\x20null'))),_0xdeff('0x2f')],[db[_0xdeff('0x23')]['fn']('COUNT',db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')](_0xdeff('0x30')))),_0xdeff('0x31')],[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')](_0xdeff('0x25')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')](_0xdeff('0x32')))),_0xdeff('0x33')],[db[_0xdeff('0x23')]['fn']('COUNT',db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0xdeff('0x34')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db['sequelize'][_0xdeff('0x24')](_0xdeff('0x35')))),_0xdeff('0x36')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdeff('0x37')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')]['literal'](_0xdeff('0x38')))),_0xdeff('0x39')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db['sequelize'][_0xdeff('0x24')]('`state`\x20=\x2013,\x201,\x20null'))),_0xdeff('0x3a')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db['sequelize']['literal'](_0xdeff('0x3b')))),_0xdeff('0x3c')],[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')]['literal'](_0xdeff('0x3d')))),_0xdeff('0x3e')],[db[_0xdeff('0x23')]['fn']('COUNT',db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')](_0xdeff('0x3f')))),_0xdeff('0x3c')],[db[_0xdeff('0x23')]['fn'](_0xdeff('0x22'),db['sequelize']['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xdeff('0x40')]],'group':[_0xdeff('0x2d')]})[_0xdeff('0xd')](function(_0x33482b){logger[_0xdeff('0xe')](_0xdeff('0x2c'),_0x387c19);logger[_0xdeff('0x10')](_0xdeff('0x2c'),_0x387c19,JSON['stringify'](_0x33482b));_0xe511b2(_0x33482b);})[_0xdeff('0x18')](function(_0x3a518d){logger[_0xdeff('0x13')]('GetVoiceQueueHopperHistory',_0x3a518d['message'],_0x387c19);_0x4268e4(_0x233479[_0xdeff('0x13')](0x1f4,_0x3a518d[_0xdeff('0x16')]));});});};exports[_0xdeff('0x41')]=function(_0x22c5cc){var _0x440053=this;return new Promise(function(_0x3db4fd,_0x5eabdf){return db['CmHopperHistory'][_0xdeff('0x20')]({'raw':_0x22c5cc[_0xdeff('0x1c')]?_0x22c5cc['options']['raw']===undefined?!![]:![]:!![],'where':_0x22c5cc[_0xdeff('0x1c')]?_0x22c5cc[_0xdeff('0x1c')]['where']||null:null,'attributes':[[_0xdeff('0x2d'),_0xdeff('0x2e')],[db['sequelize']['fn'](_0xdeff('0x22'),db[_0xdeff('0x23')]['col']('id')),_0xdeff('0x42')],[db[_0xdeff('0x23')]['fn']('COUNT',db[_0xdeff('0x23')]['fn']('IF',db[_0xdeff('0x23')][_0xdeff('0x24')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xdeff('0x2d')]})['then'](function(_0x38df65){logger[_0xdeff('0xe')](_0xdeff('0x41'),_0x22c5cc);logger[_0xdeff('0x10')](_0xdeff('0x41'),_0x22c5cc,JSON['stringify'](_0x38df65));_0x3db4fd(_0x38df65);})['catch'](function(_0x98d18c){logger[_0xdeff('0x13')](_0xdeff('0x41'),_0x98d18c[_0xdeff('0x16')],_0x22c5cc);_0x5eabdf(_0x440053[_0xdeff('0x13')](0x1f4,_0x98d18c[_0xdeff('0x16')]));});});}; \ No newline at end of file +var _0x2dae=['jayson/promise','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopperHistory','body','options','raw','info','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xcb409d,_0x506635){var _0x1c0d2f=function(_0x588d55){while(--_0x588d55){_0xcb409d['push'](_0xcb409d['shift']());}};_0x1c0d2f(++_0x506635);}(_0x2dae,0xc3));var _0xe2da=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x2dae[_0x307bf6];return _0x2878fc;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});}exports['CreateCmHopperHistory']=function(_0x45bb92){var _0x1f7d33=this;return new Promise(function(_0x417363,_0x2e5730){return db[_0xe2da('0x16')]['create'](_0x45bb92[_0xe2da('0x17')],{'raw':_0x45bb92[_0xe2da('0x18')]?_0x45bb92['options'][_0xe2da('0x19')]===undefined?!![]:![]:!![]})[_0xe2da('0xc')](function(_0x332193){logger[_0xe2da('0x1a')](_0xe2da('0x1b'),_0x45bb92);logger[_0xe2da('0xf')]('CreateCmHopperHistory',_0x45bb92,JSON[_0xe2da('0x11')](_0x332193));_0x417363(_0x332193);})['catch'](function(_0x30efdc){logger[_0xe2da('0x12')](_0xe2da('0x1b'),_0x30efdc[_0xe2da('0x13')],_0x45bb92);_0x2e5730(_0x1f7d33[_0xe2da('0x12')](0x1f4,_0x30efdc[_0xe2da('0x13')]));});});};exports[_0xe2da('0x1c')]=function(_0x221e98){var _0x5a08d6=this;return new Promise(function(_0x1c901e,_0x357bff){return db[_0xe2da('0x16')][_0xe2da('0x1d')]({'raw':_0x221e98[_0xe2da('0x18')]?_0x221e98[_0xe2da('0x18')][_0xe2da('0x19')]===undefined?!![]:![]:!![],'where':_0x221e98['options']?_0x221e98[_0xe2da('0x18')][_0xe2da('0x1e')]||null:null,'attributes':[[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')][_0xe2da('0x21')]('id')),_0xe2da('0x22')],[db[_0xe2da('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe2da('0x23')](_0xe2da('0x24')))),_0xe2da('0x25')],[db[_0xe2da('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x26')))),_0xe2da('0x27')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x28'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x29')))),_0xe2da('0x2a')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x28'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x2b')))),_0xe2da('0x2c')]]})[_0xe2da('0xc')](function(_0x2618a1){logger[_0xe2da('0x1a')](_0xe2da('0x1c'),_0x221e98);logger['debug'](_0xe2da('0x1c'),_0x221e98,JSON[_0xe2da('0x11')](_0x2618a1));_0x1c901e(_0x2618a1);})[_0xe2da('0x15')](function(_0x5e1f39){logger[_0xe2da('0x12')](_0xe2da('0x1c'),_0x5e1f39[_0xe2da('0x13')],_0x221e98);_0x357bff(_0x5a08d6['error'](0x1f4,_0x5e1f39['message']));});});};exports[_0xe2da('0x2d')]=function(_0x1f4a5a){var _0x4d6e6c=this;return new Promise(function(_0x2e7324,_0x15df09){return db[_0xe2da('0x16')][_0xe2da('0x1d')]({'raw':_0x1f4a5a[_0xe2da('0x18')]?_0x1f4a5a['options'][_0xe2da('0x19')]===undefined?!![]:![]:!![],'where':_0x1f4a5a['options']?_0x1f4a5a['options'][_0xe2da('0x1e')]||null:null,'attributes':[['campaign',_0xe2da('0x2e')],[db[_0xe2da('0x1f')]['fn']('COUNT',db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x2f')))),_0xe2da('0x30')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x24')))),'outboundAnswerCallsDay'],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db['sequelize'][_0xe2da('0x23')](_0xe2da('0x31')))),_0xe2da('0x32')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xe2da('0x33')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x34')))),_0xe2da('0x35')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xe2da('0x36')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x37')))),_0xe2da('0x38')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x39')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xe2da('0x20'),db['sequelize']['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2014,\x201,\x20null'))),_0xe2da('0x3a')],[db[_0xe2da('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x3b')))),_0xe2da('0x3c')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x3d')))),_0xe2da('0x3e')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x3f')))),_0xe2da('0x3c')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xe2da('0x40')]})[_0xe2da('0xc')](function(_0x28f916){logger['info']('GetVoiceQueueHopperHistory',_0x1f4a5a);logger[_0xe2da('0xf')]('GetVoiceQueueHopperHistory',_0x1f4a5a,JSON[_0xe2da('0x11')](_0x28f916));_0x2e7324(_0x28f916);})[_0xe2da('0x15')](function(_0x8e78b9){logger[_0xe2da('0x12')](_0xe2da('0x2d'),_0x8e78b9[_0xe2da('0x13')],_0x1f4a5a);_0x15df09(_0x4d6e6c[_0xe2da('0x12')](0x1f4,_0x8e78b9[_0xe2da('0x13')]));});});};exports[_0xe2da('0x41')]=function(_0x4aa686){var _0x26a9f0=this;return new Promise(function(_0x2f763b,_0x98136a){return db[_0xe2da('0x16')]['findAll']({'raw':_0x4aa686[_0xe2da('0x18')]?_0x4aa686[_0xe2da('0x18')][_0xe2da('0x19')]===undefined?!![]:![]:!![],'where':_0x4aa686['options']?_0x4aa686[_0xe2da('0x18')][_0xe2da('0x1e')]||null:null,'attributes':[[_0xe2da('0x40'),_0xe2da('0x2e')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')][_0xe2da('0x21')]('id')),_0xe2da('0x42')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db['sequelize'][_0xe2da('0x23')](_0xe2da('0x24')))),_0xe2da('0x43')]],'group':[_0xe2da('0x40')]})[_0xe2da('0xc')](function(_0x277e8c){logger[_0xe2da('0x1a')]('GetCampaignHopperHistory',_0x4aa686);logger[_0xe2da('0xf')]('GetCampaignHopperHistory',_0x4aa686,JSON[_0xe2da('0x11')](_0x277e8c));_0x2f763b(_0x277e8c);})[_0xe2da('0x15')](function(_0x5b0c33){logger['error'](_0xe2da('0x41'),_0x5b0c33['message'],_0x4aa686);_0x98136a(_0x26a9f0[_0xe2da('0x12')](0x1f4,_0x5b0c33['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b92f875..b6847da 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc19=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x4f94b4,_0xddca5d){var _0xbc5b3=function(_0x1c76e2){while(--_0x1c76e2){_0x4f94b4['push'](_0x4f94b4['shift']());}};_0xbc5b3(++_0xddca5d);}(_0xdc19,0xa6));var _0x9dc1=function(_0x1557d3,_0x576645){_0x1557d3=_0x1557d3-0x0;var _0x1b9f33=_0xdc19[_0x1557d3];return _0x1b9f33;};'use strict';var multer=require(_0x9dc1('0x0'));var util=require(_0x9dc1('0x1'));var path=require(_0x9dc1('0x2'));var timeout=require(_0x9dc1('0x3'));var express=require(_0x9dc1('0x4'));var router=express[_0x9dc1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9dc1('0x6'));var interaction=require(_0x9dc1('0x7'));var config=require('../../config/environment');var controller=require(_0x9dc1('0x8'));router[_0x9dc1('0x9')]('/',auth[_0x9dc1('0xa')](),controller[_0x9dc1('0xb')]);router['get'](_0x9dc1('0xc'),auth[_0x9dc1('0xa')](),controller[_0x9dc1('0xd')]);router[_0x9dc1('0x9')](_0x9dc1('0xe'),auth[_0x9dc1('0xa')](),controller[_0x9dc1('0xf')]);router[_0x9dc1('0x10')]('/',auth[_0x9dc1('0xa')](),controller[_0x9dc1('0x11')]);router[_0x9dc1('0x12')](_0x9dc1('0xe'),auth[_0x9dc1('0xa')](),controller[_0x9dc1('0x13')]);module[_0x9dc1('0x14')]=router; \ No newline at end of file +var _0xdac0=['/:id','show','create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get'];(function(_0x516302,_0x1b166f){var _0x1cfc8a=function(_0x157faa){while(--_0x157faa){_0x516302['push'](_0x516302['shift']());}};_0x1cfc8a(++_0x1b166f);}(_0xdac0,0xb4));var _0x0dac=function(_0xc9840a,_0xaee017){_0xc9840a=_0xc9840a-0x0;var _0x297efc=_0xdac0[_0xc9840a];return _0x297efc;};'use strict';var multer=require(_0x0dac('0x0'));var util=require(_0x0dac('0x1'));var path=require(_0x0dac('0x2'));var timeout=require(_0x0dac('0x3'));var express=require(_0x0dac('0x4'));var router=express[_0x0dac('0x5')]();var fs_extra=require(_0x0dac('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0dac('0x7'));var controller=require(_0x0dac('0x8'));router['get']('/',auth[_0x0dac('0x9')](),controller[_0x0dac('0xa')]);router[_0x0dac('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0dac('0xb')](_0x0dac('0xc'),auth['isAuthenticated'](),controller[_0x0dac('0xd')]);router['post']('/',auth[_0x0dac('0x9')](),controller[_0x0dac('0xe')]);router[_0x0dac('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 888b940..ca99155 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcabc=['STRING','name','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcabc,0x16a));var _0xccab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcabc[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xccab('0x0')]={'name':{'type':Sequelize[_0xccab('0x1')],'unique':_0xccab('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xccab('0x1')]},'dialPrefix':{'type':Sequelize[_0xccab('0x1')]}}; \ No newline at end of file +var _0x6c84=['STRING','name','sequelize','exports'];(function(_0x18b26a,_0xb3d99a){var _0x38264a=function(_0x4f8c26){while(--_0x4f8c26){_0x18b26a['push'](_0x18b26a['shift']());}};_0x38264a(++_0xb3d99a);}(_0x6c84,0x112));var _0x46c8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6c84[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x46c8('0x0'));module[_0x46c8('0x1')]={'name':{'type':Sequelize[_0x46c8('0x2')],'unique':_0x46c8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x46c8('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 021cc74..073940a 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22bd=['getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','UserProfileResource','destroy','then','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','includeAll','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','hasOwnProperty','findAll','rows','removeDispositions','ids','CmContact','tags','isArray','push','each','success','errors','message','getContacts','CmCustomField','CustomFields','format','nolimit','order','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','customField_','item','ItemTypeId\x20=\x20?','additionalPhone_','description','cm_contact_has_items','CmContactId\x20=\x20c.id','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','sequelize'];(function(_0x1f0ad7,_0xbdbf69){var _0xc907ef=function(_0x8bc3ef){while(--_0x8bc3ef){_0x1f0ad7['push'](_0x1f0ad7['shift']());}};_0xc907ef(++_0xbdbf69);}(_0x22bd,0x140));var _0xd22b=function(_0x1750de,_0x3bc7ad){_0x1750de=_0x1750de-0x0;var _0x490134=_0x22bd[_0x1750de];return _0x490134;};'use strict';var emlformat=require(_0xd22b('0x0'));var rimraf=require(_0xd22b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd22b('0x2'));var rp=require(_0xd22b('0x3'));var moment=require(_0xd22b('0x4'));var BPromise=require(_0xd22b('0x5'));var Mustache=require('mustache');var util=require(_0xd22b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd22b('0x7'));var fs=require('fs');var fs_extra=require(_0xd22b('0x8'));var _=require('lodash');var squel=require(_0xd22b('0x9'));var crypto=require(_0xd22b('0xa'));var jsforce=require(_0xd22b('0xb'));var deskjs=require(_0xd22b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd22b('0xd'));var Papa=require(_0xd22b('0xe'));var Redis=require('ioredis');var authService=require(_0xd22b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd22b('0x10'));var utils=require(_0xd22b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xd22b('0x12'));var db=require(_0xd22b('0x13'))['db'];var csv_results;config['redis']=_[_0xd22b('0x14')](config[_0xd22b('0x15')],{'host':_0xd22b('0x16'),'port':0x18eb});var socket=require(_0xd22b('0x17'))(new Redis(config['redis']));require(_0xd22b('0x18'))['register'](socket);function respondWithStatusCode(_0x521336,_0x4aa5f8){_0x4aa5f8=_0x4aa5f8||0xcc;return function(_0x39c463){if(_0x39c463){return _0x521336[_0xd22b('0x19')](_0x4aa5f8);}return _0x521336['status'](_0x4aa5f8)[_0xd22b('0x1a')]();};}function respondWithResult(_0x3b23cb,_0x42afef){_0x42afef=_0x42afef||0xc8;return function(_0xbee94d){if(_0xbee94d){return _0x3b23cb[_0xd22b('0x1b')](_0x42afef)[_0xd22b('0x1c')](_0xbee94d);}};}function respondWithFilteredResult(_0x1ab3fa,_0x28fd71){return function(_0x3fe95f){if(_0x3fe95f){var _0x196af0=typeof _0x28fd71[_0xd22b('0x1d')]===_0xd22b('0x1e')&&typeof _0x28fd71['limit']===_0xd22b('0x1e');var _0x24eb4d=_0x3fe95f[_0xd22b('0x1f')];var _0x202461=_0x196af0?0x0:_0x28fd71[_0xd22b('0x1d')];var _0x6666a0=_0x196af0?_0x3fe95f[_0xd22b('0x1f')]:_0x28fd71[_0xd22b('0x1d')]+_0x28fd71[_0xd22b('0x20')];var _0x3596df;if(_0x6666a0>=_0x24eb4d){_0x6666a0=_0x24eb4d;_0x3596df=0xc8;}else{_0x3596df=0xce;}_0x1ab3fa[_0xd22b('0x1b')](_0x3596df);return _0x1ab3fa[_0xd22b('0x21')]('Content-Range',_0x202461+'-'+_0x6666a0+'/'+_0x24eb4d)[_0xd22b('0x1c')](_0x3fe95f);}return null;};}function patchUpdates(_0x1a4823){return function(_0xa0b815){try{jsonpatch[_0xd22b('0x22')](_0xa0b815,_0x1a4823,!![]);}catch(_0x224e8b){return BPromise['reject'](_0x224e8b);}return _0xa0b815['save']();};}function saveUpdates(_0x1edb45,_0x7dbfe2){return function(_0x4cb6f3){if(_0x4cb6f3){return _0x4cb6f3[_0xd22b('0x23')](_0x1edb45)['then'](function(_0x2711de){return _0x2711de;});}return null;};}function removeEntity(_0x3f915d,_0x4c566e){return function(_0x332542){if(_0x332542){return _0x332542['destroy']()['then'](function(){var _0x592eec=_0x332542['get']({'plain':!![]});var _0x1f8e54='Lists';return db[_0xd22b('0x24')][_0xd22b('0x25')]({'where':{'type':_0x1f8e54,'resourceId':_0x592eec['id']}})[_0xd22b('0x26')](function(){return _0x332542;});})[_0xd22b('0x26')](function(){_0x3f915d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x169008,_0x4a91c4){return function(_0x3da21d){if(!_0x3da21d){_0x169008[_0xd22b('0x19')](0x194);}return _0x3da21d;};}function handleError(_0x2e94d4,_0x3f0001){_0x3f0001=_0x3f0001||0x1f4;return function(_0x329f5e){logger[_0xd22b('0x27')](_0x329f5e['stack']);if(_0x329f5e[_0xd22b('0x28')]){delete _0x329f5e['name'];}_0x2e94d4[_0xd22b('0x1b')](_0x3f0001)[_0xd22b('0x29')](_0x329f5e);};}exports[_0xd22b('0x2a')]=function(_0xc4c672,_0x69abef){var _0x205ee4={},_0x4dffa3={},_0x3adbdd={'count':0x0,'rows':[]};var _0x3b5d0a=_[_0xd22b('0x2b')](db[_0xd22b('0x2c')][_0xd22b('0x2d')],function(_0x7a6eac){return{'name':_0x7a6eac[_0xd22b('0x2e')],'type':_0x7a6eac[_0xd22b('0x2f')][_0xd22b('0x30')]};});_0x4dffa3[_0xd22b('0x31')]=_[_0xd22b('0x2b')](_0x3b5d0a,'name');_0x4dffa3[_0xd22b('0x32')]=_[_0xd22b('0x33')](_0xc4c672[_0xd22b('0x32')]);_0x4dffa3[_0xd22b('0x34')]=_[_0xd22b('0x35')](_0x4dffa3[_0xd22b('0x31')],_0x4dffa3['query']);_0x205ee4[_0xd22b('0x36')]=_[_0xd22b('0x35')](_0x4dffa3[_0xd22b('0x31')],qs[_0xd22b('0x37')](_0xc4c672[_0xd22b('0x32')][_0xd22b('0x37')]));_0x205ee4[_0xd22b('0x36')]=_0x205ee4['attributes'][_0xd22b('0x38')]?_0x205ee4[_0xd22b('0x36')]:_0x4dffa3[_0xd22b('0x31')];if(!_0xc4c672['query']['hasOwnProperty']('nolimit')){_0x205ee4['limit']=qs['limit'](_0xc4c672['query'][_0xd22b('0x20')]);_0x205ee4['offset']=qs[_0xd22b('0x1d')](_0xc4c672[_0xd22b('0x32')][_0xd22b('0x1d')]);}_0x205ee4['order']=qs[_0xd22b('0x39')](_0xc4c672['query'][_0xd22b('0x39')]);_0x205ee4[_0xd22b('0x3a')]=qs[_0xd22b('0x34')](_[_0xd22b('0x3b')](_0xc4c672[_0xd22b('0x32')],_0x4dffa3[_0xd22b('0x34')]),_0x3b5d0a);if(_0xc4c672['query'][_0xd22b('0x3c')]){_0x205ee4['where']=_[_0xd22b('0x3d')](_0x205ee4['where'],{'$or':_[_0xd22b('0x2b')](_0x3b5d0a,function(_0x31cd60){if(_0x31cd60[_0xd22b('0x2f')]!==_0xd22b('0x3e')){var _0x174dba={};_0x174dba[_0x31cd60[_0xd22b('0x28')]]={'$like':'%'+_0xc4c672[_0xd22b('0x32')][_0xd22b('0x3c')]+'%'};return _0x174dba;}})});}_0x205ee4=_['merge']({},_0x205ee4,_0xc4c672['options']);var _0x4f4c94={'where':_0x205ee4[_0xd22b('0x3a')]};return db[_0xd22b('0x2c')]['count'](_0x4f4c94)['then'](function(_0x25462e){_0x3adbdd[_0xd22b('0x1f')]=_0x25462e;if(_0xc4c672[_0xd22b('0x32')]['includeAll']){_0x205ee4[_0xd22b('0x3f')]=[{'all':!![]}];}return db[_0xd22b('0x2c')]['findAll'](_0x205ee4);})['then'](function(_0x1ff6b6){_0x3adbdd['rows']=_0x1ff6b6;return _0x3adbdd;})[_0xd22b('0x26')](respondWithFilteredResult(_0x69abef,_0x205ee4))[_0xd22b('0x40')](handleError(_0x69abef,null));};exports[_0xd22b('0x41')]=function(_0x2cf2f4,_0xd4dfa1){var _0x1bb335={'raw':![],'where':{'id':_0x2cf2f4[_0xd22b('0x42')]['id']}},_0x582928={};_0x582928['model']=_[_0xd22b('0x33')](db[_0xd22b('0x2c')][_0xd22b('0x2d')]);_0x582928[_0xd22b('0x32')]=_[_0xd22b('0x33')](_0x2cf2f4[_0xd22b('0x32')]);_0x582928['filters']=_[_0xd22b('0x35')](_0x582928['model'],_0x582928[_0xd22b('0x32')]);_0x1bb335[_0xd22b('0x36')]=_[_0xd22b('0x35')](_0x582928[_0xd22b('0x31')],qs[_0xd22b('0x37')](_0x2cf2f4[_0xd22b('0x32')][_0xd22b('0x37')]));_0x1bb335['attributes']=_0x1bb335[_0xd22b('0x36')][_0xd22b('0x38')]?_0x1bb335['attributes']:_0x582928[_0xd22b('0x31')];if(_0x2cf2f4[_0xd22b('0x32')][_0xd22b('0x43')]){_0x1bb335[_0xd22b('0x3f')]=[{'all':!![]}];}_0x1bb335=_['merge']({},_0x1bb335,_0x2cf2f4[_0xd22b('0x44')]);return db[_0xd22b('0x2c')][_0xd22b('0x45')](_0x1bb335)[_0xd22b('0x26')](handleEntityNotFound(_0xd4dfa1,null))[_0xd22b('0x26')](respondWithResult(_0xd4dfa1,null))[_0xd22b('0x40')](handleError(_0xd4dfa1,null));};exports['create']=function(_0x5d3cd5,_0x1d12b1){return db[_0xd22b('0x2c')][_0xd22b('0x46')](_0x5d3cd5[_0xd22b('0x47')],{})[_0xd22b('0x26')](function(_0x3a87c3){var _0x5802a5=_0x5d3cd5['user'][_0xd22b('0x48')]({'plain':!![]});if(!_0x5802a5)throw new Error(_0xd22b('0x49'));if(_0x5802a5[_0xd22b('0x4a')]===_0xd22b('0x4b')){var _0x1a59af=_0x3a87c3[_0xd22b('0x48')]({'plain':!![]});var _0x3335d2=_0xd22b('0x4c');return db[_0xd22b('0x4d')][_0xd22b('0x45')]({'where':{'name':_0x3335d2,'userProfileId':_0x5802a5[_0xd22b('0x4e')]},'raw':!![]})['then'](function(_0x4616ad){if(_0x4616ad&&_0x4616ad['autoAssociation']===0x0){return db[_0xd22b('0x24')]['create']({'name':_0x1a59af['name'],'resourceId':_0x1a59af['id'],'type':_0x4616ad[_0xd22b('0x28')],'sectionId':_0x4616ad['id']},{})['then'](function(){return _0x3a87c3;});}else{return _0x3a87c3;}})[_0xd22b('0x40')](function(_0x40fc1){logger[_0xd22b('0x27')](_0xd22b('0x4f'),_0x40fc1);throw _0x40fc1;});}return _0x3a87c3;})[_0xd22b('0x26')](respondWithResult(_0x1d12b1,0xc9))['catch'](handleError(_0x1d12b1,null));};exports['update']=function(_0x52564d,_0x4e7368){if(_0x52564d[_0xd22b('0x47')]['id']){delete _0x52564d[_0xd22b('0x47')]['id'];}return db[_0xd22b('0x2c')]['find']({'where':{'id':_0x52564d[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x4e7368,null))[_0xd22b('0x26')](saveUpdates(_0x52564d[_0xd22b('0x47')],null))[_0xd22b('0x26')](respondWithResult(_0x4e7368,null))[_0xd22b('0x40')](handleError(_0x4e7368,null));};exports[_0xd22b('0x25')]=function(_0x4300c6,_0x32a8c7){return db[_0xd22b('0x2c')][_0xd22b('0x45')]({'where':{'id':_0x4300c6[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x32a8c7,null))[_0xd22b('0x26')](removeEntity(_0x32a8c7,null))[_0xd22b('0x40')](handleError(_0x32a8c7,null));};exports[_0xd22b('0x50')]=function(_0x3f8bda,_0x27f89d){return db[_0xd22b('0x2c')][_0xd22b('0x50')]()[_0xd22b('0x26')](respondWithResult(_0x27f89d,null))[_0xd22b('0x40')](handleError(_0x27f89d,null));};exports[_0xd22b('0x51')]=function(_0x309937,_0x3cc37e,_0x55a357){if(_0x309937[_0xd22b('0x47')]['id']){delete _0x309937['body']['id'];}return db['CmList'][_0xd22b('0x45')]({'where':{'id':_0x309937[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x3cc37e,null))[_0xd22b('0x26')](function(_0x12a57b){if(_0x12a57b){_0x309937[_0xd22b('0x47')][_0xd22b('0x52')]=_0x12a57b['id'];return db[_0xd22b('0x53')][_0xd22b('0x46')](_0x309937[_0xd22b('0x47')]);}})[_0xd22b('0x26')](respondWithResult(_0x3cc37e,null))['catch'](handleError(_0x3cc37e,null));};exports['getDispositions']=function(_0x484542,_0x337d80,_0x5cc820){var _0x23e41d={'raw':![],'where':{}};var _0x29cb67={};var _0x57ddb4={'count':0x0,'rows':[]};return db[_0xd22b('0x2c')][_0xd22b('0x54')]({'where':{'id':_0x484542['params']['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x337d80,null))[_0xd22b('0x26')](function(_0x5bf262){if(_0x5bf262){_0x29cb67[_0xd22b('0x31')]=_[_0xd22b('0x33')](db[_0xd22b('0x53')][_0xd22b('0x2d')]);_0x29cb67['query']=_['keys'](_0x484542[_0xd22b('0x32')]);_0x29cb67[_0xd22b('0x34')]=_[_0xd22b('0x35')](_0x29cb67[_0xd22b('0x31')],_0x29cb67[_0xd22b('0x32')]);_0x23e41d[_0xd22b('0x36')]=_[_0xd22b('0x35')](_0x29cb67[_0xd22b('0x31')],qs[_0xd22b('0x37')](_0x484542['query'][_0xd22b('0x37')]));_0x23e41d[_0xd22b('0x36')]=_0x23e41d[_0xd22b('0x36')][_0xd22b('0x38')]?_0x23e41d[_0xd22b('0x36')]:_0x29cb67[_0xd22b('0x31')];if(!_0x484542['query'][_0xd22b('0x55')]('nolimit')){_0x23e41d[_0xd22b('0x20')]=qs[_0xd22b('0x20')](_0x484542[_0xd22b('0x32')]['limit']);_0x23e41d['offset']=qs[_0xd22b('0x1d')](_0x484542[_0xd22b('0x32')][_0xd22b('0x1d')]);}_0x23e41d['order']=qs[_0xd22b('0x39')](_0x484542[_0xd22b('0x32')][_0xd22b('0x39')]);_0x23e41d[_0xd22b('0x3a')]=qs[_0xd22b('0x34')](_[_0xd22b('0x3b')](_0x484542[_0xd22b('0x32')],_0x29cb67[_0xd22b('0x34')]));_0x23e41d[_0xd22b('0x3a')][_0xd22b('0x52')]=_0x5bf262['id'];if(_0x484542[_0xd22b('0x32')][_0xd22b('0x3c')]){_0x23e41d[_0xd22b('0x3a')]=_[_0xd22b('0x3d')](_0x23e41d['where'],{'$or':_[_0xd22b('0x2b')](_0x23e41d[_0xd22b('0x36')],function(_0x5cc479){var _0x132a4d={};_0x132a4d[_0x5cc479]={'$like':'%'+_0x484542[_0xd22b('0x32')][_0xd22b('0x3c')]+'%'};return _0x132a4d;})});}_0x23e41d=_['merge']({},_0x23e41d,_0x484542['options']);return db[_0xd22b('0x53')][_0xd22b('0x1f')]({'where':_0x23e41d[_0xd22b('0x3a')]})[_0xd22b('0x26')](function(_0x1ac665){_0x57ddb4[_0xd22b('0x1f')]=_0x1ac665;if(_0x484542[_0xd22b('0x32')][_0xd22b('0x43')]){_0x23e41d[_0xd22b('0x3f')]=[{'all':!![]}];}return db[_0xd22b('0x53')][_0xd22b('0x56')](_0x23e41d);})[_0xd22b('0x26')](function(_0x4f2630){_0x57ddb4[_0xd22b('0x57')]=_0x4f2630;return _0x57ddb4;});}})[_0xd22b('0x26')](respondWithFilteredResult(_0x337d80,_0x23e41d))[_0xd22b('0x40')](handleError(_0x337d80,null));};exports[_0xd22b('0x58')]=function(_0x555c35,_0x198042,_0x5d407d){return db[_0xd22b('0x2c')][_0xd22b('0x45')]({'where':{'id':_0x555c35['params']['id']}})['then'](handleEntityNotFound(_0x198042,null))[_0xd22b('0x26')](function(_0x456fa4){if(_0x456fa4){return _0x456fa4['removeDispositions'](_0x555c35['query'][_0xd22b('0x59')]);}})[_0xd22b('0x26')](respondWithStatusCode(_0x198042,null))[_0xd22b('0x40')](handleError(_0x198042,null));};exports['addContacts']=function(_0x2e3e57,_0x113936,_0x553902){return db['CmList'][_0xd22b('0x45')]({'where':{'id':_0x2e3e57[_0xd22b('0x42')]['id']}})['then'](handleEntityNotFound(_0x113936,null))[_0xd22b('0x26')](function(_0x4ede92){if(_0x4ede92){var _0x3486d6=[];var _0xd7c311={'success':[],'errors':[]};return db[_0xd22b('0x5a')][_0xd22b('0x50')]()[_0xd22b('0x26')](function(_0x18cf04){if(_0x2e3e57[_0xd22b('0x47')][_0xd22b('0x5b')]&&_[_0xd22b('0x5c')](_0x2e3e57[_0xd22b('0x47')]['tags'])){if(_0x2e3e57['body']['tags'][_0xd22b('0x38')]){_0x2e3e57[_0xd22b('0x47')][_0xd22b('0x5b')]=_0x2e3e57[_0xd22b('0x47')]['tags']['join'](';')+';';}else{_0x2e3e57[_0xd22b('0x47')]['tags']=null;}}else{_0x2e3e57[_0xd22b('0x47')][_0xd22b('0x5b')]=null;}if(_0x2e3e57[_0xd22b('0x47')]&&_[_0xd22b('0x5c')](_0x2e3e57[_0xd22b('0x47')])){for(var _0x10340d=0x0;_0x10340d<_0x2e3e57['body'][_0xd22b('0x38')];_0x10340d+=0x1){_0x2e3e57[_0xd22b('0x47')][_0x10340d][_0xd22b('0x52')]=_0x2e3e57[_0xd22b('0x42')]['id'];_0x3486d6[_0xd22b('0x5d')](_0x2e3e57[_0xd22b('0x47')][_0x10340d]);}return BPromise[_0xd22b('0x5e')](_0x3486d6,function(_0x681dcd){return db[_0xd22b('0x5a')][_0xd22b('0x46')](_['omit'](_0x681dcd,[_0xd22b('0x59'),'id'])||{},{'fields':_[_0xd22b('0x33')](_0x18cf04),'raw':!![]})[_0xd22b('0x26')](function(_0x16aebd){_0xd7c311[_0xd22b('0x5f')][_0xd22b('0x5d')](_0x16aebd['dataValues']);})[_0xd22b('0x40')](function(_0x57d590){_0xd7c311[_0xd22b('0x60')][_0xd22b('0x5d')]({'data':_0x681dcd,'error':_0x57d590[_0xd22b('0x61')]});});})[_0xd22b('0x26')](function(_0xe02edf){return _0xd7c311;})['catch'](function(_0x1b0550){return _0x1b0550;});}else{_0x113936['status'](0x190)[_0xd22b('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xd22b('0x26')](respondWithResult(_0x113936,null))[_0xd22b('0x40')](handleError(_0x113936,null));};exports[_0xd22b('0x62')]=function(_0x4bd8d6,_0x5a0439,_0x302271){var _0xe75d22;return db[_0xd22b('0x2c')][_0xd22b('0x45')]({'where':{'id':_0x4bd8d6[_0xd22b('0x42')]['id']},'include':[{'model':db[_0xd22b('0x63')],'as':_0xd22b('0x64')}]})[_0xd22b('0x26')](handleEntityNotFound(_0x5a0439,null))[_0xd22b('0x26')](function(_0x3e41bc){if(_0x3e41bc){_0xe75d22=_0x3e41bc;return db['CmContact']['rawAttributes'];}})[_0xd22b('0x26')](function(_0x4c237a){if(_0x4c237a){var _0x5c55d5={};var _0x2b0b7a={};_0x2b0b7a[_0xd22b('0x31')]=_['concat'](_[_0xd22b('0x33')](_0x4c237a),_[_0xd22b('0x2b')](_0xe75d22[_0xd22b('0x64')],function(_0x34321a){return util[_0xd22b('0x65')]('cf_%d',_0x34321a['id']);}));_0x2b0b7a[_0xd22b('0x32')]=_[_0xd22b('0x33')](_0x4bd8d6[_0xd22b('0x32')]);_0x2b0b7a['filters']=_[_0xd22b('0x35')](_0x2b0b7a[_0xd22b('0x31')],_0x2b0b7a[_0xd22b('0x32')]);_0x5c55d5[_0xd22b('0x36')]=_['intersection'](_0x2b0b7a['model'],qs[_0xd22b('0x37')](_0x4bd8d6[_0xd22b('0x32')]['fields']));_0x5c55d5[_0xd22b('0x36')]=_0x5c55d5[_0xd22b('0x36')][_0xd22b('0x38')]?_0x5c55d5[_0xd22b('0x36')]:_0x2b0b7a[_0xd22b('0x31')];if(!_0x4bd8d6[_0xd22b('0x32')][_0xd22b('0x55')](_0xd22b('0x66'))){_0x5c55d5[_0xd22b('0x20')]=qs[_0xd22b('0x20')](_0x4bd8d6[_0xd22b('0x32')][_0xd22b('0x20')]);_0x5c55d5['offset']=qs[_0xd22b('0x1d')](_0x4bd8d6[_0xd22b('0x32')][_0xd22b('0x1d')]);}_0x5c55d5[_0xd22b('0x67')]=qs[_0xd22b('0x39')](_0x4bd8d6[_0xd22b('0x32')][_0xd22b('0x39')]);_0x5c55d5[_0xd22b('0x3a')]=qs['filters'](_[_0xd22b('0x3b')](_0x4bd8d6[_0xd22b('0x32')],_0x2b0b7a[_0xd22b('0x34')]));_0x5c55d5['raw']=!![];if(_0x4bd8d6['query'][_0xd22b('0x3c')]){_0x5c55d5[_0xd22b('0x3a')]=_['merge'](_0x5c55d5[_0xd22b('0x3a')],{'$or':_[_0xd22b('0x2b')](_0x5c55d5['attributes'],function(_0x2aa632){var _0x408e38={};_0x408e38[_0x2aa632]={'$like':'%'+_0x4bd8d6[_0xd22b('0x32')]['filter']+'%'};return _0x408e38;})});}_0x5c55d5=_[_0xd22b('0x3d')]({},_0x5c55d5,_0x4bd8d6[_0xd22b('0x44')]);return _0xe75d22[_0xd22b('0x62')](_0x5c55d5);}})['then'](respondWithResult(_0x5a0439,null))[_0xd22b('0x40')](handleError(_0x5a0439,null));};exports[_0xd22b('0x68')]=function(_0x438850,_0x2ee8a4,_0x4a27a3){var _0x119b2b;var _0x379e0b;var _0x3b54f4;var _0x33139f=_0x438850[_0xd22b('0x42')]['id'];csv_results=[];return db[_0xd22b('0x69')][_0xd22b('0x56')]({'attributes':['id',_0xd22b('0x28')],'raw':!![],'order':[_0xd22b('0x6a')]})[_0xd22b('0x26')](function(_0x13d2ea){_0x119b2b=_0x13d2ea;var _0x184622=_['keys'](db['CmContact'][_0xd22b('0x2d')]);return db[_0xd22b('0x63')]['findAll']({'raw':!![],'attributes':['id',_0xd22b('0x6b')]})['then'](function(_0x298162){_0x379e0b=_0x298162;var _0x22eb18=squel[_0xd22b('0x6c')]()[_0xd22b('0x37')](_0x184622)[_0xd22b('0x6d')](_0xd22b('0x6e'),'c')[_0xd22b('0x3a')]('c.ListId\x20=\x20?',_0x33139f)[_0xd22b('0x3a')](_0xd22b('0x6f'))[_0xd22b('0x70')]();for(var _0xcc915f=0x0;_0xcc915f<_0x379e0b[_0xd22b('0x38')];_0xcc915f++){_0x22eb18[_0xd22b('0x71')]('c.cf_'+_0x379e0b[_0xcc915f]['id'],_0xd22b('0x72')+_0x379e0b[_0xcc915f]['alias']);}for(var _0xcc915f=0x0;_0xcc915f<_0x119b2b[_0xd22b('0x38')];_0xcc915f++){_0x22eb18[_0xd22b('0x71')](squel[_0xd22b('0x6c')]()[_0xd22b('0x71')](_0xd22b('0x73'))[_0xd22b('0x6d')]('cm_contact_has_items')[_0xd22b('0x3a')](_0xd22b('0x74'),_0x119b2b[_0xcc915f]['id'])[_0xd22b('0x3a')]('CmContactId\x20=\x20c.id'),_0xd22b('0x75')+_0x119b2b[_0xcc915f][_0xd22b('0x28')]);_0x22eb18[_0xd22b('0x71')](squel[_0xd22b('0x6c')]()['field'](_0xd22b('0x76'))[_0xd22b('0x6d')](_0xd22b('0x77'))[_0xd22b('0x3a')]('ItemTypeId\x20=\x20?',_0x119b2b[_0xcc915f]['id'])['where'](_0xd22b('0x78')),'description_additionalPhone_'+_0x119b2b[_0xcc915f][_0xd22b('0x28')]);}var _0x533f56=[];_0x533f56[_0xd22b('0x5d')](_0x22eb18[_0xd22b('0x79')]());BPromise[_0xd22b('0x5e')](_0x533f56,handleQuery)[_0xd22b('0x26')](function(_0x3a94ca){handleQuery(_0x22eb18[_0xd22b('0x79')]());var _0x538d6e=csv_results[0x0];if(!_[_0xd22b('0x7a')](_0x538d6e)){var _0x34c2bc=toCsv(_0x538d6e);var _0x1f3317=Date[_0xd22b('0x7b')]();fs[_0xd22b('0x7c')](util[_0xd22b('0x65')](_0xd22b('0x7d'),_0x33139f,_0x1f3317),_0x34c2bc);_0x2ee8a4[_0xd22b('0x7e')](_0xd22b('0x7f'),'attachment;\x20filename='+util['format'](_0xd22b('0x80'),_0x33139f,_0x1f3317));_0x2ee8a4[_0xd22b('0x7e')](_0xd22b('0x81'),_0xd22b('0x82'));return _0x2ee8a4[_0xd22b('0x83')](util[_0xd22b('0x65')]('/tmp/list_%d_%s.csv',_0x33139f,_0x1f3317));}else{return _0x2ee8a4[_0xd22b('0x19')](0xcc);}});});});};exports['addCustomField']=function(_0x3bb407,_0x475039,_0x6cad11){var _0x3a8da4;delete _0x3bb407[_0xd22b('0x47')]['id'];return db['CmList'][_0xd22b('0x54')]({'where':{'id':_0x3bb407[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x475039,null))[_0xd22b('0x26')](function(_0x4f28eb){if(_0x4f28eb){return db['sequelize'][_0xd22b('0x84')](function(_0x282a40){return db[_0xd22b('0x63')][_0xd22b('0x46')](_0x3bb407[_0xd22b('0x47')],{'transaction':_0x282a40})[_0xd22b('0x26')](function(_0x1cfe11){_0x3a8da4=_0x1cfe11;return _0x4f28eb[_0xd22b('0x85')](_0x1cfe11,{'transaction':_0x282a40});})[_0xd22b('0x26')](function(){var _0x373f5d={'type':db[_0xd22b('0x86')][_0xd22b('0x87')],'transaction':_0x282a40};switch(_0x3bb407[_0xd22b('0x47')]['type']){case _0xd22b('0x88'):_0x373f5d[_0xd22b('0x2f')]=db[_0xd22b('0x86')][_0xd22b('0x87')];break;case _0xd22b('0x89'):_0x373f5d['type']=db['Sequelize'][_0xd22b('0x8a')];break;case _0xd22b('0x8b'):_0x373f5d['type']=db['Sequelize']['BOOLEAN'];_0x373f5d[_0xd22b('0x8c')]=![];break;default:}return db[_0xd22b('0x8d')]['queryInterface']['addColumn']('cm_contacts',util['format']('cf_%s',_0x3a8da4['id']),_0x373f5d);})[_0xd22b('0x26')](function(){return _0x3a8da4;});});}})[_0xd22b('0x26')](respondWithResult(_0x475039,null))[_0xd22b('0x40')](handleError(_0x475039,null));};exports[_0xd22b('0x8e')]=function(_0x551357,_0x20c597,_0x50ef46){var _0x2de8d5={};var _0x4d0ff7={};var _0x32e7d9;var _0x362498;return db['CmList']['findOne']({'where':{'id':_0x551357[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x20c597,null))[_0xd22b('0x26')](function(_0x2bb741){if(_0x2bb741){_0x32e7d9=_0x2bb741;_0x4d0ff7[_0xd22b('0x31')]=_[_0xd22b('0x33')](db['CmCustomField'][_0xd22b('0x2d')]);_0x4d0ff7['query']=_[_0xd22b('0x33')](_0x551357[_0xd22b('0x32')]);_0x4d0ff7[_0xd22b('0x34')]=_[_0xd22b('0x35')](_0x4d0ff7[_0xd22b('0x31')],_0x4d0ff7['query']);_0x2de8d5[_0xd22b('0x36')]=_[_0xd22b('0x35')](_0x4d0ff7['model'],qs[_0xd22b('0x37')](_0x551357[_0xd22b('0x32')][_0xd22b('0x37')]));_0x2de8d5[_0xd22b('0x36')]=_0x2de8d5[_0xd22b('0x36')][_0xd22b('0x38')]?_0x2de8d5[_0xd22b('0x36')]:_0x4d0ff7[_0xd22b('0x31')];_0x2de8d5[_0xd22b('0x67')]=qs[_0xd22b('0x39')](_0x551357['query'][_0xd22b('0x39')]);_0x2de8d5['where']=qs['filters'](_[_0xd22b('0x3b')](_0x551357['query'],_0x4d0ff7[_0xd22b('0x34')]));_0x2de8d5[_0xd22b('0x3a')]=_[_0xd22b('0x3d')](_0x2de8d5[_0xd22b('0x3a')],{'$or':[{'ListId':_0x2bb741['id']},{'ListId':null}]});if(_0x551357['query'][_0xd22b('0x3c')]){_0x2de8d5[_0xd22b('0x3a')]=_[_0xd22b('0x3d')](_0x2de8d5['where'],{'$or':_[_0xd22b('0x2b')](_0x2de8d5[_0xd22b('0x36')],function(_0x4801f6){var _0x2388bf={};_0x2388bf[_0x4801f6]={'$like':'%'+_0x551357[_0xd22b('0x32')][_0xd22b('0x3c')]+'%'};return _0x2388bf;})});}_0x2de8d5=_[_0xd22b('0x3d')]({},_0x2de8d5,_0x551357[_0xd22b('0x44')]);return db[_0xd22b('0x63')][_0xd22b('0x8f')](_0x2de8d5);}})[_0xd22b('0x26')](respondWithResult(_0x20c597,null))[_0xd22b('0x40')](handleError(_0x20c597,null));};exports[_0xd22b('0x90')]=function(_0x49001d,_0x1bd04d){return db[_0xd22b('0x63')][_0xd22b('0x8f')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1bd04d,null))[_0xd22b('0x26')](function(_0x902be8){return _0x902be8;})[_0xd22b('0x26')](respondWithResult(_0x1bd04d,null))[_0xd22b('0x40')](handleError(_0x1bd04d,null));};exports[_0xd22b('0x91')]=function(_0x3f49c7,_0xc9647e,_0x592ed0){return db[_0xd22b('0x2c')][_0xd22b('0x45')]({'where':{'id':_0x3f49c7[_0xd22b('0x42')]['id']}})['then'](handleEntityNotFound(_0xc9647e,null))['then'](function(_0x26ecba){if(_0x26ecba){return _0x26ecba[_0xd22b('0x91')](_0x3f49c7[_0xd22b('0x47')][_0xd22b('0x59')],_[_0xd22b('0x92')](_0x3f49c7[_0xd22b('0x47')],[_0xd22b('0x59'),'id'])||{})[_0xd22b('0x93')](function(_0x16df10){for(var _0x35d305=0x0;_0x35d305<_0x3f49c7[_0xd22b('0x47')][_0xd22b('0x59')][_0xd22b('0x38')];_0x35d305+=0x1){socket[_0xd22b('0x94')](_0xd22b('0x95'),{'UserId':Number(_0x3f49c7[_0xd22b('0x47')][_0xd22b('0x59')][_0x35d305]),'CmListId':Number(_0x3f49c7[_0xd22b('0x42')]['id'])});}return _0x16df10;});}})['then'](respondWithResult(_0xc9647e,null))[_0xd22b('0x40')](handleError(_0xc9647e,null));};exports['removeAgents']=function(_0x48f88e,_0x29e650,_0x4a452c){return db[_0xd22b('0x2c')][_0xd22b('0x45')]({'where':{'id':_0x48f88e[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x29e650,null))[_0xd22b('0x26')](function(_0x42d20e){if(_0x42d20e){return _0x42d20e['removeAgents'](_0x48f88e[_0xd22b('0x32')][_0xd22b('0x59')])[_0xd22b('0x26')](function(){if(_['isArray'](_0x48f88e[_0xd22b('0x32')]['ids'])){for(var _0x1f7c00=0x0;_0x1f7c00<_0x48f88e[_0xd22b('0x32')][_0xd22b('0x59')][_0xd22b('0x38')];_0x1f7c00+=0x1){socket[_0xd22b('0x94')](_0xd22b('0x96'),{'UserId':Number(_0x48f88e[_0xd22b('0x32')][_0xd22b('0x59')][_0x1f7c00]),'CmListId':Number(_0x48f88e[_0xd22b('0x42')]['id'])});}}else{socket['emit'](_0xd22b('0x96'),{'UserId':Number(_0x48f88e[_0xd22b('0x32')][_0xd22b('0x59')]),'CmListId':Number(_0x48f88e[_0xd22b('0x42')]['id'])});}});}})[_0xd22b('0x26')](respondWithStatusCode(_0x29e650,null))[_0xd22b('0x40')](handleError(_0x29e650,null));};exports[_0xd22b('0x97')]=function(_0x3644ef,_0x129906,_0x184eb4){var _0x54bcd2={};var _0x31f470={};var _0x4dfae6;var _0x45008b;return db[_0xd22b('0x2c')]['findOne']({'where':{'id':_0x3644ef[_0xd22b('0x42')]['id']}})[_0xd22b('0x26')](handleEntityNotFound(_0x129906,null))[_0xd22b('0x26')](function(_0x4c9956){if(_0x4c9956){_0x4dfae6=_0x4c9956;_0x31f470[_0xd22b('0x31')]=_['keys'](db[_0xd22b('0x98')][_0xd22b('0x2d')]);_0x31f470[_0xd22b('0x32')]=_[_0xd22b('0x33')](_0x3644ef[_0xd22b('0x32')]);_0x31f470[_0xd22b('0x34')]=_[_0xd22b('0x35')](_0x31f470[_0xd22b('0x31')],_0x31f470['query']);_0x54bcd2[_0xd22b('0x36')]=_['intersection'](_0x31f470[_0xd22b('0x31')],qs['fields'](_0x3644ef['query'][_0xd22b('0x37')]));_0x54bcd2[_0xd22b('0x36')]=_0x54bcd2['attributes']['length']?_0x54bcd2['attributes']:_0x31f470[_0xd22b('0x31')];_0x54bcd2[_0xd22b('0x67')]=qs[_0xd22b('0x39')](_0x3644ef[_0xd22b('0x32')][_0xd22b('0x39')]);_0x54bcd2['where']=qs[_0xd22b('0x34')](_[_0xd22b('0x3b')](_0x3644ef[_0xd22b('0x32')],_0x31f470[_0xd22b('0x34')]));if(_0x3644ef[_0xd22b('0x32')][_0xd22b('0x3c')]){_0x54bcd2[_0xd22b('0x3a')]=_[_0xd22b('0x3d')](_0x54bcd2[_0xd22b('0x3a')],{'$or':_[_0xd22b('0x2b')](_0x54bcd2['attributes'],function(_0x5dae80){var _0x7a9265={};_0x7a9265[_0x5dae80]={'$like':'%'+_0x3644ef[_0xd22b('0x32')][_0xd22b('0x3c')]+'%'};return _0x7a9265;})});}_0x54bcd2=_['merge']({},_0x54bcd2,_0x3644ef[_0xd22b('0x44')]);return _0x4dfae6[_0xd22b('0x97')](_0x54bcd2);}})[_0xd22b('0x26')](function(_0x42f4bd){if(_0x42f4bd){_0x45008b=_0x42f4bd[_0xd22b('0x38')];if(!_0x3644ef['query'][_0xd22b('0x55')](_0xd22b('0x66'))){_0x54bcd2[_0xd22b('0x20')]=qs[_0xd22b('0x20')](_0x3644ef[_0xd22b('0x32')][_0xd22b('0x20')]);_0x54bcd2[_0xd22b('0x1d')]=qs['offset'](_0x3644ef[_0xd22b('0x32')][_0xd22b('0x1d')]);}return _0x4dfae6[_0xd22b('0x97')](_0x54bcd2);}})[_0xd22b('0x26')](function(_0x53ec05){if(_0x53ec05){return _0x53ec05?{'count':_0x45008b,'rows':_0x53ec05}:null;}})[_0xd22b('0x26')](respondWithResult(_0x129906,null))[_0xd22b('0x40')](handleError(_0x129906,null));};function handleQuery(_0x8645c){logger[_0xd22b('0x99')](_0x8645c);return db[_0xd22b('0x8d')][_0xd22b('0x32')](_0x8645c)[_0xd22b('0x93')](function(_0x4efd1e){csv_results[_0xd22b('0x5d')](_0x4efd1e);})[_0xd22b('0x40')](function(_0x55b87a){logger[_0xd22b('0x27')](_0x55b87a[_0xd22b('0x61')]);});} \ No newline at end of file +var _0xd606=['findAll','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','findOne','keys','Disposition','nolimit','ListId','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','message','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','CmList','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','options','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd606,0x1a1));var _0x6d60=function(_0x21c2bd,_0x52779a){_0x21c2bd=_0x21c2bd-0x0;var _0x54d40d=_0xd606[_0x21c2bd];return _0x54d40d;};'use strict';var emlformat=require(_0x6d60('0x0'));var rimraf=require(_0x6d60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d60('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d60('0x3'));var util=require(_0x6d60('0x4'));var path=require(_0x6d60('0x5'));var sox=require('sox');var csv=require(_0x6d60('0x6'));var ejs=require(_0x6d60('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6d60('0x8'));var crypto=require(_0x6d60('0x9'));var jsforce=require(_0x6d60('0xa'));var deskjs=require(_0x6d60('0xb'));var toCsv=require(_0x6d60('0x6'));var querystring=require('querystring');var Papa=require(_0x6d60('0xc'));var Redis=require(_0x6d60('0xd'));var authService=require(_0x6d60('0xe'));var qs=require(_0x6d60('0xf'));var as=require(_0x6d60('0x10'));var hardwareService=require(_0x6d60('0x11'));var logger=require(_0x6d60('0x12'))(_0x6d60('0x13'));var utils=require(_0x6d60('0x14'));var config=require(_0x6d60('0x15'));var licenseUtil=require(_0x6d60('0x16'));var db=require(_0x6d60('0x17'))['db'];var csv_results;config[_0x6d60('0x18')]=_[_0x6d60('0x19')](config[_0x6d60('0x18')],{'host':_0x6d60('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6d60('0x1b'))[_0x6d60('0x1c')](socket);function respondWithStatusCode(_0x1b420d,_0x3c2dd8){_0x3c2dd8=_0x3c2dd8||0xcc;return function(_0xe396a5){if(_0xe396a5){return _0x1b420d['sendStatus'](_0x3c2dd8);}return _0x1b420d[_0x6d60('0x1d')](_0x3c2dd8)[_0x6d60('0x1e')]();};}function respondWithResult(_0x3178cb,_0x590e36){_0x590e36=_0x590e36||0xc8;return function(_0x591aaa){if(_0x591aaa){return _0x3178cb['status'](_0x590e36)[_0x6d60('0x1f')](_0x591aaa);}};}function respondWithFilteredResult(_0x431706,_0x5584b7){return function(_0x43e29f){if(_0x43e29f){var _0x44aa9e=typeof _0x5584b7[_0x6d60('0x20')]==='undefined'&&typeof _0x5584b7[_0x6d60('0x21')]===_0x6d60('0x22');var _0x5ea304=_0x43e29f['count'];var _0x43b087=_0x44aa9e?0x0:_0x5584b7[_0x6d60('0x20')];var _0x355035=_0x44aa9e?_0x43e29f[_0x6d60('0x23')]:_0x5584b7[_0x6d60('0x20')]+_0x5584b7['limit'];var _0x3136d2;if(_0x355035>=_0x5ea304){_0x355035=_0x5ea304;_0x3136d2=0xc8;}else{_0x3136d2=0xce;}_0x431706[_0x6d60('0x1d')](_0x3136d2);return _0x431706[_0x6d60('0x24')](_0x6d60('0x25'),_0x43b087+'-'+_0x355035+'/'+_0x5ea304)[_0x6d60('0x1f')](_0x43e29f);}return null;};}function patchUpdates(_0x3079f9){return function(_0x137158){try{jsonpatch[_0x6d60('0x26')](_0x137158,_0x3079f9,!![]);}catch(_0x25fd75){return BPromise['reject'](_0x25fd75);}return _0x137158[_0x6d60('0x27')]();};}function saveUpdates(_0x4a0d68,_0x29a854){return function(_0x4747d7){if(_0x4747d7){return _0x4747d7[_0x6d60('0x28')](_0x4a0d68)[_0x6d60('0x29')](function(_0x34ee9e){return _0x34ee9e;});}return null;};}function removeEntity(_0x51dae7,_0x48cc05){return function(_0x120081){if(_0x120081){return _0x120081['destroy']()[_0x6d60('0x29')](function(){var _0x37c2c6=_0x120081[_0x6d60('0x2a')]({'plain':!![]});var _0x43f120='Lists';return db[_0x6d60('0x2b')]['destroy']({'where':{'type':_0x43f120,'resourceId':_0x37c2c6['id']}})[_0x6d60('0x29')](function(){return _0x120081;});})[_0x6d60('0x29')](function(){_0x51dae7[_0x6d60('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198863,_0x667106){return function(_0x4c1131){if(!_0x4c1131){_0x198863[_0x6d60('0x2c')](0x194);}return _0x4c1131;};}function handleError(_0x3623a5,_0x32ad2c){_0x32ad2c=_0x32ad2c||0x1f4;return function(_0x37a478){logger[_0x6d60('0x2d')](_0x37a478[_0x6d60('0x2e')]);if(_0x37a478[_0x6d60('0x2f')]){delete _0x37a478[_0x6d60('0x2f')];}_0x3623a5[_0x6d60('0x1d')](_0x32ad2c)[_0x6d60('0x30')](_0x37a478);};}exports[_0x6d60('0x31')]=function(_0x2237fc,_0x507699){var _0x92c007={},_0x3dc04c={},_0x385be1={'count':0x0,'rows':[]};var _0x188fee=_['map'](db[_0x6d60('0x32')]['rawAttributes'],function(_0x56a18e){return{'name':_0x56a18e[_0x6d60('0x33')],'type':_0x56a18e[_0x6d60('0x34')]['key']};});_0x3dc04c[_0x6d60('0x35')]=_['map'](_0x188fee,_0x6d60('0x2f'));_0x3dc04c[_0x6d60('0x36')]=_['keys'](_0x2237fc[_0x6d60('0x36')]);_0x3dc04c['filters']=_[_0x6d60('0x37')](_0x3dc04c[_0x6d60('0x35')],_0x3dc04c['query']);_0x92c007['attributes']=_[_0x6d60('0x37')](_0x3dc04c['model'],qs[_0x6d60('0x38')](_0x2237fc[_0x6d60('0x36')][_0x6d60('0x38')]));_0x92c007[_0x6d60('0x39')]=_0x92c007['attributes'][_0x6d60('0x3a')]?_0x92c007[_0x6d60('0x39')]:_0x3dc04c[_0x6d60('0x35')];if(!_0x2237fc[_0x6d60('0x36')][_0x6d60('0x3b')]('nolimit')){_0x92c007[_0x6d60('0x21')]=qs['limit'](_0x2237fc[_0x6d60('0x36')]['limit']);_0x92c007['offset']=qs[_0x6d60('0x20')](_0x2237fc[_0x6d60('0x36')][_0x6d60('0x20')]);}_0x92c007[_0x6d60('0x3c')]=qs[_0x6d60('0x3d')](_0x2237fc[_0x6d60('0x36')][_0x6d60('0x3d')]);_0x92c007[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x2237fc['query'],_0x3dc04c[_0x6d60('0x3f')]),_0x188fee);if(_0x2237fc[_0x6d60('0x36')][_0x6d60('0x41')]){_0x92c007[_0x6d60('0x3e')]=_['merge'](_0x92c007[_0x6d60('0x3e')],{'$or':_[_0x6d60('0x42')](_0x188fee,function(_0x1e6b1c){if(_0x1e6b1c['type']!=='VIRTUAL'){var _0xd107da={};_0xd107da[_0x1e6b1c[_0x6d60('0x2f')]]={'$like':'%'+_0x2237fc[_0x6d60('0x36')][_0x6d60('0x41')]+'%'};return _0xd107da;}})});}_0x92c007=_['merge']({},_0x92c007,_0x2237fc[_0x6d60('0x43')]);var _0x5c0e24={'where':_0x92c007['where']};return db[_0x6d60('0x32')][_0x6d60('0x23')](_0x5c0e24)[_0x6d60('0x29')](function(_0x517843){_0x385be1[_0x6d60('0x23')]=_0x517843;if(_0x2237fc[_0x6d60('0x36')]['includeAll']){_0x92c007[_0x6d60('0x44')]=[{'all':!![]}];}return db['CmList'][_0x6d60('0x45')](_0x92c007);})[_0x6d60('0x29')](function(_0x33881e){_0x385be1[_0x6d60('0x46')]=_0x33881e;return _0x385be1;})[_0x6d60('0x29')](respondWithFilteredResult(_0x507699,_0x92c007))[_0x6d60('0x47')](handleError(_0x507699,null));};exports[_0x6d60('0x48')]=function(_0x2b0772,_0x3c5dbe){var _0x48db3d={'raw':![],'where':{'id':_0x2b0772[_0x6d60('0x49')]['id']}},_0x209c55={};_0x209c55['model']=_['keys'](db[_0x6d60('0x32')][_0x6d60('0x4a')]);_0x209c55[_0x6d60('0x36')]=_['keys'](_0x2b0772[_0x6d60('0x36')]);_0x209c55['filters']=_['intersection'](_0x209c55['model'],_0x209c55['query']);_0x48db3d[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x209c55[_0x6d60('0x35')],qs[_0x6d60('0x38')](_0x2b0772['query'][_0x6d60('0x38')]));_0x48db3d[_0x6d60('0x39')]=_0x48db3d[_0x6d60('0x39')][_0x6d60('0x3a')]?_0x48db3d[_0x6d60('0x39')]:_0x209c55[_0x6d60('0x35')];if(_0x2b0772[_0x6d60('0x36')][_0x6d60('0x4b')]){_0x48db3d['include']=[{'all':!![]}];}_0x48db3d=_[_0x6d60('0x4c')]({},_0x48db3d,_0x2b0772[_0x6d60('0x43')]);return db[_0x6d60('0x32')][_0x6d60('0x4d')](_0x48db3d)[_0x6d60('0x29')](handleEntityNotFound(_0x3c5dbe,null))[_0x6d60('0x29')](respondWithResult(_0x3c5dbe,null))['catch'](handleError(_0x3c5dbe,null));};exports[_0x6d60('0x4e')]=function(_0x19e323,_0x4cc661){return db['CmList'][_0x6d60('0x4e')](_0x19e323[_0x6d60('0x4f')],{})[_0x6d60('0x29')](function(_0x13474e){var _0x37fedd=_0x19e323[_0x6d60('0x50')][_0x6d60('0x2a')]({'plain':!![]});if(!_0x37fedd)throw new Error(_0x6d60('0x51'));if(_0x37fedd[_0x6d60('0x52')]===_0x6d60('0x50')){var _0x51259c=_0x13474e[_0x6d60('0x2a')]({'plain':!![]});var _0x4e9571=_0x6d60('0x53');return db[_0x6d60('0x54')]['find']({'where':{'name':_0x4e9571,'userProfileId':_0x37fedd['userProfileId']},'raw':!![]})[_0x6d60('0x29')](function(_0x5452c3){if(_0x5452c3&&_0x5452c3[_0x6d60('0x55')]===0x0){return db[_0x6d60('0x2b')]['create']({'name':_0x51259c[_0x6d60('0x2f')],'resourceId':_0x51259c['id'],'type':_0x5452c3[_0x6d60('0x2f')],'sectionId':_0x5452c3['id']},{})[_0x6d60('0x29')](function(){return _0x13474e;});}else{return _0x13474e;}})[_0x6d60('0x47')](function(_0x4fbaec){logger[_0x6d60('0x2d')](_0x6d60('0x56'),_0x4fbaec);throw _0x4fbaec;});}return _0x13474e;})[_0x6d60('0x29')](respondWithResult(_0x4cc661,0xc9))[_0x6d60('0x47')](handleError(_0x4cc661,null));};exports[_0x6d60('0x28')]=function(_0x40a231,_0x359ee1){if(_0x40a231['body']['id']){delete _0x40a231[_0x6d60('0x4f')]['id'];}return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0x40a231[_0x6d60('0x49')]['id']}})['then'](handleEntityNotFound(_0x359ee1,null))[_0x6d60('0x29')](saveUpdates(_0x40a231[_0x6d60('0x4f')],null))[_0x6d60('0x29')](respondWithResult(_0x359ee1,null))[_0x6d60('0x47')](handleError(_0x359ee1,null));};exports[_0x6d60('0x57')]=function(_0xc18800,_0x53af26){return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0xc18800[_0x6d60('0x49')]['id']}})['then'](handleEntityNotFound(_0x53af26,null))['then'](removeEntity(_0x53af26,null))[_0x6d60('0x47')](handleError(_0x53af26,null));};exports[_0x6d60('0x58')]=function(_0x4eb8c2,_0x310d6d){return db[_0x6d60('0x32')][_0x6d60('0x58')]()[_0x6d60('0x29')](respondWithResult(_0x310d6d,null))[_0x6d60('0x47')](handleError(_0x310d6d,null));};exports[_0x6d60('0x59')]=function(_0x10b516,_0x19423a,_0x4cdff1){if(_0x10b516['body']['id']){delete _0x10b516[_0x6d60('0x4f')]['id'];}return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0x10b516[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x19423a,null))[_0x6d60('0x29')](function(_0x161906){if(_0x161906){_0x10b516[_0x6d60('0x4f')]['ListId']=_0x161906['id'];return db['Disposition'][_0x6d60('0x4e')](_0x10b516[_0x6d60('0x4f')]);}})[_0x6d60('0x29')](respondWithResult(_0x19423a,null))[_0x6d60('0x47')](handleError(_0x19423a,null));};exports['getDispositions']=function(_0x119216,_0x5d9fa8,_0x20ce63){var _0x3dd16d={'raw':![],'where':{}};var _0x37e6a7={};var _0x53b5bb={'count':0x0,'rows':[]};return db['CmList'][_0x6d60('0x5a')]({'where':{'id':_0x119216[_0x6d60('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d9fa8,null))[_0x6d60('0x29')](function(_0x5da59a){if(_0x5da59a){_0x37e6a7[_0x6d60('0x35')]=_[_0x6d60('0x5b')](db[_0x6d60('0x5c')][_0x6d60('0x4a')]);_0x37e6a7[_0x6d60('0x36')]=_[_0x6d60('0x5b')](_0x119216[_0x6d60('0x36')]);_0x37e6a7['filters']=_['intersection'](_0x37e6a7['model'],_0x37e6a7[_0x6d60('0x36')]);_0x3dd16d[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x37e6a7[_0x6d60('0x35')],qs['fields'](_0x119216['query'][_0x6d60('0x38')]));_0x3dd16d[_0x6d60('0x39')]=_0x3dd16d['attributes'][_0x6d60('0x3a')]?_0x3dd16d[_0x6d60('0x39')]:_0x37e6a7[_0x6d60('0x35')];if(!_0x119216[_0x6d60('0x36')]['hasOwnProperty'](_0x6d60('0x5d'))){_0x3dd16d[_0x6d60('0x21')]=qs['limit'](_0x119216[_0x6d60('0x36')][_0x6d60('0x21')]);_0x3dd16d['offset']=qs[_0x6d60('0x20')](_0x119216[_0x6d60('0x36')][_0x6d60('0x20')]);}_0x3dd16d[_0x6d60('0x3c')]=qs[_0x6d60('0x3d')](_0x119216[_0x6d60('0x36')][_0x6d60('0x3d')]);_0x3dd16d[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x119216[_0x6d60('0x36')],_0x37e6a7['filters']));_0x3dd16d[_0x6d60('0x3e')][_0x6d60('0x5e')]=_0x5da59a['id'];if(_0x119216['query'][_0x6d60('0x41')]){_0x3dd16d[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x3dd16d[_0x6d60('0x3e')],{'$or':_['map'](_0x3dd16d['attributes'],function(_0x20688f){var _0xb8af8d={};_0xb8af8d[_0x20688f]={'$like':'%'+_0x119216[_0x6d60('0x36')][_0x6d60('0x41')]+'%'};return _0xb8af8d;})});}_0x3dd16d=_['merge']({},_0x3dd16d,_0x119216['options']);return db[_0x6d60('0x5c')]['count']({'where':_0x3dd16d[_0x6d60('0x3e')]})[_0x6d60('0x29')](function(_0x452245){_0x53b5bb[_0x6d60('0x23')]=_0x452245;if(_0x119216[_0x6d60('0x36')]['includeAll']){_0x3dd16d[_0x6d60('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x6d60('0x45')](_0x3dd16d);})[_0x6d60('0x29')](function(_0x49618c){_0x53b5bb['rows']=_0x49618c;return _0x53b5bb;});}})[_0x6d60('0x29')](respondWithFilteredResult(_0x5d9fa8,_0x3dd16d))[_0x6d60('0x47')](handleError(_0x5d9fa8,null));};exports['removeDispositions']=function(_0x4787c0,_0x1b6788,_0x1ce87c){return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0x4787c0[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x1b6788,null))[_0x6d60('0x29')](function(_0x54a2e9){if(_0x54a2e9){return _0x54a2e9[_0x6d60('0x5f')](_0x4787c0['query'][_0x6d60('0x60')]);}})[_0x6d60('0x29')](respondWithStatusCode(_0x1b6788,null))[_0x6d60('0x47')](handleError(_0x1b6788,null));};exports[_0x6d60('0x61')]=function(_0x458a3a,_0x48ee16,_0x84c92f){return db[_0x6d60('0x32')]['find']({'where':{'id':_0x458a3a['params']['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x48ee16,null))[_0x6d60('0x29')](function(_0x56f70d){if(_0x56f70d){var _0x365a74=[];var _0x1a4520={'success':[],'errors':[]};return db[_0x6d60('0x62')][_0x6d60('0x58')]()[_0x6d60('0x29')](function(_0xc52f8){if(_0x458a3a['body']['tags']&&_['isArray'](_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')])){if(_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')]['length']){_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')]=_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')][_0x6d60('0x64')](';')+';';}else{_0x458a3a[_0x6d60('0x4f')]['tags']=null;}}else{_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')]=null;}if(_0x458a3a[_0x6d60('0x4f')]&&_[_0x6d60('0x65')](_0x458a3a[_0x6d60('0x4f')])){for(var _0x34e0f2=0x0;_0x34e0f2<_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x3a')];_0x34e0f2+=0x1){_0x458a3a[_0x6d60('0x4f')][_0x34e0f2][_0x6d60('0x5e')]=_0x458a3a[_0x6d60('0x49')]['id'];_0x365a74[_0x6d60('0x66')](_0x458a3a[_0x6d60('0x4f')][_0x34e0f2]);}return BPromise[_0x6d60('0x67')](_0x365a74,function(_0x317d9f){return db['CmContact'][_0x6d60('0x4e')](_[_0x6d60('0x68')](_0x317d9f,[_0x6d60('0x60'),'id'])||{},{'fields':_[_0x6d60('0x5b')](_0xc52f8),'raw':!![]})['then'](function(_0x3c96c8){_0x1a4520[_0x6d60('0x69')][_0x6d60('0x66')](_0x3c96c8[_0x6d60('0x6a')]);})['catch'](function(_0x2fc388){_0x1a4520[_0x6d60('0x6b')]['push']({'data':_0x317d9f,'error':_0x2fc388['message']});});})['then'](function(_0x24c21c){return _0x1a4520;})[_0x6d60('0x47')](function(_0x495d6b){return _0x495d6b;});}else{_0x48ee16[_0x6d60('0x1d')](0x190)[_0x6d60('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6d60('0x29')](respondWithResult(_0x48ee16,null))[_0x6d60('0x47')](handleError(_0x48ee16,null));};exports[_0x6d60('0x6c')]=function(_0x71216a,_0x2d83aa,_0xb6bf3c){var _0x5f189b;return db[_0x6d60('0x32')]['find']({'where':{'id':_0x71216a[_0x6d60('0x49')]['id']},'include':[{'model':db[_0x6d60('0x6d')],'as':_0x6d60('0x6e')}]})['then'](handleEntityNotFound(_0x2d83aa,null))['then'](function(_0x4a7037){if(_0x4a7037){_0x5f189b=_0x4a7037;return db[_0x6d60('0x62')][_0x6d60('0x4a')];}})[_0x6d60('0x29')](function(_0x4f913b){if(_0x4f913b){var _0x435ab8={};var _0x581dc7={};_0x581dc7['model']=_['concat'](_['keys'](_0x4f913b),_[_0x6d60('0x42')](_0x5f189b[_0x6d60('0x6e')],function(_0x26291){return util[_0x6d60('0x6f')](_0x6d60('0x70'),_0x26291['id']);}));_0x581dc7['query']=_[_0x6d60('0x5b')](_0x71216a[_0x6d60('0x36')]);_0x581dc7[_0x6d60('0x3f')]=_['intersection'](_0x581dc7['model'],_0x581dc7['query']);_0x435ab8[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x581dc7[_0x6d60('0x35')],qs[_0x6d60('0x38')](_0x71216a['query'][_0x6d60('0x38')]));_0x435ab8[_0x6d60('0x39')]=_0x435ab8[_0x6d60('0x39')]['length']?_0x435ab8[_0x6d60('0x39')]:_0x581dc7[_0x6d60('0x35')];if(!_0x71216a[_0x6d60('0x36')][_0x6d60('0x3b')](_0x6d60('0x5d'))){_0x435ab8[_0x6d60('0x21')]=qs[_0x6d60('0x21')](_0x71216a[_0x6d60('0x36')][_0x6d60('0x21')]);_0x435ab8[_0x6d60('0x20')]=qs[_0x6d60('0x20')](_0x71216a[_0x6d60('0x36')][_0x6d60('0x20')]);}_0x435ab8['order']=qs[_0x6d60('0x3d')](_0x71216a['query'][_0x6d60('0x3d')]);_0x435ab8[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x71216a['query'],_0x581dc7[_0x6d60('0x3f')]));_0x435ab8['raw']=!![];if(_0x71216a['query']['filter']){_0x435ab8[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x435ab8[_0x6d60('0x3e')],{'$or':_['map'](_0x435ab8[_0x6d60('0x39')],function(_0x237b17){var _0x33e8ec={};_0x33e8ec[_0x237b17]={'$like':'%'+_0x71216a[_0x6d60('0x36')]['filter']+'%'};return _0x33e8ec;})});}_0x435ab8=_[_0x6d60('0x4c')]({},_0x435ab8,_0x71216a[_0x6d60('0x43')]);return _0x5f189b['getContacts'](_0x435ab8);}})['then'](respondWithResult(_0x2d83aa,null))['catch'](handleError(_0x2d83aa,null));};exports[_0x6d60('0x71')]=function(_0x5b56c0,_0x4164d1,_0x4916ef){var _0x1c3452;var _0x1f4b5d;var _0x4c0822;var _0x5c5a27=_0x5b56c0[_0x6d60('0x49')]['id'];csv_results=[];return db['ContactItemType'][_0x6d60('0x45')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x6d60('0x29')](function(_0xd54dab){_0x1c3452=_0xd54dab;var _0x39926c=_[_0x6d60('0x5b')](db[_0x6d60('0x62')][_0x6d60('0x4a')]);return db[_0x6d60('0x6d')][_0x6d60('0x45')]({'raw':!![],'attributes':['id',_0x6d60('0x72')]})['then'](function(_0x35fa82){_0x1f4b5d=_0x35fa82;var _0x3c4b57=squel[_0x6d60('0x73')]()[_0x6d60('0x38')](_0x39926c)[_0x6d60('0x74')](_0x6d60('0x75'),'c')[_0x6d60('0x3e')](_0x6d60('0x76'),_0x5c5a27)['where'](_0x6d60('0x77'))[_0x6d60('0x78')]();for(var _0x290110=0x0;_0x290110<_0x1f4b5d['length'];_0x290110++){_0x3c4b57[_0x6d60('0x79')](_0x6d60('0x7a')+_0x1f4b5d[_0x290110]['id'],_0x6d60('0x7b')+_0x1f4b5d[_0x290110][_0x6d60('0x72')]);}for(var _0x290110=0x0;_0x290110<_0x1c3452[_0x6d60('0x3a')];_0x290110++){_0x3c4b57[_0x6d60('0x79')](squel['select']()[_0x6d60('0x79')](_0x6d60('0x7c'))[_0x6d60('0x74')](_0x6d60('0x7d'))[_0x6d60('0x3e')](_0x6d60('0x7e'),_0x1c3452[_0x290110]['id'])[_0x6d60('0x3e')](_0x6d60('0x7f')),_0x6d60('0x80')+_0x1c3452[_0x290110][_0x6d60('0x2f')]);_0x3c4b57[_0x6d60('0x79')](squel[_0x6d60('0x73')]()[_0x6d60('0x79')](_0x6d60('0x81'))[_0x6d60('0x74')]('cm_contact_has_items')[_0x6d60('0x3e')]('ItemTypeId\x20=\x20?',_0x1c3452[_0x290110]['id'])[_0x6d60('0x3e')](_0x6d60('0x7f')),_0x6d60('0x82')+_0x1c3452[_0x290110][_0x6d60('0x2f')]);}var _0x2a0b33=[];_0x2a0b33[_0x6d60('0x66')](_0x3c4b57[_0x6d60('0x83')]());BPromise[_0x6d60('0x67')](_0x2a0b33,handleQuery)[_0x6d60('0x29')](function(_0x47fa90){handleQuery(_0x3c4b57['toString']());var _0x3d3823=csv_results[0x0];if(!_[_0x6d60('0x84')](_0x3d3823)){var _0x464068=toCsv(_0x3d3823);var _0x35eb5b=Date[_0x6d60('0x85')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x5c5a27,_0x35eb5b),_0x464068);_0x4164d1[_0x6d60('0x86')](_0x6d60('0x87'),_0x6d60('0x88')+util[_0x6d60('0x6f')]('list_%d_%s.csv',_0x5c5a27,_0x35eb5b));_0x4164d1[_0x6d60('0x86')](_0x6d60('0x89'),'text/csv');return _0x4164d1[_0x6d60('0x8a')](util['format']('/tmp/list_%d_%s.csv',_0x5c5a27,_0x35eb5b));}else{return _0x4164d1[_0x6d60('0x2c')](0xcc);}});});});};exports[_0x6d60('0x8b')]=function(_0x1d4284,_0x490419,_0x4d53c5){var _0x46f18b;delete _0x1d4284['body']['id'];return db[_0x6d60('0x32')]['findOne']({'where':{'id':_0x1d4284['params']['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x490419,null))[_0x6d60('0x29')](function(_0x412b05){if(_0x412b05){return db[_0x6d60('0x8c')]['transaction'](function(_0x342914){return db[_0x6d60('0x6d')][_0x6d60('0x4e')](_0x1d4284[_0x6d60('0x4f')],{'transaction':_0x342914})[_0x6d60('0x29')](function(_0x108c2c){_0x46f18b=_0x108c2c;return _0x412b05[_0x6d60('0x8d')](_0x108c2c,{'transaction':_0x342914});})['then'](function(){var _0x4768da={'type':db[_0x6d60('0x8e')]['TEXT'],'transaction':_0x342914};switch(_0x1d4284[_0x6d60('0x4f')][_0x6d60('0x34')]){case _0x6d60('0x8f'):_0x4768da[_0x6d60('0x34')]=db[_0x6d60('0x8e')][_0x6d60('0x90')];break;case _0x6d60('0x91'):_0x4768da['type']=db[_0x6d60('0x8e')]['INTEGER'];break;case'switch':_0x4768da[_0x6d60('0x34')]=db['Sequelize'][_0x6d60('0x92')];_0x4768da[_0x6d60('0x93')]=![];break;default:}return db[_0x6d60('0x8c')][_0x6d60('0x94')][_0x6d60('0x95')]('cm_contacts',util[_0x6d60('0x6f')](_0x6d60('0x96'),_0x46f18b['id']),_0x4768da);})[_0x6d60('0x29')](function(){return _0x46f18b;});});}})[_0x6d60('0x29')](respondWithResult(_0x490419,null))[_0x6d60('0x47')](handleError(_0x490419,null));};exports[_0x6d60('0x97')]=function(_0x18b8e9,_0x41d96a,_0x193f63){var _0x416ee9={};var _0x316a78={};var _0xe97026;var _0x3b310f;return db['CmList'][_0x6d60('0x5a')]({'where':{'id':_0x18b8e9[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x41d96a,null))[_0x6d60('0x29')](function(_0x49d7e4){if(_0x49d7e4){_0xe97026=_0x49d7e4;_0x316a78[_0x6d60('0x35')]=_['keys'](db[_0x6d60('0x6d')][_0x6d60('0x4a')]);_0x316a78[_0x6d60('0x36')]=_[_0x6d60('0x5b')](_0x18b8e9[_0x6d60('0x36')]);_0x316a78['filters']=_[_0x6d60('0x37')](_0x316a78[_0x6d60('0x35')],_0x316a78[_0x6d60('0x36')]);_0x416ee9[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x316a78[_0x6d60('0x35')],qs[_0x6d60('0x38')](_0x18b8e9['query'][_0x6d60('0x38')]));_0x416ee9[_0x6d60('0x39')]=_0x416ee9['attributes'][_0x6d60('0x3a')]?_0x416ee9['attributes']:_0x316a78[_0x6d60('0x35')];_0x416ee9[_0x6d60('0x3c')]=qs[_0x6d60('0x3d')](_0x18b8e9[_0x6d60('0x36')][_0x6d60('0x3d')]);_0x416ee9[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x18b8e9[_0x6d60('0x36')],_0x316a78[_0x6d60('0x3f')]));_0x416ee9[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x416ee9['where'],{'$or':[{'ListId':_0x49d7e4['id']},{'ListId':null}]});if(_0x18b8e9[_0x6d60('0x36')]['filter']){_0x416ee9[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x416ee9['where'],{'$or':_['map'](_0x416ee9[_0x6d60('0x39')],function(_0x16a47d){var _0x59ca9e={};_0x59ca9e[_0x16a47d]={'$like':'%'+_0x18b8e9[_0x6d60('0x36')]['filter']+'%'};return _0x59ca9e;})});}_0x416ee9=_[_0x6d60('0x4c')]({},_0x416ee9,_0x18b8e9['options']);return db[_0x6d60('0x6d')][_0x6d60('0x98')](_0x416ee9);}})[_0x6d60('0x29')](respondWithResult(_0x41d96a,null))['catch'](handleError(_0x41d96a,null));};exports['getGlobalCustomFields']=function(_0x406558,_0x100522){return db[_0x6d60('0x6d')][_0x6d60('0x98')]({'where':{'ListId':null}})[_0x6d60('0x29')](handleEntityNotFound(_0x100522,null))['then'](function(_0x3c57c3){return _0x3c57c3;})[_0x6d60('0x29')](respondWithResult(_0x100522,null))[_0x6d60('0x47')](handleError(_0x100522,null));};exports[_0x6d60('0x99')]=function(_0x332b36,_0x175277,_0x315307){return db['CmList'][_0x6d60('0x4d')]({'where':{'id':_0x332b36[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x175277,null))[_0x6d60('0x29')](function(_0x2f2055){if(_0x2f2055){return _0x2f2055[_0x6d60('0x99')](_0x332b36['body'][_0x6d60('0x60')],_['omit'](_0x332b36[_0x6d60('0x4f')],[_0x6d60('0x60'),'id'])||{})[_0x6d60('0x9a')](function(_0x5e58bf){for(var _0x4d8262=0x0;_0x4d8262<_0x332b36[_0x6d60('0x4f')][_0x6d60('0x60')][_0x6d60('0x3a')];_0x4d8262+=0x1){socket[_0x6d60('0x9b')](_0x6d60('0x9c'),{'UserId':Number(_0x332b36[_0x6d60('0x4f')][_0x6d60('0x60')][_0x4d8262]),'CmListId':Number(_0x332b36[_0x6d60('0x49')]['id'])});}return _0x5e58bf;});}})['then'](respondWithResult(_0x175277,null))[_0x6d60('0x47')](handleError(_0x175277,null));};exports[_0x6d60('0x9d')]=function(_0x3e69ad,_0x34ae31,_0x82d88b){return db['CmList'][_0x6d60('0x4d')]({'where':{'id':_0x3e69ad[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x34ae31,null))[_0x6d60('0x29')](function(_0xdf8e69){if(_0xdf8e69){return _0xdf8e69[_0x6d60('0x9d')](_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')])[_0x6d60('0x29')](function(){if(_[_0x6d60('0x65')](_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')])){for(var _0x4dc7a9=0x0;_0x4dc7a9<_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')][_0x6d60('0x3a')];_0x4dc7a9+=0x1){socket[_0x6d60('0x9b')](_0x6d60('0x9e'),{'UserId':Number(_0x3e69ad['query'][_0x6d60('0x60')][_0x4dc7a9]),'CmListId':Number(_0x3e69ad[_0x6d60('0x49')]['id'])});}}else{socket['emit'](_0x6d60('0x9e'),{'UserId':Number(_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')]),'CmListId':Number(_0x3e69ad[_0x6d60('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x34ae31,null))[_0x6d60('0x47')](handleError(_0x34ae31,null));};exports['getAgents']=function(_0x5e8499,_0x45ca62,_0x28407a){var _0x48841f={};var _0x53bcb9={};var _0x2fbf0f;var _0x5eda3f;return db[_0x6d60('0x32')][_0x6d60('0x5a')]({'where':{'id':_0x5e8499[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x45ca62,null))[_0x6d60('0x29')](function(_0x43b44c){if(_0x43b44c){_0x2fbf0f=_0x43b44c;_0x53bcb9['model']=_['keys'](db['User'][_0x6d60('0x4a')]);_0x53bcb9[_0x6d60('0x36')]=_[_0x6d60('0x5b')](_0x5e8499['query']);_0x53bcb9[_0x6d60('0x3f')]=_[_0x6d60('0x37')](_0x53bcb9[_0x6d60('0x35')],_0x53bcb9[_0x6d60('0x36')]);_0x48841f['attributes']=_[_0x6d60('0x37')](_0x53bcb9[_0x6d60('0x35')],qs['fields'](_0x5e8499[_0x6d60('0x36')]['fields']));_0x48841f[_0x6d60('0x39')]=_0x48841f[_0x6d60('0x39')][_0x6d60('0x3a')]?_0x48841f[_0x6d60('0x39')]:_0x53bcb9['model'];_0x48841f[_0x6d60('0x3c')]=qs['sort'](_0x5e8499['query'][_0x6d60('0x3d')]);_0x48841f['where']=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x5e8499[_0x6d60('0x36')],_0x53bcb9[_0x6d60('0x3f')]));if(_0x5e8499[_0x6d60('0x36')]['filter']){_0x48841f[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x48841f[_0x6d60('0x3e')],{'$or':_[_0x6d60('0x42')](_0x48841f['attributes'],function(_0x34605e){var _0x10b914={};_0x10b914[_0x34605e]={'$like':'%'+_0x5e8499[_0x6d60('0x36')][_0x6d60('0x41')]+'%'};return _0x10b914;})});}_0x48841f=_[_0x6d60('0x4c')]({},_0x48841f,_0x5e8499[_0x6d60('0x43')]);return _0x2fbf0f[_0x6d60('0x9f')](_0x48841f);}})['then'](function(_0xa6639){if(_0xa6639){_0x5eda3f=_0xa6639[_0x6d60('0x3a')];if(!_0x5e8499[_0x6d60('0x36')][_0x6d60('0x3b')](_0x6d60('0x5d'))){_0x48841f[_0x6d60('0x21')]=qs[_0x6d60('0x21')](_0x5e8499['query'][_0x6d60('0x21')]);_0x48841f[_0x6d60('0x20')]=qs[_0x6d60('0x20')](_0x5e8499['query'][_0x6d60('0x20')]);}return _0x2fbf0f['getAgents'](_0x48841f);}})[_0x6d60('0x29')](function(_0x303e9b){if(_0x303e9b){return _0x303e9b?{'count':_0x5eda3f,'rows':_0x303e9b}:null;}})[_0x6d60('0x29')](respondWithResult(_0x45ca62,null))[_0x6d60('0x47')](handleError(_0x45ca62,null));};function handleQuery(_0x972124){logger[_0x6d60('0xa0')](_0x972124);return db[_0x6d60('0x8c')][_0x6d60('0x36')](_0x972124)[_0x6d60('0x9a')](function(_0x1e7f99){csv_results['push'](_0x1e7f99);})['catch'](function(_0x53a1b3){logger[_0x6d60('0x2d')](_0x53a1b3[_0x6d60('0xa1')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 77c8dbf..4bd07bf 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1c9648,_0x19f34f){var _0x8be4fb=function(_0x57192c){while(--_0x57192c){_0x1c9648['push'](_0x1c9648['shift']());}};_0x8be4fb(++_0x19f34f);}(_0x814b,0x1a2));var _0xb814=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x814b[_0x1b6c6d];return _0x290d9d;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x5337b7,_0x20e927){var _0x813f10=function(_0xd95cb8){while(--_0xd95cb8){_0x5337b7['push'](_0x5337b7['shift']());}};_0x813f10(++_0x20e927);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 80a8e4b..8262ecf 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0xd7c26f,_0x852048){var _0x4f0478=function(_0x4960a6){while(--_0x4960a6){_0xd7c26f['push'](_0xd7c26f['shift']());}};_0x4f0478(++_0x852048);}(_0x2dae,0xc3));var _0xe2da=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0x2dae[_0x22c684];return _0x39fcbb;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x54bfcf,_0x334ebc){var _0xbbf9f8=function(_0x278df8){while(--_0x278df8){_0x54bfcf['push'](_0x54bfcf['shift']());}};_0xbbf9f8(++_0x334ebc);}(_0x3c81,0x102));var _0x13c8=function(_0x12e823,_0x4893a3){_0x12e823=_0x12e823-0x0;var _0x2a2ecc=_0x3c81[_0x12e823];return _0x2a2ecc;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a289ae3..1ee1fe5 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6904=['CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','./cmList.socket','register','request','then'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x6904,0x91));var _0x4690=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x6904[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0x4690('0x0'));var util=require(_0x4690('0x1'));var moment=require(_0x4690('0x2'));var BPromise=require('bluebird');var rs=require(_0x4690('0x3'));var fs=require('fs');var Redis=require(_0x4690('0x4'));var db=require(_0x4690('0x5'))['db'];var utils=require(_0x4690('0x6'));var logger=require(_0x4690('0x7'))('rpc');var config=require(_0x4690('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4690('0x9')][_0x4690('0xa')]({'port':0x232a});config['redis']=_[_0x4690('0xb')](config[_0x4690('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4690('0xc')]));require(_0x4690('0xd'))[_0x4690('0xe')](socket);function respondWithRpcPromise(_0x14eeaa,_0x4900bc,_0x236e36){return new BPromise(function(_0x5593e7,_0x563045){return client[_0x4690('0xf')](_0x14eeaa,_0x236e36)[_0x4690('0x10')](function(_0x2d8f15){logger['info'](_0x4690('0x11'),_0x4900bc,_0x4690('0x12'));logger[_0x4690('0x13')](_0x4690('0x14'),_0x4900bc,'request\x20sent',JSON['stringify'](_0x2d8f15));if(_0x2d8f15['error']){if(_0x2d8f15['error'][_0x4690('0x15')]===0x1f4){logger[_0x4690('0x16')](_0x4690('0x11'),_0x4900bc,_0x2d8f15[_0x4690('0x16')][_0x4690('0x17')]);return _0x563045(_0x2d8f15[_0x4690('0x16')][_0x4690('0x17')]);}logger[_0x4690('0x16')](_0x4690('0x11'),_0x4900bc,_0x2d8f15[_0x4690('0x16')][_0x4690('0x17')]);return _0x5593e7(_0x2d8f15[_0x4690('0x16')][_0x4690('0x17')]);}else{logger[_0x4690('0x18')](_0x4690('0x11'),_0x4900bc,_0x4690('0x12'));_0x5593e7(_0x2d8f15[_0x4690('0x19')][_0x4690('0x17')]);}})[_0x4690('0x1a')](function(_0x3db7f4){logger[_0x4690('0x16')]('CmList,\x20%s,\x20%s',_0x4900bc,_0x3db7f4);_0x563045(_0x3db7f4);});});} \ No newline at end of file +var _0x62eb=['http','redis','localhost','socket.io-emitter','./cmList.socket','then','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x28288a,_0x39866c){var _0x358327=function(_0x1e932d){while(--_0x1e932d){_0x28288a['push'](_0x28288a['shift']());}};_0x358327(++_0x39866c);}(_0x62eb,0x8d));var _0xb62e=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x62eb[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var util=require(_0xb62e('0x0'));var moment=require('moment');var BPromise=require(_0xb62e('0x1'));var rs=require(_0xb62e('0x2'));var fs=require('fs');var Redis=require(_0xb62e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb62e('0x4'));var logger=require('../../config/logger')(_0xb62e('0x5'));var config=require(_0xb62e('0x6'));var jayson=require(_0xb62e('0x7'));var client=jayson[_0xb62e('0x8')][_0xb62e('0x9')]({'port':0x232a});config[_0xb62e('0xa')]=_['defaults'](config[_0xb62e('0xa')],{'host':_0xb62e('0xb'),'port':0x18eb});var socket=require(_0xb62e('0xc'))(new Redis(config['redis']));require(_0xb62e('0xd'))['register'](socket);function respondWithRpcPromise(_0x4b2736,_0xb26637,_0x5f1dac){return new BPromise(function(_0x2c745b,_0x455505){return client['request'](_0x4b2736,_0x5f1dac)[_0xb62e('0xe')](function(_0x373ed1){logger['info']('CmList,\x20%s,\x20%s',_0xb26637,_0xb62e('0xf'));logger[_0xb62e('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0xb26637,_0xb62e('0xf'),JSON[_0xb62e('0x11')](_0x373ed1));if(_0x373ed1[_0xb62e('0x12')]){if(_0x373ed1[_0xb62e('0x12')][_0xb62e('0x13')]===0x1f4){logger[_0xb62e('0x12')](_0xb62e('0x14'),_0xb26637,_0x373ed1[_0xb62e('0x12')][_0xb62e('0x15')]);return _0x455505(_0x373ed1[_0xb62e('0x12')][_0xb62e('0x15')]);}logger['error'](_0xb62e('0x14'),_0xb26637,_0x373ed1[_0xb62e('0x12')]['message']);return _0x2c745b(_0x373ed1[_0xb62e('0x12')]['message']);}else{logger[_0xb62e('0x16')](_0xb62e('0x14'),_0xb26637,_0xb62e('0xf'));_0x2c745b(_0x373ed1[_0xb62e('0x17')][_0xb62e('0x15')]);}})[_0xb62e('0x18')](function(_0xf5aaf){logger[_0xb62e('0x12')]('CmList,\x20%s,\x20%s',_0xb26637,_0xf5aaf);_0x455505(_0xf5aaf);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7ed3d04..88a8f5f 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf312=['removeListener','register','length','./cmList.events','remove','update','emit'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf312,0x122));var _0x2f31=function(_0x57a8a1,_0x154bd5){_0x57a8a1=_0x57a8a1-0x0;var _0x346d17=_0xf312[_0x57a8a1];return _0x346d17;};'use strict';var CmListEvents=require(_0x2f31('0x0'));var events=['save',_0x2f31('0x1'),_0x2f31('0x2')];function createListener(_0x284676,_0x34fd1c){return function(_0x5e3875){_0x34fd1c[_0x2f31('0x3')](_0x284676,_0x5e3875);};}function removeListener(_0x5a7c66,_0x19cca7){return function(){CmListEvents[_0x2f31('0x4')](_0x5a7c66,_0x19cca7);};}exports[_0x2f31('0x5')]=function(_0x5f0b74){for(var _0x9d02a6=0x0,_0x239f25=events[_0x2f31('0x6')];_0x9d02a6<_0x239f25;_0x9d02a6++){var _0x1980dc=events[_0x9d02a6];var _0x4441d6=createListener('cmList:'+_0x1980dc,_0x5f0b74);CmListEvents['on'](_0x1980dc,_0x4441d6);}}; \ No newline at end of file +var _0x335a=['update','emit','removeListener','length','cmList:','save','remove'];(function(_0x3be45e,_0x25a05c){var _0x511c0e=function(_0x10bfaa){while(--_0x10bfaa){_0x3be45e['push'](_0x3be45e['shift']());}};_0x511c0e(++_0x25a05c);}(_0x335a,0xc2));var _0xa335=function(_0x5c339f,_0x3f993e){_0x5c339f=_0x5c339f-0x0;var _0x10aae5=_0x335a[_0x5c339f];return _0x10aae5;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xa335('0x0'),_0xa335('0x1'),_0xa335('0x2')];function createListener(_0x157dd2,_0x1d315b){return function(_0x295312){_0x1d315b[_0xa335('0x3')](_0x157dd2,_0x295312);};}function removeListener(_0x32758c,_0x1a92d4){return function(){CmListEvents[_0xa335('0x4')](_0x32758c,_0x1a92d4);};}exports['register']=function(_0x38bc2b){for(var _0x3f7f83=0x0,_0x45a566=events[_0xa335('0x5')];_0x3f7f83<_0x45a566;_0x3f7f83++){var _0x12e174=events[_0x3f7f83];var _0x4c4fc1=createListener(_0xa335('0x6')+_0x12e174,_0x38bc2b);CmListEvents['on'](_0x12e174,_0x4c4fc1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 2e2529f..0b1b96e 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb093=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','post','create','addContacts','addCustomField','addAgents','/:id','update','delete','destroy','removeDispositions','removeAgents'];(function(_0x2d4ae6,_0x4e7db2){var _0x9b1c0a=function(_0x4674c5){while(--_0x4674c5){_0x2d4ae6['push'](_0x2d4ae6['shift']());}};_0x9b1c0a(++_0x4e7db2);}(_0xb093,0xfd));var _0x3b09=function(_0x2651fb,_0x19916a){_0x2651fb=_0x2651fb-0x0;var _0x2ca1b9=_0xb093[_0x2651fb];return _0x2ca1b9;};'use strict';var multer=require(_0x3b09('0x0'));var util=require(_0x3b09('0x1'));var path=require(_0x3b09('0x2'));var timeout=require(_0x3b09('0x3'));var express=require(_0x3b09('0x4'));var router=express['Router']();var fs_extra=require(_0x3b09('0x5'));var auth=require(_0x3b09('0x6'));var interaction=require(_0x3b09('0x7'));var config=require('../../config/environment');var controller=require(_0x3b09('0x8'));router[_0x3b09('0x9')]('/',auth['isAuthenticated'](),controller[_0x3b09('0xa')]);router[_0x3b09('0x9')](_0x3b09('0xb'),auth[_0x3b09('0xc')](),controller['describe']);router[_0x3b09('0x9')](_0x3b09('0xd'),auth[_0x3b09('0xc')](),controller[_0x3b09('0xe')]);router[_0x3b09('0x9')]('/:id',auth[_0x3b09('0xc')](),controller[_0x3b09('0xf')]);router[_0x3b09('0x9')](_0x3b09('0x10'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x11')]);router[_0x3b09('0x9')](_0x3b09('0x12'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x13')]);router[_0x3b09('0x9')](_0x3b09('0x14'),auth[_0x3b09('0xc')](),controller['getContactsCsv']);router[_0x3b09('0x9')](_0x3b09('0x15'),auth['isAuthenticated'](),controller[_0x3b09('0x16')]);router[_0x3b09('0x9')](_0x3b09('0x17'),auth[_0x3b09('0xc')](),controller['getAgents']);router[_0x3b09('0x18')]('/',auth[_0x3b09('0xc')](),controller[_0x3b09('0x19')]);router[_0x3b09('0x18')](_0x3b09('0x10'),auth[_0x3b09('0xc')](),controller['addDisposition']);router['post'](_0x3b09('0x12'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x1a')]);router['post'](_0x3b09('0x15'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x1b')]);router[_0x3b09('0x18')](_0x3b09('0x17'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x1c')]);router['put'](_0x3b09('0x1d'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x1e')]);router[_0x3b09('0x1f')](_0x3b09('0x1d'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x20')]);router['delete'](_0x3b09('0x10'),auth['isAuthenticated'](),controller[_0x3b09('0x21')]);router[_0x3b09('0x1f')](_0x3b09('0x17'),auth[_0x3b09('0xc')](),controller[_0x3b09('0x22')]);module[_0x3b09('0x23')]=router; \ No newline at end of file +var _0x0439=['delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','/describe','get','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','create','/:id/dispositions','addDisposition','addCustomField','/:id/users','put','update'];(function(_0x7a7bd1,_0x4b424b){var _0x21475b=function(_0x25806a){while(--_0x25806a){_0x7a7bd1['push'](_0x7a7bd1['shift']());}};_0x21475b(++_0x4b424b);}(_0x0439,0xdd));var _0x9043=function(_0x4d98b8,_0x539839){_0x4d98b8=_0x4d98b8-0x0;var _0x5e271b=_0x0439[_0x4d98b8];return _0x5e271b;};'use strict';var multer=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var path=require(_0x9043('0x2'));var timeout=require(_0x9043('0x3'));var express=require(_0x9043('0x4'));var router=express[_0x9043('0x5')]();var fs_extra=require(_0x9043('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9043('0x7'));var config=require(_0x9043('0x8'));var controller=require(_0x9043('0x9'));router['get']('/',auth[_0x9043('0xa')](),controller['index']);router['get'](_0x9043('0xb'),auth[_0x9043('0xa')](),controller['describe']);router[_0x9043('0xc')]('/global_fields',auth[_0x9043('0xa')](),controller[_0x9043('0xd')]);router['get'](_0x9043('0xe'),auth[_0x9043('0xa')](),controller[_0x9043('0xf')]);router['get']('/:id/dispositions',auth[_0x9043('0xa')](),controller[_0x9043('0x10')]);router['get'](_0x9043('0x11'),auth[_0x9043('0xa')](),controller[_0x9043('0x12')]);router[_0x9043('0xc')](_0x9043('0x13'),auth[_0x9043('0xa')](),controller['getContactsCsv']);router[_0x9043('0xc')](_0x9043('0x14'),auth['isAuthenticated'](),controller[_0x9043('0x15')]);router[_0x9043('0xc')]('/:id/users',auth[_0x9043('0xa')](),controller[_0x9043('0x16')]);router[_0x9043('0x17')]('/',auth[_0x9043('0xa')](),controller[_0x9043('0x18')]);router[_0x9043('0x17')](_0x9043('0x19'),auth[_0x9043('0xa')](),controller[_0x9043('0x1a')]);router[_0x9043('0x17')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x9043('0x17')](_0x9043('0x14'),auth[_0x9043('0xa')](),controller[_0x9043('0x1b')]);router['post'](_0x9043('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9043('0x1d')](_0x9043('0xe'),auth[_0x9043('0xa')](),controller[_0x9043('0x1e')]);router[_0x9043('0x1f')](_0x9043('0xe'),auth[_0x9043('0xa')](),controller[_0x9043('0x20')]);router['delete'](_0x9043('0x19'),auth[_0x9043('0xa')](),controller[_0x9043('0x21')]);router['delete'](_0x9043('0x1c'),auth[_0x9043('0xa')](),controller[_0x9043('0x22')]);module[_0x9043('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ea3ec81..9d6090f 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf348=['sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x41bd14,_0x487433){var _0x5d5d10=function(_0x92374e){while(--_0x92374e){_0x41bd14['push'](_0x41bd14['shift']());}};_0x5d5d10(++_0x487433);}(_0xf348,0xd8));var _0x8f34=function(_0xa9190e,_0x56fe29){_0xa9190e=_0xa9190e-0x0;var _0x10bc2d=_0xf348[_0xa9190e];return _0x10bc2d;};'use strict';var Sequelize=require(_0x8f34('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f34('0x1')],'get':function(_0x3baa7){return this[_0x8f34('0x2')]('field');}},'field':{'type':Sequelize[_0x8f34('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x8f34('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd51d=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd51d,0x1b1));var _0xdd51=function(_0x4f9f5a,_0x19c14a){_0x4f9f5a=_0x4f9f5a-0x0;var _0x103607=_0xd51d[_0x4f9f5a];return _0x103607;};'use strict';var Sequelize=require(_0xdd51('0x0'));module[_0xdd51('0x1')]={'name':{'type':Sequelize[_0xdd51('0x2')],'get':function(_0x4eddfa){return this[_0xdd51('0x3')](_0xdd51('0x4'));}},'field':{'type':Sequelize[_0xdd51('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xdd51('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xdd51('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index fea7ca7..441f80f 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5eaa1b,_0x285e64){var _0x5b910f=function(_0x22e4a1){while(--_0x22e4a1){_0x5eaa1b['push'](_0x5eaa1b['shift']());}};_0x5b910f(++_0x285e64);}(_0x7a54,0x106));var _0x47a5=function(_0x3c838b,_0x611045){_0x3c838b=_0x3c838b-0x0;var _0x23581a=_0x7a54[_0x3c838b];return _0x23581a;};'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(_0x100f9d,_0x4f685e){var _0x23eb3d=function(_0x25151e){while(--_0x25151e){_0x100f9d['push'](_0x100f9d['shift']());}};_0x23eb3d(++_0x4f685e);}(_0x7a54,0x106));var _0x47a5=function(_0x4d2d0f,_0x2b7519){_0x4d2d0f=_0x4d2d0f-0x0;var _0xbcbc3c=_0x7a54[_0x4d2d0f];return _0xbcbc3c;};'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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 465a792..fdada41 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf392=['bluebird','request-promise','path','rimraf','../../config/environment','define','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x373c28,_0x30dcb4){var _0x21c96d=function(_0x460631){while(--_0x460631){_0x373c28['push'](_0x373c28['shift']());}};_0x21c96d(++_0x30dcb4);}(_0xf392,0x163));var _0x2f39=function(_0x369758,_0x48a9db){_0x369758=_0x369758-0x0;var _0x1761aa=_0xf392[_0x369758];return _0x1761aa;};'use strict';var _=require(_0x2f39('0x0'));var util=require(_0x2f39('0x1'));var logger=require(_0x2f39('0x2'))(_0x2f39('0x3'));var moment=require(_0x2f39('0x4'));var BPromise=require(_0x2f39('0x5'));var rp=require(_0x2f39('0x6'));var fs=require('fs');var path=require(_0x2f39('0x7'));var rimraf=require(_0x2f39('0x8'));var config=require(_0x2f39('0x9'));var attributes=require('./condition.attributes');module['exports']=function(_0x2a2308,_0x5b713d){return _0x2a2308[_0x2f39('0xa')]('Condition',attributes,{'tableName':_0x2f39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2b=['./condition.attributes','exports','define','Condition','tools_conditions','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d09b6,_0x1ac12c){var _0x2f1a26=function(_0x27e496){while(--_0x27e496){_0x1d09b6['push'](_0x1d09b6['shift']());}};_0x2f1a26(++_0x1ac12c);}(_0x9a2b,0x1b5));var _0xb9a2=function(_0x171ca6,_0x2f8f9d){_0x171ca6=_0x171ca6-0x0;var _0x244768=_0x9a2b[_0x171ca6];return _0x244768;};'use strict';var _=require('lodash');var util=require(_0xb9a2('0x0'));var logger=require('../../config/logger')(_0xb9a2('0x1'));var moment=require('moment');var BPromise=require(_0xb9a2('0x2'));var rp=require(_0xb9a2('0x3'));var fs=require('fs');var path=require(_0xb9a2('0x4'));var rimraf=require(_0xb9a2('0x5'));var config=require(_0xb9a2('0x6'));var attributes=require(_0xb9a2('0x7'));module[_0xb9a2('0x8')]=function(_0x377107,_0x20661a){return _0x377107[_0xb9a2('0x9')](_0xb9a2('0xa'),attributes,{'tableName':_0xb9a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 1490255..3da0d48 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4265=['then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http'];(function(_0x45ae47,_0x2ffbb7){var _0x3eb901=function(_0x2c444f){while(--_0x2c444f){_0x45ae47['push'](_0x45ae47['shift']());}};_0x3eb901(++_0x2ffbb7);}(_0x4265,0xe6));var _0x5426=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x4265[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var moment=require(_0x5426('0x2'));var BPromise=require(_0x5426('0x3'));var rs=require(_0x5426('0x4'));var fs=require('fs');var Redis=require(_0x5426('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5426('0x6'))(_0x5426('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5426('0x8')][_0x5426('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7680,_0x28b832,_0x2ad360){return new BPromise(function(_0x5e8d8b,_0x4b9c66){return client['request'](_0x3e7680,_0x2ad360)[_0x5426('0xa')](function(_0x49325c){logger[_0x5426('0xb')](_0x5426('0xc'),_0x28b832,_0x5426('0xd'));logger['debug'](_0x5426('0xe'),_0x28b832,_0x5426('0xd'),JSON['stringify'](_0x49325c));if(_0x49325c[_0x5426('0xf')]){if(_0x49325c[_0x5426('0xf')][_0x5426('0x10')]===0x1f4){logger[_0x5426('0xf')](_0x5426('0xc'),_0x28b832,_0x49325c['error'][_0x5426('0x11')]);return _0x4b9c66(_0x49325c[_0x5426('0xf')][_0x5426('0x11')]);}logger[_0x5426('0xf')](_0x5426('0xc'),_0x28b832,_0x49325c[_0x5426('0xf')][_0x5426('0x11')]);return _0x5e8d8b(_0x49325c[_0x5426('0xf')]['message']);}else{logger['info'](_0x5426('0xc'),_0x28b832,'request\x20sent');_0x5e8d8b(_0x49325c[_0x5426('0x12')][_0x5426('0x11')]);}})[_0x5426('0x13')](function(_0xa27b6f){logger[_0x5426('0xf')](_0x5426('0xc'),_0x28b832,_0xa27b6f);_0x4b9c66(_0xa27b6f);});});} \ No newline at end of file +var _0xdfe6=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4238e3,_0x5bbe65){var _0x1545c1=function(_0x4fca42){while(--_0x4fca42){_0x4238e3['push'](_0x4238e3['shift']());}};_0x1545c1(++_0x5bbe65);}(_0xdfe6,0xb1));var _0x6dfe=function(_0x969465,_0x171ff2){_0x969465=_0x969465-0x0;var _0x1c02a6=_0xdfe6[_0x969465];return _0x1c02a6;};'use strict';var _=require(_0x6dfe('0x0'));var util=require(_0x6dfe('0x1'));var moment=require(_0x6dfe('0x2'));var BPromise=require(_0x6dfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6dfe('0x5'))(_0x6dfe('0x6'));var config=require(_0x6dfe('0x7'));var jayson=require(_0x6dfe('0x8'));var client=jayson[_0x6dfe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33699b,_0xe0d17a,_0x47804d){return new BPromise(function(_0x558222,_0x3f87ee){return client['request'](_0x33699b,_0x47804d)[_0x6dfe('0xa')](function(_0x5a3f83){logger[_0x6dfe('0xb')](_0x6dfe('0xc'),_0xe0d17a,'request\x20sent');logger[_0x6dfe('0xd')](_0x6dfe('0xe'),_0xe0d17a,_0x6dfe('0xf'),JSON[_0x6dfe('0x10')](_0x5a3f83));if(_0x5a3f83[_0x6dfe('0x11')]){if(_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x12')]===0x1f4){logger[_0x6dfe('0x11')]('Condition,\x20%s,\x20%s',_0xe0d17a,_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x13')]);return _0x3f87ee(_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x13')]);}logger['error'](_0x6dfe('0xc'),_0xe0d17a,_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x13')]);return _0x558222(_0x5a3f83[_0x6dfe('0x11')]['message']);}else{logger[_0x6dfe('0xb')](_0x6dfe('0xc'),_0xe0d17a,'request\x20sent');_0x558222(_0x5a3f83[_0x6dfe('0x14')][_0x6dfe('0x13')]);}})[_0x6dfe('0x15')](function(_0x4dbfd3){logger[_0x6dfe('0x11')]('Condition,\x20%s,\x20%s',_0xe0d17a,_0x4dbfd3);_0x3f87ee(_0x4dbfd3);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fcac4c3..24c50b9 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc769=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x3754d6,_0x292ba8){var _0x20fcca=function(_0x1a277d){while(--_0x1a277d){_0x3754d6['push'](_0x3754d6['shift']());}};_0x20fcca(++_0x292ba8);}(_0xc769,0x1ef));var _0x9c76=function(_0x102380,_0x2e92e3){_0x102380=_0x102380-0x0;var _0x4f78b7=_0xc769[_0x102380];return _0x4f78b7;};'use strict';var multer=require(_0x9c76('0x0'));var util=require(_0x9c76('0x1'));var path=require(_0x9c76('0x2'));var timeout=require(_0x9c76('0x3'));var express=require(_0x9c76('0x4'));var router=express[_0x9c76('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9c76('0x6'));var interaction=require(_0x9c76('0x7'));var config=require(_0x9c76('0x8'));var controller=require(_0x9c76('0x9'));router['put'](_0x9c76('0xa'),auth[_0x9c76('0xb')](),controller[_0x9c76('0xc')]);router[_0x9c76('0xd')]('/:id',auth[_0x9c76('0xb')](),controller[_0x9c76('0xe')]);module[_0x9c76('0xf')]=router; \ No newline at end of file +var _0xe6c4=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe6c4,0xa1));var _0x4e6c=function(_0x4c76df,_0x521a85){_0x4c76df=_0x4c76df-0x0;var _0x5e4aa5=_0xe6c4[_0x4c76df];return _0x5e4aa5;};'use strict';var multer=require(_0x4e6c('0x0'));var util=require(_0x4e6c('0x1'));var path=require(_0x4e6c('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e6c('0x3'));var router=express[_0x4e6c('0x4')]();var fs_extra=require(_0x4e6c('0x5'));var auth=require(_0x4e6c('0x6'));var interaction=require(_0x4e6c('0x7'));var config=require(_0x4e6c('0x8'));var controller=require(_0x4e6c('0x9'));router[_0x4e6c('0xa')](_0x4e6c('0xb'),auth[_0x4e6c('0xc')](),controller[_0x4e6c('0xd')]);router['delete']('/:id',auth[_0x4e6c('0xc')](),controller[_0x4e6c('0xe')]);module[_0x4e6c('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 2b4f8a8..abbe3bb 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x105a=['sequelize','exports'];(function(_0x181148,_0x132a23){var _0x4c1740=function(_0x3d5f68){while(--_0x3d5f68){_0x181148['push'](_0x181148['shift']());}};_0x4c1740(++_0x132a23);}(_0x105a,0x7a));var _0xa105=function(_0x1efe58,_0x202a22){_0x1efe58=_0x1efe58-0x0;var _0x5611a1=_0x105a[_0x1efe58];return _0x5611a1;};'use strict';var Sequelize=require(_0xa105('0x0'));module[_0xa105('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x03a4=['STRING','name','exports'];(function(_0x32374e,_0x44eb45){var _0x3b3491=function(_0xe4b5eb){while(--_0xe4b5eb){_0x32374e['push'](_0x32374e['shift']());}};_0x3b3491(++_0x44eb45);}(_0x03a4,0x152));var _0x403a=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x03a4[_0x592e40];return _0x5d4288;};'use strict';var Sequelize=require('sequelize');module[_0x403a('0x0')]={'name':{'type':Sequelize[_0x403a('0x1')],'allowNull':![],'unique':_0x403a('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 2902e3c..643b418 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb11=['show','keys','rawAttributes','includeAll','include','find','body','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','ContactItemType','findAll','rows','catch'];(function(_0x4b74ab,_0xb66cf6){var _0x5dba22=function(_0x1b1440){while(--_0x1b1440){_0x4b74ab['push'](_0x4b74ab['shift']());}};_0x5dba22(++_0xb66cf6);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xfb11[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){var _0x5fc9e6=_0x4272c7[_0x1fb1('0x25')]({'plain':!![]});var _0x1353a4=_0x1fb1('0x26');return db[_0x1fb1('0x27')]['destroy']({'where':{'type':_0x1353a4,'resourceId':_0x5fc9e6['id']}})[_0x1fb1('0x23')](function(){return _0x4272c7;});})[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1898e7,_0x29e1bd){return function(_0x1a74c4){if(!_0x1a74c4){_0x1898e7[_0x1fb1('0x28')](0x194);}return _0x1a74c4;};}function handleError(_0xa7bba,_0x33a3b7){_0x33a3b7=_0x33a3b7||0x1f4;return function(_0x5e99e7){logger[_0x1fb1('0x29')](_0x5e99e7[_0x1fb1('0x2a')]);if(_0x5e99e7[_0x1fb1('0x2b')]){delete _0x5e99e7[_0x1fb1('0x2b')];}_0xa7bba['status'](_0x33a3b7)[_0x1fb1('0x2c')](_0x5e99e7);};}exports[_0x1fb1('0x2d')]=function(_0x90d8ef,_0x1b71cb){var _0x5402e9={},_0x245f84={},_0x30c8eb={'count':0x0,'rows':[]};var _0x5d45a5=_[_0x1fb1('0x2e')](db['ContactItemType']['rawAttributes'],function(_0x354e92){return{'name':_0x354e92[_0x1fb1('0x2f')],'type':_0x354e92['type'][_0x1fb1('0x30')]};});_0x245f84[_0x1fb1('0x31')]=_[_0x1fb1('0x2e')](_0x5d45a5,_0x1fb1('0x2b'));_0x245f84[_0x1fb1('0x32')]=_['keys'](_0x90d8ef[_0x1fb1('0x32')]);_0x245f84[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],_0x245f84[_0x1fb1('0x32')]);_0x5402e9[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x90d8ef['query'][_0x1fb1('0x36')]));_0x5402e9['attributes']=_0x5402e9[_0x1fb1('0x35')]['length']?_0x5402e9[_0x1fb1('0x35')]:_0x245f84['model'];if(!_0x90d8ef['query'][_0x1fb1('0x37')](_0x1fb1('0x38'))){_0x5402e9[_0x1fb1('0x1d')]=qs[_0x1fb1('0x1d')](_0x90d8ef['query'][_0x1fb1('0x1d')]);_0x5402e9[_0x1fb1('0x1b')]=qs[_0x1fb1('0x1b')](_0x90d8ef['query'][_0x1fb1('0x1b')]);}_0x5402e9[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3a')]);_0x5402e9[_0x1fb1('0x3b')]=qs[_0x1fb1('0x33')](_['pick'](_0x90d8ef[_0x1fb1('0x32')],_0x245f84[_0x1fb1('0x33')]),_0x5d45a5);if(_0x90d8ef['query'][_0x1fb1('0x3c')]){_0x5402e9['where']=_[_0x1fb1('0x3d')](_0x5402e9[_0x1fb1('0x3b')],{'$or':_[_0x1fb1('0x2e')](_0x5d45a5,function(_0x439eec){if(_0x439eec[_0x1fb1('0x3e')]!==_0x1fb1('0x3f')){var _0x927301={};_0x927301[_0x439eec[_0x1fb1('0x2b')]]={'$like':'%'+_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3c')]+'%'};return _0x927301;}})});}_0x5402e9=_[_0x1fb1('0x3d')]({},_0x5402e9,_0x90d8ef[_0x1fb1('0x40')]);var _0xafc9a7={'where':_0x5402e9[_0x1fb1('0x3b')]};return db[_0x1fb1('0x41')]['count'](_0xafc9a7)[_0x1fb1('0x23')](function(_0xca1fd3){_0x30c8eb[_0x1fb1('0x1e')]=_0xca1fd3;if(_0x90d8ef[_0x1fb1('0x32')]['includeAll']){_0x5402e9['include']=[{'all':!![]}];}return db[_0x1fb1('0x41')][_0x1fb1('0x42')](_0x5402e9);})[_0x1fb1('0x23')](function(_0x3edc8a){_0x30c8eb[_0x1fb1('0x43')]=_0x3edc8a;return _0x30c8eb;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x1b71cb,_0x5402e9))[_0x1fb1('0x44')](handleError(_0x1b71cb,null));};exports[_0x1fb1('0x45')]=function(_0x14aa27,_0x320bda){var _0x4a943c={'raw':!![],'where':{'id':_0x14aa27['params']['id']}},_0x44ccbe={};_0x44ccbe['model']=_[_0x1fb1('0x46')](db[_0x1fb1('0x41')][_0x1fb1('0x47')]);_0x44ccbe[_0x1fb1('0x32')]=_['keys'](_0x14aa27['query']);_0x44ccbe[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],_0x44ccbe[_0x1fb1('0x32')]);_0x4a943c[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x14aa27[_0x1fb1('0x32')]['fields']));_0x4a943c['attributes']=_0x4a943c[_0x1fb1('0x35')]['length']?_0x4a943c[_0x1fb1('0x35')]:_0x44ccbe[_0x1fb1('0x31')];if(_0x14aa27[_0x1fb1('0x32')][_0x1fb1('0x48')]){_0x4a943c[_0x1fb1('0x49')]=[{'all':!![]}];}_0x4a943c=_[_0x1fb1('0x3d')]({},_0x4a943c,_0x14aa27['options']);return db[_0x1fb1('0x41')][_0x1fb1('0x4a')](_0x4a943c)[_0x1fb1('0x23')](handleEntityNotFound(_0x320bda,null))['then'](respondWithResult(_0x320bda,null))[_0x1fb1('0x44')](handleError(_0x320bda,null));};exports['create']=function(_0x6e105b,_0xba4fa7){return db[_0x1fb1('0x41')]['create'](_0x6e105b[_0x1fb1('0x4b')],{})[_0x1fb1('0x23')](function(_0x52271f){var _0xe492ab=_0x6e105b[_0x1fb1('0x4c')][_0x1fb1('0x25')]({'plain':!![]});if(!_0xe492ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe492ab['role']==='user'){var _0x31a85a=_0x52271f[_0x1fb1('0x25')]({'plain':!![]});var _0x1e2754=_0x1fb1('0x26');return db[_0x1fb1('0x4d')][_0x1fb1('0x4a')]({'where':{'name':_0x1e2754,'userProfileId':_0xe492ab['userProfileId']},'raw':!![]})['then'](function(_0x267c36){if(_0x267c36&&_0x267c36[_0x1fb1('0x4e')]===0x0){return db[_0x1fb1('0x27')][_0x1fb1('0x4f')]({'name':_0x31a85a['name'],'resourceId':_0x31a85a['id'],'type':_0x267c36['name'],'sectionId':_0x267c36['id']},{})[_0x1fb1('0x23')](function(){return _0x52271f;});}else{return _0x52271f;}})['catch'](function(_0x41fefb){logger['error'](_0x1fb1('0x50'),_0x41fefb);throw _0x41fefb;});}return _0x52271f;})['then'](respondWithResult(_0xba4fa7,0xc9))[_0x1fb1('0x44')](handleError(_0xba4fa7,null));};exports[_0x1fb1('0x22')]=function(_0x1475ee,_0xca9395){if(_0x1475ee[_0x1fb1('0x4b')]['id']){delete _0x1475ee['body']['id'];}return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x1475ee[_0x1fb1('0x51')]['id']}})['then'](handleEntityNotFound(_0xca9395,null))['then'](saveUpdates(_0x1475ee[_0x1fb1('0x4b')],null))[_0x1fb1('0x23')](respondWithResult(_0xca9395,null))[_0x1fb1('0x44')](handleError(_0xca9395,null));};exports[_0x1fb1('0x24')]=function(_0x439670,_0xc9e8d4){return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x439670[_0x1fb1('0x51')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xc9e8d4,null))[_0x1fb1('0x23')](db[_0x1fb1('0x52')][_0x1fb1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x439670[_0x1fb1('0x51')]['id']}}))['then'](removeEntity(_0xc9e8d4,null))[_0x1fb1('0x44')](handleError(_0xc9e8d4,null));}; \ No newline at end of file +var _0x955f=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','user','catch'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x955f,0x1eb));var _0xf955=function(_0x20ab55,_0x1dfeb2){_0x20ab55=_0x20ab55-0x0;var _0x4edbb9=_0x955f[_0x20ab55];return _0x4edbb9;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];function respondWithStatusCode(_0x542347,_0x23e0c6){_0x23e0c6=_0x23e0c6||0xcc;return function(_0x50d9a9){if(_0x50d9a9){return _0x542347[_0xf955('0x17')](_0x23e0c6);}return _0x542347[_0xf955('0x18')](_0x23e0c6)[_0xf955('0x19')]();};}function respondWithResult(_0x109bc5,_0x2080c4){_0x2080c4=_0x2080c4||0xc8;return function(_0x341b8c){if(_0x341b8c){return _0x109bc5[_0xf955('0x18')](_0x2080c4)[_0xf955('0x1a')](_0x341b8c);}};}function respondWithFilteredResult(_0x3c6af7,_0x24e75c){return function(_0x5350e4){if(_0x5350e4){var _0xc29b35=typeof _0x24e75c['offset']===_0xf955('0x1b')&&typeof _0x24e75c[_0xf955('0x1c')]===_0xf955('0x1b');var _0x15c07c=_0x5350e4['count'];var _0x5ac6cb=_0xc29b35?0x0:_0x24e75c[_0xf955('0x1d')];var _0xe6de5c=_0xc29b35?_0x5350e4[_0xf955('0x1e')]:_0x24e75c['offset']+_0x24e75c[_0xf955('0x1c')];var _0x3576fa;if(_0xe6de5c>=_0x15c07c){_0xe6de5c=_0x15c07c;_0x3576fa=0xc8;}else{_0x3576fa=0xce;}_0x3c6af7[_0xf955('0x18')](_0x3576fa);return _0x3c6af7[_0xf955('0x1f')](_0xf955('0x20'),_0x5ac6cb+'-'+_0xe6de5c+'/'+_0x15c07c)['json'](_0x5350e4);}return null;};}function patchUpdates(_0x17d86a){return function(_0x3dbbe8){try{jsonpatch[_0xf955('0x21')](_0x3dbbe8,_0x17d86a,!![]);}catch(_0x488d04){return BPromise[_0xf955('0x22')](_0x488d04);}return _0x3dbbe8['save']();};}function saveUpdates(_0x21ae24,_0x43b078){return function(_0x37143d){if(_0x37143d){return _0x37143d[_0xf955('0x23')](_0x21ae24)[_0xf955('0x24')](function(_0x565641){return _0x565641;});}return null;};}function removeEntity(_0x25f4f2,_0x5fab1c){return function(_0x3585c7){if(_0x3585c7){return _0x3585c7[_0xf955('0x25')]()[_0xf955('0x24')](function(){var _0x102e36=_0x3585c7[_0xf955('0x26')]({'plain':!![]});var _0x552cf3=_0xf955('0x27');return db[_0xf955('0x28')][_0xf955('0x25')]({'where':{'type':_0x552cf3,'resourceId':_0x102e36['id']}})[_0xf955('0x24')](function(){return _0x3585c7;});})[_0xf955('0x24')](function(){_0x25f4f2[_0xf955('0x18')](0xcc)[_0xf955('0x19')]();});}};}function handleEntityNotFound(_0x51f3ab,_0x3caea6){return function(_0x145098){if(!_0x145098){_0x51f3ab[_0xf955('0x17')](0x194);}return _0x145098;};}function handleError(_0xbd0b74,_0x28fa9c){_0x28fa9c=_0x28fa9c||0x1f4;return function(_0x264f6d){logger['error'](_0x264f6d[_0xf955('0x29')]);if(_0x264f6d[_0xf955('0x2a')]){delete _0x264f6d['name'];}_0xbd0b74[_0xf955('0x18')](_0x28fa9c)[_0xf955('0x2b')](_0x264f6d);};}exports[_0xf955('0x2c')]=function(_0x1ef794,_0x59bfb5){var _0x3a951c={},_0x518fb3={},_0x227104={'count':0x0,'rows':[]};var _0x2c222a=_[_0xf955('0x2d')](db[_0xf955('0x2e')][_0xf955('0x2f')],function(_0x32121b){return{'name':_0x32121b[_0xf955('0x30')],'type':_0x32121b[_0xf955('0x31')]['key']};});_0x518fb3[_0xf955('0x32')]=_[_0xf955('0x2d')](_0x2c222a,_0xf955('0x2a'));_0x518fb3[_0xf955('0x33')]=_['keys'](_0x1ef794[_0xf955('0x33')]);_0x518fb3[_0xf955('0x34')]=_[_0xf955('0x35')](_0x518fb3[_0xf955('0x32')],_0x518fb3[_0xf955('0x33')]);_0x3a951c['attributes']=_['intersection'](_0x518fb3['model'],qs[_0xf955('0x36')](_0x1ef794[_0xf955('0x33')][_0xf955('0x36')]));_0x3a951c[_0xf955('0x37')]=_0x3a951c[_0xf955('0x37')][_0xf955('0x38')]?_0x3a951c['attributes']:_0x518fb3[_0xf955('0x32')];if(!_0x1ef794['query'][_0xf955('0x39')](_0xf955('0x3a'))){_0x3a951c[_0xf955('0x1c')]=qs['limit'](_0x1ef794[_0xf955('0x33')]['limit']);_0x3a951c[_0xf955('0x1d')]=qs[_0xf955('0x1d')](_0x1ef794[_0xf955('0x33')][_0xf955('0x1d')]);}_0x3a951c['order']=qs[_0xf955('0x3b')](_0x1ef794[_0xf955('0x33')]['sort']);_0x3a951c[_0xf955('0x3c')]=qs[_0xf955('0x34')](_[_0xf955('0x3d')](_0x1ef794['query'],_0x518fb3[_0xf955('0x34')]),_0x2c222a);if(_0x1ef794[_0xf955('0x33')][_0xf955('0x3e')]){_0x3a951c['where']=_[_0xf955('0x3f')](_0x3a951c[_0xf955('0x3c')],{'$or':_[_0xf955('0x2d')](_0x2c222a,function(_0x2069f3){if(_0x2069f3[_0xf955('0x31')]!==_0xf955('0x40')){var _0x2b614d={};_0x2b614d[_0x2069f3[_0xf955('0x2a')]]={'$like':'%'+_0x1ef794['query'][_0xf955('0x3e')]+'%'};return _0x2b614d;}})});}_0x3a951c=_[_0xf955('0x3f')]({},_0x3a951c,_0x1ef794[_0xf955('0x41')]);var _0xe633fa={'where':_0x3a951c[_0xf955('0x3c')]};return db[_0xf955('0x2e')][_0xf955('0x1e')](_0xe633fa)[_0xf955('0x24')](function(_0x47651b){_0x227104[_0xf955('0x1e')]=_0x47651b;if(_0x1ef794[_0xf955('0x33')][_0xf955('0x42')]){_0x3a951c[_0xf955('0x43')]=[{'all':!![]}];}return db[_0xf955('0x2e')][_0xf955('0x44')](_0x3a951c);})[_0xf955('0x24')](function(_0x356ec2){_0x227104[_0xf955('0x45')]=_0x356ec2;return _0x227104;})[_0xf955('0x24')](respondWithFilteredResult(_0x59bfb5,_0x3a951c))['catch'](handleError(_0x59bfb5,null));};exports[_0xf955('0x46')]=function(_0x25d809,_0x2db18d){var _0x5f0ef9={'raw':!![],'where':{'id':_0x25d809['params']['id']}},_0x16fc1a={};_0x16fc1a[_0xf955('0x32')]=_['keys'](db[_0xf955('0x2e')][_0xf955('0x2f')]);_0x16fc1a[_0xf955('0x33')]=_[_0xf955('0x47')](_0x25d809['query']);_0x16fc1a[_0xf955('0x34')]=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],_0x16fc1a['query']);_0x5f0ef9['attributes']=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],qs[_0xf955('0x36')](_0x25d809[_0xf955('0x33')]['fields']));_0x5f0ef9[_0xf955('0x37')]=_0x5f0ef9[_0xf955('0x37')][_0xf955('0x38')]?_0x5f0ef9['attributes']:_0x16fc1a[_0xf955('0x32')];if(_0x25d809['query'][_0xf955('0x42')]){_0x5f0ef9[_0xf955('0x43')]=[{'all':!![]}];}_0x5f0ef9=_[_0xf955('0x3f')]({},_0x5f0ef9,_0x25d809['options']);return db[_0xf955('0x2e')][_0xf955('0x48')](_0x5f0ef9)[_0xf955('0x24')](handleEntityNotFound(_0x2db18d,null))[_0xf955('0x24')](respondWithResult(_0x2db18d,null))['catch'](handleError(_0x2db18d,null));};exports[_0xf955('0x49')]=function(_0x4ff0f1,_0x1c6d76){return db[_0xf955('0x2e')][_0xf955('0x49')](_0x4ff0f1['body'],{})[_0xf955('0x24')](function(_0x4e7269){var _0x35c23c=_0x4ff0f1['user'][_0xf955('0x26')]({'plain':!![]});if(!_0x35c23c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c23c['role']===_0xf955('0x4a')){var _0x45c7fe=_0x4e7269['get']({'plain':!![]});var _0x142e8f='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x142e8f,'userProfileId':_0x35c23c['userProfileId']},'raw':!![]})[_0xf955('0x24')](function(_0x1abe1c){if(_0x1abe1c&&_0x1abe1c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf955('0x49')]({'name':_0x45c7fe[_0xf955('0x2a')],'resourceId':_0x45c7fe['id'],'type':_0x1abe1c[_0xf955('0x2a')],'sectionId':_0x1abe1c['id']},{})[_0xf955('0x24')](function(){return _0x4e7269;});}else{return _0x4e7269;}})[_0xf955('0x4b')](function(_0xa56483){logger[_0xf955('0x4c')](_0xf955('0x4d'),_0xa56483);throw _0xa56483;});}return _0x4e7269;})[_0xf955('0x24')](respondWithResult(_0x1c6d76,0xc9))[_0xf955('0x4b')](handleError(_0x1c6d76,null));};exports[_0xf955('0x23')]=function(_0x350873,_0x47a3a6){if(_0x350873[_0xf955('0x4e')]['id']){delete _0x350873[_0xf955('0x4e')]['id'];}return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x350873[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47a3a6,null))[_0xf955('0x24')](saveUpdates(_0x350873[_0xf955('0x4e')],null))[_0xf955('0x24')](respondWithResult(_0x47a3a6,null))[_0xf955('0x4b')](handleError(_0x47a3a6,null));};exports[_0xf955('0x25')]=function(_0x9057df,_0x228d59){return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x9057df[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x228d59,null))[_0xf955('0x24')](db[_0xf955('0x50')][_0xf955('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x9057df[_0xf955('0x4f')]['id']}}))[_0xf955('0x24')](removeEntity(_0x228d59,null))[_0xf955('0x4b')](handleError(_0x228d59,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 15402d2..e4124ad 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa25a=['lodash','util','../../config/logger','api','request-promise','path','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0xd0efc2,_0x83fe43){var _0x56e170=function(_0x34f715){while(--_0x34f715){_0xd0efc2['push'](_0xd0efc2['shift']());}};_0x56e170(++_0x83fe43);}(_0xa25a,0x1a4));var _0xaa25=function(_0x39696d,_0x24f2f2){_0x39696d=_0x39696d-0x0;var _0x2e1bc0=_0xa25a[_0x39696d];return _0x2e1bc0;};'use strict';var _=require(_0xaa25('0x0'));var util=require(_0xaa25('0x1'));var logger=require(_0xaa25('0x2'))(_0xaa25('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaa25('0x4'));var fs=require('fs');var path=require(_0xaa25('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa25('0x6'));module[_0xaa25('0x7')]=function(_0x5b2ea6,_0x4d4c58){return _0x5b2ea6[_0xaa25('0x8')](_0xaa25('0x9'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5962=['exports','define','ContactItemType','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./contactItemType.attributes'];(function(_0x43fb6c,_0x360ecd){var _0x37e001=function(_0x2a256f){while(--_0x2a256f){_0x43fb6c['push'](_0x43fb6c['shift']());}};_0x37e001(++_0x360ecd);}(_0x5962,0x163));var _0x2596=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0x5962[_0x2a1b33];return _0x4c50e7;};'use strict';var _=require(_0x2596('0x0'));var util=require('util');var logger=require(_0x2596('0x1'))(_0x2596('0x2'));var moment=require(_0x2596('0x3'));var BPromise=require(_0x2596('0x4'));var rp=require(_0x2596('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2596('0x6'));var attributes=require(_0x2596('0x7'));module[_0x2596('0x8')]=function(_0x26236a,_0x39faeb){return _0x26236a[_0x2596('0x9')](_0x2596('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index d1f1796..9a0fb73 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x768a=['ContactItemType,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2551ca,_0x3f8886){var _0x19a175=function(_0x24f6a8){while(--_0x24f6a8){_0x2551ca['push'](_0x2551ca['shift']());}};_0x19a175(++_0x3f8886);}(_0x768a,0x10d));var _0xa768=function(_0x24c57b,_0x2ab0c0){_0x24c57b=_0x24c57b-0x0;var _0x1d0146=_0x768a[_0x24c57b];return _0x1d0146;};'use strict';var _=require('lodash');var util=require(_0xa768('0x0'));var moment=require(_0xa768('0x1'));var BPromise=require(_0xa768('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa768('0x3'));var db=require(_0xa768('0x4'))['db'];var utils=require(_0xa768('0x5'));var logger=require(_0xa768('0x6'))('rpc');var config=require(_0xa768('0x7'));var jayson=require(_0xa768('0x8'));var client=jayson[_0xa768('0x9')][_0xa768('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x148ab4,_0x3c1679,_0x2bcd66){return new BPromise(function(_0x39095a,_0x4ff0d5){return client[_0xa768('0xb')](_0x148ab4,_0x2bcd66)[_0xa768('0xc')](function(_0x31523e){logger['info']('ContactItemType,\x20%s,\x20%s',_0x3c1679,_0xa768('0xd'));logger[_0xa768('0xe')](_0xa768('0xf'),_0x3c1679,_0xa768('0xd'),JSON[_0xa768('0x10')](_0x31523e));if(_0x31523e[_0xa768('0x11')]){if(_0x31523e['error'][_0xa768('0x12')]===0x1f4){logger['error'](_0xa768('0x13'),_0x3c1679,_0x31523e['error'][_0xa768('0x14')]);return _0x4ff0d5(_0x31523e[_0xa768('0x11')]['message']);}logger[_0xa768('0x11')]('ContactItemType,\x20%s,\x20%s',_0x3c1679,_0x31523e['error'][_0xa768('0x14')]);return _0x39095a(_0x31523e['error']['message']);}else{logger[_0xa768('0x15')](_0xa768('0x13'),_0x3c1679,'request\x20sent');_0x39095a(_0x31523e[_0xa768('0x16')][_0xa768('0x14')]);}})[_0xa768('0x17')](function(_0x4f87e7){logger[_0xa768('0x11')](_0xa768('0x13'),_0x3c1679,_0x4f87e7);_0x4ff0d5(_0x4f87e7);});});} \ No newline at end of file +var _0xcb39=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb39,0xee));var _0x9cb3=function(_0x3ef5a9,_0x4a2ac6){_0x3ef5a9=_0x3ef5a9-0x0;var _0x272e9a=_0xcb39[_0x3ef5a9];return _0x272e9a;};'use strict';var _=require(_0x9cb3('0x0'));var util=require(_0x9cb3('0x1'));var moment=require(_0x9cb3('0x2'));var BPromise=require(_0x9cb3('0x3'));var rs=require(_0x9cb3('0x4'));var fs=require('fs');var Redis=require(_0x9cb3('0x5'));var db=require(_0x9cb3('0x6'))['db'];var utils=require(_0x9cb3('0x7'));var logger=require(_0x9cb3('0x8'))(_0x9cb3('0x9'));var config=require(_0x9cb3('0xa'));var jayson=require(_0x9cb3('0xb'));var client=jayson[_0x9cb3('0xc')][_0x9cb3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4ad852,_0x3b17b0,_0x486ce9){return new BPromise(function(_0x5801ed,_0x474c39){return client[_0x9cb3('0xe')](_0x4ad852,_0x486ce9)[_0x9cb3('0xf')](function(_0x384357){logger[_0x9cb3('0x10')](_0x9cb3('0x11'),_0x3b17b0,_0x9cb3('0x12'));logger[_0x9cb3('0x13')](_0x9cb3('0x14'),_0x3b17b0,_0x9cb3('0x12'),JSON[_0x9cb3('0x15')](_0x384357));if(_0x384357['error']){if(_0x384357[_0x9cb3('0x16')][_0x9cb3('0x17')]===0x1f4){logger['error'](_0x9cb3('0x11'),_0x3b17b0,_0x384357[_0x9cb3('0x16')][_0x9cb3('0x18')]);return _0x474c39(_0x384357['error'][_0x9cb3('0x18')]);}logger[_0x9cb3('0x16')]('ContactItemType,\x20%s,\x20%s',_0x3b17b0,_0x384357[_0x9cb3('0x16')][_0x9cb3('0x18')]);return _0x5801ed(_0x384357[_0x9cb3('0x16')]['message']);}else{logger[_0x9cb3('0x10')](_0x9cb3('0x11'),_0x3b17b0,_0x9cb3('0x12'));_0x5801ed(_0x384357[_0x9cb3('0x19')][_0x9cb3('0x18')]);}})[_0x9cb3('0x1a')](function(_0x50b518){logger['error']('ContactItemType,\x20%s,\x20%s',_0x3b17b0,_0x50b518);_0x474c39(_0x50b518);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 17b6bff..5d39dfb 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe25=['show','create','put','destroy','multer','util','path','../../config/environment','get','/:id','isAuthenticated'];(function(_0x51e2f4,_0x1acff9){var _0x39ece2=function(_0x3709f0){while(--_0x3709f0){_0x51e2f4['push'](_0x51e2f4['shift']());}};_0x39ece2(++_0x1acff9);}(_0xfe25,0xbf));var _0x5fe2=function(_0x16343e,_0x33dc3e){_0x16343e=_0x16343e-0x0;var _0x29036b=_0xfe25[_0x16343e];return _0x29036b;};'use strict';var multer=require(_0x5fe2('0x0'));var util=require(_0x5fe2('0x1'));var path=require(_0x5fe2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fe2('0x3'));var controller=require('./contactItemType.controller');router[_0x5fe2('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fe2('0x4')](_0x5fe2('0x5'),auth[_0x5fe2('0x6')](),controller[_0x5fe2('0x7')]);router['post']('/',auth[_0x5fe2('0x6')](),controller[_0x5fe2('0x8')]);router[_0x5fe2('0x9')](_0x5fe2('0x5'),auth[_0x5fe2('0x6')](),controller['update']);router['delete'](_0x5fe2('0x5'),auth[_0x5fe2('0x6')](),controller[_0x5fe2('0xa')]);module['exports']=router; \ No newline at end of file +var _0x33fd=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id'];(function(_0x3fb56a,_0x5b610b){var _0x1f0af6=function(_0x1a82e3){while(--_0x1a82e3){_0x3fb56a['push'](_0x3fb56a['shift']());}};_0x1f0af6(++_0x5b610b);}(_0x33fd,0xb9));var _0xd33f=function(_0x1a44e3,_0x1efb77){_0x1a44e3=_0x1a44e3-0x0;var _0x27ebb4=_0x33fd[_0x1a44e3];return _0x27ebb4;};'use strict';var multer=require(_0xd33f('0x0'));var util=require(_0xd33f('0x1'));var path=require(_0xd33f('0x2'));var timeout=require(_0xd33f('0x3'));var express=require(_0xd33f('0x4'));var router=express[_0xd33f('0x5')]();var fs_extra=require(_0xd33f('0x6'));var auth=require(_0xd33f('0x7'));var interaction=require(_0xd33f('0x8'));var config=require(_0xd33f('0x9'));var controller=require(_0xd33f('0xa'));router[_0xd33f('0xb')]('/',auth[_0xd33f('0xc')](),controller[_0xd33f('0xd')]);router[_0xd33f('0xb')](_0xd33f('0xe'),auth[_0xd33f('0xc')](),controller['show']);router[_0xd33f('0xf')]('/',auth[_0xd33f('0xc')](),controller['create']);router[_0xd33f('0x10')](_0xd33f('0xe'),auth[_0xd33f('0xc')](),controller[_0xd33f('0x11')]);router[_0xd33f('0x12')](_0xd33f('0xe'),auth[_0xd33f('0xc')](),controller[_0xd33f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 017bb34..21cb309 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0xb942dd,_0x11bb9f){var _0x3e3113=function(_0x279352){while(--_0x279352){_0xb942dd['push'](_0xb942dd['shift']());}};_0x3e3113(++_0x11bb9f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index fa3b1c2..84b1318 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7f2=['reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','save','destroy','then','get','UserProfileResource','error','name','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','Dashboard','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','update','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport'];(function(_0x2f67f3,_0x40986f){var _0x2b6fc1=function(_0x3e9bcf){while(--_0x3e9bcf){_0x2f67f3['push'](_0x2f67f3['shift']());}};_0x2b6fc1(++_0x40986f);}(_0xe7f2,0x10d));var _0x2e7f=function(_0x2ecf9d,_0x4953f6){_0x2ecf9d=_0x2ecf9d-0x0;var _0x126e08=_0xe7f2[_0x2ecf9d];return _0x126e08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e7f('0x0'));var zipdir=require(_0x2e7f('0x1'));var jsonpatch=require(_0x2e7f('0x2'));var rp=require(_0x2e7f('0x3'));var moment=require(_0x2e7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2e7f('0x5'));var util=require(_0x2e7f('0x6'));var path=require(_0x2e7f('0x7'));var sox=require(_0x2e7f('0x8'));var csv=require(_0x2e7f('0x9'));var ejs=require(_0x2e7f('0xa'));var fs=require('fs');var fs_extra=require(_0x2e7f('0xb'));var _=require('lodash');var squel=require(_0x2e7f('0xc'));var crypto=require(_0x2e7f('0xd'));var jsforce=require(_0x2e7f('0xe'));var deskjs=require(_0x2e7f('0xf'));var toCsv=require(_0x2e7f('0x9'));var querystring=require(_0x2e7f('0x10'));var Papa=require('papaparse');var Redis=require(_0x2e7f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2e7f('0x12'));var hardwareService=require(_0x2e7f('0x13'));var logger=require(_0x2e7f('0x14'))('api');var utils=require(_0x2e7f('0x15'));var config=require(_0x2e7f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e7f('0x17'))['db'];config[_0x2e7f('0x18')]=_[_0x2e7f('0x19')](config[_0x2e7f('0x18')],{'host':_0x2e7f('0x1a'),'port':0x18eb});var socket=require(_0x2e7f('0x1b'))(new Redis(config['redis']));require('./dashboard.socket')[_0x2e7f('0x1c')](socket);function respondWithStatusCode(_0x5e1ad6,_0x356392){_0x356392=_0x356392||0xcc;return function(_0x202328){if(_0x202328){return _0x5e1ad6[_0x2e7f('0x1d')](_0x356392);}return _0x5e1ad6[_0x2e7f('0x1e')](_0x356392)[_0x2e7f('0x1f')]();};}function respondWithResult(_0x5838ba,_0x4df648){_0x4df648=_0x4df648||0xc8;return function(_0x495344){if(_0x495344){return _0x5838ba['status'](_0x4df648)['json'](_0x495344);}};}function respondWithFilteredResult(_0x4d4adc,_0x2b4f64){return function(_0x2dd387){if(_0x2dd387){var _0x14e0e6=typeof _0x2b4f64[_0x2e7f('0x20')]===_0x2e7f('0x21')&&typeof _0x2b4f64[_0x2e7f('0x22')]===_0x2e7f('0x21');var _0x4fc670=_0x2dd387[_0x2e7f('0x23')];var _0x416631=_0x14e0e6?0x0:_0x2b4f64[_0x2e7f('0x20')];var _0x5ceef0=_0x14e0e6?_0x2dd387['count']:_0x2b4f64['offset']+_0x2b4f64['limit'];var _0x1d2cd4;if(_0x5ceef0>=_0x4fc670){_0x5ceef0=_0x4fc670;_0x1d2cd4=0xc8;}else{_0x1d2cd4=0xce;}_0x4d4adc[_0x2e7f('0x1e')](_0x1d2cd4);return _0x4d4adc[_0x2e7f('0x24')]('Content-Range',_0x416631+'-'+_0x5ceef0+'/'+_0x4fc670)[_0x2e7f('0x25')](_0x2dd387);}return null;};}function patchUpdates(_0x1f0321){return function(_0xf961fa){try{jsonpatch['apply'](_0xf961fa,_0x1f0321,!![]);}catch(_0x3cb2dd){return BPromise['reject'](_0x3cb2dd);}return _0xf961fa[_0x2e7f('0x26')]();};}function saveUpdates(_0x59a09a,_0x339841){return function(_0x1e46c0){if(_0x1e46c0){return _0x1e46c0['update'](_0x59a09a)['then'](function(_0x5f345d){return _0x5f345d;});}return null;};}function removeEntity(_0x44e4de,_0x1b1bd0){return function(_0x59d358){if(_0x59d358){return _0x59d358[_0x2e7f('0x27')]()[_0x2e7f('0x28')](function(){var _0x256883=_0x59d358[_0x2e7f('0x29')]({'plain':!![]});var _0x210bcc='CustomDashboards';return db[_0x2e7f('0x2a')][_0x2e7f('0x27')]({'where':{'type':_0x210bcc,'resourceId':_0x256883['id']}})['then'](function(){return _0x59d358;});})[_0x2e7f('0x28')](function(){_0x44e4de[_0x2e7f('0x1e')](0xcc)[_0x2e7f('0x1f')]();});}};}function handleEntityNotFound(_0x58a53f,_0xf3569c){return function(_0x32fcdb){if(!_0x32fcdb){_0x58a53f[_0x2e7f('0x1d')](0x194);}return _0x32fcdb;};}function handleError(_0x4a3f91,_0x1132fc){_0x1132fc=_0x1132fc||0x1f4;return function(_0x5b420b){logger[_0x2e7f('0x2b')](_0x5b420b['stack']);if(_0x5b420b[_0x2e7f('0x2c')]){delete _0x5b420b[_0x2e7f('0x2c')];}_0x4a3f91['status'](_0x1132fc)['send'](_0x5b420b);};}exports[_0x2e7f('0x2d')]=function(_0x511389,_0x963d80){var _0x11a298={},_0x31b86c={},_0x51cb6c={'count':0x0,'rows':[]};var _0x341b4a=_[_0x2e7f('0x2e')](db['Dashboard']['rawAttributes'],function(_0x55f4be){return{'name':_0x55f4be[_0x2e7f('0x2f')],'type':_0x55f4be[_0x2e7f('0x30')][_0x2e7f('0x31')]};});_0x31b86c['model']=_[_0x2e7f('0x2e')](_0x341b4a,_0x2e7f('0x2c'));_0x31b86c[_0x2e7f('0x32')]=_[_0x2e7f('0x33')](_0x511389['query']);_0x31b86c['filters']=_[_0x2e7f('0x34')](_0x31b86c[_0x2e7f('0x35')],_0x31b86c[_0x2e7f('0x32')]);_0x11a298[_0x2e7f('0x36')]=_[_0x2e7f('0x34')](_0x31b86c[_0x2e7f('0x35')],qs[_0x2e7f('0x37')](_0x511389['query'][_0x2e7f('0x37')]));_0x11a298['attributes']=_0x11a298[_0x2e7f('0x36')][_0x2e7f('0x38')]?_0x11a298[_0x2e7f('0x36')]:_0x31b86c[_0x2e7f('0x35')];if(!_0x511389['query'][_0x2e7f('0x39')](_0x2e7f('0x3a'))){_0x11a298[_0x2e7f('0x22')]=qs[_0x2e7f('0x22')](_0x511389['query'][_0x2e7f('0x22')]);_0x11a298['offset']=qs['offset'](_0x511389[_0x2e7f('0x32')]['offset']);}_0x11a298['order']=qs[_0x2e7f('0x3b')](_0x511389[_0x2e7f('0x32')][_0x2e7f('0x3b')]);_0x11a298[_0x2e7f('0x3c')]=qs[_0x2e7f('0x3d')](_[_0x2e7f('0x3e')](_0x511389[_0x2e7f('0x32')],_0x31b86c['filters']),_0x341b4a);if(_0x511389[_0x2e7f('0x32')][_0x2e7f('0x3f')]){_0x11a298[_0x2e7f('0x3c')]=_[_0x2e7f('0x40')](_0x11a298['where'],{'$or':_[_0x2e7f('0x2e')](_0x341b4a,function(_0x5eccf1){if(_0x5eccf1[_0x2e7f('0x30')]!=='VIRTUAL'){var _0x1e4aa6={};_0x1e4aa6[_0x5eccf1[_0x2e7f('0x2c')]]={'$like':'%'+_0x511389[_0x2e7f('0x32')][_0x2e7f('0x3f')]+'%'};return _0x1e4aa6;}})});}_0x11a298=_['merge']({},_0x11a298,_0x511389['options']);var _0x36a7c8={'where':_0x11a298[_0x2e7f('0x3c')]};return db[_0x2e7f('0x41')][_0x2e7f('0x23')](_0x36a7c8)[_0x2e7f('0x28')](function(_0x53a926){_0x51cb6c[_0x2e7f('0x23')]=_0x53a926;if(_0x511389['query'][_0x2e7f('0x42')]){_0x11a298['include']=[{'all':!![]}];}return db[_0x2e7f('0x41')][_0x2e7f('0x43')](_0x11a298);})['then'](function(_0x4a689a){_0x51cb6c[_0x2e7f('0x44')]=_0x4a689a;return _0x51cb6c;})['then'](respondWithFilteredResult(_0x963d80,_0x11a298))[_0x2e7f('0x45')](handleError(_0x963d80,null));};exports[_0x2e7f('0x46')]=function(_0x2b8e7d,_0x5f5aa8){var _0x36eef8={'raw':![],'where':{'id':_0x2b8e7d[_0x2e7f('0x47')]['id']}},_0x39ac80={};_0x39ac80['model']=_[_0x2e7f('0x33')](db[_0x2e7f('0x41')][_0x2e7f('0x48')]);_0x39ac80[_0x2e7f('0x32')]=_[_0x2e7f('0x33')](_0x2b8e7d['query']);_0x39ac80['filters']=_[_0x2e7f('0x34')](_0x39ac80[_0x2e7f('0x35')],_0x39ac80['query']);_0x36eef8[_0x2e7f('0x36')]=_[_0x2e7f('0x34')](_0x39ac80[_0x2e7f('0x35')],qs[_0x2e7f('0x37')](_0x2b8e7d[_0x2e7f('0x32')]['fields']));_0x36eef8['attributes']=_0x36eef8['attributes'][_0x2e7f('0x38')]?_0x36eef8[_0x2e7f('0x36')]:_0x39ac80['model'];if(_0x2b8e7d[_0x2e7f('0x32')][_0x2e7f('0x42')]){_0x36eef8[_0x2e7f('0x49')]=[{'all':!![]}];}_0x36eef8=_[_0x2e7f('0x40')]({},_0x36eef8,_0x2b8e7d[_0x2e7f('0x4a')]);return db[_0x2e7f('0x41')]['find'](_0x36eef8)[_0x2e7f('0x28')](handleEntityNotFound(_0x5f5aa8,null))['then'](respondWithResult(_0x5f5aa8,null))[_0x2e7f('0x45')](handleError(_0x5f5aa8,null));};exports[_0x2e7f('0x4b')]=function(_0x5b3207,_0x158950){return db[_0x2e7f('0x41')][_0x2e7f('0x4b')](_0x5b3207[_0x2e7f('0x4c')],{})[_0x2e7f('0x28')](function(_0x27595c){var _0x27f075=_0x5b3207[_0x2e7f('0x4d')]['get']({'plain':!![]});if(!_0x27f075)throw new Error(_0x2e7f('0x4e'));if(_0x27f075[_0x2e7f('0x4f')]===_0x2e7f('0x4d')){var _0x2f7c02=_0x27595c[_0x2e7f('0x29')]({'plain':!![]});var _0x234a3d=_0x2e7f('0x50');return db[_0x2e7f('0x51')]['find']({'where':{'name':_0x234a3d,'userProfileId':_0x27f075[_0x2e7f('0x52')]},'raw':!![]})['then'](function(_0x514dd7){if(_0x514dd7&&_0x514dd7[_0x2e7f('0x53')]===0x0){return db['UserProfileResource'][_0x2e7f('0x4b')]({'name':_0x2f7c02['name'],'resourceId':_0x2f7c02['id'],'type':_0x514dd7[_0x2e7f('0x2c')],'sectionId':_0x514dd7['id']},{})[_0x2e7f('0x28')](function(){return _0x27595c;});}else{return _0x27595c;}})[_0x2e7f('0x45')](function(_0x25bb87){logger[_0x2e7f('0x2b')](_0x2e7f('0x54'),_0x25bb87);throw _0x25bb87;});}return _0x27595c;})[_0x2e7f('0x28')](respondWithResult(_0x158950,0xc9))['catch'](handleError(_0x158950,null));};exports[_0x2e7f('0x55')]=function(_0x346f64,_0x2dd101){var _0x334405={'where':{'id':_0x346f64['params']['id']}},_0x1396a2={};_0x1396a2[_0x2e7f('0x35')]=_['keys'](db[_0x2e7f('0x41')][_0x2e7f('0x48')]);_0x334405[_0x2e7f('0x36')]=_[_0x2e7f('0x34')](_0x1396a2['model'],qs[_0x2e7f('0x37')](_0x346f64[_0x2e7f('0x32')][_0x2e7f('0x37')]));_0x334405[_0x2e7f('0x36')]=_0x334405['attributes'][_0x2e7f('0x38')]?_0x334405[_0x2e7f('0x36')]:_0x1396a2[_0x2e7f('0x35')];if(_0x346f64[_0x2e7f('0x32')][_0x2e7f('0x42')]){_0x334405[_0x2e7f('0x49')]=[{'all':!![]}];}_0x334405=_[_0x2e7f('0x40')]({},_0x334405,_0x346f64['options']);return db[_0x2e7f('0x41')][_0x2e7f('0x56')](_0x334405)['then'](handleEntityNotFound(_0x2dd101,null))['then'](function(_0x2b0bd1){if(_0x2b0bd1){var _0x1b34e6=_0x2b0bd1[_0x2e7f('0x29')]({'plain':!![]});_0x1b34e6=qs[_0x2e7f('0x57')](_0x1b34e6,['id',_0x2e7f('0x58'),'updatedAt']);_0x346f64[_0x2e7f('0x4c')]=_[_0x2e7f('0x57')](_0x346f64['body'],['id',_0x2e7f('0x58'),_0x2e7f('0x59')]);return db[_0x2e7f('0x41')][_0x2e7f('0x4b')](_[_0x2e7f('0x40')](_0x1b34e6,_0x346f64[_0x2e7f('0x4c')]),{'include':_0x346f64['query'][_0x2e7f('0x42')]?[{'all':!![]}]:undefined})[_0x2e7f('0x28')](function(_0x3820ab){var _0x40feea=_0x346f64['user'][_0x2e7f('0x29')]({'plain':!![]});if(!_0x40feea)throw new Error(_0x2e7f('0x4e'));if(_0x40feea[_0x2e7f('0x4f')]===_0x2e7f('0x4d')){var _0x370993=_0x3820ab[_0x2e7f('0x29')]({'plain':!![]});var _0x5bce48=_0x2e7f('0x50');return db[_0x2e7f('0x51')][_0x2e7f('0x56')]({'where':{'name':_0x5bce48,'userProfileId':_0x40feea[_0x2e7f('0x52')]},'raw':!![]})[_0x2e7f('0x28')](function(_0x2839f3){if(_0x2839f3&&_0x2839f3[_0x2e7f('0x53')]===0x0){return db[_0x2e7f('0x2a')][_0x2e7f('0x4b')]({'name':_0x370993[_0x2e7f('0x2c')],'resourceId':_0x370993['id'],'type':_0x2839f3[_0x2e7f('0x2c')],'sectionId':_0x2839f3['id']},{})[_0x2e7f('0x28')](function(){return _0x3820ab;});}else{return _0x3820ab;}})[_0x2e7f('0x45')](function(_0x2b9442){logger[_0x2e7f('0x2b')](_0x2e7f('0x54'),_0x2b9442);throw _0x2b9442;});}return _0x3820ab;});}})[_0x2e7f('0x28')](respondWithResult(_0x2dd101,0xc9))[_0x2e7f('0x45')](handleError(_0x2dd101,null));};exports[_0x2e7f('0x5a')]=function(_0x10d3a5,_0x1478f4){if(_0x10d3a5['body']['id']){delete _0x10d3a5['body']['id'];}return db[_0x2e7f('0x41')][_0x2e7f('0x56')]({'where':{'id':_0x10d3a5[_0x2e7f('0x47')]['id']}})[_0x2e7f('0x28')](handleEntityNotFound(_0x1478f4,null))[_0x2e7f('0x28')](saveUpdates(_0x10d3a5[_0x2e7f('0x4c')],null))[_0x2e7f('0x28')](respondWithResult(_0x1478f4,null))[_0x2e7f('0x45')](handleError(_0x1478f4,null));};exports[_0x2e7f('0x27')]=function(_0x4190e1,_0x167d62){return db['Dashboard'][_0x2e7f('0x56')]({'where':{'id':_0x4190e1['params']['id']}})[_0x2e7f('0x28')](handleEntityNotFound(_0x167d62,null))[_0x2e7f('0x28')](removeEntity(_0x167d62,null))[_0x2e7f('0x45')](handleError(_0x167d62,null));};function widgetAttributes(_0x4b2205){try{switch(_0x4b2205['type']){case _0x2e7f('0x5b'):return[{'name':_0x2e7f('0x5c'),'value':_0x4b2205[_0x2e7f('0x5c')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x0]?_0x4b2205['attrs'][0x0]['value']:undefined)||'https://'}];case _0x2e7f('0x5e'):return[{'name':_0x2e7f('0x5f'),'value':_0x4b2205[_0x2e7f('0x5f')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x0]?_0x4b2205['attrs'][0x0][_0x2e7f('0x60')]:undefined)||''}];case _0x2e7f('0x61'):return[{'name':_0x2e7f('0x62'),'value':_0x4b2205[_0x2e7f('0x62')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x0]?_0x4b2205['attrs'][0x0]['value']:undefined)||_0x2e7f('0x63')},{'name':_0x2e7f('0x64'),'value':_0x4b2205[_0x2e7f('0x64')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x1]?_0x4b2205[_0x2e7f('0x5d')][0x1][_0x2e7f('0x60')]:undefined)||_0x2e7f('0x65')},{'name':'attrFontSize','value':_0x4b2205['attrFontSize']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x2]?_0x4b2205[_0x2e7f('0x5d')][0x2][_0x2e7f('0x60')]:undefined)||0xc}];case _0x2e7f('0x66'):return[{'name':_0x2e7f('0x67'),'value':_0x4b2205['attrMetric']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205['attrs'][0x0]?_0x4b2205[_0x2e7f('0x5d')][0x0][_0x2e7f('0x60')]:undefined)||'total'},{'name':_0x2e7f('0x68'),'value':_0x4b2205[_0x2e7f('0x68')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x1]?_0x4b2205[_0x2e7f('0x5d')][0x1][_0x2e7f('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x4b2205['attrFontSize']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x2]?_0x4b2205[_0x2e7f('0x5d')][0x2][_0x2e7f('0x60')]:undefined)||0x14},{'name':_0x2e7f('0x69'),'value':_0x4b2205[_0x2e7f('0x69')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205['attrs'][0x3]?_0x4b2205[_0x2e7f('0x5d')][0x3][_0x2e7f('0x60')]:undefined)||_0x2e7f('0x6a')},{'name':_0x2e7f('0x6b'),'value':_0x4b2205[_0x2e7f('0x6b')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x4]?_0x4b2205[_0x2e7f('0x5d')][0x4]['value']:undefined)||''},{'name':_0x2e7f('0x6c'),'value':_0x4b2205[_0x2e7f('0x6c')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x5]?_0x4b2205[_0x2e7f('0x5d')][0x5][_0x2e7f('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4b2205[_0x2e7f('0x6d')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x6]?_0x4b2205['attrs'][0x6][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x6e'),'value':_0x4b2205[_0x2e7f('0x6e')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205['attrs'][0x7]?_0x4b2205['attrs'][0x7]['value']:undefined)||''},{'name':_0x2e7f('0x6f'),'value':_0x4b2205['attrWhatsappAccounts']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x8]?_0x4b2205[_0x2e7f('0x5d')][0x8][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x70'),'value':_0x4b2205['attrChatWebsites']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x9]?_0x4b2205[_0x2e7f('0x5d')][0x9][_0x2e7f('0x60')]:undefined)||''}];case _0x2e7f('0x71'):case _0x2e7f('0x72'):return[{'name':_0x2e7f('0x73'),'value':_0x4b2205['attrSerie1']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x0]?_0x4b2205[_0x2e7f('0x5d')][0x0][_0x2e7f('0x60')]:undefined)||_0x2e7f('0x74')},{'name':_0x2e7f('0x75'),'value':_0x4b2205[_0x2e7f('0x75')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x1]?_0x4b2205[_0x2e7f('0x5d')][0x1][_0x2e7f('0x60')]:undefined)||null},{'name':_0x2e7f('0x76'),'value':_0x4b2205[_0x2e7f('0x76')]||(_0x4b2205['attrs']&&_0x4b2205[_0x2e7f('0x5d')][0x2]?_0x4b2205['attrs'][0x2]['value']:undefined)||null},{'name':_0x2e7f('0x68'),'value':_0x4b2205[_0x2e7f('0x68')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x3]?_0x4b2205[_0x2e7f('0x5d')][0x3][_0x2e7f('0x60')]:undefined)||[]},{'name':'attrChannel','value':_0x4b2205[_0x2e7f('0x69')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x4]?_0x4b2205['attrs'][0x4]['value']:undefined)||_0x2e7f('0x6a')},{'name':_0x2e7f('0x6b'),'value':_0x4b2205[_0x2e7f('0x6b')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x5]?_0x4b2205[_0x2e7f('0x5d')][0x5][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x6c'),'value':_0x4b2205[_0x2e7f('0x6c')]||(_0x4b2205['attrs']&&_0x4b2205[_0x2e7f('0x5d')][0x6]?_0x4b2205['attrs'][0x6][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x6d'),'value':_0x4b2205['attrSmsAccounts']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x7]?_0x4b2205['attrs'][0x7][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x6e'),'value':_0x4b2205[_0x2e7f('0x6e')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x8]?_0x4b2205[_0x2e7f('0x5d')][0x8][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x6f'),'value':_0x4b2205[_0x2e7f('0x6f')]||(_0x4b2205['attrs']&&_0x4b2205[_0x2e7f('0x5d')][0x9]?_0x4b2205[_0x2e7f('0x5d')][0x9][_0x2e7f('0x60')]:undefined)||''},{'name':_0x2e7f('0x70'),'value':_0x4b2205[_0x2e7f('0x70')]||(_0x4b2205['attrs']&&_0x4b2205[_0x2e7f('0x5d')][0xa]?_0x4b2205[_0x2e7f('0x5d')][0xa][_0x2e7f('0x60')]:undefined)||''}];case _0x2e7f('0x77'):return[{'name':_0x2e7f('0x78'),'type':_0x4b2205[_0x2e7f('0x79')]||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x0]?_0x4b2205[_0x2e7f('0x5d')][0x0][_0x2e7f('0x30')]:undefined)||null,'value':_0x4b2205['attrReport']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x0]?_0x4b2205[_0x2e7f('0x5d')][0x0]['value']:undefined)||null},{'name':_0x2e7f('0x7a'),'value':_0x4b2205['attrRefresh']||(_0x4b2205[_0x2e7f('0x5d')]&&_0x4b2205[_0x2e7f('0x5d')][0x1]?_0x4b2205[_0x2e7f('0x5d')][0x1][_0x2e7f('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x329adf){logger[_0x2e7f('0x2b')]('widgetAttributes:\x20%s',JSON[_0x2e7f('0x7b')](_0x329adf));return[];}}exports[_0x2e7f('0x7c')]=function(_0x2050a6,_0x36763c,_0x3e7d8f){if(_0x2050a6['body']['id']){delete _0x2050a6[_0x2e7f('0x4c')]['id'];}return db['Dashboard'][_0x2e7f('0x56')]({'where':{'id':_0x2050a6[_0x2e7f('0x47')]['id']}})[_0x2e7f('0x28')](handleEntityNotFound(_0x36763c,null))[_0x2e7f('0x28')](function(_0x2529f4){if(_0x2529f4){_0x2050a6['body'][_0x2e7f('0x7d')]=_0x2529f4['id'];_0x2050a6[_0x2e7f('0x4c')]['attrs']=widgetAttributes(_0x2050a6[_0x2e7f('0x4c')]);return db[_0x2e7f('0x7e')][_0x2e7f('0x4b')](_0x2050a6['body']);}})[_0x2e7f('0x28')](respondWithResult(_0x36763c,null))[_0x2e7f('0x45')](handleError(_0x36763c,null));};exports[_0x2e7f('0x7f')]=function(_0x1beb27,_0x295a12,_0x39401d){var _0x1c3f29={};var _0x22f3a0={};var _0x1ce102;var _0x1a4ef0;return db[_0x2e7f('0x41')][_0x2e7f('0x80')]({'where':{'id':_0x1beb27[_0x2e7f('0x47')]['id']}})[_0x2e7f('0x28')](handleEntityNotFound(_0x295a12,null))[_0x2e7f('0x28')](function(_0x1d4f41){if(_0x1d4f41){_0x1ce102=_0x1d4f41;_0x22f3a0[_0x2e7f('0x35')]=_[_0x2e7f('0x33')](db['DashboardItem'][_0x2e7f('0x48')]);_0x22f3a0[_0x2e7f('0x32')]=_[_0x2e7f('0x33')](_0x1beb27[_0x2e7f('0x32')]);_0x22f3a0['filters']=_['intersection'](_0x22f3a0['model'],_0x22f3a0[_0x2e7f('0x32')]);_0x1c3f29[_0x2e7f('0x36')]=_[_0x2e7f('0x34')](_0x22f3a0[_0x2e7f('0x35')],qs[_0x2e7f('0x37')](_0x1beb27[_0x2e7f('0x32')][_0x2e7f('0x37')]));_0x1c3f29[_0x2e7f('0x36')]=_0x1c3f29[_0x2e7f('0x36')]['length']?_0x1c3f29[_0x2e7f('0x36')]:_0x22f3a0['model'];_0x1c3f29[_0x2e7f('0x81')]=qs['sort'](_0x1beb27[_0x2e7f('0x32')][_0x2e7f('0x3b')]);_0x1c3f29['where']=qs['filters'](_[_0x2e7f('0x3e')](_0x1beb27[_0x2e7f('0x32')],_0x22f3a0[_0x2e7f('0x3d')]));if(_0x1beb27[_0x2e7f('0x32')][_0x2e7f('0x3f')]){_0x1c3f29[_0x2e7f('0x3c')]=_[_0x2e7f('0x40')](_0x1c3f29['where'],{'$or':_[_0x2e7f('0x2e')](_0x1c3f29['attributes'],function(_0x2a2fbd){var _0x5d2537={};_0x5d2537[_0x2a2fbd]={'$like':'%'+_0x1beb27[_0x2e7f('0x32')]['filter']+'%'};return _0x5d2537;})});}_0x1c3f29=_[_0x2e7f('0x40')]({},_0x1c3f29,_0x1beb27[_0x2e7f('0x4a')]);return _0x1ce102[_0x2e7f('0x7f')](_0x1c3f29);}})['then'](function(_0x5e6715){if(_0x5e6715){_0x1a4ef0=_0x5e6715[_0x2e7f('0x38')];if(!_0x1beb27['query'][_0x2e7f('0x39')](_0x2e7f('0x3a'))){_0x1c3f29[_0x2e7f('0x22')]=qs['limit'](_0x1beb27[_0x2e7f('0x32')][_0x2e7f('0x22')]);_0x1c3f29[_0x2e7f('0x20')]=qs['offset'](_0x1beb27[_0x2e7f('0x32')]['offset']);}return _0x1ce102[_0x2e7f('0x7f')](_0x1c3f29);}})['then'](function(_0x5e4abb){if(_0x5e4abb){return _0x5e4abb?{'count':_0x1a4ef0,'rows':_0x5e4abb}:null;}})[_0x2e7f('0x28')](respondWithResult(_0x295a12,null))[_0x2e7f('0x45')](handleError(_0x295a12,null));}; \ No newline at end of file +var _0xdfb4=['omit','createdAt','updatedAt','role','update','iframe','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrOpenchannelAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','order','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','Dashboard','rawAttributes','fieldName','type','key','model','map','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','keys','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0xf37b8d,_0x42ce54){var _0x3b0b62=function(_0x41a7cc){while(--_0x41a7cc){_0xf37b8d['push'](_0xf37b8d['shift']());}};_0x3b0b62(++_0x42ce54);}(_0xdfb4,0x131));var _0x4dfb=function(_0xc7a0e1,_0x2ed7c5){_0xc7a0e1=_0xc7a0e1-0x0;var _0x19698c=_0xdfb4[_0xc7a0e1];return _0x19698c;};'use strict';var emlformat=require(_0x4dfb('0x0'));var rimraf=require(_0x4dfb('0x1'));var zipdir=require(_0x4dfb('0x2'));var jsonpatch=require(_0x4dfb('0x3'));var rp=require(_0x4dfb('0x4'));var moment=require('moment');var BPromise=require(_0x4dfb('0x5'));var Mustache=require('mustache');var util=require(_0x4dfb('0x6'));var path=require(_0x4dfb('0x7'));var sox=require('sox');var csv=require(_0x4dfb('0x8'));var ejs=require(_0x4dfb('0x9'));var fs=require('fs');var fs_extra=require(_0x4dfb('0xa'));var _=require(_0x4dfb('0xb'));var squel=require(_0x4dfb('0xc'));var crypto=require(_0x4dfb('0xd'));var jsforce=require(_0x4dfb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4dfb('0x8'));var querystring=require('querystring');var Papa=require(_0x4dfb('0xf'));var Redis=require('ioredis');var authService=require(_0x4dfb('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dfb('0x11'));var logger=require(_0x4dfb('0x12'))(_0x4dfb('0x13'));var utils=require(_0x4dfb('0x14'));var config=require(_0x4dfb('0x15'));var licenseUtil=require(_0x4dfb('0x16'));var db=require('../../mysqldb')['db'];config[_0x4dfb('0x17')]=_[_0x4dfb('0x18')](config['redis'],{'host':_0x4dfb('0x19'),'port':0x18eb});var socket=require(_0x4dfb('0x1a'))(new Redis(config[_0x4dfb('0x17')]));require(_0x4dfb('0x1b'))[_0x4dfb('0x1c')](socket);function respondWithStatusCode(_0x1d51f9,_0x84105e){_0x84105e=_0x84105e||0xcc;return function(_0x2f2457){if(_0x2f2457){return _0x1d51f9[_0x4dfb('0x1d')](_0x84105e);}return _0x1d51f9[_0x4dfb('0x1e')](_0x84105e)[_0x4dfb('0x1f')]();};}function respondWithResult(_0x3fc365,_0x1eb348){_0x1eb348=_0x1eb348||0xc8;return function(_0x59e6fd){if(_0x59e6fd){return _0x3fc365['status'](_0x1eb348)[_0x4dfb('0x20')](_0x59e6fd);}};}function respondWithFilteredResult(_0x470fc4,_0x535bed){return function(_0x289ef6){if(_0x289ef6){var _0x1f8714=typeof _0x535bed[_0x4dfb('0x21')]===_0x4dfb('0x22')&&typeof _0x535bed[_0x4dfb('0x23')]===_0x4dfb('0x22');var _0x15e1b2=_0x289ef6['count'];var _0x9b6575=_0x1f8714?0x0:_0x535bed[_0x4dfb('0x21')];var _0x3b8eec=_0x1f8714?_0x289ef6[_0x4dfb('0x24')]:_0x535bed[_0x4dfb('0x21')]+_0x535bed[_0x4dfb('0x23')];var _0x689fde;if(_0x3b8eec>=_0x15e1b2){_0x3b8eec=_0x15e1b2;_0x689fde=0xc8;}else{_0x689fde=0xce;}_0x470fc4[_0x4dfb('0x1e')](_0x689fde);return _0x470fc4[_0x4dfb('0x25')](_0x4dfb('0x26'),_0x9b6575+'-'+_0x3b8eec+'/'+_0x15e1b2)[_0x4dfb('0x20')](_0x289ef6);}return null;};}function patchUpdates(_0x5f46bb){return function(_0x5b3659){try{jsonpatch[_0x4dfb('0x27')](_0x5b3659,_0x5f46bb,!![]);}catch(_0x58ff86){return BPromise[_0x4dfb('0x28')](_0x58ff86);}return _0x5b3659[_0x4dfb('0x29')]();};}function saveUpdates(_0x59d036,_0xf38e58){return function(_0x1ef2dd){if(_0x1ef2dd){return _0x1ef2dd['update'](_0x59d036)[_0x4dfb('0x2a')](function(_0x516584){return _0x516584;});}return null;};}function removeEntity(_0x243d15,_0x3a4df2){return function(_0x9a81bf){if(_0x9a81bf){return _0x9a81bf[_0x4dfb('0x2b')]()['then'](function(){var _0x236e7a=_0x9a81bf[_0x4dfb('0x2c')]({'plain':!![]});var _0x3de456=_0x4dfb('0x2d');return db[_0x4dfb('0x2e')][_0x4dfb('0x2b')]({'where':{'type':_0x3de456,'resourceId':_0x236e7a['id']}})[_0x4dfb('0x2a')](function(){return _0x9a81bf;});})[_0x4dfb('0x2a')](function(){_0x243d15[_0x4dfb('0x1e')](0xcc)[_0x4dfb('0x1f')]();});}};}function handleEntityNotFound(_0x499b45,_0x3bb9f4){return function(_0x9e61da){if(!_0x9e61da){_0x499b45['sendStatus'](0x194);}return _0x9e61da;};}function handleError(_0x583096,_0x563541){_0x563541=_0x563541||0x1f4;return function(_0x50d091){logger[_0x4dfb('0x2f')](_0x50d091[_0x4dfb('0x30')]);if(_0x50d091[_0x4dfb('0x31')]){delete _0x50d091[_0x4dfb('0x31')];}_0x583096[_0x4dfb('0x1e')](_0x563541)['send'](_0x50d091);};}exports['index']=function(_0x218673,_0x43c1cd){var _0x478b55={},_0x59fb0a={},_0x5a29e5={'count':0x0,'rows':[]};var _0x10015e=_['map'](db[_0x4dfb('0x32')][_0x4dfb('0x33')],function(_0x310c4e){return{'name':_0x310c4e[_0x4dfb('0x34')],'type':_0x310c4e[_0x4dfb('0x35')][_0x4dfb('0x36')]};});_0x59fb0a[_0x4dfb('0x37')]=_[_0x4dfb('0x38')](_0x10015e,'name');_0x59fb0a['query']=_['keys'](_0x218673['query']);_0x59fb0a['filters']=_[_0x4dfb('0x39')](_0x59fb0a[_0x4dfb('0x37')],_0x59fb0a['query']);_0x478b55[_0x4dfb('0x3a')]=_[_0x4dfb('0x39')](_0x59fb0a[_0x4dfb('0x37')],qs[_0x4dfb('0x3b')](_0x218673[_0x4dfb('0x3c')]['fields']));_0x478b55[_0x4dfb('0x3a')]=_0x478b55[_0x4dfb('0x3a')][_0x4dfb('0x3d')]?_0x478b55['attributes']:_0x59fb0a[_0x4dfb('0x37')];if(!_0x218673['query'][_0x4dfb('0x3e')](_0x4dfb('0x3f'))){_0x478b55[_0x4dfb('0x23')]=qs['limit'](_0x218673['query'][_0x4dfb('0x23')]);_0x478b55[_0x4dfb('0x21')]=qs[_0x4dfb('0x21')](_0x218673[_0x4dfb('0x3c')][_0x4dfb('0x21')]);}_0x478b55['order']=qs[_0x4dfb('0x40')](_0x218673[_0x4dfb('0x3c')]['sort']);_0x478b55['where']=qs['filters'](_[_0x4dfb('0x41')](_0x218673['query'],_0x59fb0a['filters']),_0x10015e);if(_0x218673['query'][_0x4dfb('0x42')]){_0x478b55['where']=_['merge'](_0x478b55[_0x4dfb('0x43')],{'$or':_[_0x4dfb('0x38')](_0x10015e,function(_0x2f1214){if(_0x2f1214[_0x4dfb('0x35')]!==_0x4dfb('0x44')){var _0x389d5a={};_0x389d5a[_0x2f1214[_0x4dfb('0x31')]]={'$like':'%'+_0x218673['query']['filter']+'%'};return _0x389d5a;}})});}_0x478b55=_[_0x4dfb('0x45')]({},_0x478b55,_0x218673['options']);var _0x38cd88={'where':_0x478b55['where']};return db[_0x4dfb('0x32')][_0x4dfb('0x24')](_0x38cd88)[_0x4dfb('0x2a')](function(_0x4a8321){_0x5a29e5[_0x4dfb('0x24')]=_0x4a8321;if(_0x218673[_0x4dfb('0x3c')][_0x4dfb('0x46')]){_0x478b55[_0x4dfb('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x4dfb('0x48')](_0x478b55);})[_0x4dfb('0x2a')](function(_0x4d4ed2){_0x5a29e5[_0x4dfb('0x49')]=_0x4d4ed2;return _0x5a29e5;})[_0x4dfb('0x2a')](respondWithFilteredResult(_0x43c1cd,_0x478b55))[_0x4dfb('0x4a')](handleError(_0x43c1cd,null));};exports[_0x4dfb('0x4b')]=function(_0x3ca90c,_0x1dde5b){var _0x138e3b={'raw':![],'where':{'id':_0x3ca90c['params']['id']}},_0x5592d8={};_0x5592d8[_0x4dfb('0x37')]=_[_0x4dfb('0x4c')](db[_0x4dfb('0x32')]['rawAttributes']);_0x5592d8[_0x4dfb('0x3c')]=_[_0x4dfb('0x4c')](_0x3ca90c[_0x4dfb('0x3c')]);_0x5592d8[_0x4dfb('0x4d')]=_[_0x4dfb('0x39')](_0x5592d8[_0x4dfb('0x37')],_0x5592d8[_0x4dfb('0x3c')]);_0x138e3b['attributes']=_[_0x4dfb('0x39')](_0x5592d8['model'],qs[_0x4dfb('0x3b')](_0x3ca90c[_0x4dfb('0x3c')][_0x4dfb('0x3b')]));_0x138e3b[_0x4dfb('0x3a')]=_0x138e3b['attributes'][_0x4dfb('0x3d')]?_0x138e3b[_0x4dfb('0x3a')]:_0x5592d8[_0x4dfb('0x37')];if(_0x3ca90c[_0x4dfb('0x3c')][_0x4dfb('0x46')]){_0x138e3b[_0x4dfb('0x47')]=[{'all':!![]}];}_0x138e3b=_[_0x4dfb('0x45')]({},_0x138e3b,_0x3ca90c['options']);return db[_0x4dfb('0x32')][_0x4dfb('0x4e')](_0x138e3b)['then'](handleEntityNotFound(_0x1dde5b,null))[_0x4dfb('0x2a')](respondWithResult(_0x1dde5b,null))[_0x4dfb('0x4a')](handleError(_0x1dde5b,null));};exports[_0x4dfb('0x4f')]=function(_0x5aa90e,_0x45b6ad){return db[_0x4dfb('0x32')][_0x4dfb('0x4f')](_0x5aa90e[_0x4dfb('0x50')],{})[_0x4dfb('0x2a')](function(_0x76dc9c){var _0x1da471=_0x5aa90e[_0x4dfb('0x51')][_0x4dfb('0x2c')]({'plain':!![]});if(!_0x1da471)throw new Error(_0x4dfb('0x52'));if(_0x1da471['role']===_0x4dfb('0x51')){var _0x4b12db=_0x76dc9c['get']({'plain':!![]});var _0xdd6156='CustomDashboards';return db[_0x4dfb('0x53')][_0x4dfb('0x4e')]({'where':{'name':_0xdd6156,'userProfileId':_0x1da471[_0x4dfb('0x54')]},'raw':!![]})[_0x4dfb('0x2a')](function(_0x20d720){if(_0x20d720&&_0x20d720[_0x4dfb('0x55')]===0x0){return db[_0x4dfb('0x2e')][_0x4dfb('0x4f')]({'name':_0x4b12db[_0x4dfb('0x31')],'resourceId':_0x4b12db['id'],'type':_0x20d720['name'],'sectionId':_0x20d720['id']},{})[_0x4dfb('0x2a')](function(){return _0x76dc9c;});}else{return _0x76dc9c;}})['catch'](function(_0x2678da){logger[_0x4dfb('0x2f')](_0x4dfb('0x56'),_0x2678da);throw _0x2678da;});}return _0x76dc9c;})['then'](respondWithResult(_0x45b6ad,0xc9))['catch'](handleError(_0x45b6ad,null));};exports['clone']=function(_0x47030d,_0x4893dc){var _0x505fd7={'where':{'id':_0x47030d[_0x4dfb('0x57')]['id']}},_0x1fd1ae={};_0x1fd1ae[_0x4dfb('0x37')]=_[_0x4dfb('0x4c')](db[_0x4dfb('0x32')]['rawAttributes']);_0x505fd7['attributes']=_[_0x4dfb('0x39')](_0x1fd1ae[_0x4dfb('0x37')],qs[_0x4dfb('0x3b')](_0x47030d[_0x4dfb('0x3c')][_0x4dfb('0x3b')]));_0x505fd7[_0x4dfb('0x3a')]=_0x505fd7['attributes'][_0x4dfb('0x3d')]?_0x505fd7['attributes']:_0x1fd1ae[_0x4dfb('0x37')];if(_0x47030d[_0x4dfb('0x3c')][_0x4dfb('0x46')]){_0x505fd7[_0x4dfb('0x47')]=[{'all':!![]}];}_0x505fd7=_[_0x4dfb('0x45')]({},_0x505fd7,_0x47030d['options']);return db[_0x4dfb('0x32')][_0x4dfb('0x4e')](_0x505fd7)[_0x4dfb('0x2a')](handleEntityNotFound(_0x4893dc,null))[_0x4dfb('0x2a')](function(_0x24c2aa){if(_0x24c2aa){var _0x113ebb=_0x24c2aa[_0x4dfb('0x2c')]({'plain':!![]});_0x113ebb=qs[_0x4dfb('0x58')](_0x113ebb,['id',_0x4dfb('0x59'),_0x4dfb('0x5a')]);_0x47030d['body']=_[_0x4dfb('0x58')](_0x47030d[_0x4dfb('0x50')],['id',_0x4dfb('0x59'),'updatedAt']);return db[_0x4dfb('0x32')][_0x4dfb('0x4f')](_[_0x4dfb('0x45')](_0x113ebb,_0x47030d[_0x4dfb('0x50')]),{'include':_0x47030d[_0x4dfb('0x3c')][_0x4dfb('0x46')]?[{'all':!![]}]:undefined})[_0x4dfb('0x2a')](function(_0x3af576){var _0x10567c=_0x47030d[_0x4dfb('0x51')][_0x4dfb('0x2c')]({'plain':!![]});if(!_0x10567c)throw new Error(_0x4dfb('0x52'));if(_0x10567c[_0x4dfb('0x5b')]===_0x4dfb('0x51')){var _0x321470=_0x3af576[_0x4dfb('0x2c')]({'plain':!![]});var _0x45cd35='CustomDashboards';return db[_0x4dfb('0x53')]['find']({'where':{'name':_0x45cd35,'userProfileId':_0x10567c[_0x4dfb('0x54')]},'raw':!![]})[_0x4dfb('0x2a')](function(_0x2e9964){if(_0x2e9964&&_0x2e9964['autoAssociation']===0x0){return db[_0x4dfb('0x2e')][_0x4dfb('0x4f')]({'name':_0x321470[_0x4dfb('0x31')],'resourceId':_0x321470['id'],'type':_0x2e9964['name'],'sectionId':_0x2e9964['id']},{})[_0x4dfb('0x2a')](function(){return _0x3af576;});}else{return _0x3af576;}})[_0x4dfb('0x4a')](function(_0xfa380b){logger[_0x4dfb('0x2f')](_0x4dfb('0x56'),_0xfa380b);throw _0xfa380b;});}return _0x3af576;});}})[_0x4dfb('0x2a')](respondWithResult(_0x4893dc,0xc9))[_0x4dfb('0x4a')](handleError(_0x4893dc,null));};exports[_0x4dfb('0x5c')]=function(_0x2009a9,_0xd90120){if(_0x2009a9[_0x4dfb('0x50')]['id']){delete _0x2009a9[_0x4dfb('0x50')]['id'];}return db['Dashboard'][_0x4dfb('0x4e')]({'where':{'id':_0x2009a9[_0x4dfb('0x57')]['id']}})[_0x4dfb('0x2a')](handleEntityNotFound(_0xd90120,null))['then'](saveUpdates(_0x2009a9[_0x4dfb('0x50')],null))[_0x4dfb('0x2a')](respondWithResult(_0xd90120,null))[_0x4dfb('0x4a')](handleError(_0xd90120,null));};exports[_0x4dfb('0x2b')]=function(_0x350534,_0x3d8397){return db[_0x4dfb('0x32')]['find']({'where':{'id':_0x350534[_0x4dfb('0x57')]['id']}})[_0x4dfb('0x2a')](handleEntityNotFound(_0x3d8397,null))[_0x4dfb('0x2a')](removeEntity(_0x3d8397,null))[_0x4dfb('0x4a')](handleError(_0x3d8397,null));};function widgetAttributes(_0x2c56a7){try{switch(_0x2c56a7[_0x4dfb('0x35')]){case _0x4dfb('0x5d'):return[{'name':'attrUrl','value':_0x2c56a7['attrUrl']||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x60')}];case _0x4dfb('0x61'):return[{'name':_0x4dfb('0x62'),'value':_0x2c56a7[_0x4dfb('0x62')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0][_0x4dfb('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x4dfb('0x63'),'value':_0x2c56a7[_0x4dfb('0x63')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x64')},{'name':_0x4dfb('0x65'),'value':_0x2c56a7[_0x4dfb('0x65')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x66')},{'name':_0x4dfb('0x67'),'value':_0x2c56a7[_0x4dfb('0x67')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x2]?_0x2c56a7['attrs'][0x2][_0x4dfb('0x5f')]:undefined)||0xc}];case _0x4dfb('0x68'):return[{'name':_0x4dfb('0x69'),'value':_0x2c56a7['attrMetric']||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0]['value']:undefined)||_0x4dfb('0x6a')},{'name':_0x4dfb('0x6b'),'value':_0x2c56a7[_0x4dfb('0x6b')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1][_0x4dfb('0x5f')]:undefined)||[]},{'name':_0x4dfb('0x67'),'value':_0x2c56a7[_0x4dfb('0x67')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x2]?_0x2c56a7['attrs'][0x2][_0x4dfb('0x5f')]:undefined)||0x14},{'name':_0x4dfb('0x6c'),'value':_0x2c56a7[_0x4dfb('0x6c')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x3]?_0x2c56a7[_0x4dfb('0x5e')][0x3][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x6d')},{'name':'attrEmailAccounts','value':_0x2c56a7[_0x4dfb('0x6e')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x4]?_0x2c56a7[_0x4dfb('0x5e')][0x4][_0x4dfb('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2c56a7[_0x4dfb('0x6f')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x5]?_0x2c56a7['attrs'][0x5][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x70'),'value':_0x2c56a7[_0x4dfb('0x70')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x6]?_0x2c56a7['attrs'][0x6][_0x4dfb('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c56a7['attrOpenchannelAccounts']||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x7]?_0x2c56a7['attrs'][0x7]['value']:undefined)||''},{'name':_0x4dfb('0x71'),'value':_0x2c56a7[_0x4dfb('0x71')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x8]?_0x2c56a7['attrs'][0x8][_0x4dfb('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c56a7[_0x4dfb('0x72')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x9]?_0x2c56a7[_0x4dfb('0x5e')][0x9][_0x4dfb('0x5f')]:undefined)||''}];case _0x4dfb('0x73'):case'pie-chart':return[{'name':'attrSerie1','value':_0x2c56a7[_0x4dfb('0x74')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0]['value']:undefined)||_0x4dfb('0x6a')},{'name':_0x4dfb('0x75'),'value':_0x2c56a7[_0x4dfb('0x75')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1]['value']:undefined)||null},{'name':_0x4dfb('0x76'),'value':_0x2c56a7['attrSerie3']||(_0x2c56a7['attrs']&&_0x2c56a7['attrs'][0x2]?_0x2c56a7[_0x4dfb('0x5e')][0x2][_0x4dfb('0x5f')]:undefined)||null},{'name':_0x4dfb('0x6b'),'value':_0x2c56a7[_0x4dfb('0x6b')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x3]?_0x2c56a7['attrs'][0x3][_0x4dfb('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x2c56a7[_0x4dfb('0x6c')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x4]?_0x2c56a7[_0x4dfb('0x5e')][0x4][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x6d')},{'name':_0x4dfb('0x6e'),'value':_0x2c56a7[_0x4dfb('0x6e')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x5]?_0x2c56a7['attrs'][0x5][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x6f'),'value':_0x2c56a7[_0x4dfb('0x6f')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x6]?_0x2c56a7[_0x4dfb('0x5e')][0x6][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x70'),'value':_0x2c56a7[_0x4dfb('0x70')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x7]?_0x2c56a7['attrs'][0x7][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x77'),'value':_0x2c56a7[_0x4dfb('0x77')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x8]?_0x2c56a7['attrs'][0x8][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x71'),'value':_0x2c56a7[_0x4dfb('0x71')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x9]?_0x2c56a7[_0x4dfb('0x5e')][0x9]['value']:undefined)||''},{'name':_0x4dfb('0x72'),'value':_0x2c56a7[_0x4dfb('0x72')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0xa]?_0x2c56a7[_0x4dfb('0x5e')][0xa][_0x4dfb('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0x4dfb('0x78'),'type':_0x2c56a7[_0x4dfb('0x79')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0]['type']:undefined)||null,'value':_0x2c56a7[_0x4dfb('0x78')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7['attrs'][0x0][_0x4dfb('0x5f')]:undefined)||null},{'name':_0x4dfb('0x7a'),'value':_0x2c56a7[_0x4dfb('0x7a')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1][_0x4dfb('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x417f19){logger[_0x4dfb('0x2f')](_0x4dfb('0x7b'),JSON[_0x4dfb('0x7c')](_0x417f19));return[];}}exports['addItem']=function(_0x1d649c,_0xf33622,_0x4b3774){if(_0x1d649c[_0x4dfb('0x50')]['id']){delete _0x1d649c[_0x4dfb('0x50')]['id'];}return db[_0x4dfb('0x32')][_0x4dfb('0x4e')]({'where':{'id':_0x1d649c['params']['id']}})[_0x4dfb('0x2a')](handleEntityNotFound(_0xf33622,null))[_0x4dfb('0x2a')](function(_0x107a7e){if(_0x107a7e){_0x1d649c[_0x4dfb('0x50')][_0x4dfb('0x7d')]=_0x107a7e['id'];_0x1d649c[_0x4dfb('0x50')]['attrs']=widgetAttributes(_0x1d649c['body']);return db[_0x4dfb('0x7e')]['create'](_0x1d649c[_0x4dfb('0x50')]);}})[_0x4dfb('0x2a')](respondWithResult(_0xf33622,null))['catch'](handleError(_0xf33622,null));};exports[_0x4dfb('0x7f')]=function(_0x1dca6e,_0x42a03e,_0x427b28){var _0x38a594={};var _0x38c7ef={};var _0x198cd4;var _0x8b3638;return db[_0x4dfb('0x32')][_0x4dfb('0x80')]({'where':{'id':_0x1dca6e[_0x4dfb('0x57')]['id']}})['then'](handleEntityNotFound(_0x42a03e,null))[_0x4dfb('0x2a')](function(_0x521c0a){if(_0x521c0a){_0x198cd4=_0x521c0a;_0x38c7ef[_0x4dfb('0x37')]=_[_0x4dfb('0x4c')](db[_0x4dfb('0x7e')][_0x4dfb('0x33')]);_0x38c7ef['query']=_[_0x4dfb('0x4c')](_0x1dca6e[_0x4dfb('0x3c')]);_0x38c7ef[_0x4dfb('0x4d')]=_[_0x4dfb('0x39')](_0x38c7ef[_0x4dfb('0x37')],_0x38c7ef[_0x4dfb('0x3c')]);_0x38a594['attributes']=_[_0x4dfb('0x39')](_0x38c7ef[_0x4dfb('0x37')],qs[_0x4dfb('0x3b')](_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x3b')]));_0x38a594[_0x4dfb('0x3a')]=_0x38a594[_0x4dfb('0x3a')][_0x4dfb('0x3d')]?_0x38a594['attributes']:_0x38c7ef[_0x4dfb('0x37')];_0x38a594[_0x4dfb('0x81')]=qs[_0x4dfb('0x40')](_0x1dca6e['query'][_0x4dfb('0x40')]);_0x38a594[_0x4dfb('0x43')]=qs['filters'](_[_0x4dfb('0x41')](_0x1dca6e['query'],_0x38c7ef[_0x4dfb('0x4d')]));if(_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x42')]){_0x38a594[_0x4dfb('0x43')]=_['merge'](_0x38a594[_0x4dfb('0x43')],{'$or':_[_0x4dfb('0x38')](_0x38a594[_0x4dfb('0x3a')],function(_0x1c1920){var _0x194d7f={};_0x194d7f[_0x1c1920]={'$like':'%'+_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x42')]+'%'};return _0x194d7f;})});}_0x38a594=_['merge']({},_0x38a594,_0x1dca6e[_0x4dfb('0x82')]);return _0x198cd4['getItems'](_0x38a594);}})['then'](function(_0x3bfa58){if(_0x3bfa58){_0x8b3638=_0x3bfa58[_0x4dfb('0x3d')];if(!_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x3e')](_0x4dfb('0x3f'))){_0x38a594['limit']=qs[_0x4dfb('0x23')](_0x1dca6e[_0x4dfb('0x3c')]['limit']);_0x38a594[_0x4dfb('0x21')]=qs[_0x4dfb('0x21')](_0x1dca6e[_0x4dfb('0x3c')]['offset']);}return _0x198cd4[_0x4dfb('0x7f')](_0x38a594);}})[_0x4dfb('0x2a')](function(_0xc6c898){if(_0xc6c898){return _0xc6c898?{'count':_0x8b3638,'rows':_0xc6c898}:null;}})[_0x4dfb('0x2a')](respondWithResult(_0x42a03e,null))[_0x4dfb('0x4a')](handleError(_0x42a03e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1b3539e..67a4b22 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde36=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2d69f3,_0x3e6500){var _0x22fa14=function(_0x4ead27){while(--_0x4ead27){_0x2d69f3['push'](_0x2d69f3['shift']());}};_0x22fa14(++_0x3e6500);}(_0xde36,0x1a5));var _0x6de3=function(_0x5889c4,_0x2cb921){_0x5889c4=_0x5889c4-0x0;var _0x18cbb8=_0xde36[_0x5889c4];return _0x18cbb8;};'use strict';var EventEmitter=require(_0x6de3('0x0'));var Dashboard=require(_0x6de3('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6de3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6de3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4de47d){return function(_0x3a8eb9,_0x15a010,_0x5731c9){DashboardEvents[_0x6de3('0x4')](_0x4de47d+':'+_0x3a8eb9['id'],_0x3a8eb9);DashboardEvents[_0x6de3('0x4')](_0x4de47d,_0x3a8eb9);_0x5731c9(null);};}for(var e in events){if(events[_0x6de3('0x5')](e)){var event=events[e];Dashboard[_0x6de3('0x6')](e,emitEvent(event));}}module[_0x6de3('0x7')]=DashboardEvents; \ No newline at end of file +var _0xf8af=['Dashboard','setMaxListeners','save','update','hasOwnProperty','exports','events'];(function(_0x470c21,_0x4575dc){var _0x4d80b5=function(_0x249e59){while(--_0x249e59){_0x470c21['push'](_0x470c21['shift']());}};_0x4d80b5(++_0x4575dc);}(_0xf8af,0x8b));var _0xff8a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf8af[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xff8a('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xff8a('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xff8a('0x2')](0x0);var events={'afterCreate':_0xff8a('0x3'),'afterUpdate':_0xff8a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b1bb0){return function(_0x460bf6,_0x11cfa2,_0x3bd9c2){DashboardEvents['emit'](_0x7b1bb0+':'+_0x460bf6['id'],_0x460bf6);DashboardEvents['emit'](_0x7b1bb0,_0x460bf6);_0x3bd9c2(null);};}for(var e in events){if(events[_0xff8a('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xff8a('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 92d33ee..1f09c38 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c7=['request-promise','rimraf','../../config/environment','Dashboard','dashboards','util','../../config/logger','api','moment','bluebird'];(function(_0x446ad0,_0x29f51e){var _0x4a3478=function(_0x2d15c8){while(--_0x2d15c8){_0x446ad0['push'](_0x446ad0['shift']());}};_0x4a3478(++_0x29f51e);}(_0xe6c7,0x159));var _0x7e6c=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xe6c7[_0x48b810];return _0x23c17d;};'use strict';var _=require('lodash');var util=require(_0x7e6c('0x0'));var logger=require(_0x7e6c('0x1'))(_0x7e6c('0x2'));var moment=require(_0x7e6c('0x3'));var BPromise=require(_0x7e6c('0x4'));var rp=require(_0x7e6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e6c('0x6'));var config=require(_0x7e6c('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x550d80,_0x268982){return _0x550d80['define'](_0x7e6c('0x8'),attributes,{'tableName':_0x7e6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe469=['bluebird','request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x2c0720,_0x1db601){var _0x19f1aa=function(_0x4c34f4){while(--_0x4c34f4){_0x2c0720['push'](_0x2c0720['shift']());}};_0x19f1aa(++_0x1db601);}(_0xe469,0x79));var _0x9e46=function(_0x9c22da,_0xd059c3){_0x9c22da=_0x9c22da-0x0;var _0x386c9a=_0xe469[_0x9c22da];return _0x386c9a;};'use strict';var _=require(_0x9e46('0x0'));var util=require(_0x9e46('0x1'));var logger=require(_0x9e46('0x2'))(_0x9e46('0x3'));var moment=require(_0x9e46('0x4'));var BPromise=require(_0x9e46('0x5'));var rp=require(_0x9e46('0x6'));var fs=require('fs');var path=require(_0x9e46('0x7'));var rimraf=require(_0x9e46('0x8'));var config=require('../../config/environment');var attributes=require(_0x9e46('0x9'));module[_0x9e46('0xa')]=function(_0x1acda9,_0xc9d837){return _0x1acda9[_0x9e46('0xb')](_0x9e46('0xc'),attributes,{'tableName':_0x9e46('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index ea427cb..25cc0e5 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f4f=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3ecfbd,_0x3ba03f){var _0x21d01c=function(_0xb48535){while(--_0xb48535){_0x3ecfbd['push'](_0x3ecfbd['shift']());}};_0x21d01c(++_0x3ba03f);}(_0x5f4f,0x125));var _0xf5f4=function(_0x3d5351,_0x27bc80){_0x3d5351=_0x3d5351-0x0;var _0x1db4db=_0x5f4f[_0x3d5351];return _0x1db4db;};'use strict';var _=require(_0xf5f4('0x0'));var util=require(_0xf5f4('0x1'));var moment=require(_0xf5f4('0x2'));var BPromise=require(_0xf5f4('0x3'));var rs=require(_0xf5f4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf5f4('0x5'));var logger=require(_0xf5f4('0x6'))(_0xf5f4('0x7'));var config=require(_0xf5f4('0x8'));var jayson=require(_0xf5f4('0x9'));var client=jayson[_0xf5f4('0xa')][_0xf5f4('0xb')]({'port':0x232a});config[_0xf5f4('0xc')]=_[_0xf5f4('0xd')](config[_0xf5f4('0xc')],{'host':_0xf5f4('0xe'),'port':0x18eb});var socket=require(_0xf5f4('0xf'))(new Redis(config['redis']));require(_0xf5f4('0x10'))['register'](socket);function respondWithRpcPromise(_0x22793a,_0x278f2f,_0x1bb62b){return new BPromise(function(_0x168153,_0x1e9ff6){return client[_0xf5f4('0x11')](_0x22793a,_0x1bb62b)[_0xf5f4('0x12')](function(_0x87dd66){logger[_0xf5f4('0x13')](_0xf5f4('0x14'),_0x278f2f,_0xf5f4('0x15'));logger[_0xf5f4('0x16')](_0xf5f4('0x17'),_0x278f2f,_0xf5f4('0x15'),JSON['stringify'](_0x87dd66));if(_0x87dd66['error']){if(_0x87dd66[_0xf5f4('0x18')][_0xf5f4('0x19')]===0x1f4){logger[_0xf5f4('0x18')](_0xf5f4('0x14'),_0x278f2f,_0x87dd66['error']['message']);return _0x1e9ff6(_0x87dd66['error'][_0xf5f4('0x1a')]);}logger[_0xf5f4('0x18')](_0xf5f4('0x14'),_0x278f2f,_0x87dd66[_0xf5f4('0x18')][_0xf5f4('0x1a')]);return _0x168153(_0x87dd66[_0xf5f4('0x18')][_0xf5f4('0x1a')]);}else{logger[_0xf5f4('0x13')]('Dashboard,\x20%s,\x20%s',_0x278f2f,_0xf5f4('0x15'));_0x168153(_0x87dd66[_0xf5f4('0x1b')][_0xf5f4('0x1a')]);}})[_0xf5f4('0x1c')](function(_0x1f28ca){logger[_0xf5f4('0x18')](_0xf5f4('0x14'),_0x278f2f,_0x1f28ca);_0x1e9ff6(_0x1f28ca);});});} \ No newline at end of file +var _0x00c9=['client','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x244bcb,_0x3feee2){var _0xdae57a=function(_0x27e0c7){while(--_0x27e0c7){_0x244bcb['push'](_0x244bcb['shift']());}};_0xdae57a(++_0x3feee2);}(_0x00c9,0x1ce));var _0x900c=function(_0x32d4ed,_0x328178){_0x32d4ed=_0x32d4ed-0x0;var _0x1c48e1=_0x00c9[_0x32d4ed];return _0x1c48e1;};'use strict';var _=require('lodash');var util=require(_0x900c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x900c('0x1'));var fs=require('fs');var Redis=require(_0x900c('0x2'));var db=require(_0x900c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x900c('0x4'));var config=require(_0x900c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x900c('0x6')]['http']({'port':0x232a});config['redis']=_[_0x900c('0x7')](config[_0x900c('0x8')],{'host':_0x900c('0x9'),'port':0x18eb});var socket=require(_0x900c('0xa'))(new Redis(config[_0x900c('0x8')]));require(_0x900c('0xb'))[_0x900c('0xc')](socket);function respondWithRpcPromise(_0x329b83,_0xcdca3,_0x40d978){return new BPromise(function(_0x3937ca,_0x583622){return client[_0x900c('0xd')](_0x329b83,_0x40d978)[_0x900c('0xe')](function(_0x505eff){logger[_0x900c('0xf')]('Dashboard,\x20%s,\x20%s',_0xcdca3,_0x900c('0x10'));logger[_0x900c('0x11')](_0x900c('0x12'),_0xcdca3,'request\x20sent',JSON[_0x900c('0x13')](_0x505eff));if(_0x505eff[_0x900c('0x14')]){if(_0x505eff[_0x900c('0x14')][_0x900c('0x15')]===0x1f4){logger['error'](_0x900c('0x16'),_0xcdca3,_0x505eff['error'][_0x900c('0x17')]);return _0x583622(_0x505eff['error'][_0x900c('0x17')]);}logger[_0x900c('0x14')](_0x900c('0x16'),_0xcdca3,_0x505eff[_0x900c('0x14')][_0x900c('0x17')]);return _0x3937ca(_0x505eff[_0x900c('0x14')]['message']);}else{logger[_0x900c('0xf')]('Dashboard,\x20%s,\x20%s',_0xcdca3,_0x900c('0x10'));_0x3937ca(_0x505eff[_0x900c('0x18')][_0x900c('0x17')]);}})[_0x900c('0x19')](function(_0x154d06){logger[_0x900c('0x14')]('Dashboard,\x20%s,\x20%s',_0xcdca3,_0x154d06);_0x583622(_0x154d06);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6d6e137..a1dd93b 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7fe=['save','remove','removeListener','register','length','dashboard:'];(function(_0x1d4c74,_0x3657c6){var _0x477a02=function(_0x4f8e43){while(--_0x4f8e43){_0x1d4c74['push'](_0x1d4c74['shift']());}};_0x477a02(++_0x3657c6);}(_0xc7fe,0x1b6));var _0xec7f=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xc7fe[_0x5c3ae9];return _0x3f5950;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xec7f('0x0'),_0xec7f('0x1'),'update'];function createListener(_0x4bc1fc,_0x59be54){return function(_0x34cfc4){_0x59be54['emit'](_0x4bc1fc,_0x34cfc4);};}function removeListener(_0xee7a99,_0xc5ecb4){return function(){DashboardEvents[_0xec7f('0x2')](_0xee7a99,_0xc5ecb4);};}exports[_0xec7f('0x3')]=function(_0x16e863){for(var _0x526743=0x0,_0x3ffa26=events[_0xec7f('0x4')];_0x526743<_0x3ffa26;_0x526743++){var _0x449735=events[_0x526743];var _0x3dc354=createListener(_0xec7f('0x5')+_0x449735,_0x16e863);DashboardEvents['on'](_0x449735,_0x3dc354);}}; \ No newline at end of file +var _0xa347=['dashboard:','update','removeListener','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa347,0x79));var _0x7a34=function(_0x3543e7,_0x501fcf){_0x3543e7=_0x3543e7-0x0;var _0x42df23=_0xa347[_0x3543e7];return _0x42df23;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0x7a34('0x0')];function createListener(_0x2c645c,_0x229822){return function(_0xc52d7c){_0x229822['emit'](_0x2c645c,_0xc52d7c);};}function removeListener(_0x40519e,_0x4aba74){return function(){DashboardEvents[_0x7a34('0x1')](_0x40519e,_0x4aba74);};}exports['register']=function(_0x311661){for(var _0x36e3f9=0x0,_0x215898=events[_0x7a34('0x2')];_0x36e3f9<_0x215898;_0x36e3f9++){var _0x153338=events[_0x36e3f9];var _0x2e0fe1=createListener(_0x7a34('0x3')+_0x153338,_0x311661);DashboardEvents['on'](_0x153338,_0x2e0fe1);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d9af2d4..733fdbb 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb51=['../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','get','/:id','/:id/items','getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x13e24e,_0x2aaae5){var _0x35ac3d=function(_0x3ab55d){while(--_0x3ab55d){_0x13e24e['push'](_0x13e24e['shift']());}};_0x35ac3d(++_0x2aaae5);}(_0xdb51,0x191));var _0x1db5=function(_0x3a25e8,_0x84dc5c){_0x3a25e8=_0x3a25e8-0x0;var _0x55b8f3=_0xdb51[_0x3a25e8];return _0x55b8f3;};'use strict';var multer=require(_0x1db5('0x0'));var util=require(_0x1db5('0x1'));var path=require(_0x1db5('0x2'));var timeout=require(_0x1db5('0x3'));var express=require(_0x1db5('0x4'));var router=express[_0x1db5('0x5')]();var fs_extra=require(_0x1db5('0x6'));var auth=require(_0x1db5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1db5('0x8'));var controller=require(_0x1db5('0x9'));router['get']('/',auth[_0x1db5('0xa')](),controller['index']);router[_0x1db5('0xb')](_0x1db5('0xc'),auth[_0x1db5('0xa')](),controller['show']);router[_0x1db5('0xb')](_0x1db5('0xd'),auth[_0x1db5('0xa')](),controller[_0x1db5('0xe')]);router[_0x1db5('0xf')]('/',auth[_0x1db5('0xa')](),controller[_0x1db5('0x10')]);router[_0x1db5('0xf')](_0x1db5('0x11'),auth[_0x1db5('0xa')](),controller['clone']);router['post']('/:id/items',auth[_0x1db5('0xa')](),controller[_0x1db5('0x12')]);router[_0x1db5('0x13')](_0x1db5('0xc'),auth['isAuthenticated'](),controller[_0x1db5('0x14')]);router[_0x1db5('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1db5('0x16')]);module[_0x1db5('0x17')]=router; \ No newline at end of file +var _0x9fe2=['isAuthenticated','index','/:id','/:id/items','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get'];(function(_0x3c5163,_0xac9816){var _0x2943c=function(_0x5daca7){while(--_0x5daca7){_0x3c5163['push'](_0x3c5163['shift']());}};_0x2943c(++_0xac9816);}(_0x9fe2,0x68));var _0x29fe=function(_0x43e628,_0x55c96a){_0x43e628=_0x43e628-0x0;var _0x3193da=_0x9fe2[_0x43e628];return _0x3193da;};'use strict';var multer=require(_0x29fe('0x0'));var util=require(_0x29fe('0x1'));var path=require(_0x29fe('0x2'));var timeout=require(_0x29fe('0x3'));var express=require(_0x29fe('0x4'));var router=express[_0x29fe('0x5')]();var fs_extra=require(_0x29fe('0x6'));var auth=require(_0x29fe('0x7'));var interaction=require(_0x29fe('0x8'));var config=require('../../config/environment');var controller=require(_0x29fe('0x9'));router[_0x29fe('0xa')]('/',auth[_0x29fe('0xb')](),controller[_0x29fe('0xc')]);router[_0x29fe('0xa')](_0x29fe('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x29fe('0xe'),auth[_0x29fe('0xb')](),controller['getItems']);router[_0x29fe('0xf')]('/',auth[_0x29fe('0xb')](),controller['create']);router['post'](_0x29fe('0x10'),auth['isAuthenticated'](),controller[_0x29fe('0x11')]);router[_0x29fe('0xf')](_0x29fe('0xe'),auth[_0x29fe('0xb')](),controller['addItem']);router[_0x29fe('0x12')](_0x29fe('0xd'),auth[_0x29fe('0xb')](),controller[_0x29fe('0x13')]);router[_0x29fe('0x14')](_0x29fe('0xd'),auth[_0x29fe('0xb')](),controller[_0x29fe('0x15')]);module[_0x29fe('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 2d652ca..25cdd71 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x1637ba,_0x29ad25){var _0x761eb6=function(_0x2caa3e){while(--_0x2caa3e){_0x1637ba['push'](_0x1637ba['shift']());}};_0x761eb6(++_0x29ad25);}(_0xeda8,0x104));var _0x8eda=function(_0x176f75,_0x4fdffb){_0x176f75=_0x176f75-0x0;var _0x2e9f75=_0xeda8[_0x176f75];return _0x2e9f75;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x2c039d,_0x2b43fe){var _0x40b446=function(_0x558253){while(--_0x558253){_0x2c039d['push'](_0x2c039d['shift']());}};_0x40b446(++_0x2b43fe);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2618eb,_0x235b1d){_0x2618eb=_0x2618eb-0x0;var _0x41a50b=_0xc6ac[_0x2618eb];return _0x41a50b;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index e76abf1..fb1ccfc 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb931=['then','destroy','sendStatus','error','stack','send','show','params','model','rawAttributes','keys','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','DashboardItem','find','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','widgetAttributes:\x20%s','stringify','create','body','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update'];(function(_0x355d56,_0x402690){var _0x110878=function(_0x2c5527){while(--_0x2c5527){_0x355d56['push'](_0x355d56['shift']());}};_0x110878(++_0x402690);}(_0xb931,0x155));var _0x1b93=function(_0x5cb2d5,_0x20e92a){_0x5cb2d5=_0x5cb2d5-0x0;var _0x2518cf=_0xb931[_0x5cb2d5];return _0x2518cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b93('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b93('0x1'));var BPromise=require(_0x1b93('0x2'));var Mustache=require(_0x1b93('0x3'));var util=require(_0x1b93('0x4'));var path=require(_0x1b93('0x5'));var sox=require(_0x1b93('0x6'));var csv=require(_0x1b93('0x7'));var ejs=require(_0x1b93('0x8'));var fs=require('fs');var fs_extra=require(_0x1b93('0x9'));var _=require(_0x1b93('0xa'));var squel=require(_0x1b93('0xb'));var crypto=require(_0x1b93('0xc'));var jsforce=require(_0x1b93('0xd'));var deskjs=require(_0x1b93('0xe'));var toCsv=require(_0x1b93('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b93('0xf'));var authService=require(_0x1b93('0x10'));var qs=require(_0x1b93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b93('0x12'));var logger=require('../../config/logger')(_0x1b93('0x13'));var utils=require(_0x1b93('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b93('0x15'))['db'];config[_0x1b93('0x16')]=_[_0x1b93('0x17')](config['redis'],{'host':_0x1b93('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b93('0x16')]));require(_0x1b93('0x19'))[_0x1b93('0x1a')](socket);function respondWithStatusCode(_0x1ea97a,_0xe5a8ab){_0xe5a8ab=_0xe5a8ab||0xcc;return function(_0x1512fd){if(_0x1512fd){return _0x1ea97a['sendStatus'](_0xe5a8ab);}return _0x1ea97a[_0x1b93('0x1b')](_0xe5a8ab)[_0x1b93('0x1c')]();};}function respondWithResult(_0x240b8f,_0x23d687){_0x23d687=_0x23d687||0xc8;return function(_0x4d4c47){if(_0x4d4c47){return _0x240b8f[_0x1b93('0x1b')](_0x23d687)[_0x1b93('0x1d')](_0x4d4c47);}};}function respondWithFilteredResult(_0x4f7199,_0x446cc2){return function(_0x339c5b){if(_0x339c5b){var _0x4ed0d5=typeof _0x446cc2['offset']===_0x1b93('0x1e')&&typeof _0x446cc2[_0x1b93('0x1f')]===_0x1b93('0x1e');var _0x4156d9=_0x339c5b[_0x1b93('0x20')];var _0x4c3a25=_0x4ed0d5?0x0:_0x446cc2[_0x1b93('0x21')];var _0x23428d=_0x4ed0d5?_0x339c5b['count']:_0x446cc2['offset']+_0x446cc2[_0x1b93('0x1f')];var _0x116775;if(_0x23428d>=_0x4156d9){_0x23428d=_0x4156d9;_0x116775=0xc8;}else{_0x116775=0xce;}_0x4f7199[_0x1b93('0x1b')](_0x116775);return _0x4f7199[_0x1b93('0x22')](_0x1b93('0x23'),_0x4c3a25+'-'+_0x23428d+'/'+_0x4156d9)[_0x1b93('0x1d')](_0x339c5b);}return null;};}function patchUpdates(_0x577a22){return function(_0x43e492){try{jsonpatch[_0x1b93('0x24')](_0x43e492,_0x577a22,!![]);}catch(_0x208217){return BPromise['reject'](_0x208217);}return _0x43e492[_0x1b93('0x25')]();};}function saveUpdates(_0x41f219,_0xa6ea){return function(_0x20ce59){if(_0x20ce59){return _0x20ce59[_0x1b93('0x26')](_0x41f219)[_0x1b93('0x27')](function(_0x13cddc){return _0x13cddc;});}return null;};}function removeEntity(_0x309ac5,_0x14626a){return function(_0x24f04e){if(_0x24f04e){return _0x24f04e[_0x1b93('0x28')]()[_0x1b93('0x27')](function(){_0x309ac5[_0x1b93('0x1b')](0xcc)[_0x1b93('0x1c')]();});}};}function handleEntityNotFound(_0x2f92a0,_0x5ce57b){return function(_0x56e2d3){if(!_0x56e2d3){_0x2f92a0[_0x1b93('0x29')](0x194);}return _0x56e2d3;};}function handleError(_0x195c77,_0x28c014){_0x28c014=_0x28c014||0x1f4;return function(_0x2501ee){logger[_0x1b93('0x2a')](_0x2501ee[_0x1b93('0x2b')]);if(_0x2501ee['name']){delete _0x2501ee['name'];}_0x195c77[_0x1b93('0x1b')](_0x28c014)[_0x1b93('0x2c')](_0x2501ee);};}exports[_0x1b93('0x2d')]=function(_0x4d504c,_0x3dc539){var _0x49873d={'raw':![],'where':{'id':_0x4d504c[_0x1b93('0x2e')]['id']}},_0x758971={};_0x758971[_0x1b93('0x2f')]=_['keys'](db['DashboardItem'][_0x1b93('0x30')]);_0x758971['query']=_[_0x1b93('0x31')](_0x4d504c[_0x1b93('0x32')]);_0x758971[_0x1b93('0x33')]=_['intersection'](_0x758971[_0x1b93('0x2f')],_0x758971[_0x1b93('0x32')]);_0x49873d[_0x1b93('0x34')]=_[_0x1b93('0x35')](_0x758971[_0x1b93('0x2f')],qs[_0x1b93('0x36')](_0x4d504c[_0x1b93('0x32')][_0x1b93('0x36')]));_0x49873d[_0x1b93('0x34')]=_0x49873d[_0x1b93('0x34')][_0x1b93('0x37')]?_0x49873d['attributes']:_0x758971['model'];if(_0x4d504c[_0x1b93('0x32')][_0x1b93('0x38')]){_0x49873d[_0x1b93('0x39')]=[{'all':!![]}];}_0x49873d=_[_0x1b93('0x3a')]({},_0x49873d,_0x4d504c[_0x1b93('0x3b')]);return db[_0x1b93('0x3c')][_0x1b93('0x3d')](_0x49873d)['then'](handleEntityNotFound(_0x3dc539,null))['then'](respondWithResult(_0x3dc539,null))['catch'](handleError(_0x3dc539,null));};exports[_0x1b93('0x28')]=function(_0x457674,_0x55d921){return db['DashboardItem'][_0x1b93('0x3d')]({'where':{'id':_0x457674[_0x1b93('0x2e')]['id']}})['then'](handleEntityNotFound(_0x55d921,null))[_0x1b93('0x27')](removeEntity(_0x55d921,null))['catch'](handleError(_0x55d921,null));};function widgetAttributes(_0x413013){try{switch(_0x413013[_0x1b93('0x3e')]){case _0x1b93('0x3f'):return[{'name':_0x1b93('0x40'),'value':_0x413013[_0x1b93('0x40')]||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x0]?_0x413013[_0x1b93('0x41')][0x0]['value']:undefined)||_0x1b93('0x42')}];case'custom':return[{'name':_0x1b93('0x43'),'value':_0x413013[_0x1b93('0x43')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x0]?_0x413013[_0x1b93('0x41')][0x0][_0x1b93('0x44')]:undefined)||''}];case _0x1b93('0x45'):return[{'name':_0x1b93('0x46'),'value':_0x413013[_0x1b93('0x46')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x0]?_0x413013[_0x1b93('0x41')][0x0][_0x1b93('0x44')]:undefined)||_0x1b93('0x47')},{'name':'attrTimezone','value':_0x413013[_0x1b93('0x48')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x1]?_0x413013['attrs'][0x1][_0x1b93('0x44')]:undefined)||_0x1b93('0x49')},{'name':_0x1b93('0x4a'),'value':_0x413013[_0x1b93('0x4a')]||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x2]?_0x413013['attrs'][0x2]['value']:undefined)||0xc}];case _0x1b93('0x4b'):return[{'name':'attrMetric','value':_0x413013['attrMetric']||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x0]?_0x413013[_0x1b93('0x41')][0x0][_0x1b93('0x44')]:undefined)||_0x1b93('0x4c')},{'name':_0x1b93('0x4d'),'value':_0x413013[_0x1b93('0x4d')]||(_0x413013['attrs']&&_0x413013['attrs'][0x1]?_0x413013[_0x1b93('0x41')][0x1][_0x1b93('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0x413013[_0x1b93('0x4a')]||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x2]?_0x413013[_0x1b93('0x41')][0x2]['value']:undefined)||0x14},{'name':_0x1b93('0x4e'),'value':_0x413013[_0x1b93('0x4e')]||(_0x413013['attrs']&&_0x413013[_0x1b93('0x41')][0x3]?_0x413013[_0x1b93('0x41')][0x3][_0x1b93('0x44')]:undefined)||_0x1b93('0x4f')},{'name':'attrEmailAccounts','value':_0x413013[_0x1b93('0x50')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x4]?_0x413013[_0x1b93('0x41')][0x4]['value']:undefined)||''},{'name':_0x1b93('0x51'),'value':_0x413013[_0x1b93('0x51')]||(_0x413013['attrs']&&_0x413013[_0x1b93('0x41')][0x5]?_0x413013['attrs'][0x5][_0x1b93('0x44')]:undefined)||''},{'name':_0x1b93('0x52'),'value':_0x413013[_0x1b93('0x52')]||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x6]?_0x413013[_0x1b93('0x41')][0x6][_0x1b93('0x44')]:undefined)||''},{'name':_0x1b93('0x53'),'value':_0x413013[_0x1b93('0x53')]||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x7]?_0x413013[_0x1b93('0x41')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x413013[_0x1b93('0x54')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x8]?_0x413013[_0x1b93('0x41')][0x8][_0x1b93('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x413013[_0x1b93('0x55')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x9]?_0x413013[_0x1b93('0x41')][0x9][_0x1b93('0x44')]:undefined)||''}];case'multibar-chart':case _0x1b93('0x56'):return[{'name':'attrSerie1','value':_0x413013[_0x1b93('0x57')]||(_0x413013['attrs']&&_0x413013['attrs'][0x0]?_0x413013[_0x1b93('0x41')][0x0]['value']:undefined)||_0x1b93('0x4c')},{'name':'attrSerie2','value':_0x413013['attrSerie2']||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x1]?_0x413013['attrs'][0x1][_0x1b93('0x44')]:undefined)||null},{'name':_0x1b93('0x58'),'value':_0x413013[_0x1b93('0x58')]||(_0x413013['attrs']&&_0x413013[_0x1b93('0x41')][0x2]?_0x413013[_0x1b93('0x41')][0x2]['value']:undefined)||null},{'name':_0x1b93('0x4d'),'value':_0x413013[_0x1b93('0x4d')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x3]?_0x413013['attrs'][0x3][_0x1b93('0x44')]:undefined)||[]},{'name':_0x1b93('0x4e'),'value':_0x413013[_0x1b93('0x4e')]||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x4]?_0x413013[_0x1b93('0x41')][0x4]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x413013[_0x1b93('0x50')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x5]?_0x413013[_0x1b93('0x41')][0x5][_0x1b93('0x44')]:undefined)||''},{'name':_0x1b93('0x51'),'value':_0x413013[_0x1b93('0x51')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x6]?_0x413013['attrs'][0x6][_0x1b93('0x44')]:undefined)||''},{'name':_0x1b93('0x52'),'value':_0x413013['attrSmsAccounts']||(_0x413013['attrs']&&_0x413013[_0x1b93('0x41')][0x7]?_0x413013[_0x1b93('0x41')][0x7][_0x1b93('0x44')]:undefined)||''},{'name':_0x1b93('0x53'),'value':_0x413013[_0x1b93('0x53')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x8]?_0x413013[_0x1b93('0x41')][0x8]['value']:undefined)||''},{'name':_0x1b93('0x54'),'value':_0x413013[_0x1b93('0x54')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x9]?_0x413013[_0x1b93('0x41')][0x9][_0x1b93('0x44')]:undefined)||''},{'name':_0x1b93('0x55'),'value':_0x413013[_0x1b93('0x55')]||(_0x413013['attrs']&&_0x413013[_0x1b93('0x41')][0xa]?_0x413013[_0x1b93('0x41')][0xa][_0x1b93('0x44')]:undefined)||''}];case _0x1b93('0x59'):return[{'name':_0x1b93('0x5a'),'type':_0x413013['reportType']||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x0]?_0x413013['attrs'][0x0][_0x1b93('0x3e')]:undefined)||null,'value':_0x413013[_0x1b93('0x5a')]||(_0x413013[_0x1b93('0x41')]&&_0x413013[_0x1b93('0x41')][0x0]?_0x413013['attrs'][0x0][_0x1b93('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x413013['attrRefresh']||(_0x413013[_0x1b93('0x41')]&&_0x413013['attrs'][0x1]?_0x413013[_0x1b93('0x41')][0x1][_0x1b93('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x37e5e6){logger[_0x1b93('0x2a')](_0x1b93('0x5b'),JSON[_0x1b93('0x5c')](_0x37e5e6));return[];}}exports[_0x1b93('0x5d')]=function(_0x12e5d5,_0x58d3f0){if(_0x12e5d5[_0x1b93('0x5e')]){_0x12e5d5[_0x1b93('0x5e')][_0x1b93('0x41')]=widgetAttributes(_0x12e5d5[_0x1b93('0x5e')]);}return db[_0x1b93('0x3c')][_0x1b93('0x5d')](_0x12e5d5[_0x1b93('0x5e')],{})[_0x1b93('0x27')](respondWithResult(_0x58d3f0,0xc9))['catch'](handleError(_0x58d3f0,null));};exports[_0x1b93('0x26')]=function(_0x40aa45,_0x550568){if(_0x40aa45[_0x1b93('0x5e')]['id']){delete _0x40aa45[_0x1b93('0x5e')]['id'];}_0x40aa45['body']['attrs']=widgetAttributes(_0x40aa45['body']);return db[_0x1b93('0x3c')][_0x1b93('0x3d')]({'where':{'id':_0x40aa45['params']['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x550568,null))[_0x1b93('0x27')](saveUpdates(_0x40aa45[_0x1b93('0x5e')],null))[_0x1b93('0x27')](respondWithResult(_0x550568,null))['catch'](handleError(_0x550568,null));}; \ No newline at end of file +var _0x82f8=['update','then','destroy','end','stack','name','send','show','params','model','keys','rawAttributes','intersection','attributes','fields','query','includeAll','options','DashboardItem','catch','find','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','stringify','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save'];(function(_0x4defce,_0x17354f){var _0x21a214=function(_0x48936c){while(--_0x48936c){_0x4defce['push'](_0x4defce['shift']());}};_0x21a214(++_0x17354f);}(_0x82f8,0x157));var _0x882f=function(_0x12a5cb,_0xa34c3f){_0x12a5cb=_0x12a5cb-0x0;var _0x2246e6=_0x82f8[_0x12a5cb];return _0x2246e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x882f('0x0'));var zipdir=require(_0x882f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x882f('0x2'));var moment=require(_0x882f('0x3'));var BPromise=require(_0x882f('0x4'));var Mustache=require(_0x882f('0x5'));var util=require(_0x882f('0x6'));var path=require(_0x882f('0x7'));var sox=require(_0x882f('0x8'));var csv=require(_0x882f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x882f('0xa'));var squel=require(_0x882f('0xb'));var crypto=require(_0x882f('0xc'));var jsforce=require(_0x882f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x882f('0x9'));var querystring=require('querystring');var Papa=require(_0x882f('0xe'));var Redis=require('ioredis');var authService=require(_0x882f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x882f('0x10'));var logger=require(_0x882f('0x11'))(_0x882f('0x12'));var utils=require(_0x882f('0x13'));var config=require(_0x882f('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x882f('0x15')]=_[_0x882f('0x16')](config[_0x882f('0x15')],{'host':_0x882f('0x17'),'port':0x18eb});var socket=require(_0x882f('0x18'))(new Redis(config[_0x882f('0x15')]));require(_0x882f('0x19'))['register'](socket);function respondWithStatusCode(_0x33740b,_0x422e91){_0x422e91=_0x422e91||0xcc;return function(_0x21381d){if(_0x21381d){return _0x33740b[_0x882f('0x1a')](_0x422e91);}return _0x33740b['status'](_0x422e91)['end']();};}function respondWithResult(_0x4e9b6e,_0x264da8){_0x264da8=_0x264da8||0xc8;return function(_0x187ce1){if(_0x187ce1){return _0x4e9b6e[_0x882f('0x1b')](_0x264da8)[_0x882f('0x1c')](_0x187ce1);}};}function respondWithFilteredResult(_0x3f72c2,_0x1420bf){return function(_0x3bd47c){if(_0x3bd47c){var _0x67cc4b=typeof _0x1420bf['offset']===_0x882f('0x1d')&&typeof _0x1420bf['limit']==='undefined';var _0xaa6bcb=_0x3bd47c[_0x882f('0x1e')];var _0x4242ed=_0x67cc4b?0x0:_0x1420bf[_0x882f('0x1f')];var _0x54957a=_0x67cc4b?_0x3bd47c[_0x882f('0x1e')]:_0x1420bf[_0x882f('0x1f')]+_0x1420bf[_0x882f('0x20')];var _0x421aaf;if(_0x54957a>=_0xaa6bcb){_0x54957a=_0xaa6bcb;_0x421aaf=0xc8;}else{_0x421aaf=0xce;}_0x3f72c2[_0x882f('0x1b')](_0x421aaf);return _0x3f72c2[_0x882f('0x21')](_0x882f('0x22'),_0x4242ed+'-'+_0x54957a+'/'+_0xaa6bcb)[_0x882f('0x1c')](_0x3bd47c);}return null;};}function patchUpdates(_0x251ed0){return function(_0x4b72ca){try{jsonpatch['apply'](_0x4b72ca,_0x251ed0,!![]);}catch(_0x4c0a93){return BPromise[_0x882f('0x23')](_0x4c0a93);}return _0x4b72ca[_0x882f('0x24')]();};}function saveUpdates(_0x11298b,_0x9ce278){return function(_0x1eea66){if(_0x1eea66){return _0x1eea66[_0x882f('0x25')](_0x11298b)[_0x882f('0x26')](function(_0x2d6f58){return _0x2d6f58;});}return null;};}function removeEntity(_0x1bfc1d,_0x4f24f1){return function(_0x42a827){if(_0x42a827){return _0x42a827[_0x882f('0x27')]()['then'](function(){_0x1bfc1d['status'](0xcc)[_0x882f('0x28')]();});}};}function handleEntityNotFound(_0x46b9e8,_0xd284e0){return function(_0x4cf987){if(!_0x4cf987){_0x46b9e8[_0x882f('0x1a')](0x194);}return _0x4cf987;};}function handleError(_0x2a84a4,_0x101711){_0x101711=_0x101711||0x1f4;return function(_0x29fc23){logger['error'](_0x29fc23[_0x882f('0x29')]);if(_0x29fc23[_0x882f('0x2a')]){delete _0x29fc23[_0x882f('0x2a')];}_0x2a84a4[_0x882f('0x1b')](_0x101711)[_0x882f('0x2b')](_0x29fc23);};}exports[_0x882f('0x2c')]=function(_0x340e9b,_0x862f1b){var _0x299f62={'raw':![],'where':{'id':_0x340e9b[_0x882f('0x2d')]['id']}},_0x46cb78={};_0x46cb78[_0x882f('0x2e')]=_[_0x882f('0x2f')](db['DashboardItem'][_0x882f('0x30')]);_0x46cb78['query']=_[_0x882f('0x2f')](_0x340e9b['query']);_0x46cb78['filters']=_[_0x882f('0x31')](_0x46cb78[_0x882f('0x2e')],_0x46cb78['query']);_0x299f62[_0x882f('0x32')]=_[_0x882f('0x31')](_0x46cb78[_0x882f('0x2e')],qs[_0x882f('0x33')](_0x340e9b[_0x882f('0x34')][_0x882f('0x33')]));_0x299f62['attributes']=_0x299f62['attributes']['length']?_0x299f62[_0x882f('0x32')]:_0x46cb78['model'];if(_0x340e9b[_0x882f('0x34')][_0x882f('0x35')]){_0x299f62['include']=[{'all':!![]}];}_0x299f62=_['merge']({},_0x299f62,_0x340e9b[_0x882f('0x36')]);return db[_0x882f('0x37')]['find'](_0x299f62)[_0x882f('0x26')](handleEntityNotFound(_0x862f1b,null))[_0x882f('0x26')](respondWithResult(_0x862f1b,null))[_0x882f('0x38')](handleError(_0x862f1b,null));};exports[_0x882f('0x27')]=function(_0xafbe46,_0x4d343d){return db[_0x882f('0x37')][_0x882f('0x39')]({'where':{'id':_0xafbe46[_0x882f('0x2d')]['id']}})[_0x882f('0x26')](handleEntityNotFound(_0x4d343d,null))[_0x882f('0x26')](removeEntity(_0x4d343d,null))[_0x882f('0x38')](handleError(_0x4d343d,null));};function widgetAttributes(_0x1a6210){try{switch(_0x1a6210[_0x882f('0x3a')]){case'iframe':return[{'name':_0x882f('0x3b'),'value':_0x1a6210[_0x882f('0x3b')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||_0x882f('0x3e')}];case _0x882f('0x3f'):return[{'name':'attrPath','value':_0x1a6210[_0x882f('0x40')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||''}];case _0x882f('0x41'):return[{'name':'attrHourFormat','value':_0x1a6210[_0x882f('0x42')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210['attrs'][0x0]['value']:undefined)||_0x882f('0x43')},{'name':_0x882f('0x44'),'value':_0x1a6210[_0x882f('0x44')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x1]?_0x1a6210[_0x882f('0x3c')][0x1][_0x882f('0x3d')]:undefined)||_0x882f('0x45')},{'name':_0x882f('0x46'),'value':_0x1a6210[_0x882f('0x46')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x2]?_0x1a6210[_0x882f('0x3c')][0x2][_0x882f('0x3d')]:undefined)||0xc}];case _0x882f('0x47'):return[{'name':_0x882f('0x48'),'value':_0x1a6210[_0x882f('0x48')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1a6210['attrVoiceQueues']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x1]?_0x1a6210['attrs'][0x1][_0x882f('0x3d')]:undefined)||[]},{'name':_0x882f('0x46'),'value':_0x1a6210[_0x882f('0x46')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x2]?_0x1a6210[_0x882f('0x3c')][0x2][_0x882f('0x3d')]:undefined)||0x14},{'name':_0x882f('0x49'),'value':_0x1a6210['attrChannel']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x3]?_0x1a6210[_0x882f('0x3c')][0x3][_0x882f('0x3d')]:undefined)||_0x882f('0x4a')},{'name':'attrEmailAccounts','value':_0x1a6210[_0x882f('0x4b')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x4]?_0x1a6210[_0x882f('0x3c')][0x4][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4c'),'value':_0x1a6210['attrFaxAccounts']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x5]?_0x1a6210[_0x882f('0x3c')][0x5][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4d'),'value':_0x1a6210[_0x882f('0x4d')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x6]?_0x1a6210[_0x882f('0x3c')][0x6][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4e'),'value':_0x1a6210['attrOpenchannelAccounts']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x7]?_0x1a6210[_0x882f('0x3c')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1a6210[_0x882f('0x4f')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x8]?_0x1a6210[_0x882f('0x3c')][0x8][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x50'),'value':_0x1a6210[_0x882f('0x50')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x9]?_0x1a6210['attrs'][0x9][_0x882f('0x3d')]:undefined)||''}];case _0x882f('0x51'):case _0x882f('0x52'):return[{'name':_0x882f('0x53'),'value':_0x1a6210[_0x882f('0x53')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||_0x882f('0x54')},{'name':_0x882f('0x55'),'value':_0x1a6210[_0x882f('0x55')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x1]?_0x1a6210[_0x882f('0x3c')][0x1][_0x882f('0x3d')]:undefined)||null},{'name':_0x882f('0x56'),'value':_0x1a6210[_0x882f('0x56')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x2]?_0x1a6210[_0x882f('0x3c')][0x2][_0x882f('0x3d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1a6210[_0x882f('0x57')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x3]?_0x1a6210[_0x882f('0x3c')][0x3][_0x882f('0x3d')]:undefined)||[]},{'name':_0x882f('0x49'),'value':_0x1a6210[_0x882f('0x49')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x4]?_0x1a6210[_0x882f('0x3c')][0x4][_0x882f('0x3d')]:undefined)||_0x882f('0x4a')},{'name':_0x882f('0x4b'),'value':_0x1a6210[_0x882f('0x4b')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x5]?_0x1a6210[_0x882f('0x3c')][0x5][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4c'),'value':_0x1a6210[_0x882f('0x4c')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x6]?_0x1a6210[_0x882f('0x3c')][0x6]['value']:undefined)||''},{'name':_0x882f('0x4d'),'value':_0x1a6210[_0x882f('0x4d')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x7]?_0x1a6210['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1a6210['attrOpenchannelAccounts']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x8]?_0x1a6210[_0x882f('0x3c')][0x8][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4f'),'value':_0x1a6210['attrWhatsappAccounts']||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x9]?_0x1a6210[_0x882f('0x3c')][0x9][_0x882f('0x3d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a6210[_0x882f('0x50')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0xa]?_0x1a6210[_0x882f('0x3c')][0xa][_0x882f('0x3d')]:undefined)||''}];case _0x882f('0x58'):return[{'name':_0x882f('0x59'),'type':_0x1a6210[_0x882f('0x5a')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3a')]:undefined)||null,'value':_0x1a6210['attrReport']||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||null},{'name':_0x882f('0x5b'),'value':_0x1a6210[_0x882f('0x5b')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x1]?_0x1a6210[_0x882f('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3557f3){logger['error']('widgetAttributes:\x20%s',JSON[_0x882f('0x5c')](_0x3557f3));return[];}}exports[_0x882f('0x5d')]=function(_0x5b185c,_0x2d0784){if(_0x5b185c['body']){_0x5b185c['body'][_0x882f('0x3c')]=widgetAttributes(_0x5b185c[_0x882f('0x5e')]);}return db[_0x882f('0x37')][_0x882f('0x5d')](_0x5b185c['body'],{})[_0x882f('0x26')](respondWithResult(_0x2d0784,0xc9))[_0x882f('0x38')](handleError(_0x2d0784,null));};exports[_0x882f('0x25')]=function(_0x222f5d,_0x262c62){if(_0x222f5d[_0x882f('0x5e')]['id']){delete _0x222f5d['body']['id'];}_0x222f5d['body'][_0x882f('0x3c')]=widgetAttributes(_0x222f5d['body']);return db[_0x882f('0x37')]['find']({'where':{'id':_0x222f5d['params']['id']}})['then'](handleEntityNotFound(_0x262c62,null))[_0x882f('0x26')](saveUpdates(_0x222f5d[_0x882f('0x5e')],null))['then'](respondWithResult(_0x262c62,null))[_0x882f('0x38')](handleError(_0x262c62,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f57430c..87a96bb 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed1c=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x15d215,_0x1ce028){var _0x16c5f6=function(_0x17716a){while(--_0x17716a){_0x15d215['push'](_0x15d215['shift']());}};_0x16c5f6(++_0x1ce028);}(_0xed1c,0x1bd));var _0xced1=function(_0x4d9f8f,_0x406149){_0x4d9f8f=_0x4d9f8f-0x0;var _0x5ad538=_0xed1c[_0x4d9f8f];return _0x5ad538;};'use strict';var EventEmitter=require(_0xced1('0x0'));var DashboardItem=require(_0xced1('0x1'))['db'][_0xced1('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xced1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xced1('0x4')};function emitEvent(_0x52d2e0){return function(_0x214c9e,_0x4c43bb,_0x334199){DashboardItemEvents[_0xced1('0x5')](_0x52d2e0+':'+_0x214c9e['id'],_0x214c9e);DashboardItemEvents[_0xced1('0x5')](_0x52d2e0,_0x214c9e);_0x334199(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xced1('0x6')](e,emitEvent(event));}}module[_0xced1('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xde25=['DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x41d2c6,_0x3cf817){var _0x87d147=function(_0x4a66e7){while(--_0x4a66e7){_0x41d2c6['push'](_0x41d2c6['shift']());}};_0x87d147(++_0x3cf817);}(_0xde25,0x104));var _0x5de2=function(_0x1b1411,_0xebef84){_0x1b1411=_0x1b1411-0x0;var _0x196b28=_0xde25[_0x1b1411];return _0x196b28;};'use strict';var EventEmitter=require(_0x5de2('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x5de2('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5de2('0x2')](0x0);var events={'afterCreate':_0x5de2('0x3'),'afterUpdate':_0x5de2('0x4'),'afterDestroy':_0x5de2('0x5')};function emitEvent(_0x58d416){return function(_0x81a80f,_0x2a6a90,_0xd98d97){DashboardItemEvents['emit'](_0x58d416+':'+_0x81a80f['id'],_0x81a80f);DashboardItemEvents[_0x5de2('0x6')](_0x58d416,_0x81a80f);_0xd98d97(null);};}for(var e in events){if(events[_0x5de2('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x5de2('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 9b22aa5..b725bf5 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1395=['api','moment','bluebird','request-promise','path','../../config/environment','define','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x695d9d,_0x15397c){var _0x27ddb3=function(_0x4b6536){while(--_0x4b6536){_0x695d9d['push'](_0x695d9d['shift']());}};_0x27ddb3(++_0x15397c);}(_0x1395,0x105));var _0x5139=function(_0x2a2ff4,_0x42ea25){_0x2a2ff4=_0x2a2ff4-0x0;var _0x9873c4=_0x1395[_0x2a2ff4];return _0x9873c4;};'use strict';var _=require(_0x5139('0x0'));var util=require(_0x5139('0x1'));var logger=require(_0x5139('0x2'))(_0x5139('0x3'));var moment=require(_0x5139('0x4'));var BPromise=require(_0x5139('0x5'));var rp=require(_0x5139('0x6'));var fs=require('fs');var path=require(_0x5139('0x7'));var rimraf=require('rimraf');var config=require(_0x5139('0x8'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x2ef957,_0x52051f){return _0x2ef957[_0x5139('0x9')](_0x5139('0xa'),attributes,{'tableName':_0x5139('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b44=['../../config/environment','./dashboardItem.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4215e4,_0x3fb09f){var _0x4a4574=function(_0x2906c0){while(--_0x2906c0){_0x4215e4['push'](_0x4215e4['shift']());}};_0x4a4574(++_0x3fb09f);}(_0x2b44,0x122));var _0x42b4=function(_0x54000a,_0x210194){_0x54000a=_0x54000a-0x0;var _0x4e7381=_0x2b44[_0x54000a];return _0x4e7381;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var logger=require(_0x42b4('0x2'))(_0x42b4('0x3'));var moment=require(_0x42b4('0x4'));var BPromise=require(_0x42b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var attributes=require(_0x42b4('0x8'));module[_0x42b4('0x9')]=function(_0x4cc6c5,_0xe54897){return _0x4cc6c5[_0x42b4('0xa')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 24d366b..ea09ea0 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d4d=['DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x2d4d,0x1f2));var _0xd2d4=function(_0x4b0010,_0x5660a3){_0x4b0010=_0x4b0010-0x0;var _0x3beadc=_0x2d4d[_0x4b0010];return _0x3beadc;};'use strict';var _=require(_0xd2d4('0x0'));var util=require(_0xd2d4('0x1'));var moment=require('moment');var BPromise=require(_0xd2d4('0x2'));var rs=require(_0xd2d4('0x3'));var fs=require('fs');var Redis=require(_0xd2d4('0x4'));var db=require(_0xd2d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2d4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd2d4('0x7'));var client=jayson[_0xd2d4('0x8')][_0xd2d4('0x9')]({'port':0x232a});config[_0xd2d4('0xa')]=_[_0xd2d4('0xb')](config['redis'],{'host':_0xd2d4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd2d4('0xa')]));require(_0xd2d4('0xd'))[_0xd2d4('0xe')](socket);function respondWithRpcPromise(_0xe269b0,_0x528961,_0x531d18){return new BPromise(function(_0x3895a2,_0x2145f8){return client[_0xd2d4('0xf')](_0xe269b0,_0x531d18)['then'](function(_0x34c592){logger[_0xd2d4('0x10')]('DashboardItem,\x20%s,\x20%s',_0x528961,_0xd2d4('0x11'));logger[_0xd2d4('0x12')](_0xd2d4('0x13'),_0x528961,_0xd2d4('0x11'),JSON[_0xd2d4('0x14')](_0x34c592));if(_0x34c592[_0xd2d4('0x15')]){if(_0x34c592[_0xd2d4('0x15')]['code']===0x1f4){logger[_0xd2d4('0x15')](_0xd2d4('0x16'),_0x528961,_0x34c592[_0xd2d4('0x15')][_0xd2d4('0x17')]);return _0x2145f8(_0x34c592[_0xd2d4('0x15')][_0xd2d4('0x17')]);}logger[_0xd2d4('0x15')](_0xd2d4('0x16'),_0x528961,_0x34c592[_0xd2d4('0x15')]['message']);return _0x3895a2(_0x34c592[_0xd2d4('0x15')][_0xd2d4('0x17')]);}else{logger[_0xd2d4('0x10')](_0xd2d4('0x16'),_0x528961,_0xd2d4('0x11'));_0x3895a2(_0x34c592[_0xd2d4('0x18')]['message']);}})[_0xd2d4('0x19')](function(_0x427026){logger['error'](_0xd2d4('0x16'),_0x528961,_0x427026);_0x2145f8(_0x427026);});});} \ No newline at end of file +var _0x80e6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x912d43,_0x181d0c){var _0x323b7e=function(_0x8b62d7){while(--_0x8b62d7){_0x912d43['push'](_0x912d43['shift']());}};_0x323b7e(++_0x181d0c);}(_0x80e6,0x187));var _0x680e=function(_0x207905,_0x28aa09){_0x207905=_0x207905-0x0;var _0x5b791f=_0x80e6[_0x207905];return _0x5b791f;};'use strict';var _=require(_0x680e('0x0'));var util=require('util');var moment=require(_0x680e('0x1'));var BPromise=require(_0x680e('0x2'));var rs=require(_0x680e('0x3'));var fs=require('fs');var Redis=require(_0x680e('0x4'));var db=require(_0x680e('0x5'))['db'];var utils=require(_0x680e('0x6'));var logger=require(_0x680e('0x7'))(_0x680e('0x8'));var config=require(_0x680e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x680e('0xa')][_0x680e('0xb')]({'port':0x232a});config['redis']=_[_0x680e('0xc')](config[_0x680e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x680e('0xd')]));require('./dashboardItem.socket')[_0x680e('0xe')](socket);function respondWithRpcPromise(_0x9db8f4,_0x2ccb63,_0x2b4135){return new BPromise(function(_0x5b2822,_0xd4dae9){return client[_0x680e('0xf')](_0x9db8f4,_0x2b4135)[_0x680e('0x10')](function(_0x3eb771){logger[_0x680e('0x11')](_0x680e('0x12'),_0x2ccb63,_0x680e('0x13'));logger[_0x680e('0x14')](_0x680e('0x15'),_0x2ccb63,_0x680e('0x13'),JSON[_0x680e('0x16')](_0x3eb771));if(_0x3eb771[_0x680e('0x17')]){if(_0x3eb771['error'][_0x680e('0x18')]===0x1f4){logger['error'](_0x680e('0x12'),_0x2ccb63,_0x3eb771[_0x680e('0x17')][_0x680e('0x19')]);return _0xd4dae9(_0x3eb771[_0x680e('0x17')]['message']);}logger['error'](_0x680e('0x12'),_0x2ccb63,_0x3eb771['error'][_0x680e('0x19')]);return _0x5b2822(_0x3eb771[_0x680e('0x17')][_0x680e('0x19')]);}else{logger['info'](_0x680e('0x12'),_0x2ccb63,_0x680e('0x13'));_0x5b2822(_0x3eb771[_0x680e('0x1a')]['message']);}})[_0x680e('0x1b')](function(_0x50dd5e){logger['error'](_0x680e('0x12'),_0x2ccb63,_0x50dd5e);_0xd4dae9(_0x50dd5e);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1d8f8fc..59c9060 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6fb=['save','remove','emit','removeListener','register','length','./dashboardItem.events'];(function(_0x3f7ebc,_0x291344){var _0x319c10=function(_0x1227ad){while(--_0x1227ad){_0x3f7ebc['push'](_0x3f7ebc['shift']());}};_0x319c10(++_0x291344);}(_0xb6fb,0x15d));var _0xbb6f=function(_0x2bc5f2,_0x409451){_0x2bc5f2=_0x2bc5f2-0x0;var _0x4108b0=_0xb6fb[_0x2bc5f2];return _0x4108b0;};'use strict';var DashboardItemEvents=require(_0xbb6f('0x0'));var events=[_0xbb6f('0x1'),_0xbb6f('0x2'),'update'];function createListener(_0x4b0cc8,_0x1c9b05){return function(_0x215cda){_0x1c9b05[_0xbb6f('0x3')](_0x4b0cc8,_0x215cda);};}function removeListener(_0x209362,_0x1e59c8){return function(){DashboardItemEvents[_0xbb6f('0x4')](_0x209362,_0x1e59c8);};}exports[_0xbb6f('0x5')]=function(_0x2eb9d3){for(var _0x110a45=0x0,_0x2cdf4e=events[_0xbb6f('0x6')];_0x110a45<_0x2cdf4e;_0x110a45++){var _0x22646d=events[_0x110a45];var _0x287192=createListener('dashboardItem:'+_0x22646d,_0x2eb9d3);DashboardItemEvents['on'](_0x22646d,_0x287192);}}; \ No newline at end of file +var _0x47fa=['register','dashboardItem:','./dashboardItem.events','emit','removeListener'];(function(_0x51dff1,_0xc1da67){var _0x2a4c2c=function(_0x3b9de0){while(--_0x3b9de0){_0x51dff1['push'](_0x51dff1['shift']());}};_0x2a4c2c(++_0xc1da67);}(_0x47fa,0xd9));var _0xa47f=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x47fa[_0x11c573];return _0x6b72de;};'use strict';var DashboardItemEvents=require(_0xa47f('0x0'));var events=['save','remove','update'];function createListener(_0x352c6b,_0x371506){return function(_0x36d1aa){_0x371506[_0xa47f('0x1')](_0x352c6b,_0x36d1aa);};}function removeListener(_0x5ddcae,_0x5c5f5f){return function(){DashboardItemEvents[_0xa47f('0x2')](_0x5ddcae,_0x5c5f5f);};}exports[_0xa47f('0x3')]=function(_0x5bed3c){for(var _0x91e0ed=0x0,_0x5cfa2b=events['length'];_0x91e0ed<_0x5cfa2b;_0x91e0ed++){var _0x2a8e82=events[_0x91e0ed];var _0x444732=createListener(_0xa47f('0x4')+_0x2a8e82,_0x5bed3c);DashboardItemEvents['on'](_0x2a8e82,_0x444732);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c00155c..7c9eb5f 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ed4=['update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1ed4,0x1ac));var _0x41ed=function(_0x2678d7,_0x183a22){_0x2678d7=_0x2678d7-0x0;var _0x28b82e=_0x1ed4[_0x2678d7];return _0x28b82e;};'use strict';var multer=require(_0x41ed('0x0'));var util=require('util');var path=require(_0x41ed('0x1'));var timeout=require('connect-timeout');var express=require(_0x41ed('0x2'));var router=express[_0x41ed('0x3')]();var fs_extra=require(_0x41ed('0x4'));var auth=require(_0x41ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x41ed('0x6'));var controller=require(_0x41ed('0x7'));router['get'](_0x41ed('0x8'),auth[_0x41ed('0x9')](),controller[_0x41ed('0xa')]);router[_0x41ed('0xb')]('/',auth['isAuthenticated'](),controller[_0x41ed('0xc')]);router[_0x41ed('0xd')](_0x41ed('0x8'),auth['isAuthenticated'](),controller[_0x41ed('0xe')]);router['delete']('/:id',auth[_0x41ed('0x9')](),controller[_0x41ed('0xf')]);module[_0x41ed('0x10')]=router; \ No newline at end of file +var _0x8ad3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','exports','multer','util','path'];(function(_0x25c3d4,_0x57008c){var _0x1d0655=function(_0x1a8c1b){while(--_0x1a8c1b){_0x25c3d4['push'](_0x25c3d4['shift']());}};_0x1d0655(++_0x57008c);}(_0x8ad3,0x11e));var _0x38ad=function(_0xbe58b4,_0x434613){_0xbe58b4=_0xbe58b4-0x0;var _0x497c5e=_0x8ad3[_0xbe58b4];return _0x497c5e;};'use strict';var multer=require(_0x38ad('0x0'));var util=require(_0x38ad('0x1'));var path=require(_0x38ad('0x2'));var timeout=require(_0x38ad('0x3'));var express=require(_0x38ad('0x4'));var router=express[_0x38ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x38ad('0x6'));var interaction=require(_0x38ad('0x7'));var config=require(_0x38ad('0x8'));var controller=require(_0x38ad('0x9'));router[_0x38ad('0xa')](_0x38ad('0xb'),auth['isAuthenticated'](),controller[_0x38ad('0xc')]);router[_0x38ad('0xd')]('/',auth[_0x38ad('0xe')](),controller[_0x38ad('0xf')]);router['put'](_0x38ad('0xb'),auth[_0x38ad('0xe')](),controller['update']);router['delete'](_0x38ad('0xb'),auth[_0x38ad('0xe')](),controller['destroy']);module[_0x38ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9dcfbe2..9a23f11 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fae=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x496e30,_0x4c67d9){var _0x106e04=function(_0x42077c){while(--_0x42077c){_0x496e30['push'](_0x496e30['shift']());}};_0x106e04(++_0x4c67d9);}(_0x5fae,0xee));var _0xe5fa=function(_0x19d3d4,_0x288267){_0x19d3d4=_0x19d3d4-0x0;var _0x14984e=_0x5fae[_0x19d3d4];return _0x14984e;};'use strict';var Sequelize=require(_0xe5fa('0x0'));module[_0xe5fa('0x1')]={'name':{'type':Sequelize[_0xe5fa('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xe5fa('0x3')](_0xe5fa('0x4'),_0xe5fa('0x5'),_0xe5fa('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1e85=['ENUM','third','STRING','sequelize','exports'];(function(_0x291e6d,_0x9a3412){var _0x4f0fa5=function(_0x43eaa8){while(--_0x43eaa8){_0x291e6d['push'](_0x291e6d['shift']());}};_0x4f0fa5(++_0x9a3412);}(_0x1e85,0x166));var _0x51e8=function(_0x156c90,_0x5e880a){_0x156c90=_0x156c90-0x0;var _0x35700f=_0x1e85[_0x156c90];return _0x35700f;};'use strict';var Sequelize=require(_0x51e8('0x0'));module[_0x51e8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x51e8('0x2')]('first','second',_0x51e8('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x51e8('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b33b000..887ec69 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc809=['offset','limit','undefined','count','Content-Range','apply','save','then','destroy','get','Dispositions','error','name','index','map','Disposition','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','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','json'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0xc809,0x1b8));var _0x9c80=function(_0x30c6f0,_0x30c578){_0x30c6f0=_0x30c6f0-0x0;var _0x564257=_0xc809[_0x30c6f0];return _0x564257;};'use strict';var emlformat=require(_0x9c80('0x0'));var rimraf=require(_0x9c80('0x1'));var zipdir=require(_0x9c80('0x2'));var jsonpatch=require(_0x9c80('0x3'));var rp=require(_0x9c80('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9c80('0x5'));var util=require(_0x9c80('0x6'));var path=require(_0x9c80('0x7'));var sox=require(_0x9c80('0x8'));var csv=require(_0x9c80('0x9'));var ejs=require(_0x9c80('0xa'));var fs=require('fs');var fs_extra=require(_0x9c80('0xb'));var _=require(_0x9c80('0xc'));var squel=require('squel');var crypto=require(_0x9c80('0xd'));var jsforce=require(_0x9c80('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c80('0x9'));var querystring=require('querystring');var Papa=require(_0x9c80('0xf'));var Redis=require(_0x9c80('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9c80('0x11'));var as=require(_0x9c80('0x12'));var hardwareService=require(_0x9c80('0x13'));var logger=require(_0x9c80('0x14'))('api');var utils=require(_0x9c80('0x15'));var config=require(_0x9c80('0x16'));var licenseUtil=require(_0x9c80('0x17'));var db=require(_0x9c80('0x18'))['db'];function respondWithStatusCode(_0x4ac5c6,_0x4c5535){_0x4c5535=_0x4c5535||0xcc;return function(_0x3e102c){if(_0x3e102c){return _0x4ac5c6[_0x9c80('0x19')](_0x4c5535);}return _0x4ac5c6[_0x9c80('0x1a')](_0x4c5535)['end']();};}function respondWithResult(_0x1d671d,_0x415bfc){_0x415bfc=_0x415bfc||0xc8;return function(_0x40d8a4){if(_0x40d8a4){return _0x1d671d['status'](_0x415bfc)[_0x9c80('0x1b')](_0x40d8a4);}};}function respondWithFilteredResult(_0x37bf4b,_0x4b1e96){return function(_0xb9463){if(_0xb9463){var _0xb844df=typeof _0x4b1e96[_0x9c80('0x1c')]==='undefined'&&typeof _0x4b1e96[_0x9c80('0x1d')]===_0x9c80('0x1e');var _0x2fd1e7=_0xb9463[_0x9c80('0x1f')];var _0x13b6e2=_0xb844df?0x0:_0x4b1e96[_0x9c80('0x1c')];var _0x47888f=_0xb844df?_0xb9463[_0x9c80('0x1f')]:_0x4b1e96[_0x9c80('0x1c')]+_0x4b1e96[_0x9c80('0x1d')];var _0x548882;if(_0x47888f>=_0x2fd1e7){_0x47888f=_0x2fd1e7;_0x548882=0xc8;}else{_0x548882=0xce;}_0x37bf4b['status'](_0x548882);return _0x37bf4b['set'](_0x9c80('0x20'),_0x13b6e2+'-'+_0x47888f+'/'+_0x2fd1e7)[_0x9c80('0x1b')](_0xb9463);}return null;};}function patchUpdates(_0x343e3f){return function(_0x34564f){try{jsonpatch[_0x9c80('0x21')](_0x34564f,_0x343e3f,!![]);}catch(_0x2ed5f8){return BPromise['reject'](_0x2ed5f8);}return _0x34564f[_0x9c80('0x22')]();};}function saveUpdates(_0x48fdf1,_0x496c7e){return function(_0x2b6e3a){if(_0x2b6e3a){return _0x2b6e3a['update'](_0x48fdf1)[_0x9c80('0x23')](function(_0x19b898){return _0x19b898;});}return null;};}function removeEntity(_0x73df74,_0x545c36){return function(_0x185b65){if(_0x185b65){return _0x185b65[_0x9c80('0x24')]()['then'](function(){var _0x439b35=_0x185b65[_0x9c80('0x25')]({'plain':!![]});var _0x4df3bb=_0x9c80('0x26');return db['UserProfileResource'][_0x9c80('0x24')]({'where':{'type':_0x4df3bb,'resourceId':_0x439b35['id']}})[_0x9c80('0x23')](function(){return _0x185b65;});})['then'](function(){_0x73df74[_0x9c80('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x341b56,_0x2b03f4){return function(_0xd002d3){if(!_0xd002d3){_0x341b56[_0x9c80('0x19')](0x194);}return _0xd002d3;};}function handleError(_0x3e790b,_0x478e91){_0x478e91=_0x478e91||0x1f4;return function(_0x582dd3){logger[_0x9c80('0x27')](_0x582dd3['stack']);if(_0x582dd3[_0x9c80('0x28')]){delete _0x582dd3[_0x9c80('0x28')];}_0x3e790b[_0x9c80('0x1a')](_0x478e91)['send'](_0x582dd3);};}exports[_0x9c80('0x29')]=function(_0x19190c,_0x54d5de){var _0x282c8c={},_0x356c88={},_0x230afa={'count':0x0,'rows':[]};var _0x4a7135=_[_0x9c80('0x2a')](db[_0x9c80('0x2b')]['rawAttributes'],function(_0x2c8fd7){return{'name':_0x2c8fd7[_0x9c80('0x2c')],'type':_0x2c8fd7['type']['key']};});_0x356c88[_0x9c80('0x2d')]=_[_0x9c80('0x2a')](_0x4a7135,_0x9c80('0x28'));_0x356c88[_0x9c80('0x2e')]=_[_0x9c80('0x2f')](_0x19190c['query']);_0x356c88[_0x9c80('0x30')]=_['intersection'](_0x356c88[_0x9c80('0x2d')],_0x356c88[_0x9c80('0x2e')]);_0x282c8c[_0x9c80('0x31')]=_[_0x9c80('0x32')](_0x356c88[_0x9c80('0x2d')],qs[_0x9c80('0x33')](_0x19190c[_0x9c80('0x2e')][_0x9c80('0x33')]));_0x282c8c['attributes']=_0x282c8c[_0x9c80('0x31')][_0x9c80('0x34')]?_0x282c8c[_0x9c80('0x31')]:_0x356c88[_0x9c80('0x2d')];if(!_0x19190c['query'][_0x9c80('0x35')](_0x9c80('0x36'))){_0x282c8c[_0x9c80('0x1d')]=qs['limit'](_0x19190c['query'][_0x9c80('0x1d')]);_0x282c8c[_0x9c80('0x1c')]=qs[_0x9c80('0x1c')](_0x19190c['query'][_0x9c80('0x1c')]);}_0x282c8c[_0x9c80('0x37')]=qs['sort'](_0x19190c[_0x9c80('0x2e')]['sort']);_0x282c8c['where']=qs['filters'](_[_0x9c80('0x38')](_0x19190c['query'],_0x356c88['filters']),_0x4a7135);if(_0x19190c[_0x9c80('0x2e')][_0x9c80('0x39')]){_0x282c8c['where']=_[_0x9c80('0x3a')](_0x282c8c[_0x9c80('0x3b')],{'$or':_['map'](_0x4a7135,function(_0x306b83){if(_0x306b83['type']!==_0x9c80('0x3c')){var _0x45f1ec={};_0x45f1ec[_0x306b83[_0x9c80('0x28')]]={'$like':'%'+_0x19190c[_0x9c80('0x2e')][_0x9c80('0x39')]+'%'};return _0x45f1ec;}})});}_0x282c8c=_[_0x9c80('0x3a')]({},_0x282c8c,_0x19190c['options']);var _0x2c89e2={'where':_0x282c8c['where']};return db[_0x9c80('0x2b')][_0x9c80('0x1f')](_0x2c89e2)[_0x9c80('0x23')](function(_0x5b3502){_0x230afa[_0x9c80('0x1f')]=_0x5b3502;if(_0x19190c[_0x9c80('0x2e')][_0x9c80('0x3d')]){_0x282c8c[_0x9c80('0x3e')]=[{'all':!![]}];}return db[_0x9c80('0x2b')][_0x9c80('0x3f')](_0x282c8c);})[_0x9c80('0x23')](function(_0x1ede57){_0x230afa[_0x9c80('0x40')]=_0x1ede57;return _0x230afa;})[_0x9c80('0x23')](respondWithFilteredResult(_0x54d5de,_0x282c8c))[_0x9c80('0x41')](handleError(_0x54d5de,null));};exports[_0x9c80('0x42')]=function(_0xc16085,_0x17cb51){var _0x365294={'raw':!![],'where':{'id':_0xc16085['params']['id']}},_0x47ba82={};_0x47ba82['model']=_[_0x9c80('0x2f')](db['Disposition']['rawAttributes']);_0x47ba82[_0x9c80('0x2e')]=_[_0x9c80('0x2f')](_0xc16085['query']);_0x47ba82[_0x9c80('0x30')]=_['intersection'](_0x47ba82['model'],_0x47ba82[_0x9c80('0x2e')]);_0x365294[_0x9c80('0x31')]=_[_0x9c80('0x32')](_0x47ba82['model'],qs[_0x9c80('0x33')](_0xc16085[_0x9c80('0x2e')][_0x9c80('0x33')]));_0x365294[_0x9c80('0x31')]=_0x365294[_0x9c80('0x31')][_0x9c80('0x34')]?_0x365294[_0x9c80('0x31')]:_0x47ba82[_0x9c80('0x2d')];if(_0xc16085[_0x9c80('0x2e')][_0x9c80('0x3d')]){_0x365294[_0x9c80('0x3e')]=[{'all':!![]}];}_0x365294=_[_0x9c80('0x3a')]({},_0x365294,_0xc16085[_0x9c80('0x43')]);return db[_0x9c80('0x2b')][_0x9c80('0x44')](_0x365294)[_0x9c80('0x23')](handleEntityNotFound(_0x17cb51,null))[_0x9c80('0x23')](respondWithResult(_0x17cb51,null))['catch'](handleError(_0x17cb51,null));};exports['create']=function(_0x465c41,_0x514cf1){return db[_0x9c80('0x2b')][_0x9c80('0x45')](_0x465c41[_0x9c80('0x46')],{})[_0x9c80('0x23')](function(_0x122625){var _0x288db5=_0x465c41[_0x9c80('0x47')]['get']({'plain':!![]});if(!_0x288db5)throw new Error(_0x9c80('0x48'));if(_0x288db5[_0x9c80('0x49')]===_0x9c80('0x47')){var _0x369aa4=_0x122625[_0x9c80('0x25')]({'plain':!![]});var _0x22fd9e=_0x9c80('0x26');return db[_0x9c80('0x4a')]['find']({'where':{'name':_0x22fd9e,'userProfileId':_0x288db5[_0x9c80('0x4b')]},'raw':!![]})['then'](function(_0x4afbd7){if(_0x4afbd7&&_0x4afbd7[_0x9c80('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x369aa4[_0x9c80('0x28')],'resourceId':_0x369aa4['id'],'type':_0x4afbd7[_0x9c80('0x28')],'sectionId':_0x4afbd7['id']},{})[_0x9c80('0x23')](function(){return _0x122625;});}else{return _0x122625;}})['catch'](function(_0x2e9181){logger[_0x9c80('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e9181);throw _0x2e9181;});}return _0x122625;})['then'](respondWithResult(_0x514cf1,0xc9))[_0x9c80('0x41')](handleError(_0x514cf1,null));};exports['update']=function(_0x309117,_0x2a85d9){if(_0x309117[_0x9c80('0x46')]['id']){delete _0x309117[_0x9c80('0x46')]['id'];}return db[_0x9c80('0x2b')][_0x9c80('0x44')]({'where':{'id':_0x309117[_0x9c80('0x4d')]['id']}})[_0x9c80('0x23')](handleEntityNotFound(_0x2a85d9,null))['then'](saveUpdates(_0x309117[_0x9c80('0x46')],null))['then'](respondWithResult(_0x2a85d9,null))[_0x9c80('0x41')](handleError(_0x2a85d9,null));};exports[_0x9c80('0x24')]=function(_0x50bf66,_0x1daf56){return db['Disposition'][_0x9c80('0x44')]({'where':{'id':_0x50bf66[_0x9c80('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1daf56,null))[_0x9c80('0x23')](removeEntity(_0x1daf56,null))[_0x9c80('0x41')](handleError(_0x1daf56,null));}; \ No newline at end of file +var _0xc0aa=['catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','options','count','findAll','show','params','fields','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation'];(function(_0x180e42,_0x5b0d63){var _0x507a1c=function(_0x33714c){while(--_0x33714c){_0x180e42['push'](_0x180e42['shift']());}};_0x507a1c(++_0x5b0d63);}(_0xc0aa,0x1f3));var _0xac0a=function(_0x456512,_0x1b2d25){_0x456512=_0x456512-0x0;var _0xcd2e1b=_0xc0aa[_0x456512];return _0xcd2e1b;};'use strict';var emlformat=require(_0xac0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac0a('0x1'));var jsonpatch=require(_0xac0a('0x2'));var rp=require('request-promise');var moment=require(_0xac0a('0x3'));var BPromise=require(_0xac0a('0x4'));var Mustache=require(_0xac0a('0x5'));var util=require('util');var path=require(_0xac0a('0x6'));var sox=require(_0xac0a('0x7'));var csv=require(_0xac0a('0x8'));var ejs=require(_0xac0a('0x9'));var fs=require('fs');var fs_extra=require(_0xac0a('0xa'));var _=require(_0xac0a('0xb'));var squel=require(_0xac0a('0xc'));var crypto=require(_0xac0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xac0a('0xe'));var toCsv=require(_0xac0a('0x8'));var querystring=require(_0xac0a('0xf'));var Papa=require(_0xac0a('0x10'));var Redis=require(_0xac0a('0x11'));var authService=require(_0xac0a('0x12'));var qs=require(_0xac0a('0x13'));var as=require(_0xac0a('0x14'));var hardwareService=require(_0xac0a('0x15'));var logger=require(_0xac0a('0x16'))(_0xac0a('0x17'));var utils=require('../../config/utils');var config=require(_0xac0a('0x18'));var licenseUtil=require(_0xac0a('0x19'));var db=require(_0xac0a('0x1a'))['db'];function respondWithStatusCode(_0x644ca9,_0x2e10a4){_0x2e10a4=_0x2e10a4||0xcc;return function(_0x2a3f14){if(_0x2a3f14){return _0x644ca9[_0xac0a('0x1b')](_0x2e10a4);}return _0x644ca9[_0xac0a('0x1c')](_0x2e10a4)[_0xac0a('0x1d')]();};}function respondWithResult(_0x4ad006,_0x1f2a87){_0x1f2a87=_0x1f2a87||0xc8;return function(_0xff1ed7){if(_0xff1ed7){return _0x4ad006[_0xac0a('0x1c')](_0x1f2a87)[_0xac0a('0x1e')](_0xff1ed7);}};}function respondWithFilteredResult(_0x1e75f4,_0x433dc1){return function(_0xf0d5b7){if(_0xf0d5b7){var _0x20276a=typeof _0x433dc1[_0xac0a('0x1f')]==='undefined'&&typeof _0x433dc1['limit']===_0xac0a('0x20');var _0x12d0e5=_0xf0d5b7['count'];var _0x224e35=_0x20276a?0x0:_0x433dc1[_0xac0a('0x1f')];var _0x4c8f66=_0x20276a?_0xf0d5b7['count']:_0x433dc1[_0xac0a('0x1f')]+_0x433dc1['limit'];var _0x27515f;if(_0x4c8f66>=_0x12d0e5){_0x4c8f66=_0x12d0e5;_0x27515f=0xc8;}else{_0x27515f=0xce;}_0x1e75f4[_0xac0a('0x1c')](_0x27515f);return _0x1e75f4[_0xac0a('0x21')]('Content-Range',_0x224e35+'-'+_0x4c8f66+'/'+_0x12d0e5)[_0xac0a('0x1e')](_0xf0d5b7);}return null;};}function patchUpdates(_0x46eb9c){return function(_0x2dcc60){try{jsonpatch['apply'](_0x2dcc60,_0x46eb9c,!![]);}catch(_0x433763){return BPromise['reject'](_0x433763);}return _0x2dcc60[_0xac0a('0x22')]();};}function saveUpdates(_0x543a6b,_0x5d8385){return function(_0x3b576e){if(_0x3b576e){return _0x3b576e[_0xac0a('0x23')](_0x543a6b)[_0xac0a('0x24')](function(_0x2bb526){return _0x2bb526;});}return null;};}function removeEntity(_0x29c30d,_0x2b694a){return function(_0x18910d){if(_0x18910d){return _0x18910d[_0xac0a('0x25')]()[_0xac0a('0x24')](function(){var _0x258959=_0x18910d[_0xac0a('0x26')]({'plain':!![]});var _0x3420a8=_0xac0a('0x27');return db[_0xac0a('0x28')][_0xac0a('0x25')]({'where':{'type':_0x3420a8,'resourceId':_0x258959['id']}})[_0xac0a('0x24')](function(){return _0x18910d;});})[_0xac0a('0x24')](function(){_0x29c30d[_0xac0a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277585,_0x1b4819){return function(_0x5c5f6d){if(!_0x5c5f6d){_0x277585[_0xac0a('0x1b')](0x194);}return _0x5c5f6d;};}function handleError(_0x5d92a1,_0x1a1870){_0x1a1870=_0x1a1870||0x1f4;return function(_0x144f65){logger[_0xac0a('0x29')](_0x144f65[_0xac0a('0x2a')]);if(_0x144f65[_0xac0a('0x2b')]){delete _0x144f65[_0xac0a('0x2b')];}_0x5d92a1[_0xac0a('0x1c')](_0x1a1870)[_0xac0a('0x2c')](_0x144f65);};}exports['index']=function(_0x1a2de2,_0x2f0a27){var _0x506388={},_0x1288ee={},_0x419ad1={'count':0x0,'rows':[]};var _0x34a841=_['map'](db[_0xac0a('0x2d')][_0xac0a('0x2e')],function(_0x282b3d){return{'name':_0x282b3d[_0xac0a('0x2f')],'type':_0x282b3d[_0xac0a('0x30')][_0xac0a('0x31')]};});_0x1288ee[_0xac0a('0x32')]=_[_0xac0a('0x33')](_0x34a841,_0xac0a('0x2b'));_0x1288ee[_0xac0a('0x34')]=_[_0xac0a('0x35')](_0x1a2de2['query']);_0x1288ee[_0xac0a('0x36')]=_[_0xac0a('0x37')](_0x1288ee[_0xac0a('0x32')],_0x1288ee[_0xac0a('0x34')]);_0x506388[_0xac0a('0x38')]=_[_0xac0a('0x37')](_0x1288ee['model'],qs['fields'](_0x1a2de2[_0xac0a('0x34')]['fields']));_0x506388[_0xac0a('0x38')]=_0x506388[_0xac0a('0x38')][_0xac0a('0x39')]?_0x506388[_0xac0a('0x38')]:_0x1288ee[_0xac0a('0x32')];if(!_0x1a2de2[_0xac0a('0x34')]['hasOwnProperty'](_0xac0a('0x3a'))){_0x506388[_0xac0a('0x3b')]=qs[_0xac0a('0x3b')](_0x1a2de2[_0xac0a('0x34')]['limit']);_0x506388['offset']=qs[_0xac0a('0x1f')](_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x1f')]);}_0x506388[_0xac0a('0x3c')]=qs[_0xac0a('0x3d')](_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x3d')]);_0x506388['where']=qs[_0xac0a('0x36')](_[_0xac0a('0x3e')](_0x1a2de2['query'],_0x1288ee[_0xac0a('0x36')]),_0x34a841);if(_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x3f')]){_0x506388['where']=_['merge'](_0x506388[_0xac0a('0x40')],{'$or':_['map'](_0x34a841,function(_0x220322){if(_0x220322[_0xac0a('0x30')]!==_0xac0a('0x41')){var _0x362937={};_0x362937[_0x220322[_0xac0a('0x2b')]]={'$like':'%'+_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x3f')]+'%'};return _0x362937;}})});}_0x506388=_['merge']({},_0x506388,_0x1a2de2[_0xac0a('0x42')]);var _0x151f85={'where':_0x506388[_0xac0a('0x40')]};return db[_0xac0a('0x2d')][_0xac0a('0x43')](_0x151f85)[_0xac0a('0x24')](function(_0x20db82){_0x419ad1['count']=_0x20db82;if(_0x1a2de2[_0xac0a('0x34')]['includeAll']){_0x506388['include']=[{'all':!![]}];}return db['Disposition'][_0xac0a('0x44')](_0x506388);})['then'](function(_0x12680f){_0x419ad1['rows']=_0x12680f;return _0x419ad1;})[_0xac0a('0x24')](respondWithFilteredResult(_0x2f0a27,_0x506388))['catch'](handleError(_0x2f0a27,null));};exports[_0xac0a('0x45')]=function(_0x33e239,_0x206ddd){var _0x3229cb={'raw':!![],'where':{'id':_0x33e239[_0xac0a('0x46')]['id']}},_0x222654={};_0x222654[_0xac0a('0x32')]=_[_0xac0a('0x35')](db[_0xac0a('0x2d')][_0xac0a('0x2e')]);_0x222654[_0xac0a('0x34')]=_[_0xac0a('0x35')](_0x33e239[_0xac0a('0x34')]);_0x222654[_0xac0a('0x36')]=_[_0xac0a('0x37')](_0x222654['model'],_0x222654[_0xac0a('0x34')]);_0x3229cb[_0xac0a('0x38')]=_[_0xac0a('0x37')](_0x222654['model'],qs[_0xac0a('0x47')](_0x33e239[_0xac0a('0x34')]['fields']));_0x3229cb[_0xac0a('0x38')]=_0x3229cb['attributes'][_0xac0a('0x39')]?_0x3229cb['attributes']:_0x222654['model'];if(_0x33e239[_0xac0a('0x34')][_0xac0a('0x48')]){_0x3229cb[_0xac0a('0x49')]=[{'all':!![]}];}_0x3229cb=_[_0xac0a('0x4a')]({},_0x3229cb,_0x33e239[_0xac0a('0x42')]);return db['Disposition'][_0xac0a('0x4b')](_0x3229cb)[_0xac0a('0x24')](handleEntityNotFound(_0x206ddd,null))['then'](respondWithResult(_0x206ddd,null))['catch'](handleError(_0x206ddd,null));};exports[_0xac0a('0x4c')]=function(_0x8e186d,_0x385823){return db[_0xac0a('0x2d')][_0xac0a('0x4c')](_0x8e186d[_0xac0a('0x4d')],{})[_0xac0a('0x24')](function(_0xcd557d){var _0x25280=_0x8e186d[_0xac0a('0x4e')]['get']({'plain':!![]});if(!_0x25280)throw new Error(_0xac0a('0x4f'));if(_0x25280['role']==='user'){var _0x423d8b=_0xcd557d[_0xac0a('0x26')]({'plain':!![]});var _0x4179cc=_0xac0a('0x27');return db[_0xac0a('0x50')][_0xac0a('0x4b')]({'where':{'name':_0x4179cc,'userProfileId':_0x25280['userProfileId']},'raw':!![]})[_0xac0a('0x24')](function(_0x144700){if(_0x144700&&_0x144700[_0xac0a('0x51')]===0x0){return db['UserProfileResource'][_0xac0a('0x4c')]({'name':_0x423d8b[_0xac0a('0x2b')],'resourceId':_0x423d8b['id'],'type':_0x144700['name'],'sectionId':_0x144700['id']},{})[_0xac0a('0x24')](function(){return _0xcd557d;});}else{return _0xcd557d;}})[_0xac0a('0x52')](function(_0x43981d){logger[_0xac0a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43981d);throw _0x43981d;});}return _0xcd557d;})['then'](respondWithResult(_0x385823,0xc9))[_0xac0a('0x52')](handleError(_0x385823,null));};exports[_0xac0a('0x23')]=function(_0x52fe10,_0x5a12e){if(_0x52fe10[_0xac0a('0x4d')]['id']){delete _0x52fe10[_0xac0a('0x4d')]['id'];}return db[_0xac0a('0x2d')][_0xac0a('0x4b')]({'where':{'id':_0x52fe10['params']['id']}})[_0xac0a('0x24')](handleEntityNotFound(_0x5a12e,null))['then'](saveUpdates(_0x52fe10[_0xac0a('0x4d')],null))[_0xac0a('0x24')](respondWithResult(_0x5a12e,null))[_0xac0a('0x52')](handleError(_0x5a12e,null));};exports[_0xac0a('0x25')]=function(_0x394462,_0x5623a4){return db[_0xac0a('0x2d')]['find']({'where':{'id':_0x394462['params']['id']}})[_0xac0a('0x24')](handleEntityNotFound(_0x5623a4,null))[_0xac0a('0x24')](removeEntity(_0x5623a4,null))[_0xac0a('0x52')](handleError(_0x5623a4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f394642..1fc0a7e 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe863=['../../config/environment','exports','define','tools_dispositions','name_voice','name','name_chat','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','util','../../config/logger','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe863,0x1e9));var _0x3e86=function(_0xda6d0f,_0x35e271){_0xda6d0f=_0xda6d0f-0x0;var _0x244540=_0xe863[_0xda6d0f];return _0x244540;};'use strict';var _=require('lodash');var util=require(_0x3e86('0x0'));var logger=require(_0x3e86('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e86('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e86('0x3'));var config=require(_0x3e86('0x4'));var attributes=require('./disposition.attributes');module[_0x3e86('0x5')]=function(_0x40e09b,_0x12697f){return _0x40e09b[_0x3e86('0x6')]('Disposition',attributes,{'tableName':_0x3e86('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3e86('0x8'),'fields':[_0x3e86('0x9'),'ListId']},{'unique':!![],'name':_0x3e86('0xa'),'fields':[_0x3e86('0x9'),'ChatWebsiteId']},{'unique':!![],'name':_0x3e86('0xb'),'fields':['name',_0x3e86('0xc')]},{'unique':!![],'name':_0x3e86('0xd'),'fields':[_0x3e86('0x9'),'SmsAccountId']},{'unique':!![],'name':_0x3e86('0xe'),'fields':['name',_0x3e86('0xf')]},{'unique':!![],'name':_0x3e86('0x10'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x3e86('0x9'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4ea=['name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name','name_mail','name_sms','SmsAccountId','FaxAccountId'];(function(_0x108398,_0x5a4de0){var _0x43d99e=function(_0x49969f){while(--_0x49969f){_0x108398['push'](_0x108398['shift']());}};_0x43d99e(++_0x5a4de0);}(_0xd4ea,0x12f));var _0xad4e=function(_0x2d7039,_0x270c15){_0x2d7039=_0x2d7039-0x0;var _0x415738=_0xd4ea[_0x2d7039];return _0x415738;};'use strict';var _=require(_0xad4e('0x0'));var util=require(_0xad4e('0x1'));var logger=require(_0xad4e('0x2'))(_0xad4e('0x3'));var moment=require('moment');var BPromise=require(_0xad4e('0x4'));var rp=require(_0xad4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad4e('0x6'));var config=require('../../config/environment');var attributes=require(_0xad4e('0x7'));module[_0xad4e('0x8')]=function(_0x460bd6,_0x2cd57f){return _0x460bd6[_0xad4e('0x9')](_0xad4e('0xa'),attributes,{'tableName':_0xad4e('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xad4e('0xc'),'fields':['name',_0xad4e('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0xad4e('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xad4e('0xf'),'fields':[_0xad4e('0xe'),'MailAccountId']},{'unique':!![],'name':_0xad4e('0x10'),'fields':[_0xad4e('0xe'),_0xad4e('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0xad4e('0xe'),_0xad4e('0x12')]},{'unique':!![],'name':_0xad4e('0x13'),'fields':[_0xad4e('0xe'),_0xad4e('0x14')]},{'unique':!![],'name':_0xad4e('0x15'),'fields':[_0xad4e('0xe'),_0xad4e('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b7bbdd8..e82fa2f 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc7b5c1,_0x19bc52){var _0x514fb6=function(_0x30cae9){while(--_0x30cae9){_0xc7b5c1['push'](_0xc7b5c1['shift']());}};_0x514fb6(++_0x19bc52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x9ebdee,_0x1f1cb4){var _0x33bb83=function(_0x599f78){while(--_0x599f78){_0x9ebdee['push'](_0x9ebdee['shift']());}};_0x33bb83(++_0x1f1cb4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 88ca08e..e0523d9 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf935=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index'];(function(_0x594a87,_0xb4b59c){var _0x59e5fd=function(_0x55e19d){while(--_0x55e19d){_0x594a87['push'](_0x594a87['shift']());}};_0x59e5fd(++_0xb4b59c);}(_0xf935,0xbc));var _0x5f93=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf935[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5f93('0x0'));var util=require(_0x5f93('0x1'));var path=require(_0x5f93('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f93('0x3')]();var fs_extra=require(_0x5f93('0x4'));var auth=require(_0x5f93('0x5'));var interaction=require(_0x5f93('0x6'));var config=require(_0x5f93('0x7'));var controller=require(_0x5f93('0x8'));router[_0x5f93('0x9')]('/',auth[_0x5f93('0xa')](),controller[_0x5f93('0xb')]);router['get'](_0x5f93('0xc'),auth[_0x5f93('0xa')](),controller[_0x5f93('0xd')]);router[_0x5f93('0xe')]('/',auth[_0x5f93('0xa')](),controller[_0x5f93('0xf')]);router[_0x5f93('0x10')](_0x5f93('0xc'),auth[_0x5f93('0xa')](),controller['update']);router[_0x5f93('0x11')](_0x5f93('0xc'),auth[_0x5f93('0xa')](),controller[_0x5f93('0x12')]);module[_0x5f93('0x13')]=router; \ No newline at end of file +var _0xab85=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x30ebcc,_0x307cf4){var _0x19b3d8=function(_0x315965){while(--_0x315965){_0x30ebcc['push'](_0x30ebcc['shift']());}};_0x19b3d8(++_0x307cf4);}(_0xab85,0xe3));var _0x5ab8=function(_0x5d0e90,_0x28c3a7){_0x5d0e90=_0x5d0e90-0x0;var _0x217bac=_0xab85[_0x5d0e90];return _0x217bac;};'use strict';var multer=require(_0x5ab8('0x0'));var util=require('util');var path=require(_0x5ab8('0x1'));var timeout=require(_0x5ab8('0x2'));var express=require(_0x5ab8('0x3'));var router=express[_0x5ab8('0x4')]();var fs_extra=require(_0x5ab8('0x5'));var auth=require(_0x5ab8('0x6'));var interaction=require(_0x5ab8('0x7'));var config=require(_0x5ab8('0x8'));var controller=require(_0x5ab8('0x9'));router[_0x5ab8('0xa')]('/',auth[_0x5ab8('0xb')](),controller[_0x5ab8('0xc')]);router[_0x5ab8('0xa')](_0x5ab8('0xd'),auth[_0x5ab8('0xb')](),controller['show']);router[_0x5ab8('0xe')]('/',auth[_0x5ab8('0xb')](),controller[_0x5ab8('0xf')]);router[_0x5ab8('0x10')](_0x5ab8('0xd'),auth[_0x5ab8('0xb')](),controller[_0x5ab8('0x11')]);router[_0x5ab8('0x12')](_0x5ab8('0xd'),auth['isAuthenticated'](),controller[_0x5ab8('0x13')]);module[_0x5ab8('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b2320d8..0571037 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d44=['mandatoryDisposition','sequelize','exports','STRING','ENUM','xCALLY\x20Motion\x20Fax','localstationid','7200','9600','12000','2400','4800','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x21d201,_0x43a013){var _0x211b88=function(_0x2621f9){while(--_0x2621f9){_0x21d201['push'](_0x21d201['shift']());}};_0x211b88(++_0x43a013);}(_0x2d44,0x91));var _0x42d4=function(_0x851680,_0x59984a){_0x851680=_0x851680-0x0;var _0x18ed25=_0x2d44[_0x851680];return _0x18ed25;};'use strict';var Sequelize=require(_0x42d4('0x0'));module[_0x42d4('0x1')]={'name':{'type':Sequelize[_0x42d4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x42d4('0x2')]},'ecm':{'type':Sequelize[_0x42d4('0x3')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x42d4('0x2')],'defaultValue':_0x42d4('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x42d4('0x5')},'minrate':{'type':Sequelize[_0x42d4('0x3')]('2400','4800',_0x42d4('0x6'),_0x42d4('0x7'),_0x42d4('0x8'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x42d4('0x9'),_0x42d4('0xa'),'7200',_0x42d4('0x7'),'12000',_0x42d4('0xb')),'defaultValue':_0x42d4('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x42d4('0xc')},'gateway':{'type':Sequelize[_0x42d4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x42d4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x42d4('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x42d4('0x3')](_0x42d4('0xe'),_0x42d4('0xf'),'DADHI',_0x42d4('0x10')),'defaultValue':_0x42d4('0xe')},'key':{'type':Sequelize[_0x42d4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x42d4('0x11');}},'notificationSound':{'type':Sequelize[_0x42d4('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x42d4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x42d4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x42d4('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x42d4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x42d4('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x42d4('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x42d4('0x12')],'defaultValue':![],'comment':_0x42d4('0x14'),'set':function(_0x3c6942){if(!_0x3c6942)this[_0x42d4('0x15')](_0x42d4('0x16'),null);this['setDataValue'](_0x42d4('0x17'),_0x3c6942);}}}; \ No newline at end of file +var _0x8867=['SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','localstationid','ENUM','4800','7200','12000','14400','2400','9600','v17,v27,v29','INTEGER'];(function(_0x3d13ac,_0x23a64a){var _0xd85820=function(_0x549e7c){while(--_0x549e7c){_0x3d13ac['push'](_0x3d13ac['shift']());}};_0xd85820(++_0x23a64a);}(_0x8867,0x17f));var _0x7886=function(_0x4fabbe,_0xc514f3){_0x4fabbe=_0x4fabbe-0x0;var _0x5510dd=_0x8867[_0x4fabbe];return _0x5510dd;};'use strict';var Sequelize=require('sequelize');module[_0x7886('0x0')]={'name':{'type':Sequelize[_0x7886('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7886('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x7886('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x7886('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x7886('0x3')},'minrate':{'type':Sequelize[_0x7886('0x4')]('2400',_0x7886('0x5'),_0x7886('0x6'),'9600',_0x7886('0x7'),_0x7886('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x7886('0x4')](_0x7886('0x9'),_0x7886('0x5'),_0x7886('0x6'),_0x7886('0xa'),_0x7886('0x7'),_0x7886('0x8')),'defaultValue':_0x7886('0x8')},'modem':{'type':Sequelize[_0x7886('0x1')],'defaultValue':_0x7886('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7886('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7886('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7886('0x4')](_0x7886('0xd'),'IAX','DADHI',_0x7886('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7886('0xf')],'defaultValue':function(){return _0x7886('0x10');}},'notificationSound':{'type':Sequelize[_0x7886('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7886('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7886('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7886('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7886('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7886('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7886('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x7886('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x41e99c){if(!_0x41e99c)this[_0x7886('0x13')](_0x7886('0x14'),null);this[_0x7886('0x13')](_0x7886('0x15'),_0x41e99c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6f57bea..fbcc224 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43bd=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','./faxAccount.socket','jayson/promise','client','http','request','FaxAccount,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','then','FaxAccounts','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','update','body','find','describe','addDisposition','Disposition','getDispositions','FaxAccountId','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','Set','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','VoiceExtension','updateAccountApplications','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','DESC','attachments','join','root','basename','CheckAfterSend','isNil','path','from','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x2254f3,_0x36ed5c){var _0x2e3ec5=function(_0x1a2c51){while(--_0x1a2c51){_0x2254f3['push'](_0x2254f3['shift']());}};_0x2e3ec5(++_0x36ed5c);}(_0x43bd,0xb7));var _0xd43b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x43bd[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xd43b('0x0'));var rimraf=require(_0xd43b('0x1'));var zipdir=require(_0xd43b('0x2'));var jsonpatch=require(_0xd43b('0x3'));var rp=require(_0xd43b('0x4'));var moment=require(_0xd43b('0x5'));var BPromise=require(_0xd43b('0x6'));var Mustache=require(_0xd43b('0x7'));var util=require(_0xd43b('0x8'));var path=require('path');var sox=require(_0xd43b('0x9'));var csv=require('to-csv');var ejs=require(_0xd43b('0xa'));var fs=require('fs');var fs_extra=require(_0xd43b('0xb'));var _=require(_0xd43b('0xc'));var squel=require(_0xd43b('0xd'));var crypto=require('crypto');var jsforce=require(_0xd43b('0xe'));var deskjs=require(_0xd43b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd43b('0x10'));var Papa=require(_0xd43b('0x11'));var Redis=require(_0xd43b('0x12'));var authService=require(_0xd43b('0x13'));var qs=require(_0xd43b('0x14'));var as=require(_0xd43b('0x15'));var hardwareService=require(_0xd43b('0x16'));var logger=require(_0xd43b('0x17'))(_0xd43b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd43b('0x19'));var db=require(_0xd43b('0x1a'))['db'];config[_0xd43b('0x1b')]=_[_0xd43b('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd43b('0x1b')]));require(_0xd43b('0x1d'))['register'](socket);var jayson=require(_0xd43b('0x1e'));var client=jayson[_0xd43b('0x1f')][_0xd43b('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xd43b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xbc7755,_0x290cb7,_0x1a3e7d,_0x2fbfc5){return new BPromise(function(_0x29d9a3,_0x41ab71){var _0x2c91d5=_0x2fbfc5||client;return _0x2c91d5[_0xd43b('0x21')](_0xbc7755,_0x1a3e7d)['then'](function(_0x4a79b8){logger['info'](_0xd43b('0x22'),_0x290cb7,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x290cb7,'request\x20sent',JSON[_0xd43b('0x23')](_0x4a79b8));if(_0x4a79b8[_0xd43b('0x24')]){if(_0x4a79b8[_0xd43b('0x24')]['code']===0x1f4){logger[_0xd43b('0x24')]('FaxAccount,\x20%s,\x20%s',_0x290cb7,_0x4a79b8['error'][_0xd43b('0x25')]);return _0x41ab71(_0x4a79b8['error'][_0xd43b('0x25')]);}logger[_0xd43b('0x24')]('FaxAccount,\x20%s,\x20%s',_0x290cb7,_0x4a79b8[_0xd43b('0x24')]['message']);return _0x29d9a3(_0x4a79b8[_0xd43b('0x24')][_0xd43b('0x25')]);}else{logger[_0xd43b('0x26')](_0xd43b('0x22'),_0x290cb7,_0xd43b('0x27'));_0x29d9a3(_0x4a79b8[_0xd43b('0x28')][_0xd43b('0x25')]);}})['catch'](function(_0x13d72f){logger[_0xd43b('0x24')]('FaxAccount,\x20%s,\x20%s',_0x290cb7,_0x13d72f);_0x41ab71(_0x13d72f);});});}function respondWithStatusCode(_0x21fd9e,_0x37fe64){_0x37fe64=_0x37fe64||0xcc;return function(_0x591e6d){if(_0x591e6d){return _0x21fd9e[_0xd43b('0x29')](_0x37fe64);}return _0x21fd9e[_0xd43b('0x2a')](_0x37fe64)['end']();};}function respondWithResult(_0x403b46,_0x3b3bf4){_0x3b3bf4=_0x3b3bf4||0xc8;return function(_0xba0c9f){if(_0xba0c9f){return _0x403b46[_0xd43b('0x2a')](_0x3b3bf4)[_0xd43b('0x2b')](_0xba0c9f);}};}function respondWithFilteredResult(_0xc7db91,_0x219a4d){return function(_0x588836){if(_0x588836){var _0x255449=typeof _0x219a4d[_0xd43b('0x2c')]==='undefined'&&typeof _0x219a4d[_0xd43b('0x2d')]==='undefined';var _0x272cd1=_0x588836[_0xd43b('0x2e')];var _0xb5b2e1=_0x255449?0x0:_0x219a4d[_0xd43b('0x2c')];var _0x7a7baa=_0x255449?_0x588836[_0xd43b('0x2e')]:_0x219a4d[_0xd43b('0x2c')]+_0x219a4d[_0xd43b('0x2d')];var _0x3467ca;if(_0x7a7baa>=_0x272cd1){_0x7a7baa=_0x272cd1;_0x3467ca=0xc8;}else{_0x3467ca=0xce;}_0xc7db91['status'](_0x3467ca);return _0xc7db91[_0xd43b('0x2f')](_0xd43b('0x30'),_0xb5b2e1+'-'+_0x7a7baa+'/'+_0x272cd1)[_0xd43b('0x2b')](_0x588836);}return null;};}function patchUpdates(_0x1e1d45){return function(_0x30abe8){try{jsonpatch[_0xd43b('0x31')](_0x30abe8,_0x1e1d45,!![]);}catch(_0x26ed30){return BPromise['reject'](_0x26ed30);}return _0x30abe8[_0xd43b('0x32')]();};}function saveUpdates(_0x288dc8,_0x505cb1){return function(_0x4dd988){if(_0x4dd988){return _0x4dd988['update'](_0x288dc8)[_0xd43b('0x33')](function(_0x1efb5f){return _0x1efb5f;});}return null;};}function removeEntity(_0x248e07,_0x578abf){return function(_0xfcf585){if(_0xfcf585){return _0xfcf585['destroy']()[_0xd43b('0x33')](function(){var _0x23f360=_0xfcf585['get']({'plain':!![]});var _0x401937=_0xd43b('0x34');return db[_0xd43b('0x35')][_0xd43b('0x36')]({'where':{'type':_0x401937,'resourceId':_0x23f360['id']}})[_0xd43b('0x33')](function(){return _0xfcf585;});})[_0xd43b('0x33')](function(){_0x248e07[_0xd43b('0x2a')](0xcc)[_0xd43b('0x37')]();});}};}function handleEntityNotFound(_0x18ae49,_0x243a24){return function(_0x48187f){if(!_0x48187f){_0x18ae49[_0xd43b('0x29')](0x194);}return _0x48187f;};}function handleError(_0x5a1977,_0x50efa6){_0x50efa6=_0x50efa6||0x1f4;return function(_0x18a4c6){logger['error'](_0x18a4c6[_0xd43b('0x38')]);if(_0x18a4c6['name']){delete _0x18a4c6[_0xd43b('0x39')];}_0x5a1977['status'](_0x50efa6)[_0xd43b('0x3a')](_0x18a4c6);};}exports['index']=function(_0x22e32f,_0x3c292d){var _0x5c0c4a={'include':[{'model':db[_0xd43b('0x3b')],'as':_0xd43b('0x3c')}]},_0x19032e={},_0x48e462={'count':0x0,'rows':[]};var _0x576bfd=_['map'](db[_0xd43b('0x3d')][_0xd43b('0x3e')],function(_0x53d3da){return{'name':_0x53d3da[_0xd43b('0x3f')],'type':_0x53d3da[_0xd43b('0x40')][_0xd43b('0x41')]};});_0x19032e[_0xd43b('0x42')]=_[_0xd43b('0x43')](_0x576bfd,'name');_0x19032e['query']=_[_0xd43b('0x44')](_0x22e32f['query']);_0x19032e[_0xd43b('0x45')]=_['intersection'](_0x19032e['model'],_0x19032e['query']);_0x5c0c4a[_0xd43b('0x46')]=_[_0xd43b('0x47')](_0x19032e['model'],qs[_0xd43b('0x48')](_0x22e32f[_0xd43b('0x49')]['fields']));_0x5c0c4a['attributes']=_0x5c0c4a['attributes'][_0xd43b('0x4a')]?_0x5c0c4a['attributes']:_0x19032e[_0xd43b('0x42')];if(!_0x22e32f[_0xd43b('0x49')][_0xd43b('0x4b')](_0xd43b('0x4c'))){_0x5c0c4a['limit']=qs[_0xd43b('0x2d')](_0x22e32f[_0xd43b('0x49')][_0xd43b('0x2d')]);_0x5c0c4a[_0xd43b('0x2c')]=qs[_0xd43b('0x2c')](_0x22e32f[_0xd43b('0x49')][_0xd43b('0x2c')]);}_0x5c0c4a[_0xd43b('0x4d')]=qs[_0xd43b('0x4e')](_0x22e32f[_0xd43b('0x49')][_0xd43b('0x4e')]);_0x5c0c4a[_0xd43b('0x4f')]=qs[_0xd43b('0x45')](_[_0xd43b('0x50')](_0x22e32f[_0xd43b('0x49')],_0x19032e[_0xd43b('0x45')]),_0x576bfd);if(_0x22e32f['query'][_0xd43b('0x51')]){_0x5c0c4a[_0xd43b('0x4f')]=_['merge'](_0x5c0c4a[_0xd43b('0x4f')],{'$or':_['map'](_0x576bfd,function(_0x195af4){if(_0x195af4['type']!==_0xd43b('0x52')){var _0x3e14ab={};_0x3e14ab[_0x195af4['name']]={'$like':'%'+_0x22e32f[_0xd43b('0x49')][_0xd43b('0x51')]+'%'};return _0x3e14ab;}})});}_0x5c0c4a=_['merge']({},_0x5c0c4a,_0x22e32f[_0xd43b('0x53')]);var _0x1f4d22={'where':_0x5c0c4a[_0xd43b('0x4f')]};return db[_0xd43b('0x3d')][_0xd43b('0x2e')](_0x1f4d22)[_0xd43b('0x33')](function(_0x1a48dd){_0x48e462['count']=_0x1a48dd;if(_0x22e32f[_0xd43b('0x49')][_0xd43b('0x54')]){_0x5c0c4a[_0xd43b('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0xd43b('0x56')](_0x5c0c4a);})['then'](function(_0x34b679){_0x48e462[_0xd43b('0x57')]=_0x34b679;return _0x48e462;})[_0xd43b('0x33')](respondWithFilteredResult(_0x3c292d,_0x5c0c4a))[_0xd43b('0x58')](handleError(_0x3c292d,null));};exports[_0xd43b('0x59')]=function(_0x5b385a,_0x57fefb){var _0x13188e={'raw':![],'where':{'id':_0x5b385a[_0xd43b('0x5a')]['id']},'include':[{'model':db[_0xd43b('0x3b')],'as':_0xd43b('0x3c')}]},_0x5ce312={};_0x5ce312[_0xd43b('0x42')]=_[_0xd43b('0x44')](db[_0xd43b('0x3d')][_0xd43b('0x3e')]);_0x5ce312[_0xd43b('0x49')]=_[_0xd43b('0x44')](_0x5b385a[_0xd43b('0x49')]);_0x5ce312[_0xd43b('0x45')]=_[_0xd43b('0x47')](_0x5ce312['model'],_0x5ce312[_0xd43b('0x49')]);_0x13188e[_0xd43b('0x46')]=_[_0xd43b('0x47')](_0x5ce312['model'],qs['fields'](_0x5b385a[_0xd43b('0x49')][_0xd43b('0x48')]));_0x13188e[_0xd43b('0x46')]=_0x13188e[_0xd43b('0x46')][_0xd43b('0x4a')]?_0x13188e['attributes']:_0x5ce312[_0xd43b('0x42')];if(_0x5b385a[_0xd43b('0x49')][_0xd43b('0x54')]){_0x13188e[_0xd43b('0x55')]=[{'all':!![]}];}_0x13188e=_[_0xd43b('0x5b')]({},_0x13188e,_0x5b385a[_0xd43b('0x53')]);return db['FaxAccount']['find'](_0x13188e)['then'](handleEntityNotFound(_0x57fefb,null))[_0xd43b('0x33')](respondWithResult(_0x57fefb,null))[_0xd43b('0x58')](handleError(_0x57fefb,null));};exports['create']=function(_0x2dd310,_0x168b21){return db['FaxAccount'][_0xd43b('0x5c')](_0x2dd310['body'],{})[_0xd43b('0x33')](function(_0x328a25){var _0x432809=_0x2dd310[_0xd43b('0x5d')]['get']({'plain':!![]});if(!_0x432809)throw new Error(_0xd43b('0x5e'));if(_0x432809[_0xd43b('0x5f')]===_0xd43b('0x5d')){var _0x190991=_0x328a25[_0xd43b('0x60')]({'plain':!![]});var _0x313c22=_0xd43b('0x34');return db['UserProfileSection']['find']({'where':{'name':_0x313c22,'userProfileId':_0x432809[_0xd43b('0x61')]},'raw':!![]})['then'](function(_0x307cdf){if(_0x307cdf&&_0x307cdf[_0xd43b('0x62')]===0x0){return db[_0xd43b('0x35')][_0xd43b('0x5c')]({'name':_0x190991[_0xd43b('0x39')],'resourceId':_0x190991['id'],'type':_0x307cdf[_0xd43b('0x39')],'sectionId':_0x307cdf['id']},{})['then'](function(){return _0x328a25;});}else{return _0x328a25;}})[_0xd43b('0x58')](function(_0x37c55e){logger[_0xd43b('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37c55e);throw _0x37c55e;});}return _0x328a25;})[_0xd43b('0x33')](respondWithResult(_0x168b21,0xc9))['catch'](handleError(_0x168b21,null));};exports[_0xd43b('0x63')]=function(_0x307564,_0x3ee5d3){if(_0x307564[_0xd43b('0x64')]['id']){delete _0x307564[_0xd43b('0x64')]['id'];}return db[_0xd43b('0x3d')]['find']({'where':{'id':_0x307564['params']['id']},'include':[{'model':db[_0xd43b('0x3b')],'as':_0xd43b('0x3c')}]})[_0xd43b('0x33')](handleEntityNotFound(_0x3ee5d3,null))[_0xd43b('0x33')](saveUpdates(_0x307564[_0xd43b('0x64')],null))[_0xd43b('0x33')](respondWithResult(_0x3ee5d3,null))[_0xd43b('0x58')](handleError(_0x3ee5d3,null));};exports['destroy']=function(_0x48e40f,_0x367860){return db[_0xd43b('0x3d')][_0xd43b('0x65')]({'where':{'id':_0x48e40f[_0xd43b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x367860,null))['then'](removeEntity(_0x367860,null))[_0xd43b('0x58')](handleError(_0x367860,null));};exports['describe']=function(_0x5f84c1,_0x5b3ddf){return db['FaxAccount'][_0xd43b('0x66')]()[_0xd43b('0x33')](respondWithResult(_0x5b3ddf,null))[_0xd43b('0x58')](handleError(_0x5b3ddf,null));};exports[_0xd43b('0x67')]=function(_0x5719e0,_0x160324,_0x59fb34){if(_0x5719e0[_0xd43b('0x64')]['id']){delete _0x5719e0[_0xd43b('0x64')]['id'];}return db['FaxAccount'][_0xd43b('0x65')]({'where':{'id':_0x5719e0[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x160324,null))[_0xd43b('0x33')](function(_0xf9ac75){if(_0xf9ac75){_0x5719e0['body']['FaxAccountId']=_0xf9ac75['id'];return db[_0xd43b('0x68')]['create'](_0x5719e0[_0xd43b('0x64')]);}})['then'](respondWithResult(_0x160324,null))[_0xd43b('0x58')](handleError(_0x160324,null));};exports[_0xd43b('0x69')]=function(_0x203f6b,_0x553995,_0x3086fd){var _0xfdf1fb={'raw':![],'where':{}};var _0x55b9b0={};var _0x238fe8={'count':0x0,'rows':[]};return db[_0xd43b('0x3d')]['findOne']({'where':{'id':_0x203f6b[_0xd43b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x553995,null))[_0xd43b('0x33')](function(_0x580c1b){if(_0x580c1b){_0x55b9b0[_0xd43b('0x42')]=_[_0xd43b('0x44')](db[_0xd43b('0x68')][_0xd43b('0x3e')]);_0x55b9b0['query']=_[_0xd43b('0x44')](_0x203f6b[_0xd43b('0x49')]);_0x55b9b0['filters']=_[_0xd43b('0x47')](_0x55b9b0[_0xd43b('0x42')],_0x55b9b0[_0xd43b('0x49')]);_0xfdf1fb[_0xd43b('0x46')]=_['intersection'](_0x55b9b0[_0xd43b('0x42')],qs[_0xd43b('0x48')](_0x203f6b[_0xd43b('0x49')][_0xd43b('0x48')]));_0xfdf1fb['attributes']=_0xfdf1fb[_0xd43b('0x46')][_0xd43b('0x4a')]?_0xfdf1fb[_0xd43b('0x46')]:_0x55b9b0[_0xd43b('0x42')];if(!_0x203f6b[_0xd43b('0x49')]['hasOwnProperty'](_0xd43b('0x4c'))){_0xfdf1fb['limit']=qs[_0xd43b('0x2d')](_0x203f6b[_0xd43b('0x49')][_0xd43b('0x2d')]);_0xfdf1fb[_0xd43b('0x2c')]=qs[_0xd43b('0x2c')](_0x203f6b[_0xd43b('0x49')][_0xd43b('0x2c')]);}_0xfdf1fb[_0xd43b('0x4d')]=qs[_0xd43b('0x4e')](_0x203f6b[_0xd43b('0x49')]['sort']);_0xfdf1fb[_0xd43b('0x4f')]=qs[_0xd43b('0x45')](_[_0xd43b('0x50')](_0x203f6b['query'],_0x55b9b0[_0xd43b('0x45')]));_0xfdf1fb[_0xd43b('0x4f')][_0xd43b('0x6a')]=_0x580c1b['id'];if(_0x203f6b[_0xd43b('0x49')][_0xd43b('0x51')]){_0xfdf1fb[_0xd43b('0x4f')]=_[_0xd43b('0x5b')](_0xfdf1fb[_0xd43b('0x4f')],{'$or':_[_0xd43b('0x43')](_0xfdf1fb['attributes'],function(_0x497358){var _0x15bbcb={};_0x15bbcb[_0x497358]={'$like':'%'+_0x203f6b[_0xd43b('0x49')][_0xd43b('0x51')]+'%'};return _0x15bbcb;})});}_0xfdf1fb=_[_0xd43b('0x5b')]({},_0xfdf1fb,_0x203f6b['options']);return db[_0xd43b('0x68')][_0xd43b('0x2e')]({'where':_0xfdf1fb[_0xd43b('0x4f')]})[_0xd43b('0x33')](function(_0x4415d8){_0x238fe8[_0xd43b('0x2e')]=_0x4415d8;if(_0x203f6b['query'][_0xd43b('0x54')]){_0xfdf1fb[_0xd43b('0x55')]=[{'all':!![]}];}return db[_0xd43b('0x68')][_0xd43b('0x56')](_0xfdf1fb);})['then'](function(_0x44b15){_0x238fe8[_0xd43b('0x57')]=_0x44b15;return _0x238fe8;});}})['then'](respondWithFilteredResult(_0x553995,_0xfdf1fb))['catch'](handleError(_0x553995,null));};exports[_0xd43b('0x6b')]=function(_0x59ac97,_0x2f5e56,_0x1b2665){return db[_0xd43b('0x3d')][_0xd43b('0x65')]({'where':{'id':_0x59ac97[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x2f5e56,null))['then'](function(_0x53dda7){if(_0x53dda7){return _0x53dda7[_0xd43b('0x6b')](_0x59ac97[_0xd43b('0x49')][_0xd43b('0x6c')]);}})[_0xd43b('0x33')](respondWithStatusCode(_0x2f5e56,null))[_0xd43b('0x58')](handleError(_0x2f5e56,null));};exports[_0xd43b('0x6d')]=function(_0x3fce17,_0x59374c,_0x42d17c){if(_0x3fce17['body']['id']){delete _0x3fce17[_0xd43b('0x64')]['id'];}return db[_0xd43b('0x3d')][_0xd43b('0x65')]({'where':{'id':_0x3fce17[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x59374c,null))[_0xd43b('0x33')](function(_0x25a393){if(_0x25a393){_0x3fce17[_0xd43b('0x64')][_0xd43b('0x6a')]=_0x25a393['id'];return db['CannedAnswer'][_0xd43b('0x5c')](_0x3fce17[_0xd43b('0x64')]);}})['then'](respondWithResult(_0x59374c,null))['catch'](handleError(_0x59374c,null));};exports[_0xd43b('0x6e')]=function(_0x3b8713,_0x5cd3d9,_0x5d1b20){var _0x507966={'raw':![],'where':{}};var _0x5c54c6={};var _0x199da6={'count':0x0,'rows':[]};return db[_0xd43b('0x3d')][_0xd43b('0x6f')]({'where':{'id':_0x3b8713[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x5cd3d9,null))[_0xd43b('0x33')](function(_0x34cc69){if(_0x34cc69){_0x5c54c6[_0xd43b('0x42')]=_[_0xd43b('0x44')](db[_0xd43b('0x70')][_0xd43b('0x3e')]);_0x5c54c6['query']=_[_0xd43b('0x44')](_0x3b8713['query']);_0x5c54c6[_0xd43b('0x45')]=_[_0xd43b('0x47')](_0x5c54c6[_0xd43b('0x42')],_0x5c54c6[_0xd43b('0x49')]);_0x507966['attributes']=_[_0xd43b('0x47')](_0x5c54c6[_0xd43b('0x42')],qs[_0xd43b('0x48')](_0x3b8713[_0xd43b('0x49')][_0xd43b('0x48')]));_0x507966[_0xd43b('0x46')]=_0x507966[_0xd43b('0x46')]['length']?_0x507966[_0xd43b('0x46')]:_0x5c54c6[_0xd43b('0x42')];if(!_0x3b8713['query'][_0xd43b('0x4b')](_0xd43b('0x4c'))){_0x507966[_0xd43b('0x2d')]=qs[_0xd43b('0x2d')](_0x3b8713[_0xd43b('0x49')][_0xd43b('0x2d')]);_0x507966[_0xd43b('0x2c')]=qs[_0xd43b('0x2c')](_0x3b8713['query'][_0xd43b('0x2c')]);}_0x507966[_0xd43b('0x4d')]=qs[_0xd43b('0x4e')](_0x3b8713[_0xd43b('0x49')]['sort']);_0x507966[_0xd43b('0x4f')]=qs[_0xd43b('0x45')](_['pick'](_0x3b8713[_0xd43b('0x49')],_0x5c54c6[_0xd43b('0x45')]));_0x507966[_0xd43b('0x4f')][_0xd43b('0x6a')]=_0x34cc69['id'];if(_0x3b8713[_0xd43b('0x49')][_0xd43b('0x51')]){_0x507966[_0xd43b('0x4f')]=_[_0xd43b('0x5b')](_0x507966[_0xd43b('0x4f')],{'$or':_[_0xd43b('0x43')](_0x507966[_0xd43b('0x46')],function(_0xef91ac){var _0x1fff3c={};_0x1fff3c[_0xef91ac]={'$like':'%'+_0x3b8713[_0xd43b('0x49')]['filter']+'%'};return _0x1fff3c;})});}_0x507966=_[_0xd43b('0x5b')]({},_0x507966,_0x3b8713['options']);return db[_0xd43b('0x70')][_0xd43b('0x2e')]({'where':_0x507966[_0xd43b('0x4f')]})['then'](function(_0x228f75){_0x199da6['count']=_0x228f75;if(_0x3b8713[_0xd43b('0x49')][_0xd43b('0x54')]){_0x507966['include']=[{'all':!![]}];}return db[_0xd43b('0x70')][_0xd43b('0x56')](_0x507966);})[_0xd43b('0x33')](function(_0x55d0fc){_0x199da6[_0xd43b('0x57')]=_0x55d0fc;return _0x199da6;});}})[_0xd43b('0x33')](respondWithFilteredResult(_0x5cd3d9,_0x507966))[_0xd43b('0x58')](handleError(_0x5cd3d9,null));};exports[_0xd43b('0x71')]=function(_0x24b080,_0x3cf404,_0x32462c){return db[_0xd43b('0x3d')]['find']({'where':{'id':_0x24b080['params']['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x3cf404,null))['then'](function(_0x41715e){if(_0x41715e){return _0x41715e[_0xd43b('0x71')](_0x24b080[_0xd43b('0x49')][_0xd43b('0x6c')]);}})[_0xd43b('0x33')](respondWithStatusCode(_0x3cf404,null))[_0xd43b('0x58')](handleError(_0x3cf404,null));};exports[_0xd43b('0x72')]=function(_0x53030c,_0x118ab7,_0x2678f){return db[_0xd43b('0x73')][_0xd43b('0x65')]({'where':{'id':_0x53030c[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x118ab7,null))[_0xd43b('0x33')](function(_0x4c6c2b){if(_0x4c6c2b){return _0x4c6c2b[_0xd43b('0x72')](_0x53030c[_0xd43b('0x64')]['ids'],_[_0xd43b('0x74')](_0x53030c['body'],[_0xd43b('0x6c'),'id'])||{});}})[_0xd43b('0x33')](respondWithResult(_0x118ab7,null))[_0xd43b('0x58')](handleError(_0x118ab7,null));};exports[_0xd43b('0x75')]=function(_0x4cc930,_0x50e805,_0xd2b2a9){var _0x225e81={'raw':![],'where':{}};var _0x1ba05f={};var _0x2de87f={'count':0x0,'rows':[]};return db[_0xd43b('0x3d')]['findOne']({'where':{'id':_0x4cc930[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x50e805,null))[_0xd43b('0x33')](function(_0xf1b19e){if(_0xf1b19e){_0x1ba05f['model']=_[_0xd43b('0x44')](db['FaxInteraction']['rawAttributes']);_0x1ba05f['query']=_[_0xd43b('0x44')](_0x4cc930[_0xd43b('0x49')]);_0x1ba05f[_0xd43b('0x45')]=_['intersection'](_0x1ba05f[_0xd43b('0x42')],_0x1ba05f[_0xd43b('0x49')]);_0x225e81['attributes']=_[_0xd43b('0x47')](_0x1ba05f['model'],qs['fields'](_0x4cc930[_0xd43b('0x49')][_0xd43b('0x48')]));_0x225e81[_0xd43b('0x46')]=_0x225e81[_0xd43b('0x46')][_0xd43b('0x4a')]?_0x225e81[_0xd43b('0x46')]:_0x1ba05f['model'];if(!_0x4cc930[_0xd43b('0x49')]['hasOwnProperty'](_0xd43b('0x4c'))){_0x225e81[_0xd43b('0x2d')]=qs['limit'](_0x4cc930[_0xd43b('0x49')][_0xd43b('0x2d')]);_0x225e81['offset']=qs[_0xd43b('0x2c')](_0x4cc930[_0xd43b('0x49')][_0xd43b('0x2c')]);}_0x225e81[_0xd43b('0x4d')]=qs[_0xd43b('0x4e')](_0x4cc930[_0xd43b('0x49')][_0xd43b('0x4e')]);_0x225e81[_0xd43b('0x4f')]=qs['filters'](_[_0xd43b('0x50')](_0x4cc930[_0xd43b('0x49')],_0x1ba05f[_0xd43b('0x45')]));_0x225e81[_0xd43b('0x4f')][_0xd43b('0x6a')]=_0xf1b19e['id'];if(_0x4cc930[_0xd43b('0x49')]['filter']){_0x225e81['where']=_['merge'](_0x225e81[_0xd43b('0x4f')],{'$or':_[_0xd43b('0x43')](_0x225e81[_0xd43b('0x46')],function(_0x11b468){var _0xcfeb36={};_0xcfeb36[_0x11b468]={'$like':'%'+_0x4cc930[_0xd43b('0x49')][_0xd43b('0x51')]+'%'};return _0xcfeb36;})});}_0x225e81=_[_0xd43b('0x5b')]({},_0x225e81,_0x4cc930[_0xd43b('0x53')]);return db[_0xd43b('0x73')][_0xd43b('0x2e')]({'where':_0x225e81[_0xd43b('0x4f')]})[_0xd43b('0x33')](function(_0x3cc7c6){_0x2de87f[_0xd43b('0x2e')]=_0x3cc7c6;if(_0x4cc930[_0xd43b('0x49')]['includeAll']){_0x225e81[_0xd43b('0x55')]=[{'model':db[_0xd43b('0x76')],'as':_0xd43b('0x77'),'required':![]},{'model':db[_0xd43b('0x78')],'as':_0xd43b('0x79'),'attributes':[_0xd43b('0x39'),'fullname',_0xd43b('0x7a')],'required':![]},{'model':db[_0xd43b('0x7b')],'as':'Tags','attributes':['id',_0xd43b('0x39'),'color'],'where':_0x4cc930[_0xd43b('0x49')][_0xd43b('0x7c')]?{'id':_0x4cc930[_0xd43b('0x49')][_0xd43b('0x7c')]}:undefined,'required':_0x4cc930[_0xd43b('0x49')]['tag']?!![]:![]}];}return db[_0xd43b('0x73')][_0xd43b('0x56')](_0x225e81);})[_0xd43b('0x33')](function(_0x4d9cd8){_0x2de87f[_0xd43b('0x57')]=_0x4d9cd8;return _0x2de87f;});}})[_0xd43b('0x33')](respondWithFilteredResult(_0x50e805,_0x225e81))[_0xd43b('0x58')](handleError(_0x50e805,null));};exports[_0xd43b('0x7d')]=function(_0x4dfc84,_0x45fe3b){var _0x437df1=_0x4dfc84['params']['id'];var _0x3d100e=_0x4dfc84[_0xd43b('0x64')];var _0x37105d=0xc8;var _0x575a11=null;return db['sequelize'][_0xd43b('0x7e')]({'isolationLevel':db[_0xd43b('0x7f')][_0xd43b('0x80')][_0xd43b('0x81')][_0xd43b('0x82')]},function(_0x12810d){return db[_0xd43b('0x3d')]['findOne']({'where':{'id':_0x437df1},'transaction':_0x12810d})[_0xd43b('0x33')](function(_0x560564){if(_0x560564){return db[_0xd43b('0x83')][_0xd43b('0x36')]({'where':{'FaxAccountId':_0x437df1},'transaction':_0x12810d})[_0xd43b('0x33')](function(){var _0xa3f79e=_['map'](_0x3d100e,function(_0x5b55e3){_0x5b55e3[_0xd43b('0x6a')]=_0x437df1;return _0x5b55e3;});return db[_0xd43b('0x83')][_0xd43b('0x84')](_0xa3f79e,{'transaction':_0x12810d});});}else{_0x37105d=0x194;_0x575a11=[];}});})[_0xd43b('0x33')](function(){if(_0x37105d!==0x194){return db[_0xd43b('0x83')][_0xd43b('0x85')]({'where':{'FaxAccountId':_0x437df1},'order':_0xd43b('0x86')})[_0xd43b('0x33')](function(_0x488df9){_0x575a11=_0x488df9;});}})[_0xd43b('0x58')](function(_0x232718){_0x37105d=0x1f4;logger[_0xd43b('0x24')](_0x232718[_0xd43b('0x38')]);if(_0x232718['name']){delete _0x232718[_0xd43b('0x39')];}_0x575a11=_0x232718;})['finally'](function(){if(_0x575a11===null){_0x45fe3b[_0xd43b('0x29')](_0x37105d);}else{if(_0x37105d===0x1f4){_0x45fe3b[_0xd43b('0x2a')](_0x37105d)['send'](_0x575a11);}else{_0x45fe3b['status'](_0x37105d)[_0xd43b('0x2b')](_0x575a11);}}});};exports['getApplications']=function(_0x12e27a,_0x34fa9b,_0x2e7781){var _0x1f8085={};var _0x6a6f7e={};var _0x3d9128;var _0x3d917f;return db['FaxAccount'][_0xd43b('0x6f')]({'where':{'id':_0x12e27a[_0xd43b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x34fa9b,null))[_0xd43b('0x33')](function(_0x6eca12){if(_0x6eca12){_0x3d9128=_0x6eca12;_0x6a6f7e[_0xd43b('0x42')]=_[_0xd43b('0x44')](db[_0xd43b('0x83')][_0xd43b('0x3e')]);_0x6a6f7e[_0xd43b('0x49')]=_[_0xd43b('0x44')](_0x12e27a['query']);_0x6a6f7e[_0xd43b('0x45')]=_[_0xd43b('0x47')](_0x6a6f7e[_0xd43b('0x42')],_0x6a6f7e[_0xd43b('0x49')]);_0x1f8085[_0xd43b('0x46')]=_[_0xd43b('0x47')](_0x6a6f7e[_0xd43b('0x42')],qs[_0xd43b('0x48')](_0x12e27a[_0xd43b('0x49')][_0xd43b('0x48')]));_0x1f8085['attributes']=_0x1f8085[_0xd43b('0x46')][_0xd43b('0x4a')]?_0x1f8085[_0xd43b('0x46')]:_0x6a6f7e[_0xd43b('0x42')];_0x1f8085[_0xd43b('0x4d')]=qs[_0xd43b('0x4e')](_0x12e27a['query'][_0xd43b('0x4e')]);_0x1f8085[_0xd43b('0x4f')]=qs[_0xd43b('0x45')](_[_0xd43b('0x50')](_0x12e27a[_0xd43b('0x49')],_0x6a6f7e[_0xd43b('0x45')]));if(_0x12e27a[_0xd43b('0x49')][_0xd43b('0x51')]){_0x1f8085[_0xd43b('0x4f')]=_[_0xd43b('0x5b')](_0x1f8085[_0xd43b('0x4f')],{'$or':_[_0xd43b('0x43')](_0x1f8085[_0xd43b('0x46')],function(_0x56f20a){var _0x28f2e4={};_0x28f2e4[_0x56f20a]={'$like':'%'+_0x12e27a[_0xd43b('0x49')][_0xd43b('0x51')]+'%'};return _0x28f2e4;})});}_0x1f8085=_[_0xd43b('0x5b')]({},_0x1f8085,_0x12e27a['options']);return _0x3d9128[_0xd43b('0x87')](_0x1f8085);}})[_0xd43b('0x33')](function(_0x1f7366){if(_0x1f7366){_0x3d917f=_0x1f7366[_0xd43b('0x4a')];if(!_0x12e27a[_0xd43b('0x49')][_0xd43b('0x4b')](_0xd43b('0x4c'))){_0x1f8085['limit']=qs['limit'](_0x12e27a[_0xd43b('0x49')][_0xd43b('0x2d')]);_0x1f8085[_0xd43b('0x2c')]=qs[_0xd43b('0x2c')](_0x12e27a[_0xd43b('0x49')][_0xd43b('0x2c')]);}return _0x3d9128[_0xd43b('0x87')](_0x1f8085);}})[_0xd43b('0x33')](function(_0x2d266c){if(_0x2d266c){return _0x2d266c?{'count':_0x3d917f,'rows':_0x2d266c}:null;}})[_0xd43b('0x33')](respondWithResult(_0x34fa9b,null))[_0xd43b('0x58')](handleError(_0x34fa9b,null));};function Extension(_0x3f3cd7,_0x151148,_0x33ae93,_0x2c546f){this[_0xd43b('0x88')]='from-voip-provider';this[_0xd43b('0x89')]=_0x3f3cd7[_0xd43b('0x8a')];this['app']=_0x2c546f;this[_0xd43b('0x40')]=_0xd43b('0x8b');this[_0xd43b('0x8c')]=_0xd43b('0x8d');this['FaxAccountId']=_0x3f3cd7['id'];this[_0xd43b('0x86')]=_0x151148;this[_0xd43b('0x8e')]=_0x33ae93;}function createExtensionsReciveFax(_0xa86fbb){var _0xf0249d=0x1;var _0x1be7f2=[];_0x1be7f2[_0xd43b('0x8f')](new Extension(_0xa86fbb,_0xf0249d,'',_0xd43b('0x90')));_0xf0249d+=0x1;_0x1be7f2['push'](new Extension(_0xa86fbb,_0xf0249d,_0xd43b('0x91'),'Set'));_0xf0249d+=0x1;for(var _0x22dcf0 in _0xa86fbb){if(_0xa86fbb[_0xd43b('0x4b')](_0x22dcf0)&&(_0x22dcf0==='ecm'||_0x22dcf0===_0xd43b('0x8a')||_0x22dcf0==='gateway'||_0x22dcf0===_0xd43b('0x92')||_0x22dcf0==='headerinfo'||_0x22dcf0===_0xd43b('0x93')||_0x22dcf0===_0xd43b('0x94')||_0x22dcf0==='modem'||_0x22dcf0===_0xd43b('0x95'))){_0x1be7f2[_0xd43b('0x8f')](new Extension(_0xa86fbb,_0xf0249d,_0xd43b('0x96')+_0x22dcf0+')='+_0xa86fbb[_0x22dcf0],_0xd43b('0x97')));_0xf0249d+=0x1;}}_0x1be7f2[_0xd43b('0x8f')](new Extension(_0xa86fbb,_0xf0249d,'6',_0xd43b('0x98')));_0xf0249d+=0x1;_0x1be7f2[_0xd43b('0x8f')](new Extension(_0xa86fbb,_0xf0249d,_0xd43b('0x99'),_0xd43b('0x9a')));_0xf0249d=0x0;return _0x1be7f2;}exports['addAccountApplications']=function(_0x3acc8d,_0x984619,_0x2f8c96){var _0x128628;return db[_0xd43b('0x7f')][_0xd43b('0x7e')](function(_0x438635){return db[_0xd43b('0x3d')][_0xd43b('0x5c')](_0x3acc8d[_0xd43b('0x64')],{'transaction':_0x438635})[_0xd43b('0x33')](function(_0x515ecc){_0x128628=_0x515ecc[_0xd43b('0x60')]({'plain':!![]});return db[_0xd43b('0x9b')][_0xd43b('0x84')](createExtensionsReciveFax(_0x128628),{'transaction':_0x438635});});})[_0xd43b('0x33')](function(){return _0x128628;})[_0xd43b('0x33')](respondWithResult(_0x984619,null))[_0xd43b('0x58')](handleError(_0x984619,null));};exports[_0xd43b('0x9c')]=function(_0x3b680b,_0xccad96,_0x11f05){var _0x47f3a1;return db[_0xd43b('0x7f')][_0xd43b('0x7e')](function(_0x4ba792){return db[_0xd43b('0x3d')][_0xd43b('0x63')](_0x3b680b['body'],{'where':{'id':_0x3b680b[_0xd43b('0x64')]['id']},'transaction':_0x4ba792})[_0xd43b('0x33')](function(_0x31cd66){return db[_0xd43b('0x9b')][_0xd43b('0x36')]({'where':{'FaxAccountId':_0x3b680b['body']['id']},'transaction':_0x4ba792})['then'](function(_0x311be4){return db[_0xd43b('0x9b')][_0xd43b('0x84')](createExtensionsReciveFax(_[_0xd43b('0x74')](_0x3b680b[_0xd43b('0x64')],['tech',_0xd43b('0x41'),_0xd43b('0x9d'),'updatedAt',_0xd43b('0x9e'),_0xd43b('0x9f')])),{'transaction':_0x4ba792});});});})[_0xd43b('0x33')](function(){return db[_0xd43b('0x3d')][_0xd43b('0xa0')](_0x3b680b[_0xd43b('0x64')]['id']);})['then'](respondWithResult(_0xccad96,null))[_0xd43b('0x58')](handleError(_0xccad96,null));};exports[_0xd43b('0xa1')]=function(_0x43a96f,_0x125d7c,_0x56557a){var _0x31c87c={'raw':!![],'where':{}};var _0x5bb626={};var _0x14e174={'count':0x0,'rows':[]};return db[_0xd43b('0x3d')][_0xd43b('0x6f')]({'where':{'id':_0x43a96f['params']['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x125d7c,null))[_0xd43b('0x33')](function(_0x5997df){if(_0x5997df){_0x5bb626[_0xd43b('0x42')]=_[_0xd43b('0x44')](db[_0xd43b('0xa2')]['rawAttributes']);_0x5bb626['query']=_[_0xd43b('0x44')](_0x43a96f[_0xd43b('0x49')]);_0x5bb626[_0xd43b('0x45')]=_[_0xd43b('0x47')](_0x5bb626[_0xd43b('0x42')],_0x5bb626[_0xd43b('0x49')]);_0x31c87c[_0xd43b('0x46')]=_[_0xd43b('0x47')](_0x5bb626['model'],qs[_0xd43b('0x48')](_0x43a96f[_0xd43b('0x49')][_0xd43b('0x48')]));_0x31c87c[_0xd43b('0x46')]=_0x31c87c[_0xd43b('0x46')][_0xd43b('0x4a')]?_0x31c87c['attributes']:_0x5bb626['model'];if(!_0x43a96f[_0xd43b('0x49')][_0xd43b('0x4b')]('nolimit')){_0x31c87c[_0xd43b('0x2d')]=qs[_0xd43b('0x2d')](_0x43a96f[_0xd43b('0x49')]['limit']);_0x31c87c[_0xd43b('0x2c')]=qs[_0xd43b('0x2c')](_0x43a96f[_0xd43b('0x49')][_0xd43b('0x2c')]);}_0x31c87c[_0xd43b('0x4d')]=qs[_0xd43b('0x4e')](_0x43a96f[_0xd43b('0x49')][_0xd43b('0x4e')]);_0x31c87c[_0xd43b('0x4f')]=qs[_0xd43b('0x45')](_[_0xd43b('0x50')](_0x43a96f[_0xd43b('0x49')],_0x5bb626[_0xd43b('0x45')]));_0x31c87c[_0xd43b('0x4f')][_0xd43b('0x6a')]=_0x5997df['id'];if(_0x43a96f[_0xd43b('0x49')]['filter']){_0x31c87c['where']=_['merge'](_0x31c87c[_0xd43b('0x4f')],{'$or':_[_0xd43b('0x43')](_0x31c87c['attributes'],function(_0xd6541e){var _0x5b13ea={};_0x5b13ea[_0xd6541e]={'$like':'%'+_0x43a96f[_0xd43b('0x49')][_0xd43b('0x51')]+'%'};return _0x5b13ea;})});}if(_0x43a96f['query']['$gte']){var _0x25dc82=_0x43a96f['query'][_0xd43b('0xa3')][_0xd43b('0xa4')](',');var _0x4b5909={};_0x4b5909[_0x25dc82[0x0]]={'$gte':moment(_0x25dc82[0x1])[_0xd43b('0xa5')](_0xd43b('0xa6'))};_0x31c87c[_0xd43b('0x4f')]=_[_0xd43b('0x5b')](_0x31c87c['where'],_0x4b5909);}_0x31c87c=_['merge']({},_0x31c87c,_0x43a96f[_0xd43b('0x53')]);return db['FaxMessage']['count']({'where':_0x31c87c[_0xd43b('0x4f')]})[_0xd43b('0x33')](function(_0xe6c9f4){_0x14e174[_0xd43b('0x2e')]=_0xe6c9f4;if(_0x43a96f['query'][_0xd43b('0x54')]){_0x31c87c[_0xd43b('0x55')]=[{'all':!![]}];}return db[_0xd43b('0xa2')]['findAll'](_0x31c87c);})['then'](function(_0x2c429f){_0x14e174[_0xd43b('0x57')]=_0x2c429f;return _0x14e174;});}})[_0xd43b('0x33')](respondWithFilteredResult(_0x125d7c,_0x31c87c))['catch'](handleError(_0x125d7c,null));};exports[_0xd43b('0x3a')]=function(_0x560a24,_0x3ce81e,_0x3cfaf9){var _0x1dbd4d,_0x49f6fe={},_0x4909fa;if(_0x560a24[_0xd43b('0x64')]['to']){_0x4909fa=_0x560a24[_0xd43b('0x64')]['to'][0x0];}return db[_0xd43b('0x3d')][_0xd43b('0x65')]({'where':{'id':_0x560a24[_0xd43b('0x5a')]['id']},'include':[{'model':db[_0xd43b('0xa7')],'as':'List','include':[{'model':db[_0xd43b('0x76')],'as':_0xd43b('0xa8'),'where':{'fax':_0x4909fa},'limit':0x1,'order':[[_0xd43b('0xa9'),_0xd43b('0xaa')]]}]}]})[_0xd43b('0x33')](handleEntityNotFound(_0x3ce81e,null))[_0xd43b('0x33')](function(_0x3edc3c){_0x1dbd4d=_0x3edc3c;if(_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')]&&_0x560a24['body'][_0xd43b('0xab')]['length']){for(var _0xbf29a2=0x0;_0xbf29a2<_0x560a24['body']['attachments'][_0xd43b('0x4a')];_0xbf29a2+=0x1){_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')][_0xbf29a2]={'filename':_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')][_0xbf29a2][_0xd43b('0x39')],'id':_0x560a24[_0xd43b('0x64')]['attachments'][_0xbf29a2]['id'],'path':path[_0xd43b('0xac')](config[_0xd43b('0xad')],'server/files/attachments',_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')][_0xbf29a2][_0xd43b('0xae')])};}}return respondWithRpcPromise(_0xd43b('0xaf'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x560a24[_0xd43b('0x5a')]['id'])?undefined:_0x560a24[_0xd43b('0x5a')]['id'],'path':_[_0xd43b('0xb0')](_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')][0x0][_0xd43b('0xb1')])?undefined:_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')][0x0][_0xd43b('0xb1')],'fax':_['isNil'](_0x560a24[_0xd43b('0x64')]['to'][0x0])?undefined:_0x560a24[_0xd43b('0x64')]['to'][0x0]},client9002);})[_0xd43b('0x33')](function(){if(_0x1dbd4d){if(_[_0xd43b('0xb0')](_0x560a24[_0xd43b('0x64')][_0xd43b('0xb2')])){_0x560a24[_0xd43b('0x64')][_0xd43b('0xb2')]=util[_0xd43b('0xa5')]('\x22%s\x22\x20<%s>',_0x1dbd4d[_0xd43b('0x39')],_0x1dbd4d['fax']);}if(_0x1dbd4d[_0xd43b('0xb3')]){if(_0x1dbd4d[_0xd43b('0xb3')][_0xd43b('0xa8')][_0xd43b('0x4a')]){return _0x1dbd4d['List'][_0xd43b('0xa8')][0x0];}else{return db['CmContact'][_0xd43b('0x5c')](_[_0xd43b('0x1c')](_0x560a24[_0xd43b('0x64')],{'firstName':_0x560a24[_0xd43b('0x64')]['to'][0x0],'phone':_0x560a24[_0xd43b('0x64')]['to'][0x0],'fax':_0x560a24[_0xd43b('0x64')]['to'][0x0],'ListId':_0x1dbd4d[_0xd43b('0x9f')]}));}}else{throw new Error(_0xd43b('0xb4'));}}else{throw new Error(_0xd43b('0xb5'));}})[_0xd43b('0x33')](function(_0x4fd7e3){if(_0x4fd7e3){return db[_0xd43b('0x73')][_0xd43b('0x65')]({'where':{'ContactId':_0x4fd7e3['id'],'closed':![],'FaxAccountId':_0x1dbd4d['id']}})[_0xd43b('0x33')](function(_0x3ee541){if(_0x3ee541){return[_0x3ee541,![]];}return db['FaxInteraction'][_0xd43b('0x5c')]({'UserId':_0x560a24['user']['id'],'ContactId':_0x4fd7e3['id'],'FaxAccountId':_0x1dbd4d['id'],'fax':_0x560a24[_0xd43b('0x64')]['to'][0x0],'firstMsgDirection':_0xd43b('0xb6'),'Messages':[_[_0xd43b('0x5b')](_0x560a24[_0xd43b('0x64')],{'read':![],'body':_0x560a24['body'][_0xd43b('0xab')][0x0][_0xd43b('0xb7')],'FaxAccountId':_0x1dbd4d['id'],'UserId':_0x560a24[_0xd43b('0x5d')]['id'],'ContactId':_0x4fd7e3['id'],'AttachmentId':_0x560a24['body'][_0xd43b('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xd43b('0xa2')],'as':_0xd43b('0xb8')}]})[_0xd43b('0x33')](function(_0x373f58){return[_0x373f58,!![]];});});}else{throw new Error(_0xd43b('0xb9'));}})[_0xd43b('0xba')](function(_0x2ac6a0,_0x1ca378){if(_0x1ca378){return _0x2ac6a0;}return db[_0xd43b('0xa2')]['create']({'direction':_0xd43b('0xb6'),'read':![],'body':_0x560a24['body']['attachments'][0x0][_0xd43b('0xb7')],'FaxAccountId':_0x1dbd4d['id'],'FaxInteractionId':_0x2ac6a0['id'],'UserId':_0x560a24['user']['id'],'ContactId':_0x2ac6a0[_0xd43b('0xbb')],'AttachmentId':_0x560a24['body'][_0xd43b('0xab')][0x0]['id']})[_0xd43b('0x33')](function(_0x321d9e){_0x2ac6a0[_0xd43b('0xbc')][_0xd43b('0xb8')]=[];_0x2ac6a0[_0xd43b('0xbc')][_0xd43b('0xb8')][_0xd43b('0x8f')](_0x321d9e[_0xd43b('0xbc')]);return _0x2ac6a0;});})[_0xd43b('0x33')](function(_0x3eb8f5){respondWithRpcPromise(_0xd43b('0xbd'),'SendFax',{'FaxAccountId':_[_0xd43b('0xb0')](_0x560a24[_0xd43b('0x5a')]['id'])?undefined:_0x560a24[_0xd43b('0x5a')]['id'],'path':_['isNil'](_0x560a24['body']['attachments'][0x0][_0xd43b('0xb1')])?undefined:_0x560a24['body']['attachments'][0x0][_0xd43b('0xb1')],'fax':_['isNil'](_0x560a24['body']['to'][0x0])?undefined:_0x560a24[_0xd43b('0x64')]['to'][0x0],'AttachmentId':_0x560a24[_0xd43b('0x64')][_0xd43b('0xab')][0x0]['id']},client9002)[_0xd43b('0x33')](function(_0x2bfb68){logger[_0xd43b('0x26')](_0xd43b('0xbe'),_0x2bfb68);})[_0xd43b('0x58')](function(_0x189b84){logger[_0xd43b('0x26')](_0xd43b('0xbe'),_0x189b84);});return _0x3eb8f5;})[_0xd43b('0x33')](respondWithResult(_0x3ce81e,null))[_0xd43b('0x58')](handleError(_0x3ce81e,null));};exports[_0xd43b('0xbf')]=function(_0x2f0201,_0x513f87,_0x4a2ec7){return db['FaxAccount'][_0xd43b('0x65')]({'where':{'id':_0x2f0201[_0xd43b('0x5a')]['id']}})[_0xd43b('0x33')](handleEntityNotFound(_0x513f87,null))['then'](function(_0x580d9f){if(_0x580d9f){return _0x580d9f[_0xd43b('0xbf')](_0x2f0201[_0xd43b('0x64')][_0xd43b('0x6c')],_[_0xd43b('0x74')](_0x2f0201[_0xd43b('0x64')],['ids','id'])||{})[_0xd43b('0xba')](function(_0x2dbc43){for(var _0x58c2a8=0x0;_0x58c2a8<_0x2f0201[_0xd43b('0x64')][_0xd43b('0x6c')]['length'];_0x58c2a8+=0x1){socket[_0xd43b('0xc0')](_0xd43b('0xc1'),{'UserId':Number(_0x2f0201['body'][_0xd43b('0x6c')][_0x58c2a8]),'FaxAccountId':Number(_0x2f0201['params']['id'])});}return _0x2dbc43;});}})[_0xd43b('0x33')](respondWithResult(_0x513f87,null))['catch'](handleError(_0x513f87,null));};exports[_0xd43b('0xc2')]=function(_0x55672c,_0x395462,_0x5e3162){return db[_0xd43b('0x3d')][_0xd43b('0x65')]({'where':{'id':_0x55672c[_0xd43b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x395462,null))['then'](function(_0x790779){if(_0x790779){return _0x790779[_0xd43b('0xc2')](_0x55672c[_0xd43b('0x49')][_0xd43b('0x6c')])['then'](function(){if(_[_0xd43b('0xc3')](_0x55672c[_0xd43b('0x49')][_0xd43b('0x6c')])){for(var _0x1b6415=0x0;_0x1b6415<_0x55672c['query'][_0xd43b('0x6c')][_0xd43b('0x4a')];_0x1b6415+=0x1){socket[_0xd43b('0xc0')]('userFaxAccount:remove',{'UserId':Number(_0x55672c[_0xd43b('0x49')][_0xd43b('0x6c')][_0x1b6415]),'FaxAccountId':Number(_0x55672c[_0xd43b('0x5a')]['id'])});}}else{socket[_0xd43b('0xc0')](_0xd43b('0xc4'),{'UserId':Number(_0x55672c[_0xd43b('0x49')]['ids']),'FaxAccountId':Number(_0x55672c[_0xd43b('0x5a')]['id'])});}});}})[_0xd43b('0x33')](respondWithStatusCode(_0x395462,null))[_0xd43b('0x58')](handleError(_0x395462,null));};exports['getAgents']=function(_0x2a35cb,_0x2ff905,_0x113623){var _0x1a8963={};var _0x449890={};var _0x37d05a;var _0x33ba55;return db[_0xd43b('0x3d')][_0xd43b('0x6f')]({'where':{'id':_0x2a35cb[_0xd43b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2ff905,null))[_0xd43b('0x33')](function(_0x492e8c){if(_0x492e8c){_0x37d05a=_0x492e8c;_0x449890[_0xd43b('0x42')]=_['keys'](db[_0xd43b('0x78')]['rawAttributes']);_0x449890[_0xd43b('0x49')]=_[_0xd43b('0x44')](_0x2a35cb[_0xd43b('0x49')]);_0x449890['filters']=_[_0xd43b('0x47')](_0x449890['model'],_0x449890[_0xd43b('0x49')]);_0x1a8963[_0xd43b('0x46')]=_[_0xd43b('0x47')](_0x449890[_0xd43b('0x42')],qs[_0xd43b('0x48')](_0x2a35cb[_0xd43b('0x49')]['fields']));_0x1a8963[_0xd43b('0x46')]=_0x1a8963[_0xd43b('0x46')][_0xd43b('0x4a')]?_0x1a8963[_0xd43b('0x46')]:_0x449890[_0xd43b('0x42')];_0x1a8963['order']=qs[_0xd43b('0x4e')](_0x2a35cb[_0xd43b('0x49')][_0xd43b('0x4e')]);_0x1a8963['where']=qs[_0xd43b('0x45')](_[_0xd43b('0x50')](_0x2a35cb[_0xd43b('0x49')],_0x449890[_0xd43b('0x45')]));if(_0x2a35cb[_0xd43b('0x49')][_0xd43b('0x51')]){_0x1a8963[_0xd43b('0x4f')]=_[_0xd43b('0x5b')](_0x1a8963[_0xd43b('0x4f')],{'$or':_[_0xd43b('0x43')](_0x1a8963[_0xd43b('0x46')],function(_0xbcb85a){var _0x406db3={};_0x406db3[_0xbcb85a]={'$like':'%'+_0x2a35cb[_0xd43b('0x49')][_0xd43b('0x51')]+'%'};return _0x406db3;})});}_0x1a8963=_[_0xd43b('0x5b')]({},_0x1a8963,_0x2a35cb['options']);return _0x37d05a[_0xd43b('0xc5')](_0x1a8963);}})[_0xd43b('0x33')](function(_0x305c74){if(_0x305c74){_0x33ba55=_0x305c74[_0xd43b('0x4a')];if(!_0x2a35cb[_0xd43b('0x49')][_0xd43b('0x4b')](_0xd43b('0x4c'))){_0x1a8963[_0xd43b('0x2d')]=qs['limit'](_0x2a35cb[_0xd43b('0x49')]['limit']);_0x1a8963['offset']=qs[_0xd43b('0x2c')](_0x2a35cb['query'][_0xd43b('0x2c')]);}return _0x37d05a[_0xd43b('0xc5')](_0x1a8963);}})['then'](function(_0x5cfd99){if(_0x5cfd99){return _0x5cfd99?{'count':_0x33ba55,'rows':_0x5cfd99}:null;}})['then'](respondWithResult(_0x2ff905,null))[_0xd43b('0x58')](handleError(_0x2ff905,null));}; \ No newline at end of file +var _0x172d=['../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','UserProfileResource','destroy','end','stack','name','send','index','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','Pause','mandatoryDispositionPause','find','create','body','user','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','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','get','VoiceExtension','updateAccountApplications','bulkCreate','key','createdAt','updatedAt','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x172d,0xb5));var _0xd172=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x172d[_0x64aff8];return _0x5488a3;};'use strict';var emlformat=require(_0xd172('0x0'));var rimraf=require(_0xd172('0x1'));var zipdir=require(_0xd172('0x2'));var jsonpatch=require(_0xd172('0x3'));var rp=require(_0xd172('0x4'));var moment=require(_0xd172('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd172('0x6'));var path=require(_0xd172('0x7'));var sox=require(_0xd172('0x8'));var csv=require('to-csv');var ejs=require(_0xd172('0x9'));var fs=require('fs');var fs_extra=require(_0xd172('0xa'));var _=require(_0xd172('0xb'));var squel=require('squel');var crypto=require(_0xd172('0xc'));var jsforce=require(_0xd172('0xd'));var deskjs=require(_0xd172('0xe'));var toCsv=require(_0xd172('0xf'));var querystring=require('querystring');var Papa=require(_0xd172('0x10'));var Redis=require(_0xd172('0x11'));var authService=require(_0xd172('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd172('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd172('0x14'));var config=require(_0xd172('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd172('0x16'))['db'];config['redis']=_['defaults'](config[_0xd172('0x17')],{'host':_0xd172('0x18'),'port':0x18eb});var socket=require(_0xd172('0x19'))(new Redis(config[_0xd172('0x17')]));require(_0xd172('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd172('0x1b')][_0xd172('0x1c')]({'port':0x232c});var client9002=jayson[_0xd172('0x1b')][_0xd172('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x55b194,_0x41a28d,_0x28641e,_0x31df17){return new BPromise(function(_0xa841f,_0x1d142d){var _0x16c966=_0x31df17||client;return _0x16c966[_0xd172('0x1d')](_0x55b194,_0x28641e)[_0xd172('0x1e')](function(_0x420f5c){logger[_0xd172('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x41a28d,_0xd172('0x20'));logger[_0xd172('0x21')](_0xd172('0x22'),_0x41a28d,_0xd172('0x20'),JSON[_0xd172('0x23')](_0x420f5c));if(_0x420f5c[_0xd172('0x24')]){if(_0x420f5c['error'][_0xd172('0x25')]===0x1f4){logger['error'](_0xd172('0x26'),_0x41a28d,_0x420f5c[_0xd172('0x24')][_0xd172('0x27')]);return _0x1d142d(_0x420f5c['error'][_0xd172('0x27')]);}logger[_0xd172('0x24')](_0xd172('0x26'),_0x41a28d,_0x420f5c['error'][_0xd172('0x27')]);return _0xa841f(_0x420f5c[_0xd172('0x24')][_0xd172('0x27')]);}else{logger[_0xd172('0x1f')](_0xd172('0x26'),_0x41a28d,_0xd172('0x20'));_0xa841f(_0x420f5c[_0xd172('0x28')][_0xd172('0x27')]);}})[_0xd172('0x29')](function(_0x45cbe7){logger[_0xd172('0x24')]('FaxAccount,\x20%s,\x20%s',_0x41a28d,_0x45cbe7);_0x1d142d(_0x45cbe7);});});}function respondWithStatusCode(_0x458edf,_0x3c8da7){_0x3c8da7=_0x3c8da7||0xcc;return function(_0x2fcb6b){if(_0x2fcb6b){return _0x458edf[_0xd172('0x2a')](_0x3c8da7);}return _0x458edf[_0xd172('0x2b')](_0x3c8da7)['end']();};}function respondWithResult(_0x2de5ed,_0x3d6a50){_0x3d6a50=_0x3d6a50||0xc8;return function(_0x3713cd){if(_0x3713cd){return _0x2de5ed[_0xd172('0x2b')](_0x3d6a50)[_0xd172('0x2c')](_0x3713cd);}};}function respondWithFilteredResult(_0x589e5b,_0x1891e7){return function(_0x332dbc){if(_0x332dbc){var _0x1d8ea8=typeof _0x1891e7[_0xd172('0x2d')]==='undefined'&&typeof _0x1891e7[_0xd172('0x2e')]===_0xd172('0x2f');var _0x4bede9=_0x332dbc[_0xd172('0x30')];var _0x496159=_0x1d8ea8?0x0:_0x1891e7[_0xd172('0x2d')];var _0x249cba=_0x1d8ea8?_0x332dbc[_0xd172('0x30')]:_0x1891e7['offset']+_0x1891e7[_0xd172('0x2e')];var _0x78f4d7;if(_0x249cba>=_0x4bede9){_0x249cba=_0x4bede9;_0x78f4d7=0xc8;}else{_0x78f4d7=0xce;}_0x589e5b[_0xd172('0x2b')](_0x78f4d7);return _0x589e5b[_0xd172('0x31')](_0xd172('0x32'),_0x496159+'-'+_0x249cba+'/'+_0x4bede9)[_0xd172('0x2c')](_0x332dbc);}return null;};}function patchUpdates(_0x4d8828){return function(_0x4f73e4){try{jsonpatch['apply'](_0x4f73e4,_0x4d8828,!![]);}catch(_0x1bc1d4){return BPromise['reject'](_0x1bc1d4);}return _0x4f73e4['save']();};}function saveUpdates(_0x3c0636,_0x17d84e){return function(_0x365f89){if(_0x365f89){return _0x365f89[_0xd172('0x33')](_0x3c0636)[_0xd172('0x1e')](function(_0x3f6c31){return _0x3f6c31;});}return null;};}function removeEntity(_0x2409a9,_0x28aa45){return function(_0x202fd6){if(_0x202fd6){return _0x202fd6['destroy']()[_0xd172('0x1e')](function(){var _0x212e20=_0x202fd6['get']({'plain':!![]});var _0xf393a8='FaxAccounts';return db[_0xd172('0x34')][_0xd172('0x35')]({'where':{'type':_0xf393a8,'resourceId':_0x212e20['id']}})['then'](function(){return _0x202fd6;});})[_0xd172('0x1e')](function(){_0x2409a9[_0xd172('0x2b')](0xcc)[_0xd172('0x36')]();});}};}function handleEntityNotFound(_0x5911c5,_0x3a0883){return function(_0x5af7cf){if(!_0x5af7cf){_0x5911c5[_0xd172('0x2a')](0x194);}return _0x5af7cf;};}function handleError(_0x5c54fd,_0x37533d){_0x37533d=_0x37533d||0x1f4;return function(_0x5d3983){logger['error'](_0x5d3983[_0xd172('0x37')]);if(_0x5d3983[_0xd172('0x38')]){delete _0x5d3983[_0xd172('0x38')];}_0x5c54fd[_0xd172('0x2b')](_0x37533d)[_0xd172('0x39')](_0x5d3983);};}exports[_0xd172('0x3a')]=function(_0x25eef4,_0x7986be){var _0x344230={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5389cf={},_0x251dc8={'count':0x0,'rows':[]};var _0x4b3f82=_[_0xd172('0x3b')](db[_0xd172('0x3c')][_0xd172('0x3d')],function(_0x3142c0){return{'name':_0x3142c0[_0xd172('0x3e')],'type':_0x3142c0[_0xd172('0x3f')]['key']};});_0x5389cf[_0xd172('0x40')]=_[_0xd172('0x3b')](_0x4b3f82,_0xd172('0x38'));_0x5389cf[_0xd172('0x41')]=_[_0xd172('0x42')](_0x25eef4[_0xd172('0x41')]);_0x5389cf[_0xd172('0x43')]=_['intersection'](_0x5389cf[_0xd172('0x40')],_0x5389cf[_0xd172('0x41')]);_0x344230[_0xd172('0x44')]=_[_0xd172('0x45')](_0x5389cf['model'],qs[_0xd172('0x46')](_0x25eef4[_0xd172('0x41')]['fields']));_0x344230[_0xd172('0x44')]=_0x344230[_0xd172('0x44')][_0xd172('0x47')]?_0x344230['attributes']:_0x5389cf[_0xd172('0x40')];if(!_0x25eef4[_0xd172('0x41')][_0xd172('0x48')](_0xd172('0x49'))){_0x344230[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0x25eef4[_0xd172('0x41')][_0xd172('0x2e')]);_0x344230[_0xd172('0x2d')]=qs[_0xd172('0x2d')](_0x25eef4[_0xd172('0x41')]['offset']);}_0x344230['order']=qs[_0xd172('0x4a')](_0x25eef4['query'][_0xd172('0x4a')]);_0x344230['where']=qs[_0xd172('0x43')](_[_0xd172('0x4b')](_0x25eef4[_0xd172('0x41')],_0x5389cf[_0xd172('0x43')]),_0x4b3f82);if(_0x25eef4['query'][_0xd172('0x4c')]){_0x344230['where']=_['merge'](_0x344230[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x4b3f82,function(_0x4b6023){if(_0x4b6023[_0xd172('0x3f')]!==_0xd172('0x4e')){var _0x138a59={};_0x138a59[_0x4b6023[_0xd172('0x38')]]={'$like':'%'+_0x25eef4['query'][_0xd172('0x4c')]+'%'};return _0x138a59;}})});}_0x344230=_[_0xd172('0x4f')]({},_0x344230,_0x25eef4[_0xd172('0x50')]);var _0x57d77d={'where':_0x344230[_0xd172('0x4d')]};return db[_0xd172('0x3c')][_0xd172('0x30')](_0x57d77d)[_0xd172('0x1e')](function(_0x402e1a){_0x251dc8[_0xd172('0x30')]=_0x402e1a;if(_0x25eef4['query'][_0xd172('0x51')]){_0x344230[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0x3c')][_0xd172('0x53')](_0x344230);})['then'](function(_0x59c8e6){_0x251dc8[_0xd172('0x54')]=_0x59c8e6;return _0x251dc8;})[_0xd172('0x1e')](respondWithFilteredResult(_0x7986be,_0x344230))[_0xd172('0x29')](handleError(_0x7986be,null));};exports['show']=function(_0x33720a,_0x438e96){var _0x858c01={'raw':![],'where':{'id':_0x33720a['params']['id']},'include':[{'model':db[_0xd172('0x55')],'as':_0xd172('0x56')}]},_0x344670={};_0x344670[_0xd172('0x40')]=_[_0xd172('0x42')](db[_0xd172('0x3c')][_0xd172('0x3d')]);_0x344670[_0xd172('0x41')]=_['keys'](_0x33720a[_0xd172('0x41')]);_0x344670[_0xd172('0x43')]=_[_0xd172('0x45')](_0x344670[_0xd172('0x40')],_0x344670['query']);_0x858c01[_0xd172('0x44')]=_[_0xd172('0x45')](_0x344670[_0xd172('0x40')],qs[_0xd172('0x46')](_0x33720a[_0xd172('0x41')][_0xd172('0x46')]));_0x858c01['attributes']=_0x858c01[_0xd172('0x44')][_0xd172('0x47')]?_0x858c01['attributes']:_0x344670[_0xd172('0x40')];if(_0x33720a[_0xd172('0x41')][_0xd172('0x51')]){_0x858c01['include']=[{'all':!![]}];}_0x858c01=_['merge']({},_0x858c01,_0x33720a['options']);return db[_0xd172('0x3c')][_0xd172('0x57')](_0x858c01)[_0xd172('0x1e')](handleEntityNotFound(_0x438e96,null))[_0xd172('0x1e')](respondWithResult(_0x438e96,null))[_0xd172('0x29')](handleError(_0x438e96,null));};exports[_0xd172('0x58')]=function(_0x5dd10b,_0x57487a){return db[_0xd172('0x3c')]['create'](_0x5dd10b[_0xd172('0x59')],{})[_0xd172('0x1e')](function(_0xd6043f){var _0x5766cd=_0x5dd10b['user']['get']({'plain':!![]});if(!_0x5766cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5766cd['role']===_0xd172('0x5a')){var _0x1793d6=_0xd6043f['get']({'plain':!![]});var _0x242616=_0xd172('0x5b');return db[_0xd172('0x5c')][_0xd172('0x57')]({'where':{'name':_0x242616,'userProfileId':_0x5766cd['userProfileId']},'raw':!![]})['then'](function(_0x5bee83){if(_0x5bee83&&_0x5bee83[_0xd172('0x5d')]===0x0){return db[_0xd172('0x34')]['create']({'name':_0x1793d6['name'],'resourceId':_0x1793d6['id'],'type':_0x5bee83[_0xd172('0x38')],'sectionId':_0x5bee83['id']},{})[_0xd172('0x1e')](function(){return _0xd6043f;});}else{return _0xd6043f;}})[_0xd172('0x29')](function(_0x22edf2){logger[_0xd172('0x24')](_0xd172('0x5e'),_0x22edf2);throw _0x22edf2;});}return _0xd6043f;})[_0xd172('0x1e')](respondWithResult(_0x57487a,0xc9))[_0xd172('0x29')](handleError(_0x57487a,null));};exports[_0xd172('0x33')]=function(_0x5e8236,_0x46b5df){if(_0x5e8236[_0xd172('0x59')]['id']){delete _0x5e8236[_0xd172('0x59')]['id'];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x5e8236[_0xd172('0x5f')]['id']},'include':[{'model':db[_0xd172('0x55')],'as':_0xd172('0x56')}]})[_0xd172('0x1e')](handleEntityNotFound(_0x46b5df,null))[_0xd172('0x1e')](saveUpdates(_0x5e8236[_0xd172('0x59')],null))['then'](respondWithResult(_0x46b5df,null))[_0xd172('0x29')](handleError(_0x46b5df,null));};exports[_0xd172('0x35')]=function(_0x3015c8,_0x29b640){return db[_0xd172('0x3c')]['find']({'where':{'id':_0x3015c8[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x29b640,null))['then'](removeEntity(_0x29b640,null))['catch'](handleError(_0x29b640,null));};exports[_0xd172('0x60')]=function(_0x21e8cc,_0x21c08e){return db['FaxAccount'][_0xd172('0x60')]()[_0xd172('0x1e')](respondWithResult(_0x21c08e,null))[_0xd172('0x29')](handleError(_0x21c08e,null));};exports[_0xd172('0x61')]=function(_0x2df21e,_0xae3a58,_0x4f012e){if(_0x2df21e[_0xd172('0x59')]['id']){delete _0x2df21e[_0xd172('0x59')]['id'];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x2df21e['params']['id']}})['then'](handleEntityNotFound(_0xae3a58,null))[_0xd172('0x1e')](function(_0x4907b6){if(_0x4907b6){_0x2df21e[_0xd172('0x59')][_0xd172('0x62')]=_0x4907b6['id'];return db[_0xd172('0x63')]['create'](_0x2df21e[_0xd172('0x59')]);}})['then'](respondWithResult(_0xae3a58,null))[_0xd172('0x29')](handleError(_0xae3a58,null));};exports[_0xd172('0x64')]=function(_0xe899d6,_0x658f58,_0xf30643){var _0x8a182b={'raw':![],'where':{}};var _0x468501={};var _0x4e34eb={'count':0x0,'rows':[]};return db[_0xd172('0x3c')]['findOne']({'where':{'id':_0xe899d6['params']['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x658f58,null))[_0xd172('0x1e')](function(_0x315af1){if(_0x315af1){_0x468501[_0xd172('0x40')]=_[_0xd172('0x42')](db[_0xd172('0x63')][_0xd172('0x3d')]);_0x468501[_0xd172('0x41')]=_[_0xd172('0x42')](_0xe899d6[_0xd172('0x41')]);_0x468501[_0xd172('0x43')]=_[_0xd172('0x45')](_0x468501[_0xd172('0x40')],_0x468501['query']);_0x8a182b[_0xd172('0x44')]=_['intersection'](_0x468501[_0xd172('0x40')],qs[_0xd172('0x46')](_0xe899d6[_0xd172('0x41')]['fields']));_0x8a182b['attributes']=_0x8a182b[_0xd172('0x44')][_0xd172('0x47')]?_0x8a182b[_0xd172('0x44')]:_0x468501[_0xd172('0x40')];if(!_0xe899d6[_0xd172('0x41')]['hasOwnProperty']('nolimit')){_0x8a182b[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0xe899d6[_0xd172('0x41')][_0xd172('0x2e')]);_0x8a182b[_0xd172('0x2d')]=qs['offset'](_0xe899d6[_0xd172('0x41')][_0xd172('0x2d')]);}_0x8a182b[_0xd172('0x65')]=qs['sort'](_0xe899d6[_0xd172('0x41')][_0xd172('0x4a')]);_0x8a182b[_0xd172('0x4d')]=qs[_0xd172('0x43')](_[_0xd172('0x4b')](_0xe899d6[_0xd172('0x41')],_0x468501[_0xd172('0x43')]));_0x8a182b['where'][_0xd172('0x62')]=_0x315af1['id'];if(_0xe899d6[_0xd172('0x41')][_0xd172('0x4c')]){_0x8a182b['where']=_['merge'](_0x8a182b[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x8a182b['attributes'],function(_0x2a2b8f){var _0x374429={};_0x374429[_0x2a2b8f]={'$like':'%'+_0xe899d6[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x374429;})});}_0x8a182b=_[_0xd172('0x4f')]({},_0x8a182b,_0xe899d6[_0xd172('0x50')]);return db[_0xd172('0x63')][_0xd172('0x30')]({'where':_0x8a182b[_0xd172('0x4d')]})[_0xd172('0x1e')](function(_0x29be89){_0x4e34eb['count']=_0x29be89;if(_0xe899d6[_0xd172('0x41')][_0xd172('0x51')]){_0x8a182b[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0x63')][_0xd172('0x53')](_0x8a182b);})[_0xd172('0x1e')](function(_0x5eaa0e){_0x4e34eb[_0xd172('0x54')]=_0x5eaa0e;return _0x4e34eb;});}})[_0xd172('0x1e')](respondWithFilteredResult(_0x658f58,_0x8a182b))[_0xd172('0x29')](handleError(_0x658f58,null));};exports[_0xd172('0x66')]=function(_0x57408a,_0x4115aa,_0x30392a){return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x57408a[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x4115aa,null))[_0xd172('0x1e')](function(_0x36e81c){if(_0x36e81c){return _0x36e81c['removeDispositions'](_0x57408a[_0xd172('0x41')][_0xd172('0x67')]);}})['then'](respondWithStatusCode(_0x4115aa,null))[_0xd172('0x29')](handleError(_0x4115aa,null));};exports[_0xd172('0x68')]=function(_0x199692,_0x2d6448,_0x516459){if(_0x199692[_0xd172('0x59')]['id']){delete _0x199692['body']['id'];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x199692[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x2d6448,null))['then'](function(_0xdcc686){if(_0xdcc686){_0x199692[_0xd172('0x59')]['FaxAccountId']=_0xdcc686['id'];return db[_0xd172('0x69')][_0xd172('0x58')](_0x199692['body']);}})[_0xd172('0x1e')](respondWithResult(_0x2d6448,null))[_0xd172('0x29')](handleError(_0x2d6448,null));};exports[_0xd172('0x6a')]=function(_0x413fd1,_0x14aaf3,_0x4921b4){var _0xd157cf={'raw':![],'where':{}};var _0x1e771b={};var _0x23bcd3={'count':0x0,'rows':[]};return db[_0xd172('0x3c')][_0xd172('0x6b')]({'where':{'id':_0x413fd1[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x14aaf3,null))[_0xd172('0x1e')](function(_0x223322){if(_0x223322){_0x1e771b[_0xd172('0x40')]=_['keys'](db[_0xd172('0x69')]['rawAttributes']);_0x1e771b['query']=_['keys'](_0x413fd1[_0xd172('0x41')]);_0x1e771b[_0xd172('0x43')]=_[_0xd172('0x45')](_0x1e771b[_0xd172('0x40')],_0x1e771b[_0xd172('0x41')]);_0xd157cf[_0xd172('0x44')]=_['intersection'](_0x1e771b[_0xd172('0x40')],qs['fields'](_0x413fd1[_0xd172('0x41')][_0xd172('0x46')]));_0xd157cf['attributes']=_0xd157cf[_0xd172('0x44')][_0xd172('0x47')]?_0xd157cf['attributes']:_0x1e771b[_0xd172('0x40')];if(!_0x413fd1['query'][_0xd172('0x48')](_0xd172('0x49'))){_0xd157cf[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0x413fd1[_0xd172('0x41')]['limit']);_0xd157cf['offset']=qs[_0xd172('0x2d')](_0x413fd1[_0xd172('0x41')][_0xd172('0x2d')]);}_0xd157cf[_0xd172('0x65')]=qs[_0xd172('0x4a')](_0x413fd1[_0xd172('0x41')][_0xd172('0x4a')]);_0xd157cf[_0xd172('0x4d')]=qs[_0xd172('0x43')](_['pick'](_0x413fd1['query'],_0x1e771b[_0xd172('0x43')]));_0xd157cf[_0xd172('0x4d')][_0xd172('0x62')]=_0x223322['id'];if(_0x413fd1[_0xd172('0x41')][_0xd172('0x4c')]){_0xd157cf[_0xd172('0x4d')]=_['merge'](_0xd157cf[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0xd157cf['attributes'],function(_0x1ec81e){var _0x1bcfae={};_0x1bcfae[_0x1ec81e]={'$like':'%'+_0x413fd1['query'][_0xd172('0x4c')]+'%'};return _0x1bcfae;})});}_0xd157cf=_['merge']({},_0xd157cf,_0x413fd1['options']);return db[_0xd172('0x69')]['count']({'where':_0xd157cf[_0xd172('0x4d')]})[_0xd172('0x1e')](function(_0x1c4dcd){_0x23bcd3[_0xd172('0x30')]=_0x1c4dcd;if(_0x413fd1['query'][_0xd172('0x51')]){_0xd157cf[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0x69')][_0xd172('0x53')](_0xd157cf);})[_0xd172('0x1e')](function(_0x4d42be){_0x23bcd3[_0xd172('0x54')]=_0x4d42be;return _0x23bcd3;});}})['then'](respondWithFilteredResult(_0x14aaf3,_0xd157cf))[_0xd172('0x29')](handleError(_0x14aaf3,null));};exports['removeAnswers']=function(_0x18f3a8,_0x585cde,_0x5bec4c){return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x18f3a8[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x585cde,null))['then'](function(_0x57c240){if(_0x57c240){return _0x57c240[_0xd172('0x6c')](_0x18f3a8[_0xd172('0x41')][_0xd172('0x67')]);}})[_0xd172('0x1e')](respondWithStatusCode(_0x585cde,null))[_0xd172('0x29')](handleError(_0x585cde,null));};exports[_0xd172('0x6d')]=function(_0x423d46,_0x13571d,_0x479ca4){return db[_0xd172('0x6e')][_0xd172('0x57')]({'where':{'id':_0x423d46[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x13571d,null))[_0xd172('0x1e')](function(_0x56b77d){if(_0x56b77d){return _0x56b77d[_0xd172('0x6d')](_0x423d46['body'][_0xd172('0x67')],_[_0xd172('0x6f')](_0x423d46['body'],['ids','id'])||{});}})[_0xd172('0x1e')](respondWithResult(_0x13571d,null))[_0xd172('0x29')](handleError(_0x13571d,null));};exports[_0xd172('0x70')]=function(_0x154837,_0x576edf,_0x2d1ae2){var _0x1ac8c5={'raw':![],'where':{}};var _0x134a1a={};var _0x2855cb={'count':0x0,'rows':[]};return db[_0xd172('0x3c')][_0xd172('0x6b')]({'where':{'id':_0x154837[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x576edf,null))[_0xd172('0x1e')](function(_0x1128d6){if(_0x1128d6){_0x134a1a['model']=_[_0xd172('0x42')](db['FaxInteraction'][_0xd172('0x3d')]);_0x134a1a[_0xd172('0x41')]=_['keys'](_0x154837[_0xd172('0x41')]);_0x134a1a[_0xd172('0x43')]=_[_0xd172('0x45')](_0x134a1a[_0xd172('0x40')],_0x134a1a[_0xd172('0x41')]);_0x1ac8c5[_0xd172('0x44')]=_[_0xd172('0x45')](_0x134a1a[_0xd172('0x40')],qs[_0xd172('0x46')](_0x154837[_0xd172('0x41')][_0xd172('0x46')]));_0x1ac8c5[_0xd172('0x44')]=_0x1ac8c5['attributes'][_0xd172('0x47')]?_0x1ac8c5[_0xd172('0x44')]:_0x134a1a[_0xd172('0x40')];if(!_0x154837[_0xd172('0x41')]['hasOwnProperty'](_0xd172('0x49'))){_0x1ac8c5['limit']=qs[_0xd172('0x2e')](_0x154837['query'][_0xd172('0x2e')]);_0x1ac8c5['offset']=qs['offset'](_0x154837['query'][_0xd172('0x2d')]);}_0x1ac8c5['order']=qs[_0xd172('0x4a')](_0x154837[_0xd172('0x41')][_0xd172('0x4a')]);_0x1ac8c5[_0xd172('0x4d')]=qs['filters'](_[_0xd172('0x4b')](_0x154837[_0xd172('0x41')],_0x134a1a['filters']));_0x1ac8c5['where'][_0xd172('0x62')]=_0x1128d6['id'];if(_0x154837['query'][_0xd172('0x4c')]){_0x1ac8c5['where']=_[_0xd172('0x4f')](_0x1ac8c5['where'],{'$or':_[_0xd172('0x3b')](_0x1ac8c5[_0xd172('0x44')],function(_0x25de74){var _0x42a21d={};_0x42a21d[_0x25de74]={'$like':'%'+_0x154837[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x42a21d;})});}_0x1ac8c5=_['merge']({},_0x1ac8c5,_0x154837['options']);return db['FaxInteraction'][_0xd172('0x30')]({'where':_0x1ac8c5[_0xd172('0x4d')]})[_0xd172('0x1e')](function(_0xea4758){_0x2855cb[_0xd172('0x30')]=_0xea4758;if(_0x154837[_0xd172('0x41')][_0xd172('0x51')]){_0x1ac8c5[_0xd172('0x52')]=[{'model':db[_0xd172('0x71')],'as':_0xd172('0x72'),'required':![]},{'model':db[_0xd172('0x73')],'as':_0xd172('0x74'),'attributes':[_0xd172('0x38'),_0xd172('0x75'),_0xd172('0x76')],'required':![]},{'model':db['Tag'],'as':_0xd172('0x77'),'attributes':['id',_0xd172('0x38'),_0xd172('0x78')],'where':_0x154837[_0xd172('0x41')][_0xd172('0x79')]?{'id':_0x154837[_0xd172('0x41')][_0xd172('0x79')]}:undefined,'required':_0x154837[_0xd172('0x41')]['tag']?!![]:![]}];}return db[_0xd172('0x6e')]['findAll'](_0x1ac8c5);})[_0xd172('0x1e')](function(_0x546d1e){_0x2855cb[_0xd172('0x54')]=_0x546d1e;return _0x2855cb;});}})[_0xd172('0x1e')](respondWithFilteredResult(_0x576edf,_0x1ac8c5))[_0xd172('0x29')](handleError(_0x576edf,null));};exports[_0xd172('0x7a')]=function(_0x44e5c3,_0x1f72a6){var _0x1ef868=_0x44e5c3['params']['id'];var _0x478d16=_0x44e5c3[_0xd172('0x59')];var _0x250a87=0xc8;var _0xb8353d=null;return db[_0xd172('0x7b')][_0xd172('0x7c')]({'isolationLevel':db[_0xd172('0x7b')][_0xd172('0x7d')]['ISOLATION_LEVELS'][_0xd172('0x7e')]},function(_0x19f8b9){return db['FaxAccount'][_0xd172('0x6b')]({'where':{'id':_0x1ef868},'transaction':_0x19f8b9})[_0xd172('0x1e')](function(_0x3a1554){if(_0x3a1554){return db[_0xd172('0x7f')][_0xd172('0x35')]({'where':{'FaxAccountId':_0x1ef868},'transaction':_0x19f8b9})[_0xd172('0x1e')](function(){var _0xa6b5b4=_[_0xd172('0x3b')](_0x478d16,function(_0x635ca4){_0x635ca4[_0xd172('0x62')]=_0x1ef868;return _0x635ca4;});return db[_0xd172('0x7f')]['bulkCreate'](_0xa6b5b4,{'transaction':_0x19f8b9});});}else{_0x250a87=0x194;_0xb8353d=[];}});})[_0xd172('0x1e')](function(){if(_0x250a87!==0x194){return db['FaxApplication'][_0xd172('0x80')]({'where':{'FaxAccountId':_0x1ef868},'order':_0xd172('0x81')})['then'](function(_0x329a55){_0xb8353d=_0x329a55;});}})[_0xd172('0x29')](function(_0x30586a){_0x250a87=0x1f4;logger['error'](_0x30586a[_0xd172('0x37')]);if(_0x30586a[_0xd172('0x38')]){delete _0x30586a[_0xd172('0x38')];}_0xb8353d=_0x30586a;})['finally'](function(){if(_0xb8353d===null){_0x1f72a6[_0xd172('0x2a')](_0x250a87);}else{if(_0x250a87===0x1f4){_0x1f72a6[_0xd172('0x2b')](_0x250a87)[_0xd172('0x39')](_0xb8353d);}else{_0x1f72a6[_0xd172('0x2b')](_0x250a87)[_0xd172('0x2c')](_0xb8353d);}}});};exports[_0xd172('0x82')]=function(_0x456fc5,_0x25a0bc,_0x113880){var _0x18cb59={};var _0x383a8f={};var _0x1fb701;var _0x2a5c15;return db['FaxAccount'][_0xd172('0x6b')]({'where':{'id':_0x456fc5[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x25a0bc,null))[_0xd172('0x1e')](function(_0x2cdd28){if(_0x2cdd28){_0x1fb701=_0x2cdd28;_0x383a8f['model']=_[_0xd172('0x42')](db[_0xd172('0x7f')][_0xd172('0x3d')]);_0x383a8f[_0xd172('0x41')]=_['keys'](_0x456fc5[_0xd172('0x41')]);_0x383a8f[_0xd172('0x43')]=_[_0xd172('0x45')](_0x383a8f['model'],_0x383a8f[_0xd172('0x41')]);_0x18cb59[_0xd172('0x44')]=_[_0xd172('0x45')](_0x383a8f['model'],qs[_0xd172('0x46')](_0x456fc5[_0xd172('0x41')][_0xd172('0x46')]));_0x18cb59[_0xd172('0x44')]=_0x18cb59[_0xd172('0x44')]['length']?_0x18cb59[_0xd172('0x44')]:_0x383a8f[_0xd172('0x40')];_0x18cb59[_0xd172('0x65')]=qs['sort'](_0x456fc5[_0xd172('0x41')]['sort']);_0x18cb59[_0xd172('0x4d')]=qs[_0xd172('0x43')](_['pick'](_0x456fc5[_0xd172('0x41')],_0x383a8f[_0xd172('0x43')]));if(_0x456fc5['query'][_0xd172('0x4c')]){_0x18cb59[_0xd172('0x4d')]=_[_0xd172('0x4f')](_0x18cb59[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x18cb59[_0xd172('0x44')],function(_0xee35b7){var _0x442f91={};_0x442f91[_0xee35b7]={'$like':'%'+_0x456fc5[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x442f91;})});}_0x18cb59=_[_0xd172('0x4f')]({},_0x18cb59,_0x456fc5['options']);return _0x1fb701['getApplications'](_0x18cb59);}})['then'](function(_0xcc9685){if(_0xcc9685){_0x2a5c15=_0xcc9685['length'];if(!_0x456fc5[_0xd172('0x41')][_0xd172('0x48')](_0xd172('0x49'))){_0x18cb59[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0x456fc5[_0xd172('0x41')][_0xd172('0x2e')]);_0x18cb59['offset']=qs['offset'](_0x456fc5['query'][_0xd172('0x2d')]);}return _0x1fb701[_0xd172('0x82')](_0x18cb59);}})['then'](function(_0x45f53e){if(_0x45f53e){return _0x45f53e?{'count':_0x2a5c15,'rows':_0x45f53e}:null;}})['then'](respondWithResult(_0x25a0bc,null))['catch'](handleError(_0x25a0bc,null));};function Extension(_0x5c3cce,_0x5b5477,_0x2b79cd,_0x33745c){this[_0xd172('0x83')]=_0xd172('0x84');this[_0xd172('0x85')]=_0x5c3cce[_0xd172('0x86')];this[_0xd172('0x87')]=_0x33745c;this[_0xd172('0x3f')]=_0xd172('0x88');this[_0xd172('0x89')]=_0xd172('0x8a');this[_0xd172('0x62')]=_0x5c3cce['id'];this[_0xd172('0x81')]=_0x5b5477;this[_0xd172('0x8b')]=_0x2b79cd;}function createExtensionsReciveFax(_0xd8fca1){var _0x391d4c=0x1;var _0x4746df=[];_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'',_0xd172('0x8d')));_0x391d4c+=0x1;_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'CDR(type)=inbound-fax',_0xd172('0x8e')));_0x391d4c+=0x1;for(var _0x36cc7a in _0xd8fca1){if(_0xd8fca1['hasOwnProperty'](_0x36cc7a)&&(_0x36cc7a===_0xd172('0x8f')||_0x36cc7a===_0xd172('0x86')||_0x36cc7a===_0xd172('0x90')||_0x36cc7a===_0xd172('0x91')||_0x36cc7a===_0xd172('0x92')||_0x36cc7a==='maxrate'||_0x36cc7a===_0xd172('0x93')||_0x36cc7a===_0xd172('0x94')||_0x36cc7a==='t38timeout')){_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'FAXOPT('+_0x36cc7a+')='+_0xd8fca1[_0x36cc7a],_0xd172('0x8e')));_0x391d4c+=0x1;}}_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'6',_0xd172('0x95')));_0x391d4c+=0x1;_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,_0xd172('0x96'),_0xd172('0x97')));_0x391d4c=0x0;return _0x4746df;}exports[_0xd172('0x98')]=function(_0x396e52,_0x335f1a,_0x258346){var _0x1d9940;return db[_0xd172('0x7b')][_0xd172('0x7c')](function(_0x482912){return db[_0xd172('0x3c')][_0xd172('0x58')](_0x396e52[_0xd172('0x59')],{'transaction':_0x482912})[_0xd172('0x1e')](function(_0x2d2760){_0x1d9940=_0x2d2760[_0xd172('0x99')]({'plain':!![]});return db[_0xd172('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x1d9940),{'transaction':_0x482912});});})['then'](function(){return _0x1d9940;})['then'](respondWithResult(_0x335f1a,null))[_0xd172('0x29')](handleError(_0x335f1a,null));};exports[_0xd172('0x9b')]=function(_0x2fcfa8,_0x539c8d,_0x58ca5a){var _0xd94a50;return db[_0xd172('0x7b')]['transaction'](function(_0x34f4cf){return db[_0xd172('0x3c')][_0xd172('0x33')](_0x2fcfa8[_0xd172('0x59')],{'where':{'id':_0x2fcfa8['body']['id']},'transaction':_0x34f4cf})[_0xd172('0x1e')](function(_0xa6d71e){return db[_0xd172('0x9a')][_0xd172('0x35')]({'where':{'FaxAccountId':_0x2fcfa8['body']['id']},'transaction':_0x34f4cf})[_0xd172('0x1e')](function(_0x2e6e79){return db[_0xd172('0x9a')][_0xd172('0x9c')](createExtensionsReciveFax(_['omit'](_0x2fcfa8[_0xd172('0x59')],['tech',_0xd172('0x9d'),_0xd172('0x9e'),_0xd172('0x9f'),'TrunkId',_0xd172('0xa0')])),{'transaction':_0x34f4cf});});});})['then'](function(){return db[_0xd172('0x3c')][_0xd172('0xa1')](_0x2fcfa8[_0xd172('0x59')]['id']);})[_0xd172('0x1e')](respondWithResult(_0x539c8d,null))['catch'](handleError(_0x539c8d,null));};exports[_0xd172('0xa2')]=function(_0x1ebb0b,_0x28a8fe,_0x38ad27){var _0x30541c={'raw':!![],'where':{}};var _0x5b5a56={};var _0x2ec67e={'count':0x0,'rows':[]};return db[_0xd172('0x3c')][_0xd172('0x6b')]({'where':{'id':_0x1ebb0b[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x28a8fe,null))['then'](function(_0x300c74){if(_0x300c74){_0x5b5a56[_0xd172('0x40')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x5b5a56[_0xd172('0x41')]=_[_0xd172('0x42')](_0x1ebb0b[_0xd172('0x41')]);_0x5b5a56[_0xd172('0x43')]=_[_0xd172('0x45')](_0x5b5a56['model'],_0x5b5a56[_0xd172('0x41')]);_0x30541c[_0xd172('0x44')]=_['intersection'](_0x5b5a56[_0xd172('0x40')],qs['fields'](_0x1ebb0b[_0xd172('0x41')][_0xd172('0x46')]));_0x30541c['attributes']=_0x30541c[_0xd172('0x44')][_0xd172('0x47')]?_0x30541c[_0xd172('0x44')]:_0x5b5a56['model'];if(!_0x1ebb0b['query']['hasOwnProperty']('nolimit')){_0x30541c['limit']=qs[_0xd172('0x2e')](_0x1ebb0b[_0xd172('0x41')][_0xd172('0x2e')]);_0x30541c['offset']=qs['offset'](_0x1ebb0b[_0xd172('0x41')]['offset']);}_0x30541c[_0xd172('0x65')]=qs['sort'](_0x1ebb0b[_0xd172('0x41')]['sort']);_0x30541c[_0xd172('0x4d')]=qs['filters'](_[_0xd172('0x4b')](_0x1ebb0b[_0xd172('0x41')],_0x5b5a56[_0xd172('0x43')]));_0x30541c[_0xd172('0x4d')][_0xd172('0x62')]=_0x300c74['id'];if(_0x1ebb0b['query'][_0xd172('0x4c')]){_0x30541c[_0xd172('0x4d')]=_[_0xd172('0x4f')](_0x30541c[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x30541c['attributes'],function(_0x112c8e){var _0x27bf97={};_0x27bf97[_0x112c8e]={'$like':'%'+_0x1ebb0b['query'][_0xd172('0x4c')]+'%'};return _0x27bf97;})});}if(_0x1ebb0b[_0xd172('0x41')][_0xd172('0xa3')]){var _0x51f617=_0x1ebb0b['query'][_0xd172('0xa3')][_0xd172('0xa4')](',');var _0x1f99b7={};_0x1f99b7[_0x51f617[0x0]]={'$gte':moment(_0x51f617[0x1])[_0xd172('0xa5')](_0xd172('0xa6'))};_0x30541c['where']=_['merge'](_0x30541c[_0xd172('0x4d')],_0x1f99b7);}_0x30541c=_[_0xd172('0x4f')]({},_0x30541c,_0x1ebb0b[_0xd172('0x50')]);return db[_0xd172('0xa7')][_0xd172('0x30')]({'where':_0x30541c['where']})['then'](function(_0x3601cb){_0x2ec67e['count']=_0x3601cb;if(_0x1ebb0b['query'][_0xd172('0x51')]){_0x30541c[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0xa7')][_0xd172('0x53')](_0x30541c);})[_0xd172('0x1e')](function(_0x5c1534){_0x2ec67e[_0xd172('0x54')]=_0x5c1534;return _0x2ec67e;});}})[_0xd172('0x1e')](respondWithFilteredResult(_0x28a8fe,_0x30541c))[_0xd172('0x29')](handleError(_0x28a8fe,null));};exports[_0xd172('0x39')]=function(_0x137b0a,_0x5ea5fc,_0x2451ed){var _0x16ffb3,_0xf0bdbd={},_0x1f3238;if(_0x137b0a[_0xd172('0x59')]['to']){_0x1f3238=_0x137b0a[_0xd172('0x59')]['to'][0x0];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x137b0a[_0xd172('0x5f')]['id']},'include':[{'model':db[_0xd172('0xa8')],'as':_0xd172('0xa9'),'include':[{'model':db[_0xd172('0x71')],'as':'Contacts','where':{'fax':_0x1f3238},'limit':0x1,'order':[[_0xd172('0x9f'),_0xd172('0xaa')]]}]}]})[_0xd172('0x1e')](handleEntityNotFound(_0x5ea5fc,null))[_0xd172('0x1e')](function(_0x5e70ca){_0x16ffb3=_0x5e70ca;if(_0x137b0a[_0xd172('0x59')]['attachments']&&_0x137b0a['body']['attachments'][_0xd172('0x47')]){for(var _0x5d9dd7=0x0;_0x5d9dd7<_0x137b0a['body'][_0xd172('0xab')][_0xd172('0x47')];_0x5d9dd7+=0x1){_0x137b0a['body']['attachments'][_0x5d9dd7]={'filename':_0x137b0a['body']['attachments'][_0x5d9dd7][_0xd172('0x38')],'id':_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][_0x5d9dd7]['id'],'path':path['join'](config[_0xd172('0xac')],_0xd172('0xad'),_0x137b0a['body']['attachments'][_0x5d9dd7][_0xd172('0xae')])};}}return respondWithRpcPromise('CheckAfterSend',_0xd172('0xaf'),{'FaxAccountId':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x5f')]['id'])?undefined:_0x137b0a[_0xd172('0x5f')]['id'],'path':_[_0xd172('0xb0')](_0x137b0a['body'][_0xd172('0xab')][0x0][_0xd172('0x7')])?undefined:_0x137b0a['body'][_0xd172('0xab')][0x0][_0xd172('0x7')],'fax':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x59')]['to'][0x0])?undefined:_0x137b0a[_0xd172('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x16ffb3){if(_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x59')]['from'])){_0x137b0a[_0xd172('0x59')][_0xd172('0xb1')]=util[_0xd172('0xa5')](_0xd172('0xb2'),_0x16ffb3[_0xd172('0x38')],_0x16ffb3[_0xd172('0xb3')]);}if(_0x16ffb3[_0xd172('0xa9')]){if(_0x16ffb3[_0xd172('0xa9')][_0xd172('0xb4')][_0xd172('0x47')]){return _0x16ffb3[_0xd172('0xa9')][_0xd172('0xb4')][0x0];}else{return db['CmContact'][_0xd172('0x58')](_[_0xd172('0xb5')](_0x137b0a[_0xd172('0x59')],{'firstName':_0x137b0a[_0xd172('0x59')]['to'][0x0],'phone':_0x137b0a[_0xd172('0x59')]['to'][0x0],'fax':_0x137b0a['body']['to'][0x0],'ListId':_0x16ffb3[_0xd172('0xa0')]}));}}else{throw new Error(_0xd172('0xb6'));}}else{throw new Error(_0xd172('0xb7'));}})[_0xd172('0x1e')](function(_0x8d4f8f){if(_0x8d4f8f){return db[_0xd172('0x6e')]['find']({'where':{'ContactId':_0x8d4f8f['id'],'closed':![],'FaxAccountId':_0x16ffb3['id']}})[_0xd172('0x1e')](function(_0x360f57){if(_0x360f57){return[_0x360f57,![]];}return db[_0xd172('0x6e')][_0xd172('0x58')]({'UserId':_0x137b0a['user']['id'],'ContactId':_0x8d4f8f['id'],'FaxAccountId':_0x16ffb3['id'],'fax':_0x137b0a[_0xd172('0x59')]['to'][0x0],'firstMsgDirection':_0xd172('0xb8'),'Messages':[_['merge'](_0x137b0a[_0xd172('0x59')],{'read':![],'body':_0x137b0a['body'][_0xd172('0xab')][0x0][_0xd172('0xb9')],'FaxAccountId':_0x16ffb3['id'],'UserId':_0x137b0a[_0xd172('0x5a')]['id'],'ContactId':_0x8d4f8f['id'],'AttachmentId':_0x137b0a[_0xd172('0x59')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xd172('0xa7')],'as':_0xd172('0xba')}]})[_0xd172('0x1e')](function(_0x3d5981){return[_0x3d5981,!![]];});});}else{throw new Error(_0xd172('0xbb'));}})[_0xd172('0xbc')](function(_0x5ee489,_0x3c5219){if(_0x3c5219){return _0x5ee489;}return db['FaxMessage'][_0xd172('0x58')]({'direction':'out','read':![],'body':_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][0x0][_0xd172('0xb9')],'FaxAccountId':_0x16ffb3['id'],'FaxInteractionId':_0x5ee489['id'],'UserId':_0x137b0a[_0xd172('0x5a')]['id'],'ContactId':_0x5ee489[_0xd172('0xbd')],'AttachmentId':_0x137b0a['body']['attachments'][0x0]['id']})[_0xd172('0x1e')](function(_0x2dca04){_0x5ee489[_0xd172('0xbe')]['Messages']=[];_0x5ee489['dataValues'][_0xd172('0xba')]['push'](_0x2dca04[_0xd172('0xbe')]);return _0x5ee489;});})[_0xd172('0x1e')](function(_0x4be4d4){respondWithRpcPromise(_0xd172('0xbf'),_0xd172('0xbf'),{'FaxAccountId':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x5f')]['id'])?undefined:_0x137b0a['params']['id'],'path':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][0x0][_0xd172('0x7')])?undefined:_0x137b0a['body']['attachments'][0x0][_0xd172('0x7')],'fax':_[_0xd172('0xb0')](_0x137b0a['body']['to'][0x0])?undefined:_0x137b0a['body']['to'][0x0],'AttachmentId':_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][0x0]['id']},client9002)[_0xd172('0x1e')](function(_0x104edf){logger[_0xd172('0x1f')](_0xd172('0xc0'),_0x104edf);})['catch'](function(_0x575ffd){logger['info'](_0xd172('0xc0'),_0x575ffd);});return _0x4be4d4;})['then'](respondWithResult(_0x5ea5fc,null))[_0xd172('0x29')](handleError(_0x5ea5fc,null));};exports[_0xd172('0xc1')]=function(_0x179a83,_0x1c99ce,_0x224be0){return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x179a83[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x1c99ce,null))[_0xd172('0x1e')](function(_0x40737e){if(_0x40737e){return _0x40737e['addAgents'](_0x179a83[_0xd172('0x59')]['ids'],_[_0xd172('0x6f')](_0x179a83['body'],['ids','id'])||{})['spread'](function(_0xeeb724){for(var _0x55369c=0x0;_0x55369c<_0x179a83[_0xd172('0x59')][_0xd172('0x67')][_0xd172('0x47')];_0x55369c+=0x1){socket[_0xd172('0xc2')](_0xd172('0xc3'),{'UserId':Number(_0x179a83[_0xd172('0x59')][_0xd172('0x67')][_0x55369c]),'FaxAccountId':Number(_0x179a83[_0xd172('0x5f')]['id'])});}return _0xeeb724;});}})[_0xd172('0x1e')](respondWithResult(_0x1c99ce,null))[_0xd172('0x29')](handleError(_0x1c99ce,null));};exports[_0xd172('0xc4')]=function(_0x15d9b0,_0x151d65,_0x891479){return db[_0xd172('0x3c')]['find']({'where':{'id':_0x15d9b0['params']['id']}})['then'](handleEntityNotFound(_0x151d65,null))[_0xd172('0x1e')](function(_0x190688){if(_0x190688){return _0x190688[_0xd172('0xc4')](_0x15d9b0[_0xd172('0x41')][_0xd172('0x67')])[_0xd172('0x1e')](function(){if(_[_0xd172('0xc5')](_0x15d9b0[_0xd172('0x41')][_0xd172('0x67')])){for(var _0x241873=0x0;_0x241873<_0x15d9b0[_0xd172('0x41')][_0xd172('0x67')][_0xd172('0x47')];_0x241873+=0x1){socket[_0xd172('0xc2')](_0xd172('0xc6'),{'UserId':Number(_0x15d9b0[_0xd172('0x41')]['ids'][_0x241873]),'FaxAccountId':Number(_0x15d9b0[_0xd172('0x5f')]['id'])});}}else{socket[_0xd172('0xc2')](_0xd172('0xc6'),{'UserId':Number(_0x15d9b0['query']['ids']),'FaxAccountId':Number(_0x15d9b0[_0xd172('0x5f')]['id'])});}});}})[_0xd172('0x1e')](respondWithStatusCode(_0x151d65,null))[_0xd172('0x29')](handleError(_0x151d65,null));};exports['getAgents']=function(_0xe664d9,_0x8b4f8f,_0x406824){var _0x10dea5={};var _0x214dad={};var _0x35ab9a;var _0x18fd2b;return db[_0xd172('0x3c')]['findOne']({'where':{'id':_0xe664d9['params']['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x8b4f8f,null))[_0xd172('0x1e')](function(_0x235826){if(_0x235826){_0x35ab9a=_0x235826;_0x214dad[_0xd172('0x40')]=_[_0xd172('0x42')](db[_0xd172('0x73')]['rawAttributes']);_0x214dad[_0xd172('0x41')]=_['keys'](_0xe664d9['query']);_0x214dad[_0xd172('0x43')]=_['intersection'](_0x214dad[_0xd172('0x40')],_0x214dad['query']);_0x10dea5[_0xd172('0x44')]=_['intersection'](_0x214dad[_0xd172('0x40')],qs['fields'](_0xe664d9[_0xd172('0x41')]['fields']));_0x10dea5[_0xd172('0x44')]=_0x10dea5[_0xd172('0x44')][_0xd172('0x47')]?_0x10dea5[_0xd172('0x44')]:_0x214dad[_0xd172('0x40')];_0x10dea5[_0xd172('0x65')]=qs[_0xd172('0x4a')](_0xe664d9[_0xd172('0x41')][_0xd172('0x4a')]);_0x10dea5['where']=qs[_0xd172('0x43')](_['pick'](_0xe664d9[_0xd172('0x41')],_0x214dad['filters']));if(_0xe664d9['query'][_0xd172('0x4c')]){_0x10dea5['where']=_['merge'](_0x10dea5[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x10dea5[_0xd172('0x44')],function(_0x34e1d4){var _0x44e090={};_0x44e090[_0x34e1d4]={'$like':'%'+_0xe664d9[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x44e090;})});}_0x10dea5=_['merge']({},_0x10dea5,_0xe664d9[_0xd172('0x50')]);return _0x35ab9a[_0xd172('0xc7')](_0x10dea5);}})[_0xd172('0x1e')](function(_0x2aebc7){if(_0x2aebc7){_0x18fd2b=_0x2aebc7[_0xd172('0x47')];if(!_0xe664d9[_0xd172('0x41')]['hasOwnProperty']('nolimit')){_0x10dea5['limit']=qs[_0xd172('0x2e')](_0xe664d9['query'][_0xd172('0x2e')]);_0x10dea5['offset']=qs[_0xd172('0x2d')](_0xe664d9[_0xd172('0x41')][_0xd172('0x2d')]);}return _0x35ab9a[_0xd172('0xc7')](_0x10dea5);}})['then'](function(_0x3ac61c){if(_0x3ac61c){return _0x3ac61c?{'count':_0x18fd2b,'rows':_0x3ac61c}:null;}})[_0xd172('0x1e')](respondWithResult(_0x8b4f8f,null))[_0xd172('0x29')](handleError(_0x8b4f8f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d8dac77..d3c4f6d 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x368a=['hook','exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x37a694,_0x5afe80){var _0x139848=function(_0x443114){while(--_0x443114){_0x37a694['push'](_0x37a694['shift']());}};_0x139848(++_0x5afe80);}(_0x368a,0x1a9));var _0xa368=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x368a[_0x4e9d3c];return _0x2d0825;};'use strict';var EventEmitter=require(_0xa368('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa368('0x1')](0x0);var events={'afterCreate':_0xa368('0x2'),'afterUpdate':_0xa368('0x3'),'afterDestroy':_0xa368('0x4')};function emitEvent(_0x3badd3){return function(_0x27f5a0,_0x267ff7,_0x5580d7){FaxAccountEvents['emit'](_0x3badd3+':'+_0x27f5a0['id'],_0x27f5a0);FaxAccountEvents[_0xa368('0x5')](_0x3badd3,_0x27f5a0);_0x5580d7(null);};}for(var e in events){if(events[_0xa368('0x6')](e)){var event=events[e];FaxAccount[_0xa368('0x7')](e,emitEvent(event));}}module[_0xa368('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xe19a=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','FaxAccount'];(function(_0x1c73a0,_0x2e32ec){var _0x44e724=function(_0x59be7b){while(--_0x59be7b){_0x1c73a0['push'](_0x1c73a0['shift']());}};_0x44e724(++_0x2e32ec);}(_0xe19a,0xd6));var _0xae19=function(_0x253889,_0x4d077f){_0x253889=_0x253889-0x0;var _0x3dd963=_0xe19a[_0x253889];return _0x3dd963;};'use strict';var EventEmitter=require(_0xae19('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xae19('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xae19('0x2')](0x0);var events={'afterCreate':_0xae19('0x3'),'afterUpdate':_0xae19('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc709e8){return function(_0x32604f,_0x4d1326,_0x2181a0){FaxAccountEvents[_0xae19('0x5')](_0xc709e8+':'+_0x32604f['id'],_0x32604f);FaxAccountEvents[_0xae19('0x5')](_0xc709e8,_0x32604f);_0x2181a0(null);};}for(var e in events){if(events[_0xae19('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xae19('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index b1a3d44..6422e47 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d98=['lodash','../../config/logger','api','moment','path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d98,0x181));var _0x80d9=function(_0x1ee4bb,_0x5daed8){_0x1ee4bb=_0x1ee4bb-0x0;var _0x511b52=_0x0d98[_0x1ee4bb];return _0x511b52;};'use strict';var _=require(_0x80d9('0x0'));var util=require('util');var logger=require(_0x80d9('0x1'))(_0x80d9('0x2'));var moment=require(_0x80d9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x80d9('0x4'));var rimraf=require('rimraf');var config=require(_0x80d9('0x5'));var attributes=require(_0x80d9('0x6'));module[_0x80d9('0x7')]=function(_0x256c60,_0x3242f3){return _0x256c60[_0x80d9('0x8')](_0x80d9('0x9'),attributes,{'tableName':_0x80d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c70=['bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','lodash','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7c70,0xa2));var _0x07c7=function(_0x42157a,_0x198d83){_0x42157a=_0x42157a-0x0;var _0x41c6c5=_0x7c70[_0x42157a];return _0x41c6c5;};'use strict';var _=require(_0x07c7('0x0'));var util=require(_0x07c7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x07c7('0x2'));var BPromise=require(_0x07c7('0x3'));var rp=require(_0x07c7('0x4'));var fs=require('fs');var path=require(_0x07c7('0x5'));var rimraf=require(_0x07c7('0x6'));var config=require('../../config/environment');var attributes=require(_0x07c7('0x7'));module[_0x07c7('0x8')]=function(_0x3b4874,_0x41d902){return _0x3b4874[_0x07c7('0x9')](_0x07c7('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 0bda210..8191c36 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0f4=['FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','debug','catch','NotifyFaxAccount','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','Contacts','get','account','applications','Applications','orderBy','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','close','unmanaged','created','interaction','ContactId','AttachmentId','UserId','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxAccount.socket','request','then','info'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xf0f4,0x19d));var _0x4f0f=function(_0x584ba3,_0x227b35){_0x584ba3=_0x584ba3-0x0;var _0xc2211f=_0xf0f4[_0x584ba3];return _0xc2211f;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var moment=require(_0x4f0f('0x1'));var BPromise=require('bluebird');var rs=require(_0x4f0f('0x2'));var fs=require('fs');var Redis=require(_0x4f0f('0x3'));var db=require(_0x4f0f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f0f('0x5'))(_0x4f0f('0x6'));var config=require(_0x4f0f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4f0f('0x8')][_0x4f0f('0x9')]({'port':0x232c});config[_0x4f0f('0xa')]=_[_0x4f0f('0xb')](config[_0x4f0f('0xa')],{'host':_0x4f0f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f0f('0xa')]));require(_0x4f0f('0xd'))['register'](socket);function respondWithRpcPromise(_0x42f2b5,_0x52e262,_0x33ef9f){return new BPromise(function(_0x497f5c,_0x5cb2e3){return client[_0x4f0f('0xe')](_0x42f2b5,_0x33ef9f)[_0x4f0f('0xf')](function(_0x3e2e08){logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x52e262,'request\x20sent');logger['debug'](_0x4f0f('0x12'),_0x52e262,_0x4f0f('0x13'),JSON[_0x4f0f('0x14')](_0x3e2e08));if(_0x3e2e08[_0x4f0f('0x15')]){if(_0x3e2e08[_0x4f0f('0x15')][_0x4f0f('0x16')]===0x1f4){logger[_0x4f0f('0x15')]('FaxAccount,\x20%s,\x20%s',_0x52e262,_0x3e2e08['error']['message']);return _0x5cb2e3(_0x3e2e08['error'][_0x4f0f('0x17')]);}logger[_0x4f0f('0x15')]('FaxAccount,\x20%s,\x20%s',_0x52e262,_0x3e2e08[_0x4f0f('0x15')][_0x4f0f('0x17')]);return _0x497f5c(_0x3e2e08[_0x4f0f('0x15')][_0x4f0f('0x17')]);}else{logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x52e262,_0x4f0f('0x13'));_0x497f5c(_0x3e2e08[_0x4f0f('0x18')][_0x4f0f('0x17')]);}})['catch'](function(_0x7c8a8d){logger[_0x4f0f('0x15')](_0x4f0f('0x11'),_0x52e262,_0x7c8a8d);_0x5cb2e3(_0x7c8a8d);});});}exports['GetFaxAccount']=function(_0x2b7561){var _0x1d186a=this;return new Promise(function(_0xdde64b,_0xd7c9fa){return db[_0x4f0f('0x19')][_0x4f0f('0x1a')]({'raw':_0x2b7561[_0x4f0f('0x1b')]?_0x2b7561[_0x4f0f('0x1b')][_0x4f0f('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b7561[_0x4f0f('0x1b')]?_0x2b7561[_0x4f0f('0x1b')][_0x4f0f('0x1d')]||null:null,'attributes':_0x2b7561[_0x4f0f('0x1b')]?_0x2b7561[_0x4f0f('0x1b')][_0x4f0f('0x1e')]||null:null,'limit':_0x2b7561[_0x4f0f('0x1b')]?_0x2b7561[_0x4f0f('0x1b')][_0x4f0f('0x1f')]||null:null,'include':_0x2b7561[_0x4f0f('0x1b')]?_0x2b7561[_0x4f0f('0x1b')][_0x4f0f('0x20')]?_[_0x4f0f('0x21')](_0x2b7561[_0x4f0f('0x1b')][_0x4f0f('0x20')],function(_0x33d4e6){return{'model':db[_0x33d4e6[_0x4f0f('0x22')]],'as':_0x33d4e6['as'],'attributes':_0x33d4e6[_0x4f0f('0x1e')],'include':_0x33d4e6[_0x4f0f('0x20')]?_[_0x4f0f('0x21')](_0x33d4e6[_0x4f0f('0x20')],function(_0x52ebc3){return{'model':db[_0x52ebc3['model']],'as':_0x52ebc3['as'],'attributes':_0x52ebc3[_0x4f0f('0x1e')],'include':_0x52ebc3['include']?_[_0x4f0f('0x21')](_0x52ebc3[_0x4f0f('0x20')],function(_0x4e0072){return{'model':db[_0x4e0072[_0x4f0f('0x22')]],'as':_0x4e0072['as'],'attributes':_0x4e0072[_0x4f0f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11da57){logger['info'](_0x4f0f('0x23'),_0x2b7561);logger[_0x4f0f('0x24')](_0x4f0f('0x23'),_0x2b7561,JSON[_0x4f0f('0x14')](_0x11da57));_0xdde64b(_0x11da57);})[_0x4f0f('0x25')](function(_0x4f4536){logger[_0x4f0f('0x15')](_0x4f0f('0x23'),_0x4f4536['message'],_0x2b7561);_0xd7c9fa(_0x1d186a[_0x4f0f('0x15')](0x1f4,_0x4f4536[_0x4f0f('0x17')]));});});};exports[_0x4f0f('0x26')]=function(_0x4cd026,_0x3bd947,_0x5c1fb8){var _0x480626=this;return new Promise(function(_0x2487c0,_0x3be713){var _0x285081={'body':_0x4cd026[_0x4f0f('0x27')],'channel':'fax'};var _0x49b1c1=[];var _0x35112b=[];var _0x53b417={};return db[_0x4f0f('0x28')][_0x4f0f('0x29')]()[_0x4f0f('0xf')](function(_0x4b9586){if(!_0x4b9586){throw new db[(_0x4f0f('0x2a'))]['ValidationError'](_0x4f0f('0x2b'));}_0x49b1c1=_[_0x4f0f('0x2c')](_[_0x4f0f('0x2d')](_0x4b9586),[_0x4f0f('0x2e'),_0x4f0f('0x2f')]);_0x35112b=_['difference'](_[_0x4f0f('0x2d')](_0x4b9586),[_0x4f0f('0x2e'),_0x4f0f('0x2f'),_0x4f0f('0x30'),_0x4f0f('0x31')]);if(_0x4cd026['body']['id']){delete _0x4cd026[_0x4f0f('0x27')]['id'];}if(_[_0x4f0f('0x32')](_0x4cd026['body'][_0x4f0f('0x33')])){throw new db[(_0x4f0f('0x2a'))][(_0x4f0f('0x34'))](_0x4f0f('0x35'));}if(_[_0x4f0f('0x32')](_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x27')])||_0x4cd026['body']['body']===''){throw new db[(_0x4f0f('0x2a'))][(_0x4f0f('0x34'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x36')])){throw new db[(_0x4f0f('0x2a'))][(_0x4f0f('0x34'))](_0x4f0f('0x37')+_0x35112b);}if(!_[_0x4f0f('0x38')](_0x35112b,_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x36')])){throw new db[(_0x4f0f('0x2a'))][(_0x4f0f('0x34'))](_0x4f0f('0x39')+_0x35112b);}_0x53b417[_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x36')]]=_0x4cd026['body'][_0x4f0f('0x33')];})[_0x4f0f('0xf')](function(){return db[_0x4f0f('0x19')][_0x4f0f('0x3a')]({'where':{'id':_0x4cd026['account']['id']},'include':[{'model':db['CmList'],'as':_0x4f0f('0x3b'),'include':[{'model':db['CmContact'],'as':_0x4f0f('0x3c'),'where':_0x53b417,'limit':0x1,'order':[[_0x4f0f('0x2f'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x4f0f('0xf')](function(_0x366a59){if(_0x366a59&&_0x366a59[_0x4f0f('0x3b')]){var _0x4bfb2b=_0x366a59[_0x4f0f('0x3d')]({'plain':!![]});_0x285081[_0x4f0f('0x3e')]=_0x4bfb2b;_0x285081[_0x4f0f('0x3f')]=_0x4bfb2b[_0x4f0f('0x40')];_0x285081['list']=_0x4bfb2b[_0x4f0f('0x3b')];_0x285081[_0x4f0f('0x3f')]=_[_0x4f0f('0x41')](_0x285081[_0x4f0f('0x3f')],['priority'],[_0x4f0f('0x42')]);if(_0x285081[_0x4f0f('0x3e')][_0x4f0f('0x40')]){delete _0x285081['account'][_0x4f0f('0x40')];}if(_0x285081[_0x4f0f('0x3e')][_0x4f0f('0x3b')]&&_0x285081['account']['List'][_0x4f0f('0x3c')][_0x4f0f('0x43')]){return _0x285081[_0x4f0f('0x3e')]['List']['Contacts'][0x0];}var _0x154357=_[_0x4f0f('0xb')](_0x4cd026[_0x4f0f('0x27')],{'firstName':_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x33')],'ListId':_0x4bfb2b[_0x4f0f('0x31')]});_0x154357[_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x36')]]=_0x4cd026[_0x4f0f('0x27')]['from'];return db[_0x4f0f('0x28')][_0x4f0f('0x44')](_0x154357,{'fields':_0x49b1c1,'raw':!![]});}})[_0x4f0f('0xf')](function(_0x21c93b){_0x285081[_0x4f0f('0x45')]=_0x21c93b;if(_0x21c93b){var _0x16f221={'ContactId':_0x21c93b['id'],'FaxAccountId':_0x4cd026[_0x4f0f('0x3e')]['id'],'fax':_0x21c93b['fax']};return db[_0x4f0f('0x46')][_0x4f0f('0x3a')]({'where':{'ContactId':_0x21c93b['id'],'closed':![],'FaxAccountId':_0x4cd026[_0x4f0f('0x3e')]['id']}})[_0x4f0f('0xf')](function(_0x51b302){if(_0x51b302){return[_0x51b302,![]];}return db[_0x4f0f('0x46')][_0x4f0f('0x44')](_0x16f221)[_0x4f0f('0xf')](function(_0xb4b7e8){return[_0xb4b7e8,!![]];});});}else{throw new Error(_0x4f0f('0x47'));}})['spread'](function(_0x1432dd,_0x3a02d3){var _0x14d0e2=_0x1432dd[_0x4f0f('0x3d')]({'plain':!![]});if(_0x3a02d3){if(_0x285081[_0x4f0f('0x3e')][_0x4f0f('0x48')]){_0x285081[_0x4f0f('0x3f')]['push']({'id':0x0,'priority':_0x285081[_0x4f0f('0x3f')]['length']+0x1,'app':_0x4f0f('0x49'),'appdata':_0x4f0f('0x4a'),'interval':'*,*,*,*'});}_0x14d0e2[_0x4f0f('0x4b')]=!![];}else{_0x14d0e2['created']=![];}_0x285081[_0x4f0f('0x4c')]=_0x14d0e2;return db['FaxMessage'][_0x4f0f('0x44')]({'body':_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x27')],'FaxAccountId':_0x4cd026[_0x4f0f('0x3e')]['id'],'FaxInteractionId':_0x1432dd['id'],'direction':'in','ContactId':_0x1432dd[_0x4f0f('0x4d')],'AttachmentId':_0x4cd026[_0x4f0f('0x27')][_0x4f0f('0x4e')]});})[_0x4f0f('0xf')](function(_0xc446de){_0x285081[_0x4f0f('0x17')]=_0xc446de;if(_0x285081[_0x4f0f('0x4c')][_0x4f0f('0x4f')]){return db['User'][_0x4f0f('0x3a')]({'attributes':['id',_0x4f0f('0x50')],'where':{'id':_0x285081[_0x4f0f('0x4c')][_0x4f0f('0x4f')]}})[_0x4f0f('0xf')](function(_0x56a362){if(_0x56a362){_0x285081['applications'][_0x4f0f('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x56a362[_0x4f0f('0x50')]+','+(_0x285081[_0x4f0f('0x3e')][_0x4f0f('0x52')]||0xa),'interval':_0x4f0f('0x53')});}return respondWithRpcPromise(_0x4f0f('0x54'),_0x4f0f('0x55'),_0x285081);});}return respondWithRpcPromise(_0x4f0f('0x54'),_0x4f0f('0x55'),_0x285081);})[_0x4f0f('0xf')](function(_0x539791){_0x2487c0(_0x539791);})[_0x4f0f('0x25')](function(_0x41bf2a){_0x3be713(_0x480626[_0x4f0f('0x15')](0x1f4,_0x41bf2a[_0x4f0f('0x17')]));});});}; \ No newline at end of file +var _0x9749=['orderBy','priority','asc','length','FaxInteraction','create','Contact\x20not\x20found','spread','get','push','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','Applications','applications','list'];(function(_0x74b2d6,_0x5aba96){var _0x3a5eed=function(_0x4d77c3){while(--_0x4d77c3){_0x74b2d6['push'](_0x74b2d6['shift']());}};_0x3a5eed(++_0x5aba96);}(_0x9749,0xd0));var _0x9974=function(_0x2bd67f,_0x137730){_0x2bd67f=_0x2bd67f-0x0;var _0x102e07=_0x9749[_0x2bd67f];return _0x102e07;};'use strict';var _=require(_0x9974('0x0'));var util=require(_0x9974('0x1'));var moment=require('moment');var BPromise=require(_0x9974('0x2'));var rs=require(_0x9974('0x3'));var fs=require('fs');var Redis=require(_0x9974('0x4'));var db=require(_0x9974('0x5'))['db'];var utils=require(_0x9974('0x6'));var logger=require(_0x9974('0x7'))(_0x9974('0x8'));var config=require(_0x9974('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9974('0xa')][_0x9974('0xb')]({'port':0x232c});config['redis']=_[_0x9974('0xc')](config['redis'],{'host':_0x9974('0xd'),'port':0x18eb});var socket=require(_0x9974('0xe'))(new Redis(config[_0x9974('0xf')]));require(_0x9974('0x10'))[_0x9974('0x11')](socket);function respondWithRpcPromise(_0x4d2c17,_0x1d365e,_0x16818c){return new BPromise(function(_0x256c32,_0x124490){return client[_0x9974('0x12')](_0x4d2c17,_0x16818c)[_0x9974('0x13')](function(_0xca56ec){logger['info'](_0x9974('0x14'),_0x1d365e,'request\x20sent');logger[_0x9974('0x15')](_0x9974('0x16'),_0x1d365e,_0x9974('0x17'),JSON[_0x9974('0x18')](_0xca56ec));if(_0xca56ec['error']){if(_0xca56ec[_0x9974('0x19')]['code']===0x1f4){logger[_0x9974('0x19')]('FaxAccount,\x20%s,\x20%s',_0x1d365e,_0xca56ec[_0x9974('0x19')][_0x9974('0x1a')]);return _0x124490(_0xca56ec[_0x9974('0x19')]['message']);}logger['error'](_0x9974('0x14'),_0x1d365e,_0xca56ec[_0x9974('0x19')]['message']);return _0x256c32(_0xca56ec[_0x9974('0x19')][_0x9974('0x1a')]);}else{logger[_0x9974('0x1b')](_0x9974('0x14'),_0x1d365e,_0x9974('0x17'));_0x256c32(_0xca56ec['result']['message']);}})[_0x9974('0x1c')](function(_0xb5c902){logger['error'](_0x9974('0x14'),_0x1d365e,_0xb5c902);_0x124490(_0xb5c902);});});}exports[_0x9974('0x1d')]=function(_0x94acfe){var _0x24cb4c=this;return new Promise(function(_0x41bd66,_0x26e43d){return db[_0x9974('0x1e')][_0x9974('0x1f')]({'raw':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')][_0x9974('0x21')]===undefined?!![]:![]:!![],'where':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')]['where']||null:null,'attributes':_0x94acfe[_0x9974('0x20')]?_0x94acfe['options'][_0x9974('0x22')]||null:null,'limit':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')][_0x9974('0x23')]||null:null,'include':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')][_0x9974('0x24')]?_[_0x9974('0x25')](_0x94acfe['options'][_0x9974('0x24')],function(_0x215ba5){return{'model':db[_0x215ba5[_0x9974('0x26')]],'as':_0x215ba5['as'],'attributes':_0x215ba5[_0x9974('0x22')],'include':_0x215ba5[_0x9974('0x24')]?_[_0x9974('0x25')](_0x215ba5['include'],function(_0x12713c){return{'model':db[_0x12713c[_0x9974('0x26')]],'as':_0x12713c['as'],'attributes':_0x12713c[_0x9974('0x22')],'include':_0x12713c[_0x9974('0x24')]?_['map'](_0x12713c[_0x9974('0x24')],function(_0x4ad9b0){return{'model':db[_0x4ad9b0['model']],'as':_0x4ad9b0['as'],'attributes':_0x4ad9b0[_0x9974('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9974('0x13')](function(_0x1f11a6){logger[_0x9974('0x1b')](_0x9974('0x1d'),_0x94acfe);logger[_0x9974('0x15')](_0x9974('0x1d'),_0x94acfe,JSON[_0x9974('0x18')](_0x1f11a6));_0x41bd66(_0x1f11a6);})[_0x9974('0x1c')](function(_0x2925a2){logger[_0x9974('0x19')](_0x9974('0x1d'),_0x2925a2[_0x9974('0x1a')],_0x94acfe);_0x26e43d(_0x24cb4c[_0x9974('0x19')](0x1f4,_0x2925a2['message']));});});};exports[_0x9974('0x27')]=function(_0xa0e15a,_0x20ac3d,_0x2e825e){var _0x249db4=this;return new Promise(function(_0x2752cb,_0x500101){var _0x161735={'body':_0xa0e15a[_0x9974('0x28')],'channel':_0x9974('0x29')};var _0x2a3dd2=[];var _0x1d947a=[];var _0x565345={};return db[_0x9974('0x2a')][_0x9974('0x2b')]()[_0x9974('0x13')](function(_0x2f3df1){if(!_0x2f3df1){throw new db[(_0x9974('0x2c'))][(_0x9974('0x2d'))](_0x9974('0x2e'));}_0x2a3dd2=_[_0x9974('0x2f')](_['keys'](_0x2f3df1),[_0x9974('0x30'),_0x9974('0x31')]);_0x1d947a=_['difference'](_['keys'](_0x2f3df1),['createdAt','updatedAt','CompanyId',_0x9974('0x32')]);if(_0xa0e15a[_0x9974('0x28')]['id']){delete _0xa0e15a[_0x9974('0x28')]['id'];}if(_['isNil'](_0xa0e15a[_0x9974('0x28')][_0x9974('0x33')])){throw new db[(_0x9974('0x2c'))]['ValidationError'](_0x9974('0x34'));}if(_['isNil'](_0xa0e15a[_0x9974('0x28')][_0x9974('0x28')])||_0xa0e15a['body'][_0x9974('0x28')]===''){throw new db[(_0x9974('0x2c'))]['ValidationError'](_0x9974('0x35'));}if(_[_0x9974('0x36')](_0xa0e15a[_0x9974('0x28')]['mapKey'])){throw new db['Sequelize'][(_0x9974('0x2d'))](_0x9974('0x37')+_0x1d947a);}if(!_[_0x9974('0x38')](_0x1d947a,_0xa0e15a[_0x9974('0x28')][_0x9974('0x39')])){throw new db[(_0x9974('0x2c'))]['ValidationError'](_0x9974('0x3a')+_0x1d947a);}_0x565345[_0xa0e15a[_0x9974('0x28')]['mapKey']]=_0xa0e15a[_0x9974('0x28')][_0x9974('0x33')];})[_0x9974('0x13')](function(){return db[_0x9974('0x1e')][_0x9974('0x3b')]({'where':{'id':_0xa0e15a[_0x9974('0x3c')]['id']},'include':[{'model':db[_0x9974('0x3d')],'as':_0x9974('0x3e'),'include':[{'model':db[_0x9974('0x2a')],'as':_0x9974('0x3f'),'where':_0x565345,'limit':0x1,'order':[[_0x9974('0x31'),'DESC']]}]},{'model':db[_0x9974('0x40')],'as':_0x9974('0x41')}]});})[_0x9974('0x13')](function(_0x235312){if(_0x235312&&_0x235312[_0x9974('0x3e')]){var _0x3478e2=_0x235312['get']({'plain':!![]});_0x161735[_0x9974('0x3c')]=_0x3478e2;_0x161735[_0x9974('0x42')]=_0x3478e2[_0x9974('0x41')];_0x161735[_0x9974('0x43')]=_0x3478e2[_0x9974('0x3e')];_0x161735[_0x9974('0x42')]=_[_0x9974('0x44')](_0x161735[_0x9974('0x42')],[_0x9974('0x45')],[_0x9974('0x46')]);if(_0x161735[_0x9974('0x3c')][_0x9974('0x41')]){delete _0x161735[_0x9974('0x3c')]['Applications'];}if(_0x161735[_0x9974('0x3c')][_0x9974('0x3e')]&&_0x161735[_0x9974('0x3c')][_0x9974('0x3e')]['Contacts'][_0x9974('0x47')]){return _0x161735[_0x9974('0x3c')][_0x9974('0x3e')][_0x9974('0x3f')][0x0];}var _0x525c5e=_[_0x9974('0xc')](_0xa0e15a[_0x9974('0x28')],{'firstName':_0xa0e15a[_0x9974('0x28')]['from'],'ListId':_0x3478e2[_0x9974('0x32')]});_0x525c5e[_0xa0e15a['body'][_0x9974('0x39')]]=_0xa0e15a['body']['from'];return db[_0x9974('0x2a')]['create'](_0x525c5e,{'fields':_0x2a3dd2,'raw':!![]});}})[_0x9974('0x13')](function(_0x3bd4a1){_0x161735['contact']=_0x3bd4a1;if(_0x3bd4a1){var _0x4cd207={'ContactId':_0x3bd4a1['id'],'FaxAccountId':_0xa0e15a[_0x9974('0x3c')]['id'],'fax':_0x3bd4a1[_0x9974('0x29')]};return db[_0x9974('0x48')][_0x9974('0x3b')]({'where':{'ContactId':_0x3bd4a1['id'],'closed':![],'FaxAccountId':_0xa0e15a[_0x9974('0x3c')]['id']}})['then'](function(_0xb97b97){if(_0xb97b97){return[_0xb97b97,![]];}return db[_0x9974('0x48')][_0x9974('0x49')](_0x4cd207)['then'](function(_0x2dcd60){return[_0x2dcd60,!![]];});});}else{throw new Error(_0x9974('0x4a'));}})[_0x9974('0x4b')](function(_0x424698,_0x58e356){var _0x31cd64=_0x424698[_0x9974('0x4c')]({'plain':!![]});if(_0x58e356){if(_0x161735[_0x9974('0x3c')]['autoclose']){_0x161735[_0x9974('0x42')][_0x9974('0x4d')]({'id':0x0,'priority':_0x161735[_0x9974('0x42')][_0x9974('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9974('0x4e')});}_0x31cd64[_0x9974('0x4f')]=!![];}else{_0x31cd64['created']=![];}_0x161735[_0x9974('0x50')]=_0x31cd64;return db[_0x9974('0x51')][_0x9974('0x49')]({'body':_0xa0e15a['body']['body'],'FaxAccountId':_0xa0e15a[_0x9974('0x3c')]['id'],'FaxInteractionId':_0x424698['id'],'direction':'in','ContactId':_0x424698[_0x9974('0x52')],'AttachmentId':_0xa0e15a['body'][_0x9974('0x53')]});})[_0x9974('0x13')](function(_0x2cbc58){_0x161735[_0x9974('0x1a')]=_0x2cbc58;if(_0x161735[_0x9974('0x50')]['UserId']){return db[_0x9974('0x54')][_0x9974('0x3b')]({'attributes':['id','name'],'where':{'id':_0x161735[_0x9974('0x50')][_0x9974('0x55')]}})[_0x9974('0x13')](function(_0x12fb15){if(_0x12fb15){_0x161735['applications'][_0x9974('0x56')]({'id':0x0,'priority':0x0,'app':_0x9974('0x57'),'appdata':_0x12fb15[_0x9974('0x58')]+','+(_0x161735[_0x9974('0x3c')][_0x9974('0x59')]||0xa),'interval':_0x9974('0x4e')});}return respondWithRpcPromise(_0x9974('0x5a'),_0x9974('0x5b'),_0x161735);});}return respondWithRpcPromise('Start','startRouting',_0x161735);})[_0x9974('0x13')](function(_0x4337c7){_0x2752cb(_0x4337c7);})['catch'](function(_0x40c81d){_0x500101(_0x249db4['error'](0x1f4,_0x40c81d[_0x9974('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6f9e28a..82b9ac1 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae4e=['faxAccount:','./faxAccount.events','save','remove','emit','removeListener','length'];(function(_0x5489ef,_0x400603){var _0x460e84=function(_0x247716){while(--_0x247716){_0x5489ef['push'](_0x5489ef['shift']());}};_0x460e84(++_0x400603);}(_0xae4e,0x10b));var _0xeae4=function(_0x35720c,_0x6a0cba){_0x35720c=_0x35720c-0x0;var _0xbf3d07=_0xae4e[_0x35720c];return _0xbf3d07;};'use strict';var FaxAccountEvents=require(_0xeae4('0x0'));var events=[_0xeae4('0x1'),_0xeae4('0x2'),'update'];function createListener(_0x31da4c,_0x23e115){return function(_0x1dbbfc){_0x23e115[_0xeae4('0x3')](_0x31da4c,_0x1dbbfc);};}function removeListener(_0x415eb5,_0x33fdb7){return function(){FaxAccountEvents[_0xeae4('0x4')](_0x415eb5,_0x33fdb7);};}exports['register']=function(_0x1d86f2){for(var _0x33cc3e=0x0,_0x5e01fc=events[_0xeae4('0x5')];_0x33cc3e<_0x5e01fc;_0x33cc3e++){var _0x5e0df8=events[_0x33cc3e];var _0x2292ed=createListener(_0xeae4('0x6')+_0x5e0df8,_0x1d86f2);FaxAccountEvents['on'](_0x5e0df8,_0x2292ed);}}; \ No newline at end of file +var _0xe904=['save','removeListener','register','./faxAccount.events'];(function(_0x541056,_0x1b4d2c){var _0x576c06=function(_0x292b5e){while(--_0x292b5e){_0x541056['push'](_0x541056['shift']());}};_0x576c06(++_0x1b4d2c);}(_0xe904,0x16b));var _0x4e90=function(_0x13f5d1,_0x43d446){_0x13f5d1=_0x13f5d1-0x0;var _0x17aabf=_0xe904[_0x13f5d1];return _0x17aabf;};'use strict';var FaxAccountEvents=require(_0x4e90('0x0'));var events=[_0x4e90('0x1'),'remove','update'];function createListener(_0xb303f5,_0x279d0d){return function(_0x1ca1a5){_0x279d0d['emit'](_0xb303f5,_0x1ca1a5);};}function removeListener(_0x43acc7,_0x3a54fa){return function(){FaxAccountEvents[_0x4e90('0x2')](_0x43acc7,_0x3a54fa);};}exports[_0x4e90('0x3')]=function(_0x500fbc){for(var _0xc23466=0x0,_0xe05f76=events['length'];_0xc23466<_0xe05f76;_0xc23466++){var _0x447d23=events[_0xc23466];var _0x8b1abe=createListener('faxAccount:'+_0x447d23,_0x500fbc);FaxAccountEvents['on'](_0x447d23,_0x8b1abe);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 947a273..6652cd7 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x134a1c,_0x23a135){var _0x3eb660=function(_0x2b76c3){while(--_0x2b76c3){_0x134a1c['push'](_0x134a1c['shift']());}};_0x3eb660(++_0x23a135);}(_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['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(_0x5530d0,_0x56bac6){var _0x4b4285=function(_0x448aac){while(--_0x448aac){_0x5530d0['push'](_0x5530d0['shift']());}};_0x4b4285(++_0x56bac6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index e5ca95a..993785a 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79bd=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x79bd,0x80));var _0xd79b=function(_0x442bb6,_0x5ab3aa){_0x442bb6=_0x442bb6-0x0;var _0x5ea01e=_0x79bd[_0x442bb6];return _0x5ea01e;};'use strict';var Sequelize=require(_0xd79b('0x0'));module[_0xd79b('0x1')]={'priority':{'type':Sequelize[_0xd79b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd79b('0x3')],'allowNull':![],'defaultValue':_0xd79b('0x4')},'appdata':{'type':Sequelize[_0xd79b('0x5')]()},'description':{'type':Sequelize[_0xd79b('0x3')]},'interval':{'type':Sequelize[_0xd79b('0x3')],'defaultValue':_0xd79b('0x6')}}; \ No newline at end of file +var _0xeb74=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x166436,_0x257244){var _0x1d4447=function(_0x9645ff){while(--_0x9645ff){_0x166436['push'](_0x166436['shift']());}};_0x1d4447(++_0x257244);}(_0xeb74,0x66));var _0x4eb7=function(_0x2be07b,_0xd9e535){_0x2be07b=_0x2be07b-0x0;var _0x4138c0=_0xeb74[_0x2be07b];return _0x4138c0;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'priority':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4eb7('0x3')],'allowNull':![],'defaultValue':_0x4eb7('0x4')},'appdata':{'type':Sequelize[_0x4eb7('0x5')]()},'description':{'type':Sequelize[_0x4eb7('0x3')]},'interval':{'type':Sequelize[_0x4eb7('0x3')],'defaultValue':_0x4eb7('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c887f7d..b73c61d 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e9e=['json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','findAll','rows','catch','show','include','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x2458e0,_0x2a9234){var _0x3fc9c7=function(_0x4ad98d){while(--_0x4ad98d){_0x2458e0['push'](_0x2458e0['shift']());}};_0x3fc9c7(++_0x2a9234);}(_0x6e9e,0x19d));var _0xe6e9=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0x6e9e[_0xe6e78c];return _0x2a09c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6e9('0x0'));var zipdir=require(_0xe6e9('0x1'));var jsonpatch=require(_0xe6e9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe6e9('0x3'));var Mustache=require(_0xe6e9('0x4'));var util=require('util');var path=require(_0xe6e9('0x5'));var sox=require(_0xe6e9('0x6'));var csv=require(_0xe6e9('0x7'));var ejs=require(_0xe6e9('0x8'));var fs=require('fs');var fs_extra=require(_0xe6e9('0x9'));var _=require(_0xe6e9('0xa'));var squel=require(_0xe6e9('0xb'));var crypto=require('crypto');var jsforce=require(_0xe6e9('0xc'));var deskjs=require(_0xe6e9('0xd'));var toCsv=require(_0xe6e9('0x7'));var querystring=require(_0xe6e9('0xe'));var Papa=require(_0xe6e9('0xf'));var Redis=require('ioredis');var authService=require(_0xe6e9('0x10'));var qs=require(_0xe6e9('0x11'));var as=require(_0xe6e9('0x12'));var hardwareService=require(_0xe6e9('0x13'));var logger=require('../../config/logger')(_0xe6e9('0x14'));var utils=require(_0xe6e9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe6e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x433bc4,_0x20fb05){_0x20fb05=_0x20fb05||0xcc;return function(_0x2a0100){if(_0x2a0100){return _0x433bc4[_0xe6e9('0x17')](_0x20fb05);}return _0x433bc4['status'](_0x20fb05)['end']();};}function respondWithResult(_0x257994,_0x1cd01f){_0x1cd01f=_0x1cd01f||0xc8;return function(_0x441842){if(_0x441842){return _0x257994[_0xe6e9('0x18')](_0x1cd01f)[_0xe6e9('0x19')](_0x441842);}};}function respondWithFilteredResult(_0x52ada0,_0x2fc440){return function(_0xeed2fd){if(_0xeed2fd){var _0x144a47=typeof _0x2fc440[_0xe6e9('0x1a')]===_0xe6e9('0x1b')&&typeof _0x2fc440[_0xe6e9('0x1c')]==='undefined';var _0x556183=_0xeed2fd[_0xe6e9('0x1d')];var _0x33e116=_0x144a47?0x0:_0x2fc440['offset'];var _0x43cd61=_0x144a47?_0xeed2fd['count']:_0x2fc440[_0xe6e9('0x1a')]+_0x2fc440['limit'];var _0x4dfd31;if(_0x43cd61>=_0x556183){_0x43cd61=_0x556183;_0x4dfd31=0xc8;}else{_0x4dfd31=0xce;}_0x52ada0[_0xe6e9('0x18')](_0x4dfd31);return _0x52ada0[_0xe6e9('0x1e')](_0xe6e9('0x1f'),_0x33e116+'-'+_0x43cd61+'/'+_0x556183)[_0xe6e9('0x19')](_0xeed2fd);}return null;};}function patchUpdates(_0x88cdba){return function(_0x57000b){try{jsonpatch[_0xe6e9('0x20')](_0x57000b,_0x88cdba,!![]);}catch(_0x49691b){return BPromise['reject'](_0x49691b);}return _0x57000b[_0xe6e9('0x21')]();};}function saveUpdates(_0x4624cf,_0x1f9bed){return function(_0x4393a1){if(_0x4393a1){return _0x4393a1['update'](_0x4624cf)[_0xe6e9('0x22')](function(_0x38ccba){return _0x38ccba;});}return null;};}function removeEntity(_0x340df4,_0x533432){return function(_0x4833d1){if(_0x4833d1){return _0x4833d1[_0xe6e9('0x23')]()[_0xe6e9('0x22')](function(){_0x340df4['status'](0xcc)[_0xe6e9('0x24')]();});}};}function handleEntityNotFound(_0x3aacc4,_0x22e485){return function(_0x7956db){if(!_0x7956db){_0x3aacc4['sendStatus'](0x194);}return _0x7956db;};}function handleError(_0x1fd26e,_0xfad4d8){_0xfad4d8=_0xfad4d8||0x1f4;return function(_0x5520bb){logger[_0xe6e9('0x25')](_0x5520bb[_0xe6e9('0x26')]);if(_0x5520bb[_0xe6e9('0x27')]){delete _0x5520bb[_0xe6e9('0x27')];}_0x1fd26e[_0xe6e9('0x18')](_0xfad4d8)[_0xe6e9('0x28')](_0x5520bb);};}exports[_0xe6e9('0x29')]=function(_0x14f9ab,_0x2c488d){var _0x5e679a={},_0x1affc6={},_0x5a6806={'count':0x0,'rows':[]};var _0x4ed14d=_[_0xe6e9('0x2a')](db['FaxApplication'][_0xe6e9('0x2b')],function(_0x559b49){return{'name':_0x559b49[_0xe6e9('0x2c')],'type':_0x559b49[_0xe6e9('0x2d')][_0xe6e9('0x2e')]};});_0x1affc6[_0xe6e9('0x2f')]=_['map'](_0x4ed14d,_0xe6e9('0x27'));_0x1affc6[_0xe6e9('0x30')]=_[_0xe6e9('0x31')](_0x14f9ab[_0xe6e9('0x30')]);_0x1affc6[_0xe6e9('0x32')]=_['intersection'](_0x1affc6[_0xe6e9('0x2f')],_0x1affc6[_0xe6e9('0x30')]);_0x5e679a['attributes']=_[_0xe6e9('0x33')](_0x1affc6[_0xe6e9('0x2f')],qs[_0xe6e9('0x34')](_0x14f9ab[_0xe6e9('0x30')][_0xe6e9('0x34')]));_0x5e679a[_0xe6e9('0x35')]=_0x5e679a[_0xe6e9('0x35')]['length']?_0x5e679a[_0xe6e9('0x35')]:_0x1affc6[_0xe6e9('0x2f')];if(!_0x14f9ab[_0xe6e9('0x30')][_0xe6e9('0x36')]('nolimit')){_0x5e679a[_0xe6e9('0x1c')]=qs[_0xe6e9('0x1c')](_0x14f9ab[_0xe6e9('0x30')][_0xe6e9('0x1c')]);_0x5e679a[_0xe6e9('0x1a')]=qs['offset'](_0x14f9ab['query']['offset']);}_0x5e679a['order']=qs[_0xe6e9('0x37')](_0x14f9ab['query'][_0xe6e9('0x37')]);_0x5e679a[_0xe6e9('0x38')]=qs[_0xe6e9('0x32')](_[_0xe6e9('0x39')](_0x14f9ab[_0xe6e9('0x30')],_0x1affc6[_0xe6e9('0x32')]),_0x4ed14d);if(_0x14f9ab[_0xe6e9('0x30')][_0xe6e9('0x3a')]){_0x5e679a[_0xe6e9('0x38')]=_[_0xe6e9('0x3b')](_0x5e679a[_0xe6e9('0x38')],{'$or':_[_0xe6e9('0x2a')](_0x4ed14d,function(_0x4883d2){if(_0x4883d2[_0xe6e9('0x2d')]!==_0xe6e9('0x3c')){var _0x4f24eb={};_0x4f24eb[_0x4883d2[_0xe6e9('0x27')]]={'$like':'%'+_0x14f9ab[_0xe6e9('0x30')][_0xe6e9('0x3a')]+'%'};return _0x4f24eb;}})});}_0x5e679a=_['merge']({},_0x5e679a,_0x14f9ab[_0xe6e9('0x3d')]);var _0x3f1196={'where':_0x5e679a[_0xe6e9('0x38')]};return db['FaxApplication'][_0xe6e9('0x1d')](_0x3f1196)[_0xe6e9('0x22')](function(_0x3f5823){_0x5a6806[_0xe6e9('0x1d')]=_0x3f5823;if(_0x14f9ab[_0xe6e9('0x30')]['includeAll']){_0x5e679a['include']=[{'all':!![]}];}return db[_0xe6e9('0x3e')][_0xe6e9('0x3f')](_0x5e679a);})[_0xe6e9('0x22')](function(_0x8baf54){_0x5a6806[_0xe6e9('0x40')]=_0x8baf54;return _0x5a6806;})[_0xe6e9('0x22')](respondWithFilteredResult(_0x2c488d,_0x5e679a))[_0xe6e9('0x41')](handleError(_0x2c488d,null));};exports[_0xe6e9('0x42')]=function(_0x17176d,_0x59eb04){var _0x5e461a={'raw':!![],'where':{'id':_0x17176d['params']['id']}},_0x50be18={};_0x50be18[_0xe6e9('0x2f')]=_['keys'](db[_0xe6e9('0x3e')]['rawAttributes']);_0x50be18['query']=_[_0xe6e9('0x31')](_0x17176d['query']);_0x50be18['filters']=_['intersection'](_0x50be18[_0xe6e9('0x2f')],_0x50be18['query']);_0x5e461a[_0xe6e9('0x35')]=_['intersection'](_0x50be18['model'],qs[_0xe6e9('0x34')](_0x17176d[_0xe6e9('0x30')]['fields']));_0x5e461a[_0xe6e9('0x35')]=_0x5e461a[_0xe6e9('0x35')]['length']?_0x5e461a[_0xe6e9('0x35')]:_0x50be18[_0xe6e9('0x2f')];if(_0x17176d[_0xe6e9('0x30')]['includeAll']){_0x5e461a[_0xe6e9('0x43')]=[{'all':!![]}];}_0x5e461a=_[_0xe6e9('0x3b')]({},_0x5e461a,_0x17176d[_0xe6e9('0x3d')]);return db['FaxApplication'][_0xe6e9('0x44')](_0x5e461a)[_0xe6e9('0x22')](handleEntityNotFound(_0x59eb04,null))[_0xe6e9('0x22')](respondWithResult(_0x59eb04,null))['catch'](handleError(_0x59eb04,null));};exports[_0xe6e9('0x45')]=function(_0x1868da,_0x4b90fb){return db[_0xe6e9('0x3e')][_0xe6e9('0x45')](_0x1868da[_0xe6e9('0x46')],{})['then'](respondWithResult(_0x4b90fb,0xc9))['catch'](handleError(_0x4b90fb,null));};exports[_0xe6e9('0x47')]=function(_0x4d1625,_0x3ed9d1){if(_0x4d1625[_0xe6e9('0x46')]['id']){delete _0x4d1625[_0xe6e9('0x46')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x4d1625[_0xe6e9('0x48')]['id']}})[_0xe6e9('0x22')](handleEntityNotFound(_0x3ed9d1,null))['then'](saveUpdates(_0x4d1625[_0xe6e9('0x46')],null))['then'](respondWithResult(_0x3ed9d1,null))['catch'](handleError(_0x3ed9d1,null));};exports[_0xe6e9('0x23')]=function(_0x481812,_0xf5f312){return db['FaxApplication'][_0xe6e9('0x44')]({'where':{'id':_0x481812[_0xe6e9('0x48')]['id']}})['then'](handleEntityNotFound(_0xf5f312,null))[_0xe6e9('0x22')](removeEntity(_0xf5f312,null))[_0xe6e9('0x41')](handleError(_0xf5f312,null));}; \ No newline at end of file +var _0xdd57=['hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','options','FaxApplication','count','includeAll','findAll','rows','catch','keys','find','create','body','update','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length'];(function(_0x6d1c65,_0x22df6e){var _0x1e96b4=function(_0xc1aac4){while(--_0xc1aac4){_0x6d1c65['push'](_0x6d1c65['shift']());}};_0x1e96b4(++_0x22df6e);}(_0xdd57,0x1d3));var _0x7dd5=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xdd57[_0x1f6f84];return _0x177f40;};'use strict';var emlformat=require(_0x7dd5('0x0'));var rimraf=require(_0x7dd5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dd5('0x2'));var rp=require('request-promise');var moment=require(_0x7dd5('0x3'));var BPromise=require(_0x7dd5('0x4'));var Mustache=require(_0x7dd5('0x5'));var util=require(_0x7dd5('0x6'));var path=require(_0x7dd5('0x7'));var sox=require(_0x7dd5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7dd5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7dd5('0xa'));var jsforce=require(_0x7dd5('0xb'));var deskjs=require(_0x7dd5('0xc'));var toCsv=require(_0x7dd5('0xd'));var querystring=require(_0x7dd5('0xe'));var Papa=require(_0x7dd5('0xf'));var Redis=require(_0x7dd5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7dd5('0x11'));var as=require(_0x7dd5('0x12'));var hardwareService=require(_0x7dd5('0x13'));var logger=require(_0x7dd5('0x14'))(_0x7dd5('0x15'));var utils=require(_0x7dd5('0x16'));var config=require(_0x7dd5('0x17'));var licenseUtil=require(_0x7dd5('0x18'));var db=require(_0x7dd5('0x19'))['db'];function respondWithStatusCode(_0x1719ca,_0x14047f){_0x14047f=_0x14047f||0xcc;return function(_0x5c7fe8){if(_0x5c7fe8){return _0x1719ca[_0x7dd5('0x1a')](_0x14047f);}return _0x1719ca[_0x7dd5('0x1b')](_0x14047f)['end']();};}function respondWithResult(_0x2d9edb,_0x32f416){_0x32f416=_0x32f416||0xc8;return function(_0x51186e){if(_0x51186e){return _0x2d9edb[_0x7dd5('0x1b')](_0x32f416)[_0x7dd5('0x1c')](_0x51186e);}};}function respondWithFilteredResult(_0x266a96,_0x429ad5){return function(_0x49101d){if(_0x49101d){var _0x49dee9=typeof _0x429ad5['offset']===_0x7dd5('0x1d')&&typeof _0x429ad5[_0x7dd5('0x1e')]===_0x7dd5('0x1d');var _0x42591e=_0x49101d['count'];var _0x524993=_0x49dee9?0x0:_0x429ad5['offset'];var _0xa7c642=_0x49dee9?_0x49101d['count']:_0x429ad5['offset']+_0x429ad5['limit'];var _0x151297;if(_0xa7c642>=_0x42591e){_0xa7c642=_0x42591e;_0x151297=0xc8;}else{_0x151297=0xce;}_0x266a96['status'](_0x151297);return _0x266a96[_0x7dd5('0x1f')](_0x7dd5('0x20'),_0x524993+'-'+_0xa7c642+'/'+_0x42591e)[_0x7dd5('0x1c')](_0x49101d);}return null;};}function patchUpdates(_0x451b34){return function(_0x19ec4b){try{jsonpatch[_0x7dd5('0x21')](_0x19ec4b,_0x451b34,!![]);}catch(_0x4b3397){return BPromise[_0x7dd5('0x22')](_0x4b3397);}return _0x19ec4b[_0x7dd5('0x23')]();};}function saveUpdates(_0x5233ee,_0x4837de){return function(_0x334e03){if(_0x334e03){return _0x334e03['update'](_0x5233ee)[_0x7dd5('0x24')](function(_0x1cbd11){return _0x1cbd11;});}return null;};}function removeEntity(_0xa0f3b4,_0x4fed3b){return function(_0xa52c89){if(_0xa52c89){return _0xa52c89['destroy']()[_0x7dd5('0x24')](function(){_0xa0f3b4[_0x7dd5('0x1b')](0xcc)[_0x7dd5('0x25')]();});}};}function handleEntityNotFound(_0x153ada,_0x3fb53f){return function(_0x1fb0a2){if(!_0x1fb0a2){_0x153ada[_0x7dd5('0x1a')](0x194);}return _0x1fb0a2;};}function handleError(_0x279e48,_0x45077d){_0x45077d=_0x45077d||0x1f4;return function(_0x3d066f){logger[_0x7dd5('0x26')](_0x3d066f[_0x7dd5('0x27')]);if(_0x3d066f[_0x7dd5('0x28')]){delete _0x3d066f[_0x7dd5('0x28')];}_0x279e48['status'](_0x45077d)['send'](_0x3d066f);};}exports['index']=function(_0x57a620,_0x511a04){var _0x1bba45={},_0x56f0af={},_0x44a047={'count':0x0,'rows':[]};var _0xe04ba1=_[_0x7dd5('0x29')](db['FaxApplication'][_0x7dd5('0x2a')],function(_0x2d3ca3){return{'name':_0x2d3ca3[_0x7dd5('0x2b')],'type':_0x2d3ca3['type'][_0x7dd5('0x2c')]};});_0x56f0af[_0x7dd5('0x2d')]=_[_0x7dd5('0x29')](_0xe04ba1,'name');_0x56f0af[_0x7dd5('0x2e')]=_['keys'](_0x57a620[_0x7dd5('0x2e')]);_0x56f0af['filters']=_[_0x7dd5('0x2f')](_0x56f0af['model'],_0x56f0af[_0x7dd5('0x2e')]);_0x1bba45['attributes']=_['intersection'](_0x56f0af[_0x7dd5('0x2d')],qs['fields'](_0x57a620['query'][_0x7dd5('0x30')]));_0x1bba45['attributes']=_0x1bba45[_0x7dd5('0x31')][_0x7dd5('0x32')]?_0x1bba45[_0x7dd5('0x31')]:_0x56f0af[_0x7dd5('0x2d')];if(!_0x57a620['query'][_0x7dd5('0x33')](_0x7dd5('0x34'))){_0x1bba45[_0x7dd5('0x1e')]=qs[_0x7dd5('0x1e')](_0x57a620['query'][_0x7dd5('0x1e')]);_0x1bba45[_0x7dd5('0x35')]=qs['offset'](_0x57a620[_0x7dd5('0x2e')][_0x7dd5('0x35')]);}_0x1bba45[_0x7dd5('0x36')]=qs[_0x7dd5('0x37')](_0x57a620[_0x7dd5('0x2e')][_0x7dd5('0x37')]);_0x1bba45[_0x7dd5('0x38')]=qs[_0x7dd5('0x39')](_['pick'](_0x57a620[_0x7dd5('0x2e')],_0x56f0af[_0x7dd5('0x39')]),_0xe04ba1);if(_0x57a620['query'][_0x7dd5('0x3a')]){_0x1bba45[_0x7dd5('0x38')]=_[_0x7dd5('0x3b')](_0x1bba45[_0x7dd5('0x38')],{'$or':_[_0x7dd5('0x29')](_0xe04ba1,function(_0x118bca){if(_0x118bca[_0x7dd5('0x3c')]!=='VIRTUAL'){var _0x2a5b28={};_0x2a5b28[_0x118bca[_0x7dd5('0x28')]]={'$like':'%'+_0x57a620[_0x7dd5('0x2e')][_0x7dd5('0x3a')]+'%'};return _0x2a5b28;}})});}_0x1bba45=_[_0x7dd5('0x3b')]({},_0x1bba45,_0x57a620[_0x7dd5('0x3d')]);var _0xd34fd8={'where':_0x1bba45['where']};return db[_0x7dd5('0x3e')][_0x7dd5('0x3f')](_0xd34fd8)[_0x7dd5('0x24')](function(_0x2e8a1b){_0x44a047['count']=_0x2e8a1b;if(_0x57a620['query'][_0x7dd5('0x40')]){_0x1bba45['include']=[{'all':!![]}];}return db[_0x7dd5('0x3e')][_0x7dd5('0x41')](_0x1bba45);})['then'](function(_0x574524){_0x44a047[_0x7dd5('0x42')]=_0x574524;return _0x44a047;})[_0x7dd5('0x24')](respondWithFilteredResult(_0x511a04,_0x1bba45))[_0x7dd5('0x43')](handleError(_0x511a04,null));};exports['show']=function(_0x53705e,_0x2d8591){var _0x423ce9={'raw':!![],'where':{'id':_0x53705e['params']['id']}},_0x48487d={};_0x48487d[_0x7dd5('0x2d')]=_[_0x7dd5('0x44')](db[_0x7dd5('0x3e')][_0x7dd5('0x2a')]);_0x48487d[_0x7dd5('0x2e')]=_[_0x7dd5('0x44')](_0x53705e[_0x7dd5('0x2e')]);_0x48487d[_0x7dd5('0x39')]=_[_0x7dd5('0x2f')](_0x48487d['model'],_0x48487d['query']);_0x423ce9[_0x7dd5('0x31')]=_[_0x7dd5('0x2f')](_0x48487d[_0x7dd5('0x2d')],qs[_0x7dd5('0x30')](_0x53705e[_0x7dd5('0x2e')][_0x7dd5('0x30')]));_0x423ce9[_0x7dd5('0x31')]=_0x423ce9[_0x7dd5('0x31')][_0x7dd5('0x32')]?_0x423ce9[_0x7dd5('0x31')]:_0x48487d[_0x7dd5('0x2d')];if(_0x53705e[_0x7dd5('0x2e')][_0x7dd5('0x40')]){_0x423ce9['include']=[{'all':!![]}];}_0x423ce9=_['merge']({},_0x423ce9,_0x53705e[_0x7dd5('0x3d')]);return db[_0x7dd5('0x3e')][_0x7dd5('0x45')](_0x423ce9)['then'](handleEntityNotFound(_0x2d8591,null))[_0x7dd5('0x24')](respondWithResult(_0x2d8591,null))['catch'](handleError(_0x2d8591,null));};exports[_0x7dd5('0x46')]=function(_0x262686,_0x30a763){return db['FaxApplication'][_0x7dd5('0x46')](_0x262686[_0x7dd5('0x47')],{})[_0x7dd5('0x24')](respondWithResult(_0x30a763,0xc9))['catch'](handleError(_0x30a763,null));};exports[_0x7dd5('0x48')]=function(_0x27ab6d,_0x251f20){if(_0x27ab6d[_0x7dd5('0x47')]['id']){delete _0x27ab6d[_0x7dd5('0x47')]['id'];}return db[_0x7dd5('0x3e')][_0x7dd5('0x45')]({'where':{'id':_0x27ab6d[_0x7dd5('0x49')]['id']}})[_0x7dd5('0x24')](handleEntityNotFound(_0x251f20,null))['then'](saveUpdates(_0x27ab6d[_0x7dd5('0x47')],null))[_0x7dd5('0x24')](respondWithResult(_0x251f20,null))[_0x7dd5('0x43')](handleError(_0x251f20,null));};exports['destroy']=function(_0x2c05b7,_0x1d3e0d){return db[_0x7dd5('0x3e')][_0x7dd5('0x45')]({'where':{'id':_0x2c05b7[_0x7dd5('0x49')]['id']}})[_0x7dd5('0x24')](handleEntityNotFound(_0x1d3e0d,null))[_0x7dd5('0x24')](removeEntity(_0x1d3e0d,null))[_0x7dd5('0x43')](handleError(_0x1d3e0d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ae0cb9f..f77e1e2 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45d0=['FaxApplication','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x54c259,_0x2f6813){var _0x2c1e04=function(_0x3f6e5a){while(--_0x3f6e5a){_0x54c259['push'](_0x54c259['shift']());}};_0x2c1e04(++_0x2f6813);}(_0x45d0,0xb8));var _0x045d=function(_0xe7c01e,_0xc06596){_0xe7c01e=_0xe7c01e-0x0;var _0x59095a=_0x45d0[_0xe7c01e];return _0x59095a;};'use strict';var _=require(_0x045d('0x0'));var util=require('util');var logger=require(_0x045d('0x1'))(_0x045d('0x2'));var moment=require(_0x045d('0x3'));var BPromise=require(_0x045d('0x4'));var rp=require(_0x045d('0x5'));var fs=require('fs');var path=require(_0x045d('0x6'));var rimraf=require(_0x045d('0x7'));var config=require(_0x045d('0x8'));var attributes=require(_0x045d('0x9'));module[_0x045d('0xa')]=function(_0x3dd6f2,_0x52bc9e){return _0x3dd6f2[_0x045d('0xb')](_0x045d('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x045d('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xae59=['fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxApplication.attributes','exports','FaxApplication'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xae59,0x17c));var _0x9ae5=function(_0x5d4779,_0x2e3fb8){_0x5d4779=_0x5d4779-0x0;var _0x1ad4e6=_0xae59[_0x5d4779];return _0x1ad4e6;};'use strict';var _=require('lodash');var util=require(_0x9ae5('0x0'));var logger=require(_0x9ae5('0x1'))(_0x9ae5('0x2'));var moment=require(_0x9ae5('0x3'));var BPromise=require(_0x9ae5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ae5('0x5'));var rimraf=require(_0x9ae5('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ae5('0x7'));module[_0x9ae5('0x8')]=function(_0x33a9ed,_0x2622ca){return _0x33a9ed['define'](_0x9ae5('0x9'),attributes,{'tableName':_0x9ae5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ae5('0xb'),'collate':_0x9ae5('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2746845..9e69f16 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ba5=['UpdateFaxApplication','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','update','body','options','attributes','limit'];(function(_0x113374,_0x59e4a6){var _0x1f0036=function(_0x1593da){while(--_0x1593da){_0x113374['push'](_0x113374['shift']());}};_0x1f0036(++_0x59e4a6);}(_0x6ba5,0x1ef));var _0x56ba=function(_0x23f7aa,_0xddb5ef){_0x23f7aa=_0x23f7aa-0x0;var _0x37441b=_0x6ba5[_0x23f7aa];return _0x37441b;};'use strict';var _=require(_0x56ba('0x0'));var util=require(_0x56ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56ba('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56ba('0x3'))['db'];var utils=require(_0x56ba('0x4'));var logger=require(_0x56ba('0x5'))(_0x56ba('0x6'));var config=require(_0x56ba('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa6a2f4,_0x393205,_0x465645){return new BPromise(function(_0x1e200b,_0x4f5f10){return client[_0x56ba('0x8')](_0xa6a2f4,_0x465645)['then'](function(_0x4a79f4){logger[_0x56ba('0x9')](_0x56ba('0xa'),_0x393205,'request\x20sent');logger[_0x56ba('0xb')](_0x56ba('0xc'),_0x393205,_0x56ba('0xd'),JSON[_0x56ba('0xe')](_0x4a79f4));if(_0x4a79f4[_0x56ba('0xf')]){if(_0x4a79f4[_0x56ba('0xf')][_0x56ba('0x10')]===0x1f4){logger[_0x56ba('0xf')](_0x56ba('0xa'),_0x393205,_0x4a79f4[_0x56ba('0xf')][_0x56ba('0x11')]);return _0x4f5f10(_0x4a79f4[_0x56ba('0xf')][_0x56ba('0x11')]);}logger[_0x56ba('0xf')](_0x56ba('0xa'),_0x393205,_0x4a79f4['error'][_0x56ba('0x11')]);return _0x1e200b(_0x4a79f4[_0x56ba('0xf')]['message']);}else{logger[_0x56ba('0x9')]('FaxApplication,\x20%s,\x20%s',_0x393205,_0x56ba('0xd'));_0x1e200b(_0x4a79f4[_0x56ba('0x12')][_0x56ba('0x11')]);}})[_0x56ba('0x13')](function(_0x597ad4){logger['error'](_0x56ba('0xa'),_0x393205,_0x597ad4);_0x4f5f10(_0x597ad4);});});}exports['UpdateFaxApplication']=function(_0x162c4c){var _0x56f107=this;return new Promise(function(_0x51652b,_0x430c96){return db['FaxApplication'][_0x56ba('0x14')](_0x162c4c[_0x56ba('0x15')],{'raw':_0x162c4c['options']?_0x162c4c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x162c4c['options']?_0x162c4c[_0x56ba('0x16')]['where']||null:null,'attributes':_0x162c4c[_0x56ba('0x16')]?_0x162c4c['options'][_0x56ba('0x17')]||null:null,'limit':_0x162c4c[_0x56ba('0x16')]?_0x162c4c[_0x56ba('0x16')][_0x56ba('0x18')]||null:null})['then'](function(_0x122352){logger[_0x56ba('0x9')](_0x56ba('0x19'),_0x162c4c);logger[_0x56ba('0xb')](_0x56ba('0x19'),_0x162c4c,JSON[_0x56ba('0xe')](_0x122352));_0x51652b(_0x122352);})['catch'](function(_0x2fa1da){logger[_0x56ba('0xf')](_0x56ba('0x19'),_0x2fa1da[_0x56ba('0x11')],_0x162c4c);_0x430c96(_0x56f107[_0x56ba('0xf')](0x1f4,_0x2fa1da[_0x56ba('0x11')]));});});}; \ No newline at end of file +var _0xe20d=['attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where'];(function(_0x68c1f5,_0xf9567){var _0x53ed77=function(_0x54feff){while(--_0x54feff){_0x68c1f5['push'](_0x68c1f5['shift']());}};_0x53ed77(++_0xf9567);}(_0xe20d,0x1bd));var _0xde20=function(_0x35c84e,_0xd7ebb9){_0x35c84e=_0x35c84e-0x0;var _0x5d7aa7=_0xe20d[_0x35c84e];return _0x5d7aa7;};'use strict';var _=require(_0xde20('0x0'));var util=require(_0xde20('0x1'));var moment=require(_0xde20('0x2'));var BPromise=require(_0xde20('0x3'));var rs=require(_0xde20('0x4'));var fs=require('fs');var Redis=require(_0xde20('0x5'));var db=require(_0xde20('0x6'))['db'];var utils=require(_0xde20('0x7'));var logger=require(_0xde20('0x8'))(_0xde20('0x9'));var config=require(_0xde20('0xa'));var jayson=require(_0xde20('0xb'));var client=jayson[_0xde20('0xc')][_0xde20('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x10c321,_0x3a4bad,_0x5e0d99){return new BPromise(function(_0x185dd4,_0x3f9053){return client[_0xde20('0xe')](_0x10c321,_0x5e0d99)[_0xde20('0xf')](function(_0x4dbf22){logger[_0xde20('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3a4bad,_0xde20('0x11'));logger[_0xde20('0x12')](_0xde20('0x13'),_0x3a4bad,_0xde20('0x11'),JSON['stringify'](_0x4dbf22));if(_0x4dbf22['error']){if(_0x4dbf22[_0xde20('0x14')][_0xde20('0x15')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x3a4bad,_0x4dbf22[_0xde20('0x14')][_0xde20('0x16')]);return _0x3f9053(_0x4dbf22['error'][_0xde20('0x16')]);}logger[_0xde20('0x14')](_0xde20('0x17'),_0x3a4bad,_0x4dbf22['error'][_0xde20('0x16')]);return _0x185dd4(_0x4dbf22['error'][_0xde20('0x16')]);}else{logger[_0xde20('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3a4bad,_0xde20('0x11'));_0x185dd4(_0x4dbf22[_0xde20('0x18')][_0xde20('0x16')]);}})[_0xde20('0x19')](function(_0x87e9b6){logger[_0xde20('0x14')](_0xde20('0x17'),_0x3a4bad,_0x87e9b6);_0x3f9053(_0x87e9b6);});});}exports[_0xde20('0x1a')]=function(_0x1d2272){var _0x57fe5a=this;return new Promise(function(_0x4868fd,_0x2a8a0f){return db[_0xde20('0x1b')]['update'](_0x1d2272['body'],{'raw':_0x1d2272[_0xde20('0x1c')]?_0x1d2272[_0xde20('0x1c')][_0xde20('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d2272[_0xde20('0x1c')]?_0x1d2272['options'][_0xde20('0x1e')]||null:null,'attributes':_0x1d2272[_0xde20('0x1c')]?_0x1d2272[_0xde20('0x1c')][_0xde20('0x1f')]||null:null,'limit':_0x1d2272[_0xde20('0x1c')]?_0x1d2272[_0xde20('0x1c')][_0xde20('0x20')]||null:null})[_0xde20('0xf')](function(_0x400c0f){logger[_0xde20('0x10')](_0xde20('0x1a'),_0x1d2272);logger[_0xde20('0x12')]('UpdateFaxApplication',_0x1d2272,JSON[_0xde20('0x21')](_0x400c0f));_0x4868fd(_0x400c0f);})['catch'](function(_0x20ea13){logger[_0xde20('0x14')](_0xde20('0x1a'),_0x20ea13[_0xde20('0x16')],_0x1d2272);_0x2a8a0f(_0x57fe5a[_0xde20('0x14')](0x1f4,_0x20ea13[_0xde20('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 505882b..b06a866 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea28,0x13a));var _0x8ea2=function(_0x25a945,_0x45b040){_0x25a945=_0x25a945-0x0;var _0x2ec358=_0xea28[_0x25a945];return _0x2ec358;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router; \ No newline at end of file +var _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x283de8,_0x2a77d8){var _0x448f9b=function(_0xd214d8){while(--_0xd214d8){_0x283de8['push'](_0x283de8['shift']());}};_0x448f9b(++_0x2a77d8);}(_0x4213,0x77));var _0x3421=function(_0x264b10,_0x510e2e){_0x264b10=_0x264b10-0x0;var _0xc3722d=_0x4213[_0x264b10];return _0xc3722d;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e3b5d96..799b8a5 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b2b=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x3b2b,0x70));var _0xb3b2=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x3b2b[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require(_0xb3b2('0x0'));module[_0xb3b2('0x1')]={'closed':{'type':Sequelize[_0xb3b2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb3b2('0x3')]},'disposition':{'type':Sequelize[_0xb3b2('0x4')]},'secondDisposition':{'type':Sequelize[_0xb3b2('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb3b2('0x4')]},'note':{'type':Sequelize[_0xb3b2('0x4')]},'read1stAt':{'type':Sequelize[_0xb3b2('0x3')]},'fax':{'type':Sequelize[_0xb3b2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb3b2('0x5')]('in',_0xb3b2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb3b2('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb3b2('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb020=['BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x5dbe75,_0x5d23e0){var _0x528bd3=function(_0x208192){while(--_0x208192){_0x5dbe75['push'](_0x5dbe75['shift']());}};_0x528bd3(++_0x5d23e0);}(_0xb020,0x86));var _0x0b02=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xb020[_0x9b3efc];return _0x200f05;};'use strict';var Sequelize=require(_0x0b02('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0b02('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0b02('0x2')]},'disposition':{'type':Sequelize[_0x0b02('0x3')]},'secondDisposition':{'type':Sequelize[_0x0b02('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0b02('0x3')]},'note':{'type':Sequelize[_0x0b02('0x3')]},'read1stAt':{'type':Sequelize[_0x0b02('0x2')]},'fax':{'type':Sequelize[_0x0b02('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b02('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0b02('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b02('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 5954fd9..7e8c244 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb225=['filter','where','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','spread','Tag','color','emit','removeTags','download','toString','join','root','server','files','attachments','push','Attachment','createdAt','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','send','rawAttributes','type','key','getOptions','findAll','fax','model','keys','query','filters','intersection','attributes','fields','length','include','merge','options','FaxInteraction','find','catch','create','body','params','describe','FaxMessage','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','pick'];(function(_0x58e62f,_0x38ea46){var _0x7ed624=function(_0x1a95a3){while(--_0x1a95a3){_0x58e62f['push'](_0x58e62f['shift']());}};_0x7ed624(++_0x38ea46);}(_0xb225,0x153));var _0x5b22=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0xb225[_0x383627];return _0x2c16a0;};'use strict';var rimraf=require(_0x5b22('0x0'));var zipdir=require(_0x5b22('0x1'));var moment=require(_0x5b22('0x2'));var BPromise=require(_0x5b22('0x3'));var util=require(_0x5b22('0x4'));var path=require(_0x5b22('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x5b22('0x6'));var interaction=require(_0x5b22('0x7'));var qs=require(_0x5b22('0x8'));var logger=require(_0x5b22('0x9'))(_0x5b22('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5b22('0xb')]=_[_0x5b22('0xc')](config[_0x5b22('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b22('0xd'))(new Redis(config['redis']));require(_0x5b22('0xe'))[_0x5b22('0xf')](socket);function respondWithStatusCode(_0x21e374,_0x27b514){_0x27b514=_0x27b514||0xcc;return function(_0x5eda1b){if(_0x5eda1b){return _0x21e374[_0x5b22('0x10')](_0x27b514);}return _0x21e374[_0x5b22('0x11')](_0x27b514)[_0x5b22('0x12')]();};}function respondWithResult(_0xc1a15a,_0x52ea7d){_0x52ea7d=_0x52ea7d||0xc8;return function(_0x8ab472){if(_0x8ab472){return _0xc1a15a['status'](_0x52ea7d)[_0x5b22('0x13')](_0x8ab472);}};}function respondWithFilteredResult(_0x5a63be,_0x39ec01){return function(_0x27c586){if(_0x27c586){var _0x27ea4c=typeof _0x39ec01[_0x5b22('0x14')]===_0x5b22('0x15')&&typeof _0x39ec01['limit']===_0x5b22('0x15');var _0x187fe4=_0x27c586[_0x5b22('0x16')];var _0x43a1f9=_0x27ea4c?0x0:_0x39ec01[_0x5b22('0x14')];var _0x5ec0af=_0x27ea4c?_0x27c586[_0x5b22('0x16')]:_0x39ec01[_0x5b22('0x14')]+_0x39ec01[_0x5b22('0x17')];var _0xed225e;if(_0x5ec0af>=_0x187fe4){_0x5ec0af=_0x187fe4;_0xed225e=0xc8;}else{_0xed225e=0xce;}_0x5a63be[_0x5b22('0x11')](_0xed225e);return _0x5a63be['set'](_0x5b22('0x18'),_0x43a1f9+'-'+_0x5ec0af+'/'+_0x187fe4)[_0x5b22('0x13')](_0x27c586);}return null;};}function saveUpdates(_0x2506c7){return function(_0x4f4dc3){if(_0x4f4dc3){return _0x4f4dc3[_0x5b22('0x19')](_0x2506c7)[_0x5b22('0x1a')](function(_0xf49db8){return _0xf49db8;});}return null;};}function removeEntity(_0x26df64){return function(_0x1743b0){if(_0x1743b0){return _0x1743b0[_0x5b22('0x1b')]()[_0x5b22('0x1a')](function(){_0x26df64[_0x5b22('0x11')](0xcc)[_0x5b22('0x12')]();});}};}function handleEntityNotFound(_0x33821d){return function(_0x17ec31){if(!_0x17ec31){_0x33821d[_0x5b22('0x10')](0x194);}return _0x17ec31;};}function handleError(_0x4a37ea,_0xafdaed){_0xafdaed=_0xafdaed||0x1f4;return function(_0x4b5162){logger[_0x5b22('0x1c')](_0x4b5162[_0x5b22('0x1d')]);if(_0x4b5162[_0x5b22('0x1e')]){delete _0x4b5162[_0x5b22('0x1e')];}_0x4a37ea[_0x5b22('0x11')](_0xafdaed)[_0x5b22('0x1f')](_0x4b5162);};}exports['index']=function(_0x246838,_0x4ee13e){var _0x2f4cce={};var _0x2359af=_['map'](db['FaxInteraction'][_0x5b22('0x20')],function(_0x1ef20a){return{'name':_0x1ef20a['fieldName'],'type':_0x1ef20a[_0x5b22('0x21')][_0x5b22('0x22')]};});_0x2f4cce=qs[_0x5b22('0x23')](_0x2359af,_0x246838);return interaction[_0x5b22('0x24')](_0x5b22('0x25'),_0x246838['query'],_0x246838['user'],_0x2f4cce,_0x2359af)['then'](respondWithFilteredResult(_0x4ee13e,_0x2f4cce))['catch'](handleError(_0x4ee13e,null));};exports['show']=function(_0x5291c7,_0x153270){var _0x351b1d={'raw':![],'where':{'id':_0x5291c7['params']['id']}},_0x18d23f={};_0x18d23f[_0x5b22('0x26')]=_[_0x5b22('0x27')](db['FaxInteraction']['rawAttributes']);_0x18d23f['query']=_[_0x5b22('0x27')](_0x5291c7[_0x5b22('0x28')]);_0x18d23f[_0x5b22('0x29')]=_[_0x5b22('0x2a')](_0x18d23f[_0x5b22('0x26')],_0x18d23f[_0x5b22('0x28')]);_0x351b1d[_0x5b22('0x2b')]=_['intersection'](_0x18d23f[_0x5b22('0x26')],qs[_0x5b22('0x2c')](_0x5291c7['query'][_0x5b22('0x2c')]));_0x351b1d[_0x5b22('0x2b')]=_0x351b1d[_0x5b22('0x2b')][_0x5b22('0x2d')]?_0x351b1d[_0x5b22('0x2b')]:_0x18d23f[_0x5b22('0x26')];if(_0x5291c7['query']['includeAll']){_0x351b1d[_0x5b22('0x2e')]=[{'all':!![]}];}_0x351b1d=_[_0x5b22('0x2f')]({},_0x351b1d,_0x5291c7[_0x5b22('0x30')]);return db[_0x5b22('0x31')][_0x5b22('0x32')](_0x351b1d)['then'](handleEntityNotFound(_0x153270,null))['then'](respondWithResult(_0x153270,null))[_0x5b22('0x33')](handleError(_0x153270,null));};exports[_0x5b22('0x34')]=function(_0x46a99a,_0x133492){return db[_0x5b22('0x31')][_0x5b22('0x34')](_0x46a99a[_0x5b22('0x35')],{})[_0x5b22('0x1a')](respondWithResult(_0x133492,0xc9))[_0x5b22('0x33')](handleError(_0x133492,null));};exports[_0x5b22('0x19')]=function(_0x163460,_0x2870bd){if(_0x163460[_0x5b22('0x35')]['id']){delete _0x163460[_0x5b22('0x35')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x163460[_0x5b22('0x36')]['id']}})[_0x5b22('0x1a')](handleEntityNotFound(_0x2870bd,null))['then'](saveUpdates(_0x163460[_0x5b22('0x35')],null))[_0x5b22('0x1a')](respondWithResult(_0x2870bd,null))[_0x5b22('0x33')](handleError(_0x2870bd,null));};exports[_0x5b22('0x1b')]=function(_0x10e703,_0x4c1bf6){return db[_0x5b22('0x31')][_0x5b22('0x32')]({'where':{'id':_0x10e703[_0x5b22('0x36')]['id']}})[_0x5b22('0x1a')](handleEntityNotFound(_0x4c1bf6,null))['then'](removeEntity(_0x4c1bf6,null))[_0x5b22('0x33')](handleError(_0x4c1bf6,null));};exports[_0x5b22('0x37')]=function(_0xedfdaa,_0x33bb11){return db[_0x5b22('0x31')][_0x5b22('0x37')]()[_0x5b22('0x1a')](respondWithResult(_0x33bb11,null))[_0x5b22('0x33')](handleError(_0x33bb11,null));};exports['addMessage']=function(_0x58cb8b,_0x374ad2){return db[_0x5b22('0x38')]['find']({'where':{'id':_0x58cb8b[_0x5b22('0x36')]['id']}})[_0x5b22('0x1a')](handleEntityNotFound(_0x374ad2,null))['then'](function(_0x14fe93){if(_0x14fe93){return _0x14fe93[_0x5b22('0x39')](_0x58cb8b['body'][_0x5b22('0x3a')],_[_0x5b22('0x3b')](_0x58cb8b[_0x5b22('0x35')],['ids','id'])||{});}})[_0x5b22('0x1a')](respondWithResult(_0x374ad2,null))['catch'](handleError(_0x374ad2,null));};exports[_0x5b22('0x3c')]=function(_0x507bd9,_0x38533a){var _0x200a78={'raw':![],'where':{}};var _0x52988b={};var _0x4a71ac={'count':0x0,'rows':[]};return db[_0x5b22('0x31')]['findOne']({'where':{'id':_0x507bd9[_0x5b22('0x36')]['id']}})['then'](handleEntityNotFound(_0x38533a,null))['then'](function(_0x182d53){if(_0x182d53){_0x52988b[_0x5b22('0x26')]=_[_0x5b22('0x27')](db[_0x5b22('0x38')][_0x5b22('0x20')]);_0x52988b[_0x5b22('0x28')]=_[_0x5b22('0x27')](_0x507bd9[_0x5b22('0x28')]);_0x52988b[_0x5b22('0x29')]=_[_0x5b22('0x2a')](_0x52988b[_0x5b22('0x26')],_0x52988b[_0x5b22('0x28')]);_0x200a78[_0x5b22('0x2b')]=_[_0x5b22('0x2a')](_0x52988b[_0x5b22('0x26')],qs[_0x5b22('0x2c')](_0x507bd9[_0x5b22('0x28')][_0x5b22('0x2c')]));_0x200a78[_0x5b22('0x2b')]=_0x200a78[_0x5b22('0x2b')]['length']?_0x200a78['attributes']:_0x52988b[_0x5b22('0x26')];if(!_0x507bd9[_0x5b22('0x28')][_0x5b22('0x3d')]('nolimit')){_0x200a78[_0x5b22('0x17')]=qs[_0x5b22('0x17')](_0x507bd9[_0x5b22('0x28')][_0x5b22('0x17')]);_0x200a78[_0x5b22('0x14')]=qs[_0x5b22('0x14')](_0x507bd9[_0x5b22('0x28')][_0x5b22('0x14')]);}_0x200a78[_0x5b22('0x3e')]=qs[_0x5b22('0x3f')](_0x507bd9[_0x5b22('0x28')]['sort']);_0x200a78['where']=qs['filters'](_[_0x5b22('0x40')](_0x507bd9[_0x5b22('0x28')],_0x52988b[_0x5b22('0x29')]));_0x200a78['where']['FaxInteractionId']=_0x182d53['id'];if(_0x507bd9[_0x5b22('0x28')][_0x5b22('0x41')]){_0x200a78['where']=_[_0x5b22('0x2f')](_0x200a78[_0x5b22('0x42')],{'$or':_[_0x5b22('0x43')](_0x200a78[_0x5b22('0x2b')],function(_0x292e01){var _0x214126={};_0x214126[_0x292e01]={'$like':'%'+_0x507bd9[_0x5b22('0x28')][_0x5b22('0x41')]+'%'};return _0x214126;})});}if(_0x507bd9[_0x5b22('0x28')][_0x5b22('0x44')]){var _0x44c960=_0x507bd9[_0x5b22('0x28')]['$gte'][_0x5b22('0x45')](',');var _0xdc16a={};_0xdc16a[_0x44c960[0x0]]={'$gte':moment(_0x44c960[0x1])[_0x5b22('0x46')](_0x5b22('0x47'))};_0x200a78['where']=_['merge'](_0x200a78[_0x5b22('0x42')],_0xdc16a);}_0x200a78=_[_0x5b22('0x2f')]({},_0x200a78,_0x507bd9['options']);return db[_0x5b22('0x38')][_0x5b22('0x16')]({'where':_0x200a78[_0x5b22('0x42')]})[_0x5b22('0x1a')](function(_0x280e71){_0x4a71ac[_0x5b22('0x16')]=_0x280e71;if(_0x507bd9[_0x5b22('0x28')][_0x5b22('0x48')]){_0x200a78[_0x5b22('0x2e')]=[{'all':!![]}];}return db[_0x5b22('0x38')][_0x5b22('0x24')](_0x200a78);})[_0x5b22('0x1a')](function(_0x3273db){_0x4a71ac[_0x5b22('0x49')]=_0x3273db;return _0x4a71ac;});}})['then'](respondWithFilteredResult(_0x38533a,_0x200a78))[_0x5b22('0x33')](handleError(_0x38533a,null));};exports[_0x5b22('0x4a')]=function(_0x53e08a,_0x5e769a){return db['FaxInteraction']['find']({'where':{'id':_0x53e08a[_0x5b22('0x36')]['id']}})[_0x5b22('0x1a')](handleEntityNotFound(_0x5e769a,null))[_0x5b22('0x1a')](function(_0x203fcc){if(_0x203fcc){return _0x203fcc['setTags'](_0x53e08a[_0x5b22('0x35')][_0x5b22('0x3a')],_[_0x5b22('0x3b')](_0x53e08a[_0x5b22('0x35')],[_0x5b22('0x3a'),'id'])||{})[_0x5b22('0x4b')](function(){return db[_0x5b22('0x4c')][_0x5b22('0x24')]({'attributes':['id',_0x5b22('0x1e'),_0x5b22('0x4d')],'where':{'id':_0x53e08a[_0x5b22('0x35')][_0x5b22('0x3a')]}});})[_0x5b22('0x1a')](function(_0x1f37c5){socket[_0x5b22('0x4e')]('faxInteractionTags:save',{'id':Number(_0x53e08a[_0x5b22('0x36')]['id']),'tags':_0x1f37c5||[]});return{'id':Number(_0x53e08a[_0x5b22('0x36')]['id']),'tags':_0x1f37c5||[]};});}})['then'](respondWithResult(_0x5e769a,null))[_0x5b22('0x33')](handleError(_0x5e769a,null));};exports[_0x5b22('0x4f')]=function(_0x282df9,_0x720181){return db[_0x5b22('0x31')][_0x5b22('0x32')]({'where':{'id':_0x282df9[_0x5b22('0x36')]['id']}})[_0x5b22('0x1a')](handleEntityNotFound(_0x720181,null))[_0x5b22('0x1a')](function(_0x526234){if(_0x526234){return _0x526234['removeTags'](_0x282df9['query'][_0x5b22('0x3a')]);}})['then'](respondWithStatusCode(_0x720181,null))[_0x5b22('0x33')](handleError(_0x720181,null));};exports[_0x5b22('0x50')]=function(_0x398b1c,_0xb636c8){var _0x4c2bf6=moment()['unix']()[_0x5b22('0x51')]();var _0x453fc4=path[_0x5b22('0x52')](config[_0x5b22('0x53')],_0x5b22('0x54'),_0x5b22('0x55'),'tmp');var _0x3a6f77=path['join'](config['root'],'server',_0x5b22('0x55'),_0x5b22('0x56'));var _0x70397=path['join'](_0x453fc4,_0x4c2bf6);var _0x29b886=util['format']('transcript-%d-%s.zip',_0x398b1c[_0x5b22('0x36')]['id'],_0x4c2bf6);var _0x4e2c62=path['join'](_0x453fc4,_0x29b886);var _0x23782c=[];_0x23782c[_0x5b22('0x57')]({'model':db[_0x5b22('0x58')],'as':_0x5b22('0x58'),'raw':!![]});var _0x90ac34=[{'model':db[_0x5b22('0x38')],'as':'Messages','attributes':['id',_0x5b22('0x35'),_0x5b22('0x59')],'include':_0x23782c}];return db['FaxInteraction']['find']({'where':{'id':_0x398b1c['params']['id']},'include':_0x90ac34})[_0x5b22('0x1a')](handleEntityNotFound(_0xb636c8,null))[_0x5b22('0x1a')](function(_0x5d2ecc){if(_0x5d2ecc&&_0x5d2ecc[_0x5b22('0x5a')]){var _0x190171=_0x5d2ecc[_0x5b22('0x5b')]({'plain':!![]});fs[_0x5b22('0x5c')](_0x70397);for(var _0x3e94a9=0x0;_0x3e94a9<_0x190171[_0x5b22('0x5a')]['length'];_0x3e94a9++){var _0x343867=_0x190171[_0x5b22('0x5a')][_0x3e94a9]['Attachment'];if(_0x343867){var _0x2f8353=path[_0x5b22('0x52')](_0x3a6f77,_0x343867[_0x5b22('0x5d')]);if(fs[_0x5b22('0x5e')](_0x2f8353)){fs[_0x5b22('0x5f')](_0x2f8353)[_0x5b22('0x60')](fs[_0x5b22('0x61')](path[_0x5b22('0x52')](_0x70397,_0x343867[_0x5b22('0x5d')])));}}}return BPromise[_0x5b22('0x62')]()['then'](function(){return new BPromise(function(_0x18fe82,_0x207e60){zipdir(_0x70397,{'saveTo':_0x4e2c62},function(_0x211fb6,_0x29bec7){if(_0x211fb6)return _0x207e60(_0x211fb6);return _0x18fe82(_0x29bec7);});})['then'](function(){return new BPromise(function(_0x502c3f,_0x102d1b){rimraf(_0x70397,function(_0x354670){if(_0x354670)_0x102d1b(_0x354670);return _0x502c3f();});});})[_0x5b22('0x1a')](function(){return _0xb636c8['download'](_0x4e2c62,_0x29b886,function(_0x2ff715){if(_0x2ff715){console['log'](_0x5b22('0x63'),_0x2ff715);}else{fs[_0x5b22('0x64')](_0x4e2c62);}});});});}else{return _0xb636c8['sendStatus'](0xc8);}})['catch'](handleError(_0xb636c8,null));}; \ No newline at end of file +var _0xa214=['color','emit','faxInteractionTags:save','download','unix','toString','join','root','files','tmp','server','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','log','err','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','length','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xa214,0x1b1));var _0x4a21=function(_0x236935,_0x7072eb){_0x236935=_0x236935-0x0;var _0x41c2fa=_0xa214[_0x236935];return _0x41c2fa;};'use strict';var rimraf=require(_0x4a21('0x0'));var zipdir=require(_0x4a21('0x1'));var moment=require(_0x4a21('0x2'));var BPromise=require(_0x4a21('0x3'));var util=require('util');var path=require(_0x4a21('0x4'));var fs=require('fs');var _=require(_0x4a21('0x5'));var Redis=require(_0x4a21('0x6'));var interaction=require(_0x4a21('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4a21('0x8'));var config=require(_0x4a21('0x9'));var db=require(_0x4a21('0xa'))['db'];config[_0x4a21('0xb')]=_['defaults'](config[_0x4a21('0xb')],{'host':_0x4a21('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a21('0xb')]));require(_0x4a21('0xd'))[_0x4a21('0xe')](socket);function respondWithStatusCode(_0x44572e,_0x14f53c){_0x14f53c=_0x14f53c||0xcc;return function(_0x5820c8){if(_0x5820c8){return _0x44572e[_0x4a21('0xf')](_0x14f53c);}return _0x44572e[_0x4a21('0x10')](_0x14f53c)['end']();};}function respondWithResult(_0x3fcae9,_0x52978e){_0x52978e=_0x52978e||0xc8;return function(_0x20c29e){if(_0x20c29e){return _0x3fcae9[_0x4a21('0x10')](_0x52978e)[_0x4a21('0x11')](_0x20c29e);}};}function respondWithFilteredResult(_0x36bc4b,_0x1aed01){return function(_0x2f8335){if(_0x2f8335){var _0x14dc61=typeof _0x1aed01['offset']===_0x4a21('0x12')&&typeof _0x1aed01[_0x4a21('0x13')]===_0x4a21('0x12');var _0x53a0a9=_0x2f8335[_0x4a21('0x14')];var _0x51b1a8=_0x14dc61?0x0:_0x1aed01[_0x4a21('0x15')];var _0x11300e=_0x14dc61?_0x2f8335['count']:_0x1aed01['offset']+_0x1aed01[_0x4a21('0x13')];var _0xc77f49;if(_0x11300e>=_0x53a0a9){_0x11300e=_0x53a0a9;_0xc77f49=0xc8;}else{_0xc77f49=0xce;}_0x36bc4b[_0x4a21('0x10')](_0xc77f49);return _0x36bc4b[_0x4a21('0x16')](_0x4a21('0x17'),_0x51b1a8+'-'+_0x11300e+'/'+_0x53a0a9)[_0x4a21('0x11')](_0x2f8335);}return null;};}function saveUpdates(_0x4eb42d){return function(_0x6ba035){if(_0x6ba035){return _0x6ba035[_0x4a21('0x18')](_0x4eb42d)[_0x4a21('0x19')](function(_0x327ecb){return _0x327ecb;});}return null;};}function removeEntity(_0x14d18c){return function(_0x4845ce){if(_0x4845ce){return _0x4845ce[_0x4a21('0x1a')]()[_0x4a21('0x19')](function(){_0x14d18c[_0x4a21('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b06fc){return function(_0x236a1c){if(!_0x236a1c){_0x1b06fc[_0x4a21('0xf')](0x194);}return _0x236a1c;};}function handleError(_0x5e0d7b,_0x42ead2){_0x42ead2=_0x42ead2||0x1f4;return function(_0x388dd4){logger['error'](_0x388dd4[_0x4a21('0x1b')]);if(_0x388dd4[_0x4a21('0x1c')]){delete _0x388dd4[_0x4a21('0x1c')];}_0x5e0d7b[_0x4a21('0x10')](_0x42ead2)[_0x4a21('0x1d')](_0x388dd4);};}exports[_0x4a21('0x1e')]=function(_0x3b9334,_0x1ca5ee){var _0x2e6586={};var _0x3f9b3e=_[_0x4a21('0x1f')](db[_0x4a21('0x20')][_0x4a21('0x21')],function(_0x2ba230){return{'name':_0x2ba230[_0x4a21('0x22')],'type':_0x2ba230[_0x4a21('0x23')][_0x4a21('0x24')]};});_0x2e6586=qs[_0x4a21('0x25')](_0x3f9b3e,_0x3b9334);return interaction[_0x4a21('0x26')](_0x4a21('0x27'),_0x3b9334[_0x4a21('0x28')],_0x3b9334[_0x4a21('0x29')],_0x2e6586,_0x3f9b3e)[_0x4a21('0x19')](respondWithFilteredResult(_0x1ca5ee,_0x2e6586))[_0x4a21('0x2a')](handleError(_0x1ca5ee,null));};exports[_0x4a21('0x2b')]=function(_0xc0e500,_0xad1bfe){var _0x18b994={'raw':![],'where':{'id':_0xc0e500[_0x4a21('0x2c')]['id']}},_0x1bd6d6={};_0x1bd6d6[_0x4a21('0x2d')]=_[_0x4a21('0x2e')](db['FaxInteraction']['rawAttributes']);_0x1bd6d6[_0x4a21('0x28')]=_[_0x4a21('0x2e')](_0xc0e500[_0x4a21('0x28')]);_0x1bd6d6[_0x4a21('0x2f')]=_[_0x4a21('0x30')](_0x1bd6d6[_0x4a21('0x2d')],_0x1bd6d6['query']);_0x18b994['attributes']=_[_0x4a21('0x30')](_0x1bd6d6[_0x4a21('0x2d')],qs['fields'](_0xc0e500[_0x4a21('0x28')][_0x4a21('0x31')]));_0x18b994['attributes']=_0x18b994[_0x4a21('0x32')]['length']?_0x18b994[_0x4a21('0x32')]:_0x1bd6d6[_0x4a21('0x2d')];if(_0xc0e500[_0x4a21('0x28')][_0x4a21('0x33')]){_0x18b994[_0x4a21('0x34')]=[{'all':!![]}];}_0x18b994=_[_0x4a21('0x35')]({},_0x18b994,_0xc0e500[_0x4a21('0x36')]);return db[_0x4a21('0x20')][_0x4a21('0x37')](_0x18b994)['then'](handleEntityNotFound(_0xad1bfe,null))['then'](respondWithResult(_0xad1bfe,null))[_0x4a21('0x2a')](handleError(_0xad1bfe,null));};exports['create']=function(_0x24b3a6,_0x482312){return db[_0x4a21('0x20')][_0x4a21('0x38')](_0x24b3a6[_0x4a21('0x39')],{})[_0x4a21('0x19')](respondWithResult(_0x482312,0xc9))[_0x4a21('0x2a')](handleError(_0x482312,null));};exports[_0x4a21('0x18')]=function(_0x3b4b89,_0x270726){if(_0x3b4b89[_0x4a21('0x39')]['id']){delete _0x3b4b89[_0x4a21('0x39')]['id'];}return db[_0x4a21('0x20')]['find']({'where':{'id':_0x3b4b89[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x270726,null))[_0x4a21('0x19')](saveUpdates(_0x3b4b89['body'],null))[_0x4a21('0x19')](respondWithResult(_0x270726,null))[_0x4a21('0x2a')](handleError(_0x270726,null));};exports[_0x4a21('0x1a')]=function(_0x5b4c83,_0x5a9b95){return db['FaxInteraction'][_0x4a21('0x37')]({'where':{'id':_0x5b4c83[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x5a9b95,null))[_0x4a21('0x19')](removeEntity(_0x5a9b95,null))[_0x4a21('0x2a')](handleError(_0x5a9b95,null));};exports[_0x4a21('0x3a')]=function(_0x261db1,_0x1d311a){return db['FaxInteraction']['describe']()[_0x4a21('0x19')](respondWithResult(_0x1d311a,null))[_0x4a21('0x2a')](handleError(_0x1d311a,null));};exports[_0x4a21('0x3b')]=function(_0x1a047b,_0xe40f7b){return db[_0x4a21('0x3c')][_0x4a21('0x37')]({'where':{'id':_0x1a047b[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0xe40f7b,null))['then'](function(_0x2c99ad){if(_0x2c99ad){return _0x2c99ad['addMessage'](_0x1a047b[_0x4a21('0x39')][_0x4a21('0x3d')],_[_0x4a21('0x3e')](_0x1a047b[_0x4a21('0x39')],[_0x4a21('0x3d'),'id'])||{});}})[_0x4a21('0x19')](respondWithResult(_0xe40f7b,null))['catch'](handleError(_0xe40f7b,null));};exports[_0x4a21('0x3f')]=function(_0x5da71d,_0x38ef0e){var _0xb15503={'raw':![],'where':{}};var _0x3eb16b={};var _0x135d29={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x4a21('0x40')]({'where':{'id':_0x5da71d[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x38ef0e,null))[_0x4a21('0x19')](function(_0x1a5202){if(_0x1a5202){_0x3eb16b[_0x4a21('0x2d')]=_[_0x4a21('0x2e')](db['FaxMessage']['rawAttributes']);_0x3eb16b[_0x4a21('0x28')]=_[_0x4a21('0x2e')](_0x5da71d[_0x4a21('0x28')]);_0x3eb16b['filters']=_[_0x4a21('0x30')](_0x3eb16b[_0x4a21('0x2d')],_0x3eb16b[_0x4a21('0x28')]);_0xb15503[_0x4a21('0x32')]=_[_0x4a21('0x30')](_0x3eb16b[_0x4a21('0x2d')],qs['fields'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x31')]));_0xb15503[_0x4a21('0x32')]=_0xb15503[_0x4a21('0x32')][_0x4a21('0x41')]?_0xb15503[_0x4a21('0x32')]:_0x3eb16b[_0x4a21('0x2d')];if(!_0x5da71d['query']['hasOwnProperty'](_0x4a21('0x42'))){_0xb15503[_0x4a21('0x13')]=qs['limit'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x13')]);_0xb15503[_0x4a21('0x15')]=qs['offset'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x15')]);}_0xb15503[_0x4a21('0x43')]=qs['sort'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x44')]);_0xb15503[_0x4a21('0x45')]=qs['filters'](_['pick'](_0x5da71d[_0x4a21('0x28')],_0x3eb16b['filters']));_0xb15503[_0x4a21('0x45')]['FaxInteractionId']=_0x1a5202['id'];if(_0x5da71d[_0x4a21('0x28')]['filter']){_0xb15503[_0x4a21('0x45')]=_[_0x4a21('0x35')](_0xb15503['where'],{'$or':_['map'](_0xb15503[_0x4a21('0x32')],function(_0x2bdd11){var _0x13daf4={};_0x13daf4[_0x2bdd11]={'$like':'%'+_0x5da71d[_0x4a21('0x28')][_0x4a21('0x46')]+'%'};return _0x13daf4;})});}if(_0x5da71d[_0x4a21('0x28')][_0x4a21('0x47')]){var _0x334fb9=_0x5da71d[_0x4a21('0x28')][_0x4a21('0x47')][_0x4a21('0x48')](',');var _0x314846={};_0x314846[_0x334fb9[0x0]]={'$gte':moment(_0x334fb9[0x1])[_0x4a21('0x49')](_0x4a21('0x4a'))};_0xb15503[_0x4a21('0x45')]=_[_0x4a21('0x35')](_0xb15503[_0x4a21('0x45')],_0x314846);}_0xb15503=_[_0x4a21('0x35')]({},_0xb15503,_0x5da71d[_0x4a21('0x36')]);return db['FaxMessage'][_0x4a21('0x14')]({'where':_0xb15503[_0x4a21('0x45')]})['then'](function(_0x51aa90){_0x135d29[_0x4a21('0x14')]=_0x51aa90;if(_0x5da71d[_0x4a21('0x28')][_0x4a21('0x33')]){_0xb15503[_0x4a21('0x34')]=[{'all':!![]}];}return db[_0x4a21('0x3c')][_0x4a21('0x26')](_0xb15503);})[_0x4a21('0x19')](function(_0x35625b){_0x135d29['rows']=_0x35625b;return _0x135d29;});}})[_0x4a21('0x19')](respondWithFilteredResult(_0x38ef0e,_0xb15503))['catch'](handleError(_0x38ef0e,null));};exports[_0x4a21('0x4b')]=function(_0x886fbc,_0xb40c74){return db[_0x4a21('0x20')][_0x4a21('0x37')]({'where':{'id':_0x886fbc['params']['id']}})['then'](handleEntityNotFound(_0xb40c74,null))[_0x4a21('0x19')](function(_0x28c060){if(_0x28c060){return _0x28c060['setTags'](_0x886fbc[_0x4a21('0x39')][_0x4a21('0x3d')],_['omit'](_0x886fbc[_0x4a21('0x39')],[_0x4a21('0x3d'),'id'])||{})[_0x4a21('0x4c')](function(){return db['Tag'][_0x4a21('0x26')]({'attributes':['id',_0x4a21('0x1c'),_0x4a21('0x4d')],'where':{'id':_0x886fbc['body'][_0x4a21('0x3d')]}});})[_0x4a21('0x19')](function(_0x13fbf2){socket[_0x4a21('0x4e')](_0x4a21('0x4f'),{'id':Number(_0x886fbc[_0x4a21('0x2c')]['id']),'tags':_0x13fbf2||[]});return{'id':Number(_0x886fbc[_0x4a21('0x2c')]['id']),'tags':_0x13fbf2||[]};});}})[_0x4a21('0x19')](respondWithResult(_0xb40c74,null))[_0x4a21('0x2a')](handleError(_0xb40c74,null));};exports['removeTags']=function(_0x1caa62,_0x1f75a0){return db[_0x4a21('0x20')][_0x4a21('0x37')]({'where':{'id':_0x1caa62[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x1f75a0,null))[_0x4a21('0x19')](function(_0x564748){if(_0x564748){return _0x564748['removeTags'](_0x1caa62[_0x4a21('0x28')][_0x4a21('0x3d')]);}})[_0x4a21('0x19')](respondWithStatusCode(_0x1f75a0,null))['catch'](handleError(_0x1f75a0,null));};exports[_0x4a21('0x50')]=function(_0x18454d,_0x5eed39){var _0x21158d=moment()[_0x4a21('0x51')]()[_0x4a21('0x52')]();var _0x5ecb84=path[_0x4a21('0x53')](config[_0x4a21('0x54')],'server',_0x4a21('0x55'),_0x4a21('0x56'));var _0x147cac=path[_0x4a21('0x53')](config[_0x4a21('0x54')],_0x4a21('0x57'),_0x4a21('0x55'),'attachments');var _0x813b77=path[_0x4a21('0x53')](_0x5ecb84,_0x21158d);var _0x1ee2c7=util[_0x4a21('0x49')](_0x4a21('0x58'),_0x18454d['params']['id'],_0x21158d);var _0x477881=path['join'](_0x5ecb84,_0x1ee2c7);var _0x32f7e5=[];_0x32f7e5[_0x4a21('0x59')]({'model':db[_0x4a21('0x5a')],'as':_0x4a21('0x5a'),'raw':!![]});var _0x15fd9a=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x4a21('0x5b')],'include':_0x32f7e5}];return db['FaxInteraction']['find']({'where':{'id':_0x18454d[_0x4a21('0x2c')]['id']},'include':_0x15fd9a})['then'](handleEntityNotFound(_0x5eed39,null))[_0x4a21('0x19')](function(_0x29719f){if(_0x29719f&&_0x29719f[_0x4a21('0x5c')]){var _0x424fbb=_0x29719f[_0x4a21('0x5d')]({'plain':!![]});fs[_0x4a21('0x5e')](_0x813b77);for(var _0x3d6380=0x0;_0x3d6380<_0x424fbb[_0x4a21('0x5c')]['length'];_0x3d6380++){var _0x1c416b=_0x424fbb[_0x4a21('0x5c')][_0x3d6380][_0x4a21('0x5a')];if(_0x1c416b){var _0x155e91=path[_0x4a21('0x53')](_0x147cac,_0x1c416b[_0x4a21('0x5f')]);if(fs[_0x4a21('0x60')](_0x155e91)){fs[_0x4a21('0x61')](_0x155e91)[_0x4a21('0x62')](fs['createWriteStream'](path['join'](_0x813b77,_0x1c416b[_0x4a21('0x5f')])));}}}return BPromise[_0x4a21('0x63')]()[_0x4a21('0x19')](function(){return new BPromise(function(_0x1c12f6,_0x25dab5){zipdir(_0x813b77,{'saveTo':_0x477881},function(_0x35053f,_0x38ee7e){if(_0x35053f)return _0x25dab5(_0x35053f);return _0x1c12f6(_0x38ee7e);});})[_0x4a21('0x19')](function(){return new BPromise(function(_0x308c54,_0x538275){rimraf(_0x813b77,function(_0x5acb13){if(_0x5acb13)_0x538275(_0x5acb13);return _0x308c54();});});})[_0x4a21('0x19')](function(){return _0x5eed39[_0x4a21('0x50')](_0x477881,_0x1ee2c7,function(_0x207e02){if(_0x207e02){console[_0x4a21('0x64')](_0x4a21('0x65'),_0x207e02);}else{fs['unlinkSync'](_0x477881);}});});});}else{return _0x5eed39[_0x4a21('0xf')](0xc8);}})[_0x4a21('0x2a')](handleError(_0x5eed39,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4bda1df..35290d0 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabfe=['FaxMessage','setMaxListeners','save','remove','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x151f00,_0x4ca3a1){var _0x418d9b=function(_0x5c37c7){while(--_0x5c37c7){_0x151f00['push'](_0x151f00['shift']());}};_0x418d9b(++_0x4ca3a1);}(_0xabfe,0x86));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xeabf('0x0'));var FaxInteraction=require(_0xeabf('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xeabf('0x1'))['db'][_0xeabf('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xeabf('0x3')](0x0);var events={'afterCreate':_0xeabf('0x4'),'afterUpdate':'update','afterDestroy':_0xeabf('0x5')};function emitEvent(_0x10de96){return function(_0x2879e5,_0x872a30,_0x39ca90){_0x2879e5['getUsers']({'attributes':['id'],'raw':!![]})[_0xeabf('0x6')](function(_0x5ac2b7){_0x2879e5['setDataValue'](_0xeabf('0x7'),_0x5ac2b7[_0xeabf('0x8')](function(_0x182c15){return{'id':_0x182c15['id']};}));return FaxMessage[_0xeabf('0x9')]({'where':{'FaxInteractionId':_0x2879e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeabf('0x6')](function(_0x36edba){_0x2879e5['setDataValue'](_0xeabf('0xa'),_0x36edba[_0xeabf('0xb')]);FaxInteractionEvents[_0xeabf('0xc')](_0x10de96+':'+_0x2879e5['id'],_0x2879e5);FaxInteractionEvents[_0xeabf('0xc')](_0x10de96,_0x2879e5);_0x39ca90(null);})[_0xeabf('0xd')](_0x39ca90(null));};}for(var e in events){if(events[_0xeabf('0xe')](e)){var event=events[e];FaxInteraction[_0xeabf('0xf')](e,emitEvent(event));}}module[_0xeabf('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xd412=['update','remove','then','setDataValue','Users','map','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save'];(function(_0x4c9f70,_0x53990b){var _0x3b1dd9=function(_0x1548fa){while(--_0x1548fa){_0x4c9f70['push'](_0x4c9f70['shift']());}};_0x3b1dd9(++_0x53990b);}(_0xd412,0x83));var _0x2d41=function(_0x46f01a,_0xc5ab14){_0x46f01a=_0x46f01a-0x0;var _0xfe8a59=_0xd412[_0x46f01a];return _0xfe8a59;};'use strict';var EventEmitter=require(_0x2d41('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x2d41('0x1'))['db'][_0x2d41('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d41('0x3'),'afterUpdate':_0x2d41('0x4'),'afterDestroy':_0x2d41('0x5')};function emitEvent(_0x4b8675){return function(_0x438191,_0x40c933,_0x3fde68){_0x438191['getUsers']({'attributes':['id'],'raw':!![]})[_0x2d41('0x6')](function(_0x4601ba){_0x438191[_0x2d41('0x7')](_0x2d41('0x8'),_0x4601ba[_0x2d41('0x9')](function(_0x3850fd){return{'id':_0x3850fd['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x438191['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2d41('0x6')](function(_0x2ec36e){_0x438191[_0x2d41('0x7')]('unreadMessages',_0x2ec36e['length']);FaxInteractionEvents[_0x2d41('0xa')](_0x4b8675+':'+_0x438191['id'],_0x438191);FaxInteractionEvents[_0x2d41('0xa')](_0x4b8675,_0x438191);_0x3fde68(null);})[_0x2d41('0xb')](_0x3fde68(null));};}for(var e in events){if(events[_0x2d41('0xc')](e)){var event=events[e];FaxInteraction[_0x2d41('0xd')](e,emitEvent(event));}}module[_0x2d41('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d5280f4..96df28d 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe586=['format','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed'];(function(_0x5d8d70,_0x48e642){var _0x4d0778=function(_0x2dca0b){while(--_0x2dca0b){_0x5d8d70['push'](_0x5d8d70['shift']());}};_0x4d0778(++_0x48e642);}(_0xe586,0x151));var _0x6e58=function(_0xe6a5db,_0x41f427){_0xe6a5db=_0xe6a5db-0x0;var _0x57a033=_0xe586[_0xe6a5db];return _0x57a033;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e58('0x0'))(_0x6e58('0x1'));var moment=require('moment');var BPromise=require(_0x6e58('0x2'));var rp=require(_0x6e58('0x3'));var fs=require('fs');var path=require(_0x6e58('0x4'));var rimraf=require(_0x6e58('0x5'));var config=require(_0x6e58('0x6'));var attributes=require(_0x6e58('0x7'));module['exports']=function(_0x555753,_0x3006bb){return _0x555753[_0x6e58('0x8')](_0x6e58('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xac70b8,_0x4b43fb,_0x1d0701){if(_0xac70b8[_0x6e58('0xa')]('closed')){_0xac70b8['closedAt']=moment()[_0x6e58('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1d0701(null,_0xac70b8);}}});}; \ No newline at end of file +var _0xdba3=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdba3,0x19f));var _0x3dba=function(_0x234490,_0x55a83c){_0x234490=_0x234490-0x0;var _0x5d4081=_0xdba3[_0x234490];return _0x5d4081;};'use strict';var _=require(_0x3dba('0x0'));var util=require(_0x3dba('0x1'));var logger=require('../../config/logger')(_0x3dba('0x2'));var moment=require(_0x3dba('0x3'));var BPromise=require(_0x3dba('0x4'));var rp=require(_0x3dba('0x5'));var fs=require('fs');var path=require(_0x3dba('0x6'));var rimraf=require(_0x3dba('0x7'));var config=require(_0x3dba('0x8'));var attributes=require(_0x3dba('0x9'));module[_0x3dba('0xa')]=function(_0x374134,_0x50995d){return _0x374134[_0x3dba('0xb')](_0x3dba('0xc'),attributes,{'tableName':_0x3dba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c1f2a,_0x4b33d8,_0x56e4ed){if(_0x5c1f2a[_0x3dba('0xe')](_0x3dba('0xf'))){_0x5c1f2a['closedAt']=moment()[_0x3dba('0x10')](_0x3dba('0x11'));}_0x56e4ed(null,_0x5c1f2a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index b91b9ad..4518d21 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd0c=['http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xcd0c,0x1ee));var _0xccd0=function(_0x33b43b,_0x24e1dc){_0x33b43b=_0x33b43b-0x0;var _0x355e5f=_0xcd0c[_0x33b43b];return _0x355e5f;};'use strict';var _=require(_0xccd0('0x0'));var util=require(_0xccd0('0x1'));var moment=require(_0xccd0('0x2'));var BPromise=require('bluebird');var rs=require(_0xccd0('0x3'));var fs=require('fs');var Redis=require(_0xccd0('0x4'));var db=require(_0xccd0('0x5'))['db'];var utils=require(_0xccd0('0x6'));var logger=require(_0xccd0('0x7'))(_0xccd0('0x8'));var config=require(_0xccd0('0x9'));var jayson=require(_0xccd0('0xa'));var client=jayson[_0xccd0('0xb')][_0xccd0('0xc')]({'port':0x232a});config[_0xccd0('0xd')]=_['defaults'](config[_0xccd0('0xd')],{'host':_0xccd0('0xe'),'port':0x18eb});var socket=require(_0xccd0('0xf'))(new Redis(config[_0xccd0('0xd')]));require('./faxInteraction.socket')[_0xccd0('0x10')](socket);function respondWithRpcPromise(_0x1bb894,_0x18c104,_0x535fec){return new BPromise(function(_0x1178e4,_0x3194d3){return client[_0xccd0('0x11')](_0x1bb894,_0x535fec)[_0xccd0('0x12')](function(_0x3184b5){logger[_0xccd0('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x18c104,_0xccd0('0x14'));logger[_0xccd0('0x15')](_0xccd0('0x16'),_0x18c104,'request\x20sent',JSON['stringify'](_0x3184b5));if(_0x3184b5['error']){if(_0x3184b5[_0xccd0('0x17')][_0xccd0('0x18')]===0x1f4){logger['error'](_0xccd0('0x19'),_0x18c104,_0x3184b5['error'][_0xccd0('0x1a')]);return _0x3194d3(_0x3184b5[_0xccd0('0x17')][_0xccd0('0x1a')]);}logger[_0xccd0('0x17')](_0xccd0('0x19'),_0x18c104,_0x3184b5[_0xccd0('0x17')][_0xccd0('0x1a')]);return _0x1178e4(_0x3184b5[_0xccd0('0x17')][_0xccd0('0x1a')]);}else{logger[_0xccd0('0x13')](_0xccd0('0x19'),_0x18c104,_0xccd0('0x14'));_0x1178e4(_0x3184b5[_0xccd0('0x1b')]['message']);}})[_0xccd0('0x1c')](function(_0x5355bc){logger[_0xccd0('0x17')](_0xccd0('0x19'),_0x18c104,_0x5355bc);_0x3194d3(_0x5355bc);});});}exports[_0xccd0('0x1d')]=function(_0xa5eba6){var _0x4266e8=this;return new Promise(function(_0x2078b7,_0xe11104){return db[_0xccd0('0x1e')][_0xccd0('0x1f')](_0xa5eba6[_0xccd0('0x20')],{'raw':_0xa5eba6[_0xccd0('0x21')]?_0xa5eba6[_0xccd0('0x21')][_0xccd0('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa5eba6[_0xccd0('0x21')]?_0xa5eba6[_0xccd0('0x21')][_0xccd0('0x23')]||null:null,'attributes':_0xa5eba6[_0xccd0('0x21')]?_0xa5eba6[_0xccd0('0x21')][_0xccd0('0x24')]||null:null,'limit':_0xa5eba6['options']?_0xa5eba6[_0xccd0('0x21')][_0xccd0('0x25')]||null:null})[_0xccd0('0x12')](function(_0x16bf0a){logger['info']('UpdateFaxInteraction',_0xa5eba6);logger['debug'](_0xccd0('0x1d'),_0xa5eba6,JSON[_0xccd0('0x26')](_0x16bf0a));_0x2078b7(_0x16bf0a);})[_0xccd0('0x1c')](function(_0x39fe8a){logger[_0xccd0('0x17')]('UpdateFaxInteraction',_0x39fe8a[_0xccd0('0x1a')],_0xa5eba6);_0xe11104(_0x4266e8[_0xccd0('0x17')](0x1f4,_0x39fe8a[_0xccd0('0x1a')]));});});};exports[_0xccd0('0x27')]=function(_0x190818){return new Promise(function(_0x4798cd,_0x90932){return db['FaxInteraction'][_0xccd0('0x28')]({'where':_0x190818[_0xccd0('0x21')]?_0x190818[_0xccd0('0x21')][_0xccd0('0x23')]||null:null})['then'](function(_0x353916){if(_0x353916){return _0x353916[_0xccd0('0x29')](_0x190818['body'][_0xccd0('0x2a')],_[_0xccd0('0x2b')](_0x190818['body'],['ids','id'])||{});}})[_0xccd0('0x2c')](function(_0x50f225){logger[_0xccd0('0x13')](_0xccd0('0x2d'),_0x190818);logger['debug'](_0xccd0('0x2d'),_0x190818,JSON[_0xccd0('0x26')](_0x50f225));_0x4798cd(_0x50f225);})[_0xccd0('0x1c')](function(_0x560961){logger['error'](_0xccd0('0x2d'),_0x560961[_0xccd0('0x1a')],_0x190818);_0x90932(_this['error'](0x1f4,_0x560961[_0xccd0('0x1a')]));});});}; \ No newline at end of file +var _0x2287=['client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','FaxInteraction','update','body','options','raw','where','attributes','info','UpdateFaxInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x38f366,_0x1eda8b){var _0x4b00a2=function(_0x1d3da9){while(--_0x1d3da9){_0x38f366['push'](_0x38f366['shift']());}};_0x4b00a2(++_0x1eda8b);}(_0x2287,0x77));var _0x7228=function(_0x31fe47,_0x32640f){_0x31fe47=_0x31fe47-0x0;var _0x2e78a8=_0x2287[_0x31fe47];return _0x2e78a8;};'use strict';var _=require(_0x7228('0x0'));var util=require(_0x7228('0x1'));var moment=require(_0x7228('0x2'));var BPromise=require(_0x7228('0x3'));var rs=require(_0x7228('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7228('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7228('0x6'))(_0x7228('0x7'));var config=require(_0x7228('0x8'));var jayson=require(_0x7228('0x9'));var client=jayson[_0x7228('0xa')][_0x7228('0xb')]({'port':0x232a});config[_0x7228('0xc')]=_[_0x7228('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7228('0xe'))(new Redis(config[_0x7228('0xc')]));require(_0x7228('0xf'))[_0x7228('0x10')](socket);function respondWithRpcPromise(_0x99cb2b,_0x299897,_0x3458c1){return new BPromise(function(_0x25c0df,_0x12e426){return client[_0x7228('0x11')](_0x99cb2b,_0x3458c1)[_0x7228('0x12')](function(_0xe9687a){logger['info'](_0x7228('0x13'),_0x299897,'request\x20sent');logger['debug'](_0x7228('0x14'),_0x299897,'request\x20sent',JSON[_0x7228('0x15')](_0xe9687a));if(_0xe9687a[_0x7228('0x16')]){if(_0xe9687a[_0x7228('0x16')]['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x299897,_0xe9687a[_0x7228('0x16')]['message']);return _0x12e426(_0xe9687a[_0x7228('0x16')][_0x7228('0x17')]);}logger['error'](_0x7228('0x13'),_0x299897,_0xe9687a[_0x7228('0x16')]['message']);return _0x25c0df(_0xe9687a[_0x7228('0x16')][_0x7228('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x299897,_0x7228('0x18'));_0x25c0df(_0xe9687a[_0x7228('0x19')][_0x7228('0x17')]);}})[_0x7228('0x1a')](function(_0x40b57a){logger[_0x7228('0x16')](_0x7228('0x13'),_0x299897,_0x40b57a);_0x12e426(_0x40b57a);});});}exports['UpdateFaxInteraction']=function(_0x12c0a5){var _0x2794c6=this;return new Promise(function(_0x5495a8,_0x1febfa){return db[_0x7228('0x1b')][_0x7228('0x1c')](_0x12c0a5[_0x7228('0x1d')],{'raw':_0x12c0a5['options']?_0x12c0a5[_0x7228('0x1e')][_0x7228('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c0a5[_0x7228('0x1e')]?_0x12c0a5['options'][_0x7228('0x20')]||null:null,'attributes':_0x12c0a5[_0x7228('0x1e')]?_0x12c0a5[_0x7228('0x1e')][_0x7228('0x21')]||null:null,'limit':_0x12c0a5['options']?_0x12c0a5[_0x7228('0x1e')]['limit']||null:null})[_0x7228('0x12')](function(_0x3132a9){logger[_0x7228('0x22')](_0x7228('0x23'),_0x12c0a5);logger['debug']('UpdateFaxInteraction',_0x12c0a5,JSON[_0x7228('0x15')](_0x3132a9));_0x5495a8(_0x3132a9);})['catch'](function(_0x313205){logger[_0x7228('0x16')]('UpdateFaxInteraction',_0x313205[_0x7228('0x17')],_0x12c0a5);_0x1febfa(_0x2794c6[_0x7228('0x16')](0x1f4,_0x313205[_0x7228('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2e3a20){return new Promise(function(_0x144cf9,_0x840a90){return db[_0x7228('0x1b')][_0x7228('0x24')]({'where':_0x2e3a20[_0x7228('0x1e')]?_0x2e3a20[_0x7228('0x1e')][_0x7228('0x20')]||null:null})['then'](function(_0x1be5ca){if(_0x1be5ca){return _0x1be5ca[_0x7228('0x25')](_0x2e3a20[_0x7228('0x1d')][_0x7228('0x26')],_[_0x7228('0x27')](_0x2e3a20[_0x7228('0x1d')],['ids','id'])||{});}})[_0x7228('0x28')](function(_0x11f62b){logger[_0x7228('0x22')]('AddTags',_0x2e3a20);logger[_0x7228('0x29')](_0x7228('0x2a'),_0x2e3a20,JSON[_0x7228('0x15')](_0x11f62b));_0x144cf9(_0x11f62b);})['catch'](function(_0x9718b2){logger[_0x7228('0x16')]('AddTags',_0x9718b2[_0x7228('0x17')],_0x2e3a20);_0x840a90(_this[_0x7228('0x16')](0x1f4,_0x9718b2[_0x7228('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 6d99e8b..0300d81 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66c5=['remove','update','removeListener','length','./faxInteraction.events','save'];(function(_0x41a3cd,_0x261b16){var _0x37ac53=function(_0x99ed34){while(--_0x99ed34){_0x41a3cd['push'](_0x41a3cd['shift']());}};_0x37ac53(++_0x261b16);}(_0x66c5,0x82));var _0x566c=function(_0xbca5f7,_0x7f833a){_0xbca5f7=_0xbca5f7-0x0;var _0x2eb4c0=_0x66c5[_0xbca5f7];return _0x2eb4c0;};'use strict';var FaxInteractionEvents=require(_0x566c('0x0'));var events=[_0x566c('0x1'),_0x566c('0x2'),_0x566c('0x3')];function createListener(_0x198d0f,_0xd7d468){return function(_0x30a507){_0xd7d468['emit'](_0x198d0f,_0x30a507);};}function removeListener(_0x23059f,_0x233c8c){return function(){FaxInteractionEvents[_0x566c('0x4')](_0x23059f,_0x233c8c);};}exports['register']=function(_0x13b398){for(var _0x5367a8=0x0,_0x1b4019=events[_0x566c('0x5')];_0x5367a8<_0x1b4019;_0x5367a8++){var _0x2252eb=events[_0x5367a8];var _0x5309ba=createListener('faxInteraction:'+_0x2252eb,_0x13b398);FaxInteractionEvents['on'](_0x2252eb,_0x5309ba);}}; \ No newline at end of file +var _0x63b3=['./faxInteraction.events','save','update','removeListener','register','length','faxInteraction:'];(function(_0x5c54ff,_0x58e42c){var _0x5406db=function(_0x53b411){while(--_0x53b411){_0x5c54ff['push'](_0x5c54ff['shift']());}};_0x5406db(++_0x58e42c);}(_0x63b3,0x173));var _0x363b=function(_0x3a7dfb,_0x591ca1){_0x3a7dfb=_0x3a7dfb-0x0;var _0x42a20=_0x63b3[_0x3a7dfb];return _0x42a20;};'use strict';var FaxInteractionEvents=require(_0x363b('0x0'));var events=[_0x363b('0x1'),'remove',_0x363b('0x2')];function createListener(_0x456be2,_0x1a28f7){return function(_0x34682e){_0x1a28f7['emit'](_0x456be2,_0x34682e);};}function removeListener(_0x3e7999,_0x6043a7){return function(){FaxInteractionEvents[_0x363b('0x3')](_0x3e7999,_0x6043a7);};}exports[_0x363b('0x4')]=function(_0x5a1926){for(var _0x47d3d8=0x0,_0x7614b9=events[_0x363b('0x5')];_0x47d3d8<_0x7614b9;_0x47d3d8++){var _0x1b1b92=events[_0x47d3d8];var _0x522299=createListener(_0x363b('0x6')+_0x1b1b92,_0x5a1926);FaxInteractionEvents['on'](_0x1b1b92,_0x522299);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3698c15..212f3cc 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aaf=['/:id','/:id/messages','/:id/download','download','create','post','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4aaf,0x10a));var _0xf4aa=function(_0x388550,_0x3fd74b){_0x388550=_0x388550-0x0;var _0x735860=_0x4aaf[_0x388550];return _0x735860;};'use strict';var multer=require(_0xf4aa('0x0'));var util=require(_0xf4aa('0x1'));var path=require('path');var timeout=require(_0xf4aa('0x2'));var express=require(_0xf4aa('0x3'));var router=express[_0xf4aa('0x4')]();var fs_extra=require(_0xf4aa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf4aa('0x6'));var config=require(_0xf4aa('0x7'));var controller=require(_0xf4aa('0x8'));router['get']('/',auth[_0xf4aa('0x9')](),controller['index']);router[_0xf4aa('0xa')](_0xf4aa('0xb'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0xc')]);router['get'](_0xf4aa('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf4aa('0xa')](_0xf4aa('0xe'),auth[_0xf4aa('0x9')](),controller['getMessages']);router[_0xf4aa('0xa')](_0xf4aa('0xf'),auth[_0xf4aa('0x9')](),controller[_0xf4aa('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf4aa('0x11')]);router[_0xf4aa('0x12')](_0xf4aa('0xe'),auth[_0xf4aa('0x9')](),controller['addMessage']);router['post'](_0xf4aa('0x13'),auth[_0xf4aa('0x9')](),interaction[_0xf4aa('0x14')](_0xf4aa('0x15'),_0xf4aa('0x16')),controller['addTags']);router[_0xf4aa('0x17')](_0xf4aa('0xd'),auth[_0xf4aa('0x9')](),interaction[_0xf4aa('0x14')](_0xf4aa('0x15'),_0xf4aa('0x18')),controller[_0xf4aa('0x19')]);router['delete'](_0xf4aa('0xd'),auth[_0xf4aa('0x9')](),interaction[_0xf4aa('0x14')]('fax',_0xf4aa('0x1a')),controller[_0xf4aa('0x1b')]);router[_0xf4aa('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller[_0xf4aa('0x1d')]);module[_0xf4aa('0x1e')]=router; \ No newline at end of file +var _0x23fc=['/:id/tags','fax','addTags','put','tracked','update','destroy','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage'];(function(_0x1c89fa,_0xfbba1a){var _0x4bee68=function(_0x47a5fa){while(--_0x47a5fa){_0x1c89fa['push'](_0x1c89fa['shift']());}};_0x4bee68(++_0xfbba1a);}(_0x23fc,0x10e));var _0xc23f=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x23fc[_0x2eb3db];return _0x358f33;};'use strict';var multer=require(_0xc23f('0x0'));var util=require(_0xc23f('0x1'));var path=require(_0xc23f('0x2'));var timeout=require(_0xc23f('0x3'));var express=require('express');var router=express[_0xc23f('0x4')]();var fs_extra=require(_0xc23f('0x5'));var auth=require(_0xc23f('0x6'));var interaction=require(_0xc23f('0x7'));var config=require('../../config/environment');var controller=require(_0xc23f('0x8'));router[_0xc23f('0x9')]('/',auth[_0xc23f('0xa')](),controller['index']);router[_0xc23f('0x9')](_0xc23f('0xb'),auth[_0xc23f('0xa')](),controller['describe']);router[_0xc23f('0x9')](_0xc23f('0xc'),auth[_0xc23f('0xa')](),controller[_0xc23f('0xd')]);router['get'](_0xc23f('0xe'),auth['isAuthenticated'](),controller[_0xc23f('0xf')]);router[_0xc23f('0x9')]('/:id/download',auth[_0xc23f('0xa')](),controller[_0xc23f('0x10')]);router[_0xc23f('0x11')]('/',auth[_0xc23f('0xa')](),controller[_0xc23f('0x12')]);router[_0xc23f('0x11')](_0xc23f('0xe'),auth['isAuthenticated'](),controller[_0xc23f('0x13')]);router[_0xc23f('0x11')](_0xc23f('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xc23f('0x15'),'faxinteraction:addtags'),controller[_0xc23f('0x16')]);router[_0xc23f('0x17')](_0xc23f('0xc'),auth[_0xc23f('0xa')](),interaction[_0xc23f('0x18')](_0xc23f('0x15'),'faxinteraction:update'),controller[_0xc23f('0x19')]);router['delete'](_0xc23f('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xc23f('0x15'),'faxinteraction:destroy'),controller[_0xc23f('0x1a')]);router[_0xc23f('0x1b')](_0xc23f('0x14'),auth[_0xc23f('0xa')](),controller['removeTags']);module[_0xc23f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 38886e6..7df7b79 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd66c=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x5c2dc3,_0x4d6309){var _0x2779c8=function(_0x221051){while(--_0x221051){_0x5c2dc3['push'](_0x5c2dc3['shift']());}};_0x2779c8(++_0x4d6309);}(_0xd66c,0x106));var _0xcd66=function(_0x20f62b,_0x2e1045){_0x20f62b=_0x20f62b-0x0;var _0x1b52c4=_0xd66c[_0x20f62b];return _0x1b52c4;};'use strict';var Sequelize=require(_0xcd66('0x0'));module['exports']={'body':{'type':Sequelize[_0xcd66('0x1')](_0xcd66('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcd66('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd66('0x4')]('in','out'),'defaultValue':_0xcd66('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xcd66('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xcd66('0x6')]}}; \ No newline at end of file +var _0x207d=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x99a230,_0xe70e96){var _0xd903cf=function(_0x2bf598){while(--_0x2bf598){_0x99a230['push'](_0x99a230['shift']());}};_0xd903cf(++_0xe70e96);}(_0x207d,0x10d));var _0xd207=function(_0x711ebd,_0x393e61){_0x711ebd=_0x711ebd-0x0;var _0x41ec9e=_0x207d[_0x711ebd];return _0x41ec9e;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'body':{'type':Sequelize[_0xd207('0x2')](_0xd207('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd207('0x4')]('in','out'),'defaultValue':_0xd207('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd207('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index bcd8a1e..b45ee59 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91d1=['nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','body','find','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE: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','contact','email','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT','fullname','interface','event','create','CmContact','Attachment','findOne','AttachmentId','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x1454e1,_0x3b2847){var _0x3739e5=function(_0x5ac32b){while(--_0x5ac32b){_0x1454e1['push'](_0x1454e1['shift']());}};_0x3739e5(++_0x3b2847);}(_0x91d1,0xd1));var _0x191d=function(_0x1a478f,_0x388e9c){_0x1a478f=_0x1a478f-0x0;var _0xbe294a=_0x91d1[_0x1a478f];return _0xbe294a;};'use strict';var emlformat=require(_0x191d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x191d('0x1'));var jsonpatch=require(_0x191d('0x2'));var rp=require(_0x191d('0x3'));var moment=require(_0x191d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x191d('0x5'));var path=require(_0x191d('0x6'));var sox=require(_0x191d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x191d('0x8'));var _=require(_0x191d('0x9'));var squel=require(_0x191d('0xa'));var crypto=require(_0x191d('0xb'));var jsforce=require(_0x191d('0xc'));var deskjs=require(_0x191d('0xd'));var toCsv=require(_0x191d('0xe'));var querystring=require('querystring');var Papa=require(_0x191d('0xf'));var Redis=require(_0x191d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x191d('0x11'));var as=require(_0x191d('0x12'));var hardwareService=require(_0x191d('0x13'));var logger=require(_0x191d('0x14'))('api');var utils=require(_0x191d('0x15'));var config=require(_0x191d('0x16'));var licenseUtil=require(_0x191d('0x17'));var db=require('../../mysqldb')['db'];config[_0x191d('0x18')]=_['defaults'](config[_0x191d('0x18')],{'host':_0x191d('0x19'),'port':0x18eb});var socket=require(_0x191d('0x1a'))(new Redis(config[_0x191d('0x18')]));require(_0x191d('0x1b'))[_0x191d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x191d('0x1d')][_0x191d('0x1e')]({'port':0x232c});var client9002=jayson[_0x191d('0x1d')][_0x191d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x552c21,_0x3f9ec3,_0x31af2d,_0x3a83fd){return new BPromise(function(_0x1dd9b9,_0x15483a){var _0x15200d=_0x3a83fd||client;return _0x15200d[_0x191d('0x1f')](_0x552c21,_0x31af2d)[_0x191d('0x20')](function(_0x3ee01a){logger['info'](_0x191d('0x21'),_0x3f9ec3,_0x191d('0x22'));logger[_0x191d('0x23')](_0x191d('0x24'),_0x3f9ec3,_0x191d('0x22'),JSON[_0x191d('0x25')](_0x3ee01a));if(_0x3ee01a['error']){if(_0x3ee01a[_0x191d('0x26')][_0x191d('0x27')]===0x1f4){logger[_0x191d('0x26')]('FaxMessage,\x20%s,\x20%s',_0x3f9ec3,_0x3ee01a[_0x191d('0x26')]['message']);return _0x15483a(_0x3ee01a[_0x191d('0x26')][_0x191d('0x28')]);}logger[_0x191d('0x26')](_0x191d('0x21'),_0x3f9ec3,_0x3ee01a[_0x191d('0x26')][_0x191d('0x28')]);return _0x1dd9b9(_0x3ee01a['error'][_0x191d('0x28')]);}else{logger[_0x191d('0x29')]('FaxMessage,\x20%s,\x20%s',_0x3f9ec3,_0x191d('0x22'));_0x1dd9b9(_0x3ee01a['result'][_0x191d('0x28')]);}})[_0x191d('0x2a')](function(_0xcba2ba){logger[_0x191d('0x26')](_0x191d('0x21'),_0x3f9ec3,_0xcba2ba);_0x15483a(_0xcba2ba);});});}function respondWithStatusCode(_0x45d05b,_0x5719bf){_0x5719bf=_0x5719bf||0xcc;return function(_0x96c90d){if(_0x96c90d){return _0x45d05b[_0x191d('0x2b')](_0x5719bf);}return _0x45d05b[_0x191d('0x2c')](_0x5719bf)[_0x191d('0x2d')]();};}function respondWithResult(_0x1c44fb,_0x5e7b75){_0x5e7b75=_0x5e7b75||0xc8;return function(_0x30d3ee){if(_0x30d3ee){return _0x1c44fb['status'](_0x5e7b75)['json'](_0x30d3ee);}};}function respondWithFilteredResult(_0x14d867,_0x511e23){return function(_0x9623b9){if(_0x9623b9){var _0x3f2ed5=typeof _0x511e23[_0x191d('0x2e')]==='undefined'&&typeof _0x511e23[_0x191d('0x2f')]===_0x191d('0x30');var _0x5c5201=_0x9623b9[_0x191d('0x31')];var _0x4a4142=_0x3f2ed5?0x0:_0x511e23['offset'];var _0x2521fd=_0x3f2ed5?_0x9623b9[_0x191d('0x31')]:_0x511e23[_0x191d('0x2e')]+_0x511e23[_0x191d('0x2f')];var _0x4db170;if(_0x2521fd>=_0x5c5201){_0x2521fd=_0x5c5201;_0x4db170=0xc8;}else{_0x4db170=0xce;}_0x14d867[_0x191d('0x2c')](_0x4db170);return _0x14d867['set']('Content-Range',_0x4a4142+'-'+_0x2521fd+'/'+_0x5c5201)[_0x191d('0x32')](_0x9623b9);}return null;};}function patchUpdates(_0xb54185){return function(_0x1d83be){try{jsonpatch[_0x191d('0x33')](_0x1d83be,_0xb54185,!![]);}catch(_0x27794d){return BPromise[_0x191d('0x34')](_0x27794d);}return _0x1d83be['save']();};}function saveUpdates(_0x33dd13,_0x26846b){return function(_0x438577){if(_0x438577){return _0x438577[_0x191d('0x35')](_0x33dd13)[_0x191d('0x20')](function(_0x27885c){return _0x27885c;});}return null;};}function removeEntity(_0x5864f4,_0x4486fe){return function(_0x2e6463){if(_0x2e6463){return _0x2e6463[_0x191d('0x36')]()[_0x191d('0x20')](function(){_0x5864f4[_0x191d('0x2c')](0xcc)[_0x191d('0x2d')]();});}};}function handleEntityNotFound(_0x552021,_0x15b114){return function(_0x2cef70){if(!_0x2cef70){_0x552021['sendStatus'](0x194);}return _0x2cef70;};}function handleError(_0x31541a,_0x8eff6b){_0x8eff6b=_0x8eff6b||0x1f4;return function(_0x2176d9){logger[_0x191d('0x26')](_0x2176d9[_0x191d('0x37')]);if(_0x2176d9[_0x191d('0x38')]){delete _0x2176d9['name'];}_0x31541a[_0x191d('0x2c')](_0x8eff6b)[_0x191d('0x39')](_0x2176d9);};}exports[_0x191d('0x3a')]=function(_0x30608a,_0x533738){var _0x5809cc={},_0x3c802b={},_0x2a8470={'count':0x0,'rows':[]};var _0x4dbb62=_[_0x191d('0x3b')](db[_0x191d('0x3c')][_0x191d('0x3d')],function(_0x1e7fce){return{'name':_0x1e7fce[_0x191d('0x3e')],'type':_0x1e7fce[_0x191d('0x3f')][_0x191d('0x40')]};});_0x3c802b[_0x191d('0x41')]=_[_0x191d('0x3b')](_0x4dbb62,'name');_0x3c802b[_0x191d('0x42')]=_[_0x191d('0x43')](_0x30608a[_0x191d('0x42')]);_0x3c802b['filters']=_['intersection'](_0x3c802b['model'],_0x3c802b[_0x191d('0x42')]);_0x5809cc[_0x191d('0x44')]=_[_0x191d('0x45')](_0x3c802b[_0x191d('0x41')],qs[_0x191d('0x46')](_0x30608a[_0x191d('0x42')]['fields']));_0x5809cc[_0x191d('0x44')]=_0x5809cc[_0x191d('0x44')][_0x191d('0x47')]?_0x5809cc[_0x191d('0x44')]:_0x3c802b[_0x191d('0x41')];if(!_0x30608a[_0x191d('0x42')][_0x191d('0x48')](_0x191d('0x49'))){_0x5809cc[_0x191d('0x2f')]=qs['limit'](_0x30608a[_0x191d('0x42')]['limit']);_0x5809cc[_0x191d('0x2e')]=qs[_0x191d('0x2e')](_0x30608a[_0x191d('0x42')]['offset']);}_0x5809cc[_0x191d('0x4a')]=qs['sort'](_0x30608a[_0x191d('0x42')][_0x191d('0x4b')]);_0x5809cc['where']=qs[_0x191d('0x4c')](_['pick'](_0x30608a[_0x191d('0x42')],_0x3c802b[_0x191d('0x4c')]),_0x4dbb62);if(_0x30608a[_0x191d('0x42')]['filter']){_0x5809cc[_0x191d('0x4d')]=_[_0x191d('0x4e')](_0x5809cc[_0x191d('0x4d')],{'$or':_['map'](_0x4dbb62,function(_0x20a23c){if(_0x20a23c[_0x191d('0x3f')]!==_0x191d('0x4f')){var _0x7539a4={};_0x7539a4[_0x20a23c[_0x191d('0x38')]]={'$like':'%'+_0x30608a[_0x191d('0x42')]['filter']+'%'};return _0x7539a4;}})});}_0x5809cc=_[_0x191d('0x4e')]({},_0x5809cc,_0x30608a[_0x191d('0x50')]);var _0x2423c0={'where':_0x5809cc[_0x191d('0x4d')]};return db[_0x191d('0x3c')][_0x191d('0x31')](_0x2423c0)[_0x191d('0x20')](function(_0x371281){_0x2a8470[_0x191d('0x31')]=_0x371281;if(_0x30608a[_0x191d('0x42')][_0x191d('0x51')]){_0x5809cc[_0x191d('0x52')]=[{'all':!![]}];}return db[_0x191d('0x3c')]['findAll'](_0x5809cc);})['then'](function(_0x20d64f){_0x2a8470[_0x191d('0x53')]=_0x20d64f;return _0x2a8470;})[_0x191d('0x20')](respondWithFilteredResult(_0x533738,_0x5809cc))[_0x191d('0x2a')](handleError(_0x533738,null));};exports[_0x191d('0x54')]=function(_0x327346,_0x149db1){var _0x5a6d5c={'raw':!![],'where':{'id':_0x327346[_0x191d('0x55')]['id']}},_0x2a1fc3={};_0x2a1fc3['model']=_[_0x191d('0x43')](db['FaxMessage'][_0x191d('0x3d')]);_0x2a1fc3[_0x191d('0x42')]=_[_0x191d('0x43')](_0x327346[_0x191d('0x42')]);_0x2a1fc3[_0x191d('0x4c')]=_[_0x191d('0x45')](_0x2a1fc3['model'],_0x2a1fc3[_0x191d('0x42')]);_0x5a6d5c[_0x191d('0x44')]=_[_0x191d('0x45')](_0x2a1fc3[_0x191d('0x41')],qs[_0x191d('0x46')](_0x327346[_0x191d('0x42')][_0x191d('0x46')]));_0x5a6d5c[_0x191d('0x44')]=_0x5a6d5c['attributes'][_0x191d('0x47')]?_0x5a6d5c[_0x191d('0x44')]:_0x2a1fc3[_0x191d('0x41')];if(_0x327346[_0x191d('0x42')][_0x191d('0x51')]){_0x5a6d5c[_0x191d('0x52')]=[{'all':!![]}];}_0x5a6d5c=_[_0x191d('0x4e')]({},_0x5a6d5c,_0x327346[_0x191d('0x50')]);return db[_0x191d('0x3c')]['find'](_0x5a6d5c)[_0x191d('0x20')](handleEntityNotFound(_0x149db1,null))[_0x191d('0x20')](respondWithResult(_0x149db1,null))[_0x191d('0x2a')](handleError(_0x149db1,null));};exports[_0x191d('0x35')]=function(_0x24daa2,_0x260c6e){if(_0x24daa2[_0x191d('0x56')]['id']){delete _0x24daa2[_0x191d('0x56')]['id'];}return db[_0x191d('0x3c')][_0x191d('0x57')]({'where':{'id':_0x24daa2[_0x191d('0x55')]['id']}})[_0x191d('0x20')](handleEntityNotFound(_0x260c6e,null))[_0x191d('0x20')](saveUpdates(_0x24daa2[_0x191d('0x56')],null))[_0x191d('0x20')](respondWithResult(_0x260c6e,null))[_0x191d('0x2a')](handleError(_0x260c6e,null));};exports[_0x191d('0x36')]=function(_0x3a9982,_0x3012f0){return db[_0x191d('0x3c')][_0x191d('0x57')]({'where':{'id':_0x3a9982['params']['id']}})['then'](handleEntityNotFound(_0x3012f0,null))[_0x191d('0x20')](removeEntity(_0x3012f0,null))['catch'](handleError(_0x3012f0,null));};exports[_0x191d('0x58')]=function(_0x230759,_0x5841e2){return db[_0x191d('0x3c')][_0x191d('0x58')]()['then'](respondWithResult(_0x5841e2,null))[_0x191d('0x2a')](handleError(_0x5841e2,null));};var interaction_log=require(_0x191d('0x14'))(_0x191d('0x59'));exports[_0x191d('0x5a')]=function(_0x296b67,_0x5e5710,_0x57f175){var _0x16a4f4={'agent':{},'channel':_0x191d('0x5b')};if(_0x296b67[_0x191d('0x56')]['id']){delete _0x296b67[_0x191d('0x56')]['id'];}_0x296b67[_0x191d('0x56')][_0x191d('0x5c')]=!![];_0x296b67['body']['readAt']=moment()[_0x191d('0x5d')](_0x191d('0x5e'));_0x296b67[_0x191d('0x56')][_0x191d('0x5f')]=_0x296b67[_0x191d('0x56')]['UserId']||_0x296b67[_0x191d('0x60')]['id'];_0x16a4f4[_0x191d('0x61')]['id']=_0x296b67[_0x191d('0x56')][_0x191d('0x5f')];return db['FaxMessage'][_0x191d('0x57')]({'where':{'id':_0x296b67[_0x191d('0x55')]['id'],'UserId':null}})[_0x191d('0x20')](handleEntityNotFound(_0x5e5710,null))[_0x191d('0x20')](saveUpdates(_0x296b67['body'],null))[_0x191d('0x20')](function(_0x364778){if(_0x364778){_0x16a4f4[_0x191d('0x28')]=_0x364778[_0x191d('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x191d('0x57')]({'where':{'id':_0x364778[_0x191d('0x63')]}});}return null;})[_0x191d('0x20')](handleEntityNotFound(_0x5e5710,null))['then'](function(_0x5051b8){if(_0x5051b8){return _0x5051b8[_0x191d('0x35')]({'UserId':_0x296b67[_0x191d('0x56')][_0x191d('0x5f')],'read1stAt':_['isNil'](_0x5051b8[_0x191d('0x64')])?moment()[_0x191d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x191d('0x20')](function(_0x2a36c1){if(_0x2a36c1){_0x16a4f4[_0x191d('0x65')]=_0x2a36c1[_0x191d('0x62')]({'plain':!![]});interaction_log[_0x191d('0x29')](_0x191d('0x66'),_0x296b67[_0x191d('0x60')]['id'],_0x296b67['user'][_0x191d('0x38')],_0x296b67[_0x191d('0x60')]['role'],_0x16a4f4[_0x191d('0x65')]['id'],_0x296b67[_0x191d('0x56')]?JSON['stringify'](_0x296b67['body']):_0x191d('0x67'));return respondWithRpcPromise(_0x191d('0x68'),_0x191d('0x69'),_0x16a4f4);}return null;})[_0x191d('0x20')](function(_0x2afd07){var _0x19b979=_0x191d('0x6a')+_0x2afd07[_0x191d('0x28')][_0x191d('0x6b')];return db[_0x191d('0x6c')][_0x191d('0x42')](_0x19b979,{'type':db[_0x191d('0x6d')][_0x191d('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x5cd69e){return _0x5cd69e;});})[_0x191d('0x20')](function(_0x17e437){if(_0x17e437){_0x16a4f4[_0x191d('0x28')][_0x191d('0x6f')]=_0x17e437[0x0];if(!_0x296b67['body']['UserId'])return;return db['User'][_0x191d('0x57')]({'where':{'id':_0x296b67[_0x191d('0x56')][_0x191d('0x5f')],'role':_0x191d('0x61')},'attributes':['id',_0x191d('0x38'),'fullname',_0x191d('0x70'),'internal'],'raw':!![]});}return null;})[_0x191d('0x20')](function(_0x2b1ec0){if(!_0x2b1ec0)return null;_0x16a4f4['message']['agent']=_0x2b1ec0;return _0x16a4f4;})[_0x191d('0x20')](function(_0x368f99){if(_0x368f99){if(_0x296b67[_0x191d('0x56')][_0x191d('0x71')]){_0x16a4f4[_0x191d('0x28')]['interface']=util[_0x191d('0x5d')](_0x191d('0x72'),_0x296b67[_0x191d('0x60')][_0x191d('0x38')]);_0x16a4f4[_0x191d('0x28')]['channel']=_0x16a4f4[_0x191d('0x73')];_0x16a4f4[_0x191d('0x28')][_0x191d('0x74')]=_0x16a4f4[_0x191d('0x73')];_0x16a4f4['message']['event']=_0x191d('0x5a');return respondWithRpcPromise(_0x191d('0x75'),_0x191d('0x75'),{'event':_0x191d('0x76'),'message':_0x16a4f4[_0x191d('0x28')]},client9002)[_0x191d('0x20')](function(){return _0x16a4f4;});}return _0x16a4f4;}return null;})['then'](respondWithResult(_0x5e5710,null))[_0x191d('0x2a')](handleError(_0x5e5710,null));};var interaction_log=require('../../config/logger')(_0x191d('0x59'));exports[_0x191d('0x34')]=function(_0x559abd,_0x409801,_0x41ed0c){var _0x1fef3f={'agent':{},'channel':_0x191d('0x5b')};if(_0x559abd[_0x191d('0x56')]['id']){delete _0x559abd[_0x191d('0x56')]['id'];}_0x559abd[_0x191d('0x56')][_0x191d('0x5f')]=_0x559abd[_0x191d('0x56')]['UserId']||_0x559abd[_0x191d('0x60')]['id'];_0x1fef3f['agent']['id']=_0x559abd[_0x191d('0x56')]['UserId'];return db[_0x191d('0x3c')][_0x191d('0x57')]({'where':{'id':_0x559abd[_0x191d('0x55')]['id'],'UserId':null}})[_0x191d('0x20')](handleEntityNotFound(_0x409801,null))[_0x191d('0x20')](function(_0x3ed7db){if(_0x3ed7db){_0x1fef3f[_0x191d('0x28')]=_0x3ed7db[_0x191d('0x62')]({'plain':!![]});return db[_0x191d('0x77')][_0x191d('0x57')]({'where':{'id':_0x3ed7db['FaxInteractionId']}});}return null;})[_0x191d('0x20')](handleEntityNotFound(_0x409801,null))['then'](function(_0x3dd16b){if(_0x3dd16b){_0x1fef3f[_0x191d('0x65')]=_0x3dd16b[_0x191d('0x62')]({'plain':!![]});interaction_log[_0x191d('0x29')](_0x191d('0x78'),_0x559abd[_0x191d('0x60')]['id'],_0x559abd[_0x191d('0x60')][_0x191d('0x38')],_0x559abd[_0x191d('0x60')][_0x191d('0x79')],_0x1fef3f[_0x191d('0x65')]['id'],_0x559abd[_0x191d('0x56')]?JSON[_0x191d('0x25')](_0x559abd[_0x191d('0x56')]):_0x191d('0x67'));return respondWithRpcPromise('RejectMessage',_0x191d('0x7a'),_0x1fef3f);}return null;})['then'](function(_0x544c40){var _0x5ab238=_0x191d('0x6a')+_0x544c40['message']['ContactId'];return db[_0x191d('0x6c')]['query'](_0x5ab238,{'type':db[_0x191d('0x6d')][_0x191d('0x6e')][_0x191d('0x7b')],'raw':!![]})[_0x191d('0x20')](function(_0x57366f){return _0x57366f;});})[_0x191d('0x20')](function(_0x27429c){if(_0x27429c){_0x1fef3f[_0x191d('0x28')][_0x191d('0x6f')]=_0x27429c[0x0];if(!_0x559abd['body'][_0x191d('0x5f')])return;return db['User']['find']({'where':{'id':_0x559abd[_0x191d('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x191d('0x38'),_0x191d('0x7c'),_0x191d('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5ca8c6){if(!_0x5ca8c6)return null;_0x1fef3f[_0x191d('0x28')][_0x191d('0x61')]=_0x5ca8c6;return _0x1fef3f;})[_0x191d('0x20')](function(_0x33c509){if(_0x33c509){_0x33c509['message'][_0x191d('0x7d')]=util[_0x191d('0x5d')]('SIP/%s',_0x559abd['user'][_0x191d('0x38')]);_0x33c509['message'][_0x191d('0x73')]=_0x1fef3f[_0x191d('0x73')];_0x33c509[_0x191d('0x28')][_0x191d('0x74')]=_0x1fef3f['channel'];_0x33c509[_0x191d('0x28')][_0x191d('0x7e')]=_0x191d('0x34');respondWithRpcPromise(_0x191d('0x75'),'EventManager',{'event':'rejectmessage','message':_0x33c509[_0x191d('0x28')]},client9002);return _0x1fef3f;}return null;})[_0x191d('0x20')](respondWithResult(_0x409801,null))[_0x191d('0x2a')](handleError(_0x409801,null));};exports[_0x191d('0x7f')]=function(_0x166594,_0x3cac48){var _0x453cf1;return db['FaxMessage'][_0x191d('0x7f')](_0x166594[_0x191d('0x56')],{})['then'](function(_0x1682cc){_0x453cf1=_0x1682cc;return db[_0x191d('0x80')]['findOne']({'where':{'id':_0x453cf1[_0x191d('0x6b')]}});})[_0x191d('0x20')](function(_0x5c328f){if(_['isNil'](_0x5c328f)){return;}else{_0x453cf1['fax']=_0x5c328f[_0x191d('0x5b')];return db[_0x191d('0x81')][_0x191d('0x82')]({'where':{'id':_0x453cf1[_0x191d('0x83')]}});}})[_0x191d('0x20')](function(_0x1749cd){return respondWithRpcPromise(_0x191d('0x84'),_0x191d('0x84'),{'FaxAccountId':_[_0x191d('0x85')](_0x166594[_0x191d('0x56')])?undefined:_0x166594[_0x191d('0x56')][_0x191d('0x86')],'path':_['isNil'](_0x1749cd)?undefined:util['format'](_0x191d('0x87'),_0x1749cd[_0x191d('0x88')]),'fax':_['isNil'](_0x453cf1[_0x191d('0x5b')])?undefined:_0x453cf1[_0x191d('0x5b')],'AttachmentId':_0x453cf1[_0x191d('0x83')]},client9002);})[_0x191d('0x20')](respondWithResult(_0x3cac48,0xc9))[_0x191d('0x2a')](handleError(_0x3cac48,null));};exports[_0x191d('0x89')]=function(_0x519300,_0x5579eb){var _0x112d08=path[_0x191d('0x8a')](config[_0x191d('0x8b')],'server','files',_0x191d('0x8c'));return db[_0x191d('0x3c')][_0x191d('0x57')]({'where':{'id':_0x519300[_0x191d('0x55')]['id']},'include':[{'model':db[_0x191d('0x81')],'as':_0x191d('0x81')}]})[_0x191d('0x20')](handleEntityNotFound(_0x5579eb,null))[_0x191d('0x20')](function(_0x5ec6be){if(_0x5ec6be){return _0x5579eb[_0x191d('0x89')](path[_0x191d('0x8a')](_0x112d08,_0x5ec6be['Attachment']['basename']));}})[_0x191d('0x2a')](handleError(_0x5579eb,null));}; \ No newline at end of file +var _0x4c96=['read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','read1stAt','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','motionChannel','rejectmessage','create','CmContact','findOne','isNil','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','fax','download','join','root','server','files','Attachment','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','end','json','offset','undefined','count','status','set','apply','reject','save','update','destroy','name','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','FaxMessage','rows','catch','show','body','find','params','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c96,0x1eb));var _0x64c9=function(_0x369e2b,_0x384403){_0x369e2b=_0x369e2b-0x0;var _0x62676e=_0x4c96[_0x369e2b];return _0x62676e;};'use strict';var emlformat=require(_0x64c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x64c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64c9('0x2'));var moment=require(_0x64c9('0x3'));var BPromise=require(_0x64c9('0x4'));var Mustache=require(_0x64c9('0x5'));var util=require(_0x64c9('0x6'));var path=require(_0x64c9('0x7'));var sox=require('sox');var csv=require(_0x64c9('0x8'));var ejs=require(_0x64c9('0x9'));var fs=require('fs');var fs_extra=require(_0x64c9('0xa'));var _=require('lodash');var squel=require(_0x64c9('0xb'));var crypto=require(_0x64c9('0xc'));var jsforce=require(_0x64c9('0xd'));var deskjs=require(_0x64c9('0xe'));var toCsv=require(_0x64c9('0x8'));var querystring=require(_0x64c9('0xf'));var Papa=require(_0x64c9('0x10'));var Redis=require(_0x64c9('0x11'));var authService=require(_0x64c9('0x12'));var qs=require(_0x64c9('0x13'));var as=require(_0x64c9('0x14'));var hardwareService=require(_0x64c9('0x15'));var logger=require(_0x64c9('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x64c9('0x17'));var licenseUtil=require(_0x64c9('0x18'));var db=require(_0x64c9('0x19'))['db'];config['redis']=_[_0x64c9('0x1a')](config[_0x64c9('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x64c9('0x1c'))(new Redis(config[_0x64c9('0x1b')]));require(_0x64c9('0x1d'))[_0x64c9('0x1e')](socket);var jayson=require(_0x64c9('0x1f'));var client=jayson['client'][_0x64c9('0x20')]({'port':0x232c});var client9002=jayson[_0x64c9('0x21')][_0x64c9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x518475,_0x9cdcae,_0x7d7188,_0x2d3bfa){return new BPromise(function(_0x1442a4,_0x4c481e){var _0x3f6f93=_0x2d3bfa||client;return _0x3f6f93[_0x64c9('0x22')](_0x518475,_0x7d7188)[_0x64c9('0x23')](function(_0x356a6c){logger[_0x64c9('0x24')](_0x64c9('0x25'),_0x9cdcae,'request\x20sent');logger['debug'](_0x64c9('0x26'),_0x9cdcae,_0x64c9('0x27'),JSON[_0x64c9('0x28')](_0x356a6c));if(_0x356a6c['error']){if(_0x356a6c[_0x64c9('0x29')]['code']===0x1f4){logger[_0x64c9('0x29')](_0x64c9('0x25'),_0x9cdcae,_0x356a6c[_0x64c9('0x29')][_0x64c9('0x2a')]);return _0x4c481e(_0x356a6c['error'][_0x64c9('0x2a')]);}logger[_0x64c9('0x29')](_0x64c9('0x25'),_0x9cdcae,_0x356a6c[_0x64c9('0x29')][_0x64c9('0x2a')]);return _0x1442a4(_0x356a6c[_0x64c9('0x29')][_0x64c9('0x2a')]);}else{logger['info'](_0x64c9('0x25'),_0x9cdcae,_0x64c9('0x27'));_0x1442a4(_0x356a6c[_0x64c9('0x2b')][_0x64c9('0x2a')]);}})['catch'](function(_0x153d47){logger[_0x64c9('0x29')](_0x64c9('0x25'),_0x9cdcae,_0x153d47);_0x4c481e(_0x153d47);});});}function respondWithStatusCode(_0x6ae0d0,_0x1b9c85){_0x1b9c85=_0x1b9c85||0xcc;return function(_0x174d0a){if(_0x174d0a){return _0x6ae0d0[_0x64c9('0x2c')](_0x1b9c85);}return _0x6ae0d0['status'](_0x1b9c85)[_0x64c9('0x2d')]();};}function respondWithResult(_0x1d0431,_0x10e534){_0x10e534=_0x10e534||0xc8;return function(_0x1aeb15){if(_0x1aeb15){return _0x1d0431['status'](_0x10e534)[_0x64c9('0x2e')](_0x1aeb15);}};}function respondWithFilteredResult(_0x42af8d,_0x30fa4a){return function(_0x2424d6){if(_0x2424d6){var _0x515952=typeof _0x30fa4a[_0x64c9('0x2f')]==='undefined'&&typeof _0x30fa4a['limit']===_0x64c9('0x30');var _0xd8a713=_0x2424d6[_0x64c9('0x31')];var _0x396261=_0x515952?0x0:_0x30fa4a['offset'];var _0x23da06=_0x515952?_0x2424d6[_0x64c9('0x31')]:_0x30fa4a[_0x64c9('0x2f')]+_0x30fa4a['limit'];var _0x3e13cc;if(_0x23da06>=_0xd8a713){_0x23da06=_0xd8a713;_0x3e13cc=0xc8;}else{_0x3e13cc=0xce;}_0x42af8d[_0x64c9('0x32')](_0x3e13cc);return _0x42af8d[_0x64c9('0x33')]('Content-Range',_0x396261+'-'+_0x23da06+'/'+_0xd8a713)[_0x64c9('0x2e')](_0x2424d6);}return null;};}function patchUpdates(_0x2c8895){return function(_0x57f619){try{jsonpatch[_0x64c9('0x34')](_0x57f619,_0x2c8895,!![]);}catch(_0x56bc8b){return BPromise[_0x64c9('0x35')](_0x56bc8b);}return _0x57f619[_0x64c9('0x36')]();};}function saveUpdates(_0x4eaad2,_0x53ba02){return function(_0x5a21a7){if(_0x5a21a7){return _0x5a21a7[_0x64c9('0x37')](_0x4eaad2)[_0x64c9('0x23')](function(_0x5e0fcb){return _0x5e0fcb;});}return null;};}function removeEntity(_0x4b3923,_0x17072e){return function(_0x2c43e3){if(_0x2c43e3){return _0x2c43e3[_0x64c9('0x38')]()[_0x64c9('0x23')](function(){_0x4b3923[_0x64c9('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x171c8f,_0x1463cf){return function(_0x7b44e9){if(!_0x7b44e9){_0x171c8f['sendStatus'](0x194);}return _0x7b44e9;};}function handleError(_0x397410,_0x30e67c){_0x30e67c=_0x30e67c||0x1f4;return function(_0x305f92){logger[_0x64c9('0x29')](_0x305f92['stack']);if(_0x305f92[_0x64c9('0x39')]){delete _0x305f92[_0x64c9('0x39')];}_0x397410[_0x64c9('0x32')](_0x30e67c)['send'](_0x305f92);};}exports[_0x64c9('0x3a')]=function(_0x114559,_0xe34005){var _0x20a3a3={},_0x383adb={},_0x1a9caf={'count':0x0,'rows':[]};var _0x7546f0=_['map'](db['FaxMessage'][_0x64c9('0x3b')],function(_0x4cd595){return{'name':_0x4cd595[_0x64c9('0x3c')],'type':_0x4cd595['type'][_0x64c9('0x3d')]};});_0x383adb[_0x64c9('0x3e')]=_[_0x64c9('0x3f')](_0x7546f0,_0x64c9('0x39'));_0x383adb['query']=_[_0x64c9('0x40')](_0x114559['query']);_0x383adb[_0x64c9('0x41')]=_[_0x64c9('0x42')](_0x383adb[_0x64c9('0x3e')],_0x383adb[_0x64c9('0x43')]);_0x20a3a3[_0x64c9('0x44')]=_[_0x64c9('0x42')](_0x383adb[_0x64c9('0x3e')],qs[_0x64c9('0x45')](_0x114559[_0x64c9('0x43')][_0x64c9('0x45')]));_0x20a3a3['attributes']=_0x20a3a3['attributes'][_0x64c9('0x46')]?_0x20a3a3['attributes']:_0x383adb['model'];if(!_0x114559[_0x64c9('0x43')][_0x64c9('0x47')](_0x64c9('0x48'))){_0x20a3a3[_0x64c9('0x49')]=qs[_0x64c9('0x49')](_0x114559['query'][_0x64c9('0x49')]);_0x20a3a3[_0x64c9('0x2f')]=qs[_0x64c9('0x2f')](_0x114559['query']['offset']);}_0x20a3a3[_0x64c9('0x4a')]=qs[_0x64c9('0x4b')](_0x114559['query'][_0x64c9('0x4b')]);_0x20a3a3[_0x64c9('0x4c')]=qs[_0x64c9('0x41')](_['pick'](_0x114559[_0x64c9('0x43')],_0x383adb[_0x64c9('0x41')]),_0x7546f0);if(_0x114559[_0x64c9('0x43')][_0x64c9('0x4d')]){_0x20a3a3[_0x64c9('0x4c')]=_[_0x64c9('0x4e')](_0x20a3a3['where'],{'$or':_['map'](_0x7546f0,function(_0x1151e7){if(_0x1151e7['type']!=='VIRTUAL'){var _0x1c835c={};_0x1c835c[_0x1151e7['name']]={'$like':'%'+_0x114559['query'][_0x64c9('0x4d')]+'%'};return _0x1c835c;}})});}_0x20a3a3=_[_0x64c9('0x4e')]({},_0x20a3a3,_0x114559[_0x64c9('0x4f')]);var _0x329d3a={'where':_0x20a3a3[_0x64c9('0x4c')]};return db['FaxMessage']['count'](_0x329d3a)['then'](function(_0x4c4654){_0x1a9caf[_0x64c9('0x31')]=_0x4c4654;if(_0x114559[_0x64c9('0x43')][_0x64c9('0x50')]){_0x20a3a3['include']=[{'all':!![]}];}return db[_0x64c9('0x51')]['findAll'](_0x20a3a3);})[_0x64c9('0x23')](function(_0x40b8d7){_0x1a9caf[_0x64c9('0x52')]=_0x40b8d7;return _0x1a9caf;})[_0x64c9('0x23')](respondWithFilteredResult(_0xe34005,_0x20a3a3))[_0x64c9('0x53')](handleError(_0xe34005,null));};exports[_0x64c9('0x54')]=function(_0x9c0d31,_0x47eb11){var _0x5cb819={'raw':!![],'where':{'id':_0x9c0d31['params']['id']}},_0x3bcc6a={};_0x3bcc6a[_0x64c9('0x3e')]=_[_0x64c9('0x40')](db['FaxMessage'][_0x64c9('0x3b')]);_0x3bcc6a[_0x64c9('0x43')]=_['keys'](_0x9c0d31[_0x64c9('0x43')]);_0x3bcc6a[_0x64c9('0x41')]=_[_0x64c9('0x42')](_0x3bcc6a['model'],_0x3bcc6a[_0x64c9('0x43')]);_0x5cb819[_0x64c9('0x44')]=_[_0x64c9('0x42')](_0x3bcc6a['model'],qs['fields'](_0x9c0d31[_0x64c9('0x43')][_0x64c9('0x45')]));_0x5cb819[_0x64c9('0x44')]=_0x5cb819[_0x64c9('0x44')]['length']?_0x5cb819[_0x64c9('0x44')]:_0x3bcc6a[_0x64c9('0x3e')];if(_0x9c0d31[_0x64c9('0x43')][_0x64c9('0x50')]){_0x5cb819['include']=[{'all':!![]}];}_0x5cb819=_[_0x64c9('0x4e')]({},_0x5cb819,_0x9c0d31[_0x64c9('0x4f')]);return db[_0x64c9('0x51')]['find'](_0x5cb819)[_0x64c9('0x23')](handleEntityNotFound(_0x47eb11,null))['then'](respondWithResult(_0x47eb11,null))[_0x64c9('0x53')](handleError(_0x47eb11,null));};exports[_0x64c9('0x37')]=function(_0x571dce,_0x3ae7d5){if(_0x571dce[_0x64c9('0x55')]['id']){delete _0x571dce[_0x64c9('0x55')]['id'];}return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x571dce[_0x64c9('0x57')]['id']}})[_0x64c9('0x23')](handleEntityNotFound(_0x3ae7d5,null))['then'](saveUpdates(_0x571dce['body'],null))['then'](respondWithResult(_0x3ae7d5,null))['catch'](handleError(_0x3ae7d5,null));};exports[_0x64c9('0x38')]=function(_0xdd811b,_0x3755e2){return db['FaxMessage'][_0x64c9('0x56')]({'where':{'id':_0xdd811b[_0x64c9('0x57')]['id']}})['then'](handleEntityNotFound(_0x3755e2,null))[_0x64c9('0x23')](removeEntity(_0x3755e2,null))[_0x64c9('0x53')](handleError(_0x3755e2,null));};exports[_0x64c9('0x58')]=function(_0x48333d,_0xb4f53b){return db['FaxMessage'][_0x64c9('0x58')]()[_0x64c9('0x23')](respondWithResult(_0xb4f53b,null))[_0x64c9('0x53')](handleError(_0xb4f53b,null));};var interaction_log=require(_0x64c9('0x16'))('fax-interactions');exports['accept']=function(_0x3d483a,_0x4d7fc4,_0x4b619e){var _0x1825e3={'agent':{},'channel':'fax'};if(_0x3d483a[_0x64c9('0x55')]['id']){delete _0x3d483a[_0x64c9('0x55')]['id'];}_0x3d483a[_0x64c9('0x55')][_0x64c9('0x59')]=!![];_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5a')]=moment()['format'](_0x64c9('0x5b'));_0x3d483a['body'][_0x64c9('0x5c')]=_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5c')]||_0x3d483a[_0x64c9('0x5d')]['id'];_0x1825e3[_0x64c9('0x5e')]['id']=_0x3d483a[_0x64c9('0x55')]['UserId'];return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x3d483a[_0x64c9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d7fc4,null))[_0x64c9('0x23')](saveUpdates(_0x3d483a[_0x64c9('0x55')],null))[_0x64c9('0x23')](function(_0x3c4dbe){if(_0x3c4dbe){_0x1825e3[_0x64c9('0x2a')]=_0x3c4dbe['get']({'plain':!![]});return db[_0x64c9('0x5f')]['find']({'where':{'id':_0x3c4dbe[_0x64c9('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x4d7fc4,null))[_0x64c9('0x23')](function(_0x25d260){if(_0x25d260){return _0x25d260[_0x64c9('0x37')]({'UserId':_0x3d483a[_0x64c9('0x55')]['UserId'],'read1stAt':_['isNil'](_0x25d260[_0x64c9('0x61')])?moment()[_0x64c9('0x62')](_0x64c9('0x5b')):undefined});}return null;})[_0x64c9('0x23')](function(_0x5acf1b){if(_0x5acf1b){_0x1825e3[_0x64c9('0x63')]=_0x5acf1b[_0x64c9('0x64')]({'plain':!![]});interaction_log[_0x64c9('0x24')](_0x64c9('0x65'),_0x3d483a['user']['id'],_0x3d483a[_0x64c9('0x5d')][_0x64c9('0x39')],_0x3d483a[_0x64c9('0x5d')]['role'],_0x1825e3['interaction']['id'],_0x3d483a[_0x64c9('0x55')]?JSON[_0x64c9('0x28')](_0x3d483a[_0x64c9('0x55')]):_0x64c9('0x66'));return respondWithRpcPromise(_0x64c9('0x67'),_0x64c9('0x68'),_0x1825e3);}return null;})['then'](function(_0x1eb962){var _0xdd8855='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1eb962[_0x64c9('0x2a')][_0x64c9('0x69')];return db['sequelize'][_0x64c9('0x43')](_0xdd8855,{'type':db[_0x64c9('0x6a')]['QueryTypes'][_0x64c9('0x6b')],'raw':!![]})[_0x64c9('0x23')](function(_0x353b69){return _0x353b69;});})[_0x64c9('0x23')](function(_0x49e4ae){if(_0x49e4ae){_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x6c')]=_0x49e4ae[0x0];if(!_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5c')])return;return db[_0x64c9('0x6d')]['find']({'where':{'id':_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5c')],'role':'agent'},'attributes':['id','name',_0x64c9('0x6e'),_0x64c9('0x6f'),_0x64c9('0x70')],'raw':!![]});}return null;})[_0x64c9('0x23')](function(_0x75f07c){if(!_0x75f07c)return null;_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x5e')]=_0x75f07c;return _0x1825e3;})['then'](function(_0x29199d){if(_0x29199d){if(_0x3d483a[_0x64c9('0x55')][_0x64c9('0x71')]){_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x72')]=util[_0x64c9('0x62')](_0x64c9('0x73'),_0x3d483a[_0x64c9('0x5d')]['name']);_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x74')]=_0x1825e3[_0x64c9('0x74')];_0x1825e3[_0x64c9('0x2a')]['motionChannel']=_0x1825e3['channel'];_0x1825e3['message'][_0x64c9('0x75')]=_0x64c9('0x76');return respondWithRpcPromise(_0x64c9('0x77'),'EventManager',{'event':_0x64c9('0x78'),'message':_0x1825e3[_0x64c9('0x2a')]},client9002)[_0x64c9('0x23')](function(){return _0x1825e3;});}return _0x1825e3;}return null;})[_0x64c9('0x23')](respondWithResult(_0x4d7fc4,null))['catch'](handleError(_0x4d7fc4,null));};var interaction_log=require(_0x64c9('0x16'))(_0x64c9('0x79'));exports[_0x64c9('0x35')]=function(_0x2b5a45,_0x11ca37,_0x31e16e){var _0x1944f9={'agent':{},'channel':'fax'};if(_0x2b5a45[_0x64c9('0x55')]['id']){delete _0x2b5a45[_0x64c9('0x55')]['id'];}_0x2b5a45['body']['UserId']=_0x2b5a45['body'][_0x64c9('0x5c')]||_0x2b5a45[_0x64c9('0x5d')]['id'];_0x1944f9['agent']['id']=_0x2b5a45[_0x64c9('0x55')][_0x64c9('0x5c')];return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x2b5a45['params']['id'],'UserId':null}})[_0x64c9('0x23')](handleEntityNotFound(_0x11ca37,null))[_0x64c9('0x23')](function(_0x2885a7){if(_0x2885a7){_0x1944f9[_0x64c9('0x2a')]=_0x2885a7['get']({'plain':!![]});return db[_0x64c9('0x5f')][_0x64c9('0x56')]({'where':{'id':_0x2885a7['FaxInteractionId']}});}return null;})[_0x64c9('0x23')](handleEntityNotFound(_0x11ca37,null))['then'](function(_0x10ae8b){if(_0x10ae8b){_0x1944f9[_0x64c9('0x63')]=_0x10ae8b[_0x64c9('0x64')]({'plain':!![]});interaction_log['info'](_0x64c9('0x7a'),_0x2b5a45[_0x64c9('0x5d')]['id'],_0x2b5a45['user'][_0x64c9('0x39')],_0x2b5a45[_0x64c9('0x5d')][_0x64c9('0x7b')],_0x1944f9['interaction']['id'],_0x2b5a45[_0x64c9('0x55')]?JSON['stringify'](_0x2b5a45['body']):_0x64c9('0x66'));return respondWithRpcPromise(_0x64c9('0x7c'),'rejectMessage',_0x1944f9);}return null;})[_0x64c9('0x23')](function(_0x2a4d63){var _0x17b536=_0x64c9('0x7d')+_0x2a4d63[_0x64c9('0x2a')][_0x64c9('0x69')];return db[_0x64c9('0x7e')][_0x64c9('0x43')](_0x17b536,{'type':db[_0x64c9('0x6a')][_0x64c9('0x7f')][_0x64c9('0x6b')],'raw':!![]})['then'](function(_0x408b4d){return _0x408b4d;});})[_0x64c9('0x23')](function(_0x277f8d){if(_0x277f8d){_0x1944f9[_0x64c9('0x2a')]['contact']=_0x277f8d[0x0];if(!_0x2b5a45[_0x64c9('0x55')][_0x64c9('0x5c')])return;return db[_0x64c9('0x6d')][_0x64c9('0x56')]({'where':{'id':_0x2b5a45[_0x64c9('0x55')][_0x64c9('0x5c')],'role':'agent'},'attributes':['id','name',_0x64c9('0x6e'),_0x64c9('0x6f'),_0x64c9('0x70')],'raw':!![]});}return null;})[_0x64c9('0x23')](function(_0x2e4a15){if(!_0x2e4a15)return null;_0x1944f9['message'][_0x64c9('0x5e')]=_0x2e4a15;return _0x1944f9;})[_0x64c9('0x23')](function(_0x294aab){if(_0x294aab){_0x294aab[_0x64c9('0x2a')][_0x64c9('0x72')]=util[_0x64c9('0x62')](_0x64c9('0x73'),_0x2b5a45[_0x64c9('0x5d')][_0x64c9('0x39')]);_0x294aab[_0x64c9('0x2a')]['channel']=_0x1944f9[_0x64c9('0x74')];_0x294aab['message'][_0x64c9('0x80')]=_0x1944f9[_0x64c9('0x74')];_0x294aab['message'][_0x64c9('0x75')]=_0x64c9('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x64c9('0x81'),'message':_0x294aab[_0x64c9('0x2a')]},client9002);return _0x1944f9;}return null;})[_0x64c9('0x23')](respondWithResult(_0x11ca37,null))['catch'](handleError(_0x11ca37,null));};exports[_0x64c9('0x82')]=function(_0x58180e,_0x445e73){var _0x1e88b8;return db[_0x64c9('0x51')]['create'](_0x58180e[_0x64c9('0x55')],{})[_0x64c9('0x23')](function(_0x206040){_0x1e88b8=_0x206040;return db[_0x64c9('0x83')][_0x64c9('0x84')]({'where':{'id':_0x1e88b8[_0x64c9('0x69')]}});})['then'](function(_0x2eb95d){if(_[_0x64c9('0x85')](_0x2eb95d)){return;}else{_0x1e88b8['fax']=_0x2eb95d['fax'];return db['Attachment'][_0x64c9('0x84')]({'where':{'id':_0x1e88b8[_0x64c9('0x86')]}});}})[_0x64c9('0x23')](function(_0x1fb0a0){return respondWithRpcPromise('SendFax',_0x64c9('0x87'),{'FaxAccountId':_[_0x64c9('0x85')](_0x58180e['body'])?undefined:_0x58180e[_0x64c9('0x55')]['FaxAccountId'],'path':_[_0x64c9('0x85')](_0x1fb0a0)?undefined:util[_0x64c9('0x62')](_0x64c9('0x88'),_0x1fb0a0[_0x64c9('0x89')]),'fax':_[_0x64c9('0x85')](_0x1e88b8[_0x64c9('0x8a')])?undefined:_0x1e88b8[_0x64c9('0x8a')],'AttachmentId':_0x1e88b8[_0x64c9('0x86')]},client9002);})[_0x64c9('0x23')](respondWithResult(_0x445e73,0xc9))['catch'](handleError(_0x445e73,null));};exports[_0x64c9('0x8b')]=function(_0x259275,_0x571220){var _0x3b8170=path[_0x64c9('0x8c')](config[_0x64c9('0x8d')],_0x64c9('0x8e'),_0x64c9('0x8f'),'attachments');return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x259275['params']['id']},'include':[{'model':db[_0x64c9('0x90')],'as':_0x64c9('0x90')}]})['then'](handleEntityNotFound(_0x571220,null))[_0x64c9('0x23')](function(_0x46f90f){if(_0x46f90f){return _0x571220['download'](path[_0x64c9('0x8c')](_0x3b8170,_0x46f90f[_0x64c9('0x90')][_0x64c9('0x89')]));}})[_0x64c9('0x53')](handleError(_0x571220,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 543b5cc..7813a35 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeae8=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','remove','emit'];(function(_0x8968a5,_0x3e4578){var _0x192952=function(_0x50216e){while(--_0x50216e){_0x8968a5['push'](_0x8968a5['shift']());}};_0x192952(++_0x3e4578);}(_0xeae8,0x66));var _0x8eae=function(_0x1c3a05,_0x2993e5){_0x1c3a05=_0x1c3a05-0x0;var _0x3158ee=_0xeae8[_0x1c3a05];return _0x3158ee;};'use strict';var EventEmitter=require(_0x8eae('0x0'));var FaxMessage=require(_0x8eae('0x1'))['db'][_0x8eae('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8eae('0x3'),'afterUpdate':'update','afterDestroy':_0x8eae('0x4')};function emitEvent(_0x5f311f){return function(_0x355d48,_0x18cccf,_0x30e4cc){FaxMessageEvents[_0x8eae('0x5')](_0x5f311f+':'+_0x355d48['id'],_0x355d48);FaxMessageEvents[_0x8eae('0x5')](_0x5f311f,_0x355d48);_0x30e4cc(null);};}for(var e in events){if(events[_0x8eae('0x6')](e)){var event=events[e];FaxMessage[_0x8eae('0x7')](e,emitEvent(event));}}module[_0x8eae('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x960c=['emit','hasOwnProperty','hook','events','FaxMessage','save','update','remove'];(function(_0x59ce18,_0x2b6286){var _0x4c2c9c=function(_0x5b3386){while(--_0x5b3386){_0x59ce18['push'](_0x59ce18['shift']());}};_0x4c2c9c(++_0x2b6286);}(_0x960c,0x113));var _0xc960=function(_0x394662,_0x42e8e3){_0x394662=_0x394662-0x0;var _0x11683d=_0x960c[_0x394662];return _0x11683d;};'use strict';var EventEmitter=require(_0xc960('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xc960('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc960('0x2'),'afterUpdate':_0xc960('0x3'),'afterDestroy':_0xc960('0x4')};function emitEvent(_0x5c6ea5){return function(_0x1b54d7,_0x3ff69d,_0x485db9){FaxMessageEvents['emit'](_0x5c6ea5+':'+_0x1b54d7['id'],_0x1b54d7);FaxMessageEvents[_0xc960('0x5')](_0x5c6ea5,_0x1b54d7);_0x485db9(null);};}for(var e in events){if(events[_0xc960('0x6')](e)){var event=events[e];FaxMessage[_0xc960('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 9a14a5a..150c218 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae32=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','then','update','catch','error'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xae32,0x12a));var _0x2ae3=function(_0x106696,_0xe64257){_0x106696=_0x106696-0x0;var _0x13fc73=_0xae32[_0x106696];return _0x13fc73;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2ae3('0x0'))('api');var moment=require(_0x2ae3('0x1'));var BPromise=require(_0x2ae3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ae3('0x3'));var rimraf=require(_0x2ae3('0x4'));var config=require(_0x2ae3('0x5'));var attributes=require(_0x2ae3('0x6'));module[_0x2ae3('0x7')]=function(_0x14aedc,_0x20f646){return _0x14aedc[_0x2ae3('0x8')](_0x2ae3('0x9'),attributes,{'tableName':_0x2ae3('0xa'),'paranoid':![],'indexes':[{'name':_0x2ae3('0xb'),'fields':[_0x2ae3('0xc')],'type':_0x2ae3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b58ab,_0x312756,_0x2c054a){var _0x534fbc=_0x14aedc['models'];var _0x449858=_0x1b58ab[_0x2ae3('0xe')]({'plain':!![]});if(_0x449858['direction'][_0x2ae3('0xf')]()==='in'||_0x449858[_0x2ae3('0x10')]['toLowerCase']()==='out'&&!_0x449858[_0x2ae3('0x11')]&&!_[_0x2ae3('0x12')](_0x449858[_0x2ae3('0x13')])){_0x534fbc[_0x2ae3('0x14')][_0x2ae3('0x15')]({'where':{'id':_0x449858['FaxInteractionId']}})[_0x2ae3('0x16')](function(_0xde5c83){if(_0xde5c83){_0xde5c83[_0x2ae3('0x17')]({'lastMsgAt':_0x449858['createdAt'],'lastMsgDirection':_0x449858['direction'][_0x2ae3('0xf')]()});}})[_0x2ae3('0x18')](function(_0x3c9900){console[_0x2ae3('0x19')](_0x3c9900);});}_0x2c054a();}},'charset':'utf8mb4','collate':_0x2ae3('0x1a')});}; \ No newline at end of file +var _0x3b9b=['exports','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','update','direction','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','rimraf','./faxMessage.attributes'];(function(_0x166e33,_0x127e77){var _0x1a2409=function(_0x48edd3){while(--_0x48edd3){_0x166e33['push'](_0x166e33['shift']());}};_0x1a2409(++_0x127e77);}(_0x3b9b,0x18a));var _0xb3b9=function(_0x73b74c,_0x11dcb0){_0x73b74c=_0x73b74c-0x0;var _0x5488d0=_0x3b9b[_0x73b74c];return _0x5488d0;};'use strict';var _=require(_0xb3b9('0x0'));var util=require('util');var logger=require(_0xb3b9('0x1'))(_0xb3b9('0x2'));var moment=require('moment');var BPromise=require(_0xb3b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb3b9('0x4'));var config=require('../../config/environment');var attributes=require(_0xb3b9('0x5'));module[_0xb3b9('0x6')]=function(_0x5ad26e,_0x3c2e26){return _0x5ad26e['define'](_0xb3b9('0x7'),attributes,{'tableName':_0xb3b9('0x8'),'paranoid':![],'indexes':[{'name':_0xb3b9('0x9'),'fields':['body'],'type':_0xb3b9('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6028ee,_0x339a98,_0x374d93){var _0x2baeb9=_0x5ad26e[_0xb3b9('0xb')];var _0x50c86a=_0x6028ee[_0xb3b9('0xc')]({'plain':!![]});if(_0x50c86a['direction'][_0xb3b9('0xd')]()==='in'||_0x50c86a['direction'][_0xb3b9('0xd')]()===_0xb3b9('0xe')&&!_0x50c86a[_0xb3b9('0xf')]&&!_['isNil'](_0x50c86a[_0xb3b9('0x10')])){_0x2baeb9[_0xb3b9('0x11')][_0xb3b9('0x12')]({'where':{'id':_0x50c86a[_0xb3b9('0x13')]}})['then'](function(_0x127142){if(_0x127142){_0x127142[_0xb3b9('0x14')]({'lastMsgAt':_0x50c86a['createdAt'],'lastMsgDirection':_0x50c86a[_0xb3b9('0x15')][_0xb3b9('0xd')]()});}})[_0xb3b9('0x16')](function(_0x3963b7){console['error'](_0x3963b7);});}_0x374d93();}},'charset':_0xb3b9('0x17'),'collate':_0xb3b9('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index d033660..b8323f2 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x3cff12,_0x22745d){var _0x4bb6c3=function(_0x2d6607){while(--_0x2d6607){_0x3cff12['push'](_0x3cff12['shift']());}};_0x4bb6c3(++_0x22745d);}(_0x032e,0x124));var _0xe032=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x032e[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file +var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x17f9f7,_0x25bbd7){_0x17f9f7=_0x17f9f7-0x0;var _0x3f3b86=_0x5fd1[_0x17f9f7];return _0x3f3b86;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 063b635..8b2d0d6 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02bf=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','register'];(function(_0x4ce5ac,_0x3b6a03){var _0x2a8193=function(_0x53b32a){while(--_0x53b32a){_0x4ce5ac['push'](_0x4ce5ac['shift']());}};_0x2a8193(++_0x3b6a03);}(_0x02bf,0x92));var _0xf02b=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x02bf[_0x2f6541];return _0x4d76d8;};'use strict';var FaxMessageEvents=require(_0xf02b('0x0'));var events=[_0xf02b('0x1'),_0xf02b('0x2'),_0xf02b('0x3')];function createListener(_0x1de6f2,_0x3d5244){return function(_0x48e671){_0x3d5244[_0xf02b('0x4')](_0x1de6f2,_0x48e671);};}function removeListener(_0x251156,_0x2d5d3c){return function(){FaxMessageEvents['removeListener'](_0x251156,_0x2d5d3c);};}exports[_0xf02b('0x5')]=function(_0x306390){for(var _0x30d3dc=0x0,_0x4522d8=events[_0xf02b('0x6')];_0x30d3dc<_0x4522d8;_0x30d3dc++){var _0x3bfa3d=events[_0x30d3dc];var _0x258d5e=createListener(_0xf02b('0x7')+_0x3bfa3d,_0x306390);FaxMessageEvents['on'](_0x3bfa3d,_0x258d5e);}}; \ No newline at end of file +var _0xd54c=['removeListener','register','length','faxMessage:','./faxMessage.events','save','emit'];(function(_0x31bdbc,_0x2c5332){var _0x44cb63=function(_0x44e188){while(--_0x44e188){_0x31bdbc['push'](_0x31bdbc['shift']());}};_0x44cb63(++_0x2c5332);}(_0xd54c,0x89));var _0xcd54=function(_0x4ed4e7,_0x30a2a7){_0x4ed4e7=_0x4ed4e7-0x0;var _0x2a8e13=_0xd54c[_0x4ed4e7];return _0x2a8e13;};'use strict';var FaxMessageEvents=require(_0xcd54('0x0'));var events=[_0xcd54('0x1'),'remove','update'];function createListener(_0x48fa31,_0x5ac443){return function(_0x4da0ef){_0x5ac443[_0xcd54('0x2')](_0x48fa31,_0x4da0ef);};}function removeListener(_0x262beb,_0x2d3450){return function(){FaxMessageEvents[_0xcd54('0x3')](_0x262beb,_0x2d3450);};}exports[_0xcd54('0x4')]=function(_0x5b09e6){for(var _0x11942a=0x0,_0x30cd46=events[_0xcd54('0x5')];_0x11942a<_0x30cd46;_0x11942a++){var _0x53b1ac=events[_0x11942a];var _0x459643=createListener(_0xcd54('0x6')+_0x53b1ac,_0x5b09e6);FaxMessageEvents['on'](_0x53b1ac,_0x459643);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 82b2b47..85fe3e8 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde2c=['/describe','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x42a9c0,_0x50a236){var _0x298db3=function(_0x2bbe32){while(--_0x2bbe32){_0x42a9c0['push'](_0x42a9c0['shift']());}};_0x298db3(++_0x50a236);}(_0xde2c,0x7f));var _0xcde2=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0xde2c[_0x35f7f5];return _0x5567a4;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xcde2('0x13'),_0xcde2('0x14')),controller[_0xcde2('0x15')]);router[_0xcde2('0x16')](_0xcde2('0x17'),auth[_0xcde2('0xb')](),controller['update']);router[_0xcde2('0x16')]('/:id/accept',auth[_0xcde2('0xb')](),controller['accept']);router['put'](_0xcde2('0x18'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x19')]);router[_0xcde2('0x1a')](_0xcde2('0x17'),auth['isAuthenticated'](),controller[_0xcde2('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x04b8=['/:id','update','put','/:id/accept','/:id/reject','reject','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','isAuthenticated','show','/:id/download','post','tracked','fax','faxmessage:create','create'];(function(_0x1d203d,_0x1a5b2b){var _0x2e5a5b=function(_0x46b403){while(--_0x46b403){_0x1d203d['push'](_0x1d203d['shift']());}};_0x2e5a5b(++_0x1a5b2b);}(_0x04b8,0x159));var _0x804b=function(_0x3e23e8,_0x57b812){_0x3e23e8=_0x3e23e8-0x0;var _0x16ab10=_0x04b8[_0x3e23e8];return _0x16ab10;};'use strict';var multer=require('multer');var util=require(_0x804b('0x0'));var path=require('path');var timeout=require(_0x804b('0x1'));var express=require(_0x804b('0x2'));var router=express['Router']();var fs_extra=require(_0x804b('0x3'));var auth=require(_0x804b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x804b('0x5'));var controller=require(_0x804b('0x6'));router[_0x804b('0x7')]('/',auth['isAuthenticated'](),controller[_0x804b('0x8')]);router[_0x804b('0x7')](_0x804b('0x9'),auth['isAuthenticated'](),controller[_0x804b('0xa')]);router[_0x804b('0x7')]('/:id',auth[_0x804b('0xb')](),controller[_0x804b('0xc')]);router[_0x804b('0x7')](_0x804b('0xd'),auth[_0x804b('0xb')](),controller['download']);router[_0x804b('0xe')]('/',auth[_0x804b('0xb')](),interaction[_0x804b('0xf')](_0x804b('0x10'),_0x804b('0x11')),controller[_0x804b('0x12')]);router['put'](_0x804b('0x13'),auth['isAuthenticated'](),controller[_0x804b('0x14')]);router[_0x804b('0x15')](_0x804b('0x16'),auth[_0x804b('0xb')](),controller['accept']);router[_0x804b('0x15')](_0x804b('0x17'),auth[_0x804b('0xb')](),controller[_0x804b('0x18')]);router['delete'](_0x804b('0x13'),auth[_0x804b('0xb')](),controller['destroy']);module[_0x804b('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 8973ba3..f29f168 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09db=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x419a0b,_0x5f5440){var _0x373162=function(_0x46bb12){while(--_0x46bb12){_0x419a0b['push'](_0x419a0b['shift']());}};_0x373162(++_0x5f5440);}(_0x09db,0x6c));var _0xb09d=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x09db[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require(_0xb09d('0x0'));module[_0xb09d('0x1')]={'name':{'type':Sequelize[_0xb09d('0x2')],'unique':_0xb09d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb09d('0x2')]},'timeout':{'type':Sequelize[_0xb09d('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb09d('0x5')](_0xb09d('0x6'),_0xb09d('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a2e=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1d7c83,_0x2d8f2d){var _0x283ef2=function(_0x68da53){while(--_0x68da53){_0x1d7c83['push'](_0x1d7c83['shift']());}};_0x283ef2(++_0x2d8f2d);}(_0x0a2e,0xe1));var _0xe0a2=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x0a2e[_0x5d8018];return _0x151ac4;};'use strict';var Sequelize=require(_0xe0a2('0x0'));module[_0xe0a2('0x1')]={'name':{'type':Sequelize[_0xe0a2('0x2')],'unique':_0xe0a2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe0a2('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe0a2('0x5')](_0xe0a2('0x6'),_0xe0a2('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 4ea8ff0..ff59124 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ad9=['merge','type','VIRTUAL','include','catch','show','params','fields','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','ids','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','addAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x3ef8a9,_0x59a7c2){var _0x424f63=function(_0x7c1873){while(--_0x7c1873){_0x3ef8a9['push'](_0x3ef8a9['shift']());}};_0x424f63(++_0x59a7c2);}(_0x1ad9,0xdb));var _0x91ad=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x1ad9[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x91ad('0x0'));var rimraf=require(_0x91ad('0x1'));var zipdir=require(_0x91ad('0x2'));var jsonpatch=require(_0x91ad('0x3'));var rp=require(_0x91ad('0x4'));var moment=require(_0x91ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91ad('0x6'));var util=require(_0x91ad('0x7'));var path=require(_0x91ad('0x8'));var sox=require(_0x91ad('0x9'));var csv=require(_0x91ad('0xa'));var ejs=require(_0x91ad('0xb'));var fs=require('fs');var fs_extra=require(_0x91ad('0xc'));var _=require(_0x91ad('0xd'));var squel=require('squel');var crypto=require(_0x91ad('0xe'));var jsforce=require(_0x91ad('0xf'));var deskjs=require(_0x91ad('0x10'));var toCsv=require(_0x91ad('0xa'));var querystring=require(_0x91ad('0x11'));var Papa=require(_0x91ad('0x12'));var Redis=require(_0x91ad('0x13'));var authService=require(_0x91ad('0x14'));var qs=require(_0x91ad('0x15'));var as=require(_0x91ad('0x16'));var hardwareService=require(_0x91ad('0x17'));var logger=require('../../config/logger')(_0x91ad('0x18'));var utils=require(_0x91ad('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x91ad('0x1a'));var db=require(_0x91ad('0x1b'))['db'];config[_0x91ad('0x1c')]=_[_0x91ad('0x1d')](config[_0x91ad('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91ad('0x1c')]));require(_0x91ad('0x1e'))[_0x91ad('0x1f')](socket);function respondWithStatusCode(_0x305a11,_0x3c7bef){_0x3c7bef=_0x3c7bef||0xcc;return function(_0x57b15e){if(_0x57b15e){return _0x305a11[_0x91ad('0x20')](_0x3c7bef);}return _0x305a11[_0x91ad('0x21')](_0x3c7bef)['end']();};}function respondWithResult(_0x48cbfa,_0x469673){_0x469673=_0x469673||0xc8;return function(_0x2b86bd){if(_0x2b86bd){return _0x48cbfa['status'](_0x469673)[_0x91ad('0x22')](_0x2b86bd);}};}function respondWithFilteredResult(_0x13cc19,_0x2f6108){return function(_0x171559){if(_0x171559){var _0x1247f2=typeof _0x2f6108[_0x91ad('0x23')]===_0x91ad('0x24')&&typeof _0x2f6108[_0x91ad('0x25')]==='undefined';var _0x269501=_0x171559[_0x91ad('0x26')];var _0x56e2af=_0x1247f2?0x0:_0x2f6108[_0x91ad('0x23')];var _0x29fa18=_0x1247f2?_0x171559[_0x91ad('0x26')]:_0x2f6108[_0x91ad('0x23')]+_0x2f6108[_0x91ad('0x25')];var _0x48cb71;if(_0x29fa18>=_0x269501){_0x29fa18=_0x269501;_0x48cb71=0xc8;}else{_0x48cb71=0xce;}_0x13cc19[_0x91ad('0x21')](_0x48cb71);return _0x13cc19[_0x91ad('0x27')](_0x91ad('0x28'),_0x56e2af+'-'+_0x29fa18+'/'+_0x269501)[_0x91ad('0x22')](_0x171559);}return null;};}function patchUpdates(_0x1779e4){return function(_0x2f7e04){try{jsonpatch[_0x91ad('0x29')](_0x2f7e04,_0x1779e4,!![]);}catch(_0x293b00){return BPromise[_0x91ad('0x2a')](_0x293b00);}return _0x2f7e04[_0x91ad('0x2b')]();};}function saveUpdates(_0x3e966f,_0x22040d){return function(_0x1965ff){if(_0x1965ff){return _0x1965ff[_0x91ad('0x2c')](_0x3e966f)[_0x91ad('0x2d')](function(_0x1d4617){return _0x1d4617;});}return null;};}function removeEntity(_0x384fc2,_0x1d1123){return function(_0x307422){if(_0x307422){return _0x307422[_0x91ad('0x2e')]()['then'](function(){var _0x119931=_0x307422['get']({'plain':!![]});var _0x11ea09='FaxQueues';return db['UserProfileResource'][_0x91ad('0x2e')]({'where':{'type':_0x11ea09,'resourceId':_0x119931['id']}})[_0x91ad('0x2d')](function(){return _0x307422;});})[_0x91ad('0x2d')](function(){_0x384fc2[_0x91ad('0x21')](0xcc)[_0x91ad('0x2f')]();});}};}function handleEntityNotFound(_0x2b2565,_0x1393e2){return function(_0x687737){if(!_0x687737){_0x2b2565['sendStatus'](0x194);}return _0x687737;};}function handleError(_0x2cb5e5,_0x53ba77){_0x53ba77=_0x53ba77||0x1f4;return function(_0x119f18){logger[_0x91ad('0x30')](_0x119f18[_0x91ad('0x31')]);if(_0x119f18[_0x91ad('0x32')]){delete _0x119f18[_0x91ad('0x32')];}_0x2cb5e5[_0x91ad('0x21')](_0x53ba77)[_0x91ad('0x33')](_0x119f18);};}exports[_0x91ad('0x34')]=function(_0x550734,_0x4e2a82){var _0x3fde16={},_0x33b16c={},_0x35e488={'count':0x0,'rows':[]};var _0x2c3e1f=_[_0x91ad('0x35')](db[_0x91ad('0x36')][_0x91ad('0x37')],function(_0x566865){return{'name':_0x566865['fieldName'],'type':_0x566865['type'][_0x91ad('0x38')]};});_0x33b16c[_0x91ad('0x39')]=_[_0x91ad('0x35')](_0x2c3e1f,_0x91ad('0x32'));_0x33b16c[_0x91ad('0x3a')]=_[_0x91ad('0x3b')](_0x550734[_0x91ad('0x3a')]);_0x33b16c[_0x91ad('0x3c')]=_['intersection'](_0x33b16c['model'],_0x33b16c[_0x91ad('0x3a')]);_0x3fde16['attributes']=_[_0x91ad('0x3d')](_0x33b16c['model'],qs['fields'](_0x550734[_0x91ad('0x3a')]['fields']));_0x3fde16['attributes']=_0x3fde16[_0x91ad('0x3e')][_0x91ad('0x3f')]?_0x3fde16['attributes']:_0x33b16c['model'];if(!_0x550734[_0x91ad('0x3a')][_0x91ad('0x40')](_0x91ad('0x41'))){_0x3fde16[_0x91ad('0x25')]=qs[_0x91ad('0x25')](_0x550734[_0x91ad('0x3a')][_0x91ad('0x25')]);_0x3fde16['offset']=qs[_0x91ad('0x23')](_0x550734[_0x91ad('0x3a')][_0x91ad('0x23')]);}_0x3fde16[_0x91ad('0x42')]=qs[_0x91ad('0x43')](_0x550734[_0x91ad('0x3a')][_0x91ad('0x43')]);_0x3fde16[_0x91ad('0x44')]=qs[_0x91ad('0x3c')](_[_0x91ad('0x45')](_0x550734[_0x91ad('0x3a')],_0x33b16c[_0x91ad('0x3c')]),_0x2c3e1f);if(_0x550734[_0x91ad('0x3a')][_0x91ad('0x46')]){_0x3fde16[_0x91ad('0x44')]=_[_0x91ad('0x47')](_0x3fde16['where'],{'$or':_['map'](_0x2c3e1f,function(_0x1d977e){if(_0x1d977e[_0x91ad('0x48')]!==_0x91ad('0x49')){var _0x55fda8={};_0x55fda8[_0x1d977e[_0x91ad('0x32')]]={'$like':'%'+_0x550734[_0x91ad('0x3a')][_0x91ad('0x46')]+'%'};return _0x55fda8;}})});}_0x3fde16=_[_0x91ad('0x47')]({},_0x3fde16,_0x550734['options']);var _0x1e826d={'where':_0x3fde16['where']};return db['FaxQueue'][_0x91ad('0x26')](_0x1e826d)[_0x91ad('0x2d')](function(_0x9bca9c){_0x35e488['count']=_0x9bca9c;if(_0x550734[_0x91ad('0x3a')]['includeAll']){_0x3fde16[_0x91ad('0x4a')]=[{'all':!![]}];}return db[_0x91ad('0x36')]['findAll'](_0x3fde16);})[_0x91ad('0x2d')](function(_0x498c36){_0x35e488['rows']=_0x498c36;return _0x35e488;})[_0x91ad('0x2d')](respondWithFilteredResult(_0x4e2a82,_0x3fde16))[_0x91ad('0x4b')](handleError(_0x4e2a82,null));};exports[_0x91ad('0x4c')]=function(_0x4fbe58,_0x406b75){var _0xfae35={'raw':!![],'where':{'id':_0x4fbe58[_0x91ad('0x4d')]['id']}},_0x507084={};_0x507084['model']=_[_0x91ad('0x3b')](db[_0x91ad('0x36')][_0x91ad('0x37')]);_0x507084[_0x91ad('0x3a')]=_[_0x91ad('0x3b')](_0x4fbe58[_0x91ad('0x3a')]);_0x507084[_0x91ad('0x3c')]=_[_0x91ad('0x3d')](_0x507084['model'],_0x507084[_0x91ad('0x3a')]);_0xfae35[_0x91ad('0x3e')]=_['intersection'](_0x507084['model'],qs[_0x91ad('0x4e')](_0x4fbe58['query'][_0x91ad('0x4e')]));_0xfae35[_0x91ad('0x3e')]=_0xfae35[_0x91ad('0x3e')][_0x91ad('0x3f')]?_0xfae35[_0x91ad('0x3e')]:_0x507084['model'];if(_0x4fbe58[_0x91ad('0x3a')]['includeAll']){_0xfae35[_0x91ad('0x4a')]=[{'all':!![]}];}_0xfae35=_[_0x91ad('0x47')]({},_0xfae35,_0x4fbe58[_0x91ad('0x4f')]);return db[_0x91ad('0x36')][_0x91ad('0x50')](_0xfae35)[_0x91ad('0x2d')](handleEntityNotFound(_0x406b75,null))[_0x91ad('0x2d')](respondWithResult(_0x406b75,null))['catch'](handleError(_0x406b75,null));};exports[_0x91ad('0x51')]=function(_0x1f3224,_0x2102e1){return db[_0x91ad('0x36')][_0x91ad('0x51')](_0x1f3224[_0x91ad('0x52')],{})[_0x91ad('0x2d')](function(_0x4876d8){var _0x154af3=_0x1f3224[_0x91ad('0x53')][_0x91ad('0x54')]({'plain':!![]});if(!_0x154af3)throw new Error(_0x91ad('0x55'));if(_0x154af3[_0x91ad('0x56')]===_0x91ad('0x53')){var _0x50cfbb=_0x4876d8['get']({'plain':!![]});var _0x212fe9=_0x91ad('0x57');return db[_0x91ad('0x58')][_0x91ad('0x50')]({'where':{'name':_0x212fe9,'userProfileId':_0x154af3[_0x91ad('0x59')]},'raw':!![]})[_0x91ad('0x2d')](function(_0x19fc5d){if(_0x19fc5d&&_0x19fc5d[_0x91ad('0x5a')]===0x0){return db[_0x91ad('0x5b')][_0x91ad('0x51')]({'name':_0x50cfbb[_0x91ad('0x32')],'resourceId':_0x50cfbb['id'],'type':_0x19fc5d[_0x91ad('0x32')],'sectionId':_0x19fc5d['id']},{})[_0x91ad('0x2d')](function(){return _0x4876d8;});}else{return _0x4876d8;}})[_0x91ad('0x4b')](function(_0x97dfb6){logger[_0x91ad('0x30')](_0x91ad('0x5c'),_0x97dfb6);throw _0x97dfb6;});}return _0x4876d8;})[_0x91ad('0x2d')](respondWithResult(_0x2102e1,0xc9))[_0x91ad('0x4b')](handleError(_0x2102e1,null));};exports[_0x91ad('0x2c')]=function(_0x5dbdaa,_0x4a9234){if(_0x5dbdaa['body']['id']){delete _0x5dbdaa[_0x91ad('0x52')]['id'];}return db['FaxQueue'][_0x91ad('0x50')]({'where':{'id':_0x5dbdaa[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](handleEntityNotFound(_0x4a9234,null))[_0x91ad('0x2d')](saveUpdates(_0x5dbdaa[_0x91ad('0x52')],null))[_0x91ad('0x2d')](respondWithResult(_0x4a9234,null))[_0x91ad('0x4b')](handleError(_0x4a9234,null));};exports[_0x91ad('0x2e')]=function(_0x332ea6,_0x5da01f){return db['FaxQueue'][_0x91ad('0x50')]({'where':{'id':_0x332ea6['params']['id']}})[_0x91ad('0x2d')](handleEntityNotFound(_0x5da01f,null))[_0x91ad('0x2d')](removeEntity(_0x5da01f,null))[_0x91ad('0x4b')](handleError(_0x5da01f,null));};exports[_0x91ad('0x5d')]=function(_0x4bf99e,_0x2e5614){return db[_0x91ad('0x36')][_0x91ad('0x5d')]()[_0x91ad('0x2d')](respondWithResult(_0x2e5614,null))[_0x91ad('0x4b')](handleError(_0x2e5614,null));};exports['getMembers']=function(_0x4cdcce,_0x34abe7,_0x1c9558){var _0x581b9={'raw':!![],'where':{}},_0x47f4d0={},_0x47fc03;return db[_0x91ad('0x36')][_0x91ad('0x5e')]({'where':{'id':_0x4cdcce[_0x91ad('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34abe7,null))['then'](function(_0x3aa4b5){if(_0x3aa4b5){_0x47fc03=_0x3aa4b5[_0x91ad('0x54')]({'plain':!![]});_0x47f4d0[_0x91ad('0x39')]=_[_0x91ad('0x3b')](db[_0x91ad('0x5f')]['rawAttributes']);_0x47f4d0[_0x91ad('0x3a')]=_[_0x91ad('0x3b')](_0x4cdcce[_0x91ad('0x3a')]);_0x47f4d0[_0x91ad('0x3c')]=_['intersection'](_0x47f4d0[_0x91ad('0x39')],_0x47f4d0[_0x91ad('0x3a')]);_0x581b9[_0x91ad('0x3e')]=_[_0x91ad('0x3d')](_0x47f4d0['model'],qs[_0x91ad('0x4e')](_0x4cdcce[_0x91ad('0x3a')][_0x91ad('0x4e')]));_0x581b9[_0x91ad('0x3e')]=_0x581b9[_0x91ad('0x3e')][_0x91ad('0x3f')]?_0x581b9['attributes']:_0x47f4d0[_0x91ad('0x39')];if(!_0x4cdcce[_0x91ad('0x3a')][_0x91ad('0x40')](_0x91ad('0x41'))){_0x581b9[_0x91ad('0x25')]=qs['limit'](_0x4cdcce[_0x91ad('0x3a')][_0x91ad('0x25')]);_0x581b9[_0x91ad('0x23')]=qs[_0x91ad('0x23')](_0x4cdcce[_0x91ad('0x3a')][_0x91ad('0x23')]);}_0x581b9['order']=qs[_0x91ad('0x43')](_0x4cdcce[_0x91ad('0x3a')]['sort']);_0x581b9[_0x91ad('0x44')]=qs['filters'](_[_0x91ad('0x45')](_0x4cdcce[_0x91ad('0x3a')],_0x47f4d0[_0x91ad('0x3c')]));_0x581b9[_0x91ad('0x44')][_0x91ad('0x60')]=_0x3aa4b5['id'];if(_0x4cdcce[_0x91ad('0x3a')][_0x91ad('0x46')]){_0x581b9[_0x91ad('0x44')]=_[_0x91ad('0x47')](_0x581b9[_0x91ad('0x44')],{'$or':_[_0x91ad('0x35')](_0x581b9[_0x91ad('0x3e')],function(_0x2ec493){var _0x2c36b8={};_0x2c36b8[_0x2ec493]={'$like':'%'+_0x4cdcce[_0x91ad('0x3a')]['filter']+'%'};return _0x2c36b8;})});}_0x581b9=_[_0x91ad('0x47')]({},_0x581b9,_0x4cdcce['options']);return db[_0x91ad('0x5f')][_0x91ad('0x61')](_0x581b9);}})['then'](function(_0x17ffe3){if(_0x17ffe3){return db[_0x91ad('0x62')][_0x91ad('0x63')]({'where':{'id':_['map'](_0x17ffe3,_0x91ad('0x64')),'role':_0x91ad('0x65')},'attributes':['id',_0x91ad('0x32'),_0x91ad('0x66'),_0x91ad('0x67'),_0x91ad('0x68')]});}})[_0x91ad('0x2d')](function(_0x2629d7){if(_0x2629d7){return{'count':_0x2629d7[_0x91ad('0x26')],'rows':_[_0x91ad('0x35')](_0x2629d7[_0x91ad('0x69')],function(_0x20f03b){return{'membername':_0x20f03b['name'],'UserId':_0x20f03b['id'],'queue_name':_0x47fc03[_0x91ad('0x32')],'FaxQueueId':_0x47fc03['id'],'interface':util[_0x91ad('0x6a')](_0x91ad('0x6b'),_0x91ad('0x6c'),_0x20f03b[_0x91ad('0x32')]),'penalty':0x0,'paused':_0x20f03b[_0x91ad('0x66')],'createdAt':_0x20f03b['createdAt'],'updatedAt':_0x20f03b[_0x91ad('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x91ad('0x2d')](respondWithFilteredResult(_0x34abe7,_0x581b9))[_0x91ad('0x4b')](handleError(_0x34abe7,null));};exports['getTeams']=function(_0x5e3e38,_0x49513c,_0x18f700){var _0x56320d={};var _0x17a066={};var _0x277ac4;var _0x4a9e27;return db['FaxQueue'][_0x91ad('0x5e')]({'where':{'id':_0x5e3e38[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](handleEntityNotFound(_0x49513c,null))['then'](function(_0x2df1b1){if(_0x2df1b1){_0x277ac4=_0x2df1b1;_0x17a066[_0x91ad('0x39')]=_[_0x91ad('0x3b')](db[_0x91ad('0x6d')][_0x91ad('0x37')]);_0x17a066[_0x91ad('0x3a')]=_[_0x91ad('0x3b')](_0x5e3e38[_0x91ad('0x3a')]);_0x17a066[_0x91ad('0x3c')]=_[_0x91ad('0x3d')](_0x17a066[_0x91ad('0x39')],_0x17a066[_0x91ad('0x3a')]);_0x56320d['attributes']=_['intersection'](_0x17a066[_0x91ad('0x39')],qs[_0x91ad('0x4e')](_0x5e3e38['query'][_0x91ad('0x4e')]));_0x56320d['attributes']=_0x56320d['attributes'][_0x91ad('0x3f')]?_0x56320d[_0x91ad('0x3e')]:_0x17a066[_0x91ad('0x39')];_0x56320d['order']=qs[_0x91ad('0x43')](_0x5e3e38[_0x91ad('0x3a')][_0x91ad('0x43')]);_0x56320d[_0x91ad('0x44')]=qs[_0x91ad('0x3c')](_[_0x91ad('0x45')](_0x5e3e38[_0x91ad('0x3a')],_0x17a066[_0x91ad('0x3c')]));if(_0x5e3e38[_0x91ad('0x3a')][_0x91ad('0x46')]){_0x56320d[_0x91ad('0x44')]=_['merge'](_0x56320d[_0x91ad('0x44')],{'$or':_[_0x91ad('0x35')](_0x56320d['attributes'],function(_0x1c5ecd){var _0x39ac7a={};_0x39ac7a[_0x1c5ecd]={'$like':'%'+_0x5e3e38[_0x91ad('0x3a')][_0x91ad('0x46')]+'%'};return _0x39ac7a;})});}_0x56320d=_[_0x91ad('0x47')]({},_0x56320d,_0x5e3e38[_0x91ad('0x4f')]);return _0x277ac4['getTeams'](_0x56320d);}})[_0x91ad('0x2d')](function(_0x21d9c9){if(_0x21d9c9){_0x4a9e27=_0x21d9c9['length'];if(!_0x5e3e38['query'][_0x91ad('0x40')](_0x91ad('0x41'))){_0x56320d[_0x91ad('0x25')]=qs[_0x91ad('0x25')](_0x5e3e38[_0x91ad('0x3a')]['limit']);_0x56320d[_0x91ad('0x23')]=qs['offset'](_0x5e3e38[_0x91ad('0x3a')]['offset']);}return _0x277ac4[_0x91ad('0x6e')](_0x56320d);}})[_0x91ad('0x2d')](function(_0x354197){if(_0x354197){return _0x354197?{'count':_0x4a9e27,'rows':_0x354197}:null;}})[_0x91ad('0x2d')](respondWithResult(_0x49513c,null))[_0x91ad('0x4b')](handleError(_0x49513c,null));};exports['addTeams']=function(_0x4ea324,_0x3cde1b,_0x4d48f8){var _0x419050=_0x4ea324['body'][_0x91ad('0x6f')];return db[_0x91ad('0x6d')][_0x91ad('0x61')]({'where':{'id':_0x419050},'attributes':['id'],'include':[{'model':db[_0x91ad('0x62')],'as':_0x91ad('0x70'),'attributes':['id',_0x91ad('0x32'),'online','voicePause',_0x91ad('0x71')],'raw':!![]}]})[_0x91ad('0x2d')](function(_0x5c3922){if(_0x5c3922){var _0x518fbf=_[_0x91ad('0x72')](_0x5c3922,function(_0xf5b587){var _0x37c005=_0xf5b587[_0x91ad('0x54')]({'plain':!![]});return _0x37c005[_0x91ad('0x70')];});return db['FaxQueue'][_0x91ad('0x50')]({'where':{'id':_0x4ea324[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](function(_0x5aeb89){return db[_0x91ad('0x73')][_0x91ad('0x74')](function(_0x880714){return _0x5aeb89['addTeams'](_0x419050,{'transaction':_0x880714})['then'](function(){return BPromise[_0x91ad('0x75')](_0x518fbf,function(_0x427dae){return db[_0x91ad('0x5f')][_0x91ad('0x76')]({'where':{'UserId':_0x427dae['id'],'FaxQueueId':_0x4ea324[_0x91ad('0x4d')]['id']},'transaction':_0x880714});});})[_0x91ad('0x2d')](function(){_0x518fbf[_0x91ad('0x77')](function(_0x2adb31){socket[_0x91ad('0x78')](_0x91ad('0x79'),{'UserId':_0x2adb31['id'],'FaxQueueId':_0x5aeb89['id']});});});});});}})[_0x91ad('0x2d')](respondWithStatusCode(_0x3cde1b,null))[_0x91ad('0x4b')](handleError(_0x3cde1b,null));};exports[_0x91ad('0x7a')]=function(_0x147f58,_0x1c78ae,_0x2e57bf){return db[_0x91ad('0x6d')][_0x91ad('0x61')]({'where':{'id':_0x147f58[_0x91ad('0x3a')][_0x91ad('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x91ad('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1c78ae,null))['then'](function(_0x3e4b7f){var _0x468e5c=_[_0x91ad('0x35')](_0x3e4b7f,'id');var _0x25c084=[];var _0x3b2edd=[];var _0x5ab161=squel[_0x91ad('0x7b')]();_0x5ab161[_0x91ad('0x7c')](_0x91ad('0x7d'))['from']('team_has_fax_queues','tq')[_0x91ad('0x7e')](_0x91ad('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x91ad('0x44')](_0x91ad('0x80'),_0x147f58[_0x91ad('0x4d')]['id']);for(var _0xa25118=0x0;_0xa25118<_0x3e4b7f[_0x91ad('0x3f')];_0xa25118+=0x1){let _0x4f65cf=_0x3e4b7f[_0xa25118];for(var _0x33c6ce=0x0;_0x33c6ce<_0x4f65cf[_0x91ad('0x70')][_0x91ad('0x3f')];_0x33c6ce+=0x1){let _0x86576d=_0x4f65cf[_0x91ad('0x70')][_0x33c6ce];var _0x1b0b66=_0x5ab161[_0x91ad('0x81')]();_0x1b0b66[_0x91ad('0x44')]('ut.UserId\x20=\x20?',_0x86576d['id']);_0x3b2edd[_0x91ad('0x82')](db[_0x91ad('0x73')]['query'](_0x1b0b66[_0x91ad('0x83')](),{'type':db[_0x91ad('0x73')][_0x91ad('0x84')][_0x91ad('0x85')]})[_0x91ad('0x2d')](function(_0x4d58d0){if(_0x4d58d0[_0x91ad('0x3f')]===0x1){return _0x86576d['id'];}else{var _0xcf33be=_[_0x91ad('0x86')](_['map'](_0x4d58d0,_0x91ad('0x87')),function(_0x1a79d7){return _['includes'](_0x468e5c,_0x1a79d7);});if(_0xcf33be){return _0x86576d['id'];}}}));}}return BPromise['all'](_0x3b2edd)[_0x91ad('0x2d')](function(_0x36d32e){_0x25c084=_(_0x25c084)[_0x91ad('0x88')](_0x36d32e)[_0x91ad('0x89')]()[_0x91ad('0x8a')]();return db['FaxQueue'][_0x91ad('0x50')]({'where':{'id':_0x147f58[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](function(_0x42478c){return db[_0x91ad('0x73')][_0x91ad('0x74')](function(_0x262855){return _0x42478c[_0x91ad('0x7a')](_0x147f58[_0x91ad('0x3a')][_0x91ad('0x6f')],{'transaction':_0x262855})['then'](function(){if(!_[_0x91ad('0x8b')](_0x25c084)){return _0x42478c[_0x91ad('0x8c')](_0x25c084,{'transaction':_0x262855});}})['then'](function(){_0x25c084['forEach'](function(_0x344b74){socket[_0x91ad('0x78')]('userFaxQueue:remove',{'UserId':_0x344b74,'FaxQueueId':_0x42478c['id']});});});});});});})[_0x91ad('0x2d')](respondWithStatusCode(_0x1c78ae,null))[_0x91ad('0x4b')](handleError(_0x1c78ae,null));};exports[_0x91ad('0x8d')]=function(_0x5a904f,_0x1d666f,_0x3dec17){return db[_0x91ad('0x36')][_0x91ad('0x50')]({'where':{'id':_0x5a904f[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](handleEntityNotFound(_0x1d666f,null))[_0x91ad('0x2d')](function(_0x12c0b2){if(_0x12c0b2){return _0x12c0b2['addAgents'](_0x5a904f['body'][_0x91ad('0x6f')],_['omit'](_0x5a904f[_0x91ad('0x52')],[_0x91ad('0x6f'),'id'])||{})['spread'](function(_0x40737e){for(var _0xecc12b=0x0;_0xecc12b<_0x5a904f[_0x91ad('0x52')][_0x91ad('0x6f')][_0x91ad('0x3f')];_0xecc12b+=0x1){socket[_0x91ad('0x78')]('userFaxQueue:save',{'UserId':Number(_0x5a904f['body'][_0x91ad('0x6f')][_0xecc12b]),'FaxQueueId':Number(_0x5a904f[_0x91ad('0x4d')]['id'])});}return _0x40737e;});}})[_0x91ad('0x2d')](respondWithResult(_0x1d666f,null))[_0x91ad('0x4b')](handleError(_0x1d666f,null));};exports['removeAgents']=function(_0x41ef09,_0x527746,_0x2eab79){return db[_0x91ad('0x36')][_0x91ad('0x50')]({'where':{'id':_0x41ef09[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](handleEntityNotFound(_0x527746,null))[_0x91ad('0x2d')](function(_0x1f4038){if(_0x1f4038){return _0x1f4038[_0x91ad('0x8c')](_0x41ef09[_0x91ad('0x3a')]['ids'])[_0x91ad('0x2d')](function(){if(_[_0x91ad('0x8e')](_0x41ef09['query'][_0x91ad('0x6f')])){for(var _0x2d8789=0x0;_0x2d8789<_0x41ef09[_0x91ad('0x3a')]['ids'][_0x91ad('0x3f')];_0x2d8789+=0x1){socket[_0x91ad('0x78')]('userFaxQueue:remove',{'UserId':Number(_0x41ef09[_0x91ad('0x3a')][_0x91ad('0x6f')][_0x2d8789]),'FaxQueueId':Number(_0x41ef09[_0x91ad('0x4d')]['id'])});}}else{socket[_0x91ad('0x78')](_0x91ad('0x8f'),{'UserId':Number(_0x41ef09[_0x91ad('0x3a')]['ids']),'FaxQueueId':Number(_0x41ef09['params']['id'])});}});}})[_0x91ad('0x2d')](respondWithStatusCode(_0x527746,null))[_0x91ad('0x4b')](handleError(_0x527746,null));};exports[_0x91ad('0x90')]=function(_0x49206d,_0x3b3016,_0x214d48){var _0x3b4215={};var _0x433472={};var _0x4f64d8;var _0x5ee30d;return db[_0x91ad('0x36')]['findOne']({'where':{'id':_0x49206d[_0x91ad('0x4d')]['id']}})[_0x91ad('0x2d')](handleEntityNotFound(_0x3b3016,null))[_0x91ad('0x2d')](function(_0x1a1e54){if(_0x1a1e54){_0x4f64d8=_0x1a1e54;_0x433472[_0x91ad('0x39')]=_[_0x91ad('0x3b')](db[_0x91ad('0x62')][_0x91ad('0x37')]);_0x433472[_0x91ad('0x3a')]=_[_0x91ad('0x3b')](_0x49206d[_0x91ad('0x3a')]);_0x433472[_0x91ad('0x3c')]=_[_0x91ad('0x3d')](_0x433472[_0x91ad('0x39')],_0x433472[_0x91ad('0x3a')]);_0x3b4215[_0x91ad('0x3e')]=_[_0x91ad('0x3d')](_0x433472[_0x91ad('0x39')],qs[_0x91ad('0x4e')](_0x49206d[_0x91ad('0x3a')]['fields']));_0x3b4215[_0x91ad('0x3e')]=_0x3b4215[_0x91ad('0x3e')]['length']?_0x3b4215[_0x91ad('0x3e')]:_0x433472[_0x91ad('0x39')];_0x3b4215[_0x91ad('0x42')]=qs['sort'](_0x49206d[_0x91ad('0x3a')]['sort']);_0x3b4215[_0x91ad('0x44')]=qs[_0x91ad('0x3c')](_[_0x91ad('0x45')](_0x49206d[_0x91ad('0x3a')],_0x433472['filters']));if(_0x49206d[_0x91ad('0x3a')][_0x91ad('0x46')]){_0x3b4215[_0x91ad('0x44')]=_[_0x91ad('0x47')](_0x3b4215[_0x91ad('0x44')],{'$or':_['map'](_0x3b4215[_0x91ad('0x3e')],function(_0x537870){var _0xb1fde={};_0xb1fde[_0x537870]={'$like':'%'+_0x49206d[_0x91ad('0x3a')][_0x91ad('0x46')]+'%'};return _0xb1fde;})});}_0x3b4215=_[_0x91ad('0x47')]({},_0x3b4215,_0x49206d['options']);return _0x4f64d8['getAgents'](_0x3b4215);}})[_0x91ad('0x2d')](function(_0x1f0d68){if(_0x1f0d68){_0x5ee30d=_0x1f0d68[_0x91ad('0x3f')];if(!_0x49206d[_0x91ad('0x3a')][_0x91ad('0x40')](_0x91ad('0x41'))){_0x3b4215[_0x91ad('0x25')]=qs[_0x91ad('0x25')](_0x49206d[_0x91ad('0x3a')][_0x91ad('0x25')]);_0x3b4215[_0x91ad('0x23')]=qs[_0x91ad('0x23')](_0x49206d[_0x91ad('0x3a')][_0x91ad('0x23')]);}return _0x4f64d8['getAgents'](_0x3b4215);}})[_0x91ad('0x2d')](function(_0x487192){if(_0x487192){return _0x487192?{'count':_0x5ee30d,'rows':_0x487192}:null;}})[_0x91ad('0x2d')](respondWithResult(_0x3b3016,null))[_0x91ad('0x4b')](handleError(_0x3b3016,null));}; \ No newline at end of file +var _0x66c7=['create','body','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','length','FaxQueueId','UserFaxQueue','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','getTeams','Team','pick','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','stack','name','send','index','FaxQueue','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find'];(function(_0x15ba65,_0x530bcb){var _0x54e383=function(_0x538bf4){while(--_0x538bf4){_0x15ba65['push'](_0x15ba65['shift']());}};_0x54e383(++_0x530bcb);}(_0x66c7,0x15e));var _0x766c=function(_0x389a6a,_0x26cb60){_0x389a6a=_0x389a6a-0x0;var _0x4ba642=_0x66c7[_0x389a6a];return _0x4ba642;};'use strict';var emlformat=require(_0x766c('0x0'));var rimraf=require(_0x766c('0x1'));var zipdir=require(_0x766c('0x2'));var jsonpatch=require(_0x766c('0x3'));var rp=require(_0x766c('0x4'));var moment=require(_0x766c('0x5'));var BPromise=require(_0x766c('0x6'));var Mustache=require(_0x766c('0x7'));var util=require(_0x766c('0x8'));var path=require(_0x766c('0x9'));var sox=require(_0x766c('0xa'));var csv=require(_0x766c('0xb'));var ejs=require(_0x766c('0xc'));var fs=require('fs');var fs_extra=require(_0x766c('0xd'));var _=require(_0x766c('0xe'));var squel=require(_0x766c('0xf'));var crypto=require(_0x766c('0x10'));var jsforce=require(_0x766c('0x11'));var deskjs=require(_0x766c('0x12'));var toCsv=require(_0x766c('0xb'));var querystring=require(_0x766c('0x13'));var Papa=require(_0x766c('0x14'));var Redis=require(_0x766c('0x15'));var authService=require(_0x766c('0x16'));var qs=require(_0x766c('0x17'));var as=require(_0x766c('0x18'));var hardwareService=require(_0x766c('0x19'));var logger=require('../../config/logger')('api');var utils=require(_0x766c('0x1a'));var config=require(_0x766c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x766c('0x1c'))['db'];config[_0x766c('0x1d')]=_[_0x766c('0x1e')](config['redis'],{'host':_0x766c('0x1f'),'port':0x18eb});var socket=require(_0x766c('0x20'))(new Redis(config[_0x766c('0x1d')]));require(_0x766c('0x21'))['register'](socket);function respondWithStatusCode(_0x40e16f,_0x43b071){_0x43b071=_0x43b071||0xcc;return function(_0x54950e){if(_0x54950e){return _0x40e16f[_0x766c('0x22')](_0x43b071);}return _0x40e16f[_0x766c('0x23')](_0x43b071)[_0x766c('0x24')]();};}function respondWithResult(_0xdba366,_0x344aa4){_0x344aa4=_0x344aa4||0xc8;return function(_0x49a57b){if(_0x49a57b){return _0xdba366[_0x766c('0x23')](_0x344aa4)[_0x766c('0x25')](_0x49a57b);}};}function respondWithFilteredResult(_0x434c0e,_0x296b19){return function(_0x3da47e){if(_0x3da47e){var _0x5b3a9c=typeof _0x296b19[_0x766c('0x26')]===_0x766c('0x27')&&typeof _0x296b19['limit']===_0x766c('0x27');var _0x2271d2=_0x3da47e[_0x766c('0x28')];var _0xb464bb=_0x5b3a9c?0x0:_0x296b19[_0x766c('0x26')];var _0xafcb7a=_0x5b3a9c?_0x3da47e[_0x766c('0x28')]:_0x296b19[_0x766c('0x26')]+_0x296b19[_0x766c('0x29')];var _0x48d24c;if(_0xafcb7a>=_0x2271d2){_0xafcb7a=_0x2271d2;_0x48d24c=0xc8;}else{_0x48d24c=0xce;}_0x434c0e['status'](_0x48d24c);return _0x434c0e[_0x766c('0x2a')](_0x766c('0x2b'),_0xb464bb+'-'+_0xafcb7a+'/'+_0x2271d2)[_0x766c('0x25')](_0x3da47e);}return null;};}function patchUpdates(_0x368cbe){return function(_0x1532ba){try{jsonpatch[_0x766c('0x2c')](_0x1532ba,_0x368cbe,!![]);}catch(_0x24c7a0){return BPromise[_0x766c('0x2d')](_0x24c7a0);}return _0x1532ba[_0x766c('0x2e')]();};}function saveUpdates(_0x3cbcc7,_0x38fd18){return function(_0x32ca5e){if(_0x32ca5e){return _0x32ca5e[_0x766c('0x2f')](_0x3cbcc7)['then'](function(_0xb34afc){return _0xb34afc;});}return null;};}function removeEntity(_0x31736c,_0x2da0ec){return function(_0x23f7b0){if(_0x23f7b0){return _0x23f7b0['destroy']()[_0x766c('0x30')](function(){var _0x350618=_0x23f7b0[_0x766c('0x31')]({'plain':!![]});var _0x466165=_0x766c('0x32');return db[_0x766c('0x33')][_0x766c('0x34')]({'where':{'type':_0x466165,'resourceId':_0x350618['id']}})['then'](function(){return _0x23f7b0;});})[_0x766c('0x30')](function(){_0x31736c[_0x766c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x431c12,_0x22a712){return function(_0x27e3cd){if(!_0x27e3cd){_0x431c12['sendStatus'](0x194);}return _0x27e3cd;};}function handleError(_0x2f917d,_0x17b968){_0x17b968=_0x17b968||0x1f4;return function(_0x3519c8){logger['error'](_0x3519c8[_0x766c('0x35')]);if(_0x3519c8[_0x766c('0x36')]){delete _0x3519c8[_0x766c('0x36')];}_0x2f917d[_0x766c('0x23')](_0x17b968)[_0x766c('0x37')](_0x3519c8);};}exports[_0x766c('0x38')]=function(_0x5d3c68,_0x312999){var _0x30694b={},_0x19f16d={},_0x488dd7={'count':0x0,'rows':[]};var _0x5d5e8f=_['map'](db[_0x766c('0x39')][_0x766c('0x3a')],function(_0x3804ac){return{'name':_0x3804ac['fieldName'],'type':_0x3804ac['type'][_0x766c('0x3b')]};});_0x19f16d['model']=_[_0x766c('0x3c')](_0x5d5e8f,_0x766c('0x36'));_0x19f16d[_0x766c('0x3d')]=_[_0x766c('0x3e')](_0x5d3c68[_0x766c('0x3d')]);_0x19f16d[_0x766c('0x3f')]=_[_0x766c('0x40')](_0x19f16d[_0x766c('0x41')],_0x19f16d['query']);_0x30694b['attributes']=_['intersection'](_0x19f16d[_0x766c('0x41')],qs[_0x766c('0x42')](_0x5d3c68[_0x766c('0x3d')][_0x766c('0x42')]));_0x30694b[_0x766c('0x43')]=_0x30694b['attributes']['length']?_0x30694b[_0x766c('0x43')]:_0x19f16d[_0x766c('0x41')];if(!_0x5d3c68['query'][_0x766c('0x44')](_0x766c('0x45'))){_0x30694b[_0x766c('0x29')]=qs[_0x766c('0x29')](_0x5d3c68[_0x766c('0x3d')]['limit']);_0x30694b[_0x766c('0x26')]=qs[_0x766c('0x26')](_0x5d3c68['query'][_0x766c('0x26')]);}_0x30694b[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x5d3c68[_0x766c('0x3d')]['sort']);_0x30694b['where']=qs['filters'](_['pick'](_0x5d3c68[_0x766c('0x3d')],_0x19f16d['filters']),_0x5d5e8f);if(_0x5d3c68[_0x766c('0x3d')][_0x766c('0x48')]){_0x30694b[_0x766c('0x49')]=_[_0x766c('0x4a')](_0x30694b[_0x766c('0x49')],{'$or':_['map'](_0x5d5e8f,function(_0x10d676){if(_0x10d676[_0x766c('0x4b')]!==_0x766c('0x4c')){var _0x5ab60e={};_0x5ab60e[_0x10d676[_0x766c('0x36')]]={'$like':'%'+_0x5d3c68[_0x766c('0x3d')][_0x766c('0x48')]+'%'};return _0x5ab60e;}})});}_0x30694b=_[_0x766c('0x4a')]({},_0x30694b,_0x5d3c68[_0x766c('0x4d')]);var _0x1d7b11={'where':_0x30694b[_0x766c('0x49')]};return db['FaxQueue'][_0x766c('0x28')](_0x1d7b11)[_0x766c('0x30')](function(_0x141f9c){_0x488dd7['count']=_0x141f9c;if(_0x5d3c68[_0x766c('0x3d')][_0x766c('0x4e')]){_0x30694b['include']=[{'all':!![]}];}return db['FaxQueue'][_0x766c('0x4f')](_0x30694b);})[_0x766c('0x30')](function(_0x762acd){_0x488dd7[_0x766c('0x50')]=_0x762acd;return _0x488dd7;})[_0x766c('0x30')](respondWithFilteredResult(_0x312999,_0x30694b))[_0x766c('0x51')](handleError(_0x312999,null));};exports['show']=function(_0x48e031,_0x1c5e11){var _0x12004c={'raw':!![],'where':{'id':_0x48e031[_0x766c('0x52')]['id']}},_0x71d271={};_0x71d271[_0x766c('0x41')]=_[_0x766c('0x3e')](db['FaxQueue'][_0x766c('0x3a')]);_0x71d271['query']=_['keys'](_0x48e031[_0x766c('0x3d')]);_0x71d271['filters']=_['intersection'](_0x71d271[_0x766c('0x41')],_0x71d271['query']);_0x12004c[_0x766c('0x43')]=_['intersection'](_0x71d271[_0x766c('0x41')],qs[_0x766c('0x42')](_0x48e031[_0x766c('0x3d')][_0x766c('0x42')]));_0x12004c[_0x766c('0x43')]=_0x12004c[_0x766c('0x43')]['length']?_0x12004c[_0x766c('0x43')]:_0x71d271['model'];if(_0x48e031[_0x766c('0x3d')]['includeAll']){_0x12004c[_0x766c('0x53')]=[{'all':!![]}];}_0x12004c=_[_0x766c('0x4a')]({},_0x12004c,_0x48e031[_0x766c('0x4d')]);return db['FaxQueue'][_0x766c('0x54')](_0x12004c)[_0x766c('0x30')](handleEntityNotFound(_0x1c5e11,null))['then'](respondWithResult(_0x1c5e11,null))[_0x766c('0x51')](handleError(_0x1c5e11,null));};exports['create']=function(_0x395c6a,_0x3c711a){return db[_0x766c('0x39')][_0x766c('0x55')](_0x395c6a[_0x766c('0x56')],{})[_0x766c('0x30')](function(_0x124ab6){var _0x191561=_0x395c6a['user'][_0x766c('0x31')]({'plain':!![]});if(!_0x191561)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x191561[_0x766c('0x57')]===_0x766c('0x58')){var _0x355813=_0x124ab6[_0x766c('0x31')]({'plain':!![]});var _0xebfd09=_0x766c('0x32');return db['UserProfileSection'][_0x766c('0x54')]({'where':{'name':_0xebfd09,'userProfileId':_0x191561[_0x766c('0x59')]},'raw':!![]})[_0x766c('0x30')](function(_0x351b09){if(_0x351b09&&_0x351b09[_0x766c('0x5a')]===0x0){return db[_0x766c('0x33')][_0x766c('0x55')]({'name':_0x355813['name'],'resourceId':_0x355813['id'],'type':_0x351b09[_0x766c('0x36')],'sectionId':_0x351b09['id']},{})['then'](function(){return _0x124ab6;});}else{return _0x124ab6;}})[_0x766c('0x51')](function(_0x50c7a6){logger[_0x766c('0x5b')](_0x766c('0x5c'),_0x50c7a6);throw _0x50c7a6;});}return _0x124ab6;})[_0x766c('0x30')](respondWithResult(_0x3c711a,0xc9))[_0x766c('0x51')](handleError(_0x3c711a,null));};exports[_0x766c('0x2f')]=function(_0x3f3cad,_0x489b22){if(_0x3f3cad[_0x766c('0x56')]['id']){delete _0x3f3cad[_0x766c('0x56')]['id'];}return db[_0x766c('0x39')][_0x766c('0x54')]({'where':{'id':_0x3f3cad[_0x766c('0x52')]['id']}})['then'](handleEntityNotFound(_0x489b22,null))['then'](saveUpdates(_0x3f3cad['body'],null))[_0x766c('0x30')](respondWithResult(_0x489b22,null))[_0x766c('0x51')](handleError(_0x489b22,null));};exports['destroy']=function(_0x824317,_0x5bb799){return db[_0x766c('0x39')][_0x766c('0x54')]({'where':{'id':_0x824317[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0x5bb799,null))[_0x766c('0x30')](removeEntity(_0x5bb799,null))[_0x766c('0x51')](handleError(_0x5bb799,null));};exports[_0x766c('0x5d')]=function(_0x35382e,_0x120730){return db[_0x766c('0x39')][_0x766c('0x5d')]()['then'](respondWithResult(_0x120730,null))[_0x766c('0x51')](handleError(_0x120730,null));};exports[_0x766c('0x5e')]=function(_0x389533,_0xb76bf5,_0x3a86b9){var _0x5c6f6f={'raw':!![],'where':{}},_0x3c0e65={},_0x67bef2;return db['FaxQueue'][_0x766c('0x5f')]({'where':{'id':_0x389533[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0xb76bf5,null))[_0x766c('0x30')](function(_0x3db40d){if(_0x3db40d){_0x67bef2=_0x3db40d['get']({'plain':!![]});_0x3c0e65[_0x766c('0x41')]=_[_0x766c('0x3e')](db['UserFaxQueue']['rawAttributes']);_0x3c0e65[_0x766c('0x3d')]=_[_0x766c('0x3e')](_0x389533[_0x766c('0x3d')]);_0x3c0e65[_0x766c('0x3f')]=_[_0x766c('0x40')](_0x3c0e65[_0x766c('0x41')],_0x3c0e65['query']);_0x5c6f6f[_0x766c('0x43')]=_['intersection'](_0x3c0e65[_0x766c('0x41')],qs[_0x766c('0x42')](_0x389533[_0x766c('0x3d')][_0x766c('0x42')]));_0x5c6f6f[_0x766c('0x43')]=_0x5c6f6f[_0x766c('0x43')][_0x766c('0x60')]?_0x5c6f6f['attributes']:_0x3c0e65[_0x766c('0x41')];if(!_0x389533[_0x766c('0x3d')][_0x766c('0x44')](_0x766c('0x45'))){_0x5c6f6f[_0x766c('0x29')]=qs[_0x766c('0x29')](_0x389533[_0x766c('0x3d')][_0x766c('0x29')]);_0x5c6f6f['offset']=qs[_0x766c('0x26')](_0x389533[_0x766c('0x3d')]['offset']);}_0x5c6f6f[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x389533[_0x766c('0x3d')][_0x766c('0x47')]);_0x5c6f6f[_0x766c('0x49')]=qs[_0x766c('0x3f')](_['pick'](_0x389533[_0x766c('0x3d')],_0x3c0e65[_0x766c('0x3f')]));_0x5c6f6f['where'][_0x766c('0x61')]=_0x3db40d['id'];if(_0x389533[_0x766c('0x3d')][_0x766c('0x48')]){_0x5c6f6f[_0x766c('0x49')]=_[_0x766c('0x4a')](_0x5c6f6f['where'],{'$or':_['map'](_0x5c6f6f[_0x766c('0x43')],function(_0x17f8d6){var _0x2a2ac7={};_0x2a2ac7[_0x17f8d6]={'$like':'%'+_0x389533[_0x766c('0x3d')][_0x766c('0x48')]+'%'};return _0x2a2ac7;})});}_0x5c6f6f=_['merge']({},_0x5c6f6f,_0x389533[_0x766c('0x4d')]);return db[_0x766c('0x62')][_0x766c('0x4f')](_0x5c6f6f);}})['then'](function(_0x576418){if(_0x576418){return db['User'][_0x766c('0x63')]({'where':{'id':_['map'](_0x576418,'UserId'),'role':_0x766c('0x64')},'attributes':['id',_0x766c('0x36'),_0x766c('0x65'),_0x766c('0x66'),_0x766c('0x67')]});}})[_0x766c('0x30')](function(_0x28ed3a){if(_0x28ed3a){return{'count':_0x28ed3a[_0x766c('0x28')],'rows':_[_0x766c('0x3c')](_0x28ed3a[_0x766c('0x50')],function(_0x49a5d0){return{'membername':_0x49a5d0[_0x766c('0x36')],'UserId':_0x49a5d0['id'],'queue_name':_0x67bef2[_0x766c('0x36')],'FaxQueueId':_0x67bef2['id'],'interface':util[_0x766c('0x68')]('%s/%s','SIP',_0x49a5d0[_0x766c('0x36')]),'penalty':0x0,'paused':_0x49a5d0['faxPause'],'createdAt':_0x49a5d0['createdAt'],'updatedAt':_0x49a5d0[_0x766c('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x766c('0x30')](respondWithFilteredResult(_0xb76bf5,_0x5c6f6f))[_0x766c('0x51')](handleError(_0xb76bf5,null));};exports[_0x766c('0x69')]=function(_0x1b664c,_0x1b9264,_0x19132a){var _0x507f1a={};var _0x104e81={};var _0x275be2;var _0x514fed;return db[_0x766c('0x39')][_0x766c('0x5f')]({'where':{'id':_0x1b664c[_0x766c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b9264,null))[_0x766c('0x30')](function(_0x49a7b4){if(_0x49a7b4){_0x275be2=_0x49a7b4;_0x104e81['model']=_[_0x766c('0x3e')](db[_0x766c('0x6a')][_0x766c('0x3a')]);_0x104e81[_0x766c('0x3d')]=_[_0x766c('0x3e')](_0x1b664c['query']);_0x104e81[_0x766c('0x3f')]=_[_0x766c('0x40')](_0x104e81[_0x766c('0x41')],_0x104e81['query']);_0x507f1a[_0x766c('0x43')]=_[_0x766c('0x40')](_0x104e81[_0x766c('0x41')],qs[_0x766c('0x42')](_0x1b664c[_0x766c('0x3d')][_0x766c('0x42')]));_0x507f1a[_0x766c('0x43')]=_0x507f1a['attributes']['length']?_0x507f1a[_0x766c('0x43')]:_0x104e81[_0x766c('0x41')];_0x507f1a[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x1b664c['query']['sort']);_0x507f1a[_0x766c('0x49')]=qs['filters'](_[_0x766c('0x6b')](_0x1b664c[_0x766c('0x3d')],_0x104e81[_0x766c('0x3f')]));if(_0x1b664c[_0x766c('0x3d')][_0x766c('0x48')]){_0x507f1a[_0x766c('0x49')]=_['merge'](_0x507f1a[_0x766c('0x49')],{'$or':_[_0x766c('0x3c')](_0x507f1a[_0x766c('0x43')],function(_0x2be17e){var _0x5c3f2f={};_0x5c3f2f[_0x2be17e]={'$like':'%'+_0x1b664c['query']['filter']+'%'};return _0x5c3f2f;})});}_0x507f1a=_[_0x766c('0x4a')]({},_0x507f1a,_0x1b664c[_0x766c('0x4d')]);return _0x275be2[_0x766c('0x69')](_0x507f1a);}})[_0x766c('0x30')](function(_0x1ddd75){if(_0x1ddd75){_0x514fed=_0x1ddd75[_0x766c('0x60')];if(!_0x1b664c['query'][_0x766c('0x44')](_0x766c('0x45'))){_0x507f1a[_0x766c('0x29')]=qs[_0x766c('0x29')](_0x1b664c[_0x766c('0x3d')]['limit']);_0x507f1a[_0x766c('0x26')]=qs[_0x766c('0x26')](_0x1b664c[_0x766c('0x3d')]['offset']);}return _0x275be2[_0x766c('0x69')](_0x507f1a);}})[_0x766c('0x30')](function(_0xab2c1c){if(_0xab2c1c){return _0xab2c1c?{'count':_0x514fed,'rows':_0xab2c1c}:null;}})[_0x766c('0x30')](respondWithResult(_0x1b9264,null))[_0x766c('0x51')](handleError(_0x1b9264,null));};exports['addTeams']=function(_0x544b16,_0x4e3b07,_0xad1d0e){var _0x4521e5=_0x544b16[_0x766c('0x56')][_0x766c('0x6c')];return db['Team'][_0x766c('0x4f')]({'where':{'id':_0x4521e5},'attributes':['id'],'include':[{'model':db[_0x766c('0x6d')],'as':_0x766c('0x6e'),'attributes':['id',_0x766c('0x36'),_0x766c('0x6f'),_0x766c('0x70'),_0x766c('0x71')],'raw':!![]}]})[_0x766c('0x30')](function(_0x56262f){if(_0x56262f){var _0x2df477=_[_0x766c('0x72')](_0x56262f,function(_0x49483f){var _0x2d52fe=_0x49483f[_0x766c('0x31')]({'plain':!![]});return _0x2d52fe[_0x766c('0x6e')];});return db[_0x766c('0x39')]['find']({'where':{'id':_0x544b16['params']['id']}})[_0x766c('0x30')](function(_0x4960ff){return db[_0x766c('0x73')][_0x766c('0x74')](function(_0xe85781){return _0x4960ff[_0x766c('0x75')](_0x4521e5,{'transaction':_0xe85781})['then'](function(){return BPromise['each'](_0x2df477,function(_0xfbb4e2){return db[_0x766c('0x62')][_0x766c('0x76')]({'where':{'UserId':_0xfbb4e2['id'],'FaxQueueId':_0x544b16[_0x766c('0x52')]['id']},'transaction':_0xe85781});});})[_0x766c('0x30')](function(){_0x2df477[_0x766c('0x77')](function(_0x29fd0c){socket[_0x766c('0x78')](_0x766c('0x79'),{'UserId':_0x29fd0c['id'],'FaxQueueId':_0x4960ff['id']});});});});});}})['then'](respondWithStatusCode(_0x4e3b07,null))[_0x766c('0x51')](handleError(_0x4e3b07,null));};exports[_0x766c('0x7a')]=function(_0x3e5922,_0x3b2e36,_0xdbfabd){return db[_0x766c('0x6a')]['findAll']({'where':{'id':_0x3e5922[_0x766c('0x3d')][_0x766c('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x766c('0x6d')],'as':_0x766c('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3b2e36,null))[_0x766c('0x30')](function(_0x188b18){var _0x443691=_[_0x766c('0x3c')](_0x188b18,'id');var _0x527e63=[];var _0x40a86c=[];var _0x540d0=squel[_0x766c('0x7b')]();_0x540d0[_0x766c('0x7c')](_0x766c('0x7d'))['from']('team_has_fax_queues','tq')['join'](_0x766c('0x7e'),'ut',_0x766c('0x7f'))[_0x766c('0x49')](_0x766c('0x80'),_0x3e5922[_0x766c('0x52')]['id']);for(var _0x5884f5=0x0;_0x5884f5<_0x188b18['length'];_0x5884f5+=0x1){let _0x2178c8=_0x188b18[_0x5884f5];for(var _0x23c93a=0x0;_0x23c93a<_0x2178c8[_0x766c('0x6e')][_0x766c('0x60')];_0x23c93a+=0x1){let _0x4480dc=_0x2178c8[_0x766c('0x6e')][_0x23c93a];var _0x4fcb7b=_0x540d0[_0x766c('0x81')]();_0x4fcb7b[_0x766c('0x49')](_0x766c('0x82'),_0x4480dc['id']);_0x40a86c[_0x766c('0x83')](db[_0x766c('0x73')]['query'](_0x4fcb7b['toString'](),{'type':db[_0x766c('0x73')][_0x766c('0x84')][_0x766c('0x85')]})[_0x766c('0x30')](function(_0x360a9c){if(_0x360a9c[_0x766c('0x60')]===0x1){return _0x4480dc['id'];}else{var _0x3ea801=_[_0x766c('0x86')](_[_0x766c('0x3c')](_0x360a9c,'TeamId'),function(_0x1edbe5){return _[_0x766c('0x87')](_0x443691,_0x1edbe5);});if(_0x3ea801){return _0x4480dc['id'];}}}));}}return BPromise['all'](_0x40a86c)['then'](function(_0x459cfc){_0x527e63=_(_0x527e63)['union'](_0x459cfc)[_0x766c('0x88')]()[_0x766c('0x89')]();return db[_0x766c('0x39')]['find']({'where':{'id':_0x3e5922[_0x766c('0x52')]['id']}})['then'](function(_0x3d03e3){return db[_0x766c('0x73')]['transaction'](function(_0x4a1d77){return _0x3d03e3[_0x766c('0x7a')](_0x3e5922[_0x766c('0x3d')][_0x766c('0x6c')],{'transaction':_0x4a1d77})['then'](function(){if(!_[_0x766c('0x8a')](_0x527e63)){return _0x3d03e3[_0x766c('0x8b')](_0x527e63,{'transaction':_0x4a1d77});}})[_0x766c('0x30')](function(){_0x527e63['forEach'](function(_0x15082b){socket[_0x766c('0x78')]('userFaxQueue:remove',{'UserId':_0x15082b,'FaxQueueId':_0x3d03e3['id']});});});});});});})[_0x766c('0x30')](respondWithStatusCode(_0x3b2e36,null))[_0x766c('0x51')](handleError(_0x3b2e36,null));};exports[_0x766c('0x8c')]=function(_0x4f56fe,_0x20f96f,_0x57a1f0){return db[_0x766c('0x39')]['find']({'where':{'id':_0x4f56fe[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0x20f96f,null))[_0x766c('0x30')](function(_0x127a0a){if(_0x127a0a){return _0x127a0a[_0x766c('0x8c')](_0x4f56fe['body'][_0x766c('0x6c')],_['omit'](_0x4f56fe['body'],[_0x766c('0x6c'),'id'])||{})[_0x766c('0x8d')](function(_0x37e030){for(var _0x458900=0x0;_0x458900<_0x4f56fe[_0x766c('0x56')]['ids'][_0x766c('0x60')];_0x458900+=0x1){socket['emit'](_0x766c('0x79'),{'UserId':Number(_0x4f56fe[_0x766c('0x56')][_0x766c('0x6c')][_0x458900]),'FaxQueueId':Number(_0x4f56fe['params']['id'])});}return _0x37e030;});}})[_0x766c('0x30')](respondWithResult(_0x20f96f,null))['catch'](handleError(_0x20f96f,null));};exports['removeAgents']=function(_0xbac95,_0x50ec3e,_0x51b6dd){return db['FaxQueue'][_0x766c('0x54')]({'where':{'id':_0xbac95['params']['id']}})['then'](handleEntityNotFound(_0x50ec3e,null))[_0x766c('0x30')](function(_0x1d3c12){if(_0x1d3c12){return _0x1d3c12['removeAgents'](_0xbac95['query'][_0x766c('0x6c')])[_0x766c('0x30')](function(){if(_[_0x766c('0x8e')](_0xbac95[_0x766c('0x3d')]['ids'])){for(var _0x1c01b8=0x0;_0x1c01b8<_0xbac95[_0x766c('0x3d')]['ids'][_0x766c('0x60')];_0x1c01b8+=0x1){socket[_0x766c('0x78')](_0x766c('0x8f'),{'UserId':Number(_0xbac95[_0x766c('0x3d')][_0x766c('0x6c')][_0x1c01b8]),'FaxQueueId':Number(_0xbac95[_0x766c('0x52')]['id'])});}}else{socket[_0x766c('0x78')]('userFaxQueue:remove',{'UserId':Number(_0xbac95[_0x766c('0x3d')][_0x766c('0x6c')]),'FaxQueueId':Number(_0xbac95['params']['id'])});}});}})[_0x766c('0x30')](respondWithStatusCode(_0x50ec3e,null))['catch'](handleError(_0x50ec3e,null));};exports[_0x766c('0x90')]=function(_0x2eaf79,_0x4fada5,_0x208824){var _0x40277e={};var _0xb15814={};var _0x2d3e98;var _0x2d7d74;return db['FaxQueue'][_0x766c('0x5f')]({'where':{'id':_0x2eaf79[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0x4fada5,null))[_0x766c('0x30')](function(_0x5d82ac){if(_0x5d82ac){_0x2d3e98=_0x5d82ac;_0xb15814['model']=_[_0x766c('0x3e')](db[_0x766c('0x6d')][_0x766c('0x3a')]);_0xb15814['query']=_[_0x766c('0x3e')](_0x2eaf79[_0x766c('0x3d')]);_0xb15814['filters']=_[_0x766c('0x40')](_0xb15814[_0x766c('0x41')],_0xb15814[_0x766c('0x3d')]);_0x40277e['attributes']=_[_0x766c('0x40')](_0xb15814[_0x766c('0x41')],qs[_0x766c('0x42')](_0x2eaf79[_0x766c('0x3d')][_0x766c('0x42')]));_0x40277e['attributes']=_0x40277e[_0x766c('0x43')][_0x766c('0x60')]?_0x40277e[_0x766c('0x43')]:_0xb15814[_0x766c('0x41')];_0x40277e[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x2eaf79[_0x766c('0x3d')]['sort']);_0x40277e['where']=qs[_0x766c('0x3f')](_[_0x766c('0x6b')](_0x2eaf79['query'],_0xb15814[_0x766c('0x3f')]));if(_0x2eaf79[_0x766c('0x3d')][_0x766c('0x48')]){_0x40277e[_0x766c('0x49')]=_[_0x766c('0x4a')](_0x40277e['where'],{'$or':_[_0x766c('0x3c')](_0x40277e[_0x766c('0x43')],function(_0x1ecc53){var _0x4eabba={};_0x4eabba[_0x1ecc53]={'$like':'%'+_0x2eaf79[_0x766c('0x3d')]['filter']+'%'};return _0x4eabba;})});}_0x40277e=_['merge']({},_0x40277e,_0x2eaf79['options']);return _0x2d3e98['getAgents'](_0x40277e);}})[_0x766c('0x30')](function(_0x360db0){if(_0x360db0){_0x2d7d74=_0x360db0[_0x766c('0x60')];if(!_0x2eaf79[_0x766c('0x3d')][_0x766c('0x44')]('nolimit')){_0x40277e[_0x766c('0x29')]=qs['limit'](_0x2eaf79[_0x766c('0x3d')][_0x766c('0x29')]);_0x40277e['offset']=qs[_0x766c('0x26')](_0x2eaf79[_0x766c('0x3d')][_0x766c('0x26')]);}return _0x2d3e98[_0x766c('0x90')](_0x40277e);}})[_0x766c('0x30')](function(_0x50181f){if(_0x50181f){return _0x50181f?{'count':_0x2d7d74,'rows':_0x50181f}:null;}})['then'](respondWithResult(_0x4fada5,null))[_0x766c('0x51')](handleError(_0x4fada5,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 692399a..5bf1c49 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63bb=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','save','update'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x63bb,0x1ab));var _0xb63b=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x63bb[_0x44bcb0];return _0xfaf881;};'use strict';var EventEmitter=require(_0xb63b('0x0'));var FaxQueue=require(_0xb63b('0x1'))['db'][_0xb63b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb63b('0x3'),'afterUpdate':_0xb63b('0x4'),'afterDestroy':_0xb63b('0x5')};function emitEvent(_0x4cf560){return function(_0x3b92be,_0x246b86,_0x32b28c){FaxQueueEvents[_0xb63b('0x6')](_0x4cf560+':'+_0x3b92be['id'],_0x3b92be);FaxQueueEvents[_0xb63b('0x6')](_0x4cf560,_0x3b92be);_0x32b28c(null);};}for(var e in events){if(events[_0xb63b('0x7')](e)){var event=events[e];FaxQueue[_0xb63b('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x6fb1=['hook','events','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2d29c6,_0x479187){var _0x1363e7=function(_0x440d7a){while(--_0x440d7a){_0x2d29c6['push'](_0x2d29c6['shift']());}};_0x1363e7(++_0x479187);}(_0x6fb1,0xb1));var _0x16fb=function(_0x175bdc,_0x18d6c7){_0x175bdc=_0x175bdc-0x0;var _0x2d6f88=_0x6fb1[_0x175bdc];return _0x2d6f88;};'use strict';var EventEmitter=require(_0x16fb('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x16fb('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x16fb('0x2')](0x0);var events={'afterCreate':_0x16fb('0x3'),'afterUpdate':_0x16fb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7c6381){return function(_0x1b7cc9,_0x39e272,_0x25bce8){FaxQueueEvents[_0x16fb('0x5')](_0x7c6381+':'+_0x1b7cc9['id'],_0x1b7cc9);FaxQueueEvents[_0x16fb('0x5')](_0x7c6381,_0x1b7cc9);_0x25bce8(null);};}for(var e in events){if(events[_0x16fb('0x6')](e)){var event=events[e];FaxQueue[_0x16fb('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 729c817..6361403 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44fb=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x44fb,0xad));var _0xb44f=function(_0x3dae09,_0x1cc0be){_0x3dae09=_0x3dae09-0x0;var _0x586f75=_0x44fb[_0x3dae09];return _0x586f75;};'use strict';var _=require(_0xb44f('0x0'));var util=require(_0xb44f('0x1'));var logger=require(_0xb44f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb44f('0x3'));var rp=require(_0xb44f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb44f('0x5'));var config=require(_0xb44f('0x6'));var attributes=require(_0xb44f('0x7'));module[_0xb44f('0x8')]=function(_0x2fdd65,_0x54a577){return _0x2fdd65[_0xb44f('0x9')](_0xb44f('0xa'),attributes,{'tableName':_0xb44f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43e3=['fax_queues','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x43e3,0x182));var _0x343e=function(_0x5d99ad,_0x15d2b5){_0x5d99ad=_0x5d99ad-0x0;var _0x453124=_0x43e3[_0x5d99ad];return _0x453124;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x343e('0x0'))(_0x343e('0x1'));var moment=require(_0x343e('0x2'));var BPromise=require('bluebird');var rp=require(_0x343e('0x3'));var fs=require('fs');var path=require(_0x343e('0x4'));var rimraf=require(_0x343e('0x5'));var config=require(_0x343e('0x6'));var attributes=require(_0x343e('0x7'));module['exports']=function(_0x12f34c,_0x5d5c45){return _0x12f34c[_0x343e('0x8')](_0x343e('0x9'),attributes,{'tableName':_0x343e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index c554ccb..6c9229b 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9a2=['stringify','ShowFaxQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','options','raw','where','attributes','limit','include','map','model','then','GetFaxQueue'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0xa9a2,0x77));var _0x2a9a=function(_0x288e34,_0x102f3a){_0x288e34=_0x288e34-0x0;var _0xa96660=_0xa9a2[_0x288e34];return _0xa96660;};'use strict';var _=require('lodash');var util=require(_0x2a9a('0x0'));var moment=require('moment');var BPromise=require(_0x2a9a('0x1'));var rs=require(_0x2a9a('0x2'));var fs=require('fs');var Redis=require(_0x2a9a('0x3'));var db=require(_0x2a9a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a9a('0x5'))(_0x2a9a('0x6'));var config=require(_0x2a9a('0x7'));var jayson=require(_0x2a9a('0x8'));var client=jayson[_0x2a9a('0x9')]['http']({'port':0x232a});config[_0x2a9a('0xa')]=_[_0x2a9a('0xb')](config[_0x2a9a('0xa')],{'host':_0x2a9a('0xc'),'port':0x18eb});var socket=require(_0x2a9a('0xd'))(new Redis(config[_0x2a9a('0xa')]));require(_0x2a9a('0xe'))[_0x2a9a('0xf')](socket);function respondWithRpcPromise(_0x298696,_0x5f16c2,_0x4b1696){return new BPromise(function(_0xd84ad0,_0x3cecc4){return client['request'](_0x298696,_0x4b1696)['then'](function(_0x35a9a3){logger[_0x2a9a('0x10')]('FaxQueue,\x20%s,\x20%s',_0x5f16c2,_0x2a9a('0x11'));logger[_0x2a9a('0x12')](_0x2a9a('0x13'),_0x5f16c2,_0x2a9a('0x11'),JSON['stringify'](_0x35a9a3));if(_0x35a9a3[_0x2a9a('0x14')]){if(_0x35a9a3[_0x2a9a('0x14')][_0x2a9a('0x15')]===0x1f4){logger[_0x2a9a('0x14')](_0x2a9a('0x16'),_0x5f16c2,_0x35a9a3[_0x2a9a('0x14')][_0x2a9a('0x17')]);return _0x3cecc4(_0x35a9a3['error'][_0x2a9a('0x17')]);}logger[_0x2a9a('0x14')](_0x2a9a('0x16'),_0x5f16c2,_0x35a9a3[_0x2a9a('0x14')]['message']);return _0xd84ad0(_0x35a9a3[_0x2a9a('0x14')]['message']);}else{logger[_0x2a9a('0x10')](_0x2a9a('0x16'),_0x5f16c2,_0x2a9a('0x11'));_0xd84ad0(_0x35a9a3[_0x2a9a('0x18')]['message']);}})[_0x2a9a('0x19')](function(_0x18cb63){logger[_0x2a9a('0x14')](_0x2a9a('0x16'),_0x5f16c2,_0x18cb63);_0x3cecc4(_0x18cb63);});});}exports['GetFaxQueue']=function(_0x31d86a){var _0x46b375=this;return new Promise(function(_0x592146,_0xbcb5ec){return db[_0x2a9a('0x1a')]['findAll']({'raw':_0x31d86a[_0x2a9a('0x1b')]?_0x31d86a['options'][_0x2a9a('0x1c')]===undefined?!![]:![]:!![],'where':_0x31d86a[_0x2a9a('0x1b')]?_0x31d86a['options'][_0x2a9a('0x1d')]||null:null,'attributes':_0x31d86a[_0x2a9a('0x1b')]?_0x31d86a[_0x2a9a('0x1b')][_0x2a9a('0x1e')]||null:null,'limit':_0x31d86a[_0x2a9a('0x1b')]?_0x31d86a[_0x2a9a('0x1b')][_0x2a9a('0x1f')]||null:null,'include':_0x31d86a[_0x2a9a('0x1b')]?_0x31d86a[_0x2a9a('0x1b')][_0x2a9a('0x20')]?_[_0x2a9a('0x21')](_0x31d86a[_0x2a9a('0x1b')]['include'],function(_0x1d1e82){return{'model':db[_0x1d1e82[_0x2a9a('0x22')]],'as':_0x1d1e82['as'],'attributes':_0x1d1e82[_0x2a9a('0x1e')],'include':_0x1d1e82['include']?_['map'](_0x1d1e82[_0x2a9a('0x20')],function(_0x686d77){return{'model':db[_0x686d77[_0x2a9a('0x22')]],'as':_0x686d77['as'],'attributes':_0x686d77['attributes'],'include':_0x686d77[_0x2a9a('0x20')]?_[_0x2a9a('0x21')](_0x686d77[_0x2a9a('0x20')],function(_0x1c00a9){return{'model':db[_0x1c00a9['model']],'as':_0x1c00a9['as'],'attributes':_0x1c00a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a9a('0x23')](function(_0x2d72d5){logger[_0x2a9a('0x10')](_0x2a9a('0x24'),_0x31d86a);logger['debug'](_0x2a9a('0x24'),_0x31d86a,JSON[_0x2a9a('0x25')](_0x2d72d5));_0x592146(_0x2d72d5);})['catch'](function(_0x36de87){logger['error'](_0x2a9a('0x24'),_0x36de87['message'],_0x31d86a);_0xbcb5ec(_0x46b375['error'](0x1f4,_0x36de87[_0x2a9a('0x17')]));});});};exports['ShowFaxQueue']=function(_0x5cb8d3){var _0x444e80=this;return new Promise(function(_0x54f56c,_0x40f1da){return db[_0x2a9a('0x1a')]['find']({'raw':_0x5cb8d3[_0x2a9a('0x1b')]?_0x5cb8d3[_0x2a9a('0x1b')][_0x2a9a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cb8d3['options']?_0x5cb8d3['options'][_0x2a9a('0x1d')]||null:null,'attributes':_0x5cb8d3['options']?_0x5cb8d3[_0x2a9a('0x1b')]['attributes']||null:null,'include':_0x5cb8d3[_0x2a9a('0x1b')]?_0x5cb8d3[_0x2a9a('0x1b')][_0x2a9a('0x20')]?_[_0x2a9a('0x21')](_0x5cb8d3[_0x2a9a('0x1b')][_0x2a9a('0x20')],function(_0x489fad){return{'model':db[_0x489fad[_0x2a9a('0x22')]],'as':_0x489fad['as'],'attributes':_0x489fad[_0x2a9a('0x1e')],'include':_0x489fad[_0x2a9a('0x20')]?_[_0x2a9a('0x21')](_0x489fad['include'],function(_0x2afe5e){return{'model':db[_0x2afe5e['model']],'as':_0x2afe5e['as'],'attributes':_0x2afe5e[_0x2a9a('0x1e')],'include':_0x2afe5e[_0x2a9a('0x20')]?_[_0x2a9a('0x21')](_0x2afe5e[_0x2a9a('0x20')],function(_0x5a8a9a){return{'model':db[_0x5a8a9a['model']],'as':_0x5a8a9a['as'],'attributes':_0x5a8a9a[_0x2a9a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a9a('0x23')](function(_0x23f711){logger[_0x2a9a('0x10')]('ShowFaxQueue',_0x5cb8d3);logger[_0x2a9a('0x12')](_0x2a9a('0x26'),_0x5cb8d3,JSON[_0x2a9a('0x25')](_0x23f711));_0x54f56c(_0x23f711);})[_0x2a9a('0x19')](function(_0x1a6c1f){logger[_0x2a9a('0x14')](_0x2a9a('0x26'),_0x1a6c1f[_0x2a9a('0x17')],_0x5cb8d3);_0x40f1da(_0x444e80[_0x2a9a('0x14')](0x1f4,_0x1a6c1f[_0x2a9a('0x17')]));});});}; \ No newline at end of file +var _0xa091=['then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxQueue','findAll','raw','options','attributes','limit','include','map','GetFaxQueue','debug','catch','ShowFaxQueue','find','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','request'];(function(_0x218912,_0x313c41){var _0x5c2ce3=function(_0x369ed9){while(--_0x369ed9){_0x218912['push'](_0x218912['shift']());}};_0x5c2ce3(++_0x313c41);}(_0xa091,0xae));var _0x1a09=function(_0x54f605,_0x2fdb29){_0x54f605=_0x54f605-0x0;var _0x43a9ac=_0xa091[_0x54f605];return _0x43a9ac;};'use strict';var _=require('lodash');var util=require(_0x1a09('0x0'));var moment=require(_0x1a09('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a09('0x2'));var fs=require('fs');var Redis=require(_0x1a09('0x3'));var db=require(_0x1a09('0x4'))['db'];var utils=require(_0x1a09('0x5'));var logger=require(_0x1a09('0x6'))('rpc');var config=require(_0x1a09('0x7'));var jayson=require(_0x1a09('0x8'));var client=jayson[_0x1a09('0x9')][_0x1a09('0xa')]({'port':0x232a});config[_0x1a09('0xb')]=_['defaults'](config[_0x1a09('0xb')],{'host':_0x1a09('0xc'),'port':0x18eb});var socket=require(_0x1a09('0xd'))(new Redis(config[_0x1a09('0xb')]));require(_0x1a09('0xe'))['register'](socket);function respondWithRpcPromise(_0x540766,_0x2ed413,_0x4b52be){return new BPromise(function(_0x4f6695,_0x479d31){return client[_0x1a09('0xf')](_0x540766,_0x4b52be)[_0x1a09('0x10')](function(_0x4df99b){logger[_0x1a09('0x11')](_0x1a09('0x12'),_0x2ed413,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2ed413,_0x1a09('0x13'),JSON[_0x1a09('0x14')](_0x4df99b));if(_0x4df99b[_0x1a09('0x15')]){if(_0x4df99b['error'][_0x1a09('0x16')]===0x1f4){logger[_0x1a09('0x15')]('FaxQueue,\x20%s,\x20%s',_0x2ed413,_0x4df99b[_0x1a09('0x15')]['message']);return _0x479d31(_0x4df99b['error']['message']);}logger[_0x1a09('0x15')]('FaxQueue,\x20%s,\x20%s',_0x2ed413,_0x4df99b['error'][_0x1a09('0x17')]);return _0x4f6695(_0x4df99b['error'][_0x1a09('0x17')]);}else{logger[_0x1a09('0x11')](_0x1a09('0x12'),_0x2ed413,_0x1a09('0x13'));_0x4f6695(_0x4df99b['result'][_0x1a09('0x17')]);}})['catch'](function(_0xe5a5ff){logger[_0x1a09('0x15')](_0x1a09('0x12'),_0x2ed413,_0xe5a5ff);_0x479d31(_0xe5a5ff);});});}exports['GetFaxQueue']=function(_0x1abbd5){var _0x373007=this;return new Promise(function(_0x57e2a6,_0x4a36d6){return db[_0x1a09('0x18')][_0x1a09('0x19')]({'raw':_0x1abbd5['options']?_0x1abbd5['options'][_0x1a09('0x1a')]===undefined?!![]:![]:!![],'where':_0x1abbd5[_0x1a09('0x1b')]?_0x1abbd5[_0x1a09('0x1b')]['where']||null:null,'attributes':_0x1abbd5[_0x1a09('0x1b')]?_0x1abbd5[_0x1a09('0x1b')][_0x1a09('0x1c')]||null:null,'limit':_0x1abbd5[_0x1a09('0x1b')]?_0x1abbd5[_0x1a09('0x1b')][_0x1a09('0x1d')]||null:null,'include':_0x1abbd5['options']?_0x1abbd5[_0x1a09('0x1b')][_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0x1abbd5['options']['include'],function(_0xbed326){return{'model':db[_0xbed326['model']],'as':_0xbed326['as'],'attributes':_0xbed326[_0x1a09('0x1c')],'include':_0xbed326[_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0xbed326[_0x1a09('0x1e')],function(_0x44f6ed){return{'model':db[_0x44f6ed['model']],'as':_0x44f6ed['as'],'attributes':_0x44f6ed[_0x1a09('0x1c')],'include':_0x44f6ed[_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0x44f6ed[_0x1a09('0x1e')],function(_0x45c791){return{'model':db[_0x45c791['model']],'as':_0x45c791['as'],'attributes':_0x45c791['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a09('0x10')](function(_0x11d29d){logger[_0x1a09('0x11')](_0x1a09('0x20'),_0x1abbd5);logger[_0x1a09('0x21')](_0x1a09('0x20'),_0x1abbd5,JSON[_0x1a09('0x14')](_0x11d29d));_0x57e2a6(_0x11d29d);})[_0x1a09('0x22')](function(_0x36f51a){logger[_0x1a09('0x15')](_0x1a09('0x20'),_0x36f51a[_0x1a09('0x17')],_0x1abbd5);_0x4a36d6(_0x373007['error'](0x1f4,_0x36f51a[_0x1a09('0x17')]));});});};exports[_0x1a09('0x23')]=function(_0x127e7a){var _0x338935=this;return new Promise(function(_0x480e45,_0x59e5d3){return db['FaxQueue'][_0x1a09('0x24')]({'raw':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a['options']['raw']===undefined?!![]:![]:!![],'where':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a[_0x1a09('0x1b')]['where']||null:null,'attributes':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a[_0x1a09('0x1b')][_0x1a09('0x1c')]||null:null,'include':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a[_0x1a09('0x1b')][_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0x127e7a[_0x1a09('0x1b')]['include'],function(_0x2bd287){return{'model':db[_0x2bd287['model']],'as':_0x2bd287['as'],'attributes':_0x2bd287['attributes'],'include':_0x2bd287['include']?_[_0x1a09('0x1f')](_0x2bd287[_0x1a09('0x1e')],function(_0x41e592){return{'model':db[_0x41e592[_0x1a09('0x25')]],'as':_0x41e592['as'],'attributes':_0x41e592[_0x1a09('0x1c')],'include':_0x41e592[_0x1a09('0x1e')]?_['map'](_0x41e592[_0x1a09('0x1e')],function(_0x468eb3){return{'model':db[_0x468eb3[_0x1a09('0x25')]],'as':_0x468eb3['as'],'attributes':_0x468eb3[_0x1a09('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1a09('0x10')](function(_0x5b1f09){logger[_0x1a09('0x11')](_0x1a09('0x23'),_0x127e7a);logger['debug'](_0x1a09('0x23'),_0x127e7a,JSON[_0x1a09('0x14')](_0x5b1f09));_0x480e45(_0x5b1f09);})[_0x1a09('0x22')](function(_0xb2b016){logger[_0x1a09('0x15')](_0x1a09('0x23'),_0xb2b016['message'],_0x127e7a);_0x59e5d3(_0x338935[_0x1a09('0x15')](0x1f4,_0xb2b016['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b4767ca..9d0fac4 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8ca=['./faxQueue.events','save','remove','update','emit','removeListener','register','faxQueue:'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xd8ca,0x178));var _0xad8c=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0xd8ca[_0x378b4];return _0x11d07b;};'use strict';var FaxQueueEvents=require(_0xad8c('0x0'));var events=[_0xad8c('0x1'),_0xad8c('0x2'),_0xad8c('0x3')];function createListener(_0x4037fd,_0x4ff226){return function(_0x3dca89){_0x4ff226[_0xad8c('0x4')](_0x4037fd,_0x3dca89);};}function removeListener(_0x1ab60b,_0x541d0c){return function(){FaxQueueEvents[_0xad8c('0x5')](_0x1ab60b,_0x541d0c);};}exports[_0xad8c('0x6')]=function(_0x1657ae){for(var _0x1c8353=0x0,_0xabc45c=events['length'];_0x1c8353<_0xabc45c;_0x1c8353++){var _0x1dc270=events[_0x1c8353];var _0x5d84d7=createListener(_0xad8c('0x7')+_0x1dc270,_0x1657ae);FaxQueueEvents['on'](_0x1dc270,_0x5d84d7);}}; \ No newline at end of file +var _0xbccb=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2d36bf,_0x3bfcd6){var _0x293ad3=function(_0x5ab295){while(--_0x5ab295){_0x2d36bf['push'](_0x2d36bf['shift']());}};_0x293ad3(++_0x3bfcd6);}(_0xbccb,0x157));var _0xbbcc=function(_0x34a087,_0x4bd68e){_0x34a087=_0x34a087-0x0;var _0x5c15d7=_0xbccb[_0x34a087];return _0x5c15d7;};'use strict';var FaxQueueEvents=require(_0xbbcc('0x0'));var events=[_0xbbcc('0x1'),_0xbbcc('0x2'),_0xbbcc('0x3')];function createListener(_0x5ba09d,_0x3edfb4){return function(_0x4315d0){_0x3edfb4[_0xbbcc('0x4')](_0x5ba09d,_0x4315d0);};}function removeListener(_0x37c840,_0x1d534d){return function(){FaxQueueEvents[_0xbbcc('0x5')](_0x37c840,_0x1d534d);};}exports[_0xbbcc('0x6')]=function(_0x2ddc03){for(var _0x57f169=0x0,_0xc6f889=events[_0xbbcc('0x7')];_0x57f169<_0xc6f889;_0x57f169++){var _0x2379ab=events[_0x57f169];var _0x2d090e=createListener(_0xbbcc('0x8')+_0x2379ab,_0x2ddc03);FaxQueueEvents['on'](_0x2379ab,_0x2d090e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d84e77f..3c6b1e6 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x603c9e,_0x203942){var _0x3af2f2=function(_0x1f2177){while(--_0x1f2177){_0x603c9e['push'](_0x603c9e['shift']());}};_0x3af2f2(++_0x203942);}(_0xadb5,0xad));var _0x5adb=function(_0x57fee2,_0x5be509){_0x57fee2=_0x57fee2-0x0;var _0x1cb649=_0xadb5[_0x57fee2];return _0x1cb649;};'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('./faxQueue.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['getMembers']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['get'](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['post']('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x13')]);router[_0x5adb('0x14')]('/:id/teams',auth[_0x5adb('0x8')](),controller[_0x5adb('0x15')]);router[_0x5adb('0x14')]('/:id/users',auth[_0x5adb('0x8')](),controller['addAgents']);router[_0x5adb('0x16')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);router[_0x5adb('0x18')]('/:id/teams',auth[_0x5adb('0x8')](),controller['removeTeams']);router[_0x5adb('0x18')]('/:id/users',auth[_0x5adb('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xef17=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','put','update','destroy'];(function(_0x4adce1,_0x41d240){var _0x9110fa=function(_0x4c3c85){while(--_0x4c3c85){_0x4adce1['push'](_0x4adce1['shift']());}};_0x9110fa(++_0x41d240);}(_0xef17,0x136));var _0x7ef1=function(_0xa0e64,_0x2dc25b){_0xa0e64=_0xa0e64-0x0;var _0x73fd92=_0xef17[_0xa0e64];return _0x73fd92;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7ef1('0x11')]);router['post']('/',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')](_0x7ef1('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7ef1('0x17')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7ef1('0x19')]);router['delete'](_0x7ef1('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7ef1('0x16'),auth['isAuthenticated'](),controller[_0x7ef1('0x1a')]);module[_0x7ef1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 1687da0..3cdfe60 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6ec=['moment','sequelize','exports','STRING','DATE'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe6ec,0x1cc));var _0xce6e=function(_0x4cc19b,_0x1a2a73){_0x4cc19b=_0x4cc19b-0x0;var _0x439243=_0xe6ec[_0x4cc19b];return _0x439243;};'use strict';var moment=require(_0xce6e('0x0'));var Sequelize=require(_0xce6e('0x1'));module[_0xce6e('0x2')]={'uniqueid':{'type':Sequelize[_0xce6e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xce6e('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xce6e('0x4')]},'acceptAt':{'type':Sequelize[_0xce6e('0x4')]},'exitAt':{'type':Sequelize[_0xce6e('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf46b=['DATE','moment','sequelize','exports','STRING'];(function(_0x526631,_0x36130d){var _0x3c0945=function(_0x4095a3){while(--_0x4095a3){_0x526631['push'](_0x526631['shift']());}};_0x3c0945(++_0x36130d);}(_0xf46b,0x11e));var _0xbf46=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf46b[_0x27af45];return _0x18df21;};'use strict';var moment=require(_0xbf46('0x0'));var Sequelize=require(_0xbf46('0x1'));module[_0xbf46('0x2')]={'uniqueid':{'type':Sequelize[_0xbf46('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbf46('0x4')]},'leaveAt':{'type':Sequelize[_0xbf46('0x4')]},'acceptAt':{'type':Sequelize[_0xbf46('0x4')]},'exitAt':{'type':Sequelize[_0xbf46('0x4')]},'reason':{'type':Sequelize[_0xbf46('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 40963d6..a2de25a 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1da1=['sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','rawAttributes','length','options','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x58689e,_0x5d8ad3){var _0x330363=function(_0x3c805b){while(--_0x3c805b){_0x58689e['push'](_0x58689e['shift']());}};_0x330363(++_0x5d8ad3);}(_0x1da1,0x1a4));var _0x11da=function(_0x106464,_0x34e5d1){_0x106464=_0x106464-0x0;var _0x3fa260=_0x1da1[_0x106464];return _0x3fa260;};'use strict';var emlformat=require(_0x11da('0x0'));var rimraf=require(_0x11da('0x1'));var zipdir=require(_0x11da('0x2'));var jsonpatch=require(_0x11da('0x3'));var rp=require(_0x11da('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x11da('0x5'));var util=require(_0x11da('0x6'));var path=require(_0x11da('0x7'));var sox=require('sox');var csv=require(_0x11da('0x8'));var ejs=require(_0x11da('0x9'));var fs=require('fs');var fs_extra=require(_0x11da('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x11da('0xb'));var jsforce=require(_0x11da('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x11da('0x8'));var querystring=require(_0x11da('0xd'));var Papa=require('papaparse');var Redis=require(_0x11da('0xe'));var authService=require(_0x11da('0xf'));var qs=require(_0x11da('0x10'));var as=require(_0x11da('0x11'));var hardwareService=require(_0x11da('0x12'));var logger=require(_0x11da('0x13'))(_0x11da('0x14'));var utils=require(_0x11da('0x15'));var config=require(_0x11da('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x11da('0x17'))['db'];function respondWithStatusCode(_0x22b3a4,_0x37a467){_0x37a467=_0x37a467||0xcc;return function(_0x35c329){if(_0x35c329){return _0x22b3a4[_0x11da('0x18')](_0x37a467);}return _0x22b3a4['status'](_0x37a467)[_0x11da('0x19')]();};}function respondWithResult(_0x2e274f,_0x2ee64d){_0x2ee64d=_0x2ee64d||0xc8;return function(_0x1af139){if(_0x1af139){return _0x2e274f[_0x11da('0x1a')](_0x2ee64d)['json'](_0x1af139);}};}function respondWithFilteredResult(_0x1a0f47,_0x529f70){return function(_0x3634d4){if(_0x3634d4){var _0x741933=typeof _0x529f70[_0x11da('0x1b')]===_0x11da('0x1c')&&typeof _0x529f70[_0x11da('0x1d')]===_0x11da('0x1c');var _0x9a4aa0=_0x3634d4[_0x11da('0x1e')];var _0x3c3392=_0x741933?0x0:_0x529f70[_0x11da('0x1b')];var _0x463c3d=_0x741933?_0x3634d4[_0x11da('0x1e')]:_0x529f70['offset']+_0x529f70[_0x11da('0x1d')];var _0x2e2ae0;if(_0x463c3d>=_0x9a4aa0){_0x463c3d=_0x9a4aa0;_0x2e2ae0=0xc8;}else{_0x2e2ae0=0xce;}_0x1a0f47[_0x11da('0x1a')](_0x2e2ae0);return _0x1a0f47[_0x11da('0x1f')](_0x11da('0x20'),_0x3c3392+'-'+_0x463c3d+'/'+_0x9a4aa0)['json'](_0x3634d4);}return null;};}function patchUpdates(_0x2c0d4a){return function(_0x41bdb7){try{jsonpatch[_0x11da('0x21')](_0x41bdb7,_0x2c0d4a,!![]);}catch(_0x481dd4){return BPromise['reject'](_0x481dd4);}return _0x41bdb7[_0x11da('0x22')]();};}function saveUpdates(_0x1f10d1,_0x275400){return function(_0x514fc4){if(_0x514fc4){return _0x514fc4[_0x11da('0x23')](_0x1f10d1)['then'](function(_0x1e963e){return _0x1e963e;});}return null;};}function removeEntity(_0x3a90db,_0x3b179c){return function(_0x16ebc7){if(_0x16ebc7){return _0x16ebc7[_0x11da('0x24')]()[_0x11da('0x25')](function(){_0x3a90db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a9dc,_0x3ad7b7){return function(_0x48908f){if(!_0x48908f){_0x15a9dc[_0x11da('0x18')](0x194);}return _0x48908f;};}function handleError(_0x28adc7,_0x52bdb0){_0x52bdb0=_0x52bdb0||0x1f4;return function(_0x28f7a4){logger[_0x11da('0x26')](_0x28f7a4[_0x11da('0x27')]);if(_0x28f7a4[_0x11da('0x28')]){delete _0x28f7a4[_0x11da('0x28')];}_0x28adc7[_0x11da('0x1a')](_0x52bdb0)[_0x11da('0x29')](_0x28f7a4);};}exports[_0x11da('0x2a')]=function(_0x219ac0,_0x47aab1){var _0x1b5b92={},_0x558267={},_0x55d339={'count':0x0,'rows':[]};var _0x315488=_[_0x11da('0x2b')](db[_0x11da('0x2c')]['rawAttributes'],function(_0x553814){return{'name':_0x553814[_0x11da('0x2d')],'type':_0x553814[_0x11da('0x2e')][_0x11da('0x2f')]};});_0x558267[_0x11da('0x30')]=_[_0x11da('0x2b')](_0x315488,_0x11da('0x28'));_0x558267['query']=_[_0x11da('0x31')](_0x219ac0['query']);_0x558267['filters']=_[_0x11da('0x32')](_0x558267[_0x11da('0x30')],_0x558267[_0x11da('0x33')]);_0x1b5b92[_0x11da('0x34')]=_[_0x11da('0x32')](_0x558267[_0x11da('0x30')],qs[_0x11da('0x35')](_0x219ac0['query'][_0x11da('0x35')]));_0x1b5b92['attributes']=_0x1b5b92[_0x11da('0x34')]['length']?_0x1b5b92[_0x11da('0x34')]:_0x558267['model'];if(!_0x219ac0['query'][_0x11da('0x36')](_0x11da('0x37'))){_0x1b5b92[_0x11da('0x1d')]=qs[_0x11da('0x1d')](_0x219ac0[_0x11da('0x33')][_0x11da('0x1d')]);_0x1b5b92['offset']=qs['offset'](_0x219ac0[_0x11da('0x33')][_0x11da('0x1b')]);}_0x1b5b92[_0x11da('0x38')]=qs['sort'](_0x219ac0[_0x11da('0x33')][_0x11da('0x39')]);_0x1b5b92[_0x11da('0x3a')]=qs[_0x11da('0x3b')](_[_0x11da('0x3c')](_0x219ac0[_0x11da('0x33')],_0x558267[_0x11da('0x3b')]),_0x315488);if(_0x219ac0[_0x11da('0x33')][_0x11da('0x3d')]){_0x1b5b92[_0x11da('0x3a')]=_[_0x11da('0x3e')](_0x1b5b92[_0x11da('0x3a')],{'$or':_[_0x11da('0x2b')](_0x315488,function(_0x1af1ac){if(_0x1af1ac[_0x11da('0x2e')]!==_0x11da('0x3f')){var _0x4b4891={};_0x4b4891[_0x1af1ac[_0x11da('0x28')]]={'$like':'%'+_0x219ac0[_0x11da('0x33')]['filter']+'%'};return _0x4b4891;}})});}_0x1b5b92=_[_0x11da('0x3e')]({},_0x1b5b92,_0x219ac0['options']);var _0x42d36c={'where':_0x1b5b92[_0x11da('0x3a')]};return db[_0x11da('0x2c')]['count'](_0x42d36c)[_0x11da('0x25')](function(_0x56068d){_0x55d339[_0x11da('0x1e')]=_0x56068d;if(_0x219ac0[_0x11da('0x33')][_0x11da('0x40')]){_0x1b5b92[_0x11da('0x41')]=[{'all':!![]}];}return db[_0x11da('0x2c')]['findAll'](_0x1b5b92);})[_0x11da('0x25')](function(_0x8384e1){_0x55d339[_0x11da('0x42')]=_0x8384e1;return _0x55d339;})[_0x11da('0x25')](respondWithFilteredResult(_0x47aab1,_0x1b5b92))[_0x11da('0x43')](handleError(_0x47aab1,null));};exports['show']=function(_0x129fd8,_0x9262b6){var _0x503129={'raw':!![],'where':{'id':_0x129fd8['params']['id']}},_0x5165e5={};_0x5165e5[_0x11da('0x30')]=_[_0x11da('0x31')](db['FaxQueueReport'][_0x11da('0x44')]);_0x5165e5[_0x11da('0x33')]=_[_0x11da('0x31')](_0x129fd8['query']);_0x5165e5[_0x11da('0x3b')]=_[_0x11da('0x32')](_0x5165e5[_0x11da('0x30')],_0x5165e5[_0x11da('0x33')]);_0x503129[_0x11da('0x34')]=_[_0x11da('0x32')](_0x5165e5[_0x11da('0x30')],qs[_0x11da('0x35')](_0x129fd8[_0x11da('0x33')]['fields']));_0x503129[_0x11da('0x34')]=_0x503129[_0x11da('0x34')][_0x11da('0x45')]?_0x503129[_0x11da('0x34')]:_0x5165e5[_0x11da('0x30')];if(_0x129fd8[_0x11da('0x33')][_0x11da('0x40')]){_0x503129[_0x11da('0x41')]=[{'all':!![]}];}_0x503129=_[_0x11da('0x3e')]({},_0x503129,_0x129fd8[_0x11da('0x46')]);return db[_0x11da('0x2c')]['find'](_0x503129)[_0x11da('0x25')](handleEntityNotFound(_0x9262b6,null))[_0x11da('0x25')](respondWithResult(_0x9262b6,null))[_0x11da('0x43')](handleError(_0x9262b6,null));};exports['create']=function(_0x4ec77b,_0x4981e0){return db[_0x11da('0x2c')]['create'](_0x4ec77b['body'],{})[_0x11da('0x25')](respondWithResult(_0x4981e0,0xc9))[_0x11da('0x43')](handleError(_0x4981e0,null));};exports[_0x11da('0x23')]=function(_0x5b9117,_0x24013d){if(_0x5b9117[_0x11da('0x47')]['id']){delete _0x5b9117['body']['id'];}return db[_0x11da('0x2c')][_0x11da('0x48')]({'where':{'id':_0x5b9117['params']['id']}})[_0x11da('0x25')](handleEntityNotFound(_0x24013d,null))[_0x11da('0x25')](saveUpdates(_0x5b9117[_0x11da('0x47')],null))[_0x11da('0x25')](respondWithResult(_0x24013d,null))['catch'](handleError(_0x24013d,null));};exports[_0x11da('0x24')]=function(_0x4a9fcf,_0x4af8ca){return db['FaxQueueReport']['find']({'where':{'id':_0x4a9fcf['params']['id']}})[_0x11da('0x25')](handleEntityNotFound(_0x4af8ca,null))[_0x11da('0x25')](removeEntity(_0x4af8ca,null))[_0x11da('0x43')](handleError(_0x4af8ca,null));};exports['describe']=function(_0x105bbe,_0x44bd87){return db[_0x11da('0x2c')][_0x11da('0x49')]()['then'](respondWithResult(_0x44bd87,null))[_0x11da('0x43')](handleError(_0x44bd87,null));}; \ No newline at end of file +var _0xf72b=['catch','params','find','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0xf72b,0x1d9));var _0xbf72=function(_0x10e601,_0x143e7c){_0x10e601=_0x10e601-0x0;var _0x4552e6=_0xf72b[_0x10e601];return _0x4552e6;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf72('0x2'));var moment=require(_0xbf72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf72('0x4'));var util=require(_0xbf72('0x5'));var path=require(_0xbf72('0x6'));var sox=require(_0xbf72('0x7'));var csv=require(_0xbf72('0x8'));var ejs=require(_0xbf72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x8'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var licenseUtil=require(_0xbf72('0x17'));var db=require(_0xbf72('0x18'))['db'];function respondWithStatusCode(_0x5eb4cc,_0x5967f5){_0x5967f5=_0x5967f5||0xcc;return function(_0x3bd500){if(_0x3bd500){return _0x5eb4cc[_0xbf72('0x19')](_0x5967f5);}return _0x5eb4cc[_0xbf72('0x1a')](_0x5967f5)['end']();};}function respondWithResult(_0x25255e,_0x4f4fa5){_0x4f4fa5=_0x4f4fa5||0xc8;return function(_0x5625b3){if(_0x5625b3){return _0x25255e['status'](_0x4f4fa5)[_0xbf72('0x1b')](_0x5625b3);}};}function respondWithFilteredResult(_0xb96906,_0x3af48d){return function(_0x723eb1){if(_0x723eb1){var _0x39d0cd=typeof _0x3af48d[_0xbf72('0x1c')]==='undefined'&&typeof _0x3af48d[_0xbf72('0x1d')]===_0xbf72('0x1e');var _0x2a8609=_0x723eb1[_0xbf72('0x1f')];var _0x27dadc=_0x39d0cd?0x0:_0x3af48d['offset'];var _0x51d4c9=_0x39d0cd?_0x723eb1[_0xbf72('0x1f')]:_0x3af48d[_0xbf72('0x1c')]+_0x3af48d[_0xbf72('0x1d')];var _0x2584d9;if(_0x51d4c9>=_0x2a8609){_0x51d4c9=_0x2a8609;_0x2584d9=0xc8;}else{_0x2584d9=0xce;}_0xb96906[_0xbf72('0x1a')](_0x2584d9);return _0xb96906[_0xbf72('0x20')](_0xbf72('0x21'),_0x27dadc+'-'+_0x51d4c9+'/'+_0x2a8609)['json'](_0x723eb1);}return null;};}function patchUpdates(_0x2aecae){return function(_0x42a193){try{jsonpatch[_0xbf72('0x22')](_0x42a193,_0x2aecae,!![]);}catch(_0x200139){return BPromise[_0xbf72('0x23')](_0x200139);}return _0x42a193['save']();};}function saveUpdates(_0x3cd181,_0x1de926){return function(_0x536071){if(_0x536071){return _0x536071[_0xbf72('0x24')](_0x3cd181)[_0xbf72('0x25')](function(_0x267c41){return _0x267c41;});}return null;};}function removeEntity(_0x4c7f3d,_0x44f3f9){return function(_0x428361){if(_0x428361){return _0x428361[_0xbf72('0x26')]()[_0xbf72('0x25')](function(){_0x4c7f3d['status'](0xcc)[_0xbf72('0x27')]();});}};}function handleEntityNotFound(_0x392a8c,_0x1c8b8b){return function(_0x54fdfe){if(!_0x54fdfe){_0x392a8c[_0xbf72('0x19')](0x194);}return _0x54fdfe;};}function handleError(_0xd8fefc,_0x3df816){_0x3df816=_0x3df816||0x1f4;return function(_0x1a2f55){logger[_0xbf72('0x28')](_0x1a2f55[_0xbf72('0x29')]);if(_0x1a2f55[_0xbf72('0x2a')]){delete _0x1a2f55[_0xbf72('0x2a')];}_0xd8fefc[_0xbf72('0x1a')](_0x3df816)[_0xbf72('0x2b')](_0x1a2f55);};}exports[_0xbf72('0x2c')]=function(_0x20e747,_0x4a6ccf){var _0xb648f2={},_0x37a233={},_0x51f481={'count':0x0,'rows':[]};var _0x708fcb=_[_0xbf72('0x2d')](db[_0xbf72('0x2e')][_0xbf72('0x2f')],function(_0xb1ee4e){return{'name':_0xb1ee4e[_0xbf72('0x30')],'type':_0xb1ee4e[_0xbf72('0x31')][_0xbf72('0x32')]};});_0x37a233[_0xbf72('0x33')]=_[_0xbf72('0x2d')](_0x708fcb,_0xbf72('0x2a'));_0x37a233[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x20e747[_0xbf72('0x34')]);_0x37a233['filters']=_[_0xbf72('0x36')](_0x37a233[_0xbf72('0x33')],_0x37a233[_0xbf72('0x34')]);_0xb648f2['attributes']=_['intersection'](_0x37a233['model'],qs[_0xbf72('0x37')](_0x20e747[_0xbf72('0x34')][_0xbf72('0x37')]));_0xb648f2['attributes']=_0xb648f2[_0xbf72('0x38')][_0xbf72('0x39')]?_0xb648f2['attributes']:_0x37a233[_0xbf72('0x33')];if(!_0x20e747['query'][_0xbf72('0x3a')](_0xbf72('0x3b'))){_0xb648f2['limit']=qs['limit'](_0x20e747[_0xbf72('0x34')][_0xbf72('0x1d')]);_0xb648f2[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x20e747[_0xbf72('0x34')][_0xbf72('0x1c')]);}_0xb648f2[_0xbf72('0x3c')]=qs[_0xbf72('0x3d')](_0x20e747[_0xbf72('0x34')]['sort']);_0xb648f2[_0xbf72('0x3e')]=qs[_0xbf72('0x3f')](_[_0xbf72('0x40')](_0x20e747[_0xbf72('0x34')],_0x37a233['filters']),_0x708fcb);if(_0x20e747[_0xbf72('0x34')][_0xbf72('0x41')]){_0xb648f2['where']=_[_0xbf72('0x42')](_0xb648f2['where'],{'$or':_['map'](_0x708fcb,function(_0x515ae8){if(_0x515ae8['type']!==_0xbf72('0x43')){var _0x4ed723={};_0x4ed723[_0x515ae8['name']]={'$like':'%'+_0x20e747[_0xbf72('0x34')]['filter']+'%'};return _0x4ed723;}})});}_0xb648f2=_[_0xbf72('0x42')]({},_0xb648f2,_0x20e747[_0xbf72('0x44')]);var _0x4bc204={'where':_0xb648f2[_0xbf72('0x3e')]};return db['FaxQueueReport']['count'](_0x4bc204)[_0xbf72('0x25')](function(_0x13e1d6){_0x51f481[_0xbf72('0x1f')]=_0x13e1d6;if(_0x20e747[_0xbf72('0x34')][_0xbf72('0x45')]){_0xb648f2[_0xbf72('0x46')]=[{'all':!![]}];}return db[_0xbf72('0x2e')][_0xbf72('0x47')](_0xb648f2);})['then'](function(_0x311a0c){_0x51f481[_0xbf72('0x48')]=_0x311a0c;return _0x51f481;})['then'](respondWithFilteredResult(_0x4a6ccf,_0xb648f2))[_0xbf72('0x49')](handleError(_0x4a6ccf,null));};exports['show']=function(_0x5851b8,_0x396ff7){var _0x15e4c7={'raw':!![],'where':{'id':_0x5851b8[_0xbf72('0x4a')]['id']}},_0x3992fd={};_0x3992fd[_0xbf72('0x33')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x3992fd[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x5851b8[_0xbf72('0x34')]);_0x3992fd[_0xbf72('0x3f')]=_['intersection'](_0x3992fd['model'],_0x3992fd[_0xbf72('0x34')]);_0x15e4c7['attributes']=_[_0xbf72('0x36')](_0x3992fd[_0xbf72('0x33')],qs[_0xbf72('0x37')](_0x5851b8[_0xbf72('0x34')]['fields']));_0x15e4c7[_0xbf72('0x38')]=_0x15e4c7[_0xbf72('0x38')][_0xbf72('0x39')]?_0x15e4c7[_0xbf72('0x38')]:_0x3992fd['model'];if(_0x5851b8[_0xbf72('0x34')][_0xbf72('0x45')]){_0x15e4c7['include']=[{'all':!![]}];}_0x15e4c7=_[_0xbf72('0x42')]({},_0x15e4c7,_0x5851b8[_0xbf72('0x44')]);return db[_0xbf72('0x2e')][_0xbf72('0x4b')](_0x15e4c7)[_0xbf72('0x25')](handleEntityNotFound(_0x396ff7,null))[_0xbf72('0x25')](respondWithResult(_0x396ff7,null))[_0xbf72('0x49')](handleError(_0x396ff7,null));};exports['create']=function(_0x4ec7eb,_0x5b4bbb){return db[_0xbf72('0x2e')]['create'](_0x4ec7eb[_0xbf72('0x4c')],{})['then'](respondWithResult(_0x5b4bbb,0xc9))['catch'](handleError(_0x5b4bbb,null));};exports['update']=function(_0x9f94ea,_0x15a271){if(_0x9f94ea[_0xbf72('0x4c')]['id']){delete _0x9f94ea[_0xbf72('0x4c')]['id'];}return db[_0xbf72('0x2e')][_0xbf72('0x4b')]({'where':{'id':_0x9f94ea['params']['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x15a271,null))['then'](saveUpdates(_0x9f94ea[_0xbf72('0x4c')],null))['then'](respondWithResult(_0x15a271,null))[_0xbf72('0x49')](handleError(_0x15a271,null));};exports[_0xbf72('0x26')]=function(_0x45e4d5,_0x1fd1f8){return db[_0xbf72('0x2e')][_0xbf72('0x4b')]({'where':{'id':_0x45e4d5[_0xbf72('0x4a')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x1fd1f8,null))[_0xbf72('0x25')](removeEntity(_0x1fd1f8,null))['catch'](handleError(_0x1fd1f8,null));};exports[_0xbf72('0x4d')]=function(_0x2f9816,_0x46f22e){return db['FaxQueueReport'][_0xbf72('0x4d')]()[_0xbf72('0x25')](respondWithResult(_0x46f22e,null))[_0xbf72('0x49')](handleError(_0x46f22e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 2cde8f1..a0208ea 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x1cb9,0x14e));var _0x91cb=function(_0x394c97,_0x3aad5d){_0x394c97=_0x394c97-0x0;var _0x6f7abc=_0x1cb9[_0x394c97];return _0x6f7abc;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x4df106,_0x23f0f1){var _0x4f2246=function(_0x3d2c48){while(--_0x3d2c48){_0x4df106['push'](_0x4df106['shift']());}};_0x4f2246(++_0x23f0f1);}(_0x7a54,0x106));var _0x47a5=function(_0x327c41,_0x66357f){_0x327c41=_0x327c41-0x0;var _0x180c98=_0x7a54[_0x327c41];return _0x180c98;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c721b8c..81e368c 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2921=['request\x20sent','error','code','message','result','catch','FaxQueueReport','body','raw','debug','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','options','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x30977e,_0x1d0cb5){var _0x22f2a8=function(_0x2781ee){while(--_0x2781ee){_0x30977e['push'](_0x30977e['shift']());}};_0x22f2a8(++_0x1d0cb5);}(_0x2921,0x1df));var _0x1292=function(_0x501a87,_0x198eae){_0x501a87=_0x501a87-0x0;var _0x49f17f=_0x2921[_0x501a87];return _0x49f17f;};'use strict';var _=require(_0x1292('0x0'));var util=require(_0x1292('0x1'));var moment=require('moment');var BPromise=require(_0x1292('0x2'));var rs=require(_0x1292('0x3'));var fs=require('fs');var Redis=require(_0x1292('0x4'));var db=require(_0x1292('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1292('0x6'))(_0x1292('0x7'));var config=require(_0x1292('0x8'));var jayson=require(_0x1292('0x9'));var client=jayson['client'][_0x1292('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51ae6a,_0x29843d,_0xd81edf){return new BPromise(function(_0xc54457,_0x153902){return client[_0x1292('0xb')](_0x51ae6a,_0xd81edf)[_0x1292('0xc')](function(_0x5da85e){logger[_0x1292('0xd')](_0x1292('0xe'),_0x29843d,'request\x20sent');logger['debug'](_0x1292('0xf'),_0x29843d,_0x1292('0x10'),JSON['stringify'](_0x5da85e));if(_0x5da85e[_0x1292('0x11')]){if(_0x5da85e['error'][_0x1292('0x12')]===0x1f4){logger[_0x1292('0x11')](_0x1292('0xe'),_0x29843d,_0x5da85e[_0x1292('0x11')][_0x1292('0x13')]);return _0x153902(_0x5da85e[_0x1292('0x11')][_0x1292('0x13')]);}logger[_0x1292('0x11')](_0x1292('0xe'),_0x29843d,_0x5da85e[_0x1292('0x11')][_0x1292('0x13')]);return _0xc54457(_0x5da85e['error'][_0x1292('0x13')]);}else{logger[_0x1292('0xd')](_0x1292('0xe'),_0x29843d,_0x1292('0x10'));_0xc54457(_0x5da85e[_0x1292('0x14')]['message']);}})[_0x1292('0x15')](function(_0x11c485){logger[_0x1292('0x11')](_0x1292('0xe'),_0x29843d,_0x11c485);_0x153902(_0x11c485);});});}exports['CreateFaxQueueReport']=function(_0x1fa1b1){var _0x500564=this;return new Promise(function(_0x46bbcd,_0x2601b0){return db[_0x1292('0x16')]['create'](_0x1fa1b1[_0x1292('0x17')],{'raw':_0x1fa1b1['options']?_0x1fa1b1['options'][_0x1292('0x18')]===undefined?!![]:![]:!![]})[_0x1292('0xc')](function(_0x32bbc2){logger[_0x1292('0xd')]('CreateFaxQueueReport',_0x1fa1b1);logger[_0x1292('0x19')](_0x1292('0x1a'),_0x1fa1b1,JSON[_0x1292('0x1b')](_0x32bbc2));_0x46bbcd(_0x32bbc2);})[_0x1292('0x15')](function(_0x1d9edf){logger[_0x1292('0x11')](_0x1292('0x1a'),_0x1d9edf[_0x1292('0x13')],_0x1fa1b1);_0x2601b0(_0x500564['error'](0x1f4,_0x1d9edf[_0x1292('0x13')]));});});};exports[_0x1292('0x1c')]=function(_0x4ad6b2){var _0x3190f0=this;return new Promise(function(_0x3288c7,_0x4e68a3){return db['FaxQueueReport']['update'](_0x4ad6b2[_0x1292('0x17')],{'raw':_0x4ad6b2['options']?_0x4ad6b2[_0x1292('0x1d')][_0x1292('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ad6b2[_0x1292('0x1d')]?_0x4ad6b2[_0x1292('0x1d')][_0x1292('0x1e')]||null:null,'attributes':_0x4ad6b2['options']?_0x4ad6b2[_0x1292('0x1d')][_0x1292('0x1f')]||null:null,'limit':_0x4ad6b2[_0x1292('0x1d')]?_0x4ad6b2[_0x1292('0x1d')][_0x1292('0x20')]||null:null})[_0x1292('0xc')](function(_0x3554ea){logger[_0x1292('0xd')]('UpdateFaxQueueReport',_0x4ad6b2);logger['debug']('UpdateFaxQueueReport',_0x4ad6b2,JSON[_0x1292('0x1b')](_0x3554ea));_0x3288c7(_0x3554ea);})['catch'](function(_0x27c415){logger['error'](_0x1292('0x1c'),_0x27c415[_0x1292('0x13')],_0x4ad6b2);_0x4e68a3(_0x3190f0[_0x1292('0x11')](0x1f4,_0x27c415[_0x1292('0x13')]));});});}; \ No newline at end of file +var _0x7d76=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','create','options','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','body','raw','where','attributes','limit'];(function(_0xffa865,_0x467c66){var _0x1e6e46=function(_0x236806){while(--_0x236806){_0xffa865['push'](_0xffa865['shift']());}};_0x1e6e46(++_0x467c66);}(_0x7d76,0x160));var _0x67d7=function(_0x41108d,_0x44020b){_0x41108d=_0x41108d-0x0;var _0x463864=_0x7d76[_0x41108d];return _0x463864;};'use strict';var _=require(_0x67d7('0x0'));var util=require(_0x67d7('0x1'));var moment=require(_0x67d7('0x2'));var BPromise=require(_0x67d7('0x3'));var rs=require(_0x67d7('0x4'));var fs=require('fs');var Redis=require(_0x67d7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67d7('0x6'))(_0x67d7('0x7'));var config=require(_0x67d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x67d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28e6f9,_0xdeb599,_0x3db593){return new BPromise(function(_0x4c3138,_0x3b735d){return client['request'](_0x28e6f9,_0x3db593)[_0x67d7('0xa')](function(_0x525ee5){logger[_0x67d7('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0xdeb599,'request\x20sent');logger[_0x67d7('0xc')](_0x67d7('0xd'),_0xdeb599,_0x67d7('0xe'),JSON[_0x67d7('0xf')](_0x525ee5));if(_0x525ee5[_0x67d7('0x10')]){if(_0x525ee5[_0x67d7('0x10')][_0x67d7('0x11')]===0x1f4){logger[_0x67d7('0x10')](_0x67d7('0x12'),_0xdeb599,_0x525ee5[_0x67d7('0x10')]['message']);return _0x3b735d(_0x525ee5['error'][_0x67d7('0x13')]);}logger['error'](_0x67d7('0x12'),_0xdeb599,_0x525ee5[_0x67d7('0x10')][_0x67d7('0x13')]);return _0x4c3138(_0x525ee5[_0x67d7('0x10')][_0x67d7('0x13')]);}else{logger['info'](_0x67d7('0x12'),_0xdeb599,'request\x20sent');_0x4c3138(_0x525ee5[_0x67d7('0x14')][_0x67d7('0x13')]);}})[_0x67d7('0x15')](function(_0x4b712f){logger[_0x67d7('0x10')](_0x67d7('0x12'),_0xdeb599,_0x4b712f);_0x3b735d(_0x4b712f);});});}exports['CreateFaxQueueReport']=function(_0x135eed){var _0x4c4da3=this;return new Promise(function(_0x266cf6,_0x15f2b0){return db['FaxQueueReport'][_0x67d7('0x16')](_0x135eed['body'],{'raw':_0x135eed[_0x67d7('0x17')]?_0x135eed['options']['raw']===undefined?!![]:![]:!![]})[_0x67d7('0xa')](function(_0x2a5ee4){logger[_0x67d7('0xb')]('CreateFaxQueueReport',_0x135eed);logger[_0x67d7('0xc')](_0x67d7('0x18'),_0x135eed,JSON[_0x67d7('0xf')](_0x2a5ee4));_0x266cf6(_0x2a5ee4);})['catch'](function(_0x522828){logger[_0x67d7('0x10')](_0x67d7('0x18'),_0x522828[_0x67d7('0x13')],_0x135eed);_0x15f2b0(_0x4c4da3[_0x67d7('0x10')](0x1f4,_0x522828[_0x67d7('0x13')]));});});};exports[_0x67d7('0x19')]=function(_0x4bc11c){var _0x42ce09=this;return new Promise(function(_0x21969b,_0x547ff9){return db[_0x67d7('0x1a')]['update'](_0x4bc11c[_0x67d7('0x1b')],{'raw':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c[_0x67d7('0x17')][_0x67d7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c[_0x67d7('0x17')][_0x67d7('0x1d')]||null:null,'attributes':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c['options'][_0x67d7('0x1e')]||null:null,'limit':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c[_0x67d7('0x17')][_0x67d7('0x1f')]||null:null})[_0x67d7('0xa')](function(_0x2e01f3){logger[_0x67d7('0xb')]('UpdateFaxQueueReport',_0x4bc11c);logger[_0x67d7('0xc')]('UpdateFaxQueueReport',_0x4bc11c,JSON[_0x67d7('0xf')](_0x2e01f3));_0x21969b(_0x2e01f3);})[_0x67d7('0x15')](function(_0x4dfab9){logger[_0x67d7('0x10')](_0x67d7('0x19'),_0x4dfab9[_0x67d7('0x13')],_0x4bc11c);_0x547ff9(_0x42ce09[_0x67d7('0x10')](0x1f4,_0x4dfab9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ccbe430..16f8aae 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8578=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','isAuthenticated','/:id','create'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x8578,0x1a6));var _0x8857=function(_0x367e56,_0x123193){_0x367e56=_0x367e56-0x0;var _0xc7f4dd=_0x8578[_0x367e56];return _0xc7f4dd;};'use strict';var multer=require(_0x8857('0x0'));var util=require(_0x8857('0x1'));var path=require(_0x8857('0x2'));var timeout=require(_0x8857('0x3'));var express=require(_0x8857('0x4'));var router=express[_0x8857('0x5')]();var fs_extra=require(_0x8857('0x6'));var auth=require(_0x8857('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8857('0x8'));var controller=require(_0x8857('0x9'));router[_0x8857('0xa')]('/',auth['isAuthenticated'](),controller[_0x8857('0xb')]);router[_0x8857('0xa')]('/describe',auth[_0x8857('0xc')](),controller['describe']);router[_0x8857('0xa')](_0x8857('0xd'),auth[_0x8857('0xc')](),controller['show']);router['post']('/',auth[_0x8857('0xc')](),controller[_0x8857('0xe')]);router[_0x8857('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8857('0x10')](_0x8857('0xd'),auth[_0x8857('0xc')](),controller[_0x8857('0x11')]);module[_0x8857('0x12')]=router; \ No newline at end of file +var _0x002c=['./faxQueueReport.controller','index','get','/describe','isAuthenticated','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x002c,0xe7));var _0xc002=function(_0xd40717,_0x523966){_0xd40717=_0xd40717-0x0;var _0x3bb342=_0x002c[_0xd40717];return _0x3bb342;};'use strict';var multer=require(_0xc002('0x0'));var util=require(_0xc002('0x1'));var path=require(_0xc002('0x2'));var timeout=require(_0xc002('0x3'));var express=require(_0xc002('0x4'));var router=express[_0xc002('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc002('0x6'));var interaction=require(_0xc002('0x7'));var config=require(_0xc002('0x8'));var controller=require(_0xc002('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc002('0xa')]);router[_0xc002('0xb')](_0xc002('0xc'),auth[_0xc002('0xd')](),controller['describe']);router[_0xc002('0xb')](_0xc002('0xe'),auth[_0xc002('0xd')](),controller[_0xc002('0xf')]);router[_0xc002('0x10')]('/',auth[_0xc002('0xd')](),controller[_0xc002('0x11')]);router[_0xc002('0x12')](_0xc002('0xe'),auth[_0xc002('0xd')](),controller['update']);router[_0xc002('0x13')](_0xc002('0xe'),auth[_0xc002('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4dc3922..eb5a18e 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2efdf2,_0x486861){var _0x390270=function(_0x1d7d1f){while(--_0x1d7d1f){_0x2efdf2['push'](_0x2efdf2['shift']());}};_0x390270(++_0x486861);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xcb91[_0xc0d9bc];return _0x32ff73;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2b430a,_0x20b60b){var _0x7e016b=function(_0xccbc5f){while(--_0xccbc5f){_0x2b430a['push'](_0x2b430a['shift']());}};_0x7e016b(++_0x20b60b);}(_0xaa88,0x137));var _0x8aa8=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xaa88[_0x387dc1];return _0x17567c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index dba0641..70ee910 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a8=['update','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save'];(function(_0x4ddcdd,_0xaf62b8){var _0x1d0a37=function(_0x26de8f){while(--_0x26de8f){_0x4ddcdd['push'](_0x4ddcdd['shift']());}};_0x1d0a37(++_0xaf62b8);}(_0xd4a8,0x13e));var _0x8d4a=function(_0x51a939,_0xb2755){_0x51a939=_0x51a939-0x0;var _0xbe0988=_0xd4a8[_0x51a939];return _0xbe0988;};'use strict';var emlformat=require(_0x8d4a('0x0'));var rimraf=require(_0x8d4a('0x1'));var zipdir=require(_0x8d4a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d4a('0x3'));var moment=require(_0x8d4a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d4a('0x5'));var util=require(_0x8d4a('0x6'));var path=require('path');var sox=require(_0x8d4a('0x7'));var csv=require(_0x8d4a('0x8'));var ejs=require(_0x8d4a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d4a('0xa'));var squel=require('squel');var crypto=require(_0x8d4a('0xb'));var jsforce=require(_0x8d4a('0xc'));var deskjs=require(_0x8d4a('0xd'));var toCsv=require(_0x8d4a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8d4a('0xe'));var authService=require(_0x8d4a('0xf'));var qs=require(_0x8d4a('0x10'));var as=require(_0x8d4a('0x11'));var hardwareService=require(_0x8d4a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8d4a('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58371b,_0x3d78bf){_0x3d78bf=_0x3d78bf||0xcc;return function(_0x28357f){if(_0x28357f){return _0x58371b[_0x8d4a('0x14')](_0x3d78bf);}return _0x58371b[_0x8d4a('0x15')](_0x3d78bf)[_0x8d4a('0x16')]();};}function respondWithResult(_0x105090,_0x54b4dc){_0x54b4dc=_0x54b4dc||0xc8;return function(_0x26cf00){if(_0x26cf00){return _0x105090[_0x8d4a('0x15')](_0x54b4dc)['json'](_0x26cf00);}};}function respondWithFilteredResult(_0x2f9369,_0x39ba40){return function(_0x297647){if(_0x297647){var _0x5c9bc3=typeof _0x39ba40['offset']===_0x8d4a('0x17')&&typeof _0x39ba40[_0x8d4a('0x18')]==='undefined';var _0x38d122=_0x297647[_0x8d4a('0x19')];var _0x144dd5=_0x5c9bc3?0x0:_0x39ba40[_0x8d4a('0x1a')];var _0x194469=_0x5c9bc3?_0x297647[_0x8d4a('0x19')]:_0x39ba40[_0x8d4a('0x1a')]+_0x39ba40[_0x8d4a('0x18')];var _0x478869;if(_0x194469>=_0x38d122){_0x194469=_0x38d122;_0x478869=0xc8;}else{_0x478869=0xce;}_0x2f9369[_0x8d4a('0x15')](_0x478869);return _0x2f9369[_0x8d4a('0x1b')]('Content-Range',_0x144dd5+'-'+_0x194469+'/'+_0x38d122)[_0x8d4a('0x1c')](_0x297647);}return null;};}function patchUpdates(_0x33ffe8){return function(_0x330417){try{jsonpatch[_0x8d4a('0x1d')](_0x330417,_0x33ffe8,!![]);}catch(_0x4038c3){return BPromise[_0x8d4a('0x1e')](_0x4038c3);}return _0x330417[_0x8d4a('0x1f')]();};}function saveUpdates(_0x1c1899,_0x1dbdfe){return function(_0x495e61){if(_0x495e61){return _0x495e61[_0x8d4a('0x20')](_0x1c1899)['then'](function(_0x4ea8e6){return _0x4ea8e6;});}return null;};}function removeEntity(_0x4ae412,_0x4afadd){return function(_0x10b42b){if(_0x10b42b){return _0x10b42b['destroy']()[_0x8d4a('0x21')](function(){_0x4ae412[_0x8d4a('0x15')](0xcc)[_0x8d4a('0x16')]();});}};}function handleEntityNotFound(_0x9b79bb,_0x1c2154){return function(_0x4feb1e){if(!_0x4feb1e){_0x9b79bb[_0x8d4a('0x14')](0x194);}return _0x4feb1e;};}function handleError(_0x1bf8a1,_0xdfe150){_0xdfe150=_0xdfe150||0x1f4;return function(_0x100538){logger[_0x8d4a('0x22')](_0x100538[_0x8d4a('0x23')]);if(_0x100538[_0x8d4a('0x24')]){delete _0x100538[_0x8d4a('0x24')];}_0x1bf8a1[_0x8d4a('0x15')](_0xdfe150)[_0x8d4a('0x25')](_0x100538);};}exports['index']=function(_0x3e6bcc,_0x4317d0){var _0x2d306c={},_0x2ca90e={},_0x27f3e0={'count':0x0,'rows':[]};var _0x5cdae7=_[_0x8d4a('0x26')](db[_0x8d4a('0x27')][_0x8d4a('0x28')],function(_0x27aa4f){return{'name':_0x27aa4f[_0x8d4a('0x29')],'type':_0x27aa4f[_0x8d4a('0x2a')]['key']};});_0x2ca90e[_0x8d4a('0x2b')]=_[_0x8d4a('0x26')](_0x5cdae7,'name');_0x2ca90e[_0x8d4a('0x2c')]=_[_0x8d4a('0x2d')](_0x3e6bcc[_0x8d4a('0x2c')]);_0x2ca90e[_0x8d4a('0x2e')]=_[_0x8d4a('0x2f')](_0x2ca90e[_0x8d4a('0x2b')],_0x2ca90e[_0x8d4a('0x2c')]);_0x2d306c[_0x8d4a('0x30')]=_[_0x8d4a('0x2f')](_0x2ca90e['model'],qs[_0x8d4a('0x31')](_0x3e6bcc[_0x8d4a('0x2c')][_0x8d4a('0x31')]));_0x2d306c[_0x8d4a('0x30')]=_0x2d306c['attributes'][_0x8d4a('0x32')]?_0x2d306c['attributes']:_0x2ca90e[_0x8d4a('0x2b')];if(!_0x3e6bcc[_0x8d4a('0x2c')][_0x8d4a('0x33')](_0x8d4a('0x34'))){_0x2d306c[_0x8d4a('0x18')]=qs[_0x8d4a('0x18')](_0x3e6bcc[_0x8d4a('0x2c')][_0x8d4a('0x18')]);_0x2d306c[_0x8d4a('0x1a')]=qs[_0x8d4a('0x1a')](_0x3e6bcc['query'][_0x8d4a('0x1a')]);}_0x2d306c[_0x8d4a('0x35')]=qs[_0x8d4a('0x36')](_0x3e6bcc['query'][_0x8d4a('0x36')]);_0x2d306c[_0x8d4a('0x37')]=qs[_0x8d4a('0x2e')](_[_0x8d4a('0x38')](_0x3e6bcc['query'],_0x2ca90e[_0x8d4a('0x2e')]),_0x5cdae7);if(_0x3e6bcc[_0x8d4a('0x2c')][_0x8d4a('0x39')]){_0x2d306c['where']=_[_0x8d4a('0x3a')](_0x2d306c['where'],{'$or':_[_0x8d4a('0x26')](_0x5cdae7,function(_0xa99158){if(_0xa99158['type']!=='VIRTUAL'){var _0x5e0f1a={};_0x5e0f1a[_0xa99158['name']]={'$like':'%'+_0x3e6bcc[_0x8d4a('0x2c')][_0x8d4a('0x39')]+'%'};return _0x5e0f1a;}})});}_0x2d306c=_[_0x8d4a('0x3a')]({},_0x2d306c,_0x3e6bcc[_0x8d4a('0x3b')]);var _0x545f7d={'where':_0x2d306c['where']};return db['FaxTransferReport'][_0x8d4a('0x19')](_0x545f7d)[_0x8d4a('0x21')](function(_0x3c232b){_0x27f3e0[_0x8d4a('0x19')]=_0x3c232b;if(_0x3e6bcc[_0x8d4a('0x2c')][_0x8d4a('0x3c')]){_0x2d306c[_0x8d4a('0x3d')]=[{'all':!![]}];}return db[_0x8d4a('0x27')][_0x8d4a('0x3e')](_0x2d306c);})[_0x8d4a('0x21')](function(_0x57f608){_0x27f3e0['rows']=_0x57f608;return _0x27f3e0;})['then'](respondWithFilteredResult(_0x4317d0,_0x2d306c))[_0x8d4a('0x3f')](handleError(_0x4317d0,null));};exports['show']=function(_0x3f24fb,_0x19b562){var _0x109a04={'raw':!![],'where':{'id':_0x3f24fb[_0x8d4a('0x40')]['id']}},_0x3d78b9={};_0x3d78b9[_0x8d4a('0x2b')]=_[_0x8d4a('0x2d')](db[_0x8d4a('0x27')][_0x8d4a('0x28')]);_0x3d78b9[_0x8d4a('0x2c')]=_[_0x8d4a('0x2d')](_0x3f24fb['query']);_0x3d78b9['filters']=_[_0x8d4a('0x2f')](_0x3d78b9[_0x8d4a('0x2b')],_0x3d78b9[_0x8d4a('0x2c')]);_0x109a04[_0x8d4a('0x30')]=_['intersection'](_0x3d78b9[_0x8d4a('0x2b')],qs[_0x8d4a('0x31')](_0x3f24fb[_0x8d4a('0x2c')]['fields']));_0x109a04[_0x8d4a('0x30')]=_0x109a04['attributes']['length']?_0x109a04[_0x8d4a('0x30')]:_0x3d78b9[_0x8d4a('0x2b')];if(_0x3f24fb[_0x8d4a('0x2c')]['includeAll']){_0x109a04[_0x8d4a('0x3d')]=[{'all':!![]}];}_0x109a04=_[_0x8d4a('0x3a')]({},_0x109a04,_0x3f24fb['options']);return db[_0x8d4a('0x27')][_0x8d4a('0x41')](_0x109a04)[_0x8d4a('0x21')](handleEntityNotFound(_0x19b562,null))[_0x8d4a('0x21')](respondWithResult(_0x19b562,null))[_0x8d4a('0x3f')](handleError(_0x19b562,null));};exports[_0x8d4a('0x42')]=function(_0x468a9d,_0xabb666){return db[_0x8d4a('0x27')][_0x8d4a('0x42')](_0x468a9d[_0x8d4a('0x43')],{})[_0x8d4a('0x21')](respondWithResult(_0xabb666,0xc9))[_0x8d4a('0x3f')](handleError(_0xabb666,null));};exports[_0x8d4a('0x20')]=function(_0x361a57,_0x322422){if(_0x361a57['body']['id']){delete _0x361a57[_0x8d4a('0x43')]['id'];}return db[_0x8d4a('0x27')][_0x8d4a('0x41')]({'where':{'id':_0x361a57['params']['id']}})['then'](handleEntityNotFound(_0x322422,null))[_0x8d4a('0x21')](saveUpdates(_0x361a57[_0x8d4a('0x43')],null))[_0x8d4a('0x21')](respondWithResult(_0x322422,null))[_0x8d4a('0x3f')](handleError(_0x322422,null));};exports[_0x8d4a('0x44')]=function(_0x3538cb,_0x58940b){return db[_0x8d4a('0x27')][_0x8d4a('0x41')]({'where':{'id':_0x3538cb[_0x8d4a('0x40')]['id']}})[_0x8d4a('0x21')](handleEntityNotFound(_0x58940b,null))[_0x8d4a('0x21')](removeEntity(_0x58940b,null))[_0x8d4a('0x3f')](handleError(_0x58940b,null));};exports[_0x8d4a('0x45')]=function(_0x215aeb,_0x1d2e4e){return db['FaxTransferReport']['describe']()['then'](respondWithResult(_0x1d2e4e,null))[_0x8d4a('0x3f')](handleError(_0x1d2e4e,null));}; \ No newline at end of file +var _0x6245=['offset','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','FaxTransferReport','findAll','rows','catch','show','params','intersection','fields','include','options','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6245,0x7a));var _0x5624=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x6245[_0x7729b1];return _0x349504;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5624('0x0'));var zipdir=require(_0x5624('0x1'));var jsonpatch=require(_0x5624('0x2'));var rp=require('request-promise');var moment=require(_0x5624('0x3'));var BPromise=require(_0x5624('0x4'));var Mustache=require(_0x5624('0x5'));var util=require(_0x5624('0x6'));var path=require(_0x5624('0x7'));var sox=require(_0x5624('0x8'));var csv=require(_0x5624('0x9'));var ejs=require(_0x5624('0xa'));var fs=require('fs');var fs_extra=require(_0x5624('0xb'));var _=require(_0x5624('0xc'));var squel=require(_0x5624('0xd'));var crypto=require(_0x5624('0xe'));var jsforce=require(_0x5624('0xf'));var deskjs=require(_0x5624('0x10'));var toCsv=require(_0x5624('0x9'));var querystring=require(_0x5624('0x11'));var Papa=require(_0x5624('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5624('0x13'));var as=require(_0x5624('0x14'));var hardwareService=require(_0x5624('0x15'));var logger=require(_0x5624('0x16'))('api');var utils=require(_0x5624('0x17'));var config=require(_0x5624('0x18'));var licenseUtil=require(_0x5624('0x19'));var db=require(_0x5624('0x1a'))['db'];function respondWithStatusCode(_0x59c734,_0x2ff160){_0x2ff160=_0x2ff160||0xcc;return function(_0x2d4c1b){if(_0x2d4c1b){return _0x59c734[_0x5624('0x1b')](_0x2ff160);}return _0x59c734[_0x5624('0x1c')](_0x2ff160)[_0x5624('0x1d')]();};}function respondWithResult(_0x1c1361,_0x3ed220){_0x3ed220=_0x3ed220||0xc8;return function(_0x456672){if(_0x456672){return _0x1c1361[_0x5624('0x1c')](_0x3ed220)[_0x5624('0x1e')](_0x456672);}};}function respondWithFilteredResult(_0xcd18bc,_0x5db462){return function(_0x222ec3){if(_0x222ec3){var _0x1f123d=typeof _0x5db462['offset']==='undefined'&&typeof _0x5db462['limit']===_0x5624('0x1f');var _0x3dcf85=_0x222ec3['count'];var _0x43baf5=_0x1f123d?0x0:_0x5db462[_0x5624('0x20')];var _0x23d93f=_0x1f123d?_0x222ec3[_0x5624('0x21')]:_0x5db462[_0x5624('0x20')]+_0x5db462['limit'];var _0x53883c;if(_0x23d93f>=_0x3dcf85){_0x23d93f=_0x3dcf85;_0x53883c=0xc8;}else{_0x53883c=0xce;}_0xcd18bc[_0x5624('0x1c')](_0x53883c);return _0xcd18bc[_0x5624('0x22')](_0x5624('0x23'),_0x43baf5+'-'+_0x23d93f+'/'+_0x3dcf85)[_0x5624('0x1e')](_0x222ec3);}return null;};}function patchUpdates(_0x2682af){return function(_0x4d85ef){try{jsonpatch['apply'](_0x4d85ef,_0x2682af,!![]);}catch(_0x4430b5){return BPromise[_0x5624('0x24')](_0x4430b5);}return _0x4d85ef[_0x5624('0x25')]();};}function saveUpdates(_0x12f5ca,_0x5d18c0){return function(_0x36ea1a){if(_0x36ea1a){return _0x36ea1a['update'](_0x12f5ca)[_0x5624('0x26')](function(_0x2370d8){return _0x2370d8;});}return null;};}function removeEntity(_0x5a4f10,_0x3cd7aa){return function(_0x635cd7){if(_0x635cd7){return _0x635cd7[_0x5624('0x27')]()['then'](function(){_0x5a4f10[_0x5624('0x1c')](0xcc)[_0x5624('0x1d')]();});}};}function handleEntityNotFound(_0x196c5b,_0x14da57){return function(_0x19782d){if(!_0x19782d){_0x196c5b[_0x5624('0x1b')](0x194);}return _0x19782d;};}function handleError(_0xa186ad,_0x496bc7){_0x496bc7=_0x496bc7||0x1f4;return function(_0x5225ee){logger[_0x5624('0x28')](_0x5225ee[_0x5624('0x29')]);if(_0x5225ee[_0x5624('0x2a')]){delete _0x5225ee[_0x5624('0x2a')];}_0xa186ad[_0x5624('0x1c')](_0x496bc7)[_0x5624('0x2b')](_0x5225ee);};}exports['index']=function(_0x1787c8,_0x5f1710){var _0x4e793c={},_0x4aa754={},_0x470696={'count':0x0,'rows':[]};var _0x2d2fed=_['map'](db['FaxTransferReport'][_0x5624('0x2c')],function(_0x60ecac){return{'name':_0x60ecac[_0x5624('0x2d')],'type':_0x60ecac[_0x5624('0x2e')][_0x5624('0x2f')]};});_0x4aa754['model']=_[_0x5624('0x30')](_0x2d2fed,_0x5624('0x2a'));_0x4aa754['query']=_[_0x5624('0x31')](_0x1787c8[_0x5624('0x32')]);_0x4aa754[_0x5624('0x33')]=_['intersection'](_0x4aa754[_0x5624('0x34')],_0x4aa754['query']);_0x4e793c['attributes']=_['intersection'](_0x4aa754[_0x5624('0x34')],qs['fields'](_0x1787c8[_0x5624('0x32')]['fields']));_0x4e793c[_0x5624('0x35')]=_0x4e793c[_0x5624('0x35')][_0x5624('0x36')]?_0x4e793c[_0x5624('0x35')]:_0x4aa754[_0x5624('0x34')];if(!_0x1787c8['query']['hasOwnProperty']('nolimit')){_0x4e793c['limit']=qs['limit'](_0x1787c8['query']['limit']);_0x4e793c[_0x5624('0x20')]=qs['offset'](_0x1787c8[_0x5624('0x32')][_0x5624('0x20')]);}_0x4e793c[_0x5624('0x37')]=qs[_0x5624('0x38')](_0x1787c8[_0x5624('0x32')][_0x5624('0x38')]);_0x4e793c[_0x5624('0x39')]=qs[_0x5624('0x33')](_[_0x5624('0x3a')](_0x1787c8[_0x5624('0x32')],_0x4aa754[_0x5624('0x33')]),_0x2d2fed);if(_0x1787c8[_0x5624('0x32')][_0x5624('0x3b')]){_0x4e793c[_0x5624('0x39')]=_[_0x5624('0x3c')](_0x4e793c[_0x5624('0x39')],{'$or':_['map'](_0x2d2fed,function(_0x3b779c){if(_0x3b779c[_0x5624('0x2e')]!==_0x5624('0x3d')){var _0x5af3a6={};_0x5af3a6[_0x3b779c[_0x5624('0x2a')]]={'$like':'%'+_0x1787c8[_0x5624('0x32')][_0x5624('0x3b')]+'%'};return _0x5af3a6;}})});}_0x4e793c=_[_0x5624('0x3c')]({},_0x4e793c,_0x1787c8['options']);var _0x355322={'where':_0x4e793c[_0x5624('0x39')]};return db[_0x5624('0x3e')]['count'](_0x355322)[_0x5624('0x26')](function(_0x461a93){_0x470696[_0x5624('0x21')]=_0x461a93;if(_0x1787c8[_0x5624('0x32')]['includeAll']){_0x4e793c['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x5624('0x3f')](_0x4e793c);})[_0x5624('0x26')](function(_0x59ab5a){_0x470696[_0x5624('0x40')]=_0x59ab5a;return _0x470696;})['then'](respondWithFilteredResult(_0x5f1710,_0x4e793c))[_0x5624('0x41')](handleError(_0x5f1710,null));};exports[_0x5624('0x42')]=function(_0x5b068e,_0x1990e6){var _0x34b5c3={'raw':!![],'where':{'id':_0x5b068e[_0x5624('0x43')]['id']}},_0x4a42df={};_0x4a42df['model']=_[_0x5624('0x31')](db[_0x5624('0x3e')][_0x5624('0x2c')]);_0x4a42df[_0x5624('0x32')]=_[_0x5624('0x31')](_0x5b068e['query']);_0x4a42df['filters']=_[_0x5624('0x44')](_0x4a42df[_0x5624('0x34')],_0x4a42df[_0x5624('0x32')]);_0x34b5c3['attributes']=_['intersection'](_0x4a42df[_0x5624('0x34')],qs[_0x5624('0x45')](_0x5b068e[_0x5624('0x32')]['fields']));_0x34b5c3['attributes']=_0x34b5c3['attributes']['length']?_0x34b5c3[_0x5624('0x35')]:_0x4a42df['model'];if(_0x5b068e['query']['includeAll']){_0x34b5c3[_0x5624('0x46')]=[{'all':!![]}];}_0x34b5c3=_[_0x5624('0x3c')]({},_0x34b5c3,_0x5b068e[_0x5624('0x47')]);return db[_0x5624('0x3e')][_0x5624('0x48')](_0x34b5c3)[_0x5624('0x26')](handleEntityNotFound(_0x1990e6,null))[_0x5624('0x26')](respondWithResult(_0x1990e6,null))['catch'](handleError(_0x1990e6,null));};exports[_0x5624('0x49')]=function(_0x3df8c7,_0x33700a){return db[_0x5624('0x3e')]['create'](_0x3df8c7[_0x5624('0x4a')],{})['then'](respondWithResult(_0x33700a,0xc9))[_0x5624('0x41')](handleError(_0x33700a,null));};exports[_0x5624('0x4b')]=function(_0x4ff769,_0x2dd9f6){if(_0x4ff769[_0x5624('0x4a')]['id']){delete _0x4ff769['body']['id'];}return db[_0x5624('0x3e')][_0x5624('0x48')]({'where':{'id':_0x4ff769[_0x5624('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dd9f6,null))[_0x5624('0x26')](saveUpdates(_0x4ff769['body'],null))[_0x5624('0x26')](respondWithResult(_0x2dd9f6,null))[_0x5624('0x41')](handleError(_0x2dd9f6,null));};exports[_0x5624('0x27')]=function(_0x26be7b,_0x5a9e3f){return db['FaxTransferReport'][_0x5624('0x48')]({'where':{'id':_0x26be7b[_0x5624('0x43')]['id']}})[_0x5624('0x26')](handleEntityNotFound(_0x5a9e3f,null))[_0x5624('0x26')](removeEntity(_0x5a9e3f,null))[_0x5624('0x41')](handleError(_0x5a9e3f,null));};exports[_0x5624('0x4c')]=function(_0x22589a,_0x47daaf){return db[_0x5624('0x3e')][_0x5624('0x4c')]()[_0x5624('0x26')](respondWithResult(_0x47daaf,null))[_0x5624('0x41')](handleError(_0x47daaf,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 9ebb766..00ef872 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbd5=['../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','util','api','bluebird','request-promise','path','rimraf'];(function(_0x4333d9,_0x19ed89){var _0x212cfb=function(_0x5a2bfb){while(--_0x5a2bfb){_0x4333d9['push'](_0x4333d9['shift']());}};_0x212cfb(++_0x19ed89);}(_0xfbd5,0x7e));var _0x5fbd=function(_0x157f32,_0x385930){_0x157f32=_0x157f32-0x0;var _0x29021c=_0xfbd5[_0x157f32];return _0x29021c;};'use strict';var _=require('lodash');var util=require(_0x5fbd('0x0'));var logger=require('../../config/logger')(_0x5fbd('0x1'));var moment=require('moment');var BPromise=require(_0x5fbd('0x2'));var rp=require(_0x5fbd('0x3'));var fs=require('fs');var path=require(_0x5fbd('0x4'));var rimraf=require(_0x5fbd('0x5'));var config=require(_0x5fbd('0x6'));var attributes=require(_0x5fbd('0x7'));module[_0x5fbd('0x8')]=function(_0x882036,_0x56fdaa){return _0x882036[_0x5fbd('0x9')](_0x5fbd('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x5fbd('0xb'),'fields':[_0x5fbd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9571=['FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0x9571,0x1c2));var _0x1957=function(_0x104993,_0x3f9a6b){_0x104993=_0x104993-0x0;var _0x105a96=_0x9571[_0x104993];return _0x105a96;};'use strict';var _=require(_0x1957('0x0'));var util=require(_0x1957('0x1'));var logger=require(_0x1957('0x2'))(_0x1957('0x3'));var moment=require(_0x1957('0x4'));var BPromise=require(_0x1957('0x5'));var rp=require(_0x1957('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1957('0x7'));var config=require(_0x1957('0x8'));var attributes=require(_0x1957('0x9'));module[_0x1957('0xa')]=function(_0x1d0c37,_0x37bc29){return _0x1d0c37[_0x1957('0xb')](_0x1957('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1957('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 25d21cf..6b2988a 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc80f=['request\x20sent','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5eeb43,_0x5b900c){var _0x54aa94=function(_0x1d09b0){while(--_0x1d09b0){_0x5eeb43['push'](_0x5eeb43['shift']());}};_0x54aa94(++_0x5b900c);}(_0xc80f,0x102));var _0xfc80=function(_0x46ae40,_0x3f37bc){_0x46ae40=_0x46ae40-0x0;var _0x33785c=_0xc80f[_0x46ae40];return _0x33785c;};'use strict';var _=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var moment=require(_0xfc80('0x2'));var BPromise=require(_0xfc80('0x3'));var rs=require(_0xfc80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc80('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc80('0x6'))('rpc');var config=require(_0xfc80('0x7'));var jayson=require(_0xfc80('0x8'));var client=jayson[_0xfc80('0x9')][_0xfc80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dfc24,_0x5b416f,_0x1fb974){return new BPromise(function(_0x24c973,_0x2679bb){return client[_0xfc80('0xb')](_0x2dfc24,_0x1fb974)['then'](function(_0x571b12){logger['info'](_0xfc80('0xc'),_0x5b416f,'request\x20sent');logger[_0xfc80('0xd')](_0xfc80('0xe'),_0x5b416f,_0xfc80('0xf'),JSON[_0xfc80('0x10')](_0x571b12));if(_0x571b12[_0xfc80('0x11')]){if(_0x571b12[_0xfc80('0x11')]['code']===0x1f4){logger[_0xfc80('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x5b416f,_0x571b12[_0xfc80('0x11')][_0xfc80('0x12')]);return _0x2679bb(_0x571b12[_0xfc80('0x11')][_0xfc80('0x12')]);}logger['error'](_0xfc80('0xc'),_0x5b416f,_0x571b12['error'][_0xfc80('0x12')]);return _0x24c973(_0x571b12[_0xfc80('0x11')]['message']);}else{logger[_0xfc80('0x13')](_0xfc80('0xc'),_0x5b416f,_0xfc80('0xf'));_0x24c973(_0x571b12['result'][_0xfc80('0x12')]);}})[_0xfc80('0x14')](function(_0x3dba24){logger[_0xfc80('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x5b416f,_0x3dba24);_0x2679bb(_0x3dba24);});});} \ No newline at end of file +var _0x4d03=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x274dda,_0x17793a){var _0x1a0c75=function(_0x226ff0){while(--_0x226ff0){_0x274dda['push'](_0x274dda['shift']());}};_0x1a0c75(++_0x17793a);}(_0x4d03,0x172));var _0x34d0=function(_0xee9423,_0x1f99ab){_0xee9423=_0xee9423-0x0;var _0x4fad34=_0x4d03[_0xee9423];return _0x4fad34;};'use strict';var _=require('lodash');var util=require(_0x34d0('0x0'));var moment=require(_0x34d0('0x1'));var BPromise=require('bluebird');var rs=require(_0x34d0('0x2'));var fs=require('fs');var Redis=require(_0x34d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x34d0('0x4'));var logger=require('../../config/logger')(_0x34d0('0x5'));var config=require('../../config/environment');var jayson=require(_0x34d0('0x6'));var client=jayson['client'][_0x34d0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x978bb3,_0x2318e2,_0x398f1b){return new BPromise(function(_0x173d01,_0x193f88){return client[_0x34d0('0x8')](_0x978bb3,_0x398f1b)[_0x34d0('0x9')](function(_0x2857e3){logger[_0x34d0('0xa')](_0x34d0('0xb'),_0x2318e2,_0x34d0('0xc'));logger['debug'](_0x34d0('0xd'),_0x2318e2,'request\x20sent',JSON[_0x34d0('0xe')](_0x2857e3));if(_0x2857e3['error']){if(_0x2857e3[_0x34d0('0xf')][_0x34d0('0x10')]===0x1f4){logger[_0x34d0('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2318e2,_0x2857e3[_0x34d0('0xf')][_0x34d0('0x11')]);return _0x193f88(_0x2857e3['error']['message']);}logger[_0x34d0('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2318e2,_0x2857e3[_0x34d0('0xf')][_0x34d0('0x11')]);return _0x173d01(_0x2857e3['error'][_0x34d0('0x11')]);}else{logger['info'](_0x34d0('0xb'),_0x2318e2,_0x34d0('0xc'));_0x173d01(_0x2857e3[_0x34d0('0x12')][_0x34d0('0x11')]);}})[_0x34d0('0x13')](function(_0x390401){logger[_0x34d0('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2318e2,_0x390401);_0x193f88(_0x390401);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index e1e979e..0a2a552 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12a8=['destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','delete'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x12a8,0xce));var _0x812a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x12a8[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x812a('0x0'));var express=require(_0x812a('0x1'));var router=express[_0x812a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x812a('0x3'));var config=require(_0x812a('0x4'));var controller=require(_0x812a('0x5'));router[_0x812a('0x6')]('/',auth['isAuthenticated'](),controller[_0x812a('0x7')]);router[_0x812a('0x6')](_0x812a('0x8'),auth[_0x812a('0x9')](),controller[_0x812a('0xa')]);router['get'](_0x812a('0xb'),auth[_0x812a('0x9')](),controller[_0x812a('0xc')]);router['post']('/',auth[_0x812a('0x9')](),controller['create']);router[_0x812a('0xd')](_0x812a('0xb'),auth[_0x812a('0x9')](),controller['update']);router[_0x812a('0xe')](_0x812a('0xb'),auth[_0x812a('0x9')](),controller[_0x812a('0xf')]);module[_0x812a('0x10')]=router; \ No newline at end of file +var _0x7f5e=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ba877,_0x173618){var _0x28c592=function(_0x578368){while(--_0x578368){_0x4ba877['push'](_0x4ba877['shift']());}};_0x28c592(++_0x173618);}(_0x7f5e,0x78));var _0xe7f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f5e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe7f5('0x0'));var path=require(_0xe7f5('0x1'));var timeout=require('connect-timeout');var express=require(_0xe7f5('0x2'));var router=express[_0xe7f5('0x3')]();var fs_extra=require(_0xe7f5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe7f5('0x5'));var config=require(_0xe7f5('0x6'));var controller=require(_0xe7f5('0x7'));router[_0xe7f5('0x8')]('/',auth[_0xe7f5('0x9')](),controller['index']);router[_0xe7f5('0x8')](_0xe7f5('0xa'),auth[_0xe7f5('0x9')](),controller[_0xe7f5('0xb')]);router[_0xe7f5('0x8')]('/:id',auth[_0xe7f5('0x9')](),controller[_0xe7f5('0xc')]);router[_0xe7f5('0xd')]('/',auth[_0xe7f5('0x9')](),controller[_0xe7f5('0xe')]);router[_0xe7f5('0xf')](_0xe7f5('0x10'),auth['isAuthenticated'](),controller[_0xe7f5('0x11')]);router[_0xe7f5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe7f5('0x13')]);module[_0xe7f5('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index c5e73d5..a6c0e91 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46e5=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0xa9f756,_0x48c454){var _0x10fcdb=function(_0x4c291f){while(--_0x4c291f){_0xa9f756['push'](_0xa9f756['shift']());}};_0x10fcdb(++_0x48c454);}(_0x46e5,0x11c));var _0x546e=function(_0x521b12,_0x1a0f54){_0x521b12=_0x521b12-0x0;var _0x41b937=_0x46e5[_0x521b12];return _0x41b937;};'use strict';var multer=require(_0x546e('0x0'));var util=require(_0x546e('0x1'));var path=require(_0x546e('0x2'));var timeout=require(_0x546e('0x3'));var express=require('express');var router=express[_0x546e('0x4')]();var fs_extra=require(_0x546e('0x5'));var auth=require(_0x546e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x546e('0x7'));var controller=require('./intDeskAccount.controller');router[_0x546e('0x8')]('/',auth['isAuthenticated'](),controller[_0x546e('0x9')]);router[_0x546e('0x8')](_0x546e('0xa'),auth[_0x546e('0xb')](),controller[_0x546e('0xc')]);router[_0x546e('0x8')](_0x546e('0xd'),auth[_0x546e('0xb')](),controller[_0x546e('0xe')]);router[_0x546e('0x8')](_0x546e('0xf'),auth[_0x546e('0xb')](),controller[_0x546e('0x10')]);router[_0x546e('0x11')]('/',auth['isAuthenticated'](),controller[_0x546e('0x12')]);router[_0x546e('0x11')]('/:id/configurations',auth[_0x546e('0xb')](),controller[_0x546e('0x13')]);router[_0x546e('0x14')](_0x546e('0xa'),auth[_0x546e('0xb')](),controller[_0x546e('0x15')]);router[_0x546e('0x16')](_0x546e('0xa'),auth[_0x546e('0xb')](),controller[_0x546e('0x17')]);module['exports']=router; \ No newline at end of file +var _0xc6b3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','show','get','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xc6b3,0x6c));var _0x3c6b=function(_0x211f66,_0x6d409f){_0x211f66=_0x211f66-0x0;var _0x324240=_0xc6b3[_0x211f66];return _0x324240;};'use strict';var multer=require(_0x3c6b('0x0'));var util=require(_0x3c6b('0x1'));var path=require(_0x3c6b('0x2'));var timeout=require(_0x3c6b('0x3'));var express=require(_0x3c6b('0x4'));var router=express[_0x3c6b('0x5')]();var fs_extra=require(_0x3c6b('0x6'));var auth=require(_0x3c6b('0x7'));var interaction=require(_0x3c6b('0x8'));var config=require(_0x3c6b('0x9'));var controller=require(_0x3c6b('0xa'));router['get']('/',auth[_0x3c6b('0xb')](),controller[_0x3c6b('0xc')]);router['get'](_0x3c6b('0xd'),auth['isAuthenticated'](),controller[_0x3c6b('0xe')]);router[_0x3c6b('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3c6b('0x10')]);router[_0x3c6b('0xf')](_0x3c6b('0x11'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x12')]);router[_0x3c6b('0x13')]('/',auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x14')]);router[_0x3c6b('0x13')](_0x3c6b('0x15'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x16')]);router[_0x3c6b('0x17')](_0x3c6b('0xd'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x18')]);router[_0x3c6b('0x19')](_0x3c6b('0xd'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 0dc5a44..94383c3 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79a5=['integrationTab','newTab','exports','STRING','ENUM','basic'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x79a5,0x176));var _0x579a=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x79a5[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require('sequelize');module[_0x579a('0x0')]={'name':{'type':Sequelize[_0x579a('0x1')]},'description':{'type':Sequelize[_0x579a('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x579a('0x1')]},'authType':{'type':Sequelize[_0x579a('0x2')](_0x579a('0x3')),'defaultValue':_0x579a('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x579a('0x1')]},'consumerSecret':{'type':Sequelize[_0x579a('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x579a('0x1')]},'serverUrl':{'type':Sequelize[_0x579a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x579a('0x4'),_0x579a('0x5')),'defaultValue':_0x579a('0x4')}}; \ No newline at end of file +var _0xd071=['basic','newTab','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x33c56d,_0x45e310){var _0x4c817d=function(_0x5dab38){while(--_0x5dab38){_0x33c56d['push'](_0x33c56d['shift']());}};_0x4c817d(++_0x45e310);}(_0xd071,0xf1));var _0x1d07=function(_0x593d57,_0x58e667){_0x593d57=_0x593d57-0x0;var _0xf7676a=_0xd071[_0x593d57];return _0xf7676a;};'use strict';var Sequelize=require(_0x1d07('0x0'));module[_0x1d07('0x1')]={'name':{'type':Sequelize[_0x1d07('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1d07('0x2')]},'authType':{'type':Sequelize[_0x1d07('0x3')](_0x1d07('0x4')),'defaultValue':_0x1d07('0x4')},'password':{'type':Sequelize[_0x1d07('0x2')]},'consumerKey':{'type':Sequelize[_0x1d07('0x2')]},'consumerSecret':{'type':Sequelize[_0x1d07('0x2')]},'token':{'type':Sequelize[_0x1d07('0x2')]},'tokenSecret':{'type':Sequelize[_0x1d07('0x2')]},'serverUrl':{'type':Sequelize[_0x1d07('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1d07('0x3')]('integrationTab',_0x1d07('0x5')),'defaultValue':_0x1d07('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 4065189..0359933 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f8f=['getSubjects','Descriptions','getDescriptions','channel','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','substring','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','DeskAccount','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','AccountId'];(function(_0x3c8609,_0x23a747){var _0x4b2e40=function(_0x1297ed){while(--_0x1297ed){_0x3c8609['push'](_0x3c8609['shift']());}};_0x4b2e40(++_0x23a747);}(_0x7f8f,0xff));var _0xf7f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f8f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7f8('0x0'));var zipdir=require(_0xf7f8('0x1'));var jsonpatch=require(_0xf7f8('0x2'));var rp=require(_0xf7f8('0x3'));var moment=require(_0xf7f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7f8('0x5'));var util=require(_0xf7f8('0x6'));var path=require(_0xf7f8('0x7'));var sox=require('sox');var csv=require(_0xf7f8('0x8'));var ejs=require(_0xf7f8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7f8('0xa'));var squel=require(_0xf7f8('0xb'));var crypto=require(_0xf7f8('0xc'));var jsforce=require(_0xf7f8('0xd'));var deskjs=require(_0xf7f8('0xe'));var toCsv=require(_0xf7f8('0x8'));var querystring=require('querystring');var Papa=require(_0xf7f8('0xf'));var Redis=require(_0xf7f8('0x10'));var authService=require(_0xf7f8('0x11'));var qs=require(_0xf7f8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf7f8('0x13'));var config=require(_0xf7f8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf7f8('0x15'))['db'];var integrations=require(_0xf7f8('0x16'));function respondWithStatusCode(_0x62643c,_0x3bdc9d){_0x3bdc9d=_0x3bdc9d||0xcc;return function(_0x141868){if(_0x141868){return _0x62643c[_0xf7f8('0x17')](_0x3bdc9d);}return _0x62643c[_0xf7f8('0x18')](_0x3bdc9d)['end']();};}function respondWithResult(_0x2d9142,_0x4b12a1){_0x4b12a1=_0x4b12a1||0xc8;return function(_0x533161){if(_0x533161){return _0x2d9142['status'](_0x4b12a1)[_0xf7f8('0x19')](_0x533161);}};}function respondWithFilteredResult(_0x5a61c1,_0x399e1e){return function(_0xa801c3){if(_0xa801c3){var _0xea821d=typeof _0x399e1e[_0xf7f8('0x1a')]===_0xf7f8('0x1b')&&typeof _0x399e1e[_0xf7f8('0x1c')]==='undefined';var _0x3f6c76=_0xa801c3[_0xf7f8('0x1d')];var _0x2aca2b=_0xea821d?0x0:_0x399e1e[_0xf7f8('0x1a')];var _0x47a789=_0xea821d?_0xa801c3[_0xf7f8('0x1d')]:_0x399e1e[_0xf7f8('0x1a')]+_0x399e1e[_0xf7f8('0x1c')];var _0x14ca29;if(_0x47a789>=_0x3f6c76){_0x47a789=_0x3f6c76;_0x14ca29=0xc8;}else{_0x14ca29=0xce;}_0x5a61c1[_0xf7f8('0x18')](_0x14ca29);return _0x5a61c1[_0xf7f8('0x1e')](_0xf7f8('0x1f'),_0x2aca2b+'-'+_0x47a789+'/'+_0x3f6c76)['json'](_0xa801c3);}return null;};}function patchUpdates(_0x558834){return function(_0x517731){try{jsonpatch[_0xf7f8('0x20')](_0x517731,_0x558834,!![]);}catch(_0xc26f90){return BPromise[_0xf7f8('0x21')](_0xc26f90);}return _0x517731[_0xf7f8('0x22')]();};}function saveUpdates(_0x2f80b3,_0x32a051){return function(_0x241717){if(_0x241717){return _0x241717[_0xf7f8('0x23')](_0x2f80b3)[_0xf7f8('0x24')](function(_0x469125){return _0x469125;});}return null;};}function removeEntity(_0x41abef,_0x46e233){return function(_0x330c70){if(_0x330c70){return _0x330c70['destroy']()[_0xf7f8('0x24')](function(){_0x41abef[_0xf7f8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x95ab84,_0xbdbca3){return function(_0x4e33b0){if(!_0x4e33b0){_0x95ab84[_0xf7f8('0x17')](0x194);}return _0x4e33b0;};}function handleError(_0x53d4a1,_0x4103e1){_0x4103e1=_0x4103e1||0x1f4;return function(_0x3fb8ef){logger[_0xf7f8('0x25')](_0x3fb8ef[_0xf7f8('0x26')]);if(_0x3fb8ef['name']){delete _0x3fb8ef[_0xf7f8('0x27')];}_0x53d4a1[_0xf7f8('0x18')](_0x4103e1)['send'](_0x3fb8ef);};}exports[_0xf7f8('0x28')]=function(_0x154b14,_0x301f8f){var _0x20669f={},_0x55be1d={},_0x5a96a4={'count':0x0,'rows':[]};var _0x3c8282=_[_0xf7f8('0x29')](db[_0xf7f8('0x2a')]['rawAttributes'],function(_0x1e9b7b){return{'name':_0x1e9b7b[_0xf7f8('0x2b')],'type':_0x1e9b7b[_0xf7f8('0x2c')][_0xf7f8('0x2d')]};});_0x55be1d[_0xf7f8('0x2e')]=_[_0xf7f8('0x29')](_0x3c8282,_0xf7f8('0x27'));_0x55be1d['query']=_[_0xf7f8('0x2f')](_0x154b14[_0xf7f8('0x30')]);_0x55be1d[_0xf7f8('0x31')]=_[_0xf7f8('0x32')](_0x55be1d[_0xf7f8('0x2e')],_0x55be1d['query']);_0x20669f['attributes']=_['intersection'](_0x55be1d[_0xf7f8('0x2e')],qs[_0xf7f8('0x33')](_0x154b14['query'][_0xf7f8('0x33')]));_0x20669f[_0xf7f8('0x34')]=_0x20669f[_0xf7f8('0x34')][_0xf7f8('0x35')]?_0x20669f[_0xf7f8('0x34')]:_0x55be1d[_0xf7f8('0x2e')];if(!_0x154b14[_0xf7f8('0x30')][_0xf7f8('0x36')](_0xf7f8('0x37'))){_0x20669f['limit']=qs[_0xf7f8('0x1c')](_0x154b14[_0xf7f8('0x30')][_0xf7f8('0x1c')]);_0x20669f[_0xf7f8('0x1a')]=qs['offset'](_0x154b14[_0xf7f8('0x30')][_0xf7f8('0x1a')]);}_0x20669f[_0xf7f8('0x38')]=qs[_0xf7f8('0x39')](_0x154b14[_0xf7f8('0x30')][_0xf7f8('0x39')]);_0x20669f['where']=qs[_0xf7f8('0x31')](_['pick'](_0x154b14['query'],_0x55be1d[_0xf7f8('0x31')]),_0x3c8282);if(_0x154b14['query'][_0xf7f8('0x3a')]){_0x20669f[_0xf7f8('0x3b')]=_['merge'](_0x20669f[_0xf7f8('0x3b')],{'$or':_[_0xf7f8('0x29')](_0x3c8282,function(_0x1b5107){if(_0x1b5107['type']!==_0xf7f8('0x3c')){var _0x2334a6={};_0x2334a6[_0x1b5107[_0xf7f8('0x27')]]={'$like':'%'+_0x154b14[_0xf7f8('0x30')]['filter']+'%'};return _0x2334a6;}})});}_0x20669f=_[_0xf7f8('0x3d')]({},_0x20669f,_0x154b14['options']);var _0xd70ac5={'where':_0x20669f[_0xf7f8('0x3b')]};return db[_0xf7f8('0x2a')][_0xf7f8('0x1d')](_0xd70ac5)[_0xf7f8('0x24')](function(_0x54dd3b){_0x5a96a4['count']=_0x54dd3b;if(_0x154b14[_0xf7f8('0x30')][_0xf7f8('0x3e')]){_0x20669f['include']=[{'all':!![]}];}return db[_0xf7f8('0x2a')][_0xf7f8('0x3f')](_0x20669f);})[_0xf7f8('0x24')](function(_0x366a21){_0x5a96a4[_0xf7f8('0x40')]=_0x366a21;return _0x5a96a4;})[_0xf7f8('0x24')](respondWithFilteredResult(_0x301f8f,_0x20669f))[_0xf7f8('0x41')](handleError(_0x301f8f,null));};exports[_0xf7f8('0x42')]=function(_0x2ba1ce,_0x397b30){var _0x38e313={'raw':![],'where':{'id':_0x2ba1ce[_0xf7f8('0x43')]['id']}},_0x5f477c={};_0x5f477c['model']=_[_0xf7f8('0x2f')](db['DeskAccount'][_0xf7f8('0x44')]);_0x5f477c[_0xf7f8('0x30')]=_['keys'](_0x2ba1ce[_0xf7f8('0x30')]);_0x5f477c[_0xf7f8('0x31')]=_[_0xf7f8('0x32')](_0x5f477c[_0xf7f8('0x2e')],_0x5f477c[_0xf7f8('0x30')]);_0x38e313[_0xf7f8('0x34')]=_[_0xf7f8('0x32')](_0x5f477c['model'],qs['fields'](_0x2ba1ce[_0xf7f8('0x30')][_0xf7f8('0x33')]));_0x38e313[_0xf7f8('0x34')]=_0x38e313[_0xf7f8('0x34')][_0xf7f8('0x35')]?_0x38e313[_0xf7f8('0x34')]:_0x5f477c[_0xf7f8('0x2e')];if(_0x2ba1ce[_0xf7f8('0x30')][_0xf7f8('0x3e')]){_0x38e313[_0xf7f8('0x45')]=[{'all':!![]}];}_0x38e313=_[_0xf7f8('0x3d')]({},_0x38e313,_0x2ba1ce['options']);return db[_0xf7f8('0x2a')][_0xf7f8('0x46')](_0x38e313)[_0xf7f8('0x24')](handleEntityNotFound(_0x397b30,null))['then'](respondWithResult(_0x397b30,null))[_0xf7f8('0x41')](handleError(_0x397b30,null));};exports[_0xf7f8('0x47')]=function(_0x4da91a,_0x4fbeaf){return db[_0xf7f8('0x2a')]['create'](_0x4da91a[_0xf7f8('0x48')],{})[_0xf7f8('0x24')](respondWithResult(_0x4fbeaf,0xc9))[_0xf7f8('0x41')](handleError(_0x4fbeaf,null));};exports[_0xf7f8('0x23')]=function(_0x37f459,_0x2785cd){if(_0x37f459[_0xf7f8('0x48')]['id']){delete _0x37f459[_0xf7f8('0x48')]['id'];}return db[_0xf7f8('0x2a')]['find']({'where':{'id':_0x37f459[_0xf7f8('0x43')]['id']}})[_0xf7f8('0x24')](handleEntityNotFound(_0x2785cd,null))[_0xf7f8('0x24')](saveUpdates(_0x37f459[_0xf7f8('0x48')],null))[_0xf7f8('0x24')](respondWithResult(_0x2785cd,null))['catch'](handleError(_0x2785cd,null));};exports['destroy']=function(_0x2b94c1,_0x89f09f){return db['DeskAccount'][_0xf7f8('0x46')]({'where':{'id':_0x2b94c1[_0xf7f8('0x43')]['id']}})[_0xf7f8('0x24')](handleEntityNotFound(_0x89f09f,null))['then'](removeEntity(_0x89f09f,null))[_0xf7f8('0x41')](handleError(_0x89f09f,null));};exports[_0xf7f8('0x49')]=function(_0x2bc67,_0x16d07e,_0x1f196d){var _0x2f23fd={};var _0x363575={};var _0x24143b;var _0x417480;return db['DeskAccount'][_0xf7f8('0x4a')]({'where':{'id':_0x2bc67[_0xf7f8('0x43')]['id']}})[_0xf7f8('0x24')](handleEntityNotFound(_0x16d07e,null))[_0xf7f8('0x24')](function(_0xf35f41){if(_0xf35f41){_0x24143b=_0xf35f41;_0x363575[_0xf7f8('0x2e')]=_[_0xf7f8('0x2f')](db[_0xf7f8('0x4b')][_0xf7f8('0x44')]);_0x363575[_0xf7f8('0x30')]=_[_0xf7f8('0x2f')](_0x2bc67[_0xf7f8('0x30')]);_0x363575['filters']=_[_0xf7f8('0x32')](_0x363575['model'],_0x363575[_0xf7f8('0x30')]);_0x2f23fd[_0xf7f8('0x34')]=_[_0xf7f8('0x32')](_0x363575[_0xf7f8('0x2e')],qs[_0xf7f8('0x33')](_0x2bc67[_0xf7f8('0x30')][_0xf7f8('0x33')]));_0x2f23fd[_0xf7f8('0x34')]=_0x2f23fd['attributes'][_0xf7f8('0x35')]?_0x2f23fd['attributes']:_0x363575[_0xf7f8('0x2e')];_0x2f23fd['order']=qs[_0xf7f8('0x39')](_0x2bc67[_0xf7f8('0x30')][_0xf7f8('0x39')]);_0x2f23fd[_0xf7f8('0x3b')]=qs['filters'](_[_0xf7f8('0x4c')](_0x2bc67[_0xf7f8('0x30')],_0x363575[_0xf7f8('0x31')]));if(_0x2bc67[_0xf7f8('0x30')][_0xf7f8('0x3a')]){_0x2f23fd[_0xf7f8('0x3b')]=_['merge'](_0x2f23fd[_0xf7f8('0x3b')],{'$or':_[_0xf7f8('0x29')](_0x2f23fd[_0xf7f8('0x34')],function(_0x4d0d69){var _0x9f3e6a={};_0x9f3e6a[_0x4d0d69]={'$like':'%'+_0x2bc67[_0xf7f8('0x30')]['filter']+'%'};return _0x9f3e6a;})});}_0x2f23fd=_[_0xf7f8('0x3d')]({},_0x2f23fd,_0x2bc67['options']);return _0x24143b[_0xf7f8('0x49')](_0x2f23fd);}})[_0xf7f8('0x24')](function(_0x3175e5){if(_0x3175e5){_0x417480=_0x3175e5[_0xf7f8('0x35')];if(!_0x2bc67[_0xf7f8('0x30')][_0xf7f8('0x36')](_0xf7f8('0x37'))){_0x2f23fd[_0xf7f8('0x1c')]=qs[_0xf7f8('0x1c')](_0x2bc67['query'][_0xf7f8('0x1c')]);_0x2f23fd[_0xf7f8('0x1a')]=qs['offset'](_0x2bc67[_0xf7f8('0x30')][_0xf7f8('0x1a')]);}return _0x24143b[_0xf7f8('0x49')](_0x2f23fd);}})['then'](function(_0x21f439){if(_0x21f439){return _0x21f439?{'count':_0x417480,'rows':_0x21f439}:null;}})[_0xf7f8('0x24')](respondWithResult(_0x16d07e,null))[_0xf7f8('0x41')](handleError(_0x16d07e,null));};exports['addConfiguration']=function(_0x3739f9,_0x34e79e,_0x1eac8b){if(_0x3739f9[_0xf7f8('0x48')]['id']){delete _0x3739f9[_0xf7f8('0x48')]['id'];}return db['DeskAccount'][_0xf7f8('0x4a')]({'where':{'id':_0x3739f9[_0xf7f8('0x43')]['id']}})['then'](handleEntityNotFound(_0x34e79e,null))[_0xf7f8('0x24')](function(_0x5bbd79){if(_0x5bbd79){_0x3739f9[_0xf7f8('0x48')][_0xf7f8('0x4d')]=_0x5bbd79['id'];_0x3739f9[_0xf7f8('0x48')]['Subjects']=integrations[_0xf7f8('0x4e')](_0x3739f9[_0xf7f8('0x48')]['channel'],_0x3739f9[_0xf7f8('0x48')][_0xf7f8('0x2c')]);_0x3739f9[_0xf7f8('0x48')][_0xf7f8('0x4f')]=integrations[_0xf7f8('0x50')](_0x3739f9[_0xf7f8('0x48')][_0xf7f8('0x51')],_0x3739f9[_0xf7f8('0x48')]['type']);return db[_0xf7f8('0x4b')][_0xf7f8('0x47')](_0x3739f9[_0xf7f8('0x48')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0xf7f8('0x4f')}]});}return null;})[_0xf7f8('0x24')](respondWithResult(_0x34e79e,null))[_0xf7f8('0x41')](handleError(_0x34e79e,null));};exports[_0xf7f8('0x52')]=function(_0xcca410,_0x25eb1e,_0x5cf255){var _0x28ce49=[{'name':_0xf7f8('0x53'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3aa613='';return db[_0xf7f8('0x2a')]['findOne']({'where':{'id':_0xcca410['params']['id']},'attributes':['id',_0xf7f8('0x54'),_0xf7f8('0x55'),_0xf7f8('0x56'),_0xf7f8('0x57'),_0xf7f8('0x58'),_0xf7f8('0x59'),'token',_0xf7f8('0x5a')]})[_0xf7f8('0x24')](handleEntityNotFound(_0x25eb1e,null))[_0xf7f8('0x24')](function(_0x3c49fc){if(_0x3c49fc){_0x3aa613=_0x3c49fc[_0xf7f8('0x54')];var _0x30f8d5=_0x3aa613['slice'](-0x1);if(_0x30f8d5==='/'){_0x3aa613=_0x3aa613[_0xf7f8('0x5b')](0x0,_0x3aa613['lastIndexOf'](_0x30f8d5));}var _0x1947e3={'method':'GET','uri':util[_0xf7f8('0x5c')](_0xf7f8('0x5d'),_0x3aa613),'headers':{'Content-Type':_0xf7f8('0x5e'),'Accept':_0xf7f8('0x5e')},'json':!![]};if(_0x3c49fc['authType']==='basic'){_0x1947e3[_0xf7f8('0x5f')][_0xf7f8('0x60')]=util[_0xf7f8('0x5c')](_0xf7f8('0x61'),new Buffer(util[_0xf7f8('0x5c')](_0xf7f8('0x62'),_0x3c49fc['username'],_0x3c49fc[_0xf7f8('0x57')]))[_0xf7f8('0x63')](_0xf7f8('0x64')));}return rp(_0x1947e3)[_0xf7f8('0x24')](function(_0x3b7345){return _0x28ce49[_0xf7f8('0x65')](_['map'](_0x3b7345[_0xf7f8('0x66')][_0xf7f8('0x67')],function(_0x1cb903){return{'id':_0x1cb903[_0xf7f8('0x27')],'name':_0x1cb903[_0xf7f8('0x27')],'type':_0x1cb903['type'],'active':_0x1cb903[_0xf7f8('0x68')],'label':_0x1cb903['label'],'custom':!![]};}));});}})[_0xf7f8('0x24')](function(_0x1725ab){return{'count':_0x1725ab[_0xf7f8('0x35')],'rows':_0x1725ab};})[_0xf7f8('0x24')](respondWithResult(_0x25eb1e,null))[_0xf7f8('0x41')](function(_0x141c2b){var _0x5d2615=_0xcca410[_0xf7f8('0x30')][_0xf7f8('0x69')]?0x1f4:_0x141c2b[_0xf7f8('0x6a')]||0x1f4;logger['error'](_0xf7f8('0x6b'),_0xf7f8('0x52'),_0x5d2615,JSON[_0xf7f8('0x6c')](_0x141c2b));delete _0x141c2b[_0xf7f8('0x27')];if(_0x5d2615===0x191){_0x5d2615=0x190;}_0x25eb1e[_0xf7f8('0x18')](_0x5d2615)[_0xf7f8('0x6d')](_0xcca410[_0xf7f8('0x30')][_0xf7f8('0x69')]?{'message':_0xf7f8('0x6e'),'statusCode':_0x141c2b[_0xf7f8('0x6a')]}:_0x141c2b);});}; \ No newline at end of file +var _0x5e39=['order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','%s/custom_fields','application/json','authType','basic','headers','format','Basic\x20%s','%s:%s','toString','base64','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','DeskAccount','rawAttributes','type','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x5e39,0x11a));var _0x95e3=function(_0x3a2fa0,_0x5a64a0){_0x3a2fa0=_0x3a2fa0-0x0;var _0xad899c=_0x5e39[_0x3a2fa0];return _0xad899c;};'use strict';var emlformat=require(_0x95e3('0x0'));var rimraf=require(_0x95e3('0x1'));var zipdir=require(_0x95e3('0x2'));var jsonpatch=require(_0x95e3('0x3'));var rp=require(_0x95e3('0x4'));var moment=require(_0x95e3('0x5'));var BPromise=require(_0x95e3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x95e3('0x7'));var sox=require('sox');var csv=require(_0x95e3('0x8'));var ejs=require(_0x95e3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e3('0xa'));var squel=require(_0x95e3('0xb'));var crypto=require(_0x95e3('0xc'));var jsforce=require(_0x95e3('0xd'));var deskjs=require(_0x95e3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95e3('0xf'));var Redis=require(_0x95e3('0x10'));var authService=require(_0x95e3('0x11'));var qs=require(_0x95e3('0x12'));var as=require(_0x95e3('0x13'));var hardwareService=require(_0x95e3('0x14'));var logger=require(_0x95e3('0x15'))(_0x95e3('0x16'));var utils=require('../../config/utils');var config=require(_0x95e3('0x17'));var licenseUtil=require(_0x95e3('0x18'));var db=require(_0x95e3('0x19'))['db'];var integrations=require(_0x95e3('0x1a'));function respondWithStatusCode(_0x48498b,_0x183b1d){_0x183b1d=_0x183b1d||0xcc;return function(_0x48e68e){if(_0x48e68e){return _0x48498b[_0x95e3('0x1b')](_0x183b1d);}return _0x48498b['status'](_0x183b1d)['end']();};}function respondWithResult(_0x500103,_0x5199be){_0x5199be=_0x5199be||0xc8;return function(_0x59b255){if(_0x59b255){return _0x500103[_0x95e3('0x1c')](_0x5199be)[_0x95e3('0x1d')](_0x59b255);}};}function respondWithFilteredResult(_0x5d1f4c,_0x3d4664){return function(_0x537256){if(_0x537256){var _0x260853=typeof _0x3d4664[_0x95e3('0x1e')]===_0x95e3('0x1f')&&typeof _0x3d4664[_0x95e3('0x20')]===_0x95e3('0x1f');var _0x3f6127=_0x537256[_0x95e3('0x21')];var _0x5c06c4=_0x260853?0x0:_0x3d4664[_0x95e3('0x1e')];var _0x3978f5=_0x260853?_0x537256[_0x95e3('0x21')]:_0x3d4664[_0x95e3('0x1e')]+_0x3d4664['limit'];var _0x29f962;if(_0x3978f5>=_0x3f6127){_0x3978f5=_0x3f6127;_0x29f962=0xc8;}else{_0x29f962=0xce;}_0x5d1f4c[_0x95e3('0x1c')](_0x29f962);return _0x5d1f4c[_0x95e3('0x22')]('Content-Range',_0x5c06c4+'-'+_0x3978f5+'/'+_0x3f6127)['json'](_0x537256);}return null;};}function patchUpdates(_0x22bd40){return function(_0x57d331){try{jsonpatch[_0x95e3('0x23')](_0x57d331,_0x22bd40,!![]);}catch(_0x2b785f){return BPromise[_0x95e3('0x24')](_0x2b785f);}return _0x57d331[_0x95e3('0x25')]();};}function saveUpdates(_0x31ead3,_0x1746f7){return function(_0x5324cb){if(_0x5324cb){return _0x5324cb[_0x95e3('0x26')](_0x31ead3)['then'](function(_0x4689d1){return _0x4689d1;});}return null;};}function removeEntity(_0x53120d,_0x24efac){return function(_0x4e147c){if(_0x4e147c){return _0x4e147c[_0x95e3('0x27')]()[_0x95e3('0x28')](function(){_0x53120d[_0x95e3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x209d30,_0x56d88c){return function(_0x1f6ffb){if(!_0x1f6ffb){_0x209d30[_0x95e3('0x1b')](0x194);}return _0x1f6ffb;};}function handleError(_0x4af696,_0x53298b){_0x53298b=_0x53298b||0x1f4;return function(_0x3a8496){logger['error'](_0x3a8496[_0x95e3('0x29')]);if(_0x3a8496[_0x95e3('0x2a')]){delete _0x3a8496[_0x95e3('0x2a')];}_0x4af696[_0x95e3('0x1c')](_0x53298b)[_0x95e3('0x2b')](_0x3a8496);};}exports[_0x95e3('0x2c')]=function(_0x46c4e5,_0xbd1929){var _0x19f7ae={},_0x51433c={},_0x134ace={'count':0x0,'rows':[]};var _0x433993=_[_0x95e3('0x2d')](db[_0x95e3('0x2e')][_0x95e3('0x2f')],function(_0x365c2f){return{'name':_0x365c2f['fieldName'],'type':_0x365c2f[_0x95e3('0x30')]['key']};});_0x51433c['model']=_[_0x95e3('0x2d')](_0x433993,_0x95e3('0x2a'));_0x51433c['query']=_['keys'](_0x46c4e5['query']);_0x51433c[_0x95e3('0x31')]=_[_0x95e3('0x32')](_0x51433c[_0x95e3('0x33')],_0x51433c[_0x95e3('0x34')]);_0x19f7ae[_0x95e3('0x35')]=_['intersection'](_0x51433c[_0x95e3('0x33')],qs[_0x95e3('0x36')](_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x36')]));_0x19f7ae[_0x95e3('0x35')]=_0x19f7ae[_0x95e3('0x35')][_0x95e3('0x37')]?_0x19f7ae[_0x95e3('0x35')]:_0x51433c[_0x95e3('0x33')];if(!_0x46c4e5[_0x95e3('0x34')]['hasOwnProperty'](_0x95e3('0x38'))){_0x19f7ae[_0x95e3('0x20')]=qs[_0x95e3('0x20')](_0x46c4e5['query'][_0x95e3('0x20')]);_0x19f7ae[_0x95e3('0x1e')]=qs[_0x95e3('0x1e')](_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x1e')]);}_0x19f7ae[_0x95e3('0x39')]=qs[_0x95e3('0x3a')](_0x46c4e5[_0x95e3('0x34')]['sort']);_0x19f7ae['where']=qs[_0x95e3('0x31')](_[_0x95e3('0x3b')](_0x46c4e5[_0x95e3('0x34')],_0x51433c[_0x95e3('0x31')]),_0x433993);if(_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x3c')]){_0x19f7ae[_0x95e3('0x3d')]=_[_0x95e3('0x3e')](_0x19f7ae['where'],{'$or':_['map'](_0x433993,function(_0x1c5170){if(_0x1c5170[_0x95e3('0x30')]!==_0x95e3('0x3f')){var _0x195292={};_0x195292[_0x1c5170['name']]={'$like':'%'+_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x3c')]+'%'};return _0x195292;}})});}_0x19f7ae=_[_0x95e3('0x3e')]({},_0x19f7ae,_0x46c4e5[_0x95e3('0x40')]);var _0x380ced={'where':_0x19f7ae['where']};return db[_0x95e3('0x2e')]['count'](_0x380ced)[_0x95e3('0x28')](function(_0x502163){_0x134ace['count']=_0x502163;if(_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x41')]){_0x19f7ae[_0x95e3('0x42')]=[{'all':!![]}];}return db[_0x95e3('0x2e')]['findAll'](_0x19f7ae);})[_0x95e3('0x28')](function(_0x52c373){_0x134ace[_0x95e3('0x43')]=_0x52c373;return _0x134ace;})[_0x95e3('0x28')](respondWithFilteredResult(_0xbd1929,_0x19f7ae))[_0x95e3('0x44')](handleError(_0xbd1929,null));};exports[_0x95e3('0x45')]=function(_0x37bec8,_0x14bbfc){var _0x4f98c2={'raw':![],'where':{'id':_0x37bec8[_0x95e3('0x46')]['id']}},_0x5777d4={};_0x5777d4['model']=_[_0x95e3('0x47')](db[_0x95e3('0x2e')][_0x95e3('0x2f')]);_0x5777d4['query']=_[_0x95e3('0x47')](_0x37bec8[_0x95e3('0x34')]);_0x5777d4[_0x95e3('0x31')]=_[_0x95e3('0x32')](_0x5777d4[_0x95e3('0x33')],_0x5777d4[_0x95e3('0x34')]);_0x4f98c2[_0x95e3('0x35')]=_[_0x95e3('0x32')](_0x5777d4[_0x95e3('0x33')],qs[_0x95e3('0x36')](_0x37bec8[_0x95e3('0x34')]['fields']));_0x4f98c2[_0x95e3('0x35')]=_0x4f98c2[_0x95e3('0x35')]['length']?_0x4f98c2[_0x95e3('0x35')]:_0x5777d4[_0x95e3('0x33')];if(_0x37bec8['query'][_0x95e3('0x41')]){_0x4f98c2[_0x95e3('0x42')]=[{'all':!![]}];}_0x4f98c2=_[_0x95e3('0x3e')]({},_0x4f98c2,_0x37bec8[_0x95e3('0x40')]);return db[_0x95e3('0x2e')]['find'](_0x4f98c2)[_0x95e3('0x28')](handleEntityNotFound(_0x14bbfc,null))['then'](respondWithResult(_0x14bbfc,null))[_0x95e3('0x44')](handleError(_0x14bbfc,null));};exports[_0x95e3('0x48')]=function(_0x471e37,_0x4998e3){return db[_0x95e3('0x2e')][_0x95e3('0x48')](_0x471e37[_0x95e3('0x49')],{})[_0x95e3('0x28')](respondWithResult(_0x4998e3,0xc9))['catch'](handleError(_0x4998e3,null));};exports[_0x95e3('0x26')]=function(_0x12dc30,_0x5c4fa1){if(_0x12dc30[_0x95e3('0x49')]['id']){delete _0x12dc30[_0x95e3('0x49')]['id'];}return db[_0x95e3('0x2e')][_0x95e3('0x4a')]({'where':{'id':_0x12dc30[_0x95e3('0x46')]['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x5c4fa1,null))[_0x95e3('0x28')](saveUpdates(_0x12dc30[_0x95e3('0x49')],null))['then'](respondWithResult(_0x5c4fa1,null))[_0x95e3('0x44')](handleError(_0x5c4fa1,null));};exports['destroy']=function(_0x33709c,_0x2cc2ed){return db[_0x95e3('0x2e')][_0x95e3('0x4a')]({'where':{'id':_0x33709c['params']['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x2cc2ed,null))[_0x95e3('0x28')](removeEntity(_0x2cc2ed,null))[_0x95e3('0x44')](handleError(_0x2cc2ed,null));};exports[_0x95e3('0x4b')]=function(_0x20d628,_0x1fb8b0,_0x30609c){var _0x1f0574={};var _0x312cf8={};var _0x392206;var _0x10593a;return db[_0x95e3('0x2e')][_0x95e3('0x4c')]({'where':{'id':_0x20d628[_0x95e3('0x46')]['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x1fb8b0,null))[_0x95e3('0x28')](function(_0x7d637c){if(_0x7d637c){_0x392206=_0x7d637c;_0x312cf8['model']=_[_0x95e3('0x47')](db[_0x95e3('0x4d')][_0x95e3('0x2f')]);_0x312cf8[_0x95e3('0x34')]=_[_0x95e3('0x47')](_0x20d628[_0x95e3('0x34')]);_0x312cf8['filters']=_['intersection'](_0x312cf8[_0x95e3('0x33')],_0x312cf8[_0x95e3('0x34')]);_0x1f0574[_0x95e3('0x35')]=_['intersection'](_0x312cf8[_0x95e3('0x33')],qs[_0x95e3('0x36')](_0x20d628[_0x95e3('0x34')]['fields']));_0x1f0574[_0x95e3('0x35')]=_0x1f0574[_0x95e3('0x35')][_0x95e3('0x37')]?_0x1f0574[_0x95e3('0x35')]:_0x312cf8[_0x95e3('0x33')];_0x1f0574['order']=qs['sort'](_0x20d628['query'][_0x95e3('0x3a')]);_0x1f0574[_0x95e3('0x3d')]=qs[_0x95e3('0x31')](_[_0x95e3('0x3b')](_0x20d628[_0x95e3('0x34')],_0x312cf8[_0x95e3('0x31')]));if(_0x20d628['query'][_0x95e3('0x3c')]){_0x1f0574['where']=_['merge'](_0x1f0574[_0x95e3('0x3d')],{'$or':_[_0x95e3('0x2d')](_0x1f0574[_0x95e3('0x35')],function(_0x5bdde8){var _0x267499={};_0x267499[_0x5bdde8]={'$like':'%'+_0x20d628['query'][_0x95e3('0x3c')]+'%'};return _0x267499;})});}_0x1f0574=_[_0x95e3('0x3e')]({},_0x1f0574,_0x20d628[_0x95e3('0x40')]);return _0x392206['getConfigurations'](_0x1f0574);}})[_0x95e3('0x28')](function(_0x43ebd2){if(_0x43ebd2){_0x10593a=_0x43ebd2[_0x95e3('0x37')];if(!_0x20d628[_0x95e3('0x34')][_0x95e3('0x4e')](_0x95e3('0x38'))){_0x1f0574[_0x95e3('0x20')]=qs[_0x95e3('0x20')](_0x20d628[_0x95e3('0x34')][_0x95e3('0x20')]);_0x1f0574[_0x95e3('0x1e')]=qs[_0x95e3('0x1e')](_0x20d628[_0x95e3('0x34')][_0x95e3('0x1e')]);}return _0x392206[_0x95e3('0x4b')](_0x1f0574);}})[_0x95e3('0x28')](function(_0x815703){if(_0x815703){return _0x815703?{'count':_0x10593a,'rows':_0x815703}:null;}})[_0x95e3('0x28')](respondWithResult(_0x1fb8b0,null))[_0x95e3('0x44')](handleError(_0x1fb8b0,null));};exports['addConfiguration']=function(_0x3d19e8,_0x2ef78b,_0x108aff){if(_0x3d19e8[_0x95e3('0x49')]['id']){delete _0x3d19e8[_0x95e3('0x49')]['id'];}return db['DeskAccount'][_0x95e3('0x4c')]({'where':{'id':_0x3d19e8[_0x95e3('0x46')]['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x2ef78b,null))['then'](function(_0x2673ed){if(_0x2673ed){_0x3d19e8[_0x95e3('0x49')][_0x95e3('0x4f')]=_0x2673ed['id'];_0x3d19e8[_0x95e3('0x49')][_0x95e3('0x50')]=integrations[_0x95e3('0x51')](_0x3d19e8['body'][_0x95e3('0x52')],_0x3d19e8[_0x95e3('0x49')][_0x95e3('0x30')]);_0x3d19e8['body'][_0x95e3('0x53')]=integrations[_0x95e3('0x54')](_0x3d19e8[_0x95e3('0x49')]['channel'],_0x3d19e8[_0x95e3('0x49')]['type']);return db[_0x95e3('0x4d')][_0x95e3('0x48')](_0x3d19e8['body'],{'include':[{'model':db[_0x95e3('0x55')],'as':_0x95e3('0x50')},{'model':db[_0x95e3('0x55')],'as':_0x95e3('0x53')}]});}return null;})[_0x95e3('0x28')](respondWithResult(_0x2ef78b,null))[_0x95e3('0x44')](handleError(_0x2ef78b,null));};exports['getFields']=function(_0x4c9919,_0x235fd6,_0x81433b){var _0x350637=[{'name':_0x95e3('0x56'),'label':_0x95e3('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x532ef4='';return db[_0x95e3('0x2e')]['findOne']({'where':{'id':_0x4c9919['params']['id']},'attributes':['id','remoteUri','authType','username',_0x95e3('0x57'),_0x95e3('0x58'),_0x95e3('0x59'),_0x95e3('0x5a'),_0x95e3('0x5b')]})[_0x95e3('0x28')](handleEntityNotFound(_0x235fd6,null))['then'](function(_0x5223ea){if(_0x5223ea){_0x532ef4=_0x5223ea['remoteUri'];var _0x25aa72=_0x532ef4['slice'](-0x1);if(_0x25aa72==='/'){_0x532ef4=_0x532ef4[_0x95e3('0x5c')](0x0,_0x532ef4[_0x95e3('0x5d')](_0x25aa72));}var _0x489ba8={'method':_0x95e3('0x5e'),'uri':util['format'](_0x95e3('0x5f'),_0x532ef4),'headers':{'Content-Type':_0x95e3('0x60'),'Accept':_0x95e3('0x60')},'json':!![]};if(_0x5223ea[_0x95e3('0x61')]===_0x95e3('0x62')){_0x489ba8[_0x95e3('0x63')]['Authorization']=util[_0x95e3('0x64')](_0x95e3('0x65'),new Buffer(util[_0x95e3('0x64')](_0x95e3('0x66'),_0x5223ea['username'],_0x5223ea[_0x95e3('0x57')]))[_0x95e3('0x67')](_0x95e3('0x68')));}return rp(_0x489ba8)['then'](function(_0x3925d9){return _0x350637['concat'](_['map'](_0x3925d9['_embedded'][_0x95e3('0x69')],function(_0x12bb3f){return{'id':_0x12bb3f[_0x95e3('0x2a')],'name':_0x12bb3f[_0x95e3('0x2a')],'type':_0x12bb3f[_0x95e3('0x30')],'active':_0x12bb3f['active'],'label':_0x12bb3f[_0x95e3('0x6a')],'custom':!![]};}));});}})[_0x95e3('0x28')](function(_0x8600b8){return{'count':_0x8600b8['length'],'rows':_0x8600b8};})[_0x95e3('0x28')](respondWithResult(_0x235fd6,null))['catch'](function(_0x4de792){var _0x588fff=_0x4c9919[_0x95e3('0x34')]['test']?0x1f4:_0x4de792[_0x95e3('0x6b')]||0x1f4;logger['error'](_0x95e3('0x6c'),_0x95e3('0x6d'),_0x588fff,JSON[_0x95e3('0x6e')](_0x4de792));delete _0x4de792[_0x95e3('0x2a')];if(_0x588fff===0x191){_0x588fff=0x190;}_0x235fd6[_0x95e3('0x1c')](_0x588fff)['send'](_0x4c9919[_0x95e3('0x34')][_0x95e3('0x6f')]?{'message':_0x95e3('0x70'),'statusCode':_0x4de792[_0x95e3('0x6b')]}:_0x4de792);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 93d12c6..155e5d6 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5686=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x3b6e28,_0x1526b9){var _0x50677a=function(_0x1d24ff){while(--_0x1d24ff){_0x3b6e28['push'](_0x3b6e28['shift']());}};_0x50677a(++_0x1526b9);}(_0x5686,0xf3));var _0x6568=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x5686[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x6568('0x0'));var util=require(_0x6568('0x1'));var logger=require(_0x6568('0x2'))(_0x6568('0x3'));var moment=require(_0x6568('0x4'));var BPromise=require(_0x6568('0x5'));var rp=require(_0x6568('0x6'));var fs=require('fs');var path=require(_0x6568('0x7'));var rimraf=require(_0x6568('0x8'));var config=require(_0x6568('0x9'));var attributes=require(_0x6568('0xa'));var integrations=require(_0x6568('0xb'));module['exports']=function(_0x327aa3,_0x1487d){return _0x327aa3[_0x6568('0xc')](_0x6568('0xd'),attributes,{'tableName':_0x6568('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd4=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x418730,_0x39ee1f){var _0x561e14=function(_0x4d250d){while(--_0x4d250d){_0x418730['push'](_0x418730['shift']());}};_0x561e14(++_0x39ee1f);}(_0xcbd4,0x64));var _0x4cbd=function(_0x24dcc8,_0x3c79f3){_0x24dcc8=_0x24dcc8-0x0;var _0xe6ebac=_0xcbd4[_0x24dcc8];return _0xe6ebac;};'use strict';var _=require(_0x4cbd('0x0'));var util=require('util');var logger=require(_0x4cbd('0x1'))(_0x4cbd('0x2'));var moment=require('moment');var BPromise=require(_0x4cbd('0x3'));var rp=require(_0x4cbd('0x4'));var fs=require('fs');var path=require(_0x4cbd('0x5'));var rimraf=require(_0x4cbd('0x6'));var config=require(_0x4cbd('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x4cbd('0x8'));module[_0x4cbd('0x9')]=function(_0x537180,_0x2c7119){return _0x537180[_0x4cbd('0xa')](_0x4cbd('0xb'),attributes,{'tableName':_0x4cbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 2dc1881..1cae291 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eb6=['request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x447855,_0x1143bd){var _0x1946e5=function(_0x2fd3eb){while(--_0x2fd3eb){_0x447855['push'](_0x447855['shift']());}};_0x1946e5(++_0x1143bd);}(_0x0eb6,0x1c9));var _0x60eb=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x0eb6[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0x60eb('0x0'));var util=require(_0x60eb('0x1'));var moment=require(_0x60eb('0x2'));var BPromise=require(_0x60eb('0x3'));var rs=require(_0x60eb('0x4'));var fs=require('fs');var Redis=require(_0x60eb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x60eb('0x6'));var config=require(_0x60eb('0x7'));var jayson=require(_0x60eb('0x8'));var client=jayson[_0x60eb('0x9')][_0x60eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4a63,_0x135cac,_0x3abad6){return new BPromise(function(_0x35a654,_0x951acc){return client[_0x60eb('0xb')](_0x4c4a63,_0x3abad6)[_0x60eb('0xc')](function(_0x12b550){logger[_0x60eb('0xd')](_0x60eb('0xe'),_0x135cac,_0x60eb('0xf'));logger[_0x60eb('0x10')](_0x60eb('0x11'),_0x135cac,_0x60eb('0xf'),JSON[_0x60eb('0x12')](_0x12b550));if(_0x12b550[_0x60eb('0x13')]){if(_0x12b550[_0x60eb('0x13')][_0x60eb('0x14')]===0x1f4){logger[_0x60eb('0x13')]('DeskAccount,\x20%s,\x20%s',_0x135cac,_0x12b550[_0x60eb('0x13')]['message']);return _0x951acc(_0x12b550[_0x60eb('0x13')][_0x60eb('0x15')]);}logger['error'](_0x60eb('0xe'),_0x135cac,_0x12b550[_0x60eb('0x13')][_0x60eb('0x15')]);return _0x35a654(_0x12b550[_0x60eb('0x13')][_0x60eb('0x15')]);}else{logger[_0x60eb('0xd')](_0x60eb('0xe'),_0x135cac,_0x60eb('0xf'));_0x35a654(_0x12b550['result'][_0x60eb('0x15')]);}})[_0x60eb('0x16')](function(_0x4c4385){logger[_0x60eb('0x13')](_0x60eb('0xe'),_0x135cac,_0x4c4385);_0x951acc(_0x4c4385);});});}exports[_0x60eb('0x17')]=function(_0x18fa1b){var _0x24194e=this;return new Promise(function(_0x834281,_0x20a57f){return db['DeskAccount'][_0x60eb('0x18')]({'raw':_0x18fa1b[_0x60eb('0x19')]?_0x18fa1b[_0x60eb('0x19')][_0x60eb('0x1a')]===undefined?!![]:![]:!![],'where':_0x18fa1b['options']?_0x18fa1b['options'][_0x60eb('0x1b')]||null:null,'attributes':_0x18fa1b['options']?_0x18fa1b[_0x60eb('0x19')][_0x60eb('0x1c')]||null:null,'limit':_0x18fa1b[_0x60eb('0x19')]?_0x18fa1b['options'][_0x60eb('0x1d')]||null:null,'include':_0x18fa1b[_0x60eb('0x19')]?_0x18fa1b[_0x60eb('0x19')][_0x60eb('0x1e')]?_[_0x60eb('0x1f')](_0x18fa1b[_0x60eb('0x19')][_0x60eb('0x1e')],function(_0x25278d){return{'model':db[_0x25278d['model']],'as':_0x25278d['as'],'attributes':_0x25278d[_0x60eb('0x1c')],'include':_0x25278d[_0x60eb('0x1e')]?_[_0x60eb('0x1f')](_0x25278d[_0x60eb('0x1e')],function(_0x836a6d){return{'model':db[_0x836a6d[_0x60eb('0x20')]],'as':_0x836a6d['as'],'attributes':_0x836a6d[_0x60eb('0x1c')],'include':_0x836a6d[_0x60eb('0x1e')]?_[_0x60eb('0x1f')](_0x836a6d['include'],function(_0x39e7e7){return{'model':db[_0x39e7e7['model']],'as':_0x39e7e7['as'],'attributes':_0x39e7e7[_0x60eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x60eb('0xc')](function(_0x53ddaf){logger[_0x60eb('0xd')](_0x60eb('0x17'),_0x18fa1b);logger[_0x60eb('0x10')]('GetDeskAccount',_0x18fa1b,JSON[_0x60eb('0x12')](_0x53ddaf));_0x834281(_0x53ddaf);})[_0x60eb('0x16')](function(_0x1c4c6d){logger[_0x60eb('0x13')]('GetDeskAccount',_0x1c4c6d[_0x60eb('0x15')],_0x18fa1b);_0x20a57f(_0x24194e['error'](0x1f4,_0x1c4c6d[_0x60eb('0x15')]));});});};exports[_0x60eb('0x21')]=function(_0x36b2ed){var _0x1abe74=this;return new Promise(function(_0x4af8c0,_0x44aef0){return db[_0x60eb('0x22')][_0x60eb('0x23')]({'raw':_0x36b2ed[_0x60eb('0x19')]?_0x36b2ed[_0x60eb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x36b2ed['options']?_0x36b2ed[_0x60eb('0x19')]['where']||null:null,'attributes':_0x36b2ed[_0x60eb('0x19')]?_0x36b2ed['options'][_0x60eb('0x1c')]||null:null,'include':_0x36b2ed[_0x60eb('0x19')]?_0x36b2ed['options']['include']?_[_0x60eb('0x1f')](_0x36b2ed[_0x60eb('0x19')][_0x60eb('0x1e')],function(_0xab4e80){return{'model':db[_0xab4e80['model']],'as':_0xab4e80['as'],'attributes':_0xab4e80[_0x60eb('0x1c')],'include':_0xab4e80[_0x60eb('0x1e')]?_[_0x60eb('0x1f')](_0xab4e80[_0x60eb('0x1e')],function(_0x4f25df){return{'model':db[_0x4f25df[_0x60eb('0x20')]],'as':_0x4f25df['as'],'attributes':_0x4f25df[_0x60eb('0x1c')],'include':_0x4f25df['include']?_[_0x60eb('0x1f')](_0x4f25df[_0x60eb('0x1e')],function(_0x21d0c6){return{'model':db[_0x21d0c6[_0x60eb('0x20')]],'as':_0x21d0c6['as'],'attributes':_0x21d0c6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x167188){logger[_0x60eb('0xd')](_0x60eb('0x21'),_0x36b2ed);logger['debug'](_0x60eb('0x21'),_0x36b2ed,JSON[_0x60eb('0x12')](_0x167188));_0x4af8c0(_0x167188);})[_0x60eb('0x16')](function(_0x29f32a){logger['error']('ShowDeskAccount',_0x29f32a[_0x60eb('0x15')],_0x36b2ed);_0x44aef0(_0x1abe74['error'](0x1f4,_0x29f32a[_0x60eb('0x15')]));});});}; \ No newline at end of file +var _0x3612=['catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','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'];(function(_0x1c6f8,_0x18af22){var _0xc47f94=function(_0x280668){while(--_0x280668){_0x1c6f8['push'](_0x1c6f8['shift']());}};_0xc47f94(++_0x18af22);}(_0x3612,0xa2));var _0x2361=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x3612[_0x1098db];return _0x14f090;};'use strict';var _=require(_0x2361('0x0'));var util=require(_0x2361('0x1'));var moment=require('moment');var BPromise=require(_0x2361('0x2'));var rs=require(_0x2361('0x3'));var fs=require('fs');var Redis=require(_0x2361('0x4'));var db=require(_0x2361('0x5'))['db'];var utils=require(_0x2361('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2361('0x7'));var jayson=require(_0x2361('0x8'));var client=jayson[_0x2361('0x9')][_0x2361('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345dcf,_0x22214d,_0x332e6a){return new BPromise(function(_0x109a6a,_0x1d204a){return client[_0x2361('0xb')](_0x345dcf,_0x332e6a)[_0x2361('0xc')](function(_0x4ff4f3){logger[_0x2361('0xd')](_0x2361('0xe'),_0x22214d,_0x2361('0xf'));logger[_0x2361('0x10')](_0x2361('0x11'),_0x22214d,'request\x20sent',JSON[_0x2361('0x12')](_0x4ff4f3));if(_0x4ff4f3[_0x2361('0x13')]){if(_0x4ff4f3['error'][_0x2361('0x14')]===0x1f4){logger[_0x2361('0x13')](_0x2361('0xe'),_0x22214d,_0x4ff4f3[_0x2361('0x13')]['message']);return _0x1d204a(_0x4ff4f3[_0x2361('0x13')][_0x2361('0x15')]);}logger[_0x2361('0x13')]('DeskAccount,\x20%s,\x20%s',_0x22214d,_0x4ff4f3[_0x2361('0x13')][_0x2361('0x15')]);return _0x109a6a(_0x4ff4f3[_0x2361('0x13')][_0x2361('0x15')]);}else{logger[_0x2361('0xd')](_0x2361('0xe'),_0x22214d,_0x2361('0xf'));_0x109a6a(_0x4ff4f3[_0x2361('0x16')][_0x2361('0x15')]);}})[_0x2361('0x17')](function(_0x40ffeb){logger['error'](_0x2361('0xe'),_0x22214d,_0x40ffeb);_0x1d204a(_0x40ffeb);});});}exports['GetDeskAccount']=function(_0x359bc5){var _0x119a1c=this;return new Promise(function(_0x5a36f5,_0x53bc6e){return db[_0x2361('0x18')][_0x2361('0x19')]({'raw':_0x359bc5[_0x2361('0x1a')]?_0x359bc5[_0x2361('0x1a')][_0x2361('0x1b')]===undefined?!![]:![]:!![],'where':_0x359bc5[_0x2361('0x1a')]?_0x359bc5[_0x2361('0x1a')][_0x2361('0x1c')]||null:null,'attributes':_0x359bc5[_0x2361('0x1a')]?_0x359bc5['options'][_0x2361('0x1d')]||null:null,'limit':_0x359bc5[_0x2361('0x1a')]?_0x359bc5['options'][_0x2361('0x1e')]||null:null,'include':_0x359bc5[_0x2361('0x1a')]?_0x359bc5[_0x2361('0x1a')]['include']?_['map'](_0x359bc5[_0x2361('0x1a')]['include'],function(_0x5d2368){return{'model':db[_0x5d2368['model']],'as':_0x5d2368['as'],'attributes':_0x5d2368['attributes'],'include':_0x5d2368[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x5d2368['include'],function(_0x53bc76){return{'model':db[_0x53bc76[_0x2361('0x21')]],'as':_0x53bc76['as'],'attributes':_0x53bc76['attributes'],'include':_0x53bc76[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x53bc76[_0x2361('0x1f')],function(_0x362a9d){return{'model':db[_0x362a9d[_0x2361('0x21')]],'as':_0x362a9d['as'],'attributes':_0x362a9d[_0x2361('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2548a0){logger[_0x2361('0xd')](_0x2361('0x22'),_0x359bc5);logger[_0x2361('0x10')](_0x2361('0x22'),_0x359bc5,JSON[_0x2361('0x12')](_0x2548a0));_0x5a36f5(_0x2548a0);})['catch'](function(_0x5556c8){logger[_0x2361('0x13')](_0x2361('0x22'),_0x5556c8[_0x2361('0x15')],_0x359bc5);_0x53bc6e(_0x119a1c['error'](0x1f4,_0x5556c8['message']));});});};exports[_0x2361('0x23')]=function(_0x4cae27){var _0x498aee=this;return new Promise(function(_0x423a33,_0x54e35c){return db[_0x2361('0x18')][_0x2361('0x24')]({'raw':_0x4cae27[_0x2361('0x1a')]?_0x4cae27[_0x2361('0x1a')][_0x2361('0x1b')]===undefined?!![]:![]:!![],'where':_0x4cae27['options']?_0x4cae27[_0x2361('0x1a')][_0x2361('0x1c')]||null:null,'attributes':_0x4cae27[_0x2361('0x1a')]?_0x4cae27['options'][_0x2361('0x1d')]||null:null,'include':_0x4cae27[_0x2361('0x1a')]?_0x4cae27['options'][_0x2361('0x1f')]?_[_0x2361('0x20')](_0x4cae27['options'][_0x2361('0x1f')],function(_0x4c18d8){return{'model':db[_0x4c18d8['model']],'as':_0x4c18d8['as'],'attributes':_0x4c18d8[_0x2361('0x1d')],'include':_0x4c18d8[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x4c18d8[_0x2361('0x1f')],function(_0x17b2c7){return{'model':db[_0x17b2c7['model']],'as':_0x17b2c7['as'],'attributes':_0x17b2c7[_0x2361('0x1d')],'include':_0x17b2c7[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x17b2c7[_0x2361('0x1f')],function(_0x2f6c35){return{'model':db[_0x2f6c35[_0x2361('0x21')]],'as':_0x2f6c35['as'],'attributes':_0x2f6c35['attributes']};}):[]};}):[]};}):[]:[]})[_0x2361('0xc')](function(_0x2902ce){logger['info']('ShowDeskAccount',_0x4cae27);logger['debug'](_0x2361('0x23'),_0x4cae27,JSON['stringify'](_0x2902ce));_0x423a33(_0x2902ce);})[_0x2361('0x17')](function(_0x55fcaa){logger['error'](_0x2361('0x23'),_0x55fcaa['message'],_0x4cae27);_0x54e35c(_0x498aee[_0x2361('0x13')](0x1f4,_0x55fcaa[_0x2361('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bf48ac0..b550c00 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x5bcf33,_0x548451){var _0x5d5abe=function(_0x4d4457){while(--_0x4d4457){_0x5bcf33['push'](_0x5bcf33['shift']());}};_0x5d5abe(++_0x548451);}(_0x34e8,0x12c));var _0x834e=function(_0x5a465a,_0x4f83eb){_0x5a465a=_0x5a465a-0x0;var _0x3bb21f=_0x34e8[_0x5a465a];return _0x3bb21f;};'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 +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0x55ca,0x126));var _0xa55c=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x55ca[_0x4cee4b];return _0x4d891d;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 620f922..6674453 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc98e=['STRING','exports'];(function(_0x364a18,_0x1ee061){var _0x48c703=function(_0x3bd6c3){while(--_0x3bd6c3){_0x364a18['push'](_0x364a18['shift']());}};_0x48c703(++_0x1ee061);}(_0xc98e,0x197));var _0xec98=function(_0x15677c,_0x4b3cc5){_0x15677c=_0x15677c-0x0;var _0x5e7541=_0xc98e[_0x15677c];return _0x5e7541;};'use strict';var Sequelize=require('sequelize');module[_0xec98('0x0')]={'name':{'type':Sequelize[_0xec98('0x1')]},'description':{'type':Sequelize[_0xec98('0x1')]}}; \ No newline at end of file +var _0xc39a=['STRING','exports'];(function(_0x4d442d,_0x31af2d){var _0x58c92f=function(_0x188d29){while(--_0x188d29){_0x4d442d['push'](_0x4d442d['shift']());}};_0x58c92f(++_0x31af2d);}(_0xc39a,0x77));var _0xac39=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xc39a[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require('sequelize');module[_0xac39('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac39('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 8b0c26b..b826d2a 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00f7=['end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','catch','params','DeskConfiguration','include','find','create','body','getFields','findOne','DeskField','getSubjects','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','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','status'];(function(_0x5d88ff,_0x50313d){var _0x3db12d=function(_0x12b3cb){while(--_0x12b3cb){_0x5d88ff['push'](_0x5d88ff['shift']());}};_0x3db12d(++_0x50313d);}(_0x00f7,0x1bb));var _0x700f=function(_0xb28729,_0x54f9ed){_0xb28729=_0xb28729-0x0;var _0x51ea35=_0x00f7[_0xb28729];return _0x51ea35;};'use strict';var emlformat=require(_0x700f('0x0'));var rimraf=require(_0x700f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x700f('0x2'));var rp=require(_0x700f('0x3'));var moment=require(_0x700f('0x4'));var BPromise=require(_0x700f('0x5'));var Mustache=require(_0x700f('0x6'));var util=require(_0x700f('0x7'));var path=require(_0x700f('0x8'));var sox=require('sox');var csv=require(_0x700f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x700f('0xa'));var crypto=require('crypto');var jsforce=require(_0x700f('0xb'));var deskjs=require(_0x700f('0xc'));var toCsv=require(_0x700f('0x9'));var querystring=require('querystring');var Papa=require(_0x700f('0xd'));var Redis=require(_0x700f('0xe'));var authService=require(_0x700f('0xf'));var qs=require(_0x700f('0x10'));var as=require(_0x700f('0x11'));var hardwareService=require(_0x700f('0x12'));var logger=require('../../config/logger')(_0x700f('0x13'));var utils=require(_0x700f('0x14'));var config=require(_0x700f('0x15'));var licenseUtil=require(_0x700f('0x16'));var db=require(_0x700f('0x17'))['db'];function respondWithStatusCode(_0xb83b47,_0x34d7b7){_0x34d7b7=_0x34d7b7||0xcc;return function(_0x1aa944){if(_0x1aa944){return _0xb83b47['sendStatus'](_0x34d7b7);}return _0xb83b47[_0x700f('0x18')](_0x34d7b7)[_0x700f('0x19')]();};}function respondWithResult(_0x332687,_0x381a2b){_0x381a2b=_0x381a2b||0xc8;return function(_0xb471ea){if(_0xb471ea){return _0x332687['status'](_0x381a2b)[_0x700f('0x1a')](_0xb471ea);}};}function respondWithFilteredResult(_0x2e4032,_0x339463){return function(_0x47cde1){if(_0x47cde1){var _0x1fd299=typeof _0x339463[_0x700f('0x1b')]===_0x700f('0x1c')&&typeof _0x339463[_0x700f('0x1d')]===_0x700f('0x1c');var _0x1398db=_0x47cde1[_0x700f('0x1e')];var _0x3a92f9=_0x1fd299?0x0:_0x339463[_0x700f('0x1b')];var _0x996e0d=_0x1fd299?_0x47cde1[_0x700f('0x1e')]:_0x339463[_0x700f('0x1b')]+_0x339463['limit'];var _0x20ffed;if(_0x996e0d>=_0x1398db){_0x996e0d=_0x1398db;_0x20ffed=0xc8;}else{_0x20ffed=0xce;}_0x2e4032['status'](_0x20ffed);return _0x2e4032[_0x700f('0x1f')]('Content-Range',_0x3a92f9+'-'+_0x996e0d+'/'+_0x1398db)[_0x700f('0x1a')](_0x47cde1);}return null;};}function patchUpdates(_0x4cf91e){return function(_0x5e3b57){try{jsonpatch[_0x700f('0x20')](_0x5e3b57,_0x4cf91e,!![]);}catch(_0x358115){return BPromise[_0x700f('0x21')](_0x358115);}return _0x5e3b57[_0x700f('0x22')]();};}function saveUpdates(_0x16f091,_0x39ca07){return function(_0x3ab340){if(_0x3ab340){return _0x3ab340[_0x700f('0x23')](_0x16f091)[_0x700f('0x24')](function(_0x95c037){return _0x95c037;});}return null;};}function removeEntity(_0x13f2ee,_0x1caee9){return function(_0x2b6dab){if(_0x2b6dab){return _0x2b6dab[_0x700f('0x25')]()[_0x700f('0x24')](function(){_0x13f2ee['status'](0xcc)[_0x700f('0x19')]();});}};}function handleEntityNotFound(_0x3539a3,_0x47ad29){return function(_0x42d34e){if(!_0x42d34e){_0x3539a3[_0x700f('0x26')](0x194);}return _0x42d34e;};}function handleError(_0x43c2be,_0x6ff204){_0x6ff204=_0x6ff204||0x1f4;return function(_0x5dc2ae){logger['error'](_0x5dc2ae['stack']);if(_0x5dc2ae[_0x700f('0x27')]){delete _0x5dc2ae[_0x700f('0x27')];}_0x43c2be[_0x700f('0x18')](_0x6ff204)[_0x700f('0x28')](_0x5dc2ae);};}exports[_0x700f('0x29')]=function(_0x27dc18,_0x3b96f4){var _0x628846={},_0x1380a4={},_0x4de1f7={'count':0x0,'rows':[]};var _0x5cfe3b=_[_0x700f('0x2a')](db['DeskConfiguration'][_0x700f('0x2b')],function(_0x523458){return{'name':_0x523458['fieldName'],'type':_0x523458[_0x700f('0x2c')]['key']};});_0x1380a4[_0x700f('0x2d')]=_[_0x700f('0x2a')](_0x5cfe3b,_0x700f('0x27'));_0x1380a4['query']=_[_0x700f('0x2e')](_0x27dc18[_0x700f('0x2f')]);_0x1380a4[_0x700f('0x30')]=_[_0x700f('0x31')](_0x1380a4['model'],_0x1380a4[_0x700f('0x2f')]);_0x628846[_0x700f('0x32')]=_['intersection'](_0x1380a4['model'],qs['fields'](_0x27dc18[_0x700f('0x2f')][_0x700f('0x33')]));_0x628846['attributes']=_0x628846[_0x700f('0x32')][_0x700f('0x34')]?_0x628846[_0x700f('0x32')]:_0x1380a4['model'];if(!_0x27dc18[_0x700f('0x2f')][_0x700f('0x35')](_0x700f('0x36'))){_0x628846[_0x700f('0x1d')]=qs[_0x700f('0x1d')](_0x27dc18[_0x700f('0x2f')][_0x700f('0x1d')]);_0x628846[_0x700f('0x1b')]=qs['offset'](_0x27dc18[_0x700f('0x2f')]['offset']);}_0x628846[_0x700f('0x37')]=qs[_0x700f('0x38')](_0x27dc18[_0x700f('0x2f')][_0x700f('0x38')]);_0x628846[_0x700f('0x39')]=qs[_0x700f('0x30')](_[_0x700f('0x3a')](_0x27dc18[_0x700f('0x2f')],_0x1380a4[_0x700f('0x30')]),_0x5cfe3b);if(_0x27dc18['query']['filter']){_0x628846[_0x700f('0x39')]=_[_0x700f('0x3b')](_0x628846['where'],{'$or':_[_0x700f('0x2a')](_0x5cfe3b,function(_0x278b6b){if(_0x278b6b[_0x700f('0x2c')]!=='VIRTUAL'){var _0x4565bf={};_0x4565bf[_0x278b6b['name']]={'$like':'%'+_0x27dc18['query'][_0x700f('0x3c')]+'%'};return _0x4565bf;}})});}_0x628846=_[_0x700f('0x3b')]({},_0x628846,_0x27dc18[_0x700f('0x3d')]);var _0x2937e0={'where':_0x628846[_0x700f('0x39')]};return db['DeskConfiguration'][_0x700f('0x1e')](_0x2937e0)[_0x700f('0x24')](function(_0x4ba84e){_0x4de1f7['count']=_0x4ba84e;if(_0x27dc18[_0x700f('0x2f')][_0x700f('0x3e')]){_0x628846['include']=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x628846);})[_0x700f('0x24')](function(_0x49089e){_0x4de1f7['rows']=_0x49089e;return _0x4de1f7;})[_0x700f('0x24')](respondWithFilteredResult(_0x3b96f4,_0x628846))[_0x700f('0x3f')](handleError(_0x3b96f4,null));};exports['show']=function(_0x56e6fd,_0x158b76){var _0x3b886f={'raw':![],'where':{'id':_0x56e6fd[_0x700f('0x40')]['id']}},_0x1f971f={};_0x1f971f['model']=_[_0x700f('0x2e')](db[_0x700f('0x41')][_0x700f('0x2b')]);_0x1f971f[_0x700f('0x2f')]=_[_0x700f('0x2e')](_0x56e6fd[_0x700f('0x2f')]);_0x1f971f[_0x700f('0x30')]=_[_0x700f('0x31')](_0x1f971f[_0x700f('0x2d')],_0x1f971f[_0x700f('0x2f')]);_0x3b886f[_0x700f('0x32')]=_[_0x700f('0x31')](_0x1f971f[_0x700f('0x2d')],qs[_0x700f('0x33')](_0x56e6fd[_0x700f('0x2f')]['fields']));_0x3b886f[_0x700f('0x32')]=_0x3b886f[_0x700f('0x32')][_0x700f('0x34')]?_0x3b886f['attributes']:_0x1f971f[_0x700f('0x2d')];if(_0x56e6fd[_0x700f('0x2f')][_0x700f('0x3e')]){_0x3b886f[_0x700f('0x42')]=[{'all':!![]}];}_0x3b886f=_[_0x700f('0x3b')]({},_0x3b886f,_0x56e6fd[_0x700f('0x3d')]);return db['DeskConfiguration'][_0x700f('0x43')](_0x3b886f)['then'](handleEntityNotFound(_0x158b76,null))[_0x700f('0x24')](respondWithResult(_0x158b76,null))[_0x700f('0x3f')](handleError(_0x158b76,null));};exports[_0x700f('0x44')]=function(_0x2b7aed,_0x1db7a1){return db['DeskConfiguration']['create'](_0x2b7aed[_0x700f('0x45')],{})[_0x700f('0x24')](respondWithResult(_0x1db7a1,0xc9))[_0x700f('0x3f')](handleError(_0x1db7a1,null));};exports[_0x700f('0x23')]=function(_0x3dfbdb,_0x1be1d1){if(_0x3dfbdb[_0x700f('0x45')]['id']){delete _0x3dfbdb[_0x700f('0x45')]['id'];}return db[_0x700f('0x41')][_0x700f('0x43')]({'where':{'id':_0x3dfbdb[_0x700f('0x40')]['id']}})[_0x700f('0x24')](handleEntityNotFound(_0x1be1d1,null))[_0x700f('0x24')](saveUpdates(_0x3dfbdb[_0x700f('0x45')],null))[_0x700f('0x24')](respondWithResult(_0x1be1d1,null))['catch'](handleError(_0x1be1d1,null));};exports[_0x700f('0x25')]=function(_0xba8966,_0x3bb197){return db[_0x700f('0x41')][_0x700f('0x43')]({'where':{'id':_0xba8966['params']['id']}})[_0x700f('0x24')](handleEntityNotFound(_0x3bb197,null))[_0x700f('0x24')](removeEntity(_0x3bb197,null))[_0x700f('0x3f')](handleError(_0x3bb197,null));};exports[_0x700f('0x46')]=function(_0x21ffdb,_0x3bd44e,_0x1d2629){var _0x39ee78={};var _0xfddc63={};var _0x4cb88e;var _0x5b0fc8;return db[_0x700f('0x41')][_0x700f('0x47')]({'where':{'id':_0x21ffdb[_0x700f('0x40')]['id']}})[_0x700f('0x24')](handleEntityNotFound(_0x3bd44e,null))[_0x700f('0x24')](function(_0x311737){if(_0x311737){_0x4cb88e=_0x311737;_0xfddc63['model']=_['keys'](db[_0x700f('0x48')][_0x700f('0x2b')]);_0xfddc63[_0x700f('0x2f')]=_['keys'](_0x21ffdb[_0x700f('0x2f')]);_0xfddc63[_0x700f('0x30')]=_[_0x700f('0x31')](_0xfddc63[_0x700f('0x2d')],_0xfddc63['query']);_0x39ee78[_0x700f('0x32')]=_[_0x700f('0x31')](_0xfddc63[_0x700f('0x2d')],qs[_0x700f('0x33')](_0x21ffdb[_0x700f('0x2f')][_0x700f('0x33')]));_0x39ee78[_0x700f('0x32')]=_0x39ee78[_0x700f('0x32')][_0x700f('0x34')]?_0x39ee78[_0x700f('0x32')]:_0xfddc63[_0x700f('0x2d')];_0x39ee78['order']=qs[_0x700f('0x38')](_0x21ffdb[_0x700f('0x2f')][_0x700f('0x38')]);_0x39ee78[_0x700f('0x39')]=qs[_0x700f('0x30')](_[_0x700f('0x3a')](_0x21ffdb[_0x700f('0x2f')],_0xfddc63[_0x700f('0x30')]));if(_0x21ffdb[_0x700f('0x2f')][_0x700f('0x3c')]){_0x39ee78['where']=_[_0x700f('0x3b')](_0x39ee78[_0x700f('0x39')],{'$or':_[_0x700f('0x2a')](_0x39ee78[_0x700f('0x32')],function(_0x5530a4){var _0x459d4b={};_0x459d4b[_0x5530a4]={'$like':'%'+_0x21ffdb[_0x700f('0x2f')]['filter']+'%'};return _0x459d4b;})});}_0x39ee78=_['merge']({},_0x39ee78,_0x21ffdb[_0x700f('0x3d')]);return _0x4cb88e[_0x700f('0x46')](_0x39ee78);}})[_0x700f('0x24')](function(_0x2dd91c){if(_0x2dd91c){_0x5b0fc8=_0x2dd91c['length'];if(!_0x21ffdb[_0x700f('0x2f')][_0x700f('0x35')](_0x700f('0x36'))){_0x39ee78[_0x700f('0x1d')]=qs['limit'](_0x21ffdb[_0x700f('0x2f')]['limit']);_0x39ee78[_0x700f('0x1b')]=qs[_0x700f('0x1b')](_0x21ffdb[_0x700f('0x2f')][_0x700f('0x1b')]);}return _0x4cb88e[_0x700f('0x46')](_0x39ee78);}})[_0x700f('0x24')](function(_0x1abd3c){if(_0x1abd3c){return _0x1abd3c?{'count':_0x5b0fc8,'rows':_0x1abd3c}:null;}})[_0x700f('0x24')](respondWithResult(_0x3bd44e,null))[_0x700f('0x3f')](handleError(_0x3bd44e,null));};exports[_0x700f('0x49')]=function(_0x23261c,_0x392f4a,_0x49dd9a){var _0x47b2c3={};var _0x17f478={};var _0x3e5dcf;var _0x5dd51c;return db[_0x700f('0x41')][_0x700f('0x47')]({'where':{'id':_0x23261c['params']['id']}})[_0x700f('0x24')](handleEntityNotFound(_0x392f4a,null))['then'](function(_0x5296fd){if(_0x5296fd){_0x3e5dcf=_0x5296fd;_0x17f478[_0x700f('0x2d')]=_[_0x700f('0x2e')](db['DeskField'][_0x700f('0x2b')]);_0x17f478[_0x700f('0x2f')]=_[_0x700f('0x2e')](_0x23261c[_0x700f('0x2f')]);_0x17f478[_0x700f('0x30')]=_[_0x700f('0x31')](_0x17f478['model'],_0x17f478[_0x700f('0x2f')]);_0x47b2c3[_0x700f('0x32')]=_[_0x700f('0x31')](_0x17f478['model'],qs[_0x700f('0x33')](_0x23261c[_0x700f('0x2f')][_0x700f('0x33')]));_0x47b2c3['attributes']=_0x47b2c3[_0x700f('0x32')]['length']?_0x47b2c3['attributes']:_0x17f478[_0x700f('0x2d')];_0x47b2c3[_0x700f('0x37')]=qs[_0x700f('0x38')](_0x23261c[_0x700f('0x2f')]['sort']);_0x47b2c3[_0x700f('0x39')]=qs['filters'](_['pick'](_0x23261c[_0x700f('0x2f')],_0x17f478[_0x700f('0x30')]));if(_0x23261c[_0x700f('0x2f')][_0x700f('0x3c')]){_0x47b2c3['where']=_[_0x700f('0x3b')](_0x47b2c3['where'],{'$or':_[_0x700f('0x2a')](_0x47b2c3[_0x700f('0x32')],function(_0x11d6ba){var _0x296e82={};_0x296e82[_0x11d6ba]={'$like':'%'+_0x23261c[_0x700f('0x2f')][_0x700f('0x3c')]+'%'};return _0x296e82;})});}_0x47b2c3=_[_0x700f('0x3b')]({},_0x47b2c3,_0x23261c[_0x700f('0x3d')]);return _0x3e5dcf['getSubjects'](_0x47b2c3);}})['then'](function(_0x1ed713){if(_0x1ed713){_0x5dd51c=_0x1ed713['length'];if(!_0x23261c['query'][_0x700f('0x35')](_0x700f('0x36'))){_0x47b2c3[_0x700f('0x1d')]=qs[_0x700f('0x1d')](_0x23261c[_0x700f('0x2f')][_0x700f('0x1d')]);_0x47b2c3[_0x700f('0x1b')]=qs[_0x700f('0x1b')](_0x23261c[_0x700f('0x2f')][_0x700f('0x1b')]);}return _0x3e5dcf[_0x700f('0x49')](_0x47b2c3);}})[_0x700f('0x24')](function(_0x332de6){if(_0x332de6){return _0x332de6?{'count':_0x5dd51c,'rows':_0x332de6}:null;}})[_0x700f('0x24')](respondWithResult(_0x392f4a,null))[_0x700f('0x3f')](handleError(_0x392f4a,null));};exports['getDescriptions']=function(_0x14dc44,_0x5709b3,_0x470242){var _0x3d1d57={};var _0x2eb0fe={};var _0x19eb15;var _0xa23a35;return db[_0x700f('0x41')][_0x700f('0x47')]({'where':{'id':_0x14dc44[_0x700f('0x40')]['id']}})[_0x700f('0x24')](handleEntityNotFound(_0x5709b3,null))[_0x700f('0x24')](function(_0x2e2284){if(_0x2e2284){_0x19eb15=_0x2e2284;_0x2eb0fe['model']=_[_0x700f('0x2e')](db['DeskField']['rawAttributes']);_0x2eb0fe[_0x700f('0x2f')]=_[_0x700f('0x2e')](_0x14dc44['query']);_0x2eb0fe[_0x700f('0x30')]=_[_0x700f('0x31')](_0x2eb0fe[_0x700f('0x2d')],_0x2eb0fe[_0x700f('0x2f')]);_0x3d1d57[_0x700f('0x32')]=_[_0x700f('0x31')](_0x2eb0fe[_0x700f('0x2d')],qs['fields'](_0x14dc44[_0x700f('0x2f')][_0x700f('0x33')]));_0x3d1d57[_0x700f('0x32')]=_0x3d1d57[_0x700f('0x32')][_0x700f('0x34')]?_0x3d1d57[_0x700f('0x32')]:_0x2eb0fe[_0x700f('0x2d')];_0x3d1d57[_0x700f('0x37')]=qs[_0x700f('0x38')](_0x14dc44[_0x700f('0x2f')]['sort']);_0x3d1d57[_0x700f('0x39')]=qs[_0x700f('0x30')](_['pick'](_0x14dc44[_0x700f('0x2f')],_0x2eb0fe[_0x700f('0x30')]));if(_0x14dc44[_0x700f('0x2f')][_0x700f('0x3c')]){_0x3d1d57[_0x700f('0x39')]=_[_0x700f('0x3b')](_0x3d1d57[_0x700f('0x39')],{'$or':_['map'](_0x3d1d57[_0x700f('0x32')],function(_0x3a9ffb){var _0x4e2a40={};_0x4e2a40[_0x3a9ffb]={'$like':'%'+_0x14dc44[_0x700f('0x2f')][_0x700f('0x3c')]+'%'};return _0x4e2a40;})});}_0x3d1d57=_[_0x700f('0x3b')]({},_0x3d1d57,_0x14dc44['options']);return _0x19eb15['getDescriptions'](_0x3d1d57);}})[_0x700f('0x24')](function(_0x57760b){if(_0x57760b){_0xa23a35=_0x57760b[_0x700f('0x34')];if(!_0x14dc44['query'][_0x700f('0x35')](_0x700f('0x36'))){_0x3d1d57['limit']=qs[_0x700f('0x1d')](_0x14dc44[_0x700f('0x2f')][_0x700f('0x1d')]);_0x3d1d57[_0x700f('0x1b')]=qs['offset'](_0x14dc44['query'][_0x700f('0x1b')]);}return _0x19eb15['getDescriptions'](_0x3d1d57);}})[_0x700f('0x24')](function(_0x4eb788){if(_0x4eb788){return _0x4eb788?{'count':_0xa23a35,'rows':_0x4eb788}:null;}})[_0x700f('0x24')](respondWithResult(_0x5709b3,null))[_0x700f('0x3f')](handleError(_0x5709b3,null));};exports[_0x700f('0x4a')]=function(_0x5af567,_0x4c50a9,_0x224638){var _0xb5b528={};var _0x2dbdff={};var _0x5086fa;var _0x272efc;return db[_0x700f('0x41')][_0x700f('0x47')]({'where':{'id':_0x5af567['params']['id']}})['then'](handleEntityNotFound(_0x4c50a9,null))[_0x700f('0x24')](function(_0xe4444b){if(_0xe4444b){_0x5086fa=_0xe4444b;_0x2dbdff['model']=_[_0x700f('0x2e')](db[_0x700f('0x4b')][_0x700f('0x2b')]);_0x2dbdff[_0x700f('0x2f')]=_['keys'](_0x5af567['query']);_0x2dbdff[_0x700f('0x30')]=_[_0x700f('0x31')](_0x2dbdff[_0x700f('0x2d')],_0x2dbdff[_0x700f('0x2f')]);_0xb5b528[_0x700f('0x32')]=_[_0x700f('0x31')](_0x2dbdff[_0x700f('0x2d')],qs['fields'](_0x5af567[_0x700f('0x2f')]['fields']));_0xb5b528[_0x700f('0x32')]=_0xb5b528[_0x700f('0x32')][_0x700f('0x34')]?_0xb5b528[_0x700f('0x32')]:_0x2dbdff[_0x700f('0x2d')];_0xb5b528[_0x700f('0x37')]=qs[_0x700f('0x38')](_0x5af567[_0x700f('0x2f')][_0x700f('0x38')]);_0xb5b528[_0x700f('0x39')]=qs[_0x700f('0x30')](_[_0x700f('0x3a')](_0x5af567[_0x700f('0x2f')],_0x2dbdff[_0x700f('0x30')]));if(_0x5af567[_0x700f('0x2f')][_0x700f('0x3c')]){_0xb5b528[_0x700f('0x39')]=_[_0x700f('0x3b')](_0xb5b528[_0x700f('0x39')],{'$or':_['map'](_0xb5b528[_0x700f('0x32')],function(_0x326d02){var _0x3619aa={};_0x3619aa[_0x326d02]={'$like':'%'+_0x5af567[_0x700f('0x2f')][_0x700f('0x3c')]+'%'};return _0x3619aa;})});}_0xb5b528=_['merge']({},_0xb5b528,_0x5af567[_0x700f('0x3d')]);return _0x5086fa['getTags'](_0xb5b528);}})[_0x700f('0x24')](function(_0x3adfa9){if(_0x3adfa9){_0x272efc=_0x3adfa9['length'];if(!_0x5af567[_0x700f('0x2f')][_0x700f('0x35')](_0x700f('0x36'))){_0xb5b528[_0x700f('0x1d')]=qs['limit'](_0x5af567[_0x700f('0x2f')][_0x700f('0x1d')]);_0xb5b528[_0x700f('0x1b')]=qs[_0x700f('0x1b')](_0x5af567[_0x700f('0x2f')][_0x700f('0x1b')]);}return _0x5086fa[_0x700f('0x4a')](_0xb5b528);}})['then'](function(_0x27864e){if(_0x27864e){return _0x27864e?{'count':_0x272efc,'rows':_0x27864e}:null;}})[_0x700f('0x24')](respondWithResult(_0x4c50a9,null))['catch'](handleError(_0x4c50a9,null));};exports[_0x700f('0x4c')]=function(_0x46643d,_0x41ad15,_0x13fa3){if(_0x46643d[_0x700f('0x45')]['id']){delete _0x46643d['body']['id'];}return db[_0x700f('0x41')]['findOne']({'where':{'id':_0x46643d[_0x700f('0x40')]['id']}})[_0x700f('0x24')](handleEntityNotFound(_0x41ad15,null))[_0x700f('0x24')](function(_0x49a2b4){if(_0x49a2b4){return _0x49a2b4[_0x700f('0x4c')](_0x46643d[_0x700f('0x45')][_0x700f('0x4d')]||[]);}return null;})[_0x700f('0x24')](respondWithResult(_0x41ad15,null))[_0x700f('0x3f')](handleError(_0x41ad15,null));}; \ No newline at end of file +var _0x44a4=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','findOne','DeskField','getFields','nolimit','getSubjects','hasOwnProperty','getDescriptions','order','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set'];(function(_0x31d73d,_0x280c02){var _0x53e143=function(_0x19deaa){while(--_0x19deaa){_0x31d73d['push'](_0x31d73d['shift']());}};_0x53e143(++_0x280c02);}(_0x44a4,0xe2));var _0x444a=function(_0x2bb84e,_0x4405ff){_0x2bb84e=_0x2bb84e-0x0;var _0x37d33d=_0x44a4[_0x2bb84e];return _0x37d33d;};'use strict';var emlformat=require(_0x444a('0x0'));var rimraf=require(_0x444a('0x1'));var zipdir=require(_0x444a('0x2'));var jsonpatch=require(_0x444a('0x3'));var rp=require(_0x444a('0x4'));var moment=require(_0x444a('0x5'));var BPromise=require(_0x444a('0x6'));var Mustache=require(_0x444a('0x7'));var util=require(_0x444a('0x8'));var path=require(_0x444a('0x9'));var sox=require(_0x444a('0xa'));var csv=require(_0x444a('0xb'));var ejs=require(_0x444a('0xc'));var fs=require('fs');var fs_extra=require(_0x444a('0xd'));var _=require('lodash');var squel=require(_0x444a('0xe'));var crypto=require('crypto');var jsforce=require(_0x444a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x444a('0xb'));var querystring=require(_0x444a('0x10'));var Papa=require(_0x444a('0x11'));var Redis=require('ioredis');var authService=require(_0x444a('0x12'));var qs=require(_0x444a('0x13'));var as=require(_0x444a('0x14'));var hardwareService=require(_0x444a('0x15'));var logger=require(_0x444a('0x16'))(_0x444a('0x17'));var utils=require(_0x444a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x444a('0x19'));var db=require(_0x444a('0x1a'))['db'];function respondWithStatusCode(_0x3f223b,_0x14a07f){_0x14a07f=_0x14a07f||0xcc;return function(_0x5afccd){if(_0x5afccd){return _0x3f223b['sendStatus'](_0x14a07f);}return _0x3f223b['status'](_0x14a07f)[_0x444a('0x1b')]();};}function respondWithResult(_0x2e95da,_0x2ed7c7){_0x2ed7c7=_0x2ed7c7||0xc8;return function(_0x457d29){if(_0x457d29){return _0x2e95da[_0x444a('0x1c')](_0x2ed7c7)[_0x444a('0x1d')](_0x457d29);}};}function respondWithFilteredResult(_0x2d5678,_0x57cf46){return function(_0x109014){if(_0x109014){var _0xa2529c=typeof _0x57cf46[_0x444a('0x1e')]===_0x444a('0x1f')&&typeof _0x57cf46[_0x444a('0x20')]===_0x444a('0x1f');var _0x24b845=_0x109014['count'];var _0x4476e3=_0xa2529c?0x0:_0x57cf46['offset'];var _0x433441=_0xa2529c?_0x109014[_0x444a('0x21')]:_0x57cf46[_0x444a('0x1e')]+_0x57cf46[_0x444a('0x20')];var _0x39871d;if(_0x433441>=_0x24b845){_0x433441=_0x24b845;_0x39871d=0xc8;}else{_0x39871d=0xce;}_0x2d5678[_0x444a('0x1c')](_0x39871d);return _0x2d5678[_0x444a('0x22')](_0x444a('0x23'),_0x4476e3+'-'+_0x433441+'/'+_0x24b845)[_0x444a('0x1d')](_0x109014);}return null;};}function patchUpdates(_0x5d4a60){return function(_0x89cadf){try{jsonpatch[_0x444a('0x24')](_0x89cadf,_0x5d4a60,!![]);}catch(_0x19d149){return BPromise[_0x444a('0x25')](_0x19d149);}return _0x89cadf[_0x444a('0x26')]();};}function saveUpdates(_0x18fb0d,_0x45f9ea){return function(_0x3aadfc){if(_0x3aadfc){return _0x3aadfc[_0x444a('0x27')](_0x18fb0d)[_0x444a('0x28')](function(_0x4fe8ab){return _0x4fe8ab;});}return null;};}function removeEntity(_0x43090f,_0x588750){return function(_0x4665dd){if(_0x4665dd){return _0x4665dd[_0x444a('0x29')]()['then'](function(){_0x43090f[_0x444a('0x1c')](0xcc)[_0x444a('0x1b')]();});}};}function handleEntityNotFound(_0x15ffce,_0x2642c2){return function(_0x2f935f){if(!_0x2f935f){_0x15ffce['sendStatus'](0x194);}return _0x2f935f;};}function handleError(_0x2a7539,_0x31e8ed){_0x31e8ed=_0x31e8ed||0x1f4;return function(_0x4c6e60){logger[_0x444a('0x2a')](_0x4c6e60[_0x444a('0x2b')]);if(_0x4c6e60[_0x444a('0x2c')]){delete _0x4c6e60[_0x444a('0x2c')];}_0x2a7539[_0x444a('0x1c')](_0x31e8ed)[_0x444a('0x2d')](_0x4c6e60);};}exports[_0x444a('0x2e')]=function(_0x286796,_0x4e3dc3){var _0x25bf2c={},_0x5332c4={},_0x3cad5f={'count':0x0,'rows':[]};var _0x10fc99=_[_0x444a('0x2f')](db[_0x444a('0x30')][_0x444a('0x31')],function(_0x4bb1f6){return{'name':_0x4bb1f6['fieldName'],'type':_0x4bb1f6['type'][_0x444a('0x32')]};});_0x5332c4[_0x444a('0x33')]=_[_0x444a('0x2f')](_0x10fc99,_0x444a('0x2c'));_0x5332c4[_0x444a('0x34')]=_['keys'](_0x286796[_0x444a('0x34')]);_0x5332c4[_0x444a('0x35')]=_['intersection'](_0x5332c4[_0x444a('0x33')],_0x5332c4[_0x444a('0x34')]);_0x25bf2c[_0x444a('0x36')]=_[_0x444a('0x37')](_0x5332c4[_0x444a('0x33')],qs['fields'](_0x286796[_0x444a('0x34')][_0x444a('0x38')]));_0x25bf2c[_0x444a('0x36')]=_0x25bf2c['attributes'][_0x444a('0x39')]?_0x25bf2c['attributes']:_0x5332c4[_0x444a('0x33')];if(!_0x286796[_0x444a('0x34')]['hasOwnProperty']('nolimit')){_0x25bf2c[_0x444a('0x20')]=qs[_0x444a('0x20')](_0x286796[_0x444a('0x34')]['limit']);_0x25bf2c[_0x444a('0x1e')]=qs[_0x444a('0x1e')](_0x286796[_0x444a('0x34')][_0x444a('0x1e')]);}_0x25bf2c['order']=qs[_0x444a('0x3a')](_0x286796['query']['sort']);_0x25bf2c[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x286796[_0x444a('0x34')],_0x5332c4[_0x444a('0x35')]),_0x10fc99);if(_0x286796[_0x444a('0x34')][_0x444a('0x3d')]){_0x25bf2c[_0x444a('0x3b')]=_[_0x444a('0x3e')](_0x25bf2c[_0x444a('0x3b')],{'$or':_[_0x444a('0x2f')](_0x10fc99,function(_0x11ae95){if(_0x11ae95[_0x444a('0x3f')]!=='VIRTUAL'){var _0x3c280d={};_0x3c280d[_0x11ae95['name']]={'$like':'%'+_0x286796[_0x444a('0x34')][_0x444a('0x3d')]+'%'};return _0x3c280d;}})});}_0x25bf2c=_[_0x444a('0x3e')]({},_0x25bf2c,_0x286796[_0x444a('0x40')]);var _0x1bacb4={'where':_0x25bf2c[_0x444a('0x3b')]};return db[_0x444a('0x30')][_0x444a('0x21')](_0x1bacb4)['then'](function(_0x5646b5){_0x3cad5f['count']=_0x5646b5;if(_0x286796[_0x444a('0x34')][_0x444a('0x41')]){_0x25bf2c[_0x444a('0x42')]=[{'all':!![]}];}return db[_0x444a('0x30')][_0x444a('0x43')](_0x25bf2c);})[_0x444a('0x28')](function(_0x3e1298){_0x3cad5f['rows']=_0x3e1298;return _0x3cad5f;})['then'](respondWithFilteredResult(_0x4e3dc3,_0x25bf2c))[_0x444a('0x44')](handleError(_0x4e3dc3,null));};exports[_0x444a('0x45')]=function(_0x3e10bc,_0x5c392b){var _0x275983={'raw':![],'where':{'id':_0x3e10bc[_0x444a('0x46')]['id']}},_0xea3efc={};_0xea3efc[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x30')][_0x444a('0x31')]);_0xea3efc[_0x444a('0x34')]=_[_0x444a('0x47')](_0x3e10bc[_0x444a('0x34')]);_0xea3efc[_0x444a('0x35')]=_[_0x444a('0x37')](_0xea3efc[_0x444a('0x33')],_0xea3efc[_0x444a('0x34')]);_0x275983[_0x444a('0x36')]=_[_0x444a('0x37')](_0xea3efc['model'],qs[_0x444a('0x38')](_0x3e10bc[_0x444a('0x34')][_0x444a('0x38')]));_0x275983['attributes']=_0x275983[_0x444a('0x36')]['length']?_0x275983[_0x444a('0x36')]:_0xea3efc[_0x444a('0x33')];if(_0x3e10bc[_0x444a('0x34')]['includeAll']){_0x275983[_0x444a('0x42')]=[{'all':!![]}];}_0x275983=_[_0x444a('0x3e')]({},_0x275983,_0x3e10bc[_0x444a('0x40')]);return db[_0x444a('0x30')][_0x444a('0x48')](_0x275983)[_0x444a('0x28')](handleEntityNotFound(_0x5c392b,null))[_0x444a('0x28')](respondWithResult(_0x5c392b,null))['catch'](handleError(_0x5c392b,null));};exports[_0x444a('0x49')]=function(_0x26fac1,_0x5bbd25){return db[_0x444a('0x30')]['create'](_0x26fac1[_0x444a('0x4a')],{})['then'](respondWithResult(_0x5bbd25,0xc9))[_0x444a('0x44')](handleError(_0x5bbd25,null));};exports[_0x444a('0x27')]=function(_0x5ab9c8,_0x589650){if(_0x5ab9c8[_0x444a('0x4a')]['id']){delete _0x5ab9c8[_0x444a('0x4a')]['id'];}return db[_0x444a('0x30')][_0x444a('0x48')]({'where':{'id':_0x5ab9c8[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x589650,null))[_0x444a('0x28')](saveUpdates(_0x5ab9c8[_0x444a('0x4a')],null))['then'](respondWithResult(_0x589650,null))[_0x444a('0x44')](handleError(_0x589650,null));};exports['destroy']=function(_0x14b9bb,_0x2bc1a2){return db[_0x444a('0x30')][_0x444a('0x48')]({'where':{'id':_0x14b9bb['params']['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x2bc1a2,null))['then'](removeEntity(_0x2bc1a2,null))[_0x444a('0x44')](handleError(_0x2bc1a2,null));};exports['getFields']=function(_0x10ea90,_0x2d28d3,_0x492a3a){var _0x4a7cbb={};var _0x51007a={};var _0x41ff95;var _0x580f4f;return db['DeskConfiguration'][_0x444a('0x4b')]({'where':{'id':_0x10ea90['params']['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x2d28d3,null))[_0x444a('0x28')](function(_0x35ae74){if(_0x35ae74){_0x41ff95=_0x35ae74;_0x51007a[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x4c')][_0x444a('0x31')]);_0x51007a[_0x444a('0x34')]=_['keys'](_0x10ea90[_0x444a('0x34')]);_0x51007a[_0x444a('0x35')]=_[_0x444a('0x37')](_0x51007a[_0x444a('0x33')],_0x51007a[_0x444a('0x34')]);_0x4a7cbb[_0x444a('0x36')]=_['intersection'](_0x51007a[_0x444a('0x33')],qs[_0x444a('0x38')](_0x10ea90[_0x444a('0x34')][_0x444a('0x38')]));_0x4a7cbb['attributes']=_0x4a7cbb[_0x444a('0x36')][_0x444a('0x39')]?_0x4a7cbb[_0x444a('0x36')]:_0x51007a[_0x444a('0x33')];_0x4a7cbb['order']=qs[_0x444a('0x3a')](_0x10ea90[_0x444a('0x34')][_0x444a('0x3a')]);_0x4a7cbb[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x10ea90[_0x444a('0x34')],_0x51007a['filters']));if(_0x10ea90[_0x444a('0x34')][_0x444a('0x3d')]){_0x4a7cbb[_0x444a('0x3b')]=_['merge'](_0x4a7cbb[_0x444a('0x3b')],{'$or':_[_0x444a('0x2f')](_0x4a7cbb[_0x444a('0x36')],function(_0x7930a9){var _0x1ed837={};_0x1ed837[_0x7930a9]={'$like':'%'+_0x10ea90[_0x444a('0x34')]['filter']+'%'};return _0x1ed837;})});}_0x4a7cbb=_[_0x444a('0x3e')]({},_0x4a7cbb,_0x10ea90[_0x444a('0x40')]);return _0x41ff95[_0x444a('0x4d')](_0x4a7cbb);}})['then'](function(_0x2c1869){if(_0x2c1869){_0x580f4f=_0x2c1869[_0x444a('0x39')];if(!_0x10ea90[_0x444a('0x34')]['hasOwnProperty'](_0x444a('0x4e'))){_0x4a7cbb[_0x444a('0x20')]=qs[_0x444a('0x20')](_0x10ea90[_0x444a('0x34')]['limit']);_0x4a7cbb[_0x444a('0x1e')]=qs['offset'](_0x10ea90['query'][_0x444a('0x1e')]);}return _0x41ff95[_0x444a('0x4d')](_0x4a7cbb);}})[_0x444a('0x28')](function(_0x39e633){if(_0x39e633){return _0x39e633?{'count':_0x580f4f,'rows':_0x39e633}:null;}})[_0x444a('0x28')](respondWithResult(_0x2d28d3,null))[_0x444a('0x44')](handleError(_0x2d28d3,null));};exports[_0x444a('0x4f')]=function(_0x5efa04,_0x3bfc59,_0x26fbae){var _0x2c2d00={};var _0x52c01c={};var _0x3a5cf1;var _0x1e4361;return db[_0x444a('0x30')][_0x444a('0x4b')]({'where':{'id':_0x5efa04[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x3bfc59,null))[_0x444a('0x28')](function(_0x16ae76){if(_0x16ae76){_0x3a5cf1=_0x16ae76;_0x52c01c[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x4c')]['rawAttributes']);_0x52c01c[_0x444a('0x34')]=_[_0x444a('0x47')](_0x5efa04['query']);_0x52c01c['filters']=_[_0x444a('0x37')](_0x52c01c['model'],_0x52c01c[_0x444a('0x34')]);_0x2c2d00[_0x444a('0x36')]=_[_0x444a('0x37')](_0x52c01c['model'],qs[_0x444a('0x38')](_0x5efa04[_0x444a('0x34')][_0x444a('0x38')]));_0x2c2d00['attributes']=_0x2c2d00['attributes']['length']?_0x2c2d00['attributes']:_0x52c01c['model'];_0x2c2d00['order']=qs['sort'](_0x5efa04[_0x444a('0x34')][_0x444a('0x3a')]);_0x2c2d00[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x5efa04[_0x444a('0x34')],_0x52c01c[_0x444a('0x35')]));if(_0x5efa04[_0x444a('0x34')][_0x444a('0x3d')]){_0x2c2d00[_0x444a('0x3b')]=_['merge'](_0x2c2d00[_0x444a('0x3b')],{'$or':_['map'](_0x2c2d00['attributes'],function(_0x23a7b1){var _0x18178c={};_0x18178c[_0x23a7b1]={'$like':'%'+_0x5efa04[_0x444a('0x34')][_0x444a('0x3d')]+'%'};return _0x18178c;})});}_0x2c2d00=_[_0x444a('0x3e')]({},_0x2c2d00,_0x5efa04['options']);return _0x3a5cf1[_0x444a('0x4f')](_0x2c2d00);}})[_0x444a('0x28')](function(_0xe3a4c0){if(_0xe3a4c0){_0x1e4361=_0xe3a4c0[_0x444a('0x39')];if(!_0x5efa04[_0x444a('0x34')][_0x444a('0x50')](_0x444a('0x4e'))){_0x2c2d00['limit']=qs[_0x444a('0x20')](_0x5efa04[_0x444a('0x34')]['limit']);_0x2c2d00[_0x444a('0x1e')]=qs['offset'](_0x5efa04[_0x444a('0x34')][_0x444a('0x1e')]);}return _0x3a5cf1[_0x444a('0x4f')](_0x2c2d00);}})[_0x444a('0x28')](function(_0xe685bc){if(_0xe685bc){return _0xe685bc?{'count':_0x1e4361,'rows':_0xe685bc}:null;}})['then'](respondWithResult(_0x3bfc59,null))['catch'](handleError(_0x3bfc59,null));};exports[_0x444a('0x51')]=function(_0x1c733c,_0x4f04e0,_0x28ce13){var _0x42aaf3={};var _0x27a7df={};var _0x3d664c;var _0x2ea405;return db[_0x444a('0x30')]['findOne']({'where':{'id':_0x1c733c[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x4f04e0,null))[_0x444a('0x28')](function(_0x1a94af){if(_0x1a94af){_0x3d664c=_0x1a94af;_0x27a7df['model']=_['keys'](db[_0x444a('0x4c')][_0x444a('0x31')]);_0x27a7df[_0x444a('0x34')]=_['keys'](_0x1c733c[_0x444a('0x34')]);_0x27a7df[_0x444a('0x35')]=_['intersection'](_0x27a7df[_0x444a('0x33')],_0x27a7df[_0x444a('0x34')]);_0x42aaf3[_0x444a('0x36')]=_[_0x444a('0x37')](_0x27a7df[_0x444a('0x33')],qs[_0x444a('0x38')](_0x1c733c[_0x444a('0x34')][_0x444a('0x38')]));_0x42aaf3[_0x444a('0x36')]=_0x42aaf3['attributes'][_0x444a('0x39')]?_0x42aaf3['attributes']:_0x27a7df['model'];_0x42aaf3[_0x444a('0x52')]=qs['sort'](_0x1c733c[_0x444a('0x34')]['sort']);_0x42aaf3[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x1c733c[_0x444a('0x34')],_0x27a7df['filters']));if(_0x1c733c[_0x444a('0x34')][_0x444a('0x3d')]){_0x42aaf3['where']=_[_0x444a('0x3e')](_0x42aaf3['where'],{'$or':_[_0x444a('0x2f')](_0x42aaf3[_0x444a('0x36')],function(_0x42a7bf){var _0x44db2a={};_0x44db2a[_0x42a7bf]={'$like':'%'+_0x1c733c[_0x444a('0x34')][_0x444a('0x3d')]+'%'};return _0x44db2a;})});}_0x42aaf3=_['merge']({},_0x42aaf3,_0x1c733c['options']);return _0x3d664c[_0x444a('0x51')](_0x42aaf3);}})[_0x444a('0x28')](function(_0x5dc3b8){if(_0x5dc3b8){_0x2ea405=_0x5dc3b8[_0x444a('0x39')];if(!_0x1c733c[_0x444a('0x34')][_0x444a('0x50')](_0x444a('0x4e'))){_0x42aaf3['limit']=qs[_0x444a('0x20')](_0x1c733c[_0x444a('0x34')][_0x444a('0x20')]);_0x42aaf3[_0x444a('0x1e')]=qs['offset'](_0x1c733c['query']['offset']);}return _0x3d664c[_0x444a('0x51')](_0x42aaf3);}})[_0x444a('0x28')](function(_0x49aca9){if(_0x49aca9){return _0x49aca9?{'count':_0x2ea405,'rows':_0x49aca9}:null;}})[_0x444a('0x28')](respondWithResult(_0x4f04e0,null))[_0x444a('0x44')](handleError(_0x4f04e0,null));};exports['getTags']=function(_0x5e35c1,_0x5722d3,_0x226435){var _0x3a0d55={};var _0x5b0166={};var _0x80047;var _0x4d41ad;return db['DeskConfiguration'][_0x444a('0x4b')]({'where':{'id':_0x5e35c1['params']['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x5722d3,null))[_0x444a('0x28')](function(_0xb54351){if(_0xb54351){_0x80047=_0xb54351;_0x5b0166[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x53')][_0x444a('0x31')]);_0x5b0166[_0x444a('0x34')]=_[_0x444a('0x47')](_0x5e35c1[_0x444a('0x34')]);_0x5b0166[_0x444a('0x35')]=_[_0x444a('0x37')](_0x5b0166[_0x444a('0x33')],_0x5b0166[_0x444a('0x34')]);_0x3a0d55[_0x444a('0x36')]=_[_0x444a('0x37')](_0x5b0166[_0x444a('0x33')],qs[_0x444a('0x38')](_0x5e35c1[_0x444a('0x34')][_0x444a('0x38')]));_0x3a0d55['attributes']=_0x3a0d55[_0x444a('0x36')][_0x444a('0x39')]?_0x3a0d55[_0x444a('0x36')]:_0x5b0166[_0x444a('0x33')];_0x3a0d55[_0x444a('0x52')]=qs[_0x444a('0x3a')](_0x5e35c1[_0x444a('0x34')]['sort']);_0x3a0d55[_0x444a('0x3b')]=qs[_0x444a('0x35')](_['pick'](_0x5e35c1[_0x444a('0x34')],_0x5b0166[_0x444a('0x35')]));if(_0x5e35c1['query'][_0x444a('0x3d')]){_0x3a0d55['where']=_[_0x444a('0x3e')](_0x3a0d55[_0x444a('0x3b')],{'$or':_[_0x444a('0x2f')](_0x3a0d55[_0x444a('0x36')],function(_0x8c5516){var _0x40de3f={};_0x40de3f[_0x8c5516]={'$like':'%'+_0x5e35c1[_0x444a('0x34')]['filter']+'%'};return _0x40de3f;})});}_0x3a0d55=_[_0x444a('0x3e')]({},_0x3a0d55,_0x5e35c1[_0x444a('0x40')]);return _0x80047[_0x444a('0x54')](_0x3a0d55);}})[_0x444a('0x28')](function(_0x27819a){if(_0x27819a){_0x4d41ad=_0x27819a[_0x444a('0x39')];if(!_0x5e35c1[_0x444a('0x34')]['hasOwnProperty'](_0x444a('0x4e'))){_0x3a0d55[_0x444a('0x20')]=qs[_0x444a('0x20')](_0x5e35c1[_0x444a('0x34')][_0x444a('0x20')]);_0x3a0d55[_0x444a('0x1e')]=qs[_0x444a('0x1e')](_0x5e35c1[_0x444a('0x34')][_0x444a('0x1e')]);}return _0x80047[_0x444a('0x54')](_0x3a0d55);}})['then'](function(_0x278bb1){if(_0x278bb1){return _0x278bb1?{'count':_0x4d41ad,'rows':_0x278bb1}:null;}})[_0x444a('0x28')](respondWithResult(_0x5722d3,null))['catch'](handleError(_0x5722d3,null));};exports[_0x444a('0x55')]=function(_0x1c0057,_0x31a044,_0xf754f){if(_0x1c0057[_0x444a('0x4a')]['id']){delete _0x1c0057['body']['id'];}return db[_0x444a('0x30')][_0x444a('0x4b')]({'where':{'id':_0x1c0057[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x31a044,null))[_0x444a('0x28')](function(_0x21356d){if(_0x21356d){return _0x21356d[_0x444a('0x55')](_0x1c0057[_0x444a('0x4a')][_0x444a('0x56')]||[]);}return null;})[_0x444a('0x28')](respondWithResult(_0x31a044,null))[_0x444a('0x44')](handleError(_0x31a044,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 141dc0e..1a4b04a 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc551=['define','int_desk_configurations','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xc551,0xbd));var _0x1c55=function(_0x545151,_0x47b5df){_0x545151=_0x545151-0x0;var _0x39c992=_0xc551[_0x545151];return _0x39c992;};'use strict';var _=require(_0x1c55('0x0'));var util=require('util');var logger=require(_0x1c55('0x1'))('api');var moment=require(_0x1c55('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c55('0x3'));var fs=require('fs');var path=require(_0x1c55('0x4'));var rimraf=require(_0x1c55('0x5'));var config=require(_0x1c55('0x6'));var attributes=require(_0x1c55('0x7'));module[_0x1c55('0x8')]=function(_0x1c28ba,_0x4fdfbc){return _0x1c28ba[_0x1c55('0x9')]('DeskConfiguration',attributes,{'tableName':_0x1c55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d5d=['api','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger'];(function(_0xebb14a,_0x7375a2){var _0x2024a8=function(_0x1784b3){while(--_0x1784b3){_0xebb14a['push'](_0xebb14a['shift']());}};_0x2024a8(++_0x7375a2);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x3d5d[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var logger=require(_0xd3d5('0x1'))(_0xd3d5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3d5('0x3'));var fs=require('fs');var path=require(_0xd3d5('0x4'));var rimraf=require(_0xd3d5('0x5'));var config=require(_0xd3d5('0x6'));var attributes=require(_0xd3d5('0x7'));module[_0xd3d5('0x8')]=function(_0x52d8ae,_0x440936){return _0x52d8ae[_0xd3d5('0x9')](_0xd3d5('0xa'),attributes,{'tableName':_0xd3d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index aea5805..fcf41ab 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6426=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x50c96f,_0x2ee009){var _0x38fcf2=function(_0x299a4d){while(--_0x299a4d){_0x50c96f['push'](_0x50c96f['shift']());}};_0x38fcf2(++_0x2ee009);}(_0x6426,0x15b));var _0x6642=function(_0x4f1ee6,_0x16e924){_0x4f1ee6=_0x4f1ee6-0x0;var _0x10aabf=_0x6426[_0x4f1ee6];return _0x10aabf;};'use strict';var _=require(_0x6642('0x0'));var util=require(_0x6642('0x1'));var moment=require(_0x6642('0x2'));var BPromise=require(_0x6642('0x3'));var rs=require(_0x6642('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6642('0x5'))['db'];var utils=require(_0x6642('0x6'));var logger=require('../../config/logger')(_0x6642('0x7'));var config=require(_0x6642('0x8'));var jayson=require(_0x6642('0x9'));var client=jayson[_0x6642('0xa')][_0x6642('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6b1ef0,_0x5d149a,_0x1f9b53){return new BPromise(function(_0x1cf31a,_0x30746e){return client[_0x6642('0xc')](_0x6b1ef0,_0x1f9b53)[_0x6642('0xd')](function(_0x10606c){logger[_0x6642('0xe')](_0x6642('0xf'),_0x5d149a,_0x6642('0x10'));logger[_0x6642('0x11')](_0x6642('0x12'),_0x5d149a,_0x6642('0x10'),JSON[_0x6642('0x13')](_0x10606c));if(_0x10606c['error']){if(_0x10606c[_0x6642('0x14')][_0x6642('0x15')]===0x1f4){logger[_0x6642('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x5d149a,_0x10606c['error'][_0x6642('0x16')]);return _0x30746e(_0x10606c[_0x6642('0x14')][_0x6642('0x16')]);}logger[_0x6642('0x14')](_0x6642('0xf'),_0x5d149a,_0x10606c[_0x6642('0x14')]['message']);return _0x1cf31a(_0x10606c[_0x6642('0x14')][_0x6642('0x16')]);}else{logger[_0x6642('0xe')](_0x6642('0xf'),_0x5d149a,_0x6642('0x10'));_0x1cf31a(_0x10606c[_0x6642('0x17')]['message']);}})[_0x6642('0x18')](function(_0x1fba71){logger[_0x6642('0x14')](_0x6642('0xf'),_0x5d149a,_0x1fba71);_0x30746e(_0x1fba71);});});} \ No newline at end of file +var _0x5386=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util'];(function(_0x24de1b,_0x3dd173){var _0x47ff0a=function(_0x242017){while(--_0x242017){_0x24de1b['push'](_0x24de1b['shift']());}};_0x47ff0a(++_0x3dd173);}(_0x5386,0x1e1));var _0x6538=function(_0x2bafde,_0x39326c){_0x2bafde=_0x2bafde-0x0;var _0x5733dc=_0x5386[_0x2bafde];return _0x5733dc;};'use strict';var _=require(_0x6538('0x0'));var util=require(_0x6538('0x1'));var moment=require(_0x6538('0x2'));var BPromise=require(_0x6538('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6538('0x4'));var db=require(_0x6538('0x5'))['db'];var utils=require(_0x6538('0x6'));var logger=require(_0x6538('0x7'))(_0x6538('0x8'));var config=require(_0x6538('0x9'));var jayson=require(_0x6538('0xa'));var client=jayson[_0x6538('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16c291,_0x4b0e05,_0x16d67){return new BPromise(function(_0x28e83b,_0x113fe4){return client[_0x6538('0xc')](_0x16c291,_0x16d67)[_0x6538('0xd')](function(_0x2bce05){logger[_0x6538('0xe')](_0x6538('0xf'),_0x4b0e05,_0x6538('0x10'));logger[_0x6538('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4b0e05,_0x6538('0x10'),JSON[_0x6538('0x12')](_0x2bce05));if(_0x2bce05[_0x6538('0x13')]){if(_0x2bce05['error'][_0x6538('0x14')]===0x1f4){logger['error'](_0x6538('0xf'),_0x4b0e05,_0x2bce05[_0x6538('0x13')]['message']);return _0x113fe4(_0x2bce05[_0x6538('0x13')][_0x6538('0x15')]);}logger['error'](_0x6538('0xf'),_0x4b0e05,_0x2bce05[_0x6538('0x13')][_0x6538('0x15')]);return _0x28e83b(_0x2bce05['error'][_0x6538('0x15')]);}else{logger['info'](_0x6538('0xf'),_0x4b0e05,_0x6538('0x10'));_0x28e83b(_0x2bce05[_0x6538('0x16')][_0x6538('0x15')]);}})['catch'](function(_0x7caa07){logger[_0x6538('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x4b0e05,_0x7caa07);_0x113fe4(_0x7caa07);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d471634..8d12ee4 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x287f=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x41256f,_0x418ae6){var _0x572145=function(_0x59ca9a){while(--_0x59ca9a){_0x41256f['push'](_0x41256f['shift']());}};_0x572145(++_0x418ae6);}(_0x287f,0x150));var _0xf287=function(_0x243f29,_0x2ad99c){_0x243f29=_0x243f29-0x0;var _0x1474e=_0x287f[_0x243f29];return _0x1474e;};'use strict';var multer=require(_0xf287('0x0'));var util=require('util');var path=require(_0xf287('0x1'));var timeout=require(_0xf287('0x2'));var express=require(_0xf287('0x3'));var router=express[_0xf287('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf287('0x5'));var interaction=require(_0xf287('0x6'));var config=require(_0xf287('0x7'));var controller=require(_0xf287('0x8'));router[_0xf287('0x9')]('/',auth['isAuthenticated'](),controller[_0xf287('0xa')]);router[_0xf287('0x9')](_0xf287('0xb'),auth[_0xf287('0xc')](),controller[_0xf287('0xd')]);router[_0xf287('0xe')]('/',auth[_0xf287('0xc')](),controller[_0xf287('0xf')]);router['put'](_0xf287('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf287('0x10')](_0xf287('0xb'),auth[_0xf287('0xc')](),controller[_0xf287('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4373=['get','isAuthenticated','index','/:id','create','update','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c6e25,_0x3b40d9){var _0x1250c1=function(_0x58859b){while(--_0x58859b){_0x3c6e25['push'](_0x3c6e25['shift']());}};_0x1250c1(++_0x3b40d9);}(_0x4373,0xfe));var _0x3437=function(_0x2c9c36,_0x11d199){_0x2c9c36=_0x2c9c36-0x0;var _0x4f2f55=_0x4373[_0x2c9c36];return _0x4f2f55;};'use strict';var multer=require(_0x3437('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3437('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3437('0x2'));var auth=require(_0x3437('0x3'));var interaction=require(_0x3437('0x4'));var config=require(_0x3437('0x5'));var controller=require('./intDeskField.controller');router[_0x3437('0x6')]('/',auth[_0x3437('0x7')](),controller[_0x3437('0x8')]);router[_0x3437('0x6')](_0x3437('0x9'),auth[_0x3437('0x7')](),controller['show']);router['post']('/',auth[_0x3437('0x7')](),controller[_0x3437('0xa')]);router['put'](_0x3437('0x9'),auth[_0x3437('0x7')](),controller[_0x3437('0xb')]);router['delete'](_0x3437('0x9'),auth['isAuthenticated'](),controller[_0x3437('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6497f00..3f6bd32 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2219=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2219,0x18f));var _0x9221=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x2219[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x9221('0x0'));module[_0x9221('0x1')]={'type':{'type':Sequelize[_0x9221('0x2')](_0x9221('0x3'),_0x9221('0x4'),_0x9221('0x5'),_0x9221('0x6'),_0x9221('0x7')),'defaultValue':_0x9221('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9221('0x8')]},'keyType':{'type':Sequelize[_0x9221('0x2')](_0x9221('0x3'),'variable',_0x9221('0x5'))},'keyContent':{'type':Sequelize[_0x9221('0x8')]},'idField':{'type':Sequelize[_0x9221('0x8')]},'nameField':{'type':Sequelize[_0x9221('0x8')]},'customField':{'type':Sequelize[_0x9221('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcc2b=['ENUM','string','variable','customVariable','picklist','BOOLEAN','sequelize','exports'];(function(_0x343dea,_0x45fe7f){var _0x5eab0b=function(_0x53e9e5){while(--_0x53e9e5){_0x343dea['push'](_0x343dea['shift']());}};_0x5eab0b(++_0x45fe7f);}(_0xcc2b,0xb6));var _0xbcc2=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xcc2b[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require(_0xbcc2('0x0'));module[_0xbcc2('0x1')]={'type':{'type':Sequelize[_0xbcc2('0x2')](_0xbcc2('0x3'),_0xbcc2('0x4'),_0xbcc2('0x5'),'keyValue',_0xbcc2('0x6')),'defaultValue':_0xbcc2('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbcc2('0x3'),_0xbcc2('0x4'),_0xbcc2('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbcc2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ec98057..a6a8faf 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c97=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','DeskField','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection'];(function(_0x154385,_0x4b7a00){var _0x2b5ffb=function(_0x200ac2){while(--_0x200ac2){_0x154385['push'](_0x154385['shift']());}};_0x2b5ffb(++_0x4b7a00);}(_0x8c97,0x194));var _0x78c9=function(_0x27ecb1,_0x5f29a8){_0x27ecb1=_0x27ecb1-0x0;var _0x1b02ca=_0x8c97[_0x27ecb1];return _0x1b02ca;};'use strict';var emlformat=require(_0x78c9('0x0'));var rimraf=require(_0x78c9('0x1'));var zipdir=require(_0x78c9('0x2'));var jsonpatch=require(_0x78c9('0x3'));var rp=require('request-promise');var moment=require(_0x78c9('0x4'));var BPromise=require(_0x78c9('0x5'));var Mustache=require('mustache');var util=require(_0x78c9('0x6'));var path=require(_0x78c9('0x7'));var sox=require(_0x78c9('0x8'));var csv=require(_0x78c9('0x9'));var ejs=require(_0x78c9('0xa'));var fs=require('fs');var fs_extra=require(_0x78c9('0xb'));var _=require(_0x78c9('0xc'));var squel=require(_0x78c9('0xd'));var crypto=require(_0x78c9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x78c9('0xf'));var toCsv=require(_0x78c9('0x9'));var querystring=require(_0x78c9('0x10'));var Papa=require('papaparse');var Redis=require(_0x78c9('0x11'));var authService=require(_0x78c9('0x12'));var qs=require(_0x78c9('0x13'));var as=require(_0x78c9('0x14'));var hardwareService=require(_0x78c9('0x15'));var logger=require(_0x78c9('0x16'))(_0x78c9('0x17'));var utils=require('../../config/utils');var config=require(_0x78c9('0x18'));var licenseUtil=require(_0x78c9('0x19'));var db=require(_0x78c9('0x1a'))['db'];function respondWithStatusCode(_0x5e515e,_0x3f21a6){_0x3f21a6=_0x3f21a6||0xcc;return function(_0x5e450d){if(_0x5e450d){return _0x5e515e['sendStatus'](_0x3f21a6);}return _0x5e515e[_0x78c9('0x1b')](_0x3f21a6)[_0x78c9('0x1c')]();};}function respondWithResult(_0x4e051a,_0x58be8c){_0x58be8c=_0x58be8c||0xc8;return function(_0x3010d3){if(_0x3010d3){return _0x4e051a[_0x78c9('0x1b')](_0x58be8c)[_0x78c9('0x1d')](_0x3010d3);}};}function respondWithFilteredResult(_0x3ad95d,_0x34a7b2){return function(_0x2d440d){if(_0x2d440d){var _0x5b6476=typeof _0x34a7b2[_0x78c9('0x1e')]===_0x78c9('0x1f')&&typeof _0x34a7b2[_0x78c9('0x20')]===_0x78c9('0x1f');var _0x41ad55=_0x2d440d[_0x78c9('0x21')];var _0x11ae39=_0x5b6476?0x0:_0x34a7b2['offset'];var _0x5b8633=_0x5b6476?_0x2d440d[_0x78c9('0x21')]:_0x34a7b2[_0x78c9('0x1e')]+_0x34a7b2[_0x78c9('0x20')];var _0x33d630;if(_0x5b8633>=_0x41ad55){_0x5b8633=_0x41ad55;_0x33d630=0xc8;}else{_0x33d630=0xce;}_0x3ad95d[_0x78c9('0x1b')](_0x33d630);return _0x3ad95d['set']('Content-Range',_0x11ae39+'-'+_0x5b8633+'/'+_0x41ad55)[_0x78c9('0x1d')](_0x2d440d);}return null;};}function patchUpdates(_0x3c4143){return function(_0x39f180){try{jsonpatch['apply'](_0x39f180,_0x3c4143,!![]);}catch(_0x3ab4e9){return BPromise[_0x78c9('0x22')](_0x3ab4e9);}return _0x39f180[_0x78c9('0x23')]();};}function saveUpdates(_0x23d34c,_0x4d4563){return function(_0x2a0892){if(_0x2a0892){return _0x2a0892[_0x78c9('0x24')](_0x23d34c)[_0x78c9('0x25')](function(_0x4e41d3){return _0x4e41d3;});}return null;};}function removeEntity(_0x3c8adb,_0x45069d){return function(_0xcfa065){if(_0xcfa065){return _0xcfa065['destroy']()[_0x78c9('0x25')](function(){_0x3c8adb['status'](0xcc)[_0x78c9('0x1c')]();});}};}function handleEntityNotFound(_0x4ffae8,_0x426088){return function(_0x32684b){if(!_0x32684b){_0x4ffae8['sendStatus'](0x194);}return _0x32684b;};}function handleError(_0x58036f,_0x31b38b){_0x31b38b=_0x31b38b||0x1f4;return function(_0x3e313a){logger[_0x78c9('0x26')](_0x3e313a[_0x78c9('0x27')]);if(_0x3e313a[_0x78c9('0x28')]){delete _0x3e313a[_0x78c9('0x28')];}_0x58036f['status'](_0x31b38b)[_0x78c9('0x29')](_0x3e313a);};}exports[_0x78c9('0x2a')]=function(_0x949c5d,_0x125a3b){var _0x1298db={},_0x500b0c={},_0x12cbc0={'count':0x0,'rows':[]};var _0x3617b6=_['map'](db['DeskField'][_0x78c9('0x2b')],function(_0x5e02f9){return{'name':_0x5e02f9[_0x78c9('0x2c')],'type':_0x5e02f9[_0x78c9('0x2d')][_0x78c9('0x2e')]};});_0x500b0c[_0x78c9('0x2f')]=_[_0x78c9('0x30')](_0x3617b6,_0x78c9('0x28'));_0x500b0c[_0x78c9('0x31')]=_[_0x78c9('0x32')](_0x949c5d[_0x78c9('0x31')]);_0x500b0c['filters']=_['intersection'](_0x500b0c['model'],_0x500b0c[_0x78c9('0x31')]);_0x1298db['attributes']=_[_0x78c9('0x33')](_0x500b0c['model'],qs[_0x78c9('0x34')](_0x949c5d[_0x78c9('0x31')][_0x78c9('0x34')]));_0x1298db['attributes']=_0x1298db[_0x78c9('0x35')][_0x78c9('0x36')]?_0x1298db['attributes']:_0x500b0c[_0x78c9('0x2f')];if(!_0x949c5d[_0x78c9('0x31')][_0x78c9('0x37')](_0x78c9('0x38'))){_0x1298db[_0x78c9('0x20')]=qs[_0x78c9('0x20')](_0x949c5d['query']['limit']);_0x1298db['offset']=qs['offset'](_0x949c5d[_0x78c9('0x31')]['offset']);}_0x1298db[_0x78c9('0x39')]=qs[_0x78c9('0x3a')](_0x949c5d[_0x78c9('0x31')][_0x78c9('0x3a')]);_0x1298db[_0x78c9('0x3b')]=qs['filters'](_[_0x78c9('0x3c')](_0x949c5d[_0x78c9('0x31')],_0x500b0c[_0x78c9('0x3d')]),_0x3617b6);if(_0x949c5d[_0x78c9('0x31')][_0x78c9('0x3e')]){_0x1298db[_0x78c9('0x3b')]=_['merge'](_0x1298db[_0x78c9('0x3b')],{'$or':_[_0x78c9('0x30')](_0x3617b6,function(_0x20e36b){if(_0x20e36b[_0x78c9('0x2d')]!=='VIRTUAL'){var _0x2f1e33={};_0x2f1e33[_0x20e36b['name']]={'$like':'%'+_0x949c5d[_0x78c9('0x31')][_0x78c9('0x3e')]+'%'};return _0x2f1e33;}})});}_0x1298db=_[_0x78c9('0x3f')]({},_0x1298db,_0x949c5d['options']);var _0xd6deaa={'where':_0x1298db['where']};return db[_0x78c9('0x40')][_0x78c9('0x21')](_0xd6deaa)['then'](function(_0x225bcf){_0x12cbc0[_0x78c9('0x21')]=_0x225bcf;if(_0x949c5d[_0x78c9('0x31')][_0x78c9('0x41')]){_0x1298db[_0x78c9('0x42')]=[{'all':!![]}];}return db[_0x78c9('0x40')][_0x78c9('0x43')](_0x1298db);})[_0x78c9('0x25')](function(_0xf528b1){_0x12cbc0['rows']=_0xf528b1;return _0x12cbc0;})[_0x78c9('0x25')](respondWithFilteredResult(_0x125a3b,_0x1298db))[_0x78c9('0x44')](handleError(_0x125a3b,null));};exports[_0x78c9('0x45')]=function(_0x2a4f2b,_0x41bbd0){var _0x2b1132={'raw':!![],'where':{'id':_0x2a4f2b[_0x78c9('0x46')]['id']}},_0x4541b2={};_0x4541b2[_0x78c9('0x2f')]=_['keys'](db[_0x78c9('0x40')][_0x78c9('0x2b')]);_0x4541b2['query']=_[_0x78c9('0x32')](_0x2a4f2b[_0x78c9('0x31')]);_0x4541b2[_0x78c9('0x3d')]=_['intersection'](_0x4541b2['model'],_0x4541b2[_0x78c9('0x31')]);_0x2b1132[_0x78c9('0x35')]=_['intersection'](_0x4541b2[_0x78c9('0x2f')],qs[_0x78c9('0x34')](_0x2a4f2b[_0x78c9('0x31')][_0x78c9('0x34')]));_0x2b1132['attributes']=_0x2b1132[_0x78c9('0x35')][_0x78c9('0x36')]?_0x2b1132[_0x78c9('0x35')]:_0x4541b2[_0x78c9('0x2f')];if(_0x2a4f2b[_0x78c9('0x31')]['includeAll']){_0x2b1132[_0x78c9('0x42')]=[{'all':!![]}];}_0x2b1132=_['merge']({},_0x2b1132,_0x2a4f2b[_0x78c9('0x47')]);return db['DeskField']['find'](_0x2b1132)[_0x78c9('0x25')](handleEntityNotFound(_0x41bbd0,null))[_0x78c9('0x25')](respondWithResult(_0x41bbd0,null))[_0x78c9('0x44')](handleError(_0x41bbd0,null));};exports[_0x78c9('0x48')]=function(_0x32fe08,_0x50481a){return db['DeskField'][_0x78c9('0x48')](_0x32fe08['body'],{})[_0x78c9('0x25')](respondWithResult(_0x50481a,0xc9))[_0x78c9('0x44')](handleError(_0x50481a,null));};exports[_0x78c9('0x24')]=function(_0x307405,_0x2ae60b){if(_0x307405['body']['id']){delete _0x307405[_0x78c9('0x49')]['id'];}return db[_0x78c9('0x40')][_0x78c9('0x4a')]({'where':{'id':_0x307405[_0x78c9('0x46')]['id']}})[_0x78c9('0x25')](handleEntityNotFound(_0x2ae60b,null))[_0x78c9('0x25')](saveUpdates(_0x307405[_0x78c9('0x49')],null))[_0x78c9('0x25')](respondWithResult(_0x2ae60b,null))[_0x78c9('0x44')](handleError(_0x2ae60b,null));};exports[_0x78c9('0x4b')]=function(_0x2a46ff,_0x57305d){return db[_0x78c9('0x40')][_0x78c9('0x4a')]({'where':{'id':_0x2a46ff[_0x78c9('0x46')]['id']}})['then'](handleEntityNotFound(_0x57305d,null))[_0x78c9('0x25')](removeEntity(_0x57305d,null))[_0x78c9('0x44')](handleError(_0x57305d,null));}; \ No newline at end of file +var _0x83e3=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','index','map','DeskField','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','merge','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x274509,_0x1353f7){var _0x47298c=function(_0x514eaf){while(--_0x514eaf){_0x274509['push'](_0x274509['shift']());}};_0x47298c(++_0x1353f7);}(_0x83e3,0xc1));var _0x383e=function(_0x5c0eb9,_0x1e0fa9){_0x5c0eb9=_0x5c0eb9-0x0;var _0x168f80=_0x83e3[_0x5c0eb9];return _0x168f80;};'use strict';var emlformat=require(_0x383e('0x0'));var rimraf=require(_0x383e('0x1'));var zipdir=require(_0x383e('0x2'));var jsonpatch=require(_0x383e('0x3'));var rp=require(_0x383e('0x4'));var moment=require(_0x383e('0x5'));var BPromise=require(_0x383e('0x6'));var Mustache=require(_0x383e('0x7'));var util=require(_0x383e('0x8'));var path=require(_0x383e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x383e('0xa'));var fs=require('fs');var fs_extra=require(_0x383e('0xb'));var _=require(_0x383e('0xc'));var squel=require(_0x383e('0xd'));var crypto=require('crypto');var jsforce=require(_0x383e('0xe'));var deskjs=require(_0x383e('0xf'));var toCsv=require(_0x383e('0x10'));var querystring=require('querystring');var Papa=require(_0x383e('0x11'));var Redis=require(_0x383e('0x12'));var authService=require(_0x383e('0x13'));var qs=require(_0x383e('0x14'));var as=require(_0x383e('0x15'));var hardwareService=require(_0x383e('0x16'));var logger=require(_0x383e('0x17'))(_0x383e('0x18'));var utils=require('../../config/utils');var config=require(_0x383e('0x19'));var licenseUtil=require(_0x383e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1247db,_0x493fc3){_0x493fc3=_0x493fc3||0xcc;return function(_0x3ea872){if(_0x3ea872){return _0x1247db[_0x383e('0x1b')](_0x493fc3);}return _0x1247db[_0x383e('0x1c')](_0x493fc3)[_0x383e('0x1d')]();};}function respondWithResult(_0x3eaf4d,_0xd4ccc5){_0xd4ccc5=_0xd4ccc5||0xc8;return function(_0x263471){if(_0x263471){return _0x3eaf4d['status'](_0xd4ccc5)[_0x383e('0x1e')](_0x263471);}};}function respondWithFilteredResult(_0x93f2ff,_0x5b336e){return function(_0x1b707e){if(_0x1b707e){var _0xaf3351=typeof _0x5b336e[_0x383e('0x1f')]===_0x383e('0x20')&&typeof _0x5b336e[_0x383e('0x21')]===_0x383e('0x20');var _0x426328=_0x1b707e[_0x383e('0x22')];var _0x5815b5=_0xaf3351?0x0:_0x5b336e['offset'];var _0x3a468c=_0xaf3351?_0x1b707e[_0x383e('0x22')]:_0x5b336e['offset']+_0x5b336e[_0x383e('0x21')];var _0x5bef1a;if(_0x3a468c>=_0x426328){_0x3a468c=_0x426328;_0x5bef1a=0xc8;}else{_0x5bef1a=0xce;}_0x93f2ff[_0x383e('0x1c')](_0x5bef1a);return _0x93f2ff['set']('Content-Range',_0x5815b5+'-'+_0x3a468c+'/'+_0x426328)[_0x383e('0x1e')](_0x1b707e);}return null;};}function patchUpdates(_0x351701){return function(_0x520a53){try{jsonpatch[_0x383e('0x23')](_0x520a53,_0x351701,!![]);}catch(_0x5d9c62){return BPromise[_0x383e('0x24')](_0x5d9c62);}return _0x520a53[_0x383e('0x25')]();};}function saveUpdates(_0x127289,_0x4e16aa){return function(_0x543348){if(_0x543348){return _0x543348[_0x383e('0x26')](_0x127289)['then'](function(_0x5cf631){return _0x5cf631;});}return null;};}function removeEntity(_0x33ac89,_0x228334){return function(_0x4fe863){if(_0x4fe863){return _0x4fe863[_0x383e('0x27')]()[_0x383e('0x28')](function(){_0x33ac89[_0x383e('0x1c')](0xcc)[_0x383e('0x1d')]();});}};}function handleEntityNotFound(_0x5bb812,_0x119ed9){return function(_0x4acf35){if(!_0x4acf35){_0x5bb812[_0x383e('0x1b')](0x194);}return _0x4acf35;};}function handleError(_0x16a0e7,_0xedc826){_0xedc826=_0xedc826||0x1f4;return function(_0x1a9ba1){logger[_0x383e('0x29')](_0x1a9ba1[_0x383e('0x2a')]);if(_0x1a9ba1[_0x383e('0x2b')]){delete _0x1a9ba1[_0x383e('0x2b')];}_0x16a0e7[_0x383e('0x1c')](_0xedc826)['send'](_0x1a9ba1);};}exports[_0x383e('0x2c')]=function(_0xbcfa21,_0x1d6801){var _0x5902bf={},_0x44999c={},_0x51f788={'count':0x0,'rows':[]};var _0x5237bf=_[_0x383e('0x2d')](db[_0x383e('0x2e')][_0x383e('0x2f')],function(_0x4de918){return{'name':_0x4de918['fieldName'],'type':_0x4de918[_0x383e('0x30')][_0x383e('0x31')]};});_0x44999c['model']=_[_0x383e('0x2d')](_0x5237bf,_0x383e('0x2b'));_0x44999c['query']=_['keys'](_0xbcfa21[_0x383e('0x32')]);_0x44999c[_0x383e('0x33')]=_[_0x383e('0x34')](_0x44999c[_0x383e('0x35')],_0x44999c[_0x383e('0x32')]);_0x5902bf[_0x383e('0x36')]=_[_0x383e('0x34')](_0x44999c[_0x383e('0x35')],qs[_0x383e('0x37')](_0xbcfa21['query'][_0x383e('0x37')]));_0x5902bf[_0x383e('0x36')]=_0x5902bf[_0x383e('0x36')][_0x383e('0x38')]?_0x5902bf['attributes']:_0x44999c[_0x383e('0x35')];if(!_0xbcfa21[_0x383e('0x32')][_0x383e('0x39')](_0x383e('0x3a'))){_0x5902bf['limit']=qs[_0x383e('0x21')](_0xbcfa21[_0x383e('0x32')][_0x383e('0x21')]);_0x5902bf[_0x383e('0x1f')]=qs[_0x383e('0x1f')](_0xbcfa21[_0x383e('0x32')][_0x383e('0x1f')]);}_0x5902bf['order']=qs['sort'](_0xbcfa21[_0x383e('0x32')]['sort']);_0x5902bf[_0x383e('0x3b')]=qs[_0x383e('0x33')](_['pick'](_0xbcfa21[_0x383e('0x32')],_0x44999c[_0x383e('0x33')]),_0x5237bf);if(_0xbcfa21['query']['filter']){_0x5902bf['where']=_[_0x383e('0x3c')](_0x5902bf[_0x383e('0x3b')],{'$or':_[_0x383e('0x2d')](_0x5237bf,function(_0x8ee763){if(_0x8ee763[_0x383e('0x30')]!=='VIRTUAL'){var _0x522475={};_0x522475[_0x8ee763[_0x383e('0x2b')]]={'$like':'%'+_0xbcfa21[_0x383e('0x32')]['filter']+'%'};return _0x522475;}})});}_0x5902bf=_[_0x383e('0x3c')]({},_0x5902bf,_0xbcfa21['options']);var _0x4c2bfb={'where':_0x5902bf['where']};return db[_0x383e('0x2e')][_0x383e('0x22')](_0x4c2bfb)[_0x383e('0x28')](function(_0x321939){_0x51f788[_0x383e('0x22')]=_0x321939;if(_0xbcfa21[_0x383e('0x32')][_0x383e('0x3d')]){_0x5902bf[_0x383e('0x3e')]=[{'all':!![]}];}return db[_0x383e('0x2e')][_0x383e('0x3f')](_0x5902bf);})[_0x383e('0x28')](function(_0x4c75eb){_0x51f788[_0x383e('0x40')]=_0x4c75eb;return _0x51f788;})[_0x383e('0x28')](respondWithFilteredResult(_0x1d6801,_0x5902bf))[_0x383e('0x41')](handleError(_0x1d6801,null));};exports[_0x383e('0x42')]=function(_0x1e8732,_0x281202){var _0x561753={'raw':!![],'where':{'id':_0x1e8732['params']['id']}},_0x2d8153={};_0x2d8153[_0x383e('0x35')]=_[_0x383e('0x43')](db['DeskField'][_0x383e('0x2f')]);_0x2d8153['query']=_['keys'](_0x1e8732[_0x383e('0x32')]);_0x2d8153[_0x383e('0x33')]=_[_0x383e('0x34')](_0x2d8153[_0x383e('0x35')],_0x2d8153[_0x383e('0x32')]);_0x561753['attributes']=_[_0x383e('0x34')](_0x2d8153[_0x383e('0x35')],qs['fields'](_0x1e8732['query'][_0x383e('0x37')]));_0x561753['attributes']=_0x561753[_0x383e('0x36')][_0x383e('0x38')]?_0x561753[_0x383e('0x36')]:_0x2d8153[_0x383e('0x35')];if(_0x1e8732[_0x383e('0x32')]['includeAll']){_0x561753[_0x383e('0x3e')]=[{'all':!![]}];}_0x561753=_['merge']({},_0x561753,_0x1e8732[_0x383e('0x44')]);return db['DeskField'][_0x383e('0x45')](_0x561753)[_0x383e('0x28')](handleEntityNotFound(_0x281202,null))['then'](respondWithResult(_0x281202,null))[_0x383e('0x41')](handleError(_0x281202,null));};exports[_0x383e('0x46')]=function(_0x44c08e,_0x476af9){return db[_0x383e('0x2e')][_0x383e('0x46')](_0x44c08e[_0x383e('0x47')],{})['then'](respondWithResult(_0x476af9,0xc9))[_0x383e('0x41')](handleError(_0x476af9,null));};exports[_0x383e('0x26')]=function(_0x1cb120,_0x1f7a22){if(_0x1cb120[_0x383e('0x47')]['id']){delete _0x1cb120[_0x383e('0x47')]['id'];}return db[_0x383e('0x2e')][_0x383e('0x45')]({'where':{'id':_0x1cb120[_0x383e('0x48')]['id']}})[_0x383e('0x28')](handleEntityNotFound(_0x1f7a22,null))[_0x383e('0x28')](saveUpdates(_0x1cb120[_0x383e('0x47')],null))[_0x383e('0x28')](respondWithResult(_0x1f7a22,null))[_0x383e('0x41')](handleError(_0x1f7a22,null));};exports[_0x383e('0x27')]=function(_0x11e795,_0x150558){return db[_0x383e('0x2e')][_0x383e('0x45')]({'where':{'id':_0x11e795[_0x383e('0x48')]['id']}})[_0x383e('0x28')](handleEntityNotFound(_0x150558,null))[_0x383e('0x28')](removeEntity(_0x150558,null))[_0x383e('0x41')](handleError(_0x150558,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 543f86c..254c534 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8b4=['./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0xbac1ec,_0x2f59dc){var _0x1d5ce9=function(_0x18c604){while(--_0x18c604){_0xbac1ec['push'](_0xbac1ec['shift']());}};_0x1d5ce9(++_0x2f59dc);}(_0xc8b4,0x14a));var _0x4c8b=function(_0x48d619,_0x4d2c68){_0x48d619=_0x48d619-0x0;var _0x190c7f=_0xc8b4[_0x48d619];return _0x190c7f;};'use strict';var _=require(_0x4c8b('0x0'));var util=require(_0x4c8b('0x1'));var logger=require(_0x4c8b('0x2'))('api');var moment=require(_0x4c8b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c8b('0x4'));var rimraf=require(_0x4c8b('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c8b('0x6'));module['exports']=function(_0x21fd05,_0x3f045e){return _0x21fd05[_0x4c8b('0x7')](_0x4c8b('0x8'),attributes,{'tableName':_0x4c8b('0x9'),'paranoid':![],'indexes':[{'name':_0x4c8b('0xa'),'fields':[_0x4c8b('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56b2=['bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x55b659,_0x55bc0d){var _0xc174fd=function(_0xfd1904){while(--_0xfd1904){_0x55b659['push'](_0x55b659['shift']());}};_0xc174fd(++_0x55bc0d);}(_0x56b2,0x19c));var _0x256b=function(_0x130575,_0x559a21){_0x130575=_0x130575-0x0;var _0x748d58=_0x56b2[_0x130575];return _0x748d58;};'use strict';var _=require(_0x256b('0x0'));var util=require(_0x256b('0x1'));var logger=require(_0x256b('0x2'))(_0x256b('0x3'));var moment=require('moment');var BPromise=require(_0x256b('0x4'));var rp=require(_0x256b('0x5'));var fs=require('fs');var path=require(_0x256b('0x6'));var rimraf=require('rimraf');var config=require(_0x256b('0x7'));var attributes=require(_0x256b('0x8'));module[_0x256b('0x9')]=function(_0x35b5d4,_0x5a45f3){return _0x35b5d4[_0x256b('0xa')](_0x256b('0xb'),attributes,{'tableName':_0x256b('0xc'),'paranoid':![],'indexes':[{'name':_0x256b('0xd'),'fields':[_0x256b('0xe'),_0x256b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index cb4e5c7..437bfe1 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9d6=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x224d78,_0xac1d29){var _0x52d48a=function(_0x5774a6){while(--_0x5774a6){_0x224d78['push'](_0x224d78['shift']());}};_0x52d48a(++_0xac1d29);}(_0xf9d6,0x144));var _0x6f9d=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0xf9d6[_0x9307ea];return _0x295554;};'use strict';var _=require(_0x6f9d('0x0'));var util=require(_0x6f9d('0x1'));var moment=require(_0x6f9d('0x2'));var BPromise=require(_0x6f9d('0x3'));var rs=require(_0x6f9d('0x4'));var fs=require('fs');var Redis=require(_0x6f9d('0x5'));var db=require(_0x6f9d('0x6'))['db'];var utils=require(_0x6f9d('0x7'));var logger=require('../../config/logger')(_0x6f9d('0x8'));var config=require('../../config/environment');var jayson=require(_0x6f9d('0x9'));var client=jayson[_0x6f9d('0xa')][_0x6f9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc4b5a3,_0x1e1f89,_0x54499a){return new BPromise(function(_0x567208,_0x32dab3){return client[_0x6f9d('0xc')](_0xc4b5a3,_0x54499a)[_0x6f9d('0xd')](function(_0x25af0d){logger[_0x6f9d('0xe')](_0x6f9d('0xf'),_0x1e1f89,_0x6f9d('0x10'));logger[_0x6f9d('0x11')](_0x6f9d('0x12'),_0x1e1f89,_0x6f9d('0x10'),JSON[_0x6f9d('0x13')](_0x25af0d));if(_0x25af0d['error']){if(_0x25af0d[_0x6f9d('0x14')][_0x6f9d('0x15')]===0x1f4){logger[_0x6f9d('0x14')]('DeskField,\x20%s,\x20%s',_0x1e1f89,_0x25af0d['error'][_0x6f9d('0x16')]);return _0x32dab3(_0x25af0d[_0x6f9d('0x14')][_0x6f9d('0x16')]);}logger[_0x6f9d('0x14')](_0x6f9d('0xf'),_0x1e1f89,_0x25af0d['error'][_0x6f9d('0x16')]);return _0x567208(_0x25af0d[_0x6f9d('0x14')][_0x6f9d('0x16')]);}else{logger[_0x6f9d('0xe')]('DeskField,\x20%s,\x20%s',_0x1e1f89,'request\x20sent');_0x567208(_0x25af0d['result'][_0x6f9d('0x16')]);}})['catch'](function(_0x219ac5){logger[_0x6f9d('0x14')](_0x6f9d('0xf'),_0x1e1f89,_0x219ac5);_0x32dab3(_0x219ac5);});});} \ No newline at end of file +var _0x27e1=['debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','DeskField,\x20%s,\x20%s'];(function(_0x1b5738,_0x5e6b11){var _0x4d8a1e=function(_0x5c7ab3){while(--_0x5c7ab3){_0x1b5738['push'](_0x1b5738['shift']());}};_0x4d8a1e(++_0x5e6b11);}(_0x27e1,0x1a7));var _0x127e=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x27e1[_0x1602ef];return _0x5870ee;};'use strict';var _=require(_0x127e('0x0'));var util=require(_0x127e('0x1'));var moment=require(_0x127e('0x2'));var BPromise=require('bluebird');var rs=require(_0x127e('0x3'));var fs=require('fs');var Redis=require(_0x127e('0x4'));var db=require(_0x127e('0x5'))['db'];var utils=require(_0x127e('0x6'));var logger=require(_0x127e('0x7'))(_0x127e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x127e('0x9')][_0x127e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3643f6,_0x15fc88,_0x3bbd76){return new BPromise(function(_0x520fc3,_0x18e119){return client[_0x127e('0xb')](_0x3643f6,_0x3bbd76)[_0x127e('0xc')](function(_0x20390d){logger['info'](_0x127e('0xd'),_0x15fc88,'request\x20sent');logger[_0x127e('0xe')](_0x127e('0xf'),_0x15fc88,_0x127e('0x10'),JSON[_0x127e('0x11')](_0x20390d));if(_0x20390d['error']){if(_0x20390d['error'][_0x127e('0x12')]===0x1f4){logger[_0x127e('0x13')](_0x127e('0xd'),_0x15fc88,_0x20390d['error'][_0x127e('0x14')]);return _0x18e119(_0x20390d[_0x127e('0x13')][_0x127e('0x14')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x15fc88,_0x20390d[_0x127e('0x13')][_0x127e('0x14')]);return _0x520fc3(_0x20390d[_0x127e('0x13')]['message']);}else{logger[_0x127e('0x15')](_0x127e('0xd'),_0x15fc88,_0x127e('0x10'));_0x520fc3(_0x20390d[_0x127e('0x16')][_0x127e('0x14')]);}})['catch'](function(_0x5bbd3f){logger[_0x127e('0x13')](_0x127e('0xd'),_0x15fc88,_0x5bbd3f);_0x18e119(_0x5bbd3f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ac332a6..08ea7d8 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5918=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x41aaa1,_0x413ddc){var _0x367de3=function(_0x266772){while(--_0x266772){_0x41aaa1['push'](_0x41aaa1['shift']());}};_0x367de3(++_0x413ddc);}(_0x5918,0x18b));var _0x8591=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5918[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8591('0x0'));var util=require(_0x8591('0x1'));var path=require(_0x8591('0x2'));var timeout=require('connect-timeout');var express=require(_0x8591('0x3'));var router=express[_0x8591('0x4')]();var fs_extra=require(_0x8591('0x5'));var auth=require(_0x8591('0x6'));var interaction=require(_0x8591('0x7'));var config=require(_0x8591('0x8'));var controller=require(_0x8591('0x9'));router[_0x8591('0xa')]('/',auth[_0x8591('0xb')](),controller['index']);router[_0x8591('0xa')](_0x8591('0xc'),auth['isAuthenticated'](),controller[_0x8591('0xd')]);router[_0x8591('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8591('0xe')]);router[_0x8591('0xa')](_0x8591('0xf'),auth[_0x8591('0xb')](),controller[_0x8591('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8591('0x11')]);router[_0x8591('0x12')](_0x8591('0x13'),auth['isAuthenticated'](),controller[_0x8591('0x14')]);router['put']('/:id',auth[_0x8591('0xb')](),controller[_0x8591('0x15')]);router[_0x8591('0x16')](_0x8591('0xc'),auth['isAuthenticated'](),controller[_0x8591('0x17')]);module[_0x8591('0x18')]=router; \ No newline at end of file +var _0x8a92=['addConfiguration','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post'];(function(_0x326954,_0x29b6c9){var _0x9ce015=function(_0x59d6cf){while(--_0x59d6cf){_0x326954['push'](_0x326954['shift']());}};_0x9ce015(++_0x29b6c9);}(_0x8a92,0x114));var _0x28a9=function(_0x14aafd,_0x37abfa){_0x14aafd=_0x14aafd-0x0;var _0x5129ae=_0x8a92[_0x14aafd];return _0x5129ae;};'use strict';var multer=require(_0x28a9('0x0'));var util=require(_0x28a9('0x1'));var path=require(_0x28a9('0x2'));var timeout=require(_0x28a9('0x3'));var express=require(_0x28a9('0x4'));var router=express[_0x28a9('0x5')]();var fs_extra=require(_0x28a9('0x6'));var auth=require(_0x28a9('0x7'));var interaction=require(_0x28a9('0x8'));var config=require(_0x28a9('0x9'));var controller=require('./intDynamics365Account.controller');router[_0x28a9('0xa')]('/',auth[_0x28a9('0xb')](),controller[_0x28a9('0xc')]);router['get'](_0x28a9('0xd'),auth[_0x28a9('0xb')](),controller[_0x28a9('0xe')]);router[_0x28a9('0xa')](_0x28a9('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x28a9('0xa')](_0x28a9('0x10'),auth[_0x28a9('0xb')](),controller['getFields']);router[_0x28a9('0x11')]('/',auth[_0x28a9('0xb')](),controller['create']);router[_0x28a9('0x11')]('/:id/configurations',auth[_0x28a9('0xb')](),controller[_0x28a9('0x12')]);router[_0x28a9('0x13')](_0x28a9('0xd'),auth[_0x28a9('0xb')](),controller['update']);router['delete'](_0x28a9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x28a9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index b549756..a65787e 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3714=['BOOLEAN','sequelize','exports','STRING'];(function(_0x48126a,_0x306a2c){var _0x3ff786=function(_0x4fd24c){while(--_0x4fd24c){_0x48126a['push'](_0x48126a['shift']());}};_0x3ff786(++_0x306a2c);}(_0x3714,0x95));var _0x4371=function(_0x2bed0a,_0x32619b){_0x2bed0a=_0x2bed0a-0x0;var _0x350b0a=_0x3714[_0x2bed0a];return _0x350b0a;};'use strict';var Sequelize=require(_0x4371('0x0'));module[_0x4371('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4371('0x2')]},'password':{'type':Sequelize[_0x4371('0x2')]},'remoteUri':{'type':Sequelize[_0x4371('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4371('0x2')]},'clientSecret':{'type':Sequelize[_0x4371('0x2')]},'serverUrl':{'type':Sequelize[_0x4371('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x4371('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcb66=['BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb66,0x19f));var _0x6cb6=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xcb66[_0x3718b7];return _0xf8c91e;};'use strict';var Sequelize=require('sequelize');module[_0x6cb6('0x0')]={'name':{'type':Sequelize[_0x6cb6('0x1')]},'username':{'type':Sequelize[_0x6cb6('0x1')]},'password':{'type':Sequelize[_0x6cb6('0x1')]},'remoteUri':{'type':Sequelize[_0x6cb6('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6cb6('0x1')]},'clientSecret':{'type':Sequelize[_0x6cb6('0x1')]},'serverUrl':{'type':Sequelize[_0x6cb6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6cb6('0x1')]},'modernAuthentication':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e6af27e..264cda7 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96ca=['versionnumber','concat','username','remoteUri','tenantId','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','OptionSet','Options','UserLocalizedLabel','Label','DisplayName','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getConfigurations','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','subject','regardingobjectid','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode'];(function(_0x132659,_0x486e0c){var _0x215fc3=function(_0x3a14e8){while(--_0x3a14e8){_0x132659['push'](_0x132659['shift']());}};_0x215fc3(++_0x486e0c);}(_0x96ca,0xf1));var _0xa96c=function(_0xafceaf,_0x5c65ad){_0xafceaf=_0xafceaf-0x0;var _0x3684e4=_0x96ca[_0xafceaf];return _0x3684e4;};'use strict';var rp=require(_0xa96c('0x0'));var util=require(_0xa96c('0x1'));var _=require(_0xa96c('0x2'));var qs=require(_0xa96c('0x3'));var logger=require(_0xa96c('0x4'))(_0xa96c('0x5'));var db=require(_0xa96c('0x6'))['db'];var integrations=require(_0xa96c('0x7'));function respondWithResult(_0x569883,_0x5e0a72){_0x5e0a72=_0x5e0a72||0xc8;return function(_0x455e82){if(_0x455e82){return _0x569883['status'](_0x5e0a72)[_0xa96c('0x8')](_0x455e82);}};}function respondWithFilteredResult(_0x3d8e18,_0x2b0ae5){return function(_0xe6f02c){if(_0xe6f02c){var _0x550dac=typeof _0x2b0ae5[_0xa96c('0x9')]===_0xa96c('0xa')&&typeof _0x2b0ae5[_0xa96c('0xb')]===_0xa96c('0xa');var _0x320273=_0xe6f02c[_0xa96c('0xc')];var _0x173c6c=_0x550dac?0x0:_0x2b0ae5[_0xa96c('0x9')];var _0x1b891f=_0x550dac?_0xe6f02c[_0xa96c('0xc')]:_0x2b0ae5[_0xa96c('0x9')]+_0x2b0ae5['limit'];var _0x555d88;if(_0x1b891f>=_0x320273){_0x1b891f=_0x320273;_0x555d88=0xc8;}else{_0x555d88=0xce;}_0x3d8e18[_0xa96c('0xd')](_0x555d88);return _0x3d8e18[_0xa96c('0xe')](_0xa96c('0xf'),_0x173c6c+'-'+_0x1b891f+'/'+_0x320273)['json'](_0xe6f02c);}return null;};}function saveUpdates(_0x3e0245){return function(_0x7ea15c){if(_0x7ea15c){return _0x7ea15c[_0xa96c('0x10')](_0x3e0245)['then'](function(_0x41e21b){return _0x41e21b;});}return null;};}function removeEntity(_0x25c4d4){return function(_0x24ec21){if(_0x24ec21){return _0x24ec21[_0xa96c('0x11')]()[_0xa96c('0x12')](function(){_0x25c4d4['status'](0xcc)[_0xa96c('0x13')]();});}};}function handleEntityNotFound(_0x1eedb9){return function(_0x3dd0d9){if(!_0x3dd0d9){_0x1eedb9[_0xa96c('0x14')](0x194);}return _0x3dd0d9;};}function handleError(_0x5e6809,_0x4820cd){_0x4820cd=_0x4820cd||0x1f4;return function(_0x510098){logger[_0xa96c('0x15')](_0x510098[_0xa96c('0x16')]);if(_0x510098[_0xa96c('0x17')]){delete _0x510098[_0xa96c('0x17')];}_0x5e6809[_0xa96c('0xd')](_0x4820cd)[_0xa96c('0x18')](_0x510098);};}exports[_0xa96c('0x19')]=function(_0x42fc8d,_0x26c45b){var _0x4c1914={},_0x188727={},_0xcbce78={'count':0x0,'rows':[]};var _0x5b6085=_[_0xa96c('0x1a')](db[_0xa96c('0x1b')]['rawAttributes'],function(_0x4acf7f){return{'name':_0x4acf7f[_0xa96c('0x1c')],'type':_0x4acf7f[_0xa96c('0x1d')][_0xa96c('0x1e')]};});_0x188727[_0xa96c('0x1f')]=_[_0xa96c('0x1a')](_0x5b6085,'name');_0x188727[_0xa96c('0x20')]=_[_0xa96c('0x21')](_0x42fc8d[_0xa96c('0x20')]);_0x188727[_0xa96c('0x22')]=_[_0xa96c('0x23')](_0x188727[_0xa96c('0x1f')],_0x188727['query']);_0x4c1914[_0xa96c('0x24')]=_[_0xa96c('0x23')](_0x188727[_0xa96c('0x1f')],qs[_0xa96c('0x25')](_0x42fc8d[_0xa96c('0x20')][_0xa96c('0x25')]));_0x4c1914[_0xa96c('0x24')]=_0x4c1914[_0xa96c('0x24')][_0xa96c('0x26')]?_0x4c1914[_0xa96c('0x24')]:_0x188727['model'];if(!_0x42fc8d[_0xa96c('0x20')]['hasOwnProperty'](_0xa96c('0x27'))){_0x4c1914[_0xa96c('0xb')]=qs['limit'](_0x42fc8d['query'][_0xa96c('0xb')]);_0x4c1914[_0xa96c('0x9')]=qs[_0xa96c('0x9')](_0x42fc8d[_0xa96c('0x20')][_0xa96c('0x9')]);}_0x4c1914['order']=qs[_0xa96c('0x28')](_0x42fc8d[_0xa96c('0x20')][_0xa96c('0x28')]);_0x4c1914[_0xa96c('0x29')]=qs[_0xa96c('0x22')](_[_0xa96c('0x2a')](_0x42fc8d[_0xa96c('0x20')],_0x188727[_0xa96c('0x22')]),_0x5b6085);if(_0x42fc8d[_0xa96c('0x20')][_0xa96c('0x2b')]){_0x4c1914[_0xa96c('0x29')]=_[_0xa96c('0x2c')](_0x4c1914[_0xa96c('0x29')],{'$or':_[_0xa96c('0x1a')](_0x5b6085,function(_0x4e4dde){if(_0x4e4dde[_0xa96c('0x1d')]!=='VIRTUAL'){var _0x36224f={};_0x36224f[_0x4e4dde['name']]={'$like':'%'+_0x42fc8d[_0xa96c('0x20')]['filter']+'%'};return _0x36224f;}})});}_0x4c1914=_[_0xa96c('0x2c')]({},_0x4c1914,_0x42fc8d[_0xa96c('0x2d')]);var _0x5dfce1={'where':_0x4c1914[_0xa96c('0x29')]};return db[_0xa96c('0x1b')][_0xa96c('0xc')](_0x5dfce1)[_0xa96c('0x12')](function(_0xc22684){_0xcbce78[_0xa96c('0xc')]=_0xc22684;if(_0x42fc8d[_0xa96c('0x20')][_0xa96c('0x2e')]){_0x4c1914['include']=[{'all':!![]}];}return db[_0xa96c('0x1b')][_0xa96c('0x2f')](_0x4c1914);})[_0xa96c('0x12')](function(_0x1f239f){_0xcbce78[_0xa96c('0x30')]=_0x1f239f;return _0xcbce78;})[_0xa96c('0x12')](respondWithFilteredResult(_0x26c45b,_0x4c1914))[_0xa96c('0x31')](handleError(_0x26c45b,null));};exports[_0xa96c('0x32')]=function(_0x4ca725,_0x14ecad){var _0x2fb8d0={'raw':![],'where':{'id':_0x4ca725['params']['id']}},_0x20af54={};_0x20af54['model']=_[_0xa96c('0x21')](db[_0xa96c('0x1b')][_0xa96c('0x33')]);_0x20af54['query']=_[_0xa96c('0x21')](_0x4ca725[_0xa96c('0x20')]);_0x20af54[_0xa96c('0x22')]=_[_0xa96c('0x23')](_0x20af54[_0xa96c('0x1f')],_0x20af54[_0xa96c('0x20')]);_0x2fb8d0[_0xa96c('0x24')]=_['intersection'](_0x20af54['model'],qs[_0xa96c('0x25')](_0x4ca725[_0xa96c('0x20')][_0xa96c('0x25')]));_0x2fb8d0[_0xa96c('0x24')]=_0x2fb8d0[_0xa96c('0x24')][_0xa96c('0x26')]?_0x2fb8d0[_0xa96c('0x24')]:_0x20af54['model'];if(_0x4ca725['query'][_0xa96c('0x2e')]){_0x2fb8d0[_0xa96c('0x34')]=[{'all':!![]}];}_0x2fb8d0=_['merge']({},_0x2fb8d0,_0x4ca725['options']);return db['Dynamics365Account'][_0xa96c('0x35')](_0x2fb8d0)[_0xa96c('0x12')](handleEntityNotFound(_0x14ecad,null))[_0xa96c('0x12')](respondWithResult(_0x14ecad,null))[_0xa96c('0x31')](handleError(_0x14ecad,null));};exports[_0xa96c('0x36')]=function(_0x5921be,_0x14f02d){return db[_0xa96c('0x1b')][_0xa96c('0x36')](_0x5921be[_0xa96c('0x37')],{})[_0xa96c('0x12')](respondWithResult(_0x14f02d,0xc9))[_0xa96c('0x31')](handleError(_0x14f02d,null));};exports[_0xa96c('0x10')]=function(_0x418963,_0x5e4dcf){if(_0x418963[_0xa96c('0x37')]['id']){delete _0x418963[_0xa96c('0x37')]['id'];}return db[_0xa96c('0x1b')][_0xa96c('0x35')]({'where':{'id':_0x418963[_0xa96c('0x38')]['id']}})['then'](handleEntityNotFound(_0x5e4dcf,null))[_0xa96c('0x12')](saveUpdates(_0x418963['body'],null))[_0xa96c('0x12')](respondWithResult(_0x5e4dcf,null))['catch'](handleError(_0x5e4dcf,null));};exports[_0xa96c('0x11')]=function(_0xaf87f6,_0x1acf61){return db[_0xa96c('0x1b')]['find']({'where':{'id':_0xaf87f6[_0xa96c('0x38')]['id']}})[_0xa96c('0x12')](handleEntityNotFound(_0x1acf61,null))[_0xa96c('0x12')](removeEntity(_0x1acf61,null))[_0xa96c('0x31')](handleError(_0x1acf61,null));};exports[_0xa96c('0x39')]=function(_0x2ea9ee,_0x39e6c2){var _0x573562={};var _0x370396={};var _0x82b0cb;var _0xccd3fa;return db[_0xa96c('0x1b')]['findOne']({'where':{'id':_0x2ea9ee['params']['id']}})[_0xa96c('0x12')](handleEntityNotFound(_0x39e6c2,null))[_0xa96c('0x12')](function(_0x4e578c){if(_0x4e578c){_0x82b0cb=_0x4e578c;_0x370396[_0xa96c('0x1f')]=_[_0xa96c('0x21')](db['Dynamics365Configuration'][_0xa96c('0x33')]);_0x370396['query']=_[_0xa96c('0x21')](_0x2ea9ee['query']);_0x370396['filters']=_[_0xa96c('0x23')](_0x370396[_0xa96c('0x1f')],_0x370396[_0xa96c('0x20')]);_0x573562[_0xa96c('0x24')]=_[_0xa96c('0x23')](_0x370396[_0xa96c('0x1f')],qs[_0xa96c('0x25')](_0x2ea9ee['query']['fields']));_0x573562['attributes']=_0x573562['attributes'][_0xa96c('0x26')]?_0x573562[_0xa96c('0x24')]:_0x370396[_0xa96c('0x1f')];_0x573562[_0xa96c('0x3a')]=qs[_0xa96c('0x28')](_0x2ea9ee['query']['sort']);_0x573562[_0xa96c('0x29')]=qs[_0xa96c('0x22')](_['pick'](_0x2ea9ee[_0xa96c('0x20')],_0x370396[_0xa96c('0x22')]));if(_0x2ea9ee[_0xa96c('0x20')][_0xa96c('0x2b')]){_0x573562['where']=_['merge'](_0x573562[_0xa96c('0x29')],{'$or':_[_0xa96c('0x1a')](_0x573562[_0xa96c('0x24')],function(_0x36d535){var _0x48b6fc={};_0x48b6fc[_0x36d535]={'$like':'%'+_0x2ea9ee[_0xa96c('0x20')]['filter']+'%'};return _0x48b6fc;})});}_0x573562=_[_0xa96c('0x2c')]({},_0x573562,_0x2ea9ee[_0xa96c('0x2d')]);return _0x82b0cb['getConfigurations'](_0x573562);}})[_0xa96c('0x12')](function(_0x55ba35){if(_0x55ba35){_0xccd3fa=_0x55ba35[_0xa96c('0x26')];if(!_0x2ea9ee['query'][_0xa96c('0x3b')](_0xa96c('0x27'))){_0x573562[_0xa96c('0xb')]=qs['limit'](_0x2ea9ee[_0xa96c('0x20')][_0xa96c('0xb')]);_0x573562[_0xa96c('0x9')]=qs[_0xa96c('0x9')](_0x2ea9ee[_0xa96c('0x20')][_0xa96c('0x9')]);}return _0x82b0cb['getConfigurations'](_0x573562);}})[_0xa96c('0x12')](function(_0xd9eaba){if(_0xd9eaba){return _0xd9eaba?{'count':_0xccd3fa,'rows':_0xd9eaba}:null;}})[_0xa96c('0x12')](respondWithResult(_0x39e6c2,null))[_0xa96c('0x31')](handleError(_0x39e6c2,null));};exports[_0xa96c('0x3c')]=function(_0x1ef810,_0x41f515){if(_0x1ef810[_0xa96c('0x37')]['id']){delete _0x1ef810[_0xa96c('0x37')]['id'];}return db[_0xa96c('0x1b')][_0xa96c('0x3d')]({'where':{'id':_0x1ef810[_0xa96c('0x38')]['id']}})[_0xa96c('0x12')](handleEntityNotFound(_0x41f515,null))[_0xa96c('0x12')](function(_0x3cf7f9){if(_0x3cf7f9){_0x1ef810[_0xa96c('0x37')][_0xa96c('0x3e')]=_0x3cf7f9['id'];_0x1ef810[_0xa96c('0x37')][_0xa96c('0x3f')]=integrations[_0xa96c('0x40')](_0x1ef810[_0xa96c('0x37')][_0xa96c('0x41')],_0x1ef810['body']['type']);_0x1ef810[_0xa96c('0x37')][_0xa96c('0x42')]=integrations[_0xa96c('0x43')](_0x1ef810[_0xa96c('0x37')]['channel'],_0x1ef810['body'][_0xa96c('0x1d')]);return db[_0xa96c('0x44')]['create'](_0x1ef810[_0xa96c('0x37')],{'include':[{'model':db[_0xa96c('0x45')],'as':'Subjects'},{'model':db[_0xa96c('0x45')],'as':_0xa96c('0x42')}]});}return null;})[_0xa96c('0x12')](respondWithResult(_0x41f515,null))[_0xa96c('0x31')](handleError(_0x41f515,null));};function sanitizeRemoteUri(_0x23e1ea){var _0x8ab919=_0x23e1ea['slice'](-0x1);if(_0x8ab919==='/')return _0x23e1ea[_0xa96c('0x46')](0x0,_0x23e1ea[_0xa96c('0x47')](_0x8ab919));return _0x23e1ea;}function getWebApiUrl(_0x1509d3){return util[_0xa96c('0x48')](_0xa96c('0x49'),_0x1509d3);}exports[_0xa96c('0x4a')]=function(_0x4a86b5,_0x48f522){var _0x18ce1f=_0x4a86b5[_0xa96c('0x20')][_0xa96c('0x4b')];var _0x27a6b2=_0x18ce1f===_0xa96c('0x4c')?_0xa96c('0x4d'):_0xa96c('0x4e');var _0x3e548f='';var _0x41e093='';var _0x5b88b3='';var _0x6983cc='';var _0x58f84e='';var _0x4e46bf='';var _0x542a78='';var _0x51c894='';var _0xa458f1=['title',_0xa96c('0x4f'),_0xa96c('0x50'),_0xa96c('0x51'),'caseorigincode',_0xa96c('0x52'),'phonenumber',_0xa96c('0x53'),'directioncode','phonecall_activity_parties'];var _0x533e59=[_0xa96c('0x54'),_0xa96c('0x55'),_0xa96c('0x56'),_0xa96c('0x57'),'contactidname',_0xa96c('0x58'),_0xa96c('0x59'),_0xa96c('0x5a'),'createdbyexternalpartyname',_0xa96c('0x5b'),'createdbyname','createdbyyominame',_0xa96c('0x5c'),_0xa96c('0x5d'),'createdonbehalfbyyominame','customeridname',_0xa96c('0x5e'),_0xa96c('0x5f'),'emailaddress','entitlementidname',_0xa96c('0x60'),_0xa96c('0x61'),_0xa96c('0x62'),_0xa96c('0x63'),_0xa96c('0x64'),_0xa96c('0x65'),'importsequencenumber',_0xa96c('0x66'),_0xa96c('0x67'),_0xa96c('0x68'),'masteridname',_0xa96c('0x69'),_0xa96c('0x6a'),_0xa96c('0x6b'),_0xa96c('0x6c'),'modifiedon',_0xa96c('0x6d'),_0xa96c('0x6e'),_0xa96c('0x6f'),'msdyn_iotalertname',_0xa96c('0x70'),_0xa96c('0x71'),_0xa96c('0x72'),_0xa96c('0x73'),_0xa96c('0x74'),_0xa96c('0x75'),_0xa96c('0x76'),_0xa96c('0x77'),'primarycontactidyominame',_0xa96c('0x78'),'productidname','productserialnumber',_0xa96c('0x79'),_0xa96c('0x7a'),_0xa96c('0x7b'),_0xa96c('0x7c'),'responsiblecontactidyominame',_0xa96c('0x7d'),_0xa96c('0x7e'),_0xa96c('0x7f'),'socialprofileidname',_0xa96c('0x80'),_0xa96c('0x81'),_0xa96c('0x82'),_0xa96c('0x83'),_0xa96c('0x84'),_0xa96c('0x85'),'traversedpath',_0xa96c('0x86'),_0xa96c('0x87')];var _0x208bcf=_0xa458f1[_0xa96c('0x88')](_0x533e59);return db[_0xa96c('0x1b')][_0xa96c('0x3d')]({'where':{'id':_0x4a86b5[_0xa96c('0x38')]['id']},'attributes':['id',_0xa96c('0x89'),'password',_0xa96c('0x8a'),_0xa96c('0x8b'),'clientId','clientSecret',_0xa96c('0x8c')],'include':[{'model':db[_0xa96c('0x8d')],'as':_0xa96c('0x8d'),'attributes':['id',_0xa96c('0x8e'),_0xa96c('0x8f')]}]})[_0xa96c('0x12')](handleEntityNotFound(_0x48f522,null))[_0xa96c('0x12')](function(_0x32b954){if(_0x32b954){if(_0x32b954['modernAuthentication']){_0x32b954[_0xa96c('0x90')]=_0x32b954['CloudProvider']['data5'];_0x51c894=sanitizeRemoteUri(_0x32b954[_0xa96c('0x8d')]['data7']);_0x542a78=getWebApiUrl(_0x51c894);return _0x32b954;}_0x51c894=sanitizeRemoteUri(_0x32b954['remoteUri']);_0x542a78=getWebApiUrl(_0x51c894);var _0x9192ec={'method':_0xa96c('0x91'),'uri':_0xa96c('0x92')+_0x32b954[_0xa96c('0x8b')]+_0xa96c('0x93'),'form':{'client_id':_0x32b954['clientId'],'resource':_0x51c894,'username':_0x32b954['username'],'password':_0x32b954[_0xa96c('0x94')],'grant_type':_0xa96c('0x94'),'client_secret':_0x32b954[_0xa96c('0x95')]},'json':!![]};return rp(_0x9192ec);}})[_0xa96c('0x12')](function(_0x197d88){_0x4e46bf=_0x197d88[_0xa96c('0x90')];var _0x365b09={'method':_0xa96c('0x96'),'uri':encodeURI(_0x542a78+_0xa96c('0x97')+_0x27a6b2+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4e46bf,'If-None-Match':null,'OData-Version':_0xa96c('0x98')},'json':!![]};return rp(_0x365b09);})['then'](function(_0x5a3a48){var _0x268d96=_0x5a3a48[_0xa96c('0x99')][0x0];var _0x37d80f=_0x268d96[_0xa96c('0x9a')];var _0x309d49={'method':'GET','uri':_0x542a78+'EntityDefinitions('+_0x37d80f+_0xa96c('0x9b'),'headers':{'Authorization':_0xa96c('0x9c')+_0x4e46bf,'If-None-Match':null,'OData-Version':_0xa96c('0x98')},'json':!![]};return rp(_0x309d49);})[_0xa96c('0x12')](function(_0x3c445c){_0x3e548f=_0x3c445c;_0x41e093=_0x3e548f[_0xa96c('0x9d')];_0x41e093=_[_0xa96c('0x9e')](_0x41e093,function(_0x550963){return!_0x208bcf[_0xa96c('0x9f')](_0x550963[_0xa96c('0xa0')]);});var _0x326340=[];var _0x53920f=[];_0x41e093[_0xa96c('0xa1')](function(_0x556a17){if(_0x556a17[_0xa96c('0xa2')]){var _0x548466=_0x556a17[_0xa96c('0xa2')][_0xa96c('0x46')](_0x556a17['@odata.type'][_0xa96c('0x47')]('.')+0x1);if(_0x548466==='PicklistAttributeMetadata'){_0x326340[_0xa96c('0xa3')](getSelectList(_0x542a78,_0x18ce1f,_0x53920f,_0x3e548f[_0xa96c('0x9a')],_0x556a17['MetadataId'],_0x4e46bf));}}});return Promise[_0xa96c('0xa4')](_0x326340);})[_0xa96c('0x12')](function(_0x38ad4c){_0x5b88b3=_0x38ad4c[0x0];var _0x2ba059=[];var _0x449e90=[];_0x41e093['forEach'](function(_0x26cb0e){if(!_[_0xa96c('0xa5')](_0x26cb0e[_0xa96c('0xa2')])){var _0x314ad2=_0x26cb0e[_0xa96c('0xa2')][_0xa96c('0x46')](_0x26cb0e['@odata.type'][_0xa96c('0x47')]('.')+0x1);if(_0x314ad2==='BooleanAttributeMetadata'){_0x2ba059['push'](getBooleanList(_0x542a78,_0x18ce1f,_0x449e90,_0x3e548f[_0xa96c('0x9a')],_0x26cb0e[_0xa96c('0x9a')],_0x4e46bf));}}});return Promise[_0xa96c('0xa4')](_0x2ba059);})[_0xa96c('0x12')](function(_0x4c6695){_0x6983cc=_0x4c6695[0x0];var _0x3437b0=[];var _0x3a3107=[];_0x41e093[_0xa96c('0xa1')](function(_0x48ad3e){if(_0x48ad3e[_0xa96c('0xa2')]){var _0x5ac14a=_0x48ad3e[_0xa96c('0xa2')][_0xa96c('0x46')](_0x48ad3e[_0xa96c('0xa2')][_0xa96c('0x47')]('.')+0x1);if(_0x5ac14a===_0xa96c('0xa6')||_0x5ac14a==='DoubleAttributeMetadata'||_0x5ac14a===_0xa96c('0xa7')||_0x5ac14a===_0xa96c('0xa8')||_0x5ac14a==='MemoAttributeMetadata'||_0x5ac14a===_0xa96c('0xa9')||_0x5ac14a==='StatusAttributeMetadata'||_0x5ac14a===_0xa96c('0xaa')||_0x5ac14a===_0xa96c('0xab')||_0x5ac14a===_0xa96c('0xac')){_0x3437b0[_0xa96c('0xa3')](getInputList(_0x542a78,_0x18ce1f,_0x5ac14a,_0x3a3107,_0x3e548f[_0xa96c('0x9a')],_0x48ad3e[_0xa96c('0x9a')],_0x4e46bf));}}});return Promise['all'](_0x3437b0);})[_0xa96c('0x12')](function(_0x19dee0){_0x58f84e=_0x19dee0[0x0];var _0x5596e0=_0x5b88b3[_0xa96c('0x88')](_0x6983cc)[_0xa96c('0x88')](_0x58f84e);var _0x4af0a2={'count':_0x5596e0[_0xa96c('0x26')],'rows':_0x5596e0};return _0x4af0a2;})['then'](respondWithResult(_0x48f522,null))[_0xa96c('0x31')](function(_0x427993){var _0x3752d4=_0x4a86b5[_0xa96c('0x20')][_0xa96c('0xad')]?0x1f4:_0x427993[_0xa96c('0xae')]||0x1f4;logger[_0xa96c('0x15')](_0x427993[_0xa96c('0x16')]);delete _0x427993[_0xa96c('0x17')];if(_0x3752d4===0x191){_0x3752d4=0x190;}_0x48f522['status'](_0x3752d4)[_0xa96c('0x18')](_0x4a86b5[_0xa96c('0x20')]['test']?{'message':_0xa96c('0xaf'),'statusCode':_0x427993[_0xa96c('0xae')]}:_0x427993);});};function getSelectList(_0x3429d4,_0xf9e4b1,_0x301f9a,_0x394ca7,_0xdaa531,_0x2dd6c4){var _0x5d45cb={'method':'GET','uri':_0x3429d4+_0xa96c('0xb0')+_0x394ca7+_0xa96c('0xb1')+_0xdaa531+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xa96c('0x9c')+_0x2dd6c4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5d45cb)[_0xa96c('0x12')](function(_0xad44c5){var _0x33ea3a=[];var _0x55527c=_0xad44c5[_0xa96c('0xb2')][_0xa96c('0xb3')];_0x55527c['forEach'](function(_0xbaee3d){_0x33ea3a[_0xa96c('0xa3')]({'name':_0xbaee3d['Label'][_0xa96c('0xb4')][_0xa96c('0xb5')],'value':String(_0xbaee3d['Value'])});});var _0x480e5c={'id':_0xf9e4b1+'_'+_0xad44c5[_0xa96c('0xa0')],'name':_0xad44c5[_0xa96c('0xb6')]['UserLocalizedLabel'][_0xa96c('0xb5')],'custom':![],'options':_0x33ea3a};_0x301f9a[_0xa96c('0xa3')](_0x480e5c);return _0x301f9a;});}function getBooleanList(_0x31a31e,_0x5164be,_0x577158,_0x660064,_0x3b0909,_0x46571e){var _0x34819f={'method':_0xa96c('0x96'),'uri':_0x31a31e+_0xa96c('0xb0')+_0x660064+_0xa96c('0xb1')+_0x3b0909+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xa96c('0x9c')+_0x46571e,'If-None-Match':null,'OData-Version':_0xa96c('0x98')},'json':!![]};return rp(_0x34819f)['then'](function(_0x238968){var _0x14d66a=[];_0x14d66a['push']({'name':_0x238968[_0xa96c('0xb2')][_0xa96c('0xb7')][_0xa96c('0xb5')][_0xa96c('0xb4')][_0xa96c('0xb5')],'value':_0xa96c('0xb8')},{'name':_0x238968[_0xa96c('0xb2')][_0xa96c('0xb9')][_0xa96c('0xb5')][_0xa96c('0xb4')][_0xa96c('0xb5')],'value':'false'});var _0x5cd386={'id':_0x5164be+'_'+_0x238968[_0xa96c('0xa0')],'name':_0x238968[_0xa96c('0xb6')]['UserLocalizedLabel'][_0xa96c('0xb5')],'custom':![],'options':_0x14d66a};_0x577158[_0xa96c('0xa3')](_0x5cd386);return _0x577158;});}function getInputList(_0x968dd4,_0x973421,_0x425561,_0x165a4f,_0x4d3685,_0x5e1d3b,_0x5c4710){var _0x2c6779={'method':'GET','uri':_0x968dd4+_0xa96c('0xb0')+_0x4d3685+_0xa96c('0xb1')+_0x5e1d3b+_0xa96c('0xba')+_0x425561+_0xa96c('0xbb'),'headers':{'Authorization':_0xa96c('0x9c')+_0x5c4710,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2c6779)[_0xa96c('0x12')](function(_0x35d66c){var _0x1fd3df={'id':_0x973421+'_'+_0x35d66c['LogicalName'],'name':_0x35d66c[_0xa96c('0xb6')][_0xa96c('0xb4')]?_0x35d66c[_0xa96c('0xb6')][_0xa96c('0xb4')][_0xa96c('0xb5')]:_0x35d66c[_0xa96c('0xa0')],'custom':![],'options':[]};_0x165a4f['push'](_0x1fd3df);return _0x165a4f;});} \ No newline at end of file +var _0xf635=['intersection','attributes','fields','length','nolimit','sort','filter','merge','where','VIRTUAL','options','Dynamics365Account','includeAll','include','catch','show','params','create','body','find','findOne','Dynamics365Configuration','order','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','/oauth2/token','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','LogicalName','GET',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Attributes(','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf635,0x158));var _0x5f63=function(_0x20bbe5,_0x189723){_0x20bbe5=_0x20bbe5-0x0;var _0x1d94c7=_0xf635[_0x20bbe5];return _0x1d94c7;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x5f63('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f63('0x1'))(_0x5f63('0x2'));var db=require(_0x5f63('0x3'))['db'];var integrations=require(_0x5f63('0x4'));function respondWithResult(_0x437b2b,_0x411e8a){_0x411e8a=_0x411e8a||0xc8;return function(_0x15ca06){if(_0x15ca06){return _0x437b2b[_0x5f63('0x5')](_0x411e8a)[_0x5f63('0x6')](_0x15ca06);}};}function respondWithFilteredResult(_0x2098f7,_0x100e78){return function(_0x535bfe){if(_0x535bfe){var _0x4fe0fb=typeof _0x100e78[_0x5f63('0x7')]===_0x5f63('0x8')&&typeof _0x100e78[_0x5f63('0x9')]==='undefined';var _0x5317c3=_0x535bfe[_0x5f63('0xa')];var _0xeb061b=_0x4fe0fb?0x0:_0x100e78[_0x5f63('0x7')];var _0x214112=_0x4fe0fb?_0x535bfe[_0x5f63('0xa')]:_0x100e78[_0x5f63('0x7')]+_0x100e78[_0x5f63('0x9')];var _0x536656;if(_0x214112>=_0x5317c3){_0x214112=_0x5317c3;_0x536656=0xc8;}else{_0x536656=0xce;}_0x2098f7['status'](_0x536656);return _0x2098f7[_0x5f63('0xb')](_0x5f63('0xc'),_0xeb061b+'-'+_0x214112+'/'+_0x5317c3)[_0x5f63('0x6')](_0x535bfe);}return null;};}function saveUpdates(_0x4a5f26){return function(_0x13d641){if(_0x13d641){return _0x13d641[_0x5f63('0xd')](_0x4a5f26)[_0x5f63('0xe')](function(_0x24b786){return _0x24b786;});}return null;};}function removeEntity(_0xe9c3d3){return function(_0x1bc845){if(_0x1bc845){return _0x1bc845[_0x5f63('0xf')]()['then'](function(){_0xe9c3d3[_0x5f63('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dde6){return function(_0x381cc5){if(!_0x381cc5){_0x32dde6['sendStatus'](0x194);}return _0x381cc5;};}function handleError(_0x3ba95a,_0x19feaf){_0x19feaf=_0x19feaf||0x1f4;return function(_0x2ea48d){logger[_0x5f63('0x10')](_0x2ea48d[_0x5f63('0x11')]);if(_0x2ea48d[_0x5f63('0x12')]){delete _0x2ea48d[_0x5f63('0x12')];}_0x3ba95a[_0x5f63('0x5')](_0x19feaf)[_0x5f63('0x13')](_0x2ea48d);};}exports[_0x5f63('0x14')]=function(_0x26b97f,_0x3593f3){var _0x462118={},_0x3fdc4d={},_0x75af48={'count':0x0,'rows':[]};var _0x4860b4=_[_0x5f63('0x15')](db['Dynamics365Account'][_0x5f63('0x16')],function(_0x42d2a5){return{'name':_0x42d2a5[_0x5f63('0x17')],'type':_0x42d2a5['type']['key']};});_0x3fdc4d[_0x5f63('0x18')]=_[_0x5f63('0x15')](_0x4860b4,_0x5f63('0x12'));_0x3fdc4d[_0x5f63('0x19')]=_[_0x5f63('0x1a')](_0x26b97f['query']);_0x3fdc4d[_0x5f63('0x1b')]=_[_0x5f63('0x1c')](_0x3fdc4d['model'],_0x3fdc4d[_0x5f63('0x19')]);_0x462118[_0x5f63('0x1d')]=_[_0x5f63('0x1c')](_0x3fdc4d['model'],qs[_0x5f63('0x1e')](_0x26b97f['query'][_0x5f63('0x1e')]));_0x462118[_0x5f63('0x1d')]=_0x462118[_0x5f63('0x1d')][_0x5f63('0x1f')]?_0x462118[_0x5f63('0x1d')]:_0x3fdc4d[_0x5f63('0x18')];if(!_0x26b97f[_0x5f63('0x19')]['hasOwnProperty'](_0x5f63('0x20'))){_0x462118[_0x5f63('0x9')]=qs[_0x5f63('0x9')](_0x26b97f[_0x5f63('0x19')][_0x5f63('0x9')]);_0x462118[_0x5f63('0x7')]=qs[_0x5f63('0x7')](_0x26b97f[_0x5f63('0x19')]['offset']);}_0x462118['order']=qs[_0x5f63('0x21')](_0x26b97f['query'][_0x5f63('0x21')]);_0x462118['where']=qs[_0x5f63('0x1b')](_['pick'](_0x26b97f[_0x5f63('0x19')],_0x3fdc4d[_0x5f63('0x1b')]),_0x4860b4);if(_0x26b97f['query'][_0x5f63('0x22')]){_0x462118['where']=_[_0x5f63('0x23')](_0x462118[_0x5f63('0x24')],{'$or':_[_0x5f63('0x15')](_0x4860b4,function(_0x194037){if(_0x194037['type']!==_0x5f63('0x25')){var _0x325c4b={};_0x325c4b[_0x194037[_0x5f63('0x12')]]={'$like':'%'+_0x26b97f[_0x5f63('0x19')][_0x5f63('0x22')]+'%'};return _0x325c4b;}})});}_0x462118=_[_0x5f63('0x23')]({},_0x462118,_0x26b97f[_0x5f63('0x26')]);var _0x4b1980={'where':_0x462118[_0x5f63('0x24')]};return db[_0x5f63('0x27')]['count'](_0x4b1980)[_0x5f63('0xe')](function(_0x2d489e){_0x75af48[_0x5f63('0xa')]=_0x2d489e;if(_0x26b97f[_0x5f63('0x19')][_0x5f63('0x28')]){_0x462118[_0x5f63('0x29')]=[{'all':!![]}];}return db[_0x5f63('0x27')]['findAll'](_0x462118);})[_0x5f63('0xe')](function(_0x3547fe){_0x75af48['rows']=_0x3547fe;return _0x75af48;})[_0x5f63('0xe')](respondWithFilteredResult(_0x3593f3,_0x462118))[_0x5f63('0x2a')](handleError(_0x3593f3,null));};exports[_0x5f63('0x2b')]=function(_0x3626ef,_0x47aacd){var _0x59ebef={'raw':![],'where':{'id':_0x3626ef[_0x5f63('0x2c')]['id']}},_0x1a0524={};_0x1a0524['model']=_[_0x5f63('0x1a')](db[_0x5f63('0x27')]['rawAttributes']);_0x1a0524['query']=_[_0x5f63('0x1a')](_0x3626ef['query']);_0x1a0524[_0x5f63('0x1b')]=_[_0x5f63('0x1c')](_0x1a0524[_0x5f63('0x18')],_0x1a0524[_0x5f63('0x19')]);_0x59ebef[_0x5f63('0x1d')]=_[_0x5f63('0x1c')](_0x1a0524['model'],qs[_0x5f63('0x1e')](_0x3626ef[_0x5f63('0x19')][_0x5f63('0x1e')]));_0x59ebef[_0x5f63('0x1d')]=_0x59ebef[_0x5f63('0x1d')][_0x5f63('0x1f')]?_0x59ebef[_0x5f63('0x1d')]:_0x1a0524[_0x5f63('0x18')];if(_0x3626ef[_0x5f63('0x19')]['includeAll']){_0x59ebef[_0x5f63('0x29')]=[{'all':!![]}];}_0x59ebef=_['merge']({},_0x59ebef,_0x3626ef[_0x5f63('0x26')]);return db[_0x5f63('0x27')]['find'](_0x59ebef)[_0x5f63('0xe')](handleEntityNotFound(_0x47aacd,null))[_0x5f63('0xe')](respondWithResult(_0x47aacd,null))['catch'](handleError(_0x47aacd,null));};exports[_0x5f63('0x2d')]=function(_0x31ad4e,_0x55ac21){return db[_0x5f63('0x27')]['create'](_0x31ad4e[_0x5f63('0x2e')],{})[_0x5f63('0xe')](respondWithResult(_0x55ac21,0xc9))[_0x5f63('0x2a')](handleError(_0x55ac21,null));};exports[_0x5f63('0xd')]=function(_0x5f560d,_0x2c59d9){if(_0x5f560d[_0x5f63('0x2e')]['id']){delete _0x5f560d[_0x5f63('0x2e')]['id'];}return db[_0x5f63('0x27')][_0x5f63('0x2f')]({'where':{'id':_0x5f560d[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x2c59d9,null))[_0x5f63('0xe')](saveUpdates(_0x5f560d['body'],null))['then'](respondWithResult(_0x2c59d9,null))[_0x5f63('0x2a')](handleError(_0x2c59d9,null));};exports[_0x5f63('0xf')]=function(_0x512d51,_0x5ea7f3){return db[_0x5f63('0x27')][_0x5f63('0x2f')]({'where':{'id':_0x512d51[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x5ea7f3,null))[_0x5f63('0xe')](removeEntity(_0x5ea7f3,null))['catch'](handleError(_0x5ea7f3,null));};exports['getConfigurations']=function(_0x8e5ef9,_0x281704){var _0x41c9ee={};var _0x378ce4={};var _0x138009;var _0x40eb69;return db['Dynamics365Account'][_0x5f63('0x30')]({'where':{'id':_0x8e5ef9[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x281704,null))[_0x5f63('0xe')](function(_0x4a17c8){if(_0x4a17c8){_0x138009=_0x4a17c8;_0x378ce4[_0x5f63('0x18')]=_[_0x5f63('0x1a')](db[_0x5f63('0x31')][_0x5f63('0x16')]);_0x378ce4[_0x5f63('0x19')]=_[_0x5f63('0x1a')](_0x8e5ef9[_0x5f63('0x19')]);_0x378ce4[_0x5f63('0x1b')]=_[_0x5f63('0x1c')](_0x378ce4[_0x5f63('0x18')],_0x378ce4[_0x5f63('0x19')]);_0x41c9ee[_0x5f63('0x1d')]=_[_0x5f63('0x1c')](_0x378ce4[_0x5f63('0x18')],qs[_0x5f63('0x1e')](_0x8e5ef9[_0x5f63('0x19')]['fields']));_0x41c9ee[_0x5f63('0x1d')]=_0x41c9ee[_0x5f63('0x1d')]['length']?_0x41c9ee['attributes']:_0x378ce4[_0x5f63('0x18')];_0x41c9ee[_0x5f63('0x32')]=qs[_0x5f63('0x21')](_0x8e5ef9['query'][_0x5f63('0x21')]);_0x41c9ee[_0x5f63('0x24')]=qs[_0x5f63('0x1b')](_[_0x5f63('0x33')](_0x8e5ef9[_0x5f63('0x19')],_0x378ce4['filters']));if(_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x22')]){_0x41c9ee[_0x5f63('0x24')]=_['merge'](_0x41c9ee[_0x5f63('0x24')],{'$or':_[_0x5f63('0x15')](_0x41c9ee[_0x5f63('0x1d')],function(_0x3bee2d){var _0x23f365={};_0x23f365[_0x3bee2d]={'$like':'%'+_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x22')]+'%'};return _0x23f365;})});}_0x41c9ee=_['merge']({},_0x41c9ee,_0x8e5ef9[_0x5f63('0x26')]);return _0x138009[_0x5f63('0x34')](_0x41c9ee);}})[_0x5f63('0xe')](function(_0x4a8b5c){if(_0x4a8b5c){_0x40eb69=_0x4a8b5c[_0x5f63('0x1f')];if(!_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x35')](_0x5f63('0x20'))){_0x41c9ee[_0x5f63('0x9')]=qs[_0x5f63('0x9')](_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x9')]);_0x41c9ee[_0x5f63('0x7')]=qs[_0x5f63('0x7')](_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x7')]);}return _0x138009['getConfigurations'](_0x41c9ee);}})[_0x5f63('0xe')](function(_0x6e56){if(_0x6e56){return _0x6e56?{'count':_0x40eb69,'rows':_0x6e56}:null;}})[_0x5f63('0xe')](respondWithResult(_0x281704,null))['catch'](handleError(_0x281704,null));};exports[_0x5f63('0x36')]=function(_0x2a83c2,_0x4c16d9){if(_0x2a83c2['body']['id']){delete _0x2a83c2[_0x5f63('0x2e')]['id'];}return db[_0x5f63('0x27')][_0x5f63('0x30')]({'where':{'id':_0x2a83c2[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x4c16d9,null))[_0x5f63('0xe')](function(_0x1732d4){if(_0x1732d4){_0x2a83c2['body'][_0x5f63('0x37')]=_0x1732d4['id'];_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x38')]=integrations[_0x5f63('0x39')](_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3a')],_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3b')]);_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3c')]=integrations[_0x5f63('0x3d')](_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3a')],_0x2a83c2[_0x5f63('0x2e')]['type']);return db[_0x5f63('0x31')][_0x5f63('0x2d')](_0x2a83c2[_0x5f63('0x2e')],{'include':[{'model':db['Dynamics365Field'],'as':_0x5f63('0x38')},{'model':db[_0x5f63('0x3e')],'as':_0x5f63('0x3c')}]});}return null;})['then'](respondWithResult(_0x4c16d9,null))[_0x5f63('0x2a')](handleError(_0x4c16d9,null));};function sanitizeRemoteUri(_0x400d19){var _0x4d1088=_0x400d19[_0x5f63('0x3f')](-0x1);if(_0x4d1088==='/')return _0x400d19[_0x5f63('0x40')](0x0,_0x400d19[_0x5f63('0x41')](_0x4d1088));return _0x400d19;}function getWebApiUrl(_0x5b7805){return util[_0x5f63('0x42')](_0x5f63('0x43'),_0x5b7805);}exports['getFields']=function(_0x4c5f85,_0x25b0d7){var _0x399faa=_0x4c5f85[_0x5f63('0x19')][_0x5f63('0x44')];var _0x22d2ec=_0x399faa===_0x5f63('0x45')?_0x5f63('0x46'):_0x5f63('0x47');var _0x8d5505='';var _0x2a33a1='';var _0x3fa0b0='';var _0x4f2cce='';var _0xd7df56='';var _0x3bc597='';var _0x24777d='';var _0x3d57ce='';var _0x8d4a1a=['title','description',_0x5f63('0x48'),_0x5f63('0x49'),_0x5f63('0x4a'),_0x5f63('0x4b'),_0x5f63('0x4c'),_0x5f63('0x4d'),_0x5f63('0x4e'),_0x5f63('0x4f')];var _0x14b8fe=[_0x5f63('0x50'),_0x5f63('0x51'),_0x5f63('0x52'),_0x5f63('0x53'),'contactidname','contactidyominame',_0x5f63('0x54'),_0x5f63('0x55'),_0x5f63('0x56'),'createdbyexternalpartyyominame','createdbyname',_0x5f63('0x57'),'createdon',_0x5f63('0x58'),_0x5f63('0x59'),_0x5f63('0x5a'),_0x5f63('0x5b'),_0x5f63('0x5c'),_0x5f63('0x5d'),'entitlementidname','entityimage_timestamp',_0x5f63('0x5e'),_0x5f63('0x5f'),_0x5f63('0x60'),_0x5f63('0x61'),_0x5f63('0x62'),'importsequencenumber','influencescore','kbarticleidname',_0x5f63('0x63'),_0x5f63('0x64'),_0x5f63('0x65'),_0x5f63('0x66'),_0x5f63('0x67'),_0x5f63('0x68'),_0x5f63('0x69'),_0x5f63('0x6a'),_0x5f63('0x6b'),_0x5f63('0x6c'),'msdyn_iotalertname',_0x5f63('0x6d'),_0x5f63('0x6e'),_0x5f63('0x6f'),_0x5f63('0x70'),_0x5f63('0x71'),_0x5f63('0x72'),_0x5f63('0x73'),_0x5f63('0x74'),_0x5f63('0x75'),'prioritycodename',_0x5f63('0x76'),_0x5f63('0x77'),_0x5f63('0x78'),'resolvebykpiidname',_0x5f63('0x79'),_0x5f63('0x7a'),_0x5f63('0x7b'),_0x5f63('0x7c'),_0x5f63('0x7d'),'slaname',_0x5f63('0x7e'),_0x5f63('0x7f'),_0x5f63('0x80'),'subjectidname',_0x5f63('0x81'),_0x5f63('0x82'),'transactioncurrencyidname','traversedpath',_0x5f63('0x83'),_0x5f63('0x84')];var _0xd7c461=_0x8d4a1a[_0x5f63('0x85')](_0x14b8fe);return db[_0x5f63('0x27')][_0x5f63('0x30')]({'where':{'id':_0x4c5f85['params']['id']},'attributes':['id',_0x5f63('0x86'),_0x5f63('0x87'),_0x5f63('0x88'),_0x5f63('0x89'),_0x5f63('0x8a'),_0x5f63('0x8b'),_0x5f63('0x8c')],'include':[{'model':db[_0x5f63('0x8d')],'as':'CloudProvider','attributes':['id',_0x5f63('0x8e'),_0x5f63('0x8f')]}]})[_0x5f63('0xe')](handleEntityNotFound(_0x25b0d7,null))[_0x5f63('0xe')](function(_0x4ab0a4){if(_0x4ab0a4){if(_0x4ab0a4['modernAuthentication']){_0x4ab0a4[_0x5f63('0x90')]=_0x4ab0a4['CloudProvider'][_0x5f63('0x8e')];_0x3d57ce=sanitizeRemoteUri(_0x4ab0a4[_0x5f63('0x8d')][_0x5f63('0x8f')]);_0x24777d=getWebApiUrl(_0x3d57ce);return _0x4ab0a4;}_0x3d57ce=sanitizeRemoteUri(_0x4ab0a4[_0x5f63('0x88')]);_0x24777d=getWebApiUrl(_0x3d57ce);var _0x3b3ebd={'method':'POST','uri':_0x5f63('0x91')+_0x4ab0a4['tenantId']+_0x5f63('0x92'),'form':{'client_id':_0x4ab0a4['clientId'],'resource':_0x3d57ce,'username':_0x4ab0a4['username'],'password':_0x4ab0a4['password'],'grant_type':_0x5f63('0x87'),'client_secret':_0x4ab0a4[_0x5f63('0x8b')]},'json':!![]};return rp(_0x3b3ebd);}})['then'](function(_0x1264af){_0x3bc597=_0x1264af['access_token'];var _0x52912f={'method':'GET','uri':encodeURI(_0x24777d+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x22d2ec+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3bc597,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x52912f);})[_0x5f63('0xe')](function(_0x4bd10f){var _0x5cb068=_0x4bd10f[_0x5f63('0x93')][0x0];var _0x19b091=_0x5cb068[_0x5f63('0x94')];var _0x47396b={'method':'GET','uri':_0x24777d+'EntityDefinitions('+_0x19b091+_0x5f63('0x95'),'headers':{'Authorization':_0x5f63('0x96')+_0x3bc597,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x47396b);})[_0x5f63('0xe')](function(_0x38d615){_0x8d5505=_0x38d615;_0x2a33a1=_0x8d5505[_0x5f63('0x98')];_0x2a33a1=_[_0x5f63('0x99')](_0x2a33a1,function(_0x522876){return!_0xd7c461[_0x5f63('0x9a')](_0x522876['LogicalName']);});var _0x19cef5=[];var _0x2cf921=[];_0x2a33a1[_0x5f63('0x9b')](function(_0x283cc6){if(_0x283cc6[_0x5f63('0x9c')]){var _0x2dc622=_0x283cc6[_0x5f63('0x9c')][_0x5f63('0x40')](_0x283cc6[_0x5f63('0x9c')]['lastIndexOf']('.')+0x1);if(_0x2dc622==='PicklistAttributeMetadata'){_0x19cef5['push'](getSelectList(_0x24777d,_0x399faa,_0x2cf921,_0x8d5505[_0x5f63('0x94')],_0x283cc6[_0x5f63('0x94')],_0x3bc597));}}});return Promise[_0x5f63('0x9d')](_0x19cef5);})[_0x5f63('0xe')](function(_0x1eadb8){_0x3fa0b0=_0x1eadb8[0x0];var _0x3a8691=[];var _0x478a9d=[];_0x2a33a1[_0x5f63('0x9b')](function(_0x3a8d7e){if(!_[_0x5f63('0x9e')](_0x3a8d7e['@odata.type'])){var _0x12fb38=_0x3a8d7e['@odata.type']['substring'](_0x3a8d7e['@odata.type'][_0x5f63('0x41')]('.')+0x1);if(_0x12fb38===_0x5f63('0x9f')){_0x3a8691[_0x5f63('0xa0')](getBooleanList(_0x24777d,_0x399faa,_0x478a9d,_0x8d5505[_0x5f63('0x94')],_0x3a8d7e[_0x5f63('0x94')],_0x3bc597));}}});return Promise[_0x5f63('0x9d')](_0x3a8691);})[_0x5f63('0xe')](function(_0x1663e5){_0x4f2cce=_0x1663e5[0x0];var _0x4fd710=[];var _0x3355d2=[];_0x2a33a1[_0x5f63('0x9b')](function(_0x153ba7){if(_0x153ba7[_0x5f63('0x9c')]){var _0x1bd285=_0x153ba7[_0x5f63('0x9c')][_0x5f63('0x40')](_0x153ba7['@odata.type'][_0x5f63('0x41')]('.')+0x1);if(_0x1bd285===_0x5f63('0xa1')||_0x1bd285==='DoubleAttributeMetadata'||_0x1bd285==='BigIntAttributeMetadata'||_0x1bd285===_0x5f63('0xa2')||_0x1bd285===_0x5f63('0xa3')||_0x1bd285===_0x5f63('0xa4')||_0x1bd285===_0x5f63('0xa5')||_0x1bd285===_0x5f63('0xa6')||_0x1bd285===_0x5f63('0xa7')||_0x1bd285===_0x5f63('0xa8')){_0x4fd710['push'](getInputList(_0x24777d,_0x399faa,_0x1bd285,_0x3355d2,_0x8d5505[_0x5f63('0x94')],_0x153ba7[_0x5f63('0x94')],_0x3bc597));}}});return Promise[_0x5f63('0x9d')](_0x4fd710);})[_0x5f63('0xe')](function(_0x30ed7e){_0xd7df56=_0x30ed7e[0x0];var _0x28a611=_0x3fa0b0[_0x5f63('0x85')](_0x4f2cce)[_0x5f63('0x85')](_0xd7df56);var _0x215f20={'count':_0x28a611['length'],'rows':_0x28a611};return _0x215f20;})[_0x5f63('0xe')](respondWithResult(_0x25b0d7,null))[_0x5f63('0x2a')](function(_0x1e84e9){var _0x413575=_0x4c5f85[_0x5f63('0x19')][_0x5f63('0xa9')]?0x1f4:_0x1e84e9[_0x5f63('0xaa')]||0x1f4;logger['error'](_0x1e84e9[_0x5f63('0x11')]);delete _0x1e84e9['name'];if(_0x413575===0x191){_0x413575=0x190;}_0x25b0d7[_0x5f63('0x5')](_0x413575)['send'](_0x4c5f85[_0x5f63('0x19')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1e84e9[_0x5f63('0xaa')]}:_0x1e84e9);});};function getSelectList(_0x31bbc1,_0xbf4a2f,_0x265e24,_0x59a913,_0x9ca6a2,_0x5626db){var _0x90a94b={'method':'GET','uri':_0x31bbc1+_0x5f63('0xab')+_0x59a913+')/Attributes('+_0x9ca6a2+_0x5f63('0xac')+_0x5f63('0xad'),'headers':{'Authorization':'Bearer\x20'+_0x5626db,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x90a94b)[_0x5f63('0xe')](function(_0x5df1c7){var _0x304c3a=[];var _0x2d9ad3=_0x5df1c7[_0x5f63('0xae')]['Options'];_0x2d9ad3['forEach'](function(_0x267fb4){_0x304c3a[_0x5f63('0xa0')]({'name':_0x267fb4[_0x5f63('0xaf')][_0x5f63('0xb0')][_0x5f63('0xaf')],'value':String(_0x267fb4['Value'])});});var _0x4f4459={'id':_0xbf4a2f+'_'+_0x5df1c7[_0x5f63('0xb1')],'name':_0x5df1c7['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x304c3a};_0x265e24[_0x5f63('0xa0')](_0x4f4459);return _0x265e24;});}function getBooleanList(_0x1c40a2,_0x4640c8,_0xd33485,_0x12c7c4,_0x3d569c,_0x589b66){var _0x3c2201={'method':_0x5f63('0xb2'),'uri':_0x1c40a2+_0x5f63('0xab')+_0x12c7c4+')/Attributes('+_0x3d569c+_0x5f63('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x589b66,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x3c2201)[_0x5f63('0xe')](function(_0x4f5bd2){var _0x5b43b9=[];_0x5b43b9[_0x5f63('0xa0')]({'name':_0x4f5bd2[_0x5f63('0xae')][_0x5f63('0xb4')][_0x5f63('0xaf')][_0x5f63('0xb0')]['Label'],'value':_0x5f63('0xb5')},{'name':_0x4f5bd2[_0x5f63('0xae')][_0x5f63('0xb6')]['Label'][_0x5f63('0xb0')][_0x5f63('0xaf')],'value':_0x5f63('0xb7')});var _0x1094a1={'id':_0x4640c8+'_'+_0x4f5bd2['LogicalName'],'name':_0x4f5bd2[_0x5f63('0xb8')]['UserLocalizedLabel'][_0x5f63('0xaf')],'custom':![],'options':_0x5b43b9};_0xd33485[_0x5f63('0xa0')](_0x1094a1);return _0xd33485;});}function getInputList(_0xddf7f1,_0x22cdbf,_0x2f5698,_0x4b4e59,_0x1f2e18,_0x235198,_0x27ee93){var _0x595310={'method':_0x5f63('0xb2'),'uri':_0xddf7f1+_0x5f63('0xab')+_0x1f2e18+_0x5f63('0xb9')+_0x235198+')/Microsoft.Dynamics.CRM.'+_0x2f5698+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5f63('0x96')+_0x27ee93,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x595310)['then'](function(_0x4f3326){var _0x36c688={'id':_0x22cdbf+'_'+_0x4f3326[_0x5f63('0xb1')],'name':_0x4f3326['DisplayName'][_0x5f63('0xb0')]?_0x4f3326[_0x5f63('0xb8')][_0x5f63('0xb0')][_0x5f63('0xaf')]:_0x4f3326[_0x5f63('0xb1')],'custom':![],'options':[]};_0x4b4e59[_0x5f63('0xa0')](_0x36c688);return _0x4b4e59;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 5f73c15..f876cb4 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x581502,_0xbe9358){var _0x35277e=function(_0x1446b2){while(--_0x1446b2){_0x581502['push'](_0x581502['shift']());}};_0x35277e(++_0xbe9358);}(_0x757a,0xde));var _0xa757=function(_0x1e31f0,_0x53b362){_0x1e31f0=_0x1e31f0-0x0;var _0x22cad4=_0x757a[_0x1e31f0];return _0x22cad4;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 201e952..a203790 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd06a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDynamics365Account','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account','find','util','moment'];(function(_0x299ad6,_0x5e46f1){var _0x318fcb=function(_0x25007c){while(--_0x25007c){_0x299ad6['push'](_0x299ad6['shift']());}};_0x318fcb(++_0x5e46f1);}(_0xd06a,0xd6));var _0xad06=function(_0x17e1f7,_0x2894ad){_0x17e1f7=_0x17e1f7-0x0;var _0x1ac7ea=_0xd06a[_0x17e1f7];return _0x1ac7ea;};'use strict';var _=require('lodash');var util=require(_0xad06('0x0'));var moment=require(_0xad06('0x1'));var BPromise=require(_0xad06('0x2'));var rs=require(_0xad06('0x3'));var fs=require('fs');var Redis=require(_0xad06('0x4'));var db=require(_0xad06('0x5'))['db'];var utils=require(_0xad06('0x6'));var logger=require(_0xad06('0x7'))(_0xad06('0x8'));var config=require(_0xad06('0x9'));var jayson=require(_0xad06('0xa'));var client=jayson[_0xad06('0xb')][_0xad06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28105e,_0x55d6e5,_0x228044){return new BPromise(function(_0x9b0d96,_0x14d5e3){return client[_0xad06('0xd')](_0x28105e,_0x228044)[_0xad06('0xe')](function(_0x5b4c7e){logger[_0xad06('0xf')](_0xad06('0x10'),_0x55d6e5,_0xad06('0x11'));logger[_0xad06('0x12')](_0xad06('0x13'),_0x55d6e5,'request\x20sent',JSON[_0xad06('0x14')](_0x5b4c7e));if(_0x5b4c7e[_0xad06('0x15')]){if(_0x5b4c7e['error']['code']===0x1f4){logger[_0xad06('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x55d6e5,_0x5b4c7e[_0xad06('0x15')][_0xad06('0x16')]);return _0x14d5e3(_0x5b4c7e[_0xad06('0x15')][_0xad06('0x16')]);}logger[_0xad06('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x55d6e5,_0x5b4c7e[_0xad06('0x15')][_0xad06('0x16')]);return _0x9b0d96(_0x5b4c7e[_0xad06('0x15')][_0xad06('0x16')]);}else{logger[_0xad06('0xf')](_0xad06('0x10'),_0x55d6e5,_0xad06('0x11'));_0x9b0d96(_0x5b4c7e[_0xad06('0x17')][_0xad06('0x16')]);}})[_0xad06('0x18')](function(_0x13a4b1){logger[_0xad06('0x15')](_0xad06('0x10'),_0x55d6e5,_0x13a4b1);_0x14d5e3(_0x13a4b1);});});}exports[_0xad06('0x19')]=function(_0xc368ea){var _0x4adcf6=this;return new Promise(function(_0x1332ed,_0x188ddb){return db['Dynamics365Account']['findAll']({'raw':_0xc368ea['options']?_0xc368ea[_0xad06('0x1a')][_0xad06('0x1b')]===undefined?!![]:![]:!![],'where':_0xc368ea[_0xad06('0x1a')]?_0xc368ea['options'][_0xad06('0x1c')]||null:null,'attributes':_0xc368ea[_0xad06('0x1a')]?_0xc368ea[_0xad06('0x1a')]['attributes']||null:null,'limit':_0xc368ea[_0xad06('0x1a')]?_0xc368ea[_0xad06('0x1a')][_0xad06('0x1d')]||null:null,'include':_0xc368ea[_0xad06('0x1a')]?_0xc368ea[_0xad06('0x1a')][_0xad06('0x1e')]?_[_0xad06('0x1f')](_0xc368ea['options']['include'],function(_0x2e2b86){return{'model':db[_0x2e2b86[_0xad06('0x20')]],'as':_0x2e2b86['as'],'attributes':_0x2e2b86[_0xad06('0x21')],'include':_0x2e2b86[_0xad06('0x1e')]?_['map'](_0x2e2b86[_0xad06('0x1e')],function(_0x21ab1b){return{'model':db[_0x21ab1b[_0xad06('0x20')]],'as':_0x21ab1b['as'],'attributes':_0x21ab1b[_0xad06('0x21')],'include':_0x21ab1b[_0xad06('0x1e')]?_['map'](_0x21ab1b[_0xad06('0x1e')],function(_0x5a24e9){return{'model':db[_0x5a24e9[_0xad06('0x20')]],'as':_0x5a24e9['as'],'attributes':_0x5a24e9['attributes']};}):[]};}):[]};}):[]:[]})[_0xad06('0xe')](function(_0x4c73a8){logger['info'](_0xad06('0x19'),_0xc368ea);logger[_0xad06('0x12')](_0xad06('0x19'),_0xc368ea,JSON[_0xad06('0x14')](_0x4c73a8));_0x1332ed(_0x4c73a8);})[_0xad06('0x18')](function(_0x4976f8){logger['error'](_0xad06('0x19'),_0x4976f8['message'],_0xc368ea);_0x188ddb(_0x4adcf6['error'](0x1f4,_0x4976f8['message']));});});};exports[_0xad06('0x22')]=function(_0x10e1ca){var _0x3085b5=this;return new Promise(function(_0x2c9d19,_0x43bd41){return db['Dynamics365Account'][_0xad06('0x23')]({'raw':_0x10e1ca[_0xad06('0x1a')]?_0x10e1ca[_0xad06('0x1a')][_0xad06('0x1b')]===undefined?!![]:![]:!![],'where':_0x10e1ca['options']?_0x10e1ca[_0xad06('0x1a')][_0xad06('0x1c')]||null:null,'attributes':_0x10e1ca[_0xad06('0x1a')]?_0x10e1ca[_0xad06('0x1a')][_0xad06('0x21')]||null:null,'include':_0x10e1ca['options']?_0x10e1ca[_0xad06('0x1a')][_0xad06('0x1e')]?_['map'](_0x10e1ca[_0xad06('0x1a')][_0xad06('0x1e')],function(_0x33d2eb){return{'model':db[_0x33d2eb['model']],'as':_0x33d2eb['as'],'attributes':_0x33d2eb[_0xad06('0x21')],'include':_0x33d2eb['include']?_[_0xad06('0x1f')](_0x33d2eb[_0xad06('0x1e')],function(_0x2e675f){return{'model':db[_0x2e675f['model']],'as':_0x2e675f['as'],'attributes':_0x2e675f[_0xad06('0x21')],'include':_0x2e675f[_0xad06('0x1e')]?_[_0xad06('0x1f')](_0x2e675f['include'],function(_0x10d1a4){return{'model':db[_0x10d1a4[_0xad06('0x20')]],'as':_0x10d1a4['as'],'attributes':_0x10d1a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xad06('0xe')](function(_0x234650){logger[_0xad06('0xf')](_0xad06('0x22'),_0x10e1ca);logger[_0xad06('0x12')](_0xad06('0x22'),_0x10e1ca,JSON['stringify'](_0x234650));_0x2c9d19(_0x234650);})[_0xad06('0x18')](function(_0x1c8e72){logger[_0xad06('0x15')](_0xad06('0x22'),_0x1c8e72['message'],_0x10e1ca);_0x43bd41(_0x3085b5[_0xad06('0x15')](0x1f4,_0x1c8e72[_0xad06('0x16')]));});});}; \ No newline at end of file +var _0x02e6=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','include','map','attributes','model','ShowDynamics365Account','raw','lodash'];(function(_0x2bd440,_0xfb5a9d){var _0x58f325=function(_0x19847f){while(--_0x19847f){_0x2bd440['push'](_0x2bd440['shift']());}};_0x58f325(++_0xfb5a9d);}(_0x02e6,0xa9));var _0x602e=function(_0x1d505a,_0x1d6144){_0x1d505a=_0x1d505a-0x0;var _0xe10353=_0x02e6[_0x1d505a];return _0xe10353;};'use strict';var _=require(_0x602e('0x0'));var util=require('util');var moment=require(_0x602e('0x1'));var BPromise=require('bluebird');var rs=require(_0x602e('0x2'));var fs=require('fs');var Redis=require(_0x602e('0x3'));var db=require(_0x602e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x602e('0x5'))(_0x602e('0x6'));var config=require(_0x602e('0x7'));var jayson=require(_0x602e('0x8'));var client=jayson[_0x602e('0x9')][_0x602e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dd22c,_0x336a64,_0x3e3092){return new BPromise(function(_0x17670c,_0x186d71){return client[_0x602e('0xb')](_0x1dd22c,_0x3e3092)[_0x602e('0xc')](function(_0x2b5eda){logger[_0x602e('0xd')](_0x602e('0xe'),_0x336a64,'request\x20sent');logger[_0x602e('0xf')](_0x602e('0x10'),_0x336a64,'request\x20sent',JSON[_0x602e('0x11')](_0x2b5eda));if(_0x2b5eda[_0x602e('0x12')]){if(_0x2b5eda[_0x602e('0x12')][_0x602e('0x13')]===0x1f4){logger['error'](_0x602e('0xe'),_0x336a64,_0x2b5eda[_0x602e('0x12')]['message']);return _0x186d71(_0x2b5eda[_0x602e('0x12')][_0x602e('0x14')]);}logger[_0x602e('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x336a64,_0x2b5eda[_0x602e('0x12')][_0x602e('0x14')]);return _0x17670c(_0x2b5eda[_0x602e('0x12')][_0x602e('0x14')]);}else{logger[_0x602e('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x336a64,_0x602e('0x15'));_0x17670c(_0x2b5eda['result']['message']);}})[_0x602e('0x16')](function(_0xd1b796){logger[_0x602e('0x12')](_0x602e('0xe'),_0x336a64,_0xd1b796);_0x186d71(_0xd1b796);});});}exports[_0x602e('0x17')]=function(_0xcda370){var _0x3d58a2=this;return new Promise(function(_0xdf1ba,_0x36ab6e){return db[_0x602e('0x18')][_0x602e('0x19')]({'raw':_0xcda370[_0x602e('0x1a')]?_0xcda370[_0x602e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xcda370[_0x602e('0x1a')]?_0xcda370[_0x602e('0x1a')][_0x602e('0x1b')]||null:null,'attributes':_0xcda370['options']?_0xcda370[_0x602e('0x1a')]['attributes']||null:null,'limit':_0xcda370[_0x602e('0x1a')]?_0xcda370[_0x602e('0x1a')]['limit']||null:null,'include':_0xcda370[_0x602e('0x1a')]?_0xcda370['options'][_0x602e('0x1c')]?_[_0x602e('0x1d')](_0xcda370[_0x602e('0x1a')][_0x602e('0x1c')],function(_0x4547b1){return{'model':db[_0x4547b1['model']],'as':_0x4547b1['as'],'attributes':_0x4547b1[_0x602e('0x1e')],'include':_0x4547b1[_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x4547b1[_0x602e('0x1c')],function(_0x5bb993){return{'model':db[_0x5bb993[_0x602e('0x1f')]],'as':_0x5bb993['as'],'attributes':_0x5bb993[_0x602e('0x1e')],'include':_0x5bb993[_0x602e('0x1c')]?_['map'](_0x5bb993[_0x602e('0x1c')],function(_0x52247e){return{'model':db[_0x52247e[_0x602e('0x1f')]],'as':_0x52247e['as'],'attributes':_0x52247e[_0x602e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x602e('0xc')](function(_0x4de926){logger[_0x602e('0xd')](_0x602e('0x17'),_0xcda370);logger[_0x602e('0xf')](_0x602e('0x17'),_0xcda370,JSON[_0x602e('0x11')](_0x4de926));_0xdf1ba(_0x4de926);})['catch'](function(_0x12716b){logger['error'](_0x602e('0x17'),_0x12716b[_0x602e('0x14')],_0xcda370);_0x36ab6e(_0x3d58a2[_0x602e('0x12')](0x1f4,_0x12716b[_0x602e('0x14')]));});});};exports[_0x602e('0x20')]=function(_0x12b906){var _0x19f918=this;return new Promise(function(_0x39a0a8,_0x487e80){return db[_0x602e('0x18')]['find']({'raw':_0x12b906[_0x602e('0x1a')]?_0x12b906[_0x602e('0x1a')][_0x602e('0x21')]===undefined?!![]:![]:!![],'where':_0x12b906['options']?_0x12b906[_0x602e('0x1a')][_0x602e('0x1b')]||null:null,'attributes':_0x12b906[_0x602e('0x1a')]?_0x12b906[_0x602e('0x1a')][_0x602e('0x1e')]||null:null,'include':_0x12b906[_0x602e('0x1a')]?_0x12b906[_0x602e('0x1a')][_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x12b906[_0x602e('0x1a')][_0x602e('0x1c')],function(_0x531296){return{'model':db[_0x531296['model']],'as':_0x531296['as'],'attributes':_0x531296[_0x602e('0x1e')],'include':_0x531296[_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x531296[_0x602e('0x1c')],function(_0x2285c5){return{'model':db[_0x2285c5[_0x602e('0x1f')]],'as':_0x2285c5['as'],'attributes':_0x2285c5[_0x602e('0x1e')],'include':_0x2285c5[_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x2285c5[_0x602e('0x1c')],function(_0x35dbbf){return{'model':db[_0x35dbbf[_0x602e('0x1f')]],'as':_0x35dbbf['as'],'attributes':_0x35dbbf[_0x602e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x602e('0xc')](function(_0x40d0a4){logger['info'](_0x602e('0x20'),_0x12b906);logger[_0x602e('0xf')](_0x602e('0x20'),_0x12b906,JSON[_0x602e('0x11')](_0x40d0a4));_0x39a0a8(_0x40d0a4);})[_0x602e('0x16')](function(_0x162d2b){logger[_0x602e('0x12')](_0x602e('0x20'),_0x162d2b[_0x602e('0x14')],_0x12b906);_0x487e80(_0x19f918[_0x602e('0x12')](0x1f4,_0x162d2b['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 5480673..bdf850f 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc9b=['update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x2b23dd,_0x21647d){var _0x52ab2c=function(_0x357aca){while(--_0x357aca){_0x2b23dd['push'](_0x2b23dd['shift']());}};_0x52ab2c(++_0x21647d);}(_0xdc9b,0x70));var _0xbdc9=function(_0x29c54b,_0x2f9c0a){_0x29c54b=_0x29c54b-0x0;var _0x13636b=_0xdc9b[_0x29c54b];return _0x13636b;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc9('0x3'));var router=express[_0xbdc9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbdc9('0x5'));var config=require(_0xbdc9('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xbdc9('0x7')]('/',auth[_0xbdc9('0x8')](),controller['index']);router[_0xbdc9('0x7')]('/:id',auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x9')]);router[_0xbdc9('0x7')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xb')]);router[_0xbdc9('0x7')](_0xbdc9('0xc'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xd')]);router[_0xbdc9('0x7')](_0xbdc9('0xe'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xf')]);router[_0xbdc9('0x10')]('/',auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x11')]);router[_0xbdc9('0x12')](_0xbdc9('0x13'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x14')]);router['delete'](_0xbdc9('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xbdc9('0x15')]=router; \ No newline at end of file +var _0x96bb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','getDescriptions','put','update','exports','util','path','connect-timeout','express'];(function(_0x197d72,_0x19b07b){var _0x1e3507=function(_0x34e0b6){while(--_0x34e0b6){_0x197d72['push'](_0x197d72['shift']());}};_0x1e3507(++_0x19b07b);}(_0x96bb,0x9c));var _0xb96b=function(_0x27d66e,_0x1eeff6){_0x27d66e=_0x27d66e-0x0;var _0x2f7081=_0x96bb[_0x27d66e];return _0x2f7081;};'use strict';var multer=require('multer');var util=require(_0xb96b('0x0'));var path=require(_0xb96b('0x1'));var timeout=require(_0xb96b('0x2'));var express=require(_0xb96b('0x3'));var router=express[_0xb96b('0x4')]();var fs_extra=require(_0xb96b('0x5'));var auth=require(_0xb96b('0x6'));var interaction=require(_0xb96b('0x7'));var config=require(_0xb96b('0x8'));var controller=require(_0xb96b('0x9'));router[_0xb96b('0xa')]('/',auth[_0xb96b('0xb')](),controller['index']);router['get'](_0xb96b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb96b('0xa')](_0xb96b('0xd'),auth[_0xb96b('0xb')](),controller[_0xb96b('0xe')]);router[_0xb96b('0xa')]('/:id/subjects',auth[_0xb96b('0xb')](),controller[_0xb96b('0xf')]);router['get']('/:id/descriptions',auth[_0xb96b('0xb')](),controller[_0xb96b('0x10')]);router['post']('/',auth[_0xb96b('0xb')](),controller['create']);router[_0xb96b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb96b('0x12')]);router['delete'](_0xb96b('0xc'),auth[_0xb96b('0xb')](),controller['destroy']);module[_0xb96b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 4ff34e2..0237cbe 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9900=['incident','ENUM','contact','nothing','sequelize','STRING'];(function(_0xa8d61c,_0x285f7a){var _0x98c03f=function(_0x47fc85){while(--_0x47fc85){_0xa8d61c['push'](_0xa8d61c['shift']());}};_0x98c03f(++_0x285f7a);}(_0x9900,0x12a));var _0x0990=function(_0x406f7f,_0x505b6a){_0x406f7f=_0x406f7f-0x0;var _0x470b06=_0x9900[_0x406f7f];return _0x470b06;};'use strict';var Sequelize=require(_0x0990('0x0'));module['exports']={'name':{'type':Sequelize[_0x0990('0x1')]},'description':{'type':Sequelize[_0x0990('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x0990('0x2'),'phonecall'),'defaultValue':_0x0990('0x2')},'moduleCreate':{'type':Sequelize[_0x0990('0x3')](_0x0990('0x4'),_0x0990('0x5')),'defaultValue':_0x0990('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x615e=['phonecall','nothing','contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x615e,0xb8));var _0xe615=function(_0x263676,_0x55bc00){_0x263676=_0x263676-0x0;var _0x16e3c3=_0x615e[_0x263676];return _0x16e3c3;};'use strict';var Sequelize=require(_0xe615('0x0'));module[_0xe615('0x1')]={'name':{'type':Sequelize[_0xe615('0x2')]},'description':{'type':Sequelize[_0xe615('0x2')]},'ticketType':{'type':Sequelize[_0xe615('0x3')](_0xe615('0x4'),_0xe615('0x5')),'defaultValue':_0xe615('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xe615('0x6')),'defaultValue':_0xe615('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe615('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 89b12b5..e35d715 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa87d=['nolimit','order','sort','pick','filter','where','merge','options','Dynamics365Configuration','includeAll','include','findAll','catch','create','body','find','params','findOne','Dynamics365Field','getFields','rawAttributes','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa87d,0x68));var _0xda87=function(_0x27b536,_0xf5051c){_0x27b536=_0x27b536-0x0;var _0x4e8700=_0xa87d[_0x27b536];return _0x4e8700;};'use strict';var emlformat=require(_0xda87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda87('0x1'));var jsonpatch=require(_0xda87('0x2'));var rp=require('request-promise');var moment=require(_0xda87('0x3'));var BPromise=require(_0xda87('0x4'));var Mustache=require('mustache');var util=require(_0xda87('0x5'));var path=require(_0xda87('0x6'));var sox=require(_0xda87('0x7'));var csv=require('to-csv');var ejs=require(_0xda87('0x8'));var fs=require('fs');var fs_extra=require(_0xda87('0x9'));var _=require(_0xda87('0xa'));var squel=require(_0xda87('0xb'));var crypto=require(_0xda87('0xc'));var jsforce=require(_0xda87('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xda87('0xe'));var querystring=require(_0xda87('0xf'));var Papa=require(_0xda87('0x10'));var Redis=require(_0xda87('0x11'));var authService=require(_0xda87('0x12'));var qs=require(_0xda87('0x13'));var as=require(_0xda87('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda87('0x15'))('api');var utils=require(_0xda87('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda87('0x17'));var db=require(_0xda87('0x18'))['db'];function respondWithStatusCode(_0x5d192e,_0x26a08d){_0x26a08d=_0x26a08d||0xcc;return function(_0x2989ca){if(_0x2989ca){return _0x5d192e[_0xda87('0x19')](_0x26a08d);}return _0x5d192e['status'](_0x26a08d)['end']();};}function respondWithResult(_0x1b317d,_0x24068f){_0x24068f=_0x24068f||0xc8;return function(_0x2334f0){if(_0x2334f0){return _0x1b317d[_0xda87('0x1a')](_0x24068f)[_0xda87('0x1b')](_0x2334f0);}};}function respondWithFilteredResult(_0x53a1a4,_0xf407fe){return function(_0x213898){if(_0x213898){var _0x15fd0f=typeof _0xf407fe[_0xda87('0x1c')]===_0xda87('0x1d')&&typeof _0xf407fe[_0xda87('0x1e')]===_0xda87('0x1d');var _0x5051cc=_0x213898[_0xda87('0x1f')];var _0x4d0623=_0x15fd0f?0x0:_0xf407fe[_0xda87('0x1c')];var _0x11af6c=_0x15fd0f?_0x213898['count']:_0xf407fe[_0xda87('0x1c')]+_0xf407fe[_0xda87('0x1e')];var _0x53b996;if(_0x11af6c>=_0x5051cc){_0x11af6c=_0x5051cc;_0x53b996=0xc8;}else{_0x53b996=0xce;}_0x53a1a4['status'](_0x53b996);return _0x53a1a4[_0xda87('0x20')](_0xda87('0x21'),_0x4d0623+'-'+_0x11af6c+'/'+_0x5051cc)[_0xda87('0x1b')](_0x213898);}return null;};}function patchUpdates(_0x154557){return function(_0x59878b){try{jsonpatch[_0xda87('0x22')](_0x59878b,_0x154557,!![]);}catch(_0x10cb51){return BPromise[_0xda87('0x23')](_0x10cb51);}return _0x59878b['save']();};}function saveUpdates(_0x514c56,_0x149533){return function(_0x498e47){if(_0x498e47){return _0x498e47[_0xda87('0x24')](_0x514c56)[_0xda87('0x25')](function(_0x13de05){return _0x13de05;});}return null;};}function removeEntity(_0x2cfb3d,_0x1bc0df){return function(_0x411fad){if(_0x411fad){return _0x411fad[_0xda87('0x26')]()[_0xda87('0x25')](function(){_0x2cfb3d[_0xda87('0x1a')](0xcc)[_0xda87('0x27')]();});}};}function handleEntityNotFound(_0x5249bd,_0x38c5d5){return function(_0x4ad67d){if(!_0x4ad67d){_0x5249bd[_0xda87('0x19')](0x194);}return _0x4ad67d;};}function handleError(_0x65640a,_0x5d4cf0){_0x5d4cf0=_0x5d4cf0||0x1f4;return function(_0x3ee0eb){logger[_0xda87('0x28')](_0x3ee0eb[_0xda87('0x29')]);if(_0x3ee0eb[_0xda87('0x2a')]){delete _0x3ee0eb[_0xda87('0x2a')];}_0x65640a[_0xda87('0x1a')](_0x5d4cf0)[_0xda87('0x2b')](_0x3ee0eb);};}exports[_0xda87('0x2c')]=function(_0x4fffce,_0x1858dd){var _0xf191c3={},_0xe462be={},_0x2d1bb2={'count':0x0,'rows':[]};var _0x16be8f=_[_0xda87('0x2d')](db['Dynamics365Configuration']['rawAttributes'],function(_0x1c91f6){return{'name':_0x1c91f6[_0xda87('0x2e')],'type':_0x1c91f6[_0xda87('0x2f')][_0xda87('0x30')]};});_0xe462be['model']=_['map'](_0x16be8f,_0xda87('0x2a'));_0xe462be[_0xda87('0x31')]=_[_0xda87('0x32')](_0x4fffce[_0xda87('0x31')]);_0xe462be[_0xda87('0x33')]=_['intersection'](_0xe462be[_0xda87('0x34')],_0xe462be[_0xda87('0x31')]);_0xf191c3[_0xda87('0x35')]=_[_0xda87('0x36')](_0xe462be[_0xda87('0x34')],qs[_0xda87('0x37')](_0x4fffce[_0xda87('0x31')][_0xda87('0x37')]));_0xf191c3[_0xda87('0x35')]=_0xf191c3[_0xda87('0x35')][_0xda87('0x38')]?_0xf191c3[_0xda87('0x35')]:_0xe462be[_0xda87('0x34')];if(!_0x4fffce[_0xda87('0x31')][_0xda87('0x39')](_0xda87('0x3a'))){_0xf191c3[_0xda87('0x1e')]=qs[_0xda87('0x1e')](_0x4fffce[_0xda87('0x31')][_0xda87('0x1e')]);_0xf191c3[_0xda87('0x1c')]=qs[_0xda87('0x1c')](_0x4fffce['query'][_0xda87('0x1c')]);}_0xf191c3[_0xda87('0x3b')]=qs[_0xda87('0x3c')](_0x4fffce['query']['sort']);_0xf191c3['where']=qs[_0xda87('0x33')](_[_0xda87('0x3d')](_0x4fffce[_0xda87('0x31')],_0xe462be[_0xda87('0x33')]),_0x16be8f);if(_0x4fffce[_0xda87('0x31')][_0xda87('0x3e')]){_0xf191c3[_0xda87('0x3f')]=_[_0xda87('0x40')](_0xf191c3['where'],{'$or':_[_0xda87('0x2d')](_0x16be8f,function(_0x19b996){if(_0x19b996['type']!=='VIRTUAL'){var _0x277244={};_0x277244[_0x19b996['name']]={'$like':'%'+_0x4fffce[_0xda87('0x31')]['filter']+'%'};return _0x277244;}})});}_0xf191c3=_[_0xda87('0x40')]({},_0xf191c3,_0x4fffce[_0xda87('0x41')]);var _0x3bcbc7={'where':_0xf191c3[_0xda87('0x3f')]};return db[_0xda87('0x42')][_0xda87('0x1f')](_0x3bcbc7)[_0xda87('0x25')](function(_0x2b16c5){_0x2d1bb2[_0xda87('0x1f')]=_0x2b16c5;if(_0x4fffce[_0xda87('0x31')][_0xda87('0x43')]){_0xf191c3[_0xda87('0x44')]=[{'all':!![]}];}return db[_0xda87('0x42')][_0xda87('0x45')](_0xf191c3);})[_0xda87('0x25')](function(_0x3bec6b){_0x2d1bb2['rows']=_0x3bec6b;return _0x2d1bb2;})[_0xda87('0x25')](respondWithFilteredResult(_0x1858dd,_0xf191c3))[_0xda87('0x46')](handleError(_0x1858dd,null));};exports['show']=function(_0xa5ddfd,_0x5580ba){var _0x20dca5={'raw':![],'where':{'id':_0xa5ddfd['params']['id']}},_0x5ddd9b={};_0x5ddd9b[_0xda87('0x34')]=_[_0xda87('0x32')](db[_0xda87('0x42')]['rawAttributes']);_0x5ddd9b[_0xda87('0x31')]=_[_0xda87('0x32')](_0xa5ddfd[_0xda87('0x31')]);_0x5ddd9b['filters']=_[_0xda87('0x36')](_0x5ddd9b[_0xda87('0x34')],_0x5ddd9b['query']);_0x20dca5['attributes']=_[_0xda87('0x36')](_0x5ddd9b[_0xda87('0x34')],qs[_0xda87('0x37')](_0xa5ddfd[_0xda87('0x31')][_0xda87('0x37')]));_0x20dca5[_0xda87('0x35')]=_0x20dca5[_0xda87('0x35')]['length']?_0x20dca5[_0xda87('0x35')]:_0x5ddd9b[_0xda87('0x34')];if(_0xa5ddfd[_0xda87('0x31')][_0xda87('0x43')]){_0x20dca5['include']=[{'all':!![]}];}_0x20dca5=_[_0xda87('0x40')]({},_0x20dca5,_0xa5ddfd[_0xda87('0x41')]);return db[_0xda87('0x42')]['find'](_0x20dca5)[_0xda87('0x25')](handleEntityNotFound(_0x5580ba,null))['then'](respondWithResult(_0x5580ba,null))[_0xda87('0x46')](handleError(_0x5580ba,null));};exports[_0xda87('0x47')]=function(_0xc62aab,_0x5bcddd){return db['Dynamics365Configuration'][_0xda87('0x47')](_0xc62aab['body'],{})[_0xda87('0x25')](respondWithResult(_0x5bcddd,0xc9))['catch'](handleError(_0x5bcddd,null));};exports[_0xda87('0x24')]=function(_0x42d4f2,_0x3471cc){if(_0x42d4f2[_0xda87('0x48')]['id']){delete _0x42d4f2[_0xda87('0x48')]['id'];}return db['Dynamics365Configuration'][_0xda87('0x49')]({'where':{'id':_0x42d4f2[_0xda87('0x4a')]['id']}})[_0xda87('0x25')](handleEntityNotFound(_0x3471cc,null))[_0xda87('0x25')](saveUpdates(_0x42d4f2[_0xda87('0x48')],null))['then'](respondWithResult(_0x3471cc,null))['catch'](handleError(_0x3471cc,null));};exports['destroy']=function(_0x56b94d,_0x3204cc){return db['Dynamics365Configuration'][_0xda87('0x49')]({'where':{'id':_0x56b94d[_0xda87('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3204cc,null))['then'](removeEntity(_0x3204cc,null))[_0xda87('0x46')](handleError(_0x3204cc,null));};exports['getFields']=function(_0xb4c796,_0x4f2a90,_0x510985){var _0x40f656={};var _0x3f5a5c={};var _0x38a835;var _0x485449;return db['Dynamics365Configuration'][_0xda87('0x4b')]({'where':{'id':_0xb4c796['params']['id']}})[_0xda87('0x25')](handleEntityNotFound(_0x4f2a90,null))[_0xda87('0x25')](function(_0x1d86f8){if(_0x1d86f8){_0x38a835=_0x1d86f8;_0x3f5a5c[_0xda87('0x34')]=_[_0xda87('0x32')](db[_0xda87('0x4c')]['rawAttributes']);_0x3f5a5c[_0xda87('0x31')]=_[_0xda87('0x32')](_0xb4c796[_0xda87('0x31')]);_0x3f5a5c[_0xda87('0x33')]=_['intersection'](_0x3f5a5c['model'],_0x3f5a5c['query']);_0x40f656[_0xda87('0x35')]=_[_0xda87('0x36')](_0x3f5a5c[_0xda87('0x34')],qs['fields'](_0xb4c796['query'][_0xda87('0x37')]));_0x40f656[_0xda87('0x35')]=_0x40f656[_0xda87('0x35')][_0xda87('0x38')]?_0x40f656[_0xda87('0x35')]:_0x3f5a5c[_0xda87('0x34')];_0x40f656[_0xda87('0x3b')]=qs[_0xda87('0x3c')](_0xb4c796[_0xda87('0x31')]['sort']);_0x40f656[_0xda87('0x3f')]=qs[_0xda87('0x33')](_[_0xda87('0x3d')](_0xb4c796[_0xda87('0x31')],_0x3f5a5c[_0xda87('0x33')]));if(_0xb4c796['query'][_0xda87('0x3e')]){_0x40f656[_0xda87('0x3f')]=_[_0xda87('0x40')](_0x40f656['where'],{'$or':_[_0xda87('0x2d')](_0x40f656['attributes'],function(_0x5b6357){var _0x1b4f27={};_0x1b4f27[_0x5b6357]={'$like':'%'+_0xb4c796[_0xda87('0x31')][_0xda87('0x3e')]+'%'};return _0x1b4f27;})});}_0x40f656=_[_0xda87('0x40')]({},_0x40f656,_0xb4c796[_0xda87('0x41')]);return _0x38a835[_0xda87('0x4d')](_0x40f656);}})[_0xda87('0x25')](function(_0x33eabe){if(_0x33eabe){_0x485449=_0x33eabe['length'];if(!_0xb4c796[_0xda87('0x31')][_0xda87('0x39')](_0xda87('0x3a'))){_0x40f656[_0xda87('0x1e')]=qs[_0xda87('0x1e')](_0xb4c796[_0xda87('0x31')]['limit']);_0x40f656[_0xda87('0x1c')]=qs['offset'](_0xb4c796['query']['offset']);}return _0x38a835[_0xda87('0x4d')](_0x40f656);}})[_0xda87('0x25')](function(_0x2cfe02){if(_0x2cfe02){return _0x2cfe02?{'count':_0x485449,'rows':_0x2cfe02}:null;}})[_0xda87('0x25')](respondWithResult(_0x4f2a90,null))['catch'](handleError(_0x4f2a90,null));};exports['getSubjects']=function(_0x142f6f,_0xd0e76b,_0x4a7e1c){var _0x4ea1c4={};var _0x5a7e4f={};var _0x5352a5;var _0x2eebc5;return db['Dynamics365Configuration'][_0xda87('0x4b')]({'where':{'id':_0x142f6f[_0xda87('0x4a')]['id']}})[_0xda87('0x25')](handleEntityNotFound(_0xd0e76b,null))['then'](function(_0x138d00){if(_0x138d00){_0x5352a5=_0x138d00;_0x5a7e4f[_0xda87('0x34')]=_[_0xda87('0x32')](db['Dynamics365Field'][_0xda87('0x4e')]);_0x5a7e4f[_0xda87('0x31')]=_[_0xda87('0x32')](_0x142f6f[_0xda87('0x31')]);_0x5a7e4f['filters']=_[_0xda87('0x36')](_0x5a7e4f[_0xda87('0x34')],_0x5a7e4f[_0xda87('0x31')]);_0x4ea1c4[_0xda87('0x35')]=_[_0xda87('0x36')](_0x5a7e4f[_0xda87('0x34')],qs['fields'](_0x142f6f[_0xda87('0x31')][_0xda87('0x37')]));_0x4ea1c4['attributes']=_0x4ea1c4[_0xda87('0x35')][_0xda87('0x38')]?_0x4ea1c4[_0xda87('0x35')]:_0x5a7e4f['model'];_0x4ea1c4['order']=qs[_0xda87('0x3c')](_0x142f6f[_0xda87('0x31')][_0xda87('0x3c')]);_0x4ea1c4[_0xda87('0x3f')]=qs[_0xda87('0x33')](_['pick'](_0x142f6f[_0xda87('0x31')],_0x5a7e4f[_0xda87('0x33')]));if(_0x142f6f[_0xda87('0x31')][_0xda87('0x3e')]){_0x4ea1c4[_0xda87('0x3f')]=_[_0xda87('0x40')](_0x4ea1c4[_0xda87('0x3f')],{'$or':_[_0xda87('0x2d')](_0x4ea1c4[_0xda87('0x35')],function(_0x4fdf27){var _0x304469={};_0x304469[_0x4fdf27]={'$like':'%'+_0x142f6f[_0xda87('0x31')][_0xda87('0x3e')]+'%'};return _0x304469;})});}_0x4ea1c4=_[_0xda87('0x40')]({},_0x4ea1c4,_0x142f6f[_0xda87('0x41')]);return _0x5352a5[_0xda87('0x4f')](_0x4ea1c4);}})[_0xda87('0x25')](function(_0x1616b5){if(_0x1616b5){_0x2eebc5=_0x1616b5[_0xda87('0x38')];if(!_0x142f6f[_0xda87('0x31')][_0xda87('0x39')](_0xda87('0x3a'))){_0x4ea1c4[_0xda87('0x1e')]=qs[_0xda87('0x1e')](_0x142f6f[_0xda87('0x31')][_0xda87('0x1e')]);_0x4ea1c4[_0xda87('0x1c')]=qs[_0xda87('0x1c')](_0x142f6f[_0xda87('0x31')]['offset']);}return _0x5352a5['getSubjects'](_0x4ea1c4);}})[_0xda87('0x25')](function(_0x4fb228){if(_0x4fb228){return _0x4fb228?{'count':_0x2eebc5,'rows':_0x4fb228}:null;}})[_0xda87('0x25')](respondWithResult(_0xd0e76b,null))[_0xda87('0x46')](handleError(_0xd0e76b,null));};exports[_0xda87('0x50')]=function(_0x37d789,_0x10b263,_0x8429dd){var _0x3daa27={};var _0x37bc61={};var _0xf4c20b;var _0x11c88d;return db[_0xda87('0x42')][_0xda87('0x4b')]({'where':{'id':_0x37d789[_0xda87('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10b263,null))[_0xda87('0x25')](function(_0x53ea2e){if(_0x53ea2e){_0xf4c20b=_0x53ea2e;_0x37bc61['model']=_[_0xda87('0x32')](db[_0xda87('0x4c')][_0xda87('0x4e')]);_0x37bc61[_0xda87('0x31')]=_[_0xda87('0x32')](_0x37d789[_0xda87('0x31')]);_0x37bc61[_0xda87('0x33')]=_['intersection'](_0x37bc61[_0xda87('0x34')],_0x37bc61[_0xda87('0x31')]);_0x3daa27[_0xda87('0x35')]=_[_0xda87('0x36')](_0x37bc61['model'],qs[_0xda87('0x37')](_0x37d789[_0xda87('0x31')][_0xda87('0x37')]));_0x3daa27['attributes']=_0x3daa27[_0xda87('0x35')][_0xda87('0x38')]?_0x3daa27['attributes']:_0x37bc61['model'];_0x3daa27[_0xda87('0x3b')]=qs[_0xda87('0x3c')](_0x37d789[_0xda87('0x31')][_0xda87('0x3c')]);_0x3daa27[_0xda87('0x3f')]=qs[_0xda87('0x33')](_['pick'](_0x37d789[_0xda87('0x31')],_0x37bc61[_0xda87('0x33')]));if(_0x37d789[_0xda87('0x31')][_0xda87('0x3e')]){_0x3daa27[_0xda87('0x3f')]=_[_0xda87('0x40')](_0x3daa27[_0xda87('0x3f')],{'$or':_['map'](_0x3daa27[_0xda87('0x35')],function(_0x179285){var _0x4205af={};_0x4205af[_0x179285]={'$like':'%'+_0x37d789[_0xda87('0x31')]['filter']+'%'};return _0x4205af;})});}_0x3daa27=_[_0xda87('0x40')]({},_0x3daa27,_0x37d789[_0xda87('0x41')]);return _0xf4c20b[_0xda87('0x50')](_0x3daa27);}})[_0xda87('0x25')](function(_0x5ec1a7){if(_0x5ec1a7){_0x11c88d=_0x5ec1a7[_0xda87('0x38')];if(!_0x37d789[_0xda87('0x31')][_0xda87('0x39')](_0xda87('0x3a'))){_0x3daa27[_0xda87('0x1e')]=qs['limit'](_0x37d789[_0xda87('0x31')][_0xda87('0x1e')]);_0x3daa27[_0xda87('0x1c')]=qs[_0xda87('0x1c')](_0x37d789['query'][_0xda87('0x1c')]);}return _0xf4c20b['getDescriptions'](_0x3daa27);}})['then'](function(_0x20110c){if(_0x20110c){return _0x20110c?{'count':_0x11c88d,'rows':_0x20110c}:null;}})['then'](respondWithResult(_0x10b263,null))[_0xda87('0x46')](handleError(_0x10b263,null));}; \ No newline at end of file +var _0xa079=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','options','create','body','catch','find','getFields','getSubjects','findOne','Dynamics365Field','rawAttributes','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x188495,_0x58eedf){var _0x874b0a=function(_0xa900b1){while(--_0xa900b1){_0x188495['push'](_0x188495['shift']());}};_0x874b0a(++_0x58eedf);}(_0xa079,0x88));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a07('0x0'));var zipdir=require(_0x9a07('0x1'));var jsonpatch=require(_0x9a07('0x2'));var rp=require(_0x9a07('0x3'));var moment=require(_0x9a07('0x4'));var BPromise=require(_0x9a07('0x5'));var Mustache=require(_0x9a07('0x6'));var util=require(_0x9a07('0x7'));var path=require(_0x9a07('0x8'));var sox=require('sox');var csv=require(_0x9a07('0x9'));var ejs=require(_0x9a07('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a07('0xb'));var squel=require('squel');var crypto=require(_0x9a07('0xc'));var jsforce=require(_0x9a07('0xd'));var deskjs=require(_0x9a07('0xe'));var toCsv=require(_0x9a07('0x9'));var querystring=require(_0x9a07('0xf'));var Papa=require(_0x9a07('0x10'));var Redis=require(_0x9a07('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9a07('0x12'));var as=require(_0x9a07('0x13'));var hardwareService=require(_0x9a07('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9a07('0x15'));var config=require(_0x9a07('0x16'));var licenseUtil=require(_0x9a07('0x17'));var db=require(_0x9a07('0x18'))['db'];function respondWithStatusCode(_0x43720c,_0x47dd06){_0x47dd06=_0x47dd06||0xcc;return function(_0xc4e7ec){if(_0xc4e7ec){return _0x43720c[_0x9a07('0x19')](_0x47dd06);}return _0x43720c[_0x9a07('0x1a')](_0x47dd06)[_0x9a07('0x1b')]();};}function respondWithResult(_0x4e0757,_0x1de35e){_0x1de35e=_0x1de35e||0xc8;return function(_0x893d9e){if(_0x893d9e){return _0x4e0757[_0x9a07('0x1a')](_0x1de35e)[_0x9a07('0x1c')](_0x893d9e);}};}function respondWithFilteredResult(_0x155c15,_0x21cf0d){return function(_0x196e87){if(_0x196e87){var _0x4d342f=typeof _0x21cf0d[_0x9a07('0x1d')]===_0x9a07('0x1e')&&typeof _0x21cf0d[_0x9a07('0x1f')]===_0x9a07('0x1e');var _0x1b54ed=_0x196e87[_0x9a07('0x20')];var _0x3113a5=_0x4d342f?0x0:_0x21cf0d[_0x9a07('0x1d')];var _0xd680fb=_0x4d342f?_0x196e87[_0x9a07('0x20')]:_0x21cf0d[_0x9a07('0x1d')]+_0x21cf0d[_0x9a07('0x1f')];var _0x584c30;if(_0xd680fb>=_0x1b54ed){_0xd680fb=_0x1b54ed;_0x584c30=0xc8;}else{_0x584c30=0xce;}_0x155c15[_0x9a07('0x1a')](_0x584c30);return _0x155c15['set'](_0x9a07('0x21'),_0x3113a5+'-'+_0xd680fb+'/'+_0x1b54ed)[_0x9a07('0x1c')](_0x196e87);}return null;};}function patchUpdates(_0x3f366f){return function(_0x12b2f6){try{jsonpatch[_0x9a07('0x22')](_0x12b2f6,_0x3f366f,!![]);}catch(_0x2416a1){return BPromise[_0x9a07('0x23')](_0x2416a1);}return _0x12b2f6[_0x9a07('0x24')]();};}function saveUpdates(_0x394193,_0x4b8d61){return function(_0x328112){if(_0x328112){return _0x328112[_0x9a07('0x25')](_0x394193)[_0x9a07('0x26')](function(_0x57b3e4){return _0x57b3e4;});}return null;};}function removeEntity(_0x505bde,_0x633d7f){return function(_0x55c290){if(_0x55c290){return _0x55c290[_0x9a07('0x27')]()[_0x9a07('0x26')](function(){_0x505bde['status'](0xcc)[_0x9a07('0x1b')]();});}};}function handleEntityNotFound(_0x4a1b39,_0x3cf647){return function(_0x53d93b){if(!_0x53d93b){_0x4a1b39[_0x9a07('0x19')](0x194);}return _0x53d93b;};}function handleError(_0x58d62b,_0x206ac9){_0x206ac9=_0x206ac9||0x1f4;return function(_0x4c8b57){logger[_0x9a07('0x28')](_0x4c8b57[_0x9a07('0x29')]);if(_0x4c8b57[_0x9a07('0x2a')]){delete _0x4c8b57[_0x9a07('0x2a')];}_0x58d62b[_0x9a07('0x1a')](_0x206ac9)[_0x9a07('0x2b')](_0x4c8b57);};}exports[_0x9a07('0x2c')]=function(_0x2d741a,_0x42b2aa){var _0x54c12d={},_0x21c7be={},_0x22fe29={'count':0x0,'rows':[]};var _0x17e766=_[_0x9a07('0x2d')](db[_0x9a07('0x2e')]['rawAttributes'],function(_0x111512){return{'name':_0x111512[_0x9a07('0x2f')],'type':_0x111512[_0x9a07('0x30')][_0x9a07('0x31')]};});_0x21c7be[_0x9a07('0x32')]=_[_0x9a07('0x2d')](_0x17e766,_0x9a07('0x2a'));_0x21c7be[_0x9a07('0x33')]=_[_0x9a07('0x34')](_0x2d741a[_0x9a07('0x33')]);_0x21c7be[_0x9a07('0x35')]=_['intersection'](_0x21c7be[_0x9a07('0x32')],_0x21c7be['query']);_0x54c12d[_0x9a07('0x36')]=_[_0x9a07('0x37')](_0x21c7be[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x2d741a[_0x9a07('0x33')]['fields']));_0x54c12d[_0x9a07('0x36')]=_0x54c12d[_0x9a07('0x36')][_0x9a07('0x39')]?_0x54c12d[_0x9a07('0x36')]:_0x21c7be[_0x9a07('0x32')];if(!_0x2d741a[_0x9a07('0x33')][_0x9a07('0x3a')](_0x9a07('0x3b'))){_0x54c12d['limit']=qs[_0x9a07('0x1f')](_0x2d741a[_0x9a07('0x33')][_0x9a07('0x1f')]);_0x54c12d[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x2d741a['query'][_0x9a07('0x1d')]);}_0x54c12d[_0x9a07('0x3c')]=qs['sort'](_0x2d741a['query'][_0x9a07('0x3d')]);_0x54c12d[_0x9a07('0x3e')]=qs[_0x9a07('0x35')](_[_0x9a07('0x3f')](_0x2d741a[_0x9a07('0x33')],_0x21c7be[_0x9a07('0x35')]),_0x17e766);if(_0x2d741a[_0x9a07('0x33')][_0x9a07('0x40')]){_0x54c12d[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x54c12d[_0x9a07('0x3e')],{'$or':_[_0x9a07('0x2d')](_0x17e766,function(_0xd43b10){if(_0xd43b10['type']!==_0x9a07('0x42')){var _0x257018={};_0x257018[_0xd43b10['name']]={'$like':'%'+_0x2d741a['query'][_0x9a07('0x40')]+'%'};return _0x257018;}})});}_0x54c12d=_[_0x9a07('0x41')]({},_0x54c12d,_0x2d741a['options']);var _0xd6f0df={'where':_0x54c12d[_0x9a07('0x3e')]};return db[_0x9a07('0x2e')][_0x9a07('0x20')](_0xd6f0df)[_0x9a07('0x26')](function(_0xe485f2){_0x22fe29[_0x9a07('0x20')]=_0xe485f2;if(_0x2d741a[_0x9a07('0x33')][_0x9a07('0x43')]){_0x54c12d[_0x9a07('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x54c12d);})[_0x9a07('0x26')](function(_0x42d6bf){_0x22fe29['rows']=_0x42d6bf;return _0x22fe29;})['then'](respondWithFilteredResult(_0x42b2aa,_0x54c12d))['catch'](handleError(_0x42b2aa,null));};exports[_0x9a07('0x45')]=function(_0x24e47f,_0x2b97b2){var _0x38b813={'raw':![],'where':{'id':_0x24e47f[_0x9a07('0x46')]['id']}},_0x40f049={};_0x40f049['model']=_[_0x9a07('0x34')](db[_0x9a07('0x2e')]['rawAttributes']);_0x40f049['query']=_['keys'](_0x24e47f[_0x9a07('0x33')]);_0x40f049[_0x9a07('0x35')]=_['intersection'](_0x40f049[_0x9a07('0x32')],_0x40f049[_0x9a07('0x33')]);_0x38b813[_0x9a07('0x36')]=_[_0x9a07('0x37')](_0x40f049[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x24e47f['query'][_0x9a07('0x38')]));_0x38b813[_0x9a07('0x36')]=_0x38b813[_0x9a07('0x36')]['length']?_0x38b813[_0x9a07('0x36')]:_0x40f049[_0x9a07('0x32')];if(_0x24e47f[_0x9a07('0x33')]['includeAll']){_0x38b813[_0x9a07('0x44')]=[{'all':!![]}];}_0x38b813=_[_0x9a07('0x41')]({},_0x38b813,_0x24e47f[_0x9a07('0x47')]);return db[_0x9a07('0x2e')]['find'](_0x38b813)[_0x9a07('0x26')](handleEntityNotFound(_0x2b97b2,null))[_0x9a07('0x26')](respondWithResult(_0x2b97b2,null))['catch'](handleError(_0x2b97b2,null));};exports[_0x9a07('0x48')]=function(_0x159993,_0x44f3e8){return db['Dynamics365Configuration'][_0x9a07('0x48')](_0x159993[_0x9a07('0x49')],{})['then'](respondWithResult(_0x44f3e8,0xc9))[_0x9a07('0x4a')](handleError(_0x44f3e8,null));};exports['update']=function(_0x344894,_0x42a1ae){if(_0x344894[_0x9a07('0x49')]['id']){delete _0x344894[_0x9a07('0x49')]['id'];}return db[_0x9a07('0x2e')][_0x9a07('0x4b')]({'where':{'id':_0x344894[_0x9a07('0x46')]['id']}})[_0x9a07('0x26')](handleEntityNotFound(_0x42a1ae,null))[_0x9a07('0x26')](saveUpdates(_0x344894['body'],null))[_0x9a07('0x26')](respondWithResult(_0x42a1ae,null))['catch'](handleError(_0x42a1ae,null));};exports['destroy']=function(_0x44a2e7,_0x2586bb){return db[_0x9a07('0x2e')][_0x9a07('0x4b')]({'where':{'id':_0x44a2e7[_0x9a07('0x46')]['id']}})[_0x9a07('0x26')](handleEntityNotFound(_0x2586bb,null))[_0x9a07('0x26')](removeEntity(_0x2586bb,null))['catch'](handleError(_0x2586bb,null));};exports[_0x9a07('0x4c')]=function(_0x26240a,_0x268731,_0x2ea25c){var _0x3fa7c9={};var _0x2223ae={};var _0x4574ed;var _0x4c2b35;return db[_0x9a07('0x2e')]['findOne']({'where':{'id':_0x26240a[_0x9a07('0x46')]['id']}})[_0x9a07('0x26')](handleEntityNotFound(_0x268731,null))[_0x9a07('0x26')](function(_0x4abdf1){if(_0x4abdf1){_0x4574ed=_0x4abdf1;_0x2223ae[_0x9a07('0x32')]=_[_0x9a07('0x34')](db['Dynamics365Field']['rawAttributes']);_0x2223ae['query']=_[_0x9a07('0x34')](_0x26240a[_0x9a07('0x33')]);_0x2223ae[_0x9a07('0x35')]=_[_0x9a07('0x37')](_0x2223ae['model'],_0x2223ae[_0x9a07('0x33')]);_0x3fa7c9['attributes']=_[_0x9a07('0x37')](_0x2223ae[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x26240a[_0x9a07('0x33')][_0x9a07('0x38')]));_0x3fa7c9['attributes']=_0x3fa7c9[_0x9a07('0x36')][_0x9a07('0x39')]?_0x3fa7c9[_0x9a07('0x36')]:_0x2223ae[_0x9a07('0x32')];_0x3fa7c9[_0x9a07('0x3c')]=qs['sort'](_0x26240a[_0x9a07('0x33')][_0x9a07('0x3d')]);_0x3fa7c9[_0x9a07('0x3e')]=qs[_0x9a07('0x35')](_['pick'](_0x26240a[_0x9a07('0x33')],_0x2223ae[_0x9a07('0x35')]));if(_0x26240a[_0x9a07('0x33')][_0x9a07('0x40')]){_0x3fa7c9[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x3fa7c9['where'],{'$or':_[_0x9a07('0x2d')](_0x3fa7c9[_0x9a07('0x36')],function(_0x52bab2){var _0x5e0626={};_0x5e0626[_0x52bab2]={'$like':'%'+_0x26240a[_0x9a07('0x33')][_0x9a07('0x40')]+'%'};return _0x5e0626;})});}_0x3fa7c9=_[_0x9a07('0x41')]({},_0x3fa7c9,_0x26240a[_0x9a07('0x47')]);return _0x4574ed[_0x9a07('0x4c')](_0x3fa7c9);}})['then'](function(_0x88e005){if(_0x88e005){_0x4c2b35=_0x88e005[_0x9a07('0x39')];if(!_0x26240a[_0x9a07('0x33')][_0x9a07('0x3a')](_0x9a07('0x3b'))){_0x3fa7c9[_0x9a07('0x1f')]=qs['limit'](_0x26240a[_0x9a07('0x33')][_0x9a07('0x1f')]);_0x3fa7c9['offset']=qs[_0x9a07('0x1d')](_0x26240a[_0x9a07('0x33')][_0x9a07('0x1d')]);}return _0x4574ed['getFields'](_0x3fa7c9);}})[_0x9a07('0x26')](function(_0x27dac3){if(_0x27dac3){return _0x27dac3?{'count':_0x4c2b35,'rows':_0x27dac3}:null;}})['then'](respondWithResult(_0x268731,null))[_0x9a07('0x4a')](handleError(_0x268731,null));};exports[_0x9a07('0x4d')]=function(_0x38edea,_0x3c19f4,_0x1508a0){var _0x3c2848={};var _0x40395={};var _0x37da64;var _0x1158e6;return db[_0x9a07('0x2e')][_0x9a07('0x4e')]({'where':{'id':_0x38edea['params']['id']}})['then'](handleEntityNotFound(_0x3c19f4,null))['then'](function(_0x5027c7){if(_0x5027c7){_0x37da64=_0x5027c7;_0x40395[_0x9a07('0x32')]=_[_0x9a07('0x34')](db[_0x9a07('0x4f')][_0x9a07('0x50')]);_0x40395[_0x9a07('0x33')]=_['keys'](_0x38edea[_0x9a07('0x33')]);_0x40395[_0x9a07('0x35')]=_[_0x9a07('0x37')](_0x40395[_0x9a07('0x32')],_0x40395[_0x9a07('0x33')]);_0x3c2848[_0x9a07('0x36')]=_['intersection'](_0x40395[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x38edea[_0x9a07('0x33')][_0x9a07('0x38')]));_0x3c2848['attributes']=_0x3c2848['attributes'][_0x9a07('0x39')]?_0x3c2848['attributes']:_0x40395[_0x9a07('0x32')];_0x3c2848[_0x9a07('0x3c')]=qs[_0x9a07('0x3d')](_0x38edea[_0x9a07('0x33')][_0x9a07('0x3d')]);_0x3c2848[_0x9a07('0x3e')]=qs[_0x9a07('0x35')](_[_0x9a07('0x3f')](_0x38edea['query'],_0x40395['filters']));if(_0x38edea[_0x9a07('0x33')][_0x9a07('0x40')]){_0x3c2848[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x3c2848[_0x9a07('0x3e')],{'$or':_[_0x9a07('0x2d')](_0x3c2848[_0x9a07('0x36')],function(_0x2b45c4){var _0x392ebb={};_0x392ebb[_0x2b45c4]={'$like':'%'+_0x38edea[_0x9a07('0x33')]['filter']+'%'};return _0x392ebb;})});}_0x3c2848=_[_0x9a07('0x41')]({},_0x3c2848,_0x38edea['options']);return _0x37da64[_0x9a07('0x4d')](_0x3c2848);}})[_0x9a07('0x26')](function(_0x209c1c){if(_0x209c1c){_0x1158e6=_0x209c1c[_0x9a07('0x39')];if(!_0x38edea[_0x9a07('0x33')][_0x9a07('0x3a')](_0x9a07('0x3b'))){_0x3c2848[_0x9a07('0x1f')]=qs['limit'](_0x38edea[_0x9a07('0x33')]['limit']);_0x3c2848[_0x9a07('0x1d')]=qs['offset'](_0x38edea['query'][_0x9a07('0x1d')]);}return _0x37da64['getSubjects'](_0x3c2848);}})[_0x9a07('0x26')](function(_0x3a70e5){if(_0x3a70e5){return _0x3a70e5?{'count':_0x1158e6,'rows':_0x3a70e5}:null;}})[_0x9a07('0x26')](respondWithResult(_0x3c19f4,null))[_0x9a07('0x4a')](handleError(_0x3c19f4,null));};exports[_0x9a07('0x51')]=function(_0x2edcc5,_0x4c559d,_0x3db352){var _0x45aa96={};var _0xf3ac9e={};var _0x34d506;var _0x27ce90;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2edcc5['params']['id']}})['then'](handleEntityNotFound(_0x4c559d,null))[_0x9a07('0x26')](function(_0x392a23){if(_0x392a23){_0x34d506=_0x392a23;_0xf3ac9e[_0x9a07('0x32')]=_[_0x9a07('0x34')](db[_0x9a07('0x4f')]['rawAttributes']);_0xf3ac9e[_0x9a07('0x33')]=_[_0x9a07('0x34')](_0x2edcc5[_0x9a07('0x33')]);_0xf3ac9e[_0x9a07('0x35')]=_[_0x9a07('0x37')](_0xf3ac9e[_0x9a07('0x32')],_0xf3ac9e[_0x9a07('0x33')]);_0x45aa96['attributes']=_['intersection'](_0xf3ac9e['model'],qs[_0x9a07('0x38')](_0x2edcc5[_0x9a07('0x33')]['fields']));_0x45aa96[_0x9a07('0x36')]=_0x45aa96['attributes'][_0x9a07('0x39')]?_0x45aa96[_0x9a07('0x36')]:_0xf3ac9e[_0x9a07('0x32')];_0x45aa96[_0x9a07('0x3c')]=qs[_0x9a07('0x3d')](_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x3d')]);_0x45aa96[_0x9a07('0x3e')]=qs['filters'](_['pick'](_0x2edcc5[_0x9a07('0x33')],_0xf3ac9e[_0x9a07('0x35')]));if(_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x40')]){_0x45aa96[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x45aa96[_0x9a07('0x3e')],{'$or':_[_0x9a07('0x2d')](_0x45aa96[_0x9a07('0x36')],function(_0x1f70e4){var _0x27975b={};_0x27975b[_0x1f70e4]={'$like':'%'+_0x2edcc5['query'][_0x9a07('0x40')]+'%'};return _0x27975b;})});}_0x45aa96=_[_0x9a07('0x41')]({},_0x45aa96,_0x2edcc5['options']);return _0x34d506[_0x9a07('0x51')](_0x45aa96);}})[_0x9a07('0x26')](function(_0x47026a){if(_0x47026a){_0x27ce90=_0x47026a[_0x9a07('0x39')];if(!_0x2edcc5['query']['hasOwnProperty'](_0x9a07('0x3b'))){_0x45aa96[_0x9a07('0x1f')]=qs['limit'](_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x1f')]);_0x45aa96[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x1d')]);}return _0x34d506[_0x9a07('0x51')](_0x45aa96);}})['then'](function(_0x138449){if(_0x138449){return _0x138449?{'count':_0x27ce90,'rows':_0x138449}:null;}})[_0x9a07('0x26')](respondWithResult(_0x4c559d,null))[_0x9a07('0x4a')](handleError(_0x4c559d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5a7b628..3bb8e9a 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x3bcd69,_0x41165e){var _0x1a6825=function(_0x569e95){while(--_0x569e95){_0x3bcd69['push'](_0x3bcd69['shift']());}};_0x1a6825(++_0x41165e);}(_0xa41a,0x6b));var _0xaa41=function(_0x33144c,_0x12b640){_0x33144c=_0x33144c-0x0;var _0x425ee8=_0xa41a[_0x33144c];return _0x425ee8;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e6413,_0x33a376){var _0x331e31=function(_0x495bec){while(--_0x495bec){_0x2e6413['push'](_0x2e6413['shift']());}};_0x331e31(++_0x33a376);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xf3cd[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 2d8c719..8d080dd 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67ad=['../../config/environment','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xa7d678,_0x3dfdff){var _0x5cc539=function(_0x4393d7){while(--_0x4393d7){_0xa7d678['push'](_0xa7d678['shift']());}};_0x5cc539(++_0x3dfdff);}(_0x67ad,0xdc));var _0xd67a=function(_0xc1b041,_0x2d2362){_0xc1b041=_0xc1b041-0x0;var _0x2e2060=_0x67ad[_0xc1b041];return _0x2e2060;};'use strict';var _=require(_0xd67a('0x0'));var util=require(_0xd67a('0x1'));var moment=require(_0xd67a('0x2'));var BPromise=require(_0xd67a('0x3'));var rs=require(_0xd67a('0x4'));var fs=require('fs');var Redis=require(_0xd67a('0x5'));var db=require(_0xd67a('0x6'))['db'];var utils=require(_0xd67a('0x7'));var logger=require(_0xd67a('0x8'))(_0xd67a('0x9'));var config=require(_0xd67a('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd67a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36ab47,_0x46f9fe,_0x192184){return new BPromise(function(_0x592b9d,_0x2ff670){return client[_0xd67a('0xc')](_0x36ab47,_0x192184)['then'](function(_0x34f0c6){logger[_0xd67a('0xd')](_0xd67a('0xe'),_0x46f9fe,_0xd67a('0xf'));logger[_0xd67a('0x10')](_0xd67a('0x11'),_0x46f9fe,_0xd67a('0xf'),JSON[_0xd67a('0x12')](_0x34f0c6));if(_0x34f0c6[_0xd67a('0x13')]){if(_0x34f0c6[_0xd67a('0x13')][_0xd67a('0x14')]===0x1f4){logger[_0xd67a('0x13')](_0xd67a('0xe'),_0x46f9fe,_0x34f0c6[_0xd67a('0x13')][_0xd67a('0x15')]);return _0x2ff670(_0x34f0c6[_0xd67a('0x13')][_0xd67a('0x15')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x46f9fe,_0x34f0c6[_0xd67a('0x13')][_0xd67a('0x15')]);return _0x592b9d(_0x34f0c6['error'][_0xd67a('0x15')]);}else{logger[_0xd67a('0xd')](_0xd67a('0xe'),_0x46f9fe,_0xd67a('0xf'));_0x592b9d(_0x34f0c6['result'][_0xd67a('0x15')]);}})[_0xd67a('0x16')](function(_0x5554f3){logger[_0xd67a('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x46f9fe,_0x5554f3);_0x2ff670(_0x5554f3);});});} \ No newline at end of file +var _0xf59f=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0xf4f343,_0x41fe4a){var _0x4cda68=function(_0x3850e6){while(--_0x3850e6){_0xf4f343['push'](_0xf4f343['shift']());}};_0x4cda68(++_0x41fe4a);}(_0xf59f,0x182));var _0xff59=function(_0x3a3a1b,_0x23ec74){_0x3a3a1b=_0x3a3a1b-0x0;var _0x1a30a9=_0xf59f[_0x3a3a1b];return _0x1a30a9;};'use strict';var _=require(_0xff59('0x0'));var util=require(_0xff59('0x1'));var moment=require('moment');var BPromise=require(_0xff59('0x2'));var rs=require(_0xff59('0x3'));var fs=require('fs');var Redis=require(_0xff59('0x4'));var db=require(_0xff59('0x5'))['db'];var utils=require(_0xff59('0x6'));var logger=require('../../config/logger')(_0xff59('0x7'));var config=require(_0xff59('0x8'));var jayson=require(_0xff59('0x9'));var client=jayson[_0xff59('0xa')][_0xff59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x505512,_0x4ad54e,_0x3673f0){return new BPromise(function(_0x2d837e,_0x51df2d){return client[_0xff59('0xc')](_0x505512,_0x3673f0)[_0xff59('0xd')](function(_0x4063bc){logger[_0xff59('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4ad54e,_0xff59('0xf'));logger[_0xff59('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4ad54e,_0xff59('0xf'),JSON[_0xff59('0x11')](_0x4063bc));if(_0x4063bc[_0xff59('0x12')]){if(_0x4063bc[_0xff59('0x12')][_0xff59('0x13')]===0x1f4){logger[_0xff59('0x12')](_0xff59('0x14'),_0x4ad54e,_0x4063bc[_0xff59('0x12')][_0xff59('0x15')]);return _0x51df2d(_0x4063bc[_0xff59('0x12')][_0xff59('0x15')]);}logger[_0xff59('0x12')](_0xff59('0x14'),_0x4ad54e,_0x4063bc[_0xff59('0x12')][_0xff59('0x15')]);return _0x2d837e(_0x4063bc['error'][_0xff59('0x15')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4ad54e,_0xff59('0xf'));_0x2d837e(_0x4063bc[_0xff59('0x16')][_0xff59('0x15')]);}})[_0xff59('0x17')](function(_0x502fe3){logger[_0xff59('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4ad54e,_0x502fe3);_0x51df2d(_0x502fe3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ab99fba..15ac67c 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9e2=['index','/:id','post','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9e2,0x1aa));var _0x2d9e=function(_0x5bd7a3,_0x5899b1){_0x5bd7a3=_0x5bd7a3-0x0;var _0x29e95b=_0xd9e2[_0x5bd7a3];return _0x29e95b;};'use strict';var multer=require(_0x2d9e('0x0'));var util=require('util');var path=require(_0x2d9e('0x1'));var timeout=require(_0x2d9e('0x2'));var express=require('express');var router=express[_0x2d9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2d9e('0x4'));var interaction=require(_0x2d9e('0x5'));var config=require(_0x2d9e('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x2d9e('0x7')]('/',auth[_0x2d9e('0x8')](),controller[_0x2d9e('0x9')]);router[_0x2d9e('0x7')](_0x2d9e('0xa'),auth[_0x2d9e('0x8')](),controller['show']);router[_0x2d9e('0xb')]('/',auth[_0x2d9e('0x8')](),controller['create']);router[_0x2d9e('0xc')]('/:id',auth[_0x2d9e('0x8')](),controller['update']);router[_0x2d9e('0xd')](_0x2d9e('0xa'),auth[_0x2d9e('0x8')](),controller['destroy']);module[_0x2d9e('0xe')]=router; \ No newline at end of file +var _0xf28f=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f2802,_0x29263f){var _0x1bb4d9=function(_0x32d9bd){while(--_0x32d9bd){_0x1f2802['push'](_0x1f2802['shift']());}};_0x1bb4d9(++_0x29263f);}(_0xf28f,0x19b));var _0xff28=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf28f[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0xff28('0x0'));var util=require(_0xff28('0x1'));var path=require('path');var timeout=require(_0xff28('0x2'));var express=require(_0xff28('0x3'));var router=express[_0xff28('0x4')]();var fs_extra=require(_0xff28('0x5'));var auth=require(_0xff28('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff28('0x7'));var controller=require(_0xff28('0x8'));router[_0xff28('0x9')]('/',auth[_0xff28('0xa')](),controller[_0xff28('0xb')]);router[_0xff28('0x9')](_0xff28('0xc'),auth[_0xff28('0xa')](),controller[_0xff28('0xd')]);router[_0xff28('0xe')]('/',auth[_0xff28('0xa')](),controller[_0xff28('0xf')]);router[_0xff28('0x10')](_0xff28('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xff28('0x11')](_0xff28('0xc'),auth[_0xff28('0xa')](),controller['destroy']);module[_0xff28('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index dfde27a..eaaca62 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa27=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa27,0xe3));var _0x7fa2=function(_0x11aa88,_0x1ebdc0){_0x11aa88=_0x11aa88-0x0;var _0x20bcd2=_0xfa27[_0x11aa88];return _0x20bcd2;};'use strict';var Sequelize=require(_0x7fa2('0x0'));module[_0x7fa2('0x1')]={'type':{'type':Sequelize[_0x7fa2('0x2')](_0x7fa2('0x3'),'variable',_0x7fa2('0x4'),_0x7fa2('0x5'),_0x7fa2('0x6')),'defaultValue':_0x7fa2('0x3')},'content':{'type':Sequelize[_0x7fa2('0x7')]},'key':{'type':Sequelize[_0x7fa2('0x7')]},'keyType':{'type':Sequelize[_0x7fa2('0x2')](_0x7fa2('0x3'),_0x7fa2('0x8'),_0x7fa2('0x4'))},'keyContent':{'type':Sequelize[_0x7fa2('0x7')]},'idField':{'type':Sequelize[_0x7fa2('0x7')]},'nameField':{'type':Sequelize[_0x7fa2('0x7')]},'customField':{'type':Sequelize[_0x7fa2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7fa2('0x7')]}}; \ No newline at end of file +var _0x35eb=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x35eb,0x1f3));var _0xb35e=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x35eb[_0x4169d8];return _0x32084a;};'use strict';var Sequelize=require('sequelize');module[_0xb35e('0x0')]={'type':{'type':Sequelize[_0xb35e('0x1')](_0xb35e('0x2'),_0xb35e('0x3'),_0xb35e('0x4'),_0xb35e('0x5'),_0xb35e('0x6')),'defaultValue':_0xb35e('0x2')},'content':{'type':Sequelize[_0xb35e('0x7')]},'key':{'type':Sequelize[_0xb35e('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xb35e('0x3'),_0xb35e('0x4'))},'keyContent':{'type':Sequelize[_0xb35e('0x7')]},'idField':{'type':Sequelize[_0xb35e('0x7')]},'nameField':{'type':Sequelize[_0xb35e('0x7')]},'customField':{'type':Sequelize[_0xb35e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 93b7f11..96fe8e6 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5e9=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xe5e9,0x89));var _0x9e5e=function(_0x114749,_0x9b572a){_0x114749=_0x114749-0x0;var _0x499080=_0xe5e9[_0x114749];return _0x499080;};'use strict';var emlformat=require(_0x9e5e('0x0'));var rimraf=require(_0x9e5e('0x1'));var zipdir=require(_0x9e5e('0x2'));var jsonpatch=require(_0x9e5e('0x3'));var rp=require(_0x9e5e('0x4'));var moment=require(_0x9e5e('0x5'));var BPromise=require(_0x9e5e('0x6'));var Mustache=require(_0x9e5e('0x7'));var util=require('util');var path=require(_0x9e5e('0x8'));var sox=require(_0x9e5e('0x9'));var csv=require(_0x9e5e('0xa'));var ejs=require(_0x9e5e('0xb'));var fs=require('fs');var fs_extra=require(_0x9e5e('0xc'));var _=require(_0x9e5e('0xd'));var squel=require(_0x9e5e('0xe'));var crypto=require(_0x9e5e('0xf'));var jsforce=require(_0x9e5e('0x10'));var deskjs=require(_0x9e5e('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9e5e('0x12'));var Redis=require(_0x9e5e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9e5e('0x14'));var as=require(_0x9e5e('0x15'));var hardwareService=require(_0x9e5e('0x16'));var logger=require(_0x9e5e('0x17'))(_0x9e5e('0x18'));var utils=require(_0x9e5e('0x19'));var config=require(_0x9e5e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e5e('0x1b'))['db'];function respondWithStatusCode(_0x331321,_0x45dc){_0x45dc=_0x45dc||0xcc;return function(_0x4a7c38){if(_0x4a7c38){return _0x331321['sendStatus'](_0x45dc);}return _0x331321[_0x9e5e('0x1c')](_0x45dc)[_0x9e5e('0x1d')]();};}function respondWithResult(_0x32049c,_0x11eab0){_0x11eab0=_0x11eab0||0xc8;return function(_0x5a481b){if(_0x5a481b){return _0x32049c[_0x9e5e('0x1c')](_0x11eab0)['json'](_0x5a481b);}};}function respondWithFilteredResult(_0x22aad4,_0x1b63bc){return function(_0xef2575){if(_0xef2575){var _0x528609=typeof _0x1b63bc[_0x9e5e('0x1e')]===_0x9e5e('0x1f')&&typeof _0x1b63bc[_0x9e5e('0x20')]===_0x9e5e('0x1f');var _0x21e26b=_0xef2575[_0x9e5e('0x21')];var _0x2c3411=_0x528609?0x0:_0x1b63bc['offset'];var _0x3af807=_0x528609?_0xef2575[_0x9e5e('0x21')]:_0x1b63bc['offset']+_0x1b63bc[_0x9e5e('0x20')];var _0x5d201f;if(_0x3af807>=_0x21e26b){_0x3af807=_0x21e26b;_0x5d201f=0xc8;}else{_0x5d201f=0xce;}_0x22aad4[_0x9e5e('0x1c')](_0x5d201f);return _0x22aad4[_0x9e5e('0x22')](_0x9e5e('0x23'),_0x2c3411+'-'+_0x3af807+'/'+_0x21e26b)[_0x9e5e('0x24')](_0xef2575);}return null;};}function patchUpdates(_0x5b7500){return function(_0x1d7bc6){try{jsonpatch[_0x9e5e('0x25')](_0x1d7bc6,_0x5b7500,!![]);}catch(_0xd5a7fc){return BPromise[_0x9e5e('0x26')](_0xd5a7fc);}return _0x1d7bc6['save']();};}function saveUpdates(_0x4366ec,_0x2dba34){return function(_0x26eef4){if(_0x26eef4){return _0x26eef4[_0x9e5e('0x27')](_0x4366ec)[_0x9e5e('0x28')](function(_0x1f38dd){return _0x1f38dd;});}return null;};}function removeEntity(_0x1dfd0b,_0x3b6dc6){return function(_0x313c03){if(_0x313c03){return _0x313c03[_0x9e5e('0x29')]()[_0x9e5e('0x28')](function(){_0x1dfd0b[_0x9e5e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d64b,_0xb0ffa0){return function(_0xa27b18){if(!_0xa27b18){_0x13d64b['sendStatus'](0x194);}return _0xa27b18;};}function handleError(_0x389a92,_0x1c864e){_0x1c864e=_0x1c864e||0x1f4;return function(_0x2dd7b7){logger[_0x9e5e('0x2a')](_0x2dd7b7[_0x9e5e('0x2b')]);if(_0x2dd7b7['name']){delete _0x2dd7b7[_0x9e5e('0x2c')];}_0x389a92['status'](_0x1c864e)[_0x9e5e('0x2d')](_0x2dd7b7);};}exports['index']=function(_0x39b634,_0x3da473){var _0x333fdf={},_0x2ae8e4={},_0x321f20={'count':0x0,'rows':[]};var _0x35991e=_[_0x9e5e('0x2e')](db[_0x9e5e('0x2f')][_0x9e5e('0x30')],function(_0x49e257){return{'name':_0x49e257[_0x9e5e('0x31')],'type':_0x49e257[_0x9e5e('0x32')][_0x9e5e('0x33')]};});_0x2ae8e4[_0x9e5e('0x34')]=_['map'](_0x35991e,_0x9e5e('0x2c'));_0x2ae8e4[_0x9e5e('0x35')]=_[_0x9e5e('0x36')](_0x39b634['query']);_0x2ae8e4[_0x9e5e('0x37')]=_[_0x9e5e('0x38')](_0x2ae8e4['model'],_0x2ae8e4[_0x9e5e('0x35')]);_0x333fdf[_0x9e5e('0x39')]=_[_0x9e5e('0x38')](_0x2ae8e4[_0x9e5e('0x34')],qs[_0x9e5e('0x3a')](_0x39b634[_0x9e5e('0x35')][_0x9e5e('0x3a')]));_0x333fdf[_0x9e5e('0x39')]=_0x333fdf[_0x9e5e('0x39')]['length']?_0x333fdf[_0x9e5e('0x39')]:_0x2ae8e4['model'];if(!_0x39b634['query'][_0x9e5e('0x3b')](_0x9e5e('0x3c'))){_0x333fdf[_0x9e5e('0x20')]=qs[_0x9e5e('0x20')](_0x39b634[_0x9e5e('0x35')][_0x9e5e('0x20')]);_0x333fdf['offset']=qs[_0x9e5e('0x1e')](_0x39b634[_0x9e5e('0x35')][_0x9e5e('0x1e')]);}_0x333fdf[_0x9e5e('0x3d')]=qs[_0x9e5e('0x3e')](_0x39b634[_0x9e5e('0x35')]['sort']);_0x333fdf[_0x9e5e('0x3f')]=qs[_0x9e5e('0x37')](_[_0x9e5e('0x40')](_0x39b634[_0x9e5e('0x35')],_0x2ae8e4[_0x9e5e('0x37')]),_0x35991e);if(_0x39b634[_0x9e5e('0x35')]['filter']){_0x333fdf[_0x9e5e('0x3f')]=_['merge'](_0x333fdf[_0x9e5e('0x3f')],{'$or':_[_0x9e5e('0x2e')](_0x35991e,function(_0x4afd59){if(_0x4afd59[_0x9e5e('0x32')]!=='VIRTUAL'){var _0x55015a={};_0x55015a[_0x4afd59[_0x9e5e('0x2c')]]={'$like':'%'+_0x39b634[_0x9e5e('0x35')]['filter']+'%'};return _0x55015a;}})});}_0x333fdf=_[_0x9e5e('0x41')]({},_0x333fdf,_0x39b634[_0x9e5e('0x42')]);var _0x17002c={'where':_0x333fdf[_0x9e5e('0x3f')]};return db['Dynamics365Field']['count'](_0x17002c)['then'](function(_0x3770d2){_0x321f20[_0x9e5e('0x21')]=_0x3770d2;if(_0x39b634['query'][_0x9e5e('0x43')]){_0x333fdf[_0x9e5e('0x44')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x9e5e('0x45')](_0x333fdf);})['then'](function(_0x9a337f){_0x321f20['rows']=_0x9a337f;return _0x321f20;})['then'](respondWithFilteredResult(_0x3da473,_0x333fdf))[_0x9e5e('0x46')](handleError(_0x3da473,null));};exports['show']=function(_0x59bb2a,_0xb21dc5){var _0x31f384={'raw':!![],'where':{'id':_0x59bb2a[_0x9e5e('0x47')]['id']}},_0x381720={};_0x381720[_0x9e5e('0x34')]=_[_0x9e5e('0x36')](db[_0x9e5e('0x2f')][_0x9e5e('0x30')]);_0x381720['query']=_[_0x9e5e('0x36')](_0x59bb2a['query']);_0x381720[_0x9e5e('0x37')]=_[_0x9e5e('0x38')](_0x381720[_0x9e5e('0x34')],_0x381720[_0x9e5e('0x35')]);_0x31f384['attributes']=_[_0x9e5e('0x38')](_0x381720['model'],qs[_0x9e5e('0x3a')](_0x59bb2a[_0x9e5e('0x35')][_0x9e5e('0x3a')]));_0x31f384['attributes']=_0x31f384[_0x9e5e('0x39')][_0x9e5e('0x48')]?_0x31f384[_0x9e5e('0x39')]:_0x381720['model'];if(_0x59bb2a[_0x9e5e('0x35')][_0x9e5e('0x43')]){_0x31f384['include']=[{'all':!![]}];}_0x31f384=_[_0x9e5e('0x41')]({},_0x31f384,_0x59bb2a[_0x9e5e('0x42')]);return db[_0x9e5e('0x2f')][_0x9e5e('0x49')](_0x31f384)[_0x9e5e('0x28')](handleEntityNotFound(_0xb21dc5,null))['then'](respondWithResult(_0xb21dc5,null))[_0x9e5e('0x46')](handleError(_0xb21dc5,null));};exports['create']=function(_0x19c6dc,_0xc891c7){return db[_0x9e5e('0x2f')][_0x9e5e('0x4a')](_0x19c6dc[_0x9e5e('0x4b')],{})['then'](respondWithResult(_0xc891c7,0xc9))[_0x9e5e('0x46')](handleError(_0xc891c7,null));};exports['update']=function(_0x1ac3ad,_0x8ffa9a){if(_0x1ac3ad[_0x9e5e('0x4b')]['id']){delete _0x1ac3ad[_0x9e5e('0x4b')]['id'];}return db['Dynamics365Field'][_0x9e5e('0x49')]({'where':{'id':_0x1ac3ad[_0x9e5e('0x47')]['id']}})[_0x9e5e('0x28')](handleEntityNotFound(_0x8ffa9a,null))[_0x9e5e('0x28')](saveUpdates(_0x1ac3ad[_0x9e5e('0x4b')],null))[_0x9e5e('0x28')](respondWithResult(_0x8ffa9a,null))[_0x9e5e('0x46')](handleError(_0x8ffa9a,null));};exports[_0x9e5e('0x29')]=function(_0x11cd21,_0x1d6afa){return db[_0x9e5e('0x2f')][_0x9e5e('0x49')]({'where':{'id':_0x11cd21['params']['id']}})[_0x9e5e('0x28')](handleEntityNotFound(_0x1d6afa,null))[_0x9e5e('0x28')](removeEntity(_0x1d6afa,null))[_0x9e5e('0x46')](handleError(_0x1d6afa,null));}; \ No newline at end of file +var _0x9481=['map','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','catch','rawAttributes','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Dynamics365Field','type','key'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0x9481,0x137));var _0x1948=function(_0x38b7bb,_0x21fd02){_0x38b7bb=_0x38b7bb-0x0;var _0x183069=_0x9481[_0x38b7bb];return _0x183069;};'use strict';var emlformat=require(_0x1948('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1948('0x1'));var jsonpatch=require(_0x1948('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1948('0x3'));var util=require(_0x1948('0x4'));var path=require(_0x1948('0x5'));var sox=require('sox');var csv=require(_0x1948('0x6'));var ejs=require(_0x1948('0x7'));var fs=require('fs');var fs_extra=require(_0x1948('0x8'));var _=require(_0x1948('0x9'));var squel=require(_0x1948('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1948('0xb'));var toCsv=require(_0x1948('0x6'));var querystring=require(_0x1948('0xc'));var Papa=require(_0x1948('0xd'));var Redis=require(_0x1948('0xe'));var authService=require(_0x1948('0xf'));var qs=require(_0x1948('0x10'));var as=require(_0x1948('0x11'));var hardwareService=require(_0x1948('0x12'));var logger=require(_0x1948('0x13'))('api');var utils=require(_0x1948('0x14'));var config=require(_0x1948('0x15'));var licenseUtil=require(_0x1948('0x16'));var db=require(_0x1948('0x17'))['db'];function respondWithStatusCode(_0x2af8d4,_0xacd78e){_0xacd78e=_0xacd78e||0xcc;return function(_0xff1f8b){if(_0xff1f8b){return _0x2af8d4['sendStatus'](_0xacd78e);}return _0x2af8d4['status'](_0xacd78e)[_0x1948('0x18')]();};}function respondWithResult(_0x3e3046,_0x5f2304){_0x5f2304=_0x5f2304||0xc8;return function(_0x6f6e2a){if(_0x6f6e2a){return _0x3e3046[_0x1948('0x19')](_0x5f2304)['json'](_0x6f6e2a);}};}function respondWithFilteredResult(_0x3140bf,_0x2f9a2b){return function(_0x2d4c16){if(_0x2d4c16){var _0x47ca7e=typeof _0x2f9a2b[_0x1948('0x1a')]===_0x1948('0x1b')&&typeof _0x2f9a2b[_0x1948('0x1c')]===_0x1948('0x1b');var _0x2b4b1e=_0x2d4c16[_0x1948('0x1d')];var _0x586b7a=_0x47ca7e?0x0:_0x2f9a2b[_0x1948('0x1a')];var _0x5dd045=_0x47ca7e?_0x2d4c16[_0x1948('0x1d')]:_0x2f9a2b[_0x1948('0x1a')]+_0x2f9a2b['limit'];var _0x29f3be;if(_0x5dd045>=_0x2b4b1e){_0x5dd045=_0x2b4b1e;_0x29f3be=0xc8;}else{_0x29f3be=0xce;}_0x3140bf[_0x1948('0x19')](_0x29f3be);return _0x3140bf['set'](_0x1948('0x1e'),_0x586b7a+'-'+_0x5dd045+'/'+_0x2b4b1e)[_0x1948('0x1f')](_0x2d4c16);}return null;};}function patchUpdates(_0x324f46){return function(_0x500dce){try{jsonpatch[_0x1948('0x20')](_0x500dce,_0x324f46,!![]);}catch(_0x22ced7){return BPromise['reject'](_0x22ced7);}return _0x500dce[_0x1948('0x21')]();};}function saveUpdates(_0x2a22ab,_0x69b37b){return function(_0x4472bb){if(_0x4472bb){return _0x4472bb[_0x1948('0x22')](_0x2a22ab)[_0x1948('0x23')](function(_0x3826f9){return _0x3826f9;});}return null;};}function removeEntity(_0x40664c,_0xbdd7cb){return function(_0x276d6a){if(_0x276d6a){return _0x276d6a[_0x1948('0x24')]()[_0x1948('0x23')](function(){_0x40664c['status'](0xcc)[_0x1948('0x18')]();});}};}function handleEntityNotFound(_0x45a5ed,_0x147032){return function(_0x2ca71c){if(!_0x2ca71c){_0x45a5ed['sendStatus'](0x194);}return _0x2ca71c;};}function handleError(_0xc7cc62,_0x58716c){_0x58716c=_0x58716c||0x1f4;return function(_0x29252c){logger[_0x1948('0x25')](_0x29252c[_0x1948('0x26')]);if(_0x29252c[_0x1948('0x27')]){delete _0x29252c[_0x1948('0x27')];}_0xc7cc62['status'](_0x58716c)[_0x1948('0x28')](_0x29252c);};}exports['index']=function(_0x80497e,_0x53f0ed){var _0x4cf3f8={},_0x297d93={},_0x52729c={'count':0x0,'rows':[]};var _0x55931d=_['map'](db[_0x1948('0x29')]['rawAttributes'],function(_0x4491d6){return{'name':_0x4491d6['fieldName'],'type':_0x4491d6[_0x1948('0x2a')][_0x1948('0x2b')]};});_0x297d93['model']=_[_0x1948('0x2c')](_0x55931d,_0x1948('0x27'));_0x297d93['query']=_[_0x1948('0x2d')](_0x80497e['query']);_0x297d93[_0x1948('0x2e')]=_['intersection'](_0x297d93[_0x1948('0x2f')],_0x297d93[_0x1948('0x30')]);_0x4cf3f8[_0x1948('0x31')]=_[_0x1948('0x32')](_0x297d93[_0x1948('0x2f')],qs[_0x1948('0x33')](_0x80497e['query']['fields']));_0x4cf3f8[_0x1948('0x31')]=_0x4cf3f8[_0x1948('0x31')][_0x1948('0x34')]?_0x4cf3f8[_0x1948('0x31')]:_0x297d93[_0x1948('0x2f')];if(!_0x80497e[_0x1948('0x30')][_0x1948('0x35')]('nolimit')){_0x4cf3f8[_0x1948('0x1c')]=qs[_0x1948('0x1c')](_0x80497e[_0x1948('0x30')][_0x1948('0x1c')]);_0x4cf3f8[_0x1948('0x1a')]=qs['offset'](_0x80497e[_0x1948('0x30')][_0x1948('0x1a')]);}_0x4cf3f8[_0x1948('0x36')]=qs[_0x1948('0x37')](_0x80497e[_0x1948('0x30')][_0x1948('0x37')]);_0x4cf3f8['where']=qs[_0x1948('0x2e')](_[_0x1948('0x38')](_0x80497e[_0x1948('0x30')],_0x297d93['filters']),_0x55931d);if(_0x80497e[_0x1948('0x30')]['filter']){_0x4cf3f8[_0x1948('0x39')]=_[_0x1948('0x3a')](_0x4cf3f8['where'],{'$or':_[_0x1948('0x2c')](_0x55931d,function(_0x204496){if(_0x204496['type']!==_0x1948('0x3b')){var _0x2856f3={};_0x2856f3[_0x204496[_0x1948('0x27')]]={'$like':'%'+_0x80497e[_0x1948('0x30')][_0x1948('0x3c')]+'%'};return _0x2856f3;}})});}_0x4cf3f8=_[_0x1948('0x3a')]({},_0x4cf3f8,_0x80497e[_0x1948('0x3d')]);var _0x401cbb={'where':_0x4cf3f8[_0x1948('0x39')]};return db[_0x1948('0x29')][_0x1948('0x1d')](_0x401cbb)[_0x1948('0x23')](function(_0x4495d2){_0x52729c[_0x1948('0x1d')]=_0x4495d2;if(_0x80497e['query']['includeAll']){_0x4cf3f8[_0x1948('0x3e')]=[{'all':!![]}];}return db[_0x1948('0x29')][_0x1948('0x3f')](_0x4cf3f8);})['then'](function(_0x2a3f07){_0x52729c['rows']=_0x2a3f07;return _0x52729c;})[_0x1948('0x23')](respondWithFilteredResult(_0x53f0ed,_0x4cf3f8))[_0x1948('0x40')](handleError(_0x53f0ed,null));};exports['show']=function(_0x3ad42b,_0x19b5b4){var _0x93144={'raw':!![],'where':{'id':_0x3ad42b['params']['id']}},_0x32f9f7={};_0x32f9f7[_0x1948('0x2f')]=_['keys'](db['Dynamics365Field'][_0x1948('0x41')]);_0x32f9f7[_0x1948('0x30')]=_[_0x1948('0x2d')](_0x3ad42b[_0x1948('0x30')]);_0x32f9f7[_0x1948('0x2e')]=_[_0x1948('0x32')](_0x32f9f7[_0x1948('0x2f')],_0x32f9f7[_0x1948('0x30')]);_0x93144['attributes']=_[_0x1948('0x32')](_0x32f9f7[_0x1948('0x2f')],qs[_0x1948('0x33')](_0x3ad42b[_0x1948('0x30')]['fields']));_0x93144['attributes']=_0x93144[_0x1948('0x31')][_0x1948('0x34')]?_0x93144['attributes']:_0x32f9f7[_0x1948('0x2f')];if(_0x3ad42b['query'][_0x1948('0x42')]){_0x93144['include']=[{'all':!![]}];}_0x93144=_[_0x1948('0x3a')]({},_0x93144,_0x3ad42b[_0x1948('0x3d')]);return db[_0x1948('0x29')][_0x1948('0x43')](_0x93144)[_0x1948('0x23')](handleEntityNotFound(_0x19b5b4,null))['then'](respondWithResult(_0x19b5b4,null))['catch'](handleError(_0x19b5b4,null));};exports['create']=function(_0x4ff4f8,_0x3e564b){return db[_0x1948('0x29')][_0x1948('0x44')](_0x4ff4f8['body'],{})[_0x1948('0x23')](respondWithResult(_0x3e564b,0xc9))[_0x1948('0x40')](handleError(_0x3e564b,null));};exports[_0x1948('0x22')]=function(_0x514f55,_0x4652e2){if(_0x514f55['body']['id']){delete _0x514f55[_0x1948('0x45')]['id'];}return db[_0x1948('0x29')][_0x1948('0x43')]({'where':{'id':_0x514f55[_0x1948('0x46')]['id']}})['then'](handleEntityNotFound(_0x4652e2,null))[_0x1948('0x23')](saveUpdates(_0x514f55[_0x1948('0x45')],null))[_0x1948('0x23')](respondWithResult(_0x4652e2,null))[_0x1948('0x40')](handleError(_0x4652e2,null));};exports['destroy']=function(_0x305a75,_0x205398){return db[_0x1948('0x29')][_0x1948('0x43')]({'where':{'id':_0x305a75[_0x1948('0x46')]['id']}})[_0x1948('0x23')](handleEntityNotFound(_0x205398,null))[_0x1948('0x23')](removeEntity(_0x205398,null))[_0x1948('0x40')](handleError(_0x205398,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c6c828e..166af33 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d63=['request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4cfa93,_0x105f7a){var _0x3f707e=function(_0x47700e){while(--_0x47700e){_0x4cfa93['push'](_0x4cfa93['shift']());}};_0x3f707e(++_0x105f7a);}(_0x7d63,0x1da));var _0x37d6=function(_0x32a767,_0x4e3e76){_0x32a767=_0x32a767-0x0;var _0x2b4e6d=_0x7d63[_0x32a767];return _0x2b4e6d;};'use strict';var _=require(_0x37d6('0x0'));var util=require(_0x37d6('0x1'));var logger=require(_0x37d6('0x2'))(_0x37d6('0x3'));var moment=require(_0x37d6('0x4'));var BPromise=require(_0x37d6('0x5'));var rp=require(_0x37d6('0x6'));var fs=require('fs');var path=require(_0x37d6('0x7'));var rimraf=require('rimraf');var config=require(_0x37d6('0x8'));var attributes=require(_0x37d6('0x9'));module[_0x37d6('0xa')]=function(_0x53c565,_0x1209b0){return _0x53c565['define'](_0x37d6('0xb'),attributes,{'tableName':_0x37d6('0xc'),'paranoid':![],'indexes':[{'name':_0x37d6('0xd'),'fields':['idField',_0x37d6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60b8=['dynamics365_unique_index','FieldId','util','../../config/logger','api','moment','request-promise','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x60b8,0x1bc));var _0x860b=function(_0x235323,_0x26096a){_0x235323=_0x235323-0x0;var _0x5f37da=_0x60b8[_0x235323];return _0x5f37da;};'use strict';var _=require('lodash');var util=require(_0x860b('0x0'));var logger=require(_0x860b('0x1'))(_0x860b('0x2'));var moment=require(_0x860b('0x3'));var BPromise=require('bluebird');var rp=require(_0x860b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x860b('0x5'));var config=require('../../config/environment');var attributes=require(_0x860b('0x6'));module[_0x860b('0x7')]=function(_0x4a65e6,_0x4a4c6d){return _0x4a65e6[_0x860b('0x8')](_0x860b('0x9'),attributes,{'tableName':_0x860b('0xa'),'paranoid':![],'indexes':[{'name':_0x860b('0xb'),'fields':['idField',_0x860b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 4d15b54..06ef5f5 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87bb=['../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x87bb,0x1c8));var _0xb87b=function(_0x3e2ce6,_0x1e055c){_0x3e2ce6=_0x3e2ce6-0x0;var _0x4ccc1b=_0x87bb[_0x3e2ce6];return _0x4ccc1b;};'use strict';var _=require('lodash');var util=require(_0xb87b('0x0'));var moment=require(_0xb87b('0x1'));var BPromise=require(_0xb87b('0x2'));var rs=require(_0xb87b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb87b('0x4'));var logger=require(_0xb87b('0x5'))('rpc');var config=require(_0xb87b('0x6'));var jayson=require(_0xb87b('0x7'));var client=jayson[_0xb87b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13e6f1,_0x38fed0,_0x150476){return new BPromise(function(_0x2b4a9f,_0x30404f){return client[_0xb87b('0x9')](_0x13e6f1,_0x150476)[_0xb87b('0xa')](function(_0x3dc7fd){logger[_0xb87b('0xb')](_0xb87b('0xc'),_0x38fed0,'request\x20sent');logger[_0xb87b('0xd')](_0xb87b('0xe'),_0x38fed0,_0xb87b('0xf'),JSON[_0xb87b('0x10')](_0x3dc7fd));if(_0x3dc7fd['error']){if(_0x3dc7fd[_0xb87b('0x11')][_0xb87b('0x12')]===0x1f4){logger['error'](_0xb87b('0xc'),_0x38fed0,_0x3dc7fd[_0xb87b('0x11')][_0xb87b('0x13')]);return _0x30404f(_0x3dc7fd[_0xb87b('0x11')][_0xb87b('0x13')]);}logger[_0xb87b('0x11')](_0xb87b('0xc'),_0x38fed0,_0x3dc7fd['error'][_0xb87b('0x13')]);return _0x2b4a9f(_0x3dc7fd[_0xb87b('0x11')]['message']);}else{logger[_0xb87b('0xb')](_0xb87b('0xc'),_0x38fed0,_0xb87b('0xf'));_0x2b4a9f(_0x3dc7fd[_0xb87b('0x14')][_0xb87b('0x13')]);}})[_0xb87b('0x15')](function(_0xcaccca){logger['error'](_0xb87b('0xc'),_0x38fed0,_0xcaccca);_0x30404f(_0xcaccca);});});} \ No newline at end of file +var _0x4781=['Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0xbab899,_0x4b734e){var _0x1e7712=function(_0x59b5fb){while(--_0x59b5fb){_0xbab899['push'](_0xbab899['shift']());}};_0x1e7712(++_0x4b734e);}(_0x4781,0x172));var _0x1478=function(_0x302b68,_0x284f81){_0x302b68=_0x302b68-0x0;var _0x2bf1b4=_0x4781[_0x302b68];return _0x2bf1b4;};'use strict';var _=require('lodash');var util=require(_0x1478('0x0'));var moment=require(_0x1478('0x1'));var BPromise=require(_0x1478('0x2'));var rs=require(_0x1478('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1478('0x4'))['db'];var utils=require(_0x1478('0x5'));var logger=require('../../config/logger')(_0x1478('0x6'));var config=require(_0x1478('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1478('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52b4b6,_0x4fc7de,_0x355d7e){return new BPromise(function(_0xb20c2b,_0x1c3abd){return client[_0x1478('0x9')](_0x52b4b6,_0x355d7e)['then'](function(_0x3f23a9){logger['info'](_0x1478('0xa'),_0x4fc7de,'request\x20sent');logger[_0x1478('0xb')](_0x1478('0xc'),_0x4fc7de,_0x1478('0xd'),JSON[_0x1478('0xe')](_0x3f23a9));if(_0x3f23a9[_0x1478('0xf')]){if(_0x3f23a9[_0x1478('0xf')][_0x1478('0x10')]===0x1f4){logger[_0x1478('0xf')](_0x1478('0xa'),_0x4fc7de,_0x3f23a9[_0x1478('0xf')][_0x1478('0x11')]);return _0x1c3abd(_0x3f23a9['error'][_0x1478('0x11')]);}logger[_0x1478('0xf')](_0x1478('0xa'),_0x4fc7de,_0x3f23a9[_0x1478('0xf')]['message']);return _0xb20c2b(_0x3f23a9[_0x1478('0xf')][_0x1478('0x11')]);}else{logger['info'](_0x1478('0xa'),_0x4fc7de,'request\x20sent');_0xb20c2b(_0x3f23a9['result']['message']);}})[_0x1478('0x12')](function(_0x5e058d){logger[_0x1478('0xf')](_0x1478('0xa'),_0x4fc7de,_0x5e058d);_0x1c3abd(_0x5e058d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 41220ad..60eab34 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd36=['put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x1e579f,_0x5e40cb){var _0x5caf1c=function(_0x555d1d){while(--_0x555d1d){_0x1e579f['push'](_0x1e579f['shift']());}};_0x5caf1c(++_0x5e40cb);}(_0xfd36,0x117));var _0x6fd3=function(_0x563ba6,_0x5173e4){_0x563ba6=_0x563ba6-0x0;var _0x2b9e70=_0xfd36[_0x563ba6];return _0x2b9e70;};'use strict';var multer=require(_0x6fd3('0x0'));var util=require(_0x6fd3('0x1'));var path=require(_0x6fd3('0x2'));var timeout=require(_0x6fd3('0x3'));var express=require(_0x6fd3('0x4'));var router=express['Router']();var fs_extra=require(_0x6fd3('0x5'));var auth=require(_0x6fd3('0x6'));var interaction=require(_0x6fd3('0x7'));var config=require(_0x6fd3('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x6fd3('0x9')]('/',auth[_0x6fd3('0xa')](),controller[_0x6fd3('0xb')]);router[_0x6fd3('0x9')](_0x6fd3('0xc'),auth[_0x6fd3('0xa')](),controller['show']);router['get'](_0x6fd3('0xd'),auth['isAuthenticated'](),controller[_0x6fd3('0xe')]);router[_0x6fd3('0x9')](_0x6fd3('0xf'),auth[_0x6fd3('0xa')](),controller[_0x6fd3('0x10')]);router[_0x6fd3('0x11')]('/',auth[_0x6fd3('0xa')](),controller[_0x6fd3('0x12')]);router[_0x6fd3('0x11')](_0x6fd3('0xd'),auth[_0x6fd3('0xa')](),controller[_0x6fd3('0x13')]);router[_0x6fd3('0x14')](_0x6fd3('0xc'),auth[_0x6fd3('0xa')](),controller['update']);router[_0x6fd3('0x15')](_0x6fd3('0xc'),auth[_0x6fd3('0xa')](),controller[_0x6fd3('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3f01=['/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete'];(function(_0x2094b5,_0x54c8ae){var _0x2edab9=function(_0x395898){while(--_0x395898){_0x2094b5['push'](_0x2094b5['shift']());}};_0x2edab9(++_0x54c8ae);}(_0x3f01,0x18f));var _0x13f0=function(_0x1ae2b9,_0x1eaf30){_0x1ae2b9=_0x1ae2b9-0x0;var _0x587a19=_0x3f01[_0x1ae2b9];return _0x587a19;};'use strict';var multer=require(_0x13f0('0x0'));var util=require('util');var path=require(_0x13f0('0x1'));var timeout=require(_0x13f0('0x2'));var express=require(_0x13f0('0x3'));var router=express['Router']();var fs_extra=require(_0x13f0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13f0('0x5'));var controller=require(_0x13f0('0x6'));router[_0x13f0('0x7')]('/',auth[_0x13f0('0x8')](),controller['index']);router[_0x13f0('0x7')]('/:id',auth[_0x13f0('0x8')](),controller[_0x13f0('0x9')]);router['get'](_0x13f0('0xa'),auth[_0x13f0('0x8')](),controller[_0x13f0('0xb')]);router[_0x13f0('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x13f0('0xc')]);router['post']('/',auth[_0x13f0('0x8')](),controller[_0x13f0('0xd')]);router[_0x13f0('0xe')](_0x13f0('0xa'),auth['isAuthenticated'](),controller[_0x13f0('0xf')]);router[_0x13f0('0x10')]('/:id',auth[_0x13f0('0x8')](),controller[_0x13f0('0x11')]);router[_0x13f0('0x12')](_0x13f0('0x13'),auth[_0x13f0('0x8')](),controller[_0x13f0('0x14')]);module[_0x13f0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6bf23e3..9feb89d 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8603=['remoteUri','exports','STRING'];(function(_0xaece68,_0x2d3fa0){var _0x56bc89=function(_0x32efad){while(--_0x32efad){_0xaece68['push'](_0xaece68['shift']());}};_0x56bc89(++_0x2d3fa0);}(_0x8603,0x190));var _0x3860=function(_0x4b8609,_0x45bfdc){_0x4b8609=_0x4b8609-0x0;var _0x1f2269=_0x8603[_0x4b8609];return _0x1f2269;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd117=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5ace1f,_0x50e292){var _0x3ed55b=function(_0x1cb843){while(--_0x1cb843){_0x5ace1f['push'](_0x5ace1f['shift']());}};_0x3ed55b(++_0x50e292);}(_0xd117,0x182));var _0x7d11=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0xd117[_0x1304c6];return _0x2e6654;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'apiKey':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 9d9d530..8496b40 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8164=['substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','capitalize','statusCode','error','stringify','test','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','sendStatus','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','getConfigurations','FreshdeskConfiguration','order','sort','pick','addConfiguration','findOne','AccountId','Subjects','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice'];(function(_0x2d2d62,_0x10b23f){var _0xb7d7d6=function(_0x2fb215){while(--_0x2fb215){_0x2d2d62['push'](_0x2d2d62['shift']());}};_0xb7d7d6(++_0x10b23f);}(_0x8164,0x170));var _0x4816=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x8164[_0x7185f7];return _0x182e45;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4816('0x15'));function respondWithStatusCode(_0x51a5f8,_0x5c4d42){_0x5c4d42=_0x5c4d42||0xcc;return function(_0x45a360){if(_0x45a360){return _0x51a5f8['sendStatus'](_0x5c4d42);}return _0x51a5f8[_0x4816('0x16')](_0x5c4d42)[_0x4816('0x17')]();};}function respondWithResult(_0x13a685,_0x316f36){_0x316f36=_0x316f36||0xc8;return function(_0x42fc52){if(_0x42fc52){return _0x13a685[_0x4816('0x16')](_0x316f36)[_0x4816('0x18')](_0x42fc52);}};}function respondWithFilteredResult(_0x2a58b7,_0x45c006){return function(_0x21354c){if(_0x21354c){var _0x1ce1fb=typeof _0x45c006[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x45c006[_0x4816('0x1b')]===_0x4816('0x1a');var _0x5c446b=_0x21354c['count'];var _0x5b54d4=_0x1ce1fb?0x0:_0x45c006[_0x4816('0x19')];var _0x354fdd=_0x1ce1fb?_0x21354c[_0x4816('0x1c')]:_0x45c006[_0x4816('0x19')]+_0x45c006[_0x4816('0x1b')];var _0x37effd;if(_0x354fdd>=_0x5c446b){_0x354fdd=_0x5c446b;_0x37effd=0xc8;}else{_0x37effd=0xce;}_0x2a58b7[_0x4816('0x16')](_0x37effd);return _0x2a58b7[_0x4816('0x1d')](_0x4816('0x1e'),_0x5b54d4+'-'+_0x354fdd+'/'+_0x5c446b)['json'](_0x21354c);}return null;};}function patchUpdates(_0x1ab50d){return function(_0x583a99){try{jsonpatch['apply'](_0x583a99,_0x1ab50d,!![]);}catch(_0x233902){return BPromise[_0x4816('0x1f')](_0x233902);}return _0x583a99['save']();};}function saveUpdates(_0x2bbaf4,_0x576221){return function(_0x46eb06){if(_0x46eb06){return _0x46eb06[_0x4816('0x20')](_0x2bbaf4)['then'](function(_0x504851){return _0x504851;});}return null;};}function removeEntity(_0xe484b2,_0x2c8dc4){return function(_0x394ecd){if(_0x394ecd){return _0x394ecd['destroy']()[_0x4816('0x21')](function(){_0xe484b2[_0x4816('0x16')](0xcc)[_0x4816('0x17')]();});}};}function handleEntityNotFound(_0x3f07f1,_0x571a05){return function(_0x565651){if(!_0x565651){_0x3f07f1[_0x4816('0x22')](0x194);}return _0x565651;};}function handleError(_0x47701a,_0x590349){_0x590349=_0x590349||0x1f4;return function(_0x3c96ce){logger['error'](_0x3c96ce['stack']);if(_0x3c96ce[_0x4816('0x23')]){delete _0x3c96ce[_0x4816('0x23')];}_0x47701a[_0x4816('0x16')](_0x590349)['send'](_0x3c96ce);};}exports[_0x4816('0x24')]=function(_0x521259,_0x39ddbd){var _0x229086={},_0x49c337={},_0x8ca388={'count':0x0,'rows':[]};var _0x34ba85=_[_0x4816('0x25')](db[_0x4816('0x26')][_0x4816('0x27')],function(_0x332af7){return{'name':_0x332af7[_0x4816('0x28')],'type':_0x332af7[_0x4816('0x29')][_0x4816('0x2a')]};});_0x49c337['model']=_[_0x4816('0x25')](_0x34ba85,_0x4816('0x23'));_0x49c337['query']=_['keys'](_0x521259[_0x4816('0x2b')]);_0x49c337[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x49c337[_0x4816('0x2e')],_0x49c337[_0x4816('0x2b')]);_0x229086['attributes']=_['intersection'](_0x49c337['model'],qs[_0x4816('0x2f')](_0x521259[_0x4816('0x2b')][_0x4816('0x2f')]));_0x229086[_0x4816('0x30')]=_0x229086[_0x4816('0x30')][_0x4816('0x31')]?_0x229086['attributes']:_0x49c337[_0x4816('0x2e')];if(!_0x521259['query'][_0x4816('0x32')](_0x4816('0x33'))){_0x229086[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x521259[_0x4816('0x2b')]['limit']);_0x229086[_0x4816('0x19')]=qs['offset'](_0x521259['query'][_0x4816('0x19')]);}_0x229086['order']=qs['sort'](_0x521259['query']['sort']);_0x229086[_0x4816('0x34')]=qs[_0x4816('0x2c')](_['pick'](_0x521259[_0x4816('0x2b')],_0x49c337[_0x4816('0x2c')]),_0x34ba85);if(_0x521259['query'][_0x4816('0x35')]){_0x229086[_0x4816('0x34')]=_[_0x4816('0x36')](_0x229086[_0x4816('0x34')],{'$or':_['map'](_0x34ba85,function(_0x30ed56){if(_0x30ed56[_0x4816('0x29')]!==_0x4816('0x37')){var _0x442a63={};_0x442a63[_0x30ed56[_0x4816('0x23')]]={'$like':'%'+_0x521259[_0x4816('0x2b')][_0x4816('0x35')]+'%'};return _0x442a63;}})});}_0x229086=_[_0x4816('0x36')]({},_0x229086,_0x521259[_0x4816('0x38')]);var _0x2d5752={'where':_0x229086[_0x4816('0x34')]};return db[_0x4816('0x26')][_0x4816('0x1c')](_0x2d5752)['then'](function(_0x3fa20c){_0x8ca388[_0x4816('0x1c')]=_0x3fa20c;if(_0x521259[_0x4816('0x2b')][_0x4816('0x39')]){_0x229086[_0x4816('0x3a')]=[{'all':!![]}];}return db[_0x4816('0x26')][_0x4816('0x3b')](_0x229086);})['then'](function(_0x39b205){_0x8ca388['rows']=_0x39b205;return _0x8ca388;})['then'](respondWithFilteredResult(_0x39ddbd,_0x229086))[_0x4816('0x3c')](handleError(_0x39ddbd,null));};exports[_0x4816('0x3d')]=function(_0x560170,_0x23d3a1){var _0x432bce={'raw':![],'where':{'id':_0x560170['params']['id']}},_0x476765={};_0x476765[_0x4816('0x2e')]=_[_0x4816('0x3e')](db[_0x4816('0x26')][_0x4816('0x27')]);_0x476765[_0x4816('0x2b')]=_[_0x4816('0x3e')](_0x560170['query']);_0x476765[_0x4816('0x2c')]=_['intersection'](_0x476765['model'],_0x476765['query']);_0x432bce[_0x4816('0x30')]=_[_0x4816('0x2d')](_0x476765[_0x4816('0x2e')],qs[_0x4816('0x2f')](_0x560170[_0x4816('0x2b')][_0x4816('0x2f')]));_0x432bce[_0x4816('0x30')]=_0x432bce[_0x4816('0x30')][_0x4816('0x31')]?_0x432bce[_0x4816('0x30')]:_0x476765['model'];if(_0x560170['query'][_0x4816('0x39')]){_0x432bce[_0x4816('0x3a')]=[{'all':!![]}];}_0x432bce=_[_0x4816('0x36')]({},_0x432bce,_0x560170[_0x4816('0x38')]);return db[_0x4816('0x26')][_0x4816('0x3f')](_0x432bce)[_0x4816('0x21')](handleEntityNotFound(_0x23d3a1,null))[_0x4816('0x21')](respondWithResult(_0x23d3a1,null))['catch'](handleError(_0x23d3a1,null));};exports[_0x4816('0x40')]=function(_0x1ea828,_0x31993a){return db['FreshdeskAccount']['create'](_0x1ea828[_0x4816('0x41')],{})[_0x4816('0x21')](respondWithResult(_0x31993a,0xc9))[_0x4816('0x3c')](handleError(_0x31993a,null));};exports['update']=function(_0x247adb,_0x41ce8f){if(_0x247adb[_0x4816('0x41')]['id']){delete _0x247adb[_0x4816('0x41')]['id'];}return db[_0x4816('0x26')][_0x4816('0x3f')]({'where':{'id':_0x247adb[_0x4816('0x42')]['id']}})['then'](handleEntityNotFound(_0x41ce8f,null))[_0x4816('0x21')](saveUpdates(_0x247adb[_0x4816('0x41')],null))[_0x4816('0x21')](respondWithResult(_0x41ce8f,null))[_0x4816('0x3c')](handleError(_0x41ce8f,null));};exports[_0x4816('0x43')]=function(_0x47112a,_0x309778){return db[_0x4816('0x26')][_0x4816('0x3f')]({'where':{'id':_0x47112a[_0x4816('0x42')]['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x309778,null))[_0x4816('0x21')](removeEntity(_0x309778,null))[_0x4816('0x3c')](handleError(_0x309778,null));};exports[_0x4816('0x44')]=function(_0x2930f4,_0x433ac5,_0x306e86){var _0x11272b={};var _0x2e619f={};var _0x56321c;var _0x1702bf;return db[_0x4816('0x26')]['findOne']({'where':{'id':_0x2930f4[_0x4816('0x42')]['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x433ac5,null))['then'](function(_0x3604e6){if(_0x3604e6){_0x56321c=_0x3604e6;_0x2e619f[_0x4816('0x2e')]=_[_0x4816('0x3e')](db[_0x4816('0x45')][_0x4816('0x27')]);_0x2e619f[_0x4816('0x2b')]=_[_0x4816('0x3e')](_0x2930f4[_0x4816('0x2b')]);_0x2e619f[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x2e619f['model'],_0x2e619f[_0x4816('0x2b')]);_0x11272b['attributes']=_[_0x4816('0x2d')](_0x2e619f[_0x4816('0x2e')],qs['fields'](_0x2930f4[_0x4816('0x2b')][_0x4816('0x2f')]));_0x11272b[_0x4816('0x30')]=_0x11272b[_0x4816('0x30')][_0x4816('0x31')]?_0x11272b['attributes']:_0x2e619f[_0x4816('0x2e')];_0x11272b[_0x4816('0x46')]=qs[_0x4816('0x47')](_0x2930f4[_0x4816('0x2b')][_0x4816('0x47')]);_0x11272b[_0x4816('0x34')]=qs['filters'](_[_0x4816('0x48')](_0x2930f4[_0x4816('0x2b')],_0x2e619f[_0x4816('0x2c')]));if(_0x2930f4['query'][_0x4816('0x35')]){_0x11272b[_0x4816('0x34')]=_[_0x4816('0x36')](_0x11272b['where'],{'$or':_[_0x4816('0x25')](_0x11272b[_0x4816('0x30')],function(_0xa67f45){var _0xfb9e4a={};_0xfb9e4a[_0xa67f45]={'$like':'%'+_0x2930f4['query'][_0x4816('0x35')]+'%'};return _0xfb9e4a;})});}_0x11272b=_[_0x4816('0x36')]({},_0x11272b,_0x2930f4[_0x4816('0x38')]);return _0x56321c['getConfigurations'](_0x11272b);}})['then'](function(_0x2a9d8b){if(_0x2a9d8b){_0x1702bf=_0x2a9d8b[_0x4816('0x31')];if(!_0x2930f4[_0x4816('0x2b')][_0x4816('0x32')](_0x4816('0x33'))){_0x11272b[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x2930f4['query'][_0x4816('0x1b')]);_0x11272b[_0x4816('0x19')]=qs[_0x4816('0x19')](_0x2930f4['query'][_0x4816('0x19')]);}return _0x56321c[_0x4816('0x44')](_0x11272b);}})[_0x4816('0x21')](function(_0x2c2a8c){if(_0x2c2a8c){return _0x2c2a8c?{'count':_0x1702bf,'rows':_0x2c2a8c}:null;}})[_0x4816('0x21')](respondWithResult(_0x433ac5,null))[_0x4816('0x3c')](handleError(_0x433ac5,null));};exports[_0x4816('0x49')]=function(_0x52cf85,_0x171c2b,_0x11e6f9){if(_0x52cf85[_0x4816('0x41')]['id']){delete _0x52cf85['body']['id'];}return db[_0x4816('0x26')][_0x4816('0x4a')]({'where':{'id':_0x52cf85['params']['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x171c2b,null))[_0x4816('0x21')](function(_0x211a2b){if(_0x211a2b){_0x52cf85[_0x4816('0x41')][_0x4816('0x4b')]=_0x211a2b['id'];_0x52cf85[_0x4816('0x41')][_0x4816('0x4c')]=integrations['getSubjects'](_0x52cf85[_0x4816('0x41')]['channel'],_0x52cf85['body']['type']);_0x52cf85['body']['Descriptions']=integrations[_0x4816('0x4d')](_0x52cf85[_0x4816('0x41')][_0x4816('0x4e')],_0x52cf85['body'][_0x4816('0x29')]);return db[_0x4816('0x45')][_0x4816('0x40')](_0x52cf85[_0x4816('0x41')],{'include':[{'model':db[_0x4816('0x4f')],'as':_0x4816('0x4c')},{'model':db[_0x4816('0x4f')],'as':'Descriptions'}]});}return null;})[_0x4816('0x21')](respondWithResult(_0x171c2b,null))['catch'](handleError(_0x171c2b,null));};exports[_0x4816('0x50')]=function(_0x2cbc59,_0x5277dc,_0x3002b7){var _0x9165c8='';return db[_0x4816('0x26')]['findOne']({'where':{'id':_0x2cbc59[_0x4816('0x42')]['id']},'attributes':['id',_0x4816('0x51'),_0x4816('0x52')]})['then'](handleEntityNotFound(_0x5277dc,null))[_0x4816('0x21')](function(_0x1540cf){if(_0x1540cf){_0x9165c8=_0x1540cf[_0x4816('0x51')];var _0x5742fa=_0x9165c8[_0x4816('0x53')](-0x1);if(_0x5742fa==='/'){_0x9165c8=_0x9165c8[_0x4816('0x54')](0x0,_0x9165c8[_0x4816('0x55')](_0x5742fa));}return rp({'method':_0x4816('0x56'),'uri':util[_0x4816('0x57')](_0x4816('0x58'),_0x9165c8,_0x4816('0x59')),'headers':{'Authorization':util['format'](_0x4816('0x5a'),new Buffer(util[_0x4816('0x57')](_0x4816('0x5b'),_0x1540cf[_0x4816('0x52')]))[_0x4816('0x5c')](_0x4816('0x5d')))},'json':!![]});}})[_0x4816('0x21')](function(_0x4abba0){if(_0x4abba0){var _0x1d41a3=[_0x4816('0x5e'),_0x4816('0x5f'),_0x4816('0x60'),'description',_0x4816('0x16'),_0x4816('0x61'),_0x4816('0x62'),_0x4816('0x63'),_0x4816('0x64'),_0x4816('0x62'),_0x4816('0x65')];_[_0x4816('0x66')](_0x4abba0,function(_0x28419c){return _0x1d41a3[_0x4816('0x67')](_0x28419c[_0x4816('0x23')])||!_0x28419c[_0x4816('0x68')]&&_0x28419c[_0x4816('0x29')]!=='custom_text'&&_0x28419c[_0x4816('0x29')]!==_0x4816('0x69');});return{'count':_0x4abba0[_0x4816('0x31')],'rows':_[_0x4816('0x25')](_0x4abba0,function(_0x21fe50){return{'id':_0x21fe50[_0x4816('0x23')],'name':_0x21fe50[_0x4816('0x6a')],'custom':!_0x21fe50[_0x4816('0x68')],'options':_0x21fe50[_0x4816('0x6b')]?_[_0x4816('0x25')](_0x21fe50[_0x4816('0x6b')],function(_0x2bf3aa){return{'name':_[_0x4816('0x6c')](_0x2bf3aa),'value':_0x2bf3aa};}):[]};})};}})['then'](respondWithResult(_0x5277dc,null))[_0x4816('0x3c')](function(_0x2dca54){var _0xad3f8e=_0x2cbc59['query']['test']?0x1f4:_0x2dca54[_0x4816('0x6d')]||0x1f4;logger[_0x4816('0x6e')]('getFields,\x20%s,\x20%s,\x20%s',_0x4816('0x50'),_0xad3f8e,JSON[_0x4816('0x6f')](_0x2dca54));delete _0x2dca54[_0x4816('0x23')];if(_0xad3f8e===0x191){_0xad3f8e=0x190;}_0x5277dc[_0x4816('0x16')](_0xad3f8e)['send'](_0x2cbc59[_0x4816('0x2b')][_0x4816('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x2dca54[_0x4816('0x6d')]}:_0x2dca54);});}; \ No newline at end of file +var _0x9234=['error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','lastIndexOf','%s/%s','Basic\x20%s','format','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9234,0x1bd));var _0x4923=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x9234[_0xb0de07];return _0x4633d8;};'use strict';var emlformat=require(_0x4923('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4923('0x1'));var jsonpatch=require(_0x4923('0x2'));var rp=require(_0x4923('0x3'));var moment=require(_0x4923('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4923('0x5'));var util=require(_0x4923('0x6'));var path=require('path');var sox=require(_0x4923('0x7'));var csv=require(_0x4923('0x8'));var ejs=require(_0x4923('0x9'));var fs=require('fs');var fs_extra=require(_0x4923('0xa'));var _=require(_0x4923('0xb'));var squel=require(_0x4923('0xc'));var crypto=require(_0x4923('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4923('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4923('0xf'));var Papa=require(_0x4923('0x10'));var Redis=require(_0x4923('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4923('0x12'));var as=require(_0x4923('0x13'));var hardwareService=require(_0x4923('0x14'));var logger=require(_0x4923('0x15'))(_0x4923('0x16'));var utils=require(_0x4923('0x17'));var config=require(_0x4923('0x18'));var licenseUtil=require(_0x4923('0x19'));var db=require(_0x4923('0x1a'))['db'];var integrations=require(_0x4923('0x1b'));function respondWithStatusCode(_0x5b950f,_0x4d6fda){_0x4d6fda=_0x4d6fda||0xcc;return function(_0x292799){if(_0x292799){return _0x5b950f[_0x4923('0x1c')](_0x4d6fda);}return _0x5b950f[_0x4923('0x1d')](_0x4d6fda)['end']();};}function respondWithResult(_0x31a469,_0x27a52b){_0x27a52b=_0x27a52b||0xc8;return function(_0x191257){if(_0x191257){return _0x31a469[_0x4923('0x1d')](_0x27a52b)[_0x4923('0x1e')](_0x191257);}};}function respondWithFilteredResult(_0x29a354,_0x1f8375){return function(_0x2897da){if(_0x2897da){var _0x2e9944=typeof _0x1f8375[_0x4923('0x1f')]==='undefined'&&typeof _0x1f8375[_0x4923('0x20')]===_0x4923('0x21');var _0x5dbb86=_0x2897da[_0x4923('0x22')];var _0x517b95=_0x2e9944?0x0:_0x1f8375['offset'];var _0x16955b=_0x2e9944?_0x2897da['count']:_0x1f8375[_0x4923('0x1f')]+_0x1f8375[_0x4923('0x20')];var _0x5dbddb;if(_0x16955b>=_0x5dbb86){_0x16955b=_0x5dbb86;_0x5dbddb=0xc8;}else{_0x5dbddb=0xce;}_0x29a354[_0x4923('0x1d')](_0x5dbddb);return _0x29a354[_0x4923('0x23')](_0x4923('0x24'),_0x517b95+'-'+_0x16955b+'/'+_0x5dbb86)[_0x4923('0x1e')](_0x2897da);}return null;};}function patchUpdates(_0x528b6b){return function(_0x3742d0){try{jsonpatch[_0x4923('0x25')](_0x3742d0,_0x528b6b,!![]);}catch(_0x5f4d43){return BPromise[_0x4923('0x26')](_0x5f4d43);}return _0x3742d0['save']();};}function saveUpdates(_0x3de8f5,_0x168bb4){return function(_0x569b36){if(_0x569b36){return _0x569b36[_0x4923('0x27')](_0x3de8f5)[_0x4923('0x28')](function(_0x2eb1b7){return _0x2eb1b7;});}return null;};}function removeEntity(_0x161cf9,_0x3aaede){return function(_0x8a09e7){if(_0x8a09e7){return _0x8a09e7[_0x4923('0x29')]()['then'](function(){_0x161cf9['status'](0xcc)[_0x4923('0x2a')]();});}};}function handleEntityNotFound(_0x36cc38,_0xdb893b){return function(_0x32d508){if(!_0x32d508){_0x36cc38[_0x4923('0x1c')](0x194);}return _0x32d508;};}function handleError(_0x4473a3,_0x13681b){_0x13681b=_0x13681b||0x1f4;return function(_0x2c2a66){logger[_0x4923('0x2b')](_0x2c2a66[_0x4923('0x2c')]);if(_0x2c2a66[_0x4923('0x2d')]){delete _0x2c2a66['name'];}_0x4473a3[_0x4923('0x1d')](_0x13681b)[_0x4923('0x2e')](_0x2c2a66);};}exports[_0x4923('0x2f')]=function(_0x39decd,_0x21c229){var _0x47158c={},_0x158a30={},_0x7a97f3={'count':0x0,'rows':[]};var _0xb88ca4=_[_0x4923('0x30')](db[_0x4923('0x31')][_0x4923('0x32')],function(_0x140ecb){return{'name':_0x140ecb[_0x4923('0x33')],'type':_0x140ecb['type'][_0x4923('0x34')]};});_0x158a30[_0x4923('0x35')]=_[_0x4923('0x30')](_0xb88ca4,_0x4923('0x2d'));_0x158a30[_0x4923('0x36')]=_[_0x4923('0x37')](_0x39decd[_0x4923('0x36')]);_0x158a30[_0x4923('0x38')]=_['intersection'](_0x158a30['model'],_0x158a30[_0x4923('0x36')]);_0x47158c['attributes']=_['intersection'](_0x158a30['model'],qs[_0x4923('0x39')](_0x39decd[_0x4923('0x36')][_0x4923('0x39')]));_0x47158c[_0x4923('0x3a')]=_0x47158c['attributes'][_0x4923('0x3b')]?_0x47158c['attributes']:_0x158a30[_0x4923('0x35')];if(!_0x39decd[_0x4923('0x36')][_0x4923('0x3c')](_0x4923('0x3d'))){_0x47158c[_0x4923('0x20')]=qs['limit'](_0x39decd[_0x4923('0x36')]['limit']);_0x47158c['offset']=qs[_0x4923('0x1f')](_0x39decd[_0x4923('0x36')][_0x4923('0x1f')]);}_0x47158c[_0x4923('0x3e')]=qs[_0x4923('0x3f')](_0x39decd[_0x4923('0x36')][_0x4923('0x3f')]);_0x47158c['where']=qs[_0x4923('0x38')](_['pick'](_0x39decd['query'],_0x158a30[_0x4923('0x38')]),_0xb88ca4);if(_0x39decd[_0x4923('0x36')]['filter']){_0x47158c[_0x4923('0x40')]=_[_0x4923('0x41')](_0x47158c['where'],{'$or':_['map'](_0xb88ca4,function(_0x999016){if(_0x999016[_0x4923('0x42')]!=='VIRTUAL'){var _0x51cb0e={};_0x51cb0e[_0x999016[_0x4923('0x2d')]]={'$like':'%'+_0x39decd[_0x4923('0x36')][_0x4923('0x43')]+'%'};return _0x51cb0e;}})});}_0x47158c=_[_0x4923('0x41')]({},_0x47158c,_0x39decd[_0x4923('0x44')]);var _0x524057={'where':_0x47158c[_0x4923('0x40')]};return db[_0x4923('0x31')]['count'](_0x524057)[_0x4923('0x28')](function(_0x5c419d){_0x7a97f3[_0x4923('0x22')]=_0x5c419d;if(_0x39decd[_0x4923('0x36')]['includeAll']){_0x47158c[_0x4923('0x45')]=[{'all':!![]}];}return db[_0x4923('0x31')][_0x4923('0x46')](_0x47158c);})[_0x4923('0x28')](function(_0x2e25c6){_0x7a97f3[_0x4923('0x47')]=_0x2e25c6;return _0x7a97f3;})['then'](respondWithFilteredResult(_0x21c229,_0x47158c))[_0x4923('0x48')](handleError(_0x21c229,null));};exports[_0x4923('0x49')]=function(_0x53d37e,_0x2a7355){var _0x4de4d0={'raw':![],'where':{'id':_0x53d37e[_0x4923('0x4a')]['id']}},_0x147d0d={};_0x147d0d[_0x4923('0x35')]=_[_0x4923('0x37')](db[_0x4923('0x31')][_0x4923('0x32')]);_0x147d0d[_0x4923('0x36')]=_[_0x4923('0x37')](_0x53d37e['query']);_0x147d0d[_0x4923('0x38')]=_[_0x4923('0x4b')](_0x147d0d[_0x4923('0x35')],_0x147d0d[_0x4923('0x36')]);_0x4de4d0[_0x4923('0x3a')]=_[_0x4923('0x4b')](_0x147d0d[_0x4923('0x35')],qs[_0x4923('0x39')](_0x53d37e[_0x4923('0x36')]['fields']));_0x4de4d0[_0x4923('0x3a')]=_0x4de4d0[_0x4923('0x3a')]['length']?_0x4de4d0[_0x4923('0x3a')]:_0x147d0d[_0x4923('0x35')];if(_0x53d37e[_0x4923('0x36')][_0x4923('0x4c')]){_0x4de4d0[_0x4923('0x45')]=[{'all':!![]}];}_0x4de4d0=_[_0x4923('0x41')]({},_0x4de4d0,_0x53d37e[_0x4923('0x44')]);return db[_0x4923('0x31')][_0x4923('0x4d')](_0x4de4d0)['then'](handleEntityNotFound(_0x2a7355,null))['then'](respondWithResult(_0x2a7355,null))['catch'](handleError(_0x2a7355,null));};exports[_0x4923('0x4e')]=function(_0x58c1c7,_0x239777){return db['FreshdeskAccount'][_0x4923('0x4e')](_0x58c1c7[_0x4923('0x4f')],{})[_0x4923('0x28')](respondWithResult(_0x239777,0xc9))[_0x4923('0x48')](handleError(_0x239777,null));};exports[_0x4923('0x27')]=function(_0x444b99,_0x34ebdf){if(_0x444b99[_0x4923('0x4f')]['id']){delete _0x444b99['body']['id'];}return db[_0x4923('0x31')][_0x4923('0x4d')]({'where':{'id':_0x444b99[_0x4923('0x4a')]['id']}})[_0x4923('0x28')](handleEntityNotFound(_0x34ebdf,null))[_0x4923('0x28')](saveUpdates(_0x444b99[_0x4923('0x4f')],null))[_0x4923('0x28')](respondWithResult(_0x34ebdf,null))[_0x4923('0x48')](handleError(_0x34ebdf,null));};exports['destroy']=function(_0x218f49,_0x282201){return db[_0x4923('0x31')][_0x4923('0x4d')]({'where':{'id':_0x218f49['params']['id']}})[_0x4923('0x28')](handleEntityNotFound(_0x282201,null))[_0x4923('0x28')](removeEntity(_0x282201,null))[_0x4923('0x48')](handleError(_0x282201,null));};exports[_0x4923('0x50')]=function(_0x43718e,_0x2ee03b,_0x1b9e94){var _0x562e38={};var _0x4527da={};var _0x48c2d4;var _0x4b73a6;return db[_0x4923('0x31')][_0x4923('0x51')]({'where':{'id':_0x43718e[_0x4923('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ee03b,null))[_0x4923('0x28')](function(_0x5cd6e4){if(_0x5cd6e4){_0x48c2d4=_0x5cd6e4;_0x4527da[_0x4923('0x35')]=_['keys'](db[_0x4923('0x52')][_0x4923('0x32')]);_0x4527da[_0x4923('0x36')]=_[_0x4923('0x37')](_0x43718e[_0x4923('0x36')]);_0x4527da['filters']=_[_0x4923('0x4b')](_0x4527da[_0x4923('0x35')],_0x4527da[_0x4923('0x36')]);_0x562e38[_0x4923('0x3a')]=_[_0x4923('0x4b')](_0x4527da[_0x4923('0x35')],qs['fields'](_0x43718e[_0x4923('0x36')][_0x4923('0x39')]));_0x562e38[_0x4923('0x3a')]=_0x562e38[_0x4923('0x3a')][_0x4923('0x3b')]?_0x562e38[_0x4923('0x3a')]:_0x4527da[_0x4923('0x35')];_0x562e38['order']=qs[_0x4923('0x3f')](_0x43718e[_0x4923('0x36')][_0x4923('0x3f')]);_0x562e38[_0x4923('0x40')]=qs[_0x4923('0x38')](_[_0x4923('0x53')](_0x43718e[_0x4923('0x36')],_0x4527da['filters']));if(_0x43718e[_0x4923('0x36')][_0x4923('0x43')]){_0x562e38[_0x4923('0x40')]=_['merge'](_0x562e38[_0x4923('0x40')],{'$or':_[_0x4923('0x30')](_0x562e38['attributes'],function(_0x50efb9){var _0x219de2={};_0x219de2[_0x50efb9]={'$like':'%'+_0x43718e[_0x4923('0x36')][_0x4923('0x43')]+'%'};return _0x219de2;})});}_0x562e38=_[_0x4923('0x41')]({},_0x562e38,_0x43718e[_0x4923('0x44')]);return _0x48c2d4[_0x4923('0x50')](_0x562e38);}})[_0x4923('0x28')](function(_0x4d5e14){if(_0x4d5e14){_0x4b73a6=_0x4d5e14['length'];if(!_0x43718e[_0x4923('0x36')][_0x4923('0x3c')](_0x4923('0x3d'))){_0x562e38[_0x4923('0x20')]=qs[_0x4923('0x20')](_0x43718e['query'][_0x4923('0x20')]);_0x562e38[_0x4923('0x1f')]=qs[_0x4923('0x1f')](_0x43718e['query']['offset']);}return _0x48c2d4[_0x4923('0x50')](_0x562e38);}})[_0x4923('0x28')](function(_0x5be67b){if(_0x5be67b){return _0x5be67b?{'count':_0x4b73a6,'rows':_0x5be67b}:null;}})['then'](respondWithResult(_0x2ee03b,null))[_0x4923('0x48')](handleError(_0x2ee03b,null));};exports[_0x4923('0x54')]=function(_0x2a988f,_0x478fc3,_0x2ed5cb){if(_0x2a988f[_0x4923('0x4f')]['id']){delete _0x2a988f['body']['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2a988f[_0x4923('0x4a')]['id']}})['then'](handleEntityNotFound(_0x478fc3,null))[_0x4923('0x28')](function(_0xbfea42){if(_0xbfea42){_0x2a988f[_0x4923('0x4f')][_0x4923('0x55')]=_0xbfea42['id'];_0x2a988f[_0x4923('0x4f')][_0x4923('0x56')]=integrations[_0x4923('0x57')](_0x2a988f['body'][_0x4923('0x58')],_0x2a988f[_0x4923('0x4f')][_0x4923('0x42')]);_0x2a988f['body'][_0x4923('0x59')]=integrations[_0x4923('0x5a')](_0x2a988f['body'][_0x4923('0x58')],_0x2a988f[_0x4923('0x4f')][_0x4923('0x42')]);return db[_0x4923('0x52')]['create'](_0x2a988f[_0x4923('0x4f')],{'include':[{'model':db['FreshdeskField'],'as':_0x4923('0x56')},{'model':db[_0x4923('0x5b')],'as':'Descriptions'}]});}return null;})[_0x4923('0x28')](respondWithResult(_0x478fc3,null))['catch'](handleError(_0x478fc3,null));};exports[_0x4923('0x5c')]=function(_0x352d13,_0x476679,_0x536bb8){var _0x49e04a='';return db[_0x4923('0x31')]['findOne']({'where':{'id':_0x352d13['params']['id']},'attributes':['id',_0x4923('0x5d'),_0x4923('0x5e')]})[_0x4923('0x28')](handleEntityNotFound(_0x476679,null))[_0x4923('0x28')](function(_0x942cc8){if(_0x942cc8){_0x49e04a=_0x942cc8['remoteUri'];var _0x4b691b=_0x49e04a['slice'](-0x1);if(_0x4b691b==='/'){_0x49e04a=_0x49e04a['substring'](0x0,_0x49e04a[_0x4923('0x5f')](_0x4b691b));}return rp({'method':'GET','uri':util['format'](_0x4923('0x60'),_0x49e04a,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x4923('0x61'),new Buffer(util[_0x4923('0x62')](_0x4923('0x63'),_0x942cc8[_0x4923('0x5e')]))[_0x4923('0x64')](_0x4923('0x65')))},'json':!![]});}})[_0x4923('0x28')](function(_0x16a1a5){if(_0x16a1a5){var _0x12c22e=[_0x4923('0x66'),_0x4923('0x67'),_0x4923('0x68'),_0x4923('0x69'),_0x4923('0x1d'),_0x4923('0x6a'),_0x4923('0x6b'),_0x4923('0x6c'),'ticket_type','group',_0x4923('0x6d')];_[_0x4923('0x6e')](_0x16a1a5,function(_0x10e65c){return _0x12c22e[_0x4923('0x6f')](_0x10e65c[_0x4923('0x2d')])||!_0x10e65c[_0x4923('0x70')]&&_0x10e65c[_0x4923('0x42')]!==_0x4923('0x71')&&_0x10e65c['type']!==_0x4923('0x72');});return{'count':_0x16a1a5[_0x4923('0x3b')],'rows':_[_0x4923('0x30')](_0x16a1a5,function(_0x1ab966){return{'id':_0x1ab966[_0x4923('0x2d')],'name':_0x1ab966['label'],'custom':!_0x1ab966['default'],'options':_0x1ab966[_0x4923('0x73')]?_[_0x4923('0x30')](_0x1ab966[_0x4923('0x73')],function(_0x45778b){return{'name':_[_0x4923('0x74')](_0x45778b),'value':_0x45778b};}):[]};})};}})['then'](respondWithResult(_0x476679,null))[_0x4923('0x48')](function(_0x424b64){var _0x3ad1af=_0x352d13[_0x4923('0x36')][_0x4923('0x75')]?0x1f4:_0x424b64[_0x4923('0x76')]||0x1f4;logger[_0x4923('0x2b')](_0x4923('0x77'),_0x4923('0x5c'),_0x3ad1af,JSON[_0x4923('0x78')](_0x424b64));delete _0x424b64[_0x4923('0x2d')];if(_0x3ad1af===0x191){_0x3ad1af=0x190;}_0x476679[_0x4923('0x1d')](_0x3ad1af)[_0x4923('0x2e')](_0x352d13[_0x4923('0x36')][_0x4923('0x75')]?{'message':_0x4923('0x79'),'statusCode':_0x424b64[_0x4923('0x76')]}:_0x424b64);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 8c5b7e6..57bf95d 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ea8=['bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','int_freshdesk_accounts','lodash','util','api','moment'];(function(_0x2ee01a,_0x3d7312){var _0x361c32=function(_0x5d434f){while(--_0x5d434f){_0x2ee01a['push'](_0x2ee01a['shift']());}};_0x361c32(++_0x3d7312);}(_0x3ea8,0x74));var _0x83ea=function(_0x49419d,_0x178785){_0x49419d=_0x49419d-0x0;var _0x124964=_0x3ea8[_0x49419d];return _0x124964;};'use strict';var _=require(_0x83ea('0x0'));var util=require(_0x83ea('0x1'));var logger=require('../../config/logger')(_0x83ea('0x2'));var moment=require(_0x83ea('0x3'));var BPromise=require(_0x83ea('0x4'));var rp=require(_0x83ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83ea('0x6'));var config=require('../../config/environment');var attributes=require(_0x83ea('0x7'));var integrations=require(_0x83ea('0x8'));module['exports']=function(_0x5949c5,_0x42f7ea){return _0x5949c5['define']('FreshdeskAccount',attributes,{'tableName':_0x83ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc406=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define','int_freshdesk_accounts'];(function(_0x2f2d9f,_0x53eae6){var _0x2872d4=function(_0x57a7cf){while(--_0x57a7cf){_0x2f2d9f['push'](_0x2f2d9f['shift']());}};_0x2872d4(++_0x53eae6);}(_0xc406,0x18c));var _0x6c40=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc406[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6c40('0x0'))('api');var moment=require(_0x6c40('0x1'));var BPromise=require('bluebird');var rp=require(_0x6c40('0x2'));var fs=require('fs');var path=require(_0x6c40('0x3'));var rimraf=require(_0x6c40('0x4'));var config=require(_0x6c40('0x5'));var attributes=require(_0x6c40('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3c8d56,_0x5e6473){return _0x3c8d56[_0x6c40('0x7')]('FreshdeskAccount',attributes,{'tableName':_0x6c40('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 229ae5e..ff66669 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6d9=['raw','where','attributes','include','map','model','info','stringify','ShowFreshdeskAccount','find','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options'];(function(_0x30ad27,_0x750e0f){var _0x42242a=function(_0x352f81){while(--_0x352f81){_0x30ad27['push'](_0x30ad27['shift']());}};_0x42242a(++_0x750e0f);}(_0xd6d9,0x16a));var _0x9d6d=function(_0x2e0938,_0x2e20f0){_0x2e0938=_0x2e0938-0x0;var _0x1691d3=_0xd6d9[_0x2e0938];return _0x1691d3;};'use strict';var _=require('lodash');var util=require(_0x9d6d('0x0'));var moment=require(_0x9d6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x9d6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d6d('0x3'))['db'];var utils=require(_0x9d6d('0x4'));var logger=require(_0x9d6d('0x5'))(_0x9d6d('0x6'));var config=require('../../config/environment');var jayson=require(_0x9d6d('0x7'));var client=jayson[_0x9d6d('0x8')][_0x9d6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2713fd,_0x498bdc,_0x4d271c){return new BPromise(function(_0x41e27a,_0x472196){return client[_0x9d6d('0xa')](_0x2713fd,_0x4d271c)[_0x9d6d('0xb')](function(_0x519c85){logger['info'](_0x9d6d('0xc'),_0x498bdc,_0x9d6d('0xd'));logger[_0x9d6d('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x498bdc,_0x9d6d('0xd'),JSON['stringify'](_0x519c85));if(_0x519c85['error']){if(_0x519c85[_0x9d6d('0xf')]['code']===0x1f4){logger[_0x9d6d('0xf')](_0x9d6d('0xc'),_0x498bdc,_0x519c85['error'][_0x9d6d('0x10')]);return _0x472196(_0x519c85[_0x9d6d('0xf')][_0x9d6d('0x10')]);}logger[_0x9d6d('0xf')](_0x9d6d('0xc'),_0x498bdc,_0x519c85[_0x9d6d('0xf')]['message']);return _0x41e27a(_0x519c85[_0x9d6d('0xf')][_0x9d6d('0x10')]);}else{logger['info'](_0x9d6d('0xc'),_0x498bdc,_0x9d6d('0xd'));_0x41e27a(_0x519c85['result']['message']);}})[_0x9d6d('0x11')](function(_0x59eb55){logger[_0x9d6d('0xf')](_0x9d6d('0xc'),_0x498bdc,_0x59eb55);_0x472196(_0x59eb55);});});}exports[_0x9d6d('0x12')]=function(_0x53dac2){var _0x1c12ba=this;return new Promise(function(_0x208d71,_0x57b477){return db[_0x9d6d('0x13')][_0x9d6d('0x14')]({'raw':_0x53dac2[_0x9d6d('0x15')]?_0x53dac2[_0x9d6d('0x15')][_0x9d6d('0x16')]===undefined?!![]:![]:!![],'where':_0x53dac2[_0x9d6d('0x15')]?_0x53dac2['options'][_0x9d6d('0x17')]||null:null,'attributes':_0x53dac2[_0x9d6d('0x15')]?_0x53dac2[_0x9d6d('0x15')][_0x9d6d('0x18')]||null:null,'limit':_0x53dac2['options']?_0x53dac2[_0x9d6d('0x15')]['limit']||null:null,'include':_0x53dac2[_0x9d6d('0x15')]?_0x53dac2[_0x9d6d('0x15')][_0x9d6d('0x19')]?_[_0x9d6d('0x1a')](_0x53dac2['options'][_0x9d6d('0x19')],function(_0x28461c){return{'model':db[_0x28461c['model']],'as':_0x28461c['as'],'attributes':_0x28461c[_0x9d6d('0x18')],'include':_0x28461c[_0x9d6d('0x19')]?_[_0x9d6d('0x1a')](_0x28461c[_0x9d6d('0x19')],function(_0x144245){return{'model':db[_0x144245[_0x9d6d('0x1b')]],'as':_0x144245['as'],'attributes':_0x144245[_0x9d6d('0x18')],'include':_0x144245['include']?_[_0x9d6d('0x1a')](_0x144245['include'],function(_0x1a97ec){return{'model':db[_0x1a97ec['model']],'as':_0x1a97ec['as'],'attributes':_0x1a97ec[_0x9d6d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9d6d('0xb')](function(_0x259467){logger[_0x9d6d('0x1c')](_0x9d6d('0x12'),_0x53dac2);logger[_0x9d6d('0xe')]('GetFreshdeskAccount',_0x53dac2,JSON[_0x9d6d('0x1d')](_0x259467));_0x208d71(_0x259467);})['catch'](function(_0x2eae56){logger[_0x9d6d('0xf')]('GetFreshdeskAccount',_0x2eae56[_0x9d6d('0x10')],_0x53dac2);_0x57b477(_0x1c12ba[_0x9d6d('0xf')](0x1f4,_0x2eae56[_0x9d6d('0x10')]));});});};exports[_0x9d6d('0x1e')]=function(_0x1a8c90){var _0x3e789e=this;return new Promise(function(_0x4d8880,_0x595f63){return db[_0x9d6d('0x13')][_0x9d6d('0x1f')]({'raw':_0x1a8c90[_0x9d6d('0x15')]?_0x1a8c90['options'][_0x9d6d('0x16')]===undefined?!![]:![]:!![],'where':_0x1a8c90[_0x9d6d('0x15')]?_0x1a8c90[_0x9d6d('0x15')][_0x9d6d('0x17')]||null:null,'attributes':_0x1a8c90['options']?_0x1a8c90[_0x9d6d('0x15')][_0x9d6d('0x18')]||null:null,'include':_0x1a8c90[_0x9d6d('0x15')]?_0x1a8c90['options']['include']?_[_0x9d6d('0x1a')](_0x1a8c90[_0x9d6d('0x15')][_0x9d6d('0x19')],function(_0x12f78e){return{'model':db[_0x12f78e[_0x9d6d('0x1b')]],'as':_0x12f78e['as'],'attributes':_0x12f78e[_0x9d6d('0x18')],'include':_0x12f78e[_0x9d6d('0x19')]?_[_0x9d6d('0x1a')](_0x12f78e[_0x9d6d('0x19')],function(_0xdfdcd2){return{'model':db[_0xdfdcd2['model']],'as':_0xdfdcd2['as'],'attributes':_0xdfdcd2['attributes'],'include':_0xdfdcd2[_0x9d6d('0x19')]?_[_0x9d6d('0x1a')](_0xdfdcd2[_0x9d6d('0x19')],function(_0x561dc9){return{'model':db[_0x561dc9[_0x9d6d('0x1b')]],'as':_0x561dc9['as'],'attributes':_0x561dc9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x53be93){logger['info']('ShowFreshdeskAccount',_0x1a8c90);logger[_0x9d6d('0xe')]('ShowFreshdeskAccount',_0x1a8c90,JSON[_0x9d6d('0x1d')](_0x53be93));_0x4d8880(_0x53be93);})[_0x9d6d('0x11')](function(_0x447fed){logger[_0x9d6d('0xf')](_0x9d6d('0x1e'),_0x447fed['message'],_0x1a8c90);_0x595f63(_0x3e789e[_0x9d6d('0xf')](0x1f4,_0x447fed[_0x9d6d('0x10')]));});});}; \ No newline at end of file +var _0xbd50=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','map','include','model','attributes','info','debug','stringify','catch','ShowFreshdeskAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x24e2a3,_0x534875){var _0x3e82f4=function(_0x48a8ee){while(--_0x48a8ee){_0x24e2a3['push'](_0x24e2a3['shift']());}};_0x3e82f4(++_0x534875);}(_0xbd50,0x196));var _0x0bd5=function(_0x2bfc70,_0x35c0f5){_0x2bfc70=_0x2bfc70-0x0;var _0x3af2ad=_0xbd50[_0x2bfc70];return _0x3af2ad;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}exports[_0x0bd5('0x13')]=function(_0x833c14){var _0x23be38=this;return new Promise(function(_0xc58e12,_0x19fe20){return db[_0x0bd5('0x14')][_0x0bd5('0x15')]({'raw':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x17')]===undefined?!![]:![]:!![],'where':_0x833c14[_0x0bd5('0x16')]?_0x833c14['options']['where']||null:null,'attributes':_0x833c14['options']?_0x833c14['options']['attributes']||null:null,'limit':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x18')]||null:null,'include':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')]['include']?_[_0x0bd5('0x19')](_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x1a')],function(_0x5a8139){return{'model':db[_0x5a8139[_0x0bd5('0x1b')]],'as':_0x5a8139['as'],'attributes':_0x5a8139['attributes'],'include':_0x5a8139['include']?_[_0x0bd5('0x19')](_0x5a8139[_0x0bd5('0x1a')],function(_0x184db3){return{'model':db[_0x184db3['model']],'as':_0x184db3['as'],'attributes':_0x184db3[_0x0bd5('0x1c')],'include':_0x184db3['include']?_[_0x0bd5('0x19')](_0x184db3[_0x0bd5('0x1a')],function(_0x18cec3){return{'model':db[_0x18cec3[_0x0bd5('0x1b')]],'as':_0x18cec3['as'],'attributes':_0x18cec3[_0x0bd5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd5('0xb')](function(_0x19bb5e){logger[_0x0bd5('0x1d')](_0x0bd5('0x13'),_0x833c14);logger[_0x0bd5('0x1e')](_0x0bd5('0x13'),_0x833c14,JSON[_0x0bd5('0x1f')](_0x19bb5e));_0xc58e12(_0x19bb5e);})[_0x0bd5('0x20')](function(_0x2704ee){logger['error'](_0x0bd5('0x13'),_0x2704ee[_0x0bd5('0x11')],_0x833c14);_0x19fe20(_0x23be38['error'](0x1f4,_0x2704ee[_0x0bd5('0x11')]));});});};exports[_0x0bd5('0x21')]=function(_0x5d9d20){var _0x11f482=this;return new Promise(function(_0x1b7cf4,_0x28ab82){return db[_0x0bd5('0x14')]['find']({'raw':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x17')]===undefined?!![]:![]:!![],'where':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x22')]||null:null,'attributes':_0x5d9d20['options']?_0x5d9d20[_0x0bd5('0x16')]['attributes']||null:null,'include':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x1a')]?_[_0x0bd5('0x19')](_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x1a')],function(_0x15e380){return{'model':db[_0x15e380[_0x0bd5('0x1b')]],'as':_0x15e380['as'],'attributes':_0x15e380[_0x0bd5('0x1c')],'include':_0x15e380[_0x0bd5('0x1a')]?_[_0x0bd5('0x19')](_0x15e380[_0x0bd5('0x1a')],function(_0x3cfb74){return{'model':db[_0x3cfb74['model']],'as':_0x3cfb74['as'],'attributes':_0x3cfb74[_0x0bd5('0x1c')],'include':_0x3cfb74[_0x0bd5('0x1a')]?_['map'](_0x3cfb74['include'],function(_0x6b93ed){return{'model':db[_0x6b93ed[_0x0bd5('0x1b')]],'as':_0x6b93ed['as'],'attributes':_0x6b93ed[_0x0bd5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd5('0xb')](function(_0x1dd2e1){logger[_0x0bd5('0x1d')](_0x0bd5('0x21'),_0x5d9d20);logger[_0x0bd5('0x1e')](_0x0bd5('0x21'),_0x5d9d20,JSON[_0x0bd5('0x1f')](_0x1dd2e1));_0x1b7cf4(_0x1dd2e1);})[_0x0bd5('0x20')](function(_0x3c6aa5){logger[_0x0bd5('0xf')]('ShowFreshdeskAccount',_0x3c6aa5[_0x0bd5('0x11')],_0x5d9d20);_0x28ab82(_0x11f482['error'](0x1f4,_0x3c6aa5[_0x0bd5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c370268..239cc74 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9917=['post','/:id/tags','setTags','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x48c8a9,_0x1cc168){var _0x42c713=function(_0x5d5948){while(--_0x5d5948){_0x48c8a9['push'](_0x48c8a9['shift']());}};_0x42c713(++_0x1cc168);}(_0x9917,0x1da));var _0x7991=function(_0x2175b8,_0x1cdaba){_0x2175b8=_0x2175b8-0x0;var _0x500c61=_0x9917[_0x2175b8];return _0x500c61;};'use strict';var multer=require(_0x7991('0x0'));var util=require(_0x7991('0x1'));var path=require(_0x7991('0x2'));var timeout=require(_0x7991('0x3'));var express=require(_0x7991('0x4'));var router=express[_0x7991('0x5')]();var fs_extra=require(_0x7991('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7991('0x7'));var config=require(_0x7991('0x8'));var controller=require(_0x7991('0x9'));router[_0x7991('0xa')]('/',auth[_0x7991('0xb')](),controller[_0x7991('0xc')]);router['get'](_0x7991('0xd'),auth[_0x7991('0xb')](),controller[_0x7991('0xe')]);router['get']('/:id/fields',auth[_0x7991('0xb')](),controller[_0x7991('0xf')]);router[_0x7991('0xa')](_0x7991('0x10'),auth[_0x7991('0xb')](),controller[_0x7991('0x11')]);router[_0x7991('0xa')](_0x7991('0x12'),auth[_0x7991('0xb')](),controller[_0x7991('0x13')]);router[_0x7991('0xa')]('/:id/tags',auth[_0x7991('0xb')](),controller['getTags']);router[_0x7991('0x14')]('/',auth[_0x7991('0xb')](),controller['create']);router['post'](_0x7991('0x15'),auth[_0x7991('0xb')](),controller[_0x7991('0x16')]);router['put'](_0x7991('0xd'),auth['isAuthenticated'](),controller[_0x7991('0x17')]);router[_0x7991('0x18')](_0x7991('0xd'),auth[_0x7991('0xb')](),controller['destroy']);module[_0x7991('0x19')]=router; \ No newline at end of file +var _0xe138=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','setTags','update','delete','exports','util','path','Router','fs-extra'];(function(_0x100b33,_0x198689){var _0x449e51=function(_0x58ad6e){while(--_0x58ad6e){_0x100b33['push'](_0x100b33['shift']());}};_0x449e51(++_0x198689);}(_0xe138,0x1b4));var _0x8e13=function(_0x4c2c52,_0x38b31a){_0x4c2c52=_0x4c2c52-0x0;var _0x1123c4=_0xe138[_0x4c2c52];return _0x1123c4;};'use strict';var multer=require('multer');var util=require(_0x8e13('0x0'));var path=require(_0x8e13('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8e13('0x2')]();var fs_extra=require(_0x8e13('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8e13('0x4'));var config=require(_0x8e13('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8e13('0x6')]('/',auth['isAuthenticated'](),controller[_0x8e13('0x7')]);router['get'](_0x8e13('0x8'),auth[_0x8e13('0x9')](),controller[_0x8e13('0xa')]);router[_0x8e13('0x6')](_0x8e13('0xb'),auth[_0x8e13('0x9')](),controller['getFields']);router[_0x8e13('0x6')](_0x8e13('0xc'),auth[_0x8e13('0x9')](),controller[_0x8e13('0xd')]);router[_0x8e13('0x6')](_0x8e13('0xe'),auth[_0x8e13('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x8e13('0xf')]);router[_0x8e13('0x10')]('/',auth['isAuthenticated'](),controller[_0x8e13('0x11')]);router['post']('/:id/tags',auth[_0x8e13('0x9')](),controller[_0x8e13('0x12')]);router['put'](_0x8e13('0x8'),auth[_0x8e13('0x9')](),controller[_0x8e13('0x13')]);router[_0x8e13('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8e13('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index b94ffb0..75d0d86 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87a1=['exports','STRING','sequelize'];(function(_0x512612,_0x56f14f){var _0x58e826=function(_0x18f3ec){while(--_0x18f3ec){_0x512612['push'](_0x512612['shift']());}};_0x58e826(++_0x56f14f);}(_0x87a1,0x1be));var _0x187a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x87a1[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x187a('0x0'));module[_0x187a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x187a('0x2')]}}; \ No newline at end of file +var _0xb5d2=['sequelize','exports','STRING'];(function(_0x2a99f5,_0x50eed0){var _0x818f8f=function(_0x33302c){while(--_0x33302c){_0x2a99f5['push'](_0x2a99f5['shift']());}};_0x818f8f(++_0x50eed0);}(_0xb5d2,0x1b6));var _0x2b5d=function(_0xb61753,_0x566e13){_0xb61753=_0xb61753-0x0;var _0x36a409=_0xb5d2[_0xb61753];return _0x36a409;};'use strict';var Sequelize=require(_0x2b5d('0x0'));module[_0x2b5d('0x1')]={'name':{'type':Sequelize[_0x2b5d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index a785e2c..e48079b 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe267=['options','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','order','sort','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge'];(function(_0x4184cc,_0x558a31){var _0x32bc14=function(_0x4454fb){while(--_0x4454fb){_0x4184cc['push'](_0x4184cc['shift']());}};_0x32bc14(++_0x558a31);}(_0xe267,0x1ac));var _0x7e26=function(_0x55e4e1,_0x352a79){_0x55e4e1=_0x55e4e1-0x0;var _0x1644e8=_0xe267[_0x55e4e1];return _0x1644e8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7e26('0x0'));var jsonpatch=require(_0x7e26('0x1'));var rp=require('request-promise');var moment=require(_0x7e26('0x2'));var BPromise=require(_0x7e26('0x3'));var Mustache=require(_0x7e26('0x4'));var util=require(_0x7e26('0x5'));var path=require('path');var sox=require(_0x7e26('0x6'));var csv=require(_0x7e26('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e26('0x8'));var squel=require('squel');var crypto=require(_0x7e26('0x9'));var jsforce=require(_0x7e26('0xa'));var deskjs=require(_0x7e26('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7e26('0xc'));var Papa=require(_0x7e26('0xd'));var Redis=require(_0x7e26('0xe'));var authService=require(_0x7e26('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7e26('0x10'));var hardwareService=require(_0x7e26('0x11'));var logger=require('../../config/logger')(_0x7e26('0x12'));var utils=require(_0x7e26('0x13'));var config=require(_0x7e26('0x14'));var licenseUtil=require(_0x7e26('0x15'));var db=require(_0x7e26('0x16'))['db'];function respondWithStatusCode(_0xda476e,_0xa93295){_0xa93295=_0xa93295||0xcc;return function(_0x2acdea){if(_0x2acdea){return _0xda476e[_0x7e26('0x17')](_0xa93295);}return _0xda476e['status'](_0xa93295)[_0x7e26('0x18')]();};}function respondWithResult(_0x1a314a,_0x48d64b){_0x48d64b=_0x48d64b||0xc8;return function(_0x454fcc){if(_0x454fcc){return _0x1a314a[_0x7e26('0x19')](_0x48d64b)[_0x7e26('0x1a')](_0x454fcc);}};}function respondWithFilteredResult(_0x46d7e0,_0x1bc5ff){return function(_0x40c91e){if(_0x40c91e){var _0x3d3b79=typeof _0x1bc5ff[_0x7e26('0x1b')]===_0x7e26('0x1c')&&typeof _0x1bc5ff['limit']===_0x7e26('0x1c');var _0x23337c=_0x40c91e[_0x7e26('0x1d')];var _0x3683e6=_0x3d3b79?0x0:_0x1bc5ff[_0x7e26('0x1b')];var _0xc4d771=_0x3d3b79?_0x40c91e['count']:_0x1bc5ff['offset']+_0x1bc5ff[_0x7e26('0x1e')];var _0x814615;if(_0xc4d771>=_0x23337c){_0xc4d771=_0x23337c;_0x814615=0xc8;}else{_0x814615=0xce;}_0x46d7e0[_0x7e26('0x19')](_0x814615);return _0x46d7e0['set'](_0x7e26('0x1f'),_0x3683e6+'-'+_0xc4d771+'/'+_0x23337c)[_0x7e26('0x1a')](_0x40c91e);}return null;};}function patchUpdates(_0xdda445){return function(_0x4ae829){try{jsonpatch['apply'](_0x4ae829,_0xdda445,!![]);}catch(_0x4e64e6){return BPromise[_0x7e26('0x20')](_0x4e64e6);}return _0x4ae829[_0x7e26('0x21')]();};}function saveUpdates(_0x3045ed,_0x1bc435){return function(_0x41d8ce){if(_0x41d8ce){return _0x41d8ce[_0x7e26('0x22')](_0x3045ed)['then'](function(_0x4c8126){return _0x4c8126;});}return null;};}function removeEntity(_0xf2f9f8,_0x4f99e2){return function(_0x1a6952){if(_0x1a6952){return _0x1a6952['destroy']()['then'](function(){_0xf2f9f8['status'](0xcc)[_0x7e26('0x18')]();});}};}function handleEntityNotFound(_0x2ac6ea,_0x32dc7f){return function(_0x4c7281){if(!_0x4c7281){_0x2ac6ea[_0x7e26('0x17')](0x194);}return _0x4c7281;};}function handleError(_0x3c93aa,_0x509392){_0x509392=_0x509392||0x1f4;return function(_0x4701dc){logger[_0x7e26('0x23')](_0x4701dc[_0x7e26('0x24')]);if(_0x4701dc[_0x7e26('0x25')]){delete _0x4701dc[_0x7e26('0x25')];}_0x3c93aa[_0x7e26('0x19')](_0x509392)['send'](_0x4701dc);};}exports[_0x7e26('0x26')]=function(_0x38e2f2,_0x3bfa24){var _0x173b12={},_0x3cfdfe={},_0x5618b8={'count':0x0,'rows':[]};var _0x115051=_[_0x7e26('0x27')](db[_0x7e26('0x28')][_0x7e26('0x29')],function(_0x3e6320){return{'name':_0x3e6320['fieldName'],'type':_0x3e6320[_0x7e26('0x2a')][_0x7e26('0x2b')]};});_0x3cfdfe['model']=_[_0x7e26('0x27')](_0x115051,_0x7e26('0x25'));_0x3cfdfe[_0x7e26('0x2c')]=_[_0x7e26('0x2d')](_0x38e2f2[_0x7e26('0x2c')]);_0x3cfdfe[_0x7e26('0x2e')]=_[_0x7e26('0x2f')](_0x3cfdfe[_0x7e26('0x30')],_0x3cfdfe[_0x7e26('0x2c')]);_0x173b12[_0x7e26('0x31')]=_['intersection'](_0x3cfdfe[_0x7e26('0x30')],qs['fields'](_0x38e2f2[_0x7e26('0x2c')][_0x7e26('0x32')]));_0x173b12[_0x7e26('0x31')]=_0x173b12[_0x7e26('0x31')][_0x7e26('0x33')]?_0x173b12['attributes']:_0x3cfdfe[_0x7e26('0x30')];if(!_0x38e2f2[_0x7e26('0x2c')][_0x7e26('0x34')](_0x7e26('0x35'))){_0x173b12[_0x7e26('0x1e')]=qs[_0x7e26('0x1e')](_0x38e2f2['query'][_0x7e26('0x1e')]);_0x173b12['offset']=qs['offset'](_0x38e2f2['query'][_0x7e26('0x1b')]);}_0x173b12['order']=qs['sort'](_0x38e2f2[_0x7e26('0x2c')]['sort']);_0x173b12[_0x7e26('0x36')]=qs[_0x7e26('0x2e')](_[_0x7e26('0x37')](_0x38e2f2[_0x7e26('0x2c')],_0x3cfdfe[_0x7e26('0x2e')]),_0x115051);if(_0x38e2f2[_0x7e26('0x2c')][_0x7e26('0x38')]){_0x173b12[_0x7e26('0x36')]=_[_0x7e26('0x39')](_0x173b12[_0x7e26('0x36')],{'$or':_['map'](_0x115051,function(_0x514ec2){if(_0x514ec2[_0x7e26('0x2a')]!=='VIRTUAL'){var _0x490c35={};_0x490c35[_0x514ec2[_0x7e26('0x25')]]={'$like':'%'+_0x38e2f2[_0x7e26('0x2c')]['filter']+'%'};return _0x490c35;}})});}_0x173b12=_['merge']({},_0x173b12,_0x38e2f2[_0x7e26('0x3a')]);var _0x4cc97e={'where':_0x173b12[_0x7e26('0x36')]};return db[_0x7e26('0x28')][_0x7e26('0x1d')](_0x4cc97e)[_0x7e26('0x3b')](function(_0x3ad628){_0x5618b8['count']=_0x3ad628;if(_0x38e2f2[_0x7e26('0x2c')][_0x7e26('0x3c')]){_0x173b12[_0x7e26('0x3d')]=[{'all':!![]}];}return db[_0x7e26('0x28')][_0x7e26('0x3e')](_0x173b12);})[_0x7e26('0x3b')](function(_0x3a21f5){_0x5618b8[_0x7e26('0x3f')]=_0x3a21f5;return _0x5618b8;})[_0x7e26('0x3b')](respondWithFilteredResult(_0x3bfa24,_0x173b12))[_0x7e26('0x40')](handleError(_0x3bfa24,null));};exports[_0x7e26('0x41')]=function(_0xc649e,_0x431895){var _0x53cefe={'raw':![],'where':{'id':_0xc649e['params']['id']}},_0x2e1c3a={};_0x2e1c3a[_0x7e26('0x30')]=_[_0x7e26('0x2d')](db[_0x7e26('0x28')][_0x7e26('0x29')]);_0x2e1c3a['query']=_[_0x7e26('0x2d')](_0xc649e[_0x7e26('0x2c')]);_0x2e1c3a['filters']=_['intersection'](_0x2e1c3a[_0x7e26('0x30')],_0x2e1c3a[_0x7e26('0x2c')]);_0x53cefe[_0x7e26('0x31')]=_['intersection'](_0x2e1c3a[_0x7e26('0x30')],qs[_0x7e26('0x32')](_0xc649e['query'][_0x7e26('0x32')]));_0x53cefe[_0x7e26('0x31')]=_0x53cefe[_0x7e26('0x31')][_0x7e26('0x33')]?_0x53cefe[_0x7e26('0x31')]:_0x2e1c3a[_0x7e26('0x30')];if(_0xc649e[_0x7e26('0x2c')][_0x7e26('0x3c')]){_0x53cefe[_0x7e26('0x3d')]=[{'all':!![]}];}_0x53cefe=_[_0x7e26('0x39')]({},_0x53cefe,_0xc649e[_0x7e26('0x3a')]);return db[_0x7e26('0x28')][_0x7e26('0x42')](_0x53cefe)[_0x7e26('0x3b')](handleEntityNotFound(_0x431895,null))[_0x7e26('0x3b')](respondWithResult(_0x431895,null))['catch'](handleError(_0x431895,null));};exports[_0x7e26('0x43')]=function(_0x173ef7,_0x4e2f45){return db[_0x7e26('0x28')][_0x7e26('0x43')](_0x173ef7['body'],{})['then'](respondWithResult(_0x4e2f45,0xc9))[_0x7e26('0x40')](handleError(_0x4e2f45,null));};exports[_0x7e26('0x22')]=function(_0x13e0dc,_0x4036c2){if(_0x13e0dc[_0x7e26('0x44')]['id']){delete _0x13e0dc[_0x7e26('0x44')]['id'];}return db[_0x7e26('0x28')]['find']({'where':{'id':_0x13e0dc[_0x7e26('0x45')]['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x4036c2,null))[_0x7e26('0x3b')](saveUpdates(_0x13e0dc[_0x7e26('0x44')],null))[_0x7e26('0x3b')](respondWithResult(_0x4036c2,null))['catch'](handleError(_0x4036c2,null));};exports['destroy']=function(_0x214290,_0x271ef0){return db['FreshdeskConfiguration'][_0x7e26('0x42')]({'where':{'id':_0x214290['params']['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x271ef0,null))['then'](removeEntity(_0x271ef0,null))[_0x7e26('0x40')](handleError(_0x271ef0,null));};exports[_0x7e26('0x46')]=function(_0x10d18f,_0x1ac64f,_0x2ed867){var _0x28d415={};var _0x267a0d={};var _0x55d7fa;var _0x718e9e;return db[_0x7e26('0x28')][_0x7e26('0x47')]({'where':{'id':_0x10d18f[_0x7e26('0x45')]['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x1ac64f,null))[_0x7e26('0x3b')](function(_0x16d1b1){if(_0x16d1b1){_0x55d7fa=_0x16d1b1;_0x267a0d[_0x7e26('0x30')]=_[_0x7e26('0x2d')](db['FreshdeskField'][_0x7e26('0x29')]);_0x267a0d[_0x7e26('0x2c')]=_[_0x7e26('0x2d')](_0x10d18f[_0x7e26('0x2c')]);_0x267a0d[_0x7e26('0x2e')]=_['intersection'](_0x267a0d[_0x7e26('0x30')],_0x267a0d['query']);_0x28d415[_0x7e26('0x31')]=_['intersection'](_0x267a0d[_0x7e26('0x30')],qs[_0x7e26('0x32')](_0x10d18f[_0x7e26('0x2c')][_0x7e26('0x32')]));_0x28d415[_0x7e26('0x31')]=_0x28d415[_0x7e26('0x31')][_0x7e26('0x33')]?_0x28d415[_0x7e26('0x31')]:_0x267a0d[_0x7e26('0x30')];_0x28d415[_0x7e26('0x48')]=qs[_0x7e26('0x49')](_0x10d18f[_0x7e26('0x2c')][_0x7e26('0x49')]);_0x28d415['where']=qs[_0x7e26('0x2e')](_['pick'](_0x10d18f['query'],_0x267a0d[_0x7e26('0x2e')]));if(_0x10d18f[_0x7e26('0x2c')][_0x7e26('0x38')]){_0x28d415[_0x7e26('0x36')]=_['merge'](_0x28d415['where'],{'$or':_['map'](_0x28d415['attributes'],function(_0x15e40f){var _0x47e378={};_0x47e378[_0x15e40f]={'$like':'%'+_0x10d18f[_0x7e26('0x2c')][_0x7e26('0x38')]+'%'};return _0x47e378;})});}_0x28d415=_['merge']({},_0x28d415,_0x10d18f[_0x7e26('0x3a')]);return _0x55d7fa[_0x7e26('0x46')](_0x28d415);}})[_0x7e26('0x3b')](function(_0x501ca7){if(_0x501ca7){_0x718e9e=_0x501ca7[_0x7e26('0x33')];if(!_0x10d18f['query'][_0x7e26('0x34')]('nolimit')){_0x28d415['limit']=qs[_0x7e26('0x1e')](_0x10d18f[_0x7e26('0x2c')][_0x7e26('0x1e')]);_0x28d415[_0x7e26('0x1b')]=qs[_0x7e26('0x1b')](_0x10d18f['query']['offset']);}return _0x55d7fa['getFields'](_0x28d415);}})[_0x7e26('0x3b')](function(_0x5273ca){if(_0x5273ca){return _0x5273ca?{'count':_0x718e9e,'rows':_0x5273ca}:null;}})[_0x7e26('0x3b')](respondWithResult(_0x1ac64f,null))[_0x7e26('0x40')](handleError(_0x1ac64f,null));};exports['getSubjects']=function(_0x1b612b,_0x138aec,_0x478a47){var _0x31ebfc={};var _0x2c19e6={};var _0x338f07;var _0x34b177;return db['FreshdeskConfiguration'][_0x7e26('0x47')]({'where':{'id':_0x1b612b[_0x7e26('0x45')]['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x138aec,null))['then'](function(_0x10ccd6){if(_0x10ccd6){_0x338f07=_0x10ccd6;_0x2c19e6['model']=_[_0x7e26('0x2d')](db[_0x7e26('0x4a')]['rawAttributes']);_0x2c19e6[_0x7e26('0x2c')]=_[_0x7e26('0x2d')](_0x1b612b['query']);_0x2c19e6[_0x7e26('0x2e')]=_[_0x7e26('0x2f')](_0x2c19e6[_0x7e26('0x30')],_0x2c19e6['query']);_0x31ebfc['attributes']=_[_0x7e26('0x2f')](_0x2c19e6[_0x7e26('0x30')],qs[_0x7e26('0x32')](_0x1b612b[_0x7e26('0x2c')][_0x7e26('0x32')]));_0x31ebfc['attributes']=_0x31ebfc[_0x7e26('0x31')][_0x7e26('0x33')]?_0x31ebfc[_0x7e26('0x31')]:_0x2c19e6['model'];_0x31ebfc['order']=qs[_0x7e26('0x49')](_0x1b612b[_0x7e26('0x2c')][_0x7e26('0x49')]);_0x31ebfc['where']=qs[_0x7e26('0x2e')](_[_0x7e26('0x37')](_0x1b612b[_0x7e26('0x2c')],_0x2c19e6[_0x7e26('0x2e')]));if(_0x1b612b[_0x7e26('0x2c')]['filter']){_0x31ebfc['where']=_[_0x7e26('0x39')](_0x31ebfc['where'],{'$or':_[_0x7e26('0x27')](_0x31ebfc['attributes'],function(_0x52b1fe){var _0x28152d={};_0x28152d[_0x52b1fe]={'$like':'%'+_0x1b612b['query']['filter']+'%'};return _0x28152d;})});}_0x31ebfc=_['merge']({},_0x31ebfc,_0x1b612b[_0x7e26('0x3a')]);return _0x338f07[_0x7e26('0x4b')](_0x31ebfc);}})[_0x7e26('0x3b')](function(_0x2dfbb8){if(_0x2dfbb8){_0x34b177=_0x2dfbb8[_0x7e26('0x33')];if(!_0x1b612b['query'][_0x7e26('0x34')](_0x7e26('0x35'))){_0x31ebfc[_0x7e26('0x1e')]=qs['limit'](_0x1b612b[_0x7e26('0x2c')][_0x7e26('0x1e')]);_0x31ebfc['offset']=qs[_0x7e26('0x1b')](_0x1b612b[_0x7e26('0x2c')][_0x7e26('0x1b')]);}return _0x338f07[_0x7e26('0x4b')](_0x31ebfc);}})[_0x7e26('0x3b')](function(_0x3190a2){if(_0x3190a2){return _0x3190a2?{'count':_0x34b177,'rows':_0x3190a2}:null;}})['then'](respondWithResult(_0x138aec,null))[_0x7e26('0x40')](handleError(_0x138aec,null));};exports[_0x7e26('0x4c')]=function(_0x37e6b3,_0x10c6a9,_0x59e3be){var _0x52ee56={};var _0x254437={};var _0x3c6087;var _0x329712;return db[_0x7e26('0x28')][_0x7e26('0x47')]({'where':{'id':_0x37e6b3[_0x7e26('0x45')]['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x10c6a9,null))[_0x7e26('0x3b')](function(_0x36302c){if(_0x36302c){_0x3c6087=_0x36302c;_0x254437[_0x7e26('0x30')]=_[_0x7e26('0x2d')](db[_0x7e26('0x4a')]['rawAttributes']);_0x254437[_0x7e26('0x2c')]=_[_0x7e26('0x2d')](_0x37e6b3[_0x7e26('0x2c')]);_0x254437['filters']=_['intersection'](_0x254437['model'],_0x254437[_0x7e26('0x2c')]);_0x52ee56[_0x7e26('0x31')]=_[_0x7e26('0x2f')](_0x254437[_0x7e26('0x30')],qs[_0x7e26('0x32')](_0x37e6b3[_0x7e26('0x2c')]['fields']));_0x52ee56[_0x7e26('0x31')]=_0x52ee56['attributes'][_0x7e26('0x33')]?_0x52ee56[_0x7e26('0x31')]:_0x254437[_0x7e26('0x30')];_0x52ee56[_0x7e26('0x48')]=qs[_0x7e26('0x49')](_0x37e6b3['query'][_0x7e26('0x49')]);_0x52ee56[_0x7e26('0x36')]=qs[_0x7e26('0x2e')](_[_0x7e26('0x37')](_0x37e6b3[_0x7e26('0x2c')],_0x254437[_0x7e26('0x2e')]));if(_0x37e6b3[_0x7e26('0x2c')][_0x7e26('0x38')]){_0x52ee56['where']=_[_0x7e26('0x39')](_0x52ee56[_0x7e26('0x36')],{'$or':_[_0x7e26('0x27')](_0x52ee56[_0x7e26('0x31')],function(_0x231bdb){var _0x1f61a6={};_0x1f61a6[_0x231bdb]={'$like':'%'+_0x37e6b3[_0x7e26('0x2c')][_0x7e26('0x38')]+'%'};return _0x1f61a6;})});}_0x52ee56=_['merge']({},_0x52ee56,_0x37e6b3[_0x7e26('0x3a')]);return _0x3c6087['getDescriptions'](_0x52ee56);}})['then'](function(_0xab5c62){if(_0xab5c62){_0x329712=_0xab5c62[_0x7e26('0x33')];if(!_0x37e6b3[_0x7e26('0x2c')][_0x7e26('0x34')](_0x7e26('0x35'))){_0x52ee56[_0x7e26('0x1e')]=qs[_0x7e26('0x1e')](_0x37e6b3[_0x7e26('0x2c')][_0x7e26('0x1e')]);_0x52ee56[_0x7e26('0x1b')]=qs['offset'](_0x37e6b3[_0x7e26('0x2c')][_0x7e26('0x1b')]);}return _0x3c6087[_0x7e26('0x4c')](_0x52ee56);}})['then'](function(_0x164c5b){if(_0x164c5b){return _0x164c5b?{'count':_0x329712,'rows':_0x164c5b}:null;}})['then'](respondWithResult(_0x10c6a9,null))[_0x7e26('0x40')](handleError(_0x10c6a9,null));};exports[_0x7e26('0x4d')]=function(_0x1b8690,_0x9c3e44,_0x3f53c8){var _0x57c3d9={};var _0x1dd1a5={};var _0x5b92ef;var _0x2ce8e6;return db[_0x7e26('0x28')][_0x7e26('0x47')]({'where':{'id':_0x1b8690[_0x7e26('0x45')]['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x9c3e44,null))[_0x7e26('0x3b')](function(_0x2d2347){if(_0x2d2347){_0x5b92ef=_0x2d2347;_0x1dd1a5['model']=_[_0x7e26('0x2d')](db[_0x7e26('0x4e')]['rawAttributes']);_0x1dd1a5[_0x7e26('0x2c')]=_[_0x7e26('0x2d')](_0x1b8690[_0x7e26('0x2c')]);_0x1dd1a5['filters']=_[_0x7e26('0x2f')](_0x1dd1a5['model'],_0x1dd1a5[_0x7e26('0x2c')]);_0x57c3d9['attributes']=_[_0x7e26('0x2f')](_0x1dd1a5[_0x7e26('0x30')],qs[_0x7e26('0x32')](_0x1b8690[_0x7e26('0x2c')]['fields']));_0x57c3d9['attributes']=_0x57c3d9[_0x7e26('0x31')][_0x7e26('0x33')]?_0x57c3d9[_0x7e26('0x31')]:_0x1dd1a5[_0x7e26('0x30')];_0x57c3d9[_0x7e26('0x48')]=qs[_0x7e26('0x49')](_0x1b8690[_0x7e26('0x2c')][_0x7e26('0x49')]);_0x57c3d9['where']=qs[_0x7e26('0x2e')](_[_0x7e26('0x37')](_0x1b8690[_0x7e26('0x2c')],_0x1dd1a5[_0x7e26('0x2e')]));if(_0x1b8690['query'][_0x7e26('0x38')]){_0x57c3d9[_0x7e26('0x36')]=_[_0x7e26('0x39')](_0x57c3d9['where'],{'$or':_['map'](_0x57c3d9['attributes'],function(_0x48ef45){var _0x37c137={};_0x37c137[_0x48ef45]={'$like':'%'+_0x1b8690['query'][_0x7e26('0x38')]+'%'};return _0x37c137;})});}_0x57c3d9=_['merge']({},_0x57c3d9,_0x1b8690['options']);return _0x5b92ef[_0x7e26('0x4d')](_0x57c3d9);}})['then'](function(_0x3d728b){if(_0x3d728b){_0x2ce8e6=_0x3d728b[_0x7e26('0x33')];if(!_0x1b8690['query']['hasOwnProperty']('nolimit')){_0x57c3d9['limit']=qs[_0x7e26('0x1e')](_0x1b8690['query'][_0x7e26('0x1e')]);_0x57c3d9['offset']=qs[_0x7e26('0x1b')](_0x1b8690[_0x7e26('0x2c')][_0x7e26('0x1b')]);}return _0x5b92ef[_0x7e26('0x4d')](_0x57c3d9);}})[_0x7e26('0x3b')](function(_0x2db75d){if(_0x2db75d){return _0x2db75d?{'count':_0x2ce8e6,'rows':_0x2db75d}:null;}})[_0x7e26('0x3b')](respondWithResult(_0x9c3e44,null))[_0x7e26('0x40')](handleError(_0x9c3e44,null));};exports[_0x7e26('0x4f')]=function(_0x4aec16,_0x14159b,_0x91f569){if(_0x4aec16[_0x7e26('0x44')]['id']){delete _0x4aec16[_0x7e26('0x44')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4aec16['params']['id']}})[_0x7e26('0x3b')](handleEntityNotFound(_0x14159b,null))[_0x7e26('0x3b')](function(_0x4bd8f9){if(_0x4bd8f9){return _0x4bd8f9[_0x7e26('0x4f')](_0x4aec16[_0x7e26('0x44')][_0x7e26('0x50')]||[]);}return null;})[_0x7e26('0x3b')](respondWithResult(_0x14159b,null))[_0x7e26('0x40')](handleError(_0x14159b,null));}; \ No newline at end of file +var _0xab5b=['findAll','catch','show','intersection','find','create','body','destroy','getFields','findOne','params','FreshdeskField','pick','merge','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','options','include'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xab5b,0xb8));var _0xbab5=function(_0x1f7459,_0x13631f){_0x1f7459=_0x1f7459-0x0;var _0xc77774=_0xab5b[_0x1f7459];return _0xc77774;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require(_0xbab5('0x2'));var jsonpatch=require(_0xbab5('0x3'));var rp=require(_0xbab5('0x4'));var moment=require('moment');var BPromise=require(_0xbab5('0x5'));var Mustache=require(_0xbab5('0x6'));var util=require(_0xbab5('0x7'));var path=require(_0xbab5('0x8'));var sox=require(_0xbab5('0x9'));var csv=require(_0xbab5('0xa'));var ejs=require(_0xbab5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbab5('0xc'));var crypto=require('crypto');var jsforce=require(_0xbab5('0xd'));var deskjs=require(_0xbab5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbab5('0xf'));var Papa=require('papaparse');var Redis=require(_0xbab5('0x10'));var authService=require(_0xbab5('0x11'));var qs=require(_0xbab5('0x12'));var as=require(_0xbab5('0x13'));var hardwareService=require(_0xbab5('0x14'));var logger=require(_0xbab5('0x15'))('api');var utils=require(_0xbab5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbab5('0x17'));var db=require(_0xbab5('0x18'))['db'];function respondWithStatusCode(_0x40e7f0,_0x156684){_0x156684=_0x156684||0xcc;return function(_0x2cd638){if(_0x2cd638){return _0x40e7f0['sendStatus'](_0x156684);}return _0x40e7f0[_0xbab5('0x19')](_0x156684)[_0xbab5('0x1a')]();};}function respondWithResult(_0x5c56bd,_0x33da09){_0x33da09=_0x33da09||0xc8;return function(_0x2dd719){if(_0x2dd719){return _0x5c56bd[_0xbab5('0x19')](_0x33da09)[_0xbab5('0x1b')](_0x2dd719);}};}function respondWithFilteredResult(_0x2bcb42,_0x538b39){return function(_0x26f8b9){if(_0x26f8b9){var _0x5ea2ea=typeof _0x538b39[_0xbab5('0x1c')]===_0xbab5('0x1d')&&typeof _0x538b39[_0xbab5('0x1e')]===_0xbab5('0x1d');var _0x8eefdf=_0x26f8b9[_0xbab5('0x1f')];var _0x571840=_0x5ea2ea?0x0:_0x538b39['offset'];var _0x2bbc1d=_0x5ea2ea?_0x26f8b9[_0xbab5('0x1f')]:_0x538b39['offset']+_0x538b39[_0xbab5('0x1e')];var _0x2c8214;if(_0x2bbc1d>=_0x8eefdf){_0x2bbc1d=_0x8eefdf;_0x2c8214=0xc8;}else{_0x2c8214=0xce;}_0x2bcb42['status'](_0x2c8214);return _0x2bcb42[_0xbab5('0x20')](_0xbab5('0x21'),_0x571840+'-'+_0x2bbc1d+'/'+_0x8eefdf)['json'](_0x26f8b9);}return null;};}function patchUpdates(_0x99ac81){return function(_0x1da272){try{jsonpatch[_0xbab5('0x22')](_0x1da272,_0x99ac81,!![]);}catch(_0x46bc90){return BPromise[_0xbab5('0x23')](_0x46bc90);}return _0x1da272['save']();};}function saveUpdates(_0x771438,_0x8a357b){return function(_0x2d9f42){if(_0x2d9f42){return _0x2d9f42[_0xbab5('0x24')](_0x771438)[_0xbab5('0x25')](function(_0x35060f){return _0x35060f;});}return null;};}function removeEntity(_0x5eb291,_0x2b27a3){return function(_0x2dfc0e){if(_0x2dfc0e){return _0x2dfc0e['destroy']()[_0xbab5('0x25')](function(){_0x5eb291[_0xbab5('0x19')](0xcc)[_0xbab5('0x1a')]();});}};}function handleEntityNotFound(_0xcf5925,_0x19827a){return function(_0x54ccae){if(!_0x54ccae){_0xcf5925['sendStatus'](0x194);}return _0x54ccae;};}function handleError(_0x55fb2f,_0xcfd5de){_0xcfd5de=_0xcfd5de||0x1f4;return function(_0x23d47e){logger[_0xbab5('0x26')](_0x23d47e[_0xbab5('0x27')]);if(_0x23d47e[_0xbab5('0x28')]){delete _0x23d47e[_0xbab5('0x28')];}_0x55fb2f[_0xbab5('0x19')](_0xcfd5de)[_0xbab5('0x29')](_0x23d47e);};}exports[_0xbab5('0x2a')]=function(_0x281cda,_0x1d8b9c){var _0x1e93fc={},_0xb35673={},_0x5c395e={'count':0x0,'rows':[]};var _0x2b0e89=_[_0xbab5('0x2b')](db[_0xbab5('0x2c')][_0xbab5('0x2d')],function(_0x4dcfba){return{'name':_0x4dcfba['fieldName'],'type':_0x4dcfba[_0xbab5('0x2e')][_0xbab5('0x2f')]};});_0xb35673[_0xbab5('0x30')]=_[_0xbab5('0x2b')](_0x2b0e89,_0xbab5('0x28'));_0xb35673[_0xbab5('0x31')]=_[_0xbab5('0x32')](_0x281cda[_0xbab5('0x31')]);_0xb35673[_0xbab5('0x33')]=_['intersection'](_0xb35673[_0xbab5('0x30')],_0xb35673[_0xbab5('0x31')]);_0x1e93fc[_0xbab5('0x34')]=_['intersection'](_0xb35673['model'],qs[_0xbab5('0x35')](_0x281cda[_0xbab5('0x31')][_0xbab5('0x35')]));_0x1e93fc[_0xbab5('0x34')]=_0x1e93fc[_0xbab5('0x34')][_0xbab5('0x36')]?_0x1e93fc['attributes']:_0xb35673[_0xbab5('0x30')];if(!_0x281cda[_0xbab5('0x31')][_0xbab5('0x37')]('nolimit')){_0x1e93fc['limit']=qs[_0xbab5('0x1e')](_0x281cda['query'][_0xbab5('0x1e')]);_0x1e93fc[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x281cda[_0xbab5('0x31')]['offset']);}_0x1e93fc[_0xbab5('0x38')]=qs[_0xbab5('0x39')](_0x281cda[_0xbab5('0x31')][_0xbab5('0x39')]);_0x1e93fc[_0xbab5('0x3a')]=qs[_0xbab5('0x33')](_['pick'](_0x281cda[_0xbab5('0x31')],_0xb35673[_0xbab5('0x33')]),_0x2b0e89);if(_0x281cda[_0xbab5('0x31')]['filter']){_0x1e93fc[_0xbab5('0x3a')]=_['merge'](_0x1e93fc[_0xbab5('0x3a')],{'$or':_['map'](_0x2b0e89,function(_0x564c0a){if(_0x564c0a['type']!=='VIRTUAL'){var _0x50f297={};_0x50f297[_0x564c0a['name']]={'$like':'%'+_0x281cda[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0x50f297;}})});}_0x1e93fc=_['merge']({},_0x1e93fc,_0x281cda[_0xbab5('0x3c')]);var _0x37704a={'where':_0x1e93fc[_0xbab5('0x3a')]};return db[_0xbab5('0x2c')][_0xbab5('0x1f')](_0x37704a)[_0xbab5('0x25')](function(_0x226987){_0x5c395e[_0xbab5('0x1f')]=_0x226987;if(_0x281cda[_0xbab5('0x31')]['includeAll']){_0x1e93fc[_0xbab5('0x3d')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xbab5('0x3e')](_0x1e93fc);})[_0xbab5('0x25')](function(_0x270981){_0x5c395e['rows']=_0x270981;return _0x5c395e;})['then'](respondWithFilteredResult(_0x1d8b9c,_0x1e93fc))[_0xbab5('0x3f')](handleError(_0x1d8b9c,null));};exports[_0xbab5('0x40')]=function(_0x12366a,_0x1f4b7a){var _0x36b667={'raw':![],'where':{'id':_0x12366a['params']['id']}},_0x6d1db3={};_0x6d1db3[_0xbab5('0x30')]=_[_0xbab5('0x32')](db[_0xbab5('0x2c')][_0xbab5('0x2d')]);_0x6d1db3[_0xbab5('0x31')]=_[_0xbab5('0x32')](_0x12366a['query']);_0x6d1db3['filters']=_[_0xbab5('0x41')](_0x6d1db3[_0xbab5('0x30')],_0x6d1db3[_0xbab5('0x31')]);_0x36b667[_0xbab5('0x34')]=_[_0xbab5('0x41')](_0x6d1db3[_0xbab5('0x30')],qs[_0xbab5('0x35')](_0x12366a[_0xbab5('0x31')]['fields']));_0x36b667[_0xbab5('0x34')]=_0x36b667[_0xbab5('0x34')][_0xbab5('0x36')]?_0x36b667['attributes']:_0x6d1db3['model'];if(_0x12366a[_0xbab5('0x31')]['includeAll']){_0x36b667[_0xbab5('0x3d')]=[{'all':!![]}];}_0x36b667=_['merge']({},_0x36b667,_0x12366a['options']);return db[_0xbab5('0x2c')][_0xbab5('0x42')](_0x36b667)['then'](handleEntityNotFound(_0x1f4b7a,null))[_0xbab5('0x25')](respondWithResult(_0x1f4b7a,null))['catch'](handleError(_0x1f4b7a,null));};exports[_0xbab5('0x43')]=function(_0x5ca8f0,_0x3ebaae){return db[_0xbab5('0x2c')][_0xbab5('0x43')](_0x5ca8f0['body'],{})[_0xbab5('0x25')](respondWithResult(_0x3ebaae,0xc9))[_0xbab5('0x3f')](handleError(_0x3ebaae,null));};exports['update']=function(_0x58482e,_0x45484a){if(_0x58482e['body']['id']){delete _0x58482e['body']['id'];}return db[_0xbab5('0x2c')]['find']({'where':{'id':_0x58482e['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x45484a,null))[_0xbab5('0x25')](saveUpdates(_0x58482e[_0xbab5('0x44')],null))[_0xbab5('0x25')](respondWithResult(_0x45484a,null))['catch'](handleError(_0x45484a,null));};exports[_0xbab5('0x45')]=function(_0x3731ea,_0x25acef){return db[_0xbab5('0x2c')][_0xbab5('0x42')]({'where':{'id':_0x3731ea['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x25acef,null))[_0xbab5('0x25')](removeEntity(_0x25acef,null))[_0xbab5('0x3f')](handleError(_0x25acef,null));};exports[_0xbab5('0x46')]=function(_0x3fcb64,_0x3bd566,_0x449a38){var _0x181bc0={};var _0x43b4d8={};var _0x3cbe07;var _0x42369c;return db[_0xbab5('0x2c')][_0xbab5('0x47')]({'where':{'id':_0x3fcb64[_0xbab5('0x48')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x3bd566,null))['then'](function(_0x448326){if(_0x448326){_0x3cbe07=_0x448326;_0x43b4d8['model']=_[_0xbab5('0x32')](db[_0xbab5('0x49')][_0xbab5('0x2d')]);_0x43b4d8['query']=_[_0xbab5('0x32')](_0x3fcb64[_0xbab5('0x31')]);_0x43b4d8[_0xbab5('0x33')]=_[_0xbab5('0x41')](_0x43b4d8[_0xbab5('0x30')],_0x43b4d8[_0xbab5('0x31')]);_0x181bc0[_0xbab5('0x34')]=_['intersection'](_0x43b4d8[_0xbab5('0x30')],qs[_0xbab5('0x35')](_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x35')]));_0x181bc0[_0xbab5('0x34')]=_0x181bc0[_0xbab5('0x34')][_0xbab5('0x36')]?_0x181bc0[_0xbab5('0x34')]:_0x43b4d8[_0xbab5('0x30')];_0x181bc0[_0xbab5('0x38')]=qs[_0xbab5('0x39')](_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x39')]);_0x181bc0['where']=qs[_0xbab5('0x33')](_[_0xbab5('0x4a')](_0x3fcb64[_0xbab5('0x31')],_0x43b4d8['filters']));if(_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x3b')]){_0x181bc0['where']=_[_0xbab5('0x4b')](_0x181bc0[_0xbab5('0x3a')],{'$or':_[_0xbab5('0x2b')](_0x181bc0[_0xbab5('0x34')],function(_0x1bc637){var _0x354609={};_0x354609[_0x1bc637]={'$like':'%'+_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0x354609;})});}_0x181bc0=_[_0xbab5('0x4b')]({},_0x181bc0,_0x3fcb64[_0xbab5('0x3c')]);return _0x3cbe07[_0xbab5('0x46')](_0x181bc0);}})[_0xbab5('0x25')](function(_0x233bc7){if(_0x233bc7){_0x42369c=_0x233bc7['length'];if(!_0x3fcb64[_0xbab5('0x31')]['hasOwnProperty'](_0xbab5('0x4c'))){_0x181bc0[_0xbab5('0x1e')]=qs['limit'](_0x3fcb64['query'][_0xbab5('0x1e')]);_0x181bc0[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x1c')]);}return _0x3cbe07[_0xbab5('0x46')](_0x181bc0);}})[_0xbab5('0x25')](function(_0x3e54d9){if(_0x3e54d9){return _0x3e54d9?{'count':_0x42369c,'rows':_0x3e54d9}:null;}})[_0xbab5('0x25')](respondWithResult(_0x3bd566,null))[_0xbab5('0x3f')](handleError(_0x3bd566,null));};exports[_0xbab5('0x4d')]=function(_0xf517bb,_0x152720,_0xbc840f){var _0x5e2858={};var _0x1a39e0={};var _0x2c740e;var _0x20ac0a;return db[_0xbab5('0x2c')]['findOne']({'where':{'id':_0xf517bb['params']['id']}})['then'](handleEntityNotFound(_0x152720,null))[_0xbab5('0x25')](function(_0x2045a8){if(_0x2045a8){_0x2c740e=_0x2045a8;_0x1a39e0[_0xbab5('0x30')]=_[_0xbab5('0x32')](db['FreshdeskField'][_0xbab5('0x2d')]);_0x1a39e0[_0xbab5('0x31')]=_['keys'](_0xf517bb[_0xbab5('0x31')]);_0x1a39e0[_0xbab5('0x33')]=_[_0xbab5('0x41')](_0x1a39e0['model'],_0x1a39e0[_0xbab5('0x31')]);_0x5e2858['attributes']=_['intersection'](_0x1a39e0[_0xbab5('0x30')],qs[_0xbab5('0x35')](_0xf517bb['query'][_0xbab5('0x35')]));_0x5e2858[_0xbab5('0x34')]=_0x5e2858[_0xbab5('0x34')][_0xbab5('0x36')]?_0x5e2858[_0xbab5('0x34')]:_0x1a39e0[_0xbab5('0x30')];_0x5e2858[_0xbab5('0x38')]=qs['sort'](_0xf517bb[_0xbab5('0x31')][_0xbab5('0x39')]);_0x5e2858['where']=qs[_0xbab5('0x33')](_['pick'](_0xf517bb[_0xbab5('0x31')],_0x1a39e0['filters']));if(_0xf517bb[_0xbab5('0x31')]['filter']){_0x5e2858[_0xbab5('0x3a')]=_['merge'](_0x5e2858['where'],{'$or':_[_0xbab5('0x2b')](_0x5e2858[_0xbab5('0x34')],function(_0x202ef7){var _0x30221c={};_0x30221c[_0x202ef7]={'$like':'%'+_0xf517bb[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0x30221c;})});}_0x5e2858=_[_0xbab5('0x4b')]({},_0x5e2858,_0xf517bb['options']);return _0x2c740e['getSubjects'](_0x5e2858);}})['then'](function(_0x23e29d){if(_0x23e29d){_0x20ac0a=_0x23e29d[_0xbab5('0x36')];if(!_0xf517bb[_0xbab5('0x31')][_0xbab5('0x37')]('nolimit')){_0x5e2858[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0xf517bb['query'][_0xbab5('0x1e')]);_0x5e2858['offset']=qs[_0xbab5('0x1c')](_0xf517bb[_0xbab5('0x31')]['offset']);}return _0x2c740e[_0xbab5('0x4d')](_0x5e2858);}})['then'](function(_0x3faa7e){if(_0x3faa7e){return _0x3faa7e?{'count':_0x20ac0a,'rows':_0x3faa7e}:null;}})[_0xbab5('0x25')](respondWithResult(_0x152720,null))[_0xbab5('0x3f')](handleError(_0x152720,null));};exports[_0xbab5('0x4e')]=function(_0x749d5e,_0x187a11,_0xd2489b){var _0x34a991={};var _0x25d7cc={};var _0x357618;var _0x52e7e5;return db[_0xbab5('0x2c')][_0xbab5('0x47')]({'where':{'id':_0x749d5e[_0xbab5('0x48')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x187a11,null))[_0xbab5('0x25')](function(_0x6e50fa){if(_0x6e50fa){_0x357618=_0x6e50fa;_0x25d7cc['model']=_[_0xbab5('0x32')](db['FreshdeskField'][_0xbab5('0x2d')]);_0x25d7cc[_0xbab5('0x31')]=_[_0xbab5('0x32')](_0x749d5e[_0xbab5('0x31')]);_0x25d7cc[_0xbab5('0x33')]=_[_0xbab5('0x41')](_0x25d7cc[_0xbab5('0x30')],_0x25d7cc[_0xbab5('0x31')]);_0x34a991[_0xbab5('0x34')]=_['intersection'](_0x25d7cc['model'],qs[_0xbab5('0x35')](_0x749d5e[_0xbab5('0x31')]['fields']));_0x34a991[_0xbab5('0x34')]=_0x34a991[_0xbab5('0x34')]['length']?_0x34a991[_0xbab5('0x34')]:_0x25d7cc[_0xbab5('0x30')];_0x34a991[_0xbab5('0x38')]=qs['sort'](_0x749d5e[_0xbab5('0x31')][_0xbab5('0x39')]);_0x34a991[_0xbab5('0x3a')]=qs['filters'](_[_0xbab5('0x4a')](_0x749d5e[_0xbab5('0x31')],_0x25d7cc[_0xbab5('0x33')]));if(_0x749d5e[_0xbab5('0x31')][_0xbab5('0x3b')]){_0x34a991[_0xbab5('0x3a')]=_['merge'](_0x34a991[_0xbab5('0x3a')],{'$or':_[_0xbab5('0x2b')](_0x34a991[_0xbab5('0x34')],function(_0x566a83){var _0xaa648d={};_0xaa648d[_0x566a83]={'$like':'%'+_0x749d5e[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0xaa648d;})});}_0x34a991=_[_0xbab5('0x4b')]({},_0x34a991,_0x749d5e['options']);return _0x357618[_0xbab5('0x4e')](_0x34a991);}})['then'](function(_0x42b9b4){if(_0x42b9b4){_0x52e7e5=_0x42b9b4[_0xbab5('0x36')];if(!_0x749d5e[_0xbab5('0x31')]['hasOwnProperty'](_0xbab5('0x4c'))){_0x34a991[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x749d5e['query'][_0xbab5('0x1e')]);_0x34a991[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x749d5e[_0xbab5('0x31')][_0xbab5('0x1c')]);}return _0x357618[_0xbab5('0x4e')](_0x34a991);}})[_0xbab5('0x25')](function(_0x184732){if(_0x184732){return _0x184732?{'count':_0x52e7e5,'rows':_0x184732}:null;}})[_0xbab5('0x25')](respondWithResult(_0x187a11,null))['catch'](handleError(_0x187a11,null));};exports['getTags']=function(_0x40c080,_0x552d65,_0x4073df){var _0x1cce42={};var _0x38d71a={};var _0x5bc38f;var _0x3180af;return db[_0xbab5('0x2c')][_0xbab5('0x47')]({'where':{'id':_0x40c080['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x552d65,null))[_0xbab5('0x25')](function(_0x270dcd){if(_0x270dcd){_0x5bc38f=_0x270dcd;_0x38d71a['model']=_[_0xbab5('0x32')](db['Tag'][_0xbab5('0x2d')]);_0x38d71a['query']=_[_0xbab5('0x32')](_0x40c080[_0xbab5('0x31')]);_0x38d71a[_0xbab5('0x33')]=_['intersection'](_0x38d71a[_0xbab5('0x30')],_0x38d71a['query']);_0x1cce42[_0xbab5('0x34')]=_[_0xbab5('0x41')](_0x38d71a['model'],qs[_0xbab5('0x35')](_0x40c080['query'][_0xbab5('0x35')]));_0x1cce42[_0xbab5('0x34')]=_0x1cce42[_0xbab5('0x34')][_0xbab5('0x36')]?_0x1cce42[_0xbab5('0x34')]:_0x38d71a['model'];_0x1cce42[_0xbab5('0x38')]=qs['sort'](_0x40c080[_0xbab5('0x31')][_0xbab5('0x39')]);_0x1cce42[_0xbab5('0x3a')]=qs[_0xbab5('0x33')](_[_0xbab5('0x4a')](_0x40c080[_0xbab5('0x31')],_0x38d71a[_0xbab5('0x33')]));if(_0x40c080['query'][_0xbab5('0x3b')]){_0x1cce42['where']=_['merge'](_0x1cce42[_0xbab5('0x3a')],{'$or':_[_0xbab5('0x2b')](_0x1cce42['attributes'],function(_0x217b13){var _0x4a1e22={};_0x4a1e22[_0x217b13]={'$like':'%'+_0x40c080[_0xbab5('0x31')]['filter']+'%'};return _0x4a1e22;})});}_0x1cce42=_[_0xbab5('0x4b')]({},_0x1cce42,_0x40c080[_0xbab5('0x3c')]);return _0x5bc38f[_0xbab5('0x4f')](_0x1cce42);}})['then'](function(_0x4513d6){if(_0x4513d6){_0x3180af=_0x4513d6[_0xbab5('0x36')];if(!_0x40c080[_0xbab5('0x31')][_0xbab5('0x37')]('nolimit')){_0x1cce42[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x40c080[_0xbab5('0x31')]['limit']);_0x1cce42['offset']=qs[_0xbab5('0x1c')](_0x40c080[_0xbab5('0x31')][_0xbab5('0x1c')]);}return _0x5bc38f[_0xbab5('0x4f')](_0x1cce42);}})[_0xbab5('0x25')](function(_0x402a98){if(_0x402a98){return _0x402a98?{'count':_0x3180af,'rows':_0x402a98}:null;}})[_0xbab5('0x25')](respondWithResult(_0x552d65,null))['catch'](handleError(_0x552d65,null));};exports['setTags']=function(_0x18ff4e,_0x21d9a9,_0x3256a3){if(_0x18ff4e[_0xbab5('0x44')]['id']){delete _0x18ff4e['body']['id'];}return db[_0xbab5('0x2c')]['findOne']({'where':{'id':_0x18ff4e[_0xbab5('0x48')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x21d9a9,null))[_0xbab5('0x25')](function(_0x525fcb){if(_0x525fcb){return _0x525fcb[_0xbab5('0x50')](_0x18ff4e[_0xbab5('0x44')][_0xbab5('0x51')]||[]);}return null;})[_0xbab5('0x25')](respondWithResult(_0x21d9a9,null))[_0xbab5('0x3f')](handleError(_0x21d9a9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 01b4d0f..c747c44 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefd4=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x1a46fa,_0x44876e){var _0x492be8=function(_0x2dba34){while(--_0x2dba34){_0x1a46fa['push'](_0x1a46fa['shift']());}};_0x492be8(++_0x44876e);}(_0xefd4,0x184));var _0x4efd=function(_0x418c4e,_0x6095cd){_0x418c4e=_0x418c4e-0x0;var _0x5126ac=_0xefd4[_0x418c4e];return _0x5126ac;};'use strict';var _=require(_0x4efd('0x0'));var util=require(_0x4efd('0x1'));var logger=require('../../config/logger')(_0x4efd('0x2'));var moment=require('moment');var BPromise=require(_0x4efd('0x3'));var rp=require(_0x4efd('0x4'));var fs=require('fs');var path=require(_0x4efd('0x5'));var rimraf=require('rimraf');var config=require(_0x4efd('0x6'));var attributes=require(_0x4efd('0x7'));module['exports']=function(_0x53d3d5,_0x64987c){return _0x53d3d5[_0x4efd('0x8')](_0x4efd('0x9'),attributes,{'tableName':_0x4efd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54d6=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x27a16c,_0x13b849){var _0x322bf1=function(_0x1c7bf0){while(--_0x1c7bf0){_0x27a16c['push'](_0x27a16c['shift']());}};_0x322bf1(++_0x13b849);}(_0x54d6,0x1d9));var _0x654d=function(_0x2b3c82,_0x127b8a){_0x2b3c82=_0x2b3c82-0x0;var _0x99a562=_0x54d6[_0x2b3c82];return _0x99a562;};'use strict';var _=require(_0x654d('0x0'));var util=require('util');var logger=require(_0x654d('0x1'))(_0x654d('0x2'));var moment=require(_0x654d('0x3'));var BPromise=require('bluebird');var rp=require(_0x654d('0x4'));var fs=require('fs');var path=require(_0x654d('0x5'));var rimraf=require(_0x654d('0x6'));var config=require(_0x654d('0x7'));var attributes=require(_0x654d('0x8'));module[_0x654d('0x9')]=function(_0x4ab299,_0x2255c8){return _0x4ab299[_0x654d('0xa')](_0x654d('0xb'),attributes,{'tableName':_0x654d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 4afd87e..6af3792 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab3e=['../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x318acd,_0x249413){var _0x214bb4=function(_0x30a1c0){while(--_0x30a1c0){_0x318acd['push'](_0x318acd['shift']());}};_0x214bb4(++_0x249413);}(_0xab3e,0xff));var _0xeab3=function(_0x150322,_0x2199fb){_0x150322=_0x150322-0x0;var _0x606a08=_0xab3e[_0x150322];return _0x606a08;};'use strict';var _=require('lodash');var util=require(_0xeab3('0x0'));var moment=require(_0xeab3('0x1'));var BPromise=require(_0xeab3('0x2'));var rs=require(_0xeab3('0x3'));var fs=require('fs');var Redis=require(_0xeab3('0x4'));var db=require(_0xeab3('0x5'))['db'];var utils=require(_0xeab3('0x6'));var logger=require(_0xeab3('0x7'))(_0xeab3('0x8'));var config=require(_0xeab3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeab3('0xa')][_0xeab3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6d04c4,_0xc4db8,_0x4bd0b9){return new BPromise(function(_0x415008,_0x395099){return client[_0xeab3('0xc')](_0x6d04c4,_0x4bd0b9)[_0xeab3('0xd')](function(_0x6399db){logger[_0xeab3('0xe')](_0xeab3('0xf'),_0xc4db8,_0xeab3('0x10'));logger[_0xeab3('0x11')](_0xeab3('0x12'),_0xc4db8,_0xeab3('0x10'),JSON[_0xeab3('0x13')](_0x6399db));if(_0x6399db[_0xeab3('0x14')]){if(_0x6399db[_0xeab3('0x14')]['code']===0x1f4){logger[_0xeab3('0x14')](_0xeab3('0xf'),_0xc4db8,_0x6399db[_0xeab3('0x14')][_0xeab3('0x15')]);return _0x395099(_0x6399db[_0xeab3('0x14')][_0xeab3('0x15')]);}logger[_0xeab3('0x14')](_0xeab3('0xf'),_0xc4db8,_0x6399db[_0xeab3('0x14')]['message']);return _0x415008(_0x6399db[_0xeab3('0x14')]['message']);}else{logger[_0xeab3('0xe')](_0xeab3('0xf'),_0xc4db8,_0xeab3('0x10'));_0x415008(_0x6399db[_0xeab3('0x16')]['message']);}})[_0xeab3('0x17')](function(_0x507e71){logger[_0xeab3('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xc4db8,_0x507e71);_0x395099(_0x507e71);});});} \ No newline at end of file +var _0x9d23=['error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x472209,_0x423db0){var _0x4a1fe2=function(_0x3141d9){while(--_0x3141d9){_0x472209['push'](_0x472209['shift']());}};_0x4a1fe2(++_0x423db0);}(_0x9d23,0xdc));var _0x39d2=function(_0x508aa8,_0x2daa29){_0x508aa8=_0x508aa8-0x0;var _0x2e6b6f=_0x9d23[_0x508aa8];return _0x2e6b6f;};'use strict';var _=require(_0x39d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x39d2('0x1'));var fs=require('fs');var Redis=require(_0x39d2('0x2'));var db=require(_0x39d2('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x39d2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x39d2('0x5')][_0x39d2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x370593,_0x41d438,_0x8a1a1e){return new BPromise(function(_0x1d46a5,_0x3875c3){return client[_0x39d2('0x7')](_0x370593,_0x8a1a1e)['then'](function(_0x1e06a5){logger[_0x39d2('0x8')](_0x39d2('0x9'),_0x41d438,'request\x20sent');logger[_0x39d2('0xa')](_0x39d2('0xb'),_0x41d438,_0x39d2('0xc'),JSON[_0x39d2('0xd')](_0x1e06a5));if(_0x1e06a5[_0x39d2('0xe')]){if(_0x1e06a5[_0x39d2('0xe')][_0x39d2('0xf')]===0x1f4){logger['error'](_0x39d2('0x9'),_0x41d438,_0x1e06a5['error'][_0x39d2('0x10')]);return _0x3875c3(_0x1e06a5[_0x39d2('0xe')]['message']);}logger[_0x39d2('0xe')](_0x39d2('0x9'),_0x41d438,_0x1e06a5[_0x39d2('0xe')][_0x39d2('0x10')]);return _0x1d46a5(_0x1e06a5[_0x39d2('0xe')][_0x39d2('0x10')]);}else{logger[_0x39d2('0x8')](_0x39d2('0x9'),_0x41d438,_0x39d2('0xc'));_0x1d46a5(_0x1e06a5[_0x39d2('0x11')][_0x39d2('0x10')]);}})['catch'](function(_0x37fd0b){logger[_0x39d2('0xe')](_0x39d2('0x9'),_0x41d438,_0x37fd0b);_0x3875c3(_0x37fd0b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 1fe062c..e009e39 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08cf=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','get'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x08cf,0xbd));var _0xf08c=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x08cf[_0x37a7c6];return _0x539905;};'use strict';var multer=require(_0xf08c('0x0'));var util=require(_0xf08c('0x1'));var path=require(_0xf08c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf08c('0x3'));var interaction=require(_0xf08c('0x4'));var config=require(_0xf08c('0x5'));var controller=require(_0xf08c('0x6'));router['get']('/',auth[_0xf08c('0x7')](),controller['index']);router[_0xf08c('0x8')](_0xf08c('0x9'),auth['isAuthenticated'](),controller[_0xf08c('0xa')]);router[_0xf08c('0xb')]('/',auth[_0xf08c('0x7')](),controller[_0xf08c('0xc')]);router[_0xf08c('0xd')](_0xf08c('0x9'),auth[_0xf08c('0x7')](),controller[_0xf08c('0xe')]);router[_0xf08c('0xf')](_0xf08c('0x9'),auth[_0xf08c('0x7')](),controller[_0xf08c('0x10')]);module[_0xf08c('0x11')]=router; \ No newline at end of file +var _0xe838=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','multer','util','path'];(function(_0x1f70e1,_0x3b2b60){var _0x52fe71=function(_0x45861d){while(--_0x45861d){_0x1f70e1['push'](_0x1f70e1['shift']());}};_0x52fe71(++_0x3b2b60);}(_0xe838,0x1c9));var _0x8e83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe838[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x8e83('0x0'));var util=require(_0x8e83('0x1'));var path=require(_0x8e83('0x2'));var timeout=require(_0x8e83('0x3'));var express=require(_0x8e83('0x4'));var router=express[_0x8e83('0x5')]();var fs_extra=require(_0x8e83('0x6'));var auth=require(_0x8e83('0x7'));var interaction=require(_0x8e83('0x8'));var config=require(_0x8e83('0x9'));var controller=require(_0x8e83('0xa'));router[_0x8e83('0xb')]('/',auth[_0x8e83('0xc')](),controller[_0x8e83('0xd')]);router[_0x8e83('0xb')](_0x8e83('0xe'),auth[_0x8e83('0xc')](),controller[_0x8e83('0xf')]);router[_0x8e83('0x10')]('/',auth[_0x8e83('0xc')](),controller['create']);router[_0x8e83('0x11')](_0x8e83('0xe'),auth[_0x8e83('0xc')](),controller[_0x8e83('0x12')]);router[_0x8e83('0x13')](_0x8e83('0xe'),auth[_0x8e83('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 1c9dfa4..c3413c0 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5867=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0xbe59fa,_0x530be0){var _0x135e7e=function(_0x42b33e){while(--_0x42b33e){_0xbe59fa['push'](_0xbe59fa['shift']());}};_0x135e7e(++_0x530be0);}(_0x5867,0xa9));var _0x7586=function(_0x4ce84c,_0x56b698){_0x4ce84c=_0x4ce84c-0x0;var _0x3a4601=_0x5867[_0x4ce84c];return _0x3a4601;};'use strict';var Sequelize=require(_0x7586('0x0'));module[_0x7586('0x1')]={'type':{'type':Sequelize[_0x7586('0x2')](_0x7586('0x3'),_0x7586('0x4'),_0x7586('0x5'),_0x7586('0x6'),_0x7586('0x7')),'defaultValue':_0x7586('0x3')},'content':{'type':Sequelize[_0x7586('0x8')]},'key':{'type':Sequelize[_0x7586('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x7586('0x3'),_0x7586('0x4'),_0x7586('0x5'))},'keyContent':{'type':Sequelize[_0x7586('0x8')]},'idField':{'type':Sequelize[_0x7586('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7586('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa3cf=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5da9e1,_0xc580f8){var _0x21a139=function(_0x35b0cd){while(--_0x35b0cd){_0x5da9e1['push'](_0x5da9e1['shift']());}};_0x21a139(++_0xc580f8);}(_0xa3cf,0xad));var _0xfa3c=function(_0x212cc5,_0x2f415c){_0x212cc5=_0x212cc5-0x0;var _0x5a2c40=_0xa3cf[_0x212cc5];return _0x5a2c40;};'use strict';var Sequelize=require(_0xfa3c('0x0'));module[_0xfa3c('0x1')]={'type':{'type':Sequelize[_0xfa3c('0x2')](_0xfa3c('0x3'),_0xfa3c('0x4'),_0xfa3c('0x5'),_0xfa3c('0x6'),_0xfa3c('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa3c('0x8')]},'key':{'type':Sequelize[_0xfa3c('0x8')]},'keyType':{'type':Sequelize[_0xfa3c('0x2')]('string',_0xfa3c('0x4'),_0xfa3c('0x5'))},'keyContent':{'type':Sequelize[_0xfa3c('0x8')]},'idField':{'type':Sequelize[_0xfa3c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 223b999..7e9aa42 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5db8=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','map','FreshdeskField','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x5db8,0xbb));var _0x85db=function(_0x1e5b8b,_0x4937be){_0x1e5b8b=_0x1e5b8b-0x0;var _0x59393f=_0x5db8[_0x1e5b8b];return _0x59393f;};'use strict';var emlformat=require(_0x85db('0x0'));var rimraf=require(_0x85db('0x1'));var zipdir=require(_0x85db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85db('0x3'));var moment=require(_0x85db('0x4'));var BPromise=require(_0x85db('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x85db('0x6'));var sox=require(_0x85db('0x7'));var csv=require(_0x85db('0x8'));var ejs=require(_0x85db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85db('0xa'));var crypto=require(_0x85db('0xb'));var jsforce=require(_0x85db('0xc'));var deskjs=require(_0x85db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x85db('0xe'));var Papa=require('papaparse');var Redis=require(_0x85db('0xf'));var authService=require(_0x85db('0x10'));var qs=require(_0x85db('0x11'));var as=require(_0x85db('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x85db('0x13'));var config=require(_0x85db('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x85db('0x15'))['db'];function respondWithStatusCode(_0x541f2f,_0x437f7a){_0x437f7a=_0x437f7a||0xcc;return function(_0x35f8c6){if(_0x35f8c6){return _0x541f2f[_0x85db('0x16')](_0x437f7a);}return _0x541f2f[_0x85db('0x17')](_0x437f7a)[_0x85db('0x18')]();};}function respondWithResult(_0xb7ea66,_0x2b7507){_0x2b7507=_0x2b7507||0xc8;return function(_0x25ec64){if(_0x25ec64){return _0xb7ea66[_0x85db('0x17')](_0x2b7507)[_0x85db('0x19')](_0x25ec64);}};}function respondWithFilteredResult(_0x1e9dec,_0x270fd7){return function(_0x2be61d){if(_0x2be61d){var _0x5ccfef=typeof _0x270fd7[_0x85db('0x1a')]===_0x85db('0x1b')&&typeof _0x270fd7[_0x85db('0x1c')]===_0x85db('0x1b');var _0x2ecd71=_0x2be61d[_0x85db('0x1d')];var _0x3209b3=_0x5ccfef?0x0:_0x270fd7['offset'];var _0x37ac04=_0x5ccfef?_0x2be61d[_0x85db('0x1d')]:_0x270fd7[_0x85db('0x1a')]+_0x270fd7[_0x85db('0x1c')];var _0x4d976d;if(_0x37ac04>=_0x2ecd71){_0x37ac04=_0x2ecd71;_0x4d976d=0xc8;}else{_0x4d976d=0xce;}_0x1e9dec[_0x85db('0x17')](_0x4d976d);return _0x1e9dec[_0x85db('0x1e')](_0x85db('0x1f'),_0x3209b3+'-'+_0x37ac04+'/'+_0x2ecd71)[_0x85db('0x19')](_0x2be61d);}return null;};}function patchUpdates(_0x107c10){return function(_0x5c37d7){try{jsonpatch[_0x85db('0x20')](_0x5c37d7,_0x107c10,!![]);}catch(_0x398aa2){return BPromise[_0x85db('0x21')](_0x398aa2);}return _0x5c37d7[_0x85db('0x22')]();};}function saveUpdates(_0x44c122,_0x3842d7){return function(_0x3a7148){if(_0x3a7148){return _0x3a7148[_0x85db('0x23')](_0x44c122)['then'](function(_0xfffea2){return _0xfffea2;});}return null;};}function removeEntity(_0x2534bc,_0x57fe5b){return function(_0x3381ec){if(_0x3381ec){return _0x3381ec[_0x85db('0x24')]()[_0x85db('0x25')](function(){_0x2534bc['status'](0xcc)[_0x85db('0x18')]();});}};}function handleEntityNotFound(_0x46f428,_0x1b1980){return function(_0x54ba03){if(!_0x54ba03){_0x46f428['sendStatus'](0x194);}return _0x54ba03;};}function handleError(_0x50ea52,_0x1e4ddb){_0x1e4ddb=_0x1e4ddb||0x1f4;return function(_0x105bb9){logger[_0x85db('0x26')](_0x105bb9['stack']);if(_0x105bb9[_0x85db('0x27')]){delete _0x105bb9[_0x85db('0x27')];}_0x50ea52[_0x85db('0x17')](_0x1e4ddb)['send'](_0x105bb9);};}exports['index']=function(_0x299013,_0x137e42){var _0x18963a={},_0x226540={},_0x397afc={'count':0x0,'rows':[]};var _0x16ee2a=_[_0x85db('0x28')](db[_0x85db('0x29')][_0x85db('0x2a')],function(_0x1edc8d){return{'name':_0x1edc8d['fieldName'],'type':_0x1edc8d['type'][_0x85db('0x2b')]};});_0x226540['model']=_[_0x85db('0x28')](_0x16ee2a,_0x85db('0x27'));_0x226540['query']=_[_0x85db('0x2c')](_0x299013[_0x85db('0x2d')]);_0x226540[_0x85db('0x2e')]=_[_0x85db('0x2f')](_0x226540['model'],_0x226540[_0x85db('0x2d')]);_0x18963a[_0x85db('0x30')]=_[_0x85db('0x2f')](_0x226540[_0x85db('0x31')],qs[_0x85db('0x32')](_0x299013['query'][_0x85db('0x32')]));_0x18963a[_0x85db('0x30')]=_0x18963a[_0x85db('0x30')][_0x85db('0x33')]?_0x18963a['attributes']:_0x226540[_0x85db('0x31')];if(!_0x299013[_0x85db('0x2d')][_0x85db('0x34')]('nolimit')){_0x18963a['limit']=qs[_0x85db('0x1c')](_0x299013[_0x85db('0x2d')]['limit']);_0x18963a[_0x85db('0x1a')]=qs[_0x85db('0x1a')](_0x299013[_0x85db('0x2d')][_0x85db('0x1a')]);}_0x18963a[_0x85db('0x35')]=qs[_0x85db('0x36')](_0x299013[_0x85db('0x2d')][_0x85db('0x36')]);_0x18963a[_0x85db('0x37')]=qs[_0x85db('0x2e')](_[_0x85db('0x38')](_0x299013[_0x85db('0x2d')],_0x226540['filters']),_0x16ee2a);if(_0x299013[_0x85db('0x2d')][_0x85db('0x39')]){_0x18963a[_0x85db('0x37')]=_[_0x85db('0x3a')](_0x18963a['where'],{'$or':_[_0x85db('0x28')](_0x16ee2a,function(_0x31d169){if(_0x31d169[_0x85db('0x3b')]!==_0x85db('0x3c')){var _0x5a759d={};_0x5a759d[_0x31d169['name']]={'$like':'%'+_0x299013['query']['filter']+'%'};return _0x5a759d;}})});}_0x18963a=_['merge']({},_0x18963a,_0x299013[_0x85db('0x3d')]);var _0x164f0d={'where':_0x18963a[_0x85db('0x37')]};return db[_0x85db('0x29')][_0x85db('0x1d')](_0x164f0d)['then'](function(_0x524d37){_0x397afc[_0x85db('0x1d')]=_0x524d37;if(_0x299013['query'][_0x85db('0x3e')]){_0x18963a[_0x85db('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x18963a);})[_0x85db('0x25')](function(_0x928808){_0x397afc[_0x85db('0x40')]=_0x928808;return _0x397afc;})[_0x85db('0x25')](respondWithFilteredResult(_0x137e42,_0x18963a))[_0x85db('0x41')](handleError(_0x137e42,null));};exports['show']=function(_0x2ea6f5,_0x1eda71){var _0x115720={'raw':!![],'where':{'id':_0x2ea6f5['params']['id']}},_0x5be721={};_0x5be721['model']=_[_0x85db('0x2c')](db[_0x85db('0x29')][_0x85db('0x2a')]);_0x5be721['query']=_['keys'](_0x2ea6f5[_0x85db('0x2d')]);_0x5be721['filters']=_[_0x85db('0x2f')](_0x5be721[_0x85db('0x31')],_0x5be721[_0x85db('0x2d')]);_0x115720['attributes']=_[_0x85db('0x2f')](_0x5be721[_0x85db('0x31')],qs[_0x85db('0x32')](_0x2ea6f5[_0x85db('0x2d')][_0x85db('0x32')]));_0x115720[_0x85db('0x30')]=_0x115720[_0x85db('0x30')][_0x85db('0x33')]?_0x115720[_0x85db('0x30')]:_0x5be721['model'];if(_0x2ea6f5[_0x85db('0x2d')][_0x85db('0x3e')]){_0x115720[_0x85db('0x3f')]=[{'all':!![]}];}_0x115720=_[_0x85db('0x3a')]({},_0x115720,_0x2ea6f5[_0x85db('0x3d')]);return db[_0x85db('0x29')]['find'](_0x115720)[_0x85db('0x25')](handleEntityNotFound(_0x1eda71,null))[_0x85db('0x25')](respondWithResult(_0x1eda71,null))[_0x85db('0x41')](handleError(_0x1eda71,null));};exports['create']=function(_0x5ed8c8,_0x1350ae){return db['FreshdeskField'][_0x85db('0x42')](_0x5ed8c8[_0x85db('0x43')],{})[_0x85db('0x25')](respondWithResult(_0x1350ae,0xc9))[_0x85db('0x41')](handleError(_0x1350ae,null));};exports[_0x85db('0x23')]=function(_0x5e1455,_0x5d44ef){if(_0x5e1455[_0x85db('0x43')]['id']){delete _0x5e1455[_0x85db('0x43')]['id'];}return db[_0x85db('0x29')][_0x85db('0x44')]({'where':{'id':_0x5e1455[_0x85db('0x45')]['id']}})[_0x85db('0x25')](handleEntityNotFound(_0x5d44ef,null))[_0x85db('0x25')](saveUpdates(_0x5e1455[_0x85db('0x43')],null))[_0x85db('0x25')](respondWithResult(_0x5d44ef,null))[_0x85db('0x41')](handleError(_0x5d44ef,null));};exports['destroy']=function(_0x69c505,_0x2c4ae4){return db['FreshdeskField']['find']({'where':{'id':_0x69c505[_0x85db('0x45')]['id']}})[_0x85db('0x25')](handleEntityNotFound(_0x2c4ae4,null))['then'](removeEntity(_0x2c4ae4,null))['catch'](handleError(_0x2c4ae4,null));}; \ No newline at end of file +var _0x9bde=['catch','show','params','includeAll','include','create','body','update','find','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','rows'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9bde,0xe1));var _0xe9bd=function(_0x597691,_0x140fed){_0x597691=_0x597691-0x0;var _0x24c8ef=_0x9bde[_0x597691];return _0x24c8ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={},_0x1de54c={},_0x56e409={'count':0x0,'rows':[]};var _0xa45eb0=_[_0xe9bd('0x2b')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')],function(_0x4057df){return{'name':_0x4057df['fieldName'],'type':_0x4057df['type'][_0xe9bd('0x2e')]};});_0x1de54c[_0xe9bd('0x2f')]=_[_0xe9bd('0x2b')](_0xa45eb0,_0xe9bd('0x28'));_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x183601[_0xe9bd('0x30')]);_0x1de54c[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1de54c['model'],_0x1de54c[_0xe9bd('0x30')]);_0x5b7f1d[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0x1de54c['model'],qs['fields'](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x5b7f1d[_0xe9bd('0x34')]=_0x5b7f1d[_0xe9bd('0x34')][_0xe9bd('0x36')]?_0x5b7f1d[_0xe9bd('0x34')]:_0x1de54c[_0xe9bd('0x2f')];if(!_0x183601[_0xe9bd('0x30')][_0xe9bd('0x37')](_0xe9bd('0x38'))){_0x5b7f1d[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x1e')]);_0x5b7f1d[_0xe9bd('0x20')]=qs[_0xe9bd('0x20')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x20')]);}_0x5b7f1d['order']=qs[_0xe9bd('0x39')](_0x183601[_0xe9bd('0x30')]['sort']);_0x5b7f1d[_0xe9bd('0x3a')]=qs[_0xe9bd('0x32')](_['pick'](_0x183601['query'],_0x1de54c[_0xe9bd('0x32')]),_0xa45eb0);if(_0x183601[_0xe9bd('0x30')]['filter']){_0x5b7f1d[_0xe9bd('0x3a')]=_[_0xe9bd('0x3b')](_0x5b7f1d[_0xe9bd('0x3a')],{'$or':_['map'](_0xa45eb0,function(_0x19740b){if(_0x19740b['type']!==_0xe9bd('0x3c')){var _0x42238a={};_0x42238a[_0x19740b[_0xe9bd('0x28')]]={'$like':'%'+_0x183601[_0xe9bd('0x30')]['filter']+'%'};return _0x42238a;}})});}_0x5b7f1d=_[_0xe9bd('0x3b')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x3d')]);var _0x327e1a={'where':_0x5b7f1d[_0xe9bd('0x3a')]};return db[_0xe9bd('0x2c')][_0xe9bd('0x1f')](_0x327e1a)[_0xe9bd('0x25')](function(_0xacfd19){_0x56e409[_0xe9bd('0x1f')]=_0xacfd19;if(_0x183601[_0xe9bd('0x30')]['includeAll']){_0x5b7f1d['include']=[{'all':!![]}];}return db[_0xe9bd('0x2c')]['findAll'](_0x5b7f1d);})[_0xe9bd('0x25')](function(_0x340819){_0x56e409[_0xe9bd('0x3e')]=_0x340819;return _0x56e409;})['then'](respondWithFilteredResult(_0x519f48,_0x5b7f1d))[_0xe9bd('0x3f')](handleError(_0x519f48,null));};exports[_0xe9bd('0x40')]=function(_0x1a2d94,_0x5a4460){var _0x2ef01b={'raw':!![],'where':{'id':_0x1a2d94[_0xe9bd('0x41')]['id']}},_0x3a5703={};_0x3a5703[_0xe9bd('0x2f')]=_[_0xe9bd('0x31')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')]);_0x3a5703[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1a2d94[_0xe9bd('0x30')]);_0x3a5703[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x3a5703[_0xe9bd('0x2f')],_0x3a5703[_0xe9bd('0x30')]);_0x2ef01b[_0xe9bd('0x34')]=_['intersection'](_0x3a5703['model'],qs[_0xe9bd('0x35')](_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x2ef01b['attributes']=_0x2ef01b['attributes'][_0xe9bd('0x36')]?_0x2ef01b[_0xe9bd('0x34')]:_0x3a5703[_0xe9bd('0x2f')];if(_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x42')]){_0x2ef01b[_0xe9bd('0x43')]=[{'all':!![]}];}_0x2ef01b=_[_0xe9bd('0x3b')]({},_0x2ef01b,_0x1a2d94['options']);return db[_0xe9bd('0x2c')]['find'](_0x2ef01b)[_0xe9bd('0x25')](handleEntityNotFound(_0x5a4460,null))[_0xe9bd('0x25')](respondWithResult(_0x5a4460,null))[_0xe9bd('0x3f')](handleError(_0x5a4460,null));};exports[_0xe9bd('0x44')]=function(_0x74ea23,_0x4b7b67){return db[_0xe9bd('0x2c')][_0xe9bd('0x44')](_0x74ea23[_0xe9bd('0x45')],{})['then'](respondWithResult(_0x4b7b67,0xc9))[_0xe9bd('0x3f')](handleError(_0x4b7b67,null));};exports[_0xe9bd('0x46')]=function(_0x34f787,_0x5a466b){if(_0x34f787[_0xe9bd('0x45')]['id']){delete _0x34f787[_0xe9bd('0x45')]['id'];}return db[_0xe9bd('0x2c')][_0xe9bd('0x47')]({'where':{'id':_0x34f787[_0xe9bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a466b,null))[_0xe9bd('0x25')](saveUpdates(_0x34f787['body'],null))[_0xe9bd('0x25')](respondWithResult(_0x5a466b,null))[_0xe9bd('0x3f')](handleError(_0x5a466b,null));};exports[_0xe9bd('0x26')]=function(_0x14b06b,_0x194b7d){return db['FreshdeskField'][_0xe9bd('0x47')]({'where':{'id':_0x14b06b['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x194b7d,null))[_0xe9bd('0x25')](removeEntity(_0x194b7d,null))['catch'](handleError(_0x194b7d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index c430106..4d0d392 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4aa=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird'];(function(_0x5ac5c7,_0x3e5ecd){var _0x1eede1=function(_0x128357){while(--_0x128357){_0x5ac5c7['push'](_0x5ac5c7['shift']());}};_0x1eede1(++_0x3e5ecd);}(_0xb4aa,0xdd));var _0xab4a=function(_0x32ca43,_0x3ccdb6){_0x32ca43=_0x32ca43-0x0;var _0x562297=_0xb4aa[_0x32ca43];return _0x562297;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab4a('0x0'))(_0xab4a('0x1'));var moment=require(_0xab4a('0x2'));var BPromise=require(_0xab4a('0x3'));var rp=require(_0xab4a('0x4'));var fs=require('fs');var path=require(_0xab4a('0x5'));var rimraf=require(_0xab4a('0x6'));var config=require(_0xab4a('0x7'));var attributes=require(_0xab4a('0x8'));module['exports']=function(_0x4d67bb,_0x3a0292){return _0x4d67bb[_0xab4a('0x9')](_0xab4a('0xa'),attributes,{'tableName':_0xab4a('0xb'),'paranoid':![],'indexes':[{'name':_0xab4a('0xc'),'fields':[_0xab4a('0xd'),_0xab4a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ac8=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path'];(function(_0x186683,_0x39ea45){var _0x29e712=function(_0x4b2a65){while(--_0x4b2a65){_0x186683['push'](_0x186683['shift']());}};_0x29e712(++_0x39ea45);}(_0x4ac8,0x72));var _0x84ac=function(_0x2f92e0,_0x424b37){_0x2f92e0=_0x2f92e0-0x0;var _0x5918d5=_0x4ac8[_0x2f92e0];return _0x5918d5;};'use strict';var _=require('lodash');var util=require(_0x84ac('0x0'));var logger=require(_0x84ac('0x1'))(_0x84ac('0x2'));var moment=require(_0x84ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x84ac('0x4'));var fs=require('fs');var path=require(_0x84ac('0x5'));var rimraf=require(_0x84ac('0x6'));var config=require(_0x84ac('0x7'));var attributes=require(_0x84ac('0x8'));module[_0x84ac('0x9')]=function(_0x347353,_0x126fdc){return _0x347353[_0x84ac('0xa')](_0x84ac('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x84ac('0xc'),'fields':[_0x84ac('0xd'),_0x84ac('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 27c7975..070b0c0 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5800=['../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x5ea81f,_0x465b4e){var _0x38fbcc=function(_0x4e14c9){while(--_0x4e14c9){_0x5ea81f['push'](_0x5ea81f['shift']());}};_0x38fbcc(++_0x465b4e);}(_0x5800,0x165));var _0x0580=function(_0x5d7d6b,_0x3e1cde){_0x5d7d6b=_0x5d7d6b-0x0;var _0x2e5b64=_0x5800[_0x5d7d6b];return _0x2e5b64;};'use strict';var _=require(_0x0580('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0580('0x1'));var fs=require('fs');var Redis=require(_0x0580('0x2'));var db=require(_0x0580('0x3'))['db'];var utils=require(_0x0580('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0580('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0580('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2678,_0x590196,_0x561f17){return new BPromise(function(_0x4eb4a9,_0x22124a){return client[_0x0580('0x7')](_0x1e2678,_0x561f17)[_0x0580('0x8')](function(_0x41b9ec){logger[_0x0580('0x9')](_0x0580('0xa'),_0x590196,'request\x20sent');logger[_0x0580('0xb')](_0x0580('0xc'),_0x590196,_0x0580('0xd'),JSON[_0x0580('0xe')](_0x41b9ec));if(_0x41b9ec[_0x0580('0xf')]){if(_0x41b9ec['error'][_0x0580('0x10')]===0x1f4){logger[_0x0580('0xf')](_0x0580('0xa'),_0x590196,_0x41b9ec[_0x0580('0xf')][_0x0580('0x11')]);return _0x22124a(_0x41b9ec[_0x0580('0xf')][_0x0580('0x11')]);}logger[_0x0580('0xf')](_0x0580('0xa'),_0x590196,_0x41b9ec[_0x0580('0xf')]['message']);return _0x4eb4a9(_0x41b9ec['error'][_0x0580('0x11')]);}else{logger['info'](_0x0580('0xa'),_0x590196,_0x0580('0xd'));_0x4eb4a9(_0x41b9ec[_0x0580('0x12')][_0x0580('0x11')]);}})[_0x0580('0x13')](function(_0xfc84cb){logger[_0x0580('0xf')](_0x0580('0xa'),_0x590196,_0xfc84cb);_0x22124a(_0xfc84cb);});});} \ No newline at end of file +var _0x7a97=['../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x19d183,_0x46212c){var _0x300293=function(_0x3a5185){while(--_0x3a5185){_0x19d183['push'](_0x19d183['shift']());}};_0x300293(++_0x46212c);}(_0x7a97,0x1db));var _0x77a9=function(_0x59fc88,_0x49f15d){_0x59fc88=_0x59fc88-0x0;var _0x47baed=_0x7a97[_0x59fc88];return _0x47baed;};'use strict';var _=require(_0x77a9('0x0'));var util=require(_0x77a9('0x1'));var moment=require(_0x77a9('0x2'));var BPromise=require(_0x77a9('0x3'));var rs=require(_0x77a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77a9('0x5'))['db'];var utils=require(_0x77a9('0x6'));var logger=require('../../config/logger')(_0x77a9('0x7'));var config=require(_0x77a9('0x8'));var jayson=require(_0x77a9('0x9'));var client=jayson[_0x77a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x493a8b,_0x22bc95,_0x5ac332){return new BPromise(function(_0x1f5b9f,_0x149200){return client[_0x77a9('0xb')](_0x493a8b,_0x5ac332)[_0x77a9('0xc')](function(_0x390651){logger[_0x77a9('0xd')](_0x77a9('0xe'),_0x22bc95,'request\x20sent');logger[_0x77a9('0xf')](_0x77a9('0x10'),_0x22bc95,'request\x20sent',JSON['stringify'](_0x390651));if(_0x390651['error']){if(_0x390651[_0x77a9('0x11')][_0x77a9('0x12')]===0x1f4){logger[_0x77a9('0x11')](_0x77a9('0xe'),_0x22bc95,_0x390651[_0x77a9('0x11')][_0x77a9('0x13')]);return _0x149200(_0x390651[_0x77a9('0x11')][_0x77a9('0x13')]);}logger[_0x77a9('0x11')](_0x77a9('0xe'),_0x22bc95,_0x390651[_0x77a9('0x11')]['message']);return _0x1f5b9f(_0x390651[_0x77a9('0x11')][_0x77a9('0x13')]);}else{logger[_0x77a9('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x22bc95,_0x77a9('0x14'));_0x1f5b9f(_0x390651[_0x77a9('0x15')][_0x77a9('0x13')]);}})[_0x77a9('0x16')](function(_0x14448d){logger[_0x77a9('0x11')](_0x77a9('0xe'),_0x22bc95,_0x14448d);_0x149200(_0x14448d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index f8e0306..580dec0 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x214c12,_0xbe93fe){var _0x38906c=function(_0x241f60){while(--_0x241f60){_0x214c12['push'](_0x214c12['shift']());}};_0x38906c(++_0xbe93fe);}(_0xe511,0x16f));var _0x1e51=function(_0x66dd2a,_0x3a7420){_0x66dd2a=_0x66dd2a-0x0;var _0x3924ec=_0xe511[_0x66dd2a];return _0x3924ec;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router; \ No newline at end of file +var _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x1ea866,_0x254f7d){var _0x2ccb4d=function(_0x34aa7c){while(--_0x34aa7c){_0x1ea866['push'](_0x1ea866['shift']());}};_0x2ccb4d(++_0x254f7d);}(_0xe511,0x16f));var _0x1e51=function(_0x451959,_0x18c7a5){_0x451959=_0x451959-0x0;var _0x490269=_0xe511[_0x451959];return _0x490269;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b305ef7..b15c1a8 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4213=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1e050a,_0x126b0c){var _0xe09172=function(_0x1b6b6f){while(--_0x1b6b6f){_0x1e050a['push'](_0x1e050a['shift']());}};_0xe09172(++_0x126b0c);}(_0x4213,0x77));var _0x3421=function(_0x77daf8,_0x370634){_0x77daf8=_0x77daf8-0x0;var _0x1a6b62=_0x4213[_0x77daf8];return _0x1a6b62;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')]},'description':{'type':Sequelize[_0x3421('0x2')]},'username':{'type':Sequelize[_0x3421('0x2')],'unique':_0x3421('0x3')},'apiKey':{'type':Sequelize[_0x3421('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3421('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xb78e,0x1c9));var _0xeb78=function(_0x381d42,_0x1593ec){_0x381d42=_0x381d42-0x0;var _0x2c9ff1=_0xb78e[_0x381d42];return _0x2c9ff1;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index ceea421..5200aaf 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0b4=['update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','order','sort','where','filter','merge','options','FreshsalesAccount','includeAll','include','show','fields','find','catch','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','nolimit','addConfiguration','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xd0b4,0xa5));var _0x4d0b=function(_0x5c1029,_0x3c228e){_0x5c1029=_0x5c1029-0x0;var _0xb948ce=_0xd0b4[_0x5c1029];return _0xb948ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d0b('0x0'));var zipdir=require(_0x4d0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d0b('0x2'));var moment=require(_0x4d0b('0x3'));var BPromise=require(_0x4d0b('0x4'));var Mustache=require(_0x4d0b('0x5'));var util=require('util');var path=require(_0x4d0b('0x6'));var sox=require(_0x4d0b('0x7'));var csv=require(_0x4d0b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d0b('0x9'));var squel=require(_0x4d0b('0xa'));var crypto=require(_0x4d0b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4d0b('0xc'));var toCsv=require(_0x4d0b('0x8'));var querystring=require(_0x4d0b('0xd'));var Papa=require(_0x4d0b('0xe'));var Redis=require(_0x4d0b('0xf'));var authService=require(_0x4d0b('0x10'));var qs=require(_0x4d0b('0x11'));var as=require(_0x4d0b('0x12'));var hardwareService=require(_0x4d0b('0x13'));var logger=require(_0x4d0b('0x14'))(_0x4d0b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4d0b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3630d8,_0x46505c){_0x46505c=_0x46505c||0xcc;return function(_0x516146){if(_0x516146){return _0x3630d8['sendStatus'](_0x46505c);}return _0x3630d8['status'](_0x46505c)[_0x4d0b('0x17')]();};}function respondWithResult(_0x2a6454,_0x55c61b){_0x55c61b=_0x55c61b||0xc8;return function(_0x3d1b35){if(_0x3d1b35){return _0x2a6454[_0x4d0b('0x18')](_0x55c61b)[_0x4d0b('0x19')](_0x3d1b35);}};}function respondWithFilteredResult(_0x438274,_0x1765de){return function(_0x18144f){if(_0x18144f){var _0x14aa02=typeof _0x1765de['offset']===_0x4d0b('0x1a')&&typeof _0x1765de[_0x4d0b('0x1b')]==='undefined';var _0x14689e=_0x18144f[_0x4d0b('0x1c')];var _0x54e766=_0x14aa02?0x0:_0x1765de[_0x4d0b('0x1d')];var _0x576780=_0x14aa02?_0x18144f[_0x4d0b('0x1c')]:_0x1765de[_0x4d0b('0x1d')]+_0x1765de[_0x4d0b('0x1b')];var _0x68ebf2;if(_0x576780>=_0x14689e){_0x576780=_0x14689e;_0x68ebf2=0xc8;}else{_0x68ebf2=0xce;}_0x438274[_0x4d0b('0x18')](_0x68ebf2);return _0x438274[_0x4d0b('0x1e')](_0x4d0b('0x1f'),_0x54e766+'-'+_0x576780+'/'+_0x14689e)['json'](_0x18144f);}return null;};}function patchUpdates(_0x435f27){return function(_0x38b895){try{jsonpatch[_0x4d0b('0x20')](_0x38b895,_0x435f27,!![]);}catch(_0x1281c0){return BPromise[_0x4d0b('0x21')](_0x1281c0);}return _0x38b895[_0x4d0b('0x22')]();};}function saveUpdates(_0x1fafe4,_0xf975df){return function(_0x1d3f11){if(_0x1d3f11){return _0x1d3f11[_0x4d0b('0x23')](_0x1fafe4)[_0x4d0b('0x24')](function(_0x2baebc){return _0x2baebc;});}return null;};}function removeEntity(_0x252e0f,_0x3c76dd){return function(_0x276a10){if(_0x276a10){return _0x276a10[_0x4d0b('0x25')]()[_0x4d0b('0x24')](function(){_0x252e0f[_0x4d0b('0x18')](0xcc)[_0x4d0b('0x17')]();});}};}function handleEntityNotFound(_0x1d2180,_0x4cefb9){return function(_0x11f937){if(!_0x11f937){_0x1d2180[_0x4d0b('0x26')](0x194);}return _0x11f937;};}function handleError(_0x41e2cd,_0x4a63e9){_0x4a63e9=_0x4a63e9||0x1f4;return function(_0x221d18){logger[_0x4d0b('0x27')](_0x221d18[_0x4d0b('0x28')]);if(_0x221d18['name']){delete _0x221d18[_0x4d0b('0x29')];}_0x41e2cd[_0x4d0b('0x18')](_0x4a63e9)[_0x4d0b('0x2a')](_0x221d18);};}exports[_0x4d0b('0x2b')]=function(_0x2393e7,_0x414e48){var _0x320cc5={},_0x51fe89={},_0x4a9a91={'count':0x0,'rows':[]};var _0x214d76=_[_0x4d0b('0x2c')](db['FreshsalesAccount'][_0x4d0b('0x2d')],function(_0x4076b6){return{'name':_0x4076b6[_0x4d0b('0x2e')],'type':_0x4076b6[_0x4d0b('0x2f')][_0x4d0b('0x30')]};});_0x51fe89[_0x4d0b('0x31')]=_['map'](_0x214d76,_0x4d0b('0x29'));_0x51fe89['query']=_[_0x4d0b('0x32')](_0x2393e7[_0x4d0b('0x33')]);_0x51fe89[_0x4d0b('0x34')]=_[_0x4d0b('0x35')](_0x51fe89['model'],_0x51fe89[_0x4d0b('0x33')]);_0x320cc5['attributes']=_['intersection'](_0x51fe89[_0x4d0b('0x31')],qs['fields'](_0x2393e7['query']['fields']));_0x320cc5[_0x4d0b('0x36')]=_0x320cc5['attributes'][_0x4d0b('0x37')]?_0x320cc5[_0x4d0b('0x36')]:_0x51fe89[_0x4d0b('0x31')];if(!_0x2393e7[_0x4d0b('0x33')]['hasOwnProperty']('nolimit')){_0x320cc5['limit']=qs[_0x4d0b('0x1b')](_0x2393e7[_0x4d0b('0x33')][_0x4d0b('0x1b')]);_0x320cc5[_0x4d0b('0x1d')]=qs[_0x4d0b('0x1d')](_0x2393e7[_0x4d0b('0x33')][_0x4d0b('0x1d')]);}_0x320cc5[_0x4d0b('0x38')]=qs[_0x4d0b('0x39')](_0x2393e7[_0x4d0b('0x33')][_0x4d0b('0x39')]);_0x320cc5[_0x4d0b('0x3a')]=qs['filters'](_['pick'](_0x2393e7[_0x4d0b('0x33')],_0x51fe89[_0x4d0b('0x34')]),_0x214d76);if(_0x2393e7[_0x4d0b('0x33')][_0x4d0b('0x3b')]){_0x320cc5['where']=_[_0x4d0b('0x3c')](_0x320cc5[_0x4d0b('0x3a')],{'$or':_[_0x4d0b('0x2c')](_0x214d76,function(_0x37a5a2){if(_0x37a5a2[_0x4d0b('0x2f')]!=='VIRTUAL'){var _0x49ea83={};_0x49ea83[_0x37a5a2[_0x4d0b('0x29')]]={'$like':'%'+_0x2393e7[_0x4d0b('0x33')]['filter']+'%'};return _0x49ea83;}})});}_0x320cc5=_[_0x4d0b('0x3c')]({},_0x320cc5,_0x2393e7[_0x4d0b('0x3d')]);var _0x2a5fb4={'where':_0x320cc5[_0x4d0b('0x3a')]};return db[_0x4d0b('0x3e')][_0x4d0b('0x1c')](_0x2a5fb4)['then'](function(_0x4f26e2){_0x4a9a91[_0x4d0b('0x1c')]=_0x4f26e2;if(_0x2393e7[_0x4d0b('0x33')][_0x4d0b('0x3f')]){_0x320cc5[_0x4d0b('0x40')]=[{'all':!![]}];}return db[_0x4d0b('0x3e')]['findAll'](_0x320cc5);})[_0x4d0b('0x24')](function(_0x3023cb){_0x4a9a91['rows']=_0x3023cb;return _0x4a9a91;})['then'](respondWithFilteredResult(_0x414e48,_0x320cc5))['catch'](handleError(_0x414e48,null));};exports[_0x4d0b('0x41')]=function(_0x2f5426,_0xad1e50){var _0x55ccb9={'raw':![],'where':{'id':_0x2f5426['params']['id']}},_0x465a7a={};_0x465a7a[_0x4d0b('0x31')]=_['keys'](db[_0x4d0b('0x3e')][_0x4d0b('0x2d')]);_0x465a7a[_0x4d0b('0x33')]=_[_0x4d0b('0x32')](_0x2f5426[_0x4d0b('0x33')]);_0x465a7a['filters']=_[_0x4d0b('0x35')](_0x465a7a[_0x4d0b('0x31')],_0x465a7a['query']);_0x55ccb9['attributes']=_[_0x4d0b('0x35')](_0x465a7a[_0x4d0b('0x31')],qs[_0x4d0b('0x42')](_0x2f5426[_0x4d0b('0x33')][_0x4d0b('0x42')]));_0x55ccb9[_0x4d0b('0x36')]=_0x55ccb9['attributes']['length']?_0x55ccb9[_0x4d0b('0x36')]:_0x465a7a[_0x4d0b('0x31')];if(_0x2f5426[_0x4d0b('0x33')][_0x4d0b('0x3f')]){_0x55ccb9['include']=[{'all':!![]}];}_0x55ccb9=_[_0x4d0b('0x3c')]({},_0x55ccb9,_0x2f5426[_0x4d0b('0x3d')]);return db[_0x4d0b('0x3e')][_0x4d0b('0x43')](_0x55ccb9)['then'](handleEntityNotFound(_0xad1e50,null))['then'](respondWithResult(_0xad1e50,null))[_0x4d0b('0x44')](handleError(_0xad1e50,null));};exports[_0x4d0b('0x45')]=function(_0x4b3bfe,_0x4ab81d){return db[_0x4d0b('0x3e')][_0x4d0b('0x45')](_0x4b3bfe[_0x4d0b('0x46')],{})[_0x4d0b('0x24')](respondWithResult(_0x4ab81d,0xc9))[_0x4d0b('0x44')](handleError(_0x4ab81d,null));};exports[_0x4d0b('0x23')]=function(_0x15c424,_0x5ede54){if(_0x15c424[_0x4d0b('0x46')]['id']){delete _0x15c424['body']['id'];}return db[_0x4d0b('0x3e')][_0x4d0b('0x43')]({'where':{'id':_0x15c424[_0x4d0b('0x47')]['id']}})[_0x4d0b('0x24')](handleEntityNotFound(_0x5ede54,null))['then'](saveUpdates(_0x15c424[_0x4d0b('0x46')],null))[_0x4d0b('0x24')](respondWithResult(_0x5ede54,null))[_0x4d0b('0x44')](handleError(_0x5ede54,null));};exports[_0x4d0b('0x25')]=function(_0x38c21c,_0x34e535){return db[_0x4d0b('0x3e')][_0x4d0b('0x43')]({'where':{'id':_0x38c21c['params']['id']}})[_0x4d0b('0x24')](handleEntityNotFound(_0x34e535,null))[_0x4d0b('0x24')](removeEntity(_0x34e535,null))[_0x4d0b('0x44')](handleError(_0x34e535,null));};exports[_0x4d0b('0x48')]=function(_0x341f72,_0x2f8608,_0x13ba3d){var _0x24df32={};var _0x376332={};var _0x45c5da;var _0x2cae2d;return db[_0x4d0b('0x3e')][_0x4d0b('0x49')]({'where':{'id':_0x341f72[_0x4d0b('0x47')]['id']}})[_0x4d0b('0x24')](handleEntityNotFound(_0x2f8608,null))['then'](function(_0x1dc93e){if(_0x1dc93e){_0x45c5da=_0x1dc93e;_0x376332['model']=_[_0x4d0b('0x32')](db[_0x4d0b('0x4a')]['rawAttributes']);_0x376332[_0x4d0b('0x33')]=_['keys'](_0x341f72[_0x4d0b('0x33')]);_0x376332[_0x4d0b('0x34')]=_[_0x4d0b('0x35')](_0x376332[_0x4d0b('0x31')],_0x376332[_0x4d0b('0x33')]);_0x24df32[_0x4d0b('0x36')]=_[_0x4d0b('0x35')](_0x376332[_0x4d0b('0x31')],qs[_0x4d0b('0x42')](_0x341f72[_0x4d0b('0x33')]['fields']));_0x24df32['attributes']=_0x24df32[_0x4d0b('0x36')][_0x4d0b('0x37')]?_0x24df32[_0x4d0b('0x36')]:_0x376332[_0x4d0b('0x31')];_0x24df32[_0x4d0b('0x38')]=qs['sort'](_0x341f72[_0x4d0b('0x33')][_0x4d0b('0x39')]);_0x24df32[_0x4d0b('0x3a')]=qs[_0x4d0b('0x34')](_['pick'](_0x341f72[_0x4d0b('0x33')],_0x376332[_0x4d0b('0x34')]));if(_0x341f72[_0x4d0b('0x33')][_0x4d0b('0x3b')]){_0x24df32['where']=_[_0x4d0b('0x3c')](_0x24df32['where'],{'$or':_[_0x4d0b('0x2c')](_0x24df32[_0x4d0b('0x36')],function(_0x4b26fa){var _0x382424={};_0x382424[_0x4b26fa]={'$like':'%'+_0x341f72['query'][_0x4d0b('0x3b')]+'%'};return _0x382424;})});}_0x24df32=_[_0x4d0b('0x3c')]({},_0x24df32,_0x341f72['options']);return _0x45c5da[_0x4d0b('0x48')](_0x24df32);}})[_0x4d0b('0x24')](function(_0x5ca308){if(_0x5ca308){_0x2cae2d=_0x5ca308[_0x4d0b('0x37')];if(!_0x341f72[_0x4d0b('0x33')][_0x4d0b('0x4b')](_0x4d0b('0x4c'))){_0x24df32[_0x4d0b('0x1b')]=qs[_0x4d0b('0x1b')](_0x341f72[_0x4d0b('0x33')][_0x4d0b('0x1b')]);_0x24df32['offset']=qs['offset'](_0x341f72['query'][_0x4d0b('0x1d')]);}return _0x45c5da[_0x4d0b('0x48')](_0x24df32);}})[_0x4d0b('0x24')](function(_0x288c90){if(_0x288c90){return _0x288c90?{'count':_0x2cae2d,'rows':_0x288c90}:null;}})[_0x4d0b('0x24')](respondWithResult(_0x2f8608,null))[_0x4d0b('0x44')](handleError(_0x2f8608,null));};exports[_0x4d0b('0x4d')]=function(_0x489524,_0xc968d8,_0x588231){if(_0x489524[_0x4d0b('0x46')]['id']){delete _0x489524[_0x4d0b('0x46')]['id'];}return db['FreshsalesAccount'][_0x4d0b('0x49')]({'where':{'id':_0x489524[_0x4d0b('0x47')]['id']}})['then'](handleEntityNotFound(_0xc968d8,null))['then'](function(_0x1b16d4){if(_0x1b16d4){_0x489524[_0x4d0b('0x46')]['AccountId']=_0x1b16d4['id'];_0x489524[_0x4d0b('0x46')]['Subjects']=integrations[_0x4d0b('0x4e')](_0x489524[_0x4d0b('0x46')][_0x4d0b('0x4f')],_0x489524['body'][_0x4d0b('0x2f')]);_0x489524['body'][_0x4d0b('0x50')]=integrations['getDescriptions'](_0x489524[_0x4d0b('0x46')][_0x4d0b('0x4f')],_0x489524[_0x4d0b('0x46')][_0x4d0b('0x2f')]);return db[_0x4d0b('0x4a')]['create'](_0x489524['body'],{'include':[{'model':db[_0x4d0b('0x51')],'as':_0x4d0b('0x52')},{'model':db['FreshsalesField'],'as':_0x4d0b('0x50')}]});}return null;})[_0x4d0b('0x24')](respondWithResult(_0xc968d8,null))[_0x4d0b('0x44')](handleError(_0xc968d8,null));};exports[_0x4d0b('0x53')]=function(_0x4d0166,_0x243c80,_0x42af73){var _0x3af7b0='';var _0xd7b5d4='';return db[_0x4d0b('0x3e')][_0x4d0b('0x49')]({'where':{'id':_0x4d0166[_0x4d0b('0x47')]['id']},'attributes':['id',_0x4d0b('0x54'),'remoteUri',_0x4d0b('0x55')]})['then'](handleEntityNotFound(_0x243c80,null))[_0x4d0b('0x24')](function(_0x595150){if(_0x595150){_0xd7b5d4=_0x595150[_0x4d0b('0x54')];_0x3af7b0=_0x595150[_0x4d0b('0x56')];var _0x1785f5=_0x595150[_0x4d0b('0x56')][_0x4d0b('0x57')](-0x1);if(_0x1785f5==='/'){_0x3af7b0=_0x3af7b0[_0x4d0b('0x58')](0x0,_0x3af7b0[_0x4d0b('0x59')](_0x1785f5));}return rp({'method':'GET','uri':util[_0x4d0b('0x5a')](_0x4d0b('0x5b'),_0x3af7b0,_0x4d0b('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x595150[_0x4d0b('0x55')]},'json':!![]});}})[_0x4d0b('0x24')](function(_0x105abe){if(_0x105abe){var _0x47fb29=_0x105abe[_0x4d0b('0x5d')];var _0x4122d5=![];var _0xe339ab=null;for(_0xe339ab=0x0;_0xe339ab<_0x47fb29['length'];_0xe339ab++){if(_0x47fb29[_0xe339ab][_0x4d0b('0x5e')]===_0xd7b5d4){_0x4122d5=!![];}}if(_0x4122d5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4d0b('0x5f')});}}})[_0x4d0b('0x24')](respondWithResult(_0x243c80,null))[_0x4d0b('0x44')](function(_0x1925be){var _0x21e366=_0x4d0166[_0x4d0b('0x33')]['test']?0x1f4:_0x1925be[_0x4d0b('0x60')]||0x1f4;logger[_0x4d0b('0x27')](_0x4d0b('0x61'),'getFields',_0x21e366,JSON['stringify'](_0x1925be));delete _0x1925be['name'];if(_0x21e366===0x191){_0x21e366=0x190;}_0x243c80[_0x4d0b('0x18')](_0x21e366)[_0x4d0b('0x2a')](_0x4d0166['query'][_0x4d0b('0x62')]?{'message':_0x4d0b('0x63'),'statusCode':_0x1925be[_0x4d0b('0x60')]}:_0x1925be);});}; \ No newline at end of file +var _0x9bbc=['email','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','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','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','type','Descriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','%s%s','Token\x20token=','users'];(function(_0x1a6ced,_0x337b70){var _0x7925c2=function(_0x5b84d3){while(--_0x5b84d3){_0x1a6ced['push'](_0x1a6ced['shift']());}};_0x7925c2(++_0x337b70);}(_0x9bbc,0x1a6));var _0xc9bb=function(_0x41c2df,_0x1d24e2){_0x41c2df=_0x41c2df-0x0;var _0x2fbe2f=_0x9bbc[_0x41c2df];return _0x2fbe2f;};'use strict';var emlformat=require(_0xc9bb('0x0'));var rimraf=require(_0xc9bb('0x1'));var zipdir=require(_0xc9bb('0x2'));var jsonpatch=require(_0xc9bb('0x3'));var rp=require(_0xc9bb('0x4'));var moment=require(_0xc9bb('0x5'));var BPromise=require(_0xc9bb('0x6'));var Mustache=require(_0xc9bb('0x7'));var util=require(_0xc9bb('0x8'));var path=require(_0xc9bb('0x9'));var sox=require(_0xc9bb('0xa'));var csv=require(_0xc9bb('0xb'));var ejs=require(_0xc9bb('0xc'));var fs=require('fs');var fs_extra=require(_0xc9bb('0xd'));var _=require(_0xc9bb('0xe'));var squel=require(_0xc9bb('0xf'));var crypto=require(_0xc9bb('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xc9bb('0x11'));var toCsv=require(_0xc9bb('0xb'));var querystring=require(_0xc9bb('0x12'));var Papa=require(_0xc9bb('0x13'));var Redis=require(_0xc9bb('0x14'));var authService=require(_0xc9bb('0x15'));var qs=require(_0xc9bb('0x16'));var as=require(_0xc9bb('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9bb('0x18'))(_0xc9bb('0x19'));var utils=require(_0xc9bb('0x1a'));var config=require(_0xc9bb('0x1b'));var licenseUtil=require(_0xc9bb('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc9bb('0x1d'));function respondWithStatusCode(_0x3890b7,_0x486625){_0x486625=_0x486625||0xcc;return function(_0x3f5126){if(_0x3f5126){return _0x3890b7[_0xc9bb('0x1e')](_0x486625);}return _0x3890b7[_0xc9bb('0x1f')](_0x486625)[_0xc9bb('0x20')]();};}function respondWithResult(_0x19f065,_0xd8a552){_0xd8a552=_0xd8a552||0xc8;return function(_0xa5b10c){if(_0xa5b10c){return _0x19f065[_0xc9bb('0x1f')](_0xd8a552)[_0xc9bb('0x21')](_0xa5b10c);}};}function respondWithFilteredResult(_0x3ee77b,_0x1806ec){return function(_0x2af7b0){if(_0x2af7b0){var _0x5124ff=typeof _0x1806ec[_0xc9bb('0x22')]===_0xc9bb('0x23')&&typeof _0x1806ec[_0xc9bb('0x24')]===_0xc9bb('0x23');var _0x58f82d=_0x2af7b0[_0xc9bb('0x25')];var _0x539dda=_0x5124ff?0x0:_0x1806ec[_0xc9bb('0x22')];var _0x2b4a83=_0x5124ff?_0x2af7b0['count']:_0x1806ec[_0xc9bb('0x22')]+_0x1806ec[_0xc9bb('0x24')];var _0x75b05f;if(_0x2b4a83>=_0x58f82d){_0x2b4a83=_0x58f82d;_0x75b05f=0xc8;}else{_0x75b05f=0xce;}_0x3ee77b[_0xc9bb('0x1f')](_0x75b05f);return _0x3ee77b[_0xc9bb('0x26')]('Content-Range',_0x539dda+'-'+_0x2b4a83+'/'+_0x58f82d)[_0xc9bb('0x21')](_0x2af7b0);}return null;};}function patchUpdates(_0x55197f){return function(_0xfe2177){try{jsonpatch['apply'](_0xfe2177,_0x55197f,!![]);}catch(_0x4fffdf){return BPromise[_0xc9bb('0x27')](_0x4fffdf);}return _0xfe2177[_0xc9bb('0x28')]();};}function saveUpdates(_0x44123e,_0x1358e3){return function(_0x1a2c8c){if(_0x1a2c8c){return _0x1a2c8c[_0xc9bb('0x29')](_0x44123e)[_0xc9bb('0x2a')](function(_0x499253){return _0x499253;});}return null;};}function removeEntity(_0x2fadd7,_0x209b4d){return function(_0x304a46){if(_0x304a46){return _0x304a46[_0xc9bb('0x2b')]()[_0xc9bb('0x2a')](function(){_0x2fadd7['status'](0xcc)[_0xc9bb('0x20')]();});}};}function handleEntityNotFound(_0xb39b6d,_0x13c8c0){return function(_0x1e420a){if(!_0x1e420a){_0xb39b6d[_0xc9bb('0x1e')](0x194);}return _0x1e420a;};}function handleError(_0x369ae7,_0x5c1a8a){_0x5c1a8a=_0x5c1a8a||0x1f4;return function(_0x45b994){logger['error'](_0x45b994[_0xc9bb('0x2c')]);if(_0x45b994['name']){delete _0x45b994[_0xc9bb('0x2d')];}_0x369ae7[_0xc9bb('0x1f')](_0x5c1a8a)[_0xc9bb('0x2e')](_0x45b994);};}exports['index']=function(_0x5e2a91,_0x560232){var _0x118389={},_0x138a48={},_0x487a08={'count':0x0,'rows':[]};var _0x15385d=_[_0xc9bb('0x2f')](db[_0xc9bb('0x30')][_0xc9bb('0x31')],function(_0x456b8f){return{'name':_0x456b8f[_0xc9bb('0x32')],'type':_0x456b8f['type'][_0xc9bb('0x33')]};});_0x138a48[_0xc9bb('0x34')]=_[_0xc9bb('0x2f')](_0x15385d,_0xc9bb('0x2d'));_0x138a48[_0xc9bb('0x35')]=_[_0xc9bb('0x36')](_0x5e2a91[_0xc9bb('0x35')]);_0x138a48[_0xc9bb('0x37')]=_[_0xc9bb('0x38')](_0x138a48['model'],_0x138a48[_0xc9bb('0x35')]);_0x118389[_0xc9bb('0x39')]=_[_0xc9bb('0x38')](_0x138a48[_0xc9bb('0x34')],qs[_0xc9bb('0x3a')](_0x5e2a91[_0xc9bb('0x35')]['fields']));_0x118389[_0xc9bb('0x39')]=_0x118389[_0xc9bb('0x39')][_0xc9bb('0x3b')]?_0x118389[_0xc9bb('0x39')]:_0x138a48[_0xc9bb('0x34')];if(!_0x5e2a91[_0xc9bb('0x35')]['hasOwnProperty'](_0xc9bb('0x3c'))){_0x118389[_0xc9bb('0x24')]=qs['limit'](_0x5e2a91['query'][_0xc9bb('0x24')]);_0x118389[_0xc9bb('0x22')]=qs[_0xc9bb('0x22')](_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x22')]);}_0x118389['order']=qs['sort'](_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x3d')]);_0x118389['where']=qs[_0xc9bb('0x37')](_[_0xc9bb('0x3e')](_0x5e2a91['query'],_0x138a48['filters']),_0x15385d);if(_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x3f')]){_0x118389[_0xc9bb('0x40')]=_[_0xc9bb('0x41')](_0x118389[_0xc9bb('0x40')],{'$or':_[_0xc9bb('0x2f')](_0x15385d,function(_0x1ab084){if(_0x1ab084['type']!==_0xc9bb('0x42')){var _0x21b55e={};_0x21b55e[_0x1ab084[_0xc9bb('0x2d')]]={'$like':'%'+_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x3f')]+'%'};return _0x21b55e;}})});}_0x118389=_[_0xc9bb('0x41')]({},_0x118389,_0x5e2a91['options']);var _0xc46780={'where':_0x118389[_0xc9bb('0x40')]};return db[_0xc9bb('0x30')][_0xc9bb('0x25')](_0xc46780)[_0xc9bb('0x2a')](function(_0x331189){_0x487a08[_0xc9bb('0x25')]=_0x331189;if(_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x43')]){_0x118389[_0xc9bb('0x44')]=[{'all':!![]}];}return db[_0xc9bb('0x30')][_0xc9bb('0x45')](_0x118389);})['then'](function(_0x56c709){_0x487a08[_0xc9bb('0x46')]=_0x56c709;return _0x487a08;})['then'](respondWithFilteredResult(_0x560232,_0x118389))[_0xc9bb('0x47')](handleError(_0x560232,null));};exports['show']=function(_0x13fa24,_0x19dec4){var _0x270594={'raw':![],'where':{'id':_0x13fa24['params']['id']}},_0x51bc87={};_0x51bc87[_0xc9bb('0x34')]=_['keys'](db[_0xc9bb('0x30')][_0xc9bb('0x31')]);_0x51bc87['query']=_['keys'](_0x13fa24[_0xc9bb('0x35')]);_0x51bc87[_0xc9bb('0x37')]=_[_0xc9bb('0x38')](_0x51bc87[_0xc9bb('0x34')],_0x51bc87[_0xc9bb('0x35')]);_0x270594[_0xc9bb('0x39')]=_[_0xc9bb('0x38')](_0x51bc87[_0xc9bb('0x34')],qs[_0xc9bb('0x3a')](_0x13fa24[_0xc9bb('0x35')]['fields']));_0x270594[_0xc9bb('0x39')]=_0x270594['attributes'][_0xc9bb('0x3b')]?_0x270594[_0xc9bb('0x39')]:_0x51bc87[_0xc9bb('0x34')];if(_0x13fa24[_0xc9bb('0x35')]['includeAll']){_0x270594[_0xc9bb('0x44')]=[{'all':!![]}];}_0x270594=_[_0xc9bb('0x41')]({},_0x270594,_0x13fa24[_0xc9bb('0x48')]);return db[_0xc9bb('0x30')][_0xc9bb('0x49')](_0x270594)[_0xc9bb('0x2a')](handleEntityNotFound(_0x19dec4,null))[_0xc9bb('0x2a')](respondWithResult(_0x19dec4,null))[_0xc9bb('0x47')](handleError(_0x19dec4,null));};exports[_0xc9bb('0x4a')]=function(_0x36356b,_0x2a609d){return db[_0xc9bb('0x30')][_0xc9bb('0x4a')](_0x36356b[_0xc9bb('0x4b')],{})[_0xc9bb('0x2a')](respondWithResult(_0x2a609d,0xc9))[_0xc9bb('0x47')](handleError(_0x2a609d,null));};exports[_0xc9bb('0x29')]=function(_0x374edd,_0x33ad6c){if(_0x374edd[_0xc9bb('0x4b')]['id']){delete _0x374edd[_0xc9bb('0x4b')]['id'];}return db[_0xc9bb('0x30')]['find']({'where':{'id':_0x374edd[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x33ad6c,null))[_0xc9bb('0x2a')](saveUpdates(_0x374edd[_0xc9bb('0x4b')],null))[_0xc9bb('0x2a')](respondWithResult(_0x33ad6c,null))[_0xc9bb('0x47')](handleError(_0x33ad6c,null));};exports['destroy']=function(_0x5686ed,_0x46ef50){return db[_0xc9bb('0x30')][_0xc9bb('0x49')]({'where':{'id':_0x5686ed[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x46ef50,null))['then'](removeEntity(_0x46ef50,null))[_0xc9bb('0x47')](handleError(_0x46ef50,null));};exports[_0xc9bb('0x4d')]=function(_0x394ee0,_0x16dca8,_0x3d5155){var _0x1caa17={};var _0x884688={};var _0x1063fe;var _0x2a15d7;return db[_0xc9bb('0x30')][_0xc9bb('0x4e')]({'where':{'id':_0x394ee0[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x16dca8,null))[_0xc9bb('0x2a')](function(_0x9b53fa){if(_0x9b53fa){_0x1063fe=_0x9b53fa;_0x884688[_0xc9bb('0x34')]=_[_0xc9bb('0x36')](db[_0xc9bb('0x4f')][_0xc9bb('0x31')]);_0x884688[_0xc9bb('0x35')]=_['keys'](_0x394ee0[_0xc9bb('0x35')]);_0x884688['filters']=_[_0xc9bb('0x38')](_0x884688[_0xc9bb('0x34')],_0x884688[_0xc9bb('0x35')]);_0x1caa17['attributes']=_[_0xc9bb('0x38')](_0x884688[_0xc9bb('0x34')],qs[_0xc9bb('0x3a')](_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3a')]));_0x1caa17['attributes']=_0x1caa17[_0xc9bb('0x39')][_0xc9bb('0x3b')]?_0x1caa17['attributes']:_0x884688[_0xc9bb('0x34')];_0x1caa17[_0xc9bb('0x50')]=qs[_0xc9bb('0x3d')](_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3d')]);_0x1caa17[_0xc9bb('0x40')]=qs[_0xc9bb('0x37')](_[_0xc9bb('0x3e')](_0x394ee0['query'],_0x884688['filters']));if(_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3f')]){_0x1caa17[_0xc9bb('0x40')]=_[_0xc9bb('0x41')](_0x1caa17[_0xc9bb('0x40')],{'$or':_[_0xc9bb('0x2f')](_0x1caa17[_0xc9bb('0x39')],function(_0x569fcf){var _0x1ffdb9={};_0x1ffdb9[_0x569fcf]={'$like':'%'+_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3f')]+'%'};return _0x1ffdb9;})});}_0x1caa17=_[_0xc9bb('0x41')]({},_0x1caa17,_0x394ee0['options']);return _0x1063fe['getConfigurations'](_0x1caa17);}})[_0xc9bb('0x2a')](function(_0x136c70){if(_0x136c70){_0x2a15d7=_0x136c70[_0xc9bb('0x3b')];if(!_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x51')]('nolimit')){_0x1caa17[_0xc9bb('0x24')]=qs[_0xc9bb('0x24')](_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x24')]);_0x1caa17[_0xc9bb('0x22')]=qs['offset'](_0x394ee0[_0xc9bb('0x35')]['offset']);}return _0x1063fe['getConfigurations'](_0x1caa17);}})[_0xc9bb('0x2a')](function(_0x4d3334){if(_0x4d3334){return _0x4d3334?{'count':_0x2a15d7,'rows':_0x4d3334}:null;}})[_0xc9bb('0x2a')](respondWithResult(_0x16dca8,null))[_0xc9bb('0x47')](handleError(_0x16dca8,null));};exports[_0xc9bb('0x52')]=function(_0x5ee89b,_0x1cc5bd,_0x4199d8){if(_0x5ee89b['body']['id']){delete _0x5ee89b[_0xc9bb('0x4b')]['id'];}return db['FreshsalesAccount'][_0xc9bb('0x4e')]({'where':{'id':_0x5ee89b[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x1cc5bd,null))[_0xc9bb('0x2a')](function(_0x6d1b4e){if(_0x6d1b4e){_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x53')]=_0x6d1b4e['id'];_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x54')]=integrations['getSubjects'](_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x55')],_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x56')]);_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x57')]=integrations['getDescriptions'](_0x5ee89b['body'][_0xc9bb('0x55')],_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x56')]);return db[_0xc9bb('0x4f')]['create'](_0x5ee89b['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xc9bb('0x54')},{'model':db[_0xc9bb('0x58')],'as':_0xc9bb('0x57')}]});}return null;})[_0xc9bb('0x2a')](respondWithResult(_0x1cc5bd,null))['catch'](handleError(_0x1cc5bd,null));};exports[_0xc9bb('0x59')]=function(_0x14c5ba,_0x413a3d,_0x118dff){var _0x40f3b6='';var _0x3f2036='';return db[_0xc9bb('0x30')][_0xc9bb('0x4e')]({'where':{'id':_0x14c5ba['params']['id']},'attributes':['id',_0xc9bb('0x5a'),_0xc9bb('0x5b'),'apiKey']})[_0xc9bb('0x2a')](handleEntityNotFound(_0x413a3d,null))[_0xc9bb('0x2a')](function(_0x1d98fa){if(_0x1d98fa){_0x3f2036=_0x1d98fa['username'];_0x40f3b6=_0x1d98fa[_0xc9bb('0x5b')];var _0x166e5c=_0x1d98fa['remoteUri'][_0xc9bb('0x5c')](-0x1);if(_0x166e5c==='/'){_0x40f3b6=_0x40f3b6[_0xc9bb('0x5d')](0x0,_0x40f3b6[_0xc9bb('0x5e')](_0x166e5c));}return rp({'method':'GET','uri':util['format'](_0xc9bb('0x5f'),_0x40f3b6,'/api/selector/owners'),'headers':{'Authorization':_0xc9bb('0x60')+_0x1d98fa['apiKey']},'json':!![]});}})[_0xc9bb('0x2a')](function(_0x38d1b2){if(_0x38d1b2){var _0x3e1e56=_0x38d1b2[_0xc9bb('0x61')];var _0x51d5d0=![];var _0x3a686f=null;for(_0x3a686f=0x0;_0x3a686f<_0x3e1e56[_0xc9bb('0x3b')];_0x3a686f++){if(_0x3e1e56[_0x3a686f][_0xc9bb('0x62')]===_0x3f2036){_0x51d5d0=!![];}}if(_0x51d5d0){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xc9bb('0x2a')](respondWithResult(_0x413a3d,null))['catch'](function(_0x4cef4b){var _0x3ce521=_0x14c5ba[_0xc9bb('0x35')][_0xc9bb('0x63')]?0x1f4:_0x4cef4b[_0xc9bb('0x64')]||0x1f4;logger[_0xc9bb('0x65')](_0xc9bb('0x66'),_0xc9bb('0x59'),_0x3ce521,JSON['stringify'](_0x4cef4b));delete _0x4cef4b[_0xc9bb('0x2d')];if(_0x3ce521===0x191){_0x3ce521=0x190;}_0x413a3d[_0xc9bb('0x1f')](_0x3ce521)[_0xc9bb('0x2e')](_0x14c5ba['query'][_0xc9bb('0x63')]?{'message':_0xc9bb('0x67'),'statusCode':_0x4cef4b[_0xc9bb('0x64')]}:_0x4cef4b);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index a92e880..1010fee 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1b010d,_0x269e85){var _0x592866=function(_0x4b6008){while(--_0x4b6008){_0x1b010d['push'](_0x1b010d['shift']());}};_0x592866(++_0x269e85);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5d1de4,_0x4f8af9){_0x5d1de4=_0x5d1de4-0x0;var _0x3eede3=_0xa6b0[_0x5d1de4];return _0x3eede3;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xdb28,0x106));var _0x8db2=function(_0x2cb226,_0x15ea55){_0x2cb226=_0x2cb226-0x0;var _0x11f485=_0xdb28[_0x2cb226];return _0x11f485;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x8db2('0x9'));module[_0x8db2('0xa')]=function(_0x5f42ee,_0x494b40){return _0x5f42ee[_0x8db2('0xb')](_0x8db2('0xc'),attributes,{'tableName':_0x8db2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index ebe05fc..2c28675 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0adf=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','GetFreshsalesAccount','find','raw','ShowFreshsalesAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x27431c,_0x5d28a1){var _0x4bd29b=function(_0x3c1685){while(--_0x3c1685){_0x27431c['push'](_0x27431c['shift']());}};_0x4bd29b(++_0x5d28a1);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1a3914,_0x4ef4a3){_0x1a3914=_0x1a3914-0x0;var _0x42c036=_0x0adf[_0x1a3914];return _0x42c036;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0ad('0x3'));var fs=require('fs');var Redis=require(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var utils=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));var config=require(_0xf0ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eca0e,_0x44cf37,_0x170574){return new BPromise(function(_0x41c99d,_0xa9a315){return client[_0xf0ad('0xb')](_0x2eca0e,_0x170574)[_0xf0ad('0xc')](function(_0x5bdf69){logger[_0xf0ad('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x44cf37,_0xf0ad('0xe'));logger[_0xf0ad('0xf')](_0xf0ad('0x10'),_0x44cf37,_0xf0ad('0xe'),JSON[_0xf0ad('0x11')](_0x5bdf69));if(_0x5bdf69['error']){if(_0x5bdf69['error'][_0xf0ad('0x12')]===0x1f4){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x5bdf69[_0xf0ad('0x13')]['message']);return _0xa9a315(_0x5bdf69[_0xf0ad('0x13')][_0xf0ad('0x15')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x44cf37,_0x5bdf69['error'][_0xf0ad('0x15')]);return _0x41c99d(_0x5bdf69['error'][_0xf0ad('0x15')]);}else{logger[_0xf0ad('0xd')](_0xf0ad('0x14'),_0x44cf37,_0xf0ad('0xe'));_0x41c99d(_0x5bdf69[_0xf0ad('0x16')]['message']);}})[_0xf0ad('0x17')](function(_0x285ab0){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x285ab0);_0xa9a315(_0x285ab0);});});}exports['GetFreshsalesAccount']=function(_0x4e9970){var _0x2466e8=this;return new Promise(function(_0x46fb20,_0x49f2ec){return db[_0xf0ad('0x18')][_0xf0ad('0x19')]({'raw':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970[_0xf0ad('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4e9970['options']?_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1b')]||null:null,'attributes':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1c')]||null:null,'limit':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970['options'][_0xf0ad('0x1d')]||null:null,'include':_0x4e9970[_0xf0ad('0x1a')]?_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x4e9970[_0xf0ad('0x1a')][_0xf0ad('0x1e')],function(_0x276322){return{'model':db[_0x276322[_0xf0ad('0x20')]],'as':_0x276322['as'],'attributes':_0x276322[_0xf0ad('0x1c')],'include':_0x276322[_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x276322[_0xf0ad('0x1e')],function(_0x456f81){return{'model':db[_0x456f81[_0xf0ad('0x20')]],'as':_0x456f81['as'],'attributes':_0x456f81['attributes'],'include':_0x456f81[_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x456f81[_0xf0ad('0x1e')],function(_0x7377d7){return{'model':db[_0x7377d7[_0xf0ad('0x20')]],'as':_0x7377d7['as'],'attributes':_0x7377d7[_0xf0ad('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cbe00){logger[_0xf0ad('0xd')](_0xf0ad('0x21'),_0x4e9970);logger[_0xf0ad('0xf')](_0xf0ad('0x21'),_0x4e9970,JSON[_0xf0ad('0x11')](_0x2cbe00));_0x46fb20(_0x2cbe00);})[_0xf0ad('0x17')](function(_0x1bee71){logger[_0xf0ad('0x13')](_0xf0ad('0x21'),_0x1bee71[_0xf0ad('0x15')],_0x4e9970);_0x49f2ec(_0x2466e8['error'](0x1f4,_0x1bee71[_0xf0ad('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x83f211){var _0x57a1f3=this;return new Promise(function(_0x25ed0b,_0x320174){return db[_0xf0ad('0x18')][_0xf0ad('0x22')]({'raw':_0x83f211[_0xf0ad('0x1a')]?_0x83f211[_0xf0ad('0x1a')][_0xf0ad('0x23')]===undefined?!![]:![]:!![],'where':_0x83f211[_0xf0ad('0x1a')]?_0x83f211['options']['where']||null:null,'attributes':_0x83f211[_0xf0ad('0x1a')]?_0x83f211[_0xf0ad('0x1a')][_0xf0ad('0x1c')]||null:null,'include':_0x83f211[_0xf0ad('0x1a')]?_0x83f211['options'][_0xf0ad('0x1e')]?_['map'](_0x83f211[_0xf0ad('0x1a')]['include'],function(_0x4136b9){return{'model':db[_0x4136b9['model']],'as':_0x4136b9['as'],'attributes':_0x4136b9[_0xf0ad('0x1c')],'include':_0x4136b9[_0xf0ad('0x1e')]?_[_0xf0ad('0x1f')](_0x4136b9[_0xf0ad('0x1e')],function(_0x42f87f){return{'model':db[_0x42f87f[_0xf0ad('0x20')]],'as':_0x42f87f['as'],'attributes':_0x42f87f[_0xf0ad('0x1c')],'include':_0x42f87f[_0xf0ad('0x1e')]?_['map'](_0x42f87f[_0xf0ad('0x1e')],function(_0x54b59d){return{'model':db[_0x54b59d[_0xf0ad('0x20')]],'as':_0x54b59d['as'],'attributes':_0x54b59d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0ad('0xc')](function(_0x25246b){logger[_0xf0ad('0xd')](_0xf0ad('0x24'),_0x83f211);logger[_0xf0ad('0xf')]('ShowFreshsalesAccount',_0x83f211,JSON[_0xf0ad('0x11')](_0x25246b));_0x25ed0b(_0x25246b);})[_0xf0ad('0x17')](function(_0x1d57d1){logger[_0xf0ad('0x13')](_0xf0ad('0x24'),_0x1d57d1[_0xf0ad('0x15')],_0x83f211);_0x320174(_0x57a1f3[_0xf0ad('0x13')](0x1f4,_0x1d57d1['message']));});});}; \ No newline at end of file +var _0xb016=['include','model','debug','ShowFreshsalesAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xb016,0x159));var _0x6b01=function(_0x234e0e,_0x344b33){_0x234e0e=_0x234e0e-0x0;var _0x22dae2=_0xb016[_0x234e0e];return _0x22dae2;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')]({'raw':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x18')]===undefined?!![]:![]:!![],'where':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x19')]||null:null,'attributes':_0x9c6571['options']?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1a')]||null:null,'limit':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1b')]||null:null,'include':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')]['include']?_[_0x6b01('0x1c')](_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1d')],function(_0x51243c){return{'model':db[_0x51243c[_0x6b01('0x1e')]],'as':_0x51243c['as'],'attributes':_0x51243c[_0x6b01('0x1a')],'include':_0x51243c[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x51243c[_0x6b01('0x1d')],function(_0x2456e9){return{'model':db[_0x2456e9[_0x6b01('0x1e')]],'as':_0x2456e9['as'],'attributes':_0x2456e9[_0x6b01('0x1a')],'include':_0x2456e9[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x2456e9[_0x6b01('0x1d')],function(_0xa846d8){return{'model':db[_0xa846d8[_0x6b01('0x1e')]],'as':_0xa846d8['as'],'attributes':_0xa846d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b01('0xa')](function(_0x220efb){logger[_0x6b01('0xb')](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1f')]('GetFreshsalesAccount',_0x9c6571,JSON['stringify'](_0x220efb));_0x18f336(_0x220efb);})[_0x6b01('0x13')](function(_0x3df3d4){logger[_0x6b01('0xf')](_0x6b01('0x14'),_0x3df3d4[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x3df3d4['message']));});});};exports[_0x6b01('0x20')]=function(_0x5482a8){var _0x3942d7=this;return new Promise(function(_0x4e7e32,_0x6920cf){return db[_0x6b01('0x15')][_0x6b01('0x21')]({'raw':_0x5482a8[_0x6b01('0x17')]?_0x5482a8[_0x6b01('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5482a8[_0x6b01('0x17')]?_0x5482a8[_0x6b01('0x17')][_0x6b01('0x19')]||null:null,'attributes':_0x5482a8['options']?_0x5482a8['options'][_0x6b01('0x1a')]||null:null,'include':_0x5482a8['options']?_0x5482a8[_0x6b01('0x17')][_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x5482a8['options'][_0x6b01('0x1d')],function(_0x42d5f7){return{'model':db[_0x42d5f7[_0x6b01('0x1e')]],'as':_0x42d5f7['as'],'attributes':_0x42d5f7['attributes'],'include':_0x42d5f7[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x42d5f7[_0x6b01('0x1d')],function(_0x2eb34f){return{'model':db[_0x2eb34f[_0x6b01('0x1e')]],'as':_0x2eb34f['as'],'attributes':_0x2eb34f['attributes'],'include':_0x2eb34f[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x2eb34f[_0x6b01('0x1d')],function(_0x5269c7){return{'model':db[_0x5269c7[_0x6b01('0x1e')]],'as':_0x5269c7['as'],'attributes':_0x5269c7[_0x6b01('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6b01('0xa')](function(_0x3154d7){logger['info'](_0x6b01('0x20'),_0x5482a8);logger['debug'](_0x6b01('0x20'),_0x5482a8,JSON[_0x6b01('0xe')](_0x3154d7));_0x4e7e32(_0x3154d7);})[_0x6b01('0x13')](function(_0x318b8b){logger[_0x6b01('0xf')](_0x6b01('0x20'),_0x318b8b[_0x6b01('0x11')],_0x5482a8);_0x6920cf(_0x3942d7['error'](0x1f4,_0x318b8b[_0x6b01('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 507b0c0..d3dc0f0 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fdd=['isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x184aaf,_0x428d34){var _0x40ca04=function(_0xc035d7){while(--_0xc035d7){_0x184aaf['push'](_0x184aaf['shift']());}};_0x40ca04(++_0x428d34);}(_0x0fdd,0x150));var _0xd0fd=function(_0x4c636b,_0x15b6ea){_0x4c636b=_0x4c636b-0x0;var _0x207e67=_0x0fdd[_0x4c636b];return _0x207e67;};'use strict';var multer=require(_0xd0fd('0x0'));var util=require(_0xd0fd('0x1'));var path=require(_0xd0fd('0x2'));var timeout=require(_0xd0fd('0x3'));var express=require('express');var router=express[_0xd0fd('0x4')]();var fs_extra=require(_0xd0fd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0fd('0x6'));var config=require(_0xd0fd('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xd0fd('0x8')]('/',auth[_0xd0fd('0x9')](),controller[_0xd0fd('0xa')]);router[_0xd0fd('0x8')](_0xd0fd('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd0fd('0x8')](_0xd0fd('0xc'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0xd')]);router[_0xd0fd('0x8')](_0xd0fd('0xe'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0xf')]);router[_0xd0fd('0x8')](_0xd0fd('0x10'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0x11')]);router[_0xd0fd('0x12')]('/',auth[_0xd0fd('0x9')](),controller['create']);router[_0xd0fd('0x13')](_0xd0fd('0xb'),auth[_0xd0fd('0x9')](),controller['update']);router[_0xd0fd('0x14')](_0xd0fd('0xb'),auth[_0xd0fd('0x9')](),controller[_0xd0fd('0x15')]);module[_0xd0fd('0x16')]=router; \ No newline at end of file +var _0xdf06=['create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post'];(function(_0x4a5b14,_0x239ab9){var _0x2c1cb1=function(_0x22078d){while(--_0x22078d){_0x4a5b14['push'](_0x4a5b14['shift']());}};_0x2c1cb1(++_0x239ab9);}(_0xdf06,0xb5));var _0x6df0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xdf06[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x6df0('0x0'));var util=require('util');var path=require(_0x6df0('0x1'));var timeout=require('connect-timeout');var express=require(_0x6df0('0x2'));var router=express[_0x6df0('0x3')]();var fs_extra=require(_0x6df0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6df0('0x5'));var config=require(_0x6df0('0x6'));var controller=require(_0x6df0('0x7'));router[_0x6df0('0x8')]('/',auth[_0x6df0('0x9')](),controller[_0x6df0('0xa')]);router[_0x6df0('0x8')](_0x6df0('0xb'),auth[_0x6df0('0x9')](),controller[_0x6df0('0xc')]);router[_0x6df0('0x8')](_0x6df0('0xd'),auth[_0x6df0('0x9')](),controller[_0x6df0('0xe')]);router[_0x6df0('0x8')](_0x6df0('0xf'),auth['isAuthenticated'](),controller[_0x6df0('0x10')]);router[_0x6df0('0x8')]('/:id/fields',auth[_0x6df0('0x9')](),controller[_0x6df0('0x11')]);router[_0x6df0('0x12')]('/',auth['isAuthenticated'](),controller[_0x6df0('0x13')]);router[_0x6df0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6df0('0x15')]);router[_0x6df0('0x16')]('/:id',auth[_0x6df0('0x9')](),controller[_0x6df0('0x17')]);module[_0x6df0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index ddeb106..7aee2ec 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x905f=['sequelize','STRING'];(function(_0x4e1dd8,_0x4425ae){var _0x1aa2f5=function(_0x5b67ac){while(--_0x5b67ac){_0x4e1dd8['push'](_0x4e1dd8['shift']());}};_0x1aa2f5(++_0x4425ae);}(_0x905f,0x9c));var _0xf905=function(_0x3438fb,_0xde4967){_0x3438fb=_0x3438fb-0x0;var _0x2606b1=_0x905f[_0x3438fb];return _0x2606b1;};'use strict';var Sequelize=require(_0xf905('0x0'));module['exports']={'name':{'type':Sequelize[_0xf905('0x1')]},'description':{'type':Sequelize[_0xf905('0x1')]}}; \ No newline at end of file +var _0xaabd=['STRING','sequelize'];(function(_0xd990,_0x558eba){var _0x5a827b=function(_0x2e8cb1){while(--_0x2e8cb1){_0xd990['push'](_0xd990['shift']());}};_0x5a827b(++_0x558eba);}(_0xaabd,0xf7));var _0xdaab=function(_0x4152fb,_0x382ecb){_0x4152fb=_0x4152fb-0x0;var _0x53b04d=_0xaabd[_0x4152fb];return _0x53b04d;};'use strict';var Sequelize=require(_0xdaab('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaab('0x1')]},'description':{'type':Sequelize[_0xdaab('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0bbe980..54c8cb1 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1239=['find','create','update','body','getSubjects','findOne','FreshsalesField','order','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','intersection','include'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x1239,0xad));var _0x9123=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1239[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9123('0x0'));var rimraf=require(_0x9123('0x1'));var zipdir=require(_0x9123('0x2'));var jsonpatch=require(_0x9123('0x3'));var rp=require('request-promise');var moment=require(_0x9123('0x4'));var BPromise=require(_0x9123('0x5'));var Mustache=require(_0x9123('0x6'));var util=require(_0x9123('0x7'));var path=require(_0x9123('0x8'));var sox=require('sox');var csv=require(_0x9123('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9123('0xa'));var _=require(_0x9123('0xb'));var squel=require(_0x9123('0xc'));var crypto=require(_0x9123('0xd'));var jsforce=require(_0x9123('0xe'));var deskjs=require(_0x9123('0xf'));var toCsv=require(_0x9123('0x9'));var querystring=require(_0x9123('0x10'));var Papa=require(_0x9123('0x11'));var Redis=require('ioredis');var authService=require(_0x9123('0x12'));var qs=require(_0x9123('0x13'));var as=require(_0x9123('0x14'));var hardwareService=require(_0x9123('0x15'));var logger=require('../../config/logger')(_0x9123('0x16'));var utils=require(_0x9123('0x17'));var config=require(_0x9123('0x18'));var licenseUtil=require(_0x9123('0x19'));var db=require(_0x9123('0x1a'))['db'];function respondWithStatusCode(_0x1e8ebd,_0x219fb3){_0x219fb3=_0x219fb3||0xcc;return function(_0x440292){if(_0x440292){return _0x1e8ebd[_0x9123('0x1b')](_0x219fb3);}return _0x1e8ebd[_0x9123('0x1c')](_0x219fb3)[_0x9123('0x1d')]();};}function respondWithResult(_0x3b5613,_0x522a3d){_0x522a3d=_0x522a3d||0xc8;return function(_0x29b781){if(_0x29b781){return _0x3b5613[_0x9123('0x1c')](_0x522a3d)['json'](_0x29b781);}};}function respondWithFilteredResult(_0x3ce565,_0x5ebac6){return function(_0xa28836){if(_0xa28836){var _0x288c7d=typeof _0x5ebac6[_0x9123('0x1e')]===_0x9123('0x1f')&&typeof _0x5ebac6[_0x9123('0x20')]===_0x9123('0x1f');var _0x29f25a=_0xa28836['count'];var _0x1fd2d3=_0x288c7d?0x0:_0x5ebac6[_0x9123('0x1e')];var _0x2ac0e1=_0x288c7d?_0xa28836[_0x9123('0x21')]:_0x5ebac6[_0x9123('0x1e')]+_0x5ebac6[_0x9123('0x20')];var _0x487cfc;if(_0x2ac0e1>=_0x29f25a){_0x2ac0e1=_0x29f25a;_0x487cfc=0xc8;}else{_0x487cfc=0xce;}_0x3ce565[_0x9123('0x1c')](_0x487cfc);return _0x3ce565[_0x9123('0x22')]('Content-Range',_0x1fd2d3+'-'+_0x2ac0e1+'/'+_0x29f25a)['json'](_0xa28836);}return null;};}function patchUpdates(_0x41aa4c){return function(_0x1e8b1a){try{jsonpatch[_0x9123('0x23')](_0x1e8b1a,_0x41aa4c,!![]);}catch(_0x33fefe){return BPromise[_0x9123('0x24')](_0x33fefe);}return _0x1e8b1a['save']();};}function saveUpdates(_0x4dce78,_0x5311a3){return function(_0x31390c){if(_0x31390c){return _0x31390c['update'](_0x4dce78)[_0x9123('0x25')](function(_0x3adc76){return _0x3adc76;});}return null;};}function removeEntity(_0x16742,_0x19bcf3){return function(_0x95ab80){if(_0x95ab80){return _0x95ab80[_0x9123('0x26')]()[_0x9123('0x25')](function(){_0x16742['status'](0xcc)[_0x9123('0x1d')]();});}};}function handleEntityNotFound(_0x2b8cb4,_0x15e56d){return function(_0x235efe){if(!_0x235efe){_0x2b8cb4['sendStatus'](0x194);}return _0x235efe;};}function handleError(_0xa0b4aa,_0x3e9519){_0x3e9519=_0x3e9519||0x1f4;return function(_0x3c58db){logger[_0x9123('0x27')](_0x3c58db['stack']);if(_0x3c58db[_0x9123('0x28')]){delete _0x3c58db[_0x9123('0x28')];}_0xa0b4aa['status'](_0x3e9519)[_0x9123('0x29')](_0x3c58db);};}exports[_0x9123('0x2a')]=function(_0x498894,_0x59718a){var _0x4bb5c6={},_0x147bec={},_0x48d7ae={'count':0x0,'rows':[]};var _0x5a5b78=_[_0x9123('0x2b')](db[_0x9123('0x2c')][_0x9123('0x2d')],function(_0x43a8d4){return{'name':_0x43a8d4[_0x9123('0x2e')],'type':_0x43a8d4[_0x9123('0x2f')]['key']};});_0x147bec[_0x9123('0x30')]=_['map'](_0x5a5b78,_0x9123('0x28'));_0x147bec[_0x9123('0x31')]=_[_0x9123('0x32')](_0x498894[_0x9123('0x31')]);_0x147bec[_0x9123('0x33')]=_['intersection'](_0x147bec['model'],_0x147bec[_0x9123('0x31')]);_0x4bb5c6[_0x9123('0x34')]=_['intersection'](_0x147bec['model'],qs[_0x9123('0x35')](_0x498894[_0x9123('0x31')]['fields']));_0x4bb5c6[_0x9123('0x34')]=_0x4bb5c6['attributes'][_0x9123('0x36')]?_0x4bb5c6[_0x9123('0x34')]:_0x147bec['model'];if(!_0x498894[_0x9123('0x31')][_0x9123('0x37')](_0x9123('0x38'))){_0x4bb5c6['limit']=qs[_0x9123('0x20')](_0x498894[_0x9123('0x31')][_0x9123('0x20')]);_0x4bb5c6[_0x9123('0x1e')]=qs['offset'](_0x498894[_0x9123('0x31')][_0x9123('0x1e')]);}_0x4bb5c6['order']=qs[_0x9123('0x39')](_0x498894[_0x9123('0x31')]['sort']);_0x4bb5c6[_0x9123('0x3a')]=qs[_0x9123('0x33')](_['pick'](_0x498894[_0x9123('0x31')],_0x147bec['filters']),_0x5a5b78);if(_0x498894['query'][_0x9123('0x3b')]){_0x4bb5c6[_0x9123('0x3a')]=_[_0x9123('0x3c')](_0x4bb5c6[_0x9123('0x3a')],{'$or':_[_0x9123('0x2b')](_0x5a5b78,function(_0x58039e){if(_0x58039e['type']!==_0x9123('0x3d')){var _0xcb50c6={};_0xcb50c6[_0x58039e['name']]={'$like':'%'+_0x498894[_0x9123('0x31')][_0x9123('0x3b')]+'%'};return _0xcb50c6;}})});}_0x4bb5c6=_[_0x9123('0x3c')]({},_0x4bb5c6,_0x498894[_0x9123('0x3e')]);var _0x52ff12={'where':_0x4bb5c6[_0x9123('0x3a')]};return db[_0x9123('0x2c')][_0x9123('0x21')](_0x52ff12)[_0x9123('0x25')](function(_0x310b4){_0x48d7ae['count']=_0x310b4;if(_0x498894['query'][_0x9123('0x3f')]){_0x4bb5c6['include']=[{'all':!![]}];}return db[_0x9123('0x2c')][_0x9123('0x40')](_0x4bb5c6);})[_0x9123('0x25')](function(_0x14b2e3){_0x48d7ae['rows']=_0x14b2e3;return _0x48d7ae;})[_0x9123('0x25')](respondWithFilteredResult(_0x59718a,_0x4bb5c6))[_0x9123('0x41')](handleError(_0x59718a,null));};exports[_0x9123('0x42')]=function(_0x4ce394,_0x67b00c){var _0x23571b={'raw':![],'where':{'id':_0x4ce394[_0x9123('0x43')]['id']}},_0x2c119f={};_0x2c119f[_0x9123('0x30')]=_[_0x9123('0x32')](db['FreshsalesConfiguration']['rawAttributes']);_0x2c119f[_0x9123('0x31')]=_[_0x9123('0x32')](_0x4ce394[_0x9123('0x31')]);_0x2c119f[_0x9123('0x33')]=_['intersection'](_0x2c119f[_0x9123('0x30')],_0x2c119f['query']);_0x23571b[_0x9123('0x34')]=_[_0x9123('0x44')](_0x2c119f[_0x9123('0x30')],qs['fields'](_0x4ce394[_0x9123('0x31')][_0x9123('0x35')]));_0x23571b['attributes']=_0x23571b['attributes'][_0x9123('0x36')]?_0x23571b['attributes']:_0x2c119f[_0x9123('0x30')];if(_0x4ce394[_0x9123('0x31')][_0x9123('0x3f')]){_0x23571b[_0x9123('0x45')]=[{'all':!![]}];}_0x23571b=_[_0x9123('0x3c')]({},_0x23571b,_0x4ce394[_0x9123('0x3e')]);return db[_0x9123('0x2c')][_0x9123('0x46')](_0x23571b)['then'](handleEntityNotFound(_0x67b00c,null))['then'](respondWithResult(_0x67b00c,null))[_0x9123('0x41')](handleError(_0x67b00c,null));};exports[_0x9123('0x47')]=function(_0x5a988d,_0x1f15b6){return db[_0x9123('0x2c')][_0x9123('0x47')](_0x5a988d['body'],{})[_0x9123('0x25')](respondWithResult(_0x1f15b6,0xc9))['catch'](handleError(_0x1f15b6,null));};exports[_0x9123('0x48')]=function(_0x25e8f5,_0x2c78b9){if(_0x25e8f5[_0x9123('0x49')]['id']){delete _0x25e8f5['body']['id'];}return db[_0x9123('0x2c')][_0x9123('0x46')]({'where':{'id':_0x25e8f5[_0x9123('0x43')]['id']}})[_0x9123('0x25')](handleEntityNotFound(_0x2c78b9,null))[_0x9123('0x25')](saveUpdates(_0x25e8f5['body'],null))[_0x9123('0x25')](respondWithResult(_0x2c78b9,null))[_0x9123('0x41')](handleError(_0x2c78b9,null));};exports['destroy']=function(_0x1f7dec,_0x4bb40a){return db[_0x9123('0x2c')][_0x9123('0x46')]({'where':{'id':_0x1f7dec['params']['id']}})[_0x9123('0x25')](handleEntityNotFound(_0x4bb40a,null))[_0x9123('0x25')](removeEntity(_0x4bb40a,null))[_0x9123('0x41')](handleError(_0x4bb40a,null));};exports[_0x9123('0x4a')]=function(_0xf48677,_0x308e9b,_0x57ef76){var _0x44c6e4={};var _0x5beb88={};var _0x4af1f1;var _0x435a7b;return db['FreshsalesConfiguration'][_0x9123('0x4b')]({'where':{'id':_0xf48677[_0x9123('0x43')]['id']}})['then'](handleEntityNotFound(_0x308e9b,null))[_0x9123('0x25')](function(_0x98c4d8){if(_0x98c4d8){_0x4af1f1=_0x98c4d8;_0x5beb88['model']=_[_0x9123('0x32')](db[_0x9123('0x4c')]['rawAttributes']);_0x5beb88[_0x9123('0x31')]=_['keys'](_0xf48677['query']);_0x5beb88['filters']=_['intersection'](_0x5beb88[_0x9123('0x30')],_0x5beb88[_0x9123('0x31')]);_0x44c6e4[_0x9123('0x34')]=_[_0x9123('0x44')](_0x5beb88['model'],qs['fields'](_0xf48677[_0x9123('0x31')][_0x9123('0x35')]));_0x44c6e4['attributes']=_0x44c6e4['attributes']['length']?_0x44c6e4[_0x9123('0x34')]:_0x5beb88[_0x9123('0x30')];_0x44c6e4[_0x9123('0x4d')]=qs[_0x9123('0x39')](_0xf48677[_0x9123('0x31')][_0x9123('0x39')]);_0x44c6e4[_0x9123('0x3a')]=qs[_0x9123('0x33')](_['pick'](_0xf48677[_0x9123('0x31')],_0x5beb88[_0x9123('0x33')]));if(_0xf48677[_0x9123('0x31')][_0x9123('0x3b')]){_0x44c6e4[_0x9123('0x3a')]=_['merge'](_0x44c6e4[_0x9123('0x3a')],{'$or':_[_0x9123('0x2b')](_0x44c6e4['attributes'],function(_0x2dd18e){var _0x30d17f={};_0x30d17f[_0x2dd18e]={'$like':'%'+_0xf48677[_0x9123('0x31')][_0x9123('0x3b')]+'%'};return _0x30d17f;})});}_0x44c6e4=_['merge']({},_0x44c6e4,_0xf48677[_0x9123('0x3e')]);return _0x4af1f1['getSubjects'](_0x44c6e4);}})[_0x9123('0x25')](function(_0x22a6c2){if(_0x22a6c2){_0x435a7b=_0x22a6c2['length'];if(!_0xf48677['query']['hasOwnProperty'](_0x9123('0x38'))){_0x44c6e4['limit']=qs[_0x9123('0x20')](_0xf48677[_0x9123('0x31')][_0x9123('0x20')]);_0x44c6e4['offset']=qs['offset'](_0xf48677['query'][_0x9123('0x1e')]);}return _0x4af1f1[_0x9123('0x4a')](_0x44c6e4);}})['then'](function(_0x486668){if(_0x486668){return _0x486668?{'count':_0x435a7b,'rows':_0x486668}:null;}})[_0x9123('0x25')](respondWithResult(_0x308e9b,null))[_0x9123('0x41')](handleError(_0x308e9b,null));};exports[_0x9123('0x4e')]=function(_0xfa7f3b,_0x8d7ca4,_0x3c0386){var _0x440174={};var _0xf0533c={};var _0x51dfce;var _0x4bcca9;return db[_0x9123('0x2c')][_0x9123('0x4b')]({'where':{'id':_0xfa7f3b[_0x9123('0x43')]['id']}})[_0x9123('0x25')](handleEntityNotFound(_0x8d7ca4,null))[_0x9123('0x25')](function(_0x465cd7){if(_0x465cd7){_0x51dfce=_0x465cd7;_0xf0533c[_0x9123('0x30')]=_['keys'](db[_0x9123('0x4c')][_0x9123('0x2d')]);_0xf0533c['query']=_['keys'](_0xfa7f3b[_0x9123('0x31')]);_0xf0533c[_0x9123('0x33')]=_[_0x9123('0x44')](_0xf0533c[_0x9123('0x30')],_0xf0533c[_0x9123('0x31')]);_0x440174['attributes']=_['intersection'](_0xf0533c['model'],qs[_0x9123('0x35')](_0xfa7f3b[_0x9123('0x31')][_0x9123('0x35')]));_0x440174[_0x9123('0x34')]=_0x440174['attributes'][_0x9123('0x36')]?_0x440174[_0x9123('0x34')]:_0xf0533c['model'];_0x440174[_0x9123('0x4d')]=qs['sort'](_0xfa7f3b[_0x9123('0x31')][_0x9123('0x39')]);_0x440174[_0x9123('0x3a')]=qs[_0x9123('0x33')](_[_0x9123('0x4f')](_0xfa7f3b[_0x9123('0x31')],_0xf0533c[_0x9123('0x33')]));if(_0xfa7f3b['query'][_0x9123('0x3b')]){_0x440174[_0x9123('0x3a')]=_[_0x9123('0x3c')](_0x440174['where'],{'$or':_[_0x9123('0x2b')](_0x440174[_0x9123('0x34')],function(_0xdbbad1){var _0x10a8e7={};_0x10a8e7[_0xdbbad1]={'$like':'%'+_0xfa7f3b['query'][_0x9123('0x3b')]+'%'};return _0x10a8e7;})});}_0x440174=_[_0x9123('0x3c')]({},_0x440174,_0xfa7f3b['options']);return _0x51dfce[_0x9123('0x4e')](_0x440174);}})[_0x9123('0x25')](function(_0x1586ee){if(_0x1586ee){_0x4bcca9=_0x1586ee['length'];if(!_0xfa7f3b[_0x9123('0x31')][_0x9123('0x37')]('nolimit')){_0x440174['limit']=qs[_0x9123('0x20')](_0xfa7f3b['query']['limit']);_0x440174['offset']=qs[_0x9123('0x1e')](_0xfa7f3b[_0x9123('0x31')][_0x9123('0x1e')]);}return _0x51dfce[_0x9123('0x4e')](_0x440174);}})['then'](function(_0x38b9d2){if(_0x38b9d2){return _0x38b9d2?{'count':_0x4bcca9,'rows':_0x38b9d2}:null;}})[_0x9123('0x25')](respondWithResult(_0x8d7ca4,null))[_0x9123('0x41')](handleError(_0x8d7ca4,null));};exports[_0x9123('0x50')]=function(_0x4060ba,_0x26655d,_0x37ff6b){var _0x3279ee={};var _0x11c30c={};var _0x536818;var _0x458219;return db[_0x9123('0x2c')][_0x9123('0x4b')]({'where':{'id':_0x4060ba[_0x9123('0x43')]['id']}})[_0x9123('0x25')](handleEntityNotFound(_0x26655d,null))[_0x9123('0x25')](function(_0x5e98bd){if(_0x5e98bd){_0x536818=_0x5e98bd;_0x11c30c[_0x9123('0x30')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x11c30c[_0x9123('0x31')]=_[_0x9123('0x32')](_0x4060ba[_0x9123('0x31')]);_0x11c30c[_0x9123('0x33')]=_['intersection'](_0x11c30c[_0x9123('0x30')],_0x11c30c[_0x9123('0x31')]);_0x3279ee[_0x9123('0x34')]=_['intersection'](_0x11c30c[_0x9123('0x30')],qs[_0x9123('0x35')](_0x4060ba[_0x9123('0x31')]['fields']));_0x3279ee[_0x9123('0x34')]=_0x3279ee[_0x9123('0x34')][_0x9123('0x36')]?_0x3279ee['attributes']:_0x11c30c[_0x9123('0x30')];_0x3279ee[_0x9123('0x4d')]=qs[_0x9123('0x39')](_0x4060ba[_0x9123('0x31')][_0x9123('0x39')]);_0x3279ee['where']=qs[_0x9123('0x33')](_[_0x9123('0x4f')](_0x4060ba[_0x9123('0x31')],_0x11c30c[_0x9123('0x33')]));if(_0x4060ba[_0x9123('0x31')][_0x9123('0x3b')]){_0x3279ee[_0x9123('0x3a')]=_['merge'](_0x3279ee[_0x9123('0x3a')],{'$or':_[_0x9123('0x2b')](_0x3279ee[_0x9123('0x34')],function(_0x425ff3){var _0xfe385b={};_0xfe385b[_0x425ff3]={'$like':'%'+_0x4060ba['query'][_0x9123('0x3b')]+'%'};return _0xfe385b;})});}_0x3279ee=_['merge']({},_0x3279ee,_0x4060ba[_0x9123('0x3e')]);return _0x536818[_0x9123('0x50')](_0x3279ee);}})[_0x9123('0x25')](function(_0x400e06){if(_0x400e06){_0x458219=_0x400e06[_0x9123('0x36')];if(!_0x4060ba[_0x9123('0x31')][_0x9123('0x37')]('nolimit')){_0x3279ee['limit']=qs[_0x9123('0x20')](_0x4060ba[_0x9123('0x31')][_0x9123('0x20')]);_0x3279ee[_0x9123('0x1e')]=qs[_0x9123('0x1e')](_0x4060ba[_0x9123('0x31')][_0x9123('0x1e')]);}return _0x536818[_0x9123('0x50')](_0x3279ee);}})[_0x9123('0x25')](function(_0x2c7de3){if(_0x2c7de3){return _0x2c7de3?{'count':_0x458219,'rows':_0x2c7de3}:null;}})[_0x9123('0x25')](respondWithResult(_0x26655d,null))[_0x9123('0x41')](handleError(_0x26655d,null));}; \ No newline at end of file +var _0x0267=['error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','find','create','body','params','getSubjects','findOne','keys','getDescriptions','getFields','FreshsalesField','order','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','end'];(function(_0x456f95,_0x27b85d){var _0x214fe7=function(_0xf1dbcc){while(--_0xf1dbcc){_0x456f95['push'](_0x456f95['shift']());}};_0x214fe7(++_0x27b85d);}(_0x0267,0x17c));var _0x7026=function(_0x31ccfc,_0x57c7b8){_0x31ccfc=_0x31ccfc-0x0;var _0x3e312f=_0x0267[_0x31ccfc];return _0x3e312f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7026('0x0'));var zipdir=require(_0x7026('0x1'));var jsonpatch=require(_0x7026('0x2'));var rp=require('request-promise');var moment=require(_0x7026('0x3'));var BPromise=require(_0x7026('0x4'));var Mustache=require(_0x7026('0x5'));var util=require(_0x7026('0x6'));var path=require(_0x7026('0x7'));var sox=require(_0x7026('0x8'));var csv=require(_0x7026('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7026('0xa'));var _=require(_0x7026('0xb'));var squel=require(_0x7026('0xc'));var crypto=require(_0x7026('0xd'));var jsforce=require(_0x7026('0xe'));var deskjs=require(_0x7026('0xf'));var toCsv=require(_0x7026('0x9'));var querystring=require(_0x7026('0x10'));var Papa=require(_0x7026('0x11'));var Redis=require(_0x7026('0x12'));var authService=require(_0x7026('0x13'));var qs=require(_0x7026('0x14'));var as=require(_0x7026('0x15'));var hardwareService=require(_0x7026('0x16'));var logger=require(_0x7026('0x17'))(_0x7026('0x18'));var utils=require(_0x7026('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7026('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386a1f,_0x1f9b86){_0x1f9b86=_0x1f9b86||0xcc;return function(_0x46f0e1){if(_0x46f0e1){return _0x386a1f[_0x7026('0x1b')](_0x1f9b86);}return _0x386a1f[_0x7026('0x1c')](_0x1f9b86)['end']();};}function respondWithResult(_0x4dbcb9,_0xa195fb){_0xa195fb=_0xa195fb||0xc8;return function(_0x5c42f8){if(_0x5c42f8){return _0x4dbcb9['status'](_0xa195fb)[_0x7026('0x1d')](_0x5c42f8);}};}function respondWithFilteredResult(_0x4718c4,_0x463f4b){return function(_0x5294db){if(_0x5294db){var _0x2b6011=typeof _0x463f4b[_0x7026('0x1e')]===_0x7026('0x1f')&&typeof _0x463f4b['limit']===_0x7026('0x1f');var _0x40e4ae=_0x5294db['count'];var _0x4b5e45=_0x2b6011?0x0:_0x463f4b[_0x7026('0x1e')];var _0x45009c=_0x2b6011?_0x5294db['count']:_0x463f4b[_0x7026('0x1e')]+_0x463f4b[_0x7026('0x20')];var _0x5ea910;if(_0x45009c>=_0x40e4ae){_0x45009c=_0x40e4ae;_0x5ea910=0xc8;}else{_0x5ea910=0xce;}_0x4718c4[_0x7026('0x1c')](_0x5ea910);return _0x4718c4['set'](_0x7026('0x21'),_0x4b5e45+'-'+_0x45009c+'/'+_0x40e4ae)[_0x7026('0x1d')](_0x5294db);}return null;};}function patchUpdates(_0x3da1b4){return function(_0x200cbc){try{jsonpatch[_0x7026('0x22')](_0x200cbc,_0x3da1b4,!![]);}catch(_0x373101){return BPromise['reject'](_0x373101);}return _0x200cbc[_0x7026('0x23')]();};}function saveUpdates(_0x1da6f9,_0x5cb29b){return function(_0x741e8d){if(_0x741e8d){return _0x741e8d[_0x7026('0x24')](_0x1da6f9)[_0x7026('0x25')](function(_0x5e83aa){return _0x5e83aa;});}return null;};}function removeEntity(_0x4a9f3e,_0x54ba62){return function(_0x23b2d0){if(_0x23b2d0){return _0x23b2d0[_0x7026('0x26')]()[_0x7026('0x25')](function(){_0x4a9f3e[_0x7026('0x1c')](0xcc)[_0x7026('0x27')]();});}};}function handleEntityNotFound(_0x59436a,_0x3a848b){return function(_0x4c6141){if(!_0x4c6141){_0x59436a[_0x7026('0x1b')](0x194);}return _0x4c6141;};}function handleError(_0x1c524c,_0x39d5e6){_0x39d5e6=_0x39d5e6||0x1f4;return function(_0x534006){logger[_0x7026('0x28')](_0x534006[_0x7026('0x29')]);if(_0x534006[_0x7026('0x2a')]){delete _0x534006[_0x7026('0x2a')];}_0x1c524c[_0x7026('0x1c')](_0x39d5e6)[_0x7026('0x2b')](_0x534006);};}exports[_0x7026('0x2c')]=function(_0x11f610,_0x4b1100){var _0x1fbbf3={},_0x374e25={},_0x185e41={'count':0x0,'rows':[]};var _0x4aa440=_[_0x7026('0x2d')](db[_0x7026('0x2e')][_0x7026('0x2f')],function(_0x17e959){return{'name':_0x17e959[_0x7026('0x30')],'type':_0x17e959[_0x7026('0x31')][_0x7026('0x32')]};});_0x374e25['model']=_[_0x7026('0x2d')](_0x4aa440,_0x7026('0x2a'));_0x374e25[_0x7026('0x33')]=_['keys'](_0x11f610[_0x7026('0x33')]);_0x374e25[_0x7026('0x34')]=_[_0x7026('0x35')](_0x374e25[_0x7026('0x36')],_0x374e25[_0x7026('0x33')]);_0x1fbbf3[_0x7026('0x37')]=_['intersection'](_0x374e25['model'],qs[_0x7026('0x38')](_0x11f610['query'][_0x7026('0x38')]));_0x1fbbf3[_0x7026('0x37')]=_0x1fbbf3['attributes'][_0x7026('0x39')]?_0x1fbbf3['attributes']:_0x374e25[_0x7026('0x36')];if(!_0x11f610[_0x7026('0x33')][_0x7026('0x3a')](_0x7026('0x3b'))){_0x1fbbf3[_0x7026('0x20')]=qs['limit'](_0x11f610['query'][_0x7026('0x20')]);_0x1fbbf3[_0x7026('0x1e')]=qs[_0x7026('0x1e')](_0x11f610['query'][_0x7026('0x1e')]);}_0x1fbbf3['order']=qs[_0x7026('0x3c')](_0x11f610['query'][_0x7026('0x3c')]);_0x1fbbf3[_0x7026('0x3d')]=qs[_0x7026('0x34')](_[_0x7026('0x3e')](_0x11f610[_0x7026('0x33')],_0x374e25[_0x7026('0x34')]),_0x4aa440);if(_0x11f610['query'][_0x7026('0x3f')]){_0x1fbbf3['where']=_[_0x7026('0x40')](_0x1fbbf3[_0x7026('0x3d')],{'$or':_[_0x7026('0x2d')](_0x4aa440,function(_0x392c7c){if(_0x392c7c[_0x7026('0x31')]!==_0x7026('0x41')){var _0x282ed6={};_0x282ed6[_0x392c7c[_0x7026('0x2a')]]={'$like':'%'+_0x11f610[_0x7026('0x33')][_0x7026('0x3f')]+'%'};return _0x282ed6;}})});}_0x1fbbf3=_[_0x7026('0x40')]({},_0x1fbbf3,_0x11f610[_0x7026('0x42')]);var _0x6b3bb6={'where':_0x1fbbf3[_0x7026('0x3d')]};return db[_0x7026('0x2e')][_0x7026('0x43')](_0x6b3bb6)[_0x7026('0x25')](function(_0x277632){_0x185e41[_0x7026('0x43')]=_0x277632;if(_0x11f610[_0x7026('0x33')][_0x7026('0x44')]){_0x1fbbf3[_0x7026('0x45')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1fbbf3);})['then'](function(_0x5902e6){_0x185e41[_0x7026('0x46')]=_0x5902e6;return _0x185e41;})['then'](respondWithFilteredResult(_0x4b1100,_0x1fbbf3))[_0x7026('0x47')](handleError(_0x4b1100,null));};exports[_0x7026('0x48')]=function(_0x63f446,_0x539536){var _0x1b5182={'raw':![],'where':{'id':_0x63f446['params']['id']}},_0xe70819={};_0xe70819[_0x7026('0x36')]=_['keys'](db[_0x7026('0x2e')][_0x7026('0x2f')]);_0xe70819['query']=_['keys'](_0x63f446[_0x7026('0x33')]);_0xe70819[_0x7026('0x34')]=_['intersection'](_0xe70819[_0x7026('0x36')],_0xe70819[_0x7026('0x33')]);_0x1b5182[_0x7026('0x37')]=_[_0x7026('0x35')](_0xe70819[_0x7026('0x36')],qs[_0x7026('0x38')](_0x63f446[_0x7026('0x33')][_0x7026('0x38')]));_0x1b5182['attributes']=_0x1b5182['attributes']['length']?_0x1b5182[_0x7026('0x37')]:_0xe70819['model'];if(_0x63f446[_0x7026('0x33')][_0x7026('0x44')]){_0x1b5182[_0x7026('0x45')]=[{'all':!![]}];}_0x1b5182=_['merge']({},_0x1b5182,_0x63f446[_0x7026('0x42')]);return db[_0x7026('0x2e')][_0x7026('0x49')](_0x1b5182)[_0x7026('0x25')](handleEntityNotFound(_0x539536,null))['then'](respondWithResult(_0x539536,null))['catch'](handleError(_0x539536,null));};exports[_0x7026('0x4a')]=function(_0x384856,_0x271b55){return db[_0x7026('0x2e')][_0x7026('0x4a')](_0x384856[_0x7026('0x4b')],{})['then'](respondWithResult(_0x271b55,0xc9))['catch'](handleError(_0x271b55,null));};exports['update']=function(_0x4bd5b1,_0x3a6f67){if(_0x4bd5b1[_0x7026('0x4b')]['id']){delete _0x4bd5b1[_0x7026('0x4b')]['id'];}return db[_0x7026('0x2e')][_0x7026('0x49')]({'where':{'id':_0x4bd5b1[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0x3a6f67,null))[_0x7026('0x25')](saveUpdates(_0x4bd5b1[_0x7026('0x4b')],null))[_0x7026('0x25')](respondWithResult(_0x3a6f67,null))['catch'](handleError(_0x3a6f67,null));};exports[_0x7026('0x26')]=function(_0x442fb3,_0x1a430e){return db['FreshsalesConfiguration'][_0x7026('0x49')]({'where':{'id':_0x442fb3[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0x1a430e,null))['then'](removeEntity(_0x1a430e,null))['catch'](handleError(_0x1a430e,null));};exports[_0x7026('0x4d')]=function(_0x55d25e,_0xd2adeb,_0x38e3d9){var _0x1c403f={};var _0xffedf9={};var _0x12943d;var _0x3719b6;return db[_0x7026('0x2e')][_0x7026('0x4e')]({'where':{'id':_0x55d25e[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0xd2adeb,null))[_0x7026('0x25')](function(_0x296a9b){if(_0x296a9b){_0x12943d=_0x296a9b;_0xffedf9[_0x7026('0x36')]=_[_0x7026('0x4f')](db['FreshsalesField'][_0x7026('0x2f')]);_0xffedf9[_0x7026('0x33')]=_['keys'](_0x55d25e['query']);_0xffedf9[_0x7026('0x34')]=_[_0x7026('0x35')](_0xffedf9[_0x7026('0x36')],_0xffedf9[_0x7026('0x33')]);_0x1c403f['attributes']=_[_0x7026('0x35')](_0xffedf9[_0x7026('0x36')],qs['fields'](_0x55d25e['query'][_0x7026('0x38')]));_0x1c403f[_0x7026('0x37')]=_0x1c403f[_0x7026('0x37')][_0x7026('0x39')]?_0x1c403f['attributes']:_0xffedf9['model'];_0x1c403f['order']=qs[_0x7026('0x3c')](_0x55d25e[_0x7026('0x33')]['sort']);_0x1c403f[_0x7026('0x3d')]=qs[_0x7026('0x34')](_[_0x7026('0x3e')](_0x55d25e[_0x7026('0x33')],_0xffedf9[_0x7026('0x34')]));if(_0x55d25e[_0x7026('0x33')][_0x7026('0x3f')]){_0x1c403f['where']=_['merge'](_0x1c403f[_0x7026('0x3d')],{'$or':_[_0x7026('0x2d')](_0x1c403f[_0x7026('0x37')],function(_0x5afb7b){var _0x23d58b={};_0x23d58b[_0x5afb7b]={'$like':'%'+_0x55d25e[_0x7026('0x33')][_0x7026('0x3f')]+'%'};return _0x23d58b;})});}_0x1c403f=_['merge']({},_0x1c403f,_0x55d25e['options']);return _0x12943d[_0x7026('0x4d')](_0x1c403f);}})['then'](function(_0x78c9a){if(_0x78c9a){_0x3719b6=_0x78c9a[_0x7026('0x39')];if(!_0x55d25e['query'][_0x7026('0x3a')](_0x7026('0x3b'))){_0x1c403f['limit']=qs[_0x7026('0x20')](_0x55d25e[_0x7026('0x33')][_0x7026('0x20')]);_0x1c403f[_0x7026('0x1e')]=qs[_0x7026('0x1e')](_0x55d25e['query'][_0x7026('0x1e')]);}return _0x12943d['getSubjects'](_0x1c403f);}})[_0x7026('0x25')](function(_0x44cac6){if(_0x44cac6){return _0x44cac6?{'count':_0x3719b6,'rows':_0x44cac6}:null;}})[_0x7026('0x25')](respondWithResult(_0xd2adeb,null))[_0x7026('0x47')](handleError(_0xd2adeb,null));};exports[_0x7026('0x50')]=function(_0x2afe87,_0x5cc346,_0x2e87fb){var _0x456b15={};var _0x37a44a={};var _0x3866ab;var _0x37a6a8;return db[_0x7026('0x2e')][_0x7026('0x4e')]({'where':{'id':_0x2afe87[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0x5cc346,null))['then'](function(_0x484b5b){if(_0x484b5b){_0x3866ab=_0x484b5b;_0x37a44a[_0x7026('0x36')]=_[_0x7026('0x4f')](db['FreshsalesField'][_0x7026('0x2f')]);_0x37a44a[_0x7026('0x33')]=_[_0x7026('0x4f')](_0x2afe87['query']);_0x37a44a[_0x7026('0x34')]=_['intersection'](_0x37a44a['model'],_0x37a44a[_0x7026('0x33')]);_0x456b15[_0x7026('0x37')]=_[_0x7026('0x35')](_0x37a44a[_0x7026('0x36')],qs['fields'](_0x2afe87[_0x7026('0x33')][_0x7026('0x38')]));_0x456b15['attributes']=_0x456b15['attributes'][_0x7026('0x39')]?_0x456b15[_0x7026('0x37')]:_0x37a44a['model'];_0x456b15['order']=qs[_0x7026('0x3c')](_0x2afe87[_0x7026('0x33')]['sort']);_0x456b15[_0x7026('0x3d')]=qs[_0x7026('0x34')](_[_0x7026('0x3e')](_0x2afe87[_0x7026('0x33')],_0x37a44a[_0x7026('0x34')]));if(_0x2afe87['query'][_0x7026('0x3f')]){_0x456b15[_0x7026('0x3d')]=_[_0x7026('0x40')](_0x456b15['where'],{'$or':_['map'](_0x456b15['attributes'],function(_0x4fcccb){var _0x554bbb={};_0x554bbb[_0x4fcccb]={'$like':'%'+_0x2afe87['query'][_0x7026('0x3f')]+'%'};return _0x554bbb;})});}_0x456b15=_[_0x7026('0x40')]({},_0x456b15,_0x2afe87[_0x7026('0x42')]);return _0x3866ab['getDescriptions'](_0x456b15);}})['then'](function(_0x21a762){if(_0x21a762){_0x37a6a8=_0x21a762[_0x7026('0x39')];if(!_0x2afe87[_0x7026('0x33')][_0x7026('0x3a')]('nolimit')){_0x456b15[_0x7026('0x20')]=qs['limit'](_0x2afe87[_0x7026('0x33')][_0x7026('0x20')]);_0x456b15[_0x7026('0x1e')]=qs['offset'](_0x2afe87['query'][_0x7026('0x1e')]);}return _0x3866ab[_0x7026('0x50')](_0x456b15);}})[_0x7026('0x25')](function(_0x57d32a){if(_0x57d32a){return _0x57d32a?{'count':_0x37a6a8,'rows':_0x57d32a}:null;}})[_0x7026('0x25')](respondWithResult(_0x5cc346,null))['catch'](handleError(_0x5cc346,null));};exports[_0x7026('0x51')]=function(_0x2382db,_0x552d2b,_0x210c77){var _0x4c7585={};var _0x41e89e={};var _0x5aad0c;var _0x204484;return db[_0x7026('0x2e')]['findOne']({'where':{'id':_0x2382db[_0x7026('0x4c')]['id']}})['then'](handleEntityNotFound(_0x552d2b,null))[_0x7026('0x25')](function(_0x1b8bea){if(_0x1b8bea){_0x5aad0c=_0x1b8bea;_0x41e89e[_0x7026('0x36')]=_[_0x7026('0x4f')](db[_0x7026('0x52')][_0x7026('0x2f')]);_0x41e89e['query']=_[_0x7026('0x4f')](_0x2382db[_0x7026('0x33')]);_0x41e89e['filters']=_[_0x7026('0x35')](_0x41e89e[_0x7026('0x36')],_0x41e89e[_0x7026('0x33')]);_0x4c7585[_0x7026('0x37')]=_[_0x7026('0x35')](_0x41e89e[_0x7026('0x36')],qs[_0x7026('0x38')](_0x2382db[_0x7026('0x33')]['fields']));_0x4c7585[_0x7026('0x37')]=_0x4c7585['attributes']['length']?_0x4c7585[_0x7026('0x37')]:_0x41e89e[_0x7026('0x36')];_0x4c7585[_0x7026('0x53')]=qs[_0x7026('0x3c')](_0x2382db[_0x7026('0x33')]['sort']);_0x4c7585[_0x7026('0x3d')]=qs['filters'](_[_0x7026('0x3e')](_0x2382db[_0x7026('0x33')],_0x41e89e[_0x7026('0x34')]));if(_0x2382db[_0x7026('0x33')][_0x7026('0x3f')]){_0x4c7585['where']=_[_0x7026('0x40')](_0x4c7585[_0x7026('0x3d')],{'$or':_['map'](_0x4c7585[_0x7026('0x37')],function(_0x26a30a){var _0x3b60a1={};_0x3b60a1[_0x26a30a]={'$like':'%'+_0x2382db['query'][_0x7026('0x3f')]+'%'};return _0x3b60a1;})});}_0x4c7585=_['merge']({},_0x4c7585,_0x2382db['options']);return _0x5aad0c[_0x7026('0x51')](_0x4c7585);}})['then'](function(_0x2e8980){if(_0x2e8980){_0x204484=_0x2e8980[_0x7026('0x39')];if(!_0x2382db[_0x7026('0x33')][_0x7026('0x3a')](_0x7026('0x3b'))){_0x4c7585['limit']=qs[_0x7026('0x20')](_0x2382db[_0x7026('0x33')][_0x7026('0x20')]);_0x4c7585[_0x7026('0x1e')]=qs[_0x7026('0x1e')](_0x2382db[_0x7026('0x33')][_0x7026('0x1e')]);}return _0x5aad0c[_0x7026('0x51')](_0x4c7585);}})[_0x7026('0x25')](function(_0x508a1b){if(_0x508a1b){return _0x508a1b?{'count':_0x204484,'rows':_0x508a1b}:null;}})[_0x7026('0x25')](respondWithResult(_0x552d2b,null))[_0x7026('0x47')](handleError(_0x552d2b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index c748f03..556f2a7 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9ec=['../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46fe0c,_0x3ed0be){var _0x2c2b58=function(_0x1e4f5b){while(--_0x1e4f5b){_0x46fe0c['push'](_0x46fe0c['shift']());}};_0x2c2b58(++_0x3ed0be);}(_0xf9ec,0xd4));var _0xcf9e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf9ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xcf9e('0x0'));var util=require(_0xcf9e('0x1'));var logger=require(_0xcf9e('0x2'))(_0xcf9e('0x3'));var moment=require(_0xcf9e('0x4'));var BPromise=require(_0xcf9e('0x5'));var rp=require(_0xcf9e('0x6'));var fs=require('fs');var path=require(_0xcf9e('0x7'));var rimraf=require(_0xcf9e('0x8'));var config=require(_0xcf9e('0x9'));var attributes=require(_0xcf9e('0xa'));module['exports']=function(_0xa46ccf,_0x403e32){return _0xa46ccf['define'](_0xcf9e('0xb'),attributes,{'tableName':_0xcf9e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b4f=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0xe6d97c,_0x4920f9){var _0x22bb22=function(_0x284ead){while(--_0x284ead){_0xe6d97c['push'](_0xe6d97c['shift']());}};_0x22bb22(++_0x4920f9);}(_0x9b4f,0x1ad));var _0xf9b4=function(_0x5eaeb0,_0x496576){_0x5eaeb0=_0x5eaeb0-0x0;var _0x5f1407=_0x9b4f[_0x5eaeb0];return _0x5f1407;};'use strict';var _=require(_0xf9b4('0x0'));var util=require('util');var logger=require(_0xf9b4('0x1'))(_0xf9b4('0x2'));var moment=require(_0xf9b4('0x3'));var BPromise=require(_0xf9b4('0x4'));var rp=require(_0xf9b4('0x5'));var fs=require('fs');var path=require(_0xf9b4('0x6'));var rimraf=require(_0xf9b4('0x7'));var config=require(_0xf9b4('0x8'));var attributes=require(_0xf9b4('0x9'));module[_0xf9b4('0xa')]=function(_0x556fc5,_0x4ddfa9){return _0x556fc5[_0xf9b4('0xb')](_0xf9b4('0xc'),attributes,{'tableName':_0xf9b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index f5ccb00..ec0c35c 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2915=['jayson/promise','client','http','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment'];(function(_0xeb26d1,_0x301de1){var _0x4a4e2e=function(_0xa3dad1){while(--_0xa3dad1){_0xeb26d1['push'](_0xeb26d1['shift']());}};_0x4a4e2e(++_0x301de1);}(_0x2915,0xe0));var _0x5291=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x2915[_0x378720];return _0x47920a;};'use strict';var _=require(_0x5291('0x0'));var util=require(_0x5291('0x1'));var moment=require(_0x5291('0x2'));var BPromise=require(_0x5291('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5291('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5291('0x5'));var config=require(_0x5291('0x6'));var jayson=require(_0x5291('0x7'));var client=jayson[_0x5291('0x8')][_0x5291('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13a358,_0x36b08f,_0x282e12){return new BPromise(function(_0xd75ca6,_0xc4a5){return client['request'](_0x13a358,_0x282e12)[_0x5291('0xa')](function(_0x218514){logger['info'](_0x5291('0xb'),_0x36b08f,'request\x20sent');logger[_0x5291('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x36b08f,'request\x20sent',JSON[_0x5291('0xd')](_0x218514));if(_0x218514[_0x5291('0xe')]){if(_0x218514[_0x5291('0xe')][_0x5291('0xf')]===0x1f4){logger['error'](_0x5291('0xb'),_0x36b08f,_0x218514[_0x5291('0xe')]['message']);return _0xc4a5(_0x218514[_0x5291('0xe')][_0x5291('0x10')]);}logger[_0x5291('0xe')](_0x5291('0xb'),_0x36b08f,_0x218514['error'][_0x5291('0x10')]);return _0xd75ca6(_0x218514[_0x5291('0xe')][_0x5291('0x10')]);}else{logger[_0x5291('0x11')](_0x5291('0xb'),_0x36b08f,_0x5291('0x12'));_0xd75ca6(_0x218514[_0x5291('0x13')]['message']);}})[_0x5291('0x14')](function(_0x4fcf2a){logger[_0x5291('0xe')](_0x5291('0xb'),_0x36b08f,_0x4fcf2a);_0xc4a5(_0x4fcf2a);});});} \ No newline at end of file +var _0x2362=['moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x4ac12c,_0x197626){var _0x111e2a=function(_0x532335){while(--_0x532335){_0x4ac12c['push'](_0x4ac12c['shift']());}};_0x111e2a(++_0x197626);}(_0x2362,0xee));var _0x2236=function(_0x433502,_0x1fd975){_0x433502=_0x433502-0x0;var _0x4a28de=_0x2362[_0x433502];return _0x4a28de;};'use strict';var _=require(_0x2236('0x0'));var util=require(_0x2236('0x1'));var moment=require(_0x2236('0x2'));var BPromise=require('bluebird');var rs=require(_0x2236('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2236('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2236('0x5'))(_0x2236('0x6'));var config=require('../../config/environment');var jayson=require(_0x2236('0x7'));var client=jayson[_0x2236('0x8')][_0x2236('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e036,_0x5d2c47,_0x329df3){return new BPromise(function(_0x10b798,_0x93c766){return client[_0x2236('0xa')](_0x22e036,_0x329df3)[_0x2236('0xb')](function(_0x4958ad){logger[_0x2236('0xc')](_0x2236('0xd'),_0x5d2c47,'request\x20sent');logger['debug'](_0x2236('0xe'),_0x5d2c47,_0x2236('0xf'),JSON[_0x2236('0x10')](_0x4958ad));if(_0x4958ad['error']){if(_0x4958ad['error']['code']===0x1f4){logger[_0x2236('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5d2c47,_0x4958ad[_0x2236('0x11')][_0x2236('0x12')]);return _0x93c766(_0x4958ad[_0x2236('0x11')][_0x2236('0x12')]);}logger['error'](_0x2236('0xd'),_0x5d2c47,_0x4958ad[_0x2236('0x11')]['message']);return _0x10b798(_0x4958ad[_0x2236('0x11')]['message']);}else{logger[_0x2236('0xc')](_0x2236('0xd'),_0x5d2c47,_0x2236('0xf'));_0x10b798(_0x4958ad['result'][_0x2236('0x12')]);}})[_0x2236('0x13')](function(_0x3648ee){logger['error'](_0x2236('0xd'),_0x5d2c47,_0x3648ee);_0x93c766(_0x3648ee);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 24473d7..fd068d7 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf6e=['/:id','post','create','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0xea7045,_0x33d66c){var _0x446f64=function(_0x527dc5){while(--_0x527dc5){_0xea7045['push'](_0xea7045['shift']());}};_0x446f64(++_0x33d66c);}(_0xbf6e,0x149));var _0xebf6=function(_0x2a1eb9,_0x2c6329){_0x2a1eb9=_0x2a1eb9-0x0;var _0x4b5310=_0xbf6e[_0x2a1eb9];return _0x4b5310;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0xc')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xd')]);router['put'](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['update']);router[_0xebf6('0xe')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller[_0xebf6('0xf')]);module[_0xebf6('0x10')]=router; \ No newline at end of file +var _0x00b3=['delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','create','put','update'];(function(_0xad8701,_0x4a1695){var _0xbf8c66=function(_0x4d33fc){while(--_0x4d33fc){_0xad8701['push'](_0xad8701['shift']());}};_0xbf8c66(++_0x4a1695);}(_0x00b3,0x17a));var _0x300b=function(_0x371d96,_0x43b332){_0x371d96=_0x371d96-0x0;var _0x18aaea=_0x00b3[_0x371d96];return _0x18aaea;};'use strict';var multer=require('multer');var util=require(_0x300b('0x0'));var path=require(_0x300b('0x1'));var timeout=require(_0x300b('0x2'));var express=require(_0x300b('0x3'));var router=express['Router']();var fs_extra=require(_0x300b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x300b('0x5'));var config=require('../../config/environment');var controller=require(_0x300b('0x6'));router[_0x300b('0x7')]('/',auth[_0x300b('0x8')](),controller[_0x300b('0x9')]);router['get']('/:id',auth[_0x300b('0x8')](),controller['show']);router['post']('/',auth[_0x300b('0x8')](),controller[_0x300b('0xa')]);router[_0x300b('0xb')]('/:id',auth[_0x300b('0x8')](),controller[_0x300b('0xc')]);router[_0x300b('0xd')](_0x300b('0xe'),auth['isAuthenticated'](),controller[_0x300b('0xf')]);module[_0x300b('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 9ac164a..5e5c480 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fc3=['ENUM','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0xca5315,_0x46f4f1){var _0x195a8a=function(_0x4cea70){while(--_0x4cea70){_0xca5315['push'](_0xca5315['shift']());}};_0x195a8a(++_0x46f4f1);}(_0x0fc3,0x1be));var _0x30fc=function(_0x5c7a2a,_0x3194ba){_0x5c7a2a=_0x5c7a2a-0x0;var _0x5c78ed=_0x0fc3[_0x5c7a2a];return _0x5c78ed;};'use strict';var Sequelize=require(_0x30fc('0x0'));module[_0x30fc('0x1')]={'type':{'type':Sequelize[_0x30fc('0x2')]('string',_0x30fc('0x3'),_0x30fc('0x4'),_0x30fc('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x30fc('0x6')]},'keyType':{'type':Sequelize[_0x30fc('0x2')]('string',_0x30fc('0x3'),_0x30fc('0x4'))},'keyContent':{'type':Sequelize[_0x30fc('0x6')]},'idField':{'type':Sequelize[_0x30fc('0x6')]},'nameField':{'type':Sequelize[_0x30fc('0x6')]},'customField':{'type':Sequelize[_0x30fc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7cb5=['BOOLEAN','sequelize','exports','string','keyValue','picklist','STRING','ENUM','variable','customVariable'];(function(_0x792e6b,_0x1949c4){var _0x1627c2=function(_0xa89bb1){while(--_0xa89bb1){_0x792e6b['push'](_0x792e6b['shift']());}};_0x1627c2(++_0x1949c4);}(_0x7cb5,0xbf));var _0x57cb=function(_0x3fc56b,_0x4a6575){_0x3fc56b=_0x3fc56b-0x0;var _0x4ff874=_0x7cb5[_0x3fc56b];return _0x4ff874;};'use strict';var Sequelize=require(_0x57cb('0x0'));module[_0x57cb('0x1')]={'type':{'type':Sequelize['ENUM'](_0x57cb('0x2'),'variable','customVariable',_0x57cb('0x3'),_0x57cb('0x4')),'defaultValue':_0x57cb('0x2')},'content':{'type':Sequelize[_0x57cb('0x5')]},'key':{'type':Sequelize[_0x57cb('0x5')]},'keyType':{'type':Sequelize[_0x57cb('0x6')]('string',_0x57cb('0x7'),_0x57cb('0x8'))},'keyContent':{'type':Sequelize[_0x57cb('0x5')]},'idField':{'type':Sequelize[_0x57cb('0x5')]},'nameField':{'type':Sequelize[_0x57cb('0x5')]},'customField':{'type':Sequelize[_0x57cb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57cb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 57ee7ef..0d89cf6 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b0b=['include','then','rows','catch','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','destroy','name','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','FreshsalesField','includeAll'];(function(_0x11efe8,_0xe6ad7e){var _0x5954b8=function(_0x48bc36){while(--_0x48bc36){_0x11efe8['push'](_0x11efe8['shift']());}};_0x5954b8(++_0xe6ad7e);}(_0x9b0b,0x15d));var _0xb9b0=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x9b0b[_0x553a87];return _0x12d1e6;};'use strict';var emlformat=require(_0xb9b0('0x0'));var rimraf=require(_0xb9b0('0x1'));var zipdir=require(_0xb9b0('0x2'));var jsonpatch=require(_0xb9b0('0x3'));var rp=require(_0xb9b0('0x4'));var moment=require('moment');var BPromise=require(_0xb9b0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb9b0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9b0('0x7'));var _=require(_0xb9b0('0x8'));var squel=require(_0xb9b0('0x9'));var crypto=require(_0xb9b0('0xa'));var jsforce=require(_0xb9b0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb9b0('0xc'));var querystring=require(_0xb9b0('0xd'));var Papa=require('papaparse');var Redis=require(_0xb9b0('0xe'));var authService=require(_0xb9b0('0xf'));var qs=require(_0xb9b0('0x10'));var as=require(_0xb9b0('0x11'));var hardwareService=require(_0xb9b0('0x12'));var logger=require(_0xb9b0('0x13'))(_0xb9b0('0x14'));var utils=require('../../config/utils');var config=require(_0xb9b0('0x15'));var licenseUtil=require(_0xb9b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4041c9,_0x6ad913){_0x6ad913=_0x6ad913||0xcc;return function(_0x15be3e){if(_0x15be3e){return _0x4041c9[_0xb9b0('0x17')](_0x6ad913);}return _0x4041c9[_0xb9b0('0x18')](_0x6ad913)[_0xb9b0('0x19')]();};}function respondWithResult(_0x205f40,_0x32de90){_0x32de90=_0x32de90||0xc8;return function(_0x432870){if(_0x432870){return _0x205f40[_0xb9b0('0x18')](_0x32de90)[_0xb9b0('0x1a')](_0x432870);}};}function respondWithFilteredResult(_0x4e53dc,_0x18c5cf){return function(_0x5ec74f){if(_0x5ec74f){var _0x4b44d3=typeof _0x18c5cf[_0xb9b0('0x1b')]===_0xb9b0('0x1c')&&typeof _0x18c5cf['limit']===_0xb9b0('0x1c');var _0x91b551=_0x5ec74f[_0xb9b0('0x1d')];var _0x5e984e=_0x4b44d3?0x0:_0x18c5cf[_0xb9b0('0x1b')];var _0x16124f=_0x4b44d3?_0x5ec74f[_0xb9b0('0x1d')]:_0x18c5cf['offset']+_0x18c5cf['limit'];var _0x1ecaa7;if(_0x16124f>=_0x91b551){_0x16124f=_0x91b551;_0x1ecaa7=0xc8;}else{_0x1ecaa7=0xce;}_0x4e53dc[_0xb9b0('0x18')](_0x1ecaa7);return _0x4e53dc['set'](_0xb9b0('0x1e'),_0x5e984e+'-'+_0x16124f+'/'+_0x91b551)['json'](_0x5ec74f);}return null;};}function patchUpdates(_0xd465d5){return function(_0x23df92){try{jsonpatch['apply'](_0x23df92,_0xd465d5,!![]);}catch(_0x2f4be5){return BPromise[_0xb9b0('0x1f')](_0x2f4be5);}return _0x23df92[_0xb9b0('0x20')]();};}function saveUpdates(_0x527e61,_0x3aa9eb){return function(_0x4100df){if(_0x4100df){return _0x4100df[_0xb9b0('0x21')](_0x527e61)['then'](function(_0xa5bec2){return _0xa5bec2;});}return null;};}function removeEntity(_0x2409eb,_0x5c2b6e){return function(_0x3ff6c7){if(_0x3ff6c7){return _0x3ff6c7[_0xb9b0('0x22')]()['then'](function(){_0x2409eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x676f41,_0x1698e3){return function(_0x33fa5c){if(!_0x33fa5c){_0x676f41[_0xb9b0('0x17')](0x194);}return _0x33fa5c;};}function handleError(_0x250e27,_0x14367e){_0x14367e=_0x14367e||0x1f4;return function(_0x1e617c){logger['error'](_0x1e617c['stack']);if(_0x1e617c[_0xb9b0('0x23')]){delete _0x1e617c[_0xb9b0('0x23')];}_0x250e27['status'](_0x14367e)['send'](_0x1e617c);};}exports[_0xb9b0('0x24')]=function(_0x3225cc,_0x2ed445){var _0x1c0895={},_0x143ab7={},_0x40c41d={'count':0x0,'rows':[]};var _0x1fec83=_['map'](db['FreshsalesField'][_0xb9b0('0x25')],function(_0x2d01a7){return{'name':_0x2d01a7['fieldName'],'type':_0x2d01a7[_0xb9b0('0x26')][_0xb9b0('0x27')]};});_0x143ab7[_0xb9b0('0x28')]=_[_0xb9b0('0x29')](_0x1fec83,_0xb9b0('0x23'));_0x143ab7[_0xb9b0('0x2a')]=_['keys'](_0x3225cc['query']);_0x143ab7[_0xb9b0('0x2b')]=_[_0xb9b0('0x2c')](_0x143ab7[_0xb9b0('0x28')],_0x143ab7['query']);_0x1c0895[_0xb9b0('0x2d')]=_[_0xb9b0('0x2c')](_0x143ab7['model'],qs['fields'](_0x3225cc['query'][_0xb9b0('0x2e')]));_0x1c0895[_0xb9b0('0x2d')]=_0x1c0895[_0xb9b0('0x2d')]['length']?_0x1c0895[_0xb9b0('0x2d')]:_0x143ab7[_0xb9b0('0x28')];if(!_0x3225cc['query'][_0xb9b0('0x2f')](_0xb9b0('0x30'))){_0x1c0895[_0xb9b0('0x31')]=qs[_0xb9b0('0x31')](_0x3225cc[_0xb9b0('0x2a')][_0xb9b0('0x31')]);_0x1c0895['offset']=qs['offset'](_0x3225cc[_0xb9b0('0x2a')][_0xb9b0('0x1b')]);}_0x1c0895[_0xb9b0('0x32')]=qs['sort'](_0x3225cc[_0xb9b0('0x2a')][_0xb9b0('0x33')]);_0x1c0895[_0xb9b0('0x34')]=qs['filters'](_[_0xb9b0('0x35')](_0x3225cc[_0xb9b0('0x2a')],_0x143ab7[_0xb9b0('0x2b')]),_0x1fec83);if(_0x3225cc[_0xb9b0('0x2a')][_0xb9b0('0x36')]){_0x1c0895[_0xb9b0('0x34')]=_[_0xb9b0('0x37')](_0x1c0895['where'],{'$or':_[_0xb9b0('0x29')](_0x1fec83,function(_0x1db04b){if(_0x1db04b[_0xb9b0('0x26')]!=='VIRTUAL'){var _0x5c4270={};_0x5c4270[_0x1db04b[_0xb9b0('0x23')]]={'$like':'%'+_0x3225cc[_0xb9b0('0x2a')][_0xb9b0('0x36')]+'%'};return _0x5c4270;}})});}_0x1c0895=_[_0xb9b0('0x37')]({},_0x1c0895,_0x3225cc[_0xb9b0('0x38')]);var _0x21dcce={'where':_0x1c0895[_0xb9b0('0x34')]};return db[_0xb9b0('0x39')][_0xb9b0('0x1d')](_0x21dcce)['then'](function(_0x1928d2){_0x40c41d[_0xb9b0('0x1d')]=_0x1928d2;if(_0x3225cc[_0xb9b0('0x2a')][_0xb9b0('0x3a')]){_0x1c0895[_0xb9b0('0x3b')]=[{'all':!![]}];}return db[_0xb9b0('0x39')]['findAll'](_0x1c0895);})[_0xb9b0('0x3c')](function(_0x427370){_0x40c41d[_0xb9b0('0x3d')]=_0x427370;return _0x40c41d;})[_0xb9b0('0x3c')](respondWithFilteredResult(_0x2ed445,_0x1c0895))[_0xb9b0('0x3e')](handleError(_0x2ed445,null));};exports['show']=function(_0x15e82d,_0x1c2296){var _0x79eb41={'raw':!![],'where':{'id':_0x15e82d['params']['id']}},_0xd70220={};_0xd70220[_0xb9b0('0x28')]=_['keys'](db[_0xb9b0('0x39')][_0xb9b0('0x25')]);_0xd70220['query']=_[_0xb9b0('0x3f')](_0x15e82d['query']);_0xd70220[_0xb9b0('0x2b')]=_[_0xb9b0('0x2c')](_0xd70220[_0xb9b0('0x28')],_0xd70220['query']);_0x79eb41[_0xb9b0('0x2d')]=_[_0xb9b0('0x2c')](_0xd70220[_0xb9b0('0x28')],qs[_0xb9b0('0x2e')](_0x15e82d['query'][_0xb9b0('0x2e')]));_0x79eb41[_0xb9b0('0x2d')]=_0x79eb41['attributes'][_0xb9b0('0x40')]?_0x79eb41['attributes']:_0xd70220['model'];if(_0x15e82d[_0xb9b0('0x2a')]['includeAll']){_0x79eb41['include']=[{'all':!![]}];}_0x79eb41=_[_0xb9b0('0x37')]({},_0x79eb41,_0x15e82d['options']);return db[_0xb9b0('0x39')][_0xb9b0('0x41')](_0x79eb41)[_0xb9b0('0x3c')](handleEntityNotFound(_0x1c2296,null))['then'](respondWithResult(_0x1c2296,null))[_0xb9b0('0x3e')](handleError(_0x1c2296,null));};exports[_0xb9b0('0x42')]=function(_0x508260,_0x7ac6d0){return db[_0xb9b0('0x39')][_0xb9b0('0x42')](_0x508260['body'],{})[_0xb9b0('0x3c')](respondWithResult(_0x7ac6d0,0xc9))[_0xb9b0('0x3e')](handleError(_0x7ac6d0,null));};exports[_0xb9b0('0x21')]=function(_0x12e761,_0x2b32cf){if(_0x12e761[_0xb9b0('0x43')]['id']){delete _0x12e761[_0xb9b0('0x43')]['id'];}return db[_0xb9b0('0x39')]['find']({'where':{'id':_0x12e761['params']['id']}})[_0xb9b0('0x3c')](handleEntityNotFound(_0x2b32cf,null))['then'](saveUpdates(_0x12e761[_0xb9b0('0x43')],null))['then'](respondWithResult(_0x2b32cf,null))[_0xb9b0('0x3e')](handleError(_0x2b32cf,null));};exports[_0xb9b0('0x22')]=function(_0x148980,_0x5db6e8){return db[_0xb9b0('0x39')][_0xb9b0('0x41')]({'where':{'id':_0x148980['params']['id']}})[_0xb9b0('0x3c')](handleEntityNotFound(_0x5db6e8,null))[_0xb9b0('0x3c')](removeEntity(_0x5db6e8,null))[_0xb9b0('0x3e')](handleError(_0x5db6e8,null));}; \ No newline at end of file +var _0x85f6=['options','includeAll','findAll','catch','params','keys','length','include','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','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','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x5cc711,_0x1a95c7){var _0x1ce5bb=function(_0x4a8188){while(--_0x4a8188){_0x5cc711['push'](_0x5cc711['shift']());}};_0x1ce5bb(++_0x1a95c7);}(_0x85f6,0x183));var _0x685f=function(_0xae0e2f,_0x33eb71){_0xae0e2f=_0xae0e2f-0x0;var _0xe48894=_0x85f6[_0xae0e2f];return _0xe48894;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x685f('0x0'));var zipdir=require(_0x685f('0x1'));var jsonpatch=require(_0x685f('0x2'));var rp=require(_0x685f('0x3'));var moment=require(_0x685f('0x4'));var BPromise=require(_0x685f('0x5'));var Mustache=require('mustache');var util=require(_0x685f('0x6'));var path=require(_0x685f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x685f('0x8'));var fs=require('fs');var fs_extra=require(_0x685f('0x9'));var _=require(_0x685f('0xa'));var squel=require(_0x685f('0xb'));var crypto=require(_0x685f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x685f('0xd'));var toCsv=require(_0x685f('0xe'));var querystring=require(_0x685f('0xf'));var Papa=require(_0x685f('0x10'));var Redis=require(_0x685f('0x11'));var authService=require(_0x685f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x685f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x685f('0x14'))(_0x685f('0x15'));var utils=require('../../config/utils');var config=require(_0x685f('0x16'));var licenseUtil=require(_0x685f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a0174,_0x3bd1ca){_0x3bd1ca=_0x3bd1ca||0xcc;return function(_0x29d54c){if(_0x29d54c){return _0x1a0174[_0x685f('0x18')](_0x3bd1ca);}return _0x1a0174[_0x685f('0x19')](_0x3bd1ca)[_0x685f('0x1a')]();};}function respondWithResult(_0x16da06,_0x5c3f42){_0x5c3f42=_0x5c3f42||0xc8;return function(_0x51277a){if(_0x51277a){return _0x16da06[_0x685f('0x19')](_0x5c3f42)[_0x685f('0x1b')](_0x51277a);}};}function respondWithFilteredResult(_0x2a3a50,_0x579ea7){return function(_0x415074){if(_0x415074){var _0x5a2c46=typeof _0x579ea7[_0x685f('0x1c')]===_0x685f('0x1d')&&typeof _0x579ea7[_0x685f('0x1e')]===_0x685f('0x1d');var _0x4fc5b1=_0x415074[_0x685f('0x1f')];var _0x106e06=_0x5a2c46?0x0:_0x579ea7['offset'];var _0x165fa4=_0x5a2c46?_0x415074[_0x685f('0x1f')]:_0x579ea7[_0x685f('0x1c')]+_0x579ea7['limit'];var _0x322ee1;if(_0x165fa4>=_0x4fc5b1){_0x165fa4=_0x4fc5b1;_0x322ee1=0xc8;}else{_0x322ee1=0xce;}_0x2a3a50[_0x685f('0x19')](_0x322ee1);return _0x2a3a50[_0x685f('0x20')](_0x685f('0x21'),_0x106e06+'-'+_0x165fa4+'/'+_0x4fc5b1)[_0x685f('0x1b')](_0x415074);}return null;};}function patchUpdates(_0x5c2324){return function(_0x524f30){try{jsonpatch[_0x685f('0x22')](_0x524f30,_0x5c2324,!![]);}catch(_0x21c9b3){return BPromise[_0x685f('0x23')](_0x21c9b3);}return _0x524f30[_0x685f('0x24')]();};}function saveUpdates(_0x24844b,_0x34b140){return function(_0xbb831){if(_0xbb831){return _0xbb831['update'](_0x24844b)[_0x685f('0x25')](function(_0x3e69d3){return _0x3e69d3;});}return null;};}function removeEntity(_0x3dc4bc,_0x1e399c){return function(_0x14516a){if(_0x14516a){return _0x14516a[_0x685f('0x26')]()[_0x685f('0x25')](function(){_0x3dc4bc[_0x685f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x377e98,_0x412ef8){return function(_0x1e9c2e){if(!_0x1e9c2e){_0x377e98[_0x685f('0x18')](0x194);}return _0x1e9c2e;};}function handleError(_0x58eb7e,_0x4c5deb){_0x4c5deb=_0x4c5deb||0x1f4;return function(_0x413c6c){logger[_0x685f('0x27')](_0x413c6c[_0x685f('0x28')]);if(_0x413c6c[_0x685f('0x29')]){delete _0x413c6c[_0x685f('0x29')];}_0x58eb7e[_0x685f('0x19')](_0x4c5deb)[_0x685f('0x2a')](_0x413c6c);};}exports['index']=function(_0x16c51c,_0x619c42){var _0x563a81={},_0x5d40b3={},_0x57b40a={'count':0x0,'rows':[]};var _0x10f053=_[_0x685f('0x2b')](db[_0x685f('0x2c')][_0x685f('0x2d')],function(_0x3f5fe4){return{'name':_0x3f5fe4[_0x685f('0x2e')],'type':_0x3f5fe4[_0x685f('0x2f')]['key']};});_0x5d40b3['model']=_[_0x685f('0x2b')](_0x10f053,_0x685f('0x29'));_0x5d40b3['query']=_['keys'](_0x16c51c[_0x685f('0x30')]);_0x5d40b3['filters']=_[_0x685f('0x31')](_0x5d40b3[_0x685f('0x32')],_0x5d40b3['query']);_0x563a81['attributes']=_['intersection'](_0x5d40b3[_0x685f('0x32')],qs[_0x685f('0x33')](_0x16c51c[_0x685f('0x30')][_0x685f('0x33')]));_0x563a81[_0x685f('0x34')]=_0x563a81['attributes']['length']?_0x563a81[_0x685f('0x34')]:_0x5d40b3['model'];if(!_0x16c51c['query'][_0x685f('0x35')](_0x685f('0x36'))){_0x563a81[_0x685f('0x1e')]=qs[_0x685f('0x1e')](_0x16c51c[_0x685f('0x30')][_0x685f('0x1e')]);_0x563a81[_0x685f('0x1c')]=qs[_0x685f('0x1c')](_0x16c51c[_0x685f('0x30')][_0x685f('0x1c')]);}_0x563a81[_0x685f('0x37')]=qs['sort'](_0x16c51c[_0x685f('0x30')][_0x685f('0x38')]);_0x563a81[_0x685f('0x39')]=qs[_0x685f('0x3a')](_[_0x685f('0x3b')](_0x16c51c[_0x685f('0x30')],_0x5d40b3[_0x685f('0x3a')]),_0x10f053);if(_0x16c51c[_0x685f('0x30')]['filter']){_0x563a81['where']=_[_0x685f('0x3c')](_0x563a81['where'],{'$or':_[_0x685f('0x2b')](_0x10f053,function(_0x20f713){if(_0x20f713['type']!==_0x685f('0x3d')){var _0xdd3213={};_0xdd3213[_0x20f713[_0x685f('0x29')]]={'$like':'%'+_0x16c51c[_0x685f('0x30')][_0x685f('0x3e')]+'%'};return _0xdd3213;}})});}_0x563a81=_[_0x685f('0x3c')]({},_0x563a81,_0x16c51c[_0x685f('0x3f')]);var _0x5bdb95={'where':_0x563a81['where']};return db['FreshsalesField'][_0x685f('0x1f')](_0x5bdb95)['then'](function(_0x387b1e){_0x57b40a[_0x685f('0x1f')]=_0x387b1e;if(_0x16c51c[_0x685f('0x30')][_0x685f('0x40')]){_0x563a81['include']=[{'all':!![]}];}return db[_0x685f('0x2c')][_0x685f('0x41')](_0x563a81);})[_0x685f('0x25')](function(_0x1cf99c){_0x57b40a['rows']=_0x1cf99c;return _0x57b40a;})[_0x685f('0x25')](respondWithFilteredResult(_0x619c42,_0x563a81))[_0x685f('0x42')](handleError(_0x619c42,null));};exports['show']=function(_0x3bfb03,_0x3cc909){var _0x54841a={'raw':!![],'where':{'id':_0x3bfb03[_0x685f('0x43')]['id']}},_0x7eba9a={};_0x7eba9a['model']=_['keys'](db[_0x685f('0x2c')]['rawAttributes']);_0x7eba9a[_0x685f('0x30')]=_[_0x685f('0x44')](_0x3bfb03['query']);_0x7eba9a[_0x685f('0x3a')]=_[_0x685f('0x31')](_0x7eba9a[_0x685f('0x32')],_0x7eba9a[_0x685f('0x30')]);_0x54841a[_0x685f('0x34')]=_['intersection'](_0x7eba9a[_0x685f('0x32')],qs['fields'](_0x3bfb03[_0x685f('0x30')]['fields']));_0x54841a['attributes']=_0x54841a['attributes'][_0x685f('0x45')]?_0x54841a[_0x685f('0x34')]:_0x7eba9a[_0x685f('0x32')];if(_0x3bfb03['query'][_0x685f('0x40')]){_0x54841a[_0x685f('0x46')]=[{'all':!![]}];}_0x54841a=_[_0x685f('0x3c')]({},_0x54841a,_0x3bfb03[_0x685f('0x3f')]);return db[_0x685f('0x2c')][_0x685f('0x47')](_0x54841a)[_0x685f('0x25')](handleEntityNotFound(_0x3cc909,null))['then'](respondWithResult(_0x3cc909,null))['catch'](handleError(_0x3cc909,null));};exports[_0x685f('0x48')]=function(_0x122cde,_0x15cf1d){return db[_0x685f('0x2c')]['create'](_0x122cde['body'],{})[_0x685f('0x25')](respondWithResult(_0x15cf1d,0xc9))[_0x685f('0x42')](handleError(_0x15cf1d,null));};exports[_0x685f('0x49')]=function(_0x2ef42b,_0xf757d){if(_0x2ef42b['body']['id']){delete _0x2ef42b[_0x685f('0x4a')]['id'];}return db['FreshsalesField'][_0x685f('0x47')]({'where':{'id':_0x2ef42b[_0x685f('0x43')]['id']}})[_0x685f('0x25')](handleEntityNotFound(_0xf757d,null))[_0x685f('0x25')](saveUpdates(_0x2ef42b[_0x685f('0x4a')],null))[_0x685f('0x25')](respondWithResult(_0xf757d,null))['catch'](handleError(_0xf757d,null));};exports[_0x685f('0x26')]=function(_0x543d87,_0x37987b){return db['FreshsalesField'][_0x685f('0x47')]({'where':{'id':_0x543d87[_0x685f('0x43')]['id']}})['then'](handleEntityNotFound(_0x37987b,null))[_0x685f('0x25')](removeEntity(_0x37987b,null))[_0x685f('0x42')](handleError(_0x37987b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4e58c9a..441a8eb 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd786=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x30f030,_0xd03b7a){var _0xf7614f=function(_0x261cac){while(--_0x261cac){_0x30f030['push'](_0x30f030['shift']());}};_0xf7614f(++_0xd03b7a);}(_0xd786,0x1dc));var _0x6d78=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd786[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var logger=require(_0x6d78('0x2'))(_0x6d78('0x3'));var moment=require('moment');var BPromise=require(_0x6d78('0x4'));var rp=require(_0x6d78('0x5'));var fs=require('fs');var path=require(_0x6d78('0x6'));var rimraf=require(_0x6d78('0x7'));var config=require(_0x6d78('0x8'));var attributes=require(_0x6d78('0x9'));module[_0x6d78('0xa')]=function(_0x55ea32,_0x18c038){return _0x55ea32[_0x6d78('0xb')]('FreshsalesField',attributes,{'tableName':_0x6d78('0xc'),'paranoid':![],'indexes':[{'name':_0x6d78('0xd'),'fields':[_0x6d78('0xe'),_0x6d78('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda7=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14eac5,_0x5d7549){var _0x223eb6=function(_0x892d56){while(--_0x892d56){_0x14eac5['push'](_0x14eac5['shift']());}};_0x223eb6(++_0x5d7549);}(_0xeda7,0x196));var _0x7eda=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xeda7[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var logger=require(_0x7eda('0x2'))(_0x7eda('0x3'));var moment=require(_0x7eda('0x4'));var BPromise=require(_0x7eda('0x5'));var rp=require(_0x7eda('0x6'));var fs=require('fs');var path=require(_0x7eda('0x7'));var rimraf=require(_0x7eda('0x8'));var config=require(_0x7eda('0x9'));var attributes=require(_0x7eda('0xa'));module[_0x7eda('0xb')]=function(_0x6ee7be,_0x328430){return _0x6ee7be[_0x7eda('0xc')](_0x7eda('0xd'),attributes,{'tableName':_0x7eda('0xe'),'paranoid':![],'indexes':[{'name':_0x7eda('0xf'),'fields':[_0x7eda('0x10'),_0x7eda('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index b3a6515..d5d270e 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x2be2c7,_0x32900e){var _0x4cc9a7=function(_0x2a3c37){while(--_0x2a3c37){_0x2be2c7['push'](_0x2be2c7['shift']());}};_0x4cc9a7(++_0x32900e);}(_0x7c09,0x102));var _0x97c0=function(_0x14d485,_0x1c717d){_0x14d485=_0x14d485-0x0;var _0x14484a=_0x7c09[_0x14d485];return _0x14484a;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file +var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0xfcf0,0x138));var _0x0fcf=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0xfcf0[_0x121b1a];return _0x2d89a6;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5da7c2e..ab3710e 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x49809a,_0x5c32f0){var _0x44a13a=function(_0x24d72a){while(--_0x24d72a){_0x49809a['push'](_0x49809a['shift']());}};_0x44a13a(++_0x5c32f0);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x233e75,_0x3b4eb3){var _0x19e0b3=function(_0x44d41a){while(--_0x44d41a){_0x233e75['push'](_0x233e75['shift']());}};_0x19e0b3(++_0x3b4eb3);}(_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('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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 8103b87..5a690b3 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26c2=['exports','STRING','ENUM','integrationTab','newTab'];(function(_0x455838,_0x2092c7){var _0x25aba1=function(_0x4d5c01){while(--_0x4d5c01){_0x455838['push'](_0x455838['shift']());}};_0x25aba1(++_0x2092c7);}(_0x26c2,0x1d6));var _0x226c=function(_0x499c01,_0x5b0704){_0x499c01=_0x499c01-0x0;var _0x39673b=_0x26c2[_0x499c01];return _0x39673b;};'use strict';var Sequelize=require('sequelize');module[_0x226c('0x0')]={'name':{'type':Sequelize[_0x226c('0x1')]},'description':{'type':Sequelize[_0x226c('0x1')]},'username':{'type':Sequelize[_0x226c('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x226c('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x226c('0x1')]},'clientSecret':{'type':Sequelize[_0x226c('0x1')]},'securityToken':{'type':Sequelize[_0x226c('0x1')]},'serverUrl':{'type':Sequelize[_0x226c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x226c('0x2')](_0x226c('0x3'),_0x226c('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xebae=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x2c7c7a,_0x4b2a89){var _0x4c733a=function(_0x5d6813){while(--_0x5d6813){_0x2c7c7a['push'](_0x2c7c7a['shift']());}};_0x4c733a(++_0x4b2a89);}(_0xebae,0x83));var _0xeeba=function(_0x416eed,_0x3a2a24){_0x416eed=_0x416eed-0x0;var _0x325487=_0xebae[_0x416eed];return _0x325487;};'use strict';var Sequelize=require(_0xeeba('0x0'));module[_0xeeba('0x1')]={'name':{'type':Sequelize[_0xeeba('0x2')]},'description':{'type':Sequelize[_0xeeba('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xeeba('0x2')]},'password':{'type':Sequelize[_0xeeba('0x2')]},'clientId':{'type':Sequelize[_0xeeba('0x2')]},'clientSecret':{'type':Sequelize[_0xeeba('0x2')]},'securityToken':{'type':Sequelize[_0xeeba('0x2')]},'serverUrl':{'type':Sequelize[_0xeeba('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeeba('0x3')](_0xeeba('0x4'),_0xeeba('0x5')),'defaultValue':_0xeeba('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 951c7ff..003bdf9 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7754=['Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','username','password','slice','substring','lastIndexOf','Connection','clientSecret','login','securityToken','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','phone','includes','label','picklistValues','True','true','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','map','SalesforceAccount','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','options','then','findAll','catch','show','include','create','body','find','params','getConfigurations','SalesforceConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects'];(function(_0x1bfec9,_0x2a863a){var _0x35cb18=function(_0x257a02){while(--_0x257a02){_0x1bfec9['push'](_0x1bfec9['shift']());}};_0x35cb18(++_0x2a863a);}(_0x7754,0x186));var _0x4775=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0x7754[_0x510c60];return _0x49c4aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4775('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4775('0x1'));var rp=require('request-promise');var moment=require(_0x4775('0x2'));var BPromise=require(_0x4775('0x3'));var Mustache=require(_0x4775('0x4'));var util=require(_0x4775('0x5'));var path=require(_0x4775('0x6'));var sox=require(_0x4775('0x7'));var csv=require(_0x4775('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4775('0x9'));var _=require(_0x4775('0xa'));var squel=require(_0x4775('0xb'));var crypto=require(_0x4775('0xc'));var jsforce=require(_0x4775('0xd'));var deskjs=require(_0x4775('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4775('0xf'));var Papa=require('papaparse');var Redis=require(_0x4775('0x10'));var authService=require(_0x4775('0x11'));var qs=require(_0x4775('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4775('0x13'));var logger=require('../../config/logger')(_0x4775('0x14'));var utils=require(_0x4775('0x15'));var config=require(_0x4775('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4775('0x17'))['db'];var integrations=require(_0x4775('0x18'));function respondWithStatusCode(_0x34f582,_0xbc5f9c){_0xbc5f9c=_0xbc5f9c||0xcc;return function(_0x6d616f){if(_0x6d616f){return _0x34f582[_0x4775('0x19')](_0xbc5f9c);}return _0x34f582[_0x4775('0x1a')](_0xbc5f9c)[_0x4775('0x1b')]();};}function respondWithResult(_0x199f93,_0x7332f5){_0x7332f5=_0x7332f5||0xc8;return function(_0x14fa4e){if(_0x14fa4e){return _0x199f93[_0x4775('0x1a')](_0x7332f5)[_0x4775('0x1c')](_0x14fa4e);}};}function respondWithFilteredResult(_0x22df83,_0x40d1b5){return function(_0x4cea0b){if(_0x4cea0b){var _0x4843cc=typeof _0x40d1b5[_0x4775('0x1d')]===_0x4775('0x1e')&&typeof _0x40d1b5['limit']===_0x4775('0x1e');var _0x3e6f08=_0x4cea0b[_0x4775('0x1f')];var _0x4b0791=_0x4843cc?0x0:_0x40d1b5['offset'];var _0x70fcc0=_0x4843cc?_0x4cea0b[_0x4775('0x1f')]:_0x40d1b5[_0x4775('0x1d')]+_0x40d1b5[_0x4775('0x20')];var _0x3ff1da;if(_0x70fcc0>=_0x3e6f08){_0x70fcc0=_0x3e6f08;_0x3ff1da=0xc8;}else{_0x3ff1da=0xce;}_0x22df83['status'](_0x3ff1da);return _0x22df83[_0x4775('0x21')](_0x4775('0x22'),_0x4b0791+'-'+_0x70fcc0+'/'+_0x3e6f08)['json'](_0x4cea0b);}return null;};}function patchUpdates(_0x2534d1){return function(_0x4214e7){try{jsonpatch[_0x4775('0x23')](_0x4214e7,_0x2534d1,!![]);}catch(_0x3cbd4a){return BPromise[_0x4775('0x24')](_0x3cbd4a);}return _0x4214e7[_0x4775('0x25')]();};}function saveUpdates(_0x14d246,_0x24dc3d){return function(_0x5bc010){if(_0x5bc010){return _0x5bc010[_0x4775('0x26')](_0x14d246)['then'](function(_0x58c6c6){return _0x58c6c6;});}return null;};}function removeEntity(_0x4c3b1e,_0x238fe2){return function(_0x553c4b){if(_0x553c4b){return _0x553c4b['destroy']()['then'](function(){_0x4c3b1e[_0x4775('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44569e,_0x18b555){return function(_0x362953){if(!_0x362953){_0x44569e[_0x4775('0x19')](0x194);}return _0x362953;};}function handleError(_0x132683,_0x262946){_0x262946=_0x262946||0x1f4;return function(_0x3d2390){logger['error'](_0x3d2390[_0x4775('0x27')]);if(_0x3d2390[_0x4775('0x28')]){delete _0x3d2390['name'];}_0x132683['status'](_0x262946)['send'](_0x3d2390);};}exports['index']=function(_0x4d8f5e,_0x4af8f6){var _0x129ad1={},_0x7e34f4={},_0x545bc8={'count':0x0,'rows':[]};var _0x380202=_[_0x4775('0x29')](db[_0x4775('0x2a')][_0x4775('0x2b')],function(_0x2e9cce){return{'name':_0x2e9cce['fieldName'],'type':_0x2e9cce[_0x4775('0x2c')][_0x4775('0x2d')]};});_0x7e34f4['model']=_[_0x4775('0x29')](_0x380202,_0x4775('0x28'));_0x7e34f4[_0x4775('0x2e')]=_[_0x4775('0x2f')](_0x4d8f5e[_0x4775('0x2e')]);_0x7e34f4['filters']=_['intersection'](_0x7e34f4[_0x4775('0x30')],_0x7e34f4[_0x4775('0x2e')]);_0x129ad1[_0x4775('0x31')]=_[_0x4775('0x32')](_0x7e34f4[_0x4775('0x30')],qs[_0x4775('0x33')](_0x4d8f5e[_0x4775('0x2e')][_0x4775('0x33')]));_0x129ad1[_0x4775('0x31')]=_0x129ad1['attributes'][_0x4775('0x34')]?_0x129ad1[_0x4775('0x31')]:_0x7e34f4[_0x4775('0x30')];if(!_0x4d8f5e[_0x4775('0x2e')]['hasOwnProperty'](_0x4775('0x35'))){_0x129ad1[_0x4775('0x20')]=qs[_0x4775('0x20')](_0x4d8f5e[_0x4775('0x2e')][_0x4775('0x20')]);_0x129ad1['offset']=qs[_0x4775('0x1d')](_0x4d8f5e[_0x4775('0x2e')][_0x4775('0x1d')]);}_0x129ad1[_0x4775('0x36')]=qs['sort'](_0x4d8f5e['query'][_0x4775('0x37')]);_0x129ad1[_0x4775('0x38')]=qs[_0x4775('0x39')](_['pick'](_0x4d8f5e[_0x4775('0x2e')],_0x7e34f4['filters']),_0x380202);if(_0x4d8f5e[_0x4775('0x2e')][_0x4775('0x3a')]){_0x129ad1['where']=_['merge'](_0x129ad1[_0x4775('0x38')],{'$or':_[_0x4775('0x29')](_0x380202,function(_0x2449b0){if(_0x2449b0[_0x4775('0x2c')]!=='VIRTUAL'){var _0x234857={};_0x234857[_0x2449b0[_0x4775('0x28')]]={'$like':'%'+_0x4d8f5e['query'][_0x4775('0x3a')]+'%'};return _0x234857;}})});}_0x129ad1=_[_0x4775('0x3b')]({},_0x129ad1,_0x4d8f5e[_0x4775('0x3c')]);var _0x56fcf8={'where':_0x129ad1[_0x4775('0x38')]};return db[_0x4775('0x2a')][_0x4775('0x1f')](_0x56fcf8)[_0x4775('0x3d')](function(_0xcd95aa){_0x545bc8[_0x4775('0x1f')]=_0xcd95aa;if(_0x4d8f5e['query']['includeAll']){_0x129ad1['include']=[{'all':!![]}];}return db[_0x4775('0x2a')][_0x4775('0x3e')](_0x129ad1);})[_0x4775('0x3d')](function(_0x3809f6){_0x545bc8['rows']=_0x3809f6;return _0x545bc8;})[_0x4775('0x3d')](respondWithFilteredResult(_0x4af8f6,_0x129ad1))[_0x4775('0x3f')](handleError(_0x4af8f6,null));};exports[_0x4775('0x40')]=function(_0x2f305d,_0x388cb2){var _0xcbcdce={'raw':![],'where':{'id':_0x2f305d['params']['id']}},_0x5f4901={};_0x5f4901[_0x4775('0x30')]=_[_0x4775('0x2f')](db['SalesforceAccount'][_0x4775('0x2b')]);_0x5f4901[_0x4775('0x2e')]=_[_0x4775('0x2f')](_0x2f305d[_0x4775('0x2e')]);_0x5f4901[_0x4775('0x39')]=_[_0x4775('0x32')](_0x5f4901[_0x4775('0x30')],_0x5f4901[_0x4775('0x2e')]);_0xcbcdce['attributes']=_['intersection'](_0x5f4901['model'],qs[_0x4775('0x33')](_0x2f305d[_0x4775('0x2e')][_0x4775('0x33')]));_0xcbcdce[_0x4775('0x31')]=_0xcbcdce[_0x4775('0x31')][_0x4775('0x34')]?_0xcbcdce[_0x4775('0x31')]:_0x5f4901[_0x4775('0x30')];if(_0x2f305d[_0x4775('0x2e')]['includeAll']){_0xcbcdce[_0x4775('0x41')]=[{'all':!![]}];}_0xcbcdce=_['merge']({},_0xcbcdce,_0x2f305d[_0x4775('0x3c')]);return db[_0x4775('0x2a')]['find'](_0xcbcdce)[_0x4775('0x3d')](handleEntityNotFound(_0x388cb2,null))['then'](respondWithResult(_0x388cb2,null))['catch'](handleError(_0x388cb2,null));};exports[_0x4775('0x42')]=function(_0x168026,_0x1f21a1){return db[_0x4775('0x2a')][_0x4775('0x42')](_0x168026[_0x4775('0x43')],{})[_0x4775('0x3d')](respondWithResult(_0x1f21a1,0xc9))['catch'](handleError(_0x1f21a1,null));};exports['update']=function(_0x3eee97,_0x381e85){if(_0x3eee97['body']['id']){delete _0x3eee97[_0x4775('0x43')]['id'];}return db['SalesforceAccount'][_0x4775('0x44')]({'where':{'id':_0x3eee97[_0x4775('0x45')]['id']}})['then'](handleEntityNotFound(_0x381e85,null))[_0x4775('0x3d')](saveUpdates(_0x3eee97['body'],null))['then'](respondWithResult(_0x381e85,null))[_0x4775('0x3f')](handleError(_0x381e85,null));};exports['destroy']=function(_0x4402a9,_0x228f15){return db[_0x4775('0x2a')][_0x4775('0x44')]({'where':{'id':_0x4402a9['params']['id']}})['then'](handleEntityNotFound(_0x228f15,null))['then'](removeEntity(_0x228f15,null))[_0x4775('0x3f')](handleError(_0x228f15,null));};exports[_0x4775('0x46')]=function(_0x496313,_0x11305d,_0x25b61f){var _0x494515={};var _0x4591de={};var _0x5c50a6;var _0x264ee8;return db[_0x4775('0x2a')]['findOne']({'where':{'id':_0x496313[_0x4775('0x45')]['id']}})[_0x4775('0x3d')](handleEntityNotFound(_0x11305d,null))['then'](function(_0x1476b4){if(_0x1476b4){_0x5c50a6=_0x1476b4;_0x4591de['model']=_['keys'](db[_0x4775('0x47')]['rawAttributes']);_0x4591de[_0x4775('0x2e')]=_[_0x4775('0x2f')](_0x496313[_0x4775('0x2e')]);_0x4591de[_0x4775('0x39')]=_['intersection'](_0x4591de['model'],_0x4591de['query']);_0x494515[_0x4775('0x31')]=_['intersection'](_0x4591de['model'],qs[_0x4775('0x33')](_0x496313['query']['fields']));_0x494515[_0x4775('0x31')]=_0x494515[_0x4775('0x31')][_0x4775('0x34')]?_0x494515[_0x4775('0x31')]:_0x4591de[_0x4775('0x30')];_0x494515[_0x4775('0x36')]=qs[_0x4775('0x37')](_0x496313[_0x4775('0x2e')][_0x4775('0x37')]);_0x494515[_0x4775('0x38')]=qs['filters'](_['pick'](_0x496313[_0x4775('0x2e')],_0x4591de['filters']));if(_0x496313[_0x4775('0x2e')][_0x4775('0x3a')]){_0x494515['where']=_[_0x4775('0x3b')](_0x494515['where'],{'$or':_[_0x4775('0x29')](_0x494515[_0x4775('0x31')],function(_0x3de5bb){var _0xe0cb47={};_0xe0cb47[_0x3de5bb]={'$like':'%'+_0x496313[_0x4775('0x2e')][_0x4775('0x3a')]+'%'};return _0xe0cb47;})});}_0x494515=_[_0x4775('0x3b')]({},_0x494515,_0x496313['options']);return _0x5c50a6[_0x4775('0x46')](_0x494515);}})[_0x4775('0x3d')](function(_0x1a3950){if(_0x1a3950){_0x264ee8=_0x1a3950[_0x4775('0x34')];if(!_0x496313[_0x4775('0x2e')][_0x4775('0x48')](_0x4775('0x35'))){_0x494515[_0x4775('0x20')]=qs['limit'](_0x496313[_0x4775('0x2e')][_0x4775('0x20')]);_0x494515[_0x4775('0x1d')]=qs[_0x4775('0x1d')](_0x496313['query'][_0x4775('0x1d')]);}return _0x5c50a6[_0x4775('0x46')](_0x494515);}})[_0x4775('0x3d')](function(_0x5ae5d8){if(_0x5ae5d8){return _0x5ae5d8?{'count':_0x264ee8,'rows':_0x5ae5d8}:null;}})['then'](respondWithResult(_0x11305d,null))[_0x4775('0x3f')](handleError(_0x11305d,null));};exports[_0x4775('0x49')]=function(_0x56a0a5,_0x5cfee5,_0x518d00){if(_0x56a0a5['body']['id']){delete _0x56a0a5['body']['id'];}return db[_0x4775('0x2a')][_0x4775('0x4a')]({'where':{'id':_0x56a0a5[_0x4775('0x45')]['id']}})[_0x4775('0x3d')](handleEntityNotFound(_0x5cfee5,null))[_0x4775('0x3d')](function(_0xe657a1){if(_0xe657a1){_0x56a0a5[_0x4775('0x43')][_0x4775('0x4b')]=_0xe657a1['id'];_0x56a0a5[_0x4775('0x43')][_0x4775('0x4c')]=integrations[_0x4775('0x4d')](_0x56a0a5['body']['channel'],_0x56a0a5[_0x4775('0x43')][_0x4775('0x2c')]);_0x56a0a5[_0x4775('0x43')][_0x4775('0x4e')]=integrations[_0x4775('0x4f')](_0x56a0a5[_0x4775('0x43')]['channel'],_0x56a0a5[_0x4775('0x43')]['type']);return db[_0x4775('0x47')][_0x4775('0x42')](_0x56a0a5['body'],{'include':[{'model':db[_0x4775('0x50')],'as':_0x4775('0x4c')},{'model':db[_0x4775('0x50')],'as':'Descriptions'}]});}return null;})[_0x4775('0x3d')](respondWithResult(_0x5cfee5,null))['catch'](handleError(_0x5cfee5,null));};exports[_0x4775('0x51')]=function(_0xc7f748,_0x4de2fe,_0x2eb60a){var _0x29825a;var _0x36d35b='';var _0x5b48d6='Task';return db['SalesforceAccount'][_0x4775('0x4a')]({'where':{'id':_0xc7f748[_0x4775('0x45')]['id']},'attributes':['id',_0x4775('0x52'),_0x4775('0x53'),'clientSecret',_0x4775('0x54'),_0x4775('0x55'),'securityToken']})[_0x4775('0x3d')](handleEntityNotFound(_0x4de2fe,null))[_0x4775('0x3d')](function(_0x2ab93c){if(_0x2ab93c){_0x36d35b=_0x2ab93c[_0x4775('0x52')];var _0x2a89bc=_0x36d35b[_0x4775('0x56')](-0x1);if(_0x2a89bc==='/'){_0x36d35b=_0x36d35b[_0x4775('0x57')](0x0,_0x36d35b[_0x4775('0x58')](_0x2a89bc));}_0x29825a=new jsforce[(_0x4775('0x59'))]({'oauth2':{'loginUrl':_0x36d35b,'clientId':_0x2ab93c[_0x4775('0x53')],'clientSecret':_0x2ab93c[_0x4775('0x5a')]}});return _0x29825a[_0x4775('0x5b')](_0x2ab93c[_0x4775('0x54')],_0x2ab93c[_0x4775('0x55')]['concat'](_0x2ab93c[_0x4775('0x5c')]));}})[_0x4775('0x3d')](function(_0x2fc54d){if(_0x2fc54d){if(!_['isNil'](_0xc7f748[_0x4775('0x2e')][_0x4775('0x5d')])){_0x5b48d6=_0xc7f748[_0x4775('0x2e')][_0x4775('0x5d')];}return _0x29825a[_0x4775('0x5e')](_0x5b48d6)['describe']();}})[_0x4775('0x3d')](function(_0x581a66){var _0x31077c=['OwnerId',_0x4775('0x5f'),_0x4775('0x60'),_0x4775('0x61'),_0x4775('0x62'),_0x4775('0x63')];var _0x4d695d=['string',_0x4775('0x64'),_0x4775('0x65'),_0x4775('0x66'),'email','textarea',_0x4775('0x67')];if(_0x581a66){_['remove'](_0x581a66[_0x4775('0x33')],function(_0x2dab03){return _0x31077c['includes'](_0x2dab03['name'])||!_0x4d695d[_0x4775('0x68')](_0x2dab03[_0x4775('0x2c')]);});return{'count':_0x581a66['fields'][_0x4775('0x34')],'rows':_[_0x4775('0x29')](_0x581a66['fields'],function(_0xe2c0dd){return{'id':_0xe2c0dd[_0x4775('0x28')],'name':_0xe2c0dd[_0x4775('0x69')],'custom':_0xe2c0dd['custom'],'options':_0xe2c0dd['picklistValues'][_0x4775('0x34')]>0x0?_[_0x4775('0x29')](_0xe2c0dd[_0x4775('0x6a')],function(_0x4eb390){return{'name':_0x4eb390[_0x4775('0x69')],'value':_0x4eb390['value']};}):_0xe2c0dd[_0x4775('0x2c')]==_0x4775('0x66')?[{'name':_0x4775('0x6b'),'value':_0x4775('0x6c')},{'name':_0x4775('0x6d'),'value':'false'}]:[]};})};}})[_0x4775('0x3d')](respondWithResult(_0x4de2fe,null))[_0x4775('0x3f')](function(_0x447e3a){var _0x32d3bf=_0xc7f748[_0x4775('0x2e')][_0x4775('0x6e')]?0x1f4:_0x447e3a[_0x4775('0x6f')]||0x1f4;logger[_0x4775('0x70')](_0x4775('0x71'),'getFields',_0x32d3bf,JSON[_0x4775('0x72')](_0x447e3a));delete _0x447e3a[_0x4775('0x28')];if(_0x32d3bf===0x191){_0x32d3bf=0x190;}_0x4de2fe[_0x4775('0x1a')](_0x32d3bf)[_0x4775('0x73')](_0xc7f748[_0x4775('0x2e')][_0x4775('0x6e')]?{'message':_0x4775('0x74'),'statusCode':_0x447e3a['statusCode']}:_0x447e3a);});}; \ No newline at end of file +var _0x9c1e=['SalesforceField','getFields','Task','clientId','clientSecret','username','remoteUri','slice','substring','lastIndexOf','Connection','password','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','includeAll','include','rows','catch','show','find','create','body','update','params','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9c1e,0x1a9));var _0xe9c1=function(_0x34ebe1,_0x4e7a03){_0x34ebe1=_0x34ebe1-0x0;var _0x1151b5=_0x9c1e[_0x34ebe1];return _0x1151b5;};'use strict';var emlformat=require(_0xe9c1('0x0'));var rimraf=require(_0xe9c1('0x1'));var zipdir=require(_0xe9c1('0x2'));var jsonpatch=require(_0xe9c1('0x3'));var rp=require(_0xe9c1('0x4'));var moment=require('moment');var BPromise=require(_0xe9c1('0x5'));var Mustache=require(_0xe9c1('0x6'));var util=require(_0xe9c1('0x7'));var path=require(_0xe9c1('0x8'));var sox=require(_0xe9c1('0x9'));var csv=require(_0xe9c1('0xa'));var ejs=require(_0xe9c1('0xb'));var fs=require('fs');var fs_extra=require(_0xe9c1('0xc'));var _=require(_0xe9c1('0xd'));var squel=require(_0xe9c1('0xe'));var crypto=require(_0xe9c1('0xf'));var jsforce=require(_0xe9c1('0x10'));var deskjs=require(_0xe9c1('0x11'));var toCsv=require(_0xe9c1('0xa'));var querystring=require(_0xe9c1('0x12'));var Papa=require(_0xe9c1('0x13'));var Redis=require(_0xe9c1('0x14'));var authService=require(_0xe9c1('0x15'));var qs=require(_0xe9c1('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9c1('0x17'))(_0xe9c1('0x18'));var utils=require('../../config/utils');var config=require(_0xe9c1('0x19'));var licenseUtil=require(_0xe9c1('0x1a'));var db=require(_0xe9c1('0x1b'))['db'];var integrations=require(_0xe9c1('0x1c'));function respondWithStatusCode(_0x1eaa6d,_0x41ef00){_0x41ef00=_0x41ef00||0xcc;return function(_0x4d63fe){if(_0x4d63fe){return _0x1eaa6d[_0xe9c1('0x1d')](_0x41ef00);}return _0x1eaa6d['status'](_0x41ef00)[_0xe9c1('0x1e')]();};}function respondWithResult(_0x32e1a9,_0x505d05){_0x505d05=_0x505d05||0xc8;return function(_0x51e07f){if(_0x51e07f){return _0x32e1a9[_0xe9c1('0x1f')](_0x505d05)[_0xe9c1('0x20')](_0x51e07f);}};}function respondWithFilteredResult(_0x4faaf4,_0x1524c0){return function(_0x1272b2){if(_0x1272b2){var _0x4ee92e=typeof _0x1524c0[_0xe9c1('0x21')]===_0xe9c1('0x22')&&typeof _0x1524c0[_0xe9c1('0x23')]===_0xe9c1('0x22');var _0x1a42f5=_0x1272b2[_0xe9c1('0x24')];var _0x21f9ba=_0x4ee92e?0x0:_0x1524c0[_0xe9c1('0x21')];var _0x2f6dd6=_0x4ee92e?_0x1272b2[_0xe9c1('0x24')]:_0x1524c0[_0xe9c1('0x21')]+_0x1524c0[_0xe9c1('0x23')];var _0x42b4d2;if(_0x2f6dd6>=_0x1a42f5){_0x2f6dd6=_0x1a42f5;_0x42b4d2=0xc8;}else{_0x42b4d2=0xce;}_0x4faaf4['status'](_0x42b4d2);return _0x4faaf4[_0xe9c1('0x25')]('Content-Range',_0x21f9ba+'-'+_0x2f6dd6+'/'+_0x1a42f5)[_0xe9c1('0x20')](_0x1272b2);}return null;};}function patchUpdates(_0x460af9){return function(_0xce8018){try{jsonpatch['apply'](_0xce8018,_0x460af9,!![]);}catch(_0x4013d2){return BPromise['reject'](_0x4013d2);}return _0xce8018[_0xe9c1('0x26')]();};}function saveUpdates(_0x4de533,_0x2c3ba6){return function(_0x3131df){if(_0x3131df){return _0x3131df['update'](_0x4de533)[_0xe9c1('0x27')](function(_0xd9641d){return _0xd9641d;});}return null;};}function removeEntity(_0x42082b,_0x139f35){return function(_0x1527e7){if(_0x1527e7){return _0x1527e7[_0xe9c1('0x28')]()['then'](function(){_0x42082b[_0xe9c1('0x1f')](0xcc)[_0xe9c1('0x1e')]();});}};}function handleEntityNotFound(_0x436daf,_0x22a906){return function(_0x2c587f){if(!_0x2c587f){_0x436daf[_0xe9c1('0x1d')](0x194);}return _0x2c587f;};}function handleError(_0x471e56,_0x5c9d6e){_0x5c9d6e=_0x5c9d6e||0x1f4;return function(_0x37507c){logger[_0xe9c1('0x29')](_0x37507c[_0xe9c1('0x2a')]);if(_0x37507c['name']){delete _0x37507c[_0xe9c1('0x2b')];}_0x471e56[_0xe9c1('0x1f')](_0x5c9d6e)[_0xe9c1('0x2c')](_0x37507c);};}exports[_0xe9c1('0x2d')]=function(_0xd60d63,_0x1c8b17){var _0x476102={},_0x568325={},_0x59399b={'count':0x0,'rows':[]};var _0x37ad7b=_[_0xe9c1('0x2e')](db['SalesforceAccount'][_0xe9c1('0x2f')],function(_0x4c4be9){return{'name':_0x4c4be9[_0xe9c1('0x30')],'type':_0x4c4be9[_0xe9c1('0x31')][_0xe9c1('0x32')]};});_0x568325[_0xe9c1('0x33')]=_['map'](_0x37ad7b,_0xe9c1('0x2b'));_0x568325[_0xe9c1('0x34')]=_[_0xe9c1('0x35')](_0xd60d63[_0xe9c1('0x34')]);_0x568325[_0xe9c1('0x36')]=_['intersection'](_0x568325[_0xe9c1('0x33')],_0x568325[_0xe9c1('0x34')]);_0x476102[_0xe9c1('0x37')]=_[_0xe9c1('0x38')](_0x568325[_0xe9c1('0x33')],qs[_0xe9c1('0x39')](_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x39')]));_0x476102['attributes']=_0x476102[_0xe9c1('0x37')][_0xe9c1('0x3a')]?_0x476102[_0xe9c1('0x37')]:_0x568325[_0xe9c1('0x33')];if(!_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x3b')](_0xe9c1('0x3c'))){_0x476102[_0xe9c1('0x23')]=qs[_0xe9c1('0x23')](_0xd60d63['query'][_0xe9c1('0x23')]);_0x476102[_0xe9c1('0x21')]=qs[_0xe9c1('0x21')](_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x21')]);}_0x476102[_0xe9c1('0x3d')]=qs[_0xe9c1('0x3e')](_0xd60d63['query'][_0xe9c1('0x3e')]);_0x476102[_0xe9c1('0x3f')]=qs[_0xe9c1('0x36')](_[_0xe9c1('0x40')](_0xd60d63[_0xe9c1('0x34')],_0x568325[_0xe9c1('0x36')]),_0x37ad7b);if(_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x41')]){_0x476102[_0xe9c1('0x3f')]=_[_0xe9c1('0x42')](_0x476102[_0xe9c1('0x3f')],{'$or':_[_0xe9c1('0x2e')](_0x37ad7b,function(_0x4b8a6a){if(_0x4b8a6a['type']!=='VIRTUAL'){var _0x661c5e={};_0x661c5e[_0x4b8a6a[_0xe9c1('0x2b')]]={'$like':'%'+_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x41')]+'%'};return _0x661c5e;}})});}_0x476102=_[_0xe9c1('0x42')]({},_0x476102,_0xd60d63[_0xe9c1('0x43')]);var _0x2b5dfe={'where':_0x476102[_0xe9c1('0x3f')]};return db[_0xe9c1('0x44')][_0xe9c1('0x24')](_0x2b5dfe)[_0xe9c1('0x27')](function(_0x387148){_0x59399b['count']=_0x387148;if(_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x45')]){_0x476102[_0xe9c1('0x46')]=[{'all':!![]}];}return db[_0xe9c1('0x44')]['findAll'](_0x476102);})[_0xe9c1('0x27')](function(_0x812058){_0x59399b[_0xe9c1('0x47')]=_0x812058;return _0x59399b;})[_0xe9c1('0x27')](respondWithFilteredResult(_0x1c8b17,_0x476102))[_0xe9c1('0x48')](handleError(_0x1c8b17,null));};exports[_0xe9c1('0x49')]=function(_0x5ac45c,_0x444ba7){var _0x32f7d9={'raw':![],'where':{'id':_0x5ac45c['params']['id']}},_0x3b859f={};_0x3b859f['model']=_[_0xe9c1('0x35')](db[_0xe9c1('0x44')][_0xe9c1('0x2f')]);_0x3b859f[_0xe9c1('0x34')]=_['keys'](_0x5ac45c[_0xe9c1('0x34')]);_0x3b859f['filters']=_[_0xe9c1('0x38')](_0x3b859f[_0xe9c1('0x33')],_0x3b859f[_0xe9c1('0x34')]);_0x32f7d9['attributes']=_[_0xe9c1('0x38')](_0x3b859f[_0xe9c1('0x33')],qs['fields'](_0x5ac45c['query'][_0xe9c1('0x39')]));_0x32f7d9['attributes']=_0x32f7d9[_0xe9c1('0x37')][_0xe9c1('0x3a')]?_0x32f7d9[_0xe9c1('0x37')]:_0x3b859f[_0xe9c1('0x33')];if(_0x5ac45c[_0xe9c1('0x34')]['includeAll']){_0x32f7d9[_0xe9c1('0x46')]=[{'all':!![]}];}_0x32f7d9=_[_0xe9c1('0x42')]({},_0x32f7d9,_0x5ac45c[_0xe9c1('0x43')]);return db[_0xe9c1('0x44')][_0xe9c1('0x4a')](_0x32f7d9)[_0xe9c1('0x27')](handleEntityNotFound(_0x444ba7,null))[_0xe9c1('0x27')](respondWithResult(_0x444ba7,null))[_0xe9c1('0x48')](handleError(_0x444ba7,null));};exports[_0xe9c1('0x4b')]=function(_0x168450,_0x2cf238){return db[_0xe9c1('0x44')]['create'](_0x168450[_0xe9c1('0x4c')],{})[_0xe9c1('0x27')](respondWithResult(_0x2cf238,0xc9))[_0xe9c1('0x48')](handleError(_0x2cf238,null));};exports[_0xe9c1('0x4d')]=function(_0x437757,_0x316aa8){if(_0x437757['body']['id']){delete _0x437757[_0xe9c1('0x4c')]['id'];}return db[_0xe9c1('0x44')][_0xe9c1('0x4a')]({'where':{'id':_0x437757['params']['id']}})[_0xe9c1('0x27')](handleEntityNotFound(_0x316aa8,null))[_0xe9c1('0x27')](saveUpdates(_0x437757[_0xe9c1('0x4c')],null))[_0xe9c1('0x27')](respondWithResult(_0x316aa8,null))['catch'](handleError(_0x316aa8,null));};exports[_0xe9c1('0x28')]=function(_0x2567f0,_0x50b3a9){return db['SalesforceAccount'][_0xe9c1('0x4a')]({'where':{'id':_0x2567f0[_0xe9c1('0x4e')]['id']}})[_0xe9c1('0x27')](handleEntityNotFound(_0x50b3a9,null))[_0xe9c1('0x27')](removeEntity(_0x50b3a9,null))['catch'](handleError(_0x50b3a9,null));};exports['getConfigurations']=function(_0x13ee6c,_0x10eca4,_0x4a8c42){var _0x33d678={};var _0x834f95={};var _0x4f8439;var _0x16b932;return db[_0xe9c1('0x44')][_0xe9c1('0x4f')]({'where':{'id':_0x13ee6c[_0xe9c1('0x4e')]['id']}})[_0xe9c1('0x27')](handleEntityNotFound(_0x10eca4,null))['then'](function(_0x6b87d0){if(_0x6b87d0){_0x4f8439=_0x6b87d0;_0x834f95['model']=_[_0xe9c1('0x35')](db[_0xe9c1('0x50')][_0xe9c1('0x2f')]);_0x834f95[_0xe9c1('0x34')]=_['keys'](_0x13ee6c['query']);_0x834f95['filters']=_[_0xe9c1('0x38')](_0x834f95[_0xe9c1('0x33')],_0x834f95[_0xe9c1('0x34')]);_0x33d678['attributes']=_['intersection'](_0x834f95[_0xe9c1('0x33')],qs[_0xe9c1('0x39')](_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x39')]));_0x33d678['attributes']=_0x33d678['attributes'][_0xe9c1('0x3a')]?_0x33d678[_0xe9c1('0x37')]:_0x834f95[_0xe9c1('0x33')];_0x33d678[_0xe9c1('0x3d')]=qs[_0xe9c1('0x3e')](_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x3e')]);_0x33d678['where']=qs['filters'](_['pick'](_0x13ee6c[_0xe9c1('0x34')],_0x834f95[_0xe9c1('0x36')]));if(_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x41')]){_0x33d678['where']=_[_0xe9c1('0x42')](_0x33d678[_0xe9c1('0x3f')],{'$or':_[_0xe9c1('0x2e')](_0x33d678['attributes'],function(_0x20f99){var _0x5546c0={};_0x5546c0[_0x20f99]={'$like':'%'+_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x41')]+'%'};return _0x5546c0;})});}_0x33d678=_[_0xe9c1('0x42')]({},_0x33d678,_0x13ee6c[_0xe9c1('0x43')]);return _0x4f8439[_0xe9c1('0x51')](_0x33d678);}})['then'](function(_0xb5287c){if(_0xb5287c){_0x16b932=_0xb5287c[_0xe9c1('0x3a')];if(!_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x3b')](_0xe9c1('0x3c'))){_0x33d678[_0xe9c1('0x23')]=qs[_0xe9c1('0x23')](_0x13ee6c['query']['limit']);_0x33d678[_0xe9c1('0x21')]=qs[_0xe9c1('0x21')](_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x21')]);}return _0x4f8439[_0xe9c1('0x51')](_0x33d678);}})[_0xe9c1('0x27')](function(_0x368436){if(_0x368436){return _0x368436?{'count':_0x16b932,'rows':_0x368436}:null;}})[_0xe9c1('0x27')](respondWithResult(_0x10eca4,null))[_0xe9c1('0x48')](handleError(_0x10eca4,null));};exports[_0xe9c1('0x52')]=function(_0x564aca,_0x5f00fa,_0x41c4e9){if(_0x564aca[_0xe9c1('0x4c')]['id']){delete _0x564aca['body']['id'];}return db['SalesforceAccount'][_0xe9c1('0x4f')]({'where':{'id':_0x564aca[_0xe9c1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5f00fa,null))[_0xe9c1('0x27')](function(_0x4b9aa8){if(_0x4b9aa8){_0x564aca[_0xe9c1('0x4c')][_0xe9c1('0x53')]=_0x4b9aa8['id'];_0x564aca['body'][_0xe9c1('0x54')]=integrations['getSubjects'](_0x564aca['body'][_0xe9c1('0x55')],_0x564aca[_0xe9c1('0x4c')][_0xe9c1('0x31')]);_0x564aca[_0xe9c1('0x4c')]['Descriptions']=integrations[_0xe9c1('0x56')](_0x564aca[_0xe9c1('0x4c')]['channel'],_0x564aca[_0xe9c1('0x4c')][_0xe9c1('0x31')]);return db[_0xe9c1('0x50')][_0xe9c1('0x4b')](_0x564aca[_0xe9c1('0x4c')],{'include':[{'model':db[_0xe9c1('0x57')],'as':_0xe9c1('0x54')},{'model':db[_0xe9c1('0x57')],'as':'Descriptions'}]});}return null;})[_0xe9c1('0x27')](respondWithResult(_0x5f00fa,null))['catch'](handleError(_0x5f00fa,null));};exports[_0xe9c1('0x58')]=function(_0x115612,_0x305d39,_0x1b08e9){var _0x468db1;var _0x2279cf='';var _0x1f6bc5=_0xe9c1('0x59');return db[_0xe9c1('0x44')][_0xe9c1('0x4f')]({'where':{'id':_0x115612[_0xe9c1('0x4e')]['id']},'attributes':['id','remoteUri',_0xe9c1('0x5a'),_0xe9c1('0x5b'),_0xe9c1('0x5c'),'password','securityToken']})['then'](handleEntityNotFound(_0x305d39,null))[_0xe9c1('0x27')](function(_0x142e65){if(_0x142e65){_0x2279cf=_0x142e65[_0xe9c1('0x5d')];var _0x2cc4b8=_0x2279cf[_0xe9c1('0x5e')](-0x1);if(_0x2cc4b8==='/'){_0x2279cf=_0x2279cf[_0xe9c1('0x5f')](0x0,_0x2279cf[_0xe9c1('0x60')](_0x2cc4b8));}_0x468db1=new jsforce[(_0xe9c1('0x61'))]({'oauth2':{'loginUrl':_0x2279cf,'clientId':_0x142e65[_0xe9c1('0x5a')],'clientSecret':_0x142e65[_0xe9c1('0x5b')]}});return _0x468db1['login'](_0x142e65[_0xe9c1('0x5c')],_0x142e65[_0xe9c1('0x62')][_0xe9c1('0x63')](_0x142e65[_0xe9c1('0x64')]));}})[_0xe9c1('0x27')](function(_0x3972d2){if(_0x3972d2){if(!_[_0xe9c1('0x65')](_0x115612[_0xe9c1('0x34')][_0xe9c1('0x66')])){_0x1f6bc5=_0x115612['query'][_0xe9c1('0x66')];}return _0x468db1[_0xe9c1('0x67')](_0x1f6bc5)[_0xe9c1('0x68')]();}})[_0xe9c1('0x27')](function(_0x278339){var _0xd686fd=[_0xe9c1('0x69'),_0xe9c1('0x6a'),'IsReminderSet',_0xe9c1('0x6b'),'Subject',_0xe9c1('0x6c')];var _0x598b75=[_0xe9c1('0x6d'),_0xe9c1('0x6e'),_0xe9c1('0x6f'),_0xe9c1('0x70'),_0xe9c1('0x71'),_0xe9c1('0x72'),_0xe9c1('0x73')];if(_0x278339){_['remove'](_0x278339[_0xe9c1('0x39')],function(_0x6ed8a9){return _0xd686fd['includes'](_0x6ed8a9['name'])||!_0x598b75[_0xe9c1('0x74')](_0x6ed8a9[_0xe9c1('0x31')]);});return{'count':_0x278339['fields'][_0xe9c1('0x3a')],'rows':_[_0xe9c1('0x2e')](_0x278339[_0xe9c1('0x39')],function(_0x3d316f){return{'id':_0x3d316f[_0xe9c1('0x2b')],'name':_0x3d316f[_0xe9c1('0x75')],'custom':_0x3d316f[_0xe9c1('0x76')],'options':_0x3d316f[_0xe9c1('0x77')][_0xe9c1('0x3a')]>0x0?_[_0xe9c1('0x2e')](_0x3d316f[_0xe9c1('0x77')],function(_0x3c8ed3){return{'name':_0x3c8ed3[_0xe9c1('0x75')],'value':_0x3c8ed3[_0xe9c1('0x78')]};}):_0x3d316f[_0xe9c1('0x31')]==_0xe9c1('0x70')?[{'name':_0xe9c1('0x79'),'value':_0xe9c1('0x7a')},{'name':'False','value':_0xe9c1('0x7b')}]:[]};})};}})[_0xe9c1('0x27')](respondWithResult(_0x305d39,null))[_0xe9c1('0x48')](function(_0x4fea25){var _0x5d6cbc=_0x115612[_0xe9c1('0x34')]['test']?0x1f4:_0x4fea25[_0xe9c1('0x7c')]||0x1f4;logger[_0xe9c1('0x29')](_0xe9c1('0x7d'),_0xe9c1('0x58'),_0x5d6cbc,JSON['stringify'](_0x4fea25));delete _0x4fea25[_0xe9c1('0x2b')];if(_0x5d6cbc===0x191){_0x5d6cbc=0x190;}_0x305d39[_0xe9c1('0x1f')](_0x5d6cbc)[_0xe9c1('0x2c')](_0x115612['query'][_0xe9c1('0x7e')]?{'message':_0xe9c1('0x7f'),'statusCode':_0x4fea25[_0xe9c1('0x7c')]}:_0x4fea25);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a8f8ee1..759b5d8 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa71e=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x29e79b,_0x4a3649){var _0x6bc2b5=function(_0x57b630){while(--_0x57b630){_0x29e79b['push'](_0x29e79b['shift']());}};_0x6bc2b5(++_0x4a3649);}(_0xa71e,0x7b));var _0xea71=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xa71e[_0x49052b];return _0x48c045;};'use strict';var _=require(_0xea71('0x0'));var util=require(_0xea71('0x1'));var logger=require('../../config/logger')(_0xea71('0x2'));var moment=require('moment');var BPromise=require(_0xea71('0x3'));var rp=require(_0xea71('0x4'));var fs=require('fs');var path=require(_0xea71('0x5'));var rimraf=require(_0xea71('0x6'));var config=require(_0xea71('0x7'));var attributes=require(_0xea71('0x8'));var integrations=require(_0xea71('0x9'));module[_0xea71('0xa')]=function(_0x387227,_0x5c5a81){return _0x387227[_0xea71('0xb')](_0xea71('0xc'),attributes,{'tableName':_0xea71('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5b=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x2c4fea,_0x36366f){var _0x770b8c=function(_0x27cc3b){while(--_0x27cc3b){_0x2c4fea['push'](_0x2c4fea['shift']());}};_0x770b8c(++_0x36366f);}(_0x9d5b,0x71));var _0xb9d5=function(_0x7d3de7,_0x286519){_0x7d3de7=_0x7d3de7-0x0;var _0x3b74a2=_0x9d5b[_0x7d3de7];return _0x3b74a2;};'use strict';var _=require(_0xb9d5('0x0'));var util=require('util');var logger=require(_0xb9d5('0x1'))(_0xb9d5('0x2'));var moment=require(_0xb9d5('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9d5('0x4'));var fs=require('fs');var path=require(_0xb9d5('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d5('0x6'));var attributes=require(_0xb9d5('0x7'));var integrations=require(_0xb9d5('0x8'));module[_0xb9d5('0x9')]=function(_0x858576,_0x30cd32){return _0x858576[_0xb9d5('0xa')](_0xb9d5('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 1654aae..21f81ef 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02bb=['SalesforceAccount','findAll','options','where','limit','map','model','include','attributes','ShowSalesforceAccount','find','raw','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x02bb,0xec));var _0xb02b=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x02bb[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0xb02b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb02b('0x1'));var logger=require(_0xb02b('0x2'))(_0xb02b('0x3'));var config=require(_0xb02b('0x4'));var jayson=require(_0xb02b('0x5'));var client=jayson[_0xb02b('0x6')][_0xb02b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x419b23,_0x5c8253,_0xa1d08e){return new BPromise(function(_0xebc47b,_0x408b98){return client['request'](_0x419b23,_0xa1d08e)[_0xb02b('0x8')](function(_0x424516){logger[_0xb02b('0x9')]('SalesforceAccount,\x20%s,\x20%s',_0x5c8253,_0xb02b('0xa'));logger[_0xb02b('0xb')](_0xb02b('0xc'),_0x5c8253,_0xb02b('0xa'),JSON[_0xb02b('0xd')](_0x424516));if(_0x424516[_0xb02b('0xe')]){if(_0x424516[_0xb02b('0xe')][_0xb02b('0xf')]===0x1f4){logger[_0xb02b('0xe')](_0xb02b('0x10'),_0x5c8253,_0x424516[_0xb02b('0xe')][_0xb02b('0x11')]);return _0x408b98(_0x424516[_0xb02b('0xe')][_0xb02b('0x11')]);}logger[_0xb02b('0xe')](_0xb02b('0x10'),_0x5c8253,_0x424516[_0xb02b('0xe')][_0xb02b('0x11')]);return _0xebc47b(_0x424516[_0xb02b('0xe')]['message']);}else{logger[_0xb02b('0x9')]('SalesforceAccount,\x20%s,\x20%s',_0x5c8253,_0xb02b('0xa'));_0xebc47b(_0x424516['result'][_0xb02b('0x11')]);}})[_0xb02b('0x12')](function(_0x2e6553){logger['error'](_0xb02b('0x10'),_0x5c8253,_0x2e6553);_0x408b98(_0x2e6553);});});}exports[_0xb02b('0x13')]=function(_0x5bad72){var _0x28fb71=this;return new Promise(function(_0x5443fe,_0x40dcc0){return db[_0xb02b('0x14')][_0xb02b('0x15')]({'raw':_0x5bad72[_0xb02b('0x16')]?_0x5bad72[_0xb02b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5bad72[_0xb02b('0x16')]?_0x5bad72['options'][_0xb02b('0x17')]||null:null,'attributes':_0x5bad72[_0xb02b('0x16')]?_0x5bad72[_0xb02b('0x16')]['attributes']||null:null,'limit':_0x5bad72[_0xb02b('0x16')]?_0x5bad72[_0xb02b('0x16')][_0xb02b('0x18')]||null:null,'include':_0x5bad72[_0xb02b('0x16')]?_0x5bad72[_0xb02b('0x16')]['include']?_[_0xb02b('0x19')](_0x5bad72['options']['include'],function(_0x3229bd){return{'model':db[_0x3229bd[_0xb02b('0x1a')]],'as':_0x3229bd['as'],'attributes':_0x3229bd['attributes'],'include':_0x3229bd[_0xb02b('0x1b')]?_['map'](_0x3229bd['include'],function(_0x4f53cf){return{'model':db[_0x4f53cf[_0xb02b('0x1a')]],'as':_0x4f53cf['as'],'attributes':_0x4f53cf[_0xb02b('0x1c')],'include':_0x4f53cf['include']?_[_0xb02b('0x19')](_0x4f53cf[_0xb02b('0x1b')],function(_0x3da7b5){return{'model':db[_0x3da7b5['model']],'as':_0x3da7b5['as'],'attributes':_0x3da7b5[_0xb02b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb02b('0x8')](function(_0xeb92c5){logger[_0xb02b('0x9')](_0xb02b('0x13'),_0x5bad72);logger['debug'](_0xb02b('0x13'),_0x5bad72,JSON['stringify'](_0xeb92c5));_0x5443fe(_0xeb92c5);})[_0xb02b('0x12')](function(_0x557229){logger[_0xb02b('0xe')](_0xb02b('0x13'),_0x557229[_0xb02b('0x11')],_0x5bad72);_0x40dcc0(_0x28fb71['error'](0x1f4,_0x557229[_0xb02b('0x11')]));});});};exports[_0xb02b('0x1d')]=function(_0x43b297){var _0x594b19=this;return new Promise(function(_0x2d2a44,_0x1e7abf){return db[_0xb02b('0x14')][_0xb02b('0x1e')]({'raw':_0x43b297['options']?_0x43b297[_0xb02b('0x16')][_0xb02b('0x1f')]===undefined?!![]:![]:!![],'where':_0x43b297[_0xb02b('0x16')]?_0x43b297[_0xb02b('0x16')]['where']||null:null,'attributes':_0x43b297[_0xb02b('0x16')]?_0x43b297[_0xb02b('0x16')][_0xb02b('0x1c')]||null:null,'include':_0x43b297[_0xb02b('0x16')]?_0x43b297['options'][_0xb02b('0x1b')]?_[_0xb02b('0x19')](_0x43b297[_0xb02b('0x16')][_0xb02b('0x1b')],function(_0x3a75ce){return{'model':db[_0x3a75ce[_0xb02b('0x1a')]],'as':_0x3a75ce['as'],'attributes':_0x3a75ce[_0xb02b('0x1c')],'include':_0x3a75ce[_0xb02b('0x1b')]?_['map'](_0x3a75ce[_0xb02b('0x1b')],function(_0x348217){return{'model':db[_0x348217[_0xb02b('0x1a')]],'as':_0x348217['as'],'attributes':_0x348217[_0xb02b('0x1c')],'include':_0x348217['include']?_[_0xb02b('0x19')](_0x348217[_0xb02b('0x1b')],function(_0x164bdf){return{'model':db[_0x164bdf[_0xb02b('0x1a')]],'as':_0x164bdf['as'],'attributes':_0x164bdf[_0xb02b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb02b('0x8')](function(_0x145990){logger['info'](_0xb02b('0x1d'),_0x43b297);logger[_0xb02b('0xb')](_0xb02b('0x1d'),_0x43b297,JSON['stringify'](_0x145990));_0x2d2a44(_0x145990);})[_0xb02b('0x12')](function(_0xb78cd9){logger[_0xb02b('0xe')](_0xb02b('0x1d'),_0xb78cd9[_0xb02b('0x11')],_0x43b297);_0x1e7abf(_0x594b19[_0xb02b('0xe')](0x1f4,_0xb78cd9['message']));});});}; \ No newline at end of file +var _0xc6df=['map','model','attributes','ShowSalesforceAccount','find','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include'];(function(_0x18c23c,_0x5d31df){var _0xa3b55=function(_0x59ce50){while(--_0x59ce50){_0x18c23c['push'](_0x18c23c['shift']());}};_0xa3b55(++_0x5d31df);}(_0xc6df,0x115));var _0xfc6d=function(_0x5788fd,_0x1b27fa){_0x5788fd=_0x5788fd-0x0;var _0x24ec06=_0xc6df[_0x5788fd];return _0x24ec06;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc6d('0x0'));var BPromise=require(_0xfc6d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc6d('0x2'))['db'];var utils=require(_0xfc6d('0x3'));var logger=require(_0xfc6d('0x4'))(_0xfc6d('0x5'));var config=require(_0xfc6d('0x6'));var jayson=require(_0xfc6d('0x7'));var client=jayson[_0xfc6d('0x8')][_0xfc6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c9ead,_0x33714f,_0x1df6a7){return new BPromise(function(_0x17b466,_0x5067a0){return client['request'](_0x4c9ead,_0x1df6a7)[_0xfc6d('0xa')](function(_0x394ffa){logger['info'](_0xfc6d('0xb'),_0x33714f,'request\x20sent');logger[_0xfc6d('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x33714f,_0xfc6d('0xd'),JSON[_0xfc6d('0xe')](_0x394ffa));if(_0x394ffa[_0xfc6d('0xf')]){if(_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x10')]===0x1f4){logger[_0xfc6d('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x33714f,_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x11')]);return _0x5067a0(_0x394ffa[_0xfc6d('0xf')]['message']);}logger['error'](_0xfc6d('0xb'),_0x33714f,_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x11')]);return _0x17b466(_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x11')]);}else{logger[_0xfc6d('0x12')](_0xfc6d('0xb'),_0x33714f,_0xfc6d('0xd'));_0x17b466(_0x394ffa[_0xfc6d('0x13')][_0xfc6d('0x11')]);}})[_0xfc6d('0x14')](function(_0x1d892d){logger[_0xfc6d('0xf')](_0xfc6d('0xb'),_0x33714f,_0x1d892d);_0x5067a0(_0x1d892d);});});}exports[_0xfc6d('0x15')]=function(_0x56cc8f){var _0x8b8ceb=this;return new Promise(function(_0x4b0a5f,_0x1f702a){return db[_0xfc6d('0x16')][_0xfc6d('0x17')]({'raw':_0x56cc8f[_0xfc6d('0x18')]?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x19')]===undefined?!![]:![]:!![],'where':_0x56cc8f['options']?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1a')]||null:null,'attributes':_0x56cc8f['options']?_0x56cc8f[_0xfc6d('0x18')]['attributes']||null:null,'limit':_0x56cc8f[_0xfc6d('0x18')]?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1b')]||null:null,'include':_0x56cc8f['options']?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1c')],function(_0x105b2e){return{'model':db[_0x105b2e[_0xfc6d('0x1e')]],'as':_0x105b2e['as'],'attributes':_0x105b2e['attributes'],'include':_0x105b2e[_0xfc6d('0x1c')]?_['map'](_0x105b2e[_0xfc6d('0x1c')],function(_0x494bd9){return{'model':db[_0x494bd9[_0xfc6d('0x1e')]],'as':_0x494bd9['as'],'attributes':_0x494bd9[_0xfc6d('0x1f')],'include':_0x494bd9[_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x494bd9[_0xfc6d('0x1c')],function(_0x5bb04f){return{'model':db[_0x5bb04f[_0xfc6d('0x1e')]],'as':_0x5bb04f['as'],'attributes':_0x5bb04f[_0xfc6d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfc6d('0xa')](function(_0x5c88f8){logger['info'](_0xfc6d('0x15'),_0x56cc8f);logger[_0xfc6d('0xc')](_0xfc6d('0x15'),_0x56cc8f,JSON[_0xfc6d('0xe')](_0x5c88f8));_0x4b0a5f(_0x5c88f8);})[_0xfc6d('0x14')](function(_0x3fd304){logger['error'](_0xfc6d('0x15'),_0x3fd304[_0xfc6d('0x11')],_0x56cc8f);_0x1f702a(_0x8b8ceb[_0xfc6d('0xf')](0x1f4,_0x3fd304[_0xfc6d('0x11')]));});});};exports[_0xfc6d('0x20')]=function(_0x47c574){var _0x87de60=this;return new Promise(function(_0x5c02d9,_0x5b70b2){return db['SalesforceAccount'][_0xfc6d('0x21')]({'raw':_0x47c574[_0xfc6d('0x18')]?_0x47c574[_0xfc6d('0x18')][_0xfc6d('0x19')]===undefined?!![]:![]:!![],'where':_0x47c574['options']?_0x47c574[_0xfc6d('0x18')][_0xfc6d('0x1a')]||null:null,'attributes':_0x47c574[_0xfc6d('0x18')]?_0x47c574['options'][_0xfc6d('0x1f')]||null:null,'include':_0x47c574['options']?_0x47c574[_0xfc6d('0x18')][_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x47c574[_0xfc6d('0x18')]['include'],function(_0x32b293){return{'model':db[_0x32b293[_0xfc6d('0x1e')]],'as':_0x32b293['as'],'attributes':_0x32b293['attributes'],'include':_0x32b293[_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x32b293[_0xfc6d('0x1c')],function(_0x3b8bad){return{'model':db[_0x3b8bad[_0xfc6d('0x1e')]],'as':_0x3b8bad['as'],'attributes':_0x3b8bad['attributes'],'include':_0x3b8bad[_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x3b8bad[_0xfc6d('0x1c')],function(_0x1e215e){return{'model':db[_0x1e215e[_0xfc6d('0x1e')]],'as':_0x1e215e['as'],'attributes':_0x1e215e[_0xfc6d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4238da){logger[_0xfc6d('0x12')](_0xfc6d('0x20'),_0x47c574);logger[_0xfc6d('0xc')](_0xfc6d('0x20'),_0x47c574,JSON[_0xfc6d('0xe')](_0x4238da));_0x5c02d9(_0x4238da);})[_0xfc6d('0x14')](function(_0x2d9d3f){logger['error'](_0xfc6d('0x20'),_0x2d9d3f[_0xfc6d('0x11')],_0x47c574);_0x5b70b2(_0x87de60['error'](0x1f4,_0x2d9d3f[_0xfc6d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 362fb10..f1c2568 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x53f3ae,_0x1fadeb){var _0x1a8011=function(_0x215bc5){while(--_0x215bc5){_0x53f3ae['push'](_0x53f3ae['shift']());}};_0x1a8011(++_0x1fadeb);}(_0x7a54,0x106));var _0x47a5=function(_0x5b9a3e,_0x36fd2e){_0x5b9a3e=_0x5b9a3e-0x0;var _0x210a30=_0x7a54[_0x5b9a3e];return _0x210a30;};'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('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb28,0x106));var _0x8db2=function(_0x8a6253,_0x60fc8f){_0x8a6253=_0x8a6253-0x0;var _0x505ccd=_0xdb28[_0x8a6253];return _0x505ccd;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d67d73f..03821d2 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa227=['ENUM','Task','contact','lead','account_contact_lead','account','contact_lead','exports','STRING'];(function(_0x501239,_0x569942){var _0x272c00=function(_0x540ef2){while(--_0x540ef2){_0x501239['push'](_0x501239['shift']());}};_0x272c00(++_0x569942);}(_0xa227,0x16f));var _0x7a22=function(_0x5e27a5,_0x30dd3a){_0x5e27a5=_0x5e27a5-0x0;var _0x263a08=_0xa227[_0x5e27a5];return _0x263a08;};'use strict';var Sequelize=require('sequelize');module[_0x7a22('0x0')]={'name':{'type':Sequelize[_0x7a22('0x1')]},'description':{'type':Sequelize[_0x7a22('0x1')]},'ticketType':{'type':Sequelize[_0x7a22('0x2')](_0x7a22('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x7a22('0x4'),_0x7a22('0x5'),_0x7a22('0x6'),_0x7a22('0x7')),'defaultValue':_0x7a22('0x8')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x7a22('0x4'),_0x7a22('0x5'),_0x7a22('0x7')),'defaultValue':_0x7a22('0x5')},'leadId':{'type':Sequelize[_0x7a22('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x7a22('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x7a22('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x7a22('0x1')]}}; \ No newline at end of file +var _0xfd96=['nothing','sequelize','STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xfd96,0xe7));var _0x6fd9=function(_0x19babc,_0x50a993){_0x19babc=_0x19babc-0x0;var _0x13e3e8=_0xfd96[_0x19babc];return _0x13e3e8;};'use strict';var Sequelize=require(_0x6fd9('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fd9('0x1')]},'description':{'type':Sequelize[_0x6fd9('0x1')]},'ticketType':{'type':Sequelize[_0x6fd9('0x2')](_0x6fd9('0x3'),'Case'),'defaultValue':_0x6fd9('0x3')},'moduleSearch':{'type':Sequelize[_0x6fd9('0x2')](_0x6fd9('0x4'),_0x6fd9('0x5'),_0x6fd9('0x6'),_0x6fd9('0x7'),_0x6fd9('0x8')),'defaultValue':_0x6fd9('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x6fd9('0x9'),'contact',_0x6fd9('0x6'),_0x6fd9('0x8')),'defaultValue':_0x6fd9('0x6')},'leadId':{'type':Sequelize[_0x6fd9('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6fd9('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x6fd9('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x6fd9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 6a6be2f..87c2f27 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1744=['create','body','findOne','SalesforceField','order','sort','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','SalesforceConfiguration','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x4bd97b,_0x4f80f3){var _0x4e2871=function(_0x4b8fa4){while(--_0x4b8fa4){_0x4bd97b['push'](_0x4bd97b['shift']());}};_0x4e2871(++_0x4f80f3);}(_0x1744,0xa1));var _0x4174=function(_0x243f2c,_0x1a8bcf){_0x243f2c=_0x243f2c-0x0;var _0x1a2ae7=_0x1744[_0x243f2c];return _0x1a2ae7;};'use strict';var emlformat=require(_0x4174('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4174('0x1'));var jsonpatch=require(_0x4174('0x2'));var rp=require(_0x4174('0x3'));var moment=require('moment');var BPromise=require(_0x4174('0x4'));var Mustache=require(_0x4174('0x5'));var util=require('util');var path=require(_0x4174('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4174('0x7'));var fs=require('fs');var fs_extra=require(_0x4174('0x8'));var _=require(_0x4174('0x9'));var squel=require(_0x4174('0xa'));var crypto=require(_0x4174('0xb'));var jsforce=require(_0x4174('0xc'));var deskjs=require(_0x4174('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4174('0xe'));var Papa=require(_0x4174('0xf'));var Redis=require(_0x4174('0x10'));var authService=require(_0x4174('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4174('0x12'));var logger=require('../../config/logger')(_0x4174('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4174('0x14'));var db=require(_0x4174('0x15'))['db'];function respondWithStatusCode(_0x1f4b8f,_0x276c3c){_0x276c3c=_0x276c3c||0xcc;return function(_0x5b0474){if(_0x5b0474){return _0x1f4b8f['sendStatus'](_0x276c3c);}return _0x1f4b8f[_0x4174('0x16')](_0x276c3c)[_0x4174('0x17')]();};}function respondWithResult(_0x3fcb92,_0x5a2cf){_0x5a2cf=_0x5a2cf||0xc8;return function(_0x352df3){if(_0x352df3){return _0x3fcb92[_0x4174('0x16')](_0x5a2cf)[_0x4174('0x18')](_0x352df3);}};}function respondWithFilteredResult(_0x2fc857,_0xc40296){return function(_0x41cda1){if(_0x41cda1){var _0x4d24af=typeof _0xc40296[_0x4174('0x19')]===_0x4174('0x1a')&&typeof _0xc40296[_0x4174('0x1b')]==='undefined';var _0x364727=_0x41cda1[_0x4174('0x1c')];var _0x10aa5e=_0x4d24af?0x0:_0xc40296[_0x4174('0x19')];var _0x291538=_0x4d24af?_0x41cda1[_0x4174('0x1c')]:_0xc40296[_0x4174('0x19')]+_0xc40296[_0x4174('0x1b')];var _0x1ab20d;if(_0x291538>=_0x364727){_0x291538=_0x364727;_0x1ab20d=0xc8;}else{_0x1ab20d=0xce;}_0x2fc857[_0x4174('0x16')](_0x1ab20d);return _0x2fc857['set'](_0x4174('0x1d'),_0x10aa5e+'-'+_0x291538+'/'+_0x364727)[_0x4174('0x18')](_0x41cda1);}return null;};}function patchUpdates(_0x5428a1){return function(_0x2abc14){try{jsonpatch[_0x4174('0x1e')](_0x2abc14,_0x5428a1,!![]);}catch(_0x5e19bf){return BPromise[_0x4174('0x1f')](_0x5e19bf);}return _0x2abc14[_0x4174('0x20')]();};}function saveUpdates(_0x12d53f,_0x42752f){return function(_0x19d8e3){if(_0x19d8e3){return _0x19d8e3[_0x4174('0x21')](_0x12d53f)[_0x4174('0x22')](function(_0x1f73ca){return _0x1f73ca;});}return null;};}function removeEntity(_0x51c610,_0xfa6930){return function(_0xbe9df6){if(_0xbe9df6){return _0xbe9df6[_0x4174('0x23')]()[_0x4174('0x22')](function(){_0x51c610[_0x4174('0x16')](0xcc)[_0x4174('0x17')]();});}};}function handleEntityNotFound(_0x260697,_0x262806){return function(_0xcd2dd9){if(!_0xcd2dd9){_0x260697['sendStatus'](0x194);}return _0xcd2dd9;};}function handleError(_0x38338b,_0x3fb6f8){_0x3fb6f8=_0x3fb6f8||0x1f4;return function(_0x1201c3){logger[_0x4174('0x24')](_0x1201c3['stack']);if(_0x1201c3[_0x4174('0x25')]){delete _0x1201c3[_0x4174('0x25')];}_0x38338b['status'](_0x3fb6f8)[_0x4174('0x26')](_0x1201c3);};}exports['index']=function(_0x3148b3,_0x322ce8){var _0x300d54={},_0x5d0d28={},_0x38411f={'count':0x0,'rows':[]};var _0x3663b6=_[_0x4174('0x27')](db[_0x4174('0x28')][_0x4174('0x29')],function(_0x4812f8){return{'name':_0x4812f8['fieldName'],'type':_0x4812f8[_0x4174('0x2a')]['key']};});_0x5d0d28[_0x4174('0x2b')]=_[_0x4174('0x27')](_0x3663b6,_0x4174('0x25'));_0x5d0d28[_0x4174('0x2c')]=_['keys'](_0x3148b3[_0x4174('0x2c')]);_0x5d0d28['filters']=_['intersection'](_0x5d0d28[_0x4174('0x2b')],_0x5d0d28[_0x4174('0x2c')]);_0x300d54[_0x4174('0x2d')]=_[_0x4174('0x2e')](_0x5d0d28[_0x4174('0x2b')],qs[_0x4174('0x2f')](_0x3148b3[_0x4174('0x2c')][_0x4174('0x2f')]));_0x300d54[_0x4174('0x2d')]=_0x300d54['attributes'][_0x4174('0x30')]?_0x300d54[_0x4174('0x2d')]:_0x5d0d28['model'];if(!_0x3148b3[_0x4174('0x2c')][_0x4174('0x31')](_0x4174('0x32'))){_0x300d54[_0x4174('0x1b')]=qs[_0x4174('0x1b')](_0x3148b3['query'][_0x4174('0x1b')]);_0x300d54['offset']=qs[_0x4174('0x19')](_0x3148b3[_0x4174('0x2c')][_0x4174('0x19')]);}_0x300d54['order']=qs['sort'](_0x3148b3[_0x4174('0x2c')]['sort']);_0x300d54[_0x4174('0x33')]=qs[_0x4174('0x34')](_[_0x4174('0x35')](_0x3148b3[_0x4174('0x2c')],_0x5d0d28[_0x4174('0x34')]),_0x3663b6);if(_0x3148b3['query']['filter']){_0x300d54[_0x4174('0x33')]=_[_0x4174('0x36')](_0x300d54['where'],{'$or':_[_0x4174('0x27')](_0x3663b6,function(_0x446903){if(_0x446903[_0x4174('0x2a')]!==_0x4174('0x37')){var _0x4ef96e={};_0x4ef96e[_0x446903['name']]={'$like':'%'+_0x3148b3['query'][_0x4174('0x38')]+'%'};return _0x4ef96e;}})});}_0x300d54=_[_0x4174('0x36')]({},_0x300d54,_0x3148b3[_0x4174('0x39')]);var _0x558acb={'where':_0x300d54[_0x4174('0x33')]};return db[_0x4174('0x28')][_0x4174('0x1c')](_0x558acb)[_0x4174('0x22')](function(_0x48c3be){_0x38411f[_0x4174('0x1c')]=_0x48c3be;if(_0x3148b3[_0x4174('0x2c')][_0x4174('0x3a')]){_0x300d54[_0x4174('0x3b')]=[{'all':!![]}];}return db[_0x4174('0x28')][_0x4174('0x3c')](_0x300d54);})['then'](function(_0xe1d0a1){_0x38411f[_0x4174('0x3d')]=_0xe1d0a1;return _0x38411f;})[_0x4174('0x22')](respondWithFilteredResult(_0x322ce8,_0x300d54))[_0x4174('0x3e')](handleError(_0x322ce8,null));};exports[_0x4174('0x3f')]=function(_0x31c220,_0x5f071a){var _0x867d6a={'raw':![],'where':{'id':_0x31c220[_0x4174('0x40')]['id']}},_0x262879={};_0x262879[_0x4174('0x2b')]=_[_0x4174('0x41')](db[_0x4174('0x28')][_0x4174('0x29')]);_0x262879[_0x4174('0x2c')]=_['keys'](_0x31c220[_0x4174('0x2c')]);_0x262879[_0x4174('0x34')]=_[_0x4174('0x2e')](_0x262879[_0x4174('0x2b')],_0x262879[_0x4174('0x2c')]);_0x867d6a[_0x4174('0x2d')]=_[_0x4174('0x2e')](_0x262879[_0x4174('0x2b')],qs['fields'](_0x31c220['query'][_0x4174('0x2f')]));_0x867d6a['attributes']=_0x867d6a['attributes'][_0x4174('0x30')]?_0x867d6a[_0x4174('0x2d')]:_0x262879[_0x4174('0x2b')];if(_0x31c220[_0x4174('0x2c')][_0x4174('0x3a')]){_0x867d6a[_0x4174('0x3b')]=[{'all':!![]}];}_0x867d6a=_[_0x4174('0x36')]({},_0x867d6a,_0x31c220['options']);return db[_0x4174('0x28')][_0x4174('0x42')](_0x867d6a)['then'](handleEntityNotFound(_0x5f071a,null))[_0x4174('0x22')](respondWithResult(_0x5f071a,null))[_0x4174('0x3e')](handleError(_0x5f071a,null));};exports[_0x4174('0x43')]=function(_0x52ac47,_0x293e68){return db[_0x4174('0x28')][_0x4174('0x43')](_0x52ac47[_0x4174('0x44')],{})['then'](respondWithResult(_0x293e68,0xc9))['catch'](handleError(_0x293e68,null));};exports[_0x4174('0x21')]=function(_0x1b329e,_0x3b57ba){if(_0x1b329e[_0x4174('0x44')]['id']){delete _0x1b329e[_0x4174('0x44')]['id'];}return db['SalesforceConfiguration'][_0x4174('0x42')]({'where':{'id':_0x1b329e[_0x4174('0x40')]['id']}})['then'](handleEntityNotFound(_0x3b57ba,null))['then'](saveUpdates(_0x1b329e['body'],null))[_0x4174('0x22')](respondWithResult(_0x3b57ba,null))[_0x4174('0x3e')](handleError(_0x3b57ba,null));};exports[_0x4174('0x23')]=function(_0x3edbe3,_0x260a72){return db[_0x4174('0x28')][_0x4174('0x42')]({'where':{'id':_0x3edbe3[_0x4174('0x40')]['id']}})[_0x4174('0x22')](handleEntityNotFound(_0x260a72,null))['then'](removeEntity(_0x260a72,null))[_0x4174('0x3e')](handleError(_0x260a72,null));};exports['getFields']=function(_0x4711c2,_0xab200f,_0x1cae0e){var _0x22eade={};var _0x37598c={};var _0x20c723;var _0x54b2fe;return db[_0x4174('0x28')][_0x4174('0x45')]({'where':{'id':_0x4711c2[_0x4174('0x40')]['id']}})[_0x4174('0x22')](handleEntityNotFound(_0xab200f,null))[_0x4174('0x22')](function(_0x1b7d08){if(_0x1b7d08){_0x20c723=_0x1b7d08;_0x37598c[_0x4174('0x2b')]=_[_0x4174('0x41')](db[_0x4174('0x46')]['rawAttributes']);_0x37598c[_0x4174('0x2c')]=_[_0x4174('0x41')](_0x4711c2['query']);_0x37598c['filters']=_['intersection'](_0x37598c[_0x4174('0x2b')],_0x37598c[_0x4174('0x2c')]);_0x22eade['attributes']=_[_0x4174('0x2e')](_0x37598c[_0x4174('0x2b')],qs['fields'](_0x4711c2[_0x4174('0x2c')][_0x4174('0x2f')]));_0x22eade[_0x4174('0x2d')]=_0x22eade[_0x4174('0x2d')]['length']?_0x22eade[_0x4174('0x2d')]:_0x37598c[_0x4174('0x2b')];_0x22eade[_0x4174('0x47')]=qs[_0x4174('0x48')](_0x4711c2[_0x4174('0x2c')][_0x4174('0x48')]);_0x22eade['where']=qs[_0x4174('0x34')](_[_0x4174('0x35')](_0x4711c2[_0x4174('0x2c')],_0x37598c[_0x4174('0x34')]));if(_0x4711c2[_0x4174('0x2c')]['filter']){_0x22eade[_0x4174('0x33')]=_['merge'](_0x22eade['where'],{'$or':_['map'](_0x22eade['attributes'],function(_0x4eacb4){var _0x53fec6={};_0x53fec6[_0x4eacb4]={'$like':'%'+_0x4711c2[_0x4174('0x2c')][_0x4174('0x38')]+'%'};return _0x53fec6;})});}_0x22eade=_[_0x4174('0x36')]({},_0x22eade,_0x4711c2[_0x4174('0x39')]);return _0x20c723[_0x4174('0x49')](_0x22eade);}})[_0x4174('0x22')](function(_0x4c4eea){if(_0x4c4eea){_0x54b2fe=_0x4c4eea[_0x4174('0x30')];if(!_0x4711c2[_0x4174('0x2c')][_0x4174('0x31')]('nolimit')){_0x22eade[_0x4174('0x1b')]=qs[_0x4174('0x1b')](_0x4711c2[_0x4174('0x2c')][_0x4174('0x1b')]);_0x22eade['offset']=qs[_0x4174('0x19')](_0x4711c2[_0x4174('0x2c')][_0x4174('0x19')]);}return _0x20c723[_0x4174('0x49')](_0x22eade);}})[_0x4174('0x22')](function(_0x2f710f){if(_0x2f710f){return _0x2f710f?{'count':_0x54b2fe,'rows':_0x2f710f}:null;}})[_0x4174('0x22')](respondWithResult(_0xab200f,null))[_0x4174('0x3e')](handleError(_0xab200f,null));};exports[_0x4174('0x4a')]=function(_0x13b34d,_0x2f1543,_0xce63c9){var _0x44e5a2={};var _0x5f4043={};var _0x91f579;var _0x57dcbf;return db['SalesforceConfiguration'][_0x4174('0x45')]({'where':{'id':_0x13b34d[_0x4174('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f1543,null))[_0x4174('0x22')](function(_0x437f29){if(_0x437f29){_0x91f579=_0x437f29;_0x5f4043[_0x4174('0x2b')]=_['keys'](db[_0x4174('0x46')][_0x4174('0x29')]);_0x5f4043[_0x4174('0x2c')]=_[_0x4174('0x41')](_0x13b34d[_0x4174('0x2c')]);_0x5f4043['filters']=_['intersection'](_0x5f4043[_0x4174('0x2b')],_0x5f4043[_0x4174('0x2c')]);_0x44e5a2[_0x4174('0x2d')]=_[_0x4174('0x2e')](_0x5f4043[_0x4174('0x2b')],qs[_0x4174('0x2f')](_0x13b34d['query']['fields']));_0x44e5a2[_0x4174('0x2d')]=_0x44e5a2['attributes']['length']?_0x44e5a2[_0x4174('0x2d')]:_0x5f4043[_0x4174('0x2b')];_0x44e5a2[_0x4174('0x47')]=qs['sort'](_0x13b34d[_0x4174('0x2c')][_0x4174('0x48')]);_0x44e5a2[_0x4174('0x33')]=qs[_0x4174('0x34')](_[_0x4174('0x35')](_0x13b34d['query'],_0x5f4043[_0x4174('0x34')]));if(_0x13b34d[_0x4174('0x2c')][_0x4174('0x38')]){_0x44e5a2[_0x4174('0x33')]=_['merge'](_0x44e5a2[_0x4174('0x33')],{'$or':_['map'](_0x44e5a2[_0x4174('0x2d')],function(_0x31a701){var _0x1b5836={};_0x1b5836[_0x31a701]={'$like':'%'+_0x13b34d[_0x4174('0x2c')]['filter']+'%'};return _0x1b5836;})});}_0x44e5a2=_[_0x4174('0x36')]({},_0x44e5a2,_0x13b34d['options']);return _0x91f579[_0x4174('0x4a')](_0x44e5a2);}})['then'](function(_0x4bc227){if(_0x4bc227){_0x57dcbf=_0x4bc227[_0x4174('0x30')];if(!_0x13b34d[_0x4174('0x2c')][_0x4174('0x31')]('nolimit')){_0x44e5a2[_0x4174('0x1b')]=qs[_0x4174('0x1b')](_0x13b34d[_0x4174('0x2c')][_0x4174('0x1b')]);_0x44e5a2[_0x4174('0x19')]=qs[_0x4174('0x19')](_0x13b34d['query']['offset']);}return _0x91f579['getSubjects'](_0x44e5a2);}})[_0x4174('0x22')](function(_0x185de3){if(_0x185de3){return _0x185de3?{'count':_0x57dcbf,'rows':_0x185de3}:null;}})[_0x4174('0x22')](respondWithResult(_0x2f1543,null))[_0x4174('0x3e')](handleError(_0x2f1543,null));};exports[_0x4174('0x4b')]=function(_0x2ccdde,_0x55a50d,_0xbd2f51){var _0x4e7224={};var _0x2d2243={};var _0x2d85db;var _0xfbccea;return db[_0x4174('0x28')][_0x4174('0x45')]({'where':{'id':_0x2ccdde['params']['id']}})[_0x4174('0x22')](handleEntityNotFound(_0x55a50d,null))['then'](function(_0x1588aa){if(_0x1588aa){_0x2d85db=_0x1588aa;_0x2d2243['model']=_[_0x4174('0x41')](db[_0x4174('0x46')][_0x4174('0x29')]);_0x2d2243['query']=_['keys'](_0x2ccdde[_0x4174('0x2c')]);_0x2d2243[_0x4174('0x34')]=_['intersection'](_0x2d2243[_0x4174('0x2b')],_0x2d2243[_0x4174('0x2c')]);_0x4e7224[_0x4174('0x2d')]=_['intersection'](_0x2d2243[_0x4174('0x2b')],qs[_0x4174('0x2f')](_0x2ccdde['query'][_0x4174('0x2f')]));_0x4e7224[_0x4174('0x2d')]=_0x4e7224['attributes']['length']?_0x4e7224[_0x4174('0x2d')]:_0x2d2243[_0x4174('0x2b')];_0x4e7224[_0x4174('0x47')]=qs[_0x4174('0x48')](_0x2ccdde['query'][_0x4174('0x48')]);_0x4e7224[_0x4174('0x33')]=qs['filters'](_[_0x4174('0x35')](_0x2ccdde[_0x4174('0x2c')],_0x2d2243[_0x4174('0x34')]));if(_0x2ccdde['query'][_0x4174('0x38')]){_0x4e7224['where']=_[_0x4174('0x36')](_0x4e7224[_0x4174('0x33')],{'$or':_['map'](_0x4e7224['attributes'],function(_0x48e196){var _0x41fc0c={};_0x41fc0c[_0x48e196]={'$like':'%'+_0x2ccdde[_0x4174('0x2c')][_0x4174('0x38')]+'%'};return _0x41fc0c;})});}_0x4e7224=_[_0x4174('0x36')]({},_0x4e7224,_0x2ccdde[_0x4174('0x39')]);return _0x2d85db[_0x4174('0x4b')](_0x4e7224);}})[_0x4174('0x22')](function(_0x2a6bea){if(_0x2a6bea){_0xfbccea=_0x2a6bea['length'];if(!_0x2ccdde['query']['hasOwnProperty'](_0x4174('0x32'))){_0x4e7224[_0x4174('0x1b')]=qs[_0x4174('0x1b')](_0x2ccdde[_0x4174('0x2c')][_0x4174('0x1b')]);_0x4e7224[_0x4174('0x19')]=qs[_0x4174('0x19')](_0x2ccdde['query'][_0x4174('0x19')]);}return _0x2d85db[_0x4174('0x4b')](_0x4e7224);}})[_0x4174('0x22')](function(_0x52efea){if(_0x52efea){return _0x52efea?{'count':_0xfbccea,'rows':_0x52efea}:null;}})['then'](respondWithResult(_0x55a50d,null))['catch'](handleError(_0x55a50d,null));}; \ No newline at end of file +var _0x6a8e=['index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','count','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','findOne','SalesforceField','order','getFields','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','end','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send'];(function(_0x4f3acd,_0x528a2c){var _0x1abbcb=function(_0x53779e){while(--_0x53779e){_0x4f3acd['push'](_0x4f3acd['shift']());}};_0x1abbcb(++_0x528a2c);}(_0x6a8e,0xc4));var _0xe6a8=function(_0x14f53d,_0xd6db59){_0x14f53d=_0x14f53d-0x0;var _0x3cea5b=_0x6a8e[_0x14f53d];return _0x3cea5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6a8('0x1'));var rp=require(_0xe6a8('0x2'));var moment=require('moment');var BPromise=require(_0xe6a8('0x3'));var Mustache=require(_0xe6a8('0x4'));var util=require(_0xe6a8('0x5'));var path=require(_0xe6a8('0x6'));var sox=require(_0xe6a8('0x7'));var csv=require('to-csv');var ejs=require(_0xe6a8('0x8'));var fs=require('fs');var fs_extra=require(_0xe6a8('0x9'));var _=require(_0xe6a8('0xa'));var squel=require(_0xe6a8('0xb'));var crypto=require(_0xe6a8('0xc'));var jsforce=require(_0xe6a8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6a8('0xe'));var Papa=require(_0xe6a8('0xf'));var Redis=require('ioredis');var authService=require(_0xe6a8('0x10'));var qs=require(_0xe6a8('0x11'));var as=require(_0xe6a8('0x12'));var hardwareService=require(_0xe6a8('0x13'));var logger=require('../../config/logger')(_0xe6a8('0x14'));var utils=require('../../config/utils');var config=require(_0xe6a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21ac6c,_0x383182){_0x383182=_0x383182||0xcc;return function(_0x32054e){if(_0x32054e){return _0x21ac6c['sendStatus'](_0x383182);}return _0x21ac6c[_0xe6a8('0x16')](_0x383182)[_0xe6a8('0x17')]();};}function respondWithResult(_0x4eb784,_0x405498){_0x405498=_0x405498||0xc8;return function(_0x408fec){if(_0x408fec){return _0x4eb784[_0xe6a8('0x16')](_0x405498)['json'](_0x408fec);}};}function respondWithFilteredResult(_0x1ebc64,_0x59ca94){return function(_0x19fc1a){if(_0x19fc1a){var _0xfa7897=typeof _0x59ca94[_0xe6a8('0x18')]==='undefined'&&typeof _0x59ca94[_0xe6a8('0x19')]===_0xe6a8('0x1a');var _0x144ff7=_0x19fc1a['count'];var _0x1c0c5a=_0xfa7897?0x0:_0x59ca94['offset'];var _0x39ade4=_0xfa7897?_0x19fc1a['count']:_0x59ca94[_0xe6a8('0x18')]+_0x59ca94[_0xe6a8('0x19')];var _0x4b6d4f;if(_0x39ade4>=_0x144ff7){_0x39ade4=_0x144ff7;_0x4b6d4f=0xc8;}else{_0x4b6d4f=0xce;}_0x1ebc64[_0xe6a8('0x16')](_0x4b6d4f);return _0x1ebc64[_0xe6a8('0x1b')](_0xe6a8('0x1c'),_0x1c0c5a+'-'+_0x39ade4+'/'+_0x144ff7)[_0xe6a8('0x1d')](_0x19fc1a);}return null;};}function patchUpdates(_0x39caee){return function(_0x5e02f4){try{jsonpatch[_0xe6a8('0x1e')](_0x5e02f4,_0x39caee,!![]);}catch(_0x5b600e){return BPromise[_0xe6a8('0x1f')](_0x5b600e);}return _0x5e02f4['save']();};}function saveUpdates(_0x21d384,_0x2e6109){return function(_0x1fd3d2){if(_0x1fd3d2){return _0x1fd3d2[_0xe6a8('0x20')](_0x21d384)[_0xe6a8('0x21')](function(_0x289c65){return _0x289c65;});}return null;};}function removeEntity(_0x3e5d98,_0x313486){return function(_0x5e405c){if(_0x5e405c){return _0x5e405c[_0xe6a8('0x22')]()[_0xe6a8('0x21')](function(){_0x3e5d98[_0xe6a8('0x16')](0xcc)[_0xe6a8('0x17')]();});}};}function handleEntityNotFound(_0x352a3b,_0x264468){return function(_0x372594){if(!_0x372594){_0x352a3b['sendStatus'](0x194);}return _0x372594;};}function handleError(_0x8683bd,_0x20eec9){_0x20eec9=_0x20eec9||0x1f4;return function(_0x224721){logger['error'](_0x224721[_0xe6a8('0x23')]);if(_0x224721[_0xe6a8('0x24')]){delete _0x224721[_0xe6a8('0x24')];}_0x8683bd[_0xe6a8('0x16')](_0x20eec9)[_0xe6a8('0x25')](_0x224721);};}exports[_0xe6a8('0x26')]=function(_0x263110,_0x2a21ff){var _0x122984={},_0x4d6a6f={},_0xd5655d={'count':0x0,'rows':[]};var _0x401694=_[_0xe6a8('0x27')](db[_0xe6a8('0x28')][_0xe6a8('0x29')],function(_0x5293a2){return{'name':_0x5293a2[_0xe6a8('0x2a')],'type':_0x5293a2['type'][_0xe6a8('0x2b')]};});_0x4d6a6f[_0xe6a8('0x2c')]=_[_0xe6a8('0x27')](_0x401694,_0xe6a8('0x24'));_0x4d6a6f['query']=_['keys'](_0x263110[_0xe6a8('0x2d')]);_0x4d6a6f[_0xe6a8('0x2e')]=_[_0xe6a8('0x2f')](_0x4d6a6f[_0xe6a8('0x2c')],_0x4d6a6f[_0xe6a8('0x2d')]);_0x122984[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x4d6a6f[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x122984[_0xe6a8('0x30')]=_0x122984['attributes'][_0xe6a8('0x32')]?_0x122984[_0xe6a8('0x30')]:_0x4d6a6f[_0xe6a8('0x2c')];if(!_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x33')](_0xe6a8('0x34'))){_0x122984[_0xe6a8('0x19')]=qs['limit'](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x122984[_0xe6a8('0x18')]=qs[_0xe6a8('0x18')](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x18')]);}_0x122984['order']=qs['sort'](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x35')]);_0x122984[_0xe6a8('0x36')]=qs[_0xe6a8('0x2e')](_[_0xe6a8('0x37')](_0x263110[_0xe6a8('0x2d')],_0x4d6a6f[_0xe6a8('0x2e')]),_0x401694);if(_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x38')]){_0x122984['where']=_[_0xe6a8('0x39')](_0x122984[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x401694,function(_0x2852ca){if(_0x2852ca[_0xe6a8('0x3a')]!=='VIRTUAL'){var _0x719f0f={};_0x719f0f[_0x2852ca[_0xe6a8('0x24')]]={'$like':'%'+_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x38')]+'%'};return _0x719f0f;}})});}_0x122984=_[_0xe6a8('0x39')]({},_0x122984,_0x263110['options']);var _0x3b9de0={'where':_0x122984[_0xe6a8('0x36')]};return db[_0xe6a8('0x28')][_0xe6a8('0x3b')](_0x3b9de0)['then'](function(_0x3e6c96){_0xd5655d[_0xe6a8('0x3b')]=_0x3e6c96;if(_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x3c')]){_0x122984[_0xe6a8('0x3d')]=[{'all':!![]}];}return db[_0xe6a8('0x28')][_0xe6a8('0x3e')](_0x122984);})[_0xe6a8('0x21')](function(_0xb6f46e){_0xd5655d[_0xe6a8('0x3f')]=_0xb6f46e;return _0xd5655d;})[_0xe6a8('0x21')](respondWithFilteredResult(_0x2a21ff,_0x122984))[_0xe6a8('0x40')](handleError(_0x2a21ff,null));};exports[_0xe6a8('0x41')]=function(_0x6209cb,_0x47cdf5){var _0x518e04={'raw':![],'where':{'id':_0x6209cb[_0xe6a8('0x42')]['id']}},_0x38b324={};_0x38b324[_0xe6a8('0x2c')]=_[_0xe6a8('0x43')](db[_0xe6a8('0x28')][_0xe6a8('0x29')]);_0x38b324['query']=_[_0xe6a8('0x43')](_0x6209cb['query']);_0x38b324[_0xe6a8('0x2e')]=_['intersection'](_0x38b324[_0xe6a8('0x2c')],_0x38b324[_0xe6a8('0x2d')]);_0x518e04[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x38b324[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x6209cb['query'][_0xe6a8('0x31')]));_0x518e04[_0xe6a8('0x30')]=_0x518e04[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x518e04[_0xe6a8('0x30')]:_0x38b324[_0xe6a8('0x2c')];if(_0x6209cb[_0xe6a8('0x2d')][_0xe6a8('0x3c')]){_0x518e04[_0xe6a8('0x3d')]=[{'all':!![]}];}_0x518e04=_[_0xe6a8('0x39')]({},_0x518e04,_0x6209cb[_0xe6a8('0x44')]);return db[_0xe6a8('0x28')]['find'](_0x518e04)[_0xe6a8('0x21')](handleEntityNotFound(_0x47cdf5,null))[_0xe6a8('0x21')](respondWithResult(_0x47cdf5,null))['catch'](handleError(_0x47cdf5,null));};exports[_0xe6a8('0x45')]=function(_0x3217b7,_0x30007d){return db[_0xe6a8('0x28')][_0xe6a8('0x45')](_0x3217b7['body'],{})[_0xe6a8('0x21')](respondWithResult(_0x30007d,0xc9))[_0xe6a8('0x40')](handleError(_0x30007d,null));};exports['update']=function(_0x42e8ce,_0x196ce6){if(_0x42e8ce['body']['id']){delete _0x42e8ce[_0xe6a8('0x46')]['id'];}return db[_0xe6a8('0x28')][_0xe6a8('0x47')]({'where':{'id':_0x42e8ce[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x196ce6,null))[_0xe6a8('0x21')](saveUpdates(_0x42e8ce[_0xe6a8('0x46')],null))[_0xe6a8('0x21')](respondWithResult(_0x196ce6,null))['catch'](handleError(_0x196ce6,null));};exports[_0xe6a8('0x22')]=function(_0x3e02f4,_0x2e278f){return db[_0xe6a8('0x28')]['find']({'where':{'id':_0x3e02f4[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x2e278f,null))[_0xe6a8('0x21')](removeEntity(_0x2e278f,null))[_0xe6a8('0x40')](handleError(_0x2e278f,null));};exports['getFields']=function(_0x56d42d,_0x581d14,_0x2b3a62){var _0x5e3fec={};var _0x4fe657={};var _0x302f33;var _0x2b42e7;return db[_0xe6a8('0x28')][_0xe6a8('0x48')]({'where':{'id':_0x56d42d['params']['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x581d14,null))['then'](function(_0x501701){if(_0x501701){_0x302f33=_0x501701;_0x4fe657['model']=_[_0xe6a8('0x43')](db[_0xe6a8('0x49')][_0xe6a8('0x29')]);_0x4fe657[_0xe6a8('0x2d')]=_[_0xe6a8('0x43')](_0x56d42d[_0xe6a8('0x2d')]);_0x4fe657[_0xe6a8('0x2e')]=_['intersection'](_0x4fe657['model'],_0x4fe657[_0xe6a8('0x2d')]);_0x5e3fec[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x4fe657[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x56d42d[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x5e3fec['attributes']=_0x5e3fec[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x5e3fec['attributes']:_0x4fe657['model'];_0x5e3fec[_0xe6a8('0x4a')]=qs[_0xe6a8('0x35')](_0x56d42d['query'][_0xe6a8('0x35')]);_0x5e3fec[_0xe6a8('0x36')]=qs[_0xe6a8('0x2e')](_[_0xe6a8('0x37')](_0x56d42d['query'],_0x4fe657['filters']));if(_0x56d42d['query']['filter']){_0x5e3fec[_0xe6a8('0x36')]=_['merge'](_0x5e3fec[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x5e3fec[_0xe6a8('0x30')],function(_0x20cf41){var _0x295c59={};_0x295c59[_0x20cf41]={'$like':'%'+_0x56d42d['query'][_0xe6a8('0x38')]+'%'};return _0x295c59;})});}_0x5e3fec=_[_0xe6a8('0x39')]({},_0x5e3fec,_0x56d42d[_0xe6a8('0x44')]);return _0x302f33[_0xe6a8('0x4b')](_0x5e3fec);}})[_0xe6a8('0x21')](function(_0x3d82e1){if(_0x3d82e1){_0x2b42e7=_0x3d82e1[_0xe6a8('0x32')];if(!_0x56d42d[_0xe6a8('0x2d')][_0xe6a8('0x33')]('nolimit')){_0x5e3fec[_0xe6a8('0x19')]=qs['limit'](_0x56d42d[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x5e3fec['offset']=qs['offset'](_0x56d42d['query'][_0xe6a8('0x18')]);}return _0x302f33[_0xe6a8('0x4b')](_0x5e3fec);}})[_0xe6a8('0x21')](function(_0xb36401){if(_0xb36401){return _0xb36401?{'count':_0x2b42e7,'rows':_0xb36401}:null;}})[_0xe6a8('0x21')](respondWithResult(_0x581d14,null))['catch'](handleError(_0x581d14,null));};exports['getSubjects']=function(_0xc8caa7,_0x2a2b7d,_0x547fc0){var _0x42c700={};var _0x4342fd={};var _0x6b8025;var _0x4a052c;return db[_0xe6a8('0x28')][_0xe6a8('0x48')]({'where':{'id':_0xc8caa7[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x2a2b7d,null))[_0xe6a8('0x21')](function(_0x14d77e){if(_0x14d77e){_0x6b8025=_0x14d77e;_0x4342fd[_0xe6a8('0x2c')]=_[_0xe6a8('0x43')](db[_0xe6a8('0x49')][_0xe6a8('0x29')]);_0x4342fd[_0xe6a8('0x2d')]=_[_0xe6a8('0x43')](_0xc8caa7[_0xe6a8('0x2d')]);_0x4342fd[_0xe6a8('0x2e')]=_['intersection'](_0x4342fd[_0xe6a8('0x2c')],_0x4342fd[_0xe6a8('0x2d')]);_0x42c700['attributes']=_[_0xe6a8('0x2f')](_0x4342fd[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x42c700[_0xe6a8('0x30')]=_0x42c700[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x42c700[_0xe6a8('0x30')]:_0x4342fd[_0xe6a8('0x2c')];_0x42c700['order']=qs[_0xe6a8('0x35')](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x35')]);_0x42c700[_0xe6a8('0x36')]=qs[_0xe6a8('0x2e')](_[_0xe6a8('0x37')](_0xc8caa7[_0xe6a8('0x2d')],_0x4342fd[_0xe6a8('0x2e')]));if(_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x38')]){_0x42c700[_0xe6a8('0x36')]=_[_0xe6a8('0x39')](_0x42c700[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x42c700[_0xe6a8('0x30')],function(_0x1fc933){var _0x46969e={};_0x46969e[_0x1fc933]={'$like':'%'+_0xc8caa7['query'][_0xe6a8('0x38')]+'%'};return _0x46969e;})});}_0x42c700=_['merge']({},_0x42c700,_0xc8caa7['options']);return _0x6b8025['getSubjects'](_0x42c700);}})[_0xe6a8('0x21')](function(_0x2bb6e6){if(_0x2bb6e6){_0x4a052c=_0x2bb6e6['length'];if(!_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x33')]('nolimit')){_0x42c700[_0xe6a8('0x19')]=qs[_0xe6a8('0x19')](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x42c700[_0xe6a8('0x18')]=qs['offset'](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x18')]);}return _0x6b8025[_0xe6a8('0x4c')](_0x42c700);}})[_0xe6a8('0x21')](function(_0x4fc910){if(_0x4fc910){return _0x4fc910?{'count':_0x4a052c,'rows':_0x4fc910}:null;}})[_0xe6a8('0x21')](respondWithResult(_0x2a2b7d,null))[_0xe6a8('0x40')](handleError(_0x2a2b7d,null));};exports[_0xe6a8('0x4d')]=function(_0x2935de,_0x24222b,_0x1d946f){var _0x2f980e={};var _0x2b187d={};var _0x4997d2;var _0x3b19eb;return db[_0xe6a8('0x28')][_0xe6a8('0x48')]({'where':{'id':_0x2935de[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x24222b,null))[_0xe6a8('0x21')](function(_0x1316f5){if(_0x1316f5){_0x4997d2=_0x1316f5;_0x2b187d[_0xe6a8('0x2c')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x2b187d[_0xe6a8('0x2d')]=_['keys'](_0x2935de[_0xe6a8('0x2d')]);_0x2b187d[_0xe6a8('0x2e')]=_['intersection'](_0x2b187d[_0xe6a8('0x2c')],_0x2b187d[_0xe6a8('0x2d')]);_0x2f980e[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x2b187d[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x2f980e[_0xe6a8('0x30')]=_0x2f980e[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x2f980e[_0xe6a8('0x30')]:_0x2b187d[_0xe6a8('0x2c')];_0x2f980e[_0xe6a8('0x4a')]=qs[_0xe6a8('0x35')](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x35')]);_0x2f980e['where']=qs[_0xe6a8('0x2e')](_['pick'](_0x2935de[_0xe6a8('0x2d')],_0x2b187d[_0xe6a8('0x2e')]));if(_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x38')]){_0x2f980e[_0xe6a8('0x36')]=_['merge'](_0x2f980e[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x2f980e['attributes'],function(_0x60436a){var _0x4aab78={};_0x4aab78[_0x60436a]={'$like':'%'+_0x2935de['query'][_0xe6a8('0x38')]+'%'};return _0x4aab78;})});}_0x2f980e=_[_0xe6a8('0x39')]({},_0x2f980e,_0x2935de[_0xe6a8('0x44')]);return _0x4997d2[_0xe6a8('0x4d')](_0x2f980e);}})[_0xe6a8('0x21')](function(_0x3a8964){if(_0x3a8964){_0x3b19eb=_0x3a8964['length'];if(!_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x33')]('nolimit')){_0x2f980e['limit']=qs['limit'](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x2f980e['offset']=qs[_0xe6a8('0x18')](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x18')]);}return _0x4997d2[_0xe6a8('0x4d')](_0x2f980e);}})[_0xe6a8('0x21')](function(_0x38c63f){if(_0x38c63f){return _0x38c63f?{'count':_0x3b19eb,'rows':_0x38c63f}:null;}})['then'](respondWithResult(_0x24222b,null))[_0xe6a8('0x40')](handleError(_0x24222b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 57bd635..5977dc4 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e3a=['rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1fdce6,_0x4412d9){var _0x36b546=function(_0x1bf3bb){while(--_0x1bf3bb){_0x1fdce6['push'](_0x1fdce6['shift']());}};_0x36b546(++_0x4412d9);}(_0x1e3a,0x10a));var _0xa1e3=function(_0x3dcf8a,_0x36426f){_0x3dcf8a=_0x3dcf8a-0x0;var _0x42d57e=_0x1e3a[_0x3dcf8a];return _0x42d57e;};'use strict';var _=require(_0xa1e3('0x0'));var util=require(_0xa1e3('0x1'));var logger=require(_0xa1e3('0x2'))('api');var moment=require(_0xa1e3('0x3'));var BPromise=require(_0xa1e3('0x4'));var rp=require(_0xa1e3('0x5'));var fs=require('fs');var path=require(_0xa1e3('0x6'));var rimraf=require(_0xa1e3('0x7'));var config=require('../../config/environment');var attributes=require(_0xa1e3('0x8'));module[_0xa1e3('0x9')]=function(_0x16bda1,_0x12f693){return _0x16bda1[_0xa1e3('0xa')](_0xa1e3('0xb'),attributes,{'tableName':_0xa1e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e0=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0xa0e0,0xad));var _0x0a0e=function(_0x5e604c,_0x308935){_0x5e604c=_0x5e604c-0x0;var _0x5c9e6b=_0xa0e0[_0x5e604c];return _0x5c9e6b;};'use strict';var _=require(_0x0a0e('0x0'));var util=require('util');var logger=require(_0x0a0e('0x1'))(_0x0a0e('0x2'));var moment=require(_0x0a0e('0x3'));var BPromise=require(_0x0a0e('0x4'));var rp=require(_0x0a0e('0x5'));var fs=require('fs');var path=require(_0x0a0e('0x6'));var rimraf=require(_0x0a0e('0x7'));var config=require(_0x0a0e('0x8'));var attributes=require(_0x0a0e('0x9'));module[_0x0a0e('0xa')]=function(_0x71a772,_0x59b1b3){return _0x71a772[_0x0a0e('0xb')](_0x0a0e('0xc'),attributes,{'tableName':_0x0a0e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 8d5ec44..cc3751c 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94be=['stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x17d84a,_0x443385){var _0xf52969=function(_0xc53a90){while(--_0xc53a90){_0x17d84a['push'](_0x17d84a['shift']());}};_0xf52969(++_0x443385);}(_0x94be,0xf7));var _0xe94b=function(_0x27c0fb,_0x3e64e2){_0x27c0fb=_0x27c0fb-0x0;var _0x1e845b=_0x94be[_0x27c0fb];return _0x1e845b;};'use strict';var _=require(_0xe94b('0x0'));var util=require('util');var moment=require(_0xe94b('0x1'));var BPromise=require(_0xe94b('0x2'));var rs=require(_0xe94b('0x3'));var fs=require('fs');var Redis=require(_0xe94b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe94b('0x5'));var logger=require(_0xe94b('0x6'))(_0xe94b('0x7'));var config=require(_0xe94b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe94b('0x9')][_0xe94b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a274a,_0x210bf8,_0x3607c4){return new BPromise(function(_0x4e5444,_0x25fe16){return client[_0xe94b('0xb')](_0x3a274a,_0x3607c4)[_0xe94b('0xc')](function(_0x5c6558){logger[_0xe94b('0xd')](_0xe94b('0xe'),_0x210bf8,_0xe94b('0xf'));logger['debug'](_0xe94b('0x10'),_0x210bf8,_0xe94b('0xf'),JSON[_0xe94b('0x11')](_0x5c6558));if(_0x5c6558['error']){if(_0x5c6558['error']['code']===0x1f4){logger[_0xe94b('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x210bf8,_0x5c6558[_0xe94b('0x12')][_0xe94b('0x13')]);return _0x25fe16(_0x5c6558['error'][_0xe94b('0x13')]);}logger[_0xe94b('0x12')](_0xe94b('0xe'),_0x210bf8,_0x5c6558[_0xe94b('0x12')]['message']);return _0x4e5444(_0x5c6558[_0xe94b('0x12')][_0xe94b('0x13')]);}else{logger['info'](_0xe94b('0xe'),_0x210bf8,_0xe94b('0xf'));_0x4e5444(_0x5c6558[_0xe94b('0x14')][_0xe94b('0x13')]);}})[_0xe94b('0x15')](function(_0x45e4b8){logger[_0xe94b('0x12')](_0xe94b('0xe'),_0x210bf8,_0x45e4b8);_0x25fe16(_0x45e4b8);});});} \ No newline at end of file +var _0xb699=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1ec734,_0x5a0993){var _0x504326=function(_0x51c73f){while(--_0x51c73f){_0x1ec734['push'](_0x1ec734['shift']());}};_0x504326(++_0x5a0993);}(_0xb699,0x17d));var _0x9b69=function(_0x252818,_0x36274d){_0x252818=_0x252818-0x0;var _0x22fdfe=_0xb699[_0x252818];return _0x22fdfe;};'use strict';var _=require(_0x9b69('0x0'));var util=require(_0x9b69('0x1'));var moment=require(_0x9b69('0x2'));var BPromise=require(_0x9b69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b69('0x4'));var db=require(_0x9b69('0x5'))['db'];var utils=require(_0x9b69('0x6'));var logger=require(_0x9b69('0x7'))('rpc');var config=require(_0x9b69('0x8'));var jayson=require(_0x9b69('0x9'));var client=jayson[_0x9b69('0xa')][_0x9b69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e0087,_0x4758d0,_0x544ac8){return new BPromise(function(_0x419a4b,_0xb96c57){return client[_0x9b69('0xc')](_0x4e0087,_0x544ac8)[_0x9b69('0xd')](function(_0x466995){logger[_0x9b69('0xe')](_0x9b69('0xf'),_0x4758d0,_0x9b69('0x10'));logger[_0x9b69('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4758d0,_0x9b69('0x10'),JSON[_0x9b69('0x12')](_0x466995));if(_0x466995[_0x9b69('0x13')]){if(_0x466995[_0x9b69('0x13')]['code']===0x1f4){logger['error'](_0x9b69('0xf'),_0x4758d0,_0x466995[_0x9b69('0x13')][_0x9b69('0x14')]);return _0xb96c57(_0x466995['error']['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4758d0,_0x466995[_0x9b69('0x13')][_0x9b69('0x14')]);return _0x419a4b(_0x466995[_0x9b69('0x13')][_0x9b69('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4758d0,'request\x20sent');_0x419a4b(_0x466995['result'][_0x9b69('0x14')]);}})[_0x9b69('0x15')](function(_0x53fd0a){logger[_0x9b69('0x13')](_0x9b69('0xf'),_0x4758d0,_0x53fd0a);_0xb96c57(_0x53fd0a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3ec4a95..e68fed2 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5dc=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xb9622e,_0x91225d){var _0x12969e=function(_0x5e8b52){while(--_0x5e8b52){_0xb9622e['push'](_0xb9622e['shift']());}};_0x12969e(++_0x91225d);}(_0xa5dc,0xc9));var _0xca5d=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0xa5dc[_0x11d95f];return _0x2b1a14;};'use strict';var multer=require(_0xca5d('0x0'));var util=require(_0xca5d('0x1'));var path=require(_0xca5d('0x2'));var timeout=require(_0xca5d('0x3'));var express=require(_0xca5d('0x4'));var router=express[_0xca5d('0x5')]();var fs_extra=require(_0xca5d('0x6'));var auth=require(_0xca5d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xca5d('0x8'));var controller=require(_0xca5d('0x9'));router[_0xca5d('0xa')]('/',auth[_0xca5d('0xb')](),controller[_0xca5d('0xc')]);router[_0xca5d('0xa')](_0xca5d('0xd'),auth['isAuthenticated'](),controller[_0xca5d('0xe')]);router[_0xca5d('0xf')]('/',auth[_0xca5d('0xb')](),controller[_0xca5d('0x10')]);router[_0xca5d('0x11')]('/:id',auth[_0xca5d('0xb')](),controller[_0xca5d('0x12')]);router[_0xca5d('0x13')](_0xca5d('0xd'),auth[_0xca5d('0xb')](),controller[_0xca5d('0x14')]);module[_0xca5d('0x15')]=router; \ No newline at end of file +var _0x85f4=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c26c4,_0x4ab76e){var _0x57bfd5=function(_0x57ff70){while(--_0x57ff70){_0x3c26c4['push'](_0x3c26c4['shift']());}};_0x57bfd5(++_0x4ab76e);}(_0x85f4,0x83));var _0x485f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x85f4[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x485f('0x0'));var util=require(_0x485f('0x1'));var path=require(_0x485f('0x2'));var timeout=require('connect-timeout');var express=require(_0x485f('0x3'));var router=express[_0x485f('0x4')]();var fs_extra=require(_0x485f('0x5'));var auth=require(_0x485f('0x6'));var interaction=require(_0x485f('0x7'));var config=require(_0x485f('0x8'));var controller=require(_0x485f('0x9'));router[_0x485f('0xa')]('/',auth[_0x485f('0xb')](),controller[_0x485f('0xc')]);router[_0x485f('0xa')](_0x485f('0xd'),auth[_0x485f('0xb')](),controller[_0x485f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x485f('0xf')]);router[_0x485f('0x10')](_0x485f('0xd'),auth[_0x485f('0xb')](),controller[_0x485f('0x11')]);router[_0x485f('0x12')](_0x485f('0xd'),auth['isAuthenticated'](),controller[_0x485f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8b970a8..2955f9c 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3f0=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xe3f0,0xf8));var _0x0e3f=function(_0x1101e2,_0x2bed37){_0x1101e2=_0x1101e2-0x0;var _0xdb5f33=_0xe3f0[_0x1101e2];return _0xdb5f33;};'use strict';var Sequelize=require('sequelize');module[_0x0e3f('0x0')]={'type':{'type':Sequelize[_0x0e3f('0x1')](_0x0e3f('0x2'),_0x0e3f('0x3'),_0x0e3f('0x4'),_0x0e3f('0x5'),_0x0e3f('0x6')),'defaultValue':_0x0e3f('0x2')},'content':{'type':Sequelize[_0x0e3f('0x7')]},'key':{'type':Sequelize[_0x0e3f('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0e3f('0x3'),_0x0e3f('0x4'))},'keyContent':{'type':Sequelize[_0x0e3f('0x7')]},'idField':{'type':Sequelize[_0x0e3f('0x7')]},'variableName':{'type':Sequelize[_0x0e3f('0x7')]}}; \ No newline at end of file +var _0xaa21=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x16fab5,_0x3203cd){var _0x1746ba=function(_0x5638fc){while(--_0x5638fc){_0x16fab5['push'](_0x16fab5['shift']());}};_0x1746ba(++_0x3203cd);}(_0xaa21,0x153));var _0x1aa2=function(_0x2ff3ac,_0x2c2417){_0x2ff3ac=_0x2ff3ac-0x0;var _0x2c8ef1=_0xaa21[_0x2ff3ac];return _0x2c8ef1;};'use strict';var Sequelize=require(_0x1aa2('0x0'));module[_0x1aa2('0x1')]={'type':{'type':Sequelize[_0x1aa2('0x2')]('string',_0x1aa2('0x3'),_0x1aa2('0x4'),_0x1aa2('0x5'),_0x1aa2('0x6')),'defaultValue':_0x1aa2('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1aa2('0x8')]},'keyType':{'type':Sequelize[_0x1aa2('0x2')](_0x1aa2('0x7'),'variable',_0x1aa2('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1aa2('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6531be8..a1467a2 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a9d=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','nolimit','limit','order','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','length','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x191919,_0x1c1b70){var _0x390cd6=function(_0x2f9b96){while(--_0x2f9b96){_0x191919['push'](_0x191919['shift']());}};_0x390cd6(++_0x1c1b70);}(_0x5a9d,0xd0));var _0xd5a9=function(_0x182757,_0x31991a){_0x182757=_0x182757-0x0;var _0x57c714=_0x5a9d[_0x182757];return _0x57c714;};'use strict';var emlformat=require(_0xd5a9('0x0'));var rimraf=require(_0xd5a9('0x1'));var zipdir=require(_0xd5a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd5a9('0x3'));var Mustache=require(_0xd5a9('0x4'));var util=require(_0xd5a9('0x5'));var path=require(_0xd5a9('0x6'));var sox=require(_0xd5a9('0x7'));var csv=require(_0xd5a9('0x8'));var ejs=require(_0xd5a9('0x9'));var fs=require('fs');var fs_extra=require(_0xd5a9('0xa'));var _=require(_0xd5a9('0xb'));var squel=require(_0xd5a9('0xc'));var crypto=require(_0xd5a9('0xd'));var jsforce=require(_0xd5a9('0xe'));var deskjs=require(_0xd5a9('0xf'));var toCsv=require(_0xd5a9('0x8'));var querystring=require(_0xd5a9('0x10'));var Papa=require(_0xd5a9('0x11'));var Redis=require(_0xd5a9('0x12'));var authService=require(_0xd5a9('0x13'));var qs=require(_0xd5a9('0x14'));var as=require(_0xd5a9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5a9('0x16'))(_0xd5a9('0x17'));var utils=require(_0xd5a9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd5a9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x126a76,_0x473cc9){_0x473cc9=_0x473cc9||0xcc;return function(_0x1758eb){if(_0x1758eb){return _0x126a76[_0xd5a9('0x1a')](_0x473cc9);}return _0x126a76['status'](_0x473cc9)['end']();};}function respondWithResult(_0x3ac05f,_0x12a2a5){_0x12a2a5=_0x12a2a5||0xc8;return function(_0x1cd7b1){if(_0x1cd7b1){return _0x3ac05f[_0xd5a9('0x1b')](_0x12a2a5)['json'](_0x1cd7b1);}};}function respondWithFilteredResult(_0x26916f,_0x1c6449){return function(_0x1f047e){if(_0x1f047e){var _0x4be074=typeof _0x1c6449[_0xd5a9('0x1c')]===_0xd5a9('0x1d')&&typeof _0x1c6449['limit']==='undefined';var _0x515bb1=_0x1f047e['count'];var _0x3a8b30=_0x4be074?0x0:_0x1c6449['offset'];var _0x261714=_0x4be074?_0x1f047e[_0xd5a9('0x1e')]:_0x1c6449[_0xd5a9('0x1c')]+_0x1c6449['limit'];var _0x347c39;if(_0x261714>=_0x515bb1){_0x261714=_0x515bb1;_0x347c39=0xc8;}else{_0x347c39=0xce;}_0x26916f[_0xd5a9('0x1b')](_0x347c39);return _0x26916f[_0xd5a9('0x1f')](_0xd5a9('0x20'),_0x3a8b30+'-'+_0x261714+'/'+_0x515bb1)['json'](_0x1f047e);}return null;};}function patchUpdates(_0x48e52c){return function(_0x437f41){try{jsonpatch[_0xd5a9('0x21')](_0x437f41,_0x48e52c,!![]);}catch(_0x1f951c){return BPromise[_0xd5a9('0x22')](_0x1f951c);}return _0x437f41[_0xd5a9('0x23')]();};}function saveUpdates(_0x3c9124,_0x4d32a2){return function(_0x2a8529){if(_0x2a8529){return _0x2a8529[_0xd5a9('0x24')](_0x3c9124)[_0xd5a9('0x25')](function(_0x2c8bac){return _0x2c8bac;});}return null;};}function removeEntity(_0x32c304,_0x4a1971){return function(_0xab243f){if(_0xab243f){return _0xab243f[_0xd5a9('0x26')]()[_0xd5a9('0x25')](function(){_0x32c304[_0xd5a9('0x1b')](0xcc)[_0xd5a9('0x27')]();});}};}function handleEntityNotFound(_0x1c7ad0,_0x310ae9){return function(_0x1a5fcf){if(!_0x1a5fcf){_0x1c7ad0[_0xd5a9('0x1a')](0x194);}return _0x1a5fcf;};}function handleError(_0x2cb94f,_0x33f7fd){_0x33f7fd=_0x33f7fd||0x1f4;return function(_0x26e37d){logger[_0xd5a9('0x28')](_0x26e37d[_0xd5a9('0x29')]);if(_0x26e37d['name']){delete _0x26e37d[_0xd5a9('0x2a')];}_0x2cb94f[_0xd5a9('0x1b')](_0x33f7fd)[_0xd5a9('0x2b')](_0x26e37d);};}exports['index']=function(_0x703043,_0x4be9f3){var _0xf8e2ed={},_0x13f375={},_0x1757db={'count':0x0,'rows':[]};var _0x8d7438=_[_0xd5a9('0x2c')](db[_0xd5a9('0x2d')][_0xd5a9('0x2e')],function(_0x551e9c){return{'name':_0x551e9c[_0xd5a9('0x2f')],'type':_0x551e9c[_0xd5a9('0x30')][_0xd5a9('0x31')]};});_0x13f375[_0xd5a9('0x32')]=_[_0xd5a9('0x2c')](_0x8d7438,_0xd5a9('0x2a'));_0x13f375[_0xd5a9('0x33')]=_['keys'](_0x703043[_0xd5a9('0x33')]);_0x13f375['filters']=_['intersection'](_0x13f375['model'],_0x13f375['query']);_0xf8e2ed[_0xd5a9('0x34')]=_[_0xd5a9('0x35')](_0x13f375[_0xd5a9('0x32')],qs[_0xd5a9('0x36')](_0x703043[_0xd5a9('0x33')][_0xd5a9('0x36')]));_0xf8e2ed[_0xd5a9('0x34')]=_0xf8e2ed[_0xd5a9('0x34')]['length']?_0xf8e2ed['attributes']:_0x13f375['model'];if(!_0x703043[_0xd5a9('0x33')]['hasOwnProperty'](_0xd5a9('0x37'))){_0xf8e2ed[_0xd5a9('0x38')]=qs['limit'](_0x703043[_0xd5a9('0x33')]['limit']);_0xf8e2ed[_0xd5a9('0x1c')]=qs[_0xd5a9('0x1c')](_0x703043[_0xd5a9('0x33')][_0xd5a9('0x1c')]);}_0xf8e2ed[_0xd5a9('0x39')]=qs['sort'](_0x703043[_0xd5a9('0x33')]['sort']);_0xf8e2ed[_0xd5a9('0x3a')]=qs[_0xd5a9('0x3b')](_['pick'](_0x703043[_0xd5a9('0x33')],_0x13f375['filters']),_0x8d7438);if(_0x703043[_0xd5a9('0x33')][_0xd5a9('0x3c')]){_0xf8e2ed[_0xd5a9('0x3a')]=_[_0xd5a9('0x3d')](_0xf8e2ed[_0xd5a9('0x3a')],{'$or':_[_0xd5a9('0x2c')](_0x8d7438,function(_0x548099){if(_0x548099['type']!==_0xd5a9('0x3e')){var _0x387e8c={};_0x387e8c[_0x548099[_0xd5a9('0x2a')]]={'$like':'%'+_0x703043[_0xd5a9('0x33')][_0xd5a9('0x3c')]+'%'};return _0x387e8c;}})});}_0xf8e2ed=_[_0xd5a9('0x3d')]({},_0xf8e2ed,_0x703043[_0xd5a9('0x3f')]);var _0xd8b241={'where':_0xf8e2ed[_0xd5a9('0x3a')]};return db[_0xd5a9('0x2d')][_0xd5a9('0x1e')](_0xd8b241)[_0xd5a9('0x25')](function(_0xe260ba){_0x1757db[_0xd5a9('0x1e')]=_0xe260ba;if(_0x703043[_0xd5a9('0x33')]['includeAll']){_0xf8e2ed[_0xd5a9('0x40')]=[{'all':!![]}];}return db[_0xd5a9('0x2d')][_0xd5a9('0x41')](_0xf8e2ed);})[_0xd5a9('0x25')](function(_0x46bf6d){_0x1757db['rows']=_0x46bf6d;return _0x1757db;})[_0xd5a9('0x25')](respondWithFilteredResult(_0x4be9f3,_0xf8e2ed))[_0xd5a9('0x42')](handleError(_0x4be9f3,null));};exports[_0xd5a9('0x43')]=function(_0x1b7940,_0x5153aa){var _0x2b9847={'raw':!![],'where':{'id':_0x1b7940['params']['id']}},_0x16c7d0={};_0x16c7d0['model']=_['keys'](db[_0xd5a9('0x2d')][_0xd5a9('0x2e')]);_0x16c7d0['query']=_[_0xd5a9('0x44')](_0x1b7940[_0xd5a9('0x33')]);_0x16c7d0[_0xd5a9('0x3b')]=_[_0xd5a9('0x35')](_0x16c7d0[_0xd5a9('0x32')],_0x16c7d0[_0xd5a9('0x33')]);_0x2b9847[_0xd5a9('0x34')]=_[_0xd5a9('0x35')](_0x16c7d0[_0xd5a9('0x32')],qs[_0xd5a9('0x36')](_0x1b7940['query'][_0xd5a9('0x36')]));_0x2b9847[_0xd5a9('0x34')]=_0x2b9847['attributes'][_0xd5a9('0x45')]?_0x2b9847[_0xd5a9('0x34')]:_0x16c7d0['model'];if(_0x1b7940['query']['includeAll']){_0x2b9847[_0xd5a9('0x40')]=[{'all':!![]}];}_0x2b9847=_[_0xd5a9('0x3d')]({},_0x2b9847,_0x1b7940[_0xd5a9('0x3f')]);return db[_0xd5a9('0x2d')][_0xd5a9('0x46')](_0x2b9847)[_0xd5a9('0x25')](handleEntityNotFound(_0x5153aa,null))[_0xd5a9('0x25')](respondWithResult(_0x5153aa,null))[_0xd5a9('0x42')](handleError(_0x5153aa,null));};exports[_0xd5a9('0x47')]=function(_0x3a1151,_0x61f9a6){return db['SalesforceField'][_0xd5a9('0x47')](_0x3a1151[_0xd5a9('0x48')],{})[_0xd5a9('0x25')](respondWithResult(_0x61f9a6,0xc9))[_0xd5a9('0x42')](handleError(_0x61f9a6,null));};exports['update']=function(_0x7cbf60,_0x49c8aa){if(_0x7cbf60['body']['id']){delete _0x7cbf60[_0xd5a9('0x48')]['id'];}return db[_0xd5a9('0x2d')][_0xd5a9('0x46')]({'where':{'id':_0x7cbf60[_0xd5a9('0x49')]['id']}})[_0xd5a9('0x25')](handleEntityNotFound(_0x49c8aa,null))[_0xd5a9('0x25')](saveUpdates(_0x7cbf60[_0xd5a9('0x48')],null))[_0xd5a9('0x25')](respondWithResult(_0x49c8aa,null))['catch'](handleError(_0x49c8aa,null));};exports[_0xd5a9('0x26')]=function(_0x37c2b1,_0x4e6808){return db[_0xd5a9('0x2d')]['find']({'where':{'id':_0x37c2b1[_0xd5a9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e6808,null))[_0xd5a9('0x25')](removeEntity(_0x4e6808,null))[_0xd5a9('0x42')](handleError(_0x4e6808,null));}; \ No newline at end of file +var _0x875e=['error','name','send','index','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','destroy','then'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0x875e,0x72));var _0xe875=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x875e[_0x3ae96c];return _0x1b0c90;};'use strict';var emlformat=require(_0xe875('0x0'));var rimraf=require(_0xe875('0x1'));var zipdir=require(_0xe875('0x2'));var jsonpatch=require(_0xe875('0x3'));var rp=require(_0xe875('0x4'));var moment=require(_0xe875('0x5'));var BPromise=require(_0xe875('0x6'));var Mustache=require(_0xe875('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe875('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe875('0x9'));var _=require(_0xe875('0xa'));var squel=require(_0xe875('0xb'));var crypto=require('crypto');var jsforce=require(_0xe875('0xc'));var deskjs=require(_0xe875('0xd'));var toCsv=require(_0xe875('0xe'));var querystring=require(_0xe875('0xf'));var Papa=require(_0xe875('0x10'));var Redis=require(_0xe875('0x11'));var authService=require(_0xe875('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe875('0x13'));var hardwareService=require(_0xe875('0x14'));var logger=require(_0xe875('0x15'))(_0xe875('0x16'));var utils=require('../../config/utils');var config=require(_0xe875('0x17'));var licenseUtil=require(_0xe875('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7b10,_0x108440){_0x108440=_0x108440||0xcc;return function(_0x4d3d30){if(_0x4d3d30){return _0x5a7b10[_0xe875('0x19')](_0x108440);}return _0x5a7b10[_0xe875('0x1a')](_0x108440)[_0xe875('0x1b')]();};}function respondWithResult(_0x100417,_0x4c898d){_0x4c898d=_0x4c898d||0xc8;return function(_0xf11f3e){if(_0xf11f3e){return _0x100417[_0xe875('0x1a')](_0x4c898d)[_0xe875('0x1c')](_0xf11f3e);}};}function respondWithFilteredResult(_0x4f1cbd,_0x45a09c){return function(_0x9e7a29){if(_0x9e7a29){var _0x552dc5=typeof _0x45a09c['offset']==='undefined'&&typeof _0x45a09c[_0xe875('0x1d')]===_0xe875('0x1e');var _0x4b010b=_0x9e7a29[_0xe875('0x1f')];var _0x11983b=_0x552dc5?0x0:_0x45a09c[_0xe875('0x20')];var _0x28fcd8=_0x552dc5?_0x9e7a29[_0xe875('0x1f')]:_0x45a09c[_0xe875('0x20')]+_0x45a09c[_0xe875('0x1d')];var _0x33f3e2;if(_0x28fcd8>=_0x4b010b){_0x28fcd8=_0x4b010b;_0x33f3e2=0xc8;}else{_0x33f3e2=0xce;}_0x4f1cbd['status'](_0x33f3e2);return _0x4f1cbd[_0xe875('0x21')](_0xe875('0x22'),_0x11983b+'-'+_0x28fcd8+'/'+_0x4b010b)[_0xe875('0x1c')](_0x9e7a29);}return null;};}function patchUpdates(_0x7f5625){return function(_0x3ec67a){try{jsonpatch['apply'](_0x3ec67a,_0x7f5625,!![]);}catch(_0x3461af){return BPromise['reject'](_0x3461af);}return _0x3ec67a[_0xe875('0x23')]();};}function saveUpdates(_0x1ba608,_0x20f494){return function(_0x59b0d5){if(_0x59b0d5){return _0x59b0d5['update'](_0x1ba608)['then'](function(_0x41f036){return _0x41f036;});}return null;};}function removeEntity(_0x30c360,_0x474091){return function(_0xd59c27){if(_0xd59c27){return _0xd59c27[_0xe875('0x24')]()[_0xe875('0x25')](function(){_0x30c360[_0xe875('0x1a')](0xcc)[_0xe875('0x1b')]();});}};}function handleEntityNotFound(_0x5dcbbf,_0x3bf5a7){return function(_0x432328){if(!_0x432328){_0x5dcbbf[_0xe875('0x19')](0x194);}return _0x432328;};}function handleError(_0x3b6f3f,_0x3c4bc5){_0x3c4bc5=_0x3c4bc5||0x1f4;return function(_0x2195df){logger[_0xe875('0x26')](_0x2195df['stack']);if(_0x2195df[_0xe875('0x27')]){delete _0x2195df[_0xe875('0x27')];}_0x3b6f3f[_0xe875('0x1a')](_0x3c4bc5)[_0xe875('0x28')](_0x2195df);};}exports[_0xe875('0x29')]=function(_0x83b741,_0x33d36f){var _0x15a917={},_0x53e561={},_0x40a4ee={'count':0x0,'rows':[]};var _0x243631=_[_0xe875('0x2a')](db[_0xe875('0x2b')]['rawAttributes'],function(_0x1e3457){return{'name':_0x1e3457[_0xe875('0x2c')],'type':_0x1e3457[_0xe875('0x2d')][_0xe875('0x2e')]};});_0x53e561[_0xe875('0x2f')]=_[_0xe875('0x2a')](_0x243631,_0xe875('0x27'));_0x53e561[_0xe875('0x30')]=_[_0xe875('0x31')](_0x83b741[_0xe875('0x30')]);_0x53e561[_0xe875('0x32')]=_[_0xe875('0x33')](_0x53e561['model'],_0x53e561['query']);_0x15a917[_0xe875('0x34')]=_[_0xe875('0x33')](_0x53e561[_0xe875('0x2f')],qs[_0xe875('0x35')](_0x83b741[_0xe875('0x30')][_0xe875('0x35')]));_0x15a917[_0xe875('0x34')]=_0x15a917['attributes'][_0xe875('0x36')]?_0x15a917['attributes']:_0x53e561[_0xe875('0x2f')];if(!_0x83b741[_0xe875('0x30')]['hasOwnProperty'](_0xe875('0x37'))){_0x15a917[_0xe875('0x1d')]=qs[_0xe875('0x1d')](_0x83b741['query'][_0xe875('0x1d')]);_0x15a917[_0xe875('0x20')]=qs[_0xe875('0x20')](_0x83b741[_0xe875('0x30')][_0xe875('0x20')]);}_0x15a917[_0xe875('0x38')]=qs[_0xe875('0x39')](_0x83b741[_0xe875('0x30')][_0xe875('0x39')]);_0x15a917['where']=qs[_0xe875('0x32')](_[_0xe875('0x3a')](_0x83b741[_0xe875('0x30')],_0x53e561['filters']),_0x243631);if(_0x83b741[_0xe875('0x30')][_0xe875('0x3b')]){_0x15a917[_0xe875('0x3c')]=_[_0xe875('0x3d')](_0x15a917[_0xe875('0x3c')],{'$or':_['map'](_0x243631,function(_0x25aa84){if(_0x25aa84[_0xe875('0x2d')]!==_0xe875('0x3e')){var _0x11dae4={};_0x11dae4[_0x25aa84[_0xe875('0x27')]]={'$like':'%'+_0x83b741[_0xe875('0x30')][_0xe875('0x3b')]+'%'};return _0x11dae4;}})});}_0x15a917=_[_0xe875('0x3d')]({},_0x15a917,_0x83b741[_0xe875('0x3f')]);var _0x2fe983={'where':_0x15a917[_0xe875('0x3c')]};return db['SalesforceField'][_0xe875('0x1f')](_0x2fe983)[_0xe875('0x25')](function(_0x579f75){_0x40a4ee['count']=_0x579f75;if(_0x83b741[_0xe875('0x30')][_0xe875('0x40')]){_0x15a917['include']=[{'all':!![]}];}return db[_0xe875('0x2b')][_0xe875('0x41')](_0x15a917);})['then'](function(_0x54a45c){_0x40a4ee[_0xe875('0x42')]=_0x54a45c;return _0x40a4ee;})[_0xe875('0x25')](respondWithFilteredResult(_0x33d36f,_0x15a917))[_0xe875('0x43')](handleError(_0x33d36f,null));};exports[_0xe875('0x44')]=function(_0x4f3d92,_0x36aa58){var _0x1d2592={'raw':!![],'where':{'id':_0x4f3d92['params']['id']}},_0x31f460={};_0x31f460[_0xe875('0x2f')]=_[_0xe875('0x31')](db['SalesforceField'][_0xe875('0x45')]);_0x31f460[_0xe875('0x30')]=_['keys'](_0x4f3d92[_0xe875('0x30')]);_0x31f460[_0xe875('0x32')]=_[_0xe875('0x33')](_0x31f460[_0xe875('0x2f')],_0x31f460[_0xe875('0x30')]);_0x1d2592[_0xe875('0x34')]=_[_0xe875('0x33')](_0x31f460[_0xe875('0x2f')],qs[_0xe875('0x35')](_0x4f3d92[_0xe875('0x30')][_0xe875('0x35')]));_0x1d2592[_0xe875('0x34')]=_0x1d2592[_0xe875('0x34')]['length']?_0x1d2592[_0xe875('0x34')]:_0x31f460[_0xe875('0x2f')];if(_0x4f3d92['query']['includeAll']){_0x1d2592[_0xe875('0x46')]=[{'all':!![]}];}_0x1d2592=_[_0xe875('0x3d')]({},_0x1d2592,_0x4f3d92[_0xe875('0x3f')]);return db[_0xe875('0x2b')][_0xe875('0x47')](_0x1d2592)[_0xe875('0x25')](handleEntityNotFound(_0x36aa58,null))[_0xe875('0x25')](respondWithResult(_0x36aa58,null))[_0xe875('0x43')](handleError(_0x36aa58,null));};exports['create']=function(_0x904063,_0x3d94cf){return db['SalesforceField'][_0xe875('0x48')](_0x904063[_0xe875('0x49')],{})['then'](respondWithResult(_0x3d94cf,0xc9))['catch'](handleError(_0x3d94cf,null));};exports[_0xe875('0x4a')]=function(_0x3b4eeb,_0x37627c){if(_0x3b4eeb[_0xe875('0x49')]['id']){delete _0x3b4eeb[_0xe875('0x49')]['id'];}return db[_0xe875('0x2b')][_0xe875('0x47')]({'where':{'id':_0x3b4eeb[_0xe875('0x4b')]['id']}})[_0xe875('0x25')](handleEntityNotFound(_0x37627c,null))[_0xe875('0x25')](saveUpdates(_0x3b4eeb[_0xe875('0x49')],null))[_0xe875('0x25')](respondWithResult(_0x37627c,null))[_0xe875('0x43')](handleError(_0x37627c,null));};exports[_0xe875('0x24')]=function(_0x17b057,_0x35e3f6){return db[_0xe875('0x2b')][_0xe875('0x47')]({'where':{'id':_0x17b057['params']['id']}})[_0xe875('0x25')](handleEntityNotFound(_0x35e3f6,null))['then'](removeEntity(_0x35e3f6,null))[_0xe875('0x43')](handleError(_0x35e3f6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5efa3ad..177e424 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f80=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0xf30e92,_0x1dc9e9){var _0x3feb7c=function(_0x2cbbb0){while(--_0x2cbbb0){_0xf30e92['push'](_0xf30e92['shift']());}};_0x3feb7c(++_0x1dc9e9);}(_0x9f80,0xe6));var _0x09f8=function(_0x22f862,_0x127fac){_0x22f862=_0x22f862-0x0;var _0x104abc=_0x9f80[_0x22f862];return _0x104abc;};'use strict';var _=require(_0x09f8('0x0'));var util=require(_0x09f8('0x1'));var logger=require(_0x09f8('0x2'))('api');var moment=require(_0x09f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x09f8('0x4'));var fs=require('fs');var path=require(_0x09f8('0x5'));var rimraf=require(_0x09f8('0x6'));var config=require(_0x09f8('0x7'));var attributes=require(_0x09f8('0x8'));module[_0x09f8('0x9')]=function(_0x31cd9e,_0x1c8fb9){return _0x31cd9e[_0x09f8('0xa')](_0x09f8('0xb'),attributes,{'tableName':_0x09f8('0xc'),'paranoid':![],'indexes':[{'name':_0x09f8('0xd'),'fields':[_0x09f8('0xe'),_0x09f8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87f8=['./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2eae67,_0x2c1de0){var _0x3900cd=function(_0x8002fb){while(--_0x8002fb){_0x2eae67['push'](_0x2eae67['shift']());}};_0x3900cd(++_0x2c1de0);}(_0x87f8,0x11f));var _0x887f=function(_0x59c2b2,_0x1aa634){_0x59c2b2=_0x59c2b2-0x0;var _0x410c32=_0x87f8[_0x59c2b2];return _0x410c32;};'use strict';var _=require('lodash');var util=require(_0x887f('0x0'));var logger=require(_0x887f('0x1'))(_0x887f('0x2'));var moment=require('moment');var BPromise=require(_0x887f('0x3'));var rp=require(_0x887f('0x4'));var fs=require('fs');var path=require(_0x887f('0x5'));var rimraf=require(_0x887f('0x6'));var config=require('../../config/environment');var attributes=require(_0x887f('0x7'));module[_0x887f('0x8')]=function(_0x192758,_0x3a0be6){return _0x192758['define'](_0x887f('0x9'),attributes,{'tableName':_0x887f('0xa'),'paranoid':![],'indexes':[{'name':_0x887f('0xb'),'fields':[_0x887f('0xc'),_0x887f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 62a8a1b..b73cebf 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2a=['bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x2bb44f,_0x4d786a){var _0xf4c54b=function(_0x518ed1){while(--_0x518ed1){_0x2bb44f['push'](_0x2bb44f['shift']());}};_0xf4c54b(++_0x4d786a);}(_0xda2a,0x1c0));var _0xada2=function(_0x33ba11,_0x1e030d){_0x33ba11=_0x33ba11-0x0;var _0x9b197e=_0xda2a[_0x33ba11];return _0x9b197e;};'use strict';var _=require(_0xada2('0x0'));var util=require(_0xada2('0x1'));var moment=require('moment');var BPromise=require(_0xada2('0x2'));var rs=require(_0xada2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xada2('0x4'));var logger=require('../../config/logger')(_0xada2('0x5'));var config=require(_0xada2('0x6'));var jayson=require(_0xada2('0x7'));var client=jayson['client'][_0xada2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e8ff6,_0x2c9e8e,_0x2087c7){return new BPromise(function(_0x3d46f1,_0x39bda9){return client['request'](_0x4e8ff6,_0x2087c7)[_0xada2('0x9')](function(_0x938158){logger[_0xada2('0xa')](_0xada2('0xb'),_0x2c9e8e,_0xada2('0xc'));logger['debug'](_0xada2('0xd'),_0x2c9e8e,_0xada2('0xc'),JSON['stringify'](_0x938158));if(_0x938158[_0xada2('0xe')]){if(_0x938158[_0xada2('0xe')][_0xada2('0xf')]===0x1f4){logger[_0xada2('0xe')](_0xada2('0xb'),_0x2c9e8e,_0x938158[_0xada2('0xe')][_0xada2('0x10')]);return _0x39bda9(_0x938158['error']['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x2c9e8e,_0x938158[_0xada2('0xe')][_0xada2('0x10')]);return _0x3d46f1(_0x938158[_0xada2('0xe')]['message']);}else{logger[_0xada2('0xa')]('SalesforceField,\x20%s,\x20%s',_0x2c9e8e,_0xada2('0xc'));_0x3d46f1(_0x938158['result'][_0xada2('0x10')]);}})[_0xada2('0x11')](function(_0x17680e){logger[_0xada2('0xe')](_0xada2('0xb'),_0x2c9e8e,_0x17680e);_0x39bda9(_0x17680e);});});} \ No newline at end of file +var _0x04ab=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x04ab,0x18d));var _0xb04a=function(_0x3105df,_0x55b187){_0x3105df=_0x3105df-0x0;var _0x4d5626=_0x04ab[_0x3105df];return _0x4d5626;};'use strict';var _=require('lodash');var util=require(_0xb04a('0x0'));var moment=require(_0xb04a('0x1'));var BPromise=require(_0xb04a('0x2'));var rs=require(_0xb04a('0x3'));var fs=require('fs');var Redis=require(_0xb04a('0x4'));var db=require(_0xb04a('0x5'))['db'];var utils=require(_0xb04a('0x6'));var logger=require(_0xb04a('0x7'))(_0xb04a('0x8'));var config=require(_0xb04a('0x9'));var jayson=require(_0xb04a('0xa'));var client=jayson[_0xb04a('0xb')][_0xb04a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23e742,_0x4efe8a,_0x503044){return new BPromise(function(_0x55eb92,_0x20eedc){return client[_0xb04a('0xd')](_0x23e742,_0x503044)['then'](function(_0x150e27){logger[_0xb04a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x4efe8a,_0xb04a('0xf'));logger[_0xb04a('0x10')](_0xb04a('0x11'),_0x4efe8a,'request\x20sent',JSON[_0xb04a('0x12')](_0x150e27));if(_0x150e27[_0xb04a('0x13')]){if(_0x150e27[_0xb04a('0x13')]['code']===0x1f4){logger[_0xb04a('0x13')](_0xb04a('0x14'),_0x4efe8a,_0x150e27['error'][_0xb04a('0x15')]);return _0x20eedc(_0x150e27[_0xb04a('0x13')][_0xb04a('0x15')]);}logger[_0xb04a('0x13')](_0xb04a('0x14'),_0x4efe8a,_0x150e27[_0xb04a('0x13')]['message']);return _0x55eb92(_0x150e27[_0xb04a('0x13')][_0xb04a('0x15')]);}else{logger[_0xb04a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x4efe8a,_0xb04a('0xf'));_0x55eb92(_0x150e27[_0xb04a('0x16')][_0xb04a('0x15')]);}})['catch'](function(_0x3eaa16){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4efe8a,_0x3eaa16);_0x20eedc(_0x3eaa16);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b8fbc35..6d3d75b 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc86a=['/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index'];(function(_0x2b974c,_0x3714ee){var _0x21da1d=function(_0x91b353){while(--_0x91b353){_0x2b974c['push'](_0x2b974c['shift']());}};_0x21da1d(++_0x3714ee);}(_0xc86a,0x1f0));var _0xac86=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xc86a[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0xac86('0x0'));var util=require(_0xac86('0x1'));var path=require('path');var timeout=require(_0xac86('0x2'));var express=require(_0xac86('0x3'));var router=express['Router']();var fs_extra=require(_0xac86('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac86('0x5'));var config=require(_0xac86('0x6'));var controller=require(_0xac86('0x7'));router[_0xac86('0x8')]('/',auth['isAuthenticated'](),controller[_0xac86('0x9')]);router[_0xac86('0x8')](_0xac86('0xa'),auth[_0xac86('0xb')](),controller[_0xac86('0xc')]);router[_0xac86('0x8')]('/:id/configurations',auth[_0xac86('0xb')](),controller[_0xac86('0xd')]);router[_0xac86('0x8')](_0xac86('0xe'),auth[_0xac86('0xb')](),controller[_0xac86('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac86('0x10')]);router[_0xac86('0x11')](_0xac86('0x12'),auth[_0xac86('0xb')](),controller['addConfiguration']);router[_0xac86('0x13')](_0xac86('0xa'),auth[_0xac86('0xb')](),controller['update']);router[_0xac86('0x14')]('/:id',auth[_0xac86('0xb')](),controller[_0xac86('0x15')]);module[_0xac86('0x16')]=router; \ No newline at end of file +var _0x64e9=['../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x200316,_0x37b1ba){var _0x1126b7=function(_0x2e0579){while(--_0x2e0579){_0x200316['push'](_0x200316['shift']());}};_0x1126b7(++_0x37b1ba);}(_0x64e9,0x136));var _0x964e=function(_0x3f7786,_0x1dbe8a){_0x3f7786=_0x3f7786-0x0;var _0x1551af=_0x64e9[_0x3f7786];return _0x1551af;};'use strict';var multer=require(_0x964e('0x0'));var util=require('util');var path=require(_0x964e('0x1'));var timeout=require('connect-timeout');var express=require(_0x964e('0x2'));var router=express['Router']();var fs_extra=require(_0x964e('0x3'));var auth=require(_0x964e('0x4'));var interaction=require(_0x964e('0x5'));var config=require('../../config/environment');var controller=require(_0x964e('0x6'));router[_0x964e('0x7')]('/',auth[_0x964e('0x8')](),controller[_0x964e('0x9')]);router['get']('/:id',auth[_0x964e('0x8')](),controller['show']);router[_0x964e('0x7')](_0x964e('0xa'),auth[_0x964e('0x8')](),controller[_0x964e('0xb')]);router[_0x964e('0x7')](_0x964e('0xc'),auth['isAuthenticated'](),controller[_0x964e('0xd')]);router['post']('/',auth[_0x964e('0x8')](),controller[_0x964e('0xe')]);router[_0x964e('0xf')](_0x964e('0xa'),auth[_0x964e('0x8')](),controller[_0x964e('0x10')]);router['put'](_0x964e('0x11'),auth['isAuthenticated'](),controller[_0x964e('0x12')]);router[_0x964e('0x13')](_0x964e('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x964e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index eece4af..69ebcb4 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64b8=['exports','STRING','username','remoteUri'];(function(_0x3699b0,_0x25fc8b){var _0x510f09=function(_0x39b409){while(--_0x39b409){_0x3699b0['push'](_0x3699b0['shift']());}};_0x510f09(++_0x25fc8b);}(_0x64b8,0x108));var _0x864b=function(_0x445d6e,_0x1dbe43){_0x445d6e=_0x445d6e-0x0;var _0x6b970=_0x64b8[_0x445d6e];return _0x6b970;};'use strict';var Sequelize=require('sequelize');module[_0x864b('0x0')]={'name':{'type':Sequelize[_0x864b('0x1')]},'description':{'type':Sequelize[_0x864b('0x1')]},'username':{'type':Sequelize[_0x864b('0x1')],'unique':_0x864b('0x2')},'password':{'type':Sequelize[_0x864b('0x1')]},'email':{'type':Sequelize[_0x864b('0x1')]},'remoteUri':{'type':Sequelize[_0x864b('0x1')],'unique':_0x864b('0x3')},'serverUrl':{'type':Sequelize[_0x864b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0c24=['exports','STRING','remoteUri','sequelize'];(function(_0x4093da,_0x57c930){var _0x5ca0cb=function(_0x1ebb66){while(--_0x1ebb66){_0x4093da['push'](_0x4093da['shift']());}};_0x5ca0cb(++_0x57c930);}(_0x0c24,0x183));var _0x40c2=function(_0x2b6593,_0x2c5e04){_0x2b6593=_0x2b6593-0x0;var _0x59ccf4=_0x0c24[_0x2b6593];return _0x59ccf4;};'use strict';var Sequelize=require(_0x40c2('0x0'));module[_0x40c2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x40c2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x40c2('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x40c2('0x2')],'unique':_0x40c2('0x3')},'serverUrl':{'type':Sequelize[_0x40c2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index f930d1f..ddf4069 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x640a=['lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','includes','forEach','internalType','label','assign','TCL:\x20_object','remove','push','all','log','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','error','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','attributes','fields','length','sort','where','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','filters','intersection','options','create','body','update','find','destroy','getConfigurations','ServicenowConfiguration','order','pick','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','upon_reject','sys_updated_on','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_by','calendar_stc','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','time_worked','expected_start','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','slice','substring'];(function(_0x6282d1,_0x483c53){var _0xc01486=function(_0x4413f9){while(--_0x4413f9){_0x6282d1['push'](_0x6282d1['shift']());}};_0xc01486(++_0x483c53);}(_0x640a,0xd7));var _0xa640=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x640a[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xa640('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa640('0x1'));var jsonpatch=require(_0xa640('0x2'));var rp=require(_0xa640('0x3'));var moment=require('moment');var BPromise=require(_0xa640('0x4'));var Mustache=require('mustache');var util=require(_0xa640('0x5'));var path=require(_0xa640('0x6'));var sox=require('sox');var csv=require(_0xa640('0x7'));var ejs=require(_0xa640('0x8'));var fs=require('fs');var fs_extra=require(_0xa640('0x9'));var _=require('lodash');var squel=require(_0xa640('0xa'));var crypto=require(_0xa640('0xb'));var jsforce=require(_0xa640('0xc'));var deskjs=require(_0xa640('0xd'));var toCsv=require(_0xa640('0x7'));var querystring=require(_0xa640('0xe'));var Papa=require(_0xa640('0xf'));var Redis=require(_0xa640('0x10'));var authService=require(_0xa640('0x11'));var qs=require(_0xa640('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa640('0x13'))(_0xa640('0x14'));var utils=require(_0xa640('0x15'));var config=require(_0xa640('0x16'));var licenseUtil=require(_0xa640('0x17'));var db=require(_0xa640('0x18'))['db'];var integrations=require(_0xa640('0x19'));function respondWithStatusCode(_0x274add,_0x19fd0c){_0x19fd0c=_0x19fd0c||0xcc;return function(_0x753ec5){if(_0x753ec5){return _0x274add[_0xa640('0x1a')](_0x19fd0c);}return _0x274add[_0xa640('0x1b')](_0x19fd0c)[_0xa640('0x1c')]();};}function respondWithResult(_0x116dcf,_0x350e4e){_0x350e4e=_0x350e4e||0xc8;return function(_0x85683e){if(_0x85683e){return _0x116dcf[_0xa640('0x1b')](_0x350e4e)[_0xa640('0x1d')](_0x85683e);}};}function respondWithFilteredResult(_0x1dcfc7,_0x2a7e7e){return function(_0x3b5ad3){if(_0x3b5ad3){var _0x4522d7=typeof _0x2a7e7e['offset']===_0xa640('0x1e')&&typeof _0x2a7e7e[_0xa640('0x1f')]===_0xa640('0x1e');var _0x3ec303=_0x3b5ad3[_0xa640('0x20')];var _0x443a40=_0x4522d7?0x0:_0x2a7e7e[_0xa640('0x21')];var _0x4fec84=_0x4522d7?_0x3b5ad3['count']:_0x2a7e7e[_0xa640('0x21')]+_0x2a7e7e[_0xa640('0x1f')];var _0x22af90;if(_0x4fec84>=_0x3ec303){_0x4fec84=_0x3ec303;_0x22af90=0xc8;}else{_0x22af90=0xce;}_0x1dcfc7[_0xa640('0x1b')](_0x22af90);return _0x1dcfc7[_0xa640('0x22')]('Content-Range',_0x443a40+'-'+_0x4fec84+'/'+_0x3ec303)[_0xa640('0x1d')](_0x3b5ad3);}return null;};}function patchUpdates(_0x4e42e6){return function(_0x327258){try{jsonpatch[_0xa640('0x23')](_0x327258,_0x4e42e6,!![]);}catch(_0x58d87b){return BPromise[_0xa640('0x24')](_0x58d87b);}return _0x327258[_0xa640('0x25')]();};}function saveUpdates(_0xb9bafc,_0x41c229){return function(_0x29e514){if(_0x29e514){return _0x29e514['update'](_0xb9bafc)[_0xa640('0x26')](function(_0x533781){return _0x533781;});}return null;};}function removeEntity(_0x2cbb4a,_0xb3e5d0){return function(_0x46f4d8){if(_0x46f4d8){return _0x46f4d8['destroy']()[_0xa640('0x26')](function(){_0x2cbb4a[_0xa640('0x1b')](0xcc)[_0xa640('0x1c')]();});}};}function handleEntityNotFound(_0x3f293f,_0x45c16c){return function(_0x19d910){if(!_0x19d910){_0x3f293f[_0xa640('0x1a')](0x194);}return _0x19d910;};}function handleError(_0x248d38,_0x19da60){_0x19da60=_0x19da60||0x1f4;return function(_0x553b55){logger[_0xa640('0x27')](_0x553b55['stack']);if(_0x553b55[_0xa640('0x28')]){delete _0x553b55[_0xa640('0x28')];}_0x248d38[_0xa640('0x1b')](_0x19da60)[_0xa640('0x29')](_0x553b55);};}exports[_0xa640('0x2a')]=function(_0x114f86,_0x3979f5){var _0x391dec={},_0x3ad857={},_0x4901d3={'count':0x0,'rows':[]};var _0x30da01=_[_0xa640('0x2b')](db[_0xa640('0x2c')]['rawAttributes'],function(_0x3450e0){return{'name':_0x3450e0[_0xa640('0x2d')],'type':_0x3450e0[_0xa640('0x2e')][_0xa640('0x2f')]};});_0x3ad857[_0xa640('0x30')]=_[_0xa640('0x2b')](_0x30da01,_0xa640('0x28'));_0x3ad857[_0xa640('0x31')]=_[_0xa640('0x32')](_0x114f86[_0xa640('0x31')]);_0x3ad857['filters']=_['intersection'](_0x3ad857[_0xa640('0x30')],_0x3ad857[_0xa640('0x31')]);_0x391dec[_0xa640('0x33')]=_['intersection'](_0x3ad857[_0xa640('0x30')],qs[_0xa640('0x34')](_0x114f86[_0xa640('0x31')][_0xa640('0x34')]));_0x391dec[_0xa640('0x33')]=_0x391dec[_0xa640('0x33')][_0xa640('0x35')]?_0x391dec[_0xa640('0x33')]:_0x3ad857['model'];if(!_0x114f86['query']['hasOwnProperty']('nolimit')){_0x391dec[_0xa640('0x1f')]=qs[_0xa640('0x1f')](_0x114f86['query'][_0xa640('0x1f')]);_0x391dec['offset']=qs[_0xa640('0x21')](_0x114f86['query'][_0xa640('0x21')]);}_0x391dec['order']=qs[_0xa640('0x36')](_0x114f86[_0xa640('0x31')]['sort']);_0x391dec[_0xa640('0x37')]=qs['filters'](_['pick'](_0x114f86[_0xa640('0x31')],_0x3ad857['filters']),_0x30da01);if(_0x114f86[_0xa640('0x31')][_0xa640('0x38')]){_0x391dec[_0xa640('0x37')]=_[_0xa640('0x39')](_0x391dec[_0xa640('0x37')],{'$or':_['map'](_0x30da01,function(_0x31783d){if(_0x31783d[_0xa640('0x2e')]!=='VIRTUAL'){var _0x17bdee={};_0x17bdee[_0x31783d[_0xa640('0x28')]]={'$like':'%'+_0x114f86[_0xa640('0x31')][_0xa640('0x38')]+'%'};return _0x17bdee;}})});}_0x391dec=_['merge']({},_0x391dec,_0x114f86['options']);var _0x381756={'where':_0x391dec['where']};return db[_0xa640('0x2c')][_0xa640('0x20')](_0x381756)[_0xa640('0x26')](function(_0x3a335e){_0x4901d3[_0xa640('0x20')]=_0x3a335e;if(_0x114f86['query'][_0xa640('0x3a')]){_0x391dec[_0xa640('0x3b')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xa640('0x3c')](_0x391dec);})['then'](function(_0x23efed){_0x4901d3['rows']=_0x23efed;return _0x4901d3;})[_0xa640('0x26')](respondWithFilteredResult(_0x3979f5,_0x391dec))[_0xa640('0x3d')](handleError(_0x3979f5,null));};exports[_0xa640('0x3e')]=function(_0x9d83de,_0x2e4f16){var _0x6e91a6={'raw':![],'where':{'id':_0x9d83de[_0xa640('0x3f')]['id']}},_0x267d39={};_0x267d39[_0xa640('0x30')]=_['keys'](db[_0xa640('0x2c')][_0xa640('0x40')]);_0x267d39[_0xa640('0x31')]=_[_0xa640('0x32')](_0x9d83de['query']);_0x267d39[_0xa640('0x41')]=_[_0xa640('0x42')](_0x267d39[_0xa640('0x30')],_0x267d39[_0xa640('0x31')]);_0x6e91a6[_0xa640('0x33')]=_[_0xa640('0x42')](_0x267d39['model'],qs[_0xa640('0x34')](_0x9d83de[_0xa640('0x31')]['fields']));_0x6e91a6[_0xa640('0x33')]=_0x6e91a6[_0xa640('0x33')][_0xa640('0x35')]?_0x6e91a6[_0xa640('0x33')]:_0x267d39[_0xa640('0x30')];if(_0x9d83de['query'][_0xa640('0x3a')]){_0x6e91a6[_0xa640('0x3b')]=[{'all':!![]}];}_0x6e91a6=_['merge']({},_0x6e91a6,_0x9d83de[_0xa640('0x43')]);return db[_0xa640('0x2c')]['find'](_0x6e91a6)['then'](handleEntityNotFound(_0x2e4f16,null))[_0xa640('0x26')](respondWithResult(_0x2e4f16,null))[_0xa640('0x3d')](handleError(_0x2e4f16,null));};exports[_0xa640('0x44')]=function(_0x5ab6fd,_0xfe5a4){return db['ServicenowAccount'][_0xa640('0x44')](_0x5ab6fd[_0xa640('0x45')],{})[_0xa640('0x26')](respondWithResult(_0xfe5a4,0xc9))[_0xa640('0x3d')](handleError(_0xfe5a4,null));};exports[_0xa640('0x46')]=function(_0x89c548,_0x54181f){if(_0x89c548[_0xa640('0x45')]['id']){delete _0x89c548[_0xa640('0x45')]['id'];}return db[_0xa640('0x2c')][_0xa640('0x47')]({'where':{'id':_0x89c548[_0xa640('0x3f')]['id']}})['then'](handleEntityNotFound(_0x54181f,null))[_0xa640('0x26')](saveUpdates(_0x89c548['body'],null))[_0xa640('0x26')](respondWithResult(_0x54181f,null))[_0xa640('0x3d')](handleError(_0x54181f,null));};exports[_0xa640('0x48')]=function(_0x165ea0,_0x2481a8){return db[_0xa640('0x2c')]['find']({'where':{'id':_0x165ea0[_0xa640('0x3f')]['id']}})[_0xa640('0x26')](handleEntityNotFound(_0x2481a8,null))['then'](removeEntity(_0x2481a8,null))[_0xa640('0x3d')](handleError(_0x2481a8,null));};exports[_0xa640('0x49')]=function(_0x1ca80f,_0x49e4eb,_0x2ca415){var _0x139c26={};var _0x2e7d3f={};var _0x4d3045;var _0x484f74;return db['ServicenowAccount']['findOne']({'where':{'id':_0x1ca80f[_0xa640('0x3f')]['id']}})['then'](handleEntityNotFound(_0x49e4eb,null))[_0xa640('0x26')](function(_0x5dab2d){if(_0x5dab2d){_0x4d3045=_0x5dab2d;_0x2e7d3f[_0xa640('0x30')]=_[_0xa640('0x32')](db[_0xa640('0x4a')][_0xa640('0x40')]);_0x2e7d3f[_0xa640('0x31')]=_[_0xa640('0x32')](_0x1ca80f['query']);_0x2e7d3f[_0xa640('0x41')]=_[_0xa640('0x42')](_0x2e7d3f[_0xa640('0x30')],_0x2e7d3f[_0xa640('0x31')]);_0x139c26[_0xa640('0x33')]=_[_0xa640('0x42')](_0x2e7d3f[_0xa640('0x30')],qs[_0xa640('0x34')](_0x1ca80f[_0xa640('0x31')][_0xa640('0x34')]));_0x139c26[_0xa640('0x33')]=_0x139c26[_0xa640('0x33')][_0xa640('0x35')]?_0x139c26[_0xa640('0x33')]:_0x2e7d3f[_0xa640('0x30')];_0x139c26[_0xa640('0x4b')]=qs[_0xa640('0x36')](_0x1ca80f[_0xa640('0x31')][_0xa640('0x36')]);_0x139c26['where']=qs[_0xa640('0x41')](_[_0xa640('0x4c')](_0x1ca80f[_0xa640('0x31')],_0x2e7d3f[_0xa640('0x41')]));if(_0x1ca80f[_0xa640('0x31')][_0xa640('0x38')]){_0x139c26[_0xa640('0x37')]=_[_0xa640('0x39')](_0x139c26['where'],{'$or':_[_0xa640('0x2b')](_0x139c26[_0xa640('0x33')],function(_0x53a751){var _0x5a55e1={};_0x5a55e1[_0x53a751]={'$like':'%'+_0x1ca80f['query'][_0xa640('0x38')]+'%'};return _0x5a55e1;})});}_0x139c26=_['merge']({},_0x139c26,_0x1ca80f[_0xa640('0x43')]);return _0x4d3045[_0xa640('0x49')](_0x139c26);}})[_0xa640('0x26')](function(_0x31cc2f){if(_0x31cc2f){_0x484f74=_0x31cc2f[_0xa640('0x35')];if(!_0x1ca80f[_0xa640('0x31')][_0xa640('0x4d')](_0xa640('0x4e'))){_0x139c26[_0xa640('0x1f')]=qs[_0xa640('0x1f')](_0x1ca80f[_0xa640('0x31')][_0xa640('0x1f')]);_0x139c26['offset']=qs[_0xa640('0x21')](_0x1ca80f['query']['offset']);}return _0x4d3045['getConfigurations'](_0x139c26);}})[_0xa640('0x26')](function(_0x3893a7){if(_0x3893a7){return _0x3893a7?{'count':_0x484f74,'rows':_0x3893a7}:null;}})[_0xa640('0x26')](respondWithResult(_0x49e4eb,null))[_0xa640('0x3d')](handleError(_0x49e4eb,null));};exports['addConfiguration']=function(_0x32f607,_0x4d7d4a,_0x2c215f){if(_0x32f607[_0xa640('0x45')]['id']){delete _0x32f607['body']['id'];}return db['ServicenowAccount'][_0xa640('0x4f')]({'where':{'id':_0x32f607['params']['id']}})[_0xa640('0x26')](handleEntityNotFound(_0x4d7d4a,null))[_0xa640('0x26')](function(_0x5b158b){if(_0x5b158b){_0x32f607[_0xa640('0x45')][_0xa640('0x50')]=_0x5b158b['id'];_0x32f607['body'][_0xa640('0x51')]=integrations[_0xa640('0x52')](_0x32f607['body']['channel'],_0x32f607[_0xa640('0x45')][_0xa640('0x2e')]);_0x32f607[_0xa640('0x45')][_0xa640('0x53')]=integrations[_0xa640('0x54')](_0x32f607[_0xa640('0x45')][_0xa640('0x55')],_0x32f607[_0xa640('0x45')]['type']);return db[_0xa640('0x4a')]['create'](_0x32f607[_0xa640('0x45')],{'include':[{'model':db[_0xa640('0x56')],'as':_0xa640('0x51')},{'model':db[_0xa640('0x56')],'as':_0xa640('0x53')}]});}return null;})[_0xa640('0x26')](respondWithResult(_0x4d7d4a,null))[_0xa640('0x3d')](handleError(_0x4d7d4a,null));};exports['getFields']=function(_0x57c10c,_0x45f71d,_0x4dcdff){var _0xfec0c3=[_0xa640('0x57'),_0xa640('0x58'),_0xa640('0x59'),_0xa640('0x5a'),'close_code',_0xa640('0x5b'),_0xa640('0x5c'),_0xa640('0x5d'),_0xa640('0x5e')];var _0x272524=['parent',_0xa640('0x57'),'caused_by','watch_list',_0xa640('0x5f'),_0xa640('0x60'),'child_incidents',_0xa640('0x58'),_0xa640('0x61'),_0xa640('0x62'),'resolved_by',_0xa640('0x63'),_0xa640('0x64'),_0xa640('0x65'),'sys_created_on','sys_domain','state',_0xa640('0x66'),_0xa640('0x59'),'order',_0xa640('0x67'),'closed_at','cmdb_ci',_0xa640('0x68'),_0xa640('0x69'),_0xa640('0x6a'),_0xa640('0x6b'),'business_service',_0xa640('0x6c'),_0xa640('0x6d'),'rfc',_0xa640('0x6e'),_0xa640('0x6f'),'opened_at','business_duration',_0xa640('0x70'),_0xa640('0x71'),_0xa640('0x72'),_0xa640('0x73'),_0xa640('0x74'),_0xa640('0x75'),'subcategory',_0xa640('0x76'),_0xa640('0x77'),_0xa640('0x78'),_0xa640('0x79'),_0xa640('0x7a'),_0xa640('0x7b'),'assignment_group',_0xa640('0x7c'),_0xa640('0x7d'),_0xa640('0x7e'),'calendar_duration',_0xa640('0x5b'),_0xa640('0x7f'),_0xa640('0x80'),_0xa640('0x81'),_0xa640('0x82'),_0xa640('0x83'),_0xa640('0x84'),_0xa640('0x85'),_0xa640('0x86'),_0xa640('0x5c'),_0xa640('0x87'),'problem_id',_0xa640('0x88'),'reassignment_count','activity_due',_0xa640('0x89'),_0xa640('0x5d'),_0xa640('0x8a'),_0xa640('0x8b'),_0xa640('0x8c'),'comments_and_work_notes',_0xa640('0x8d'),_0xa640('0x8e'),_0xa640('0x8f'),_0xa640('0x90'),_0xa640('0x91'),'upon_approval',_0xa640('0x92'),_0xa640('0x93'),_0xa640('0x5e')];var _0x51a811='';var _0x46aa6='';var _0x49e3a5=[];var _0x759da9='';var _0x483d01='';var _0x56c3b3=[];var _0x4161f0='';var _0x5059c7='';var _0x56f925={};var _0x3c3fad='';return db['ServicenowAccount'][_0xa640('0x4f')]({'where':{'id':_0x57c10c[_0xa640('0x3f')]['id']},'attributes':['id','username',_0xa640('0x94'),_0xa640('0x95'),_0xa640('0x96'),'serverUrl']})[_0xa640('0x26')](handleEntityNotFound(_0x45f71d,null))[_0xa640('0x26')](function(_0x3eebbc){if(_0x3eebbc){_0x3c3fad=_0x3eebbc[_0xa640('0x96')];var _0x65fad6=_0x3c3fad[_0xa640('0x97')](-0x1);if(_0x65fad6==='/'){_0x3c3fad=_0x3c3fad[_0xa640('0x98')](0x0,_0x3c3fad[_0xa640('0x99')](_0x65fad6));}_0x5059c7=util['format'](_0xa640('0x9a'),_0x3c3fad);_0x4161f0=util[_0xa640('0x9b')](_0xa640('0x9c'),_0x3c3fad);_0x56f925={'user':_0x3eebbc[_0xa640('0x9d')],'pass':_0x3eebbc[_0xa640('0x94')]};var _0xdc32c6={'method':_0xa640('0x9e'),'uri':_0x5059c7+_0xa640('0x9f'),'auth':_0x56f925,'json':!![]};return rp(_0xdc32c6);}})[_0xa640('0x26')](function(_0x362c35){if(_0x362c35[_0xa640('0xa0')][_0xa640('0x35')]>0x0){_0x51a811=_0x362c35[_0xa640('0xa0')];}console['log'](_0xa640('0xa1'),_0x51a811);_0x56c3b3=[];_0x46aa6=Object['assign']([],_0x51a811);_['remove'](_0x46aa6,function(_0x5ef5f4){return!_0xfec0c3[_0xa640('0xa2')](_0x5ef5f4[_0xa640('0x28')]);});_0x46aa6[_0xa640('0xa3')](function(_0x135f9e){var _0xf452d6=createFieldObject(_0x4161f0,_0x56f925,_0x135f9e[_0xa640('0xa4')],_0x135f9e[_0xa640('0x28')],_0x135f9e[_0xa640('0xa5')],![]);_0x56c3b3['push'](_0xf452d6);});return Promise['all'](_0x56c3b3);})['then'](function(_0x4e0a13){_0x49e3a5=_0x4e0a13;_0x759da9=Object[_0xa640('0xa6')]([],_0x51a811);console['log'](_0xa640('0xa7'),_0x51a811);_[_0xa640('0xa8')](_0x759da9,function(_0x4cb50b){return _0x272524['includes'](_0x4cb50b['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x759da9);_0x56c3b3=[];_0x759da9['forEach'](function(_0xb684eb){var _0x514811=createFieldObject(_0x4161f0,_0x56f925,_0xb684eb[_0xa640('0xa4')],_0xb684eb['name'],_0xb684eb['label'],!![]);_0x56c3b3[_0xa640('0xa9')](_0x514811);});return Promise[_0xa640('0xaa')](_0x56c3b3);})[_0xa640('0x26')](function(_0x20ffc8){_0x483d01=_0x20ffc8;var _0x3315e9=_0x49e3a5['concat'](_0x483d01);return{'count':_0x3315e9[_0xa640('0x35')],'rows':_0x3315e9};})[_0xa640('0x26')](respondWithResult(_0x45f71d,null))['catch'](function(_0x3b3579){console[_0xa640('0xab')]('ServiceNow\x20error:\x20'+_0x3b3579);var _0x5ed7d1=_0x57c10c[_0xa640('0x31')][_0xa640('0xac')]?0x1f4:_0x3b3579[_0xa640('0xad')]||0x1f4;logger[_0xa640('0x27')](_0x3b3579[_0xa640('0xae')]);delete _0x3b3579['name'];if(_0x5ed7d1===0x191){_0x5ed7d1=0x190;}_0x45f71d['status'](_0x5ed7d1)['send'](_0x57c10c[_0xa640('0x31')][_0xa640('0xac')]?{'message':_0xa640('0xaf'),'statusCode':_0x3b3579[_0xa640('0xad')]}:_0x3b3579);});};function createFieldObject(_0x59d39,_0x316e82,_0x3ebb05,_0x5d763e,_0x9640dd,_0x4c7fcb){return new Promise(function(_0x57985b,_0x17f5e3){var _0xc4b22={'id':_0x5d763e,'name':_0x9640dd,'custom':_0x4c7fcb};if(_0x3ebb05===_0xa640('0xb0')){_0xc4b22[_0xa640('0x43')]=[{'name':_0xa640('0xb1'),'value':_0xa640('0xb2')},{'name':_0xa640('0xb3'),'value':_0xa640('0xb4')}];_0x57985b(_0xc4b22);}else{var _0x529619={'method':_0xa640('0x9e'),'uri':_0x59d39+_0xa640('0xb5')+_0x5d763e,'auth':_0x316e82,'json':!![]};return rp(_0x529619)['then'](function(_0x7061f0){var _0x595371=[];if(_0x7061f0[_0xa640('0xa0')][_0xa640('0x35')]>0x0){_0x7061f0[_0xa640('0xa0')][_0xa640('0xa3')](function(_0x36c0d9){if(_0x36c0d9[_0xa640('0xb6')]===_0xa640('0xb4')){var _0x55db3b={'name':_0x36c0d9['label'],'value':_0x36c0d9[_0xa640('0xb7')]};_0x595371['push'](_0x55db3b);}});}_0xc4b22[_0xa640('0x43')]=_0x595371;if(_0xc4b22[_0xa640('0x43')][_0xa640('0x35')]>0x0){_0x57985b(_0xc4b22);}else{if(_0x4c7fcb==![]){_0x57985b();}else{_0x57985b(_0xc4b22);}}});}});} \ No newline at end of file +var _0xdbb9=['status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','find','getConfigurations','findOne','ServicenowConfiguration','filter','AccountId','Subjects','getSubjects','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','reopened_by','problem_id','activity_due','assigned_to','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','username','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xdbb9,0x9f));var _0x9dbb=function(_0x5532e1,_0x4ad6d4){_0x5532e1=_0x5532e1-0x0;var _0x4534a0=_0xdbb9[_0x5532e1];return _0x4534a0;};'use strict';var emlformat=require(_0x9dbb('0x0'));var rimraf=require(_0x9dbb('0x1'));var zipdir=require(_0x9dbb('0x2'));var jsonpatch=require(_0x9dbb('0x3'));var rp=require(_0x9dbb('0x4'));var moment=require(_0x9dbb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9dbb('0x6'));var util=require(_0x9dbb('0x7'));var path=require(_0x9dbb('0x8'));var sox=require(_0x9dbb('0x9'));var csv=require(_0x9dbb('0xa'));var ejs=require(_0x9dbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9dbb('0xc'));var squel=require(_0x9dbb('0xd'));var crypto=require(_0x9dbb('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dbb('0xa'));var querystring=require(_0x9dbb('0xf'));var Papa=require('papaparse');var Redis=require(_0x9dbb('0x10'));var authService=require(_0x9dbb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))(_0x9dbb('0x14'));var utils=require('../../config/utils');var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];var integrations=require(_0x9dbb('0x18'));function respondWithStatusCode(_0x22f17b,_0x35b547){_0x35b547=_0x35b547||0xcc;return function(_0x1f4158){if(_0x1f4158){return _0x22f17b[_0x9dbb('0x19')](_0x35b547);}return _0x22f17b['status'](_0x35b547)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x325d48,_0x457b71){_0x457b71=_0x457b71||0xc8;return function(_0x372657){if(_0x372657){return _0x325d48[_0x9dbb('0x1b')](_0x457b71)['json'](_0x372657);}};}function respondWithFilteredResult(_0x56e1be,_0x4f3741){return function(_0x3f72e7){if(_0x3f72e7){var _0x4f17c9=typeof _0x4f3741[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x4f3741['limit']===_0x9dbb('0x1d');var _0x3f775a=_0x3f72e7[_0x9dbb('0x1e')];var _0x228716=_0x4f17c9?0x0:_0x4f3741[_0x9dbb('0x1c')];var _0xbf40dc=_0x4f17c9?_0x3f72e7[_0x9dbb('0x1e')]:_0x4f3741[_0x9dbb('0x1c')]+_0x4f3741[_0x9dbb('0x1f')];var _0x133225;if(_0xbf40dc>=_0x3f775a){_0xbf40dc=_0x3f775a;_0x133225=0xc8;}else{_0x133225=0xce;}_0x56e1be[_0x9dbb('0x1b')](_0x133225);return _0x56e1be[_0x9dbb('0x20')](_0x9dbb('0x21'),_0x228716+'-'+_0xbf40dc+'/'+_0x3f775a)[_0x9dbb('0x22')](_0x3f72e7);}return null;};}function patchUpdates(_0x4492d0){return function(_0x5066ec){try{jsonpatch[_0x9dbb('0x23')](_0x5066ec,_0x4492d0,!![]);}catch(_0x7d13a3){return BPromise[_0x9dbb('0x24')](_0x7d13a3);}return _0x5066ec['save']();};}function saveUpdates(_0x282315,_0x31b3d4){return function(_0x3f5d6d){if(_0x3f5d6d){return _0x3f5d6d[_0x9dbb('0x25')](_0x282315)[_0x9dbb('0x26')](function(_0x46b9c5){return _0x46b9c5;});}return null;};}function removeEntity(_0xc194ac,_0x4f468f){return function(_0x56276c){if(_0x56276c){return _0x56276c[_0x9dbb('0x27')]()[_0x9dbb('0x26')](function(){_0xc194ac[_0x9dbb('0x1b')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x7e6f0a,_0x22536e){return function(_0xebc210){if(!_0xebc210){_0x7e6f0a[_0x9dbb('0x19')](0x194);}return _0xebc210;};}function handleError(_0x7579f,_0x2749e6){_0x2749e6=_0x2749e6||0x1f4;return function(_0x16c406){logger['error'](_0x16c406[_0x9dbb('0x28')]);if(_0x16c406['name']){delete _0x16c406[_0x9dbb('0x29')];}_0x7579f['status'](_0x2749e6)[_0x9dbb('0x2a')](_0x16c406);};}exports[_0x9dbb('0x2b')]=function(_0x4e8a9a,_0x3bfaef){var _0x1a9ca8={},_0x4981d0={},_0x2c727e={'count':0x0,'rows':[]};var _0x4858cb=_[_0x9dbb('0x2c')](db[_0x9dbb('0x2d')]['rawAttributes'],function(_0x193363){return{'name':_0x193363[_0x9dbb('0x2e')],'type':_0x193363[_0x9dbb('0x2f')][_0x9dbb('0x30')]};});_0x4981d0['model']=_[_0x9dbb('0x2c')](_0x4858cb,'name');_0x4981d0['query']=_['keys'](_0x4e8a9a[_0x9dbb('0x31')]);_0x4981d0[_0x9dbb('0x32')]=_[_0x9dbb('0x33')](_0x4981d0['model'],_0x4981d0[_0x9dbb('0x31')]);_0x1a9ca8[_0x9dbb('0x34')]=_['intersection'](_0x4981d0['model'],qs['fields'](_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x35')]));_0x1a9ca8[_0x9dbb('0x34')]=_0x1a9ca8[_0x9dbb('0x34')][_0x9dbb('0x36')]?_0x1a9ca8[_0x9dbb('0x34')]:_0x4981d0[_0x9dbb('0x37')];if(!_0x4e8a9a['query'][_0x9dbb('0x38')](_0x9dbb('0x39'))){_0x1a9ca8['limit']=qs[_0x9dbb('0x1f')](_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x1f')]);_0x1a9ca8[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x1c')]);}_0x1a9ca8[_0x9dbb('0x3a')]=qs[_0x9dbb('0x3b')](_0x4e8a9a['query'][_0x9dbb('0x3b')]);_0x1a9ca8[_0x9dbb('0x3c')]=qs['filters'](_[_0x9dbb('0x3d')](_0x4e8a9a[_0x9dbb('0x31')],_0x4981d0[_0x9dbb('0x32')]),_0x4858cb);if(_0x4e8a9a[_0x9dbb('0x31')]['filter']){_0x1a9ca8['where']=_[_0x9dbb('0x3e')](_0x1a9ca8[_0x9dbb('0x3c')],{'$or':_['map'](_0x4858cb,function(_0x27056d){if(_0x27056d[_0x9dbb('0x2f')]!=='VIRTUAL'){var _0x579334={};_0x579334[_0x27056d[_0x9dbb('0x29')]]={'$like':'%'+_0x4e8a9a[_0x9dbb('0x31')]['filter']+'%'};return _0x579334;}})});}_0x1a9ca8=_['merge']({},_0x1a9ca8,_0x4e8a9a[_0x9dbb('0x3f')]);var _0x391f3b={'where':_0x1a9ca8['where']};return db[_0x9dbb('0x2d')]['count'](_0x391f3b)[_0x9dbb('0x26')](function(_0x24390a){_0x2c727e[_0x9dbb('0x1e')]=_0x24390a;if(_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x40')]){_0x1a9ca8['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x9dbb('0x41')](_0x1a9ca8);})['then'](function(_0x8714f2){_0x2c727e[_0x9dbb('0x42')]=_0x8714f2;return _0x2c727e;})[_0x9dbb('0x26')](respondWithFilteredResult(_0x3bfaef,_0x1a9ca8))[_0x9dbb('0x43')](handleError(_0x3bfaef,null));};exports[_0x9dbb('0x44')]=function(_0x19cdfe,_0x516067){var _0x110407={'raw':![],'where':{'id':_0x19cdfe[_0x9dbb('0x45')]['id']}},_0x4185c0={};_0x4185c0[_0x9dbb('0x37')]=_[_0x9dbb('0x46')](db[_0x9dbb('0x2d')][_0x9dbb('0x47')]);_0x4185c0['query']=_[_0x9dbb('0x46')](_0x19cdfe[_0x9dbb('0x31')]);_0x4185c0[_0x9dbb('0x32')]=_[_0x9dbb('0x33')](_0x4185c0[_0x9dbb('0x37')],_0x4185c0[_0x9dbb('0x31')]);_0x110407['attributes']=_['intersection'](_0x4185c0[_0x9dbb('0x37')],qs[_0x9dbb('0x35')](_0x19cdfe['query'][_0x9dbb('0x35')]));_0x110407['attributes']=_0x110407['attributes'][_0x9dbb('0x36')]?_0x110407[_0x9dbb('0x34')]:_0x4185c0[_0x9dbb('0x37')];if(_0x19cdfe[_0x9dbb('0x31')][_0x9dbb('0x40')]){_0x110407[_0x9dbb('0x48')]=[{'all':!![]}];}_0x110407=_[_0x9dbb('0x3e')]({},_0x110407,_0x19cdfe[_0x9dbb('0x3f')]);return db[_0x9dbb('0x2d')]['find'](_0x110407)[_0x9dbb('0x26')](handleEntityNotFound(_0x516067,null))[_0x9dbb('0x26')](respondWithResult(_0x516067,null))[_0x9dbb('0x43')](handleError(_0x516067,null));};exports[_0x9dbb('0x49')]=function(_0x328288,_0x1fa9b4){return db[_0x9dbb('0x2d')][_0x9dbb('0x49')](_0x328288[_0x9dbb('0x4a')],{})[_0x9dbb('0x26')](respondWithResult(_0x1fa9b4,0xc9))[_0x9dbb('0x43')](handleError(_0x1fa9b4,null));};exports[_0x9dbb('0x25')]=function(_0x372e68,_0x5e15c3){if(_0x372e68[_0x9dbb('0x4a')]['id']){delete _0x372e68['body']['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x372e68[_0x9dbb('0x45')]['id']}})[_0x9dbb('0x26')](handleEntityNotFound(_0x5e15c3,null))[_0x9dbb('0x26')](saveUpdates(_0x372e68[_0x9dbb('0x4a')],null))['then'](respondWithResult(_0x5e15c3,null))[_0x9dbb('0x43')](handleError(_0x5e15c3,null));};exports['destroy']=function(_0x343f14,_0x2dc48a){return db[_0x9dbb('0x2d')][_0x9dbb('0x4b')]({'where':{'id':_0x343f14[_0x9dbb('0x45')]['id']}})[_0x9dbb('0x26')](handleEntityNotFound(_0x2dc48a,null))['then'](removeEntity(_0x2dc48a,null))[_0x9dbb('0x43')](handleError(_0x2dc48a,null));};exports[_0x9dbb('0x4c')]=function(_0x33ff6d,_0x40c09c,_0x1ada55){var _0x482f8e={};var _0x2e3726={};var _0x511f43;var _0x2eb213;return db['ServicenowAccount'][_0x9dbb('0x4d')]({'where':{'id':_0x33ff6d['params']['id']}})['then'](handleEntityNotFound(_0x40c09c,null))[_0x9dbb('0x26')](function(_0xccfb05){if(_0xccfb05){_0x511f43=_0xccfb05;_0x2e3726[_0x9dbb('0x37')]=_[_0x9dbb('0x46')](db[_0x9dbb('0x4e')][_0x9dbb('0x47')]);_0x2e3726[_0x9dbb('0x31')]=_[_0x9dbb('0x46')](_0x33ff6d[_0x9dbb('0x31')]);_0x2e3726[_0x9dbb('0x32')]=_['intersection'](_0x2e3726['model'],_0x2e3726[_0x9dbb('0x31')]);_0x482f8e[_0x9dbb('0x34')]=_[_0x9dbb('0x33')](_0x2e3726[_0x9dbb('0x37')],qs['fields'](_0x33ff6d[_0x9dbb('0x31')][_0x9dbb('0x35')]));_0x482f8e[_0x9dbb('0x34')]=_0x482f8e[_0x9dbb('0x34')][_0x9dbb('0x36')]?_0x482f8e['attributes']:_0x2e3726[_0x9dbb('0x37')];_0x482f8e[_0x9dbb('0x3a')]=qs[_0x9dbb('0x3b')](_0x33ff6d[_0x9dbb('0x31')][_0x9dbb('0x3b')]);_0x482f8e[_0x9dbb('0x3c')]=qs[_0x9dbb('0x32')](_['pick'](_0x33ff6d[_0x9dbb('0x31')],_0x2e3726[_0x9dbb('0x32')]));if(_0x33ff6d['query']['filter']){_0x482f8e[_0x9dbb('0x3c')]=_[_0x9dbb('0x3e')](_0x482f8e['where'],{'$or':_[_0x9dbb('0x2c')](_0x482f8e[_0x9dbb('0x34')],function(_0x1d1197){var _0x15e073={};_0x15e073[_0x1d1197]={'$like':'%'+_0x33ff6d[_0x9dbb('0x31')][_0x9dbb('0x4f')]+'%'};return _0x15e073;})});}_0x482f8e=_[_0x9dbb('0x3e')]({},_0x482f8e,_0x33ff6d[_0x9dbb('0x3f')]);return _0x511f43[_0x9dbb('0x4c')](_0x482f8e);}})[_0x9dbb('0x26')](function(_0x5b850e){if(_0x5b850e){_0x2eb213=_0x5b850e[_0x9dbb('0x36')];if(!_0x33ff6d['query'][_0x9dbb('0x38')]('nolimit')){_0x482f8e[_0x9dbb('0x1f')]=qs['limit'](_0x33ff6d[_0x9dbb('0x31')]['limit']);_0x482f8e[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x33ff6d[_0x9dbb('0x31')]['offset']);}return _0x511f43[_0x9dbb('0x4c')](_0x482f8e);}})[_0x9dbb('0x26')](function(_0x1bfa52){if(_0x1bfa52){return _0x1bfa52?{'count':_0x2eb213,'rows':_0x1bfa52}:null;}})['then'](respondWithResult(_0x40c09c,null))[_0x9dbb('0x43')](handleError(_0x40c09c,null));};exports['addConfiguration']=function(_0x14695a,_0x45118f,_0x4466ae){if(_0x14695a[_0x9dbb('0x4a')]['id']){delete _0x14695a[_0x9dbb('0x4a')]['id'];}return db[_0x9dbb('0x2d')][_0x9dbb('0x4d')]({'where':{'id':_0x14695a[_0x9dbb('0x45')]['id']}})['then'](handleEntityNotFound(_0x45118f,null))[_0x9dbb('0x26')](function(_0x1c2077){if(_0x1c2077){_0x14695a[_0x9dbb('0x4a')][_0x9dbb('0x50')]=_0x1c2077['id'];_0x14695a[_0x9dbb('0x4a')][_0x9dbb('0x51')]=integrations[_0x9dbb('0x52')](_0x14695a['body']['channel'],_0x14695a['body'][_0x9dbb('0x2f')]);_0x14695a[_0x9dbb('0x4a')]['Descriptions']=integrations[_0x9dbb('0x53')](_0x14695a[_0x9dbb('0x4a')]['channel'],_0x14695a[_0x9dbb('0x4a')][_0x9dbb('0x2f')]);return db['ServicenowConfiguration']['create'](_0x14695a[_0x9dbb('0x4a')],{'include':[{'model':db[_0x9dbb('0x54')],'as':_0x9dbb('0x51')},{'model':db['ServicenowField'],'as':_0x9dbb('0x55')}]});}return null;})[_0x9dbb('0x26')](respondWithResult(_0x45118f,null))[_0x9dbb('0x43')](handleError(_0x45118f,null));};exports[_0x9dbb('0x56')]=function(_0x476c75,_0x341787,_0x5b6f6c){var _0x40469c=[_0x9dbb('0x57'),_0x9dbb('0x58'),_0x9dbb('0x59'),_0x9dbb('0x5a'),_0x9dbb('0x5b'),_0x9dbb('0x5c'),_0x9dbb('0x5d'),_0x9dbb('0x5e'),_0x9dbb('0x5f')];var _0x47adf5=[_0x9dbb('0x60'),_0x9dbb('0x57'),_0x9dbb('0x61'),'watch_list',_0x9dbb('0x62'),'sys_updated_on','child_incidents',_0x9dbb('0x58'),_0x9dbb('0x63'),_0x9dbb('0x64'),_0x9dbb('0x65'),_0x9dbb('0x66'),_0x9dbb('0x67'),_0x9dbb('0x68'),_0x9dbb('0x69'),_0x9dbb('0x6a'),_0x9dbb('0x6b'),_0x9dbb('0x6c'),'knowledge',_0x9dbb('0x3a'),'calendar_stc',_0x9dbb('0x6d'),_0x9dbb('0x6e'),_0x9dbb('0x6f'),_0x9dbb('0x70'),_0x9dbb('0x71'),_0x9dbb('0x72'),_0x9dbb('0x73'),_0x9dbb('0x74'),_0x9dbb('0x75'),_0x9dbb('0x76'),_0x9dbb('0x77'),_0x9dbb('0x78'),_0x9dbb('0x79'),'business_duration','group_list',_0x9dbb('0x7a'),_0x9dbb('0x7b'),_0x9dbb('0x7c'),_0x9dbb('0x7d'),_0x9dbb('0x7e'),_0x9dbb('0x5a'),_0x9dbb('0x7f'),_0x9dbb('0x80'),'close_code',_0x9dbb('0x81'),_0x9dbb('0x82'),_0x9dbb('0x83'),'assignment_group',_0x9dbb('0x84'),_0x9dbb('0x85'),'description',_0x9dbb('0x86'),_0x9dbb('0x5c'),_0x9dbb('0x87'),_0x9dbb('0x88'),_0x9dbb('0x89'),_0x9dbb('0x8a'),_0x9dbb('0x8b'),'sys_id','contact_type',_0x9dbb('0x8c'),_0x9dbb('0x5d'),'urgency',_0x9dbb('0x8d'),'company','reassignment_count',_0x9dbb('0x8e'),_0x9dbb('0x8f'),_0x9dbb('0x5e'),'comments','sla_due',_0x9dbb('0x90'),_0x9dbb('0x91'),_0x9dbb('0x92'),_0x9dbb('0x93'),_0x9dbb('0x94'),'sys_tags','escalation',_0x9dbb('0x95'),_0x9dbb('0x96'),_0x9dbb('0x97'),_0x9dbb('0x5f')];var _0x327a5d='';var _0x46be6c='';var _0x3f65f4=[];var _0x4a350a='';var _0x325a42='';var _0x300043=[];var _0xedce4a='';var _0x5f0df0='';var _0x17ffe6={};var _0x49b1c1='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x476c75['params']['id']},'attributes':['id',_0x9dbb('0x98'),'password','email','remoteUri','serverUrl']})[_0x9dbb('0x26')](handleEntityNotFound(_0x341787,null))[_0x9dbb('0x26')](function(_0xdebf9a){if(_0xdebf9a){_0x49b1c1=_0xdebf9a[_0x9dbb('0x99')];var _0x3cb5e6=_0x49b1c1[_0x9dbb('0x9a')](-0x1);if(_0x3cb5e6==='/'){_0x49b1c1=_0x49b1c1['substring'](0x0,_0x49b1c1['lastIndexOf'](_0x3cb5e6));}_0x5f0df0=util[_0x9dbb('0x9b')](_0x9dbb('0x9c'),_0x49b1c1);_0xedce4a=util[_0x9dbb('0x9b')](_0x9dbb('0x9d'),_0x49b1c1);_0x17ffe6={'user':_0xdebf9a[_0x9dbb('0x98')],'pass':_0xdebf9a[_0x9dbb('0x9e')]};var _0x4ff3f4={'method':_0x9dbb('0x9f'),'uri':_0x5f0df0+_0x9dbb('0xa0'),'auth':_0x17ffe6,'json':!![]};return rp(_0x4ff3f4);}})[_0x9dbb('0x26')](function(_0x56b27b){if(_0x56b27b[_0x9dbb('0xa1')][_0x9dbb('0x36')]>0x0){_0x327a5d=_0x56b27b['result'];}console[_0x9dbb('0xa2')](_0x9dbb('0xa3'),_0x327a5d);_0x300043=[];_0x46be6c=Object['assign']([],_0x327a5d);_[_0x9dbb('0xa4')](_0x46be6c,function(_0x1f5a4c){return!_0x40469c[_0x9dbb('0xa5')](_0x1f5a4c[_0x9dbb('0x29')]);});_0x46be6c[_0x9dbb('0xa6')](function(_0x95f388){var _0x5f325f=createFieldObject(_0xedce4a,_0x17ffe6,_0x95f388[_0x9dbb('0xa7')],_0x95f388[_0x9dbb('0x29')],_0x95f388['label'],![]);_0x300043['push'](_0x5f325f);});return Promise[_0x9dbb('0xa8')](_0x300043);})[_0x9dbb('0x26')](function(_0x30f222){_0x3f65f4=_0x30f222;_0x4a350a=Object[_0x9dbb('0xa9')]([],_0x327a5d);console[_0x9dbb('0xa2')](_0x9dbb('0xaa'),_0x327a5d);_[_0x9dbb('0xa4')](_0x4a350a,function(_0xe0a118){return _0x47adf5['includes'](_0xe0a118[_0x9dbb('0x29')]);});console['log'](_0x9dbb('0xab'),_0x4a350a);_0x300043=[];_0x4a350a[_0x9dbb('0xa6')](function(_0x250ace){var _0x224a2e=createFieldObject(_0xedce4a,_0x17ffe6,_0x250ace[_0x9dbb('0xa7')],_0x250ace['name'],_0x250ace[_0x9dbb('0xac')],!![]);_0x300043[_0x9dbb('0xad')](_0x224a2e);});return Promise[_0x9dbb('0xa8')](_0x300043);})['then'](function(_0x4f4c3b){_0x325a42=_0x4f4c3b;var _0x155804=_0x3f65f4[_0x9dbb('0xae')](_0x325a42);return{'count':_0x155804['length'],'rows':_0x155804};})[_0x9dbb('0x26')](respondWithResult(_0x341787,null))[_0x9dbb('0x43')](function(_0x5a5b10){console['log'](_0x9dbb('0xaf')+_0x5a5b10);var _0x12b70e=_0x476c75[_0x9dbb('0x31')][_0x9dbb('0xb0')]?0x1f4:_0x5a5b10[_0x9dbb('0xb1')]||0x1f4;logger[_0x9dbb('0xb2')](_0x5a5b10['stack']);delete _0x5a5b10[_0x9dbb('0x29')];if(_0x12b70e===0x191){_0x12b70e=0x190;}_0x341787[_0x9dbb('0x1b')](_0x12b70e)[_0x9dbb('0x2a')](_0x476c75[_0x9dbb('0x31')][_0x9dbb('0xb0')]?{'message':_0x9dbb('0xb3'),'statusCode':_0x5a5b10[_0x9dbb('0xb1')]}:_0x5a5b10);});};function createFieldObject(_0x57975b,_0x2373b4,_0x494f61,_0x3e4425,_0xd105f8,_0x1a13bb){return new Promise(function(_0x455d0b,_0x5e3c16){var _0x6f1009={'id':_0x3e4425,'name':_0xd105f8,'custom':_0x1a13bb};if(_0x494f61===_0x9dbb('0xb4')){_0x6f1009[_0x9dbb('0x3f')]=[{'name':_0x9dbb('0xb5'),'value':_0x9dbb('0xb6')},{'name':_0x9dbb('0xb7'),'value':'false'}];_0x455d0b(_0x6f1009);}else{var _0x18b56b={'method':_0x9dbb('0x9f'),'uri':_0x57975b+_0x9dbb('0xb8')+_0x3e4425,'auth':_0x2373b4,'json':!![]};return rp(_0x18b56b)[_0x9dbb('0x26')](function(_0x1fe6e3){var _0x4faff9=[];if(_0x1fe6e3[_0x9dbb('0xa1')]['length']>0x0){_0x1fe6e3[_0x9dbb('0xa1')][_0x9dbb('0xa6')](function(_0x2f5055){if(_0x2f5055['inactive']===_0x9dbb('0xb9')){var _0x3488cb={'name':_0x2f5055[_0x9dbb('0xac')],'value':_0x2f5055['value']};_0x4faff9[_0x9dbb('0xad')](_0x3488cb);}});}_0x6f1009[_0x9dbb('0x3f')]=_0x4faff9;if(_0x6f1009[_0x9dbb('0x3f')][_0x9dbb('0x36')]>0x0){_0x455d0b(_0x6f1009);}else{if(_0x1a13bb==![]){_0x455d0b();}else{_0x455d0b(_0x6f1009);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index abed48b..1e033fb 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x519d77,_0x4e758e){var _0x56e79d=function(_0x10744e){while(--_0x10744e){_0x519d77['push'](_0x519d77['shift']());}};_0x56e79d(++_0x4e758e);}(_0x1883,0xab));var _0x3188=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0x1883[_0x380016];return _0x5c7ac0;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x327c40,_0x72ce79){var _0x3bba2d=function(_0x42d50f){while(--_0x42d50f){_0x327c40['push'](_0x327c40['shift']());}};_0x3bba2d(++_0x72ce79);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x317f15,_0xe676bc){_0x317f15=_0x317f15-0x0;var _0x4ecc99=_0xdbf5[_0x317f15];return _0x4ecc99;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));var integrations=require(_0x5dbf('0x8'));module[_0x5dbf('0x9')]=function(_0x3f8222,_0x209b7d){return _0x3f8222[_0x5dbf('0xa')](_0x5dbf('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 32f6e43..cf00de4 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2484=['model','attributes','ShowServicenowAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','limit','include','map'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x2484,0x6e));var _0x4248=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x2484[_0x2f2360];return _0x1cc8d3;};'use strict';var _=require(_0x4248('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4248('0x1'));var rs=require(_0x4248('0x2'));var fs=require('fs');var Redis=require(_0x4248('0x3'));var db=require(_0x4248('0x4'))['db'];var utils=require(_0x4248('0x5'));var logger=require('../../config/logger')(_0x4248('0x6'));var config=require(_0x4248('0x7'));var jayson=require(_0x4248('0x8'));var client=jayson[_0x4248('0x9')][_0x4248('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c701,_0x468682,_0x4fa55b){return new BPromise(function(_0x21d87d,_0x1fe3f6){return client['request'](_0x51c701,_0x4fa55b)[_0x4248('0xb')](function(_0x5c7406){logger[_0x4248('0xc')](_0x4248('0xd'),_0x468682,'request\x20sent');logger[_0x4248('0xe')](_0x4248('0xf'),_0x468682,'request\x20sent',JSON[_0x4248('0x10')](_0x5c7406));if(_0x5c7406[_0x4248('0x11')]){if(_0x5c7406[_0x4248('0x11')]['code']===0x1f4){logger['error'](_0x4248('0xd'),_0x468682,_0x5c7406['error'][_0x4248('0x12')]);return _0x1fe3f6(_0x5c7406[_0x4248('0x11')][_0x4248('0x12')]);}logger[_0x4248('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x468682,_0x5c7406[_0x4248('0x11')][_0x4248('0x12')]);return _0x21d87d(_0x5c7406[_0x4248('0x11')][_0x4248('0x12')]);}else{logger[_0x4248('0xc')](_0x4248('0xd'),_0x468682,_0x4248('0x13'));_0x21d87d(_0x5c7406[_0x4248('0x14')]['message']);}})[_0x4248('0x15')](function(_0x25bbef){logger[_0x4248('0x11')](_0x4248('0xd'),_0x468682,_0x25bbef);_0x1fe3f6(_0x25bbef);});});}exports[_0x4248('0x16')]=function(_0x3a2b72){var _0x351051=this;return new Promise(function(_0x35bb0d,_0x31b10e){return db[_0x4248('0x17')][_0x4248('0x18')]({'raw':_0x3a2b72[_0x4248('0x19')]?_0x3a2b72[_0x4248('0x19')][_0x4248('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a2b72[_0x4248('0x19')]?_0x3a2b72['options']['where']||null:null,'attributes':_0x3a2b72[_0x4248('0x19')]?_0x3a2b72['options']['attributes']||null:null,'limit':_0x3a2b72['options']?_0x3a2b72[_0x4248('0x19')][_0x4248('0x1b')]||null:null,'include':_0x3a2b72['options']?_0x3a2b72[_0x4248('0x19')][_0x4248('0x1c')]?_[_0x4248('0x1d')](_0x3a2b72[_0x4248('0x19')]['include'],function(_0x43aa1f){return{'model':db[_0x43aa1f['model']],'as':_0x43aa1f['as'],'attributes':_0x43aa1f['attributes'],'include':_0x43aa1f[_0x4248('0x1c')]?_['map'](_0x43aa1f[_0x4248('0x1c')],function(_0x1072af){return{'model':db[_0x1072af[_0x4248('0x1e')]],'as':_0x1072af['as'],'attributes':_0x1072af[_0x4248('0x1f')],'include':_0x1072af[_0x4248('0x1c')]?_['map'](_0x1072af[_0x4248('0x1c')],function(_0x1ada15){return{'model':db[_0x1ada15[_0x4248('0x1e')]],'as':_0x1ada15['as'],'attributes':_0x1ada15[_0x4248('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4248('0xb')](function(_0x50d6cf){logger[_0x4248('0xc')](_0x4248('0x16'),_0x3a2b72);logger[_0x4248('0xe')]('GetServicenowAccount',_0x3a2b72,JSON['stringify'](_0x50d6cf));_0x35bb0d(_0x50d6cf);})['catch'](function(_0x190b68){logger[_0x4248('0x11')]('GetServicenowAccount',_0x190b68['message'],_0x3a2b72);_0x31b10e(_0x351051[_0x4248('0x11')](0x1f4,_0x190b68[_0x4248('0x12')]));});});};exports[_0x4248('0x20')]=function(_0x3df4b6){var _0x3700eb=this;return new Promise(function(_0x2c1233,_0x5e5bb4){return db[_0x4248('0x17')][_0x4248('0x21')]({'raw':_0x3df4b6['options']?_0x3df4b6['options'][_0x4248('0x1a')]===undefined?!![]:![]:!![],'where':_0x3df4b6['options']?_0x3df4b6[_0x4248('0x19')][_0x4248('0x22')]||null:null,'attributes':_0x3df4b6['options']?_0x3df4b6['options'][_0x4248('0x1f')]||null:null,'include':_0x3df4b6[_0x4248('0x19')]?_0x3df4b6['options'][_0x4248('0x1c')]?_['map'](_0x3df4b6[_0x4248('0x19')][_0x4248('0x1c')],function(_0x4b7a74){return{'model':db[_0x4b7a74[_0x4248('0x1e')]],'as':_0x4b7a74['as'],'attributes':_0x4b7a74[_0x4248('0x1f')],'include':_0x4b7a74[_0x4248('0x1c')]?_[_0x4248('0x1d')](_0x4b7a74[_0x4248('0x1c')],function(_0x10a5d3){return{'model':db[_0x10a5d3[_0x4248('0x1e')]],'as':_0x10a5d3['as'],'attributes':_0x10a5d3[_0x4248('0x1f')],'include':_0x10a5d3[_0x4248('0x1c')]?_[_0x4248('0x1d')](_0x10a5d3['include'],function(_0x35dac2){return{'model':db[_0x35dac2['model']],'as':_0x35dac2['as'],'attributes':_0x35dac2[_0x4248('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4248('0xb')](function(_0x4795b7){logger[_0x4248('0xc')](_0x4248('0x20'),_0x3df4b6);logger[_0x4248('0xe')](_0x4248('0x20'),_0x3df4b6,JSON[_0x4248('0x10')](_0x4795b7));_0x2c1233(_0x4795b7);})[_0x4248('0x15')](function(_0x415e48){logger[_0x4248('0x11')](_0x4248('0x20'),_0x415e48[_0x4248('0x12')],_0x3df4b6);_0x5e5bb4(_0x3700eb[_0x4248('0x11')](0x1f4,_0x415e48[_0x4248('0x12')]));});});}; \ No newline at end of file +var _0xf0db=['raw','where','limit','map','include','model','attributes','GetServicenowAccount','stringify','ShowServicenowAccount','ServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','findAll','options'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf0db,0x1c8));var _0xbf0d=function(_0x1bafb1,_0x3f4d43){_0x1bafb1=_0x1bafb1-0x0;var _0x1e9aa9=_0xf0db[_0x1bafb1];return _0x1e9aa9;};'use strict';var _=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var moment=require(_0xbf0d('0x2'));var BPromise=require(_0xbf0d('0x3'));var rs=require(_0xbf0d('0x4'));var fs=require('fs');var Redis=require(_0xbf0d('0x5'));var db=require(_0xbf0d('0x6'))['db'];var utils=require(_0xbf0d('0x7'));var logger=require(_0xbf0d('0x8'))(_0xbf0d('0x9'));var config=require('../../config/environment');var jayson=require(_0xbf0d('0xa'));var client=jayson[_0xbf0d('0xb')][_0xbf0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4bbd1f,_0x2b2772,_0x3ca03c){return new BPromise(function(_0x45ec6a,_0x123bc4){return client['request'](_0x4bbd1f,_0x3ca03c)[_0xbf0d('0xd')](function(_0x39cf04){logger['info'](_0xbf0d('0xe'),_0x2b2772,_0xbf0d('0xf'));logger[_0xbf0d('0x10')](_0xbf0d('0x11'),_0x2b2772,'request\x20sent',JSON['stringify'](_0x39cf04));if(_0x39cf04[_0xbf0d('0x12')]){if(_0x39cf04['error'][_0xbf0d('0x13')]===0x1f4){logger[_0xbf0d('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x2b2772,_0x39cf04[_0xbf0d('0x12')][_0xbf0d('0x14')]);return _0x123bc4(_0x39cf04[_0xbf0d('0x12')][_0xbf0d('0x14')]);}logger[_0xbf0d('0x12')](_0xbf0d('0xe'),_0x2b2772,_0x39cf04[_0xbf0d('0x12')]['message']);return _0x45ec6a(_0x39cf04[_0xbf0d('0x12')]['message']);}else{logger[_0xbf0d('0x15')](_0xbf0d('0xe'),_0x2b2772,_0xbf0d('0xf'));_0x45ec6a(_0x39cf04[_0xbf0d('0x16')][_0xbf0d('0x14')]);}})['catch'](function(_0x43e943){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2b2772,_0x43e943);_0x123bc4(_0x43e943);});});}exports['GetServicenowAccount']=function(_0x161390){var _0xff867e=this;return new Promise(function(_0x2dfed8,_0x4ea94a){return db['ServicenowAccount'][_0xbf0d('0x17')]({'raw':_0x161390[_0xbf0d('0x18')]?_0x161390[_0xbf0d('0x18')][_0xbf0d('0x19')]===undefined?!![]:![]:!![],'where':_0x161390[_0xbf0d('0x18')]?_0x161390[_0xbf0d('0x18')][_0xbf0d('0x1a')]||null:null,'attributes':_0x161390[_0xbf0d('0x18')]?_0x161390[_0xbf0d('0x18')]['attributes']||null:null,'limit':_0x161390['options']?_0x161390['options'][_0xbf0d('0x1b')]||null:null,'include':_0x161390['options']?_0x161390[_0xbf0d('0x18')]['include']?_[_0xbf0d('0x1c')](_0x161390[_0xbf0d('0x18')][_0xbf0d('0x1d')],function(_0x27356d){return{'model':db[_0x27356d[_0xbf0d('0x1e')]],'as':_0x27356d['as'],'attributes':_0x27356d[_0xbf0d('0x1f')],'include':_0x27356d[_0xbf0d('0x1d')]?_['map'](_0x27356d[_0xbf0d('0x1d')],function(_0x5506e5){return{'model':db[_0x5506e5[_0xbf0d('0x1e')]],'as':_0x5506e5['as'],'attributes':_0x5506e5['attributes'],'include':_0x5506e5[_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x5506e5[_0xbf0d('0x1d')],function(_0x3992e6){return{'model':db[_0x3992e6['model']],'as':_0x3992e6['as'],'attributes':_0x3992e6[_0xbf0d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf0d('0xd')](function(_0x4f01e4){logger[_0xbf0d('0x15')](_0xbf0d('0x20'),_0x161390);logger[_0xbf0d('0x10')](_0xbf0d('0x20'),_0x161390,JSON[_0xbf0d('0x21')](_0x4f01e4));_0x2dfed8(_0x4f01e4);})['catch'](function(_0x5e7123){logger[_0xbf0d('0x12')](_0xbf0d('0x20'),_0x5e7123[_0xbf0d('0x14')],_0x161390);_0x4ea94a(_0xff867e['error'](0x1f4,_0x5e7123[_0xbf0d('0x14')]));});});};exports[_0xbf0d('0x22')]=function(_0x1c4b58){var _0x3ebf0c=this;return new Promise(function(_0x243f37,_0x26e9d2){return db[_0xbf0d('0x23')][_0xbf0d('0x24')]({'raw':_0x1c4b58[_0xbf0d('0x18')]?_0x1c4b58[_0xbf0d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1c4b58[_0xbf0d('0x18')]?_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1a')]||null:null,'attributes':_0x1c4b58['options']?_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1f')]||null:null,'include':_0x1c4b58['options']?_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1d')],function(_0x5ef1f1){return{'model':db[_0x5ef1f1['model']],'as':_0x5ef1f1['as'],'attributes':_0x5ef1f1[_0xbf0d('0x1f')],'include':_0x5ef1f1[_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x5ef1f1[_0xbf0d('0x1d')],function(_0x232987){return{'model':db[_0x232987[_0xbf0d('0x1e')]],'as':_0x232987['as'],'attributes':_0x232987['attributes'],'include':_0x232987[_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x232987['include'],function(_0x207452){return{'model':db[_0x207452[_0xbf0d('0x1e')]],'as':_0x207452['as'],'attributes':_0x207452['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf0d('0xd')](function(_0x4857ff){logger[_0xbf0d('0x15')](_0xbf0d('0x22'),_0x1c4b58);logger[_0xbf0d('0x10')](_0xbf0d('0x22'),_0x1c4b58,JSON[_0xbf0d('0x21')](_0x4857ff));_0x243f37(_0x4857ff);})['catch'](function(_0x555a91){logger['error'](_0xbf0d('0x22'),_0x555a91[_0xbf0d('0x14')],_0x1c4b58);_0x26e9d2(_0x3ebf0c[_0xbf0d('0x12')](0x1f4,_0x555a91[_0xbf0d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index e3cfcd2..c21bb89 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00cd=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','exports'];(function(_0x2f6fd8,_0x1f019d){var _0x60d49c=function(_0x183f5b){while(--_0x183f5b){_0x2f6fd8['push'](_0x2f6fd8['shift']());}};_0x60d49c(++_0x1f019d);}(_0x00cd,0x8a));var _0xd00c=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x00cd[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require(_0xd00c('0x0'));var util=require('util');var path=require(_0xd00c('0x1'));var timeout=require(_0xd00c('0x2'));var express=require(_0xd00c('0x3'));var router=express[_0xd00c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd00c('0x5'));var interaction=require(_0xd00c('0x6'));var config=require(_0xd00c('0x7'));var controller=require(_0xd00c('0x8'));router[_0xd00c('0x9')]('/',auth[_0xd00c('0xa')](),controller[_0xd00c('0xb')]);router[_0xd00c('0x9')](_0xd00c('0xc'),auth['isAuthenticated'](),controller[_0xd00c('0xd')]);router['get']('/:id/fields',auth[_0xd00c('0xa')](),controller[_0xd00c('0xe')]);router[_0xd00c('0x9')](_0xd00c('0xf'),auth[_0xd00c('0xa')](),controller['getSubjects']);router['get'](_0xd00c('0x10'),auth['isAuthenticated'](),controller[_0xd00c('0x11')]);router[_0xd00c('0x12')]('/',auth[_0xd00c('0xa')](),controller[_0xd00c('0x13')]);router[_0xd00c('0x14')]('/:id',auth[_0xd00c('0xa')](),controller[_0xd00c('0x15')]);router['delete'](_0xd00c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd00c('0x16')]=router; \ No newline at end of file +var _0xb16d=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x26df53,_0xb72f1f){var _0x347d69=function(_0x1e01ca){while(--_0x1e01ca){_0x26df53['push'](_0x26df53['shift']());}};_0x347d69(++_0xb72f1f);}(_0xb16d,0x191));var _0xdb16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb16d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdb16('0x0'));var util=require(_0xdb16('0x1'));var path=require(_0xdb16('0x2'));var timeout=require(_0xdb16('0x3'));var express=require('express');var router=express[_0xdb16('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdb16('0x5'));var interaction=require(_0xdb16('0x6'));var config=require(_0xdb16('0x7'));var controller=require(_0xdb16('0x8'));router['get']('/',auth[_0xdb16('0x9')](),controller[_0xdb16('0xa')]);router[_0xdb16('0xb')](_0xdb16('0xc'),auth[_0xdb16('0x9')](),controller[_0xdb16('0xd')]);router[_0xdb16('0xb')](_0xdb16('0xe'),auth[_0xdb16('0x9')](),controller[_0xdb16('0xf')]);router[_0xdb16('0xb')](_0xdb16('0x10'),auth[_0xdb16('0x9')](),controller[_0xdb16('0x11')]);router[_0xdb16('0xb')](_0xdb16('0x12'),auth['isAuthenticated'](),controller[_0xdb16('0x13')]);router['post']('/',auth[_0xdb16('0x9')](),controller['create']);router[_0xdb16('0x14')](_0xdb16('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdb16('0xc'),auth[_0xdb16('0x9')](),controller[_0xdb16('0x15')]);module[_0xdb16('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 5a3967c..d6e02fd 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4f1=['exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb4f1,0x1f0));var _0x1b4f=function(_0x2a18d9,_0x421a90){_0x2a18d9=_0x2a18d9-0x0;var _0x31b144=_0xb4f1[_0x2a18d9];return _0x31b144;};'use strict';var Sequelize=require('sequelize');module[_0x1b4f('0x0')]={'name':{'type':Sequelize[_0x1b4f('0x1')]},'description':{'type':Sequelize[_0x1b4f('0x1')]}}; \ No newline at end of file +var _0xde6a=['sequelize','exports','STRING'];(function(_0x4ee9c1,_0x55003e){var _0x49ce20=function(_0x129721){while(--_0x129721){_0x4ee9c1['push'](_0x4ee9c1['shift']());}};_0x49ce20(++_0x55003e);}(_0xde6a,0x11a));var _0xade6=function(_0x4e2337,_0x196364){_0x4e2337=_0x4e2337-0x0;var _0x9afca2=_0xde6a[_0x4e2337];return _0x9afca2;};'use strict';var Sequelize=require(_0xade6('0x0'));module[_0xade6('0x1')]={'name':{'type':Sequelize[_0xade6('0x2')]},'description':{'type':Sequelize[_0xade6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b9831b3..a9398c3 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['findAll','rows','catch','show','params','filters','length','options','find','create','body','getFields','ServicenowField','getSubjects','getDescriptions','findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','ServicenowConfiguration','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','includeAll','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x750a,0x1bf));var _0xa750=function(_0x62a56f,_0x4cedeb){_0x62a56f=_0x62a56f-0x0;var _0x156be0=_0x750a[_0x62a56f];return _0x156be0;};'use strict';var emlformat=require(_0xa750('0x0'));var rimraf=require(_0xa750('0x1'));var zipdir=require(_0xa750('0x2'));var jsonpatch=require(_0xa750('0x3'));var rp=require(_0xa750('0x4'));var moment=require(_0xa750('0x5'));var BPromise=require(_0xa750('0x6'));var Mustache=require(_0xa750('0x7'));var util=require(_0xa750('0x8'));var path=require(_0xa750('0x9'));var sox=require(_0xa750('0xa'));var csv=require('to-csv');var ejs=require(_0xa750('0xb'));var fs=require('fs');var fs_extra=require(_0xa750('0xc'));var _=require(_0xa750('0xd'));var squel=require('squel');var crypto=require(_0xa750('0xe'));var jsforce=require(_0xa750('0xf'));var deskjs=require(_0xa750('0x10'));var toCsv=require(_0xa750('0x11'));var querystring=require(_0xa750('0x12'));var Papa=require(_0xa750('0x13'));var Redis=require(_0xa750('0x14'));var authService=require(_0xa750('0x15'));var qs=require(_0xa750('0x16'));var as=require(_0xa750('0x17'));var hardwareService=require(_0xa750('0x18'));var logger=require(_0xa750('0x19'))(_0xa750('0x1a'));var utils=require(_0xa750('0x1b'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa750('0x1c'))['db'];function respondWithStatusCode(_0x1ab78a,_0x4fe535){_0x4fe535=_0x4fe535||0xcc;return function(_0x504ceb){if(_0x504ceb){return _0x1ab78a[_0xa750('0x1d')](_0x4fe535);}return _0x1ab78a[_0xa750('0x1e')](_0x4fe535)['end']();};}function respondWithResult(_0x532abb,_0x4ea928){_0x4ea928=_0x4ea928||0xc8;return function(_0x4c9430){if(_0x4c9430){return _0x532abb[_0xa750('0x1e')](_0x4ea928)[_0xa750('0x1f')](_0x4c9430);}};}function respondWithFilteredResult(_0x3ce51c,_0x88bcc8){return function(_0x32d893){if(_0x32d893){var _0x200860=typeof _0x88bcc8[_0xa750('0x20')]===_0xa750('0x21')&&typeof _0x88bcc8['limit']===_0xa750('0x21');var _0x4c72cb=_0x32d893[_0xa750('0x22')];var _0x5b0a38=_0x200860?0x0:_0x88bcc8[_0xa750('0x20')];var _0x543f62=_0x200860?_0x32d893[_0xa750('0x22')]:_0x88bcc8[_0xa750('0x20')]+_0x88bcc8[_0xa750('0x23')];var _0x3b0416;if(_0x543f62>=_0x4c72cb){_0x543f62=_0x4c72cb;_0x3b0416=0xc8;}else{_0x3b0416=0xce;}_0x3ce51c[_0xa750('0x1e')](_0x3b0416);return _0x3ce51c[_0xa750('0x24')](_0xa750('0x25'),_0x5b0a38+'-'+_0x543f62+'/'+_0x4c72cb)['json'](_0x32d893);}return null;};}function patchUpdates(_0x46f92d){return function(_0x74a97f){try{jsonpatch[_0xa750('0x26')](_0x74a97f,_0x46f92d,!![]);}catch(_0x1b026c){return BPromise[_0xa750('0x27')](_0x1b026c);}return _0x74a97f[_0xa750('0x28')]();};}function saveUpdates(_0x20f64,_0x3bad14){return function(_0xbd3c4b){if(_0xbd3c4b){return _0xbd3c4b[_0xa750('0x29')](_0x20f64)[_0xa750('0x2a')](function(_0x327f35){return _0x327f35;});}return null;};}function removeEntity(_0x325f73,_0x28588f){return function(_0x29b18a){if(_0x29b18a){return _0x29b18a[_0xa750('0x2b')]()[_0xa750('0x2a')](function(){_0x325f73[_0xa750('0x1e')](0xcc)[_0xa750('0x2c')]();});}};}function handleEntityNotFound(_0x2b254d,_0x59a6a3){return function(_0x4b9ccb){if(!_0x4b9ccb){_0x2b254d[_0xa750('0x1d')](0x194);}return _0x4b9ccb;};}function handleError(_0x8463bc,_0x1815f8){_0x1815f8=_0x1815f8||0x1f4;return function(_0x4e4c9a){logger[_0xa750('0x2d')](_0x4e4c9a[_0xa750('0x2e')]);if(_0x4e4c9a[_0xa750('0x2f')]){delete _0x4e4c9a[_0xa750('0x2f')];}_0x8463bc[_0xa750('0x1e')](_0x1815f8)['send'](_0x4e4c9a);};}exports[_0xa750('0x30')]=function(_0x5a7708,_0x25c449){var _0x135153={},_0x447376={},_0xdbd8ca={'count':0x0,'rows':[]};var _0x482fb4=_['map'](db[_0xa750('0x31')][_0xa750('0x32')],function(_0x10c615){return{'name':_0x10c615[_0xa750('0x33')],'type':_0x10c615[_0xa750('0x34')]['key']};});_0x447376[_0xa750('0x35')]=_[_0xa750('0x36')](_0x482fb4,_0xa750('0x2f'));_0x447376[_0xa750('0x37')]=_[_0xa750('0x38')](_0x5a7708['query']);_0x447376['filters']=_[_0xa750('0x39')](_0x447376[_0xa750('0x35')],_0x447376['query']);_0x135153[_0xa750('0x3a')]=_[_0xa750('0x39')](_0x447376['model'],qs[_0xa750('0x3b')](_0x5a7708[_0xa750('0x37')][_0xa750('0x3b')]));_0x135153[_0xa750('0x3a')]=_0x135153['attributes']['length']?_0x135153[_0xa750('0x3a')]:_0x447376[_0xa750('0x35')];if(!_0x5a7708[_0xa750('0x37')]['hasOwnProperty'](_0xa750('0x3c'))){_0x135153['limit']=qs['limit'](_0x5a7708['query'][_0xa750('0x23')]);_0x135153[_0xa750('0x20')]=qs[_0xa750('0x20')](_0x5a7708[_0xa750('0x37')][_0xa750('0x20')]);}_0x135153[_0xa750('0x3d')]=qs[_0xa750('0x3e')](_0x5a7708[_0xa750('0x37')][_0xa750('0x3e')]);_0x135153['where']=qs['filters'](_[_0xa750('0x3f')](_0x5a7708[_0xa750('0x37')],_0x447376['filters']),_0x482fb4);if(_0x5a7708[_0xa750('0x37')][_0xa750('0x40')]){_0x135153[_0xa750('0x41')]=_['merge'](_0x135153[_0xa750('0x41')],{'$or':_[_0xa750('0x36')](_0x482fb4,function(_0x1c53e2){if(_0x1c53e2['type']!=='VIRTUAL'){var _0x918c06={};_0x918c06[_0x1c53e2[_0xa750('0x2f')]]={'$like':'%'+_0x5a7708[_0xa750('0x37')][_0xa750('0x40')]+'%'};return _0x918c06;}})});}_0x135153=_[_0xa750('0x42')]({},_0x135153,_0x5a7708['options']);var _0x429a50={'where':_0x135153[_0xa750('0x41')]};return db[_0xa750('0x31')][_0xa750('0x22')](_0x429a50)[_0xa750('0x2a')](function(_0x56aafd){_0xdbd8ca['count']=_0x56aafd;if(_0x5a7708['query'][_0xa750('0x43')]){_0x135153[_0xa750('0x44')]=[{'all':!![]}];}return db[_0xa750('0x31')][_0xa750('0x45')](_0x135153);})[_0xa750('0x2a')](function(_0x5e9832){_0xdbd8ca[_0xa750('0x46')]=_0x5e9832;return _0xdbd8ca;})[_0xa750('0x2a')](respondWithFilteredResult(_0x25c449,_0x135153))[_0xa750('0x47')](handleError(_0x25c449,null));};exports[_0xa750('0x48')]=function(_0x55c7e1,_0xb821ab){var _0x27a18c={'raw':![],'where':{'id':_0x55c7e1[_0xa750('0x49')]['id']}},_0x2b8f70={};_0x2b8f70[_0xa750('0x35')]=_['keys'](db[_0xa750('0x31')]['rawAttributes']);_0x2b8f70[_0xa750('0x37')]=_[_0xa750('0x38')](_0x55c7e1[_0xa750('0x37')]);_0x2b8f70[_0xa750('0x4a')]=_[_0xa750('0x39')](_0x2b8f70[_0xa750('0x35')],_0x2b8f70['query']);_0x27a18c[_0xa750('0x3a')]=_[_0xa750('0x39')](_0x2b8f70[_0xa750('0x35')],qs[_0xa750('0x3b')](_0x55c7e1[_0xa750('0x37')][_0xa750('0x3b')]));_0x27a18c[_0xa750('0x3a')]=_0x27a18c[_0xa750('0x3a')][_0xa750('0x4b')]?_0x27a18c[_0xa750('0x3a')]:_0x2b8f70[_0xa750('0x35')];if(_0x55c7e1[_0xa750('0x37')]['includeAll']){_0x27a18c['include']=[{'all':!![]}];}_0x27a18c=_[_0xa750('0x42')]({},_0x27a18c,_0x55c7e1[_0xa750('0x4c')]);return db[_0xa750('0x31')][_0xa750('0x4d')](_0x27a18c)[_0xa750('0x2a')](handleEntityNotFound(_0xb821ab,null))[_0xa750('0x2a')](respondWithResult(_0xb821ab,null))[_0xa750('0x47')](handleError(_0xb821ab,null));};exports[_0xa750('0x4e')]=function(_0x4aae68,_0x338475){return db[_0xa750('0x31')][_0xa750('0x4e')](_0x4aae68['body'],{})['then'](respondWithResult(_0x338475,0xc9))[_0xa750('0x47')](handleError(_0x338475,null));};exports[_0xa750('0x29')]=function(_0x4f45a8,_0x4637f7){if(_0x4f45a8['body']['id']){delete _0x4f45a8[_0xa750('0x4f')]['id'];}return db[_0xa750('0x31')][_0xa750('0x4d')]({'where':{'id':_0x4f45a8[_0xa750('0x49')]['id']}})[_0xa750('0x2a')](handleEntityNotFound(_0x4637f7,null))[_0xa750('0x2a')](saveUpdates(_0x4f45a8[_0xa750('0x4f')],null))['then'](respondWithResult(_0x4637f7,null))['catch'](handleError(_0x4637f7,null));};exports[_0xa750('0x2b')]=function(_0x1d5a12,_0xfba583){return db[_0xa750('0x31')]['find']({'where':{'id':_0x1d5a12[_0xa750('0x49')]['id']}})[_0xa750('0x2a')](handleEntityNotFound(_0xfba583,null))['then'](removeEntity(_0xfba583,null))['catch'](handleError(_0xfba583,null));};exports[_0xa750('0x50')]=function(_0x2663a1,_0x46e254,_0x3aaa30){var _0x86eaa={};var _0x373255={};var _0x532f22;var _0x12469b;return db[_0xa750('0x31')]['findOne']({'where':{'id':_0x2663a1[_0xa750('0x49')]['id']}})[_0xa750('0x2a')](handleEntityNotFound(_0x46e254,null))['then'](function(_0x45cbaf){if(_0x45cbaf){_0x532f22=_0x45cbaf;_0x373255[_0xa750('0x35')]=_[_0xa750('0x38')](db[_0xa750('0x51')][_0xa750('0x32')]);_0x373255['query']=_[_0xa750('0x38')](_0x2663a1[_0xa750('0x37')]);_0x373255[_0xa750('0x4a')]=_['intersection'](_0x373255[_0xa750('0x35')],_0x373255[_0xa750('0x37')]);_0x86eaa[_0xa750('0x3a')]=_[_0xa750('0x39')](_0x373255[_0xa750('0x35')],qs[_0xa750('0x3b')](_0x2663a1[_0xa750('0x37')][_0xa750('0x3b')]));_0x86eaa['attributes']=_0x86eaa['attributes'][_0xa750('0x4b')]?_0x86eaa[_0xa750('0x3a')]:_0x373255[_0xa750('0x35')];_0x86eaa[_0xa750('0x3d')]=qs[_0xa750('0x3e')](_0x2663a1[_0xa750('0x37')]['sort']);_0x86eaa['where']=qs[_0xa750('0x4a')](_[_0xa750('0x3f')](_0x2663a1[_0xa750('0x37')],_0x373255['filters']));if(_0x2663a1[_0xa750('0x37')][_0xa750('0x40')]){_0x86eaa[_0xa750('0x41')]=_[_0xa750('0x42')](_0x86eaa[_0xa750('0x41')],{'$or':_[_0xa750('0x36')](_0x86eaa['attributes'],function(_0x31c53c){var _0x29a95c={};_0x29a95c[_0x31c53c]={'$like':'%'+_0x2663a1[_0xa750('0x37')]['filter']+'%'};return _0x29a95c;})});}_0x86eaa=_[_0xa750('0x42')]({},_0x86eaa,_0x2663a1[_0xa750('0x4c')]);return _0x532f22[_0xa750('0x50')](_0x86eaa);}})['then'](function(_0x122dc8){if(_0x122dc8){_0x12469b=_0x122dc8['length'];if(!_0x2663a1[_0xa750('0x37')]['hasOwnProperty']('nolimit')){_0x86eaa[_0xa750('0x23')]=qs[_0xa750('0x23')](_0x2663a1['query'][_0xa750('0x23')]);_0x86eaa['offset']=qs['offset'](_0x2663a1['query'][_0xa750('0x20')]);}return _0x532f22['getFields'](_0x86eaa);}})['then'](function(_0x3a11d9){if(_0x3a11d9){return _0x3a11d9?{'count':_0x12469b,'rows':_0x3a11d9}:null;}})[_0xa750('0x2a')](respondWithResult(_0x46e254,null))[_0xa750('0x47')](handleError(_0x46e254,null));};exports[_0xa750('0x52')]=function(_0x195cf9,_0x29b871,_0x8000c1){var _0x5080e0={};var _0x3eaae2={};var _0x4dd48c;var _0x58d11b;return db[_0xa750('0x31')]['findOne']({'where':{'id':_0x195cf9[_0xa750('0x49')]['id']}})[_0xa750('0x2a')](handleEntityNotFound(_0x29b871,null))[_0xa750('0x2a')](function(_0x78ffc2){if(_0x78ffc2){_0x4dd48c=_0x78ffc2;_0x3eaae2['model']=_[_0xa750('0x38')](db[_0xa750('0x51')][_0xa750('0x32')]);_0x3eaae2['query']=_[_0xa750('0x38')](_0x195cf9['query']);_0x3eaae2['filters']=_[_0xa750('0x39')](_0x3eaae2[_0xa750('0x35')],_0x3eaae2['query']);_0x5080e0[_0xa750('0x3a')]=_[_0xa750('0x39')](_0x3eaae2[_0xa750('0x35')],qs[_0xa750('0x3b')](_0x195cf9[_0xa750('0x37')]['fields']));_0x5080e0[_0xa750('0x3a')]=_0x5080e0['attributes'][_0xa750('0x4b')]?_0x5080e0[_0xa750('0x3a')]:_0x3eaae2[_0xa750('0x35')];_0x5080e0[_0xa750('0x3d')]=qs['sort'](_0x195cf9[_0xa750('0x37')][_0xa750('0x3e')]);_0x5080e0[_0xa750('0x41')]=qs['filters'](_[_0xa750('0x3f')](_0x195cf9[_0xa750('0x37')],_0x3eaae2[_0xa750('0x4a')]));if(_0x195cf9['query'][_0xa750('0x40')]){_0x5080e0[_0xa750('0x41')]=_[_0xa750('0x42')](_0x5080e0['where'],{'$or':_[_0xa750('0x36')](_0x5080e0[_0xa750('0x3a')],function(_0x3ad08c){var _0x5ddeb2={};_0x5ddeb2[_0x3ad08c]={'$like':'%'+_0x195cf9['query']['filter']+'%'};return _0x5ddeb2;})});}_0x5080e0=_['merge']({},_0x5080e0,_0x195cf9['options']);return _0x4dd48c[_0xa750('0x52')](_0x5080e0);}})[_0xa750('0x2a')](function(_0x6ba70){if(_0x6ba70){_0x58d11b=_0x6ba70[_0xa750('0x4b')];if(!_0x195cf9[_0xa750('0x37')]['hasOwnProperty'](_0xa750('0x3c'))){_0x5080e0[_0xa750('0x23')]=qs[_0xa750('0x23')](_0x195cf9[_0xa750('0x37')][_0xa750('0x23')]);_0x5080e0[_0xa750('0x20')]=qs[_0xa750('0x20')](_0x195cf9[_0xa750('0x37')][_0xa750('0x20')]);}return _0x4dd48c[_0xa750('0x52')](_0x5080e0);}})[_0xa750('0x2a')](function(_0x315109){if(_0x315109){return _0x315109?{'count':_0x58d11b,'rows':_0x315109}:null;}})[_0xa750('0x2a')](respondWithResult(_0x29b871,null))[_0xa750('0x47')](handleError(_0x29b871,null));};exports[_0xa750('0x53')]=function(_0x33d5e3,_0x40c558,_0x5628af){var _0x4be4f5={};var _0x2b648f={};var _0x57e86c;var _0x1e6e1c;return db[_0xa750('0x31')][_0xa750('0x54')]({'where':{'id':_0x33d5e3[_0xa750('0x49')]['id']}})[_0xa750('0x2a')](handleEntityNotFound(_0x40c558,null))[_0xa750('0x2a')](function(_0x5b762e){if(_0x5b762e){_0x57e86c=_0x5b762e;_0x2b648f[_0xa750('0x35')]=_[_0xa750('0x38')](db['ServicenowField']['rawAttributes']);_0x2b648f[_0xa750('0x37')]=_[_0xa750('0x38')](_0x33d5e3[_0xa750('0x37')]);_0x2b648f[_0xa750('0x4a')]=_[_0xa750('0x39')](_0x2b648f[_0xa750('0x35')],_0x2b648f[_0xa750('0x37')]);_0x4be4f5[_0xa750('0x3a')]=_[_0xa750('0x39')](_0x2b648f['model'],qs[_0xa750('0x3b')](_0x33d5e3[_0xa750('0x37')][_0xa750('0x3b')]));_0x4be4f5[_0xa750('0x3a')]=_0x4be4f5[_0xa750('0x3a')]['length']?_0x4be4f5[_0xa750('0x3a')]:_0x2b648f[_0xa750('0x35')];_0x4be4f5[_0xa750('0x3d')]=qs[_0xa750('0x3e')](_0x33d5e3[_0xa750('0x37')][_0xa750('0x3e')]);_0x4be4f5[_0xa750('0x41')]=qs[_0xa750('0x4a')](_['pick'](_0x33d5e3[_0xa750('0x37')],_0x2b648f[_0xa750('0x4a')]));if(_0x33d5e3[_0xa750('0x37')][_0xa750('0x40')]){_0x4be4f5['where']=_[_0xa750('0x42')](_0x4be4f5[_0xa750('0x41')],{'$or':_[_0xa750('0x36')](_0x4be4f5['attributes'],function(_0x4c8cbe){var _0x56e216={};_0x56e216[_0x4c8cbe]={'$like':'%'+_0x33d5e3['query'][_0xa750('0x40')]+'%'};return _0x56e216;})});}_0x4be4f5=_[_0xa750('0x42')]({},_0x4be4f5,_0x33d5e3[_0xa750('0x4c')]);return _0x57e86c[_0xa750('0x53')](_0x4be4f5);}})['then'](function(_0x532490){if(_0x532490){_0x1e6e1c=_0x532490[_0xa750('0x4b')];if(!_0x33d5e3[_0xa750('0x37')][_0xa750('0x55')]('nolimit')){_0x4be4f5['limit']=qs[_0xa750('0x23')](_0x33d5e3['query'][_0xa750('0x23')]);_0x4be4f5[_0xa750('0x20')]=qs[_0xa750('0x20')](_0x33d5e3['query'][_0xa750('0x20')]);}return _0x57e86c[_0xa750('0x53')](_0x4be4f5);}})[_0xa750('0x2a')](function(_0x3e125e){if(_0x3e125e){return _0x3e125e?{'count':_0x1e6e1c,'rows':_0x3e125e}:null;}})[_0xa750('0x2a')](respondWithResult(_0x40c558,null))[_0xa750('0x47')](handleError(_0x40c558,null));}; \ No newline at end of file +var _0x1a19=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','destroy','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1a19,0xf4));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x91a1('0x0'));var rimraf=require(_0x91a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91a1('0x2'));var rp=require(_0x91a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x91a1('0x4'));var ejs=require(_0x91a1('0x5'));var fs=require('fs');var fs_extra=require(_0x91a1('0x6'));var _=require(_0x91a1('0x7'));var squel=require(_0x91a1('0x8'));var crypto=require(_0x91a1('0x9'));var jsforce=require(_0x91a1('0xa'));var deskjs=require(_0x91a1('0xb'));var toCsv=require(_0x91a1('0x4'));var querystring=require(_0x91a1('0xc'));var Papa=require(_0x91a1('0xd'));var Redis=require(_0x91a1('0xe'));var authService=require(_0x91a1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91a1('0x10'));var logger=require(_0x91a1('0x11'))(_0x91a1('0x12'));var utils=require(_0x91a1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1cb9,_0x1ab19f){_0x1ab19f=_0x1ab19f||0xcc;return function(_0x3203c0){if(_0x3203c0){return _0x4b1cb9[_0x91a1('0x14')](_0x1ab19f);}return _0x4b1cb9[_0x91a1('0x15')](_0x1ab19f)[_0x91a1('0x16')]();};}function respondWithResult(_0x3699d0,_0x2ef964){_0x2ef964=_0x2ef964||0xc8;return function(_0x2d8b96){if(_0x2d8b96){return _0x3699d0[_0x91a1('0x15')](_0x2ef964)[_0x91a1('0x17')](_0x2d8b96);}};}function respondWithFilteredResult(_0x1a1e8f,_0xf228d4){return function(_0x386604){if(_0x386604){var _0x4ecb67=typeof _0xf228d4['offset']==='undefined'&&typeof _0xf228d4[_0x91a1('0x18')]===_0x91a1('0x19');var _0x48dd7e=_0x386604[_0x91a1('0x1a')];var _0x11d294=_0x4ecb67?0x0:_0xf228d4[_0x91a1('0x1b')];var _0x4b4c6a=_0x4ecb67?_0x386604['count']:_0xf228d4[_0x91a1('0x1b')]+_0xf228d4[_0x91a1('0x18')];var _0x990c54;if(_0x4b4c6a>=_0x48dd7e){_0x4b4c6a=_0x48dd7e;_0x990c54=0xc8;}else{_0x990c54=0xce;}_0x1a1e8f[_0x91a1('0x15')](_0x990c54);return _0x1a1e8f[_0x91a1('0x1c')](_0x91a1('0x1d'),_0x11d294+'-'+_0x4b4c6a+'/'+_0x48dd7e)[_0x91a1('0x17')](_0x386604);}return null;};}function patchUpdates(_0xf32e72){return function(_0x536412){try{jsonpatch['apply'](_0x536412,_0xf32e72,!![]);}catch(_0x4f173f){return BPromise[_0x91a1('0x1e')](_0x4f173f);}return _0x536412[_0x91a1('0x1f')]();};}function saveUpdates(_0x37acbe,_0x58986e){return function(_0x50e83a){if(_0x50e83a){return _0x50e83a['update'](_0x37acbe)['then'](function(_0x3e7d29){return _0x3e7d29;});}return null;};}function removeEntity(_0x1ac24c,_0xa0e6a4){return function(_0x321067){if(_0x321067){return _0x321067['destroy']()[_0x91a1('0x20')](function(){_0x1ac24c['status'](0xcc)[_0x91a1('0x16')]();});}};}function handleEntityNotFound(_0xc7b3a,_0x3c7e16){return function(_0x2b15fa){if(!_0x2b15fa){_0xc7b3a[_0x91a1('0x14')](0x194);}return _0x2b15fa;};}function handleError(_0x193234,_0x102096){_0x102096=_0x102096||0x1f4;return function(_0x13669f){logger['error'](_0x13669f['stack']);if(_0x13669f['name']){delete _0x13669f[_0x91a1('0x21')];}_0x193234[_0x91a1('0x15')](_0x102096)[_0x91a1('0x22')](_0x13669f);};}exports[_0x91a1('0x23')]=function(_0x48d21b,_0x5268f0){var _0x1e194d={},_0x5b2c25={},_0x13acd2={'count':0x0,'rows':[]};var _0x31778b=_[_0x91a1('0x24')](db[_0x91a1('0x25')][_0x91a1('0x26')],function(_0x591d63){return{'name':_0x591d63[_0x91a1('0x27')],'type':_0x591d63[_0x91a1('0x28')]['key']};});_0x5b2c25[_0x91a1('0x29')]=_[_0x91a1('0x24')](_0x31778b,_0x91a1('0x21'));_0x5b2c25[_0x91a1('0x2a')]=_['keys'](_0x48d21b['query']);_0x5b2c25[_0x91a1('0x2b')]=_['intersection'](_0x5b2c25['model'],_0x5b2c25[_0x91a1('0x2a')]);_0x1e194d[_0x91a1('0x2c')]=_['intersection'](_0x5b2c25[_0x91a1('0x29')],qs[_0x91a1('0x2d')](_0x48d21b['query'][_0x91a1('0x2d')]));_0x1e194d[_0x91a1('0x2c')]=_0x1e194d[_0x91a1('0x2c')][_0x91a1('0x2e')]?_0x1e194d[_0x91a1('0x2c')]:_0x5b2c25[_0x91a1('0x29')];if(!_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x2f')](_0x91a1('0x30'))){_0x1e194d[_0x91a1('0x18')]=qs[_0x91a1('0x18')](_0x48d21b['query'][_0x91a1('0x18')]);_0x1e194d[_0x91a1('0x1b')]=qs['offset'](_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x1b')]);}_0x1e194d[_0x91a1('0x31')]=qs['sort'](_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x32')]);_0x1e194d[_0x91a1('0x33')]=qs['filters'](_['pick'](_0x48d21b['query'],_0x5b2c25[_0x91a1('0x2b')]),_0x31778b);if(_0x48d21b['query'][_0x91a1('0x34')]){_0x1e194d['where']=_[_0x91a1('0x35')](_0x1e194d[_0x91a1('0x33')],{'$or':_[_0x91a1('0x24')](_0x31778b,function(_0xb344a6){if(_0xb344a6['type']!==_0x91a1('0x36')){var _0x4de763={};_0x4de763[_0xb344a6[_0x91a1('0x21')]]={'$like':'%'+_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x34')]+'%'};return _0x4de763;}})});}_0x1e194d=_[_0x91a1('0x35')]({},_0x1e194d,_0x48d21b[_0x91a1('0x37')]);var _0x28b6ab={'where':_0x1e194d[_0x91a1('0x33')]};return db[_0x91a1('0x25')][_0x91a1('0x1a')](_0x28b6ab)['then'](function(_0x505691){_0x13acd2[_0x91a1('0x1a')]=_0x505691;if(_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x38')]){_0x1e194d[_0x91a1('0x39')]=[{'all':!![]}];}return db[_0x91a1('0x25')][_0x91a1('0x3a')](_0x1e194d);})[_0x91a1('0x20')](function(_0x3a4381){_0x13acd2[_0x91a1('0x3b')]=_0x3a4381;return _0x13acd2;})[_0x91a1('0x20')](respondWithFilteredResult(_0x5268f0,_0x1e194d))[_0x91a1('0x3c')](handleError(_0x5268f0,null));};exports[_0x91a1('0x3d')]=function(_0x562b89,_0x48e53b){var _0x3fa231={'raw':![],'where':{'id':_0x562b89[_0x91a1('0x3e')]['id']}},_0x2ff80b={};_0x2ff80b[_0x91a1('0x29')]=_[_0x91a1('0x3f')](db[_0x91a1('0x25')]['rawAttributes']);_0x2ff80b['query']=_[_0x91a1('0x3f')](_0x562b89['query']);_0x2ff80b[_0x91a1('0x2b')]=_['intersection'](_0x2ff80b['model'],_0x2ff80b[_0x91a1('0x2a')]);_0x3fa231[_0x91a1('0x2c')]=_[_0x91a1('0x40')](_0x2ff80b[_0x91a1('0x29')],qs['fields'](_0x562b89[_0x91a1('0x2a')][_0x91a1('0x2d')]));_0x3fa231[_0x91a1('0x2c')]=_0x3fa231['attributes'][_0x91a1('0x2e')]?_0x3fa231['attributes']:_0x2ff80b[_0x91a1('0x29')];if(_0x562b89['query'][_0x91a1('0x38')]){_0x3fa231[_0x91a1('0x39')]=[{'all':!![]}];}_0x3fa231=_[_0x91a1('0x35')]({},_0x3fa231,_0x562b89[_0x91a1('0x37')]);return db[_0x91a1('0x25')][_0x91a1('0x41')](_0x3fa231)['then'](handleEntityNotFound(_0x48e53b,null))['then'](respondWithResult(_0x48e53b,null))[_0x91a1('0x3c')](handleError(_0x48e53b,null));};exports[_0x91a1('0x42')]=function(_0x5b4f56,_0x44b578){return db['ServicenowConfiguration'][_0x91a1('0x42')](_0x5b4f56[_0x91a1('0x43')],{})['then'](respondWithResult(_0x44b578,0xc9))['catch'](handleError(_0x44b578,null));};exports['update']=function(_0x1c849f,_0x11885c){if(_0x1c849f[_0x91a1('0x43')]['id']){delete _0x1c849f['body']['id'];}return db[_0x91a1('0x25')][_0x91a1('0x41')]({'where':{'id':_0x1c849f[_0x91a1('0x3e')]['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x11885c,null))[_0x91a1('0x20')](saveUpdates(_0x1c849f[_0x91a1('0x43')],null))['then'](respondWithResult(_0x11885c,null))[_0x91a1('0x3c')](handleError(_0x11885c,null));};exports[_0x91a1('0x44')]=function(_0x1575f3,_0x5a7818){return db[_0x91a1('0x25')][_0x91a1('0x41')]({'where':{'id':_0x1575f3['params']['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x5a7818,null))[_0x91a1('0x20')](removeEntity(_0x5a7818,null))[_0x91a1('0x3c')](handleError(_0x5a7818,null));};exports[_0x91a1('0x45')]=function(_0x2af1f8,_0x351af1,_0x3a7255){var _0xbe6753={};var _0x334c75={};var _0x48ad7f;var _0x3bc64c;return db[_0x91a1('0x25')][_0x91a1('0x46')]({'where':{'id':_0x2af1f8['params']['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x351af1,null))['then'](function(_0x508097){if(_0x508097){_0x48ad7f=_0x508097;_0x334c75[_0x91a1('0x29')]=_[_0x91a1('0x3f')](db[_0x91a1('0x47')][_0x91a1('0x26')]);_0x334c75['query']=_[_0x91a1('0x3f')](_0x2af1f8['query']);_0x334c75[_0x91a1('0x2b')]=_[_0x91a1('0x40')](_0x334c75[_0x91a1('0x29')],_0x334c75['query']);_0xbe6753['attributes']=_[_0x91a1('0x40')](_0x334c75['model'],qs[_0x91a1('0x2d')](_0x2af1f8['query'][_0x91a1('0x2d')]));_0xbe6753[_0x91a1('0x2c')]=_0xbe6753[_0x91a1('0x2c')]['length']?_0xbe6753[_0x91a1('0x2c')]:_0x334c75[_0x91a1('0x29')];_0xbe6753[_0x91a1('0x31')]=qs[_0x91a1('0x32')](_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x32')]);_0xbe6753[_0x91a1('0x33')]=qs['filters'](_['pick'](_0x2af1f8[_0x91a1('0x2a')],_0x334c75[_0x91a1('0x2b')]));if(_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x34')]){_0xbe6753[_0x91a1('0x33')]=_[_0x91a1('0x35')](_0xbe6753[_0x91a1('0x33')],{'$or':_['map'](_0xbe6753[_0x91a1('0x2c')],function(_0x2b198c){var _0x1ce397={};_0x1ce397[_0x2b198c]={'$like':'%'+_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x34')]+'%'};return _0x1ce397;})});}_0xbe6753=_[_0x91a1('0x35')]({},_0xbe6753,_0x2af1f8[_0x91a1('0x37')]);return _0x48ad7f[_0x91a1('0x45')](_0xbe6753);}})['then'](function(_0x56fcc0){if(_0x56fcc0){_0x3bc64c=_0x56fcc0[_0x91a1('0x2e')];if(!_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x2f')](_0x91a1('0x30'))){_0xbe6753[_0x91a1('0x18')]=qs[_0x91a1('0x18')](_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x18')]);_0xbe6753[_0x91a1('0x1b')]=qs[_0x91a1('0x1b')](_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x1b')]);}return _0x48ad7f[_0x91a1('0x45')](_0xbe6753);}})[_0x91a1('0x20')](function(_0x124bcd){if(_0x124bcd){return _0x124bcd?{'count':_0x3bc64c,'rows':_0x124bcd}:null;}})[_0x91a1('0x20')](respondWithResult(_0x351af1,null))[_0x91a1('0x3c')](handleError(_0x351af1,null));};exports['getSubjects']=function(_0x121ff9,_0x4d71fc,_0x4416a1){var _0xb4310a={};var _0x254916={};var _0x4ad9e7;var _0x26214c;return db[_0x91a1('0x25')][_0x91a1('0x46')]({'where':{'id':_0x121ff9[_0x91a1('0x3e')]['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x4d71fc,null))[_0x91a1('0x20')](function(_0x46a53f){if(_0x46a53f){_0x4ad9e7=_0x46a53f;_0x254916[_0x91a1('0x29')]=_[_0x91a1('0x3f')](db['ServicenowField'][_0x91a1('0x26')]);_0x254916[_0x91a1('0x2a')]=_[_0x91a1('0x3f')](_0x121ff9[_0x91a1('0x2a')]);_0x254916[_0x91a1('0x2b')]=_[_0x91a1('0x40')](_0x254916[_0x91a1('0x29')],_0x254916[_0x91a1('0x2a')]);_0xb4310a[_0x91a1('0x2c')]=_[_0x91a1('0x40')](_0x254916['model'],qs[_0x91a1('0x2d')](_0x121ff9[_0x91a1('0x2a')]['fields']));_0xb4310a[_0x91a1('0x2c')]=_0xb4310a[_0x91a1('0x2c')][_0x91a1('0x2e')]?_0xb4310a[_0x91a1('0x2c')]:_0x254916['model'];_0xb4310a[_0x91a1('0x31')]=qs[_0x91a1('0x32')](_0x121ff9[_0x91a1('0x2a')][_0x91a1('0x32')]);_0xb4310a[_0x91a1('0x33')]=qs[_0x91a1('0x2b')](_[_0x91a1('0x48')](_0x121ff9['query'],_0x254916[_0x91a1('0x2b')]));if(_0x121ff9[_0x91a1('0x2a')]['filter']){_0xb4310a[_0x91a1('0x33')]=_[_0x91a1('0x35')](_0xb4310a[_0x91a1('0x33')],{'$or':_['map'](_0xb4310a[_0x91a1('0x2c')],function(_0x41f8fd){var _0x3b7788={};_0x3b7788[_0x41f8fd]={'$like':'%'+_0x121ff9[_0x91a1('0x2a')][_0x91a1('0x34')]+'%'};return _0x3b7788;})});}_0xb4310a=_[_0x91a1('0x35')]({},_0xb4310a,_0x121ff9[_0x91a1('0x37')]);return _0x4ad9e7[_0x91a1('0x49')](_0xb4310a);}})['then'](function(_0xe368e9){if(_0xe368e9){_0x26214c=_0xe368e9[_0x91a1('0x2e')];if(!_0x121ff9['query'][_0x91a1('0x2f')](_0x91a1('0x30'))){_0xb4310a['limit']=qs['limit'](_0x121ff9[_0x91a1('0x2a')][_0x91a1('0x18')]);_0xb4310a['offset']=qs[_0x91a1('0x1b')](_0x121ff9['query'][_0x91a1('0x1b')]);}return _0x4ad9e7[_0x91a1('0x49')](_0xb4310a);}})[_0x91a1('0x20')](function(_0x4d6626){if(_0x4d6626){return _0x4d6626?{'count':_0x26214c,'rows':_0x4d6626}:null;}})[_0x91a1('0x20')](respondWithResult(_0x4d71fc,null))[_0x91a1('0x3c')](handleError(_0x4d71fc,null));};exports[_0x91a1('0x4a')]=function(_0x36a529,_0x556bfb,_0x357508){var _0x1a37f9={};var _0x248633={};var _0x25678d;var _0x13e74c;return db[_0x91a1('0x25')][_0x91a1('0x46')]({'where':{'id':_0x36a529['params']['id']}})['then'](handleEntityNotFound(_0x556bfb,null))[_0x91a1('0x20')](function(_0x15a412){if(_0x15a412){_0x25678d=_0x15a412;_0x248633['model']=_[_0x91a1('0x3f')](db['ServicenowField'][_0x91a1('0x26')]);_0x248633[_0x91a1('0x2a')]=_[_0x91a1('0x3f')](_0x36a529[_0x91a1('0x2a')]);_0x248633['filters']=_['intersection'](_0x248633[_0x91a1('0x29')],_0x248633[_0x91a1('0x2a')]);_0x1a37f9['attributes']=_[_0x91a1('0x40')](_0x248633['model'],qs[_0x91a1('0x2d')](_0x36a529[_0x91a1('0x2a')]['fields']));_0x1a37f9['attributes']=_0x1a37f9[_0x91a1('0x2c')][_0x91a1('0x2e')]?_0x1a37f9[_0x91a1('0x2c')]:_0x248633[_0x91a1('0x29')];_0x1a37f9['order']=qs['sort'](_0x36a529[_0x91a1('0x2a')]['sort']);_0x1a37f9[_0x91a1('0x33')]=qs[_0x91a1('0x2b')](_[_0x91a1('0x48')](_0x36a529[_0x91a1('0x2a')],_0x248633['filters']));if(_0x36a529[_0x91a1('0x2a')][_0x91a1('0x34')]){_0x1a37f9[_0x91a1('0x33')]=_[_0x91a1('0x35')](_0x1a37f9['where'],{'$or':_[_0x91a1('0x24')](_0x1a37f9[_0x91a1('0x2c')],function(_0x167d5e){var _0x47c51e={};_0x47c51e[_0x167d5e]={'$like':'%'+_0x36a529['query'][_0x91a1('0x34')]+'%'};return _0x47c51e;})});}_0x1a37f9=_[_0x91a1('0x35')]({},_0x1a37f9,_0x36a529[_0x91a1('0x37')]);return _0x25678d['getDescriptions'](_0x1a37f9);}})[_0x91a1('0x20')](function(_0x3f0c8a){if(_0x3f0c8a){_0x13e74c=_0x3f0c8a[_0x91a1('0x2e')];if(!_0x36a529[_0x91a1('0x2a')][_0x91a1('0x2f')](_0x91a1('0x30'))){_0x1a37f9[_0x91a1('0x18')]=qs[_0x91a1('0x18')](_0x36a529[_0x91a1('0x2a')]['limit']);_0x1a37f9['offset']=qs[_0x91a1('0x1b')](_0x36a529[_0x91a1('0x2a')][_0x91a1('0x1b')]);}return _0x25678d[_0x91a1('0x4a')](_0x1a37f9);}})['then'](function(_0x577349){if(_0x577349){return _0x577349?{'count':_0x13e74c,'rows':_0x577349}:null;}})[_0x91a1('0x20')](respondWithResult(_0x556bfb,null))[_0x91a1('0x3c')](handleError(_0x556bfb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 84f3cc6..594eba9 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51c5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x3c1d4a,_0x64ed3b){var _0x3b1c3c=function(_0x3a4767){while(--_0x3a4767){_0x3c1d4a['push'](_0x3c1d4a['shift']());}};_0x3b1c3c(++_0x64ed3b);}(_0x51c5,0x8f));var _0x551c=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x51c5[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var logger=require(_0x551c('0x2'))(_0x551c('0x3'));var moment=require(_0x551c('0x4'));var BPromise=require(_0x551c('0x5'));var rp=require(_0x551c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x551c('0x7'));var config=require(_0x551c('0x8'));var attributes=require(_0x551c('0x9'));module[_0x551c('0xa')]=function(_0xe0272c,_0x1aa8df){return _0xe0272c[_0x551c('0xb')](_0x551c('0xc'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf66=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x540a78,_0x2d44e0){var _0x4793b9=function(_0x44234c){while(--_0x44234c){_0x540a78['push'](_0x540a78['shift']());}};_0x4793b9(++_0x2d44e0);}(_0xcf66,0x71));var _0x6cf6=function(_0x4f10b1,_0x579118){_0x4f10b1=_0x4f10b1-0x0;var _0x142a5e=_0xcf66[_0x4f10b1];return _0x142a5e;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var logger=require(_0x6cf6('0x2'))('api');var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x6cf6('0x7')]=function(_0x1fbedd,_0x2a573e){return _0x1fbedd['define'](_0x6cf6('0x8'),attributes,{'tableName':_0x6cf6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 3285ee4..de19115 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a62=['message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x449baa,_0x27b696){var _0x3d7043=function(_0x5e7449){while(--_0x5e7449){_0x449baa['push'](_0x449baa['shift']());}};_0x3d7043(++_0x27b696);}(_0x8a62,0x18f));var _0x28a6=function(_0x3a228e,_0x3b4898){_0x3a228e=_0x3a228e-0x0;var _0x294c40=_0x8a62[_0x3a228e];return _0x294c40;};'use strict';var _=require(_0x28a6('0x0'));var util=require('util');var moment=require(_0x28a6('0x1'));var BPromise=require(_0x28a6('0x2'));var rs=require(_0x28a6('0x3'));var fs=require('fs');var Redis=require(_0x28a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28a6('0x5'));var logger=require(_0x28a6('0x6'))(_0x28a6('0x7'));var config=require(_0x28a6('0x8'));var jayson=require(_0x28a6('0x9'));var client=jayson[_0x28a6('0xa')][_0x28a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x97d860,_0x5ae651,_0x38bbb0){return new BPromise(function(_0x1e8c79,_0x2bef20){return client['request'](_0x97d860,_0x38bbb0)[_0x28a6('0xc')](function(_0x5accd2){logger[_0x28a6('0xd')](_0x28a6('0xe'),_0x5ae651,'request\x20sent');logger['debug'](_0x28a6('0xf'),_0x5ae651,'request\x20sent',JSON[_0x28a6('0x10')](_0x5accd2));if(_0x5accd2['error']){if(_0x5accd2[_0x28a6('0x11')][_0x28a6('0x12')]===0x1f4){logger['error'](_0x28a6('0xe'),_0x5ae651,_0x5accd2[_0x28a6('0x11')][_0x28a6('0x13')]);return _0x2bef20(_0x5accd2[_0x28a6('0x11')]['message']);}logger[_0x28a6('0x11')](_0x28a6('0xe'),_0x5ae651,_0x5accd2['error']['message']);return _0x1e8c79(_0x5accd2[_0x28a6('0x11')][_0x28a6('0x13')]);}else{logger[_0x28a6('0xd')](_0x28a6('0xe'),_0x5ae651,_0x28a6('0x14'));_0x1e8c79(_0x5accd2['result'][_0x28a6('0x13')]);}})[_0x28a6('0x15')](function(_0x2cc484){logger[_0x28a6('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5ae651,_0x2cc484);_0x2bef20(_0x2cc484);});});} \ No newline at end of file +var _0x496e=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment'];(function(_0x3f2870,_0x458e97){var _0x112ce4=function(_0x35e831){while(--_0x35e831){_0x3f2870['push'](_0x3f2870['shift']());}};_0x112ce4(++_0x458e97);}(_0x496e,0x1a0));var _0xe496=function(_0x3e20e3,_0x333575){_0x3e20e3=_0x3e20e3-0x0;var _0x2eb98c=_0x496e[_0x3e20e3];return _0x2eb98c;};'use strict';var _=require('lodash');var util=require(_0xe496('0x0'));var moment=require(_0xe496('0x1'));var BPromise=require(_0xe496('0x2'));var rs=require(_0xe496('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe496('0x4'))('rpc');var config=require(_0xe496('0x5'));var jayson=require(_0xe496('0x6'));var client=jayson[_0xe496('0x7')][_0xe496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ba6bf,_0x22d4ad,_0x19970b){return new BPromise(function(_0x42b1b6,_0x43cedd){return client[_0xe496('0x9')](_0x2ba6bf,_0x19970b)[_0xe496('0xa')](function(_0x519f3a){logger['info'](_0xe496('0xb'),_0x22d4ad,'request\x20sent');logger[_0xe496('0xc')](_0xe496('0xd'),_0x22d4ad,_0xe496('0xe'),JSON[_0xe496('0xf')](_0x519f3a));if(_0x519f3a[_0xe496('0x10')]){if(_0x519f3a[_0xe496('0x10')]['code']===0x1f4){logger['error'](_0xe496('0xb'),_0x22d4ad,_0x519f3a[_0xe496('0x10')]['message']);return _0x43cedd(_0x519f3a[_0xe496('0x10')][_0xe496('0x11')]);}logger[_0xe496('0x10')](_0xe496('0xb'),_0x22d4ad,_0x519f3a['error'][_0xe496('0x11')]);return _0x42b1b6(_0x519f3a['error'][_0xe496('0x11')]);}else{logger['info'](_0xe496('0xb'),_0x22d4ad,_0xe496('0xe'));_0x42b1b6(_0x519f3a[_0xe496('0x12')][_0xe496('0x11')]);}})['catch'](function(_0x2acc36){logger[_0xe496('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x22d4ad,_0x2acc36);_0x43cedd(_0x2acc36);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4649565..6e8a314 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfade=['../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfade,0xf0));var _0xefad=function(_0x4a6489,_0x2eff77){_0x4a6489=_0x4a6489-0x0;var _0x2d54b8=_0xfade[_0x4a6489];return _0x2d54b8;};'use strict';var multer=require(_0xefad('0x0'));var util=require(_0xefad('0x1'));var path=require(_0xefad('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xefad('0x3')]();var fs_extra=require(_0xefad('0x4'));var auth=require(_0xefad('0x5'));var interaction=require(_0xefad('0x6'));var config=require(_0xefad('0x7'));var controller=require(_0xefad('0x8'));router[_0xefad('0x9')]('/',auth['isAuthenticated'](),controller[_0xefad('0xa')]);router['get'](_0xefad('0xb'),auth[_0xefad('0xc')](),controller['show']);router[_0xefad('0xd')]('/',auth[_0xefad('0xc')](),controller['create']);router[_0xefad('0xe')](_0xefad('0xb'),auth[_0xefad('0xc')](),controller[_0xefad('0xf')]);router[_0xefad('0x10')](_0xefad('0xb'),auth[_0xefad('0xc')](),controller[_0xefad('0x11')]);module[_0xefad('0x12')]=router; \ No newline at end of file +var _0x164b=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x1c68f5,_0x49fa9b){var _0x41edda=function(_0x373b6c){while(--_0x373b6c){_0x1c68f5['push'](_0x1c68f5['shift']());}};_0x41edda(++_0x49fa9b);}(_0x164b,0x101));var _0xb164=function(_0x117d20,_0x3ce068){_0x117d20=_0x117d20-0x0;var _0x2586f1=_0x164b[_0x117d20];return _0x2586f1;};'use strict';var multer=require(_0xb164('0x0'));var util=require(_0xb164('0x1'));var path=require(_0xb164('0x2'));var timeout=require(_0xb164('0x3'));var express=require(_0xb164('0x4'));var router=express[_0xb164('0x5')]();var fs_extra=require(_0xb164('0x6'));var auth=require(_0xb164('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb164('0x8'));var controller=require(_0xb164('0x9'));router[_0xb164('0xa')]('/',auth['isAuthenticated'](),controller[_0xb164('0xb')]);router[_0xb164('0xa')](_0xb164('0xc'),auth['isAuthenticated'](),controller[_0xb164('0xd')]);router[_0xb164('0xe')]('/',auth[_0xb164('0xf')](),controller[_0xb164('0x10')]);router[_0xb164('0x11')](_0xb164('0xc'),auth[_0xb164('0xf')](),controller[_0xb164('0x12')]);router['delete'](_0xb164('0xc'),auth['isAuthenticated'](),controller[_0xb164('0x13')]);module[_0xb164('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 794ddc7..c57e322 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5597=['picklist','STRING','ENUM','customVariable','sequelize','string','variable','keyValue'];(function(_0x176749,_0x3d05b6){var _0x49f8d8=function(_0x1ad1be){while(--_0x1ad1be){_0x176749['push'](_0x176749['shift']());}};_0x49f8d8(++_0x3d05b6);}(_0x5597,0x11c));var _0x7559=function(_0x155057,_0x42889a){_0x155057=_0x155057-0x0;var _0x244ec0=_0x5597[_0x155057];return _0x244ec0;};'use strict';var Sequelize=require(_0x7559('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7559('0x1'),_0x7559('0x2'),'customVariable',_0x7559('0x3'),_0x7559('0x4')),'defaultValue':_0x7559('0x1')},'content':{'type':Sequelize[_0x7559('0x5')]},'key':{'type':Sequelize[_0x7559('0x5')]},'keyType':{'type':Sequelize[_0x7559('0x6')](_0x7559('0x1'),_0x7559('0x2'),_0x7559('0x7'))},'keyContent':{'type':Sequelize[_0x7559('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7559('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7559('0x5')]}}; \ No newline at end of file +var _0xf3c3=['customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x1e1fe9,_0x216dd9){var _0x4eeb06=function(_0x3c69c2){while(--_0x3c69c2){_0x1e1fe9['push'](_0x1e1fe9['shift']());}};_0x4eeb06(++_0x216dd9);}(_0xf3c3,0xf9));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f3c('0x0'));module['exports']={'type':{'type':Sequelize[_0x3f3c('0x1')](_0x3f3c('0x2'),'variable',_0x3f3c('0x3'),'keyValue',_0x3f3c('0x4')),'defaultValue':_0x3f3c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3f3c('0x5')]},'keyType':{'type':Sequelize[_0x3f3c('0x1')](_0x3f3c('0x2'),'variable',_0x3f3c('0x3'))},'keyContent':{'type':Sequelize[_0x3f3c('0x5')]},'idField':{'type':Sequelize[_0x3f3c('0x5')]},'nameField':{'type':Sequelize[_0x3f3c('0x5')]},'customField':{'type':Sequelize[_0x3f3c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 975c01a..92377d7 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6608=['bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','map','ServicenowField','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6608,0x168));var _0x8660=function(_0x45a57e,_0x1ec3c0){_0x45a57e=_0x45a57e-0x0;var _0x33d76e=_0x6608[_0x45a57e];return _0x33d76e;};'use strict';var emlformat=require(_0x8660('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8660('0x1'));var jsonpatch=require(_0x8660('0x2'));var rp=require(_0x8660('0x3'));var moment=require(_0x8660('0x4'));var BPromise=require(_0x8660('0x5'));var Mustache=require(_0x8660('0x6'));var util=require(_0x8660('0x7'));var path=require(_0x8660('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8660('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8660('0xa'));var squel=require(_0x8660('0xb'));var crypto=require(_0x8660('0xc'));var jsforce=require(_0x8660('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8660('0xe'));var querystring=require(_0x8660('0xf'));var Papa=require(_0x8660('0x10'));var Redis=require(_0x8660('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8660('0x12'));var as=require(_0x8660('0x13'));var hardwareService=require(_0x8660('0x14'));var logger=require('../../config/logger')(_0x8660('0x15'));var utils=require('../../config/utils');var config=require(_0x8660('0x16'));var licenseUtil=require(_0x8660('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe14ebe,_0x49f23e){_0x49f23e=_0x49f23e||0xcc;return function(_0x3c6f3d){if(_0x3c6f3d){return _0xe14ebe[_0x8660('0x18')](_0x49f23e);}return _0xe14ebe[_0x8660('0x19')](_0x49f23e)[_0x8660('0x1a')]();};}function respondWithResult(_0x191c44,_0x27aa40){_0x27aa40=_0x27aa40||0xc8;return function(_0x4248fb){if(_0x4248fb){return _0x191c44[_0x8660('0x19')](_0x27aa40)[_0x8660('0x1b')](_0x4248fb);}};}function respondWithFilteredResult(_0x14cd3f,_0x13e71a){return function(_0x246228){if(_0x246228){var _0x2306d8=typeof _0x13e71a[_0x8660('0x1c')]===_0x8660('0x1d')&&typeof _0x13e71a[_0x8660('0x1e')]==='undefined';var _0x1a7476=_0x246228['count'];var _0x553818=_0x2306d8?0x0:_0x13e71a['offset'];var _0x14fb4b=_0x2306d8?_0x246228[_0x8660('0x1f')]:_0x13e71a[_0x8660('0x1c')]+_0x13e71a['limit'];var _0x15d10d;if(_0x14fb4b>=_0x1a7476){_0x14fb4b=_0x1a7476;_0x15d10d=0xc8;}else{_0x15d10d=0xce;}_0x14cd3f[_0x8660('0x19')](_0x15d10d);return _0x14cd3f['set']('Content-Range',_0x553818+'-'+_0x14fb4b+'/'+_0x1a7476)['json'](_0x246228);}return null;};}function patchUpdates(_0x55ce5e){return function(_0xb5be36){try{jsonpatch[_0x8660('0x20')](_0xb5be36,_0x55ce5e,!![]);}catch(_0x178a49){return BPromise[_0x8660('0x21')](_0x178a49);}return _0xb5be36[_0x8660('0x22')]();};}function saveUpdates(_0x5a1854,_0x2420d1){return function(_0x43eeb9){if(_0x43eeb9){return _0x43eeb9[_0x8660('0x23')](_0x5a1854)[_0x8660('0x24')](function(_0x51415e){return _0x51415e;});}return null;};}function removeEntity(_0x2c9bdf,_0x3af49a){return function(_0x1e99c2){if(_0x1e99c2){return _0x1e99c2[_0x8660('0x25')]()[_0x8660('0x24')](function(){_0x2c9bdf[_0x8660('0x19')](0xcc)[_0x8660('0x1a')]();});}};}function handleEntityNotFound(_0x26df70,_0x1dedc0){return function(_0x2fad62){if(!_0x2fad62){_0x26df70[_0x8660('0x18')](0x194);}return _0x2fad62;};}function handleError(_0x7ff72a,_0x43b1e8){_0x43b1e8=_0x43b1e8||0x1f4;return function(_0x361fab){logger[_0x8660('0x26')](_0x361fab[_0x8660('0x27')]);if(_0x361fab[_0x8660('0x28')]){delete _0x361fab[_0x8660('0x28')];}_0x7ff72a[_0x8660('0x19')](_0x43b1e8)[_0x8660('0x29')](_0x361fab);};}exports['index']=function(_0x4dd4e9,_0x46da28){var _0x3ae847={},_0x23d8cf={},_0x35a7d1={'count':0x0,'rows':[]};var _0x5153b3=_[_0x8660('0x2a')](db[_0x8660('0x2b')][_0x8660('0x2c')],function(_0x28dc39){return{'name':_0x28dc39['fieldName'],'type':_0x28dc39[_0x8660('0x2d')][_0x8660('0x2e')]};});_0x23d8cf[_0x8660('0x2f')]=_[_0x8660('0x2a')](_0x5153b3,_0x8660('0x28'));_0x23d8cf[_0x8660('0x30')]=_['keys'](_0x4dd4e9[_0x8660('0x30')]);_0x23d8cf[_0x8660('0x31')]=_[_0x8660('0x32')](_0x23d8cf[_0x8660('0x2f')],_0x23d8cf['query']);_0x3ae847['attributes']=_[_0x8660('0x32')](_0x23d8cf['model'],qs[_0x8660('0x33')](_0x4dd4e9[_0x8660('0x30')]['fields']));_0x3ae847[_0x8660('0x34')]=_0x3ae847['attributes'][_0x8660('0x35')]?_0x3ae847[_0x8660('0x34')]:_0x23d8cf['model'];if(!_0x4dd4e9[_0x8660('0x30')][_0x8660('0x36')](_0x8660('0x37'))){_0x3ae847[_0x8660('0x1e')]=qs[_0x8660('0x1e')](_0x4dd4e9[_0x8660('0x30')][_0x8660('0x1e')]);_0x3ae847[_0x8660('0x1c')]=qs[_0x8660('0x1c')](_0x4dd4e9[_0x8660('0x30')][_0x8660('0x1c')]);}_0x3ae847[_0x8660('0x38')]=qs['sort'](_0x4dd4e9['query'][_0x8660('0x39')]);_0x3ae847[_0x8660('0x3a')]=qs[_0x8660('0x31')](_[_0x8660('0x3b')](_0x4dd4e9[_0x8660('0x30')],_0x23d8cf[_0x8660('0x31')]),_0x5153b3);if(_0x4dd4e9[_0x8660('0x30')][_0x8660('0x3c')]){_0x3ae847[_0x8660('0x3a')]=_[_0x8660('0x3d')](_0x3ae847[_0x8660('0x3a')],{'$or':_[_0x8660('0x2a')](_0x5153b3,function(_0x50fdae){if(_0x50fdae[_0x8660('0x2d')]!==_0x8660('0x3e')){var _0xe08dd5={};_0xe08dd5[_0x50fdae[_0x8660('0x28')]]={'$like':'%'+_0x4dd4e9[_0x8660('0x30')]['filter']+'%'};return _0xe08dd5;}})});}_0x3ae847=_[_0x8660('0x3d')]({},_0x3ae847,_0x4dd4e9[_0x8660('0x3f')]);var _0x49a3cc={'where':_0x3ae847[_0x8660('0x3a')]};return db[_0x8660('0x2b')][_0x8660('0x1f')](_0x49a3cc)[_0x8660('0x24')](function(_0x5c6fd6){_0x35a7d1['count']=_0x5c6fd6;if(_0x4dd4e9['query'][_0x8660('0x40')]){_0x3ae847[_0x8660('0x41')]=[{'all':!![]}];}return db[_0x8660('0x2b')]['findAll'](_0x3ae847);})[_0x8660('0x24')](function(_0x4c726f){_0x35a7d1[_0x8660('0x42')]=_0x4c726f;return _0x35a7d1;})[_0x8660('0x24')](respondWithFilteredResult(_0x46da28,_0x3ae847))[_0x8660('0x43')](handleError(_0x46da28,null));};exports[_0x8660('0x44')]=function(_0x518818,_0x27f33f){var _0x5ede90={'raw':!![],'where':{'id':_0x518818[_0x8660('0x45')]['id']}},_0x39e5e4={};_0x39e5e4[_0x8660('0x2f')]=_['keys'](db['ServicenowField'][_0x8660('0x2c')]);_0x39e5e4[_0x8660('0x30')]=_['keys'](_0x518818[_0x8660('0x30')]);_0x39e5e4[_0x8660('0x31')]=_[_0x8660('0x32')](_0x39e5e4[_0x8660('0x2f')],_0x39e5e4[_0x8660('0x30')]);_0x5ede90[_0x8660('0x34')]=_['intersection'](_0x39e5e4['model'],qs[_0x8660('0x33')](_0x518818[_0x8660('0x30')]['fields']));_0x5ede90[_0x8660('0x34')]=_0x5ede90[_0x8660('0x34')][_0x8660('0x35')]?_0x5ede90['attributes']:_0x39e5e4['model'];if(_0x518818['query'][_0x8660('0x40')]){_0x5ede90[_0x8660('0x41')]=[{'all':!![]}];}_0x5ede90=_[_0x8660('0x3d')]({},_0x5ede90,_0x518818[_0x8660('0x3f')]);return db[_0x8660('0x2b')][_0x8660('0x46')](_0x5ede90)[_0x8660('0x24')](handleEntityNotFound(_0x27f33f,null))[_0x8660('0x24')](respondWithResult(_0x27f33f,null))[_0x8660('0x43')](handleError(_0x27f33f,null));};exports[_0x8660('0x47')]=function(_0x4b1285,_0x1637de){return db[_0x8660('0x2b')][_0x8660('0x47')](_0x4b1285[_0x8660('0x48')],{})[_0x8660('0x24')](respondWithResult(_0x1637de,0xc9))['catch'](handleError(_0x1637de,null));};exports[_0x8660('0x23')]=function(_0x8f5f59,_0x456e4e){if(_0x8f5f59[_0x8660('0x48')]['id']){delete _0x8f5f59[_0x8660('0x48')]['id'];}return db[_0x8660('0x2b')][_0x8660('0x46')]({'where':{'id':_0x8f5f59[_0x8660('0x45')]['id']}})[_0x8660('0x24')](handleEntityNotFound(_0x456e4e,null))[_0x8660('0x24')](saveUpdates(_0x8f5f59[_0x8660('0x48')],null))[_0x8660('0x24')](respondWithResult(_0x456e4e,null))[_0x8660('0x43')](handleError(_0x456e4e,null));};exports['destroy']=function(_0x419963,_0x6bbfef){return db[_0x8660('0x2b')]['find']({'where':{'id':_0x419963[_0x8660('0x45')]['id']}})[_0x8660('0x24')](handleEntityNotFound(_0x6bbfef,null))['then'](removeEntity(_0x6bbfef,null))['catch'](handleError(_0x6bbfef,null));}; \ No newline at end of file +var _0xc6bc=['desk.js','to-csv','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','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','ServicenowField','include','rows','catch','show','params','keys','includeAll','create','body','update','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1b6430,_0xe8e545){var _0x5d8a2b=function(_0x3ca552){while(--_0x3ca552){_0x1b6430['push'](_0x1b6430['shift']());}};_0x5d8a2b(++_0xe8e545);}(_0xc6bc,0x87));var _0xcc6b=function(_0x3ebff1,_0x1302d6){_0x3ebff1=_0x3ebff1-0x0;var _0x551748=_0xc6bc[_0x3ebff1];return _0x551748;};'use strict';var emlformat=require(_0xcc6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc6b('0x1'));var jsonpatch=require(_0xcc6b('0x2'));var rp=require('request-promise');var moment=require(_0xcc6b('0x3'));var BPromise=require(_0xcc6b('0x4'));var Mustache=require(_0xcc6b('0x5'));var util=require(_0xcc6b('0x6'));var path=require(_0xcc6b('0x7'));var sox=require(_0xcc6b('0x8'));var csv=require('to-csv');var ejs=require(_0xcc6b('0x9'));var fs=require('fs');var fs_extra=require(_0xcc6b('0xa'));var _=require(_0xcc6b('0xb'));var squel=require(_0xcc6b('0xc'));var crypto=require(_0xcc6b('0xd'));var jsforce=require(_0xcc6b('0xe'));var deskjs=require(_0xcc6b('0xf'));var toCsv=require(_0xcc6b('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc6b('0x11'));var authService=require(_0xcc6b('0x12'));var qs=require(_0xcc6b('0x13'));var as=require(_0xcc6b('0x14'));var hardwareService=require(_0xcc6b('0x15'));var logger=require('../../config/logger')(_0xcc6b('0x16'));var utils=require(_0xcc6b('0x17'));var config=require(_0xcc6b('0x18'));var licenseUtil=require(_0xcc6b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3487,_0xe74b07){_0xe74b07=_0xe74b07||0xcc;return function(_0xeee163){if(_0xeee163){return _0x1a3487[_0xcc6b('0x1a')](_0xe74b07);}return _0x1a3487[_0xcc6b('0x1b')](_0xe74b07)['end']();};}function respondWithResult(_0x4d1351,_0x5e89b4){_0x5e89b4=_0x5e89b4||0xc8;return function(_0x43b20a){if(_0x43b20a){return _0x4d1351[_0xcc6b('0x1b')](_0x5e89b4)['json'](_0x43b20a);}};}function respondWithFilteredResult(_0xeba955,_0x250df2){return function(_0x463276){if(_0x463276){var _0x2ca841=typeof _0x250df2[_0xcc6b('0x1c')]===_0xcc6b('0x1d')&&typeof _0x250df2[_0xcc6b('0x1e')]==='undefined';var _0x30a03b=_0x463276[_0xcc6b('0x1f')];var _0x2d1ac1=_0x2ca841?0x0:_0x250df2['offset'];var _0x1f4ab6=_0x2ca841?_0x463276['count']:_0x250df2[_0xcc6b('0x1c')]+_0x250df2[_0xcc6b('0x1e')];var _0x4d8c52;if(_0x1f4ab6>=_0x30a03b){_0x1f4ab6=_0x30a03b;_0x4d8c52=0xc8;}else{_0x4d8c52=0xce;}_0xeba955[_0xcc6b('0x1b')](_0x4d8c52);return _0xeba955[_0xcc6b('0x20')](_0xcc6b('0x21'),_0x2d1ac1+'-'+_0x1f4ab6+'/'+_0x30a03b)['json'](_0x463276);}return null;};}function patchUpdates(_0x49c3d9){return function(_0x3e9ec3){try{jsonpatch[_0xcc6b('0x22')](_0x3e9ec3,_0x49c3d9,!![]);}catch(_0x29f735){return BPromise['reject'](_0x29f735);}return _0x3e9ec3[_0xcc6b('0x23')]();};}function saveUpdates(_0x103112,_0x57cfd6){return function(_0x413aaf){if(_0x413aaf){return _0x413aaf['update'](_0x103112)[_0xcc6b('0x24')](function(_0x13b5f6){return _0x13b5f6;});}return null;};}function removeEntity(_0x260589,_0x511125){return function(_0x393e89){if(_0x393e89){return _0x393e89[_0xcc6b('0x25')]()[_0xcc6b('0x24')](function(){_0x260589[_0xcc6b('0x1b')](0xcc)[_0xcc6b('0x26')]();});}};}function handleEntityNotFound(_0x94df1b,_0x15c70b){return function(_0x23db24){if(!_0x23db24){_0x94df1b[_0xcc6b('0x1a')](0x194);}return _0x23db24;};}function handleError(_0x2915f0,_0x582ade){_0x582ade=_0x582ade||0x1f4;return function(_0xa10cd4){logger[_0xcc6b('0x27')](_0xa10cd4[_0xcc6b('0x28')]);if(_0xa10cd4[_0xcc6b('0x29')]){delete _0xa10cd4[_0xcc6b('0x29')];}_0x2915f0[_0xcc6b('0x1b')](_0x582ade)[_0xcc6b('0x2a')](_0xa10cd4);};}exports[_0xcc6b('0x2b')]=function(_0x736992,_0x2d9a54){var _0x3e3590={},_0x16fd92={},_0x1af011={'count':0x0,'rows':[]};var _0x2cfb30=_[_0xcc6b('0x2c')](db['ServicenowField'][_0xcc6b('0x2d')],function(_0x1ba9a4){return{'name':_0x1ba9a4[_0xcc6b('0x2e')],'type':_0x1ba9a4[_0xcc6b('0x2f')]['key']};});_0x16fd92[_0xcc6b('0x30')]=_[_0xcc6b('0x2c')](_0x2cfb30,_0xcc6b('0x29'));_0x16fd92['query']=_['keys'](_0x736992[_0xcc6b('0x31')]);_0x16fd92[_0xcc6b('0x32')]=_[_0xcc6b('0x33')](_0x16fd92['model'],_0x16fd92['query']);_0x3e3590['attributes']=_[_0xcc6b('0x33')](_0x16fd92['model'],qs[_0xcc6b('0x34')](_0x736992['query'][_0xcc6b('0x34')]));_0x3e3590[_0xcc6b('0x35')]=_0x3e3590[_0xcc6b('0x35')][_0xcc6b('0x36')]?_0x3e3590[_0xcc6b('0x35')]:_0x16fd92[_0xcc6b('0x30')];if(!_0x736992[_0xcc6b('0x31')][_0xcc6b('0x37')](_0xcc6b('0x38'))){_0x3e3590[_0xcc6b('0x1e')]=qs[_0xcc6b('0x1e')](_0x736992['query'][_0xcc6b('0x1e')]);_0x3e3590[_0xcc6b('0x1c')]=qs[_0xcc6b('0x1c')](_0x736992['query'][_0xcc6b('0x1c')]);}_0x3e3590[_0xcc6b('0x39')]=qs[_0xcc6b('0x3a')](_0x736992[_0xcc6b('0x31')]['sort']);_0x3e3590['where']=qs['filters'](_['pick'](_0x736992[_0xcc6b('0x31')],_0x16fd92[_0xcc6b('0x32')]),_0x2cfb30);if(_0x736992[_0xcc6b('0x31')][_0xcc6b('0x3b')]){_0x3e3590['where']=_[_0xcc6b('0x3c')](_0x3e3590[_0xcc6b('0x3d')],{'$or':_[_0xcc6b('0x2c')](_0x2cfb30,function(_0x577a46){if(_0x577a46['type']!==_0xcc6b('0x3e')){var _0x2891f1={};_0x2891f1[_0x577a46[_0xcc6b('0x29')]]={'$like':'%'+_0x736992[_0xcc6b('0x31')][_0xcc6b('0x3b')]+'%'};return _0x2891f1;}})});}_0x3e3590=_['merge']({},_0x3e3590,_0x736992['options']);var _0x411d1f={'where':_0x3e3590['where']};return db[_0xcc6b('0x3f')][_0xcc6b('0x1f')](_0x411d1f)[_0xcc6b('0x24')](function(_0x435602){_0x1af011[_0xcc6b('0x1f')]=_0x435602;if(_0x736992['query']['includeAll']){_0x3e3590[_0xcc6b('0x40')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x3e3590);})[_0xcc6b('0x24')](function(_0x41bfb2){_0x1af011[_0xcc6b('0x41')]=_0x41bfb2;return _0x1af011;})[_0xcc6b('0x24')](respondWithFilteredResult(_0x2d9a54,_0x3e3590))[_0xcc6b('0x42')](handleError(_0x2d9a54,null));};exports[_0xcc6b('0x43')]=function(_0x4482de,_0x59d1d4){var _0x262968={'raw':!![],'where':{'id':_0x4482de[_0xcc6b('0x44')]['id']}},_0xabeef8={};_0xabeef8[_0xcc6b('0x30')]=_[_0xcc6b('0x45')](db[_0xcc6b('0x3f')][_0xcc6b('0x2d')]);_0xabeef8['query']=_[_0xcc6b('0x45')](_0x4482de[_0xcc6b('0x31')]);_0xabeef8[_0xcc6b('0x32')]=_['intersection'](_0xabeef8[_0xcc6b('0x30')],_0xabeef8['query']);_0x262968['attributes']=_[_0xcc6b('0x33')](_0xabeef8[_0xcc6b('0x30')],qs[_0xcc6b('0x34')](_0x4482de[_0xcc6b('0x31')][_0xcc6b('0x34')]));_0x262968[_0xcc6b('0x35')]=_0x262968[_0xcc6b('0x35')][_0xcc6b('0x36')]?_0x262968[_0xcc6b('0x35')]:_0xabeef8['model'];if(_0x4482de[_0xcc6b('0x31')][_0xcc6b('0x46')]){_0x262968[_0xcc6b('0x40')]=[{'all':!![]}];}_0x262968=_['merge']({},_0x262968,_0x4482de['options']);return db[_0xcc6b('0x3f')]['find'](_0x262968)[_0xcc6b('0x24')](handleEntityNotFound(_0x59d1d4,null))[_0xcc6b('0x24')](respondWithResult(_0x59d1d4,null))[_0xcc6b('0x42')](handleError(_0x59d1d4,null));};exports['create']=function(_0x36263c,_0xc643f3){return db['ServicenowField'][_0xcc6b('0x47')](_0x36263c[_0xcc6b('0x48')],{})['then'](respondWithResult(_0xc643f3,0xc9))[_0xcc6b('0x42')](handleError(_0xc643f3,null));};exports[_0xcc6b('0x49')]=function(_0x239efc,_0x565a7d){if(_0x239efc[_0xcc6b('0x48')]['id']){delete _0x239efc[_0xcc6b('0x48')]['id'];}return db[_0xcc6b('0x3f')][_0xcc6b('0x4a')]({'where':{'id':_0x239efc[_0xcc6b('0x44')]['id']}})[_0xcc6b('0x24')](handleEntityNotFound(_0x565a7d,null))[_0xcc6b('0x24')](saveUpdates(_0x239efc[_0xcc6b('0x48')],null))[_0xcc6b('0x24')](respondWithResult(_0x565a7d,null))['catch'](handleError(_0x565a7d,null));};exports['destroy']=function(_0x524f09,_0x5e3a0c){return db[_0xcc6b('0x3f')][_0xcc6b('0x4a')]({'where':{'id':_0x524f09['params']['id']}})[_0xcc6b('0x24')](handleEntityNotFound(_0x5e3a0c,null))[_0xcc6b('0x24')](removeEntity(_0x5e3a0c,null))[_0xcc6b('0x42')](handleError(_0x5e3a0c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 506899e..9800bed 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29c3=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x689740,_0x15278f){var _0x413ae1=function(_0x2582e5){while(--_0x2582e5){_0x689740['push'](_0x689740['shift']());}};_0x413ae1(++_0x15278f);}(_0x29c3,0x13d));var _0x329c=function(_0x153837,_0x93cc15){_0x153837=_0x153837-0x0;var _0x4830e1=_0x29c3[_0x153837];return _0x4830e1;};'use strict';var _=require(_0x329c('0x0'));var util=require(_0x329c('0x1'));var logger=require(_0x329c('0x2'))(_0x329c('0x3'));var moment=require('moment');var BPromise=require(_0x329c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x329c('0x5'));var rimraf=require(_0x329c('0x6'));var config=require(_0x329c('0x7'));var attributes=require(_0x329c('0x8'));module[_0x329c('0x9')]=function(_0x5d6841,_0x505ede){return _0x5d6841[_0x329c('0xa')](_0x329c('0xb'),attributes,{'tableName':_0x329c('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x329c('0xd'),_0x329c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3b3=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','idField'];(function(_0x338e4b,_0x4a5778){var _0xbab8e5=function(_0xbe313c){while(--_0xbe313c){_0x338e4b['push'](_0x338e4b['shift']());}};_0xbab8e5(++_0x4a5778);}(_0xb3b3,0x146));var _0x3b3b=function(_0xffcd26,_0x43ddfb){_0xffcd26=_0xffcd26-0x0;var _0x34d12b=_0xb3b3[_0xffcd26];return _0x34d12b;};'use strict';var _=require('lodash');var util=require(_0x3b3b('0x0'));var logger=require(_0x3b3b('0x1'))(_0x3b3b('0x2'));var moment=require(_0x3b3b('0x3'));var BPromise=require(_0x3b3b('0x4'));var rp=require(_0x3b3b('0x5'));var fs=require('fs');var path=require(_0x3b3b('0x6'));var rimraf=require(_0x3b3b('0x7'));var config=require(_0x3b3b('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x3b3b('0x9')]=function(_0x372e13,_0x58a6f4){return _0x372e13[_0x3b3b('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x3b3b('0xb'),_0x3b3b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 1d35238..a63b1ed 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x10ef5d,_0x203094){var _0x104260=function(_0x30d491){while(--_0x30d491){_0x10ef5d['push'](_0x10ef5d['shift']());}};_0x104260(++_0x203094);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1d664a,_0x149a34){var _0x335345=function(_0x461fac){while(--_0x461fac){_0x1d664a['push'](_0x1d664a['shift']());}};_0x335345(++_0x149a34);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 341c0c7..c9a3806 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4448e4,_0x8483fe){var _0x14658a=function(_0x2c799f){while(--_0x2c799f){_0x4448e4['push'](_0x4448e4['shift']());}};_0x14658a(++_0x8483fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5c2794,_0x3e3dbc){var _0x5e258f=function(_0x24228c){while(--_0x24228c){_0x5c2794['push'](_0x5c2794['shift']());}};_0x5e258f(++_0x3e3dbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 9039212..aeecc38 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4acf55,_0x433577){var _0x4cfe7b=function(_0x2efda8){while(--_0x2efda8){_0x4acf55['push'](_0x4acf55['shift']());}};_0x4cfe7b(++_0x433577);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0xd2ec32,_0x555f90){var _0x55671b=function(_0x3a22bf){while(--_0x3a22bf){_0xd2ec32['push'](_0xd2ec32['shift']());}};_0x55671b(++_0x555f90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 13a648a..10258df 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02c5=['SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','SugarcrmAccount','rows','catch','params','create','body','find','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x02c5,0x178));var _0x502c=function(_0x86ba06,_0x2e50d9){_0x86ba06=_0x86ba06-0x0;var _0xafb44a=_0x02c5[_0x86ba06];return _0xafb44a;};'use strict';var emlformat=require(_0x502c('0x0'));var rimraf=require(_0x502c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x502c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x502c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x502c('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x502c('0x5'));var crypto=require(_0x502c('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x502c('0x7'));var toCsv=require(_0x502c('0x8'));var querystring=require(_0x502c('0x9'));var Papa=require(_0x502c('0xa'));var Redis=require(_0x502c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x502c('0xc'));var as=require(_0x502c('0xd'));var hardwareService=require(_0x502c('0xe'));var logger=require(_0x502c('0xf'))(_0x502c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x502c('0x11'))['db'];var integrations=require(_0x502c('0x12'));function respondWithStatusCode(_0x13fc9d,_0x433411){_0x433411=_0x433411||0xcc;return function(_0x21b64c){if(_0x21b64c){return _0x13fc9d[_0x502c('0x13')](_0x433411);}return _0x13fc9d[_0x502c('0x14')](_0x433411)[_0x502c('0x15')]();};}function respondWithResult(_0x5ccd04,_0x596d18){_0x596d18=_0x596d18||0xc8;return function(_0x4a7709){if(_0x4a7709){return _0x5ccd04[_0x502c('0x14')](_0x596d18)[_0x502c('0x16')](_0x4a7709);}};}function respondWithFilteredResult(_0x4243c3,_0x4c1e54){return function(_0x5957bc){if(_0x5957bc){var _0x29247f=typeof _0x4c1e54[_0x502c('0x17')]===_0x502c('0x18')&&typeof _0x4c1e54[_0x502c('0x19')]===_0x502c('0x18');var _0x5479cc=_0x5957bc[_0x502c('0x1a')];var _0x11162e=_0x29247f?0x0:_0x4c1e54[_0x502c('0x17')];var _0x26d071=_0x29247f?_0x5957bc[_0x502c('0x1a')]:_0x4c1e54[_0x502c('0x17')]+_0x4c1e54[_0x502c('0x19')];var _0x3aa2ea;if(_0x26d071>=_0x5479cc){_0x26d071=_0x5479cc;_0x3aa2ea=0xc8;}else{_0x3aa2ea=0xce;}_0x4243c3[_0x502c('0x14')](_0x3aa2ea);return _0x4243c3['set'](_0x502c('0x1b'),_0x11162e+'-'+_0x26d071+'/'+_0x5479cc)['json'](_0x5957bc);}return null;};}function patchUpdates(_0x5060d3){return function(_0x4566ca){try{jsonpatch['apply'](_0x4566ca,_0x5060d3,!![]);}catch(_0x5480b0){return BPromise[_0x502c('0x1c')](_0x5480b0);}return _0x4566ca['save']();};}function saveUpdates(_0x2e02d6,_0xc85299){return function(_0x2ed355){if(_0x2ed355){return _0x2ed355[_0x502c('0x1d')](_0x2e02d6)[_0x502c('0x1e')](function(_0x2a1d4b){return _0x2a1d4b;});}return null;};}function removeEntity(_0x99aafa,_0x4e6e71){return function(_0x442bc8){if(_0x442bc8){return _0x442bc8[_0x502c('0x1f')]()[_0x502c('0x1e')](function(){_0x99aafa[_0x502c('0x14')](0xcc)[_0x502c('0x15')]();});}};}function handleEntityNotFound(_0x526ccf,_0x3ac457){return function(_0xcfdac2){if(!_0xcfdac2){_0x526ccf[_0x502c('0x13')](0x194);}return _0xcfdac2;};}function handleError(_0x28e679,_0x1f63a7){_0x1f63a7=_0x1f63a7||0x1f4;return function(_0x45b3d4){logger[_0x502c('0x20')](_0x45b3d4[_0x502c('0x21')]);if(_0x45b3d4['name']){delete _0x45b3d4[_0x502c('0x22')];}_0x28e679[_0x502c('0x14')](_0x1f63a7)['send'](_0x45b3d4);};}exports[_0x502c('0x23')]=function(_0x512b87,_0x48ac49){var _0x20879d={},_0x14a22c={},_0x31cf73={'count':0x0,'rows':[]};var _0x5d776f=_[_0x502c('0x24')](db['SugarcrmAccount'][_0x502c('0x25')],function(_0x1d2395){return{'name':_0x1d2395['fieldName'],'type':_0x1d2395[_0x502c('0x26')][_0x502c('0x27')]};});_0x14a22c[_0x502c('0x28')]=_[_0x502c('0x24')](_0x5d776f,_0x502c('0x22'));_0x14a22c[_0x502c('0x29')]=_[_0x502c('0x2a')](_0x512b87[_0x502c('0x29')]);_0x14a22c[_0x502c('0x2b')]=_['intersection'](_0x14a22c[_0x502c('0x28')],_0x14a22c[_0x502c('0x29')]);_0x20879d[_0x502c('0x2c')]=_[_0x502c('0x2d')](_0x14a22c[_0x502c('0x28')],qs[_0x502c('0x2e')](_0x512b87['query']['fields']));_0x20879d[_0x502c('0x2c')]=_0x20879d[_0x502c('0x2c')][_0x502c('0x2f')]?_0x20879d[_0x502c('0x2c')]:_0x14a22c[_0x502c('0x28')];if(!_0x512b87[_0x502c('0x29')][_0x502c('0x30')](_0x502c('0x31'))){_0x20879d['limit']=qs[_0x502c('0x19')](_0x512b87['query']['limit']);_0x20879d['offset']=qs['offset'](_0x512b87['query'][_0x502c('0x17')]);}_0x20879d[_0x502c('0x32')]=qs[_0x502c('0x33')](_0x512b87[_0x502c('0x29')][_0x502c('0x33')]);_0x20879d[_0x502c('0x34')]=qs[_0x502c('0x2b')](_[_0x502c('0x35')](_0x512b87[_0x502c('0x29')],_0x14a22c[_0x502c('0x2b')]),_0x5d776f);if(_0x512b87[_0x502c('0x29')][_0x502c('0x36')]){_0x20879d[_0x502c('0x34')]=_[_0x502c('0x37')](_0x20879d[_0x502c('0x34')],{'$or':_[_0x502c('0x24')](_0x5d776f,function(_0x8414ba){if(_0x8414ba[_0x502c('0x26')]!=='VIRTUAL'){var _0x16b79b={};_0x16b79b[_0x8414ba[_0x502c('0x22')]]={'$like':'%'+_0x512b87[_0x502c('0x29')][_0x502c('0x36')]+'%'};return _0x16b79b;}})});}_0x20879d=_['merge']({},_0x20879d,_0x512b87[_0x502c('0x38')]);var _0x4182a6={'where':_0x20879d['where']};return db['SugarcrmAccount'][_0x502c('0x1a')](_0x4182a6)['then'](function(_0x40b911){_0x31cf73[_0x502c('0x1a')]=_0x40b911;if(_0x512b87['query'][_0x502c('0x39')]){_0x20879d[_0x502c('0x3a')]=[{'all':!![]}];}return db[_0x502c('0x3b')]['findAll'](_0x20879d);})[_0x502c('0x1e')](function(_0x13f452){_0x31cf73[_0x502c('0x3c')]=_0x13f452;return _0x31cf73;})[_0x502c('0x1e')](respondWithFilteredResult(_0x48ac49,_0x20879d))[_0x502c('0x3d')](handleError(_0x48ac49,null));};exports['show']=function(_0x54d0bd,_0x2b47a3){var _0x2edf1a={'raw':![],'where':{'id':_0x54d0bd[_0x502c('0x3e')]['id']}},_0x2cbe8c={};_0x2cbe8c[_0x502c('0x28')]=_['keys'](db[_0x502c('0x3b')][_0x502c('0x25')]);_0x2cbe8c[_0x502c('0x29')]=_['keys'](_0x54d0bd[_0x502c('0x29')]);_0x2cbe8c[_0x502c('0x2b')]=_['intersection'](_0x2cbe8c[_0x502c('0x28')],_0x2cbe8c['query']);_0x2edf1a[_0x502c('0x2c')]=_[_0x502c('0x2d')](_0x2cbe8c['model'],qs[_0x502c('0x2e')](_0x54d0bd[_0x502c('0x29')][_0x502c('0x2e')]));_0x2edf1a[_0x502c('0x2c')]=_0x2edf1a[_0x502c('0x2c')][_0x502c('0x2f')]?_0x2edf1a[_0x502c('0x2c')]:_0x2cbe8c[_0x502c('0x28')];if(_0x54d0bd[_0x502c('0x29')][_0x502c('0x39')]){_0x2edf1a[_0x502c('0x3a')]=[{'all':!![]}];}_0x2edf1a=_[_0x502c('0x37')]({},_0x2edf1a,_0x54d0bd[_0x502c('0x38')]);return db['SugarcrmAccount']['find'](_0x2edf1a)[_0x502c('0x1e')](handleEntityNotFound(_0x2b47a3,null))[_0x502c('0x1e')](respondWithResult(_0x2b47a3,null))[_0x502c('0x3d')](handleError(_0x2b47a3,null));};exports[_0x502c('0x3f')]=function(_0x49147e,_0x478245){return db[_0x502c('0x3b')][_0x502c('0x3f')](_0x49147e[_0x502c('0x40')],{})[_0x502c('0x1e')](respondWithResult(_0x478245,0xc9))[_0x502c('0x3d')](handleError(_0x478245,null));};exports['update']=function(_0x2cd8c1,_0x5ad994){if(_0x2cd8c1[_0x502c('0x40')]['id']){delete _0x2cd8c1[_0x502c('0x40')]['id'];}return db[_0x502c('0x3b')][_0x502c('0x41')]({'where':{'id':_0x2cd8c1[_0x502c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5ad994,null))[_0x502c('0x1e')](saveUpdates(_0x2cd8c1[_0x502c('0x40')],null))[_0x502c('0x1e')](respondWithResult(_0x5ad994,null))[_0x502c('0x3d')](handleError(_0x5ad994,null));};exports[_0x502c('0x1f')]=function(_0x4ac16e,_0x1f0b56){return db['SugarcrmAccount'][_0x502c('0x41')]({'where':{'id':_0x4ac16e[_0x502c('0x3e')]['id']}})[_0x502c('0x1e')](handleEntityNotFound(_0x1f0b56,null))['then'](removeEntity(_0x1f0b56,null))[_0x502c('0x3d')](handleError(_0x1f0b56,null));};exports[_0x502c('0x42')]=function(_0x3cac50,_0x28fcc5,_0x37bab2){var _0x1ae4c9={};var _0x4de0a5={};var _0x49f545;var _0x420095;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x3cac50[_0x502c('0x3e')]['id']}})[_0x502c('0x1e')](handleEntityNotFound(_0x28fcc5,null))['then'](function(_0x44ee78){if(_0x44ee78){_0x49f545=_0x44ee78;_0x4de0a5[_0x502c('0x28')]=_[_0x502c('0x2a')](db['SugarcrmConfiguration']['rawAttributes']);_0x4de0a5[_0x502c('0x29')]=_['keys'](_0x3cac50['query']);_0x4de0a5[_0x502c('0x2b')]=_[_0x502c('0x2d')](_0x4de0a5[_0x502c('0x28')],_0x4de0a5[_0x502c('0x29')]);_0x1ae4c9[_0x502c('0x2c')]=_[_0x502c('0x2d')](_0x4de0a5[_0x502c('0x28')],qs[_0x502c('0x2e')](_0x3cac50[_0x502c('0x29')][_0x502c('0x2e')]));_0x1ae4c9[_0x502c('0x2c')]=_0x1ae4c9[_0x502c('0x2c')][_0x502c('0x2f')]?_0x1ae4c9[_0x502c('0x2c')]:_0x4de0a5[_0x502c('0x28')];_0x1ae4c9[_0x502c('0x32')]=qs[_0x502c('0x33')](_0x3cac50['query']['sort']);_0x1ae4c9[_0x502c('0x34')]=qs[_0x502c('0x2b')](_[_0x502c('0x35')](_0x3cac50[_0x502c('0x29')],_0x4de0a5[_0x502c('0x2b')]));if(_0x3cac50[_0x502c('0x29')][_0x502c('0x36')]){_0x1ae4c9[_0x502c('0x34')]=_[_0x502c('0x37')](_0x1ae4c9[_0x502c('0x34')],{'$or':_['map'](_0x1ae4c9[_0x502c('0x2c')],function(_0xbbc1f2){var _0x3a93ee={};_0x3a93ee[_0xbbc1f2]={'$like':'%'+_0x3cac50[_0x502c('0x29')][_0x502c('0x36')]+'%'};return _0x3a93ee;})});}_0x1ae4c9=_[_0x502c('0x37')]({},_0x1ae4c9,_0x3cac50['options']);return _0x49f545[_0x502c('0x42')](_0x1ae4c9);}})[_0x502c('0x1e')](function(_0x1982b9){if(_0x1982b9){_0x420095=_0x1982b9[_0x502c('0x2f')];if(!_0x3cac50['query'][_0x502c('0x30')](_0x502c('0x31'))){_0x1ae4c9[_0x502c('0x19')]=qs[_0x502c('0x19')](_0x3cac50['query'][_0x502c('0x19')]);_0x1ae4c9[_0x502c('0x17')]=qs['offset'](_0x3cac50[_0x502c('0x29')][_0x502c('0x17')]);}return _0x49f545[_0x502c('0x42')](_0x1ae4c9);}})[_0x502c('0x1e')](function(_0x59112b){if(_0x59112b){return _0x59112b?{'count':_0x420095,'rows':_0x59112b}:null;}})[_0x502c('0x1e')](respondWithResult(_0x28fcc5,null))[_0x502c('0x3d')](handleError(_0x28fcc5,null));};exports[_0x502c('0x43')]=function(_0x58c128,_0x31456f,_0x4fd740){if(_0x58c128[_0x502c('0x40')]['id']){delete _0x58c128['body']['id'];}return db['SugarcrmAccount'][_0x502c('0x44')]({'where':{'id':_0x58c128[_0x502c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x31456f,null))[_0x502c('0x1e')](function(_0x3da432){if(_0x3da432){_0x58c128[_0x502c('0x40')][_0x502c('0x45')]=_0x3da432['id'];_0x58c128[_0x502c('0x40')][_0x502c('0x46')]=integrations[_0x502c('0x47')](_0x58c128[_0x502c('0x40')][_0x502c('0x48')],_0x58c128['body']['type']);_0x58c128['body'][_0x502c('0x49')]=integrations[_0x502c('0x4a')](_0x58c128[_0x502c('0x40')][_0x502c('0x48')],_0x58c128[_0x502c('0x40')][_0x502c('0x26')]);return db[_0x502c('0x4b')][_0x502c('0x3f')](_0x58c128[_0x502c('0x40')],{'include':[{'model':db['SugarcrmField'],'as':_0x502c('0x46')},{'model':db[_0x502c('0x4c')],'as':_0x502c('0x49')}]});}return null;})['then'](respondWithResult(_0x31456f,null))[_0x502c('0x3d')](handleError(_0x31456f,null));};exports['getFields']=function(_0x59e9f6,_0x165894,_0x21305d){var _0x13f0db='';var _0x331a59=['id','name',_0x502c('0x4d'),_0x502c('0x4e'),_0x502c('0x4f'),_0x502c('0x50'),_0x502c('0x51'),'duration_minutes',_0x502c('0x52'),_0x502c('0x53'),_0x502c('0x54'),_0x502c('0x55')];return db[_0x502c('0x3b')]['findOne']({'where':{'id':_0x59e9f6[_0x502c('0x3e')]['id']},'attributes':['id',_0x502c('0x56'),_0x502c('0x57'),_0x502c('0x58')]})[_0x502c('0x1e')](handleEntityNotFound(_0x165894,null))[_0x502c('0x1e')](function(_0x2ac822){if(_0x2ac822){_0x13f0db=_0x2ac822[_0x502c('0x58')];var _0x498bd3=_0x13f0db[_0x502c('0x59')](-0x1);if(_0x498bd3==='/'){_0x13f0db=_0x13f0db[_0x502c('0x5a')](0x0,_0x13f0db[_0x502c('0x5b')](_0x498bd3));}return rp({'method':_0x502c('0x5c'),'uri':util[_0x502c('0x5d')](_0x502c('0x5e'),_0x13f0db,_0x502c('0x5f')),'json':!![],'form':{'method':'login','input_type':_0x502c('0x60'),'response_type':_0x502c('0x60'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2ac822[_0x502c('0x56')],'password':_0x2ac822[_0x502c('0x57')],'encryption':'PLAIN'},'application':_0x502c('0x61')})}});}})[_0x502c('0x1e')](function(_0x9f0e){if(_0x9f0e&&_0x9f0e[_0x502c('0x22')]!==_0x502c('0x62')&&_0x9f0e[_0x502c('0x22')]!==_0x502c('0x63')){return rp({'method':_0x502c('0x5c'),'uri':util[_0x502c('0x5d')]('%s%s',_0x13f0db,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x502c('0x64'),'input_type':_0x502c('0x60'),'response_type':_0x502c('0x60'),'rest_data':JSON[_0x502c('0x65')]({'session':_0x9f0e['id'],'module_name':_0x502c('0x66')})}})[_0x502c('0x1e')](function(_0x864636){if(_0x864636){var _0x3647df=_[_0x502c('0x67')](_0x864636[_0x502c('0x68')]);_['remove'](_0x3647df,function(_0x1ff020){return _0x331a59['includes'](_0x1ff020[_0x502c('0x22')]);});return{'count':_0x3647df['length'],'rows':_[_0x502c('0x24')](_0x3647df,function(_0x3aa0d8){return{'id':_0x3aa0d8[_0x502c('0x22')],'name':_0x3aa0d8['label'],'custom':_[_0x502c('0x69')](_0x3aa0d8[_0x502c('0x22')],'_c')?!![]:![],'options':_0x3aa0d8[_0x502c('0x38')]?_[_0x502c('0x24')](_[_0x502c('0x67')](_0x3aa0d8[_0x502c('0x38')]),function(_0x5a519b){return{'name':_0x5a519b[_0x502c('0x6a')],'value':_0x5a519b[_0x502c('0x22')]};}):[]};})};}})[_0x502c('0x1e')](respondWithResult(_0x165894,null))[_0x502c('0x3d')](function(_0x157227){var _0x9c7bd5=_0x59e9f6['query'][_0x502c('0x6b')]?0x1f4:_0x157227[_0x502c('0x6c')]||0x1f4;logger[_0x502c('0x20')](_0x502c('0x6d'),_0x502c('0x6e'),_0x9c7bd5,JSON[_0x502c('0x65')](_0x157227));delete _0x157227['name'];if(_0x9c7bd5===0x191){_0x9c7bd5=0x190;}_0x165894[_0x502c('0x14')](_0x9c7bd5)[_0x502c('0x6f')](_0x59e9f6[_0x502c('0x29')][_0x502c('0x6b')]?{'message':_0x502c('0x70'),'statusCode':_0x157227[_0x502c('0x6c')]}:_0x157227);});}else{var _0x254720=0x1f4;_0x165894['status'](_0x254720)[_0x502c('0x6f')]({'message':_0x502c('0x70'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xc9a5=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','findOne','length','order','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','duration_minutes','parent_id','password','remoteUri','slice','substring','POST','format','%s%s','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x45a33f,_0x2db610){var _0x174e40=function(_0xbc03d1){while(--_0xbc03d1){_0x45a33f['push'](_0x45a33f['shift']());}};_0x174e40(++_0x2db610);}(_0xc9a5,0x65));var _0x5c9a=function(_0x564767,_0x4b1d69){_0x564767=_0x564767-0x0;var _0x1516d3=_0xc9a5[_0x564767];return _0x1516d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c9a('0x1'));var rp=require('request-promise');var moment=require(_0x5c9a('0x2'));var BPromise=require(_0x5c9a('0x3'));var Mustache=require('mustache');var util=require(_0x5c9a('0x4'));var path=require(_0x5c9a('0x5'));var sox=require(_0x5c9a('0x6'));var csv=require(_0x5c9a('0x7'));var ejs=require(_0x5c9a('0x8'));var fs=require('fs');var fs_extra=require(_0x5c9a('0x9'));var _=require(_0x5c9a('0xa'));var squel=require(_0x5c9a('0xb'));var crypto=require(_0x5c9a('0xc'));var jsforce=require(_0x5c9a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c9a('0x7'));var querystring=require(_0x5c9a('0xe'));var Papa=require(_0x5c9a('0xf'));var Redis=require(_0x5c9a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c9a('0x11'));var as=require(_0x5c9a('0x12'));var hardwareService=require(_0x5c9a('0x13'));var logger=require(_0x5c9a('0x14'))(_0x5c9a('0x15'));var utils=require(_0x5c9a('0x16'));var config=require(_0x5c9a('0x17'));var licenseUtil=require(_0x5c9a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5c9a('0x19'));function respondWithStatusCode(_0x602ad1,_0x45a97d){_0x45a97d=_0x45a97d||0xcc;return function(_0x2e826c){if(_0x2e826c){return _0x602ad1['sendStatus'](_0x45a97d);}return _0x602ad1[_0x5c9a('0x1a')](_0x45a97d)[_0x5c9a('0x1b')]();};}function respondWithResult(_0x5a9dc0,_0x117311){_0x117311=_0x117311||0xc8;return function(_0x29e97c){if(_0x29e97c){return _0x5a9dc0[_0x5c9a('0x1a')](_0x117311)[_0x5c9a('0x1c')](_0x29e97c);}};}function respondWithFilteredResult(_0x34d9eb,_0x149e30){return function(_0x1e92a6){if(_0x1e92a6){var _0x30cfc8=typeof _0x149e30[_0x5c9a('0x1d')]==='undefined'&&typeof _0x149e30[_0x5c9a('0x1e')]===_0x5c9a('0x1f');var _0x5b3020=_0x1e92a6[_0x5c9a('0x20')];var _0x350b00=_0x30cfc8?0x0:_0x149e30['offset'];var _0x3df7f5=_0x30cfc8?_0x1e92a6[_0x5c9a('0x20')]:_0x149e30[_0x5c9a('0x1d')]+_0x149e30[_0x5c9a('0x1e')];var _0x1c84bb;if(_0x3df7f5>=_0x5b3020){_0x3df7f5=_0x5b3020;_0x1c84bb=0xc8;}else{_0x1c84bb=0xce;}_0x34d9eb[_0x5c9a('0x1a')](_0x1c84bb);return _0x34d9eb[_0x5c9a('0x21')](_0x5c9a('0x22'),_0x350b00+'-'+_0x3df7f5+'/'+_0x5b3020)[_0x5c9a('0x1c')](_0x1e92a6);}return null;};}function patchUpdates(_0x40cc58){return function(_0x22a7e6){try{jsonpatch[_0x5c9a('0x23')](_0x22a7e6,_0x40cc58,!![]);}catch(_0x59d05a){return BPromise[_0x5c9a('0x24')](_0x59d05a);}return _0x22a7e6['save']();};}function saveUpdates(_0x152026,_0x2dbf73){return function(_0x1fde16){if(_0x1fde16){return _0x1fde16[_0x5c9a('0x25')](_0x152026)[_0x5c9a('0x26')](function(_0x5d609f){return _0x5d609f;});}return null;};}function removeEntity(_0x589ea0,_0xd4475d){return function(_0x191e2c){if(_0x191e2c){return _0x191e2c[_0x5c9a('0x27')]()[_0x5c9a('0x26')](function(){_0x589ea0['status'](0xcc)[_0x5c9a('0x1b')]();});}};}function handleEntityNotFound(_0x143abb,_0x4da8b9){return function(_0x41187f){if(!_0x41187f){_0x143abb[_0x5c9a('0x28')](0x194);}return _0x41187f;};}function handleError(_0x5aab3d,_0xf59712){_0xf59712=_0xf59712||0x1f4;return function(_0x2b0a27){logger['error'](_0x2b0a27[_0x5c9a('0x29')]);if(_0x2b0a27[_0x5c9a('0x2a')]){delete _0x2b0a27[_0x5c9a('0x2a')];}_0x5aab3d[_0x5c9a('0x1a')](_0xf59712)['send'](_0x2b0a27);};}exports[_0x5c9a('0x2b')]=function(_0x5f264c,_0x54cdb2){var _0x36c415={},_0x539a6f={},_0x29cd07={'count':0x0,'rows':[]};var _0x147ced=_[_0x5c9a('0x2c')](db[_0x5c9a('0x2d')][_0x5c9a('0x2e')],function(_0x32023c){return{'name':_0x32023c[_0x5c9a('0x2f')],'type':_0x32023c['type'][_0x5c9a('0x30')]};});_0x539a6f['model']=_['map'](_0x147ced,_0x5c9a('0x2a'));_0x539a6f['query']=_['keys'](_0x5f264c[_0x5c9a('0x31')]);_0x539a6f['filters']=_[_0x5c9a('0x32')](_0x539a6f[_0x5c9a('0x33')],_0x539a6f[_0x5c9a('0x31')]);_0x36c415[_0x5c9a('0x34')]=_[_0x5c9a('0x32')](_0x539a6f['model'],qs['fields'](_0x5f264c['query'][_0x5c9a('0x35')]));_0x36c415[_0x5c9a('0x34')]=_0x36c415['attributes']['length']?_0x36c415['attributes']:_0x539a6f[_0x5c9a('0x33')];if(!_0x5f264c[_0x5c9a('0x31')][_0x5c9a('0x36')](_0x5c9a('0x37'))){_0x36c415[_0x5c9a('0x1e')]=qs['limit'](_0x5f264c['query'][_0x5c9a('0x1e')]);_0x36c415[_0x5c9a('0x1d')]=qs[_0x5c9a('0x1d')](_0x5f264c[_0x5c9a('0x31')][_0x5c9a('0x1d')]);}_0x36c415['order']=qs[_0x5c9a('0x38')](_0x5f264c[_0x5c9a('0x31')][_0x5c9a('0x38')]);_0x36c415[_0x5c9a('0x39')]=qs[_0x5c9a('0x3a')](_[_0x5c9a('0x3b')](_0x5f264c[_0x5c9a('0x31')],_0x539a6f[_0x5c9a('0x3a')]),_0x147ced);if(_0x5f264c['query'][_0x5c9a('0x3c')]){_0x36c415[_0x5c9a('0x39')]=_[_0x5c9a('0x3d')](_0x36c415[_0x5c9a('0x39')],{'$or':_[_0x5c9a('0x2c')](_0x147ced,function(_0x32c2a7){if(_0x32c2a7['type']!==_0x5c9a('0x3e')){var _0x576cad={};_0x576cad[_0x32c2a7['name']]={'$like':'%'+_0x5f264c['query'][_0x5c9a('0x3c')]+'%'};return _0x576cad;}})});}_0x36c415=_[_0x5c9a('0x3d')]({},_0x36c415,_0x5f264c['options']);var _0x196d11={'where':_0x36c415[_0x5c9a('0x39')]};return db[_0x5c9a('0x2d')][_0x5c9a('0x20')](_0x196d11)['then'](function(_0x13376e){_0x29cd07[_0x5c9a('0x20')]=_0x13376e;if(_0x5f264c['query'][_0x5c9a('0x3f')]){_0x36c415[_0x5c9a('0x40')]=[{'all':!![]}];}return db[_0x5c9a('0x2d')][_0x5c9a('0x41')](_0x36c415);})[_0x5c9a('0x26')](function(_0x3ac4df){_0x29cd07[_0x5c9a('0x42')]=_0x3ac4df;return _0x29cd07;})[_0x5c9a('0x26')](respondWithFilteredResult(_0x54cdb2,_0x36c415))[_0x5c9a('0x43')](handleError(_0x54cdb2,null));};exports['show']=function(_0x31ed42,_0x272492){var _0x39aad6={'raw':![],'where':{'id':_0x31ed42[_0x5c9a('0x44')]['id']}},_0x236623={};_0x236623[_0x5c9a('0x33')]=_[_0x5c9a('0x45')](db[_0x5c9a('0x2d')][_0x5c9a('0x2e')]);_0x236623[_0x5c9a('0x31')]=_[_0x5c9a('0x45')](_0x31ed42[_0x5c9a('0x31')]);_0x236623[_0x5c9a('0x3a')]=_[_0x5c9a('0x32')](_0x236623['model'],_0x236623[_0x5c9a('0x31')]);_0x39aad6['attributes']=_[_0x5c9a('0x32')](_0x236623[_0x5c9a('0x33')],qs['fields'](_0x31ed42[_0x5c9a('0x31')][_0x5c9a('0x35')]));_0x39aad6['attributes']=_0x39aad6['attributes']['length']?_0x39aad6['attributes']:_0x236623[_0x5c9a('0x33')];if(_0x31ed42[_0x5c9a('0x31')][_0x5c9a('0x3f')]){_0x39aad6[_0x5c9a('0x40')]=[{'all':!![]}];}_0x39aad6=_['merge']({},_0x39aad6,_0x31ed42[_0x5c9a('0x46')]);return db[_0x5c9a('0x2d')][_0x5c9a('0x47')](_0x39aad6)[_0x5c9a('0x26')](handleEntityNotFound(_0x272492,null))[_0x5c9a('0x26')](respondWithResult(_0x272492,null))[_0x5c9a('0x43')](handleError(_0x272492,null));};exports[_0x5c9a('0x48')]=function(_0x5e8e66,_0x788c99){return db['SugarcrmAccount']['create'](_0x5e8e66[_0x5c9a('0x49')],{})[_0x5c9a('0x26')](respondWithResult(_0x788c99,0xc9))[_0x5c9a('0x43')](handleError(_0x788c99,null));};exports[_0x5c9a('0x25')]=function(_0x379ad5,_0x229809){if(_0x379ad5[_0x5c9a('0x49')]['id']){delete _0x379ad5[_0x5c9a('0x49')]['id'];}return db[_0x5c9a('0x2d')]['find']({'where':{'id':_0x379ad5[_0x5c9a('0x44')]['id']}})['then'](handleEntityNotFound(_0x229809,null))[_0x5c9a('0x26')](saveUpdates(_0x379ad5[_0x5c9a('0x49')],null))[_0x5c9a('0x26')](respondWithResult(_0x229809,null))[_0x5c9a('0x43')](handleError(_0x229809,null));};exports[_0x5c9a('0x27')]=function(_0xe8a0f2,_0x53a58f){return db[_0x5c9a('0x2d')][_0x5c9a('0x47')]({'where':{'id':_0xe8a0f2[_0x5c9a('0x44')]['id']}})['then'](handleEntityNotFound(_0x53a58f,null))['then'](removeEntity(_0x53a58f,null))[_0x5c9a('0x43')](handleError(_0x53a58f,null));};exports['getConfigurations']=function(_0x43b896,_0x3d9eab,_0x5642fd){var _0x39d4dc={};var _0x2c3df3={};var _0x1fd0c9;var _0x30b3d9;return db[_0x5c9a('0x2d')][_0x5c9a('0x4a')]({'where':{'id':_0x43b896[_0x5c9a('0x44')]['id']}})[_0x5c9a('0x26')](handleEntityNotFound(_0x3d9eab,null))[_0x5c9a('0x26')](function(_0x4daf35){if(_0x4daf35){_0x1fd0c9=_0x4daf35;_0x2c3df3[_0x5c9a('0x33')]=_[_0x5c9a('0x45')](db['SugarcrmConfiguration'][_0x5c9a('0x2e')]);_0x2c3df3['query']=_['keys'](_0x43b896[_0x5c9a('0x31')]);_0x2c3df3[_0x5c9a('0x3a')]=_[_0x5c9a('0x32')](_0x2c3df3[_0x5c9a('0x33')],_0x2c3df3[_0x5c9a('0x31')]);_0x39d4dc['attributes']=_[_0x5c9a('0x32')](_0x2c3df3[_0x5c9a('0x33')],qs[_0x5c9a('0x35')](_0x43b896['query'][_0x5c9a('0x35')]));_0x39d4dc[_0x5c9a('0x34')]=_0x39d4dc[_0x5c9a('0x34')][_0x5c9a('0x4b')]?_0x39d4dc['attributes']:_0x2c3df3[_0x5c9a('0x33')];_0x39d4dc[_0x5c9a('0x4c')]=qs['sort'](_0x43b896[_0x5c9a('0x31')][_0x5c9a('0x38')]);_0x39d4dc[_0x5c9a('0x39')]=qs[_0x5c9a('0x3a')](_[_0x5c9a('0x3b')](_0x43b896[_0x5c9a('0x31')],_0x2c3df3[_0x5c9a('0x3a')]));if(_0x43b896[_0x5c9a('0x31')][_0x5c9a('0x3c')]){_0x39d4dc['where']=_[_0x5c9a('0x3d')](_0x39d4dc[_0x5c9a('0x39')],{'$or':_[_0x5c9a('0x2c')](_0x39d4dc['attributes'],function(_0x5e8e95){var _0x401a80={};_0x401a80[_0x5e8e95]={'$like':'%'+_0x43b896['query']['filter']+'%'};return _0x401a80;})});}_0x39d4dc=_[_0x5c9a('0x3d')]({},_0x39d4dc,_0x43b896[_0x5c9a('0x46')]);return _0x1fd0c9[_0x5c9a('0x4d')](_0x39d4dc);}})[_0x5c9a('0x26')](function(_0x257bba){if(_0x257bba){_0x30b3d9=_0x257bba['length'];if(!_0x43b896[_0x5c9a('0x31')]['hasOwnProperty'](_0x5c9a('0x37'))){_0x39d4dc[_0x5c9a('0x1e')]=qs[_0x5c9a('0x1e')](_0x43b896[_0x5c9a('0x31')][_0x5c9a('0x1e')]);_0x39d4dc['offset']=qs[_0x5c9a('0x1d')](_0x43b896[_0x5c9a('0x31')]['offset']);}return _0x1fd0c9['getConfigurations'](_0x39d4dc);}})[_0x5c9a('0x26')](function(_0x4b8f6b){if(_0x4b8f6b){return _0x4b8f6b?{'count':_0x30b3d9,'rows':_0x4b8f6b}:null;}})[_0x5c9a('0x26')](respondWithResult(_0x3d9eab,null))[_0x5c9a('0x43')](handleError(_0x3d9eab,null));};exports[_0x5c9a('0x4e')]=function(_0x3cf3d4,_0x5e3cbe,_0x5262f4){if(_0x3cf3d4['body']['id']){delete _0x3cf3d4['body']['id'];}return db[_0x5c9a('0x2d')]['findOne']({'where':{'id':_0x3cf3d4[_0x5c9a('0x44')]['id']}})[_0x5c9a('0x26')](handleEntityNotFound(_0x5e3cbe,null))['then'](function(_0x2fac5f){if(_0x2fac5f){_0x3cf3d4[_0x5c9a('0x49')][_0x5c9a('0x4f')]=_0x2fac5f['id'];_0x3cf3d4[_0x5c9a('0x49')]['Subjects']=integrations[_0x5c9a('0x50')](_0x3cf3d4[_0x5c9a('0x49')]['channel'],_0x3cf3d4[_0x5c9a('0x49')]['type']);_0x3cf3d4[_0x5c9a('0x49')][_0x5c9a('0x51')]=integrations[_0x5c9a('0x52')](_0x3cf3d4[_0x5c9a('0x49')]['channel'],_0x3cf3d4[_0x5c9a('0x49')]['type']);return db['SugarcrmConfiguration'][_0x5c9a('0x48')](_0x3cf3d4['body'],{'include':[{'model':db[_0x5c9a('0x53')],'as':'Subjects'},{'model':db[_0x5c9a('0x53')],'as':_0x5c9a('0x51')}]});}return null;})['then'](respondWithResult(_0x5e3cbe,null))[_0x5c9a('0x43')](handleError(_0x5e3cbe,null));};exports['getFields']=function(_0x42fc46,_0x378e59,_0xec3138){var _0x4477a3='';var _0x27635b=['id',_0x5c9a('0x2a'),'assigned_user_id',_0x5c9a('0x54'),_0x5c9a('0x55'),_0x5c9a('0x56'),_0x5c9a('0x57'),_0x5c9a('0x58'),_0x5c9a('0x59'),'parent_type','parent_name','direction'];return db[_0x5c9a('0x2d')]['findOne']({'where':{'id':_0x42fc46[_0x5c9a('0x44')]['id']},'attributes':['id','username',_0x5c9a('0x5a'),_0x5c9a('0x5b')]})[_0x5c9a('0x26')](handleEntityNotFound(_0x378e59,null))[_0x5c9a('0x26')](function(_0x556b6e){if(_0x556b6e){_0x4477a3=_0x556b6e['remoteUri'];var _0x303cbf=_0x4477a3[_0x5c9a('0x5c')](-0x1);if(_0x303cbf==='/'){_0x4477a3=_0x4477a3[_0x5c9a('0x5d')](0x0,_0x4477a3['lastIndexOf'](_0x303cbf));}return rp({'method':_0x5c9a('0x5e'),'uri':util[_0x5c9a('0x5f')](_0x5c9a('0x60'),_0x4477a3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x5c9a('0x61'),'response_type':_0x5c9a('0x61'),'rest_data':JSON[_0x5c9a('0x62')]({'user_auth':{'user_name':_0x556b6e[_0x5c9a('0x63')],'password':_0x556b6e[_0x5c9a('0x5a')],'encryption':_0x5c9a('0x64')},'application':_0x5c9a('0x65')})}});}})[_0x5c9a('0x26')](function(_0x359d38){if(_0x359d38&&_0x359d38['name']!=='Invalid\x20Login'&&_0x359d38[_0x5c9a('0x2a')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x5c9a('0x5f')](_0x5c9a('0x60'),_0x4477a3,_0x5c9a('0x66')),'json':!![],'form':{'method':_0x5c9a('0x67'),'input_type':_0x5c9a('0x61'),'response_type':_0x5c9a('0x61'),'rest_data':JSON['stringify']({'session':_0x359d38['id'],'module_name':_0x5c9a('0x68')})}})[_0x5c9a('0x26')](function(_0x4ffda0){if(_0x4ffda0){var _0x140203=_[_0x5c9a('0x69')](_0x4ffda0[_0x5c9a('0x6a')]);_['remove'](_0x140203,function(_0x2ebab7){return _0x27635b[_0x5c9a('0x6b')](_0x2ebab7[_0x5c9a('0x2a')]);});return{'count':_0x140203[_0x5c9a('0x4b')],'rows':_['map'](_0x140203,function(_0x390e02){return{'id':_0x390e02[_0x5c9a('0x2a')],'name':_0x390e02[_0x5c9a('0x6c')],'custom':_[_0x5c9a('0x6d')](_0x390e02[_0x5c9a('0x2a')],'_c')?!![]:![],'options':_0x390e02[_0x5c9a('0x46')]?_[_0x5c9a('0x2c')](_[_0x5c9a('0x69')](_0x390e02[_0x5c9a('0x46')]),function(_0x51db37){return{'name':_0x51db37[_0x5c9a('0x6e')],'value':_0x51db37[_0x5c9a('0x2a')]};}):[]};})};}})[_0x5c9a('0x26')](respondWithResult(_0x378e59,null))[_0x5c9a('0x43')](function(_0x318bec){var _0x2d30c9=_0x42fc46['query'][_0x5c9a('0x6f')]?0x1f4:_0x318bec['statusCode']||0x1f4;logger[_0x5c9a('0x70')](_0x5c9a('0x71'),_0x5c9a('0x72'),_0x2d30c9,JSON[_0x5c9a('0x62')](_0x318bec));delete _0x318bec[_0x5c9a('0x2a')];if(_0x2d30c9===0x191){_0x2d30c9=0x190;}_0x378e59[_0x5c9a('0x1a')](_0x2d30c9)[_0x5c9a('0x73')](_0x42fc46['query'][_0x5c9a('0x6f')]?{'message':_0x5c9a('0x74'),'statusCode':_0x318bec[_0x5c9a('0x75')]}:_0x318bec);});}else{var _0x5b9ad9=0x1f4;_0x378e59[_0x5c9a('0x1a')](_0x5b9ad9)[_0x5c9a('0x73')]({'message':_0x5c9a('0x74'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 977c230..0675168 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeaef=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','lodash'];(function(_0x25df99,_0x4c4480){var _0x35b6a6=function(_0x5a14ec){while(--_0x5a14ec){_0x25df99['push'](_0x25df99['shift']());}};_0x35b6a6(++_0x4c4480);}(_0xeaef,0xfb));var _0xfeae=function(_0x3b30ea,_0x28812f){_0x3b30ea=_0x3b30ea-0x0;var _0x2046b2=_0xeaef[_0x3b30ea];return _0x2046b2;};'use strict';var _=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var logger=require(_0xfeae('0x2'))(_0xfeae('0x3'));var moment=require(_0xfeae('0x4'));var BPromise=require(_0xfeae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfeae('0x6'));var rimraf=require(_0xfeae('0x7'));var config=require(_0xfeae('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xfeae('0x9'));module[_0xfeae('0xa')]=function(_0x2ac280,_0x4571f8){return _0x2ac280[_0xfeae('0xb')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x142a=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intSugarcrmAccount.attributes','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x5e0adc,_0x430b66){var _0xb9565b=function(_0x511dc5){while(--_0x511dc5){_0x5e0adc['push'](_0x5e0adc['shift']());}};_0xb9565b(++_0x430b66);}(_0x142a,0x18b));var _0xa142=function(_0x5cc9e4,_0x2d1a8f){_0x5cc9e4=_0x5cc9e4-0x0;var _0x3914df=_0x142a[_0x5cc9e4];return _0x3914df;};'use strict';var _=require(_0xa142('0x0'));var util=require(_0xa142('0x1'));var logger=require(_0xa142('0x2'))(_0xa142('0x3'));var moment=require(_0xa142('0x4'));var BPromise=require('bluebird');var rp=require(_0xa142('0x5'));var fs=require('fs');var path=require(_0xa142('0x6'));var rimraf=require(_0xa142('0x7'));var config=require('../../config/environment');var attributes=require(_0xa142('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3784a1,_0x4857c8){return _0x3784a1[_0xa142('0x9')](_0xa142('0xa'),attributes,{'tableName':_0xa142('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 7890f3c..9c2d52d 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24b1=['error','code','message','result','SugarcrmAccount','findAll','options','raw','attributes','include','map','model','then','GetSugarcrmAccount','debug','catch','ShowSugarcrmAccount','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3ae482,_0xd0ed4f){var _0x10debf=function(_0x417aef){while(--_0x417aef){_0x3ae482['push'](_0x3ae482['shift']());}};_0x10debf(++_0xd0ed4f);}(_0x24b1,0x1ee));var _0x124b=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x24b1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x124b('0x0'));var util=require(_0x124b('0x1'));var moment=require('moment');var BPromise=require(_0x124b('0x2'));var rs=require(_0x124b('0x3'));var fs=require('fs');var Redis=require(_0x124b('0x4'));var db=require(_0x124b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x124b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x124b('0x7'));var client=jayson[_0x124b('0x8')][_0x124b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15e9e8,_0x253ef7,_0x2c86f0){return new BPromise(function(_0x1a432e,_0x2243c9){return client[_0x124b('0xa')](_0x15e9e8,_0x2c86f0)['then'](function(_0x30cb3e){logger[_0x124b('0xb')](_0x124b('0xc'),_0x253ef7,'request\x20sent');logger['debug'](_0x124b('0xd'),_0x253ef7,_0x124b('0xe'),JSON[_0x124b('0xf')](_0x30cb3e));if(_0x30cb3e[_0x124b('0x10')]){if(_0x30cb3e[_0x124b('0x10')][_0x124b('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x253ef7,_0x30cb3e[_0x124b('0x10')][_0x124b('0x12')]);return _0x2243c9(_0x30cb3e[_0x124b('0x10')][_0x124b('0x12')]);}logger[_0x124b('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x253ef7,_0x30cb3e[_0x124b('0x10')][_0x124b('0x12')]);return _0x1a432e(_0x30cb3e[_0x124b('0x10')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x253ef7,_0x124b('0xe'));_0x1a432e(_0x30cb3e[_0x124b('0x13')][_0x124b('0x12')]);}})['catch'](function(_0x5eb4b8){logger[_0x124b('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x253ef7,_0x5eb4b8);_0x2243c9(_0x5eb4b8);});});}exports['GetSugarcrmAccount']=function(_0x205238){var _0x39d33e=this;return new Promise(function(_0x12e423,_0x57d20f){return db[_0x124b('0x14')][_0x124b('0x15')]({'raw':_0x205238[_0x124b('0x16')]?_0x205238[_0x124b('0x16')][_0x124b('0x17')]===undefined?!![]:![]:!![],'where':_0x205238[_0x124b('0x16')]?_0x205238[_0x124b('0x16')]['where']||null:null,'attributes':_0x205238['options']?_0x205238['options'][_0x124b('0x18')]||null:null,'limit':_0x205238[_0x124b('0x16')]?_0x205238['options']['limit']||null:null,'include':_0x205238[_0x124b('0x16')]?_0x205238[_0x124b('0x16')][_0x124b('0x19')]?_[_0x124b('0x1a')](_0x205238['options'][_0x124b('0x19')],function(_0x1ffbbe){return{'model':db[_0x1ffbbe[_0x124b('0x1b')]],'as':_0x1ffbbe['as'],'attributes':_0x1ffbbe[_0x124b('0x18')],'include':_0x1ffbbe[_0x124b('0x19')]?_[_0x124b('0x1a')](_0x1ffbbe[_0x124b('0x19')],function(_0x55a12f){return{'model':db[_0x55a12f[_0x124b('0x1b')]],'as':_0x55a12f['as'],'attributes':_0x55a12f['attributes'],'include':_0x55a12f[_0x124b('0x19')]?_[_0x124b('0x1a')](_0x55a12f[_0x124b('0x19')],function(_0x416112){return{'model':db[_0x416112[_0x124b('0x1b')]],'as':_0x416112['as'],'attributes':_0x416112[_0x124b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x124b('0x1c')](function(_0x3a2b32){logger[_0x124b('0xb')](_0x124b('0x1d'),_0x205238);logger[_0x124b('0x1e')]('GetSugarcrmAccount',_0x205238,JSON[_0x124b('0xf')](_0x3a2b32));_0x12e423(_0x3a2b32);})[_0x124b('0x1f')](function(_0x45b05c){logger[_0x124b('0x10')]('GetSugarcrmAccount',_0x45b05c[_0x124b('0x12')],_0x205238);_0x57d20f(_0x39d33e[_0x124b('0x10')](0x1f4,_0x45b05c[_0x124b('0x12')]));});});};exports[_0x124b('0x20')]=function(_0x3eed32){var _0x260da3=this;return new Promise(function(_0xea4638,_0x1c2756){return db[_0x124b('0x14')]['find']({'raw':_0x3eed32['options']?_0x3eed32[_0x124b('0x16')][_0x124b('0x17')]===undefined?!![]:![]:!![],'where':_0x3eed32[_0x124b('0x16')]?_0x3eed32[_0x124b('0x16')][_0x124b('0x21')]||null:null,'attributes':_0x3eed32[_0x124b('0x16')]?_0x3eed32[_0x124b('0x16')][_0x124b('0x18')]||null:null,'include':_0x3eed32[_0x124b('0x16')]?_0x3eed32[_0x124b('0x16')][_0x124b('0x19')]?_[_0x124b('0x1a')](_0x3eed32[_0x124b('0x16')][_0x124b('0x19')],function(_0x119149){return{'model':db[_0x119149['model']],'as':_0x119149['as'],'attributes':_0x119149[_0x124b('0x18')],'include':_0x119149['include']?_[_0x124b('0x1a')](_0x119149[_0x124b('0x19')],function(_0x28ca4b){return{'model':db[_0x28ca4b[_0x124b('0x1b')]],'as':_0x28ca4b['as'],'attributes':_0x28ca4b['attributes'],'include':_0x28ca4b[_0x124b('0x19')]?_[_0x124b('0x1a')](_0x28ca4b[_0x124b('0x19')],function(_0x438a87){return{'model':db[_0x438a87[_0x124b('0x1b')]],'as':_0x438a87['as'],'attributes':_0x438a87[_0x124b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x124b('0x1c')](function(_0x3910f9){logger[_0x124b('0xb')]('ShowSugarcrmAccount',_0x3eed32);logger[_0x124b('0x1e')](_0x124b('0x20'),_0x3eed32,JSON[_0x124b('0xf')](_0x3910f9));_0xea4638(_0x3910f9);})[_0x124b('0x1f')](function(_0x161635){logger[_0x124b('0x10')](_0x124b('0x20'),_0x161635[_0x124b('0x12')],_0x3eed32);_0x1c2756(_0x260da3['error'](0x1f4,_0x161635['message']));});});}; \ No newline at end of file +var _0x7719=['SugarcrmAccount','options','raw','attributes','include','map','model','find','where','ShowSugarcrmAccount','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x7719,0xa5));var _0x9771=function(_0x3268bb,_0x4ca217){_0x3268bb=_0x3268bb-0x0;var _0xe835=_0x7719[_0x3268bb];return _0xe835;};'use strict';var _=require('lodash');var util=require(_0x9771('0x0'));var moment=require(_0x9771('0x1'));var BPromise=require(_0x9771('0x2'));var rs=require(_0x9771('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9771('0x4'));var logger=require('../../config/logger')(_0x9771('0x5'));var config=require(_0x9771('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9771('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ace58,_0x3396ee,_0x20647f){return new BPromise(function(_0x3b08fc,_0x518b13){return client['request'](_0x1ace58,_0x20647f)[_0x9771('0x8')](function(_0x1101e5){logger[_0x9771('0x9')](_0x9771('0xa'),_0x3396ee,_0x9771('0xb'));logger[_0x9771('0xc')](_0x9771('0xd'),_0x3396ee,_0x9771('0xb'),JSON[_0x9771('0xe')](_0x1101e5));if(_0x1101e5[_0x9771('0xf')]){if(_0x1101e5[_0x9771('0xf')][_0x9771('0x10')]===0x1f4){logger[_0x9771('0xf')](_0x9771('0xa'),_0x3396ee,_0x1101e5['error']['message']);return _0x518b13(_0x1101e5[_0x9771('0xf')][_0x9771('0x11')]);}logger[_0x9771('0xf')](_0x9771('0xa'),_0x3396ee,_0x1101e5[_0x9771('0xf')][_0x9771('0x11')]);return _0x3b08fc(_0x1101e5[_0x9771('0xf')][_0x9771('0x11')]);}else{logger[_0x9771('0x9')](_0x9771('0xa'),_0x3396ee,'request\x20sent');_0x3b08fc(_0x1101e5[_0x9771('0x12')][_0x9771('0x11')]);}})[_0x9771('0x13')](function(_0xa23734){logger[_0x9771('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x3396ee,_0xa23734);_0x518b13(_0xa23734);});});}exports[_0x9771('0x14')]=function(_0x10d3d0){var _0x5c23d8=this;return new Promise(function(_0x13acf8,_0x3d292c){return db[_0x9771('0x15')]['findAll']({'raw':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0[_0x9771('0x16')][_0x9771('0x17')]===undefined?!![]:![]:!![],'where':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0[_0x9771('0x16')]['where']||null:null,'attributes':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0['options'][_0x9771('0x18')]||null:null,'limit':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0['options']['limit']||null:null,'include':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0[_0x9771('0x16')][_0x9771('0x19')]?_[_0x9771('0x1a')](_0x10d3d0[_0x9771('0x16')]['include'],function(_0x1fe053){return{'model':db[_0x1fe053[_0x9771('0x1b')]],'as':_0x1fe053['as'],'attributes':_0x1fe053[_0x9771('0x18')],'include':_0x1fe053[_0x9771('0x19')]?_[_0x9771('0x1a')](_0x1fe053[_0x9771('0x19')],function(_0x143419){return{'model':db[_0x143419[_0x9771('0x1b')]],'as':_0x143419['as'],'attributes':_0x143419[_0x9771('0x18')],'include':_0x143419[_0x9771('0x19')]?_['map'](_0x143419[_0x9771('0x19')],function(_0x525ac){return{'model':db[_0x525ac[_0x9771('0x1b')]],'as':_0x525ac['as'],'attributes':_0x525ac[_0x9771('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9771('0x8')](function(_0xd617c8){logger[_0x9771('0x9')](_0x9771('0x14'),_0x10d3d0);logger['debug'](_0x9771('0x14'),_0x10d3d0,JSON[_0x9771('0xe')](_0xd617c8));_0x13acf8(_0xd617c8);})[_0x9771('0x13')](function(_0x352231){logger[_0x9771('0xf')](_0x9771('0x14'),_0x352231['message'],_0x10d3d0);_0x3d292c(_0x5c23d8[_0x9771('0xf')](0x1f4,_0x352231[_0x9771('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x559e22){var _0x5b795f=this;return new Promise(function(_0x43eb10,_0x2ddc75){return db[_0x9771('0x15')][_0x9771('0x1c')]({'raw':_0x559e22[_0x9771('0x16')]?_0x559e22[_0x9771('0x16')][_0x9771('0x17')]===undefined?!![]:![]:!![],'where':_0x559e22['options']?_0x559e22[_0x9771('0x16')][_0x9771('0x1d')]||null:null,'attributes':_0x559e22[_0x9771('0x16')]?_0x559e22[_0x9771('0x16')][_0x9771('0x18')]||null:null,'include':_0x559e22[_0x9771('0x16')]?_0x559e22[_0x9771('0x16')]['include']?_[_0x9771('0x1a')](_0x559e22[_0x9771('0x16')][_0x9771('0x19')],function(_0x2dc373){return{'model':db[_0x2dc373[_0x9771('0x1b')]],'as':_0x2dc373['as'],'attributes':_0x2dc373[_0x9771('0x18')],'include':_0x2dc373[_0x9771('0x19')]?_[_0x9771('0x1a')](_0x2dc373[_0x9771('0x19')],function(_0x26d5cb){return{'model':db[_0x26d5cb[_0x9771('0x1b')]],'as':_0x26d5cb['as'],'attributes':_0x26d5cb[_0x9771('0x18')],'include':_0x26d5cb[_0x9771('0x19')]?_[_0x9771('0x1a')](_0x26d5cb[_0x9771('0x19')],function(_0x402a81){return{'model':db[_0x402a81[_0x9771('0x1b')]],'as':_0x402a81['as'],'attributes':_0x402a81[_0x9771('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9771('0x8')](function(_0x153bf2){logger[_0x9771('0x9')](_0x9771('0x1e'),_0x559e22);logger['debug']('ShowSugarcrmAccount',_0x559e22,JSON[_0x9771('0xe')](_0x153bf2));_0x43eb10(_0x153bf2);})[_0x9771('0x13')](function(_0x1cd310){logger['error'](_0x9771('0x1e'),_0x1cd310[_0x9771('0x11')],_0x559e22);_0x2ddc75(_0x5b795f['error'](0x1f4,_0x1cd310[_0x9771('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4191e8d..584a7cc 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x384b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/descriptions','post','put','update','delete','destroy','exports'];(function(_0x4ac2ce,_0x55d1ec){var _0x3d10e1=function(_0x413aca){while(--_0x413aca){_0x4ac2ce['push'](_0x4ac2ce['shift']());}};_0x3d10e1(++_0x55d1ec);}(_0x384b,0x108));var _0xb384=function(_0x2d2672,_0x446e75){_0x2d2672=_0x2d2672-0x0;var _0x51f3ad=_0x384b[_0x2d2672];return _0x51f3ad;};'use strict';var multer=require(_0xb384('0x0'));var util=require(_0xb384('0x1'));var path=require(_0xb384('0x2'));var timeout=require(_0xb384('0x3'));var express=require(_0xb384('0x4'));var router=express[_0xb384('0x5')]();var fs_extra=require(_0xb384('0x6'));var auth=require(_0xb384('0x7'));var interaction=require(_0xb384('0x8'));var config=require(_0xb384('0x9'));var controller=require(_0xb384('0xa'));router['get']('/',auth[_0xb384('0xb')](),controller[_0xb384('0xc')]);router[_0xb384('0xd')](_0xb384('0xe'),auth[_0xb384('0xb')](),controller[_0xb384('0xf')]);router['get']('/:id/fields',auth[_0xb384('0xb')](),controller[_0xb384('0x10')]);router[_0xb384('0xd')]('/:id/subjects',auth[_0xb384('0xb')](),controller['getSubjects']);router[_0xb384('0xd')](_0xb384('0x11'),auth[_0xb384('0xb')](),controller['getDescriptions']);router[_0xb384('0x12')]('/',auth[_0xb384('0xb')](),controller['create']);router[_0xb384('0x13')](_0xb384('0xe'),auth[_0xb384('0xb')](),controller[_0xb384('0x14')]);router[_0xb384('0x15')]('/:id',auth[_0xb384('0xb')](),controller[_0xb384('0x16')]);module[_0xb384('0x17')]=router; \ No newline at end of file +var _0x3dac=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x3dac,0x1ad));var _0xc3da=function(_0x174774,_0x295daf){_0x174774=_0x174774-0x0;var _0x465a72=_0x3dac[_0x174774];return _0x465a72;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3da('0x0'));var timeout=require(_0xc3da('0x1'));var express=require(_0xc3da('0x2'));var router=express[_0xc3da('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc3da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc3da('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xc3da('0x6')]('/',auth[_0xc3da('0x7')](),controller[_0xc3da('0x8')]);router[_0xc3da('0x6')]('/:id',auth[_0xc3da('0x7')](),controller[_0xc3da('0x9')]);router[_0xc3da('0x6')](_0xc3da('0xa'),auth['isAuthenticated'](),controller[_0xc3da('0xb')]);router['get'](_0xc3da('0xc'),auth[_0xc3da('0x7')](),controller[_0xc3da('0xd')]);router[_0xc3da('0x6')](_0xc3da('0xe'),auth[_0xc3da('0x7')](),controller[_0xc3da('0xf')]);router[_0xc3da('0x10')]('/',auth['isAuthenticated'](),controller[_0xc3da('0x11')]);router[_0xc3da('0x12')]('/:id',auth[_0xc3da('0x7')](),controller[_0xc3da('0x13')]);router['delete'](_0xc3da('0x14'),auth[_0xc3da('0x7')](),controller['destroy']);module[_0xc3da('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 0f3bd27..1a12c95 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf764=['sequelize','STRING'];(function(_0x4d37da,_0x27e2fc){var _0x8441b6=function(_0x31418a){while(--_0x31418a){_0x4d37da['push'](_0x4d37da['shift']());}};_0x8441b6(++_0x27e2fc);}(_0xf764,0xbc));var _0x4f76=function(_0x39395d,_0x2fb2cb){_0x39395d=_0x39395d-0x0;var _0x56e629=_0xf764[_0x39395d];return _0x56e629;};'use strict';var Sequelize=require(_0x4f76('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f76('0x1')]},'description':{'type':Sequelize[_0x4f76('0x1')]}}; \ No newline at end of file +var _0x4cda=['STRING','sequelize','exports'];(function(_0x26248b,_0xc0cd2b){var _0x2810a2=function(_0x4326d1){while(--_0x4326d1){_0x26248b['push'](_0x26248b['shift']());}};_0x2810a2(++_0xc0cd2b);}(_0x4cda,0x172));var _0xa4cd=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x4cda[_0x329664];return _0x4e346e;};'use strict';var Sequelize=require(_0xa4cd('0x0'));module[_0xa4cd('0x1')]={'name':{'type':Sequelize[_0xa4cd('0x2')]},'description':{'type':Sequelize[_0xa4cd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 1cf6534..e5e3aa1 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfabe=['limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','SugarcrmConfiguration','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','find','findOne','SugarcrmField','order','pick','options','getFields','getSubjects','getDescriptions','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count'];(function(_0x19a421,_0x3804d6){var _0x1b93f1=function(_0x55ea46){while(--_0x55ea46){_0x19a421['push'](_0x19a421['shift']());}};_0x1b93f1(++_0x3804d6);}(_0xfabe,0x12a));var _0xefab=function(_0xb73b18,_0x35a457){_0xb73b18=_0xb73b18-0x0;var _0x2fe43b=_0xfabe[_0xb73b18];return _0x2fe43b;};'use strict';var emlformat=require(_0xefab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefab('0x2'));var BPromise=require(_0xefab('0x3'));var Mustache=require('mustache');var util=require(_0xefab('0x4'));var path=require(_0xefab('0x5'));var sox=require(_0xefab('0x6'));var csv=require(_0xefab('0x7'));var ejs=require(_0xefab('0x8'));var fs=require('fs');var fs_extra=require(_0xefab('0x9'));var _=require(_0xefab('0xa'));var squel=require('squel');var crypto=require(_0xefab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xefab('0xc'));var toCsv=require(_0xefab('0x7'));var querystring=require(_0xefab('0xd'));var Papa=require(_0xefab('0xe'));var Redis=require(_0xefab('0xf'));var authService=require(_0xefab('0x10'));var qs=require(_0xefab('0x11'));var as=require(_0xefab('0x12'));var hardwareService=require(_0xefab('0x13'));var logger=require(_0xefab('0x14'))(_0xefab('0x15'));var utils=require('../../config/utils');var config=require(_0xefab('0x16'));var licenseUtil=require(_0xefab('0x17'));var db=require(_0xefab('0x18'))['db'];function respondWithStatusCode(_0x12b4bc,_0x291057){_0x291057=_0x291057||0xcc;return function(_0x5d3660){if(_0x5d3660){return _0x12b4bc[_0xefab('0x19')](_0x291057);}return _0x12b4bc[_0xefab('0x1a')](_0x291057)['end']();};}function respondWithResult(_0xfb4cc5,_0x111037){_0x111037=_0x111037||0xc8;return function(_0xdeadc){if(_0xdeadc){return _0xfb4cc5[_0xefab('0x1a')](_0x111037)['json'](_0xdeadc);}};}function respondWithFilteredResult(_0x19357a,_0x5878f3){return function(_0x466c83){if(_0x466c83){var _0x447af0=typeof _0x5878f3[_0xefab('0x1b')]===_0xefab('0x1c')&&typeof _0x5878f3['limit']===_0xefab('0x1c');var _0x1ec7c3=_0x466c83[_0xefab('0x1d')];var _0x515968=_0x447af0?0x0:_0x5878f3[_0xefab('0x1b')];var _0x4693d0=_0x447af0?_0x466c83[_0xefab('0x1d')]:_0x5878f3[_0xefab('0x1b')]+_0x5878f3[_0xefab('0x1e')];var _0x1f3cc6;if(_0x4693d0>=_0x1ec7c3){_0x4693d0=_0x1ec7c3;_0x1f3cc6=0xc8;}else{_0x1f3cc6=0xce;}_0x19357a[_0xefab('0x1a')](_0x1f3cc6);return _0x19357a[_0xefab('0x1f')](_0xefab('0x20'),_0x515968+'-'+_0x4693d0+'/'+_0x1ec7c3)[_0xefab('0x21')](_0x466c83);}return null;};}function patchUpdates(_0x18f97d){return function(_0x495764){try{jsonpatch[_0xefab('0x22')](_0x495764,_0x18f97d,!![]);}catch(_0x129aaa){return BPromise[_0xefab('0x23')](_0x129aaa);}return _0x495764[_0xefab('0x24')]();};}function saveUpdates(_0x48af42,_0x4e87b7){return function(_0x4750fd){if(_0x4750fd){return _0x4750fd[_0xefab('0x25')](_0x48af42)['then'](function(_0xbdc84f){return _0xbdc84f;});}return null;};}function removeEntity(_0x401a83,_0x2337aa){return function(_0x294790){if(_0x294790){return _0x294790[_0xefab('0x26')]()[_0xefab('0x27')](function(){_0x401a83[_0xefab('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb2b7,_0x2d1570){return function(_0x2e6077){if(!_0x2e6077){_0x1fb2b7[_0xefab('0x19')](0x194);}return _0x2e6077;};}function handleError(_0x14b37f,_0x5f4a9d){_0x5f4a9d=_0x5f4a9d||0x1f4;return function(_0x2a085b){logger[_0xefab('0x28')](_0x2a085b[_0xefab('0x29')]);if(_0x2a085b[_0xefab('0x2a')]){delete _0x2a085b[_0xefab('0x2a')];}_0x14b37f[_0xefab('0x1a')](_0x5f4a9d)['send'](_0x2a085b);};}exports[_0xefab('0x2b')]=function(_0x9c217b,_0x3b7158){var _0x5b56cd={},_0x5c89fd={},_0x43b268={'count':0x0,'rows':[]};var _0x1f8940=_['map'](db[_0xefab('0x2c')]['rawAttributes'],function(_0x33cf05){return{'name':_0x33cf05[_0xefab('0x2d')],'type':_0x33cf05['type'][_0xefab('0x2e')]};});_0x5c89fd[_0xefab('0x2f')]=_[_0xefab('0x30')](_0x1f8940,_0xefab('0x2a'));_0x5c89fd[_0xefab('0x31')]=_['keys'](_0x9c217b[_0xefab('0x31')]);_0x5c89fd['filters']=_[_0xefab('0x32')](_0x5c89fd[_0xefab('0x2f')],_0x5c89fd[_0xefab('0x31')]);_0x5b56cd[_0xefab('0x33')]=_[_0xefab('0x32')](_0x5c89fd[_0xefab('0x2f')],qs[_0xefab('0x34')](_0x9c217b['query'][_0xefab('0x34')]));_0x5b56cd[_0xefab('0x33')]=_0x5b56cd['attributes'][_0xefab('0x35')]?_0x5b56cd[_0xefab('0x33')]:_0x5c89fd['model'];if(!_0x9c217b[_0xefab('0x31')][_0xefab('0x36')](_0xefab('0x37'))){_0x5b56cd['limit']=qs['limit'](_0x9c217b[_0xefab('0x31')][_0xefab('0x1e')]);_0x5b56cd[_0xefab('0x1b')]=qs[_0xefab('0x1b')](_0x9c217b[_0xefab('0x31')]['offset']);}_0x5b56cd['order']=qs[_0xefab('0x38')](_0x9c217b[_0xefab('0x31')][_0xefab('0x38')]);_0x5b56cd[_0xefab('0x39')]=qs['filters'](_['pick'](_0x9c217b[_0xefab('0x31')],_0x5c89fd[_0xefab('0x3a')]),_0x1f8940);if(_0x9c217b['query'][_0xefab('0x3b')]){_0x5b56cd[_0xefab('0x39')]=_['merge'](_0x5b56cd[_0xefab('0x39')],{'$or':_[_0xefab('0x30')](_0x1f8940,function(_0x2a50d6){if(_0x2a50d6[_0xefab('0x3c')]!==_0xefab('0x3d')){var _0x56e9be={};_0x56e9be[_0x2a50d6[_0xefab('0x2a')]]={'$like':'%'+_0x9c217b['query'][_0xefab('0x3b')]+'%'};return _0x56e9be;}})});}_0x5b56cd=_[_0xefab('0x3e')]({},_0x5b56cd,_0x9c217b['options']);var _0x3acfcd={'where':_0x5b56cd[_0xefab('0x39')]};return db['SugarcrmConfiguration']['count'](_0x3acfcd)[_0xefab('0x27')](function(_0x49a700){_0x43b268['count']=_0x49a700;if(_0x9c217b[_0xefab('0x31')]['includeAll']){_0x5b56cd['include']=[{'all':!![]}];}return db[_0xefab('0x2c')][_0xefab('0x3f')](_0x5b56cd);})['then'](function(_0x3747d0){_0x43b268[_0xefab('0x40')]=_0x3747d0;return _0x43b268;})[_0xefab('0x27')](respondWithFilteredResult(_0x3b7158,_0x5b56cd))[_0xefab('0x41')](handleError(_0x3b7158,null));};exports[_0xefab('0x42')]=function(_0x3a780e,_0x4bb020){var _0xc55a4={'raw':![],'where':{'id':_0x3a780e[_0xefab('0x43')]['id']}},_0x19e6bf={};_0x19e6bf[_0xefab('0x2f')]=_[_0xefab('0x44')](db['SugarcrmConfiguration'][_0xefab('0x45')]);_0x19e6bf[_0xefab('0x31')]=_[_0xefab('0x44')](_0x3a780e[_0xefab('0x31')]);_0x19e6bf[_0xefab('0x3a')]=_[_0xefab('0x32')](_0x19e6bf[_0xefab('0x2f')],_0x19e6bf[_0xefab('0x31')]);_0xc55a4[_0xefab('0x33')]=_[_0xefab('0x32')](_0x19e6bf[_0xefab('0x2f')],qs[_0xefab('0x34')](_0x3a780e[_0xefab('0x31')][_0xefab('0x34')]));_0xc55a4['attributes']=_0xc55a4[_0xefab('0x33')][_0xefab('0x35')]?_0xc55a4[_0xefab('0x33')]:_0x19e6bf['model'];if(_0x3a780e['query']['includeAll']){_0xc55a4[_0xefab('0x46')]=[{'all':!![]}];}_0xc55a4=_[_0xefab('0x3e')]({},_0xc55a4,_0x3a780e['options']);return db[_0xefab('0x2c')]['find'](_0xc55a4)[_0xefab('0x27')](handleEntityNotFound(_0x4bb020,null))[_0xefab('0x27')](respondWithResult(_0x4bb020,null))[_0xefab('0x41')](handleError(_0x4bb020,null));};exports[_0xefab('0x47')]=function(_0x1d2071,_0x332772){return db[_0xefab('0x2c')][_0xefab('0x47')](_0x1d2071[_0xefab('0x48')],{})[_0xefab('0x27')](respondWithResult(_0x332772,0xc9))['catch'](handleError(_0x332772,null));};exports[_0xefab('0x25')]=function(_0x5eda35,_0x39ff77){if(_0x5eda35[_0xefab('0x48')]['id']){delete _0x5eda35[_0xefab('0x48')]['id'];}return db[_0xefab('0x2c')][_0xefab('0x49')]({'where':{'id':_0x5eda35[_0xefab('0x43')]['id']}})[_0xefab('0x27')](handleEntityNotFound(_0x39ff77,null))[_0xefab('0x27')](saveUpdates(_0x5eda35[_0xefab('0x48')],null))['then'](respondWithResult(_0x39ff77,null))[_0xefab('0x41')](handleError(_0x39ff77,null));};exports[_0xefab('0x26')]=function(_0x2f7a52,_0x3d1fb0){return db[_0xefab('0x2c')]['find']({'where':{'id':_0x2f7a52['params']['id']}})['then'](handleEntityNotFound(_0x3d1fb0,null))['then'](removeEntity(_0x3d1fb0,null))['catch'](handleError(_0x3d1fb0,null));};exports['getFields']=function(_0x4eac8,_0x2e2b9d,_0x527bc0){var _0x335607={};var _0x33d8db={};var _0xda664e;var _0x512ed0;return db[_0xefab('0x2c')][_0xefab('0x4a')]({'where':{'id':_0x4eac8[_0xefab('0x43')]['id']}})[_0xefab('0x27')](handleEntityNotFound(_0x2e2b9d,null))[_0xefab('0x27')](function(_0x3d9db1){if(_0x3d9db1){_0xda664e=_0x3d9db1;_0x33d8db[_0xefab('0x2f')]=_[_0xefab('0x44')](db[_0xefab('0x4b')][_0xefab('0x45')]);_0x33d8db[_0xefab('0x31')]=_[_0xefab('0x44')](_0x4eac8[_0xefab('0x31')]);_0x33d8db[_0xefab('0x3a')]=_['intersection'](_0x33d8db[_0xefab('0x2f')],_0x33d8db[_0xefab('0x31')]);_0x335607[_0xefab('0x33')]=_['intersection'](_0x33d8db['model'],qs[_0xefab('0x34')](_0x4eac8[_0xefab('0x31')]['fields']));_0x335607[_0xefab('0x33')]=_0x335607['attributes'][_0xefab('0x35')]?_0x335607[_0xefab('0x33')]:_0x33d8db['model'];_0x335607[_0xefab('0x4c')]=qs[_0xefab('0x38')](_0x4eac8['query'][_0xefab('0x38')]);_0x335607[_0xefab('0x39')]=qs[_0xefab('0x3a')](_[_0xefab('0x4d')](_0x4eac8['query'],_0x33d8db[_0xefab('0x3a')]));if(_0x4eac8[_0xefab('0x31')]['filter']){_0x335607[_0xefab('0x39')]=_[_0xefab('0x3e')](_0x335607[_0xefab('0x39')],{'$or':_[_0xefab('0x30')](_0x335607[_0xefab('0x33')],function(_0x3f96a5){var _0x5b3011={};_0x5b3011[_0x3f96a5]={'$like':'%'+_0x4eac8['query'][_0xefab('0x3b')]+'%'};return _0x5b3011;})});}_0x335607=_[_0xefab('0x3e')]({},_0x335607,_0x4eac8[_0xefab('0x4e')]);return _0xda664e[_0xefab('0x4f')](_0x335607);}})[_0xefab('0x27')](function(_0x5f07c6){if(_0x5f07c6){_0x512ed0=_0x5f07c6[_0xefab('0x35')];if(!_0x4eac8[_0xefab('0x31')][_0xefab('0x36')](_0xefab('0x37'))){_0x335607['limit']=qs[_0xefab('0x1e')](_0x4eac8['query'][_0xefab('0x1e')]);_0x335607[_0xefab('0x1b')]=qs['offset'](_0x4eac8[_0xefab('0x31')][_0xefab('0x1b')]);}return _0xda664e['getFields'](_0x335607);}})['then'](function(_0x2edf48){if(_0x2edf48){return _0x2edf48?{'count':_0x512ed0,'rows':_0x2edf48}:null;}})['then'](respondWithResult(_0x2e2b9d,null))[_0xefab('0x41')](handleError(_0x2e2b9d,null));};exports[_0xefab('0x50')]=function(_0x36e45d,_0x4367e8,_0x53507e){var _0x1fa33e={};var _0x486dc9={};var _0x5941df;var _0x129efc;return db['SugarcrmConfiguration'][_0xefab('0x4a')]({'where':{'id':_0x36e45d[_0xefab('0x43')]['id']}})[_0xefab('0x27')](handleEntityNotFound(_0x4367e8,null))[_0xefab('0x27')](function(_0x5b1bfd){if(_0x5b1bfd){_0x5941df=_0x5b1bfd;_0x486dc9[_0xefab('0x2f')]=_['keys'](db[_0xefab('0x4b')][_0xefab('0x45')]);_0x486dc9[_0xefab('0x31')]=_[_0xefab('0x44')](_0x36e45d[_0xefab('0x31')]);_0x486dc9['filters']=_[_0xefab('0x32')](_0x486dc9[_0xefab('0x2f')],_0x486dc9[_0xefab('0x31')]);_0x1fa33e[_0xefab('0x33')]=_['intersection'](_0x486dc9[_0xefab('0x2f')],qs[_0xefab('0x34')](_0x36e45d[_0xefab('0x31')]['fields']));_0x1fa33e[_0xefab('0x33')]=_0x1fa33e[_0xefab('0x33')][_0xefab('0x35')]?_0x1fa33e[_0xefab('0x33')]:_0x486dc9[_0xefab('0x2f')];_0x1fa33e[_0xefab('0x4c')]=qs[_0xefab('0x38')](_0x36e45d['query']['sort']);_0x1fa33e[_0xefab('0x39')]=qs[_0xefab('0x3a')](_[_0xefab('0x4d')](_0x36e45d[_0xefab('0x31')],_0x486dc9[_0xefab('0x3a')]));if(_0x36e45d['query'][_0xefab('0x3b')]){_0x1fa33e[_0xefab('0x39')]=_[_0xefab('0x3e')](_0x1fa33e[_0xefab('0x39')],{'$or':_['map'](_0x1fa33e['attributes'],function(_0x6d2e35){var _0x4a6077={};_0x4a6077[_0x6d2e35]={'$like':'%'+_0x36e45d['query'][_0xefab('0x3b')]+'%'};return _0x4a6077;})});}_0x1fa33e=_[_0xefab('0x3e')]({},_0x1fa33e,_0x36e45d[_0xefab('0x4e')]);return _0x5941df[_0xefab('0x50')](_0x1fa33e);}})['then'](function(_0x5f4f54){if(_0x5f4f54){_0x129efc=_0x5f4f54[_0xefab('0x35')];if(!_0x36e45d['query'][_0xefab('0x36')](_0xefab('0x37'))){_0x1fa33e[_0xefab('0x1e')]=qs[_0xefab('0x1e')](_0x36e45d[_0xefab('0x31')]['limit']);_0x1fa33e[_0xefab('0x1b')]=qs[_0xefab('0x1b')](_0x36e45d[_0xefab('0x31')][_0xefab('0x1b')]);}return _0x5941df[_0xefab('0x50')](_0x1fa33e);}})[_0xefab('0x27')](function(_0x4739b2){if(_0x4739b2){return _0x4739b2?{'count':_0x129efc,'rows':_0x4739b2}:null;}})[_0xefab('0x27')](respondWithResult(_0x4367e8,null))[_0xefab('0x41')](handleError(_0x4367e8,null));};exports['getDescriptions']=function(_0xb523fa,_0x11266c,_0x1f9370){var _0x486fae={};var _0x443822={};var _0x202a19;var _0x4ab634;return db['SugarcrmConfiguration'][_0xefab('0x4a')]({'where':{'id':_0xb523fa[_0xefab('0x43')]['id']}})[_0xefab('0x27')](handleEntityNotFound(_0x11266c,null))[_0xefab('0x27')](function(_0x4e503c){if(_0x4e503c){_0x202a19=_0x4e503c;_0x443822['model']=_[_0xefab('0x44')](db[_0xefab('0x4b')][_0xefab('0x45')]);_0x443822[_0xefab('0x31')]=_[_0xefab('0x44')](_0xb523fa[_0xefab('0x31')]);_0x443822[_0xefab('0x3a')]=_['intersection'](_0x443822[_0xefab('0x2f')],_0x443822[_0xefab('0x31')]);_0x486fae[_0xefab('0x33')]=_[_0xefab('0x32')](_0x443822[_0xefab('0x2f')],qs[_0xefab('0x34')](_0xb523fa['query'][_0xefab('0x34')]));_0x486fae[_0xefab('0x33')]=_0x486fae['attributes'][_0xefab('0x35')]?_0x486fae[_0xefab('0x33')]:_0x443822[_0xefab('0x2f')];_0x486fae[_0xefab('0x4c')]=qs[_0xefab('0x38')](_0xb523fa[_0xefab('0x31')][_0xefab('0x38')]);_0x486fae[_0xefab('0x39')]=qs['filters'](_['pick'](_0xb523fa[_0xefab('0x31')],_0x443822[_0xefab('0x3a')]));if(_0xb523fa['query']['filter']){_0x486fae[_0xefab('0x39')]=_[_0xefab('0x3e')](_0x486fae['where'],{'$or':_[_0xefab('0x30')](_0x486fae['attributes'],function(_0x502e57){var _0x5d209c={};_0x5d209c[_0x502e57]={'$like':'%'+_0xb523fa['query'][_0xefab('0x3b')]+'%'};return _0x5d209c;})});}_0x486fae=_[_0xefab('0x3e')]({},_0x486fae,_0xb523fa[_0xefab('0x4e')]);return _0x202a19[_0xefab('0x51')](_0x486fae);}})[_0xefab('0x27')](function(_0x27bdfe){if(_0x27bdfe){_0x4ab634=_0x27bdfe[_0xefab('0x35')];if(!_0xb523fa['query'][_0xefab('0x36')](_0xefab('0x37'))){_0x486fae[_0xefab('0x1e')]=qs[_0xefab('0x1e')](_0xb523fa[_0xefab('0x31')][_0xefab('0x1e')]);_0x486fae[_0xefab('0x1b')]=qs[_0xefab('0x1b')](_0xb523fa[_0xefab('0x31')][_0xefab('0x1b')]);}return _0x202a19['getDescriptions'](_0x486fae);}})[_0xefab('0x27')](function(_0x31dfb7){if(_0x31dfb7){return _0x31dfb7?{'count':_0x4ab634,'rows':_0x31dfb7}:null;}})[_0xefab('0x27')](respondWithResult(_0x11266c,null))[_0xefab('0x41')](handleError(_0x11266c,null));}; \ No newline at end of file +var _0x012e=['name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','getFields','findOne','nolimit','getSubjects','SugarcrmField','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x012e,0x112));var _0xe012=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x012e[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe012('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe012('0x1'));var rp=require('request-promise');var moment=require(_0xe012('0x2'));var BPromise=require(_0xe012('0x3'));var Mustache=require(_0xe012('0x4'));var util=require('util');var path=require(_0xe012('0x5'));var sox=require('sox');var csv=require(_0xe012('0x6'));var ejs=require(_0xe012('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe012('0x8'));var squel=require(_0xe012('0x9'));var crypto=require(_0xe012('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe012('0x6'));var querystring=require(_0xe012('0xb'));var Papa=require('papaparse');var Redis=require(_0xe012('0xc'));var authService=require(_0xe012('0xd'));var qs=require(_0xe012('0xe'));var as=require(_0xe012('0xf'));var hardwareService=require(_0xe012('0x10'));var logger=require(_0xe012('0x11'))('api');var utils=require(_0xe012('0x12'));var config=require(_0xe012('0x13'));var licenseUtil=require(_0xe012('0x14'));var db=require(_0xe012('0x15'))['db'];function respondWithStatusCode(_0x466754,_0x11a136){_0x11a136=_0x11a136||0xcc;return function(_0x49dbec){if(_0x49dbec){return _0x466754[_0xe012('0x16')](_0x11a136);}return _0x466754[_0xe012('0x17')](_0x11a136)[_0xe012('0x18')]();};}function respondWithResult(_0x2b9ccc,_0x2b9ad8){_0x2b9ad8=_0x2b9ad8||0xc8;return function(_0x26a492){if(_0x26a492){return _0x2b9ccc['status'](_0x2b9ad8)[_0xe012('0x19')](_0x26a492);}};}function respondWithFilteredResult(_0x510685,_0x1107c1){return function(_0x100f8d){if(_0x100f8d){var _0x3ecc21=typeof _0x1107c1[_0xe012('0x1a')]===_0xe012('0x1b')&&typeof _0x1107c1['limit']==='undefined';var _0x4a53b4=_0x100f8d[_0xe012('0x1c')];var _0x2a4609=_0x3ecc21?0x0:_0x1107c1[_0xe012('0x1a')];var _0x25eb2f=_0x3ecc21?_0x100f8d['count']:_0x1107c1[_0xe012('0x1a')]+_0x1107c1[_0xe012('0x1d')];var _0x81b09e;if(_0x25eb2f>=_0x4a53b4){_0x25eb2f=_0x4a53b4;_0x81b09e=0xc8;}else{_0x81b09e=0xce;}_0x510685[_0xe012('0x17')](_0x81b09e);return _0x510685[_0xe012('0x1e')](_0xe012('0x1f'),_0x2a4609+'-'+_0x25eb2f+'/'+_0x4a53b4)[_0xe012('0x19')](_0x100f8d);}return null;};}function patchUpdates(_0x34116e){return function(_0x55c3e4){try{jsonpatch[_0xe012('0x20')](_0x55c3e4,_0x34116e,!![]);}catch(_0x4ddbff){return BPromise[_0xe012('0x21')](_0x4ddbff);}return _0x55c3e4[_0xe012('0x22')]();};}function saveUpdates(_0x8b8556,_0x488511){return function(_0x3e5aca){if(_0x3e5aca){return _0x3e5aca[_0xe012('0x23')](_0x8b8556)['then'](function(_0xaa5ab4){return _0xaa5ab4;});}return null;};}function removeEntity(_0x597442,_0x401306){return function(_0x3e0452){if(_0x3e0452){return _0x3e0452['destroy']()[_0xe012('0x24')](function(){_0x597442[_0xe012('0x17')](0xcc)[_0xe012('0x18')]();});}};}function handleEntityNotFound(_0x23a9e8,_0x123026){return function(_0x1b3094){if(!_0x1b3094){_0x23a9e8[_0xe012('0x16')](0x194);}return _0x1b3094;};}function handleError(_0x360b3d,_0x169547){_0x169547=_0x169547||0x1f4;return function(_0x5b897e){logger[_0xe012('0x25')](_0x5b897e['stack']);if(_0x5b897e['name']){delete _0x5b897e[_0xe012('0x26')];}_0x360b3d[_0xe012('0x17')](_0x169547)[_0xe012('0x27')](_0x5b897e);};}exports['index']=function(_0x51d61c,_0x438f3d){var _0x2f66dd={},_0x19bb1b={},_0x20b018={'count':0x0,'rows':[]};var _0x1d3979=_['map'](db[_0xe012('0x28')][_0xe012('0x29')],function(_0x25ea14){return{'name':_0x25ea14[_0xe012('0x2a')],'type':_0x25ea14[_0xe012('0x2b')]['key']};});_0x19bb1b['model']=_[_0xe012('0x2c')](_0x1d3979,_0xe012('0x26'));_0x19bb1b[_0xe012('0x2d')]=_[_0xe012('0x2e')](_0x51d61c[_0xe012('0x2d')]);_0x19bb1b['filters']=_[_0xe012('0x2f')](_0x19bb1b['model'],_0x19bb1b[_0xe012('0x2d')]);_0x2f66dd[_0xe012('0x30')]=_[_0xe012('0x2f')](_0x19bb1b[_0xe012('0x31')],qs[_0xe012('0x32')](_0x51d61c[_0xe012('0x2d')]['fields']));_0x2f66dd[_0xe012('0x30')]=_0x2f66dd[_0xe012('0x30')][_0xe012('0x33')]?_0x2f66dd[_0xe012('0x30')]:_0x19bb1b[_0xe012('0x31')];if(!_0x51d61c['query'][_0xe012('0x34')]('nolimit')){_0x2f66dd[_0xe012('0x1d')]=qs[_0xe012('0x1d')](_0x51d61c['query'][_0xe012('0x1d')]);_0x2f66dd[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x51d61c[_0xe012('0x2d')][_0xe012('0x1a')]);}_0x2f66dd[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x51d61c[_0xe012('0x2d')][_0xe012('0x36')]);_0x2f66dd[_0xe012('0x37')]=qs[_0xe012('0x38')](_[_0xe012('0x39')](_0x51d61c[_0xe012('0x2d')],_0x19bb1b['filters']),_0x1d3979);if(_0x51d61c[_0xe012('0x2d')][_0xe012('0x3a')]){_0x2f66dd['where']=_[_0xe012('0x3b')](_0x2f66dd[_0xe012('0x37')],{'$or':_[_0xe012('0x2c')](_0x1d3979,function(_0x10419e){if(_0x10419e[_0xe012('0x2b')]!==_0xe012('0x3c')){var _0x4230cd={};_0x4230cd[_0x10419e[_0xe012('0x26')]]={'$like':'%'+_0x51d61c[_0xe012('0x2d')][_0xe012('0x3a')]+'%'};return _0x4230cd;}})});}_0x2f66dd=_[_0xe012('0x3b')]({},_0x2f66dd,_0x51d61c[_0xe012('0x3d')]);var _0x57a5d5={'where':_0x2f66dd['where']};return db[_0xe012('0x28')]['count'](_0x57a5d5)[_0xe012('0x24')](function(_0x51ab52){_0x20b018[_0xe012('0x1c')]=_0x51ab52;if(_0x51d61c[_0xe012('0x2d')][_0xe012('0x3e')]){_0x2f66dd[_0xe012('0x3f')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x2f66dd);})[_0xe012('0x24')](function(_0x26d50c){_0x20b018[_0xe012('0x40')]=_0x26d50c;return _0x20b018;})[_0xe012('0x24')](respondWithFilteredResult(_0x438f3d,_0x2f66dd))[_0xe012('0x41')](handleError(_0x438f3d,null));};exports[_0xe012('0x42')]=function(_0x1f30dc,_0x1e2d60){var _0xc4d59b={'raw':![],'where':{'id':_0x1f30dc['params']['id']}},_0x23f86e={};_0x23f86e[_0xe012('0x31')]=_[_0xe012('0x2e')](db[_0xe012('0x28')][_0xe012('0x29')]);_0x23f86e[_0xe012('0x2d')]=_['keys'](_0x1f30dc[_0xe012('0x2d')]);_0x23f86e[_0xe012('0x38')]=_[_0xe012('0x2f')](_0x23f86e[_0xe012('0x31')],_0x23f86e[_0xe012('0x2d')]);_0xc4d59b[_0xe012('0x30')]=_['intersection'](_0x23f86e[_0xe012('0x31')],qs['fields'](_0x1f30dc[_0xe012('0x2d')][_0xe012('0x32')]));_0xc4d59b[_0xe012('0x30')]=_0xc4d59b['attributes'][_0xe012('0x33')]?_0xc4d59b[_0xe012('0x30')]:_0x23f86e[_0xe012('0x31')];if(_0x1f30dc['query'][_0xe012('0x3e')]){_0xc4d59b[_0xe012('0x3f')]=[{'all':!![]}];}_0xc4d59b=_['merge']({},_0xc4d59b,_0x1f30dc['options']);return db[_0xe012('0x28')][_0xe012('0x43')](_0xc4d59b)[_0xe012('0x24')](handleEntityNotFound(_0x1e2d60,null))[_0xe012('0x24')](respondWithResult(_0x1e2d60,null))[_0xe012('0x41')](handleError(_0x1e2d60,null));};exports[_0xe012('0x44')]=function(_0xa46047,_0x2c5f49){return db[_0xe012('0x28')][_0xe012('0x44')](_0xa46047[_0xe012('0x45')],{})['then'](respondWithResult(_0x2c5f49,0xc9))['catch'](handleError(_0x2c5f49,null));};exports[_0xe012('0x23')]=function(_0x55b909,_0x91b007){if(_0x55b909[_0xe012('0x45')]['id']){delete _0x55b909['body']['id'];}return db[_0xe012('0x28')][_0xe012('0x43')]({'where':{'id':_0x55b909[_0xe012('0x46')]['id']}})['then'](handleEntityNotFound(_0x91b007,null))[_0xe012('0x24')](saveUpdates(_0x55b909[_0xe012('0x45')],null))['then'](respondWithResult(_0x91b007,null))[_0xe012('0x41')](handleError(_0x91b007,null));};exports[_0xe012('0x47')]=function(_0x40416e,_0x3859e0){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x40416e[_0xe012('0x46')]['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x3859e0,null))['then'](removeEntity(_0x3859e0,null))['catch'](handleError(_0x3859e0,null));};exports[_0xe012('0x48')]=function(_0x4dc4fa,_0x488e8f,_0x5982f6){var _0x1bd07c={};var _0x2d5b02={};var _0x4b9fbb;var _0x210ced;return db[_0xe012('0x28')][_0xe012('0x49')]({'where':{'id':_0x4dc4fa['params']['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x488e8f,null))[_0xe012('0x24')](function(_0x424e8a){if(_0x424e8a){_0x4b9fbb=_0x424e8a;_0x2d5b02[_0xe012('0x31')]=_['keys'](db['SugarcrmField'][_0xe012('0x29')]);_0x2d5b02['query']=_[_0xe012('0x2e')](_0x4dc4fa['query']);_0x2d5b02[_0xe012('0x38')]=_['intersection'](_0x2d5b02[_0xe012('0x31')],_0x2d5b02['query']);_0x1bd07c[_0xe012('0x30')]=_['intersection'](_0x2d5b02[_0xe012('0x31')],qs[_0xe012('0x32')](_0x4dc4fa[_0xe012('0x2d')]['fields']));_0x1bd07c['attributes']=_0x1bd07c['attributes'][_0xe012('0x33')]?_0x1bd07c[_0xe012('0x30')]:_0x2d5b02['model'];_0x1bd07c[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x36')]);_0x1bd07c[_0xe012('0x37')]=qs['filters'](_['pick'](_0x4dc4fa['query'],_0x2d5b02[_0xe012('0x38')]));if(_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x3a')]){_0x1bd07c[_0xe012('0x37')]=_[_0xe012('0x3b')](_0x1bd07c[_0xe012('0x37')],{'$or':_['map'](_0x1bd07c['attributes'],function(_0x6e36f9){var _0x5327f3={};_0x5327f3[_0x6e36f9]={'$like':'%'+_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x3a')]+'%'};return _0x5327f3;})});}_0x1bd07c=_[_0xe012('0x3b')]({},_0x1bd07c,_0x4dc4fa[_0xe012('0x3d')]);return _0x4b9fbb['getFields'](_0x1bd07c);}})[_0xe012('0x24')](function(_0x4e463c){if(_0x4e463c){_0x210ced=_0x4e463c[_0xe012('0x33')];if(!_0x4dc4fa[_0xe012('0x2d')]['hasOwnProperty'](_0xe012('0x4a'))){_0x1bd07c[_0xe012('0x1d')]=qs[_0xe012('0x1d')](_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x1d')]);_0x1bd07c[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x1a')]);}return _0x4b9fbb['getFields'](_0x1bd07c);}})[_0xe012('0x24')](function(_0x57545f){if(_0x57545f){return _0x57545f?{'count':_0x210ced,'rows':_0x57545f}:null;}})[_0xe012('0x24')](respondWithResult(_0x488e8f,null))[_0xe012('0x41')](handleError(_0x488e8f,null));};exports[_0xe012('0x4b')]=function(_0x3777fb,_0x34a651,_0x12f98d){var _0x224d79={};var _0x154d9a={};var _0x5ba8ea;var _0x3382a5;return db['SugarcrmConfiguration'][_0xe012('0x49')]({'where':{'id':_0x3777fb[_0xe012('0x46')]['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x34a651,null))[_0xe012('0x24')](function(_0x25b82a){if(_0x25b82a){_0x5ba8ea=_0x25b82a;_0x154d9a[_0xe012('0x31')]=_[_0xe012('0x2e')](db[_0xe012('0x4c')][_0xe012('0x29')]);_0x154d9a['query']=_[_0xe012('0x2e')](_0x3777fb[_0xe012('0x2d')]);_0x154d9a[_0xe012('0x38')]=_['intersection'](_0x154d9a[_0xe012('0x31')],_0x154d9a[_0xe012('0x2d')]);_0x224d79[_0xe012('0x30')]=_[_0xe012('0x2f')](_0x154d9a[_0xe012('0x31')],qs['fields'](_0x3777fb[_0xe012('0x2d')][_0xe012('0x32')]));_0x224d79[_0xe012('0x30')]=_0x224d79['attributes'][_0xe012('0x33')]?_0x224d79[_0xe012('0x30')]:_0x154d9a['model'];_0x224d79[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x3777fb['query'][_0xe012('0x36')]);_0x224d79[_0xe012('0x37')]=qs[_0xe012('0x38')](_[_0xe012('0x39')](_0x3777fb[_0xe012('0x2d')],_0x154d9a[_0xe012('0x38')]));if(_0x3777fb[_0xe012('0x2d')][_0xe012('0x3a')]){_0x224d79[_0xe012('0x37')]=_[_0xe012('0x3b')](_0x224d79['where'],{'$or':_[_0xe012('0x2c')](_0x224d79[_0xe012('0x30')],function(_0x231245){var _0x400be5={};_0x400be5[_0x231245]={'$like':'%'+_0x3777fb['query']['filter']+'%'};return _0x400be5;})});}_0x224d79=_[_0xe012('0x3b')]({},_0x224d79,_0x3777fb[_0xe012('0x3d')]);return _0x5ba8ea[_0xe012('0x4b')](_0x224d79);}})[_0xe012('0x24')](function(_0x47e9d3){if(_0x47e9d3){_0x3382a5=_0x47e9d3[_0xe012('0x33')];if(!_0x3777fb[_0xe012('0x2d')][_0xe012('0x34')](_0xe012('0x4a'))){_0x224d79[_0xe012('0x1d')]=qs[_0xe012('0x1d')](_0x3777fb[_0xe012('0x2d')][_0xe012('0x1d')]);_0x224d79[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x3777fb[_0xe012('0x2d')]['offset']);}return _0x5ba8ea[_0xe012('0x4b')](_0x224d79);}})[_0xe012('0x24')](function(_0x26912f){if(_0x26912f){return _0x26912f?{'count':_0x3382a5,'rows':_0x26912f}:null;}})['then'](respondWithResult(_0x34a651,null))['catch'](handleError(_0x34a651,null));};exports[_0xe012('0x4d')]=function(_0x3e271b,_0x338277,_0x3238ae){var _0x393b53={};var _0x3715ec={};var _0x7f9202;var _0xd0f021;return db[_0xe012('0x28')]['findOne']({'where':{'id':_0x3e271b['params']['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x338277,null))[_0xe012('0x24')](function(_0x3a0d31){if(_0x3a0d31){_0x7f9202=_0x3a0d31;_0x3715ec['model']=_['keys'](db['SugarcrmField'][_0xe012('0x29')]);_0x3715ec[_0xe012('0x2d')]=_[_0xe012('0x2e')](_0x3e271b[_0xe012('0x2d')]);_0x3715ec['filters']=_[_0xe012('0x2f')](_0x3715ec['model'],_0x3715ec[_0xe012('0x2d')]);_0x393b53[_0xe012('0x30')]=_[_0xe012('0x2f')](_0x3715ec['model'],qs['fields'](_0x3e271b[_0xe012('0x2d')][_0xe012('0x32')]));_0x393b53[_0xe012('0x30')]=_0x393b53[_0xe012('0x30')]['length']?_0x393b53[_0xe012('0x30')]:_0x3715ec[_0xe012('0x31')];_0x393b53[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x3e271b[_0xe012('0x2d')]['sort']);_0x393b53[_0xe012('0x37')]=qs[_0xe012('0x38')](_[_0xe012('0x39')](_0x3e271b[_0xe012('0x2d')],_0x3715ec[_0xe012('0x38')]));if(_0x3e271b[_0xe012('0x2d')][_0xe012('0x3a')]){_0x393b53['where']=_[_0xe012('0x3b')](_0x393b53[_0xe012('0x37')],{'$or':_['map'](_0x393b53[_0xe012('0x30')],function(_0x20ac52){var _0x5c04d4={};_0x5c04d4[_0x20ac52]={'$like':'%'+_0x3e271b[_0xe012('0x2d')]['filter']+'%'};return _0x5c04d4;})});}_0x393b53=_[_0xe012('0x3b')]({},_0x393b53,_0x3e271b[_0xe012('0x3d')]);return _0x7f9202['getDescriptions'](_0x393b53);}})['then'](function(_0x4c220f){if(_0x4c220f){_0xd0f021=_0x4c220f['length'];if(!_0x3e271b[_0xe012('0x2d')][_0xe012('0x34')](_0xe012('0x4a'))){_0x393b53[_0xe012('0x1d')]=qs['limit'](_0x3e271b['query'][_0xe012('0x1d')]);_0x393b53[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x3e271b[_0xe012('0x2d')][_0xe012('0x1a')]);}return _0x7f9202[_0xe012('0x4d')](_0x393b53);}})['then'](function(_0x757654){if(_0x757654){return _0x757654?{'count':_0xd0f021,'rows':_0x757654}:null;}})[_0xe012('0x24')](respondWithResult(_0x338277,null))['catch'](handleError(_0x338277,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 443920e..50a1104 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7f6=['moment','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','../../config/logger'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xf7f6,0x1b7));var _0x6f7f=function(_0x129de5,_0xe971cd){_0x129de5=_0x129de5-0x0;var _0x310691=_0xf7f6[_0x129de5];return _0x310691;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f7f('0x0'))('api');var moment=require(_0x6f7f('0x1'));var BPromise=require(_0x6f7f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6f7f('0x3'));var config=require(_0x6f7f('0x4'));var attributes=require(_0x6f7f('0x5'));module[_0x6f7f('0x6')]=function(_0x17a176,_0x105630){return _0x17a176[_0x6f7f('0x7')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffed=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xffed,0x158));var _0xdffe=function(_0x4af7cd,_0x4f9b31){_0x4af7cd=_0x4af7cd-0x0;var _0x44c82f=_0xffed[_0x4af7cd];return _0x44c82f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdffe('0x0'));var moment=require(_0xdffe('0x1'));var BPromise=require(_0xdffe('0x2'));var rp=require(_0xdffe('0x3'));var fs=require('fs');var path=require(_0xdffe('0x4'));var rimraf=require('rimraf');var config=require(_0xdffe('0x5'));var attributes=require(_0xdffe('0x6'));module[_0xdffe('0x7')]=function(_0x362367,_0x372e67){return _0x362367['define'](_0xdffe('0x8'),attributes,{'tableName':_0xdffe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 18c2ad9..8ece035 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb726=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x1d1cb7,_0x1d6e13){var _0x331a83=function(_0x21d339){while(--_0x21d339){_0x1d1cb7['push'](_0x1d1cb7['shift']());}};_0x331a83(++_0x1d6e13);}(_0xb726,0x1c6));var _0x6b72=function(_0x372b60,_0x20946a){_0x372b60=_0x372b60-0x0;var _0x8c6c1f=_0xb726[_0x372b60];return _0x8c6c1f;};'use strict';var _=require(_0x6b72('0x0'));var util=require(_0x6b72('0x1'));var moment=require(_0x6b72('0x2'));var BPromise=require(_0x6b72('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b72('0x4'));var db=require(_0x6b72('0x5'))['db'];var utils=require(_0x6b72('0x6'));var logger=require('../../config/logger')(_0x6b72('0x7'));var config=require(_0x6b72('0x8'));var jayson=require(_0x6b72('0x9'));var client=jayson[_0x6b72('0xa')][_0x6b72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13522a,_0x1115f5,_0x4873c4){return new BPromise(function(_0x272e50,_0x1ad134){return client[_0x6b72('0xc')](_0x13522a,_0x4873c4)[_0x6b72('0xd')](function(_0x1c2589){logger[_0x6b72('0xe')](_0x6b72('0xf'),_0x1115f5,_0x6b72('0x10'));logger[_0x6b72('0x11')](_0x6b72('0x12'),_0x1115f5,_0x6b72('0x10'),JSON['stringify'](_0x1c2589));if(_0x1c2589['error']){if(_0x1c2589[_0x6b72('0x13')][_0x6b72('0x14')]===0x1f4){logger[_0x6b72('0x13')](_0x6b72('0xf'),_0x1115f5,_0x1c2589[_0x6b72('0x13')]['message']);return _0x1ad134(_0x1c2589['error']['message']);}logger[_0x6b72('0x13')](_0x6b72('0xf'),_0x1115f5,_0x1c2589[_0x6b72('0x13')][_0x6b72('0x15')]);return _0x272e50(_0x1c2589[_0x6b72('0x13')][_0x6b72('0x15')]);}else{logger[_0x6b72('0xe')](_0x6b72('0xf'),_0x1115f5,_0x6b72('0x10'));_0x272e50(_0x1c2589[_0x6b72('0x16')][_0x6b72('0x15')]);}})[_0x6b72('0x17')](function(_0x50cba3){logger[_0x6b72('0x13')](_0x6b72('0xf'),_0x1115f5,_0x50cba3);_0x1ad134(_0x50cba3);});});} \ No newline at end of file +var _0xb03c=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xb03c,0x14f));var _0xcb03=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xb03c[_0x53b8e0];return _0x10630c;};'use strict';var _=require(_0xcb03('0x0'));var util=require(_0xcb03('0x1'));var moment=require(_0xcb03('0x2'));var BPromise=require(_0xcb03('0x3'));var rs=require(_0xcb03('0x4'));var fs=require('fs');var Redis=require(_0xcb03('0x5'));var db=require(_0xcb03('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb03('0x7'))('rpc');var config=require(_0xcb03('0x8'));var jayson=require(_0xcb03('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd239e7,_0x34551c,_0x5d5806){return new BPromise(function(_0x34994a,_0xad6287){return client[_0xcb03('0xa')](_0xd239e7,_0x5d5806)[_0xcb03('0xb')](function(_0x22fb4a){logger['info'](_0xcb03('0xc'),_0x34551c,_0xcb03('0xd'));logger[_0xcb03('0xe')](_0xcb03('0xf'),_0x34551c,_0xcb03('0xd'),JSON[_0xcb03('0x10')](_0x22fb4a));if(_0x22fb4a[_0xcb03('0x11')]){if(_0x22fb4a[_0xcb03('0x11')][_0xcb03('0x12')]===0x1f4){logger[_0xcb03('0x11')](_0xcb03('0xc'),_0x34551c,_0x22fb4a['error']['message']);return _0xad6287(_0x22fb4a[_0xcb03('0x11')][_0xcb03('0x13')]);}logger[_0xcb03('0x11')](_0xcb03('0xc'),_0x34551c,_0x22fb4a[_0xcb03('0x11')]['message']);return _0x34994a(_0x22fb4a[_0xcb03('0x11')]['message']);}else{logger[_0xcb03('0x14')](_0xcb03('0xc'),_0x34551c,_0xcb03('0xd'));_0x34994a(_0x22fb4a[_0xcb03('0x15')][_0xcb03('0x13')]);}})[_0xcb03('0x16')](function(_0xd6923f){logger[_0xcb03('0x11')](_0xcb03('0xc'),_0x34551c,_0xd6923f);_0xad6287(_0xd6923f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0504c89..f7f7c8e 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed6f=['get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xed6f,0x64));var _0xfed6=function(_0x1b8d1c,_0x395b3b){_0x1b8d1c=_0x1b8d1c-0x0;var _0x159a0b=_0xed6f[_0x1b8d1c];return _0x159a0b;};'use strict';var multer=require(_0xfed6('0x0'));var util=require(_0xfed6('0x1'));var path=require(_0xfed6('0x2'));var timeout=require(_0xfed6('0x3'));var express=require('express');var router=express[_0xfed6('0x4')]();var fs_extra=require(_0xfed6('0x5'));var auth=require(_0xfed6('0x6'));var interaction=require(_0xfed6('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xfed6('0x8')]('/',auth['isAuthenticated'](),controller[_0xfed6('0x9')]);router['get'](_0xfed6('0xa'),auth[_0xfed6('0xb')](),controller[_0xfed6('0xc')]);router['post']('/',auth[_0xfed6('0xb')](),controller[_0xfed6('0xd')]);router[_0xfed6('0xe')](_0xfed6('0xa'),auth[_0xfed6('0xb')](),controller['update']);router[_0xfed6('0xf')](_0xfed6('0xa'),auth['isAuthenticated'](),controller[_0xfed6('0x10')]);module[_0xfed6('0x11')]=router; \ No newline at end of file +var _0x6d85=['../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4e8b57,_0x3e1302){var _0x340834=function(_0x52cd77){while(--_0x52cd77){_0x4e8b57['push'](_0x4e8b57['shift']());}};_0x340834(++_0x3e1302);}(_0x6d85,0x104));var _0x56d8=function(_0x455380,_0x2a1448){_0x455380=_0x455380-0x0;var _0x2c2bb7=_0x6d85[_0x455380];return _0x2c2bb7;};'use strict';var multer=require(_0x56d8('0x0'));var util=require(_0x56d8('0x1'));var path=require('path');var timeout=require(_0x56d8('0x2'));var express=require(_0x56d8('0x3'));var router=express[_0x56d8('0x4')]();var fs_extra=require(_0x56d8('0x5'));var auth=require(_0x56d8('0x6'));var interaction=require(_0x56d8('0x7'));var config=require('../../config/environment');var controller=require(_0x56d8('0x8'));router[_0x56d8('0x9')]('/',auth[_0x56d8('0xa')](),controller[_0x56d8('0xb')]);router[_0x56d8('0x9')]('/:id',auth[_0x56d8('0xa')](),controller['show']);router[_0x56d8('0xc')]('/',auth[_0x56d8('0xa')](),controller[_0x56d8('0xd')]);router[_0x56d8('0xe')](_0x56d8('0xf'),auth['isAuthenticated'](),controller[_0x56d8('0x10')]);router['delete'](_0x56d8('0xf'),auth['isAuthenticated'](),controller[_0x56d8('0x11')]);module[_0x56d8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 69e0f7b..c8dcde6 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5221=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x3fabf9,_0x77efd7){var _0x5ad4d9=function(_0x8515c7){while(--_0x8515c7){_0x3fabf9['push'](_0x3fabf9['shift']());}};_0x5ad4d9(++_0x77efd7);}(_0x5221,0xdc));var _0x1522=function(_0x34a00f,_0x42f887){_0x34a00f=_0x34a00f-0x0;var _0x501cf4=_0x5221[_0x34a00f];return _0x501cf4;};'use strict';var Sequelize=require('sequelize');module[_0x1522('0x0')]={'type':{'type':Sequelize[_0x1522('0x1')](_0x1522('0x2'),_0x1522('0x3'),'customVariable',_0x1522('0x4'),_0x1522('0x5')),'defaultValue':_0x1522('0x2')},'content':{'type':Sequelize[_0x1522('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1522('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x1522('0x6')]},'idField':{'type':Sequelize[_0x1522('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1522('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1522('0x6')]}}; \ No newline at end of file +var _0xc5ec=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5ec,0x101));var _0xcc5e=function(_0x4f6719,_0x59e265){_0x4f6719=_0x4f6719-0x0;var _0xce7d75=_0xc5ec[_0x4f6719];return _0xce7d75;};'use strict';var Sequelize=require(_0xcc5e('0x0'));module[_0xcc5e('0x1')]={'type':{'type':Sequelize[_0xcc5e('0x2')](_0xcc5e('0x3'),_0xcc5e('0x4'),_0xcc5e('0x5'),_0xcc5e('0x6'),_0xcc5e('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcc5e('0x8')]},'key':{'type':Sequelize[_0xcc5e('0x8')]},'keyType':{'type':Sequelize[_0xcc5e('0x2')]('string',_0xcc5e('0x4'),_0xcc5e('0x5'))},'keyContent':{'type':Sequelize[_0xcc5e('0x8')]},'idField':{'type':Sequelize[_0xcc5e('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcc5e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index d2ce5e9..75c1f4f 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3789=['destroy','sendStatus','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x3789,0x15e));var _0x9378=function(_0x2561dd,_0x2fc0b0){_0x2561dd=_0x2561dd-0x0;var _0x4173c7=_0x3789[_0x2561dd];return _0x4173c7;};'use strict';var emlformat=require(_0x9378('0x0'));var rimraf=require(_0x9378('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9378('0x2'));var rp=require('request-promise');var moment=require(_0x9378('0x3'));var BPromise=require(_0x9378('0x4'));var Mustache=require(_0x9378('0x5'));var util=require(_0x9378('0x6'));var path=require(_0x9378('0x7'));var sox=require(_0x9378('0x8'));var csv=require(_0x9378('0x9'));var ejs=require(_0x9378('0xa'));var fs=require('fs');var fs_extra=require(_0x9378('0xb'));var _=require(_0x9378('0xc'));var squel=require('squel');var crypto=require(_0x9378('0xd'));var jsforce=require(_0x9378('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9378('0x9'));var querystring=require('querystring');var Papa=require(_0x9378('0xf'));var Redis=require(_0x9378('0x10'));var authService=require(_0x9378('0x11'));var qs=require(_0x9378('0x12'));var as=require(_0x9378('0x13'));var hardwareService=require(_0x9378('0x14'));var logger=require(_0x9378('0x15'))(_0x9378('0x16'));var utils=require(_0x9378('0x17'));var config=require(_0x9378('0x18'));var licenseUtil=require(_0x9378('0x19'));var db=require(_0x9378('0x1a'))['db'];function respondWithStatusCode(_0x143274,_0x479947){_0x479947=_0x479947||0xcc;return function(_0x3472bc){if(_0x3472bc){return _0x143274['sendStatus'](_0x479947);}return _0x143274[_0x9378('0x1b')](_0x479947)[_0x9378('0x1c')]();};}function respondWithResult(_0x5a78af,_0x1e9b9a){_0x1e9b9a=_0x1e9b9a||0xc8;return function(_0x4a80d5){if(_0x4a80d5){return _0x5a78af[_0x9378('0x1b')](_0x1e9b9a)[_0x9378('0x1d')](_0x4a80d5);}};}function respondWithFilteredResult(_0x5bf889,_0x3be7bc){return function(_0xafb5fb){if(_0xafb5fb){var _0x4bd50f=typeof _0x3be7bc['offset']===_0x9378('0x1e')&&typeof _0x3be7bc[_0x9378('0x1f')]===_0x9378('0x1e');var _0x71edcc=_0xafb5fb['count'];var _0x36581e=_0x4bd50f?0x0:_0x3be7bc[_0x9378('0x20')];var _0x523aa2=_0x4bd50f?_0xafb5fb[_0x9378('0x21')]:_0x3be7bc['offset']+_0x3be7bc[_0x9378('0x1f')];var _0x41340f;if(_0x523aa2>=_0x71edcc){_0x523aa2=_0x71edcc;_0x41340f=0xc8;}else{_0x41340f=0xce;}_0x5bf889[_0x9378('0x1b')](_0x41340f);return _0x5bf889[_0x9378('0x22')](_0x9378('0x23'),_0x36581e+'-'+_0x523aa2+'/'+_0x71edcc)[_0x9378('0x1d')](_0xafb5fb);}return null;};}function patchUpdates(_0x3ffa7f){return function(_0xbdde31){try{jsonpatch[_0x9378('0x24')](_0xbdde31,_0x3ffa7f,!![]);}catch(_0x1a9d23){return BPromise[_0x9378('0x25')](_0x1a9d23);}return _0xbdde31['save']();};}function saveUpdates(_0x51a9a7,_0x111f74){return function(_0x9a4cc7){if(_0x9a4cc7){return _0x9a4cc7[_0x9378('0x26')](_0x51a9a7)[_0x9378('0x27')](function(_0x4257d5){return _0x4257d5;});}return null;};}function removeEntity(_0x40cd22,_0x4fc191){return function(_0x123962){if(_0x123962){return _0x123962[_0x9378('0x28')]()[_0x9378('0x27')](function(){_0x40cd22[_0x9378('0x1b')](0xcc)[_0x9378('0x1c')]();});}};}function handleEntityNotFound(_0x464fc0,_0x54d1b9){return function(_0x1507d6){if(!_0x1507d6){_0x464fc0[_0x9378('0x29')](0x194);}return _0x1507d6;};}function handleError(_0x165b1f,_0x743dd9){_0x743dd9=_0x743dd9||0x1f4;return function(_0xb9fd7f){logger['error'](_0xb9fd7f[_0x9378('0x2a')]);if(_0xb9fd7f[_0x9378('0x2b')]){delete _0xb9fd7f[_0x9378('0x2b')];}_0x165b1f[_0x9378('0x1b')](_0x743dd9)[_0x9378('0x2c')](_0xb9fd7f);};}exports[_0x9378('0x2d')]=function(_0x15346d,_0x3cadd0){var _0x2271b1={},_0xcf3aca={},_0x28dd61={'count':0x0,'rows':[]};var _0x5094d3=_[_0x9378('0x2e')](db[_0x9378('0x2f')][_0x9378('0x30')],function(_0x4b2cff){return{'name':_0x4b2cff[_0x9378('0x31')],'type':_0x4b2cff['type'][_0x9378('0x32')]};});_0xcf3aca[_0x9378('0x33')]=_[_0x9378('0x2e')](_0x5094d3,_0x9378('0x2b'));_0xcf3aca['query']=_[_0x9378('0x34')](_0x15346d[_0x9378('0x35')]);_0xcf3aca['filters']=_[_0x9378('0x36')](_0xcf3aca[_0x9378('0x33')],_0xcf3aca[_0x9378('0x35')]);_0x2271b1['attributes']=_[_0x9378('0x36')](_0xcf3aca[_0x9378('0x33')],qs['fields'](_0x15346d['query'][_0x9378('0x37')]));_0x2271b1[_0x9378('0x38')]=_0x2271b1[_0x9378('0x38')]['length']?_0x2271b1[_0x9378('0x38')]:_0xcf3aca[_0x9378('0x33')];if(!_0x15346d[_0x9378('0x35')]['hasOwnProperty'](_0x9378('0x39'))){_0x2271b1[_0x9378('0x1f')]=qs[_0x9378('0x1f')](_0x15346d[_0x9378('0x35')]['limit']);_0x2271b1[_0x9378('0x20')]=qs[_0x9378('0x20')](_0x15346d[_0x9378('0x35')]['offset']);}_0x2271b1[_0x9378('0x3a')]=qs[_0x9378('0x3b')](_0x15346d['query'][_0x9378('0x3b')]);_0x2271b1[_0x9378('0x3c')]=qs[_0x9378('0x3d')](_[_0x9378('0x3e')](_0x15346d[_0x9378('0x35')],_0xcf3aca[_0x9378('0x3d')]),_0x5094d3);if(_0x15346d[_0x9378('0x35')][_0x9378('0x3f')]){_0x2271b1['where']=_[_0x9378('0x40')](_0x2271b1[_0x9378('0x3c')],{'$or':_['map'](_0x5094d3,function(_0x3bb7f6){if(_0x3bb7f6[_0x9378('0x41')]!=='VIRTUAL'){var _0x148945={};_0x148945[_0x3bb7f6[_0x9378('0x2b')]]={'$like':'%'+_0x15346d['query'][_0x9378('0x3f')]+'%'};return _0x148945;}})});}_0x2271b1=_[_0x9378('0x40')]({},_0x2271b1,_0x15346d[_0x9378('0x42')]);var _0x21dae7={'where':_0x2271b1[_0x9378('0x3c')]};return db[_0x9378('0x2f')][_0x9378('0x21')](_0x21dae7)[_0x9378('0x27')](function(_0x1a8ca5){_0x28dd61['count']=_0x1a8ca5;if(_0x15346d[_0x9378('0x35')][_0x9378('0x43')]){_0x2271b1[_0x9378('0x44')]=[{'all':!![]}];}return db[_0x9378('0x2f')][_0x9378('0x45')](_0x2271b1);})[_0x9378('0x27')](function(_0x55c272){_0x28dd61[_0x9378('0x46')]=_0x55c272;return _0x28dd61;})[_0x9378('0x27')](respondWithFilteredResult(_0x3cadd0,_0x2271b1))[_0x9378('0x47')](handleError(_0x3cadd0,null));};exports[_0x9378('0x48')]=function(_0x3874b8,_0x1a4a41){var _0x189dc6={'raw':!![],'where':{'id':_0x3874b8[_0x9378('0x49')]['id']}},_0xc423ef={};_0xc423ef[_0x9378('0x33')]=_[_0x9378('0x34')](db[_0x9378('0x2f')][_0x9378('0x30')]);_0xc423ef[_0x9378('0x35')]=_['keys'](_0x3874b8[_0x9378('0x35')]);_0xc423ef['filters']=_[_0x9378('0x36')](_0xc423ef[_0x9378('0x33')],_0xc423ef['query']);_0x189dc6[_0x9378('0x38')]=_[_0x9378('0x36')](_0xc423ef[_0x9378('0x33')],qs[_0x9378('0x37')](_0x3874b8[_0x9378('0x35')][_0x9378('0x37')]));_0x189dc6[_0x9378('0x38')]=_0x189dc6[_0x9378('0x38')][_0x9378('0x4a')]?_0x189dc6['attributes']:_0xc423ef[_0x9378('0x33')];if(_0x3874b8[_0x9378('0x35')]['includeAll']){_0x189dc6['include']=[{'all':!![]}];}_0x189dc6=_[_0x9378('0x40')]({},_0x189dc6,_0x3874b8[_0x9378('0x42')]);return db[_0x9378('0x2f')]['find'](_0x189dc6)[_0x9378('0x27')](handleEntityNotFound(_0x1a4a41,null))[_0x9378('0x27')](respondWithResult(_0x1a4a41,null))[_0x9378('0x47')](handleError(_0x1a4a41,null));};exports[_0x9378('0x4b')]=function(_0x50d559,_0x38ad47){return db[_0x9378('0x2f')]['create'](_0x50d559['body'],{})['then'](respondWithResult(_0x38ad47,0xc9))[_0x9378('0x47')](handleError(_0x38ad47,null));};exports[_0x9378('0x26')]=function(_0x479c1b,_0x5c80e5){if(_0x479c1b[_0x9378('0x4c')]['id']){delete _0x479c1b[_0x9378('0x4c')]['id'];}return db[_0x9378('0x2f')][_0x9378('0x4d')]({'where':{'id':_0x479c1b[_0x9378('0x49')]['id']}})[_0x9378('0x27')](handleEntityNotFound(_0x5c80e5,null))['then'](saveUpdates(_0x479c1b[_0x9378('0x4c')],null))['then'](respondWithResult(_0x5c80e5,null))[_0x9378('0x47')](handleError(_0x5c80e5,null));};exports[_0x9378('0x28')]=function(_0x5b5f09,_0x86b12){return db['SugarcrmField'][_0x9378('0x4d')]({'where':{'id':_0x5b5f09[_0x9378('0x49')]['id']}})[_0x9378('0x27')](handleEntityNotFound(_0x86b12,null))[_0x9378('0x27')](removeEntity(_0x86b12,null))['catch'](handleError(_0x86b12,null));}; \ No newline at end of file +var _0x7c29=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','query'];(function(_0x4a7193,_0x556c6a){var _0xc33d94=function(_0x3b7b34){while(--_0x3b7b34){_0x4a7193['push'](_0x4a7193['shift']());}};_0xc33d94(++_0x556c6a);}(_0x7c29,0x139));var _0x97c2=function(_0x7ca8b6,_0x10e63e){_0x7ca8b6=_0x7ca8b6-0x0;var _0x31f53c=_0x7c29[_0x7ca8b6];return _0x31f53c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c2('0x0'));var zipdir=require(_0x97c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c2('0x2'));var moment=require(_0x97c2('0x3'));var BPromise=require(_0x97c2('0x4'));var Mustache=require(_0x97c2('0x5'));var util=require(_0x97c2('0x6'));var path=require(_0x97c2('0x7'));var sox=require(_0x97c2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97c2('0x9'));var _=require('lodash');var squel=require(_0x97c2('0xa'));var crypto=require(_0x97c2('0xb'));var jsforce=require(_0x97c2('0xc'));var deskjs=require(_0x97c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c2('0xe'));var Papa=require(_0x97c2('0xf'));var Redis=require(_0x97c2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x97c2('0x11'));var as=require(_0x97c2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97c2('0x13'))(_0x97c2('0x14'));var utils=require('../../config/utils');var config=require(_0x97c2('0x15'));var licenseUtil=require(_0x97c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f6e16,_0x195e6c){_0x195e6c=_0x195e6c||0xcc;return function(_0x21921a){if(_0x21921a){return _0x3f6e16[_0x97c2('0x17')](_0x195e6c);}return _0x3f6e16[_0x97c2('0x18')](_0x195e6c)[_0x97c2('0x19')]();};}function respondWithResult(_0x1b7a85,_0x5bc2bc){_0x5bc2bc=_0x5bc2bc||0xc8;return function(_0x53e6ab){if(_0x53e6ab){return _0x1b7a85['status'](_0x5bc2bc)[_0x97c2('0x1a')](_0x53e6ab);}};}function respondWithFilteredResult(_0x582934,_0x416087){return function(_0x53a69a){if(_0x53a69a){var _0xe61c4d=typeof _0x416087['offset']===_0x97c2('0x1b')&&typeof _0x416087[_0x97c2('0x1c')]===_0x97c2('0x1b');var _0x121eb8=_0x53a69a[_0x97c2('0x1d')];var _0x30ab13=_0xe61c4d?0x0:_0x416087[_0x97c2('0x1e')];var _0x342e9b=_0xe61c4d?_0x53a69a[_0x97c2('0x1d')]:_0x416087[_0x97c2('0x1e')]+_0x416087[_0x97c2('0x1c')];var _0x535e39;if(_0x342e9b>=_0x121eb8){_0x342e9b=_0x121eb8;_0x535e39=0xc8;}else{_0x535e39=0xce;}_0x582934[_0x97c2('0x18')](_0x535e39);return _0x582934['set']('Content-Range',_0x30ab13+'-'+_0x342e9b+'/'+_0x121eb8)[_0x97c2('0x1a')](_0x53a69a);}return null;};}function patchUpdates(_0x1a4c44){return function(_0xe3de62){try{jsonpatch[_0x97c2('0x1f')](_0xe3de62,_0x1a4c44,!![]);}catch(_0x3b6edb){return BPromise[_0x97c2('0x20')](_0x3b6edb);}return _0xe3de62[_0x97c2('0x21')]();};}function saveUpdates(_0x49433c,_0x236eb6){return function(_0x3b16ed){if(_0x3b16ed){return _0x3b16ed[_0x97c2('0x22')](_0x49433c)[_0x97c2('0x23')](function(_0x41d1a6){return _0x41d1a6;});}return null;};}function removeEntity(_0x579db3,_0x4b4038){return function(_0x1a8ddb){if(_0x1a8ddb){return _0x1a8ddb[_0x97c2('0x24')]()[_0x97c2('0x23')](function(){_0x579db3['status'](0xcc)[_0x97c2('0x19')]();});}};}function handleEntityNotFound(_0x3f8596,_0x393f7b){return function(_0x5bace2){if(!_0x5bace2){_0x3f8596[_0x97c2('0x17')](0x194);}return _0x5bace2;};}function handleError(_0x323512,_0x38d333){_0x38d333=_0x38d333||0x1f4;return function(_0x57364a){logger['error'](_0x57364a[_0x97c2('0x25')]);if(_0x57364a[_0x97c2('0x26')]){delete _0x57364a[_0x97c2('0x26')];}_0x323512[_0x97c2('0x18')](_0x38d333)[_0x97c2('0x27')](_0x57364a);};}exports['index']=function(_0x25803d,_0x213cc9){var _0x430cdc={},_0x4809e7={},_0xc26f1={'count':0x0,'rows':[]};var _0x33a499=_[_0x97c2('0x28')](db[_0x97c2('0x29')][_0x97c2('0x2a')],function(_0x2e6002){return{'name':_0x2e6002[_0x97c2('0x2b')],'type':_0x2e6002[_0x97c2('0x2c')][_0x97c2('0x2d')]};});_0x4809e7['model']=_[_0x97c2('0x28')](_0x33a499,_0x97c2('0x26'));_0x4809e7[_0x97c2('0x2e')]=_['keys'](_0x25803d[_0x97c2('0x2e')]);_0x4809e7['filters']=_[_0x97c2('0x2f')](_0x4809e7['model'],_0x4809e7[_0x97c2('0x2e')]);_0x430cdc['attributes']=_['intersection'](_0x4809e7[_0x97c2('0x30')],qs[_0x97c2('0x31')](_0x25803d['query'][_0x97c2('0x31')]));_0x430cdc[_0x97c2('0x32')]=_0x430cdc['attributes'][_0x97c2('0x33')]?_0x430cdc[_0x97c2('0x32')]:_0x4809e7['model'];if(!_0x25803d[_0x97c2('0x2e')][_0x97c2('0x34')](_0x97c2('0x35'))){_0x430cdc['limit']=qs[_0x97c2('0x1c')](_0x25803d[_0x97c2('0x2e')][_0x97c2('0x1c')]);_0x430cdc['offset']=qs['offset'](_0x25803d[_0x97c2('0x2e')][_0x97c2('0x1e')]);}_0x430cdc[_0x97c2('0x36')]=qs[_0x97c2('0x37')](_0x25803d[_0x97c2('0x2e')][_0x97c2('0x37')]);_0x430cdc[_0x97c2('0x38')]=qs['filters'](_[_0x97c2('0x39')](_0x25803d[_0x97c2('0x2e')],_0x4809e7[_0x97c2('0x3a')]),_0x33a499);if(_0x25803d[_0x97c2('0x2e')]['filter']){_0x430cdc[_0x97c2('0x38')]=_[_0x97c2('0x3b')](_0x430cdc[_0x97c2('0x38')],{'$or':_[_0x97c2('0x28')](_0x33a499,function(_0x4c8962){if(_0x4c8962['type']!==_0x97c2('0x3c')){var _0x5f18cf={};_0x5f18cf[_0x4c8962['name']]={'$like':'%'+_0x25803d[_0x97c2('0x2e')][_0x97c2('0x3d')]+'%'};return _0x5f18cf;}})});}_0x430cdc=_[_0x97c2('0x3b')]({},_0x430cdc,_0x25803d[_0x97c2('0x3e')]);var _0x1433d2={'where':_0x430cdc[_0x97c2('0x38')]};return db[_0x97c2('0x29')][_0x97c2('0x1d')](_0x1433d2)['then'](function(_0xdc3c9c){_0xc26f1[_0x97c2('0x1d')]=_0xdc3c9c;if(_0x25803d[_0x97c2('0x2e')][_0x97c2('0x3f')]){_0x430cdc[_0x97c2('0x40')]=[{'all':!![]}];}return db[_0x97c2('0x29')]['findAll'](_0x430cdc);})[_0x97c2('0x23')](function(_0x2f1cea){_0xc26f1[_0x97c2('0x41')]=_0x2f1cea;return _0xc26f1;})[_0x97c2('0x23')](respondWithFilteredResult(_0x213cc9,_0x430cdc))[_0x97c2('0x42')](handleError(_0x213cc9,null));};exports['show']=function(_0x2b812b,_0x497303){var _0x5b4eb5={'raw':!![],'where':{'id':_0x2b812b[_0x97c2('0x43')]['id']}},_0x2f5180={};_0x2f5180[_0x97c2('0x30')]=_[_0x97c2('0x44')](db['SugarcrmField'][_0x97c2('0x2a')]);_0x2f5180[_0x97c2('0x2e')]=_[_0x97c2('0x44')](_0x2b812b[_0x97c2('0x2e')]);_0x2f5180[_0x97c2('0x3a')]=_[_0x97c2('0x2f')](_0x2f5180[_0x97c2('0x30')],_0x2f5180[_0x97c2('0x2e')]);_0x5b4eb5[_0x97c2('0x32')]=_[_0x97c2('0x2f')](_0x2f5180['model'],qs[_0x97c2('0x31')](_0x2b812b[_0x97c2('0x2e')][_0x97c2('0x31')]));_0x5b4eb5[_0x97c2('0x32')]=_0x5b4eb5[_0x97c2('0x32')]['length']?_0x5b4eb5[_0x97c2('0x32')]:_0x2f5180[_0x97c2('0x30')];if(_0x2b812b['query']['includeAll']){_0x5b4eb5[_0x97c2('0x40')]=[{'all':!![]}];}_0x5b4eb5=_[_0x97c2('0x3b')]({},_0x5b4eb5,_0x2b812b[_0x97c2('0x3e')]);return db[_0x97c2('0x29')][_0x97c2('0x45')](_0x5b4eb5)['then'](handleEntityNotFound(_0x497303,null))['then'](respondWithResult(_0x497303,null))['catch'](handleError(_0x497303,null));};exports[_0x97c2('0x46')]=function(_0x170d5d,_0x2423a5){return db[_0x97c2('0x29')]['create'](_0x170d5d['body'],{})['then'](respondWithResult(_0x2423a5,0xc9))[_0x97c2('0x42')](handleError(_0x2423a5,null));};exports[_0x97c2('0x22')]=function(_0xad5929,_0x90dac2){if(_0xad5929[_0x97c2('0x47')]['id']){delete _0xad5929[_0x97c2('0x47')]['id'];}return db[_0x97c2('0x29')][_0x97c2('0x45')]({'where':{'id':_0xad5929[_0x97c2('0x43')]['id']}})[_0x97c2('0x23')](handleEntityNotFound(_0x90dac2,null))[_0x97c2('0x23')](saveUpdates(_0xad5929[_0x97c2('0x47')],null))[_0x97c2('0x23')](respondWithResult(_0x90dac2,null))[_0x97c2('0x42')](handleError(_0x90dac2,null));};exports[_0x97c2('0x24')]=function(_0x252772,_0x5be835){return db[_0x97c2('0x29')][_0x97c2('0x45')]({'where':{'id':_0x252772[_0x97c2('0x43')]['id']}})[_0x97c2('0x23')](handleEntityNotFound(_0x5be835,null))['then'](removeEntity(_0x5be835,null))[_0x97c2('0x42')](handleError(_0x5be835,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 2359c39..09e22c9 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06fb=['util','api','bluebird','request-promise','path','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0x19d7da,_0x4fdc7d){var _0x28b3b9=function(_0x150339){while(--_0x150339){_0x19d7da['push'](_0x19d7da['shift']());}};_0x28b3b9(++_0x4fdc7d);}(_0x06fb,0x17f));var _0xb06f=function(_0x406639,_0x229acf){_0x406639=_0x406639-0x0;var _0x53a354=_0x06fb[_0x406639];return _0x53a354;};'use strict';var _=require(_0xb06f('0x0'));var util=require(_0xb06f('0x1'));var logger=require('../../config/logger')(_0xb06f('0x2'));var moment=require('moment');var BPromise=require(_0xb06f('0x3'));var rp=require(_0xb06f('0x4'));var fs=require('fs');var path=require(_0xb06f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x5b4e77,_0x541fd6){return _0x5b4e77[_0xb06f('0x6')](_0xb06f('0x7'),attributes,{'tableName':_0xb06f('0x8'),'paranoid':![],'indexes':[{'name':_0xb06f('0x9'),'fields':[_0xb06f('0xa'),_0xb06f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa22=['int_sugarcrm_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xaa22,0x12f));var _0x2aa2=function(_0x544bf2,_0x3a0218){_0x544bf2=_0x544bf2-0x0;var _0x5e2e3e=_0xaa22[_0x544bf2];return _0x5e2e3e;};'use strict';var _=require('lodash');var util=require(_0x2aa2('0x0'));var logger=require(_0x2aa2('0x1'))(_0x2aa2('0x2'));var moment=require(_0x2aa2('0x3'));var BPromise=require(_0x2aa2('0x4'));var rp=require(_0x2aa2('0x5'));var fs=require('fs');var path=require(_0x2aa2('0x6'));var rimraf=require(_0x2aa2('0x7'));var config=require(_0x2aa2('0x8'));var attributes=require(_0x2aa2('0x9'));module['exports']=function(_0x5c6ad8,_0x5ea8ce){return _0x5c6ad8[_0x2aa2('0xa')](_0x2aa2('0xb'),attributes,{'tableName':_0x2aa2('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x2aa2('0xd'),_0x2aa2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 17a3152..c73297a 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b23=['client','http','request','then','info','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x430a54,_0x1912b){var _0x50e04f=function(_0x88ae65){while(--_0x88ae65){_0x430a54['push'](_0x430a54['shift']());}};_0x50e04f(++_0x1912b);}(_0x4b23,0x1e3));var _0x34b2=function(_0x5efb3c,_0x852a5a){_0x5efb3c=_0x5efb3c-0x0;var _0x349be3=_0x4b23[_0x5efb3c];return _0x349be3;};'use strict';var _=require(_0x34b2('0x0'));var util=require(_0x34b2('0x1'));var moment=require('moment');var BPromise=require(_0x34b2('0x2'));var rs=require(_0x34b2('0x3'));var fs=require('fs');var Redis=require(_0x34b2('0x4'));var db=require(_0x34b2('0x5'))['db'];var utils=require(_0x34b2('0x6'));var logger=require(_0x34b2('0x7'))(_0x34b2('0x8'));var config=require(_0x34b2('0x9'));var jayson=require(_0x34b2('0xa'));var client=jayson[_0x34b2('0xb')][_0x34b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13e0f8,_0x4f64a1,_0x5b9c05){return new BPromise(function(_0x25252d,_0x26ab1f){return client[_0x34b2('0xd')](_0x13e0f8,_0x5b9c05)[_0x34b2('0xe')](function(_0x181e6c){logger[_0x34b2('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x4f64a1,'request\x20sent');logger[_0x34b2('0x10')](_0x34b2('0x11'),_0x4f64a1,_0x34b2('0x12'),JSON[_0x34b2('0x13')](_0x181e6c));if(_0x181e6c['error']){if(_0x181e6c[_0x34b2('0x14')][_0x34b2('0x15')]===0x1f4){logger['error'](_0x34b2('0x16'),_0x4f64a1,_0x181e6c[_0x34b2('0x14')][_0x34b2('0x17')]);return _0x26ab1f(_0x181e6c[_0x34b2('0x14')][_0x34b2('0x17')]);}logger[_0x34b2('0x14')](_0x34b2('0x16'),_0x4f64a1,_0x181e6c['error']['message']);return _0x25252d(_0x181e6c[_0x34b2('0x14')][_0x34b2('0x17')]);}else{logger[_0x34b2('0xf')](_0x34b2('0x16'),_0x4f64a1,'request\x20sent');_0x25252d(_0x181e6c[_0x34b2('0x18')][_0x34b2('0x17')]);}})[_0x34b2('0x19')](function(_0x32731a){logger[_0x34b2('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x4f64a1,_0x32731a);_0x26ab1f(_0x32731a);});});} \ No newline at end of file +var _0xaf9b=['message','request\x20sent','result','catch','util','bluebird','randomstring','../../config/logger','rpc','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2a5ad4,_0xb80fb1){var _0x3d2a67=function(_0x53de6e){while(--_0x53de6e){_0x2a5ad4['push'](_0x2a5ad4['shift']());}};_0x3d2a67(++_0xb80fb1);}(_0xaf9b,0x89));var _0xbaf9=function(_0x954f7d,_0x211eed){_0x954f7d=_0x954f7d-0x0;var _0x2b190f=_0xaf9b[_0x954f7d];return _0x2b190f;};'use strict';var _=require('lodash');var util=require(_0xbaf9('0x0'));var moment=require('moment');var BPromise=require(_0xbaf9('0x1'));var rs=require(_0xbaf9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbaf9('0x3'))(_0xbaf9('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbaf9('0x5')][_0xbaf9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x50ede2,_0x2a1fbc,_0x5b80a6){return new BPromise(function(_0x5955b0,_0x3c9211){return client[_0xbaf9('0x7')](_0x50ede2,_0x5b80a6)[_0xbaf9('0x8')](function(_0x518131){logger[_0xbaf9('0x9')](_0xbaf9('0xa'),_0x2a1fbc,'request\x20sent');logger[_0xbaf9('0xb')](_0xbaf9('0xc'),_0x2a1fbc,'request\x20sent',JSON['stringify'](_0x518131));if(_0x518131[_0xbaf9('0xd')]){if(_0x518131[_0xbaf9('0xd')][_0xbaf9('0xe')]===0x1f4){logger[_0xbaf9('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x2a1fbc,_0x518131[_0xbaf9('0xd')][_0xbaf9('0xf')]);return _0x3c9211(_0x518131[_0xbaf9('0xd')][_0xbaf9('0xf')]);}logger[_0xbaf9('0xd')](_0xbaf9('0xa'),_0x2a1fbc,_0x518131[_0xbaf9('0xd')][_0xbaf9('0xf')]);return _0x5955b0(_0x518131['error'][_0xbaf9('0xf')]);}else{logger[_0xbaf9('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x2a1fbc,_0xbaf9('0x10'));_0x5955b0(_0x518131[_0xbaf9('0x11')][_0xbaf9('0xf')]);}})[_0xbaf9('0x12')](function(_0x31b794){logger[_0xbaf9('0xd')](_0xbaf9('0xa'),_0x2a1fbc,_0x31b794);_0x3c9211(_0x31b794);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 2b0de83..63122e7 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3613=['/:id/configurations','getConfigurations','create','post','addConfiguration','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x301914,_0x13d31d){var _0x3f3a15=function(_0x21a56a){while(--_0x21a56a){_0x301914['push'](_0x301914['shift']());}};_0x3f3a15(++_0x13d31d);}(_0x3613,0x198));var _0x3361=function(_0x2f1272,_0x5593ac){_0x2f1272=_0x2f1272-0x0;var _0x4df7e7=_0x3613[_0x2f1272];return _0x4df7e7;};'use strict';var multer=require(_0x3361('0x0'));var util=require(_0x3361('0x1'));var path=require(_0x3361('0x2'));var timeout=require(_0x3361('0x3'));var express=require(_0x3361('0x4'));var router=express[_0x3361('0x5')]();var fs_extra=require(_0x3361('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3361('0x7'));var config=require('../../config/environment');var controller=require(_0x3361('0x8'));router[_0x3361('0x9')]('/',auth[_0x3361('0xa')](),controller[_0x3361('0xb')]);router[_0x3361('0x9')]('/:id',auth[_0x3361('0xa')](),controller['show']);router[_0x3361('0x9')](_0x3361('0xc'),auth[_0x3361('0xa')](),controller[_0x3361('0xd')]);router[_0x3361('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x3361('0xe')]);router[_0x3361('0xf')](_0x3361('0xc'),auth[_0x3361('0xa')](),controller[_0x3361('0x10')]);router['put'](_0x3361('0x11'),auth[_0x3361('0xa')](),controller[_0x3361('0x12')]);router['delete'](_0x3361('0x11'),auth[_0x3361('0xa')](),controller[_0x3361('0x13')]);module[_0x3361('0x14')]=router; \ No newline at end of file +var _0xafa8=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xafa8,0x135));var _0x8afa=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xafa8[_0x57fa7e];return _0x320671;};'use strict';var multer=require('multer');var util=require(_0x8afa('0x0'));var path=require(_0x8afa('0x1'));var timeout=require(_0x8afa('0x2'));var express=require(_0x8afa('0x3'));var router=express[_0x8afa('0x4')]();var fs_extra=require(_0x8afa('0x5'));var auth=require(_0x8afa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8afa('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x8afa('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8afa('0x8')](_0x8afa('0x9'),auth[_0x8afa('0xa')](),controller[_0x8afa('0xb')]);router['get'](_0x8afa('0xc'),auth[_0x8afa('0xa')](),controller[_0x8afa('0xd')]);router[_0x8afa('0x8')](_0x8afa('0xe'),auth[_0x8afa('0xa')](),controller[_0x8afa('0xf')]);router[_0x8afa('0x10')]('/',auth[_0x8afa('0xa')](),controller['create']);router[_0x8afa('0x10')](_0x8afa('0xc'),auth[_0x8afa('0xa')](),controller[_0x8afa('0x11')]);router[_0x8afa('0x12')](_0x8afa('0x9'),auth[_0x8afa('0xa')](),controller[_0x8afa('0x13')]);router[_0x8afa('0x14')]('/:id',auth[_0x8afa('0xa')](),controller['destroy']);module[_0x8afa('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 53df1b1..37f65d8 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x108a=['HelpDesk','sequelize','exports','STRING'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0x108a,0x155));var _0xa108=function(_0x3be6de,_0x44c0fd){_0x3be6de=_0x3be6de-0x0;var _0x548195=_0x108a[_0x3be6de];return _0x548195;};'use strict';var Sequelize=require(_0xa108('0x0'));module[_0xa108('0x1')]={'name':{'type':Sequelize[_0xa108('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa108('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa108('0x3')},'remoteUri':{'type':Sequelize[_0xa108('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa108('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa108('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe6df=['HelpDesk','sequelize','STRING'];(function(_0x376bc6,_0x466cbe){var _0x4392d1=function(_0x3fb3d3){while(--_0x3fb3d3){_0x376bc6['push'](_0x376bc6['shift']());}};_0x4392d1(++_0x466cbe);}(_0xe6df,0x160));var _0xfe6d=function(_0x169abd,_0x6951e6){_0x169abd=_0x169abd-0x0;var _0x40365b=_0xe6df[_0x169abd];return _0x40365b;};'use strict';var Sequelize=require(_0xfe6d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xfe6d('0x1')]},'username':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![],'defaultValue':_0xfe6d('0x2')},'remoteUri':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index cc8a0ba..91b29ee 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fe3=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getConfigurations','addConfiguration','getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Subjects','Descriptions','md5','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','format','getchallenge','success','POST','login','result','GET','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x258f9f,_0x10c626){var _0x29488b=function(_0x176199){while(--_0x176199){_0x258f9f['push'](_0x258f9f['shift']());}};_0x29488b(++_0x10c626);}(_0x0fe3,0xc1));var _0x30fe=function(_0x167102,_0x530317){_0x167102=_0x167102-0x0;var _0x1f93e0=_0x0fe3[_0x167102];return _0x1f93e0;};'use strict';var emlformat=require(_0x30fe('0x0'));var rimraf=require(_0x30fe('0x1'));var zipdir=require(_0x30fe('0x2'));var jsonpatch=require(_0x30fe('0x3'));var rp=require(_0x30fe('0x4'));var moment=require(_0x30fe('0x5'));var BPromise=require(_0x30fe('0x6'));var Mustache=require('mustache');var util=require(_0x30fe('0x7'));var path=require(_0x30fe('0x8'));var sox=require(_0x30fe('0x9'));var csv=require(_0x30fe('0xa'));var ejs=require(_0x30fe('0xb'));var fs=require('fs');var fs_extra=require(_0x30fe('0xc'));var _=require(_0x30fe('0xd'));var squel=require(_0x30fe('0xe'));var crypto=require(_0x30fe('0xf'));var jsforce=require(_0x30fe('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x30fe('0xa'));var querystring=require('querystring');var Papa=require(_0x30fe('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x30fe('0x12'));var as=require(_0x30fe('0x13'));var hardwareService=require(_0x30fe('0x14'));var logger=require(_0x30fe('0x15'))(_0x30fe('0x16'));var utils=require(_0x30fe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x30fe('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x37003b,_0x30067e){_0x30067e=_0x30067e||0xcc;return function(_0x5bb78c){if(_0x5bb78c){return _0x37003b[_0x30fe('0x19')](_0x30067e);}return _0x37003b['status'](_0x30067e)[_0x30fe('0x1a')]();};}function respondWithResult(_0x54445a,_0x36294b){_0x36294b=_0x36294b||0xc8;return function(_0x467a99){if(_0x467a99){return _0x54445a['status'](_0x36294b)[_0x30fe('0x1b')](_0x467a99);}};}function respondWithFilteredResult(_0x7ac859,_0x1da37d){return function(_0x480275){if(_0x480275){var _0x4fba0c=typeof _0x1da37d[_0x30fe('0x1c')]==='undefined'&&typeof _0x1da37d[_0x30fe('0x1d')]===_0x30fe('0x1e');var _0x2a5fd3=_0x480275[_0x30fe('0x1f')];var _0xe7f0d0=_0x4fba0c?0x0:_0x1da37d[_0x30fe('0x1c')];var _0x5832cc=_0x4fba0c?_0x480275[_0x30fe('0x1f')]:_0x1da37d[_0x30fe('0x1c')]+_0x1da37d[_0x30fe('0x1d')];var _0x506151;if(_0x5832cc>=_0x2a5fd3){_0x5832cc=_0x2a5fd3;_0x506151=0xc8;}else{_0x506151=0xce;}_0x7ac859[_0x30fe('0x20')](_0x506151);return _0x7ac859[_0x30fe('0x21')]('Content-Range',_0xe7f0d0+'-'+_0x5832cc+'/'+_0x2a5fd3)[_0x30fe('0x1b')](_0x480275);}return null;};}function patchUpdates(_0x4ade8f){return function(_0x13cbb7){try{jsonpatch['apply'](_0x13cbb7,_0x4ade8f,!![]);}catch(_0x3df199){return BPromise['reject'](_0x3df199);}return _0x13cbb7[_0x30fe('0x22')]();};}function saveUpdates(_0x4ea7e9,_0xe219b4){return function(_0x2d43ce){if(_0x2d43ce){return _0x2d43ce[_0x30fe('0x23')](_0x4ea7e9)[_0x30fe('0x24')](function(_0x38aef1){return _0x38aef1;});}return null;};}function removeEntity(_0x2599ba,_0x34a814){return function(_0x166603){if(_0x166603){return _0x166603[_0x30fe('0x25')]()[_0x30fe('0x24')](function(){_0x2599ba['status'](0xcc)[_0x30fe('0x1a')]();});}};}function handleEntityNotFound(_0x275942,_0x4d46ac){return function(_0x255a98){if(!_0x255a98){_0x275942[_0x30fe('0x19')](0x194);}return _0x255a98;};}function handleError(_0x165317,_0x51eed7){_0x51eed7=_0x51eed7||0x1f4;return function(_0x455e1e){logger[_0x30fe('0x26')](_0x455e1e['stack']);if(_0x455e1e[_0x30fe('0x27')]){delete _0x455e1e[_0x30fe('0x27')];}_0x165317[_0x30fe('0x20')](_0x51eed7)[_0x30fe('0x28')](_0x455e1e);};}exports[_0x30fe('0x29')]=function(_0x5cca77,_0x316829){var _0x2ee736={},_0x5eea57={},_0x417e22={'count':0x0,'rows':[]};var _0x3f4537=_[_0x30fe('0x2a')](db['VtigerAccount'][_0x30fe('0x2b')],function(_0x10ad05){return{'name':_0x10ad05[_0x30fe('0x2c')],'type':_0x10ad05[_0x30fe('0x2d')][_0x30fe('0x2e')]};});_0x5eea57['model']=_['map'](_0x3f4537,_0x30fe('0x27'));_0x5eea57[_0x30fe('0x2f')]=_[_0x30fe('0x30')](_0x5cca77[_0x30fe('0x2f')]);_0x5eea57[_0x30fe('0x31')]=_[_0x30fe('0x32')](_0x5eea57[_0x30fe('0x33')],_0x5eea57[_0x30fe('0x2f')]);_0x2ee736[_0x30fe('0x34')]=_[_0x30fe('0x32')](_0x5eea57[_0x30fe('0x33')],qs[_0x30fe('0x35')](_0x5cca77['query'][_0x30fe('0x35')]));_0x2ee736[_0x30fe('0x34')]=_0x2ee736[_0x30fe('0x34')][_0x30fe('0x36')]?_0x2ee736['attributes']:_0x5eea57[_0x30fe('0x33')];if(!_0x5cca77[_0x30fe('0x2f')][_0x30fe('0x37')](_0x30fe('0x38'))){_0x2ee736[_0x30fe('0x1d')]=qs[_0x30fe('0x1d')](_0x5cca77[_0x30fe('0x2f')][_0x30fe('0x1d')]);_0x2ee736['offset']=qs[_0x30fe('0x1c')](_0x5cca77['query']['offset']);}_0x2ee736[_0x30fe('0x39')]=qs['sort'](_0x5cca77[_0x30fe('0x2f')][_0x30fe('0x3a')]);_0x2ee736[_0x30fe('0x3b')]=qs[_0x30fe('0x31')](_[_0x30fe('0x3c')](_0x5cca77[_0x30fe('0x2f')],_0x5eea57[_0x30fe('0x31')]),_0x3f4537);if(_0x5cca77[_0x30fe('0x2f')][_0x30fe('0x3d')]){_0x2ee736['where']=_[_0x30fe('0x3e')](_0x2ee736[_0x30fe('0x3b')],{'$or':_[_0x30fe('0x2a')](_0x3f4537,function(_0x54ba3a){if(_0x54ba3a[_0x30fe('0x2d')]!==_0x30fe('0x3f')){var _0x2fc553={};_0x2fc553[_0x54ba3a[_0x30fe('0x27')]]={'$like':'%'+_0x5cca77[_0x30fe('0x2f')][_0x30fe('0x3d')]+'%'};return _0x2fc553;}})});}_0x2ee736=_['merge']({},_0x2ee736,_0x5cca77['options']);var _0x3f208e={'where':_0x2ee736[_0x30fe('0x3b')]};return db[_0x30fe('0x40')][_0x30fe('0x1f')](_0x3f208e)['then'](function(_0x23065a){_0x417e22[_0x30fe('0x1f')]=_0x23065a;if(_0x5cca77[_0x30fe('0x2f')][_0x30fe('0x41')]){_0x2ee736[_0x30fe('0x42')]=[{'all':!![]}];}return db['VtigerAccount'][_0x30fe('0x43')](_0x2ee736);})[_0x30fe('0x24')](function(_0x17aa53){_0x417e22[_0x30fe('0x44')]=_0x17aa53;return _0x417e22;})['then'](respondWithFilteredResult(_0x316829,_0x2ee736))[_0x30fe('0x45')](handleError(_0x316829,null));};exports[_0x30fe('0x46')]=function(_0x26e7d5,_0x7db5ee){var _0x124e3b={'raw':![],'where':{'id':_0x26e7d5[_0x30fe('0x47')]['id']}},_0x2de6c0={};_0x2de6c0['model']=_['keys'](db[_0x30fe('0x40')][_0x30fe('0x2b')]);_0x2de6c0[_0x30fe('0x2f')]=_[_0x30fe('0x30')](_0x26e7d5[_0x30fe('0x2f')]);_0x2de6c0[_0x30fe('0x31')]=_[_0x30fe('0x32')](_0x2de6c0[_0x30fe('0x33')],_0x2de6c0[_0x30fe('0x2f')]);_0x124e3b[_0x30fe('0x34')]=_[_0x30fe('0x32')](_0x2de6c0[_0x30fe('0x33')],qs[_0x30fe('0x35')](_0x26e7d5[_0x30fe('0x2f')]['fields']));_0x124e3b[_0x30fe('0x34')]=_0x124e3b['attributes'][_0x30fe('0x36')]?_0x124e3b[_0x30fe('0x34')]:_0x2de6c0[_0x30fe('0x33')];if(_0x26e7d5['query']['includeAll']){_0x124e3b[_0x30fe('0x42')]=[{'all':!![]}];}_0x124e3b=_['merge']({},_0x124e3b,_0x26e7d5[_0x30fe('0x48')]);return db[_0x30fe('0x40')][_0x30fe('0x49')](_0x124e3b)[_0x30fe('0x24')](handleEntityNotFound(_0x7db5ee,null))[_0x30fe('0x24')](respondWithResult(_0x7db5ee,null))[_0x30fe('0x45')](handleError(_0x7db5ee,null));};exports['create']=function(_0x26af1f,_0x3855f5){return db[_0x30fe('0x40')][_0x30fe('0x4a')](_0x26af1f[_0x30fe('0x4b')],{})[_0x30fe('0x24')](respondWithResult(_0x3855f5,0xc9))[_0x30fe('0x45')](handleError(_0x3855f5,null));};exports[_0x30fe('0x23')]=function(_0x4c699d,_0x52c35d){if(_0x4c699d['body']['id']){delete _0x4c699d[_0x30fe('0x4b')]['id'];}return db[_0x30fe('0x40')]['find']({'where':{'id':_0x4c699d['params']['id']}})[_0x30fe('0x24')](handleEntityNotFound(_0x52c35d,null))['then'](saveUpdates(_0x4c699d[_0x30fe('0x4b')],null))[_0x30fe('0x24')](respondWithResult(_0x52c35d,null))[_0x30fe('0x45')](handleError(_0x52c35d,null));};exports[_0x30fe('0x25')]=function(_0x1fc23b,_0x1201ac){return db[_0x30fe('0x40')]['find']({'where':{'id':_0x1fc23b[_0x30fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x1201ac,null))[_0x30fe('0x24')](removeEntity(_0x1201ac,null))[_0x30fe('0x45')](handleError(_0x1201ac,null));};exports[_0x30fe('0x4c')]=function(_0x2d9eb2,_0x5e8be1,_0x482b0){var _0x82792c={};var _0x27b99f={};var _0x1c6ec1;var _0x3894f6;return db[_0x30fe('0x40')]['findOne']({'where':{'id':_0x2d9eb2[_0x30fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e8be1,null))[_0x30fe('0x24')](function(_0x19db12){if(_0x19db12){_0x1c6ec1=_0x19db12;_0x27b99f[_0x30fe('0x33')]=_[_0x30fe('0x30')](db['VtigerConfiguration'][_0x30fe('0x2b')]);_0x27b99f[_0x30fe('0x2f')]=_[_0x30fe('0x30')](_0x2d9eb2['query']);_0x27b99f[_0x30fe('0x31')]=_[_0x30fe('0x32')](_0x27b99f[_0x30fe('0x33')],_0x27b99f['query']);_0x82792c[_0x30fe('0x34')]=_[_0x30fe('0x32')](_0x27b99f[_0x30fe('0x33')],qs[_0x30fe('0x35')](_0x2d9eb2[_0x30fe('0x2f')][_0x30fe('0x35')]));_0x82792c['attributes']=_0x82792c['attributes'][_0x30fe('0x36')]?_0x82792c[_0x30fe('0x34')]:_0x27b99f[_0x30fe('0x33')];_0x82792c[_0x30fe('0x39')]=qs[_0x30fe('0x3a')](_0x2d9eb2[_0x30fe('0x2f')][_0x30fe('0x3a')]);_0x82792c['where']=qs['filters'](_[_0x30fe('0x3c')](_0x2d9eb2[_0x30fe('0x2f')],_0x27b99f[_0x30fe('0x31')]));if(_0x2d9eb2[_0x30fe('0x2f')]['filter']){_0x82792c['where']=_[_0x30fe('0x3e')](_0x82792c['where'],{'$or':_[_0x30fe('0x2a')](_0x82792c['attributes'],function(_0x11ed2f){var _0x19d6e1={};_0x19d6e1[_0x11ed2f]={'$like':'%'+_0x2d9eb2[_0x30fe('0x2f')][_0x30fe('0x3d')]+'%'};return _0x19d6e1;})});}_0x82792c=_[_0x30fe('0x3e')]({},_0x82792c,_0x2d9eb2[_0x30fe('0x48')]);return _0x1c6ec1[_0x30fe('0x4c')](_0x82792c);}})[_0x30fe('0x24')](function(_0x9ab81b){if(_0x9ab81b){_0x3894f6=_0x9ab81b[_0x30fe('0x36')];if(!_0x2d9eb2[_0x30fe('0x2f')]['hasOwnProperty'](_0x30fe('0x38'))){_0x82792c[_0x30fe('0x1d')]=qs['limit'](_0x2d9eb2[_0x30fe('0x2f')][_0x30fe('0x1d')]);_0x82792c['offset']=qs['offset'](_0x2d9eb2[_0x30fe('0x2f')][_0x30fe('0x1c')]);}return _0x1c6ec1[_0x30fe('0x4c')](_0x82792c);}})[_0x30fe('0x24')](function(_0x2e1311){if(_0x2e1311){return _0x2e1311?{'count':_0x3894f6,'rows':_0x2e1311}:null;}})[_0x30fe('0x24')](respondWithResult(_0x5e8be1,null))[_0x30fe('0x45')](handleError(_0x5e8be1,null));};exports[_0x30fe('0x4d')]=function(_0x944657,_0x551c25,_0x596a6b){if(_0x944657[_0x30fe('0x4b')]['id']){delete _0x944657['body']['id'];}return db[_0x30fe('0x40')]['findOne']({'where':{'id':_0x944657[_0x30fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x551c25,null))[_0x30fe('0x24')](function(_0x131ee1){if(_0x131ee1){_0x944657[_0x30fe('0x4b')]['AccountId']=_0x131ee1['id'];_0x944657[_0x30fe('0x4b')]['Subjects']=integrations[_0x30fe('0x4e')](_0x944657[_0x30fe('0x4b')][_0x30fe('0x4f')],_0x944657[_0x30fe('0x4b')][_0x30fe('0x2d')]);_0x944657[_0x30fe('0x4b')]['Descriptions']=integrations[_0x30fe('0x50')](_0x944657[_0x30fe('0x4b')][_0x30fe('0x4f')],_0x944657[_0x30fe('0x4b')]['type']);return db[_0x30fe('0x51')][_0x30fe('0x4a')](_0x944657[_0x30fe('0x4b')],{'include':[{'model':db[_0x30fe('0x52')],'as':_0x30fe('0x53')},{'model':db[_0x30fe('0x52')],'as':_0x30fe('0x54')}]});}return null;})[_0x30fe('0x24')](respondWithResult(_0x551c25,null))[_0x30fe('0x45')](handleError(_0x551c25,null));};var md5=require(_0x30fe('0x55'));exports['getFields']=function(_0x3617c4,_0x53a5a6,_0xbebf0b){var _0x4091fe=null;var _0x24d808=null;var _0x149aba=null;var _0x33c7fe=null;var _0x32eae1='';return db[_0x30fe('0x40')][_0x30fe('0x56')]({'where':{'id':_0x3617c4[_0x30fe('0x47')]['id']},'attributes':['id',_0x30fe('0x27'),_0x30fe('0x57'),_0x30fe('0x58'),_0x30fe('0x59'),_0x30fe('0x5a'),_0x30fe('0x5b'),_0x30fe('0x5c')]})['then'](handleEntityNotFound(_0x53a5a6,null))['then'](function(_0x492131){if(_0x492131){_0x4091fe=_0x492131['username'];_0x24d808=_0x492131[_0x30fe('0x5c')];_0x149aba=_0x492131['moduleName'];_0x32eae1=_0x492131[_0x30fe('0x5a')];var _0x40ac3c=_0x32eae1[_0x30fe('0x5d')](-0x1);if(_0x40ac3c==='/'){_0x32eae1=_0x32eae1['substring'](0x0,_0x32eae1['lastIndexOf'](_0x40ac3c));}_0x33c7fe=util[_0x30fe('0x5e')]('%s/webservice.php',_0x32eae1);var _0x5701da={'method':'GET','uri':_0x33c7fe,'qs':{'operation':_0x30fe('0x5f'),'username':_0x492131[_0x30fe('0x57')]},'json':!![]};return rp(_0x5701da);}})[_0x30fe('0x24')](function(_0xe128fd){if(_0xe128fd[_0x30fe('0x60')]){var _0x2e9b33={'method':_0x30fe('0x61'),'uri':_0x33c7fe,'form':{'operation':_0x30fe('0x62'),'username':_0x4091fe,'accessKey':md5(_0xe128fd[_0x30fe('0x63')]['token']+_0x24d808)},'json':!![]};return rp(_0x2e9b33);}})['then'](function(_0x1a7bd9){if(_0x1a7bd9['success']){var _0x446571={'method':_0x30fe('0x64'),'uri':_0x33c7fe,'qs':{'operation':'describe','username':_0x4091fe,'sessionName':_0x1a7bd9[_0x30fe('0x63')][_0x30fe('0x65')],'elementType':_0x149aba},'json':!![]};return rp(_0x446571);}})[_0x30fe('0x24')](function(_0x396489){if(_0x396489['success']){var _0x1bbd5e=[_0x30fe('0x66'),_0x30fe('0x67'),_0x30fe('0x68')];_[_0x30fe('0x69')](_0x396489[_0x30fe('0x63')][_0x30fe('0x35')],function(_0x2d0bf2){return _0x1bbd5e[_0x30fe('0x6a')](_0x2d0bf2[_0x30fe('0x2d')][_0x30fe('0x27')]);});_[_0x30fe('0x69')](_0x396489['result']['fields'],function(_0x3c8665){return _0x3c8665[_0x30fe('0x6b')]===_0x30fe('0x6c');});return{'count':_0x396489['result']['fields'][_0x30fe('0x36')],'rows':_[_0x30fe('0x2a')](_0x396489['result'][_0x30fe('0x35')],function(_0x56cac0){return{'id':_0x56cac0[_0x30fe('0x27')],'name':_0x56cac0[_0x30fe('0x6d')],'custom':_[_0x30fe('0x6e')](_0x56cac0['name'],_0x30fe('0x6f'))?!![]:![],'options':_0x56cac0[_0x30fe('0x2d')][_0x30fe('0x27')]===_0x30fe('0x70')&&_0x56cac0[_0x30fe('0x2d')][_0x30fe('0x71')]['length']>0x0?_[_0x30fe('0x2a')](_0x56cac0['type']['picklistValues'],function(_0xbe038f){return{'name':_0xbe038f[_0x30fe('0x6d')],'value':_0xbe038f[_0x30fe('0x72')]};}):[]};})};}})[_0x30fe('0x24')](respondWithResult(_0x53a5a6,null))[_0x30fe('0x45')](function(_0x5494c2){console[_0x30fe('0x73')](_0x30fe('0x74')+_0x5494c2);var _0x5c7789=_0x3617c4[_0x30fe('0x2f')]['test']?0x1f4:_0x5494c2[_0x30fe('0x75')]||0x1f4;logger['error'](_0x30fe('0x76'),'getFields',_0x5c7789,JSON[_0x30fe('0x77')](_0x5494c2));delete _0x5494c2[_0x30fe('0x27')];if(_0x5c7789===0x191){_0x5c7789=0x190;}_0x53a5a6[_0x30fe('0x20')](_0x5c7789)[_0x30fe('0x28')](_0x3617c4[_0x30fe('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5494c2[_0x30fe('0x75')]}:_0x5494c2);});}; \ No newline at end of file +var _0xef64=['picklistValues','value','log','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VtigerAccount','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','findOne','VtigerConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','login','result','token','describe','sessionName','success','autogenerated','reference','owner','remove','false','label','picklist'];(function(_0x3c67d5,_0x5d9d44){var _0x120e96=function(_0x329da3){while(--_0x329da3){_0x3c67d5['push'](_0x3c67d5['shift']());}};_0x120e96(++_0x5d9d44);}(_0xef64,0x83));var _0x4ef6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xef64[_0x24f31b];return _0x488401;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ef6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ef6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ef6('0x2'));var Mustache=require('mustache');var util=require(_0x4ef6('0x3'));var path=require(_0x4ef6('0x4'));var sox=require(_0x4ef6('0x5'));var csv=require(_0x4ef6('0x6'));var ejs=require(_0x4ef6('0x7'));var fs=require('fs');var fs_extra=require(_0x4ef6('0x8'));var _=require(_0x4ef6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ef6('0xa'));var toCsv=require(_0x4ef6('0x6'));var querystring=require(_0x4ef6('0xb'));var Papa=require(_0x4ef6('0xc'));var Redis=require('ioredis');var authService=require(_0x4ef6('0xd'));var qs=require(_0x4ef6('0xe'));var as=require(_0x4ef6('0xf'));var hardwareService=require(_0x4ef6('0x10'));var logger=require(_0x4ef6('0x11'))(_0x4ef6('0x12'));var utils=require(_0x4ef6('0x13'));var config=require(_0x4ef6('0x14'));var licenseUtil=require(_0x4ef6('0x15'));var db=require(_0x4ef6('0x16'))['db'];var integrations=require(_0x4ef6('0x17'));function respondWithStatusCode(_0x2cbc98,_0x3eccd8){_0x3eccd8=_0x3eccd8||0xcc;return function(_0x276e4f){if(_0x276e4f){return _0x2cbc98[_0x4ef6('0x18')](_0x3eccd8);}return _0x2cbc98['status'](_0x3eccd8)[_0x4ef6('0x19')]();};}function respondWithResult(_0x3a2238,_0x473d8e){_0x473d8e=_0x473d8e||0xc8;return function(_0x5297ab){if(_0x5297ab){return _0x3a2238[_0x4ef6('0x1a')](_0x473d8e)[_0x4ef6('0x1b')](_0x5297ab);}};}function respondWithFilteredResult(_0x129173,_0x59e84e){return function(_0x31df8a){if(_0x31df8a){var _0x27adbe=typeof _0x59e84e[_0x4ef6('0x1c')]===_0x4ef6('0x1d')&&typeof _0x59e84e['limit']===_0x4ef6('0x1d');var _0xe4c304=_0x31df8a[_0x4ef6('0x1e')];var _0xbb1e8b=_0x27adbe?0x0:_0x59e84e[_0x4ef6('0x1c')];var _0x18ed40=_0x27adbe?_0x31df8a[_0x4ef6('0x1e')]:_0x59e84e[_0x4ef6('0x1c')]+_0x59e84e['limit'];var _0x25f075;if(_0x18ed40>=_0xe4c304){_0x18ed40=_0xe4c304;_0x25f075=0xc8;}else{_0x25f075=0xce;}_0x129173[_0x4ef6('0x1a')](_0x25f075);return _0x129173[_0x4ef6('0x1f')](_0x4ef6('0x20'),_0xbb1e8b+'-'+_0x18ed40+'/'+_0xe4c304)[_0x4ef6('0x1b')](_0x31df8a);}return null;};}function patchUpdates(_0x4a5dd6){return function(_0x50b8d0){try{jsonpatch[_0x4ef6('0x21')](_0x50b8d0,_0x4a5dd6,!![]);}catch(_0x949525){return BPromise[_0x4ef6('0x22')](_0x949525);}return _0x50b8d0[_0x4ef6('0x23')]();};}function saveUpdates(_0x4c1e46,_0x475105){return function(_0xfceb3f){if(_0xfceb3f){return _0xfceb3f[_0x4ef6('0x24')](_0x4c1e46)[_0x4ef6('0x25')](function(_0x1217d5){return _0x1217d5;});}return null;};}function removeEntity(_0x45fc37,_0x8b2724){return function(_0x220ef6){if(_0x220ef6){return _0x220ef6[_0x4ef6('0x26')]()[_0x4ef6('0x25')](function(){_0x45fc37[_0x4ef6('0x1a')](0xcc)[_0x4ef6('0x19')]();});}};}function handleEntityNotFound(_0x1a7514,_0x30a9f7){return function(_0x117af){if(!_0x117af){_0x1a7514[_0x4ef6('0x18')](0x194);}return _0x117af;};}function handleError(_0x36a8cf,_0x267e33){_0x267e33=_0x267e33||0x1f4;return function(_0x387ebe){logger[_0x4ef6('0x27')](_0x387ebe[_0x4ef6('0x28')]);if(_0x387ebe[_0x4ef6('0x29')]){delete _0x387ebe['name'];}_0x36a8cf[_0x4ef6('0x1a')](_0x267e33)[_0x4ef6('0x2a')](_0x387ebe);};}exports[_0x4ef6('0x2b')]=function(_0x21f572,_0x44dac0){var _0x2c3fc4={},_0x2e395b={},_0x4eaf78={'count':0x0,'rows':[]};var _0x3aabbb=_['map'](db['VtigerAccount'][_0x4ef6('0x2c')],function(_0x38c1d8){return{'name':_0x38c1d8[_0x4ef6('0x2d')],'type':_0x38c1d8['type'][_0x4ef6('0x2e')]};});_0x2e395b[_0x4ef6('0x2f')]=_[_0x4ef6('0x30')](_0x3aabbb,_0x4ef6('0x29'));_0x2e395b[_0x4ef6('0x31')]=_[_0x4ef6('0x32')](_0x21f572[_0x4ef6('0x31')]);_0x2e395b[_0x4ef6('0x33')]=_[_0x4ef6('0x34')](_0x2e395b['model'],_0x2e395b[_0x4ef6('0x31')]);_0x2c3fc4[_0x4ef6('0x35')]=_[_0x4ef6('0x34')](_0x2e395b[_0x4ef6('0x2f')],qs['fields'](_0x21f572[_0x4ef6('0x31')]['fields']));_0x2c3fc4['attributes']=_0x2c3fc4[_0x4ef6('0x35')][_0x4ef6('0x36')]?_0x2c3fc4[_0x4ef6('0x35')]:_0x2e395b[_0x4ef6('0x2f')];if(!_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x37')](_0x4ef6('0x38'))){_0x2c3fc4['limit']=qs['limit'](_0x21f572['query'][_0x4ef6('0x39')]);_0x2c3fc4['offset']=qs[_0x4ef6('0x1c')](_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x1c')]);}_0x2c3fc4[_0x4ef6('0x3a')]=qs[_0x4ef6('0x3b')](_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x3b')]);_0x2c3fc4[_0x4ef6('0x3c')]=qs[_0x4ef6('0x33')](_[_0x4ef6('0x3d')](_0x21f572[_0x4ef6('0x31')],_0x2e395b[_0x4ef6('0x33')]),_0x3aabbb);if(_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x3e')]){_0x2c3fc4[_0x4ef6('0x3c')]=_['merge'](_0x2c3fc4['where'],{'$or':_[_0x4ef6('0x30')](_0x3aabbb,function(_0x9aad08){if(_0x9aad08['type']!=='VIRTUAL'){var _0xc0bca8={};_0xc0bca8[_0x9aad08[_0x4ef6('0x29')]]={'$like':'%'+_0x21f572['query']['filter']+'%'};return _0xc0bca8;}})});}_0x2c3fc4=_[_0x4ef6('0x3f')]({},_0x2c3fc4,_0x21f572['options']);var _0x313d76={'where':_0x2c3fc4[_0x4ef6('0x3c')]};return db[_0x4ef6('0x40')][_0x4ef6('0x1e')](_0x313d76)[_0x4ef6('0x25')](function(_0x317eaa){_0x4eaf78['count']=_0x317eaa;if(_0x21f572['query'][_0x4ef6('0x41')]){_0x2c3fc4[_0x4ef6('0x42')]=[{'all':!![]}];}return db[_0x4ef6('0x40')][_0x4ef6('0x43')](_0x2c3fc4);})['then'](function(_0x24e43d){_0x4eaf78['rows']=_0x24e43d;return _0x4eaf78;})[_0x4ef6('0x25')](respondWithFilteredResult(_0x44dac0,_0x2c3fc4))[_0x4ef6('0x44')](handleError(_0x44dac0,null));};exports[_0x4ef6('0x45')]=function(_0x3685d7,_0x2787ac){var _0x31789f={'raw':![],'where':{'id':_0x3685d7[_0x4ef6('0x46')]['id']}},_0x3a7137={};_0x3a7137[_0x4ef6('0x2f')]=_['keys'](db[_0x4ef6('0x40')][_0x4ef6('0x2c')]);_0x3a7137[_0x4ef6('0x31')]=_[_0x4ef6('0x32')](_0x3685d7[_0x4ef6('0x31')]);_0x3a7137[_0x4ef6('0x33')]=_[_0x4ef6('0x34')](_0x3a7137['model'],_0x3a7137[_0x4ef6('0x31')]);_0x31789f['attributes']=_[_0x4ef6('0x34')](_0x3a7137[_0x4ef6('0x2f')],qs[_0x4ef6('0x47')](_0x3685d7[_0x4ef6('0x31')][_0x4ef6('0x47')]));_0x31789f[_0x4ef6('0x35')]=_0x31789f['attributes'][_0x4ef6('0x36')]?_0x31789f[_0x4ef6('0x35')]:_0x3a7137[_0x4ef6('0x2f')];if(_0x3685d7['query'][_0x4ef6('0x41')]){_0x31789f[_0x4ef6('0x42')]=[{'all':!![]}];}_0x31789f=_[_0x4ef6('0x3f')]({},_0x31789f,_0x3685d7[_0x4ef6('0x48')]);return db[_0x4ef6('0x40')][_0x4ef6('0x49')](_0x31789f)['then'](handleEntityNotFound(_0x2787ac,null))['then'](respondWithResult(_0x2787ac,null))[_0x4ef6('0x44')](handleError(_0x2787ac,null));};exports[_0x4ef6('0x4a')]=function(_0x1cfe6e,_0x58bc63){return db[_0x4ef6('0x40')][_0x4ef6('0x4a')](_0x1cfe6e[_0x4ef6('0x4b')],{})['then'](respondWithResult(_0x58bc63,0xc9))[_0x4ef6('0x44')](handleError(_0x58bc63,null));};exports[_0x4ef6('0x24')]=function(_0xc2bb62,_0x25cffc){if(_0xc2bb62[_0x4ef6('0x4b')]['id']){delete _0xc2bb62['body']['id'];}return db[_0x4ef6('0x40')][_0x4ef6('0x49')]({'where':{'id':_0xc2bb62[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x25cffc,null))[_0x4ef6('0x25')](saveUpdates(_0xc2bb62[_0x4ef6('0x4b')],null))[_0x4ef6('0x25')](respondWithResult(_0x25cffc,null))[_0x4ef6('0x44')](handleError(_0x25cffc,null));};exports['destroy']=function(_0xd45409,_0x4beb93){return db['VtigerAccount']['find']({'where':{'id':_0xd45409[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x4beb93,null))['then'](removeEntity(_0x4beb93,null))[_0x4ef6('0x44')](handleError(_0x4beb93,null));};exports['getConfigurations']=function(_0x2729fd,_0x48bd1f,_0xb4d18c){var _0x6bfea3={};var _0x59e408={};var _0x204399;var _0x52e40e;return db[_0x4ef6('0x40')][_0x4ef6('0x4c')]({'where':{'id':_0x2729fd[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x48bd1f,null))[_0x4ef6('0x25')](function(_0x3199a8){if(_0x3199a8){_0x204399=_0x3199a8;_0x59e408[_0x4ef6('0x2f')]=_['keys'](db[_0x4ef6('0x4d')][_0x4ef6('0x2c')]);_0x59e408['query']=_[_0x4ef6('0x32')](_0x2729fd[_0x4ef6('0x31')]);_0x59e408[_0x4ef6('0x33')]=_[_0x4ef6('0x34')](_0x59e408[_0x4ef6('0x2f')],_0x59e408[_0x4ef6('0x31')]);_0x6bfea3['attributes']=_[_0x4ef6('0x34')](_0x59e408[_0x4ef6('0x2f')],qs[_0x4ef6('0x47')](_0x2729fd['query'][_0x4ef6('0x47')]));_0x6bfea3[_0x4ef6('0x35')]=_0x6bfea3[_0x4ef6('0x35')][_0x4ef6('0x36')]?_0x6bfea3[_0x4ef6('0x35')]:_0x59e408['model'];_0x6bfea3[_0x4ef6('0x3a')]=qs[_0x4ef6('0x3b')](_0x2729fd[_0x4ef6('0x31')]['sort']);_0x6bfea3['where']=qs[_0x4ef6('0x33')](_[_0x4ef6('0x3d')](_0x2729fd[_0x4ef6('0x31')],_0x59e408[_0x4ef6('0x33')]));if(_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x3e')]){_0x6bfea3['where']=_[_0x4ef6('0x3f')](_0x6bfea3[_0x4ef6('0x3c')],{'$or':_['map'](_0x6bfea3[_0x4ef6('0x35')],function(_0x549eb4){var _0x3f8f9a={};_0x3f8f9a[_0x549eb4]={'$like':'%'+_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x3e')]+'%'};return _0x3f8f9a;})});}_0x6bfea3=_[_0x4ef6('0x3f')]({},_0x6bfea3,_0x2729fd['options']);return _0x204399[_0x4ef6('0x4e')](_0x6bfea3);}})['then'](function(_0x760d1f){if(_0x760d1f){_0x52e40e=_0x760d1f[_0x4ef6('0x36')];if(!_0x2729fd[_0x4ef6('0x31')]['hasOwnProperty'](_0x4ef6('0x38'))){_0x6bfea3[_0x4ef6('0x39')]=qs['limit'](_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x39')]);_0x6bfea3['offset']=qs[_0x4ef6('0x1c')](_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x1c')]);}return _0x204399[_0x4ef6('0x4e')](_0x6bfea3);}})[_0x4ef6('0x25')](function(_0x549b38){if(_0x549b38){return _0x549b38?{'count':_0x52e40e,'rows':_0x549b38}:null;}})[_0x4ef6('0x25')](respondWithResult(_0x48bd1f,null))[_0x4ef6('0x44')](handleError(_0x48bd1f,null));};exports['addConfiguration']=function(_0x50416e,_0x51d4e7,_0x517e9e){if(_0x50416e[_0x4ef6('0x4b')]['id']){delete _0x50416e['body']['id'];}return db[_0x4ef6('0x40')][_0x4ef6('0x4c')]({'where':{'id':_0x50416e[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x51d4e7,null))[_0x4ef6('0x25')](function(_0xae1b37){if(_0xae1b37){_0x50416e['body'][_0x4ef6('0x4f')]=_0xae1b37['id'];_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x50')]=integrations[_0x4ef6('0x51')](_0x50416e['body'][_0x4ef6('0x52')],_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x53')]);_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x54')]=integrations[_0x4ef6('0x55')](_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x52')],_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x53')]);return db[_0x4ef6('0x4d')][_0x4ef6('0x4a')](_0x50416e['body'],{'include':[{'model':db[_0x4ef6('0x56')],'as':'Subjects'},{'model':db[_0x4ef6('0x56')],'as':_0x4ef6('0x54')}]});}return null;})[_0x4ef6('0x25')](respondWithResult(_0x51d4e7,null))[_0x4ef6('0x44')](handleError(_0x51d4e7,null));};var md5=require(_0x4ef6('0x57'));exports[_0x4ef6('0x58')]=function(_0x28e9c6,_0x565e64,_0x26dcc3){var _0x84ab87=null;var _0x30aa1d=null;var _0x4021b3=null;var _0x2f0b5b=null;var _0x27f513='';return db[_0x4ef6('0x40')][_0x4ef6('0x4c')]({'where':{'id':_0x28e9c6['params']['id']},'attributes':['id',_0x4ef6('0x29'),_0x4ef6('0x59'),_0x4ef6('0x5a'),_0x4ef6('0x5b'),_0x4ef6('0x5c'),_0x4ef6('0x5d'),'accessKey']})[_0x4ef6('0x25')](handleEntityNotFound(_0x565e64,null))[_0x4ef6('0x25')](function(_0xb2385f){if(_0xb2385f){_0x84ab87=_0xb2385f[_0x4ef6('0x59')];_0x30aa1d=_0xb2385f[_0x4ef6('0x5e')];_0x4021b3=_0xb2385f[_0x4ef6('0x5b')];_0x27f513=_0xb2385f[_0x4ef6('0x5c')];var _0x2ec617=_0x27f513[_0x4ef6('0x5f')](-0x1);if(_0x2ec617==='/'){_0x27f513=_0x27f513[_0x4ef6('0x60')](0x0,_0x27f513[_0x4ef6('0x61')](_0x2ec617));}_0x2f0b5b=util[_0x4ef6('0x62')](_0x4ef6('0x63'),_0x27f513);var _0x5d28dd={'method':_0x4ef6('0x64'),'uri':_0x2f0b5b,'qs':{'operation':_0x4ef6('0x65'),'username':_0xb2385f[_0x4ef6('0x59')]},'json':!![]};return rp(_0x5d28dd);}})['then'](function(_0x57ff36){if(_0x57ff36['success']){var _0x348093={'method':'POST','uri':_0x2f0b5b,'form':{'operation':_0x4ef6('0x66'),'username':_0x84ab87,'accessKey':md5(_0x57ff36[_0x4ef6('0x67')][_0x4ef6('0x68')]+_0x30aa1d)},'json':!![]};return rp(_0x348093);}})['then'](function(_0x8651db){if(_0x8651db['success']){var _0x5c830f={'method':_0x4ef6('0x64'),'uri':_0x2f0b5b,'qs':{'operation':_0x4ef6('0x69'),'username':_0x84ab87,'sessionName':_0x8651db[_0x4ef6('0x67')][_0x4ef6('0x6a')],'elementType':_0x4021b3},'json':!![]};return rp(_0x5c830f);}})[_0x4ef6('0x25')](function(_0x21b3c4){if(_0x21b3c4[_0x4ef6('0x6b')]){var _0xb97418=[_0x4ef6('0x6c'),_0x4ef6('0x6d'),_0x4ef6('0x6e')];_['remove'](_0x21b3c4[_0x4ef6('0x67')][_0x4ef6('0x47')],function(_0x135444){return _0xb97418['includes'](_0x135444[_0x4ef6('0x53')]['name']);});_[_0x4ef6('0x6f')](_0x21b3c4[_0x4ef6('0x67')][_0x4ef6('0x47')],function(_0x46d177){return _0x46d177['editable']===_0x4ef6('0x70');});return{'count':_0x21b3c4['result'][_0x4ef6('0x47')][_0x4ef6('0x36')],'rows':_['map'](_0x21b3c4['result'][_0x4ef6('0x47')],function(_0x598e3d){return{'id':_0x598e3d[_0x4ef6('0x29')],'name':_0x598e3d[_0x4ef6('0x71')],'custom':_['startsWith'](_0x598e3d[_0x4ef6('0x29')],'cf_')?!![]:![],'options':_0x598e3d['type'][_0x4ef6('0x29')]===_0x4ef6('0x72')&&_0x598e3d[_0x4ef6('0x53')][_0x4ef6('0x73')][_0x4ef6('0x36')]>0x0?_['map'](_0x598e3d[_0x4ef6('0x53')][_0x4ef6('0x73')],function(_0x5ec733){return{'name':_0x5ec733['label'],'value':_0x5ec733[_0x4ef6('0x74')]};}):[]};})};}})[_0x4ef6('0x25')](respondWithResult(_0x565e64,null))[_0x4ef6('0x44')](function(_0x3448c5){console[_0x4ef6('0x75')](_0x4ef6('0x76')+_0x3448c5);var _0x30fb19=_0x28e9c6[_0x4ef6('0x31')]['test']?0x1f4:_0x3448c5[_0x4ef6('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4ef6('0x58'),_0x30fb19,JSON[_0x4ef6('0x78')](_0x3448c5));delete _0x3448c5[_0x4ef6('0x29')];if(_0x30fb19===0x191){_0x30fb19=0x190;}_0x565e64[_0x4ef6('0x1a')](_0x30fb19)[_0x4ef6('0x2a')](_0x28e9c6[_0x4ef6('0x31')][_0x4ef6('0x79')]?{'message':_0x4ef6('0x7a'),'statusCode':_0x3448c5[_0x4ef6('0x77')]}:_0x3448c5);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index d4e2990..3db40dc 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4de7=['define','VtigerAccount','util','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports'];(function(_0x18242c,_0x17ef5f){var _0x47f808=function(_0x52f764){while(--_0x52f764){_0x18242c['push'](_0x18242c['shift']());}};_0x47f808(++_0x17ef5f);}(_0x4de7,0xfc));var _0x74de=function(_0x16baad,_0x29e2d2){_0x16baad=_0x16baad-0x0;var _0x308caf=_0x4de7[_0x16baad];return _0x308caf;};'use strict';var _=require('lodash');var util=require(_0x74de('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x74de('0x1'));var BPromise=require(_0x74de('0x2'));var rp=require(_0x74de('0x3'));var fs=require('fs');var path=require(_0x74de('0x4'));var rimraf=require(_0x74de('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x74de('0x6'));module[_0x74de('0x7')]=function(_0x5ed758,_0x185f78){return _0x5ed758[_0x74de('0x8')](_0x74de('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2171=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0xf7b24f,_0x1bd51f){var _0x2b8d84=function(_0x2c06d0){while(--_0x2c06d0){_0xf7b24f['push'](_0xf7b24f['shift']());}};_0x2b8d84(++_0x1bd51f);}(_0x2171,0x1f1));var _0x1217=function(_0x217975,_0x327e19){_0x217975=_0x217975-0x0;var _0xd48819=_0x2171[_0x217975];return _0xd48819;};'use strict';var _=require(_0x1217('0x0'));var util=require(_0x1217('0x1'));var logger=require('../../config/logger')(_0x1217('0x2'));var moment=require(_0x1217('0x3'));var BPromise=require(_0x1217('0x4'));var rp=require(_0x1217('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1217('0x6'));var config=require(_0x1217('0x7'));var attributes=require(_0x1217('0x8'));var integrations=require(_0x1217('0x9'));module['exports']=function(_0x4cd8d4,_0xa5e9d){return _0x4cd8d4[_0x1217('0xa')]('VtigerAccount',attributes,{'tableName':_0x1217('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 3700420..083f600 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41bb=['../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVtigerAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3e7a9c,_0xcdc5ee){var _0x57c470=function(_0x1c7dee){while(--_0x1c7dee){_0x3e7a9c['push'](_0x3e7a9c['shift']());}};_0x57c470(++_0xcdc5ee);}(_0x41bb,0xc5));var _0xb41b=function(_0x3d9164,_0x33d55a){_0x3d9164=_0x3d9164-0x0;var _0x5ae074=_0x41bb[_0x3d9164];return _0x5ae074;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});}exports[_0xb41b('0x15')]=function(_0x47154d){var _0x198783=this;return new Promise(function(_0x5df8c2,_0x4b3580){return db['VtigerAccount'][_0xb41b('0x16')]({'raw':_0x47154d['options']?_0x47154d[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x47154d[_0xb41b('0x17')]?_0x47154d['options']['where']||null:null,'attributes':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'limit':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x1a')]||null:null,'include':_0x47154d['options']?_0x47154d['options'][_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x47154d[_0xb41b('0x17')]['include'],function(_0x14e9c8){return{'model':db[_0x14e9c8[_0xb41b('0x1d')]],'as':_0x14e9c8['as'],'attributes':_0x14e9c8['attributes'],'include':_0x14e9c8[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x14e9c8['include'],function(_0xed3c7e){return{'model':db[_0xed3c7e['model']],'as':_0xed3c7e['as'],'attributes':_0xed3c7e[_0xb41b('0x19')],'include':_0xed3c7e[_0xb41b('0x1b')]?_['map'](_0xed3c7e[_0xb41b('0x1b')],function(_0x4265b8){return{'model':db[_0x4265b8['model']],'as':_0x4265b8['as'],'attributes':_0x4265b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x46aecf){logger[_0xb41b('0xc')](_0xb41b('0x15'),_0x47154d);logger[_0xb41b('0xf')](_0xb41b('0x15'),_0x47154d,JSON[_0xb41b('0x1e')](_0x46aecf));_0x5df8c2(_0x46aecf);})['catch'](function(_0x26ef96){logger[_0xb41b('0x10')]('GetVtigerAccount',_0x26ef96[_0xb41b('0x12')],_0x47154d);_0x4b3580(_0x198783['error'](0x1f4,_0x26ef96[_0xb41b('0x12')]));});});};exports[_0xb41b('0x1f')]=function(_0x597a35){var _0x23a6ed=this;return new Promise(function(_0x4a95e7,_0x29da9f){return db[_0xb41b('0x20')]['find']({'raw':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x21')]||null:null,'attributes':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'include':_0x597a35[_0xb41b('0x17')]?_0x597a35['options'][_0xb41b('0x1b')]?_['map'](_0x597a35['options'][_0xb41b('0x1b')],function(_0x192ceb){return{'model':db[_0x192ceb[_0xb41b('0x1d')]],'as':_0x192ceb['as'],'attributes':_0x192ceb[_0xb41b('0x19')],'include':_0x192ceb[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x192ceb[_0xb41b('0x1b')],function(_0x197197){return{'model':db[_0x197197[_0xb41b('0x1d')]],'as':_0x197197['as'],'attributes':_0x197197[_0xb41b('0x19')],'include':_0x197197[_0xb41b('0x1b')]?_['map'](_0x197197[_0xb41b('0x1b')],function(_0x27990d){return{'model':db[_0x27990d[_0xb41b('0x1d')]],'as':_0x27990d['as'],'attributes':_0x27990d[_0xb41b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x10b3f6){logger['info']('ShowVtigerAccount',_0x597a35);logger[_0xb41b('0xf')](_0xb41b('0x1f'),_0x597a35,JSON['stringify'](_0x10b3f6));_0x4a95e7(_0x10b3f6);})[_0xb41b('0x14')](function(_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x1f'),_0x47363e[_0xb41b('0x12')],_0x597a35);_0x29da9f(_0x23a6ed['error'](0x1f4,_0x47363e[_0xb41b('0x12')]));});});}; \ No newline at end of file +var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','findAll'];(function(_0x10f10f,_0x38c840){var _0x1089aa=function(_0x3fb6f6){while(--_0x3fb6f6){_0x10f10f['push'](_0x10f10f['shift']());}};_0x1089aa(++_0x38c840);}(_0xe706,0xa3));var _0x6e70=function(_0x2375e1,_0x3d125a){_0x2375e1=_0x2375e1-0x0;var _0x2ccc7d=_0xe706[_0x2375e1];return _0x2ccc7d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['VtigerAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetVtigerAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a206895..2e8906c 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87e2=['get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated'];(function(_0x2341ab,_0x326a6c){var _0x54533e=function(_0x413273){while(--_0x413273){_0x2341ab['push'](_0x2341ab['shift']());}};_0x54533e(++_0x326a6c);}(_0x87e2,0x1d8));var _0x287e=function(_0x38f6bc,_0x10832a){_0x38f6bc=_0x38f6bc-0x0;var _0x209b27=_0x87e2[_0x38f6bc];return _0x209b27;};'use strict';var multer=require(_0x287e('0x0'));var util=require(_0x287e('0x1'));var path=require('path');var timeout=require(_0x287e('0x2'));var express=require(_0x287e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x287e('0x4'));var config=require(_0x287e('0x5'));var controller=require(_0x287e('0x6'));router['get']('/',auth[_0x287e('0x7')](),controller['index']);router[_0x287e('0x8')](_0x287e('0x9'),auth[_0x287e('0x7')](),controller[_0x287e('0xa')]);router['get'](_0x287e('0xb'),auth['isAuthenticated'](),controller[_0x287e('0xc')]);router[_0x287e('0x8')](_0x287e('0xd'),auth[_0x287e('0x7')](),controller['getSubjects']);router[_0x287e('0x8')](_0x287e('0xe'),auth['isAuthenticated'](),controller[_0x287e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x287e('0x10')]);router[_0x287e('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x287e('0x9'),auth['isAuthenticated'](),controller[_0x287e('0x12')]);module[_0x287e('0x13')]=router; \ No newline at end of file +var _0x6901=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x6901,0x98));var _0x1690=function(_0xe5964,_0x1a6057){_0xe5964=_0xe5964-0x0;var _0x5d0680=_0x6901[_0xe5964];return _0x5d0680;};'use strict';var multer=require(_0x1690('0x0'));var util=require(_0x1690('0x1'));var path=require(_0x1690('0x2'));var timeout=require(_0x1690('0x3'));var express=require('express');var router=express[_0x1690('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1690('0x5'));var interaction=require(_0x1690('0x6'));var config=require('../../config/environment');var controller=require(_0x1690('0x7'));router[_0x1690('0x8')]('/',auth['isAuthenticated'](),controller[_0x1690('0x9')]);router['get'](_0x1690('0xa'),auth[_0x1690('0xb')](),controller[_0x1690('0xc')]);router[_0x1690('0x8')](_0x1690('0xd'),auth['isAuthenticated'](),controller[_0x1690('0xe')]);router[_0x1690('0x8')](_0x1690('0xf'),auth['isAuthenticated'](),controller[_0x1690('0x10')]);router[_0x1690('0x8')](_0x1690('0x11'),auth[_0x1690('0xb')](),controller['getDescriptions']);router[_0x1690('0x12')]('/',auth[_0x1690('0xb')](),controller[_0x1690('0x13')]);router[_0x1690('0x14')](_0x1690('0xa'),auth[_0x1690('0xb')](),controller[_0x1690('0x15')]);router[_0x1690('0x16')](_0x1690('0xa'),auth['isAuthenticated'](),controller[_0x1690('0x17')]);module[_0x1690('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c7a725c..5afa751 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x400d=['sequelize'];(function(_0x5c720d,_0x547595){var _0x41971a=function(_0x337407){while(--_0x337407){_0x5c720d['push'](_0x5c720d['shift']());}};_0x41971a(++_0x547595);}(_0x400d,0xd3));var _0xd400=function(_0x1c4831,_0x3ff74a){_0x1c4831=_0x1c4831-0x0;var _0x1e6a6d=_0x400d[_0x1c4831];return _0x1e6a6d;};'use strict';var Sequelize=require(_0xd400('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9730=['sequelize','exports','STRING'];(function(_0x3c10e3,_0x1d5e67){var _0x36098d=function(_0x550877){while(--_0x550877){_0x3c10e3['push'](_0x3c10e3['shift']());}};_0x36098d(++_0x1d5e67);}(_0x9730,0xc9));var _0x0973=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9730[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0973('0x0'));module[_0x0973('0x1')]={'name':{'type':Sequelize[_0x0973('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 619d15d..a3ec39e 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36b9=['to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','length','include','options','find','catch','create','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x35267a,_0x3f5cf0){var _0x422a50=function(_0x2fa4a6){while(--_0x2fa4a6){_0x35267a['push'](_0x35267a['shift']());}};_0x422a50(++_0x3f5cf0);}(_0x36b9,0xe7));var _0x936b=function(_0x5503eb,_0x3590e2){_0x5503eb=_0x5503eb-0x0;var _0x2679d1=_0x36b9[_0x5503eb];return _0x2679d1;};'use strict';var emlformat=require(_0x936b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x936b('0x1'));var jsonpatch=require(_0x936b('0x2'));var rp=require(_0x936b('0x3'));var moment=require(_0x936b('0x4'));var BPromise=require(_0x936b('0x5'));var Mustache=require('mustache');var util=require(_0x936b('0x6'));var path=require(_0x936b('0x7'));var sox=require(_0x936b('0x8'));var csv=require(_0x936b('0x9'));var ejs=require(_0x936b('0xa'));var fs=require('fs');var fs_extra=require(_0x936b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x936b('0xc'));var deskjs=require(_0x936b('0xd'));var toCsv=require(_0x936b('0x9'));var querystring=require(_0x936b('0xe'));var Papa=require('papaparse');var Redis=require(_0x936b('0xf'));var authService=require(_0x936b('0x10'));var qs=require(_0x936b('0x11'));var as=require(_0x936b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x936b('0x13'))(_0x936b('0x14'));var utils=require(_0x936b('0x15'));var config=require(_0x936b('0x16'));var licenseUtil=require(_0x936b('0x17'));var db=require(_0x936b('0x18'))['db'];function respondWithStatusCode(_0xe85ef6,_0x245ad6){_0x245ad6=_0x245ad6||0xcc;return function(_0x2ff1f5){if(_0x2ff1f5){return _0xe85ef6[_0x936b('0x19')](_0x245ad6);}return _0xe85ef6[_0x936b('0x1a')](_0x245ad6)[_0x936b('0x1b')]();};}function respondWithResult(_0x541595,_0x274a8c){_0x274a8c=_0x274a8c||0xc8;return function(_0xe53a8d){if(_0xe53a8d){return _0x541595[_0x936b('0x1a')](_0x274a8c)[_0x936b('0x1c')](_0xe53a8d);}};}function respondWithFilteredResult(_0xc48807,_0x17db4d){return function(_0x6bd6c9){if(_0x6bd6c9){var _0x35e3f0=typeof _0x17db4d[_0x936b('0x1d')]===_0x936b('0x1e')&&typeof _0x17db4d[_0x936b('0x1f')]===_0x936b('0x1e');var _0x343037=_0x6bd6c9[_0x936b('0x20')];var _0x2af32a=_0x35e3f0?0x0:_0x17db4d[_0x936b('0x1d')];var _0x4ac7a2=_0x35e3f0?_0x6bd6c9[_0x936b('0x20')]:_0x17db4d[_0x936b('0x1d')]+_0x17db4d[_0x936b('0x1f')];var _0x38f3bf;if(_0x4ac7a2>=_0x343037){_0x4ac7a2=_0x343037;_0x38f3bf=0xc8;}else{_0x38f3bf=0xce;}_0xc48807[_0x936b('0x1a')](_0x38f3bf);return _0xc48807[_0x936b('0x21')](_0x936b('0x22'),_0x2af32a+'-'+_0x4ac7a2+'/'+_0x343037)[_0x936b('0x1c')](_0x6bd6c9);}return null;};}function patchUpdates(_0x25cc41){return function(_0xeab486){try{jsonpatch['apply'](_0xeab486,_0x25cc41,!![]);}catch(_0x5e7482){return BPromise['reject'](_0x5e7482);}return _0xeab486[_0x936b('0x23')]();};}function saveUpdates(_0x5cb287,_0x29605d){return function(_0x19320a){if(_0x19320a){return _0x19320a[_0x936b('0x24')](_0x5cb287)[_0x936b('0x25')](function(_0x3527ff){return _0x3527ff;});}return null;};}function removeEntity(_0x697bfb,_0x346621){return function(_0x22b5bd){if(_0x22b5bd){return _0x22b5bd[_0x936b('0x26')]()['then'](function(){_0x697bfb[_0x936b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x591094,_0x1f18cf){return function(_0x5d6331){if(!_0x5d6331){_0x591094['sendStatus'](0x194);}return _0x5d6331;};}function handleError(_0x4bd86c,_0x5460f6){_0x5460f6=_0x5460f6||0x1f4;return function(_0x94b80b){logger['error'](_0x94b80b[_0x936b('0x27')]);if(_0x94b80b[_0x936b('0x28')]){delete _0x94b80b[_0x936b('0x28')];}_0x4bd86c[_0x936b('0x1a')](_0x5460f6)[_0x936b('0x29')](_0x94b80b);};}exports[_0x936b('0x2a')]=function(_0xd47295,_0x105c0b){var _0x52e3d8={},_0x13f28f={},_0x3a78ed={'count':0x0,'rows':[]};var _0x3160bf=_[_0x936b('0x2b')](db[_0x936b('0x2c')][_0x936b('0x2d')],function(_0x3c470b){return{'name':_0x3c470b[_0x936b('0x2e')],'type':_0x3c470b[_0x936b('0x2f')][_0x936b('0x30')]};});_0x13f28f[_0x936b('0x31')]=_[_0x936b('0x2b')](_0x3160bf,_0x936b('0x28'));_0x13f28f['query']=_[_0x936b('0x32')](_0xd47295['query']);_0x13f28f[_0x936b('0x33')]=_[_0x936b('0x34')](_0x13f28f['model'],_0x13f28f[_0x936b('0x35')]);_0x52e3d8[_0x936b('0x36')]=_[_0x936b('0x34')](_0x13f28f[_0x936b('0x31')],qs[_0x936b('0x37')](_0xd47295[_0x936b('0x35')][_0x936b('0x37')]));_0x52e3d8['attributes']=_0x52e3d8[_0x936b('0x36')]['length']?_0x52e3d8[_0x936b('0x36')]:_0x13f28f[_0x936b('0x31')];if(!_0xd47295['query'][_0x936b('0x38')](_0x936b('0x39'))){_0x52e3d8[_0x936b('0x1f')]=qs[_0x936b('0x1f')](_0xd47295['query']['limit']);_0x52e3d8['offset']=qs['offset'](_0xd47295[_0x936b('0x35')][_0x936b('0x1d')]);}_0x52e3d8[_0x936b('0x3a')]=qs['sort'](_0xd47295['query'][_0x936b('0x3b')]);_0x52e3d8[_0x936b('0x3c')]=qs['filters'](_[_0x936b('0x3d')](_0xd47295[_0x936b('0x35')],_0x13f28f[_0x936b('0x33')]),_0x3160bf);if(_0xd47295['query']['filter']){_0x52e3d8['where']=_['merge'](_0x52e3d8[_0x936b('0x3c')],{'$or':_[_0x936b('0x2b')](_0x3160bf,function(_0x3f0114){if(_0x3f0114[_0x936b('0x2f')]!=='VIRTUAL'){var _0x14f6f9={};_0x14f6f9[_0x3f0114[_0x936b('0x28')]]={'$like':'%'+_0xd47295['query'][_0x936b('0x3e')]+'%'};return _0x14f6f9;}})});}_0x52e3d8=_[_0x936b('0x3f')]({},_0x52e3d8,_0xd47295['options']);var _0x23e288={'where':_0x52e3d8[_0x936b('0x3c')]};return db[_0x936b('0x2c')][_0x936b('0x20')](_0x23e288)[_0x936b('0x25')](function(_0x217741){_0x3a78ed['count']=_0x217741;if(_0xd47295[_0x936b('0x35')][_0x936b('0x40')]){_0x52e3d8['include']=[{'all':!![]}];}return db[_0x936b('0x2c')][_0x936b('0x41')](_0x52e3d8);})['then'](function(_0x4c2c2d){_0x3a78ed[_0x936b('0x42')]=_0x4c2c2d;return _0x3a78ed;})['then'](respondWithFilteredResult(_0x105c0b,_0x52e3d8))['catch'](handleError(_0x105c0b,null));};exports[_0x936b('0x43')]=function(_0x14dfcf,_0x3072e9){var _0x5b3087={'raw':![],'where':{'id':_0x14dfcf[_0x936b('0x44')]['id']}},_0x1a3d80={};_0x1a3d80[_0x936b('0x31')]=_[_0x936b('0x32')](db['VtigerConfiguration']['rawAttributes']);_0x1a3d80[_0x936b('0x35')]=_['keys'](_0x14dfcf[_0x936b('0x35')]);_0x1a3d80[_0x936b('0x33')]=_[_0x936b('0x34')](_0x1a3d80[_0x936b('0x31')],_0x1a3d80[_0x936b('0x35')]);_0x5b3087[_0x936b('0x36')]=_['intersection'](_0x1a3d80[_0x936b('0x31')],qs['fields'](_0x14dfcf[_0x936b('0x35')][_0x936b('0x37')]));_0x5b3087[_0x936b('0x36')]=_0x5b3087['attributes'][_0x936b('0x45')]?_0x5b3087[_0x936b('0x36')]:_0x1a3d80[_0x936b('0x31')];if(_0x14dfcf[_0x936b('0x35')]['includeAll']){_0x5b3087[_0x936b('0x46')]=[{'all':!![]}];}_0x5b3087=_[_0x936b('0x3f')]({},_0x5b3087,_0x14dfcf[_0x936b('0x47')]);return db[_0x936b('0x2c')][_0x936b('0x48')](_0x5b3087)[_0x936b('0x25')](handleEntityNotFound(_0x3072e9,null))[_0x936b('0x25')](respondWithResult(_0x3072e9,null))[_0x936b('0x49')](handleError(_0x3072e9,null));};exports[_0x936b('0x4a')]=function(_0x2c89be,_0x2b2aff){return db[_0x936b('0x2c')][_0x936b('0x4a')](_0x2c89be['body'],{})[_0x936b('0x25')](respondWithResult(_0x2b2aff,0xc9))[_0x936b('0x49')](handleError(_0x2b2aff,null));};exports['update']=function(_0x38aa08,_0x1351e2){if(_0x38aa08['body']['id']){delete _0x38aa08['body']['id'];}return db[_0x936b('0x2c')][_0x936b('0x48')]({'where':{'id':_0x38aa08[_0x936b('0x44')]['id']}})[_0x936b('0x25')](handleEntityNotFound(_0x1351e2,null))['then'](saveUpdates(_0x38aa08['body'],null))['then'](respondWithResult(_0x1351e2,null))[_0x936b('0x49')](handleError(_0x1351e2,null));};exports['destroy']=function(_0x5a33fb,_0x32ac23){return db[_0x936b('0x2c')]['find']({'where':{'id':_0x5a33fb[_0x936b('0x44')]['id']}})['then'](handleEntityNotFound(_0x32ac23,null))['then'](removeEntity(_0x32ac23,null))[_0x936b('0x49')](handleError(_0x32ac23,null));};exports[_0x936b('0x4b')]=function(_0x53ab67,_0x58785b,_0x2c8ae7){var _0x10d061={};var _0x592d10={};var _0x1dbccf;var _0x28f7f0;return db['VtigerConfiguration'][_0x936b('0x4c')]({'where':{'id':_0x53ab67[_0x936b('0x44')]['id']}})['then'](handleEntityNotFound(_0x58785b,null))[_0x936b('0x25')](function(_0x37f00e){if(_0x37f00e){_0x1dbccf=_0x37f00e;_0x592d10[_0x936b('0x31')]=_['keys'](db[_0x936b('0x4d')][_0x936b('0x2d')]);_0x592d10[_0x936b('0x35')]=_[_0x936b('0x32')](_0x53ab67[_0x936b('0x35')]);_0x592d10['filters']=_[_0x936b('0x34')](_0x592d10['model'],_0x592d10['query']);_0x10d061[_0x936b('0x36')]=_['intersection'](_0x592d10[_0x936b('0x31')],qs[_0x936b('0x37')](_0x53ab67[_0x936b('0x35')][_0x936b('0x37')]));_0x10d061[_0x936b('0x36')]=_0x10d061[_0x936b('0x36')]['length']?_0x10d061['attributes']:_0x592d10[_0x936b('0x31')];_0x10d061[_0x936b('0x3a')]=qs[_0x936b('0x3b')](_0x53ab67[_0x936b('0x35')]['sort']);_0x10d061[_0x936b('0x3c')]=qs[_0x936b('0x33')](_['pick'](_0x53ab67['query'],_0x592d10[_0x936b('0x33')]));if(_0x53ab67[_0x936b('0x35')][_0x936b('0x3e')]){_0x10d061[_0x936b('0x3c')]=_[_0x936b('0x3f')](_0x10d061[_0x936b('0x3c')],{'$or':_[_0x936b('0x2b')](_0x10d061['attributes'],function(_0x2b6c45){var _0x426427={};_0x426427[_0x2b6c45]={'$like':'%'+_0x53ab67['query'][_0x936b('0x3e')]+'%'};return _0x426427;})});}_0x10d061=_[_0x936b('0x3f')]({},_0x10d061,_0x53ab67[_0x936b('0x47')]);return _0x1dbccf['getFields'](_0x10d061);}})[_0x936b('0x25')](function(_0x17df56){if(_0x17df56){_0x28f7f0=_0x17df56['length'];if(!_0x53ab67[_0x936b('0x35')][_0x936b('0x38')](_0x936b('0x39'))){_0x10d061[_0x936b('0x1f')]=qs[_0x936b('0x1f')](_0x53ab67[_0x936b('0x35')][_0x936b('0x1f')]);_0x10d061[_0x936b('0x1d')]=qs['offset'](_0x53ab67[_0x936b('0x35')][_0x936b('0x1d')]);}return _0x1dbccf[_0x936b('0x4b')](_0x10d061);}})['then'](function(_0x178601){if(_0x178601){return _0x178601?{'count':_0x28f7f0,'rows':_0x178601}:null;}})[_0x936b('0x25')](respondWithResult(_0x58785b,null))['catch'](handleError(_0x58785b,null));};exports[_0x936b('0x4e')]=function(_0x12325d,_0x2fd39e,_0x236e46){var _0x378d92={};var _0x5a8392={};var _0x4bcebe;var _0x1baba2;return db[_0x936b('0x2c')][_0x936b('0x4c')]({'where':{'id':_0x12325d[_0x936b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fd39e,null))[_0x936b('0x25')](function(_0x544752){if(_0x544752){_0x4bcebe=_0x544752;_0x5a8392[_0x936b('0x31')]=_[_0x936b('0x32')](db['VtigerField'][_0x936b('0x2d')]);_0x5a8392[_0x936b('0x35')]=_[_0x936b('0x32')](_0x12325d[_0x936b('0x35')]);_0x5a8392[_0x936b('0x33')]=_[_0x936b('0x34')](_0x5a8392[_0x936b('0x31')],_0x5a8392[_0x936b('0x35')]);_0x378d92[_0x936b('0x36')]=_['intersection'](_0x5a8392[_0x936b('0x31')],qs[_0x936b('0x37')](_0x12325d['query'][_0x936b('0x37')]));_0x378d92[_0x936b('0x36')]=_0x378d92[_0x936b('0x36')][_0x936b('0x45')]?_0x378d92[_0x936b('0x36')]:_0x5a8392[_0x936b('0x31')];_0x378d92['order']=qs[_0x936b('0x3b')](_0x12325d[_0x936b('0x35')][_0x936b('0x3b')]);_0x378d92[_0x936b('0x3c')]=qs[_0x936b('0x33')](_[_0x936b('0x3d')](_0x12325d['query'],_0x5a8392['filters']));if(_0x12325d[_0x936b('0x35')][_0x936b('0x3e')]){_0x378d92[_0x936b('0x3c')]=_[_0x936b('0x3f')](_0x378d92[_0x936b('0x3c')],{'$or':_[_0x936b('0x2b')](_0x378d92['attributes'],function(_0x3d4f67){var _0x5e528c={};_0x5e528c[_0x3d4f67]={'$like':'%'+_0x12325d[_0x936b('0x35')][_0x936b('0x3e')]+'%'};return _0x5e528c;})});}_0x378d92=_[_0x936b('0x3f')]({},_0x378d92,_0x12325d['options']);return _0x4bcebe['getSubjects'](_0x378d92);}})[_0x936b('0x25')](function(_0x5b0379){if(_0x5b0379){_0x1baba2=_0x5b0379[_0x936b('0x45')];if(!_0x12325d[_0x936b('0x35')][_0x936b('0x38')](_0x936b('0x39'))){_0x378d92[_0x936b('0x1f')]=qs[_0x936b('0x1f')](_0x12325d[_0x936b('0x35')][_0x936b('0x1f')]);_0x378d92[_0x936b('0x1d')]=qs['offset'](_0x12325d[_0x936b('0x35')]['offset']);}return _0x4bcebe[_0x936b('0x4e')](_0x378d92);}})[_0x936b('0x25')](function(_0x8f7d85){if(_0x8f7d85){return _0x8f7d85?{'count':_0x1baba2,'rows':_0x8f7d85}:null;}})['then'](respondWithResult(_0x2fd39e,null))[_0x936b('0x49')](handleError(_0x2fd39e,null));};exports[_0x936b('0x4f')]=function(_0x47764b,_0x48389c,_0x60b2b){var _0x3411fa={};var _0x24e4a7={};var _0x2d4d58;var _0x41b053;return db[_0x936b('0x2c')][_0x936b('0x4c')]({'where':{'id':_0x47764b[_0x936b('0x44')]['id']}})[_0x936b('0x25')](handleEntityNotFound(_0x48389c,null))[_0x936b('0x25')](function(_0x566567){if(_0x566567){_0x2d4d58=_0x566567;_0x24e4a7['model']=_[_0x936b('0x32')](db[_0x936b('0x4d')][_0x936b('0x2d')]);_0x24e4a7['query']=_[_0x936b('0x32')](_0x47764b[_0x936b('0x35')]);_0x24e4a7[_0x936b('0x33')]=_[_0x936b('0x34')](_0x24e4a7[_0x936b('0x31')],_0x24e4a7[_0x936b('0x35')]);_0x3411fa[_0x936b('0x36')]=_[_0x936b('0x34')](_0x24e4a7[_0x936b('0x31')],qs[_0x936b('0x37')](_0x47764b['query'][_0x936b('0x37')]));_0x3411fa['attributes']=_0x3411fa[_0x936b('0x36')][_0x936b('0x45')]?_0x3411fa[_0x936b('0x36')]:_0x24e4a7[_0x936b('0x31')];_0x3411fa[_0x936b('0x3a')]=qs[_0x936b('0x3b')](_0x47764b['query']['sort']);_0x3411fa['where']=qs[_0x936b('0x33')](_[_0x936b('0x3d')](_0x47764b[_0x936b('0x35')],_0x24e4a7[_0x936b('0x33')]));if(_0x47764b[_0x936b('0x35')][_0x936b('0x3e')]){_0x3411fa[_0x936b('0x3c')]=_['merge'](_0x3411fa['where'],{'$or':_[_0x936b('0x2b')](_0x3411fa[_0x936b('0x36')],function(_0x210575){var _0x150527={};_0x150527[_0x210575]={'$like':'%'+_0x47764b[_0x936b('0x35')][_0x936b('0x3e')]+'%'};return _0x150527;})});}_0x3411fa=_[_0x936b('0x3f')]({},_0x3411fa,_0x47764b['options']);return _0x2d4d58[_0x936b('0x4f')](_0x3411fa);}})['then'](function(_0x1e3449){if(_0x1e3449){_0x41b053=_0x1e3449[_0x936b('0x45')];if(!_0x47764b[_0x936b('0x35')][_0x936b('0x38')](_0x936b('0x39'))){_0x3411fa[_0x936b('0x1f')]=qs[_0x936b('0x1f')](_0x47764b['query'][_0x936b('0x1f')]);_0x3411fa[_0x936b('0x1d')]=qs[_0x936b('0x1d')](_0x47764b[_0x936b('0x35')][_0x936b('0x1d')]);}return _0x2d4d58[_0x936b('0x4f')](_0x3411fa);}})['then'](function(_0x2919eb){if(_0x2919eb){return _0x2919eb?{'count':_0x41b053,'rows':_0x2919eb}:null;}})[_0x936b('0x25')](respondWithResult(_0x48389c,null))[_0x936b('0x49')](handleError(_0x48389c,null));}; \ No newline at end of file +var _0x951a=['where','pick','filter','VIRTUAL','options','count','include','findAll','catch','show','params','merge','find','body','getFields','findOne','VtigerField','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0xd43aed,_0x556f54){var _0x4aa694=function(_0x56817d){while(--_0x56817d){_0xd43aed['push'](_0xd43aed['shift']());}};_0x4aa694(++_0x556f54);}(_0x951a,0x101));var _0xa951=function(_0x294650,_0x4d9729){_0x294650=_0x294650-0x0;var _0x3fe59d=_0x951a[_0x294650];return _0x3fe59d;};'use strict';var emlformat=require(_0xa951('0x0'));var rimraf=require(_0xa951('0x1'));var zipdir=require(_0xa951('0x2'));var jsonpatch=require(_0xa951('0x3'));var rp=require(_0xa951('0x4'));var moment=require('moment');var BPromise=require(_0xa951('0x5'));var Mustache=require(_0xa951('0x6'));var util=require(_0xa951('0x7'));var path=require(_0xa951('0x8'));var sox=require(_0xa951('0x9'));var csv=require(_0xa951('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa951('0xb'));var _=require('lodash');var squel=require(_0xa951('0xc'));var crypto=require(_0xa951('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa951('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa951('0xf'));var Papa=require(_0xa951('0x10'));var Redis=require(_0xa951('0x11'));var authService=require(_0xa951('0x12'));var qs=require(_0xa951('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa951('0x14'));var logger=require(_0xa951('0x15'))(_0xa951('0x16'));var utils=require(_0xa951('0x17'));var config=require(_0xa951('0x18'));var licenseUtil=require(_0xa951('0x19'));var db=require(_0xa951('0x1a'))['db'];function respondWithStatusCode(_0x187bf6,_0x239ac5){_0x239ac5=_0x239ac5||0xcc;return function(_0x11129f){if(_0x11129f){return _0x187bf6[_0xa951('0x1b')](_0x239ac5);}return _0x187bf6[_0xa951('0x1c')](_0x239ac5)[_0xa951('0x1d')]();};}function respondWithResult(_0x211725,_0x1700d8){_0x1700d8=_0x1700d8||0xc8;return function(_0x10e696){if(_0x10e696){return _0x211725['status'](_0x1700d8)[_0xa951('0x1e')](_0x10e696);}};}function respondWithFilteredResult(_0x4e8ad4,_0x5a1b17){return function(_0x5d5a22){if(_0x5d5a22){var _0x928274=typeof _0x5a1b17[_0xa951('0x1f')]===_0xa951('0x20')&&typeof _0x5a1b17[_0xa951('0x21')]===_0xa951('0x20');var _0x51e508=_0x5d5a22['count'];var _0x45aba7=_0x928274?0x0:_0x5a1b17[_0xa951('0x1f')];var _0x11771c=_0x928274?_0x5d5a22['count']:_0x5a1b17[_0xa951('0x1f')]+_0x5a1b17[_0xa951('0x21')];var _0x365513;if(_0x11771c>=_0x51e508){_0x11771c=_0x51e508;_0x365513=0xc8;}else{_0x365513=0xce;}_0x4e8ad4['status'](_0x365513);return _0x4e8ad4['set'](_0xa951('0x22'),_0x45aba7+'-'+_0x11771c+'/'+_0x51e508)['json'](_0x5d5a22);}return null;};}function patchUpdates(_0x516d08){return function(_0x59ad07){try{jsonpatch[_0xa951('0x23')](_0x59ad07,_0x516d08,!![]);}catch(_0x376111){return BPromise[_0xa951('0x24')](_0x376111);}return _0x59ad07['save']();};}function saveUpdates(_0x20182b,_0x54a226){return function(_0x375c9d){if(_0x375c9d){return _0x375c9d[_0xa951('0x25')](_0x20182b)[_0xa951('0x26')](function(_0x1ed7ab){return _0x1ed7ab;});}return null;};}function removeEntity(_0x1863bc,_0x254a8c){return function(_0x5ab357){if(_0x5ab357){return _0x5ab357[_0xa951('0x27')]()[_0xa951('0x26')](function(){_0x1863bc['status'](0xcc)[_0xa951('0x1d')]();});}};}function handleEntityNotFound(_0x3607aa,_0x294153){return function(_0x553cd4){if(!_0x553cd4){_0x3607aa['sendStatus'](0x194);}return _0x553cd4;};}function handleError(_0x2542bc,_0x2fe31f){_0x2fe31f=_0x2fe31f||0x1f4;return function(_0x5d9c2d){logger['error'](_0x5d9c2d[_0xa951('0x28')]);if(_0x5d9c2d[_0xa951('0x29')]){delete _0x5d9c2d['name'];}_0x2542bc[_0xa951('0x1c')](_0x2fe31f)['send'](_0x5d9c2d);};}exports[_0xa951('0x2a')]=function(_0x35d851,_0x430666){var _0x3d9c07={},_0x1728b5={},_0x348e21={'count':0x0,'rows':[]};var _0xbb998a=_[_0xa951('0x2b')](db[_0xa951('0x2c')][_0xa951('0x2d')],function(_0x37d58b){return{'name':_0x37d58b['fieldName'],'type':_0x37d58b[_0xa951('0x2e')][_0xa951('0x2f')]};});_0x1728b5[_0xa951('0x30')]=_[_0xa951('0x2b')](_0xbb998a,'name');_0x1728b5[_0xa951('0x31')]=_[_0xa951('0x32')](_0x35d851[_0xa951('0x31')]);_0x1728b5[_0xa951('0x33')]=_[_0xa951('0x34')](_0x1728b5['model'],_0x1728b5[_0xa951('0x31')]);_0x3d9c07['attributes']=_['intersection'](_0x1728b5['model'],qs[_0xa951('0x35')](_0x35d851[_0xa951('0x31')][_0xa951('0x35')]));_0x3d9c07[_0xa951('0x36')]=_0x3d9c07[_0xa951('0x36')][_0xa951('0x37')]?_0x3d9c07[_0xa951('0x36')]:_0x1728b5['model'];if(!_0x35d851['query']['hasOwnProperty'](_0xa951('0x38'))){_0x3d9c07[_0xa951('0x21')]=qs[_0xa951('0x21')](_0x35d851[_0xa951('0x31')]['limit']);_0x3d9c07[_0xa951('0x1f')]=qs[_0xa951('0x1f')](_0x35d851[_0xa951('0x31')][_0xa951('0x1f')]);}_0x3d9c07[_0xa951('0x39')]=qs[_0xa951('0x3a')](_0x35d851[_0xa951('0x31')][_0xa951('0x3a')]);_0x3d9c07[_0xa951('0x3b')]=qs['filters'](_[_0xa951('0x3c')](_0x35d851[_0xa951('0x31')],_0x1728b5['filters']),_0xbb998a);if(_0x35d851[_0xa951('0x31')][_0xa951('0x3d')]){_0x3d9c07[_0xa951('0x3b')]=_['merge'](_0x3d9c07[_0xa951('0x3b')],{'$or':_[_0xa951('0x2b')](_0xbb998a,function(_0x1d0e89){if(_0x1d0e89[_0xa951('0x2e')]!==_0xa951('0x3e')){var _0x539f32={};_0x539f32[_0x1d0e89[_0xa951('0x29')]]={'$like':'%'+_0x35d851[_0xa951('0x31')][_0xa951('0x3d')]+'%'};return _0x539f32;}})});}_0x3d9c07=_['merge']({},_0x3d9c07,_0x35d851[_0xa951('0x3f')]);var _0x283de8={'where':_0x3d9c07[_0xa951('0x3b')]};return db[_0xa951('0x2c')]['count'](_0x283de8)[_0xa951('0x26')](function(_0x29b76c){_0x348e21[_0xa951('0x40')]=_0x29b76c;if(_0x35d851[_0xa951('0x31')]['includeAll']){_0x3d9c07[_0xa951('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa951('0x42')](_0x3d9c07);})['then'](function(_0x1e5795){_0x348e21['rows']=_0x1e5795;return _0x348e21;})['then'](respondWithFilteredResult(_0x430666,_0x3d9c07))[_0xa951('0x43')](handleError(_0x430666,null));};exports[_0xa951('0x44')]=function(_0x189e07,_0x694692){var _0x253fee={'raw':![],'where':{'id':_0x189e07[_0xa951('0x45')]['id']}},_0x546d17={};_0x546d17['model']=_[_0xa951('0x32')](db[_0xa951('0x2c')]['rawAttributes']);_0x546d17[_0xa951('0x31')]=_['keys'](_0x189e07['query']);_0x546d17['filters']=_['intersection'](_0x546d17[_0xa951('0x30')],_0x546d17[_0xa951('0x31')]);_0x253fee[_0xa951('0x36')]=_[_0xa951('0x34')](_0x546d17[_0xa951('0x30')],qs['fields'](_0x189e07[_0xa951('0x31')][_0xa951('0x35')]));_0x253fee[_0xa951('0x36')]=_0x253fee[_0xa951('0x36')][_0xa951('0x37')]?_0x253fee[_0xa951('0x36')]:_0x546d17[_0xa951('0x30')];if(_0x189e07[_0xa951('0x31')]['includeAll']){_0x253fee[_0xa951('0x41')]=[{'all':!![]}];}_0x253fee=_[_0xa951('0x46')]({},_0x253fee,_0x189e07[_0xa951('0x3f')]);return db['VtigerConfiguration'][_0xa951('0x47')](_0x253fee)[_0xa951('0x26')](handleEntityNotFound(_0x694692,null))[_0xa951('0x26')](respondWithResult(_0x694692,null))[_0xa951('0x43')](handleError(_0x694692,null));};exports['create']=function(_0x3c3ae5,_0x332428){return db[_0xa951('0x2c')]['create'](_0x3c3ae5[_0xa951('0x48')],{})['then'](respondWithResult(_0x332428,0xc9))[_0xa951('0x43')](handleError(_0x332428,null));};exports[_0xa951('0x25')]=function(_0x384141,_0x171c27){if(_0x384141['body']['id']){delete _0x384141['body']['id'];}return db[_0xa951('0x2c')][_0xa951('0x47')]({'where':{'id':_0x384141[_0xa951('0x45')]['id']}})[_0xa951('0x26')](handleEntityNotFound(_0x171c27,null))['then'](saveUpdates(_0x384141[_0xa951('0x48')],null))[_0xa951('0x26')](respondWithResult(_0x171c27,null))[_0xa951('0x43')](handleError(_0x171c27,null));};exports[_0xa951('0x27')]=function(_0x968be7,_0x586932){return db[_0xa951('0x2c')][_0xa951('0x47')]({'where':{'id':_0x968be7['params']['id']}})['then'](handleEntityNotFound(_0x586932,null))[_0xa951('0x26')](removeEntity(_0x586932,null))['catch'](handleError(_0x586932,null));};exports[_0xa951('0x49')]=function(_0x40aa02,_0x1ca2e9,_0x500688){var _0xa12c61={};var _0x463045={};var _0x687586;var _0xb11b1c;return db[_0xa951('0x2c')][_0xa951('0x4a')]({'where':{'id':_0x40aa02[_0xa951('0x45')]['id']}})[_0xa951('0x26')](handleEntityNotFound(_0x1ca2e9,null))[_0xa951('0x26')](function(_0x868ca1){if(_0x868ca1){_0x687586=_0x868ca1;_0x463045['model']=_[_0xa951('0x32')](db[_0xa951('0x4b')][_0xa951('0x2d')]);_0x463045['query']=_['keys'](_0x40aa02['query']);_0x463045[_0xa951('0x33')]=_['intersection'](_0x463045['model'],_0x463045['query']);_0xa12c61[_0xa951('0x36')]=_[_0xa951('0x34')](_0x463045[_0xa951('0x30')],qs[_0xa951('0x35')](_0x40aa02[_0xa951('0x31')][_0xa951('0x35')]));_0xa12c61['attributes']=_0xa12c61[_0xa951('0x36')][_0xa951('0x37')]?_0xa12c61[_0xa951('0x36')]:_0x463045[_0xa951('0x30')];_0xa12c61['order']=qs[_0xa951('0x3a')](_0x40aa02[_0xa951('0x31')][_0xa951('0x3a')]);_0xa12c61['where']=qs[_0xa951('0x33')](_[_0xa951('0x3c')](_0x40aa02[_0xa951('0x31')],_0x463045[_0xa951('0x33')]));if(_0x40aa02[_0xa951('0x31')][_0xa951('0x3d')]){_0xa12c61['where']=_[_0xa951('0x46')](_0xa12c61[_0xa951('0x3b')],{'$or':_[_0xa951('0x2b')](_0xa12c61['attributes'],function(_0xca28b1){var _0x283734={};_0x283734[_0xca28b1]={'$like':'%'+_0x40aa02[_0xa951('0x31')][_0xa951('0x3d')]+'%'};return _0x283734;})});}_0xa12c61=_[_0xa951('0x46')]({},_0xa12c61,_0x40aa02[_0xa951('0x3f')]);return _0x687586[_0xa951('0x49')](_0xa12c61);}})[_0xa951('0x26')](function(_0x5cdcc8){if(_0x5cdcc8){_0xb11b1c=_0x5cdcc8[_0xa951('0x37')];if(!_0x40aa02[_0xa951('0x31')]['hasOwnProperty'](_0xa951('0x38'))){_0xa12c61[_0xa951('0x21')]=qs['limit'](_0x40aa02[_0xa951('0x31')][_0xa951('0x21')]);_0xa12c61[_0xa951('0x1f')]=qs[_0xa951('0x1f')](_0x40aa02[_0xa951('0x31')][_0xa951('0x1f')]);}return _0x687586[_0xa951('0x49')](_0xa12c61);}})[_0xa951('0x26')](function(_0x179138){if(_0x179138){return _0x179138?{'count':_0xb11b1c,'rows':_0x179138}:null;}})['then'](respondWithResult(_0x1ca2e9,null))['catch'](handleError(_0x1ca2e9,null));};exports[_0xa951('0x4c')]=function(_0x36e341,_0x4571c5,_0x2924b2){var _0x30278c={};var _0x3ad1b4={};var _0xabcd5e;var _0x5e58ea;return db[_0xa951('0x2c')][_0xa951('0x4a')]({'where':{'id':_0x36e341[_0xa951('0x45')]['id']}})[_0xa951('0x26')](handleEntityNotFound(_0x4571c5,null))[_0xa951('0x26')](function(_0xe92de7){if(_0xe92de7){_0xabcd5e=_0xe92de7;_0x3ad1b4['model']=_[_0xa951('0x32')](db[_0xa951('0x4b')][_0xa951('0x2d')]);_0x3ad1b4[_0xa951('0x31')]=_[_0xa951('0x32')](_0x36e341[_0xa951('0x31')]);_0x3ad1b4['filters']=_['intersection'](_0x3ad1b4[_0xa951('0x30')],_0x3ad1b4[_0xa951('0x31')]);_0x30278c['attributes']=_[_0xa951('0x34')](_0x3ad1b4[_0xa951('0x30')],qs[_0xa951('0x35')](_0x36e341[_0xa951('0x31')][_0xa951('0x35')]));_0x30278c['attributes']=_0x30278c[_0xa951('0x36')][_0xa951('0x37')]?_0x30278c[_0xa951('0x36')]:_0x3ad1b4['model'];_0x30278c['order']=qs['sort'](_0x36e341['query'][_0xa951('0x3a')]);_0x30278c['where']=qs[_0xa951('0x33')](_[_0xa951('0x3c')](_0x36e341[_0xa951('0x31')],_0x3ad1b4[_0xa951('0x33')]));if(_0x36e341[_0xa951('0x31')][_0xa951('0x3d')]){_0x30278c[_0xa951('0x3b')]=_['merge'](_0x30278c[_0xa951('0x3b')],{'$or':_[_0xa951('0x2b')](_0x30278c[_0xa951('0x36')],function(_0xcfe8ec){var _0x3df4d0={};_0x3df4d0[_0xcfe8ec]={'$like':'%'+_0x36e341[_0xa951('0x31')][_0xa951('0x3d')]+'%'};return _0x3df4d0;})});}_0x30278c=_['merge']({},_0x30278c,_0x36e341[_0xa951('0x3f')]);return _0xabcd5e[_0xa951('0x4c')](_0x30278c);}})['then'](function(_0x25726f){if(_0x25726f){_0x5e58ea=_0x25726f['length'];if(!_0x36e341[_0xa951('0x31')][_0xa951('0x4d')](_0xa951('0x38'))){_0x30278c[_0xa951('0x21')]=qs[_0xa951('0x21')](_0x36e341[_0xa951('0x31')][_0xa951('0x21')]);_0x30278c[_0xa951('0x1f')]=qs[_0xa951('0x1f')](_0x36e341['query'][_0xa951('0x1f')]);}return _0xabcd5e['getSubjects'](_0x30278c);}})[_0xa951('0x26')](function(_0x58dab8){if(_0x58dab8){return _0x58dab8?{'count':_0x5e58ea,'rows':_0x58dab8}:null;}})[_0xa951('0x26')](respondWithResult(_0x4571c5,null))[_0xa951('0x43')](handleError(_0x4571c5,null));};exports['getDescriptions']=function(_0x2d1c14,_0x4953fc,_0x4eb9c6){var _0x30c4c9={};var _0x52ed60={};var _0x52d6a9;var _0x309581;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2d1c14[_0xa951('0x45')]['id']}})['then'](handleEntityNotFound(_0x4953fc,null))[_0xa951('0x26')](function(_0x27e479){if(_0x27e479){_0x52d6a9=_0x27e479;_0x52ed60['model']=_[_0xa951('0x32')](db[_0xa951('0x4b')]['rawAttributes']);_0x52ed60[_0xa951('0x31')]=_[_0xa951('0x32')](_0x2d1c14[_0xa951('0x31')]);_0x52ed60[_0xa951('0x33')]=_[_0xa951('0x34')](_0x52ed60[_0xa951('0x30')],_0x52ed60[_0xa951('0x31')]);_0x30c4c9[_0xa951('0x36')]=_[_0xa951('0x34')](_0x52ed60['model'],qs['fields'](_0x2d1c14[_0xa951('0x31')][_0xa951('0x35')]));_0x30c4c9[_0xa951('0x36')]=_0x30c4c9[_0xa951('0x36')]['length']?_0x30c4c9[_0xa951('0x36')]:_0x52ed60[_0xa951('0x30')];_0x30c4c9[_0xa951('0x39')]=qs['sort'](_0x2d1c14[_0xa951('0x31')][_0xa951('0x3a')]);_0x30c4c9[_0xa951('0x3b')]=qs[_0xa951('0x33')](_['pick'](_0x2d1c14[_0xa951('0x31')],_0x52ed60[_0xa951('0x33')]));if(_0x2d1c14[_0xa951('0x31')][_0xa951('0x3d')]){_0x30c4c9[_0xa951('0x3b')]=_[_0xa951('0x46')](_0x30c4c9['where'],{'$or':_[_0xa951('0x2b')](_0x30c4c9[_0xa951('0x36')],function(_0x501691){var _0x20a760={};_0x20a760[_0x501691]={'$like':'%'+_0x2d1c14['query'][_0xa951('0x3d')]+'%'};return _0x20a760;})});}_0x30c4c9=_[_0xa951('0x46')]({},_0x30c4c9,_0x2d1c14[_0xa951('0x3f')]);return _0x52d6a9['getDescriptions'](_0x30c4c9);}})[_0xa951('0x26')](function(_0x3be975){if(_0x3be975){_0x309581=_0x3be975[_0xa951('0x37')];if(!_0x2d1c14['query']['hasOwnProperty']('nolimit')){_0x30c4c9[_0xa951('0x21')]=qs['limit'](_0x2d1c14['query']['limit']);_0x30c4c9[_0xa951('0x1f')]=qs['offset'](_0x2d1c14[_0xa951('0x31')][_0xa951('0x1f')]);}return _0x52d6a9[_0xa951('0x4e')](_0x30c4c9);}})[_0xa951('0x26')](function(_0x2296f4){if(_0x2296f4){return _0x2296f4?{'count':_0x309581,'rows':_0x2296f4}:null;}})[_0xa951('0x26')](respondWithResult(_0x4953fc,null))['catch'](handleError(_0x4953fc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 675ba60..e667a65 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed7d=['int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x41de18,_0x5a79d){var _0x557ffb=function(_0x58bddd){while(--_0x58bddd){_0x41de18['push'](_0x41de18['shift']());}};_0x557ffb(++_0x5a79d);}(_0xed7d,0x17b));var _0xded7=function(_0x2f9eeb,_0x53b0b6){_0x2f9eeb=_0x2f9eeb-0x0;var _0xcf83bc=_0xed7d[_0x2f9eeb];return _0xcf83bc;};'use strict';var _=require(_0xded7('0x0'));var util=require(_0xded7('0x1'));var logger=require(_0xded7('0x2'))(_0xded7('0x3'));var moment=require(_0xded7('0x4'));var BPromise=require(_0xded7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xded7('0x6'));var rimraf=require(_0xded7('0x7'));var config=require(_0xded7('0x8'));var attributes=require(_0xded7('0x9'));module[_0xded7('0xa')]=function(_0x287022,_0x3497e6){return _0x287022[_0xded7('0xb')](_0xded7('0xc'),attributes,{'tableName':_0xded7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc1d=['VtigerConfiguration','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x5db99b,_0x500bff){var _0x2a8e17=function(_0x2a0c0b){while(--_0x2a0c0b){_0x5db99b['push'](_0x5db99b['shift']());}};_0x2a8e17(++_0x500bff);}(_0xcc1d,0x12a));var _0xdcc1=function(_0x16dced,_0x2f8d60){_0x16dced=_0x16dced-0x0;var _0x40e9d7=_0xcc1d[_0x16dced];return _0x40e9d7;};'use strict';var _=require(_0xdcc1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdcc1('0x1'));var moment=require('moment');var BPromise=require(_0xdcc1('0x2'));var rp=require(_0xdcc1('0x3'));var fs=require('fs');var path=require(_0xdcc1('0x4'));var rimraf=require(_0xdcc1('0x5'));var config=require(_0xdcc1('0x6'));var attributes=require(_0xdcc1('0x7'));module[_0xdcc1('0x8')]=function(_0x447798,_0x10b2eb){return _0x447798[_0xdcc1('0x9')](_0xdcc1('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index c1f41ef..dfed594 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68ad=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x307d4e,_0x4bbb11){var _0x184d26=function(_0x3ba15d){while(--_0x3ba15d){_0x307d4e['push'](_0x307d4e['shift']());}};_0x184d26(++_0x4bbb11);}(_0x68ad,0x93));var _0xd68a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd68a('0x0'));var util=require(_0xd68a('0x1'));var moment=require(_0xd68a('0x2'));var BPromise=require('bluebird');var rs=require(_0xd68a('0x3'));var fs=require('fs');var Redis=require(_0xd68a('0x4'));var db=require(_0xd68a('0x5'))['db'];var utils=require(_0xd68a('0x6'));var logger=require(_0xd68a('0x7'))(_0xd68a('0x8'));var config=require('../../config/environment');var jayson=require(_0xd68a('0x9'));var client=jayson[_0xd68a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34ea62,_0x334e67,_0x22113e){return new BPromise(function(_0x398cc3,_0x28b2af){return client[_0xd68a('0xb')](_0x34ea62,_0x22113e)['then'](function(_0xa5eb72){logger[_0xd68a('0xc')](_0xd68a('0xd'),_0x334e67,_0xd68a('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x334e67,'request\x20sent',JSON['stringify'](_0xa5eb72));if(_0xa5eb72[_0xd68a('0xf')]){if(_0xa5eb72[_0xd68a('0xf')]['code']===0x1f4){logger[_0xd68a('0xf')](_0xd68a('0xd'),_0x334e67,_0xa5eb72[_0xd68a('0xf')][_0xd68a('0x10')]);return _0x28b2af(_0xa5eb72[_0xd68a('0xf')]['message']);}logger['error'](_0xd68a('0xd'),_0x334e67,_0xa5eb72['error'][_0xd68a('0x10')]);return _0x398cc3(_0xa5eb72['error'][_0xd68a('0x10')]);}else{logger[_0xd68a('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x334e67,'request\x20sent');_0x398cc3(_0xa5eb72[_0xd68a('0x11')][_0xd68a('0x10')]);}})[_0xd68a('0x12')](function(_0x3a6a66){logger[_0xd68a('0xf')](_0xd68a('0xd'),_0x334e67,_0x3a6a66);_0x28b2af(_0x3a6a66);});});} \ No newline at end of file +var _0x7ff4=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x232e3e,_0x20e1e6){var _0x4f241a=function(_0x3b04bf){while(--_0x3b04bf){_0x232e3e['push'](_0x232e3e['shift']());}};_0x4f241a(++_0x20e1e6);}(_0x7ff4,0xd0));var _0x47ff=function(_0x4c745b,_0x5a43da){_0x4c745b=_0x4c745b-0x0;var _0x5584ab=_0x7ff4[_0x4c745b];return _0x5584ab;};'use strict';var _=require(_0x47ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x47ff('0x1'));var rs=require(_0x47ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47ff('0x3'));var logger=require(_0x47ff('0x4'))('rpc');var config=require(_0x47ff('0x5'));var jayson=require(_0x47ff('0x6'));var client=jayson[_0x47ff('0x7')][_0x47ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37eb25,_0x14db24,_0x51e435){return new BPromise(function(_0x3bb116,_0x180e29){return client[_0x47ff('0x9')](_0x37eb25,_0x51e435)[_0x47ff('0xa')](function(_0x12eb2b){logger[_0x47ff('0xb')](_0x47ff('0xc'),_0x14db24,_0x47ff('0xd'));logger[_0x47ff('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x14db24,'request\x20sent',JSON[_0x47ff('0xf')](_0x12eb2b));if(_0x12eb2b['error']){if(_0x12eb2b[_0x47ff('0x10')]['code']===0x1f4){logger[_0x47ff('0x10')](_0x47ff('0xc'),_0x14db24,_0x12eb2b[_0x47ff('0x10')][_0x47ff('0x11')]);return _0x180e29(_0x12eb2b[_0x47ff('0x10')][_0x47ff('0x11')]);}logger[_0x47ff('0x10')](_0x47ff('0xc'),_0x14db24,_0x12eb2b[_0x47ff('0x10')][_0x47ff('0x11')]);return _0x3bb116(_0x12eb2b[_0x47ff('0x10')]['message']);}else{logger[_0x47ff('0xb')](_0x47ff('0xc'),_0x14db24,'request\x20sent');_0x3bb116(_0x12eb2b[_0x47ff('0x12')][_0x47ff('0x11')]);}})[_0x47ff('0x13')](function(_0xfd5984){logger['error'](_0x47ff('0xc'),_0x14db24,_0xfd5984);_0x180e29(_0xfd5984);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 5202fe8..429375e 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe939=['show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0x347649,_0x635b73){var _0x2eebec=function(_0x29b104){while(--_0x29b104){_0x347649['push'](_0x347649['shift']());}};_0x2eebec(++_0x635b73);}(_0xe939,0x1f3));var _0x9e93=function(_0x5bb1c1,_0x39c8cf){_0x5bb1c1=_0x5bb1c1-0x0;var _0xe8d648=_0xe939[_0x5bb1c1];return _0xe8d648;};'use strict';var multer=require(_0x9e93('0x0'));var util=require(_0x9e93('0x1'));var path=require(_0x9e93('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e93('0x3'));var router=express[_0x9e93('0x4')]();var fs_extra=require(_0x9e93('0x5'));var auth=require(_0x9e93('0x6'));var interaction=require(_0x9e93('0x7'));var config=require(_0x9e93('0x8'));var controller=require(_0x9e93('0x9'));router[_0x9e93('0xa')]('/',auth[_0x9e93('0xb')](),controller[_0x9e93('0xc')]);router[_0x9e93('0xa')](_0x9e93('0xd'),auth['isAuthenticated'](),controller[_0x9e93('0xe')]);router['post']('/',auth[_0x9e93('0xb')](),controller['create']);router['put'](_0x9e93('0xd'),auth[_0x9e93('0xb')](),controller[_0x9e93('0xf')]);router[_0x9e93('0x10')](_0x9e93('0xd'),auth['isAuthenticated'](),controller[_0x9e93('0x11')]);module[_0x9e93('0x12')]=router; \ No newline at end of file +var _0x34cb=['delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x24aecf,_0x394d21){var _0xf28db=function(_0x69577c){while(--_0x69577c){_0x24aecf['push'](_0x24aecf['shift']());}};_0xf28db(++_0x394d21);}(_0x34cb,0x1ef));var _0xb34c=function(_0x192b15,_0x43f5d1){_0x192b15=_0x192b15-0x0;var _0x10ca4e=_0x34cb[_0x192b15];return _0x10ca4e;};'use strict';var multer=require(_0xb34c('0x0'));var util=require(_0xb34c('0x1'));var path=require('path');var timeout=require(_0xb34c('0x2'));var express=require('express');var router=express[_0xb34c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb34c('0x4'));var interaction=require(_0xb34c('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xb34c('0x6')](),controller[_0xb34c('0x7')]);router[_0xb34c('0x8')](_0xb34c('0x9'),auth[_0xb34c('0x6')](),controller[_0xb34c('0xa')]);router[_0xb34c('0xb')]('/',auth[_0xb34c('0x6')](),controller[_0xb34c('0xc')]);router[_0xb34c('0xd')](_0xb34c('0x9'),auth['isAuthenticated'](),controller[_0xb34c('0xe')]);router[_0xb34c('0xf')](_0xb34c('0x9'),auth[_0xb34c('0x6')](),controller[_0xb34c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b48eb39..16da0b6 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x851c=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x4dd8b2,_0x7421f7){var _0x28fb0a=function(_0x3882fd){while(--_0x3882fd){_0x4dd8b2['push'](_0x4dd8b2['shift']());}};_0x28fb0a(++_0x7421f7);}(_0x851c,0x79));var _0xc851=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x851c[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xc851('0x0'));module[_0xc851('0x1')]={'type':{'type':Sequelize[_0xc851('0x2')](_0xc851('0x3'),'variable',_0xc851('0x4'),_0xc851('0x5'),_0xc851('0x6')),'defaultValue':_0xc851('0x3')},'content':{'type':Sequelize[_0xc851('0x7')]},'key':{'type':Sequelize[_0xc851('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc851('0x3'),'variable',_0xc851('0x4'))},'keyContent':{'type':Sequelize[_0xc851('0x7')]},'idField':{'type':Sequelize[_0xc851('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc851('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc851('0x7')]}}; \ No newline at end of file +var _0xd026=['string','STRING','sequelize','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x1fae4c,_0x415a2c){var _0xe7137f=function(_0x4b8b01){while(--_0x4b8b01){_0x1fae4c['push'](_0x1fae4c['shift']());}};_0xe7137f(++_0x415a2c);}(_0xd026,0x152));var _0x6d02=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xd026[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x6d02('0x0'));module['exports']={'type':{'type':Sequelize[_0x6d02('0x1')]('string',_0x6d02('0x2'),_0x6d02('0x3'),_0x6d02('0x4'),_0x6d02('0x5')),'defaultValue':_0x6d02('0x6')},'content':{'type':Sequelize[_0x6d02('0x7')]},'key':{'type':Sequelize[_0x6d02('0x7')]},'keyType':{'type':Sequelize[_0x6d02('0x1')](_0x6d02('0x6'),'variable',_0x6d02('0x3'))},'keyContent':{'type':Sequelize[_0x6d02('0x7')]},'idField':{'type':Sequelize[_0x6d02('0x7')]},'nameField':{'type':Sequelize[_0x6d02('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d08f959..d319f56 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddac=['util','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VtigerField','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xddac,0xd1));var _0xcdda=function(_0x3712ac,_0x399adc){_0x3712ac=_0x3712ac-0x0;var _0x356928=_0xddac[_0x3712ac];return _0x356928;};'use strict';var emlformat=require(_0xcdda('0x0'));var rimraf=require(_0xcdda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcdda('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcdda('0x3'));var util=require(_0xcdda('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xcdda('0x5'));var ejs=require(_0xcdda('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcdda('0x7'));var crypto=require(_0xcdda('0x8'));var jsforce=require(_0xcdda('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xcdda('0x5'));var querystring=require('querystring');var Papa=require(_0xcdda('0xa'));var Redis=require(_0xcdda('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xcdda('0xc'));var as=require(_0xcdda('0xd'));var hardwareService=require(_0xcdda('0xe'));var logger=require(_0xcdda('0xf'))(_0xcdda('0x10'));var utils=require(_0xcdda('0x11'));var config=require(_0xcdda('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdda('0x13'))['db'];function respondWithStatusCode(_0x374088,_0x508870){_0x508870=_0x508870||0xcc;return function(_0x53d9d4){if(_0x53d9d4){return _0x374088[_0xcdda('0x14')](_0x508870);}return _0x374088[_0xcdda('0x15')](_0x508870)['end']();};}function respondWithResult(_0x4e3583,_0x279117){_0x279117=_0x279117||0xc8;return function(_0x41275c){if(_0x41275c){return _0x4e3583[_0xcdda('0x15')](_0x279117)[_0xcdda('0x16')](_0x41275c);}};}function respondWithFilteredResult(_0x85841f,_0x7fff9d){return function(_0x2895af){if(_0x2895af){var _0x301963=typeof _0x7fff9d[_0xcdda('0x17')]==='undefined'&&typeof _0x7fff9d[_0xcdda('0x18')]===_0xcdda('0x19');var _0x47c74e=_0x2895af[_0xcdda('0x1a')];var _0xfe8193=_0x301963?0x0:_0x7fff9d[_0xcdda('0x17')];var _0x2c59e0=_0x301963?_0x2895af[_0xcdda('0x1a')]:_0x7fff9d[_0xcdda('0x17')]+_0x7fff9d[_0xcdda('0x18')];var _0x8de995;if(_0x2c59e0>=_0x47c74e){_0x2c59e0=_0x47c74e;_0x8de995=0xc8;}else{_0x8de995=0xce;}_0x85841f[_0xcdda('0x15')](_0x8de995);return _0x85841f[_0xcdda('0x1b')](_0xcdda('0x1c'),_0xfe8193+'-'+_0x2c59e0+'/'+_0x47c74e)['json'](_0x2895af);}return null;};}function patchUpdates(_0x3f059a){return function(_0x5785d2){try{jsonpatch[_0xcdda('0x1d')](_0x5785d2,_0x3f059a,!![]);}catch(_0x5590d5){return BPromise[_0xcdda('0x1e')](_0x5590d5);}return _0x5785d2['save']();};}function saveUpdates(_0x376d0c,_0x1c424c){return function(_0x2f9a9a){if(_0x2f9a9a){return _0x2f9a9a[_0xcdda('0x1f')](_0x376d0c)[_0xcdda('0x20')](function(_0x21ec57){return _0x21ec57;});}return null;};}function removeEntity(_0x4413a2,_0x5a6208){return function(_0x216ed0){if(_0x216ed0){return _0x216ed0['destroy']()['then'](function(){_0x4413a2[_0xcdda('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38d08e,_0x169fd3){return function(_0x550362){if(!_0x550362){_0x38d08e[_0xcdda('0x14')](0x194);}return _0x550362;};}function handleError(_0x427528,_0x56f51e){_0x56f51e=_0x56f51e||0x1f4;return function(_0x76a7aa){logger[_0xcdda('0x21')](_0x76a7aa['stack']);if(_0x76a7aa['name']){delete _0x76a7aa[_0xcdda('0x22')];}_0x427528['status'](_0x56f51e)[_0xcdda('0x23')](_0x76a7aa);};}exports[_0xcdda('0x24')]=function(_0x37474c,_0x3fa988){var _0x8bdbdd={},_0xffac73={},_0x233959={'count':0x0,'rows':[]};var _0x5ef079=_[_0xcdda('0x25')](db['VtigerField']['rawAttributes'],function(_0x259d36){return{'name':_0x259d36[_0xcdda('0x26')],'type':_0x259d36[_0xcdda('0x27')][_0xcdda('0x28')]};});_0xffac73[_0xcdda('0x29')]=_['map'](_0x5ef079,_0xcdda('0x22'));_0xffac73[_0xcdda('0x2a')]=_[_0xcdda('0x2b')](_0x37474c[_0xcdda('0x2a')]);_0xffac73['filters']=_[_0xcdda('0x2c')](_0xffac73[_0xcdda('0x29')],_0xffac73[_0xcdda('0x2a')]);_0x8bdbdd['attributes']=_[_0xcdda('0x2c')](_0xffac73[_0xcdda('0x29')],qs[_0xcdda('0x2d')](_0x37474c[_0xcdda('0x2a')][_0xcdda('0x2d')]));_0x8bdbdd[_0xcdda('0x2e')]=_0x8bdbdd['attributes'][_0xcdda('0x2f')]?_0x8bdbdd[_0xcdda('0x2e')]:_0xffac73['model'];if(!_0x37474c['query'][_0xcdda('0x30')](_0xcdda('0x31'))){_0x8bdbdd[_0xcdda('0x18')]=qs['limit'](_0x37474c[_0xcdda('0x2a')][_0xcdda('0x18')]);_0x8bdbdd[_0xcdda('0x17')]=qs[_0xcdda('0x17')](_0x37474c[_0xcdda('0x2a')][_0xcdda('0x17')]);}_0x8bdbdd[_0xcdda('0x32')]=qs['sort'](_0x37474c[_0xcdda('0x2a')][_0xcdda('0x33')]);_0x8bdbdd[_0xcdda('0x34')]=qs[_0xcdda('0x35')](_[_0xcdda('0x36')](_0x37474c[_0xcdda('0x2a')],_0xffac73[_0xcdda('0x35')]),_0x5ef079);if(_0x37474c[_0xcdda('0x2a')][_0xcdda('0x37')]){_0x8bdbdd[_0xcdda('0x34')]=_['merge'](_0x8bdbdd[_0xcdda('0x34')],{'$or':_[_0xcdda('0x25')](_0x5ef079,function(_0x3d8010){if(_0x3d8010[_0xcdda('0x27')]!=='VIRTUAL'){var _0x24d18a={};_0x24d18a[_0x3d8010['name']]={'$like':'%'+_0x37474c['query'][_0xcdda('0x37')]+'%'};return _0x24d18a;}})});}_0x8bdbdd=_[_0xcdda('0x38')]({},_0x8bdbdd,_0x37474c[_0xcdda('0x39')]);var _0x3021a5={'where':_0x8bdbdd['where']};return db[_0xcdda('0x3a')][_0xcdda('0x1a')](_0x3021a5)['then'](function(_0x1d0ce1){_0x233959[_0xcdda('0x1a')]=_0x1d0ce1;if(_0x37474c[_0xcdda('0x2a')]['includeAll']){_0x8bdbdd['include']=[{'all':!![]}];}return db[_0xcdda('0x3a')][_0xcdda('0x3b')](_0x8bdbdd);})[_0xcdda('0x20')](function(_0x2d90d1){_0x233959[_0xcdda('0x3c')]=_0x2d90d1;return _0x233959;})[_0xcdda('0x20')](respondWithFilteredResult(_0x3fa988,_0x8bdbdd))[_0xcdda('0x3d')](handleError(_0x3fa988,null));};exports[_0xcdda('0x3e')]=function(_0x3567e6,_0x30980a){var _0x597ddf={'raw':!![],'where':{'id':_0x3567e6[_0xcdda('0x3f')]['id']}},_0x2848e4={};_0x2848e4['model']=_[_0xcdda('0x2b')](db[_0xcdda('0x3a')][_0xcdda('0x40')]);_0x2848e4[_0xcdda('0x2a')]=_[_0xcdda('0x2b')](_0x3567e6[_0xcdda('0x2a')]);_0x2848e4['filters']=_['intersection'](_0x2848e4[_0xcdda('0x29')],_0x2848e4[_0xcdda('0x2a')]);_0x597ddf[_0xcdda('0x2e')]=_[_0xcdda('0x2c')](_0x2848e4['model'],qs[_0xcdda('0x2d')](_0x3567e6[_0xcdda('0x2a')][_0xcdda('0x2d')]));_0x597ddf[_0xcdda('0x2e')]=_0x597ddf[_0xcdda('0x2e')][_0xcdda('0x2f')]?_0x597ddf[_0xcdda('0x2e')]:_0x2848e4['model'];if(_0x3567e6[_0xcdda('0x2a')][_0xcdda('0x41')]){_0x597ddf[_0xcdda('0x42')]=[{'all':!![]}];}_0x597ddf=_[_0xcdda('0x38')]({},_0x597ddf,_0x3567e6['options']);return db['VtigerField'][_0xcdda('0x43')](_0x597ddf)[_0xcdda('0x20')](handleEntityNotFound(_0x30980a,null))[_0xcdda('0x20')](respondWithResult(_0x30980a,null))['catch'](handleError(_0x30980a,null));};exports['create']=function(_0x5baf42,_0x10f7f4){return db[_0xcdda('0x3a')][_0xcdda('0x44')](_0x5baf42[_0xcdda('0x45')],{})['then'](respondWithResult(_0x10f7f4,0xc9))[_0xcdda('0x3d')](handleError(_0x10f7f4,null));};exports[_0xcdda('0x1f')]=function(_0x55aea5,_0x27d495){if(_0x55aea5['body']['id']){delete _0x55aea5['body']['id'];}return db[_0xcdda('0x3a')][_0xcdda('0x43')]({'where':{'id':_0x55aea5[_0xcdda('0x3f')]['id']}})['then'](handleEntityNotFound(_0x27d495,null))['then'](saveUpdates(_0x55aea5['body'],null))['then'](respondWithResult(_0x27d495,null))[_0xcdda('0x3d')](handleError(_0x27d495,null));};exports[_0xcdda('0x46')]=function(_0x514526,_0x51888d){return db[_0xcdda('0x3a')][_0xcdda('0x43')]({'where':{'id':_0x514526[_0xcdda('0x3f')]['id']}})[_0xcdda('0x20')](handleEntityNotFound(_0x51888d,null))[_0xcdda('0x20')](removeEntity(_0x51888d,null))[_0xcdda('0x3d')](handleError(_0x51888d,null));}; \ No newline at end of file +var _0xa4bf=['rows','show','params','fields','include','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','destroy','then','error','stack','name','rawAttributes','model','map','query','keys','attributes','length','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','VtigerField','includeAll','findAll'];(function(_0x1488af,_0x4a8f42){var _0x4efbec=function(_0x2c28d0){while(--_0x2c28d0){_0x1488af['push'](_0x1488af['shift']());}};_0x4efbec(++_0x4a8f42);}(_0xa4bf,0x98));var _0xfa4b=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0xa4bf[_0x4ca288];return _0x2362c1;};'use strict';var emlformat=require(_0xfa4b('0x0'));var rimraf=require(_0xfa4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa4b('0x2'));var rp=require(_0xfa4b('0x3'));var moment=require(_0xfa4b('0x4'));var BPromise=require(_0xfa4b('0x5'));var Mustache=require(_0xfa4b('0x6'));var util=require('util');var path=require(_0xfa4b('0x7'));var sox=require(_0xfa4b('0x8'));var csv=require(_0xfa4b('0x9'));var ejs=require(_0xfa4b('0xa'));var fs=require('fs');var fs_extra=require(_0xfa4b('0xb'));var _=require(_0xfa4b('0xc'));var squel=require(_0xfa4b('0xd'));var crypto=require(_0xfa4b('0xe'));var jsforce=require(_0xfa4b('0xf'));var deskjs=require(_0xfa4b('0x10'));var toCsv=require(_0xfa4b('0x9'));var querystring=require(_0xfa4b('0x11'));var Papa=require(_0xfa4b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfa4b('0x13'));var as=require(_0xfa4b('0x14'));var hardwareService=require(_0xfa4b('0x15'));var logger=require(_0xfa4b('0x16'))('api');var utils=require(_0xfa4b('0x17'));var config=require(_0xfa4b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11baaa,_0x1e695e){_0x1e695e=_0x1e695e||0xcc;return function(_0x378bd5){if(_0x378bd5){return _0x11baaa[_0xfa4b('0x19')](_0x1e695e);}return _0x11baaa[_0xfa4b('0x1a')](_0x1e695e)[_0xfa4b('0x1b')]();};}function respondWithResult(_0x37d0cd,_0x566858){_0x566858=_0x566858||0xc8;return function(_0x51b0de){if(_0x51b0de){return _0x37d0cd[_0xfa4b('0x1a')](_0x566858)['json'](_0x51b0de);}};}function respondWithFilteredResult(_0x2dc3ce,_0x33319e){return function(_0x45bbcd){if(_0x45bbcd){var _0xa9e377=typeof _0x33319e[_0xfa4b('0x1c')]==='undefined'&&typeof _0x33319e[_0xfa4b('0x1d')]===_0xfa4b('0x1e');var _0x1d38a7=_0x45bbcd['count'];var _0x1a6212=_0xa9e377?0x0:_0x33319e[_0xfa4b('0x1c')];var _0x41f887=_0xa9e377?_0x45bbcd[_0xfa4b('0x1f')]:_0x33319e[_0xfa4b('0x1c')]+_0x33319e['limit'];var _0x522e6b;if(_0x41f887>=_0x1d38a7){_0x41f887=_0x1d38a7;_0x522e6b=0xc8;}else{_0x522e6b=0xce;}_0x2dc3ce[_0xfa4b('0x1a')](_0x522e6b);return _0x2dc3ce['set']('Content-Range',_0x1a6212+'-'+_0x41f887+'/'+_0x1d38a7)[_0xfa4b('0x20')](_0x45bbcd);}return null;};}function patchUpdates(_0x1d7d45){return function(_0x55eec7){try{jsonpatch[_0xfa4b('0x21')](_0x55eec7,_0x1d7d45,!![]);}catch(_0x31b449){return BPromise[_0xfa4b('0x22')](_0x31b449);}return _0x55eec7[_0xfa4b('0x23')]();};}function saveUpdates(_0x5e4be0,_0x2485af){return function(_0x5290ea){if(_0x5290ea){return _0x5290ea[_0xfa4b('0x24')](_0x5e4be0)['then'](function(_0x5210ef){return _0x5210ef;});}return null;};}function removeEntity(_0x59c56a,_0x50c199){return function(_0x10e0c5){if(_0x10e0c5){return _0x10e0c5[_0xfa4b('0x25')]()[_0xfa4b('0x26')](function(){_0x59c56a['status'](0xcc)[_0xfa4b('0x1b')]();});}};}function handleEntityNotFound(_0x222b75,_0x30e053){return function(_0x38b00b){if(!_0x38b00b){_0x222b75[_0xfa4b('0x19')](0x194);}return _0x38b00b;};}function handleError(_0x1f8dab,_0x25fb86){_0x25fb86=_0x25fb86||0x1f4;return function(_0x28d632){logger[_0xfa4b('0x27')](_0x28d632[_0xfa4b('0x28')]);if(_0x28d632[_0xfa4b('0x29')]){delete _0x28d632['name'];}_0x1f8dab[_0xfa4b('0x1a')](_0x25fb86)['send'](_0x28d632);};}exports['index']=function(_0x57d60c,_0xa91e8c){var _0x31af61={},_0x25ffd0={},_0x5a8712={'count':0x0,'rows':[]};var _0x5e44f3=_['map'](db['VtigerField'][_0xfa4b('0x2a')],function(_0x2d9d78){return{'name':_0x2d9d78['fieldName'],'type':_0x2d9d78['type']['key']};});_0x25ffd0[_0xfa4b('0x2b')]=_[_0xfa4b('0x2c')](_0x5e44f3,'name');_0x25ffd0[_0xfa4b('0x2d')]=_[_0xfa4b('0x2e')](_0x57d60c[_0xfa4b('0x2d')]);_0x25ffd0['filters']=_['intersection'](_0x25ffd0['model'],_0x25ffd0[_0xfa4b('0x2d')]);_0x31af61[_0xfa4b('0x2f')]=_['intersection'](_0x25ffd0[_0xfa4b('0x2b')],qs['fields'](_0x57d60c[_0xfa4b('0x2d')]['fields']));_0x31af61['attributes']=_0x31af61[_0xfa4b('0x2f')][_0xfa4b('0x30')]?_0x31af61[_0xfa4b('0x2f')]:_0x25ffd0[_0xfa4b('0x2b')];if(!_0x57d60c[_0xfa4b('0x2d')]['hasOwnProperty'](_0xfa4b('0x31'))){_0x31af61[_0xfa4b('0x1d')]=qs[_0xfa4b('0x1d')](_0x57d60c[_0xfa4b('0x2d')]['limit']);_0x31af61[_0xfa4b('0x1c')]=qs[_0xfa4b('0x1c')](_0x57d60c[_0xfa4b('0x2d')][_0xfa4b('0x1c')]);}_0x31af61['order']=qs[_0xfa4b('0x32')](_0x57d60c[_0xfa4b('0x2d')][_0xfa4b('0x32')]);_0x31af61[_0xfa4b('0x33')]=qs['filters'](_[_0xfa4b('0x34')](_0x57d60c[_0xfa4b('0x2d')],_0x25ffd0[_0xfa4b('0x35')]),_0x5e44f3);if(_0x57d60c['query'][_0xfa4b('0x36')]){_0x31af61['where']=_[_0xfa4b('0x37')](_0x31af61[_0xfa4b('0x33')],{'$or':_[_0xfa4b('0x2c')](_0x5e44f3,function(_0x22ceb3){if(_0x22ceb3[_0xfa4b('0x38')]!==_0xfa4b('0x39')){var _0x371636={};_0x371636[_0x22ceb3[_0xfa4b('0x29')]]={'$like':'%'+_0x57d60c['query'][_0xfa4b('0x36')]+'%'};return _0x371636;}})});}_0x31af61=_[_0xfa4b('0x37')]({},_0x31af61,_0x57d60c['options']);var _0x3dbbe4={'where':_0x31af61['where']};return db[_0xfa4b('0x3a')][_0xfa4b('0x1f')](_0x3dbbe4)[_0xfa4b('0x26')](function(_0x3a2409){_0x5a8712[_0xfa4b('0x1f')]=_0x3a2409;if(_0x57d60c[_0xfa4b('0x2d')][_0xfa4b('0x3b')]){_0x31af61['include']=[{'all':!![]}];}return db['VtigerField'][_0xfa4b('0x3c')](_0x31af61);})[_0xfa4b('0x26')](function(_0x1db1f8){_0x5a8712[_0xfa4b('0x3d')]=_0x1db1f8;return _0x5a8712;})['then'](respondWithFilteredResult(_0xa91e8c,_0x31af61))['catch'](handleError(_0xa91e8c,null));};exports[_0xfa4b('0x3e')]=function(_0x50101e,_0x155553){var _0x281f18={'raw':!![],'where':{'id':_0x50101e[_0xfa4b('0x3f')]['id']}},_0x36ae91={};_0x36ae91[_0xfa4b('0x2b')]=_[_0xfa4b('0x2e')](db['VtigerField'][_0xfa4b('0x2a')]);_0x36ae91[_0xfa4b('0x2d')]=_[_0xfa4b('0x2e')](_0x50101e[_0xfa4b('0x2d')]);_0x36ae91[_0xfa4b('0x35')]=_['intersection'](_0x36ae91[_0xfa4b('0x2b')],_0x36ae91[_0xfa4b('0x2d')]);_0x281f18[_0xfa4b('0x2f')]=_['intersection'](_0x36ae91[_0xfa4b('0x2b')],qs[_0xfa4b('0x40')](_0x50101e[_0xfa4b('0x2d')][_0xfa4b('0x40')]));_0x281f18[_0xfa4b('0x2f')]=_0x281f18[_0xfa4b('0x2f')][_0xfa4b('0x30')]?_0x281f18[_0xfa4b('0x2f')]:_0x36ae91[_0xfa4b('0x2b')];if(_0x50101e['query'][_0xfa4b('0x3b')]){_0x281f18[_0xfa4b('0x41')]=[{'all':!![]}];}_0x281f18=_[_0xfa4b('0x37')]({},_0x281f18,_0x50101e[_0xfa4b('0x42')]);return db['VtigerField'][_0xfa4b('0x43')](_0x281f18)[_0xfa4b('0x26')](handleEntityNotFound(_0x155553,null))[_0xfa4b('0x26')](respondWithResult(_0x155553,null))['catch'](handleError(_0x155553,null));};exports[_0xfa4b('0x44')]=function(_0x165eed,_0xdeb02e){return db[_0xfa4b('0x3a')][_0xfa4b('0x44')](_0x165eed[_0xfa4b('0x45')],{})[_0xfa4b('0x26')](respondWithResult(_0xdeb02e,0xc9))['catch'](handleError(_0xdeb02e,null));};exports['update']=function(_0x4a3f8f,_0x15ca99){if(_0x4a3f8f[_0xfa4b('0x45')]['id']){delete _0x4a3f8f[_0xfa4b('0x45')]['id'];}return db['VtigerField'][_0xfa4b('0x43')]({'where':{'id':_0x4a3f8f['params']['id']}})['then'](handleEntityNotFound(_0x15ca99,null))[_0xfa4b('0x26')](saveUpdates(_0x4a3f8f[_0xfa4b('0x45')],null))[_0xfa4b('0x26')](respondWithResult(_0x15ca99,null))[_0xfa4b('0x46')](handleError(_0x15ca99,null));};exports[_0xfa4b('0x25')]=function(_0x2ed6a5,_0x3add44){return db[_0xfa4b('0x3a')]['find']({'where':{'id':_0x2ed6a5[_0xfa4b('0x3f')]['id']}})[_0xfa4b('0x26')](handleEntityNotFound(_0x3add44,null))['then'](removeEntity(_0x3add44,null))[_0xfa4b('0x46')](handleError(_0x3add44,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3828887..2bcfb83 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc85c=['exports','define','int_vtiger_fields','vtiger_unique_index','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x2000d2,_0x3da961){var _0xbe168=function(_0x363f90){while(--_0x363f90){_0x2000d2['push'](_0x2000d2['shift']());}};_0xbe168(++_0x3da961);}(_0xc85c,0x1a8));var _0xcc85=function(_0x36bbbb,_0x3f6709){_0x36bbbb=_0x36bbbb-0x0;var _0x3ca0eb=_0xc85c[_0x36bbbb];return _0x3ca0eb;};'use strict';var _=require(_0xcc85('0x0'));var util=require(_0xcc85('0x1'));var logger=require(_0xcc85('0x2'))(_0xcc85('0x3'));var moment=require(_0xcc85('0x4'));var BPromise=require('bluebird');var rp=require(_0xcc85('0x5'));var fs=require('fs');var path=require(_0xcc85('0x6'));var rimraf=require(_0xcc85('0x7'));var config=require(_0xcc85('0x8'));var attributes=require(_0xcc85('0x9'));module[_0xcc85('0xa')]=function(_0x3a562e,_0x425baa){return _0x3a562e[_0xcc85('0xb')]('VtigerField',attributes,{'tableName':_0xcc85('0xc'),'paranoid':![],'indexes':[{'name':_0xcc85('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3be2=['moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x13f6dc,_0x50d971){var _0x5cca3f=function(_0x38b7b8){while(--_0x38b7b8){_0x13f6dc['push'](_0x13f6dc['shift']());}};_0x5cca3f(++_0x50d971);}(_0x3be2,0x83));var _0x23be=function(_0x485f71,_0x1f0f8c){_0x485f71=_0x485f71-0x0;var _0x1061f8=_0x3be2[_0x485f71];return _0x1061f8;};'use strict';var _=require(_0x23be('0x0'));var util=require(_0x23be('0x1'));var logger=require(_0x23be('0x2'))(_0x23be('0x3'));var moment=require(_0x23be('0x4'));var BPromise=require('bluebird');var rp=require(_0x23be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23be('0x6'));var config=require(_0x23be('0x7'));var attributes=require(_0x23be('0x8'));module[_0x23be('0x9')]=function(_0x2c8756,_0x201db1){return _0x2c8756['define'](_0x23be('0xa'),attributes,{'tableName':_0x23be('0xb'),'paranoid':![],'indexes':[{'name':_0x23be('0xc'),'fields':[_0x23be('0xd'),_0x23be('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index a10ebba..0b67cff 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe348=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x152314,_0x3891bb){var _0x49bac4=function(_0x4dcbc7){while(--_0x4dcbc7){_0x152314['push'](_0x152314['shift']());}};_0x49bac4(++_0x3891bb);}(_0xe348,0x137));var _0x8e34=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xe348[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var moment=require('moment');var BPromise=require(_0x8e34('0x2'));var rs=require(_0x8e34('0x3'));var fs=require('fs');var Redis=require(_0x8e34('0x4'));var db=require(_0x8e34('0x5'))['db'];var utils=require(_0x8e34('0x6'));var logger=require(_0x8e34('0x7'))(_0x8e34('0x8'));var config=require('../../config/environment');var jayson=require(_0x8e34('0x9'));var client=jayson[_0x8e34('0xa')][_0x8e34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e8565,_0x1a5573,_0x5b4bbe){return new BPromise(function(_0x161e98,_0x41e8a8){return client['request'](_0x4e8565,_0x5b4bbe)[_0x8e34('0xc')](function(_0x3ee4d8){logger[_0x8e34('0xd')](_0x8e34('0xe'),_0x1a5573,_0x8e34('0xf'));logger[_0x8e34('0x10')](_0x8e34('0x11'),_0x1a5573,_0x8e34('0xf'),JSON[_0x8e34('0x12')](_0x3ee4d8));if(_0x3ee4d8[_0x8e34('0x13')]){if(_0x3ee4d8['error'][_0x8e34('0x14')]===0x1f4){logger[_0x8e34('0x13')](_0x8e34('0xe'),_0x1a5573,_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);return _0x41e8a8(_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x1a5573,_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);return _0x161e98(_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);}else{logger[_0x8e34('0xd')](_0x8e34('0xe'),_0x1a5573,'request\x20sent');_0x161e98(_0x3ee4d8[_0x8e34('0x16')]['message']);}})[_0x8e34('0x17')](function(_0x1b8ade){logger['error'](_0x8e34('0xe'),_0x1a5573,_0x1b8ade);_0x41e8a8(_0x1b8ade);});});} \ No newline at end of file +var _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x42a628,_0x5059c2){var _0x2420e2=function(_0x38468e){while(--_0x38468e){_0x42a628['push'](_0x42a628['shift']());}};_0x2420e2(++_0x5059c2);}(_0x153f,0x15b));var _0xf153=function(_0x490742,_0x280cee){_0x490742=_0x490742-0x0;var _0x20c144=_0x153f[_0x490742];return _0x20c144;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c0b09d2..ec6bf05 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5c0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','/:id','show','get','getConfigurations','post','addConfiguration','put','update','delete','multer','util','path'];(function(_0x41eb8b,_0x8e630f){var _0x57f6be=function(_0x552d87){while(--_0x552d87){_0x41eb8b['push'](_0x41eb8b['shift']());}};_0x57f6be(++_0x8e630f);}(_0xf5c0,0x9d));var _0x0f5c=function(_0xabe64d,_0x2618da){_0xabe64d=_0xabe64d-0x0;var _0x59af04=_0xf5c0[_0xabe64d];return _0x59af04;};'use strict';var multer=require(_0x0f5c('0x0'));var util=require(_0x0f5c('0x1'));var path=require(_0x0f5c('0x2'));var timeout=require(_0x0f5c('0x3'));var express=require(_0x0f5c('0x4'));var router=express[_0x0f5c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0f5c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0f5c('0x7'));var controller=require(_0x0f5c('0x8'));router['get']('/',auth[_0x0f5c('0x9')](),controller[_0x0f5c('0xa')]);router['get'](_0x0f5c('0xb'),auth[_0x0f5c('0x9')](),controller[_0x0f5c('0xc')]);router[_0x0f5c('0xd')]('/:id/configurations',auth[_0x0f5c('0x9')](),controller[_0x0f5c('0xe')]);router[_0x0f5c('0xd')]('/:id/fields',auth[_0x0f5c('0x9')](),controller['getFields']);router['post']('/',auth[_0x0f5c('0x9')](),controller['create']);router[_0x0f5c('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0f5c('0x10')]);router[_0x0f5c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0f5c('0x12')]);router[_0x0f5c('0x13')](_0x0f5c('0xb'),auth[_0x0f5c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x36a5=['isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x5dbadb,_0x322912){var _0xb1c5ff=function(_0x536f03){while(--_0x536f03){_0x5dbadb['push'](_0x5dbadb['shift']());}};_0xb1c5ff(++_0x322912);}(_0x36a5,0xb4));var _0x536a=function(_0x2ce6a4,_0x51e9a9){_0x2ce6a4=_0x2ce6a4-0x0;var _0x2c90de=_0x36a5[_0x2ce6a4];return _0x2c90de;};'use strict';var multer=require(_0x536a('0x0'));var util=require(_0x536a('0x1'));var path=require(_0x536a('0x2'));var timeout=require('connect-timeout');var express=require(_0x536a('0x3'));var router=express[_0x536a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x536a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x536a('0x6'));var controller=require(_0x536a('0x7'));router[_0x536a('0x8')]('/',auth[_0x536a('0x9')](),controller[_0x536a('0xa')]);router['get'](_0x536a('0xb'),auth[_0x536a('0x9')](),controller[_0x536a('0xc')]);router[_0x536a('0x8')]('/:id/configurations',auth[_0x536a('0x9')](),controller[_0x536a('0xd')]);router[_0x536a('0x8')](_0x536a('0xe'),auth[_0x536a('0x9')](),controller['getFields']);router[_0x536a('0xf')]('/',auth[_0x536a('0x9')](),controller[_0x536a('0x10')]);router[_0x536a('0xf')](_0x536a('0x11'),auth[_0x536a('0x9')](),controller['addConfiguration']);router['put'](_0x536a('0xb'),auth[_0x536a('0x9')](),controller[_0x536a('0x12')]);router[_0x536a('0x13')](_0x536a('0xb'),auth['isAuthenticated'](),controller[_0x536a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 2d22cd9..c8248de 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba38=['password','token','integrationTab','newTab','exports','STRING','username','remoteUri','ENUM'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xba38,0x190));var _0x8ba3=function(_0x47a1ad,_0x27c988){_0x47a1ad=_0x47a1ad-0x0;var _0x30b60a=_0xba38[_0x47a1ad];return _0x30b60a;};'use strict';var Sequelize=require('sequelize');module[_0x8ba3('0x0')]={'name':{'type':Sequelize[_0x8ba3('0x1')]},'description':{'type':Sequelize[_0x8ba3('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x8ba3('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8ba3('0x1')]},'remoteUri':{'type':Sequelize[_0x8ba3('0x1')],'unique':_0x8ba3('0x3')},'authType':{'type':Sequelize[_0x8ba3('0x4')](_0x8ba3('0x5'),_0x8ba3('0x6')),'defaultValue':_0x8ba3('0x5')},'serverUrl':{'type':Sequelize[_0x8ba3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8ba3('0x4')](_0x8ba3('0x7'),_0x8ba3('0x8')),'defaultValue':_0x8ba3('0x7')}}; \ No newline at end of file +var _0x687b=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x3243d4,_0x2cfa97){var _0x45f124=function(_0xf8e1ce){while(--_0xf8e1ce){_0x3243d4['push'](_0x3243d4['shift']());}};_0x45f124(++_0x2cfa97);}(_0x687b,0x14a));var _0xb687=function(_0x3e0191,_0x1d4b20){_0x3e0191=_0x3e0191-0x0;var _0xf2ae83=_0x687b[_0x3e0191];return _0xf2ae83;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')]},'description':{'type':Sequelize[_0xb687('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb687('0x2')]},'token':{'type':Sequelize[_0xb687('0x2')]},'remoteUri':{'type':Sequelize[_0xb687('0x2')],'unique':_0xb687('0x3')},'authType':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5'),_0xb687('0x6')),'defaultValue':_0xb687('0x5')},'serverUrl':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb687('0x4')]('integrationTab',_0xb687('0x7')),'defaultValue':_0xb687('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 61977b6..d8fc1df 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','error','name','index','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','includeAll','include','rows','catch','show','params','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','token','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','title','position','system_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x750a,0x140));var _0xa750=function(_0x4fe684,_0x3b6019){_0x4fe684=_0x4fe684-0x0;var _0x2c1667=_0x750a[_0x4fe684];return _0x2c1667;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa750('0x15'));function respondWithStatusCode(_0x1c5657,_0x344c67){_0x344c67=_0x344c67||0xcc;return function(_0x567c51){if(_0x567c51){return _0x1c5657[_0xa750('0x16')](_0x344c67);}return _0x1c5657[_0xa750('0x17')](_0x344c67)[_0xa750('0x18')]();};}function respondWithResult(_0x24e48a,_0xa66181){_0xa66181=_0xa66181||0xc8;return function(_0x339329){if(_0x339329){return _0x24e48a['status'](_0xa66181)[_0xa750('0x19')](_0x339329);}};}function respondWithFilteredResult(_0x8488ea,_0x290d46){return function(_0x49fe3b){if(_0x49fe3b){var _0x337095=typeof _0x290d46[_0xa750('0x1a')]==='undefined'&&typeof _0x290d46['limit']===_0xa750('0x1b');var _0x5b1e6b=_0x49fe3b[_0xa750('0x1c')];var _0x1bde87=_0x337095?0x0:_0x290d46['offset'];var _0x36dcca=_0x337095?_0x49fe3b['count']:_0x290d46['offset']+_0x290d46[_0xa750('0x1d')];var _0x5d0935;if(_0x36dcca>=_0x5b1e6b){_0x36dcca=_0x5b1e6b;_0x5d0935=0xc8;}else{_0x5d0935=0xce;}_0x8488ea[_0xa750('0x17')](_0x5d0935);return _0x8488ea['set'](_0xa750('0x1e'),_0x1bde87+'-'+_0x36dcca+'/'+_0x5b1e6b)['json'](_0x49fe3b);}return null;};}function patchUpdates(_0x3dc7f1){return function(_0x500922){try{jsonpatch[_0xa750('0x1f')](_0x500922,_0x3dc7f1,!![]);}catch(_0x4d1939){return BPromise['reject'](_0x4d1939);}return _0x500922[_0xa750('0x20')]();};}function saveUpdates(_0x52da84,_0x216fbf){return function(_0x5a9d96){if(_0x5a9d96){return _0x5a9d96['update'](_0x52da84)['then'](function(_0x5d758e){return _0x5d758e;});}return null;};}function removeEntity(_0x15d72f,_0x2ec6c4){return function(_0x2c43ef){if(_0x2c43ef){return _0x2c43ef[_0xa750('0x21')]()[_0xa750('0x22')](function(){_0x15d72f[_0xa750('0x17')](0xcc)[_0xa750('0x18')]();});}};}function handleEntityNotFound(_0x7e22ad,_0x3d52b3){return function(_0x94697a){if(!_0x94697a){_0x7e22ad[_0xa750('0x16')](0x194);}return _0x94697a;};}function handleError(_0x27a5eb,_0x31ea63){_0x31ea63=_0x31ea63||0x1f4;return function(_0x3f7d6d){logger[_0xa750('0x23')](_0x3f7d6d['stack']);if(_0x3f7d6d[_0xa750('0x24')]){delete _0x3f7d6d[_0xa750('0x24')];}_0x27a5eb[_0xa750('0x17')](_0x31ea63)['send'](_0x3f7d6d);};}exports[_0xa750('0x25')]=function(_0x6ade2b,_0x3270e3){var _0x1223d2={},_0x579f1c={},_0x297eef={'count':0x0,'rows':[]};var _0x34d5e9=_[_0xa750('0x26')](db[_0xa750('0x27')][_0xa750('0x28')],function(_0x59ab33){return{'name':_0x59ab33[_0xa750('0x29')],'type':_0x59ab33['type'][_0xa750('0x2a')]};});_0x579f1c[_0xa750('0x2b')]=_['map'](_0x34d5e9,_0xa750('0x24'));_0x579f1c[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0x6ade2b[_0xa750('0x2c')]);_0x579f1c[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x579f1c[_0xa750('0x2b')],_0x579f1c[_0xa750('0x2c')]);_0x1223d2['attributes']=_[_0xa750('0x2f')](_0x579f1c['model'],qs[_0xa750('0x30')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x30')]));_0x1223d2[_0xa750('0x31')]=_0x1223d2['attributes'][_0xa750('0x32')]?_0x1223d2[_0xa750('0x31')]:_0x579f1c['model'];if(!_0x6ade2b[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x1223d2[_0xa750('0x1d')]=qs['limit'](_0x6ade2b[_0xa750('0x2c')]['limit']);_0x1223d2['offset']=qs[_0xa750('0x1a')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x1a')]);}_0x1223d2['order']=qs[_0xa750('0x35')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x35')]);_0x1223d2['where']=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x6ade2b[_0xa750('0x2c')],_0x579f1c['filters']),_0x34d5e9);if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x37')]){_0x1223d2[_0xa750('0x38')]=_['merge'](_0x1223d2[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x34d5e9,function(_0x1e579b){if(_0x1e579b[_0xa750('0x39')]!=='VIRTUAL'){var _0x4dc0b8={};_0x4dc0b8[_0x1e579b[_0xa750('0x24')]]={'$like':'%'+_0x6ade2b[_0xa750('0x2c')]['filter']+'%'};return _0x4dc0b8;}})});}_0x1223d2=_[_0xa750('0x3a')]({},_0x1223d2,_0x6ade2b[_0xa750('0x3b')]);var _0x15d35a={'where':_0x1223d2[_0xa750('0x38')]};return db[_0xa750('0x27')]['count'](_0x15d35a)[_0xa750('0x22')](function(_0x2b33e0){_0x297eef[_0xa750('0x1c')]=_0x2b33e0;if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x3c')]){_0x1223d2[_0xa750('0x3d')]=[{'all':!![]}];}return db[_0xa750('0x27')]['findAll'](_0x1223d2);})[_0xa750('0x22')](function(_0x5e9ffb){_0x297eef[_0xa750('0x3e')]=_0x5e9ffb;return _0x297eef;})['then'](respondWithFilteredResult(_0x3270e3,_0x1223d2))[_0xa750('0x3f')](handleError(_0x3270e3,null));};exports[_0xa750('0x40')]=function(_0xf9fd5f,_0x1be24e){var _0x430d60={'raw':![],'where':{'id':_0xf9fd5f[_0xa750('0x41')]['id']}},_0xe27272={};_0xe27272[_0xa750('0x2b')]=_[_0xa750('0x2d')](db[_0xa750('0x27')][_0xa750('0x28')]);_0xe27272[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0xf9fd5f[_0xa750('0x2c')]);_0xe27272[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0xe27272[_0xa750('0x2b')],_0xe27272[_0xa750('0x2c')]);_0x430d60[_0xa750('0x31')]=_[_0xa750('0x2f')](_0xe27272['model'],qs[_0xa750('0x30')](_0xf9fd5f[_0xa750('0x2c')][_0xa750('0x30')]));_0x430d60[_0xa750('0x31')]=_0x430d60[_0xa750('0x31')][_0xa750('0x32')]?_0x430d60[_0xa750('0x31')]:_0xe27272[_0xa750('0x2b')];if(_0xf9fd5f[_0xa750('0x2c')]['includeAll']){_0x430d60[_0xa750('0x3d')]=[{'all':!![]}];}_0x430d60=_[_0xa750('0x3a')]({},_0x430d60,_0xf9fd5f['options']);return db[_0xa750('0x27')][_0xa750('0x42')](_0x430d60)[_0xa750('0x22')](handleEntityNotFound(_0x1be24e,null))[_0xa750('0x22')](respondWithResult(_0x1be24e,null))[_0xa750('0x3f')](handleError(_0x1be24e,null));};exports[_0xa750('0x43')]=function(_0x5e7a95,_0x278c22){return db[_0xa750('0x27')][_0xa750('0x43')](_0x5e7a95['body'],{})[_0xa750('0x22')](respondWithResult(_0x278c22,0xc9))[_0xa750('0x3f')](handleError(_0x278c22,null));};exports['update']=function(_0x93e49f,_0x2397e1){if(_0x93e49f[_0xa750('0x44')]['id']){delete _0x93e49f['body']['id'];}return db[_0xa750('0x27')][_0xa750('0x42')]({'where':{'id':_0x93e49f[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0x2397e1,null))['then'](saveUpdates(_0x93e49f[_0xa750('0x44')],null))[_0xa750('0x22')](respondWithResult(_0x2397e1,null))[_0xa750('0x3f')](handleError(_0x2397e1,null));};exports[_0xa750('0x21')]=function(_0x4ce363,_0x203f2a){return db[_0xa750('0x27')]['find']({'where':{'id':_0x4ce363[_0xa750('0x41')]['id']}})['then'](handleEntityNotFound(_0x203f2a,null))[_0xa750('0x22')](removeEntity(_0x203f2a,null))[_0xa750('0x3f')](handleError(_0x203f2a,null));};exports['getConfigurations']=function(_0x47e93c,_0x58eba1,_0x232da4){var _0x401125={};var _0x4ea12b={};var _0xe88dc;var _0x1a79a9;return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x47e93c['params']['id']}})['then'](handleEntityNotFound(_0x58eba1,null))['then'](function(_0x3c34d4){if(_0x3c34d4){_0xe88dc=_0x3c34d4;_0x4ea12b['model']=_[_0xa750('0x2d')](db[_0xa750('0x45')]['rawAttributes']);_0x4ea12b[_0xa750('0x2c')]=_['keys'](_0x47e93c[_0xa750('0x2c')]);_0x4ea12b['filters']=_['intersection'](_0x4ea12b['model'],_0x4ea12b['query']);_0x401125[_0xa750('0x31')]=_[_0xa750('0x2f')](_0x4ea12b['model'],qs['fields'](_0x47e93c['query'][_0xa750('0x30')]));_0x401125[_0xa750('0x31')]=_0x401125[_0xa750('0x31')][_0xa750('0x32')]?_0x401125[_0xa750('0x31')]:_0x4ea12b[_0xa750('0x2b')];_0x401125['order']=qs['sort'](_0x47e93c[_0xa750('0x2c')][_0xa750('0x35')]);_0x401125[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x47e93c['query'],_0x4ea12b[_0xa750('0x2e')]));if(_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]){_0x401125[_0xa750('0x38')]=_[_0xa750('0x3a')](_0x401125[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x401125[_0xa750('0x31')],function(_0x5e78f1){var _0x2aa1d6={};_0x2aa1d6[_0x5e78f1]={'$like':'%'+_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]+'%'};return _0x2aa1d6;})});}_0x401125=_[_0xa750('0x3a')]({},_0x401125,_0x47e93c[_0xa750('0x3b')]);return _0xe88dc['getConfigurations'](_0x401125);}})[_0xa750('0x22')](function(_0x25248f){if(_0x25248f){_0x1a79a9=_0x25248f[_0xa750('0x32')];if(!_0x47e93c[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x401125[_0xa750('0x1d')]=qs[_0xa750('0x1d')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1d')]);_0x401125[_0xa750('0x1a')]=qs[_0xa750('0x1a')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1a')]);}return _0xe88dc[_0xa750('0x46')](_0x401125);}})[_0xa750('0x22')](function(_0x49e132){if(_0x49e132){return _0x49e132?{'count':_0x1a79a9,'rows':_0x49e132}:null;}})[_0xa750('0x22')](respondWithResult(_0x58eba1,null))['catch'](handleError(_0x58eba1,null));};exports[_0xa750('0x47')]=function(_0x2d488d,_0xbe7451,_0x5845c5){if(_0x2d488d[_0xa750('0x44')]['id']){delete _0x2d488d[_0xa750('0x44')]['id'];}return db[_0xa750('0x27')][_0xa750('0x48')]({'where':{'id':_0x2d488d[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0xbe7451,null))['then'](function(_0x3001d7){if(_0x3001d7){_0x2d488d[_0xa750('0x44')]['AccountId']=_0x3001d7['id'];_0x2d488d[_0xa750('0x44')][_0xa750('0x49')]=integrations[_0xa750('0x4a')](_0x2d488d[_0xa750('0x44')][_0xa750('0x4b')],_0x2d488d[_0xa750('0x44')][_0xa750('0x39')]);_0x2d488d[_0xa750('0x44')][_0xa750('0x4c')]=integrations[_0xa750('0x4d')](_0x2d488d[_0xa750('0x44')]['channel'],_0x2d488d['body'][_0xa750('0x39')]);return db[_0xa750('0x45')][_0xa750('0x43')](_0x2d488d[_0xa750('0x44')],{'include':[{'model':db['ZendeskField'],'as':_0xa750('0x49')},{'model':db[_0xa750('0x4e')],'as':_0xa750('0x4c')}]});}return null;})[_0xa750('0x22')](respondWithResult(_0xbe7451,null))[_0xa750('0x3f')](handleError(_0xbe7451,null));};exports[_0xa750('0x4f')]=function(_0x17b25e,_0x5d883d,_0x1dcc15){var _0x2783b9='';return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x17b25e['params']['id']},'attributes':['id',_0xa750('0x50'),'password','token',_0xa750('0x51'),_0xa750('0x52')]})[_0xa750('0x22')](handleEntityNotFound(_0x5d883d,null))[_0xa750('0x22')](function(_0x292dab){if(_0x292dab){_0x2783b9=_0x292dab['remoteUri'];var _0x3ac9a2=_0x2783b9[_0xa750('0x53')](-0x1);if(_0x3ac9a2==='/'){_0x2783b9=_0x2783b9[_0xa750('0x54')](0x0,_0x2783b9[_0xa750('0x55')](_0x3ac9a2));}var _0x439dce={'method':_0xa750('0x56'),'uri':util['format']('%s/%s',_0x2783b9,_0xa750('0x57')),'json':!![]};switch(_0x292dab[_0xa750('0x51')]){case _0xa750('0x58'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util[_0xa750('0x5a')](_0xa750('0x5c'),_0x292dab['username'],_0x292dab[_0xa750('0x58')]))['toString']('base64'))};break;case _0xa750('0x5d'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util['format'](_0xa750('0x5e'),_0x292dab[_0xa750('0x50')],_0x292dab[_0xa750('0x5d')]))[_0xa750('0x5f')]('base64'))};break;default:throw new db[(_0xa750('0x60'))][(_0xa750('0x61'))](_0xa750('0x62'));}return rp(_0x439dce);}})[_0xa750('0x22')](function(_0x332862){if(_0x332862){var _0x14de1b=[_0xa750('0x63'),_0xa750('0x64'),'group','assignee'];_[_0xa750('0x65')](_0x332862['ticket_fields'],function(_0x2c4114){return _0x14de1b[_0xa750('0x66')](_0x2c4114['type']);});return{'count':_0x332862[_0xa750('0x57')]['length'],'rows':_[_0xa750('0x26')](_0x332862[_0xa750('0x57')],function(_0x77110){return{'id':_0x77110['id'],'name':_0x77110['position']>0x7?_0x77110[_0xa750('0x67')]:_0x77110[_0xa750('0x39')],'custom':_0x77110[_0xa750('0x68')]>0x7?!![]:![],'options':_0x77110[_0xa750('0x69')]?_0x77110['system_field_options']:_0x77110['custom_field_options']?_0x77110['custom_field_options']:[]};})};}})[_0xa750('0x22')](respondWithResult(_0x5d883d,null))[_0xa750('0x3f')](function(_0x5387dc){var _0x12cae9=_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?0x1f4:_0x5387dc[_0xa750('0x6b')]||0x1f4;logger[_0xa750('0x23')](_0xa750('0x6c'),'getFields',_0x12cae9,JSON[_0xa750('0x6d')](_0x5387dc));delete _0x5387dc[_0xa750('0x24')];if(_0x12cae9===0x191){_0x12cae9=0x190;}_0x5d883d[_0xa750('0x17')](_0x12cae9)['send'](_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?{'message':_0xa750('0x6e'),'statusCode':_0x5387dc[_0xa750('0x6b')]}:_0x5387dc);});}; \ No newline at end of file +var _0xb9be=['count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','AccountId','getSubjects','type','Descriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined'];(function(_0x43ba6b,_0x4590f9){var _0x232a2d=function(_0x5a4628){while(--_0x5a4628){_0x43ba6b['push'](_0x43ba6b['shift']());}};_0x232a2d(++_0x4590f9);}(_0xb9be,0xc5));var _0xeb9b=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xb9be[_0x3430aa];return _0x2ac5c;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];var integrations=require(_0xeb9b('0x19'));function respondWithStatusCode(_0x2a01df,_0x51598f){_0x51598f=_0x51598f||0xcc;return function(_0x5e94e3){if(_0x5e94e3){return _0x2a01df['sendStatus'](_0x51598f);}return _0x2a01df[_0xeb9b('0x1a')](_0x51598f)[_0xeb9b('0x1b')]();};}function respondWithResult(_0x2674e6,_0x4ec46d){_0x4ec46d=_0x4ec46d||0xc8;return function(_0x5926e1){if(_0x5926e1){return _0x2674e6['status'](_0x4ec46d)[_0xeb9b('0x1c')](_0x5926e1);}};}function respondWithFilteredResult(_0x1a5f27,_0x406afd){return function(_0x3fa308){if(_0x3fa308){var _0x2c9aa6=typeof _0x406afd[_0xeb9b('0x1d')]===_0xeb9b('0x1e')&&typeof _0x406afd['limit']===_0xeb9b('0x1e');var _0x36e871=_0x3fa308[_0xeb9b('0x1f')];var _0x3a11e3=_0x2c9aa6?0x0:_0x406afd[_0xeb9b('0x1d')];var _0x1a140c=_0x2c9aa6?_0x3fa308[_0xeb9b('0x1f')]:_0x406afd[_0xeb9b('0x1d')]+_0x406afd[_0xeb9b('0x20')];var _0x26e312;if(_0x1a140c>=_0x36e871){_0x1a140c=_0x36e871;_0x26e312=0xc8;}else{_0x26e312=0xce;}_0x1a5f27['status'](_0x26e312);return _0x1a5f27[_0xeb9b('0x21')]('Content-Range',_0x3a11e3+'-'+_0x1a140c+'/'+_0x36e871)['json'](_0x3fa308);}return null;};}function patchUpdates(_0x580498){return function(_0x703f0b){try{jsonpatch['apply'](_0x703f0b,_0x580498,!![]);}catch(_0xbed5ce){return BPromise[_0xeb9b('0x22')](_0xbed5ce);}return _0x703f0b[_0xeb9b('0x23')]();};}function saveUpdates(_0x37d7e0,_0x3c8be7){return function(_0x43dab8){if(_0x43dab8){return _0x43dab8[_0xeb9b('0x24')](_0x37d7e0)[_0xeb9b('0x25')](function(_0x142d1c){return _0x142d1c;});}return null;};}function removeEntity(_0x46df93,_0x61c86d){return function(_0x296f95){if(_0x296f95){return _0x296f95[_0xeb9b('0x26')]()[_0xeb9b('0x25')](function(){_0x46df93[_0xeb9b('0x1a')](0xcc)[_0xeb9b('0x1b')]();});}};}function handleEntityNotFound(_0x4c997e,_0xd57390){return function(_0x4ed960){if(!_0x4ed960){_0x4c997e[_0xeb9b('0x27')](0x194);}return _0x4ed960;};}function handleError(_0x5d6846,_0x347ec1){_0x347ec1=_0x347ec1||0x1f4;return function(_0x4361b9){logger[_0xeb9b('0x28')](_0x4361b9[_0xeb9b('0x29')]);if(_0x4361b9['name']){delete _0x4361b9[_0xeb9b('0x2a')];}_0x5d6846[_0xeb9b('0x1a')](_0x347ec1)['send'](_0x4361b9);};}exports[_0xeb9b('0x2b')]=function(_0x33bb1d,_0x5ce745){var _0x2a4b51={},_0x2ea20f={},_0x4188d5={'count':0x0,'rows':[]};var _0x48c5f4=_[_0xeb9b('0x2c')](db['ZendeskAccount'][_0xeb9b('0x2d')],function(_0x4c1331){return{'name':_0x4c1331[_0xeb9b('0x2e')],'type':_0x4c1331['type'][_0xeb9b('0x2f')]};});_0x2ea20f['model']=_[_0xeb9b('0x2c')](_0x48c5f4,'name');_0x2ea20f[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x33bb1d[_0xeb9b('0x30')]);_0x2ea20f[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],_0x2ea20f[_0xeb9b('0x30')]);_0x2a4b51[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],qs['fields'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x2a4b51[_0xeb9b('0x35')]=_0x2a4b51[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x2a4b51[_0xeb9b('0x35')]:_0x2ea20f[_0xeb9b('0x34')];if(!_0x33bb1d['query'][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x2a4b51[_0xeb9b('0x20')]=qs['limit'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x20')]);_0x2a4b51[_0xeb9b('0x1d')]=qs[_0xeb9b('0x1d')](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}_0x2a4b51['order']=qs[_0xeb9b('0x3a')](_0x33bb1d[_0xeb9b('0x30')]['sort']);_0x2a4b51[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x33bb1d[_0xeb9b('0x30')],_0x2ea20f[_0xeb9b('0x32')]),_0x48c5f4);if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x3d')]){_0x2a4b51['where']=_[_0xeb9b('0x3e')](_0x2a4b51[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x48c5f4,function(_0x53d2f7){if(_0x53d2f7['type']!=='VIRTUAL'){var _0x26dc71={};_0x26dc71[_0x53d2f7[_0xeb9b('0x2a')]]={'$like':'%'+_0x33bb1d[_0xeb9b('0x30')]['filter']+'%'};return _0x26dc71;}})});}_0x2a4b51=_[_0xeb9b('0x3e')]({},_0x2a4b51,_0x33bb1d[_0xeb9b('0x3f')]);var _0x240d8d={'where':_0x2a4b51[_0xeb9b('0x3b')]};return db[_0xeb9b('0x40')][_0xeb9b('0x1f')](_0x240d8d)[_0xeb9b('0x25')](function(_0x492122){_0x4188d5[_0xeb9b('0x1f')]=_0x492122;if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0x2a4b51['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xeb9b('0x42')](_0x2a4b51);})[_0xeb9b('0x25')](function(_0x495998){_0x4188d5[_0xeb9b('0x43')]=_0x495998;return _0x4188d5;})['then'](respondWithFilteredResult(_0x5ce745,_0x2a4b51))[_0xeb9b('0x44')](handleError(_0x5ce745,null));};exports[_0xeb9b('0x45')]=function(_0x28b075,_0x300565){var _0xbee63e={'raw':![],'where':{'id':_0x28b075[_0xeb9b('0x46')]['id']}},_0x10f483={};_0x10f483[_0xeb9b('0x34')]=_[_0xeb9b('0x31')](db[_0xeb9b('0x40')][_0xeb9b('0x2d')]);_0x10f483[_0xeb9b('0x30')]=_['keys'](_0x28b075['query']);_0x10f483[_0xeb9b('0x32')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],_0x10f483[_0xeb9b('0x30')]);_0xbee63e[_0xeb9b('0x35')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],qs[_0xeb9b('0x36')](_0x28b075['query'][_0xeb9b('0x36')]));_0xbee63e[_0xeb9b('0x35')]=_0xbee63e[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0xbee63e[_0xeb9b('0x35')]:_0x10f483[_0xeb9b('0x34')];if(_0x28b075[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0xbee63e['include']=[{'all':!![]}];}_0xbee63e=_['merge']({},_0xbee63e,_0x28b075[_0xeb9b('0x3f')]);return db['ZendeskAccount']['find'](_0xbee63e)[_0xeb9b('0x25')](handleEntityNotFound(_0x300565,null))[_0xeb9b('0x25')](respondWithResult(_0x300565,null))[_0xeb9b('0x44')](handleError(_0x300565,null));};exports[_0xeb9b('0x47')]=function(_0x45bc74,_0x2fd6ee){return db['ZendeskAccount']['create'](_0x45bc74['body'],{})[_0xeb9b('0x25')](respondWithResult(_0x2fd6ee,0xc9))['catch'](handleError(_0x2fd6ee,null));};exports[_0xeb9b('0x24')]=function(_0x2ee59c,_0x2ae9bf){if(_0x2ee59c[_0xeb9b('0x48')]['id']){delete _0x2ee59c[_0xeb9b('0x48')]['id'];}return db[_0xeb9b('0x40')][_0xeb9b('0x49')]({'where':{'id':_0x2ee59c[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x2ae9bf,null))[_0xeb9b('0x25')](saveUpdates(_0x2ee59c['body'],null))['then'](respondWithResult(_0x2ae9bf,null))[_0xeb9b('0x44')](handleError(_0x2ae9bf,null));};exports[_0xeb9b('0x26')]=function(_0x542ef4,_0x19bfe9){return db['ZendeskAccount'][_0xeb9b('0x49')]({'where':{'id':_0x542ef4[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bfe9,null))['then'](removeEntity(_0x19bfe9,null))['catch'](handleError(_0x19bfe9,null));};exports[_0xeb9b('0x4a')]=function(_0x32d8cd,_0x263453,_0x4fe9d0){var _0x4ded40={};var _0x471161={};var _0x1833c2;var _0x3e6e73;return db[_0xeb9b('0x40')][_0xeb9b('0x4b')]({'where':{'id':_0x32d8cd[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x263453,null))[_0xeb9b('0x25')](function(_0x1fab7a){if(_0x1fab7a){_0x1833c2=_0x1fab7a;_0x471161['model']=_[_0xeb9b('0x31')](db['ZendeskConfiguration'][_0xeb9b('0x2d')]);_0x471161[_0xeb9b('0x30')]=_['keys'](_0x32d8cd[_0xeb9b('0x30')]);_0x471161['filters']=_[_0xeb9b('0x33')](_0x471161[_0xeb9b('0x34')],_0x471161[_0xeb9b('0x30')]);_0x4ded40[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x471161['model'],qs[_0xeb9b('0x36')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x4ded40['attributes']=_0x4ded40[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x4ded40[_0xeb9b('0x35')]:_0x471161[_0xeb9b('0x34')];_0x4ded40[_0xeb9b('0x4c')]=qs[_0xeb9b('0x3a')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3a')]);_0x4ded40[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x32d8cd['query'],_0x471161['filters']));if(_0x32d8cd['query'][_0xeb9b('0x3d')]){_0x4ded40['where']=_[_0xeb9b('0x3e')](_0x4ded40[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x4ded40['attributes'],function(_0x27deea){var _0xb29d24={};_0xb29d24[_0x27deea]={'$like':'%'+_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3d')]+'%'};return _0xb29d24;})});}_0x4ded40=_[_0xeb9b('0x3e')]({},_0x4ded40,_0x32d8cd[_0xeb9b('0x3f')]);return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x58a3e2){if(_0x58a3e2){_0x3e6e73=_0x58a3e2['length'];if(!_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x4ded40['limit']=qs[_0xeb9b('0x20')](_0x32d8cd['query'][_0xeb9b('0x20')]);_0x4ded40['offset']=qs[_0xeb9b('0x1d')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x4be938){if(_0x4be938){return _0x4be938?{'count':_0x3e6e73,'rows':_0x4be938}:null;}})[_0xeb9b('0x25')](respondWithResult(_0x263453,null))[_0xeb9b('0x44')](handleError(_0x263453,null));};exports['addConfiguration']=function(_0x5a690a,_0x436470,_0x39c248){if(_0x5a690a['body']['id']){delete _0x5a690a[_0xeb9b('0x48')]['id'];}return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x5a690a['params']['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x436470,null))[_0xeb9b('0x25')](function(_0x417221){if(_0x417221){_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4d')]=_0x417221['id'];_0x5a690a[_0xeb9b('0x48')]['Subjects']=integrations[_0xeb9b('0x4e')](_0x5a690a[_0xeb9b('0x48')]['channel'],_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4f')]);_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x50')]=integrations['getDescriptions'](_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x51')],_0x5a690a['body'][_0xeb9b('0x4f')]);return db[_0xeb9b('0x52')][_0xeb9b('0x47')](_0x5a690a[_0xeb9b('0x48')],{'include':[{'model':db[_0xeb9b('0x53')],'as':_0xeb9b('0x54')},{'model':db[_0xeb9b('0x53')],'as':'Descriptions'}]});}return null;})[_0xeb9b('0x25')](respondWithResult(_0x436470,null))[_0xeb9b('0x44')](handleError(_0x436470,null));};exports['getFields']=function(_0x289654,_0x6a85fd,_0x2fb07e){var _0x25398e='';return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x289654[_0xeb9b('0x46')]['id']},'attributes':['id',_0xeb9b('0x55'),_0xeb9b('0x56'),_0xeb9b('0x57'),_0xeb9b('0x58'),_0xeb9b('0x59')]})[_0xeb9b('0x25')](handleEntityNotFound(_0x6a85fd,null))[_0xeb9b('0x25')](function(_0x128d43){if(_0x128d43){_0x25398e=_0x128d43[_0xeb9b('0x59')];var _0xbbde9c=_0x25398e[_0xeb9b('0x5a')](-0x1);if(_0xbbde9c==='/'){_0x25398e=_0x25398e[_0xeb9b('0x5b')](0x0,_0x25398e[_0xeb9b('0x5c')](_0xbbde9c));}var _0xd619ca={'method':'GET','uri':util[_0xeb9b('0x5d')](_0xeb9b('0x5e'),_0x25398e,_0xeb9b('0x5f')),'json':!![]};switch(_0x128d43['authType']){case'password':_0xd619ca[_0xeb9b('0x60')]={'Authorization':util['format'](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')](_0xeb9b('0x62'),_0x128d43[_0xeb9b('0x55')],_0x128d43[_0xeb9b('0x56')]))[_0xeb9b('0x63')](_0xeb9b('0x64')))};break;case _0xeb9b('0x57'):_0xd619ca[_0xeb9b('0x60')]={'Authorization':util[_0xeb9b('0x5d')](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')]('%s/token:%s',_0x128d43['username'],_0x128d43[_0xeb9b('0x57')]))['toString']('base64'))};break;default:throw new db[(_0xeb9b('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0xd619ca);}})['then'](function(_0x346ba9){if(_0x346ba9){var _0x3147bc=[_0xeb9b('0x66'),_0xeb9b('0x67'),'group',_0xeb9b('0x68')];_[_0xeb9b('0x69')](_0x346ba9[_0xeb9b('0x5f')],function(_0x4e5cfb){return _0x3147bc['includes'](_0x4e5cfb[_0xeb9b('0x4f')]);});return{'count':_0x346ba9['ticket_fields'][_0xeb9b('0x37')],'rows':_['map'](_0x346ba9['ticket_fields'],function(_0xa7e9c3){return{'id':_0xa7e9c3['id'],'name':_0xa7e9c3['position']>0x7?_0xa7e9c3[_0xeb9b('0x6a')]:_0xa7e9c3['type'],'custom':_0xa7e9c3['position']>0x7?!![]:![],'options':_0xa7e9c3[_0xeb9b('0x6b')]?_0xa7e9c3[_0xeb9b('0x6b')]:_0xa7e9c3[_0xeb9b('0x6c')]?_0xa7e9c3[_0xeb9b('0x6c')]:[]};})};}})['then'](respondWithResult(_0x6a85fd,null))[_0xeb9b('0x44')](function(_0x31de58){var _0x3f395a=_0x289654[_0xeb9b('0x30')][_0xeb9b('0x6d')]?0x1f4:_0x31de58[_0xeb9b('0x6e')]||0x1f4;logger['error'](_0xeb9b('0x6f'),'getFields',_0x3f395a,JSON[_0xeb9b('0x70')](_0x31de58));delete _0x31de58[_0xeb9b('0x2a')];if(_0x3f395a===0x191){_0x3f395a=0x190;}_0x6a85fd['status'](_0x3f395a)[_0xeb9b('0x71')](_0x289654['query'][_0xeb9b('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x31de58[_0xeb9b('0x6e')]}:_0x31de58);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 9366f20..f194cdc 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd642=['define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x33492e,_0x2960c3){var _0x22450d=function(_0x3113ac){while(--_0x3113ac){_0x33492e['push'](_0x33492e['shift']());}};_0x22450d(++_0x2960c3);}(_0xd642,0xd3));var _0x2d64=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xd642[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require(_0x2d64('0x0'));var util=require('util');var logger=require(_0x2d64('0x1'))(_0x2d64('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d64('0x3'));var fs=require('fs');var path=require(_0x2d64('0x4'));var rimraf=require(_0x2d64('0x5'));var config=require(_0x2d64('0x6'));var attributes=require(_0x2d64('0x7'));var integrations=require(_0x2d64('0x8'));module[_0x2d64('0x9')]=function(_0x12ef80,_0x57606d){return _0x12ef80[_0x2d64('0xa')](_0x2d64('0xb'),attributes,{'tableName':_0x2d64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9fc=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','api','moment','bluebird'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xd9fc,0xdf));var _0xcd9f=function(_0xc47acb,_0x1a810b){_0xc47acb=_0xc47acb-0x0;var _0x2a7547=_0xd9fc[_0xc47acb];return _0x2a7547;};'use strict';var _=require(_0xcd9f('0x0'));var util=require(_0xcd9f('0x1'));var logger=require('../../config/logger')(_0xcd9f('0x2'));var moment=require(_0xcd9f('0x3'));var BPromise=require(_0xcd9f('0x4'));var rp=require(_0xcd9f('0x5'));var fs=require('fs');var path=require(_0xcd9f('0x6'));var rimraf=require('rimraf');var config=require(_0xcd9f('0x7'));var attributes=require(_0xcd9f('0x8'));var integrations=require(_0xcd9f('0x9'));module[_0xcd9f('0xa')]=function(_0x484793,_0x327991){return _0x484793['define'](_0xcd9f('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 05df639..6dd1bc4 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9362=['ShowZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','request\x20sent','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','include','map','model','attributes','find','debug'];(function(_0x4c519d,_0x3cad1d){var _0x4479ce=function(_0x1e1ee8){while(--_0x1e1ee8){_0x4c519d['push'](_0x4c519d['shift']());}};_0x4479ce(++_0x3cad1d);}(_0x9362,0x111));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2936('0x0'));var util=require(_0x2936('0x1'));var moment=require(_0x2936('0x2'));var BPromise=require('bluebird');var rs=require(_0x2936('0x3'));var fs=require('fs');var Redis=require(_0x2936('0x4'));var db=require(_0x2936('0x5'))['db'];var utils=require(_0x2936('0x6'));var logger=require(_0x2936('0x7'))('rpc');var config=require(_0x2936('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2936('0x9')][_0x2936('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e1d50,_0x42154a,_0x2e89e7){return new BPromise(function(_0x83c45f,_0x21dc79){return client['request'](_0x4e1d50,_0x2e89e7)[_0x2936('0xb')](function(_0x4cea48){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x42154a,'request\x20sent');logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x42154a,_0x2936('0xc'),JSON[_0x2936('0xd')](_0x4cea48));if(_0x4cea48[_0x2936('0xe')]){if(_0x4cea48['error'][_0x2936('0xf')]===0x1f4){logger[_0x2936('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x42154a,_0x4cea48['error'][_0x2936('0x10')]);return _0x21dc79(_0x4cea48['error'][_0x2936('0x10')]);}logger[_0x2936('0xe')](_0x2936('0x11'),_0x42154a,_0x4cea48['error'][_0x2936('0x10')]);return _0x83c45f(_0x4cea48[_0x2936('0xe')][_0x2936('0x10')]);}else{logger[_0x2936('0x12')](_0x2936('0x11'),_0x42154a,_0x2936('0xc'));_0x83c45f(_0x4cea48[_0x2936('0x13')][_0x2936('0x10')]);}})[_0x2936('0x14')](function(_0x348520){logger[_0x2936('0xe')](_0x2936('0x11'),_0x42154a,_0x348520);_0x21dc79(_0x348520);});});}exports[_0x2936('0x15')]=function(_0x931847){var _0xd01740=this;return new Promise(function(_0x279441,_0x384ed1){return db[_0x2936('0x16')][_0x2936('0x17')]({'raw':_0x931847['options']?_0x931847[_0x2936('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x931847[_0x2936('0x18')]?_0x931847[_0x2936('0x18')][_0x2936('0x19')]||null:null,'attributes':_0x931847[_0x2936('0x18')]?_0x931847[_0x2936('0x18')]['attributes']||null:null,'limit':_0x931847[_0x2936('0x18')]?_0x931847[_0x2936('0x18')][_0x2936('0x1a')]||null:null,'include':_0x931847[_0x2936('0x18')]?_0x931847[_0x2936('0x18')][_0x2936('0x1b')]?_[_0x2936('0x1c')](_0x931847[_0x2936('0x18')]['include'],function(_0x3c997c){return{'model':db[_0x3c997c[_0x2936('0x1d')]],'as':_0x3c997c['as'],'attributes':_0x3c997c['attributes'],'include':_0x3c997c[_0x2936('0x1b')]?_[_0x2936('0x1c')](_0x3c997c[_0x2936('0x1b')],function(_0x30c024){return{'model':db[_0x30c024[_0x2936('0x1d')]],'as':_0x30c024['as'],'attributes':_0x30c024['attributes'],'include':_0x30c024['include']?_[_0x2936('0x1c')](_0x30c024[_0x2936('0x1b')],function(_0x4151e6){return{'model':db[_0x4151e6[_0x2936('0x1d')]],'as':_0x4151e6['as'],'attributes':_0x4151e6[_0x2936('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2936('0xb')](function(_0x5e5efa){logger[_0x2936('0x12')]('GetZendeskAccount',_0x931847);logger['debug']('GetZendeskAccount',_0x931847,JSON[_0x2936('0xd')](_0x5e5efa));_0x279441(_0x5e5efa);})['catch'](function(_0xa88ed0){logger[_0x2936('0xe')](_0x2936('0x15'),_0xa88ed0[_0x2936('0x10')],_0x931847);_0x384ed1(_0xd01740['error'](0x1f4,_0xa88ed0['message']));});});};exports['ShowZendeskAccount']=function(_0x11e3e2){var _0x3c16eb=this;return new Promise(function(_0xfcd00c,_0x5e1da1){return db[_0x2936('0x16')][_0x2936('0x1f')]({'raw':_0x11e3e2[_0x2936('0x18')]?_0x11e3e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x11e3e2[_0x2936('0x18')]?_0x11e3e2[_0x2936('0x18')][_0x2936('0x19')]||null:null,'attributes':_0x11e3e2['options']?_0x11e3e2['options'][_0x2936('0x1e')]||null:null,'include':_0x11e3e2[_0x2936('0x18')]?_0x11e3e2[_0x2936('0x18')][_0x2936('0x1b')]?_['map'](_0x11e3e2[_0x2936('0x18')][_0x2936('0x1b')],function(_0x28d4ff){return{'model':db[_0x28d4ff[_0x2936('0x1d')]],'as':_0x28d4ff['as'],'attributes':_0x28d4ff[_0x2936('0x1e')],'include':_0x28d4ff[_0x2936('0x1b')]?_[_0x2936('0x1c')](_0x28d4ff['include'],function(_0x1c716c){return{'model':db[_0x1c716c[_0x2936('0x1d')]],'as':_0x1c716c['as'],'attributes':_0x1c716c['attributes'],'include':_0x1c716c['include']?_[_0x2936('0x1c')](_0x1c716c[_0x2936('0x1b')],function(_0xdfca22){return{'model':db[_0xdfca22[_0x2936('0x1d')]],'as':_0xdfca22['as'],'attributes':_0xdfca22[_0x2936('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a9dde){logger[_0x2936('0x12')]('ShowZendeskAccount',_0x11e3e2);logger[_0x2936('0x20')](_0x2936('0x21'),_0x11e3e2,JSON['stringify'](_0x2a9dde));_0xfcd00c(_0x2a9dde);})[_0x2936('0x14')](function(_0x5b54c6){logger[_0x2936('0xe')](_0x2936('0x21'),_0x5b54c6[_0x2936('0x10')],_0x11e3e2);_0x5e1da1(_0x3c16eb[_0x2936('0xe')](0x1f4,_0x5b54c6['message']));});});}; \ No newline at end of file +var _0xbc5d=['../../config/utils','../../config/logger','rpc','../../config/environment','client','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowZendeskAccount','find','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x11f37f,_0x1c6e35){_0x11f37f=_0x11f37f-0x0;var _0x25c933=_0xbc5d[_0x11f37f];return _0x25c933;};'use strict';var _=require('lodash');var util=require(_0xdbc5('0x0'));var moment=require(_0xdbc5('0x1'));var BPromise=require(_0xdbc5('0x2'));var rs=require(_0xdbc5('0x3'));var fs=require('fs');var Redis=require(_0xdbc5('0x4'));var db=require(_0xdbc5('0x5'))['db'];var utils=require(_0xdbc5('0x6'));var logger=require(_0xdbc5('0x7'))(_0xdbc5('0x8'));var config=require(_0xdbc5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdbc5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6222,_0x3fac6f,_0x2d7747){return new BPromise(function(_0x2932b4,_0x53c60e){return client['request'](_0x1c6222,_0x2d7747)['then'](function(_0x4ac877){logger[_0xdbc5('0xb')](_0xdbc5('0xc'),_0x3fac6f,_0xdbc5('0xd'));logger['debug'](_0xdbc5('0xe'),_0x3fac6f,_0xdbc5('0xd'),JSON[_0xdbc5('0xf')](_0x4ac877));if(_0x4ac877['error']){if(_0x4ac877[_0xdbc5('0x10')][_0xdbc5('0x11')]===0x1f4){logger[_0xdbc5('0x10')](_0xdbc5('0xc'),_0x3fac6f,_0x4ac877[_0xdbc5('0x10')]['message']);return _0x53c60e(_0x4ac877[_0xdbc5('0x10')][_0xdbc5('0x12')]);}logger[_0xdbc5('0x10')](_0xdbc5('0xc'),_0x3fac6f,_0x4ac877[_0xdbc5('0x10')][_0xdbc5('0x12')]);return _0x2932b4(_0x4ac877[_0xdbc5('0x10')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x3fac6f,_0xdbc5('0xd'));_0x2932b4(_0x4ac877['result']['message']);}})[_0xdbc5('0x13')](function(_0x58871b){logger[_0xdbc5('0x10')](_0xdbc5('0xc'),_0x3fac6f,_0x58871b);_0x53c60e(_0x58871b);});});}exports[_0xdbc5('0x14')]=function(_0x41a8c4){var _0x51e06b=this;return new Promise(function(_0x4d793d,_0x5325eb){return db[_0xdbc5('0x15')][_0xdbc5('0x16')]({'raw':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4['options']['raw']===undefined?!![]:![]:!![],'where':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x18')]||null:null,'attributes':_0x41a8c4['options']?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x19')]||null:null,'limit':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x1a')]||null:null,'include':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x1b')],function(_0x20f611){return{'model':db[_0x20f611[_0xdbc5('0x1d')]],'as':_0x20f611['as'],'attributes':_0x20f611[_0xdbc5('0x19')],'include':_0x20f611[_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x20f611[_0xdbc5('0x1b')],function(_0x864959){return{'model':db[_0x864959['model']],'as':_0x864959['as'],'attributes':_0x864959[_0xdbc5('0x19')],'include':_0x864959[_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x864959[_0xdbc5('0x1b')],function(_0x5fd7f6){return{'model':db[_0x5fd7f6[_0xdbc5('0x1d')]],'as':_0x5fd7f6['as'],'attributes':_0x5fd7f6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2601aa){logger[_0xdbc5('0xb')](_0xdbc5('0x14'),_0x41a8c4);logger[_0xdbc5('0x1e')](_0xdbc5('0x14'),_0x41a8c4,JSON['stringify'](_0x2601aa));_0x4d793d(_0x2601aa);})['catch'](function(_0x123fa3){logger['error'](_0xdbc5('0x14'),_0x123fa3[_0xdbc5('0x12')],_0x41a8c4);_0x5325eb(_0x51e06b[_0xdbc5('0x10')](0x1f4,_0x123fa3[_0xdbc5('0x12')]));});});};exports[_0xdbc5('0x1f')]=function(_0x4262b9){var _0x5c3b5a=this;return new Promise(function(_0x215303,_0x44d1a8){return db['ZendeskAccount'][_0xdbc5('0x20')]({'raw':_0x4262b9[_0xdbc5('0x17')]?_0x4262b9[_0xdbc5('0x17')][_0xdbc5('0x21')]===undefined?!![]:![]:!![],'where':_0x4262b9[_0xdbc5('0x17')]?_0x4262b9['options'][_0xdbc5('0x18')]||null:null,'attributes':_0x4262b9['options']?_0x4262b9['options']['attributes']||null:null,'include':_0x4262b9[_0xdbc5('0x17')]?_0x4262b9[_0xdbc5('0x17')][_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x4262b9[_0xdbc5('0x17')][_0xdbc5('0x1b')],function(_0x132ff8){return{'model':db[_0x132ff8['model']],'as':_0x132ff8['as'],'attributes':_0x132ff8['attributes'],'include':_0x132ff8[_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x132ff8[_0xdbc5('0x1b')],function(_0x6bf36d){return{'model':db[_0x6bf36d[_0xdbc5('0x1d')]],'as':_0x6bf36d['as'],'attributes':_0x6bf36d['attributes'],'include':_0x6bf36d[_0xdbc5('0x1b')]?_['map'](_0x6bf36d[_0xdbc5('0x1b')],function(_0x50ddb8){return{'model':db[_0x50ddb8[_0xdbc5('0x1d')]],'as':_0x50ddb8['as'],'attributes':_0x50ddb8['attributes']};}):[]};}):[]};}):[]:[]})[_0xdbc5('0x22')](function(_0x3137fc){logger['info'](_0xdbc5('0x1f'),_0x4262b9);logger['debug']('ShowZendeskAccount',_0x4262b9,JSON[_0xdbc5('0xf')](_0x3137fc));_0x215303(_0x3137fc);})[_0xdbc5('0x13')](function(_0xfe9aae){logger[_0xdbc5('0x10')](_0xdbc5('0x1f'),_0xfe9aae[_0xdbc5('0x12')],_0x4262b9);_0x44d1a8(_0x5c3b5a[_0xdbc5('0x10')](0x1f4,_0xfe9aae[_0xdbc5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d9d01a5..d242c70 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x2e4481,_0xd520da){var _0x2d29c9=function(_0x1012aa){while(--_0x1012aa){_0x2e4481['push'](_0x2e4481['shift']());}};_0x2d29c9(++_0xd520da);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index e3117e9..387c191 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9e9=['exports','STRING','sequelize'];(function(_0x271ab7,_0x288a8c){var _0x3049fa=function(_0x545eb6){while(--_0x545eb6){_0x271ab7['push'](_0x271ab7['shift']());}};_0x3049fa(++_0x288a8c);}(_0xf9e9,0x16a));var _0x9f9e=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xf9e9[_0x836465];return _0x2150ea;};'use strict';var Sequelize=require(_0x9f9e('0x0'));module[_0x9f9e('0x1')]={'name':{'type':Sequelize[_0x9f9e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xed94=['sequelize','exports','STRING'];(function(_0x198911,_0x4e52f7){var _0x54f18f=function(_0x5e2c17){while(--_0x5e2c17){_0x198911['push'](_0x198911['shift']());}};_0x54f18f(++_0x4e52f7);}(_0xed94,0x19e));var _0x4ed9=function(_0x52ac27,_0x8776c8){_0x52ac27=_0x52ac27-0x0;var _0x40732e=_0xed94[_0x52ac27];return _0x40732e;};'use strict';var Sequelize=require(_0x4ed9('0x0'));module[_0x4ed9('0x1')]={'name':{'type':Sequelize[_0x4ed9('0x2')]},'description':{'type':Sequelize[_0x4ed9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 12b915b..b1c54da 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc101=['undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','length','includeAll','create','body','find','params','getFields','findOne','ZendeskField','pick','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x8ac7b2,_0xd52277){var _0x555250=function(_0x1789f6){while(--_0x1789f6){_0x8ac7b2['push'](_0x8ac7b2['shift']());}};_0x555250(++_0xd52277);}(_0xc101,0xe3));var _0x1c10=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xc101[_0x18546c];return _0x46ef43;};'use strict';var emlformat=require(_0x1c10('0x0'));var rimraf=require(_0x1c10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c10('0x2'));var rp=require(_0x1c10('0x3'));var moment=require(_0x1c10('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c10('0x5'));var util=require(_0x1c10('0x6'));var path=require(_0x1c10('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1c10('0x8'));var fs=require('fs');var fs_extra=require(_0x1c10('0x9'));var _=require(_0x1c10('0xa'));var squel=require(_0x1c10('0xb'));var crypto=require(_0x1c10('0xc'));var jsforce=require(_0x1c10('0xd'));var deskjs=require(_0x1c10('0xe'));var toCsv=require(_0x1c10('0xf'));var querystring=require(_0x1c10('0x10'));var Papa=require(_0x1c10('0x11'));var Redis=require(_0x1c10('0x12'));var authService=require(_0x1c10('0x13'));var qs=require(_0x1c10('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c10('0x15'))('api');var utils=require(_0x1c10('0x16'));var config=require(_0x1c10('0x17'));var licenseUtil=require(_0x1c10('0x18'));var db=require(_0x1c10('0x19'))['db'];function respondWithStatusCode(_0xfb478d,_0x1c3654){_0x1c3654=_0x1c3654||0xcc;return function(_0x15a916){if(_0x15a916){return _0xfb478d['sendStatus'](_0x1c3654);}return _0xfb478d[_0x1c10('0x1a')](_0x1c3654)[_0x1c10('0x1b')]();};}function respondWithResult(_0x48494d,_0x51dfda){_0x51dfda=_0x51dfda||0xc8;return function(_0x292d13){if(_0x292d13){return _0x48494d['status'](_0x51dfda)['json'](_0x292d13);}};}function respondWithFilteredResult(_0x38f975,_0x36c21b){return function(_0x4108d8){if(_0x4108d8){var _0x1dc19b=typeof _0x36c21b['offset']===_0x1c10('0x1c')&&typeof _0x36c21b['limit']===_0x1c10('0x1c');var _0x14b484=_0x4108d8[_0x1c10('0x1d')];var _0xc8d6eb=_0x1dc19b?0x0:_0x36c21b[_0x1c10('0x1e')];var _0x95cd9a=_0x1dc19b?_0x4108d8[_0x1c10('0x1d')]:_0x36c21b[_0x1c10('0x1e')]+_0x36c21b[_0x1c10('0x1f')];var _0x2f1fb6;if(_0x95cd9a>=_0x14b484){_0x95cd9a=_0x14b484;_0x2f1fb6=0xc8;}else{_0x2f1fb6=0xce;}_0x38f975['status'](_0x2f1fb6);return _0x38f975['set'](_0x1c10('0x20'),_0xc8d6eb+'-'+_0x95cd9a+'/'+_0x14b484)[_0x1c10('0x21')](_0x4108d8);}return null;};}function patchUpdates(_0x2e688c){return function(_0x129ebf){try{jsonpatch[_0x1c10('0x22')](_0x129ebf,_0x2e688c,!![]);}catch(_0x2ccde9){return BPromise[_0x1c10('0x23')](_0x2ccde9);}return _0x129ebf[_0x1c10('0x24')]();};}function saveUpdates(_0x3bbd1a,_0x586d74){return function(_0x554267){if(_0x554267){return _0x554267[_0x1c10('0x25')](_0x3bbd1a)[_0x1c10('0x26')](function(_0x4dbf17){return _0x4dbf17;});}return null;};}function removeEntity(_0x45f037,_0x455840){return function(_0x2126a0){if(_0x2126a0){return _0x2126a0['destroy']()[_0x1c10('0x26')](function(){_0x45f037[_0x1c10('0x1a')](0xcc)[_0x1c10('0x1b')]();});}};}function handleEntityNotFound(_0x310f10,_0x187044){return function(_0x2128ee){if(!_0x2128ee){_0x310f10[_0x1c10('0x27')](0x194);}return _0x2128ee;};}function handleError(_0x25e281,_0x5b34f8){_0x5b34f8=_0x5b34f8||0x1f4;return function(_0x2978c9){logger[_0x1c10('0x28')](_0x2978c9['stack']);if(_0x2978c9[_0x1c10('0x29')]){delete _0x2978c9['name'];}_0x25e281[_0x1c10('0x1a')](_0x5b34f8)['send'](_0x2978c9);};}exports[_0x1c10('0x2a')]=function(_0x2f639b,_0x2cbe25){var _0x47bc39={},_0x1481a4={},_0x3576e1={'count':0x0,'rows':[]};var _0x2aa844=_[_0x1c10('0x2b')](db[_0x1c10('0x2c')][_0x1c10('0x2d')],function(_0x2dbd33){return{'name':_0x2dbd33[_0x1c10('0x2e')],'type':_0x2dbd33[_0x1c10('0x2f')][_0x1c10('0x30')]};});_0x1481a4[_0x1c10('0x31')]=_['map'](_0x2aa844,_0x1c10('0x29'));_0x1481a4[_0x1c10('0x32')]=_[_0x1c10('0x33')](_0x2f639b[_0x1c10('0x32')]);_0x1481a4[_0x1c10('0x34')]=_[_0x1c10('0x35')](_0x1481a4[_0x1c10('0x31')],_0x1481a4[_0x1c10('0x32')]);_0x47bc39[_0x1c10('0x36')]=_[_0x1c10('0x35')](_0x1481a4[_0x1c10('0x31')],qs[_0x1c10('0x37')](_0x2f639b[_0x1c10('0x32')][_0x1c10('0x37')]));_0x47bc39[_0x1c10('0x36')]=_0x47bc39[_0x1c10('0x36')]['length']?_0x47bc39['attributes']:_0x1481a4[_0x1c10('0x31')];if(!_0x2f639b[_0x1c10('0x32')][_0x1c10('0x38')](_0x1c10('0x39'))){_0x47bc39[_0x1c10('0x1f')]=qs[_0x1c10('0x1f')](_0x2f639b['query'][_0x1c10('0x1f')]);_0x47bc39[_0x1c10('0x1e')]=qs['offset'](_0x2f639b['query'][_0x1c10('0x1e')]);}_0x47bc39['order']=qs[_0x1c10('0x3a')](_0x2f639b[_0x1c10('0x32')]['sort']);_0x47bc39[_0x1c10('0x3b')]=qs[_0x1c10('0x34')](_['pick'](_0x2f639b[_0x1c10('0x32')],_0x1481a4['filters']),_0x2aa844);if(_0x2f639b['query'][_0x1c10('0x3c')]){_0x47bc39[_0x1c10('0x3b')]=_[_0x1c10('0x3d')](_0x47bc39[_0x1c10('0x3b')],{'$or':_[_0x1c10('0x2b')](_0x2aa844,function(_0x1174af){if(_0x1174af['type']!==_0x1c10('0x3e')){var _0x5c6715={};_0x5c6715[_0x1174af[_0x1c10('0x29')]]={'$like':'%'+_0x2f639b['query'][_0x1c10('0x3c')]+'%'};return _0x5c6715;}})});}_0x47bc39=_[_0x1c10('0x3d')]({},_0x47bc39,_0x2f639b[_0x1c10('0x3f')]);var _0x1b0562={'where':_0x47bc39[_0x1c10('0x3b')]};return db[_0x1c10('0x2c')][_0x1c10('0x1d')](_0x1b0562)[_0x1c10('0x26')](function(_0x31470c){_0x3576e1['count']=_0x31470c;if(_0x2f639b[_0x1c10('0x32')]['includeAll']){_0x47bc39[_0x1c10('0x40')]=[{'all':!![]}];}return db[_0x1c10('0x2c')][_0x1c10('0x41')](_0x47bc39);})[_0x1c10('0x26')](function(_0x1ac5b7){_0x3576e1['rows']=_0x1ac5b7;return _0x3576e1;})[_0x1c10('0x26')](respondWithFilteredResult(_0x2cbe25,_0x47bc39))[_0x1c10('0x42')](handleError(_0x2cbe25,null));};exports[_0x1c10('0x43')]=function(_0x359cf7,_0x22fd52){var _0x501f36={'raw':![],'where':{'id':_0x359cf7['params']['id']}},_0x39c23c={};_0x39c23c[_0x1c10('0x31')]=_[_0x1c10('0x33')](db['ZendeskConfiguration'][_0x1c10('0x2d')]);_0x39c23c[_0x1c10('0x32')]=_[_0x1c10('0x33')](_0x359cf7['query']);_0x39c23c[_0x1c10('0x34')]=_[_0x1c10('0x35')](_0x39c23c[_0x1c10('0x31')],_0x39c23c[_0x1c10('0x32')]);_0x501f36[_0x1c10('0x36')]=_[_0x1c10('0x35')](_0x39c23c['model'],qs['fields'](_0x359cf7[_0x1c10('0x32')][_0x1c10('0x37')]));_0x501f36[_0x1c10('0x36')]=_0x501f36[_0x1c10('0x36')][_0x1c10('0x44')]?_0x501f36['attributes']:_0x39c23c['model'];if(_0x359cf7[_0x1c10('0x32')][_0x1c10('0x45')]){_0x501f36[_0x1c10('0x40')]=[{'all':!![]}];}_0x501f36=_['merge']({},_0x501f36,_0x359cf7[_0x1c10('0x3f')]);return db[_0x1c10('0x2c')]['find'](_0x501f36)[_0x1c10('0x26')](handleEntityNotFound(_0x22fd52,null))[_0x1c10('0x26')](respondWithResult(_0x22fd52,null))['catch'](handleError(_0x22fd52,null));};exports[_0x1c10('0x46')]=function(_0xef1a6a,_0x5cf4f3){return db[_0x1c10('0x2c')]['create'](_0xef1a6a[_0x1c10('0x47')],{})['then'](respondWithResult(_0x5cf4f3,0xc9))[_0x1c10('0x42')](handleError(_0x5cf4f3,null));};exports['update']=function(_0x58aeef,_0x1abc12){if(_0x58aeef[_0x1c10('0x47')]['id']){delete _0x58aeef[_0x1c10('0x47')]['id'];}return db['ZendeskConfiguration'][_0x1c10('0x48')]({'where':{'id':_0x58aeef[_0x1c10('0x49')]['id']}})[_0x1c10('0x26')](handleEntityNotFound(_0x1abc12,null))['then'](saveUpdates(_0x58aeef[_0x1c10('0x47')],null))['then'](respondWithResult(_0x1abc12,null))['catch'](handleError(_0x1abc12,null));};exports['destroy']=function(_0x4bd765,_0x21f436){return db[_0x1c10('0x2c')][_0x1c10('0x48')]({'where':{'id':_0x4bd765['params']['id']}})[_0x1c10('0x26')](handleEntityNotFound(_0x21f436,null))['then'](removeEntity(_0x21f436,null))[_0x1c10('0x42')](handleError(_0x21f436,null));};exports[_0x1c10('0x4a')]=function(_0x2498cf,_0x40f44,_0x2b07c4){var _0x3086ce={};var _0x4958be={};var _0x56d478;var _0x95a089;return db[_0x1c10('0x2c')][_0x1c10('0x4b')]({'where':{'id':_0x2498cf['params']['id']}})['then'](handleEntityNotFound(_0x40f44,null))[_0x1c10('0x26')](function(_0x3d693b){if(_0x3d693b){_0x56d478=_0x3d693b;_0x4958be[_0x1c10('0x31')]=_[_0x1c10('0x33')](db[_0x1c10('0x4c')][_0x1c10('0x2d')]);_0x4958be[_0x1c10('0x32')]=_[_0x1c10('0x33')](_0x2498cf[_0x1c10('0x32')]);_0x4958be[_0x1c10('0x34')]=_[_0x1c10('0x35')](_0x4958be[_0x1c10('0x31')],_0x4958be['query']);_0x3086ce[_0x1c10('0x36')]=_[_0x1c10('0x35')](_0x4958be[_0x1c10('0x31')],qs[_0x1c10('0x37')](_0x2498cf[_0x1c10('0x32')][_0x1c10('0x37')]));_0x3086ce[_0x1c10('0x36')]=_0x3086ce[_0x1c10('0x36')][_0x1c10('0x44')]?_0x3086ce[_0x1c10('0x36')]:_0x4958be['model'];_0x3086ce['order']=qs[_0x1c10('0x3a')](_0x2498cf[_0x1c10('0x32')][_0x1c10('0x3a')]);_0x3086ce['where']=qs[_0x1c10('0x34')](_[_0x1c10('0x4d')](_0x2498cf[_0x1c10('0x32')],_0x4958be[_0x1c10('0x34')]));if(_0x2498cf['query']['filter']){_0x3086ce['where']=_[_0x1c10('0x3d')](_0x3086ce[_0x1c10('0x3b')],{'$or':_['map'](_0x3086ce[_0x1c10('0x36')],function(_0x25c644){var _0x1da460={};_0x1da460[_0x25c644]={'$like':'%'+_0x2498cf[_0x1c10('0x32')][_0x1c10('0x3c')]+'%'};return _0x1da460;})});}_0x3086ce=_[_0x1c10('0x3d')]({},_0x3086ce,_0x2498cf[_0x1c10('0x3f')]);return _0x56d478[_0x1c10('0x4a')](_0x3086ce);}})['then'](function(_0x585985){if(_0x585985){_0x95a089=_0x585985[_0x1c10('0x44')];if(!_0x2498cf[_0x1c10('0x32')][_0x1c10('0x38')](_0x1c10('0x39'))){_0x3086ce[_0x1c10('0x1f')]=qs['limit'](_0x2498cf[_0x1c10('0x32')][_0x1c10('0x1f')]);_0x3086ce[_0x1c10('0x1e')]=qs['offset'](_0x2498cf[_0x1c10('0x32')][_0x1c10('0x1e')]);}return _0x56d478[_0x1c10('0x4a')](_0x3086ce);}})[_0x1c10('0x26')](function(_0x5444f4){if(_0x5444f4){return _0x5444f4?{'count':_0x95a089,'rows':_0x5444f4}:null;}})[_0x1c10('0x26')](respondWithResult(_0x40f44,null))[_0x1c10('0x42')](handleError(_0x40f44,null));};exports[_0x1c10('0x4e')]=function(_0x2cd8b2,_0x244162,_0x242a49){var _0x3c49f1={};var _0x389961={};var _0x28abc;var _0x108be2;return db[_0x1c10('0x2c')][_0x1c10('0x4b')]({'where':{'id':_0x2cd8b2[_0x1c10('0x49')]['id']}})[_0x1c10('0x26')](handleEntityNotFound(_0x244162,null))[_0x1c10('0x26')](function(_0x51ddc3){if(_0x51ddc3){_0x28abc=_0x51ddc3;_0x389961['model']=_['keys'](db[_0x1c10('0x4c')][_0x1c10('0x2d')]);_0x389961[_0x1c10('0x32')]=_[_0x1c10('0x33')](_0x2cd8b2[_0x1c10('0x32')]);_0x389961[_0x1c10('0x34')]=_[_0x1c10('0x35')](_0x389961['model'],_0x389961[_0x1c10('0x32')]);_0x3c49f1[_0x1c10('0x36')]=_[_0x1c10('0x35')](_0x389961[_0x1c10('0x31')],qs[_0x1c10('0x37')](_0x2cd8b2[_0x1c10('0x32')][_0x1c10('0x37')]));_0x3c49f1[_0x1c10('0x36')]=_0x3c49f1[_0x1c10('0x36')]['length']?_0x3c49f1[_0x1c10('0x36')]:_0x389961[_0x1c10('0x31')];_0x3c49f1[_0x1c10('0x4f')]=qs[_0x1c10('0x3a')](_0x2cd8b2[_0x1c10('0x32')]['sort']);_0x3c49f1[_0x1c10('0x3b')]=qs[_0x1c10('0x34')](_[_0x1c10('0x4d')](_0x2cd8b2[_0x1c10('0x32')],_0x389961[_0x1c10('0x34')]));if(_0x2cd8b2[_0x1c10('0x32')]['filter']){_0x3c49f1[_0x1c10('0x3b')]=_['merge'](_0x3c49f1[_0x1c10('0x3b')],{'$or':_[_0x1c10('0x2b')](_0x3c49f1[_0x1c10('0x36')],function(_0x39f077){var _0x239ee5={};_0x239ee5[_0x39f077]={'$like':'%'+_0x2cd8b2[_0x1c10('0x32')][_0x1c10('0x3c')]+'%'};return _0x239ee5;})});}_0x3c49f1=_['merge']({},_0x3c49f1,_0x2cd8b2[_0x1c10('0x3f')]);return _0x28abc[_0x1c10('0x4e')](_0x3c49f1);}})[_0x1c10('0x26')](function(_0xef8d75){if(_0xef8d75){_0x108be2=_0xef8d75[_0x1c10('0x44')];if(!_0x2cd8b2[_0x1c10('0x32')]['hasOwnProperty'](_0x1c10('0x39'))){_0x3c49f1[_0x1c10('0x1f')]=qs['limit'](_0x2cd8b2[_0x1c10('0x32')][_0x1c10('0x1f')]);_0x3c49f1[_0x1c10('0x1e')]=qs[_0x1c10('0x1e')](_0x2cd8b2['query']['offset']);}return _0x28abc[_0x1c10('0x4e')](_0x3c49f1);}})['then'](function(_0x30fb3e){if(_0x30fb3e){return _0x30fb3e?{'count':_0x108be2,'rows':_0x30fb3e}:null;}})[_0x1c10('0x26')](respondWithResult(_0x244162,null))[_0x1c10('0x42')](handleError(_0x244162,null));};exports[_0x1c10('0x50')]=function(_0x4059a3,_0x1b124b,_0x29dacf){var _0x18a977={};var _0x19517b={};var _0x3457e3;var _0x3ce0bb;return db[_0x1c10('0x2c')]['findOne']({'where':{'id':_0x4059a3[_0x1c10('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b124b,null))[_0x1c10('0x26')](function(_0x2d8b1d){if(_0x2d8b1d){_0x3457e3=_0x2d8b1d;_0x19517b[_0x1c10('0x31')]=_[_0x1c10('0x33')](db[_0x1c10('0x4c')][_0x1c10('0x2d')]);_0x19517b[_0x1c10('0x32')]=_[_0x1c10('0x33')](_0x4059a3[_0x1c10('0x32')]);_0x19517b['filters']=_[_0x1c10('0x35')](_0x19517b[_0x1c10('0x31')],_0x19517b['query']);_0x18a977[_0x1c10('0x36')]=_[_0x1c10('0x35')](_0x19517b[_0x1c10('0x31')],qs[_0x1c10('0x37')](_0x4059a3[_0x1c10('0x32')]['fields']));_0x18a977[_0x1c10('0x36')]=_0x18a977[_0x1c10('0x36')][_0x1c10('0x44')]?_0x18a977[_0x1c10('0x36')]:_0x19517b[_0x1c10('0x31')];_0x18a977[_0x1c10('0x4f')]=qs['sort'](_0x4059a3['query'][_0x1c10('0x3a')]);_0x18a977[_0x1c10('0x3b')]=qs[_0x1c10('0x34')](_[_0x1c10('0x4d')](_0x4059a3[_0x1c10('0x32')],_0x19517b[_0x1c10('0x34')]));if(_0x4059a3['query'][_0x1c10('0x3c')]){_0x18a977[_0x1c10('0x3b')]=_[_0x1c10('0x3d')](_0x18a977['where'],{'$or':_['map'](_0x18a977['attributes'],function(_0x4bdd44){var _0x243de9={};_0x243de9[_0x4bdd44]={'$like':'%'+_0x4059a3[_0x1c10('0x32')][_0x1c10('0x3c')]+'%'};return _0x243de9;})});}_0x18a977=_[_0x1c10('0x3d')]({},_0x18a977,_0x4059a3[_0x1c10('0x3f')]);return _0x3457e3['getDescriptions'](_0x18a977);}})[_0x1c10('0x26')](function(_0x2c7585){if(_0x2c7585){_0x3ce0bb=_0x2c7585[_0x1c10('0x44')];if(!_0x4059a3[_0x1c10('0x32')][_0x1c10('0x38')]('nolimit')){_0x18a977[_0x1c10('0x1f')]=qs[_0x1c10('0x1f')](_0x4059a3['query']['limit']);_0x18a977[_0x1c10('0x1e')]=qs[_0x1c10('0x1e')](_0x4059a3['query'][_0x1c10('0x1e')]);}return _0x3457e3[_0x1c10('0x50')](_0x18a977);}})[_0x1c10('0x26')](function(_0x1350ad){if(_0x1350ad){return _0x1350ad?{'count':_0x3ce0bb,'rows':_0x1350ad}:null;}})['then'](respondWithResult(_0x1b124b,null))[_0x1c10('0x42')](handleError(_0x1b124b,null));};exports[_0x1c10('0x51')]=function(_0x183615,_0x2f22fa,_0x3710af){var _0x4f4290={};var _0x2122e8={};var _0x19e394;var _0x578ee9;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x183615[_0x1c10('0x49')]['id']}})[_0x1c10('0x26')](handleEntityNotFound(_0x2f22fa,null))[_0x1c10('0x26')](function(_0x4c1e19){if(_0x4c1e19){_0x19e394=_0x4c1e19;_0x2122e8[_0x1c10('0x31')]=_[_0x1c10('0x33')](db[_0x1c10('0x52')][_0x1c10('0x2d')]);_0x2122e8[_0x1c10('0x32')]=_[_0x1c10('0x33')](_0x183615[_0x1c10('0x32')]);_0x2122e8[_0x1c10('0x34')]=_[_0x1c10('0x35')](_0x2122e8[_0x1c10('0x31')],_0x2122e8[_0x1c10('0x32')]);_0x4f4290[_0x1c10('0x36')]=_[_0x1c10('0x35')](_0x2122e8[_0x1c10('0x31')],qs[_0x1c10('0x37')](_0x183615['query'][_0x1c10('0x37')]));_0x4f4290[_0x1c10('0x36')]=_0x4f4290[_0x1c10('0x36')][_0x1c10('0x44')]?_0x4f4290['attributes']:_0x2122e8['model'];_0x4f4290[_0x1c10('0x4f')]=qs[_0x1c10('0x3a')](_0x183615['query'][_0x1c10('0x3a')]);_0x4f4290['where']=qs[_0x1c10('0x34')](_['pick'](_0x183615[_0x1c10('0x32')],_0x2122e8[_0x1c10('0x34')]));if(_0x183615[_0x1c10('0x32')][_0x1c10('0x3c')]){_0x4f4290[_0x1c10('0x3b')]=_['merge'](_0x4f4290['where'],{'$or':_[_0x1c10('0x2b')](_0x4f4290[_0x1c10('0x36')],function(_0x53fc89){var _0x5b99fb={};_0x5b99fb[_0x53fc89]={'$like':'%'+_0x183615[_0x1c10('0x32')]['filter']+'%'};return _0x5b99fb;})});}_0x4f4290=_[_0x1c10('0x3d')]({},_0x4f4290,_0x183615[_0x1c10('0x3f')]);return _0x19e394[_0x1c10('0x51')](_0x4f4290);}})[_0x1c10('0x26')](function(_0x4063d4){if(_0x4063d4){_0x578ee9=_0x4063d4[_0x1c10('0x44')];if(!_0x183615[_0x1c10('0x32')][_0x1c10('0x38')](_0x1c10('0x39'))){_0x4f4290[_0x1c10('0x1f')]=qs['limit'](_0x183615['query'][_0x1c10('0x1f')]);_0x4f4290[_0x1c10('0x1e')]=qs[_0x1c10('0x1e')](_0x183615[_0x1c10('0x32')][_0x1c10('0x1e')]);}return _0x19e394['getTags'](_0x4f4290);}})['then'](function(_0x4f4660){if(_0x4f4660){return _0x4f4660?{'count':_0x578ee9,'rows':_0x4f4660}:null;}})['then'](respondWithResult(_0x2f22fa,null))[_0x1c10('0x42')](handleError(_0x2f22fa,null));};exports[_0x1c10('0x53')]=function(_0x33e03b,_0x2b5902,_0x5909ea){if(_0x33e03b[_0x1c10('0x47')]['id']){delete _0x33e03b[_0x1c10('0x47')]['id'];}return db['ZendeskConfiguration'][_0x1c10('0x4b')]({'where':{'id':_0x33e03b['params']['id']}})['then'](handleEntityNotFound(_0x2b5902,null))[_0x1c10('0x26')](function(_0x36552e){if(_0x36552e){return _0x36552e['setTags'](_0x33e03b[_0x1c10('0x47')][_0x1c10('0x54')]||[]);}return null;})[_0x1c10('0x26')](respondWithResult(_0x2b5902,null))['catch'](handleError(_0x2b5902,null));}; \ No newline at end of file +var _0x1658=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','ZendeskConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','merge','find','create','body','findOne','options','getFields','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x23fd4e,_0x4201e9){var _0x192c8b=function(_0x2a09e4){while(--_0x2a09e4){_0x23fd4e['push'](_0x23fd4e['shift']());}};_0x192c8b(++_0x4201e9);}(_0x1658,0x146));var _0x8165=function(_0x3d5331,_0x37d7ef){_0x3d5331=_0x3d5331-0x0;var _0xc4e3c0=_0x1658[_0x3d5331];return _0xc4e3c0;};'use strict';var emlformat=require(_0x8165('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8165('0x1'));var jsonpatch=require(_0x8165('0x2'));var rp=require(_0x8165('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8165('0x4'));var util=require(_0x8165('0x5'));var path=require('path');var sox=require(_0x8165('0x6'));var csv=require(_0x8165('0x7'));var ejs=require(_0x8165('0x8'));var fs=require('fs');var fs_extra=require(_0x8165('0x9'));var _=require(_0x8165('0xa'));var squel=require(_0x8165('0xb'));var crypto=require('crypto');var jsforce=require(_0x8165('0xc'));var deskjs=require(_0x8165('0xd'));var toCsv=require(_0x8165('0x7'));var querystring=require(_0x8165('0xe'));var Papa=require(_0x8165('0xf'));var Redis=require(_0x8165('0x10'));var authService=require(_0x8165('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8165('0x12'));var hardwareService=require(_0x8165('0x13'));var logger=require(_0x8165('0x14'))(_0x8165('0x15'));var utils=require(_0x8165('0x16'));var config=require(_0x8165('0x17'));var licenseUtil=require(_0x8165('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7a71,_0x1b4d7b){_0x1b4d7b=_0x1b4d7b||0xcc;return function(_0x18ae3b){if(_0x18ae3b){return _0x2a7a71['sendStatus'](_0x1b4d7b);}return _0x2a7a71[_0x8165('0x19')](_0x1b4d7b)[_0x8165('0x1a')]();};}function respondWithResult(_0x3378ba,_0x24da76){_0x24da76=_0x24da76||0xc8;return function(_0x24a0d9){if(_0x24a0d9){return _0x3378ba['status'](_0x24da76)['json'](_0x24a0d9);}};}function respondWithFilteredResult(_0x41b74c,_0x5815ed){return function(_0x105484){if(_0x105484){var _0x9de95a=typeof _0x5815ed[_0x8165('0x1b')]===_0x8165('0x1c')&&typeof _0x5815ed[_0x8165('0x1d')]==='undefined';var _0x3bfe71=_0x105484[_0x8165('0x1e')];var _0x633a52=_0x9de95a?0x0:_0x5815ed[_0x8165('0x1b')];var _0xc70305=_0x9de95a?_0x105484[_0x8165('0x1e')]:_0x5815ed[_0x8165('0x1b')]+_0x5815ed[_0x8165('0x1d')];var _0x4aecd5;if(_0xc70305>=_0x3bfe71){_0xc70305=_0x3bfe71;_0x4aecd5=0xc8;}else{_0x4aecd5=0xce;}_0x41b74c[_0x8165('0x19')](_0x4aecd5);return _0x41b74c[_0x8165('0x1f')]('Content-Range',_0x633a52+'-'+_0xc70305+'/'+_0x3bfe71)[_0x8165('0x20')](_0x105484);}return null;};}function patchUpdates(_0x51bc2c){return function(_0x41a0cd){try{jsonpatch[_0x8165('0x21')](_0x41a0cd,_0x51bc2c,!![]);}catch(_0x3a1a66){return BPromise[_0x8165('0x22')](_0x3a1a66);}return _0x41a0cd['save']();};}function saveUpdates(_0x52c1f0,_0x2ab71f){return function(_0x2199df){if(_0x2199df){return _0x2199df[_0x8165('0x23')](_0x52c1f0)[_0x8165('0x24')](function(_0x3d95fd){return _0x3d95fd;});}return null;};}function removeEntity(_0x46f9fb,_0x3f2542){return function(_0x2272d9){if(_0x2272d9){return _0x2272d9[_0x8165('0x25')]()[_0x8165('0x24')](function(){_0x46f9fb['status'](0xcc)[_0x8165('0x1a')]();});}};}function handleEntityNotFound(_0x460fda,_0x506f5d){return function(_0x395131){if(!_0x395131){_0x460fda[_0x8165('0x26')](0x194);}return _0x395131;};}function handleError(_0x1d3b9e,_0x3116c9){_0x3116c9=_0x3116c9||0x1f4;return function(_0x19a114){logger[_0x8165('0x27')](_0x19a114[_0x8165('0x28')]);if(_0x19a114['name']){delete _0x19a114[_0x8165('0x29')];}_0x1d3b9e[_0x8165('0x19')](_0x3116c9)['send'](_0x19a114);};}exports[_0x8165('0x2a')]=function(_0x34c713,_0xcad789){var _0x93b6f6={},_0x41633a={},_0x5e31b1={'count':0x0,'rows':[]};var _0x212331=_['map'](db[_0x8165('0x2b')][_0x8165('0x2c')],function(_0x253fc4){return{'name':_0x253fc4[_0x8165('0x2d')],'type':_0x253fc4[_0x8165('0x2e')]['key']};});_0x41633a[_0x8165('0x2f')]=_[_0x8165('0x30')](_0x212331,'name');_0x41633a[_0x8165('0x31')]=_[_0x8165('0x32')](_0x34c713[_0x8165('0x31')]);_0x41633a[_0x8165('0x33')]=_[_0x8165('0x34')](_0x41633a[_0x8165('0x2f')],_0x41633a[_0x8165('0x31')]);_0x93b6f6[_0x8165('0x35')]=_[_0x8165('0x34')](_0x41633a[_0x8165('0x2f')],qs[_0x8165('0x36')](_0x34c713['query'][_0x8165('0x36')]));_0x93b6f6[_0x8165('0x35')]=_0x93b6f6[_0x8165('0x35')][_0x8165('0x37')]?_0x93b6f6['attributes']:_0x41633a[_0x8165('0x2f')];if(!_0x34c713[_0x8165('0x31')][_0x8165('0x38')](_0x8165('0x39'))){_0x93b6f6[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x34c713['query'][_0x8165('0x1d')]);_0x93b6f6[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x34c713[_0x8165('0x31')][_0x8165('0x1b')]);}_0x93b6f6[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x34c713[_0x8165('0x31')][_0x8165('0x3b')]);_0x93b6f6[_0x8165('0x3c')]=qs['filters'](_[_0x8165('0x3d')](_0x34c713[_0x8165('0x31')],_0x41633a['filters']),_0x212331);if(_0x34c713[_0x8165('0x31')][_0x8165('0x3e')]){_0x93b6f6[_0x8165('0x3c')]=_['merge'](_0x93b6f6[_0x8165('0x3c')],{'$or':_['map'](_0x212331,function(_0x4776f5){if(_0x4776f5['type']!==_0x8165('0x3f')){var _0x5666c9={};_0x5666c9[_0x4776f5[_0x8165('0x29')]]={'$like':'%'+_0x34c713[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x5666c9;}})});}_0x93b6f6=_['merge']({},_0x93b6f6,_0x34c713['options']);var _0x3a8728={'where':_0x93b6f6['where']};return db['ZendeskConfiguration'][_0x8165('0x1e')](_0x3a8728)[_0x8165('0x24')](function(_0x1d342e){_0x5e31b1['count']=_0x1d342e;if(_0x34c713[_0x8165('0x31')]['includeAll']){_0x93b6f6['include']=[{'all':!![]}];}return db[_0x8165('0x2b')][_0x8165('0x40')](_0x93b6f6);})[_0x8165('0x24')](function(_0x3628ec){_0x5e31b1[_0x8165('0x41')]=_0x3628ec;return _0x5e31b1;})[_0x8165('0x24')](respondWithFilteredResult(_0xcad789,_0x93b6f6))[_0x8165('0x42')](handleError(_0xcad789,null));};exports[_0x8165('0x43')]=function(_0x2773b4,_0x23fcb1){var _0x1c4220={'raw':![],'where':{'id':_0x2773b4[_0x8165('0x44')]['id']}},_0x45c7c6={};_0x45c7c6[_0x8165('0x2f')]=_[_0x8165('0x32')](db['ZendeskConfiguration'][_0x8165('0x2c')]);_0x45c7c6[_0x8165('0x31')]=_[_0x8165('0x32')](_0x2773b4[_0x8165('0x31')]);_0x45c7c6['filters']=_[_0x8165('0x34')](_0x45c7c6[_0x8165('0x2f')],_0x45c7c6[_0x8165('0x31')]);_0x1c4220[_0x8165('0x35')]=_[_0x8165('0x34')](_0x45c7c6[_0x8165('0x2f')],qs[_0x8165('0x36')](_0x2773b4['query'][_0x8165('0x36')]));_0x1c4220['attributes']=_0x1c4220[_0x8165('0x35')][_0x8165('0x37')]?_0x1c4220[_0x8165('0x35')]:_0x45c7c6[_0x8165('0x2f')];if(_0x2773b4[_0x8165('0x31')][_0x8165('0x45')]){_0x1c4220[_0x8165('0x46')]=[{'all':!![]}];}_0x1c4220=_[_0x8165('0x47')]({},_0x1c4220,_0x2773b4['options']);return db[_0x8165('0x2b')][_0x8165('0x48')](_0x1c4220)[_0x8165('0x24')](handleEntityNotFound(_0x23fcb1,null))['then'](respondWithResult(_0x23fcb1,null))['catch'](handleError(_0x23fcb1,null));};exports[_0x8165('0x49')]=function(_0x25b1ad,_0x14dc54){return db[_0x8165('0x2b')][_0x8165('0x49')](_0x25b1ad[_0x8165('0x4a')],{})[_0x8165('0x24')](respondWithResult(_0x14dc54,0xc9))[_0x8165('0x42')](handleError(_0x14dc54,null));};exports[_0x8165('0x23')]=function(_0x7a9799,_0x45dceb){if(_0x7a9799[_0x8165('0x4a')]['id']){delete _0x7a9799[_0x8165('0x4a')]['id'];}return db[_0x8165('0x2b')][_0x8165('0x48')]({'where':{'id':_0x7a9799[_0x8165('0x44')]['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x45dceb,null))[_0x8165('0x24')](saveUpdates(_0x7a9799[_0x8165('0x4a')],null))[_0x8165('0x24')](respondWithResult(_0x45dceb,null))[_0x8165('0x42')](handleError(_0x45dceb,null));};exports[_0x8165('0x25')]=function(_0x55e4f8,_0x25b84a){return db[_0x8165('0x2b')][_0x8165('0x48')]({'where':{'id':_0x55e4f8['params']['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x25b84a,null))[_0x8165('0x24')](removeEntity(_0x25b84a,null))[_0x8165('0x42')](handleError(_0x25b84a,null));};exports['getFields']=function(_0x16e104,_0x3612c9,_0xad768){var _0x459ddd={};var _0x519e16={};var _0x425c21;var _0x4d88f6;return db[_0x8165('0x2b')][_0x8165('0x4b')]({'where':{'id':_0x16e104['params']['id']}})['then'](handleEntityNotFound(_0x3612c9,null))[_0x8165('0x24')](function(_0x21456e){if(_0x21456e){_0x425c21=_0x21456e;_0x519e16[_0x8165('0x2f')]=_[_0x8165('0x32')](db['ZendeskField'][_0x8165('0x2c')]);_0x519e16[_0x8165('0x31')]=_['keys'](_0x16e104[_0x8165('0x31')]);_0x519e16[_0x8165('0x33')]=_['intersection'](_0x519e16[_0x8165('0x2f')],_0x519e16[_0x8165('0x31')]);_0x459ddd[_0x8165('0x35')]=_[_0x8165('0x34')](_0x519e16['model'],qs[_0x8165('0x36')](_0x16e104['query']['fields']));_0x459ddd[_0x8165('0x35')]=_0x459ddd[_0x8165('0x35')][_0x8165('0x37')]?_0x459ddd[_0x8165('0x35')]:_0x519e16['model'];_0x459ddd[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x16e104[_0x8165('0x31')][_0x8165('0x3b')]);_0x459ddd[_0x8165('0x3c')]=qs['filters'](_[_0x8165('0x3d')](_0x16e104['query'],_0x519e16['filters']));if(_0x16e104[_0x8165('0x31')][_0x8165('0x3e')]){_0x459ddd[_0x8165('0x3c')]=_[_0x8165('0x47')](_0x459ddd[_0x8165('0x3c')],{'$or':_['map'](_0x459ddd[_0x8165('0x35')],function(_0x55f734){var _0x4dc4ca={};_0x4dc4ca[_0x55f734]={'$like':'%'+_0x16e104[_0x8165('0x31')]['filter']+'%'};return _0x4dc4ca;})});}_0x459ddd=_[_0x8165('0x47')]({},_0x459ddd,_0x16e104[_0x8165('0x4c')]);return _0x425c21[_0x8165('0x4d')](_0x459ddd);}})['then'](function(_0x5ea246){if(_0x5ea246){_0x4d88f6=_0x5ea246['length'];if(!_0x16e104[_0x8165('0x31')][_0x8165('0x38')](_0x8165('0x39'))){_0x459ddd[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x16e104['query'][_0x8165('0x1d')]);_0x459ddd[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x16e104['query'][_0x8165('0x1b')]);}return _0x425c21[_0x8165('0x4d')](_0x459ddd);}})[_0x8165('0x24')](function(_0x15b486){if(_0x15b486){return _0x15b486?{'count':_0x4d88f6,'rows':_0x15b486}:null;}})[_0x8165('0x24')](respondWithResult(_0x3612c9,null))['catch'](handleError(_0x3612c9,null));};exports['getSubjects']=function(_0x565784,_0x200937,_0x430491){var _0x162c1a={};var _0x120698={};var _0x3e7ac1;var _0x363bb2;return db[_0x8165('0x2b')][_0x8165('0x4b')]({'where':{'id':_0x565784[_0x8165('0x44')]['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x200937,null))[_0x8165('0x24')](function(_0x13cdfc){if(_0x13cdfc){_0x3e7ac1=_0x13cdfc;_0x120698[_0x8165('0x2f')]=_[_0x8165('0x32')](db[_0x8165('0x4e')][_0x8165('0x2c')]);_0x120698[_0x8165('0x31')]=_['keys'](_0x565784['query']);_0x120698[_0x8165('0x33')]=_['intersection'](_0x120698['model'],_0x120698['query']);_0x162c1a[_0x8165('0x35')]=_[_0x8165('0x34')](_0x120698[_0x8165('0x2f')],qs[_0x8165('0x36')](_0x565784[_0x8165('0x31')][_0x8165('0x36')]));_0x162c1a[_0x8165('0x35')]=_0x162c1a['attributes']['length']?_0x162c1a[_0x8165('0x35')]:_0x120698['model'];_0x162c1a[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x565784[_0x8165('0x31')]['sort']);_0x162c1a[_0x8165('0x3c')]=qs[_0x8165('0x33')](_[_0x8165('0x3d')](_0x565784[_0x8165('0x31')],_0x120698[_0x8165('0x33')]));if(_0x565784[_0x8165('0x31')][_0x8165('0x3e')]){_0x162c1a['where']=_['merge'](_0x162c1a[_0x8165('0x3c')],{'$or':_['map'](_0x162c1a['attributes'],function(_0x224294){var _0x3ed96b={};_0x3ed96b[_0x224294]={'$like':'%'+_0x565784[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x3ed96b;})});}_0x162c1a=_[_0x8165('0x47')]({},_0x162c1a,_0x565784[_0x8165('0x4c')]);return _0x3e7ac1[_0x8165('0x4f')](_0x162c1a);}})[_0x8165('0x24')](function(_0x57c048){if(_0x57c048){_0x363bb2=_0x57c048[_0x8165('0x37')];if(!_0x565784[_0x8165('0x31')]['hasOwnProperty'](_0x8165('0x39'))){_0x162c1a[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x565784['query'][_0x8165('0x1d')]);_0x162c1a[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x565784[_0x8165('0x31')]['offset']);}return _0x3e7ac1[_0x8165('0x4f')](_0x162c1a);}})[_0x8165('0x24')](function(_0x5bc97b){if(_0x5bc97b){return _0x5bc97b?{'count':_0x363bb2,'rows':_0x5bc97b}:null;}})[_0x8165('0x24')](respondWithResult(_0x200937,null))[_0x8165('0x42')](handleError(_0x200937,null));};exports[_0x8165('0x50')]=function(_0x4dee92,_0x16a35b,_0x1cec84){var _0x2e6f9c={};var _0x4abd43={};var _0x1a8726;var _0x136da1;return db['ZendeskConfiguration'][_0x8165('0x4b')]({'where':{'id':_0x4dee92[_0x8165('0x44')]['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x16a35b,null))[_0x8165('0x24')](function(_0x5129e8){if(_0x5129e8){_0x1a8726=_0x5129e8;_0x4abd43[_0x8165('0x2f')]=_[_0x8165('0x32')](db[_0x8165('0x4e')][_0x8165('0x2c')]);_0x4abd43['query']=_[_0x8165('0x32')](_0x4dee92[_0x8165('0x31')]);_0x4abd43['filters']=_[_0x8165('0x34')](_0x4abd43[_0x8165('0x2f')],_0x4abd43[_0x8165('0x31')]);_0x2e6f9c[_0x8165('0x35')]=_[_0x8165('0x34')](_0x4abd43['model'],qs[_0x8165('0x36')](_0x4dee92['query'][_0x8165('0x36')]));_0x2e6f9c[_0x8165('0x35')]=_0x2e6f9c[_0x8165('0x35')][_0x8165('0x37')]?_0x2e6f9c[_0x8165('0x35')]:_0x4abd43['model'];_0x2e6f9c[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x4dee92[_0x8165('0x31')][_0x8165('0x3b')]);_0x2e6f9c[_0x8165('0x3c')]=qs[_0x8165('0x33')](_[_0x8165('0x3d')](_0x4dee92['query'],_0x4abd43[_0x8165('0x33')]));if(_0x4dee92[_0x8165('0x31')][_0x8165('0x3e')]){_0x2e6f9c[_0x8165('0x3c')]=_[_0x8165('0x47')](_0x2e6f9c[_0x8165('0x3c')],{'$or':_[_0x8165('0x30')](_0x2e6f9c[_0x8165('0x35')],function(_0x2b7801){var _0x432659={};_0x432659[_0x2b7801]={'$like':'%'+_0x4dee92[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x432659;})});}_0x2e6f9c=_['merge']({},_0x2e6f9c,_0x4dee92[_0x8165('0x4c')]);return _0x1a8726['getDescriptions'](_0x2e6f9c);}})[_0x8165('0x24')](function(_0x2f69b2){if(_0x2f69b2){_0x136da1=_0x2f69b2[_0x8165('0x37')];if(!_0x4dee92['query'][_0x8165('0x38')](_0x8165('0x39'))){_0x2e6f9c[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x4dee92[_0x8165('0x31')][_0x8165('0x1d')]);_0x2e6f9c[_0x8165('0x1b')]=qs['offset'](_0x4dee92['query'][_0x8165('0x1b')]);}return _0x1a8726[_0x8165('0x50')](_0x2e6f9c);}})[_0x8165('0x24')](function(_0x57fc5f){if(_0x57fc5f){return _0x57fc5f?{'count':_0x136da1,'rows':_0x57fc5f}:null;}})[_0x8165('0x24')](respondWithResult(_0x16a35b,null))[_0x8165('0x42')](handleError(_0x16a35b,null));};exports[_0x8165('0x51')]=function(_0x5d83b1,_0x5728cd,_0x27470c){var _0x14a22b={};var _0x2107e6={};var _0xeac440;var _0x238538;return db[_0x8165('0x2b')]['findOne']({'where':{'id':_0x5d83b1['params']['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x5728cd,null))[_0x8165('0x24')](function(_0x5e3a3a){if(_0x5e3a3a){_0xeac440=_0x5e3a3a;_0x2107e6[_0x8165('0x2f')]=_[_0x8165('0x32')](db[_0x8165('0x52')][_0x8165('0x2c')]);_0x2107e6[_0x8165('0x31')]=_[_0x8165('0x32')](_0x5d83b1[_0x8165('0x31')]);_0x2107e6[_0x8165('0x33')]=_[_0x8165('0x34')](_0x2107e6['model'],_0x2107e6[_0x8165('0x31')]);_0x14a22b[_0x8165('0x35')]=_[_0x8165('0x34')](_0x2107e6['model'],qs[_0x8165('0x36')](_0x5d83b1[_0x8165('0x31')][_0x8165('0x36')]));_0x14a22b[_0x8165('0x35')]=_0x14a22b[_0x8165('0x35')]['length']?_0x14a22b[_0x8165('0x35')]:_0x2107e6[_0x8165('0x2f')];_0x14a22b[_0x8165('0x3a')]=qs['sort'](_0x5d83b1[_0x8165('0x31')][_0x8165('0x3b')]);_0x14a22b[_0x8165('0x3c')]=qs[_0x8165('0x33')](_['pick'](_0x5d83b1[_0x8165('0x31')],_0x2107e6[_0x8165('0x33')]));if(_0x5d83b1[_0x8165('0x31')][_0x8165('0x3e')]){_0x14a22b[_0x8165('0x3c')]=_['merge'](_0x14a22b[_0x8165('0x3c')],{'$or':_['map'](_0x14a22b[_0x8165('0x35')],function(_0x42ec46){var _0x19c184={};_0x19c184[_0x42ec46]={'$like':'%'+_0x5d83b1[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x19c184;})});}_0x14a22b=_[_0x8165('0x47')]({},_0x14a22b,_0x5d83b1['options']);return _0xeac440['getTags'](_0x14a22b);}})[_0x8165('0x24')](function(_0x48e38b){if(_0x48e38b){_0x238538=_0x48e38b[_0x8165('0x37')];if(!_0x5d83b1[_0x8165('0x31')][_0x8165('0x38')](_0x8165('0x39'))){_0x14a22b[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x5d83b1['query'][_0x8165('0x1d')]);_0x14a22b[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x5d83b1['query'][_0x8165('0x1b')]);}return _0xeac440[_0x8165('0x51')](_0x14a22b);}})[_0x8165('0x24')](function(_0x16ed3d){if(_0x16ed3d){return _0x16ed3d?{'count':_0x238538,'rows':_0x16ed3d}:null;}})['then'](respondWithResult(_0x5728cd,null))[_0x8165('0x42')](handleError(_0x5728cd,null));};exports['setTags']=function(_0x59a76b,_0xcb9f44,_0x5728e3){if(_0x59a76b[_0x8165('0x4a')]['id']){delete _0x59a76b['body']['id'];}return db[_0x8165('0x2b')][_0x8165('0x4b')]({'where':{'id':_0x59a76b[_0x8165('0x44')]['id']}})['then'](handleEntityNotFound(_0xcb9f44,null))[_0x8165('0x24')](function(_0x36e624){if(_0x36e624){return _0x36e624[_0x8165('0x53')](_0x59a76b[_0x8165('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0xcb9f44,null))[_0x8165('0x42')](handleError(_0xcb9f44,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 33a907a..14acdbb 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea28=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x119987,_0xff374d){var _0x4aa2ce=function(_0x508b70){while(--_0x508b70){_0x119987['push'](_0x119987['shift']());}};_0x4aa2ce(++_0xff374d);}(_0xea28,0x13a));var _0x8ea2=function(_0x4d3e20,_0x5456e1){_0x4d3e20=_0x4d3e20-0x0;var _0x30cf39=_0xea28[_0x4d3e20];return _0x30cf39;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x29d813,_0x105d56){var _0x18a7c3=function(_0x2abd87){while(--_0x2abd87){_0x29d813['push'](_0x29d813['shift']());}};_0x18a7c3(++_0x105d56);}(_0x056b,0xb6));var _0xb056=function(_0x207696,_0x1cf674){_0x207696=_0x207696-0x0;var _0x4060f3=_0x056b[_0x207696];return _0x4060f3;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 055c040..8f6b77e 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31c8=['client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x385325,_0x480c62){var _0x5b9b93=function(_0x51d974){while(--_0x51d974){_0x385325['push'](_0x385325['shift']());}};_0x5b9b93(++_0x480c62);}(_0x31c8,0x1a5));var _0x831c=function(_0xf54a80,_0x4f0c6a){_0xf54a80=_0xf54a80-0x0;var _0x208e95=_0x31c8[_0xf54a80];return _0x208e95;};'use strict';var _=require(_0x831c('0x0'));var util=require(_0x831c('0x1'));var moment=require(_0x831c('0x2'));var BPromise=require(_0x831c('0x3'));var rs=require(_0x831c('0x4'));var fs=require('fs');var Redis=require(_0x831c('0x5'));var db=require(_0x831c('0x6'))['db'];var utils=require(_0x831c('0x7'));var logger=require('../../config/logger')(_0x831c('0x8'));var config=require(_0x831c('0x9'));var jayson=require(_0x831c('0xa'));var client=jayson[_0x831c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2774f4,_0x4ee0d7,_0x34b6b7){return new BPromise(function(_0x24d70f,_0x59a92a){return client[_0x831c('0xc')](_0x2774f4,_0x34b6b7)[_0x831c('0xd')](function(_0x24d1c0){logger[_0x831c('0xe')](_0x831c('0xf'),_0x4ee0d7,_0x831c('0x10'));logger[_0x831c('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4ee0d7,_0x831c('0x10'),JSON[_0x831c('0x12')](_0x24d1c0));if(_0x24d1c0[_0x831c('0x13')]){if(_0x24d1c0[_0x831c('0x13')][_0x831c('0x14')]===0x1f4){logger[_0x831c('0x13')](_0x831c('0xf'),_0x4ee0d7,_0x24d1c0[_0x831c('0x13')][_0x831c('0x15')]);return _0x59a92a(_0x24d1c0[_0x831c('0x13')]['message']);}logger[_0x831c('0x13')](_0x831c('0xf'),_0x4ee0d7,_0x24d1c0[_0x831c('0x13')][_0x831c('0x15')]);return _0x24d70f(_0x24d1c0[_0x831c('0x13')]['message']);}else{logger[_0x831c('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ee0d7,_0x831c('0x10'));_0x24d70f(_0x24d1c0[_0x831c('0x16')][_0x831c('0x15')]);}})[_0x831c('0x17')](function(_0x334b70){logger[_0x831c('0x13')](_0x831c('0xf'),_0x4ee0d7,_0x334b70);_0x59a92a(_0x334b70);});});} \ No newline at end of file +var _0xeea4=['client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0xeea4,0x194));var _0x4eea=function(_0x2ade31,_0x2aeb74){_0x2ade31=_0x2ade31-0x0;var _0x558685=_0xeea4[_0x2ade31];return _0x558685;};'use strict';var _=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var moment=require(_0x4eea('0x2'));var BPromise=require(_0x4eea('0x3'));var rs=require(_0x4eea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4eea('0x5'))['db'];var utils=require(_0x4eea('0x6'));var logger=require(_0x4eea('0x7'))(_0x4eea('0x8'));var config=require(_0x4eea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4eea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x927213,_0xe77ba6,_0x7521c4){return new BPromise(function(_0x43aa0c,_0x3b26e6){return client[_0x4eea('0xb')](_0x927213,_0x7521c4)[_0x4eea('0xc')](function(_0x41ead9){logger[_0x4eea('0xd')](_0x4eea('0xe'),_0xe77ba6,_0x4eea('0xf'));logger[_0x4eea('0x10')](_0x4eea('0x11'),_0xe77ba6,'request\x20sent',JSON[_0x4eea('0x12')](_0x41ead9));if(_0x41ead9[_0x4eea('0x13')]){if(_0x41ead9[_0x4eea('0x13')][_0x4eea('0x14')]===0x1f4){logger[_0x4eea('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe77ba6,_0x41ead9[_0x4eea('0x13')]['message']);return _0x3b26e6(_0x41ead9[_0x4eea('0x13')][_0x4eea('0x15')]);}logger[_0x4eea('0x13')](_0x4eea('0xe'),_0xe77ba6,_0x41ead9['error'][_0x4eea('0x15')]);return _0x43aa0c(_0x41ead9['error'][_0x4eea('0x15')]);}else{logger[_0x4eea('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe77ba6,_0x4eea('0xf'));_0x43aa0c(_0x41ead9['result']['message']);}})[_0x4eea('0x16')](function(_0x333d0b){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xe77ba6,_0x333d0b);_0x3b26e6(_0x333d0b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c1157be..06dfee4 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7c0=['../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x590cc4,_0x5d581b){var _0x5ca730=function(_0x3f3741){while(--_0x3f3741){_0x590cc4['push'](_0x590cc4['shift']());}};_0x5ca730(++_0x5d581b);}(_0xf7c0,0xfa));var _0x0f7c=function(_0x6935ba,_0x1eb4d5){_0x6935ba=_0x6935ba-0x0;var _0x4c844c=_0xf7c0[_0x6935ba];return _0x4c844c;};'use strict';var multer=require('multer');var util=require(_0x0f7c('0x0'));var path=require(_0x0f7c('0x1'));var timeout=require(_0x0f7c('0x2'));var express=require('express');var router=express[_0x0f7c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0f7c('0x4'));var interaction=require(_0x0f7c('0x5'));var config=require(_0x0f7c('0x6'));var controller=require('./intZendeskField.controller');router[_0x0f7c('0x7')]('/',auth[_0x0f7c('0x8')](),controller[_0x0f7c('0x9')]);router[_0x0f7c('0x7')](_0x0f7c('0xa'),auth[_0x0f7c('0x8')](),controller[_0x0f7c('0xb')]);router[_0x0f7c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0f7c('0xd')](_0x0f7c('0xa'),auth[_0x0f7c('0x8')](),controller[_0x0f7c('0xe')]);router['delete'](_0x0f7c('0xa'),auth[_0x0f7c('0x8')](),controller['destroy']);module[_0x0f7c('0xf')]=router; \ No newline at end of file +var _0x9e09=['isAuthenticated','show','post','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id'];(function(_0x1bd646,_0x21803d){var _0xf9d22e=function(_0x30929c){while(--_0x30929c){_0x1bd646['push'](_0x1bd646['shift']());}};_0xf9d22e(++_0x21803d);}(_0x9e09,0x66));var _0x99e0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9e09[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x99e0('0x0'));var util=require(_0x99e0('0x1'));var path=require(_0x99e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x99e0('0x3'));var router=express['Router']();var fs_extra=require(_0x99e0('0x4'));var auth=require(_0x99e0('0x5'));var interaction=require(_0x99e0('0x6'));var config=require(_0x99e0('0x7'));var controller=require(_0x99e0('0x8'));router[_0x99e0('0x9')]('/',auth['isAuthenticated'](),controller[_0x99e0('0xa')]);router[_0x99e0('0x9')](_0x99e0('0xb'),auth[_0x99e0('0xc')](),controller[_0x99e0('0xd')]);router[_0x99e0('0xe')]('/',auth[_0x99e0('0xc')](),controller['create']);router[_0x99e0('0xf')]('/:id',auth[_0x99e0('0xc')](),controller[_0x99e0('0x10')]);router[_0x99e0('0x11')](_0x99e0('0xb'),auth[_0x99e0('0xc')](),controller['destroy']);module[_0x99e0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index c24cfd7..58bf624 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa232=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize'];(function(_0x1531e8,_0x3a1b03){var _0x3e058b=function(_0x45125b){while(--_0x45125b){_0x1531e8['push'](_0x1531e8['shift']());}};_0x3e058b(++_0x3a1b03);}(_0xa232,0x19f));var _0x2a23=function(_0x33c3f0,_0x35a6a6){_0x33c3f0=_0x33c3f0-0x0;var _0x2ce021=_0xa232[_0x33c3f0];return _0x2ce021;};'use strict';var Sequelize=require(_0x2a23('0x0'));module['exports']={'type':{'type':Sequelize[_0x2a23('0x1')](_0x2a23('0x2'),_0x2a23('0x3'),'customVariable',_0x2a23('0x4'),_0x2a23('0x5')),'defaultValue':_0x2a23('0x2')},'content':{'type':Sequelize[_0x2a23('0x6')]},'key':{'type':Sequelize[_0x2a23('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x2a23('0x3'),_0x2a23('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2a23('0x6')]},'nameField':{'type':Sequelize[_0x2a23('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xec92=['STRING','ENUM','string','variable','customVariable','picklist'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xec92,0x121));var _0x2ec9=function(_0x1bb9be,_0x2fe99f){_0x1bb9be=_0x1bb9be-0x0;var _0x4f6b36=_0xec92[_0x1bb9be];return _0x4f6b36;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2ec9('0x0')](_0x2ec9('0x1'),_0x2ec9('0x2'),_0x2ec9('0x3'),'keyValue',_0x2ec9('0x4')),'defaultValue':_0x2ec9('0x1')},'content':{'type':Sequelize[_0x2ec9('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2ec9('0x0')]('string',_0x2ec9('0x2'),_0x2ec9('0x3'))},'keyContent':{'type':Sequelize[_0x2ec9('0x5')]},'idField':{'type':Sequelize[_0x2ec9('0x5')]},'nameField':{'type':Sequelize[_0x2ec9('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ec9('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 798024c..e5cddd5 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa671=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','ZendeskField','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x55b296,_0x1d7176){var _0x57c656=function(_0x519951){while(--_0x519951){_0x55b296['push'](_0x55b296['shift']());}};_0x57c656(++_0x1d7176);}(_0xa671,0x1a4));var _0x1a67=function(_0x3c2b2b,_0x5250d9){_0x3c2b2b=_0x3c2b2b-0x0;var _0x1484f5=_0xa671[_0x3c2b2b];return _0x1484f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a67('0x0'));var zipdir=require(_0x1a67('0x1'));var jsonpatch=require(_0x1a67('0x2'));var rp=require(_0x1a67('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a67('0x4'));var util=require('util');var path=require(_0x1a67('0x5'));var sox=require(_0x1a67('0x6'));var csv=require(_0x1a67('0x7'));var ejs=require(_0x1a67('0x8'));var fs=require('fs');var fs_extra=require(_0x1a67('0x9'));var _=require('lodash');var squel=require(_0x1a67('0xa'));var crypto=require(_0x1a67('0xb'));var jsforce=require(_0x1a67('0xc'));var deskjs=require(_0x1a67('0xd'));var toCsv=require(_0x1a67('0x7'));var querystring=require(_0x1a67('0xe'));var Papa=require(_0x1a67('0xf'));var Redis=require(_0x1a67('0x10'));var authService=require(_0x1a67('0x11'));var qs=require(_0x1a67('0x12'));var as=require(_0x1a67('0x13'));var hardwareService=require(_0x1a67('0x14'));var logger=require(_0x1a67('0x15'))(_0x1a67('0x16'));var utils=require('../../config/utils');var config=require(_0x1a67('0x17'));var licenseUtil=require(_0x1a67('0x18'));var db=require(_0x1a67('0x19'))['db'];function respondWithStatusCode(_0x56f6d0,_0x48c82c){_0x48c82c=_0x48c82c||0xcc;return function(_0x35ae66){if(_0x35ae66){return _0x56f6d0['sendStatus'](_0x48c82c);}return _0x56f6d0[_0x1a67('0x1a')](_0x48c82c)['end']();};}function respondWithResult(_0x28c5d0,_0x499416){_0x499416=_0x499416||0xc8;return function(_0x1b81d7){if(_0x1b81d7){return _0x28c5d0['status'](_0x499416)[_0x1a67('0x1b')](_0x1b81d7);}};}function respondWithFilteredResult(_0x3fdcf1,_0x592278){return function(_0x53b3cc){if(_0x53b3cc){var _0x534a03=typeof _0x592278[_0x1a67('0x1c')]===_0x1a67('0x1d')&&typeof _0x592278[_0x1a67('0x1e')]===_0x1a67('0x1d');var _0x55d3d9=_0x53b3cc[_0x1a67('0x1f')];var _0x58d74e=_0x534a03?0x0:_0x592278['offset'];var _0x1f6c56=_0x534a03?_0x53b3cc[_0x1a67('0x1f')]:_0x592278[_0x1a67('0x1c')]+_0x592278['limit'];var _0x5db62f;if(_0x1f6c56>=_0x55d3d9){_0x1f6c56=_0x55d3d9;_0x5db62f=0xc8;}else{_0x5db62f=0xce;}_0x3fdcf1[_0x1a67('0x1a')](_0x5db62f);return _0x3fdcf1[_0x1a67('0x20')](_0x1a67('0x21'),_0x58d74e+'-'+_0x1f6c56+'/'+_0x55d3d9)[_0x1a67('0x1b')](_0x53b3cc);}return null;};}function patchUpdates(_0x30ea78){return function(_0x1c1f7b){try{jsonpatch[_0x1a67('0x22')](_0x1c1f7b,_0x30ea78,!![]);}catch(_0x3153a9){return BPromise[_0x1a67('0x23')](_0x3153a9);}return _0x1c1f7b[_0x1a67('0x24')]();};}function saveUpdates(_0x355704,_0x4e2cfe){return function(_0x2ae1d9){if(_0x2ae1d9){return _0x2ae1d9[_0x1a67('0x25')](_0x355704)['then'](function(_0x3cfe34){return _0x3cfe34;});}return null;};}function removeEntity(_0x2ee67b,_0x4d04dd){return function(_0x1addf1){if(_0x1addf1){return _0x1addf1[_0x1a67('0x26')]()[_0x1a67('0x27')](function(){_0x2ee67b[_0x1a67('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501a28,_0x19c8da){return function(_0x39db4d){if(!_0x39db4d){_0x501a28[_0x1a67('0x28')](0x194);}return _0x39db4d;};}function handleError(_0x710e5e,_0x4ae97a){_0x4ae97a=_0x4ae97a||0x1f4;return function(_0x44b19d){logger[_0x1a67('0x29')](_0x44b19d['stack']);if(_0x44b19d[_0x1a67('0x2a')]){delete _0x44b19d[_0x1a67('0x2a')];}_0x710e5e[_0x1a67('0x1a')](_0x4ae97a)[_0x1a67('0x2b')](_0x44b19d);};}exports[_0x1a67('0x2c')]=function(_0x3633fb,_0x5cd798){var _0x6b4816={},_0x5b613e={},_0x4b25b0={'count':0x0,'rows':[]};var _0x333abb=_[_0x1a67('0x2d')](db[_0x1a67('0x2e')][_0x1a67('0x2f')],function(_0x4669e2){return{'name':_0x4669e2['fieldName'],'type':_0x4669e2['type'][_0x1a67('0x30')]};});_0x5b613e[_0x1a67('0x31')]=_['map'](_0x333abb,_0x1a67('0x2a'));_0x5b613e[_0x1a67('0x32')]=_['keys'](_0x3633fb[_0x1a67('0x32')]);_0x5b613e[_0x1a67('0x33')]=_[_0x1a67('0x34')](_0x5b613e[_0x1a67('0x31')],_0x5b613e[_0x1a67('0x32')]);_0x6b4816['attributes']=_[_0x1a67('0x34')](_0x5b613e['model'],qs[_0x1a67('0x35')](_0x3633fb[_0x1a67('0x32')][_0x1a67('0x35')]));_0x6b4816[_0x1a67('0x36')]=_0x6b4816[_0x1a67('0x36')][_0x1a67('0x37')]?_0x6b4816[_0x1a67('0x36')]:_0x5b613e['model'];if(!_0x3633fb[_0x1a67('0x32')][_0x1a67('0x38')]('nolimit')){_0x6b4816[_0x1a67('0x1e')]=qs[_0x1a67('0x1e')](_0x3633fb[_0x1a67('0x32')]['limit']);_0x6b4816['offset']=qs[_0x1a67('0x1c')](_0x3633fb['query'][_0x1a67('0x1c')]);}_0x6b4816['order']=qs[_0x1a67('0x39')](_0x3633fb[_0x1a67('0x32')][_0x1a67('0x39')]);_0x6b4816[_0x1a67('0x3a')]=qs[_0x1a67('0x33')](_['pick'](_0x3633fb[_0x1a67('0x32')],_0x5b613e[_0x1a67('0x33')]),_0x333abb);if(_0x3633fb[_0x1a67('0x32')]['filter']){_0x6b4816['where']=_[_0x1a67('0x3b')](_0x6b4816[_0x1a67('0x3a')],{'$or':_['map'](_0x333abb,function(_0x5c1cef){if(_0x5c1cef[_0x1a67('0x3c')]!==_0x1a67('0x3d')){var _0x238374={};_0x238374[_0x5c1cef['name']]={'$like':'%'+_0x3633fb[_0x1a67('0x32')]['filter']+'%'};return _0x238374;}})});}_0x6b4816=_[_0x1a67('0x3b')]({},_0x6b4816,_0x3633fb[_0x1a67('0x3e')]);var _0x38a1bf={'where':_0x6b4816[_0x1a67('0x3a')]};return db['ZendeskField']['count'](_0x38a1bf)[_0x1a67('0x27')](function(_0x260d01){_0x4b25b0[_0x1a67('0x1f')]=_0x260d01;if(_0x3633fb[_0x1a67('0x32')][_0x1a67('0x3f')]){_0x6b4816[_0x1a67('0x40')]=[{'all':!![]}];}return db['ZendeskField'][_0x1a67('0x41')](_0x6b4816);})['then'](function(_0x52b0e2){_0x4b25b0['rows']=_0x52b0e2;return _0x4b25b0;})[_0x1a67('0x27')](respondWithFilteredResult(_0x5cd798,_0x6b4816))['catch'](handleError(_0x5cd798,null));};exports[_0x1a67('0x42')]=function(_0x26b0f3,_0x5b2825){var _0x5eed3b={'raw':!![],'where':{'id':_0x26b0f3[_0x1a67('0x43')]['id']}},_0x29cc2b={};_0x29cc2b[_0x1a67('0x31')]=_[_0x1a67('0x44')](db[_0x1a67('0x2e')][_0x1a67('0x2f')]);_0x29cc2b['query']=_[_0x1a67('0x44')](_0x26b0f3['query']);_0x29cc2b[_0x1a67('0x33')]=_[_0x1a67('0x34')](_0x29cc2b['model'],_0x29cc2b[_0x1a67('0x32')]);_0x5eed3b['attributes']=_[_0x1a67('0x34')](_0x29cc2b['model'],qs[_0x1a67('0x35')](_0x26b0f3[_0x1a67('0x32')][_0x1a67('0x35')]));_0x5eed3b['attributes']=_0x5eed3b[_0x1a67('0x36')][_0x1a67('0x37')]?_0x5eed3b[_0x1a67('0x36')]:_0x29cc2b[_0x1a67('0x31')];if(_0x26b0f3['query'][_0x1a67('0x3f')]){_0x5eed3b['include']=[{'all':!![]}];}_0x5eed3b=_[_0x1a67('0x3b')]({},_0x5eed3b,_0x26b0f3[_0x1a67('0x3e')]);return db[_0x1a67('0x2e')][_0x1a67('0x45')](_0x5eed3b)[_0x1a67('0x27')](handleEntityNotFound(_0x5b2825,null))[_0x1a67('0x27')](respondWithResult(_0x5b2825,null))[_0x1a67('0x46')](handleError(_0x5b2825,null));};exports['create']=function(_0x46f13e,_0x44c88e){return db[_0x1a67('0x2e')][_0x1a67('0x47')](_0x46f13e[_0x1a67('0x48')],{})['then'](respondWithResult(_0x44c88e,0xc9))[_0x1a67('0x46')](handleError(_0x44c88e,null));};exports['update']=function(_0x4e7539,_0x2f4f3c){if(_0x4e7539[_0x1a67('0x48')]['id']){delete _0x4e7539[_0x1a67('0x48')]['id'];}return db[_0x1a67('0x2e')][_0x1a67('0x45')]({'where':{'id':_0x4e7539[_0x1a67('0x43')]['id']}})[_0x1a67('0x27')](handleEntityNotFound(_0x2f4f3c,null))[_0x1a67('0x27')](saveUpdates(_0x4e7539[_0x1a67('0x48')],null))[_0x1a67('0x27')](respondWithResult(_0x2f4f3c,null))[_0x1a67('0x46')](handleError(_0x2f4f3c,null));};exports['destroy']=function(_0x56b4a8,_0x21d3c2){return db[_0x1a67('0x2e')][_0x1a67('0x45')]({'where':{'id':_0x56b4a8[_0x1a67('0x43')]['id']}})[_0x1a67('0x27')](handleEntityNotFound(_0x21d3c2,null))[_0x1a67('0x27')](removeEntity(_0x21d3c2,null))[_0x1a67('0x46')](handleError(_0x21d3c2,null));}; \ No newline at end of file +var _0xe9ff=['length','create','body','catch','find','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','type','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x526dc2,_0x37ebb8){var _0x54e521=function(_0x186bfb){while(--_0x186bfb){_0x526dc2['push'](_0x526dc2['shift']());}};_0x54e521(++_0x37ebb8);}(_0xe9ff,0x17c));var _0xfe9f=function(_0x166698,_0x3c779c){_0x166698=_0x166698-0x0;var _0x5905f3=_0xe9ff[_0x166698];return _0x5905f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfe9f('0x0'));var rp=require('request-promise');var moment=require(_0xfe9f('0x1'));var BPromise=require(_0xfe9f('0x2'));var Mustache=require(_0xfe9f('0x3'));var util=require(_0xfe9f('0x4'));var path=require(_0xfe9f('0x5'));var sox=require(_0xfe9f('0x6'));var csv=require(_0xfe9f('0x7'));var ejs=require(_0xfe9f('0x8'));var fs=require('fs');var fs_extra=require(_0xfe9f('0x9'));var _=require(_0xfe9f('0xa'));var squel=require(_0xfe9f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe9f('0xc'));var toCsv=require(_0xfe9f('0x7'));var querystring=require(_0xfe9f('0xd'));var Papa=require(_0xfe9f('0xe'));var Redis=require('ioredis');var authService=require(_0xfe9f('0xf'));var qs=require(_0xfe9f('0x10'));var as=require(_0xfe9f('0x11'));var hardwareService=require(_0xfe9f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfe9f('0x13'));var config=require(_0xfe9f('0x14'));var licenseUtil=require(_0xfe9f('0x15'));var db=require(_0xfe9f('0x16'))['db'];function respondWithStatusCode(_0x118d31,_0x3a5b66){_0x3a5b66=_0x3a5b66||0xcc;return function(_0x49c897){if(_0x49c897){return _0x118d31[_0xfe9f('0x17')](_0x3a5b66);}return _0x118d31[_0xfe9f('0x18')](_0x3a5b66)[_0xfe9f('0x19')]();};}function respondWithResult(_0x2fda1a,_0x46777e){_0x46777e=_0x46777e||0xc8;return function(_0x556443){if(_0x556443){return _0x2fda1a[_0xfe9f('0x18')](_0x46777e)[_0xfe9f('0x1a')](_0x556443);}};}function respondWithFilteredResult(_0x515769,_0x501943){return function(_0x1d61a7){if(_0x1d61a7){var _0x14b9d0=typeof _0x501943[_0xfe9f('0x1b')]===_0xfe9f('0x1c')&&typeof _0x501943[_0xfe9f('0x1d')]==='undefined';var _0x349837=_0x1d61a7[_0xfe9f('0x1e')];var _0x92b2dd=_0x14b9d0?0x0:_0x501943[_0xfe9f('0x1b')];var _0x482355=_0x14b9d0?_0x1d61a7[_0xfe9f('0x1e')]:_0x501943[_0xfe9f('0x1b')]+_0x501943[_0xfe9f('0x1d')];var _0x236696;if(_0x482355>=_0x349837){_0x482355=_0x349837;_0x236696=0xc8;}else{_0x236696=0xce;}_0x515769[_0xfe9f('0x18')](_0x236696);return _0x515769[_0xfe9f('0x1f')](_0xfe9f('0x20'),_0x92b2dd+'-'+_0x482355+'/'+_0x349837)[_0xfe9f('0x1a')](_0x1d61a7);}return null;};}function patchUpdates(_0xf26af8){return function(_0x2992b1){try{jsonpatch[_0xfe9f('0x21')](_0x2992b1,_0xf26af8,!![]);}catch(_0x3401b1){return BPromise[_0xfe9f('0x22')](_0x3401b1);}return _0x2992b1[_0xfe9f('0x23')]();};}function saveUpdates(_0x7e84cc,_0x1d4bab){return function(_0x1a9e8b){if(_0x1a9e8b){return _0x1a9e8b[_0xfe9f('0x24')](_0x7e84cc)[_0xfe9f('0x25')](function(_0x44172c){return _0x44172c;});}return null;};}function removeEntity(_0x3d87dc,_0x56db1f){return function(_0x59bb68){if(_0x59bb68){return _0x59bb68[_0xfe9f('0x26')]()[_0xfe9f('0x25')](function(){_0x3d87dc[_0xfe9f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9298,_0x63372f){return function(_0x5dc218){if(!_0x5dc218){_0x3f9298[_0xfe9f('0x17')](0x194);}return _0x5dc218;};}function handleError(_0x3567e4,_0x436210){_0x436210=_0x436210||0x1f4;return function(_0x90772d){logger[_0xfe9f('0x27')](_0x90772d[_0xfe9f('0x28')]);if(_0x90772d[_0xfe9f('0x29')]){delete _0x90772d['name'];}_0x3567e4[_0xfe9f('0x18')](_0x436210)[_0xfe9f('0x2a')](_0x90772d);};}exports[_0xfe9f('0x2b')]=function(_0x3decc9,_0x4dc1ca){var _0x224fe2={},_0x4ed4da={},_0x6e0ca6={'count':0x0,'rows':[]};var _0x4118cf=_['map'](db[_0xfe9f('0x2c')][_0xfe9f('0x2d')],function(_0x19b224){return{'name':_0x19b224['fieldName'],'type':_0x19b224[_0xfe9f('0x2e')]['key']};});_0x4ed4da[_0xfe9f('0x2f')]=_[_0xfe9f('0x30')](_0x4118cf,_0xfe9f('0x29'));_0x4ed4da[_0xfe9f('0x31')]=_['keys'](_0x3decc9[_0xfe9f('0x31')]);_0x4ed4da['filters']=_[_0xfe9f('0x32')](_0x4ed4da[_0xfe9f('0x2f')],_0x4ed4da[_0xfe9f('0x31')]);_0x224fe2[_0xfe9f('0x33')]=_[_0xfe9f('0x32')](_0x4ed4da[_0xfe9f('0x2f')],qs[_0xfe9f('0x34')](_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x34')]));_0x224fe2[_0xfe9f('0x33')]=_0x224fe2[_0xfe9f('0x33')]['length']?_0x224fe2[_0xfe9f('0x33')]:_0x4ed4da[_0xfe9f('0x2f')];if(!_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x35')](_0xfe9f('0x36'))){_0x224fe2['limit']=qs[_0xfe9f('0x1d')](_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x1d')]);_0x224fe2[_0xfe9f('0x1b')]=qs['offset'](_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x1b')]);}_0x224fe2[_0xfe9f('0x37')]=qs[_0xfe9f('0x38')](_0x3decc9['query'][_0xfe9f('0x38')]);_0x224fe2[_0xfe9f('0x39')]=qs['filters'](_['pick'](_0x3decc9[_0xfe9f('0x31')],_0x4ed4da[_0xfe9f('0x3a')]),_0x4118cf);if(_0x3decc9['query'][_0xfe9f('0x3b')]){_0x224fe2['where']=_[_0xfe9f('0x3c')](_0x224fe2['where'],{'$or':_[_0xfe9f('0x30')](_0x4118cf,function(_0x59be94){if(_0x59be94['type']!==_0xfe9f('0x3d')){var _0x41c47f={};_0x41c47f[_0x59be94[_0xfe9f('0x29')]]={'$like':'%'+_0x3decc9['query'][_0xfe9f('0x3b')]+'%'};return _0x41c47f;}})});}_0x224fe2=_['merge']({},_0x224fe2,_0x3decc9[_0xfe9f('0x3e')]);var _0x4a396f={'where':_0x224fe2[_0xfe9f('0x39')]};return db[_0xfe9f('0x2c')][_0xfe9f('0x1e')](_0x4a396f)[_0xfe9f('0x25')](function(_0x3addb5){_0x6e0ca6[_0xfe9f('0x1e')]=_0x3addb5;if(_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x3f')]){_0x224fe2[_0xfe9f('0x40')]=[{'all':!![]}];}return db['ZendeskField'][_0xfe9f('0x41')](_0x224fe2);})[_0xfe9f('0x25')](function(_0x504665){_0x6e0ca6[_0xfe9f('0x42')]=_0x504665;return _0x6e0ca6;})[_0xfe9f('0x25')](respondWithFilteredResult(_0x4dc1ca,_0x224fe2))['catch'](handleError(_0x4dc1ca,null));};exports[_0xfe9f('0x43')]=function(_0x2606d7,_0x500526){var _0x3f5055={'raw':!![],'where':{'id':_0x2606d7[_0xfe9f('0x44')]['id']}},_0x172a71={};_0x172a71['model']=_[_0xfe9f('0x45')](db[_0xfe9f('0x2c')]['rawAttributes']);_0x172a71['query']=_[_0xfe9f('0x45')](_0x2606d7[_0xfe9f('0x31')]);_0x172a71[_0xfe9f('0x3a')]=_[_0xfe9f('0x32')](_0x172a71[_0xfe9f('0x2f')],_0x172a71[_0xfe9f('0x31')]);_0x3f5055[_0xfe9f('0x33')]=_['intersection'](_0x172a71[_0xfe9f('0x2f')],qs[_0xfe9f('0x34')](_0x2606d7[_0xfe9f('0x31')][_0xfe9f('0x34')]));_0x3f5055[_0xfe9f('0x33')]=_0x3f5055[_0xfe9f('0x33')][_0xfe9f('0x46')]?_0x3f5055[_0xfe9f('0x33')]:_0x172a71[_0xfe9f('0x2f')];if(_0x2606d7[_0xfe9f('0x31')]['includeAll']){_0x3f5055['include']=[{'all':!![]}];}_0x3f5055=_[_0xfe9f('0x3c')]({},_0x3f5055,_0x2606d7[_0xfe9f('0x3e')]);return db[_0xfe9f('0x2c')]['find'](_0x3f5055)['then'](handleEntityNotFound(_0x500526,null))[_0xfe9f('0x25')](respondWithResult(_0x500526,null))['catch'](handleError(_0x500526,null));};exports[_0xfe9f('0x47')]=function(_0xa36d3b,_0x117260){return db[_0xfe9f('0x2c')]['create'](_0xa36d3b[_0xfe9f('0x48')],{})[_0xfe9f('0x25')](respondWithResult(_0x117260,0xc9))[_0xfe9f('0x49')](handleError(_0x117260,null));};exports[_0xfe9f('0x24')]=function(_0x53d23a,_0x527271){if(_0x53d23a[_0xfe9f('0x48')]['id']){delete _0x53d23a[_0xfe9f('0x48')]['id'];}return db[_0xfe9f('0x2c')][_0xfe9f('0x4a')]({'where':{'id':_0x53d23a[_0xfe9f('0x44')]['id']}})['then'](handleEntityNotFound(_0x527271,null))[_0xfe9f('0x25')](saveUpdates(_0x53d23a[_0xfe9f('0x48')],null))[_0xfe9f('0x25')](respondWithResult(_0x527271,null))[_0xfe9f('0x49')](handleError(_0x527271,null));};exports[_0xfe9f('0x26')]=function(_0x2b1ef3,_0x1d9385){return db[_0xfe9f('0x2c')][_0xfe9f('0x4a')]({'where':{'id':_0x2b1ef3[_0xfe9f('0x44')]['id']}})[_0xfe9f('0x25')](handleEntityNotFound(_0x1d9385,null))['then'](removeEntity(_0x1d9385,null))[_0xfe9f('0x49')](handleError(_0x1d9385,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 9632ccf..df328c2 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ab9=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','moment','request-promise','path','rimraf'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x3ab9,0x134));var _0x93ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x93ab('0x0'));var BPromise=require('bluebird');var rp=require(_0x93ab('0x1'));var fs=require('fs');var path=require(_0x93ab('0x2'));var rimraf=require(_0x93ab('0x3'));var config=require('../../config/environment');var attributes=require(_0x93ab('0x4'));module[_0x93ab('0x5')]=function(_0x3455e4,_0x19c081){return _0x3455e4[_0x93ab('0x6')](_0x93ab('0x7'),attributes,{'tableName':_0x93ab('0x8'),'paranoid':![],'indexes':[{'name':_0x93ab('0x9'),'fields':[_0x93ab('0xa'),_0x93ab('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ae7=['define','ZendeskField','zendesk_unique_index','idField','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intZendeskField.attributes','exports'];(function(_0x5c6c46,_0x9770b2){var _0x2684cf=function(_0x4fa41c){while(--_0x4fa41c){_0x5c6c46['push'](_0x5c6c46['shift']());}};_0x2684cf(++_0x9770b2);}(_0x7ae7,0x93));var _0x77ae=function(_0x381df6,_0x190833){_0x381df6=_0x381df6-0x0;var _0x26be31=_0x7ae7[_0x381df6];return _0x26be31;};'use strict';var _=require(_0x77ae('0x0'));var util=require('util');var logger=require(_0x77ae('0x1'))(_0x77ae('0x2'));var moment=require(_0x77ae('0x3'));var BPromise=require('bluebird');var rp=require(_0x77ae('0x4'));var fs=require('fs');var path=require(_0x77ae('0x5'));var rimraf=require(_0x77ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x77ae('0x7'));module[_0x77ae('0x8')]=function(_0x3a9099,_0x373a63){return _0x3a9099[_0x77ae('0x9')](_0x77ae('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x77ae('0xb'),'fields':[_0x77ae('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index da0c9db..42e4b59 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4601=['request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1510e5,_0x3ff2da){var _0x5db94a=function(_0x3a9024){while(--_0x3a9024){_0x1510e5['push'](_0x1510e5['shift']());}};_0x5db94a(++_0x3ff2da);}(_0x4601,0x70));var _0x1460=function(_0x247625,_0x3d964e){_0x247625=_0x247625-0x0;var _0x4a0805=_0x4601[_0x247625];return _0x4a0805;};'use strict';var _=require(_0x1460('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1460('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1460('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1460('0x3'))(_0x1460('0x4'));var config=require(_0x1460('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1460('0x6')][_0x1460('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x501314,_0x14eaf2,_0x12c79c){return new BPromise(function(_0x4d7142,_0x1232c4){return client[_0x1460('0x8')](_0x501314,_0x12c79c)['then'](function(_0x11d337){logger[_0x1460('0x9')](_0x1460('0xa'),_0x14eaf2,_0x1460('0xb'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x14eaf2,_0x1460('0xb'),JSON[_0x1460('0xc')](_0x11d337));if(_0x11d337[_0x1460('0xd')]){if(_0x11d337['error']['code']===0x1f4){logger[_0x1460('0xd')]('ZendeskField,\x20%s,\x20%s',_0x14eaf2,_0x11d337[_0x1460('0xd')]['message']);return _0x1232c4(_0x11d337[_0x1460('0xd')][_0x1460('0xe')]);}logger[_0x1460('0xd')](_0x1460('0xa'),_0x14eaf2,_0x11d337[_0x1460('0xd')][_0x1460('0xe')]);return _0x4d7142(_0x11d337['error'][_0x1460('0xe')]);}else{logger[_0x1460('0x9')](_0x1460('0xa'),_0x14eaf2,_0x1460('0xb'));_0x4d7142(_0x11d337['result']['message']);}})['catch'](function(_0x226f93){logger[_0x1460('0xd')](_0x1460('0xa'),_0x14eaf2,_0x226f93);_0x1232c4(_0x226f93);});});} \ No newline at end of file +var _0x40a3=['info','ZendeskField,\x20%s,\x20%s','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x4383f6,_0x28ac9a){var _0x21747b=function(_0x3d365a){while(--_0x3d365a){_0x4383f6['push'](_0x4383f6['shift']());}};_0x21747b(++_0x28ac9a);}(_0x40a3,0x16f));var _0x340a=function(_0x31a9a6,_0x5db0ca){_0x31a9a6=_0x31a9a6-0x0;var _0x57ab92=_0x40a3[_0x31a9a6];return _0x57ab92;};'use strict';var _=require(_0x340a('0x0'));var util=require(_0x340a('0x1'));var moment=require(_0x340a('0x2'));var BPromise=require(_0x340a('0x3'));var rs=require(_0x340a('0x4'));var fs=require('fs');var Redis=require(_0x340a('0x5'));var db=require(_0x340a('0x6'))['db'];var utils=require(_0x340a('0x7'));var logger=require('../../config/logger')(_0x340a('0x8'));var config=require('../../config/environment');var jayson=require(_0x340a('0x9'));var client=jayson[_0x340a('0xa')][_0x340a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36769d,_0x4358c8,_0x43afb9){return new BPromise(function(_0x49bc59,_0x2b097f){return client[_0x340a('0xc')](_0x36769d,_0x43afb9)['then'](function(_0x4e7867){logger[_0x340a('0xd')](_0x340a('0xe'),_0x4358c8,'request\x20sent');logger[_0x340a('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4358c8,'request\x20sent',JSON['stringify'](_0x4e7867));if(_0x4e7867['error']){if(_0x4e7867[_0x340a('0x10')][_0x340a('0x11')]===0x1f4){logger[_0x340a('0x10')](_0x340a('0xe'),_0x4358c8,_0x4e7867[_0x340a('0x10')]['message']);return _0x2b097f(_0x4e7867[_0x340a('0x10')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x4358c8,_0x4e7867[_0x340a('0x10')][_0x340a('0x12')]);return _0x49bc59(_0x4e7867[_0x340a('0x10')][_0x340a('0x12')]);}else{logger['info'](_0x340a('0xe'),_0x4358c8,'request\x20sent');_0x49bc59(_0x4e7867[_0x340a('0x13')][_0x340a('0x12')]);}})['catch'](function(_0x14a873){logger['error'](_0x340a('0xe'),_0x4358c8,_0x14a873);_0x2b097f(_0x14a873);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1ace733..ab81dc0 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffe9=['addConfiguration','put','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations'];(function(_0x59cb31,_0x2a63a2){var _0x4dd4ac=function(_0x479e0e){while(--_0x479e0e){_0x59cb31['push'](_0x59cb31['shift']());}};_0x4dd4ac(++_0x2a63a2);}(_0xffe9,0x1d0));var _0x9ffe=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0xffe9[_0x200827];return _0x120047;};'use strict';var multer=require(_0x9ffe('0x0'));var util=require('util');var path=require(_0x9ffe('0x1'));var timeout=require('connect-timeout');var express=require(_0x9ffe('0x2'));var router=express['Router']();var fs_extra=require(_0x9ffe('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9ffe('0x4'));var config=require('../../config/environment');var controller=require(_0x9ffe('0x5'));router[_0x9ffe('0x6')]('/',auth[_0x9ffe('0x7')](),controller[_0x9ffe('0x8')]);router[_0x9ffe('0x6')](_0x9ffe('0x9'),auth[_0x9ffe('0x7')](),controller[_0x9ffe('0xa')]);router[_0x9ffe('0x6')]('/:id/configurations',auth[_0x9ffe('0x7')](),controller[_0x9ffe('0xb')]);router[_0x9ffe('0x6')]('/:id/fields',auth[_0x9ffe('0x7')](),controller[_0x9ffe('0xc')]);router[_0x9ffe('0xd')]('/',auth[_0x9ffe('0x7')](),controller[_0x9ffe('0xe')]);router['post'](_0x9ffe('0xf'),auth[_0x9ffe('0x7')](),controller[_0x9ffe('0x10')]);router[_0x9ffe('0x11')](_0x9ffe('0x9'),auth[_0x9ffe('0x7')](),controller['update']);router[_0x9ffe('0x12')](_0x9ffe('0x9'),auth[_0x9ffe('0x7')](),controller['destroy']);module[_0x9ffe('0x13')]=router; \ No newline at end of file +var _0x18f3=['/:id/configurations','getConfigurations','getFields','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x387ab7,_0x35cedb){var _0x37bc6f=function(_0x39f529){while(--_0x39f529){_0x387ab7['push'](_0x387ab7['shift']());}};_0x37bc6f(++_0x35cedb);}(_0x18f3,0x161));var _0x318f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x18f3[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x318f('0x0'));var util=require(_0x318f('0x1'));var path=require(_0x318f('0x2'));var timeout=require(_0x318f('0x3'));var express=require(_0x318f('0x4'));var router=express['Router']();var fs_extra=require(_0x318f('0x5'));var auth=require(_0x318f('0x6'));var interaction=require(_0x318f('0x7'));var config=require(_0x318f('0x8'));var controller=require(_0x318f('0x9'));router[_0x318f('0xa')]('/',auth[_0x318f('0xb')](),controller[_0x318f('0xc')]);router[_0x318f('0xa')](_0x318f('0xd'),auth['isAuthenticated'](),controller[_0x318f('0xe')]);router['get'](_0x318f('0xf'),auth[_0x318f('0xb')](),controller[_0x318f('0x10')]);router[_0x318f('0xa')]('/:id/fields',auth[_0x318f('0xb')](),controller[_0x318f('0x11')]);router[_0x318f('0x12')]('/',auth[_0x318f('0xb')](),controller[_0x318f('0x13')]);router[_0x318f('0x12')]('/:id/configurations',auth[_0x318f('0xb')](),controller['addConfiguration']);router[_0x318f('0x14')]('/:id',auth[_0x318f('0xb')](),controller[_0x318f('0x15')]);router['delete']('/:id',auth[_0x318f('0xb')](),controller[_0x318f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e5eaad0..ed4bbba 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['exports','STRING'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x750a,0x140));var _0xa750=function(_0x2093ec,_0x75df91){_0x2093ec=_0x2093ec-0x0;var _0x3fc04f=_0x750a[_0x2093ec];return _0x3fc04f;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa750('0x1')]},'zone':{'type':Sequelize[_0xa750('0x1')]},'clientId':{'type':Sequelize[_0xa750('0x1')]},'clientSecret':{'type':Sequelize[_0xa750('0x1')]},'serverUrl':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa750('0x1')]},'refreshToken':{'type':Sequelize[_0xa750('0x1')]}}; \ No newline at end of file +var _0x6c76=['STRING','sequelize','exports'];(function(_0x128e76,_0x8a9c92){var _0x42ef27=function(_0x39d4ee){while(--_0x39d4ee){_0x128e76['push'](_0x128e76['shift']());}};_0x42ef27(++_0x8a9c92);}(_0x6c76,0x184));var _0x66c7=function(_0x2a4e3c,_0x3fc3fe){_0x2a4e3c=_0x2a4e3c-0x0;var _0x37c234=_0x6c76[_0x2a4e3c];return _0x37c234;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'name':{'type':Sequelize[_0x66c7('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x66c7('0x2')]},'zone':{'type':Sequelize[_0x66c7('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x66c7('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x66c7('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 22e7d3e..f55e197 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x849a=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','rawAttributes','includeAll','find','catch','create','body','update','params','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','serverUrl','host','zoho.eu','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','api_name','system_mandatory','push','picklist','pick_list_values','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','ZohoAccount','fieldName','key','model'];(function(_0x113f41,_0x160d27){var _0x3ab6f9=function(_0x91cc89){while(--_0x91cc89){_0x113f41['push'](_0x113f41['shift']());}};_0x3ab6f9(++_0x160d27);}(_0x849a,0x1ba));var _0xa849=function(_0x276ad3,_0xe6addd){_0x276ad3=_0x276ad3-0x0;var _0x1555b0=_0x849a[_0x276ad3];return _0x1555b0;};'use strict';var emlformat=require(_0xa849('0x0'));var rimraf=require(_0xa849('0x1'));var zipdir=require(_0xa849('0x2'));var jsonpatch=require(_0xa849('0x3'));var rp=require(_0xa849('0x4'));var moment=require('moment');var BPromise=require(_0xa849('0x5'));var Mustache=require(_0xa849('0x6'));var util=require(_0xa849('0x7'));var path=require(_0xa849('0x8'));var sox=require(_0xa849('0x9'));var csv=require(_0xa849('0xa'));var ejs=require(_0xa849('0xb'));var fs=require('fs');var fs_extra=require(_0xa849('0xc'));var _=require('lodash');var squel=require(_0xa849('0xd'));var crypto=require('crypto');var jsforce=require(_0xa849('0xe'));var deskjs=require(_0xa849('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa849('0x10'));var Papa=require(_0xa849('0x11'));var Redis=require(_0xa849('0x12'));var authService=require(_0xa849('0x13'));var qs=require(_0xa849('0x14'));var as=require(_0xa849('0x15'));var hardwareService=require(_0xa849('0x16'));var logger=require(_0xa849('0x17'))(_0xa849('0x18'));var utils=require(_0xa849('0x19'));var config=require(_0xa849('0x1a'));var licenseUtil=require(_0xa849('0x1b'));var db=require(_0xa849('0x1c'))['db'];var integrations=require(_0xa849('0x1d'));function respondWithStatusCode(_0x42b68b,_0x4597e5){_0x4597e5=_0x4597e5||0xcc;return function(_0x1c3f9c){if(_0x1c3f9c){return _0x42b68b[_0xa849('0x1e')](_0x4597e5);}return _0x42b68b[_0xa849('0x1f')](_0x4597e5)[_0xa849('0x20')]();};}function respondWithResult(_0x10e8ab,_0xc6a8fd){_0xc6a8fd=_0xc6a8fd||0xc8;return function(_0x4c472d){if(_0x4c472d){return _0x10e8ab[_0xa849('0x1f')](_0xc6a8fd)[_0xa849('0x21')](_0x4c472d);}};}function respondWithFilteredResult(_0x2231bf,_0x55707c){return function(_0x38c319){if(_0x38c319){var _0xe6348f=typeof _0x55707c[_0xa849('0x22')]===_0xa849('0x23')&&typeof _0x55707c[_0xa849('0x24')]===_0xa849('0x23');var _0x215c21=_0x38c319[_0xa849('0x25')];var _0x4aa02d=_0xe6348f?0x0:_0x55707c[_0xa849('0x22')];var _0x34c26d=_0xe6348f?_0x38c319[_0xa849('0x25')]:_0x55707c[_0xa849('0x22')]+_0x55707c[_0xa849('0x24')];var _0xb839f3;if(_0x34c26d>=_0x215c21){_0x34c26d=_0x215c21;_0xb839f3=0xc8;}else{_0xb839f3=0xce;}_0x2231bf['status'](_0xb839f3);return _0x2231bf[_0xa849('0x26')](_0xa849('0x27'),_0x4aa02d+'-'+_0x34c26d+'/'+_0x215c21)[_0xa849('0x21')](_0x38c319);}return null;};}function patchUpdates(_0x255afb){return function(_0x48bd5e){try{jsonpatch[_0xa849('0x28')](_0x48bd5e,_0x255afb,!![]);}catch(_0x547997){return BPromise[_0xa849('0x29')](_0x547997);}return _0x48bd5e['save']();};}function saveUpdates(_0xe41c13,_0x2bec){return function(_0x117c6a){if(_0x117c6a){return _0x117c6a['update'](_0xe41c13)[_0xa849('0x2a')](function(_0x556c93){return _0x556c93;});}return null;};}function removeEntity(_0x4f1a0c,_0x1df158){return function(_0x4e08be){if(_0x4e08be){return _0x4e08be[_0xa849('0x2b')]()['then'](function(){_0x4f1a0c[_0xa849('0x1f')](0xcc)[_0xa849('0x20')]();});}};}function handleEntityNotFound(_0x21231b,_0x3bd2c5){return function(_0x54deae){if(!_0x54deae){_0x21231b[_0xa849('0x1e')](0x194);}return _0x54deae;};}function handleError(_0x2aecf1,_0x4fcb93){_0x4fcb93=_0x4fcb93||0x1f4;return function(_0x241cb4){logger[_0xa849('0x2c')](_0x241cb4[_0xa849('0x2d')]);if(_0x241cb4[_0xa849('0x2e')]){delete _0x241cb4[_0xa849('0x2e')];}_0x2aecf1[_0xa849('0x1f')](_0x4fcb93)[_0xa849('0x2f')](_0x241cb4);};}exports[_0xa849('0x30')]=function(_0x71a6a1,_0xa8aa4f){var _0x1708e3={},_0x5eedd4={},_0x48ec9d={'count':0x0,'rows':[]};var _0x58b8e3=_[_0xa849('0x31')](db[_0xa849('0x32')]['rawAttributes'],function(_0x151c18){return{'name':_0x151c18[_0xa849('0x33')],'type':_0x151c18['type'][_0xa849('0x34')]};});_0x5eedd4[_0xa849('0x35')]=_[_0xa849('0x31')](_0x58b8e3,_0xa849('0x2e'));_0x5eedd4[_0xa849('0x36')]=_[_0xa849('0x37')](_0x71a6a1[_0xa849('0x36')]);_0x5eedd4[_0xa849('0x38')]=_[_0xa849('0x39')](_0x5eedd4[_0xa849('0x35')],_0x5eedd4['query']);_0x1708e3[_0xa849('0x3a')]=_[_0xa849('0x39')](_0x5eedd4[_0xa849('0x35')],qs[_0xa849('0x3b')](_0x71a6a1['query'][_0xa849('0x3b')]));_0x1708e3[_0xa849('0x3a')]=_0x1708e3[_0xa849('0x3a')][_0xa849('0x3c')]?_0x1708e3[_0xa849('0x3a')]:_0x5eedd4['model'];if(!_0x71a6a1[_0xa849('0x36')][_0xa849('0x3d')](_0xa849('0x3e'))){_0x1708e3[_0xa849('0x24')]=qs['limit'](_0x71a6a1[_0xa849('0x36')]['limit']);_0x1708e3[_0xa849('0x22')]=qs[_0xa849('0x22')](_0x71a6a1[_0xa849('0x36')][_0xa849('0x22')]);}_0x1708e3[_0xa849('0x3f')]=qs[_0xa849('0x40')](_0x71a6a1[_0xa849('0x36')][_0xa849('0x40')]);_0x1708e3[_0xa849('0x41')]=qs[_0xa849('0x38')](_[_0xa849('0x42')](_0x71a6a1[_0xa849('0x36')],_0x5eedd4[_0xa849('0x38')]),_0x58b8e3);if(_0x71a6a1[_0xa849('0x36')]['filter']){_0x1708e3[_0xa849('0x41')]=_[_0xa849('0x43')](_0x1708e3[_0xa849('0x41')],{'$or':_[_0xa849('0x31')](_0x58b8e3,function(_0x4c0da2){if(_0x4c0da2[_0xa849('0x44')]!==_0xa849('0x45')){var _0x7fd710={};_0x7fd710[_0x4c0da2[_0xa849('0x2e')]]={'$like':'%'+_0x71a6a1[_0xa849('0x36')][_0xa849('0x46')]+'%'};return _0x7fd710;}})});}_0x1708e3=_[_0xa849('0x43')]({},_0x1708e3,_0x71a6a1[_0xa849('0x47')]);var _0x19bbd4={'where':_0x1708e3['where']};return db[_0xa849('0x32')][_0xa849('0x25')](_0x19bbd4)[_0xa849('0x2a')](function(_0x52b9b3){_0x48ec9d[_0xa849('0x25')]=_0x52b9b3;if(_0x71a6a1['query']['includeAll']){_0x1708e3[_0xa849('0x48')]=[{'all':!![]}];}return db[_0xa849('0x32')][_0xa849('0x49')](_0x1708e3);})[_0xa849('0x2a')](function(_0x1f609f){_0x48ec9d[_0xa849('0x4a')]=_0x1f609f;return _0x48ec9d;})[_0xa849('0x2a')](respondWithFilteredResult(_0xa8aa4f,_0x1708e3))['catch'](handleError(_0xa8aa4f,null));};exports[_0xa849('0x4b')]=function(_0x1be6c3,_0x1f9e6c){var _0x741698={'raw':![],'where':{'id':_0x1be6c3['params']['id']}},_0xe107af={};_0xe107af[_0xa849('0x35')]=_[_0xa849('0x37')](db[_0xa849('0x32')][_0xa849('0x4c')]);_0xe107af['query']=_[_0xa849('0x37')](_0x1be6c3['query']);_0xe107af[_0xa849('0x38')]=_[_0xa849('0x39')](_0xe107af[_0xa849('0x35')],_0xe107af[_0xa849('0x36')]);_0x741698['attributes']=_[_0xa849('0x39')](_0xe107af[_0xa849('0x35')],qs[_0xa849('0x3b')](_0x1be6c3[_0xa849('0x36')][_0xa849('0x3b')]));_0x741698['attributes']=_0x741698[_0xa849('0x3a')][_0xa849('0x3c')]?_0x741698['attributes']:_0xe107af[_0xa849('0x35')];if(_0x1be6c3['query'][_0xa849('0x4d')]){_0x741698[_0xa849('0x48')]=[{'all':!![]}];}_0x741698=_['merge']({},_0x741698,_0x1be6c3[_0xa849('0x47')]);return db[_0xa849('0x32')][_0xa849('0x4e')](_0x741698)['then'](handleEntityNotFound(_0x1f9e6c,null))[_0xa849('0x2a')](respondWithResult(_0x1f9e6c,null))[_0xa849('0x4f')](handleError(_0x1f9e6c,null));};exports[_0xa849('0x50')]=function(_0xfa50d2,_0x2ca0cb){return db['ZohoAccount'][_0xa849('0x50')](_0xfa50d2[_0xa849('0x51')],{})[_0xa849('0x2a')](respondWithResult(_0x2ca0cb,0xc9))['catch'](handleError(_0x2ca0cb,null));};exports[_0xa849('0x52')]=function(_0x3a196f,_0x4ae7e2){if(_0x3a196f['body']['id']){delete _0x3a196f[_0xa849('0x51')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x3a196f[_0xa849('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ae7e2,null))[_0xa849('0x2a')](saveUpdates(_0x3a196f[_0xa849('0x51')],null))[_0xa849('0x2a')](respondWithResult(_0x4ae7e2,null))[_0xa849('0x4f')](handleError(_0x4ae7e2,null));};exports[_0xa849('0x2b')]=function(_0x2314b0,_0x15e3d0){return db[_0xa849('0x32')][_0xa849('0x4e')]({'where':{'id':_0x2314b0['params']['id']}})['then'](handleEntityNotFound(_0x15e3d0,null))[_0xa849('0x2a')](removeEntity(_0x15e3d0,null))[_0xa849('0x4f')](handleError(_0x15e3d0,null));};exports[_0xa849('0x54')]=function(_0xcad211,_0x2ce32a,_0x5a0dbc){var _0x40959f={};var _0x58c33d={};var _0x2fb86f;var _0xdded84;return db[_0xa849('0x32')][_0xa849('0x55')]({'where':{'id':_0xcad211[_0xa849('0x53')]['id']}})[_0xa849('0x2a')](handleEntityNotFound(_0x2ce32a,null))[_0xa849('0x2a')](function(_0x54e685){if(_0x54e685){_0x2fb86f=_0x54e685;_0x58c33d['model']=_['keys'](db[_0xa849('0x56')][_0xa849('0x4c')]);_0x58c33d[_0xa849('0x36')]=_[_0xa849('0x37')](_0xcad211[_0xa849('0x36')]);_0x58c33d[_0xa849('0x38')]=_[_0xa849('0x39')](_0x58c33d[_0xa849('0x35')],_0x58c33d['query']);_0x40959f[_0xa849('0x3a')]=_[_0xa849('0x39')](_0x58c33d[_0xa849('0x35')],qs[_0xa849('0x3b')](_0xcad211['query'][_0xa849('0x3b')]));_0x40959f[_0xa849('0x3a')]=_0x40959f[_0xa849('0x3a')][_0xa849('0x3c')]?_0x40959f[_0xa849('0x3a')]:_0x58c33d['model'];_0x40959f[_0xa849('0x3f')]=qs['sort'](_0xcad211[_0xa849('0x36')][_0xa849('0x40')]);_0x40959f[_0xa849('0x41')]=qs[_0xa849('0x38')](_[_0xa849('0x42')](_0xcad211[_0xa849('0x36')],_0x58c33d[_0xa849('0x38')]));if(_0xcad211[_0xa849('0x36')][_0xa849('0x46')]){_0x40959f[_0xa849('0x41')]=_['merge'](_0x40959f[_0xa849('0x41')],{'$or':_['map'](_0x40959f[_0xa849('0x3a')],function(_0x114136){var _0x1f716f={};_0x1f716f[_0x114136]={'$like':'%'+_0xcad211[_0xa849('0x36')][_0xa849('0x46')]+'%'};return _0x1f716f;})});}_0x40959f=_['merge']({},_0x40959f,_0xcad211['options']);return _0x2fb86f[_0xa849('0x54')](_0x40959f);}})[_0xa849('0x2a')](function(_0x18eff6){if(_0x18eff6){_0xdded84=_0x18eff6[_0xa849('0x3c')];if(!_0xcad211[_0xa849('0x36')][_0xa849('0x3d')](_0xa849('0x3e'))){_0x40959f[_0xa849('0x24')]=qs['limit'](_0xcad211[_0xa849('0x36')]['limit']);_0x40959f[_0xa849('0x22')]=qs[_0xa849('0x22')](_0xcad211[_0xa849('0x36')][_0xa849('0x22')]);}return _0x2fb86f[_0xa849('0x54')](_0x40959f);}})['then'](function(_0x156f35){if(_0x156f35){return _0x156f35?{'count':_0xdded84,'rows':_0x156f35}:null;}})[_0xa849('0x2a')](respondWithResult(_0x2ce32a,null))[_0xa849('0x4f')](handleError(_0x2ce32a,null));};exports[_0xa849('0x57')]=function(_0x2db752,_0x130c71,_0x3c2e85){if(_0x2db752[_0xa849('0x51')]['id']){delete _0x2db752[_0xa849('0x51')]['id'];}return db[_0xa849('0x32')][_0xa849('0x55')]({'where':{'id':_0x2db752[_0xa849('0x53')]['id']}})[_0xa849('0x2a')](handleEntityNotFound(_0x130c71,null))['then'](function(_0x4986da){if(_0x4986da){_0x2db752['body']['AccountId']=_0x4986da['id'];_0x2db752[_0xa849('0x51')][_0xa849('0x58')]=integrations[_0xa849('0x59')](_0x2db752['body'][_0xa849('0x5a')],_0x2db752['body'][_0xa849('0x44')]);_0x2db752[_0xa849('0x51')]['Descriptions']=integrations[_0xa849('0x5b')](_0x2db752[_0xa849('0x51')][_0xa849('0x5a')],_0x2db752[_0xa849('0x51')][_0xa849('0x44')]);return db[_0xa849('0x56')]['create'](_0x2db752[_0xa849('0x51')],{'include':[{'model':db['ZohoField'],'as':_0xa849('0x58')},{'model':db[_0xa849('0x5c')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x130c71,null))[_0xa849('0x4f')](handleError(_0x130c71,null));};function getAccessToken(_0x145b43){return new Promise(function(_0x21d593,_0x43b710){var _0x32fc88;switch(_0x145b43[_0xa849('0x5d')]){case'US':_0x32fc88='https://accounts.zoho.com';break;case'AU':_0x32fc88=_0xa849('0x5e');break;case'EU':_0x32fc88=_0xa849('0x5f');break;case'IN':_0x32fc88=_0xa849('0x60');break;case'CN':_0x32fc88=_0xa849('0x61');break;default:_0x32fc88='https://accounts.zoho.eu';break;}var _0x1ee13d={'method':_0xa849('0x62'),'uri':_0x32fc88+'/oauth/v2/token','qs':{'refresh_token':_0x145b43[_0xa849('0x63')],'client_id':_0x145b43[_0xa849('0x64')],'client_secret':_0x145b43[_0xa849('0x65')],'grant_type':_0xa849('0x66')},'json':!![]};return rp(_0x1ee13d)[_0xa849('0x2a')](function(_0x305999){if(_0x305999[_0xa849('0x67')]){_0x21d593(_0x305999[_0xa849('0x67')]);}else{_0x43b710('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x36883e){_0x43b710(_0x36883e);});});}exports[_0xa849('0x68')]=function(_0x1e76c3,_0x170962,_0x5556ad){var _0x818629,_0x3e71c2,_0x505f2f,_0x328310,_0x2ee777;return db['ZohoAccount'][_0xa849('0x55')]({'where':{'id':_0x1e76c3[_0xa849('0x53')]['id']},'attributes':['id','host','zone',_0xa849('0x64'),'clientSecret',_0xa849('0x69'),'code',_0xa849('0x63')]})[_0xa849('0x2a')](handleEntityNotFound(_0x170962,null))[_0xa849('0x2a')](function(_0x301dc3){_0x2ee777=_0x301dc3;_0x818629=_0x2ee777[_0xa849('0x6a')];_0x3e71c2=_0x818629===_0xa849('0x6b')?'eu':'com';_0x505f2f=_0x2ee777[_0xa849('0x69')];var _0x560a16=_0x505f2f['slice'](-0x1);if(_0x560a16==='/'||_0x560a16==='\x5c'||_0x560a16===':'){_0x505f2f=_0x505f2f['substring'](0x0,_0x505f2f[_0xa849('0x6c')](_0x560a16));}if(!_0x2ee777[_0xa849('0x63')]){throw new Error(_0xa849('0x6d'));}return getAccessToken(_0x2ee777);})[_0xa849('0x2a')](function(_0x1a21af){if(_0x1a21af){return rp({'method':_0xa849('0x6e'),'uri':util[_0xa849('0x6f')](_0xa849('0x70'),_0x3e71c2),'qs':{'module':'Calls'},'headers':{'Authorization':_0xa849('0x71')+_0x1a21af},'json':!![]});}})[_0xa849('0x2a')](function(_0xe18cb6){if(_0xe18cb6){if(_0xe18cb6['response']&&_0xe18cb6[_0xa849('0x72')][_0xa849('0x2c')]){throw new Error(_0xe18cb6[_0xa849('0x72')][_0xa849('0x2c')]['message']);}var _0x3fc68c=[];var _0x52bee8=[];var _0x549ccf=[_0xa849('0x73'),'Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type'];_0x52bee8=_['remove'](_0xe18cb6['fields'],function(_0x431591){return _0x549ccf['includes'](_0x431591[_0xa849('0x74')]);});for(var _0x4cefbf=0x0;_0x4cefbf<_0x52bee8[_0xa849('0x3c')];_0x4cefbf++){if(_0x52bee8[_0x4cefbf][_0xa849('0x75')]===![]){_0x3fc68c[_0xa849('0x76')]({'id':_0x52bee8[_0x4cefbf]['id'],'name':_0x52bee8[_0x4cefbf]['display_label'],'custom':_0x52bee8[_0x4cefbf]['custom_field'],'options':_0x52bee8[_0x4cefbf]['data_type']===_0xa849('0x77')&&_0x52bee8[_0x4cefbf]['pick_list_values'][_0xa849('0x3c')]>-0x1?_['map'](_0x52bee8[_0x4cefbf][_0xa849('0x78')],function(_0x57991c){return{'name':_0x57991c,'value':_0x57991c};}):[]});}}return{'count':_0x3fc68c[_0xa849('0x3c')],'rows':_0x3fc68c};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x170962,null))[_0xa849('0x4f')](function(_0x46cdef){var _0x33d31b=_0x1e76c3[_0xa849('0x36')][_0xa849('0x79')]?0x1f4:_0x46cdef[_0xa849('0x7a')]||0x1f4;logger[_0xa849('0x2c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x33d31b,JSON['stringify'](_0x46cdef));delete _0x46cdef[_0xa849('0x2e')];if(_0x33d31b===0x191){_0x33d31b=0x190;}_0x170962[_0xa849('0x1f')](_0x33d31b)[_0xa849('0x2f')](_0x1e76c3['query']['test']?{'message':_0xa849('0x7b'),'statusCode':_0x46cdef[_0xa849('0x7a')]}:_0x46cdef);});}; \ No newline at end of file +var _0x6dc4=['order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','params','body','catch','update','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','create','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','save','then','destroy','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x77850a,_0x2fc4a6){var _0x24bdef=function(_0x17d6a5){while(--_0x17d6a5){_0x77850a['push'](_0x77850a['shift']());}};_0x24bdef(++_0x2fc4a6);}(_0x6dc4,0xc5));var _0x46dc=function(_0x33127f,_0x1eafed){_0x33127f=_0x33127f-0x0;var _0x3c469f=_0x6dc4[_0x33127f];return _0x3c469f;};'use strict';var emlformat=require(_0x46dc('0x0'));var rimraf=require(_0x46dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46dc('0x2'));var rp=require(_0x46dc('0x3'));var moment=require(_0x46dc('0x4'));var BPromise=require(_0x46dc('0x5'));var Mustache=require(_0x46dc('0x6'));var util=require('util');var path=require(_0x46dc('0x7'));var sox=require(_0x46dc('0x8'));var csv=require(_0x46dc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46dc('0xa'));var _=require('lodash');var squel=require(_0x46dc('0xb'));var crypto=require(_0x46dc('0xc'));var jsforce=require(_0x46dc('0xd'));var deskjs=require(_0x46dc('0xe'));var toCsv=require(_0x46dc('0x9'));var querystring=require(_0x46dc('0xf'));var Papa=require(_0x46dc('0x10'));var Redis=require('ioredis');var authService=require(_0x46dc('0x11'));var qs=require(_0x46dc('0x12'));var as=require(_0x46dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x46dc('0x14'));var utils=require(_0x46dc('0x15'));var config=require(_0x46dc('0x16'));var licenseUtil=require(_0x46dc('0x17'));var db=require(_0x46dc('0x18'))['db'];var integrations=require(_0x46dc('0x19'));function respondWithStatusCode(_0x4837d4,_0x29b1c9){_0x29b1c9=_0x29b1c9||0xcc;return function(_0x1379fb){if(_0x1379fb){return _0x4837d4[_0x46dc('0x1a')](_0x29b1c9);}return _0x4837d4[_0x46dc('0x1b')](_0x29b1c9)['end']();};}function respondWithResult(_0x23c8db,_0x365f40){_0x365f40=_0x365f40||0xc8;return function(_0x2b41fa){if(_0x2b41fa){return _0x23c8db['status'](_0x365f40)[_0x46dc('0x1c')](_0x2b41fa);}};}function respondWithFilteredResult(_0x5bbb2c,_0x4cb4f8){return function(_0x231411){if(_0x231411){var _0x2dba35=typeof _0x4cb4f8[_0x46dc('0x1d')]===_0x46dc('0x1e')&&typeof _0x4cb4f8[_0x46dc('0x1f')]===_0x46dc('0x1e');var _0xac7d28=_0x231411[_0x46dc('0x20')];var _0x5e0219=_0x2dba35?0x0:_0x4cb4f8[_0x46dc('0x1d')];var _0x267364=_0x2dba35?_0x231411['count']:_0x4cb4f8[_0x46dc('0x1d')]+_0x4cb4f8['limit'];var _0x4c0457;if(_0x267364>=_0xac7d28){_0x267364=_0xac7d28;_0x4c0457=0xc8;}else{_0x4c0457=0xce;}_0x5bbb2c[_0x46dc('0x1b')](_0x4c0457);return _0x5bbb2c['set']('Content-Range',_0x5e0219+'-'+_0x267364+'/'+_0xac7d28)['json'](_0x231411);}return null;};}function patchUpdates(_0x2b0f0b){return function(_0x353134){try{jsonpatch[_0x46dc('0x21')](_0x353134,_0x2b0f0b,!![]);}catch(_0x289d22){return BPromise['reject'](_0x289d22);}return _0x353134[_0x46dc('0x22')]();};}function saveUpdates(_0xf0683a,_0x4f9c34){return function(_0x1e9423){if(_0x1e9423){return _0x1e9423['update'](_0xf0683a)[_0x46dc('0x23')](function(_0x314cdf){return _0x314cdf;});}return null;};}function removeEntity(_0x5b28ef,_0x2964a4){return function(_0x59868c){if(_0x59868c){return _0x59868c[_0x46dc('0x24')]()[_0x46dc('0x23')](function(){_0x5b28ef[_0x46dc('0x1b')](0xcc)[_0x46dc('0x25')]();});}};}function handleEntityNotFound(_0x244597,_0x43e6ab){return function(_0x447653){if(!_0x447653){_0x244597[_0x46dc('0x1a')](0x194);}return _0x447653;};}function handleError(_0x1f0e85,_0x2acb2b){_0x2acb2b=_0x2acb2b||0x1f4;return function(_0x305a1b){logger[_0x46dc('0x26')](_0x305a1b[_0x46dc('0x27')]);if(_0x305a1b['name']){delete _0x305a1b[_0x46dc('0x28')];}_0x1f0e85[_0x46dc('0x1b')](_0x2acb2b)[_0x46dc('0x29')](_0x305a1b);};}exports[_0x46dc('0x2a')]=function(_0x584b6a,_0x2f01b2){var _0xffc665={},_0x342f82={},_0x36cb40={'count':0x0,'rows':[]};var _0x2b8091=_[_0x46dc('0x2b')](db[_0x46dc('0x2c')][_0x46dc('0x2d')],function(_0x7f967d){return{'name':_0x7f967d[_0x46dc('0x2e')],'type':_0x7f967d['type']['key']};});_0x342f82[_0x46dc('0x2f')]=_['map'](_0x2b8091,_0x46dc('0x28'));_0x342f82['query']=_[_0x46dc('0x30')](_0x584b6a[_0x46dc('0x31')]);_0x342f82[_0x46dc('0x32')]=_[_0x46dc('0x33')](_0x342f82[_0x46dc('0x2f')],_0x342f82[_0x46dc('0x31')]);_0xffc665['attributes']=_[_0x46dc('0x33')](_0x342f82[_0x46dc('0x2f')],qs[_0x46dc('0x34')](_0x584b6a['query'][_0x46dc('0x34')]));_0xffc665[_0x46dc('0x35')]=_0xffc665[_0x46dc('0x35')][_0x46dc('0x36')]?_0xffc665[_0x46dc('0x35')]:_0x342f82[_0x46dc('0x2f')];if(!_0x584b6a[_0x46dc('0x31')][_0x46dc('0x37')](_0x46dc('0x38'))){_0xffc665[_0x46dc('0x1f')]=qs[_0x46dc('0x1f')](_0x584b6a['query'][_0x46dc('0x1f')]);_0xffc665['offset']=qs[_0x46dc('0x1d')](_0x584b6a[_0x46dc('0x31')][_0x46dc('0x1d')]);}_0xffc665[_0x46dc('0x39')]=qs['sort'](_0x584b6a[_0x46dc('0x31')][_0x46dc('0x3a')]);_0xffc665[_0x46dc('0x3b')]=qs[_0x46dc('0x32')](_[_0x46dc('0x3c')](_0x584b6a['query'],_0x342f82[_0x46dc('0x32')]),_0x2b8091);if(_0x584b6a[_0x46dc('0x31')][_0x46dc('0x3d')]){_0xffc665[_0x46dc('0x3b')]=_[_0x46dc('0x3e')](_0xffc665[_0x46dc('0x3b')],{'$or':_[_0x46dc('0x2b')](_0x2b8091,function(_0x3107b7){if(_0x3107b7[_0x46dc('0x3f')]!=='VIRTUAL'){var _0x583855={};_0x583855[_0x3107b7[_0x46dc('0x28')]]={'$like':'%'+_0x584b6a[_0x46dc('0x31')][_0x46dc('0x3d')]+'%'};return _0x583855;}})});}_0xffc665=_[_0x46dc('0x3e')]({},_0xffc665,_0x584b6a[_0x46dc('0x40')]);var _0x4af48c={'where':_0xffc665[_0x46dc('0x3b')]};return db[_0x46dc('0x2c')][_0x46dc('0x20')](_0x4af48c)[_0x46dc('0x23')](function(_0x245f66){_0x36cb40['count']=_0x245f66;if(_0x584b6a[_0x46dc('0x31')][_0x46dc('0x41')]){_0xffc665[_0x46dc('0x42')]=[{'all':!![]}];}return db[_0x46dc('0x2c')]['findAll'](_0xffc665);})[_0x46dc('0x23')](function(_0xcb145d){_0x36cb40[_0x46dc('0x43')]=_0xcb145d;return _0x36cb40;})[_0x46dc('0x23')](respondWithFilteredResult(_0x2f01b2,_0xffc665))['catch'](handleError(_0x2f01b2,null));};exports[_0x46dc('0x44')]=function(_0x12ce9d,_0x19e71c){var _0x4c4b7e={'raw':![],'where':{'id':_0x12ce9d[_0x46dc('0x45')]['id']}},_0x3a2c29={};_0x3a2c29['model']=_[_0x46dc('0x30')](db['ZohoAccount'][_0x46dc('0x2d')]);_0x3a2c29[_0x46dc('0x31')]=_[_0x46dc('0x30')](_0x12ce9d[_0x46dc('0x31')]);_0x3a2c29[_0x46dc('0x32')]=_['intersection'](_0x3a2c29[_0x46dc('0x2f')],_0x3a2c29[_0x46dc('0x31')]);_0x4c4b7e[_0x46dc('0x35')]=_[_0x46dc('0x33')](_0x3a2c29['model'],qs[_0x46dc('0x34')](_0x12ce9d[_0x46dc('0x31')]['fields']));_0x4c4b7e[_0x46dc('0x35')]=_0x4c4b7e[_0x46dc('0x35')]['length']?_0x4c4b7e[_0x46dc('0x35')]:_0x3a2c29[_0x46dc('0x2f')];if(_0x12ce9d[_0x46dc('0x31')][_0x46dc('0x41')]){_0x4c4b7e['include']=[{'all':!![]}];}_0x4c4b7e=_[_0x46dc('0x3e')]({},_0x4c4b7e,_0x12ce9d[_0x46dc('0x40')]);return db['ZohoAccount']['find'](_0x4c4b7e)[_0x46dc('0x23')](handleEntityNotFound(_0x19e71c,null))[_0x46dc('0x23')](respondWithResult(_0x19e71c,null))['catch'](handleError(_0x19e71c,null));};exports['create']=function(_0x1eeba6,_0xc53fba){return db[_0x46dc('0x2c')]['create'](_0x1eeba6[_0x46dc('0x46')],{})['then'](respondWithResult(_0xc53fba,0xc9))[_0x46dc('0x47')](handleError(_0xc53fba,null));};exports[_0x46dc('0x48')]=function(_0x3fe770,_0x369e0d){if(_0x3fe770[_0x46dc('0x46')]['id']){delete _0x3fe770[_0x46dc('0x46')]['id'];}return db[_0x46dc('0x2c')][_0x46dc('0x49')]({'where':{'id':_0x3fe770[_0x46dc('0x45')]['id']}})[_0x46dc('0x23')](handleEntityNotFound(_0x369e0d,null))[_0x46dc('0x23')](saveUpdates(_0x3fe770[_0x46dc('0x46')],null))[_0x46dc('0x23')](respondWithResult(_0x369e0d,null))['catch'](handleError(_0x369e0d,null));};exports['destroy']=function(_0x1198b0,_0x3907aa){return db[_0x46dc('0x2c')][_0x46dc('0x49')]({'where':{'id':_0x1198b0['params']['id']}})[_0x46dc('0x23')](handleEntityNotFound(_0x3907aa,null))[_0x46dc('0x23')](removeEntity(_0x3907aa,null))['catch'](handleError(_0x3907aa,null));};exports[_0x46dc('0x4a')]=function(_0x10b696,_0x358a3f,_0x5b8522){var _0xff6024={};var _0x2e703b={};var _0x302e5f;var _0x5edfee;return db['ZohoAccount'][_0x46dc('0x4b')]({'where':{'id':_0x10b696[_0x46dc('0x45')]['id']}})[_0x46dc('0x23')](handleEntityNotFound(_0x358a3f,null))[_0x46dc('0x23')](function(_0xd5eace){if(_0xd5eace){_0x302e5f=_0xd5eace;_0x2e703b['model']=_[_0x46dc('0x30')](db[_0x46dc('0x4c')]['rawAttributes']);_0x2e703b['query']=_['keys'](_0x10b696[_0x46dc('0x31')]);_0x2e703b[_0x46dc('0x32')]=_[_0x46dc('0x33')](_0x2e703b['model'],_0x2e703b[_0x46dc('0x31')]);_0xff6024['attributes']=_[_0x46dc('0x33')](_0x2e703b[_0x46dc('0x2f')],qs['fields'](_0x10b696[_0x46dc('0x31')][_0x46dc('0x34')]));_0xff6024['attributes']=_0xff6024[_0x46dc('0x35')][_0x46dc('0x36')]?_0xff6024[_0x46dc('0x35')]:_0x2e703b[_0x46dc('0x2f')];_0xff6024['order']=qs[_0x46dc('0x3a')](_0x10b696['query'][_0x46dc('0x3a')]);_0xff6024[_0x46dc('0x3b')]=qs[_0x46dc('0x32')](_[_0x46dc('0x3c')](_0x10b696[_0x46dc('0x31')],_0x2e703b[_0x46dc('0x32')]));if(_0x10b696['query'][_0x46dc('0x3d')]){_0xff6024[_0x46dc('0x3b')]=_[_0x46dc('0x3e')](_0xff6024[_0x46dc('0x3b')],{'$or':_[_0x46dc('0x2b')](_0xff6024[_0x46dc('0x35')],function(_0x5a21ac){var _0x83ab9a={};_0x83ab9a[_0x5a21ac]={'$like':'%'+_0x10b696[_0x46dc('0x31')][_0x46dc('0x3d')]+'%'};return _0x83ab9a;})});}_0xff6024=_['merge']({},_0xff6024,_0x10b696[_0x46dc('0x40')]);return _0x302e5f[_0x46dc('0x4a')](_0xff6024);}})['then'](function(_0x26a199){if(_0x26a199){_0x5edfee=_0x26a199[_0x46dc('0x36')];if(!_0x10b696[_0x46dc('0x31')][_0x46dc('0x37')](_0x46dc('0x38'))){_0xff6024[_0x46dc('0x1f')]=qs['limit'](_0x10b696['query'][_0x46dc('0x1f')]);_0xff6024[_0x46dc('0x1d')]=qs[_0x46dc('0x1d')](_0x10b696[_0x46dc('0x31')][_0x46dc('0x1d')]);}return _0x302e5f[_0x46dc('0x4a')](_0xff6024);}})[_0x46dc('0x23')](function(_0x53510f){if(_0x53510f){return _0x53510f?{'count':_0x5edfee,'rows':_0x53510f}:null;}})['then'](respondWithResult(_0x358a3f,null))[_0x46dc('0x47')](handleError(_0x358a3f,null));};exports[_0x46dc('0x4d')]=function(_0x5ee654,_0x311c16,_0x2c25ee){if(_0x5ee654['body']['id']){delete _0x5ee654[_0x46dc('0x46')]['id'];}return db[_0x46dc('0x2c')][_0x46dc('0x4b')]({'where':{'id':_0x5ee654[_0x46dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x311c16,null))[_0x46dc('0x23')](function(_0x562286){if(_0x562286){_0x5ee654[_0x46dc('0x46')][_0x46dc('0x4e')]=_0x562286['id'];_0x5ee654['body']['Subjects']=integrations[_0x46dc('0x4f')](_0x5ee654[_0x46dc('0x46')][_0x46dc('0x50')],_0x5ee654[_0x46dc('0x46')][_0x46dc('0x3f')]);_0x5ee654[_0x46dc('0x46')]['Descriptions']=integrations[_0x46dc('0x51')](_0x5ee654['body'][_0x46dc('0x50')],_0x5ee654[_0x46dc('0x46')]['type']);return db[_0x46dc('0x4c')][_0x46dc('0x52')](_0x5ee654[_0x46dc('0x46')],{'include':[{'model':db[_0x46dc('0x53')],'as':_0x46dc('0x54')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x311c16,null))[_0x46dc('0x47')](handleError(_0x311c16,null));};function getAccessToken(_0x559092){return new Promise(function(_0x3fdc4b,_0x2ff746){var _0xf140c6;switch(_0x559092[_0x46dc('0x55')]){case'US':_0xf140c6=_0x46dc('0x56');break;case'AU':_0xf140c6='https://accounts.zoho.com.au';break;case'EU':_0xf140c6='https://accounts.zoho.eu';break;case'IN':_0xf140c6=_0x46dc('0x57');break;case'CN':_0xf140c6='https://accounts.zoho.com.cn';break;default:_0xf140c6=_0x46dc('0x58');break;}var _0x5dac6d={'method':_0x46dc('0x59'),'uri':_0xf140c6+_0x46dc('0x5a'),'qs':{'refresh_token':_0x559092[_0x46dc('0x5b')],'client_id':_0x559092['clientId'],'client_secret':_0x559092[_0x46dc('0x5c')],'grant_type':_0x46dc('0x5d')},'json':!![]};return rp(_0x5dac6d)[_0x46dc('0x23')](function(_0xd2637b){if(_0xd2637b['access_token']){_0x3fdc4b(_0xd2637b[_0x46dc('0x5e')]);}else{_0x2ff746(_0x46dc('0x5f'));}})['catch'](function(_0x36daaa){_0x2ff746(_0x36daaa);});});}exports['getFields']=function(_0x39b1ad,_0xbe0c01,_0x15b508){var _0x38ee36,_0x1b8a51,_0x4a3900,_0x2c83ca,_0x1206bd;return db['ZohoAccount'][_0x46dc('0x4b')]({'where':{'id':_0x39b1ad[_0x46dc('0x45')]['id']},'attributes':['id',_0x46dc('0x60'),_0x46dc('0x55'),'clientId',_0x46dc('0x5c'),_0x46dc('0x61'),_0x46dc('0x62'),_0x46dc('0x5b')]})['then'](handleEntityNotFound(_0xbe0c01,null))[_0x46dc('0x23')](function(_0xd0c09e){_0x1206bd=_0xd0c09e;_0x38ee36=_0x1206bd[_0x46dc('0x60')];_0x1b8a51=_0x38ee36===_0x46dc('0x63')?'eu':'com';_0x4a3900=_0x1206bd[_0x46dc('0x61')];var _0x19867b=_0x4a3900[_0x46dc('0x64')](-0x1);if(_0x19867b==='/'||_0x19867b==='\x5c'||_0x19867b===':'){_0x4a3900=_0x4a3900[_0x46dc('0x65')](0x0,_0x4a3900[_0x46dc('0x66')](_0x19867b));}if(!_0x1206bd[_0x46dc('0x5b')]){throw new Error(_0x46dc('0x67'));}return getAccessToken(_0x1206bd);})[_0x46dc('0x23')](function(_0x459cdb){if(_0x459cdb){return rp({'method':_0x46dc('0x68'),'uri':util[_0x46dc('0x69')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1b8a51),'qs':{'module':_0x46dc('0x6a')},'headers':{'Authorization':_0x46dc('0x6b')+_0x459cdb},'json':!![]});}})[_0x46dc('0x23')](function(_0xf69528){if(_0xf69528){if(_0xf69528[_0x46dc('0x6c')]&&_0xf69528[_0x46dc('0x6c')][_0x46dc('0x26')]){throw new Error(_0xf69528[_0x46dc('0x6c')][_0x46dc('0x26')]['message']);}var _0x4daa98=[];var _0x4bbd1e=[];var _0x398c52=[_0x46dc('0x6d'),_0x46dc('0x6e'),_0x46dc('0x6f'),'WhoId',_0x46dc('0x70'),_0x46dc('0x71'),_0x46dc('0x72'),_0x46dc('0x73')];_0x4bbd1e=_['remove'](_0xf69528[_0x46dc('0x34')],function(_0x2f04f1){return _0x398c52['includes'](_0x2f04f1[_0x46dc('0x74')]);});for(var _0x11e9df=0x0;_0x11e9df<_0x4bbd1e[_0x46dc('0x36')];_0x11e9df++){if(_0x4bbd1e[_0x11e9df][_0x46dc('0x75')]===![]){_0x4daa98[_0x46dc('0x76')]({'id':_0x4bbd1e[_0x11e9df]['id'],'name':_0x4bbd1e[_0x11e9df][_0x46dc('0x77')],'custom':_0x4bbd1e[_0x11e9df][_0x46dc('0x78')],'options':_0x4bbd1e[_0x11e9df][_0x46dc('0x79')]==='picklist'&&_0x4bbd1e[_0x11e9df][_0x46dc('0x7a')]['length']>-0x1?_['map'](_0x4bbd1e[_0x11e9df][_0x46dc('0x7a')],function(_0x47db72){return{'name':_0x47db72,'value':_0x47db72};}):[]});}}return{'count':_0x4daa98[_0x46dc('0x36')],'rows':_0x4daa98};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xbe0c01,null))[_0x46dc('0x47')](function(_0x14d8c6){var _0xe0fd1f=_0x39b1ad[_0x46dc('0x31')][_0x46dc('0x7b')]?0x1f4:_0x14d8c6['statusCode']||0x1f4;logger[_0x46dc('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x46dc('0x7c'),_0xe0fd1f,JSON[_0x46dc('0x7d')](_0x14d8c6));delete _0x14d8c6[_0x46dc('0x28')];if(_0xe0fd1f===0x191){_0xe0fd1f=0x190;}_0xbe0c01[_0x46dc('0x1b')](_0xe0fd1f)[_0x46dc('0x29')](_0x39b1ad[_0x46dc('0x31')][_0x46dc('0x7b')]?{'message':_0x46dc('0x7e'),'statusCode':_0x14d8c6['statusCode']}:_0x14d8c6);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 005b1ca..6a454e5 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75ab=['../../components/integrations/configuration','exports','define','changed','serverUrl','clientId','clientSecret','code','host','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.in','https://accounts.zoho.eu','parse','refresh_token','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes'];(function(_0x89941,_0x3357ef){var _0x11eca3=function(_0x3203e2){while(--_0x3203e2){_0x89941['push'](_0x89941['shift']());}};_0x11eca3(++_0x3357ef);}(_0x75ab,0xed));var _0xb75a=function(_0x1ca42b,_0x47dbbb){_0x1ca42b=_0x1ca42b-0x0;var _0x18b0aa=_0x75ab[_0x1ca42b];return _0x18b0aa;};'use strict';var _=require('lodash');var util=require(_0xb75a('0x0'));var logger=require(_0xb75a('0x1'))(_0xb75a('0x2'));var moment=require(_0xb75a('0x3'));var BPromise=require(_0xb75a('0x4'));var rp=require(_0xb75a('0x5'));var fs=require('fs');var path=require(_0xb75a('0x6'));var rimraf=require('rimraf');var config=require(_0xb75a('0x7'));var attributes=require(_0xb75a('0x8'));var integrations=require(_0xb75a('0x9'));module[_0xb75a('0xa')]=function(_0x34e8a,_0x38c109){return _0x34e8a[_0xb75a('0xb')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4684e0,_0x33c5b5,_0x8309a2){if(_0x4684e0[_0xb75a('0xc')]('zone')||_0x4684e0[_0xb75a('0xc')](_0xb75a('0xd'))||_0x4684e0[_0xb75a('0xc')](_0xb75a('0xe'))||_0x4684e0[_0xb75a('0xc')](_0xb75a('0xf'))||_0x4684e0['changed'](_0xb75a('0x10'))||_0x4684e0[_0xb75a('0xc')](_0xb75a('0x11'))){var _0x5c58e9,_0x2ef9bc;_0x5c58e9=_0x4684e0['serverUrl'];var _0xd0056d=_0x5c58e9['slice'](-0x1);if(_0xd0056d==='/'||_0xd0056d==='\x5c'||_0xd0056d===':'){_0x5c58e9=_0x5c58e9[_0xb75a('0x12')](0x0,_0x5c58e9['lastIndexOf'](_0xd0056d));}switch(_0x4684e0[_0xb75a('0x13')]){case'US':_0x2ef9bc=_0xb75a('0x14');break;case'AU':_0x2ef9bc=_0xb75a('0x15');break;case'IN':_0x2ef9bc='https://accounts.zoho.in';break;case'CN':_0x2ef9bc=_0xb75a('0x16');break;default:_0x2ef9bc='https://accounts.zoho.eu';break;}var _0x180d57={'method':_0xb75a('0x17'),'uri':_0x2ef9bc+_0xb75a('0x18'),'form':{'grant_type':_0xb75a('0x19'),'client_id':_0x4684e0['clientId'],'client_secret':_0x4684e0['clientSecret'],'redirect_uri':_0x4684e0[_0xb75a('0xd')],'code':_0x4684e0['code']},'headers':{'Content-Type':_0xb75a('0x1a')}};return rp(_0x180d57)[_0xb75a('0x1b')](function(_0x4a7880){var _0x1395da=JSON['parse'](_0x4a7880);if(_0x1395da['refresh_token']){_0x4684e0[_0xb75a('0x1c')]=_0x1395da['refresh_token'];logger[_0xb75a('0x1d')](util[_0xb75a('0x1e')](_0xb75a('0x1f'),_0x4684e0[_0xb75a('0x20')],_0x4684e0['id']));}else{logger[_0xb75a('0x21')](util[_0xb75a('0x1e')](_0xb75a('0x22'),_0x4684e0[_0xb75a('0x20')],_0x4684e0['id']),util[_0xb75a('0x23')](_0x1395da,{'showHidden':![],'depth':null}));}return _0x8309a2(null,_0x33c5b5);})[_0xb75a('0x24')](function(_0x464beb){logger[_0xb75a('0x21')](util[_0xb75a('0x1e')](_0xb75a('0x22'),_0x4684e0[_0xb75a('0x20')],_0x4684e0['id']),util[_0xb75a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x8309a2(_0x464beb);});}else{return _0x8309a2(null,_0x33c5b5);}},'beforeUpdate':function(_0x84e1b2,_0x2a7876,_0x518f9b){if(_0x84e1b2[_0xb75a('0xc')]('zone')||_0x84e1b2['changed'](_0xb75a('0xd'))||_0x84e1b2['changed'](_0xb75a('0xe'))||_0x84e1b2[_0xb75a('0xc')](_0xb75a('0xf'))||_0x84e1b2['changed'](_0xb75a('0x10'))||_0x84e1b2[_0xb75a('0xc')](_0xb75a('0x11'))){var _0x15f2e3,_0x2bae2c;_0x15f2e3=_0x84e1b2['serverUrl'];var _0x2d6d23=_0x15f2e3['slice'](-0x1);if(_0x2d6d23==='/'||_0x2d6d23==='\x5c'||_0x2d6d23===':'){_0x15f2e3=_0x15f2e3[_0xb75a('0x12')](0x0,_0x15f2e3['lastIndexOf'](_0x2d6d23));}switch(_0x84e1b2[_0xb75a('0x13')]){case'US':_0x2bae2c=_0xb75a('0x14');break;case'AU':_0x2bae2c=_0xb75a('0x15');break;case'IN':_0x2bae2c=_0xb75a('0x25');break;case'CN':_0x2bae2c='https://accounts.zoho.com.cn';break;default:_0x2bae2c=_0xb75a('0x26');break;}var _0x1267ff={'method':_0xb75a('0x17'),'uri':_0x2bae2c+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x84e1b2[_0xb75a('0xe')],'client_secret':_0x84e1b2[_0xb75a('0xf')],'redirect_uri':_0x84e1b2[_0xb75a('0xd')],'code':_0x84e1b2[_0xb75a('0x10')]},'headers':{'Content-Type':_0xb75a('0x1a')}};return rp(_0x1267ff)[_0xb75a('0x1b')](function(_0x252435){var _0x3930b5=JSON[_0xb75a('0x27')](_0x252435);if(_0x3930b5[_0xb75a('0x28')]){_0x84e1b2[_0xb75a('0x1c')]=_0x3930b5[_0xb75a('0x28')];logger['info'](util[_0xb75a('0x1e')](_0xb75a('0x1f'),_0x84e1b2['name'],_0x84e1b2['id']));}else{logger['error'](util['format'](_0xb75a('0x22'),_0x84e1b2[_0xb75a('0x20')],_0x84e1b2['id']),util[_0xb75a('0x23')](_0x3930b5,{'showHidden':![],'depth':null}));}return _0x518f9b(null,_0x2a7876);})[_0xb75a('0x24')](function(_0x3b9564){logger[_0xb75a('0x21')](util['format'](_0xb75a('0x22'),_0x84e1b2[_0xb75a('0x20')],_0x84e1b2['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x518f9b(_0x3b9564);});}else{return _0x518f9b(null,_0x2a7876);}}}});}; \ No newline at end of file +var _0xf540=['info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','authorization_code','parse','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','refresh_token'];(function(_0x5db8c3,_0x5303c6){var _0x40b396=function(_0x2e9395){while(--_0x2e9395){_0x5db8c3['push'](_0x5db8c3['shift']());}};_0x40b396(++_0x5303c6);}(_0xf540,0xba));var _0x0f54=function(_0x4c4e69,_0x4dae3d){_0x4c4e69=_0x4c4e69-0x0;var _0x481c41=_0xf540[_0x4c4e69];return _0x481c41;};'use strict';var _=require('lodash');var util=require(_0x0f54('0x0'));var logger=require(_0x0f54('0x1'))(_0x0f54('0x2'));var moment=require('moment');var BPromise=require(_0x0f54('0x3'));var rp=require(_0x0f54('0x4'));var fs=require('fs');var path=require(_0x0f54('0x5'));var rimraf=require(_0x0f54('0x6'));var config=require(_0x0f54('0x7'));var attributes=require(_0x0f54('0x8'));var integrations=require(_0x0f54('0x9'));module[_0x0f54('0xa')]=function(_0x48c449,_0xc8a8c7){return _0x48c449[_0x0f54('0xb')](_0x0f54('0xc'),attributes,{'tableName':_0x0f54('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e70a9,_0x302fea,_0x144390){if(_0x5e70a9[_0x0f54('0xe')](_0x0f54('0xf'))||_0x5e70a9['changed']('serverUrl')||_0x5e70a9[_0x0f54('0xe')](_0x0f54('0x10'))||_0x5e70a9[_0x0f54('0xe')](_0x0f54('0x11'))||_0x5e70a9['changed'](_0x0f54('0x12'))||_0x5e70a9['changed'](_0x0f54('0x13'))){var _0x5d6676,_0x1c7baa;_0x5d6676=_0x5e70a9[_0x0f54('0x14')];var _0x2fd917=_0x5d6676[_0x0f54('0x15')](-0x1);if(_0x2fd917==='/'||_0x2fd917==='\x5c'||_0x2fd917===':'){_0x5d6676=_0x5d6676[_0x0f54('0x16')](0x0,_0x5d6676[_0x0f54('0x17')](_0x2fd917));}switch(_0x5e70a9[_0x0f54('0xf')]){case'US':_0x1c7baa=_0x0f54('0x18');break;case'AU':_0x1c7baa=_0x0f54('0x19');break;case'IN':_0x1c7baa=_0x0f54('0x1a');break;case'CN':_0x1c7baa=_0x0f54('0x1b');break;default:_0x1c7baa=_0x0f54('0x1c');break;}var _0x3ad829={'method':_0x0f54('0x1d'),'uri':_0x1c7baa+_0x0f54('0x1e'),'form':{'grant_type':'authorization_code','client_id':_0x5e70a9[_0x0f54('0x10')],'client_secret':_0x5e70a9[_0x0f54('0x11')],'redirect_uri':_0x5e70a9[_0x0f54('0x14')],'code':_0x5e70a9[_0x0f54('0x12')]},'headers':{'Content-Type':_0x0f54('0x1f')}};return rp(_0x3ad829)[_0x0f54('0x20')](function(_0x58b743){var _0x500c38=JSON['parse'](_0x58b743);if(_0x500c38[_0x0f54('0x21')]){_0x5e70a9['refreshToken']=_0x500c38[_0x0f54('0x21')];logger[_0x0f54('0x22')](util[_0x0f54('0x23')](_0x0f54('0x24'),_0x5e70a9['name'],_0x5e70a9['id']));}else{logger[_0x0f54('0x25')](util['format'](_0x0f54('0x26'),_0x5e70a9[_0x0f54('0x27')],_0x5e70a9['id']),util[_0x0f54('0x28')](_0x500c38,{'showHidden':![],'depth':null}));}return _0x144390(null,_0x302fea);})[_0x0f54('0x29')](function(_0x1a3903){logger[_0x0f54('0x25')](util[_0x0f54('0x23')](_0x0f54('0x26'),_0x5e70a9[_0x0f54('0x27')],_0x5e70a9['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x144390(_0x1a3903);});}else{return _0x144390(null,_0x302fea);}},'beforeUpdate':function(_0x569c97,_0x4af5de,_0x5ce237){if(_0x569c97[_0x0f54('0xe')](_0x0f54('0xf'))||_0x569c97['changed'](_0x0f54('0x14'))||_0x569c97[_0x0f54('0xe')](_0x0f54('0x10'))||_0x569c97['changed'](_0x0f54('0x11'))||_0x569c97[_0x0f54('0xe')]('code')||_0x569c97['changed'](_0x0f54('0x13'))){var _0x25fbb9,_0x5538b7;_0x25fbb9=_0x569c97[_0x0f54('0x14')];var _0x141684=_0x25fbb9[_0x0f54('0x15')](-0x1);if(_0x141684==='/'||_0x141684==='\x5c'||_0x141684===':'){_0x25fbb9=_0x25fbb9[_0x0f54('0x16')](0x0,_0x25fbb9[_0x0f54('0x17')](_0x141684));}switch(_0x569c97[_0x0f54('0xf')]){case'US':_0x5538b7='https://accounts.zoho.com';break;case'AU':_0x5538b7=_0x0f54('0x19');break;case'IN':_0x5538b7=_0x0f54('0x1a');break;case'CN':_0x5538b7=_0x0f54('0x1b');break;default:_0x5538b7=_0x0f54('0x1c');break;}var _0x213f4a={'method':_0x0f54('0x1d'),'uri':_0x5538b7+'/oauth/v2/token','form':{'grant_type':_0x0f54('0x2a'),'client_id':_0x569c97[_0x0f54('0x10')],'client_secret':_0x569c97[_0x0f54('0x11')],'redirect_uri':_0x569c97[_0x0f54('0x14')],'code':_0x569c97['code']},'headers':{'Content-Type':_0x0f54('0x1f')}};return rp(_0x213f4a)[_0x0f54('0x20')](function(_0x2db3e3){var _0x4cf90f=JSON[_0x0f54('0x2b')](_0x2db3e3);if(_0x4cf90f[_0x0f54('0x21')]){_0x569c97['refreshToken']=_0x4cf90f[_0x0f54('0x21')];logger[_0x0f54('0x22')](util['format'](_0x0f54('0x24'),_0x569c97[_0x0f54('0x27')],_0x569c97['id']));}else{logger[_0x0f54('0x25')](util[_0x0f54('0x23')](_0x0f54('0x26'),_0x569c97[_0x0f54('0x27')],_0x569c97['id']),util[_0x0f54('0x28')](_0x4cf90f,{'showHidden':![],'depth':null}));}return _0x5ce237(null,_0x4af5de);})[_0x0f54('0x29')](function(_0x37f94a){logger['error'](util[_0x0f54('0x23')](_0x0f54('0x26'),_0x569c97[_0x0f54('0x27')],_0x569c97['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5ce237(_0x37f94a);});}else{return _0x5ce237(null,_0x4af5de);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 6746754..f197790 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4910=['attributes','include','model','map','ShowZohoAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0x4910,0x1d9));var _0x0491=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4910[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});}exports[_0x0491('0x19')]=function(_0x31bc2c){var _0x3b536e=this;return new Promise(function(_0xc02328,_0x4ba009){return db[_0x0491('0x1a')][_0x0491('0x1b')]({'raw':_0x31bc2c['options']?_0x31bc2c['options'][_0x0491('0x1c')]===undefined?!![]:![]:!![],'where':_0x31bc2c['options']?_0x31bc2c[_0x0491('0x1d')][_0x0491('0x1e')]||null:null,'attributes':_0x31bc2c['options']?_0x31bc2c[_0x0491('0x1d')][_0x0491('0x1f')]||null:null,'limit':_0x31bc2c[_0x0491('0x1d')]?_0x31bc2c[_0x0491('0x1d')]['limit']||null:null,'include':_0x31bc2c[_0x0491('0x1d')]?_0x31bc2c[_0x0491('0x1d')][_0x0491('0x20')]?_['map'](_0x31bc2c[_0x0491('0x1d')][_0x0491('0x20')],function(_0x31c4ba){return{'model':db[_0x31c4ba[_0x0491('0x21')]],'as':_0x31c4ba['as'],'attributes':_0x31c4ba[_0x0491('0x1f')],'include':_0x31c4ba[_0x0491('0x20')]?_[_0x0491('0x22')](_0x31c4ba['include'],function(_0x7c03ef){return{'model':db[_0x7c03ef[_0x0491('0x21')]],'as':_0x7c03ef['as'],'attributes':_0x7c03ef[_0x0491('0x1f')],'include':_0x7c03ef[_0x0491('0x20')]?_[_0x0491('0x22')](_0x7c03ef['include'],function(_0x12ebdb){return{'model':db[_0x12ebdb[_0x0491('0x21')]],'as':_0x12ebdb['as'],'attributes':_0x12ebdb[_0x0491('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0491('0xd')](function(_0xe0e31e){logger[_0x0491('0xe')](_0x0491('0x19'),_0x31bc2c);logger[_0x0491('0x10')](_0x0491('0x19'),_0x31bc2c,JSON[_0x0491('0x12')](_0xe0e31e));_0xc02328(_0xe0e31e);})['catch'](function(_0x4fbeb8){logger['error']('GetZohoAccount',_0x4fbeb8[_0x0491('0x16')],_0x31bc2c);_0x4ba009(_0x3b536e['error'](0x1f4,_0x4fbeb8[_0x0491('0x16')]));});});};exports[_0x0491('0x23')]=function(_0x3b66d0){var _0x7d4feb=this;return new Promise(function(_0x2e3223,_0x18278b){return db[_0x0491('0x1a')]['find']({'raw':_0x3b66d0[_0x0491('0x1d')]?_0x3b66d0[_0x0491('0x1d')][_0x0491('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b66d0[_0x0491('0x1d')]?_0x3b66d0['options']['where']||null:null,'attributes':_0x3b66d0['options']?_0x3b66d0[_0x0491('0x1d')]['attributes']||null:null,'include':_0x3b66d0[_0x0491('0x1d')]?_0x3b66d0[_0x0491('0x1d')][_0x0491('0x20')]?_[_0x0491('0x22')](_0x3b66d0[_0x0491('0x1d')][_0x0491('0x20')],function(_0x17b4ee){return{'model':db[_0x17b4ee[_0x0491('0x21')]],'as':_0x17b4ee['as'],'attributes':_0x17b4ee['attributes'],'include':_0x17b4ee[_0x0491('0x20')]?_['map'](_0x17b4ee[_0x0491('0x20')],function(_0x16ef85){return{'model':db[_0x16ef85['model']],'as':_0x16ef85['as'],'attributes':_0x16ef85[_0x0491('0x1f')],'include':_0x16ef85['include']?_[_0x0491('0x22')](_0x16ef85[_0x0491('0x20')],function(_0x404b74){return{'model':db[_0x404b74[_0x0491('0x21')]],'as':_0x404b74['as'],'attributes':_0x404b74['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bff9c){logger[_0x0491('0xe')](_0x0491('0x23'),_0x3b66d0);logger['debug'](_0x0491('0x23'),_0x3b66d0,JSON['stringify'](_0x2bff9c));_0x2e3223(_0x2bff9c);})[_0x0491('0x18')](function(_0x524387){logger[_0x0491('0x13')](_0x0491('0x23'),_0x524387[_0x0491('0x16')],_0x3b66d0);_0x18278b(_0x7d4feb['error'](0x1f4,_0x524387['message']));});});}; \ No newline at end of file +var _0x8952=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','ShowZohoAccount','find','raw','debug','util','moment','bluebird'];(function(_0x270e46,_0x122174){var _0x18ca4e=function(_0x5c1a81){while(--_0x5c1a81){_0x270e46['push'](_0x270e46['shift']());}};_0x18ca4e(++_0x122174);}(_0x8952,0x17e));var _0x2895=function(_0x47aec4,_0x43cf82){_0x47aec4=_0x47aec4-0x0;var _0x12906c=_0x8952[_0x47aec4];return _0x12906c;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')]({'raw':_0xbf8b63['options']?_0xbf8b63['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf8b63[_0x2895('0x18')]?_0xbf8b63[_0x2895('0x18')][_0x2895('0x19')]||null:null,'attributes':_0xbf8b63['options']?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1a')]||null:null,'limit':_0xbf8b63[_0x2895('0x18')]?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1b')]||null:null,'include':_0xbf8b63['options']?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1c')]?_['map'](_0xbf8b63[_0x2895('0x18')][_0x2895('0x1c')],function(_0x6f8ad4){return{'model':db[_0x6f8ad4['model']],'as':_0x6f8ad4['as'],'attributes':_0x6f8ad4['attributes'],'include':_0x6f8ad4[_0x2895('0x1c')]?_[_0x2895('0x1d')](_0x6f8ad4[_0x2895('0x1c')],function(_0x4a21cf){return{'model':db[_0x4a21cf[_0x2895('0x1e')]],'as':_0x4a21cf['as'],'attributes':_0x4a21cf[_0x2895('0x1a')],'include':_0x4a21cf['include']?_[_0x2895('0x1d')](_0x4a21cf[_0x2895('0x1c')],function(_0x2cd4df){return{'model':db[_0x2cd4df['model']],'as':_0x2cd4df['as'],'attributes':_0x2cd4df[_0x2895('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2895('0xc')](function(_0x5eedfc){logger[_0x2895('0xd')]('GetZohoAccount',_0xbf8b63);logger['debug'](_0x2895('0x15'),_0xbf8b63,JSON['stringify'](_0x5eedfc));_0x155124(_0x5eedfc);})[_0x2895('0x14')](function(_0x381538){logger['error']('GetZohoAccount',_0x381538[_0x2895('0x12')],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x381538[_0x2895('0x12')]));});});};exports[_0x2895('0x1f')]=function(_0x14d150){var _0xa61689=this;return new Promise(function(_0x34e110,_0x546514){return db[_0x2895('0x16')][_0x2895('0x20')]({'raw':_0x14d150[_0x2895('0x18')]?_0x14d150['options'][_0x2895('0x21')]===undefined?!![]:![]:!![],'where':_0x14d150[_0x2895('0x18')]?_0x14d150[_0x2895('0x18')][_0x2895('0x19')]||null:null,'attributes':_0x14d150['options']?_0x14d150[_0x2895('0x18')][_0x2895('0x1a')]||null:null,'include':_0x14d150[_0x2895('0x18')]?_0x14d150[_0x2895('0x18')][_0x2895('0x1c')]?_['map'](_0x14d150['options'][_0x2895('0x1c')],function(_0xf3c8f7){return{'model':db[_0xf3c8f7['model']],'as':_0xf3c8f7['as'],'attributes':_0xf3c8f7[_0x2895('0x1a')],'include':_0xf3c8f7['include']?_[_0x2895('0x1d')](_0xf3c8f7[_0x2895('0x1c')],function(_0x586c4a){return{'model':db[_0x586c4a[_0x2895('0x1e')]],'as':_0x586c4a['as'],'attributes':_0x586c4a['attributes'],'include':_0x586c4a[_0x2895('0x1c')]?_['map'](_0x586c4a['include'],function(_0xa6fe9e){return{'model':db[_0xa6fe9e[_0x2895('0x1e')]],'as':_0xa6fe9e['as'],'attributes':_0xa6fe9e[_0x2895('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e4348){logger[_0x2895('0xd')](_0x2895('0x1f'),_0x14d150);logger[_0x2895('0x22')](_0x2895('0x1f'),_0x14d150,JSON[_0x2895('0xf')](_0x1e4348));_0x34e110(_0x1e4348);})[_0x2895('0x14')](function(_0x240230){logger[_0x2895('0x10')](_0x2895('0x1f'),_0x240230['message'],_0x14d150);_0x546514(_0xa61689[_0x2895('0x10')](0x1f4,_0x240230[_0x2895('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 67951a4..fef173f 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf406=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','multer','path','Router','../../components/auth/service','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x5f438b,_0xf50a97){var _0x2fb15a=function(_0xbab3c0){while(--_0xbab3c0){_0x5f438b['push'](_0x5f438b['shift']());}};_0x2fb15a(++_0xf50a97);}(_0xf406,0x1bf));var _0x6f40=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xf406[_0x2d982d];return _0x4f36b0;};'use strict';var multer=require(_0x6f40('0x0'));var util=require('util');var path=require(_0x6f40('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f40('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f40('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f40('0x4'));router[_0x6f40('0x5')]('/',auth['isAuthenticated'](),controller[_0x6f40('0x6')]);router['get'](_0x6f40('0x7'),auth[_0x6f40('0x8')](),controller[_0x6f40('0x9')]);router[_0x6f40('0x5')](_0x6f40('0xa'),auth[_0x6f40('0x8')](),controller[_0x6f40('0xb')]);router[_0x6f40('0x5')](_0x6f40('0xc'),auth[_0x6f40('0x8')](),controller[_0x6f40('0xd')]);router[_0x6f40('0x5')](_0x6f40('0xe'),auth[_0x6f40('0x8')](),controller[_0x6f40('0xf')]);router[_0x6f40('0x10')]('/',auth[_0x6f40('0x8')](),controller['create']);router[_0x6f40('0x11')](_0x6f40('0x7'),auth[_0x6f40('0x8')](),controller[_0x6f40('0x12')]);router[_0x6f40('0x13')]('/:id',auth[_0x6f40('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf5ad=['/:id/fields','getFields','getDescriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xf5ad,0xb1));var _0xdf5a=function(_0x1fee72,_0x1117c3){_0x1fee72=_0x1fee72-0x0;var _0x42435c=_0xf5ad[_0x1fee72];return _0x42435c;};'use strict';var multer=require(_0xdf5a('0x0'));var util=require(_0xdf5a('0x1'));var path=require('path');var timeout=require(_0xdf5a('0x2'));var express=require(_0xdf5a('0x3'));var router=express[_0xdf5a('0x4')]();var fs_extra=require(_0xdf5a('0x5'));var auth=require(_0xdf5a('0x6'));var interaction=require(_0xdf5a('0x7'));var config=require(_0xdf5a('0x8'));var controller=require(_0xdf5a('0x9'));router[_0xdf5a('0xa')]('/',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0xc')]);router[_0xdf5a('0xa')](_0xdf5a('0xd'),auth[_0xdf5a('0xb')](),controller[_0xdf5a('0xe')]);router[_0xdf5a('0xa')](_0xdf5a('0xf'),auth['isAuthenticated'](),controller[_0xdf5a('0x10')]);router[_0xdf5a('0xa')]('/:id/subjects',auth[_0xdf5a('0xb')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xdf5a('0x11')]);router[_0xdf5a('0x12')]('/',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0x13')]);router[_0xdf5a('0x14')]('/:id',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0x15')]);router[_0xdf5a('0x16')]('/:id',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 4bfb593..c54f9e8 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5e4=['lead','contact_lead','STRING','exports','ENUM','contact','nothing'];(function(_0x498a98,_0x176d45){var _0x16472e=function(_0x2d0d69){while(--_0x2d0d69){_0x498a98['push'](_0x498a98['shift']());}};_0x16472e(++_0x176d45);}(_0xf5e4,0x8f));var _0x4f5e=function(_0x3102e4,_0x1c7e18){_0x3102e4=_0x3102e4-0x0;var _0x19a056=_0xf5e4[_0x3102e4];return _0x19a056;};'use strict';var Sequelize=require('sequelize');module[_0x4f5e('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x4f5e('0x1')]('lead',_0x4f5e('0x2'),_0x4f5e('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x4f5e('0x1')]('contact_lead',_0x4f5e('0x2'),_0x4f5e('0x4')),'defaultValue':_0x4f5e('0x5')},'description':{'type':Sequelize[_0x4f5e('0x6')]}}; \ No newline at end of file +var _0xadb5=['contact_lead','contact','exports','STRING','lead','nothing','ENUM'];(function(_0x1a89a5,_0x1f895f){var _0x1f351f=function(_0x5c4218){while(--_0x5c4218){_0x1a89a5['push'](_0x1a89a5['shift']());}};_0x1f351f(++_0x1f895f);}(_0xadb5,0x1c2));var _0x5adb=function(_0x5a7660,_0x24c108){_0x5a7660=_0x5a7660-0x0;var _0x55c7c3=_0xadb5[_0x5a7660];return _0x55c7c3;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize[_0x5adb('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x5adb('0x2'),'contact',_0x5adb('0x3')),'defaultValue':_0x5adb('0x2')},'moduleSearch':{'type':Sequelize[_0x5adb('0x4')](_0x5adb('0x5'),_0x5adb('0x6'),_0x5adb('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x5adb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 28dcbd6..6f35fb8 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2271=['apply','reject','save','destroy','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','then','include','findAll','rows','catch','show','params','options','create','update','body','find','getFields','ZohoField','nolimit','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x26d859,_0x169d28){var _0x39bb3b=function(_0x3b9a8d){while(--_0x3b9a8d){_0x26d859['push'](_0x26d859['shift']());}};_0x39bb3b(++_0x169d28);}(_0x2271,0x83));var _0x1227=function(_0xb07d4d,_0x1ed5d5){_0xb07d4d=_0xb07d4d-0x0;var _0x4cf453=_0x2271[_0xb07d4d];return _0x4cf453;};'use strict';var emlformat=require(_0x1227('0x0'));var rimraf=require(_0x1227('0x1'));var zipdir=require(_0x1227('0x2'));var jsonpatch=require(_0x1227('0x3'));var rp=require(_0x1227('0x4'));var moment=require(_0x1227('0x5'));var BPromise=require(_0x1227('0x6'));var Mustache=require(_0x1227('0x7'));var util=require(_0x1227('0x8'));var path=require(_0x1227('0x9'));var sox=require(_0x1227('0xa'));var csv=require(_0x1227('0xb'));var ejs=require(_0x1227('0xc'));var fs=require('fs');var fs_extra=require(_0x1227('0xd'));var _=require(_0x1227('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1227('0xf'));var deskjs=require(_0x1227('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1227('0x11'));var Redis=require(_0x1227('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1227('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1227('0x14'))(_0x1227('0x15'));var utils=require(_0x1227('0x16'));var config=require(_0x1227('0x17'));var licenseUtil=require(_0x1227('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f6737,_0x4abd6a){_0x4abd6a=_0x4abd6a||0xcc;return function(_0x3edd53){if(_0x3edd53){return _0x3f6737[_0x1227('0x19')](_0x4abd6a);}return _0x3f6737['status'](_0x4abd6a)[_0x1227('0x1a')]();};}function respondWithResult(_0x10e763,_0x440046){_0x440046=_0x440046||0xc8;return function(_0x35d2c0){if(_0x35d2c0){return _0x10e763[_0x1227('0x1b')](_0x440046)[_0x1227('0x1c')](_0x35d2c0);}};}function respondWithFilteredResult(_0x366fdb,_0x344f9d){return function(_0x2a51a9){if(_0x2a51a9){var _0x40b945=typeof _0x344f9d[_0x1227('0x1d')]===_0x1227('0x1e')&&typeof _0x344f9d[_0x1227('0x1f')]===_0x1227('0x1e');var _0x111a5f=_0x2a51a9[_0x1227('0x20')];var _0x40f4aa=_0x40b945?0x0:_0x344f9d[_0x1227('0x1d')];var _0x17e418=_0x40b945?_0x2a51a9[_0x1227('0x20')]:_0x344f9d[_0x1227('0x1d')]+_0x344f9d[_0x1227('0x1f')];var _0x321a00;if(_0x17e418>=_0x111a5f){_0x17e418=_0x111a5f;_0x321a00=0xc8;}else{_0x321a00=0xce;}_0x366fdb[_0x1227('0x1b')](_0x321a00);return _0x366fdb[_0x1227('0x21')](_0x1227('0x22'),_0x40f4aa+'-'+_0x17e418+'/'+_0x111a5f)[_0x1227('0x1c')](_0x2a51a9);}return null;};}function patchUpdates(_0x3b2a97){return function(_0x27e06e){try{jsonpatch[_0x1227('0x23')](_0x27e06e,_0x3b2a97,!![]);}catch(_0x9d899b){return BPromise[_0x1227('0x24')](_0x9d899b);}return _0x27e06e[_0x1227('0x25')]();};}function saveUpdates(_0x55505c,_0xe30d88){return function(_0x26680c){if(_0x26680c){return _0x26680c['update'](_0x55505c)['then'](function(_0x2b21ba){return _0x2b21ba;});}return null;};}function removeEntity(_0x4fe004,_0x102c36){return function(_0x283c2b){if(_0x283c2b){return _0x283c2b[_0x1227('0x26')]()['then'](function(){_0x4fe004[_0x1227('0x1b')](0xcc)[_0x1227('0x1a')]();});}};}function handleEntityNotFound(_0xa1410f,_0x1ae66e){return function(_0x2daf84){if(!_0x2daf84){_0xa1410f[_0x1227('0x19')](0x194);}return _0x2daf84;};}function handleError(_0x3ec5bb,_0x23b47a){_0x23b47a=_0x23b47a||0x1f4;return function(_0x3c3fff){logger[_0x1227('0x27')](_0x3c3fff[_0x1227('0x28')]);if(_0x3c3fff['name']){delete _0x3c3fff[_0x1227('0x29')];}_0x3ec5bb['status'](_0x23b47a)['send'](_0x3c3fff);};}exports[_0x1227('0x2a')]=function(_0x43221c,_0x19123d){var _0x55ed92={},_0xc5fb40={},_0x44ddd8={'count':0x0,'rows':[]};var _0xdcd440=_[_0x1227('0x2b')](db[_0x1227('0x2c')][_0x1227('0x2d')],function(_0x437f9b){return{'name':_0x437f9b[_0x1227('0x2e')],'type':_0x437f9b[_0x1227('0x2f')][_0x1227('0x30')]};});_0xc5fb40['model']=_[_0x1227('0x2b')](_0xdcd440,_0x1227('0x29'));_0xc5fb40[_0x1227('0x31')]=_[_0x1227('0x32')](_0x43221c[_0x1227('0x31')]);_0xc5fb40[_0x1227('0x33')]=_[_0x1227('0x34')](_0xc5fb40[_0x1227('0x35')],_0xc5fb40[_0x1227('0x31')]);_0x55ed92[_0x1227('0x36')]=_[_0x1227('0x34')](_0xc5fb40[_0x1227('0x35')],qs['fields'](_0x43221c[_0x1227('0x31')][_0x1227('0x37')]));_0x55ed92[_0x1227('0x36')]=_0x55ed92['attributes'][_0x1227('0x38')]?_0x55ed92['attributes']:_0xc5fb40[_0x1227('0x35')];if(!_0x43221c['query'][_0x1227('0x39')]('nolimit')){_0x55ed92[_0x1227('0x1f')]=qs['limit'](_0x43221c['query'][_0x1227('0x1f')]);_0x55ed92[_0x1227('0x1d')]=qs[_0x1227('0x1d')](_0x43221c[_0x1227('0x31')]['offset']);}_0x55ed92[_0x1227('0x3a')]=qs[_0x1227('0x3b')](_0x43221c[_0x1227('0x31')][_0x1227('0x3b')]);_0x55ed92['where']=qs['filters'](_['pick'](_0x43221c[_0x1227('0x31')],_0xc5fb40['filters']),_0xdcd440);if(_0x43221c[_0x1227('0x31')]['filter']){_0x55ed92[_0x1227('0x3c')]=_[_0x1227('0x3d')](_0x55ed92[_0x1227('0x3c')],{'$or':_['map'](_0xdcd440,function(_0x2814d3){if(_0x2814d3[_0x1227('0x2f')]!==_0x1227('0x3e')){var _0x563c65={};_0x563c65[_0x2814d3[_0x1227('0x29')]]={'$like':'%'+_0x43221c[_0x1227('0x31')][_0x1227('0x3f')]+'%'};return _0x563c65;}})});}_0x55ed92=_[_0x1227('0x3d')]({},_0x55ed92,_0x43221c['options']);var _0x43a880={'where':_0x55ed92['where']};return db[_0x1227('0x2c')][_0x1227('0x20')](_0x43a880)[_0x1227('0x40')](function(_0x331389){_0x44ddd8['count']=_0x331389;if(_0x43221c[_0x1227('0x31')]['includeAll']){_0x55ed92[_0x1227('0x41')]=[{'all':!![]}];}return db[_0x1227('0x2c')][_0x1227('0x42')](_0x55ed92);})[_0x1227('0x40')](function(_0x4b38c0){_0x44ddd8[_0x1227('0x43')]=_0x4b38c0;return _0x44ddd8;})[_0x1227('0x40')](respondWithFilteredResult(_0x19123d,_0x55ed92))[_0x1227('0x44')](handleError(_0x19123d,null));};exports[_0x1227('0x45')]=function(_0x5ede31,_0x1a089b){var _0x3054a0={'raw':![],'where':{'id':_0x5ede31[_0x1227('0x46')]['id']}},_0xe6bbf6={};_0xe6bbf6[_0x1227('0x35')]=_['keys'](db[_0x1227('0x2c')]['rawAttributes']);_0xe6bbf6[_0x1227('0x31')]=_[_0x1227('0x32')](_0x5ede31[_0x1227('0x31')]);_0xe6bbf6[_0x1227('0x33')]=_['intersection'](_0xe6bbf6[_0x1227('0x35')],_0xe6bbf6[_0x1227('0x31')]);_0x3054a0['attributes']=_['intersection'](_0xe6bbf6[_0x1227('0x35')],qs[_0x1227('0x37')](_0x5ede31[_0x1227('0x31')][_0x1227('0x37')]));_0x3054a0[_0x1227('0x36')]=_0x3054a0[_0x1227('0x36')]['length']?_0x3054a0[_0x1227('0x36')]:_0xe6bbf6['model'];if(_0x5ede31[_0x1227('0x31')]['includeAll']){_0x3054a0['include']=[{'all':!![]}];}_0x3054a0=_[_0x1227('0x3d')]({},_0x3054a0,_0x5ede31[_0x1227('0x47')]);return db[_0x1227('0x2c')]['find'](_0x3054a0)[_0x1227('0x40')](handleEntityNotFound(_0x1a089b,null))[_0x1227('0x40')](respondWithResult(_0x1a089b,null))[_0x1227('0x44')](handleError(_0x1a089b,null));};exports[_0x1227('0x48')]=function(_0x1db415,_0x1102e2){return db[_0x1227('0x2c')][_0x1227('0x48')](_0x1db415['body'],{})[_0x1227('0x40')](respondWithResult(_0x1102e2,0xc9))['catch'](handleError(_0x1102e2,null));};exports[_0x1227('0x49')]=function(_0x156e3f,_0x2e26de){if(_0x156e3f[_0x1227('0x4a')]['id']){delete _0x156e3f['body']['id'];}return db[_0x1227('0x2c')][_0x1227('0x4b')]({'where':{'id':_0x156e3f[_0x1227('0x46')]['id']}})[_0x1227('0x40')](handleEntityNotFound(_0x2e26de,null))['then'](saveUpdates(_0x156e3f['body'],null))[_0x1227('0x40')](respondWithResult(_0x2e26de,null))[_0x1227('0x44')](handleError(_0x2e26de,null));};exports[_0x1227('0x26')]=function(_0x356d5c,_0xdd819e){return db[_0x1227('0x2c')][_0x1227('0x4b')]({'where':{'id':_0x356d5c[_0x1227('0x46')]['id']}})[_0x1227('0x40')](handleEntityNotFound(_0xdd819e,null))[_0x1227('0x40')](removeEntity(_0xdd819e,null))['catch'](handleError(_0xdd819e,null));};exports[_0x1227('0x4c')]=function(_0x3a8a50,_0x5819c7,_0x44e6fd){var _0x2171b5={};var _0xa988e5={};var _0x48b50d;var _0x1aeca7;return db[_0x1227('0x2c')]['findOne']({'where':{'id':_0x3a8a50[_0x1227('0x46')]['id']}})[_0x1227('0x40')](handleEntityNotFound(_0x5819c7,null))[_0x1227('0x40')](function(_0x33eb21){if(_0x33eb21){_0x48b50d=_0x33eb21;_0xa988e5[_0x1227('0x35')]=_[_0x1227('0x32')](db[_0x1227('0x4d')][_0x1227('0x2d')]);_0xa988e5[_0x1227('0x31')]=_[_0x1227('0x32')](_0x3a8a50[_0x1227('0x31')]);_0xa988e5[_0x1227('0x33')]=_[_0x1227('0x34')](_0xa988e5[_0x1227('0x35')],_0xa988e5[_0x1227('0x31')]);_0x2171b5['attributes']=_[_0x1227('0x34')](_0xa988e5[_0x1227('0x35')],qs[_0x1227('0x37')](_0x3a8a50[_0x1227('0x31')]['fields']));_0x2171b5[_0x1227('0x36')]=_0x2171b5['attributes']['length']?_0x2171b5[_0x1227('0x36')]:_0xa988e5[_0x1227('0x35')];_0x2171b5[_0x1227('0x3a')]=qs[_0x1227('0x3b')](_0x3a8a50[_0x1227('0x31')][_0x1227('0x3b')]);_0x2171b5['where']=qs[_0x1227('0x33')](_['pick'](_0x3a8a50[_0x1227('0x31')],_0xa988e5['filters']));if(_0x3a8a50[_0x1227('0x31')][_0x1227('0x3f')]){_0x2171b5['where']=_[_0x1227('0x3d')](_0x2171b5[_0x1227('0x3c')],{'$or':_[_0x1227('0x2b')](_0x2171b5[_0x1227('0x36')],function(_0x4351ef){var _0xc9f6f5={};_0xc9f6f5[_0x4351ef]={'$like':'%'+_0x3a8a50[_0x1227('0x31')][_0x1227('0x3f')]+'%'};return _0xc9f6f5;})});}_0x2171b5=_[_0x1227('0x3d')]({},_0x2171b5,_0x3a8a50[_0x1227('0x47')]);return _0x48b50d[_0x1227('0x4c')](_0x2171b5);}})[_0x1227('0x40')](function(_0x584dac){if(_0x584dac){_0x1aeca7=_0x584dac[_0x1227('0x38')];if(!_0x3a8a50['query'][_0x1227('0x39')](_0x1227('0x4e'))){_0x2171b5[_0x1227('0x1f')]=qs['limit'](_0x3a8a50[_0x1227('0x31')][_0x1227('0x1f')]);_0x2171b5[_0x1227('0x1d')]=qs['offset'](_0x3a8a50['query'][_0x1227('0x1d')]);}return _0x48b50d[_0x1227('0x4c')](_0x2171b5);}})[_0x1227('0x40')](function(_0x2bc454){if(_0x2bc454){return _0x2bc454?{'count':_0x1aeca7,'rows':_0x2bc454}:null;}})[_0x1227('0x40')](respondWithResult(_0x5819c7,null))[_0x1227('0x44')](handleError(_0x5819c7,null));};exports[_0x1227('0x4f')]=function(_0x2881e5,_0x42b0e8,_0x4107cf){var _0x7dbfcd={};var _0x4a8e79={};var _0x2f93ae;var _0x11ef74;return db[_0x1227('0x2c')][_0x1227('0x50')]({'where':{'id':_0x2881e5[_0x1227('0x46')]['id']}})[_0x1227('0x40')](handleEntityNotFound(_0x42b0e8,null))[_0x1227('0x40')](function(_0x323030){if(_0x323030){_0x2f93ae=_0x323030;_0x4a8e79['model']=_[_0x1227('0x32')](db['ZohoField']['rawAttributes']);_0x4a8e79['query']=_[_0x1227('0x32')](_0x2881e5[_0x1227('0x31')]);_0x4a8e79[_0x1227('0x33')]=_[_0x1227('0x34')](_0x4a8e79['model'],_0x4a8e79[_0x1227('0x31')]);_0x7dbfcd[_0x1227('0x36')]=_[_0x1227('0x34')](_0x4a8e79[_0x1227('0x35')],qs[_0x1227('0x37')](_0x2881e5['query'][_0x1227('0x37')]));_0x7dbfcd[_0x1227('0x36')]=_0x7dbfcd[_0x1227('0x36')]['length']?_0x7dbfcd[_0x1227('0x36')]:_0x4a8e79['model'];_0x7dbfcd['order']=qs[_0x1227('0x3b')](_0x2881e5[_0x1227('0x31')][_0x1227('0x3b')]);_0x7dbfcd[_0x1227('0x3c')]=qs['filters'](_[_0x1227('0x51')](_0x2881e5[_0x1227('0x31')],_0x4a8e79[_0x1227('0x33')]));if(_0x2881e5['query'][_0x1227('0x3f')]){_0x7dbfcd[_0x1227('0x3c')]=_[_0x1227('0x3d')](_0x7dbfcd[_0x1227('0x3c')],{'$or':_[_0x1227('0x2b')](_0x7dbfcd[_0x1227('0x36')],function(_0x1f9662){var _0x380e3d={};_0x380e3d[_0x1f9662]={'$like':'%'+_0x2881e5[_0x1227('0x31')][_0x1227('0x3f')]+'%'};return _0x380e3d;})});}_0x7dbfcd=_[_0x1227('0x3d')]({},_0x7dbfcd,_0x2881e5[_0x1227('0x47')]);return _0x2f93ae[_0x1227('0x4f')](_0x7dbfcd);}})[_0x1227('0x40')](function(_0x24f4bd){if(_0x24f4bd){_0x11ef74=_0x24f4bd['length'];if(!_0x2881e5[_0x1227('0x31')][_0x1227('0x39')](_0x1227('0x4e'))){_0x7dbfcd[_0x1227('0x1f')]=qs[_0x1227('0x1f')](_0x2881e5[_0x1227('0x31')][_0x1227('0x1f')]);_0x7dbfcd['offset']=qs[_0x1227('0x1d')](_0x2881e5[_0x1227('0x31')][_0x1227('0x1d')]);}return _0x2f93ae['getSubjects'](_0x7dbfcd);}})['then'](function(_0x4180e6){if(_0x4180e6){return _0x4180e6?{'count':_0x11ef74,'rows':_0x4180e6}:null;}})[_0x1227('0x40')](respondWithResult(_0x42b0e8,null))[_0x1227('0x44')](handleError(_0x42b0e8,null));};exports[_0x1227('0x52')]=function(_0x4274ea,_0x4bdaeb,_0x36edd4){var _0x1afca0={};var _0x138d0a={};var _0x3f61ba;var _0xcf7083;return db[_0x1227('0x2c')][_0x1227('0x50')]({'where':{'id':_0x4274ea['params']['id']}})['then'](handleEntityNotFound(_0x4bdaeb,null))[_0x1227('0x40')](function(_0x33b6fb){if(_0x33b6fb){_0x3f61ba=_0x33b6fb;_0x138d0a[_0x1227('0x35')]=_[_0x1227('0x32')](db[_0x1227('0x4d')][_0x1227('0x2d')]);_0x138d0a['query']=_['keys'](_0x4274ea[_0x1227('0x31')]);_0x138d0a[_0x1227('0x33')]=_['intersection'](_0x138d0a[_0x1227('0x35')],_0x138d0a['query']);_0x1afca0['attributes']=_[_0x1227('0x34')](_0x138d0a[_0x1227('0x35')],qs[_0x1227('0x37')](_0x4274ea[_0x1227('0x31')][_0x1227('0x37')]));_0x1afca0[_0x1227('0x36')]=_0x1afca0[_0x1227('0x36')][_0x1227('0x38')]?_0x1afca0['attributes']:_0x138d0a[_0x1227('0x35')];_0x1afca0[_0x1227('0x3a')]=qs['sort'](_0x4274ea['query'][_0x1227('0x3b')]);_0x1afca0[_0x1227('0x3c')]=qs[_0x1227('0x33')](_['pick'](_0x4274ea[_0x1227('0x31')],_0x138d0a[_0x1227('0x33')]));if(_0x4274ea['query'][_0x1227('0x3f')]){_0x1afca0[_0x1227('0x3c')]=_['merge'](_0x1afca0[_0x1227('0x3c')],{'$or':_['map'](_0x1afca0[_0x1227('0x36')],function(_0x3147e9){var _0x4f4457={};_0x4f4457[_0x3147e9]={'$like':'%'+_0x4274ea[_0x1227('0x31')][_0x1227('0x3f')]+'%'};return _0x4f4457;})});}_0x1afca0=_[_0x1227('0x3d')]({},_0x1afca0,_0x4274ea[_0x1227('0x47')]);return _0x3f61ba['getDescriptions'](_0x1afca0);}})[_0x1227('0x40')](function(_0x16fd2b){if(_0x16fd2b){_0xcf7083=_0x16fd2b['length'];if(!_0x4274ea[_0x1227('0x31')][_0x1227('0x39')]('nolimit')){_0x1afca0['limit']=qs[_0x1227('0x1f')](_0x4274ea[_0x1227('0x31')][_0x1227('0x1f')]);_0x1afca0[_0x1227('0x1d')]=qs[_0x1227('0x1d')](_0x4274ea['query'][_0x1227('0x1d')]);}return _0x3f61ba[_0x1227('0x52')](_0x1afca0);}})[_0x1227('0x40')](function(_0x48dbe6){if(_0x48dbe6){return _0x48dbe6?{'count':_0xcf7083,'rows':_0x48dbe6}:null;}})[_0x1227('0x40')](respondWithResult(_0x4bdaeb,null))[_0x1227('0x44')](handleError(_0x4bdaeb,null));}; \ No newline at end of file +var _0x89bd=['create','body','getFields','findOne','ZohoField','length','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','ZohoConfiguration','findAll','rows','catch','show','params','keys','options','find'];(function(_0xdec007,_0x300f77){var _0x28d549=function(_0x28accc){while(--_0x28accc){_0xdec007['push'](_0xdec007['shift']());}};_0x28d549(++_0x300f77);}(_0x89bd,0x151));var _0xd89b=function(_0x216e07,_0x59581a){_0x216e07=_0x216e07-0x0;var _0x73b29f=_0x89bd[_0x216e07];return _0x73b29f;};'use strict';var emlformat=require(_0xd89b('0x0'));var rimraf=require(_0xd89b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd89b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd89b('0x3'));var Mustache=require(_0xd89b('0x4'));var util=require('util');var path=require(_0xd89b('0x5'));var sox=require('sox');var csv=require(_0xd89b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd89b('0x7'));var _=require(_0xd89b('0x8'));var squel=require(_0xd89b('0x9'));var crypto=require(_0xd89b('0xa'));var jsforce=require(_0xd89b('0xb'));var deskjs=require(_0xd89b('0xc'));var toCsv=require(_0xd89b('0x6'));var querystring=require(_0xd89b('0xd'));var Papa=require(_0xd89b('0xe'));var Redis=require(_0xd89b('0xf'));var authService=require(_0xd89b('0x10'));var qs=require(_0xd89b('0x11'));var as=require(_0xd89b('0x12'));var hardwareService=require(_0xd89b('0x13'));var logger=require(_0xd89b('0x14'))(_0xd89b('0x15'));var utils=require(_0xd89b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd89b('0x17'));var db=require(_0xd89b('0x18'))['db'];function respondWithStatusCode(_0x1dd8f8,_0x386949){_0x386949=_0x386949||0xcc;return function(_0x1e5e9a){if(_0x1e5e9a){return _0x1dd8f8[_0xd89b('0x19')](_0x386949);}return _0x1dd8f8['status'](_0x386949)['end']();};}function respondWithResult(_0x4a03aa,_0x202e32){_0x202e32=_0x202e32||0xc8;return function(_0x12c7b1){if(_0x12c7b1){return _0x4a03aa[_0xd89b('0x1a')](_0x202e32)[_0xd89b('0x1b')](_0x12c7b1);}};}function respondWithFilteredResult(_0x26847e,_0x206e62){return function(_0x2f7b7c){if(_0x2f7b7c){var _0x5bea73=typeof _0x206e62[_0xd89b('0x1c')]===_0xd89b('0x1d')&&typeof _0x206e62['limit']===_0xd89b('0x1d');var _0x1e1a28=_0x2f7b7c[_0xd89b('0x1e')];var _0x4c675d=_0x5bea73?0x0:_0x206e62[_0xd89b('0x1c')];var _0x48ec65=_0x5bea73?_0x2f7b7c['count']:_0x206e62[_0xd89b('0x1c')]+_0x206e62[_0xd89b('0x1f')];var _0x4652e0;if(_0x48ec65>=_0x1e1a28){_0x48ec65=_0x1e1a28;_0x4652e0=0xc8;}else{_0x4652e0=0xce;}_0x26847e[_0xd89b('0x1a')](_0x4652e0);return _0x26847e[_0xd89b('0x20')](_0xd89b('0x21'),_0x4c675d+'-'+_0x48ec65+'/'+_0x1e1a28)['json'](_0x2f7b7c);}return null;};}function patchUpdates(_0x2cbb72){return function(_0x182b48){try{jsonpatch[_0xd89b('0x22')](_0x182b48,_0x2cbb72,!![]);}catch(_0x241d70){return BPromise[_0xd89b('0x23')](_0x241d70);}return _0x182b48[_0xd89b('0x24')]();};}function saveUpdates(_0x1dc577,_0x4e7237){return function(_0x22b149){if(_0x22b149){return _0x22b149[_0xd89b('0x25')](_0x1dc577)[_0xd89b('0x26')](function(_0x33d8d9){return _0x33d8d9;});}return null;};}function removeEntity(_0xa82aa5,_0x3bdf0f){return function(_0x349464){if(_0x349464){return _0x349464[_0xd89b('0x27')]()['then'](function(){_0xa82aa5[_0xd89b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x535c07,_0x1dd94c){return function(_0x31e886){if(!_0x31e886){_0x535c07[_0xd89b('0x19')](0x194);}return _0x31e886;};}function handleError(_0x565642,_0x57fbc7){_0x57fbc7=_0x57fbc7||0x1f4;return function(_0x3abde2){logger['error'](_0x3abde2[_0xd89b('0x28')]);if(_0x3abde2[_0xd89b('0x29')]){delete _0x3abde2[_0xd89b('0x29')];}_0x565642['status'](_0x57fbc7)[_0xd89b('0x2a')](_0x3abde2);};}exports['index']=function(_0x3ebedf,_0x18b02c){var _0x42d71f={},_0x160366={},_0x23fe6f={'count':0x0,'rows':[]};var _0x143f38=_['map'](db['ZohoConfiguration'][_0xd89b('0x2b')],function(_0x207cfe){return{'name':_0x207cfe[_0xd89b('0x2c')],'type':_0x207cfe['type'][_0xd89b('0x2d')]};});_0x160366[_0xd89b('0x2e')]=_[_0xd89b('0x2f')](_0x143f38,'name');_0x160366[_0xd89b('0x30')]=_['keys'](_0x3ebedf[_0xd89b('0x30')]);_0x160366[_0xd89b('0x31')]=_[_0xd89b('0x32')](_0x160366[_0xd89b('0x2e')],_0x160366[_0xd89b('0x30')]);_0x42d71f[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x160366[_0xd89b('0x2e')],qs[_0xd89b('0x34')](_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x34')]));_0x42d71f[_0xd89b('0x33')]=_0x42d71f[_0xd89b('0x33')]['length']?_0x42d71f[_0xd89b('0x33')]:_0x160366['model'];if(!_0x3ebedf[_0xd89b('0x30')]['hasOwnProperty'](_0xd89b('0x35'))){_0x42d71f['limit']=qs[_0xd89b('0x1f')](_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x1f')]);_0x42d71f[_0xd89b('0x1c')]=qs[_0xd89b('0x1c')](_0x3ebedf[_0xd89b('0x30')]['offset']);}_0x42d71f[_0xd89b('0x36')]=qs[_0xd89b('0x37')](_0x3ebedf[_0xd89b('0x30')]['sort']);_0x42d71f['where']=qs[_0xd89b('0x31')](_[_0xd89b('0x38')](_0x3ebedf[_0xd89b('0x30')],_0x160366[_0xd89b('0x31')]),_0x143f38);if(_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x39')]){_0x42d71f[_0xd89b('0x3a')]=_[_0xd89b('0x3b')](_0x42d71f[_0xd89b('0x3a')],{'$or':_[_0xd89b('0x2f')](_0x143f38,function(_0x38afc1){if(_0x38afc1[_0xd89b('0x3c')]!==_0xd89b('0x3d')){var _0x3e4215={};_0x3e4215[_0x38afc1[_0xd89b('0x29')]]={'$like':'%'+_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x39')]+'%'};return _0x3e4215;}})});}_0x42d71f=_['merge']({},_0x42d71f,_0x3ebedf['options']);var _0xe5c739={'where':_0x42d71f[_0xd89b('0x3a')]};return db['ZohoConfiguration']['count'](_0xe5c739)['then'](function(_0x1f1e85){_0x23fe6f[_0xd89b('0x1e')]=_0x1f1e85;if(_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x3e')]){_0x42d71f[_0xd89b('0x3f')]=[{'all':!![]}];}return db[_0xd89b('0x40')][_0xd89b('0x41')](_0x42d71f);})['then'](function(_0x51e051){_0x23fe6f[_0xd89b('0x42')]=_0x51e051;return _0x23fe6f;})['then'](respondWithFilteredResult(_0x18b02c,_0x42d71f))[_0xd89b('0x43')](handleError(_0x18b02c,null));};exports[_0xd89b('0x44')]=function(_0x538738,_0x57f2a4){var _0x43b701={'raw':![],'where':{'id':_0x538738[_0xd89b('0x45')]['id']}},_0x1eee29={};_0x1eee29[_0xd89b('0x2e')]=_[_0xd89b('0x46')](db[_0xd89b('0x40')]['rawAttributes']);_0x1eee29[_0xd89b('0x30')]=_[_0xd89b('0x46')](_0x538738[_0xd89b('0x30')]);_0x1eee29[_0xd89b('0x31')]=_[_0xd89b('0x32')](_0x1eee29[_0xd89b('0x2e')],_0x1eee29[_0xd89b('0x30')]);_0x43b701[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x1eee29['model'],qs[_0xd89b('0x34')](_0x538738[_0xd89b('0x30')][_0xd89b('0x34')]));_0x43b701[_0xd89b('0x33')]=_0x43b701[_0xd89b('0x33')]['length']?_0x43b701[_0xd89b('0x33')]:_0x1eee29[_0xd89b('0x2e')];if(_0x538738[_0xd89b('0x30')]['includeAll']){_0x43b701[_0xd89b('0x3f')]=[{'all':!![]}];}_0x43b701=_[_0xd89b('0x3b')]({},_0x43b701,_0x538738[_0xd89b('0x47')]);return db[_0xd89b('0x40')][_0xd89b('0x48')](_0x43b701)[_0xd89b('0x26')](handleEntityNotFound(_0x57f2a4,null))[_0xd89b('0x26')](respondWithResult(_0x57f2a4,null))[_0xd89b('0x43')](handleError(_0x57f2a4,null));};exports[_0xd89b('0x49')]=function(_0x26e309,_0x14aa0a){return db[_0xd89b('0x40')]['create'](_0x26e309[_0xd89b('0x4a')],{})[_0xd89b('0x26')](respondWithResult(_0x14aa0a,0xc9))[_0xd89b('0x43')](handleError(_0x14aa0a,null));};exports['update']=function(_0x5cd1f6,_0x300e25){if(_0x5cd1f6[_0xd89b('0x4a')]['id']){delete _0x5cd1f6[_0xd89b('0x4a')]['id'];}return db[_0xd89b('0x40')][_0xd89b('0x48')]({'where':{'id':_0x5cd1f6[_0xd89b('0x45')]['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x300e25,null))['then'](saveUpdates(_0x5cd1f6[_0xd89b('0x4a')],null))[_0xd89b('0x26')](respondWithResult(_0x300e25,null))[_0xd89b('0x43')](handleError(_0x300e25,null));};exports[_0xd89b('0x27')]=function(_0x2edccf,_0x870ac3){return db[_0xd89b('0x40')][_0xd89b('0x48')]({'where':{'id':_0x2edccf[_0xd89b('0x45')]['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x870ac3,null))['then'](removeEntity(_0x870ac3,null))['catch'](handleError(_0x870ac3,null));};exports[_0xd89b('0x4b')]=function(_0x81d382,_0x194297,_0x2f9928){var _0x4acec4={};var _0x4b168c={};var _0x306dec;var _0x34cc56;return db['ZohoConfiguration'][_0xd89b('0x4c')]({'where':{'id':_0x81d382['params']['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x194297,null))['then'](function(_0x4395e6){if(_0x4395e6){_0x306dec=_0x4395e6;_0x4b168c[_0xd89b('0x2e')]=_['keys'](db[_0xd89b('0x4d')][_0xd89b('0x2b')]);_0x4b168c[_0xd89b('0x30')]=_[_0xd89b('0x46')](_0x81d382[_0xd89b('0x30')]);_0x4b168c[_0xd89b('0x31')]=_['intersection'](_0x4b168c[_0xd89b('0x2e')],_0x4b168c['query']);_0x4acec4[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x4b168c[_0xd89b('0x2e')],qs[_0xd89b('0x34')](_0x81d382[_0xd89b('0x30')][_0xd89b('0x34')]));_0x4acec4[_0xd89b('0x33')]=_0x4acec4['attributes'][_0xd89b('0x4e')]?_0x4acec4[_0xd89b('0x33')]:_0x4b168c[_0xd89b('0x2e')];_0x4acec4['order']=qs[_0xd89b('0x37')](_0x81d382['query']['sort']);_0x4acec4[_0xd89b('0x3a')]=qs[_0xd89b('0x31')](_['pick'](_0x81d382['query'],_0x4b168c[_0xd89b('0x31')]));if(_0x81d382[_0xd89b('0x30')][_0xd89b('0x39')]){_0x4acec4[_0xd89b('0x3a')]=_['merge'](_0x4acec4[_0xd89b('0x3a')],{'$or':_['map'](_0x4acec4['attributes'],function(_0x335e25){var _0x4d45bb={};_0x4d45bb[_0x335e25]={'$like':'%'+_0x81d382[_0xd89b('0x30')]['filter']+'%'};return _0x4d45bb;})});}_0x4acec4=_['merge']({},_0x4acec4,_0x81d382[_0xd89b('0x47')]);return _0x306dec[_0xd89b('0x4b')](_0x4acec4);}})[_0xd89b('0x26')](function(_0x1e599e){if(_0x1e599e){_0x34cc56=_0x1e599e[_0xd89b('0x4e')];if(!_0x81d382['query']['hasOwnProperty'](_0xd89b('0x35'))){_0x4acec4[_0xd89b('0x1f')]=qs[_0xd89b('0x1f')](_0x81d382[_0xd89b('0x30')][_0xd89b('0x1f')]);_0x4acec4['offset']=qs[_0xd89b('0x1c')](_0x81d382[_0xd89b('0x30')][_0xd89b('0x1c')]);}return _0x306dec[_0xd89b('0x4b')](_0x4acec4);}})[_0xd89b('0x26')](function(_0x170dfc){if(_0x170dfc){return _0x170dfc?{'count':_0x34cc56,'rows':_0x170dfc}:null;}})[_0xd89b('0x26')](respondWithResult(_0x194297,null))[_0xd89b('0x43')](handleError(_0x194297,null));};exports[_0xd89b('0x4f')]=function(_0x50065d,_0x4df7e9,_0x3bc755){var _0x42112f={};var _0x398d7f={};var _0x499072;var _0x7b36b4;return db[_0xd89b('0x40')]['findOne']({'where':{'id':_0x50065d[_0xd89b('0x45')]['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x4df7e9,null))['then'](function(_0x372320){if(_0x372320){_0x499072=_0x372320;_0x398d7f[_0xd89b('0x2e')]=_['keys'](db['ZohoField'][_0xd89b('0x2b')]);_0x398d7f[_0xd89b('0x30')]=_['keys'](_0x50065d[_0xd89b('0x30')]);_0x398d7f['filters']=_['intersection'](_0x398d7f[_0xd89b('0x2e')],_0x398d7f[_0xd89b('0x30')]);_0x42112f['attributes']=_['intersection'](_0x398d7f[_0xd89b('0x2e')],qs['fields'](_0x50065d[_0xd89b('0x30')][_0xd89b('0x34')]));_0x42112f[_0xd89b('0x33')]=_0x42112f[_0xd89b('0x33')]['length']?_0x42112f[_0xd89b('0x33')]:_0x398d7f['model'];_0x42112f['order']=qs[_0xd89b('0x37')](_0x50065d['query'][_0xd89b('0x37')]);_0x42112f[_0xd89b('0x3a')]=qs['filters'](_[_0xd89b('0x38')](_0x50065d[_0xd89b('0x30')],_0x398d7f['filters']));if(_0x50065d[_0xd89b('0x30')][_0xd89b('0x39')]){_0x42112f['where']=_[_0xd89b('0x3b')](_0x42112f[_0xd89b('0x3a')],{'$or':_[_0xd89b('0x2f')](_0x42112f['attributes'],function(_0x5c7668){var _0x39c387={};_0x39c387[_0x5c7668]={'$like':'%'+_0x50065d[_0xd89b('0x30')][_0xd89b('0x39')]+'%'};return _0x39c387;})});}_0x42112f=_['merge']({},_0x42112f,_0x50065d[_0xd89b('0x47')]);return _0x499072['getSubjects'](_0x42112f);}})[_0xd89b('0x26')](function(_0x5b454e){if(_0x5b454e){_0x7b36b4=_0x5b454e['length'];if(!_0x50065d[_0xd89b('0x30')][_0xd89b('0x50')]('nolimit')){_0x42112f[_0xd89b('0x1f')]=qs[_0xd89b('0x1f')](_0x50065d[_0xd89b('0x30')][_0xd89b('0x1f')]);_0x42112f[_0xd89b('0x1c')]=qs['offset'](_0x50065d['query'][_0xd89b('0x1c')]);}return _0x499072['getSubjects'](_0x42112f);}})[_0xd89b('0x26')](function(_0x4e1679){if(_0x4e1679){return _0x4e1679?{'count':_0x7b36b4,'rows':_0x4e1679}:null;}})[_0xd89b('0x26')](respondWithResult(_0x4df7e9,null))['catch'](handleError(_0x4df7e9,null));};exports['getDescriptions']=function(_0x319b74,_0x5b3014,_0x15679d){var _0x259f8a={};var _0x2e4243={};var _0x30bdf3;var _0x503388;return db[_0xd89b('0x40')]['findOne']({'where':{'id':_0x319b74['params']['id']}})['then'](handleEntityNotFound(_0x5b3014,null))[_0xd89b('0x26')](function(_0x2929c9){if(_0x2929c9){_0x30bdf3=_0x2929c9;_0x2e4243[_0xd89b('0x2e')]=_[_0xd89b('0x46')](db[_0xd89b('0x4d')][_0xd89b('0x2b')]);_0x2e4243[_0xd89b('0x30')]=_[_0xd89b('0x46')](_0x319b74[_0xd89b('0x30')]);_0x2e4243[_0xd89b('0x31')]=_[_0xd89b('0x32')](_0x2e4243[_0xd89b('0x2e')],_0x2e4243[_0xd89b('0x30')]);_0x259f8a[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x2e4243[_0xd89b('0x2e')],qs[_0xd89b('0x34')](_0x319b74[_0xd89b('0x30')][_0xd89b('0x34')]));_0x259f8a[_0xd89b('0x33')]=_0x259f8a[_0xd89b('0x33')][_0xd89b('0x4e')]?_0x259f8a[_0xd89b('0x33')]:_0x2e4243[_0xd89b('0x2e')];_0x259f8a[_0xd89b('0x36')]=qs['sort'](_0x319b74['query']['sort']);_0x259f8a['where']=qs[_0xd89b('0x31')](_[_0xd89b('0x38')](_0x319b74['query'],_0x2e4243[_0xd89b('0x31')]));if(_0x319b74['query'][_0xd89b('0x39')]){_0x259f8a['where']=_[_0xd89b('0x3b')](_0x259f8a['where'],{'$or':_[_0xd89b('0x2f')](_0x259f8a[_0xd89b('0x33')],function(_0x40f8a8){var _0x1324a7={};_0x1324a7[_0x40f8a8]={'$like':'%'+_0x319b74['query']['filter']+'%'};return _0x1324a7;})});}_0x259f8a=_[_0xd89b('0x3b')]({},_0x259f8a,_0x319b74[_0xd89b('0x47')]);return _0x30bdf3['getDescriptions'](_0x259f8a);}})[_0xd89b('0x26')](function(_0x46de91){if(_0x46de91){_0x503388=_0x46de91[_0xd89b('0x4e')];if(!_0x319b74[_0xd89b('0x30')]['hasOwnProperty'](_0xd89b('0x35'))){_0x259f8a[_0xd89b('0x1f')]=qs[_0xd89b('0x1f')](_0x319b74[_0xd89b('0x30')]['limit']);_0x259f8a[_0xd89b('0x1c')]=qs[_0xd89b('0x1c')](_0x319b74[_0xd89b('0x30')][_0xd89b('0x1c')]);}return _0x30bdf3[_0xd89b('0x51')](_0x259f8a);}})[_0xd89b('0x26')](function(_0x314824){if(_0x314824){return _0x314824?{'count':_0x503388,'rows':_0x314824}:null;}})[_0xd89b('0x26')](respondWithResult(_0x5b3014,null))[_0xd89b('0x43')](handleError(_0x5b3014,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 4bdcc6e..7426fdd 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f4c=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x2c2358,_0x9b0f52){var _0x5b98b2=function(_0x34bb91){while(--_0x34bb91){_0x2c2358['push'](_0x2c2358['shift']());}};_0x5b98b2(++_0x9b0f52);}(_0x3f4c,0x121));var _0xc3f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f4c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc3f4('0x0'));var util=require(_0xc3f4('0x1'));var logger=require(_0xc3f4('0x2'))(_0xc3f4('0x3'));var moment=require(_0xc3f4('0x4'));var BPromise=require(_0xc3f4('0x5'));var rp=require(_0xc3f4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3f4('0x7'));var config=require(_0xc3f4('0x8'));var attributes=require(_0xc3f4('0x9'));module[_0xc3f4('0xa')]=function(_0x4242e0,_0x53eb45){return _0x4242e0['define']('ZohoConfiguration',attributes,{'tableName':_0xc3f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x518a=['moment','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x518a,0xec));var _0xa518=function(_0x1a94db,_0x51850b){_0x1a94db=_0x1a94db-0x0;var _0x4890da=_0x518a[_0x1a94db];return _0x4890da;};'use strict';var _=require(_0xa518('0x0'));var util=require(_0xa518('0x1'));var logger=require(_0xa518('0x2'))(_0xa518('0x3'));var moment=require(_0xa518('0x4'));var BPromise=require('bluebird');var rp=require(_0xa518('0x5'));var fs=require('fs');var path=require(_0xa518('0x6'));var rimraf=require('rimraf');var config=require(_0xa518('0x7'));var attributes=require(_0xa518('0x8'));module[_0xa518('0x9')]=function(_0x493abf,_0x57d199){return _0x493abf[_0xa518('0xa')]('ZohoConfiguration',attributes,{'tableName':_0xa518('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 8aa7b3e..69b6b23 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc86d=['../../config/environment','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4700a1,_0x5c3cf8){var _0x121ab9=function(_0x718dd6){while(--_0x718dd6){_0x4700a1['push'](_0x4700a1['shift']());}};_0x121ab9(++_0x5c3cf8);}(_0xc86d,0x1da));var _0xdc86=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xc86d[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xdc86('0x0'));var util=require(_0xdc86('0x1'));var moment=require(_0xdc86('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc86('0x3'));var fs=require('fs');var Redis=require(_0xdc86('0x4'));var db=require(_0xdc86('0x5'))['db'];var utils=require(_0xdc86('0x6'));var logger=require(_0xdc86('0x7'))(_0xdc86('0x8'));var config=require(_0xdc86('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc86('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe84faa,_0x1d6f98,_0x119772){return new BPromise(function(_0x2c161c,_0x49f6a2){return client['request'](_0xe84faa,_0x119772)[_0xdc86('0xb')](function(_0x41f158){logger['info'](_0xdc86('0xc'),_0x1d6f98,_0xdc86('0xd'));logger[_0xdc86('0xe')](_0xdc86('0xf'),_0x1d6f98,_0xdc86('0xd'),JSON['stringify'](_0x41f158));if(_0x41f158[_0xdc86('0x10')]){if(_0x41f158['error'][_0xdc86('0x11')]===0x1f4){logger[_0xdc86('0x10')](_0xdc86('0xc'),_0x1d6f98,_0x41f158['error'][_0xdc86('0x12')]);return _0x49f6a2(_0x41f158[_0xdc86('0x10')][_0xdc86('0x12')]);}logger[_0xdc86('0x10')](_0xdc86('0xc'),_0x1d6f98,_0x41f158[_0xdc86('0x10')][_0xdc86('0x12')]);return _0x2c161c(_0x41f158[_0xdc86('0x10')]['message']);}else{logger[_0xdc86('0x13')](_0xdc86('0xc'),_0x1d6f98,_0xdc86('0xd'));_0x2c161c(_0x41f158['result'][_0xdc86('0x12')]);}})[_0xdc86('0x14')](function(_0x2b8662){logger[_0xdc86('0x10')](_0xdc86('0xc'),_0x1d6f98,_0x2b8662);_0x49f6a2(_0x2b8662);});});} \ No newline at end of file +var _0xcf47=['info','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x20a92c,_0x1b88aa){var _0x3e756f=function(_0x1df598){while(--_0x1df598){_0x20a92c['push'](_0x20a92c['shift']());}};_0x3e756f(++_0x1b88aa);}(_0xcf47,0xef));var _0x7cf4=function(_0xb227fc,_0x39dede){_0xb227fc=_0xb227fc-0x0;var _0x51096f=_0xcf47[_0xb227fc];return _0x51096f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7cf4('0x0'));var rs=require(_0x7cf4('0x1'));var fs=require('fs');var Redis=require(_0x7cf4('0x2'));var db=require(_0x7cf4('0x3'))['db'];var utils=require(_0x7cf4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7cf4('0x5'));var jayson=require(_0x7cf4('0x6'));var client=jayson[_0x7cf4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541c28,_0x218c96,_0x53c9a0){return new BPromise(function(_0x3b73f9,_0x806f13){return client[_0x7cf4('0x8')](_0x541c28,_0x53c9a0)['then'](function(_0x48aebe){logger['info'](_0x7cf4('0x9'),_0x218c96,_0x7cf4('0xa'));logger[_0x7cf4('0xb')](_0x7cf4('0xc'),_0x218c96,_0x7cf4('0xa'),JSON[_0x7cf4('0xd')](_0x48aebe));if(_0x48aebe[_0x7cf4('0xe')]){if(_0x48aebe[_0x7cf4('0xe')]['code']===0x1f4){logger[_0x7cf4('0xe')](_0x7cf4('0x9'),_0x218c96,_0x48aebe['error'][_0x7cf4('0xf')]);return _0x806f13(_0x48aebe[_0x7cf4('0xe')][_0x7cf4('0xf')]);}logger[_0x7cf4('0xe')](_0x7cf4('0x9'),_0x218c96,_0x48aebe[_0x7cf4('0xe')][_0x7cf4('0xf')]);return _0x3b73f9(_0x48aebe[_0x7cf4('0xe')][_0x7cf4('0xf')]);}else{logger[_0x7cf4('0x10')](_0x7cf4('0x9'),_0x218c96,_0x7cf4('0xa'));_0x3b73f9(_0x48aebe['result'][_0x7cf4('0xf')]);}})['catch'](function(_0x164435){logger[_0x7cf4('0xe')](_0x7cf4('0x9'),_0x218c96,_0x164435);_0x806f13(_0x164435);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 24c7773..2d75a0d 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x293d=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3ea81d,_0x4c5b1a){var _0x1ed489=function(_0xf4198e){while(--_0xf4198e){_0x3ea81d['push'](_0x3ea81d['shift']());}};_0x1ed489(++_0x4c5b1a);}(_0x293d,0x8c));var _0xd293=function(_0x4fb4ba,_0x1ac856){_0x4fb4ba=_0x4fb4ba-0x0;var _0x5f02c0=_0x293d[_0x4fb4ba];return _0x5f02c0;};'use strict';var multer=require('multer');var util=require(_0xd293('0x0'));var path=require(_0xd293('0x1'));var timeout=require(_0xd293('0x2'));var express=require(_0xd293('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd293('0x4'));var config=require(_0xd293('0x5'));var controller=require(_0xd293('0x6'));router[_0xd293('0x7')]('/',auth[_0xd293('0x8')](),controller['index']);router[_0xd293('0x7')]('/:id',auth[_0xd293('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd293('0x9')]);router[_0xd293('0xa')](_0xd293('0xb'),auth[_0xd293('0x8')](),controller[_0xd293('0xc')]);router[_0xd293('0xd')](_0xd293('0xb'),auth['isAuthenticated'](),controller[_0xd293('0xe')]);module[_0xd293('0xf')]=router; \ No newline at end of file +var _0x74f1=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x1e6346,_0x57ccbd){var _0x770c06=function(_0x4a9aa9){while(--_0x4a9aa9){_0x1e6346['push'](_0x1e6346['shift']());}};_0x770c06(++_0x57ccbd);}(_0x74f1,0x66));var _0x174f=function(_0x306646,_0xdc2e1b){_0x306646=_0x306646-0x0;var _0x40bd8d=_0x74f1[_0x306646];return _0x40bd8d;};'use strict';var multer=require(_0x174f('0x0'));var util=require('util');var path=require(_0x174f('0x1'));var timeout=require(_0x174f('0x2'));var express=require('express');var router=express[_0x174f('0x3')]();var fs_extra=require(_0x174f('0x4'));var auth=require(_0x174f('0x5'));var interaction=require(_0x174f('0x6'));var config=require('../../config/environment');var controller=require(_0x174f('0x7'));router[_0x174f('0x8')]('/',auth[_0x174f('0x9')](),controller[_0x174f('0xa')]);router[_0x174f('0x8')](_0x174f('0xb'),auth[_0x174f('0x9')](),controller[_0x174f('0xc')]);router[_0x174f('0xd')]('/',auth[_0x174f('0x9')](),controller[_0x174f('0xe')]);router[_0x174f('0xf')](_0x174f('0xb'),auth[_0x174f('0x9')](),controller['update']);router[_0x174f('0x10')](_0x174f('0xb'),auth[_0x174f('0x9')](),controller[_0x174f('0x11')]);module[_0x174f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ef11d28..f946756 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbc5=['picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x39cb93,_0x3e3503){var _0x76b144=function(_0x77f1ef){while(--_0x77f1ef){_0x39cb93['push'](_0x39cb93['shift']());}};_0x76b144(++_0x3e3503);}(_0xbbc5,0xc7));var _0x5bbc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbbc5[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5bbc('0x0')](_0x5bbc('0x1'),_0x5bbc('0x2'),_0x5bbc('0x3'),'keyValue',_0x5bbc('0x4')),'defaultValue':_0x5bbc('0x1')},'content':{'type':Sequelize[_0x5bbc('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5bbc('0x0')](_0x5bbc('0x1'),_0x5bbc('0x2'),_0x5bbc('0x3'))},'keyContent':{'type':Sequelize[_0x5bbc('0x5')]},'idField':{'type':Sequelize[_0x5bbc('0x5')]},'nameField':{'type':Sequelize[_0x5bbc('0x5')]},'customField':{'type':Sequelize[_0x5bbc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9eec=['string','variable','keyValue','picklist','STRING','exports','ENUM'];(function(_0x12a586,_0x119c7b){var _0x50cbec=function(_0x552662){while(--_0x552662){_0x12a586['push'](_0x12a586['shift']());}};_0x50cbec(++_0x119c7b);}(_0x9eec,0xec));var _0xc9ee=function(_0x35d453,_0x4e7b98){_0x35d453=_0x35d453-0x0;var _0x370083=_0x9eec[_0x35d453];return _0x370083;};'use strict';var Sequelize=require('sequelize');module[_0xc9ee('0x0')]={'type':{'type':Sequelize[_0xc9ee('0x1')](_0xc9ee('0x2'),_0xc9ee('0x3'),'customVariable',_0xc9ee('0x4'),_0xc9ee('0x5')),'defaultValue':_0xc9ee('0x2')},'content':{'type':Sequelize[_0xc9ee('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc9ee('0x1')](_0xc9ee('0x2'),_0xc9ee('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc9ee('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc9ee('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9ee('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 3fc4e3d..9ef46c0 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6625=['VIRTUAL','options','where','count','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','end','error','name','send','map','ZohoField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge'];(function(_0xc4f500,_0x5737c0){var _0xf124e5=function(_0x2116c8){while(--_0x2116c8){_0xc4f500['push'](_0xc4f500['shift']());}};_0xf124e5(++_0x5737c0);}(_0x6625,0x141));var _0x5662=function(_0xf85511,_0x546f78){_0xf85511=_0xf85511-0x0;var _0x43acdd=_0x6625[_0xf85511];return _0x43acdd;};'use strict';var emlformat=require(_0x5662('0x0'));var rimraf=require(_0x5662('0x1'));var zipdir=require(_0x5662('0x2'));var jsonpatch=require(_0x5662('0x3'));var rp=require(_0x5662('0x4'));var moment=require(_0x5662('0x5'));var BPromise=require(_0x5662('0x6'));var Mustache=require(_0x5662('0x7'));var util=require(_0x5662('0x8'));var path=require(_0x5662('0x9'));var sox=require(_0x5662('0xa'));var csv=require(_0x5662('0xb'));var ejs=require(_0x5662('0xc'));var fs=require('fs');var fs_extra=require(_0x5662('0xd'));var _=require(_0x5662('0xe'));var squel=require('squel');var crypto=require(_0x5662('0xf'));var jsforce=require(_0x5662('0x10'));var deskjs=require(_0x5662('0x11'));var toCsv=require(_0x5662('0xb'));var querystring=require(_0x5662('0x12'));var Papa=require('papaparse');var Redis=require(_0x5662('0x13'));var authService=require(_0x5662('0x14'));var qs=require(_0x5662('0x15'));var as=require(_0x5662('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5662('0x17'))('api');var utils=require(_0x5662('0x18'));var config=require(_0x5662('0x19'));var licenseUtil=require(_0x5662('0x1a'));var db=require(_0x5662('0x1b'))['db'];function respondWithStatusCode(_0x5eee77,_0x118c34){_0x118c34=_0x118c34||0xcc;return function(_0x571715){if(_0x571715){return _0x5eee77[_0x5662('0x1c')](_0x118c34);}return _0x5eee77[_0x5662('0x1d')](_0x118c34)['end']();};}function respondWithResult(_0x4596e3,_0x3471c7){_0x3471c7=_0x3471c7||0xc8;return function(_0x2627e5){if(_0x2627e5){return _0x4596e3['status'](_0x3471c7)[_0x5662('0x1e')](_0x2627e5);}};}function respondWithFilteredResult(_0x43f1fb,_0x417670){return function(_0x304e5b){if(_0x304e5b){var _0x57e63e=typeof _0x417670[_0x5662('0x1f')]===_0x5662('0x20')&&typeof _0x417670[_0x5662('0x21')]==='undefined';var _0x2830b1=_0x304e5b['count'];var _0x11c222=_0x57e63e?0x0:_0x417670[_0x5662('0x1f')];var _0x5d87d3=_0x57e63e?_0x304e5b['count']:_0x417670[_0x5662('0x1f')]+_0x417670[_0x5662('0x21')];var _0x44850f;if(_0x5d87d3>=_0x2830b1){_0x5d87d3=_0x2830b1;_0x44850f=0xc8;}else{_0x44850f=0xce;}_0x43f1fb[_0x5662('0x1d')](_0x44850f);return _0x43f1fb[_0x5662('0x22')](_0x5662('0x23'),_0x11c222+'-'+_0x5d87d3+'/'+_0x2830b1)[_0x5662('0x1e')](_0x304e5b);}return null;};}function patchUpdates(_0x2a454b){return function(_0x213b11){try{jsonpatch['apply'](_0x213b11,_0x2a454b,!![]);}catch(_0x1b03dd){return BPromise['reject'](_0x1b03dd);}return _0x213b11[_0x5662('0x24')]();};}function saveUpdates(_0x51cfed,_0x22242b){return function(_0x13c684){if(_0x13c684){return _0x13c684[_0x5662('0x25')](_0x51cfed)[_0x5662('0x26')](function(_0x37b8f4){return _0x37b8f4;});}return null;};}function removeEntity(_0x38808f,_0x38ba25){return function(_0x29d309){if(_0x29d309){return _0x29d309[_0x5662('0x27')]()['then'](function(){_0x38808f[_0x5662('0x1d')](0xcc)[_0x5662('0x28')]();});}};}function handleEntityNotFound(_0x5e7974,_0xb30678){return function(_0x225645){if(!_0x225645){_0x5e7974['sendStatus'](0x194);}return _0x225645;};}function handleError(_0x3273df,_0x240a7f){_0x240a7f=_0x240a7f||0x1f4;return function(_0x1abb10){logger[_0x5662('0x29')](_0x1abb10['stack']);if(_0x1abb10[_0x5662('0x2a')]){delete _0x1abb10['name'];}_0x3273df[_0x5662('0x1d')](_0x240a7f)[_0x5662('0x2b')](_0x1abb10);};}exports['index']=function(_0x2383f5,_0x5479f4){var _0x5bb8bb={},_0x3c5e1c={},_0x2693b2={'count':0x0,'rows':[]};var _0x3daed7=_[_0x5662('0x2c')](db[_0x5662('0x2d')][_0x5662('0x2e')],function(_0x16606b){return{'name':_0x16606b['fieldName'],'type':_0x16606b[_0x5662('0x2f')][_0x5662('0x30')]};});_0x3c5e1c[_0x5662('0x31')]=_['map'](_0x3daed7,_0x5662('0x2a'));_0x3c5e1c[_0x5662('0x32')]=_[_0x5662('0x33')](_0x2383f5[_0x5662('0x32')]);_0x3c5e1c['filters']=_[_0x5662('0x34')](_0x3c5e1c[_0x5662('0x31')],_0x3c5e1c['query']);_0x5bb8bb[_0x5662('0x35')]=_[_0x5662('0x34')](_0x3c5e1c[_0x5662('0x31')],qs[_0x5662('0x36')](_0x2383f5[_0x5662('0x32')][_0x5662('0x36')]));_0x5bb8bb[_0x5662('0x35')]=_0x5bb8bb[_0x5662('0x35')][_0x5662('0x37')]?_0x5bb8bb[_0x5662('0x35')]:_0x3c5e1c[_0x5662('0x31')];if(!_0x2383f5[_0x5662('0x32')][_0x5662('0x38')](_0x5662('0x39'))){_0x5bb8bb[_0x5662('0x21')]=qs[_0x5662('0x21')](_0x2383f5['query'][_0x5662('0x21')]);_0x5bb8bb[_0x5662('0x1f')]=qs[_0x5662('0x1f')](_0x2383f5[_0x5662('0x32')]['offset']);}_0x5bb8bb[_0x5662('0x3a')]=qs['sort'](_0x2383f5[_0x5662('0x32')][_0x5662('0x3b')]);_0x5bb8bb['where']=qs[_0x5662('0x3c')](_[_0x5662('0x3d')](_0x2383f5['query'],_0x3c5e1c[_0x5662('0x3c')]),_0x3daed7);if(_0x2383f5[_0x5662('0x32')][_0x5662('0x3e')]){_0x5bb8bb['where']=_[_0x5662('0x3f')](_0x5bb8bb['where'],{'$or':_[_0x5662('0x2c')](_0x3daed7,function(_0x46a4ce){if(_0x46a4ce[_0x5662('0x2f')]!==_0x5662('0x40')){var _0x28a914={};_0x28a914[_0x46a4ce[_0x5662('0x2a')]]={'$like':'%'+_0x2383f5['query'][_0x5662('0x3e')]+'%'};return _0x28a914;}})});}_0x5bb8bb=_[_0x5662('0x3f')]({},_0x5bb8bb,_0x2383f5[_0x5662('0x41')]);var _0x224299={'where':_0x5bb8bb[_0x5662('0x42')]};return db['ZohoField'][_0x5662('0x43')](_0x224299)['then'](function(_0x32a4ba){_0x2693b2[_0x5662('0x43')]=_0x32a4ba;if(_0x2383f5['query'][_0x5662('0x44')]){_0x5bb8bb[_0x5662('0x45')]=[{'all':!![]}];}return db[_0x5662('0x2d')][_0x5662('0x46')](_0x5bb8bb);})[_0x5662('0x26')](function(_0x3a6de7){_0x2693b2[_0x5662('0x47')]=_0x3a6de7;return _0x2693b2;})['then'](respondWithFilteredResult(_0x5479f4,_0x5bb8bb))[_0x5662('0x48')](handleError(_0x5479f4,null));};exports['show']=function(_0x3a0f66,_0x32373a){var _0x688407={'raw':!![],'where':{'id':_0x3a0f66[_0x5662('0x49')]['id']}},_0x14fd03={};_0x14fd03['model']=_['keys'](db[_0x5662('0x2d')]['rawAttributes']);_0x14fd03[_0x5662('0x32')]=_['keys'](_0x3a0f66[_0x5662('0x32')]);_0x14fd03['filters']=_['intersection'](_0x14fd03[_0x5662('0x31')],_0x14fd03['query']);_0x688407[_0x5662('0x35')]=_[_0x5662('0x34')](_0x14fd03[_0x5662('0x31')],qs[_0x5662('0x36')](_0x3a0f66[_0x5662('0x32')][_0x5662('0x36')]));_0x688407[_0x5662('0x35')]=_0x688407['attributes'][_0x5662('0x37')]?_0x688407[_0x5662('0x35')]:_0x14fd03[_0x5662('0x31')];if(_0x3a0f66['query']['includeAll']){_0x688407[_0x5662('0x45')]=[{'all':!![]}];}_0x688407=_[_0x5662('0x3f')]({},_0x688407,_0x3a0f66[_0x5662('0x41')]);return db['ZohoField'][_0x5662('0x4a')](_0x688407)[_0x5662('0x26')](handleEntityNotFound(_0x32373a,null))['then'](respondWithResult(_0x32373a,null))[_0x5662('0x48')](handleError(_0x32373a,null));};exports['create']=function(_0x31369c,_0x3b3578){return db['ZohoField'][_0x5662('0x4b')](_0x31369c[_0x5662('0x4c')],{})[_0x5662('0x26')](respondWithResult(_0x3b3578,0xc9))['catch'](handleError(_0x3b3578,null));};exports[_0x5662('0x25')]=function(_0xb5e717,_0x2370ff){if(_0xb5e717[_0x5662('0x4c')]['id']){delete _0xb5e717['body']['id'];}return db[_0x5662('0x2d')][_0x5662('0x4a')]({'where':{'id':_0xb5e717[_0x5662('0x49')]['id']}})[_0x5662('0x26')](handleEntityNotFound(_0x2370ff,null))[_0x5662('0x26')](saveUpdates(_0xb5e717[_0x5662('0x4c')],null))[_0x5662('0x26')](respondWithResult(_0x2370ff,null))['catch'](handleError(_0x2370ff,null));};exports['destroy']=function(_0x2d2292,_0x30437a){return db[_0x5662('0x2d')][_0x5662('0x4a')]({'where':{'id':_0x2d2292['params']['id']}})[_0x5662('0x26')](handleEntityNotFound(_0x30437a,null))[_0x5662('0x26')](removeEntity(_0x30437a,null))[_0x5662('0x48')](handleError(_0x30437a,null));}; \ No newline at end of file +var _0x88be=['then','end','sendStatus','error','stack','name','send','index','map','ZohoField','fieldName','type','key','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','keys','rawAttributes','include','options','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x88be,0xcb));var _0xe88b=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x88be[_0x4e1d03];return _0x362d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe88b('0x0'));var zipdir=require(_0xe88b('0x1'));var jsonpatch=require(_0xe88b('0x2'));var rp=require(_0xe88b('0x3'));var moment=require(_0xe88b('0x4'));var BPromise=require(_0xe88b('0x5'));var Mustache=require(_0xe88b('0x6'));var util=require('util');var path=require(_0xe88b('0x7'));var sox=require(_0xe88b('0x8'));var csv=require('to-csv');var ejs=require(_0xe88b('0x9'));var fs=require('fs');var fs_extra=require(_0xe88b('0xa'));var _=require(_0xe88b('0xb'));var squel=require(_0xe88b('0xc'));var crypto=require(_0xe88b('0xd'));var jsforce=require(_0xe88b('0xe'));var deskjs=require(_0xe88b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe88b('0x10'));var Papa=require('papaparse');var Redis=require(_0xe88b('0x11'));var authService=require(_0xe88b('0x12'));var qs=require(_0xe88b('0x13'));var as=require(_0xe88b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe88b('0x15'))(_0xe88b('0x16'));var utils=require(_0xe88b('0x17'));var config=require(_0xe88b('0x18'));var licenseUtil=require(_0xe88b('0x19'));var db=require(_0xe88b('0x1a'))['db'];function respondWithStatusCode(_0x439012,_0x386004){_0x386004=_0x386004||0xcc;return function(_0x1fd07d){if(_0x1fd07d){return _0x439012['sendStatus'](_0x386004);}return _0x439012[_0xe88b('0x1b')](_0x386004)['end']();};}function respondWithResult(_0x3dbdc1,_0xb1f62b){_0xb1f62b=_0xb1f62b||0xc8;return function(_0x43543d){if(_0x43543d){return _0x3dbdc1[_0xe88b('0x1b')](_0xb1f62b)['json'](_0x43543d);}};}function respondWithFilteredResult(_0x285767,_0x5315dd){return function(_0x158f84){if(_0x158f84){var _0x146adc=typeof _0x5315dd['offset']==='undefined'&&typeof _0x5315dd['limit']===_0xe88b('0x1c');var _0x3922d7=_0x158f84['count'];var _0xf2bf08=_0x146adc?0x0:_0x5315dd['offset'];var _0xa575f7=_0x146adc?_0x158f84[_0xe88b('0x1d')]:_0x5315dd[_0xe88b('0x1e')]+_0x5315dd[_0xe88b('0x1f')];var _0x17b193;if(_0xa575f7>=_0x3922d7){_0xa575f7=_0x3922d7;_0x17b193=0xc8;}else{_0x17b193=0xce;}_0x285767[_0xe88b('0x1b')](_0x17b193);return _0x285767[_0xe88b('0x20')](_0xe88b('0x21'),_0xf2bf08+'-'+_0xa575f7+'/'+_0x3922d7)[_0xe88b('0x22')](_0x158f84);}return null;};}function patchUpdates(_0x1142a0){return function(_0x8581b5){try{jsonpatch[_0xe88b('0x23')](_0x8581b5,_0x1142a0,!![]);}catch(_0x3f4e63){return BPromise[_0xe88b('0x24')](_0x3f4e63);}return _0x8581b5[_0xe88b('0x25')]();};}function saveUpdates(_0xe522bd,_0x17d6ac){return function(_0x358d16){if(_0x358d16){return _0x358d16[_0xe88b('0x26')](_0xe522bd)['then'](function(_0x376240){return _0x376240;});}return null;};}function removeEntity(_0x2f71c5,_0x11fc60){return function(_0x30ceee){if(_0x30ceee){return _0x30ceee[_0xe88b('0x27')]()[_0xe88b('0x28')](function(){_0x2f71c5[_0xe88b('0x1b')](0xcc)[_0xe88b('0x29')]();});}};}function handleEntityNotFound(_0x241dae,_0x40dca){return function(_0x535b3e){if(!_0x535b3e){_0x241dae[_0xe88b('0x2a')](0x194);}return _0x535b3e;};}function handleError(_0xa6166a,_0x41bf4b){_0x41bf4b=_0x41bf4b||0x1f4;return function(_0x27bf94){logger[_0xe88b('0x2b')](_0x27bf94[_0xe88b('0x2c')]);if(_0x27bf94[_0xe88b('0x2d')]){delete _0x27bf94[_0xe88b('0x2d')];}_0xa6166a['status'](_0x41bf4b)[_0xe88b('0x2e')](_0x27bf94);};}exports[_0xe88b('0x2f')]=function(_0x2a965a,_0x2039ae){var _0x2f9c59={},_0x40c599={},_0x40d690={'count':0x0,'rows':[]};var _0xb9deed=_[_0xe88b('0x30')](db[_0xe88b('0x31')]['rawAttributes'],function(_0x48b971){return{'name':_0x48b971[_0xe88b('0x32')],'type':_0x48b971[_0xe88b('0x33')][_0xe88b('0x34')]};});_0x40c599['model']=_[_0xe88b('0x30')](_0xb9deed,'name');_0x40c599['query']=_['keys'](_0x2a965a['query']);_0x40c599['filters']=_[_0xe88b('0x35')](_0x40c599['model'],_0x40c599[_0xe88b('0x36')]);_0x2f9c59[_0xe88b('0x37')]=_[_0xe88b('0x35')](_0x40c599[_0xe88b('0x38')],qs[_0xe88b('0x39')](_0x2a965a['query'][_0xe88b('0x39')]));_0x2f9c59[_0xe88b('0x37')]=_0x2f9c59[_0xe88b('0x37')][_0xe88b('0x3a')]?_0x2f9c59['attributes']:_0x40c599[_0xe88b('0x38')];if(!_0x2a965a[_0xe88b('0x36')][_0xe88b('0x3b')](_0xe88b('0x3c'))){_0x2f9c59[_0xe88b('0x1f')]=qs['limit'](_0x2a965a['query'][_0xe88b('0x1f')]);_0x2f9c59[_0xe88b('0x1e')]=qs[_0xe88b('0x1e')](_0x2a965a[_0xe88b('0x36')][_0xe88b('0x1e')]);}_0x2f9c59[_0xe88b('0x3d')]=qs['sort'](_0x2a965a[_0xe88b('0x36')][_0xe88b('0x3e')]);_0x2f9c59[_0xe88b('0x3f')]=qs[_0xe88b('0x40')](_[_0xe88b('0x41')](_0x2a965a['query'],_0x40c599['filters']),_0xb9deed);if(_0x2a965a[_0xe88b('0x36')][_0xe88b('0x42')]){_0x2f9c59[_0xe88b('0x3f')]=_[_0xe88b('0x43')](_0x2f9c59['where'],{'$or':_['map'](_0xb9deed,function(_0x2fb8be){if(_0x2fb8be[_0xe88b('0x33')]!==_0xe88b('0x44')){var _0x33e335={};_0x33e335[_0x2fb8be['name']]={'$like':'%'+_0x2a965a[_0xe88b('0x36')][_0xe88b('0x42')]+'%'};return _0x33e335;}})});}_0x2f9c59=_[_0xe88b('0x43')]({},_0x2f9c59,_0x2a965a['options']);var _0x376273={'where':_0x2f9c59['where']};return db[_0xe88b('0x31')][_0xe88b('0x1d')](_0x376273)['then'](function(_0x76020){_0x40d690[_0xe88b('0x1d')]=_0x76020;if(_0x2a965a[_0xe88b('0x36')][_0xe88b('0x45')]){_0x2f9c59['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x2f9c59);})[_0xe88b('0x28')](function(_0x55fbaa){_0x40d690[_0xe88b('0x46')]=_0x55fbaa;return _0x40d690;})['then'](respondWithFilteredResult(_0x2039ae,_0x2f9c59))['catch'](handleError(_0x2039ae,null));};exports[_0xe88b('0x47')]=function(_0x14587c,_0x1b8b40){var _0x1dcadb={'raw':!![],'where':{'id':_0x14587c[_0xe88b('0x48')]['id']}},_0x1c98ef={};_0x1c98ef[_0xe88b('0x38')]=_[_0xe88b('0x49')](db['ZohoField'][_0xe88b('0x4a')]);_0x1c98ef[_0xe88b('0x36')]=_[_0xe88b('0x49')](_0x14587c[_0xe88b('0x36')]);_0x1c98ef[_0xe88b('0x40')]=_['intersection'](_0x1c98ef[_0xe88b('0x38')],_0x1c98ef['query']);_0x1dcadb[_0xe88b('0x37')]=_[_0xe88b('0x35')](_0x1c98ef[_0xe88b('0x38')],qs[_0xe88b('0x39')](_0x14587c[_0xe88b('0x36')][_0xe88b('0x39')]));_0x1dcadb['attributes']=_0x1dcadb[_0xe88b('0x37')][_0xe88b('0x3a')]?_0x1dcadb[_0xe88b('0x37')]:_0x1c98ef[_0xe88b('0x38')];if(_0x14587c['query'][_0xe88b('0x45')]){_0x1dcadb[_0xe88b('0x4b')]=[{'all':!![]}];}_0x1dcadb=_[_0xe88b('0x43')]({},_0x1dcadb,_0x14587c[_0xe88b('0x4c')]);return db[_0xe88b('0x31')]['find'](_0x1dcadb)[_0xe88b('0x28')](handleEntityNotFound(_0x1b8b40,null))['then'](respondWithResult(_0x1b8b40,null))[_0xe88b('0x4d')](handleError(_0x1b8b40,null));};exports['create']=function(_0x265a2e,_0x466f0b){return db['ZohoField'][_0xe88b('0x4e')](_0x265a2e['body'],{})['then'](respondWithResult(_0x466f0b,0xc9))[_0xe88b('0x4d')](handleError(_0x466f0b,null));};exports['update']=function(_0x1b4445,_0x34d6bf){if(_0x1b4445[_0xe88b('0x4f')]['id']){delete _0x1b4445[_0xe88b('0x4f')]['id'];}return db[_0xe88b('0x31')][_0xe88b('0x50')]({'where':{'id':_0x1b4445['params']['id']}})[_0xe88b('0x28')](handleEntityNotFound(_0x34d6bf,null))[_0xe88b('0x28')](saveUpdates(_0x1b4445['body'],null))[_0xe88b('0x28')](respondWithResult(_0x34d6bf,null))[_0xe88b('0x4d')](handleError(_0x34d6bf,null));};exports[_0xe88b('0x27')]=function(_0x38f174,_0x304e95){return db[_0xe88b('0x31')]['find']({'where':{'id':_0x38f174[_0xe88b('0x48')]['id']}})['then'](handleEntityNotFound(_0x304e95,null))[_0xe88b('0x28')](removeEntity(_0x304e95,null))[_0xe88b('0x4d')](handleError(_0x304e95,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2f16bc2..4a102ad 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4325=['../../config/environment','./intZohoField.attributes','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','rimraf'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x4325,0x1da));var _0x5432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4325[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var logger=require('../../config/logger')(_0x5432('0x2'));var moment=require(_0x5432('0x3'));var BPromise=require(_0x5432('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var attributes=require(_0x5432('0x7'));module['exports']=function(_0x209e2e,_0xbb0075){return _0x209e2e['define'](_0x5432('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5432('0x9'),'fields':[_0x5432('0xa'),_0x5432('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb44a=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','../../config/logger','moment','path','../../config/environment','./intZohoField.attributes','exports'];(function(_0x2672e1,_0x34b076){var _0x2b804a=function(_0x142e1d){while(--_0x142e1d){_0x2672e1['push'](_0x2672e1['shift']());}};_0x2b804a(++_0x34b076);}(_0xb44a,0x1c2));var _0xab44=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0xb44a[_0xb03f9];return _0x3ec30a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[{'name':_0xab44('0x9'),'fields':[_0xab44('0xa'),_0xab44('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 4f35202..f1fb468 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba9=['request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xec0fbd,_0x4dbcdb){var _0x24a373=function(_0x4ea092){while(--_0x4ea092){_0xec0fbd['push'](_0xec0fbd['shift']());}};_0x24a373(++_0x4dbcdb);}(_0x7ba9,0x1ef));var _0x97ba=function(_0x30853f,_0x4aa320){_0x30853f=_0x30853f-0x0;var _0x3c416d=_0x7ba9[_0x30853f];return _0x3c416d;};'use strict';var _=require(_0x97ba('0x0'));var util=require(_0x97ba('0x1'));var moment=require('moment');var BPromise=require(_0x97ba('0x2'));var rs=require(_0x97ba('0x3'));var fs=require('fs');var Redis=require(_0x97ba('0x4'));var db=require(_0x97ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97ba('0x6'))(_0x97ba('0x7'));var config=require(_0x97ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x97ba('0x9')][_0x97ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x453798,_0x4296fe,_0x2aca27){return new BPromise(function(_0x139631,_0x2f83d8){return client[_0x97ba('0xb')](_0x453798,_0x2aca27)['then'](function(_0x42405b){logger[_0x97ba('0xc')](_0x97ba('0xd'),_0x4296fe,_0x97ba('0xe'));logger[_0x97ba('0xf')](_0x97ba('0x10'),_0x4296fe,'request\x20sent',JSON[_0x97ba('0x11')](_0x42405b));if(_0x42405b[_0x97ba('0x12')]){if(_0x42405b['error'][_0x97ba('0x13')]===0x1f4){logger[_0x97ba('0x12')]('ZohoField,\x20%s,\x20%s',_0x4296fe,_0x42405b['error'][_0x97ba('0x14')]);return _0x2f83d8(_0x42405b[_0x97ba('0x12')]['message']);}logger[_0x97ba('0x12')](_0x97ba('0xd'),_0x4296fe,_0x42405b[_0x97ba('0x12')][_0x97ba('0x14')]);return _0x139631(_0x42405b[_0x97ba('0x12')]['message']);}else{logger[_0x97ba('0xc')](_0x97ba('0xd'),_0x4296fe,_0x97ba('0xe'));_0x139631(_0x42405b[_0x97ba('0x15')][_0x97ba('0x14')]);}})[_0x97ba('0x16')](function(_0x2e5bad){logger[_0x97ba('0x12')](_0x97ba('0xd'),_0x4296fe,_0x2e5bad);_0x2f83d8(_0x2e5bad);});});} \ No newline at end of file +var _0xf7d8=['debug','ZohoField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x58b148,_0x179268){var _0x22cdd5=function(_0x53e73e){while(--_0x53e73e){_0x58b148['push'](_0x58b148['shift']());}};_0x22cdd5(++_0x179268);}(_0xf7d8,0x79));var _0x8f7d=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xf7d8[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x8f7d('0x0'));var util=require('util');var moment=require(_0x8f7d('0x1'));var BPromise=require(_0x8f7d('0x2'));var rs=require(_0x8f7d('0x3'));var fs=require('fs');var Redis=require(_0x8f7d('0x4'));var db=require(_0x8f7d('0x5'))['db'];var utils=require(_0x8f7d('0x6'));var logger=require(_0x8f7d('0x7'))(_0x8f7d('0x8'));var config=require(_0x8f7d('0x9'));var jayson=require(_0x8f7d('0xa'));var client=jayson[_0x8f7d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30da58,_0x2c3a8c,_0x31d78e){return new BPromise(function(_0x18c549,_0x3bea3a){return client[_0x8f7d('0xc')](_0x30da58,_0x31d78e)[_0x8f7d('0xd')](function(_0x1ed988){logger[_0x8f7d('0xe')](_0x8f7d('0xf'),_0x2c3a8c,_0x8f7d('0x10'));logger[_0x8f7d('0x11')](_0x8f7d('0x12'),_0x2c3a8c,_0x8f7d('0x10'),JSON['stringify'](_0x1ed988));if(_0x1ed988[_0x8f7d('0x13')]){if(_0x1ed988[_0x8f7d('0x13')]['code']===0x1f4){logger[_0x8f7d('0x13')]('ZohoField,\x20%s,\x20%s',_0x2c3a8c,_0x1ed988['error'][_0x8f7d('0x14')]);return _0x3bea3a(_0x1ed988[_0x8f7d('0x13')][_0x8f7d('0x14')]);}logger['error'](_0x8f7d('0xf'),_0x2c3a8c,_0x1ed988[_0x8f7d('0x13')][_0x8f7d('0x14')]);return _0x18c549(_0x1ed988['error']['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x2c3a8c,_0x8f7d('0x10'));_0x18c549(_0x1ed988[_0x8f7d('0x15')][_0x8f7d('0x14')]);}})[_0x8f7d('0x16')](function(_0x44cc51){logger[_0x8f7d('0x13')](_0x8f7d('0xf'),_0x2c3a8c,_0x44cc51);_0x3bea3a(_0x44cc51);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 97025cf..be9b272 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5a2fbf,_0x13c8da){var _0x2c916b=function(_0x1d4888){while(--_0x1d4888){_0x5a2fbf['push'](_0x5a2fbf['shift']());}};_0x2c916b(++_0x13c8da);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4887aa,_0x2e6612){var _0x1b1242=function(_0x4d87cd){while(--_0x4d87cd){_0x4887aa['push'](_0x4887aa['shift']());}};_0x1b1242(++_0x2e6612);}(_0xe706,0xa3));var _0x6e70=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xe706[_0x202c61];return _0x540691;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 031cd4d..8f7c805 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3df4=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x25f1bf,_0x3db86d){var _0x5622cf=function(_0x59d7bd){while(--_0x59d7bd){_0x25f1bf['push'](_0x25f1bf['shift']());}};_0x5622cf(++_0x3db86d);}(_0x3df4,0x173));var _0x43df=function(_0x6674e4,_0x1f1a41){_0x6674e4=_0x6674e4-0x0;var _0x2cfd78=_0x3df4[_0x6674e4];return _0x2cfd78;};'use strict';var Sequelize=require(_0x43df('0x0'));module[_0x43df('0x1')]={'name':{'type':Sequelize[_0x43df('0x2')],'allowNull':![],'unique':_0x43df('0x3')},'version':{'type':Sequelize[_0x43df('0x2')],'allowNull':![],'unique':_0x43df('0x3')},'main':{'type':Sequelize[_0x43df('0x2')],'defaultValue':_0x43df('0x4')},'filename':{'type':Sequelize[_0x43df('0x2')]},'path':{'type':Sequelize[_0x43df('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x43df('0x5')]},'active':{'type':Sequelize[_0x43df('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x43df('0x2')]},'logo':{'type':Sequelize[_0x43df('0x2')]},'state':{'type':Sequelize[_0x43df('0x2')],'unique':_0x43df('0x7')},'description':{'type':Sequelize[_0x43df('0x2')]},'title':{'type':Sequelize[_0x43df('0x2')]},'remoteUri':{'type':Sequelize[_0x43df('0x2')]},'link':{'type':Sequelize[_0x43df('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x6268=['BOOLEAN','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x2feea2,_0x2acc4f){var _0x3f911d=function(_0x2c844a){while(--_0x2c844a){_0x2feea2['push'](_0x2feea2['shift']());}};_0x3f911d(++_0x2acc4f);}(_0x6268,0x193));var _0x8626=function(_0x5ad5e7,_0x44dad1){_0x5ad5e7=_0x5ad5e7-0x0;var _0x160d53=_0x6268[_0x5ad5e7];return _0x160d53;};'use strict';var Sequelize=require(_0x8626('0x0'));module['exports']={'name':{'type':Sequelize[_0x8626('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x8626('0x1')],'allowNull':![],'unique':_0x8626('0x2')},'main':{'type':Sequelize[_0x8626('0x1')],'defaultValue':_0x8626('0x3')},'filename':{'type':Sequelize[_0x8626('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8626('0x1')]},'size':{'type':Sequelize[_0x8626('0x4')]},'active':{'type':Sequelize[_0x8626('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8626('0x1')]},'logo':{'type':Sequelize[_0x8626('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x8626('0x1')]},'title':{'type':Sequelize[_0x8626('0x1')]},'remoteUri':{'type':Sequelize[_0x8626('0x1')]},'link':{'type':Sequelize[_0x8626('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 49a4ced..38c14fa 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Integration','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x39f36f,_0x2db91e){var _0x21781f=function(_0x2325b9){while(--_0x2325b9){_0x39f36f['push'](_0x39f36f['shift']());}};_0x21781f(++_0x2db91e);}(_0x2ef3,0xba));var _0x32ef=function(_0x4ebcd2,_0x2d6c36){_0x4ebcd2=_0x4ebcd2-0x0;var _0x102f8f=_0x2ef3[_0x4ebcd2];return _0x102f8f;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['Integration'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['Integration'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['Integration']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x20b5cf,_0x49ec67){var _0x4b86b7=function(_0x734ec1){while(--_0x734ec1){_0x20b5cf['push'](_0x20b5cf['shift']());}};_0x4b86b7(++_0x49ec67);}(_0x7a54,0x106));var _0x47a5=function(_0x372d94,_0x1b66af){_0x372d94=_0x372d94-0x0;var _0x27e897=_0x7a54[_0x372d94];return _0x27e897;};'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['Integration'][_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['Integration']['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['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index a928732..ee82b3c 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e17=['moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger','api'];(function(_0x3466bf,_0x2886dd){var _0x42e29a=function(_0x2fbcee){while(--_0x2fbcee){_0x3466bf['push'](_0x3466bf['shift']());}};_0x42e29a(++_0x2886dd);}(_0x3e17,0x1de));var _0x73e1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3e17[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x73e1('0x0'));var util=require('util');var logger=require(_0x73e1('0x1'))(_0x73e1('0x2'));var moment=require(_0x73e1('0x3'));var BPromise=require(_0x73e1('0x4'));var rp=require(_0x73e1('0x5'));var fs=require('fs');var path=require(_0x73e1('0x6'));var rimraf=require(_0x73e1('0x7'));var config=require('../../config/environment');var attributes=require(_0x73e1('0x8'));module[_0x73e1('0x9')]=function(_0xe21327,_0x5ca0c2){return _0xe21327[_0x73e1('0xa')](_0x73e1('0xb'),attributes,{'tableName':_0x73e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f28=['../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4fde72,_0x545e17){var _0x167bc0=function(_0x28b921){while(--_0x28b921){_0x4fde72['push'](_0x4fde72['shift']());}};_0x167bc0(++_0x545e17);}(_0x7f28,0x1c1));var _0x87f2=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7f28[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x87f2('0x0'));var util=require(_0x87f2('0x1'));var logger=require(_0x87f2('0x2'))(_0x87f2('0x3'));var moment=require(_0x87f2('0x4'));var BPromise=require(_0x87f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x87f2('0x6'));var config=require(_0x87f2('0x7'));var attributes=require(_0x87f2('0x8'));module[_0x87f2('0x9')]=function(_0x2fa3f0,_0x58ec82){return _0x2fa3f0[_0x87f2('0xa')](_0x87f2('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index be9592a..deb2fb1 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b259a,_0x222250){var _0x39b8b4=function(_0x798bec){while(--_0x798bec){_0x2b259a['push'](_0x2b259a['shift']());}};_0x39b8b4(++_0x222250);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xe8d26a,_0x352036){_0xe8d26a=_0xe8d26a-0x0;var _0x1b5602=_0xc6ac[_0xe8d26a];return _0x1b5602;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index e9aea31..eca7ce5 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xda2d,0x102));var _0xdda2=function(_0x32681a,_0x38e51f){_0x32681a=_0x32681a-0x0;var _0x377f71=_0xda2d[_0x32681a];return _0x377f71;};'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('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x66fa,0x117));var _0xa66f=function(_0x2490e3,_0x1e7faa){_0x2490e3=_0x2490e3-0x0;var _0x5bcf6d=_0x66fa[_0x2490e3];return _0x5bcf6d;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a5c8f78..a70fb74 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e60=['TEXT','ENUM','SENT','SENDING','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x567585,_0x41ea71){var _0x2d175e=function(_0xe3c0b3){while(--_0xe3c0b3){_0x567585['push'](_0x567585['shift']());}};_0x2d175e(++_0x41ea71);}(_0x2e60,0x13a));var _0x02e6=function(_0x4008c0,_0x2465aa){_0x4008c0=_0x4008c0-0x0;var _0x1af99f=_0x2e60[_0x4008c0];return _0x1af99f;};'use strict';var Sequelize=require(_0x02e6('0x0'));module[_0x02e6('0x1')]={'integration':{'type':Sequelize[_0x02e6('0x2')]},'eventChannel':{'type':Sequelize[_0x02e6('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x02e6('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x02e6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x02e6('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x02e6('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x02e6('0x3')]},'agentconnectAt':{'type':Sequelize[_0x02e6('0x3')]},'holdtime':{'type':Sequelize[_0x02e6('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x02e6('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x02e6('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x02e6('0x4')]},'reason':{'type':Sequelize[_0x02e6('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x02e6('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x02e6('0x3')]},'agentdump':{'type':Sequelize[_0x02e6('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x02e6('0x3')]},'lastevent':{'type':Sequelize[_0x02e6('0x2')]},'channel':{'type':Sequelize[_0x02e6('0x2')]},'channelstate':{'type':Sequelize[_0x02e6('0x4')]},'channelstatedesc':{'type':Sequelize[_0x02e6('0x2')]},'connectedlinenum':{'type':Sequelize[_0x02e6('0x2')]},'connectedlinename':{'type':Sequelize[_0x02e6('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x02e6('0x2')]},'context':{'type':Sequelize[_0x02e6('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x02e6('0x2')]},'destchannelstate':{'type':Sequelize[_0x02e6('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x02e6('0x2')]},'destcalleridnum':{'type':Sequelize[_0x02e6('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x02e6('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x02e6('0x2')]},'destcontext':{'type':Sequelize[_0x02e6('0x2')]},'destexten':{'type':Sequelize[_0x02e6('0x2')]},'destpriority':{'type':Sequelize[_0x02e6('0x2')]},'destuniqueid':{'type':Sequelize[_0x02e6('0x2')]},'messageId':{'type':Sequelize[_0x02e6('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x02e6('0x2')]},'to':{'type':Sequelize[_0x02e6('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x02e6('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x02e6('0x7')](_0x02e6('0x8'),_0x02e6('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x02e6('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x02e6('0x2')]},'projectId':{'type':Sequelize[_0x02e6('0x4')]}}; \ No newline at end of file +var _0xea0e=['ENUM','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x31cdff,_0x545438){var _0x14091f=function(_0x363721){while(--_0x363721){_0x31cdff['push'](_0x31cdff['shift']());}};_0x14091f(++_0x545438);}(_0xea0e,0x16f));var _0xeea0=function(_0x2b4ed3,_0x38f189){_0x2b4ed3=_0x2b4ed3-0x0;var _0x465806=_0xea0e[_0x2b4ed3];return _0x465806;};'use strict';var Sequelize=require(_0xeea0('0x0'));module[_0xeea0('0x1')]={'integration':{'type':Sequelize[_0xeea0('0x2')]},'eventChannel':{'type':Sequelize[_0xeea0('0x2')]},'exitStatus':{'type':Sequelize[_0xeea0('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xeea0('0x3')]},'contacts':{'type':Sequelize[_0xeea0('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xeea0('0x2')]},'calleridname':{'type':Sequelize[_0xeea0('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xeea0('0x2')]},'membername':{'type':Sequelize[_0xeea0('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeea0('0x4')]},'agentconnectAt':{'type':Sequelize[_0xeea0('0x4')]},'holdtime':{'type':Sequelize[_0xeea0('0x3')]},'agentcomplete':{'type':Sequelize[_0xeea0('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xeea0('0x4')]},'talktime':{'type':Sequelize[_0xeea0('0x3')]},'agentacw':{'type':Sequelize[_0xeea0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeea0('0x3')]},'reason':{'type':Sequelize[_0xeea0('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xeea0('0x4')]},'agentdump':{'type':Sequelize[_0xeea0('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xeea0('0x2')]},'channel':{'type':Sequelize[_0xeea0('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xeea0('0x2')]},'connectedlinename':{'type':Sequelize[_0xeea0('0x2')]},'language':{'type':Sequelize[_0xeea0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xeea0('0x2')]},'exten':{'type':Sequelize[_0xeea0('0x2')]},'priority':{'type':Sequelize[_0xeea0('0x2')]},'destchannel':{'type':Sequelize[_0xeea0('0x2')]},'destchannelstate':{'type':Sequelize[_0xeea0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xeea0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xeea0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xeea0('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xeea0('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xeea0('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xeea0('0x2')]},'cc':{'type':Sequelize[_0xeea0('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xeea0('0x6')]},'status':{'type':Sequelize[_0xeea0('0x7')]('SENT',_0xeea0('0x8'),_0xeea0('0x9'),_0xeea0('0xa'))},'url':{'type':Sequelize[_0xeea0('0x2')]},'app':{'type':Sequelize[_0xeea0('0x2')]},'appdata':{'type':Sequelize[_0xeea0('0x2')]},'projectId':{'type':Sequelize[_0xeea0('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c39d35e..45a0c7c 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee3=['limit','undefined','count','set','Content-Range','json','then','destroy','error','stack','name','index','IntegrationReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x556188,_0x1e665a){var _0x5c175d=function(_0x4e222f){while(--_0x4e222f){_0x556188['push'](_0x556188['shift']());}};_0x5c175d(++_0x1e665a);}(_0x7ee3,0xc7));var _0x37ee=function(_0x5e5177,_0x1b728b){_0x5e5177=_0x5e5177-0x0;var _0x2517ab=_0x7ee3[_0x5e5177];return _0x2517ab;};'use strict';var emlformat=require(_0x37ee('0x0'));var rimraf=require(_0x37ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37ee('0x2'));var rp=require(_0x37ee('0x3'));var moment=require(_0x37ee('0x4'));var BPromise=require(_0x37ee('0x5'));var Mustache=require(_0x37ee('0x6'));var util=require(_0x37ee('0x7'));var path=require(_0x37ee('0x8'));var sox=require(_0x37ee('0x9'));var csv=require(_0x37ee('0xa'));var ejs=require(_0x37ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37ee('0xc'));var squel=require(_0x37ee('0xd'));var crypto=require('crypto');var jsforce=require(_0x37ee('0xe'));var deskjs=require(_0x37ee('0xf'));var toCsv=require(_0x37ee('0xa'));var querystring=require(_0x37ee('0x10'));var Papa=require(_0x37ee('0x11'));var Redis=require(_0x37ee('0x12'));var authService=require(_0x37ee('0x13'));var qs=require(_0x37ee('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37ee('0x15'));var logger=require(_0x37ee('0x16'))(_0x37ee('0x17'));var utils=require(_0x37ee('0x18'));var config=require(_0x37ee('0x19'));var licenseUtil=require(_0x37ee('0x1a'));var db=require(_0x37ee('0x1b'))['db'];function respondWithStatusCode(_0x57f7df,_0x237652){_0x237652=_0x237652||0xcc;return function(_0x1d7406){if(_0x1d7406){return _0x57f7df[_0x37ee('0x1c')](_0x237652);}return _0x57f7df['status'](_0x237652)[_0x37ee('0x1d')]();};}function respondWithResult(_0x453f9f,_0x26e6cc){_0x26e6cc=_0x26e6cc||0xc8;return function(_0x56f8e5){if(_0x56f8e5){return _0x453f9f[_0x37ee('0x1e')](_0x26e6cc)['json'](_0x56f8e5);}};}function respondWithFilteredResult(_0xf3e9e,_0x53a0e7){return function(_0x3df933){if(_0x3df933){var _0x128e80=typeof _0x53a0e7[_0x37ee('0x1f')]==='undefined'&&typeof _0x53a0e7[_0x37ee('0x20')]===_0x37ee('0x21');var _0x33117d=_0x3df933[_0x37ee('0x22')];var _0x26c7fb=_0x128e80?0x0:_0x53a0e7['offset'];var _0x26b6f6=_0x128e80?_0x3df933[_0x37ee('0x22')]:_0x53a0e7['offset']+_0x53a0e7[_0x37ee('0x20')];var _0x1859f9;if(_0x26b6f6>=_0x33117d){_0x26b6f6=_0x33117d;_0x1859f9=0xc8;}else{_0x1859f9=0xce;}_0xf3e9e[_0x37ee('0x1e')](_0x1859f9);return _0xf3e9e[_0x37ee('0x23')](_0x37ee('0x24'),_0x26c7fb+'-'+_0x26b6f6+'/'+_0x33117d)[_0x37ee('0x25')](_0x3df933);}return null;};}function patchUpdates(_0x16ec14){return function(_0x9e4174){try{jsonpatch['apply'](_0x9e4174,_0x16ec14,!![]);}catch(_0x2d7032){return BPromise['reject'](_0x2d7032);}return _0x9e4174['save']();};}function saveUpdates(_0x41c1bc,_0x3c1dbc){return function(_0xf96b8d){if(_0xf96b8d){return _0xf96b8d['update'](_0x41c1bc)[_0x37ee('0x26')](function(_0x13004e){return _0x13004e;});}return null;};}function removeEntity(_0x4af700,_0x3a4611){return function(_0x510fea){if(_0x510fea){return _0x510fea[_0x37ee('0x27')]()[_0x37ee('0x26')](function(){_0x4af700[_0x37ee('0x1e')](0xcc)[_0x37ee('0x1d')]();});}};}function handleEntityNotFound(_0xce2463,_0x284d5f){return function(_0x447690){if(!_0x447690){_0xce2463[_0x37ee('0x1c')](0x194);}return _0x447690;};}function handleError(_0x5ad521,_0xd5fb6e){_0xd5fb6e=_0xd5fb6e||0x1f4;return function(_0x25161c){logger[_0x37ee('0x28')](_0x25161c[_0x37ee('0x29')]);if(_0x25161c[_0x37ee('0x2a')]){delete _0x25161c[_0x37ee('0x2a')];}_0x5ad521['status'](_0xd5fb6e)['send'](_0x25161c);};}exports[_0x37ee('0x2b')]=function(_0x352b66,_0x16ce8a){var _0x8595c={},_0x2c01eb={},_0xc22ce9={'count':0x0,'rows':[]};var _0x55c01b=_['map'](db[_0x37ee('0x2c')][_0x37ee('0x2d')],function(_0x3ae7ee){return{'name':_0x3ae7ee[_0x37ee('0x2e')],'type':_0x3ae7ee[_0x37ee('0x2f')]['key']};});_0x2c01eb[_0x37ee('0x30')]=_[_0x37ee('0x31')](_0x55c01b,_0x37ee('0x2a'));_0x2c01eb[_0x37ee('0x32')]=_[_0x37ee('0x33')](_0x352b66[_0x37ee('0x32')]);_0x2c01eb[_0x37ee('0x34')]=_[_0x37ee('0x35')](_0x2c01eb[_0x37ee('0x30')],_0x2c01eb[_0x37ee('0x32')]);_0x8595c[_0x37ee('0x36')]=_[_0x37ee('0x35')](_0x2c01eb[_0x37ee('0x30')],qs['fields'](_0x352b66[_0x37ee('0x32')][_0x37ee('0x37')]));_0x8595c[_0x37ee('0x36')]=_0x8595c[_0x37ee('0x36')][_0x37ee('0x38')]?_0x8595c[_0x37ee('0x36')]:_0x2c01eb[_0x37ee('0x30')];if(!_0x352b66['query'][_0x37ee('0x39')](_0x37ee('0x3a'))){_0x8595c['limit']=qs[_0x37ee('0x20')](_0x352b66[_0x37ee('0x32')][_0x37ee('0x20')]);_0x8595c[_0x37ee('0x1f')]=qs[_0x37ee('0x1f')](_0x352b66['query'][_0x37ee('0x1f')]);}_0x8595c['order']=qs[_0x37ee('0x3b')](_0x352b66[_0x37ee('0x32')]['sort']);_0x8595c[_0x37ee('0x3c')]=qs[_0x37ee('0x34')](_[_0x37ee('0x3d')](_0x352b66['query'],_0x2c01eb[_0x37ee('0x34')]),_0x55c01b);if(_0x352b66['query'][_0x37ee('0x3e')]){_0x8595c['where']=_[_0x37ee('0x3f')](_0x8595c[_0x37ee('0x3c')],{'$or':_[_0x37ee('0x31')](_0x55c01b,function(_0x4fb241){if(_0x4fb241[_0x37ee('0x2f')]!==_0x37ee('0x40')){var _0x549cf1={};_0x549cf1[_0x4fb241[_0x37ee('0x2a')]]={'$like':'%'+_0x352b66[_0x37ee('0x32')][_0x37ee('0x3e')]+'%'};return _0x549cf1;}})});}_0x8595c=_[_0x37ee('0x3f')]({},_0x8595c,_0x352b66[_0x37ee('0x41')]);var _0x242dd5={'where':_0x8595c[_0x37ee('0x3c')]};return db[_0x37ee('0x2c')][_0x37ee('0x22')](_0x242dd5)['then'](function(_0x25c334){_0xc22ce9[_0x37ee('0x22')]=_0x25c334;if(_0x352b66['query'][_0x37ee('0x42')]){_0x8595c['include']=[{'all':!![]}];}return db[_0x37ee('0x2c')][_0x37ee('0x43')](_0x8595c);})[_0x37ee('0x26')](function(_0x2c807f){_0xc22ce9[_0x37ee('0x44')]=_0x2c807f;return _0xc22ce9;})['then'](respondWithFilteredResult(_0x16ce8a,_0x8595c))['catch'](handleError(_0x16ce8a,null));};exports[_0x37ee('0x45')]=function(_0x3ee1bf,_0x4df9ae){var _0x1c685b={'raw':![],'where':{'id':_0x3ee1bf[_0x37ee('0x46')]['id']}},_0xc94da2={};_0xc94da2[_0x37ee('0x30')]=_[_0x37ee('0x33')](db[_0x37ee('0x2c')]['rawAttributes']);_0xc94da2[_0x37ee('0x32')]=_[_0x37ee('0x33')](_0x3ee1bf[_0x37ee('0x32')]);_0xc94da2[_0x37ee('0x34')]=_[_0x37ee('0x35')](_0xc94da2[_0x37ee('0x30')],_0xc94da2[_0x37ee('0x32')]);_0x1c685b[_0x37ee('0x36')]=_[_0x37ee('0x35')](_0xc94da2[_0x37ee('0x30')],qs[_0x37ee('0x37')](_0x3ee1bf['query'][_0x37ee('0x37')]));_0x1c685b['attributes']=_0x1c685b['attributes']['length']?_0x1c685b[_0x37ee('0x36')]:_0xc94da2[_0x37ee('0x30')];if(_0x3ee1bf[_0x37ee('0x32')][_0x37ee('0x42')]){_0x1c685b[_0x37ee('0x47')]=[{'all':!![]}];}_0x1c685b=_[_0x37ee('0x3f')]({},_0x1c685b,_0x3ee1bf[_0x37ee('0x41')]);return db[_0x37ee('0x2c')][_0x37ee('0x48')](_0x1c685b)[_0x37ee('0x26')](handleEntityNotFound(_0x4df9ae,null))[_0x37ee('0x26')](respondWithResult(_0x4df9ae,null))[_0x37ee('0x49')](handleError(_0x4df9ae,null));};exports[_0x37ee('0x4a')]=function(_0x5b6cdc,_0x50e4cc){return db[_0x37ee('0x2c')][_0x37ee('0x4a')](_0x5b6cdc[_0x37ee('0x4b')],{})['then'](respondWithResult(_0x50e4cc,0xc9))[_0x37ee('0x49')](handleError(_0x50e4cc,null));};exports['update']=function(_0x1ed8a1,_0x41ca80){if(_0x1ed8a1[_0x37ee('0x4b')]['id']){delete _0x1ed8a1[_0x37ee('0x4b')]['id'];}return db[_0x37ee('0x2c')][_0x37ee('0x48')]({'where':{'id':_0x1ed8a1[_0x37ee('0x46')]['id']}})[_0x37ee('0x26')](handleEntityNotFound(_0x41ca80,null))['then'](saveUpdates(_0x1ed8a1[_0x37ee('0x4b')],null))[_0x37ee('0x26')](respondWithResult(_0x41ca80,null))[_0x37ee('0x49')](handleError(_0x41ca80,null));};exports[_0x37ee('0x27')]=function(_0x1c669a,_0xbb6466){return db[_0x37ee('0x2c')][_0x37ee('0x48')]({'where':{'id':_0x1c669a[_0x37ee('0x46')]['id']}})[_0x37ee('0x26')](handleEntityNotFound(_0xbb6466,null))['then'](removeEntity(_0xbb6466,null))[_0x37ee('0x49')](handleError(_0xbb6466,null));};exports[_0x37ee('0x4c')]=function(_0x3db7ea,_0x1b5e93){return db['IntegrationReport'][_0x37ee('0x4c')]()[_0x37ee('0x26')](respondWithResult(_0x1b5e93,null))[_0x37ee('0x49')](handleError(_0x1b5e93,null));}; \ No newline at end of file +var _0xa54e=['desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','fast-json-patch','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xa54e,0x1b1));var _0xea54=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0xa54e[_0x59ee41];return _0x3ecd3e;};'use strict';var emlformat=require(_0xea54('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea54('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea54('0x2'));var util=require(_0xea54('0x3'));var path=require(_0xea54('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea54('0x5'));var fs=require('fs');var fs_extra=require(_0xea54('0x6'));var _=require(_0xea54('0x7'));var squel=require(_0xea54('0x8'));var crypto=require(_0xea54('0x9'));var jsforce=require(_0xea54('0xa'));var deskjs=require(_0xea54('0xb'));var toCsv=require(_0xea54('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xea54('0xd'));var qs=require(_0xea54('0xe'));var as=require(_0xea54('0xf'));var hardwareService=require(_0xea54('0x10'));var logger=require('../../config/logger')(_0xea54('0x11'));var utils=require(_0xea54('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xea54('0x13'));var db=require(_0xea54('0x14'))['db'];function respondWithStatusCode(_0x4c8e89,_0x4c8a6b){_0x4c8a6b=_0x4c8a6b||0xcc;return function(_0x3027a8){if(_0x3027a8){return _0x4c8e89['sendStatus'](_0x4c8a6b);}return _0x4c8e89[_0xea54('0x15')](_0x4c8a6b)['end']();};}function respondWithResult(_0x4bc36f,_0x482c9a){_0x482c9a=_0x482c9a||0xc8;return function(_0x3934d0){if(_0x3934d0){return _0x4bc36f[_0xea54('0x15')](_0x482c9a)[_0xea54('0x16')](_0x3934d0);}};}function respondWithFilteredResult(_0x2e801b,_0x11f5b3){return function(_0x81ac33){if(_0x81ac33){var _0xda23ff=typeof _0x11f5b3[_0xea54('0x17')]===_0xea54('0x18')&&typeof _0x11f5b3[_0xea54('0x19')]===_0xea54('0x18');var _0xdcb3cc=_0x81ac33[_0xea54('0x1a')];var _0x1888a7=_0xda23ff?0x0:_0x11f5b3[_0xea54('0x17')];var _0x17d6a2=_0xda23ff?_0x81ac33[_0xea54('0x1a')]:_0x11f5b3[_0xea54('0x17')]+_0x11f5b3[_0xea54('0x19')];var _0x52e22e;if(_0x17d6a2>=_0xdcb3cc){_0x17d6a2=_0xdcb3cc;_0x52e22e=0xc8;}else{_0x52e22e=0xce;}_0x2e801b['status'](_0x52e22e);return _0x2e801b[_0xea54('0x1b')](_0xea54('0x1c'),_0x1888a7+'-'+_0x17d6a2+'/'+_0xdcb3cc)[_0xea54('0x16')](_0x81ac33);}return null;};}function patchUpdates(_0x485048){return function(_0x487023){try{jsonpatch[_0xea54('0x1d')](_0x487023,_0x485048,!![]);}catch(_0x17a363){return BPromise[_0xea54('0x1e')](_0x17a363);}return _0x487023[_0xea54('0x1f')]();};}function saveUpdates(_0x23a014,_0x278e0a){return function(_0x1988ef){if(_0x1988ef){return _0x1988ef[_0xea54('0x20')](_0x23a014)[_0xea54('0x21')](function(_0x43e95f){return _0x43e95f;});}return null;};}function removeEntity(_0x2090a2,_0x4c9b1c){return function(_0x2afa83){if(_0x2afa83){return _0x2afa83[_0xea54('0x22')]()[_0xea54('0x21')](function(){_0x2090a2[_0xea54('0x15')](0xcc)[_0xea54('0x23')]();});}};}function handleEntityNotFound(_0x1ea056,_0x597d17){return function(_0x211d5e){if(!_0x211d5e){_0x1ea056[_0xea54('0x24')](0x194);}return _0x211d5e;};}function handleError(_0x1bc527,_0x35887d){_0x35887d=_0x35887d||0x1f4;return function(_0x335065){logger[_0xea54('0x25')](_0x335065[_0xea54('0x26')]);if(_0x335065[_0xea54('0x27')]){delete _0x335065['name'];}_0x1bc527[_0xea54('0x15')](_0x35887d)[_0xea54('0x28')](_0x335065);};}exports[_0xea54('0x29')]=function(_0x362fb7,_0x13b032){var _0x100a4f={},_0x394c5a={},_0x30c097={'count':0x0,'rows':[]};var _0x3062c1=_['map'](db[_0xea54('0x2a')]['rawAttributes'],function(_0x15f385){return{'name':_0x15f385[_0xea54('0x2b')],'type':_0x15f385[_0xea54('0x2c')][_0xea54('0x2d')]};});_0x394c5a[_0xea54('0x2e')]=_[_0xea54('0x2f')](_0x3062c1,_0xea54('0x27'));_0x394c5a['query']=_[_0xea54('0x30')](_0x362fb7[_0xea54('0x31')]);_0x394c5a[_0xea54('0x32')]=_[_0xea54('0x33')](_0x394c5a[_0xea54('0x2e')],_0x394c5a[_0xea54('0x31')]);_0x100a4f[_0xea54('0x34')]=_[_0xea54('0x33')](_0x394c5a[_0xea54('0x2e')],qs[_0xea54('0x35')](_0x362fb7['query'][_0xea54('0x35')]));_0x100a4f[_0xea54('0x34')]=_0x100a4f['attributes'][_0xea54('0x36')]?_0x100a4f[_0xea54('0x34')]:_0x394c5a[_0xea54('0x2e')];if(!_0x362fb7[_0xea54('0x31')]['hasOwnProperty'](_0xea54('0x37'))){_0x100a4f[_0xea54('0x19')]=qs['limit'](_0x362fb7[_0xea54('0x31')]['limit']);_0x100a4f[_0xea54('0x17')]=qs[_0xea54('0x17')](_0x362fb7[_0xea54('0x31')][_0xea54('0x17')]);}_0x100a4f['order']=qs['sort'](_0x362fb7[_0xea54('0x31')]['sort']);_0x100a4f[_0xea54('0x38')]=qs[_0xea54('0x32')](_[_0xea54('0x39')](_0x362fb7[_0xea54('0x31')],_0x394c5a[_0xea54('0x32')]),_0x3062c1);if(_0x362fb7[_0xea54('0x31')]['filter']){_0x100a4f[_0xea54('0x38')]=_[_0xea54('0x3a')](_0x100a4f[_0xea54('0x38')],{'$or':_[_0xea54('0x2f')](_0x3062c1,function(_0x5680ca){if(_0x5680ca[_0xea54('0x2c')]!==_0xea54('0x3b')){var _0x2724b4={};_0x2724b4[_0x5680ca[_0xea54('0x27')]]={'$like':'%'+_0x362fb7[_0xea54('0x31')][_0xea54('0x3c')]+'%'};return _0x2724b4;}})});}_0x100a4f=_[_0xea54('0x3a')]({},_0x100a4f,_0x362fb7[_0xea54('0x3d')]);var _0x352914={'where':_0x100a4f['where']};return db['IntegrationReport']['count'](_0x352914)['then'](function(_0x3192d2){_0x30c097[_0xea54('0x1a')]=_0x3192d2;if(_0x362fb7['query'][_0xea54('0x3e')]){_0x100a4f[_0xea54('0x3f')]=[{'all':!![]}];}return db[_0xea54('0x2a')][_0xea54('0x40')](_0x100a4f);})[_0xea54('0x21')](function(_0x1b4f39){_0x30c097[_0xea54('0x41')]=_0x1b4f39;return _0x30c097;})['then'](respondWithFilteredResult(_0x13b032,_0x100a4f))[_0xea54('0x42')](handleError(_0x13b032,null));};exports[_0xea54('0x43')]=function(_0x210f53,_0x26aee4){var _0x4a5c8b={'raw':![],'where':{'id':_0x210f53[_0xea54('0x44')]['id']}},_0x4b7527={};_0x4b7527[_0xea54('0x2e')]=_[_0xea54('0x30')](db['IntegrationReport'][_0xea54('0x45')]);_0x4b7527['query']=_[_0xea54('0x30')](_0x210f53[_0xea54('0x31')]);_0x4b7527['filters']=_[_0xea54('0x33')](_0x4b7527[_0xea54('0x2e')],_0x4b7527[_0xea54('0x31')]);_0x4a5c8b[_0xea54('0x34')]=_[_0xea54('0x33')](_0x4b7527[_0xea54('0x2e')],qs[_0xea54('0x35')](_0x210f53[_0xea54('0x31')]['fields']));_0x4a5c8b[_0xea54('0x34')]=_0x4a5c8b[_0xea54('0x34')][_0xea54('0x36')]?_0x4a5c8b['attributes']:_0x4b7527['model'];if(_0x210f53[_0xea54('0x31')][_0xea54('0x3e')]){_0x4a5c8b[_0xea54('0x3f')]=[{'all':!![]}];}_0x4a5c8b=_[_0xea54('0x3a')]({},_0x4a5c8b,_0x210f53[_0xea54('0x3d')]);return db[_0xea54('0x2a')][_0xea54('0x46')](_0x4a5c8b)[_0xea54('0x21')](handleEntityNotFound(_0x26aee4,null))[_0xea54('0x21')](respondWithResult(_0x26aee4,null))['catch'](handleError(_0x26aee4,null));};exports['create']=function(_0x57494c,_0x1acb52){return db[_0xea54('0x2a')][_0xea54('0x47')](_0x57494c['body'],{})[_0xea54('0x21')](respondWithResult(_0x1acb52,0xc9))['catch'](handleError(_0x1acb52,null));};exports[_0xea54('0x20')]=function(_0x43ea26,_0x372139){if(_0x43ea26[_0xea54('0x48')]['id']){delete _0x43ea26[_0xea54('0x48')]['id'];}return db[_0xea54('0x2a')][_0xea54('0x46')]({'where':{'id':_0x43ea26[_0xea54('0x44')]['id']}})['then'](handleEntityNotFound(_0x372139,null))['then'](saveUpdates(_0x43ea26[_0xea54('0x48')],null))[_0xea54('0x21')](respondWithResult(_0x372139,null))[_0xea54('0x42')](handleError(_0x372139,null));};exports[_0xea54('0x22')]=function(_0x225d1d,_0x40d4f8){return db['IntegrationReport'][_0xea54('0x46')]({'where':{'id':_0x225d1d[_0xea54('0x44')]['id']}})[_0xea54('0x21')](handleEntityNotFound(_0x40d4f8,null))[_0xea54('0x21')](removeEntity(_0x40d4f8,null))[_0xea54('0x42')](handleError(_0x40d4f8,null));};exports['describe']=function(_0x915bfe,_0x1abb0d){return db['IntegrationReport'][_0xea54('0x49')]()['then'](respondWithResult(_0x1abb0d,null))[_0xea54('0x42')](handleError(_0x1abb0d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 37b65c4..d93aa96 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4445=['bluebird','request-promise','path','rimraf','../../config/environment','IntegrationReport','util','api','moment'];(function(_0x4f3a4f,_0x8eba75){var _0x1fae5d=function(_0x1114bd){while(--_0x1114bd){_0x4f3a4f['push'](_0x4f3a4f['shift']());}};_0x1fae5d(++_0x8eba75);}(_0x4445,0xd5));var _0x5444=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x4445[_0x4996d5];return _0x4793f9;};'use strict';var _=require('lodash');var util=require(_0x5444('0x0'));var logger=require('../../config/logger')(_0x5444('0x1'));var moment=require(_0x5444('0x2'));var BPromise=require(_0x5444('0x3'));var rp=require(_0x5444('0x4'));var fs=require('fs');var path=require(_0x5444('0x5'));var rimraf=require(_0x5444('0x6'));var config=require(_0x5444('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x20a206,_0xdff2aa){return _0x20a206['define'](_0x5444('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe82f=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x4fe92e,_0x5d426d){var _0x92d5=function(_0x13eebe){while(--_0x13eebe){_0x4fe92e['push'](_0x4fe92e['shift']());}};_0x92d5(++_0x5d426d);}(_0xe82f,0x15b));var _0xfe82=function(_0x1b940f,_0x13bc26){_0x1b940f=_0x1b940f-0x0;var _0x306f25=_0xe82f[_0x1b940f];return _0x306f25;};'use strict';var _=require(_0xfe82('0x0'));var util=require(_0xfe82('0x1'));var logger=require(_0xfe82('0x2'))(_0xfe82('0x3'));var moment=require(_0xfe82('0x4'));var BPromise=require(_0xfe82('0x5'));var rp=require(_0xfe82('0x6'));var fs=require('fs');var path=require(_0xfe82('0x7'));var rimraf=require(_0xfe82('0x8'));var config=require(_0xfe82('0x9'));var attributes=require(_0xfe82('0xa'));module[_0xfe82('0xb')]=function(_0x27d3ec,_0x3d00c8){return _0x27d3ec[_0xfe82('0xc')](_0xfe82('0xd'),attributes,{'tableName':_0xfe82('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index eb979b0..f90fc89 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xf39e84,_0x825c93){var _0x58e41f=function(_0x3f2b03){while(--_0x3f2b03){_0xf39e84['push'](_0xf39e84['shift']());}};_0x58e41f(++_0x825c93);}(_0x2ef3,0xba));var _0x32ef=function(_0xd90d0e,_0x2fac7a){_0xd90d0e=_0xd90d0e-0x0;var _0x255f67=_0x2ef3[_0xd90d0e];return _0x255f67;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x10f995,_0x133b8e){var _0x22892e=function(_0x4896e0){while(--_0x4896e0){_0x10f995['push'](_0x10f995['shift']());}};_0x22892e(++_0x133b8e);}(_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']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a231227..f2c24ec 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc569=['../../config/environment','get','isAuthenticated','index','show','/:id/sub_intervals','create','post','/:id/sub_intervals/create_many','addIntervals','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34f565,_0x33a99a){var _0x3b7120=function(_0x4c8776){while(--_0x4c8776){_0x34f565['push'](_0x34f565['shift']());}};_0x3b7120(++_0x33a99a);}(_0xc569,0x159));var _0x9c56=function(_0x1b1a17,_0x1b6ce9){_0x1b1a17=_0x1b1a17-0x0;var _0x46c222=_0xc569[_0x1b1a17];return _0x46c222;};'use strict';var multer=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var path=require(_0x9c56('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c56('0x3'));var router=express[_0x9c56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c56('0x5'));var interaction=require(_0x9c56('0x6'));var config=require(_0x9c56('0x7'));var controller=require('./interval.controller');router[_0x9c56('0x8')]('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0xa')]);router[_0x9c56('0x8')]('/:id',auth[_0x9c56('0x9')](),controller[_0x9c56('0xb')]);router[_0x9c56('0x8')](_0x9c56('0xc'),auth[_0x9c56('0x9')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x9c56('0xd')]);router[_0x9c56('0xe')]('/:id/sub_intervals',auth[_0x9c56('0x9')](),controller['addInterval']);router[_0x9c56('0xe')](_0x9c56('0xf'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x10')]);router[_0x9c56('0x11')](_0x9c56('0x12'),auth[_0x9c56('0x9')](),controller['update']);router[_0x9c56('0x13')](_0x9c56('0x12'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x14')]);module[_0x9c56('0x15')]=router; \ No newline at end of file +var _0xc1db=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','index','isAuthenticated','get','/:id/sub_intervals','getIntervals','create','addInterval','post','put','/:id','update'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xc1db,0x120));var _0xbc1d=function(_0x17f24e,_0x5e722e){_0x17f24e=_0x17f24e-0x0;var _0x54311f=_0xc1db[_0x17f24e];return _0x54311f;};'use strict';var multer=require(_0xbc1d('0x0'));var util=require('util');var path=require(_0xbc1d('0x1'));var timeout=require(_0xbc1d('0x2'));var express=require(_0xbc1d('0x3'));var router=express[_0xbc1d('0x4')]();var fs_extra=require(_0xbc1d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbc1d('0x6'));var config=require(_0xbc1d('0x7'));var controller=require(_0xbc1d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc1d('0x9')]);router['get']('/:id',auth[_0xbc1d('0xa')](),controller['show']);router[_0xbc1d('0xb')](_0xbc1d('0xc'),auth['isAuthenticated'](),controller[_0xbc1d('0xd')]);router['post']('/',auth[_0xbc1d('0xa')](),controller[_0xbc1d('0xe')]);router['post'](_0xbc1d('0xc'),auth[_0xbc1d('0xa')](),controller[_0xbc1d('0xf')]);router[_0xbc1d('0x10')]('/:id/sub_intervals/create_many',auth[_0xbc1d('0xa')](),controller['addIntervals']);router[_0xbc1d('0x11')](_0xbc1d('0x12'),auth['isAuthenticated'](),controller[_0xbc1d('0x13')]);router[_0xbc1d('0x14')]('/:id',auth[_0xbc1d('0xa')](),controller[_0xbc1d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index d74162e..755ca71 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdeb=['exports','STRING','sequelize'];(function(_0x4a73d9,_0x1e93e0){var _0x23db2f=function(_0x427d17){while(--_0x427d17){_0x4a73d9['push'](_0x4a73d9['shift']());}};_0x23db2f(++_0x1e93e0);}(_0xbdeb,0x1af));var _0xbbde=function(_0xd405fb,_0xaaa0bd){_0xd405fb=_0xd405fb-0x0;var _0x211e1d=_0xbdeb[_0xd405fb];return _0x211e1d;};'use strict';var Sequelize=require(_0xbbde('0x0'));module[_0xbbde('0x1')]={'name':{'type':Sequelize[_0xbbde('0x2')]},'description':{'type':Sequelize[_0xbbde('0x2')]},'interval':{'type':Sequelize[_0xbbde('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x5d7a=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5d7a,0x133));var _0xa5d7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5d7a[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xa5d7('0x0'));module[_0xa5d7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa5d7('0x2')]},'interval':{'type':Sequelize[_0xa5d7('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 03022d3..0a4fd65 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8a8=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','destroy','get','Intervals','error','name','index','Interval','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','nolimit','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xb8a8,0xf0));var _0x8b8a=function(_0x3011e9,_0x73094c){_0x3011e9=_0x3011e9-0x0;var _0x386596=_0xb8a8[_0x3011e9];return _0x386596;};'use strict';var emlformat=require(_0x8b8a('0x0'));var rimraf=require(_0x8b8a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b8a('0x2'));var moment=require(_0x8b8a('0x3'));var BPromise=require(_0x8b8a('0x4'));var Mustache=require(_0x8b8a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8b8a('0x6'));var csv=require('to-csv');var ejs=require(_0x8b8a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b8a('0x8'));var squel=require(_0x8b8a('0x9'));var crypto=require(_0x8b8a('0xa'));var jsforce=require(_0x8b8a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8b8a('0xc'));var querystring=require(_0x8b8a('0xd'));var Papa=require(_0x8b8a('0xe'));var Redis=require(_0x8b8a('0xf'));var authService=require(_0x8b8a('0x10'));var qs=require(_0x8b8a('0x11'));var as=require(_0x8b8a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b8a('0x13'))('api');var utils=require(_0x8b8a('0x14'));var config=require(_0x8b8a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b8a('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x8f7637,_0x2477fe){_0x2477fe=_0x2477fe||0xcc;return function(_0x2571e7){if(_0x2571e7){return _0x8f7637[_0x8b8a('0x17')](_0x2477fe);}return _0x8f7637[_0x8b8a('0x18')](_0x2477fe)['end']();};}function respondWithResult(_0x52459c,_0x5540f9){_0x5540f9=_0x5540f9||0xc8;return function(_0x94a095){if(_0x94a095){return _0x52459c['status'](_0x5540f9)[_0x8b8a('0x19')](_0x94a095);}};}function respondWithFilteredResult(_0x57caf0,_0x18d7b0){return function(_0x658e38){if(_0x658e38){var _0x3fc243=typeof _0x18d7b0['offset']===_0x8b8a('0x1a')&&typeof _0x18d7b0[_0x8b8a('0x1b')]===_0x8b8a('0x1a');var _0x37f078=_0x658e38['count'];var _0x5db979=_0x3fc243?0x0:_0x18d7b0[_0x8b8a('0x1c')];var _0x4573ca=_0x3fc243?_0x658e38[_0x8b8a('0x1d')]:_0x18d7b0[_0x8b8a('0x1c')]+_0x18d7b0[_0x8b8a('0x1b')];var _0x1dd10b;if(_0x4573ca>=_0x37f078){_0x4573ca=_0x37f078;_0x1dd10b=0xc8;}else{_0x1dd10b=0xce;}_0x57caf0[_0x8b8a('0x18')](_0x1dd10b);return _0x57caf0['set'](_0x8b8a('0x1e'),_0x5db979+'-'+_0x4573ca+'/'+_0x37f078)[_0x8b8a('0x19')](_0x658e38);}return null;};}function patchUpdates(_0x56cdb3){return function(_0x3e9628){try{jsonpatch[_0x8b8a('0x1f')](_0x3e9628,_0x56cdb3,!![]);}catch(_0x4cfc2e){return BPromise['reject'](_0x4cfc2e);}return _0x3e9628[_0x8b8a('0x20')]();};}function saveUpdates(_0xa50d5a,_0x18437b){return function(_0x39aced){if(_0x39aced){return _0x39aced[_0x8b8a('0x21')](_0xa50d5a)[_0x8b8a('0x22')](function(_0x496f02){return _0x496f02;});}return null;};}function removeEntity(_0xd78dfa,_0x5f4e1f){return function(_0x41c80b){if(_0x41c80b){return _0x41c80b[_0x8b8a('0x23')]()[_0x8b8a('0x22')](function(){var _0x4098d6=_0x41c80b[_0x8b8a('0x24')]({'plain':!![]});var _0x4e736c=_0x8b8a('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e736c,'resourceId':_0x4098d6['id']}})[_0x8b8a('0x22')](function(){return _0x41c80b;});})[_0x8b8a('0x22')](function(){_0xd78dfa[_0x8b8a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420521,_0x2de352){return function(_0x5390cd){if(!_0x5390cd){_0x420521[_0x8b8a('0x17')](0x194);}return _0x5390cd;};}function handleError(_0x5deec2,_0x1f6027){_0x1f6027=_0x1f6027||0x1f4;return function(_0x8ef10c){logger[_0x8b8a('0x26')](_0x8ef10c['stack']);if(_0x8ef10c[_0x8b8a('0x27')]){delete _0x8ef10c['name'];}_0x5deec2[_0x8b8a('0x18')](_0x1f6027)['send'](_0x8ef10c);};}exports[_0x8b8a('0x28')]=function(_0x4ae2f8,_0x2425c7){var _0x2bebd0={},_0xe95a06={},_0x164cbd={'count':0x0,'rows':[]};var _0x41ccf0=_['map'](db[_0x8b8a('0x29')][_0x8b8a('0x2a')],function(_0x4b6672){return{'name':_0x4b6672[_0x8b8a('0x2b')],'type':_0x4b6672[_0x8b8a('0x2c')][_0x8b8a('0x2d')]};});_0xe95a06['model']=_[_0x8b8a('0x2e')](_0x41ccf0,'name');_0xe95a06[_0x8b8a('0x2f')]=_[_0x8b8a('0x30')](_0x4ae2f8[_0x8b8a('0x2f')]);_0xe95a06[_0x8b8a('0x31')]=_[_0x8b8a('0x32')](_0xe95a06[_0x8b8a('0x33')],_0xe95a06[_0x8b8a('0x2f')]);_0x2bebd0['attributes']=_['intersection'](_0xe95a06[_0x8b8a('0x33')],qs[_0x8b8a('0x34')](_0x4ae2f8[_0x8b8a('0x2f')]['fields']));_0x2bebd0[_0x8b8a('0x35')]=_0x2bebd0[_0x8b8a('0x35')][_0x8b8a('0x36')]?_0x2bebd0[_0x8b8a('0x35')]:_0xe95a06['model'];if(!_0x4ae2f8[_0x8b8a('0x2f')][_0x8b8a('0x37')]('nolimit')){_0x2bebd0[_0x8b8a('0x1b')]=qs['limit'](_0x4ae2f8['query'][_0x8b8a('0x1b')]);_0x2bebd0['offset']=qs[_0x8b8a('0x1c')](_0x4ae2f8['query']['offset']);}_0x2bebd0['order']=qs[_0x8b8a('0x38')](_0x4ae2f8[_0x8b8a('0x2f')]['sort']);_0x2bebd0[_0x8b8a('0x39')]=qs[_0x8b8a('0x31')](_[_0x8b8a('0x3a')](_0x4ae2f8[_0x8b8a('0x2f')],_0xe95a06['filters']),_0x41ccf0);if(_0x4ae2f8[_0x8b8a('0x2f')][_0x8b8a('0x3b')]){_0x2bebd0[_0x8b8a('0x39')]=_[_0x8b8a('0x3c')](_0x2bebd0[_0x8b8a('0x39')],{'$or':_[_0x8b8a('0x2e')](_0x41ccf0,function(_0x1d26ea){if(_0x1d26ea[_0x8b8a('0x2c')]!==_0x8b8a('0x3d')){var _0x11111b={};_0x11111b[_0x1d26ea[_0x8b8a('0x27')]]={'$like':'%'+_0x4ae2f8['query'][_0x8b8a('0x3b')]+'%'};return _0x11111b;}})});}_0x2bebd0=_[_0x8b8a('0x3c')]({},_0x2bebd0,_0x4ae2f8[_0x8b8a('0x3e')]);var _0x463788={'where':_0x2bebd0[_0x8b8a('0x39')]};return db[_0x8b8a('0x29')][_0x8b8a('0x1d')](_0x463788)[_0x8b8a('0x22')](function(_0x3e809c){_0x164cbd[_0x8b8a('0x1d')]=_0x3e809c;if(_0x4ae2f8[_0x8b8a('0x2f')][_0x8b8a('0x3f')]){_0x2bebd0['include']=[{'all':!![]}];}return db[_0x8b8a('0x29')]['findAll'](_0x2bebd0);})['then'](function(_0x5444c0){_0x164cbd[_0x8b8a('0x40')]=_0x5444c0;return _0x164cbd;})[_0x8b8a('0x22')](respondWithFilteredResult(_0x2425c7,_0x2bebd0))['catch'](handleError(_0x2425c7,null));};exports[_0x8b8a('0x41')]=function(_0x16e860,_0x5c9e80){var _0x381cfc={'raw':!![],'where':{'id':_0x16e860[_0x8b8a('0x42')]['id']}},_0xf6d60d={};_0xf6d60d[_0x8b8a('0x33')]=_[_0x8b8a('0x30')](db[_0x8b8a('0x29')][_0x8b8a('0x2a')]);_0xf6d60d[_0x8b8a('0x2f')]=_['keys'](_0x16e860[_0x8b8a('0x2f')]);_0xf6d60d[_0x8b8a('0x31')]=_[_0x8b8a('0x32')](_0xf6d60d[_0x8b8a('0x33')],_0xf6d60d['query']);_0x381cfc[_0x8b8a('0x35')]=_[_0x8b8a('0x32')](_0xf6d60d['model'],qs[_0x8b8a('0x34')](_0x16e860[_0x8b8a('0x2f')][_0x8b8a('0x34')]));_0x381cfc[_0x8b8a('0x35')]=_0x381cfc[_0x8b8a('0x35')][_0x8b8a('0x36')]?_0x381cfc[_0x8b8a('0x35')]:_0xf6d60d['model'];if(_0x16e860[_0x8b8a('0x2f')][_0x8b8a('0x3f')]){_0x381cfc['include']=[{'all':!![]}];}_0x381cfc=_['merge']({},_0x381cfc,_0x16e860[_0x8b8a('0x3e')]);return db['Interval'][_0x8b8a('0x43')](_0x381cfc)['then'](handleEntityNotFound(_0x5c9e80,null))[_0x8b8a('0x22')](respondWithResult(_0x5c9e80,null))[_0x8b8a('0x44')](handleError(_0x5c9e80,null));};exports['create']=function(_0x1d1570,_0x1aa5bf){return db[_0x8b8a('0x29')][_0x8b8a('0x45')](_0x1d1570[_0x8b8a('0x46')],{})[_0x8b8a('0x22')](function(_0x4263ee){var _0x143929=_0x1d1570[_0x8b8a('0x47')][_0x8b8a('0x24')]({'plain':!![]});if(!_0x143929)throw new Error(_0x8b8a('0x48'));if(_0x143929[_0x8b8a('0x49')]===_0x8b8a('0x47')){var _0x45ad64=_0x4263ee[_0x8b8a('0x24')]({'plain':!![]});var _0x5ee3db=_0x8b8a('0x25');return db[_0x8b8a('0x4a')][_0x8b8a('0x43')]({'where':{'name':_0x5ee3db,'userProfileId':_0x143929['userProfileId']},'raw':!![]})[_0x8b8a('0x22')](function(_0x503ca4){if(_0x503ca4&&_0x503ca4[_0x8b8a('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x45ad64[_0x8b8a('0x27')],'resourceId':_0x45ad64['id'],'type':_0x503ca4[_0x8b8a('0x27')],'sectionId':_0x503ca4['id']},{})[_0x8b8a('0x22')](function(){return _0x4263ee;});}else{return _0x4263ee;}})['catch'](function(_0x3f3fb9){logger[_0x8b8a('0x26')](_0x8b8a('0x4c'),_0x3f3fb9);throw _0x3f3fb9;});}return _0x4263ee;})[_0x8b8a('0x22')](respondWithResult(_0x1aa5bf,0xc9))['catch'](handleError(_0x1aa5bf,null));};exports['update']=function(_0xa01e6d,_0x3d2bf2){if(_0xa01e6d[_0x8b8a('0x46')]['id']){delete _0xa01e6d[_0x8b8a('0x46')]['id'];}return db[_0x8b8a('0x29')][_0x8b8a('0x43')]({'where':{'id':_0xa01e6d[_0x8b8a('0x42')]['id']}})[_0x8b8a('0x22')](handleEntityNotFound(_0x3d2bf2,null))['then'](saveUpdates(_0xa01e6d[_0x8b8a('0x46')],null))[_0x8b8a('0x22')](respondWithResult(_0x3d2bf2,null))[_0x8b8a('0x44')](handleError(_0x3d2bf2,null));};exports[_0x8b8a('0x23')]=function(_0x3e3951,_0x4b7657){return db[_0x8b8a('0x29')]['find']({'where':{'id':_0x3e3951[_0x8b8a('0x42')]['id']}})[_0x8b8a('0x22')](handleEntityNotFound(_0x4b7657,null))['then'](removeEntity(_0x4b7657,null))[_0x8b8a('0x44')](handleError(_0x4b7657,null));};exports[_0x8b8a('0x4d')]=function(_0xc9b146,_0x539ea8,_0x1bc18b){if(_0xc9b146[_0x8b8a('0x46')]['id']){delete _0xc9b146[_0x8b8a('0x46')]['id'];}return db[_0x8b8a('0x29')]['find']({'where':{'id':_0xc9b146[_0x8b8a('0x42')]['id']}})[_0x8b8a('0x22')](handleEntityNotFound(_0x539ea8,null))['then'](function(_0xc30f86){if(_0xc30f86){_0xc9b146['body'][_0x8b8a('0x4e')]=_0xc30f86['id'];return db[_0x8b8a('0x29')][_0x8b8a('0x45')](_0xc9b146[_0x8b8a('0x46')]);}})['then'](respondWithResult(_0x539ea8,null))[_0x8b8a('0x44')](handleError(_0x539ea8,null));};exports['getIntervals']=function(_0x10bce7,_0x49b4a3,_0x11d13e){var _0x493a8d={};var _0x3d25aa={};var _0x37eb53;var _0x2e0817;return db[_0x8b8a('0x29')][_0x8b8a('0x4f')]({'where':{'id':_0x10bce7[_0x8b8a('0x42')]['id']}})[_0x8b8a('0x22')](handleEntityNotFound(_0x49b4a3,null))[_0x8b8a('0x22')](function(_0x6b0997){if(_0x6b0997){_0x37eb53=_0x6b0997;_0x3d25aa['model']=_[_0x8b8a('0x30')](db[_0x8b8a('0x29')][_0x8b8a('0x2a')]);_0x3d25aa[_0x8b8a('0x2f')]=_[_0x8b8a('0x30')](_0x10bce7[_0x8b8a('0x2f')]);_0x3d25aa[_0x8b8a('0x31')]=_[_0x8b8a('0x32')](_0x3d25aa[_0x8b8a('0x33')],_0x3d25aa['query']);_0x493a8d[_0x8b8a('0x35')]=_[_0x8b8a('0x32')](_0x3d25aa['model'],qs[_0x8b8a('0x34')](_0x10bce7['query'][_0x8b8a('0x34')]));_0x493a8d[_0x8b8a('0x35')]=_0x493a8d[_0x8b8a('0x35')]['length']?_0x493a8d[_0x8b8a('0x35')]:_0x3d25aa[_0x8b8a('0x33')];_0x493a8d['order']=qs['sort'](_0x10bce7[_0x8b8a('0x2f')][_0x8b8a('0x38')]);_0x493a8d['where']=qs['filters'](_['pick'](_0x10bce7[_0x8b8a('0x2f')],_0x3d25aa[_0x8b8a('0x31')]));if(_0x10bce7[_0x8b8a('0x2f')][_0x8b8a('0x3b')]){_0x493a8d[_0x8b8a('0x39')]=_['merge'](_0x493a8d[_0x8b8a('0x39')],{'$or':_['map'](_0x493a8d[_0x8b8a('0x35')],function(_0x2c4e21){var _0x3712e1={};_0x3712e1[_0x2c4e21]={'$like':'%'+_0x10bce7[_0x8b8a('0x2f')][_0x8b8a('0x3b')]+'%'};return _0x3712e1;})});}_0x493a8d=_['merge']({},_0x493a8d,_0x10bce7['options']);return _0x37eb53['getIntervals'](_0x493a8d);}})[_0x8b8a('0x22')](function(_0x54fc20){if(_0x54fc20){_0x2e0817=_0x54fc20[_0x8b8a('0x36')];if(!_0x10bce7[_0x8b8a('0x2f')][_0x8b8a('0x37')](_0x8b8a('0x50'))){_0x493a8d['limit']=qs[_0x8b8a('0x1b')](_0x10bce7[_0x8b8a('0x2f')][_0x8b8a('0x1b')]);_0x493a8d[_0x8b8a('0x1c')]=qs['offset'](_0x10bce7[_0x8b8a('0x2f')][_0x8b8a('0x1c')]);}return _0x37eb53[_0x8b8a('0x51')](_0x493a8d);}})['then'](function(_0x1d505c){if(_0x1d505c){return _0x1d505c?{'count':_0x2e0817,'rows':_0x1d505c}:null;}})[_0x8b8a('0x22')](respondWithResult(_0x49b4a3,null))[_0x8b8a('0x44')](handleError(_0x49b4a3,null));};exports[_0x8b8a('0x52')]=function(_0x26ad6a,_0x1b83dd,_0x164854){return db['Interval'][_0x8b8a('0x4f')]({'where':{'id':_0x26ad6a[_0x8b8a('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b83dd,null))[_0x8b8a('0x22')](function(_0x180dad){if(_0x180dad){return db[_0x8b8a('0x53')][_0x8b8a('0x54')](function(_0x33be6c){return db['Interval'][_0x8b8a('0x23')]({'where':{'IntervalId':_0x26ad6a[_0x8b8a('0x42')]['id']},'transaction':_0x33be6c})[_0x8b8a('0x22')](function(_0xe687b1){var _0x3143c0=_[_0x8b8a('0x2e')](_0x26ad6a[_0x8b8a('0x46')],function(_0x486519){delete _0x486519['id'];_0x486519[_0x8b8a('0x4e')]=_0x26ad6a['params']['id'];return _0x486519;});return db[_0x8b8a('0x29')][_0x8b8a('0x55')](_0x3143c0,{'transaction':_0x33be6c});});})[_0x8b8a('0x22')](function(){return db[_0x8b8a('0x29')]['findAll']({'where':{'IntervalId':_0x26ad6a[_0x8b8a('0x42')]['id']}});});}})[_0x8b8a('0x22')](respondWithResult(_0x1b83dd,null))['catch'](handleError(_0x1b83dd,null));}; \ No newline at end of file +var _0x5f77=['getIntervals','findOne','where','addIntervals','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','Intervals','UserProfileResource','error','send','map','Interval','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','name','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval'];(function(_0x4c8abf,_0x4c8018){var _0x911676=function(_0x4b11b3){while(--_0x4b11b3){_0x4c8abf['push'](_0x4c8abf['shift']());}};_0x911676(++_0x4c8018);}(_0x5f77,0x1cd));var _0x75f7=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x5f77[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x75f7('0x0'));var rimraf=require(_0x75f7('0x1'));var zipdir=require(_0x75f7('0x2'));var jsonpatch=require(_0x75f7('0x3'));var rp=require(_0x75f7('0x4'));var moment=require(_0x75f7('0x5'));var BPromise=require(_0x75f7('0x6'));var Mustache=require(_0x75f7('0x7'));var util=require(_0x75f7('0x8'));var path=require(_0x75f7('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x75f7('0xa'));var fs=require('fs');var fs_extra=require(_0x75f7('0xb'));var _=require('lodash');var squel=require(_0x75f7('0xc'));var crypto=require(_0x75f7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x75f7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x75f7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x75f7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x75f7('0x11'));var hardwareService=require(_0x75f7('0x12'));var logger=require(_0x75f7('0x13'))(_0x75f7('0x14'));var utils=require(_0x75f7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x75f7('0x16'));var db=require(_0x75f7('0x17'))['db'];var extensions=require(_0x75f7('0x18'));function respondWithStatusCode(_0x45ce4d,_0x2b12af){_0x2b12af=_0x2b12af||0xcc;return function(_0x4b24ef){if(_0x4b24ef){return _0x45ce4d[_0x75f7('0x19')](_0x2b12af);}return _0x45ce4d[_0x75f7('0x1a')](_0x2b12af)[_0x75f7('0x1b')]();};}function respondWithResult(_0x43b345,_0x317bdc){_0x317bdc=_0x317bdc||0xc8;return function(_0x251d17){if(_0x251d17){return _0x43b345[_0x75f7('0x1a')](_0x317bdc)[_0x75f7('0x1c')](_0x251d17);}};}function respondWithFilteredResult(_0x146847,_0x15d648){return function(_0x3a6583){if(_0x3a6583){var _0x647cbe=typeof _0x15d648[_0x75f7('0x1d')]===_0x75f7('0x1e')&&typeof _0x15d648[_0x75f7('0x1f')]===_0x75f7('0x1e');var _0x237b8c=_0x3a6583[_0x75f7('0x20')];var _0x102b16=_0x647cbe?0x0:_0x15d648[_0x75f7('0x1d')];var _0xcbe3e8=_0x647cbe?_0x3a6583[_0x75f7('0x20')]:_0x15d648[_0x75f7('0x1d')]+_0x15d648['limit'];var _0x255ac2;if(_0xcbe3e8>=_0x237b8c){_0xcbe3e8=_0x237b8c;_0x255ac2=0xc8;}else{_0x255ac2=0xce;}_0x146847[_0x75f7('0x1a')](_0x255ac2);return _0x146847[_0x75f7('0x21')](_0x75f7('0x22'),_0x102b16+'-'+_0xcbe3e8+'/'+_0x237b8c)['json'](_0x3a6583);}return null;};}function patchUpdates(_0x186597){return function(_0x1a6cee){try{jsonpatch['apply'](_0x1a6cee,_0x186597,!![]);}catch(_0x4e781c){return BPromise[_0x75f7('0x23')](_0x4e781c);}return _0x1a6cee[_0x75f7('0x24')]();};}function saveUpdates(_0x241900,_0x464368){return function(_0x21852c){if(_0x21852c){return _0x21852c['update'](_0x241900)[_0x75f7('0x25')](function(_0x2d4d31){return _0x2d4d31;});}return null;};}function removeEntity(_0xe9c41d,_0x59efc5){return function(_0x642eb2){if(_0x642eb2){return _0x642eb2[_0x75f7('0x26')]()[_0x75f7('0x25')](function(){var _0x29d5d6=_0x642eb2[_0x75f7('0x27')]({'plain':!![]});var _0x46f694=_0x75f7('0x28');return db[_0x75f7('0x29')]['destroy']({'where':{'type':_0x46f694,'resourceId':_0x29d5d6['id']}})['then'](function(){return _0x642eb2;});})['then'](function(){_0xe9c41d[_0x75f7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x279ca5,_0x55b9a9){return function(_0x4e2fc1){if(!_0x4e2fc1){_0x279ca5['sendStatus'](0x194);}return _0x4e2fc1;};}function handleError(_0x188379,_0x1435b2){_0x1435b2=_0x1435b2||0x1f4;return function(_0xfbd489){logger[_0x75f7('0x2a')](_0xfbd489['stack']);if(_0xfbd489['name']){delete _0xfbd489['name'];}_0x188379[_0x75f7('0x1a')](_0x1435b2)[_0x75f7('0x2b')](_0xfbd489);};}exports['index']=function(_0x406cc3,_0x1954c8){var _0x438115={},_0x13429c={},_0x4a27a1={'count':0x0,'rows':[]};var _0x25a1e1=_[_0x75f7('0x2c')](db[_0x75f7('0x2d')]['rawAttributes'],function(_0x29225b){return{'name':_0x29225b[_0x75f7('0x2e')],'type':_0x29225b['type'][_0x75f7('0x2f')]};});_0x13429c[_0x75f7('0x30')]=_[_0x75f7('0x2c')](_0x25a1e1,'name');_0x13429c[_0x75f7('0x31')]=_['keys'](_0x406cc3[_0x75f7('0x31')]);_0x13429c[_0x75f7('0x32')]=_['intersection'](_0x13429c[_0x75f7('0x30')],_0x13429c[_0x75f7('0x31')]);_0x438115['attributes']=_[_0x75f7('0x33')](_0x13429c[_0x75f7('0x30')],qs[_0x75f7('0x34')](_0x406cc3[_0x75f7('0x31')][_0x75f7('0x34')]));_0x438115[_0x75f7('0x35')]=_0x438115[_0x75f7('0x35')][_0x75f7('0x36')]?_0x438115[_0x75f7('0x35')]:_0x13429c[_0x75f7('0x30')];if(!_0x406cc3[_0x75f7('0x31')][_0x75f7('0x37')](_0x75f7('0x38'))){_0x438115[_0x75f7('0x1f')]=qs[_0x75f7('0x1f')](_0x406cc3[_0x75f7('0x31')][_0x75f7('0x1f')]);_0x438115['offset']=qs[_0x75f7('0x1d')](_0x406cc3[_0x75f7('0x31')]['offset']);}_0x438115[_0x75f7('0x39')]=qs[_0x75f7('0x3a')](_0x406cc3[_0x75f7('0x31')]['sort']);_0x438115['where']=qs[_0x75f7('0x32')](_[_0x75f7('0x3b')](_0x406cc3['query'],_0x13429c[_0x75f7('0x32')]),_0x25a1e1);if(_0x406cc3[_0x75f7('0x31')][_0x75f7('0x3c')]){_0x438115['where']=_[_0x75f7('0x3d')](_0x438115['where'],{'$or':_['map'](_0x25a1e1,function(_0x380496){if(_0x380496[_0x75f7('0x3e')]!==_0x75f7('0x3f')){var _0x5411cb={};_0x5411cb[_0x380496[_0x75f7('0x40')]]={'$like':'%'+_0x406cc3[_0x75f7('0x31')][_0x75f7('0x3c')]+'%'};return _0x5411cb;}})});}_0x438115=_[_0x75f7('0x3d')]({},_0x438115,_0x406cc3[_0x75f7('0x41')]);var _0x3ec1a8={'where':_0x438115['where']};return db['Interval']['count'](_0x3ec1a8)[_0x75f7('0x25')](function(_0x35d97d){_0x4a27a1[_0x75f7('0x20')]=_0x35d97d;if(_0x406cc3['query'][_0x75f7('0x42')]){_0x438115['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x438115);})[_0x75f7('0x25')](function(_0x2d0b39){_0x4a27a1[_0x75f7('0x43')]=_0x2d0b39;return _0x4a27a1;})[_0x75f7('0x25')](respondWithFilteredResult(_0x1954c8,_0x438115))[_0x75f7('0x44')](handleError(_0x1954c8,null));};exports[_0x75f7('0x45')]=function(_0x372c12,_0x39a76b){var _0x15cdbc={'raw':!![],'where':{'id':_0x372c12[_0x75f7('0x46')]['id']}},_0x533094={};_0x533094[_0x75f7('0x30')]=_[_0x75f7('0x47')](db['Interval'][_0x75f7('0x48')]);_0x533094[_0x75f7('0x31')]=_[_0x75f7('0x47')](_0x372c12[_0x75f7('0x31')]);_0x533094['filters']=_[_0x75f7('0x33')](_0x533094['model'],_0x533094[_0x75f7('0x31')]);_0x15cdbc['attributes']=_['intersection'](_0x533094[_0x75f7('0x30')],qs[_0x75f7('0x34')](_0x372c12[_0x75f7('0x31')]['fields']));_0x15cdbc['attributes']=_0x15cdbc['attributes'][_0x75f7('0x36')]?_0x15cdbc[_0x75f7('0x35')]:_0x533094[_0x75f7('0x30')];if(_0x372c12[_0x75f7('0x31')]['includeAll']){_0x15cdbc[_0x75f7('0x49')]=[{'all':!![]}];}_0x15cdbc=_[_0x75f7('0x3d')]({},_0x15cdbc,_0x372c12[_0x75f7('0x41')]);return db[_0x75f7('0x2d')][_0x75f7('0x4a')](_0x15cdbc)[_0x75f7('0x25')](handleEntityNotFound(_0x39a76b,null))[_0x75f7('0x25')](respondWithResult(_0x39a76b,null))[_0x75f7('0x44')](handleError(_0x39a76b,null));};exports[_0x75f7('0x4b')]=function(_0x8a4455,_0x12daef){return db[_0x75f7('0x2d')][_0x75f7('0x4b')](_0x8a4455[_0x75f7('0x4c')],{})[_0x75f7('0x25')](function(_0x164e1a){var _0x2fdcc2=_0x8a4455[_0x75f7('0x4d')][_0x75f7('0x27')]({'plain':!![]});if(!_0x2fdcc2)throw new Error(_0x75f7('0x4e'));if(_0x2fdcc2[_0x75f7('0x4f')]===_0x75f7('0x4d')){var _0x249565=_0x164e1a[_0x75f7('0x27')]({'plain':!![]});var _0x435d7a='Intervals';return db[_0x75f7('0x50')][_0x75f7('0x4a')]({'where':{'name':_0x435d7a,'userProfileId':_0x2fdcc2[_0x75f7('0x51')]},'raw':!![]})[_0x75f7('0x25')](function(_0xa899bc){if(_0xa899bc&&_0xa899bc['autoAssociation']===0x0){return db[_0x75f7('0x29')][_0x75f7('0x4b')]({'name':_0x249565[_0x75f7('0x40')],'resourceId':_0x249565['id'],'type':_0xa899bc[_0x75f7('0x40')],'sectionId':_0xa899bc['id']},{})[_0x75f7('0x25')](function(){return _0x164e1a;});}else{return _0x164e1a;}})[_0x75f7('0x44')](function(_0x4b141d){logger['error'](_0x75f7('0x52'),_0x4b141d);throw _0x4b141d;});}return _0x164e1a;})[_0x75f7('0x25')](respondWithResult(_0x12daef,0xc9))['catch'](handleError(_0x12daef,null));};exports[_0x75f7('0x53')]=function(_0x98f02b,_0x5044d4){if(_0x98f02b[_0x75f7('0x4c')]['id']){delete _0x98f02b[_0x75f7('0x4c')]['id'];}return db[_0x75f7('0x2d')][_0x75f7('0x4a')]({'where':{'id':_0x98f02b[_0x75f7('0x46')]['id']}})[_0x75f7('0x25')](handleEntityNotFound(_0x5044d4,null))['then'](saveUpdates(_0x98f02b['body'],null))[_0x75f7('0x25')](respondWithResult(_0x5044d4,null))[_0x75f7('0x44')](handleError(_0x5044d4,null));};exports[_0x75f7('0x26')]=function(_0x507573,_0xc83998){return db[_0x75f7('0x2d')][_0x75f7('0x4a')]({'where':{'id':_0x507573['params']['id']}})[_0x75f7('0x25')](handleEntityNotFound(_0xc83998,null))['then'](removeEntity(_0xc83998,null))['catch'](handleError(_0xc83998,null));};exports[_0x75f7('0x54')]=function(_0x2852ef,_0x4e3e2f,_0x4e448a){if(_0x2852ef[_0x75f7('0x4c')]['id']){delete _0x2852ef[_0x75f7('0x4c')]['id'];}return db[_0x75f7('0x2d')][_0x75f7('0x4a')]({'where':{'id':_0x2852ef[_0x75f7('0x46')]['id']}})[_0x75f7('0x25')](handleEntityNotFound(_0x4e3e2f,null))[_0x75f7('0x25')](function(_0x41eb97){if(_0x41eb97){_0x2852ef['body']['IntervalId']=_0x41eb97['id'];return db[_0x75f7('0x2d')][_0x75f7('0x4b')](_0x2852ef['body']);}})[_0x75f7('0x25')](respondWithResult(_0x4e3e2f,null))['catch'](handleError(_0x4e3e2f,null));};exports[_0x75f7('0x55')]=function(_0x39a7d3,_0x206592,_0x56714e){var _0x223d6f={};var _0x225302={};var _0x4f68af;var _0x2ee362;return db[_0x75f7('0x2d')][_0x75f7('0x56')]({'where':{'id':_0x39a7d3[_0x75f7('0x46')]['id']}})['then'](handleEntityNotFound(_0x206592,null))['then'](function(_0x4179b){if(_0x4179b){_0x4f68af=_0x4179b;_0x225302[_0x75f7('0x30')]=_[_0x75f7('0x47')](db[_0x75f7('0x2d')][_0x75f7('0x48')]);_0x225302[_0x75f7('0x31')]=_[_0x75f7('0x47')](_0x39a7d3[_0x75f7('0x31')]);_0x225302[_0x75f7('0x32')]=_[_0x75f7('0x33')](_0x225302['model'],_0x225302[_0x75f7('0x31')]);_0x223d6f[_0x75f7('0x35')]=_[_0x75f7('0x33')](_0x225302[_0x75f7('0x30')],qs[_0x75f7('0x34')](_0x39a7d3['query'][_0x75f7('0x34')]));_0x223d6f[_0x75f7('0x35')]=_0x223d6f[_0x75f7('0x35')][_0x75f7('0x36')]?_0x223d6f[_0x75f7('0x35')]:_0x225302[_0x75f7('0x30')];_0x223d6f[_0x75f7('0x39')]=qs['sort'](_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x3a')]);_0x223d6f[_0x75f7('0x57')]=qs[_0x75f7('0x32')](_[_0x75f7('0x3b')](_0x39a7d3[_0x75f7('0x31')],_0x225302['filters']));if(_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x3c')]){_0x223d6f[_0x75f7('0x57')]=_[_0x75f7('0x3d')](_0x223d6f[_0x75f7('0x57')],{'$or':_[_0x75f7('0x2c')](_0x223d6f[_0x75f7('0x35')],function(_0x4946b8){var _0x102bf8={};_0x102bf8[_0x4946b8]={'$like':'%'+_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x3c')]+'%'};return _0x102bf8;})});}_0x223d6f=_[_0x75f7('0x3d')]({},_0x223d6f,_0x39a7d3[_0x75f7('0x41')]);return _0x4f68af['getIntervals'](_0x223d6f);}})[_0x75f7('0x25')](function(_0x3d8e12){if(_0x3d8e12){_0x2ee362=_0x3d8e12['length'];if(!_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x37')]('nolimit')){_0x223d6f['limit']=qs['limit'](_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x1f')]);_0x223d6f['offset']=qs[_0x75f7('0x1d')](_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x1d')]);}return _0x4f68af['getIntervals'](_0x223d6f);}})[_0x75f7('0x25')](function(_0x1e7838){if(_0x1e7838){return _0x1e7838?{'count':_0x2ee362,'rows':_0x1e7838}:null;}})[_0x75f7('0x25')](respondWithResult(_0x206592,null))[_0x75f7('0x44')](handleError(_0x206592,null));};exports[_0x75f7('0x58')]=function(_0x16cf07,_0x8edfd7,_0x18b129){return db['Interval'][_0x75f7('0x56')]({'where':{'id':_0x16cf07[_0x75f7('0x46')]['id']}})['then'](handleEntityNotFound(_0x8edfd7,null))[_0x75f7('0x25')](function(_0x2ea105){if(_0x2ea105){return db['sequelize'][_0x75f7('0x59')](function(_0x3182ab){return db[_0x75f7('0x2d')]['destroy']({'where':{'IntervalId':_0x16cf07[_0x75f7('0x46')]['id']},'transaction':_0x3182ab})[_0x75f7('0x25')](function(_0x98f32){var _0x5ab803=_[_0x75f7('0x2c')](_0x16cf07[_0x75f7('0x4c')],function(_0x4812ce){delete _0x4812ce['id'];_0x4812ce['IntervalId']=_0x16cf07[_0x75f7('0x46')]['id'];return _0x4812ce;});return db['Interval']['bulkCreate'](_0x5ab803,{'transaction':_0x3182ab});});})[_0x75f7('0x25')](function(){return db['Interval'][_0x75f7('0x5a')]({'where':{'IntervalId':_0x16cf07['params']['id']}});});}})[_0x75f7('0x25')](respondWithResult(_0x8edfd7,null))[_0x75f7('0x44')](handleError(_0x8edfd7,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 3493a6c..7001439 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b76=['rewrite','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals'];(function(_0x936f1f,_0x2eaf2f){var _0xb36ff7=function(_0x4877ac){while(--_0x4877ac){_0x936f1f['push'](_0x936f1f['shift']());}};_0xb36ff7(++_0x2eaf2f);}(_0x6b76,0xe8));var _0x66b7=function(_0x303b2d,_0xfbade0){_0x303b2d=_0x303b2d-0x0;var _0x13a21f=_0x6b76[_0x303b2d];return _0x13a21f;};'use strict';var attributes=require(_0x66b7('0x0'));var extensions=require(_0x66b7('0x1'));var iftime=require(_0x66b7('0x2'))[_0x66b7('0x3')];module[_0x66b7('0x4')]=function(_0x1b1cf4){return _0x1b1cf4[_0x66b7('0x5')](_0x66b7('0x6'),attributes,{'tableName':_0x66b7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1baae4){extensions[_0x66b7('0x8')](_0x1b1cf4,_0x1baae4);},'afterBulkCreate':function(_0xecb1e1,_0x2e6826,_0x2ea379){_0x2ea379();extensions['rewrite'](_0x1b1cf4,_0xecb1e1[0x0]);},'afterUpdate':function(_0x2a3c31){extensions['rewrite'](_0x1b1cf4,_0x2a3c31);},'afterDestroy':function(_0x2c8ca1){extensions['rewrite'](_0x1b1cf4,_0x2c8ca1);}},'instanceMethods':{'ifTime':function(_0xfe2af=undefined,_0x516ead=new Date()){if(typeof this['interval']===_0x66b7('0x9')){return iftime(this['interval'],_0xfe2af,_0x516ead);}else{return this[_0x66b7('0xa')]()[_0x66b7('0xb')](function(_0x3031ab){return Promise[_0x66b7('0xc')](_0x3031ab[_0x66b7('0xd')](function(_0x2a3ab0){return _0x2a3ab0[_0x66b7('0xe')](_0xfe2af,_0x516ead);}));})['then'](function(_0x3a6ae3){return _0x3a6ae3[_0x66b7('0xf')](function(_0x355814,_0x1cff6c){return _0x355814||_0x1cff6c;},![]);});}}}});}; \ No newline at end of file +var _0x7217=['then','all','map','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals'];(function(_0x29f31c,_0x46bbdf){var _0x3b6b8a=function(_0x557471){while(--_0x557471){_0x29f31c['push'](_0x29f31c['shift']());}};_0x3b6b8a(++_0x46bbdf);}(_0x7217,0x1d6));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x7721('0x0'));var iftime=require(_0x7721('0x1'))['iftime'];module[_0x7721('0x2')]=function(_0x56526c){return _0x56526c[_0x7721('0x3')](_0x7721('0x4'),attributes,{'tableName':_0x7721('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ca816){extensions[_0x7721('0x6')](_0x56526c,_0x4ca816);},'afterBulkCreate':function(_0x312af1,_0x4903cd,_0x58a746){_0x58a746();extensions[_0x7721('0x6')](_0x56526c,_0x312af1[0x0]);},'afterUpdate':function(_0x11a957){extensions['rewrite'](_0x56526c,_0x11a957);},'afterDestroy':function(_0x1db35d){extensions[_0x7721('0x6')](_0x56526c,_0x1db35d);}},'instanceMethods':{'ifTime':function(_0x1f65cd=undefined,_0x4d725f=new Date()){if(typeof this[_0x7721('0x7')]===_0x7721('0x8')){return iftime(this[_0x7721('0x7')],_0x1f65cd,_0x4d725f);}else{return this[_0x7721('0x9')]()[_0x7721('0xa')](function(_0x43aff3){return Promise[_0x7721('0xb')](_0x43aff3[_0x7721('0xc')](function(_0x551e25){return _0x551e25[_0x7721('0xd')](_0x1f65cd,_0x4d725f);}));})[_0x7721('0xa')](function(_0x3ed9f9){return _0x3ed9f9[_0x7721('0xe')](function(_0x4f4f20,_0x3f933d){return _0x4f4f20||_0x3f933d;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8a3d7de..f9b3238 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dd0=['stringify','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','format','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','catch','error','message','ShowInterval','find','then'];(function(_0x2c035c,_0xf71ce8){var _0x50dfa2=function(_0x2f4623){while(--_0x2f4623){_0x2c035c['push'](_0x2c035c['shift']());}};_0x50dfa2(++_0xf71ce8);}(_0x6dd0,0xe9));var _0x06dd=function(_0x543b52,_0x1dfd0e){_0x543b52=_0x543b52-0x0;var _0x113df8=_0x6dd0[_0x543b52];return _0x113df8;};'use strict';var _=require(_0x06dd('0x0'));var util=require(_0x06dd('0x1'));var db=require(_0x06dd('0x2'))['db'];var iftime=require(_0x06dd('0x3'))[_0x06dd('0x4')];var logger=require('../../config/logger')(_0x06dd('0x5'));exports[_0x06dd('0x6')]=function(_0x25329e){var _0x561f0b=this;return new Promise(function(_0xcaaaef,_0x51c382){return db[_0x06dd('0x7')][_0x06dd('0x8')]({'raw':_0x25329e[_0x06dd('0x9')]?_0x25329e[_0x06dd('0x9')][_0x06dd('0xa')]===undefined?!![]:![]:!![],'where':_0x25329e[_0x06dd('0x9')]?_0x25329e['options'][_0x06dd('0xb')]||null:null,'attributes':_0x25329e[_0x06dd('0x9')]?_0x25329e[_0x06dd('0x9')][_0x06dd('0xc')]||null:null,'limit':_0x25329e[_0x06dd('0x9')]?_0x25329e['options'][_0x06dd('0xd')]||null:null,'include':_0x25329e['options']?_0x25329e['options']['include']?_['map'](_0x25329e[_0x06dd('0x9')]['include'],function(_0x1991d8){return{'model':db[_0x1991d8['model']],'as':_0x1991d8['as'],'attributes':_0x1991d8[_0x06dd('0xc')],'include':_0x1991d8[_0x06dd('0xe')]?_[_0x06dd('0xf')](_0x1991d8[_0x06dd('0xe')],function(_0x58e3bb){return{'model':db[_0x58e3bb[_0x06dd('0x10')]],'as':_0x58e3bb['as'],'attributes':_0x58e3bb[_0x06dd('0xc')],'include':_0x58e3bb[_0x06dd('0xe')]?_[_0x06dd('0xf')](_0x58e3bb[_0x06dd('0xe')],function(_0x2f7a3f){return{'model':db[_0x2f7a3f[_0x06dd('0x10')]],'as':_0x2f7a3f['as'],'attributes':_0x2f7a3f[_0x06dd('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7065ab){logger[_0x06dd('0x11')](_0x06dd('0x6'),_0x25329e);logger[_0x06dd('0x12')]('GetInterval',_0x25329e,JSON['stringify'](_0x7065ab));_0xcaaaef(_0x7065ab);})[_0x06dd('0x13')](function(_0x186fec){logger[_0x06dd('0x14')]('GetInterval',_0x186fec[_0x06dd('0x15')],_0x25329e);_0x51c382(_0x561f0b[_0x06dd('0x14')](0x1f4,_0x186fec[_0x06dd('0x15')]));});});};exports[_0x06dd('0x16')]=function(_0x50de86){var _0x422347=this;return new Promise(function(_0x463988,_0x10bcfb){return db['Interval'][_0x06dd('0x17')]({'raw':_0x50de86['options']?_0x50de86['options'][_0x06dd('0xa')]===undefined?!![]:![]:!![],'where':_0x50de86['options']?_0x50de86[_0x06dd('0x9')][_0x06dd('0xb')]||null:null,'attributes':_0x50de86[_0x06dd('0x9')]?_0x50de86[_0x06dd('0x9')][_0x06dd('0xc')]||null:null,'include':_0x50de86[_0x06dd('0x9')]?_0x50de86[_0x06dd('0x9')][_0x06dd('0xe')]?_['map'](_0x50de86[_0x06dd('0x9')]['include'],function(_0x4c6459){return{'model':db[_0x4c6459[_0x06dd('0x10')]],'as':_0x4c6459['as'],'attributes':_0x4c6459[_0x06dd('0xc')],'include':_0x4c6459[_0x06dd('0xe')]?_[_0x06dd('0xf')](_0x4c6459[_0x06dd('0xe')],function(_0x285749){return{'model':db[_0x285749[_0x06dd('0x10')]],'as':_0x285749['as'],'attributes':_0x285749[_0x06dd('0xc')],'include':_0x285749[_0x06dd('0xe')]?_[_0x06dd('0xf')](_0x285749[_0x06dd('0xe')],function(_0x5d2ab5){return{'model':db[_0x5d2ab5[_0x06dd('0x10')]],'as':_0x5d2ab5['as'],'attributes':_0x5d2ab5['attributes']};}):[]};}):[]};}):[]:[]})[_0x06dd('0x18')](function(_0x307291){logger[_0x06dd('0x11')](_0x06dd('0x16'),_0x50de86);logger[_0x06dd('0x12')](_0x06dd('0x16'),_0x50de86,JSON[_0x06dd('0x19')](_0x307291));_0x463988(_0x307291);})[_0x06dd('0x13')](function(_0x46387e){logger[_0x06dd('0x14')](_0x06dd('0x16'),_0x46387e[_0x06dd('0x15')],_0x50de86);_0x10bcfb(_0x422347[_0x06dd('0x14')](0x1f4,_0x46387e[_0x06dd('0x15')]));});});};function checkArrayOfIntervals(_0x3420ec,_0x284729){var _0x2e5e33=[];return db['Interval'][_0x06dd('0x8')]({'where':{'id':_0x3420ec}})[_0x06dd('0x18')](function(_0x411b6b){_0x2e5e33=_0x411b6b;return Promise['all'](_0x2e5e33[_0x06dd('0xf')](function(_0xbe8e9c){return _0xbe8e9c[_0x06dd('0x1a')](_0x284729);}));})[_0x06dd('0x18')](function(_0x14fa43){var _0x30e034=_0x14fa43[_0x06dd('0x1b')](function(_0x4f1e4c,_0x55eb25){return _0x4f1e4c||_0x55eb25;},![]);logger[_0x06dd('0x11')](util['format'](_0x06dd('0x1c'),_0x2e5e33[_0x06dd('0xf')](function(_0x469225){return _0x469225[_0x06dd('0x1d')];})['join'](',\x20'),_0x2e5e33[_0x06dd('0xf')](function(_0x39bb27){return _0x39bb27['id'];})[_0x06dd('0x1e')](',\x20')));return _0x30e034;});}function checkSingleInterval(_0x332240,_0x2ccac7){return db['Interval'][_0x06dd('0x1f')](_0x332240)[_0x06dd('0x18')](function(_0x50bddc){if(_0x50bddc){logger[_0x06dd('0x11')](util[_0x06dd('0x20')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x50bddc[_0x06dd('0x1d')],_0x50bddc['id']));return _0x50bddc['ifTime'](_0x2ccac7);}});}exports['IntervalIftime']=function(_0x3b044b){var _0x558124=_0x3b044b['intervalIds'];var _0x2a90a8=Array[_0x06dd('0x21')](_0x3b044b[_0x06dd('0x22')])?_0x3b044b[_0x06dd('0x22')]:typeof _0x3b044b['intervals']===_0x06dd('0x23')?[_0x3b044b['intervals']]:[];var _0x36f229=_0x3b044b[_0x06dd('0x24')]||undefined;var _0x5befab=![];if(_0x2a90a8['length']){logger[_0x06dd('0x11')](util[_0x06dd('0x20')](_0x06dd('0x25'),_0x2a90a8[_0x06dd('0x1e')](';\x20')));}if(_0x36f229){logger[_0x06dd('0x11')](util[_0x06dd('0x20')](_0x06dd('0x26'),_0x36f229));}logger['debug'](_0x06dd('0x27'),_0x5befab);logger[_0x06dd('0x28')](_0x06dd('0x29'),_0x3b044b);return Promise[_0x06dd('0x2a')]()[_0x06dd('0x18')](function(){if(Array[_0x06dd('0x21')](_0x558124)){return checkArrayOfIntervals(_0x558124,_0x36f229);}else if(_0x558124){return checkSingleInterval(_0x558124,_0x36f229);}})['then'](function(_0x204b1b){var _0x4b5796=_0x2a90a8[_0x06dd('0x1b')](function(_0x1914b9,_0x26af5b){return _0x1914b9||iftime(_0x26af5b,_0x36f229);},![]);_0x5befab=_0x204b1b||_0x4b5796;return _0x5befab;})[_0x06dd('0x13')](function(_0x196f22){logger['error'](_0x06dd('0x29'),_0x3b044b,_0x196f22);throw this[_0x06dd('0x14')](0x1f4,_0x196f22[_0x06dd('0x15')]);});}; \ No newline at end of file +var _0xba6f=['intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','options','raw','limit','include','map','attributes','model','then','info','debug','stringify','catch','message','find','ShowInterval','error','findAll','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime','intervalIds','isArray'];(function(_0x3a188f,_0x4ac11f){var _0x76ee08=function(_0x1c7e2d){while(--_0x1c7e2d){_0x3a188f['push'](_0x3a188f['shift']());}};_0x76ee08(++_0x4ac11f);}(_0xba6f,0xb4));var _0xfba6=function(_0x31a16a,_0x1d60e3){_0x31a16a=_0x31a16a-0x0;var _0x21c892=_0xba6f[_0x31a16a];return _0x21c892;};'use strict';var _=require(_0xfba6('0x0'));var util=require(_0xfba6('0x1'));var db=require(_0xfba6('0x2'))['db'];var iftime=require(_0xfba6('0x3'))[_0xfba6('0x4')];var logger=require(_0xfba6('0x5'))(_0xfba6('0x6'));exports[_0xfba6('0x7')]=function(_0x351f68){var _0x47d73f=this;return new Promise(function(_0x1759b8,_0x5f1e56){return db[_0xfba6('0x8')]['findAll']({'raw':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')][_0xfba6('0xa')]===undefined?!![]:![]:!![],'where':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')]['where']||null:null,'attributes':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')]['attributes']||null:null,'limit':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')][_0xfba6('0xb')]||null:null,'include':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')][_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x351f68[_0xfba6('0x9')][_0xfba6('0xc')],function(_0x5e3aa3){return{'model':db[_0x5e3aa3['model']],'as':_0x5e3aa3['as'],'attributes':_0x5e3aa3[_0xfba6('0xe')],'include':_0x5e3aa3[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x5e3aa3[_0xfba6('0xc')],function(_0x464997){return{'model':db[_0x464997[_0xfba6('0xf')]],'as':_0x464997['as'],'attributes':_0x464997[_0xfba6('0xe')],'include':_0x464997[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x464997['include'],function(_0x24fb3b){return{'model':db[_0x24fb3b['model']],'as':_0x24fb3b['as'],'attributes':_0x24fb3b['attributes']};}):[]};}):[]};}):[]:[]})[_0xfba6('0x10')](function(_0x35cc27){logger[_0xfba6('0x11')]('GetInterval',_0x351f68);logger[_0xfba6('0x12')](_0xfba6('0x7'),_0x351f68,JSON[_0xfba6('0x13')](_0x35cc27));_0x1759b8(_0x35cc27);})[_0xfba6('0x14')](function(_0x5d8928){logger['error'](_0xfba6('0x7'),_0x5d8928['message'],_0x351f68);_0x5f1e56(_0x47d73f['error'](0x1f4,_0x5d8928[_0xfba6('0x15')]));});});};exports['ShowInterval']=function(_0x3fddbc){var _0x21890c=this;return new Promise(function(_0x20ba1c,_0x20c7c6){return db['Interval'][_0xfba6('0x16')]({'raw':_0x3fddbc[_0xfba6('0x9')]?_0x3fddbc['options'][_0xfba6('0xa')]===undefined?!![]:![]:!![],'where':_0x3fddbc['options']?_0x3fddbc['options']['where']||null:null,'attributes':_0x3fddbc[_0xfba6('0x9')]?_0x3fddbc[_0xfba6('0x9')]['attributes']||null:null,'include':_0x3fddbc[_0xfba6('0x9')]?_0x3fddbc[_0xfba6('0x9')]['include']?_[_0xfba6('0xd')](_0x3fddbc[_0xfba6('0x9')][_0xfba6('0xc')],function(_0x5264fa){return{'model':db[_0x5264fa[_0xfba6('0xf')]],'as':_0x5264fa['as'],'attributes':_0x5264fa[_0xfba6('0xe')],'include':_0x5264fa[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x5264fa[_0xfba6('0xc')],function(_0x24fa47){return{'model':db[_0x24fa47[_0xfba6('0xf')]],'as':_0x24fa47['as'],'attributes':_0x24fa47[_0xfba6('0xe')],'include':_0x24fa47[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x24fa47['include'],function(_0x45e51f){return{'model':db[_0x45e51f[_0xfba6('0xf')]],'as':_0x45e51f['as'],'attributes':_0x45e51f[_0xfba6('0xe')]};}):[]};}):[]};}):[]:[]})[_0xfba6('0x10')](function(_0x3805be){logger['info'](_0xfba6('0x17'),_0x3fddbc);logger[_0xfba6('0x12')](_0xfba6('0x17'),_0x3fddbc,JSON[_0xfba6('0x13')](_0x3805be));_0x20ba1c(_0x3805be);})[_0xfba6('0x14')](function(_0x4d9395){logger[_0xfba6('0x18')](_0xfba6('0x17'),_0x4d9395[_0xfba6('0x15')],_0x3fddbc);_0x20c7c6(_0x21890c[_0xfba6('0x18')](0x1f4,_0x4d9395[_0xfba6('0x15')]));});});};function checkArrayOfIntervals(_0x14d54b,_0x350ca5){var _0x249b5c=[];return db[_0xfba6('0x8')][_0xfba6('0x19')]({'where':{'id':_0x14d54b}})[_0xfba6('0x10')](function(_0x4ea259){_0x249b5c=_0x4ea259;return Promise['all'](_0x249b5c['map'](function(_0x47c33b){return _0x47c33b[_0xfba6('0x1a')](_0x350ca5);}));})[_0xfba6('0x10')](function(_0x21d53a){var _0x121c3f=_0x21d53a[_0xfba6('0x1b')](function(_0x11656a,_0x48f8e9){return _0x11656a||_0x48f8e9;},![]);logger[_0xfba6('0x11')](util[_0xfba6('0x1c')](_0xfba6('0x1d'),_0x249b5c[_0xfba6('0xd')](function(_0xc2b367){return _0xc2b367[_0xfba6('0x1e')];})[_0xfba6('0x1f')](',\x20'),_0x249b5c[_0xfba6('0xd')](function(_0x44ef82){return _0x44ef82['id'];})[_0xfba6('0x1f')](',\x20')));return _0x121c3f;});}function checkSingleInterval(_0x2ba22f,_0x5a9891){return db['Interval']['findById'](_0x2ba22f)[_0xfba6('0x10')](function(_0x2e3313){if(_0x2e3313){logger['info'](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x2e3313[_0xfba6('0x1e')],_0x2e3313['id']));return _0x2e3313['ifTime'](_0x5a9891);}});}exports[_0xfba6('0x20')]=function(_0x1cc335){var _0x3bc2c1=_0x1cc335[_0xfba6('0x21')];var _0x17365b=Array[_0xfba6('0x22')](_0x1cc335[_0xfba6('0x23')])?_0x1cc335[_0xfba6('0x23')]:typeof _0x1cc335[_0xfba6('0x23')]===_0xfba6('0x24')?[_0x1cc335['intervals']]:[];var _0x55b424=_0x1cc335[_0xfba6('0x25')]||undefined;var _0x49f43a=![];if(_0x17365b[_0xfba6('0x26')]){logger[_0xfba6('0x11')](util[_0xfba6('0x1c')](_0xfba6('0x27'),_0x17365b[_0xfba6('0x1f')](';\x20')));}if(_0x55b424){logger[_0xfba6('0x11')](util[_0xfba6('0x1c')](_0xfba6('0x28'),_0x55b424));}logger['debug'](_0xfba6('0x29'),_0x49f43a);logger['silly'](_0xfba6('0x20'),_0x1cc335);return Promise[_0xfba6('0x2a')]()[_0xfba6('0x10')](function(){if(Array[_0xfba6('0x22')](_0x3bc2c1)){return checkArrayOfIntervals(_0x3bc2c1,_0x55b424);}else if(_0x3bc2c1){return checkSingleInterval(_0x3bc2c1,_0x55b424);}})['then'](function(_0x4382d0){var _0xdf3000=_0x17365b[_0xfba6('0x1b')](function(_0x1a13b2,_0x291aac){return _0x1a13b2||iftime(_0x291aac,_0x55b424);},![]);_0x49f43a=_0x4382d0||_0xdf3000;return _0x49f43a;})[_0xfba6('0x14')](function(_0x4f4fb4){logger[_0xfba6('0x18')](_0xfba6('0x20'),_0x1cc335,_0x4f4fb4);throw this['error'](0x1f4,_0x4f4fb4['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 3a1be86..d8fb8da 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x16fa02,_0x3eaff5){var _0x58fa70=function(_0x18bfc5){while(--_0x18bfc5){_0x16fa02['push'](_0x16fa02['shift']());}};_0x58fa70(++_0x3eaff5);}(_0x5f2f,0x73));var _0xf5f2=function(_0xcd2b47,_0x298e3b){_0xcd2b47=_0xcd2b47-0x0;var _0x3a62dd=_0x5f2f[_0xcd2b47];return _0x3a62dd;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x5e1b94,_0x561a11){var _0x19fb41=function(_0x2eb040){while(--_0x2eb040){_0x5e1b94['push'](_0x5e1b94['shift']());}};_0x19fb41(++_0x561a11);}(_0x2032,0xd9));var _0x2203=function(_0x4f5f03,_0x387b15){_0x4f5f03=_0x4f5f03-0x0;var _0x28795b=_0x2032[_0x4f5f03];return _0x28795b;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 3b7f80b..2ec59b6 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6837=['api','3eAmWpBVP0','summary','Report','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','json','error','api.jira','write','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger'];(function(_0x54412c,_0x127e5b){var _0x538562=function(_0xff72f7){while(--_0xff72f7){_0x54412c['push'](_0x54412c['shift']());}};_0x538562(++_0x127e5b);}(_0x6837,0x11d));var _0x7683=function(_0x42331a,_0x1284ad){_0x42331a=_0x42331a-0x0;var _0x14937d=_0x6837[_0x42331a];return _0x14937d;};'use strict';var BPromise=require(_0x7683('0x0'));var https=require('https');var logger=require(_0x7683('0x1'))(_0x7683('0x2'));var USERNAME='support';var PASSWORD=_0x7683('0x3');function openIssue(_0x41b618,_0x1dcbeb){var _0x5f5c40={'fields':{'project':{'key':_0x41b618['key']||'MOTGUI'},'summary':(_0x41b618[_0x7683('0x4')]||_0x7683('0x5'))+'\x20from\x20'+_0x41b618['ip'],'description':_0x41b618['description']||JSON['stringify'](_0x41b618),'issuetype':{'name':_0x41b618[_0x7683('0x6')]||_0x7683('0x7')}}};_0x5f5c40[_0x7683('0x8')][_0x7683('0x9')]=_0x41b618['email'];_0x5f5c40[_0x7683('0x8')][_0x7683('0xa')]=_0x41b618[_0x7683('0xb')];_0x5f5c40[_0x7683('0x8')][_0x7683('0xc')]=_0x41b618[_0x7683('0xd')];_0x5f5c40[_0x7683('0x8')][_0x7683('0xe')]=_0x41b618['name'];_0x5f5c40['fields'][_0x7683('0xf')]=_0x41b618[_0x7683('0x10')];_0x5f5c40[_0x7683('0x8')][_0x7683('0x11')]=_0x41b618['ip'];var _0x28fd9f={'host':_0x7683('0x12'),'port':0x1bb,'path':_0x7683('0x13'),'method':_0x7683('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x7683('0x15'),'Authorization':_0x7683('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x7683('0x17')](_0x7683('0x18'))}};var _0x2cdeb2=JSON['stringify'](_0x5f5c40);var _0x5e81c0=https['request'](_0x28fd9f,function(_0xbe2468){_0xbe2468[_0x7683('0x19')](_0x7683('0x1a'));var _0x6cc295='';_0xbe2468['on'](_0x7683('0x1b'),function(_0x1f1da1){_0x6cc295+=_0x1f1da1;});_0xbe2468['on'](_0x7683('0x1c'),function(){if(_0x1dcbeb){return _0x1dcbeb[_0x7683('0x1d')](_0xbe2468['statusCode'])[_0x7683('0x1e')](JSON['parse'](_0x6cc295));}});});_0x5e81c0['on'](_0x7683('0x1f'),function(_0x3315b4){if(_0x1dcbeb){return _0x1dcbeb[_0x7683('0x1d')](0x1f4)[_0x7683('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x7683('0x20')}]});}});_0x5e81c0[_0x7683('0x21')](_0x2cdeb2);_0x5e81c0[_0x7683('0x1c')]();}exports[_0x7683('0x22')]=openIssue;exports[_0x7683('0x23')]=function(_0x52dcc0,_0x545f99){_0x52dcc0[_0x7683('0x24')]['ip']=_0x52dcc0['headers'][_0x7683('0x25')]||_0x52dcc0[_0x7683('0x26')][_0x7683('0x27')]||_0x52dcc0[_0x7683('0x28')][_0x7683('0x27')]||_0x52dcc0['connection'][_0x7683('0x28')][_0x7683('0x27')];return openIssue(_0x52dcc0[_0x7683('0x24')],_0x545f99);}; \ No newline at end of file +var _0x3b7a=['write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','key','MOTGUI','summary','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira'];(function(_0x54b907,_0x29ff96){var _0x363d89=function(_0x184d8f){while(--_0x184d8f){_0x54b907['push'](_0x54b907['shift']());}};_0x363d89(++_0x29ff96);}(_0x3b7a,0x129));var _0xa3b7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3b7a[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0xa3b7('0x0'));var https=require(_0xa3b7('0x1'));var logger=require(_0xa3b7('0x2'))(_0xa3b7('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x14b269,_0x1fe360){var _0x25d400={'fields':{'project':{'key':_0x14b269[_0xa3b7('0x4')]||_0xa3b7('0x5')},'summary':(_0x14b269[_0xa3b7('0x6')]||'Report')+'\x20from\x20'+_0x14b269['ip'],'description':_0x14b269[_0xa3b7('0x7')]||JSON[_0xa3b7('0x8')](_0x14b269),'issuetype':{'name':_0x14b269[_0xa3b7('0x9')]||_0xa3b7('0xa')}}};_0x25d400[_0xa3b7('0xb')][_0xa3b7('0xc')]=_0x14b269[_0xa3b7('0xd')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0xe')]=_0x14b269[_0xa3b7('0xf')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x10')]=_0x14b269[_0xa3b7('0x11')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x12')]=_0x14b269[_0xa3b7('0x13')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x14')]=_0x14b269[_0xa3b7('0x15')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x16')]=_0x14b269['ip'];var _0x1a0f3a={'host':_0xa3b7('0x17'),'port':0x1bb,'path':_0xa3b7('0x18'),'method':_0xa3b7('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xa3b7('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xa3b7('0x1b'))}};var _0x2c74d8=JSON[_0xa3b7('0x8')](_0x25d400);var _0x397d25=https[_0xa3b7('0x1c')](_0x1a0f3a,function(_0xf1f291){_0xf1f291[_0xa3b7('0x1d')](_0xa3b7('0x1e'));var _0x3cca9f='';_0xf1f291['on'](_0xa3b7('0x1f'),function(_0x357d0d){_0x3cca9f+=_0x357d0d;});_0xf1f291['on'](_0xa3b7('0x20'),function(){if(_0x1fe360){return _0x1fe360['status'](_0xf1f291[_0xa3b7('0x21')])[_0xa3b7('0x22')](JSON[_0xa3b7('0x23')](_0x3cca9f));}});});_0x397d25['on'](_0xa3b7('0x24'),function(_0x46717b){if(_0x1fe360){return _0x1fe360[_0xa3b7('0x25')](0x1f4)[_0xa3b7('0x22')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xa3b7('0x26')}]});}});_0x397d25[_0xa3b7('0x27')](_0x2c74d8);_0x397d25[_0xa3b7('0x20')]();}exports[_0xa3b7('0x28')]=openIssue;exports[_0xa3b7('0x29')]=function(_0x30f68b,_0x535982){_0x30f68b[_0xa3b7('0x2a')]['ip']=_0x30f68b[_0xa3b7('0x2b')][_0xa3b7('0x2c')]||_0x30f68b[_0xa3b7('0x2d')][_0xa3b7('0x2e')]||_0x30f68b[_0xa3b7('0x2f')][_0xa3b7('0x2e')]||_0x30f68b['connection'][_0xa3b7('0x2f')][_0xa3b7('0x2e')];return openIssue(_0x30f68b[_0xa3b7('0x2a')],_0x535982);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5352092..8c4ff67 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x2ef445,_0x90a077){var _0x98e4de=function(_0x4f348d){while(--_0x4f348d){_0x2ef445['push'](_0x2ef445['shift']());}};_0x98e4de(++_0x90a077);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xcb91[_0x231b2e];return _0x3feb2a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6f0d=['post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x497e97,_0x4fb74c){var _0x1891f9=function(_0x370b3a){while(--_0x370b3a){_0x497e97['push'](_0x497e97['shift']());}};_0x1891f9(++_0x4fb74c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x28bad1,_0x64bba2){_0x28bad1=_0x28bad1-0x0;var _0x37e5df=_0x6f0d[_0x28bad1];return _0x37e5df;};'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('0xe')]('/',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);router['put'](_0xd6f0('0x10'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x11')]);router[_0xd6f0('0x12')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x13')]);module[_0xd6f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 1d99cdc..df0a3d5 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x7a54,0x106));var _0x47a5=function(_0x273567,_0x28c4fe){_0x273567=_0x273567-0x0;var _0x56c27e=_0x7a54[_0x273567];return _0x56c27e;};'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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x1830be,_0x32d010){_0x1830be=_0x1830be-0x0;var _0x15ff7b=_0x7a54[_0x1830be];return _0x15ff7b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 9d342b4..72948c7 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b27=['rows','catch','show','keys','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x2f7290,_0x20a5d2){var _0xeb684f=function(_0x1d4ae4){while(--_0x1d4ae4){_0x2f7290['push'](_0x2f7290['shift']());}};_0xeb684f(++_0x20a5d2);}(_0x7b27,0x186));var _0x77b2=function(_0x458691,_0x2ba030){_0x458691=_0x458691-0x0;var _0x5ce624=_0x7b27[_0x458691];return _0x5ce624;};'use strict';var emlformat=require(_0x77b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x77b2('0x1'));var jsonpatch=require(_0x77b2('0x2'));var rp=require(_0x77b2('0x3'));var moment=require(_0x77b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77b2('0x5'));var util=require(_0x77b2('0x6'));var path=require('path');var sox=require(_0x77b2('0x7'));var csv=require(_0x77b2('0x8'));var ejs=require(_0x77b2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77b2('0xa'));var squel=require(_0x77b2('0xb'));var crypto=require(_0x77b2('0xc'));var jsforce=require(_0x77b2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x77b2('0x8'));var querystring=require(_0x77b2('0xe'));var Papa=require(_0x77b2('0xf'));var Redis=require(_0x77b2('0x10'));var authService=require(_0x77b2('0x11'));var qs=require(_0x77b2('0x12'));var as=require(_0x77b2('0x13'));var hardwareService=require(_0x77b2('0x14'));var logger=require('../../config/logger')(_0x77b2('0x15'));var utils=require(_0x77b2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x77b2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x82878c,_0x29385b){_0x29385b=_0x29385b||0xcc;return function(_0x4bd51c){if(_0x4bd51c){return _0x82878c[_0x77b2('0x18')](_0x29385b);}return _0x82878c['status'](_0x29385b)[_0x77b2('0x19')]();};}function respondWithResult(_0x14cd9f,_0x129ef1){_0x129ef1=_0x129ef1||0xc8;return function(_0x21ac8e){if(_0x21ac8e){return _0x14cd9f[_0x77b2('0x1a')](_0x129ef1)[_0x77b2('0x1b')](_0x21ac8e);}};}function respondWithFilteredResult(_0x2539d3,_0x284e2c){return function(_0xd7ed8c){if(_0xd7ed8c){var _0x48885e=typeof _0x284e2c['offset']===_0x77b2('0x1c')&&typeof _0x284e2c[_0x77b2('0x1d')]===_0x77b2('0x1c');var _0x68c16e=_0xd7ed8c[_0x77b2('0x1e')];var _0x3a346c=_0x48885e?0x0:_0x284e2c[_0x77b2('0x1f')];var _0x4dc713=_0x48885e?_0xd7ed8c[_0x77b2('0x1e')]:_0x284e2c[_0x77b2('0x1f')]+_0x284e2c[_0x77b2('0x1d')];var _0x25e7fc;if(_0x4dc713>=_0x68c16e){_0x4dc713=_0x68c16e;_0x25e7fc=0xc8;}else{_0x25e7fc=0xce;}_0x2539d3[_0x77b2('0x1a')](_0x25e7fc);return _0x2539d3['set'](_0x77b2('0x20'),_0x3a346c+'-'+_0x4dc713+'/'+_0x68c16e)['json'](_0xd7ed8c);}return null;};}function patchUpdates(_0x298871){return function(_0x1d8132){try{jsonpatch[_0x77b2('0x21')](_0x1d8132,_0x298871,!![]);}catch(_0x28c778){return BPromise[_0x77b2('0x22')](_0x28c778);}return _0x1d8132[_0x77b2('0x23')]();};}function saveUpdates(_0x36dde1,_0x542d76){return function(_0x4d5c66){if(_0x4d5c66){return _0x4d5c66['update'](_0x36dde1)[_0x77b2('0x24')](function(_0x450892){return _0x450892;});}return null;};}function removeEntity(_0x11f7d1,_0x327a8e){return function(_0x93374a){if(_0x93374a){return _0x93374a[_0x77b2('0x25')]()[_0x77b2('0x24')](function(){_0x11f7d1['status'](0xcc)[_0x77b2('0x19')]();});}};}function handleEntityNotFound(_0x3f4068,_0x21b691){return function(_0x283d80){if(!_0x283d80){_0x3f4068[_0x77b2('0x18')](0x194);}return _0x283d80;};}function handleError(_0x3eae04,_0x9995){_0x9995=_0x9995||0x1f4;return function(_0x250202){logger[_0x77b2('0x26')](_0x250202[_0x77b2('0x27')]);if(_0x250202['name']){delete _0x250202[_0x77b2('0x28')];}_0x3eae04[_0x77b2('0x1a')](_0x9995)[_0x77b2('0x29')](_0x250202);};}exports[_0x77b2('0x2a')]=function(_0x21d161,_0x5dc412){var _0x251bf1={},_0x4a53e8={},_0x3b7f85={'count':0x0,'rows':[]};var _0x334366=_[_0x77b2('0x2b')](db[_0x77b2('0x2c')][_0x77b2('0x2d')],function(_0x1e9e01){return{'name':_0x1e9e01[_0x77b2('0x2e')],'type':_0x1e9e01[_0x77b2('0x2f')][_0x77b2('0x30')]};});_0x4a53e8[_0x77b2('0x31')]=_['map'](_0x334366,'name');_0x4a53e8['query']=_['keys'](_0x21d161[_0x77b2('0x32')]);_0x4a53e8[_0x77b2('0x33')]=_['intersection'](_0x4a53e8['model'],_0x4a53e8['query']);_0x251bf1[_0x77b2('0x34')]=_[_0x77b2('0x35')](_0x4a53e8[_0x77b2('0x31')],qs[_0x77b2('0x36')](_0x21d161['query'][_0x77b2('0x36')]));_0x251bf1['attributes']=_0x251bf1[_0x77b2('0x34')][_0x77b2('0x37')]?_0x251bf1[_0x77b2('0x34')]:_0x4a53e8[_0x77b2('0x31')];if(!_0x21d161[_0x77b2('0x32')][_0x77b2('0x38')]('nolimit')){_0x251bf1[_0x77b2('0x1d')]=qs[_0x77b2('0x1d')](_0x21d161[_0x77b2('0x32')]['limit']);_0x251bf1[_0x77b2('0x1f')]=qs['offset'](_0x21d161[_0x77b2('0x32')][_0x77b2('0x1f')]);}_0x251bf1[_0x77b2('0x39')]=qs['sort'](_0x21d161['query']['sort']);_0x251bf1['where']=qs[_0x77b2('0x33')](_['pick'](_0x21d161[_0x77b2('0x32')],_0x4a53e8[_0x77b2('0x33')]),_0x334366);if(_0x21d161[_0x77b2('0x32')][_0x77b2('0x3a')]){_0x251bf1[_0x77b2('0x3b')]=_[_0x77b2('0x3c')](_0x251bf1[_0x77b2('0x3b')],{'$or':_['map'](_0x334366,function(_0x4d1035){if(_0x4d1035[_0x77b2('0x2f')]!==_0x77b2('0x3d')){var _0x2b76fb={};_0x2b76fb[_0x4d1035[_0x77b2('0x28')]]={'$like':'%'+_0x21d161['query'][_0x77b2('0x3a')]+'%'};return _0x2b76fb;}})});}_0x251bf1=_[_0x77b2('0x3c')]({},_0x251bf1,_0x21d161[_0x77b2('0x3e')]);var _0x54770d={'where':_0x251bf1['where']};return db[_0x77b2('0x2c')][_0x77b2('0x1e')](_0x54770d)[_0x77b2('0x24')](function(_0x35b418){_0x3b7f85['count']=_0x35b418;if(_0x21d161[_0x77b2('0x32')][_0x77b2('0x3f')]){_0x251bf1[_0x77b2('0x40')]=[{'all':!![]}];}return db[_0x77b2('0x2c')][_0x77b2('0x41')](_0x251bf1);})['then'](function(_0x5a8c43){_0x3b7f85[_0x77b2('0x42')]=_0x5a8c43;return _0x3b7f85;})[_0x77b2('0x24')](respondWithFilteredResult(_0x5dc412,_0x251bf1))[_0x77b2('0x43')](handleError(_0x5dc412,null));};exports[_0x77b2('0x44')]=function(_0x23724a,_0xfda01f){var _0x95ac66={'raw':!![],'where':{'id':_0x23724a['params']['id']}},_0x531e2e={};_0x531e2e[_0x77b2('0x31')]=_[_0x77b2('0x45')](db[_0x77b2('0x2c')][_0x77b2('0x2d')]);_0x531e2e['query']=_['keys'](_0x23724a[_0x77b2('0x32')]);_0x531e2e['filters']=_[_0x77b2('0x35')](_0x531e2e[_0x77b2('0x31')],_0x531e2e[_0x77b2('0x32')]);_0x95ac66['attributes']=_['intersection'](_0x531e2e[_0x77b2('0x31')],qs['fields'](_0x23724a[_0x77b2('0x32')][_0x77b2('0x36')]));_0x95ac66[_0x77b2('0x34')]=_0x95ac66['attributes'][_0x77b2('0x37')]?_0x95ac66[_0x77b2('0x34')]:_0x531e2e[_0x77b2('0x31')];if(_0x23724a[_0x77b2('0x32')][_0x77b2('0x3f')]){_0x95ac66[_0x77b2('0x40')]=[{'all':!![]}];}_0x95ac66=_[_0x77b2('0x3c')]({},_0x95ac66,_0x23724a[_0x77b2('0x3e')]);return db[_0x77b2('0x2c')][_0x77b2('0x46')](_0x95ac66)[_0x77b2('0x24')](handleEntityNotFound(_0xfda01f,null))[_0x77b2('0x24')](respondWithResult(_0xfda01f,null))[_0x77b2('0x43')](handleError(_0xfda01f,null));};exports[_0x77b2('0x47')]=function(_0x213378,_0x3230a1){return db[_0x77b2('0x2c')][_0x77b2('0x47')](_0x213378[_0x77b2('0x48')],{})[_0x77b2('0x24')](respondWithResult(_0x3230a1,0xc9))['catch'](handleError(_0x3230a1,null));};exports[_0x77b2('0x49')]=function(_0x411a12,_0x4388f5){if(_0x411a12[_0x77b2('0x48')]['id']){delete _0x411a12[_0x77b2('0x48')]['id'];}return db[_0x77b2('0x2c')][_0x77b2('0x46')]({'where':{'id':_0x411a12[_0x77b2('0x4a')]['id']}})[_0x77b2('0x24')](handleEntityNotFound(_0x4388f5,null))[_0x77b2('0x24')](saveUpdates(_0x411a12[_0x77b2('0x48')],null))[_0x77b2('0x24')](respondWithResult(_0x4388f5,null))[_0x77b2('0x43')](handleError(_0x4388f5,null));};exports['destroy']=function(_0x26fe61,_0x3d4c49){return db[_0x77b2('0x2c')][_0x77b2('0x46')]({'where':{'id':_0x26fe61['params']['id']}})[_0x77b2('0x24')](handleEntityNotFound(_0x3d4c49,null))[_0x77b2('0x24')](removeEntity(_0x3d4c49,null))['catch'](handleError(_0x3d4c49,null));};exports[_0x77b2('0x4b')]=function(_0x1bac23,_0x3890fb){return db[_0x77b2('0x2c')]['describe']()[_0x77b2('0x24')](respondWithResult(_0x3890fb,null))['catch'](handleError(_0x3890fb,null));}; \ No newline at end of file +var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x5292,0xf7));var _0x2529=function(_0x455ac0,_0x1d5f16){_0x455ac0=_0x455ac0-0x0;var _0xfb9257=_0x5292[_0x455ac0];return _0xfb9257;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['JscriptyAnswerReport'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 9007e04..c5542e6 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2b2=['moment','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0xa2b2,0x189));var _0x2a2b=function(_0x4b63a7,_0x594052){_0x4b63a7=_0x4b63a7-0x0;var _0x1e925b=_0xa2b2[_0x4b63a7];return _0x1e925b;};'use strict';var _=require(_0x2a2b('0x0'));var util=require(_0x2a2b('0x1'));var logger=require('../../config/logger')(_0x2a2b('0x2'));var moment=require(_0x2a2b('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a2b('0x4'));var fs=require('fs');var path=require(_0x2a2b('0x5'));var rimraf=require(_0x2a2b('0x6'));var config=require(_0x2a2b('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x2a2b('0x8')]=function(_0x31634a,_0x3d7d4e){return _0x31634a[_0x2a2b('0x9')](_0x2a2b('0xa'),attributes,{'tableName':_0x2a2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x363f=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x363f,0x9e));var _0xf363=function(_0x25ff51,_0x2a1c1b){_0x25ff51=_0x25ff51-0x0;var _0x34a777=_0x363f[_0x25ff51];return _0x34a777;};'use strict';var _=require('lodash');var util=require(_0xf363('0x0'));var logger=require(_0xf363('0x1'))(_0xf363('0x2'));var moment=require(_0xf363('0x3'));var BPromise=require(_0xf363('0x4'));var rp=require(_0xf363('0x5'));var fs=require('fs');var path=require(_0xf363('0x6'));var rimraf=require(_0xf363('0x7'));var config=require(_0xf363('0x8'));var attributes=require(_0xf363('0x9'));module[_0xf363('0xa')]=function(_0xfba494,_0x359a4a){return _0xfba494[_0xf363('0xb')](_0xf363('0xc'),attributes,{'tableName':_0xf363('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 9cb9b29..23a6cff 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf13=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2160b9,_0x538a7d){var _0x249f65=function(_0x28bc18){while(--_0x28bc18){_0x2160b9['push'](_0x2160b9['shift']());}};_0x249f65(++_0x538a7d);}(_0xbf13,0x14b));var _0x3bf1=function(_0x8ec9ec,_0xf95ed2){_0x8ec9ec=_0x8ec9ec-0x0;var _0x5b7366=_0xbf13[_0x8ec9ec];return _0x5b7366;};'use strict';var _=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var moment=require(_0x3bf1('0x2'));var BPromise=require(_0x3bf1('0x3'));var rs=require(_0x3bf1('0x4'));var fs=require('fs');var Redis=require(_0x3bf1('0x5'));var db=require(_0x3bf1('0x6'))['db'];var utils=require(_0x3bf1('0x7'));var logger=require(_0x3bf1('0x8'))(_0x3bf1('0x9'));var config=require(_0x3bf1('0xa'));var jayson=require(_0x3bf1('0xb'));var client=jayson[_0x3bf1('0xc')][_0x3bf1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x21ea89,_0x129baa,_0x3c14b8){return new BPromise(function(_0x56674f,_0x1b51f5){return client['request'](_0x21ea89,_0x3c14b8)[_0x3bf1('0xe')](function(_0x315ee1){logger[_0x3bf1('0xf')](_0x3bf1('0x10'),_0x129baa,'request\x20sent');logger[_0x3bf1('0x11')](_0x3bf1('0x12'),_0x129baa,_0x3bf1('0x13'),JSON[_0x3bf1('0x14')](_0x315ee1));if(_0x315ee1['error']){if(_0x315ee1[_0x3bf1('0x15')][_0x3bf1('0x16')]===0x1f4){logger[_0x3bf1('0x15')](_0x3bf1('0x10'),_0x129baa,_0x315ee1[_0x3bf1('0x15')][_0x3bf1('0x17')]);return _0x1b51f5(_0x315ee1[_0x3bf1('0x15')][_0x3bf1('0x17')]);}logger[_0x3bf1('0x15')](_0x3bf1('0x10'),_0x129baa,_0x315ee1[_0x3bf1('0x15')]['message']);return _0x56674f(_0x315ee1['error'][_0x3bf1('0x17')]);}else{logger[_0x3bf1('0xf')](_0x3bf1('0x10'),_0x129baa,_0x3bf1('0x13'));_0x56674f(_0x315ee1[_0x3bf1('0x18')][_0x3bf1('0x17')]);}})[_0x3bf1('0x19')](function(_0x577cd8){logger['error'](_0x3bf1('0x10'),_0x129baa,_0x577cd8);_0x1b51f5(_0x577cd8);});});} \ No newline at end of file +var _0xf2eb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird'];(function(_0x35574a,_0x1e8f95){var _0x5f0ce2=function(_0x51b5a2){while(--_0x51b5a2){_0x35574a['push'](_0x35574a['shift']());}};_0x5f0ce2(++_0x1e8f95);}(_0xf2eb,0x19f));var _0xbf2e=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xf2eb[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0xbf2e('0x0'));var util=require(_0xbf2e('0x1'));var moment=require('moment');var BPromise=require(_0xbf2e('0x2'));var rs=require(_0xbf2e('0x3'));var fs=require('fs');var Redis=require(_0xbf2e('0x4'));var db=require(_0xbf2e('0x5'))['db'];var utils=require(_0xbf2e('0x6'));var logger=require(_0xbf2e('0x7'))(_0xbf2e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbf2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x347a6e,_0x58ce85,_0x4fd4a3){return new BPromise(function(_0x5bd315,_0x506502){return client['request'](_0x347a6e,_0x4fd4a3)[_0xbf2e('0xa')](function(_0x319e67){logger[_0xbf2e('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x58ce85,'request\x20sent');logger['debug'](_0xbf2e('0xc'),_0x58ce85,'request\x20sent',JSON['stringify'](_0x319e67));if(_0x319e67['error']){if(_0x319e67[_0xbf2e('0xd')][_0xbf2e('0xe')]===0x1f4){logger[_0xbf2e('0xd')](_0xbf2e('0xf'),_0x58ce85,_0x319e67[_0xbf2e('0xd')]['message']);return _0x506502(_0x319e67[_0xbf2e('0xd')][_0xbf2e('0x10')]);}logger[_0xbf2e('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x58ce85,_0x319e67[_0xbf2e('0xd')][_0xbf2e('0x10')]);return _0x5bd315(_0x319e67[_0xbf2e('0xd')][_0xbf2e('0x10')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x58ce85,_0xbf2e('0x11'));_0x5bd315(_0x319e67[_0xbf2e('0x12')][_0xbf2e('0x10')]);}})['catch'](function(_0x455766){logger[_0xbf2e('0xd')](_0xbf2e('0xf'),_0x58ce85,_0x455766);_0x506502(_0x455766);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b54e9f4..7f806d5 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89a4=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x571506,_0x132cce){var _0xe2fdfa=function(_0x4e49ac){while(--_0x4e49ac){_0x571506['push'](_0x571506['shift']());}};_0xe2fdfa(++_0x132cce);}(_0x89a4,0x1b4));var _0x489a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x89a4[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x489a('0x0'));var util=require(_0x489a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x489a('0x2'));var router=express[_0x489a('0x3')]();var fs_extra=require(_0x489a('0x4'));var auth=require(_0x489a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x489a('0x6'));var controller=require(_0x489a('0x7'));router[_0x489a('0x8')]('/',auth[_0x489a('0x9')](),controller[_0x489a('0xa')]);router[_0x489a('0x8')](_0x489a('0xb'),auth[_0x489a('0x9')](),controller[_0x489a('0xc')]);router[_0x489a('0x8')](_0x489a('0xd'),auth['isAuthenticated'](),controller['getSessions']);router[_0x489a('0x8')](_0x489a('0xe'),auth['isAuthenticated'](),controller[_0x489a('0xf')]);router[_0x489a('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x489a('0x10')),controller[_0x489a('0x11')]);router[_0x489a('0x12')]('/',auth[_0x489a('0x9')](),controller[_0x489a('0x13')]);router[_0x489a('0x12')](_0x489a('0x14'),auth[_0x489a('0x9')](),controller[_0x489a('0x15')]);router[_0x489a('0x16')](_0x489a('0xb'),auth['isAuthenticated'](),controller[_0x489a('0x17')]);router[_0x489a('0x18')]('/:id',auth[_0x489a('0x9')](),controller[_0x489a('0x19')]);module['exports']=router; \ No newline at end of file +var _0xa2cc=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x3b6d6e,_0x3beafa){var _0x32784d=function(_0x28cd38){while(--_0x28cd38){_0x3b6d6e['push'](_0x3b6d6e['shift']());}};_0x32784d(++_0x3beafa);}(_0xa2cc,0xf9));var _0xca2c=function(_0x2f60a6,_0x433a6e){_0x2f60a6=_0x2f60a6-0x0;var _0x98285a=_0xa2cc[_0x2f60a6];return _0x98285a;};'use strict';var multer=require(_0xca2c('0x0'));var util=require('util');var path=require(_0xca2c('0x1'));var timeout=require(_0xca2c('0x2'));var express=require('express');var router=express[_0xca2c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xca2c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xca2c('0x5'));var controller=require(_0xca2c('0x6'));router[_0xca2c('0x7')]('/',auth[_0xca2c('0x8')](),controller[_0xca2c('0x9')]);router[_0xca2c('0x7')](_0xca2c('0xa'),auth[_0xca2c('0x8')](),controller[_0xca2c('0xb')]);router[_0xca2c('0x7')](_0xca2c('0xc'),auth[_0xca2c('0x8')](),controller[_0xca2c('0xd')]);router[_0xca2c('0x7')](_0xca2c('0xe'),auth[_0xca2c('0x8')](),controller[_0xca2c('0xf')]);router[_0xca2c('0x7')](_0xca2c('0x10'),auth[_0xca2c('0x8')](),timeout(_0xca2c('0x11')),controller[_0xca2c('0x12')]);router[_0xca2c('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca2c('0x13')](_0xca2c('0x14'),auth[_0xca2c('0x8')](),controller[_0xca2c('0x15')]);router[_0xca2c('0x16')](_0xca2c('0xa'),auth[_0xca2c('0x8')](),controller[_0xca2c('0x17')]);router[_0xca2c('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xca2c('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 0bd3e6a..bbf98c9 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a87=['exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','sequelize','lodash','util'];(function(_0x2e23ee,_0x12eaec){var _0x5af1a6=function(_0x1e3874){while(--_0x1e3874){_0x2e23ee['push'](_0x2e23ee['shift']());}};_0x5af1a6(++_0x12eaec);}(_0x8a87,0x19d));var _0x78a8=function(_0x47c39a,_0x165a5d){_0x47c39a=_0x47c39a-0x0;var _0x590928=_0x8a87[_0x47c39a];return _0x590928;};'use strict';var Sequelize=require(_0x78a8('0x0'));var _=require(_0x78a8('0x1'));var util=require(_0x78a8('0x2'));module[_0x78a8('0x3')]={'name':{'type':Sequelize[_0x78a8('0x4')],'unique':_0x78a8('0x5')},'description':{'type':Sequelize[_0x78a8('0x4')]},'formData':{'type':Sequelize[_0x78a8('0x6')](_0x78a8('0x7')),'set':function(_0x358f83){if(_[_0x78a8('0x8')](_0x358f83)){this[_0x78a8('0x9')](_0x78a8('0xa'),JSON[_0x78a8('0xb')](_0x358f83));}else if(_[_0x78a8('0xc')](_0x358f83)){this[_0x78a8('0x9')](_0x78a8('0xa'),_0x358f83);}else{this[_0x78a8('0x9')]('formData',util['format'](_0x78a8('0xd'),this[_0x78a8('0xe')]('name')||'',this[_0x78a8('0xe')](_0x78a8('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6ced=['name','description','BOOLEAN','sequelize','lodash','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x56d3a2,_0x5f191b){var _0x2c14d0=function(_0xb776e2){while(--_0xb776e2){_0x56d3a2['push'](_0x56d3a2['shift']());}};_0x2c14d0(++_0x5f191b);}(_0x6ced,0xcf));var _0xd6ce=function(_0x544a3d,_0x4bc199){_0x544a3d=_0x544a3d-0x0;var _0x1d1437=_0x6ced[_0x544a3d];return _0x1d1437;};'use strict';var Sequelize=require(_0xd6ce('0x0'));var _=require(_0xd6ce('0x1'));var util=require('util');module[_0xd6ce('0x2')]={'name':{'type':Sequelize[_0xd6ce('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd6ce('0x4')](_0xd6ce('0x5')),'set':function(_0x339bf0){if(_[_0xd6ce('0x6')](_0x339bf0)){this[_0xd6ce('0x7')](_0xd6ce('0x8'),JSON[_0xd6ce('0x9')](_0x339bf0));}else if(_[_0xd6ce('0xa')](_0x339bf0)){this['setDataValue'](_0xd6ce('0x8'),_0x339bf0);}else{this['setDataValue'](_0xd6ce('0x8'),util[_0xd6ce('0xb')](_0xd6ce('0xc'),this[_0xd6ce('0xd')](_0xd6ce('0xe'))||'',this['getDataValue'](_0xd6ce('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd6ce('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9a70389..045e0d3 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97db=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','reject','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','options','JscriptyProject','includeAll','include','findAll','rows','length','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','catch','clone','params','omit','createdAt','updatedAt','body','getSessions','findOne','JscriptySessionReport','hasOwnProperty','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','starttime','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5c3e80,_0x4e6c3a){var _0x2ad8ab=function(_0x52c82c){while(--_0x52c82c){_0x5c3e80['push'](_0x5c3e80['shift']());}};_0x2ad8ab(++_0x4e6c3a);}(_0x97db,0x1b4));var _0xb97d=function(_0x150820,_0x3a6ce5){_0x150820=_0x150820-0x0;var _0x2e21a0=_0x97db[_0x150820];return _0x2e21a0;};'use strict';var emlformat=require(_0xb97d('0x0'));var rimraf=require(_0xb97d('0x1'));var zipdir=require(_0xb97d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb97d('0x3'));var BPromise=require(_0xb97d('0x4'));var Mustache=require(_0xb97d('0x5'));var util=require(_0xb97d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb97d('0x7'));var ejs=require(_0xb97d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb97d('0x9'));var crypto=require('crypto');var jsforce=require(_0xb97d('0xa'));var deskjs=require(_0xb97d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb97d('0xc'));var Papa=require(_0xb97d('0xd'));var Redis=require(_0xb97d('0xe'));var authService=require(_0xb97d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb97d('0x10'));var hardwareService=require(_0xb97d('0x11'));var logger=require(_0xb97d('0x12'))(_0xb97d('0x13'));var utils=require(_0xb97d('0x14'));var config=require(_0xb97d('0x15'));var licenseUtil=require(_0xb97d('0x16'));var db=require(_0xb97d('0x17'))['db'];function respondWithStatusCode(_0xa31bc3,_0x412655){_0x412655=_0x412655||0xcc;return function(_0xb3abc1){if(_0xb3abc1){return _0xa31bc3[_0xb97d('0x18')](_0x412655);}return _0xa31bc3[_0xb97d('0x19')](_0x412655)[_0xb97d('0x1a')]();};}function respondWithResult(_0x1d70f9,_0x2f73ec){_0x2f73ec=_0x2f73ec||0xc8;return function(_0x117bfe){if(_0x117bfe){return _0x1d70f9[_0xb97d('0x19')](_0x2f73ec)['json'](_0x117bfe);}};}function respondWithFilteredResult(_0x41a47c,_0x1a71de){return function(_0x35ea35){if(_0x35ea35){var _0x170a07=typeof _0x1a71de[_0xb97d('0x1b')]==='undefined'&&typeof _0x1a71de[_0xb97d('0x1c')]===_0xb97d('0x1d');var _0xea4e95=_0x35ea35['count'];var _0x50cd63=_0x170a07?0x0:_0x1a71de[_0xb97d('0x1b')];var _0x2285bc=_0x170a07?_0x35ea35[_0xb97d('0x1e')]:_0x1a71de[_0xb97d('0x1b')]+_0x1a71de[_0xb97d('0x1c')];var _0x3cd261;if(_0x2285bc>=_0xea4e95){_0x2285bc=_0xea4e95;_0x3cd261=0xc8;}else{_0x3cd261=0xce;}_0x41a47c[_0xb97d('0x19')](_0x3cd261);return _0x41a47c['set']('Content-Range',_0x50cd63+'-'+_0x2285bc+'/'+_0xea4e95)['json'](_0x35ea35);}return null;};}function patchUpdates(_0x49b857){return function(_0x395e6b){try{jsonpatch['apply'](_0x395e6b,_0x49b857,!![]);}catch(_0x3c0d42){return BPromise[_0xb97d('0x1f')](_0x3c0d42);}return _0x395e6b['save']();};}function saveUpdates(_0x52af79,_0x5b2a19){return function(_0xd77fee){if(_0xd77fee){return _0xd77fee[_0xb97d('0x20')](_0x52af79)[_0xb97d('0x21')](function(_0x453741){return _0x453741;});}return null;};}function removeEntity(_0x20df11,_0x3f7704){return function(_0x270cc5){if(_0x270cc5){return _0x270cc5[_0xb97d('0x22')]()[_0xb97d('0x21')](function(){var _0x207575=_0x270cc5['get']({'plain':!![]});var _0x14a8eb=_0xb97d('0x23');return db[_0xb97d('0x24')][_0xb97d('0x22')]({'where':{'type':_0x14a8eb,'resourceId':_0x207575['id']}})['then'](function(){return _0x270cc5;});})[_0xb97d('0x21')](function(){_0x20df11['status'](0xcc)[_0xb97d('0x1a')]();});}};}function handleEntityNotFound(_0xee6a00,_0x29b7e2){return function(_0x29508a){if(!_0x29508a){_0xee6a00[_0xb97d('0x18')](0x194);}return _0x29508a;};}function handleError(_0x121765,_0xa5fbed){_0xa5fbed=_0xa5fbed||0x1f4;return function(_0x26886a){logger[_0xb97d('0x25')](_0x26886a[_0xb97d('0x26')]);if(_0x26886a['name']){delete _0x26886a[_0xb97d('0x27')];}_0x121765[_0xb97d('0x19')](_0xa5fbed)[_0xb97d('0x28')](_0x26886a);};}exports['index']=function(_0x1a519a,_0x949dd1){var _0x50da08={},_0x499b2c={},_0x5d51bf={'count':0x0,'rows':[]};var _0x2227ed=_[_0xb97d('0x29')](db['JscriptyProject'][_0xb97d('0x2a')],function(_0x577da6){return{'name':_0x577da6['fieldName'],'type':_0x577da6[_0xb97d('0x2b')][_0xb97d('0x2c')]};});_0x499b2c[_0xb97d('0x2d')]=_[_0xb97d('0x29')](_0x2227ed,'name');_0x499b2c[_0xb97d('0x2e')]=_[_0xb97d('0x2f')](_0x1a519a[_0xb97d('0x2e')]);_0x499b2c[_0xb97d('0x30')]=_[_0xb97d('0x31')](_0x499b2c[_0xb97d('0x2d')],_0x499b2c[_0xb97d('0x2e')]);_0x50da08[_0xb97d('0x32')]=_[_0xb97d('0x31')](_0x499b2c['model'],qs[_0xb97d('0x33')](_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x50da08[_0xb97d('0x32')]=_0x50da08[_0xb97d('0x32')]['length']?_0x50da08[_0xb97d('0x32')]:_0x499b2c[_0xb97d('0x2d')];if(!_0x1a519a['query']['hasOwnProperty'](_0xb97d('0x34'))){_0x50da08['limit']=qs[_0xb97d('0x1c')](_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x1c')]);_0x50da08[_0xb97d('0x1b')]=qs['offset'](_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x1b')]);}_0x50da08['order']=qs[_0xb97d('0x35')](_0x1a519a[_0xb97d('0x2e')]['sort']);_0x50da08[_0xb97d('0x36')]=qs[_0xb97d('0x30')](_['pick'](_0x1a519a[_0xb97d('0x2e')],_0x499b2c[_0xb97d('0x30')]),_0x2227ed);if(_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x37')]){_0x50da08[_0xb97d('0x36')]=_[_0xb97d('0x38')](_0x50da08['where'],{'$or':_[_0xb97d('0x29')](_0x2227ed,function(_0x5b313a){if(_0x5b313a[_0xb97d('0x2b')]!=='VIRTUAL'){var _0xf5a069={};_0xf5a069[_0x5b313a[_0xb97d('0x27')]]={'$like':'%'+_0x1a519a['query'][_0xb97d('0x37')]+'%'};return _0xf5a069;}})});}_0x50da08=_[_0xb97d('0x38')]({},_0x50da08,_0x1a519a[_0xb97d('0x39')]);var _0x118824={'where':_0x50da08['where']};return db[_0xb97d('0x3a')]['count'](_0x118824)[_0xb97d('0x21')](function(_0x5967e4){_0x5d51bf['count']=_0x5967e4;if(_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x50da08[_0xb97d('0x3c')]=[{'all':!![]}];}return db[_0xb97d('0x3a')][_0xb97d('0x3d')](_0x50da08);})[_0xb97d('0x21')](function(_0xa3b813){_0x5d51bf[_0xb97d('0x3e')]=_0xa3b813;return _0x5d51bf;})[_0xb97d('0x21')](respondWithFilteredResult(_0x949dd1,_0x50da08))['catch'](handleError(_0x949dd1,null));};exports['show']=function(_0x3d5372,_0x244cb9){var _0x6c07b5={'raw':![],'where':{'id':_0x3d5372['params']['id']}},_0x1e5162={};_0x1e5162[_0xb97d('0x2d')]=_[_0xb97d('0x2f')](db[_0xb97d('0x3a')]['rawAttributes']);_0x1e5162[_0xb97d('0x2e')]=_[_0xb97d('0x2f')](_0x3d5372[_0xb97d('0x2e')]);_0x1e5162[_0xb97d('0x30')]=_[_0xb97d('0x31')](_0x1e5162[_0xb97d('0x2d')],_0x1e5162[_0xb97d('0x2e')]);_0x6c07b5['attributes']=_[_0xb97d('0x31')](_0x1e5162[_0xb97d('0x2d')],qs[_0xb97d('0x33')](_0x3d5372[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x6c07b5[_0xb97d('0x32')]=_0x6c07b5[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x6c07b5[_0xb97d('0x32')]:_0x1e5162[_0xb97d('0x2d')];if(_0x3d5372[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x6c07b5[_0xb97d('0x3c')]=[{'all':!![]}];}_0x6c07b5=_[_0xb97d('0x38')]({},_0x6c07b5,_0x3d5372['options']);return db[_0xb97d('0x3a')][_0xb97d('0x40')](_0x6c07b5)[_0xb97d('0x21')](handleEntityNotFound(_0x244cb9,null))['then'](respondWithResult(_0x244cb9,null))['catch'](handleError(_0x244cb9,null));};exports[_0xb97d('0x41')]=function(_0x24bddf,_0x481cb4){return db[_0xb97d('0x3a')][_0xb97d('0x41')](_0x24bddf['body'],{})[_0xb97d('0x21')](function(_0x1336d3){var _0x3cfe00=_0x24bddf['user']['get']({'plain':!![]});if(!_0x3cfe00)throw new Error(_0xb97d('0x42'));if(_0x3cfe00[_0xb97d('0x43')]===_0xb97d('0x44')){var _0x4e5ae7=_0x1336d3[_0xb97d('0x45')]({'plain':!![]});var _0x4ca0fe=_0xb97d('0x23');return db[_0xb97d('0x46')]['find']({'where':{'name':_0x4ca0fe,'userProfileId':_0x3cfe00[_0xb97d('0x47')]},'raw':!![]})[_0xb97d('0x21')](function(_0x386b91){if(_0x386b91&&_0x386b91[_0xb97d('0x48')]===0x0){return db['UserProfileResource'][_0xb97d('0x41')]({'name':_0x4e5ae7['name'],'resourceId':_0x4e5ae7['id'],'type':_0x386b91[_0xb97d('0x27')],'sectionId':_0x386b91['id']},{})[_0xb97d('0x21')](function(){return _0x1336d3;});}else{return _0x1336d3;}})['catch'](function(_0x55919f){logger[_0xb97d('0x25')](_0xb97d('0x49'),_0x55919f);throw _0x55919f;});}return _0x1336d3;})[_0xb97d('0x21')](respondWithResult(_0x481cb4,0xc9))[_0xb97d('0x4a')](handleError(_0x481cb4,null));};exports[_0xb97d('0x4b')]=function(_0x5f4e37,_0x3ca690){var _0x298fff={'where':{'id':_0x5f4e37[_0xb97d('0x4c')]['id']}},_0x228209={};_0x228209[_0xb97d('0x2d')]=_[_0xb97d('0x2f')](db[_0xb97d('0x3a')][_0xb97d('0x2a')]);_0x298fff[_0xb97d('0x32')]=_[_0xb97d('0x31')](_0x228209[_0xb97d('0x2d')],qs['fields'](_0x5f4e37[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x298fff[_0xb97d('0x32')]=_0x298fff[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x298fff['attributes']:_0x228209['model'];if(_0x5f4e37[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x298fff[_0xb97d('0x3c')]=[{'all':!![]}];}_0x298fff=_[_0xb97d('0x38')]({},_0x298fff,_0x5f4e37[_0xb97d('0x39')]);return db[_0xb97d('0x3a')]['find'](_0x298fff)[_0xb97d('0x21')](handleEntityNotFound(_0x3ca690,null))[_0xb97d('0x21')](function(_0x454067){if(_0x454067){var _0x58f8b3=_0x454067[_0xb97d('0x45')]({'plain':!![]});_0x58f8b3=qs[_0xb97d('0x4d')](_0x58f8b3,['id',_0xb97d('0x4e'),_0xb97d('0x4f')]);_0x5f4e37[_0xb97d('0x50')]=_[_0xb97d('0x4d')](_0x5f4e37[_0xb97d('0x50')],['id',_0xb97d('0x4e'),_0xb97d('0x4f')]);return db[_0xb97d('0x3a')]['create'](_[_0xb97d('0x38')](_0x58f8b3,_0x5f4e37[_0xb97d('0x50')]),{'include':_0x5f4e37[_0xb97d('0x2e')][_0xb97d('0x3b')]?[{'all':!![]}]:undefined})['then'](function(_0x68ce48){var _0x411744=_0x5f4e37['user'][_0xb97d('0x45')]({'plain':!![]});if(!_0x411744)throw new Error(_0xb97d('0x42'));if(_0x411744['role']==='user'){var _0xa270b5=_0x68ce48['get']({'plain':!![]});var _0x574546=_0xb97d('0x23');return db[_0xb97d('0x46')][_0xb97d('0x40')]({'where':{'name':_0x574546,'userProfileId':_0x411744['userProfileId']},'raw':!![]})[_0xb97d('0x21')](function(_0x653d86){if(_0x653d86&&_0x653d86['autoAssociation']===0x0){return db[_0xb97d('0x24')][_0xb97d('0x41')]({'name':_0xa270b5[_0xb97d('0x27')],'resourceId':_0xa270b5['id'],'type':_0x653d86['name'],'sectionId':_0x653d86['id']},{})[_0xb97d('0x21')](function(){return _0x68ce48;});}else{return _0x68ce48;}})[_0xb97d('0x4a')](function(_0x173da2){logger['error'](_0xb97d('0x49'),_0x173da2);throw _0x173da2;});}return _0x68ce48;});}})[_0xb97d('0x21')](respondWithResult(_0x3ca690,0xc9))[_0xb97d('0x4a')](handleError(_0x3ca690,null));};exports[_0xb97d('0x20')]=function(_0x114c23,_0x30291b){if(_0x114c23['body']['id']){delete _0x114c23[_0xb97d('0x50')]['id'];}return db['JscriptyProject'][_0xb97d('0x40')]({'where':{'id':_0x114c23[_0xb97d('0x4c')]['id']}})[_0xb97d('0x21')](handleEntityNotFound(_0x30291b,null))[_0xb97d('0x21')](saveUpdates(_0x114c23['body'],null))[_0xb97d('0x21')](respondWithResult(_0x30291b,null))[_0xb97d('0x4a')](handleError(_0x30291b,null));};exports[_0xb97d('0x22')]=function(_0x1eed10,_0x21c461){return db[_0xb97d('0x3a')][_0xb97d('0x40')]({'where':{'id':_0x1eed10[_0xb97d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x21c461,null))[_0xb97d('0x21')](removeEntity(_0x21c461,null))[_0xb97d('0x4a')](handleError(_0x21c461,null));};exports[_0xb97d('0x51')]=function(_0x4fd322,_0x1a0a11,_0x233ba9){var _0x127f55={'raw':!![],'where':{}};var _0xce0b29={};var _0x40675b={'count':0x0,'rows':[]};return db[_0xb97d('0x3a')][_0xb97d('0x52')]({'where':{'id':_0x4fd322[_0xb97d('0x4c')]['id']}})[_0xb97d('0x21')](handleEntityNotFound(_0x1a0a11,null))[_0xb97d('0x21')](function(_0x5e4376){if(_0x5e4376){_0xce0b29[_0xb97d('0x2d')]=_['keys'](db[_0xb97d('0x53')]['rawAttributes']);_0xce0b29['query']=_[_0xb97d('0x2f')](_0x4fd322[_0xb97d('0x2e')]);_0xce0b29[_0xb97d('0x30')]=_[_0xb97d('0x31')](_0xce0b29[_0xb97d('0x2d')],_0xce0b29['query']);_0x127f55['attributes']=_[_0xb97d('0x31')](_0xce0b29[_0xb97d('0x2d')],qs['fields'](_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x127f55[_0xb97d('0x32')]=_0x127f55[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x127f55[_0xb97d('0x32')]:_0xce0b29[_0xb97d('0x2d')];if(!_0x4fd322['query'][_0xb97d('0x54')]('nolimit')){_0x127f55[_0xb97d('0x1c')]=qs[_0xb97d('0x1c')](_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x1c')]);_0x127f55[_0xb97d('0x1b')]=qs[_0xb97d('0x1b')](_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x1b')]);}_0x127f55['order']=qs[_0xb97d('0x35')](_0x4fd322['query'][_0xb97d('0x35')]);_0x127f55[_0xb97d('0x36')]=qs[_0xb97d('0x30')](_[_0xb97d('0x55')](_0x4fd322[_0xb97d('0x2e')],_0xce0b29[_0xb97d('0x30')]));_0x127f55[_0xb97d('0x36')][_0xb97d('0x56')]=_0x5e4376['id'];if(_0x4fd322['query']['filter']){_0x127f55['where']=_[_0xb97d('0x38')](_0x127f55['where'],{'$or':_['map'](_0x127f55[_0xb97d('0x32')],function(_0x22262d){var _0x2e70df={};_0x2e70df[_0x22262d]={'$like':'%'+_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x37')]+'%'};return _0x2e70df;})});}_0x127f55=_['merge']({},_0x127f55,_0x4fd322[_0xb97d('0x39')]);return db['JscriptySessionReport'][_0xb97d('0x1e')]({'where':_0x127f55[_0xb97d('0x36')]})[_0xb97d('0x21')](function(_0x5b77d2){_0x40675b['count']=_0x5b77d2;if(_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x127f55[_0xb97d('0x3c')]=[{'all':!![]}];}return db[_0xb97d('0x53')][_0xb97d('0x3d')](_0x127f55);})[_0xb97d('0x21')](function(_0x1fa78a){_0x40675b['rows']=_0x1fa78a;return _0x40675b;});}})[_0xb97d('0x21')](respondWithFilteredResult(_0x1a0a11,_0x127f55))['catch'](handleError(_0x1a0a11,null));};exports[_0xb97d('0x57')]=function(_0x25c890,_0x1ff63a,_0x4ee1aa){var _0x536452={'raw':!![],'where':{}};var _0x26ede1={};var _0x1aaba7={'count':0x0,'rows':[]};return db[_0xb97d('0x3a')][_0xb97d('0x52')]({'where':{'id':_0x25c890[_0xb97d('0x4c')]['id']}})[_0xb97d('0x21')](handleEntityNotFound(_0x1ff63a,null))[_0xb97d('0x21')](function(_0x50d5c9){if(_0x50d5c9){_0x26ede1[_0xb97d('0x2d')]=_['keys'](db[_0xb97d('0x58')][_0xb97d('0x2a')]);_0x26ede1['query']=_[_0xb97d('0x2f')](_0x25c890['query']);_0x26ede1['filters']=_['intersection'](_0x26ede1[_0xb97d('0x2d')],_0x26ede1['query']);_0x536452[_0xb97d('0x32')]=_[_0xb97d('0x31')](_0x26ede1['model'],qs['fields'](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x536452[_0xb97d('0x32')]=_0x536452[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x536452[_0xb97d('0x32')]:_0x26ede1[_0xb97d('0x2d')];if(!_0x25c890[_0xb97d('0x2e')][_0xb97d('0x54')](_0xb97d('0x34'))){_0x536452['limit']=qs[_0xb97d('0x1c')](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x1c')]);_0x536452['offset']=qs['offset'](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x1b')]);}_0x536452['order']=qs[_0xb97d('0x35')](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x35')]);_0x536452[_0xb97d('0x36')]=qs['filters'](_[_0xb97d('0x55')](_0x25c890[_0xb97d('0x2e')],_0x26ede1[_0xb97d('0x30')]));_0x536452['where'][_0xb97d('0x56')]=_0x50d5c9['id'];if(_0x25c890['query']['filter']){_0x536452[_0xb97d('0x36')]=_['merge'](_0x536452[_0xb97d('0x36')],{'$or':_[_0xb97d('0x29')](_0x536452[_0xb97d('0x32')],function(_0x53e142){var _0x4d15ba={};_0x4d15ba[_0x53e142]={'$like':'%'+_0x25c890['query'][_0xb97d('0x37')]+'%'};return _0x4d15ba;})});}_0x536452=_[_0xb97d('0x38')]({},_0x536452,_0x25c890[_0xb97d('0x39')]);return db[_0xb97d('0x58')][_0xb97d('0x1e')]({'where':_0x536452[_0xb97d('0x36')]})['then'](function(_0x3d2f90){_0x1aaba7[_0xb97d('0x1e')]=_0x3d2f90;if(_0x25c890[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x536452['include']=[{'all':!![]}];}return db[_0xb97d('0x58')]['findAll'](_0x536452);})[_0xb97d('0x21')](function(_0x1b63f4){_0x1aaba7[_0xb97d('0x3e')]=_0x1b63f4;return _0x1aaba7;});}})[_0xb97d('0x21')](respondWithFilteredResult(_0x1ff63a,_0x536452))['catch'](handleError(_0x1ff63a,null));};function char(_0x3dbbf4){return _0xb97d('0x59')===typeof _0x3dbbf4?String[_0xb97d('0x5a')][_0xb97d('0x5b')](null,arguments):_0x3dbbf4;}function needsEncapsulation(_0x3743a0){return!!_0x3743a0&&(_0x3743a0[_0xb97d('0x5c')]()[_0xb97d('0x5d')](char(0xd))>=0x0||_0x3743a0[_0xb97d('0x5c')]()[_0xb97d('0x5d')](char(0xa))>=0x0||_0x3743a0['toString']()[_0xb97d('0x5d')](char(0x2c))>=0x0||_0x3743a0['toString']()[_0xb97d('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x5500e8){var _0x3b7ac7=char(0x22),_0x41cdf9='\x5c'+char(0x22),_0xba43b5=_0x5500e8[_0xb97d('0x5c')]()[_0xb97d('0x5e')](new RegExp(_0x3b7ac7,'g'),_0x41cdf9);return _0x3b7ac7+_0xba43b5+_0x3b7ac7;}exports['getSummary']=function(_0x4d1552,_0x1a5d85,_0x59a518){var _0x4aab4f,_0x57957a;var _0x6f0066={'where':{'ProjectId':_0x4d1552[_0xb97d('0x4c')]['id']}};if(_0x4d1552[_0xb97d('0x2e')]['startTime']){_0x6f0066[_0xb97d('0x36')][_0xb97d('0x5f')]=JSON['parse'](_0x4d1552[_0xb97d('0x2e')][_0xb97d('0x60')]);}return db[_0xb97d('0x53')][_0xb97d('0x3d')](_0x6f0066)[_0xb97d('0x21')](handleEntityNotFound(_0x1a5d85,null))[_0xb97d('0x21')](function(_0x537be3){if(_0x537be3){_0x4aab4f=_0x537be3;return db['JscriptyQuestionReport'][_0xb97d('0x3d')]({'where':{'SessionId':{'$in':_[_0xb97d('0x29')](_0x4aab4f,'id')},'ProjectId':_0x4d1552[_0xb97d('0x4c')]['id']},'order':_0xb97d('0x61')});}})[_0xb97d('0x21')](handleEntityNotFound(_0x1a5d85,null))[_0xb97d('0x21')](function(_0x41d537){if(_0x41d537){_0x57957a=_0x41d537;var _0x489ffa={};for(var _0x34d3d4=0x0,_0x3be837=_0x57957a[_0xb97d('0x3f')];_0x34d3d4<_0x3be837;_0x34d3d4++){if(!_0x489ffa[_0xb97d('0x54')](_0x57957a[_0x34d3d4][_0xb97d('0x62')])){_0x489ffa[_0x57957a[_0x34d3d4]['questionId']]=needsEncapsulation(_0x57957a[_0x34d3d4][_0xb97d('0x63')])?encapsulate(_0x57957a[_0x34d3d4]['question']):_0x57957a[_0x34d3d4][_0xb97d('0x63')];}}var _0x45176a=[],_0xdb6d22={};for(var _0x320a7d=0x0,_0x3876a8=_0x4aab4f[_0xb97d('0x3f')];_0x320a7d<_0x3876a8;_0x320a7d++){_0xdb6d22={'ProjectId':_0x4d1552[_0xb97d('0x4c')]['id'],'SessionId':_0x4aab4f[_0x320a7d]['id'],'StartTime':moment(_0x4aab4f[_0x320a7d][_0xb97d('0x5f')])[_0xb97d('0x64')](_0xb97d('0x65'))};for(var _0xa9f55d=0x0,_0x3d28e9=_0x57957a[_0xb97d('0x3f')];_0xa9f55d<_0x3d28e9;_0xa9f55d++){if(_0x57957a[_0xa9f55d][_0xb97d('0x66')]==_0x4aab4f[_0x320a7d]['id']&&_0x489ffa['hasOwnProperty'](_0x57957a[_0xa9f55d][_0xb97d('0x62')])){_0xdb6d22[_0x489ffa[_0x57957a[_0xa9f55d][_0xb97d('0x62')]]]=_0x57957a[_0xa9f55d][_0xb97d('0x67')];}}for(var _0x1d389c in _0x489ffa){if(!_0xdb6d22['hasOwnProperty'](_0x489ffa[_0x1d389c])){_0xdb6d22[_0x489ffa[_0x1d389c]]=null;}}_0x45176a[_0xb97d('0x68')](_0xdb6d22);}return _0x45176a;}})[_0xb97d('0x21')](function(_0xb74d87){if(!_['isEmpty'](_0xb74d87)){var _0x30fd45=toCsv(_0xb74d87);var _0x3f9fb0=Date[_0xb97d('0x69')]();fs[_0xb97d('0x6a')](util[_0xb97d('0x64')](_0xb97d('0x6b'),_0x4d1552[_0xb97d('0x4c')]['id'],_0x3f9fb0),_0x30fd45);_0x1a5d85[_0xb97d('0x6c')](_0xb97d('0x6d'),_0xb97d('0x6e')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4d1552[_0xb97d('0x4c')]['id'],_0x3f9fb0));_0x1a5d85[_0xb97d('0x6c')](_0xb97d('0x6f'),_0xb97d('0x70'));return _0x1a5d85[_0xb97d('0x71')](util[_0xb97d('0x64')](_0xb97d('0x6b'),_0x4d1552[_0xb97d('0x4c')]['id'],_0x3f9fb0));}else{return _0x1a5d85[_0xb97d('0x18')](0xcc);}})[_0xb97d('0x4a')](handleError(_0x1a5d85,null));}; \ No newline at end of file +var _0x1956=['end','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','role','user','UserProfileSection','getSessions','findOne','nolimit','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','UserProfileResource'];(function(_0x5a9f73,_0x19a26a){var _0x4e50b3=function(_0xa11396){while(--_0xa11396){_0x5a9f73['push'](_0x5a9f73['shift']());}};_0x4e50b3(++_0x19a26a);}(_0x1956,0x15c));var _0x6195=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x1956[_0xac151d];return _0x111dba;};'use strict';var emlformat=require(_0x6195('0x0'));var rimraf=require(_0x6195('0x1'));var zipdir=require(_0x6195('0x2'));var jsonpatch=require(_0x6195('0x3'));var rp=require(_0x6195('0x4'));var moment=require(_0x6195('0x5'));var BPromise=require(_0x6195('0x6'));var Mustache=require('mustache');var util=require(_0x6195('0x7'));var path=require(_0x6195('0x8'));var sox=require(_0x6195('0x9'));var csv=require(_0x6195('0xa'));var ejs=require(_0x6195('0xb'));var fs=require('fs');var fs_extra=require(_0x6195('0xc'));var _=require(_0x6195('0xd'));var squel=require(_0x6195('0xe'));var crypto=require(_0x6195('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6195('0x10'));var toCsv=require(_0x6195('0xa'));var querystring=require(_0x6195('0x11'));var Papa=require(_0x6195('0x12'));var Redis=require(_0x6195('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6195('0x14'));var as=require(_0x6195('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6195('0x16'))(_0x6195('0x17'));var utils=require(_0x6195('0x18'));var config=require(_0x6195('0x19'));var licenseUtil=require(_0x6195('0x1a'));var db=require(_0x6195('0x1b'))['db'];function respondWithStatusCode(_0x1282f5,_0x96b635){_0x96b635=_0x96b635||0xcc;return function(_0x51b975){if(_0x51b975){return _0x1282f5[_0x6195('0x1c')](_0x96b635);}return _0x1282f5[_0x6195('0x1d')](_0x96b635)['end']();};}function respondWithResult(_0x29c5e0,_0x431b3d){_0x431b3d=_0x431b3d||0xc8;return function(_0x5320f7){if(_0x5320f7){return _0x29c5e0[_0x6195('0x1d')](_0x431b3d)[_0x6195('0x1e')](_0x5320f7);}};}function respondWithFilteredResult(_0x1af54a,_0x397370){return function(_0x6653b7){if(_0x6653b7){var _0x1a555f=typeof _0x397370[_0x6195('0x1f')]===_0x6195('0x20')&&typeof _0x397370['limit']==='undefined';var _0x21bf76=_0x6653b7[_0x6195('0x21')];var _0x6174a3=_0x1a555f?0x0:_0x397370[_0x6195('0x1f')];var _0x3b42a0=_0x1a555f?_0x6653b7['count']:_0x397370[_0x6195('0x1f')]+_0x397370['limit'];var _0x40134d;if(_0x3b42a0>=_0x21bf76){_0x3b42a0=_0x21bf76;_0x40134d=0xc8;}else{_0x40134d=0xce;}_0x1af54a[_0x6195('0x1d')](_0x40134d);return _0x1af54a[_0x6195('0x22')](_0x6195('0x23'),_0x6174a3+'-'+_0x3b42a0+'/'+_0x21bf76)[_0x6195('0x1e')](_0x6653b7);}return null;};}function patchUpdates(_0x4e9673){return function(_0x4cadf3){try{jsonpatch['apply'](_0x4cadf3,_0x4e9673,!![]);}catch(_0x5595e0){return BPromise[_0x6195('0x24')](_0x5595e0);}return _0x4cadf3[_0x6195('0x25')]();};}function saveUpdates(_0xc1e5d9,_0x4f2d43){return function(_0x5bed95){if(_0x5bed95){return _0x5bed95[_0x6195('0x26')](_0xc1e5d9)['then'](function(_0x4181f3){return _0x4181f3;});}return null;};}function removeEntity(_0x11cc46,_0x184080){return function(_0x5dbe2c){if(_0x5dbe2c){return _0x5dbe2c[_0x6195('0x27')]()[_0x6195('0x28')](function(){var _0xd03b87=_0x5dbe2c['get']({'plain':!![]});var _0x5b83dc='Projects';return db[_0x6195('0x29')][_0x6195('0x27')]({'where':{'type':_0x5b83dc,'resourceId':_0xd03b87['id']}})[_0x6195('0x28')](function(){return _0x5dbe2c;});})[_0x6195('0x28')](function(){_0x11cc46[_0x6195('0x1d')](0xcc)[_0x6195('0x2a')]();});}};}function handleEntityNotFound(_0x251e21,_0x25a227){return function(_0x44c5ef){if(!_0x44c5ef){_0x251e21[_0x6195('0x1c')](0x194);}return _0x44c5ef;};}function handleError(_0x566e1e,_0x20c3e2){_0x20c3e2=_0x20c3e2||0x1f4;return function(_0x5af2af){logger[_0x6195('0x2b')](_0x5af2af[_0x6195('0x2c')]);if(_0x5af2af[_0x6195('0x2d')]){delete _0x5af2af[_0x6195('0x2d')];}_0x566e1e[_0x6195('0x1d')](_0x20c3e2)[_0x6195('0x2e')](_0x5af2af);};}exports[_0x6195('0x2f')]=function(_0x208c93,_0x217ac1){var _0x3839fd={},_0x21d93c={},_0x52d3ff={'count':0x0,'rows':[]};var _0x611d5=_[_0x6195('0x30')](db[_0x6195('0x31')][_0x6195('0x32')],function(_0x559e31){return{'name':_0x559e31[_0x6195('0x33')],'type':_0x559e31['type'][_0x6195('0x34')]};});_0x21d93c[_0x6195('0x35')]=_['map'](_0x611d5,_0x6195('0x2d'));_0x21d93c[_0x6195('0x36')]=_['keys'](_0x208c93[_0x6195('0x36')]);_0x21d93c[_0x6195('0x37')]=_[_0x6195('0x38')](_0x21d93c[_0x6195('0x35')],_0x21d93c[_0x6195('0x36')]);_0x3839fd[_0x6195('0x39')]=_[_0x6195('0x38')](_0x21d93c[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x208c93['query'][_0x6195('0x3a')]));_0x3839fd[_0x6195('0x39')]=_0x3839fd[_0x6195('0x39')]['length']?_0x3839fd[_0x6195('0x39')]:_0x21d93c[_0x6195('0x35')];if(!_0x208c93[_0x6195('0x36')][_0x6195('0x3b')]('nolimit')){_0x3839fd[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x208c93[_0x6195('0x36')][_0x6195('0x3c')]);_0x3839fd['offset']=qs['offset'](_0x208c93[_0x6195('0x36')][_0x6195('0x1f')]);}_0x3839fd['order']=qs[_0x6195('0x3d')](_0x208c93[_0x6195('0x36')]['sort']);_0x3839fd[_0x6195('0x3e')]=qs[_0x6195('0x37')](_[_0x6195('0x3f')](_0x208c93[_0x6195('0x36')],_0x21d93c[_0x6195('0x37')]),_0x611d5);if(_0x208c93[_0x6195('0x36')][_0x6195('0x40')]){_0x3839fd[_0x6195('0x3e')]=_['merge'](_0x3839fd[_0x6195('0x3e')],{'$or':_[_0x6195('0x30')](_0x611d5,function(_0x3f9e43){if(_0x3f9e43['type']!==_0x6195('0x41')){var _0x2a871f={};_0x2a871f[_0x3f9e43[_0x6195('0x2d')]]={'$like':'%'+_0x208c93[_0x6195('0x36')][_0x6195('0x40')]+'%'};return _0x2a871f;}})});}_0x3839fd=_['merge']({},_0x3839fd,_0x208c93[_0x6195('0x42')]);var _0xbcbc4b={'where':_0x3839fd[_0x6195('0x3e')]};return db[_0x6195('0x31')][_0x6195('0x21')](_0xbcbc4b)[_0x6195('0x28')](function(_0x353a65){_0x52d3ff[_0x6195('0x21')]=_0x353a65;if(_0x208c93[_0x6195('0x36')][_0x6195('0x43')]){_0x3839fd[_0x6195('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x6195('0x45')](_0x3839fd);})[_0x6195('0x28')](function(_0x45a188){_0x52d3ff[_0x6195('0x46')]=_0x45a188;return _0x52d3ff;})[_0x6195('0x28')](respondWithFilteredResult(_0x217ac1,_0x3839fd))['catch'](handleError(_0x217ac1,null));};exports[_0x6195('0x47')]=function(_0x1bc105,_0x45e392){var _0x11b900={'raw':![],'where':{'id':_0x1bc105[_0x6195('0x48')]['id']}},_0x35bd25={};_0x35bd25[_0x6195('0x35')]=_[_0x6195('0x49')](db['JscriptyProject'][_0x6195('0x32')]);_0x35bd25[_0x6195('0x36')]=_[_0x6195('0x49')](_0x1bc105[_0x6195('0x36')]);_0x35bd25[_0x6195('0x37')]=_[_0x6195('0x38')](_0x35bd25['model'],_0x35bd25[_0x6195('0x36')]);_0x11b900[_0x6195('0x39')]=_[_0x6195('0x38')](_0x35bd25[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x1bc105[_0x6195('0x36')][_0x6195('0x3a')]));_0x11b900['attributes']=_0x11b900[_0x6195('0x39')][_0x6195('0x4a')]?_0x11b900[_0x6195('0x39')]:_0x35bd25[_0x6195('0x35')];if(_0x1bc105['query']['includeAll']){_0x11b900[_0x6195('0x44')]=[{'all':!![]}];}_0x11b900=_['merge']({},_0x11b900,_0x1bc105[_0x6195('0x42')]);return db[_0x6195('0x31')][_0x6195('0x4b')](_0x11b900)[_0x6195('0x28')](handleEntityNotFound(_0x45e392,null))['then'](respondWithResult(_0x45e392,null))[_0x6195('0x4c')](handleError(_0x45e392,null));};exports[_0x6195('0x4d')]=function(_0x3feac1,_0x1ea3e7){return db['JscriptyProject'][_0x6195('0x4d')](_0x3feac1[_0x6195('0x4e')],{})['then'](function(_0x4aec1e){var _0x3da422=_0x3feac1['user'][_0x6195('0x4f')]({'plain':!![]});if(!_0x3da422)throw new Error(_0x6195('0x50'));if(_0x3da422['role']==='user'){var _0x589bad=_0x4aec1e[_0x6195('0x4f')]({'plain':!![]});var _0x2a686a=_0x6195('0x51');return db['UserProfileSection'][_0x6195('0x4b')]({'where':{'name':_0x2a686a,'userProfileId':_0x3da422[_0x6195('0x52')]},'raw':!![]})['then'](function(_0x8cf212){if(_0x8cf212&&_0x8cf212[_0x6195('0x53')]===0x0){return db[_0x6195('0x29')][_0x6195('0x4d')]({'name':_0x589bad[_0x6195('0x2d')],'resourceId':_0x589bad['id'],'type':_0x8cf212[_0x6195('0x2d')],'sectionId':_0x8cf212['id']},{})[_0x6195('0x28')](function(){return _0x4aec1e;});}else{return _0x4aec1e;}})[_0x6195('0x4c')](function(_0x5842c0){logger[_0x6195('0x2b')](_0x6195('0x54'),_0x5842c0);throw _0x5842c0;});}return _0x4aec1e;})['then'](respondWithResult(_0x1ea3e7,0xc9))[_0x6195('0x4c')](handleError(_0x1ea3e7,null));};exports[_0x6195('0x55')]=function(_0x5c23ab,_0x20defd){var _0x460983={'where':{'id':_0x5c23ab[_0x6195('0x48')]['id']}},_0x4f536b={};_0x4f536b[_0x6195('0x35')]=_['keys'](db[_0x6195('0x31')][_0x6195('0x32')]);_0x460983[_0x6195('0x39')]=_[_0x6195('0x38')](_0x4f536b[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x5c23ab[_0x6195('0x36')][_0x6195('0x3a')]));_0x460983[_0x6195('0x39')]=_0x460983[_0x6195('0x39')]['length']?_0x460983['attributes']:_0x4f536b[_0x6195('0x35')];if(_0x5c23ab[_0x6195('0x36')][_0x6195('0x43')]){_0x460983[_0x6195('0x44')]=[{'all':!![]}];}_0x460983=_[_0x6195('0x56')]({},_0x460983,_0x5c23ab[_0x6195('0x42')]);return db['JscriptyProject'][_0x6195('0x4b')](_0x460983)[_0x6195('0x28')](handleEntityNotFound(_0x20defd,null))[_0x6195('0x28')](function(_0x21b444){if(_0x21b444){var _0x532aaa=_0x21b444[_0x6195('0x4f')]({'plain':!![]});_0x532aaa=qs[_0x6195('0x57')](_0x532aaa,['id',_0x6195('0x58'),_0x6195('0x59')]);_0x5c23ab[_0x6195('0x4e')]=_['omit'](_0x5c23ab['body'],['id',_0x6195('0x58'),_0x6195('0x59')]);return db[_0x6195('0x31')][_0x6195('0x4d')](_[_0x6195('0x56')](_0x532aaa,_0x5c23ab[_0x6195('0x4e')]),{'include':_0x5c23ab[_0x6195('0x36')][_0x6195('0x43')]?[{'all':!![]}]:undefined})[_0x6195('0x28')](function(_0x1f7988){var _0x440696=_0x5c23ab['user'][_0x6195('0x4f')]({'plain':!![]});if(!_0x440696)throw new Error(_0x6195('0x50'));if(_0x440696[_0x6195('0x5a')]===_0x6195('0x5b')){var _0x1ef3e4=_0x1f7988[_0x6195('0x4f')]({'plain':!![]});var _0x17aece=_0x6195('0x51');return db[_0x6195('0x5c')][_0x6195('0x4b')]({'where':{'name':_0x17aece,'userProfileId':_0x440696[_0x6195('0x52')]},'raw':!![]})[_0x6195('0x28')](function(_0x187c98){if(_0x187c98&&_0x187c98[_0x6195('0x53')]===0x0){return db[_0x6195('0x29')]['create']({'name':_0x1ef3e4[_0x6195('0x2d')],'resourceId':_0x1ef3e4['id'],'type':_0x187c98[_0x6195('0x2d')],'sectionId':_0x187c98['id']},{})[_0x6195('0x28')](function(){return _0x1f7988;});}else{return _0x1f7988;}})[_0x6195('0x4c')](function(_0x10f978){logger[_0x6195('0x2b')](_0x6195('0x54'),_0x10f978);throw _0x10f978;});}return _0x1f7988;});}})['then'](respondWithResult(_0x20defd,0xc9))[_0x6195('0x4c')](handleError(_0x20defd,null));};exports[_0x6195('0x26')]=function(_0x3e6c67,_0x3494ee){if(_0x3e6c67[_0x6195('0x4e')]['id']){delete _0x3e6c67[_0x6195('0x4e')]['id'];}return db[_0x6195('0x31')][_0x6195('0x4b')]({'where':{'id':_0x3e6c67['params']['id']}})['then'](handleEntityNotFound(_0x3494ee,null))[_0x6195('0x28')](saveUpdates(_0x3e6c67[_0x6195('0x4e')],null))[_0x6195('0x28')](respondWithResult(_0x3494ee,null))[_0x6195('0x4c')](handleError(_0x3494ee,null));};exports[_0x6195('0x27')]=function(_0x36f5a4,_0x50d603){return db[_0x6195('0x31')][_0x6195('0x4b')]({'where':{'id':_0x36f5a4[_0x6195('0x48')]['id']}})['then'](handleEntityNotFound(_0x50d603,null))['then'](removeEntity(_0x50d603,null))[_0x6195('0x4c')](handleError(_0x50d603,null));};exports[_0x6195('0x5d')]=function(_0x691505,_0x3ecfba,_0x1bc14a){var _0x2d7dfa={'raw':!![],'where':{}};var _0x2e2f06={};var _0x393964={'count':0x0,'rows':[]};return db[_0x6195('0x31')][_0x6195('0x5e')]({'where':{'id':_0x691505['params']['id']}})[_0x6195('0x28')](handleEntityNotFound(_0x3ecfba,null))[_0x6195('0x28')](function(_0x31cb77){if(_0x31cb77){_0x2e2f06['model']=_[_0x6195('0x49')](db['JscriptySessionReport']['rawAttributes']);_0x2e2f06[_0x6195('0x36')]=_[_0x6195('0x49')](_0x691505[_0x6195('0x36')]);_0x2e2f06[_0x6195('0x37')]=_[_0x6195('0x38')](_0x2e2f06[_0x6195('0x35')],_0x2e2f06[_0x6195('0x36')]);_0x2d7dfa['attributes']=_[_0x6195('0x38')](_0x2e2f06[_0x6195('0x35')],qs['fields'](_0x691505[_0x6195('0x36')][_0x6195('0x3a')]));_0x2d7dfa[_0x6195('0x39')]=_0x2d7dfa[_0x6195('0x39')]['length']?_0x2d7dfa[_0x6195('0x39')]:_0x2e2f06[_0x6195('0x35')];if(!_0x691505[_0x6195('0x36')]['hasOwnProperty'](_0x6195('0x5f'))){_0x2d7dfa[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x691505[_0x6195('0x36')][_0x6195('0x3c')]);_0x2d7dfa[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x691505['query'][_0x6195('0x1f')]);}_0x2d7dfa[_0x6195('0x60')]=qs[_0x6195('0x3d')](_0x691505['query'][_0x6195('0x3d')]);_0x2d7dfa[_0x6195('0x3e')]=qs['filters'](_['pick'](_0x691505[_0x6195('0x36')],_0x2e2f06[_0x6195('0x37')]));_0x2d7dfa[_0x6195('0x3e')][_0x6195('0x61')]=_0x31cb77['id'];if(_0x691505[_0x6195('0x36')][_0x6195('0x40')]){_0x2d7dfa['where']=_['merge'](_0x2d7dfa[_0x6195('0x3e')],{'$or':_['map'](_0x2d7dfa[_0x6195('0x39')],function(_0x3533de){var _0x23e8ee={};_0x23e8ee[_0x3533de]={'$like':'%'+_0x691505[_0x6195('0x36')][_0x6195('0x40')]+'%'};return _0x23e8ee;})});}_0x2d7dfa=_[_0x6195('0x56')]({},_0x2d7dfa,_0x691505[_0x6195('0x42')]);return db[_0x6195('0x62')][_0x6195('0x21')]({'where':_0x2d7dfa[_0x6195('0x3e')]})[_0x6195('0x28')](function(_0x16576c){_0x393964[_0x6195('0x21')]=_0x16576c;if(_0x691505[_0x6195('0x36')][_0x6195('0x43')]){_0x2d7dfa['include']=[{'all':!![]}];}return db[_0x6195('0x62')][_0x6195('0x45')](_0x2d7dfa);})[_0x6195('0x28')](function(_0x195ba1){_0x393964[_0x6195('0x46')]=_0x195ba1;return _0x393964;});}})[_0x6195('0x28')](respondWithFilteredResult(_0x3ecfba,_0x2d7dfa))[_0x6195('0x4c')](handleError(_0x3ecfba,null));};exports[_0x6195('0x63')]=function(_0x58a03a,_0xe517be,_0xbc1944){var _0x5a809a={'raw':!![],'where':{}};var _0xeb2f6a={};var _0x46316a={'count':0x0,'rows':[]};return db[_0x6195('0x31')][_0x6195('0x5e')]({'where':{'id':_0x58a03a[_0x6195('0x48')]['id']}})[_0x6195('0x28')](handleEntityNotFound(_0xe517be,null))['then'](function(_0x40c727){if(_0x40c727){_0xeb2f6a[_0x6195('0x35')]=_[_0x6195('0x49')](db[_0x6195('0x64')][_0x6195('0x32')]);_0xeb2f6a[_0x6195('0x36')]=_[_0x6195('0x49')](_0x58a03a[_0x6195('0x36')]);_0xeb2f6a['filters']=_['intersection'](_0xeb2f6a[_0x6195('0x35')],_0xeb2f6a[_0x6195('0x36')]);_0x5a809a['attributes']=_[_0x6195('0x38')](_0xeb2f6a['model'],qs[_0x6195('0x3a')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3a')]));_0x5a809a[_0x6195('0x39')]=_0x5a809a[_0x6195('0x39')]['length']?_0x5a809a[_0x6195('0x39')]:_0xeb2f6a[_0x6195('0x35')];if(!_0x58a03a[_0x6195('0x36')][_0x6195('0x3b')]('nolimit')){_0x5a809a[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3c')]);_0x5a809a[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x58a03a[_0x6195('0x36')]['offset']);}_0x5a809a[_0x6195('0x60')]=qs[_0x6195('0x3d')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3d')]);_0x5a809a['where']=qs[_0x6195('0x37')](_[_0x6195('0x3f')](_0x58a03a[_0x6195('0x36')],_0xeb2f6a['filters']));_0x5a809a[_0x6195('0x3e')][_0x6195('0x61')]=_0x40c727['id'];if(_0x58a03a[_0x6195('0x36')][_0x6195('0x40')]){_0x5a809a[_0x6195('0x3e')]=_['merge'](_0x5a809a[_0x6195('0x3e')],{'$or':_[_0x6195('0x30')](_0x5a809a[_0x6195('0x39')],function(_0x1e978a){var _0x4074c3={};_0x4074c3[_0x1e978a]={'$like':'%'+_0x58a03a['query'][_0x6195('0x40')]+'%'};return _0x4074c3;})});}_0x5a809a=_[_0x6195('0x56')]({},_0x5a809a,_0x58a03a[_0x6195('0x42')]);return db[_0x6195('0x64')]['count']({'where':_0x5a809a[_0x6195('0x3e')]})[_0x6195('0x28')](function(_0x38b8bd){_0x46316a[_0x6195('0x21')]=_0x38b8bd;if(_0x58a03a[_0x6195('0x36')][_0x6195('0x43')]){_0x5a809a[_0x6195('0x44')]=[{'all':!![]}];}return db[_0x6195('0x64')]['findAll'](_0x5a809a);})[_0x6195('0x28')](function(_0x436dd3){_0x46316a[_0x6195('0x46')]=_0x436dd3;return _0x46316a;});}})[_0x6195('0x28')](respondWithFilteredResult(_0xe517be,_0x5a809a))['catch'](handleError(_0xe517be,null));};function char(_0x4edab3){return _0x6195('0x65')===typeof _0x4edab3?String[_0x6195('0x66')][_0x6195('0x67')](null,arguments):_0x4edab3;}function needsEncapsulation(_0x4c5cda){return!!_0x4c5cda&&(_0x4c5cda[_0x6195('0x68')]()['indexOf'](char(0xd))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0xa))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0x2c))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0x22))>=0x0);}function encapsulate(_0x4dd628){var _0x3f0c69=char(0x22),_0x582fe4='\x5c'+char(0x22),_0x91e220=_0x4dd628[_0x6195('0x68')]()[_0x6195('0x6a')](new RegExp(_0x3f0c69,'g'),_0x582fe4);return _0x3f0c69+_0x91e220+_0x3f0c69;}exports[_0x6195('0x6b')]=function(_0x20af35,_0x343275,_0x41a3d4){var _0x45363b,_0x19d6f5;var _0x600032={'where':{'ProjectId':_0x20af35[_0x6195('0x48')]['id']}};if(_0x20af35[_0x6195('0x36')][_0x6195('0x6c')]){_0x600032[_0x6195('0x3e')]['starttime']=JSON[_0x6195('0x6d')](_0x20af35[_0x6195('0x36')][_0x6195('0x6c')]);}return db[_0x6195('0x62')][_0x6195('0x45')](_0x600032)[_0x6195('0x28')](handleEntityNotFound(_0x343275,null))['then'](function(_0x282f48){if(_0x282f48){_0x45363b=_0x282f48;return db[_0x6195('0x6e')][_0x6195('0x45')]({'where':{'SessionId':{'$in':_[_0x6195('0x30')](_0x45363b,'id')},'ProjectId':_0x20af35['params']['id']},'order':_0x6195('0x6f')});}})[_0x6195('0x28')](handleEntityNotFound(_0x343275,null))[_0x6195('0x28')](function(_0x34b4e8){if(_0x34b4e8){_0x19d6f5=_0x34b4e8;var _0x4f27da={};for(var _0x38ba43=0x0,_0x12c3ee=_0x19d6f5['length'];_0x38ba43<_0x12c3ee;_0x38ba43++){if(!_0x4f27da[_0x6195('0x3b')](_0x19d6f5[_0x38ba43][_0x6195('0x70')])){_0x4f27da[_0x19d6f5[_0x38ba43][_0x6195('0x70')]]=needsEncapsulation(_0x19d6f5[_0x38ba43][_0x6195('0x71')])?encapsulate(_0x19d6f5[_0x38ba43][_0x6195('0x71')]):_0x19d6f5[_0x38ba43]['question'];}}var _0x825885=[],_0x56d2b7={};for(var _0x39f1c1=0x0,_0x5540f3=_0x45363b[_0x6195('0x4a')];_0x39f1c1<_0x5540f3;_0x39f1c1++){_0x56d2b7={'ProjectId':_0x20af35['params']['id'],'SessionId':_0x45363b[_0x39f1c1]['id'],'StartTime':moment(_0x45363b[_0x39f1c1][_0x6195('0x72')])[_0x6195('0x73')](_0x6195('0x74'))};for(var _0x3200f7=0x0,_0x401bdb=_0x19d6f5[_0x6195('0x4a')];_0x3200f7<_0x401bdb;_0x3200f7++){if(_0x19d6f5[_0x3200f7][_0x6195('0x75')]==_0x45363b[_0x39f1c1]['id']&&_0x4f27da[_0x6195('0x3b')](_0x19d6f5[_0x3200f7][_0x6195('0x70')])){_0x56d2b7[_0x4f27da[_0x19d6f5[_0x3200f7][_0x6195('0x70')]]]=_0x19d6f5[_0x3200f7][_0x6195('0x76')];}}for(var _0x50f16b in _0x4f27da){if(!_0x56d2b7[_0x6195('0x3b')](_0x4f27da[_0x50f16b])){_0x56d2b7[_0x4f27da[_0x50f16b]]=null;}}_0x825885[_0x6195('0x77')](_0x56d2b7);}return _0x825885;}})[_0x6195('0x28')](function(_0x457125){if(!_[_0x6195('0x78')](_0x457125)){var _0x332219=toCsv(_0x457125);var _0x2cbacd=Date['now']();fs[_0x6195('0x79')](util[_0x6195('0x73')](_0x6195('0x7a'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd),_0x332219);_0x343275[_0x6195('0x7b')](_0x6195('0x7c'),_0x6195('0x7d')+util['format'](_0x6195('0x7e'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd));_0x343275[_0x6195('0x7b')](_0x6195('0x7f'),_0x6195('0x80'));return _0x343275[_0x6195('0x81')](util[_0x6195('0x73')](_0x6195('0x7a'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd));}else{return _0x343275[_0x6195('0x1c')](0xcc);}})[_0x6195('0x4c')](handleError(_0x343275,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index dd21f54..2930647 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3645=['JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x5b66f8,_0xabd783){var _0x25e421=function(_0x1ddac0){while(--_0x1ddac0){_0x5b66f8['push'](_0x5b66f8['shift']());}};_0x25e421(++_0xabd783);}(_0x3645,0x154));var _0x5364=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0x3645[_0x1e7345];return _0x33017c;};'use strict';var _=require('lodash');var util=require(_0x5364('0x0'));var logger=require(_0x5364('0x1'))(_0x5364('0x2'));var moment=require(_0x5364('0x3'));var BPromise=require(_0x5364('0x4'));var rp=require(_0x5364('0x5'));var fs=require('fs');var path=require(_0x5364('0x6'));var rimraf=require('rimraf');var config=require(_0x5364('0x7'));var attributes=require(_0x5364('0x8'));module[_0x5364('0x9')]=function(_0x1f9c6b,_0x417c44){return _0x1f9c6b[_0x5364('0xa')](_0x5364('0xb'),attributes,{'tableName':_0x5364('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb717=['exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x82a412,_0x2edc31){var _0x222222=function(_0x2b2497){while(--_0x2b2497){_0x82a412['push'](_0x82a412['shift']());}};_0x222222(++_0x2edc31);}(_0xb717,0x1b4));var _0x7b71=function(_0x111099,_0x4b8433){_0x111099=_0x111099-0x0;var _0x9b0d02=_0xb717[_0x111099];return _0x9b0d02;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index eadd645..63adf6f 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x51c39f,_0x5bfb0b){_0x51c39f=_0x51c39f-0x0;var _0x274221=_0xbdb7[_0x51c39f];return _0x274221;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0xda3f,0xec));var _0xfda3=function(_0x580430,_0x4fb275){_0x580430=_0x580430-0x0;var _0x5254b8=_0xda3f[_0x580430];return _0x5254b8;};'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')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c07dbb4..a7bfbba 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1459=['isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe'];(function(_0x357d69,_0xf80d4d){var _0x3182e9=function(_0x180ba3){while(--_0x180ba3){_0x357d69['push'](_0x357d69['shift']());}};_0x3182e9(++_0xf80d4d);}(_0x1459,0x135));var _0x9145=function(_0x537e5a,_0xb3ef91){_0x537e5a=_0x537e5a-0x0;var _0x142374=_0x1459[_0x537e5a];return _0x142374;};'use strict';var multer=require(_0x9145('0x0'));var util=require('util');var path=require(_0x9145('0x1'));var timeout=require(_0x9145('0x2'));var express=require('express');var router=express[_0x9145('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9145('0x4'));var interaction=require(_0x9145('0x5'));var config=require(_0x9145('0x6'));var controller=require(_0x9145('0x7'));router[_0x9145('0x8')]('/',auth['isAuthenticated'](),controller[_0x9145('0x9')]);router[_0x9145('0x8')](_0x9145('0xa'),auth[_0x9145('0xb')](),controller[_0x9145('0xc')]);router['get'](_0x9145('0xd'),auth[_0x9145('0xb')](),controller[_0x9145('0xe')]);router[_0x9145('0xf')]('/',auth[_0x9145('0xb')](),controller[_0x9145('0x10')]);router[_0x9145('0x11')](_0x9145('0xd'),auth[_0x9145('0xb')](),controller['update']);router['delete']('/:id',auth[_0x9145('0xb')](),controller[_0x9145('0x12')]);module[_0x9145('0x13')]=router; \ No newline at end of file +var _0xe3fe=['isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe'];(function(_0x51b28f,_0x20f46c){var _0x2c3885=function(_0x4a6585){while(--_0x4a6585){_0x51b28f['push'](_0x51b28f['shift']());}};_0x2c3885(++_0x20f46c);}(_0xe3fe,0x1ad));var _0xee3f=function(_0x3c04ab,_0xe6ddaa){_0x3c04ab=_0x3c04ab-0x0;var _0x5f2eb1=_0xe3fe[_0x3c04ab];return _0x5f2eb1;};'use strict';var multer=require(_0xee3f('0x0'));var util=require(_0xee3f('0x1'));var path=require(_0xee3f('0x2'));var timeout=require(_0xee3f('0x3'));var express=require(_0xee3f('0x4'));var router=express[_0xee3f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xee3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xee3f('0x7'));var controller=require(_0xee3f('0x8'));router[_0xee3f('0x9')]('/',auth['isAuthenticated'](),controller[_0xee3f('0xa')]);router[_0xee3f('0x9')](_0xee3f('0xb'),auth[_0xee3f('0xc')](),controller[_0xee3f('0xd')]);router['get']('/:id',auth[_0xee3f('0xc')](),controller[_0xee3f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee3f('0xf')]);router[_0xee3f('0x10')](_0xee3f('0x11'),auth[_0xee3f('0xc')](),controller[_0xee3f('0x12')]);router[_0xee3f('0x13')](_0xee3f('0x11'),auth[_0xee3f('0xc')](),controller[_0xee3f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 567697a..9706d59 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0xce5bc9,_0x588886){_0xce5bc9=_0xce5bc9-0x0;var _0x3196b9=_0x7a54[_0xce5bc9];return _0x3196b9;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x4c4d61,_0x2d9311){_0x4c4d61=_0x4c4d61-0x0;var _0x1e6522=_0x7a54[_0x4c4d61];return _0x1e6522;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 03df0c6..dc570b3 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86df=['nolimit','order','sort','pick','filter','merge','where','type','includeAll','include','findAll','rows','catch','params','keys','intersection','options','find','create','body','update','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','query','filters','model','fields','attributes','length','hasOwnProperty'];(function(_0x22ed4b,_0x20609c){var _0x4e9cf6=function(_0x3a2de1){while(--_0x3a2de1){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4e9cf6(++_0x20609c);}(_0x86df,0x14a));var _0xf86d=function(_0x39eaf1,_0x56f6b9){_0x39eaf1=_0x39eaf1-0x0;var _0x116705=_0x86df[_0x39eaf1];return _0x116705;};'use strict';var emlformat=require(_0xf86d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf86d('0x1'));var rp=require(_0xf86d('0x2'));var moment=require(_0xf86d('0x3'));var BPromise=require(_0xf86d('0x4'));var Mustache=require(_0xf86d('0x5'));var util=require(_0xf86d('0x6'));var path=require(_0xf86d('0x7'));var sox=require(_0xf86d('0x8'));var csv=require(_0xf86d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf86d('0xa'));var _=require(_0xf86d('0xb'));var squel=require(_0xf86d('0xc'));var crypto=require(_0xf86d('0xd'));var jsforce=require(_0xf86d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf86d('0x9'));var querystring=require(_0xf86d('0xf'));var Papa=require('papaparse');var Redis=require(_0xf86d('0x10'));var authService=require(_0xf86d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf86d('0x12'));var logger=require(_0xf86d('0x13'))('api');var utils=require(_0xf86d('0x14'));var config=require(_0xf86d('0x15'));var licenseUtil=require(_0xf86d('0x16'));var db=require(_0xf86d('0x17'))['db'];function respondWithStatusCode(_0x57a0d2,_0x5f121d){_0x5f121d=_0x5f121d||0xcc;return function(_0x67000a){if(_0x67000a){return _0x57a0d2[_0xf86d('0x18')](_0x5f121d);}return _0x57a0d2['status'](_0x5f121d)[_0xf86d('0x19')]();};}function respondWithResult(_0x5317bc,_0x60a3f8){_0x60a3f8=_0x60a3f8||0xc8;return function(_0x3e1121){if(_0x3e1121){return _0x5317bc[_0xf86d('0x1a')](_0x60a3f8)[_0xf86d('0x1b')](_0x3e1121);}};}function respondWithFilteredResult(_0x26eb63,_0x4aed10){return function(_0x3aedcc){if(_0x3aedcc){var _0x407e06=typeof _0x4aed10[_0xf86d('0x1c')]==='undefined'&&typeof _0x4aed10[_0xf86d('0x1d')]==='undefined';var _0x358729=_0x3aedcc[_0xf86d('0x1e')];var _0x4f09e3=_0x407e06?0x0:_0x4aed10[_0xf86d('0x1c')];var _0x4c12a9=_0x407e06?_0x3aedcc['count']:_0x4aed10[_0xf86d('0x1c')]+_0x4aed10[_0xf86d('0x1d')];var _0x77b40;if(_0x4c12a9>=_0x358729){_0x4c12a9=_0x358729;_0x77b40=0xc8;}else{_0x77b40=0xce;}_0x26eb63['status'](_0x77b40);return _0x26eb63[_0xf86d('0x1f')](_0xf86d('0x20'),_0x4f09e3+'-'+_0x4c12a9+'/'+_0x358729)[_0xf86d('0x1b')](_0x3aedcc);}return null;};}function patchUpdates(_0x3cf37c){return function(_0x249dee){try{jsonpatch[_0xf86d('0x21')](_0x249dee,_0x3cf37c,!![]);}catch(_0x4613e5){return BPromise[_0xf86d('0x22')](_0x4613e5);}return _0x249dee[_0xf86d('0x23')]();};}function saveUpdates(_0x3e36e6,_0x321284){return function(_0xd16cd8){if(_0xd16cd8){return _0xd16cd8['update'](_0x3e36e6)[_0xf86d('0x24')](function(_0x4a37af){return _0x4a37af;});}return null;};}function removeEntity(_0x17561b,_0x1a7652){return function(_0x27d057){if(_0x27d057){return _0x27d057[_0xf86d('0x25')]()[_0xf86d('0x24')](function(){_0x17561b[_0xf86d('0x1a')](0xcc)[_0xf86d('0x19')]();});}};}function handleEntityNotFound(_0x28df8c,_0x3b2451){return function(_0xdd7f20){if(!_0xdd7f20){_0x28df8c['sendStatus'](0x194);}return _0xdd7f20;};}function handleError(_0x216397,_0xad8f58){_0xad8f58=_0xad8f58||0x1f4;return function(_0x5df3fc){logger[_0xf86d('0x26')](_0x5df3fc[_0xf86d('0x27')]);if(_0x5df3fc['name']){delete _0x5df3fc[_0xf86d('0x28')];}_0x216397[_0xf86d('0x1a')](_0xad8f58)[_0xf86d('0x29')](_0x5df3fc);};}exports[_0xf86d('0x2a')]=function(_0x584eb1,_0xb098ed){var _0x4bfdf2={},_0x22a281={},_0x167205={'count':0x0,'rows':[]};var _0xcb3e11=_[_0xf86d('0x2b')](db[_0xf86d('0x2c')][_0xf86d('0x2d')],function(_0x357d6c){return{'name':_0x357d6c[_0xf86d('0x2e')],'type':_0x357d6c['type'][_0xf86d('0x2f')]};});_0x22a281['model']=_['map'](_0xcb3e11,_0xf86d('0x28'));_0x22a281[_0xf86d('0x30')]=_['keys'](_0x584eb1[_0xf86d('0x30')]);_0x22a281[_0xf86d('0x31')]=_['intersection'](_0x22a281[_0xf86d('0x32')],_0x22a281['query']);_0x4bfdf2['attributes']=_['intersection'](_0x22a281['model'],qs[_0xf86d('0x33')](_0x584eb1[_0xf86d('0x30')][_0xf86d('0x33')]));_0x4bfdf2[_0xf86d('0x34')]=_0x4bfdf2['attributes'][_0xf86d('0x35')]?_0x4bfdf2[_0xf86d('0x34')]:_0x22a281[_0xf86d('0x32')];if(!_0x584eb1[_0xf86d('0x30')][_0xf86d('0x36')](_0xf86d('0x37'))){_0x4bfdf2[_0xf86d('0x1d')]=qs[_0xf86d('0x1d')](_0x584eb1[_0xf86d('0x30')][_0xf86d('0x1d')]);_0x4bfdf2['offset']=qs[_0xf86d('0x1c')](_0x584eb1[_0xf86d('0x30')][_0xf86d('0x1c')]);}_0x4bfdf2[_0xf86d('0x38')]=qs[_0xf86d('0x39')](_0x584eb1[_0xf86d('0x30')][_0xf86d('0x39')]);_0x4bfdf2['where']=qs['filters'](_[_0xf86d('0x3a')](_0x584eb1[_0xf86d('0x30')],_0x22a281[_0xf86d('0x31')]),_0xcb3e11);if(_0x584eb1[_0xf86d('0x30')][_0xf86d('0x3b')]){_0x4bfdf2['where']=_[_0xf86d('0x3c')](_0x4bfdf2[_0xf86d('0x3d')],{'$or':_[_0xf86d('0x2b')](_0xcb3e11,function(_0x3d6aad){if(_0x3d6aad[_0xf86d('0x3e')]!=='VIRTUAL'){var _0x47d8e6={};_0x47d8e6[_0x3d6aad[_0xf86d('0x28')]]={'$like':'%'+_0x584eb1[_0xf86d('0x30')][_0xf86d('0x3b')]+'%'};return _0x47d8e6;}})});}_0x4bfdf2=_[_0xf86d('0x3c')]({},_0x4bfdf2,_0x584eb1['options']);var _0x29e4b8={'where':_0x4bfdf2[_0xf86d('0x3d')]};return db['JscriptyQuestionReport']['count'](_0x29e4b8)[_0xf86d('0x24')](function(_0x23cd38){_0x167205['count']=_0x23cd38;if(_0x584eb1['query'][_0xf86d('0x3f')]){_0x4bfdf2[_0xf86d('0x40')]=[{'all':!![]}];}return db[_0xf86d('0x2c')][_0xf86d('0x41')](_0x4bfdf2);})[_0xf86d('0x24')](function(_0x5508b8){_0x167205[_0xf86d('0x42')]=_0x5508b8;return _0x167205;})[_0xf86d('0x24')](respondWithFilteredResult(_0xb098ed,_0x4bfdf2))[_0xf86d('0x43')](handleError(_0xb098ed,null));};exports['show']=function(_0x20d8d4,_0x1fec37){var _0x3b5ea0={'raw':!![],'where':{'id':_0x20d8d4[_0xf86d('0x44')]['id']}},_0x3413e7={};_0x3413e7[_0xf86d('0x32')]=_[_0xf86d('0x45')](db[_0xf86d('0x2c')]['rawAttributes']);_0x3413e7[_0xf86d('0x30')]=_[_0xf86d('0x45')](_0x20d8d4[_0xf86d('0x30')]);_0x3413e7['filters']=_[_0xf86d('0x46')](_0x3413e7[_0xf86d('0x32')],_0x3413e7[_0xf86d('0x30')]);_0x3b5ea0['attributes']=_['intersection'](_0x3413e7[_0xf86d('0x32')],qs['fields'](_0x20d8d4[_0xf86d('0x30')][_0xf86d('0x33')]));_0x3b5ea0[_0xf86d('0x34')]=_0x3b5ea0['attributes']['length']?_0x3b5ea0['attributes']:_0x3413e7[_0xf86d('0x32')];if(_0x20d8d4[_0xf86d('0x30')][_0xf86d('0x3f')]){_0x3b5ea0[_0xf86d('0x40')]=[{'all':!![]}];}_0x3b5ea0=_[_0xf86d('0x3c')]({},_0x3b5ea0,_0x20d8d4[_0xf86d('0x47')]);return db[_0xf86d('0x2c')][_0xf86d('0x48')](_0x3b5ea0)[_0xf86d('0x24')](handleEntityNotFound(_0x1fec37,null))[_0xf86d('0x24')](respondWithResult(_0x1fec37,null))['catch'](handleError(_0x1fec37,null));};exports['create']=function(_0x541d6a,_0x5d5f98){return db[_0xf86d('0x2c')][_0xf86d('0x49')](_0x541d6a[_0xf86d('0x4a')],{})[_0xf86d('0x24')](respondWithResult(_0x5d5f98,0xc9))[_0xf86d('0x43')](handleError(_0x5d5f98,null));};exports[_0xf86d('0x4b')]=function(_0x11064c,_0x2e2844){if(_0x11064c[_0xf86d('0x4a')]['id']){delete _0x11064c[_0xf86d('0x4a')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x11064c[_0xf86d('0x44')]['id']}})[_0xf86d('0x24')](handleEntityNotFound(_0x2e2844,null))[_0xf86d('0x24')](saveUpdates(_0x11064c[_0xf86d('0x4a')],null))['then'](respondWithResult(_0x2e2844,null))['catch'](handleError(_0x2e2844,null));};exports['destroy']=function(_0x199e65,_0x2269f6){return db[_0xf86d('0x2c')][_0xf86d('0x48')]({'where':{'id':_0x199e65[_0xf86d('0x44')]['id']}})[_0xf86d('0x24')](handleEntityNotFound(_0x2269f6,null))['then'](removeEntity(_0x2269f6,null))[_0xf86d('0x43')](handleError(_0x2269f6,null));};exports[_0xf86d('0x4c')]=function(_0x4c50c2,_0x247b71){return db[_0xf86d('0x2c')][_0xf86d('0x4c')]()[_0xf86d('0x24')](respondWithResult(_0x247b71,null))[_0xf86d('0x43')](handleError(_0x247b71,null));}; \ No newline at end of file +var _0xaac0=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','update','body'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0xaac0,0x1b8));var _0x0aac=function(_0x1123bb,_0x54472a){_0x1123bb=_0x1123bb-0x0;var _0xdeb602=_0xaac0[_0x1123bb];return _0xdeb602;};'use strict';var emlformat=require(_0x0aac('0x0'));var rimraf=require(_0x0aac('0x1'));var zipdir=require(_0x0aac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0aac('0x3'));var moment=require(_0x0aac('0x4'));var BPromise=require(_0x0aac('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0aac('0x6'));var csv=require(_0x0aac('0x7'));var ejs=require(_0x0aac('0x8'));var fs=require('fs');var fs_extra=require(_0x0aac('0x9'));var _=require(_0x0aac('0xa'));var squel=require(_0x0aac('0xb'));var crypto=require('crypto');var jsforce=require(_0x0aac('0xc'));var deskjs=require(_0x0aac('0xd'));var toCsv=require(_0x0aac('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0aac('0xe'));var authService=require(_0x0aac('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0aac('0x10'));var logger=require(_0x0aac('0x11'))('api');var utils=require(_0x0aac('0x12'));var config=require(_0x0aac('0x13'));var licenseUtil=require(_0x0aac('0x14'));var db=require(_0x0aac('0x15'))['db'];function respondWithStatusCode(_0x14316c,_0x2c702e){_0x2c702e=_0x2c702e||0xcc;return function(_0x4db6c4){if(_0x4db6c4){return _0x14316c[_0x0aac('0x16')](_0x2c702e);}return _0x14316c[_0x0aac('0x17')](_0x2c702e)[_0x0aac('0x18')]();};}function respondWithResult(_0x4c0f9f,_0x2c98e1){_0x2c98e1=_0x2c98e1||0xc8;return function(_0x1eb20b){if(_0x1eb20b){return _0x4c0f9f[_0x0aac('0x17')](_0x2c98e1)[_0x0aac('0x19')](_0x1eb20b);}};}function respondWithFilteredResult(_0x439b00,_0x173d1e){return function(_0x47c71f){if(_0x47c71f){var _0x36e03e=typeof _0x173d1e[_0x0aac('0x1a')]===_0x0aac('0x1b')&&typeof _0x173d1e[_0x0aac('0x1c')]===_0x0aac('0x1b');var _0x5b85b0=_0x47c71f[_0x0aac('0x1d')];var _0x4d0d9c=_0x36e03e?0x0:_0x173d1e[_0x0aac('0x1a')];var _0x57307f=_0x36e03e?_0x47c71f['count']:_0x173d1e[_0x0aac('0x1a')]+_0x173d1e[_0x0aac('0x1c')];var _0x6f743;if(_0x57307f>=_0x5b85b0){_0x57307f=_0x5b85b0;_0x6f743=0xc8;}else{_0x6f743=0xce;}_0x439b00[_0x0aac('0x17')](_0x6f743);return _0x439b00[_0x0aac('0x1e')]('Content-Range',_0x4d0d9c+'-'+_0x57307f+'/'+_0x5b85b0)[_0x0aac('0x19')](_0x47c71f);}return null;};}function patchUpdates(_0x275b31){return function(_0x48ab7c){try{jsonpatch[_0x0aac('0x1f')](_0x48ab7c,_0x275b31,!![]);}catch(_0x52da3c){return BPromise[_0x0aac('0x20')](_0x52da3c);}return _0x48ab7c['save']();};}function saveUpdates(_0x34c1c9,_0x2b7eeb){return function(_0xf48ae4){if(_0xf48ae4){return _0xf48ae4['update'](_0x34c1c9)[_0x0aac('0x21')](function(_0x248b8f){return _0x248b8f;});}return null;};}function removeEntity(_0x53123f,_0x329fed){return function(_0x238466){if(_0x238466){return _0x238466['destroy']()[_0x0aac('0x21')](function(){_0x53123f[_0x0aac('0x17')](0xcc)[_0x0aac('0x18')]();});}};}function handleEntityNotFound(_0x379e19,_0x3dc18d){return function(_0x487639){if(!_0x487639){_0x379e19[_0x0aac('0x16')](0x194);}return _0x487639;};}function handleError(_0x2b749f,_0x15b6c1){_0x15b6c1=_0x15b6c1||0x1f4;return function(_0x56b95c){logger[_0x0aac('0x22')](_0x56b95c[_0x0aac('0x23')]);if(_0x56b95c[_0x0aac('0x24')]){delete _0x56b95c['name'];}_0x2b749f[_0x0aac('0x17')](_0x15b6c1)[_0x0aac('0x25')](_0x56b95c);};}exports[_0x0aac('0x26')]=function(_0x16b292,_0x46892a){var _0x573919={},_0x11626a={},_0x48dc28={'count':0x0,'rows':[]};var _0x20358c=_[_0x0aac('0x27')](db[_0x0aac('0x28')]['rawAttributes'],function(_0x5793a9){return{'name':_0x5793a9[_0x0aac('0x29')],'type':_0x5793a9[_0x0aac('0x2a')][_0x0aac('0x2b')]};});_0x11626a[_0x0aac('0x2c')]=_[_0x0aac('0x27')](_0x20358c,_0x0aac('0x24'));_0x11626a[_0x0aac('0x2d')]=_[_0x0aac('0x2e')](_0x16b292['query']);_0x11626a[_0x0aac('0x2f')]=_[_0x0aac('0x30')](_0x11626a[_0x0aac('0x2c')],_0x11626a['query']);_0x573919[_0x0aac('0x31')]=_['intersection'](_0x11626a['model'],qs[_0x0aac('0x32')](_0x16b292[_0x0aac('0x2d')][_0x0aac('0x32')]));_0x573919[_0x0aac('0x31')]=_0x573919['attributes'][_0x0aac('0x33')]?_0x573919[_0x0aac('0x31')]:_0x11626a[_0x0aac('0x2c')];if(!_0x16b292['query'][_0x0aac('0x34')](_0x0aac('0x35'))){_0x573919[_0x0aac('0x1c')]=qs[_0x0aac('0x1c')](_0x16b292[_0x0aac('0x2d')][_0x0aac('0x1c')]);_0x573919['offset']=qs[_0x0aac('0x1a')](_0x16b292['query'][_0x0aac('0x1a')]);}_0x573919[_0x0aac('0x36')]=qs['sort'](_0x16b292[_0x0aac('0x2d')]['sort']);_0x573919['where']=qs['filters'](_[_0x0aac('0x37')](_0x16b292[_0x0aac('0x2d')],_0x11626a[_0x0aac('0x2f')]),_0x20358c);if(_0x16b292['query'][_0x0aac('0x38')]){_0x573919[_0x0aac('0x39')]=_[_0x0aac('0x3a')](_0x573919[_0x0aac('0x39')],{'$or':_['map'](_0x20358c,function(_0x4f71f4){if(_0x4f71f4[_0x0aac('0x2a')]!==_0x0aac('0x3b')){var _0x266c60={};_0x266c60[_0x4f71f4['name']]={'$like':'%'+_0x16b292[_0x0aac('0x2d')][_0x0aac('0x38')]+'%'};return _0x266c60;}})});}_0x573919=_[_0x0aac('0x3a')]({},_0x573919,_0x16b292['options']);var _0x98a2e7={'where':_0x573919[_0x0aac('0x39')]};return db[_0x0aac('0x28')]['count'](_0x98a2e7)[_0x0aac('0x21')](function(_0x58a30a){_0x48dc28[_0x0aac('0x1d')]=_0x58a30a;if(_0x16b292[_0x0aac('0x2d')][_0x0aac('0x3c')]){_0x573919[_0x0aac('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x573919);})['then'](function(_0x2283a8){_0x48dc28[_0x0aac('0x3e')]=_0x2283a8;return _0x48dc28;})['then'](respondWithFilteredResult(_0x46892a,_0x573919))[_0x0aac('0x3f')](handleError(_0x46892a,null));};exports[_0x0aac('0x40')]=function(_0xd5faec,_0x283ab2){var _0x1db1e0={'raw':!![],'where':{'id':_0xd5faec[_0x0aac('0x41')]['id']}},_0x25d8a9={};_0x25d8a9[_0x0aac('0x2c')]=_[_0x0aac('0x2e')](db[_0x0aac('0x28')]['rawAttributes']);_0x25d8a9['query']=_[_0x0aac('0x2e')](_0xd5faec[_0x0aac('0x2d')]);_0x25d8a9[_0x0aac('0x2f')]=_[_0x0aac('0x30')](_0x25d8a9['model'],_0x25d8a9[_0x0aac('0x2d')]);_0x1db1e0['attributes']=_[_0x0aac('0x30')](_0x25d8a9[_0x0aac('0x2c')],qs[_0x0aac('0x32')](_0xd5faec[_0x0aac('0x2d')][_0x0aac('0x32')]));_0x1db1e0[_0x0aac('0x31')]=_0x1db1e0[_0x0aac('0x31')][_0x0aac('0x33')]?_0x1db1e0[_0x0aac('0x31')]:_0x25d8a9[_0x0aac('0x2c')];if(_0xd5faec[_0x0aac('0x2d')]['includeAll']){_0x1db1e0[_0x0aac('0x3d')]=[{'all':!![]}];}_0x1db1e0=_[_0x0aac('0x3a')]({},_0x1db1e0,_0xd5faec[_0x0aac('0x42')]);return db[_0x0aac('0x28')][_0x0aac('0x43')](_0x1db1e0)['then'](handleEntityNotFound(_0x283ab2,null))[_0x0aac('0x21')](respondWithResult(_0x283ab2,null))[_0x0aac('0x3f')](handleError(_0x283ab2,null));};exports['create']=function(_0x25e6fe,_0x1ce469){return db[_0x0aac('0x28')][_0x0aac('0x44')](_0x25e6fe['body'],{})[_0x0aac('0x21')](respondWithResult(_0x1ce469,0xc9))[_0x0aac('0x3f')](handleError(_0x1ce469,null));};exports[_0x0aac('0x45')]=function(_0x1aacb5,_0x3df2e5){if(_0x1aacb5['body']['id']){delete _0x1aacb5[_0x0aac('0x46')]['id'];}return db[_0x0aac('0x28')][_0x0aac('0x43')]({'where':{'id':_0x1aacb5[_0x0aac('0x41')]['id']}})[_0x0aac('0x21')](handleEntityNotFound(_0x3df2e5,null))[_0x0aac('0x21')](saveUpdates(_0x1aacb5[_0x0aac('0x46')],null))[_0x0aac('0x21')](respondWithResult(_0x3df2e5,null))['catch'](handleError(_0x3df2e5,null));};exports[_0x0aac('0x47')]=function(_0x2ff213,_0x311e7a){return db[_0x0aac('0x28')]['find']({'where':{'id':_0x2ff213[_0x0aac('0x41')]['id']}})[_0x0aac('0x21')](handleEntityNotFound(_0x311e7a,null))['then'](removeEntity(_0x311e7a,null))[_0x0aac('0x3f')](handleError(_0x311e7a,null));};exports[_0x0aac('0x48')]=function(_0x5721e6,_0x465cfb){return db[_0x0aac('0x28')][_0x0aac('0x48')]()['then'](respondWithResult(_0x465cfb,null))[_0x0aac('0x3f')](handleError(_0x465cfb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 02f1076..5a671b4 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72fa=['request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x72fa,0x19f));var _0xa72f=function(_0x2e5f03,_0x45b348){_0x2e5f03=_0x2e5f03-0x0;var _0x39c200=_0x72fa[_0x2e5f03];return _0x39c200;};'use strict';var _=require(_0xa72f('0x0'));var util=require('util');var logger=require(_0xa72f('0x1'))(_0xa72f('0x2'));var moment=require(_0xa72f('0x3'));var BPromise=require(_0xa72f('0x4'));var rp=require(_0xa72f('0x5'));var fs=require('fs');var path=require(_0xa72f('0x6'));var rimraf=require(_0xa72f('0x7'));var config=require('../../config/environment');var attributes=require(_0xa72f('0x8'));module[_0xa72f('0x9')]=function(_0xde8621,_0x466e41){return _0xde8621[_0xa72f('0xa')](_0xa72f('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d22=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x231ede,_0x4856bb){var _0x3fdd8a=function(_0x4e622c){while(--_0x4e622c){_0x231ede['push'](_0x231ede['shift']());}};_0x3fdd8a(++_0x4856bb);}(_0x4d22,0xb8));var _0x24d2=function(_0x2409cb,_0x26b709){_0x2409cb=_0x2409cb-0x0;var _0xe25c7=_0x4d22[_0x2409cb];return _0xe25c7;};'use strict';var _=require(_0x24d2('0x0'));var util=require(_0x24d2('0x1'));var logger=require(_0x24d2('0x2'))(_0x24d2('0x3'));var moment=require(_0x24d2('0x4'));var BPromise=require(_0x24d2('0x5'));var rp=require(_0x24d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d2('0x7'));var config=require(_0x24d2('0x8'));var attributes=require(_0x24d2('0x9'));module[_0x24d2('0xa')]=function(_0x84f6d7,_0x5158c6){return _0x84f6d7['define'](_0x24d2('0xb'),attributes,{'tableName':_0x24d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 19c6e16..ce772f0 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7e7=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment'];(function(_0x27802c,_0x526f93){var _0x526579=function(_0x57aa88){while(--_0x57aa88){_0x27802c['push'](_0x27802c['shift']());}};_0x526579(++_0x526f93);}(_0xd7e7,0x18e));var _0x7d7e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd7e7[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x7d7e('0x0'));var util=require('util');var moment=require(_0x7d7e('0x1'));var BPromise=require(_0x7d7e('0x2'));var rs=require(_0x7d7e('0x3'));var fs=require('fs');var Redis=require(_0x7d7e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d7e('0x5'));var logger=require(_0x7d7e('0x6'))(_0x7d7e('0x7'));var config=require(_0x7d7e('0x8'));var jayson=require(_0x7d7e('0x9'));var client=jayson['client'][_0x7d7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130f32,_0xdba3b5,_0x5d209c){return new BPromise(function(_0x4f501d,_0x4b6ee8){return client[_0x7d7e('0xb')](_0x130f32,_0x5d209c)[_0x7d7e('0xc')](function(_0xfb393b){logger[_0x7d7e('0xd')](_0x7d7e('0xe'),_0xdba3b5,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0xdba3b5,_0x7d7e('0xf'),JSON['stringify'](_0xfb393b));if(_0xfb393b[_0x7d7e('0x10')]){if(_0xfb393b[_0x7d7e('0x10')][_0x7d7e('0x11')]===0x1f4){logger[_0x7d7e('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xdba3b5,_0xfb393b[_0x7d7e('0x10')][_0x7d7e('0x12')]);return _0x4b6ee8(_0xfb393b[_0x7d7e('0x10')][_0x7d7e('0x12')]);}logger[_0x7d7e('0x10')](_0x7d7e('0xe'),_0xdba3b5,_0xfb393b[_0x7d7e('0x10')][_0x7d7e('0x12')]);return _0x4f501d(_0xfb393b[_0x7d7e('0x10')][_0x7d7e('0x12')]);}else{logger[_0x7d7e('0xd')](_0x7d7e('0xe'),_0xdba3b5,'request\x20sent');_0x4f501d(_0xfb393b['result']['message']);}})[_0x7d7e('0x13')](function(_0x498181){logger[_0x7d7e('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xdba3b5,_0x498181);_0x4b6ee8(_0x498181);});});} \ No newline at end of file +var _0x4c93=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c93,0xcf));var _0x34c9=function(_0x4b45b2,_0x56ac7f){_0x4b45b2=_0x4b45b2-0x0;var _0x53a1f2=_0x4c93[_0x4b45b2];return _0x53a1f2;};'use strict';var _=require(_0x34c9('0x0'));var util=require(_0x34c9('0x1'));var moment=require(_0x34c9('0x2'));var BPromise=require(_0x34c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34c9('0x4'));var db=require(_0x34c9('0x5'))['db'];var utils=require(_0x34c9('0x6'));var logger=require('../../config/logger')(_0x34c9('0x7'));var config=require(_0x34c9('0x8'));var jayson=require(_0x34c9('0x9'));var client=jayson[_0x34c9('0xa')][_0x34c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34cbfb,_0x26948a,_0x3e4420){return new BPromise(function(_0x5ae715,_0x46dfb6){return client[_0x34c9('0xc')](_0x34cbfb,_0x3e4420)[_0x34c9('0xd')](function(_0x13c54c){logger['info'](_0x34c9('0xe'),_0x26948a,_0x34c9('0xf'));logger[_0x34c9('0x10')](_0x34c9('0x11'),_0x26948a,_0x34c9('0xf'),JSON[_0x34c9('0x12')](_0x13c54c));if(_0x13c54c[_0x34c9('0x13')]){if(_0x13c54c[_0x34c9('0x13')][_0x34c9('0x14')]===0x1f4){logger[_0x34c9('0x13')](_0x34c9('0xe'),_0x26948a,_0x13c54c['error'][_0x34c9('0x15')]);return _0x46dfb6(_0x13c54c['error'][_0x34c9('0x15')]);}logger[_0x34c9('0x13')](_0x34c9('0xe'),_0x26948a,_0x13c54c['error'][_0x34c9('0x15')]);return _0x5ae715(_0x13c54c[_0x34c9('0x13')][_0x34c9('0x15')]);}else{logger['info'](_0x34c9('0xe'),_0x26948a,'request\x20sent');_0x5ae715(_0x13c54c['result'][_0x34c9('0x15')]);}})[_0x34c9('0x16')](function(_0x39708a){logger[_0x34c9('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x26948a,_0x39708a);_0x46dfb6(_0x39708a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9888dd9..8fb33e8 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd121=['getQuestions','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id/questions'];(function(_0x52c3f7,_0x340dbe){var _0x26c539=function(_0x1a4004){while(--_0x1a4004){_0x52c3f7['push'](_0x52c3f7['shift']());}};_0x26c539(++_0x340dbe);}(_0xd121,0x190));var _0x1d12=function(_0x13db41,_0x21e2f2){_0x13db41=_0x13db41-0x0;var _0x590f8e=_0xd121[_0x13db41];return _0x590f8e;};'use strict';var multer=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var path=require(_0x1d12('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d12('0x3'));var router=express[_0x1d12('0x4')]();var fs_extra=require(_0x1d12('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1d12('0x6'));var config=require(_0x1d12('0x7'));var controller=require(_0x1d12('0x8'));router[_0x1d12('0x9')]('/',auth[_0x1d12('0xa')](),controller[_0x1d12('0xb')]);router[_0x1d12('0x9')]('/describe',auth[_0x1d12('0xa')](),controller[_0x1d12('0xc')]);router['get']('/:id',auth[_0x1d12('0xa')](),controller['show']);router['get'](_0x1d12('0xd'),auth[_0x1d12('0xa')](),controller[_0x1d12('0xe')]);router[_0x1d12('0xf')]('/',auth[_0x1d12('0xa')](),controller[_0x1d12('0x10')]);router[_0x1d12('0x11')]('/:id',auth[_0x1d12('0xa')](),controller[_0x1d12('0x12')]);router[_0x1d12('0x13')](_0x1d12('0x14'),auth[_0x1d12('0xa')](),controller[_0x1d12('0x15')]);module[_0x1d12('0x16')]=router; \ No newline at end of file +var _0xb7f8=['/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xe972a7,_0x484223){var _0x3f8517=function(_0x4ed046){while(--_0x4ed046){_0xe972a7['push'](_0xe972a7['shift']());}};_0x3f8517(++_0x484223);}(_0xb7f8,0xf1));var _0x8b7f=function(_0x2e119f,_0x13dd59){_0x2e119f=_0x2e119f-0x0;var _0x4d5ee2=_0xb7f8[_0x2e119f];return _0x4d5ee2;};'use strict';var multer=require(_0x8b7f('0x0'));var util=require(_0x8b7f('0x1'));var path=require(_0x8b7f('0x2'));var timeout=require(_0x8b7f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b7f('0x4'));var interaction=require(_0x8b7f('0x5'));var config=require('../../config/environment');var controller=require(_0x8b7f('0x6'));router[_0x8b7f('0x7')]('/',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x9')]);router[_0x8b7f('0x7')](_0x8b7f('0xa'),auth['isAuthenticated'](),controller[_0x8b7f('0xb')]);router['get'](_0x8b7f('0xc'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0xd')]);router[_0x8b7f('0x7')](_0x8b7f('0xe'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0xf')]);router[_0x8b7f('0x10')]('/',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x11')]);router[_0x8b7f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8b7f('0x13')]);router[_0x8b7f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8b7f('0x15')]);module[_0x8b7f('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index f356d26..8838812 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dad=['setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0x6dad,0x77));var _0xd6da=function(_0x3fdf3c,_0x424ca0){_0x3fdf3c=_0x3fdf3c-0x0;var _0x2118a3=_0x6dad[_0x3fdf3c];return _0x2118a3;};'use strict';var moment=require(_0xd6da('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x698ac0){this[_0xd6da('0x1')](_0xd6da('0x2'),_0x698ac0);this[_0xd6da('0x1')]('endtime',moment()[_0xd6da('0x3')](_0xd6da('0x4')));}},'endtime':{'type':Sequelize[_0xd6da('0x5')]},'membername':{'type':Sequelize[_0xd6da('0x6')]},'projectname':{'type':Sequelize[_0xd6da('0x6')]},'queue':{'type':Sequelize[_0xd6da('0x6')]},'uniqueid':{'type':Sequelize[_0xd6da('0x6')]},'calleridname':{'type':Sequelize[_0xd6da('0x6')]},'calleridnum':{'type':Sequelize[_0xd6da('0x6')]},'completed':{'type':Sequelize[_0xd6da('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x904a=['starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE'];(function(_0x1018cc,_0xcea0b){var _0x43356d=function(_0x29269e){while(--_0x29269e){_0x1018cc['push'](_0x1018cc['shift']());}};_0x43356d(++_0xcea0b);}(_0x904a,0x1dd));var _0xa904=function(_0x357a05,_0x4b9e30){_0x357a05=_0x357a05-0x0;var _0xc35a9a=_0x904a[_0x357a05];return _0xc35a9a;};'use strict';var moment=require(_0xa904('0x0'));var Sequelize=require(_0xa904('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xa904('0x2')],'set':function(_0x271b87){this['setDataValue'](_0xa904('0x3'),_0x271b87);this[_0xa904('0x4')](_0xa904('0x5'),moment()[_0xa904('0x6')](_0xa904('0x7')));}},'endtime':{'type':Sequelize[_0xa904('0x2')]},'membername':{'type':Sequelize[_0xa904('0x8')]},'projectname':{'type':Sequelize[_0xa904('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa904('0x8')]},'calleridname':{'type':Sequelize[_0xa904('0x8')]},'calleridnum':{'type':Sequelize[_0xa904('0x8')]},'completed':{'type':Sequelize[_0xa904('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 04c33ab..1b5a216 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e25=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','map','merge','options','include','rows','show','params','keys','includeAll','find','catch','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9e25,0x17d));var _0x59e2=function(_0x50c0fc,_0x41acff){_0x50c0fc=_0x50c0fc-0x0;var _0x57196c=_0x9e25[_0x50c0fc];return _0x57196c;};'use strict';var emlformat=require(_0x59e2('0x0'));var rimraf=require(_0x59e2('0x1'));var zipdir=require(_0x59e2('0x2'));var jsonpatch=require(_0x59e2('0x3'));var rp=require('request-promise');var moment=require(_0x59e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x59e2('0x5'));var util=require(_0x59e2('0x6'));var path=require(_0x59e2('0x7'));var sox=require(_0x59e2('0x8'));var csv=require(_0x59e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59e2('0xa'));var _=require(_0x59e2('0xb'));var squel=require(_0x59e2('0xc'));var crypto=require(_0x59e2('0xd'));var jsforce=require(_0x59e2('0xe'));var deskjs=require(_0x59e2('0xf'));var toCsv=require(_0x59e2('0x9'));var querystring=require('querystring');var Papa=require(_0x59e2('0x10'));var Redis=require(_0x59e2('0x11'));var authService=require(_0x59e2('0x12'));var qs=require(_0x59e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59e2('0x14'));var logger=require('../../config/logger')(_0x59e2('0x15'));var utils=require(_0x59e2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x59e2('0x17'));var db=require(_0x59e2('0x18'))['db'];function respondWithStatusCode(_0xb7991,_0x387e0c){_0x387e0c=_0x387e0c||0xcc;return function(_0x44c02d){if(_0x44c02d){return _0xb7991[_0x59e2('0x19')](_0x387e0c);}return _0xb7991[_0x59e2('0x1a')](_0x387e0c)['end']();};}function respondWithResult(_0x5c75a0,_0x4ab1f9){_0x4ab1f9=_0x4ab1f9||0xc8;return function(_0x4aa89b){if(_0x4aa89b){return _0x5c75a0[_0x59e2('0x1a')](_0x4ab1f9)[_0x59e2('0x1b')](_0x4aa89b);}};}function respondWithFilteredResult(_0xbe6d7e,_0x581c6d){return function(_0x54ff8d){if(_0x54ff8d){var _0x417ee7=typeof _0x581c6d[_0x59e2('0x1c')]===_0x59e2('0x1d')&&typeof _0x581c6d[_0x59e2('0x1e')]==='undefined';var _0x5256e1=_0x54ff8d[_0x59e2('0x1f')];var _0x545f97=_0x417ee7?0x0:_0x581c6d['offset'];var _0x15f7b6=_0x417ee7?_0x54ff8d[_0x59e2('0x1f')]:_0x581c6d[_0x59e2('0x1c')]+_0x581c6d[_0x59e2('0x1e')];var _0x48a3ab;if(_0x15f7b6>=_0x5256e1){_0x15f7b6=_0x5256e1;_0x48a3ab=0xc8;}else{_0x48a3ab=0xce;}_0xbe6d7e[_0x59e2('0x1a')](_0x48a3ab);return _0xbe6d7e[_0x59e2('0x20')](_0x59e2('0x21'),_0x545f97+'-'+_0x15f7b6+'/'+_0x5256e1)[_0x59e2('0x1b')](_0x54ff8d);}return null;};}function patchUpdates(_0x5cb63f){return function(_0x3fb8ce){try{jsonpatch[_0x59e2('0x22')](_0x3fb8ce,_0x5cb63f,!![]);}catch(_0x598a8b){return BPromise[_0x59e2('0x23')](_0x598a8b);}return _0x3fb8ce[_0x59e2('0x24')]();};}function saveUpdates(_0x1f4e99,_0x1af01a){return function(_0x14bdeb){if(_0x14bdeb){return _0x14bdeb['update'](_0x1f4e99)[_0x59e2('0x25')](function(_0x10ace2){return _0x10ace2;});}return null;};}function removeEntity(_0x343b75,_0xb4ff55){return function(_0xe9f71){if(_0xe9f71){return _0xe9f71[_0x59e2('0x26')]()[_0x59e2('0x25')](function(){_0x343b75[_0x59e2('0x1a')](0xcc)[_0x59e2('0x27')]();});}};}function handleEntityNotFound(_0x77c4bb,_0x3d25d7){return function(_0x23b7a1){if(!_0x23b7a1){_0x77c4bb[_0x59e2('0x19')](0x194);}return _0x23b7a1;};}function handleError(_0x2830dc,_0x3f1277){_0x3f1277=_0x3f1277||0x1f4;return function(_0x16da73){logger['error'](_0x16da73['stack']);if(_0x16da73[_0x59e2('0x28')]){delete _0x16da73[_0x59e2('0x28')];}_0x2830dc[_0x59e2('0x1a')](_0x3f1277)[_0x59e2('0x29')](_0x16da73);};}exports[_0x59e2('0x2a')]=function(_0x56b8f2,_0x46af99){var _0x2a9fe0={},_0x141a8d={},_0x578da4={'count':0x0,'rows':[]};var _0x2286f3=_['map'](db[_0x59e2('0x2b')][_0x59e2('0x2c')],function(_0x2eddec){return{'name':_0x2eddec[_0x59e2('0x2d')],'type':_0x2eddec[_0x59e2('0x2e')][_0x59e2('0x2f')]};});_0x141a8d[_0x59e2('0x30')]=_['map'](_0x2286f3,_0x59e2('0x28'));_0x141a8d[_0x59e2('0x31')]=_['keys'](_0x56b8f2[_0x59e2('0x31')]);_0x141a8d[_0x59e2('0x32')]=_[_0x59e2('0x33')](_0x141a8d[_0x59e2('0x30')],_0x141a8d[_0x59e2('0x31')]);_0x2a9fe0[_0x59e2('0x34')]=_[_0x59e2('0x33')](_0x141a8d[_0x59e2('0x30')],qs[_0x59e2('0x35')](_0x56b8f2[_0x59e2('0x31')][_0x59e2('0x35')]));_0x2a9fe0[_0x59e2('0x34')]=_0x2a9fe0[_0x59e2('0x34')][_0x59e2('0x36')]?_0x2a9fe0[_0x59e2('0x34')]:_0x141a8d['model'];if(!_0x56b8f2[_0x59e2('0x31')][_0x59e2('0x37')]('nolimit')){_0x2a9fe0[_0x59e2('0x1e')]=qs[_0x59e2('0x1e')](_0x56b8f2[_0x59e2('0x31')][_0x59e2('0x1e')]);_0x2a9fe0[_0x59e2('0x1c')]=qs[_0x59e2('0x1c')](_0x56b8f2['query']['offset']);}_0x2a9fe0[_0x59e2('0x38')]=qs[_0x59e2('0x39')](_0x56b8f2[_0x59e2('0x31')]['sort']);_0x2a9fe0['where']=qs[_0x59e2('0x32')](_['pick'](_0x56b8f2['query'],_0x141a8d[_0x59e2('0x32')]),_0x2286f3);if(_0x56b8f2[_0x59e2('0x31')][_0x59e2('0x3a')]){_0x2a9fe0['where']=_['merge'](_0x2a9fe0[_0x59e2('0x3b')],{'$or':_[_0x59e2('0x3c')](_0x2286f3,function(_0x22605d){if(_0x22605d['type']!=='VIRTUAL'){var _0x2f5991={};_0x2f5991[_0x22605d['name']]={'$like':'%'+_0x56b8f2[_0x59e2('0x31')][_0x59e2('0x3a')]+'%'};return _0x2f5991;}})});}_0x2a9fe0=_[_0x59e2('0x3d')]({},_0x2a9fe0,_0x56b8f2[_0x59e2('0x3e')]);var _0x246fbe={'where':_0x2a9fe0[_0x59e2('0x3b')]};return db[_0x59e2('0x2b')][_0x59e2('0x1f')](_0x246fbe)[_0x59e2('0x25')](function(_0x311226){_0x578da4['count']=_0x311226;if(_0x56b8f2[_0x59e2('0x31')]['includeAll']){_0x2a9fe0[_0x59e2('0x3f')]=[{'all':!![]}];}return db[_0x59e2('0x2b')]['findAll'](_0x2a9fe0);})['then'](function(_0x297d68){_0x578da4[_0x59e2('0x40')]=_0x297d68;return _0x578da4;})[_0x59e2('0x25')](respondWithFilteredResult(_0x46af99,_0x2a9fe0))['catch'](handleError(_0x46af99,null));};exports[_0x59e2('0x41')]=function(_0x418ecb,_0x4c859d){var _0x4dc9a6={'raw':!![],'where':{'id':_0x418ecb[_0x59e2('0x42')]['id']}},_0x1eb75b={};_0x1eb75b[_0x59e2('0x30')]=_['keys'](db['JscriptySessionReport'][_0x59e2('0x2c')]);_0x1eb75b[_0x59e2('0x31')]=_[_0x59e2('0x43')](_0x418ecb[_0x59e2('0x31')]);_0x1eb75b[_0x59e2('0x32')]=_[_0x59e2('0x33')](_0x1eb75b[_0x59e2('0x30')],_0x1eb75b[_0x59e2('0x31')]);_0x4dc9a6[_0x59e2('0x34')]=_[_0x59e2('0x33')](_0x1eb75b[_0x59e2('0x30')],qs[_0x59e2('0x35')](_0x418ecb[_0x59e2('0x31')][_0x59e2('0x35')]));_0x4dc9a6[_0x59e2('0x34')]=_0x4dc9a6['attributes'][_0x59e2('0x36')]?_0x4dc9a6[_0x59e2('0x34')]:_0x1eb75b[_0x59e2('0x30')];if(_0x418ecb[_0x59e2('0x31')][_0x59e2('0x44')]){_0x4dc9a6[_0x59e2('0x3f')]=[{'all':!![]}];}_0x4dc9a6=_[_0x59e2('0x3d')]({},_0x4dc9a6,_0x418ecb[_0x59e2('0x3e')]);return db['JscriptySessionReport'][_0x59e2('0x45')](_0x4dc9a6)[_0x59e2('0x25')](handleEntityNotFound(_0x4c859d,null))[_0x59e2('0x25')](respondWithResult(_0x4c859d,null))[_0x59e2('0x46')](handleError(_0x4c859d,null));};exports['create']=function(_0x50b820,_0x2c5a8){return db['JscriptySessionReport'][_0x59e2('0x47')](_0x50b820[_0x59e2('0x48')],{})['then'](respondWithResult(_0x2c5a8,0xc9))['catch'](handleError(_0x2c5a8,null));};exports[_0x59e2('0x49')]=function(_0x1e4878,_0x415c8d){if(_0x1e4878['body']['id']){delete _0x1e4878[_0x59e2('0x48')]['id'];}return db[_0x59e2('0x2b')][_0x59e2('0x45')]({'where':{'id':_0x1e4878[_0x59e2('0x42')]['id']}})[_0x59e2('0x25')](handleEntityNotFound(_0x415c8d,null))[_0x59e2('0x25')](saveUpdates(_0x1e4878[_0x59e2('0x48')],null))['then'](respondWithResult(_0x415c8d,null))[_0x59e2('0x46')](handleError(_0x415c8d,null));};exports[_0x59e2('0x26')]=function(_0x842e92,_0x22593d){return db[_0x59e2('0x2b')]['find']({'where':{'id':_0x842e92[_0x59e2('0x42')]['id']}})[_0x59e2('0x25')](handleEntityNotFound(_0x22593d,null))['then'](removeEntity(_0x22593d,null))['catch'](handleError(_0x22593d,null));};exports[_0x59e2('0x4a')]=function(_0x4b1e21,_0x305a2f){return db['JscriptySessionReport'][_0x59e2('0x4a')]()[_0x59e2('0x25')](respondWithResult(_0x305a2f,null))[_0x59e2('0x46')](handleError(_0x305a2f,null));};exports[_0x59e2('0x4b')]=function(_0x402a04,_0x26f46e,_0x36d477){var _0x5509e7={'raw':!![],'where':{}};var _0x53a657={};var _0x1bfca2={'count':0x0,'rows':[]};return db[_0x59e2('0x2b')][_0x59e2('0x4c')]({'where':{'id':_0x402a04[_0x59e2('0x42')]['id']}})['then'](handleEntityNotFound(_0x26f46e,null))[_0x59e2('0x25')](function(_0x4d4845){if(_0x4d4845){_0x53a657[_0x59e2('0x30')]=_[_0x59e2('0x43')](db[_0x59e2('0x4d')][_0x59e2('0x2c')]);_0x53a657['query']=_[_0x59e2('0x43')](_0x402a04[_0x59e2('0x31')]);_0x53a657[_0x59e2('0x32')]=_[_0x59e2('0x33')](_0x53a657[_0x59e2('0x30')],_0x53a657[_0x59e2('0x31')]);_0x5509e7[_0x59e2('0x34')]=_[_0x59e2('0x33')](_0x53a657[_0x59e2('0x30')],qs[_0x59e2('0x35')](_0x402a04[_0x59e2('0x31')]['fields']));_0x5509e7['attributes']=_0x5509e7[_0x59e2('0x34')]['length']?_0x5509e7[_0x59e2('0x34')]:_0x53a657['model'];if(!_0x402a04[_0x59e2('0x31')][_0x59e2('0x37')](_0x59e2('0x4e'))){_0x5509e7[_0x59e2('0x1e')]=qs[_0x59e2('0x1e')](_0x402a04[_0x59e2('0x31')][_0x59e2('0x1e')]);_0x5509e7[_0x59e2('0x1c')]=qs[_0x59e2('0x1c')](_0x402a04[_0x59e2('0x31')]['offset']);}_0x5509e7[_0x59e2('0x38')]=qs[_0x59e2('0x39')](_0x402a04[_0x59e2('0x31')][_0x59e2('0x39')]);_0x5509e7[_0x59e2('0x3b')]=qs['filters'](_[_0x59e2('0x4f')](_0x402a04[_0x59e2('0x31')],_0x53a657[_0x59e2('0x32')]));_0x5509e7[_0x59e2('0x3b')][_0x59e2('0x50')]=_0x4d4845['id'];if(_0x402a04[_0x59e2('0x31')]['filter']){_0x5509e7[_0x59e2('0x3b')]=_[_0x59e2('0x3d')](_0x5509e7[_0x59e2('0x3b')],{'$or':_[_0x59e2('0x3c')](_0x5509e7[_0x59e2('0x34')],function(_0x267aa9){var _0x12d739={};_0x12d739[_0x267aa9]={'$like':'%'+_0x402a04[_0x59e2('0x31')]['filter']+'%'};return _0x12d739;})});}_0x5509e7=_[_0x59e2('0x3d')]({},_0x5509e7,_0x402a04[_0x59e2('0x3e')]);return db[_0x59e2('0x4d')][_0x59e2('0x1f')]({'where':_0x5509e7[_0x59e2('0x3b')]})[_0x59e2('0x25')](function(_0x37a787){_0x1bfca2['count']=_0x37a787;if(_0x402a04[_0x59e2('0x31')][_0x59e2('0x44')]){_0x5509e7['include']=[{'all':!![]}];}return db[_0x59e2('0x4d')][_0x59e2('0x51')](_0x5509e7);})[_0x59e2('0x25')](function(_0x12a160){_0x1bfca2[_0x59e2('0x40')]=_0x12a160;return _0x1bfca2;});}})[_0x59e2('0x25')](respondWithFilteredResult(_0x26f46e,_0x5509e7))['catch'](handleError(_0x26f46e,null));}; \ No newline at end of file +var _0xdf57=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','getQuestions','findOne','keys','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0xdf57,0x1e3));var _0x7df5=function(_0x3bb63a,_0x15af8f){_0x3bb63a=_0x3bb63a-0x0;var _0x3b822a=_0xdf57[_0x3bb63a];return _0x3b822a;};'use strict';var emlformat=require(_0x7df5('0x0'));var rimraf=require(_0x7df5('0x1'));var zipdir=require(_0x7df5('0x2'));var jsonpatch=require(_0x7df5('0x3'));var rp=require(_0x7df5('0x4'));var moment=require(_0x7df5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7df5('0x6'));var util=require(_0x7df5('0x7'));var path=require(_0x7df5('0x8'));var sox=require(_0x7df5('0x9'));var csv=require(_0x7df5('0xa'));var ejs=require(_0x7df5('0xb'));var fs=require('fs');var fs_extra=require(_0x7df5('0xc'));var _=require(_0x7df5('0xd'));var squel=require(_0x7df5('0xe'));var crypto=require('crypto');var jsforce=require(_0x7df5('0xf'));var deskjs=require(_0x7df5('0x10'));var toCsv=require(_0x7df5('0xa'));var querystring=require(_0x7df5('0x11'));var Papa=require('papaparse');var Redis=require(_0x7df5('0x12'));var authService=require(_0x7df5('0x13'));var qs=require(_0x7df5('0x14'));var as=require(_0x7df5('0x15'));var hardwareService=require(_0x7df5('0x16'));var logger=require(_0x7df5('0x17'))(_0x7df5('0x18'));var utils=require(_0x7df5('0x19'));var config=require(_0x7df5('0x1a'));var licenseUtil=require(_0x7df5('0x1b'));var db=require(_0x7df5('0x1c'))['db'];function respondWithStatusCode(_0x1955dc,_0x3e1929){_0x3e1929=_0x3e1929||0xcc;return function(_0x482dd7){if(_0x482dd7){return _0x1955dc['sendStatus'](_0x3e1929);}return _0x1955dc[_0x7df5('0x1d')](_0x3e1929)[_0x7df5('0x1e')]();};}function respondWithResult(_0xb76050,_0x19e286){_0x19e286=_0x19e286||0xc8;return function(_0x5d72ab){if(_0x5d72ab){return _0xb76050['status'](_0x19e286)[_0x7df5('0x1f')](_0x5d72ab);}};}function respondWithFilteredResult(_0x4cb321,_0x4fec24){return function(_0x315860){if(_0x315860){var _0x375fea=typeof _0x4fec24[_0x7df5('0x20')]===_0x7df5('0x21')&&typeof _0x4fec24[_0x7df5('0x22')]===_0x7df5('0x21');var _0x4c432e=_0x315860[_0x7df5('0x23')];var _0x252895=_0x375fea?0x0:_0x4fec24[_0x7df5('0x20')];var _0x32f082=_0x375fea?_0x315860['count']:_0x4fec24[_0x7df5('0x20')]+_0x4fec24[_0x7df5('0x22')];var _0x4aef6e;if(_0x32f082>=_0x4c432e){_0x32f082=_0x4c432e;_0x4aef6e=0xc8;}else{_0x4aef6e=0xce;}_0x4cb321[_0x7df5('0x1d')](_0x4aef6e);return _0x4cb321[_0x7df5('0x24')](_0x7df5('0x25'),_0x252895+'-'+_0x32f082+'/'+_0x4c432e)['json'](_0x315860);}return null;};}function patchUpdates(_0x2621c4){return function(_0x558739){try{jsonpatch[_0x7df5('0x26')](_0x558739,_0x2621c4,!![]);}catch(_0x574aa0){return BPromise[_0x7df5('0x27')](_0x574aa0);}return _0x558739[_0x7df5('0x28')]();};}function saveUpdates(_0x136415,_0x595ba6){return function(_0x4dd511){if(_0x4dd511){return _0x4dd511[_0x7df5('0x29')](_0x136415)['then'](function(_0x16ef37){return _0x16ef37;});}return null;};}function removeEntity(_0x440cbd,_0x47ccfa){return function(_0x40d371){if(_0x40d371){return _0x40d371['destroy']()[_0x7df5('0x2a')](function(){_0x440cbd[_0x7df5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2721b1,_0x1297ca){return function(_0xd4af7f){if(!_0xd4af7f){_0x2721b1[_0x7df5('0x2b')](0x194);}return _0xd4af7f;};}function handleError(_0x5c1795,_0xb21710){_0xb21710=_0xb21710||0x1f4;return function(_0x513c7a){logger[_0x7df5('0x2c')](_0x513c7a['stack']);if(_0x513c7a[_0x7df5('0x2d')]){delete _0x513c7a[_0x7df5('0x2d')];}_0x5c1795[_0x7df5('0x1d')](_0xb21710)[_0x7df5('0x2e')](_0x513c7a);};}exports[_0x7df5('0x2f')]=function(_0x17f20f,_0x14de81){var _0x3b5f38={},_0x40b34c={},_0x20547b={'count':0x0,'rows':[]};var _0x15ccfd=_[_0x7df5('0x30')](db[_0x7df5('0x31')][_0x7df5('0x32')],function(_0x4f0b79){return{'name':_0x4f0b79[_0x7df5('0x33')],'type':_0x4f0b79['type'][_0x7df5('0x34')]};});_0x40b34c['model']=_['map'](_0x15ccfd,_0x7df5('0x2d'));_0x40b34c[_0x7df5('0x35')]=_['keys'](_0x17f20f['query']);_0x40b34c[_0x7df5('0x36')]=_[_0x7df5('0x37')](_0x40b34c[_0x7df5('0x38')],_0x40b34c[_0x7df5('0x35')]);_0x3b5f38['attributes']=_['intersection'](_0x40b34c[_0x7df5('0x38')],qs[_0x7df5('0x39')](_0x17f20f[_0x7df5('0x35')]['fields']));_0x3b5f38['attributes']=_0x3b5f38[_0x7df5('0x3a')][_0x7df5('0x3b')]?_0x3b5f38[_0x7df5('0x3a')]:_0x40b34c[_0x7df5('0x38')];if(!_0x17f20f[_0x7df5('0x35')][_0x7df5('0x3c')](_0x7df5('0x3d'))){_0x3b5f38[_0x7df5('0x22')]=qs[_0x7df5('0x22')](_0x17f20f[_0x7df5('0x35')]['limit']);_0x3b5f38[_0x7df5('0x20')]=qs['offset'](_0x17f20f[_0x7df5('0x35')]['offset']);}_0x3b5f38[_0x7df5('0x3e')]=qs[_0x7df5('0x3f')](_0x17f20f[_0x7df5('0x35')][_0x7df5('0x3f')]);_0x3b5f38[_0x7df5('0x40')]=qs[_0x7df5('0x36')](_[_0x7df5('0x41')](_0x17f20f[_0x7df5('0x35')],_0x40b34c[_0x7df5('0x36')]),_0x15ccfd);if(_0x17f20f[_0x7df5('0x35')][_0x7df5('0x42')]){_0x3b5f38[_0x7df5('0x40')]=_['merge'](_0x3b5f38[_0x7df5('0x40')],{'$or':_[_0x7df5('0x30')](_0x15ccfd,function(_0x54dbea){if(_0x54dbea['type']!==_0x7df5('0x43')){var _0x3680bc={};_0x3680bc[_0x54dbea['name']]={'$like':'%'+_0x17f20f[_0x7df5('0x35')]['filter']+'%'};return _0x3680bc;}})});}_0x3b5f38=_[_0x7df5('0x44')]({},_0x3b5f38,_0x17f20f[_0x7df5('0x45')]);var _0x113d2d={'where':_0x3b5f38['where']};return db[_0x7df5('0x31')][_0x7df5('0x23')](_0x113d2d)['then'](function(_0x251dc3){_0x20547b[_0x7df5('0x23')]=_0x251dc3;if(_0x17f20f[_0x7df5('0x35')][_0x7df5('0x46')]){_0x3b5f38[_0x7df5('0x47')]=[{'all':!![]}];}return db[_0x7df5('0x31')][_0x7df5('0x48')](_0x3b5f38);})[_0x7df5('0x2a')](function(_0x38feff){_0x20547b[_0x7df5('0x49')]=_0x38feff;return _0x20547b;})[_0x7df5('0x2a')](respondWithFilteredResult(_0x14de81,_0x3b5f38))[_0x7df5('0x4a')](handleError(_0x14de81,null));};exports[_0x7df5('0x4b')]=function(_0x593b3e,_0xfc9af9){var _0x1caba4={'raw':!![],'where':{'id':_0x593b3e[_0x7df5('0x4c')]['id']}},_0x14a339={};_0x14a339[_0x7df5('0x38')]=_['keys'](db[_0x7df5('0x31')][_0x7df5('0x32')]);_0x14a339[_0x7df5('0x35')]=_['keys'](_0x593b3e[_0x7df5('0x35')]);_0x14a339[_0x7df5('0x36')]=_['intersection'](_0x14a339[_0x7df5('0x38')],_0x14a339[_0x7df5('0x35')]);_0x1caba4[_0x7df5('0x3a')]=_[_0x7df5('0x37')](_0x14a339[_0x7df5('0x38')],qs[_0x7df5('0x39')](_0x593b3e[_0x7df5('0x35')][_0x7df5('0x39')]));_0x1caba4[_0x7df5('0x3a')]=_0x1caba4[_0x7df5('0x3a')][_0x7df5('0x3b')]?_0x1caba4[_0x7df5('0x3a')]:_0x14a339[_0x7df5('0x38')];if(_0x593b3e[_0x7df5('0x35')][_0x7df5('0x46')]){_0x1caba4['include']=[{'all':!![]}];}_0x1caba4=_[_0x7df5('0x44')]({},_0x1caba4,_0x593b3e[_0x7df5('0x45')]);return db[_0x7df5('0x31')][_0x7df5('0x4d')](_0x1caba4)[_0x7df5('0x2a')](handleEntityNotFound(_0xfc9af9,null))[_0x7df5('0x2a')](respondWithResult(_0xfc9af9,null))[_0x7df5('0x4a')](handleError(_0xfc9af9,null));};exports[_0x7df5('0x4e')]=function(_0x1e0c84,_0xc3d37a){return db[_0x7df5('0x31')][_0x7df5('0x4e')](_0x1e0c84['body'],{})[_0x7df5('0x2a')](respondWithResult(_0xc3d37a,0xc9))['catch'](handleError(_0xc3d37a,null));};exports[_0x7df5('0x29')]=function(_0x401360,_0x4ab37c){if(_0x401360[_0x7df5('0x4f')]['id']){delete _0x401360['body']['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x401360[_0x7df5('0x4c')]['id']}})[_0x7df5('0x2a')](handleEntityNotFound(_0x4ab37c,null))['then'](saveUpdates(_0x401360[_0x7df5('0x4f')],null))['then'](respondWithResult(_0x4ab37c,null))[_0x7df5('0x4a')](handleError(_0x4ab37c,null));};exports[_0x7df5('0x50')]=function(_0x281a0d,_0x11c812){return db[_0x7df5('0x31')][_0x7df5('0x4d')]({'where':{'id':_0x281a0d[_0x7df5('0x4c')]['id']}})[_0x7df5('0x2a')](handleEntityNotFound(_0x11c812,null))[_0x7df5('0x2a')](removeEntity(_0x11c812,null))[_0x7df5('0x4a')](handleError(_0x11c812,null));};exports[_0x7df5('0x51')]=function(_0x2e39a0,_0x30108b){return db['JscriptySessionReport'][_0x7df5('0x51')]()[_0x7df5('0x2a')](respondWithResult(_0x30108b,null))[_0x7df5('0x4a')](handleError(_0x30108b,null));};exports[_0x7df5('0x52')]=function(_0x2fb122,_0x2774fa,_0x156114){var _0x32e2c0={'raw':!![],'where':{}};var _0x2491ad={};var _0x4e118e={'count':0x0,'rows':[]};return db[_0x7df5('0x31')][_0x7df5('0x53')]({'where':{'id':_0x2fb122['params']['id']}})[_0x7df5('0x2a')](handleEntityNotFound(_0x2774fa,null))[_0x7df5('0x2a')](function(_0x145b18){if(_0x145b18){_0x2491ad['model']=_['keys'](db['JscriptyQuestionReport'][_0x7df5('0x32')]);_0x2491ad['query']=_[_0x7df5('0x54')](_0x2fb122['query']);_0x2491ad['filters']=_[_0x7df5('0x37')](_0x2491ad['model'],_0x2491ad[_0x7df5('0x35')]);_0x32e2c0['attributes']=_[_0x7df5('0x37')](_0x2491ad['model'],qs[_0x7df5('0x39')](_0x2fb122['query'][_0x7df5('0x39')]));_0x32e2c0[_0x7df5('0x3a')]=_0x32e2c0[_0x7df5('0x3a')][_0x7df5('0x3b')]?_0x32e2c0[_0x7df5('0x3a')]:_0x2491ad[_0x7df5('0x38')];if(!_0x2fb122[_0x7df5('0x35')][_0x7df5('0x3c')]('nolimit')){_0x32e2c0[_0x7df5('0x22')]=qs[_0x7df5('0x22')](_0x2fb122[_0x7df5('0x35')][_0x7df5('0x22')]);_0x32e2c0[_0x7df5('0x20')]=qs[_0x7df5('0x20')](_0x2fb122[_0x7df5('0x35')][_0x7df5('0x20')]);}_0x32e2c0[_0x7df5('0x3e')]=qs['sort'](_0x2fb122['query'][_0x7df5('0x3f')]);_0x32e2c0[_0x7df5('0x40')]=qs[_0x7df5('0x36')](_[_0x7df5('0x41')](_0x2fb122['query'],_0x2491ad[_0x7df5('0x36')]));_0x32e2c0[_0x7df5('0x40')]['SessionId']=_0x145b18['id'];if(_0x2fb122[_0x7df5('0x35')][_0x7df5('0x42')]){_0x32e2c0[_0x7df5('0x40')]=_[_0x7df5('0x44')](_0x32e2c0[_0x7df5('0x40')],{'$or':_[_0x7df5('0x30')](_0x32e2c0[_0x7df5('0x3a')],function(_0x24674e){var _0x5206d2={};_0x5206d2[_0x24674e]={'$like':'%'+_0x2fb122[_0x7df5('0x35')][_0x7df5('0x42')]+'%'};return _0x5206d2;})});}_0x32e2c0=_[_0x7df5('0x44')]({},_0x32e2c0,_0x2fb122['options']);return db['JscriptyQuestionReport']['count']({'where':_0x32e2c0[_0x7df5('0x40')]})[_0x7df5('0x2a')](function(_0x47c377){_0x4e118e[_0x7df5('0x23')]=_0x47c377;if(_0x2fb122[_0x7df5('0x35')][_0x7df5('0x46')]){_0x32e2c0[_0x7df5('0x47')]=[{'all':!![]}];}return db[_0x7df5('0x55')]['findAll'](_0x32e2c0);})['then'](function(_0x353089){_0x4e118e[_0x7df5('0x49')]=_0x353089;return _0x4e118e;});}})['then'](respondWithFilteredResult(_0x2774fa,_0x32e2c0))[_0x7df5('0x4a')](handleError(_0x2774fa,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 80daf7d..1c118b1 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc4=['path','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xafc4,0x69));var _0x4afc=function(_0x569649,_0x2007c4){_0x569649=_0x569649-0x0;var _0x54b89e=_0xafc4[_0x569649];return _0x54b89e;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions'];(function(_0x28b848,_0x1089e9){var _0x349489=function(_0x117858){while(--_0x117858){_0x28b848['push'](_0x28b848['shift']());}};_0x349489(++_0x1089e9);}(_0x1261,0x144));var _0x1126=function(_0x5bf609,_0x5c1e35){_0x5bf609=_0x5bf609-0x0;var _0x3c3a74=_0x1261[_0x5bf609];return _0x3c3a74;};'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')]('JscriptySessionReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index c715005..f508db0 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7046=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x39be20,_0x226232){var _0x392511=function(_0x12a9f9){while(--_0x12a9f9){_0x39be20['push'](_0x39be20['shift']());}};_0x392511(++_0x226232);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});} \ No newline at end of file +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(_0x4d6ff0,_0x1913bd){var _0x51bdb9=function(_0xd6983e){while(--_0xd6983e){_0x4d6ff0['push'](_0x4d6ff0['shift']());}};_0x51bdb9(++_0x1913bd);}(_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']('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 diff --git a/server/api/license/index.js b/server/api/license/index.js index e1fe210..c41c768 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0257=['./license.controller','get','index','put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x0257,0x1c3));var _0x7025=function(_0x2d85a5,_0x26861c){_0x2d85a5=_0x2d85a5-0x0;var _0x27d75b=_0x0257[_0x2d85a5];return _0x27d75b;};'use strict';var multer=require(_0x7025('0x0'));var util=require(_0x7025('0x1'));var path=require(_0x7025('0x2'));var timeout=require(_0x7025('0x3'));var express=require('express');var router=express[_0x7025('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7025('0x5'));var interaction=require(_0x7025('0x6'));var config=require(_0x7025('0x7'));var controller=require(_0x7025('0x8'));router[_0x7025('0x9')]('/',controller[_0x7025('0xa')]);router[_0x7025('0xb')]('/:id',auth[_0x7025('0xc')](),controller[_0x7025('0xd')]);router['get'](_0x7025('0xe'),auth[_0x7025('0xc')](),controller[_0x7025('0xf')]);module[_0x7025('0x10')]=router; \ No newline at end of file +var _0x6615=['./license.controller','index','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x5550c6,_0x278e80){var _0x2b21f8=function(_0x3f57e2){while(--_0x3f57e2){_0x5550c6['push'](_0x5550c6['shift']());}};_0x2b21f8(++_0x278e80);}(_0x6615,0x8f));var _0x5661=function(_0x5d2637,_0x4de66a){_0x5d2637=_0x5d2637-0x0;var _0x197d8d=_0x6615[_0x5d2637];return _0x197d8d;};'use strict';var multer=require(_0x5661('0x0'));var util=require(_0x5661('0x1'));var path=require('path');var timeout=require(_0x5661('0x2'));var express=require(_0x5661('0x3'));var router=express[_0x5661('0x4')]();var fs_extra=require(_0x5661('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5661('0x6'));var controller=require(_0x5661('0x7'));router['get']('/',controller[_0x5661('0x8')]);router[_0x5661('0x9')](_0x5661('0xa'),auth['isAuthenticated'](),controller[_0x5661('0xb')]);router['get'](_0x5661('0xc'),auth[_0x5661('0xd')](),controller[_0x5661('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b92631d..3f65fb2 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52e6=['exports','TEXT','STRING','INTEGER'];(function(_0x5b7588,_0x451e71){var _0x4c66bd=function(_0x4d72ce){while(--_0x4d72ce){_0x5b7588['push'](_0x5b7588['shift']());}};_0x4c66bd(++_0x451e71);}(_0x52e6,0x188));var _0x652e=function(_0x5b093b,_0xe4e3a5){_0x5b093b=_0x5b093b-0x0;var _0x2fc71c=_0x52e6[_0x5b093b];return _0x2fc71c;};'use strict';var Sequelize=require('sequelize');module[_0x652e('0x0')]={'license':{'type':Sequelize[_0x652e('0x1')]},'data1':{'type':Sequelize[_0x652e('0x2')]},'data2':{'type':Sequelize[_0x652e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x652e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x566c=['sequelize','exports','TEXT','STRING'];(function(_0x3c66c0,_0x1d8a47){var _0x18c29f=function(_0x5c47a1){while(--_0x5c47a1){_0x3c66c0['push'](_0x3c66c0['shift']());}};_0x18c29f(++_0x1d8a47);}(_0x566c,0x164));var _0xc566=function(_0x5b2078,_0x2e6cd0){_0x5b2078=_0x5b2078-0x0;var _0x4180cf=_0x566c[_0x5b2078];return _0x4180cf;};'use strict';var Sequelize=require(_0xc566('0x0'));module[_0xc566('0x1')]={'license':{'type':Sequelize[_0xc566('0x2')]},'data1':{'type':Sequelize[_0xc566('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 6c5ade1..095e380 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5430=['intersection','attributes','fields','length','merge','options','catch','update','body','find','params','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','setHeader','attachment;\x20filename=','download','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','../../config/license/util','index','model','License','rawAttributes','query','keys','filters'];(function(_0x3c84cf,_0x46e0e0){var _0x53e552=function(_0x2dfecd){while(--_0x2dfecd){_0x3c84cf['push'](_0x3c84cf['shift']());}};_0x53e552(++_0x46e0e0);}(_0x5430,0xaa));var _0x0543=function(_0x241ab3,_0x39c5b8){_0x241ab3=_0x241ab3-0x0;var _0x31ae76=_0x5430[_0x241ab3];return _0x31ae76;};'use strict';var emlformat=require(_0x0543('0x0'));var rimraf=require(_0x0543('0x1'));var zipdir=require(_0x0543('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0543('0x3'));var moment=require('moment');var BPromise=require(_0x0543('0x4'));var Mustache=require('mustache');var util=require(_0x0543('0x5'));var path=require(_0x0543('0x6'));var sox=require(_0x0543('0x7'));var csv=require(_0x0543('0x8'));var ejs=require(_0x0543('0x9'));var fs=require('fs');var fs_extra=require(_0x0543('0xa'));var _=require(_0x0543('0xb'));var squel=require(_0x0543('0xc'));var crypto=require('crypto');var jsforce=require(_0x0543('0xd'));var deskjs=require(_0x0543('0xe'));var toCsv=require(_0x0543('0x8'));var querystring=require(_0x0543('0xf'));var Papa=require(_0x0543('0x10'));var Redis=require(_0x0543('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0543('0x12'));var as=require(_0x0543('0x13'));var hardwareService=require(_0x0543('0x14'));var logger=require(_0x0543('0x15'))(_0x0543('0x16'));var utils=require(_0x0543('0x17'));var config=require(_0x0543('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0543('0x19'))['db'];function respondWithStatusCode(_0x475ed3,_0x457d07){_0x457d07=_0x457d07||0xcc;return function(_0x394d09){if(_0x394d09){return _0x475ed3[_0x0543('0x1a')](_0x457d07);}return _0x475ed3[_0x0543('0x1b')](_0x457d07)[_0x0543('0x1c')]();};}function respondWithResult(_0x53230d,_0xb70926){_0xb70926=_0xb70926||0xc8;return function(_0x46c4f7){if(_0x46c4f7){return _0x53230d[_0x0543('0x1b')](_0xb70926)['json'](_0x46c4f7);}};}function respondWithFilteredResult(_0x1e1b15,_0x2db720){return function(_0x133c66){if(_0x133c66){var _0x103d8b=typeof _0x2db720[_0x0543('0x1d')]===_0x0543('0x1e')&&typeof _0x2db720[_0x0543('0x1f')]==='undefined';var _0x31246c=_0x133c66[_0x0543('0x20')];var _0x2abd59=_0x103d8b?0x0:_0x2db720[_0x0543('0x1d')];var _0x52a492=_0x103d8b?_0x133c66[_0x0543('0x20')]:_0x2db720[_0x0543('0x1d')]+_0x2db720[_0x0543('0x1f')];var _0x54ea26;if(_0x52a492>=_0x31246c){_0x52a492=_0x31246c;_0x54ea26=0xc8;}else{_0x54ea26=0xce;}_0x1e1b15[_0x0543('0x1b')](_0x54ea26);return _0x1e1b15[_0x0543('0x21')](_0x0543('0x22'),_0x2abd59+'-'+_0x52a492+'/'+_0x31246c)[_0x0543('0x23')](_0x133c66);}return null;};}function patchUpdates(_0x44b77b){return function(_0x3ad4fc){try{jsonpatch[_0x0543('0x24')](_0x3ad4fc,_0x44b77b,!![]);}catch(_0x3269c7){return BPromise[_0x0543('0x25')](_0x3269c7);}return _0x3ad4fc['save']();};}function saveUpdates(_0x324027,_0x12e520){return function(_0xf5eace){if(_0xf5eace){return _0xf5eace['update'](_0x324027)[_0x0543('0x26')](function(_0x36f0d4){return _0x36f0d4;});}return null;};}function removeEntity(_0x5e8e05,_0xf9e08e){return function(_0x39f9c0){if(_0x39f9c0){return _0x39f9c0[_0x0543('0x27')]()[_0x0543('0x26')](function(){_0x5e8e05[_0x0543('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b07e3,_0xedbb3){return function(_0x4f8577){if(!_0x4f8577){_0x3b07e3[_0x0543('0x1a')](0x194);}return _0x4f8577;};}function handleError(_0x2dfec8,_0x1f190d){_0x1f190d=_0x1f190d||0x1f4;return function(_0x3c0764){logger[_0x0543('0x28')](_0x3c0764[_0x0543('0x29')]);if(_0x3c0764[_0x0543('0x2a')]){delete _0x3c0764[_0x0543('0x2a')];}_0x2dfec8[_0x0543('0x1b')](_0x1f190d)[_0x0543('0x2b')](_0x3c0764);};}var utilLicense=require(_0x0543('0x2c'));exports[_0x0543('0x2d')]=function(_0x56892b,_0x1317ae){var _0x1fee2a={'raw':!![],'where':{'id':0x1}},_0x235527={};_0x235527[_0x0543('0x2e')]=_['keys'](db[_0x0543('0x2f')][_0x0543('0x30')]);_0x235527[_0x0543('0x31')]=_[_0x0543('0x32')](_0x56892b[_0x0543('0x31')]);_0x235527[_0x0543('0x33')]=_[_0x0543('0x34')](_0x235527['model'],_0x235527[_0x0543('0x31')]);_0x1fee2a[_0x0543('0x35')]=_[_0x0543('0x34')](_0x235527[_0x0543('0x2e')],qs[_0x0543('0x36')](_0x56892b['query']['fields']));_0x1fee2a['attributes']=_0x1fee2a[_0x0543('0x35')][_0x0543('0x37')]?_0x1fee2a['attributes']:_0x235527['model'];_0x1fee2a=_[_0x0543('0x38')]({},_0x1fee2a,_0x56892b[_0x0543('0x39')]);return utilLicense['getLicense'](_0x1fee2a)[_0x0543('0x26')](respondWithResult(_0x1317ae,null))[_0x0543('0x3a')](handleError(_0x1317ae,null));};exports[_0x0543('0x3b')]=function(_0x3f3854,_0xb9263e){if(_0x3f3854[_0x0543('0x3c')]['id']){delete _0x3f3854[_0x0543('0x3c')]['id'];}return db[_0x0543('0x2f')][_0x0543('0x3d')]({'where':{'id':_0x3f3854[_0x0543('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb9263e,null))['then'](function(_0x10a2ee){var _0x12aea1=_0x10a2ee['get']({'plain':!![]});return utilLicense[_0x0543('0x3f')](_0x12aea1,_0x3f3854[_0x0543('0x3c')][_0x0543('0x40')]);})[_0x0543('0x26')](function(_0x4891c9){if(!_0x4891c9[_0x0543('0x41')]){return saveUpdates(_0x3f3854[_0x0543('0x3c')],null);}return _0x4891c9;})[_0x0543('0x26')](respondWithResult(_0xb9263e,null))[_0x0543('0x3a')](handleError(_0xb9263e,null));};exports[_0x0543('0x42')]=function(_0x580486,_0x446d8f){var _0xb7610a=_0x0543('0x43');var _0x2ca012=path[_0x0543('0x44')](_0x0543('0x45'),_0x0543('0x46'),'xcally',_0xb7610a);_0x446d8f[_0x0543('0x47')]('Content-disposition',_0x0543('0x48')+_0xb7610a);_0x446d8f[_0x0543('0x21')]('Content-Type','text/plain');_0x446d8f[_0x0543('0x49')](_0x2ca012);}; \ No newline at end of file +var _0x188d=['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/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x4a9de7,_0x24c8e8){var _0x4a7054=function(_0x823812){while(--_0x823812){_0x4a9de7['push'](_0x4a9de7['shift']());}};_0x4a7054(++_0x24c8e8);}(_0x188d,0x173));var _0xd188=function(_0xc7ed29,_0x515330){_0xc7ed29=_0xc7ed29-0x0;var _0xf8da19=_0x188d[_0xc7ed29];return _0xf8da19;};'use strict';var emlformat=require(_0xd188('0x0'));var rimraf=require(_0xd188('0x1'));var zipdir=require(_0xd188('0x2'));var jsonpatch=require(_0xd188('0x3'));var rp=require(_0xd188('0x4'));var moment=require(_0xd188('0x5'));var BPromise=require(_0xd188('0x6'));var Mustache=require(_0xd188('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd188('0x8'));var csv=require(_0xd188('0x9'));var ejs=require(_0xd188('0xa'));var fs=require('fs');var fs_extra=require(_0xd188('0xb'));var _=require(_0xd188('0xc'));var squel=require(_0xd188('0xd'));var crypto=require(_0xd188('0xe'));var jsforce=require(_0xd188('0xf'));var deskjs=require(_0xd188('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd188('0x11'));var Redis=require(_0xd188('0x12'));var authService=require(_0xd188('0x13'));var qs=require(_0xd188('0x14'));var as=require(_0xd188('0x15'));var hardwareService=require(_0xd188('0x16'));var logger=require(_0xd188('0x17'))(_0xd188('0x18'));var utils=require(_0xd188('0x19'));var config=require(_0xd188('0x1a'));var licenseUtil=require(_0xd188('0x1b'));var db=require(_0xd188('0x1c'))['db'];function respondWithStatusCode(_0x2bdf5b,_0x4b929e){_0x4b929e=_0x4b929e||0xcc;return function(_0x44240a){if(_0x44240a){return _0x2bdf5b['sendStatus'](_0x4b929e);}return _0x2bdf5b[_0xd188('0x1d')](_0x4b929e)[_0xd188('0x1e')]();};}function respondWithResult(_0x4b43aa,_0x1aae4e){_0x1aae4e=_0x1aae4e||0xc8;return function(_0x5ee234){if(_0x5ee234){return _0x4b43aa[_0xd188('0x1d')](_0x1aae4e)[_0xd188('0x1f')](_0x5ee234);}};}function respondWithFilteredResult(_0x4c54a1,_0x1e591e){return function(_0x146b89){if(_0x146b89){var _0x17c2c6=typeof _0x1e591e['offset']===_0xd188('0x20')&&typeof _0x1e591e[_0xd188('0x21')]===_0xd188('0x20');var _0x4340eb=_0x146b89['count'];var _0x3c1f60=_0x17c2c6?0x0:_0x1e591e[_0xd188('0x22')];var _0x9d6e82=_0x17c2c6?_0x146b89[_0xd188('0x23')]:_0x1e591e[_0xd188('0x22')]+_0x1e591e[_0xd188('0x21')];var _0x2d2f3b;if(_0x9d6e82>=_0x4340eb){_0x9d6e82=_0x4340eb;_0x2d2f3b=0xc8;}else{_0x2d2f3b=0xce;}_0x4c54a1['status'](_0x2d2f3b);return _0x4c54a1[_0xd188('0x24')](_0xd188('0x25'),_0x3c1f60+'-'+_0x9d6e82+'/'+_0x4340eb)[_0xd188('0x1f')](_0x146b89);}return null;};}function patchUpdates(_0x5a051c){return function(_0x20c55d){try{jsonpatch[_0xd188('0x26')](_0x20c55d,_0x5a051c,!![]);}catch(_0xa35928){return BPromise[_0xd188('0x27')](_0xa35928);}return _0x20c55d[_0xd188('0x28')]();};}function saveUpdates(_0x196184,_0x1607e3){return function(_0x1a9d9f){if(_0x1a9d9f){return _0x1a9d9f[_0xd188('0x29')](_0x196184)[_0xd188('0x2a')](function(_0x57b1e8){return _0x57b1e8;});}return null;};}function removeEntity(_0x315314,_0x3ef04a){return function(_0xf93fc4){if(_0xf93fc4){return _0xf93fc4[_0xd188('0x2b')]()['then'](function(){_0x315314[_0xd188('0x1d')](0xcc)[_0xd188('0x1e')]();});}};}function handleEntityNotFound(_0x5d872d,_0x99e340){return function(_0x1bbfe5){if(!_0x1bbfe5){_0x5d872d[_0xd188('0x2c')](0x194);}return _0x1bbfe5;};}function handleError(_0x3eb366,_0xba36f5){_0xba36f5=_0xba36f5||0x1f4;return function(_0x4f7de9){logger[_0xd188('0x2d')](_0x4f7de9['stack']);if(_0x4f7de9[_0xd188('0x2e')]){delete _0x4f7de9['name'];}_0x3eb366[_0xd188('0x1d')](_0xba36f5)['send'](_0x4f7de9);};}var utilLicense=require(_0xd188('0x1b'));exports[_0xd188('0x2f')]=function(_0x3e683b,_0x329580){var _0x2628c6={'raw':!![],'where':{'id':0x1}},_0x58fe1a={};_0x58fe1a[_0xd188('0x30')]=_[_0xd188('0x31')](db[_0xd188('0x32')][_0xd188('0x33')]);_0x58fe1a[_0xd188('0x34')]=_[_0xd188('0x31')](_0x3e683b[_0xd188('0x34')]);_0x58fe1a['filters']=_[_0xd188('0x35')](_0x58fe1a[_0xd188('0x30')],_0x58fe1a[_0xd188('0x34')]);_0x2628c6[_0xd188('0x36')]=_[_0xd188('0x35')](_0x58fe1a[_0xd188('0x30')],qs['fields'](_0x3e683b[_0xd188('0x34')][_0xd188('0x37')]));_0x2628c6['attributes']=_0x2628c6[_0xd188('0x36')][_0xd188('0x38')]?_0x2628c6[_0xd188('0x36')]:_0x58fe1a[_0xd188('0x30')];_0x2628c6=_[_0xd188('0x39')]({},_0x2628c6,_0x3e683b[_0xd188('0x3a')]);return utilLicense[_0xd188('0x3b')](_0x2628c6)[_0xd188('0x2a')](respondWithResult(_0x329580,null))[_0xd188('0x3c')](handleError(_0x329580,null));};exports['update']=function(_0x586ff0,_0x7df5f6){if(_0x586ff0[_0xd188('0x3d')]['id']){delete _0x586ff0[_0xd188('0x3d')]['id'];}return db[_0xd188('0x32')]['find']({'where':{'id':_0x586ff0['params']['id']}})[_0xd188('0x2a')](handleEntityNotFound(_0x7df5f6,null))[_0xd188('0x2a')](function(_0x5036c0){var _0xc03e29=_0x5036c0[_0xd188('0x3e')]({'plain':!![]});return utilLicense[_0xd188('0x3f')](_0xc03e29,_0x586ff0[_0xd188('0x3d')][_0xd188('0x40')]);})[_0xd188('0x2a')](function(_0x495841){if(!_0x495841['demo']){return saveUpdates(_0x586ff0['body'],null);}return _0x495841;})['then'](respondWithResult(_0x7df5f6,null))['catch'](handleError(_0x7df5f6,null));};exports[_0xd188('0x41')]=function(_0x3a24e4,_0x234e4d){var _0x157c71=_0xd188('0x42');var _0x1c390f=path[_0xd188('0x43')](_0xd188('0x44'),_0xd188('0x45'),_0xd188('0x46'),_0x157c71);_0x234e4d[_0xd188('0x47')](_0xd188('0x48'),_0xd188('0x49')+_0x157c71);_0x234e4d[_0xd188('0x24')](_0xd188('0x4a'),'text/plain');_0x234e4d[_0xd188('0x4b')](_0x1c390f);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 9cd7b77..fac6e4c 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30ec=['../../config/environment','./license.attributes','exports','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2366ac,_0x2fff4c){var _0xf87f9b=function(_0x131ee6){while(--_0x131ee6){_0x2366ac['push'](_0x2366ac['shift']());}};_0xf87f9b(++_0x2fff4c);}(_0x30ec,0xf3));var _0xc30e=function(_0x50f9ab,_0x5009b4){_0x50f9ab=_0x50f9ab-0x0;var _0x58dda4=_0x30ec[_0x50f9ab];return _0x58dda4;};'use strict';var _=require(_0xc30e('0x0'));var util=require(_0xc30e('0x1'));var logger=require(_0xc30e('0x2'))(_0xc30e('0x3'));var moment=require(_0xc30e('0x4'));var BPromise=require(_0xc30e('0x5'));var rp=require(_0xc30e('0x6'));var fs=require('fs');var path=require(_0xc30e('0x7'));var rimraf=require(_0xc30e('0x8'));var config=require(_0xc30e('0x9'));var attributes=require(_0xc30e('0xa'));module[_0xc30e('0xb')]=function(_0x5909e4,_0x1232ee){return _0x5909e4['define'](_0xc30e('0xc'),attributes,{'tableName':_0xc30e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc2d=['request-promise','path','../../config/environment','./license.attributes','exports','define','License','lodash','api','bluebird'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xbc2d,0x10b));var _0xdbc2=function(_0xbf6fcd,_0x28f814){_0xbf6fcd=_0xbf6fcd-0x0;var _0x2da644=_0xbc2d[_0xbf6fcd];return _0x2da644;};'use strict';var _=require(_0xdbc2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbc2('0x1'));var moment=require('moment');var BPromise=require(_0xdbc2('0x2'));var rp=require(_0xdbc2('0x3'));var fs=require('fs');var path=require(_0xdbc2('0x4'));var rimraf=require('rimraf');var config=require(_0xdbc2('0x5'));var attributes=require(_0xdbc2('0x6'));module[_0xdbc2('0x7')]=function(_0x58aabe,_0x3ac65f){return _0x58aabe[_0xdbc2('0x8')](_0xdbc2('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index d1de24c..672916c 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6749=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3c5f20,_0x403b82){var _0x4cc9cf=function(_0x34fddc){while(--_0x34fddc){_0x3c5f20['push'](_0x3c5f20['shift']());}};_0x4cc9cf(++_0x403b82);}(_0x6749,0x6e));var _0x9674=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6749[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9674('0x0'));var util=require(_0x9674('0x1'));var moment=require(_0x9674('0x2'));var BPromise=require(_0x9674('0x3'));var rs=require(_0x9674('0x4'));var fs=require('fs');var Redis=require(_0x9674('0x5'));var db=require(_0x9674('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9674('0x7'))(_0x9674('0x8'));var config=require(_0x9674('0x9'));var jayson=require(_0x9674('0xa'));var client=jayson['client'][_0x9674('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1518c1,_0x3f9178,_0x1de3ce){return new BPromise(function(_0x4fe1e9,_0x5ad1e7){return client[_0x9674('0xc')](_0x1518c1,_0x1de3ce)['then'](function(_0x4d9686){logger[_0x9674('0xd')](_0x9674('0xe'),_0x3f9178,_0x9674('0xf'));logger[_0x9674('0x10')](_0x9674('0x11'),_0x3f9178,_0x9674('0xf'),JSON[_0x9674('0x12')](_0x4d9686));if(_0x4d9686[_0x9674('0x13')]){if(_0x4d9686['error']['code']===0x1f4){logger[_0x9674('0x13')](_0x9674('0xe'),_0x3f9178,_0x4d9686[_0x9674('0x13')][_0x9674('0x14')]);return _0x5ad1e7(_0x4d9686['error']['message']);}logger[_0x9674('0x13')](_0x9674('0xe'),_0x3f9178,_0x4d9686[_0x9674('0x13')][_0x9674('0x14')]);return _0x4fe1e9(_0x4d9686['error'][_0x9674('0x14')]);}else{logger[_0x9674('0xd')](_0x9674('0xe'),_0x3f9178,_0x9674('0xf'));_0x4fe1e9(_0x4d9686[_0x9674('0x15')][_0x9674('0x14')]);}})[_0x9674('0x16')](function(_0x472b1e){logger['error'](_0x9674('0xe'),_0x3f9178,_0x472b1e);_0x5ad1e7(_0x472b1e);});});} \ No newline at end of file +var _0x9dea=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ce4b1,_0x151bd3){var _0xefb3c0=function(_0x44eb3e){while(--_0x44eb3e){_0x5ce4b1['push'](_0x5ce4b1['shift']());}};_0xefb3c0(++_0x151bd3);}(_0x9dea,0x1f3));var _0xa9de=function(_0x4189b5,_0x1c5416){_0x4189b5=_0x4189b5-0x0;var _0x4dc46b=_0x9dea[_0x4189b5];return _0x4dc46b;};'use strict';var _=require(_0xa9de('0x0'));var util=require(_0xa9de('0x1'));var moment=require('moment');var BPromise=require(_0xa9de('0x2'));var rs=require(_0xa9de('0x3'));var fs=require('fs');var Redis=require(_0xa9de('0x4'));var db=require(_0xa9de('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa9de('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa9de('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464cca,_0x4ff3b7,_0x17cc76){return new BPromise(function(_0x4601cb,_0x4579a7){return client[_0xa9de('0x8')](_0x464cca,_0x17cc76)[_0xa9de('0x9')](function(_0xc065af){logger[_0xa9de('0xa')](_0xa9de('0xb'),_0x4ff3b7,_0xa9de('0xc'));logger[_0xa9de('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x4ff3b7,_0xa9de('0xc'),JSON[_0xa9de('0xe')](_0xc065af));if(_0xc065af[_0xa9de('0xf')]){if(_0xc065af['error']['code']===0x1f4){logger[_0xa9de('0xf')](_0xa9de('0xb'),_0x4ff3b7,_0xc065af['error']['message']);return _0x4579a7(_0xc065af[_0xa9de('0xf')][_0xa9de('0x10')]);}logger[_0xa9de('0xf')]('License,\x20%s,\x20%s',_0x4ff3b7,_0xc065af[_0xa9de('0xf')][_0xa9de('0x10')]);return _0x4601cb(_0xc065af['error'][_0xa9de('0x10')]);}else{logger['info'](_0xa9de('0xb'),_0x4ff3b7,_0xa9de('0xc'));_0x4601cb(_0xc065af[_0xa9de('0x11')][_0xa9de('0x10')]);}})[_0xa9de('0x12')](function(_0x1e3a95){logger['error'](_0xa9de('0xb'),_0x4ff3b7,_0x1e3a95);_0x4579a7(_0x1e3a95);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index d4ec45a..38e6208 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ff9=['/:id/out_servers','destroy','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addImap','addSmtp','addInteraction','addApplications','/:id/send','/:id/users','put','delete','removeDispositions','removeImap'];(function(_0x15f523,_0x5d55bf){var _0x30c5e9=function(_0x215633){while(--_0x215633){_0x15f523['push'](_0x15f523['shift']());}};_0x30c5e9(++_0x5d55bf);}(_0x0ff9,0xe4));var _0x90ff=function(_0x590c43,_0x64efa6){_0x590c43=_0x590c43-0x0;var _0xdfffcd=_0x0ff9[_0x590c43];return _0xdfffcd;};'use strict';var multer=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var path=require(_0x90ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x90ff('0x3'));var router=express[_0x90ff('0x4')]();var fs_extra=require(_0x90ff('0x5'));var auth=require(_0x90ff('0x6'));var interaction=require(_0x90ff('0x7'));var config=require(_0x90ff('0x8'));var controller=require(_0x90ff('0x9'));router[_0x90ff('0xa')]('/',auth[_0x90ff('0xb')](),controller[_0x90ff('0xc')]);router['get'](_0x90ff('0xd'),auth[_0x90ff('0xb')](),controller[_0x90ff('0xe')]);router[_0x90ff('0xa')](_0x90ff('0xf'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x10')]);router[_0x90ff('0xa')](_0x90ff('0x11'),auth[_0x90ff('0xb')](),controller['getDispositions']);router[_0x90ff('0xa')](_0x90ff('0x12'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x13')]);router[_0x90ff('0xa')](_0x90ff('0x14'),auth['isAuthenticated'](),controller[_0x90ff('0x15')]);router['get']('/:id/out_servers',auth[_0x90ff('0xb')](),controller[_0x90ff('0x16')]);router[_0x90ff('0xa')](_0x90ff('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x90ff('0xa')](_0x90ff('0x18'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x19')]);router[_0x90ff('0xa')](_0x90ff('0x1a'),auth['isAuthenticated'](),controller[_0x90ff('0x1b')]);router[_0x90ff('0xa')](_0x90ff('0x1c'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x1d')]);router[_0x90ff('0xa')]('/:id/users',auth[_0x90ff('0xb')](),controller[_0x90ff('0x1e')]);router[_0x90ff('0x1f')](_0x90ff('0x11'),auth[_0x90ff('0xb')](),controller['addDisposition']);router[_0x90ff('0x1f')](_0x90ff('0x12'),auth[_0x90ff('0xb')](),controller['addAnswer']);router[_0x90ff('0x1f')]('/',auth['isAuthenticated'](),controller['create']);router[_0x90ff('0x1f')](_0x90ff('0x14'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x20')]);router[_0x90ff('0x1f')]('/:id/out_servers',auth[_0x90ff('0xb')](),controller[_0x90ff('0x21')]);router[_0x90ff('0x1f')](_0x90ff('0x17'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x22')]);router[_0x90ff('0x1f')]('/:id/applications',auth[_0x90ff('0xb')](),controller[_0x90ff('0x23')]);router[_0x90ff('0x1f')](_0x90ff('0x24'),auth[_0x90ff('0xb')](),controller['send']);router[_0x90ff('0x1f')](_0x90ff('0x25'),auth[_0x90ff('0xb')](),controller['addAgents']);router[_0x90ff('0x26')]('/:id',auth[_0x90ff('0xb')](),controller['update']);router[_0x90ff('0x27')](_0x90ff('0x11'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x28')]);router[_0x90ff('0x27')](_0x90ff('0x12'),auth[_0x90ff('0xb')](),controller['removeAnswers']);router[_0x90ff('0x27')]('/:id/in_servers',auth[_0x90ff('0xb')](),controller[_0x90ff('0x29')]);router[_0x90ff('0x27')](_0x90ff('0x2a'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0x90ff('0x27')](_0x90ff('0xf'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x2b')]);router[_0x90ff('0x27')](_0x90ff('0x25'),auth[_0x90ff('0xb')](),controller[_0x90ff('0x2c')]);module['exports']=router; \ No newline at end of file +var _0xd46f=['/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','/describe','isAuthenticated','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp'];(function(_0x2029f7,_0x53b3f1){var _0x5c6c6f=function(_0x22836a){while(--_0x22836a){_0x2029f7['push'](_0x2029f7['shift']());}};_0x5c6c6f(++_0x53b3f1);}(_0xd46f,0x115));var _0xfd46=function(_0x5267ec,_0x51f33b){_0x5267ec=_0x5267ec-0x0;var _0x1c68b0=_0xd46f[_0x5267ec];return _0x1c68b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd46('0x0'));var timeout=require(_0xfd46('0x1'));var express=require(_0xfd46('0x2'));var router=express[_0xfd46('0x3')]();var fs_extra=require(_0xfd46('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd46('0x5'));var controller=require('./mailAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfd46('0x6')]);router['get'](_0xfd46('0x7'),auth[_0xfd46('0x8')](),controller['describe']);router[_0xfd46('0x9')](_0xfd46('0xa'),auth[_0xfd46('0x8')](),controller[_0xfd46('0xb')]);router[_0xfd46('0x9')](_0xfd46('0xc'),auth[_0xfd46('0x8')](),controller['getDispositions']);router[_0xfd46('0x9')](_0xfd46('0xd'),auth[_0xfd46('0x8')](),controller[_0xfd46('0xe')]);router[_0xfd46('0x9')](_0xfd46('0xf'),auth['isAuthenticated'](),controller[_0xfd46('0x10')]);router[_0xfd46('0x9')]('/:id/out_servers',auth[_0xfd46('0x8')](),controller[_0xfd46('0x11')]);router[_0xfd46('0x9')](_0xfd46('0x12'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x13')]);router[_0xfd46('0x9')](_0xfd46('0x14'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x15')]);router['get']('/:id/messages',auth[_0xfd46('0x8')](),controller['getMessages']);router[_0xfd46('0x9')](_0xfd46('0x16'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x17')]);router[_0xfd46('0x9')](_0xfd46('0x18'),auth['isAuthenticated'](),controller[_0xfd46('0x19')]);router[_0xfd46('0x1a')](_0xfd46('0xc'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x1b')]);router[_0xfd46('0x1a')](_0xfd46('0xd'),auth['isAuthenticated'](),controller[_0xfd46('0x1c')]);router[_0xfd46('0x1a')]('/',auth[_0xfd46('0x8')](),controller[_0xfd46('0x1d')]);router[_0xfd46('0x1a')](_0xfd46('0xf'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x1e')]);router[_0xfd46('0x1a')]('/:id/out_servers',auth[_0xfd46('0x8')](),controller[_0xfd46('0x1f')]);router[_0xfd46('0x1a')](_0xfd46('0x12'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x20')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xfd46('0x21')]);router[_0xfd46('0x1a')](_0xfd46('0x22'),auth[_0xfd46('0x8')](),controller['send']);router[_0xfd46('0x1a')](_0xfd46('0x18'),auth['isAuthenticated'](),controller[_0xfd46('0x23')]);router['put'](_0xfd46('0xa'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x24')]);router[_0xfd46('0x25')](_0xfd46('0xc'),auth['isAuthenticated'](),controller[_0xfd46('0x26')]);router[_0xfd46('0x25')](_0xfd46('0xd'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x27')]);router[_0xfd46('0x25')](_0xfd46('0xf'),auth['isAuthenticated'](),controller[_0xfd46('0x28')]);router[_0xfd46('0x25')](_0xfd46('0x29'),auth[_0xfd46('0x8')](),controller['removeSmtp']);router[_0xfd46('0x25')]('/:id',auth[_0xfd46('0x8')](),controller['destroy']);router['delete'](_0xfd46('0x18'),auth[_0xfd46('0x8')](),controller['removeAgents']);module[_0xfd46('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 619505c..543b10a 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d01=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','hotmail','yahoo','custom','getDataValue','provider','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x360f76,_0x2a1361){var _0x4c3d88=function(_0x3e5ab1){while(--_0x3e5ab1){_0x360f76['push'](_0x360f76['shift']());}};_0x4c3d88(++_0x2a1361);}(_0x4d01,0x108));var _0x14d0=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x4d01[_0x37ffea];return _0x2e2615;};'use strict';var Sequelize=require('sequelize');module[_0x14d0('0x0')]={'description':{'type':Sequelize[_0x14d0('0x1')]},'name':{'type':Sequelize[_0x14d0('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x14d0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x14d0('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x14d0('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x14d0('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x14d0('0x3')]},'markAsUnread':{'type':Sequelize[_0x14d0('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x14d0('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x14d0('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x14d0('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x14d0('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x14d0('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x14d0('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x14d0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x14d0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x14d0('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x14d0('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x14d0('0x8'),'set':function(_0x5df389){if(!_0x5df389)this[_0x14d0('0x9')](_0x14d0('0xa'),null);this[_0x14d0('0x9')]('mandatoryDisposition',_0x5df389);}},'provider':{'type':Sequelize[_0x14d0('0xb')]('gmail',_0x14d0('0xc'),_0x14d0('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0x14d0('0xe');return this[_0x14d0('0xf')](_0x14d0('0x10'));},'set':function(_0x79d15f){if(_0x79d15f===_0x14d0('0xe'))_0x79d15f=null;return this[_0x14d0('0x9')]('provider',_0x79d15f);}}}; \ No newline at end of file +var _0x70d6=['setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x509083,_0xa6676b){var _0x4b2495=function(_0x2a14f5){while(--_0x2a14f5){_0x509083['push'](_0x509083['shift']());}};_0x4b2495(++_0xa6676b);}(_0x70d6,0xa9));var _0x670d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x70d6[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x670d('0x0'));module[_0x670d('0x1')]={'description':{'type':Sequelize[_0x670d('0x2')]},'name':{'type':Sequelize[_0x670d('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x670d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x670d('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x670d('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x670d('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x670d('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x670d('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x670d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x670d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x670d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![],'comment':_0x670d('0x6'),'set':function(_0x585890){if(!_0x585890)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x670d('0x7')](_0x670d('0x8'),_0x585890);}},'provider':{'type':Sequelize[_0x670d('0x9')](_0x670d('0xa'),_0x670d('0xb'),_0x670d('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x670d('0xd')](_0x670d('0xe')))return _0x670d('0xf');return this[_0x670d('0xd')](_0x670d('0xe'));},'set':function(_0xf94023){if(_0xf94023===_0x670d('0xf'))_0xf94023=null;return this[_0x670d('0x7')]('provider',_0xf94023);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4d7df6f..66afe58 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde64=['ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','removeAgents','emit','userMailAccount:remove','getAgents','moment','util','lodash','../../config/logger','api','../../config/environment','../../mysqldb','localhost','redis','./mailAccount.socket','register','jayson/promise','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','outlook365','user','username','password','pass','modernAuthentication','CloudProviderId','host','secure','service','authentication','Imap','port','Smtp','index','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','show','params','MailServerIn','MailServerOut','includeAll','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','merge','findAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','create','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','MailMessage','inlineCss','true','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Messages','verifySmtp','VerifySmtp','Sequelize'];(function(_0x55bd29,_0x246900){var _0x413176=function(_0x53ec79){while(--_0x53ec79){_0x55bd29['push'](_0x55bd29['shift']());}};_0x413176(++_0x246900);}(_0xde64,0x197));var _0x4de6=function(_0x55d794,_0x4fe9d6){_0x55d794=_0x55d794-0x0;var _0x30e751=_0xde64[_0x55d794];return _0x30e751;};'use strict';var moment=require(_0x4de6('0x0'));var BPromise=require('bluebird');var util=require(_0x4de6('0x1'));var path=require('path');var _=require(_0x4de6('0x2'));var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x4de6('0x3'))(_0x4de6('0x4'));var config=require(_0x4de6('0x5'));var db=require(_0x4de6('0x6'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4de6('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4de6('0x8')]));require(_0x4de6('0x9'))[_0x4de6('0xa')](socket);var jayson=require(_0x4de6('0xb'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x488cdb,_0x4cb55d,_0x3633ba,_0x463dfa){return new BPromise(function(_0x267aa1,_0x1cc82a){var _0x3c808e=_0x463dfa||client;return _0x3c808e[_0x4de6('0xc')](_0x488cdb,_0x3633ba)[_0x4de6('0xd')](function(_0x2ff489){logger[_0x4de6('0xe')](_0x4de6('0xf'),_0x4cb55d,_0x4de6('0x10'));logger[_0x4de6('0x11')](_0x4de6('0x12'),_0x4cb55d,_0x4de6('0x10'),JSON[_0x4de6('0x13')](_0x2ff489));if(_0x2ff489[_0x4de6('0x14')]){if(_0x2ff489['error'][_0x4de6('0x15')]===0x1f4){logger[_0x4de6('0x14')](_0x4de6('0xf'),_0x4cb55d,_0x2ff489[_0x4de6('0x14')]['message']);return _0x1cc82a(_0x2ff489['error'][_0x4de6('0x16')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x4cb55d,_0x2ff489[_0x4de6('0x14')][_0x4de6('0x16')]);return _0x267aa1(_0x2ff489[_0x4de6('0x14')][_0x4de6('0x16')]);}else{logger[_0x4de6('0xe')](_0x4de6('0xf'),_0x4cb55d,_0x4de6('0x10'));_0x267aa1(_0x2ff489[_0x4de6('0x17')][_0x4de6('0x16')]);}})[_0x4de6('0x18')](function(_0x4f9558){logger[_0x4de6('0x14')](_0x4de6('0xf'),_0x4cb55d,_0x4f9558);_0x1cc82a(_0x4f9558);});});}function respondWithStatusCode(_0x3d706b,_0xcb831){_0xcb831=_0xcb831||0xcc;return function(_0x52e145){if(_0x52e145){return _0x3d706b[_0x4de6('0x19')](_0xcb831);}return _0x3d706b[_0x4de6('0x1a')](_0xcb831)[_0x4de6('0x1b')]();};}function respondWithResult(_0x25f267,_0x77ab46){_0x77ab46=_0x77ab46||0xc8;return function(_0x47c757){if(_0x47c757){return _0x25f267[_0x4de6('0x1a')](_0x77ab46)['json'](_0x47c757);}};}function respondWithFilteredResult(_0xfdb169,_0x52b042){return function(_0x1a2797){if(_0x1a2797){var _0x22c257=typeof _0x52b042[_0x4de6('0x1c')]===_0x4de6('0x1d')&&typeof _0x52b042[_0x4de6('0x1e')]===_0x4de6('0x1d');var _0x204526=_0x1a2797[_0x4de6('0x1f')];var _0x21335b=_0x22c257?0x0:_0x52b042[_0x4de6('0x1c')];var _0x5d9315=_0x22c257?_0x1a2797[_0x4de6('0x1f')]:_0x52b042[_0x4de6('0x1c')]+_0x52b042['limit'];var _0x37bd27;if(_0x5d9315>=_0x204526){_0x5d9315=_0x204526;_0x37bd27=0xc8;}else{_0x37bd27=0xce;}_0xfdb169[_0x4de6('0x1a')](_0x37bd27);return _0xfdb169[_0x4de6('0x20')](_0x4de6('0x21'),_0x21335b+'-'+_0x5d9315+'/'+_0x204526)[_0x4de6('0x22')](_0x1a2797);}return null;};}function saveUpdates(_0x208b03){return function(_0x5e0638){if(_0x5e0638){return _0x5e0638[_0x4de6('0x23')](_0x208b03)[_0x4de6('0xd')](function(_0xc76977){return _0xc76977;});}return null;};}function removeEntity(_0xa1f1e0){return function(_0x58d301){if(_0x58d301){return _0x58d301[_0x4de6('0x24')]()['then'](function(){var _0x158ab0=_0x58d301[_0x4de6('0x25')]({'plain':!![]});var _0x37e2ef=_0x4de6('0x26');return db[_0x4de6('0x27')]['destroy']({'where':{'type':_0x37e2ef,'resourceId':_0x158ab0['id']}})[_0x4de6('0xd')](function(){return _0x58d301;});})[_0x4de6('0xd')](function(){_0xa1f1e0['status'](0xcc)[_0x4de6('0x1b')]();});}};}function handleEntityNotFound(_0x1ed6b2){return function(_0x26dcf9){if(!_0x26dcf9){_0x1ed6b2['sendStatus'](0x194);}return _0x26dcf9;};}function handleError(_0x428351,_0x3b0cd2){_0x3b0cd2=_0x3b0cd2||0x1f4;return function(_0x56547b){logger[_0x4de6('0x14')](_0x56547b[_0x4de6('0x28')]);if(_0x56547b[_0x4de6('0x29')]){delete _0x56547b[_0x4de6('0x29')];}_0x428351['status'](_0x3b0cd2)[_0x4de6('0x2a')](_0x56547b);};}function getImapHost(_0x8f95f5){switch(_0x8f95f5){case _0x4de6('0x2b'):return _0x4de6('0x2c');case _0x4de6('0x2d'):return _0x4de6('0x2e');case _0x4de6('0x2f'):return _0x4de6('0x30');case'outlook365':return _0x4de6('0x31');}throw new Error(_0x4de6('0x32'),_0x8f95f5);}function getSmtpHost(_0x5795d2){switch(_0x5795d2){case _0x4de6('0x2b'):return _0x4de6('0x33');case _0x4de6('0x2d'):return'smtp.mail.yahoo.com';case _0x4de6('0x2f'):return'smtp-mail.outlook.com';case _0x4de6('0x34'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x5795d2);}function getAuthenticationOptions(_0x2b5fc7,_0x455c73){var _0x1aa5ce={};var _0x464737={};if(_0x2b5fc7){_0x1aa5ce[_0x4de6('0x35')]=_0x464737[_0x4de6('0x35')]=_0x455c73[_0x4de6('0x36')];_0x1aa5ce[_0x4de6('0x37')]=_0x464737[_0x4de6('0x38')]=_0x455c73[_0x4de6('0x37')];if(_0x455c73[_0x4de6('0x39')]){_0x1aa5ce[_0x4de6('0x39')]=_0x464737['modernAuthentication']=!![];_0x1aa5ce[_0x4de6('0x3a')]=_0x464737[_0x4de6('0x3a')]=_0x455c73[_0x4de6('0x3a')];_0x1aa5ce['password']=_0x464737[_0x4de6('0x38')]=null;}else{_0x1aa5ce[_0x4de6('0x3a')]=_0x464737[_0x4de6('0x3a')]=null;}_0x1aa5ce['host']=getImapHost(_0x2b5fc7);_0x1aa5ce['port']=0x3e1;_0x464737[_0x4de6('0x3b')]=getSmtpHost(_0x2b5fc7);_0x464737['port']=0x24b;_0x464737[_0x4de6('0x3c')]=![];_0x1aa5ce[_0x4de6('0x3d')]=_0x464737[_0x4de6('0x3d')]=null;}else{if(_0x455c73[_0x4de6('0x3e')]){_0x1aa5ce[_0x4de6('0x35')]=_0x464737[_0x4de6('0x35')]=_0x455c73['username'];_0x1aa5ce['password']=_0x464737[_0x4de6('0x38')]=_0x455c73[_0x4de6('0x37')];}else{_0x1aa5ce[_0x4de6('0x3e')]=_0x464737['authentication']=![];_0x1aa5ce[_0x4de6('0x35')]=_0x464737['user']=null;_0x1aa5ce[_0x4de6('0x37')]=_0x464737['pass']=null;}_0x1aa5ce[_0x4de6('0x3b')]=_0x455c73[_0x4de6('0x3f')][_0x4de6('0x3b')];_0x1aa5ce[_0x4de6('0x40')]=_0x455c73[_0x4de6('0x3f')][_0x4de6('0x40')];_0x464737[_0x4de6('0x3b')]=_0x455c73[_0x4de6('0x41')][_0x4de6('0x3b')];_0x464737[_0x4de6('0x40')]=_0x455c73[_0x4de6('0x41')][_0x4de6('0x40')];}return{'Imap':_0x1aa5ce,'Smtp':_0x464737};}exports[_0x4de6('0x42')]=function(_0x237318,_0x4e5517){var _0x5df1fd={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x4de6('0x41')},{'model':db[_0x4de6('0x43')],'as':_0x4de6('0x44')}]},_0x31c4f3={},_0x48e092={'count':0x0,'rows':[]};var _0x359974=_[_0x4de6('0x45')](db[_0x4de6('0x46')][_0x4de6('0x47')],function(_0x5142aa){return{'name':_0x5142aa[_0x4de6('0x48')],'type':_0x5142aa[_0x4de6('0x49')]['key']};});_0x31c4f3[_0x4de6('0x4a')]=_[_0x4de6('0x45')](_0x359974,_0x4de6('0x29'));_0x31c4f3['query']=_[_0x4de6('0x4b')](_0x237318['query']);_0x31c4f3[_0x4de6('0x4c')]=_[_0x4de6('0x4d')](_0x31c4f3[_0x4de6('0x4a')],_0x31c4f3['query']);_0x5df1fd[_0x4de6('0x4e')]=_[_0x4de6('0x4d')](_0x31c4f3[_0x4de6('0x4a')],qs[_0x4de6('0x4f')](_0x237318[_0x4de6('0x50')]['fields']));_0x5df1fd[_0x4de6('0x4e')]=_0x5df1fd[_0x4de6('0x4e')][_0x4de6('0x51')]?_0x5df1fd[_0x4de6('0x4e')]:_0x31c4f3[_0x4de6('0x4a')];if(!_0x237318[_0x4de6('0x50')][_0x4de6('0x52')](_0x4de6('0x53'))){_0x5df1fd[_0x4de6('0x1e')]=qs['limit'](_0x237318[_0x4de6('0x50')][_0x4de6('0x1e')]);_0x5df1fd['offset']=qs['offset'](_0x237318[_0x4de6('0x50')][_0x4de6('0x1c')]);}_0x5df1fd[_0x4de6('0x54')]=qs[_0x4de6('0x55')](_0x237318['query']['sort']);_0x5df1fd[_0x4de6('0x56')]=qs[_0x4de6('0x4c')](_[_0x4de6('0x57')](_0x237318[_0x4de6('0x50')],_0x31c4f3[_0x4de6('0x4c')]),_0x359974);if(_0x237318[_0x4de6('0x50')][_0x4de6('0x58')]){_0x5df1fd[_0x4de6('0x56')]=_['merge'](_0x5df1fd['where'],{'$or':_['map'](_0x359974,function(_0x23e9d9){if(_0x23e9d9[_0x4de6('0x49')]!==_0x4de6('0x59')){var _0x411839={};_0x411839[_0x23e9d9[_0x4de6('0x29')]]={'$like':'%'+_0x237318[_0x4de6('0x50')]['filter']+'%'};return _0x411839;}})});}_0x5df1fd=_['merge']({},_0x5df1fd,_0x237318[_0x4de6('0x5a')]);var _0x44f075={'where':_0x5df1fd[_0x4de6('0x56')]};return db[_0x4de6('0x46')][_0x4de6('0x1f')](_0x44f075)[_0x4de6('0xd')](function(_0x36bc51){_0x48e092[_0x4de6('0x1f')]=_0x36bc51;if(_0x237318[_0x4de6('0x50')]['includeAll']){_0x5df1fd[_0x4de6('0x5b')]=[{'all':!![]}];}return db[_0x4de6('0x46')]['findAll'](_0x5df1fd);})[_0x4de6('0xd')](function(_0x33b1c4){_0x48e092['rows']=_0x33b1c4;return _0x48e092;})[_0x4de6('0xd')](respondWithFilteredResult(_0x4e5517,_0x5df1fd))[_0x4de6('0x18')](handleError(_0x4e5517,null));};exports[_0x4de6('0x5c')]=function(_0x1fb71f,_0x571f30){var _0x4e6d2e={'raw':![],'where':{'id':_0x1fb71f[_0x4de6('0x5d')]['id']},'include':[{'model':db[_0x4de6('0x5e')],'as':_0x4de6('0x3f')},{'model':db[_0x4de6('0x5f')],'as':_0x4de6('0x41')},{'model':db['Pause'],'as':_0x4de6('0x44')}]},_0x35eae8={};_0x35eae8[_0x4de6('0x4a')]=_[_0x4de6('0x4b')](db[_0x4de6('0x46')][_0x4de6('0x47')]);_0x35eae8[_0x4de6('0x50')]=_[_0x4de6('0x4b')](_0x1fb71f[_0x4de6('0x50')]);_0x35eae8[_0x4de6('0x4c')]=_['intersection'](_0x35eae8['model'],_0x35eae8[_0x4de6('0x50')]);_0x4e6d2e[_0x4de6('0x4e')]=_[_0x4de6('0x4d')](_0x35eae8[_0x4de6('0x4a')],qs['fields'](_0x1fb71f[_0x4de6('0x50')][_0x4de6('0x4f')]));_0x4e6d2e[_0x4de6('0x4e')]=_0x4e6d2e[_0x4de6('0x4e')][_0x4de6('0x51')]?_0x4e6d2e[_0x4de6('0x4e')]:_0x35eae8['model'];if(_0x1fb71f[_0x4de6('0x50')][_0x4de6('0x60')]){_0x4e6d2e[_0x4de6('0x5b')]=[{'all':!![]}];}_0x4e6d2e=_['merge']({},_0x4e6d2e,_0x1fb71f[_0x4de6('0x5a')]);return db[_0x4de6('0x46')][_0x4de6('0x61')](_0x4e6d2e)['then'](handleEntityNotFound(_0x571f30,null))[_0x4de6('0xd')](respondWithResult(_0x571f30,null))[_0x4de6('0x18')](handleError(_0x571f30,null));};exports[_0x4de6('0x23')]=function(_0x2c4300,_0x704239){if(_0x2c4300['body']['id']){delete _0x2c4300[_0x4de6('0x62')]['id'];}var _0x116b33=_0x2c4300['body'][_0x4de6('0x63')]===_0x4de6('0x64')?null:_0x2c4300[_0x4de6('0x62')]['provider'];var _0x3dcdbc=_0x2c4300[_0x4de6('0x62')][_0x4de6('0x3f')]||{};var _0x4fa739=_0x2c4300['body'][_0x4de6('0x41')]||{};if(_0x116b33){_0x3dcdbc[_0x4de6('0x3b')]=getImapHost(_0x116b33);_0x3dcdbc[_0x4de6('0x40')]=0x3e1;_0x4fa739[_0x4de6('0x3b')]=getSmtpHost(_0x116b33);_0x4fa739[_0x4de6('0x40')]=0x24b;_0x4fa739[_0x4de6('0x3c')]=![];}if(_0x4fa739[_0x4de6('0x39')]){_0x4fa739['secure']=![];}else{_0x4fa739[_0x4de6('0x3a')]=null;}if(!_0x3dcdbc[_0x4de6('0x39')])_0x3dcdbc['CloudProviderId']=null;_0x2c4300[_0x4de6('0x62')][_0x4de6('0x3f')]=_0x3dcdbc;_0x2c4300['body'][_0x4de6('0x41')]=_0x4fa739;return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x2c4300[_0x4de6('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x4de6('0x5f')],'as':_0x4de6('0x41')},{'model':db[_0x4de6('0x43')],'as':_0x4de6('0x44')}]})['then'](handleEntityNotFound(_0x704239,null))[_0x4de6('0xd')](function(_0x1408a8){if(!_0x1408a8)throw new Error(_0x4de6('0x65'));if(_0x1408a8['service'])delete _0x2c4300[_0x4de6('0x62')][_0x4de6('0x3f')];return _0x1408a8;})['then'](saveUpdates(_0x2c4300[_0x4de6('0x62')],null))['then'](function(_0x25e7b9){if(!_0x2c4300[_0x4de6('0x62')][_0x4de6('0x3f')])return _0x25e7b9;return db[_0x4de6('0x5e')]['update'](_0x2c4300[_0x4de6('0x62')][_0x4de6('0x3f')],{'where':{'MailAccountId':_0x25e7b9['id']}})[_0x4de6('0xd')](function(){return _0x25e7b9;});})[_0x4de6('0xd')](function(_0x3b4b2e){if(!_0x2c4300[_0x4de6('0x62')][_0x4de6('0x41')])return _0x3b4b2e;return db['MailServerOut'][_0x4de6('0x23')](_0x2c4300[_0x4de6('0x62')][_0x4de6('0x41')],{'where':{'MailAccountId':_0x3b4b2e['id']}})[_0x4de6('0xd')](function(){return _0x3b4b2e;});})[_0x4de6('0xd')](respondWithResult(_0x704239,null))['catch'](handleError(_0x704239,null));};exports[_0x4de6('0x66')]=function(_0x1ad0de,_0x1e17f1){return db[_0x4de6('0x46')][_0x4de6('0x66')]()['then'](respondWithResult(_0x1e17f1,null))['catch'](handleError(_0x1e17f1,null));};exports[_0x4de6('0x67')]=function(_0x202035,_0x3205f5){if(_0x202035[_0x4de6('0x62')]['id']){delete _0x202035[_0x4de6('0x62')]['id'];}return db['MailAccount'][_0x4de6('0x61')]({'where':{'id':_0x202035[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x3205f5,null))[_0x4de6('0xd')](function(_0x2dbada){if(_0x2dbada){_0x202035[_0x4de6('0x62')][_0x4de6('0x68')]=_0x2dbada['id'];return db[_0x4de6('0x69')]['create'](_0x202035[_0x4de6('0x62')]);}})[_0x4de6('0xd')](respondWithResult(_0x3205f5,null))['catch'](handleError(_0x3205f5,null));};exports[_0x4de6('0x6a')]=function(_0x4bdd4c,_0x130ce9){var _0xe2d299={'raw':![],'where':{}};var _0x3f64ad={};var _0xfd8062={'count':0x0,'rows':[]};return db[_0x4de6('0x46')][_0x4de6('0x6b')]({'where':{'id':_0x4bdd4c['params']['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x130ce9,null))[_0x4de6('0xd')](function(_0x5b700e){if(_0x5b700e){_0x3f64ad['model']=_['keys'](db[_0x4de6('0x69')][_0x4de6('0x47')]);_0x3f64ad[_0x4de6('0x50')]=_[_0x4de6('0x4b')](_0x4bdd4c['query']);_0x3f64ad[_0x4de6('0x4c')]=_['intersection'](_0x3f64ad[_0x4de6('0x4a')],_0x3f64ad[_0x4de6('0x50')]);_0xe2d299[_0x4de6('0x4e')]=_['intersection'](_0x3f64ad[_0x4de6('0x4a')],qs[_0x4de6('0x4f')](_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x4f')]));_0xe2d299[_0x4de6('0x4e')]=_0xe2d299[_0x4de6('0x4e')]['length']?_0xe2d299[_0x4de6('0x4e')]:_0x3f64ad[_0x4de6('0x4a')];if(!_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x52')](_0x4de6('0x53'))){_0xe2d299[_0x4de6('0x1e')]=qs[_0x4de6('0x1e')](_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x1e')]);_0xe2d299['offset']=qs[_0x4de6('0x1c')](_0x4bdd4c['query'][_0x4de6('0x1c')]);}_0xe2d299[_0x4de6('0x54')]=qs['sort'](_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x55')]);_0xe2d299[_0x4de6('0x56')]=qs[_0x4de6('0x4c')](_[_0x4de6('0x57')](_0x4bdd4c[_0x4de6('0x50')],_0x3f64ad['filters']));_0xe2d299['where'][_0x4de6('0x68')]=_0x5b700e['id'];if(_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x58')]){_0xe2d299['where']=_['merge'](_0xe2d299[_0x4de6('0x56')],{'$or':_['map'](_0xe2d299['attributes'],function(_0x384b99){var _0x586f64={};_0x586f64[_0x384b99]={'$like':'%'+_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x58')]+'%'};return _0x586f64;})});}_0xe2d299=_[_0x4de6('0x6c')]({},_0xe2d299,_0x4bdd4c[_0x4de6('0x5a')]);return db[_0x4de6('0x69')][_0x4de6('0x1f')]({'where':_0xe2d299['where']})[_0x4de6('0xd')](function(_0x2ce982){_0xfd8062[_0x4de6('0x1f')]=_0x2ce982;if(_0x4bdd4c[_0x4de6('0x50')][_0x4de6('0x60')]){_0xe2d299[_0x4de6('0x5b')]=[{'all':!![]}];}return db[_0x4de6('0x69')][_0x4de6('0x6d')](_0xe2d299);})['then'](function(_0x51fbf2){_0xfd8062[_0x4de6('0x6e')]=_0x51fbf2;return _0xfd8062;});}})[_0x4de6('0xd')](respondWithFilteredResult(_0x130ce9,_0xe2d299))[_0x4de6('0x18')](handleError(_0x130ce9,null));};exports[_0x4de6('0x6f')]=function(_0x503e12,_0x59ab59){return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x503e12[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x59ab59,null))['then'](function(_0x583e6b){if(_0x583e6b){return _0x583e6b[_0x4de6('0x6f')](_0x503e12[_0x4de6('0x50')][_0x4de6('0x70')]);}})[_0x4de6('0xd')](respondWithStatusCode(_0x59ab59,null))[_0x4de6('0x18')](handleError(_0x59ab59,null));};exports[_0x4de6('0x71')]=function(_0x586f3b,_0x486007){if(_0x586f3b[_0x4de6('0x62')]['id']){delete _0x586f3b[_0x4de6('0x62')]['id'];}return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x586f3b[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x486007,null))[_0x4de6('0xd')](function(_0x2d9269){if(_0x2d9269){_0x586f3b['body']['MailAccountId']=_0x2d9269['id'];return db['CannedAnswer']['create'](_0x586f3b[_0x4de6('0x62')]);}})[_0x4de6('0xd')](respondWithResult(_0x486007,null))[_0x4de6('0x18')](handleError(_0x486007,null));};exports[_0x4de6('0x72')]=function(_0x1bdb39,_0x50b004){var _0x1bd743={'raw':![],'where':{}};var _0x2afadb={};var _0x2c9abb={'count':0x0,'rows':[]};return db['MailAccount'][_0x4de6('0x6b')]({'where':{'id':_0x1bdb39[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x50b004,null))[_0x4de6('0xd')](function(_0x17e073){if(_0x17e073){_0x2afadb['model']=_[_0x4de6('0x4b')](db[_0x4de6('0x73')][_0x4de6('0x47')]);_0x2afadb[_0x4de6('0x50')]=_['keys'](_0x1bdb39[_0x4de6('0x50')]);_0x2afadb[_0x4de6('0x4c')]=_[_0x4de6('0x4d')](_0x2afadb[_0x4de6('0x4a')],_0x2afadb[_0x4de6('0x50')]);_0x1bd743[_0x4de6('0x4e')]=_[_0x4de6('0x4d')](_0x2afadb[_0x4de6('0x4a')],qs['fields'](_0x1bdb39[_0x4de6('0x50')]['fields']));_0x1bd743['attributes']=_0x1bd743['attributes'][_0x4de6('0x51')]?_0x1bd743[_0x4de6('0x4e')]:_0x2afadb[_0x4de6('0x4a')];if(!_0x1bdb39[_0x4de6('0x50')][_0x4de6('0x52')](_0x4de6('0x53'))){_0x1bd743[_0x4de6('0x1e')]=qs[_0x4de6('0x1e')](_0x1bdb39[_0x4de6('0x50')][_0x4de6('0x1e')]);_0x1bd743['offset']=qs[_0x4de6('0x1c')](_0x1bdb39['query'][_0x4de6('0x1c')]);}_0x1bd743[_0x4de6('0x54')]=qs[_0x4de6('0x55')](_0x1bdb39['query'][_0x4de6('0x55')]);_0x1bd743[_0x4de6('0x56')]=qs['filters'](_[_0x4de6('0x57')](_0x1bdb39['query'],_0x2afadb[_0x4de6('0x4c')]));_0x1bd743[_0x4de6('0x56')][_0x4de6('0x68')]=_0x17e073['id'];if(_0x1bdb39[_0x4de6('0x50')][_0x4de6('0x58')]){_0x1bd743['where']=_[_0x4de6('0x6c')](_0x1bd743[_0x4de6('0x56')],{'$or':_[_0x4de6('0x45')](_0x1bd743[_0x4de6('0x4e')],function(_0x484cbb){var _0x345472={};_0x345472[_0x484cbb]={'$like':'%'+_0x1bdb39[_0x4de6('0x50')][_0x4de6('0x58')]+'%'};return _0x345472;})});}_0x1bd743=_[_0x4de6('0x6c')]({},_0x1bd743,_0x1bdb39['options']);return db[_0x4de6('0x73')][_0x4de6('0x1f')]({'where':_0x1bd743[_0x4de6('0x56')]})[_0x4de6('0xd')](function(_0xfb3084){_0x2c9abb[_0x4de6('0x1f')]=_0xfb3084;if(_0x1bdb39['query'][_0x4de6('0x60')]){_0x1bd743['include']=[{'all':!![]}];}return db[_0x4de6('0x73')][_0x4de6('0x6d')](_0x1bd743);})[_0x4de6('0xd')](function(_0x2d8cbd){_0x2c9abb[_0x4de6('0x6e')]=_0x2d8cbd;return _0x2c9abb;});}})['then'](respondWithFilteredResult(_0x50b004,_0x1bd743))[_0x4de6('0x18')](handleError(_0x50b004,null));};exports[_0x4de6('0x74')]=function(_0x5e4952,_0x40eda4){return db['MailAccount']['find']({'where':{'id':_0x5e4952[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x40eda4,null))[_0x4de6('0xd')](function(_0x36d750){if(_0x36d750){return _0x36d750[_0x4de6('0x74')](_0x5e4952[_0x4de6('0x50')][_0x4de6('0x70')]);}})[_0x4de6('0xd')](respondWithStatusCode(_0x40eda4,null))[_0x4de6('0x18')](handleError(_0x40eda4,null));};exports[_0x4de6('0x75')]=function(_0x2fdaae,_0x6e3f32){var _0x2ba2f9={'name':_0x2fdaae['body'][_0x4de6('0x29')],'key':_0x2fdaae[_0x4de6('0x62')]['key'],'provider':_0x2fdaae['body'][_0x4de6('0x63')]===_0x4de6('0x64')?null:_0x2fdaae[_0x4de6('0x62')]['provider'],'email':_0x2fdaae[_0x4de6('0x62')][_0x4de6('0x76')],'ListId':_0x2fdaae[_0x4de6('0x62')][_0x4de6('0x77')],'active':!_[_0x4de6('0x78')](_0x2fdaae['body'][_0x4de6('0x79')])?_0x2fdaae[_0x4de6('0x62')][_0x4de6('0x79')]:!![],'description':_0x2fdaae['body'][_0x4de6('0x7a')]||null};var _0x1fc9fd=getAuthenticationOptions(_0x2ba2f9[_0x4de6('0x63')],_0x2fdaae[_0x4de6('0x62')]);_0x2ba2f9[_0x4de6('0x3f')]=_0x1fc9fd[_0x4de6('0x3f')];_0x2ba2f9[_0x4de6('0x41')]=_0x1fc9fd[_0x4de6('0x41')];return db[_0x4de6('0x46')][_0x4de6('0x75')](_0x2ba2f9,{'include':[{'model':db[_0x4de6('0x5f')],'as':'Smtp'},{'model':db[_0x4de6('0x5e')],'as':_0x4de6('0x3f')}]})[_0x4de6('0xd')](function(_0x1c01fa){var _0x5309b=_0x2fdaae[_0x4de6('0x35')][_0x4de6('0x25')]({'plain':!![]});if(!_0x5309b)throw new Error(_0x4de6('0x7b'));if(_0x5309b[_0x4de6('0x7c')]==='user'){var _0x5e9ed5=_0x1c01fa['get']({'plain':!![]});return db[_0x4de6('0x7d')][_0x4de6('0x61')]({'where':{'name':'MailAccounts','userProfileId':_0x5309b[_0x4de6('0x7e')]},'raw':!![]})['then'](function(_0x4007c5){if(_0x4007c5&&_0x4007c5[_0x4de6('0x7f')]===0x0){return db[_0x4de6('0x27')][_0x4de6('0x75')]({'name':_0x5e9ed5[_0x4de6('0x29')],'resourceId':_0x5e9ed5['id'],'type':_0x4007c5[_0x4de6('0x29')],'sectionId':_0x4007c5['id']},{})[_0x4de6('0xd')](function(){return _0x1c01fa;});}else{return _0x1c01fa;}})['catch'](function(_0x3c0496){logger['error'](_0x4de6('0x80'),_0x3c0496);throw _0x3c0496;});}return _0x1c01fa;})['then'](respondWithResult(_0x6e3f32,0xc9))['catch'](handleError(_0x6e3f32,null));};exports['getImap']=function(_0x5306d6,_0x18273b){return db['MailAccount'][_0x4de6('0x6b')]({'where':{'id':_0x5306d6[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x18273b,null))[_0x4de6('0xd')](function(_0x1e7a22){if(_0x1e7a22){return _0x1e7a22[_0x4de6('0x81')]();}return null;})[_0x4de6('0xd')](respondWithResult(_0x18273b,null))['catch'](handleError(_0x18273b,null));};exports[_0x4de6('0x82')]=function(_0x3dd1f7,_0x37973f){if(_0x3dd1f7['body']['id']){delete _0x3dd1f7[_0x4de6('0x62')]['id'];}return db['MailAccount'][_0x4de6('0x61')]({'where':{'id':_0x3dd1f7[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x37973f,null))[_0x4de6('0xd')](function(_0x430350){if(_0x430350){_0x3dd1f7[_0x4de6('0x62')][_0x4de6('0x68')]=_0x430350['id'];return db[_0x4de6('0x5e')]['create'](_0x3dd1f7[_0x4de6('0x62')]);}})['then'](respondWithResult(_0x37973f,null))['catch'](handleError(_0x37973f,null));};exports['removeImap']=function(_0x4c4523,_0x465513){return db['MailAccount'][_0x4de6('0x6b')]({'where':{'id':_0x4c4523[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x465513,null))[_0x4de6('0xd')](function(_0x3dd5fc){if(_0x3dd5fc){return _0x3dd5fc[_0x4de6('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x465513,null))[_0x4de6('0x18')](handleError(_0x465513,null));};exports[_0x4de6('0x84')]=function(_0x67414d,_0xb24a21){return db[_0x4de6('0x46')]['findOne']({'where':{'id':_0x67414d['params']['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0xb24a21,null))[_0x4de6('0xd')](function(_0x500c55){if(_0x500c55){return _0x500c55[_0x4de6('0x84')]();}return null;})[_0x4de6('0xd')](respondWithResult(_0xb24a21,null))[_0x4de6('0x18')](handleError(_0xb24a21,null));};exports[_0x4de6('0x85')]=function(_0x311393,_0x34d9f8){if(_0x311393['body']['id']){delete _0x311393[_0x4de6('0x62')]['id'];}return db['MailAccount'][_0x4de6('0x61')]({'where':{'id':_0x311393[_0x4de6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x34d9f8,null))[_0x4de6('0xd')](function(_0x10d8f0){if(_0x10d8f0){_0x311393[_0x4de6('0x62')][_0x4de6('0x68')]=_0x10d8f0['id'];return db[_0x4de6('0x5f')]['create'](_0x311393[_0x4de6('0x62')]);}})[_0x4de6('0xd')](respondWithResult(_0x34d9f8,null))['catch'](handleError(_0x34d9f8,null));};exports[_0x4de6('0x86')]=function(_0x363353,_0x545796){return db['MailAccount'][_0x4de6('0x6b')]({'where':{'id':_0x363353[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x545796,null))[_0x4de6('0xd')](function(_0x214793){if(_0x214793){return _0x214793[_0x4de6('0x87')](null);}return null;})[_0x4de6('0xd')](respondWithStatusCode(_0x545796,null))['catch'](handleError(_0x545796,null));};exports[_0x4de6('0x88')]=function(_0x1bf80b,_0xe3aac4){return db[_0x4de6('0x89')][_0x4de6('0x61')]({'where':{'id':_0x1bf80b['params']['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0xe3aac4,null))[_0x4de6('0xd')](function(_0x2e42c1){if(_0x2e42c1){return _0x2e42c1[_0x4de6('0x88')](_0x1bf80b[_0x4de6('0x62')]['ids'],_['omit'](_0x1bf80b[_0x4de6('0x62')],[_0x4de6('0x70'),'id'])||{});}})[_0x4de6('0xd')](respondWithResult(_0xe3aac4,null))[_0x4de6('0x18')](handleError(_0xe3aac4,null));};exports[_0x4de6('0x8a')]=function(_0x52fceb,_0x44fbdf){var _0x1b1d74={'raw':![],'where':{}};var _0x5c76da={};var _0x56e21d={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x52fceb[_0x4de6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x44fbdf,null))[_0x4de6('0xd')](function(_0x1fdc4d){if(_0x1fdc4d){_0x5c76da['model']=_['keys'](db[_0x4de6('0x89')][_0x4de6('0x47')]);_0x5c76da[_0x4de6('0x50')]=_[_0x4de6('0x4b')](_0x52fceb[_0x4de6('0x50')]);_0x5c76da[_0x4de6('0x4c')]=_[_0x4de6('0x4d')](_0x5c76da[_0x4de6('0x4a')],_0x5c76da[_0x4de6('0x50')]);_0x1b1d74[_0x4de6('0x4e')]=_[_0x4de6('0x4d')](_0x5c76da[_0x4de6('0x4a')],qs[_0x4de6('0x4f')](_0x52fceb['query']['fields']));_0x1b1d74[_0x4de6('0x4e')]=_0x1b1d74[_0x4de6('0x4e')][_0x4de6('0x51')]?_0x1b1d74[_0x4de6('0x4e')]:_0x5c76da[_0x4de6('0x4a')];if(!_0x52fceb[_0x4de6('0x50')][_0x4de6('0x52')](_0x4de6('0x53'))){_0x1b1d74[_0x4de6('0x1e')]=qs[_0x4de6('0x1e')](_0x52fceb[_0x4de6('0x50')][_0x4de6('0x1e')]);_0x1b1d74[_0x4de6('0x1c')]=qs['offset'](_0x52fceb[_0x4de6('0x50')][_0x4de6('0x1c')]);}_0x1b1d74['order']=qs['sort'](_0x52fceb[_0x4de6('0x50')]['sort']);_0x1b1d74[_0x4de6('0x56')]=qs[_0x4de6('0x4c')](_[_0x4de6('0x57')](_0x52fceb[_0x4de6('0x50')],_0x5c76da[_0x4de6('0x4c')]));_0x1b1d74['where'][_0x4de6('0x68')]=_0x1fdc4d['id'];if(_0x52fceb[_0x4de6('0x50')][_0x4de6('0x58')]){_0x1b1d74[_0x4de6('0x56')]=_[_0x4de6('0x6c')](_0x1b1d74['where'],{'$or':_[_0x4de6('0x45')](_0x1b1d74['attributes'],function(_0x147033){var _0x2731e8={};_0x2731e8[_0x147033]={'$like':'%'+_0x52fceb[_0x4de6('0x50')]['filter']+'%'};return _0x2731e8;})});}_0x1b1d74=_[_0x4de6('0x6c')]({},_0x1b1d74,_0x52fceb[_0x4de6('0x5a')]);return db[_0x4de6('0x89')][_0x4de6('0x1f')]({'where':_0x1b1d74['where']})[_0x4de6('0xd')](function(_0x14acf4){_0x56e21d[_0x4de6('0x1f')]=_0x14acf4;if(_0x52fceb['query'][_0x4de6('0x60')]){_0x1b1d74[_0x4de6('0x5b')]=[{'model':db[_0x4de6('0x8b')],'as':'Contact','required':![]},{'model':db[_0x4de6('0x8c')],'as':_0x4de6('0x8d'),'attributes':[_0x4de6('0x29'),'fullname',_0x4de6('0x8e')],'required':![]},{'model':db[_0x4de6('0x8f')],'as':_0x4de6('0x90'),'attributes':['id','name',_0x4de6('0x91')],'where':_0x52fceb['query'][_0x4de6('0x92')]?{'id':_0x52fceb[_0x4de6('0x50')][_0x4de6('0x92')]}:undefined,'required':_0x52fceb[_0x4de6('0x50')][_0x4de6('0x92')]?!![]:![]}];}return db[_0x4de6('0x89')][_0x4de6('0x6d')](_0x1b1d74);})[_0x4de6('0xd')](function(_0x2381a9){_0x56e21d[_0x4de6('0x6e')]=_0x2381a9;return _0x56e21d;});}})[_0x4de6('0xd')](respondWithFilteredResult(_0x44fbdf,_0x1b1d74))[_0x4de6('0x18')](handleError(_0x44fbdf,null));};exports[_0x4de6('0x93')]=function addApplications(_0x3f96ef,_0x26dafe){var _0x2b221a=_0x3f96ef[_0x4de6('0x5d')]['id'];var _0x53978e=_0x3f96ef[_0x4de6('0x62')];var _0x8388f9=0xc8;var _0x28a3bf=null;return db['sequelize'][_0x4de6('0x94')]({'isolationLevel':db[_0x4de6('0x95')][_0x4de6('0x96')][_0x4de6('0x97')]['READ_COMMITTED']},function(_0x18ca14){return db[_0x4de6('0x46')][_0x4de6('0x6b')]({'where':{'id':_0x2b221a},'transaction':_0x18ca14})[_0x4de6('0xd')](function(_0x5a11c9){if(_0x5a11c9){return db[_0x4de6('0x98')]['destroy']({'where':{'MailAccountId':_0x2b221a},'transaction':_0x18ca14})[_0x4de6('0xd')](function(){var _0x2d2580=_[_0x4de6('0x45')](_0x53978e,function(_0x13fcab){_0x13fcab[_0x4de6('0x68')]=_0x2b221a;return _0x13fcab;});return db[_0x4de6('0x98')][_0x4de6('0x99')](_0x2d2580,{'transaction':_0x18ca14});});}else{_0x8388f9=0x194;_0x28a3bf=[];}});})['then'](function(){if(_0x8388f9!==0x194){return db[_0x4de6('0x98')][_0x4de6('0x9a')]({'where':{'MailAccountId':_0x2b221a},'order':_0x4de6('0x9b')})['then'](function(_0x4c00ef){_0x28a3bf=_0x4c00ef;});}})[_0x4de6('0x18')](function(_0x4d8730){_0x8388f9=0x1f4;logger[_0x4de6('0x14')](_0x4d8730['stack']);if(_0x4d8730[_0x4de6('0x29')]){delete _0x4d8730[_0x4de6('0x29')];}_0x28a3bf=_0x4d8730;})[_0x4de6('0x9c')](function(){if(_0x28a3bf===null){_0x26dafe[_0x4de6('0x19')](_0x8388f9);}else{if(_0x8388f9===0x1f4){_0x26dafe[_0x4de6('0x1a')](_0x8388f9)[_0x4de6('0x2a')](_0x28a3bf);}else{_0x26dafe[_0x4de6('0x1a')](_0x8388f9)['json'](_0x28a3bf);}}});};exports['getApplications']=function(_0x2ab085,_0x1fb102){var _0xddcba1={};var _0x3c1d70={};var _0x54b540;var _0x18f276;return db[_0x4de6('0x46')]['findOne']({'where':{'id':_0x2ab085[_0x4de6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1fb102,null))[_0x4de6('0xd')](function(_0x551521){if(_0x551521){_0x54b540=_0x551521;_0x3c1d70[_0x4de6('0x4a')]=_[_0x4de6('0x4b')](db[_0x4de6('0x98')]['rawAttributes']);_0x3c1d70['query']=_['keys'](_0x2ab085[_0x4de6('0x50')]);_0x3c1d70[_0x4de6('0x4c')]=_[_0x4de6('0x4d')](_0x3c1d70[_0x4de6('0x4a')],_0x3c1d70['query']);_0xddcba1[_0x4de6('0x4e')]=_[_0x4de6('0x4d')](_0x3c1d70[_0x4de6('0x4a')],qs['fields'](_0x2ab085['query'][_0x4de6('0x4f')]));_0xddcba1[_0x4de6('0x4e')]=_0xddcba1['attributes'][_0x4de6('0x51')]?_0xddcba1['attributes']:_0x3c1d70[_0x4de6('0x4a')];_0xddcba1[_0x4de6('0x54')]=qs[_0x4de6('0x55')](_0x2ab085[_0x4de6('0x50')]['sort']);_0xddcba1[_0x4de6('0x56')]=qs[_0x4de6('0x4c')](_['pick'](_0x2ab085[_0x4de6('0x50')],_0x3c1d70[_0x4de6('0x4c')]));if(_0x2ab085[_0x4de6('0x50')]['filter']){_0xddcba1[_0x4de6('0x56')]=_[_0x4de6('0x6c')](_0xddcba1[_0x4de6('0x56')],{'$or':_['map'](_0xddcba1[_0x4de6('0x4e')],function(_0x531129){var _0x1d0a09={};_0x1d0a09[_0x531129]={'$like':'%'+_0x2ab085[_0x4de6('0x50')][_0x4de6('0x58')]+'%'};return _0x1d0a09;})});}_0xddcba1=_[_0x4de6('0x6c')]({},_0xddcba1,_0x2ab085['options']);return _0x54b540[_0x4de6('0x9d')](_0xddcba1);}})[_0x4de6('0xd')](function(_0x16ba2f){if(_0x16ba2f){_0x18f276=_0x16ba2f[_0x4de6('0x51')];if(!_0x2ab085[_0x4de6('0x50')][_0x4de6('0x52')](_0x4de6('0x53'))){_0xddcba1[_0x4de6('0x1e')]=qs[_0x4de6('0x1e')](_0x2ab085[_0x4de6('0x50')][_0x4de6('0x1e')]);_0xddcba1[_0x4de6('0x1c')]=qs[_0x4de6('0x1c')](_0x2ab085[_0x4de6('0x50')][_0x4de6('0x1c')]);}return _0x54b540[_0x4de6('0x9d')](_0xddcba1);}})[_0x4de6('0xd')](function(_0x21bad4){if(_0x21bad4){return _0x21bad4?{'count':_0x18f276,'rows':_0x21bad4}:null;}})[_0x4de6('0xd')](respondWithResult(_0x1fb102,null))[_0x4de6('0x18')](handleError(_0x1fb102,null));};exports[_0x4de6('0x9e')]=function(_0x265d36,_0x325b5b){var _0x414750={'raw':!![],'where':{}};var _0x25d69b={};var _0xdeacaa={'count':0x0,'rows':[]};return db[_0x4de6('0x46')][_0x4de6('0x6b')]({'where':{'id':_0x265d36[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x325b5b,null))[_0x4de6('0xd')](function(_0x29b7e6){if(_0x29b7e6){_0x25d69b[_0x4de6('0x4a')]=_[_0x4de6('0x4b')](db['MailMessage'][_0x4de6('0x47')]);_0x25d69b['query']=_[_0x4de6('0x4b')](_0x265d36[_0x4de6('0x50')]);_0x25d69b['filters']=_[_0x4de6('0x4d')](_0x25d69b[_0x4de6('0x4a')],_0x25d69b[_0x4de6('0x50')]);_0x414750[_0x4de6('0x4e')]=_[_0x4de6('0x4d')](_0x25d69b[_0x4de6('0x4a')],qs[_0x4de6('0x4f')](_0x265d36[_0x4de6('0x50')]['fields']));_0x414750['attributes']=_0x414750[_0x4de6('0x4e')][_0x4de6('0x51')]?_0x414750['attributes']:_0x25d69b[_0x4de6('0x4a')];if(!_0x265d36[_0x4de6('0x50')][_0x4de6('0x52')](_0x4de6('0x53'))){_0x414750['limit']=qs[_0x4de6('0x1e')](_0x265d36[_0x4de6('0x50')][_0x4de6('0x1e')]);_0x414750[_0x4de6('0x1c')]=qs[_0x4de6('0x1c')](_0x265d36[_0x4de6('0x50')]['offset']);}_0x414750[_0x4de6('0x54')]=qs['sort'](_0x265d36['query'][_0x4de6('0x55')]);_0x414750[_0x4de6('0x56')]=qs[_0x4de6('0x4c')](_[_0x4de6('0x57')](_0x265d36[_0x4de6('0x50')],_0x25d69b[_0x4de6('0x4c')]));_0x414750[_0x4de6('0x56')][_0x4de6('0x68')]=_0x29b7e6['id'];if(_0x265d36[_0x4de6('0x50')][_0x4de6('0x58')]){_0x414750[_0x4de6('0x56')]=_['merge'](_0x414750[_0x4de6('0x56')],{'$or':_[_0x4de6('0x45')](_0x414750[_0x4de6('0x4e')],function(_0x508c26){var _0x3839b8={};_0x3839b8[_0x508c26]={'$like':'%'+_0x265d36[_0x4de6('0x50')][_0x4de6('0x58')]+'%'};return _0x3839b8;})});}if(_0x265d36[_0x4de6('0x50')][_0x4de6('0x9f')]){var _0x4cb117=_0x265d36['query']['$gte'][_0x4de6('0xa0')](',');var _0x3aef7b={};_0x3aef7b[_0x4cb117[0x0]]={'$gte':moment(_0x4cb117[0x1])[_0x4de6('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x414750[_0x4de6('0x56')]=_[_0x4de6('0x6c')](_0x414750[_0x4de6('0x56')],_0x3aef7b);}_0x414750=_['merge']({},_0x414750,_0x265d36[_0x4de6('0x5a')]);return db['MailMessage'][_0x4de6('0x1f')]({'where':_0x414750[_0x4de6('0x56')]})[_0x4de6('0xd')](function(_0x35d23b){_0xdeacaa[_0x4de6('0x1f')]=_0x35d23b;if(_0x265d36[_0x4de6('0x50')][_0x4de6('0x60')]){_0x414750[_0x4de6('0x5b')]=[{'all':!![]}];}return db[_0x4de6('0xa2')]['findAll'](_0x414750);})['then'](function(_0x2fc727){if(_0x265d36[_0x4de6('0x50')][_0x4de6('0xa3')]===_0x4de6('0xa4')){for(var _0xdfaed1=0x0;_0xdfaed1<_0x2fc727[_0x4de6('0x51')];_0xdfaed1++){_0x2fc727[_0xdfaed1][_0x4de6('0x62')]=juice(_0x2fc727[_0xdfaed1][_0x4de6('0x62')]);}}_0xdeacaa['rows']=_0x2fc727;return _0xdeacaa;});}})['then'](respondWithFilteredResult(_0x325b5b,_0x414750))[_0x4de6('0x18')](handleError(_0x325b5b,null));};exports[_0x4de6('0x2a')]=function(_0x1c6f46,_0x3adf19){var _0x19efd8,_0x1da795={},_0x5ec8b4;if(_0x1c6f46[_0x4de6('0x62')]['to']){_0x5ec8b4=_0x1c6f46[_0x4de6('0x62')]['to'][_0x4de6('0xa0')](',')[0x0];}return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x1c6f46[_0x4de6('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x4de6('0xa5'),'include':[{'model':db[_0x4de6('0x8b')],'as':_0x4de6('0xa6'),'where':{'email':_0x5ec8b4},'limit':0x1,'order':[[_0x4de6('0xa7'),_0x4de6('0xa8')]]}]},{'model':db[_0x4de6('0x5f')],'as':_0x4de6('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x4de6('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3adf19,null))[_0x4de6('0xd')](function(_0x3718eb){if(!_0x3718eb)return;_0x19efd8=_0x3718eb;if(!_0x3718eb['Smtp'])throw new Error(_0x4de6('0xaa'));if(_[_0x4de6('0x78')](_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xab')])){_0x1c6f46['body'][_0x4de6('0xab')]=util[_0x4de6('0xa1')](_0x4de6('0xac'),_0x3718eb[_0x4de6('0x29')],_0x3718eb[_0x4de6('0x76')]||_0x3718eb['Smtp'][_0x4de6('0x35')]);}if(_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xad')]&&_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xad')][_0x4de6('0x51')]){for(var _0x572246=0x0;_0x572246<_0x1c6f46['body']['attachments'][_0x4de6('0x51')];_0x572246+=0x1){_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xad')][_0x572246]={'filename':_0x1c6f46['body'][_0x4de6('0xad')][_0x572246][_0x4de6('0x29')],'path':path[_0x4de6('0xae')](config[_0x4de6('0xaf')],_0x4de6('0xb0'),_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xad')][_0x572246][_0x4de6('0xb1')])};}}var _0x1e1b83=_0x3718eb[_0x4de6('0xb2')]();return respondWithRpcPromise(_0x4de6('0xb3'),_0x4de6('0xb4'),{'account':_0x1e1b83,'message':_0x1c6f46[_0x4de6('0x62')]});})[_0x4de6('0xd')](function(_0x59883c){if(!_0x59883c)return;_0x1da795=_0x59883c;if(!_0x19efd8[_0x4de6('0xa5')])throw new Error('List\x20not\x20found');if(_0x19efd8['List'][_0x4de6('0xa6')]['length'])return _0x19efd8[_0x4de6('0xa5')][_0x4de6('0xa6')][0x0];return db[_0x4de6('0x8b')][_0x4de6('0x75')](_['defaults'](_0x1c6f46[_0x4de6('0x62')],{'firstName':_0x1c6f46[_0x4de6('0x62')]['to'],'email':_0x1c6f46[_0x4de6('0x62')]['to'],'phone':_0x1c6f46[_0x4de6('0x62')]['to'],'ListId':_0x19efd8['ListId']}));})[_0x4de6('0xd')](function(_0x10b28c){if(!_0x10b28c)return;var _0x48a463={'UserId':_0x1c6f46[_0x4de6('0x35')]['id'],'ContactId':_0x10b28c['id'],'MailAccountId':_0x19efd8['id'],'inReplyTo':_0x1da795['messageId'],'to':_0x1c6f46['body'][_0x4de6('0xab')],'cc':_0x1c6f46[_0x4de6('0x62')]['cc'],'subject':_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xb5')],'attach':_0x1c6f46[_0x4de6('0x62')][_0x4de6('0xb6')],'firstMsgDirection':_0x4de6('0xb7'),'lastMsgAt':moment()['format'](_0x4de6('0xb8')),'lastMsgDirection':_0x4de6('0xb7'),'Messages':[_['merge'](_0x1c6f46[_0x4de6('0x62')],{'messageId':_0x1da795[_0x4de6('0xb9')],'sentAt':moment()[_0x4de6('0xa1')](_0x4de6('0xb8')),'read':!![],'MailAccountId':_0x19efd8['id'],'UserId':_0x1c6f46[_0x4de6('0x35')]['id'],'ContactId':_0x10b28c['id']})]};if(_0x1c6f46[_0x4de6('0x62')]['Interaction']){_0x48a463=_[_0x4de6('0x6c')](_0x48a463,_0x1c6f46[_0x4de6('0x62')]['Interaction']);}return db[_0x4de6('0x89')][_0x4de6('0x75')](_0x48a463,{'include':[{'model':db['MailMessage'],'as':_0x4de6('0xba')}]});})['then'](respondWithResult(_0x3adf19,null))[_0x4de6('0x18')](handleError(_0x3adf19,null));};exports[_0x4de6('0xbb')]=function(_0x1fcc8b,_0x2393db){return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x1fcc8b['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0x4de6('0x41'),'raw':!![],'include':[{'model':db[_0x4de6('0xa9')],'as':_0x4de6('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2393db,null))[_0x4de6('0xd')](function(_0x2ed50d){if(!_0x2ed50d['Smtp'])return;var _0x1c2798=_0x2ed50d[_0x4de6('0xb2')]();return respondWithRpcPromise(_0x4de6('0xbc'),_0x4de6('0xbb'),{'account':_0x1c2798});})[_0x4de6('0xd')](respondWithResult(_0x2393db,null))[_0x4de6('0x18')](handleError(_0x2393db,null));};exports[_0x4de6('0x24')]=function(_0x40acff,_0x11095a){return db['MailAccount'][_0x4de6('0x61')]({'where':{'id':_0x40acff[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x11095a,null))[_0x4de6('0xd')](function(_0x5fd83a){if(_0x5fd83a&&_0x5fd83a[_0x4de6('0x3d')]){throw new db[(_0x4de6('0xbd'))][(_0x4de6('0xbe'))](_0x4de6('0xbf'));}return _0x5fd83a;})['then'](removeEntity(_0x11095a,null))[_0x4de6('0x18')](handleError(_0x11095a,null));};exports['addAgents']=function(_0x4bb838,_0x470dbf){return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x4bb838[_0x4de6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x470dbf,null))[_0x4de6('0xd')](function(_0x2fc9a6){if(_0x2fc9a6){return _0x2fc9a6[_0x4de6('0xc0')](_0x4bb838[_0x4de6('0x62')][_0x4de6('0x70')],_[_0x4de6('0xc1')](_0x4bb838[_0x4de6('0x62')],['ids','id'])||{})[_0x4de6('0xc2')](function(_0x19691a){for(var _0xe16f1f=0x0;_0xe16f1f<_0x4bb838['body'][_0x4de6('0x70')][_0x4de6('0x51')];_0xe16f1f+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x4bb838[_0x4de6('0x62')][_0x4de6('0x70')][_0xe16f1f]),'MailAccountId':Number(_0x4bb838[_0x4de6('0x5d')]['id'])});}return _0x19691a;});}})['then'](respondWithResult(_0x470dbf,null))[_0x4de6('0x18')](handleError(_0x470dbf,null));};exports[_0x4de6('0xc3')]=function(_0x368af8,_0x41c2ae){return db[_0x4de6('0x46')][_0x4de6('0x61')]({'where':{'id':_0x368af8[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x41c2ae,null))[_0x4de6('0xd')](function(_0x3311e8){if(_0x3311e8){return _0x3311e8[_0x4de6('0xc3')](_0x368af8['query'][_0x4de6('0x70')])[_0x4de6('0xd')](function(){if(_['isArray'](_0x368af8[_0x4de6('0x50')][_0x4de6('0x70')])){for(var _0x2da277=0x0;_0x2da277<_0x368af8['query']['ids'][_0x4de6('0x51')];_0x2da277+=0x1){socket[_0x4de6('0xc4')](_0x4de6('0xc5'),{'UserId':Number(_0x368af8[_0x4de6('0x50')][_0x4de6('0x70')][_0x2da277]),'MailAccountId':Number(_0x368af8[_0x4de6('0x5d')]['id'])});}}else{socket[_0x4de6('0xc4')](_0x4de6('0xc5'),{'UserId':Number(_0x368af8[_0x4de6('0x50')][_0x4de6('0x70')]),'MailAccountId':Number(_0x368af8['params']['id'])});}});}})[_0x4de6('0xd')](respondWithStatusCode(_0x41c2ae,null))['catch'](handleError(_0x41c2ae,null));};exports[_0x4de6('0xc6')]=function(_0x6e7f15,_0x5d2579){var _0x30e7f4={};var _0x53d00={};var _0x5a0ca2;var _0x17e2de;return db[_0x4de6('0x46')][_0x4de6('0x6b')]({'where':{'id':_0x6e7f15[_0x4de6('0x5d')]['id']}})[_0x4de6('0xd')](handleEntityNotFound(_0x5d2579,null))[_0x4de6('0xd')](function(_0x588723){if(_0x588723){_0x5a0ca2=_0x588723;_0x53d00['model']=_['keys'](db[_0x4de6('0x8c')]['rawAttributes']);_0x53d00['query']=_[_0x4de6('0x4b')](_0x6e7f15['query']);_0x53d00[_0x4de6('0x4c')]=_[_0x4de6('0x4d')](_0x53d00[_0x4de6('0x4a')],_0x53d00['query']);_0x30e7f4[_0x4de6('0x4e')]=_['intersection'](_0x53d00['model'],qs['fields'](_0x6e7f15[_0x4de6('0x50')][_0x4de6('0x4f')]));_0x30e7f4[_0x4de6('0x4e')]=_0x30e7f4[_0x4de6('0x4e')]['length']?_0x30e7f4['attributes']:_0x53d00[_0x4de6('0x4a')];_0x30e7f4['order']=qs[_0x4de6('0x55')](_0x6e7f15[_0x4de6('0x50')][_0x4de6('0x55')]);_0x30e7f4[_0x4de6('0x56')]=qs[_0x4de6('0x4c')](_[_0x4de6('0x57')](_0x6e7f15[_0x4de6('0x50')],_0x53d00['filters']));if(_0x6e7f15[_0x4de6('0x50')]['filter']){_0x30e7f4[_0x4de6('0x56')]=_[_0x4de6('0x6c')](_0x30e7f4[_0x4de6('0x56')],{'$or':_['map'](_0x30e7f4[_0x4de6('0x4e')],function(_0x4fd34f){var _0x4311b2={};_0x4311b2[_0x4fd34f]={'$like':'%'+_0x6e7f15[_0x4de6('0x50')][_0x4de6('0x58')]+'%'};return _0x4311b2;})});}_0x30e7f4=_['merge']({},_0x30e7f4,_0x6e7f15[_0x4de6('0x5a')]);return _0x5a0ca2[_0x4de6('0xc6')](_0x30e7f4);}})['then'](function(_0x200679){if(_0x200679){_0x17e2de=_0x200679[_0x4de6('0x51')];if(!_0x6e7f15['query']['hasOwnProperty']('nolimit')){_0x30e7f4[_0x4de6('0x1e')]=qs[_0x4de6('0x1e')](_0x6e7f15[_0x4de6('0x50')][_0x4de6('0x1e')]);_0x30e7f4['offset']=qs[_0x4de6('0x1c')](_0x6e7f15[_0x4de6('0x50')][_0x4de6('0x1c')]);}return _0x5a0ca2[_0x4de6('0xc6')](_0x30e7f4);}})[_0x4de6('0xd')](function(_0x3b04e0){if(_0x3b04e0){return _0x3b04e0?{'count':_0x17e2de,'rows':_0x3b04e0}:null;}})[_0x4de6('0xd')](respondWithResult(_0x5d2579,null))[_0x4de6('0x18')](handleError(_0x5d2579,null));}; \ No newline at end of file +var _0x417a=['host','port','service','authentication','username','Imap','Smtp','MailServerIn','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','mandatoryDispositionPause','includeAll','find','catch','body','custom','provider','secure','params','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','Disposition','order','MailAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','findAll','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addInteraction','MailInteraction','getInteractions','Owner','internal','Tag','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','CmList','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','sendMail','List','List\x20not\x20found','Contacts','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','path','lodash','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','end','stack','name','send','yahoo','imap.mail.yahoo.com','hotmail','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','user','password','pass','modernAuthentication','CloudProviderId'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x417a,0x1e7));var _0xa417=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x417a[_0xd73d53];return _0x560148;};'use strict';var moment=require(_0xa417('0x0'));var BPromise=require(_0xa417('0x1'));var util=require('util');var path=require(_0xa417('0x2'));var _=require(_0xa417('0x3'));var juice=require(_0xa417('0x4'));var Redis=require('ioredis');var qs=require(_0xa417('0x5'));var logger=require('../../config/logger')(_0xa417('0x6'));var config=require(_0xa417('0x7'));var db=require(_0xa417('0x8'))['db'];config['redis']=_[_0xa417('0x9')](config[_0xa417('0xa')],{'host':_0xa417('0xb'),'port':0x18eb});var socket=require(_0xa417('0xc'))(new Redis(config[_0xa417('0xa')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xa417('0xd'));var client=jayson['client'][_0xa417('0xe')]({'port':0x232b});function respondWithRpcPromise(_0xd53401,_0x430c43,_0x4aabd0,_0x2f6642){return new BPromise(function(_0x915b9a,_0x36b6df){var _0x855956=_0x2f6642||client;return _0x855956[_0xa417('0xf')](_0xd53401,_0x4aabd0)[_0xa417('0x10')](function(_0x520d8a){logger[_0xa417('0x11')](_0xa417('0x12'),_0x430c43,_0xa417('0x13'));logger[_0xa417('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x430c43,_0xa417('0x13'),JSON[_0xa417('0x15')](_0x520d8a));if(_0x520d8a['error']){if(_0x520d8a[_0xa417('0x16')][_0xa417('0x17')]===0x1f4){logger[_0xa417('0x16')](_0xa417('0x12'),_0x430c43,_0x520d8a[_0xa417('0x16')][_0xa417('0x18')]);return _0x36b6df(_0x520d8a['error'][_0xa417('0x18')]);}logger[_0xa417('0x16')](_0xa417('0x12'),_0x430c43,_0x520d8a[_0xa417('0x16')][_0xa417('0x18')]);return _0x915b9a(_0x520d8a[_0xa417('0x16')][_0xa417('0x18')]);}else{logger[_0xa417('0x11')](_0xa417('0x12'),_0x430c43,_0xa417('0x13'));_0x915b9a(_0x520d8a['result'][_0xa417('0x18')]);}})['catch'](function(_0x379f90){logger[_0xa417('0x16')](_0xa417('0x12'),_0x430c43,_0x379f90);_0x36b6df(_0x379f90);});});}function respondWithStatusCode(_0x14382b,_0x3256f9){_0x3256f9=_0x3256f9||0xcc;return function(_0x42f864){if(_0x42f864){return _0x14382b[_0xa417('0x19')](_0x3256f9);}return _0x14382b[_0xa417('0x1a')](_0x3256f9)['end']();};}function respondWithResult(_0x19af9d,_0x2479c1){_0x2479c1=_0x2479c1||0xc8;return function(_0x2fa60b){if(_0x2fa60b){return _0x19af9d[_0xa417('0x1a')](_0x2479c1)[_0xa417('0x1b')](_0x2fa60b);}};}function respondWithFilteredResult(_0x18dae3,_0x26d7fc){return function(_0x392e44){if(_0x392e44){var _0x164e65=typeof _0x26d7fc[_0xa417('0x1c')]==='undefined'&&typeof _0x26d7fc[_0xa417('0x1d')]===_0xa417('0x1e');var _0x1e7431=_0x392e44[_0xa417('0x1f')];var _0x4f374c=_0x164e65?0x0:_0x26d7fc[_0xa417('0x1c')];var _0x419450=_0x164e65?_0x392e44[_0xa417('0x1f')]:_0x26d7fc[_0xa417('0x1c')]+_0x26d7fc[_0xa417('0x1d')];var _0x4ace7b;if(_0x419450>=_0x1e7431){_0x419450=_0x1e7431;_0x4ace7b=0xc8;}else{_0x4ace7b=0xce;}_0x18dae3[_0xa417('0x1a')](_0x4ace7b);return _0x18dae3[_0xa417('0x20')](_0xa417('0x21'),_0x4f374c+'-'+_0x419450+'/'+_0x1e7431)[_0xa417('0x1b')](_0x392e44);}return null;};}function saveUpdates(_0x211f5c){return function(_0x28bff6){if(_0x28bff6){return _0x28bff6[_0xa417('0x22')](_0x211f5c)[_0xa417('0x10')](function(_0x7ad520){return _0x7ad520;});}return null;};}function removeEntity(_0x1025d8){return function(_0xbc38cd){if(_0xbc38cd){return _0xbc38cd[_0xa417('0x23')]()[_0xa417('0x10')](function(){var _0x284bea=_0xbc38cd[_0xa417('0x24')]({'plain':!![]});var _0x4e14e9=_0xa417('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e14e9,'resourceId':_0x284bea['id']}})[_0xa417('0x10')](function(){return _0xbc38cd;});})[_0xa417('0x10')](function(){_0x1025d8['status'](0xcc)[_0xa417('0x26')]();});}};}function handleEntityNotFound(_0x5c2b41){return function(_0x4adede){if(!_0x4adede){_0x5c2b41[_0xa417('0x19')](0x194);}return _0x4adede;};}function handleError(_0x3b174b,_0x1cc5c8){_0x1cc5c8=_0x1cc5c8||0x1f4;return function(_0x1ef631){logger[_0xa417('0x16')](_0x1ef631[_0xa417('0x27')]);if(_0x1ef631[_0xa417('0x28')]){delete _0x1ef631[_0xa417('0x28')];}_0x3b174b[_0xa417('0x1a')](_0x1cc5c8)[_0xa417('0x29')](_0x1ef631);};}function getImapHost(_0x51433b){switch(_0x51433b){case'gmail':return'imap.gmail.com';case _0xa417('0x2a'):return _0xa417('0x2b');case _0xa417('0x2c'):return'imap-mail.outlook.com';case'outlook365':return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x51433b);}function getSmtpHost(_0x351682){switch(_0x351682){case _0xa417('0x2d'):return _0xa417('0x2e');case _0xa417('0x2a'):return _0xa417('0x2f');case _0xa417('0x2c'):return _0xa417('0x30');case _0xa417('0x31'):return'smtp.office365.com';}throw new Error(_0xa417('0x32'),_0x351682);}function getAuthenticationOptions(_0x21a519,_0x153be5){var _0x4aa793={};var _0x72ec10={};if(_0x21a519){_0x4aa793[_0xa417('0x33')]=_0x72ec10[_0xa417('0x33')]=_0x153be5['username'];_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=_0x153be5[_0xa417('0x34')];if(_0x153be5['modernAuthentication']){_0x4aa793['modernAuthentication']=_0x72ec10[_0xa417('0x36')]=!![];_0x4aa793[_0xa417('0x37')]=_0x72ec10[_0xa417('0x37')]=_0x153be5['CloudProviderId'];_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=null;}else{_0x4aa793[_0xa417('0x37')]=_0x72ec10[_0xa417('0x37')]=null;}_0x4aa793[_0xa417('0x38')]=getImapHost(_0x21a519);_0x4aa793[_0xa417('0x39')]=0x3e1;_0x72ec10[_0xa417('0x38')]=getSmtpHost(_0x21a519);_0x72ec10[_0xa417('0x39')]=0x24b;_0x72ec10['secure']=![];_0x4aa793[_0xa417('0x3a')]=_0x72ec10['service']=null;}else{if(_0x153be5[_0xa417('0x3b')]){_0x4aa793['user']=_0x72ec10[_0xa417('0x33')]=_0x153be5[_0xa417('0x3c')];_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=_0x153be5['password'];}else{_0x4aa793[_0xa417('0x3b')]=_0x72ec10[_0xa417('0x3b')]=![];_0x4aa793[_0xa417('0x33')]=_0x72ec10[_0xa417('0x33')]=null;_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=null;}_0x4aa793[_0xa417('0x38')]=_0x153be5['Imap']['host'];_0x4aa793[_0xa417('0x39')]=_0x153be5[_0xa417('0x3d')][_0xa417('0x39')];_0x72ec10['host']=_0x153be5[_0xa417('0x3e')][_0xa417('0x38')];_0x72ec10[_0xa417('0x39')]=_0x153be5[_0xa417('0x3e')][_0xa417('0x39')];}return{'Imap':_0x4aa793,'Smtp':_0x72ec10};}exports['index']=function(_0x1e3389,_0x46af15){var _0x4de442={'include':[{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')},{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e')},{'model':db[_0xa417('0x41')],'as':'mandatoryDispositionPause'}]},_0x1a969e={},_0x36071b={'count':0x0,'rows':[]};var _0x19647f=_[_0xa417('0x42')](db[_0xa417('0x43')][_0xa417('0x44')],function(_0x3e814d){return{'name':_0x3e814d[_0xa417('0x45')],'type':_0x3e814d[_0xa417('0x46')][_0xa417('0x47')]};});_0x1a969e[_0xa417('0x48')]=_[_0xa417('0x42')](_0x19647f,'name');_0x1a969e['query']=_[_0xa417('0x49')](_0x1e3389[_0xa417('0x4a')]);_0x1a969e[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x1a969e[_0xa417('0x48')],_0x1a969e[_0xa417('0x4a')]);_0x4de442[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x1a969e[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x1e3389['query'][_0xa417('0x4e')]));_0x4de442[_0xa417('0x4d')]=_0x4de442[_0xa417('0x4d')][_0xa417('0x4f')]?_0x4de442[_0xa417('0x4d')]:_0x1a969e[_0xa417('0x48')];if(!_0x1e3389[_0xa417('0x4a')]['hasOwnProperty'](_0xa417('0x50'))){_0x4de442[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x1e3389[_0xa417('0x4a')]['limit']);_0x4de442[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x1e3389[_0xa417('0x4a')][_0xa417('0x1c')]);}_0x4de442['order']=qs[_0xa417('0x51')](_0x1e3389[_0xa417('0x4a')][_0xa417('0x51')]);_0x4de442[_0xa417('0x52')]=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x1e3389[_0xa417('0x4a')],_0x1a969e['filters']),_0x19647f);if(_0x1e3389[_0xa417('0x4a')]['filter']){_0x4de442[_0xa417('0x52')]=_[_0xa417('0x54')](_0x4de442['where'],{'$or':_[_0xa417('0x42')](_0x19647f,function(_0x192ab6){if(_0x192ab6[_0xa417('0x46')]!==_0xa417('0x55')){var _0x362182={};_0x362182[_0x192ab6[_0xa417('0x28')]]={'$like':'%'+_0x1e3389['query'][_0xa417('0x56')]+'%'};return _0x362182;}})});}_0x4de442=_['merge']({},_0x4de442,_0x1e3389[_0xa417('0x57')]);var _0x19b37d={'where':_0x4de442['where']};return db[_0xa417('0x43')][_0xa417('0x1f')](_0x19b37d)[_0xa417('0x10')](function(_0x2f87ca){_0x36071b[_0xa417('0x1f')]=_0x2f87ca;if(_0x1e3389[_0xa417('0x4a')]['includeAll']){_0x4de442[_0xa417('0x58')]=[{'all':!![]}];}return db[_0xa417('0x43')]['findAll'](_0x4de442);})['then'](function(_0x1440a5){_0x36071b[_0xa417('0x59')]=_0x1440a5;return _0x36071b;})[_0xa417('0x10')](respondWithFilteredResult(_0x46af15,_0x4de442))['catch'](handleError(_0x46af15,null));};exports['show']=function(_0x573fa1,_0x1f9f39){var _0x114499={'raw':![],'where':{'id':_0x573fa1['params']['id']},'include':[{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')},{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e')},{'model':db[_0xa417('0x41')],'as':_0xa417('0x5a')}]},_0x4063cf={};_0x4063cf[_0xa417('0x48')]=_[_0xa417('0x49')](db['MailAccount'][_0xa417('0x44')]);_0x4063cf[_0xa417('0x4a')]=_['keys'](_0x573fa1[_0xa417('0x4a')]);_0x4063cf[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x4063cf[_0xa417('0x48')],_0x4063cf['query']);_0x114499['attributes']=_[_0xa417('0x4c')](_0x4063cf[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x573fa1[_0xa417('0x4a')]['fields']));_0x114499['attributes']=_0x114499[_0xa417('0x4d')][_0xa417('0x4f')]?_0x114499[_0xa417('0x4d')]:_0x4063cf[_0xa417('0x48')];if(_0x573fa1['query'][_0xa417('0x5b')]){_0x114499[_0xa417('0x58')]=[{'all':!![]}];}_0x114499=_[_0xa417('0x54')]({},_0x114499,_0x573fa1[_0xa417('0x57')]);return db[_0xa417('0x43')][_0xa417('0x5c')](_0x114499)[_0xa417('0x10')](handleEntityNotFound(_0x1f9f39,null))['then'](respondWithResult(_0x1f9f39,null))[_0xa417('0x5d')](handleError(_0x1f9f39,null));};exports[_0xa417('0x22')]=function(_0x481cd0,_0x424126){if(_0x481cd0[_0xa417('0x5e')]['id']){delete _0x481cd0['body']['id'];}var _0x526545=_0x481cd0['body']['provider']===_0xa417('0x5f')?null:_0x481cd0[_0xa417('0x5e')][_0xa417('0x60')];var _0x3e9aae=_0x481cd0['body'][_0xa417('0x3d')]||{};var _0x884122=_0x481cd0['body'][_0xa417('0x3e')]||{};if(_0x526545){_0x3e9aae[_0xa417('0x38')]=getImapHost(_0x526545);_0x3e9aae[_0xa417('0x39')]=0x3e1;_0x884122[_0xa417('0x38')]=getSmtpHost(_0x526545);_0x884122['port']=0x24b;_0x884122[_0xa417('0x61')]=![];}if(_0x884122[_0xa417('0x36')]){_0x884122[_0xa417('0x61')]=![];}else{_0x884122[_0xa417('0x37')]=null;}if(!_0x3e9aae[_0xa417('0x36')])_0x3e9aae[_0xa417('0x37')]=null;_0x481cd0[_0xa417('0x5e')]['Imap']=_0x3e9aae;_0x481cd0[_0xa417('0x5e')]['Smtp']=_0x884122;return db['MailAccount'][_0xa417('0x5c')]({'where':{'id':_0x481cd0[_0xa417('0x62')]['id']},'include':[{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')},{'model':db['MailServerOut'],'as':_0xa417('0x3e')},{'model':db[_0xa417('0x41')],'as':_0xa417('0x5a')}]})['then'](handleEntityNotFound(_0x424126,null))['then'](function(_0x5687f0){if(!_0x5687f0)throw new Error(_0xa417('0x63'));if(_0x5687f0[_0xa417('0x3a')])delete _0x481cd0['body']['Imap'];return _0x5687f0;})[_0xa417('0x10')](saveUpdates(_0x481cd0[_0xa417('0x5e')],null))[_0xa417('0x10')](function(_0x3c099d){if(!_0x481cd0[_0xa417('0x5e')][_0xa417('0x3d')])return _0x3c099d;return db[_0xa417('0x3f')][_0xa417('0x22')](_0x481cd0[_0xa417('0x5e')][_0xa417('0x3d')],{'where':{'MailAccountId':_0x3c099d['id']}})['then'](function(){return _0x3c099d;});})['then'](function(_0x5883fc){if(!_0x481cd0[_0xa417('0x5e')][_0xa417('0x3e')])return _0x5883fc;return db[_0xa417('0x40')]['update'](_0x481cd0['body']['Smtp'],{'where':{'MailAccountId':_0x5883fc['id']}})['then'](function(){return _0x5883fc;});})['then'](respondWithResult(_0x424126,null))[_0xa417('0x5d')](handleError(_0x424126,null));};exports[_0xa417('0x64')]=function(_0x54d339,_0xa5321b){return db[_0xa417('0x43')]['describe']()[_0xa417('0x10')](respondWithResult(_0xa5321b,null))[_0xa417('0x5d')](handleError(_0xa5321b,null));};exports[_0xa417('0x65')]=function(_0x267227,_0x4d25d5){if(_0x267227[_0xa417('0x5e')]['id']){delete _0x267227['body']['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x267227['params']['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x4d25d5,null))[_0xa417('0x10')](function(_0x1e7b71){if(_0x1e7b71){_0x267227[_0xa417('0x5e')]['MailAccountId']=_0x1e7b71['id'];return db['Disposition'][_0xa417('0x66')](_0x267227[_0xa417('0x5e')]);}})[_0xa417('0x10')](respondWithResult(_0x4d25d5,null))['catch'](handleError(_0x4d25d5,null));};exports[_0xa417('0x67')]=function(_0x50fbc9,_0x3ff5cc){var _0x328096={'raw':![],'where':{}};var _0x118ae2={};var _0x471932={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x50fbc9[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x3ff5cc,null))['then'](function(_0x154ab6){if(_0x154ab6){_0x118ae2[_0xa417('0x48')]=_[_0xa417('0x49')](db[_0xa417('0x68')]['rawAttributes']);_0x118ae2[_0xa417('0x4a')]=_['keys'](_0x50fbc9['query']);_0x118ae2[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x118ae2[_0xa417('0x48')],_0x118ae2[_0xa417('0x4a')]);_0x328096['attributes']=_['intersection'](_0x118ae2[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x50fbc9['query'][_0xa417('0x4e')]));_0x328096['attributes']=_0x328096[_0xa417('0x4d')][_0xa417('0x4f')]?_0x328096[_0xa417('0x4d')]:_0x118ae2['model'];if(!_0x50fbc9['query']['hasOwnProperty']('nolimit')){_0x328096[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x50fbc9[_0xa417('0x4a')][_0xa417('0x1d')]);_0x328096[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x50fbc9['query'][_0xa417('0x1c')]);}_0x328096[_0xa417('0x69')]=qs[_0xa417('0x51')](_0x50fbc9[_0xa417('0x4a')][_0xa417('0x51')]);_0x328096[_0xa417('0x52')]=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x50fbc9[_0xa417('0x4a')],_0x118ae2[_0xa417('0x4b')]));_0x328096[_0xa417('0x52')][_0xa417('0x6a')]=_0x154ab6['id'];if(_0x50fbc9[_0xa417('0x4a')][_0xa417('0x56')]){_0x328096[_0xa417('0x52')]=_[_0xa417('0x54')](_0x328096[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x328096[_0xa417('0x4d')],function(_0x5d16e1){var _0x4a2237={};_0x4a2237[_0x5d16e1]={'$like':'%'+_0x50fbc9[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x4a2237;})});}_0x328096=_['merge']({},_0x328096,_0x50fbc9['options']);return db[_0xa417('0x68')][_0xa417('0x1f')]({'where':_0x328096[_0xa417('0x52')]})[_0xa417('0x10')](function(_0x4f306e){_0x471932[_0xa417('0x1f')]=_0x4f306e;if(_0x50fbc9[_0xa417('0x4a')]['includeAll']){_0x328096[_0xa417('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x328096);})[_0xa417('0x10')](function(_0x35bff5){_0x471932[_0xa417('0x59')]=_0x35bff5;return _0x471932;});}})['then'](respondWithFilteredResult(_0x3ff5cc,_0x328096))[_0xa417('0x5d')](handleError(_0x3ff5cc,null));};exports[_0xa417('0x6b')]=function(_0x544c7b,_0x3fd9b6){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x544c7b[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x3fd9b6,null))[_0xa417('0x10')](function(_0x208234){if(_0x208234){return _0x208234['removeDispositions'](_0x544c7b[_0xa417('0x4a')]['ids']);}})[_0xa417('0x10')](respondWithStatusCode(_0x3fd9b6,null))[_0xa417('0x5d')](handleError(_0x3fd9b6,null));};exports[_0xa417('0x6c')]=function(_0x1186c7,_0x40fc43){if(_0x1186c7[_0xa417('0x5e')]['id']){delete _0x1186c7[_0xa417('0x5e')]['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x1186c7[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x40fc43,null))[_0xa417('0x10')](function(_0x37e4c6){if(_0x37e4c6){_0x1186c7[_0xa417('0x5e')][_0xa417('0x6a')]=_0x37e4c6['id'];return db[_0xa417('0x6d')][_0xa417('0x66')](_0x1186c7[_0xa417('0x5e')]);}})[_0xa417('0x10')](respondWithResult(_0x40fc43,null))[_0xa417('0x5d')](handleError(_0x40fc43,null));};exports[_0xa417('0x6e')]=function(_0x5b77be,_0x1ada45){var _0x45be6a={'raw':![],'where':{}};var _0x382835={};var _0x261ab7={'count':0x0,'rows':[]};return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x5b77be['params']['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x1ada45,null))[_0xa417('0x10')](function(_0x5b7c79){if(_0x5b7c79){_0x382835[_0xa417('0x48')]=_[_0xa417('0x49')](db[_0xa417('0x6d')][_0xa417('0x44')]);_0x382835['query']=_[_0xa417('0x49')](_0x5b77be[_0xa417('0x4a')]);_0x382835[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x382835[_0xa417('0x48')],_0x382835[_0xa417('0x4a')]);_0x45be6a[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x382835[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x5b77be[_0xa417('0x4a')][_0xa417('0x4e')]));_0x45be6a[_0xa417('0x4d')]=_0x45be6a['attributes'][_0xa417('0x4f')]?_0x45be6a[_0xa417('0x4d')]:_0x382835['model'];if(!_0x5b77be[_0xa417('0x4a')][_0xa417('0x70')]('nolimit')){_0x45be6a[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x5b77be[_0xa417('0x4a')][_0xa417('0x1d')]);_0x45be6a['offset']=qs[_0xa417('0x1c')](_0x5b77be[_0xa417('0x4a')]['offset']);}_0x45be6a[_0xa417('0x69')]=qs['sort'](_0x5b77be[_0xa417('0x4a')][_0xa417('0x51')]);_0x45be6a['where']=qs['filters'](_[_0xa417('0x53')](_0x5b77be[_0xa417('0x4a')],_0x382835[_0xa417('0x4b')]));_0x45be6a['where'][_0xa417('0x6a')]=_0x5b7c79['id'];if(_0x5b77be['query']['filter']){_0x45be6a[_0xa417('0x52')]=_[_0xa417('0x54')](_0x45be6a[_0xa417('0x52')],{'$or':_['map'](_0x45be6a[_0xa417('0x4d')],function(_0x208c4d){var _0x28e28d={};_0x28e28d[_0x208c4d]={'$like':'%'+_0x5b77be[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x28e28d;})});}_0x45be6a=_[_0xa417('0x54')]({},_0x45be6a,_0x5b77be[_0xa417('0x57')]);return db[_0xa417('0x6d')][_0xa417('0x1f')]({'where':_0x45be6a['where']})[_0xa417('0x10')](function(_0x2b1bae){_0x261ab7[_0xa417('0x1f')]=_0x2b1bae;if(_0x5b77be['query'][_0xa417('0x5b')]){_0x45be6a['include']=[{'all':!![]}];}return db[_0xa417('0x6d')][_0xa417('0x71')](_0x45be6a);})[_0xa417('0x10')](function(_0x1764c4){_0x261ab7[_0xa417('0x59')]=_0x1764c4;return _0x261ab7;});}})['then'](respondWithFilteredResult(_0x1ada45,_0x45be6a))[_0xa417('0x5d')](handleError(_0x1ada45,null));};exports[_0xa417('0x72')]=function(_0x5d5b85,_0x102093){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x5d5b85[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x102093,null))[_0xa417('0x10')](function(_0x45a804){if(_0x45a804){return _0x45a804['removeAnswers'](_0x5d5b85[_0xa417('0x4a')][_0xa417('0x73')]);}})[_0xa417('0x10')](respondWithStatusCode(_0x102093,null))[_0xa417('0x5d')](handleError(_0x102093,null));};exports[_0xa417('0x66')]=function(_0x590057,_0x3f9acf){var _0x3b94ec={'name':_0x590057['body'][_0xa417('0x28')],'key':_0x590057[_0xa417('0x5e')][_0xa417('0x47')],'provider':_0x590057[_0xa417('0x5e')]['provider']==='custom'?null:_0x590057[_0xa417('0x5e')][_0xa417('0x60')],'email':_0x590057[_0xa417('0x5e')][_0xa417('0x74')],'ListId':_0x590057[_0xa417('0x5e')][_0xa417('0x75')],'active':!_[_0xa417('0x76')](_0x590057['body']['active'])?_0x590057[_0xa417('0x5e')][_0xa417('0x77')]:!![],'description':_0x590057[_0xa417('0x5e')][_0xa417('0x78')]||null};var _0x5f50ff=getAuthenticationOptions(_0x3b94ec['provider'],_0x590057[_0xa417('0x5e')]);_0x3b94ec[_0xa417('0x3d')]=_0x5f50ff[_0xa417('0x3d')];_0x3b94ec['Smtp']=_0x5f50ff[_0xa417('0x3e')];return db[_0xa417('0x43')]['create'](_0x3b94ec,{'include':[{'model':db[_0xa417('0x40')],'as':'Smtp'},{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')}]})[_0xa417('0x10')](function(_0x59a12e){var _0x51bd21=_0x590057[_0xa417('0x33')][_0xa417('0x24')]({'plain':!![]});if(!_0x51bd21)throw new Error(_0xa417('0x79'));if(_0x51bd21[_0xa417('0x7a')]==='user'){var _0x493ed6=_0x59a12e[_0xa417('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xa417('0x5c')]({'where':{'name':_0xa417('0x25'),'userProfileId':_0x51bd21[_0xa417('0x7b')]},'raw':!![]})['then'](function(_0x1828c2){if(_0x1828c2&&_0x1828c2[_0xa417('0x7c')]===0x0){return db['UserProfileResource']['create']({'name':_0x493ed6[_0xa417('0x28')],'resourceId':_0x493ed6['id'],'type':_0x1828c2['name'],'sectionId':_0x1828c2['id']},{})[_0xa417('0x10')](function(){return _0x59a12e;});}else{return _0x59a12e;}})[_0xa417('0x5d')](function(_0x1977bf){logger[_0xa417('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1977bf);throw _0x1977bf;});}return _0x59a12e;})[_0xa417('0x10')](respondWithResult(_0x3f9acf,0xc9))['catch'](handleError(_0x3f9acf,null));};exports[_0xa417('0x7d')]=function(_0x5e5a33,_0x1e0b6d){return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x5e5a33[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x1e0b6d,null))[_0xa417('0x10')](function(_0x1f2d27){if(_0x1f2d27){return _0x1f2d27[_0xa417('0x7d')]();}return null;})[_0xa417('0x10')](respondWithResult(_0x1e0b6d,null))[_0xa417('0x5d')](handleError(_0x1e0b6d,null));};exports['addImap']=function(_0x352320,_0x14ee59){if(_0x352320[_0xa417('0x5e')]['id']){delete _0x352320[_0xa417('0x5e')]['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x352320[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x14ee59,null))['then'](function(_0x4e7d2){if(_0x4e7d2){_0x352320['body']['MailAccountId']=_0x4e7d2['id'];return db[_0xa417('0x3f')][_0xa417('0x66')](_0x352320[_0xa417('0x5e')]);}})[_0xa417('0x10')](respondWithResult(_0x14ee59,null))['catch'](handleError(_0x14ee59,null));};exports[_0xa417('0x7e')]=function(_0x372a53,_0x590a7c){return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x372a53[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x590a7c,null))[_0xa417('0x10')](function(_0xaa4be3){if(_0xaa4be3){return _0xaa4be3[_0xa417('0x7f')](null);}return null;})[_0xa417('0x10')](respondWithStatusCode(_0x590a7c,null))[_0xa417('0x5d')](handleError(_0x590a7c,null));};exports[_0xa417('0x80')]=function(_0x27833c,_0x4493b8){return db['MailAccount'][_0xa417('0x6f')]({'where':{'id':_0x27833c[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x4493b8,null))[_0xa417('0x10')](function(_0x1fae4c){if(_0x1fae4c){return _0x1fae4c[_0xa417('0x80')]();}return null;})['then'](respondWithResult(_0x4493b8,null))[_0xa417('0x5d')](handleError(_0x4493b8,null));};exports['addSmtp']=function(_0xfe92fd,_0x421b92){if(_0xfe92fd[_0xa417('0x5e')]['id']){delete _0xfe92fd[_0xa417('0x5e')]['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0xfe92fd[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x421b92,null))[_0xa417('0x10')](function(_0x27958c){if(_0x27958c){_0xfe92fd['body'][_0xa417('0x6a')]=_0x27958c['id'];return db[_0xa417('0x40')][_0xa417('0x66')](_0xfe92fd['body']);}})[_0xa417('0x10')](respondWithResult(_0x421b92,null))[_0xa417('0x5d')](handleError(_0x421b92,null));};exports['removeSmtp']=function(_0x5e5b81,_0x5c02f8){return db[_0xa417('0x43')]['findOne']({'where':{'id':_0x5e5b81[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x5c02f8,null))[_0xa417('0x10')](function(_0x63741c){if(_0x63741c){return _0x63741c['setSmtp'](null);}return null;})[_0xa417('0x10')](respondWithStatusCode(_0x5c02f8,null))[_0xa417('0x5d')](handleError(_0x5c02f8,null));};exports[_0xa417('0x81')]=function(_0x571cab,_0x249f17){return db[_0xa417('0x82')][_0xa417('0x5c')]({'where':{'id':_0x571cab[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x249f17,null))[_0xa417('0x10')](function(_0x50a654){if(_0x50a654){return _0x50a654['addInteraction'](_0x571cab[_0xa417('0x5e')]['ids'],_['omit'](_0x571cab[_0xa417('0x5e')],[_0xa417('0x73'),'id'])||{});}})[_0xa417('0x10')](respondWithResult(_0x249f17,null))[_0xa417('0x5d')](handleError(_0x249f17,null));};exports[_0xa417('0x83')]=function(_0x172074,_0x33b791){var _0x758ede={'raw':![],'where':{}};var _0x5cc276={};var _0x1ac1cd={'count':0x0,'rows':[]};return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x172074[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x33b791,null))[_0xa417('0x10')](function(_0xadb37f){if(_0xadb37f){_0x5cc276[_0xa417('0x48')]=_[_0xa417('0x49')](db[_0xa417('0x82')][_0xa417('0x44')]);_0x5cc276[_0xa417('0x4a')]=_[_0xa417('0x49')](_0x172074[_0xa417('0x4a')]);_0x5cc276[_0xa417('0x4b')]=_['intersection'](_0x5cc276[_0xa417('0x48')],_0x5cc276[_0xa417('0x4a')]);_0x758ede['attributes']=_[_0xa417('0x4c')](_0x5cc276['model'],qs[_0xa417('0x4e')](_0x172074[_0xa417('0x4a')][_0xa417('0x4e')]));_0x758ede[_0xa417('0x4d')]=_0x758ede[_0xa417('0x4d')][_0xa417('0x4f')]?_0x758ede[_0xa417('0x4d')]:_0x5cc276[_0xa417('0x48')];if(!_0x172074['query']['hasOwnProperty']('nolimit')){_0x758ede['limit']=qs[_0xa417('0x1d')](_0x172074[_0xa417('0x4a')][_0xa417('0x1d')]);_0x758ede[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x172074[_0xa417('0x4a')][_0xa417('0x1c')]);}_0x758ede[_0xa417('0x69')]=qs[_0xa417('0x51')](_0x172074[_0xa417('0x4a')]['sort']);_0x758ede['where']=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x172074[_0xa417('0x4a')],_0x5cc276[_0xa417('0x4b')]));_0x758ede['where'][_0xa417('0x6a')]=_0xadb37f['id'];if(_0x172074['query']['filter']){_0x758ede[_0xa417('0x52')]=_[_0xa417('0x54')](_0x758ede[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x758ede[_0xa417('0x4d')],function(_0x51bec2){var _0x7b57cd={};_0x7b57cd[_0x51bec2]={'$like':'%'+_0x172074[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x7b57cd;})});}_0x758ede=_[_0xa417('0x54')]({},_0x758ede,_0x172074['options']);return db[_0xa417('0x82')][_0xa417('0x1f')]({'where':_0x758ede['where']})[_0xa417('0x10')](function(_0x31fed5){_0x1ac1cd[_0xa417('0x1f')]=_0x31fed5;if(_0x172074[_0xa417('0x4a')][_0xa417('0x5b')]){_0x758ede['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xa417('0x84'),'attributes':[_0xa417('0x28'),'fullname',_0xa417('0x85')],'required':![]},{'model':db[_0xa417('0x86')],'as':'Tags','attributes':['id',_0xa417('0x28'),'color'],'where':_0x172074[_0xa417('0x4a')][_0xa417('0x87')]?{'id':_0x172074['query'][_0xa417('0x87')]}:undefined,'required':_0x172074[_0xa417('0x4a')][_0xa417('0x87')]?!![]:![]}];}return db['MailInteraction'][_0xa417('0x71')](_0x758ede);})[_0xa417('0x10')](function(_0xe6da22){_0x1ac1cd[_0xa417('0x59')]=_0xe6da22;return _0x1ac1cd;});}})['then'](respondWithFilteredResult(_0x33b791,_0x758ede))[_0xa417('0x5d')](handleError(_0x33b791,null));};exports[_0xa417('0x88')]=function addApplications(_0x4c9c24,_0x17d0e2){var _0x59532f=_0x4c9c24[_0xa417('0x62')]['id'];var _0x33a3cf=_0x4c9c24[_0xa417('0x5e')];var _0x243369=0xc8;var _0xfbe1a2=null;return db[_0xa417('0x89')][_0xa417('0x8a')]({'isolationLevel':db[_0xa417('0x89')][_0xa417('0x8b')][_0xa417('0x8c')][_0xa417('0x8d')]},function(_0x56b1be){return db['MailAccount'][_0xa417('0x6f')]({'where':{'id':_0x59532f},'transaction':_0x56b1be})[_0xa417('0x10')](function(_0x584950){if(_0x584950){return db[_0xa417('0x8e')][_0xa417('0x23')]({'where':{'MailAccountId':_0x59532f},'transaction':_0x56b1be})[_0xa417('0x10')](function(){var _0x82b8bb=_[_0xa417('0x42')](_0x33a3cf,function(_0xac88ee){_0xac88ee['MailAccountId']=_0x59532f;return _0xac88ee;});return db['MailApplication']['bulkCreate'](_0x82b8bb,{'transaction':_0x56b1be});});}else{_0x243369=0x194;_0xfbe1a2=[];}});})[_0xa417('0x10')](function(){if(_0x243369!==0x194){return db[_0xa417('0x8e')]['findAndCountAll']({'where':{'MailAccountId':_0x59532f},'order':_0xa417('0x8f')})[_0xa417('0x10')](function(_0x3ca2e8){_0xfbe1a2=_0x3ca2e8;});}})[_0xa417('0x5d')](function(_0x33bac6){_0x243369=0x1f4;logger[_0xa417('0x16')](_0x33bac6['stack']);if(_0x33bac6[_0xa417('0x28')]){delete _0x33bac6[_0xa417('0x28')];}_0xfbe1a2=_0x33bac6;})['finally'](function(){if(_0xfbe1a2===null){_0x17d0e2['sendStatus'](_0x243369);}else{if(_0x243369===0x1f4){_0x17d0e2[_0xa417('0x1a')](_0x243369)[_0xa417('0x29')](_0xfbe1a2);}else{_0x17d0e2[_0xa417('0x1a')](_0x243369)['json'](_0xfbe1a2);}}});};exports[_0xa417('0x90')]=function(_0x1514a9,_0x582d07){var _0x5c1ab1={};var _0x56b649={};var _0x2b6c84;var _0x492ac5;return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x1514a9[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x582d07,null))[_0xa417('0x10')](function(_0x201cce){if(_0x201cce){_0x2b6c84=_0x201cce;_0x56b649[_0xa417('0x48')]=_[_0xa417('0x49')](db['MailApplication'][_0xa417('0x44')]);_0x56b649[_0xa417('0x4a')]=_['keys'](_0x1514a9['query']);_0x56b649[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x56b649[_0xa417('0x48')],_0x56b649[_0xa417('0x4a')]);_0x5c1ab1['attributes']=_[_0xa417('0x4c')](_0x56b649[_0xa417('0x48')],qs['fields'](_0x1514a9[_0xa417('0x4a')][_0xa417('0x4e')]));_0x5c1ab1['attributes']=_0x5c1ab1[_0xa417('0x4d')][_0xa417('0x4f')]?_0x5c1ab1[_0xa417('0x4d')]:_0x56b649['model'];_0x5c1ab1[_0xa417('0x69')]=qs['sort'](_0x1514a9[_0xa417('0x4a')][_0xa417('0x51')]);_0x5c1ab1[_0xa417('0x52')]=qs['filters'](_[_0xa417('0x53')](_0x1514a9[_0xa417('0x4a')],_0x56b649['filters']));if(_0x1514a9['query'][_0xa417('0x56')]){_0x5c1ab1['where']=_[_0xa417('0x54')](_0x5c1ab1[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x5c1ab1[_0xa417('0x4d')],function(_0x24912c){var _0x4fd754={};_0x4fd754[_0x24912c]={'$like':'%'+_0x1514a9[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x4fd754;})});}_0x5c1ab1=_['merge']({},_0x5c1ab1,_0x1514a9[_0xa417('0x57')]);return _0x2b6c84['getApplications'](_0x5c1ab1);}})[_0xa417('0x10')](function(_0x394a36){if(_0x394a36){_0x492ac5=_0x394a36['length'];if(!_0x1514a9[_0xa417('0x4a')][_0xa417('0x70')](_0xa417('0x50'))){_0x5c1ab1[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x1514a9[_0xa417('0x4a')][_0xa417('0x1d')]);_0x5c1ab1[_0xa417('0x1c')]=qs['offset'](_0x1514a9[_0xa417('0x4a')][_0xa417('0x1c')]);}return _0x2b6c84['getApplications'](_0x5c1ab1);}})['then'](function(_0x379a36){if(_0x379a36){return _0x379a36?{'count':_0x492ac5,'rows':_0x379a36}:null;}})[_0xa417('0x10')](respondWithResult(_0x582d07,null))[_0xa417('0x5d')](handleError(_0x582d07,null));};exports[_0xa417('0x91')]=function(_0x483189,_0x1fdba7){var _0x338687={'raw':!![],'where':{}};var _0x1c895c={};var _0xecb230={'count':0x0,'rows':[]};return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x483189['params']['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x1fdba7,null))[_0xa417('0x10')](function(_0x280e3f){if(_0x280e3f){_0x1c895c[_0xa417('0x48')]=_['keys'](db[_0xa417('0x92')][_0xa417('0x44')]);_0x1c895c[_0xa417('0x4a')]=_[_0xa417('0x49')](_0x483189['query']);_0x1c895c['filters']=_[_0xa417('0x4c')](_0x1c895c['model'],_0x1c895c[_0xa417('0x4a')]);_0x338687[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x1c895c['model'],qs[_0xa417('0x4e')](_0x483189[_0xa417('0x4a')][_0xa417('0x4e')]));_0x338687[_0xa417('0x4d')]=_0x338687[_0xa417('0x4d')][_0xa417('0x4f')]?_0x338687[_0xa417('0x4d')]:_0x1c895c[_0xa417('0x48')];if(!_0x483189[_0xa417('0x4a')][_0xa417('0x70')](_0xa417('0x50'))){_0x338687['limit']=qs[_0xa417('0x1d')](_0x483189[_0xa417('0x4a')]['limit']);_0x338687[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x483189['query'][_0xa417('0x1c')]);}_0x338687[_0xa417('0x69')]=qs[_0xa417('0x51')](_0x483189['query'][_0xa417('0x51')]);_0x338687[_0xa417('0x52')]=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x483189['query'],_0x1c895c[_0xa417('0x4b')]));_0x338687[_0xa417('0x52')][_0xa417('0x6a')]=_0x280e3f['id'];if(_0x483189[_0xa417('0x4a')][_0xa417('0x56')]){_0x338687[_0xa417('0x52')]=_[_0xa417('0x54')](_0x338687['where'],{'$or':_['map'](_0x338687['attributes'],function(_0x4c75f8){var _0x400893={};_0x400893[_0x4c75f8]={'$like':'%'+_0x483189[_0xa417('0x4a')]['filter']+'%'};return _0x400893;})});}if(_0x483189[_0xa417('0x4a')][_0xa417('0x93')]){var _0x26b6b9=_0x483189[_0xa417('0x4a')]['$gte'][_0xa417('0x94')](',');var _0x16b448={};_0x16b448[_0x26b6b9[0x0]]={'$gte':moment(_0x26b6b9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x338687['where']=_['merge'](_0x338687['where'],_0x16b448);}_0x338687=_[_0xa417('0x54')]({},_0x338687,_0x483189['options']);return db[_0xa417('0x92')][_0xa417('0x1f')]({'where':_0x338687[_0xa417('0x52')]})[_0xa417('0x10')](function(_0x3b8565){_0xecb230[_0xa417('0x1f')]=_0x3b8565;if(_0x483189[_0xa417('0x4a')]['includeAll']){_0x338687[_0xa417('0x58')]=[{'all':!![]}];}return db[_0xa417('0x92')][_0xa417('0x71')](_0x338687);})[_0xa417('0x10')](function(_0x5d51e6){if(_0x483189['query'][_0xa417('0x95')]===_0xa417('0x96')){for(var _0x5afcd6=0x0;_0x5afcd6<_0x5d51e6['length'];_0x5afcd6++){_0x5d51e6[_0x5afcd6]['body']=juice(_0x5d51e6[_0x5afcd6][_0xa417('0x5e')]);}}_0xecb230['rows']=_0x5d51e6;return _0xecb230;});}})['then'](respondWithFilteredResult(_0x1fdba7,_0x338687))[_0xa417('0x5d')](handleError(_0x1fdba7,null));};exports['send']=function(_0x23afdf,_0x55d3be){var _0x4ec66a,_0x18fc9d={},_0x2603fe;if(_0x23afdf[_0xa417('0x5e')]['to']){_0x2603fe=_0x23afdf['body']['to'][_0xa417('0x94')](',')[0x0];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x23afdf[_0xa417('0x62')]['id']},'include':[{'model':db[_0xa417('0x97')],'as':'List','include':[{'model':db[_0xa417('0x98')],'as':'Contacts','where':{'email':_0x2603fe},'limit':0x1,'order':[[_0xa417('0x99'),_0xa417('0x9a')]]}]},{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e'),'raw':!![],'include':[{'model':db[_0xa417('0x9b')],'as':_0xa417('0x9b'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x55d3be,null))[_0xa417('0x10')](function(_0x1234b9){if(!_0x1234b9)return;_0x4ec66a=_0x1234b9;if(!_0x1234b9[_0xa417('0x3e')])throw new Error(_0xa417('0x9c'));if(_[_0xa417('0x76')](_0x23afdf[_0xa417('0x5e')]['from'])){_0x23afdf[_0xa417('0x5e')][_0xa417('0x9d')]=util[_0xa417('0x9e')]('%s\x20<%s>',_0x1234b9[_0xa417('0x28')],_0x1234b9[_0xa417('0x74')]||_0x1234b9['Smtp'][_0xa417('0x33')]);}if(_0x23afdf['body'][_0xa417('0x9f')]&&_0x23afdf[_0xa417('0x5e')][_0xa417('0x9f')][_0xa417('0x4f')]){for(var _0x59ce31=0x0;_0x59ce31<_0x23afdf[_0xa417('0x5e')][_0xa417('0x9f')]['length'];_0x59ce31+=0x1){_0x23afdf['body'][_0xa417('0x9f')][_0x59ce31]={'filename':_0x23afdf['body']['attachments'][_0x59ce31][_0xa417('0x28')],'path':path['join'](config['root'],'server/files/attachments',_0x23afdf['body'][_0xa417('0x9f')][_0x59ce31]['basename'])};}}var _0x5b61d9=_0x1234b9['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xa417('0xa0'),{'account':_0x5b61d9,'message':_0x23afdf[_0xa417('0x5e')]});})[_0xa417('0x10')](function(_0x36b0db){if(!_0x36b0db)return;_0x18fc9d=_0x36b0db;if(!_0x4ec66a[_0xa417('0xa1')])throw new Error(_0xa417('0xa2'));if(_0x4ec66a[_0xa417('0xa1')][_0xa417('0xa3')][_0xa417('0x4f')])return _0x4ec66a['List'][_0xa417('0xa3')][0x0];return db[_0xa417('0x98')][_0xa417('0x66')](_['defaults'](_0x23afdf['body'],{'firstName':_0x23afdf['body']['to'],'email':_0x23afdf['body']['to'],'phone':_0x23afdf[_0xa417('0x5e')]['to'],'ListId':_0x4ec66a[_0xa417('0x75')]}));})['then'](function(_0x3bdc97){if(!_0x3bdc97)return;var _0x344001={'UserId':_0x23afdf[_0xa417('0x33')]['id'],'ContactId':_0x3bdc97['id'],'MailAccountId':_0x4ec66a['id'],'inReplyTo':_0x18fc9d[_0xa417('0xa4')],'to':_0x23afdf['body'][_0xa417('0x9d')],'cc':_0x23afdf['body']['cc'],'subject':_0x23afdf['body'][_0xa417('0xa5')],'attach':_0x23afdf['body']['attach'],'firstMsgDirection':_0xa417('0xa6'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xa417('0xa6'),'Messages':[_[_0xa417('0x54')](_0x23afdf[_0xa417('0x5e')],{'messageId':_0x18fc9d[_0xa417('0xa4')],'sentAt':moment()[_0xa417('0x9e')](_0xa417('0xa7')),'read':!![],'MailAccountId':_0x4ec66a['id'],'UserId':_0x23afdf[_0xa417('0x33')]['id'],'ContactId':_0x3bdc97['id']})]};if(_0x23afdf[_0xa417('0x5e')][_0xa417('0xa8')]){_0x344001=_[_0xa417('0x54')](_0x344001,_0x23afdf[_0xa417('0x5e')][_0xa417('0xa8')]);}return db[_0xa417('0x82')][_0xa417('0x66')](_0x344001,{'include':[{'model':db[_0xa417('0x92')],'as':_0xa417('0xa9')}]});})[_0xa417('0x10')](respondWithResult(_0x55d3be,null))[_0xa417('0x5d')](handleError(_0x55d3be,null));};exports['verifySmtp']=function(_0x280837,_0x20939b){return db['MailAccount'][_0xa417('0x5c')]({'where':{'id':_0x280837[_0xa417('0x62')]['id']},'include':[{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e'),'raw':!![],'include':[{'model':db[_0xa417('0x9b')],'as':_0xa417('0x9b'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20939b,null))['then'](function(_0x24a6f3){if(!_0x24a6f3['Smtp'])return;var _0x5412a4=_0x24a6f3['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x5412a4});})[_0xa417('0x10')](respondWithResult(_0x20939b,null))['catch'](handleError(_0x20939b,null));};exports['destroy']=function(_0x4e004d,_0x36ad9f){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x4e004d[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x36ad9f,null))['then'](function(_0x1fad42){if(_0x1fad42&&_0x1fad42[_0xa417('0x3a')]){throw new db[(_0xa417('0xaa'))]['ValidationError'](_0xa417('0xab'));}return _0x1fad42;})[_0xa417('0x10')](removeEntity(_0x36ad9f,null))['catch'](handleError(_0x36ad9f,null));};exports['addAgents']=function(_0x295846,_0x3bd8a7){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x295846[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x3bd8a7,null))[_0xa417('0x10')](function(_0x266eb3){if(_0x266eb3){return _0x266eb3['addAgents'](_0x295846[_0xa417('0x5e')]['ids'],_[_0xa417('0xac')](_0x295846[_0xa417('0x5e')],[_0xa417('0x73'),'id'])||{})[_0xa417('0xad')](function(_0x446872){for(var _0x324156=0x0;_0x324156<_0x295846[_0xa417('0x5e')][_0xa417('0x73')]['length'];_0x324156+=0x1){socket[_0xa417('0xae')](_0xa417('0xaf'),{'UserId':Number(_0x295846['body']['ids'][_0x324156]),'MailAccountId':Number(_0x295846[_0xa417('0x62')]['id'])});}return _0x446872;});}})[_0xa417('0x10')](respondWithResult(_0x3bd8a7,null))[_0xa417('0x5d')](handleError(_0x3bd8a7,null));};exports['removeAgents']=function(_0x1556a4,_0x45c3ad){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x1556a4[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x45c3ad,null))[_0xa417('0x10')](function(_0x2c2d3d){if(_0x2c2d3d){return _0x2c2d3d[_0xa417('0xb0')](_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')])[_0xa417('0x10')](function(){if(_[_0xa417('0xb1')](_0x1556a4['query']['ids'])){for(var _0x549ade=0x0;_0x549ade<_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')]['length'];_0x549ade+=0x1){socket[_0xa417('0xae')](_0xa417('0xb2'),{'UserId':Number(_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')][_0x549ade]),'MailAccountId':Number(_0x1556a4['params']['id'])});}}else{socket[_0xa417('0xae')]('userMailAccount:remove',{'UserId':Number(_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')]),'MailAccountId':Number(_0x1556a4[_0xa417('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x45c3ad,null))[_0xa417('0x5d')](handleError(_0x45c3ad,null));};exports['getAgents']=function(_0xf3b244,_0x1934ab){var _0x47c738={};var _0x2821d3={};var _0x4f7e27;var _0x3c7ad5;return db['MailAccount'][_0xa417('0x6f')]({'where':{'id':_0xf3b244[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x1934ab,null))[_0xa417('0x10')](function(_0x3820cc){if(_0x3820cc){_0x4f7e27=_0x3820cc;_0x2821d3[_0xa417('0x48')]=_['keys'](db[_0xa417('0xb3')][_0xa417('0x44')]);_0x2821d3[_0xa417('0x4a')]=_['keys'](_0xf3b244[_0xa417('0x4a')]);_0x2821d3[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x2821d3[_0xa417('0x48')],_0x2821d3[_0xa417('0x4a')]);_0x47c738[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x2821d3[_0xa417('0x48')],qs[_0xa417('0x4e')](_0xf3b244[_0xa417('0x4a')]['fields']));_0x47c738['attributes']=_0x47c738[_0xa417('0x4d')][_0xa417('0x4f')]?_0x47c738[_0xa417('0x4d')]:_0x2821d3[_0xa417('0x48')];_0x47c738['order']=qs['sort'](_0xf3b244[_0xa417('0x4a')][_0xa417('0x51')]);_0x47c738['where']=qs[_0xa417('0x4b')](_['pick'](_0xf3b244[_0xa417('0x4a')],_0x2821d3[_0xa417('0x4b')]));if(_0xf3b244[_0xa417('0x4a')]['filter']){_0x47c738[_0xa417('0x52')]=_['merge'](_0x47c738[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x47c738[_0xa417('0x4d')],function(_0x138a25){var _0xeaad06={};_0xeaad06[_0x138a25]={'$like':'%'+_0xf3b244['query'][_0xa417('0x56')]+'%'};return _0xeaad06;})});}_0x47c738=_[_0xa417('0x54')]({},_0x47c738,_0xf3b244[_0xa417('0x57')]);return _0x4f7e27['getAgents'](_0x47c738);}})[_0xa417('0x10')](function(_0x30e5aa){if(_0x30e5aa){_0x3c7ad5=_0x30e5aa[_0xa417('0x4f')];if(!_0xf3b244[_0xa417('0x4a')][_0xa417('0x70')](_0xa417('0x50'))){_0x47c738[_0xa417('0x1d')]=qs['limit'](_0xf3b244[_0xa417('0x4a')][_0xa417('0x1d')]);_0x47c738[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0xf3b244['query']['offset']);}return _0x4f7e27[_0xa417('0xb4')](_0x47c738);}})[_0xa417('0x10')](function(_0x21feb5){if(_0x21feb5){return _0x21feb5?{'count':_0x3c7ad5,'rows':_0x21feb5}:null;}})[_0xa417('0x10')](respondWithResult(_0x1934ab,null))[_0xa417('0x5d')](handleError(_0x1934ab,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 603c6f8..b77372a 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe225=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','remove'];(function(_0x3cc914,_0x56cbbd){var _0x217fb3=function(_0x256142){while(--_0x256142){_0x3cc914['push'](_0x3cc914['shift']());}};_0x217fb3(++_0x56cbbd);}(_0xe225,0x1bd));var _0x5e22=function(_0x5a4b16,_0x294bb1){_0x5a4b16=_0x5a4b16-0x0;var _0x5236dc=_0xe225[_0x5a4b16];return _0x5236dc;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x5e22('0x0'))['db'][_0x5e22('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5e22('0x2')};function emitEvent(_0x5ca6b5){return function(_0x45790b,_0x4e0d42,_0x50df23){MailAccountEvents['emit'](_0x5ca6b5+':'+_0x45790b['id'],_0x45790b);MailAccountEvents[_0x5e22('0x3')](_0x5ca6b5,_0x45790b);_0x50df23(null);};}for(var e in events){if(events[_0x5e22('0x4')](e)){var event=events[e];MailAccount[_0x5e22('0x5')](e,emitEvent(event));}}module[_0x5e22('0x6')]=MailAccountEvents; \ No newline at end of file +var _0xed20=['../../mysqldb','MailAccount','save','update','remove','emit','hook','exports','events'];(function(_0x3ed0bf,_0x5bb8a9){var _0x1e618e=function(_0x4230b6){while(--_0x4230b6){_0x3ed0bf['push'](_0x3ed0bf['shift']());}};_0x1e618e(++_0x5bb8a9);}(_0xed20,0xce));var _0x0ed2=function(_0x39c3ed,_0x2e1561){_0x39c3ed=_0x39c3ed-0x0;var _0x4f058c=_0xed20[_0x39c3ed];return _0x4f058c;};'use strict';var EventEmitter=require(_0x0ed2('0x0'));var MailAccount=require(_0x0ed2('0x1'))['db'][_0x0ed2('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ed2('0x3'),'afterUpdate':_0x0ed2('0x4'),'afterDestroy':_0x0ed2('0x5')};function emitEvent(_0x2a6405){return function(_0x395e2d,_0x20cac9,_0x5693ea){MailAccountEvents[_0x0ed2('0x6')](_0x2a6405+':'+_0x395e2d['id'],_0x395e2d);MailAccountEvents[_0x0ed2('0x6')](_0x2a6405,_0x395e2d);_0x5693ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x0ed2('0x7')](e,emitEvent(event));}}module[_0x0ed2('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 187a76c..2f25404 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd551=['exports','define','MailAccount','provider','custom','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0xd551,0x1a1));var _0x1d55=function(_0x3e698a,_0x59967d){_0x3e698a=_0x3e698a-0x0;var _0x2b4996=_0xd551[_0x3e698a];return _0x2b4996;};'use strict';var attributes=require(_0x1d55('0x0'));module[_0x1d55('0x1')]=function(_0xfa2b83){return _0xfa2b83[_0x1d55('0x2')](_0x1d55('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4892d9=this;var _0x278b0a={'id':_0x4892d9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4892d9[_0x1d55('0x4')]!==_0x1d55('0x5')){_0x278b0a['service']=_0x4892d9['provider'];}else{_0x278b0a[_0x1d55('0x6')]=_0x4892d9['Smtp'][_0x1d55('0x6')];_0x278b0a[_0x1d55('0x7')]=_0x4892d9[_0x1d55('0x8')][_0x1d55('0x7')];_0x278b0a['secure']=_0x4892d9[_0x1d55('0x8')][_0x1d55('0x9')];}if(_0x4892d9[_0x1d55('0x8')][_0x1d55('0xa')]){if(_0x4892d9[_0x1d55('0x8')][_0x1d55('0xb')]){if(!_0x4892d9[_0x1d55('0x8')][_0x1d55('0xc')])throw new Error(_0x1d55('0xd'));_0x278b0a[_0x1d55('0xe')]={'type':_0x1d55('0xf'),'user':_0x4892d9['Smtp'][_0x1d55('0x10')],'accessToken':_0x4892d9['Smtp']['CloudProvider'][_0x1d55('0x11')]};}else{_0x278b0a[_0x1d55('0xe')]={'user':_0x4892d9[_0x1d55('0x8')]['user'],'pass':_0x4892d9[_0x1d55('0x8')][_0x1d55('0x12')]};}}return _0x278b0a;}}});}; \ No newline at end of file +var _0x44aa=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','./mailAccount.attributes','exports','MailAccount','provider','custom','service','Smtp'];(function(_0xcc470b,_0x668b1){var _0x1707aa=function(_0x3e0255){while(--_0x3e0255){_0xcc470b['push'](_0xcc470b['shift']());}};_0x1707aa(++_0x668b1);}(_0x44aa,0x173));var _0xa44a=function(_0xe66186,_0x1d97b8){_0xe66186=_0xe66186-0x0;var _0x3cc27d=_0x44aa[_0xe66186];return _0x3cc27d;};'use strict';var attributes=require(_0xa44a('0x0'));module[_0xa44a('0x1')]=function(_0x4af259){return _0x4af259['define'](_0xa44a('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3373d9=this;var _0x5858eb={'id':_0x3373d9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3373d9[_0xa44a('0x3')]!==_0xa44a('0x4')){_0x5858eb[_0xa44a('0x5')]=_0x3373d9['provider'];}else{_0x5858eb['host']=_0x3373d9[_0xa44a('0x6')][_0xa44a('0x7')];_0x5858eb[_0xa44a('0x8')]=_0x3373d9[_0xa44a('0x6')][_0xa44a('0x8')];_0x5858eb[_0xa44a('0x9')]=_0x3373d9[_0xa44a('0x6')]['secure'];}if(_0x3373d9[_0xa44a('0x6')][_0xa44a('0xa')]){if(_0x3373d9[_0xa44a('0x6')][_0xa44a('0xb')]){if(!_0x3373d9[_0xa44a('0x6')][_0xa44a('0xc')])throw new Error(_0xa44a('0xd'));_0x5858eb['auth']={'type':_0xa44a('0xe'),'user':_0x3373d9['Smtp'][_0xa44a('0xf')],'accessToken':_0x3373d9[_0xa44a('0x6')][_0xa44a('0xc')][_0xa44a('0x10')]};}else{_0x5858eb[_0xa44a('0x11')]={'user':_0x3373d9[_0xa44a('0x6')][_0xa44a('0xf')],'pass':_0x3373d9[_0xa44a('0x6')]['pass']};}}return _0x5858eb;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4e1a17c..fec713d 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x4f2419,_0xb45d3f){var _0x10966a=function(_0x1f44fb){while(--_0x1f44fb){_0x4f2419['push'](_0x4f2419['shift']());}};_0x10966a(++_0xb45d3f);}(_0xef0f,0x168));var _0xfef0=function(_0x3b7034,_0x521ed9){_0x3b7034=_0x3b7034-0x0;var _0x2d300b=_0xef0f[_0x3b7034];return _0x2d300b;};'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 _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x25139d,_0x1e040d){var _0x4427f5=function(_0x33eeb5){while(--_0x33eeb5){_0x25139d['push'](_0x25139d['shift']());}};_0x4427f5(++_0x1e040d);}(_0x687b,0x14a));var _0xb687=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x687b[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f34052e..38def62 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7d6=['register','./mailAccount.events','remove','update'];(function(_0x52ca18,_0x5864d1){var _0x3b04d8=function(_0x19bd2e){while(--_0x19bd2e){_0x52ca18['push'](_0x52ca18['shift']());}};_0x3b04d8(++_0x5864d1);}(_0xe7d6,0x85));var _0x6e7d=function(_0x3ae89c,_0x4bc1d3){_0x3ae89c=_0x3ae89c-0x0;var _0x54df34=_0xe7d6[_0x3ae89c];return _0x54df34;};'use strict';var MailAccountEvents=require(_0x6e7d('0x0'));var events=['save',_0x6e7d('0x1'),_0x6e7d('0x2')];function createListener(_0xf91a1,_0x5ec949){return function(_0x5eea9b){_0x5ec949['emit'](_0xf91a1,_0x5eea9b);};}function removeListener(_0x2ba59f,_0x23b386){return function(){MailAccountEvents['removeListener'](_0x2ba59f,_0x23b386);};}exports[_0x6e7d('0x3')]=function(_0x17339b){for(var _0x41b1db=0x0,_0x1bec54=events['length'];_0x41b1db<_0x1bec54;_0x41b1db++){var _0x4587ee=events[_0x41b1db];var _0x3bdbc7=createListener('mailAccount:'+_0x4587ee,_0x17339b);MailAccountEvents['on'](_0x4587ee,_0x3bdbc7);}}; \ No newline at end of file +var _0x4d45=['./mailAccount.events','save','remove','update','register','length','mailAccount:'];(function(_0x57f1b9,_0x5e00e3){var _0x98c3a3=function(_0x566288){while(--_0x566288){_0x57f1b9['push'](_0x57f1b9['shift']());}};_0x98c3a3(++_0x5e00e3);}(_0x4d45,0x7e));var _0x54d4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4d45[_0x1035c1];return _0x308d67;};'use strict';var MailAccountEvents=require(_0x54d4('0x0'));var events=[_0x54d4('0x1'),_0x54d4('0x2'),_0x54d4('0x3')];function createListener(_0x3a74bd,_0x48f236){return function(_0x47cda0){_0x48f236['emit'](_0x3a74bd,_0x47cda0);};}function removeListener(_0x5d531a,_0x373b11){return function(){MailAccountEvents['removeListener'](_0x5d531a,_0x373b11);};}exports[_0x54d4('0x4')]=function(_0xaa2734){for(var _0x240a78=0x0,_0x38b399=events[_0x54d4('0x5')];_0x240a78<_0x38b399;_0x240a78++){var _0x6338f=events[_0x240a78];var _0x5ae585=createListener(_0x54d4('0x6')+_0x6338f,_0xaa2734);MailAccountEvents['on'](_0x6338f,_0x5ae585);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index d41d531..8b6f769 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d33=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','destroy','exports'];(function(_0x159459,_0x58ee4b){var _0x18c058=function(_0x1dc2bb){while(--_0x1dc2bb){_0x159459['push'](_0x159459['shift']());}};_0x18c058(++_0x58ee4b);}(_0x0d33,0x1b3));var _0x30d3=function(_0x2703b4,_0x327991){_0x2703b4=_0x2703b4-0x0;var _0x394cdf=_0x0d33[_0x2703b4];return _0x394cdf;};'use strict';var multer=require(_0x30d3('0x0'));var util=require(_0x30d3('0x1'));var path=require(_0x30d3('0x2'));var timeout=require(_0x30d3('0x3'));var express=require(_0x30d3('0x4'));var router=express[_0x30d3('0x5')]();var fs_extra=require(_0x30d3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x30d3('0x7'));var controller=require(_0x30d3('0x8'));router[_0x30d3('0x9')](_0x30d3('0xa'),auth[_0x30d3('0xb')](),controller['show']);router[_0x30d3('0xc')](_0x30d3('0xa'),auth[_0x30d3('0xb')](),controller['update']);router['delete'](_0x30d3('0xa'),auth['isAuthenticated'](),controller[_0x30d3('0xd')]);module[_0x30d3('0xe')]=router; \ No newline at end of file +var _0x4f6c=['put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show'];(function(_0x43cb5f,_0x4e62cc){var _0x286c59=function(_0xc7d9af){while(--_0xc7d9af){_0x43cb5f['push'](_0x43cb5f['shift']());}};_0x286c59(++_0x4e62cc);}(_0x4f6c,0xff));var _0xc4f6=function(_0x5ea390,_0x262b04){_0x5ea390=_0x5ea390-0x0;var _0x354a3f=_0x4f6c[_0x5ea390];return _0x354a3f;};'use strict';var multer=require(_0xc4f6('0x0'));var util=require(_0xc4f6('0x1'));var path=require(_0xc4f6('0x2'));var timeout=require(_0xc4f6('0x3'));var express=require(_0xc4f6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc4f6('0x5'));var interaction=require(_0xc4f6('0x6'));var config=require('../../config/environment');var controller=require(_0xc4f6('0x7'));router['get'](_0xc4f6('0x8'),auth[_0xc4f6('0x9')](),controller[_0xc4f6('0xa')]);router[_0xc4f6('0xb')](_0xc4f6('0x8'),auth[_0xc4f6('0x9')](),controller['update']);router['delete'](_0xc4f6('0x8'),auth[_0xc4f6('0x9')](),controller[_0xc4f6('0xc')]);module[_0xc4f6('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 2fe628e..0913b50 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50ea=['*,*,*,*','sequelize','noop','TEXT','STRING'];(function(_0x164d7f,_0x394afe){var _0x134277=function(_0x510565){while(--_0x510565){_0x164d7f['push'](_0x164d7f['shift']());}};_0x134277(++_0x394afe);}(_0x50ea,0xf6));var _0xa50e=function(_0x5c9afe,_0x2d1d03){_0x5c9afe=_0x5c9afe-0x0;var _0xfb727c=_0x50ea[_0x5c9afe];return _0xfb727c;};'use strict';var Sequelize=require(_0xa50e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa50e('0x1')},'appdata':{'type':Sequelize[_0xa50e('0x2')]()},'description':{'type':Sequelize[_0xa50e('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa50e('0x4')}}; \ No newline at end of file +var _0xd7c0=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x1a2d37,_0x19cd85){var _0x4d5e76=function(_0x4c254d){while(--_0x4c254d){_0x1a2d37['push'](_0x1a2d37['shift']());}};_0x4d5e76(++_0x19cd85);}(_0xd7c0,0x1b4));var _0x0d7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd7c0[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x0d7c('0x0'));module[_0x0d7c('0x1')]={'priority':{'type':Sequelize[_0x0d7c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0d7c('0x3')],'allowNull':![],'defaultValue':_0x0d7c('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0d7c('0x3')]},'interval':{'type':Sequelize[_0x0d7c('0x3')],'defaultValue':_0x0d7c('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a7b4a68..c8c44e9 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0xda21e8,_0x19d184){var _0x28904b=function(_0x10c833){while(--_0x10c833){_0xda21e8['push'](_0xda21e8['shift']());}};_0x28904b(++_0x19d184);}(_0xe706,0xa3));var _0x6e70=function(_0x3f3519,_0xd53cae){_0x3f3519=_0x3f3519-0x0;var _0x23b6bf=_0xe706[_0x3f3519];return _0x23b6bf;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x17c601,_0x47d691){var _0x116e26=function(_0xce5b73){while(--_0xce5b73){_0x17c601['push'](_0x17c601['shift']());}};_0x116e26(++_0x47d691);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xcb91[_0x3da612];return _0x1a9d1d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a387e14..8577d7e 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51e9=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x395aff,_0x2ab13d){var _0x218774=function(_0x4f874e){while(--_0x4f874e){_0x395aff['push'](_0x395aff['shift']());}};_0x218774(++_0x2ab13d);}(_0x51e9,0x1a1));var _0x951e=function(_0x39529b,_0x3cc044){_0x39529b=_0x39529b-0x0;var _0x26ba43=_0x51e9[_0x39529b];return _0x26ba43;};'use strict';var _=require(_0x951e('0x0'));var util=require(_0x951e('0x1'));var logger=require(_0x951e('0x2'))(_0x951e('0x3'));var moment=require(_0x951e('0x4'));var BPromise=require(_0x951e('0x5'));var rp=require(_0x951e('0x6'));var fs=require('fs');var path=require(_0x951e('0x7'));var rimraf=require(_0x951e('0x8'));var config=require(_0x951e('0x9'));var attributes=require(_0x951e('0xa'));module[_0x951e('0xb')]=function(_0x43a58f,_0x2f1f06){return _0x43a58f[_0x951e('0xc')](_0x951e('0xd'),attributes,{'tableName':_0x951e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x951e('0xf')});}; \ No newline at end of file +var _0xfeea=['moment','request-promise','rimraf','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x35289d,_0x230ce7){var _0x2dec71=function(_0x391feb){while(--_0x391feb){_0x35289d['push'](_0x35289d['shift']());}};_0x2dec71(++_0x230ce7);}(_0xfeea,0x131));var _0xafee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfeea[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xafee('0x0'));var util=require(_0xafee('0x1'));var logger=require('../../config/logger')(_0xafee('0x2'));var moment=require(_0xafee('0x3'));var BPromise=require('bluebird');var rp=require(_0xafee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafee('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xafee('0x6')]=function(_0x33c208,_0x4f48a5){return _0x33c208[_0xafee('0x7')](_0xafee('0x8'),attributes,{'tableName':_0xafee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xafee('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index db17ad4..ac539d9 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabd2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','limit','then','lodash','util'];(function(_0xd66253,_0x28277b){var _0x6cc65f=function(_0x1b6ec4){while(--_0x1b6ec4){_0xd66253['push'](_0xd66253['shift']());}};_0x6cc65f(++_0x28277b);}(_0xabd2,0x10c));var _0x2abd=function(_0xbbaa03,_0x3be846){_0xbbaa03=_0xbbaa03-0x0;var _0x54558c=_0xabd2[_0xbbaa03];return _0x54558c;};'use strict';var _=require(_0x2abd('0x0'));var util=require(_0x2abd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2abd('0x2'))['db'];var utils=require(_0x2abd('0x3'));var logger=require(_0x2abd('0x4'))(_0x2abd('0x5'));var config=require(_0x2abd('0x6'));var jayson=require(_0x2abd('0x7'));var client=jayson[_0x2abd('0x8')][_0x2abd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28f848,_0x488370,_0x866534){return new BPromise(function(_0x40a6d9,_0x504a21){return client[_0x2abd('0xa')](_0x28f848,_0x866534)['then'](function(_0x21b27e){logger[_0x2abd('0xb')](_0x2abd('0xc'),_0x488370,_0x2abd('0xd'));logger[_0x2abd('0xe')](_0x2abd('0xf'),_0x488370,_0x2abd('0xd'),JSON[_0x2abd('0x10')](_0x21b27e));if(_0x21b27e[_0x2abd('0x11')]){if(_0x21b27e[_0x2abd('0x11')][_0x2abd('0x12')]===0x1f4){logger['error'](_0x2abd('0xc'),_0x488370,_0x21b27e[_0x2abd('0x11')][_0x2abd('0x13')]);return _0x504a21(_0x21b27e[_0x2abd('0x11')][_0x2abd('0x13')]);}logger['error'](_0x2abd('0xc'),_0x488370,_0x21b27e[_0x2abd('0x11')][_0x2abd('0x13')]);return _0x40a6d9(_0x21b27e[_0x2abd('0x11')][_0x2abd('0x13')]);}else{logger['info'](_0x2abd('0xc'),_0x488370,_0x2abd('0xd'));_0x40a6d9(_0x21b27e[_0x2abd('0x14')][_0x2abd('0x13')]);}})[_0x2abd('0x15')](function(_0xe81c78){logger[_0x2abd('0x11')]('MailApplication,\x20%s,\x20%s',_0x488370,_0xe81c78);_0x504a21(_0xe81c78);});});}exports[_0x2abd('0x16')]=function(_0x352122){var _0x59269c=this;return new Promise(function(_0x139edf,_0x435aee){return db[_0x2abd('0x17')][_0x2abd('0x18')](_0x352122[_0x2abd('0x19')],{'raw':_0x352122[_0x2abd('0x1a')]?_0x352122['options'][_0x2abd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x352122['options']?_0x352122[_0x2abd('0x1a')]['where']||null:null,'attributes':_0x352122['options']?_0x352122[_0x2abd('0x1a')]['attributes']||null:null,'limit':_0x352122[_0x2abd('0x1a')]?_0x352122['options'][_0x2abd('0x1c')]||null:null})[_0x2abd('0x1d')](function(_0x2541cc){logger[_0x2abd('0xb')]('UpdateMailApplication',_0x352122);logger[_0x2abd('0xe')](_0x2abd('0x16'),_0x352122,JSON[_0x2abd('0x10')](_0x2541cc));_0x139edf(_0x2541cc);})[_0x2abd('0x15')](function(_0x242e70){logger[_0x2abd('0x11')](_0x2abd('0x16'),_0x242e70[_0x2abd('0x13')],_0x352122);_0x435aee(_0x59269c[_0x2abd('0x11')](0x1f4,_0x242e70[_0x2abd('0x13')]));});});}; \ No newline at end of file +var _0xe310=['client','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe310,0x105));var _0x0e31=function(_0x14b2e1,_0x3636f0){_0x14b2e1=_0x14b2e1-0x0;var _0x55c89b=_0xe310[_0x14b2e1];return _0x55c89b;};'use strict';var _=require(_0x0e31('0x0'));var util=require('util');var moment=require(_0x0e31('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e31('0x2'));var fs=require('fs');var Redis=require(_0x0e31('0x3'));var db=require(_0x0e31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e31('0x5'))(_0x0e31('0x6'));var config=require(_0x0e31('0x7'));var jayson=require(_0x0e31('0x8'));var client=jayson[_0x0e31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23283b,_0x158630,_0x225385){return new BPromise(function(_0x1ea4bd,_0x55ac58){return client['request'](_0x23283b,_0x225385)[_0x0e31('0xa')](function(_0x50826a){logger[_0x0e31('0xb')](_0x0e31('0xc'),_0x158630,_0x0e31('0xd'));logger[_0x0e31('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x158630,_0x0e31('0xd'),JSON[_0x0e31('0xf')](_0x50826a));if(_0x50826a[_0x0e31('0x10')]){if(_0x50826a[_0x0e31('0x10')][_0x0e31('0x11')]===0x1f4){logger[_0x0e31('0x10')](_0x0e31('0xc'),_0x158630,_0x50826a[_0x0e31('0x10')]['message']);return _0x55ac58(_0x50826a['error'][_0x0e31('0x12')]);}logger[_0x0e31('0x10')](_0x0e31('0xc'),_0x158630,_0x50826a[_0x0e31('0x10')][_0x0e31('0x12')]);return _0x1ea4bd(_0x50826a[_0x0e31('0x10')][_0x0e31('0x12')]);}else{logger['info'](_0x0e31('0xc'),_0x158630,'request\x20sent');_0x1ea4bd(_0x50826a[_0x0e31('0x13')]['message']);}})[_0x0e31('0x14')](function(_0x1db6d3){logger[_0x0e31('0x10')](_0x0e31('0xc'),_0x158630,_0x1db6d3);_0x55ac58(_0x1db6d3);});});}exports[_0x0e31('0x15')]=function(_0x293032){var _0x25ae51=this;return new Promise(function(_0x1da285,_0x7c28d8){return db[_0x0e31('0x16')][_0x0e31('0x17')](_0x293032[_0x0e31('0x18')],{'raw':_0x293032[_0x0e31('0x19')]?_0x293032[_0x0e31('0x19')][_0x0e31('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293032['options']?_0x293032[_0x0e31('0x19')][_0x0e31('0x1b')]||null:null,'attributes':_0x293032[_0x0e31('0x19')]?_0x293032[_0x0e31('0x19')][_0x0e31('0x1c')]||null:null,'limit':_0x293032['options']?_0x293032[_0x0e31('0x19')][_0x0e31('0x1d')]||null:null})[_0x0e31('0xa')](function(_0x37d2c5){logger['info'](_0x0e31('0x15'),_0x293032);logger[_0x0e31('0xe')]('UpdateMailApplication',_0x293032,JSON[_0x0e31('0xf')](_0x37d2c5));_0x1da285(_0x37d2c5);})[_0x0e31('0x14')](function(_0x3973e4){logger[_0x0e31('0x10')](_0x0e31('0x15'),_0x3973e4['message'],_0x293032);_0x7c28d8(_0x25ae51[_0x0e31('0x10')](0x1f4,_0x3973e4[_0x0e31('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d2ffc03..c289421 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ace=['delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update'];(function(_0x9e879f,_0x376ad4){var _0x3da06d=function(_0x2ff4ad){while(--_0x2ff4ad){_0x9e879f['push'](_0x9e879f['shift']());}};_0x3da06d(++_0x376ad4);}(_0x4ace,0x160));var _0xe4ac=function(_0x52908f,_0x53a7a3){_0x52908f=_0x52908f-0x0;var _0x1a6af0=_0x4ace[_0x52908f];return _0x1a6af0;};'use strict';var express=require(_0xe4ac('0x0'));var router=express[_0xe4ac('0x1')]();var auth=require(_0xe4ac('0x2'));var interaction=require(_0xe4ac('0x3'));var controller=require(_0xe4ac('0x4'));router[_0xe4ac('0x5')]('/',auth[_0xe4ac('0x6')](),controller[_0xe4ac('0x7')]);router[_0xe4ac('0x5')](_0xe4ac('0x8'),auth[_0xe4ac('0x6')](),controller[_0xe4ac('0x9')]);router[_0xe4ac('0x5')](_0xe4ac('0xa'),auth['isAuthenticated'](),controller[_0xe4ac('0xb')]);router[_0xe4ac('0x5')]('/:id/messages',auth[_0xe4ac('0x6')](),controller['getMessages']);router[_0xe4ac('0x5')](_0xe4ac('0xc'),auth['isAuthenticated'](),controller[_0xe4ac('0xd')]);router[_0xe4ac('0xe')]('/',auth['isAuthenticated'](),controller[_0xe4ac('0xf')]);router[_0xe4ac('0xe')](_0xe4ac('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0xe4ac('0xe')](_0xe4ac('0x11'),auth['isAuthenticated'](),interaction[_0xe4ac('0x12')](_0xe4ac('0x13'),_0xe4ac('0x14')),controller[_0xe4ac('0x15')]);router[_0xe4ac('0x16')](_0xe4ac('0xa'),auth['isAuthenticated'](),interaction[_0xe4ac('0x12')](_0xe4ac('0x13'),_0xe4ac('0x17')),controller[_0xe4ac('0x18')]);router[_0xe4ac('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0xe4ac('0x12')](_0xe4ac('0x13'),'mailinteraction:destroy'),controller[_0xe4ac('0x1a')]);router[_0xe4ac('0x19')](_0xe4ac('0x11'),auth[_0xe4ac('0x6')](),controller[_0xe4ac('0x1b')]);module[_0xe4ac('0x1c')]=router; \ No newline at end of file +var _0xc2bc=['getMessages','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages'];(function(_0x118749,_0x50e848){var _0x20d489=function(_0x3c80a2){while(--_0x3c80a2){_0x118749['push'](_0x118749['shift']());}};_0x20d489(++_0x50e848);}(_0xc2bc,0x189));var _0xcc2b=function(_0xf9e26f,_0x22a5d3){_0xf9e26f=_0xf9e26f-0x0;var _0xc94e83=_0xc2bc[_0xf9e26f];return _0xc94e83;};'use strict';var express=require(_0xcc2b('0x0'));var router=express[_0xcc2b('0x1')]();var auth=require(_0xcc2b('0x2'));var interaction=require(_0xcc2b('0x3'));var controller=require(_0xcc2b('0x4'));router[_0xcc2b('0x5')]('/',auth[_0xcc2b('0x6')](),controller[_0xcc2b('0x7')]);router['get'](_0xcc2b('0x8'),auth[_0xcc2b('0x6')](),controller[_0xcc2b('0x9')]);router[_0xcc2b('0x5')](_0xcc2b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcc2b('0x5')](_0xcc2b('0xb'),auth[_0xcc2b('0x6')](),controller[_0xcc2b('0xc')]);router['get']('/:id/download',auth[_0xcc2b('0x6')](),controller[_0xcc2b('0xd')]);router[_0xcc2b('0xe')]('/',auth[_0xcc2b('0x6')](),controller[_0xcc2b('0xf')]);router[_0xcc2b('0xe')](_0xcc2b('0xb'),auth[_0xcc2b('0x6')](),controller[_0xcc2b('0x10')]);router[_0xcc2b('0xe')](_0xcc2b('0x11'),auth[_0xcc2b('0x6')](),interaction[_0xcc2b('0x12')](_0xcc2b('0x13'),_0xcc2b('0x14')),controller['addTags']);router[_0xcc2b('0x15')](_0xcc2b('0xa'),auth[_0xcc2b('0x6')](),interaction['tracked'](_0xcc2b('0x13'),_0xcc2b('0x16')),controller['update']);router[_0xcc2b('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xcc2b('0x12')](_0xcc2b('0x13'),'mailinteraction:destroy'),controller[_0xcc2b('0x18')]);router[_0xcc2b('0x17')](_0xcc2b('0x11'),auth['isAuthenticated'](),controller[_0xcc2b('0x19')]);module[_0xcc2b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d846ccb..8ef146f 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6a9=['exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','sequelize','iconv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6a9,0x166));var _0x9a6a=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xa6a9[_0x3d27ba];return _0xf01885;};'use strict';var Sequelize=require(_0x9a6a('0x0'));var iconv=require(_0x9a6a('0x1'));module[_0x9a6a('0x2')]={'closed':{'type':Sequelize[_0x9a6a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9a6a('0x4')]},'secondDisposition':{'type':Sequelize[_0x9a6a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9a6a('0x4')]},'note':{'type':Sequelize[_0x9a6a('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x9a6a('0x4')]},'cc':{'type':Sequelize[_0x9a6a('0x5')](_0x9a6a('0x6'))},'subject':{'type':Sequelize[_0x9a6a('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9a6a('0x7')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9a6a('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x9a6a('0x8')]('in',_0x9a6a('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9a6a('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9a6a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb06=['BOOLEAN','DATE','STRING','TEXT','long','out','ENUM','iconv','exports'];(function(_0x25b40d,_0x3d8e6c){var _0x25adab=function(_0x44de2b){while(--_0x44de2b){_0x25b40d['push'](_0x25b40d['shift']());}};_0x25adab(++_0x3d8e6c);}(_0xdb06,0x1e4));var _0x6db0=function(_0x2510db,_0x22d7b7){_0x2510db=_0x2510db-0x0;var _0x4617c6=_0xdb06[_0x2510db];return _0x4617c6;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x6db0('0x0'));module[_0x6db0('0x1')]={'closed':{'type':Sequelize[_0x6db0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6db0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6db0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6db0('0x4')]},'note':{'type':Sequelize[_0x6db0('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x6db0('0x4')]},'cc':{'type':Sequelize[_0x6db0('0x5')](_0x6db0('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x6db0('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6db0('0x3')]},'substatus':{'type':Sequelize[_0x6db0('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x6db0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6db0('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6db0('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6db0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8135e4e..c9083ad 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95b9=['query','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','MailMessage','addMessage','ids','findOne','hasOwnProperty','order','sort','pick','filters','where','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','omit','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','subject','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','sendStatus','rimraf','zip-dir','moment','bluebird','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','user','catch','params','model','keys'];(function(_0x5d761c,_0xed601d){var _0x1381fa=function(_0x28d9d5){while(--_0x28d9d5){_0x5d761c['push'](_0x5d761c['shift']());}};_0x1381fa(++_0xed601d);}(_0x95b9,0x19e));var _0x995b=function(_0x5256f6,_0x5e6284){_0x5256f6=_0x5256f6-0x0;var _0x5ce6a3=_0x95b9[_0x5256f6];return _0x5ce6a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x995b('0x0'));var zipdir=require(_0x995b('0x1'));var moment=require(_0x995b('0x2'));var BPromise=require(_0x995b('0x3'));var util=require('util');var path=require(_0x995b('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x995b('0x5'));var interaction=require(_0x995b('0x6'));var qs=require(_0x995b('0x7'));var logger=require(_0x995b('0x8'))(_0x995b('0x9'));var config=require(_0x995b('0xa'));var db=require(_0x995b('0xb'))['db'];var htmlEntities=require(_0x995b('0xc'));config[_0x995b('0xd')]=_[_0x995b('0xe')](config[_0x995b('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x995b('0xd')]));require(_0x995b('0xf'))[_0x995b('0x10')](socket);function respondWithStatusCode(_0x2faaec,_0x75187){_0x75187=_0x75187||0xcc;return function(_0x515583){if(_0x515583){return _0x2faaec['sendStatus'](_0x75187);}return _0x2faaec[_0x995b('0x11')](_0x75187)[_0x995b('0x12')]();};}function respondWithResult(_0x3522a2,_0x21963f){_0x21963f=_0x21963f||0xc8;return function(_0xefc886){if(_0xefc886){return _0x3522a2[_0x995b('0x11')](_0x21963f)[_0x995b('0x13')](_0xefc886);}};}function respondWithFilteredResult(_0x2d00b4,_0x571dd8){return function(_0x1ea50b){if(_0x1ea50b){var _0x5e3aa4=typeof _0x571dd8[_0x995b('0x14')]===_0x995b('0x15')&&typeof _0x571dd8[_0x995b('0x16')]===_0x995b('0x15');var _0x109260=_0x1ea50b[_0x995b('0x17')];var _0x48e277=_0x5e3aa4?0x0:_0x571dd8[_0x995b('0x14')];var _0x426920=_0x5e3aa4?_0x1ea50b[_0x995b('0x17')]:_0x571dd8['offset']+_0x571dd8[_0x995b('0x16')];var _0x3fae96;if(_0x426920>=_0x109260){_0x426920=_0x109260;_0x3fae96=0xc8;}else{_0x3fae96=0xce;}_0x2d00b4[_0x995b('0x11')](_0x3fae96);return _0x2d00b4[_0x995b('0x18')](_0x995b('0x19'),_0x48e277+'-'+_0x426920+'/'+_0x109260)['json'](_0x1ea50b);}return null;};}function saveUpdates(_0x1657f8){return function(_0x29fbbd){if(_0x29fbbd){return _0x29fbbd[_0x995b('0x1a')](_0x1657f8)[_0x995b('0x1b')](function(_0x1051cc){return _0x1051cc;});}return null;};}function removeEntity(_0x344e3e){return function(_0x3f3963){if(_0x3f3963){return _0x3f3963['destroy']()[_0x995b('0x1b')](function(){_0x344e3e[_0x995b('0x11')](0xcc)[_0x995b('0x12')]();});}};}function handleEntityNotFound(_0x401ca0){return function(_0x585700){if(!_0x585700){_0x401ca0['sendStatus'](0x194);}return _0x585700;};}function handleError(_0x437b88,_0x14d0b5){_0x14d0b5=_0x14d0b5||0x1f4;return function(_0x120bc2){logger[_0x995b('0x1c')](_0x120bc2[_0x995b('0x1d')]);if(_0x120bc2[_0x995b('0x1e')]){delete _0x120bc2[_0x995b('0x1e')];}_0x437b88['status'](_0x14d0b5)[_0x995b('0x1f')](_0x120bc2);};}exports[_0x995b('0x20')]=function(_0x24b8bc,_0x880186){var _0x12c7ba={};var _0x253234=_['map'](db[_0x995b('0x21')][_0x995b('0x22')],function(_0xa54603){return{'name':_0xa54603[_0x995b('0x23')],'type':_0xa54603[_0x995b('0x24')][_0x995b('0x25')]};});_0x12c7ba=qs[_0x995b('0x26')](_0x253234,_0x24b8bc);return interaction[_0x995b('0x27')](_0x995b('0x28'),_0x24b8bc['query'],_0x24b8bc[_0x995b('0x29')],_0x12c7ba,_0x253234)[_0x995b('0x1b')](respondWithFilteredResult(_0x880186,_0x12c7ba))[_0x995b('0x2a')](handleError(_0x880186,null));};exports['show']=function(_0x466eb5,_0x22f5a8){var _0x584cd9={'raw':![],'where':{'id':_0x466eb5[_0x995b('0x2b')]['id']}},_0x4a603d={};_0x4a603d[_0x995b('0x2c')]=_[_0x995b('0x2d')](db['MailInteraction']['rawAttributes']);_0x4a603d[_0x995b('0x2e')]=_['keys'](_0x466eb5[_0x995b('0x2e')]);_0x4a603d['filters']=_[_0x995b('0x2f')](_0x4a603d[_0x995b('0x2c')],_0x4a603d[_0x995b('0x2e')]);_0x584cd9[_0x995b('0x30')]=_[_0x995b('0x2f')](_0x4a603d[_0x995b('0x2c')],qs['fields'](_0x466eb5[_0x995b('0x2e')][_0x995b('0x31')]));_0x584cd9['attributes']=_0x584cd9['attributes'][_0x995b('0x32')]?_0x584cd9[_0x995b('0x30')]:_0x4a603d[_0x995b('0x2c')];if(_0x466eb5[_0x995b('0x2e')]['includeAll']){_0x584cd9[_0x995b('0x33')]=[{'all':!![]}];}_0x584cd9=_[_0x995b('0x34')]({},_0x584cd9,_0x466eb5[_0x995b('0x35')]);return db[_0x995b('0x21')][_0x995b('0x36')](_0x584cd9)[_0x995b('0x1b')](handleEntityNotFound(_0x22f5a8,null))['then'](respondWithResult(_0x22f5a8,null))[_0x995b('0x2a')](handleError(_0x22f5a8,null));};exports['create']=function(_0x5d4f16,_0x564cdd){return db[_0x995b('0x21')][_0x995b('0x37')](_0x5d4f16['body'],{})[_0x995b('0x1b')](respondWithResult(_0x564cdd,0xc9))[_0x995b('0x2a')](handleError(_0x564cdd,null));};exports[_0x995b('0x1a')]=function(_0x3dbb18,_0x3b154b){if(_0x3dbb18[_0x995b('0x38')]['id']){delete _0x3dbb18[_0x995b('0x38')]['id'];}return db[_0x995b('0x21')]['find']({'where':{'id':_0x3dbb18[_0x995b('0x2b')]['id']}})[_0x995b('0x1b')](handleEntityNotFound(_0x3b154b,null))[_0x995b('0x1b')](saveUpdates(_0x3dbb18[_0x995b('0x38')],null))[_0x995b('0x1b')](respondWithResult(_0x3b154b,null))[_0x995b('0x2a')](handleError(_0x3b154b,null));};exports['destroy']=function(_0xc6b461,_0x28c602){return db[_0x995b('0x21')][_0x995b('0x36')]({'where':{'id':_0xc6b461[_0x995b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x28c602,null))[_0x995b('0x1b')](removeEntity(_0x28c602,null))[_0x995b('0x2a')](handleError(_0x28c602,null));};exports['describe']=function(_0xa49d10,_0x3da958){return db[_0x995b('0x21')][_0x995b('0x39')]()[_0x995b('0x1b')](respondWithResult(_0x3da958,null))[_0x995b('0x2a')](handleError(_0x3da958,null));};exports['addMessage']=function(_0x5051d1,_0xe7e8d2){return db[_0x995b('0x3a')]['find']({'where':{'id':_0x5051d1['params']['id']}})['then'](handleEntityNotFound(_0xe7e8d2,null))[_0x995b('0x1b')](function(_0x51c8ac){if(_0x51c8ac){return _0x51c8ac[_0x995b('0x3b')](_0x5051d1[_0x995b('0x38')]['ids'],_['omit'](_0x5051d1[_0x995b('0x38')],[_0x995b('0x3c'),'id'])||{});}})[_0x995b('0x1b')](respondWithResult(_0xe7e8d2,null))['catch'](handleError(_0xe7e8d2,null));};exports['getMessages']=function(_0x45b214,_0x590f6e){var _0x314788={'raw':![],'where':{}};var _0x2ba076={};var _0x5f4f7a={'count':0x0,'rows':[]};return db['MailInteraction'][_0x995b('0x3d')]({'where':{'id':_0x45b214[_0x995b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x590f6e,null))[_0x995b('0x1b')](function(_0x5e1fa1){if(_0x5e1fa1){_0x2ba076[_0x995b('0x2c')]=_['keys'](db[_0x995b('0x3a')]['rawAttributes']);_0x2ba076['query']=_[_0x995b('0x2d')](_0x45b214[_0x995b('0x2e')]);_0x2ba076['filters']=_[_0x995b('0x2f')](_0x2ba076[_0x995b('0x2c')],_0x2ba076[_0x995b('0x2e')]);_0x314788[_0x995b('0x30')]=_['intersection'](_0x2ba076['model'],qs['fields'](_0x45b214[_0x995b('0x2e')][_0x995b('0x31')]));_0x314788[_0x995b('0x30')]=_0x314788[_0x995b('0x30')][_0x995b('0x32')]?_0x314788[_0x995b('0x30')]:_0x2ba076[_0x995b('0x2c')];if(!_0x45b214['query'][_0x995b('0x3e')]('nolimit')){_0x314788['limit']=qs[_0x995b('0x16')](_0x45b214[_0x995b('0x2e')]['limit']);_0x314788[_0x995b('0x14')]=qs[_0x995b('0x14')](_0x45b214[_0x995b('0x2e')][_0x995b('0x14')]);}_0x314788[_0x995b('0x3f')]=qs['sort'](_0x45b214[_0x995b('0x2e')][_0x995b('0x40')]);_0x314788['where']=qs['filters'](_[_0x995b('0x41')](_0x45b214[_0x995b('0x2e')],_0x2ba076[_0x995b('0x42')]));_0x314788[_0x995b('0x43')][_0x995b('0x44')]=_0x5e1fa1['id'];if(_0x45b214['query'][_0x995b('0x45')]){_0x314788[_0x995b('0x43')]=_[_0x995b('0x34')](_0x314788[_0x995b('0x43')],{'$or':_['map'](_0x314788['attributes'],function(_0x43bb41){var _0x29f5f3={};_0x29f5f3[_0x43bb41]={'$like':'%'+_0x45b214[_0x995b('0x2e')]['filter']+'%'};return _0x29f5f3;})});}if(_0x45b214[_0x995b('0x2e')]['$gte']){var _0x5d2d1c=_0x45b214[_0x995b('0x2e')][_0x995b('0x46')][_0x995b('0x47')](',');var _0x47ba3c={};_0x47ba3c[_0x5d2d1c[0x0]]={'$gte':moment(_0x5d2d1c[0x1])['format'](_0x995b('0x48'))};_0x314788[_0x995b('0x43')]=_[_0x995b('0x34')](_0x314788['where'],_0x47ba3c);}_0x314788=_[_0x995b('0x34')]({},_0x314788,_0x45b214[_0x995b('0x35')]);return db['MailMessage'][_0x995b('0x17')]({'where':_0x314788[_0x995b('0x43')]})['then'](function(_0xde7d4f){_0x5f4f7a[_0x995b('0x17')]=_0xde7d4f;if(_0x45b214[_0x995b('0x2e')]['includeAll']){_0x314788[_0x995b('0x33')]=[{'all':!![]}];}return db['MailMessage'][_0x995b('0x27')](_0x314788);})[_0x995b('0x1b')](function(_0x3a92b1){if(_0x45b214[_0x995b('0x2e')][_0x995b('0x49')]===_0x995b('0x4a')){for(var _0x34ebe8=0x0;_0x34ebe8<_0x3a92b1[_0x995b('0x32')];_0x34ebe8++){_0x3a92b1[_0x34ebe8][_0x995b('0x38')]=juice(_0x3a92b1[_0x34ebe8][_0x995b('0x38')]);}}_0x5f4f7a[_0x995b('0x4b')]=_0x3a92b1;return _0x5f4f7a;});}})[_0x995b('0x1b')](respondWithFilteredResult(_0x590f6e,_0x314788))['catch'](handleError(_0x590f6e,null));};exports[_0x995b('0x4c')]=function(_0x3691f0,_0x1b632b){return db[_0x995b('0x21')][_0x995b('0x36')]({'where':{'id':_0x3691f0['params']['id']}})['then'](handleEntityNotFound(_0x1b632b,null))[_0x995b('0x1b')](function(_0x14dc45){if(_0x14dc45){return _0x14dc45['setTags'](_0x3691f0['body'][_0x995b('0x3c')],_[_0x995b('0x4d')](_0x3691f0[_0x995b('0x38')],[_0x995b('0x3c'),'id'])||{})[_0x995b('0x4e')](function(){return db[_0x995b('0x4f')][_0x995b('0x27')]({'attributes':['id',_0x995b('0x1e'),_0x995b('0x50')],'where':{'id':_0x3691f0[_0x995b('0x38')][_0x995b('0x3c')]}});})[_0x995b('0x1b')](function(_0x1c4be3){socket['emit'](_0x995b('0x51'),{'id':Number(_0x3691f0[_0x995b('0x2b')]['id']),'tags':_0x1c4be3||[]});return{'id':Number(_0x3691f0[_0x995b('0x2b')]['id']),'tags':_0x1c4be3||[]};});}})[_0x995b('0x1b')](respondWithResult(_0x1b632b,null))['catch'](handleError(_0x1b632b,null));};exports[_0x995b('0x52')]=function(_0x40b7ab,_0x5208c3){return db[_0x995b('0x21')]['find']({'where':{'id':_0x40b7ab[_0x995b('0x2b')]['id']}})[_0x995b('0x1b')](handleEntityNotFound(_0x5208c3,null))['then'](function(_0x4f4669){if(_0x4f4669){return _0x4f4669[_0x995b('0x52')](_0x40b7ab[_0x995b('0x2e')][_0x995b('0x3c')]);}})['then'](respondWithStatusCode(_0x5208c3,null))[_0x995b('0x2a')](handleError(_0x5208c3,null));};exports[_0x995b('0x53')]=function(_0x5418b3,_0x541e88){var _0x95b83c=moment()[_0x995b('0x54')]()[_0x995b('0x55')]();var _0x41b9cc=path['join'](config[_0x995b('0x56')],_0x995b('0x57'),_0x995b('0x58'),_0x995b('0x59'));var _0x54f808=path[_0x995b('0x5a')](config['root'],_0x995b('0x57'),_0x995b('0x58'),'attachments');var _0x513648=path[_0x995b('0x5a')](_0x41b9cc,_0x95b83c);var _0x419165=util['format'](_0x995b('0x5b'),_0x5418b3[_0x995b('0x2b')]['id'],_0x95b83c);var _0x4bdd95=path['join'](_0x41b9cc,_0x419165);var _0x5e45c9=[];if(_0x5418b3[_0x995b('0x2e')]['attachments']){_0x5e45c9[_0x995b('0x5c')]({'model':db[_0x995b('0x5d')],'as':_0x995b('0x5e'),'raw':!![]});}var _0x29e9eb=[{'model':db[_0x995b('0x3a')],'as':_0x995b('0x5f'),'attributes':['id',_0x995b('0x38'),_0x995b('0x60'),'to','cc',_0x995b('0x61'),'subject',_0x995b('0x62')],'where':{'secret':![]},'order':qs[_0x995b('0x40')]('id'),'include':_0x5e45c9}];return db['MailInteraction']['find']({'where':{'id':_0x5418b3['params']['id']},'include':_0x29e9eb})[_0x995b('0x1b')](handleEntityNotFound(_0x541e88,null))['then'](function(_0x36cd95){if(_0x36cd95&&_0x36cd95[_0x995b('0x5f')]){var _0x2cd2b4=_0x36cd95[_0x995b('0x63')]({'plain':!![]});fs[_0x995b('0x64')](_0x513648);return BPromise[_0x995b('0x65')](_0x2cd2b4['Messages'],function(_0x532a62,_0x262d51){var _0x117851={'from':_0x532a62['from'],'to':_0x532a62['to']||_0x995b('0x66'),'subject':_0x532a62[_0x995b('0x67')],'html':htmlEntities[_0x995b('0x68')](_0x532a62[_0x995b('0x38')]),'headers':{'Date':moment(_0x532a62['createdAt'])[_0x995b('0x69')](_0x995b('0x6a'))},'attachments':[]};if(_0x532a62['cc']){_0x117851[_0x995b('0x6b')]['Cc']=_0x532a62['cc'];}if(_0x532a62[_0x995b('0x61')]){_0x117851['headers'][_0x995b('0x6c')]=_0x532a62[_0x995b('0x61')];}return new BPromise(function(_0x23a979,_0x53a2a7){if(_0x532a62[_0x995b('0x5e')]){for(var _0x5eb72d=0x0;_0x5eb72d<_0x532a62[_0x995b('0x5e')][_0x995b('0x32')];_0x5eb72d++){var _0x10d2b5=_0x532a62[_0x995b('0x5e')][_0x5eb72d];var _0x41748c=path[_0x995b('0x5a')](_0x54f808,_0x10d2b5[_0x995b('0x6d')]);if(fs['existsSync'](_0x41748c)){_0x117851['attachments'][_0x995b('0x5c')]({'name':_0x10d2b5[_0x995b('0x1e')],'contentType':_0x10d2b5[_0x995b('0x24')],'data':fs[_0x995b('0x6e')](_0x41748c)});}}}emlformat[_0x995b('0x6f')](_0x117851,function(_0x312c1e,_0x5354d2){if(_0x312c1e)return _0x53a2a7(_0x312c1e);fs[_0x995b('0x70')](path['join'](_0x513648,util[_0x995b('0x69')](_0x995b('0x71'),_0x262d51)),_0x5354d2);return _0x23a979(_0x5354d2);});});})[_0x995b('0x1b')](function(){return new BPromise(function(_0x52bc32,_0x5a70d3){zipdir(_0x513648,{'saveTo':_0x4bdd95},function(_0x3e301d,_0x4d8e7b){if(_0x3e301d)return _0x5a70d3(_0x3e301d);return _0x52bc32(_0x4d8e7b);});})[_0x995b('0x1b')](function(){return new BPromise(function(_0x2d103a,_0x26d675){rimraf(_0x513648,function(_0x3c6eeb){if(_0x3c6eeb)_0x26d675(_0x3c6eeb);return _0x2d103a();});});})[_0x995b('0x1b')](function(){return _0x541e88[_0x995b('0x53')](_0x4bdd95,_0x419165,function(_0x1a8d45){if(!_0x1a8d45)fs['unlinkSync'](_0x4bdd95);});});});}else{return _0x541e88[_0x995b('0x72')](0xc8);}})[_0x995b('0x2a')](handleError(_0x541e88,null));}; \ No newline at end of file +var _0x4eb5=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','then','destroy','stack','name','send','index','map','fieldName','type','key','findAll','query','params','model','keys','MailInteraction','filters','attributes','intersection','fields','length','includeAll','include','merge','options','catch','create','body','update','describe','MailMessage','find','addMessage','ids','getMessages','findOne','rawAttributes','order','pick','MailInteractionId','where','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','root','tmp','files','format','transcript-%d-%s.zip','attachments','push','Attachment','Attachments','Messages','from','subject','createdAt','sort','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','moment','util','path','lodash','juice'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4eb5,0x1a6));var _0x54eb=function(_0x28c60a,_0x2dc2c7){_0x28c60a=_0x28c60a-0x0;var _0x1e8393=_0x4eb5[_0x28c60a];return _0x1e8393;};'use strict';var emlformat=require(_0x54eb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x54eb('0x1'));var BPromise=require('bluebird');var util=require(_0x54eb('0x2'));var path=require(_0x54eb('0x3'));var fs=require('fs');var _=require(_0x54eb('0x4'));var juice=require(_0x54eb('0x5'));var Redis=require(_0x54eb('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x54eb('0x7'));var logger=require(_0x54eb('0x8'))(_0x54eb('0x9'));var config=require(_0x54eb('0xa'));var db=require(_0x54eb('0xb'))['db'];var htmlEntities=require(_0x54eb('0xc'));config[_0x54eb('0xd')]=_[_0x54eb('0xe')](config[_0x54eb('0xd')],{'host':_0x54eb('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x54eb('0x10'))['register'](socket);function respondWithStatusCode(_0x2a3b28,_0x1bea9c){_0x1bea9c=_0x1bea9c||0xcc;return function(_0xd61e54){if(_0xd61e54){return _0x2a3b28[_0x54eb('0x11')](_0x1bea9c);}return _0x2a3b28[_0x54eb('0x12')](_0x1bea9c)['end']();};}function respondWithResult(_0x6385a5,_0xb38bbf){_0xb38bbf=_0xb38bbf||0xc8;return function(_0x3c33cd){if(_0x3c33cd){return _0x6385a5[_0x54eb('0x12')](_0xb38bbf)[_0x54eb('0x13')](_0x3c33cd);}};}function respondWithFilteredResult(_0x57e0f1,_0x24dbb5){return function(_0x5a91c9){if(_0x5a91c9){var _0x44e8fa=typeof _0x24dbb5['offset']==='undefined'&&typeof _0x24dbb5[_0x54eb('0x14')]===_0x54eb('0x15');var _0x159f9a=_0x5a91c9['count'];var _0x93160a=_0x44e8fa?0x0:_0x24dbb5[_0x54eb('0x16')];var _0x153498=_0x44e8fa?_0x5a91c9[_0x54eb('0x17')]:_0x24dbb5[_0x54eb('0x16')]+_0x24dbb5['limit'];var _0x99a540;if(_0x153498>=_0x159f9a){_0x153498=_0x159f9a;_0x99a540=0xc8;}else{_0x99a540=0xce;}_0x57e0f1['status'](_0x99a540);return _0x57e0f1[_0x54eb('0x18')](_0x54eb('0x19'),_0x93160a+'-'+_0x153498+'/'+_0x159f9a)[_0x54eb('0x13')](_0x5a91c9);}return null;};}function saveUpdates(_0x4efa58){return function(_0x467e3b){if(_0x467e3b){return _0x467e3b['update'](_0x4efa58)[_0x54eb('0x1a')](function(_0x4ab039){return _0x4ab039;});}return null;};}function removeEntity(_0x2d7d93){return function(_0x35409b){if(_0x35409b){return _0x35409b[_0x54eb('0x1b')]()[_0x54eb('0x1a')](function(){_0x2d7d93['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e11){return function(_0x42eb19){if(!_0x42eb19){_0x4a9e11[_0x54eb('0x11')](0x194);}return _0x42eb19;};}function handleError(_0x40f2c4,_0xe69c9e){_0xe69c9e=_0xe69c9e||0x1f4;return function(_0x3179ea){logger['error'](_0x3179ea[_0x54eb('0x1c')]);if(_0x3179ea[_0x54eb('0x1d')]){delete _0x3179ea[_0x54eb('0x1d')];}_0x40f2c4[_0x54eb('0x12')](_0xe69c9e)[_0x54eb('0x1e')](_0x3179ea);};}exports[_0x54eb('0x1f')]=function(_0x241f1a,_0x5ba0ef){var _0x456366={};var _0x471619=_[_0x54eb('0x20')](db['MailInteraction']['rawAttributes'],function(_0x5d5ba4){return{'name':_0x5d5ba4[_0x54eb('0x21')],'type':_0x5d5ba4[_0x54eb('0x22')][_0x54eb('0x23')]};});_0x456366=qs['getOptions'](_0x471619,_0x241f1a);return interaction[_0x54eb('0x24')]('mail',_0x241f1a[_0x54eb('0x25')],_0x241f1a['user'],_0x456366,_0x471619)['then'](respondWithFilteredResult(_0x5ba0ef,_0x456366))['catch'](handleError(_0x5ba0ef,null));};exports['show']=function(_0x5c2f9b,_0x5f5875){var _0x2253de={'raw':![],'where':{'id':_0x5c2f9b[_0x54eb('0x26')]['id']}},_0x3da3d1={};_0x3da3d1[_0x54eb('0x27')]=_[_0x54eb('0x28')](db[_0x54eb('0x29')]['rawAttributes']);_0x3da3d1[_0x54eb('0x25')]=_[_0x54eb('0x28')](_0x5c2f9b[_0x54eb('0x25')]);_0x3da3d1[_0x54eb('0x2a')]=_['intersection'](_0x3da3d1[_0x54eb('0x27')],_0x3da3d1['query']);_0x2253de[_0x54eb('0x2b')]=_[_0x54eb('0x2c')](_0x3da3d1['model'],qs[_0x54eb('0x2d')](_0x5c2f9b[_0x54eb('0x25')]['fields']));_0x2253de[_0x54eb('0x2b')]=_0x2253de['attributes'][_0x54eb('0x2e')]?_0x2253de[_0x54eb('0x2b')]:_0x3da3d1['model'];if(_0x5c2f9b[_0x54eb('0x25')][_0x54eb('0x2f')]){_0x2253de[_0x54eb('0x30')]=[{'all':!![]}];}_0x2253de=_[_0x54eb('0x31')]({},_0x2253de,_0x5c2f9b[_0x54eb('0x32')]);return db[_0x54eb('0x29')]['find'](_0x2253de)[_0x54eb('0x1a')](handleEntityNotFound(_0x5f5875,null))['then'](respondWithResult(_0x5f5875,null))[_0x54eb('0x33')](handleError(_0x5f5875,null));};exports['create']=function(_0x59acbe,_0x4efcb5){return db[_0x54eb('0x29')][_0x54eb('0x34')](_0x59acbe[_0x54eb('0x35')],{})[_0x54eb('0x1a')](respondWithResult(_0x4efcb5,0xc9))[_0x54eb('0x33')](handleError(_0x4efcb5,null));};exports[_0x54eb('0x36')]=function(_0x24110e,_0x53ea68){if(_0x24110e[_0x54eb('0x35')]['id']){delete _0x24110e['body']['id'];}return db[_0x54eb('0x29')]['find']({'where':{'id':_0x24110e[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x53ea68,null))[_0x54eb('0x1a')](saveUpdates(_0x24110e['body'],null))[_0x54eb('0x1a')](respondWithResult(_0x53ea68,null))[_0x54eb('0x33')](handleError(_0x53ea68,null));};exports[_0x54eb('0x1b')]=function(_0x3a9821,_0x29307f){return db['MailInteraction']['find']({'where':{'id':_0x3a9821[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x29307f,null))['then'](removeEntity(_0x29307f,null))['catch'](handleError(_0x29307f,null));};exports[_0x54eb('0x37')]=function(_0x1be2b0,_0x1fe4c3){return db['MailInteraction']['describe']()[_0x54eb('0x1a')](respondWithResult(_0x1fe4c3,null))[_0x54eb('0x33')](handleError(_0x1fe4c3,null));};exports['addMessage']=function(_0x375eea,_0x20a936){return db[_0x54eb('0x38')][_0x54eb('0x39')]({'where':{'id':_0x375eea[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x20a936,null))[_0x54eb('0x1a')](function(_0x46f676){if(_0x46f676){return _0x46f676[_0x54eb('0x3a')](_0x375eea['body'][_0x54eb('0x3b')],_['omit'](_0x375eea['body'],['ids','id'])||{});}})[_0x54eb('0x1a')](respondWithResult(_0x20a936,null))[_0x54eb('0x33')](handleError(_0x20a936,null));};exports[_0x54eb('0x3c')]=function(_0x49f7ae,_0x15bfb3){var _0x335ec5={'raw':![],'where':{}};var _0x449f81={};var _0x1b9899={'count':0x0,'rows':[]};return db['MailInteraction'][_0x54eb('0x3d')]({'where':{'id':_0x49f7ae['params']['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x15bfb3,null))['then'](function(_0x510ada){if(_0x510ada){_0x449f81['model']=_[_0x54eb('0x28')](db['MailMessage'][_0x54eb('0x3e')]);_0x449f81[_0x54eb('0x25')]=_['keys'](_0x49f7ae[_0x54eb('0x25')]);_0x449f81[_0x54eb('0x2a')]=_[_0x54eb('0x2c')](_0x449f81[_0x54eb('0x27')],_0x449f81[_0x54eb('0x25')]);_0x335ec5[_0x54eb('0x2b')]=_['intersection'](_0x449f81[_0x54eb('0x27')],qs[_0x54eb('0x2d')](_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x2d')]));_0x335ec5['attributes']=_0x335ec5['attributes'][_0x54eb('0x2e')]?_0x335ec5['attributes']:_0x449f81[_0x54eb('0x27')];if(!_0x49f7ae[_0x54eb('0x25')]['hasOwnProperty']('nolimit')){_0x335ec5[_0x54eb('0x14')]=qs[_0x54eb('0x14')](_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x14')]);_0x335ec5[_0x54eb('0x16')]=qs[_0x54eb('0x16')](_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x16')]);}_0x335ec5[_0x54eb('0x3f')]=qs['sort'](_0x49f7ae[_0x54eb('0x25')]['sort']);_0x335ec5['where']=qs[_0x54eb('0x2a')](_[_0x54eb('0x40')](_0x49f7ae[_0x54eb('0x25')],_0x449f81[_0x54eb('0x2a')]));_0x335ec5['where'][_0x54eb('0x41')]=_0x510ada['id'];if(_0x49f7ae[_0x54eb('0x25')]['filter']){_0x335ec5[_0x54eb('0x42')]=_[_0x54eb('0x31')](_0x335ec5[_0x54eb('0x42')],{'$or':_[_0x54eb('0x20')](_0x335ec5[_0x54eb('0x2b')],function(_0x5528fe){var _0x3c7d19={};_0x3c7d19[_0x5528fe]={'$like':'%'+_0x49f7ae[_0x54eb('0x25')]['filter']+'%'};return _0x3c7d19;})});}if(_0x49f7ae[_0x54eb('0x25')]['$gte']){var _0x499662=_0x49f7ae['query'][_0x54eb('0x43')]['split'](',');var _0x368aaf={};_0x368aaf[_0x499662[0x0]]={'$gte':moment(_0x499662[0x1])['format'](_0x54eb('0x44'))};_0x335ec5[_0x54eb('0x42')]=_['merge'](_0x335ec5[_0x54eb('0x42')],_0x368aaf);}_0x335ec5=_[_0x54eb('0x31')]({},_0x335ec5,_0x49f7ae[_0x54eb('0x32')]);return db[_0x54eb('0x38')][_0x54eb('0x17')]({'where':_0x335ec5['where']})[_0x54eb('0x1a')](function(_0x403f76){_0x1b9899[_0x54eb('0x17')]=_0x403f76;if(_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x2f')]){_0x335ec5['include']=[{'all':!![]}];}return db[_0x54eb('0x38')][_0x54eb('0x24')](_0x335ec5);})[_0x54eb('0x1a')](function(_0x3116d2){if(_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x45')]===_0x54eb('0x46')){for(var _0x2840ae=0x0;_0x2840ae<_0x3116d2[_0x54eb('0x2e')];_0x2840ae++){_0x3116d2[_0x2840ae][_0x54eb('0x35')]=juice(_0x3116d2[_0x2840ae]['body']);}}_0x1b9899[_0x54eb('0x47')]=_0x3116d2;return _0x1b9899;});}})[_0x54eb('0x1a')](respondWithFilteredResult(_0x15bfb3,_0x335ec5))[_0x54eb('0x33')](handleError(_0x15bfb3,null));};exports['addTags']=function(_0x35c03f,_0x39a23e){return db['MailInteraction'][_0x54eb('0x39')]({'where':{'id':_0x35c03f[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x39a23e,null))[_0x54eb('0x1a')](function(_0x3dbb6e){if(_0x3dbb6e){return _0x3dbb6e[_0x54eb('0x48')](_0x35c03f['body'][_0x54eb('0x3b')],_[_0x54eb('0x49')](_0x35c03f['body'],[_0x54eb('0x3b'),'id'])||{})[_0x54eb('0x4a')](function(){return db['Tag'][_0x54eb('0x24')]({'attributes':['id',_0x54eb('0x1d'),'color'],'where':{'id':_0x35c03f[_0x54eb('0x35')][_0x54eb('0x3b')]}});})[_0x54eb('0x1a')](function(_0x4c5b70){socket[_0x54eb('0x4b')](_0x54eb('0x4c'),{'id':Number(_0x35c03f[_0x54eb('0x26')]['id']),'tags':_0x4c5b70||[]});return{'id':Number(_0x35c03f[_0x54eb('0x26')]['id']),'tags':_0x4c5b70||[]};});}})[_0x54eb('0x1a')](respondWithResult(_0x39a23e,null))['catch'](handleError(_0x39a23e,null));};exports[_0x54eb('0x4d')]=function(_0xd13908,_0x31d0fe){return db[_0x54eb('0x29')]['find']({'where':{'id':_0xd13908[_0x54eb('0x26')]['id']}})['then'](handleEntityNotFound(_0x31d0fe,null))['then'](function(_0x5f5919){if(_0x5f5919){return _0x5f5919['removeTags'](_0xd13908[_0x54eb('0x25')][_0x54eb('0x3b')]);}})[_0x54eb('0x1a')](respondWithStatusCode(_0x31d0fe,null))['catch'](handleError(_0x31d0fe,null));};exports[_0x54eb('0x4e')]=function(_0x41e937,_0x113777){var _0xfdfc00=moment()['unix']()['toString']();var _0x16554c=path[_0x54eb('0x4f')](config[_0x54eb('0x50')],'server','files',_0x54eb('0x51'));var _0x519d38=path[_0x54eb('0x4f')](config[_0x54eb('0x50')],'server',_0x54eb('0x52'),'attachments');var _0x486848=path[_0x54eb('0x4f')](_0x16554c,_0xfdfc00);var _0x459251=util[_0x54eb('0x53')](_0x54eb('0x54'),_0x41e937['params']['id'],_0xfdfc00);var _0x580ce5=path[_0x54eb('0x4f')](_0x16554c,_0x459251);var _0x2286fe=[];if(_0x41e937[_0x54eb('0x25')][_0x54eb('0x55')]){_0x2286fe[_0x54eb('0x56')]({'model':db[_0x54eb('0x57')],'as':_0x54eb('0x58'),'raw':!![]});}var _0x2750f3=[{'model':db['MailMessage'],'as':_0x54eb('0x59'),'attributes':['id',_0x54eb('0x35'),_0x54eb('0x5a'),'to','cc','bcc',_0x54eb('0x5b'),_0x54eb('0x5c')],'where':{'secret':![]},'order':qs[_0x54eb('0x5d')]('id'),'include':_0x2286fe}];return db[_0x54eb('0x29')][_0x54eb('0x39')]({'where':{'id':_0x41e937[_0x54eb('0x26')]['id']},'include':_0x2750f3})[_0x54eb('0x1a')](handleEntityNotFound(_0x113777,null))[_0x54eb('0x1a')](function(_0x3de061){if(_0x3de061&&_0x3de061[_0x54eb('0x59')]){var _0x3413ae=_0x3de061[_0x54eb('0x5e')]({'plain':!![]});fs[_0x54eb('0x5f')](_0x486848);return BPromise['each'](_0x3413ae[_0x54eb('0x59')],function(_0x299721,_0x497103){var _0x232717={'from':_0x299721[_0x54eb('0x5a')],'to':_0x299721['to']||'missing.recipient@your.company.com','subject':_0x299721[_0x54eb('0x5b')],'html':htmlEntities[_0x54eb('0x60')](_0x299721[_0x54eb('0x35')]),'headers':{'Date':moment(_0x299721[_0x54eb('0x5c')])[_0x54eb('0x53')](_0x54eb('0x61'))},'attachments':[]};if(_0x299721['cc']){_0x232717[_0x54eb('0x62')]['Cc']=_0x299721['cc'];}if(_0x299721[_0x54eb('0x63')]){_0x232717[_0x54eb('0x62')]['Bcc']=_0x299721[_0x54eb('0x63')];}return new BPromise(function(_0x1c91df,_0x1df1c8){if(_0x299721[_0x54eb('0x58')]){for(var _0x1bf9b6=0x0;_0x1bf9b6<_0x299721[_0x54eb('0x58')][_0x54eb('0x2e')];_0x1bf9b6++){var _0x4a6750=_0x299721['Attachments'][_0x1bf9b6];var _0x4b553d=path[_0x54eb('0x4f')](_0x519d38,_0x4a6750[_0x54eb('0x64')]);if(fs[_0x54eb('0x65')](_0x4b553d)){_0x232717[_0x54eb('0x55')][_0x54eb('0x56')]({'name':_0x4a6750[_0x54eb('0x1d')],'contentType':_0x4a6750[_0x54eb('0x22')],'data':fs[_0x54eb('0x66')](_0x4b553d)});}}}emlformat[_0x54eb('0x67')](_0x232717,function(_0x3d85b6,_0x3bf535){if(_0x3d85b6)return _0x1df1c8(_0x3d85b6);fs[_0x54eb('0x68')](path[_0x54eb('0x4f')](_0x486848,util[_0x54eb('0x53')](_0x54eb('0x69'),_0x497103)),_0x3bf535);return _0x1c91df(_0x3bf535);});});})[_0x54eb('0x1a')](function(){return new BPromise(function(_0x2002e8,_0x15f214){zipdir(_0x486848,{'saveTo':_0x580ce5},function(_0x4637c9,_0x442984){if(_0x4637c9)return _0x15f214(_0x4637c9);return _0x2002e8(_0x442984);});})[_0x54eb('0x1a')](function(){return new BPromise(function(_0x291763,_0x5b0f24){rimraf(_0x486848,function(_0x115df3){if(_0x115df3)_0x5b0f24(_0x115df3);return _0x291763();});});})[_0x54eb('0x1a')](function(){return _0x113777[_0x54eb('0x4e')](_0x580ce5,_0x459251,function(_0x1b82dd){if(!_0x1b82dd)fs[_0x54eb('0x6a')](_0x580ce5);});});});}else{return _0x113777[_0x54eb('0x11')](0xc8);}})[_0x54eb('0x33')](handleError(_0x113777,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ce6e056..735c2a4 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80a1=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x8ba2d5,_0x13babf){var _0x55bf92=function(_0x43fd48){while(--_0x43fd48){_0x8ba2d5['push'](_0x8ba2d5['shift']());}};_0x55bf92(++_0x13babf);}(_0x80a1,0x12a));var _0x180a=function(_0x28972d,_0x5cd0ba){_0x28972d=_0x28972d-0x0;var _0x302084=_0x80a1[_0x28972d];return _0x302084;};'use strict';var EventEmitter=require(_0x180a('0x0'));var MailInteraction=require(_0x180a('0x1'))['db'][_0x180a('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x180a('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x180a('0x4')](0x0);var events={'afterCreate':_0x180a('0x5'),'afterUpdate':_0x180a('0x6'),'afterDestroy':_0x180a('0x7')};function emitEvent(_0x3452a2){return function(_0x363fb3,_0x3c6a75,_0x16ed11){_0x363fb3[_0x180a('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2eb667){_0x363fb3[_0x180a('0x9')](_0x180a('0xa'),_0x2eb667[_0x180a('0xb')](function(_0xe79615){return{'id':_0xe79615['id']};}));return MailMessage[_0x180a('0xc')]({'where':{'MailInteractionId':_0x363fb3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x180a('0xd')](function(_0x580505){_0x363fb3[_0x180a('0x9')](_0x180a('0xe'),_0x580505[_0x180a('0xf')]);MailInteractionEvents[_0x180a('0x10')](_0x3452a2+':'+_0x363fb3['id'],_0x363fb3);MailInteractionEvents[_0x180a('0x10')](_0x3452a2,_0x363fb3);_0x16ed11(null);})[_0x180a('0x11')](_0x16ed11(null));};}for(var e in events){if(events[_0x180a('0x12')](e)){var event=events[e];MailInteraction[_0x180a('0x13')](e,emitEvent(event));}}module[_0x180a('0x14')]=MailInteractionEvents; \ No newline at end of file +var _0x6574=['hasOwnProperty','events','MailInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x6574,0x1a1));var _0x4657=function(_0x79462d,_0xea171f){_0x79462d=_0x79462d-0x0;var _0x4bfdc4=_0x6574[_0x79462d];return _0x4bfdc4;};'use strict';var EventEmitter=require(_0x4657('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4657('0x1')];var MailMessage=require(_0x4657('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4657('0x3')](0x0);var events={'afterCreate':_0x4657('0x4'),'afterUpdate':_0x4657('0x5'),'afterDestroy':_0x4657('0x6')};function emitEvent(_0x5ab034){return function(_0x1c0f02,_0x3fb75d,_0x21f5e1){_0x1c0f02[_0x4657('0x7')]({'attributes':['id'],'raw':!![]})[_0x4657('0x8')](function(_0x1c1ba1){_0x1c0f02[_0x4657('0x9')](_0x4657('0xa'),_0x1c1ba1['map'](function(_0x15c6c8){return{'id':_0x15c6c8['id']};}));return MailMessage[_0x4657('0xb')]({'where':{'MailInteractionId':_0x1c0f02['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x6782c6){_0x1c0f02[_0x4657('0x9')](_0x4657('0xc'),_0x6782c6[_0x4657('0xd')]);MailInteractionEvents[_0x4657('0xe')](_0x5ab034+':'+_0x1c0f02['id'],_0x1c0f02);MailInteractionEvents[_0x4657('0xe')](_0x5ab034,_0x1c0f02);_0x21f5e1(null);})['catch'](_0x21f5e1(null));};}for(var e in events){if(events[_0x4657('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ec90d6b..7d44c38 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b99=['moment','request-promise','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','substatus','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b99,0x1e9));var _0x94b9=function(_0xba645e,_0x1e1b67){_0xba645e=_0xba645e-0x0;var _0x27582a=_0x4b99[_0xba645e];return _0x27582a;};'use strict';var _=require(_0x94b9('0x0'));var util=require(_0x94b9('0x1'));var logger=require(_0x94b9('0x2'))(_0x94b9('0x3'));var moment=require(_0x94b9('0x4'));var BPromise=require('bluebird');var rp=require(_0x94b9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94b9('0x6'));var config=require(_0x94b9('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x94b9('0x8')]=function(_0x3ee555,_0x2097ff){return _0x3ee555[_0x94b9('0x9')](_0x94b9('0xa'),attributes,{'tableName':_0x94b9('0xb'),'paranoid':![],'indexes':[{'name':_0x94b9('0xc'),'fields':[_0x94b9('0xd'),'to'],'type':_0x94b9('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d5ea2,_0x3f9048,_0x1eddf0){if(_0x5d5ea2['substatus']){_0x5d5ea2[_0x94b9('0xf')]=moment()[_0x94b9('0x10')](_0x94b9('0x11'));}if(_0x5d5ea2['closed']){_0x5d5ea2['closedAt']=moment()[_0x94b9('0x10')](_0x94b9('0x11'));}_0x1eddf0(null,_0x3f9048);},'beforeUpdate':function(_0x1f19d8,_0x3e2617,_0x35a83a){if(_0x1f19d8['changed']('substatus')){_0x1f19d8['substatusAt']=_0x1f19d8['substatus']?moment()[_0x94b9('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x1f19d8[_0x94b9('0x12')](_0x94b9('0x13'))){_0x1f19d8[_0x94b9('0x14')]=moment()['format'](_0x94b9('0x11'));_0x1f19d8[_0x94b9('0x15')]=null;_0x1f19d8[_0x94b9('0xf')]=null;}_0x35a83a(null,_0x1f19d8);},'afterUpdate':function(_0x36a6a9,_0x59591f,_0x2d1b4d){var _0x59de29=_0x3ee555['models'];var _0x2fa3bb=_0x36a6a9[_0x94b9('0x16')]({'plain':!![]});if(_0x2fa3bb[_0x94b9('0x13')]){return _0x59de29[_0x94b9('0x17')][_0x94b9('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x2fa3bb['id']}})[_0x94b9('0x19')](function(){_0x2d1b4d();})[_0x94b9('0x1a')](function(_0xcc31ff){_0x2d1b4d(_0xcc31ff);});}else{_0x2d1b4d();}}},'charset':_0x94b9('0x1b'),'collate':_0x94b9('0x1c')});}; \ No newline at end of file +var _0x6dad=['define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','format','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6dad,0xcf));var _0xd6da=function(_0x1a0c32,_0x38de8b){_0x1a0c32=_0x1a0c32-0x0;var _0x129e71=_0x6dad[_0x1a0c32];return _0x129e71;};'use strict';var _=require(_0xd6da('0x0'));var util=require(_0xd6da('0x1'));var logger=require(_0xd6da('0x2'))(_0xd6da('0x3'));var moment=require(_0xd6da('0x4'));var BPromise=require(_0xd6da('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd6da('0x6'));var config=require(_0xd6da('0x7'));var attributes=require('./mailInteraction.attributes');module[_0xd6da('0x8')]=function(_0x1660c2,_0x1ca8f0){return _0x1660c2[_0xd6da('0x9')](_0xd6da('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xd6da('0xb'),'fields':[_0xd6da('0xc'),'to'],'type':_0xd6da('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e1c8b,_0x200fef,_0x37225c){if(_0x4e1c8b[_0xd6da('0xe')]){_0x4e1c8b[_0xd6da('0xf')]=moment()['format'](_0xd6da('0x10'));}if(_0x4e1c8b[_0xd6da('0x11')]){_0x4e1c8b[_0xd6da('0x12')]=moment()['format'](_0xd6da('0x10'));}_0x37225c(null,_0x200fef);},'beforeUpdate':function(_0x4b1453,_0x2e2b85,_0x352113){if(_0x4b1453[_0xd6da('0x13')](_0xd6da('0xe'))){_0x4b1453[_0xd6da('0xf')]=_0x4b1453[_0xd6da('0xe')]?moment()['format'](_0xd6da('0x10')):null;}if(_0x4b1453[_0xd6da('0x13')]('closed')){_0x4b1453[_0xd6da('0x12')]=moment()[_0xd6da('0x14')](_0xd6da('0x10'));_0x4b1453[_0xd6da('0xe')]=null;_0x4b1453[_0xd6da('0xf')]=null;}_0x352113(null,_0x4b1453);},'afterUpdate':function(_0x3e6d2a,_0x5c550e,_0x3b52f4){var _0x4385e6=_0x1660c2[_0xd6da('0x15')];var _0x9fac58=_0x3e6d2a['get']({'plain':!![]});if(_0x9fac58[_0xd6da('0x11')]){return _0x4385e6[_0xd6da('0x16')][_0xd6da('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x9fac58['id']}})['then'](function(){_0x3b52f4();})[_0xd6da('0x18')](function(_0x556fdf){_0x3b52f4(_0x556fdf);});}else{_0x3b52f4();}}},'charset':_0xd6da('0x19'),'collate':_0xd6da('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 7f7bdb1..befe915 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5322=['body','options','raw','where','AddTagsToMailInteraction','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5322,0xff));var _0x2532=function(_0x43576f,_0x1356ed){_0x43576f=_0x43576f-0x0;var _0x4d2466=_0x5322[_0x43576f];return _0x4d2466;};'use strict';var _=require(_0x2532('0x0'));var util=require(_0x2532('0x1'));var moment=require(_0x2532('0x2'));var BPromise=require('bluebird');var rs=require(_0x2532('0x3'));var fs=require('fs');var Redis=require(_0x2532('0x4'));var db=require(_0x2532('0x5'))['db'];var utils=require(_0x2532('0x6'));var logger=require('../../config/logger')(_0x2532('0x7'));var config=require(_0x2532('0x8'));var jayson=require(_0x2532('0x9'));var client=jayson[_0x2532('0xa')][_0x2532('0xb')]({'port':0x232a});config[_0x2532('0xc')]=_['defaults'](config[_0x2532('0xc')],{'host':_0x2532('0xd'),'port':0x18eb});var socket=require(_0x2532('0xe'))(new Redis(config[_0x2532('0xc')]));require(_0x2532('0xf'))[_0x2532('0x10')](socket);function respondWithRpcPromise(_0x58a034,_0x3f3325,_0x4423ed){return new BPromise(function(_0x18d2e1,_0x5d4577){return client[_0x2532('0x11')](_0x58a034,_0x4423ed)[_0x2532('0x12')](function(_0x3c437c){logger[_0x2532('0x13')](_0x2532('0x14'),_0x3f3325,_0x2532('0x15'));logger[_0x2532('0x16')](_0x2532('0x17'),_0x3f3325,_0x2532('0x15'),JSON[_0x2532('0x18')](_0x3c437c));if(_0x3c437c[_0x2532('0x19')]){if(_0x3c437c[_0x2532('0x19')][_0x2532('0x1a')]===0x1f4){logger[_0x2532('0x19')](_0x2532('0x14'),_0x3f3325,_0x3c437c['error'][_0x2532('0x1b')]);return _0x5d4577(_0x3c437c[_0x2532('0x19')][_0x2532('0x1b')]);}logger['error'](_0x2532('0x14'),_0x3f3325,_0x3c437c[_0x2532('0x19')][_0x2532('0x1b')]);return _0x18d2e1(_0x3c437c[_0x2532('0x19')]['message']);}else{logger[_0x2532('0x13')]('MailInteraction,\x20%s,\x20%s',_0x3f3325,_0x2532('0x15'));_0x18d2e1(_0x3c437c[_0x2532('0x1c')][_0x2532('0x1b')]);}})[_0x2532('0x1d')](function(_0x445cbf){logger[_0x2532('0x19')]('MailInteraction,\x20%s,\x20%s',_0x3f3325,_0x445cbf);_0x5d4577(_0x445cbf);});});}exports[_0x2532('0x1e')]=function(_0x60faf){var _0x122083=this;return new Promise(function(_0x178f50,_0x52d232){return db[_0x2532('0x1f')]['update'](_0x60faf[_0x2532('0x20')],{'raw':_0x60faf['options']?_0x60faf[_0x2532('0x21')][_0x2532('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x60faf['options']?_0x60faf[_0x2532('0x21')][_0x2532('0x23')]||null:null,'attributes':_0x60faf[_0x2532('0x21')]?_0x60faf[_0x2532('0x21')]['attributes']||null:null,'limit':_0x60faf[_0x2532('0x21')]?_0x60faf['options']['limit']||null:null})[_0x2532('0x12')](function(_0x264d91){logger[_0x2532('0x13')]('UpdateMailInteraction',_0x60faf);logger[_0x2532('0x16')](_0x2532('0x1e'),_0x60faf,JSON['stringify'](_0x264d91));_0x178f50(_0x264d91);})['catch'](function(_0x232cec){logger[_0x2532('0x19')](_0x2532('0x1e'),_0x232cec['message'],_0x60faf);_0x52d232(_0x122083[_0x2532('0x19')](0x1f4,_0x232cec[_0x2532('0x1b')]));});});};exports[_0x2532('0x24')]=function(_0x39d965){return new Promise(function(_0x2850f1,_0x2f134f){return db[_0x2532('0x1f')]['find']({'where':_0x39d965[_0x2532('0x21')]?_0x39d965[_0x2532('0x21')]['where']||null:null})[_0x2532('0x12')](function(_0x5b2a9c){if(_0x5b2a9c){return _0x5b2a9c['addTags'](_0x39d965[_0x2532('0x20')]['ids'],_[_0x2532('0x25')](_0x39d965[_0x2532('0x20')],[_0x2532('0x26'),'id'])||{});}})[_0x2532('0x27')](function(_0x1fd59d){logger[_0x2532('0x13')](_0x2532('0x28'),_0x39d965);logger[_0x2532('0x16')](_0x2532('0x28'),_0x39d965,JSON[_0x2532('0x18')](_0x1fd59d));_0x2850f1(_0x1fd59d);})[_0x2532('0x1d')](function(_0x5877d4){logger['error'](_0x2532('0x28'),_0x5877d4[_0x2532('0x1b')],_0x39d965);_0x2f134f(_this['error'](0x1f4,_0x5877d4[_0x2532('0x1b')]));});});}; \ No newline at end of file +var _0xcafa=['options','raw','where','attributes','limit','stringify','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','MailInteraction'];(function(_0x36c39e,_0x383ba0){var _0x5307b7=function(_0x594d83){while(--_0x594d83){_0x36c39e['push'](_0x36c39e['shift']());}};_0x5307b7(++_0x383ba0);}(_0xcafa,0x8f));var _0xacaf=function(_0x5f55d1,_0x432d){_0x5f55d1=_0x5f55d1-0x0;var _0x358b0d=_0xcafa[_0x5f55d1];return _0x358b0d;};'use strict';var _=require(_0xacaf('0x0'));var util=require(_0xacaf('0x1'));var moment=require(_0xacaf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacaf('0x3'));var db=require(_0xacaf('0x4'))['db'];var utils=require(_0xacaf('0x5'));var logger=require(_0xacaf('0x6'))('rpc');var config=require(_0xacaf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xacaf('0x8')][_0xacaf('0x9')]({'port':0x232a});config[_0xacaf('0xa')]=_[_0xacaf('0xb')](config[_0xacaf('0xa')],{'host':_0xacaf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacaf('0xa')]));require(_0xacaf('0xd'))[_0xacaf('0xe')](socket);function respondWithRpcPromise(_0x414444,_0x549dc8,_0x2f7abc){return new BPromise(function(_0x472b2e,_0x198be1){return client[_0xacaf('0xf')](_0x414444,_0x2f7abc)[_0xacaf('0x10')](function(_0x48ed4f){logger['info']('MailInteraction,\x20%s,\x20%s',_0x549dc8,_0xacaf('0x11'));logger[_0xacaf('0x12')](_0xacaf('0x13'),_0x549dc8,_0xacaf('0x11'),JSON['stringify'](_0x48ed4f));if(_0x48ed4f[_0xacaf('0x14')]){if(_0x48ed4f[_0xacaf('0x14')][_0xacaf('0x15')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x549dc8,_0x48ed4f[_0xacaf('0x14')][_0xacaf('0x16')]);return _0x198be1(_0x48ed4f['error'][_0xacaf('0x16')]);}logger[_0xacaf('0x14')](_0xacaf('0x17'),_0x549dc8,_0x48ed4f[_0xacaf('0x14')][_0xacaf('0x16')]);return _0x472b2e(_0x48ed4f[_0xacaf('0x14')]['message']);}else{logger[_0xacaf('0x18')](_0xacaf('0x17'),_0x549dc8,'request\x20sent');_0x472b2e(_0x48ed4f[_0xacaf('0x19')]['message']);}})[_0xacaf('0x1a')](function(_0x45b41b){logger[_0xacaf('0x14')](_0xacaf('0x17'),_0x549dc8,_0x45b41b);_0x198be1(_0x45b41b);});});}exports[_0xacaf('0x1b')]=function(_0x42c3ee){var _0xf8050f=this;return new Promise(function(_0x42e3b7,_0x3ed37f){return db[_0xacaf('0x1c')]['update'](_0x42c3ee['body'],{'raw':_0x42c3ee['options']?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42c3ee[_0xacaf('0x1d')]?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x1f')]||null:null,'attributes':_0x42c3ee[_0xacaf('0x1d')]?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x20')]||null:null,'limit':_0x42c3ee[_0xacaf('0x1d')]?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x21')]||null:null})[_0xacaf('0x10')](function(_0x5e0d90){logger[_0xacaf('0x18')](_0xacaf('0x1b'),_0x42c3ee);logger['debug'](_0xacaf('0x1b'),_0x42c3ee,JSON[_0xacaf('0x22')](_0x5e0d90));_0x42e3b7(_0x5e0d90);})['catch'](function(_0x32a68a){logger[_0xacaf('0x14')](_0xacaf('0x1b'),_0x32a68a[_0xacaf('0x16')],_0x42c3ee);_0x3ed37f(_0xf8050f[_0xacaf('0x14')](0x1f4,_0x32a68a[_0xacaf('0x16')]));});});};exports[_0xacaf('0x23')]=function(_0x53c182){return new Promise(function(_0x2507f4,_0x493025){return db[_0xacaf('0x1c')][_0xacaf('0x24')]({'where':_0x53c182[_0xacaf('0x1d')]?_0x53c182['options'][_0xacaf('0x1f')]||null:null})[_0xacaf('0x10')](function(_0x371fed){if(_0x371fed){return _0x371fed[_0xacaf('0x25')](_0x53c182[_0xacaf('0x26')][_0xacaf('0x27')],_[_0xacaf('0x28')](_0x53c182[_0xacaf('0x26')],[_0xacaf('0x27'),'id'])||{});}})[_0xacaf('0x29')](function(_0x11d665){logger[_0xacaf('0x18')](_0xacaf('0x2a'),_0x53c182);logger[_0xacaf('0x12')](_0xacaf('0x2a'),_0x53c182,JSON[_0xacaf('0x22')](_0x11d665));_0x2507f4(_0x11d665);})[_0xacaf('0x1a')](function(_0x37da4c){logger['error'](_0xacaf('0x2a'),_0x37da4c[_0xacaf('0x16')],_0x53c182);_0x493025(_this[_0xacaf('0x14')](0x1f4,_0x37da4c[_0xacaf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 1364daa..d462ae3 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55a6=['remove','update','emit','length','mailInteraction:','save'];(function(_0xdb1ed6,_0x256dd5){var _0x1ef726=function(_0x1230b4){while(--_0x1230b4){_0xdb1ed6['push'](_0xdb1ed6['shift']());}};_0x1ef726(++_0x256dd5);}(_0x55a6,0xb9));var _0x655a=function(_0x7b92d7,_0x37466a){_0x7b92d7=_0x7b92d7-0x0;var _0x132089=_0x55a6[_0x7b92d7];return _0x132089;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x655a('0x0'),_0x655a('0x1'),_0x655a('0x2')];function createListener(_0xaca88,_0x398444){return function(_0x3beb07){_0x398444[_0x655a('0x3')](_0xaca88,_0x3beb07);};}function removeListener(_0x18f370,_0x7a0e11){return function(){MailInteractionEvents['removeListener'](_0x18f370,_0x7a0e11);};}exports['register']=function(_0x428365){for(var _0x22dd44=0x0,_0x48f062=events[_0x655a('0x4')];_0x22dd44<_0x48f062;_0x22dd44++){var _0x5c43f0=events[_0x22dd44];var _0x480454=createListener(_0x655a('0x5')+_0x5c43f0,_0x428365);MailInteractionEvents['on'](_0x5c43f0,_0x480454);}}; \ No newline at end of file +var _0xffa1=['register','length','mailInteraction:','./mailInteraction.events','remove','update','removeListener'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0xffa1,0x18b));var _0x1ffa=function(_0x34c241,_0x5df182){_0x34c241=_0x34c241-0x0;var _0x54907c=_0xffa1[_0x34c241];return _0x54907c;};'use strict';var MailInteractionEvents=require(_0x1ffa('0x0'));var events=['save',_0x1ffa('0x1'),_0x1ffa('0x2')];function createListener(_0x5ac242,_0xc9d2cf){return function(_0x1fe0d1){_0xc9d2cf['emit'](_0x5ac242,_0x1fe0d1);};}function removeListener(_0x428762,_0x547fc4){return function(){MailInteractionEvents[_0x1ffa('0x3')](_0x428762,_0x547fc4);};}exports[_0x1ffa('0x4')]=function(_0x57f171){for(var _0x33050c=0x0,_0x474e4c=events[_0x1ffa('0x5')];_0x33050c<_0x474e4c;_0x33050c++){var _0x69fcaa=events[_0x33050c];var _0x497cbd=createListener(_0x1ffa('0x6')+_0x69fcaa,_0x57f171);MailInteractionEvents['on'](_0x69fcaa,_0x497cbd);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 4c3290b..9dc6105 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x477a=['/:id','/:id/download','mail','mailmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa477('0x0'));var util=require('util');var path=require(_0xa477('0x1'));var timeout=require(_0xa477('0x2'));var express=require('express');var router=express[_0xa477('0x3')]();var fs_extra=require(_0xa477('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa477('0x5'));var controller=require(_0xa477('0x6'));router['get']('/',auth[_0xa477('0x7')](),controller[_0xa477('0x8')]);router[_0xa477('0x9')](_0xa477('0xa'),auth[_0xa477('0x7')](),controller[_0xa477('0xb')]);router[_0xa477('0x9')](_0xa477('0xc'),auth[_0xa477('0x7')](),controller['show']);router[_0xa477('0x9')](_0xa477('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xa477('0xe'),_0xa477('0xf')),controller[_0xa477('0x10')]);router['put'](_0xa477('0xc'),auth[_0xa477('0x7')](),controller[_0xa477('0x11')]);router['put'](_0xa477('0x12'),auth[_0xa477('0x7')](),controller[_0xa477('0x13')]);router[_0xa477('0x14')](_0xa477('0x15'),auth['isAuthenticated'](),controller[_0xa477('0x16')]);router[_0xa477('0x17')](_0xa477('0xc'),auth[_0xa477('0x7')](),controller[_0xa477('0x18')]);module[_0xa477('0x19')]=router; \ No newline at end of file +var _0xb248=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','index','isAuthenticated','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','multer','path'];(function(_0x58fd81,_0x59a714){var _0x19d75c=function(_0x3bbdea){while(--_0x3bbdea){_0x58fd81['push'](_0x58fd81['shift']());}};_0x19d75c(++_0x59a714);}(_0xb248,0xc6));var _0x8b24=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xb248[_0x543084];return _0x306a57;};'use strict';var multer=require(_0x8b24('0x0'));var util=require('util');var path=require(_0x8b24('0x1'));var timeout=require(_0x8b24('0x2'));var express=require(_0x8b24('0x3'));var router=express[_0x8b24('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b24('0x5'));var interaction=require(_0x8b24('0x6'));var config=require('../../config/environment');var controller=require(_0x8b24('0x7'));router[_0x8b24('0x8')]('/',auth['isAuthenticated'](),controller[_0x8b24('0x9')]);router[_0x8b24('0x8')]('/describe',auth[_0x8b24('0xa')](),controller['describe']);router[_0x8b24('0x8')](_0x8b24('0xb'),auth[_0x8b24('0xa')](),controller['show']);router[_0x8b24('0x8')](_0x8b24('0xc'),auth[_0x8b24('0xa')](),controller[_0x8b24('0xd')]);router[_0x8b24('0xe')]('/',auth[_0x8b24('0xa')](),interaction[_0x8b24('0xf')](_0x8b24('0x10'),_0x8b24('0x11')),controller[_0x8b24('0x12')]);router[_0x8b24('0x13')](_0x8b24('0xb'),auth[_0x8b24('0xa')](),controller[_0x8b24('0x14')]);router['put']('/:id/accept',auth[_0x8b24('0xa')](),controller[_0x8b24('0x15')]);router[_0x8b24('0x13')](_0x8b24('0x16'),auth[_0x8b24('0xa')](),controller[_0x8b24('0x17')]);router[_0x8b24('0x18')](_0x8b24('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 57963d2..9317b4f 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5d4=['ENUM','out','STRING','long','DATE','INTEGER','Email','sequelize','lodash','TEXT','medium','BOOLEAN'];(function(_0x188199,_0x5c95c3){var _0x35c809=function(_0x39a8ad){while(--_0x39a8ad){_0x188199['push'](_0x188199['shift']());}};_0x35c809(++_0x5c95c3);}(_0xf5d4,0x19f));var _0x4f5d=function(_0x465ad1,_0x3bdd5e){_0x465ad1=_0x465ad1-0x0;var _0x236f7c=_0xf5d4[_0x465ad1];return _0x236f7c;};'use strict';var Sequelize=require(_0x4f5d('0x0'));var _=require(_0x4f5d('0x1'));module['exports']={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4f5d('0x2')](_0x4f5d('0x3'))},'read':{'type':Sequelize[_0x4f5d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f5d('0x5')]('in',_0x4f5d('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x4f5d('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x4f5d('0x2')]('long')},'cc':{'type':Sequelize[_0x4f5d('0x2')]('long')},'bcc':{'type':Sequelize['TEXT'](_0x4f5d('0x8'))},'subject':{'type':Sequelize[_0x4f5d('0x2')]},'sentAt':{'type':Sequelize[_0x4f5d('0x9')]},'attach':{'type':Sequelize[_0x4f5d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4f5d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4f5d('0x9')]},'originTo':{'type':Sequelize[_0x4f5d('0x2')](_0x4f5d('0x8'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x4f5d('0x5')](_0x4f5d('0xb'),'Chat'),'defaultValue':_0x4f5d('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xaf30=['sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email'];(function(_0x1aa074,_0x1315f6){var _0x5727ce=function(_0xf6bf8a){while(--_0xf6bf8a){_0x1aa074['push'](_0x1aa074['shift']());}};_0x5727ce(++_0x1315f6);}(_0xaf30,0x16c));var _0x0af3=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xaf30[_0x999b85];return _0x1d7124;};'use strict';var Sequelize=require(_0x0af3('0x0'));var _=require(_0x0af3('0x1'));module[_0x0af3('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x4'))},'read':{'type':Sequelize[_0x0af3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0af3('0x6')]('in',_0x0af3('0x7')),'defaultValue':_0x0af3('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0af3('0x8')](0x1fe)},'from':{'type':Sequelize[_0x0af3('0x8')]},'to':{'type':Sequelize[_0x0af3('0x3')]('long')},'cc':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x9'))},'bcc':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x0af3('0xa')]},'attach':{'type':Sequelize[_0x0af3('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0af3('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0af3('0xa')]},'originTo':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x9'))},'originCc':{'type':Sequelize['TEXT'](_0x0af3('0x9'))},'originChannel':{'type':Sequelize[_0x0af3('0x6')]('Email','Chat'),'defaultValue':_0x0af3('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 5767869..ef53310 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf28=['api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','http','client','request','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','message','MailMessage,\x20%s,\x20%s','result','catch','json','offset','undefined','count','status','set','Content-Range','destroy','stack','index','map','MailMessage','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','update','body','describe','create','direction','out','secret','MailAccount','CmList','List','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','CmContact','List\x20not\x20found','SendMail','messageId','format','stringify','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','MailInteraction','MailInteractionId','read1stAt','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','reject','mail','rejectMessage','sequelize','motionChannel','download','unix','server','files','tmp','join','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0xdf28,0x128));var _0x8df2=function(_0x1fe7c3,_0x2f7c6e){_0x1fe7c3=_0x1fe7c3-0x0;var _0x490542=_0xdf28[_0x1fe7c3];return _0x490542;};'use strict';var emlformat=require(_0x8df2('0x0'));var moment=require(_0x8df2('0x1'));var BPromise=require('bluebird');var util=require(_0x8df2('0x2'));var path=require(_0x8df2('0x3'));var fs=require('fs');var _=require(_0x8df2('0x4'));var Redis=require(_0x8df2('0x5'));var htmlToText=require(_0x8df2('0x6'));var qs=require(_0x8df2('0x7'));var logger=require('../../config/logger')(_0x8df2('0x8'));var interaction_log=require(_0x8df2('0x9'))(_0x8df2('0xa'));var config=require(_0x8df2('0xb'));var db=require(_0x8df2('0xc'))['db'];config[_0x8df2('0xd')]=_[_0x8df2('0xe')](config[_0x8df2('0xd')],{'host':_0x8df2('0xf'),'port':0x18eb});var socket=require(_0x8df2('0x10'))(new Redis(config['redis']));var htmlEntities=require(_0x8df2('0x11'));require(_0x8df2('0x12'))[_0x8df2('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8df2('0x14')]({'port':0x232c});var client9003=jayson['client'][_0x8df2('0x14')]({'port':0x232b});var client9002=jayson[_0x8df2('0x15')][_0x8df2('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4d99c8,_0x5744da,_0x503613,_0x11e659){return new BPromise(function(_0x47f03c,_0x56ddcd){var _0x3e96cf=_0x11e659||client;return _0x3e96cf[_0x8df2('0x16')](_0x4d99c8,_0x503613)[_0x8df2('0x17')](function(_0xcc1ed2){logger[_0x8df2('0x18')]('MailMessage,\x20%s,\x20%s',_0x5744da,_0x8df2('0x19'));logger['debug'](_0x8df2('0x1a'),_0x5744da,_0x8df2('0x19'),JSON['stringify'](_0xcc1ed2));if(_0xcc1ed2[_0x8df2('0x1b')]){if(_0xcc1ed2['error']['code']===0x1f4){logger[_0x8df2('0x1b')]('MailMessage,\x20%s,\x20%s',_0x5744da,_0xcc1ed2[_0x8df2('0x1b')]['message']);return _0x56ddcd(_0xcc1ed2[_0x8df2('0x1b')][_0x8df2('0x1c')]);}logger[_0x8df2('0x1b')](_0x8df2('0x1d'),_0x5744da,_0xcc1ed2[_0x8df2('0x1b')][_0x8df2('0x1c')]);return _0x47f03c(_0xcc1ed2[_0x8df2('0x1b')]['message']);}else{logger[_0x8df2('0x18')](_0x8df2('0x1d'),_0x5744da,_0x8df2('0x19'));_0x47f03c(_0xcc1ed2[_0x8df2('0x1e')]['message']);}})[_0x8df2('0x1f')](function(_0x14b3b6){logger[_0x8df2('0x1b')](_0x8df2('0x1d'),_0x5744da,_0x14b3b6);_0x56ddcd(_0x14b3b6);});});}function respondWithResult(_0x4d26b9,_0x170b00){_0x170b00=_0x170b00||0xc8;return function(_0x119295){if(_0x119295){return _0x4d26b9['status'](_0x170b00)[_0x8df2('0x20')](_0x119295);}};}function respondWithFilteredResult(_0x932848,_0x8f6377){return function(_0x23207f){if(_0x23207f){var _0x2ffd44=typeof _0x8f6377[_0x8df2('0x21')]===_0x8df2('0x22')&&typeof _0x8f6377['limit']==='undefined';var _0x50d1e3=_0x23207f[_0x8df2('0x23')];var _0x109404=_0x2ffd44?0x0:_0x8f6377[_0x8df2('0x21')];var _0xb03bbf=_0x2ffd44?_0x23207f[_0x8df2('0x23')]:_0x8f6377[_0x8df2('0x21')]+_0x8f6377['limit'];var _0x83cfbb;if(_0xb03bbf>=_0x50d1e3){_0xb03bbf=_0x50d1e3;_0x83cfbb=0xc8;}else{_0x83cfbb=0xce;}_0x932848[_0x8df2('0x24')](_0x83cfbb);return _0x932848[_0x8df2('0x25')](_0x8df2('0x26'),_0x109404+'-'+_0xb03bbf+'/'+_0x50d1e3)[_0x8df2('0x20')](_0x23207f);}return null;};}function saveUpdates(_0x3d7900){return function(_0x3f6527){if(_0x3f6527){return _0x3f6527['update'](_0x3d7900)[_0x8df2('0x17')](function(_0x54f353){return _0x54f353;});}return null;};}function removeEntity(_0x21599a){return function(_0x4bf5ae){if(_0x4bf5ae){return _0x4bf5ae[_0x8df2('0x27')]()[_0x8df2('0x17')](function(){_0x21599a[_0x8df2('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af740){return function(_0x2013e1){if(!_0x2013e1){_0x3af740['sendStatus'](0x194);}return _0x2013e1;};}function handleError(_0x430331,_0x48f22a){_0x48f22a=_0x48f22a||0x1f4;return function(_0x23a0f6){logger['error'](_0x23a0f6[_0x8df2('0x28')]);if(_0x23a0f6['name']){delete _0x23a0f6['name'];}_0x430331['status'](_0x48f22a)['send'](_0x23a0f6);};}exports[_0x8df2('0x29')]=function(_0x5640b8,_0x15ee46){var _0x5d7a6c={},_0x2a6146={},_0x3c405c={'count':0x0,'rows':[]};var _0x44ebe9=_[_0x8df2('0x2a')](db[_0x8df2('0x2b')]['rawAttributes'],function(_0x4095be){return{'name':_0x4095be[_0x8df2('0x2c')],'type':_0x4095be[_0x8df2('0x2d')][_0x8df2('0x2e')]};});_0x2a6146[_0x8df2('0x2f')]=_[_0x8df2('0x2a')](_0x44ebe9,_0x8df2('0x30'));_0x2a6146[_0x8df2('0x31')]=_[_0x8df2('0x32')](_0x5640b8[_0x8df2('0x31')]);_0x2a6146[_0x8df2('0x33')]=_[_0x8df2('0x34')](_0x2a6146[_0x8df2('0x2f')],_0x2a6146[_0x8df2('0x31')]);_0x5d7a6c['attributes']=_['intersection'](_0x2a6146['model'],qs['fields'](_0x5640b8[_0x8df2('0x31')][_0x8df2('0x35')]));_0x5d7a6c[_0x8df2('0x36')]=_0x5d7a6c['attributes'][_0x8df2('0x37')]?_0x5d7a6c[_0x8df2('0x36')]:_0x2a6146[_0x8df2('0x2f')];if(!_0x5640b8[_0x8df2('0x31')][_0x8df2('0x38')]('nolimit')){_0x5d7a6c['limit']=qs[_0x8df2('0x39')](_0x5640b8[_0x8df2('0x31')]['limit']);_0x5d7a6c[_0x8df2('0x21')]=qs[_0x8df2('0x21')](_0x5640b8[_0x8df2('0x31')]['offset']);}_0x5d7a6c[_0x8df2('0x3a')]=qs[_0x8df2('0x3b')](_0x5640b8[_0x8df2('0x31')][_0x8df2('0x3b')]);_0x5d7a6c[_0x8df2('0x3c')]=qs['filters'](_['pick'](_0x5640b8['query'],_0x2a6146[_0x8df2('0x33')]),_0x44ebe9);if(_0x5640b8[_0x8df2('0x31')][_0x8df2('0x3d')]){_0x5d7a6c[_0x8df2('0x3c')]=_[_0x8df2('0x3e')](_0x5d7a6c[_0x8df2('0x3c')],{'$or':_[_0x8df2('0x2a')](_0x44ebe9,function(_0x190b4f){if(_0x190b4f[_0x8df2('0x2d')]!==_0x8df2('0x3f')){var _0x576df7={};_0x576df7[_0x190b4f['name']]={'$like':'%'+_0x5640b8['query']['filter']+'%'};return _0x576df7;}})});}_0x5d7a6c=_[_0x8df2('0x3e')]({},_0x5d7a6c,_0x5640b8[_0x8df2('0x40')]);var _0x53a7ba={'where':_0x5d7a6c[_0x8df2('0x3c')]};return db[_0x8df2('0x2b')][_0x8df2('0x23')](_0x53a7ba)[_0x8df2('0x17')](function(_0x11be29){_0x3c405c[_0x8df2('0x23')]=_0x11be29;if(_0x5640b8[_0x8df2('0x31')][_0x8df2('0x41')]){_0x5d7a6c[_0x8df2('0x42')]=[{'all':!![]}];}return db[_0x8df2('0x2b')][_0x8df2('0x43')](_0x5d7a6c);})['then'](function(_0x1567c6){_0x3c405c[_0x8df2('0x44')]=_0x1567c6;return _0x3c405c;})[_0x8df2('0x17')](respondWithFilteredResult(_0x15ee46,_0x5d7a6c))[_0x8df2('0x1f')](handleError(_0x15ee46,null));};exports['show']=function(_0x565c66,_0x49ce56){var _0x1f3bf4={'raw':!![],'where':{'id':_0x565c66[_0x8df2('0x45')]['id']}},_0x3b3c21={};_0x3b3c21[_0x8df2('0x2f')]=_[_0x8df2('0x32')](db[_0x8df2('0x2b')][_0x8df2('0x46')]);_0x3b3c21[_0x8df2('0x31')]=_['keys'](_0x565c66[_0x8df2('0x31')]);_0x3b3c21[_0x8df2('0x33')]=_[_0x8df2('0x34')](_0x3b3c21[_0x8df2('0x2f')],_0x3b3c21[_0x8df2('0x31')]);_0x1f3bf4[_0x8df2('0x36')]=_[_0x8df2('0x34')](_0x3b3c21['model'],qs[_0x8df2('0x35')](_0x565c66['query'][_0x8df2('0x35')]));_0x1f3bf4['attributes']=_0x1f3bf4['attributes']['length']?_0x1f3bf4[_0x8df2('0x36')]:_0x3b3c21[_0x8df2('0x2f')];if(_0x565c66[_0x8df2('0x31')][_0x8df2('0x41')]){_0x1f3bf4[_0x8df2('0x42')]=[{'all':!![]}];}_0x1f3bf4=_[_0x8df2('0x3e')]({},_0x1f3bf4,_0x565c66[_0x8df2('0x40')]);return db[_0x8df2('0x2b')][_0x8df2('0x47')](_0x1f3bf4)[_0x8df2('0x17')](handleEntityNotFound(_0x49ce56,null))['then'](respondWithResult(_0x49ce56,null))[_0x8df2('0x1f')](handleError(_0x49ce56,null));};exports[_0x8df2('0x48')]=function(_0x15cf37,_0x888155){if(_0x15cf37[_0x8df2('0x49')]['id']){delete _0x15cf37[_0x8df2('0x49')]['id'];}return db[_0x8df2('0x2b')][_0x8df2('0x47')]({'where':{'id':_0x15cf37[_0x8df2('0x45')]['id']}})[_0x8df2('0x17')](handleEntityNotFound(_0x888155,null))[_0x8df2('0x17')](saveUpdates(_0x15cf37[_0x8df2('0x49')],null))[_0x8df2('0x17')](respondWithResult(_0x888155,null))['catch'](handleError(_0x888155,null));};exports[_0x8df2('0x27')]=function(_0xf0efb3,_0x2d18da){return db[_0x8df2('0x2b')]['find']({'where':{'id':_0xf0efb3[_0x8df2('0x45')]['id']}})[_0x8df2('0x17')](handleEntityNotFound(_0x2d18da,null))[_0x8df2('0x17')](removeEntity(_0x2d18da,null))[_0x8df2('0x1f')](handleError(_0x2d18da,null));};exports[_0x8df2('0x4a')]=function(_0x48d409,_0x16cfd5){return db[_0x8df2('0x2b')][_0x8df2('0x4a')]()[_0x8df2('0x17')](respondWithResult(_0x16cfd5,null))[_0x8df2('0x1f')](handleError(_0x16cfd5,null));};exports[_0x8df2('0x4b')]=function(_0x54842d,_0x21fccb){return db['MailMessage'][_0x8df2('0x4b')](_0x54842d[_0x8df2('0x49')])['then'](function(_0x52985a){if(_0x52985a){if(_0x52985a[_0x8df2('0x4c')]===_0x8df2('0x4d')&&!_0x52985a[_0x8df2('0x4e')]){var _0x30963b,_0x253123,_0x514e47;if(_0x54842d[_0x8df2('0x49')]['to']){_0x253123=_0x54842d[_0x8df2('0x49')]['to']['split'](',')[0x0];}return db[_0x8df2('0x4f')]['findOne']({'where':{'id':_0x52985a['MailAccountId']},'include':[{'model':db[_0x8df2('0x50')],'as':_0x8df2('0x51'),'include':[{'model':db['CmContact'],'as':_0x8df2('0x52'),'where':{'email':_0x253123},'limit':0x1,'order':[[_0x8df2('0x53'),'DESC']]}]},{'model':db[_0x8df2('0x54')],'as':_0x8df2('0x55'),'raw':!![],'include':[{'model':db[_0x8df2('0x56')],'as':'CloudProvider','raw':!![]}]}]})[_0x8df2('0x17')](function(_0x42d1d3){_0x30963b=_0x42d1d3;if(!_0x30963b||!_0x30963b[_0x8df2('0x55')])return;var _0x3f3c5b=_0x30963b[_0x8df2('0x57')]();if(_0x54842d[_0x8df2('0x49')][_0x8df2('0x58')]&&_0x54842d['body'][_0x8df2('0x58')][_0x8df2('0x37')]){for(var _0x50c529=0x0;_0x50c529<_0x54842d['body'][_0x8df2('0x58')][_0x8df2('0x37')];_0x50c529+=0x1){_0x54842d[_0x8df2('0x49')][_0x8df2('0x58')][_0x50c529]={'filename':_0x54842d[_0x8df2('0x49')]['attachments'][_0x50c529]['name'],'path':path['join'](config[_0x8df2('0x59')],_0x8df2('0x5a'),_0x54842d[_0x8df2('0x49')][_0x8df2('0x58')][_0x50c529][_0x8df2('0x5b')])};}}_0x514e47={'account':_0x3f3c5b,'message':_0x54842d[_0x8df2('0x49')]};return;})['then'](function(){if(_0x30963b[_0x8df2('0x51')]){if(_0x30963b[_0x8df2('0x51')]['Contacts']['length']){return _0x30963b['List']['Contacts'][0x0];}else{return db[_0x8df2('0x5c')]['create'](_[_0x8df2('0xe')](_0x54842d['body'],{'firstName':_0x54842d[_0x8df2('0x49')]['to'],'email':_0x54842d[_0x8df2('0x49')]['to'],'phone':_0x54842d['body']['to'],'ListId':_0x30963b['ListId']}));}}else{throw new Error(_0x8df2('0x5d'));}})[_0x8df2('0x17')](function(){if(_0x514e47){return respondWithRpcPromise(_0x8df2('0x5e'),'sendMail',_0x514e47,client9003)['then'](function(_0x397d64){return _0x52985a[_0x8df2('0x48')]({'read':!![],'messageId':_0x397d64[_0x8df2('0x5f')],'sentAt':moment()[_0x8df2('0x60')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x567c7f){logger[_0x8df2('0x1b')]('%s',JSON[_0x8df2('0x61')](_0x567c7f));return _0x52985a;});}return _0x52985a;});}return _0x52985a;}})['then'](respondWithResult(_0x21fccb,0xc9))[_0x8df2('0x1f')](handleError(_0x21fccb,null));};exports[_0x8df2('0x62')]=function(_0x5cc347,_0x29caf4){var _0x35c37c={'agent':{},'channel':'mail'};if(_0x5cc347[_0x8df2('0x49')]['id']){delete _0x5cc347['body']['id'];}_0x5cc347['body']['read']=!![];_0x5cc347['body'][_0x8df2('0x63')]=moment()[_0x8df2('0x60')](_0x8df2('0x64'));_0x5cc347[_0x8df2('0x49')][_0x8df2('0x65')]=_0x5cc347['body'][_0x8df2('0x65')]||_0x5cc347['user']['id'];_0x35c37c['agent']['id']=_0x5cc347[_0x8df2('0x49')][_0x8df2('0x65')];return db[_0x8df2('0x2b')][_0x8df2('0x47')]({'where':{'id':_0x5cc347[_0x8df2('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x29caf4,null))[_0x8df2('0x17')](saveUpdates(_0x5cc347[_0x8df2('0x49')],null))[_0x8df2('0x17')](function(_0x3413af){if(_0x3413af){_0x35c37c[_0x8df2('0x1c')]=_0x3413af[_0x8df2('0x66')]({'plain':!![]});return db[_0x8df2('0x67')][_0x8df2('0x47')]({'where':{'id':_0x3413af[_0x8df2('0x68')]}});}return null;})[_0x8df2('0x17')](handleEntityNotFound(_0x29caf4,null))[_0x8df2('0x17')](function(_0xdf6734){if(_0xdf6734){return _0xdf6734[_0x8df2('0x48')]({'UserId':_0x5cc347[_0x8df2('0x49')][_0x8df2('0x65')],'read1stAt':_['isNil'](_0xdf6734[_0x8df2('0x69')])?moment()[_0x8df2('0x60')](_0x8df2('0x64')):undefined});}return null;})[_0x8df2('0x17')](function(_0x5aab4e){if(_0x5aab4e){_0x35c37c['interaction']=_0x5aab4e[_0x8df2('0x66')]({'plain':!![]});interaction_log[_0x8df2('0x18')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5cc347['user']['id'],_0x5cc347[_0x8df2('0x6a')][_0x8df2('0x30')],_0x5cc347[_0x8df2('0x6a')][_0x8df2('0x6b')],_0x35c37c[_0x8df2('0x6c')]['id'],_0x5cc347[_0x8df2('0x49')]?JSON[_0x8df2('0x61')](_0x5cc347[_0x8df2('0x49')]):_0x8df2('0x6d'));return respondWithRpcPromise(_0x8df2('0x6e'),_0x8df2('0x6f'),_0x35c37c);}return null;})[_0x8df2('0x17')](function(_0x80ceab){var _0x2bd679=_0x8df2('0x70')+_0x80ceab['message'][_0x8df2('0x71')];return db['sequelize'][_0x8df2('0x31')](_0x2bd679,{'type':db[_0x8df2('0x72')][_0x8df2('0x73')][_0x8df2('0x74')],'raw':!![]})[_0x8df2('0x17')](function(_0x575718){return _0x575718;});})[_0x8df2('0x17')](function(_0x439c11){if(_0x439c11){_0x35c37c['message'][_0x8df2('0x75')]=_0x439c11[0x0];if(!_0x5cc347[_0x8df2('0x49')]['UserId'])return;return db['User'][_0x8df2('0x47')]({'where':{'id':_0x5cc347[_0x8df2('0x49')][_0x8df2('0x65')],'role':_0x8df2('0x76')},'attributes':['id',_0x8df2('0x30'),_0x8df2('0x77'),'email',_0x8df2('0x78')],'raw':!![]});}return null;})[_0x8df2('0x17')](function(_0x25c4b2){if(!_0x25c4b2)return null;_0x35c37c[_0x8df2('0x1c')][_0x8df2('0x76')]=_0x25c4b2;return _0x35c37c;})[_0x8df2('0x17')](function(_0x5088cc){if(_0x5088cc){if(_0x5cc347[_0x8df2('0x49')][_0x8df2('0x79')]){_0x35c37c['message'][_0x8df2('0x7a')]=util[_0x8df2('0x60')](_0x8df2('0x7b'),_0x5cc347[_0x8df2('0x6a')][_0x8df2('0x30')]);_0x35c37c['message'][_0x8df2('0x7c')]=_0x35c37c[_0x8df2('0x7c')];_0x35c37c['message']['motionChannel']=_0x35c37c['channel'];_0x35c37c[_0x8df2('0x1c')][_0x8df2('0x7d')]=_0x8df2('0x62');_0x35c37c[_0x8df2('0x1c')][_0x8df2('0x49')]=htmlToText[_0x8df2('0x7e')](_0x35c37c[_0x8df2('0x1c')][_0x8df2('0x49')]);return respondWithRpcPromise(_0x8df2('0x7f'),_0x8df2('0x7f'),{'event':'acceptmessage','message':_0x35c37c[_0x8df2('0x1c')]},client9002)[_0x8df2('0x17')](function(){return _0x35c37c;});}return _0x35c37c;}return null;})[_0x8df2('0x17')](respondWithResult(_0x29caf4,null))[_0x8df2('0x1f')](handleError(_0x29caf4,null));};exports[_0x8df2('0x80')]=function(_0x52d451,_0x1428ee){var _0x9091af={'agent':{},'channel':_0x8df2('0x81')};if(_0x52d451[_0x8df2('0x49')]['id']){delete _0x52d451[_0x8df2('0x49')]['id'];}_0x52d451[_0x8df2('0x49')][_0x8df2('0x65')]=_0x52d451[_0x8df2('0x49')]['UserId']||_0x52d451[_0x8df2('0x6a')]['id'];_0x9091af[_0x8df2('0x76')]['id']=_0x52d451[_0x8df2('0x49')][_0x8df2('0x65')];return db['MailMessage'][_0x8df2('0x47')]({'where':{'id':_0x52d451['params']['id'],'UserId':null}})[_0x8df2('0x17')](handleEntityNotFound(_0x1428ee,null))['then'](function(_0x13760c){if(_0x13760c){_0x9091af[_0x8df2('0x1c')]=_0x13760c[_0x8df2('0x66')]({'plain':!![]});return db[_0x8df2('0x67')]['find']({'where':{'id':_0x13760c[_0x8df2('0x68')]}});}return null;})[_0x8df2('0x17')](handleEntityNotFound(_0x1428ee,null))[_0x8df2('0x17')](function(_0x51a0ac){if(_0x51a0ac){_0x9091af[_0x8df2('0x6c')]=_0x51a0ac['get']({'plain':!![]});interaction_log[_0x8df2('0x18')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x52d451['user']['id'],_0x52d451[_0x8df2('0x6a')][_0x8df2('0x30')],_0x52d451[_0x8df2('0x6a')][_0x8df2('0x6b')],_0x9091af[_0x8df2('0x6c')]['id'],_0x52d451[_0x8df2('0x49')]?JSON[_0x8df2('0x61')](_0x52d451[_0x8df2('0x49')]):_0x8df2('0x6d'));return respondWithRpcPromise('RejectMessage',_0x8df2('0x82'),_0x9091af);}return null;})[_0x8df2('0x17')](function(_0x58f22a){var _0x166e2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58f22a['message'][_0x8df2('0x71')];return db[_0x8df2('0x83')][_0x8df2('0x31')](_0x166e2e,{'type':db[_0x8df2('0x72')][_0x8df2('0x73')]['SELECT'],'raw':!![]})[_0x8df2('0x17')](function(_0x4fd146){return _0x4fd146;});})[_0x8df2('0x17')](function(_0x1b582d){if(_0x1b582d){_0x9091af[_0x8df2('0x1c')]['contact']=_0x1b582d[0x0];if(!_0x52d451['body'][_0x8df2('0x65')])return;return db['User'][_0x8df2('0x47')]({'where':{'id':_0x52d451[_0x8df2('0x49')]['UserId'],'role':_0x8df2('0x76')},'attributes':['id',_0x8df2('0x30'),_0x8df2('0x77'),'email',_0x8df2('0x78')],'raw':!![]});}return null;})[_0x8df2('0x17')](function(_0x5020d2){if(!_0x5020d2)return null;_0x9091af[_0x8df2('0x1c')][_0x8df2('0x76')]=_0x5020d2;return _0x9091af;})[_0x8df2('0x17')](function(_0xe1d28){if(_0xe1d28){_0xe1d28['message'][_0x8df2('0x7a')]=util['format'](_0x8df2('0x7b'),_0x52d451['user']['name']);_0xe1d28[_0x8df2('0x1c')][_0x8df2('0x7c')]=_0x9091af['channel'];_0xe1d28[_0x8df2('0x1c')][_0x8df2('0x84')]=_0x9091af[_0x8df2('0x7c')];_0xe1d28[_0x8df2('0x1c')][_0x8df2('0x7d')]=_0x8df2('0x80');_0xe1d28[_0x8df2('0x1c')][_0x8df2('0x49')]=htmlToText[_0x8df2('0x7e')](_0x9091af[_0x8df2('0x1c')][_0x8df2('0x49')]);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0xe1d28[_0x8df2('0x1c')]},client9002);return _0x9091af;}return null;})[_0x8df2('0x17')](respondWithResult(_0x1428ee,null))[_0x8df2('0x1f')](handleError(_0x1428ee,null));};exports[_0x8df2('0x85')]=function(_0x3bd4a8,_0x3c2522){var _0x100713=moment()[_0x8df2('0x86')]()['toString']();var _0x45cc45=path['join'](config['root'],_0x8df2('0x87'),_0x8df2('0x88'),_0x8df2('0x89'));var _0x20f13b=path[_0x8df2('0x8a')](config[_0x8df2('0x59')],'server',_0x8df2('0x88'),_0x8df2('0x58'));var _0x48cd46=util[_0x8df2('0x60')]('message-%s.eml',_0x100713);return db[_0x8df2('0x2b')][_0x8df2('0x47')]({'where':{'id':_0x3bd4a8[_0x8df2('0x45')]['id']},'attributes':['id',_0x8df2('0x49'),_0x8df2('0x8b'),'to','cc',_0x8df2('0x8c'),_0x8df2('0x8d'),'createdAt'],'include':_0x3bd4a8[_0x8df2('0x31')][_0x8df2('0x58')]?[{'model':db[_0x8df2('0x8e')],'as':_0x8df2('0x8f')}]:undefined})[_0x8df2('0x17')](handleEntityNotFound(_0x3c2522,null))[_0x8df2('0x17')](function(_0x10e47c){if(_0x10e47c){var _0x4e13f2=_0x10e47c;var _0x1ae720={'from':_0x4e13f2['from'],'to':_0x4e13f2['to'],'subject':_0x4e13f2['subject'],'html':htmlEntities['decode'](_0x4e13f2[_0x8df2('0x49')]),'headers':{'Date':moment(_0x4e13f2[_0x8df2('0x90')])[_0x8df2('0x60')](_0x8df2('0x91'))},'attachments':[]};if(_0x10e47c['cc']){_0x1ae720[_0x8df2('0x92')]['Cc']=_0x10e47c['cc'];}if(_0x10e47c[_0x8df2('0x8c')]){_0x1ae720[_0x8df2('0x92')]['Bcc']=_0x10e47c[_0x8df2('0x8c')];}return new BPromise(function(_0xa9534d,_0x59bc8f){if(_0x10e47c[_0x8df2('0x8f')]){for(var _0x4d6492=0x0;_0x4d6492<_0x10e47c[_0x8df2('0x8f')][_0x8df2('0x37')];_0x4d6492++){var _0x525c73=_0x10e47c[_0x8df2('0x8f')][_0x4d6492];var _0x3b8208=path['join'](_0x20f13b,_0x525c73[_0x8df2('0x5b')]);if(fs[_0x8df2('0x93')](_0x3b8208)){_0x1ae720['attachments'][_0x8df2('0x94')]({'name':_0x525c73['name'],'contentType':_0x525c73[_0x8df2('0x2d')],'data':fs['readFileSync'](_0x3b8208)});}}}emlformat[_0x8df2('0x95')](_0x1ae720,function(_0x129e5a,_0x288a80){if(_0x129e5a)return _0x59bc8f(_0x129e5a);fs[_0x8df2('0x96')](path['join'](_0x45cc45,_0x48cd46),_0x288a80);return _0xa9534d(_0x288a80);});});}})['then'](function(_0x113e45){if(_0x113e45){return _0x3c2522[_0x8df2('0x85')](path['join'](_0x45cc45,_0x48cd46),_0x48cd46,function(_0x1fc1e0){if(!_0x1fc1e0)fs[_0x8df2('0x97')](path['join'](_0x45cc45,_0x48cd46));});}})[_0x8df2('0x1f')](handleError(_0x3c2522,null));}; \ No newline at end of file +var _0xf3a6=['existsSync','push','readFileSync','unlinkSync','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','client','http','then','MailMessage,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','json','undefined','limit','count','offset','status','destroy','end','sendStatus','name','send','map','MailMessage','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','show','params','keys','length','find','update','body','describe','create','secret','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteraction','role','rejectMessage','contact','email','internal','reject','rejectmessage','download','unix','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments'];(function(_0xda40ff,_0x2e30cb){var _0x35b3e0=function(_0x26b379){while(--_0x26b379){_0xda40ff['push'](_0xda40ff['shift']());}};_0x35b3e0(++_0x2e30cb);}(_0xf3a6,0x132));var _0x6f3a=function(_0x1a697e,_0x130466){_0x1a697e=_0x1a697e-0x0;var _0x40e871=_0xf3a6[_0x1a697e];return _0x40e871;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x6f3a('0x0'));var util=require(_0x6f3a('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x6f3a('0x2'));var Redis=require(_0x6f3a('0x3'));var htmlToText=require(_0x6f3a('0x4'));var qs=require(_0x6f3a('0x5'));var logger=require(_0x6f3a('0x6'))(_0x6f3a('0x7'));var interaction_log=require(_0x6f3a('0x6'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x6f3a('0x8'))['db'];config[_0x6f3a('0x9')]=_[_0x6f3a('0xa')](config[_0x6f3a('0x9')],{'host':_0x6f3a('0xb'),'port':0x18eb});var socket=require(_0x6f3a('0xc'))(new Redis(config['redis']));var htmlEntities=require(_0x6f3a('0xd'));require('./mailMessage.socket')[_0x6f3a('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6f3a('0xf')][_0x6f3a('0x10')]({'port':0x232c});var client9003=jayson[_0x6f3a('0xf')][_0x6f3a('0x10')]({'port':0x232b});var client9002=jayson[_0x6f3a('0xf')][_0x6f3a('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x1338f1,_0x476d2f,_0x9f19cb,_0x992e85){return new BPromise(function(_0x213e3c,_0x499b06){var _0x4e1fd4=_0x992e85||client;return _0x4e1fd4['request'](_0x1338f1,_0x9f19cb)[_0x6f3a('0x11')](function(_0x36b918){logger['info'](_0x6f3a('0x12'),_0x476d2f,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x476d2f,'request\x20sent',JSON['stringify'](_0x36b918));if(_0x36b918[_0x6f3a('0x13')]){if(_0x36b918[_0x6f3a('0x13')][_0x6f3a('0x14')]===0x1f4){logger[_0x6f3a('0x13')](_0x6f3a('0x12'),_0x476d2f,_0x36b918['error'][_0x6f3a('0x15')]);return _0x499b06(_0x36b918['error'][_0x6f3a('0x15')]);}logger[_0x6f3a('0x13')](_0x6f3a('0x12'),_0x476d2f,_0x36b918['error'][_0x6f3a('0x15')]);return _0x213e3c(_0x36b918['error'][_0x6f3a('0x15')]);}else{logger[_0x6f3a('0x16')]('MailMessage,\x20%s,\x20%s',_0x476d2f,_0x6f3a('0x17'));_0x213e3c(_0x36b918[_0x6f3a('0x18')][_0x6f3a('0x15')]);}})[_0x6f3a('0x19')](function(_0x2ab985){logger['error']('MailMessage,\x20%s,\x20%s',_0x476d2f,_0x2ab985);_0x499b06(_0x2ab985);});});}function respondWithResult(_0x37df28,_0x1012f7){_0x1012f7=_0x1012f7||0xc8;return function(_0x2b21cc){if(_0x2b21cc){return _0x37df28['status'](_0x1012f7)[_0x6f3a('0x1a')](_0x2b21cc);}};}function respondWithFilteredResult(_0x52d397,_0x3f0b2e){return function(_0x298612){if(_0x298612){var _0x194770=typeof _0x3f0b2e['offset']===_0x6f3a('0x1b')&&typeof _0x3f0b2e[_0x6f3a('0x1c')]===_0x6f3a('0x1b');var _0x4fe8c8=_0x298612[_0x6f3a('0x1d')];var _0x1ec4c5=_0x194770?0x0:_0x3f0b2e['offset'];var _0x572724=_0x194770?_0x298612[_0x6f3a('0x1d')]:_0x3f0b2e[_0x6f3a('0x1e')]+_0x3f0b2e[_0x6f3a('0x1c')];var _0x2cb58a;if(_0x572724>=_0x4fe8c8){_0x572724=_0x4fe8c8;_0x2cb58a=0xc8;}else{_0x2cb58a=0xce;}_0x52d397[_0x6f3a('0x1f')](_0x2cb58a);return _0x52d397['set']('Content-Range',_0x1ec4c5+'-'+_0x572724+'/'+_0x4fe8c8)[_0x6f3a('0x1a')](_0x298612);}return null;};}function saveUpdates(_0x8986bb){return function(_0x19cb36){if(_0x19cb36){return _0x19cb36['update'](_0x8986bb)[_0x6f3a('0x11')](function(_0x1ae544){return _0x1ae544;});}return null;};}function removeEntity(_0x5ce90e){return function(_0x514d2f){if(_0x514d2f){return _0x514d2f[_0x6f3a('0x20')]()[_0x6f3a('0x11')](function(){_0x5ce90e['status'](0xcc)[_0x6f3a('0x21')]();});}};}function handleEntityNotFound(_0x55917d){return function(_0x198842){if(!_0x198842){_0x55917d[_0x6f3a('0x22')](0x194);}return _0x198842;};}function handleError(_0x1e8739,_0x1cd540){_0x1cd540=_0x1cd540||0x1f4;return function(_0x98ad41){logger[_0x6f3a('0x13')](_0x98ad41['stack']);if(_0x98ad41[_0x6f3a('0x23')]){delete _0x98ad41[_0x6f3a('0x23')];}_0x1e8739[_0x6f3a('0x1f')](_0x1cd540)[_0x6f3a('0x24')](_0x98ad41);};}exports['index']=function(_0x43b28b,_0x38be61){var _0x95569e={},_0x113be8={},_0x217bc6={'count':0x0,'rows':[]};var _0x187b7e=_[_0x6f3a('0x25')](db[_0x6f3a('0x26')][_0x6f3a('0x27')],function(_0x1d958b){return{'name':_0x1d958b[_0x6f3a('0x28')],'type':_0x1d958b['type'][_0x6f3a('0x29')]};});_0x113be8['model']=_[_0x6f3a('0x25')](_0x187b7e,_0x6f3a('0x23'));_0x113be8[_0x6f3a('0x2a')]=_['keys'](_0x43b28b[_0x6f3a('0x2a')]);_0x113be8[_0x6f3a('0x2b')]=_[_0x6f3a('0x2c')](_0x113be8[_0x6f3a('0x2d')],_0x113be8[_0x6f3a('0x2a')]);_0x95569e[_0x6f3a('0x2e')]=_[_0x6f3a('0x2c')](_0x113be8['model'],qs['fields'](_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x2f')]));_0x95569e['attributes']=_0x95569e[_0x6f3a('0x2e')]['length']?_0x95569e[_0x6f3a('0x2e')]:_0x113be8[_0x6f3a('0x2d')];if(!_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x30')](_0x6f3a('0x31'))){_0x95569e[_0x6f3a('0x1c')]=qs[_0x6f3a('0x1c')](_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x1c')]);_0x95569e[_0x6f3a('0x1e')]=qs[_0x6f3a('0x1e')](_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x1e')]);}_0x95569e['order']=qs[_0x6f3a('0x32')](_0x43b28b[_0x6f3a('0x2a')]['sort']);_0x95569e[_0x6f3a('0x33')]=qs[_0x6f3a('0x2b')](_[_0x6f3a('0x34')](_0x43b28b[_0x6f3a('0x2a')],_0x113be8['filters']),_0x187b7e);if(_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x35')]){_0x95569e[_0x6f3a('0x33')]=_['merge'](_0x95569e['where'],{'$or':_[_0x6f3a('0x25')](_0x187b7e,function(_0x28c82d){if(_0x28c82d[_0x6f3a('0x36')]!=='VIRTUAL'){var _0x52f345={};_0x52f345[_0x28c82d['name']]={'$like':'%'+_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x35')]+'%'};return _0x52f345;}})});}_0x95569e=_[_0x6f3a('0x37')]({},_0x95569e,_0x43b28b[_0x6f3a('0x38')]);var _0x541ab4={'where':_0x95569e[_0x6f3a('0x33')]};return db[_0x6f3a('0x26')][_0x6f3a('0x1d')](_0x541ab4)[_0x6f3a('0x11')](function(_0x47298a){_0x217bc6[_0x6f3a('0x1d')]=_0x47298a;if(_0x43b28b['query'][_0x6f3a('0x39')]){_0x95569e[_0x6f3a('0x3a')]=[{'all':!![]}];}return db[_0x6f3a('0x26')][_0x6f3a('0x3b')](_0x95569e);})[_0x6f3a('0x11')](function(_0x3e6071){_0x217bc6['rows']=_0x3e6071;return _0x217bc6;})['then'](respondWithFilteredResult(_0x38be61,_0x95569e))[_0x6f3a('0x19')](handleError(_0x38be61,null));};exports[_0x6f3a('0x3c')]=function(_0x42129a,_0x1b4592){var _0x57774f={'raw':!![],'where':{'id':_0x42129a[_0x6f3a('0x3d')]['id']}},_0x5db3cd={};_0x5db3cd['model']=_[_0x6f3a('0x3e')](db[_0x6f3a('0x26')][_0x6f3a('0x27')]);_0x5db3cd[_0x6f3a('0x2a')]=_['keys'](_0x42129a['query']);_0x5db3cd[_0x6f3a('0x2b')]=_[_0x6f3a('0x2c')](_0x5db3cd['model'],_0x5db3cd[_0x6f3a('0x2a')]);_0x57774f[_0x6f3a('0x2e')]=_[_0x6f3a('0x2c')](_0x5db3cd['model'],qs[_0x6f3a('0x2f')](_0x42129a[_0x6f3a('0x2a')]['fields']));_0x57774f[_0x6f3a('0x2e')]=_0x57774f['attributes'][_0x6f3a('0x3f')]?_0x57774f[_0x6f3a('0x2e')]:_0x5db3cd['model'];if(_0x42129a['query'][_0x6f3a('0x39')]){_0x57774f['include']=[{'all':!![]}];}_0x57774f=_[_0x6f3a('0x37')]({},_0x57774f,_0x42129a['options']);return db[_0x6f3a('0x26')][_0x6f3a('0x40')](_0x57774f)[_0x6f3a('0x11')](handleEntityNotFound(_0x1b4592,null))[_0x6f3a('0x11')](respondWithResult(_0x1b4592,null))[_0x6f3a('0x19')](handleError(_0x1b4592,null));};exports[_0x6f3a('0x41')]=function(_0x2ac379,_0x2580bb){if(_0x2ac379[_0x6f3a('0x42')]['id']){delete _0x2ac379[_0x6f3a('0x42')]['id'];}return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x2ac379[_0x6f3a('0x3d')]['id']}})[_0x6f3a('0x11')](handleEntityNotFound(_0x2580bb,null))[_0x6f3a('0x11')](saveUpdates(_0x2ac379[_0x6f3a('0x42')],null))['then'](respondWithResult(_0x2580bb,null))[_0x6f3a('0x19')](handleError(_0x2580bb,null));};exports[_0x6f3a('0x20')]=function(_0x5216ca,_0x35774c){return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x5216ca[_0x6f3a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x35774c,null))[_0x6f3a('0x11')](removeEntity(_0x35774c,null))[_0x6f3a('0x19')](handleError(_0x35774c,null));};exports[_0x6f3a('0x43')]=function(_0x18aeec,_0x4ad6b2){return db[_0x6f3a('0x26')][_0x6f3a('0x43')]()[_0x6f3a('0x11')](respondWithResult(_0x4ad6b2,null))[_0x6f3a('0x19')](handleError(_0x4ad6b2,null));};exports[_0x6f3a('0x44')]=function(_0x47027a,_0x199f5b){return db['MailMessage'][_0x6f3a('0x44')](_0x47027a[_0x6f3a('0x42')])[_0x6f3a('0x11')](function(_0x4e769f){if(_0x4e769f){if(_0x4e769f['direction']==='out'&&!_0x4e769f[_0x6f3a('0x45')]){var _0x1d726e,_0x4e5371,_0x2293f1;if(_0x47027a[_0x6f3a('0x42')]['to']){_0x4e5371=_0x47027a['body']['to']['split'](',')[0x0];}return db[_0x6f3a('0x46')]['findOne']({'where':{'id':_0x4e769f[_0x6f3a('0x47')]},'include':[{'model':db[_0x6f3a('0x48')],'as':'List','include':[{'model':db[_0x6f3a('0x49')],'as':_0x6f3a('0x4a'),'where':{'email':_0x4e5371},'limit':0x1,'order':[[_0x6f3a('0x4b'),_0x6f3a('0x4c')]]}]},{'model':db['MailServerOut'],'as':_0x6f3a('0x4d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6f3a('0x4e'),'raw':!![]}]}]})[_0x6f3a('0x11')](function(_0x3a49a8){_0x1d726e=_0x3a49a8;if(!_0x1d726e||!_0x1d726e[_0x6f3a('0x4d')])return;var _0x176341=_0x1d726e['getSmtpOptions']();if(_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')]&&_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')]['length']){for(var _0x135a0f=0x0;_0x135a0f<_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')][_0x6f3a('0x3f')];_0x135a0f+=0x1){_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')][_0x135a0f]={'filename':_0x47027a['body'][_0x6f3a('0x4f')][_0x135a0f]['name'],'path':path[_0x6f3a('0x50')](config[_0x6f3a('0x51')],_0x6f3a('0x52'),_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')][_0x135a0f][_0x6f3a('0x53')])};}}_0x2293f1={'account':_0x176341,'message':_0x47027a[_0x6f3a('0x42')]};return;})['then'](function(){if(_0x1d726e[_0x6f3a('0x54')]){if(_0x1d726e['List']['Contacts']['length']){return _0x1d726e[_0x6f3a('0x54')][_0x6f3a('0x4a')][0x0];}else{return db[_0x6f3a('0x49')]['create'](_[_0x6f3a('0xa')](_0x47027a[_0x6f3a('0x42')],{'firstName':_0x47027a[_0x6f3a('0x42')]['to'],'email':_0x47027a['body']['to'],'phone':_0x47027a[_0x6f3a('0x42')]['to'],'ListId':_0x1d726e[_0x6f3a('0x55')]}));}}else{throw new Error(_0x6f3a('0x56'));}})[_0x6f3a('0x11')](function(){if(_0x2293f1){return respondWithRpcPromise(_0x6f3a('0x57'),_0x6f3a('0x58'),_0x2293f1,client9003)[_0x6f3a('0x11')](function(_0x1bbb14){return _0x4e769f[_0x6f3a('0x41')]({'read':!![],'messageId':_0x1bbb14[_0x6f3a('0x59')],'sentAt':moment()[_0x6f3a('0x5a')](_0x6f3a('0x5b'))});})[_0x6f3a('0x19')](function(_0x3b99d6){logger[_0x6f3a('0x13')]('%s',JSON['stringify'](_0x3b99d6));return _0x4e769f;});}return _0x4e769f;});}return _0x4e769f;}})[_0x6f3a('0x11')](respondWithResult(_0x199f5b,0xc9))['catch'](handleError(_0x199f5b,null));};exports['accept']=function(_0x546770,_0x71f444){var _0x5bdffb={'agent':{},'channel':_0x6f3a('0x5c')};if(_0x546770[_0x6f3a('0x42')]['id']){delete _0x546770[_0x6f3a('0x42')]['id'];}_0x546770[_0x6f3a('0x42')][_0x6f3a('0x5d')]=!![];_0x546770[_0x6f3a('0x42')][_0x6f3a('0x5e')]=moment()[_0x6f3a('0x5a')](_0x6f3a('0x5b'));_0x546770[_0x6f3a('0x42')][_0x6f3a('0x5f')]=_0x546770['body'][_0x6f3a('0x5f')]||_0x546770[_0x6f3a('0x60')]['id'];_0x5bdffb[_0x6f3a('0x61')]['id']=_0x546770['body'][_0x6f3a('0x5f')];return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x546770[_0x6f3a('0x3d')]['id'],'UserId':null}})[_0x6f3a('0x11')](handleEntityNotFound(_0x71f444,null))['then'](saveUpdates(_0x546770[_0x6f3a('0x42')],null))[_0x6f3a('0x11')](function(_0x144bb0){if(_0x144bb0){_0x5bdffb[_0x6f3a('0x15')]=_0x144bb0[_0x6f3a('0x62')]({'plain':!![]});return db['MailInteraction'][_0x6f3a('0x40')]({'where':{'id':_0x144bb0[_0x6f3a('0x63')]}});}return null;})[_0x6f3a('0x11')](handleEntityNotFound(_0x71f444,null))[_0x6f3a('0x11')](function(_0x487dae){if(_0x487dae){return _0x487dae['update']({'UserId':_0x546770['body'][_0x6f3a('0x5f')],'read1stAt':_[_0x6f3a('0x64')](_0x487dae[_0x6f3a('0x65')])?moment()[_0x6f3a('0x5a')](_0x6f3a('0x5b')):undefined});}return null;})['then'](function(_0x17ec6e){if(_0x17ec6e){_0x5bdffb[_0x6f3a('0x66')]=_0x17ec6e[_0x6f3a('0x62')]({'plain':!![]});interaction_log[_0x6f3a('0x16')](_0x6f3a('0x67'),_0x546770[_0x6f3a('0x60')]['id'],_0x546770['user'][_0x6f3a('0x23')],_0x546770['user']['role'],_0x5bdffb['interaction']['id'],_0x546770[_0x6f3a('0x42')]?JSON[_0x6f3a('0x68')](_0x546770[_0x6f3a('0x42')]):_0x6f3a('0x69'));return respondWithRpcPromise(_0x6f3a('0x6a'),'acceptMessage',_0x5bdffb);}return null;})[_0x6f3a('0x11')](function(_0x5c93e9){var _0x237c78='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c93e9[_0x6f3a('0x15')][_0x6f3a('0x6b')];return db[_0x6f3a('0x6c')][_0x6f3a('0x2a')](_0x237c78,{'type':db[_0x6f3a('0x6d')][_0x6f3a('0x6e')][_0x6f3a('0x6f')],'raw':!![]})['then'](function(_0x32c48b){return _0x32c48b;});})[_0x6f3a('0x11')](function(_0x369be1){if(_0x369be1){_0x5bdffb[_0x6f3a('0x15')]['contact']=_0x369be1[0x0];if(!_0x546770[_0x6f3a('0x42')]['UserId'])return;return db[_0x6f3a('0x70')][_0x6f3a('0x40')]({'where':{'id':_0x546770['body'][_0x6f3a('0x5f')],'role':_0x6f3a('0x61')},'attributes':['id','name',_0x6f3a('0x71'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x2670ee){if(!_0x2670ee)return null;_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x61')]=_0x2670ee;return _0x5bdffb;})[_0x6f3a('0x11')](function(_0x8cee96){if(_0x8cee96){if(_0x546770[_0x6f3a('0x42')][_0x6f3a('0x72')]){_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x73')]=util['format'](_0x6f3a('0x74'),_0x546770['user'][_0x6f3a('0x23')]);_0x5bdffb['message']['channel']=_0x5bdffb[_0x6f3a('0x75')];_0x5bdffb['message'][_0x6f3a('0x76')]=_0x5bdffb[_0x6f3a('0x75')];_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x77')]='accept';_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x42')]=htmlToText[_0x6f3a('0x78')](_0x5bdffb[_0x6f3a('0x15')]['body']);return respondWithRpcPromise(_0x6f3a('0x79'),'EventManager',{'event':_0x6f3a('0x7a'),'message':_0x5bdffb['message']},client9002)[_0x6f3a('0x11')](function(){return _0x5bdffb;});}return _0x5bdffb;}return null;})[_0x6f3a('0x11')](respondWithResult(_0x71f444,null))[_0x6f3a('0x19')](handleError(_0x71f444,null));};exports['reject']=function(_0x29687c,_0x553846){var _0x2f67d7={'agent':{},'channel':_0x6f3a('0x5c')};if(_0x29687c[_0x6f3a('0x42')]['id']){delete _0x29687c['body']['id'];}_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')]=_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')]||_0x29687c[_0x6f3a('0x60')]['id'];_0x2f67d7['agent']['id']=_0x29687c[_0x6f3a('0x42')]['UserId'];return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x29687c[_0x6f3a('0x3d')]['id'],'UserId':null}})[_0x6f3a('0x11')](handleEntityNotFound(_0x553846,null))['then'](function(_0x50d9d6){if(_0x50d9d6){_0x2f67d7[_0x6f3a('0x15')]=_0x50d9d6[_0x6f3a('0x62')]({'plain':!![]});return db[_0x6f3a('0x7b')][_0x6f3a('0x40')]({'where':{'id':_0x50d9d6[_0x6f3a('0x63')]}});}return null;})[_0x6f3a('0x11')](handleEntityNotFound(_0x553846,null))[_0x6f3a('0x11')](function(_0x4f51c0){if(_0x4f51c0){_0x2f67d7[_0x6f3a('0x66')]=_0x4f51c0[_0x6f3a('0x62')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29687c['user']['id'],_0x29687c[_0x6f3a('0x60')][_0x6f3a('0x23')],_0x29687c[_0x6f3a('0x60')][_0x6f3a('0x7c')],_0x2f67d7[_0x6f3a('0x66')]['id'],_0x29687c['body']?JSON[_0x6f3a('0x68')](_0x29687c[_0x6f3a('0x42')]):'null');return respondWithRpcPromise('RejectMessage',_0x6f3a('0x7d'),_0x2f67d7);}return null;})[_0x6f3a('0x11')](function(_0x21fc55){var _0x31ea4a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x21fc55[_0x6f3a('0x15')]['ContactId'];return db[_0x6f3a('0x6c')][_0x6f3a('0x2a')](_0x31ea4a,{'type':db[_0x6f3a('0x6d')]['QueryTypes'][_0x6f3a('0x6f')],'raw':!![]})[_0x6f3a('0x11')](function(_0x2249dc){return _0x2249dc;});})[_0x6f3a('0x11')](function(_0x195437){if(_0x195437){_0x2f67d7[_0x6f3a('0x15')][_0x6f3a('0x7e')]=_0x195437[0x0];if(!_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')])return;return db[_0x6f3a('0x70')]['find']({'where':{'id':_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')],'role':_0x6f3a('0x61')},'attributes':['id',_0x6f3a('0x23'),'fullname',_0x6f3a('0x7f'),_0x6f3a('0x80')],'raw':!![]});}return null;})[_0x6f3a('0x11')](function(_0x36a406){if(!_0x36a406)return null;_0x2f67d7[_0x6f3a('0x15')][_0x6f3a('0x61')]=_0x36a406;return _0x2f67d7;})[_0x6f3a('0x11')](function(_0x521bf3){if(_0x521bf3){_0x521bf3['message']['interface']=util[_0x6f3a('0x5a')]('SIP/%s',_0x29687c['user'][_0x6f3a('0x23')]);_0x521bf3[_0x6f3a('0x15')][_0x6f3a('0x75')]=_0x2f67d7[_0x6f3a('0x75')];_0x521bf3[_0x6f3a('0x15')][_0x6f3a('0x76')]=_0x2f67d7['channel'];_0x521bf3[_0x6f3a('0x15')][_0x6f3a('0x77')]=_0x6f3a('0x81');_0x521bf3[_0x6f3a('0x15')]['body']=htmlToText[_0x6f3a('0x78')](_0x2f67d7[_0x6f3a('0x15')][_0x6f3a('0x42')]);respondWithRpcPromise('EventManager',_0x6f3a('0x79'),{'event':_0x6f3a('0x82'),'message':_0x521bf3[_0x6f3a('0x15')]},client9002);return _0x2f67d7;}return null;})['then'](respondWithResult(_0x553846,null))['catch'](handleError(_0x553846,null));};exports[_0x6f3a('0x83')]=function(_0x3d32fe,_0x111565){var _0x508976=moment()[_0x6f3a('0x84')]()['toString']();var _0x200d7b=path[_0x6f3a('0x50')](config['root'],_0x6f3a('0x85'),_0x6f3a('0x86'),_0x6f3a('0x87'));var _0x34c219=path[_0x6f3a('0x50')](config[_0x6f3a('0x51')],_0x6f3a('0x85'),_0x6f3a('0x86'),_0x6f3a('0x4f'));var _0x590c7b=util[_0x6f3a('0x5a')](_0x6f3a('0x88'),_0x508976);return db['MailMessage']['find']({'where':{'id':_0x3d32fe[_0x6f3a('0x3d')]['id']},'attributes':['id',_0x6f3a('0x42'),'from','to','cc',_0x6f3a('0x89'),_0x6f3a('0x8a'),_0x6f3a('0x8b')],'include':_0x3d32fe[_0x6f3a('0x2a')][_0x6f3a('0x4f')]?[{'model':db[_0x6f3a('0x8c')],'as':'Attachments'}]:undefined})[_0x6f3a('0x11')](handleEntityNotFound(_0x111565,null))[_0x6f3a('0x11')](function(_0x402ac3){if(_0x402ac3){var _0x34d1db=_0x402ac3;var _0x177b8f={'from':_0x34d1db[_0x6f3a('0x8d')],'to':_0x34d1db['to'],'subject':_0x34d1db['subject'],'html':htmlEntities[_0x6f3a('0x8e')](_0x34d1db[_0x6f3a('0x42')]),'headers':{'Date':moment(_0x34d1db[_0x6f3a('0x8b')])['format'](_0x6f3a('0x8f'))},'attachments':[]};if(_0x402ac3['cc']){_0x177b8f[_0x6f3a('0x90')]['Cc']=_0x402ac3['cc'];}if(_0x402ac3[_0x6f3a('0x89')]){_0x177b8f['headers'][_0x6f3a('0x91')]=_0x402ac3[_0x6f3a('0x89')];}return new BPromise(function(_0x22225b,_0xb10eec){if(_0x402ac3['Attachments']){for(var _0x24deaa=0x0;_0x24deaa<_0x402ac3[_0x6f3a('0x92')][_0x6f3a('0x3f')];_0x24deaa++){var _0x5de523=_0x402ac3[_0x6f3a('0x92')][_0x24deaa];var _0x274611=path[_0x6f3a('0x50')](_0x34c219,_0x5de523[_0x6f3a('0x53')]);if(fs[_0x6f3a('0x93')](_0x274611)){_0x177b8f[_0x6f3a('0x4f')][_0x6f3a('0x94')]({'name':_0x5de523[_0x6f3a('0x23')],'contentType':_0x5de523[_0x6f3a('0x36')],'data':fs[_0x6f3a('0x95')](_0x274611)});}}}emlformat['build'](_0x177b8f,function(_0x1ab31e,_0x11fbff){if(_0x1ab31e)return _0xb10eec(_0x1ab31e);fs['writeFileSync'](path[_0x6f3a('0x50')](_0x200d7b,_0x590c7b),_0x11fbff);return _0x22225b(_0x11fbff);});});}})[_0x6f3a('0x11')](function(_0x11df82){if(_0x11df82){return _0x111565['download'](path[_0x6f3a('0x50')](_0x200d7b,_0x590c7b),_0x590c7b,function(_0x4430d2){if(!_0x4430d2)fs[_0x6f3a('0x96')](path[_0x6f3a('0x50')](_0x200d7b,_0x590c7b));});}})[_0x6f3a('0x19')](handleError(_0x111565,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index cfb3a1e..9c52afe 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd995=['hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5bb2b7,_0x33f14b){var _0xa5dbf6=function(_0x5ceed9){while(--_0x5ceed9){_0x5bb2b7['push'](_0x5bb2b7['shift']());}};_0xa5dbf6(++_0x33f14b);}(_0xd995,0x13c));var _0x5d99=function(_0x4d61a1,_0x15694f){_0x4d61a1=_0x4d61a1-0x0;var _0x3a542f=_0xd995[_0x4d61a1];return _0x3a542f;};'use strict';var EventEmitter=require(_0x5d99('0x0'));var MailMessage=require(_0x5d99('0x1'))['db'][_0x5d99('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5d99('0x3')](0x0);var events={'afterCreate':_0x5d99('0x4'),'afterUpdate':_0x5d99('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12a0cc){return function(_0x1a13dc,_0x4f2e30,_0x18efc5){MailMessageEvents['emit'](_0x12a0cc+':'+_0x1a13dc['id'],_0x1a13dc);MailMessageEvents[_0x5d99('0x6')](_0x12a0cc,_0x1a13dc);_0x18efc5(null);};}for(var e in events){if(events[_0x5d99('0x7')](e)){var event=events[e];MailMessage[_0x5d99('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x8897=['MailMessage','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0x8897,0xa7));var _0x7889=function(_0x5321a4,_0x3029bd){_0x5321a4=_0x5321a4-0x0;var _0x59c36c=_0x8897[_0x5321a4];return _0x59c36c;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x7889('0x0'))['db'][_0x7889('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7889('0x2'),'afterDestroy':_0x7889('0x3')};function emitEvent(_0xf981e8){return function(_0x365d7b,_0xc8681,_0x102dd5){MailMessageEvents[_0x7889('0x4')](_0xf981e8+':'+_0x365d7b['id'],_0x365d7b);MailMessageEvents[_0x7889('0x4')](_0xf981e8,_0x365d7b);_0x102dd5(null);};}for(var e in events){if(events[_0x7889('0x5')](e)){var event=events[e];MailMessage[_0x7889('0x6')](e,emitEvent(event));}}module[_0x7889('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 8fd704f..ebc0d87 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3466=['body','fromString','get','toLowerCase','out','secret','UserId','findOne','MailInteractionId','then','createdAt','direction','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','html-to-text','path','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT'];(function(_0xde80d,_0x312776){var _0x551ba0=function(_0x34d19e){while(--_0x34d19e){_0xde80d['push'](_0xde80d['shift']());}};_0x551ba0(++_0x312776);}(_0x3466,0x126));var _0x6346=function(_0x370c1a,_0x444e6f){_0x370c1a=_0x370c1a-0x0;var _0xb4f5e9=_0x3466[_0x370c1a];return _0xb4f5e9;};'use strict';var _=require(_0x6346('0x0'));var util=require(_0x6346('0x1'));var logger=require(_0x6346('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6346('0x3'));var rp=require(_0x6346('0x4'));var htmlToText=require(_0x6346('0x5'));var fs=require('fs');var path=require(_0x6346('0x6'));var rimraf=require('rimraf');var config=require(_0x6346('0x7'));var attributes=require('./mailMessage.attributes');module[_0x6346('0x8')]=function(_0x340147,_0x17580e){return _0x340147[_0x6346('0x9')]('MailMessage',attributes,{'tableName':_0x6346('0xa'),'paranoid':![],'indexes':[{'name':_0x6346('0xb'),'fields':[_0x6346('0xb')]},{'name':_0x6346('0xc'),'fields':[_0x6346('0xd'),_0x6346('0xe')],'type':_0x6346('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xeaefb8,_0xec5ac1,_0x1b17e1){if(_0xeaefb8[_0x6346('0x10')]){_0xeaefb8[_0x6346('0xd')]=htmlToText[_0x6346('0x11')](_0xeaefb8[_0x6346('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1b17e1(null,_0xec5ac1);},'afterCreate':function(_0x350f5d,_0x38851b,_0xeddf37){var _0x4a398d=_0x340147['models'];var _0x2ae116=_0x350f5d[_0x6346('0x12')]({'plain':!![]});if(_0x2ae116['direction'][_0x6346('0x13')]()==='in'||_0x2ae116['direction'][_0x6346('0x13')]()===_0x6346('0x14')&&!_0x2ae116[_0x6346('0x15')]&&!_['isNil'](_0x2ae116[_0x6346('0x16')])){_0x4a398d['MailInteraction'][_0x6346('0x17')]({'where':{'id':_0x2ae116[_0x6346('0x18')]}})[_0x6346('0x19')](function(_0x5ac65a){if(_0x5ac65a){_0x5ac65a['update']({'lastMsgAt':_0x2ae116[_0x6346('0x1a')],'lastMsgDirection':_0x2ae116[_0x6346('0x1b')]['toLowerCase']()});}})[_0x6346('0x1c')](function(_0x50231f){console[_0x6346('0x1d')](_0x50231f);});}_0xeddf37();}},'charset':'utf8mb4','collate':_0x6346('0x1e')});}; \ No newline at end of file +var _0xce25=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','toLowerCase'];(function(_0x116246,_0x2dfa41){var _0x439ddd=function(_0x546da8){while(--_0x546da8){_0x116246['push'](_0x116246['shift']());}};_0x439ddd(++_0x2dfa41);}(_0xce25,0x115));var _0x5ce2=function(_0x11618f,_0x526928){_0x11618f=_0x11618f-0x0;var _0x1db5d0=_0xce25[_0x11618f];return _0x1db5d0;};'use strict';var _=require(_0x5ce2('0x0'));var util=require(_0x5ce2('0x1'));var logger=require('../../config/logger')(_0x5ce2('0x2'));var moment=require(_0x5ce2('0x3'));var BPromise=require(_0x5ce2('0x4'));var rp=require(_0x5ce2('0x5'));var htmlToText=require(_0x5ce2('0x6'));var fs=require('fs');var path=require(_0x5ce2('0x7'));var rimraf=require(_0x5ce2('0x8'));var config=require(_0x5ce2('0x9'));var attributes=require('./mailMessage.attributes');module[_0x5ce2('0xa')]=function(_0x5a2710,_0x46371f){return _0x5a2710[_0x5ce2('0xb')](_0x5ce2('0xc'),attributes,{'tableName':_0x5ce2('0xd'),'paranoid':![],'indexes':[{'name':_0x5ce2('0xe'),'fields':[_0x5ce2('0xe')]},{'name':_0x5ce2('0xf'),'fields':[_0x5ce2('0x10'),_0x5ce2('0x11')],'type':_0x5ce2('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17b4c5,_0x17117f,_0x222586){if(_0x17b4c5[_0x5ce2('0x13')]){_0x17b4c5[_0x5ce2('0x10')]=htmlToText[_0x5ce2('0x14')](_0x17b4c5[_0x5ce2('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x222586(null,_0x17117f);},'afterCreate':function(_0x361d51,_0x3cc1bd,_0x460768){var _0x4e0c61=_0x5a2710[_0x5ce2('0x15')];var _0x3f298c=_0x361d51[_0x5ce2('0x16')]({'plain':!![]});if(_0x3f298c[_0x5ce2('0x17')]['toLowerCase']()==='in'||_0x3f298c[_0x5ce2('0x17')]['toLowerCase']()===_0x5ce2('0x18')&&!_0x3f298c[_0x5ce2('0x19')]&&!_[_0x5ce2('0x1a')](_0x3f298c[_0x5ce2('0x1b')])){_0x4e0c61[_0x5ce2('0x1c')][_0x5ce2('0x1d')]({'where':{'id':_0x3f298c[_0x5ce2('0x1e')]}})[_0x5ce2('0x1f')](function(_0x5b7bd8){if(_0x5b7bd8){_0x5b7bd8[_0x5ce2('0x20')]({'lastMsgAt':_0x3f298c[_0x5ce2('0x21')],'lastMsgDirection':_0x3f298c[_0x5ce2('0x17')][_0x5ce2('0x22')]()});}})[_0x5ce2('0x23')](function(_0x5da435){console[_0x5ce2('0x24')](_0x5da435);});}_0x460768();}},'charset':_0x5ce2('0x25'),'collate':_0x5ce2('0x26')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bf82f68..1f1a9ec 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0xdb28,0x106));var _0x8db2=function(_0x3cddce,_0x38eb99){_0x3cddce=_0x3cddce-0x0;var _0x21d2f6=_0xdb28[_0x3cddce];return _0x21d2f6;};'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});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('MailMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateMailMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateMailMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x63a5=['error','message','result','catch','body','options','raw','CreateMailMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x210126,_0x491b15){var _0x4dabfa=function(_0x3653fb){while(--_0x3653fb){_0x210126['push'](_0x210126['shift']());}};_0x4dabfa(++_0x491b15);}(_0x63a5,0x18e));var _0x563a=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x63a5[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});config[_0x563a('0x9')]=_[_0x563a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x563a('0xb'))(new Redis(config[_0x563a('0x9')]));require(_0x563a('0xc'))[_0x563a('0xd')](socket);function respondWithRpcPromise(_0x255922,_0xa61ffa,_0xd1b480){return new BPromise(function(_0x381fab,_0x3e97a8){return client[_0x563a('0xe')](_0x255922,_0xd1b480)[_0x563a('0xf')](function(_0x2361dd){logger[_0x563a('0x10')](_0x563a('0x11'),_0xa61ffa,'request\x20sent');logger[_0x563a('0x12')](_0x563a('0x13'),_0xa61ffa,_0x563a('0x14'),JSON[_0x563a('0x15')](_0x2361dd));if(_0x2361dd[_0x563a('0x16')]){if(_0x2361dd[_0x563a('0x16')]['code']===0x1f4){logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);return _0x3e97a8(_0x2361dd['error']['message']);}logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd['error'][_0x563a('0x17')]);return _0x381fab(_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);}else{logger[_0x563a('0x10')]('MailMessage,\x20%s,\x20%s',_0xa61ffa,'request\x20sent');_0x381fab(_0x2361dd[_0x563a('0x18')][_0x563a('0x17')]);}})[_0x563a('0x19')](function(_0x526a51){logger['error']('MailMessage,\x20%s,\x20%s',_0xa61ffa,_0x526a51);_0x3e97a8(_0x526a51);});});}exports['CreateMailMessage']=function(_0x40916a){var _0x300956=this;return new Promise(function(_0x26061f,_0x43b7a8){return db['MailMessage']['create'](_0x40916a[_0x563a('0x1a')],{'raw':_0x40916a[_0x563a('0x1b')]?_0x40916a[_0x563a('0x1b')][_0x563a('0x1c')]===undefined?!![]:![]:!![]})[_0x563a('0xf')](function(_0x2dc7e2){logger[_0x563a('0x10')](_0x563a('0x1d'),_0x40916a);logger['debug'](_0x563a('0x1d'),_0x40916a,JSON['stringify'](_0x2dc7e2));_0x26061f(_0x2dc7e2);})[_0x563a('0x19')](function(_0xd3e0ae){logger[_0x563a('0x16')](_0x563a('0x1d'),_0xd3e0ae[_0x563a('0x17')],_0x40916a);_0x43b7a8(_0x300956[_0x563a('0x16')](0x1f4,_0xd3e0ae[_0x563a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 774ed91..e606adc 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf33=['emit','register','length','./mailMessage.events','save','remove','update'];(function(_0x37bf8d,_0x43bce8){var _0x580ada=function(_0x43df13){while(--_0x43df13){_0x37bf8d['push'](_0x37bf8d['shift']());}};_0x580ada(++_0x43bce8);}(_0xcf33,0x10d));var _0x3cf3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcf33[_0x502c7d];return _0x30b7ed;};'use strict';var MailMessageEvents=require(_0x3cf3('0x0'));var events=[_0x3cf3('0x1'),_0x3cf3('0x2'),_0x3cf3('0x3')];function createListener(_0x4efc26,_0x3cdbd7){return function(_0x4e9a39){_0x3cdbd7[_0x3cf3('0x4')](_0x4efc26,_0x4e9a39);};}function removeListener(_0x285a6b,_0xedf347){return function(){MailMessageEvents['removeListener'](_0x285a6b,_0xedf347);};}exports[_0x3cf3('0x5')]=function(_0x15fe57){for(var _0x4b03a1=0x0,_0x119edb=events[_0x3cf3('0x6')];_0x4b03a1<_0x119edb;_0x4b03a1++){var _0x508ebc=events[_0x4b03a1];var _0x404308=createListener('mailMessage:'+_0x508ebc,_0x15fe57);MailMessageEvents['on'](_0x508ebc,_0x404308);}}; \ No newline at end of file +var _0xd44e=['length','mailMessage:','./mailMessage.events','save','remove','update','emit','register'];(function(_0x554911,_0x4d1f4c){var _0x3743e1=function(_0x50788b){while(--_0x50788b){_0x554911['push'](_0x554911['shift']());}};_0x3743e1(++_0x4d1f4c);}(_0xd44e,0x1c2));var _0xed44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd44e[_0x14add3];return _0x4a174f;};'use strict';var MailMessageEvents=require(_0xed44('0x0'));var events=[_0xed44('0x1'),_0xed44('0x2'),_0xed44('0x3')];function createListener(_0x9f67df,_0x5744da){return function(_0x2d8575){_0x5744da[_0xed44('0x4')](_0x9f67df,_0x2d8575);};}function removeListener(_0xb471c,_0x17223d){return function(){MailMessageEvents['removeListener'](_0xb471c,_0x17223d);};}exports[_0xed44('0x5')]=function(_0x138b6d){for(var _0x3d75fa=0x0,_0x5b172a=events[_0xed44('0x6')];_0x3d75fa<_0x5b172a;_0x3d75fa++){var _0x4247c9=events[_0x3d75fa];var _0x25f348=createListener(_0xed44('0x7')+_0x4247c9,_0x138b6d);MailMessageEvents['on'](_0x4247c9,_0x25f348);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c35281f..66dd589 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa781=['Router','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x2b7df8,_0x2f1cd0){var _0x5b8b3d=function(_0xeffb26){while(--_0xeffb26){_0x2b7df8['push'](_0x2b7df8['shift']());}};_0x5b8b3d(++_0x2f1cd0);}(_0xa781,0x1cc));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1a78('0x0'));var util=require(_0x1a78('0x1'));var path=require(_0x1a78('0x2'));var timeout=require(_0x1a78('0x3'));var express=require(_0x1a78('0x4'));var router=express[_0x1a78('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1a78('0x6'));var config=require(_0x1a78('0x7'));var controller=require(_0x1a78('0x8'));router[_0x1a78('0x9')]('/',auth[_0x1a78('0xa')](),controller[_0x1a78('0xb')]);router[_0x1a78('0x9')]('/describe',auth[_0x1a78('0xa')](),controller[_0x1a78('0xc')]);router[_0x1a78('0x9')](_0x1a78('0xd'),auth[_0x1a78('0xa')](),controller[_0x1a78('0xe')]);router['get']('/:id/members',auth[_0x1a78('0xa')](),controller[_0x1a78('0xf')]);router[_0x1a78('0x9')]('/:id/teams',auth[_0x1a78('0xa')](),controller[_0x1a78('0x10')]);router[_0x1a78('0x9')](_0x1a78('0x11'),auth[_0x1a78('0xa')](),controller[_0x1a78('0x12')]);router['post']('/',auth[_0x1a78('0xa')](),controller[_0x1a78('0x13')]);router[_0x1a78('0x14')](_0x1a78('0x15'),auth['isAuthenticated'](),controller[_0x1a78('0x16')]);router[_0x1a78('0x14')](_0x1a78('0x11'),auth[_0x1a78('0xa')](),controller[_0x1a78('0x17')]);router[_0x1a78('0x18')](_0x1a78('0xd'),auth[_0x1a78('0xa')](),controller[_0x1a78('0x19')]);router['delete'](_0x1a78('0xd'),auth[_0x1a78('0xa')](),controller[_0x1a78('0x1a')]);router[_0x1a78('0x1b')](_0x1a78('0x15'),auth[_0x1a78('0xa')](),controller[_0x1a78('0x1c')]);router[_0x1a78('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x1a78('0x1d')]);module[_0x1a78('0x1e')]=router; \ No newline at end of file +var _0xb76c=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x13851e,_0x249f30){var _0x50524d=function(_0x50fbf5){while(--_0x50fbf5){_0x13851e['push'](_0x13851e['shift']());}};_0x50524d(++_0x249f30);}(_0xb76c,0x75));var _0xcb76=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xb76c[_0x15b399];return _0x199f2d;};'use strict';var multer=require(_0xcb76('0x0'));var util=require(_0xcb76('0x1'));var path=require(_0xcb76('0x2'));var timeout=require(_0xcb76('0x3'));var express=require(_0xcb76('0x4'));var router=express[_0xcb76('0x5')]();var fs_extra=require(_0xcb76('0x6'));var auth=require(_0xcb76('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcb76('0x8'));var controller=require('./mailQueue.controller');router[_0xcb76('0x9')]('/',auth[_0xcb76('0xa')](),controller[_0xcb76('0xb')]);router[_0xcb76('0x9')](_0xcb76('0xc'),auth['isAuthenticated'](),controller[_0xcb76('0xd')]);router[_0xcb76('0x9')]('/:id',auth[_0xcb76('0xa')](),controller[_0xcb76('0xe')]);router[_0xcb76('0x9')](_0xcb76('0xf'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x10')]);router['get'](_0xcb76('0x11'),auth['isAuthenticated'](),controller[_0xcb76('0x12')]);router[_0xcb76('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xcb76('0x13')]);router['post']('/',auth[_0xcb76('0xa')](),controller[_0xcb76('0x14')]);router[_0xcb76('0x15')](_0xcb76('0x11'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x16')]);router[_0xcb76('0x15')](_0xcb76('0x17'),auth[_0xcb76('0xa')](),controller['addAgents']);router[_0xcb76('0x18')](_0xcb76('0x19'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x1a')]);router[_0xcb76('0x1b')](_0xcb76('0x19'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x1c')]);router[_0xcb76('0x1b')](_0xcb76('0x11'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x1d')]);router[_0xcb76('0x1b')](_0xcb76('0x17'),auth['isAuthenticated'](),controller[_0xcb76('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 9867840..1eaca77 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24da=['rrmemory','beepall','exports','STRING','name','INTEGER'];(function(_0x12781,_0x5e49b5){var _0x5a88db=function(_0x35f86e){while(--_0x35f86e){_0x12781['push'](_0x12781['shift']());}};_0x5a88db(++_0x5e49b5);}(_0x24da,0x86));var _0xa24d=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x24da[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');module[_0xa24d('0x0')]={'name':{'type':Sequelize[_0xa24d('0x1')],'unique':_0xa24d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa24d('0x1')]},'timeout':{'type':Sequelize[_0xa24d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa24d('0x4'),_0xa24d('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xbf5f=['INTEGER','rrmemory','beepall','sequelize','STRING'];(function(_0x8295d6,_0x263216){var _0x4fa9aa=function(_0x4779de){while(--_0x4779de){_0x8295d6['push'](_0x8295d6['shift']());}};_0x4fa9aa(++_0x263216);}(_0xbf5f,0x1bb));var _0xfbf5=function(_0x1b61d0,_0x374c5d){_0x1b61d0=_0x1b61d0-0x0;var _0x1e48f6=_0xbf5f[_0x1b61d0];return _0x1e48f6;};'use strict';var Sequelize=require(_0xfbf5('0x0'));module['exports']={'name':{'type':Sequelize[_0xfbf5('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfbf5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfbf5('0x3'),_0xfbf5('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 0874fba..f8e8d86 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5137=['Agents','online','interface','transaction','findOrCreate','forEach','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','value','removeTeams','isEmpty','emit','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','MailQueues','UserProfileResource','stack','name','map','MailQueue','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids'];(function(_0x4da0ed,_0x2f1441){var _0x14cdcc=function(_0x36d5f2){while(--_0x36d5f2){_0x4da0ed['push'](_0x4da0ed['shift']());}};_0x14cdcc(++_0x2f1441);}(_0x5137,0x1c9));var _0x7513=function(_0x3017a1,_0x29c1e4){_0x3017a1=_0x3017a1-0x0;var _0x50c6cf=_0x5137[_0x3017a1];return _0x50c6cf;};'use strict';var emlformat=require(_0x7513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7513('0x1'));var jsonpatch=require(_0x7513('0x2'));var rp=require('request-promise');var moment=require(_0x7513('0x3'));var BPromise=require(_0x7513('0x4'));var Mustache=require('mustache');var util=require(_0x7513('0x5'));var path=require(_0x7513('0x6'));var sox=require(_0x7513('0x7'));var csv=require(_0x7513('0x8'));var ejs=require(_0x7513('0x9'));var fs=require('fs');var fs_extra=require(_0x7513('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7513('0xb'));var deskjs=require(_0x7513('0xc'));var toCsv=require(_0x7513('0x8'));var querystring=require(_0x7513('0xd'));var Papa=require(_0x7513('0xe'));var Redis=require(_0x7513('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7513('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7513('0x11'));var utils=require(_0x7513('0x12'));var config=require(_0x7513('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7513('0x14'))['db'];config['redis']=_[_0x7513('0x15')](config[_0x7513('0x16')],{'host':_0x7513('0x17'),'port':0x18eb});var socket=require(_0x7513('0x18'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x7513('0x19')](socket);function respondWithStatusCode(_0x2c3a05,_0x58e1c4){_0x58e1c4=_0x58e1c4||0xcc;return function(_0x100cc3){if(_0x100cc3){return _0x2c3a05[_0x7513('0x1a')](_0x58e1c4);}return _0x2c3a05['status'](_0x58e1c4)[_0x7513('0x1b')]();};}function respondWithResult(_0x378bed,_0xee245){_0xee245=_0xee245||0xc8;return function(_0x229d3f){if(_0x229d3f){return _0x378bed[_0x7513('0x1c')](_0xee245)[_0x7513('0x1d')](_0x229d3f);}};}function respondWithFilteredResult(_0x2ba981,_0x51b208){return function(_0x53ea5b){if(_0x53ea5b){var _0x3b3eeb=typeof _0x51b208['offset']===_0x7513('0x1e')&&typeof _0x51b208[_0x7513('0x1f')]==='undefined';var _0xe145e1=_0x53ea5b[_0x7513('0x20')];var _0x48c7e9=_0x3b3eeb?0x0:_0x51b208['offset'];var _0x2c791f=_0x3b3eeb?_0x53ea5b[_0x7513('0x20')]:_0x51b208[_0x7513('0x21')]+_0x51b208['limit'];var _0x665a72;if(_0x2c791f>=_0xe145e1){_0x2c791f=_0xe145e1;_0x665a72=0xc8;}else{_0x665a72=0xce;}_0x2ba981[_0x7513('0x1c')](_0x665a72);return _0x2ba981[_0x7513('0x22')](_0x7513('0x23'),_0x48c7e9+'-'+_0x2c791f+'/'+_0xe145e1)[_0x7513('0x1d')](_0x53ea5b);}return null;};}function patchUpdates(_0x1ed012){return function(_0x472557){try{jsonpatch[_0x7513('0x24')](_0x472557,_0x1ed012,!![]);}catch(_0xdb6d87){return BPromise['reject'](_0xdb6d87);}return _0x472557[_0x7513('0x25')]();};}function saveUpdates(_0x30437f,_0x4bfe80){return function(_0x13ee9c){if(_0x13ee9c){return _0x13ee9c[_0x7513('0x26')](_0x30437f)['then'](function(_0x130769){return _0x130769;});}return null;};}function removeEntity(_0x8cb4cc,_0x2cb62d){return function(_0x3e6dca){if(_0x3e6dca){return _0x3e6dca[_0x7513('0x27')]()[_0x7513('0x28')](function(){var _0x200660=_0x3e6dca['get']({'plain':!![]});var _0x2cf5aa=_0x7513('0x29');return db[_0x7513('0x2a')][_0x7513('0x27')]({'where':{'type':_0x2cf5aa,'resourceId':_0x200660['id']}})[_0x7513('0x28')](function(){return _0x3e6dca;});})['then'](function(){_0x8cb4cc['status'](0xcc)[_0x7513('0x1b')]();});}};}function handleEntityNotFound(_0x4cb6f6,_0x1eefc2){return function(_0x2a3950){if(!_0x2a3950){_0x4cb6f6['sendStatus'](0x194);}return _0x2a3950;};}function handleError(_0x594a9d,_0x4b640a){_0x4b640a=_0x4b640a||0x1f4;return function(_0x25d2f4){logger['error'](_0x25d2f4[_0x7513('0x2b')]);if(_0x25d2f4[_0x7513('0x2c')]){delete _0x25d2f4[_0x7513('0x2c')];}_0x594a9d[_0x7513('0x1c')](_0x4b640a)['send'](_0x25d2f4);};}exports['index']=function(_0x50dce2,_0x4b3eb5){var _0x3ecf3e={},_0x1860ce={},_0xc68815={'count':0x0,'rows':[]};var _0x263e1d=_[_0x7513('0x2d')](db[_0x7513('0x2e')]['rawAttributes'],function(_0x929531){return{'name':_0x929531['fieldName'],'type':_0x929531[_0x7513('0x2f')]['key']};});_0x1860ce[_0x7513('0x30')]=_[_0x7513('0x2d')](_0x263e1d,_0x7513('0x2c'));_0x1860ce[_0x7513('0x31')]=_[_0x7513('0x32')](_0x50dce2[_0x7513('0x31')]);_0x1860ce['filters']=_['intersection'](_0x1860ce[_0x7513('0x30')],_0x1860ce[_0x7513('0x31')]);_0x3ecf3e[_0x7513('0x33')]=_[_0x7513('0x34')](_0x1860ce['model'],qs[_0x7513('0x35')](_0x50dce2['query'][_0x7513('0x35')]));_0x3ecf3e[_0x7513('0x33')]=_0x3ecf3e[_0x7513('0x33')][_0x7513('0x36')]?_0x3ecf3e[_0x7513('0x33')]:_0x1860ce[_0x7513('0x30')];if(!_0x50dce2[_0x7513('0x31')][_0x7513('0x37')](_0x7513('0x38'))){_0x3ecf3e[_0x7513('0x1f')]=qs[_0x7513('0x1f')](_0x50dce2[_0x7513('0x31')][_0x7513('0x1f')]);_0x3ecf3e[_0x7513('0x21')]=qs[_0x7513('0x21')](_0x50dce2[_0x7513('0x31')][_0x7513('0x21')]);}_0x3ecf3e[_0x7513('0x39')]=qs['sort'](_0x50dce2[_0x7513('0x31')][_0x7513('0x3a')]);_0x3ecf3e[_0x7513('0x3b')]=qs[_0x7513('0x3c')](_[_0x7513('0x3d')](_0x50dce2['query'],_0x1860ce[_0x7513('0x3c')]),_0x263e1d);if(_0x50dce2[_0x7513('0x31')][_0x7513('0x3e')]){_0x3ecf3e[_0x7513('0x3b')]=_[_0x7513('0x3f')](_0x3ecf3e['where'],{'$or':_[_0x7513('0x2d')](_0x263e1d,function(_0xbc0514){if(_0xbc0514[_0x7513('0x2f')]!==_0x7513('0x40')){var _0x125c0d={};_0x125c0d[_0xbc0514['name']]={'$like':'%'+_0x50dce2[_0x7513('0x31')]['filter']+'%'};return _0x125c0d;}})});}_0x3ecf3e=_[_0x7513('0x3f')]({},_0x3ecf3e,_0x50dce2[_0x7513('0x41')]);var _0x2438e6={'where':_0x3ecf3e[_0x7513('0x3b')]};return db['MailQueue'][_0x7513('0x20')](_0x2438e6)[_0x7513('0x28')](function(_0x1517b5){_0xc68815['count']=_0x1517b5;if(_0x50dce2[_0x7513('0x31')][_0x7513('0x42')]){_0x3ecf3e[_0x7513('0x43')]=[{'all':!![]}];}return db['MailQueue'][_0x7513('0x44')](_0x3ecf3e);})[_0x7513('0x28')](function(_0x12ed9f){_0xc68815[_0x7513('0x45')]=_0x12ed9f;return _0xc68815;})[_0x7513('0x28')](respondWithFilteredResult(_0x4b3eb5,_0x3ecf3e))[_0x7513('0x46')](handleError(_0x4b3eb5,null));};exports[_0x7513('0x47')]=function(_0xe582f0,_0x2ccc3b){var _0x13c58b={'raw':!![],'where':{'id':_0xe582f0[_0x7513('0x48')]['id']}},_0x26f425={};_0x26f425['model']=_[_0x7513('0x32')](db[_0x7513('0x2e')][_0x7513('0x49')]);_0x26f425[_0x7513('0x31')]=_[_0x7513('0x32')](_0xe582f0[_0x7513('0x31')]);_0x26f425[_0x7513('0x3c')]=_[_0x7513('0x34')](_0x26f425['model'],_0x26f425[_0x7513('0x31')]);_0x13c58b[_0x7513('0x33')]=_[_0x7513('0x34')](_0x26f425[_0x7513('0x30')],qs[_0x7513('0x35')](_0xe582f0['query'][_0x7513('0x35')]));_0x13c58b[_0x7513('0x33')]=_0x13c58b[_0x7513('0x33')][_0x7513('0x36')]?_0x13c58b['attributes']:_0x26f425[_0x7513('0x30')];if(_0xe582f0[_0x7513('0x31')][_0x7513('0x42')]){_0x13c58b['include']=[{'all':!![]}];}_0x13c58b=_[_0x7513('0x3f')]({},_0x13c58b,_0xe582f0[_0x7513('0x41')]);return db['MailQueue'][_0x7513('0x4a')](_0x13c58b)[_0x7513('0x28')](handleEntityNotFound(_0x2ccc3b,null))[_0x7513('0x28')](respondWithResult(_0x2ccc3b,null))['catch'](handleError(_0x2ccc3b,null));};exports[_0x7513('0x4b')]=function(_0xaf1d9c,_0x10e2f1){return db['MailQueue']['create'](_0xaf1d9c[_0x7513('0x4c')],{})[_0x7513('0x28')](function(_0x1117b6){var _0x1b3ae3=_0xaf1d9c['user'][_0x7513('0x4d')]({'plain':!![]});if(!_0x1b3ae3)throw new Error(_0x7513('0x4e'));if(_0x1b3ae3['role']===_0x7513('0x4f')){var _0x1e82d3=_0x1117b6[_0x7513('0x4d')]({'plain':!![]});var _0xd66c63='MailQueues';return db[_0x7513('0x50')][_0x7513('0x4a')]({'where':{'name':_0xd66c63,'userProfileId':_0x1b3ae3[_0x7513('0x51')]},'raw':!![]})[_0x7513('0x28')](function(_0x14aa51){if(_0x14aa51&&_0x14aa51[_0x7513('0x52')]===0x0){return db[_0x7513('0x2a')][_0x7513('0x4b')]({'name':_0x1e82d3['name'],'resourceId':_0x1e82d3['id'],'type':_0x14aa51['name'],'sectionId':_0x14aa51['id']},{})['then'](function(){return _0x1117b6;});}else{return _0x1117b6;}})[_0x7513('0x46')](function(_0x271846){logger[_0x7513('0x53')](_0x7513('0x54'),_0x271846);throw _0x271846;});}return _0x1117b6;})[_0x7513('0x28')](respondWithResult(_0x10e2f1,0xc9))[_0x7513('0x46')](handleError(_0x10e2f1,null));};exports[_0x7513('0x26')]=function(_0x27be7b,_0x26d4df){if(_0x27be7b[_0x7513('0x4c')]['id']){delete _0x27be7b['body']['id'];}return db['MailQueue'][_0x7513('0x4a')]({'where':{'id':_0x27be7b[_0x7513('0x48')]['id']}})[_0x7513('0x28')](handleEntityNotFound(_0x26d4df,null))['then'](saveUpdates(_0x27be7b[_0x7513('0x4c')],null))[_0x7513('0x28')](respondWithResult(_0x26d4df,null))['catch'](handleError(_0x26d4df,null));};exports[_0x7513('0x27')]=function(_0x32d76d,_0x31c126){return db['MailQueue'][_0x7513('0x4a')]({'where':{'id':_0x32d76d['params']['id']}})[_0x7513('0x28')](handleEntityNotFound(_0x31c126,null))['then'](removeEntity(_0x31c126,null))[_0x7513('0x46')](handleError(_0x31c126,null));};exports[_0x7513('0x55')]=function(_0x56118a,_0x1c9bf9){return db[_0x7513('0x2e')][_0x7513('0x55')]()[_0x7513('0x28')](respondWithResult(_0x1c9bf9,null))[_0x7513('0x46')](handleError(_0x1c9bf9,null));};exports[_0x7513('0x56')]=function(_0x30465b,_0x1f5b72,_0x2f1776){var _0x469a93={'raw':!![],'where':{}},_0x164896={},_0x4a5209;return db[_0x7513('0x2e')][_0x7513('0x57')]({'where':{'id':_0x30465b[_0x7513('0x48')]['id']}})[_0x7513('0x28')](handleEntityNotFound(_0x1f5b72,null))[_0x7513('0x28')](function(_0x5909e6){if(_0x5909e6){_0x4a5209=_0x5909e6[_0x7513('0x4d')]({'plain':!![]});_0x164896[_0x7513('0x30')]=_[_0x7513('0x32')](db[_0x7513('0x58')][_0x7513('0x49')]);_0x164896[_0x7513('0x31')]=_[_0x7513('0x32')](_0x30465b['query']);_0x164896[_0x7513('0x3c')]=_[_0x7513('0x34')](_0x164896[_0x7513('0x30')],_0x164896['query']);_0x469a93[_0x7513('0x33')]=_['intersection'](_0x164896['model'],qs[_0x7513('0x35')](_0x30465b['query']['fields']));_0x469a93[_0x7513('0x33')]=_0x469a93['attributes'][_0x7513('0x36')]?_0x469a93[_0x7513('0x33')]:_0x164896[_0x7513('0x30')];if(!_0x30465b[_0x7513('0x31')][_0x7513('0x37')]('nolimit')){_0x469a93[_0x7513('0x1f')]=qs[_0x7513('0x1f')](_0x30465b[_0x7513('0x31')][_0x7513('0x1f')]);_0x469a93['offset']=qs[_0x7513('0x21')](_0x30465b['query']['offset']);}_0x469a93[_0x7513('0x39')]=qs[_0x7513('0x3a')](_0x30465b[_0x7513('0x31')][_0x7513('0x3a')]);_0x469a93['where']=qs[_0x7513('0x3c')](_[_0x7513('0x3d')](_0x30465b[_0x7513('0x31')],_0x164896['filters']));_0x469a93['where']['MailQueueId']=_0x5909e6['id'];if(_0x30465b['query'][_0x7513('0x3e')]){_0x469a93['where']=_['merge'](_0x469a93['where'],{'$or':_[_0x7513('0x2d')](_0x469a93[_0x7513('0x33')],function(_0x3a9ba8){var _0x3e0193={};_0x3e0193[_0x3a9ba8]={'$like':'%'+_0x30465b[_0x7513('0x31')][_0x7513('0x3e')]+'%'};return _0x3e0193;})});}_0x469a93=_[_0x7513('0x3f')]({},_0x469a93,_0x30465b['options']);return db[_0x7513('0x58')][_0x7513('0x44')](_0x469a93);}})[_0x7513('0x28')](function(_0x343047){if(_0x343047){return db[_0x7513('0x59')][_0x7513('0x5a')]({'where':{'id':_['map'](_0x343047,_0x7513('0x5b')),'role':_0x7513('0x5c')},'attributes':['id',_0x7513('0x2c'),_0x7513('0x5d'),'updatedAt',_0x7513('0x5e')]});}})['then'](function(_0x31c22d){if(_0x31c22d){return{'count':_0x31c22d['count'],'rows':_['map'](_0x31c22d[_0x7513('0x45')],function(_0x30d796){return{'membername':_0x30d796[_0x7513('0x2c')],'UserId':_0x30d796['id'],'queue_name':_0x4a5209[_0x7513('0x2c')],'MailQueueId':_0x4a5209['id'],'interface':util[_0x7513('0x5f')](_0x7513('0x60'),_0x7513('0x61'),_0x30d796[_0x7513('0x2c')]),'penalty':0x0,'paused':_0x30d796[_0x7513('0x5d')],'createdAt':_0x30d796['createdAt'],'updatedAt':_0x30d796[_0x7513('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1f5b72,_0x469a93))[_0x7513('0x46')](handleError(_0x1f5b72,null));};exports[_0x7513('0x63')]=function(_0x1cd90c,_0xc8d961,_0x2225d2){var _0x5857d1={};var _0x3ddee9={};var _0x4fff42;var _0x56747a;return db[_0x7513('0x2e')][_0x7513('0x57')]({'where':{'id':_0x1cd90c[_0x7513('0x48')]['id']}})['then'](handleEntityNotFound(_0xc8d961,null))[_0x7513('0x28')](function(_0x498708){if(_0x498708){_0x4fff42=_0x498708;_0x3ddee9[_0x7513('0x30')]=_['keys'](db[_0x7513('0x64')]['rawAttributes']);_0x3ddee9[_0x7513('0x31')]=_['keys'](_0x1cd90c[_0x7513('0x31')]);_0x3ddee9[_0x7513('0x3c')]=_[_0x7513('0x34')](_0x3ddee9['model'],_0x3ddee9[_0x7513('0x31')]);_0x5857d1[_0x7513('0x33')]=_[_0x7513('0x34')](_0x3ddee9[_0x7513('0x30')],qs['fields'](_0x1cd90c[_0x7513('0x31')][_0x7513('0x35')]));_0x5857d1[_0x7513('0x33')]=_0x5857d1[_0x7513('0x33')][_0x7513('0x36')]?_0x5857d1[_0x7513('0x33')]:_0x3ddee9['model'];_0x5857d1['order']=qs[_0x7513('0x3a')](_0x1cd90c['query'][_0x7513('0x3a')]);_0x5857d1['where']=qs[_0x7513('0x3c')](_[_0x7513('0x3d')](_0x1cd90c[_0x7513('0x31')],_0x3ddee9['filters']));if(_0x1cd90c['query'][_0x7513('0x3e')]){_0x5857d1[_0x7513('0x3b')]=_['merge'](_0x5857d1['where'],{'$or':_[_0x7513('0x2d')](_0x5857d1[_0x7513('0x33')],function(_0x1bcb95){var _0x11a2e9={};_0x11a2e9[_0x1bcb95]={'$like':'%'+_0x1cd90c[_0x7513('0x31')]['filter']+'%'};return _0x11a2e9;})});}_0x5857d1=_['merge']({},_0x5857d1,_0x1cd90c[_0x7513('0x41')]);return _0x4fff42['getTeams'](_0x5857d1);}})['then'](function(_0x15d67b){if(_0x15d67b){_0x56747a=_0x15d67b[_0x7513('0x36')];if(!_0x1cd90c[_0x7513('0x31')][_0x7513('0x37')](_0x7513('0x38'))){_0x5857d1['limit']=qs['limit'](_0x1cd90c[_0x7513('0x31')][_0x7513('0x1f')]);_0x5857d1[_0x7513('0x21')]=qs[_0x7513('0x21')](_0x1cd90c['query'][_0x7513('0x21')]);}return _0x4fff42['getTeams'](_0x5857d1);}})['then'](function(_0x48cc71){if(_0x48cc71){return _0x48cc71?{'count':_0x56747a,'rows':_0x48cc71}:null;}})[_0x7513('0x28')](respondWithResult(_0xc8d961,null))[_0x7513('0x46')](handleError(_0xc8d961,null));};exports[_0x7513('0x65')]=function(_0x7e9321,_0xa8274b,_0x38c370){var _0x38ccde=_0x7e9321[_0x7513('0x4c')][_0x7513('0x66')];return db[_0x7513('0x64')][_0x7513('0x44')]({'where':{'id':_0x38ccde},'attributes':['id'],'include':[{'model':db[_0x7513('0x59')],'as':_0x7513('0x67'),'attributes':['id','name',_0x7513('0x68'),'voicePause',_0x7513('0x69')],'raw':!![]}]})[_0x7513('0x28')](function(_0x4105a7){if(_0x4105a7){var _0x5b723e=_['flatMap'](_0x4105a7,function(_0x23d35a){var _0x1bdb77=_0x23d35a[_0x7513('0x4d')]({'plain':!![]});return _0x1bdb77[_0x7513('0x67')];});return db['MailQueue'][_0x7513('0x4a')]({'where':{'id':_0x7e9321[_0x7513('0x48')]['id']}})[_0x7513('0x28')](function(_0x40f7a1){return db['sequelize'][_0x7513('0x6a')](function(_0x2af668){return _0x40f7a1[_0x7513('0x65')](_0x38ccde,{'transaction':_0x2af668})[_0x7513('0x28')](function(){return BPromise['each'](_0x5b723e,function(_0x54494c){return db[_0x7513('0x58')][_0x7513('0x6b')]({'where':{'UserId':_0x54494c['id'],'MailQueueId':_0x7e9321[_0x7513('0x48')]['id']},'transaction':_0x2af668});});})[_0x7513('0x28')](function(){_0x5b723e[_0x7513('0x6c')](function(_0xa9ad62){socket['emit'](_0x7513('0x6d'),{'UserId':_0xa9ad62['id'],'MailQueueId':_0x40f7a1['id']});});});});});}})['then'](respondWithStatusCode(_0xa8274b,null))[_0x7513('0x46')](handleError(_0xa8274b,null));};exports['removeTeams']=function(_0x115f9e,_0x33bf65,_0x2cfb04){return db[_0x7513('0x64')][_0x7513('0x44')]({'where':{'id':_0x115f9e[_0x7513('0x31')][_0x7513('0x66')]},'attributes':['id'],'include':[{'model':db[_0x7513('0x59')],'as':_0x7513('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7513('0x28')](handleEntityNotFound(_0x33bf65,null))[_0x7513('0x28')](function(_0x2b1110){var _0x56aaef=_[_0x7513('0x2d')](_0x2b1110,'id');var _0x2eac93=[];var _0x57be3d=[];var _0x2b7bc8=squel[_0x7513('0x6e')]();_0x2b7bc8[_0x7513('0x6f')](_0x7513('0x70'))[_0x7513('0x71')](_0x7513('0x72'),'tq')['join'](_0x7513('0x73'),'ut',_0x7513('0x74'))[_0x7513('0x3b')](_0x7513('0x75'),_0x115f9e[_0x7513('0x48')]['id']);for(var _0x446b6e=0x0;_0x446b6e<_0x2b1110[_0x7513('0x36')];_0x446b6e+=0x1){let _0x425304=_0x2b1110[_0x446b6e];for(var _0x29bd44=0x0;_0x29bd44<_0x425304[_0x7513('0x67')]['length'];_0x29bd44+=0x1){let _0x390dea=_0x425304[_0x7513('0x67')][_0x29bd44];var _0x269f93=_0x2b7bc8[_0x7513('0x76')]();_0x269f93['where'](_0x7513('0x77'),_0x390dea['id']);_0x57be3d[_0x7513('0x78')](db[_0x7513('0x79')]['query'](_0x269f93[_0x7513('0x7a')](),{'type':db[_0x7513('0x79')][_0x7513('0x7b')][_0x7513('0x7c')]})[_0x7513('0x28')](function(_0x18ea0a){if(_0x18ea0a[_0x7513('0x36')]===0x1){return _0x390dea['id'];}else{var _0x4866f8=_[_0x7513('0x7d')](_[_0x7513('0x2d')](_0x18ea0a,_0x7513('0x7e')),function(_0x13eafa){return _['includes'](_0x56aaef,_0x13eafa);});if(_0x4866f8){return _0x390dea['id'];}}}));}}return BPromise[_0x7513('0x7f')](_0x57be3d)[_0x7513('0x28')](function(_0x448891){_0x2eac93=_(_0x2eac93)[_0x7513('0x80')](_0x448891)['compact']()[_0x7513('0x81')]();return db[_0x7513('0x2e')]['find']({'where':{'id':_0x115f9e['params']['id']}})[_0x7513('0x28')](function(_0x313b63){return db['sequelize'][_0x7513('0x6a')](function(_0x224578){return _0x313b63[_0x7513('0x82')](_0x115f9e['query']['ids'],{'transaction':_0x224578})[_0x7513('0x28')](function(){if(!_[_0x7513('0x83')](_0x2eac93)){return _0x313b63['removeAgents'](_0x2eac93,{'transaction':_0x224578});}})[_0x7513('0x28')](function(){_0x2eac93[_0x7513('0x6c')](function(_0x336fb2){socket[_0x7513('0x84')](_0x7513('0x85'),{'UserId':_0x336fb2,'MailQueueId':_0x313b63['id']});});});});});});})[_0x7513('0x28')](respondWithStatusCode(_0x33bf65,null))[_0x7513('0x46')](handleError(_0x33bf65,null));};exports['addAgents']=function(_0x4c7ac9,_0x4f410,_0x33f5ae){return db['MailQueue'][_0x7513('0x4a')]({'where':{'id':_0x4c7ac9[_0x7513('0x48')]['id']}})[_0x7513('0x28')](handleEntityNotFound(_0x4f410,null))[_0x7513('0x28')](function(_0x442b03){if(_0x442b03){return _0x442b03[_0x7513('0x86')](_0x4c7ac9[_0x7513('0x4c')][_0x7513('0x66')],_[_0x7513('0x87')](_0x4c7ac9['body'],[_0x7513('0x66'),'id'])||{})[_0x7513('0x88')](function(_0x21288c){for(var _0x407155=0x0;_0x407155<_0x4c7ac9[_0x7513('0x4c')][_0x7513('0x66')]['length'];_0x407155+=0x1){socket[_0x7513('0x84')]('userMailQueue:save',{'UserId':Number(_0x4c7ac9[_0x7513('0x4c')][_0x7513('0x66')][_0x407155]),'MailQueueId':Number(_0x4c7ac9['params']['id'])});}return _0x21288c;});}})['then'](respondWithResult(_0x4f410,null))[_0x7513('0x46')](handleError(_0x4f410,null));};exports[_0x7513('0x89')]=function(_0x28daf7,_0x2fa02c,_0x1bf399){return db[_0x7513('0x2e')][_0x7513('0x4a')]({'where':{'id':_0x28daf7[_0x7513('0x48')]['id']}})[_0x7513('0x28')](handleEntityNotFound(_0x2fa02c,null))[_0x7513('0x28')](function(_0xfa4941){if(_0xfa4941){return _0xfa4941[_0x7513('0x89')](_0x28daf7['query'][_0x7513('0x66')])[_0x7513('0x28')](function(){if(_[_0x7513('0x8a')](_0x28daf7['query'][_0x7513('0x66')])){for(var _0x308157=0x0;_0x308157<_0x28daf7['query'][_0x7513('0x66')]['length'];_0x308157+=0x1){socket[_0x7513('0x84')](_0x7513('0x85'),{'UserId':Number(_0x28daf7[_0x7513('0x31')][_0x7513('0x66')][_0x308157]),'MailQueueId':Number(_0x28daf7[_0x7513('0x48')]['id'])});}}else{socket['emit'](_0x7513('0x85'),{'UserId':Number(_0x28daf7[_0x7513('0x31')][_0x7513('0x66')]),'MailQueueId':Number(_0x28daf7[_0x7513('0x48')]['id'])});}});}})[_0x7513('0x28')](respondWithStatusCode(_0x2fa02c,null))[_0x7513('0x46')](handleError(_0x2fa02c,null));};exports['getAgents']=function(_0x16a358,_0x54be6b,_0x8ccc2d){var _0x4f1f03={};var _0x23c296={};var _0x57118e;var _0x18a53c;return db[_0x7513('0x2e')][_0x7513('0x57')]({'where':{'id':_0x16a358[_0x7513('0x48')]['id']}})[_0x7513('0x28')](handleEntityNotFound(_0x54be6b,null))[_0x7513('0x28')](function(_0x560e40){if(_0x560e40){_0x57118e=_0x560e40;_0x23c296['model']=_['keys'](db[_0x7513('0x59')]['rawAttributes']);_0x23c296[_0x7513('0x31')]=_['keys'](_0x16a358['query']);_0x23c296[_0x7513('0x3c')]=_['intersection'](_0x23c296['model'],_0x23c296[_0x7513('0x31')]);_0x4f1f03['attributes']=_[_0x7513('0x34')](_0x23c296[_0x7513('0x30')],qs[_0x7513('0x35')](_0x16a358[_0x7513('0x31')][_0x7513('0x35')]));_0x4f1f03[_0x7513('0x33')]=_0x4f1f03['attributes'][_0x7513('0x36')]?_0x4f1f03[_0x7513('0x33')]:_0x23c296[_0x7513('0x30')];_0x4f1f03['order']=qs[_0x7513('0x3a')](_0x16a358[_0x7513('0x31')]['sort']);_0x4f1f03[_0x7513('0x3b')]=qs['filters'](_[_0x7513('0x3d')](_0x16a358['query'],_0x23c296[_0x7513('0x3c')]));if(_0x16a358[_0x7513('0x31')][_0x7513('0x3e')]){_0x4f1f03[_0x7513('0x3b')]=_[_0x7513('0x3f')](_0x4f1f03[_0x7513('0x3b')],{'$or':_[_0x7513('0x2d')](_0x4f1f03[_0x7513('0x33')],function(_0x5477aa){var _0x1b1eb6={};_0x1b1eb6[_0x5477aa]={'$like':'%'+_0x16a358['query'][_0x7513('0x3e')]+'%'};return _0x1b1eb6;})});}_0x4f1f03=_['merge']({},_0x4f1f03,_0x16a358[_0x7513('0x41')]);return _0x57118e[_0x7513('0x8b')](_0x4f1f03);}})[_0x7513('0x28')](function(_0x302c08){if(_0x302c08){_0x18a53c=_0x302c08['length'];if(!_0x16a358[_0x7513('0x31')][_0x7513('0x37')]('nolimit')){_0x4f1f03['limit']=qs[_0x7513('0x1f')](_0x16a358['query'][_0x7513('0x1f')]);_0x4f1f03[_0x7513('0x21')]=qs['offset'](_0x16a358[_0x7513('0x31')][_0x7513('0x21')]);}return _0x57118e[_0x7513('0x8b')](_0x4f1f03);}})[_0x7513('0x28')](function(_0xad7a68){if(_0xad7a68){return _0xad7a68?{'count':_0x18a53c,'rows':_0xad7a68}:null;}})[_0x7513('0x28')](respondWithResult(_0x54be6b,null))[_0x7513('0x46')](handleError(_0x54be6b,null));}; \ No newline at end of file +var _0x1d57=['toString','QueryTypes','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','userMailQueue:remove','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','get','MailQueues','destroy','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','mailPause','createdAt','SIP','updatedAt','Team','getTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push'];(function(_0x21b9a2,_0x3289dd){var _0x27ef05=function(_0x1a28ff){while(--_0x1a28ff){_0x21b9a2['push'](_0x21b9a2['shift']());}};_0x27ef05(++_0x3289dd);}(_0x1d57,0x123));var _0x71d5=function(_0x389a61,_0x20216c){_0x389a61=_0x389a61-0x0;var _0x1acde9=_0x1d57[_0x389a61];return _0x1acde9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71d5('0x0'));var zipdir=require(_0x71d5('0x1'));var jsonpatch=require(_0x71d5('0x2'));var rp=require('request-promise');var moment=require(_0x71d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x71d5('0x4'));var util=require(_0x71d5('0x5'));var path=require(_0x71d5('0x6'));var sox=require(_0x71d5('0x7'));var csv=require(_0x71d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71d5('0x9'));var _=require(_0x71d5('0xa'));var squel=require('squel');var crypto=require(_0x71d5('0xb'));var jsforce=require(_0x71d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x71d5('0x8'));var querystring=require(_0x71d5('0xd'));var Papa=require(_0x71d5('0xe'));var Redis=require(_0x71d5('0xf'));var authService=require(_0x71d5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x71d5('0x11'));var hardwareService=require(_0x71d5('0x12'));var logger=require(_0x71d5('0x13'))(_0x71d5('0x14'));var utils=require(_0x71d5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x71d5('0x16'));var db=require(_0x71d5('0x17'))['db'];config[_0x71d5('0x18')]=_[_0x71d5('0x19')](config[_0x71d5('0x18')],{'host':_0x71d5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x71d5('0x1b'))[_0x71d5('0x1c')](socket);function respondWithStatusCode(_0x178b3b,_0x3a5b83){_0x3a5b83=_0x3a5b83||0xcc;return function(_0x39d16a){if(_0x39d16a){return _0x178b3b[_0x71d5('0x1d')](_0x3a5b83);}return _0x178b3b[_0x71d5('0x1e')](_0x3a5b83)[_0x71d5('0x1f')]();};}function respondWithResult(_0x384ff3,_0x18dcd0){_0x18dcd0=_0x18dcd0||0xc8;return function(_0x22e4f1){if(_0x22e4f1){return _0x384ff3[_0x71d5('0x1e')](_0x18dcd0)['json'](_0x22e4f1);}};}function respondWithFilteredResult(_0xc9a36b,_0x2f9896){return function(_0x4333c1){if(_0x4333c1){var _0x4ca64f=typeof _0x2f9896['offset']===_0x71d5('0x20')&&typeof _0x2f9896[_0x71d5('0x21')]==='undefined';var _0x37bc54=_0x4333c1['count'];var _0x5e4bc5=_0x4ca64f?0x0:_0x2f9896[_0x71d5('0x22')];var _0x37e5c7=_0x4ca64f?_0x4333c1[_0x71d5('0x23')]:_0x2f9896[_0x71d5('0x22')]+_0x2f9896[_0x71d5('0x21')];var _0x423277;if(_0x37e5c7>=_0x37bc54){_0x37e5c7=_0x37bc54;_0x423277=0xc8;}else{_0x423277=0xce;}_0xc9a36b[_0x71d5('0x1e')](_0x423277);return _0xc9a36b[_0x71d5('0x24')](_0x71d5('0x25'),_0x5e4bc5+'-'+_0x37e5c7+'/'+_0x37bc54)[_0x71d5('0x26')](_0x4333c1);}return null;};}function patchUpdates(_0x41f1c3){return function(_0x448482){try{jsonpatch[_0x71d5('0x27')](_0x448482,_0x41f1c3,!![]);}catch(_0x31d2be){return BPromise[_0x71d5('0x28')](_0x31d2be);}return _0x448482[_0x71d5('0x29')]();};}function saveUpdates(_0x26aacf,_0x311a30){return function(_0x475b1a){if(_0x475b1a){return _0x475b1a[_0x71d5('0x2a')](_0x26aacf)['then'](function(_0x199997){return _0x199997;});}return null;};}function removeEntity(_0x49d636,_0x399502){return function(_0x46c363){if(_0x46c363){return _0x46c363['destroy']()[_0x71d5('0x2b')](function(){var _0x3200e8=_0x46c363[_0x71d5('0x2c')]({'plain':!![]});var _0x5ed7fb=_0x71d5('0x2d');return db['UserProfileResource'][_0x71d5('0x2e')]({'where':{'type':_0x5ed7fb,'resourceId':_0x3200e8['id']}})[_0x71d5('0x2b')](function(){return _0x46c363;});})['then'](function(){_0x49d636[_0x71d5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x388fd7,_0x49399f){return function(_0x31e51f){if(!_0x31e51f){_0x388fd7[_0x71d5('0x1d')](0x194);}return _0x31e51f;};}function handleError(_0x468ed6,_0x457339){_0x457339=_0x457339||0x1f4;return function(_0x4cc40d){logger[_0x71d5('0x2f')](_0x4cc40d[_0x71d5('0x30')]);if(_0x4cc40d[_0x71d5('0x31')]){delete _0x4cc40d[_0x71d5('0x31')];}_0x468ed6[_0x71d5('0x1e')](_0x457339)['send'](_0x4cc40d);};}exports[_0x71d5('0x32')]=function(_0x68ada3,_0x66e8fe){var _0x3097bf={},_0x1933ce={},_0x5f13dc={'count':0x0,'rows':[]};var _0x588c3f=_[_0x71d5('0x33')](db[_0x71d5('0x34')][_0x71d5('0x35')],function(_0x59081e){return{'name':_0x59081e[_0x71d5('0x36')],'type':_0x59081e[_0x71d5('0x37')][_0x71d5('0x38')]};});_0x1933ce[_0x71d5('0x39')]=_[_0x71d5('0x33')](_0x588c3f,'name');_0x1933ce[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x68ada3[_0x71d5('0x3a')]);_0x1933ce[_0x71d5('0x3c')]=_[_0x71d5('0x3d')](_0x1933ce['model'],_0x1933ce[_0x71d5('0x3a')]);_0x3097bf[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x1933ce[_0x71d5('0x39')],qs['fields'](_0x68ada3[_0x71d5('0x3a')]['fields']));_0x3097bf[_0x71d5('0x3e')]=_0x3097bf[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x3097bf[_0x71d5('0x3e')]:_0x1933ce['model'];if(!_0x68ada3[_0x71d5('0x3a')][_0x71d5('0x40')](_0x71d5('0x41'))){_0x3097bf[_0x71d5('0x21')]=qs[_0x71d5('0x21')](_0x68ada3[_0x71d5('0x3a')]['limit']);_0x3097bf[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x68ada3[_0x71d5('0x3a')][_0x71d5('0x22')]);}_0x3097bf[_0x71d5('0x42')]=qs[_0x71d5('0x43')](_0x68ada3['query'][_0x71d5('0x43')]);_0x3097bf['where']=qs[_0x71d5('0x3c')](_[_0x71d5('0x44')](_0x68ada3[_0x71d5('0x3a')],_0x1933ce['filters']),_0x588c3f);if(_0x68ada3[_0x71d5('0x3a')][_0x71d5('0x45')]){_0x3097bf[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0x3097bf[_0x71d5('0x46')],{'$or':_[_0x71d5('0x33')](_0x588c3f,function(_0x21571d){if(_0x21571d[_0x71d5('0x37')]!=='VIRTUAL'){var _0x208cc8={};_0x208cc8[_0x21571d[_0x71d5('0x31')]]={'$like':'%'+_0x68ada3['query'][_0x71d5('0x45')]+'%'};return _0x208cc8;}})});}_0x3097bf=_[_0x71d5('0x47')]({},_0x3097bf,_0x68ada3[_0x71d5('0x48')]);var _0x49b34c={'where':_0x3097bf[_0x71d5('0x46')]};return db[_0x71d5('0x34')]['count'](_0x49b34c)[_0x71d5('0x2b')](function(_0x12facc){_0x5f13dc[_0x71d5('0x23')]=_0x12facc;if(_0x68ada3['query'][_0x71d5('0x49')]){_0x3097bf[_0x71d5('0x4a')]=[{'all':!![]}];}return db[_0x71d5('0x34')][_0x71d5('0x4b')](_0x3097bf);})[_0x71d5('0x2b')](function(_0x54900d){_0x5f13dc[_0x71d5('0x4c')]=_0x54900d;return _0x5f13dc;})[_0x71d5('0x2b')](respondWithFilteredResult(_0x66e8fe,_0x3097bf))[_0x71d5('0x4d')](handleError(_0x66e8fe,null));};exports[_0x71d5('0x4e')]=function(_0x51dede,_0x1ed14a){var _0x3289f6={'raw':!![],'where':{'id':_0x51dede['params']['id']}},_0x3225f8={};_0x3225f8[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x34')][_0x71d5('0x35')]);_0x3225f8[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x51dede[_0x71d5('0x3a')]);_0x3225f8[_0x71d5('0x3c')]=_['intersection'](_0x3225f8[_0x71d5('0x39')],_0x3225f8['query']);_0x3289f6[_0x71d5('0x3e')]=_['intersection'](_0x3225f8[_0x71d5('0x39')],qs['fields'](_0x51dede['query'][_0x71d5('0x4f')]));_0x3289f6[_0x71d5('0x3e')]=_0x3289f6[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x3289f6[_0x71d5('0x3e')]:_0x3225f8[_0x71d5('0x39')];if(_0x51dede[_0x71d5('0x3a')][_0x71d5('0x49')]){_0x3289f6[_0x71d5('0x4a')]=[{'all':!![]}];}_0x3289f6=_['merge']({},_0x3289f6,_0x51dede[_0x71d5('0x48')]);return db[_0x71d5('0x34')][_0x71d5('0x50')](_0x3289f6)[_0x71d5('0x2b')](handleEntityNotFound(_0x1ed14a,null))[_0x71d5('0x2b')](respondWithResult(_0x1ed14a,null))['catch'](handleError(_0x1ed14a,null));};exports[_0x71d5('0x51')]=function(_0x1cfa0a,_0x573624){return db[_0x71d5('0x34')][_0x71d5('0x51')](_0x1cfa0a['body'],{})[_0x71d5('0x2b')](function(_0x59fd22){var _0x34ce15=_0x1cfa0a[_0x71d5('0x52')][_0x71d5('0x2c')]({'plain':!![]});if(!_0x34ce15)throw new Error(_0x71d5('0x53'));if(_0x34ce15['role']===_0x71d5('0x52')){var _0x510b32=_0x59fd22[_0x71d5('0x2c')]({'plain':!![]});var _0x484a57='MailQueues';return db['UserProfileSection'][_0x71d5('0x50')]({'where':{'name':_0x484a57,'userProfileId':_0x34ce15[_0x71d5('0x54')]},'raw':!![]})[_0x71d5('0x2b')](function(_0x1e03d5){if(_0x1e03d5&&_0x1e03d5[_0x71d5('0x55')]===0x0){return db[_0x71d5('0x56')][_0x71d5('0x51')]({'name':_0x510b32['name'],'resourceId':_0x510b32['id'],'type':_0x1e03d5[_0x71d5('0x31')],'sectionId':_0x1e03d5['id']},{})['then'](function(){return _0x59fd22;});}else{return _0x59fd22;}})[_0x71d5('0x4d')](function(_0x45a5ac){logger[_0x71d5('0x2f')](_0x71d5('0x57'),_0x45a5ac);throw _0x45a5ac;});}return _0x59fd22;})[_0x71d5('0x2b')](respondWithResult(_0x573624,0xc9))['catch'](handleError(_0x573624,null));};exports[_0x71d5('0x2a')]=function(_0x16bac2,_0x3a8460){if(_0x16bac2[_0x71d5('0x58')]['id']){delete _0x16bac2[_0x71d5('0x58')]['id'];}return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x16bac2[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x3a8460,null))[_0x71d5('0x2b')](saveUpdates(_0x16bac2[_0x71d5('0x58')],null))['then'](respondWithResult(_0x3a8460,null))[_0x71d5('0x4d')](handleError(_0x3a8460,null));};exports[_0x71d5('0x2e')]=function(_0x285aa1,_0x59cd4a){return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x285aa1[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x59cd4a,null))[_0x71d5('0x2b')](removeEntity(_0x59cd4a,null))['catch'](handleError(_0x59cd4a,null));};exports[_0x71d5('0x5a')]=function(_0x4350ea,_0x61885d){return db[_0x71d5('0x34')][_0x71d5('0x5a')]()['then'](respondWithResult(_0x61885d,null))['catch'](handleError(_0x61885d,null));};exports['getMembers']=function(_0x5c9b77,_0x597aaf,_0x5af848){var _0x26011f={'raw':!![],'where':{}},_0x5cbe0f={},_0x1e63fe;return db[_0x71d5('0x34')][_0x71d5('0x5b')]({'where':{'id':_0x5c9b77['params']['id']}})['then'](handleEntityNotFound(_0x597aaf,null))[_0x71d5('0x2b')](function(_0x4108b0){if(_0x4108b0){_0x1e63fe=_0x4108b0[_0x71d5('0x2c')]({'plain':!![]});_0x5cbe0f[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x5c')]['rawAttributes']);_0x5cbe0f[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x5c9b77['query']);_0x5cbe0f[_0x71d5('0x3c')]=_['intersection'](_0x5cbe0f[_0x71d5('0x39')],_0x5cbe0f[_0x71d5('0x3a')]);_0x26011f[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x5cbe0f[_0x71d5('0x39')],qs[_0x71d5('0x4f')](_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x4f')]));_0x26011f[_0x71d5('0x3e')]=_0x26011f[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x26011f[_0x71d5('0x3e')]:_0x5cbe0f[_0x71d5('0x39')];if(!_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x40')](_0x71d5('0x41'))){_0x26011f[_0x71d5('0x21')]=qs[_0x71d5('0x21')](_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x21')]);_0x26011f[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x22')]);}_0x26011f[_0x71d5('0x42')]=qs[_0x71d5('0x43')](_0x5c9b77[_0x71d5('0x3a')]['sort']);_0x26011f[_0x71d5('0x46')]=qs['filters'](_[_0x71d5('0x44')](_0x5c9b77[_0x71d5('0x3a')],_0x5cbe0f[_0x71d5('0x3c')]));_0x26011f['where'][_0x71d5('0x5d')]=_0x4108b0['id'];if(_0x5c9b77['query'][_0x71d5('0x45')]){_0x26011f[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0x26011f['where'],{'$or':_['map'](_0x26011f[_0x71d5('0x3e')],function(_0x1d0bad){var _0x4d1a5e={};_0x4d1a5e[_0x1d0bad]={'$like':'%'+_0x5c9b77[_0x71d5('0x3a')]['filter']+'%'};return _0x4d1a5e;})});}_0x26011f=_[_0x71d5('0x47')]({},_0x26011f,_0x5c9b77[_0x71d5('0x48')]);return db[_0x71d5('0x5c')]['findAll'](_0x26011f);}})[_0x71d5('0x2b')](function(_0x13c59d){if(_0x13c59d){return db[_0x71d5('0x5e')][_0x71d5('0x5f')]({'where':{'id':_[_0x71d5('0x33')](_0x13c59d,_0x71d5('0x60')),'role':'agent'},'attributes':['id',_0x71d5('0x31'),_0x71d5('0x61'),'updatedAt',_0x71d5('0x62')]});}})[_0x71d5('0x2b')](function(_0x69df6a){if(_0x69df6a){return{'count':_0x69df6a['count'],'rows':_[_0x71d5('0x33')](_0x69df6a[_0x71d5('0x4c')],function(_0x16ceb3){return{'membername':_0x16ceb3[_0x71d5('0x31')],'UserId':_0x16ceb3['id'],'queue_name':_0x1e63fe[_0x71d5('0x31')],'MailQueueId':_0x1e63fe['id'],'interface':util['format']('%s/%s',_0x71d5('0x63'),_0x16ceb3[_0x71d5('0x31')]),'penalty':0x0,'paused':_0x16ceb3[_0x71d5('0x61')],'createdAt':_0x16ceb3[_0x71d5('0x62')],'updatedAt':_0x16ceb3[_0x71d5('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x71d5('0x2b')](respondWithFilteredResult(_0x597aaf,_0x26011f))[_0x71d5('0x4d')](handleError(_0x597aaf,null));};exports['getTeams']=function(_0x2b19db,_0x5c9205,_0x374bdd){var _0xc1d692={};var _0x473b4e={};var _0x1329c2;var _0x59dcb8;return db[_0x71d5('0x34')][_0x71d5('0x5b')]({'where':{'id':_0x2b19db[_0x71d5('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c9205,null))[_0x71d5('0x2b')](function(_0x36cb07){if(_0x36cb07){_0x1329c2=_0x36cb07;_0x473b4e[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x65')][_0x71d5('0x35')]);_0x473b4e[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x2b19db[_0x71d5('0x3a')]);_0x473b4e['filters']=_[_0x71d5('0x3d')](_0x473b4e[_0x71d5('0x39')],_0x473b4e[_0x71d5('0x3a')]);_0xc1d692[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x473b4e['model'],qs[_0x71d5('0x4f')](_0x2b19db['query']['fields']));_0xc1d692[_0x71d5('0x3e')]=_0xc1d692[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0xc1d692[_0x71d5('0x3e')]:_0x473b4e[_0x71d5('0x39')];_0xc1d692[_0x71d5('0x42')]=qs[_0x71d5('0x43')](_0x2b19db['query'][_0x71d5('0x43')]);_0xc1d692[_0x71d5('0x46')]=qs[_0x71d5('0x3c')](_[_0x71d5('0x44')](_0x2b19db[_0x71d5('0x3a')],_0x473b4e['filters']));if(_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x45')]){_0xc1d692[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0xc1d692[_0x71d5('0x46')],{'$or':_['map'](_0xc1d692[_0x71d5('0x3e')],function(_0x24fad6){var _0x271295={};_0x271295[_0x24fad6]={'$like':'%'+_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x45')]+'%'};return _0x271295;})});}_0xc1d692=_['merge']({},_0xc1d692,_0x2b19db[_0x71d5('0x48')]);return _0x1329c2[_0x71d5('0x66')](_0xc1d692);}})[_0x71d5('0x2b')](function(_0x218e3f){if(_0x218e3f){_0x59dcb8=_0x218e3f[_0x71d5('0x3f')];if(!_0x2b19db['query'][_0x71d5('0x40')](_0x71d5('0x41'))){_0xc1d692['limit']=qs[_0x71d5('0x21')](_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x21')]);_0xc1d692[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x22')]);}return _0x1329c2['getTeams'](_0xc1d692);}})['then'](function(_0xce14df){if(_0xce14df){return _0xce14df?{'count':_0x59dcb8,'rows':_0xce14df}:null;}})[_0x71d5('0x2b')](respondWithResult(_0x5c9205,null))[_0x71d5('0x4d')](handleError(_0x5c9205,null));};exports['addTeams']=function(_0x464556,_0x288518,_0xb8f547){var _0x354597=_0x464556[_0x71d5('0x58')][_0x71d5('0x67')];return db[_0x71d5('0x65')][_0x71d5('0x4b')]({'where':{'id':_0x354597},'attributes':['id'],'include':[{'model':db[_0x71d5('0x5e')],'as':'Agents','attributes':['id','name',_0x71d5('0x68'),'voicePause',_0x71d5('0x69')],'raw':!![]}]})['then'](function(_0x1554e3){if(_0x1554e3){var _0x16362d=_[_0x71d5('0x6a')](_0x1554e3,function(_0x5d3446){var _0x36d024=_0x5d3446['get']({'plain':!![]});return _0x36d024[_0x71d5('0x6b')];});return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x464556[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](function(_0x2b7473){return db[_0x71d5('0x6c')][_0x71d5('0x6d')](function(_0x4a877d){return _0x2b7473['addTeams'](_0x354597,{'transaction':_0x4a877d})['then'](function(){return BPromise[_0x71d5('0x6e')](_0x16362d,function(_0x5857a2){return db['UserMailQueue'][_0x71d5('0x6f')]({'where':{'UserId':_0x5857a2['id'],'MailQueueId':_0x464556['params']['id']},'transaction':_0x4a877d});});})[_0x71d5('0x2b')](function(){_0x16362d[_0x71d5('0x70')](function(_0x49b671){socket[_0x71d5('0x71')](_0x71d5('0x72'),{'UserId':_0x49b671['id'],'MailQueueId':_0x2b7473['id']});});});});});}})['then'](respondWithStatusCode(_0x288518,null))['catch'](handleError(_0x288518,null));};exports[_0x71d5('0x73')]=function(_0x39bfa0,_0x1c3f85,_0x15b6af){return db[_0x71d5('0x65')][_0x71d5('0x4b')]({'where':{'id':_0x39bfa0[_0x71d5('0x3a')][_0x71d5('0x67')]},'attributes':['id'],'include':[{'model':db[_0x71d5('0x5e')],'as':_0x71d5('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x71d5('0x2b')](handleEntityNotFound(_0x1c3f85,null))[_0x71d5('0x2b')](function(_0x1d1fe4){var _0x37afe8=_[_0x71d5('0x33')](_0x1d1fe4,'id');var _0x361dc8=[];var _0x3482ab=[];var _0x10fcb7=squel[_0x71d5('0x74')]();_0x10fcb7['field'](_0x71d5('0x75'))[_0x71d5('0x76')]('team_has_mail_queues','tq')[_0x71d5('0x77')]('user_has_teams','ut',_0x71d5('0x78'))['where']('MailQueueId\x20=\x20?',_0x39bfa0[_0x71d5('0x59')]['id']);for(var _0x4e538b=0x0;_0x4e538b<_0x1d1fe4[_0x71d5('0x3f')];_0x4e538b+=0x1){let _0x3eddac=_0x1d1fe4[_0x4e538b];for(var _0x132b30=0x0;_0x132b30<_0x3eddac['Agents']['length'];_0x132b30+=0x1){let _0x1fe936=_0x3eddac[_0x71d5('0x6b')][_0x132b30];var _0x1642cd=_0x10fcb7['clone']();_0x1642cd['where'](_0x71d5('0x79'),_0x1fe936['id']);_0x3482ab[_0x71d5('0x7a')](db[_0x71d5('0x6c')][_0x71d5('0x3a')](_0x1642cd[_0x71d5('0x7b')](),{'type':db['sequelize'][_0x71d5('0x7c')][_0x71d5('0x7d')]})[_0x71d5('0x2b')](function(_0x279dc8){if(_0x279dc8['length']===0x1){return _0x1fe936['id'];}else{var _0x2f56bb=_[_0x71d5('0x7e')](_[_0x71d5('0x33')](_0x279dc8,'TeamId'),function(_0x4ba5dd){return _[_0x71d5('0x7f')](_0x37afe8,_0x4ba5dd);});if(_0x2f56bb){return _0x1fe936['id'];}}}));}}return BPromise[_0x71d5('0x80')](_0x3482ab)[_0x71d5('0x2b')](function(_0x4b7369){_0x361dc8=_(_0x361dc8)[_0x71d5('0x81')](_0x4b7369)[_0x71d5('0x82')]()['value']();return db['MailQueue']['find']({'where':{'id':_0x39bfa0[_0x71d5('0x59')]['id']}})['then'](function(_0x409b8a){return db['sequelize']['transaction'](function(_0xe43445){return _0x409b8a['removeTeams'](_0x39bfa0['query']['ids'],{'transaction':_0xe43445})['then'](function(){if(!_[_0x71d5('0x83')](_0x361dc8)){return _0x409b8a[_0x71d5('0x84')](_0x361dc8,{'transaction':_0xe43445});}})[_0x71d5('0x2b')](function(){_0x361dc8[_0x71d5('0x70')](function(_0x2612f2){socket[_0x71d5('0x71')](_0x71d5('0x85'),{'UserId':_0x2612f2,'MailQueueId':_0x409b8a['id']});});});});});});})['then'](respondWithStatusCode(_0x1c3f85,null))[_0x71d5('0x4d')](handleError(_0x1c3f85,null));};exports['addAgents']=function(_0x5418b0,_0x44933b,_0xe871fd){return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x5418b0[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x44933b,null))[_0x71d5('0x2b')](function(_0x34ce29){if(_0x34ce29){return _0x34ce29['addAgents'](_0x5418b0[_0x71d5('0x58')]['ids'],_[_0x71d5('0x86')](_0x5418b0['body'],[_0x71d5('0x67'),'id'])||{})[_0x71d5('0x87')](function(_0x1518c3){for(var _0x5b16f6=0x0;_0x5b16f6<_0x5418b0[_0x71d5('0x58')][_0x71d5('0x67')]['length'];_0x5b16f6+=0x1){socket[_0x71d5('0x71')](_0x71d5('0x72'),{'UserId':Number(_0x5418b0['body'][_0x71d5('0x67')][_0x5b16f6]),'MailQueueId':Number(_0x5418b0[_0x71d5('0x59')]['id'])});}return _0x1518c3;});}})[_0x71d5('0x2b')](respondWithResult(_0x44933b,null))['catch'](handleError(_0x44933b,null));};exports[_0x71d5('0x84')]=function(_0xc4f059,_0x4632e3,_0x1c453f){return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0xc4f059['params']['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x4632e3,null))[_0x71d5('0x2b')](function(_0x59512f){if(_0x59512f){return _0x59512f['removeAgents'](_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')])[_0x71d5('0x2b')](function(){if(_[_0x71d5('0x88')](_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')])){for(var _0x886c05=0x0;_0x886c05<_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')]['length'];_0x886c05+=0x1){socket[_0x71d5('0x71')](_0x71d5('0x85'),{'UserId':Number(_0xc4f059['query'][_0x71d5('0x67')][_0x886c05]),'MailQueueId':Number(_0xc4f059[_0x71d5('0x59')]['id'])});}}else{socket[_0x71d5('0x71')](_0x71d5('0x85'),{'UserId':Number(_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')]),'MailQueueId':Number(_0xc4f059[_0x71d5('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x4632e3,null))['catch'](handleError(_0x4632e3,null));};exports[_0x71d5('0x89')]=function(_0x1c6de2,_0x5e438d,_0x25d959){var _0x4468eb={};var _0x4d2a75={};var _0x36ba09;var _0x15b908;return db[_0x71d5('0x34')][_0x71d5('0x5b')]({'where':{'id':_0x1c6de2[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x5e438d,null))[_0x71d5('0x2b')](function(_0x3963eb){if(_0x3963eb){_0x36ba09=_0x3963eb;_0x4d2a75[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x5e')][_0x71d5('0x35')]);_0x4d2a75[_0x71d5('0x3a')]=_['keys'](_0x1c6de2[_0x71d5('0x3a')]);_0x4d2a75[_0x71d5('0x3c')]=_['intersection'](_0x4d2a75['model'],_0x4d2a75[_0x71d5('0x3a')]);_0x4468eb[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x4d2a75[_0x71d5('0x39')],qs[_0x71d5('0x4f')](_0x1c6de2['query']['fields']));_0x4468eb[_0x71d5('0x3e')]=_0x4468eb[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x4468eb[_0x71d5('0x3e')]:_0x4d2a75[_0x71d5('0x39')];_0x4468eb['order']=qs['sort'](_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x43')]);_0x4468eb['where']=qs['filters'](_[_0x71d5('0x44')](_0x1c6de2['query'],_0x4d2a75[_0x71d5('0x3c')]));if(_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x45')]){_0x4468eb[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0x4468eb[_0x71d5('0x46')],{'$or':_['map'](_0x4468eb[_0x71d5('0x3e')],function(_0x142da1){var _0x23afad={};_0x23afad[_0x142da1]={'$like':'%'+_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x45')]+'%'};return _0x23afad;})});}_0x4468eb=_['merge']({},_0x4468eb,_0x1c6de2[_0x71d5('0x48')]);return _0x36ba09[_0x71d5('0x89')](_0x4468eb);}})[_0x71d5('0x2b')](function(_0x284626){if(_0x284626){_0x15b908=_0x284626[_0x71d5('0x3f')];if(!_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x40')](_0x71d5('0x41'))){_0x4468eb[_0x71d5('0x21')]=qs[_0x71d5('0x21')](_0x1c6de2['query'][_0x71d5('0x21')]);_0x4468eb[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x1c6de2[_0x71d5('0x3a')]['offset']);}return _0x36ba09[_0x71d5('0x89')](_0x4468eb);}})['then'](function(_0x220f38){if(_0x220f38){return _0x220f38?{'count':_0x15b908,'rows':_0x220f38}:null;}})[_0x71d5('0x2b')](respondWithResult(_0x5e438d,null))[_0x71d5('0x4d')](handleError(_0x5e438d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6ea2cd7..aaaa712 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08e1=['../../mysqldb','MailQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x50589c,_0x561045){var _0x25f9c3=function(_0x410531){while(--_0x410531){_0x50589c['push'](_0x50589c['shift']());}};_0x25f9c3(++_0x561045);}(_0x08e1,0xd7));var _0x108e=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x08e1[_0x468a77];return _0x2d1c33;};'use strict';var EventEmitter=require(_0x108e('0x0'));var MailQueue=require(_0x108e('0x1'))['db'][_0x108e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x108e('0x3'),'afterUpdate':_0x108e('0x4'),'afterDestroy':_0x108e('0x5')};function emitEvent(_0x446662){return function(_0x49cb7d,_0x18cf1f,_0x3ae7c1){MailQueueEvents[_0x108e('0x6')](_0x446662+':'+_0x49cb7d['id'],_0x49cb7d);MailQueueEvents[_0x108e('0x6')](_0x446662,_0x49cb7d);_0x3ae7c1(null);};}for(var e in events){if(events[_0x108e('0x7')](e)){var event=events[e];MailQueue[_0x108e('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x6ed8=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6ed8,0x1e8));var _0x86ed=function(_0x5029a5,_0xd43924){_0x5029a5=_0x5029a5-0x0;var _0x473bff=_0x6ed8[_0x5029a5];return _0x473bff;};'use strict';var EventEmitter=require(_0x86ed('0x0'));var MailQueue=require(_0x86ed('0x1'))['db'][_0x86ed('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x86ed('0x3')](0x0);var events={'afterCreate':_0x86ed('0x4'),'afterUpdate':_0x86ed('0x5'),'afterDestroy':_0x86ed('0x6')};function emitEvent(_0x4a4f28){return function(_0x1f6714,_0x298c0b,_0x4ee347){MailQueueEvents[_0x86ed('0x7')](_0x4a4f28+':'+_0x1f6714['id'],_0x1f6714);MailQueueEvents[_0x86ed('0x7')](_0x4a4f28,_0x1f6714);_0x4ee347(null);};}for(var e in events){if(events[_0x86ed('0x8')](e)){var event=events[e];MailQueue[_0x86ed('0x9')](e,emitEvent(event));}}module[_0x86ed('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 775ba3c..b74b745 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b51=['../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash','util','api','moment','bluebird','path'];(function(_0x258959,_0x4c2abe){var _0x2e49ef=function(_0x2f16a){while(--_0x2f16a){_0x258959['push'](_0x258959['shift']());}};_0x2e49ef(++_0x4c2abe);}(_0x5b51,0xea));var _0x15b5=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x5b51[_0x55ff79];return _0x579067;};'use strict';var _=require(_0x15b5('0x0'));var util=require(_0x15b5('0x1'));var logger=require('../../config/logger')(_0x15b5('0x2'));var moment=require(_0x15b5('0x3'));var BPromise=require(_0x15b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15b5('0x5'));var rimraf=require('rimraf');var config=require(_0x15b5('0x6'));var attributes=require(_0x15b5('0x7'));module['exports']=function(_0x2db494,_0x428c0d){return _0x2db494['define'](_0x15b5('0x8'),attributes,{'tableName':_0x15b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81a7=['./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54fc08,_0x9710f3){var _0x132ead=function(_0xcf901f){while(--_0xcf901f){_0x54fc08['push'](_0x54fc08['shift']());}};_0x132ead(++_0x9710f3);}(_0x81a7,0x163));var _0x781a=function(_0x4b07e0,_0x3fdfdd){_0x4b07e0=_0x4b07e0-0x0;var _0x5e6381=_0x81a7[_0x4b07e0];return _0x5e6381;};'use strict';var _=require(_0x781a('0x0'));var util=require(_0x781a('0x1'));var logger=require(_0x781a('0x2'))(_0x781a('0x3'));var moment=require(_0x781a('0x4'));var BPromise=require(_0x781a('0x5'));var rp=require(_0x781a('0x6'));var fs=require('fs');var path=require(_0x781a('0x7'));var rimraf=require(_0x781a('0x8'));var config=require('../../config/environment');var attributes=require(_0x781a('0x9'));module[_0x781a('0xa')]=function(_0x41ee3b,_0xf178b3){return _0x41ee3b[_0x781a('0xb')](_0x781a('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 78a9cc1..c7c3895 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7314=['result','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailQueue','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5d5a67,_0x14bb88){var _0x91f724=function(_0x400737){while(--_0x400737){_0x5d5a67['push'](_0x5d5a67['shift']());}};_0x91f724(++_0x14bb88);}(_0x7314,0x100));var _0x4731=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var moment=require('moment');var BPromise=require(_0x4731('0x2'));var rs=require(_0x4731('0x3'));var fs=require('fs');var Redis=require(_0x4731('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4731('0x5'));var logger=require(_0x4731('0x6'))(_0x4731('0x7'));var config=require('../../config/environment');var jayson=require(_0x4731('0x8'));var client=jayson[_0x4731('0x9')]['http']({'port':0x232a});config[_0x4731('0xa')]=_[_0x4731('0xb')](config[_0x4731('0xa')],{'host':_0x4731('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4731('0xa')]));require('./mailQueue.socket')[_0x4731('0xd')](socket);function respondWithRpcPromise(_0x232e67,_0x17af9d,_0x4e6811){return new BPromise(function(_0xba853d,_0x24bca8){return client[_0x4731('0xe')](_0x232e67,_0x4e6811)[_0x4731('0xf')](function(_0x2f546b){logger[_0x4731('0x10')](_0x4731('0x11'),_0x17af9d,_0x4731('0x12'));logger[_0x4731('0x13')](_0x4731('0x14'),_0x17af9d,_0x4731('0x12'),JSON['stringify'](_0x2f546b));if(_0x2f546b['error']){if(_0x2f546b[_0x4731('0x15')][_0x4731('0x16')]===0x1f4){logger['error'](_0x4731('0x11'),_0x17af9d,_0x2f546b[_0x4731('0x15')][_0x4731('0x17')]);return _0x24bca8(_0x2f546b[_0x4731('0x15')]['message']);}logger[_0x4731('0x15')](_0x4731('0x11'),_0x17af9d,_0x2f546b['error'][_0x4731('0x17')]);return _0xba853d(_0x2f546b[_0x4731('0x15')]['message']);}else{logger[_0x4731('0x10')](_0x4731('0x11'),_0x17af9d,'request\x20sent');_0xba853d(_0x2f546b[_0x4731('0x18')][_0x4731('0x17')]);}})['catch'](function(_0x4e31c3){logger[_0x4731('0x15')](_0x4731('0x11'),_0x17af9d,_0x4e31c3);_0x24bca8(_0x4e31c3);});});}exports[_0x4731('0x19')]=function(_0x5991e4){var _0x343776=this;return new Promise(function(_0x27e9ca,_0xc6efce){return db[_0x4731('0x1a')][_0x4731('0x1b')]({'raw':_0x5991e4[_0x4731('0x1c')]?_0x5991e4[_0x4731('0x1c')][_0x4731('0x1d')]===undefined?!![]:![]:!![],'where':_0x5991e4[_0x4731('0x1c')]?_0x5991e4[_0x4731('0x1c')][_0x4731('0x1e')]||null:null,'attributes':_0x5991e4[_0x4731('0x1c')]?_0x5991e4[_0x4731('0x1c')][_0x4731('0x1f')]||null:null,'limit':_0x5991e4[_0x4731('0x1c')]?_0x5991e4[_0x4731('0x1c')][_0x4731('0x20')]||null:null,'include':_0x5991e4['options']?_0x5991e4[_0x4731('0x1c')][_0x4731('0x21')]?_[_0x4731('0x22')](_0x5991e4[_0x4731('0x1c')]['include'],function(_0x3c3cd5){return{'model':db[_0x3c3cd5[_0x4731('0x23')]],'as':_0x3c3cd5['as'],'attributes':_0x3c3cd5[_0x4731('0x1f')],'include':_0x3c3cd5[_0x4731('0x21')]?_[_0x4731('0x22')](_0x3c3cd5[_0x4731('0x21')],function(_0x209ee6){return{'model':db[_0x209ee6['model']],'as':_0x209ee6['as'],'attributes':_0x209ee6[_0x4731('0x1f')],'include':_0x209ee6[_0x4731('0x21')]?_[_0x4731('0x22')](_0x209ee6[_0x4731('0x21')],function(_0x25f17d){return{'model':db[_0x25f17d[_0x4731('0x23')]],'as':_0x25f17d['as'],'attributes':_0x25f17d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4731('0xf')](function(_0x5b335a){logger['info'](_0x4731('0x19'),_0x5991e4);logger['debug'](_0x4731('0x19'),_0x5991e4,JSON[_0x4731('0x24')](_0x5b335a));_0x27e9ca(_0x5b335a);})[_0x4731('0x25')](function(_0x2d9a45){logger[_0x4731('0x15')]('GetMailQueue',_0x2d9a45['message'],_0x5991e4);_0xc6efce(_0x343776[_0x4731('0x15')](0x1f4,_0x2d9a45[_0x4731('0x17')]));});});};exports[_0x4731('0x26')]=function(_0x2b6c29){var _0x5cd91e=this;return new Promise(function(_0x5419e5,_0x3f3a79){return db[_0x4731('0x1a')][_0x4731('0x27')]({'raw':_0x2b6c29[_0x4731('0x1c')]?_0x2b6c29['options'][_0x4731('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b6c29['options']?_0x2b6c29[_0x4731('0x1c')]['where']||null:null,'attributes':_0x2b6c29[_0x4731('0x1c')]?_0x2b6c29[_0x4731('0x1c')][_0x4731('0x1f')]||null:null,'include':_0x2b6c29[_0x4731('0x1c')]?_0x2b6c29[_0x4731('0x1c')][_0x4731('0x21')]?_[_0x4731('0x22')](_0x2b6c29[_0x4731('0x1c')][_0x4731('0x21')],function(_0x346e22){return{'model':db[_0x346e22[_0x4731('0x23')]],'as':_0x346e22['as'],'attributes':_0x346e22['attributes'],'include':_0x346e22[_0x4731('0x21')]?_[_0x4731('0x22')](_0x346e22[_0x4731('0x21')],function(_0x3c9b37){return{'model':db[_0x3c9b37[_0x4731('0x23')]],'as':_0x3c9b37['as'],'attributes':_0x3c9b37[_0x4731('0x1f')],'include':_0x3c9b37['include']?_['map'](_0x3c9b37[_0x4731('0x21')],function(_0x4fb932){return{'model':db[_0x4fb932[_0x4731('0x23')]],'as':_0x4fb932['as'],'attributes':_0x4fb932[_0x4731('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4731('0xf')](function(_0x479ba8){logger[_0x4731('0x10')](_0x4731('0x26'),_0x2b6c29);logger[_0x4731('0x13')](_0x4731('0x26'),_0x2b6c29,JSON['stringify'](_0x479ba8));_0x5419e5(_0x479ba8);})[_0x4731('0x25')](function(_0x1049a1){logger[_0x4731('0x15')]('ShowMailQueue',_0x1049a1['message'],_0x2b6c29);_0x3f3a79(_0x5cd91e[_0x4731('0x15')](0x1f4,_0x1049a1['message']));});});}; \ No newline at end of file +var _0x210d=['catch','ShowMailQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailQueue','MailQueue','findAll','options','where','limit','include','model','map','attributes'];(function(_0x55bed7,_0x1b34c5){var _0x130a75=function(_0x24ae24){while(--_0x24ae24){_0x55bed7['push'](_0x55bed7['shift']());}};_0x130a75(++_0x1b34c5);}(_0x210d,0x7c));var _0xd210=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x210d[_0x2605dc];return _0x4568c9;};'use strict';var _=require(_0xd210('0x0'));var util=require(_0xd210('0x1'));var moment=require('moment');var BPromise=require(_0xd210('0x2'));var rs=require(_0xd210('0x3'));var fs=require('fs');var Redis=require(_0xd210('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd210('0x5'))(_0xd210('0x6'));var config=require(_0xd210('0x7'));var jayson=require(_0xd210('0x8'));var client=jayson[_0xd210('0x9')][_0xd210('0xa')]({'port':0x232a});config[_0xd210('0xb')]=_[_0xd210('0xc')](config[_0xd210('0xb')],{'host':_0xd210('0xd'),'port':0x18eb});var socket=require(_0xd210('0xe'))(new Redis(config[_0xd210('0xb')]));require('./mailQueue.socket')[_0xd210('0xf')](socket);function respondWithRpcPromise(_0x37295f,_0x6e7c5d,_0x465cc1){return new BPromise(function(_0x331d8b,_0x382a45){return client['request'](_0x37295f,_0x465cc1)[_0xd210('0x10')](function(_0x3fb61e){logger[_0xd210('0x11')](_0xd210('0x12'),_0x6e7c5d,_0xd210('0x13'));logger[_0xd210('0x14')](_0xd210('0x15'),_0x6e7c5d,'request\x20sent',JSON[_0xd210('0x16')](_0x3fb61e));if(_0x3fb61e[_0xd210('0x17')]){if(_0x3fb61e['error']['code']===0x1f4){logger[_0xd210('0x17')](_0xd210('0x12'),_0x6e7c5d,_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);return _0x382a45(_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);}logger['error'](_0xd210('0x12'),_0x6e7c5d,_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);return _0x331d8b(_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);}else{logger[_0xd210('0x11')](_0xd210('0x12'),_0x6e7c5d,_0xd210('0x13'));_0x331d8b(_0x3fb61e[_0xd210('0x19')][_0xd210('0x18')]);}})['catch'](function(_0x99711){logger[_0xd210('0x17')](_0xd210('0x12'),_0x6e7c5d,_0x99711);_0x382a45(_0x99711);});});}exports[_0xd210('0x1a')]=function(_0x136a2f){var _0x31adaa=this;return new Promise(function(_0x1502ba,_0x3d687f){return db[_0xd210('0x1b')][_0xd210('0x1c')]({'raw':_0x136a2f[_0xd210('0x1d')]?_0x136a2f[_0xd210('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x136a2f[_0xd210('0x1d')]?_0x136a2f[_0xd210('0x1d')][_0xd210('0x1e')]||null:null,'attributes':_0x136a2f[_0xd210('0x1d')]?_0x136a2f[_0xd210('0x1d')]['attributes']||null:null,'limit':_0x136a2f['options']?_0x136a2f['options'][_0xd210('0x1f')]||null:null,'include':_0x136a2f['options']?_0x136a2f[_0xd210('0x1d')][_0xd210('0x20')]?_['map'](_0x136a2f[_0xd210('0x1d')][_0xd210('0x20')],function(_0x2b4379){return{'model':db[_0x2b4379[_0xd210('0x21')]],'as':_0x2b4379['as'],'attributes':_0x2b4379['attributes'],'include':_0x2b4379['include']?_[_0xd210('0x22')](_0x2b4379['include'],function(_0x17f604){return{'model':db[_0x17f604['model']],'as':_0x17f604['as'],'attributes':_0x17f604[_0xd210('0x23')],'include':_0x17f604[_0xd210('0x20')]?_[_0xd210('0x22')](_0x17f604[_0xd210('0x20')],function(_0x1065e6){return{'model':db[_0x1065e6[_0xd210('0x21')]],'as':_0x1065e6['as'],'attributes':_0x1065e6[_0xd210('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd210('0x10')](function(_0x33faf5){logger['info'](_0xd210('0x1a'),_0x136a2f);logger['debug'](_0xd210('0x1a'),_0x136a2f,JSON[_0xd210('0x16')](_0x33faf5));_0x1502ba(_0x33faf5);})[_0xd210('0x24')](function(_0x12e2f8){logger[_0xd210('0x17')](_0xd210('0x1a'),_0x12e2f8[_0xd210('0x18')],_0x136a2f);_0x3d687f(_0x31adaa['error'](0x1f4,_0x12e2f8[_0xd210('0x18')]));});});};exports[_0xd210('0x25')]=function(_0x17f63f){var _0x38ce7e=this;return new Promise(function(_0x491288,_0x45b100){return db[_0xd210('0x1b')][_0xd210('0x26')]({'raw':_0x17f63f[_0xd210('0x1d')]?_0x17f63f[_0xd210('0x1d')][_0xd210('0x27')]===undefined?!![]:![]:!![],'where':_0x17f63f[_0xd210('0x1d')]?_0x17f63f[_0xd210('0x1d')][_0xd210('0x1e')]||null:null,'attributes':_0x17f63f[_0xd210('0x1d')]?_0x17f63f[_0xd210('0x1d')][_0xd210('0x23')]||null:null,'include':_0x17f63f[_0xd210('0x1d')]?_0x17f63f['options'][_0xd210('0x20')]?_[_0xd210('0x22')](_0x17f63f[_0xd210('0x1d')][_0xd210('0x20')],function(_0x15a5d4){return{'model':db[_0x15a5d4['model']],'as':_0x15a5d4['as'],'attributes':_0x15a5d4[_0xd210('0x23')],'include':_0x15a5d4[_0xd210('0x20')]?_[_0xd210('0x22')](_0x15a5d4[_0xd210('0x20')],function(_0x1abc13){return{'model':db[_0x1abc13[_0xd210('0x21')]],'as':_0x1abc13['as'],'attributes':_0x1abc13[_0xd210('0x23')],'include':_0x1abc13[_0xd210('0x20')]?_[_0xd210('0x22')](_0x1abc13[_0xd210('0x20')],function(_0x4b02de){return{'model':db[_0x4b02de[_0xd210('0x21')]],'as':_0x4b02de['as'],'attributes':_0x4b02de[_0xd210('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd210('0x10')](function(_0x232f58){logger[_0xd210('0x11')](_0xd210('0x25'),_0x17f63f);logger['debug'](_0xd210('0x25'),_0x17f63f,JSON[_0xd210('0x16')](_0x232f58));_0x491288(_0x232f58);})[_0xd210('0x24')](function(_0x498ac5){logger['error'](_0xd210('0x25'),_0x498ac5[_0xd210('0x18')],_0x17f63f);_0x45b100(_0x38ce7e[_0xd210('0x17')](0x1f4,_0x498ac5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index cf22e9c..141ae5d 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77b0=['length','mailQueue:','save','remove','emit','removeListener','register'];(function(_0x278e20,_0x2e570d){var _0x2ed7e6=function(_0x4e8b4c){while(--_0x4e8b4c){_0x278e20['push'](_0x278e20['shift']());}};_0x2ed7e6(++_0x2e570d);}(_0x77b0,0xd4));var _0x077b=function(_0x284a9f,_0x4d8dfe){_0x284a9f=_0x284a9f-0x0;var _0x3987a5=_0x77b0[_0x284a9f];return _0x3987a5;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x077b('0x0'),_0x077b('0x1'),'update'];function createListener(_0x10b1e9,_0xc3fc9f){return function(_0x3979cc){_0xc3fc9f[_0x077b('0x2')](_0x10b1e9,_0x3979cc);};}function removeListener(_0x976fa8,_0x4d9096){return function(){MailQueueEvents[_0x077b('0x3')](_0x976fa8,_0x4d9096);};}exports[_0x077b('0x4')]=function(_0x28d2ae){for(var _0x4848ec=0x0,_0x75f4e0=events[_0x077b('0x5')];_0x4848ec<_0x75f4e0;_0x4848ec++){var _0x522f52=events[_0x4848ec];var _0x57843c=createListener(_0x077b('0x6')+_0x522f52,_0x28d2ae);MailQueueEvents['on'](_0x522f52,_0x57843c);}}; \ No newline at end of file +var _0x819f=['update','emit','register','length','./mailQueue.events','save','remove'];(function(_0x303273,_0x352ebb){var _0x56d9f6=function(_0xdf2780){while(--_0xdf2780){_0x303273['push'](_0x303273['shift']());}};_0x56d9f6(++_0x352ebb);}(_0x819f,0x1bd));var _0xf819=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x819f[_0x35b2a1];return _0x6023da;};'use strict';var MailQueueEvents=require(_0xf819('0x0'));var events=[_0xf819('0x1'),_0xf819('0x2'),_0xf819('0x3')];function createListener(_0x52fd18,_0x5c364e){return function(_0x1ce763){_0x5c364e[_0xf819('0x4')](_0x52fd18,_0x1ce763);};}function removeListener(_0x13aae9,_0x2a5726){return function(){MailQueueEvents['removeListener'](_0x13aae9,_0x2a5726);};}exports[_0xf819('0x5')]=function(_0x3cdad7){for(var _0x5b6143=0x0,_0x590f19=events[_0xf819('0x6')];_0x5b6143<_0x590f19;_0x5b6143++){var _0x4c5042=events[_0x5b6143];var _0x447fc3=createListener('mailQueue:'+_0x4c5042,_0x3cdad7);MailQueueEvents['on'](_0x4c5042,_0x447fc3);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index bb27457..3e91d6f 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe739=['./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xe739,0xd5));var _0x9e73=function(_0x188620,_0x360c00){_0x188620=_0x188620-0x0;var _0x3c0166=_0xe739[_0x188620];return _0x3c0166;};'use strict';var multer=require(_0x9e73('0x0'));var util=require(_0x9e73('0x1'));var path=require(_0x9e73('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e73('0x3'));var router=express[_0x9e73('0x4')]();var fs_extra=require(_0x9e73('0x5'));var auth=require(_0x9e73('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e73('0x7'));router[_0x9e73('0x8')]('/',auth[_0x9e73('0x9')](),controller[_0x9e73('0xa')]);router['get'](_0x9e73('0xb'),auth[_0x9e73('0x9')](),controller[_0x9e73('0xc')]);router[_0x9e73('0x8')](_0x9e73('0xd'),auth[_0x9e73('0x9')](),controller[_0x9e73('0xe')]);router[_0x9e73('0xf')]('/',auth[_0x9e73('0x9')](),controller[_0x9e73('0x10')]);router[_0x9e73('0x11')](_0x9e73('0xd'),auth['isAuthenticated'](),controller[_0x9e73('0x12')]);router['delete'](_0x9e73('0xd'),auth[_0x9e73('0x9')](),controller[_0x9e73('0x13')]);module['exports']=router; \ No newline at end of file +var _0xbe73=['show','post','create','put','delete','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xbe73,0x1c8));var _0x3be7=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0xbe73[_0x319e2e];return _0x302524;};'use strict';var multer=require('multer');var util=require(_0x3be7('0x0'));var path=require('path');var timeout=require(_0x3be7('0x1'));var express=require(_0x3be7('0x2'));var router=express[_0x3be7('0x3')]();var fs_extra=require(_0x3be7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3be7('0x5'));var controller=require(_0x3be7('0x6'));router[_0x3be7('0x7')]('/',auth[_0x3be7('0x8')](),controller['index']);router[_0x3be7('0x7')](_0x3be7('0x9'),auth[_0x3be7('0x8')](),controller[_0x3be7('0xa')]);router['get'](_0x3be7('0xb'),auth[_0x3be7('0x8')](),controller[_0x3be7('0xc')]);router[_0x3be7('0xd')]('/',auth[_0x3be7('0x8')](),controller[_0x3be7('0xe')]);router[_0x3be7('0xf')](_0x3be7('0xb'),auth[_0x3be7('0x8')](),controller['update']);router[_0x3be7('0x10')](_0x3be7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3be7('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index bf09d3e..4d89b01 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0ee=['DATE','moment','sequelize','exports','STRING'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0xd0ee,0x18c));var _0xed0e=function(_0x5dba3f,_0x2ce6f5){_0x5dba3f=_0x5dba3f-0x0;var _0x37ff5d=_0xd0ee[_0x5dba3f];return _0x37ff5d;};'use strict';var moment=require(_0xed0e('0x0'));var Sequelize=require(_0xed0e('0x1'));module[_0xed0e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xed0e('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xed0e('0x4')]},'acceptAt':{'type':Sequelize[_0xed0e('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x274e=['sequelize','exports','STRING','DATE'];(function(_0x52219b,_0x435d51){var _0x139fcf=function(_0x398a85){while(--_0x398a85){_0x52219b['push'](_0x52219b['shift']());}};_0x139fcf(++_0x435d51);}(_0x274e,0x1c0));var _0xe274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x274e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xe274('0x0'));module[_0xe274('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe274('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe274('0x3')]},'acceptAt':{'type':Sequelize[_0xe274('0x3')]},'exitAt':{'type':Sequelize[_0xe274('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1adad30..f59e5b7 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1893=['query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','map','VIRTUAL','filter','includeAll','include','catch','keys','merge','find','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','send','index','MailQueueReport','rawAttributes','type','key','model','name'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x1893,0xa2));var _0x3189=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0x1893[_0x2e50a2];return _0x47e5de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3189('0x0'));var jsonpatch=require(_0x3189('0x1'));var rp=require(_0x3189('0x2'));var moment=require(_0x3189('0x3'));var BPromise=require(_0x3189('0x4'));var Mustache=require(_0x3189('0x5'));var util=require(_0x3189('0x6'));var path=require('path');var sox=require(_0x3189('0x7'));var csv=require(_0x3189('0x8'));var ejs=require(_0x3189('0x9'));var fs=require('fs');var fs_extra=require(_0x3189('0xa'));var _=require(_0x3189('0xb'));var squel=require(_0x3189('0xc'));var crypto=require(_0x3189('0xd'));var jsforce=require(_0x3189('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3189('0x8'));var querystring=require('querystring');var Papa=require(_0x3189('0xf'));var Redis=require('ioredis');var authService=require(_0x3189('0x10'));var qs=require(_0x3189('0x11'));var as=require(_0x3189('0x12'));var hardwareService=require(_0x3189('0x13'));var logger=require('../../config/logger')(_0x3189('0x14'));var utils=require(_0x3189('0x15'));var config=require(_0x3189('0x16'));var licenseUtil=require(_0x3189('0x17'));var db=require(_0x3189('0x18'))['db'];function respondWithStatusCode(_0x5d9fff,_0x22b11e){_0x22b11e=_0x22b11e||0xcc;return function(_0x353b17){if(_0x353b17){return _0x5d9fff[_0x3189('0x19')](_0x22b11e);}return _0x5d9fff[_0x3189('0x1a')](_0x22b11e)[_0x3189('0x1b')]();};}function respondWithResult(_0x20dcc2,_0xef438){_0xef438=_0xef438||0xc8;return function(_0x25a917){if(_0x25a917){return _0x20dcc2['status'](_0xef438)[_0x3189('0x1c')](_0x25a917);}};}function respondWithFilteredResult(_0xb3e4c2,_0x1c209b){return function(_0x2fb62b){if(_0x2fb62b){var _0x486dd2=typeof _0x1c209b[_0x3189('0x1d')]==='undefined'&&typeof _0x1c209b['limit']===_0x3189('0x1e');var _0x49b1bc=_0x2fb62b[_0x3189('0x1f')];var _0xf8aed7=_0x486dd2?0x0:_0x1c209b[_0x3189('0x1d')];var _0x9905c4=_0x486dd2?_0x2fb62b['count']:_0x1c209b[_0x3189('0x1d')]+_0x1c209b[_0x3189('0x20')];var _0x16edd7;if(_0x9905c4>=_0x49b1bc){_0x9905c4=_0x49b1bc;_0x16edd7=0xc8;}else{_0x16edd7=0xce;}_0xb3e4c2['status'](_0x16edd7);return _0xb3e4c2[_0x3189('0x21')](_0x3189('0x22'),_0xf8aed7+'-'+_0x9905c4+'/'+_0x49b1bc)[_0x3189('0x1c')](_0x2fb62b);}return null;};}function patchUpdates(_0x2c1e59){return function(_0x29b275){try{jsonpatch['apply'](_0x29b275,_0x2c1e59,!![]);}catch(_0x1771a8){return BPromise[_0x3189('0x23')](_0x1771a8);}return _0x29b275[_0x3189('0x24')]();};}function saveUpdates(_0x539e12,_0x309c6e){return function(_0x47abb4){if(_0x47abb4){return _0x47abb4[_0x3189('0x25')](_0x539e12)[_0x3189('0x26')](function(_0x200f16){return _0x200f16;});}return null;};}function removeEntity(_0x38e56a,_0x1cbe33){return function(_0x393fcb){if(_0x393fcb){return _0x393fcb['destroy']()['then'](function(){_0x38e56a[_0x3189('0x1a')](0xcc)[_0x3189('0x1b')]();});}};}function handleEntityNotFound(_0x1dc1c8,_0x3cc1e5){return function(_0x103de4){if(!_0x103de4){_0x1dc1c8[_0x3189('0x19')](0x194);}return _0x103de4;};}function handleError(_0xdda38b,_0x379a48){_0x379a48=_0x379a48||0x1f4;return function(_0x17b540){logger[_0x3189('0x27')](_0x17b540['stack']);if(_0x17b540['name']){delete _0x17b540['name'];}_0xdda38b[_0x3189('0x1a')](_0x379a48)[_0x3189('0x28')](_0x17b540);};}exports[_0x3189('0x29')]=function(_0x90c31,_0x36b258){var _0x2f7504={},_0x4d453a={},_0x1ab94b={'count':0x0,'rows':[]};var _0x37b9ec=_['map'](db[_0x3189('0x2a')][_0x3189('0x2b')],function(_0x39c5e4){return{'name':_0x39c5e4['fieldName'],'type':_0x39c5e4[_0x3189('0x2c')][_0x3189('0x2d')]};});_0x4d453a[_0x3189('0x2e')]=_['map'](_0x37b9ec,_0x3189('0x2f'));_0x4d453a[_0x3189('0x30')]=_['keys'](_0x90c31[_0x3189('0x30')]);_0x4d453a[_0x3189('0x31')]=_[_0x3189('0x32')](_0x4d453a[_0x3189('0x2e')],_0x4d453a[_0x3189('0x30')]);_0x2f7504['attributes']=_['intersection'](_0x4d453a[_0x3189('0x2e')],qs['fields'](_0x90c31[_0x3189('0x30')][_0x3189('0x33')]));_0x2f7504[_0x3189('0x34')]=_0x2f7504[_0x3189('0x34')][_0x3189('0x35')]?_0x2f7504[_0x3189('0x34')]:_0x4d453a[_0x3189('0x2e')];if(!_0x90c31[_0x3189('0x30')][_0x3189('0x36')]('nolimit')){_0x2f7504[_0x3189('0x20')]=qs[_0x3189('0x20')](_0x90c31[_0x3189('0x30')][_0x3189('0x20')]);_0x2f7504[_0x3189('0x1d')]=qs[_0x3189('0x1d')](_0x90c31[_0x3189('0x30')]['offset']);}_0x2f7504['order']=qs[_0x3189('0x37')](_0x90c31['query'][_0x3189('0x37')]);_0x2f7504[_0x3189('0x38')]=qs['filters'](_[_0x3189('0x39')](_0x90c31[_0x3189('0x30')],_0x4d453a[_0x3189('0x31')]),_0x37b9ec);if(_0x90c31[_0x3189('0x30')]['filter']){_0x2f7504[_0x3189('0x38')]=_['merge'](_0x2f7504['where'],{'$or':_[_0x3189('0x3a')](_0x37b9ec,function(_0xed3041){if(_0xed3041[_0x3189('0x2c')]!==_0x3189('0x3b')){var _0x12dee0={};_0x12dee0[_0xed3041[_0x3189('0x2f')]]={'$like':'%'+_0x90c31[_0x3189('0x30')][_0x3189('0x3c')]+'%'};return _0x12dee0;}})});}_0x2f7504=_['merge']({},_0x2f7504,_0x90c31['options']);var _0x407e0a={'where':_0x2f7504[_0x3189('0x38')]};return db[_0x3189('0x2a')][_0x3189('0x1f')](_0x407e0a)[_0x3189('0x26')](function(_0xb52c70){_0x1ab94b['count']=_0xb52c70;if(_0x90c31[_0x3189('0x30')][_0x3189('0x3d')]){_0x2f7504[_0x3189('0x3e')]=[{'all':!![]}];}return db[_0x3189('0x2a')]['findAll'](_0x2f7504);})[_0x3189('0x26')](function(_0x2f0d49){_0x1ab94b['rows']=_0x2f0d49;return _0x1ab94b;})['then'](respondWithFilteredResult(_0x36b258,_0x2f7504))[_0x3189('0x3f')](handleError(_0x36b258,null));};exports['show']=function(_0x376787,_0x3074b9){var _0x38bf83={'raw':!![],'where':{'id':_0x376787['params']['id']}},_0x9593f3={};_0x9593f3[_0x3189('0x2e')]=_[_0x3189('0x40')](db['MailQueueReport'][_0x3189('0x2b')]);_0x9593f3[_0x3189('0x30')]=_[_0x3189('0x40')](_0x376787[_0x3189('0x30')]);_0x9593f3[_0x3189('0x31')]=_['intersection'](_0x9593f3['model'],_0x9593f3[_0x3189('0x30')]);_0x38bf83['attributes']=_[_0x3189('0x32')](_0x9593f3[_0x3189('0x2e')],qs[_0x3189('0x33')](_0x376787['query'][_0x3189('0x33')]));_0x38bf83[_0x3189('0x34')]=_0x38bf83[_0x3189('0x34')]['length']?_0x38bf83[_0x3189('0x34')]:_0x9593f3[_0x3189('0x2e')];if(_0x376787[_0x3189('0x30')][_0x3189('0x3d')]){_0x38bf83[_0x3189('0x3e')]=[{'all':!![]}];}_0x38bf83=_[_0x3189('0x41')]({},_0x38bf83,_0x376787['options']);return db['MailQueueReport'][_0x3189('0x42')](_0x38bf83)['then'](handleEntityNotFound(_0x3074b9,null))['then'](respondWithResult(_0x3074b9,null))[_0x3189('0x3f')](handleError(_0x3074b9,null));};exports['create']=function(_0x2d58fd,_0x1b6f09){return db[_0x3189('0x2a')]['create'](_0x2d58fd[_0x3189('0x43')],{})['then'](respondWithResult(_0x1b6f09,0xc9))[_0x3189('0x3f')](handleError(_0x1b6f09,null));};exports['update']=function(_0x49c4a8,_0x244166){if(_0x49c4a8['body']['id']){delete _0x49c4a8[_0x3189('0x43')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x49c4a8[_0x3189('0x44')]['id']}})[_0x3189('0x26')](handleEntityNotFound(_0x244166,null))[_0x3189('0x26')](saveUpdates(_0x49c4a8[_0x3189('0x43')],null))[_0x3189('0x26')](respondWithResult(_0x244166,null))[_0x3189('0x3f')](handleError(_0x244166,null));};exports['destroy']=function(_0x21d446,_0x549bc7){return db['MailQueueReport'][_0x3189('0x42')]({'where':{'id':_0x21d446[_0x3189('0x44')]['id']}})[_0x3189('0x26')](handleEntityNotFound(_0x549bc7,null))[_0x3189('0x26')](removeEntity(_0x549bc7,null))[_0x3189('0x3f')](handleError(_0x549bc7,null));};exports[_0x3189('0x45')]=function(_0x556ee5,_0x5117fb){return db['MailQueueReport'][_0x3189('0x45')]()[_0x3189('0x26')](respondWithResult(_0x5117fb,null))[_0x3189('0x3f')](handleError(_0x5117fb,null));}; \ No newline at end of file +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(_0x15dacd,_0x8b58e4){var _0x30f78c=function(_0x400b4a){while(--_0x400b4a){_0x15dacd['push'](_0x15dacd['shift']());}};_0x30f78c(++_0x8b58e4);}(_0x2542,0x169));var _0x2254=function(_0x5bb9fc,_0x36eaa3){_0x5bb9fc=_0x5bb9fc-0x0;var _0x31d701=_0x2542[_0x5bb9fc];return _0x31d701;};'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 diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 16f8ace..ef64b0b 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbba8=['define','MailQueueReport','report_mail_queue','uniqueid','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xbba8,0x1da));var _0x8bba=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xbba8[_0x125ff8];return _0x2d9ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8bba('0x0'))('api');var moment=require('moment');var BPromise=require(_0x8bba('0x1'));var rp=require(_0x8bba('0x2'));var fs=require('fs');var path=require(_0x8bba('0x3'));var rimraf=require(_0x8bba('0x4'));var config=require('../../config/environment');var attributes=require(_0x8bba('0x5'));module['exports']=function(_0x1fd8dc,_0x4e6f1b){return _0x1fd8dc[_0x8bba('0x6')](_0x8bba('0x7'),attributes,{'tableName':_0x8bba('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8bba('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc0b9=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue'];(function(_0x20b5fc,_0x41e26d){var _0x2508b1=function(_0x3e28ea){while(--_0x3e28ea){_0x20b5fc['push'](_0x20b5fc['shift']());}};_0x2508b1(++_0x41e26d);}(_0xc0b9,0x12d));var _0x9c0b=function(_0x496e26,_0x2ace9c){_0x496e26=_0x496e26-0x0;var _0x575705=_0xc0b9[_0x496e26];return _0x575705;};'use strict';var _=require(_0x9c0b('0x0'));var util=require(_0x9c0b('0x1'));var logger=require(_0x9c0b('0x2'))(_0x9c0b('0x3'));var moment=require(_0x9c0b('0x4'));var BPromise=require(_0x9c0b('0x5'));var rp=require(_0x9c0b('0x6'));var fs=require('fs');var path=require(_0x9c0b('0x7'));var rimraf=require(_0x9c0b('0x8'));var config=require(_0x9c0b('0x9'));var attributes=require(_0x9c0b('0xa'));module[_0x9c0b('0xb')]=function(_0x453013,_0x46d2b8){return _0x453013[_0x9c0b('0xc')]('MailQueueReport',attributes,{'tableName':_0x9c0b('0xd'),'paranoid':![],'indexes':[{'name':_0x9c0b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 0617c25..032deda 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3bbfb4,_0x264af5){var _0x3fb233=function(_0x5e99d7){while(--_0x5e99d7){_0x3bbfb4['push'](_0x3bbfb4['shift']());}};_0x3fb233(++_0x264af5);}(_0x1261,0x144));var _0x1126=function(_0x2bbd2d,_0x37c3c4){_0x2bbd2d=_0x2bbd2d-0x0;var _0x257dc9=_0x1261[_0x2bbd2d];return _0x257dc9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x18211c,_0x5da85f){var _0x519e10=function(_0x832252){while(--_0x832252){_0x18211c['push'](_0x18211c['shift']());}};_0x519e10(++_0x5da85f);}(_0xdb28,0x106));var _0x8db2=function(_0x4ac028,_0x46c6de){_0x4ac028=_0x4ac028-0x0;var _0x34ad7f=_0xdb28[_0x4ac028];return _0x34ad7f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 7892fcb..cfa0161 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x18c50f,_0x46b88c){var _0x1bdaec=function(_0x54056a){while(--_0x54056a){_0x18c50f['push'](_0x18c50f['shift']());}};_0x1bdaec(++_0x46b88c);}(_0xedd9,0xfc));var _0x9edd=function(_0x5313e0,_0x2dfc0d){_0x5313e0=_0x5313e0-0x0;var _0x49e0f0=_0xedd9[_0x5313e0];return _0x49e0f0;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5aabcb,_0x219fbd){var _0x4b6e71=function(_0x1546ee){while(--_0x1546ee){_0x5aabcb['push'](_0x5aabcb['shift']());}};_0x4b6e71(++_0x219fbd);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 4b12879..2bb4d4f 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd795=['INTEGER','INBOX','exports','STRING','BOOLEAN'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd795,0x1bf));var _0x5d79=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xd795[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require('sequelize');module[_0x5d79('0x0')]={'description':{'type':Sequelize[_0x5d79('0x1')]},'host':{'type':Sequelize[_0x5d79('0x1')]},'authentication':{'type':Sequelize[_0x5d79('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x5d79('0x1')]},'password':{'type':Sequelize[_0x5d79('0x1')]},'port':{'type':Sequelize[_0x5d79('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x5d79('0x1')],'defaultValue':_0x5d79('0x4')},'connTimeout':{'type':Sequelize[_0x5d79('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x5d79('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x5d79('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe814=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x5dfa0c,_0x5359f8){var _0x463457=function(_0x34b36e){while(--_0x34b36e){_0x5dfa0c['push'](_0x5dfa0c['shift']());}};_0x463457(++_0x5359f8);}(_0xe814,0x1c3));var _0x4e81=function(_0xee1510,_0x42b1de){_0xee1510=_0xee1510-0x0;var _0x36481a=_0xe814[_0xee1510];return _0x36481a;};'use strict';var Sequelize=require('sequelize');module[_0x4e81('0x0')]={'description':{'type':Sequelize[_0x4e81('0x1')]},'host':{'type':Sequelize[_0x4e81('0x1')]},'authentication':{'type':Sequelize[_0x4e81('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4e81('0x1')]},'password':{'type':Sequelize[_0x4e81('0x1')]},'port':{'type':Sequelize[_0x4e81('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4e81('0x1')],'defaultValue':_0x4e81('0x4')},'connTimeout':{'type':Sequelize[_0x4e81('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4e81('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4e81('0x1')]},'modernAuthentication':{'type':Sequelize[_0x4e81('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 312c64d..91507aa 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53f7=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment'];(function(_0x1988fa,_0x26b372){var _0x5d35e1=function(_0x4dff42){while(--_0x4dff42){_0x1988fa['push'](_0x1988fa['shift']());}};_0x5d35e1(++_0x26b372);}(_0x53f7,0x136));var _0x753f=function(_0x5ece84,_0xc06c9f){_0x5ece84=_0x5ece84-0x0;var _0x2a12c4=_0x53f7[_0x5ece84];return _0x2a12c4;};'use strict';var _=require(_0x753f('0x0'));var util=require(_0x753f('0x1'));var logger=require(_0x753f('0x2'))(_0x753f('0x3'));var moment=require(_0x753f('0x4'));var BPromise=require(_0x753f('0x5'));var rp=require(_0x753f('0x6'));var fs=require('fs');var path=require(_0x753f('0x7'));var rimraf=require(_0x753f('0x8'));var config=require(_0x753f('0x9'));var attributes=require(_0x753f('0xa'));module[_0x753f('0xb')]=function(_0x5146b1,_0xa7aa3c){return _0x5146b1[_0x753f('0xc')](_0x753f('0xd'),attributes,{'tableName':_0x753f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee78=['lodash','api','moment','bluebird','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x3e161f,_0x34c245){var _0x4d71cf=function(_0x2a6644){while(--_0x2a6644){_0x3e161f['push'](_0x3e161f['shift']());}};_0x4d71cf(++_0x34c245);}(_0xee78,0x1ae));var _0x8ee7=function(_0x3e5690,_0x495f56){_0x3e5690=_0x3e5690-0x0;var _0x1eb3ba=_0xee78[_0x3e5690];return _0x1eb3ba;};'use strict';var _=require(_0x8ee7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ee7('0x1'));var moment=require(_0x8ee7('0x2'));var BPromise=require(_0x8ee7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ee7('0x4'));var rimraf=require('rimraf');var config=require(_0x8ee7('0x5'));var attributes=require(_0x8ee7('0x6'));module[_0x8ee7('0x7')]=function(_0x46a1ab,_0x191232){return _0x46a1ab['define'](_0x8ee7('0x8'),attributes,{'tableName':_0x8ee7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 4f4b91d..65b6222 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a31=['catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x157160,_0x443993){var _0x2d96e5=function(_0x55f166){while(--_0x55f166){_0x157160['push'](_0x157160['shift']());}};_0x2d96e5(++_0x443993);}(_0x2a31,0xe4));var _0x12a3=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2a31[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x12a3('0x0'));var util=require(_0x12a3('0x1'));var moment=require(_0x12a3('0x2'));var BPromise=require(_0x12a3('0x3'));var rs=require(_0x12a3('0x4'));var fs=require('fs');var Redis=require(_0x12a3('0x5'));var db=require(_0x12a3('0x6'))['db'];var utils=require(_0x12a3('0x7'));var logger=require(_0x12a3('0x8'))(_0x12a3('0x9'));var config=require(_0x12a3('0xa'));var jayson=require(_0x12a3('0xb'));var client=jayson[_0x12a3('0xc')][_0x12a3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5411bc,_0xcf401f,_0x5e24b3){return new BPromise(function(_0x25703e,_0x4d6252){return client[_0x12a3('0xe')](_0x5411bc,_0x5e24b3)['then'](function(_0xc38543){logger['info'](_0x12a3('0xf'),_0xcf401f,_0x12a3('0x10'));logger[_0x12a3('0x11')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xcf401f,'request\x20sent',JSON[_0x12a3('0x12')](_0xc38543));if(_0xc38543[_0x12a3('0x13')]){if(_0xc38543[_0x12a3('0x13')][_0x12a3('0x14')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0xcf401f,_0xc38543[_0x12a3('0x13')]['message']);return _0x4d6252(_0xc38543[_0x12a3('0x13')][_0x12a3('0x15')]);}logger['error'](_0x12a3('0xf'),_0xcf401f,_0xc38543[_0x12a3('0x13')]['message']);return _0x25703e(_0xc38543['error'][_0x12a3('0x15')]);}else{logger[_0x12a3('0x16')](_0x12a3('0xf'),_0xcf401f,_0x12a3('0x10'));_0x25703e(_0xc38543[_0x12a3('0x17')][_0x12a3('0x15')]);}})[_0x12a3('0x18')](function(_0x471db6){logger[_0x12a3('0x13')](_0x12a3('0xf'),_0xcf401f,_0x471db6);_0x4d6252(_0x471db6);});});}exports[_0x12a3('0x19')]=function(_0xa0f618){var _0x1873f6=this;return new Promise(function(_0x3dbbe0,_0x395686){return db[_0x12a3('0x1a')][_0x12a3('0x1b')]({'raw':_0xa0f618[_0x12a3('0x1c')]?_0xa0f618[_0x12a3('0x1c')][_0x12a3('0x1d')]===undefined?!![]:![]:!![],'where':_0xa0f618[_0x12a3('0x1c')]?_0xa0f618[_0x12a3('0x1c')][_0x12a3('0x1e')]||null:null,'attributes':_0xa0f618['options']?_0xa0f618[_0x12a3('0x1c')][_0x12a3('0x1f')]||null:null,'limit':_0xa0f618[_0x12a3('0x1c')]?_0xa0f618[_0x12a3('0x1c')][_0x12a3('0x20')]||null:null,'include':_0xa0f618[_0x12a3('0x1c')]?_0xa0f618['options']['include']?_[_0x12a3('0x21')](_0xa0f618[_0x12a3('0x1c')][_0x12a3('0x22')],function(_0x16e39d){return{'model':db[_0x16e39d[_0x12a3('0x23')]],'as':_0x16e39d['as'],'attributes':_0x16e39d[_0x12a3('0x1f')],'include':_0x16e39d[_0x12a3('0x22')]?_[_0x12a3('0x21')](_0x16e39d[_0x12a3('0x22')],function(_0x53f3cb){return{'model':db[_0x53f3cb[_0x12a3('0x23')]],'as':_0x53f3cb['as'],'attributes':_0x53f3cb['attributes'],'include':_0x53f3cb['include']?_[_0x12a3('0x21')](_0x53f3cb['include'],function(_0x1418d9){return{'model':db[_0x1418d9[_0x12a3('0x23')]],'as':_0x1418d9['as'],'attributes':_0x1418d9[_0x12a3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3365b7){logger['info'](_0x12a3('0x19'),_0xa0f618);logger[_0x12a3('0x11')](_0x12a3('0x19'),_0xa0f618,JSON[_0x12a3('0x12')](_0x3365b7));_0x3dbbe0(_0x3365b7);})[_0x12a3('0x18')](function(_0x7075ab){logger[_0x12a3('0x13')](_0x12a3('0x19'),_0x7075ab['message'],_0xa0f618);_0x395686(_0x1873f6['error'](0x1f4,_0x7075ab['message']));});});}; \ No newline at end of file +var _0xd1d7=['stringify','error','code','message','result','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd1d7,0x144));var _0x7d1d=function(_0x3765e2,_0x4e1fba){_0x3765e2=_0x3765e2-0x0;var _0x144efb=_0xd1d7[_0x3765e2];return _0x144efb;};'use strict';var _=require(_0x7d1d('0x0'));var util=require(_0x7d1d('0x1'));var moment=require(_0x7d1d('0x2'));var BPromise=require(_0x7d1d('0x3'));var rs=require(_0x7d1d('0x4'));var fs=require('fs');var Redis=require(_0x7d1d('0x5'));var db=require(_0x7d1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d1d('0x7'))(_0x7d1d('0x8'));var config=require(_0x7d1d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d1d('0xa')][_0x7d1d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b7d44,_0x458b26,_0x31c346){return new BPromise(function(_0x3ee0be,_0x3351e5){return client['request'](_0x3b7d44,_0x31c346)['then'](function(_0x31b835){logger[_0x7d1d('0xc')](_0x7d1d('0xd'),_0x458b26,_0x7d1d('0xe'));logger['debug'](_0x7d1d('0xf'),_0x458b26,_0x7d1d('0xe'),JSON[_0x7d1d('0x10')](_0x31b835));if(_0x31b835[_0x7d1d('0x11')]){if(_0x31b835[_0x7d1d('0x11')][_0x7d1d('0x12')]===0x1f4){logger[_0x7d1d('0x11')](_0x7d1d('0xd'),_0x458b26,_0x31b835[_0x7d1d('0x11')]['message']);return _0x3351e5(_0x31b835['error']['message']);}logger['error'](_0x7d1d('0xd'),_0x458b26,_0x31b835[_0x7d1d('0x11')][_0x7d1d('0x13')]);return _0x3ee0be(_0x31b835['error']['message']);}else{logger[_0x7d1d('0xc')](_0x7d1d('0xd'),_0x458b26,_0x7d1d('0xe'));_0x3ee0be(_0x31b835[_0x7d1d('0x14')][_0x7d1d('0x13')]);}})[_0x7d1d('0x15')](function(_0xbf0a9b){logger[_0x7d1d('0x11')](_0x7d1d('0xd'),_0x458b26,_0xbf0a9b);_0x3351e5(_0xbf0a9b);});});}exports[_0x7d1d('0x16')]=function(_0x103e4a){var _0x4ad117=this;return new Promise(function(_0x1e14eb,_0x5a50ca){return db['MailServerIn'][_0x7d1d('0x17')]({'raw':_0x103e4a['options']?_0x103e4a['options'][_0x7d1d('0x18')]===undefined?!![]:![]:!![],'where':_0x103e4a[_0x7d1d('0x19')]?_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1a')]||null:null,'attributes':_0x103e4a[_0x7d1d('0x19')]?_0x103e4a['options'][_0x7d1d('0x1b')]||null:null,'limit':_0x103e4a['options']?_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1c')]||null:null,'include':_0x103e4a['options']?_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1d')]?_[_0x7d1d('0x1e')](_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1d')],function(_0x158f10){return{'model':db[_0x158f10[_0x7d1d('0x1f')]],'as':_0x158f10['as'],'attributes':_0x158f10[_0x7d1d('0x1b')],'include':_0x158f10[_0x7d1d('0x1d')]?_[_0x7d1d('0x1e')](_0x158f10[_0x7d1d('0x1d')],function(_0x390e22){return{'model':db[_0x390e22[_0x7d1d('0x1f')]],'as':_0x390e22['as'],'attributes':_0x390e22[_0x7d1d('0x1b')],'include':_0x390e22['include']?_[_0x7d1d('0x1e')](_0x390e22['include'],function(_0x3088db){return{'model':db[_0x3088db[_0x7d1d('0x1f')]],'as':_0x3088db['as'],'attributes':_0x3088db[_0x7d1d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7d1d('0x20')](function(_0x2a1bef){logger[_0x7d1d('0xc')](_0x7d1d('0x16'),_0x103e4a);logger[_0x7d1d('0x21')](_0x7d1d('0x16'),_0x103e4a,JSON['stringify'](_0x2a1bef));_0x1e14eb(_0x2a1bef);})[_0x7d1d('0x15')](function(_0x4ce74a){logger['error'](_0x7d1d('0x16'),_0x4ce74a[_0x7d1d('0x13')],_0x103e4a);_0x5a50ca(_0x4ad117['error'](0x1f4,_0x4ce74a[_0x7d1d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 57311e3..6892884 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x9ae911,_0x588dd9){_0x9ae911=_0x9ae911-0x0;var _0x1e1f65=_0x7a54[_0x9ae911];return _0x1e1f65;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 778e19c..288bc36 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3266=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x513e5f,_0x3ff078){var _0x5048ca=function(_0x1a6f67){while(--_0x1a6f67){_0x513e5f['push'](_0x513e5f['shift']());}};_0x5048ca(++_0x3ff078);}(_0x3266,0x6a));var _0x6326=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x3266[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'description':{'type':Sequelize[_0x6326('0x2')]},'host':{'type':Sequelize[_0x6326('0x2')]},'user':{'type':Sequelize[_0x6326('0x2')]},'pass':{'type':Sequelize[_0x6326('0x2')]},'port':{'type':Sequelize[_0x6326('0x3')]},'secure':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x6326('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xea28=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0xea28,0x13a));var _0x8ea2=function(_0x4495f5,_0x2a87a1){_0x4495f5=_0x4495f5-0x0;var _0x2a3b77=_0xea28[_0x4495f5];return _0x2a3b77;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'description':{'type':Sequelize[_0x8ea2('0x2')]},'host':{'type':Sequelize[_0x8ea2('0x2')]},'user':{'type':Sequelize[_0x8ea2('0x2')]},'pass':{'type':Sequelize[_0x8ea2('0x2')]},'port':{'type':Sequelize[_0x8ea2('0x3')]},'secure':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7976145..0718d67 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbefa=['findAll','catch','show','params','intersection','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','MailServerOut','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbefa,0x1e9));var _0xabef=function(_0x3ccee8,_0x25de90){_0x3ccee8=_0x3ccee8-0x0;var _0x370129=_0xbefa[_0x3ccee8];return _0x370129;};'use strict';var emlformat=require(_0xabef('0x0'));var rimraf=require(_0xabef('0x1'));var zipdir=require(_0xabef('0x2'));var jsonpatch=require(_0xabef('0x3'));var rp=require(_0xabef('0x4'));var moment=require(_0xabef('0x5'));var BPromise=require(_0xabef('0x6'));var Mustache=require(_0xabef('0x7'));var util=require(_0xabef('0x8'));var path=require(_0xabef('0x9'));var sox=require(_0xabef('0xa'));var csv=require(_0xabef('0xb'));var ejs=require(_0xabef('0xc'));var fs=require('fs');var fs_extra=require(_0xabef('0xd'));var _=require(_0xabef('0xe'));var squel=require(_0xabef('0xf'));var crypto=require(_0xabef('0x10'));var jsforce=require(_0xabef('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xabef('0xb'));var querystring=require(_0xabef('0x12'));var Papa=require(_0xabef('0x13'));var Redis=require(_0xabef('0x14'));var authService=require(_0xabef('0x15'));var qs=require(_0xabef('0x16'));var as=require(_0xabef('0x17'));var hardwareService=require(_0xabef('0x18'));var logger=require(_0xabef('0x19'))(_0xabef('0x1a'));var utils=require(_0xabef('0x1b'));var config=require(_0xabef('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0xabef('0x1d'))['db'];function respondWithStatusCode(_0x54496a,_0x22cdc5){_0x22cdc5=_0x22cdc5||0xcc;return function(_0x251a30){if(_0x251a30){return _0x54496a['sendStatus'](_0x22cdc5);}return _0x54496a[_0xabef('0x1e')](_0x22cdc5)[_0xabef('0x1f')]();};}function respondWithResult(_0x2cc67c,_0x310df3){_0x310df3=_0x310df3||0xc8;return function(_0x4a2a02){if(_0x4a2a02){return _0x2cc67c['status'](_0x310df3)[_0xabef('0x20')](_0x4a2a02);}};}function respondWithFilteredResult(_0x389561,_0x5d7aaf){return function(_0x191da3){if(_0x191da3){var _0x1df90b=typeof _0x5d7aaf['offset']===_0xabef('0x21')&&typeof _0x5d7aaf['limit']===_0xabef('0x21');var _0x197c0f=_0x191da3['count'];var _0x36565c=_0x1df90b?0x0:_0x5d7aaf[_0xabef('0x22')];var _0x36f925=_0x1df90b?_0x191da3[_0xabef('0x23')]:_0x5d7aaf['offset']+_0x5d7aaf[_0xabef('0x24')];var _0x10fffa;if(_0x36f925>=_0x197c0f){_0x36f925=_0x197c0f;_0x10fffa=0xc8;}else{_0x10fffa=0xce;}_0x389561[_0xabef('0x1e')](_0x10fffa);return _0x389561[_0xabef('0x25')](_0xabef('0x26'),_0x36565c+'-'+_0x36f925+'/'+_0x197c0f)[_0xabef('0x20')](_0x191da3);}return null;};}function patchUpdates(_0x4f10d5){return function(_0x14b909){try{jsonpatch[_0xabef('0x27')](_0x14b909,_0x4f10d5,!![]);}catch(_0x19f37d){return BPromise[_0xabef('0x28')](_0x19f37d);}return _0x14b909[_0xabef('0x29')]();};}function saveUpdates(_0x5cc90c,_0x443773){return function(_0x39b1d5){if(_0x39b1d5){return _0x39b1d5[_0xabef('0x2a')](_0x5cc90c)['then'](function(_0x3521aa){return _0x3521aa;});}return null;};}function removeEntity(_0x48535c,_0x4f4158){return function(_0x1dddac){if(_0x1dddac){return _0x1dddac[_0xabef('0x2b')]()[_0xabef('0x2c')](function(){_0x48535c['status'](0xcc)[_0xabef('0x1f')]();});}};}function handleEntityNotFound(_0x4b9b71,_0x4efd14){return function(_0x1f8218){if(!_0x1f8218){_0x4b9b71[_0xabef('0x2d')](0x194);}return _0x1f8218;};}function handleError(_0x3a32e3,_0x420908){_0x420908=_0x420908||0x1f4;return function(_0x115d71){logger['error'](_0x115d71[_0xabef('0x2e')]);if(_0x115d71['name']){delete _0x115d71[_0xabef('0x2f')];}_0x3a32e3[_0xabef('0x1e')](_0x420908)[_0xabef('0x30')](_0x115d71);};}exports[_0xabef('0x31')]=function(_0x2c45bb,_0x2e6b71){var _0x4e7e76={},_0x1afcb2={},_0x5c72ae={'count':0x0,'rows':[]};var _0x2c9238=_['map'](db[_0xabef('0x32')][_0xabef('0x33')],function(_0x477d3c){return{'name':_0x477d3c[_0xabef('0x34')],'type':_0x477d3c['type'][_0xabef('0x35')]};});_0x1afcb2[_0xabef('0x36')]=_[_0xabef('0x37')](_0x2c9238,_0xabef('0x2f'));_0x1afcb2['query']=_[_0xabef('0x38')](_0x2c45bb[_0xabef('0x39')]);_0x1afcb2[_0xabef('0x3a')]=_['intersection'](_0x1afcb2[_0xabef('0x36')],_0x1afcb2[_0xabef('0x39')]);_0x4e7e76[_0xabef('0x3b')]=_['intersection'](_0x1afcb2[_0xabef('0x36')],qs['fields'](_0x2c45bb['query'][_0xabef('0x3c')]));_0x4e7e76[_0xabef('0x3b')]=_0x4e7e76[_0xabef('0x3b')][_0xabef('0x3d')]?_0x4e7e76[_0xabef('0x3b')]:_0x1afcb2[_0xabef('0x36')];if(!_0x2c45bb[_0xabef('0x39')][_0xabef('0x3e')]('nolimit')){_0x4e7e76[_0xabef('0x24')]=qs[_0xabef('0x24')](_0x2c45bb[_0xabef('0x39')][_0xabef('0x24')]);_0x4e7e76['offset']=qs[_0xabef('0x22')](_0x2c45bb[_0xabef('0x39')][_0xabef('0x22')]);}_0x4e7e76[_0xabef('0x3f')]=qs[_0xabef('0x40')](_0x2c45bb['query'][_0xabef('0x40')]);_0x4e7e76[_0xabef('0x41')]=qs[_0xabef('0x3a')](_['pick'](_0x2c45bb[_0xabef('0x39')],_0x1afcb2['filters']),_0x2c9238);if(_0x2c45bb['query']['filter']){_0x4e7e76[_0xabef('0x41')]=_[_0xabef('0x42')](_0x4e7e76[_0xabef('0x41')],{'$or':_[_0xabef('0x37')](_0x2c9238,function(_0x4422bb){if(_0x4422bb['type']!==_0xabef('0x43')){var _0x4b7e0a={};_0x4b7e0a[_0x4422bb[_0xabef('0x2f')]]={'$like':'%'+_0x2c45bb['query'][_0xabef('0x44')]+'%'};return _0x4b7e0a;}})});}_0x4e7e76=_[_0xabef('0x42')]({},_0x4e7e76,_0x2c45bb['options']);var _0x3abff3={'where':_0x4e7e76[_0xabef('0x41')]};return db[_0xabef('0x32')][_0xabef('0x23')](_0x3abff3)['then'](function(_0x4a4a8a){_0x5c72ae['count']=_0x4a4a8a;if(_0x2c45bb['query'][_0xabef('0x45')]){_0x4e7e76[_0xabef('0x46')]=[{'all':!![]}];}return db['MailServerOut'][_0xabef('0x47')](_0x4e7e76);})[_0xabef('0x2c')](function(_0x64d581){_0x5c72ae['rows']=_0x64d581;return _0x5c72ae;})[_0xabef('0x2c')](respondWithFilteredResult(_0x2e6b71,_0x4e7e76))[_0xabef('0x48')](handleError(_0x2e6b71,null));};exports[_0xabef('0x49')]=function(_0x4f879f,_0x131a81){var _0x53c18d={'raw':!![],'where':{'id':_0x4f879f[_0xabef('0x4a')]['id']}},_0x4fab6e={};_0x4fab6e['model']=_[_0xabef('0x38')](db[_0xabef('0x32')][_0xabef('0x33')]);_0x4fab6e['query']=_['keys'](_0x4f879f[_0xabef('0x39')]);_0x4fab6e[_0xabef('0x3a')]=_[_0xabef('0x4b')](_0x4fab6e[_0xabef('0x36')],_0x4fab6e[_0xabef('0x39')]);_0x53c18d[_0xabef('0x3b')]=_[_0xabef('0x4b')](_0x4fab6e[_0xabef('0x36')],qs[_0xabef('0x3c')](_0x4f879f['query']['fields']));_0x53c18d[_0xabef('0x3b')]=_0x53c18d[_0xabef('0x3b')][_0xabef('0x3d')]?_0x53c18d[_0xabef('0x3b')]:_0x4fab6e[_0xabef('0x36')];if(_0x4f879f[_0xabef('0x39')][_0xabef('0x45')]){_0x53c18d[_0xabef('0x46')]=[{'all':!![]}];}_0x53c18d=_['merge']({},_0x53c18d,_0x4f879f[_0xabef('0x4c')]);return db['MailServerOut'][_0xabef('0x4d')](_0x53c18d)[_0xabef('0x2c')](handleEntityNotFound(_0x131a81,null))['then'](respondWithResult(_0x131a81,null))[_0xabef('0x48')](handleError(_0x131a81,null));};exports['create']=function(_0x460539,_0x14d089){return db['MailServerOut'][_0xabef('0x4e')](_0x460539['body'],{})[_0xabef('0x2c')](respondWithResult(_0x14d089,0xc9))[_0xabef('0x48')](handleError(_0x14d089,null));};exports[_0xabef('0x2a')]=function(_0x39af2e,_0x5e5290){if(_0x39af2e['body']['id']){delete _0x39af2e[_0xabef('0x4f')]['id'];}return db[_0xabef('0x32')][_0xabef('0x4d')]({'where':{'id':_0x39af2e[_0xabef('0x4a')]['id']}})[_0xabef('0x2c')](handleEntityNotFound(_0x5e5290,null))[_0xabef('0x2c')](saveUpdates(_0x39af2e[_0xabef('0x4f')],null))[_0xabef('0x2c')](respondWithResult(_0x5e5290,null))[_0xabef('0x48')](handleError(_0x5e5290,null));};exports[_0xabef('0x2b')]=function(_0x43ac5f,_0xd0aec9){return db['MailServerOut'][_0xabef('0x4d')]({'where':{'id':_0x43ac5f[_0xabef('0x4a')]['id']}})[_0xabef('0x2c')](handleEntityNotFound(_0xd0aec9,null))[_0xabef('0x2c')](removeEntity(_0xd0aec9,null))[_0xabef('0x48')](handleError(_0xd0aec9,null));}; \ No newline at end of file +var _0x2a50=['apply','reject','save','update','then','error','stack','name','send','MailServerOut','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','zip-dir','fast-json-patch','util','ejs','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range'];(function(_0x1cc972,_0x3c6c34){var _0x3705a2=function(_0x25bcd5){while(--_0x25bcd5){_0x1cc972['push'](_0x1cc972['shift']());}};_0x3705a2(++_0x3c6c34);}(_0x2a50,0x1db));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02a5('0x0'));var jsonpatch=require(_0x02a5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02a5('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x02a5('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02a5('0x4'));var squel=require(_0x02a5('0x5'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x02a5('0x6'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02a5('0x7'));var qs=require(_0x02a5('0x8'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x02a5('0x9'))('api');var utils=require('../../config/utils');var config=require(_0x02a5('0xa'));var licenseUtil=require(_0x02a5('0xb'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bdc82,_0x2fb0a3){_0x2fb0a3=_0x2fb0a3||0xcc;return function(_0x537043){if(_0x537043){return _0x5bdc82[_0x02a5('0xc')](_0x2fb0a3);}return _0x5bdc82[_0x02a5('0xd')](_0x2fb0a3)[_0x02a5('0xe')]();};}function respondWithResult(_0x440d68,_0x3cb4d5){_0x3cb4d5=_0x3cb4d5||0xc8;return function(_0x14bacf){if(_0x14bacf){return _0x440d68['status'](_0x3cb4d5)[_0x02a5('0xf')](_0x14bacf);}};}function respondWithFilteredResult(_0x3c8cf5,_0xa87ab0){return function(_0x206acb){if(_0x206acb){var _0xfbb5a7=typeof _0xa87ab0[_0x02a5('0x10')]==='undefined'&&typeof _0xa87ab0[_0x02a5('0x11')]==='undefined';var _0x1ef65a=_0x206acb['count'];var _0x150f0c=_0xfbb5a7?0x0:_0xa87ab0[_0x02a5('0x10')];var _0x3b6598=_0xfbb5a7?_0x206acb[_0x02a5('0x12')]:_0xa87ab0[_0x02a5('0x10')]+_0xa87ab0[_0x02a5('0x11')];var _0x39c8da;if(_0x3b6598>=_0x1ef65a){_0x3b6598=_0x1ef65a;_0x39c8da=0xc8;}else{_0x39c8da=0xce;}_0x3c8cf5[_0x02a5('0xd')](_0x39c8da);return _0x3c8cf5[_0x02a5('0x13')](_0x02a5('0x14'),_0x150f0c+'-'+_0x3b6598+'/'+_0x1ef65a)[_0x02a5('0xf')](_0x206acb);}return null;};}function patchUpdates(_0x12abc9){return function(_0x382764){try{jsonpatch[_0x02a5('0x15')](_0x382764,_0x12abc9,!![]);}catch(_0xf2dc84){return BPromise[_0x02a5('0x16')](_0xf2dc84);}return _0x382764[_0x02a5('0x17')]();};}function saveUpdates(_0x416596,_0x15dc03){return function(_0x4bfe97){if(_0x4bfe97){return _0x4bfe97[_0x02a5('0x18')](_0x416596)[_0x02a5('0x19')](function(_0x472f38){return _0x472f38;});}return null;};}function removeEntity(_0x4ca801,_0x310dbc){return function(_0x4b69a7){if(_0x4b69a7){return _0x4b69a7['destroy']()[_0x02a5('0x19')](function(){_0x4ca801[_0x02a5('0xd')](0xcc)[_0x02a5('0xe')]();});}};}function handleEntityNotFound(_0x4e8be0,_0x324db3){return function(_0x4026a3){if(!_0x4026a3){_0x4e8be0['sendStatus'](0x194);}return _0x4026a3;};}function handleError(_0x5d86fc,_0x1e5e81){_0x1e5e81=_0x1e5e81||0x1f4;return function(_0x2a8659){logger[_0x02a5('0x1a')](_0x2a8659[_0x02a5('0x1b')]);if(_0x2a8659[_0x02a5('0x1c')]){delete _0x2a8659[_0x02a5('0x1c')];}_0x5d86fc[_0x02a5('0xd')](_0x1e5e81)[_0x02a5('0x1d')](_0x2a8659);};}exports['index']=function(_0x4388f3,_0x56c223){var _0x31642c={},_0x563a83={},_0x543903={'count':0x0,'rows':[]};var _0x5c8ed2=_['map'](db[_0x02a5('0x1e')][_0x02a5('0x1f')],function(_0x1f0329){return{'name':_0x1f0329[_0x02a5('0x20')],'type':_0x1f0329[_0x02a5('0x21')]['key']};});_0x563a83[_0x02a5('0x22')]=_[_0x02a5('0x23')](_0x5c8ed2,_0x02a5('0x1c'));_0x563a83[_0x02a5('0x24')]=_[_0x02a5('0x25')](_0x4388f3[_0x02a5('0x24')]);_0x563a83['filters']=_[_0x02a5('0x26')](_0x563a83['model'],_0x563a83['query']);_0x31642c['attributes']=_[_0x02a5('0x26')](_0x563a83[_0x02a5('0x22')],qs[_0x02a5('0x27')](_0x4388f3[_0x02a5('0x24')][_0x02a5('0x27')]));_0x31642c[_0x02a5('0x28')]=_0x31642c[_0x02a5('0x28')][_0x02a5('0x29')]?_0x31642c['attributes']:_0x563a83['model'];if(!_0x4388f3[_0x02a5('0x24')][_0x02a5('0x2a')](_0x02a5('0x2b'))){_0x31642c[_0x02a5('0x11')]=qs[_0x02a5('0x11')](_0x4388f3[_0x02a5('0x24')]['limit']);_0x31642c[_0x02a5('0x10')]=qs['offset'](_0x4388f3[_0x02a5('0x24')][_0x02a5('0x10')]);}_0x31642c[_0x02a5('0x2c')]=qs['sort'](_0x4388f3[_0x02a5('0x24')][_0x02a5('0x2d')]);_0x31642c['where']=qs[_0x02a5('0x2e')](_[_0x02a5('0x2f')](_0x4388f3[_0x02a5('0x24')],_0x563a83['filters']),_0x5c8ed2);if(_0x4388f3[_0x02a5('0x24')][_0x02a5('0x30')]){_0x31642c[_0x02a5('0x31')]=_[_0x02a5('0x32')](_0x31642c[_0x02a5('0x31')],{'$or':_[_0x02a5('0x23')](_0x5c8ed2,function(_0x35b72d){if(_0x35b72d['type']!==_0x02a5('0x33')){var _0x52917a={};_0x52917a[_0x35b72d[_0x02a5('0x1c')]]={'$like':'%'+_0x4388f3[_0x02a5('0x24')][_0x02a5('0x30')]+'%'};return _0x52917a;}})});}_0x31642c=_[_0x02a5('0x32')]({},_0x31642c,_0x4388f3['options']);var _0x5aa8ae={'where':_0x31642c[_0x02a5('0x31')]};return db[_0x02a5('0x1e')][_0x02a5('0x12')](_0x5aa8ae)[_0x02a5('0x19')](function(_0x5067d3){_0x543903[_0x02a5('0x12')]=_0x5067d3;if(_0x4388f3[_0x02a5('0x24')][_0x02a5('0x34')]){_0x31642c[_0x02a5('0x35')]=[{'all':!![]}];}return db[_0x02a5('0x1e')][_0x02a5('0x36')](_0x31642c);})['then'](function(_0x1f6784){_0x543903[_0x02a5('0x37')]=_0x1f6784;return _0x543903;})[_0x02a5('0x19')](respondWithFilteredResult(_0x56c223,_0x31642c))[_0x02a5('0x38')](handleError(_0x56c223,null));};exports['show']=function(_0x145757,_0x2bbe10){var _0x3c3656={'raw':!![],'where':{'id':_0x145757[_0x02a5('0x39')]['id']}},_0x185357={};_0x185357[_0x02a5('0x22')]=_[_0x02a5('0x25')](db[_0x02a5('0x1e')][_0x02a5('0x1f')]);_0x185357['query']=_[_0x02a5('0x25')](_0x145757['query']);_0x185357[_0x02a5('0x2e')]=_[_0x02a5('0x26')](_0x185357[_0x02a5('0x22')],_0x185357[_0x02a5('0x24')]);_0x3c3656[_0x02a5('0x28')]=_[_0x02a5('0x26')](_0x185357['model'],qs['fields'](_0x145757[_0x02a5('0x24')][_0x02a5('0x27')]));_0x3c3656[_0x02a5('0x28')]=_0x3c3656[_0x02a5('0x28')][_0x02a5('0x29')]?_0x3c3656['attributes']:_0x185357['model'];if(_0x145757['query'][_0x02a5('0x34')]){_0x3c3656[_0x02a5('0x35')]=[{'all':!![]}];}_0x3c3656=_['merge']({},_0x3c3656,_0x145757['options']);return db[_0x02a5('0x1e')][_0x02a5('0x3a')](_0x3c3656)['then'](handleEntityNotFound(_0x2bbe10,null))[_0x02a5('0x19')](respondWithResult(_0x2bbe10,null))[_0x02a5('0x38')](handleError(_0x2bbe10,null));};exports[_0x02a5('0x3b')]=function(_0x51c8d4,_0x1cbe22){return db[_0x02a5('0x1e')]['create'](_0x51c8d4[_0x02a5('0x3c')],{})[_0x02a5('0x19')](respondWithResult(_0x1cbe22,0xc9))[_0x02a5('0x38')](handleError(_0x1cbe22,null));};exports['update']=function(_0x422e7b,_0x535038){if(_0x422e7b['body']['id']){delete _0x422e7b[_0x02a5('0x3c')]['id'];}return db['MailServerOut'][_0x02a5('0x3a')]({'where':{'id':_0x422e7b[_0x02a5('0x39')]['id']}})[_0x02a5('0x19')](handleEntityNotFound(_0x535038,null))[_0x02a5('0x19')](saveUpdates(_0x422e7b[_0x02a5('0x3c')],null))[_0x02a5('0x19')](respondWithResult(_0x535038,null))[_0x02a5('0x38')](handleError(_0x535038,null));};exports[_0x02a5('0x3d')]=function(_0x187cb2,_0x517dcc){return db['MailServerOut'][_0x02a5('0x3a')]({'where':{'id':_0x187cb2[_0x02a5('0x39')]['id']}})[_0x02a5('0x19')](handleEntityNotFound(_0x517dcc,null))[_0x02a5('0x19')](removeEntity(_0x517dcc,null))[_0x02a5('0x38')](handleError(_0x517dcc,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 65d5c83..2de25d6 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64b9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','util','../../config/logger'];(function(_0x5f55d6,_0x4cdd6f){var _0x3ba746=function(_0x4deaf8){while(--_0x4deaf8){_0x5f55d6['push'](_0x5f55d6['shift']());}};_0x3ba746(++_0x4cdd6f);}(_0x64b9,0x82));var _0x964b=function(_0xcf5917,_0x3b7a91){_0xcf5917=_0xcf5917-0x0;var _0x131466=_0x64b9[_0xcf5917];return _0x131466;};'use strict';var _=require('lodash');var util=require(_0x964b('0x0'));var logger=require(_0x964b('0x1'))(_0x964b('0x2'));var moment=require(_0x964b('0x3'));var BPromise=require(_0x964b('0x4'));var rp=require(_0x964b('0x5'));var fs=require('fs');var path=require(_0x964b('0x6'));var rimraf=require(_0x964b('0x7'));var config=require(_0x964b('0x8'));var attributes=require(_0x964b('0x9'));module[_0x964b('0xa')]=function(_0xafd96d,_0x33e5b0){return _0xafd96d[_0x964b('0xb')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2254=['bluebird','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','moment'];(function(_0x26df10,_0x8990e4){var _0x270348=function(_0x438918){while(--_0x438918){_0x26df10['push'](_0x26df10['shift']());}};_0x270348(++_0x8990e4);}(_0x2254,0x115));var _0x4225=function(_0xede3fe,_0x27c3c5){_0xede3fe=_0xede3fe-0x0;var _0x59657a=_0x2254[_0xede3fe];return _0x59657a;};'use strict';var _=require(_0x4225('0x0'));var util=require(_0x4225('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4225('0x2'));var BPromise=require(_0x4225('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4225('0x4'));var config=require(_0x4225('0x5'));var attributes=require(_0x4225('0x6'));module[_0x4225('0x7')]=function(_0x2db52d,_0x256526){return _0x2db52d[_0x4225('0x8')](_0x4225('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index eccd3cf..6c21414 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x342548,_0x31c72e){var _0x107140=function(_0x32c2ab){while(--_0x32c2ab){_0x342548['push'](_0x342548['shift']());}};_0x107140(++_0x31c72e);}(_0xadb5,0xad));var _0x5adb=function(_0x3cefd0,_0x1d614a){_0x3cefd0=_0x3cefd0-0x0;var _0x41042b=_0xadb5[_0x3cefd0];return _0x41042b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4cc0f8,_0xe8dcab){var _0xb1250c=function(_0x39a419){while(--_0x39a419){_0x4cc0f8['push'](_0x4cc0f8['shift']());}};_0xb1250c(++_0xe8dcab);}(_0x1261,0x144));var _0x1126=function(_0x3c6835,_0x952d5c){_0x3c6835=_0x3c6835-0x0;var _0x1adeb9=_0x1261[_0x3c6835];return _0x1adeb9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a7357d7..d8e3309 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35b0=['describe','/:id','show','create','put','update','delete','destroy','exports','util','Router','./mailSubstatus.controller','get','index','isAuthenticated'];(function(_0x140622,_0x4abe75){var _0x48a9d2=function(_0x4b51c0){while(--_0x4b51c0){_0x140622['push'](_0x140622['shift']());}};_0x48a9d2(++_0x4abe75);}(_0x35b0,0x19e));var _0x035b=function(_0x35968c,_0x50c1b6){_0x35968c=_0x35968c-0x0;var _0x15f31c=_0x35b0[_0x35968c];return _0x15f31c;};'use strict';var multer=require('multer');var util=require(_0x035b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x035b('0x1')]();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(_0x035b('0x2'));router[_0x035b('0x3')]('/',auth['isAuthenticated'](),controller[_0x035b('0x4')]);router['get']('/describe',auth[_0x035b('0x5')](),controller[_0x035b('0x6')]);router[_0x035b('0x3')](_0x035b('0x7'),auth[_0x035b('0x5')](),controller[_0x035b('0x8')]);router['post']('/',auth[_0x035b('0x5')](),controller[_0x035b('0x9')]);router[_0x035b('0xa')](_0x035b('0x7'),auth[_0x035b('0x5')](),controller[_0x035b('0xb')]);router[_0x035b('0xc')](_0x035b('0x7'),auth[_0x035b('0x5')](),controller[_0x035b('0xd')]);module[_0x035b('0xe')]=router; \ No newline at end of file +var _0x0fe7=['/:id','update','multer','path','express','fs-extra','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x4cdf9d,_0xf0c32){var _0x5c34e1=function(_0x47a864){while(--_0x47a864){_0x4cdf9d['push'](_0x4cdf9d['shift']());}};_0x5c34e1(++_0xf0c32);}(_0x0fe7,0xf2));var _0x70fe=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x0fe7[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require(_0x70fe('0x0'));var util=require('util');var path=require(_0x70fe('0x1'));var timeout=require('connect-timeout');var express=require(_0x70fe('0x2'));var router=express['Router']();var fs_extra=require(_0x70fe('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x70fe('0x4'));var controller=require(_0x70fe('0x5'));router[_0x70fe('0x6')]('/',auth[_0x70fe('0x7')](),controller[_0x70fe('0x8')]);router[_0x70fe('0x6')](_0x70fe('0x9'),auth[_0x70fe('0x7')](),controller[_0x70fe('0xa')]);router[_0x70fe('0x6')]('/:id',auth[_0x70fe('0x7')](),controller[_0x70fe('0xb')]);router[_0x70fe('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x70fe('0xd'),auth[_0x70fe('0x7')](),controller[_0x70fe('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f5ea2ce..1dca821 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d9=['sequelize','exports','STRING','name'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x901d('0x0'));module[_0x901d('0x1')]={'name':{'type':Sequelize[_0x901d('0x2')],'unique':_0x901d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5e0e=['STRING','sequelize','exports','name'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x5e0e,0x89));var _0xe5e0=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x5e0e[_0x1c470d];return _0x12141b;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe5e0('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index aad1791..111d47f 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x907c=['params','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','include','findAll','rows','catch','show'];(function(_0x1a09a7,_0x308926){var _0xe92e09=function(_0x128b5b){while(--_0x128b5b){_0x1a09a7['push'](_0x1a09a7['shift']());}};_0xe92e09(++_0x308926);}(_0x907c,0x12e));var _0xc907=function(_0x3250a9,_0x5c85a1){_0x3250a9=_0x3250a9-0x0;var _0x2299f2=_0x907c[_0x3250a9];return _0x2299f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc907('0x0'));var jsonpatch=require(_0xc907('0x1'));var rp=require(_0xc907('0x2'));var moment=require(_0xc907('0x3'));var BPromise=require(_0xc907('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc907('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc907('0x6'));var _=require(_0xc907('0x7'));var squel=require('squel');var crypto=require(_0xc907('0x8'));var jsforce=require(_0xc907('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc907('0xa'));var Papa=require(_0xc907('0xb'));var Redis=require('ioredis');var authService=require(_0xc907('0xc'));var qs=require(_0xc907('0xd'));var as=require(_0xc907('0xe'));var hardwareService=require(_0xc907('0xf'));var logger=require(_0xc907('0x10'))('api');var utils=require(_0xc907('0x11'));var config=require(_0xc907('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc907('0x13'))['db'];function respondWithStatusCode(_0x2e74e2,_0x29da7c){_0x29da7c=_0x29da7c||0xcc;return function(_0x5d909b){if(_0x5d909b){return _0x2e74e2['sendStatus'](_0x29da7c);}return _0x2e74e2[_0xc907('0x14')](_0x29da7c)['end']();};}function respondWithResult(_0x2f4f13,_0x586e17){_0x586e17=_0x586e17||0xc8;return function(_0x35987a){if(_0x35987a){return _0x2f4f13[_0xc907('0x14')](_0x586e17)[_0xc907('0x15')](_0x35987a);}};}function respondWithFilteredResult(_0x1fe34a,_0x130ce7){return function(_0x2a1521){if(_0x2a1521){var _0xe162d0=typeof _0x130ce7[_0xc907('0x16')]==='undefined'&&typeof _0x130ce7[_0xc907('0x17')]===_0xc907('0x18');var _0x3655fd=_0x2a1521[_0xc907('0x19')];var _0x49fc05=_0xe162d0?0x0:_0x130ce7[_0xc907('0x16')];var _0x2d47b4=_0xe162d0?_0x2a1521[_0xc907('0x19')]:_0x130ce7[_0xc907('0x16')]+_0x130ce7[_0xc907('0x17')];var _0x1842af;if(_0x2d47b4>=_0x3655fd){_0x2d47b4=_0x3655fd;_0x1842af=0xc8;}else{_0x1842af=0xce;}_0x1fe34a['status'](_0x1842af);return _0x1fe34a[_0xc907('0x1a')](_0xc907('0x1b'),_0x49fc05+'-'+_0x2d47b4+'/'+_0x3655fd)[_0xc907('0x15')](_0x2a1521);}return null;};}function patchUpdates(_0x461543){return function(_0xdf7f77){try{jsonpatch[_0xc907('0x1c')](_0xdf7f77,_0x461543,!![]);}catch(_0xf97ad){return BPromise[_0xc907('0x1d')](_0xf97ad);}return _0xdf7f77[_0xc907('0x1e')]();};}function saveUpdates(_0x4da9b7,_0x3d5012){return function(_0x5cd1e8){if(_0x5cd1e8){return _0x5cd1e8[_0xc907('0x1f')](_0x4da9b7)[_0xc907('0x20')](function(_0x5b1d6d){return _0x5b1d6d;});}return null;};}function removeEntity(_0x79cc94,_0xba1cba){return function(_0xeac1a6){if(_0xeac1a6){return _0xeac1a6[_0xc907('0x21')]()[_0xc907('0x20')](function(){_0x79cc94[_0xc907('0x14')](0xcc)[_0xc907('0x22')]();});}};}function handleEntityNotFound(_0x3ae7d6,_0x2283d5){return function(_0x3570c9){if(!_0x3570c9){_0x3ae7d6[_0xc907('0x23')](0x194);}return _0x3570c9;};}function handleError(_0x34f7f8,_0x1930f9){_0x1930f9=_0x1930f9||0x1f4;return function(_0x54efd2){logger[_0xc907('0x24')](_0x54efd2[_0xc907('0x25')]);if(_0x54efd2[_0xc907('0x26')]){delete _0x54efd2['name'];}_0x34f7f8[_0xc907('0x14')](_0x1930f9)[_0xc907('0x27')](_0x54efd2);};}exports[_0xc907('0x28')]=function(_0x22920b,_0x1bd2f7){var _0x16b0ff={},_0x3d40ed={},_0x2b8246={'count':0x0,'rows':[]};var _0x396531=_[_0xc907('0x29')](db['MailSubstatus'][_0xc907('0x2a')],function(_0x22720d){return{'name':_0x22720d[_0xc907('0x2b')],'type':_0x22720d[_0xc907('0x2c')][_0xc907('0x2d')]};});_0x3d40ed['model']=_['map'](_0x396531,'name');_0x3d40ed['query']=_[_0xc907('0x2e')](_0x22920b[_0xc907('0x2f')]);_0x3d40ed[_0xc907('0x30')]=_[_0xc907('0x31')](_0x3d40ed[_0xc907('0x32')],_0x3d40ed[_0xc907('0x2f')]);_0x16b0ff[_0xc907('0x33')]=_['intersection'](_0x3d40ed[_0xc907('0x32')],qs[_0xc907('0x34')](_0x22920b[_0xc907('0x2f')][_0xc907('0x34')]));_0x16b0ff[_0xc907('0x33')]=_0x16b0ff[_0xc907('0x33')][_0xc907('0x35')]?_0x16b0ff[_0xc907('0x33')]:_0x3d40ed[_0xc907('0x32')];if(!_0x22920b['query']['hasOwnProperty'](_0xc907('0x36'))){_0x16b0ff[_0xc907('0x17')]=qs[_0xc907('0x17')](_0x22920b['query']['limit']);_0x16b0ff['offset']=qs[_0xc907('0x16')](_0x22920b[_0xc907('0x2f')][_0xc907('0x16')]);}_0x16b0ff['order']=qs[_0xc907('0x37')](_0x22920b[_0xc907('0x2f')][_0xc907('0x37')]);_0x16b0ff[_0xc907('0x38')]=qs[_0xc907('0x30')](_[_0xc907('0x39')](_0x22920b[_0xc907('0x2f')],_0x3d40ed[_0xc907('0x30')]),_0x396531);if(_0x22920b['query'][_0xc907('0x3a')]){_0x16b0ff[_0xc907('0x38')]=_[_0xc907('0x3b')](_0x16b0ff[_0xc907('0x38')],{'$or':_[_0xc907('0x29')](_0x396531,function(_0x2dc1fd){if(_0x2dc1fd[_0xc907('0x2c')]!==_0xc907('0x3c')){var _0x1972f4={};_0x1972f4[_0x2dc1fd[_0xc907('0x26')]]={'$like':'%'+_0x22920b['query'][_0xc907('0x3a')]+'%'};return _0x1972f4;}})});}_0x16b0ff=_[_0xc907('0x3b')]({},_0x16b0ff,_0x22920b[_0xc907('0x3d')]);var _0xc85dbe={'where':_0x16b0ff[_0xc907('0x38')]};return db[_0xc907('0x3e')][_0xc907('0x19')](_0xc85dbe)[_0xc907('0x20')](function(_0x56f5e0){_0x2b8246[_0xc907('0x19')]=_0x56f5e0;if(_0x22920b[_0xc907('0x2f')]['includeAll']){_0x16b0ff[_0xc907('0x3f')]=[{'all':!![]}];}return db[_0xc907('0x3e')][_0xc907('0x40')](_0x16b0ff);})[_0xc907('0x20')](function(_0x5347d4){_0x2b8246[_0xc907('0x41')]=_0x5347d4;return _0x2b8246;})[_0xc907('0x20')](respondWithFilteredResult(_0x1bd2f7,_0x16b0ff))[_0xc907('0x42')](handleError(_0x1bd2f7,null));};exports[_0xc907('0x43')]=function(_0x1afce8,_0x2ae267){var _0x433615={'raw':!![],'where':{'id':_0x1afce8[_0xc907('0x44')]['id']}},_0x16c3ba={};_0x16c3ba[_0xc907('0x32')]=_[_0xc907('0x2e')](db[_0xc907('0x3e')][_0xc907('0x2a')]);_0x16c3ba['query']=_['keys'](_0x1afce8[_0xc907('0x2f')]);_0x16c3ba[_0xc907('0x30')]=_[_0xc907('0x31')](_0x16c3ba[_0xc907('0x32')],_0x16c3ba[_0xc907('0x2f')]);_0x433615[_0xc907('0x33')]=_[_0xc907('0x31')](_0x16c3ba[_0xc907('0x32')],qs[_0xc907('0x34')](_0x1afce8[_0xc907('0x2f')]['fields']));_0x433615[_0xc907('0x33')]=_0x433615[_0xc907('0x33')][_0xc907('0x35')]?_0x433615[_0xc907('0x33')]:_0x16c3ba[_0xc907('0x32')];if(_0x1afce8[_0xc907('0x2f')][_0xc907('0x45')]){_0x433615[_0xc907('0x3f')]=[{'all':!![]}];}_0x433615=_[_0xc907('0x3b')]({},_0x433615,_0x1afce8[_0xc907('0x3d')]);return db[_0xc907('0x3e')][_0xc907('0x46')](_0x433615)[_0xc907('0x20')](handleEntityNotFound(_0x2ae267,null))[_0xc907('0x20')](respondWithResult(_0x2ae267,null))[_0xc907('0x42')](handleError(_0x2ae267,null));};exports[_0xc907('0x47')]=function(_0x4a0951,_0x218b0a){return db[_0xc907('0x3e')][_0xc907('0x47')](_0x4a0951[_0xc907('0x48')],{})['then'](respondWithResult(_0x218b0a,0xc9))[_0xc907('0x42')](handleError(_0x218b0a,null));};exports[_0xc907('0x1f')]=function(_0x105d76,_0x15b989){if(_0x105d76[_0xc907('0x48')]['id']){delete _0x105d76[_0xc907('0x48')]['id'];}return db[_0xc907('0x3e')][_0xc907('0x46')]({'where':{'id':_0x105d76[_0xc907('0x44')]['id']}})[_0xc907('0x20')](handleEntityNotFound(_0x15b989,null))[_0xc907('0x20')](saveUpdates(_0x105d76[_0xc907('0x48')],null))[_0xc907('0x20')](respondWithResult(_0x15b989,null))['catch'](handleError(_0x15b989,null));};exports[_0xc907('0x21')]=function(_0x386aa0,_0x3e50a8){return db[_0xc907('0x3e')]['find']({'where':{'id':_0x386aa0[_0xc907('0x44')]['id']}})[_0xc907('0x20')](handleEntityNotFound(_0x3e50a8,null))['then'](removeEntity(_0x3e50a8,null))[_0xc907('0x42')](handleError(_0x3e50a8,null));};exports['describe']=function(_0x2b1679,_0x4106c1){return db[_0xc907('0x3e')][_0xc907('0x49')]()['then'](respondWithResult(_0x4106c1,null))[_0xc907('0x42')](handleError(_0x4106c1,null));}; \ No newline at end of file +var _0x0edd=['includeAll','find','catch','create','body','describe','rimraf','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','include','findAll','rows','show','params'];(function(_0x5d2c82,_0xadbd70){var _0x9047d4=function(_0x2646a2){while(--_0x2646a2){_0x5d2c82['push'](_0x5d2c82['shift']());}};_0x9047d4(++_0xadbd70);}(_0x0edd,0xde));var _0xd0ed=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0edd[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd0ed('0x1'));var BPromise=require(_0xd0ed('0x2'));var Mustache=require(_0xd0ed('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd0ed('0x4'));var ejs=require(_0xd0ed('0x5'));var fs=require('fs');var fs_extra=require(_0xd0ed('0x6'));var _=require(_0xd0ed('0x7'));var squel=require(_0xd0ed('0x8'));var crypto=require(_0xd0ed('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd0ed('0xa'));var toCsv=require(_0xd0ed('0x4'));var querystring=require('querystring');var Papa=require(_0xd0ed('0xb'));var Redis=require(_0xd0ed('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd0ed('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0ed('0xe'));var logger=require(_0xd0ed('0xf'))('api');var utils=require(_0xd0ed('0x10'));var config=require(_0xd0ed('0x11'));var licenseUtil=require(_0xd0ed('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43a7c7,_0x594379){_0x594379=_0x594379||0xcc;return function(_0x595fbb){if(_0x595fbb){return _0x43a7c7['sendStatus'](_0x594379);}return _0x43a7c7[_0xd0ed('0x13')](_0x594379)['end']();};}function respondWithResult(_0x4308ad,_0x39b4ea){_0x39b4ea=_0x39b4ea||0xc8;return function(_0x184195){if(_0x184195){return _0x4308ad[_0xd0ed('0x13')](_0x39b4ea)[_0xd0ed('0x14')](_0x184195);}};}function respondWithFilteredResult(_0x5962c2,_0x33e7c6){return function(_0x89a947){if(_0x89a947){var _0x4a13e6=typeof _0x33e7c6['offset']==='undefined'&&typeof _0x33e7c6[_0xd0ed('0x15')]===_0xd0ed('0x16');var _0x1f9e88=_0x89a947[_0xd0ed('0x17')];var _0x20c88e=_0x4a13e6?0x0:_0x33e7c6[_0xd0ed('0x18')];var _0x4e7c54=_0x4a13e6?_0x89a947[_0xd0ed('0x17')]:_0x33e7c6['offset']+_0x33e7c6[_0xd0ed('0x15')];var _0x473508;if(_0x4e7c54>=_0x1f9e88){_0x4e7c54=_0x1f9e88;_0x473508=0xc8;}else{_0x473508=0xce;}_0x5962c2[_0xd0ed('0x13')](_0x473508);return _0x5962c2[_0xd0ed('0x19')](_0xd0ed('0x1a'),_0x20c88e+'-'+_0x4e7c54+'/'+_0x1f9e88)['json'](_0x89a947);}return null;};}function patchUpdates(_0x2a9f38){return function(_0x5e2604){try{jsonpatch[_0xd0ed('0x1b')](_0x5e2604,_0x2a9f38,!![]);}catch(_0x8c7fef){return BPromise[_0xd0ed('0x1c')](_0x8c7fef);}return _0x5e2604[_0xd0ed('0x1d')]();};}function saveUpdates(_0x5570c5,_0x1b41ee){return function(_0x5bb179){if(_0x5bb179){return _0x5bb179[_0xd0ed('0x1e')](_0x5570c5)[_0xd0ed('0x1f')](function(_0x18721f){return _0x18721f;});}return null;};}function removeEntity(_0x252399,_0x5e138d){return function(_0x47411e){if(_0x47411e){return _0x47411e[_0xd0ed('0x20')]()[_0xd0ed('0x1f')](function(){_0x252399[_0xd0ed('0x13')](0xcc)[_0xd0ed('0x21')]();});}};}function handleEntityNotFound(_0x45affa,_0x1d9f43){return function(_0x13cad9){if(!_0x13cad9){_0x45affa['sendStatus'](0x194);}return _0x13cad9;};}function handleError(_0x2ed97a,_0xd9f2af){_0xd9f2af=_0xd9f2af||0x1f4;return function(_0x253a64){logger[_0xd0ed('0x22')](_0x253a64[_0xd0ed('0x23')]);if(_0x253a64[_0xd0ed('0x24')]){delete _0x253a64[_0xd0ed('0x24')];}_0x2ed97a[_0xd0ed('0x13')](_0xd9f2af)[_0xd0ed('0x25')](_0x253a64);};}exports[_0xd0ed('0x26')]=function(_0x166a2e,_0x3be0ae){var _0x26c275={},_0xe40bca={},_0x2626e6={'count':0x0,'rows':[]};var _0x1dc8f1=_['map'](db[_0xd0ed('0x27')][_0xd0ed('0x28')],function(_0x128b20){return{'name':_0x128b20[_0xd0ed('0x29')],'type':_0x128b20[_0xd0ed('0x2a')]['key']};});_0xe40bca[_0xd0ed('0x2b')]=_['map'](_0x1dc8f1,_0xd0ed('0x24'));_0xe40bca['query']=_[_0xd0ed('0x2c')](_0x166a2e[_0xd0ed('0x2d')]);_0xe40bca['filters']=_[_0xd0ed('0x2e')](_0xe40bca['model'],_0xe40bca['query']);_0x26c275[_0xd0ed('0x2f')]=_[_0xd0ed('0x2e')](_0xe40bca[_0xd0ed('0x2b')],qs[_0xd0ed('0x30')](_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x30')]));_0x26c275[_0xd0ed('0x2f')]=_0x26c275['attributes'][_0xd0ed('0x31')]?_0x26c275[_0xd0ed('0x2f')]:_0xe40bca[_0xd0ed('0x2b')];if(!_0x166a2e[_0xd0ed('0x2d')]['hasOwnProperty'](_0xd0ed('0x32'))){_0x26c275['limit']=qs['limit'](_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x15')]);_0x26c275[_0xd0ed('0x18')]=qs[_0xd0ed('0x18')](_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x18')]);}_0x26c275[_0xd0ed('0x33')]=qs[_0xd0ed('0x34')](_0x166a2e['query']['sort']);_0x26c275[_0xd0ed('0x35')]=qs[_0xd0ed('0x36')](_[_0xd0ed('0x37')](_0x166a2e['query'],_0xe40bca[_0xd0ed('0x36')]),_0x1dc8f1);if(_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x38')]){_0x26c275[_0xd0ed('0x35')]=_['merge'](_0x26c275[_0xd0ed('0x35')],{'$or':_[_0xd0ed('0x39')](_0x1dc8f1,function(_0x1a508e){if(_0x1a508e[_0xd0ed('0x2a')]!==_0xd0ed('0x3a')){var _0x4494de={};_0x4494de[_0x1a508e[_0xd0ed('0x24')]]={'$like':'%'+_0x166a2e[_0xd0ed('0x2d')]['filter']+'%'};return _0x4494de;}})});}_0x26c275=_[_0xd0ed('0x3b')]({},_0x26c275,_0x166a2e[_0xd0ed('0x3c')]);var _0x18d17a={'where':_0x26c275[_0xd0ed('0x35')]};return db['MailSubstatus'][_0xd0ed('0x17')](_0x18d17a)[_0xd0ed('0x1f')](function(_0xc31a16){_0x2626e6[_0xd0ed('0x17')]=_0xc31a16;if(_0x166a2e[_0xd0ed('0x2d')]['includeAll']){_0x26c275[_0xd0ed('0x3d')]=[{'all':!![]}];}return db[_0xd0ed('0x27')][_0xd0ed('0x3e')](_0x26c275);})['then'](function(_0x17fec7){_0x2626e6[_0xd0ed('0x3f')]=_0x17fec7;return _0x2626e6;})['then'](respondWithFilteredResult(_0x3be0ae,_0x26c275))['catch'](handleError(_0x3be0ae,null));};exports[_0xd0ed('0x40')]=function(_0x3a90e5,_0x864fa2){var _0x2af13e={'raw':!![],'where':{'id':_0x3a90e5[_0xd0ed('0x41')]['id']}},_0x1dabc9={};_0x1dabc9['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0x1dabc9['query']=_[_0xd0ed('0x2c')](_0x3a90e5[_0xd0ed('0x2d')]);_0x1dabc9[_0xd0ed('0x36')]=_['intersection'](_0x1dabc9[_0xd0ed('0x2b')],_0x1dabc9[_0xd0ed('0x2d')]);_0x2af13e['attributes']=_[_0xd0ed('0x2e')](_0x1dabc9[_0xd0ed('0x2b')],qs['fields'](_0x3a90e5[_0xd0ed('0x2d')][_0xd0ed('0x30')]));_0x2af13e[_0xd0ed('0x2f')]=_0x2af13e['attributes'][_0xd0ed('0x31')]?_0x2af13e[_0xd0ed('0x2f')]:_0x1dabc9['model'];if(_0x3a90e5[_0xd0ed('0x2d')][_0xd0ed('0x42')]){_0x2af13e[_0xd0ed('0x3d')]=[{'all':!![]}];}_0x2af13e=_[_0xd0ed('0x3b')]({},_0x2af13e,_0x3a90e5['options']);return db[_0xd0ed('0x27')][_0xd0ed('0x43')](_0x2af13e)['then'](handleEntityNotFound(_0x864fa2,null))['then'](respondWithResult(_0x864fa2,null))[_0xd0ed('0x44')](handleError(_0x864fa2,null));};exports[_0xd0ed('0x45')]=function(_0x511b9c,_0x3fc5bd){return db['MailSubstatus'][_0xd0ed('0x45')](_0x511b9c[_0xd0ed('0x46')],{})[_0xd0ed('0x1f')](respondWithResult(_0x3fc5bd,0xc9))[_0xd0ed('0x44')](handleError(_0x3fc5bd,null));};exports['update']=function(_0x365cf0,_0x1c74f4){if(_0x365cf0[_0xd0ed('0x46')]['id']){delete _0x365cf0[_0xd0ed('0x46')]['id'];}return db['MailSubstatus'][_0xd0ed('0x43')]({'where':{'id':_0x365cf0[_0xd0ed('0x41')]['id']}})[_0xd0ed('0x1f')](handleEntityNotFound(_0x1c74f4,null))[_0xd0ed('0x1f')](saveUpdates(_0x365cf0['body'],null))['then'](respondWithResult(_0x1c74f4,null))[_0xd0ed('0x44')](handleError(_0x1c74f4,null));};exports[_0xd0ed('0x20')]=function(_0x119f45,_0x589a37){return db[_0xd0ed('0x27')][_0xd0ed('0x43')]({'where':{'id':_0x119f45[_0xd0ed('0x41')]['id']}})[_0xd0ed('0x1f')](handleEntityNotFound(_0x589a37,null))[_0xd0ed('0x1f')](removeEntity(_0x589a37,null))['catch'](handleError(_0x589a37,null));};exports[_0xd0ed('0x47')]=function(_0x1f506d,_0x17c883){return db[_0xd0ed('0x27')][_0xd0ed('0x47')]()['then'](respondWithResult(_0x17c883,null))[_0xd0ed('0x44')](handleError(_0x17c883,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index cdabd1d..166f208 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42ff=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x36af61,_0x311023){var _0x34a90d=function(_0x478cb0){while(--_0x478cb0){_0x36af61['push'](_0x36af61['shift']());}};_0x34a90d(++_0x311023);}(_0x42ff,0x11e));var _0xf42f=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x42ff[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0xf42f('0x0'));var MailSubstatus=require(_0xf42f('0x1'))['db'][_0xf42f('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf42f('0x3')](0x0);var events={'afterUpdate':_0xf42f('0x4')};function emitEvent(_0x4875ac){return function(_0x57c9a0,_0x110d97,_0x206c5c){MailSubstatusEvents[_0xf42f('0x5')](_0x4875ac+':'+_0x57c9a0['id'],_0x57c9a0);MailSubstatusEvents[_0xf42f('0x5')](_0x4875ac,_0x57c9a0);_0x206c5c(null);};}for(var e in events){if(events[_0xf42f('0x6')](e)){var event=events[e];MailSubstatus[_0xf42f('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x6479=['setMaxListeners','emit','hasOwnProperty','hook','exports','MailSubstatus'];(function(_0x24bd93,_0x38f451){var _0x55f35d=function(_0x320132){while(--_0x320132){_0x24bd93['push'](_0x24bd93['shift']());}};_0x55f35d(++_0x38f451);}(_0x6479,0x83));var _0x9647=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x6479[_0x274dd7];return _0x148829;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x9647('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9647('0x1')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x5bf152){return function(_0x72541f,_0x28ed82,_0x3a41b9){MailSubstatusEvents[_0x9647('0x2')](_0x5bf152+':'+_0x72541f['id'],_0x72541f);MailSubstatusEvents['emit'](_0x5bf152,_0x72541f);_0x3a41b9(null);};}for(var e in events){if(events[_0x9647('0x3')](e)){var event=events[e];MailSubstatus[_0x9647('0x4')](e,emitEvent(event));}}module[_0x9647('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 03c8c01..4e360e1 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34d1=['MailSubstatus','Condition','update','mailSubstatus','_previousDataValues','name','then','catch','exports','models','define'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x34d1,0x189));var _0x134d=function(_0x2ddbc6,_0x60e5a4){_0x2ddbc6=_0x2ddbc6-0x0;var _0x35170d=_0x34d1[_0x2ddbc6];return _0x35170d;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x134d('0x0')]=function(_0x4cb6ca){var _0x38c7e5=_0x4cb6ca[_0x134d('0x1')];return _0x4cb6ca[_0x134d('0x2')](_0x134d('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x12dab7,_0x3be087,_0x5b6b2c){return _0x38c7e5[_0x134d('0x4')][_0x134d('0x5')]({'value':_0x12dab7['name']},{'where':{'field':_0x134d('0x6'),'value':_0x12dab7[_0x134d('0x7')][_0x134d('0x8')]}})[_0x134d('0x9')](function(){_0x5b6b2c();})[_0x134d('0xa')](function(_0x593e54){_0x5b6b2c(_0x593e54);});}}});}; \ No newline at end of file +var _0x09b3=['define','MailSubstatus','mail_substatuses','Condition','update','name','then','catch','./mailSubstatus.attributes','models'];(function(_0xe96887,_0x395a33){var _0x23cb6b=function(_0x5e5d30){while(--_0x5e5d30){_0xe96887['push'](_0xe96887['shift']());}};_0x23cb6b(++_0x395a33);}(_0x09b3,0x1f2));var _0x309b=function(_0x241c30,_0x19c789){_0x241c30=_0x241c30-0x0;var _0x117f1c=_0x09b3[_0x241c30];return _0x117f1c;};'use strict';var attributes=require(_0x309b('0x0'));module['exports']=function(_0x43a610){var _0x5699d5=_0x43a610[_0x309b('0x1')];return _0x43a610[_0x309b('0x2')](_0x309b('0x3'),attributes,{'tableName':_0x309b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5bfb4c,_0x1d7e1d,_0x2493f0){return _0x5699d5[_0x309b('0x5')][_0x309b('0x6')]({'value':_0x5bfb4c[_0x309b('0x7')]},{'where':{'field':'mailSubstatus','value':_0x5bfb4c['_previousDataValues'][_0x309b('0x7')]}})[_0x309b('0x8')](function(){_0x2493f0();})[_0x309b('0x9')](function(_0x572f20){_0x2493f0(_0x572f20);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e593759..8f7ce21 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fe9=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x9fe9,0x1e1));var _0x99fe=function(_0x371360,_0x355110){_0x371360=_0x371360-0x0;var _0x3dc4be=_0x9fe9[_0x371360];return _0x3dc4be;};'use strict';var _=require('lodash');var util=require(_0x99fe('0x0'));var moment=require('moment');var BPromise=require(_0x99fe('0x1'));var rs=require(_0x99fe('0x2'));var fs=require('fs');var Redis=require(_0x99fe('0x3'));var db=require(_0x99fe('0x4'))['db'];var utils=require(_0x99fe('0x5'));var logger=require(_0x99fe('0x6'))(_0x99fe('0x7'));var config=require(_0x99fe('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3904ab,_0x1fc941,_0x3da151){return new BPromise(function(_0x4051c5,_0x48d841){return client[_0x99fe('0x9')](_0x3904ab,_0x3da151)[_0x99fe('0xa')](function(_0xda8ecf){logger[_0x99fe('0xb')](_0x99fe('0xc'),_0x1fc941,'request\x20sent');logger[_0x99fe('0xd')](_0x99fe('0xe'),_0x1fc941,_0x99fe('0xf'),JSON[_0x99fe('0x10')](_0xda8ecf));if(_0xda8ecf[_0x99fe('0x11')]){if(_0xda8ecf[_0x99fe('0x11')]['code']===0x1f4){logger[_0x99fe('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1fc941,_0xda8ecf[_0x99fe('0x11')]['message']);return _0x48d841(_0xda8ecf[_0x99fe('0x11')]['message']);}logger['error'](_0x99fe('0xc'),_0x1fc941,_0xda8ecf[_0x99fe('0x11')][_0x99fe('0x12')]);return _0x4051c5(_0xda8ecf[_0x99fe('0x11')][_0x99fe('0x12')]);}else{logger[_0x99fe('0xb')](_0x99fe('0xc'),_0x1fc941,'request\x20sent');_0x4051c5(_0xda8ecf['result']['message']);}})[_0x99fe('0x13')](function(_0x25e45c){logger[_0x99fe('0x11')](_0x99fe('0xc'),_0x1fc941,_0x25e45c);_0x48d841(_0x25e45c);});});} \ No newline at end of file +var _0x3542=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4b144a,_0x3dd885){var _0x2f7d2b=function(_0x2888f6){while(--_0x2888f6){_0x4b144a['push'](_0x4b144a['shift']());}};_0x2f7d2b(++_0x3dd885);}(_0x3542,0xf9));var _0x2354=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0x3542[_0x47643e];return _0x2aa5db;};'use strict';var _=require(_0x2354('0x0'));var util=require(_0x2354('0x1'));var moment=require(_0x2354('0x2'));var BPromise=require(_0x2354('0x3'));var rs=require(_0x2354('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2354('0x5'))['db'];var utils=require(_0x2354('0x6'));var logger=require('../../config/logger')(_0x2354('0x7'));var config=require(_0x2354('0x8'));var jayson=require(_0x2354('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2606d4,_0x58af72,_0x5e4d2d){return new BPromise(function(_0xc712e3,_0x155de2){return client[_0x2354('0xa')](_0x2606d4,_0x5e4d2d)[_0x2354('0xb')](function(_0x5369e5){logger[_0x2354('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x58af72,_0x2354('0xd'));logger[_0x2354('0xe')](_0x2354('0xf'),_0x58af72,_0x2354('0xd'),JSON[_0x2354('0x10')](_0x5369e5));if(_0x5369e5[_0x2354('0x11')]){if(_0x5369e5[_0x2354('0x11')][_0x2354('0x12')]===0x1f4){logger[_0x2354('0x11')](_0x2354('0x13'),_0x58af72,_0x5369e5['error'][_0x2354('0x14')]);return _0x155de2(_0x5369e5['error'][_0x2354('0x14')]);}logger[_0x2354('0x11')](_0x2354('0x13'),_0x58af72,_0x5369e5[_0x2354('0x11')][_0x2354('0x14')]);return _0xc712e3(_0x5369e5['error']['message']);}else{logger['info'](_0x2354('0x13'),_0x58af72,_0x2354('0xd'));_0xc712e3(_0x5369e5[_0x2354('0x15')][_0x2354('0x14')]);}})[_0x2354('0x16')](function(_0xc085f3){logger[_0x2354('0x11')](_0x2354('0x13'),_0x58af72,_0xc085f3);_0x155de2(_0xc085f3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 120b6a6..9fee11e 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb65a=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','destroy','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb65a,0xa0));var _0xab65=function(_0x30d6a4,_0x4a2580){_0x30d6a4=_0x30d6a4-0x0;var _0x48665d=_0xb65a[_0x30d6a4];return _0x48665d;};'use strict';var multer=require(_0xab65('0x0'));var util=require('util');var path=require(_0xab65('0x1'));var timeout=require(_0xab65('0x2'));var express=require(_0xab65('0x3'));var router=express[_0xab65('0x4')]();var fs_extra=require(_0xab65('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xab65('0x6'));var config=require(_0xab65('0x7'));var controller=require(_0xab65('0x8'));router[_0xab65('0x9')]('/',auth[_0xab65('0xa')](),controller[_0xab65('0xb')]);router['get'](_0xab65('0xc'),auth[_0xab65('0xa')](),controller['describe']);router['get'](_0xab65('0xd'),auth[_0xab65('0xa')](),controller[_0xab65('0xe')]);router['post']('/',auth[_0xab65('0xa')](),controller[_0xab65('0xf')]);router[_0xab65('0x10')](_0xab65('0xd'),auth[_0xab65('0xa')](),controller['update']);router['delete'](_0xab65('0xd'),auth[_0xab65('0xa')](),controller[_0xab65('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3c8a=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x3c8a,0xa7));var _0xa3c8=function(_0x5d0c1e,_0x132dd6){_0x5d0c1e=_0x5d0c1e-0x0;var _0x3ad7b0=_0x3c8a[_0x5d0c1e];return _0x3ad7b0;};'use strict';var multer=require('multer');var util=require(_0xa3c8('0x0'));var path=require(_0xa3c8('0x1'));var timeout=require(_0xa3c8('0x2'));var express=require('express');var router=express[_0xa3c8('0x3')]();var fs_extra=require(_0xa3c8('0x4'));var auth=require(_0xa3c8('0x5'));var interaction=require(_0xa3c8('0x6'));var config=require(_0xa3c8('0x7'));var controller=require(_0xa3c8('0x8'));router[_0xa3c8('0x9')]('/',auth[_0xa3c8('0xa')](),controller[_0xa3c8('0xb')]);router[_0xa3c8('0x9')]('/describe',auth[_0xa3c8('0xa')](),controller[_0xa3c8('0xc')]);router[_0xa3c8('0x9')](_0xa3c8('0xd'),auth[_0xa3c8('0xa')](),controller[_0xa3c8('0xe')]);router[_0xa3c8('0xf')]('/',auth[_0xa3c8('0xa')](),controller[_0xa3c8('0x10')]);router[_0xa3c8('0x11')](_0xa3c8('0xd'),auth[_0xa3c8('0xa')](),controller[_0xa3c8('0x12')]);router[_0xa3c8('0x13')](_0xa3c8('0xd'),auth[_0xa3c8('0xa')](),controller['destroy']);module[_0xa3c8('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index e414ce7..04a9213 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3e9025,_0x550b45){_0x3e9025=_0x3e9025-0x0;var _0x30495f=_0xb43b[_0x3e9025];return _0x30495f;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3c3ec7,_0x309339){var _0x23e52c=function(_0x34cd19){while(--_0x34cd19){_0x3c3ec7['push'](_0x3c3ec7['shift']());}};_0x23e52c(++_0x309339);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ebe78f9..b622724 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7071=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailTransferReport','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x7071,0x119));var _0x1707=function(_0x4a7449,_0x29ed36){_0x4a7449=_0x4a7449-0x0;var _0x14d403=_0x7071[_0x4a7449];return _0x14d403;};'use strict';var emlformat=require(_0x1707('0x0'));var rimraf=require(_0x1707('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1707('0x2'));var moment=require(_0x1707('0x3'));var BPromise=require(_0x1707('0x4'));var Mustache=require(_0x1707('0x5'));var util=require(_0x1707('0x6'));var path=require(_0x1707('0x7'));var sox=require(_0x1707('0x8'));var csv=require(_0x1707('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1707('0xa'));var squel=require('squel');var crypto=require(_0x1707('0xb'));var jsforce=require(_0x1707('0xc'));var deskjs=require(_0x1707('0xd'));var toCsv=require(_0x1707('0x9'));var querystring=require(_0x1707('0xe'));var Papa=require('papaparse');var Redis=require(_0x1707('0xf'));var authService=require(_0x1707('0x10'));var qs=require(_0x1707('0x11'));var as=require(_0x1707('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1707('0x13'));var utils=require(_0x1707('0x14'));var config=require(_0x1707('0x15'));var licenseUtil=require(_0x1707('0x16'));var db=require(_0x1707('0x17'))['db'];function respondWithStatusCode(_0x25b59e,_0x5ce7b0){_0x5ce7b0=_0x5ce7b0||0xcc;return function(_0x7c87b0){if(_0x7c87b0){return _0x25b59e[_0x1707('0x18')](_0x5ce7b0);}return _0x25b59e['status'](_0x5ce7b0)[_0x1707('0x19')]();};}function respondWithResult(_0x4d30d6,_0x1cf19c){_0x1cf19c=_0x1cf19c||0xc8;return function(_0x4801cb){if(_0x4801cb){return _0x4d30d6[_0x1707('0x1a')](_0x1cf19c)[_0x1707('0x1b')](_0x4801cb);}};}function respondWithFilteredResult(_0x107668,_0x49d813){return function(_0x2f7480){if(_0x2f7480){var _0x4c1bed=typeof _0x49d813['offset']===_0x1707('0x1c')&&typeof _0x49d813[_0x1707('0x1d')]===_0x1707('0x1c');var _0x2e2ad8=_0x2f7480['count'];var _0x1db320=_0x4c1bed?0x0:_0x49d813['offset'];var _0x4bd9ff=_0x4c1bed?_0x2f7480[_0x1707('0x1e')]:_0x49d813[_0x1707('0x1f')]+_0x49d813[_0x1707('0x1d')];var _0x47d3e1;if(_0x4bd9ff>=_0x2e2ad8){_0x4bd9ff=_0x2e2ad8;_0x47d3e1=0xc8;}else{_0x47d3e1=0xce;}_0x107668[_0x1707('0x1a')](_0x47d3e1);return _0x107668[_0x1707('0x20')]('Content-Range',_0x1db320+'-'+_0x4bd9ff+'/'+_0x2e2ad8)[_0x1707('0x1b')](_0x2f7480);}return null;};}function patchUpdates(_0x545b04){return function(_0x1c2b10){try{jsonpatch[_0x1707('0x21')](_0x1c2b10,_0x545b04,!![]);}catch(_0x314509){return BPromise[_0x1707('0x22')](_0x314509);}return _0x1c2b10[_0x1707('0x23')]();};}function saveUpdates(_0x576dcb,_0x12aaf7){return function(_0x4beaeb){if(_0x4beaeb){return _0x4beaeb[_0x1707('0x24')](_0x576dcb)[_0x1707('0x25')](function(_0x48c2e2){return _0x48c2e2;});}return null;};}function removeEntity(_0x1e9be3,_0x430407){return function(_0x2ad443){if(_0x2ad443){return _0x2ad443[_0x1707('0x26')]()[_0x1707('0x25')](function(){_0x1e9be3[_0x1707('0x1a')](0xcc)[_0x1707('0x19')]();});}};}function handleEntityNotFound(_0x2737c5,_0x35da3e){return function(_0x357e96){if(!_0x357e96){_0x2737c5['sendStatus'](0x194);}return _0x357e96;};}function handleError(_0x2d1152,_0x53bffd){_0x53bffd=_0x53bffd||0x1f4;return function(_0x19204b){logger[_0x1707('0x27')](_0x19204b[_0x1707('0x28')]);if(_0x19204b[_0x1707('0x29')]){delete _0x19204b[_0x1707('0x29')];}_0x2d1152[_0x1707('0x1a')](_0x53bffd)['send'](_0x19204b);};}exports[_0x1707('0x2a')]=function(_0x4aa468,_0x136a10){var _0x528c2e={},_0x3a3e58={},_0x14d36e={'count':0x0,'rows':[]};var _0x3ea9ab=_[_0x1707('0x2b')](db[_0x1707('0x2c')]['rawAttributes'],function(_0x195c9b){return{'name':_0x195c9b['fieldName'],'type':_0x195c9b[_0x1707('0x2d')]['key']};});_0x3a3e58[_0x1707('0x2e')]=_['map'](_0x3ea9ab,'name');_0x3a3e58[_0x1707('0x2f')]=_[_0x1707('0x30')](_0x4aa468[_0x1707('0x2f')]);_0x3a3e58[_0x1707('0x31')]=_[_0x1707('0x32')](_0x3a3e58[_0x1707('0x2e')],_0x3a3e58[_0x1707('0x2f')]);_0x528c2e[_0x1707('0x33')]=_[_0x1707('0x32')](_0x3a3e58[_0x1707('0x2e')],qs['fields'](_0x4aa468[_0x1707('0x2f')][_0x1707('0x34')]));_0x528c2e[_0x1707('0x33')]=_0x528c2e[_0x1707('0x33')][_0x1707('0x35')]?_0x528c2e['attributes']:_0x3a3e58[_0x1707('0x2e')];if(!_0x4aa468[_0x1707('0x2f')][_0x1707('0x36')](_0x1707('0x37'))){_0x528c2e[_0x1707('0x1d')]=qs['limit'](_0x4aa468[_0x1707('0x2f')][_0x1707('0x1d')]);_0x528c2e[_0x1707('0x1f')]=qs['offset'](_0x4aa468['query'][_0x1707('0x1f')]);}_0x528c2e[_0x1707('0x38')]=qs[_0x1707('0x39')](_0x4aa468['query'][_0x1707('0x39')]);_0x528c2e[_0x1707('0x3a')]=qs[_0x1707('0x31')](_[_0x1707('0x3b')](_0x4aa468[_0x1707('0x2f')],_0x3a3e58['filters']),_0x3ea9ab);if(_0x4aa468[_0x1707('0x2f')][_0x1707('0x3c')]){_0x528c2e[_0x1707('0x3a')]=_[_0x1707('0x3d')](_0x528c2e[_0x1707('0x3a')],{'$or':_[_0x1707('0x2b')](_0x3ea9ab,function(_0xc24175){if(_0xc24175['type']!==_0x1707('0x3e')){var _0x19730e={};_0x19730e[_0xc24175[_0x1707('0x29')]]={'$like':'%'+_0x4aa468['query'][_0x1707('0x3c')]+'%'};return _0x19730e;}})});}_0x528c2e=_[_0x1707('0x3d')]({},_0x528c2e,_0x4aa468[_0x1707('0x3f')]);var _0x167249={'where':_0x528c2e[_0x1707('0x3a')]};return db['MailTransferReport'][_0x1707('0x1e')](_0x167249)['then'](function(_0x1e986d){_0x14d36e[_0x1707('0x1e')]=_0x1e986d;if(_0x4aa468[_0x1707('0x2f')][_0x1707('0x40')]){_0x528c2e['include']=[{'all':!![]}];}return db[_0x1707('0x2c')]['findAll'](_0x528c2e);})[_0x1707('0x25')](function(_0x3bff74){_0x14d36e[_0x1707('0x41')]=_0x3bff74;return _0x14d36e;})[_0x1707('0x25')](respondWithFilteredResult(_0x136a10,_0x528c2e))[_0x1707('0x42')](handleError(_0x136a10,null));};exports[_0x1707('0x43')]=function(_0x3d231a,_0x5812a1){var _0x3732de={'raw':!![],'where':{'id':_0x3d231a[_0x1707('0x44')]['id']}},_0x4274d5={};_0x4274d5[_0x1707('0x2e')]=_[_0x1707('0x30')](db[_0x1707('0x2c')][_0x1707('0x45')]);_0x4274d5[_0x1707('0x2f')]=_[_0x1707('0x30')](_0x3d231a[_0x1707('0x2f')]);_0x4274d5[_0x1707('0x31')]=_['intersection'](_0x4274d5[_0x1707('0x2e')],_0x4274d5[_0x1707('0x2f')]);_0x3732de[_0x1707('0x33')]=_[_0x1707('0x32')](_0x4274d5[_0x1707('0x2e')],qs[_0x1707('0x34')](_0x3d231a[_0x1707('0x2f')][_0x1707('0x34')]));_0x3732de['attributes']=_0x3732de[_0x1707('0x33')]['length']?_0x3732de[_0x1707('0x33')]:_0x4274d5[_0x1707('0x2e')];if(_0x3d231a[_0x1707('0x2f')]['includeAll']){_0x3732de[_0x1707('0x46')]=[{'all':!![]}];}_0x3732de=_[_0x1707('0x3d')]({},_0x3732de,_0x3d231a[_0x1707('0x3f')]);return db['MailTransferReport'][_0x1707('0x47')](_0x3732de)[_0x1707('0x25')](handleEntityNotFound(_0x5812a1,null))[_0x1707('0x25')](respondWithResult(_0x5812a1,null))[_0x1707('0x42')](handleError(_0x5812a1,null));};exports[_0x1707('0x48')]=function(_0x165a0d,_0xb87b80){return db[_0x1707('0x2c')]['create'](_0x165a0d[_0x1707('0x49')],{})[_0x1707('0x25')](respondWithResult(_0xb87b80,0xc9))[_0x1707('0x42')](handleError(_0xb87b80,null));};exports[_0x1707('0x24')]=function(_0x351647,_0x2719e3){if(_0x351647[_0x1707('0x49')]['id']){delete _0x351647[_0x1707('0x49')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x351647[_0x1707('0x44')]['id']}})[_0x1707('0x25')](handleEntityNotFound(_0x2719e3,null))[_0x1707('0x25')](saveUpdates(_0x351647[_0x1707('0x49')],null))[_0x1707('0x25')](respondWithResult(_0x2719e3,null))[_0x1707('0x42')](handleError(_0x2719e3,null));};exports['destroy']=function(_0x1d6fb0,_0x23484b){return db[_0x1707('0x2c')][_0x1707('0x47')]({'where':{'id':_0x1d6fb0['params']['id']}})['then'](handleEntityNotFound(_0x23484b,null))[_0x1707('0x25')](removeEntity(_0x23484b,null))[_0x1707('0x42')](handleError(_0x23484b,null));};exports[_0x1707('0x4a')]=function(_0x588d98,_0xb4c604){return db[_0x1707('0x2c')][_0x1707('0x4a')]()['then'](respondWithResult(_0xb4c604,null))['catch'](handleError(_0xb4c604,null));}; \ No newline at end of file +var _0x900c=['update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','MailTransferReport','fieldName','type','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','options','includeAll','include','rows','catch','show','rawAttributes','fields','find','create','body'];(function(_0x1d9d73,_0x1f6d33){var _0x1769c6=function(_0x230159){while(--_0x230159){_0x1d9d73['push'](_0x1d9d73['shift']());}};_0x1769c6(++_0x1f6d33);}(_0x900c,0x12a));var _0xc900=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x900c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc900('0x0'));var rimraf=require(_0xc900('0x1'));var zipdir=require(_0xc900('0x2'));var jsonpatch=require(_0xc900('0x3'));var rp=require(_0xc900('0x4'));var moment=require(_0xc900('0x5'));var BPromise=require(_0xc900('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc900('0x7'));var sox=require(_0xc900('0x8'));var csv=require(_0xc900('0x9'));var ejs=require(_0xc900('0xa'));var fs=require('fs');var fs_extra=require(_0xc900('0xb'));var _=require(_0xc900('0xc'));var squel=require(_0xc900('0xd'));var crypto=require(_0xc900('0xe'));var jsforce=require(_0xc900('0xf'));var deskjs=require(_0xc900('0x10'));var toCsv=require(_0xc900('0x9'));var querystring=require(_0xc900('0x11'));var Papa=require(_0xc900('0x12'));var Redis=require(_0xc900('0x13'));var authService=require(_0xc900('0x14'));var qs=require(_0xc900('0x15'));var as=require(_0xc900('0x16'));var hardwareService=require(_0xc900('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xc900('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc900('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c9f15,_0x2ce423){_0x2ce423=_0x2ce423||0xcc;return function(_0x42bbe1){if(_0x42bbe1){return _0x4c9f15[_0xc900('0x1a')](_0x2ce423);}return _0x4c9f15['status'](_0x2ce423)[_0xc900('0x1b')]();};}function respondWithResult(_0x5264c6,_0xc2c09c){_0xc2c09c=_0xc2c09c||0xc8;return function(_0x8b5bd4){if(_0x8b5bd4){return _0x5264c6[_0xc900('0x1c')](_0xc2c09c)['json'](_0x8b5bd4);}};}function respondWithFilteredResult(_0x101210,_0x7e1f15){return function(_0x2f6311){if(_0x2f6311){var _0x3bfcd8=typeof _0x7e1f15[_0xc900('0x1d')]===_0xc900('0x1e')&&typeof _0x7e1f15[_0xc900('0x1f')]==='undefined';var _0x4c5080=_0x2f6311[_0xc900('0x20')];var _0x2b4ee3=_0x3bfcd8?0x0:_0x7e1f15['offset'];var _0x2f96ce=_0x3bfcd8?_0x2f6311[_0xc900('0x20')]:_0x7e1f15[_0xc900('0x1d')]+_0x7e1f15[_0xc900('0x1f')];var _0x286734;if(_0x2f96ce>=_0x4c5080){_0x2f96ce=_0x4c5080;_0x286734=0xc8;}else{_0x286734=0xce;}_0x101210[_0xc900('0x1c')](_0x286734);return _0x101210[_0xc900('0x21')](_0xc900('0x22'),_0x2b4ee3+'-'+_0x2f96ce+'/'+_0x4c5080)[_0xc900('0x23')](_0x2f6311);}return null;};}function patchUpdates(_0x27f46e){return function(_0x53dcbc){try{jsonpatch[_0xc900('0x24')](_0x53dcbc,_0x27f46e,!![]);}catch(_0x4cce42){return BPromise['reject'](_0x4cce42);}return _0x53dcbc[_0xc900('0x25')]();};}function saveUpdates(_0xc0775,_0x4e1d46){return function(_0x4e24bf){if(_0x4e24bf){return _0x4e24bf['update'](_0xc0775)[_0xc900('0x26')](function(_0x10b897){return _0x10b897;});}return null;};}function removeEntity(_0x3d8412,_0x520905){return function(_0x30c550){if(_0x30c550){return _0x30c550[_0xc900('0x27')]()[_0xc900('0x26')](function(){_0x3d8412[_0xc900('0x1c')](0xcc)[_0xc900('0x1b')]();});}};}function handleEntityNotFound(_0x2841c6,_0x5044b7){return function(_0x365aec){if(!_0x365aec){_0x2841c6[_0xc900('0x1a')](0x194);}return _0x365aec;};}function handleError(_0x125959,_0x5877e4){_0x5877e4=_0x5877e4||0x1f4;return function(_0x9edcd7){logger[_0xc900('0x28')](_0x9edcd7['stack']);if(_0x9edcd7[_0xc900('0x29')]){delete _0x9edcd7['name'];}_0x125959[_0xc900('0x1c')](_0x5877e4)[_0xc900('0x2a')](_0x9edcd7);};}exports[_0xc900('0x2b')]=function(_0x1faa20,_0x2c9c1b){var _0x5eba9c={},_0x5cef98={},_0xc123b={'count':0x0,'rows':[]};var _0xf8cce9=_['map'](db[_0xc900('0x2c')]['rawAttributes'],function(_0x160cc3){return{'name':_0x160cc3[_0xc900('0x2d')],'type':_0x160cc3[_0xc900('0x2e')]['key']};});_0x5cef98[_0xc900('0x2f')]=_['map'](_0xf8cce9,_0xc900('0x29'));_0x5cef98['query']=_[_0xc900('0x30')](_0x1faa20[_0xc900('0x31')]);_0x5cef98['filters']=_[_0xc900('0x32')](_0x5cef98[_0xc900('0x2f')],_0x5cef98[_0xc900('0x31')]);_0x5eba9c[_0xc900('0x33')]=_[_0xc900('0x32')](_0x5cef98[_0xc900('0x2f')],qs['fields'](_0x1faa20[_0xc900('0x31')]['fields']));_0x5eba9c[_0xc900('0x33')]=_0x5eba9c[_0xc900('0x33')][_0xc900('0x34')]?_0x5eba9c[_0xc900('0x33')]:_0x5cef98[_0xc900('0x2f')];if(!_0x1faa20[_0xc900('0x31')][_0xc900('0x35')](_0xc900('0x36'))){_0x5eba9c['limit']=qs['limit'](_0x1faa20['query'][_0xc900('0x1f')]);_0x5eba9c[_0xc900('0x1d')]=qs['offset'](_0x1faa20[_0xc900('0x31')]['offset']);}_0x5eba9c[_0xc900('0x37')]=qs['sort'](_0x1faa20[_0xc900('0x31')][_0xc900('0x38')]);_0x5eba9c[_0xc900('0x39')]=qs[_0xc900('0x3a')](_['pick'](_0x1faa20[_0xc900('0x31')],_0x5cef98['filters']),_0xf8cce9);if(_0x1faa20['query']['filter']){_0x5eba9c[_0xc900('0x39')]=_[_0xc900('0x3b')](_0x5eba9c[_0xc900('0x39')],{'$or':_[_0xc900('0x3c')](_0xf8cce9,function(_0x3bd12c){if(_0x3bd12c[_0xc900('0x2e')]!=='VIRTUAL'){var _0x211652={};_0x211652[_0x3bd12c[_0xc900('0x29')]]={'$like':'%'+_0x1faa20['query']['filter']+'%'};return _0x211652;}})});}_0x5eba9c=_['merge']({},_0x5eba9c,_0x1faa20[_0xc900('0x3d')]);var _0x3f803d={'where':_0x5eba9c[_0xc900('0x39')]};return db[_0xc900('0x2c')][_0xc900('0x20')](_0x3f803d)['then'](function(_0xe72f88){_0xc123b[_0xc900('0x20')]=_0xe72f88;if(_0x1faa20[_0xc900('0x31')][_0xc900('0x3e')]){_0x5eba9c[_0xc900('0x3f')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x5eba9c);})['then'](function(_0x4809d2){_0xc123b[_0xc900('0x40')]=_0x4809d2;return _0xc123b;})[_0xc900('0x26')](respondWithFilteredResult(_0x2c9c1b,_0x5eba9c))[_0xc900('0x41')](handleError(_0x2c9c1b,null));};exports[_0xc900('0x42')]=function(_0xd3b0e2,_0x25366c){var _0x21b3e1={'raw':!![],'where':{'id':_0xd3b0e2['params']['id']}},_0x130ca0={};_0x130ca0[_0xc900('0x2f')]=_[_0xc900('0x30')](db[_0xc900('0x2c')][_0xc900('0x43')]);_0x130ca0[_0xc900('0x31')]=_[_0xc900('0x30')](_0xd3b0e2[_0xc900('0x31')]);_0x130ca0[_0xc900('0x3a')]=_['intersection'](_0x130ca0['model'],_0x130ca0[_0xc900('0x31')]);_0x21b3e1[_0xc900('0x33')]=_[_0xc900('0x32')](_0x130ca0[_0xc900('0x2f')],qs[_0xc900('0x44')](_0xd3b0e2['query'][_0xc900('0x44')]));_0x21b3e1[_0xc900('0x33')]=_0x21b3e1[_0xc900('0x33')][_0xc900('0x34')]?_0x21b3e1[_0xc900('0x33')]:_0x130ca0[_0xc900('0x2f')];if(_0xd3b0e2['query'][_0xc900('0x3e')]){_0x21b3e1[_0xc900('0x3f')]=[{'all':!![]}];}_0x21b3e1=_[_0xc900('0x3b')]({},_0x21b3e1,_0xd3b0e2[_0xc900('0x3d')]);return db['MailTransferReport'][_0xc900('0x45')](_0x21b3e1)['then'](handleEntityNotFound(_0x25366c,null))[_0xc900('0x26')](respondWithResult(_0x25366c,null))[_0xc900('0x41')](handleError(_0x25366c,null));};exports[_0xc900('0x46')]=function(_0x9a8ff1,_0xa5d96e){return db[_0xc900('0x2c')][_0xc900('0x46')](_0x9a8ff1[_0xc900('0x47')],{})[_0xc900('0x26')](respondWithResult(_0xa5d96e,0xc9))[_0xc900('0x41')](handleError(_0xa5d96e,null));};exports[_0xc900('0x48')]=function(_0x1e5f84,_0x434d35){if(_0x1e5f84[_0xc900('0x47')]['id']){delete _0x1e5f84[_0xc900('0x47')]['id'];}return db[_0xc900('0x2c')][_0xc900('0x45')]({'where':{'id':_0x1e5f84['params']['id']}})[_0xc900('0x26')](handleEntityNotFound(_0x434d35,null))[_0xc900('0x26')](saveUpdates(_0x1e5f84[_0xc900('0x47')],null))[_0xc900('0x26')](respondWithResult(_0x434d35,null))['catch'](handleError(_0x434d35,null));};exports['destroy']=function(_0x3d1d16,_0x1b2f39){return db['MailTransferReport'][_0xc900('0x45')]({'where':{'id':_0x3d1d16[_0xc900('0x49')]['id']}})[_0xc900('0x26')](handleEntityNotFound(_0x1b2f39,null))[_0xc900('0x26')](removeEntity(_0x1b2f39,null))[_0xc900('0x41')](handleError(_0x1b2f39,null));};exports['describe']=function(_0x43b5aa,_0x485b28){return db[_0xc900('0x2c')]['describe']()[_0xc900('0x26')](respondWithResult(_0x485b28,null))[_0xc900('0x41')](handleError(_0x485b28,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 62d8148..7e9a7fb 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aa3=['lodash','util','api','moment','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x4aa3,0x174));var _0x34aa=function(_0x266a3c,_0x59bf4a){_0x266a3c=_0x266a3c-0x0;var _0x5b09a0=_0x4aa3[_0x266a3c];return _0x5b09a0;};'use strict';var _=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var logger=require('../../config/logger')(_0x34aa('0x2'));var moment=require(_0x34aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x34aa('0x4'));var fs=require('fs');var path=require(_0x34aa('0x5'));var rimraf=require('rimraf');var config=require(_0x34aa('0x6'));var attributes=require(_0x34aa('0x7'));module[_0x34aa('0x8')]=function(_0x5a717c,_0x201f69){return _0x5a717c[_0x34aa('0x9')]('MailTransferReport',attributes,{'tableName':_0x34aa('0xa'),'paranoid':![],'indexes':[{'name':_0x34aa('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb1a=['rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xbb1a,0x14c));var _0xabb1=function(_0x43ed1b,_0x29a2dc){_0x43ed1b=_0x43ed1b-0x0;var _0x15fe5e=_0xbb1a[_0x43ed1b];return _0x15fe5e;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var logger=require(_0xabb1('0x2'))(_0xabb1('0x3'));var moment=require('moment');var BPromise=require(_0xabb1('0x4'));var rp=require(_0xabb1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabb1('0x6'));var config=require(_0xabb1('0x7'));var attributes=require(_0xabb1('0x8'));module['exports']=function(_0x2bfc3e,_0x426a6b){return _0x2bfc3e[_0xabb1('0x9')](_0xabb1('0xa'),attributes,{'tableName':_0xabb1('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xabb1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 11f9ada..33f058a 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeef8=['message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x7c596,_0x2bf61f){var _0x427fc0=function(_0x8d811f){while(--_0x8d811f){_0x7c596['push'](_0x7c596['shift']());}};_0x427fc0(++_0x2bf61f);}(_0xeef8,0x1bb));var _0x8eef=function(_0x15e6fa,_0x419f96){_0x15e6fa=_0x15e6fa-0x0;var _0x5138d3=_0xeef8[_0x15e6fa];return _0x5138d3;};'use strict';var _=require(_0x8eef('0x0'));var util=require(_0x8eef('0x1'));var moment=require('moment');var BPromise=require(_0x8eef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8eef('0x3'));var db=require(_0x8eef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eef('0x5'))(_0x8eef('0x6'));var config=require('../../config/environment');var jayson=require(_0x8eef('0x7'));var client=jayson[_0x8eef('0x8')][_0x8eef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3219d3,_0x18d1e5,_0x3e9743){return new BPromise(function(_0x3d3655,_0x4b1781){return client[_0x8eef('0xa')](_0x3219d3,_0x3e9743)[_0x8eef('0xb')](function(_0x1903ec){logger[_0x8eef('0xc')](_0x8eef('0xd'),_0x18d1e5,_0x8eef('0xe'));logger[_0x8eef('0xf')](_0x8eef('0x10'),_0x18d1e5,_0x8eef('0xe'),JSON[_0x8eef('0x11')](_0x1903ec));if(_0x1903ec[_0x8eef('0x12')]){if(_0x1903ec[_0x8eef('0x12')]['code']===0x1f4){logger[_0x8eef('0x12')](_0x8eef('0xd'),_0x18d1e5,_0x1903ec[_0x8eef('0x12')]['message']);return _0x4b1781(_0x1903ec['error']['message']);}logger['error'](_0x8eef('0xd'),_0x18d1e5,_0x1903ec[_0x8eef('0x12')][_0x8eef('0x13')]);return _0x3d3655(_0x1903ec[_0x8eef('0x12')][_0x8eef('0x13')]);}else{logger[_0x8eef('0xc')](_0x8eef('0xd'),_0x18d1e5,_0x8eef('0xe'));_0x3d3655(_0x1903ec['result'][_0x8eef('0x13')]);}})[_0x8eef('0x14')](function(_0x5d11ef){logger[_0x8eef('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x18d1e5,_0x5d11ef);_0x4b1781(_0x5d11ef);});});} \ No newline at end of file +var _0x142a=['error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x520945,_0x28b144){var _0x17067a=function(_0x191ae1){while(--_0x191ae1){_0x520945['push'](_0x520945['shift']());}};_0x17067a(++_0x28b144);}(_0x142a,0x72));var _0xa142=function(_0x5d1817,_0x4b303a){_0x5d1817=_0x5d1817-0x0;var _0x5700e7=_0x142a[_0x5d1817];return _0x5700e7;};'use strict';var _=require(_0xa142('0x0'));var util=require(_0xa142('0x1'));var moment=require('moment');var BPromise=require(_0xa142('0x2'));var rs=require(_0xa142('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa142('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa142('0x5'))(_0xa142('0x6'));var config=require(_0xa142('0x7'));var jayson=require(_0xa142('0x8'));var client=jayson[_0xa142('0x9')][_0xa142('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f38c,_0x65e75f,_0x546fff){return new BPromise(function(_0x1dde30,_0x26ad49){return client[_0xa142('0xb')](_0x30f38c,_0x546fff)[_0xa142('0xc')](function(_0x13a585){logger[_0xa142('0xd')](_0xa142('0xe'),_0x65e75f,'request\x20sent');logger['debug'](_0xa142('0xf'),_0x65e75f,_0xa142('0x10'),JSON[_0xa142('0x11')](_0x13a585));if(_0x13a585['error']){if(_0x13a585[_0xa142('0x12')][_0xa142('0x13')]===0x1f4){logger['error'](_0xa142('0xe'),_0x65e75f,_0x13a585['error'][_0xa142('0x14')]);return _0x26ad49(_0x13a585[_0xa142('0x12')][_0xa142('0x14')]);}logger[_0xa142('0x12')](_0xa142('0xe'),_0x65e75f,_0x13a585['error'][_0xa142('0x14')]);return _0x1dde30(_0x13a585[_0xa142('0x12')]['message']);}else{logger[_0xa142('0xd')](_0xa142('0xe'),_0x65e75f,'request\x20sent');_0x1dde30(_0x13a585['result']['message']);}})[_0xa142('0x15')](function(_0x19a815){logger[_0xa142('0x12')](_0xa142('0xe'),_0x65e75f,_0x19a815);_0x26ad49(_0x19a815);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a74a1b6..6d62f57 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd197=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x52084c,_0x49d2e4){var _0x49f34d=function(_0x14f829){while(--_0x14f829){_0x52084c['push'](_0x52084c['shift']());}};_0x49f34d(++_0x49d2e4);}(_0xd197,0x196));var _0x7d19=function(_0xeaf632,_0x26d325){_0xeaf632=_0xeaf632-0x0;var _0x1134fe=_0xd197[_0xeaf632];return _0x1134fe;};'use strict';var multer=require(_0x7d19('0x0'));var util=require(_0x7d19('0x1'));var path=require(_0x7d19('0x2'));var timeout=require(_0x7d19('0x3'));var express=require('express');var router=express[_0x7d19('0x4')]();var fs_extra=require(_0x7d19('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d19('0x6'));var controller=require(_0x7d19('0x7'));router[_0x7d19('0x8')]('/',auth[_0x7d19('0x9')](),controller[_0x7d19('0xa')]);router[_0x7d19('0x8')](_0x7d19('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7d19('0x8')](_0x7d19('0xc'),auth[_0x7d19('0x9')](),controller[_0x7d19('0xd')]);router[_0x7d19('0xe')]('/',auth[_0x7d19('0x9')](),controller[_0x7d19('0xf')]);router[_0x7d19('0x10')](_0x7d19('0xc'),auth[_0x7d19('0x9')](),controller[_0x7d19('0x11')]);router[_0x7d19('0x12')](_0x7d19('0xc'),auth[_0x7d19('0x9')](),controller[_0x7d19('0x13')]);module[_0x7d19('0x14')]=router; \ No newline at end of file +var _0xee64=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','/describe','describe','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a458a,_0x4b141d){var _0x39a3dd=function(_0x342476){while(--_0x342476){_0x1a458a['push'](_0x1a458a['shift']());}};_0x39a3dd(++_0x4b141d);}(_0xee64,0xf9));var _0x4ee6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xee64[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4ee6('0x0'));var util=require(_0x4ee6('0x1'));var path=require(_0x4ee6('0x2'));var timeout=require(_0x4ee6('0x3'));var express=require(_0x4ee6('0x4'));var router=express[_0x4ee6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4ee6('0x7'));var controller=require(_0x4ee6('0x8'));router[_0x4ee6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ee6('0x9')](_0x4ee6('0xa'),auth['isAuthenticated'](),controller[_0x4ee6('0xb')]);router[_0x4ee6('0x9')](_0x4ee6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4ee6('0xd')]('/',auth[_0x4ee6('0xe')](),controller[_0x4ee6('0xf')]);router[_0x4ee6('0x10')](_0x4ee6('0xc'),auth[_0x4ee6('0xe')](),controller[_0x4ee6('0x11')]);router[_0x4ee6('0x12')](_0x4ee6('0xc'),auth['isAuthenticated'](),controller[_0x4ee6('0x13')]);module[_0x4ee6('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b9d6d3a..6130f3c 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffa=['INTEGER','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9ffa,0x145));var _0xa9ff=function(_0x2c43d4,_0x480f06){_0x2c43d4=_0x2c43d4-0x0;var _0xf7c812=_0x9ffa[_0x2c43d4];return _0xf7c812;};'use strict';var Sequelize=require(_0xa9ff('0x0'));var moment=require(_0xa9ff('0x1'));module[_0xa9ff('0x2')]={'channel':{'type':Sequelize[_0xa9ff('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xa9ff('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xa9ff('0x5')]},'exitAt':{'type':Sequelize[_0xa9ff('0x5')],'set':function(_0x491193){var _0x4ade79=moment(_0x491193);var _0x1edbcb=moment(this[_0xa9ff('0x6')]('enterAt'));var _0xa4cf76=_0x4ade79[_0xa9ff('0x7')](_0x1edbcb,_0xa9ff('0x8'));this[_0xa9ff('0x9')](_0xa9ff('0xa'),_0x491193);this['setDataValue'](_0xa9ff('0xb'),_0xa4cf76>=0x0?_0xa4cf76:null);}},'data1':{'type':Sequelize[_0xa9ff('0x3')],'comment':_0xa9ff('0xc')},'data2':{'type':Sequelize[_0xa9ff('0x3')],'comment':_0xa9ff('0xd')},'data3':{'type':Sequelize[_0xa9ff('0x3')],'comment':_0xa9ff('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xa9ff('0xf')},'data5':{'type':Sequelize[_0xa9ff('0x3')],'comment':_0xa9ff('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xa9ff('0x11')]},'uniqueid':{'type':Sequelize[_0xa9ff('0x3')]}}; \ No newline at end of file +var _0x9c50=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize'];(function(_0x389b48,_0x2a1760){var _0x1cc751=function(_0x1f314d){while(--_0x1f314d){_0x389b48['push'](_0x389b48['shift']());}};_0x1cc751(++_0x2a1760);}(_0x9c50,0xed));var _0x09c5=function(_0x1747ce,_0x49f4a7){_0x1747ce=_0x1747ce-0x0;var _0x421001=_0x9c50[_0x1747ce];return _0x421001;};'use strict';var Sequelize=require(_0x09c5('0x0'));var moment=require(_0x09c5('0x1'));module[_0x09c5('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x09c5('0x3')]},'interface':{'type':Sequelize[_0x09c5('0x3')]},'type':{'type':Sequelize[_0x09c5('0x3')],'defaultValue':_0x09c5('0x4'),'comment':_0x09c5('0x5')},'duration':{'type':Sequelize[_0x09c5('0x6')]},'enterAt':{'type':Sequelize[_0x09c5('0x7')]},'exitAt':{'type':Sequelize[_0x09c5('0x7')],'set':function(_0x5d969d){var _0x3ce8b8=moment(_0x5d969d);var _0x818bc9=moment(this['getDataValue']('enterAt'));var _0x35b2c8=_0x3ce8b8[_0x09c5('0x8')](_0x818bc9,_0x09c5('0x9'));this['setDataValue'](_0x09c5('0xa'),_0x5d969d);this[_0x09c5('0xb')](_0x09c5('0xc'),_0x35b2c8>=0x0?_0x35b2c8:null);}},'data1':{'type':Sequelize[_0x09c5('0x3')],'comment':_0x09c5('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x09c5('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x09c5('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0x09c5('0x10')},'data5':{'type':Sequelize[_0x09c5('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x09c5('0x6')]},'uniqueid':{'type':Sequelize[_0x09c5('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 017a66c..a8b5226 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xedd9,0xfc));var _0x9edd=function(_0x42eabe,_0x5366ea){_0x42eabe=_0x42eabe-0x0;var _0x45b06e=_0xedd9[_0x42eabe];return _0x45b06e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x191dff,_0xb60d16){_0x191dff=_0x191dff-0x0;var _0x410a43=_0x55ca[_0x191dff];return _0x410a43;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 0355b9e..8c0bc3e 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x927c=['MemberReport','membername_interface','membername','interface','util','bluebird','rimraf','../../config/environment','./memberReport.attributes','exports','define'];(function(_0x946e1b,_0x4f9f57){var _0x4db99b=function(_0x16f0e9){while(--_0x16f0e9){_0x946e1b['push'](_0x946e1b['shift']());}};_0x4db99b(++_0x4f9f57);}(_0x927c,0x190));var _0xc927=function(_0x2192cc,_0xd5dd81){_0x2192cc=_0x2192cc-0x0;var _0x158adc=_0x927c[_0x2192cc];return _0x158adc;};'use strict';var _=require('lodash');var util=require(_0xc927('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc927('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc927('0x2'));var config=require(_0xc927('0x3'));var attributes=require(_0xc927('0x4'));module[_0xc927('0x5')]=function(_0xa9e945,_0x411603){return _0xa9e945[_0xc927('0x6')](_0xc927('0x7'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xc927('0x8'),'fields':[_0xc927('0x9'),_0xc927('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x83fc=['path','rimraf','../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','membername','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x122107,_0x17cf75){var _0x5211d7=function(_0x485d20){while(--_0x485d20){_0x122107['push'](_0x122107['shift']());}};_0x5211d7(++_0x17cf75);}(_0x83fc,0x181));var _0xc83f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x83fc[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xc83f('0x0'));var util=require(_0xc83f('0x1'));var logger=require(_0xc83f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc83f('0x3'));var rp=require(_0xc83f('0x4'));var fs=require('fs');var path=require(_0xc83f('0x5'));var rimraf=require(_0xc83f('0x6'));var config=require(_0xc83f('0x7'));var attributes=require(_0xc83f('0x8'));module['exports']=function(_0x5717b8,_0x4c8230){return _0x5717b8['define'](_0xc83f('0x9'),attributes,{'tableName':_0xc83f('0xa'),'paranoid':![],'indexes':[{'name':_0xc83f('0xb'),'fields':[_0xc83f('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 424f4ea..94effcc 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81d4=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','MemberReport','options','raw','where','attributes','limit','map','model','include','GetMemberReport','catch','CreateMemberReport','UpdateMemberReport','update','body','util'];(function(_0x53b6a3,_0x1ff0f7){var _0x1c2199=function(_0x27e1cc){while(--_0x27e1cc){_0x53b6a3['push'](_0x53b6a3['shift']());}};_0x1c2199(++_0x1ff0f7);}(_0x81d4,0x197));var _0x481d=function(_0x56e08e,_0xd2f730){_0x56e08e=_0x56e08e-0x0;var _0x2bfcac=_0x81d4[_0x56e08e];return _0x2bfcac;};'use strict';var _=require('lodash');var util=require(_0x481d('0x0'));var moment=require(_0x481d('0x1'));var BPromise=require('bluebird');var rs=require(_0x481d('0x2'));var fs=require('fs');var Redis=require(_0x481d('0x3'));var db=require(_0x481d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x481d('0x5'));var config=require(_0x481d('0x6'));var jayson=require(_0x481d('0x7'));var client=jayson['client'][_0x481d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17d32a,_0x2f91fd,_0x271b33){return new BPromise(function(_0x1d9263,_0x25adbb){return client['request'](_0x17d32a,_0x271b33)[_0x481d('0x9')](function(_0x1cf758){logger[_0x481d('0xa')]('MemberReport,\x20%s,\x20%s',_0x2f91fd,_0x481d('0xb'));logger[_0x481d('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2f91fd,_0x481d('0xb'),JSON[_0x481d('0xd')](_0x1cf758));if(_0x1cf758[_0x481d('0xe')]){if(_0x1cf758[_0x481d('0xe')][_0x481d('0xf')]===0x1f4){logger[_0x481d('0xe')](_0x481d('0x10'),_0x2f91fd,_0x1cf758['error'][_0x481d('0x11')]);return _0x25adbb(_0x1cf758['error']['message']);}logger[_0x481d('0xe')](_0x481d('0x10'),_0x2f91fd,_0x1cf758[_0x481d('0xe')]['message']);return _0x1d9263(_0x1cf758[_0x481d('0xe')]['message']);}else{logger[_0x481d('0xa')](_0x481d('0x10'),_0x2f91fd,_0x481d('0xb'));_0x1d9263(_0x1cf758[_0x481d('0x12')][_0x481d('0x11')]);}})['catch'](function(_0x63b8c1){logger[_0x481d('0xe')](_0x481d('0x10'),_0x2f91fd,_0x63b8c1);_0x25adbb(_0x63b8c1);});});}exports['GetMemberReport']=function(_0x21e2a5){var _0x5056c7=this;return new Promise(function(_0x3ef7c6,_0x534a99){return db[_0x481d('0x13')]['findAll']({'raw':_0x21e2a5[_0x481d('0x14')]?_0x21e2a5['options'][_0x481d('0x15')]===undefined?!![]:![]:!![],'where':_0x21e2a5['options']?_0x21e2a5[_0x481d('0x14')][_0x481d('0x16')]||null:null,'attributes':_0x21e2a5['options']?_0x21e2a5[_0x481d('0x14')][_0x481d('0x17')]||null:null,'limit':_0x21e2a5[_0x481d('0x14')]?_0x21e2a5['options'][_0x481d('0x18')]||null:null,'include':_0x21e2a5['options']?_0x21e2a5['options']['include']?_[_0x481d('0x19')](_0x21e2a5['options']['include'],function(_0x280586){return{'model':db[_0x280586[_0x481d('0x1a')]],'as':_0x280586['as'],'attributes':_0x280586[_0x481d('0x17')],'include':_0x280586['include']?_[_0x481d('0x19')](_0x280586[_0x481d('0x1b')],function(_0x51e3a){return{'model':db[_0x51e3a[_0x481d('0x1a')]],'as':_0x51e3a['as'],'attributes':_0x51e3a['attributes'],'include':_0x51e3a[_0x481d('0x1b')]?_[_0x481d('0x19')](_0x51e3a['include'],function(_0x371cbe){return{'model':db[_0x371cbe[_0x481d('0x1a')]],'as':_0x371cbe['as'],'attributes':_0x371cbe[_0x481d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x599e61){logger[_0x481d('0xa')](_0x481d('0x1c'),_0x21e2a5);logger['debug']('GetMemberReport',_0x21e2a5,JSON[_0x481d('0xd')](_0x599e61));_0x3ef7c6(_0x599e61);})[_0x481d('0x1d')](function(_0x495fbb){logger[_0x481d('0xe')](_0x481d('0x1c'),_0x495fbb[_0x481d('0x11')],_0x21e2a5);_0x534a99(_0x5056c7[_0x481d('0xe')](0x1f4,_0x495fbb[_0x481d('0x11')]));});});};exports[_0x481d('0x1e')]=function(_0x447ac3){var _0x46f01b=this;return new Promise(function(_0x43d417,_0x4791ae){return db[_0x481d('0x13')]['create'](_0x447ac3['body'],{'raw':_0x447ac3['options']?_0x447ac3[_0x481d('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x481d('0x9')](function(_0x5d00fe){logger[_0x481d('0xa')](_0x481d('0x1e'),_0x447ac3);logger[_0x481d('0xc')](_0x481d('0x1e'),_0x447ac3,JSON[_0x481d('0xd')](_0x5d00fe));_0x43d417(_0x5d00fe);})[_0x481d('0x1d')](function(_0x46e60c){logger[_0x481d('0xe')](_0x481d('0x1e'),_0x46e60c[_0x481d('0x11')],_0x447ac3);_0x4791ae(_0x46f01b[_0x481d('0xe')](0x1f4,_0x46e60c[_0x481d('0x11')]));});});};exports[_0x481d('0x1f')]=function(_0x35c4b4){var _0x131961=this;return new Promise(function(_0x5288fe,_0x2143f6){return db[_0x481d('0x13')][_0x481d('0x20')](_0x35c4b4[_0x481d('0x21')],{'raw':_0x35c4b4[_0x481d('0x14')]?_0x35c4b4[_0x481d('0x14')][_0x481d('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35c4b4[_0x481d('0x14')]?_0x35c4b4['options'][_0x481d('0x16')]||null:null,'attributes':_0x35c4b4[_0x481d('0x14')]?_0x35c4b4[_0x481d('0x14')][_0x481d('0x17')]||null:null,'limit':_0x35c4b4[_0x481d('0x14')]?_0x35c4b4['options']['limit']||null:null})[_0x481d('0x9')](function(_0x5def7f){logger[_0x481d('0xa')](_0x481d('0x1f'),_0x35c4b4);logger[_0x481d('0xc')](_0x481d('0x1f'),_0x35c4b4,JSON[_0x481d('0xd')](_0x5def7f));_0x5288fe(_0x5def7f);})[_0x481d('0x1d')](function(_0x2c251f){logger[_0x481d('0xe')](_0x481d('0x1f'),_0x2c251f['message'],_0x35c4b4);_0x2143f6(_0x131961['error'](0x1f4,_0x2c251f[_0x481d('0x11')]));});});}; \ No newline at end of file +var _0xb1aa=['MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','raw','options','where','attributes','limit','include','model','map','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0xb1aa,0x159));var _0xab1a=function(_0x22112a,_0x78270){_0x22112a=_0x22112a-0x0;var _0x389d21=_0xb1aa[_0x22112a];return _0x389d21;};'use strict';var _=require(_0xab1a('0x0'));var util=require(_0xab1a('0x1'));var moment=require('moment');var BPromise=require(_0xab1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab1a('0x3'));var db=require(_0xab1a('0x4'))['db'];var utils=require(_0xab1a('0x5'));var logger=require(_0xab1a('0x6'))(_0xab1a('0x7'));var config=require(_0xab1a('0x8'));var jayson=require(_0xab1a('0x9'));var client=jayson[_0xab1a('0xa')][_0xab1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e7ff9,_0x5471ad,_0x400319){return new BPromise(function(_0x55a6d,_0x16eace){return client[_0xab1a('0xc')](_0x1e7ff9,_0x400319)[_0xab1a('0xd')](function(_0x1f0d04){logger[_0xab1a('0xe')](_0xab1a('0xf'),_0x5471ad,'request\x20sent');logger[_0xab1a('0x10')](_0xab1a('0x11'),_0x5471ad,_0xab1a('0x12'),JSON[_0xab1a('0x13')](_0x1f0d04));if(_0x1f0d04[_0xab1a('0x14')]){if(_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x15')]===0x1f4){logger[_0xab1a('0x14')](_0xab1a('0xf'),_0x5471ad,_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x16')]);return _0x16eace(_0x1f0d04['error'][_0xab1a('0x16')]);}logger['error'](_0xab1a('0xf'),_0x5471ad,_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x16')]);return _0x55a6d(_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x16')]);}else{logger[_0xab1a('0xe')](_0xab1a('0xf'),_0x5471ad,_0xab1a('0x12'));_0x55a6d(_0x1f0d04[_0xab1a('0x17')][_0xab1a('0x16')]);}})[_0xab1a('0x18')](function(_0x4b5fe6){logger[_0xab1a('0x14')](_0xab1a('0xf'),_0x5471ad,_0x4b5fe6);_0x16eace(_0x4b5fe6);});});}exports[_0xab1a('0x19')]=function(_0x2bd832){var _0x24a612=this;return new Promise(function(_0x51cd51,_0x2afbe7){return db['MemberReport']['findAll']({'raw':_0x2bd832['options']?_0x2bd832['options'][_0xab1a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bd832[_0xab1a('0x1b')]?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1c')]||null:null,'attributes':_0x2bd832[_0xab1a('0x1b')]?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1d')]||null:null,'limit':_0x2bd832['options']?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1e')]||null:null,'include':_0x2bd832[_0xab1a('0x1b')]?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1f')]?_['map'](_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1f')],function(_0x279def){return{'model':db[_0x279def[_0xab1a('0x20')]],'as':_0x279def['as'],'attributes':_0x279def[_0xab1a('0x1d')],'include':_0x279def[_0xab1a('0x1f')]?_['map'](_0x279def[_0xab1a('0x1f')],function(_0x41d4e6){return{'model':db[_0x41d4e6[_0xab1a('0x20')]],'as':_0x41d4e6['as'],'attributes':_0x41d4e6['attributes'],'include':_0x41d4e6['include']?_[_0xab1a('0x21')](_0x41d4e6[_0xab1a('0x1f')],function(_0x197ffc){return{'model':db[_0x197ffc['model']],'as':_0x197ffc['as'],'attributes':_0x197ffc[_0xab1a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xab1a('0xd')](function(_0x140483){logger[_0xab1a('0xe')](_0xab1a('0x19'),_0x2bd832);logger[_0xab1a('0x10')](_0xab1a('0x19'),_0x2bd832,JSON[_0xab1a('0x13')](_0x140483));_0x51cd51(_0x140483);})[_0xab1a('0x18')](function(_0x2fba42){logger[_0xab1a('0x14')](_0xab1a('0x19'),_0x2fba42[_0xab1a('0x16')],_0x2bd832);_0x2afbe7(_0x24a612[_0xab1a('0x14')](0x1f4,_0x2fba42['message']));});});};exports[_0xab1a('0x22')]=function(_0x13d163){var _0x5a2768=this;return new Promise(function(_0x110650,_0xfe915f){return db[_0xab1a('0x23')][_0xab1a('0x24')](_0x13d163[_0xab1a('0x25')],{'raw':_0x13d163[_0xab1a('0x1b')]?_0x13d163[_0xab1a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xab1a('0xd')](function(_0x571141){logger[_0xab1a('0xe')]('CreateMemberReport',_0x13d163);logger[_0xab1a('0x10')](_0xab1a('0x22'),_0x13d163,JSON[_0xab1a('0x13')](_0x571141));_0x110650(_0x571141);})[_0xab1a('0x18')](function(_0x1b5523){logger[_0xab1a('0x14')]('CreateMemberReport',_0x1b5523[_0xab1a('0x16')],_0x13d163);_0xfe915f(_0x5a2768[_0xab1a('0x14')](0x1f4,_0x1b5523[_0xab1a('0x16')]));});});};exports[_0xab1a('0x26')]=function(_0x2c5064){var _0x5ceb7b=this;return new Promise(function(_0x597dd0,_0x1ce017){return db[_0xab1a('0x23')][_0xab1a('0x27')](_0x2c5064[_0xab1a('0x25')],{'raw':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')][_0xab1a('0x1c')]||null:null,'attributes':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')][_0xab1a('0x1d')]||null:null,'limit':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')]['limit']||null:null})[_0xab1a('0xd')](function(_0x8338a1){logger[_0xab1a('0xe')](_0xab1a('0x26'),_0x2c5064);logger[_0xab1a('0x10')](_0xab1a('0x26'),_0x2c5064,JSON[_0xab1a('0x13')](_0x8338a1));_0x597dd0(_0x8338a1);})[_0xab1a('0x18')](function(_0x31e9b6){logger[_0xab1a('0x14')](_0xab1a('0x26'),_0x31e9b6[_0xab1a('0x16')],_0x2c5064);_0x1ce017(_0x5ceb7b['error'](0x1f4,_0x31e9b6[_0xab1a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 17db4da..02608e1 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a80=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','path'];(function(_0x8ade8b,_0x50f50c){var _0x308814=function(_0x205c35){while(--_0x205c35){_0x8ade8b['push'](_0x8ade8b['shift']());}};_0x308814(++_0x50f50c);}(_0x4a80,0xbe));var _0x04a8=function(_0x4dfb08,_0x1650ad){_0x4dfb08=_0x4dfb08-0x0;var _0xf00ce6=_0x4a80[_0x4dfb08];return _0xf00ce6;};'use strict';var multer=require(_0x04a8('0x0'));var util=require('util');var path=require(_0x04a8('0x1'));var timeout=require(_0x04a8('0x2'));var express=require('express');var router=express[_0x04a8('0x3')]();var fs_extra=require(_0x04a8('0x4'));var auth=require(_0x04a8('0x5'));var interaction=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var controller=require(_0x04a8('0x8'));router[_0x04a8('0x9')]('/',controller[_0x04a8('0xa')]);module[_0x04a8('0xb')]=router; \ No newline at end of file +var _0x4bfb=['fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer','util','path','connect-timeout','Router'];(function(_0x2efe2c,_0x45047d){var _0x54e2e1=function(_0x15c360){while(--_0x15c360){_0x2efe2c['push'](_0x2efe2c['shift']());}};_0x54e2e1(++_0x45047d);}(_0x4bfb,0x150));var _0xb4bf=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x4bfb[_0x13342f];return _0x2fc1fc;};'use strict';var multer=require(_0xb4bf('0x0'));var util=require(_0xb4bf('0x1'));var path=require(_0xb4bf('0x2'));var timeout=require(_0xb4bf('0x3'));var express=require('express');var router=express[_0xb4bf('0x4')]();var fs_extra=require(_0xb4bf('0x5'));var auth=require(_0xb4bf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb4bf('0x7'));router[_0xb4bf('0x8')]('/',controller[_0xb4bf('0x9')]);module[_0xb4bf('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ac6aed5..5dac07a 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd66a=['sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd66a,0x111));var _0xad66=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xd66a[_0x3203a1];return _0x24215e;};'use strict';var Sequelize=require(_0xad66('0x0'));module[_0xad66('0x1')]={'version':{'type':Sequelize[_0xad66('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x1def=['sequelize','STRING','version'];(function(_0x3c1a53,_0x583c4a){var _0x2bbfd5=function(_0x32e2d3){while(--_0x32e2d3){_0x3c1a53['push'](_0x3c1a53['shift']());}};_0x2bbfd5(++_0x583c4a);}(_0x1def,0x1a1));var _0xf1de=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1def[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xf1de('0x0'));module['exports']={'version':{'type':Sequelize[_0xf1de('0x1')],'unique':_0xf1de('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 216de62..f0cb17b 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc87b=['count','offset','set','Content-Range','save','then','destroy','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xc87b,0x1a3));var _0xbc87=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xc87b[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0xbc87('0x0'));var rimraf=require(_0xbc87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbc87('0x2'));var moment=require(_0xbc87('0x3'));var BPromise=require(_0xbc87('0x4'));var Mustache=require(_0xbc87('0x5'));var util=require(_0xbc87('0x6'));var path=require(_0xbc87('0x7'));var sox=require(_0xbc87('0x8'));var csv=require(_0xbc87('0x9'));var ejs=require(_0xbc87('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc87('0xb'));var squel=require('squel');var crypto=require(_0xbc87('0xc'));var jsforce=require(_0xbc87('0xd'));var deskjs=require(_0xbc87('0xe'));var toCsv=require(_0xbc87('0x9'));var querystring=require('querystring');var Papa=require(_0xbc87('0xf'));var Redis=require('ioredis');var authService=require(_0xbc87('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbc87('0x11'));var hardwareService=require(_0xbc87('0x12'));var logger=require(_0xbc87('0x13'))(_0xbc87('0x14'));var utils=require(_0xbc87('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbc87('0x16'))['db'];function respondWithStatusCode(_0x588495,_0x4312fc){_0x4312fc=_0x4312fc||0xcc;return function(_0x2ccc3a){if(_0x2ccc3a){return _0x588495[_0xbc87('0x17')](_0x4312fc);}return _0x588495[_0xbc87('0x18')](_0x4312fc)[_0xbc87('0x19')]();};}function respondWithResult(_0x5c243f,_0x3c8338){_0x3c8338=_0x3c8338||0xc8;return function(_0x1e9dca){if(_0x1e9dca){return _0x5c243f['status'](_0x3c8338)[_0xbc87('0x1a')](_0x1e9dca);}};}function respondWithFilteredResult(_0x189701,_0x111bba){return function(_0x2e40b6){if(_0x2e40b6){var _0x3698ce=typeof _0x111bba['offset']===_0xbc87('0x1b')&&typeof _0x111bba[_0xbc87('0x1c')]===_0xbc87('0x1b');var _0x7df5e=_0x2e40b6[_0xbc87('0x1d')];var _0x113f55=_0x3698ce?0x0:_0x111bba[_0xbc87('0x1e')];var _0x4e4ca1=_0x3698ce?_0x2e40b6[_0xbc87('0x1d')]:_0x111bba[_0xbc87('0x1e')]+_0x111bba[_0xbc87('0x1c')];var _0x20c365;if(_0x4e4ca1>=_0x7df5e){_0x4e4ca1=_0x7df5e;_0x20c365=0xc8;}else{_0x20c365=0xce;}_0x189701[_0xbc87('0x18')](_0x20c365);return _0x189701[_0xbc87('0x1f')](_0xbc87('0x20'),_0x113f55+'-'+_0x4e4ca1+'/'+_0x7df5e)[_0xbc87('0x1a')](_0x2e40b6);}return null;};}function patchUpdates(_0x2ce879){return function(_0x172c77){try{jsonpatch['apply'](_0x172c77,_0x2ce879,!![]);}catch(_0x20c4ac){return BPromise['reject'](_0x20c4ac);}return _0x172c77[_0xbc87('0x21')]();};}function saveUpdates(_0x2af8dc,_0x2ec5bb){return function(_0x355c19){if(_0x355c19){return _0x355c19['update'](_0x2af8dc)[_0xbc87('0x22')](function(_0x1e37cd){return _0x1e37cd;});}return null;};}function removeEntity(_0x4f457f,_0x10c1fc){return function(_0x5eaae6){if(_0x5eaae6){return _0x5eaae6[_0xbc87('0x23')]()[_0xbc87('0x22')](function(){_0x4f457f[_0xbc87('0x18')](0xcc)[_0xbc87('0x19')]();});}};}function handleEntityNotFound(_0x2b3133,_0x9768df){return function(_0x18a7ec){if(!_0x18a7ec){_0x2b3133[_0xbc87('0x17')](0x194);}return _0x18a7ec;};}function handleError(_0x44f8b4,_0x23a7b9){_0x23a7b9=_0x23a7b9||0x1f4;return function(_0x347bc8){logger['error'](_0x347bc8['stack']);if(_0x347bc8[_0xbc87('0x24')]){delete _0x347bc8['name'];}_0x44f8b4[_0xbc87('0x18')](_0x23a7b9)[_0xbc87('0x25')](_0x347bc8);};}exports[_0xbc87('0x26')]=function(_0x462ed4,_0x1b0f36){var _0x410bb0={},_0x31c85d={},_0x1ecc3a={'count':0x0,'rows':[]};var _0x8d5338=_[_0xbc87('0x27')](db[_0xbc87('0x28')][_0xbc87('0x29')],function(_0x2e1736){return{'name':_0x2e1736[_0xbc87('0x2a')],'type':_0x2e1736[_0xbc87('0x2b')]['key']};});_0x31c85d[_0xbc87('0x2c')]=_[_0xbc87('0x27')](_0x8d5338,_0xbc87('0x24'));_0x31c85d[_0xbc87('0x2d')]=_[_0xbc87('0x2e')](_0x462ed4['query']);_0x31c85d['filters']=_['intersection'](_0x31c85d[_0xbc87('0x2c')],_0x31c85d[_0xbc87('0x2d')]);_0x410bb0[_0xbc87('0x2f')]=_['intersection'](_0x31c85d[_0xbc87('0x2c')],qs[_0xbc87('0x30')](_0x462ed4['query'][_0xbc87('0x30')]));_0x410bb0[_0xbc87('0x2f')]=_0x410bb0['attributes']['length']?_0x410bb0[_0xbc87('0x2f')]:_0x31c85d[_0xbc87('0x2c')];if(!_0x462ed4[_0xbc87('0x2d')][_0xbc87('0x31')]('nolimit')){_0x410bb0[_0xbc87('0x1c')]=qs[_0xbc87('0x1c')](_0x462ed4[_0xbc87('0x2d')][_0xbc87('0x1c')]);_0x410bb0[_0xbc87('0x1e')]=qs['offset'](_0x462ed4[_0xbc87('0x2d')][_0xbc87('0x1e')]);}_0x410bb0[_0xbc87('0x32')]=qs[_0xbc87('0x33')](_0x462ed4[_0xbc87('0x2d')][_0xbc87('0x33')]);_0x410bb0[_0xbc87('0x34')]=qs[_0xbc87('0x35')](_[_0xbc87('0x36')](_0x462ed4[_0xbc87('0x2d')],_0x31c85d[_0xbc87('0x35')]),_0x8d5338);if(_0x462ed4[_0xbc87('0x2d')][_0xbc87('0x37')]){_0x410bb0[_0xbc87('0x34')]=_[_0xbc87('0x38')](_0x410bb0[_0xbc87('0x34')],{'$or':_[_0xbc87('0x27')](_0x8d5338,function(_0x5df4c8){if(_0x5df4c8[_0xbc87('0x2b')]!==_0xbc87('0x39')){var _0x29de96={};_0x29de96[_0x5df4c8[_0xbc87('0x24')]]={'$like':'%'+_0x462ed4[_0xbc87('0x2d')]['filter']+'%'};return _0x29de96;}})});}_0x410bb0=_[_0xbc87('0x38')]({},_0x410bb0,_0x462ed4[_0xbc87('0x3a')]);var _0x596103={'where':_0x410bb0[_0xbc87('0x34')]};return db['Migration']['count'](_0x596103)[_0xbc87('0x22')](function(_0x34e966){_0x1ecc3a[_0xbc87('0x1d')]=_0x34e966;if(_0x462ed4[_0xbc87('0x2d')][_0xbc87('0x3b')]){_0x410bb0[_0xbc87('0x3c')]=[{'all':!![]}];}return db['Migration'][_0xbc87('0x3d')](_0x410bb0);})[_0xbc87('0x22')](function(_0x2ba186){_0x1ecc3a[_0xbc87('0x3e')]=_0x2ba186;return _0x1ecc3a;})[_0xbc87('0x22')](respondWithFilteredResult(_0x1b0f36,_0x410bb0))[_0xbc87('0x3f')](handleError(_0x1b0f36,null));}; \ No newline at end of file +var _0x8a7e=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','then','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x51b75b,_0x2b7fae){var _0x403cf9=function(_0x5345ab){while(--_0x5345ab){_0x51b75b['push'](_0x51b75b['shift']());}};_0x403cf9(++_0x2b7fae);}(_0x8a7e,0x1de));var _0xe8a7=function(_0x3dc13b,_0x16c7f9){_0x3dc13b=_0x3dc13b-0x0;var _0x7d6feb=_0x8a7e[_0x3dc13b];return _0x7d6feb;};'use strict';var emlformat=require(_0xe8a7('0x0'));var rimraf=require(_0xe8a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8a7('0x2'));var rp=require(_0xe8a7('0x3'));var moment=require(_0xe8a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe8a7('0x5'));var util=require(_0xe8a7('0x6'));var path=require(_0xe8a7('0x7'));var sox=require('sox');var csv=require(_0xe8a7('0x8'));var ejs=require(_0xe8a7('0x9'));var fs=require('fs');var fs_extra=require(_0xe8a7('0xa'));var _=require(_0xe8a7('0xb'));var squel=require(_0xe8a7('0xc'));var crypto=require('crypto');var jsforce=require(_0xe8a7('0xd'));var deskjs=require(_0xe8a7('0xe'));var toCsv=require(_0xe8a7('0x8'));var querystring=require(_0xe8a7('0xf'));var Papa=require(_0xe8a7('0x10'));var Redis=require(_0xe8a7('0x11'));var authService=require(_0xe8a7('0x12'));var qs=require(_0xe8a7('0x13'));var as=require(_0xe8a7('0x14'));var hardwareService=require(_0xe8a7('0x15'));var logger=require(_0xe8a7('0x16'))('api');var utils=require(_0xe8a7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe8a7('0x18'))['db'];function respondWithStatusCode(_0x83fbf1,_0x5c33ae){_0x5c33ae=_0x5c33ae||0xcc;return function(_0x4f13d8){if(_0x4f13d8){return _0x83fbf1[_0xe8a7('0x19')](_0x5c33ae);}return _0x83fbf1[_0xe8a7('0x1a')](_0x5c33ae)['end']();};}function respondWithResult(_0x471d3a,_0x571d36){_0x571d36=_0x571d36||0xc8;return function(_0x32bb6c){if(_0x32bb6c){return _0x471d3a[_0xe8a7('0x1a')](_0x571d36)[_0xe8a7('0x1b')](_0x32bb6c);}};}function respondWithFilteredResult(_0x1aab72,_0x2faef8){return function(_0xd98201){if(_0xd98201){var _0x3bac3f=typeof _0x2faef8[_0xe8a7('0x1c')]==='undefined'&&typeof _0x2faef8[_0xe8a7('0x1d')]===_0xe8a7('0x1e');var _0x50f1cf=_0xd98201[_0xe8a7('0x1f')];var _0x2c58a3=_0x3bac3f?0x0:_0x2faef8[_0xe8a7('0x1c')];var _0x280689=_0x3bac3f?_0xd98201[_0xe8a7('0x1f')]:_0x2faef8['offset']+_0x2faef8['limit'];var _0x1e95b5;if(_0x280689>=_0x50f1cf){_0x280689=_0x50f1cf;_0x1e95b5=0xc8;}else{_0x1e95b5=0xce;}_0x1aab72[_0xe8a7('0x1a')](_0x1e95b5);return _0x1aab72[_0xe8a7('0x20')](_0xe8a7('0x21'),_0x2c58a3+'-'+_0x280689+'/'+_0x50f1cf)[_0xe8a7('0x1b')](_0xd98201);}return null;};}function patchUpdates(_0x7694b7){return function(_0x7d90f8){try{jsonpatch[_0xe8a7('0x22')](_0x7d90f8,_0x7694b7,!![]);}catch(_0x493c86){return BPromise[_0xe8a7('0x23')](_0x493c86);}return _0x7d90f8[_0xe8a7('0x24')]();};}function saveUpdates(_0x2a763c,_0x3398b4){return function(_0x12a52d){if(_0x12a52d){return _0x12a52d[_0xe8a7('0x25')](_0x2a763c)['then'](function(_0x3bcbf5){return _0x3bcbf5;});}return null;};}function removeEntity(_0x11e68e,_0x547383){return function(_0x5ef3c1){if(_0x5ef3c1){return _0x5ef3c1[_0xe8a7('0x26')]()['then'](function(){_0x11e68e[_0xe8a7('0x1a')](0xcc)[_0xe8a7('0x27')]();});}};}function handleEntityNotFound(_0x221048,_0x23163d){return function(_0x5a4258){if(!_0x5a4258){_0x221048[_0xe8a7('0x19')](0x194);}return _0x5a4258;};}function handleError(_0x23cabc,_0x4019f5){_0x4019f5=_0x4019f5||0x1f4;return function(_0xa97794){logger[_0xe8a7('0x28')](_0xa97794['stack']);if(_0xa97794[_0xe8a7('0x29')]){delete _0xa97794[_0xe8a7('0x29')];}_0x23cabc[_0xe8a7('0x1a')](_0x4019f5)[_0xe8a7('0x2a')](_0xa97794);};}exports[_0xe8a7('0x2b')]=function(_0x531ddc,_0x4fd59){var _0x18f85b={},_0x4ed4cc={},_0xb3914b={'count':0x0,'rows':[]};var _0x30e28e=_[_0xe8a7('0x2c')](db['Migration'][_0xe8a7('0x2d')],function(_0x5c57cb){return{'name':_0x5c57cb[_0xe8a7('0x2e')],'type':_0x5c57cb[_0xe8a7('0x2f')][_0xe8a7('0x30')]};});_0x4ed4cc[_0xe8a7('0x31')]=_['map'](_0x30e28e,'name');_0x4ed4cc[_0xe8a7('0x32')]=_['keys'](_0x531ddc[_0xe8a7('0x32')]);_0x4ed4cc[_0xe8a7('0x33')]=_[_0xe8a7('0x34')](_0x4ed4cc['model'],_0x4ed4cc[_0xe8a7('0x32')]);_0x18f85b[_0xe8a7('0x35')]=_[_0xe8a7('0x34')](_0x4ed4cc[_0xe8a7('0x31')],qs['fields'](_0x531ddc['query'][_0xe8a7('0x36')]));_0x18f85b[_0xe8a7('0x35')]=_0x18f85b[_0xe8a7('0x35')]['length']?_0x18f85b[_0xe8a7('0x35')]:_0x4ed4cc[_0xe8a7('0x31')];if(!_0x531ddc['query'][_0xe8a7('0x37')](_0xe8a7('0x38'))){_0x18f85b[_0xe8a7('0x1d')]=qs[_0xe8a7('0x1d')](_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x1d')]);_0x18f85b['offset']=qs[_0xe8a7('0x1c')](_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x1c')]);}_0x18f85b[_0xe8a7('0x39')]=qs[_0xe8a7('0x3a')](_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x3a')]);_0x18f85b[_0xe8a7('0x3b')]=qs[_0xe8a7('0x33')](_['pick'](_0x531ddc[_0xe8a7('0x32')],_0x4ed4cc['filters']),_0x30e28e);if(_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x3c')]){_0x18f85b[_0xe8a7('0x3b')]=_[_0xe8a7('0x3d')](_0x18f85b[_0xe8a7('0x3b')],{'$or':_['map'](_0x30e28e,function(_0x12a499){if(_0x12a499[_0xe8a7('0x2f')]!==_0xe8a7('0x3e')){var _0x456a3e={};_0x456a3e[_0x12a499[_0xe8a7('0x29')]]={'$like':'%'+_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x3c')]+'%'};return _0x456a3e;}})});}_0x18f85b=_[_0xe8a7('0x3d')]({},_0x18f85b,_0x531ddc[_0xe8a7('0x3f')]);var _0x54dc76={'where':_0x18f85b[_0xe8a7('0x3b')]};return db[_0xe8a7('0x40')]['count'](_0x54dc76)['then'](function(_0x144534){_0xb3914b[_0xe8a7('0x1f')]=_0x144534;if(_0x531ddc['query'][_0xe8a7('0x41')]){_0x18f85b[_0xe8a7('0x42')]=[{'all':!![]}];}return db['Migration'][_0xe8a7('0x43')](_0x18f85b);})[_0xe8a7('0x44')](function(_0x5741de){_0xb3914b[_0xe8a7('0x45')]=_0x5741de;return _0xb3914b;})['then'](respondWithFilteredResult(_0x4fd59,_0x18f85b))['catch'](handleError(_0x4fd59,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 650e05d..44a2c5d 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47b5=['path','rimraf','../../config/environment','./migration.attributes','exports','migrations','bluebird','request-promise'];(function(_0x271df9,_0x1091a9){var _0x10eecf=function(_0xd58db7){while(--_0xd58db7){_0x271df9['push'](_0x271df9['shift']());}};_0x10eecf(++_0x1091a9);}(_0x47b5,0x1c6));var _0x547b=function(_0x28661f,_0x2bfcd6){_0x28661f=_0x28661f-0x0;var _0x1aac56=_0x47b5[_0x28661f];return _0x1aac56;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x547b('0x0'));var rp=require(_0x547b('0x1'));var fs=require('fs');var path=require(_0x547b('0x2'));var rimraf=require(_0x547b('0x3'));var config=require(_0x547b('0x4'));var attributes=require(_0x547b('0x5'));module[_0x547b('0x6')]=function(_0x1f87e6,_0x288092){return _0x1f87e6['define']('Migration',attributes,{'tableName':_0x547b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb04c=['rimraf','../../config/environment','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b4f11,_0x2e6543){var _0x31d846=function(_0x1a2812){while(--_0x1a2812){_0x3b4f11['push'](_0x3b4f11['shift']());}};_0x31d846(++_0x2e6543);}(_0xb04c,0x156));var _0xcb04=function(_0x4a4288,_0x497d63){_0x4a4288=_0x4a4288-0x0;var _0x380f66=_0xb04c[_0x4a4288];return _0x380f66;};'use strict';var _=require(_0xcb04('0x0'));var util=require(_0xcb04('0x1'));var logger=require(_0xcb04('0x2'))(_0xcb04('0x3'));var moment=require(_0xcb04('0x4'));var BPromise=require(_0xcb04('0x5'));var rp=require(_0xcb04('0x6'));var fs=require('fs');var path=require(_0xcb04('0x7'));var rimraf=require(_0xcb04('0x8'));var config=require(_0xcb04('0x9'));var attributes=require('./migration.attributes');module[_0xcb04('0xa')]=function(_0x22b7ae,_0x3b9683){return _0x22b7ae[_0xcb04('0xb')](_0xcb04('0xc'),attributes,{'tableName':_0xcb04('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 754eff5..558c8e5 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0efe=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird'];(function(_0x2c0a29,_0x4f0ed1){var _0x38516a=function(_0x429839){while(--_0x429839){_0x2c0a29['push'](_0x2c0a29['shift']());}};_0x38516a(++_0x4f0ed1);}(_0x0efe,0x110));var _0xe0ef=function(_0x44d9a0,_0x5ce830){_0x44d9a0=_0x44d9a0-0x0;var _0x398cb7=_0x0efe[_0x44d9a0];return _0x398cb7;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require('moment');var BPromise=require(_0xe0ef('0x2'));var rs=require(_0xe0ef('0x3'));var fs=require('fs');var Redis=require(_0xe0ef('0x4'));var db=require(_0xe0ef('0x5'))['db'];var utils=require(_0xe0ef('0x6'));var logger=require(_0xe0ef('0x7'))(_0xe0ef('0x8'));var config=require(_0xe0ef('0x9'));var jayson=require(_0xe0ef('0xa'));var client=jayson[_0xe0ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49643a,_0x3a6030,_0x1a57fb){return new BPromise(function(_0x161f87,_0xa4f9be){return client[_0xe0ef('0xc')](_0x49643a,_0x1a57fb)[_0xe0ef('0xd')](function(_0x18f982){logger['info']('Migration,\x20%s,\x20%s',_0x3a6030,_0xe0ef('0xe'));logger[_0xe0ef('0xf')](_0xe0ef('0x10'),_0x3a6030,'request\x20sent',JSON[_0xe0ef('0x11')](_0x18f982));if(_0x18f982[_0xe0ef('0x12')]){if(_0x18f982['error'][_0xe0ef('0x13')]===0x1f4){logger['error'](_0xe0ef('0x14'),_0x3a6030,_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);return _0xa4f9be(_0x18f982['error']['message']);}logger[_0xe0ef('0x12')](_0xe0ef('0x14'),_0x3a6030,_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);return _0x161f87(_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);}else{logger[_0xe0ef('0x16')](_0xe0ef('0x14'),_0x3a6030,'request\x20sent');_0x161f87(_0x18f982[_0xe0ef('0x17')][_0xe0ef('0x15')]);}})[_0xe0ef('0x18')](function(_0xe9b6d4){logger[_0xe0ef('0x12')]('Migration,\x20%s,\x20%s',_0x3a6030,_0xe9b6d4);_0xa4f9be(_0xe9b6d4);});});} \ No newline at end of file +var _0xb077=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x11cc54,_0x1b3e76){var _0x2b04c0=function(_0x400e76){while(--_0x400e76){_0x11cc54['push'](_0x11cc54['shift']());}};_0x2b04c0(++_0x1b3e76);}(_0xb077,0x7a));var _0x7b07=function(_0x5e34e8,_0x1f8d13){_0x5e34e8=_0x5e34e8-0x0;var _0x1541d8=_0xb077[_0x5e34e8];return _0x1541d8;};'use strict';var _=require(_0x7b07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b07('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b07('0x2'));var db=require(_0x7b07('0x3'))['db'];var utils=require(_0x7b07('0x4'));var logger=require(_0x7b07('0x5'))(_0x7b07('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b07('0x7')][_0x7b07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x110ee5,_0x4d9976,_0x561c99){return new BPromise(function(_0x3a82e8,_0x4b6f20){return client[_0x7b07('0x9')](_0x110ee5,_0x561c99)[_0x7b07('0xa')](function(_0x2d3741){logger[_0x7b07('0xb')](_0x7b07('0xc'),_0x4d9976,_0x7b07('0xd'));logger[_0x7b07('0xe')](_0x7b07('0xf'),_0x4d9976,_0x7b07('0xd'),JSON['stringify'](_0x2d3741));if(_0x2d3741[_0x7b07('0x10')]){if(_0x2d3741[_0x7b07('0x10')][_0x7b07('0x11')]===0x1f4){logger['error'](_0x7b07('0xc'),_0x4d9976,_0x2d3741[_0x7b07('0x10')][_0x7b07('0x12')]);return _0x4b6f20(_0x2d3741[_0x7b07('0x10')]['message']);}logger[_0x7b07('0x10')](_0x7b07('0xc'),_0x4d9976,_0x2d3741[_0x7b07('0x10')][_0x7b07('0x12')]);return _0x3a82e8(_0x2d3741['error'][_0x7b07('0x12')]);}else{logger[_0x7b07('0xb')](_0x7b07('0xc'),_0x4d9976,_0x7b07('0xd'));_0x3a82e8(_0x2d3741['result']['message']);}})['catch'](function(_0x521d8d){logger[_0x7b07('0x10')](_0x7b07('0xc'),_0x4d9976,_0x521d8d);_0x4b6f20(_0x521d8d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ae6c257..abc0f92 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58e6=['./network.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x58e6,0x1c2));var _0x658e=function(_0x4e076e,_0xa0c117){_0x4e076e=_0x4e076e-0x0;var _0x2d3195=_0x58e6[_0x4e076e];return _0x2d3195;};'use strict';var multer=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x658e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x658e('0x3'));var interaction=require(_0x658e('0x4'));var config=require(_0x658e('0x5'));var controller=require(_0x658e('0x6'));router[_0x658e('0x7')]('/',auth[_0x658e('0x8')](),controller[_0x658e('0x9')]);router['get']('/:id',auth[_0x658e('0x8')](),controller[_0x658e('0xa')]);router[_0x658e('0xb')]('/',auth['isAuthenticated'](),controller[_0x658e('0xc')]);router[_0x658e('0xd')](_0x658e('0xe'),auth[_0x658e('0x8')](),controller[_0x658e('0xf')]);router[_0x658e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x658e('0x11')]);module[_0x658e('0x12')]=router; \ No newline at end of file +var _0xe2fe=['/:id','show','create','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x39ab81,_0x458741){var _0x36fdbb=function(_0x480442){while(--_0x480442){_0x39ab81['push'](_0x39ab81['shift']());}};_0x36fdbb(++_0x458741);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'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('./network.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['post']('/',auth[_0xee2f('0x8')](),controller[_0xee2f('0xb')]);router['put'](_0xee2f('0x9'),auth[_0xee2f('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 9bf3245..18ce1c3 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6df=['externip','stun','turn','STRING','sequelize','exports','localnet'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xf6df,0x10e));var _0xff6d=function(_0x573469,_0x3261e4){_0x573469=_0x573469-0x0;var _0x3396bd=_0xf6df[_0x573469];return _0x3396bd;};'use strict';var Sequelize=require(_0xff6d('0x0'));module[_0xff6d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xff6d('0x2'),_0xff6d('0x3'),_0xff6d('0x4'),_0xff6d('0x5'))},'value':{'type':Sequelize[_0xff6d('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xff6d('0x6')]}}; \ No newline at end of file +var _0x2b20=['STRING','sequelize','exports','localnet','stun','turn'];(function(_0xa8b596,_0x2396ef){var _0x1dfc5f=function(_0x25243b){while(--_0x25243b){_0xa8b596['push'](_0xa8b596['shift']());}};_0x1dfc5f(++_0x2396ef);}(_0x2b20,0x73));var _0x02b2=function(_0x252663,_0x5da67b){_0x252663=_0x252663-0x0;var _0x5cb3c9=_0x2b20[_0x252663];return _0x5cb3c9;};'use strict';var Sequelize=require(_0x02b2('0x0'));module[_0x02b2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x02b2('0x2'),'externip',_0x02b2('0x3'),_0x02b2('0x4'))},'value':{'type':Sequelize[_0x02b2('0x5')]},'username':{'type':Sequelize[_0x02b2('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 44ed85a..1531a0c 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3c9=['name','send','index','map','Network','rawAttributes','type','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','keys','find','create','findAll','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','update','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','destroy','TURN','path','ejs','../../components/parsers/qs','../../config/logger','api','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','offset','undefined','limit','count','status','set','Content-Range','json','end','stack'];(function(_0x110cbb,_0x186ee7){var _0x145f91=function(_0x3d2195){while(--_0x3d2195){_0x110cbb['push'](_0x110cbb['shift']());}};_0x145f91(++_0x186ee7);}(_0xe3c9,0x12b));var _0x9e3c=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xe3c9[_0x5f1391];return _0x50ebe3;};'use strict';var util=require('util');var path=require(_0x9e3c('0x0'));var ejs=require(_0x9e3c('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0x9e3c('0x2'));var logger=require(_0x9e3c('0x3'))(_0x9e3c('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x9e3c('0x5'));var client=jayson['client'][_0x9e3c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x45a661,_0x3d87e9,_0x5bab17,_0x49106e){return new Promise(function(_0x2d6ad1,_0x239609){var _0x3f1db3=_0x49106e||client;return _0x3f1db3[_0x9e3c('0x7')](_0x45a661,_0x5bab17)[_0x9e3c('0x8')](function(_0x2f8fee){logger['info'](_0x9e3c('0x9'),_0x3d87e9,_0x9e3c('0xa'));logger[_0x9e3c('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x3d87e9,_0x9e3c('0xa'),JSON[_0x9e3c('0xc')](_0x2f8fee));if(_0x2f8fee['error']){if(_0x2f8fee[_0x9e3c('0xd')][_0x9e3c('0xe')]===0x1f4){logger[_0x9e3c('0xd')](_0x9e3c('0x9'),_0x3d87e9,_0x2f8fee[_0x9e3c('0xd')][_0x9e3c('0xf')]);return _0x239609(_0x2f8fee[_0x9e3c('0xd')][_0x9e3c('0xf')]);}logger[_0x9e3c('0xd')](_0x9e3c('0x9'),_0x3d87e9,_0x2f8fee[_0x9e3c('0xd')][_0x9e3c('0xf')]);return _0x2d6ad1(_0x2f8fee[_0x9e3c('0xd')][_0x9e3c('0xf')]);}else{logger[_0x9e3c('0x10')](_0x9e3c('0x9'),_0x3d87e9,_0x9e3c('0xa'));_0x2d6ad1(_0x2f8fee[_0x9e3c('0x11')][_0x9e3c('0xf')]);}})[_0x9e3c('0x12')](function(_0x542437){logger[_0x9e3c('0xd')](_0x9e3c('0x9'),_0x3d87e9,_0x542437);_0x239609(_0x542437);});});}function respondWithResult(_0x36a678,_0x361f00){_0x361f00=_0x361f00||0xc8;return function(_0x114886){if(_0x114886){return _0x36a678['status'](_0x361f00)['json'](_0x114886);}};}function respondWithFilteredResult(_0x2f54b4,_0x26f432){return function(_0x5dabd3){if(_0x5dabd3){var _0x45e758=typeof _0x26f432[_0x9e3c('0x13')]===_0x9e3c('0x14')&&typeof _0x26f432[_0x9e3c('0x15')]===_0x9e3c('0x14');var _0xe5fc86=_0x5dabd3[_0x9e3c('0x16')];var _0x569e8b=_0x45e758?0x0:_0x26f432['offset'];var _0x3c935b=_0x45e758?_0x5dabd3[_0x9e3c('0x16')]:_0x26f432[_0x9e3c('0x13')]+_0x26f432[_0x9e3c('0x15')];var _0x28f3aa;if(_0x3c935b>=_0xe5fc86){_0x3c935b=_0xe5fc86;_0x28f3aa=0xc8;}else{_0x28f3aa=0xce;}_0x2f54b4[_0x9e3c('0x17')](_0x28f3aa);return _0x2f54b4[_0x9e3c('0x18')](_0x9e3c('0x19'),_0x569e8b+'-'+_0x3c935b+'/'+_0xe5fc86)[_0x9e3c('0x1a')](_0x5dabd3);}return null;};}function saveUpdates(_0x463bae){return function(_0x1a7569){if(_0x1a7569){return _0x1a7569['update'](_0x463bae)[_0x9e3c('0x8')](function(_0x24dd1e){return _0x24dd1e;});}return null;};}function removeEntity(_0x511540){return function(_0x25c164){if(_0x25c164){return _0x25c164['destroy']()[_0x9e3c('0x8')](function(){_0x511540[_0x9e3c('0x17')](0xcc)[_0x9e3c('0x1b')]();});}};}function handleEntityNotFound(_0x4d2b1a){return function(_0x43eaa2){if(!_0x43eaa2){_0x4d2b1a['sendStatus'](0x194);}return _0x43eaa2;};}function handleError(_0x3f8610,_0x5cb91f){_0x5cb91f=_0x5cb91f||0x1f4;return function(_0x1c8182){logger['error'](_0x1c8182[_0x9e3c('0x1c')]);if(_0x1c8182[_0x9e3c('0x1d')]){delete _0x1c8182[_0x9e3c('0x1d')];}_0x3f8610[_0x9e3c('0x17')](_0x5cb91f)[_0x9e3c('0x1e')](_0x1c8182);};}exports[_0x9e3c('0x1f')]=function(_0x92e60f,_0x462c10){var _0x2ea81e={},_0x13b670={},_0x535dce={'count':0x0,'rows':[]};var _0x4c4f03=_[_0x9e3c('0x20')](db[_0x9e3c('0x21')][_0x9e3c('0x22')],function(_0x447cee){return{'name':_0x447cee['fieldName'],'type':_0x447cee[_0x9e3c('0x23')]['key']};});_0x13b670['model']=_[_0x9e3c('0x20')](_0x4c4f03,_0x9e3c('0x1d'));_0x13b670[_0x9e3c('0x24')]=_['keys'](_0x92e60f[_0x9e3c('0x24')]);_0x13b670[_0x9e3c('0x25')]=_['intersection'](_0x13b670[_0x9e3c('0x26')],_0x13b670['query']);_0x2ea81e['attributes']=_[_0x9e3c('0x27')](_0x13b670[_0x9e3c('0x26')],qs['fields'](_0x92e60f['query'][_0x9e3c('0x28')]));_0x2ea81e[_0x9e3c('0x29')]=_0x2ea81e[_0x9e3c('0x29')]['length']?_0x2ea81e['attributes']:_0x13b670[_0x9e3c('0x26')];if(!_0x92e60f[_0x9e3c('0x24')][_0x9e3c('0x2a')](_0x9e3c('0x2b'))){_0x2ea81e[_0x9e3c('0x15')]=qs['limit'](_0x92e60f[_0x9e3c('0x24')]['limit']);_0x2ea81e[_0x9e3c('0x13')]=qs[_0x9e3c('0x13')](_0x92e60f['query'][_0x9e3c('0x13')]);}_0x2ea81e[_0x9e3c('0x2c')]=qs[_0x9e3c('0x2d')](_0x92e60f[_0x9e3c('0x24')][_0x9e3c('0x2d')]);_0x2ea81e[_0x9e3c('0x2e')]=qs['filters'](_['pick'](_0x92e60f['query'],_0x13b670[_0x9e3c('0x25')]),_0x4c4f03);if(_0x92e60f[_0x9e3c('0x24')][_0x9e3c('0x2f')]){_0x2ea81e[_0x9e3c('0x2e')]=_[_0x9e3c('0x30')](_0x2ea81e[_0x9e3c('0x2e')],{'$or':_[_0x9e3c('0x20')](_0x4c4f03,function(_0x3eb044){if(_0x3eb044[_0x9e3c('0x23')]!=='VIRTUAL'){var _0x20c172={};_0x20c172[_0x3eb044[_0x9e3c('0x1d')]]={'$like':'%'+_0x92e60f['query']['filter']+'%'};return _0x20c172;}})});}_0x2ea81e=_[_0x9e3c('0x30')]({},_0x2ea81e,_0x92e60f[_0x9e3c('0x31')]);var _0x450c8a={'where':_0x2ea81e[_0x9e3c('0x2e')]};return db['Network']['count'](_0x450c8a)[_0x9e3c('0x8')](function(_0x765bd6){_0x535dce[_0x9e3c('0x16')]=_0x765bd6;if(_0x92e60f[_0x9e3c('0x24')][_0x9e3c('0x32')]){_0x2ea81e[_0x9e3c('0x33')]=[{'all':!![]}];}return db[_0x9e3c('0x21')]['findAll'](_0x2ea81e);})[_0x9e3c('0x8')](function(_0x1607a9){_0x535dce[_0x9e3c('0x34')]=_0x1607a9;return _0x535dce;})[_0x9e3c('0x8')](respondWithFilteredResult(_0x462c10,_0x2ea81e))[_0x9e3c('0x12')](handleError(_0x462c10,null));};exports[_0x9e3c('0x35')]=function(_0x16a705,_0x56f9fa){var _0x127fb7={'raw':!![],'where':{'id':_0x16a705[_0x9e3c('0x36')]['id']}},_0x55886d={};_0x55886d[_0x9e3c('0x26')]=_['keys'](db[_0x9e3c('0x21')][_0x9e3c('0x22')]);_0x55886d[_0x9e3c('0x24')]=_[_0x9e3c('0x37')](_0x16a705[_0x9e3c('0x24')]);_0x55886d[_0x9e3c('0x25')]=_['intersection'](_0x55886d[_0x9e3c('0x26')],_0x55886d['query']);_0x127fb7[_0x9e3c('0x29')]=_[_0x9e3c('0x27')](_0x55886d[_0x9e3c('0x26')],qs[_0x9e3c('0x28')](_0x16a705['query'][_0x9e3c('0x28')]));_0x127fb7[_0x9e3c('0x29')]=_0x127fb7['attributes']['length']?_0x127fb7[_0x9e3c('0x29')]:_0x55886d[_0x9e3c('0x26')];if(_0x16a705[_0x9e3c('0x24')][_0x9e3c('0x32')]){_0x127fb7[_0x9e3c('0x33')]=[{'all':!![]}];}_0x127fb7=_[_0x9e3c('0x30')]({},_0x127fb7,_0x16a705[_0x9e3c('0x31')]);return db[_0x9e3c('0x21')][_0x9e3c('0x38')](_0x127fb7)[_0x9e3c('0x8')](handleEntityNotFound(_0x56f9fa,null))[_0x9e3c('0x8')](respondWithResult(_0x56f9fa,null))[_0x9e3c('0x12')](handleError(_0x56f9fa,null));};exports[_0x9e3c('0x39')]=function(_0x32367b,_0x5c1beb){var _0xa9fb8c;return db[_0x9e3c('0x21')][_0x9e3c('0x39')](_0x32367b['body'],{'raw':!![]})[_0x9e3c('0x8')](function(_0x4e2243){_0xa9fb8c=_0x4e2243;return db[_0x9e3c('0x21')][_0x9e3c('0x3a')]({'where':{'type':_0x32367b[_0x9e3c('0x3b')]['type']},'raw':!![]});})[_0x9e3c('0x8')](function(_0x36ceff){if(_0xa9fb8c[_0x9e3c('0x23')][_0x9e3c('0x3c')]()==_0x9e3c('0x3d')){var _0x21385a=fs[_0x9e3c('0x3e')](path[_0x9e3c('0x3f')](config[_0x9e3c('0x40')],_0x9e3c('0x41')),_0x9e3c('0x42'));var _0x5b900a=ejs[_0x9e3c('0x43')](_0x21385a,{'networks':_0x36ceff||[]});fs[_0x9e3c('0x44')](_0x9e3c('0x45'),_0x5b900a);return respondWithRpcPromise(_0x9e3c('0x46'),'create',{'module':_0x9e3c('0x47')});}else if(_0xa9fb8c[_0x9e3c('0x23')]['toUpperCase']()=='TURN'){var _0x20ed09=fs['readFileSync'](path[_0x9e3c('0x3f')](config[_0x9e3c('0x40')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x15d650=ejs[_0x9e3c('0x43')](_0x20ed09,{'networks':_0x36ceff||[]});fs[_0x9e3c('0x44')](_0x9e3c('0x48'),_0x15d650);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x39'),{'module':_0x9e3c('0x47')});}else{var _0x26577b=fs[_0x9e3c('0x3e')](path[_0x9e3c('0x3f')](config[_0x9e3c('0x40')],_0x9e3c('0x49')),'utf8');var _0x5beae2=ejs[_0x9e3c('0x43')](_0x26577b,{'networks':_0x36ceff||[]});fs[_0x9e3c('0x44')](util[_0x9e3c('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x32367b[_0x9e3c('0x3b')]['type']['toLowerCase']()),_0x5beae2);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x39'),{'module':'chan_sip.so'});}})[_0x9e3c('0x8')](function(){return _0xa9fb8c;})[_0x9e3c('0x8')](respondWithResult(_0x5c1beb,0xc9))[_0x9e3c('0x12')](handleError(_0x5c1beb,null));};exports['update']=function(_0x26326f,_0x7214fc){var _0x2d3058;return db[_0x9e3c('0x21')][_0x9e3c('0x38')]({'where':{'id':_0x26326f[_0x9e3c('0x36')]['id']}})[_0x9e3c('0x8')](handleEntityNotFound(_0x7214fc,null))['then'](saveUpdates(_0x26326f[_0x9e3c('0x3b')],null))['then'](function(_0x168ceb){if(_0x168ceb){_0x2d3058=_0x168ceb;return db['Network'][_0x9e3c('0x3a')]({'where':{'type':_0x2d3058[_0x9e3c('0x23')]},'raw':!![]});}return null;})['then'](function(_0x1e70ea){if(_0x2d3058[_0x9e3c('0x23')]['toUpperCase']()=='STUN'){var _0x1be4a7=fs[_0x9e3c('0x3e')](path[_0x9e3c('0x3f')](config[_0x9e3c('0x40')],_0x9e3c('0x41')),_0x9e3c('0x42'));var _0xb48eec=ejs[_0x9e3c('0x43')](_0x1be4a7,{'networks':_0x1e70ea||[]});fs[_0x9e3c('0x44')](_0x9e3c('0x45'),_0xb48eec);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x4b'),{'module':_0x9e3c('0x47')});}else if(_0x2d3058[_0x9e3c('0x23')][_0x9e3c('0x3c')]()=='TURN'){var _0x3a952b=fs['readFileSync'](path['join'](config[_0x9e3c('0x40')],_0x9e3c('0x4c')),_0x9e3c('0x42'));var _0x4085de=ejs['render'](_0x3a952b,{'networks':_0x1e70ea||[]});fs['writeFileSync'](_0x9e3c('0x48'),_0x4085de);return respondWithRpcPromise(_0x9e3c('0x46'),'update',{'module':_0x9e3c('0x47')});}else{var _0x289a31=fs[_0x9e3c('0x3e')](path[_0x9e3c('0x3f')](config[_0x9e3c('0x40')],_0x9e3c('0x49')),'utf8');var _0x1d3a64=ejs[_0x9e3c('0x43')](_0x289a31,{'networks':_0x1e70ea||[]});fs[_0x9e3c('0x44')](util[_0x9e3c('0x4a')](_0x9e3c('0x4d'),_0x26326f['body']['type'][_0x9e3c('0x4e')]()),_0x1d3a64);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x4b'),{'module':_0x9e3c('0x4f')});}})[_0x9e3c('0x8')](function(_0x424d41){if(_0x424d41){return _0x2d3058;}return null;})[_0x9e3c('0x8')](respondWithResult(_0x7214fc,null))[_0x9e3c('0x12')](handleError(_0x7214fc,null));};exports[_0x9e3c('0x50')]=function(_0x57d88c,_0x1a1f0e){var _0x532685;return db['Network'][_0x9e3c('0x38')]({'where':{'id':_0x57d88c[_0x9e3c('0x36')]['id']}})['then'](function(_0x107c4a){_0x532685=_0x107c4a;return _0x107c4a;})[_0x9e3c('0x8')](handleEntityNotFound(_0x1a1f0e,null))[_0x9e3c('0x8')](removeEntity(_0x1a1f0e,null))[_0x9e3c('0x8')](function(){if(_0x532685){return db[_0x9e3c('0x21')][_0x9e3c('0x3a')]({'where':{'type':_0x532685[_0x9e3c('0x23')]},'raw':!![]});}})[_0x9e3c('0x8')](function(_0x495d34){if(_0x532685['type'][_0x9e3c('0x3c')]()==_0x9e3c('0x3d')){var _0x3b8e6d=fs[_0x9e3c('0x3e')](path['join'](config['root'],_0x9e3c('0x41')),_0x9e3c('0x42'));var _0x3795f9=ejs[_0x9e3c('0x43')](_0x3b8e6d,{'networks':_0x495d34||[]});fs[_0x9e3c('0x44')](_0x9e3c('0x45'),_0x3795f9);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x532685[_0x9e3c('0x23')][_0x9e3c('0x3c')]()==_0x9e3c('0x51')){var _0x4d369f=fs[_0x9e3c('0x3e')](path[_0x9e3c('0x3f')](config[_0x9e3c('0x40')],_0x9e3c('0x4c')),_0x9e3c('0x42'));var _0x4b8c78=ejs[_0x9e3c('0x43')](_0x4d369f,{'networks':_0x495d34||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x4b8c78);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x50'),{'module':'res_stun_monitor.so'});}else{var _0x4185f2=fs[_0x9e3c('0x3e')](path[_0x9e3c('0x3f')](config['root'],'server/files/templates/network.ejs'),_0x9e3c('0x42'));var _0x313e6a=ejs[_0x9e3c('0x43')](_0x4185f2,{'networks':_0x495d34||[]});fs[_0x9e3c('0x44')](util[_0x9e3c('0x4a')](_0x9e3c('0x4d'),_0x532685[_0x9e3c('0x23')][_0x9e3c('0x4e')]()),_0x313e6a);return respondWithRpcPromise(_0x9e3c('0x46'),_0x9e3c('0x50'),{'module':'chan_sip.so'});}})[_0x9e3c('0x12')](handleError(_0x1a1f0e,null));}; \ No newline at end of file +var _0x6516=['request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','offset','limit','undefined','count','status','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','Network','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','fields','find','create','body','toUpperCase','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','readFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','path','ejs','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s'];(function(_0x42f45f,_0x1b7fdd){var _0x2db896=function(_0x1dc1ad){while(--_0x1dc1ad){_0x42f45f['push'](_0x42f45f['shift']());}};_0x2db896(++_0x1b7fdd);}(_0x6516,0xed));var _0x6651=function(_0x2ab358,_0x15c4ca){_0x2ab358=_0x2ab358-0x0;var _0x2ef2eb=_0x6516[_0x2ab358];return _0x2ef2eb;};'use strict';var util=require('util');var path=require(_0x6651('0x0'));var ejs=require(_0x6651('0x1'));var fs=require('fs');var _=require(_0x6651('0x2'));var qs=require(_0x6651('0x3'));var logger=require('../../config/logger')('api');var config=require(_0x6651('0x4'));var db=require(_0x6651('0x5'))['db'];var jayson=require(_0x6651('0x6'));var client=jayson[_0x6651('0x7')][_0x6651('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3440ec,_0x3b3b5b,_0x11d2f9,_0x52fe37){return new Promise(function(_0x2f2bc8,_0x55a84e){var _0x582297=_0x52fe37||client;return _0x582297[_0x6651('0x9')](_0x3440ec,_0x11d2f9)[_0x6651('0xa')](function(_0x14c15f){logger['info'](_0x6651('0xb'),_0x3b3b5b,_0x6651('0xc'));logger[_0x6651('0xd')](_0x6651('0xe'),_0x3b3b5b,_0x6651('0xc'),JSON['stringify'](_0x14c15f));if(_0x14c15f[_0x6651('0xf')]){if(_0x14c15f[_0x6651('0xf')][_0x6651('0x10')]===0x1f4){logger[_0x6651('0xf')](_0x6651('0xb'),_0x3b3b5b,_0x14c15f[_0x6651('0xf')]['message']);return _0x55a84e(_0x14c15f[_0x6651('0xf')][_0x6651('0x11')]);}logger[_0x6651('0xf')](_0x6651('0xb'),_0x3b3b5b,_0x14c15f['error'][_0x6651('0x11')]);return _0x2f2bc8(_0x14c15f[_0x6651('0xf')][_0x6651('0x11')]);}else{logger[_0x6651('0x12')]('Network,\x20%s,\x20%s',_0x3b3b5b,_0x6651('0xc'));_0x2f2bc8(_0x14c15f[_0x6651('0x13')][_0x6651('0x11')]);}})[_0x6651('0x14')](function(_0xfac511){logger['error']('Network,\x20%s,\x20%s',_0x3b3b5b,_0xfac511);_0x55a84e(_0xfac511);});});}function respondWithResult(_0x477568,_0x52fe8e){_0x52fe8e=_0x52fe8e||0xc8;return function(_0x27a104){if(_0x27a104){return _0x477568['status'](_0x52fe8e)['json'](_0x27a104);}};}function respondWithFilteredResult(_0x10d782,_0x50b1fc){return function(_0x61110c){if(_0x61110c){var _0x2ceb20=typeof _0x50b1fc[_0x6651('0x15')]==='undefined'&&typeof _0x50b1fc[_0x6651('0x16')]===_0x6651('0x17');var _0x24f1c4=_0x61110c[_0x6651('0x18')];var _0x4c8998=_0x2ceb20?0x0:_0x50b1fc[_0x6651('0x15')];var _0x89b799=_0x2ceb20?_0x61110c[_0x6651('0x18')]:_0x50b1fc['offset']+_0x50b1fc['limit'];var _0x1e27e7;if(_0x89b799>=_0x24f1c4){_0x89b799=_0x24f1c4;_0x1e27e7=0xc8;}else{_0x1e27e7=0xce;}_0x10d782[_0x6651('0x19')](_0x1e27e7);return _0x10d782['set'](_0x6651('0x1a'),_0x4c8998+'-'+_0x89b799+'/'+_0x24f1c4)[_0x6651('0x1b')](_0x61110c);}return null;};}function saveUpdates(_0x3c255a){return function(_0x26921b){if(_0x26921b){return _0x26921b[_0x6651('0x1c')](_0x3c255a)['then'](function(_0x4d0792){return _0x4d0792;});}return null;};}function removeEntity(_0x22b52c){return function(_0x70e507){if(_0x70e507){return _0x70e507[_0x6651('0x1d')]()[_0x6651('0xa')](function(){_0x22b52c[_0x6651('0x19')](0xcc)[_0x6651('0x1e')]();});}};}function handleEntityNotFound(_0x4107c9){return function(_0x4ad629){if(!_0x4ad629){_0x4107c9[_0x6651('0x1f')](0x194);}return _0x4ad629;};}function handleError(_0x46b103,_0x5156ed){_0x5156ed=_0x5156ed||0x1f4;return function(_0x782515){logger[_0x6651('0xf')](_0x782515[_0x6651('0x20')]);if(_0x782515[_0x6651('0x21')]){delete _0x782515[_0x6651('0x21')];}_0x46b103[_0x6651('0x19')](_0x5156ed)[_0x6651('0x22')](_0x782515);};}exports['index']=function(_0x405042,_0x1b4c3b){var _0x175371={},_0x52e309={},_0x41450b={'count':0x0,'rows':[]};var _0x22e11d=_['map'](db[_0x6651('0x23')]['rawAttributes'],function(_0x4c97d5){return{'name':_0x4c97d5[_0x6651('0x24')],'type':_0x4c97d5[_0x6651('0x25')]['key']};});_0x52e309['model']=_[_0x6651('0x26')](_0x22e11d,_0x6651('0x21'));_0x52e309[_0x6651('0x27')]=_[_0x6651('0x28')](_0x405042[_0x6651('0x27')]);_0x52e309[_0x6651('0x29')]=_[_0x6651('0x2a')](_0x52e309[_0x6651('0x2b')],_0x52e309[_0x6651('0x27')]);_0x175371[_0x6651('0x2c')]=_[_0x6651('0x2a')](_0x52e309[_0x6651('0x2b')],qs['fields'](_0x405042[_0x6651('0x27')]['fields']));_0x175371[_0x6651('0x2c')]=_0x175371[_0x6651('0x2c')][_0x6651('0x2d')]?_0x175371[_0x6651('0x2c')]:_0x52e309[_0x6651('0x2b')];if(!_0x405042[_0x6651('0x27')][_0x6651('0x2e')](_0x6651('0x2f'))){_0x175371[_0x6651('0x16')]=qs[_0x6651('0x16')](_0x405042['query']['limit']);_0x175371[_0x6651('0x15')]=qs[_0x6651('0x15')](_0x405042[_0x6651('0x27')][_0x6651('0x15')]);}_0x175371['order']=qs[_0x6651('0x30')](_0x405042[_0x6651('0x27')][_0x6651('0x30')]);_0x175371['where']=qs[_0x6651('0x29')](_['pick'](_0x405042[_0x6651('0x27')],_0x52e309[_0x6651('0x29')]),_0x22e11d);if(_0x405042[_0x6651('0x27')]['filter']){_0x175371[_0x6651('0x31')]=_[_0x6651('0x32')](_0x175371['where'],{'$or':_[_0x6651('0x26')](_0x22e11d,function(_0x4057d5){if(_0x4057d5[_0x6651('0x25')]!==_0x6651('0x33')){var _0x55a05d={};_0x55a05d[_0x4057d5[_0x6651('0x21')]]={'$like':'%'+_0x405042[_0x6651('0x27')][_0x6651('0x34')]+'%'};return _0x55a05d;}})});}_0x175371=_[_0x6651('0x32')]({},_0x175371,_0x405042[_0x6651('0x35')]);var _0x3a00e5={'where':_0x175371[_0x6651('0x31')]};return db[_0x6651('0x23')][_0x6651('0x18')](_0x3a00e5)[_0x6651('0xa')](function(_0x11d1b0){_0x41450b[_0x6651('0x18')]=_0x11d1b0;if(_0x405042['query'][_0x6651('0x36')]){_0x175371[_0x6651('0x37')]=[{'all':!![]}];}return db[_0x6651('0x23')][_0x6651('0x38')](_0x175371);})[_0x6651('0xa')](function(_0x23a29c){_0x41450b[_0x6651('0x39')]=_0x23a29c;return _0x41450b;})[_0x6651('0xa')](respondWithFilteredResult(_0x1b4c3b,_0x175371))[_0x6651('0x14')](handleError(_0x1b4c3b,null));};exports['show']=function(_0x4ba27c,_0x5864b0){var _0xd0d9dd={'raw':!![],'where':{'id':_0x4ba27c['params']['id']}},_0x47f558={};_0x47f558[_0x6651('0x2b')]=_['keys'](db['Network']['rawAttributes']);_0x47f558[_0x6651('0x27')]=_[_0x6651('0x28')](_0x4ba27c[_0x6651('0x27')]);_0x47f558[_0x6651('0x29')]=_['intersection'](_0x47f558[_0x6651('0x2b')],_0x47f558[_0x6651('0x27')]);_0xd0d9dd[_0x6651('0x2c')]=_[_0x6651('0x2a')](_0x47f558[_0x6651('0x2b')],qs[_0x6651('0x3a')](_0x4ba27c[_0x6651('0x27')]['fields']));_0xd0d9dd[_0x6651('0x2c')]=_0xd0d9dd[_0x6651('0x2c')][_0x6651('0x2d')]?_0xd0d9dd['attributes']:_0x47f558[_0x6651('0x2b')];if(_0x4ba27c[_0x6651('0x27')][_0x6651('0x36')]){_0xd0d9dd[_0x6651('0x37')]=[{'all':!![]}];}_0xd0d9dd=_[_0x6651('0x32')]({},_0xd0d9dd,_0x4ba27c['options']);return db[_0x6651('0x23')][_0x6651('0x3b')](_0xd0d9dd)[_0x6651('0xa')](handleEntityNotFound(_0x5864b0,null))[_0x6651('0xa')](respondWithResult(_0x5864b0,null))[_0x6651('0x14')](handleError(_0x5864b0,null));};exports[_0x6651('0x3c')]=function(_0x5ed8d4,_0x4decb5){var _0x12fc91;return db[_0x6651('0x23')]['create'](_0x5ed8d4[_0x6651('0x3d')],{'raw':!![]})[_0x6651('0xa')](function(_0xdec57c){_0x12fc91=_0xdec57c;return db['Network'][_0x6651('0x38')]({'where':{'type':_0x5ed8d4[_0x6651('0x3d')][_0x6651('0x25')]},'raw':!![]});})[_0x6651('0xa')](function(_0x5cf491){if(_0x12fc91[_0x6651('0x25')][_0x6651('0x3e')]()==_0x6651('0x3f')){var _0x3fe92e=fs['readFileSync'](path['join'](config['root'],_0x6651('0x40')),_0x6651('0x41'));var _0x20f73f=ejs[_0x6651('0x42')](_0x3fe92e,{'networks':_0x5cf491||[]});fs[_0x6651('0x43')](_0x6651('0x44'),_0x20f73f);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x3c'),{'module':_0x6651('0x46')});}else if(_0x12fc91['type']['toUpperCase']()==_0x6651('0x47')){var _0x552f08=fs['readFileSync'](path[_0x6651('0x48')](config[_0x6651('0x49')],_0x6651('0x4a')),_0x6651('0x41'));var _0x3136cc=ejs[_0x6651('0x42')](_0x552f08,{'networks':_0x5cf491||[]});fs[_0x6651('0x43')]('/etc/asterisk/turn_xcally.conf',_0x3136cc);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x3c'),{'module':_0x6651('0x46')});}else{var _0x100492=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config[_0x6651('0x49')],'server/files/templates/network.ejs'),_0x6651('0x41'));var _0x3b86bb=ejs['render'](_0x100492,{'networks':_0x5cf491||[]});fs[_0x6651('0x43')](util[_0x6651('0x4c')](_0x6651('0x4d'),_0x5ed8d4['body'][_0x6651('0x25')][_0x6651('0x4e')]()),_0x3b86bb);return respondWithRpcPromise(_0x6651('0x45'),'create',{'module':_0x6651('0x4f')});}})['then'](function(){return _0x12fc91;})[_0x6651('0xa')](respondWithResult(_0x4decb5,0xc9))[_0x6651('0x14')](handleError(_0x4decb5,null));};exports[_0x6651('0x1c')]=function(_0x25fc51,_0x577825){var _0x2c8e5f;return db[_0x6651('0x23')]['find']({'where':{'id':_0x25fc51[_0x6651('0x50')]['id']}})[_0x6651('0xa')](handleEntityNotFound(_0x577825,null))[_0x6651('0xa')](saveUpdates(_0x25fc51[_0x6651('0x3d')],null))[_0x6651('0xa')](function(_0x4c3fbd){if(_0x4c3fbd){_0x2c8e5f=_0x4c3fbd;return db[_0x6651('0x23')][_0x6651('0x38')]({'where':{'type':_0x2c8e5f[_0x6651('0x25')]},'raw':!![]});}return null;})[_0x6651('0xa')](function(_0xaf8d7a){if(_0x2c8e5f[_0x6651('0x25')][_0x6651('0x3e')]()=='STUN'){var _0x42e0ae=fs['readFileSync'](path[_0x6651('0x48')](config[_0x6651('0x49')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x488be3=ejs[_0x6651('0x42')](_0x42e0ae,{'networks':_0xaf8d7a||[]});fs['writeFileSync'](_0x6651('0x44'),_0x488be3);return respondWithRpcPromise('Reload',_0x6651('0x1c'),{'module':'res_stun_monitor.so'});}else if(_0x2c8e5f[_0x6651('0x25')][_0x6651('0x3e')]()==_0x6651('0x47')){var _0x3a42c8=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config[_0x6651('0x49')],_0x6651('0x4a')),_0x6651('0x41'));var _0x4c10f4=ejs[_0x6651('0x42')](_0x3a42c8,{'networks':_0xaf8d7a||[]});fs['writeFileSync'](_0x6651('0x51'),_0x4c10f4);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x1c'),{'module':_0x6651('0x46')});}else{var _0x4cb542=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config[_0x6651('0x49')],'server/files/templates/network.ejs'),_0x6651('0x41'));var _0x54414e=ejs['render'](_0x4cb542,{'networks':_0xaf8d7a||[]});fs[_0x6651('0x43')](util['format'](_0x6651('0x4d'),_0x25fc51[_0x6651('0x3d')][_0x6651('0x25')]['toLowerCase']()),_0x54414e);return respondWithRpcPromise(_0x6651('0x45'),'update',{'module':_0x6651('0x4f')});}})[_0x6651('0xa')](function(_0x230419){if(_0x230419){return _0x2c8e5f;}return null;})['then'](respondWithResult(_0x577825,null))[_0x6651('0x14')](handleError(_0x577825,null));};exports[_0x6651('0x1d')]=function(_0x1ce3bb,_0x19c2b7){var _0x344d60;return db[_0x6651('0x23')]['find']({'where':{'id':_0x1ce3bb[_0x6651('0x50')]['id']}})[_0x6651('0xa')](function(_0xc8d5e4){_0x344d60=_0xc8d5e4;return _0xc8d5e4;})[_0x6651('0xa')](handleEntityNotFound(_0x19c2b7,null))[_0x6651('0xa')](removeEntity(_0x19c2b7,null))[_0x6651('0xa')](function(){if(_0x344d60){return db[_0x6651('0x23')][_0x6651('0x38')]({'where':{'type':_0x344d60[_0x6651('0x25')]},'raw':!![]});}})[_0x6651('0xa')](function(_0x429231){if(_0x344d60[_0x6651('0x25')]['toUpperCase']()==_0x6651('0x3f')){var _0x29f8a5=fs['readFileSync'](path['join'](config[_0x6651('0x49')],_0x6651('0x40')),_0x6651('0x41'));var _0x445f86=ejs[_0x6651('0x42')](_0x29f8a5,{'networks':_0x429231||[]});fs[_0x6651('0x43')](_0x6651('0x44'),_0x445f86);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x1d'),{'module':_0x6651('0x46')});}else if(_0x344d60['type'][_0x6651('0x3e')]()==_0x6651('0x47')){var _0x16f619=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config['root'],_0x6651('0x4a')),_0x6651('0x41'));var _0x5d4d9c=ejs[_0x6651('0x42')](_0x16f619,{'networks':_0x429231||[]});fs[_0x6651('0x43')]('/etc/asterisk/turn_xcally.conf',_0x5d4d9c);return respondWithRpcPromise('Reload',_0x6651('0x1d'),{'module':_0x6651('0x46')});}else{var _0x2329c9=fs['readFileSync'](path[_0x6651('0x48')](config[_0x6651('0x49')],_0x6651('0x52')),_0x6651('0x41'));var _0x1aee1b=ejs[_0x6651('0x42')](_0x2329c9,{'networks':_0x429231||[]});fs[_0x6651('0x43')](util[_0x6651('0x4c')](_0x6651('0x4d'),_0x344d60[_0x6651('0x25')][_0x6651('0x4e')]()),_0x1aee1b);return respondWithRpcPromise(_0x6651('0x45'),'destroy',{'module':_0x6651('0x4f')});}})[_0x6651('0x14')](handleError(_0x19c2b7,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e5b077c..9333723 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe130=['api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','exports','define','lodash','util'];(function(_0xb545e0,_0x255020){var _0x5e37c9=function(_0x3b32b2){while(--_0x3b32b2){_0xb545e0['push'](_0xb545e0['shift']());}};_0x5e37c9(++_0x255020);}(_0xe130,0x127));var _0x0e13=function(_0x59fba8,_0x2a727e){_0x59fba8=_0x59fba8-0x0;var _0xc7fef1=_0xe130[_0x59fba8];return _0xc7fef1;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var logger=require('../../config/logger')(_0x0e13('0x2'));var moment=require(_0x0e13('0x3'));var BPromise=require(_0x0e13('0x4'));var rp=require(_0x0e13('0x5'));var fs=require('fs');var path=require(_0x0e13('0x6'));var rimraf=require('rimraf');var config=require(_0x0e13('0x7'));var attributes=require(_0x0e13('0x8'));module[_0x0e13('0x9')]=function(_0xcd92e,_0x50a80e){return _0xcd92e[_0x0e13('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc9d=['./network.attributes','exports','define','network','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x220ae9,_0x1d9cfa){var _0x164801=function(_0x285bec){while(--_0x285bec){_0x220ae9['push'](_0x220ae9['shift']());}};_0x164801(++_0x1d9cfa);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x1fe67a,_0x3794b1){_0x1fe67a=_0x1fe67a-0x0;var _0x3c5f44=_0xbc9d[_0x1fe67a];return _0x3c5f44;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var logger=require(_0xdbc9('0x2'))(_0xdbc9('0x3'));var moment=require(_0xdbc9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdbc9('0x5'));var config=require(_0xdbc9('0x6'));var attributes=require(_0xdbc9('0x7'));module[_0xdbc9('0x8')]=function(_0x6ab397,_0x7c4c55){return _0x6ab397[_0xdbc9('0x9')]('Network',attributes,{'tableName':_0xdbc9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index d0b2be4..71be142 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x971bf0,_0x12bbfb){var _0x510cd1=function(_0x524548){while(--_0x524548){_0x971bf0['push'](_0x971bf0['shift']());}};_0x510cd1(++_0x12bbfb);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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 _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(_0x236a55,_0x145ba8){var _0x435fef=function(_0x3699e1){while(--_0x3699e1){_0x236a55['push'](_0x236a55['shift']());}};_0x435fef(++_0x145ba8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 0874a7d..b9cfada 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4c9098,_0x15d815){var _0x29be7c=function(_0x16ba37){while(--_0x16ba37){_0x4c9098['push'](_0x4c9098['shift']());}};_0x29be7c(++_0x15d815);}(_0x53ec,0x176));var _0xc53e=function(_0x11c331,_0x523ccf){_0x11c331=_0x11c331-0x0;var _0x1b89e1=_0x53ec[_0x11c331];return _0x1b89e1;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc53e('0x2'));var router=express[_0xc53e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x5'));var controller=require('./openchannelAccount.controller');router[_0xc53e('0x6')]('/',auth[_0xc53e('0x7')](),controller[_0xc53e('0x8')]);router[_0xc53e('0x6')](_0xc53e('0x9'),auth[_0xc53e('0x7')](),controller[_0xc53e('0xa')]);router[_0xc53e('0x6')](_0xc53e('0xb'),auth[_0xc53e('0x7')](),controller['show']);router[_0xc53e('0x6')]('/:id/dispositions',auth[_0xc53e('0x7')](),controller[_0xc53e('0xc')]);router[_0xc53e('0x6')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xc53e('0xe'),auth[_0xc53e('0x7')](),controller[_0xc53e('0xf')]);router['get'](_0xc53e('0x10'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x11')]);router['get'](_0xc53e('0x12'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x13')]);router['post']('/',auth[_0xc53e('0x7')](),controller['create']);router[_0xc53e('0x14')](_0xc53e('0x15'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x16')]);router[_0xc53e('0x14')](_0xc53e('0xd'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x14')](_0xc53e('0x18'),controller[_0xc53e('0x19')]);router[_0xc53e('0x14')](_0xc53e('0xe'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x1a')]);router[_0xc53e('0x14')](_0xc53e('0x12'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x1b')]);router['post'](_0xc53e('0x1c'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x1d')]);router[_0xc53e('0x1e')](_0xc53e('0xb'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x1f')]);router['delete'](_0xc53e('0xb'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x20')]);router['delete']('/:id/dispositions',auth[_0xc53e('0x7')](),controller[_0xc53e('0x21')]);router[_0xc53e('0x22')]('/:id/canned_answers',auth[_0xc53e('0x7')](),controller[_0xc53e('0x23')]);router[_0xc53e('0x22')](_0xc53e('0x12'),auth[_0xc53e('0x7')](),controller[_0xc53e('0x24')]);module[_0xc53e('0x25')]=router; \ No newline at end of file +var _0x4f95=['/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','notify','/:id/applications','addApplications','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/:id','show','/:id/dispositions'];(function(_0x3e948f,_0x19484d){var _0x4cc3de=function(_0x335e95){while(--_0x335e95){_0x3e948f['push'](_0x3e948f['shift']());}};_0x4cc3de(++_0x19484d);}(_0x4f95,0x76));var _0x54f9=function(_0x38093b,_0x55be97){_0x38093b=_0x38093b-0x0;var _0x16e592=_0x4f95[_0x38093b];return _0x16e592;};'use strict';var multer=require(_0x54f9('0x0'));var util=require(_0x54f9('0x1'));var path=require(_0x54f9('0x2'));var timeout=require(_0x54f9('0x3'));var express=require(_0x54f9('0x4'));var router=express[_0x54f9('0x5')]();var fs_extra=require(_0x54f9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x54f9('0x7'));var config=require('../../config/environment');var controller=require(_0x54f9('0x8'));router[_0x54f9('0x9')]('/',auth[_0x54f9('0xa')](),controller['index']);router[_0x54f9('0x9')]('/describe',auth[_0x54f9('0xa')](),controller['describe']);router['get'](_0x54f9('0xb'),auth[_0x54f9('0xa')](),controller[_0x54f9('0xc')]);router['get'](_0x54f9('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x54f9('0x9')](_0x54f9('0xe'),auth[_0x54f9('0xa')](),controller[_0x54f9('0xf')]);router[_0x54f9('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x54f9('0x10'),auth[_0x54f9('0xa')](),controller[_0x54f9('0x11')]);router[_0x54f9('0x9')](_0x54f9('0x12'),auth[_0x54f9('0xa')](),controller[_0x54f9('0x13')]);router['post']('/',auth[_0x54f9('0xa')](),controller[_0x54f9('0x14')]);router[_0x54f9('0x15')](_0x54f9('0xd'),auth[_0x54f9('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x54f9('0xa')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x54f9('0x16')]);router[_0x54f9('0x15')](_0x54f9('0x17'),auth[_0x54f9('0xa')](),controller[_0x54f9('0x18')]);router[_0x54f9('0x15')](_0x54f9('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x54f9('0x19'),auth['isAuthenticated'](),controller[_0x54f9('0x1a')]);router[_0x54f9('0x1b')]('/:id',auth[_0x54f9('0xa')](),controller[_0x54f9('0x1c')]);router['delete'](_0x54f9('0xb'),auth['isAuthenticated'](),controller[_0x54f9('0x1d')]);router[_0x54f9('0x1e')](_0x54f9('0xd'),auth['isAuthenticated'](),controller[_0x54f9('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x54f9('0xa')](),controller[_0x54f9('0x20')]);router[_0x54f9('0x1e')]('/:id/users',auth[_0x54f9('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 117d537..d3b0a34 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x609d=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x609d,0x106));var _0xd609=function(_0xd91aea,_0x90202d){_0xd91aea=_0xd91aea-0x0;var _0xed7cb0=_0x609d[_0xd91aea];return _0xed7cb0;};'use strict';var Sequelize=require(_0xd609('0x0'));var rs=require(_0xd609('0x1'));module[_0xd609('0x2')]={'name':{'type':Sequelize[_0xd609('0x3')],'unique':_0xd609('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd609('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd609('0x5')],'defaultValue':function(){return _0xd609('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd609('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xd609('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd609('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd609('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xd609('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xd609('0x7')],'defaultValue':![],'comment':_0xd609('0xa'),'set':function(_0x4ab933){if(!_0x4ab933)this[_0xd609('0xb')](_0xd609('0xc'),null);this[_0xd609('0xb')]('mandatoryDisposition',_0x4ab933);}}}; \ No newline at end of file +var _0x9ae5=['name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x55f029,_0x1024e9){var _0x6c02bd=function(_0x2ffde6){while(--_0x2ffde6){_0x55f029['push'](_0x55f029['shift']());}};_0x6c02bd(++_0x1024e9);}(_0x9ae5,0x1a0));var _0x59ae=function(_0x4908c2,_0x5572d2){_0x4908c2=_0x4908c2-0x0;var _0x2820c2=_0x9ae5[_0x4908c2];return _0x2820c2;};'use strict';var Sequelize=require(_0x59ae('0x0'));var rs=require(_0x59ae('0x1'));module[_0x59ae('0x2')]={'name':{'type':Sequelize[_0x59ae('0x3')],'unique':_0x59ae('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x59ae('0x3')]},'token':{'type':Sequelize[_0x59ae('0x3')],'defaultValue':function(){return rs[_0x59ae('0x5')]();}},'replyUri':{'type':Sequelize[_0x59ae('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x59ae('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x59ae('0x6')],'defaultValue':function(){return _0x59ae('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x59ae('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x59ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x59ae('0x3')]},'queueTransfer':{'type':Sequelize[_0x59ae('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x59ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x59ae('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x59ae('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x59ae('0xb'),'set':function(_0x223303){if(!_0x223303)this[_0x59ae('0xc')](_0x59ae('0xd'),null);this[_0x59ae('0xc')](_0x59ae('0xe'),_0x223303);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 4906f20..0a7fc79 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe02=['catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','map','OpenchannelAccount','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','show','params','mandatoryDispositionPause','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','rawAttributes','nolimit','pick','Disposition','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','account','applications','Applications','list','asc','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','EventManager','sequelize','Transaction','OpenchannelApplication','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','Owner','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x44b014,_0x34c218){var _0x1c18c9=function(_0x45bfd3){while(--_0x45bfd3){_0x44b014['push'](_0x44b014['shift']());}};_0x1c18c9(++_0x34c218);}(_0xbe02,0x146));var _0x2be0=function(_0x115c85,_0x1b26de){_0x115c85=_0x115c85-0x0;var _0x569b25=_0xbe02[_0x115c85];return _0x569b25;};'use strict';var emlformat=require(_0x2be0('0x0'));var rimraf=require(_0x2be0('0x1'));var zipdir=require(_0x2be0('0x2'));var jsonpatch=require(_0x2be0('0x3'));var rp=require('request-promise');var moment=require(_0x2be0('0x4'));var BPromise=require(_0x2be0('0x5'));var Mustache=require(_0x2be0('0x6'));var util=require(_0x2be0('0x7'));var path=require(_0x2be0('0x8'));var sox=require(_0x2be0('0x9'));var csv=require(_0x2be0('0xa'));var ejs=require(_0x2be0('0xb'));var fs=require('fs');var fs_extra=require(_0x2be0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2be0('0xd'));var jsforce=require(_0x2be0('0xe'));var deskjs=require(_0x2be0('0xf'));var toCsv=require(_0x2be0('0xa'));var querystring=require(_0x2be0('0x10'));var Papa=require(_0x2be0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2be0('0x12'));var utils=require(_0x2be0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2be0('0x14'));var db=require(_0x2be0('0x15'))['db'];config[_0x2be0('0x16')]=_[_0x2be0('0x17')](config[_0x2be0('0x16')],{'host':_0x2be0('0x18'),'port':0x18eb});var socket=require(_0x2be0('0x19'))(new Redis(config[_0x2be0('0x16')]));require(_0x2be0('0x1a'))[_0x2be0('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2be0('0x1c')][_0x2be0('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x2be0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1e0c27,_0x5bcbc5,_0x334070,_0x30d623){return new BPromise(function(_0x137ce9,_0x1cedaa){var _0x1d4e04=_0x30d623||client;return _0x1d4e04[_0x2be0('0x1e')](_0x1e0c27,_0x334070)[_0x2be0('0x1f')](function(_0x415894){logger[_0x2be0('0x20')](_0x2be0('0x21'),_0x5bcbc5,_0x2be0('0x22'));logger[_0x2be0('0x23')](_0x2be0('0x24'),_0x5bcbc5,_0x2be0('0x22'),JSON[_0x2be0('0x25')](_0x415894));if(_0x415894[_0x2be0('0x26')]){if(_0x415894[_0x2be0('0x26')]['code']===0x1f4){logger['error'](_0x2be0('0x21'),_0x5bcbc5,_0x415894['error']['message']);return _0x1cedaa(_0x415894[_0x2be0('0x26')][_0x2be0('0x27')]);}logger[_0x2be0('0x26')](_0x2be0('0x21'),_0x5bcbc5,_0x415894[_0x2be0('0x26')][_0x2be0('0x27')]);return _0x137ce9(_0x415894[_0x2be0('0x26')][_0x2be0('0x27')]);}else{logger['info'](_0x2be0('0x21'),_0x5bcbc5,'request\x20sent');_0x137ce9(_0x415894['result'][_0x2be0('0x27')]);}})[_0x2be0('0x28')](function(_0x166aa1){logger[_0x2be0('0x26')](_0x2be0('0x21'),_0x5bcbc5,_0x166aa1);_0x1cedaa(_0x166aa1);});});}function respondWithStatusCode(_0x4b5f21,_0x21a62b){_0x21a62b=_0x21a62b||0xcc;return function(_0x50617d){if(_0x50617d){return _0x4b5f21[_0x2be0('0x29')](_0x21a62b);}return _0x4b5f21[_0x2be0('0x2a')](_0x21a62b)['end']();};}function respondWithResult(_0x5260d3,_0x1fd3eb){_0x1fd3eb=_0x1fd3eb||0xc8;return function(_0x20f866){if(_0x20f866){return _0x5260d3['status'](_0x1fd3eb)[_0x2be0('0x2b')](_0x20f866);}};}function respondWithFilteredResult(_0x36b490,_0x3eeb86){return function(_0x439888){if(_0x439888){var _0x3b97c0=typeof _0x3eeb86[_0x2be0('0x2c')]===_0x2be0('0x2d')&&typeof _0x3eeb86['limit']===_0x2be0('0x2d');var _0x4d2ad6=_0x439888[_0x2be0('0x2e')];var _0xa88b4f=_0x3b97c0?0x0:_0x3eeb86[_0x2be0('0x2c')];var _0x493b7c=_0x3b97c0?_0x439888[_0x2be0('0x2e')]:_0x3eeb86[_0x2be0('0x2c')]+_0x3eeb86[_0x2be0('0x2f')];var _0x5191e6;if(_0x493b7c>=_0x4d2ad6){_0x493b7c=_0x4d2ad6;_0x5191e6=0xc8;}else{_0x5191e6=0xce;}_0x36b490[_0x2be0('0x2a')](_0x5191e6);return _0x36b490[_0x2be0('0x30')](_0x2be0('0x31'),_0xa88b4f+'-'+_0x493b7c+'/'+_0x4d2ad6)[_0x2be0('0x2b')](_0x439888);}return null;};}function patchUpdates(_0x101114){return function(_0x4ee731){try{jsonpatch[_0x2be0('0x32')](_0x4ee731,_0x101114,!![]);}catch(_0x1bc509){return BPromise[_0x2be0('0x33')](_0x1bc509);}return _0x4ee731[_0x2be0('0x34')]();};}function saveUpdates(_0x779ef2,_0x554dd4){return function(_0x4c47b4){if(_0x4c47b4){return _0x4c47b4[_0x2be0('0x35')](_0x779ef2)[_0x2be0('0x1f')](function(_0x25c1ea){return _0x25c1ea;});}return null;};}function removeEntity(_0x5a53ac,_0x48b4cd){return function(_0x52f7b6){if(_0x52f7b6){return _0x52f7b6[_0x2be0('0x36')]()[_0x2be0('0x1f')](function(){var _0x11f12b=_0x52f7b6[_0x2be0('0x37')]({'plain':!![]});var _0x3c7227=_0x2be0('0x38');return db[_0x2be0('0x39')][_0x2be0('0x36')]({'where':{'type':_0x3c7227,'resourceId':_0x11f12b['id']}})[_0x2be0('0x1f')](function(){return _0x52f7b6;});})[_0x2be0('0x1f')](function(){_0x5a53ac[_0x2be0('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x260003,_0x1fb14e){return function(_0x42edd5){if(!_0x42edd5){_0x260003[_0x2be0('0x29')](0x194);}return _0x42edd5;};}function handleError(_0x1d1a64,_0x565623){_0x565623=_0x565623||0x1f4;return function(_0x27d35e){logger[_0x2be0('0x26')](_0x27d35e[_0x2be0('0x3a')]);if(_0x27d35e['name']){delete _0x27d35e[_0x2be0('0x3b')];}_0x1d1a64['status'](_0x565623)[_0x2be0('0x3c')](_0x27d35e);};}exports['index']=function(_0x4ea299,_0x309e91){var _0x4d6ccf={'include':[{'model':db[_0x2be0('0x3d')],'as':'mandatoryDispositionPause'}]},_0x165f00={},_0x5a24a6={'count':0x0,'rows':[]};var _0x25c858=_[_0x2be0('0x3e')](db[_0x2be0('0x3f')]['rawAttributes'],function(_0x46d474){return{'name':_0x46d474['fieldName'],'type':_0x46d474[_0x2be0('0x40')][_0x2be0('0x41')]};});_0x165f00[_0x2be0('0x42')]=_[_0x2be0('0x3e')](_0x25c858,_0x2be0('0x3b'));_0x165f00[_0x2be0('0x43')]=_[_0x2be0('0x44')](_0x4ea299[_0x2be0('0x43')]);_0x165f00[_0x2be0('0x45')]=_[_0x2be0('0x46')](_0x165f00[_0x2be0('0x42')],_0x165f00[_0x2be0('0x43')]);_0x4d6ccf[_0x2be0('0x47')]=_[_0x2be0('0x46')](_0x165f00[_0x2be0('0x42')],qs['fields'](_0x4ea299[_0x2be0('0x43')]['fields']));_0x4d6ccf[_0x2be0('0x47')]=_0x4d6ccf[_0x2be0('0x47')][_0x2be0('0x48')]?_0x4d6ccf[_0x2be0('0x47')]:_0x165f00[_0x2be0('0x42')];if(!_0x4ea299[_0x2be0('0x43')][_0x2be0('0x49')]('nolimit')){_0x4d6ccf[_0x2be0('0x2f')]=qs[_0x2be0('0x2f')](_0x4ea299[_0x2be0('0x43')][_0x2be0('0x2f')]);_0x4d6ccf[_0x2be0('0x2c')]=qs['offset'](_0x4ea299[_0x2be0('0x43')]['offset']);}_0x4d6ccf[_0x2be0('0x4a')]=qs[_0x2be0('0x4b')](_0x4ea299[_0x2be0('0x43')][_0x2be0('0x4b')]);_0x4d6ccf[_0x2be0('0x4c')]=qs[_0x2be0('0x45')](_['pick'](_0x4ea299[_0x2be0('0x43')],_0x165f00['filters']),_0x25c858);if(_0x4ea299[_0x2be0('0x43')][_0x2be0('0x4d')]){_0x4d6ccf['where']=_[_0x2be0('0x4e')](_0x4d6ccf[_0x2be0('0x4c')],{'$or':_[_0x2be0('0x3e')](_0x25c858,function(_0x89817d){if(_0x89817d[_0x2be0('0x40')]!=='VIRTUAL'){var _0x52211f={};_0x52211f[_0x89817d[_0x2be0('0x3b')]]={'$like':'%'+_0x4ea299[_0x2be0('0x43')]['filter']+'%'};return _0x52211f;}})});}_0x4d6ccf=_['merge']({},_0x4d6ccf,_0x4ea299[_0x2be0('0x4f')]);var _0x3e6f94={'where':_0x4d6ccf[_0x2be0('0x4c')]};return db[_0x2be0('0x3f')]['count'](_0x3e6f94)[_0x2be0('0x1f')](function(_0x10fc9a){_0x5a24a6[_0x2be0('0x2e')]=_0x10fc9a;if(_0x4ea299[_0x2be0('0x43')][_0x2be0('0x50')]){_0x4d6ccf[_0x2be0('0x51')]=[{'all':!![]}];}return db[_0x2be0('0x3f')]['findAll'](_0x4d6ccf);})[_0x2be0('0x1f')](function(_0x400f59){_0x5a24a6['rows']=_0x400f59;return _0x5a24a6;})[_0x2be0('0x1f')](respondWithFilteredResult(_0x309e91,_0x4d6ccf))[_0x2be0('0x28')](handleError(_0x309e91,null));};exports[_0x2be0('0x52')]=function(_0x556235,_0x419671){var _0x2c1c6f={'raw':![],'where':{'id':_0x556235[_0x2be0('0x53')]['id']},'include':[{'model':db[_0x2be0('0x3d')],'as':_0x2be0('0x54')}]},_0x1cd530={};_0x1cd530[_0x2be0('0x42')]=_[_0x2be0('0x44')](db[_0x2be0('0x3f')]['rawAttributes']);_0x1cd530[_0x2be0('0x43')]=_[_0x2be0('0x44')](_0x556235[_0x2be0('0x43')]);_0x1cd530[_0x2be0('0x45')]=_['intersection'](_0x1cd530[_0x2be0('0x42')],_0x1cd530['query']);_0x2c1c6f[_0x2be0('0x47')]=_[_0x2be0('0x46')](_0x1cd530['model'],qs[_0x2be0('0x55')](_0x556235['query'][_0x2be0('0x55')]));_0x2c1c6f[_0x2be0('0x47')]=_0x2c1c6f['attributes'][_0x2be0('0x48')]?_0x2c1c6f[_0x2be0('0x47')]:_0x1cd530[_0x2be0('0x42')];if(_0x556235[_0x2be0('0x43')][_0x2be0('0x50')]){_0x2c1c6f[_0x2be0('0x51')]=[{'all':!![]}];}_0x2c1c6f=_[_0x2be0('0x4e')]({},_0x2c1c6f,_0x556235[_0x2be0('0x4f')]);return db[_0x2be0('0x3f')]['find'](_0x2c1c6f)[_0x2be0('0x1f')](handleEntityNotFound(_0x419671,null))[_0x2be0('0x1f')](respondWithResult(_0x419671,null))[_0x2be0('0x28')](handleError(_0x419671,null));};exports['create']=function(_0x38278b,_0x443e5d){return db[_0x2be0('0x3f')][_0x2be0('0x56')](_0x38278b[_0x2be0('0x57')],{})[_0x2be0('0x1f')](function(_0x328a16){var _0x4c3e21=_0x38278b[_0x2be0('0x58')][_0x2be0('0x37')]({'plain':!![]});if(!_0x4c3e21)throw new Error(_0x2be0('0x59'));if(_0x4c3e21[_0x2be0('0x5a')]===_0x2be0('0x58')){var _0x2094b0=_0x328a16['get']({'plain':!![]});var _0xc60d86='OpenchannelAccounts';return db['UserProfileSection'][_0x2be0('0x5b')]({'where':{'name':_0xc60d86,'userProfileId':_0x4c3e21[_0x2be0('0x5c')]},'raw':!![]})[_0x2be0('0x1f')](function(_0x5a0e73){if(_0x5a0e73&&_0x5a0e73[_0x2be0('0x5d')]===0x0){return db[_0x2be0('0x39')][_0x2be0('0x56')]({'name':_0x2094b0[_0x2be0('0x3b')],'resourceId':_0x2094b0['id'],'type':_0x5a0e73[_0x2be0('0x3b')],'sectionId':_0x5a0e73['id']},{})['then'](function(){return _0x328a16;});}else{return _0x328a16;}})[_0x2be0('0x28')](function(_0x2553e0){logger[_0x2be0('0x26')](_0x2be0('0x5e'),_0x2553e0);throw _0x2553e0;});}return _0x328a16;})[_0x2be0('0x1f')](respondWithResult(_0x443e5d,0xc9))[_0x2be0('0x28')](handleError(_0x443e5d,null));};exports[_0x2be0('0x35')]=function(_0x3137ce,_0x1ada0a){if(_0x3137ce[_0x2be0('0x57')]['id']){delete _0x3137ce[_0x2be0('0x57')]['id'];}return db['OpenchannelAccount'][_0x2be0('0x5b')]({'where':{'id':_0x3137ce[_0x2be0('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x2be0('0x54')}]})[_0x2be0('0x1f')](handleEntityNotFound(_0x1ada0a,null))[_0x2be0('0x1f')](saveUpdates(_0x3137ce[_0x2be0('0x57')],null))[_0x2be0('0x1f')](respondWithResult(_0x1ada0a,null))['catch'](handleError(_0x1ada0a,null));};exports['destroy']=function(_0x2e69aa,_0x3a0154){return db[_0x2be0('0x3f')]['find']({'where':{'id':_0x2e69aa[_0x2be0('0x53')]['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x3a0154,null))[_0x2be0('0x1f')](removeEntity(_0x3a0154,null))[_0x2be0('0x28')](handleError(_0x3a0154,null));};exports[_0x2be0('0x5f')]=function(_0xaf914d,_0xc10295){return db[_0x2be0('0x3f')][_0x2be0('0x5f')]()[_0x2be0('0x1f')](respondWithResult(_0xc10295,null))[_0x2be0('0x28')](handleError(_0xc10295,null));};exports[_0x2be0('0x60')]=function(_0x320266,_0x10e9a7,_0x598c0e){if(_0x320266[_0x2be0('0x57')]['id']){delete _0x320266[_0x2be0('0x57')]['id'];}return db[_0x2be0('0x3f')][_0x2be0('0x5b')]({'where':{'id':_0x320266['params']['id']}})['then'](handleEntityNotFound(_0x10e9a7,null))[_0x2be0('0x1f')](function(_0x15702c){if(_0x15702c){_0x320266[_0x2be0('0x57')][_0x2be0('0x61')]=_0x15702c['id'];return db['Disposition'][_0x2be0('0x56')](_0x320266[_0x2be0('0x57')]);}})['then'](respondWithResult(_0x10e9a7,null))[_0x2be0('0x28')](handleError(_0x10e9a7,null));};exports[_0x2be0('0x62')]=function(_0x201c58,_0x178ae7,_0x2c7c27){var _0x7a2db5={'raw':![],'where':{}};var _0x34acf3={};var _0x5d6659={'count':0x0,'rows':[]};return db[_0x2be0('0x3f')][_0x2be0('0x63')]({'where':{'id':_0x201c58[_0x2be0('0x53')]['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x178ae7,null))[_0x2be0('0x1f')](function(_0x3ba859){if(_0x3ba859){_0x34acf3['model']=_['keys'](db['Disposition'][_0x2be0('0x64')]);_0x34acf3['query']=_[_0x2be0('0x44')](_0x201c58[_0x2be0('0x43')]);_0x34acf3['filters']=_[_0x2be0('0x46')](_0x34acf3[_0x2be0('0x42')],_0x34acf3['query']);_0x7a2db5[_0x2be0('0x47')]=_[_0x2be0('0x46')](_0x34acf3[_0x2be0('0x42')],qs[_0x2be0('0x55')](_0x201c58[_0x2be0('0x43')][_0x2be0('0x55')]));_0x7a2db5['attributes']=_0x7a2db5[_0x2be0('0x47')][_0x2be0('0x48')]?_0x7a2db5[_0x2be0('0x47')]:_0x34acf3[_0x2be0('0x42')];if(!_0x201c58[_0x2be0('0x43')][_0x2be0('0x49')](_0x2be0('0x65'))){_0x7a2db5[_0x2be0('0x2f')]=qs[_0x2be0('0x2f')](_0x201c58[_0x2be0('0x43')]['limit']);_0x7a2db5[_0x2be0('0x2c')]=qs[_0x2be0('0x2c')](_0x201c58['query'][_0x2be0('0x2c')]);}_0x7a2db5['order']=qs[_0x2be0('0x4b')](_0x201c58[_0x2be0('0x43')][_0x2be0('0x4b')]);_0x7a2db5[_0x2be0('0x4c')]=qs[_0x2be0('0x45')](_[_0x2be0('0x66')](_0x201c58[_0x2be0('0x43')],_0x34acf3['filters']));_0x7a2db5['where'][_0x2be0('0x61')]=_0x3ba859['id'];if(_0x201c58['query'][_0x2be0('0x4d')]){_0x7a2db5[_0x2be0('0x4c')]=_[_0x2be0('0x4e')](_0x7a2db5[_0x2be0('0x4c')],{'$or':_[_0x2be0('0x3e')](_0x7a2db5[_0x2be0('0x47')],function(_0x50880e){var _0x580968={};_0x580968[_0x50880e]={'$like':'%'+_0x201c58['query'][_0x2be0('0x4d')]+'%'};return _0x580968;})});}_0x7a2db5=_[_0x2be0('0x4e')]({},_0x7a2db5,_0x201c58[_0x2be0('0x4f')]);return db[_0x2be0('0x67')][_0x2be0('0x2e')]({'where':_0x7a2db5[_0x2be0('0x4c')]})['then'](function(_0xdb3e27){_0x5d6659['count']=_0xdb3e27;if(_0x201c58[_0x2be0('0x43')][_0x2be0('0x50')]){_0x7a2db5[_0x2be0('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x2be0('0x68')](_0x7a2db5);})['then'](function(_0x1e0916){_0x5d6659[_0x2be0('0x69')]=_0x1e0916;return _0x5d6659;});}})[_0x2be0('0x1f')](respondWithFilteredResult(_0x178ae7,_0x7a2db5))[_0x2be0('0x28')](handleError(_0x178ae7,null));};exports[_0x2be0('0x6a')]=function(_0x4388d4,_0x56db7a,_0xc40b1f){return db[_0x2be0('0x3f')][_0x2be0('0x5b')]({'where':{'id':_0x4388d4['params']['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x56db7a,null))[_0x2be0('0x1f')](function(_0x52252d){if(_0x52252d){return _0x52252d['removeDispositions'](_0x4388d4[_0x2be0('0x43')][_0x2be0('0x6b')]);}})[_0x2be0('0x1f')](respondWithStatusCode(_0x56db7a,null))['catch'](handleError(_0x56db7a,null));};exports[_0x2be0('0x6c')]=function(_0x341f41,_0x52c457,_0x15c520){if(_0x341f41[_0x2be0('0x57')]['id']){delete _0x341f41[_0x2be0('0x57')]['id'];}return db[_0x2be0('0x3f')]['find']({'where':{'id':_0x341f41[_0x2be0('0x53')]['id']}})['then'](handleEntityNotFound(_0x52c457,null))[_0x2be0('0x1f')](function(_0x42bc1d){if(_0x42bc1d){_0x341f41[_0x2be0('0x57')]['OpenchannelAccountId']=_0x42bc1d['id'];return db[_0x2be0('0x6d')][_0x2be0('0x56')](_0x341f41['body']);}})[_0x2be0('0x1f')](respondWithResult(_0x52c457,null))[_0x2be0('0x28')](handleError(_0x52c457,null));};exports['getAnswers']=function(_0x38d087,_0x321946,_0x1814e3){var _0x514661={'raw':![],'where':{}};var _0x521317={};var _0x1748ea={'count':0x0,'rows':[]};return db[_0x2be0('0x3f')][_0x2be0('0x63')]({'where':{'id':_0x38d087[_0x2be0('0x53')]['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x321946,null))[_0x2be0('0x1f')](function(_0x3f1e37){if(_0x3f1e37){_0x521317['model']=_['keys'](db['CannedAnswer'][_0x2be0('0x64')]);_0x521317[_0x2be0('0x43')]=_['keys'](_0x38d087[_0x2be0('0x43')]);_0x521317[_0x2be0('0x45')]=_['intersection'](_0x521317[_0x2be0('0x42')],_0x521317[_0x2be0('0x43')]);_0x514661[_0x2be0('0x47')]=_['intersection'](_0x521317[_0x2be0('0x42')],qs['fields'](_0x38d087[_0x2be0('0x43')][_0x2be0('0x55')]));_0x514661[_0x2be0('0x47')]=_0x514661[_0x2be0('0x47')][_0x2be0('0x48')]?_0x514661[_0x2be0('0x47')]:_0x521317[_0x2be0('0x42')];if(!_0x38d087[_0x2be0('0x43')]['hasOwnProperty'](_0x2be0('0x65'))){_0x514661[_0x2be0('0x2f')]=qs[_0x2be0('0x2f')](_0x38d087[_0x2be0('0x43')]['limit']);_0x514661[_0x2be0('0x2c')]=qs[_0x2be0('0x2c')](_0x38d087[_0x2be0('0x43')]['offset']);}_0x514661['order']=qs['sort'](_0x38d087[_0x2be0('0x43')][_0x2be0('0x4b')]);_0x514661[_0x2be0('0x4c')]=qs['filters'](_[_0x2be0('0x66')](_0x38d087[_0x2be0('0x43')],_0x521317[_0x2be0('0x45')]));_0x514661[_0x2be0('0x4c')]['OpenchannelAccountId']=_0x3f1e37['id'];if(_0x38d087[_0x2be0('0x43')][_0x2be0('0x4d')]){_0x514661[_0x2be0('0x4c')]=_[_0x2be0('0x4e')](_0x514661[_0x2be0('0x4c')],{'$or':_[_0x2be0('0x3e')](_0x514661[_0x2be0('0x47')],function(_0x127c32){var _0x284adf={};_0x284adf[_0x127c32]={'$like':'%'+_0x38d087['query']['filter']+'%'};return _0x284adf;})});}_0x514661=_[_0x2be0('0x4e')]({},_0x514661,_0x38d087['options']);return db[_0x2be0('0x6d')]['count']({'where':_0x514661['where']})['then'](function(_0x5b6c77){_0x1748ea[_0x2be0('0x2e')]=_0x5b6c77;if(_0x38d087[_0x2be0('0x43')][_0x2be0('0x50')]){_0x514661['include']=[{'all':!![]}];}return db[_0x2be0('0x6d')][_0x2be0('0x68')](_0x514661);})['then'](function(_0x5b2ed3){_0x1748ea[_0x2be0('0x69')]=_0x5b2ed3;return _0x1748ea;});}})[_0x2be0('0x1f')](respondWithFilteredResult(_0x321946,_0x514661))['catch'](handleError(_0x321946,null));};exports[_0x2be0('0x6e')]=function(_0x38e0bc,_0x57d8aa,_0xf2a892){return db[_0x2be0('0x3f')][_0x2be0('0x5b')]({'where':{'id':_0x38e0bc['params']['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x57d8aa,null))[_0x2be0('0x1f')](function(_0x1a80bb){if(_0x1a80bb){return _0x1a80bb['removeAnswers'](_0x38e0bc[_0x2be0('0x43')]['ids']);}})[_0x2be0('0x1f')](respondWithStatusCode(_0x57d8aa,null))['catch'](handleError(_0x57d8aa,null));};exports[_0x2be0('0x6f')]=function(_0x487e8d,_0xdc6140,_0x1e4208){var _0x4abf29={'body':_0x487e8d[_0x2be0('0x57')],'channel':_0x2be0('0x70')};var _0xfdeac7=[];var _0x3ae40a=[];var _0x222e7f={};var _0x3c3ae9=![];return db[_0x2be0('0x71')][_0x2be0('0x5f')]()[_0x2be0('0x1f')](function(_0x12d2ea){if(!_0x12d2ea){throw new db[(_0x2be0('0x72'))][(_0x2be0('0x73'))](_0x2be0('0x74'));}_0xfdeac7=_[_0x2be0('0x75')](_['keys'](_0x12d2ea),['createdAt',_0x2be0('0x76')]);_0x3ae40a=_['difference'](_[_0x2be0('0x44')](_0x12d2ea),[_0x2be0('0x77'),'updatedAt',_0x2be0('0x78'),_0x2be0('0x79')]);if(_0x487e8d[_0x2be0('0x57')]['id']){delete _0x487e8d['body']['id'];}if(_['isNil'](_0x487e8d[_0x2be0('0x57')][_0x2be0('0x7a')])){throw new db[(_0x2be0('0x72'))][(_0x2be0('0x73'))](_0x2be0('0x7b'));}if(_[_0x2be0('0x7c')](_0x487e8d[_0x2be0('0x57')]['body'])||_0x487e8d[_0x2be0('0x57')][_0x2be0('0x57')]===''){throw new db[(_0x2be0('0x72'))][(_0x2be0('0x73'))](_0x2be0('0x7d'));}if(_[_0x2be0('0x7c')](_0x487e8d[_0x2be0('0x57')][_0x2be0('0x7e')])){throw new db[(_0x2be0('0x72'))][(_0x2be0('0x73'))](_0x2be0('0x7f')+_0x3ae40a);}if(!_[_0x2be0('0x80')](_0x3ae40a,_0x487e8d[_0x2be0('0x57')]['mapKey'])){throw new db[(_0x2be0('0x72'))][(_0x2be0('0x73'))](_0x2be0('0x81')+_0x3ae40a);}_0x222e7f[_0x487e8d['body'][_0x2be0('0x7e')]]=_0x487e8d['body']['from'];})[_0x2be0('0x1f')](function(){return db[_0x2be0('0x3f')]['find']({'where':{'id':_0x487e8d[_0x2be0('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x2be0('0x82'),'include':[{'model':db['CmContact'],'as':_0x2be0('0x83'),'where':_0x222e7f,'limit':0x1,'order':[[_0x2be0('0x76'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0xdc6140,null))['then'](function(_0xcf444e){if(_0xcf444e&&_0xcf444e[_0x2be0('0x82')]){_0x4abf29[_0x2be0('0x84')]=_0xcf444e;_0x4abf29[_0x2be0('0x85')]=_0xcf444e[_0x2be0('0x86')];_0x4abf29[_0x2be0('0x87')]=_0xcf444e[_0x2be0('0x82')];_0x4abf29[_0x2be0('0x85')]=_['orderBy'](_0x4abf29[_0x2be0('0x85')],['priority'],[_0x2be0('0x88')]);if(_0x4abf29['account']['Applications']){delete _0x4abf29[_0x2be0('0x84')][_0x2be0('0x86')];}if(_0x4abf29[_0x2be0('0x84')][_0x2be0('0x82')]&&_0x4abf29[_0x2be0('0x84')][_0x2be0('0x82')][_0x2be0('0x83')][_0x2be0('0x48')]){return _0x4abf29[_0x2be0('0x84')][_0x2be0('0x82')][_0x2be0('0x83')][0x0];}var _0x47954f=_[_0x2be0('0x17')](_0x487e8d['body'],{'firstName':_0x487e8d['body']['from'],'ListId':_0xcf444e['ListId']});_0x47954f[_0x487e8d['body'][_0x2be0('0x7e')]]=_0x487e8d[_0x2be0('0x57')]['from'];return db[_0x2be0('0x71')][_0x2be0('0x56')](_0x47954f,{'fields':_0xfdeac7,'raw':!![]});}})[_0x2be0('0x1f')](handleEntityNotFound(_0xdc6140,null))[_0x2be0('0x1f')](function(_0x3e6188){_0x4abf29['contact']=_0x3e6188;if(_0x3e6188){var _0x58393a={'ContactId':_0x3e6188['id'],'OpenchannelAccountId':_0x487e8d[_0x2be0('0x53')]['id'],'from':(_0x3e6188['firstName']||'')+'\x20'+(_0x3e6188[_0x2be0('0x89')]||'')};var _0x4a9c76={'OpenchannelAccountId':_0x487e8d[_0x2be0('0x53')]['id'],'closed':![]};if(_0x487e8d[_0x2be0('0x57')]['threadId']){_0x4a9c76[_0x2be0('0x8a')]=_0x487e8d['body'][_0x2be0('0x8a')];return db[_0x2be0('0x8b')]['find']({'where':_0x4a9c76})[_0x2be0('0x1f')](function(_0x1d9ace){if(_0x1d9ace){return[_0x1d9ace,![]];}_0x58393a[_0x2be0('0x8a')]=_0x487e8d[_0x2be0('0x57')][_0x2be0('0x8a')];_0x58393a[_0x2be0('0x8c')]=_0x487e8d['body']['externalUrl'];return db[_0x2be0('0x8b')][_0x2be0('0x56')](_0x58393a)['then'](function(_0x55c321){return[_0x55c321,!![]];});});}else{_0x4a9c76[_0x2be0('0x8a')]=null;}_0x4a9c76[_0x2be0('0x8d')]=_0x3e6188['id'];return db[_0x2be0('0x8b')]['find']({'where':_0x4a9c76})[_0x2be0('0x1f')](function(_0x4c8538){if(_0x4c8538){return[_0x4c8538,![]];}return db[_0x2be0('0x8b')][_0x2be0('0x56')](_0x58393a)[_0x2be0('0x1f')](function(_0x4e5994){return[_0x4e5994,!![]];});});}})[_0x2be0('0x8e')](function(_0x247ffd,_0x4b65ec){if(_0x247ffd){_0x3c3ae9=_0x4b65ec;if(!_0x4b65ec){var _0x11be59={'from':(_0x4abf29['contact']['firstName']||'')+'\x20'+(_0x4abf29[_0x2be0('0x8f')]['lastName']||'')};if(_0x487e8d[_0x2be0('0x57')][_0x2be0('0x8a')]&&_0x487e8d[_0x2be0('0x57')]['messageId']&&_0x487e8d[_0x2be0('0x57')][_0x2be0('0x8a')]!=_0x487e8d[_0x2be0('0x57')][_0x2be0('0x90')]){_0x11be59[_0x2be0('0x8a')]=_0x487e8d[_0x2be0('0x57')][_0x2be0('0x90')];}return _0x247ffd['update'](_0x11be59);}else{return _0x247ffd;}}})[_0x2be0('0x1f')](function(_0x4ce866){_0x4abf29[_0x2be0('0x91')]=_0x4ce866['get']({'plain':!![]});_0x4abf29[_0x2be0('0x91')][_0x2be0('0x92')]=_0x3c3ae9;if(_0x4abf29[_0x2be0('0x91')]['created']){if(_0x4abf29[_0x2be0('0x84')]['autoclose']){_0x4abf29['applications'][_0x2be0('0x93')]({'id':0x0,'priority':_0x4abf29[_0x2be0('0x85')][_0x2be0('0x48')]+0x1,'app':_0x2be0('0x94'),'appdata':'unmanaged','interval':_0x2be0('0x95')});}}return db[_0x2be0('0x96')]['create']({'body':_0x487e8d[_0x2be0('0x57')][_0x2be0('0x57')],'OpenchannelAccountId':_0x487e8d[_0x2be0('0x53')]['id'],'OpenchannelInteractionId':_0x4ce866['id'],'direction':'in','ContactId':_0x4abf29[_0x2be0('0x8f')]['id'],'AttachmentId':_0x487e8d[_0x2be0('0x57')][_0x2be0('0x97')]});})[_0x2be0('0x1f')](function(_0x555803){_0x4abf29[_0x2be0('0x27')]=_0x555803;if(_0x4abf29[_0x2be0('0x91')][_0x2be0('0x98')]){return db[_0x2be0('0x99')][_0x2be0('0x5b')]({'attributes':['id',_0x2be0('0x3b')],'where':{'id':_0x4abf29[_0x2be0('0x91')][_0x2be0('0x98')]}})[_0x2be0('0x1f')](function(_0x4b69a7){if(_0x4b69a7){_0x4abf29[_0x2be0('0x85')][_0x2be0('0x9a')]({'id':0x0,'priority':0x0,'app':_0x2be0('0x9b'),'appdata':_0x4b69a7[_0x2be0('0x3b')]+','+(_0x4abf29[_0x2be0('0x84')][_0x2be0('0x9c')]||0xa),'interval':_0x2be0('0x95')});_0x4abf29[_0x2be0('0x9d')]=![];}return respondWithRpcPromise('Start','startRouting',_0x4abf29);});}return respondWithRpcPromise('Start','startRouting',_0x4abf29);})['then'](function(_0x3f4c8c){respondWithRpcPromise(_0x2be0('0x9e'),_0x2be0('0x9e'),{'event':_0x2be0('0x6f'),'message':_0x3f4c8c},client9002);return _0x3f4c8c;})['then'](respondWithResult(_0xdc6140,null))[_0x2be0('0x28')](handleError(_0xdc6140,null));};exports['addApplications']=function(_0x410563,_0x1a1a97){var _0x4cf4f0=_0x410563[_0x2be0('0x53')]['id'];var _0x5acddf=_0x410563[_0x2be0('0x57')];var _0x3ec18b=0xc8;var _0x3dde11=null;return db[_0x2be0('0x9f')]['transaction']({'isolationLevel':db[_0x2be0('0x9f')][_0x2be0('0xa0')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x576202){return db[_0x2be0('0x3f')]['findOne']({'where':{'id':_0x4cf4f0},'transaction':_0x576202})['then'](function(_0x3baa84){if(_0x3baa84){return db['OpenchannelApplication'][_0x2be0('0x36')]({'where':{'OpenchannelAccountId':_0x4cf4f0},'transaction':_0x576202})[_0x2be0('0x1f')](function(){var _0xd07556=_['map'](_0x5acddf,function(_0x39220f){_0x39220f[_0x2be0('0x61')]=_0x4cf4f0;return _0x39220f;});return db[_0x2be0('0xa1')]['bulkCreate'](_0xd07556,{'transaction':_0x576202});});}else{_0x3ec18b=0x194;_0x3dde11=[];}});})[_0x2be0('0x1f')](function(){if(_0x3ec18b!==0x194){return db['OpenchannelApplication'][_0x2be0('0xa2')]({'where':{'OpenchannelAccountId':_0x4cf4f0},'order':_0x2be0('0xa3')})[_0x2be0('0x1f')](function(_0x2b911a){_0x3dde11=_0x2b911a;});}})['catch'](function(_0x319276){_0x3ec18b=0x1f4;logger[_0x2be0('0x26')](_0x319276['stack']);if(_0x319276[_0x2be0('0x3b')]){delete _0x319276['name'];}_0x3dde11=_0x319276;})[_0x2be0('0xa4')](function(){if(_0x3dde11===null){_0x1a1a97[_0x2be0('0x29')](_0x3ec18b);}else{if(_0x3ec18b===0x1f4){_0x1a1a97[_0x2be0('0x2a')](_0x3ec18b)[_0x2be0('0x3c')](_0x3dde11);}else{_0x1a1a97[_0x2be0('0x2a')](_0x3ec18b)[_0x2be0('0x2b')](_0x3dde11);}}});};exports['getApplications']=function(_0x5c5c5d,_0x375928,_0x48be43){var _0x5a8148={};var _0x5b8f83={};var _0x52c438;var _0x301dd8;return db[_0x2be0('0x3f')]['findOne']({'where':{'id':_0x5c5c5d[_0x2be0('0x53')]['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x375928,null))[_0x2be0('0x1f')](function(_0x294ae9){if(_0x294ae9){_0x52c438=_0x294ae9;_0x5b8f83[_0x2be0('0x42')]=_[_0x2be0('0x44')](db['OpenchannelApplication'][_0x2be0('0x64')]);_0x5b8f83[_0x2be0('0x43')]=_['keys'](_0x5c5c5d['query']);_0x5b8f83['filters']=_[_0x2be0('0x46')](_0x5b8f83[_0x2be0('0x42')],_0x5b8f83['query']);_0x5a8148[_0x2be0('0x47')]=_[_0x2be0('0x46')](_0x5b8f83['model'],qs[_0x2be0('0x55')](_0x5c5c5d[_0x2be0('0x43')][_0x2be0('0x55')]));_0x5a8148[_0x2be0('0x47')]=_0x5a8148['attributes'][_0x2be0('0x48')]?_0x5a8148[_0x2be0('0x47')]:_0x5b8f83[_0x2be0('0x42')];_0x5a8148['order']=qs['sort'](_0x5c5c5d['query'][_0x2be0('0x4b')]);_0x5a8148[_0x2be0('0x4c')]=qs[_0x2be0('0x45')](_[_0x2be0('0x66')](_0x5c5c5d[_0x2be0('0x43')],_0x5b8f83[_0x2be0('0x45')]));if(_0x5c5c5d[_0x2be0('0x43')][_0x2be0('0x4d')]){_0x5a8148[_0x2be0('0x4c')]=_[_0x2be0('0x4e')](_0x5a8148[_0x2be0('0x4c')],{'$or':_[_0x2be0('0x3e')](_0x5a8148[_0x2be0('0x47')],function(_0x109265){var _0x554097={};_0x554097[_0x109265]={'$like':'%'+_0x5c5c5d[_0x2be0('0x43')]['filter']+'%'};return _0x554097;})});}_0x5a8148=_[_0x2be0('0x4e')]({},_0x5a8148,_0x5c5c5d[_0x2be0('0x4f')]);return _0x52c438[_0x2be0('0xa5')](_0x5a8148);}})[_0x2be0('0x1f')](function(_0x1ec1be){if(_0x1ec1be){_0x301dd8=_0x1ec1be[_0x2be0('0x48')];if(!_0x5c5c5d[_0x2be0('0x43')]['hasOwnProperty'](_0x2be0('0x65'))){_0x5a8148[_0x2be0('0x2f')]=qs[_0x2be0('0x2f')](_0x5c5c5d['query'][_0x2be0('0x2f')]);_0x5a8148[_0x2be0('0x2c')]=qs[_0x2be0('0x2c')](_0x5c5c5d[_0x2be0('0x43')][_0x2be0('0x2c')]);}return _0x52c438[_0x2be0('0xa5')](_0x5a8148);}})[_0x2be0('0x1f')](function(_0x1cad48){if(_0x1cad48){return _0x1cad48?{'count':_0x301dd8,'rows':_0x1cad48}:null;}})['then'](respondWithResult(_0x375928,null))[_0x2be0('0x28')](handleError(_0x375928,null));};exports[_0x2be0('0xa6')]=function(_0x448292,_0x4b401a,_0x315364){var _0x1ce54f={'raw':![],'where':{}};var _0x100fe1={};var _0x2ba673={'count':0x0,'rows':[]};return db[_0x2be0('0x3f')][_0x2be0('0x63')]({'where':{'id':_0x448292['params']['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x4b401a,null))['then'](function(_0x1c30d6){if(_0x1c30d6){_0x100fe1['model']=_[_0x2be0('0x44')](db[_0x2be0('0x8b')][_0x2be0('0x64')]);_0x100fe1[_0x2be0('0x43')]=_[_0x2be0('0x44')](_0x448292[_0x2be0('0x43')]);_0x100fe1['filters']=_[_0x2be0('0x46')](_0x100fe1[_0x2be0('0x42')],_0x100fe1['query']);_0x1ce54f[_0x2be0('0x47')]=_[_0x2be0('0x46')](_0x100fe1[_0x2be0('0x42')],qs[_0x2be0('0x55')](_0x448292[_0x2be0('0x43')][_0x2be0('0x55')]));_0x1ce54f[_0x2be0('0x47')]=_0x1ce54f['attributes']['length']?_0x1ce54f[_0x2be0('0x47')]:_0x100fe1['model'];if(!_0x448292[_0x2be0('0x43')][_0x2be0('0x49')]('nolimit')){_0x1ce54f['limit']=qs[_0x2be0('0x2f')](_0x448292[_0x2be0('0x43')][_0x2be0('0x2f')]);_0x1ce54f['offset']=qs['offset'](_0x448292['query'][_0x2be0('0x2c')]);}_0x1ce54f[_0x2be0('0x4a')]=qs['sort'](_0x448292[_0x2be0('0x43')]['sort']);_0x1ce54f[_0x2be0('0x4c')]=qs[_0x2be0('0x45')](_[_0x2be0('0x66')](_0x448292[_0x2be0('0x43')],_0x100fe1['filters']));_0x1ce54f[_0x2be0('0x4c')]['OpenchannelAccountId']=_0x1c30d6['id'];if(_0x448292['query'][_0x2be0('0x4d')]){_0x1ce54f[_0x2be0('0x4c')]=_[_0x2be0('0x4e')](_0x1ce54f[_0x2be0('0x4c')],{'$or':_[_0x2be0('0x3e')](_0x1ce54f[_0x2be0('0x47')],function(_0x1aae13){var _0x4b538e={};_0x4b538e[_0x1aae13]={'$like':'%'+_0x448292[_0x2be0('0x43')][_0x2be0('0x4d')]+'%'};return _0x4b538e;})});}_0x1ce54f=_[_0x2be0('0x4e')]({},_0x1ce54f,_0x448292[_0x2be0('0x4f')]);return db[_0x2be0('0x8b')][_0x2be0('0x2e')]({'where':_0x1ce54f['where']})['then'](function(_0x253027){_0x2ba673['count']=_0x253027;if(_0x448292[_0x2be0('0x43')][_0x2be0('0x50')]){_0x1ce54f[_0x2be0('0x51')]=[{'model':db[_0x2be0('0x71')],'as':_0x2be0('0xa7'),'required':![]},{'model':db[_0x2be0('0x99')],'as':_0x2be0('0xa8'),'attributes':[_0x2be0('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0x2be0('0xa9')],'as':'Tags','attributes':['id',_0x2be0('0x3b'),_0x2be0('0xaa')],'where':_0x448292[_0x2be0('0x43')][_0x2be0('0xab')]?{'id':_0x448292[_0x2be0('0x43')]['tag']}:undefined,'required':_0x448292[_0x2be0('0x43')][_0x2be0('0xab')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x2be0('0x68')](_0x1ce54f);})['then'](function(_0x4ecadf){_0x2ba673['rows']=_0x4ecadf;return _0x2ba673;});}})['then'](respondWithFilteredResult(_0x4b401a,_0x1ce54f))[_0x2be0('0x28')](handleError(_0x4b401a,null));};exports[_0x2be0('0xac')]=function(_0x3207f0,_0x4fa333,_0x19bacb){return db[_0x2be0('0x3f')][_0x2be0('0x5b')]({'where':{'id':_0x3207f0[_0x2be0('0x53')]['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x4fa333,null))[_0x2be0('0x1f')](function(_0x3c69f4){if(_0x3c69f4){return _0x3c69f4[_0x2be0('0xac')](_0x3207f0['body'][_0x2be0('0x6b')],_['omit'](_0x3207f0[_0x2be0('0x57')],[_0x2be0('0x6b'),'id'])||{})[_0x2be0('0x8e')](function(_0x39ab4c){for(var _0x5c1396=0x0;_0x5c1396<_0x3207f0[_0x2be0('0x57')][_0x2be0('0x6b')][_0x2be0('0x48')];_0x5c1396+=0x1){socket[_0x2be0('0xad')](_0x2be0('0xae'),{'UserId':Number(_0x3207f0[_0x2be0('0x57')][_0x2be0('0x6b')][_0x5c1396]),'OpenchannelAccountId':Number(_0x3207f0[_0x2be0('0x53')]['id'])});}return _0x39ab4c;});}})[_0x2be0('0x1f')](respondWithResult(_0x4fa333,null))['catch'](handleError(_0x4fa333,null));};exports[_0x2be0('0xaf')]=function(_0x4317fd,_0x3dfe66,_0x34a4cf){return db[_0x2be0('0x3f')][_0x2be0('0x5b')]({'where':{'id':_0x4317fd[_0x2be0('0x53')]['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x3dfe66,null))[_0x2be0('0x1f')](function(_0x5ecd53){if(_0x5ecd53){return _0x5ecd53['removeAgents'](_0x4317fd[_0x2be0('0x43')][_0x2be0('0x6b')])[_0x2be0('0x1f')](function(){if(_['isArray'](_0x4317fd['query'][_0x2be0('0x6b')])){for(var _0x1465bf=0x0;_0x1465bf<_0x4317fd[_0x2be0('0x43')]['ids'][_0x2be0('0x48')];_0x1465bf+=0x1){socket[_0x2be0('0xad')](_0x2be0('0xb0'),{'UserId':Number(_0x4317fd['query'][_0x2be0('0x6b')][_0x1465bf]),'OpenchannelAccountId':Number(_0x4317fd[_0x2be0('0x53')]['id'])});}}else{socket[_0x2be0('0xad')](_0x2be0('0xb0'),{'UserId':Number(_0x4317fd[_0x2be0('0x43')][_0x2be0('0x6b')]),'OpenchannelAccountId':Number(_0x4317fd[_0x2be0('0x53')]['id'])});}});}})[_0x2be0('0x1f')](respondWithStatusCode(_0x3dfe66,null))[_0x2be0('0x28')](handleError(_0x3dfe66,null));};exports[_0x2be0('0xb1')]=function(_0xde0f89,_0x56ed56,_0x44066e){var _0x1683b9={};var _0x5738c8={};var _0x3a1569;var _0x49fc5f;return db['OpenchannelAccount'][_0x2be0('0x63')]({'where':{'id':_0xde0f89['params']['id']}})['then'](handleEntityNotFound(_0x56ed56,null))[_0x2be0('0x1f')](function(_0x21a0ce){if(_0x21a0ce){_0x3a1569=_0x21a0ce;_0x5738c8[_0x2be0('0x42')]=_[_0x2be0('0x44')](db['User']['rawAttributes']);_0x5738c8[_0x2be0('0x43')]=_[_0x2be0('0x44')](_0xde0f89[_0x2be0('0x43')]);_0x5738c8[_0x2be0('0x45')]=_[_0x2be0('0x46')](_0x5738c8[_0x2be0('0x42')],_0x5738c8[_0x2be0('0x43')]);_0x1683b9['attributes']=_['intersection'](_0x5738c8[_0x2be0('0x42')],qs['fields'](_0xde0f89[_0x2be0('0x43')][_0x2be0('0x55')]));_0x1683b9[_0x2be0('0x47')]=_0x1683b9[_0x2be0('0x47')][_0x2be0('0x48')]?_0x1683b9[_0x2be0('0x47')]:_0x5738c8[_0x2be0('0x42')];_0x1683b9[_0x2be0('0x4a')]=qs['sort'](_0xde0f89[_0x2be0('0x43')][_0x2be0('0x4b')]);_0x1683b9[_0x2be0('0x4c')]=qs[_0x2be0('0x45')](_[_0x2be0('0x66')](_0xde0f89[_0x2be0('0x43')],_0x5738c8[_0x2be0('0x45')]));if(_0xde0f89[_0x2be0('0x43')][_0x2be0('0x4d')]){_0x1683b9[_0x2be0('0x4c')]=_[_0x2be0('0x4e')](_0x1683b9[_0x2be0('0x4c')],{'$or':_[_0x2be0('0x3e')](_0x1683b9[_0x2be0('0x47')],function(_0x21907a){var _0x1b241e={};_0x1b241e[_0x21907a]={'$like':'%'+_0xde0f89[_0x2be0('0x43')]['filter']+'%'};return _0x1b241e;})});}_0x1683b9=_['merge']({},_0x1683b9,_0xde0f89[_0x2be0('0x4f')]);return _0x3a1569[_0x2be0('0xb1')](_0x1683b9);}})['then'](function(_0xdb4f32){if(_0xdb4f32){_0x49fc5f=_0xdb4f32[_0x2be0('0x48')];if(!_0xde0f89['query'][_0x2be0('0x49')](_0x2be0('0x65'))){_0x1683b9['limit']=qs[_0x2be0('0x2f')](_0xde0f89[_0x2be0('0x43')]['limit']);_0x1683b9[_0x2be0('0x2c')]=qs[_0x2be0('0x2c')](_0xde0f89['query'][_0x2be0('0x2c')]);}return _0x3a1569[_0x2be0('0xb1')](_0x1683b9);}})[_0x2be0('0x1f')](function(_0x4e2976){if(_0x4e2976){return _0x4e2976?{'count':_0x49fc5f,'rows':_0x4e2976}:null;}})[_0x2be0('0x1f')](respondWithResult(_0x56ed56,null))[_0x2be0('0x28')](handleError(_0x56ed56,null));};exports[_0x2be0('0x3c')]=function(_0xe4457,_0x4f4f3f,_0x307e1d){var _0x430f32,_0x30c9e3,_0x4e017f;if(_['isNil'](_0xe4457[_0x2be0('0x57')][_0x2be0('0x57')])||_0xe4457[_0x2be0('0x57')][_0x2be0('0x57')]===''){throw new db['Sequelize'][(_0x2be0('0x73'))](_0x2be0('0x7d'));}if(_[_0x2be0('0x7c')](_0xe4457[_0x2be0('0x57')]['to'])){}_0x430f32=_0xe4457[_0x2be0('0x57')]['to'];return db[_0x2be0('0x3f')][_0x2be0('0x63')]({'where':{'id':_0xe4457['params']['id']}})[_0x2be0('0x1f')](handleEntityNotFound(_0x4f4f3f,null))['then'](function(_0x230d74){if(_0x230d74){return db[_0x2be0('0x3f')][_0x2be0('0x5b')]({'where':{'id':_0x230d74['id']},'include':[{'model':db[_0x2be0('0xb2')],'as':_0x2be0('0x82'),'include':[{'model':db[_0x2be0('0x71')],'as':_0x2be0('0x83'),'where':{[_0x230d74[_0x2be0('0x7e')]]:_0x430f32},'limit':0x1,'order':[[_0x2be0('0x76'),_0x2be0('0xb3')]]}]}]})[_0x2be0('0x1f')](handleEntityNotFound(_0x4f4f3f,null))[_0x2be0('0x1f')](function(_0x38012b){if(_0x38012b&&_0x38012b[_0x2be0('0x82')]){_0x30c9e3=_0x38012b[_0x2be0('0x37')]({'plain':!![]});if(_0x30c9e3[_0x2be0('0x82')]&&_0x30c9e3[_0x2be0('0x82')][_0x2be0('0x83')][_0x2be0('0x48')]){return _0x30c9e3[_0x2be0('0x82')]['Contacts'][0x0];}return db[_0x2be0('0x71')][_0x2be0('0x56')](_[_0x2be0('0x17')](_0xe4457['body'],{'firstName':_0x430f32,[_0x38012b[_0x2be0('0x7e')]]:_0x430f32,'phone':_0x430f32,'ListId':_0x30c9e3[_0x2be0('0x79')]}));}})[_0x2be0('0x1f')](handleEntityNotFound(_0x4f4f3f,null))[_0x2be0('0x1f')](function(_0x20c94f){if(_0x20c94f){_0x4e017f=_0x20c94f;return db['OpenchannelInteraction'][_0x2be0('0x5b')]({'where':{'ContactId':_0x4e017f['id'],'closed':![],'OpenchannelAccountId':_0x30c9e3['id']}})[_0x2be0('0x1f')](function(_0x367753){if(_0x367753){return[_0x367753,![]];}return db[_0x2be0('0x8b')]['create']({'UserId':_0xe4457['user']['id'],'ContactId':_0x4e017f['id'],'OpenchannelAccountId':_0x30c9e3['id'],'lastMsgDirection':_0x2be0('0xb4'),'firstMsgDirection':_0x2be0('0xb4'),'Messages':[_[_0x2be0('0x4e')](_0xe4457['body'],{'read':![],'body':_0xe4457['body']['body'],'OpenchannelAccountId':_0x30c9e3['id'],'UserId':_0xe4457[_0x2be0('0x58')]['id'],'ContactId':_0x4e017f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2be0('0xb5')}]})[_0x2be0('0x1f')](function(_0x52dd9b){return[_0x52dd9b,!![]];});});}})[_0x2be0('0x8e')](function(_0x28a4ce,_0x28754e){if(_0x28754e){return _0x28a4ce;}return db[_0x2be0('0x96')][_0x2be0('0x56')](_[_0x2be0('0x4e')](_0xe4457[_0x2be0('0x57')],{'read':![],'body':_0xe4457[_0x2be0('0x57')][_0x2be0('0x57')],'OpenchannelAccountId':_0x30c9e3['id'],'OpenchannelInteractionId':_0x28a4ce['id'],'UserId':_0xe4457['user']['id'],'ContactId':_0x4e017f['id']}))[_0x2be0('0x1f')](function(_0x3b8f2e){_0x28a4ce[_0x2be0('0xb6')][_0x2be0('0xb5')]=[];_0x28a4ce[_0x2be0('0xb6')][_0x2be0('0xb5')][_0x2be0('0x93')](_0x3b8f2e[_0x2be0('0xb6')]);return _0x28a4ce;});});}})[_0x2be0('0x1f')](respondWithResult(_0x4f4f3f,null))['catch'](handleError(_0x4f4f3f,null));}; \ No newline at end of file +var _0x6ae0=['addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','getApplications','hasOwnProperty','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','OpenchannelMessage','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','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','../../mysqldb','localhost','redis','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','show','params','Pause','length','include','find','create','body','user','get','UserProfileSection','userProfileId','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','keys','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager'];(function(_0x14ad1a,_0x1d3f95){var _0x7b46f4=function(_0x29c72d){while(--_0x29c72d){_0x14ad1a['push'](_0x14ad1a['shift']());}};_0x7b46f4(++_0x1d3f95);}(_0x6ae0,0x192));var _0x06ae=function(_0x5e38c2,_0x1b4e81){_0x5e38c2=_0x5e38c2-0x0;var _0x56be5f=_0x6ae0[_0x5e38c2];return _0x56be5f;};'use strict';var emlformat=require(_0x06ae('0x0'));var rimraf=require(_0x06ae('0x1'));var zipdir=require(_0x06ae('0x2'));var jsonpatch=require(_0x06ae('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06ae('0x4'));var Mustache=require('mustache');var util=require(_0x06ae('0x5'));var path=require('path');var sox=require(_0x06ae('0x6'));var csv=require(_0x06ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06ae('0x8'));var _=require('lodash');var squel=require(_0x06ae('0x9'));var crypto=require(_0x06ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x06ae('0xb'));var toCsv=require(_0x06ae('0x7'));var querystring=require(_0x06ae('0xc'));var Papa=require(_0x06ae('0xd'));var Redis=require(_0x06ae('0xe'));var authService=require(_0x06ae('0xf'));var qs=require(_0x06ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ae('0x11'));var logger=require(_0x06ae('0x12'))(_0x06ae('0x13'));var utils=require(_0x06ae('0x14'));var config=require(_0x06ae('0x15'));var licenseUtil=require(_0x06ae('0x16'));var db=require(_0x06ae('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x06ae('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06ae('0x19')]));require(_0x06ae('0x1a'))[_0x06ae('0x1b')](socket);var jayson=require(_0x06ae('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x06ae('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8fd7,_0xf59273,_0x3a541a,_0x504598){return new BPromise(function(_0x4ec020,_0x4f3545){var _0xf869c6=_0x504598||client;return _0xf869c6[_0x06ae('0x1e')](_0x1c8fd7,_0x3a541a)[_0x06ae('0x1f')](function(_0x11adef){logger[_0x06ae('0x20')](_0x06ae('0x21'),_0xf59273,_0x06ae('0x22'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xf59273,'request\x20sent',JSON['stringify'](_0x11adef));if(_0x11adef[_0x06ae('0x23')]){if(_0x11adef[_0x06ae('0x23')]['code']===0x1f4){logger[_0x06ae('0x23')](_0x06ae('0x21'),_0xf59273,_0x11adef[_0x06ae('0x23')][_0x06ae('0x24')]);return _0x4f3545(_0x11adef['error'][_0x06ae('0x24')]);}logger['error'](_0x06ae('0x21'),_0xf59273,_0x11adef[_0x06ae('0x23')]['message']);return _0x4ec020(_0x11adef[_0x06ae('0x23')][_0x06ae('0x24')]);}else{logger[_0x06ae('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0xf59273,_0x06ae('0x22'));_0x4ec020(_0x11adef[_0x06ae('0x25')]['message']);}})[_0x06ae('0x26')](function(_0xf6075b){logger[_0x06ae('0x23')](_0x06ae('0x21'),_0xf59273,_0xf6075b);_0x4f3545(_0xf6075b);});});}function respondWithStatusCode(_0x2e0bfa,_0x47c5ca){_0x47c5ca=_0x47c5ca||0xcc;return function(_0x104db1){if(_0x104db1){return _0x2e0bfa[_0x06ae('0x27')](_0x47c5ca);}return _0x2e0bfa[_0x06ae('0x28')](_0x47c5ca)[_0x06ae('0x29')]();};}function respondWithResult(_0x5dce44,_0x2ab4f4){_0x2ab4f4=_0x2ab4f4||0xc8;return function(_0x425941){if(_0x425941){return _0x5dce44[_0x06ae('0x28')](_0x2ab4f4)[_0x06ae('0x2a')](_0x425941);}};}function respondWithFilteredResult(_0x49f0b6,_0xfd320a){return function(_0x5ca32b){if(_0x5ca32b){var _0x1baff9=typeof _0xfd320a[_0x06ae('0x2b')]===_0x06ae('0x2c')&&typeof _0xfd320a[_0x06ae('0x2d')]===_0x06ae('0x2c');var _0x4a6336=_0x5ca32b[_0x06ae('0x2e')];var _0x43ad07=_0x1baff9?0x0:_0xfd320a['offset'];var _0x3b8011=_0x1baff9?_0x5ca32b['count']:_0xfd320a[_0x06ae('0x2b')]+_0xfd320a['limit'];var _0x3fe7ac;if(_0x3b8011>=_0x4a6336){_0x3b8011=_0x4a6336;_0x3fe7ac=0xc8;}else{_0x3fe7ac=0xce;}_0x49f0b6[_0x06ae('0x28')](_0x3fe7ac);return _0x49f0b6[_0x06ae('0x2f')]('Content-Range',_0x43ad07+'-'+_0x3b8011+'/'+_0x4a6336)[_0x06ae('0x2a')](_0x5ca32b);}return null;};}function patchUpdates(_0x5d4f3d){return function(_0x4f0ccf){try{jsonpatch['apply'](_0x4f0ccf,_0x5d4f3d,!![]);}catch(_0x3e5317){return BPromise[_0x06ae('0x30')](_0x3e5317);}return _0x4f0ccf['save']();};}function saveUpdates(_0x1629a5,_0x580bed){return function(_0x49f8e8){if(_0x49f8e8){return _0x49f8e8[_0x06ae('0x31')](_0x1629a5)[_0x06ae('0x1f')](function(_0x58359e){return _0x58359e;});}return null;};}function removeEntity(_0x548b26,_0x5b707c){return function(_0x28fdb6){if(_0x28fdb6){return _0x28fdb6[_0x06ae('0x32')]()[_0x06ae('0x1f')](function(){var _0x4defc1=_0x28fdb6['get']({'plain':!![]});var _0x2ae772='OpenchannelAccounts';return db['UserProfileResource'][_0x06ae('0x32')]({'where':{'type':_0x2ae772,'resourceId':_0x4defc1['id']}})[_0x06ae('0x1f')](function(){return _0x28fdb6;});})[_0x06ae('0x1f')](function(){_0x548b26[_0x06ae('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd20d58,_0x31b11b){return function(_0x417ce6){if(!_0x417ce6){_0xd20d58[_0x06ae('0x27')](0x194);}return _0x417ce6;};}function handleError(_0xc81e79,_0x30a5d6){_0x30a5d6=_0x30a5d6||0x1f4;return function(_0x3553c3){logger[_0x06ae('0x23')](_0x3553c3[_0x06ae('0x33')]);if(_0x3553c3[_0x06ae('0x34')]){delete _0x3553c3[_0x06ae('0x34')];}_0xc81e79[_0x06ae('0x28')](_0x30a5d6)[_0x06ae('0x35')](_0x3553c3);};}exports['index']=function(_0x477c29,_0x1fa92a){var _0x3b22cc={'include':[{'model':db['Pause'],'as':_0x06ae('0x36')}]},_0xf11ea9={},_0xd7eb8e={'count':0x0,'rows':[]};var _0x53a793=_[_0x06ae('0x37')](db[_0x06ae('0x38')][_0x06ae('0x39')],function(_0x3464cf){return{'name':_0x3464cf[_0x06ae('0x3a')],'type':_0x3464cf['type'][_0x06ae('0x3b')]};});_0xf11ea9[_0x06ae('0x3c')]=_[_0x06ae('0x37')](_0x53a793,_0x06ae('0x34'));_0xf11ea9[_0x06ae('0x3d')]=_['keys'](_0x477c29[_0x06ae('0x3d')]);_0xf11ea9['filters']=_[_0x06ae('0x3e')](_0xf11ea9[_0x06ae('0x3c')],_0xf11ea9[_0x06ae('0x3d')]);_0x3b22cc[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0xf11ea9['model'],qs[_0x06ae('0x40')](_0x477c29[_0x06ae('0x3d')]['fields']));_0x3b22cc[_0x06ae('0x3f')]=_0x3b22cc[_0x06ae('0x3f')]['length']?_0x3b22cc[_0x06ae('0x3f')]:_0xf11ea9['model'];if(!_0x477c29['query']['hasOwnProperty'](_0x06ae('0x41'))){_0x3b22cc[_0x06ae('0x2d')]=qs[_0x06ae('0x2d')](_0x477c29[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0x3b22cc[_0x06ae('0x2b')]=qs[_0x06ae('0x2b')](_0x477c29[_0x06ae('0x3d')]['offset']);}_0x3b22cc[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x477c29[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x3b22cc['where']=qs[_0x06ae('0x44')](_[_0x06ae('0x45')](_0x477c29[_0x06ae('0x3d')],_0xf11ea9[_0x06ae('0x44')]),_0x53a793);if(_0x477c29[_0x06ae('0x3d')][_0x06ae('0x46')]){_0x3b22cc[_0x06ae('0x47')]=_[_0x06ae('0x48')](_0x3b22cc[_0x06ae('0x47')],{'$or':_[_0x06ae('0x37')](_0x53a793,function(_0x3e56b9){if(_0x3e56b9[_0x06ae('0x49')]!==_0x06ae('0x4a')){var _0x21b49f={};_0x21b49f[_0x3e56b9[_0x06ae('0x34')]]={'$like':'%'+_0x477c29[_0x06ae('0x3d')][_0x06ae('0x46')]+'%'};return _0x21b49f;}})});}_0x3b22cc=_[_0x06ae('0x48')]({},_0x3b22cc,_0x477c29[_0x06ae('0x4b')]);var _0x509969={'where':_0x3b22cc[_0x06ae('0x47')]};return db[_0x06ae('0x38')][_0x06ae('0x2e')](_0x509969)[_0x06ae('0x1f')](function(_0x16de5b){_0xd7eb8e[_0x06ae('0x2e')]=_0x16de5b;if(_0x477c29[_0x06ae('0x3d')][_0x06ae('0x4c')]){_0x3b22cc['include']=[{'all':!![]}];}return db[_0x06ae('0x38')][_0x06ae('0x4d')](_0x3b22cc);})[_0x06ae('0x1f')](function(_0x262fea){_0xd7eb8e['rows']=_0x262fea;return _0xd7eb8e;})['then'](respondWithFilteredResult(_0x1fa92a,_0x3b22cc))[_0x06ae('0x26')](handleError(_0x1fa92a,null));};exports[_0x06ae('0x4e')]=function(_0x38b2e7,_0x4653bb){var _0x1c014c={'raw':![],'where':{'id':_0x38b2e7[_0x06ae('0x4f')]['id']},'include':[{'model':db[_0x06ae('0x50')],'as':_0x06ae('0x36')}]},_0x4910fd={};_0x4910fd[_0x06ae('0x3c')]=_['keys'](db[_0x06ae('0x38')][_0x06ae('0x39')]);_0x4910fd[_0x06ae('0x3d')]=_['keys'](_0x38b2e7[_0x06ae('0x3d')]);_0x4910fd[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x4910fd['model'],_0x4910fd[_0x06ae('0x3d')]);_0x1c014c['attributes']=_[_0x06ae('0x3e')](_0x4910fd[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x38b2e7[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x1c014c[_0x06ae('0x3f')]=_0x1c014c[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x1c014c[_0x06ae('0x3f')]:_0x4910fd[_0x06ae('0x3c')];if(_0x38b2e7[_0x06ae('0x3d')]['includeAll']){_0x1c014c[_0x06ae('0x52')]=[{'all':!![]}];}_0x1c014c=_[_0x06ae('0x48')]({},_0x1c014c,_0x38b2e7[_0x06ae('0x4b')]);return db[_0x06ae('0x38')][_0x06ae('0x53')](_0x1c014c)[_0x06ae('0x1f')](handleEntityNotFound(_0x4653bb,null))[_0x06ae('0x1f')](respondWithResult(_0x4653bb,null))['catch'](handleError(_0x4653bb,null));};exports[_0x06ae('0x54')]=function(_0x3567b8,_0x400136){return db['OpenchannelAccount'][_0x06ae('0x54')](_0x3567b8[_0x06ae('0x55')],{})[_0x06ae('0x1f')](function(_0xdb82a7){var _0x42f2f9=_0x3567b8[_0x06ae('0x56')]['get']({'plain':!![]});if(!_0x42f2f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42f2f9['role']===_0x06ae('0x56')){var _0x24a9ca=_0xdb82a7[_0x06ae('0x57')]({'plain':!![]});var _0x37567f='OpenchannelAccounts';return db[_0x06ae('0x58')]['find']({'where':{'name':_0x37567f,'userProfileId':_0x42f2f9[_0x06ae('0x59')]},'raw':!![]})['then'](function(_0x5749a6){if(_0x5749a6&&_0x5749a6['autoAssociation']===0x0){return db['UserProfileResource'][_0x06ae('0x54')]({'name':_0x24a9ca['name'],'resourceId':_0x24a9ca['id'],'type':_0x5749a6[_0x06ae('0x34')],'sectionId':_0x5749a6['id']},{})[_0x06ae('0x1f')](function(){return _0xdb82a7;});}else{return _0xdb82a7;}})[_0x06ae('0x26')](function(_0x1222b4){logger[_0x06ae('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1222b4);throw _0x1222b4;});}return _0xdb82a7;})[_0x06ae('0x1f')](respondWithResult(_0x400136,0xc9))[_0x06ae('0x26')](handleError(_0x400136,null));};exports[_0x06ae('0x31')]=function(_0x996cb9,_0x1618d9){if(_0x996cb9[_0x06ae('0x55')]['id']){delete _0x996cb9[_0x06ae('0x55')]['id'];}return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x996cb9[_0x06ae('0x4f')]['id']},'include':[{'model':db[_0x06ae('0x50')],'as':_0x06ae('0x36')}]})[_0x06ae('0x1f')](handleEntityNotFound(_0x1618d9,null))[_0x06ae('0x1f')](saveUpdates(_0x996cb9[_0x06ae('0x55')],null))['then'](respondWithResult(_0x1618d9,null))[_0x06ae('0x26')](handleError(_0x1618d9,null));};exports['destroy']=function(_0xd06c04,_0x1b6f11){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0xd06c04[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x1b6f11,null))[_0x06ae('0x1f')](removeEntity(_0x1b6f11,null))[_0x06ae('0x26')](handleError(_0x1b6f11,null));};exports['describe']=function(_0x2fbc9e,_0xcb07c5){return db[_0x06ae('0x38')][_0x06ae('0x5a')]()['then'](respondWithResult(_0xcb07c5,null))[_0x06ae('0x26')](handleError(_0xcb07c5,null));};exports[_0x06ae('0x5b')]=function(_0x485e3b,_0x5d66c5,_0x52baae){if(_0x485e3b[_0x06ae('0x55')]['id']){delete _0x485e3b[_0x06ae('0x55')]['id'];}return db[_0x06ae('0x38')]['find']({'where':{'id':_0x485e3b[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x5d66c5,null))['then'](function(_0x16ebc4){if(_0x16ebc4){_0x485e3b['body'][_0x06ae('0x5c')]=_0x16ebc4['id'];return db[_0x06ae('0x5d')][_0x06ae('0x54')](_0x485e3b[_0x06ae('0x55')]);}})[_0x06ae('0x1f')](respondWithResult(_0x5d66c5,null))[_0x06ae('0x26')](handleError(_0x5d66c5,null));};exports[_0x06ae('0x5e')]=function(_0x2a4434,_0x1d7da6,_0x171331){var _0x25cb7c={'raw':![],'where':{}};var _0xc8fe57={};var _0x415e85={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0x2a4434[_0x06ae('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d7da6,null))[_0x06ae('0x1f')](function(_0xe4979b){if(_0xe4979b){_0xc8fe57[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db['Disposition'][_0x06ae('0x39')]);_0xc8fe57[_0x06ae('0x3d')]=_['keys'](_0x2a4434[_0x06ae('0x3d')]);_0xc8fe57['filters']=_['intersection'](_0xc8fe57['model'],_0xc8fe57[_0x06ae('0x3d')]);_0x25cb7c[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0xc8fe57[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x2a4434[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x25cb7c[_0x06ae('0x3f')]=_0x25cb7c[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x25cb7c[_0x06ae('0x3f')]:_0xc8fe57['model'];if(!_0x2a4434['query']['hasOwnProperty'](_0x06ae('0x41'))){_0x25cb7c['limit']=qs[_0x06ae('0x2d')](_0x2a4434[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0x25cb7c['offset']=qs[_0x06ae('0x2b')](_0x2a4434['query']['offset']);}_0x25cb7c[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x2a4434[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x25cb7c[_0x06ae('0x47')]=qs['filters'](_[_0x06ae('0x45')](_0x2a4434[_0x06ae('0x3d')],_0xc8fe57[_0x06ae('0x44')]));_0x25cb7c[_0x06ae('0x47')][_0x06ae('0x5c')]=_0xe4979b['id'];if(_0x2a4434['query'][_0x06ae('0x46')]){_0x25cb7c[_0x06ae('0x47')]=_[_0x06ae('0x48')](_0x25cb7c['where'],{'$or':_[_0x06ae('0x37')](_0x25cb7c[_0x06ae('0x3f')],function(_0x149362){var _0x379fb6={};_0x379fb6[_0x149362]={'$like':'%'+_0x2a4434['query'][_0x06ae('0x46')]+'%'};return _0x379fb6;})});}_0x25cb7c=_[_0x06ae('0x48')]({},_0x25cb7c,_0x2a4434[_0x06ae('0x4b')]);return db[_0x06ae('0x5d')][_0x06ae('0x2e')]({'where':_0x25cb7c[_0x06ae('0x47')]})[_0x06ae('0x1f')](function(_0x2ffba3){_0x415e85[_0x06ae('0x2e')]=_0x2ffba3;if(_0x2a4434['query'][_0x06ae('0x4c')]){_0x25cb7c[_0x06ae('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x06ae('0x4d')](_0x25cb7c);})[_0x06ae('0x1f')](function(_0x53b7cc){_0x415e85[_0x06ae('0x61')]=_0x53b7cc;return _0x415e85;});}})[_0x06ae('0x1f')](respondWithFilteredResult(_0x1d7da6,_0x25cb7c))['catch'](handleError(_0x1d7da6,null));};exports[_0x06ae('0x62')]=function(_0x20f719,_0x49ded0,_0x49cd44){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x20f719[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x49ded0,null))[_0x06ae('0x1f')](function(_0x3f6143){if(_0x3f6143){return _0x3f6143['removeDispositions'](_0x20f719[_0x06ae('0x3d')][_0x06ae('0x63')]);}})['then'](respondWithStatusCode(_0x49ded0,null))[_0x06ae('0x26')](handleError(_0x49ded0,null));};exports[_0x06ae('0x64')]=function(_0x601bfb,_0xe82a8,_0x1e6d98){if(_0x601bfb['body']['id']){delete _0x601bfb[_0x06ae('0x55')]['id'];}return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x601bfb[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0xe82a8,null))[_0x06ae('0x1f')](function(_0x1fd136){if(_0x1fd136){_0x601bfb[_0x06ae('0x55')][_0x06ae('0x5c')]=_0x1fd136['id'];return db[_0x06ae('0x65')][_0x06ae('0x54')](_0x601bfb['body']);}})['then'](respondWithResult(_0xe82a8,null))['catch'](handleError(_0xe82a8,null));};exports[_0x06ae('0x66')]=function(_0x128bd1,_0x3ebc03,_0x324caa){var _0x290d12={'raw':![],'where':{}};var _0x536d67={};var _0x533aaf={'count':0x0,'rows':[]};return db[_0x06ae('0x38')]['findOne']({'where':{'id':_0x128bd1['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x3ebc03,null))['then'](function(_0x191ce2){if(_0x191ce2){_0x536d67[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db[_0x06ae('0x65')][_0x06ae('0x39')]);_0x536d67[_0x06ae('0x3d')]=_[_0x06ae('0x60')](_0x128bd1[_0x06ae('0x3d')]);_0x536d67[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x536d67[_0x06ae('0x3c')],_0x536d67[_0x06ae('0x3d')]);_0x290d12[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0x536d67[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x128bd1[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x290d12[_0x06ae('0x3f')]=_0x290d12['attributes'][_0x06ae('0x51')]?_0x290d12[_0x06ae('0x3f')]:_0x536d67[_0x06ae('0x3c')];if(!_0x128bd1[_0x06ae('0x3d')]['hasOwnProperty']('nolimit')){_0x290d12[_0x06ae('0x2d')]=qs[_0x06ae('0x2d')](_0x128bd1[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0x290d12[_0x06ae('0x2b')]=qs[_0x06ae('0x2b')](_0x128bd1['query']['offset']);}_0x290d12[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x128bd1[_0x06ae('0x3d')]['sort']);_0x290d12[_0x06ae('0x47')]=qs['filters'](_[_0x06ae('0x45')](_0x128bd1['query'],_0x536d67[_0x06ae('0x44')]));_0x290d12[_0x06ae('0x47')]['OpenchannelAccountId']=_0x191ce2['id'];if(_0x128bd1['query']['filter']){_0x290d12['where']=_['merge'](_0x290d12['where'],{'$or':_[_0x06ae('0x37')](_0x290d12[_0x06ae('0x3f')],function(_0x4cdd43){var _0x9062aa={};_0x9062aa[_0x4cdd43]={'$like':'%'+_0x128bd1['query'][_0x06ae('0x46')]+'%'};return _0x9062aa;})});}_0x290d12=_[_0x06ae('0x48')]({},_0x290d12,_0x128bd1['options']);return db[_0x06ae('0x65')][_0x06ae('0x2e')]({'where':_0x290d12[_0x06ae('0x47')]})[_0x06ae('0x1f')](function(_0x36425b){_0x533aaf[_0x06ae('0x2e')]=_0x36425b;if(_0x128bd1[_0x06ae('0x3d')][_0x06ae('0x4c')]){_0x290d12[_0x06ae('0x52')]=[{'all':!![]}];}return db[_0x06ae('0x65')][_0x06ae('0x4d')](_0x290d12);})[_0x06ae('0x1f')](function(_0x17e223){_0x533aaf[_0x06ae('0x61')]=_0x17e223;return _0x533aaf;});}})['then'](respondWithFilteredResult(_0x3ebc03,_0x290d12))['catch'](handleError(_0x3ebc03,null));};exports[_0x06ae('0x67')]=function(_0x2091c4,_0x357c3e,_0x1f4619){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x2091c4['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x357c3e,null))[_0x06ae('0x1f')](function(_0x45d973){if(_0x45d973){return _0x45d973['removeAnswers'](_0x2091c4[_0x06ae('0x3d')][_0x06ae('0x63')]);}})[_0x06ae('0x1f')](respondWithStatusCode(_0x357c3e,null))[_0x06ae('0x26')](handleError(_0x357c3e,null));};exports[_0x06ae('0x68')]=function(_0x31f9ac,_0xe5acb3,_0x179019){var _0x7de0f0={'body':_0x31f9ac[_0x06ae('0x55')],'channel':_0x06ae('0x69')};var _0x32f65a=[];var _0x47be26=[];var _0x4a83f6={};var _0x5f3252=![];return db['CmContact'][_0x06ae('0x5a')]()['then'](function(_0x327aa2){if(!_0x327aa2){throw new db['Sequelize'][(_0x06ae('0x6a'))](_0x06ae('0x6b'));}_0x32f65a=_['difference'](_['keys'](_0x327aa2),[_0x06ae('0x6c'),_0x06ae('0x6d')]);_0x47be26=_[_0x06ae('0x6e')](_['keys'](_0x327aa2),[_0x06ae('0x6c'),'updatedAt',_0x06ae('0x6f'),_0x06ae('0x70')]);if(_0x31f9ac[_0x06ae('0x55')]['id']){delete _0x31f9ac[_0x06ae('0x55')]['id'];}if(_[_0x06ae('0x71')](_0x31f9ac[_0x06ae('0x55')]['from'])){throw new db[(_0x06ae('0x72'))][(_0x06ae('0x6a'))](_0x06ae('0x73'));}if(_[_0x06ae('0x71')](_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x55')])||_0x31f9ac[_0x06ae('0x55')]['body']===''){throw new db[(_0x06ae('0x72'))]['ValidationError'](_0x06ae('0x74'));}if(_[_0x06ae('0x71')](_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x75')])){throw new db['Sequelize'][(_0x06ae('0x6a'))](_0x06ae('0x76')+_0x47be26);}if(!_[_0x06ae('0x77')](_0x47be26,_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x75')])){throw new db[(_0x06ae('0x72'))]['ValidationError'](_0x06ae('0x78')+_0x47be26);}_0x4a83f6[_0x31f9ac['body'][_0x06ae('0x75')]]=_0x31f9ac['body'][_0x06ae('0x79')];})['then'](function(){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x31f9ac[_0x06ae('0x4f')]['id']},'include':[{'model':db['CmList'],'as':_0x06ae('0x7a'),'include':[{'model':db[_0x06ae('0x7b')],'as':_0x06ae('0x7c'),'where':_0x4a83f6,'limit':0x1,'order':[['updatedAt',_0x06ae('0x7d')]]}]},{'model':db[_0x06ae('0x7e')],'as':_0x06ae('0x7f')}]});})[_0x06ae('0x1f')](handleEntityNotFound(_0xe5acb3,null))[_0x06ae('0x1f')](function(_0x5e58af){if(_0x5e58af&&_0x5e58af[_0x06ae('0x7a')]){_0x7de0f0[_0x06ae('0x80')]=_0x5e58af;_0x7de0f0[_0x06ae('0x81')]=_0x5e58af[_0x06ae('0x7f')];_0x7de0f0[_0x06ae('0x82')]=_0x5e58af[_0x06ae('0x7a')];_0x7de0f0['applications']=_[_0x06ae('0x83')](_0x7de0f0[_0x06ae('0x81')],['priority'],[_0x06ae('0x84')]);if(_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7f')]){delete _0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7f')];}if(_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7a')]&&_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7a')][_0x06ae('0x7c')][_0x06ae('0x51')]){return _0x7de0f0['account'][_0x06ae('0x7a')][_0x06ae('0x7c')][0x0];}var _0x4a5b00=_[_0x06ae('0x85')](_0x31f9ac[_0x06ae('0x55')],{'firstName':_0x31f9ac['body'][_0x06ae('0x79')],'ListId':_0x5e58af[_0x06ae('0x70')]});_0x4a5b00[_0x31f9ac['body'][_0x06ae('0x75')]]=_0x31f9ac['body']['from'];return db[_0x06ae('0x7b')][_0x06ae('0x54')](_0x4a5b00,{'fields':_0x32f65a,'raw':!![]});}})[_0x06ae('0x1f')](handleEntityNotFound(_0xe5acb3,null))[_0x06ae('0x1f')](function(_0x212009){_0x7de0f0[_0x06ae('0x86')]=_0x212009;if(_0x212009){var _0x485713={'ContactId':_0x212009['id'],'OpenchannelAccountId':_0x31f9ac['params']['id'],'from':(_0x212009['firstName']||'')+'\x20'+(_0x212009[_0x06ae('0x87')]||'')};var _0x48abba={'OpenchannelAccountId':_0x31f9ac['params']['id'],'closed':![]};if(_0x31f9ac['body']['threadId']){_0x48abba[_0x06ae('0x88')]=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')];return db[_0x06ae('0x89')][_0x06ae('0x53')]({'where':_0x48abba})['then'](function(_0x403f3f){if(_0x403f3f){return[_0x403f3f,![]];}_0x485713[_0x06ae('0x88')]=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')];_0x485713[_0x06ae('0x8a')]=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8a')];return db[_0x06ae('0x89')][_0x06ae('0x54')](_0x485713)['then'](function(_0x1965d5){return[_0x1965d5,!![]];});});}else{_0x48abba[_0x06ae('0x88')]=null;}_0x48abba[_0x06ae('0x8b')]=_0x212009['id'];return db[_0x06ae('0x89')][_0x06ae('0x53')]({'where':_0x48abba})[_0x06ae('0x1f')](function(_0x268fc3){if(_0x268fc3){return[_0x268fc3,![]];}return db['OpenchannelInteraction']['create'](_0x485713)[_0x06ae('0x1f')](function(_0x33fa07){return[_0x33fa07,!![]];});});}})[_0x06ae('0x8c')](function(_0x427b85,_0x1e72a9){if(_0x427b85){_0x5f3252=_0x1e72a9;if(!_0x1e72a9){var _0x1fb926={'from':(_0x7de0f0[_0x06ae('0x86')]['firstName']||'')+'\x20'+(_0x7de0f0[_0x06ae('0x86')][_0x06ae('0x87')]||'')};if(_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')]&&_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8d')]&&_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')]!=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8d')]){_0x1fb926['threadId']=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8d')];}return _0x427b85[_0x06ae('0x31')](_0x1fb926);}else{return _0x427b85;}}})[_0x06ae('0x1f')](function(_0x4baa1e){_0x7de0f0['interaction']=_0x4baa1e[_0x06ae('0x57')]({'plain':!![]});_0x7de0f0['interaction']['created']=_0x5f3252;if(_0x7de0f0[_0x06ae('0x8e')][_0x06ae('0x8f')]){if(_0x7de0f0[_0x06ae('0x80')]['autoclose']){_0x7de0f0['applications']['push']({'id':0x0,'priority':_0x7de0f0['applications'][_0x06ae('0x51')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x06ae('0x90')});}}return db['OpenchannelMessage'][_0x06ae('0x54')]({'body':_0x31f9ac['body']['body'],'OpenchannelAccountId':_0x31f9ac['params']['id'],'OpenchannelInteractionId':_0x4baa1e['id'],'direction':'in','ContactId':_0x7de0f0[_0x06ae('0x86')]['id'],'AttachmentId':_0x31f9ac['body'][_0x06ae('0x91')]});})[_0x06ae('0x1f')](function(_0x4f6a87){_0x7de0f0[_0x06ae('0x24')]=_0x4f6a87;if(_0x7de0f0[_0x06ae('0x8e')][_0x06ae('0x92')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x7de0f0[_0x06ae('0x8e')][_0x06ae('0x92')]}})['then'](function(_0x1a928a){if(_0x1a928a){_0x7de0f0[_0x06ae('0x81')][_0x06ae('0x93')]({'id':0x0,'priority':0x0,'app':_0x06ae('0x94'),'appdata':_0x1a928a[_0x06ae('0x34')]+','+(_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x95')]||0xa),'interval':'*,*,*,*'});_0x7de0f0[_0x06ae('0x96')]=![];}return respondWithRpcPromise('Start',_0x06ae('0x97'),_0x7de0f0);});}return respondWithRpcPromise('Start',_0x06ae('0x97'),_0x7de0f0);})[_0x06ae('0x1f')](function(_0x445fd1){respondWithRpcPromise(_0x06ae('0x98'),_0x06ae('0x98'),{'event':_0x06ae('0x68'),'message':_0x445fd1},client9002);return _0x445fd1;})[_0x06ae('0x1f')](respondWithResult(_0xe5acb3,null))['catch'](handleError(_0xe5acb3,null));};exports[_0x06ae('0x99')]=function(_0x2fe28a,_0x56ac5c){var _0x3dfc55=_0x2fe28a[_0x06ae('0x4f')]['id'];var _0x13a8c7=_0x2fe28a[_0x06ae('0x55')];var _0x3246cc=0xc8;var _0x214755=null;return db[_0x06ae('0x9a')][_0x06ae('0x9b')]({'isolationLevel':db[_0x06ae('0x9a')]['Transaction'][_0x06ae('0x9c')][_0x06ae('0x9d')]},function(_0x1bb312){return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0x3dfc55},'transaction':_0x1bb312})['then'](function(_0x5a79aa){if(_0x5a79aa){return db[_0x06ae('0x7e')][_0x06ae('0x32')]({'where':{'OpenchannelAccountId':_0x3dfc55},'transaction':_0x1bb312})['then'](function(){var _0x24c9e7=_[_0x06ae('0x37')](_0x13a8c7,function(_0x5113b7){_0x5113b7[_0x06ae('0x5c')]=_0x3dfc55;return _0x5113b7;});return db[_0x06ae('0x7e')][_0x06ae('0x9e')](_0x24c9e7,{'transaction':_0x1bb312});});}else{_0x3246cc=0x194;_0x214755=[];}});})['then'](function(){if(_0x3246cc!==0x194){return db[_0x06ae('0x7e')][_0x06ae('0x9f')]({'where':{'OpenchannelAccountId':_0x3dfc55},'order':_0x06ae('0xa0')})[_0x06ae('0x1f')](function(_0x1f189a){_0x214755=_0x1f189a;});}})[_0x06ae('0x26')](function(_0x3a2edc){_0x3246cc=0x1f4;logger[_0x06ae('0x23')](_0x3a2edc['stack']);if(_0x3a2edc[_0x06ae('0x34')]){delete _0x3a2edc['name'];}_0x214755=_0x3a2edc;})['finally'](function(){if(_0x214755===null){_0x56ac5c[_0x06ae('0x27')](_0x3246cc);}else{if(_0x3246cc===0x1f4){_0x56ac5c[_0x06ae('0x28')](_0x3246cc)[_0x06ae('0x35')](_0x214755);}else{_0x56ac5c[_0x06ae('0x28')](_0x3246cc)[_0x06ae('0x2a')](_0x214755);}}});};exports[_0x06ae('0xa1')]=function(_0x38dcb5,_0x28255c,_0x25c3fd){var _0x3be33b={};var _0x1fa51e={};var _0x17aa6f;var _0x15ccbe;return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0x38dcb5[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x28255c,null))[_0x06ae('0x1f')](function(_0x28594b){if(_0x28594b){_0x17aa6f=_0x28594b;_0x1fa51e[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db[_0x06ae('0x7e')][_0x06ae('0x39')]);_0x1fa51e[_0x06ae('0x3d')]=_['keys'](_0x38dcb5[_0x06ae('0x3d')]);_0x1fa51e[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x1fa51e['model'],_0x1fa51e[_0x06ae('0x3d')]);_0x3be33b['attributes']=_[_0x06ae('0x3e')](_0x1fa51e[_0x06ae('0x3c')],qs['fields'](_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x3be33b[_0x06ae('0x3f')]=_0x3be33b[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x3be33b[_0x06ae('0x3f')]:_0x1fa51e[_0x06ae('0x3c')];_0x3be33b[_0x06ae('0x42')]=qs['sort'](_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x3be33b[_0x06ae('0x47')]=qs[_0x06ae('0x44')](_[_0x06ae('0x45')](_0x38dcb5[_0x06ae('0x3d')],_0x1fa51e['filters']));if(_0x38dcb5['query'][_0x06ae('0x46')]){_0x3be33b[_0x06ae('0x47')]=_[_0x06ae('0x48')](_0x3be33b[_0x06ae('0x47')],{'$or':_[_0x06ae('0x37')](_0x3be33b[_0x06ae('0x3f')],function(_0x3c8458){var _0x3faa8f={};_0x3faa8f[_0x3c8458]={'$like':'%'+_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0x46')]+'%'};return _0x3faa8f;})});}_0x3be33b=_[_0x06ae('0x48')]({},_0x3be33b,_0x38dcb5[_0x06ae('0x4b')]);return _0x17aa6f[_0x06ae('0xa1')](_0x3be33b);}})['then'](function(_0x44757e){if(_0x44757e){_0x15ccbe=_0x44757e[_0x06ae('0x51')];if(!_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0xa2')](_0x06ae('0x41'))){_0x3be33b['limit']=qs['limit'](_0x38dcb5[_0x06ae('0x3d')]['limit']);_0x3be33b['offset']=qs[_0x06ae('0x2b')](_0x38dcb5[_0x06ae('0x3d')]['offset']);}return _0x17aa6f['getApplications'](_0x3be33b);}})['then'](function(_0x3045b3){if(_0x3045b3){return _0x3045b3?{'count':_0x15ccbe,'rows':_0x3045b3}:null;}})[_0x06ae('0x1f')](respondWithResult(_0x28255c,null))[_0x06ae('0x26')](handleError(_0x28255c,null));};exports['getInteractions']=function(_0xe10d8d,_0x36a2d5,_0x165352){var _0xab9f57={'raw':![],'where':{}};var _0x48df7b={};var _0x404246={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0xe10d8d[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x36a2d5,null))[_0x06ae('0x1f')](function(_0x1af8b6){if(_0x1af8b6){_0x48df7b[_0x06ae('0x3c')]=_['keys'](db['OpenchannelInteraction'][_0x06ae('0x39')]);_0x48df7b[_0x06ae('0x3d')]=_['keys'](_0xe10d8d['query']);_0x48df7b[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x48df7b[_0x06ae('0x3c')],_0x48df7b['query']);_0xab9f57[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0x48df7b['model'],qs[_0x06ae('0x40')](_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x40')]));_0xab9f57[_0x06ae('0x3f')]=_0xab9f57[_0x06ae('0x3f')][_0x06ae('0x51')]?_0xab9f57[_0x06ae('0x3f')]:_0x48df7b[_0x06ae('0x3c')];if(!_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0xa2')]('nolimit')){_0xab9f57[_0x06ae('0x2d')]=qs[_0x06ae('0x2d')](_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0xab9f57[_0x06ae('0x2b')]=qs[_0x06ae('0x2b')](_0xe10d8d['query'][_0x06ae('0x2b')]);}_0xab9f57[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x43')]);_0xab9f57[_0x06ae('0x47')]=qs[_0x06ae('0x44')](_['pick'](_0xe10d8d[_0x06ae('0x3d')],_0x48df7b[_0x06ae('0x44')]));_0xab9f57['where'][_0x06ae('0x5c')]=_0x1af8b6['id'];if(_0xe10d8d['query'][_0x06ae('0x46')]){_0xab9f57[_0x06ae('0x47')]=_['merge'](_0xab9f57['where'],{'$or':_[_0x06ae('0x37')](_0xab9f57[_0x06ae('0x3f')],function(_0x2cd72f){var _0x3d3821={};_0x3d3821[_0x2cd72f]={'$like':'%'+_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x46')]+'%'};return _0x3d3821;})});}_0xab9f57=_[_0x06ae('0x48')]({},_0xab9f57,_0xe10d8d[_0x06ae('0x4b')]);return db['OpenchannelInteraction'][_0x06ae('0x2e')]({'where':_0xab9f57['where']})['then'](function(_0x5764ce){_0x404246[_0x06ae('0x2e')]=_0x5764ce;if(_0xe10d8d['query'][_0x06ae('0x4c')]){_0xab9f57[_0x06ae('0x52')]=[{'model':db[_0x06ae('0x7b')],'as':_0x06ae('0xa3'),'required':![]},{'model':db[_0x06ae('0xa4')],'as':_0x06ae('0xa5'),'attributes':[_0x06ae('0x34'),_0x06ae('0xa6'),_0x06ae('0xa7')],'required':![]},{'model':db[_0x06ae('0xa8')],'as':_0x06ae('0xa9'),'attributes':['id',_0x06ae('0x34'),_0x06ae('0xaa')],'where':_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0xab')]?{'id':_0xe10d8d['query'][_0x06ae('0xab')]}:undefined,'required':_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0xab')]?!![]:![]}];}return db[_0x06ae('0x89')][_0x06ae('0x4d')](_0xab9f57);})[_0x06ae('0x1f')](function(_0x2f9ff8){_0x404246['rows']=_0x2f9ff8;return _0x404246;});}})[_0x06ae('0x1f')](respondWithFilteredResult(_0x36a2d5,_0xab9f57))[_0x06ae('0x26')](handleError(_0x36a2d5,null));};exports[_0x06ae('0xac')]=function(_0x4f2d72,_0x134b8f,_0x3a940d){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x4f2d72[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x134b8f,null))[_0x06ae('0x1f')](function(_0x5d34ec){if(_0x5d34ec){return _0x5d34ec['addAgents'](_0x4f2d72['body'][_0x06ae('0x63')],_[_0x06ae('0xad')](_0x4f2d72[_0x06ae('0x55')],[_0x06ae('0x63'),'id'])||{})[_0x06ae('0x8c')](function(_0x41ff87){for(var _0x5a8be5=0x0;_0x5a8be5<_0x4f2d72[_0x06ae('0x55')][_0x06ae('0x63')][_0x06ae('0x51')];_0x5a8be5+=0x1){socket[_0x06ae('0xae')](_0x06ae('0xaf'),{'UserId':Number(_0x4f2d72['body'][_0x06ae('0x63')][_0x5a8be5]),'OpenchannelAccountId':Number(_0x4f2d72[_0x06ae('0x4f')]['id'])});}return _0x41ff87;});}})['then'](respondWithResult(_0x134b8f,null))[_0x06ae('0x26')](handleError(_0x134b8f,null));};exports[_0x06ae('0xb0')]=function(_0x38918c,_0x493aaa,_0x26afa6){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x38918c[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x493aaa,null))['then'](function(_0x70341){if(_0x70341){return _0x70341[_0x06ae('0xb0')](_0x38918c[_0x06ae('0x3d')][_0x06ae('0x63')])[_0x06ae('0x1f')](function(){if(_[_0x06ae('0xb1')](_0x38918c['query'][_0x06ae('0x63')])){for(var _0x1deb9f=0x0;_0x1deb9f<_0x38918c[_0x06ae('0x3d')][_0x06ae('0x63')][_0x06ae('0x51')];_0x1deb9f+=0x1){socket[_0x06ae('0xae')](_0x06ae('0xb2'),{'UserId':Number(_0x38918c['query']['ids'][_0x1deb9f]),'OpenchannelAccountId':Number(_0x38918c[_0x06ae('0x4f')]['id'])});}}else{socket[_0x06ae('0xae')](_0x06ae('0xb2'),{'UserId':Number(_0x38918c[_0x06ae('0x3d')]['ids']),'OpenchannelAccountId':Number(_0x38918c[_0x06ae('0x4f')]['id'])});}});}})[_0x06ae('0x1f')](respondWithStatusCode(_0x493aaa,null))[_0x06ae('0x26')](handleError(_0x493aaa,null));};exports[_0x06ae('0xb3')]=function(_0x5733c9,_0x547cfc,_0x32a3b9){var _0x1ea526={};var _0x2f6d44={};var _0x55fa87;var _0x3b1b04;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5733c9['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x547cfc,null))['then'](function(_0xa698bc){if(_0xa698bc){_0x55fa87=_0xa698bc;_0x2f6d44[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db[_0x06ae('0xa4')][_0x06ae('0x39')]);_0x2f6d44[_0x06ae('0x3d')]=_[_0x06ae('0x60')](_0x5733c9['query']);_0x2f6d44[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x2f6d44[_0x06ae('0x3c')],_0x2f6d44[_0x06ae('0x3d')]);_0x1ea526[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0x2f6d44[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x5733c9['query'][_0x06ae('0x40')]));_0x1ea526['attributes']=_0x1ea526[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x1ea526[_0x06ae('0x3f')]:_0x2f6d44['model'];_0x1ea526[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x5733c9[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x1ea526['where']=qs[_0x06ae('0x44')](_[_0x06ae('0x45')](_0x5733c9[_0x06ae('0x3d')],_0x2f6d44[_0x06ae('0x44')]));if(_0x5733c9['query'][_0x06ae('0x46')]){_0x1ea526[_0x06ae('0x47')]=_['merge'](_0x1ea526[_0x06ae('0x47')],{'$or':_[_0x06ae('0x37')](_0x1ea526['attributes'],function(_0x3d0846){var _0x37d6ed={};_0x37d6ed[_0x3d0846]={'$like':'%'+_0x5733c9['query'][_0x06ae('0x46')]+'%'};return _0x37d6ed;})});}_0x1ea526=_[_0x06ae('0x48')]({},_0x1ea526,_0x5733c9[_0x06ae('0x4b')]);return _0x55fa87[_0x06ae('0xb3')](_0x1ea526);}})[_0x06ae('0x1f')](function(_0x44c352){if(_0x44c352){_0x3b1b04=_0x44c352[_0x06ae('0x51')];if(!_0x5733c9['query'][_0x06ae('0xa2')](_0x06ae('0x41'))){_0x1ea526['limit']=qs[_0x06ae('0x2d')](_0x5733c9['query'][_0x06ae('0x2d')]);_0x1ea526[_0x06ae('0x2b')]=qs['offset'](_0x5733c9[_0x06ae('0x3d')]['offset']);}return _0x55fa87[_0x06ae('0xb3')](_0x1ea526);}})['then'](function(_0x422a93){if(_0x422a93){return _0x422a93?{'count':_0x3b1b04,'rows':_0x422a93}:null;}})[_0x06ae('0x1f')](respondWithResult(_0x547cfc,null))[_0x06ae('0x26')](handleError(_0x547cfc,null));};exports[_0x06ae('0x35')]=function(_0x3dfbb1,_0x179b89,_0x7b8641){var _0x3405f5,_0x2d0969,_0xc8e8e6;if(_[_0x06ae('0x71')](_0x3dfbb1[_0x06ae('0x55')][_0x06ae('0x55')])||_0x3dfbb1[_0x06ae('0x55')]['body']===''){throw new db[(_0x06ae('0x72'))]['ValidationError'](_0x06ae('0x74'));}if(_['isNil'](_0x3dfbb1['body']['to'])){}_0x3405f5=_0x3dfbb1[_0x06ae('0x55')]['to'];return db[_0x06ae('0x38')]['findOne']({'where':{'id':_0x3dfbb1['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x179b89,null))[_0x06ae('0x1f')](function(_0x5d8c76){if(_0x5d8c76){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x5d8c76['id']},'include':[{'model':db['CmList'],'as':_0x06ae('0x7a'),'include':[{'model':db[_0x06ae('0x7b')],'as':'Contacts','where':{[_0x5d8c76[_0x06ae('0x75')]]:_0x3405f5},'limit':0x1,'order':[[_0x06ae('0x6d'),'DESC']]}]}]})[_0x06ae('0x1f')](handleEntityNotFound(_0x179b89,null))['then'](function(_0xb91272){if(_0xb91272&&_0xb91272[_0x06ae('0x7a')]){_0x2d0969=_0xb91272[_0x06ae('0x57')]({'plain':!![]});if(_0x2d0969[_0x06ae('0x7a')]&&_0x2d0969['List'][_0x06ae('0x7c')]['length']){return _0x2d0969['List'][_0x06ae('0x7c')][0x0];}return db['CmContact']['create'](_[_0x06ae('0x85')](_0x3dfbb1[_0x06ae('0x55')],{'firstName':_0x3405f5,[_0xb91272[_0x06ae('0x75')]]:_0x3405f5,'phone':_0x3405f5,'ListId':_0x2d0969[_0x06ae('0x70')]}));}})[_0x06ae('0x1f')](handleEntityNotFound(_0x179b89,null))[_0x06ae('0x1f')](function(_0x2e67af){if(_0x2e67af){_0xc8e8e6=_0x2e67af;return db[_0x06ae('0x89')][_0x06ae('0x53')]({'where':{'ContactId':_0xc8e8e6['id'],'closed':![],'OpenchannelAccountId':_0x2d0969['id']}})[_0x06ae('0x1f')](function(_0x9ba423){if(_0x9ba423){return[_0x9ba423,![]];}return db[_0x06ae('0x89')]['create']({'UserId':_0x3dfbb1['user']['id'],'ContactId':_0xc8e8e6['id'],'OpenchannelAccountId':_0x2d0969['id'],'lastMsgDirection':_0x06ae('0xb4'),'firstMsgDirection':'out','Messages':[_[_0x06ae('0x48')](_0x3dfbb1[_0x06ae('0x55')],{'read':![],'body':_0x3dfbb1[_0x06ae('0x55')][_0x06ae('0x55')],'OpenchannelAccountId':_0x2d0969['id'],'UserId':_0x3dfbb1['user']['id'],'ContactId':_0xc8e8e6['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x06ae('0xb5')}]})['then'](function(_0x170449){return[_0x170449,!![]];});});}})[_0x06ae('0x8c')](function(_0x5136a5,_0x47ba99){if(_0x47ba99){return _0x5136a5;}return db[_0x06ae('0xb6')][_0x06ae('0x54')](_['merge'](_0x3dfbb1[_0x06ae('0x55')],{'read':![],'body':_0x3dfbb1[_0x06ae('0x55')][_0x06ae('0x55')],'OpenchannelAccountId':_0x2d0969['id'],'OpenchannelInteractionId':_0x5136a5['id'],'UserId':_0x3dfbb1['user']['id'],'ContactId':_0xc8e8e6['id']}))[_0x06ae('0x1f')](function(_0x2aabf6){_0x5136a5['dataValues']['Messages']=[];_0x5136a5[_0x06ae('0xb7')]['Messages'][_0x06ae('0xb8')](_0x2aabf6['dataValues']);return _0x5136a5;});});}})['then'](respondWithResult(_0x179b89,null))[_0x06ae('0x26')](handleError(_0x179b89,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 14e7388..bf64870 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dae=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x219bbc,_0x3687bf){var _0x4a3f02=function(_0x1d0e95){while(--_0x1d0e95){_0x219bbc['push'](_0x219bbc['shift']());}};_0x4a3f02(++_0x3687bf);}(_0x2dae,0xc3));var _0xe2da=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x2dae[_0x33a694];return _0x41ff01;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe2da('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe2da('0x2')](0x0);var events={'afterCreate':_0xe2da('0x3'),'afterUpdate':_0xe2da('0x4'),'afterDestroy':_0xe2da('0x5')};function emitEvent(_0x481d97){return function(_0x25b9f2,_0x439b5d,_0x77e45e){OpenchannelAccountEvents[_0xe2da('0x6')](_0x481d97+':'+_0x25b9f2['id'],_0x25b9f2);OpenchannelAccountEvents['emit'](_0x481d97,_0x25b9f2);_0x77e45e(null);};}for(var e in events){if(events[_0xe2da('0x7')](e)){var event=events[e];OpenchannelAccount[_0xe2da('0x8')](e,emitEvent(event));}}module[_0xe2da('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4483,0x1a3));var _0x3448=function(_0x5d20d5,_0x10f89b){_0x5d20d5=_0x5d20d5-0x0;var _0x171248=_0x4483[_0x5d20d5];return _0x171248;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8d260b0..72d5f44 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3774bb,_0x4914dc){var _0x58fc64=function(_0x173967){while(--_0x173967){_0x3774bb['push'](_0x3774bb['shift']());}};_0x58fc64(++_0x4914dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0xc7be04,_0x4f7e2b){var _0x46ea1a=function(_0x4ba2e1){while(--_0x4ba2e1){_0xc7be04['push'](_0xc7be04['shift']());}};_0x46ea1a(++_0x4f7e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 489eba3..46bf430 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b20=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x372291,_0x5910a5){var _0x530635=function(_0x1f21dc){while(--_0x1f21dc){_0x372291['push'](_0x372291['shift']());}};_0x530635(++_0x5910a5);}(_0x6b20,0xd1));var _0x06b2=function(_0x546e34,_0x1dbdd6){_0x546e34=_0x546e34-0x0;var _0x2398c6=_0x6b20[_0x546e34];return _0x2398c6;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});config[_0x06b2('0xb')]=_[_0x06b2('0xc')](config['redis'],{'host':_0x06b2('0xd'),'port':0x18eb});var socket=require(_0x06b2('0xe'))(new Redis(config[_0x06b2('0xb')]));require('./openchannelAccount.socket')[_0x06b2('0xf')](socket);function respondWithRpcPromise(_0x57f854,_0x2cc28f,_0x4da705){return new BPromise(function(_0x552cd8,_0x301519){return client[_0x06b2('0x10')](_0x57f854,_0x4da705)['then'](function(_0x182f8f){logger[_0x06b2('0x11')](_0x06b2('0x12'),_0x2cc28f,_0x06b2('0x13'));logger[_0x06b2('0x14')](_0x06b2('0x15'),_0x2cc28f,_0x06b2('0x13'),JSON[_0x06b2('0x16')](_0x182f8f));if(_0x182f8f[_0x06b2('0x17')]){if(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x18')]===0x1f4){logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f['error'][_0x06b2('0x19')]);return _0x301519(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f[_0x06b2('0x17')]['message']);return _0x552cd8(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}else{logger['info'](_0x06b2('0x12'),_0x2cc28f,'request\x20sent');_0x552cd8(_0x182f8f['result'][_0x06b2('0x19')]);}})[_0x06b2('0x1a')](function(_0x27852e){logger[_0x06b2('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2cc28f,_0x27852e);_0x301519(_0x27852e);});});} \ No newline at end of file +var _0x073e=['../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils'];(function(_0x1a64b2,_0x348f77){var _0x4f9d61=function(_0x22b740){while(--_0x22b740){_0x1a64b2['push'](_0x1a64b2['shift']());}};_0x4f9d61(++_0x348f77);}(_0x073e,0x181));var _0xe073=function(_0x4a3e91,_0x8e03db){_0x4a3e91=_0x4a3e91-0x0;var _0x36da84=_0x073e[_0x4a3e91];return _0x36da84;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var moment=require(_0xe073('0x2'));var BPromise=require(_0xe073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe073('0x4'));var logger=require(_0xe073('0x5'))(_0xe073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe073('0x7')]({'port':0x232a});config[_0xe073('0x8')]=_[_0xe073('0x9')](config[_0xe073('0x8')],{'host':_0xe073('0xa'),'port':0x18eb});var socket=require(_0xe073('0xb'))(new Redis(config['redis']));require(_0xe073('0xc'))[_0xe073('0xd')](socket);function respondWithRpcPromise(_0x46757c,_0x118048,_0x4fccb1){return new BPromise(function(_0x47ac27,_0x32878f){return client[_0xe073('0xe')](_0x46757c,_0x4fccb1)[_0xe073('0xf')](function(_0x3a9df1){logger[_0xe073('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x118048,_0xe073('0x11'));logger['debug'](_0xe073('0x12'),_0x118048,'request\x20sent',JSON[_0xe073('0x13')](_0x3a9df1));if(_0x3a9df1['error']){if(_0x3a9df1[_0xe073('0x14')][_0xe073('0x15')]===0x1f4){logger[_0xe073('0x14')](_0xe073('0x16'),_0x118048,_0x3a9df1[_0xe073('0x14')][_0xe073('0x17')]);return _0x32878f(_0x3a9df1[_0xe073('0x14')][_0xe073('0x17')]);}logger[_0xe073('0x14')](_0xe073('0x16'),_0x118048,_0x3a9df1[_0xe073('0x14')]['message']);return _0x47ac27(_0x3a9df1['error']['message']);}else{logger[_0xe073('0x10')](_0xe073('0x16'),_0x118048,_0xe073('0x11'));_0x47ac27(_0x3a9df1[_0xe073('0x18')]['message']);}})[_0xe073('0x19')](function(_0x103a51){logger[_0xe073('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x118048,_0x103a51);_0x32878f(_0x103a51);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 1d68113..53d6ecc 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fec=['removeListener','openchannelAccount:','./openchannelAccount.events','save','remove','emit'];(function(_0x218896,_0x227715){var _0x41547e=function(_0x38d970){while(--_0x38d970){_0x218896['push'](_0x218896['shift']());}};_0x41547e(++_0x227715);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x1c656a,_0x3ebdab){_0x1c656a=_0x1c656a-0x0;var _0x35bee5=_0x0fec[_0x1c656a];return _0x35bee5;};'use strict';var OpenchannelAccountEvents=require(_0xc0fe('0x0'));var events=[_0xc0fe('0x1'),_0xc0fe('0x2'),'update'];function createListener(_0x5b0e31,_0x36377d){return function(_0x53dc4d){_0x36377d[_0xc0fe('0x3')](_0x5b0e31,_0x53dc4d);};}function removeListener(_0x28af46,_0x4d1088){return function(){OpenchannelAccountEvents[_0xc0fe('0x4')](_0x28af46,_0x4d1088);};}exports['register']=function(_0x3fce36){for(var _0x1073f0=0x0,_0x4cc359=events['length'];_0x1073f0<_0x4cc359;_0x1073f0++){var _0x5b3f5a=events[_0x1073f0];var _0x326ab7=createListener(_0xc0fe('0x5')+_0x5b3f5a,_0x3fce36);OpenchannelAccountEvents['on'](_0x5b3f5a,_0x326ab7);}}; \ No newline at end of file +var _0x136c=['emit','removeListener','register','length','./openchannelAccount.events','save','update'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x136c,0x1d2));var _0xc136=function(_0x438ab,_0x45db52){_0x438ab=_0x438ab-0x0;var _0x3dbe29=_0x136c[_0x438ab];return _0x3dbe29;};'use strict';var OpenchannelAccountEvents=require(_0xc136('0x0'));var events=[_0xc136('0x1'),'remove',_0xc136('0x2')];function createListener(_0x3b4cbd,_0x34c789){return function(_0x15181c){_0x34c789[_0xc136('0x3')](_0x3b4cbd,_0x15181c);};}function removeListener(_0x9e2e9d,_0x19565a){return function(){OpenchannelAccountEvents[_0xc136('0x4')](_0x9e2e9d,_0x19565a);};}exports[_0xc136('0x5')]=function(_0x586570){for(var _0x1ac41b=0x0,_0x594112=events[_0xc136('0x6')];_0x1ac41b<_0x594112;_0x1ac41b++){var _0x3993f2=events[_0x1ac41b];var _0x1804c1=createListener('openchannelAccount:'+_0x3993f2,_0x586570);OpenchannelAccountEvents['on'](_0x3993f2,_0x1804c1);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index f0559a0..1abcc46 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1139=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','post','create','put','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0xb953a,_0x3d230e){var _0x27ea69=function(_0x4c9b9e){while(--_0x4c9b9e){_0xb953a['push'](_0xb953a['shift']());}};_0x27ea69(++_0x3d230e);}(_0x1139,0x1e9));var _0x9113=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1139[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require('path');var timeout=require(_0x9113('0x2'));var express=require(_0x9113('0x3'));var router=express[_0x9113('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9113('0x5'));var config=require(_0x9113('0x6'));var controller=require(_0x9113('0x7'));router[_0x9113('0x8')]('/',auth[_0x9113('0x9')](),controller['index']);router['get']('/:id',auth[_0x9113('0x9')](),controller[_0x9113('0xa')]);router[_0x9113('0xb')]('/',auth['isAuthenticated'](),controller[_0x9113('0xc')]);router[_0x9113('0xd')]('/:id',auth[_0x9113('0x9')](),controller['update']);router['delete']('/:id',auth[_0x9113('0x9')](),controller['destroy']);module[_0x9113('0xe')]=router; \ No newline at end of file +var _0x9048=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9048,0x105));var _0x8904=function(_0x6084c8,_0x450d6a){_0x6084c8=_0x6084c8-0x0;var _0x51522f=_0x9048[_0x6084c8];return _0x51522f;};'use strict';var multer=require(_0x8904('0x0'));var util=require(_0x8904('0x1'));var path=require(_0x8904('0x2'));var timeout=require(_0x8904('0x3'));var express=require(_0x8904('0x4'));var router=express[_0x8904('0x5')]();var fs_extra=require(_0x8904('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8904('0x7'));var config=require(_0x8904('0x8'));var controller=require(_0x8904('0x9'));router[_0x8904('0xa')]('/',auth[_0x8904('0xb')](),controller['index']);router[_0x8904('0xa')](_0x8904('0xc'),auth[_0x8904('0xb')](),controller[_0x8904('0xd')]);router[_0x8904('0xe')]('/',auth[_0x8904('0xb')](),controller[_0x8904('0xf')]);router['put'](_0x8904('0xc'),auth[_0x8904('0xb')](),controller[_0x8904('0x10')]);router[_0x8904('0x11')](_0x8904('0xc'),auth[_0x8904('0xb')](),controller[_0x8904('0x12')]);module[_0x8904('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index e0ee836..58ab07d 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5050=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5050,0xe7));var _0x0505=function(_0x834e47,_0x4ffed4){_0x834e47=_0x834e47-0x0;var _0x2c5ce1=_0x5050[_0x834e47];return _0x2c5ce1;};'use strict';var Sequelize=require('sequelize');module[_0x0505('0x0')]={'priority':{'type':Sequelize[_0x0505('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0505('0x2')],'allowNull':![],'defaultValue':_0x0505('0x3')},'appdata':{'type':Sequelize[_0x0505('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0505('0x2')],'defaultValue':_0x0505('0x5')}}; \ No newline at end of file +var _0x8a78=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8a78,0x158));var _0x88a7=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x8a78[_0xcd0918];return _0x250704;};'use strict';var Sequelize=require(_0x88a7('0x0'));module[_0x88a7('0x1')]={'priority':{'type':Sequelize[_0x88a7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88a7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x88a7('0x4')]()},'description':{'type':Sequelize[_0x88a7('0x3')]},'interval':{'type':Sequelize[_0x88a7('0x3')],'defaultValue':_0x88a7('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 42bf151..495956f 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9438=['../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','findAll','catch','show','keys','include','options','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5ba113,_0x4b990c){var _0x471a04=function(_0x21df6e){while(--_0x21df6e){_0x5ba113['push'](_0x5ba113['shift']());}};_0x471a04(++_0x4b990c);}(_0x9438,0x186));var _0x8943=function(_0x48e53f,_0x9bdd20){_0x48e53f=_0x48e53f-0x0;var _0xd4fa6a=_0x9438[_0x48e53f];return _0xd4fa6a;};'use strict';var emlformat=require(_0x8943('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8943('0x1'));var jsonpatch=require(_0x8943('0x2'));var rp=require(_0x8943('0x3'));var moment=require(_0x8943('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8943('0x5'));var path=require(_0x8943('0x6'));var sox=require(_0x8943('0x7'));var csv=require(_0x8943('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8943('0x9'));var squel=require(_0x8943('0xa'));var crypto=require(_0x8943('0xb'));var jsforce=require(_0x8943('0xc'));var deskjs=require(_0x8943('0xd'));var toCsv=require(_0x8943('0x8'));var querystring=require(_0x8943('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8943('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8943('0x10'));var hardwareService=require(_0x8943('0x11'));var logger=require(_0x8943('0x12'))('api');var utils=require(_0x8943('0x13'));var config=require(_0x8943('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x307c0c,_0x55d971){_0x55d971=_0x55d971||0xcc;return function(_0x33e0ea){if(_0x33e0ea){return _0x307c0c[_0x8943('0x15')](_0x55d971);}return _0x307c0c[_0x8943('0x16')](_0x55d971)[_0x8943('0x17')]();};}function respondWithResult(_0x61f15c,_0x17ac2e){_0x17ac2e=_0x17ac2e||0xc8;return function(_0x1d88b1){if(_0x1d88b1){return _0x61f15c[_0x8943('0x16')](_0x17ac2e)[_0x8943('0x18')](_0x1d88b1);}};}function respondWithFilteredResult(_0x222676,_0x3bf27b){return function(_0x2753e3){if(_0x2753e3){var _0x19f69d=typeof _0x3bf27b[_0x8943('0x19')]===_0x8943('0x1a')&&typeof _0x3bf27b[_0x8943('0x1b')]===_0x8943('0x1a');var _0x249416=_0x2753e3[_0x8943('0x1c')];var _0x26b46d=_0x19f69d?0x0:_0x3bf27b[_0x8943('0x19')];var _0x164cfd=_0x19f69d?_0x2753e3[_0x8943('0x1c')]:_0x3bf27b['offset']+_0x3bf27b[_0x8943('0x1b')];var _0x338824;if(_0x164cfd>=_0x249416){_0x164cfd=_0x249416;_0x338824=0xc8;}else{_0x338824=0xce;}_0x222676[_0x8943('0x16')](_0x338824);return _0x222676['set'](_0x8943('0x1d'),_0x26b46d+'-'+_0x164cfd+'/'+_0x249416)[_0x8943('0x18')](_0x2753e3);}return null;};}function patchUpdates(_0x5e3acf){return function(_0x27b56f){try{jsonpatch['apply'](_0x27b56f,_0x5e3acf,!![]);}catch(_0x510260){return BPromise[_0x8943('0x1e')](_0x510260);}return _0x27b56f[_0x8943('0x1f')]();};}function saveUpdates(_0x216a76,_0x18eb0b){return function(_0x3236b5){if(_0x3236b5){return _0x3236b5[_0x8943('0x20')](_0x216a76)[_0x8943('0x21')](function(_0x371409){return _0x371409;});}return null;};}function removeEntity(_0x59aada,_0x15ef77){return function(_0x34b29c){if(_0x34b29c){return _0x34b29c['destroy']()['then'](function(){_0x59aada[_0x8943('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5f90,_0x48ac8f){return function(_0x164d67){if(!_0x164d67){_0x2f5f90[_0x8943('0x15')](0x194);}return _0x164d67;};}function handleError(_0x1ed91d,_0x254307){_0x254307=_0x254307||0x1f4;return function(_0x4563ad){logger['error'](_0x4563ad[_0x8943('0x22')]);if(_0x4563ad[_0x8943('0x23')]){delete _0x4563ad[_0x8943('0x23')];}_0x1ed91d['status'](_0x254307)[_0x8943('0x24')](_0x4563ad);};}exports[_0x8943('0x25')]=function(_0x39cc9e,_0x184496){var _0x4b34f5={},_0x3915f7={},_0x282418={'count':0x0,'rows':[]};var _0x5d1850=_[_0x8943('0x26')](db[_0x8943('0x27')][_0x8943('0x28')],function(_0x290deb){return{'name':_0x290deb[_0x8943('0x29')],'type':_0x290deb[_0x8943('0x2a')][_0x8943('0x2b')]};});_0x3915f7[_0x8943('0x2c')]=_[_0x8943('0x26')](_0x5d1850,_0x8943('0x23'));_0x3915f7[_0x8943('0x2d')]=_['keys'](_0x39cc9e[_0x8943('0x2d')]);_0x3915f7[_0x8943('0x2e')]=_[_0x8943('0x2f')](_0x3915f7[_0x8943('0x2c')],_0x3915f7['query']);_0x4b34f5['attributes']=_[_0x8943('0x2f')](_0x3915f7[_0x8943('0x2c')],qs['fields'](_0x39cc9e[_0x8943('0x2d')][_0x8943('0x30')]));_0x4b34f5[_0x8943('0x31')]=_0x4b34f5[_0x8943('0x31')][_0x8943('0x32')]?_0x4b34f5[_0x8943('0x31')]:_0x3915f7[_0x8943('0x2c')];if(!_0x39cc9e[_0x8943('0x2d')]['hasOwnProperty'](_0x8943('0x33'))){_0x4b34f5[_0x8943('0x1b')]=qs[_0x8943('0x1b')](_0x39cc9e[_0x8943('0x2d')]['limit']);_0x4b34f5[_0x8943('0x19')]=qs['offset'](_0x39cc9e[_0x8943('0x2d')][_0x8943('0x19')]);}_0x4b34f5[_0x8943('0x34')]=qs['sort'](_0x39cc9e[_0x8943('0x2d')]['sort']);_0x4b34f5[_0x8943('0x35')]=qs[_0x8943('0x2e')](_[_0x8943('0x36')](_0x39cc9e[_0x8943('0x2d')],_0x3915f7[_0x8943('0x2e')]),_0x5d1850);if(_0x39cc9e[_0x8943('0x2d')]['filter']){_0x4b34f5[_0x8943('0x35')]=_[_0x8943('0x37')](_0x4b34f5[_0x8943('0x35')],{'$or':_[_0x8943('0x26')](_0x5d1850,function(_0x4011ec){if(_0x4011ec[_0x8943('0x2a')]!=='VIRTUAL'){var _0x3db658={};_0x3db658[_0x4011ec[_0x8943('0x23')]]={'$like':'%'+_0x39cc9e[_0x8943('0x2d')][_0x8943('0x38')]+'%'};return _0x3db658;}})});}_0x4b34f5=_[_0x8943('0x37')]({},_0x4b34f5,_0x39cc9e['options']);var _0x552a78={'where':_0x4b34f5['where']};return db['OpenchannelApplication']['count'](_0x552a78)[_0x8943('0x21')](function(_0xaa5082){_0x282418[_0x8943('0x1c')]=_0xaa5082;if(_0x39cc9e[_0x8943('0x2d')]['includeAll']){_0x4b34f5['include']=[{'all':!![]}];}return db[_0x8943('0x27')][_0x8943('0x39')](_0x4b34f5);})[_0x8943('0x21')](function(_0x213562){_0x282418['rows']=_0x213562;return _0x282418;})['then'](respondWithFilteredResult(_0x184496,_0x4b34f5))[_0x8943('0x3a')](handleError(_0x184496,null));};exports[_0x8943('0x3b')]=function(_0xcfc5f7,_0x44f58b){var _0xd0a830={'raw':!![],'where':{'id':_0xcfc5f7['params']['id']}},_0x5ab011={};_0x5ab011[_0x8943('0x2c')]=_['keys'](db[_0x8943('0x27')][_0x8943('0x28')]);_0x5ab011[_0x8943('0x2d')]=_[_0x8943('0x3c')](_0xcfc5f7['query']);_0x5ab011[_0x8943('0x2e')]=_['intersection'](_0x5ab011[_0x8943('0x2c')],_0x5ab011[_0x8943('0x2d')]);_0xd0a830[_0x8943('0x31')]=_[_0x8943('0x2f')](_0x5ab011[_0x8943('0x2c')],qs[_0x8943('0x30')](_0xcfc5f7[_0x8943('0x2d')]['fields']));_0xd0a830[_0x8943('0x31')]=_0xd0a830['attributes'][_0x8943('0x32')]?_0xd0a830[_0x8943('0x31')]:_0x5ab011[_0x8943('0x2c')];if(_0xcfc5f7[_0x8943('0x2d')]['includeAll']){_0xd0a830[_0x8943('0x3d')]=[{'all':!![]}];}_0xd0a830=_['merge']({},_0xd0a830,_0xcfc5f7[_0x8943('0x3e')]);return db[_0x8943('0x27')][_0x8943('0x3f')](_0xd0a830)[_0x8943('0x21')](handleEntityNotFound(_0x44f58b,null))[_0x8943('0x21')](respondWithResult(_0x44f58b,null))[_0x8943('0x3a')](handleError(_0x44f58b,null));};exports[_0x8943('0x40')]=function(_0x3591b7,_0x511a6a){return db['OpenchannelApplication'][_0x8943('0x40')](_0x3591b7['body'],{})[_0x8943('0x21')](respondWithResult(_0x511a6a,0xc9))[_0x8943('0x3a')](handleError(_0x511a6a,null));};exports[_0x8943('0x20')]=function(_0x395289,_0xb3b106){if(_0x395289[_0x8943('0x41')]['id']){delete _0x395289[_0x8943('0x41')]['id'];}return db[_0x8943('0x27')][_0x8943('0x3f')]({'where':{'id':_0x395289[_0x8943('0x42')]['id']}})[_0x8943('0x21')](handleEntityNotFound(_0xb3b106,null))[_0x8943('0x21')](saveUpdates(_0x395289[_0x8943('0x41')],null))[_0x8943('0x21')](respondWithResult(_0xb3b106,null))[_0x8943('0x3a')](handleError(_0xb3b106,null));};exports[_0x8943('0x43')]=function(_0x4f6c12,_0x4ed22d){return db[_0x8943('0x27')][_0x8943('0x3f')]({'where':{'id':_0x4f6c12['params']['id']}})[_0x8943('0x21')](handleEntityNotFound(_0x4ed22d,null))[_0x8943('0x21')](removeEntity(_0x4ed22d,null))[_0x8943('0x3a')](handleError(_0x4ed22d,null));}; \ No newline at end of file +var _0x3e16=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','catch','create','update','body','eml-format','rimraf','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x44178b,_0x16e647){var _0x32dc2a=function(_0x3cbf2d){while(--_0x3cbf2d){_0x44178b['push'](_0x44178b['shift']());}};_0x32dc2a(++_0x16e647);}(_0x3e16,0xab));var _0x63e1=function(_0x53281d,_0x28a2c3){_0x53281d=_0x53281d-0x0;var _0x1ee558=_0x3e16[_0x53281d];return _0x1ee558;};'use strict';var emlformat=require(_0x63e1('0x0'));var rimraf=require(_0x63e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x63e1('0x2'));var moment=require(_0x63e1('0x3'));var BPromise=require(_0x63e1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x63e1('0x5'));var ejs=require(_0x63e1('0x6'));var fs=require('fs');var fs_extra=require(_0x63e1('0x7'));var _=require(_0x63e1('0x8'));var squel=require(_0x63e1('0x9'));var crypto=require(_0x63e1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x63e1('0xb'));var toCsv=require(_0x63e1('0x5'));var querystring=require(_0x63e1('0xc'));var Papa=require(_0x63e1('0xd'));var Redis=require(_0x63e1('0xe'));var authService=require(_0x63e1('0xf'));var qs=require(_0x63e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63e1('0x11'));var logger=require('../../config/logger')(_0x63e1('0x12'));var utils=require(_0x63e1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x63e1('0x14'));var db=require(_0x63e1('0x15'))['db'];function respondWithStatusCode(_0x1694c8,_0x1bfb14){_0x1bfb14=_0x1bfb14||0xcc;return function(_0x3dcc76){if(_0x3dcc76){return _0x1694c8[_0x63e1('0x16')](_0x1bfb14);}return _0x1694c8[_0x63e1('0x17')](_0x1bfb14)[_0x63e1('0x18')]();};}function respondWithResult(_0x27a9cd,_0x46e21e){_0x46e21e=_0x46e21e||0xc8;return function(_0x37053c){if(_0x37053c){return _0x27a9cd[_0x63e1('0x17')](_0x46e21e)[_0x63e1('0x19')](_0x37053c);}};}function respondWithFilteredResult(_0x5ce1a9,_0x38fb5e){return function(_0x2da8bf){if(_0x2da8bf){var _0x3ca119=typeof _0x38fb5e[_0x63e1('0x1a')]==='undefined'&&typeof _0x38fb5e[_0x63e1('0x1b')]===_0x63e1('0x1c');var _0x423a74=_0x2da8bf[_0x63e1('0x1d')];var _0x6f7774=_0x3ca119?0x0:_0x38fb5e['offset'];var _0x399923=_0x3ca119?_0x2da8bf['count']:_0x38fb5e[_0x63e1('0x1a')]+_0x38fb5e[_0x63e1('0x1b')];var _0x3c6bd7;if(_0x399923>=_0x423a74){_0x399923=_0x423a74;_0x3c6bd7=0xc8;}else{_0x3c6bd7=0xce;}_0x5ce1a9['status'](_0x3c6bd7);return _0x5ce1a9['set'](_0x63e1('0x1e'),_0x6f7774+'-'+_0x399923+'/'+_0x423a74)['json'](_0x2da8bf);}return null;};}function patchUpdates(_0x5b5719){return function(_0x5b523c){try{jsonpatch[_0x63e1('0x1f')](_0x5b523c,_0x5b5719,!![]);}catch(_0x12a482){return BPromise[_0x63e1('0x20')](_0x12a482);}return _0x5b523c['save']();};}function saveUpdates(_0x6238a6,_0x5d59c3){return function(_0x5a9bc5){if(_0x5a9bc5){return _0x5a9bc5['update'](_0x6238a6)[_0x63e1('0x21')](function(_0x4db04c){return _0x4db04c;});}return null;};}function removeEntity(_0x52cf60,_0x4e1550){return function(_0x2f6d6d){if(_0x2f6d6d){return _0x2f6d6d[_0x63e1('0x22')]()[_0x63e1('0x21')](function(){_0x52cf60[_0x63e1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33a75a,_0x524871){return function(_0x420e6b){if(!_0x420e6b){_0x33a75a[_0x63e1('0x16')](0x194);}return _0x420e6b;};}function handleError(_0x231c3b,_0x59257c){_0x59257c=_0x59257c||0x1f4;return function(_0x34f02f){logger[_0x63e1('0x23')](_0x34f02f[_0x63e1('0x24')]);if(_0x34f02f[_0x63e1('0x25')]){delete _0x34f02f[_0x63e1('0x25')];}_0x231c3b['status'](_0x59257c)[_0x63e1('0x26')](_0x34f02f);};}exports['index']=function(_0x55b3e4,_0x4a5340){var _0x1bf1fb={},_0x1e1fdd={},_0x5c8d0b={'count':0x0,'rows':[]};var _0x32e3b2=_[_0x63e1('0x27')](db[_0x63e1('0x28')][_0x63e1('0x29')],function(_0x1f6315){return{'name':_0x1f6315[_0x63e1('0x2a')],'type':_0x1f6315[_0x63e1('0x2b')][_0x63e1('0x2c')]};});_0x1e1fdd[_0x63e1('0x2d')]=_[_0x63e1('0x27')](_0x32e3b2,_0x63e1('0x25'));_0x1e1fdd[_0x63e1('0x2e')]=_[_0x63e1('0x2f')](_0x55b3e4[_0x63e1('0x2e')]);_0x1e1fdd[_0x63e1('0x30')]=_[_0x63e1('0x31')](_0x1e1fdd['model'],_0x1e1fdd[_0x63e1('0x2e')]);_0x1bf1fb[_0x63e1('0x32')]=_[_0x63e1('0x31')](_0x1e1fdd[_0x63e1('0x2d')],qs['fields'](_0x55b3e4[_0x63e1('0x2e')]['fields']));_0x1bf1fb['attributes']=_0x1bf1fb[_0x63e1('0x32')][_0x63e1('0x33')]?_0x1bf1fb[_0x63e1('0x32')]:_0x1e1fdd[_0x63e1('0x2d')];if(!_0x55b3e4['query'][_0x63e1('0x34')](_0x63e1('0x35'))){_0x1bf1fb[_0x63e1('0x1b')]=qs[_0x63e1('0x1b')](_0x55b3e4[_0x63e1('0x2e')][_0x63e1('0x1b')]);_0x1bf1fb[_0x63e1('0x1a')]=qs[_0x63e1('0x1a')](_0x55b3e4[_0x63e1('0x2e')]['offset']);}_0x1bf1fb[_0x63e1('0x36')]=qs['sort'](_0x55b3e4['query'][_0x63e1('0x37')]);_0x1bf1fb[_0x63e1('0x38')]=qs['filters'](_[_0x63e1('0x39')](_0x55b3e4[_0x63e1('0x2e')],_0x1e1fdd[_0x63e1('0x30')]),_0x32e3b2);if(_0x55b3e4['query'][_0x63e1('0x3a')]){_0x1bf1fb[_0x63e1('0x38')]=_[_0x63e1('0x3b')](_0x1bf1fb[_0x63e1('0x38')],{'$or':_[_0x63e1('0x27')](_0x32e3b2,function(_0x187098){if(_0x187098[_0x63e1('0x2b')]!==_0x63e1('0x3c')){var _0x3f8eea={};_0x3f8eea[_0x187098[_0x63e1('0x25')]]={'$like':'%'+_0x55b3e4[_0x63e1('0x2e')]['filter']+'%'};return _0x3f8eea;}})});}_0x1bf1fb=_[_0x63e1('0x3b')]({},_0x1bf1fb,_0x55b3e4[_0x63e1('0x3d')]);var _0x5292c5={'where':_0x1bf1fb[_0x63e1('0x38')]};return db['OpenchannelApplication']['count'](_0x5292c5)['then'](function(_0x37a1e0){_0x5c8d0b[_0x63e1('0x1d')]=_0x37a1e0;if(_0x55b3e4[_0x63e1('0x2e')][_0x63e1('0x3e')]){_0x1bf1fb['include']=[{'all':!![]}];}return db[_0x63e1('0x28')][_0x63e1('0x3f')](_0x1bf1fb);})['then'](function(_0x2bc9b3){_0x5c8d0b[_0x63e1('0x40')]=_0x2bc9b3;return _0x5c8d0b;})[_0x63e1('0x21')](respondWithFilteredResult(_0x4a5340,_0x1bf1fb))['catch'](handleError(_0x4a5340,null));};exports[_0x63e1('0x41')]=function(_0x4644a7,_0x1e5f84){var _0x18d534={'raw':!![],'where':{'id':_0x4644a7[_0x63e1('0x42')]['id']}},_0x542efe={};_0x542efe[_0x63e1('0x2d')]=_[_0x63e1('0x2f')](db['OpenchannelApplication'][_0x63e1('0x29')]);_0x542efe[_0x63e1('0x2e')]=_[_0x63e1('0x2f')](_0x4644a7[_0x63e1('0x2e')]);_0x542efe['filters']=_[_0x63e1('0x31')](_0x542efe[_0x63e1('0x2d')],_0x542efe[_0x63e1('0x2e')]);_0x18d534['attributes']=_[_0x63e1('0x31')](_0x542efe[_0x63e1('0x2d')],qs[_0x63e1('0x43')](_0x4644a7['query'][_0x63e1('0x43')]));_0x18d534[_0x63e1('0x32')]=_0x18d534[_0x63e1('0x32')][_0x63e1('0x33')]?_0x18d534[_0x63e1('0x32')]:_0x542efe['model'];if(_0x4644a7[_0x63e1('0x2e')][_0x63e1('0x3e')]){_0x18d534[_0x63e1('0x44')]=[{'all':!![]}];}_0x18d534=_['merge']({},_0x18d534,_0x4644a7[_0x63e1('0x3d')]);return db['OpenchannelApplication'][_0x63e1('0x45')](_0x18d534)[_0x63e1('0x21')](handleEntityNotFound(_0x1e5f84,null))[_0x63e1('0x21')](respondWithResult(_0x1e5f84,null))[_0x63e1('0x46')](handleError(_0x1e5f84,null));};exports[_0x63e1('0x47')]=function(_0xf3f943,_0x198ed0){return db[_0x63e1('0x28')][_0x63e1('0x47')](_0xf3f943['body'],{})['then'](respondWithResult(_0x198ed0,0xc9))['catch'](handleError(_0x198ed0,null));};exports[_0x63e1('0x48')]=function(_0x51763a,_0x180238){if(_0x51763a[_0x63e1('0x49')]['id']){delete _0x51763a['body']['id'];}return db[_0x63e1('0x28')][_0x63e1('0x45')]({'where':{'id':_0x51763a[_0x63e1('0x42')]['id']}})[_0x63e1('0x21')](handleEntityNotFound(_0x180238,null))[_0x63e1('0x21')](saveUpdates(_0x51763a['body'],null))['then'](respondWithResult(_0x180238,null))[_0x63e1('0x46')](handleError(_0x180238,null));};exports[_0x63e1('0x22')]=function(_0x3273f9,_0x258fe5){return db['OpenchannelApplication'][_0x63e1('0x45')]({'where':{'id':_0x3273f9[_0x63e1('0x42')]['id']}})['then'](handleEntityNotFound(_0x258fe5,null))['then'](removeEntity(_0x258fe5,null))[_0x63e1('0x46')](handleError(_0x258fe5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d779a72..553b0d6 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x470b=['define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','../../config/environment','exports'];(function(_0x4e202d,_0x221567){var _0x24c04f=function(_0x19727f){while(--_0x19727f){_0x4e202d['push'](_0x4e202d['shift']());}};_0x24c04f(++_0x221567);}(_0x470b,0x93));var _0xb470=function(_0x98a1f2,_0x75360f){_0x98a1f2=_0x98a1f2-0x0;var _0x2cfc98=_0x470b[_0x98a1f2];return _0x2cfc98;};'use strict';var _=require(_0xb470('0x0'));var util=require(_0xb470('0x1'));var logger=require('../../config/logger')(_0xb470('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb470('0x3'));var fs=require('fs');var path=require(_0xb470('0x4'));var rimraf=require('rimraf');var config=require(_0xb470('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0xb470('0x6')]=function(_0x576f25,_0x3c5665){return _0x576f25[_0xb470('0x7')](_0xb470('0x8'),attributes,{'tableName':_0xb470('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb470('0xa')});}; \ No newline at end of file +var _0x0216=['rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1aa51d,_0x25e458){var _0x55ba13=function(_0x5939a8){while(--_0x5939a8){_0x1aa51d['push'](_0x1aa51d['shift']());}};_0x55ba13(++_0x25e458);}(_0x0216,0x165));var _0x6021=function(_0x282de7,_0x3b688d){_0x282de7=_0x282de7-0x0;var _0x46ad7a=_0x0216[_0x282de7];return _0x46ad7a;};'use strict';var _=require(_0x6021('0x0'));var util=require(_0x6021('0x1'));var logger=require(_0x6021('0x2'))(_0x6021('0x3'));var moment=require(_0x6021('0x4'));var BPromise=require(_0x6021('0x5'));var rp=require(_0x6021('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6021('0x7'));var config=require('../../config/environment');var attributes=require(_0x6021('0x8'));module['exports']=function(_0x5b4bdd,_0x5d429b){return _0x5b4bdd[_0x6021('0x9')](_0x6021('0xa'),attributes,{'tableName':_0x6021('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6021('0xc'),'collate':_0x6021('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index ce43dd3..9dcaa34 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0673=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','OpenchannelApplication,\x20%s,\x20%s','debug'];(function(_0x342672,_0x1a07a5){var _0x298483=function(_0x34b164){while(--_0x34b164){_0x342672['push'](_0x342672['shift']());}};_0x298483(++_0x1a07a5);}(_0x0673,0x75));var _0x3067=function(_0x46a42e,_0x2f5779){_0x46a42e=_0x46a42e-0x0;var _0x2a323f=_0x0673[_0x46a42e];return _0x2a323f;};'use strict';var _=require(_0x3067('0x0'));var util=require(_0x3067('0x1'));var moment=require('moment');var BPromise=require(_0x3067('0x2'));var rs=require(_0x3067('0x3'));var fs=require('fs');var Redis=require(_0x3067('0x4'));var db=require(_0x3067('0x5'))['db'];var utils=require(_0x3067('0x6'));var logger=require(_0x3067('0x7'))(_0x3067('0x8'));var config=require(_0x3067('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3067('0xa')][_0x3067('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58f653,_0x4cd1e0,_0x11957d){return new BPromise(function(_0x1b895e,_0x27a798){return client['request'](_0x58f653,_0x11957d)[_0x3067('0xc')](function(_0x4fcb6a){logger['info'](_0x3067('0xd'),_0x4cd1e0,'request\x20sent');logger[_0x3067('0xe')](_0x3067('0xf'),_0x4cd1e0,_0x3067('0x10'),JSON[_0x3067('0x11')](_0x4fcb6a));if(_0x4fcb6a[_0x3067('0x12')]){if(_0x4fcb6a['error'][_0x3067('0x13')]===0x1f4){logger[_0x3067('0x12')](_0x3067('0xd'),_0x4cd1e0,_0x4fcb6a[_0x3067('0x12')][_0x3067('0x14')]);return _0x27a798(_0x4fcb6a[_0x3067('0x12')]['message']);}logger[_0x3067('0x12')](_0x3067('0xd'),_0x4cd1e0,_0x4fcb6a[_0x3067('0x12')][_0x3067('0x14')]);return _0x1b895e(_0x4fcb6a[_0x3067('0x12')][_0x3067('0x14')]);}else{logger[_0x3067('0x15')](_0x3067('0xd'),_0x4cd1e0,_0x3067('0x10'));_0x1b895e(_0x4fcb6a[_0x3067('0x16')][_0x3067('0x14')]);}})['catch'](function(_0x321f9c){logger[_0x3067('0x12')](_0x3067('0xd'),_0x4cd1e0,_0x321f9c);_0x27a798(_0x321f9c);});});}exports[_0x3067('0x17')]=function(_0x359722){var _0x11c4f1=this;return new Promise(function(_0xa05eb1,_0x4bf4ec){return db[_0x3067('0x18')][_0x3067('0x19')](_0x359722[_0x3067('0x1a')],{'raw':_0x359722[_0x3067('0x1b')]?_0x359722[_0x3067('0x1b')][_0x3067('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x359722[_0x3067('0x1b')]?_0x359722['options'][_0x3067('0x1d')]||null:null,'attributes':_0x359722[_0x3067('0x1b')]?_0x359722[_0x3067('0x1b')][_0x3067('0x1e')]||null:null,'limit':_0x359722[_0x3067('0x1b')]?_0x359722[_0x3067('0x1b')][_0x3067('0x1f')]||null:null})[_0x3067('0xc')](function(_0x89c6a6){logger[_0x3067('0x15')](_0x3067('0x17'),_0x359722);logger['debug']('UpdateOpenchannelApplication',_0x359722,JSON[_0x3067('0x11')](_0x89c6a6));_0xa05eb1(_0x89c6a6);})[_0x3067('0x20')](function(_0x267df3){logger[_0x3067('0x12')](_0x3067('0x17'),_0x267df3['message'],_0x359722);_0x4bf4ec(_0x11c4f1[_0x3067('0x12')](0x1f4,_0x267df3[_0x3067('0x14')]));});});}; \ No newline at end of file +var _0x0c7e=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelApplication','update','options','raw','where','attributes','limit','UpdateOpenchannelApplication','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x0c7e,0x1c2));var _0xe0c7=function(_0x58893a,_0x51f966){_0x58893a=_0x58893a-0x0;var _0x936f20=_0x0c7e[_0x58893a];return _0x936f20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe0c7('0x0'));var BPromise=require('bluebird');var rs=require(_0xe0c7('0x1'));var fs=require('fs');var Redis=require(_0xe0c7('0x2'));var db=require(_0xe0c7('0x3'))['db'];var utils=require(_0xe0c7('0x4'));var logger=require(_0xe0c7('0x5'))(_0xe0c7('0x6'));var config=require(_0xe0c7('0x7'));var jayson=require(_0xe0c7('0x8'));var client=jayson[_0xe0c7('0x9')][_0xe0c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd55206,_0x324492,_0x3e578b){return new BPromise(function(_0x5a5b31,_0x5bd630){return client[_0xe0c7('0xb')](_0xd55206,_0x3e578b)[_0xe0c7('0xc')](function(_0x5dc754){logger[_0xe0c7('0xd')](_0xe0c7('0xe'),_0x324492,_0xe0c7('0xf'));logger[_0xe0c7('0x10')](_0xe0c7('0x11'),_0x324492,_0xe0c7('0xf'),JSON[_0xe0c7('0x12')](_0x5dc754));if(_0x5dc754[_0xe0c7('0x13')]){if(_0x5dc754['error']['code']===0x1f4){logger[_0xe0c7('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x324492,_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);return _0x5bd630(_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);}logger[_0xe0c7('0x13')](_0xe0c7('0xe'),_0x324492,_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);return _0x5a5b31(_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);}else{logger[_0xe0c7('0xd')](_0xe0c7('0xe'),_0x324492,'request\x20sent');_0x5a5b31(_0x5dc754[_0xe0c7('0x15')][_0xe0c7('0x14')]);}})[_0xe0c7('0x16')](function(_0x688ed1){logger['error'](_0xe0c7('0xe'),_0x324492,_0x688ed1);_0x5bd630(_0x688ed1);});});}exports['UpdateOpenchannelApplication']=function(_0x3d08ea){var _0x4bddea=this;return new Promise(function(_0xdd89ac,_0x482cd9){return db[_0xe0c7('0x17')][_0xe0c7('0x18')](_0x3d08ea['body'],{'raw':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea[_0xe0c7('0x19')][_0xe0c7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea[_0xe0c7('0x19')][_0xe0c7('0x1b')]||null:null,'attributes':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea[_0xe0c7('0x19')][_0xe0c7('0x1c')]||null:null,'limit':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea['options'][_0xe0c7('0x1d')]||null:null})[_0xe0c7('0xc')](function(_0x1870ea){logger[_0xe0c7('0xd')]('UpdateOpenchannelApplication',_0x3d08ea);logger[_0xe0c7('0x10')](_0xe0c7('0x1e'),_0x3d08ea,JSON['stringify'](_0x1870ea));_0xdd89ac(_0x1870ea);})[_0xe0c7('0x16')](function(_0x43b7c2){logger[_0xe0c7('0x13')](_0xe0c7('0x1e'),_0x43b7c2['message'],_0x3d08ea);_0x482cd9(_0x4bddea['error'](0x1f4,_0x43b7c2['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e7d98d4..09b696f 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffd6=['addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','destroy','removeTags','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/:id','/:id/messages','post'];(function(_0x36eb43,_0x1a5b45){var _0x284448=function(_0x4b25d1){while(--_0x4b25d1){_0x36eb43['push'](_0x36eb43['shift']());}};_0x284448(++_0x1a5b45);}(_0xffd6,0x19b));var _0x6ffd=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xffd6[_0x12b683];return _0xfb150b;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require(_0x6ffd('0x3'));var express=require('express');var router=express[_0x6ffd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6ffd('0x5'));var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xa')]);router['get']('/describe',auth[_0x6ffd('0x9')](),controller['describe']);router[_0x6ffd('0x8')](_0x6ffd('0xb'),auth[_0x6ffd('0x9')](),controller['show']);router[_0x6ffd('0x8')](_0x6ffd('0xc'),auth[_0x6ffd('0x9')](),controller['getMessages']);router[_0x6ffd('0x8')]('/:id/download',auth[_0x6ffd('0x9')](),controller['download']);router[_0x6ffd('0xd')]('/',auth[_0x6ffd('0x9')](),controller['create']);router['post'](_0x6ffd('0xc'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router['post'](_0x6ffd('0xf'),auth['isAuthenticated'](),interaction[_0x6ffd('0x10')](_0x6ffd('0x11'),_0x6ffd('0x12')),controller['addTags']);router[_0x6ffd('0x13')](_0x6ffd('0xb'),auth[_0x6ffd('0x9')](),interaction[_0x6ffd('0x10')](_0x6ffd('0x11'),_0x6ffd('0x14')),controller[_0x6ffd('0x15')]);router[_0x6ffd('0x16')](_0x6ffd('0xb'),auth[_0x6ffd('0x9')](),interaction[_0x6ffd('0x10')](_0x6ffd('0x11'),'openchannelinteraction:destroy'),controller[_0x6ffd('0x17')]);router['delete'](_0x6ffd('0xf'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x18')]);module['exports']=router; \ No newline at end of file +var _0x01f4=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','show','getMessages','/:id/download','download','create','/:id/messages','addMessage','post','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','tracked','openchannelinteraction:destroy','delete','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e00fa,_0x178628){var _0x252563=function(_0x5e9267){while(--_0x5e9267){_0x5e00fa['push'](_0x5e00fa['shift']());}};_0x252563(++_0x178628);}(_0x01f4,0x165));var _0x401f=function(_0x278636,_0x5d305f){_0x278636=_0x278636-0x0;var _0x20e87e=_0x01f4[_0x278636];return _0x20e87e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x401f('0x0'));var timeout=require(_0x401f('0x1'));var express=require(_0x401f('0x2'));var router=express[_0x401f('0x3')]();var fs_extra=require(_0x401f('0x4'));var auth=require(_0x401f('0x5'));var interaction=require(_0x401f('0x6'));var config=require(_0x401f('0x7'));var controller=require(_0x401f('0x8'));router[_0x401f('0x9')]('/',auth['isAuthenticated'](),controller[_0x401f('0xa')]);router[_0x401f('0x9')](_0x401f('0xb'),auth[_0x401f('0xc')](),controller[_0x401f('0xd')]);router['get']('/:id',auth[_0x401f('0xc')](),controller[_0x401f('0xe')]);router[_0x401f('0x9')]('/:id/messages',auth[_0x401f('0xc')](),controller[_0x401f('0xf')]);router[_0x401f('0x9')](_0x401f('0x10'),auth['isAuthenticated'](),controller[_0x401f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x401f('0x12')]);router['post'](_0x401f('0x13'),auth[_0x401f('0xc')](),controller[_0x401f('0x14')]);router[_0x401f('0x15')](_0x401f('0x16'),auth[_0x401f('0xc')](),interaction['tracked'](_0x401f('0x17'),_0x401f('0x18')),controller[_0x401f('0x19')]);router['put'](_0x401f('0x1a'),auth[_0x401f('0xc')](),interaction['tracked'](_0x401f('0x17'),_0x401f('0x1b')),controller[_0x401f('0x1c')]);router['delete'](_0x401f('0x1a'),auth[_0x401f('0xc')](),interaction[_0x401f('0x1d')](_0x401f('0x17'),_0x401f('0x1e')),controller['destroy']);router[_0x401f('0x1f')]('/:id/tags',auth[_0x401f('0xc')](),controller[_0x401f('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index d66f9f8..752e7cc 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d5b=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x289187,_0x5b6795){var _0x5c4db4=function(_0x1e4618){while(--_0x1e4618){_0x289187['push'](_0x289187['shift']());}};_0x5c4db4(++_0x5b6795);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x553157,_0x1a14f2){_0x553157=_0x553157-0x0;var _0x2064e4=_0x1d5b[_0x553157];return _0x2064e4;};'use strict';var Sequelize=require(_0xb1d5('0x0'));module[_0xb1d5('0x1')]={'closed':{'type':Sequelize[_0xb1d5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb1d5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb1d5('0x3')]},'note':{'type':Sequelize[_0xb1d5('0x3')]},'read1stAt':{'type':Sequelize[_0xb1d5('0x4')]},'threadId':{'type':Sequelize[_0xb1d5('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb1d5('0x5')]('in',_0xb1d5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xb1d5('0x5')]('in',_0xb1d5('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb1d5('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xb1d5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf675=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0xf675,0x199));var _0x5f67=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xf675[_0x564e9f];return _0x3a9f3e;};'use strict';var Sequelize=require(_0x5f67('0x0'));module[_0x5f67('0x1')]={'closed':{'type':Sequelize[_0x5f67('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5f67('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5f67('0x3')]},'note':{'type':Sequelize[_0x5f67('0x3')]},'read1stAt':{'type':Sequelize[_0x5f67('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x5f67('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5f67('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5f67('0x5')]('in',_0x5f67('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5f67('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5f67('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 5e603fc..bef971a 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x112e=['include','merge','find','create','body','describe','OpenchannelMessage','addMessage','ids','getMessages','findOne','nolimit','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','join','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','get','mkdirSync','Openchannel','Account','Owner','N.A.','closed','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','firstName','value','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelInteraction','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','params','keys','rawAttributes','filters','intersection','model','fields','attributes','length','includeAll'];(function(_0x561f36,_0x164a8b){var _0x526261=function(_0xe858db){while(--_0xe858db){_0x561f36['push'](_0x561f36['shift']());}};_0x526261(++_0x164a8b);}(_0x112e,0xca));var _0xe112=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x112e[_0x19b84f];return _0x18067b;};'use strict';var rimraf=require(_0xe112('0x0'));var zipdir=require(_0xe112('0x1'));var moment=require(_0xe112('0x2'));var util=require(_0xe112('0x3'));var path=require(_0xe112('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe112('0x5'));var Redis=require(_0xe112('0x6'));var interaction=require(_0xe112('0x7'));var qs=require(_0xe112('0x8'));var pdf=require(_0xe112('0x9'));var logger=require(_0xe112('0xa'))(_0xe112('0xb'));var config=require(_0xe112('0xc'));var db=require(_0xe112('0xd'))['db'];config[_0xe112('0xe')]=_[_0xe112('0xf')](config['redis'],{'host':_0xe112('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe112('0xe')]));require(_0xe112('0x11'))['register'](socket);function respondWithStatusCode(_0x40eda4,_0x50a794){_0x50a794=_0x50a794||0xcc;return function(_0x770fe7){if(_0x770fe7){return _0x40eda4[_0xe112('0x12')](_0x50a794);}return _0x40eda4[_0xe112('0x13')](_0x50a794)['end']();};}function respondWithResult(_0x369bb3,_0x2e1ed7){_0x2e1ed7=_0x2e1ed7||0xc8;return function(_0x16cf1a){if(_0x16cf1a){return _0x369bb3[_0xe112('0x13')](_0x2e1ed7)[_0xe112('0x14')](_0x16cf1a);}};}function respondWithFilteredResult(_0x3af760,_0x1701c9){return function(_0x25a235){if(_0x25a235){var _0x55638f=typeof _0x1701c9[_0xe112('0x15')]===_0xe112('0x16')&&typeof _0x1701c9['limit']===_0xe112('0x16');var _0x2270bd=_0x25a235[_0xe112('0x17')];var _0x4d437a=_0x55638f?0x0:_0x1701c9['offset'];var _0x5322fa=_0x55638f?_0x25a235[_0xe112('0x17')]:_0x1701c9[_0xe112('0x15')]+_0x1701c9[_0xe112('0x18')];var _0x35b5e4;if(_0x5322fa>=_0x2270bd){_0x5322fa=_0x2270bd;_0x35b5e4=0xc8;}else{_0x35b5e4=0xce;}_0x3af760[_0xe112('0x13')](_0x35b5e4);return _0x3af760[_0xe112('0x19')](_0xe112('0x1a'),_0x4d437a+'-'+_0x5322fa+'/'+_0x2270bd)[_0xe112('0x14')](_0x25a235);}return null;};}function saveUpdates(_0x43c354){return function(_0x47ff0e){if(_0x47ff0e){return _0x47ff0e[_0xe112('0x1b')](_0x43c354)[_0xe112('0x1c')](function(_0x286bb5){return _0x286bb5;});}return null;};}function removeEntity(_0x59b6a3){return function(_0x49408f){if(_0x49408f){return _0x49408f[_0xe112('0x1d')]()['then'](function(){_0x59b6a3['status'](0xcc)[_0xe112('0x1e')]();});}};}function handleEntityNotFound(_0x4ffcc7){return function(_0x2a845c){if(!_0x2a845c){_0x4ffcc7[_0xe112('0x12')](0x194);}return _0x2a845c;};}function handleError(_0x430316,_0xff1907){_0xff1907=_0xff1907||0x1f4;return function(_0x8cd7a9){logger[_0xe112('0x1f')](_0x8cd7a9[_0xe112('0x20')]);if(_0x8cd7a9[_0xe112('0x21')]){delete _0x8cd7a9[_0xe112('0x21')];}_0x430316[_0xe112('0x13')](_0xff1907)[_0xe112('0x22')](_0x8cd7a9);};}exports[_0xe112('0x23')]=function(_0x19e28a,_0x5a4bd9){var _0x4d7e9a={};var _0x2d5ca4=_[_0xe112('0x24')](db[_0xe112('0x25')]['rawAttributes'],function(_0x365241){return{'name':_0x365241[_0xe112('0x26')],'type':_0x365241[_0xe112('0x27')][_0xe112('0x28')]};});_0x4d7e9a=qs[_0xe112('0x29')](_0x2d5ca4,_0x19e28a);return interaction[_0xe112('0x2a')](_0xe112('0x2b'),_0x19e28a[_0xe112('0x2c')],_0x19e28a[_0xe112('0x2d')],_0x4d7e9a,_0x2d5ca4)[_0xe112('0x1c')](respondWithFilteredResult(_0x5a4bd9,_0x4d7e9a))[_0xe112('0x2e')](handleError(_0x5a4bd9,null));};exports[_0xe112('0x2f')]=function(_0x5c981d,_0x4cdcd8){var _0x5894c5={};if(_0x5c981d['query']['type']&&_0x5c981d['query'][_0xe112('0x27')]==='from'){_0x5894c5['from']=_0x5c981d[_0xe112('0x30')]['id'];}else{_0x5894c5['id']=_0x5c981d['params']['id'];}var _0x188653={'raw':![],'where':_0x5894c5},_0x18e067={};_0x18e067['model']=_[_0xe112('0x31')](db[_0xe112('0x25')][_0xe112('0x32')]);_0x18e067[_0xe112('0x2c')]=_['keys'](_0x5c981d[_0xe112('0x2c')]);_0x18e067[_0xe112('0x33')]=_[_0xe112('0x34')](_0x18e067[_0xe112('0x35')],_0x18e067[_0xe112('0x2c')]);_0x188653['attributes']=_['intersection'](_0x18e067[_0xe112('0x35')],qs[_0xe112('0x36')](_0x5c981d[_0xe112('0x2c')][_0xe112('0x36')]));_0x188653[_0xe112('0x37')]=_0x188653['attributes'][_0xe112('0x38')]?_0x188653['attributes']:_0x18e067[_0xe112('0x35')];if(_0x5c981d[_0xe112('0x2c')][_0xe112('0x39')]){_0x188653[_0xe112('0x3a')]=[{'all':!![]}];}_0x188653=_[_0xe112('0x3b')]({},_0x188653,_0x5c981d['options']);return db[_0xe112('0x25')][_0xe112('0x3c')](_0x188653)[_0xe112('0x1c')](handleEntityNotFound(_0x4cdcd8,null))['then'](respondWithResult(_0x4cdcd8,null))[_0xe112('0x2e')](handleError(_0x4cdcd8,null));};exports[_0xe112('0x3d')]=function(_0x43b66f,_0xeccf69){return db[_0xe112('0x25')]['create'](_0x43b66f[_0xe112('0x3e')],{})[_0xe112('0x1c')](respondWithResult(_0xeccf69,0xc9))[_0xe112('0x2e')](handleError(_0xeccf69,null));};exports[_0xe112('0x1b')]=function(_0x4766db,_0x10d3aa){if(_0x4766db['body']['id']){delete _0x4766db[_0xe112('0x3e')]['id'];}return db[_0xe112('0x25')][_0xe112('0x3c')]({'where':{'id':_0x4766db[_0xe112('0x30')]['id']}})['then'](handleEntityNotFound(_0x10d3aa,null))['then'](saveUpdates(_0x4766db[_0xe112('0x3e')],null))['then'](respondWithResult(_0x10d3aa,null))['catch'](handleError(_0x10d3aa,null));};exports[_0xe112('0x1d')]=function(_0xbab77,_0x4e4811){return db[_0xe112('0x25')]['find']({'where':{'id':_0xbab77[_0xe112('0x30')]['id']}})[_0xe112('0x1c')](handleEntityNotFound(_0x4e4811,null))[_0xe112('0x1c')](removeEntity(_0x4e4811,null))['catch'](handleError(_0x4e4811,null));};exports[_0xe112('0x3f')]=function(_0x4123ee,_0x4fbec3){return db[_0xe112('0x25')][_0xe112('0x3f')]()[_0xe112('0x1c')](respondWithResult(_0x4fbec3,null))[_0xe112('0x2e')](handleError(_0x4fbec3,null));};exports['addMessage']=function(_0x1032d4,_0x3c6b16){return db[_0xe112('0x40')][_0xe112('0x3c')]({'where':{'id':_0x1032d4[_0xe112('0x30')]['id']}})[_0xe112('0x1c')](handleEntityNotFound(_0x3c6b16,null))[_0xe112('0x1c')](function(_0x15e113){if(_0x15e113){return _0x15e113[_0xe112('0x41')](_0x1032d4[_0xe112('0x3e')][_0xe112('0x42')],_['omit'](_0x1032d4[_0xe112('0x3e')],[_0xe112('0x42'),'id'])||{});}})[_0xe112('0x1c')](respondWithResult(_0x3c6b16,null))[_0xe112('0x2e')](handleError(_0x3c6b16,null));};exports[_0xe112('0x43')]=function(_0x3a0a2f,_0x33a7b1){var _0x3d6c26={'raw':![],'where':{}};var _0x2051c4={};var _0x1bba4f={'count':0x0,'rows':[]};return db[_0xe112('0x25')][_0xe112('0x44')]({'where':{'id':_0x3a0a2f[_0xe112('0x30')]['id']}})[_0xe112('0x1c')](handleEntityNotFound(_0x33a7b1,null))[_0xe112('0x1c')](function(_0x36302e){if(_0x36302e){_0x2051c4[_0xe112('0x35')]=_[_0xe112('0x31')](db['OpenchannelMessage'][_0xe112('0x32')]);_0x2051c4[_0xe112('0x2c')]=_[_0xe112('0x31')](_0x3a0a2f['query']);_0x2051c4[_0xe112('0x33')]=_[_0xe112('0x34')](_0x2051c4[_0xe112('0x35')],_0x2051c4['query']);_0x3d6c26['attributes']=_[_0xe112('0x34')](_0x2051c4[_0xe112('0x35')],qs[_0xe112('0x36')](_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x36')]));_0x3d6c26[_0xe112('0x37')]=_0x3d6c26[_0xe112('0x37')]['length']?_0x3d6c26[_0xe112('0x37')]:_0x2051c4[_0xe112('0x35')];if(!_0x3a0a2f[_0xe112('0x2c')]['hasOwnProperty'](_0xe112('0x45'))){_0x3d6c26[_0xe112('0x18')]=qs[_0xe112('0x18')](_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x18')]);_0x3d6c26[_0xe112('0x15')]=qs[_0xe112('0x15')](_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x15')]);}_0x3d6c26[_0xe112('0x46')]=qs[_0xe112('0x47')](_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x47')]);_0x3d6c26['where']=qs[_0xe112('0x33')](_[_0xe112('0x48')](_0x3a0a2f['query'],_0x2051c4[_0xe112('0x33')]));_0x3d6c26[_0xe112('0x49')][_0xe112('0x4a')]=_0x36302e['id'];if(_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x4b')]){_0x3d6c26[_0xe112('0x49')]=_[_0xe112('0x3b')](_0x3d6c26['where'],{'$or':_['map'](_0x3d6c26[_0xe112('0x37')],function(_0x22eca0){var _0x3c2ea9={};_0x3c2ea9[_0x22eca0]={'$like':'%'+_0x3a0a2f['query'][_0xe112('0x4b')]+'%'};return _0x3c2ea9;})});}if(_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x4c')]){var _0x8ed265=_0x3a0a2f[_0xe112('0x2c')]['$gte']['split'](',');var _0xbad67={};_0xbad67[_0x8ed265[0x0]]={'$gte':moment(_0x8ed265[0x1])[_0xe112('0x4d')](_0xe112('0x4e'))};_0x3d6c26[_0xe112('0x49')]=_[_0xe112('0x3b')](_0x3d6c26['where'],_0xbad67);}_0x3d6c26=_['merge']({},_0x3d6c26,_0x3a0a2f[_0xe112('0x4f')]);return db[_0xe112('0x40')][_0xe112('0x17')]({'where':_0x3d6c26['where']})['then'](function(_0x263507){_0x1bba4f[_0xe112('0x17')]=_0x263507;if(_0x3a0a2f[_0xe112('0x2c')][_0xe112('0x39')]){_0x3d6c26['include']=[{'all':!![]}];}return db[_0xe112('0x40')][_0xe112('0x2a')](_0x3d6c26);})[_0xe112('0x1c')](function(_0x5c27bf){_0x1bba4f[_0xe112('0x50')]=_0x5c27bf;return _0x1bba4f;});}})['then'](respondWithFilteredResult(_0x33a7b1,_0x3d6c26))[_0xe112('0x2e')](handleError(_0x33a7b1,null));};exports['addTags']=function(_0x259768,_0x57f537){return db['OpenchannelInteraction'][_0xe112('0x3c')]({'where':{'id':_0x259768[_0xe112('0x30')]['id']}})[_0xe112('0x1c')](handleEntityNotFound(_0x57f537,null))[_0xe112('0x1c')](function(_0x3b95c6){if(_0x3b95c6){return _0x3b95c6['setTags'](_0x259768[_0xe112('0x3e')][_0xe112('0x42')],_['omit'](_0x259768[_0xe112('0x3e')],[_0xe112('0x42'),'id'])||{})[_0xe112('0x51')](function(){return db[_0xe112('0x52')][_0xe112('0x2a')]({'attributes':['id',_0xe112('0x21'),_0xe112('0x53')],'where':{'id':_0x259768['body'][_0xe112('0x42')]}});})[_0xe112('0x1c')](function(_0x54900c){socket[_0xe112('0x54')](_0xe112('0x55'),{'id':Number(_0x259768['params']['id']),'tags':_0x54900c||[]});return{'id':Number(_0x259768[_0xe112('0x30')]['id']),'tags':_0x54900c||[]};});}})[_0xe112('0x1c')](respondWithResult(_0x57f537,null))[_0xe112('0x2e')](handleError(_0x57f537,null));};exports[_0xe112('0x56')]=function(_0xe7bd73,_0x13b2d8){return db['OpenchannelInteraction'][_0xe112('0x3c')]({'where':{'id':_0xe7bd73['params']['id']}})[_0xe112('0x1c')](handleEntityNotFound(_0x13b2d8,null))[_0xe112('0x1c')](function(_0x2eb1ae){if(_0x2eb1ae){return _0x2eb1ae[_0xe112('0x56')](_0xe7bd73[_0xe112('0x2c')][_0xe112('0x42')]);}})[_0xe112('0x1c')](respondWithStatusCode(_0x13b2d8,null))[_0xe112('0x2e')](handleError(_0x13b2d8,null));};exports[_0xe112('0x57')]=function(_0x5b9f41,_0x44a602){var _0x259904=moment()[_0xe112('0x58')]()[_0xe112('0x59')]();var _0x4e8a60=path['join'](config[_0xe112('0x5a')],_0xe112('0x5b'),'files',_0xe112('0x5c'));var _0x504e8b=path[_0xe112('0x5d')](config[_0xe112('0x5a')],_0xe112('0x5b'),'files','attachments');var _0xe3d142=path[_0xe112('0x5d')](_0x4e8a60,_0x259904);var _0x25e776=util['format'](_0xe112('0x5e'),_0x5b9f41[_0xe112('0x30')]['id'],_0x259904);var _0x16c462=path[_0xe112('0x5d')](_0x4e8a60,_0x25e776);var _0x49b4bb=[];_0x49b4bb['push']({'model':db[_0xe112('0x5f')],'as':_0xe112('0x5f'),'attributes':['id',_0xe112('0x60')],'raw':!![]});_0x49b4bb[_0xe112('0x61')]({'model':db[_0xe112('0x62')],'as':_0xe112('0x63'),'attributes':['id','firstName',_0xe112('0x64')],'raw':!![]});if(_0x5b9f41['query']['attachments']){_0x49b4bb[_0xe112('0x61')]({'model':db['Attachment'],'as':_0xe112('0x65'),'raw':!![]});}var _0x3becb2=[{'model':db[_0xe112('0x40')],'as':_0xe112('0x66'),'attributes':['id',_0xe112('0x3e'),_0xe112('0x67'),'direction',_0xe112('0x68'),_0xe112('0x69')],'include':_0x49b4bb}];_0x3becb2['push']({'model':db[_0xe112('0x6a')],'as':'Account','attributes':['id','name']});_0x3becb2[_0xe112('0x61')]({'model':db[_0xe112('0x5f')],'as':'Owner','attributes':['id',_0xe112('0x60')]});return db[_0xe112('0x25')][_0xe112('0x3c')]({'where':{'id':_0x5b9f41[_0xe112('0x30')]['id']},'include':_0x3becb2})[_0xe112('0x1c')](handleEntityNotFound(_0x44a602,null))['then'](function(_0x731108){if(_0x731108){var _0x5726f5=_0x731108[_0xe112('0x6b')]({'plain':!![]});fs[_0xe112('0x6c')](_0xe3d142);var _0xab42a3={'channel':_0xe112('0x6d'),'account':_0x5726f5[_0xe112('0x6e')]['name'],'agent':_0x5726f5[_0xe112('0x6f')]?_0x5726f5['Owner'][_0xe112('0x60')]:_0xe112('0x70'),'createdAt':moment(_0x5726f5[_0xe112('0x67')])[_0xe112('0x4d')](_0xe112('0x4e'))[_0xe112('0x59')](),'closedAt':_0x5726f5[_0xe112('0x71')]?moment(_0x5726f5['closedAt'])[_0xe112('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe112('0x59')]():'','disposition':_0x5726f5[_0xe112('0x72')],'visibility':_0x5726f5[_0xe112('0x73')]?_0xe112('0x74'):_0xe112('0x75'),'messages':_(_0x5726f5[_0xe112('0x66')])['filter']({'secret':![]})[_0xe112('0x24')](function(_0x58dcd6){if(_0x58dcd6[_0xe112('0x65')]){var _0x3d934=path[_0xe112('0x5d')](_0x504e8b,_0x58dcd6[_0xe112('0x65')]['basename']);if(fs[_0xe112('0x76')](_0x3d934)){fs[_0xe112('0x77')](_0x3d934)[_0xe112('0x78')](fs[_0xe112('0x79')](path['join'](_0xe3d142,_0x58dcd6[_0xe112('0x65')][_0xe112('0x7a')])));}}return{'date':moment(_0x58dcd6['createdAt'])[_0xe112('0x4d')](_0xe112('0x4e'))[_0xe112('0x59')](),'sender':_0x58dcd6[_0xe112('0x7b')]===_0xe112('0x7c')?_0x58dcd6['User']?_0x58dcd6[_0xe112('0x5f')][_0xe112('0x60')]:'System':_0x58dcd6[_0xe112('0x63')][_0xe112('0x7d')]+(_0x58dcd6['Contact'][_0xe112('0x64')]?'\x20'+_0x58dcd6[_0xe112('0x63')][_0xe112('0x64')]:''),'body':_0x58dcd6['Attachment']?_0x58dcd6[_0xe112('0x65')][_0xe112('0x7a')]:_0x58dcd6['body'],'direction':_0x58dcd6[_0xe112('0x7b')]==='out'?'A':'C','secret':_0x58dcd6[_0xe112('0x68')],'read':_0x58dcd6[_0xe112('0x69')],'attachment':_0x58dcd6[_0xe112('0x65')]};})[_0xe112('0x7e')]()};return ejs['renderFile'](path[_0xe112('0x5d')](config[_0xe112('0x5a')],_0xe112('0x5b'),'views','downloadInteraction.ejs'),{'interaction':_0xab42a3})[_0xe112('0x1c')](function(_0x4c16f9){var _0x2a85eb=path[_0xe112('0x5d')](_0xe3d142,'transcript-'+_0x5726f5['id']+'-'+_0x259904+_0xe112('0x7f'));var _0x58fd4f={'path':_0x2a85eb,'channel':'Openchannel','interactionId':_0x5726f5['id']};return pdf[_0xe112('0x80')](_0x4c16f9,_0x58fd4f);})[_0xe112('0x1c')](function(){return new Promise(function(_0x56bb66,_0x4618cf){zipdir(_0xe3d142,{'saveTo':_0x16c462},function(_0xb01a0c,_0x18d90d){if(_0xb01a0c)return _0x4618cf(_0xb01a0c);return _0x56bb66(_0x18d90d);});})['then'](function(){return new Promise(function(_0x44d65f,_0x17390e){rimraf(_0xe3d142,function(_0x1e3ea3){if(_0x1e3ea3)_0x17390e(_0x1e3ea3);return _0x44d65f();});});})[_0xe112('0x1c')](function(){return _0x44a602[_0xe112('0x57')](_0x16c462,_0x25e776,function(_0x120093){if(_0x120093){logger['error']('Unable\x20to\x20delete\x20zip\x20file',_0x120093);}else{fs[_0xe112('0x81')](_0x16c462);}});});});}else{return _0x44a602[_0xe112('0x12')](0xc8);}})[_0xe112('0x2e')](handleError(_0x44a602,null));}; \ No newline at end of file +var _0xed2b=['length','include','options','find','catch','create','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','Tag','color','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','Openchannel','format','closed','closedAt','disposition','Private','createWriteStream','basename','out','System','Contact','value','renderFile','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','update','then','destroy','sendStatus','error','stack','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','query','user','show','from','params','keys','filters','intersection','model','attributes','fields'];(function(_0x509049,_0x3615d0){var _0x1cdfda=function(_0x4994d4){while(--_0x4994d4){_0x509049['push'](_0x509049['shift']());}};_0x1cdfda(++_0x3615d0);}(_0xed2b,0x1b3));var _0xbed2=function(_0x5659c0,_0x5f2532){_0x5659c0=_0x5659c0-0x0;var _0x36e3c0=_0xed2b[_0x5659c0];return _0x36e3c0;};'use strict';var rimraf=require(_0xbed2('0x0'));var zipdir=require(_0xbed2('0x1'));var moment=require('moment');var util=require(_0xbed2('0x2'));var path=require(_0xbed2('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbed2('0x4'));var Redis=require(_0xbed2('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xbed2('0x6'));var pdf=require(_0xbed2('0x7'));var logger=require(_0xbed2('0x8'))(_0xbed2('0x9'));var config=require(_0xbed2('0xa'));var db=require(_0xbed2('0xb'))['db'];config[_0xbed2('0xc')]=_[_0xbed2('0xd')](config[_0xbed2('0xc')],{'host':_0xbed2('0xe'),'port':0x18eb});var socket=require(_0xbed2('0xf'))(new Redis(config[_0xbed2('0xc')]));require('./openchannelInteraction.socket')[_0xbed2('0x10')](socket);function respondWithStatusCode(_0x5df24c,_0x6cffd4){_0x6cffd4=_0x6cffd4||0xcc;return function(_0x6ad293){if(_0x6ad293){return _0x5df24c['sendStatus'](_0x6cffd4);}return _0x5df24c[_0xbed2('0x11')](_0x6cffd4)[_0xbed2('0x12')]();};}function respondWithResult(_0x4c2c91,_0x3634a8){_0x3634a8=_0x3634a8||0xc8;return function(_0xee997a){if(_0xee997a){return _0x4c2c91[_0xbed2('0x11')](_0x3634a8)[_0xbed2('0x13')](_0xee997a);}};}function respondWithFilteredResult(_0x58d487,_0x460558){return function(_0x2f2c70){if(_0x2f2c70){var _0x34a4a8=typeof _0x460558[_0xbed2('0x14')]===_0xbed2('0x15')&&typeof _0x460558['limit']===_0xbed2('0x15');var _0x408da3=_0x2f2c70[_0xbed2('0x16')];var _0x4693d4=_0x34a4a8?0x0:_0x460558[_0xbed2('0x14')];var _0x362362=_0x34a4a8?_0x2f2c70[_0xbed2('0x16')]:_0x460558[_0xbed2('0x14')]+_0x460558[_0xbed2('0x17')];var _0x5ccc69;if(_0x362362>=_0x408da3){_0x362362=_0x408da3;_0x5ccc69=0xc8;}else{_0x5ccc69=0xce;}_0x58d487[_0xbed2('0x11')](_0x5ccc69);return _0x58d487['set']('Content-Range',_0x4693d4+'-'+_0x362362+'/'+_0x408da3)[_0xbed2('0x13')](_0x2f2c70);}return null;};}function saveUpdates(_0x103145){return function(_0x58a2b6){if(_0x58a2b6){return _0x58a2b6[_0xbed2('0x18')](_0x103145)[_0xbed2('0x19')](function(_0x3a3b13){return _0x3a3b13;});}return null;};}function removeEntity(_0x2b47b8){return function(_0x2755ac){if(_0x2755ac){return _0x2755ac[_0xbed2('0x1a')]()['then'](function(){_0x2b47b8['status'](0xcc)[_0xbed2('0x12')]();});}};}function handleEntityNotFound(_0x4a8cee){return function(_0x7703f0){if(!_0x7703f0){_0x4a8cee[_0xbed2('0x1b')](0x194);}return _0x7703f0;};}function handleError(_0x58b826,_0x2f1211){_0x2f1211=_0x2f1211||0x1f4;return function(_0x37ca49){logger[_0xbed2('0x1c')](_0x37ca49[_0xbed2('0x1d')]);if(_0x37ca49[_0xbed2('0x1e')]){delete _0x37ca49[_0xbed2('0x1e')];}_0x58b826[_0xbed2('0x11')](_0x2f1211)['send'](_0x37ca49);};}exports[_0xbed2('0x1f')]=function(_0x7480eb,_0x334707){var _0x343b1b={};var _0x1d0d8a=_['map'](db[_0xbed2('0x20')][_0xbed2('0x21')],function(_0x3133a8){return{'name':_0x3133a8[_0xbed2('0x22')],'type':_0x3133a8[_0xbed2('0x23')][_0xbed2('0x24')]};});_0x343b1b=qs['getOptions'](_0x1d0d8a,_0x7480eb);return interaction[_0xbed2('0x25')]('openchannel',_0x7480eb[_0xbed2('0x26')],_0x7480eb[_0xbed2('0x27')],_0x343b1b,_0x1d0d8a)[_0xbed2('0x19')](respondWithFilteredResult(_0x334707,_0x343b1b))['catch'](handleError(_0x334707,null));};exports[_0xbed2('0x28')]=function(_0x58551e,_0x4897e9){var _0x32872b={};if(_0x58551e[_0xbed2('0x26')][_0xbed2('0x23')]&&_0x58551e[_0xbed2('0x26')][_0xbed2('0x23')]===_0xbed2('0x29')){_0x32872b[_0xbed2('0x29')]=_0x58551e[_0xbed2('0x2a')]['id'];}else{_0x32872b['id']=_0x58551e[_0xbed2('0x2a')]['id'];}var _0xc847c2={'raw':![],'where':_0x32872b},_0x41d9c5={};_0x41d9c5['model']=_[_0xbed2('0x2b')](db['OpenchannelInteraction'][_0xbed2('0x21')]);_0x41d9c5[_0xbed2('0x26')]=_[_0xbed2('0x2b')](_0x58551e[_0xbed2('0x26')]);_0x41d9c5[_0xbed2('0x2c')]=_[_0xbed2('0x2d')](_0x41d9c5[_0xbed2('0x2e')],_0x41d9c5[_0xbed2('0x26')]);_0xc847c2[_0xbed2('0x2f')]=_['intersection'](_0x41d9c5[_0xbed2('0x2e')],qs[_0xbed2('0x30')](_0x58551e[_0xbed2('0x26')][_0xbed2('0x30')]));_0xc847c2[_0xbed2('0x2f')]=_0xc847c2[_0xbed2('0x2f')][_0xbed2('0x31')]?_0xc847c2[_0xbed2('0x2f')]:_0x41d9c5[_0xbed2('0x2e')];if(_0x58551e[_0xbed2('0x26')]['includeAll']){_0xc847c2[_0xbed2('0x32')]=[{'all':!![]}];}_0xc847c2=_['merge']({},_0xc847c2,_0x58551e[_0xbed2('0x33')]);return db[_0xbed2('0x20')][_0xbed2('0x34')](_0xc847c2)[_0xbed2('0x19')](handleEntityNotFound(_0x4897e9,null))['then'](respondWithResult(_0x4897e9,null))[_0xbed2('0x35')](handleError(_0x4897e9,null));};exports['create']=function(_0x4d3920,_0xe099ad){return db[_0xbed2('0x20')][_0xbed2('0x36')](_0x4d3920[_0xbed2('0x37')],{})[_0xbed2('0x19')](respondWithResult(_0xe099ad,0xc9))['catch'](handleError(_0xe099ad,null));};exports[_0xbed2('0x18')]=function(_0x268183,_0x1ba2dc){if(_0x268183[_0xbed2('0x37')]['id']){delete _0x268183[_0xbed2('0x37')]['id'];}return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x268183[_0xbed2('0x2a')]['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x1ba2dc,null))[_0xbed2('0x19')](saveUpdates(_0x268183['body'],null))[_0xbed2('0x19')](respondWithResult(_0x1ba2dc,null))[_0xbed2('0x35')](handleError(_0x1ba2dc,null));};exports[_0xbed2('0x1a')]=function(_0x434511,_0x48c2bc){return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x434511[_0xbed2('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48c2bc,null))[_0xbed2('0x19')](removeEntity(_0x48c2bc,null))['catch'](handleError(_0x48c2bc,null));};exports[_0xbed2('0x38')]=function(_0xa556e8,_0x482328){return db['OpenchannelInteraction']['describe']()[_0xbed2('0x19')](respondWithResult(_0x482328,null))[_0xbed2('0x35')](handleError(_0x482328,null));};exports['addMessage']=function(_0x13fa7e,_0x2c9fa2){return db[_0xbed2('0x39')][_0xbed2('0x34')]({'where':{'id':_0x13fa7e[_0xbed2('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2c9fa2,null))[_0xbed2('0x19')](function(_0xfa2fd0){if(_0xfa2fd0){return _0xfa2fd0[_0xbed2('0x3a')](_0x13fa7e[_0xbed2('0x37')][_0xbed2('0x3b')],_[_0xbed2('0x3c')](_0x13fa7e[_0xbed2('0x37')],[_0xbed2('0x3b'),'id'])||{});}})[_0xbed2('0x19')](respondWithResult(_0x2c9fa2,null))[_0xbed2('0x35')](handleError(_0x2c9fa2,null));};exports[_0xbed2('0x3d')]=function(_0x157be6,_0x56dca0){var _0x4afa02={'raw':![],'where':{}};var _0x3a43a4={};var _0x1e007c={'count':0x0,'rows':[]};return db[_0xbed2('0x20')][_0xbed2('0x3e')]({'where':{'id':_0x157be6[_0xbed2('0x2a')]['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x56dca0,null))[_0xbed2('0x19')](function(_0x7e764d){if(_0x7e764d){_0x3a43a4[_0xbed2('0x2e')]=_['keys'](db[_0xbed2('0x39')][_0xbed2('0x21')]);_0x3a43a4[_0xbed2('0x26')]=_[_0xbed2('0x2b')](_0x157be6['query']);_0x3a43a4[_0xbed2('0x2c')]=_[_0xbed2('0x2d')](_0x3a43a4[_0xbed2('0x2e')],_0x3a43a4[_0xbed2('0x26')]);_0x4afa02[_0xbed2('0x2f')]=_[_0xbed2('0x2d')](_0x3a43a4['model'],qs[_0xbed2('0x30')](_0x157be6[_0xbed2('0x26')][_0xbed2('0x30')]));_0x4afa02[_0xbed2('0x2f')]=_0x4afa02[_0xbed2('0x2f')]['length']?_0x4afa02[_0xbed2('0x2f')]:_0x3a43a4[_0xbed2('0x2e')];if(!_0x157be6[_0xbed2('0x26')][_0xbed2('0x3f')](_0xbed2('0x40'))){_0x4afa02[_0xbed2('0x17')]=qs['limit'](_0x157be6[_0xbed2('0x26')][_0xbed2('0x17')]);_0x4afa02[_0xbed2('0x14')]=qs['offset'](_0x157be6['query'][_0xbed2('0x14')]);}_0x4afa02[_0xbed2('0x41')]=qs[_0xbed2('0x42')](_0x157be6['query'][_0xbed2('0x42')]);_0x4afa02[_0xbed2('0x43')]=qs[_0xbed2('0x2c')](_[_0xbed2('0x44')](_0x157be6[_0xbed2('0x26')],_0x3a43a4['filters']));_0x4afa02[_0xbed2('0x43')][_0xbed2('0x45')]=_0x7e764d['id'];if(_0x157be6['query'][_0xbed2('0x46')]){_0x4afa02[_0xbed2('0x43')]=_[_0xbed2('0x47')](_0x4afa02['where'],{'$or':_[_0xbed2('0x48')](_0x4afa02['attributes'],function(_0x246bae){var _0xe098bf={};_0xe098bf[_0x246bae]={'$like':'%'+_0x157be6[_0xbed2('0x26')][_0xbed2('0x46')]+'%'};return _0xe098bf;})});}if(_0x157be6[_0xbed2('0x26')][_0xbed2('0x49')]){var _0x58255c=_0x157be6[_0xbed2('0x26')][_0xbed2('0x49')][_0xbed2('0x4a')](',');var _0x261a4e={};_0x261a4e[_0x58255c[0x0]]={'$gte':moment(_0x58255c[0x1])['format'](_0xbed2('0x4b'))};_0x4afa02['where']=_[_0xbed2('0x47')](_0x4afa02[_0xbed2('0x43')],_0x261a4e);}_0x4afa02=_[_0xbed2('0x47')]({},_0x4afa02,_0x157be6[_0xbed2('0x33')]);return db['OpenchannelMessage'][_0xbed2('0x16')]({'where':_0x4afa02['where']})[_0xbed2('0x19')](function(_0x32b1be){_0x1e007c[_0xbed2('0x16')]=_0x32b1be;if(_0x157be6[_0xbed2('0x26')]['includeAll']){_0x4afa02[_0xbed2('0x32')]=[{'all':!![]}];}return db[_0xbed2('0x39')][_0xbed2('0x25')](_0x4afa02);})[_0xbed2('0x19')](function(_0x14c3e5){_0x1e007c['rows']=_0x14c3e5;return _0x1e007c;});}})[_0xbed2('0x19')](respondWithFilteredResult(_0x56dca0,_0x4afa02))[_0xbed2('0x35')](handleError(_0x56dca0,null));};exports[_0xbed2('0x4c')]=function(_0x4e3902,_0x361ece){return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x4e3902[_0xbed2('0x2a')]['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x361ece,null))['then'](function(_0x243a2c){if(_0x243a2c){return _0x243a2c[_0xbed2('0x4d')](_0x4e3902[_0xbed2('0x37')][_0xbed2('0x3b')],_[_0xbed2('0x3c')](_0x4e3902[_0xbed2('0x37')],[_0xbed2('0x3b'),'id'])||{})['spread'](function(){return db[_0xbed2('0x4e')]['findAll']({'attributes':['id',_0xbed2('0x1e'),_0xbed2('0x4f')],'where':{'id':_0x4e3902[_0xbed2('0x37')][_0xbed2('0x3b')]}});})[_0xbed2('0x19')](function(_0x29d98b){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x4e3902[_0xbed2('0x2a')]['id']),'tags':_0x29d98b||[]});return{'id':Number(_0x4e3902['params']['id']),'tags':_0x29d98b||[]};});}})[_0xbed2('0x19')](respondWithResult(_0x361ece,null))[_0xbed2('0x35')](handleError(_0x361ece,null));};exports['removeTags']=function(_0x117732,_0x41c72d){return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x117732['params']['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x41c72d,null))[_0xbed2('0x19')](function(_0x5abf5f){if(_0x5abf5f){return _0x5abf5f['removeTags'](_0x117732[_0xbed2('0x26')][_0xbed2('0x3b')]);}})[_0xbed2('0x19')](respondWithStatusCode(_0x41c72d,null))[_0xbed2('0x35')](handleError(_0x41c72d,null));};exports[_0xbed2('0x50')]=function(_0x280d0a,_0x59e2ad){var _0x89d23a=moment()[_0xbed2('0x51')]()[_0xbed2('0x52')]();var _0x5b435e=path['join'](config[_0xbed2('0x53')],_0xbed2('0x54'),_0xbed2('0x55'),_0xbed2('0x56'));var _0x5707e2=path[_0xbed2('0x57')](config['root'],_0xbed2('0x54'),_0xbed2('0x55'),_0xbed2('0x58'));var _0xf01fe3=path[_0xbed2('0x57')](_0x5b435e,_0x89d23a);var _0x1d01a5=util['format'](_0xbed2('0x59'),_0x280d0a[_0xbed2('0x2a')]['id'],_0x89d23a);var _0xe5675f=path[_0xbed2('0x57')](_0x5b435e,_0x1d01a5);var _0x5ae1dc=[];_0x5ae1dc['push']({'model':db['User'],'as':_0xbed2('0x5a'),'attributes':['id',_0xbed2('0x5b')],'raw':!![]});_0x5ae1dc[_0xbed2('0x5c')]({'model':db[_0xbed2('0x5d')],'as':'Contact','attributes':['id',_0xbed2('0x5e'),_0xbed2('0x5f')],'raw':!![]});if(_0x280d0a[_0xbed2('0x26')][_0xbed2('0x58')]){_0x5ae1dc[_0xbed2('0x5c')]({'model':db['Attachment'],'as':_0xbed2('0x60'),'raw':!![]});}var _0x5a2132=[{'model':db[_0xbed2('0x39')],'as':_0xbed2('0x61'),'attributes':['id',_0xbed2('0x37'),_0xbed2('0x62'),_0xbed2('0x63'),_0xbed2('0x64'),_0xbed2('0x65')],'include':_0x5ae1dc}];_0x5a2132[_0xbed2('0x5c')]({'model':db['OpenchannelAccount'],'as':_0xbed2('0x66'),'attributes':['id',_0xbed2('0x1e')]});_0x5a2132[_0xbed2('0x5c')]({'model':db[_0xbed2('0x5a')],'as':_0xbed2('0x67'),'attributes':['id','fullname']});return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x280d0a['params']['id']},'include':_0x5a2132})[_0xbed2('0x19')](handleEntityNotFound(_0x59e2ad,null))['then'](function(_0x367220){if(_0x367220){var _0x38199f=_0x367220[_0xbed2('0x68')]({'plain':!![]});fs['mkdirSync'](_0xf01fe3);var _0x22643c={'channel':_0xbed2('0x69'),'account':_0x38199f[_0xbed2('0x66')][_0xbed2('0x1e')],'agent':_0x38199f['Owner']?_0x38199f[_0xbed2('0x67')][_0xbed2('0x5b')]:'N.A.','createdAt':moment(_0x38199f['createdAt'])[_0xbed2('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x38199f[_0xbed2('0x6b')]?moment(_0x38199f[_0xbed2('0x6c')])['format'](_0xbed2('0x4b'))[_0xbed2('0x52')]():'','disposition':_0x38199f[_0xbed2('0x6d')],'visibility':_0x38199f['threadId']?'Public':_0xbed2('0x6e'),'messages':_(_0x38199f[_0xbed2('0x61')])['filter']({'secret':![]})['map'](function(_0x2600fb){if(_0x2600fb[_0xbed2('0x60')]){var _0x463423=path[_0xbed2('0x57')](_0x5707e2,_0x2600fb['Attachment']['basename']);if(fs['existsSync'](_0x463423)){fs['createReadStream'](_0x463423)['pipe'](fs[_0xbed2('0x6f')](path['join'](_0xf01fe3,_0x2600fb[_0xbed2('0x60')][_0xbed2('0x70')])));}}return{'date':moment(_0x2600fb[_0xbed2('0x62')])[_0xbed2('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbed2('0x52')](),'sender':_0x2600fb[_0xbed2('0x63')]===_0xbed2('0x71')?_0x2600fb[_0xbed2('0x5a')]?_0x2600fb[_0xbed2('0x5a')][_0xbed2('0x5b')]:_0xbed2('0x72'):_0x2600fb[_0xbed2('0x73')][_0xbed2('0x5e')]+(_0x2600fb[_0xbed2('0x73')][_0xbed2('0x5f')]?'\x20'+_0x2600fb[_0xbed2('0x73')][_0xbed2('0x5f')]:''),'body':_0x2600fb['Attachment']?_0x2600fb['Attachment'][_0xbed2('0x70')]:_0x2600fb[_0xbed2('0x37')],'direction':_0x2600fb[_0xbed2('0x63')]===_0xbed2('0x71')?'A':'C','secret':_0x2600fb[_0xbed2('0x64')],'read':_0x2600fb[_0xbed2('0x65')],'attachment':_0x2600fb[_0xbed2('0x60')]};})[_0xbed2('0x74')]()};return ejs[_0xbed2('0x75')](path[_0xbed2('0x57')](config[_0xbed2('0x53')],'server','views','downloadInteraction.ejs'),{'interaction':_0x22643c})['then'](function(_0x185711){var _0x137207=path[_0xbed2('0x57')](_0xf01fe3,_0xbed2('0x76')+_0x38199f['id']+'-'+_0x89d23a+'.pdf');var _0x437330={'path':_0x137207,'channel':_0xbed2('0x69'),'interactionId':_0x38199f['id']};return pdf[_0xbed2('0x77')](_0x185711,_0x437330);})[_0xbed2('0x19')](function(){return new Promise(function(_0x31f888,_0x5c5626){zipdir(_0xf01fe3,{'saveTo':_0xe5675f},function(_0x14b2c4,_0x297512){if(_0x14b2c4)return _0x5c5626(_0x14b2c4);return _0x31f888(_0x297512);});})[_0xbed2('0x19')](function(){return new Promise(function(_0x6f985f,_0x21bea7){rimraf(_0xf01fe3,function(_0x44a1e9){if(_0x44a1e9)_0x21bea7(_0x44a1e9);return _0x6f985f();});});})[_0xbed2('0x19')](function(){return _0x59e2ad[_0xbed2('0x50')](_0xe5675f,_0x1d01a5,function(_0x1c67f6){if(_0x1c67f6){logger[_0xbed2('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x1c67f6);}else{fs[_0xbed2('0x78')](_0xe5675f);}});});});}else{return _0x59e2ad['sendStatus'](0xc8);}})['catch'](handleError(_0x59e2ad,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c189c2a..d2c51da 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cf8=['setMaxListeners','save','update','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','OpenchannelMessage'];(function(_0x5de818,_0x7c4485){var _0x345670=function(_0x5e268d){while(--_0x5e268d){_0x5de818['push'](_0x5de818['shift']());}};_0x345670(++_0x7c4485);}(_0x2cf8,0x7f));var _0x82cf=function(_0x272734,_0x5e33e4){_0x272734=_0x272734-0x0;var _0x1f7aa0=_0x2cf8[_0x272734];return _0x1f7aa0;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x82cf('0x0')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x82cf('0x1')](0x0);var events={'afterCreate':_0x82cf('0x2'),'afterUpdate':_0x82cf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x33d65e){return function(_0x2394ca,_0x13f0f3,_0x1f57dd){_0x2394ca[_0x82cf('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x196a7f){_0x2394ca[_0x82cf('0x5')](_0x82cf('0x6'),_0x196a7f['map'](function(_0x23acfa){return{'id':_0x23acfa['id']};}));return OpenchannelMessage[_0x82cf('0x7')]({'where':{'OpenchannelInteractionId':_0x2394ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0x82cf('0x8')](function(_0x12959a){_0x2394ca[_0x82cf('0x5')](_0x82cf('0x9'),_0x12959a[_0x82cf('0xa')]);OpenchannelInteractionEvents[_0x82cf('0xb')](_0x33d65e+':'+_0x2394ca['id'],_0x2394ca);OpenchannelInteractionEvents[_0x82cf('0xb')](_0x33d65e,_0x2394ca);_0x1f57dd(null);})[_0x82cf('0xc')](_0x1f57dd(null));};}for(var e in events){if(events[_0x82cf('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x82cf('0xe')](e,emitEvent(event));}}module[_0x82cf('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x092e=['length','emit','catch','hasOwnProperty','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x18cbe1,_0x38624f){var _0x243fbd=function(_0x40594f){while(--_0x40594f){_0x18cbe1['push'](_0x18cbe1['shift']());}};_0x243fbd(++_0x38624f);}(_0x092e,0x1ad));var _0xe092=function(_0x94a543,_0x160f2a){_0x94a543=_0x94a543-0x0;var _0x1e1c43=_0x092e[_0x94a543];return _0x1e1c43;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xe092('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xe092('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe092('0x2')](0x0);var events={'afterCreate':_0xe092('0x3'),'afterUpdate':_0xe092('0x4'),'afterDestroy':_0xe092('0x5')};function emitEvent(_0x45ef8d){return function(_0x1a816a,_0x51a607,_0x14d288){_0x1a816a[_0xe092('0x6')]({'attributes':['id'],'raw':!![]})[_0xe092('0x7')](function(_0x55c83a){_0x1a816a[_0xe092('0x8')](_0xe092('0x9'),_0x55c83a[_0xe092('0xa')](function(_0x37b948){return{'id':_0x37b948['id']};}));return OpenchannelMessage[_0xe092('0xb')]({'where':{'OpenchannelInteractionId':_0x1a816a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x12478e){_0x1a816a[_0xe092('0x8')](_0xe092('0xc'),_0x12478e[_0xe092('0xd')]);OpenchannelInteractionEvents[_0xe092('0xe')](_0x45ef8d+':'+_0x1a816a['id'],_0x1a816a);OpenchannelInteractionEvents[_0xe092('0xe')](_0x45ef8d,_0x1a816a);_0x14d288(null);})[_0xe092('0xf')](_0x14d288(null));};}for(var e in events){if(events[_0xe092('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 2b2ba46..37434be 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac03=['api','moment','bluebird','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac03,0x6e));var _0x3ac0=function(_0x11c06e,_0x1cb9c7){_0x11c06e=_0x11c06e-0x0;var _0x20a7dc=_0xac03[_0x11c06e];return _0x20a7dc;};'use strict';var _=require(_0x3ac0('0x0'));var util=require(_0x3ac0('0x1'));var logger=require('../../config/logger')(_0x3ac0('0x2'));var moment=require(_0x3ac0('0x3'));var BPromise=require(_0x3ac0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ac0('0x5'));var attributes=require(_0x3ac0('0x6'));module[_0x3ac0('0x7')]=function(_0x1036ec,_0x2e8317){return _0x1036ec[_0x3ac0('0x8')](_0x3ac0('0x9'),attributes,{'tableName':_0x3ac0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ac0('0xb'),'collate':_0x3ac0('0xc'),'hooks':{'beforeUpdate':function(_0x3afdb1,_0x4f6121,_0xf162d5){if(_0x3afdb1['changed']('closed')){_0x3afdb1[_0x3ac0('0xd')]=moment()[_0x3ac0('0xe')](_0x3ac0('0xf'));}_0xf162d5(null,_0x3afdb1);}}});}; \ No newline at end of file +var _0xdc12=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0x5f2327,_0x3d7d14){var _0x3d55d5=function(_0x18a085){while(--_0x18a085){_0x5f2327['push'](_0x5f2327['shift']());}};_0x3d55d5(++_0x3d7d14);}(_0xdc12,0x1c2));var _0x2dc1=function(_0x553197,_0x913961){_0x553197=_0x553197-0x0;var _0x70f1b=_0xdc12[_0x553197];return _0x70f1b;};'use strict';var _=require(_0x2dc1('0x0'));var util=require('util');var logger=require(_0x2dc1('0x1'))('api');var moment=require(_0x2dc1('0x2'));var BPromise=require(_0x2dc1('0x3'));var rp=require(_0x2dc1('0x4'));var fs=require('fs');var path=require(_0x2dc1('0x5'));var rimraf=require(_0x2dc1('0x6'));var config=require(_0x2dc1('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x2dc1('0x8')]=function(_0x2a2c3b,_0x1f2453){return _0x2a2c3b['define'](_0x2dc1('0x9'),attributes,{'tableName':_0x2dc1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dc1('0xb'),'collate':_0x2dc1('0xc'),'hooks':{'beforeUpdate':function(_0x56ec0a,_0x183ebf,_0x1d699b){if(_0x56ec0a[_0x2dc1('0xd')]('closed')){_0x56ec0a['closedAt']=moment()[_0x2dc1('0xe')](_0x2dc1('0xf'));}_0x1d699b(null,_0x56ec0a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index bbaff98..dacd504 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0885=['AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','AddTags','stringify','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','info','catch','OpenchannelInteraction','update','options','raw','where','attributes','limit','UpdateOpenchannelInteraction'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0885,0x1dc));var _0x5088=function(_0x53758c,_0x3f5260){_0x53758c=_0x53758c-0x0;var _0x297de2=_0x0885[_0x53758c];return _0x297de2;};'use strict';var _=require(_0x5088('0x0'));var util=require(_0x5088('0x1'));var moment=require(_0x5088('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5088('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5088('0x4'))(_0x5088('0x5'));var config=require(_0x5088('0x6'));var jayson=require(_0x5088('0x7'));var client=jayson[_0x5088('0x8')][_0x5088('0x9')]({'port':0x232a});config[_0x5088('0xa')]=_['defaults'](config[_0x5088('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5088('0xb'))[_0x5088('0xc')](socket);function respondWithRpcPromise(_0x3258ca,_0x3c2dfe,_0x4729c9){return new BPromise(function(_0x547159,_0x514a96){return client[_0x5088('0xd')](_0x3258ca,_0x4729c9)[_0x5088('0xe')](function(_0x5a1cc6){logger['info'](_0x5088('0xf'),_0x3c2dfe,_0x5088('0x10'));logger[_0x5088('0x11')](_0x5088('0x12'),_0x3c2dfe,_0x5088('0x10'),JSON['stringify'](_0x5a1cc6));if(_0x5a1cc6[_0x5088('0x13')]){if(_0x5a1cc6[_0x5088('0x13')]['code']===0x1f4){logger[_0x5088('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3c2dfe,_0x5a1cc6[_0x5088('0x13')][_0x5088('0x14')]);return _0x514a96(_0x5a1cc6[_0x5088('0x13')]['message']);}logger[_0x5088('0x13')](_0x5088('0xf'),_0x3c2dfe,_0x5a1cc6[_0x5088('0x13')][_0x5088('0x14')]);return _0x547159(_0x5a1cc6['error'][_0x5088('0x14')]);}else{logger[_0x5088('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3c2dfe,_0x5088('0x10'));_0x547159(_0x5a1cc6['result'][_0x5088('0x14')]);}})[_0x5088('0x16')](function(_0x392082){logger[_0x5088('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3c2dfe,_0x392082);_0x514a96(_0x392082);});});}exports['UpdateOpenchannelInteraction']=function(_0x1487dd){var _0x474d0d=this;return new Promise(function(_0x49841c,_0x3f9915){return db[_0x5088('0x17')][_0x5088('0x18')](_0x1487dd['body'],{'raw':_0x1487dd[_0x5088('0x19')]?_0x1487dd['options'][_0x5088('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1487dd[_0x5088('0x19')]?_0x1487dd[_0x5088('0x19')][_0x5088('0x1b')]||null:null,'attributes':_0x1487dd[_0x5088('0x19')]?_0x1487dd[_0x5088('0x19')][_0x5088('0x1c')]||null:null,'limit':_0x1487dd[_0x5088('0x19')]?_0x1487dd[_0x5088('0x19')][_0x5088('0x1d')]||null:null})[_0x5088('0xe')](function(_0x137cdd){logger[_0x5088('0x15')](_0x5088('0x1e'),_0x1487dd);logger['debug']('UpdateOpenchannelInteraction',_0x1487dd,JSON['stringify'](_0x137cdd));_0x49841c(_0x137cdd);})[_0x5088('0x16')](function(_0x25d8be){logger[_0x5088('0x13')]('UpdateOpenchannelInteraction',_0x25d8be[_0x5088('0x14')],_0x1487dd);_0x3f9915(_0x474d0d[_0x5088('0x13')](0x1f4,_0x25d8be[_0x5088('0x14')]));});});};exports[_0x5088('0x1f')]=function(_0x6dd271){return new Promise(function(_0x3f1fb1,_0x12d448){return db[_0x5088('0x17')][_0x5088('0x20')]({'where':_0x6dd271[_0x5088('0x19')]?_0x6dd271[_0x5088('0x19')][_0x5088('0x1b')]||null:null})[_0x5088('0xe')](function(_0x4cd7af){if(_0x4cd7af){return _0x4cd7af[_0x5088('0x21')](_0x6dd271[_0x5088('0x22')][_0x5088('0x23')],_[_0x5088('0x24')](_0x6dd271[_0x5088('0x22')],[_0x5088('0x23'),'id'])||{});}})['spread'](function(_0x99ce9f){logger[_0x5088('0x15')](_0x5088('0x25'),_0x6dd271);logger[_0x5088('0x11')](_0x5088('0x25'),_0x6dd271,JSON[_0x5088('0x26')](_0x99ce9f));_0x3f1fb1(_0x99ce9f);})[_0x5088('0x16')](function(_0x4ffa94){logger[_0x5088('0x13')](_0x5088('0x25'),_0x4ffa94[_0x5088('0x14')],_0x6dd271);_0x12d448(_this[_0x5088('0x13')](0x1f4,_0x4ffa94[_0x5088('0x14')]));});});}; \ No newline at end of file +var _0x4bd4=['socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2d9ece,_0x282f1c){var _0x4e2c19=function(_0x14ff16){while(--_0x14ff16){_0x2d9ece['push'](_0x2d9ece['shift']());}};_0x4e2c19(++_0x282f1c);}(_0x4bd4,0xd1));var _0x44bd=function(_0x2952e0,_0x304b91){_0x2952e0=_0x2952e0-0x0;var _0x2730fb=_0x4bd4[_0x2952e0];return _0x2730fb;};'use strict';var _=require(_0x44bd('0x0'));var util=require(_0x44bd('0x1'));var moment=require(_0x44bd('0x2'));var BPromise=require(_0x44bd('0x3'));var rs=require(_0x44bd('0x4'));var fs=require('fs');var Redis=require(_0x44bd('0x5'));var db=require(_0x44bd('0x6'))['db'];var utils=require(_0x44bd('0x7'));var logger=require('../../config/logger')(_0x44bd('0x8'));var config=require(_0x44bd('0x9'));var jayson=require(_0x44bd('0xa'));var client=jayson[_0x44bd('0xb')][_0x44bd('0xc')]({'port':0x232a});config[_0x44bd('0xd')]=_[_0x44bd('0xe')](config[_0x44bd('0xd')],{'host':_0x44bd('0xf'),'port':0x18eb});var socket=require(_0x44bd('0x10'))(new Redis(config['redis']));require(_0x44bd('0x11'))[_0x44bd('0x12')](socket);function respondWithRpcPromise(_0x1de32c,_0x5079e1,_0x1a776e){return new BPromise(function(_0x23aa9d,_0x36791c){return client[_0x44bd('0x13')](_0x1de32c,_0x1a776e)[_0x44bd('0x14')](function(_0x76c91e){logger[_0x44bd('0x15')](_0x44bd('0x16'),_0x5079e1,'request\x20sent');logger[_0x44bd('0x17')](_0x44bd('0x18'),_0x5079e1,_0x44bd('0x19'),JSON[_0x44bd('0x1a')](_0x76c91e));if(_0x76c91e[_0x44bd('0x1b')]){if(_0x76c91e[_0x44bd('0x1b')]['code']===0x1f4){logger['error'](_0x44bd('0x16'),_0x5079e1,_0x76c91e[_0x44bd('0x1b')][_0x44bd('0x1c')]);return _0x36791c(_0x76c91e[_0x44bd('0x1b')]['message']);}logger[_0x44bd('0x1b')](_0x44bd('0x16'),_0x5079e1,_0x76c91e[_0x44bd('0x1b')][_0x44bd('0x1c')]);return _0x23aa9d(_0x76c91e[_0x44bd('0x1b')][_0x44bd('0x1c')]);}else{logger[_0x44bd('0x15')](_0x44bd('0x16'),_0x5079e1,'request\x20sent');_0x23aa9d(_0x76c91e['result'][_0x44bd('0x1c')]);}})[_0x44bd('0x1d')](function(_0x28381b){logger[_0x44bd('0x1b')](_0x44bd('0x16'),_0x5079e1,_0x28381b);_0x36791c(_0x28381b);});});}exports[_0x44bd('0x1e')]=function(_0x1a1bbf){var _0x45e3a9=this;return new Promise(function(_0x4efa9b,_0x2b845a){return db['OpenchannelInteraction'][_0x44bd('0x1f')](_0x1a1bbf[_0x44bd('0x20')],{'raw':_0x1a1bbf[_0x44bd('0x21')]?_0x1a1bbf[_0x44bd('0x21')][_0x44bd('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1bbf[_0x44bd('0x21')]?_0x1a1bbf[_0x44bd('0x21')][_0x44bd('0x23')]||null:null,'attributes':_0x1a1bbf['options']?_0x1a1bbf['options'][_0x44bd('0x24')]||null:null,'limit':_0x1a1bbf['options']?_0x1a1bbf[_0x44bd('0x21')][_0x44bd('0x25')]||null:null})[_0x44bd('0x14')](function(_0x30035b){logger['info'](_0x44bd('0x1e'),_0x1a1bbf);logger['debug'](_0x44bd('0x1e'),_0x1a1bbf,JSON[_0x44bd('0x1a')](_0x30035b));_0x4efa9b(_0x30035b);})[_0x44bd('0x1d')](function(_0xd4a4ff){logger[_0x44bd('0x1b')](_0x44bd('0x1e'),_0xd4a4ff['message'],_0x1a1bbf);_0x2b845a(_0x45e3a9[_0x44bd('0x1b')](0x1f4,_0xd4a4ff[_0x44bd('0x1c')]));});});};exports[_0x44bd('0x26')]=function(_0x3f61ab){return new Promise(function(_0x4696d2,_0x4a8c22){return db[_0x44bd('0x27')][_0x44bd('0x28')]({'where':_0x3f61ab[_0x44bd('0x21')]?_0x3f61ab['options']['where']||null:null})['then'](function(_0x4655fa){if(_0x4655fa){return _0x4655fa[_0x44bd('0x29')](_0x3f61ab['body'][_0x44bd('0x2a')],_[_0x44bd('0x2b')](_0x3f61ab[_0x44bd('0x20')],[_0x44bd('0x2a'),'id'])||{});}})['spread'](function(_0x26146a){logger[_0x44bd('0x15')](_0x44bd('0x2c'),_0x3f61ab);logger[_0x44bd('0x17')](_0x44bd('0x2c'),_0x3f61ab,JSON[_0x44bd('0x1a')](_0x26146a));_0x4696d2(_0x26146a);})['catch'](function(_0x3b30c4){logger[_0x44bd('0x1b')]('AddTags',_0x3b30c4['message'],_0x3f61ab);_0x4a8c22(_this[_0x44bd('0x1b')](0x1f4,_0x3b30c4[_0x44bd('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a6746a9..d02e571 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10dd=['update','register','length','./openchannelInteraction.events','save'];(function(_0x3339bd,_0x1ba6a8){var _0x725e64=function(_0x34ce8d){while(--_0x34ce8d){_0x3339bd['push'](_0x3339bd['shift']());}};_0x725e64(++_0x1ba6a8);}(_0x10dd,0xc6));var _0xd10d=function(_0x3db33f,_0x56ce5b){_0x3db33f=_0x3db33f-0x0;var _0xf413f9=_0x10dd[_0x3db33f];return _0xf413f9;};'use strict';var OpenchannelInteractionEvents=require(_0xd10d('0x0'));var events=[_0xd10d('0x1'),'remove',_0xd10d('0x2')];function createListener(_0x58b0e3,_0x281c57){return function(_0x525e9d){_0x281c57['emit'](_0x58b0e3,_0x525e9d);};}function removeListener(_0x30d42b,_0x4966f8){return function(){OpenchannelInteractionEvents['removeListener'](_0x30d42b,_0x4966f8);};}exports[_0xd10d('0x3')]=function(_0x51bec8){for(var _0xc76e8a=0x0,_0x196bde=events[_0xd10d('0x4')];_0xc76e8a<_0x196bde;_0xc76e8a++){var _0x1c6375=events[_0xc76e8a];var _0x539f21=createListener('openchannelInteraction:'+_0x1c6375,_0x51bec8);OpenchannelInteractionEvents['on'](_0x1c6375,_0x539f21);}}; \ No newline at end of file +var _0xcf54=['save','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x155937,_0x4630ed){var _0x556878=function(_0x184056){while(--_0x184056){_0x155937['push'](_0x155937['shift']());}};_0x556878(++_0x4630ed);}(_0xcf54,0x1bf));var _0x4cf5=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xcf54[_0xf6e75d];return _0x27514d;};'use strict';var OpenchannelInteractionEvents=require(_0x4cf5('0x0'));var events=[_0x4cf5('0x1'),'remove',_0x4cf5('0x2')];function createListener(_0x4a8811,_0x2cb10f){return function(_0x333caf){_0x2cb10f[_0x4cf5('0x3')](_0x4a8811,_0x333caf);};}function removeListener(_0x5150f0,_0x11f25a){return function(){OpenchannelInteractionEvents[_0x4cf5('0x4')](_0x5150f0,_0x11f25a);};}exports[_0x4cf5('0x5')]=function(_0x196b9c){for(var _0x2c8ab7=0x0,_0xcd83b1=events[_0x4cf5('0x6')];_0x2c8ab7<_0xcd83b1;_0x2c8ab7++){var _0x5ca98a=events[_0x2c8ab7];var _0x2d1f2e=createListener(_0x4cf5('0x7')+_0x5ca98a,_0x196b9c);OpenchannelInteractionEvents['on'](_0x5ca98a,_0x2d1f2e);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a9fb9fc..ad754f8 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +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(_0x2cf187,_0x2d6246){_0x2cf187=_0x2cf187-0x0;var _0xd5ca99=_0x70e0[_0x2cf187];return _0xd5ca99;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 9c64221..65356db 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47d6=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1d3242,_0x480f2e){var _0x2c1f3f=function(_0x300a0d){while(--_0x300a0d){_0x1d3242['push'](_0x1d3242['shift']());}};_0x2c1f3f(++_0x480f2e);}(_0x47d6,0x13f));var _0x647d=function(_0x1da660,_0x3b8b06){_0x1da660=_0x1da660-0x0;var _0xddf1ab=_0x47d6[_0x1da660];return _0xddf1ab;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'body':{'type':Sequelize[_0x647d('0x2')](_0x647d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x647d('0x5')]('in',_0x647d('0x6')),'defaultValue':_0x647d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x647d('0x7')]},'providerName':{'type':Sequelize[_0x647d('0x8')]},'providerResponse':{'type':Sequelize[_0x647d('0x2')]}}; \ No newline at end of file +var _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0x2bf346,_0x2186fe){var _0x50c73b=function(_0x494427){while(--_0x494427){_0x2bf346['push'](_0x2bf346['shift']());}};_0x50c73b(++_0x2186fe);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x561cad,_0x3ea409){_0x561cad=_0x561cad-0x0;var _0x578791=_0x9d5b[_0x561cad];return _0x578791;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8ab0b29..2d81a66 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8bc=['OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','include','show','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','interaction','RejectMessage','rejectMessage','Sequelize','internal','event','rejectmessage','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','register','http','client','request'];(function(_0x3765e2,_0x4e1fba){var _0x144efb=function(_0x1b1ad0){while(--_0x1b1ad0){_0x3765e2['push'](_0x3765e2['shift']());}};_0x144efb(++_0x4e1fba);}(_0xb8bc,0x1d8));var _0xcb8b=function(_0x4070aa,_0x4fec19){_0x4070aa=_0x4070aa-0x0;var _0x1daf4e=_0xb8bc[_0x4070aa];return _0x1daf4e;};'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(_0xcb8b('0x0'));var moment=require(_0xcb8b('0x1'));var BPromise=require(_0xcb8b('0x2'));var Mustache=require(_0xcb8b('0x3'));var util=require(_0xcb8b('0x4'));var path=require(_0xcb8b('0x5'));var sox=require(_0xcb8b('0x6'));var csv=require(_0xcb8b('0x7'));var ejs=require(_0xcb8b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb8b('0x9'));var squel=require(_0xcb8b('0xa'));var crypto=require(_0xcb8b('0xb'));var jsforce=require(_0xcb8b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcb8b('0x7'));var querystring=require('querystring');var Papa=require(_0xcb8b('0xd'));var Redis=require(_0xcb8b('0xe'));var authService=require(_0xcb8b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb8b('0x10'))(_0xcb8b('0x11'));var utils=require(_0xcb8b('0x12'));var config=require(_0xcb8b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb8b('0x14'))['db'];config['redis']=_[_0xcb8b('0x15')](config['redis'],{'host':_0xcb8b('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb8b('0x17')]));require('./openchannelMessage.socket')[_0xcb8b('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcb8b('0x19')]({'port':0x232c});var client9002=jayson[_0xcb8b('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33a8f7,_0x1b63f6,_0x879f5d,_0x363f07){return new BPromise(function(_0xbef607,_0x5a1bbc){var _0x24cb38=_0x363f07||client;return _0x24cb38[_0xcb8b('0x1b')](_0x33a8f7,_0x879f5d)['then'](function(_0x42d7cb){logger['info'](_0xcb8b('0x1c'),_0x1b63f6,_0xcb8b('0x1d'));logger[_0xcb8b('0x1e')](_0xcb8b('0x1f'),_0x1b63f6,'request\x20sent',JSON[_0xcb8b('0x20')](_0x42d7cb));if(_0x42d7cb[_0xcb8b('0x21')]){if(_0x42d7cb[_0xcb8b('0x21')][_0xcb8b('0x22')]===0x1f4){logger[_0xcb8b('0x21')](_0xcb8b('0x1c'),_0x1b63f6,_0x42d7cb[_0xcb8b('0x21')][_0xcb8b('0x23')]);return _0x5a1bbc(_0x42d7cb[_0xcb8b('0x21')][_0xcb8b('0x23')]);}logger['error'](_0xcb8b('0x1c'),_0x1b63f6,_0x42d7cb[_0xcb8b('0x21')]['message']);return _0xbef607(_0x42d7cb[_0xcb8b('0x21')][_0xcb8b('0x23')]);}else{logger['info'](_0xcb8b('0x1c'),_0x1b63f6,_0xcb8b('0x1d'));_0xbef607(_0x42d7cb[_0xcb8b('0x24')][_0xcb8b('0x23')]);}})[_0xcb8b('0x25')](function(_0x3049e3){logger[_0xcb8b('0x21')](_0xcb8b('0x1c'),_0x1b63f6,_0x3049e3);_0x5a1bbc(_0x3049e3);});});}function respondWithStatusCode(_0x2968c0,_0x1aef06){_0x1aef06=_0x1aef06||0xcc;return function(_0x2857c9){if(_0x2857c9){return _0x2968c0[_0xcb8b('0x26')](_0x1aef06);}return _0x2968c0['status'](_0x1aef06)[_0xcb8b('0x27')]();};}function respondWithResult(_0x151fee,_0x3d40cc){_0x3d40cc=_0x3d40cc||0xc8;return function(_0x1f36d9){if(_0x1f36d9){return _0x151fee[_0xcb8b('0x28')](_0x3d40cc)['json'](_0x1f36d9);}};}function respondWithFilteredResult(_0x1cd221,_0x3f4265){return function(_0x4a51c3){if(_0x4a51c3){var _0x5e3564=typeof _0x3f4265[_0xcb8b('0x29')]===_0xcb8b('0x2a')&&typeof _0x3f4265['limit']==='undefined';var _0x218b0e=_0x4a51c3[_0xcb8b('0x2b')];var _0x367fd7=_0x5e3564?0x0:_0x3f4265[_0xcb8b('0x29')];var _0xe7e41=_0x5e3564?_0x4a51c3[_0xcb8b('0x2b')]:_0x3f4265[_0xcb8b('0x29')]+_0x3f4265[_0xcb8b('0x2c')];var _0x23cd40;if(_0xe7e41>=_0x218b0e){_0xe7e41=_0x218b0e;_0x23cd40=0xc8;}else{_0x23cd40=0xce;}_0x1cd221[_0xcb8b('0x28')](_0x23cd40);return _0x1cd221[_0xcb8b('0x2d')](_0xcb8b('0x2e'),_0x367fd7+'-'+_0xe7e41+'/'+_0x218b0e)['json'](_0x4a51c3);}return null;};}function patchUpdates(_0x1d2dd4){return function(_0x1d2ef7){try{jsonpatch[_0xcb8b('0x2f')](_0x1d2ef7,_0x1d2dd4,!![]);}catch(_0x193a37){return BPromise[_0xcb8b('0x30')](_0x193a37);}return _0x1d2ef7[_0xcb8b('0x31')]();};}function saveUpdates(_0x32657c,_0x7b1730){return function(_0x1e649f){if(_0x1e649f){return _0x1e649f[_0xcb8b('0x32')](_0x32657c)[_0xcb8b('0x33')](function(_0x467130){return _0x467130;});}return null;};}function removeEntity(_0x5b9b87,_0x4f0237){return function(_0x1a0399){if(_0x1a0399){return _0x1a0399[_0xcb8b('0x34')]()[_0xcb8b('0x33')](function(){_0x5b9b87[_0xcb8b('0x28')](0xcc)[_0xcb8b('0x27')]();});}};}function handleEntityNotFound(_0x3ac290,_0x4911b0){return function(_0x26faa4){if(!_0x26faa4){_0x3ac290[_0xcb8b('0x26')](0x194);}return _0x26faa4;};}function handleError(_0x69dbd3,_0x8bbe50){_0x8bbe50=_0x8bbe50||0x1f4;return function(_0x1f4e57){logger[_0xcb8b('0x21')](_0x1f4e57[_0xcb8b('0x35')]);if(_0x1f4e57[_0xcb8b('0x36')]){delete _0x1f4e57[_0xcb8b('0x36')];}_0x69dbd3[_0xcb8b('0x28')](_0x8bbe50)[_0xcb8b('0x37')](_0x1f4e57);};}exports['index']=function(_0x4c8c5d,_0xce9de9){var _0x1479ca={},_0x4e386a={},_0x4c1656={'count':0x0,'rows':[]};var _0x54352f=_[_0xcb8b('0x38')](db[_0xcb8b('0x39')][_0xcb8b('0x3a')],function(_0x564b2f){return{'name':_0x564b2f['fieldName'],'type':_0x564b2f[_0xcb8b('0x3b')][_0xcb8b('0x3c')]};});_0x4e386a['model']=_[_0xcb8b('0x38')](_0x54352f,_0xcb8b('0x36'));_0x4e386a[_0xcb8b('0x3d')]=_[_0xcb8b('0x3e')](_0x4c8c5d[_0xcb8b('0x3d')]);_0x4e386a[_0xcb8b('0x3f')]=_[_0xcb8b('0x40')](_0x4e386a[_0xcb8b('0x41')],_0x4e386a['query']);_0x1479ca[_0xcb8b('0x42')]=_[_0xcb8b('0x40')](_0x4e386a['model'],qs[_0xcb8b('0x43')](_0x4c8c5d[_0xcb8b('0x3d')][_0xcb8b('0x43')]));_0x1479ca[_0xcb8b('0x42')]=_0x1479ca[_0xcb8b('0x42')][_0xcb8b('0x44')]?_0x1479ca[_0xcb8b('0x42')]:_0x4e386a[_0xcb8b('0x41')];if(!_0x4c8c5d['query'][_0xcb8b('0x45')]('nolimit')){_0x1479ca['limit']=qs['limit'](_0x4c8c5d['query']['limit']);_0x1479ca[_0xcb8b('0x29')]=qs[_0xcb8b('0x29')](_0x4c8c5d['query'][_0xcb8b('0x29')]);}_0x1479ca[_0xcb8b('0x46')]=qs[_0xcb8b('0x47')](_0x4c8c5d[_0xcb8b('0x3d')][_0xcb8b('0x47')]);_0x1479ca['where']=qs[_0xcb8b('0x3f')](_[_0xcb8b('0x48')](_0x4c8c5d[_0xcb8b('0x3d')],_0x4e386a[_0xcb8b('0x3f')]),_0x54352f);if(_0x4c8c5d[_0xcb8b('0x3d')][_0xcb8b('0x49')]){_0x1479ca['where']=_[_0xcb8b('0x4a')](_0x1479ca[_0xcb8b('0x4b')],{'$or':_[_0xcb8b('0x38')](_0x54352f,function(_0x61a72e){if(_0x61a72e[_0xcb8b('0x3b')]!==_0xcb8b('0x4c')){var _0x3b57b2={};_0x3b57b2[_0x61a72e[_0xcb8b('0x36')]]={'$like':'%'+_0x4c8c5d[_0xcb8b('0x3d')][_0xcb8b('0x49')]+'%'};return _0x3b57b2;}})});}_0x1479ca=_[_0xcb8b('0x4a')]({},_0x1479ca,_0x4c8c5d[_0xcb8b('0x4d')]);var _0x42623a={'where':_0x1479ca[_0xcb8b('0x4b')]};return db['OpenchannelMessage'][_0xcb8b('0x2b')](_0x42623a)[_0xcb8b('0x33')](function(_0x2d84e6){_0x4c1656[_0xcb8b('0x2b')]=_0x2d84e6;if(_0x4c8c5d['query']['includeAll']){_0x1479ca[_0xcb8b('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1479ca);})[_0xcb8b('0x33')](function(_0xc59261){_0x4c1656['rows']=_0xc59261;return _0x4c1656;})[_0xcb8b('0x33')](respondWithFilteredResult(_0xce9de9,_0x1479ca))[_0xcb8b('0x25')](handleError(_0xce9de9,null));};exports[_0xcb8b('0x4f')]=function(_0x45f9ba,_0x39872a){var _0x1e2a8c={'raw':!![],'where':{'id':_0x45f9ba[_0xcb8b('0x50')]['id']}},_0x4e5fb8={};_0x4e5fb8[_0xcb8b('0x41')]=_[_0xcb8b('0x3e')](db[_0xcb8b('0x39')]['rawAttributes']);_0x4e5fb8[_0xcb8b('0x3d')]=_[_0xcb8b('0x3e')](_0x45f9ba[_0xcb8b('0x3d')]);_0x4e5fb8['filters']=_[_0xcb8b('0x40')](_0x4e5fb8[_0xcb8b('0x41')],_0x4e5fb8[_0xcb8b('0x3d')]);_0x1e2a8c['attributes']=_['intersection'](_0x4e5fb8[_0xcb8b('0x41')],qs['fields'](_0x45f9ba[_0xcb8b('0x3d')]['fields']));_0x1e2a8c[_0xcb8b('0x42')]=_0x1e2a8c[_0xcb8b('0x42')][_0xcb8b('0x44')]?_0x1e2a8c[_0xcb8b('0x42')]:_0x4e5fb8['model'];if(_0x45f9ba[_0xcb8b('0x3d')][_0xcb8b('0x51')]){_0x1e2a8c[_0xcb8b('0x4e')]=[{'all':!![]}];}_0x1e2a8c=_['merge']({},_0x1e2a8c,_0x45f9ba[_0xcb8b('0x4d')]);return db[_0xcb8b('0x39')][_0xcb8b('0x52')](_0x1e2a8c)[_0xcb8b('0x33')](handleEntityNotFound(_0x39872a,null))[_0xcb8b('0x33')](respondWithResult(_0x39872a,null))[_0xcb8b('0x25')](handleError(_0x39872a,null));};exports[_0xcb8b('0x53')]=function(_0x1e5c92,_0x5b399a){return db[_0xcb8b('0x39')][_0xcb8b('0x53')](_0x1e5c92[_0xcb8b('0x54')],{})[_0xcb8b('0x33')](respondWithResult(_0x5b399a,0xc9))[_0xcb8b('0x25')](handleError(_0x5b399a,null));};exports[_0xcb8b('0x32')]=function(_0x169b40,_0x5e0a4c){if(_0x169b40[_0xcb8b('0x54')]['id']){delete _0x169b40[_0xcb8b('0x54')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x169b40[_0xcb8b('0x50')]['id']}})[_0xcb8b('0x33')](handleEntityNotFound(_0x5e0a4c,null))[_0xcb8b('0x33')](saveUpdates(_0x169b40[_0xcb8b('0x54')],null))['then'](respondWithResult(_0x5e0a4c,null))[_0xcb8b('0x25')](handleError(_0x5e0a4c,null));};exports['destroy']=function(_0xe99290,_0x317f09){return db[_0xcb8b('0x39')][_0xcb8b('0x52')]({'where':{'id':_0xe99290[_0xcb8b('0x50')]['id']}})['then'](handleEntityNotFound(_0x317f09,null))['then'](removeEntity(_0x317f09,null))[_0xcb8b('0x25')](handleError(_0x317f09,null));};exports[_0xcb8b('0x55')]=function(_0x33af2a,_0x13f245){return db[_0xcb8b('0x39')][_0xcb8b('0x55')]()[_0xcb8b('0x33')](respondWithResult(_0x13f245,null))[_0xcb8b('0x25')](handleError(_0x13f245,null));};var interaction_log=require(_0xcb8b('0x10'))(_0xcb8b('0x56'));exports[_0xcb8b('0x57')]=function(_0x181b2e,_0x569daa,_0x2ba44a){var _0x139898={'agent':{},'channel':_0xcb8b('0x58')};if(_0x181b2e[_0xcb8b('0x54')]['id']){delete _0x181b2e[_0xcb8b('0x54')]['id'];}_0x181b2e[_0xcb8b('0x54')]['read']=!![];_0x181b2e[_0xcb8b('0x54')]['readAt']=moment()[_0xcb8b('0x59')](_0xcb8b('0x5a'));_0x181b2e[_0xcb8b('0x54')][_0xcb8b('0x5b')]=_0x181b2e[_0xcb8b('0x54')][_0xcb8b('0x5b')]||_0x181b2e['user']['id'];_0x139898[_0xcb8b('0x5c')]['id']=_0x181b2e[_0xcb8b('0x54')][_0xcb8b('0x5b')];return db[_0xcb8b('0x39')][_0xcb8b('0x52')]({'where':{'id':_0x181b2e[_0xcb8b('0x50')]['id'],'UserId':null}})[_0xcb8b('0x33')](handleEntityNotFound(_0x569daa,null))[_0xcb8b('0x33')](saveUpdates(_0x181b2e[_0xcb8b('0x54')],null))['then'](function(_0x1c0b4f){if(_0x1c0b4f){_0x139898['message']=_0x1c0b4f[_0xcb8b('0x5d')]({'plain':!![]});return db[_0xcb8b('0x5e')][_0xcb8b('0x52')]({'where':{'id':_0x1c0b4f[_0xcb8b('0x5f')]}});}return null;})[_0xcb8b('0x33')](handleEntityNotFound(_0x569daa,null))[_0xcb8b('0x33')](function(_0x34fc56){if(_0x34fc56){return _0x34fc56[_0xcb8b('0x32')]({'UserId':_0x181b2e['body']['UserId'],'read1stAt':_[_0xcb8b('0x60')](_0x34fc56[_0xcb8b('0x61')])?moment()[_0xcb8b('0x59')](_0xcb8b('0x5a')):undefined});}return null;})[_0xcb8b('0x33')](function(_0x2bae13){if(_0x2bae13){_0x139898['interaction']=_0x2bae13[_0xcb8b('0x5d')]({'plain':!![]});interaction_log[_0xcb8b('0x62')](_0xcb8b('0x63'),_0x181b2e[_0xcb8b('0x64')]['id'],_0x181b2e['user'][_0xcb8b('0x36')],_0x181b2e[_0xcb8b('0x64')][_0xcb8b('0x65')],_0x139898['interaction']['id'],_0x181b2e[_0xcb8b('0x54')]?JSON['stringify'](_0x181b2e[_0xcb8b('0x54')]):'null');return respondWithRpcPromise(_0xcb8b('0x66'),'acceptMessage',_0x139898);}return null;})[_0xcb8b('0x33')](function(_0x6ab2ff){var _0x1105f1=_0xcb8b('0x67')+_0x6ab2ff[_0xcb8b('0x23')]['ContactId'];return db[_0xcb8b('0x68')][_0xcb8b('0x3d')](_0x1105f1,{'type':db['Sequelize'][_0xcb8b('0x69')][_0xcb8b('0x6a')],'raw':!![]})[_0xcb8b('0x33')](function(_0x10a8bb){return _0x10a8bb;});})[_0xcb8b('0x33')](function(_0x8b31e3){if(_0x8b31e3){_0x139898[_0xcb8b('0x23')][_0xcb8b('0x6b')]=_0x8b31e3[0x0];if(!_0x181b2e['body'][_0xcb8b('0x5b')])return;return db[_0xcb8b('0x6c')][_0xcb8b('0x52')]({'where':{'id':_0x181b2e[_0xcb8b('0x54')][_0xcb8b('0x5b')],'role':_0xcb8b('0x5c')},'attributes':['id',_0xcb8b('0x36'),_0xcb8b('0x6d'),_0xcb8b('0x6e'),'internal'],'raw':!![]});}return null;})[_0xcb8b('0x33')](function(_0x2d1515){if(!_0x2d1515)return null;_0x139898[_0xcb8b('0x23')][_0xcb8b('0x5c')]=_0x2d1515;return _0x139898;})[_0xcb8b('0x33')](function(_0x2ce749){if(_0x2ce749){if(_0x181b2e[_0xcb8b('0x54')][_0xcb8b('0x6f')]){_0x139898[_0xcb8b('0x23')][_0xcb8b('0x70')]=util[_0xcb8b('0x59')](_0xcb8b('0x71'),_0x181b2e[_0xcb8b('0x64')]['name']);_0x139898['message']['channel']=_0x139898[_0xcb8b('0x72')];_0x139898[_0xcb8b('0x23')][_0xcb8b('0x73')]=_0x139898[_0xcb8b('0x72')];_0x139898[_0xcb8b('0x23')]['event']='accept';return respondWithRpcPromise(_0xcb8b('0x74'),_0xcb8b('0x74'),{'event':_0xcb8b('0x75'),'message':_0x139898[_0xcb8b('0x23')]},client9002)[_0xcb8b('0x33')](function(){return _0x139898;});}return _0x139898;}return null;})[_0xcb8b('0x33')](respondWithResult(_0x569daa,null))[_0xcb8b('0x25')](handleError(_0x569daa,null));};var interaction_log=require(_0xcb8b('0x10'))('openchannel-interactions');exports[_0xcb8b('0x30')]=function(_0x55c6b9,_0x156487,_0x11fac2){var _0xe04819={'agent':{},'channel':'openchannel'};if(_0x55c6b9[_0xcb8b('0x54')]['id']){delete _0x55c6b9['body']['id'];}_0x55c6b9[_0xcb8b('0x54')][_0xcb8b('0x5b')]=_0x55c6b9[_0xcb8b('0x54')][_0xcb8b('0x5b')]||_0x55c6b9[_0xcb8b('0x64')]['id'];_0xe04819['agent']['id']=_0x55c6b9['body'][_0xcb8b('0x5b')];return db[_0xcb8b('0x39')]['find']({'where':{'id':_0x55c6b9['params']['id'],'UserId':null}})[_0xcb8b('0x33')](handleEntityNotFound(_0x156487,null))[_0xcb8b('0x33')](function(_0x289404){if(_0x289404){_0xe04819['message']=_0x289404['get']({'plain':!![]});return db[_0xcb8b('0x5e')][_0xcb8b('0x52')]({'where':{'id':_0x289404[_0xcb8b('0x5f')]}});}return null;})[_0xcb8b('0x33')](handleEntityNotFound(_0x156487,null))[_0xcb8b('0x33')](function(_0x346a82){if(_0x346a82){_0xe04819[_0xcb8b('0x76')]=_0x346a82[_0xcb8b('0x5d')]({'plain':!![]});interaction_log[_0xcb8b('0x62')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55c6b9['user']['id'],_0x55c6b9[_0xcb8b('0x64')][_0xcb8b('0x36')],_0x55c6b9[_0xcb8b('0x64')]['role'],_0xe04819[_0xcb8b('0x76')]['id'],_0x55c6b9[_0xcb8b('0x54')]?JSON[_0xcb8b('0x20')](_0x55c6b9['body']):'null');return respondWithRpcPromise(_0xcb8b('0x77'),_0xcb8b('0x78'),_0xe04819);}return null;})['then'](function(_0xf48fd1){var _0x2cb4f9=_0xcb8b('0x67')+_0xf48fd1['message']['ContactId'];return db['sequelize'][_0xcb8b('0x3d')](_0x2cb4f9,{'type':db[_0xcb8b('0x79')][_0xcb8b('0x69')][_0xcb8b('0x6a')],'raw':!![]})[_0xcb8b('0x33')](function(_0x3a0bdf){return _0x3a0bdf;});})[_0xcb8b('0x33')](function(_0x493be4){if(_0x493be4){_0xe04819[_0xcb8b('0x23')][_0xcb8b('0x6b')]=_0x493be4[0x0];if(!_0x55c6b9[_0xcb8b('0x54')]['UserId'])return;return db[_0xcb8b('0x6c')][_0xcb8b('0x52')]({'where':{'id':_0x55c6b9[_0xcb8b('0x54')][_0xcb8b('0x5b')],'role':_0xcb8b('0x5c')},'attributes':['id','name',_0xcb8b('0x6d'),'email',_0xcb8b('0x7a')],'raw':!![]});}return null;})[_0xcb8b('0x33')](function(_0x34a899){if(!_0x34a899)return null;_0xe04819[_0xcb8b('0x23')][_0xcb8b('0x5c')]=_0x34a899;return _0xe04819;})[_0xcb8b('0x33')](function(_0x296ad6){if(_0x296ad6){_0x296ad6[_0xcb8b('0x23')][_0xcb8b('0x70')]=util[_0xcb8b('0x59')](_0xcb8b('0x71'),_0x55c6b9['user'][_0xcb8b('0x36')]);_0x296ad6[_0xcb8b('0x23')][_0xcb8b('0x72')]=_0xe04819[_0xcb8b('0x72')];_0x296ad6[_0xcb8b('0x23')][_0xcb8b('0x73')]=_0xe04819[_0xcb8b('0x72')];_0x296ad6[_0xcb8b('0x23')][_0xcb8b('0x7b')]=_0xcb8b('0x30');respondWithRpcPromise(_0xcb8b('0x74'),_0xcb8b('0x74'),{'event':_0xcb8b('0x7c'),'message':_0x296ad6[_0xcb8b('0x23')]},client9002);return _0xe04819;}return null;})[_0xcb8b('0x33')](respondWithResult(_0x156487,null))[_0xcb8b('0x25')](handleError(_0x156487,null));}; \ No newline at end of file +var _0xccde=['manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','Sequelize','QueryTypes','User','rejectmessage','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','status','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','destroy','name','send','index','map','OpenchannelMessage','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','keys','length','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','fullname','email','internal'];(function(_0x5cabfe,_0x52dd2f){var _0x373553=function(_0x59a103){while(--_0x59a103){_0x5cabfe['push'](_0x5cabfe['shift']());}};_0x373553(++_0x52dd2f);}(_0xccde,0x11e));var _0xeccd=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xccde[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeccd('0x0'));var zipdir=require(_0xeccd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeccd('0x2'));var moment=require(_0xeccd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeccd('0x4'));var util=require(_0xeccd('0x5'));var path=require(_0xeccd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeccd('0x7'));var fs=require('fs');var fs_extra=require(_0xeccd('0x8'));var _=require(_0xeccd('0x9'));var squel=require(_0xeccd('0xa'));var crypto=require('crypto');var jsforce=require(_0xeccd('0xb'));var deskjs=require(_0xeccd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeccd('0xd'));var Papa=require(_0xeccd('0xe'));var Redis=require(_0xeccd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xeccd('0x10'));var as=require(_0xeccd('0x11'));var hardwareService=require(_0xeccd('0x12'));var logger=require(_0xeccd('0x13'))(_0xeccd('0x14'));var utils=require(_0xeccd('0x15'));var config=require(_0xeccd('0x16'));var licenseUtil=require(_0xeccd('0x17'));var db=require(_0xeccd('0x18'))['db'];config[_0xeccd('0x19')]=_[_0xeccd('0x1a')](config[_0xeccd('0x19')],{'host':_0xeccd('0x1b'),'port':0x18eb});var socket=require(_0xeccd('0x1c'))(new Redis(config[_0xeccd('0x19')]));require(_0xeccd('0x1d'))[_0xeccd('0x1e')](socket);var jayson=require(_0xeccd('0x1f'));var client=jayson['client'][_0xeccd('0x20')]({'port':0x232c});var client9002=jayson[_0xeccd('0x21')][_0xeccd('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x475055,_0x38ff3c,_0x34e2e9,_0x23f18a){return new BPromise(function(_0x1631ac,_0xc21d0){var _0x1dcabe=_0x23f18a||client;return _0x1dcabe[_0xeccd('0x22')](_0x475055,_0x34e2e9)[_0xeccd('0x23')](function(_0x459f14){logger['info'](_0xeccd('0x24'),_0x38ff3c,_0xeccd('0x25'));logger[_0xeccd('0x26')](_0xeccd('0x27'),_0x38ff3c,_0xeccd('0x25'),JSON[_0xeccd('0x28')](_0x459f14));if(_0x459f14[_0xeccd('0x29')]){if(_0x459f14[_0xeccd('0x29')]['code']===0x1f4){logger['error'](_0xeccd('0x24'),_0x38ff3c,_0x459f14[_0xeccd('0x29')][_0xeccd('0x2a')]);return _0xc21d0(_0x459f14[_0xeccd('0x29')][_0xeccd('0x2a')]);}logger[_0xeccd('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x38ff3c,_0x459f14['error'][_0xeccd('0x2a')]);return _0x1631ac(_0x459f14['error'][_0xeccd('0x2a')]);}else{logger[_0xeccd('0x2b')](_0xeccd('0x24'),_0x38ff3c,_0xeccd('0x25'));_0x1631ac(_0x459f14[_0xeccd('0x2c')][_0xeccd('0x2a')]);}})[_0xeccd('0x2d')](function(_0x2fb1ef){logger[_0xeccd('0x29')](_0xeccd('0x24'),_0x38ff3c,_0x2fb1ef);_0xc21d0(_0x2fb1ef);});});}function respondWithStatusCode(_0x212ac6,_0x5a6d75){_0x5a6d75=_0x5a6d75||0xcc;return function(_0x548dea){if(_0x548dea){return _0x212ac6[_0xeccd('0x2e')](_0x5a6d75);}return _0x212ac6['status'](_0x5a6d75)[_0xeccd('0x2f')]();};}function respondWithResult(_0x37f0a2,_0x1db9c6){_0x1db9c6=_0x1db9c6||0xc8;return function(_0x385c20){if(_0x385c20){return _0x37f0a2[_0xeccd('0x30')](_0x1db9c6)[_0xeccd('0x31')](_0x385c20);}};}function respondWithFilteredResult(_0x329c88,_0x2ae70c){return function(_0xd1a5cd){if(_0xd1a5cd){var _0x395ab4=typeof _0x2ae70c['offset']==='undefined'&&typeof _0x2ae70c[_0xeccd('0x32')]===_0xeccd('0x33');var _0x3b7b05=_0xd1a5cd['count'];var _0x1732f3=_0x395ab4?0x0:_0x2ae70c[_0xeccd('0x34')];var _0x1fdc9b=_0x395ab4?_0xd1a5cd[_0xeccd('0x35')]:_0x2ae70c['offset']+_0x2ae70c[_0xeccd('0x32')];var _0x248aa5;if(_0x1fdc9b>=_0x3b7b05){_0x1fdc9b=_0x3b7b05;_0x248aa5=0xc8;}else{_0x248aa5=0xce;}_0x329c88[_0xeccd('0x30')](_0x248aa5);return _0x329c88['set'](_0xeccd('0x36'),_0x1732f3+'-'+_0x1fdc9b+'/'+_0x3b7b05)[_0xeccd('0x31')](_0xd1a5cd);}return null;};}function patchUpdates(_0x250ee5){return function(_0x1959fd){try{jsonpatch[_0xeccd('0x37')](_0x1959fd,_0x250ee5,!![]);}catch(_0x301031){return BPromise[_0xeccd('0x38')](_0x301031);}return _0x1959fd[_0xeccd('0x39')]();};}function saveUpdates(_0x50031a,_0x120020){return function(_0x3fa34d){if(_0x3fa34d){return _0x3fa34d[_0xeccd('0x3a')](_0x50031a)['then'](function(_0x210518){return _0x210518;});}return null;};}function removeEntity(_0x35a727,_0x3a1d6c){return function(_0x2e61f3){if(_0x2e61f3){return _0x2e61f3[_0xeccd('0x3b')]()[_0xeccd('0x23')](function(){_0x35a727['status'](0xcc)[_0xeccd('0x2f')]();});}};}function handleEntityNotFound(_0x9f94ba,_0x1b9c52){return function(_0x16832e){if(!_0x16832e){_0x9f94ba[_0xeccd('0x2e')](0x194);}return _0x16832e;};}function handleError(_0x5ebe84,_0x4f16b2){_0x4f16b2=_0x4f16b2||0x1f4;return function(_0x1b2ceb){logger[_0xeccd('0x29')](_0x1b2ceb['stack']);if(_0x1b2ceb[_0xeccd('0x3c')]){delete _0x1b2ceb[_0xeccd('0x3c')];}_0x5ebe84[_0xeccd('0x30')](_0x4f16b2)[_0xeccd('0x3d')](_0x1b2ceb);};}exports[_0xeccd('0x3e')]=function(_0x35d975,_0xe9e62b){var _0x3de5c4={},_0x44b4d0={},_0x56d1f6={'count':0x0,'rows':[]};var _0x494647=_[_0xeccd('0x3f')](db[_0xeccd('0x40')]['rawAttributes'],function(_0x29f122){return{'name':_0x29f122['fieldName'],'type':_0x29f122[_0xeccd('0x41')][_0xeccd('0x42')]};});_0x44b4d0[_0xeccd('0x43')]=_[_0xeccd('0x3f')](_0x494647,_0xeccd('0x3c'));_0x44b4d0[_0xeccd('0x44')]=_['keys'](_0x35d975[_0xeccd('0x44')]);_0x44b4d0[_0xeccd('0x45')]=_[_0xeccd('0x46')](_0x44b4d0['model'],_0x44b4d0[_0xeccd('0x44')]);_0x3de5c4['attributes']=_[_0xeccd('0x46')](_0x44b4d0[_0xeccd('0x43')],qs[_0xeccd('0x47')](_0x35d975[_0xeccd('0x44')][_0xeccd('0x47')]));_0x3de5c4['attributes']=_0x3de5c4[_0xeccd('0x48')]['length']?_0x3de5c4['attributes']:_0x44b4d0[_0xeccd('0x43')];if(!_0x35d975[_0xeccd('0x44')][_0xeccd('0x49')](_0xeccd('0x4a'))){_0x3de5c4['limit']=qs['limit'](_0x35d975[_0xeccd('0x44')]['limit']);_0x3de5c4['offset']=qs[_0xeccd('0x34')](_0x35d975[_0xeccd('0x44')][_0xeccd('0x34')]);}_0x3de5c4['order']=qs[_0xeccd('0x4b')](_0x35d975[_0xeccd('0x44')]['sort']);_0x3de5c4[_0xeccd('0x4c')]=qs[_0xeccd('0x45')](_[_0xeccd('0x4d')](_0x35d975[_0xeccd('0x44')],_0x44b4d0[_0xeccd('0x45')]),_0x494647);if(_0x35d975[_0xeccd('0x44')]['filter']){_0x3de5c4[_0xeccd('0x4c')]=_['merge'](_0x3de5c4['where'],{'$or':_[_0xeccd('0x3f')](_0x494647,function(_0x4cbd11){if(_0x4cbd11[_0xeccd('0x41')]!==_0xeccd('0x4e')){var _0x5eb364={};_0x5eb364[_0x4cbd11[_0xeccd('0x3c')]]={'$like':'%'+_0x35d975[_0xeccd('0x44')][_0xeccd('0x4f')]+'%'};return _0x5eb364;}})});}_0x3de5c4=_[_0xeccd('0x50')]({},_0x3de5c4,_0x35d975[_0xeccd('0x51')]);var _0x3634c8={'where':_0x3de5c4[_0xeccd('0x4c')]};return db[_0xeccd('0x40')][_0xeccd('0x35')](_0x3634c8)[_0xeccd('0x23')](function(_0x1df2c2){_0x56d1f6['count']=_0x1df2c2;if(_0x35d975[_0xeccd('0x44')][_0xeccd('0x52')]){_0x3de5c4[_0xeccd('0x53')]=[{'all':!![]}];}return db[_0xeccd('0x40')]['findAll'](_0x3de5c4);})[_0xeccd('0x23')](function(_0x3fecf3){_0x56d1f6[_0xeccd('0x54')]=_0x3fecf3;return _0x56d1f6;})['then'](respondWithFilteredResult(_0xe9e62b,_0x3de5c4))[_0xeccd('0x2d')](handleError(_0xe9e62b,null));};exports[_0xeccd('0x55')]=function(_0x222df1,_0xf8389f){var _0x3e73ae={'raw':!![],'where':{'id':_0x222df1[_0xeccd('0x56')]['id']}},_0x3e0d20={};_0x3e0d20[_0xeccd('0x43')]=_['keys'](db[_0xeccd('0x40')][_0xeccd('0x57')]);_0x3e0d20[_0xeccd('0x44')]=_[_0xeccd('0x58')](_0x222df1[_0xeccd('0x44')]);_0x3e0d20[_0xeccd('0x45')]=_[_0xeccd('0x46')](_0x3e0d20[_0xeccd('0x43')],_0x3e0d20[_0xeccd('0x44')]);_0x3e73ae[_0xeccd('0x48')]=_[_0xeccd('0x46')](_0x3e0d20['model'],qs[_0xeccd('0x47')](_0x222df1[_0xeccd('0x44')]['fields']));_0x3e73ae[_0xeccd('0x48')]=_0x3e73ae['attributes'][_0xeccd('0x59')]?_0x3e73ae['attributes']:_0x3e0d20[_0xeccd('0x43')];if(_0x222df1[_0xeccd('0x44')][_0xeccd('0x52')]){_0x3e73ae[_0xeccd('0x53')]=[{'all':!![]}];}_0x3e73ae=_[_0xeccd('0x50')]({},_0x3e73ae,_0x222df1[_0xeccd('0x51')]);return db['OpenchannelMessage'][_0xeccd('0x5a')](_0x3e73ae)['then'](handleEntityNotFound(_0xf8389f,null))[_0xeccd('0x23')](respondWithResult(_0xf8389f,null))[_0xeccd('0x2d')](handleError(_0xf8389f,null));};exports[_0xeccd('0x5b')]=function(_0x4f0aea,_0x326a53){return db[_0xeccd('0x40')]['create'](_0x4f0aea[_0xeccd('0x5c')],{})[_0xeccd('0x23')](respondWithResult(_0x326a53,0xc9))[_0xeccd('0x2d')](handleError(_0x326a53,null));};exports[_0xeccd('0x3a')]=function(_0x4d9616,_0x11ecc9){if(_0x4d9616['body']['id']){delete _0x4d9616[_0xeccd('0x5c')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x4d9616[_0xeccd('0x56')]['id']}})[_0xeccd('0x23')](handleEntityNotFound(_0x11ecc9,null))['then'](saveUpdates(_0x4d9616[_0xeccd('0x5c')],null))[_0xeccd('0x23')](respondWithResult(_0x11ecc9,null))[_0xeccd('0x2d')](handleError(_0x11ecc9,null));};exports[_0xeccd('0x3b')]=function(_0x258239,_0x53d370){return db[_0xeccd('0x40')][_0xeccd('0x5a')]({'where':{'id':_0x258239[_0xeccd('0x56')]['id']}})['then'](handleEntityNotFound(_0x53d370,null))[_0xeccd('0x23')](removeEntity(_0x53d370,null))['catch'](handleError(_0x53d370,null));};exports[_0xeccd('0x5d')]=function(_0xf85115,_0x19d207){return db[_0xeccd('0x40')][_0xeccd('0x5d')]()[_0xeccd('0x23')](respondWithResult(_0x19d207,null))[_0xeccd('0x2d')](handleError(_0x19d207,null));};var interaction_log=require(_0xeccd('0x13'))(_0xeccd('0x5e'));exports[_0xeccd('0x5f')]=function(_0x3650cd,_0x530f59,_0x2d80d7){var _0x2c83ee={'agent':{},'channel':_0xeccd('0x60')};if(_0x3650cd['body']['id']){delete _0x3650cd['body']['id'];}_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x61')]=!![];_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x63')]=_0x3650cd['body']['UserId']||_0x3650cd[_0xeccd('0x64')]['id'];_0x2c83ee[_0xeccd('0x65')]['id']=_0x3650cd[_0xeccd('0x5c')]['UserId'];return db['OpenchannelMessage'][_0xeccd('0x5a')]({'where':{'id':_0x3650cd[_0xeccd('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x530f59,null))[_0xeccd('0x23')](saveUpdates(_0x3650cd[_0xeccd('0x5c')],null))['then'](function(_0x291f08){if(_0x291f08){_0x2c83ee[_0xeccd('0x2a')]=_0x291f08[_0xeccd('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0xeccd('0x5a')]({'where':{'id':_0x291f08[_0xeccd('0x67')]}});}return null;})[_0xeccd('0x23')](handleEntityNotFound(_0x530f59,null))[_0xeccd('0x23')](function(_0x12abd8){if(_0x12abd8){return _0x12abd8['update']({'UserId':_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x63')],'read1stAt':_[_0xeccd('0x68')](_0x12abd8[_0xeccd('0x69')])?moment()['format'](_0xeccd('0x6a')):undefined});}return null;})[_0xeccd('0x23')](function(_0x53e931){if(_0x53e931){_0x2c83ee[_0xeccd('0x6b')]=_0x53e931[_0xeccd('0x66')]({'plain':!![]});interaction_log[_0xeccd('0x2b')](_0xeccd('0x6c'),_0x3650cd[_0xeccd('0x64')]['id'],_0x3650cd[_0xeccd('0x64')]['name'],_0x3650cd[_0xeccd('0x64')][_0xeccd('0x6d')],_0x2c83ee[_0xeccd('0x6b')]['id'],_0x3650cd[_0xeccd('0x5c')]?JSON['stringify'](_0x3650cd[_0xeccd('0x5c')]):_0xeccd('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xeccd('0x6f'),_0x2c83ee);}return null;})['then'](function(_0x4a8c43){var _0x562d8b=_0xeccd('0x70')+_0x4a8c43['message']['ContactId'];return db[_0xeccd('0x71')][_0xeccd('0x44')](_0x562d8b,{'type':db['Sequelize']['QueryTypes'][_0xeccd('0x72')],'raw':!![]})[_0xeccd('0x23')](function(_0x12f84f){return _0x12f84f;});})[_0xeccd('0x23')](function(_0x3c64fe){if(_0x3c64fe){_0x2c83ee['message'][_0xeccd('0x73')]=_0x3c64fe[0x0];if(!_0x3650cd[_0xeccd('0x5c')]['UserId'])return;return db['User'][_0xeccd('0x5a')]({'where':{'id':_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x63')],'role':_0xeccd('0x65')},'attributes':['id',_0xeccd('0x3c'),_0xeccd('0x74'),_0xeccd('0x75'),_0xeccd('0x76')],'raw':!![]});}return null;})[_0xeccd('0x23')](function(_0x51ecef){if(!_0x51ecef)return null;_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x65')]=_0x51ecef;return _0x2c83ee;})[_0xeccd('0x23')](function(_0x32698a){if(_0x32698a){if(_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x77')]){_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x78')]=util[_0xeccd('0x79')](_0xeccd('0x7a'),_0x3650cd[_0xeccd('0x64')][_0xeccd('0x3c')]);_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x7b')]=_0x2c83ee[_0xeccd('0x7b')];_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x7c')]=_0x2c83ee['channel'];_0x2c83ee['message'][_0xeccd('0x7d')]=_0xeccd('0x5f');return respondWithRpcPromise(_0xeccd('0x7e'),_0xeccd('0x7e'),{'event':_0xeccd('0x7f'),'message':_0x2c83ee[_0xeccd('0x2a')]},client9002)['then'](function(){return _0x2c83ee;});}return _0x2c83ee;}return null;})[_0xeccd('0x23')](respondWithResult(_0x530f59,null))[_0xeccd('0x2d')](handleError(_0x530f59,null));};var interaction_log=require(_0xeccd('0x13'))(_0xeccd('0x5e'));exports[_0xeccd('0x38')]=function(_0x36e0a1,_0x1caf74,_0x3fefc0){var _0x18f379={'agent':{},'channel':_0xeccd('0x60')};if(_0x36e0a1[_0xeccd('0x5c')]['id']){delete _0x36e0a1[_0xeccd('0x5c')]['id'];}_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')]=_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')]||_0x36e0a1[_0xeccd('0x64')]['id'];_0x18f379['agent']['id']=_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')];return db[_0xeccd('0x40')][_0xeccd('0x5a')]({'where':{'id':_0x36e0a1[_0xeccd('0x56')]['id'],'UserId':null}})[_0xeccd('0x23')](handleEntityNotFound(_0x1caf74,null))[_0xeccd('0x23')](function(_0x2e7c6c){if(_0x2e7c6c){_0x18f379[_0xeccd('0x2a')]=_0x2e7c6c['get']({'plain':!![]});return db[_0xeccd('0x80')][_0xeccd('0x5a')]({'where':{'id':_0x2e7c6c['OpenchannelInteractionId']}});}return null;})[_0xeccd('0x23')](handleEntityNotFound(_0x1caf74,null))['then'](function(_0x39c464){if(_0x39c464){_0x18f379[_0xeccd('0x6b')]=_0x39c464['get']({'plain':!![]});interaction_log[_0xeccd('0x2b')](_0xeccd('0x81'),_0x36e0a1['user']['id'],_0x36e0a1[_0xeccd('0x64')][_0xeccd('0x3c')],_0x36e0a1[_0xeccd('0x64')][_0xeccd('0x6d')],_0x18f379[_0xeccd('0x6b')]['id'],_0x36e0a1['body']?JSON[_0xeccd('0x28')](_0x36e0a1[_0xeccd('0x5c')]):_0xeccd('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x18f379);}return null;})[_0xeccd('0x23')](function(_0x1b0ba4){var _0x58871e=_0xeccd('0x70')+_0x1b0ba4['message'][_0xeccd('0x82')];return db[_0xeccd('0x71')][_0xeccd('0x44')](_0x58871e,{'type':db[_0xeccd('0x83')][_0xeccd('0x84')][_0xeccd('0x72')],'raw':!![]})['then'](function(_0x296d9e){return _0x296d9e;});})['then'](function(_0x2cbcd7){if(_0x2cbcd7){_0x18f379[_0xeccd('0x2a')][_0xeccd('0x73')]=_0x2cbcd7[0x0];if(!_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')])return;return db[_0xeccd('0x85')][_0xeccd('0x5a')]({'where':{'id':_0x36e0a1['body'][_0xeccd('0x63')],'role':_0xeccd('0x65')},'attributes':['id','name',_0xeccd('0x74'),_0xeccd('0x75'),_0xeccd('0x76')],'raw':!![]});}return null;})['then'](function(_0x30777d){if(!_0x30777d)return null;_0x18f379['message'][_0xeccd('0x65')]=_0x30777d;return _0x18f379;})['then'](function(_0x4297e5){if(_0x4297e5){_0x4297e5[_0xeccd('0x2a')][_0xeccd('0x78')]=util[_0xeccd('0x79')](_0xeccd('0x7a'),_0x36e0a1[_0xeccd('0x64')]['name']);_0x4297e5[_0xeccd('0x2a')][_0xeccd('0x7b')]=_0x18f379['channel'];_0x4297e5[_0xeccd('0x2a')]['motionChannel']=_0x18f379['channel'];_0x4297e5['message'][_0xeccd('0x7d')]='reject';respondWithRpcPromise(_0xeccd('0x7e'),_0xeccd('0x7e'),{'event':_0xeccd('0x86'),'message':_0x4297e5[_0xeccd('0x2a')]},client9002);return _0x18f379;}return null;})['then'](respondWithResult(_0x1caf74,null))[_0xeccd('0x2d')](handleError(_0x1caf74,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 402879d..385b000 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd53=['update','emit','hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xdd53,0xcc));var _0x3dd5=function(_0x520fa2,_0x4ec24e){_0x520fa2=_0x520fa2-0x0;var _0x5921d1=_0xdd53[_0x520fa2];return _0x5921d1;};'use strict';var EventEmitter=require(_0x3dd5('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x3dd5('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3dd5('0x2')](0x0);var events={'afterCreate':_0x3dd5('0x3'),'afterUpdate':_0x3dd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x26ac69){return function(_0x1f21a2,_0x2ee11d,_0x371f14){OpenchannelMessageEvents[_0x3dd5('0x5')](_0x26ac69+':'+_0x1f21a2['id'],_0x1f21a2);OpenchannelMessageEvents['emit'](_0x26ac69,_0x1f21a2);_0x371f14(null);};}for(var e in events){if(events[_0x3dd5('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x3dd5('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xfd03=['update','remove','emit','hook','events','../../mysqldb','OpenchannelMessage','save'];(function(_0x44f698,_0x3a2b2b){var _0x4a1308=function(_0x4af522){while(--_0x4af522){_0x44f698['push'](_0x44f698['shift']());}};_0x4a1308(++_0x3a2b2b);}(_0xfd03,0x1b4));var _0x3fd0=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xfd03[_0x4fa0ea];return _0x51d027;};'use strict';var EventEmitter=require(_0x3fd0('0x0'));var OpenchannelMessage=require(_0x3fd0('0x1'))['db'][_0x3fd0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3fd0('0x3'),'afterUpdate':_0x3fd0('0x4'),'afterDestroy':_0x3fd0('0x5')};function emitEvent(_0x50a4a2){return function(_0xc5f816,_0x31c2fd,_0x15387e){OpenchannelMessageEvents[_0x3fd0('0x6')](_0x50a4a2+':'+_0xc5f816['id'],_0xc5f816);OpenchannelMessageEvents[_0x3fd0('0x6')](_0x50a4a2,_0xc5f816);_0x15387e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x3fd0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 379cfd2..82d8fc2 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdec4=['direction','toLowerCase','out','secret','isNil','UserId','findOne','then','error','describe','OpenchannelAccount','find','OpenchannelInteraction','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','omit','POST','info','format','threadId','Interaction','update','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get'];(function(_0x27c42a,_0x2c6c0d){var _0x57a504=function(_0x12508d){while(--_0x12508d){_0x27c42a['push'](_0x27c42a['shift']());}};_0x57a504(++_0x2c6c0d);}(_0xdec4,0x146));var _0x4dec=function(_0x513980,_0xdb33f1){_0x513980=_0x513980-0x0;var _0x5cbcfe=_0xdec4[_0x513980];return _0x5cbcfe;};'use strict';var _=require('lodash');var util=require(_0x4dec('0x0'));var logger=require(_0x4dec('0x1'))(_0x4dec('0x2'));var moment=require(_0x4dec('0x3'));var BPromise=require(_0x4dec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4dec('0x5'));var rimraf=require(_0x4dec('0x6'));var config=require(_0x4dec('0x7'));var attributes=require(_0x4dec('0x8'));module[_0x4dec('0x9')]=function(_0x3a6547,_0x4a5728){return _0x3a6547['define'](_0x4dec('0xa'),attributes,{'tableName':_0x4dec('0xb'),'paranoid':![],'indexes':[{'name':_0x4dec('0xc'),'fields':[_0x4dec('0xd')],'type':_0x4dec('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44b083,_0x4fe5fb,_0x2d12a0){var _0x2d708b=_0x3a6547[_0x4dec('0xf')];var _0x1e5290=_0x44b083[_0x4dec('0x10')]({'plain':!![]});if(_0x1e5290[_0x4dec('0x11')][_0x4dec('0x12')]()==='in'||_0x1e5290[_0x4dec('0x11')][_0x4dec('0x12')]()===_0x4dec('0x13')&&!_0x1e5290[_0x4dec('0x14')]&&!_[_0x4dec('0x15')](_0x1e5290[_0x4dec('0x16')])){_0x2d708b['OpenchannelInteraction'][_0x4dec('0x17')]({'where':{'id':_0x1e5290['OpenchannelInteractionId']}})[_0x4dec('0x18')](function(_0x409fd9){if(_0x409fd9){_0x409fd9['update']({'lastMsgAt':_0x1e5290['createdAt'],'lastMsgDirection':_0x1e5290['direction']['toLowerCase']()});}})['catch'](function(_0x117aa4){console[_0x4dec('0x19')](_0x117aa4);});}if(_0x1e5290[_0x4dec('0x11')]===_0x4dec('0x13')&&!_0x1e5290[_0x4dec('0x14')]){var _0x20c761;_0x2d708b['CmContact'][_0x4dec('0x1a')]()['then'](function(_0x319fee){return _0x2d708b[_0x4dec('0x1b')][_0x4dec('0x1c')]({'where':{'id':_0x1e5290['OpenchannelAccountId']},'include':[{'model':_0x2d708b[_0x4dec('0x1d')],'as':_0x4dec('0x1e'),'where':{'id':_0x1e5290[_0x4dec('0x1f')]},'limit':0x1,'include':[{'model':_0x2d708b[_0x4dec('0x20')],'as':_0x4dec('0x21'),'attributes':_[_0x4dec('0x22')](_0x319fee)}]}]});})[_0x4dec('0x18')](function(_0x38de13){_0x20c761=_0x38de13['get']({'plain':!![]});if(_0x20c761&&_0x20c761[_0x4dec('0x23')]){logger['info'](_0x4dec('0x24'),_0x4dec('0x25'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x1e5290['id'],_0x20c761['replyUri']));if(_0x20c761['Interactions']&&_0x20c761['Interactions'][_0x4dec('0x26')]){_0x1e5290['Interaction']=_[_0x4dec('0x27')](_0x20c761['Interactions'][0x0],_0x4dec('0x21'));_0x1e5290[_0x4dec('0x21')]=_0x20c761[_0x4dec('0x1e')][0x0]['Contact'];}var _0x4fe5fb={'method':_0x4dec('0x28'),'uri':encodeURI(_0x20c761[_0x4dec('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4fe5fb['method']){case'GET':_0x4fe5fb['qs']=_0x1e5290;break;case'POST':_0x4fe5fb[_0x4dec('0xd')]=_0x1e5290;break;}return rp(_0x4fe5fb)[_0x4dec('0x18')](function(_0x38817e){logger[_0x4dec('0x29')](_0x4dec('0x24'),_0x4dec('0x25'),util[_0x4dec('0x2a')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1e5290['id'],_0x20c761[_0x4dec('0x23')]));if(_0x38817e[_0x4dec('0xd')][_0x4dec('0x2b')]&&_0x38817e[_0x4dec('0xd')]['threadId']!=_0x1e5290[_0x4dec('0x2c')][_0x4dec('0x2b')]){return _0x2d708b[_0x4dec('0x1d')][_0x4dec('0x2d')]({'threadId':_0x38817e[_0x4dec('0xd')][_0x4dec('0x2b')]},{'where':{'id':_0x1e5290[_0x4dec('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x44b083['update']({'read':!![]});})['catch'](function(_0x5b48b9){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x4dec('0x25'),util['inspect'](_0x5b48b9,{'showHidden':![],'depth':null}));_0x2d12a0();});}else{_0x2d12a0();}})[_0x4dec('0x2e')](function(){_0x2d12a0();});}else{_0x2d12a0();}}},'charset':_0x4dec('0x2f'),'collate':_0x4dec('0x30')});}; \ No newline at end of file +var _0x3461=['OpenchannelInteractionId','then','update','createdAt','catch','out','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','finally','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x5e40a3,_0x3d7c6){var _0x38c47f=function(_0x3a4041){while(--_0x3a4041){_0x5e40a3['push'](_0x5e40a3['shift']());}};_0x38c47f(++_0x3d7c6);}(_0x3461,0x1b6));var _0x1346=function(_0x24b168,_0x286dae){_0x24b168=_0x24b168-0x0;var _0xe99b4d=_0x3461[_0x24b168];return _0xe99b4d;};'use strict';var _=require(_0x1346('0x0'));var util=require(_0x1346('0x1'));var logger=require('../../config/logger')(_0x1346('0x2'));var moment=require('moment');var BPromise=require(_0x1346('0x3'));var rp=require(_0x1346('0x4'));var fs=require('fs');var path=require(_0x1346('0x5'));var rimraf=require(_0x1346('0x6'));var config=require(_0x1346('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x1346('0x8')]=function(_0x320edb,_0x5b69b9){return _0x320edb['define']('OpenchannelMessage',attributes,{'tableName':_0x1346('0x9'),'paranoid':![],'indexes':[{'name':_0x1346('0xa'),'fields':[_0x1346('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe92919,_0x2f3e13,_0x5462ed){var _0x1254b7=_0x320edb[_0x1346('0xc')];var _0x3c97ac=_0xe92919[_0x1346('0xd')]({'plain':!![]});if(_0x3c97ac[_0x1346('0xe')][_0x1346('0xf')]()==='in'||_0x3c97ac['direction']['toLowerCase']()==='out'&&!_0x3c97ac[_0x1346('0x10')]&&!_[_0x1346('0x11')](_0x3c97ac[_0x1346('0x12')])){_0x1254b7[_0x1346('0x13')][_0x1346('0x14')]({'where':{'id':_0x3c97ac[_0x1346('0x15')]}})[_0x1346('0x16')](function(_0x378b26){if(_0x378b26){_0x378b26[_0x1346('0x17')]({'lastMsgAt':_0x3c97ac[_0x1346('0x18')],'lastMsgDirection':_0x3c97ac[_0x1346('0xe')][_0x1346('0xf')]()});}})[_0x1346('0x19')](function(_0x2c1e4d){console['error'](_0x2c1e4d);});}if(_0x3c97ac[_0x1346('0xe')]===_0x1346('0x1a')&&!_0x3c97ac[_0x1346('0x10')]){var _0x488c88;_0x1254b7[_0x1346('0x1b')][_0x1346('0x1c')]()[_0x1346('0x16')](function(_0xf40c8c){return _0x1254b7[_0x1346('0x1d')][_0x1346('0x1e')]({'where':{'id':_0x3c97ac['OpenchannelAccountId']},'include':[{'model':_0x1254b7[_0x1346('0x13')],'as':_0x1346('0x1f'),'where':{'id':_0x3c97ac[_0x1346('0x15')]},'limit':0x1,'include':[{'model':_0x1254b7[_0x1346('0x1b')],'as':_0x1346('0x20'),'attributes':_[_0x1346('0x21')](_0xf40c8c)}]}]});})['then'](function(_0x41fa99){_0x488c88=_0x41fa99['get']({'plain':!![]});if(_0x488c88&&_0x488c88[_0x1346('0x22')]){logger['info'](_0x1346('0x23'),'afterCreate',util[_0x1346('0x24')](_0x1346('0x25'),_0x3c97ac['id'],_0x488c88[_0x1346('0x22')]));if(_0x488c88[_0x1346('0x1f')]&&_0x488c88[_0x1346('0x1f')][_0x1346('0x26')]){_0x3c97ac[_0x1346('0x27')]=_[_0x1346('0x28')](_0x488c88[_0x1346('0x1f')][0x0],_0x1346('0x20'));_0x3c97ac[_0x1346('0x20')]=_0x488c88[_0x1346('0x1f')][0x0]['Contact'];}var _0x2f3e13={'method':_0x1346('0x29'),'uri':encodeURI(_0x488c88[_0x1346('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2f3e13['method']){case _0x1346('0x2a'):_0x2f3e13['qs']=_0x3c97ac;break;case _0x1346('0x29'):_0x2f3e13['body']=_0x3c97ac;break;}return rp(_0x2f3e13)[_0x1346('0x16')](function(_0x207bc6){logger[_0x1346('0x2b')](_0x1346('0x23'),_0x1346('0x2c'),util[_0x1346('0x24')](_0x1346('0x2d'),_0x3c97ac['id'],_0x488c88[_0x1346('0x22')]));if(_0x207bc6[_0x1346('0xb')][_0x1346('0x2e')]&&_0x207bc6[_0x1346('0xb')]['threadId']!=_0x3c97ac[_0x1346('0x27')][_0x1346('0x2e')]){return _0x1254b7['OpenchannelInteraction']['update']({'threadId':_0x207bc6[_0x1346('0xb')][_0x1346('0x2e')]},{'where':{'id':_0x3c97ac[_0x1346('0x27')]['id']}});}else{return;}})[_0x1346('0x16')](function(){return _0xe92919['update']({'read':!![]});})[_0x1346('0x19')](function(_0x5e389c){logger[_0x1346('0x2f')](_0x1346('0x23'),_0x1346('0x2c'),util[_0x1346('0x30')](_0x5e389c,{'showHidden':![],'depth':null}));_0x5462ed();});}else{_0x5462ed();}})[_0x1346('0x31')](function(){_0x5462ed();});}else{_0x5462ed();}}},'charset':'utf8mb4','collate':_0x1346('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index c9be50c..8e17019 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x51d625,_0x19c44d){var _0x291e93=function(_0x292869){while(--_0x292869){_0x51d625['push'](_0x51d625['shift']());}};_0x291e93(++_0x19c44d);}(_0xadb5,0xad));var _0x5adb=function(_0x5ab9f9,_0x388022){_0x5ab9f9=_0x5ab9f9-0x0;var _0x4cf527=_0xadb5[_0x5ab9f9];return _0x4cf527;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2d167b,_0x44ef83){var _0x2e6a5c=function(_0x5a0746){while(--_0x5a0746){_0x2d167b['push'](_0x2d167b['shift']());}};_0x2e6a5c(++_0x44ef83);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 77ba585..733b923 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5559=['save','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x5559,0x1af));var _0x9555=function(_0x4c7a89,_0x3b5dd5){_0x4c7a89=_0x4c7a89-0x0;var _0x17a564=_0x5559[_0x4c7a89];return _0x17a564;};'use strict';var OpenchannelMessageEvents=require(_0x9555('0x0'));var events=[_0x9555('0x1'),'remove','update'];function createListener(_0x52e3f6,_0x4b624b){return function(_0x4bc1a7){_0x4b624b[_0x9555('0x2')](_0x52e3f6,_0x4bc1a7);};}function removeListener(_0x1d40a9,_0x3bdd89){return function(){OpenchannelMessageEvents['removeListener'](_0x1d40a9,_0x3bdd89);};}exports[_0x9555('0x3')]=function(_0x57cac5){for(var _0x5c9dc7=0x0,_0x20e405=events[_0x9555('0x4')];_0x5c9dc7<_0x20e405;_0x5c9dc7++){var _0xe0be93=events[_0x5c9dc7];var _0x3428ed=createListener(_0x9555('0x5')+_0xe0be93,_0x57cac5);OpenchannelMessageEvents['on'](_0xe0be93,_0x3428ed);}}; \ No newline at end of file +var _0x37a7=['openchannelMessage:','./openchannelMessage.events','save','removeListener','register'];(function(_0x124269,_0x161b31){var _0x231ac3=function(_0x297925){while(--_0x297925){_0x124269['push'](_0x124269['shift']());}};_0x231ac3(++_0x161b31);}(_0x37a7,0x6f));var _0x737a=function(_0x15f602,_0x28d602){_0x15f602=_0x15f602-0x0;var _0x4a7377=_0x37a7[_0x15f602];return _0x4a7377;};'use strict';var OpenchannelMessageEvents=require(_0x737a('0x0'));var events=[_0x737a('0x1'),'remove','update'];function createListener(_0x5a259b,_0x2d4b54){return function(_0xc5eaef){_0x2d4b54['emit'](_0x5a259b,_0xc5eaef);};}function removeListener(_0x524516,_0x4af128){return function(){OpenchannelMessageEvents[_0x737a('0x2')](_0x524516,_0x4af128);};}exports[_0x737a('0x3')]=function(_0x7f4eed){for(var _0x11109c=0x0,_0x2f6800=events['length'];_0x11109c<_0x2f6800;_0x11109c++){var _0x244850=events[_0x11109c];var _0x249898=createListener(_0x737a('0x4')+_0x244850,_0x7f4eed);OpenchannelMessageEvents['on'](_0x244850,_0x249898);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c5b3b22..9d29235 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x736b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express'];(function(_0x39eb1e,_0x2925c1){var _0x3b3aaa=function(_0x296e7b){while(--_0x296e7b){_0x39eb1e['push'](_0x39eb1e['shift']());}};_0x3b3aaa(++_0x2925c1);}(_0x736b,0x10a));var _0xb736=function(_0x203a98,_0x5eb746){_0x203a98=_0x203a98-0x0;var _0x12baa7=_0x736b[_0x203a98];return _0x12baa7;};'use strict';var multer=require('multer');var util=require(_0xb736('0x0'));var path=require(_0xb736('0x1'));var timeout=require(_0xb736('0x2'));var express=require(_0xb736('0x3'));var router=express[_0xb736('0x4')]();var fs_extra=require(_0xb736('0x5'));var auth=require(_0xb736('0x6'));var interaction=require(_0xb736('0x7'));var config=require('../../config/environment');var controller=require(_0xb736('0x8'));router[_0xb736('0x9')]('/',auth[_0xb736('0xa')](),controller[_0xb736('0xb')]);router[_0xb736('0x9')](_0xb736('0xc'),auth[_0xb736('0xa')](),controller['describe']);router[_0xb736('0x9')](_0xb736('0xd'),auth['isAuthenticated'](),controller[_0xb736('0xe')]);router['get'](_0xb736('0xf'),auth[_0xb736('0xa')](),controller['getMembers']);router['get'](_0xb736('0x10'),auth['isAuthenticated'](),controller[_0xb736('0x11')]);router[_0xb736('0x9')](_0xb736('0x12'),auth[_0xb736('0xa')](),controller[_0xb736('0x13')]);router[_0xb736('0x14')]('/',auth['isAuthenticated'](),controller[_0xb736('0x15')]);router[_0xb736('0x14')]('/:id/teams',auth[_0xb736('0xa')](),controller[_0xb736('0x16')]);router[_0xb736('0x14')]('/:id/users',auth[_0xb736('0xa')](),controller[_0xb736('0x17')]);router[_0xb736('0x18')]('/:id',auth[_0xb736('0xa')](),controller[_0xb736('0x19')]);router[_0xb736('0x1a')](_0xb736('0xd'),auth['isAuthenticated'](),controller[_0xb736('0x1b')]);router[_0xb736('0x1a')]('/:id/teams',auth[_0xb736('0xa')](),controller[_0xb736('0x1c')]);router[_0xb736('0x1a')](_0xb736('0x12'),auth[_0xb736('0xa')](),controller[_0xb736('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x3365=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2952e8,_0xdebf50){var _0x3e4676=function(_0x34dc36){while(--_0x34dc36){_0x2952e8['push'](_0x2952e8['shift']());}};_0x3e4676(++_0xdebf50);}(_0x3365,0x1eb));var _0x5336=function(_0x19ff34,_0x19f930){_0x19ff34=_0x19ff34-0x0;var _0x5cd174=_0x3365[_0x19ff34];return _0x5cd174;};'use strict';var multer=require(_0x5336('0x0'));var util=require(_0x5336('0x1'));var path=require(_0x5336('0x2'));var timeout=require(_0x5336('0x3'));var express=require(_0x5336('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5336('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5336('0x6'));var controller=require(_0x5336('0x7'));router[_0x5336('0x8')]('/',auth[_0x5336('0x9')](),controller[_0x5336('0xa')]);router[_0x5336('0x8')](_0x5336('0xb'),auth[_0x5336('0x9')](),controller[_0x5336('0xc')]);router[_0x5336('0x8')](_0x5336('0xd'),auth['isAuthenticated'](),controller[_0x5336('0xe')]);router[_0x5336('0x8')](_0x5336('0xf'),auth[_0x5336('0x9')](),controller[_0x5336('0x10')]);router[_0x5336('0x8')](_0x5336('0x11'),auth['isAuthenticated'](),controller[_0x5336('0x12')]);router[_0x5336('0x8')]('/:id/users',auth[_0x5336('0x9')](),controller['getAgents']);router['post']('/',auth[_0x5336('0x9')](),controller[_0x5336('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x5336('0x14')]);router['post'](_0x5336('0x15'),auth[_0x5336('0x9')](),controller['addAgents']);router[_0x5336('0x16')]('/:id',auth[_0x5336('0x9')](),controller[_0x5336('0x17')]);router[_0x5336('0x18')](_0x5336('0xd'),auth['isAuthenticated'](),controller[_0x5336('0x19')]);router[_0x5336('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5336('0x1a')]);router['delete'](_0x5336('0x15'),auth[_0x5336('0x9')](),controller[_0x5336('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 251330a..db318c5 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc574=['STRING','name','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x52a1e3,_0x4788a1){var _0x1b2ce4=function(_0x5a4a36){while(--_0x5a4a36){_0x52a1e3['push'](_0x52a1e3['shift']());}};_0x1b2ce4(++_0x4788a1);}(_0xc574,0x1e8));var _0x4c57=function(_0xbfa157,_0x5d332f){_0xbfa157=_0xbfa157-0x0;var _0x1510c8=_0xc574[_0xbfa157];return _0x1510c8;};'use strict';var Sequelize=require(_0x4c57('0x0'));module[_0x4c57('0x1')]={'name':{'type':Sequelize[_0x4c57('0x2')],'unique':_0x4c57('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c57('0x2')]},'timeout':{'type':Sequelize[_0x4c57('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c57('0x5')]('rrmemory','beepall',_0x4c57('0x6'))}}; \ No newline at end of file +var _0x0b03=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x0b03,0x1a0));var _0x30b0=function(_0x174d5a,_0x11331d){_0x174d5a=_0x174d5a-0x0;var _0x28c59a=_0x0b03[_0x174d5a];return _0x28c59a;};'use strict';var Sequelize=require(_0x30b0('0x0'));module[_0x30b0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x30b0('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x30b0('0x3')](_0x30b0('0x4'),_0x30b0('0x5'),_0x30b0('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 857c7b1..156a9be 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb454=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','limit','undefined','count','set','reject','update','then','destroy','get','OpenchannelQueues','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','OpenchannelQueue','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','sequelize','transaction','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x396db0,_0x510b7d){var _0x11bc3c=function(_0x1ada79){while(--_0x1ada79){_0x396db0['push'](_0x396db0['shift']());}};_0x11bc3c(++_0x510b7d);}(_0xb454,0x19e));var _0x4b45=function(_0x53c4f8,_0x44ccaf){_0x53c4f8=_0x53c4f8-0x0;var _0x416458=_0xb454[_0x53c4f8];return _0x416458;};'use strict';var emlformat=require(_0x4b45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b45('0x1'));var jsonpatch=require(_0x4b45('0x2'));var rp=require(_0x4b45('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b45('0x4'));var path=require(_0x4b45('0x5'));var sox=require(_0x4b45('0x6'));var csv=require(_0x4b45('0x7'));var ejs=require(_0x4b45('0x8'));var fs=require('fs');var fs_extra=require(_0x4b45('0x9'));var _=require(_0x4b45('0xa'));var squel=require(_0x4b45('0xb'));var crypto=require('crypto');var jsforce=require(_0x4b45('0xc'));var deskjs=require(_0x4b45('0xd'));var toCsv=require(_0x4b45('0x7'));var querystring=require(_0x4b45('0xe'));var Papa=require(_0x4b45('0xf'));var Redis=require(_0x4b45('0x10'));var authService=require(_0x4b45('0x11'));var qs=require(_0x4b45('0x12'));var as=require(_0x4b45('0x13'));var hardwareService=require(_0x4b45('0x14'));var logger=require('../../config/logger')(_0x4b45('0x15'));var utils=require(_0x4b45('0x16'));var config=require(_0x4b45('0x17'));var licenseUtil=require(_0x4b45('0x18'));var db=require(_0x4b45('0x19'))['db'];config[_0x4b45('0x1a')]=_[_0x4b45('0x1b')](config[_0x4b45('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b45('0x1c'))(new Redis(config['redis']));require(_0x4b45('0x1d'))[_0x4b45('0x1e')](socket);function respondWithStatusCode(_0x2dfd13,_0x306a68){_0x306a68=_0x306a68||0xcc;return function(_0x58d88c){if(_0x58d88c){return _0x2dfd13['sendStatus'](_0x306a68);}return _0x2dfd13[_0x4b45('0x1f')](_0x306a68)[_0x4b45('0x20')]();};}function respondWithResult(_0x23d866,_0x27b2be){_0x27b2be=_0x27b2be||0xc8;return function(_0x320dfd){if(_0x320dfd){return _0x23d866['status'](_0x27b2be)[_0x4b45('0x21')](_0x320dfd);}};}function respondWithFilteredResult(_0x5ebb4e,_0x357d1f){return function(_0x5963f7){if(_0x5963f7){var _0xd4da7d=typeof _0x357d1f[_0x4b45('0x22')]==='undefined'&&typeof _0x357d1f[_0x4b45('0x23')]===_0x4b45('0x24');var _0x5b4e60=_0x5963f7['count'];var _0x4d2a93=_0xd4da7d?0x0:_0x357d1f[_0x4b45('0x22')];var _0x23ea64=_0xd4da7d?_0x5963f7[_0x4b45('0x25')]:_0x357d1f['offset']+_0x357d1f[_0x4b45('0x23')];var _0x4eaa96;if(_0x23ea64>=_0x5b4e60){_0x23ea64=_0x5b4e60;_0x4eaa96=0xc8;}else{_0x4eaa96=0xce;}_0x5ebb4e[_0x4b45('0x1f')](_0x4eaa96);return _0x5ebb4e[_0x4b45('0x26')]('Content-Range',_0x4d2a93+'-'+_0x23ea64+'/'+_0x5b4e60)['json'](_0x5963f7);}return null;};}function patchUpdates(_0x467f8e){return function(_0x34fab7){try{jsonpatch['apply'](_0x34fab7,_0x467f8e,!![]);}catch(_0x33bccb){return BPromise[_0x4b45('0x27')](_0x33bccb);}return _0x34fab7['save']();};}function saveUpdates(_0x4ce6e0,_0x23dac2){return function(_0x5763d7){if(_0x5763d7){return _0x5763d7[_0x4b45('0x28')](_0x4ce6e0)[_0x4b45('0x29')](function(_0x21ca3e){return _0x21ca3e;});}return null;};}function removeEntity(_0x2becfa,_0x3f2463){return function(_0x54e7f2){if(_0x54e7f2){return _0x54e7f2[_0x4b45('0x2a')]()[_0x4b45('0x29')](function(){var _0x5fb890=_0x54e7f2[_0x4b45('0x2b')]({'plain':!![]});var _0x14926e=_0x4b45('0x2c');return db['UserProfileResource'][_0x4b45('0x2a')]({'where':{'type':_0x14926e,'resourceId':_0x5fb890['id']}})['then'](function(){return _0x54e7f2;});})[_0x4b45('0x29')](function(){_0x2becfa[_0x4b45('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x483d93,_0x3a2e23){return function(_0x1f2124){if(!_0x1f2124){_0x483d93['sendStatus'](0x194);}return _0x1f2124;};}function handleError(_0x354cf9,_0x30f06c){_0x30f06c=_0x30f06c||0x1f4;return function(_0x21abc3){logger[_0x4b45('0x2d')](_0x21abc3[_0x4b45('0x2e')]);if(_0x21abc3['name']){delete _0x21abc3[_0x4b45('0x2f')];}_0x354cf9[_0x4b45('0x1f')](_0x30f06c)[_0x4b45('0x30')](_0x21abc3);};}exports['index']=function(_0x37d72d,_0x585c92){var _0x5b2743={},_0x5570b0={},_0x31af18={'count':0x0,'rows':[]};var _0x361788=_[_0x4b45('0x31')](db['OpenchannelQueue'][_0x4b45('0x32')],function(_0x2be150){return{'name':_0x2be150[_0x4b45('0x33')],'type':_0x2be150['type'][_0x4b45('0x34')]};});_0x5570b0['model']=_[_0x4b45('0x31')](_0x361788,'name');_0x5570b0[_0x4b45('0x35')]=_[_0x4b45('0x36')](_0x37d72d[_0x4b45('0x35')]);_0x5570b0[_0x4b45('0x37')]=_[_0x4b45('0x38')](_0x5570b0[_0x4b45('0x39')],_0x5570b0[_0x4b45('0x35')]);_0x5b2743[_0x4b45('0x3a')]=_['intersection'](_0x5570b0['model'],qs[_0x4b45('0x3b')](_0x37d72d[_0x4b45('0x35')]['fields']));_0x5b2743['attributes']=_0x5b2743[_0x4b45('0x3a')][_0x4b45('0x3c')]?_0x5b2743['attributes']:_0x5570b0[_0x4b45('0x39')];if(!_0x37d72d[_0x4b45('0x35')][_0x4b45('0x3d')](_0x4b45('0x3e'))){_0x5b2743[_0x4b45('0x23')]=qs['limit'](_0x37d72d[_0x4b45('0x35')]['limit']);_0x5b2743[_0x4b45('0x22')]=qs[_0x4b45('0x22')](_0x37d72d[_0x4b45('0x35')][_0x4b45('0x22')]);}_0x5b2743[_0x4b45('0x3f')]=qs[_0x4b45('0x40')](_0x37d72d[_0x4b45('0x35')]['sort']);_0x5b2743['where']=qs['filters'](_[_0x4b45('0x41')](_0x37d72d[_0x4b45('0x35')],_0x5570b0['filters']),_0x361788);if(_0x37d72d[_0x4b45('0x35')][_0x4b45('0x42')]){_0x5b2743[_0x4b45('0x43')]=_[_0x4b45('0x44')](_0x5b2743[_0x4b45('0x43')],{'$or':_[_0x4b45('0x31')](_0x361788,function(_0x48909c){if(_0x48909c[_0x4b45('0x45')]!==_0x4b45('0x46')){var _0x388942={};_0x388942[_0x48909c[_0x4b45('0x2f')]]={'$like':'%'+_0x37d72d[_0x4b45('0x35')][_0x4b45('0x42')]+'%'};return _0x388942;}})});}_0x5b2743=_[_0x4b45('0x44')]({},_0x5b2743,_0x37d72d[_0x4b45('0x47')]);var _0x4565b7={'where':_0x5b2743['where']};return db['OpenchannelQueue'][_0x4b45('0x25')](_0x4565b7)[_0x4b45('0x29')](function(_0x392b97){_0x31af18[_0x4b45('0x25')]=_0x392b97;if(_0x37d72d[_0x4b45('0x35')][_0x4b45('0x48')]){_0x5b2743[_0x4b45('0x49')]=[{'all':!![]}];}return db[_0x4b45('0x4a')][_0x4b45('0x4b')](_0x5b2743);})[_0x4b45('0x29')](function(_0x21bdb0){_0x31af18[_0x4b45('0x4c')]=_0x21bdb0;return _0x31af18;})[_0x4b45('0x29')](respondWithFilteredResult(_0x585c92,_0x5b2743))[_0x4b45('0x4d')](handleError(_0x585c92,null));};exports[_0x4b45('0x4e')]=function(_0x4f1a85,_0x96f775){var _0x2a4779={'raw':!![],'where':{'id':_0x4f1a85[_0x4b45('0x4f')]['id']}},_0x589cc7={};_0x589cc7[_0x4b45('0x39')]=_[_0x4b45('0x36')](db['OpenchannelQueue'][_0x4b45('0x32')]);_0x589cc7['query']=_[_0x4b45('0x36')](_0x4f1a85[_0x4b45('0x35')]);_0x589cc7[_0x4b45('0x37')]=_[_0x4b45('0x38')](_0x589cc7[_0x4b45('0x39')],_0x589cc7[_0x4b45('0x35')]);_0x2a4779['attributes']=_[_0x4b45('0x38')](_0x589cc7[_0x4b45('0x39')],qs[_0x4b45('0x3b')](_0x4f1a85[_0x4b45('0x35')][_0x4b45('0x3b')]));_0x2a4779['attributes']=_0x2a4779['attributes'][_0x4b45('0x3c')]?_0x2a4779['attributes']:_0x589cc7[_0x4b45('0x39')];if(_0x4f1a85['query'][_0x4b45('0x48')]){_0x2a4779[_0x4b45('0x49')]=[{'all':!![]}];}_0x2a4779=_['merge']({},_0x2a4779,_0x4f1a85[_0x4b45('0x47')]);return db['OpenchannelQueue'][_0x4b45('0x50')](_0x2a4779)[_0x4b45('0x29')](handleEntityNotFound(_0x96f775,null))['then'](respondWithResult(_0x96f775,null))[_0x4b45('0x4d')](handleError(_0x96f775,null));};exports[_0x4b45('0x51')]=function(_0x45d4f2,_0x4484eb){return db[_0x4b45('0x4a')][_0x4b45('0x51')](_0x45d4f2['body'],{})[_0x4b45('0x29')](function(_0x553312){var _0x58bbf0=_0x45d4f2[_0x4b45('0x52')][_0x4b45('0x2b')]({'plain':!![]});if(!_0x58bbf0)throw new Error(_0x4b45('0x53'));if(_0x58bbf0['role']===_0x4b45('0x52')){var _0x11ee0d=_0x553312[_0x4b45('0x2b')]({'plain':!![]});var _0x5957c4=_0x4b45('0x2c');return db[_0x4b45('0x54')]['find']({'where':{'name':_0x5957c4,'userProfileId':_0x58bbf0[_0x4b45('0x55')]},'raw':!![]})['then'](function(_0x4b7e6e){if(_0x4b7e6e&&_0x4b7e6e[_0x4b45('0x56')]===0x0){return db[_0x4b45('0x57')]['create']({'name':_0x11ee0d[_0x4b45('0x2f')],'resourceId':_0x11ee0d['id'],'type':_0x4b7e6e[_0x4b45('0x2f')],'sectionId':_0x4b7e6e['id']},{})[_0x4b45('0x29')](function(){return _0x553312;});}else{return _0x553312;}})[_0x4b45('0x4d')](function(_0x5b2cc4){logger[_0x4b45('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b2cc4);throw _0x5b2cc4;});}return _0x553312;})[_0x4b45('0x29')](respondWithResult(_0x4484eb,0xc9))[_0x4b45('0x4d')](handleError(_0x4484eb,null));};exports[_0x4b45('0x28')]=function(_0x6f287,_0x46c174){if(_0x6f287[_0x4b45('0x58')]['id']){delete _0x6f287[_0x4b45('0x58')]['id'];}return db[_0x4b45('0x4a')][_0x4b45('0x50')]({'where':{'id':_0x6f287['params']['id']}})['then'](handleEntityNotFound(_0x46c174,null))[_0x4b45('0x29')](saveUpdates(_0x6f287['body'],null))['then'](respondWithResult(_0x46c174,null))[_0x4b45('0x4d')](handleError(_0x46c174,null));};exports[_0x4b45('0x2a')]=function(_0x1578e9,_0x4151de){return db[_0x4b45('0x4a')][_0x4b45('0x50')]({'where':{'id':_0x1578e9[_0x4b45('0x4f')]['id']}})[_0x4b45('0x29')](handleEntityNotFound(_0x4151de,null))[_0x4b45('0x29')](removeEntity(_0x4151de,null))[_0x4b45('0x4d')](handleError(_0x4151de,null));};exports[_0x4b45('0x59')]=function(_0x244f9c,_0x34f51e){return db[_0x4b45('0x4a')][_0x4b45('0x59')]()[_0x4b45('0x29')](respondWithResult(_0x34f51e,null))[_0x4b45('0x4d')](handleError(_0x34f51e,null));};exports[_0x4b45('0x5a')]=function(_0x1ce788,_0x2b60d7,_0x36488b){var _0x57ba38={'raw':!![],'where':{}},_0xdf0063={},_0x29c7d7;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x1ce788[_0x4b45('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b60d7,null))[_0x4b45('0x29')](function(_0xf44084){if(_0xf44084){_0x29c7d7=_0xf44084[_0x4b45('0x2b')]({'plain':!![]});_0xdf0063[_0x4b45('0x39')]=_[_0x4b45('0x36')](db[_0x4b45('0x5b')][_0x4b45('0x32')]);_0xdf0063[_0x4b45('0x35')]=_[_0x4b45('0x36')](_0x1ce788['query']);_0xdf0063[_0x4b45('0x37')]=_[_0x4b45('0x38')](_0xdf0063[_0x4b45('0x39')],_0xdf0063[_0x4b45('0x35')]);_0x57ba38['attributes']=_['intersection'](_0xdf0063[_0x4b45('0x39')],qs[_0x4b45('0x3b')](_0x1ce788['query']['fields']));_0x57ba38['attributes']=_0x57ba38['attributes']['length']?_0x57ba38['attributes']:_0xdf0063[_0x4b45('0x39')];if(!_0x1ce788[_0x4b45('0x35')][_0x4b45('0x3d')]('nolimit')){_0x57ba38[_0x4b45('0x23')]=qs[_0x4b45('0x23')](_0x1ce788['query']['limit']);_0x57ba38[_0x4b45('0x22')]=qs[_0x4b45('0x22')](_0x1ce788[_0x4b45('0x35')][_0x4b45('0x22')]);}_0x57ba38[_0x4b45('0x3f')]=qs[_0x4b45('0x40')](_0x1ce788[_0x4b45('0x35')][_0x4b45('0x40')]);_0x57ba38[_0x4b45('0x43')]=qs[_0x4b45('0x37')](_[_0x4b45('0x41')](_0x1ce788[_0x4b45('0x35')],_0xdf0063[_0x4b45('0x37')]));_0x57ba38[_0x4b45('0x43')]['OpenchannelQueueId']=_0xf44084['id'];if(_0x1ce788[_0x4b45('0x35')][_0x4b45('0x42')]){_0x57ba38[_0x4b45('0x43')]=_[_0x4b45('0x44')](_0x57ba38[_0x4b45('0x43')],{'$or':_[_0x4b45('0x31')](_0x57ba38[_0x4b45('0x3a')],function(_0x3cdbea){var _0x354a52={};_0x354a52[_0x3cdbea]={'$like':'%'+_0x1ce788[_0x4b45('0x35')][_0x4b45('0x42')]+'%'};return _0x354a52;})});}_0x57ba38=_[_0x4b45('0x44')]({},_0x57ba38,_0x1ce788[_0x4b45('0x47')]);return db[_0x4b45('0x5b')][_0x4b45('0x4b')](_0x57ba38);}})[_0x4b45('0x29')](function(_0x13ff2c){if(_0x13ff2c){return db[_0x4b45('0x5c')][_0x4b45('0x5d')]({'where':{'id':_[_0x4b45('0x31')](_0x13ff2c,_0x4b45('0x5e')),'role':_0x4b45('0x5f')},'attributes':['id',_0x4b45('0x2f'),_0x4b45('0x60'),_0x4b45('0x61'),_0x4b45('0x62')]});}})[_0x4b45('0x29')](function(_0x431a35){if(_0x431a35){return{'count':_0x431a35[_0x4b45('0x25')],'rows':_[_0x4b45('0x31')](_0x431a35[_0x4b45('0x4c')],function(_0x328940){return{'membername':_0x328940['name'],'UserId':_0x328940['id'],'queue_name':_0x29c7d7[_0x4b45('0x2f')],'OpenchannelQueueId':_0x29c7d7['id'],'interface':util[_0x4b45('0x63')](_0x4b45('0x64'),_0x4b45('0x65'),_0x328940[_0x4b45('0x2f')]),'penalty':0x0,'paused':_0x328940[_0x4b45('0x60')],'createdAt':_0x328940['createdAt'],'updatedAt':_0x328940[_0x4b45('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2b60d7,_0x57ba38))[_0x4b45('0x4d')](handleError(_0x2b60d7,null));};exports[_0x4b45('0x66')]=function(_0x328f7d,_0x50a4d5,_0x40e546){var _0x193fdf={};var _0x217d06={};var _0x451467;var _0x7c9a1d;return db[_0x4b45('0x4a')][_0x4b45('0x67')]({'where':{'id':_0x328f7d['params']['id']}})[_0x4b45('0x29')](handleEntityNotFound(_0x50a4d5,null))['then'](function(_0xdf1cb2){if(_0xdf1cb2){_0x451467=_0xdf1cb2;_0x217d06[_0x4b45('0x39')]=_[_0x4b45('0x36')](db[_0x4b45('0x68')][_0x4b45('0x32')]);_0x217d06['query']=_[_0x4b45('0x36')](_0x328f7d['query']);_0x217d06['filters']=_['intersection'](_0x217d06[_0x4b45('0x39')],_0x217d06[_0x4b45('0x35')]);_0x193fdf['attributes']=_[_0x4b45('0x38')](_0x217d06['model'],qs['fields'](_0x328f7d[_0x4b45('0x35')][_0x4b45('0x3b')]));_0x193fdf['attributes']=_0x193fdf[_0x4b45('0x3a')][_0x4b45('0x3c')]?_0x193fdf['attributes']:_0x217d06['model'];_0x193fdf[_0x4b45('0x3f')]=qs[_0x4b45('0x40')](_0x328f7d[_0x4b45('0x35')][_0x4b45('0x40')]);_0x193fdf[_0x4b45('0x43')]=qs[_0x4b45('0x37')](_[_0x4b45('0x41')](_0x328f7d[_0x4b45('0x35')],_0x217d06[_0x4b45('0x37')]));if(_0x328f7d[_0x4b45('0x35')]['filter']){_0x193fdf[_0x4b45('0x43')]=_['merge'](_0x193fdf[_0x4b45('0x43')],{'$or':_[_0x4b45('0x31')](_0x193fdf[_0x4b45('0x3a')],function(_0x3940c9){var _0x449b09={};_0x449b09[_0x3940c9]={'$like':'%'+_0x328f7d[_0x4b45('0x35')][_0x4b45('0x42')]+'%'};return _0x449b09;})});}_0x193fdf=_[_0x4b45('0x44')]({},_0x193fdf,_0x328f7d[_0x4b45('0x47')]);return _0x451467[_0x4b45('0x66')](_0x193fdf);}})[_0x4b45('0x29')](function(_0x497a09){if(_0x497a09){_0x7c9a1d=_0x497a09['length'];if(!_0x328f7d[_0x4b45('0x35')]['hasOwnProperty'](_0x4b45('0x3e'))){_0x193fdf[_0x4b45('0x23')]=qs[_0x4b45('0x23')](_0x328f7d[_0x4b45('0x35')][_0x4b45('0x23')]);_0x193fdf[_0x4b45('0x22')]=qs[_0x4b45('0x22')](_0x328f7d[_0x4b45('0x35')][_0x4b45('0x22')]);}return _0x451467[_0x4b45('0x66')](_0x193fdf);}})[_0x4b45('0x29')](function(_0x3366db){if(_0x3366db){return _0x3366db?{'count':_0x7c9a1d,'rows':_0x3366db}:null;}})[_0x4b45('0x29')](respondWithResult(_0x50a4d5,null))[_0x4b45('0x4d')](handleError(_0x50a4d5,null));};exports[_0x4b45('0x69')]=function(_0x2e776d,_0x46eea8,_0x1e4dd0){var _0x1d7a46=_0x2e776d[_0x4b45('0x58')][_0x4b45('0x6a')];return db[_0x4b45('0x68')]['findAll']({'where':{'id':_0x1d7a46},'attributes':['id'],'include':[{'model':db[_0x4b45('0x5c')],'as':_0x4b45('0x6b'),'attributes':['id',_0x4b45('0x2f'),_0x4b45('0x6c'),_0x4b45('0x6d'),'interface'],'raw':!![]}]})[_0x4b45('0x29')](function(_0x2cf52e){if(_0x2cf52e){var _0x2a4619=_[_0x4b45('0x6e')](_0x2cf52e,function(_0x5544ce){var _0x4a6627=_0x5544ce['get']({'plain':!![]});return _0x4a6627[_0x4b45('0x6b')];});return db[_0x4b45('0x4a')][_0x4b45('0x50')]({'where':{'id':_0x2e776d[_0x4b45('0x4f')]['id']}})[_0x4b45('0x29')](function(_0x149ec9){return db['sequelize']['transaction'](function(_0x3c805d){return _0x149ec9[_0x4b45('0x69')](_0x1d7a46,{'transaction':_0x3c805d})[_0x4b45('0x29')](function(){return BPromise[_0x4b45('0x6f')](_0x2a4619,function(_0x4a3fad){return db[_0x4b45('0x5b')][_0x4b45('0x70')]({'where':{'UserId':_0x4a3fad['id'],'OpenchannelQueueId':_0x2e776d[_0x4b45('0x4f')]['id']},'transaction':_0x3c805d});});})[_0x4b45('0x29')](function(){_0x2a4619[_0x4b45('0x71')](function(_0x26fd3e){socket['emit'](_0x4b45('0x72'),{'UserId':_0x26fd3e['id'],'OpenchannelQueueId':_0x149ec9['id']});});});});});}})['then'](respondWithStatusCode(_0x46eea8,null))[_0x4b45('0x4d')](handleError(_0x46eea8,null));};exports[_0x4b45('0x73')]=function(_0x3f0b35,_0x36db86,_0x2d3089){return db[_0x4b45('0x68')]['findAll']({'where':{'id':_0x3f0b35[_0x4b45('0x35')][_0x4b45('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4b45('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x4b45('0x29')](handleEntityNotFound(_0x36db86,null))['then'](function(_0x3c3ce2){var _0x8c582b=_[_0x4b45('0x31')](_0x3c3ce2,'id');var _0x1ac5e8=[];var _0x121a8d=[];var _0x5b4957=squel[_0x4b45('0x74')]();_0x5b4957[_0x4b45('0x75')]('tq.TeamId')[_0x4b45('0x76')](_0x4b45('0x77'),'tq')['join']('user_has_teams','ut',_0x4b45('0x78'))['where'](_0x4b45('0x79'),_0x3f0b35['params']['id']);for(var _0xb7f43d=0x0;_0xb7f43d<_0x3c3ce2[_0x4b45('0x3c')];_0xb7f43d+=0x1){let _0x230500=_0x3c3ce2[_0xb7f43d];for(var _0xaf9680=0x0;_0xaf9680<_0x230500[_0x4b45('0x6b')][_0x4b45('0x3c')];_0xaf9680+=0x1){let _0x46527e=_0x230500[_0x4b45('0x6b')][_0xaf9680];var _0x5a95d8=_0x5b4957['clone']();_0x5a95d8['where'](_0x4b45('0x7a'),_0x46527e['id']);_0x121a8d[_0x4b45('0x7b')](db['sequelize']['query'](_0x5a95d8[_0x4b45('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0x4b45('0x7d')]})[_0x4b45('0x29')](function(_0x2f3520){if(_0x2f3520[_0x4b45('0x3c')]===0x1){return _0x46527e['id'];}else{var _0x119c07=_[_0x4b45('0x7e')](_['map'](_0x2f3520,_0x4b45('0x7f')),function(_0x5e283f){return _[_0x4b45('0x80')](_0x8c582b,_0x5e283f);});if(_0x119c07){return _0x46527e['id'];}}}));}}return BPromise[_0x4b45('0x81')](_0x121a8d)[_0x4b45('0x29')](function(_0xc49025){_0x1ac5e8=_(_0x1ac5e8)[_0x4b45('0x82')](_0xc49025)[_0x4b45('0x83')]()['value']();return db[_0x4b45('0x4a')][_0x4b45('0x50')]({'where':{'id':_0x3f0b35[_0x4b45('0x4f')]['id']}})['then'](function(_0x4e7d72){return db[_0x4b45('0x84')][_0x4b45('0x85')](function(_0x53a9d1){return _0x4e7d72[_0x4b45('0x73')](_0x3f0b35[_0x4b45('0x35')]['ids'],{'transaction':_0x53a9d1})[_0x4b45('0x29')](function(){if(!_['isEmpty'](_0x1ac5e8)){return _0x4e7d72[_0x4b45('0x86')](_0x1ac5e8,{'transaction':_0x53a9d1});}})[_0x4b45('0x29')](function(){_0x1ac5e8['forEach'](function(_0x1135c8){socket[_0x4b45('0x87')](_0x4b45('0x88'),{'UserId':_0x1135c8,'OpenchannelQueueId':_0x4e7d72['id']});});});});});});})['then'](respondWithStatusCode(_0x36db86,null))[_0x4b45('0x4d')](handleError(_0x36db86,null));};exports[_0x4b45('0x89')]=function(_0x3937f3,_0x35f8d8,_0x11b1d2){return db[_0x4b45('0x4a')]['find']({'where':{'id':_0x3937f3['params']['id']}})['then'](handleEntityNotFound(_0x35f8d8,null))[_0x4b45('0x29')](function(_0x590681){if(_0x590681){return _0x590681[_0x4b45('0x89')](_0x3937f3[_0x4b45('0x58')][_0x4b45('0x6a')],_[_0x4b45('0x8a')](_0x3937f3['body'],[_0x4b45('0x6a'),'id'])||{})[_0x4b45('0x8b')](function(_0x1366c1){for(var _0x577912=0x0;_0x577912<_0x3937f3[_0x4b45('0x58')][_0x4b45('0x6a')][_0x4b45('0x3c')];_0x577912+=0x1){socket[_0x4b45('0x87')](_0x4b45('0x72'),{'UserId':Number(_0x3937f3[_0x4b45('0x58')]['ids'][_0x577912]),'OpenchannelQueueId':Number(_0x3937f3[_0x4b45('0x4f')]['id'])});}return _0x1366c1;});}})[_0x4b45('0x29')](respondWithResult(_0x35f8d8,null))['catch'](handleError(_0x35f8d8,null));};exports[_0x4b45('0x86')]=function(_0x8aa72,_0xed9846,_0x19cd71){return db['OpenchannelQueue'][_0x4b45('0x50')]({'where':{'id':_0x8aa72[_0x4b45('0x4f')]['id']}})['then'](handleEntityNotFound(_0xed9846,null))[_0x4b45('0x29')](function(_0x4589ae){if(_0x4589ae){return _0x4589ae['removeAgents'](_0x8aa72[_0x4b45('0x35')][_0x4b45('0x6a')])[_0x4b45('0x29')](function(){if(_['isArray'](_0x8aa72[_0x4b45('0x35')][_0x4b45('0x6a')])){for(var _0x24e7f7=0x0;_0x24e7f7<_0x8aa72[_0x4b45('0x35')][_0x4b45('0x6a')][_0x4b45('0x3c')];_0x24e7f7+=0x1){socket[_0x4b45('0x87')](_0x4b45('0x88'),{'UserId':Number(_0x8aa72[_0x4b45('0x35')][_0x4b45('0x6a')][_0x24e7f7]),'OpenchannelQueueId':Number(_0x8aa72[_0x4b45('0x4f')]['id'])});}}else{socket[_0x4b45('0x87')]('userOpenchannelQueue:remove',{'UserId':Number(_0x8aa72['query'][_0x4b45('0x6a')]),'OpenchannelQueueId':Number(_0x8aa72['params']['id'])});}});}})[_0x4b45('0x29')](respondWithStatusCode(_0xed9846,null))['catch'](handleError(_0xed9846,null));};exports[_0x4b45('0x8c')]=function(_0x314864,_0x25b63b,_0x5dcead){var _0x4925c8={};var _0xd182a4={};var _0x29276d;var _0x33cd49;return db[_0x4b45('0x4a')][_0x4b45('0x67')]({'where':{'id':_0x314864[_0x4b45('0x4f')]['id']}})[_0x4b45('0x29')](handleEntityNotFound(_0x25b63b,null))[_0x4b45('0x29')](function(_0x57e292){if(_0x57e292){_0x29276d=_0x57e292;_0xd182a4[_0x4b45('0x39')]=_['keys'](db[_0x4b45('0x5c')]['rawAttributes']);_0xd182a4['query']=_['keys'](_0x314864[_0x4b45('0x35')]);_0xd182a4[_0x4b45('0x37')]=_[_0x4b45('0x38')](_0xd182a4[_0x4b45('0x39')],_0xd182a4['query']);_0x4925c8[_0x4b45('0x3a')]=_[_0x4b45('0x38')](_0xd182a4[_0x4b45('0x39')],qs['fields'](_0x314864['query'][_0x4b45('0x3b')]));_0x4925c8[_0x4b45('0x3a')]=_0x4925c8['attributes']['length']?_0x4925c8[_0x4b45('0x3a')]:_0xd182a4[_0x4b45('0x39')];_0x4925c8[_0x4b45('0x3f')]=qs[_0x4b45('0x40')](_0x314864[_0x4b45('0x35')][_0x4b45('0x40')]);_0x4925c8[_0x4b45('0x43')]=qs[_0x4b45('0x37')](_[_0x4b45('0x41')](_0x314864[_0x4b45('0x35')],_0xd182a4[_0x4b45('0x37')]));if(_0x314864[_0x4b45('0x35')][_0x4b45('0x42')]){_0x4925c8[_0x4b45('0x43')]=_[_0x4b45('0x44')](_0x4925c8[_0x4b45('0x43')],{'$or':_[_0x4b45('0x31')](_0x4925c8[_0x4b45('0x3a')],function(_0x1cea58){var _0x167f5a={};_0x167f5a[_0x1cea58]={'$like':'%'+_0x314864['query'][_0x4b45('0x42')]+'%'};return _0x167f5a;})});}_0x4925c8=_[_0x4b45('0x44')]({},_0x4925c8,_0x314864['options']);return _0x29276d[_0x4b45('0x8c')](_0x4925c8);}})[_0x4b45('0x29')](function(_0x23b407){if(_0x23b407){_0x33cd49=_0x23b407['length'];if(!_0x314864['query'][_0x4b45('0x3d')](_0x4b45('0x3e'))){_0x4925c8[_0x4b45('0x23')]=qs[_0x4b45('0x23')](_0x314864[_0x4b45('0x35')][_0x4b45('0x23')]);_0x4925c8['offset']=qs[_0x4b45('0x22')](_0x314864[_0x4b45('0x35')][_0x4b45('0x22')]);}return _0x29276d['getAgents'](_0x4925c8);}})[_0x4b45('0x29')](function(_0x2cef7a){if(_0x2cef7a){return _0x2cef7a?{'count':_0x33cd49,'rows':_0x2cef7a}:null;}})['then'](respondWithResult(_0x25b63b,null))[_0x4b45('0x4d')](handleError(_0x25b63b,null));}; \ No newline at end of file +var _0xd175=['userOpenchannelQueue:save','removeTeams','field','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','order','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserOpenchannelQueue','findOrCreate','forEach'];(function(_0x11f041,_0x5d5b82){var _0x3b7ba4=function(_0x2c6963){while(--_0x2c6963){_0x11f041['push'](_0x11f041['shift']());}};_0x3b7ba4(++_0x5d5b82);}(_0xd175,0xaa));var _0x5d17=function(_0x38b6a5,_0x531fc0){_0x38b6a5=_0x38b6a5-0x0;var _0x4e5d0a=_0xd175[_0x38b6a5];return _0x4e5d0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d17('0x0'));var zipdir=require(_0x5d17('0x1'));var jsonpatch=require(_0x5d17('0x2'));var rp=require(_0x5d17('0x3'));var moment=require(_0x5d17('0x4'));var BPromise=require(_0x5d17('0x5'));var Mustache=require(_0x5d17('0x6'));var util=require(_0x5d17('0x7'));var path=require(_0x5d17('0x8'));var sox=require(_0x5d17('0x9'));var csv=require('to-csv');var ejs=require(_0x5d17('0xa'));var fs=require('fs');var fs_extra=require(_0x5d17('0xb'));var _=require(_0x5d17('0xc'));var squel=require('squel');var crypto=require(_0x5d17('0xd'));var jsforce=require(_0x5d17('0xe'));var deskjs=require(_0x5d17('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d17('0x10'));var Papa=require('papaparse');var Redis=require(_0x5d17('0x11'));var authService=require(_0x5d17('0x12'));var qs=require(_0x5d17('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d17('0x14'));var logger=require(_0x5d17('0x15'))('api');var utils=require(_0x5d17('0x16'));var config=require(_0x5d17('0x17'));var licenseUtil=require(_0x5d17('0x18'));var db=require('../../mysqldb')['db'];config[_0x5d17('0x19')]=_[_0x5d17('0x1a')](config[_0x5d17('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d17('0x1b'))(new Redis(config['redis']));require(_0x5d17('0x1c'))['register'](socket);function respondWithStatusCode(_0x46ccab,_0x55a610){_0x55a610=_0x55a610||0xcc;return function(_0x330f0b){if(_0x330f0b){return _0x46ccab[_0x5d17('0x1d')](_0x55a610);}return _0x46ccab[_0x5d17('0x1e')](_0x55a610)[_0x5d17('0x1f')]();};}function respondWithResult(_0x2ca8de,_0x260d9){_0x260d9=_0x260d9||0xc8;return function(_0x54ce27){if(_0x54ce27){return _0x2ca8de[_0x5d17('0x1e')](_0x260d9)[_0x5d17('0x20')](_0x54ce27);}};}function respondWithFilteredResult(_0x2f7821,_0xfd79d7){return function(_0x41039e){if(_0x41039e){var _0x25fe49=typeof _0xfd79d7[_0x5d17('0x21')]===_0x5d17('0x22')&&typeof _0xfd79d7['limit']===_0x5d17('0x22');var _0x731f9a=_0x41039e[_0x5d17('0x23')];var _0x31405a=_0x25fe49?0x0:_0xfd79d7[_0x5d17('0x21')];var _0x3be4a4=_0x25fe49?_0x41039e[_0x5d17('0x23')]:_0xfd79d7[_0x5d17('0x21')]+_0xfd79d7[_0x5d17('0x24')];var _0x15ddbf;if(_0x3be4a4>=_0x731f9a){_0x3be4a4=_0x731f9a;_0x15ddbf=0xc8;}else{_0x15ddbf=0xce;}_0x2f7821[_0x5d17('0x1e')](_0x15ddbf);return _0x2f7821[_0x5d17('0x25')](_0x5d17('0x26'),_0x31405a+'-'+_0x3be4a4+'/'+_0x731f9a)[_0x5d17('0x20')](_0x41039e);}return null;};}function patchUpdates(_0x39dbf6){return function(_0x33f850){try{jsonpatch[_0x5d17('0x27')](_0x33f850,_0x39dbf6,!![]);}catch(_0x25ac2a){return BPromise[_0x5d17('0x28')](_0x25ac2a);}return _0x33f850[_0x5d17('0x29')]();};}function saveUpdates(_0x58c2b7,_0x1e853c){return function(_0x2ba57d){if(_0x2ba57d){return _0x2ba57d[_0x5d17('0x2a')](_0x58c2b7)['then'](function(_0x25fc3f){return _0x25fc3f;});}return null;};}function removeEntity(_0x20ce63,_0x1d62f1){return function(_0x1528bb){if(_0x1528bb){return _0x1528bb[_0x5d17('0x2b')]()[_0x5d17('0x2c')](function(){var _0x26fe90=_0x1528bb[_0x5d17('0x2d')]({'plain':!![]});var _0x71bd6c=_0x5d17('0x2e');return db[_0x5d17('0x2f')][_0x5d17('0x2b')]({'where':{'type':_0x71bd6c,'resourceId':_0x26fe90['id']}})[_0x5d17('0x2c')](function(){return _0x1528bb;});})[_0x5d17('0x2c')](function(){_0x20ce63[_0x5d17('0x1e')](0xcc)[_0x5d17('0x1f')]();});}};}function handleEntityNotFound(_0x56c1fe,_0x206028){return function(_0x5e8a75){if(!_0x5e8a75){_0x56c1fe[_0x5d17('0x1d')](0x194);}return _0x5e8a75;};}function handleError(_0x5612b9,_0x127646){_0x127646=_0x127646||0x1f4;return function(_0x43c21c){logger[_0x5d17('0x30')](_0x43c21c[_0x5d17('0x31')]);if(_0x43c21c['name']){delete _0x43c21c[_0x5d17('0x32')];}_0x5612b9['status'](_0x127646)[_0x5d17('0x33')](_0x43c21c);};}exports[_0x5d17('0x34')]=function(_0x4b7ef0,_0x297f27){var _0x3e8aa4={},_0x13ef2d={},_0x1de624={'count':0x0,'rows':[]};var _0x3deafd=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x46e143){return{'name':_0x46e143[_0x5d17('0x35')],'type':_0x46e143[_0x5d17('0x36')][_0x5d17('0x37')]};});_0x13ef2d[_0x5d17('0x38')]=_[_0x5d17('0x39')](_0x3deafd,_0x5d17('0x32'));_0x13ef2d[_0x5d17('0x3a')]=_[_0x5d17('0x3b')](_0x4b7ef0[_0x5d17('0x3a')]);_0x13ef2d['filters']=_['intersection'](_0x13ef2d[_0x5d17('0x38')],_0x13ef2d[_0x5d17('0x3a')]);_0x3e8aa4[_0x5d17('0x3c')]=_[_0x5d17('0x3d')](_0x13ef2d['model'],qs[_0x5d17('0x3e')](_0x4b7ef0[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x3e8aa4[_0x5d17('0x3c')]=_0x3e8aa4[_0x5d17('0x3c')][_0x5d17('0x3f')]?_0x3e8aa4[_0x5d17('0x3c')]:_0x13ef2d[_0x5d17('0x38')];if(!_0x4b7ef0[_0x5d17('0x3a')][_0x5d17('0x40')]('nolimit')){_0x3e8aa4[_0x5d17('0x24')]=qs[_0x5d17('0x24')](_0x4b7ef0[_0x5d17('0x3a')]['limit']);_0x3e8aa4[_0x5d17('0x21')]=qs[_0x5d17('0x21')](_0x4b7ef0[_0x5d17('0x3a')]['offset']);}_0x3e8aa4['order']=qs[_0x5d17('0x41')](_0x4b7ef0['query']['sort']);_0x3e8aa4[_0x5d17('0x42')]=qs['filters'](_[_0x5d17('0x43')](_0x4b7ef0['query'],_0x13ef2d['filters']),_0x3deafd);if(_0x4b7ef0['query']['filter']){_0x3e8aa4[_0x5d17('0x42')]=_['merge'](_0x3e8aa4[_0x5d17('0x42')],{'$or':_['map'](_0x3deafd,function(_0x272233){if(_0x272233['type']!==_0x5d17('0x44')){var _0x58a4cf={};_0x58a4cf[_0x272233['name']]={'$like':'%'+_0x4b7ef0[_0x5d17('0x3a')]['filter']+'%'};return _0x58a4cf;}})});}_0x3e8aa4=_['merge']({},_0x3e8aa4,_0x4b7ef0['options']);var _0xef7e12={'where':_0x3e8aa4['where']};return db[_0x5d17('0x45')][_0x5d17('0x23')](_0xef7e12)[_0x5d17('0x2c')](function(_0x5b3035){_0x1de624['count']=_0x5b3035;if(_0x4b7ef0['query'][_0x5d17('0x46')]){_0x3e8aa4[_0x5d17('0x47')]=[{'all':!![]}];}return db[_0x5d17('0x45')][_0x5d17('0x48')](_0x3e8aa4);})['then'](function(_0x20267f){_0x1de624[_0x5d17('0x49')]=_0x20267f;return _0x1de624;})[_0x5d17('0x2c')](respondWithFilteredResult(_0x297f27,_0x3e8aa4))[_0x5d17('0x4a')](handleError(_0x297f27,null));};exports[_0x5d17('0x4b')]=function(_0x5c0409,_0x14b9bd){var _0x5c13a8={'raw':!![],'where':{'id':_0x5c0409[_0x5d17('0x4c')]['id']}},_0x2d7a40={};_0x2d7a40['model']=_['keys'](db[_0x5d17('0x45')][_0x5d17('0x4d')]);_0x2d7a40[_0x5d17('0x3a')]=_['keys'](_0x5c0409['query']);_0x2d7a40[_0x5d17('0x4e')]=_[_0x5d17('0x3d')](_0x2d7a40['model'],_0x2d7a40[_0x5d17('0x3a')]);_0x5c13a8['attributes']=_['intersection'](_0x2d7a40[_0x5d17('0x38')],qs[_0x5d17('0x3e')](_0x5c0409['query'][_0x5d17('0x3e')]));_0x5c13a8[_0x5d17('0x3c')]=_0x5c13a8[_0x5d17('0x3c')][_0x5d17('0x3f')]?_0x5c13a8[_0x5d17('0x3c')]:_0x2d7a40[_0x5d17('0x38')];if(_0x5c0409[_0x5d17('0x3a')][_0x5d17('0x46')]){_0x5c13a8[_0x5d17('0x47')]=[{'all':!![]}];}_0x5c13a8=_[_0x5d17('0x4f')]({},_0x5c13a8,_0x5c0409[_0x5d17('0x50')]);return db[_0x5d17('0x45')][_0x5d17('0x51')](_0x5c13a8)[_0x5d17('0x2c')](handleEntityNotFound(_0x14b9bd,null))['then'](respondWithResult(_0x14b9bd,null))[_0x5d17('0x4a')](handleError(_0x14b9bd,null));};exports['create']=function(_0x245796,_0x2b9bd5){return db['OpenchannelQueue']['create'](_0x245796[_0x5d17('0x52')],{})[_0x5d17('0x2c')](function(_0x4a84ba){var _0x2b109e=_0x245796[_0x5d17('0x53')][_0x5d17('0x2d')]({'plain':!![]});if(!_0x2b109e)throw new Error(_0x5d17('0x54'));if(_0x2b109e[_0x5d17('0x55')]===_0x5d17('0x53')){var _0x381cae=_0x4a84ba[_0x5d17('0x2d')]({'plain':!![]});var _0x13fcb5=_0x5d17('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x13fcb5,'userProfileId':_0x2b109e[_0x5d17('0x56')]},'raw':!![]})[_0x5d17('0x2c')](function(_0x310674){if(_0x310674&&_0x310674['autoAssociation']===0x0){return db[_0x5d17('0x2f')]['create']({'name':_0x381cae[_0x5d17('0x32')],'resourceId':_0x381cae['id'],'type':_0x310674[_0x5d17('0x32')],'sectionId':_0x310674['id']},{})[_0x5d17('0x2c')](function(){return _0x4a84ba;});}else{return _0x4a84ba;}})['catch'](function(_0x23c4af){logger[_0x5d17('0x30')](_0x5d17('0x57'),_0x23c4af);throw _0x23c4af;});}return _0x4a84ba;})[_0x5d17('0x2c')](respondWithResult(_0x2b9bd5,0xc9))[_0x5d17('0x4a')](handleError(_0x2b9bd5,null));};exports['update']=function(_0x17179d,_0x20b0b4){if(_0x17179d[_0x5d17('0x52')]['id']){delete _0x17179d['body']['id'];}return db[_0x5d17('0x45')]['find']({'where':{'id':_0x17179d[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x20b0b4,null))['then'](saveUpdates(_0x17179d[_0x5d17('0x52')],null))['then'](respondWithResult(_0x20b0b4,null))[_0x5d17('0x4a')](handleError(_0x20b0b4,null));};exports[_0x5d17('0x2b')]=function(_0x171191,_0x110488){return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x171191[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x110488,null))[_0x5d17('0x2c')](removeEntity(_0x110488,null))[_0x5d17('0x4a')](handleError(_0x110488,null));};exports['describe']=function(_0xa9c1f,_0x22162b){return db[_0x5d17('0x45')][_0x5d17('0x58')]()[_0x5d17('0x2c')](respondWithResult(_0x22162b,null))[_0x5d17('0x4a')](handleError(_0x22162b,null));};exports[_0x5d17('0x59')]=function(_0x2b051a,_0x3421e3,_0x269a55){var _0x5bfd58={'raw':!![],'where':{}},_0x4ac89f={},_0x573f2d;return db[_0x5d17('0x45')][_0x5d17('0x5a')]({'where':{'id':_0x2b051a[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x3421e3,null))[_0x5d17('0x2c')](function(_0x598ee5){if(_0x598ee5){_0x573f2d=_0x598ee5[_0x5d17('0x2d')]({'plain':!![]});_0x4ac89f[_0x5d17('0x38')]=_[_0x5d17('0x3b')](db['UserOpenchannelQueue'][_0x5d17('0x4d')]);_0x4ac89f['query']=_['keys'](_0x2b051a[_0x5d17('0x3a')]);_0x4ac89f['filters']=_[_0x5d17('0x3d')](_0x4ac89f[_0x5d17('0x38')],_0x4ac89f[_0x5d17('0x3a')]);_0x5bfd58[_0x5d17('0x3c')]=_['intersection'](_0x4ac89f[_0x5d17('0x38')],qs[_0x5d17('0x3e')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x5bfd58[_0x5d17('0x3c')]=_0x5bfd58[_0x5d17('0x3c')]['length']?_0x5bfd58[_0x5d17('0x3c')]:_0x4ac89f[_0x5d17('0x38')];if(!_0x2b051a['query'][_0x5d17('0x40')](_0x5d17('0x5b'))){_0x5bfd58['limit']=qs[_0x5d17('0x24')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x24')]);_0x5bfd58[_0x5d17('0x21')]=qs[_0x5d17('0x21')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x21')]);}_0x5bfd58[_0x5d17('0x5c')]=qs[_0x5d17('0x41')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x41')]);_0x5bfd58['where']=qs[_0x5d17('0x4e')](_[_0x5d17('0x43')](_0x2b051a[_0x5d17('0x3a')],_0x4ac89f[_0x5d17('0x4e')]));_0x5bfd58[_0x5d17('0x42')][_0x5d17('0x5d')]=_0x598ee5['id'];if(_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x5e')]){_0x5bfd58[_0x5d17('0x42')]=_['merge'](_0x5bfd58[_0x5d17('0x42')],{'$or':_[_0x5d17('0x39')](_0x5bfd58[_0x5d17('0x3c')],function(_0x20ea71){var _0x18d00d={};_0x18d00d[_0x20ea71]={'$like':'%'+_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x5e')]+'%'};return _0x18d00d;})});}_0x5bfd58=_['merge']({},_0x5bfd58,_0x2b051a[_0x5d17('0x50')]);return db['UserOpenchannelQueue'][_0x5d17('0x48')](_0x5bfd58);}})[_0x5d17('0x2c')](function(_0x13e58b){if(_0x13e58b){return db[_0x5d17('0x5f')][_0x5d17('0x60')]({'where':{'id':_[_0x5d17('0x39')](_0x13e58b,_0x5d17('0x61')),'role':_0x5d17('0x62')},'attributes':['id',_0x5d17('0x32'),_0x5d17('0x63'),_0x5d17('0x64'),'createdAt']});}})[_0x5d17('0x2c')](function(_0x280f40){if(_0x280f40){return{'count':_0x280f40[_0x5d17('0x23')],'rows':_[_0x5d17('0x39')](_0x280f40[_0x5d17('0x49')],function(_0x1b9e27){return{'membername':_0x1b9e27['name'],'UserId':_0x1b9e27['id'],'queue_name':_0x573f2d[_0x5d17('0x32')],'OpenchannelQueueId':_0x573f2d['id'],'interface':util['format']('%s/%s',_0x5d17('0x65'),_0x1b9e27['name']),'penalty':0x0,'paused':_0x1b9e27['openchannelPause'],'createdAt':_0x1b9e27[_0x5d17('0x66')],'updatedAt':_0x1b9e27[_0x5d17('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5d17('0x2c')](respondWithFilteredResult(_0x3421e3,_0x5bfd58))['catch'](handleError(_0x3421e3,null));};exports[_0x5d17('0x67')]=function(_0x303867,_0x438bb5,_0x5a59c9){var _0x3e0881={};var _0x38b883={};var _0x747594;var _0x33283b;return db[_0x5d17('0x45')][_0x5d17('0x5a')]({'where':{'id':_0x303867[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x438bb5,null))['then'](function(_0x36fc43){if(_0x36fc43){_0x747594=_0x36fc43;_0x38b883[_0x5d17('0x38')]=_['keys'](db[_0x5d17('0x68')][_0x5d17('0x4d')]);_0x38b883[_0x5d17('0x3a')]=_['keys'](_0x303867[_0x5d17('0x3a')]);_0x38b883[_0x5d17('0x4e')]=_[_0x5d17('0x3d')](_0x38b883['model'],_0x38b883[_0x5d17('0x3a')]);_0x3e0881[_0x5d17('0x3c')]=_[_0x5d17('0x3d')](_0x38b883['model'],qs[_0x5d17('0x3e')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x3e0881[_0x5d17('0x3c')]=_0x3e0881['attributes'][_0x5d17('0x3f')]?_0x3e0881[_0x5d17('0x3c')]:_0x38b883['model'];_0x3e0881[_0x5d17('0x5c')]=qs[_0x5d17('0x41')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x41')]);_0x3e0881[_0x5d17('0x42')]=qs[_0x5d17('0x4e')](_[_0x5d17('0x43')](_0x303867[_0x5d17('0x3a')],_0x38b883[_0x5d17('0x4e')]));if(_0x303867['query'][_0x5d17('0x5e')]){_0x3e0881[_0x5d17('0x42')]=_[_0x5d17('0x4f')](_0x3e0881[_0x5d17('0x42')],{'$or':_[_0x5d17('0x39')](_0x3e0881[_0x5d17('0x3c')],function(_0x168b18){var _0x140cdb={};_0x140cdb[_0x168b18]={'$like':'%'+_0x303867[_0x5d17('0x3a')]['filter']+'%'};return _0x140cdb;})});}_0x3e0881=_[_0x5d17('0x4f')]({},_0x3e0881,_0x303867[_0x5d17('0x50')]);return _0x747594[_0x5d17('0x67')](_0x3e0881);}})['then'](function(_0x2a70af){if(_0x2a70af){_0x33283b=_0x2a70af[_0x5d17('0x3f')];if(!_0x303867['query'][_0x5d17('0x40')](_0x5d17('0x5b'))){_0x3e0881[_0x5d17('0x24')]=qs[_0x5d17('0x24')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x24')]);_0x3e0881[_0x5d17('0x21')]=qs[_0x5d17('0x21')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x21')]);}return _0x747594[_0x5d17('0x67')](_0x3e0881);}})[_0x5d17('0x2c')](function(_0xc41114){if(_0xc41114){return _0xc41114?{'count':_0x33283b,'rows':_0xc41114}:null;}})['then'](respondWithResult(_0x438bb5,null))['catch'](handleError(_0x438bb5,null));};exports[_0x5d17('0x69')]=function(_0x11ee2a,_0x3705a7,_0x564df1){var _0x3e0339=_0x11ee2a[_0x5d17('0x52')][_0x5d17('0x6a')];return db[_0x5d17('0x68')][_0x5d17('0x48')]({'where':{'id':_0x3e0339},'attributes':['id'],'include':[{'model':db[_0x5d17('0x5f')],'as':_0x5d17('0x6b'),'attributes':['id',_0x5d17('0x32'),_0x5d17('0x6c'),_0x5d17('0x6d'),_0x5d17('0x6e')],'raw':!![]}]})[_0x5d17('0x2c')](function(_0x134b49){if(_0x134b49){var _0x19f7e7=_[_0x5d17('0x6f')](_0x134b49,function(_0xf25c9e){var _0x4ebd35=_0xf25c9e[_0x5d17('0x2d')]({'plain':!![]});return _0x4ebd35[_0x5d17('0x6b')];});return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x11ee2a[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](function(_0x520587){return db[_0x5d17('0x70')][_0x5d17('0x71')](function(_0x55e619){return _0x520587[_0x5d17('0x69')](_0x3e0339,{'transaction':_0x55e619})['then'](function(){return BPromise[_0x5d17('0x72')](_0x19f7e7,function(_0x10455c){return db[_0x5d17('0x73')][_0x5d17('0x74')]({'where':{'UserId':_0x10455c['id'],'OpenchannelQueueId':_0x11ee2a[_0x5d17('0x4c')]['id']},'transaction':_0x55e619});});})[_0x5d17('0x2c')](function(){_0x19f7e7[_0x5d17('0x75')](function(_0x343715){socket['emit'](_0x5d17('0x76'),{'UserId':_0x343715['id'],'OpenchannelQueueId':_0x520587['id']});});});});});}})['then'](respondWithStatusCode(_0x3705a7,null))[_0x5d17('0x4a')](handleError(_0x3705a7,null));};exports[_0x5d17('0x77')]=function(_0x4bc093,_0x19bd02,_0x31eb71){return db[_0x5d17('0x68')][_0x5d17('0x48')]({'where':{'id':_0x4bc093[_0x5d17('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5d17('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x5d17('0x2c')](handleEntityNotFound(_0x19bd02,null))[_0x5d17('0x2c')](function(_0x1ab7bb){var _0x3b25cd=_[_0x5d17('0x39')](_0x1ab7bb,'id');var _0xd9f25d=[];var _0x557d6b=[];var _0x48d564=squel['select']();_0x48d564[_0x5d17('0x78')](_0x5d17('0x79'))['from'](_0x5d17('0x7a'),'tq')['join'](_0x5d17('0x7b'),'ut',_0x5d17('0x7c'))[_0x5d17('0x42')](_0x5d17('0x7d'),_0x4bc093[_0x5d17('0x4c')]['id']);for(var _0x17467d=0x0;_0x17467d<_0x1ab7bb[_0x5d17('0x3f')];_0x17467d+=0x1){let _0x442e04=_0x1ab7bb[_0x17467d];for(var _0x4f73d7=0x0;_0x4f73d7<_0x442e04[_0x5d17('0x6b')][_0x5d17('0x3f')];_0x4f73d7+=0x1){let _0x21531f=_0x442e04['Agents'][_0x4f73d7];var _0x261699=_0x48d564[_0x5d17('0x7e')]();_0x261699[_0x5d17('0x42')](_0x5d17('0x7f'),_0x21531f['id']);_0x557d6b[_0x5d17('0x80')](db[_0x5d17('0x70')][_0x5d17('0x3a')](_0x261699[_0x5d17('0x81')](),{'type':db['sequelize'][_0x5d17('0x82')][_0x5d17('0x83')]})[_0x5d17('0x2c')](function(_0x4fe4bf){if(_0x4fe4bf[_0x5d17('0x3f')]===0x1){return _0x21531f['id'];}else{var _0x23ccdd=_[_0x5d17('0x84')](_[_0x5d17('0x39')](_0x4fe4bf,_0x5d17('0x85')),function(_0x1d6745){return _['includes'](_0x3b25cd,_0x1d6745);});if(_0x23ccdd){return _0x21531f['id'];}}}));}}return BPromise[_0x5d17('0x86')](_0x557d6b)['then'](function(_0x54911e){_0xd9f25d=_(_0xd9f25d)['union'](_0x54911e)['compact']()[_0x5d17('0x87')]();return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x4bc093['params']['id']}})[_0x5d17('0x2c')](function(_0x2d9ba0){return db[_0x5d17('0x70')][_0x5d17('0x71')](function(_0x395d91){return _0x2d9ba0['removeTeams'](_0x4bc093[_0x5d17('0x3a')][_0x5d17('0x6a')],{'transaction':_0x395d91})[_0x5d17('0x2c')](function(){if(!_[_0x5d17('0x88')](_0xd9f25d)){return _0x2d9ba0[_0x5d17('0x89')](_0xd9f25d,{'transaction':_0x395d91});}})[_0x5d17('0x2c')](function(){_0xd9f25d[_0x5d17('0x75')](function(_0x3facc1){socket[_0x5d17('0x8a')](_0x5d17('0x8b'),{'UserId':_0x3facc1,'OpenchannelQueueId':_0x2d9ba0['id']});});});});});});})['then'](respondWithStatusCode(_0x19bd02,null))['catch'](handleError(_0x19bd02,null));};exports[_0x5d17('0x8c')]=function(_0x372198,_0x2bcd9c,_0x16ef21){return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x372198[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x2bcd9c,null))[_0x5d17('0x2c')](function(_0x2407c4){if(_0x2407c4){return _0x2407c4[_0x5d17('0x8c')](_0x372198[_0x5d17('0x52')][_0x5d17('0x6a')],_[_0x5d17('0x8d')](_0x372198['body'],[_0x5d17('0x6a'),'id'])||{})['spread'](function(_0x447222){for(var _0x456a00=0x0;_0x456a00<_0x372198[_0x5d17('0x52')][_0x5d17('0x6a')][_0x5d17('0x3f')];_0x456a00+=0x1){socket[_0x5d17('0x8a')]('userOpenchannelQueue:save',{'UserId':Number(_0x372198[_0x5d17('0x52')][_0x5d17('0x6a')][_0x456a00]),'OpenchannelQueueId':Number(_0x372198[_0x5d17('0x4c')]['id'])});}return _0x447222;});}})[_0x5d17('0x2c')](respondWithResult(_0x2bcd9c,null))['catch'](handleError(_0x2bcd9c,null));};exports[_0x5d17('0x89')]=function(_0x59ba0c,_0x38b1e7,_0x3e6058){return db[_0x5d17('0x45')][_0x5d17('0x51')]({'where':{'id':_0x59ba0c[_0x5d17('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38b1e7,null))[_0x5d17('0x2c')](function(_0x47c99d){if(_0x47c99d){return _0x47c99d[_0x5d17('0x89')](_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')])['then'](function(){if(_[_0x5d17('0x8e')](_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')])){for(var _0x4e27b2=0x0;_0x4e27b2<_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')][_0x5d17('0x3f')];_0x4e27b2+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x59ba0c[_0x5d17('0x3a')]['ids'][_0x4e27b2]),'OpenchannelQueueId':Number(_0x59ba0c[_0x5d17('0x4c')]['id'])});}}else{socket['emit'](_0x5d17('0x8b'),{'UserId':Number(_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')]),'OpenchannelQueueId':Number(_0x59ba0c[_0x5d17('0x4c')]['id'])});}});}})[_0x5d17('0x2c')](respondWithStatusCode(_0x38b1e7,null))[_0x5d17('0x4a')](handleError(_0x38b1e7,null));};exports[_0x5d17('0x8f')]=function(_0x4a2d8d,_0x271c22,_0x34dcf3){var _0x445acb={};var _0x3f3e42={};var _0x11d3d0;var _0x3598e0;return db[_0x5d17('0x45')][_0x5d17('0x5a')]({'where':{'id':_0x4a2d8d[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x271c22,null))['then'](function(_0x4d38e3){if(_0x4d38e3){_0x11d3d0=_0x4d38e3;_0x3f3e42[_0x5d17('0x38')]=_[_0x5d17('0x3b')](db['User'][_0x5d17('0x4d')]);_0x3f3e42[_0x5d17('0x3a')]=_[_0x5d17('0x3b')](_0x4a2d8d[_0x5d17('0x3a')]);_0x3f3e42[_0x5d17('0x4e')]=_[_0x5d17('0x3d')](_0x3f3e42['model'],_0x3f3e42['query']);_0x445acb['attributes']=_[_0x5d17('0x3d')](_0x3f3e42[_0x5d17('0x38')],qs[_0x5d17('0x3e')](_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x445acb[_0x5d17('0x3c')]=_0x445acb[_0x5d17('0x3c')][_0x5d17('0x3f')]?_0x445acb[_0x5d17('0x3c')]:_0x3f3e42[_0x5d17('0x38')];_0x445acb[_0x5d17('0x5c')]=qs['sort'](_0x4a2d8d['query'][_0x5d17('0x41')]);_0x445acb[_0x5d17('0x42')]=qs[_0x5d17('0x4e')](_[_0x5d17('0x43')](_0x4a2d8d['query'],_0x3f3e42['filters']));if(_0x4a2d8d[_0x5d17('0x3a')]['filter']){_0x445acb[_0x5d17('0x42')]=_[_0x5d17('0x4f')](_0x445acb[_0x5d17('0x42')],{'$or':_[_0x5d17('0x39')](_0x445acb[_0x5d17('0x3c')],function(_0x33c196){var _0x57643b={};_0x57643b[_0x33c196]={'$like':'%'+_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x5e')]+'%'};return _0x57643b;})});}_0x445acb=_[_0x5d17('0x4f')]({},_0x445acb,_0x4a2d8d[_0x5d17('0x50')]);return _0x11d3d0['getAgents'](_0x445acb);}})['then'](function(_0x44b3d9){if(_0x44b3d9){_0x3598e0=_0x44b3d9[_0x5d17('0x3f')];if(!_0x4a2d8d['query'][_0x5d17('0x40')](_0x5d17('0x5b'))){_0x445acb[_0x5d17('0x24')]=qs[_0x5d17('0x24')](_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x24')]);_0x445acb[_0x5d17('0x21')]=qs['offset'](_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x21')]);}return _0x11d3d0[_0x5d17('0x8f')](_0x445acb);}})['then'](function(_0x15dbd9){if(_0x15dbd9){return _0x15dbd9?{'count':_0x3598e0,'rows':_0x15dbd9}:null;}})[_0x5d17('0x2c')](respondWithResult(_0x271c22,null))[_0x5d17('0x4a')](handleError(_0x271c22,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8f551f4..dfd7b98 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x253a=['hasOwnProperty','hook','exports','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0xe6fbee,_0x28fad2){var _0x50505a=function(_0x123810){while(--_0x123810){_0xe6fbee['push'](_0xe6fbee['shift']());}};_0x50505a(++_0x28fad2);}(_0x253a,0x8f));var _0xa253=function(_0x2d470,_0x335d65){_0x2d470=_0x2d470-0x0;var _0x57cec7=_0x253a[_0x2d470];return _0x57cec7;};'use strict';var EventEmitter=require(_0xa253('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xa253('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa253('0x2')](0x0);var events={'afterCreate':_0xa253('0x3'),'afterUpdate':_0xa253('0x4'),'afterDestroy':_0xa253('0x5')};function emitEvent(_0xbde7fe){return function(_0x1ff8e6,_0x58354f,_0x3cc84b){OpenchannelQueueEvents[_0xa253('0x6')](_0xbde7fe+':'+_0x1ff8e6['id'],_0x1ff8e6);OpenchannelQueueEvents[_0xa253('0x6')](_0xbde7fe,_0x1ff8e6);_0x3cc84b(null);};}for(var e in events){if(events[_0xa253('0x7')](e)){var event=events[e];OpenchannelQueue[_0xa253('0x8')](e,emitEvent(event));}}module[_0xa253('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xdf44=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x46b295,_0x554b00){var _0x1c4c10=function(_0x58c71b){while(--_0x58c71b){_0x46b295['push'](_0x46b295['shift']());}};_0x1c4c10(++_0x554b00);}(_0xdf44,0x7e));var _0x4df4=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xdf44[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require(_0x4df4('0x0'));var OpenchannelQueue=require(_0x4df4('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4df4('0x2')](0x0);var events={'afterCreate':_0x4df4('0x3'),'afterUpdate':_0x4df4('0x4'),'afterDestroy':_0x4df4('0x5')};function emitEvent(_0x326eeb){return function(_0xa2efa2,_0x24eb70,_0x55a60f){OpenchannelQueueEvents[_0x4df4('0x6')](_0x326eeb+':'+_0xa2efa2['id'],_0xa2efa2);OpenchannelQueueEvents['emit'](_0x326eeb,_0xa2efa2);_0x55a60f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x4df4('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 022f16b..d29bca7 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x223a=['bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','api'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x223a,0x1db));var _0xa223=function(_0x167e6a,_0x1cb2f2){_0x167e6a=_0x167e6a-0x0;var _0x2894ad=_0x223a[_0x167e6a];return _0x2894ad;};'use strict';var _=require(_0xa223('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa223('0x1'));var moment=require('moment');var BPromise=require(_0xa223('0x2'));var rp=require(_0xa223('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa223('0x4'));var config=require(_0xa223('0x5'));var attributes=require(_0xa223('0x6'));module['exports']=function(_0x12cd64,_0x37d5ef){return _0x12cd64[_0xa223('0x7')]('OpenchannelQueue',attributes,{'tableName':_0xa223('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fd6=['request-promise','path','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird'];(function(_0x2edf9e,_0x4f1203){var _0x33a6b1=function(_0xc4aa3c){while(--_0xc4aa3c){_0x2edf9e['push'](_0x2edf9e['shift']());}};_0x33a6b1(++_0x4f1203);}(_0x8fd6,0x104));var _0x68fd=function(_0x3944b3,_0xf05375){_0x3944b3=_0x3944b3-0x0;var _0xbf7a53=_0x8fd6[_0x3944b3];return _0xbf7a53;};'use strict';var _=require(_0x68fd('0x0'));var util=require(_0x68fd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x68fd('0x2'));var BPromise=require(_0x68fd('0x3'));var rp=require(_0x68fd('0x4'));var fs=require('fs');var path=require(_0x68fd('0x5'));var rimraf=require('rimraf');var config=require(_0x68fd('0x6'));var attributes=require(_0x68fd('0x7'));module['exports']=function(_0x4a2357,_0x477ec7){return _0x4a2357[_0x68fd('0x8')](_0x68fd('0x9'),attributes,{'tableName':_0x68fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 01d62a5..90ca572 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6716=['raw','where','attributes','limit','include','model','map','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options'];(function(_0x2bf6f9,_0x14c39b){var _0xe910af=function(_0x4f7533){while(--_0x4f7533){_0x2bf6f9['push'](_0x2bf6f9['shift']());}};_0xe910af(++_0x14c39b);}(_0x6716,0x151));var _0x6671=function(_0x5b9512,_0x5bec1a){_0x5b9512=_0x5b9512-0x0;var _0x37802f=_0x6716[_0x5b9512];return _0x37802f;};'use strict';var _=require(_0x6671('0x0'));var util=require(_0x6671('0x1'));var moment=require(_0x6671('0x2'));var BPromise=require(_0x6671('0x3'));var rs=require(_0x6671('0x4'));var fs=require('fs');var Redis=require(_0x6671('0x5'));var db=require(_0x6671('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6671('0x7'));var config=require(_0x6671('0x8'));var jayson=require(_0x6671('0x9'));var client=jayson[_0x6671('0xa')][_0x6671('0xb')]({'port':0x232a});config[_0x6671('0xc')]=_['defaults'](config[_0x6671('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6671('0xd'))(new Redis(config[_0x6671('0xc')]));require(_0x6671('0xe'))[_0x6671('0xf')](socket);function respondWithRpcPromise(_0x3d562c,_0x53ddfc,_0xa79d51){return new BPromise(function(_0x209a6a,_0x5556b1){return client[_0x6671('0x10')](_0x3d562c,_0xa79d51)[_0x6671('0x11')](function(_0x8088){logger[_0x6671('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x53ddfc,_0x6671('0x13'));logger[_0x6671('0x14')](_0x6671('0x15'),_0x53ddfc,'request\x20sent',JSON[_0x6671('0x16')](_0x8088));if(_0x8088[_0x6671('0x17')]){if(_0x8088[_0x6671('0x17')][_0x6671('0x18')]===0x1f4){logger[_0x6671('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x53ddfc,_0x8088[_0x6671('0x17')]['message']);return _0x5556b1(_0x8088[_0x6671('0x17')]['message']);}logger['error'](_0x6671('0x19'),_0x53ddfc,_0x8088[_0x6671('0x17')][_0x6671('0x1a')]);return _0x209a6a(_0x8088[_0x6671('0x17')][_0x6671('0x1a')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x53ddfc,_0x6671('0x13'));_0x209a6a(_0x8088[_0x6671('0x1b')][_0x6671('0x1a')]);}})[_0x6671('0x1c')](function(_0x27f216){logger[_0x6671('0x17')](_0x6671('0x19'),_0x53ddfc,_0x27f216);_0x5556b1(_0x27f216);});});}exports[_0x6671('0x1d')]=function(_0xd72b49){var _0x51f13b=this;return new Promise(function(_0x10e4a5,_0x256f87){return db[_0x6671('0x1e')]['findAll']({'raw':_0xd72b49[_0x6671('0x1f')]?_0xd72b49[_0x6671('0x1f')][_0x6671('0x20')]===undefined?!![]:![]:!![],'where':_0xd72b49[_0x6671('0x1f')]?_0xd72b49['options'][_0x6671('0x21')]||null:null,'attributes':_0xd72b49[_0x6671('0x1f')]?_0xd72b49[_0x6671('0x1f')][_0x6671('0x22')]||null:null,'limit':_0xd72b49['options']?_0xd72b49[_0x6671('0x1f')][_0x6671('0x23')]||null:null,'include':_0xd72b49[_0x6671('0x1f')]?_0xd72b49[_0x6671('0x1f')][_0x6671('0x24')]?_['map'](_0xd72b49[_0x6671('0x1f')][_0x6671('0x24')],function(_0x3af8d0){return{'model':db[_0x3af8d0[_0x6671('0x25')]],'as':_0x3af8d0['as'],'attributes':_0x3af8d0[_0x6671('0x22')],'include':_0x3af8d0[_0x6671('0x24')]?_['map'](_0x3af8d0['include'],function(_0x38e884){return{'model':db[_0x38e884['model']],'as':_0x38e884['as'],'attributes':_0x38e884[_0x6671('0x22')],'include':_0x38e884[_0x6671('0x24')]?_[_0x6671('0x26')](_0x38e884[_0x6671('0x24')],function(_0x5d4f04){return{'model':db[_0x5d4f04[_0x6671('0x25')]],'as':_0x5d4f04['as'],'attributes':_0x5d4f04[_0x6671('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6671('0x11')](function(_0xad69ee){logger['info']('GetOpenchannelQueue',_0xd72b49);logger['debug'](_0x6671('0x1d'),_0xd72b49,JSON['stringify'](_0xad69ee));_0x10e4a5(_0xad69ee);})[_0x6671('0x1c')](function(_0x142228){logger['error'](_0x6671('0x1d'),_0x142228[_0x6671('0x1a')],_0xd72b49);_0x256f87(_0x51f13b[_0x6671('0x17')](0x1f4,_0x142228[_0x6671('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x416922){var _0x2aeec9=this;return new Promise(function(_0x234b03,_0x1bc6a9){return db['OpenchannelQueue'][_0x6671('0x27')]({'raw':_0x416922[_0x6671('0x1f')]?_0x416922['options'][_0x6671('0x20')]===undefined?!![]:![]:!![],'where':_0x416922['options']?_0x416922[_0x6671('0x1f')][_0x6671('0x21')]||null:null,'attributes':_0x416922[_0x6671('0x1f')]?_0x416922[_0x6671('0x1f')][_0x6671('0x22')]||null:null,'include':_0x416922[_0x6671('0x1f')]?_0x416922['options'][_0x6671('0x24')]?_[_0x6671('0x26')](_0x416922['options']['include'],function(_0x3f001e){return{'model':db[_0x3f001e['model']],'as':_0x3f001e['as'],'attributes':_0x3f001e[_0x6671('0x22')],'include':_0x3f001e[_0x6671('0x24')]?_[_0x6671('0x26')](_0x3f001e[_0x6671('0x24')],function(_0x9acc61){return{'model':db[_0x9acc61[_0x6671('0x25')]],'as':_0x9acc61['as'],'attributes':_0x9acc61[_0x6671('0x22')],'include':_0x9acc61['include']?_[_0x6671('0x26')](_0x9acc61[_0x6671('0x24')],function(_0x2c3bd4){return{'model':db[_0x2c3bd4['model']],'as':_0x2c3bd4['as'],'attributes':_0x2c3bd4[_0x6671('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6671('0x11')](function(_0x523446){logger[_0x6671('0x12')](_0x6671('0x28'),_0x416922);logger[_0x6671('0x14')]('ShowOpenchannelQueue',_0x416922,JSON[_0x6671('0x16')](_0x523446));_0x234b03(_0x523446);})[_0x6671('0x1c')](function(_0x493c68){logger[_0x6671('0x17')](_0x6671('0x28'),_0x493c68[_0x6671('0x1a')],_0x416922);_0x1bc6a9(_0x2aeec9[_0x6671('0x17')](0x1f4,_0x493c68[_0x6671('0x1a')]));});});}; \ No newline at end of file +var _0xfad5=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','catch','OpenchannelQueue','find','where','info','ShowOpenchannelQueue','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfad5,0xba));var _0x5fad=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xfad5[_0x51fe5f];return _0x4abce9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5fad('0x0'));var rs=require(_0x5fad('0x1'));var fs=require('fs');var Redis=require(_0x5fad('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fad('0x3'));var logger=require(_0x5fad('0x4'))(_0x5fad('0x5'));var config=require(_0x5fad('0x6'));var jayson=require(_0x5fad('0x7'));var client=jayson[_0x5fad('0x8')][_0x5fad('0x9')]({'port':0x232a});config[_0x5fad('0xa')]=_[_0x5fad('0xb')](config[_0x5fad('0xa')],{'host':_0x5fad('0xc'),'port':0x18eb});var socket=require(_0x5fad('0xd'))(new Redis(config[_0x5fad('0xa')]));require(_0x5fad('0xe'))[_0x5fad('0xf')](socket);function respondWithRpcPromise(_0x135d8d,_0x1167a0,_0xcdad29){return new BPromise(function(_0x22e923,_0x81a9e9){return client[_0x5fad('0x10')](_0x135d8d,_0xcdad29)[_0x5fad('0x11')](function(_0x4fa4af){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x1167a0,_0x5fad('0x12'));logger[_0x5fad('0x13')](_0x5fad('0x14'),_0x1167a0,_0x5fad('0x12'),JSON[_0x5fad('0x15')](_0x4fa4af));if(_0x4fa4af[_0x5fad('0x16')]){if(_0x4fa4af['error']['code']===0x1f4){logger[_0x5fad('0x16')](_0x5fad('0x17'),_0x1167a0,_0x4fa4af[_0x5fad('0x16')][_0x5fad('0x18')]);return _0x81a9e9(_0x4fa4af[_0x5fad('0x16')][_0x5fad('0x18')]);}logger['error'](_0x5fad('0x17'),_0x1167a0,_0x4fa4af['error'][_0x5fad('0x18')]);return _0x22e923(_0x4fa4af[_0x5fad('0x16')][_0x5fad('0x18')]);}else{logger['info'](_0x5fad('0x17'),_0x1167a0,_0x5fad('0x12'));_0x22e923(_0x4fa4af[_0x5fad('0x19')][_0x5fad('0x18')]);}})['catch'](function(_0x388da4){logger[_0x5fad('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1167a0,_0x388da4);_0x81a9e9(_0x388da4);});});}exports[_0x5fad('0x1a')]=function(_0x306f8c){var _0x28ffea=this;return new Promise(function(_0x3faa43,_0x29db96){return db['OpenchannelQueue'][_0x5fad('0x1b')]({'raw':_0x306f8c['options']?_0x306f8c[_0x5fad('0x1c')][_0x5fad('0x1d')]===undefined?!![]:![]:!![],'where':_0x306f8c[_0x5fad('0x1c')]?_0x306f8c['options']['where']||null:null,'attributes':_0x306f8c[_0x5fad('0x1c')]?_0x306f8c['options'][_0x5fad('0x1e')]||null:null,'limit':_0x306f8c[_0x5fad('0x1c')]?_0x306f8c[_0x5fad('0x1c')][_0x5fad('0x1f')]||null:null,'include':_0x306f8c['options']?_0x306f8c[_0x5fad('0x1c')][_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x306f8c['options']['include'],function(_0x44a13b){return{'model':db[_0x44a13b[_0x5fad('0x22')]],'as':_0x44a13b['as'],'attributes':_0x44a13b[_0x5fad('0x1e')],'include':_0x44a13b[_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x44a13b[_0x5fad('0x20')],function(_0x3a81c0){return{'model':db[_0x3a81c0[_0x5fad('0x22')]],'as':_0x3a81c0['as'],'attributes':_0x3a81c0[_0x5fad('0x1e')],'include':_0x3a81c0[_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x3a81c0['include'],function(_0x2a5c83){return{'model':db[_0x2a5c83[_0x5fad('0x22')]],'as':_0x2a5c83['as'],'attributes':_0x2a5c83[_0x5fad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5fad('0x11')](function(_0x3018af){logger['info'](_0x5fad('0x1a'),_0x306f8c);logger[_0x5fad('0x13')](_0x5fad('0x1a'),_0x306f8c,JSON['stringify'](_0x3018af));_0x3faa43(_0x3018af);})[_0x5fad('0x23')](function(_0x7194e1){logger['error'](_0x5fad('0x1a'),_0x7194e1[_0x5fad('0x18')],_0x306f8c);_0x29db96(_0x28ffea[_0x5fad('0x16')](0x1f4,_0x7194e1[_0x5fad('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x59d8e5){var _0x95cddd=this;return new Promise(function(_0x1c8bb9,_0x48cffa){return db[_0x5fad('0x24')][_0x5fad('0x25')]({'raw':_0x59d8e5['options']?_0x59d8e5[_0x5fad('0x1c')][_0x5fad('0x1d')]===undefined?!![]:![]:!![],'where':_0x59d8e5['options']?_0x59d8e5[_0x5fad('0x1c')][_0x5fad('0x26')]||null:null,'attributes':_0x59d8e5[_0x5fad('0x1c')]?_0x59d8e5[_0x5fad('0x1c')][_0x5fad('0x1e')]||null:null,'include':_0x59d8e5[_0x5fad('0x1c')]?_0x59d8e5[_0x5fad('0x1c')]['include']?_[_0x5fad('0x21')](_0x59d8e5['options'][_0x5fad('0x20')],function(_0x375ba4){return{'model':db[_0x375ba4['model']],'as':_0x375ba4['as'],'attributes':_0x375ba4[_0x5fad('0x1e')],'include':_0x375ba4[_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x375ba4[_0x5fad('0x20')],function(_0xf907b){return{'model':db[_0xf907b[_0x5fad('0x22')]],'as':_0xf907b['as'],'attributes':_0xf907b[_0x5fad('0x1e')],'include':_0xf907b['include']?_[_0x5fad('0x21')](_0xf907b['include'],function(_0x513b16){return{'model':db[_0x513b16['model']],'as':_0x513b16['as'],'attributes':_0x513b16[_0x5fad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5fad('0x11')](function(_0xaa1100){logger[_0x5fad('0x27')](_0x5fad('0x28'),_0x59d8e5);logger[_0x5fad('0x13')](_0x5fad('0x28'),_0x59d8e5,JSON['stringify'](_0xaa1100));_0x1c8bb9(_0xaa1100);})[_0x5fad('0x23')](function(_0x2f8a20){logger[_0x5fad('0x16')](_0x5fad('0x28'),_0x2f8a20[_0x5fad('0x18')],_0x59d8e5);_0x48cffa(_0x95cddd[_0x5fad('0x16')](0x1f4,_0x2f8a20['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 697d09d..5f7b29d 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdccc=['update','emit','register','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x9e9ead,_0x1a7ff3){var _0x31ff57=function(_0x22a9da){while(--_0x22a9da){_0x9e9ead['push'](_0x9e9ead['shift']());}};_0x31ff57(++_0x1a7ff3);}(_0xdccc,0x10d));var _0xcdcc=function(_0x13ea28,_0x3c6887){_0x13ea28=_0x13ea28-0x0;var _0x43b351=_0xdccc[_0x13ea28];return _0x43b351;};'use strict';var OpenchannelQueueEvents=require(_0xcdcc('0x0'));var events=[_0xcdcc('0x1'),_0xcdcc('0x2'),_0xcdcc('0x3')];function createListener(_0x1c06c7,_0x3bbdd1){return function(_0x3671c8){_0x3bbdd1[_0xcdcc('0x4')](_0x1c06c7,_0x3671c8);};}function removeListener(_0x2210d4,_0x29c67f){return function(){OpenchannelQueueEvents['removeListener'](_0x2210d4,_0x29c67f);};}exports[_0xcdcc('0x5')]=function(_0x4708fc){for(var _0x1ef13e=0x0,_0x13629e=events[_0xcdcc('0x6')];_0x1ef13e<_0x13629e;_0x1ef13e++){var _0x3e6525=events[_0x1ef13e];var _0x58aee3=createListener(_0xcdcc('0x7')+_0x3e6525,_0x4708fc);OpenchannelQueueEvents['on'](_0x3e6525,_0x58aee3);}}; \ No newline at end of file +var _0x7385=['update','emit','removeListener','save','remove'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x7385,0x1ac));var _0x5738=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7385[_0x397e5f];return _0x5302b8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x5738('0x0'),_0x5738('0x1'),_0x5738('0x2')];function createListener(_0x45b766,_0x16ca0f){return function(_0x1c123e){_0x16ca0f[_0x5738('0x3')](_0x45b766,_0x1c123e);};}function removeListener(_0x33c550,_0xebd9a4){return function(){OpenchannelQueueEvents[_0x5738('0x4')](_0x33c550,_0xebd9a4);};}exports['register']=function(_0x4fd36c){for(var _0x20df37=0x0,_0x2a0d2b=events['length'];_0x20df37<_0x2a0d2b;_0x20df37++){var _0x5723ba=events[_0x20df37];var _0x42793f=createListener('openchannelQueue:'+_0x5723ba,_0x4fd36c);OpenchannelQueueEvents['on'](_0x5723ba,_0x42793f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 09d54a9..2489d97 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf22d=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x4a5aaa,_0x358361){var _0x51d89d=function(_0x5ef2ae){while(--_0x5ef2ae){_0x4a5aaa['push'](_0x4a5aaa['shift']());}};_0x51d89d(++_0x358361);}(_0xf22d,0x1c2));var _0xdf22=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xf22d[_0x30f5bb];return _0x1cfc00;};'use strict';var multer=require(_0xdf22('0x0'));var util=require(_0xdf22('0x1'));var path=require(_0xdf22('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdf22('0x3')]();var fs_extra=require(_0xdf22('0x4'));var auth=require(_0xdf22('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf22('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdf22('0x7')]);router[_0xdf22('0x8')](_0xdf22('0x9'),auth[_0xdf22('0xa')](),controller['describe']);router[_0xdf22('0x8')](_0xdf22('0xb'),auth[_0xdf22('0xa')](),controller[_0xdf22('0xc')]);router['post']('/',auth[_0xdf22('0xa')](),controller[_0xdf22('0xd')]);router[_0xdf22('0xe')]('/:id',auth[_0xdf22('0xa')](),controller[_0xdf22('0xf')]);router[_0xdf22('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xdf22('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7b75=['show','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x282823,_0x422f23){var _0x162a49=function(_0x30f9c4){while(--_0x30f9c4){_0x282823['push'](_0x282823['shift']());}};_0x162a49(++_0x422f23);}(_0x7b75,0x16d));var _0x57b7=function(_0x1900be,_0x59745d){_0x1900be=_0x1900be-0x0;var _0x1b44d5=_0x7b75[_0x1900be];return _0x1b44d5;};'use strict';var multer=require(_0x57b7('0x0'));var util=require(_0x57b7('0x1'));var path=require(_0x57b7('0x2'));var timeout=require(_0x57b7('0x3'));var express=require(_0x57b7('0x4'));var router=express['Router']();var fs_extra=require(_0x57b7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x57b7('0x6'));var config=require(_0x57b7('0x7'));var controller=require(_0x57b7('0x8'));router[_0x57b7('0x9')]('/',auth[_0x57b7('0xa')](),controller[_0x57b7('0xb')]);router[_0x57b7('0x9')](_0x57b7('0xc'),auth[_0x57b7('0xa')](),controller[_0x57b7('0xd')]);router[_0x57b7('0x9')](_0x57b7('0xe'),auth[_0x57b7('0xa')](),controller[_0x57b7('0xf')]);router['post']('/',auth[_0x57b7('0xa')](),controller[_0x57b7('0x10')]);router[_0x57b7('0x11')]('/:id',auth[_0x57b7('0xa')](),controller[_0x57b7('0x12')]);router['delete']('/:id',auth[_0x57b7('0xa')](),controller[_0x57b7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index aabc325..1a95fdf 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb54c=['DATE','moment','sequelize','STRING'];(function(_0x9a7d5b,_0x50327f){var _0xe2a5b3=function(_0x98ad8d){while(--_0x98ad8d){_0x9a7d5b['push'](_0x9a7d5b['shift']());}};_0xe2a5b3(++_0x50327f);}(_0xb54c,0x1d5));var _0xcb54=function(_0x56b4b9,_0x5b0a5c){_0x56b4b9=_0x56b4b9-0x0;var _0xe1b391=_0xb54c[_0x56b4b9];return _0xe1b391;};'use strict';var moment=require(_0xcb54('0x0'));var Sequelize=require(_0xcb54('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xcb54('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcb54('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xcb54('0x3')]},'exitAt':{'type':Sequelize[_0xcb54('0x3')]},'reason':{'type':Sequelize[_0xcb54('0x2')]}}; \ No newline at end of file +var _0x23f6=['DATE','moment','sequelize','exports','STRING'];(function(_0x5222cb,_0x5b965e){var _0x88f3eb=function(_0x353421){while(--_0x353421){_0x5222cb['push'](_0x5222cb['shift']());}};_0x88f3eb(++_0x5b965e);}(_0x23f6,0xb0));var _0x623f=function(_0x11ee3d,_0x2d36bc){_0x11ee3d=_0x11ee3d-0x0;var _0x45e37e=_0x23f6[_0x11ee3d];return _0x45e37e;};'use strict';var moment=require(_0x623f('0x0'));var Sequelize=require(_0x623f('0x1'));module[_0x623f('0x2')]={'uniqueid':{'type':Sequelize[_0x623f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x623f('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x623f('0x4')]},'acceptAt':{'type':Sequelize[_0x623f('0x4')]},'exitAt':{'type':Sequelize[_0x623f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e18c8a6..485ed31 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9620=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3e5c33,_0xe6087d){var _0x52817f=function(_0xe8d26c){while(--_0xe8d26c){_0x3e5c33['push'](_0x3e5c33['shift']());}};_0x52817f(++_0xe6087d);}(_0x9620,0x124));var _0x0962=function(_0x3cc30c,_0x415f9c){_0x3cc30c=_0x3cc30c-0x0;var _0x3fd0f7=_0x9620[_0x3cc30c];return _0x3fd0f7;};'use strict';var emlformat=require(_0x0962('0x0'));var rimraf=require(_0x0962('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0962('0x2'));var rp=require('request-promise');var moment=require(_0x0962('0x3'));var BPromise=require(_0x0962('0x4'));var Mustache=require(_0x0962('0x5'));var util=require(_0x0962('0x6'));var path=require(_0x0962('0x7'));var sox=require(_0x0962('0x8'));var csv=require(_0x0962('0x9'));var ejs=require(_0x0962('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0962('0xb'));var squel=require(_0x0962('0xc'));var crypto=require(_0x0962('0xd'));var jsforce=require(_0x0962('0xe'));var deskjs=require(_0x0962('0xf'));var toCsv=require(_0x0962('0x9'));var querystring=require(_0x0962('0x10'));var Papa=require(_0x0962('0x11'));var Redis=require(_0x0962('0x12'));var authService=require(_0x0962('0x13'));var qs=require(_0x0962('0x14'));var as=require(_0x0962('0x15'));var hardwareService=require(_0x0962('0x16'));var logger=require(_0x0962('0x17'))('api');var utils=require(_0x0962('0x18'));var config=require(_0x0962('0x19'));var licenseUtil=require(_0x0962('0x1a'));var db=require(_0x0962('0x1b'))['db'];function respondWithStatusCode(_0x5a6aef,_0x5ed8ca){_0x5ed8ca=_0x5ed8ca||0xcc;return function(_0x265d96){if(_0x265d96){return _0x5a6aef['sendStatus'](_0x5ed8ca);}return _0x5a6aef[_0x0962('0x1c')](_0x5ed8ca)[_0x0962('0x1d')]();};}function respondWithResult(_0x137eda,_0x1a301a){_0x1a301a=_0x1a301a||0xc8;return function(_0x58683c){if(_0x58683c){return _0x137eda['status'](_0x1a301a)[_0x0962('0x1e')](_0x58683c);}};}function respondWithFilteredResult(_0x1206cb,_0x4bf062){return function(_0x3190e3){if(_0x3190e3){var _0x427e2e=typeof _0x4bf062[_0x0962('0x1f')]===_0x0962('0x20')&&typeof _0x4bf062['limit']===_0x0962('0x20');var _0x1719a6=_0x3190e3[_0x0962('0x21')];var _0x1769a1=_0x427e2e?0x0:_0x4bf062[_0x0962('0x1f')];var _0x359b66=_0x427e2e?_0x3190e3[_0x0962('0x21')]:_0x4bf062[_0x0962('0x1f')]+_0x4bf062[_0x0962('0x22')];var _0x49e377;if(_0x359b66>=_0x1719a6){_0x359b66=_0x1719a6;_0x49e377=0xc8;}else{_0x49e377=0xce;}_0x1206cb['status'](_0x49e377);return _0x1206cb['set'](_0x0962('0x23'),_0x1769a1+'-'+_0x359b66+'/'+_0x1719a6)[_0x0962('0x1e')](_0x3190e3);}return null;};}function patchUpdates(_0x2cbf39){return function(_0x2ef2e4){try{jsonpatch[_0x0962('0x24')](_0x2ef2e4,_0x2cbf39,!![]);}catch(_0x37985b){return BPromise['reject'](_0x37985b);}return _0x2ef2e4['save']();};}function saveUpdates(_0x3a7f61,_0x8ec407){return function(_0x192a1c){if(_0x192a1c){return _0x192a1c['update'](_0x3a7f61)[_0x0962('0x25')](function(_0xfd8539){return _0xfd8539;});}return null;};}function removeEntity(_0x479f27,_0x27ced7){return function(_0x13a605){if(_0x13a605){return _0x13a605[_0x0962('0x26')]()[_0x0962('0x25')](function(){_0x479f27[_0x0962('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d716,_0x2e06fa){return function(_0x402d28){if(!_0x402d28){_0x54d716['sendStatus'](0x194);}return _0x402d28;};}function handleError(_0x2b4074,_0x359cb7){_0x359cb7=_0x359cb7||0x1f4;return function(_0x19d041){logger[_0x0962('0x27')](_0x19d041[_0x0962('0x28')]);if(_0x19d041[_0x0962('0x29')]){delete _0x19d041[_0x0962('0x29')];}_0x2b4074[_0x0962('0x1c')](_0x359cb7)[_0x0962('0x2a')](_0x19d041);};}exports[_0x0962('0x2b')]=function(_0x3aceb7,_0x21737a){var _0x576144={},_0xe73765={},_0x4e2fc8={'count':0x0,'rows':[]};var _0x48071d=_[_0x0962('0x2c')](db[_0x0962('0x2d')][_0x0962('0x2e')],function(_0x415567){return{'name':_0x415567[_0x0962('0x2f')],'type':_0x415567[_0x0962('0x30')]['key']};});_0xe73765[_0x0962('0x31')]=_['map'](_0x48071d,'name');_0xe73765['query']=_[_0x0962('0x32')](_0x3aceb7[_0x0962('0x33')]);_0xe73765['filters']=_[_0x0962('0x34')](_0xe73765[_0x0962('0x31')],_0xe73765[_0x0962('0x33')]);_0x576144[_0x0962('0x35')]=_[_0x0962('0x34')](_0xe73765['model'],qs[_0x0962('0x36')](_0x3aceb7[_0x0962('0x33')][_0x0962('0x36')]));_0x576144[_0x0962('0x35')]=_0x576144[_0x0962('0x35')][_0x0962('0x37')]?_0x576144[_0x0962('0x35')]:_0xe73765[_0x0962('0x31')];if(!_0x3aceb7['query'][_0x0962('0x38')](_0x0962('0x39'))){_0x576144['limit']=qs['limit'](_0x3aceb7['query'][_0x0962('0x22')]);_0x576144['offset']=qs[_0x0962('0x1f')](_0x3aceb7[_0x0962('0x33')][_0x0962('0x1f')]);}_0x576144[_0x0962('0x3a')]=qs['sort'](_0x3aceb7[_0x0962('0x33')][_0x0962('0x3b')]);_0x576144[_0x0962('0x3c')]=qs[_0x0962('0x3d')](_['pick'](_0x3aceb7[_0x0962('0x33')],_0xe73765[_0x0962('0x3d')]),_0x48071d);if(_0x3aceb7[_0x0962('0x33')]['filter']){_0x576144[_0x0962('0x3c')]=_[_0x0962('0x3e')](_0x576144[_0x0962('0x3c')],{'$or':_[_0x0962('0x2c')](_0x48071d,function(_0x3fc80a){if(_0x3fc80a[_0x0962('0x30')]!==_0x0962('0x3f')){var _0x58c6de={};_0x58c6de[_0x3fc80a[_0x0962('0x29')]]={'$like':'%'+_0x3aceb7['query'][_0x0962('0x40')]+'%'};return _0x58c6de;}})});}_0x576144=_[_0x0962('0x3e')]({},_0x576144,_0x3aceb7[_0x0962('0x41')]);var _0x1dbfb7={'where':_0x576144[_0x0962('0x3c')]};return db[_0x0962('0x2d')][_0x0962('0x21')](_0x1dbfb7)['then'](function(_0x420137){_0x4e2fc8[_0x0962('0x21')]=_0x420137;if(_0x3aceb7[_0x0962('0x33')]['includeAll']){_0x576144['include']=[{'all':!![]}];}return db[_0x0962('0x2d')][_0x0962('0x42')](_0x576144);})[_0x0962('0x25')](function(_0x3b28d6){_0x4e2fc8[_0x0962('0x43')]=_0x3b28d6;return _0x4e2fc8;})[_0x0962('0x25')](respondWithFilteredResult(_0x21737a,_0x576144))['catch'](handleError(_0x21737a,null));};exports[_0x0962('0x44')]=function(_0x40cf62,_0x16e749){var _0x59a869={'raw':!![],'where':{'id':_0x40cf62[_0x0962('0x45')]['id']}},_0xf484d3={};_0xf484d3[_0x0962('0x31')]=_[_0x0962('0x32')](db[_0x0962('0x2d')]['rawAttributes']);_0xf484d3[_0x0962('0x33')]=_[_0x0962('0x32')](_0x40cf62[_0x0962('0x33')]);_0xf484d3[_0x0962('0x3d')]=_[_0x0962('0x34')](_0xf484d3[_0x0962('0x31')],_0xf484d3[_0x0962('0x33')]);_0x59a869['attributes']=_[_0x0962('0x34')](_0xf484d3['model'],qs[_0x0962('0x36')](_0x40cf62['query']['fields']));_0x59a869[_0x0962('0x35')]=_0x59a869[_0x0962('0x35')]['length']?_0x59a869['attributes']:_0xf484d3[_0x0962('0x31')];if(_0x40cf62['query'][_0x0962('0x46')]){_0x59a869[_0x0962('0x47')]=[{'all':!![]}];}_0x59a869=_['merge']({},_0x59a869,_0x40cf62['options']);return db[_0x0962('0x2d')][_0x0962('0x48')](_0x59a869)[_0x0962('0x25')](handleEntityNotFound(_0x16e749,null))[_0x0962('0x25')](respondWithResult(_0x16e749,null))[_0x0962('0x49')](handleError(_0x16e749,null));};exports[_0x0962('0x4a')]=function(_0x34c38e,_0x128049){return db[_0x0962('0x2d')][_0x0962('0x4a')](_0x34c38e[_0x0962('0x4b')],{})[_0x0962('0x25')](respondWithResult(_0x128049,0xc9))['catch'](handleError(_0x128049,null));};exports[_0x0962('0x4c')]=function(_0x2557dd,_0x1ebe77){if(_0x2557dd[_0x0962('0x4b')]['id']){delete _0x2557dd[_0x0962('0x4b')]['id'];}return db[_0x0962('0x2d')][_0x0962('0x48')]({'where':{'id':_0x2557dd[_0x0962('0x45')]['id']}})[_0x0962('0x25')](handleEntityNotFound(_0x1ebe77,null))[_0x0962('0x25')](saveUpdates(_0x2557dd[_0x0962('0x4b')],null))[_0x0962('0x25')](respondWithResult(_0x1ebe77,null))[_0x0962('0x49')](handleError(_0x1ebe77,null));};exports[_0x0962('0x26')]=function(_0xe70b37,_0x10dc94){return db[_0x0962('0x2d')][_0x0962('0x48')]({'where':{'id':_0xe70b37[_0x0962('0x45')]['id']}})[_0x0962('0x25')](handleEntityNotFound(_0x10dc94,null))[_0x0962('0x25')](removeEntity(_0x10dc94,null))[_0x0962('0x49')](handleError(_0x10dc94,null));};exports[_0x0962('0x4d')]=function(_0x5e2223,_0x2af905){return db['OpenchannelQueueReport']['describe']()[_0x0962('0x25')](respondWithResult(_0x2af905,null))['catch'](handleError(_0x2af905,null));}; \ No newline at end of file +var _0x7757=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x4b8afa,_0x55852a){var _0x3ccbe2=function(_0x3c6c0e){while(--_0x3c6c0e){_0x4b8afa['push'](_0x4b8afa['shift']());}};_0x3ccbe2(++_0x55852a);}(_0x7757,0x188));var _0x7775=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7757[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7775('0x0'));var jsonpatch=require(_0x7775('0x1'));var rp=require(_0x7775('0x2'));var moment=require(_0x7775('0x3'));var BPromise=require(_0x7775('0x4'));var Mustache=require(_0x7775('0x5'));var util=require('util');var path=require(_0x7775('0x6'));var sox=require(_0x7775('0x7'));var csv=require(_0x7775('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7775('0x9'));var _=require(_0x7775('0xa'));var squel=require('squel');var crypto=require(_0x7775('0xb'));var jsforce=require(_0x7775('0xc'));var deskjs=require(_0x7775('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7775('0xe'));var Papa=require(_0x7775('0xf'));var Redis=require(_0x7775('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7775('0x11'));var as=require(_0x7775('0x12'));var hardwareService=require(_0x7775('0x13'));var logger=require(_0x7775('0x14'))(_0x7775('0x15'));var utils=require(_0x7775('0x16'));var config=require(_0x7775('0x17'));var licenseUtil=require(_0x7775('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x361332,_0x3972b5){_0x3972b5=_0x3972b5||0xcc;return function(_0x401ecd){if(_0x401ecd){return _0x361332[_0x7775('0x19')](_0x3972b5);}return _0x361332[_0x7775('0x1a')](_0x3972b5)['end']();};}function respondWithResult(_0x10151f,_0x41df2c){_0x41df2c=_0x41df2c||0xc8;return function(_0x2c8689){if(_0x2c8689){return _0x10151f['status'](_0x41df2c)[_0x7775('0x1b')](_0x2c8689);}};}function respondWithFilteredResult(_0xe96d6d,_0x452740){return function(_0x421ff8){if(_0x421ff8){var _0x37f1b7=typeof _0x452740[_0x7775('0x1c')]===_0x7775('0x1d')&&typeof _0x452740[_0x7775('0x1e')]===_0x7775('0x1d');var _0x52447e=_0x421ff8['count'];var _0x4f402b=_0x37f1b7?0x0:_0x452740['offset'];var _0xed5582=_0x37f1b7?_0x421ff8['count']:_0x452740['offset']+_0x452740[_0x7775('0x1e')];var _0x538fbc;if(_0xed5582>=_0x52447e){_0xed5582=_0x52447e;_0x538fbc=0xc8;}else{_0x538fbc=0xce;}_0xe96d6d[_0x7775('0x1a')](_0x538fbc);return _0xe96d6d[_0x7775('0x1f')](_0x7775('0x20'),_0x4f402b+'-'+_0xed5582+'/'+_0x52447e)[_0x7775('0x1b')](_0x421ff8);}return null;};}function patchUpdates(_0x4c75be){return function(_0x3cb2df){try{jsonpatch[_0x7775('0x21')](_0x3cb2df,_0x4c75be,!![]);}catch(_0x5781b1){return BPromise['reject'](_0x5781b1);}return _0x3cb2df[_0x7775('0x22')]();};}function saveUpdates(_0x122ea3,_0x1c50fd){return function(_0x54243e){if(_0x54243e){return _0x54243e[_0x7775('0x23')](_0x122ea3)['then'](function(_0x402046){return _0x402046;});}return null;};}function removeEntity(_0x408871,_0x367e2b){return function(_0x1f87e5){if(_0x1f87e5){return _0x1f87e5['destroy']()[_0x7775('0x24')](function(){_0x408871[_0x7775('0x1a')](0xcc)[_0x7775('0x25')]();});}};}function handleEntityNotFound(_0x4ee870,_0xeda466){return function(_0x566af6){if(!_0x566af6){_0x4ee870[_0x7775('0x19')](0x194);}return _0x566af6;};}function handleError(_0x8503f4,_0x360d55){_0x360d55=_0x360d55||0x1f4;return function(_0x31ee00){logger[_0x7775('0x26')](_0x31ee00[_0x7775('0x27')]);if(_0x31ee00[_0x7775('0x28')]){delete _0x31ee00[_0x7775('0x28')];}_0x8503f4[_0x7775('0x1a')](_0x360d55)['send'](_0x31ee00);};}exports[_0x7775('0x29')]=function(_0x9b5953,_0x5a1738){var _0x3129c6={},_0x4ac0da={},_0x2f1c17={'count':0x0,'rows':[]};var _0x1e4f0f=_[_0x7775('0x2a')](db[_0x7775('0x2b')][_0x7775('0x2c')],function(_0x34e9fe){return{'name':_0x34e9fe[_0x7775('0x2d')],'type':_0x34e9fe[_0x7775('0x2e')][_0x7775('0x2f')]};});_0x4ac0da[_0x7775('0x30')]=_[_0x7775('0x2a')](_0x1e4f0f,_0x7775('0x28'));_0x4ac0da[_0x7775('0x31')]=_[_0x7775('0x32')](_0x9b5953['query']);_0x4ac0da[_0x7775('0x33')]=_[_0x7775('0x34')](_0x4ac0da[_0x7775('0x30')],_0x4ac0da[_0x7775('0x31')]);_0x3129c6[_0x7775('0x35')]=_[_0x7775('0x34')](_0x4ac0da[_0x7775('0x30')],qs['fields'](_0x9b5953[_0x7775('0x31')][_0x7775('0x36')]));_0x3129c6[_0x7775('0x35')]=_0x3129c6[_0x7775('0x35')][_0x7775('0x37')]?_0x3129c6[_0x7775('0x35')]:_0x4ac0da['model'];if(!_0x9b5953[_0x7775('0x31')][_0x7775('0x38')](_0x7775('0x39'))){_0x3129c6[_0x7775('0x1e')]=qs[_0x7775('0x1e')](_0x9b5953[_0x7775('0x31')][_0x7775('0x1e')]);_0x3129c6[_0x7775('0x1c')]=qs['offset'](_0x9b5953[_0x7775('0x31')][_0x7775('0x1c')]);}_0x3129c6[_0x7775('0x3a')]=qs['sort'](_0x9b5953[_0x7775('0x31')]['sort']);_0x3129c6[_0x7775('0x3b')]=qs['filters'](_['pick'](_0x9b5953[_0x7775('0x31')],_0x4ac0da[_0x7775('0x33')]),_0x1e4f0f);if(_0x9b5953[_0x7775('0x31')][_0x7775('0x3c')]){_0x3129c6[_0x7775('0x3b')]=_[_0x7775('0x3d')](_0x3129c6[_0x7775('0x3b')],{'$or':_['map'](_0x1e4f0f,function(_0x180b22){if(_0x180b22['type']!==_0x7775('0x3e')){var _0x2a3cde={};_0x2a3cde[_0x180b22[_0x7775('0x28')]]={'$like':'%'+_0x9b5953[_0x7775('0x31')][_0x7775('0x3c')]+'%'};return _0x2a3cde;}})});}_0x3129c6=_[_0x7775('0x3d')]({},_0x3129c6,_0x9b5953['options']);var _0x362119={'where':_0x3129c6[_0x7775('0x3b')]};return db[_0x7775('0x2b')]['count'](_0x362119)[_0x7775('0x24')](function(_0x3e3c94){_0x2f1c17['count']=_0x3e3c94;if(_0x9b5953[_0x7775('0x31')]['includeAll']){_0x3129c6[_0x7775('0x3f')]=[{'all':!![]}];}return db[_0x7775('0x2b')][_0x7775('0x40')](_0x3129c6);})[_0x7775('0x24')](function(_0x4ca997){_0x2f1c17[_0x7775('0x41')]=_0x4ca997;return _0x2f1c17;})['then'](respondWithFilteredResult(_0x5a1738,_0x3129c6))['catch'](handleError(_0x5a1738,null));};exports[_0x7775('0x42')]=function(_0x38519b,_0xe6799b){var _0x12734b={'raw':!![],'where':{'id':_0x38519b[_0x7775('0x43')]['id']}},_0x4fefed={};_0x4fefed[_0x7775('0x30')]=_[_0x7775('0x32')](db[_0x7775('0x2b')][_0x7775('0x2c')]);_0x4fefed[_0x7775('0x31')]=_[_0x7775('0x32')](_0x38519b[_0x7775('0x31')]);_0x4fefed['filters']=_[_0x7775('0x34')](_0x4fefed[_0x7775('0x30')],_0x4fefed['query']);_0x12734b[_0x7775('0x35')]=_[_0x7775('0x34')](_0x4fefed['model'],qs[_0x7775('0x36')](_0x38519b[_0x7775('0x31')]['fields']));_0x12734b[_0x7775('0x35')]=_0x12734b[_0x7775('0x35')]['length']?_0x12734b[_0x7775('0x35')]:_0x4fefed[_0x7775('0x30')];if(_0x38519b[_0x7775('0x31')]['includeAll']){_0x12734b['include']=[{'all':!![]}];}_0x12734b=_['merge']({},_0x12734b,_0x38519b['options']);return db[_0x7775('0x2b')][_0x7775('0x44')](_0x12734b)[_0x7775('0x24')](handleEntityNotFound(_0xe6799b,null))[_0x7775('0x24')](respondWithResult(_0xe6799b,null))[_0x7775('0x45')](handleError(_0xe6799b,null));};exports[_0x7775('0x46')]=function(_0x3c387c,_0x29e595){return db[_0x7775('0x2b')][_0x7775('0x46')](_0x3c387c[_0x7775('0x47')],{})[_0x7775('0x24')](respondWithResult(_0x29e595,0xc9))[_0x7775('0x45')](handleError(_0x29e595,null));};exports[_0x7775('0x23')]=function(_0x247f99,_0xc76534){if(_0x247f99[_0x7775('0x47')]['id']){delete _0x247f99[_0x7775('0x47')]['id'];}return db['OpenchannelQueueReport'][_0x7775('0x44')]({'where':{'id':_0x247f99[_0x7775('0x43')]['id']}})['then'](handleEntityNotFound(_0xc76534,null))[_0x7775('0x24')](saveUpdates(_0x247f99[_0x7775('0x47')],null))[_0x7775('0x24')](respondWithResult(_0xc76534,null))[_0x7775('0x45')](handleError(_0xc76534,null));};exports[_0x7775('0x48')]=function(_0x4cc612,_0x398cb6){return db['OpenchannelQueueReport'][_0x7775('0x44')]({'where':{'id':_0x4cc612[_0x7775('0x43')]['id']}})['then'](handleEntityNotFound(_0x398cb6,null))[_0x7775('0x24')](removeEntity(_0x398cb6,null))[_0x7775('0x45')](handleError(_0x398cb6,null));};exports['describe']=function(_0x13e599,_0x1ab56a){return db[_0x7775('0x2b')][_0x7775('0x49')]()['then'](respondWithResult(_0x1ab56a,null))[_0x7775('0x45')](handleError(_0x1ab56a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 083d3b0..25ffa63 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x33bc9a,_0x838971){var _0x5a6f6a=function(_0x30db4b){while(--_0x30db4b){_0x33bc9a['push'](_0x33bc9a['shift']());}};_0x5a6f6a(++_0x838971);}(_0x7a54,0x106));var _0x47a5=function(_0x30af64,_0x3ab86c){_0x30af64=_0x30af64-0x0;var _0x2a9242=_0x7a54[_0x30af64];return _0x2a9242;};'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 +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x123436,_0x1f2426){var _0x2d2f37=function(_0x3dec50){while(--_0x3dec50){_0x123436['push'](_0x123436['shift']());}};_0x2d2f37(++_0x1f2426);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5d2c75e..0bf3914 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd070=['catch','create','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xd58fc1,_0x1d931c){var _0xc71c40=function(_0x8f4d82){while(--_0x8f4d82){_0xd58fc1['push'](_0xd58fc1['shift']());}};_0xc71c40(++_0x1d931c);}(_0xd070,0x8e));var _0x0d07=function(_0x232032,_0x1683d1){_0x232032=_0x232032-0x0;var _0x21b8b9=_0xd070[_0x232032];return _0x21b8b9;};'use strict';var _=require(_0x0d07('0x0'));var util=require('util');var moment=require(_0x0d07('0x1'));var BPromise=require(_0x0d07('0x2'));var rs=require(_0x0d07('0x3'));var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require(_0x0d07('0x7'))(_0x0d07('0x8'));var config=require(_0x0d07('0x9'));var jayson=require(_0x0d07('0xa'));var client=jayson[_0x0d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d75a,_0x5a4366,_0x20fd56){return new BPromise(function(_0x8c16d8,_0x1f989e){return client[_0x0d07('0xc')](_0x13d75a,_0x20fd56)[_0x0d07('0xd')](function(_0xc5b04d){logger[_0x0d07('0xe')](_0x0d07('0xf'),_0x5a4366,_0x0d07('0x10'));logger[_0x0d07('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x5a4366,'request\x20sent',JSON[_0x0d07('0x12')](_0xc5b04d));if(_0xc5b04d[_0x0d07('0x13')]){if(_0xc5b04d['error'][_0x0d07('0x14')]===0x1f4){logger['error'](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')]['message']);return _0x1f989e(_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);}logger[_0x0d07('0x13')](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);return _0x8c16d8(_0xc5b04d['error'][_0x0d07('0x15')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5a4366,_0x0d07('0x10'));_0x8c16d8(_0xc5b04d[_0x0d07('0x16')][_0x0d07('0x15')]);}})[_0x0d07('0x17')](function(_0x220203){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5a4366,_0x220203);_0x1f989e(_0x220203);});});}exports['CreateOpenchannelQueueReport']=function(_0x187df2){var _0x312015=this;return new Promise(function(_0x52cb4b,_0x410ad2){return db['OpenchannelQueueReport'][_0x0d07('0x18')](_0x187df2['body'],{'raw':_0x187df2['options']?_0x187df2[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d07('0xd')](function(_0x54790f){logger[_0x0d07('0xe')]('CreateOpenchannelQueueReport',_0x187df2);logger['debug'](_0x0d07('0x1a'),_0x187df2,JSON[_0x0d07('0x12')](_0x54790f));_0x52cb4b(_0x54790f);})[_0x0d07('0x17')](function(_0x57e997){logger[_0x0d07('0x13')]('CreateOpenchannelQueueReport',_0x57e997['message'],_0x187df2);_0x410ad2(_0x312015[_0x0d07('0x13')](0x1f4,_0x57e997[_0x0d07('0x15')]));});});};exports[_0x0d07('0x1b')]=function(_0x19f82f){var _0x4e0c97=this;return new Promise(function(_0x5898db,_0x9d9bfd){return db['OpenchannelQueueReport'][_0x0d07('0x1c')](_0x19f82f[_0x0d07('0x1d')],{'raw':_0x19f82f['options']?_0x19f82f[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f82f['options']?_0x19f82f['options'][_0x0d07('0x1e')]||null:null,'attributes':_0x19f82f[_0x0d07('0x19')]?_0x19f82f[_0x0d07('0x19')][_0x0d07('0x1f')]||null:null,'limit':_0x19f82f[_0x0d07('0x19')]?_0x19f82f[_0x0d07('0x19')][_0x0d07('0x20')]||null:null})[_0x0d07('0xd')](function(_0x4c68d7){logger['info'](_0x0d07('0x1b'),_0x19f82f);logger[_0x0d07('0x11')](_0x0d07('0x1b'),_0x19f82f,JSON[_0x0d07('0x12')](_0x4c68d7));_0x5898db(_0x4c68d7);})[_0x0d07('0x17')](function(_0xb7d4d){logger[_0x0d07('0x13')](_0x0d07('0x1b'),_0xb7d4d[_0x0d07('0x15')],_0x19f82f);_0x9d9bfd(_0x4e0c97[_0x0d07('0x13')](0x1f4,_0xb7d4d[_0x0d07('0x15')]));});});}; \ No newline at end of file +var _0x42f4=['jayson/promise','http','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','OpenchannelQueueReport','create','body','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x42f4,0x19d));var _0x442f=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x42f4[_0x7a112];return _0x136dc5;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});}exports['CreateOpenchannelQueueReport']=function(_0x54c48a){var _0x5668e0=this;return new Promise(function(_0x5e3dda,_0x1b18fd){return db[_0x442f('0x15')][_0x442f('0x16')](_0x54c48a[_0x442f('0x17')],{'raw':_0x54c48a[_0x442f('0x18')]?_0x54c48a[_0x442f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x442f('0x9')](function(_0x552f81){logger[_0x442f('0x12')](_0x442f('0x19'),_0x54c48a);logger[_0x442f('0xb')]('CreateOpenchannelQueueReport',_0x54c48a,JSON[_0x442f('0xd')](_0x552f81));_0x5e3dda(_0x552f81);})[_0x442f('0x14')](function(_0x5dd019){logger['error'](_0x442f('0x19'),_0x5dd019[_0x442f('0x11')],_0x54c48a);_0x1b18fd(_0x5668e0[_0x442f('0xe')](0x1f4,_0x5dd019[_0x442f('0x11')]));});});};exports[_0x442f('0x1a')]=function(_0x127b9c){var _0x31d445=this;return new Promise(function(_0x372db9,_0x1eae0a){return db['OpenchannelQueueReport'][_0x442f('0x1b')](_0x127b9c[_0x442f('0x17')],{'raw':_0x127b9c[_0x442f('0x18')]?_0x127b9c[_0x442f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127b9c[_0x442f('0x18')]?_0x127b9c[_0x442f('0x18')][_0x442f('0x1c')]||null:null,'attributes':_0x127b9c[_0x442f('0x18')]?_0x127b9c['options'][_0x442f('0x1d')]||null:null,'limit':_0x127b9c[_0x442f('0x18')]?_0x127b9c[_0x442f('0x18')]['limit']||null:null})[_0x442f('0x9')](function(_0x5a272e){logger[_0x442f('0x12')](_0x442f('0x1a'),_0x127b9c);logger[_0x442f('0xb')]('UpdateOpenchannelQueueReport',_0x127b9c,JSON[_0x442f('0xd')](_0x5a272e));_0x372db9(_0x5a272e);})[_0x442f('0x14')](function(_0x16a369){logger[_0x442f('0xe')](_0x442f('0x1a'),_0x16a369['message'],_0x127b9c);_0x1eae0a(_0x31d445['error'](0x1f4,_0x16a369[_0x442f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ae64df8..04b20d8 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33a1=['post','create','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id'];(function(_0x45a85e,_0x292dd7){var _0x4c85b7=function(_0x10059f){while(--_0x10059f){_0x45a85e['push'](_0x45a85e['shift']());}};_0x4c85b7(++_0x292dd7);}(_0x33a1,0x1f3));var _0x133a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x33a1[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x133a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x133a('0x1')]();var fs_extra=require(_0x133a('0x2'));var auth=require(_0x133a('0x3'));var interaction=require(_0x133a('0x4'));var config=require(_0x133a('0x5'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x133a('0x6')]);router[_0x133a('0x7')](_0x133a('0x8'),auth[_0x133a('0x9')](),controller['describe']);router[_0x133a('0x7')](_0x133a('0xa'),auth[_0x133a('0x9')](),controller['show']);router[_0x133a('0xb')]('/',auth[_0x133a('0x9')](),controller[_0x133a('0xc')]);router['put'](_0x133a('0xa'),auth['isAuthenticated'](),controller[_0x133a('0xd')]);router[_0x133a('0xe')](_0x133a('0xa'),auth[_0x133a('0x9')](),controller[_0x133a('0xf')]);module[_0x133a('0x10')]=router; \ No newline at end of file +var _0x5929=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path'];(function(_0x3de09b,_0x335158){var _0xfd3d1b=function(_0x3cfdbd){while(--_0x3cfdbd){_0x3de09b['push'](_0x3de09b['shift']());}};_0xfd3d1b(++_0x335158);}(_0x5929,0x6b));var _0x9592=function(_0x3b9f0e,_0x4808a0){_0x3b9f0e=_0x3b9f0e-0x0;var _0x334fba=_0x5929[_0x3b9f0e];return _0x334fba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9592('0x0'));var timeout=require(_0x9592('0x1'));var express=require(_0x9592('0x2'));var router=express[_0x9592('0x3')]();var fs_extra=require(_0x9592('0x4'));var auth=require(_0x9592('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9592('0x6'));var controller=require(_0x9592('0x7'));router[_0x9592('0x8')]('/',auth[_0x9592('0x9')](),controller['index']);router[_0x9592('0x8')](_0x9592('0xa'),auth[_0x9592('0x9')](),controller[_0x9592('0xb')]);router['get'](_0x9592('0xc'),auth[_0x9592('0x9')](),controller[_0x9592('0xd')]);router[_0x9592('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9592('0xf')](_0x9592('0xc'),auth[_0x9592('0x9')](),controller[_0x9592('0x10')]);router[_0x9592('0x11')](_0x9592('0xc'),auth[_0x9592('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index bbd5828..105ba62 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4a743e,_0x2ed02b){var _0x354374=function(_0x4ec1aa){while(--_0x4ec1aa){_0x4a743e['push'](_0x4a743e['shift']());}};_0x354374(++_0x2ed02b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0xcb91[_0x4bc4c8];return _0x3bb121;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x57f989,_0xc1902a){var _0x1e10ef=function(_0x4a1d57){while(--_0x4a1d57){_0x57f989['push'](_0x57f989['shift']());}};_0x1e10ef(++_0xc1902a);}(_0xaa88,0x137));var _0x8aa8=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xaa88[_0x31a37b];return _0x49ae16;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index bc6480e..c44d825 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe7c=['squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','OpenchannelTransferReport','findAll','rows','catch','show','length','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash'];(function(_0x4fd8d7,_0x129968){var _0x58d7dc=function(_0x244418){while(--_0x244418){_0x4fd8d7['push'](_0x4fd8d7['shift']());}};_0x58d7dc(++_0x129968);}(_0xfe7c,0x172));var _0xcfe7=function(_0x50403a,_0x5a96c8){_0x50403a=_0x50403a-0x0;var _0x2fad23=_0xfe7c[_0x50403a];return _0x2fad23;};'use strict';var emlformat=require(_0xcfe7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfe7('0x1'));var jsonpatch=require(_0xcfe7('0x2'));var rp=require(_0xcfe7('0x3'));var moment=require(_0xcfe7('0x4'));var BPromise=require(_0xcfe7('0x5'));var Mustache=require(_0xcfe7('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcfe7('0x7'));var fs=require('fs');var fs_extra=require(_0xcfe7('0x8'));var _=require(_0xcfe7('0x9'));var squel=require(_0xcfe7('0xa'));var crypto=require(_0xcfe7('0xb'));var jsforce=require(_0xcfe7('0xc'));var deskjs=require(_0xcfe7('0xd'));var toCsv=require(_0xcfe7('0xe'));var querystring=require(_0xcfe7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcfe7('0x10'));var qs=require(_0xcfe7('0x11'));var as=require(_0xcfe7('0x12'));var hardwareService=require(_0xcfe7('0x13'));var logger=require(_0xcfe7('0x14'))(_0xcfe7('0x15'));var utils=require(_0xcfe7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcfe7('0x17'));var db=require(_0xcfe7('0x18'))['db'];function respondWithStatusCode(_0x558f32,_0x4ad43e){_0x4ad43e=_0x4ad43e||0xcc;return function(_0xc2a72a){if(_0xc2a72a){return _0x558f32['sendStatus'](_0x4ad43e);}return _0x558f32[_0xcfe7('0x19')](_0x4ad43e)[_0xcfe7('0x1a')]();};}function respondWithResult(_0x1466ac,_0x58fa34){_0x58fa34=_0x58fa34||0xc8;return function(_0x1f5804){if(_0x1f5804){return _0x1466ac[_0xcfe7('0x19')](_0x58fa34)[_0xcfe7('0x1b')](_0x1f5804);}};}function respondWithFilteredResult(_0x490863,_0x5d0ddf){return function(_0x2b9e89){if(_0x2b9e89){var _0x22b0da=typeof _0x5d0ddf['offset']==='undefined'&&typeof _0x5d0ddf[_0xcfe7('0x1c')]===_0xcfe7('0x1d');var _0x23bb30=_0x2b9e89[_0xcfe7('0x1e')];var _0x295414=_0x22b0da?0x0:_0x5d0ddf[_0xcfe7('0x1f')];var _0x210196=_0x22b0da?_0x2b9e89[_0xcfe7('0x1e')]:_0x5d0ddf['offset']+_0x5d0ddf[_0xcfe7('0x1c')];var _0x2e419a;if(_0x210196>=_0x23bb30){_0x210196=_0x23bb30;_0x2e419a=0xc8;}else{_0x2e419a=0xce;}_0x490863[_0xcfe7('0x19')](_0x2e419a);return _0x490863['set'](_0xcfe7('0x20'),_0x295414+'-'+_0x210196+'/'+_0x23bb30)[_0xcfe7('0x1b')](_0x2b9e89);}return null;};}function patchUpdates(_0x30a729){return function(_0x56004f){try{jsonpatch[_0xcfe7('0x21')](_0x56004f,_0x30a729,!![]);}catch(_0x3de056){return BPromise[_0xcfe7('0x22')](_0x3de056);}return _0x56004f['save']();};}function saveUpdates(_0x4fbe5d,_0x15200c){return function(_0x2c0522){if(_0x2c0522){return _0x2c0522['update'](_0x4fbe5d)[_0xcfe7('0x23')](function(_0x3bce2e){return _0x3bce2e;});}return null;};}function removeEntity(_0x1d34fe,_0x4158c9){return function(_0x4e5ade){if(_0x4e5ade){return _0x4e5ade[_0xcfe7('0x24')]()[_0xcfe7('0x23')](function(){_0x1d34fe['status'](0xcc)[_0xcfe7('0x1a')]();});}};}function handleEntityNotFound(_0x4addc1,_0x4ac893){return function(_0x1fb232){if(!_0x1fb232){_0x4addc1[_0xcfe7('0x25')](0x194);}return _0x1fb232;};}function handleError(_0x3e6776,_0x580061){_0x580061=_0x580061||0x1f4;return function(_0x29a61b){logger[_0xcfe7('0x26')](_0x29a61b[_0xcfe7('0x27')]);if(_0x29a61b[_0xcfe7('0x28')]){delete _0x29a61b['name'];}_0x3e6776[_0xcfe7('0x19')](_0x580061)[_0xcfe7('0x29')](_0x29a61b);};}exports[_0xcfe7('0x2a')]=function(_0x434e21,_0x35a511){var _0x39e2b6={},_0x1692e0={},_0x268ade={'count':0x0,'rows':[]};var _0x34b50b=_[_0xcfe7('0x2b')](db['OpenchannelTransferReport'][_0xcfe7('0x2c')],function(_0x367030){return{'name':_0x367030['fieldName'],'type':_0x367030['type']['key']};});_0x1692e0['model']=_[_0xcfe7('0x2b')](_0x34b50b,_0xcfe7('0x28'));_0x1692e0[_0xcfe7('0x2d')]=_[_0xcfe7('0x2e')](_0x434e21[_0xcfe7('0x2d')]);_0x1692e0[_0xcfe7('0x2f')]=_[_0xcfe7('0x30')](_0x1692e0[_0xcfe7('0x31')],_0x1692e0[_0xcfe7('0x2d')]);_0x39e2b6['attributes']=_['intersection'](_0x1692e0[_0xcfe7('0x31')],qs[_0xcfe7('0x32')](_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x32')]));_0x39e2b6[_0xcfe7('0x33')]=_0x39e2b6[_0xcfe7('0x33')]['length']?_0x39e2b6[_0xcfe7('0x33')]:_0x1692e0[_0xcfe7('0x31')];if(!_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x34')](_0xcfe7('0x35'))){_0x39e2b6[_0xcfe7('0x1c')]=qs['limit'](_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x1c')]);_0x39e2b6[_0xcfe7('0x1f')]=qs[_0xcfe7('0x1f')](_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x1f')]);}_0x39e2b6['order']=qs[_0xcfe7('0x36')](_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x36')]);_0x39e2b6['where']=qs['filters'](_[_0xcfe7('0x37')](_0x434e21[_0xcfe7('0x2d')],_0x1692e0['filters']),_0x34b50b);if(_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x38')]){_0x39e2b6[_0xcfe7('0x39')]=_[_0xcfe7('0x3a')](_0x39e2b6[_0xcfe7('0x39')],{'$or':_['map'](_0x34b50b,function(_0x1255f2){if(_0x1255f2[_0xcfe7('0x3b')]!==_0xcfe7('0x3c')){var _0x142a9f={};_0x142a9f[_0x1255f2[_0xcfe7('0x28')]]={'$like':'%'+_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x38')]+'%'};return _0x142a9f;}})});}_0x39e2b6=_['merge']({},_0x39e2b6,_0x434e21[_0xcfe7('0x3d')]);var _0x37630a={'where':_0x39e2b6[_0xcfe7('0x39')]};return db['OpenchannelTransferReport'][_0xcfe7('0x1e')](_0x37630a)[_0xcfe7('0x23')](function(_0x2951b8){_0x268ade[_0xcfe7('0x1e')]=_0x2951b8;if(_0x434e21[_0xcfe7('0x2d')][_0xcfe7('0x3e')]){_0x39e2b6[_0xcfe7('0x3f')]=[{'all':!![]}];}return db[_0xcfe7('0x40')][_0xcfe7('0x41')](_0x39e2b6);})[_0xcfe7('0x23')](function(_0x597902){_0x268ade[_0xcfe7('0x42')]=_0x597902;return _0x268ade;})[_0xcfe7('0x23')](respondWithFilteredResult(_0x35a511,_0x39e2b6))[_0xcfe7('0x43')](handleError(_0x35a511,null));};exports[_0xcfe7('0x44')]=function(_0xc7a79d,_0x42a12a){var _0x34c2f7={'raw':!![],'where':{'id':_0xc7a79d['params']['id']}},_0x55f3b9={};_0x55f3b9[_0xcfe7('0x31')]=_[_0xcfe7('0x2e')](db['OpenchannelTransferReport'][_0xcfe7('0x2c')]);_0x55f3b9['query']=_[_0xcfe7('0x2e')](_0xc7a79d[_0xcfe7('0x2d')]);_0x55f3b9['filters']=_[_0xcfe7('0x30')](_0x55f3b9[_0xcfe7('0x31')],_0x55f3b9[_0xcfe7('0x2d')]);_0x34c2f7[_0xcfe7('0x33')]=_['intersection'](_0x55f3b9[_0xcfe7('0x31')],qs[_0xcfe7('0x32')](_0xc7a79d[_0xcfe7('0x2d')][_0xcfe7('0x32')]));_0x34c2f7[_0xcfe7('0x33')]=_0x34c2f7[_0xcfe7('0x33')][_0xcfe7('0x45')]?_0x34c2f7[_0xcfe7('0x33')]:_0x55f3b9['model'];if(_0xc7a79d[_0xcfe7('0x2d')]['includeAll']){_0x34c2f7[_0xcfe7('0x3f')]=[{'all':!![]}];}_0x34c2f7=_[_0xcfe7('0x3a')]({},_0x34c2f7,_0xc7a79d[_0xcfe7('0x3d')]);return db[_0xcfe7('0x40')][_0xcfe7('0x46')](_0x34c2f7)['then'](handleEntityNotFound(_0x42a12a,null))[_0xcfe7('0x23')](respondWithResult(_0x42a12a,null))[_0xcfe7('0x43')](handleError(_0x42a12a,null));};exports['create']=function(_0x4cd35d,_0xf35db1){return db[_0xcfe7('0x40')][_0xcfe7('0x47')](_0x4cd35d[_0xcfe7('0x48')],{})[_0xcfe7('0x23')](respondWithResult(_0xf35db1,0xc9))['catch'](handleError(_0xf35db1,null));};exports[_0xcfe7('0x49')]=function(_0x1bac9a,_0x22f2ac){if(_0x1bac9a[_0xcfe7('0x48')]['id']){delete _0x1bac9a[_0xcfe7('0x48')]['id'];}return db[_0xcfe7('0x40')]['find']({'where':{'id':_0x1bac9a[_0xcfe7('0x4a')]['id']}})[_0xcfe7('0x23')](handleEntityNotFound(_0x22f2ac,null))['then'](saveUpdates(_0x1bac9a[_0xcfe7('0x48')],null))['then'](respondWithResult(_0x22f2ac,null))['catch'](handleError(_0x22f2ac,null));};exports[_0xcfe7('0x24')]=function(_0x34fba3,_0x1639c4){return db['OpenchannelTransferReport'][_0xcfe7('0x46')]({'where':{'id':_0x34fba3[_0xcfe7('0x4a')]['id']}})[_0xcfe7('0x23')](handleEntityNotFound(_0x1639c4,null))[_0xcfe7('0x23')](removeEntity(_0x1639c4,null))[_0xcfe7('0x43')](handleError(_0x1639c4,null));};exports[_0xcfe7('0x4b')]=function(_0x4839c7,_0x2e7191){return db['OpenchannelTransferReport'][_0xcfe7('0x4b')]()[_0xcfe7('0x23')](respondWithResult(_0x2e7191,null))[_0xcfe7('0x43')](handleError(_0x2e7191,null));}; \ No newline at end of file +var _0x82b8=['crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','rawAttributes','keys','length','includeAll','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x82b8,0xe1));var _0x882b=function(_0x42eb4a,_0x3abe1b){_0x42eb4a=_0x42eb4a-0x0;var _0x415377=_0x82b8[_0x42eb4a];return _0x415377;};'use strict';var emlformat=require(_0x882b('0x0'));var rimraf=require(_0x882b('0x1'));var zipdir=require(_0x882b('0x2'));var jsonpatch=require(_0x882b('0x3'));var rp=require('request-promise');var moment=require(_0x882b('0x4'));var BPromise=require(_0x882b('0x5'));var Mustache=require(_0x882b('0x6'));var util=require(_0x882b('0x7'));var path=require('path');var sox=require(_0x882b('0x8'));var csv=require('to-csv');var ejs=require(_0x882b('0x9'));var fs=require('fs');var fs_extra=require(_0x882b('0xa'));var _=require('lodash');var squel=require(_0x882b('0xb'));var crypto=require(_0x882b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x882b('0xd'));var querystring=require(_0x882b('0xe'));var Papa=require(_0x882b('0xf'));var Redis=require(_0x882b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x882b('0x11'));var as=require(_0x882b('0x12'));var hardwareService=require(_0x882b('0x13'));var logger=require(_0x882b('0x14'))(_0x882b('0x15'));var utils=require(_0x882b('0x16'));var config=require(_0x882b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x882b('0x18'))['db'];function respondWithStatusCode(_0x22cfa9,_0x2f40d8){_0x2f40d8=_0x2f40d8||0xcc;return function(_0x284616){if(_0x284616){return _0x22cfa9[_0x882b('0x19')](_0x2f40d8);}return _0x22cfa9[_0x882b('0x1a')](_0x2f40d8)[_0x882b('0x1b')]();};}function respondWithResult(_0x701c00,_0x260b90){_0x260b90=_0x260b90||0xc8;return function(_0x3c4d3a){if(_0x3c4d3a){return _0x701c00['status'](_0x260b90)[_0x882b('0x1c')](_0x3c4d3a);}};}function respondWithFilteredResult(_0x251bb9,_0x12f6ff){return function(_0x45e17f){if(_0x45e17f){var _0x17754d=typeof _0x12f6ff['offset']===_0x882b('0x1d')&&typeof _0x12f6ff['limit']===_0x882b('0x1d');var _0x34d242=_0x45e17f['count'];var _0x1b5ac0=_0x17754d?0x0:_0x12f6ff['offset'];var _0x25fabb=_0x17754d?_0x45e17f[_0x882b('0x1e')]:_0x12f6ff[_0x882b('0x1f')]+_0x12f6ff[_0x882b('0x20')];var _0x12249d;if(_0x25fabb>=_0x34d242){_0x25fabb=_0x34d242;_0x12249d=0xc8;}else{_0x12249d=0xce;}_0x251bb9['status'](_0x12249d);return _0x251bb9[_0x882b('0x21')](_0x882b('0x22'),_0x1b5ac0+'-'+_0x25fabb+'/'+_0x34d242)[_0x882b('0x1c')](_0x45e17f);}return null;};}function patchUpdates(_0x299e74){return function(_0x182b02){try{jsonpatch[_0x882b('0x23')](_0x182b02,_0x299e74,!![]);}catch(_0x5942b0){return BPromise[_0x882b('0x24')](_0x5942b0);}return _0x182b02[_0x882b('0x25')]();};}function saveUpdates(_0x5b797d,_0x41930c){return function(_0x34948f){if(_0x34948f){return _0x34948f[_0x882b('0x26')](_0x5b797d)['then'](function(_0x114ff6){return _0x114ff6;});}return null;};}function removeEntity(_0x40a7fb,_0x57fe65){return function(_0x4f778a){if(_0x4f778a){return _0x4f778a['destroy']()[_0x882b('0x27')](function(){_0x40a7fb[_0x882b('0x1a')](0xcc)[_0x882b('0x1b')]();});}};}function handleEntityNotFound(_0x2d51dc,_0x542981){return function(_0x299c12){if(!_0x299c12){_0x2d51dc[_0x882b('0x19')](0x194);}return _0x299c12;};}function handleError(_0x36dafc,_0x19fee8){_0x19fee8=_0x19fee8||0x1f4;return function(_0x2b4a98){logger[_0x882b('0x28')](_0x2b4a98[_0x882b('0x29')]);if(_0x2b4a98[_0x882b('0x2a')]){delete _0x2b4a98[_0x882b('0x2a')];}_0x36dafc[_0x882b('0x1a')](_0x19fee8)[_0x882b('0x2b')](_0x2b4a98);};}exports[_0x882b('0x2c')]=function(_0x5daad2,_0x1d0b85){var _0x2ce103={},_0x271f47={},_0x2b3939={'count':0x0,'rows':[]};var _0x9e3ed2=_[_0x882b('0x2d')](db[_0x882b('0x2e')]['rawAttributes'],function(_0x2a84cd){return{'name':_0x2a84cd[_0x882b('0x2f')],'type':_0x2a84cd[_0x882b('0x30')][_0x882b('0x31')]};});_0x271f47[_0x882b('0x32')]=_['map'](_0x9e3ed2,_0x882b('0x2a'));_0x271f47[_0x882b('0x33')]=_['keys'](_0x5daad2[_0x882b('0x33')]);_0x271f47[_0x882b('0x34')]=_[_0x882b('0x35')](_0x271f47[_0x882b('0x32')],_0x271f47[_0x882b('0x33')]);_0x2ce103['attributes']=_['intersection'](_0x271f47['model'],qs['fields'](_0x5daad2[_0x882b('0x33')][_0x882b('0x36')]));_0x2ce103['attributes']=_0x2ce103[_0x882b('0x37')]['length']?_0x2ce103[_0x882b('0x37')]:_0x271f47[_0x882b('0x32')];if(!_0x5daad2['query'][_0x882b('0x38')](_0x882b('0x39'))){_0x2ce103[_0x882b('0x20')]=qs['limit'](_0x5daad2['query'][_0x882b('0x20')]);_0x2ce103[_0x882b('0x1f')]=qs['offset'](_0x5daad2[_0x882b('0x33')][_0x882b('0x1f')]);}_0x2ce103[_0x882b('0x3a')]=qs[_0x882b('0x3b')](_0x5daad2[_0x882b('0x33')][_0x882b('0x3b')]);_0x2ce103[_0x882b('0x3c')]=qs[_0x882b('0x34')](_[_0x882b('0x3d')](_0x5daad2[_0x882b('0x33')],_0x271f47[_0x882b('0x34')]),_0x9e3ed2);if(_0x5daad2['query'][_0x882b('0x3e')]){_0x2ce103[_0x882b('0x3c')]=_[_0x882b('0x3f')](_0x2ce103['where'],{'$or':_['map'](_0x9e3ed2,function(_0x53aa18){if(_0x53aa18['type']!=='VIRTUAL'){var _0x22425a={};_0x22425a[_0x53aa18[_0x882b('0x2a')]]={'$like':'%'+_0x5daad2['query'][_0x882b('0x3e')]+'%'};return _0x22425a;}})});}_0x2ce103=_[_0x882b('0x3f')]({},_0x2ce103,_0x5daad2['options']);var _0x13bd31={'where':_0x2ce103[_0x882b('0x3c')]};return db[_0x882b('0x2e')][_0x882b('0x1e')](_0x13bd31)[_0x882b('0x27')](function(_0x3f0fcb){_0x2b3939['count']=_0x3f0fcb;if(_0x5daad2[_0x882b('0x33')]['includeAll']){_0x2ce103[_0x882b('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x882b('0x41')](_0x2ce103);})[_0x882b('0x27')](function(_0x1de616){_0x2b3939[_0x882b('0x42')]=_0x1de616;return _0x2b3939;})[_0x882b('0x27')](respondWithFilteredResult(_0x1d0b85,_0x2ce103))[_0x882b('0x43')](handleError(_0x1d0b85,null));};exports[_0x882b('0x44')]=function(_0x360ac0,_0x5c4d2c){var _0x43c38e={'raw':!![],'where':{'id':_0x360ac0[_0x882b('0x45')]['id']}},_0x52b69a={};_0x52b69a['model']=_['keys'](db['OpenchannelTransferReport'][_0x882b('0x46')]);_0x52b69a[_0x882b('0x33')]=_[_0x882b('0x47')](_0x360ac0['query']);_0x52b69a[_0x882b('0x34')]=_[_0x882b('0x35')](_0x52b69a[_0x882b('0x32')],_0x52b69a[_0x882b('0x33')]);_0x43c38e[_0x882b('0x37')]=_[_0x882b('0x35')](_0x52b69a[_0x882b('0x32')],qs['fields'](_0x360ac0[_0x882b('0x33')]['fields']));_0x43c38e[_0x882b('0x37')]=_0x43c38e[_0x882b('0x37')][_0x882b('0x48')]?_0x43c38e[_0x882b('0x37')]:_0x52b69a[_0x882b('0x32')];if(_0x360ac0[_0x882b('0x33')][_0x882b('0x49')]){_0x43c38e['include']=[{'all':!![]}];}_0x43c38e=_[_0x882b('0x3f')]({},_0x43c38e,_0x360ac0[_0x882b('0x4a')]);return db[_0x882b('0x2e')]['find'](_0x43c38e)[_0x882b('0x27')](handleEntityNotFound(_0x5c4d2c,null))['then'](respondWithResult(_0x5c4d2c,null))['catch'](handleError(_0x5c4d2c,null));};exports['create']=function(_0x4f4d06,_0x2c8d00){return db[_0x882b('0x2e')][_0x882b('0x4b')](_0x4f4d06[_0x882b('0x4c')],{})[_0x882b('0x27')](respondWithResult(_0x2c8d00,0xc9))[_0x882b('0x43')](handleError(_0x2c8d00,null));};exports[_0x882b('0x26')]=function(_0x40296b,_0x440c09){if(_0x40296b[_0x882b('0x4c')]['id']){delete _0x40296b[_0x882b('0x4c')]['id'];}return db['OpenchannelTransferReport'][_0x882b('0x4d')]({'where':{'id':_0x40296b[_0x882b('0x45')]['id']}})[_0x882b('0x27')](handleEntityNotFound(_0x440c09,null))['then'](saveUpdates(_0x40296b[_0x882b('0x4c')],null))[_0x882b('0x27')](respondWithResult(_0x440c09,null))[_0x882b('0x43')](handleError(_0x440c09,null));};exports[_0x882b('0x4e')]=function(_0x14aaca,_0x4c4399){return db[_0x882b('0x2e')][_0x882b('0x4d')]({'where':{'id':_0x14aaca[_0x882b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c4399,null))[_0x882b('0x27')](removeEntity(_0x4c4399,null))['catch'](handleError(_0x4c4399,null));};exports['describe']=function(_0x3eff95,_0x4ab04e){return db[_0x882b('0x2e')]['describe']()['then'](respondWithResult(_0x4ab04e,null))[_0x882b('0x43')](handleError(_0x4ab04e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4a158b7..9a1cdfa 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09b9=['api','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x4a7362,_0x145e38){var _0x5ce767=function(_0x6010d5){while(--_0x6010d5){_0x4a7362['push'](_0x4a7362['shift']());}};_0x5ce767(++_0x145e38);}(_0x09b9,0x184));var _0x909b=function(_0x38c251,_0x1c9fa5){_0x38c251=_0x38c251-0x0;var _0x19d273=_0x09b9[_0x38c251];return _0x19d273;};'use strict';var _=require(_0x909b('0x0'));var util=require(_0x909b('0x1'));var logger=require('../../config/logger')(_0x909b('0x2'));var moment=require(_0x909b('0x3'));var BPromise=require(_0x909b('0x4'));var rp=require(_0x909b('0x5'));var fs=require('fs');var path=require(_0x909b('0x6'));var rimraf=require(_0x909b('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x909b('0x8')]=function(_0x2e4e5b,_0x2e655a){return _0x2e4e5b[_0x909b('0x9')](_0x909b('0xa'),attributes,{'tableName':_0x909b('0xb'),'paranoid':![],'indexes':[{'name':_0x909b('0xc'),'fields':[_0x909b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71f8=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x71f8,0x96));var _0x871f=function(_0x7917d5,_0x17feed){_0x7917d5=_0x7917d5-0x0;var _0xebfe51=_0x71f8[_0x7917d5];return _0xebfe51;};'use strict';var _=require(_0x871f('0x0'));var util=require(_0x871f('0x1'));var logger=require(_0x871f('0x2'))(_0x871f('0x3'));var moment=require(_0x871f('0x4'));var BPromise=require('bluebird');var rp=require(_0x871f('0x5'));var fs=require('fs');var path=require(_0x871f('0x6'));var rimraf=require(_0x871f('0x7'));var config=require(_0x871f('0x8'));var attributes=require(_0x871f('0x9'));module[_0x871f('0xa')]=function(_0x4968b9,_0x3be0d3){return _0x4968b9[_0x871f('0xb')](_0x871f('0xc'),attributes,{'tableName':_0x871f('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x871f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index bff6991..3e9ad2c 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26d1=['OpenchannelTransferReport,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x26d1,0x8e));var _0x126d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x26d1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x126d('0x0'));var util=require('util');var moment=require(_0x126d('0x1'));var BPromise=require(_0x126d('0x2'));var rs=require(_0x126d('0x3'));var fs=require('fs');var Redis=require(_0x126d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x126d('0x5'))('rpc');var config=require(_0x126d('0x6'));var jayson=require(_0x126d('0x7'));var client=jayson[_0x126d('0x8')][_0x126d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4dfc,_0x4e5e87,_0x2e668c){return new BPromise(function(_0x25ccc2,_0x7d6e4c){return client[_0x126d('0xa')](_0x2b4dfc,_0x2e668c)[_0x126d('0xb')](function(_0x1cf6fb){logger[_0x126d('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4e5e87,_0x126d('0xd'));logger[_0x126d('0xe')](_0x126d('0xf'),_0x4e5e87,_0x126d('0xd'),JSON[_0x126d('0x10')](_0x1cf6fb));if(_0x1cf6fb['error']){if(_0x1cf6fb[_0x126d('0x11')]['code']===0x1f4){logger[_0x126d('0x11')](_0x126d('0x12'),_0x4e5e87,_0x1cf6fb[_0x126d('0x11')]['message']);return _0x7d6e4c(_0x1cf6fb[_0x126d('0x11')][_0x126d('0x13')]);}logger[_0x126d('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4e5e87,_0x1cf6fb['error'][_0x126d('0x13')]);return _0x25ccc2(_0x1cf6fb[_0x126d('0x11')][_0x126d('0x13')]);}else{logger[_0x126d('0xc')](_0x126d('0x12'),_0x4e5e87,_0x126d('0xd'));_0x25ccc2(_0x1cf6fb['result'][_0x126d('0x13')]);}})['catch'](function(_0x352d72){logger['error'](_0x126d('0x12'),_0x4e5e87,_0x352d72);_0x7d6e4c(_0x352d72);});});} \ No newline at end of file +var _0x3248=['ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x22de40,_0x445eb0){var _0x42b57c=function(_0x4a4d1d){while(--_0x4a4d1d){_0x22de40['push'](_0x22de40['shift']());}};_0x42b57c(++_0x445eb0);}(_0x3248,0x1b0));var _0x8324=function(_0x437e73,_0xdd071){_0x437e73=_0x437e73-0x0;var _0x5be93b=_0x3248[_0x437e73];return _0x5be93b;};'use strict';var _=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var moment=require(_0x8324('0x2'));var BPromise=require(_0x8324('0x3'));var rs=require(_0x8324('0x4'));var fs=require('fs');var Redis=require(_0x8324('0x5'));var db=require(_0x8324('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8324('0x7'));var config=require(_0x8324('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8324('0x9')][_0x8324('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446423,_0x2ad12f,_0x215c15){return new BPromise(function(_0x5d5f01,_0x300886){return client[_0x8324('0xb')](_0x446423,_0x215c15)[_0x8324('0xc')](function(_0x52b5f2){logger['info'](_0x8324('0xd'),_0x2ad12f,_0x8324('0xe'));logger[_0x8324('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2ad12f,_0x8324('0xe'),JSON[_0x8324('0x10')](_0x52b5f2));if(_0x52b5f2[_0x8324('0x11')]){if(_0x52b5f2[_0x8324('0x11')][_0x8324('0x12')]===0x1f4){logger[_0x8324('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ad12f,_0x52b5f2['error']['message']);return _0x300886(_0x52b5f2[_0x8324('0x11')]['message']);}logger['error'](_0x8324('0xd'),_0x2ad12f,_0x52b5f2[_0x8324('0x11')][_0x8324('0x13')]);return _0x5d5f01(_0x52b5f2['error'][_0x8324('0x13')]);}else{logger[_0x8324('0x14')](_0x8324('0xd'),_0x2ad12f,'request\x20sent');_0x5d5f01(_0x52b5f2[_0x8324('0x15')][_0x8324('0x13')]);}})[_0x8324('0x16')](function(_0x9cfe5){logger[_0x8324('0x11')](_0x8324('0xd'),_0x2ad12f,_0x9cfe5);_0x300886(_0x9cfe5);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e61b606..624b035 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf739=['show','post','create','update','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf739,0x18d));var _0x9f73=function(_0x7d7814,_0x224c09){_0x7d7814=_0x7d7814-0x0;var _0x253187=_0xf739[_0x7d7814];return _0x253187;};'use strict';var multer=require(_0x9f73('0x0'));var util=require(_0x9f73('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9f73('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f73('0x3'));var interaction=require(_0x9f73('0x4'));var config=require(_0x9f73('0x5'));var controller=require(_0x9f73('0x6'));router[_0x9f73('0x7')]('/',auth[_0x9f73('0x8')](),controller[_0x9f73('0x9')]);router[_0x9f73('0x7')](_0x9f73('0xa'),auth['isAuthenticated'](),controller[_0x9f73('0xb')]);router[_0x9f73('0xc')]('/',auth[_0x9f73('0x8')](),controller[_0x9f73('0xd')]);router['put'](_0x9f73('0xa'),auth['isAuthenticated'](),controller[_0x9f73('0xe')]);router['delete'](_0x9f73('0xa'),auth[_0x9f73('0x8')](),controller[_0x9f73('0xf')]);module[_0x9f73('0x10')]=router; \ No newline at end of file +var _0xb344=['isAuthenticated','post','create','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./pause.controller','get','index','/:id'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xb344,0x156));var _0x4b34=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0xb344[_0x2390bd];return _0x3a969d;};'use strict';var multer=require(_0x4b34('0x0'));var util=require(_0x4b34('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4b34('0x2'));var router=express[_0x4b34('0x3')]();var fs_extra=require(_0x4b34('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4b34('0x5'));var config=require('../../config/environment');var controller=require(_0x4b34('0x6'));router[_0x4b34('0x7')]('/',auth['isAuthenticated'](),controller[_0x4b34('0x8')]);router[_0x4b34('0x7')](_0x4b34('0x9'),auth[_0x4b34('0xa')](),controller['show']);router[_0x4b34('0xb')]('/',auth['isAuthenticated'](),controller[_0x4b34('0xc')]);router['put'](_0x4b34('0x9'),auth[_0x4b34('0xa')](),controller['update']);router[_0x4b34('0xd')]('/:id',auth[_0x4b34('0xa')](),controller[_0x4b34('0xe')]);module[_0x4b34('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d5c91aa..311383a 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c5e=['sequelize','exports','name'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x7c5e,0x129));var _0xe7c5=function(_0x4f990b,_0x48b010){_0x4f990b=_0x4f990b-0x0;var _0x26cc66=_0x7c5e[_0x4f990b];return _0x26cc66;};'use strict';var Sequelize=require(_0xe7c5('0x0'));module[_0xe7c5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe7c5('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8069=['exports','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8069,0x95));var _0x9806=function(_0x5db3a3,_0x22ea41){_0x5db3a3=_0x5db3a3-0x0;var _0x573e53=_0x8069[_0x5db3a3];return _0x573e53;};'use strict';var Sequelize=require(_0x9806('0x0'));module[_0x9806('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4068bdd..9dc12f1 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab90=['find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','Pauses','UserProfileResource','then','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0x3c4f93,_0x24be5c){var _0x56d097=function(_0x30ad6e){while(--_0x30ad6e){_0x3c4f93['push'](_0x3c4f93['shift']());}};_0x56d097(++_0x24be5c);}(_0xab90,0x1b1));var _0x0ab9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xab90[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x0ab9('0x0'));var rimraf=require(_0x0ab9('0x1'));var zipdir=require(_0x0ab9('0x2'));var jsonpatch=require(_0x0ab9('0x3'));var rp=require(_0x0ab9('0x4'));var moment=require(_0x0ab9('0x5'));var BPromise=require(_0x0ab9('0x6'));var Mustache=require(_0x0ab9('0x7'));var util=require(_0x0ab9('0x8'));var path=require(_0x0ab9('0x9'));var sox=require(_0x0ab9('0xa'));var csv=require(_0x0ab9('0xb'));var ejs=require(_0x0ab9('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab9('0xd'));var squel=require(_0x0ab9('0xe'));var crypto=require(_0x0ab9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ab9('0xb'));var querystring=require(_0x0ab9('0x10'));var Papa=require(_0x0ab9('0x11'));var Redis=require(_0x0ab9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0ab9('0x13'));var as=require(_0x0ab9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ab9('0x15'))('api');var utils=require(_0x0ab9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ab9('0x17'));var db=require(_0x0ab9('0x18'))['db'];function respondWithStatusCode(_0x4cf7cd,_0x2c91c6){_0x2c91c6=_0x2c91c6||0xcc;return function(_0x53cade){if(_0x53cade){return _0x4cf7cd['sendStatus'](_0x2c91c6);}return _0x4cf7cd[_0x0ab9('0x19')](_0x2c91c6)['end']();};}function respondWithResult(_0x34bd5c,_0x143bdb){_0x143bdb=_0x143bdb||0xc8;return function(_0x3f5665){if(_0x3f5665){return _0x34bd5c[_0x0ab9('0x19')](_0x143bdb)['json'](_0x3f5665);}};}function respondWithFilteredResult(_0x57bfce,_0x5e952b){return function(_0xfb61ec){if(_0xfb61ec){var _0x254bc2=typeof _0x5e952b['offset']===_0x0ab9('0x1a')&&typeof _0x5e952b[_0x0ab9('0x1b')]===_0x0ab9('0x1a');var _0xf0d9c9=_0xfb61ec['count'];var _0x25d1ba=_0x254bc2?0x0:_0x5e952b['offset'];var _0x4eeebd=_0x254bc2?_0xfb61ec[_0x0ab9('0x1c')]:_0x5e952b[_0x0ab9('0x1d')]+_0x5e952b[_0x0ab9('0x1b')];var _0x250225;if(_0x4eeebd>=_0xf0d9c9){_0x4eeebd=_0xf0d9c9;_0x250225=0xc8;}else{_0x250225=0xce;}_0x57bfce[_0x0ab9('0x19')](_0x250225);return _0x57bfce[_0x0ab9('0x1e')](_0x0ab9('0x1f'),_0x25d1ba+'-'+_0x4eeebd+'/'+_0xf0d9c9)['json'](_0xfb61ec);}return null;};}function patchUpdates(_0x2cf2b3){return function(_0x2d727d){try{jsonpatch[_0x0ab9('0x20')](_0x2d727d,_0x2cf2b3,!![]);}catch(_0xa2c732){return BPromise[_0x0ab9('0x21')](_0xa2c732);}return _0x2d727d[_0x0ab9('0x22')]();};}function saveUpdates(_0x4c6b69,_0x427c86){return function(_0x524a37){if(_0x524a37){return _0x524a37[_0x0ab9('0x23')](_0x4c6b69)['then'](function(_0x22a983){return _0x22a983;});}return null;};}function removeEntity(_0x1c23d1,_0x4347b8){return function(_0x4cc88a){if(_0x4cc88a){return _0x4cc88a[_0x0ab9('0x24')]()['then'](function(){var _0x5840c4=_0x4cc88a[_0x0ab9('0x25')]({'plain':!![]});var _0x35c8bc=_0x0ab9('0x26');return db[_0x0ab9('0x27')][_0x0ab9('0x24')]({'where':{'type':_0x35c8bc,'resourceId':_0x5840c4['id']}})[_0x0ab9('0x28')](function(){return _0x4cc88a;});})['then'](function(){_0x1c23d1[_0x0ab9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b538,_0x58934b){return function(_0x4b8f42){if(!_0x4b8f42){_0x46b538['sendStatus'](0x194);}return _0x4b8f42;};}function handleError(_0x2d6bd3,_0x1c3025){_0x1c3025=_0x1c3025||0x1f4;return function(_0x4374ca){logger[_0x0ab9('0x29')](_0x4374ca[_0x0ab9('0x2a')]);if(_0x4374ca['name']){delete _0x4374ca[_0x0ab9('0x2b')];}_0x2d6bd3[_0x0ab9('0x19')](_0x1c3025)[_0x0ab9('0x2c')](_0x4374ca);};}exports[_0x0ab9('0x2d')]=function(_0x4fbc5a,_0x576759){var _0x2eb5e8={},_0x33c3c6={},_0x207a0e={'count':0x0,'rows':[]};var _0x3a49a7=_[_0x0ab9('0x2e')](db[_0x0ab9('0x2f')][_0x0ab9('0x30')],function(_0x1e232b){return{'name':_0x1e232b[_0x0ab9('0x31')],'type':_0x1e232b[_0x0ab9('0x32')][_0x0ab9('0x33')]};});_0x33c3c6[_0x0ab9('0x34')]=_['map'](_0x3a49a7,_0x0ab9('0x2b'));_0x33c3c6[_0x0ab9('0x35')]=_[_0x0ab9('0x36')](_0x4fbc5a[_0x0ab9('0x35')]);_0x33c3c6['filters']=_[_0x0ab9('0x37')](_0x33c3c6['model'],_0x33c3c6[_0x0ab9('0x35')]);_0x2eb5e8[_0x0ab9('0x38')]=_[_0x0ab9('0x37')](_0x33c3c6[_0x0ab9('0x34')],qs['fields'](_0x4fbc5a[_0x0ab9('0x35')]['fields']));_0x2eb5e8['attributes']=_0x2eb5e8[_0x0ab9('0x38')][_0x0ab9('0x39')]?_0x2eb5e8[_0x0ab9('0x38')]:_0x33c3c6['model'];if(!_0x4fbc5a[_0x0ab9('0x35')][_0x0ab9('0x3a')](_0x0ab9('0x3b'))){_0x2eb5e8[_0x0ab9('0x1b')]=qs[_0x0ab9('0x1b')](_0x4fbc5a[_0x0ab9('0x35')][_0x0ab9('0x1b')]);_0x2eb5e8[_0x0ab9('0x1d')]=qs[_0x0ab9('0x1d')](_0x4fbc5a[_0x0ab9('0x35')][_0x0ab9('0x1d')]);}_0x2eb5e8[_0x0ab9('0x3c')]=qs[_0x0ab9('0x3d')](_0x4fbc5a[_0x0ab9('0x35')][_0x0ab9('0x3d')]);_0x2eb5e8[_0x0ab9('0x3e')]=qs[_0x0ab9('0x3f')](_[_0x0ab9('0x40')](_0x4fbc5a['query'],_0x33c3c6[_0x0ab9('0x3f')]),_0x3a49a7);if(_0x4fbc5a['query'][_0x0ab9('0x41')]){_0x2eb5e8[_0x0ab9('0x3e')]=_[_0x0ab9('0x42')](_0x2eb5e8[_0x0ab9('0x3e')],{'$or':_[_0x0ab9('0x2e')](_0x3a49a7,function(_0x3b168e){if(_0x3b168e[_0x0ab9('0x32')]!==_0x0ab9('0x43')){var _0x33c8cd={};_0x33c8cd[_0x3b168e[_0x0ab9('0x2b')]]={'$like':'%'+_0x4fbc5a[_0x0ab9('0x35')][_0x0ab9('0x41')]+'%'};return _0x33c8cd;}})});}_0x2eb5e8=_[_0x0ab9('0x42')]({},_0x2eb5e8,_0x4fbc5a[_0x0ab9('0x44')]);var _0x24c0f2={'where':_0x2eb5e8[_0x0ab9('0x3e')]};return db['Pause']['count'](_0x24c0f2)[_0x0ab9('0x28')](function(_0x4e9a45){_0x207a0e[_0x0ab9('0x1c')]=_0x4e9a45;if(_0x4fbc5a[_0x0ab9('0x35')][_0x0ab9('0x45')]){_0x2eb5e8[_0x0ab9('0x46')]=[{'all':!![]}];}return db['Pause'][_0x0ab9('0x47')](_0x2eb5e8);})[_0x0ab9('0x28')](function(_0x19e77f){_0x207a0e[_0x0ab9('0x48')]=_0x19e77f;return _0x207a0e;})[_0x0ab9('0x28')](respondWithFilteredResult(_0x576759,_0x2eb5e8))[_0x0ab9('0x49')](handleError(_0x576759,null));};exports[_0x0ab9('0x4a')]=function(_0x11f850,_0x34839b){var _0x44d557={'raw':!![],'where':{'id':_0x11f850[_0x0ab9('0x4b')]['id']}},_0x4636fc={};_0x4636fc[_0x0ab9('0x34')]=_[_0x0ab9('0x36')](db[_0x0ab9('0x2f')][_0x0ab9('0x30')]);_0x4636fc[_0x0ab9('0x35')]=_[_0x0ab9('0x36')](_0x11f850['query']);_0x4636fc[_0x0ab9('0x3f')]=_['intersection'](_0x4636fc[_0x0ab9('0x34')],_0x4636fc[_0x0ab9('0x35')]);_0x44d557['attributes']=_[_0x0ab9('0x37')](_0x4636fc[_0x0ab9('0x34')],qs['fields'](_0x11f850[_0x0ab9('0x35')][_0x0ab9('0x4c')]));_0x44d557[_0x0ab9('0x38')]=_0x44d557['attributes']['length']?_0x44d557[_0x0ab9('0x38')]:_0x4636fc[_0x0ab9('0x34')];if(_0x11f850[_0x0ab9('0x35')][_0x0ab9('0x45')]){_0x44d557['include']=[{'all':!![]}];}_0x44d557=_[_0x0ab9('0x42')]({},_0x44d557,_0x11f850[_0x0ab9('0x44')]);return db[_0x0ab9('0x2f')][_0x0ab9('0x4d')](_0x44d557)[_0x0ab9('0x28')](handleEntityNotFound(_0x34839b,null))[_0x0ab9('0x28')](respondWithResult(_0x34839b,null))['catch'](handleError(_0x34839b,null));};exports['create']=function(_0x4fd518,_0x46457d){return db[_0x0ab9('0x2f')][_0x0ab9('0x4e')](_0x4fd518[_0x0ab9('0x4f')],{})['then'](function(_0x5126b9){var _0x3e96ce=_0x4fd518[_0x0ab9('0x50')][_0x0ab9('0x25')]({'plain':!![]});if(!_0x3e96ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e96ce[_0x0ab9('0x51')]==='user'){var _0x11a12f=_0x5126b9[_0x0ab9('0x25')]({'plain':!![]});var _0x17fe8f=_0x0ab9('0x26');return db['UserProfileSection'][_0x0ab9('0x4d')]({'where':{'name':_0x17fe8f,'userProfileId':_0x3e96ce[_0x0ab9('0x52')]},'raw':!![]})['then'](function(_0x20356a){if(_0x20356a&&_0x20356a[_0x0ab9('0x53')]===0x0){return db[_0x0ab9('0x27')][_0x0ab9('0x4e')]({'name':_0x11a12f[_0x0ab9('0x2b')],'resourceId':_0x11a12f['id'],'type':_0x20356a[_0x0ab9('0x2b')],'sectionId':_0x20356a['id']},{})[_0x0ab9('0x28')](function(){return _0x5126b9;});}else{return _0x5126b9;}})[_0x0ab9('0x49')](function(_0xc70a30){logger['error'](_0x0ab9('0x54'),_0xc70a30);throw _0xc70a30;});}return _0x5126b9;})[_0x0ab9('0x28')](respondWithResult(_0x46457d,0xc9))[_0x0ab9('0x49')](handleError(_0x46457d,null));};exports['update']=function(_0x4244ef,_0x527c49){if(_0x4244ef[_0x0ab9('0x4f')]['id']){delete _0x4244ef[_0x0ab9('0x4f')]['id'];}return db[_0x0ab9('0x2f')][_0x0ab9('0x4d')]({'where':{'id':_0x4244ef[_0x0ab9('0x4b')]['id']}})[_0x0ab9('0x28')](handleEntityNotFound(_0x527c49,null))[_0x0ab9('0x28')](saveUpdates(_0x4244ef[_0x0ab9('0x4f')],null))['then'](respondWithResult(_0x527c49,null))[_0x0ab9('0x49')](handleError(_0x527c49,null));};exports[_0x0ab9('0x24')]=function(_0x1fece6,_0x5556f7){return db['Pause']['find']({'where':{'id':_0x1fece6[_0x0ab9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5556f7,null))[_0x0ab9('0x28')](removeEntity(_0x5556f7,null))[_0x0ab9('0x49')](handleError(_0x5556f7,null));}; \ No newline at end of file +var _0xf59f=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2470eb,_0x193881){var _0x13bf0f=function(_0x1a2fc7){while(--_0x1a2fc7){_0x2470eb['push'](_0x2470eb['shift']());}};_0x13bf0f(++_0x193881);}(_0xf59f,0xf4));var _0xff59=function(_0x5754c7,_0x28591e){_0x5754c7=_0x5754c7-0x0;var _0xfbf156=_0xf59f[_0x5754c7];return _0xfbf156;};'use strict';var emlformat=require(_0xff59('0x0'));var rimraf=require(_0xff59('0x1'));var zipdir=require(_0xff59('0x2'));var jsonpatch=require(_0xff59('0x3'));var rp=require(_0xff59('0x4'));var moment=require(_0xff59('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xff59('0x6'));var util=require(_0xff59('0x7'));var path=require(_0xff59('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff59('0x9'));var _=require(_0xff59('0xa'));var squel=require(_0xff59('0xb'));var crypto=require(_0xff59('0xc'));var jsforce=require(_0xff59('0xd'));var deskjs=require(_0xff59('0xe'));var toCsv=require(_0xff59('0xf'));var querystring=require(_0xff59('0x10'));var Papa=require(_0xff59('0x11'));var Redis=require(_0xff59('0x12'));var authService=require(_0xff59('0x13'));var qs=require(_0xff59('0x14'));var as=require(_0xff59('0x15'));var hardwareService=require(_0xff59('0x16'));var logger=require('../../config/logger')(_0xff59('0x17'));var utils=require(_0xff59('0x18'));var config=require(_0xff59('0x19'));var licenseUtil=require(_0xff59('0x1a'));var db=require(_0xff59('0x1b'))['db'];function respondWithStatusCode(_0x4883b6,_0x1f88a7){_0x1f88a7=_0x1f88a7||0xcc;return function(_0x4f1cd6){if(_0x4f1cd6){return _0x4883b6[_0xff59('0x1c')](_0x1f88a7);}return _0x4883b6[_0xff59('0x1d')](_0x1f88a7)[_0xff59('0x1e')]();};}function respondWithResult(_0x59b033,_0x432a99){_0x432a99=_0x432a99||0xc8;return function(_0x2500fc){if(_0x2500fc){return _0x59b033[_0xff59('0x1d')](_0x432a99)['json'](_0x2500fc);}};}function respondWithFilteredResult(_0x2ec6d8,_0x4afd15){return function(_0x5d085b){if(_0x5d085b){var _0x48fc3a=typeof _0x4afd15[_0xff59('0x1f')]===_0xff59('0x20')&&typeof _0x4afd15[_0xff59('0x21')]===_0xff59('0x20');var _0x3216d3=_0x5d085b[_0xff59('0x22')];var _0x63cb17=_0x48fc3a?0x0:_0x4afd15['offset'];var _0x88c7a9=_0x48fc3a?_0x5d085b[_0xff59('0x22')]:_0x4afd15[_0xff59('0x1f')]+_0x4afd15[_0xff59('0x21')];var _0x10839b;if(_0x88c7a9>=_0x3216d3){_0x88c7a9=_0x3216d3;_0x10839b=0xc8;}else{_0x10839b=0xce;}_0x2ec6d8['status'](_0x10839b);return _0x2ec6d8[_0xff59('0x23')](_0xff59('0x24'),_0x63cb17+'-'+_0x88c7a9+'/'+_0x3216d3)['json'](_0x5d085b);}return null;};}function patchUpdates(_0x5567de){return function(_0x50d72c){try{jsonpatch[_0xff59('0x25')](_0x50d72c,_0x5567de,!![]);}catch(_0x21807c){return BPromise[_0xff59('0x26')](_0x21807c);}return _0x50d72c[_0xff59('0x27')]();};}function saveUpdates(_0x5a3911,_0x1de19f){return function(_0x1de1c7){if(_0x1de1c7){return _0x1de1c7[_0xff59('0x28')](_0x5a3911)['then'](function(_0x24914a){return _0x24914a;});}return null;};}function removeEntity(_0x49c49b,_0x1f10c9){return function(_0x5d17a4){if(_0x5d17a4){return _0x5d17a4[_0xff59('0x29')]()[_0xff59('0x2a')](function(){var _0x363b6e=_0x5d17a4[_0xff59('0x2b')]({'plain':!![]});var _0x2a67b9=_0xff59('0x2c');return db[_0xff59('0x2d')][_0xff59('0x29')]({'where':{'type':_0x2a67b9,'resourceId':_0x363b6e['id']}})[_0xff59('0x2a')](function(){return _0x5d17a4;});})[_0xff59('0x2a')](function(){_0x49c49b[_0xff59('0x1d')](0xcc)[_0xff59('0x1e')]();});}};}function handleEntityNotFound(_0x37d14a,_0x4f2e1a){return function(_0x3c66dc){if(!_0x3c66dc){_0x37d14a[_0xff59('0x1c')](0x194);}return _0x3c66dc;};}function handleError(_0x2a3fe3,_0x543404){_0x543404=_0x543404||0x1f4;return function(_0x4e9d1b){logger[_0xff59('0x2e')](_0x4e9d1b[_0xff59('0x2f')]);if(_0x4e9d1b[_0xff59('0x30')]){delete _0x4e9d1b[_0xff59('0x30')];}_0x2a3fe3[_0xff59('0x1d')](_0x543404)[_0xff59('0x31')](_0x4e9d1b);};}exports[_0xff59('0x32')]=function(_0x4c4011,_0x50b598){var _0x29575d={},_0xc8bd8a={},_0x36f5c7={'count':0x0,'rows':[]};var _0x361b77=_[_0xff59('0x33')](db[_0xff59('0x34')][_0xff59('0x35')],function(_0x26ab91){return{'name':_0x26ab91[_0xff59('0x36')],'type':_0x26ab91['type'][_0xff59('0x37')]};});_0xc8bd8a[_0xff59('0x38')]=_[_0xff59('0x33')](_0x361b77,'name');_0xc8bd8a[_0xff59('0x39')]=_['keys'](_0x4c4011[_0xff59('0x39')]);_0xc8bd8a['filters']=_[_0xff59('0x3a')](_0xc8bd8a[_0xff59('0x38')],_0xc8bd8a[_0xff59('0x39')]);_0x29575d[_0xff59('0x3b')]=_['intersection'](_0xc8bd8a[_0xff59('0x38')],qs['fields'](_0x4c4011[_0xff59('0x39')][_0xff59('0x3c')]));_0x29575d[_0xff59('0x3b')]=_0x29575d[_0xff59('0x3b')][_0xff59('0x3d')]?_0x29575d['attributes']:_0xc8bd8a['model'];if(!_0x4c4011['query']['hasOwnProperty'](_0xff59('0x3e'))){_0x29575d[_0xff59('0x21')]=qs[_0xff59('0x21')](_0x4c4011['query'][_0xff59('0x21')]);_0x29575d[_0xff59('0x1f')]=qs[_0xff59('0x1f')](_0x4c4011[_0xff59('0x39')]['offset']);}_0x29575d[_0xff59('0x3f')]=qs[_0xff59('0x40')](_0x4c4011['query'][_0xff59('0x40')]);_0x29575d[_0xff59('0x41')]=qs[_0xff59('0x42')](_['pick'](_0x4c4011[_0xff59('0x39')],_0xc8bd8a[_0xff59('0x42')]),_0x361b77);if(_0x4c4011[_0xff59('0x39')][_0xff59('0x43')]){_0x29575d[_0xff59('0x41')]=_[_0xff59('0x44')](_0x29575d[_0xff59('0x41')],{'$or':_[_0xff59('0x33')](_0x361b77,function(_0xe3496e){if(_0xe3496e[_0xff59('0x45')]!=='VIRTUAL'){var _0x3611eb={};_0x3611eb[_0xe3496e[_0xff59('0x30')]]={'$like':'%'+_0x4c4011[_0xff59('0x39')][_0xff59('0x43')]+'%'};return _0x3611eb;}})});}_0x29575d=_[_0xff59('0x44')]({},_0x29575d,_0x4c4011[_0xff59('0x46')]);var _0x48875d={'where':_0x29575d['where']};return db[_0xff59('0x34')][_0xff59('0x22')](_0x48875d)[_0xff59('0x2a')](function(_0x539c29){_0x36f5c7['count']=_0x539c29;if(_0x4c4011[_0xff59('0x39')][_0xff59('0x47')]){_0x29575d[_0xff59('0x48')]=[{'all':!![]}];}return db[_0xff59('0x34')][_0xff59('0x49')](_0x29575d);})[_0xff59('0x2a')](function(_0x4f4555){_0x36f5c7['rows']=_0x4f4555;return _0x36f5c7;})[_0xff59('0x2a')](respondWithFilteredResult(_0x50b598,_0x29575d))[_0xff59('0x4a')](handleError(_0x50b598,null));};exports[_0xff59('0x4b')]=function(_0x18e6c6,_0x3a334b){var _0x1406ce={'raw':!![],'where':{'id':_0x18e6c6[_0xff59('0x4c')]['id']}},_0x48bf16={};_0x48bf16[_0xff59('0x38')]=_[_0xff59('0x4d')](db[_0xff59('0x34')]['rawAttributes']);_0x48bf16[_0xff59('0x39')]=_[_0xff59('0x4d')](_0x18e6c6['query']);_0x48bf16[_0xff59('0x42')]=_[_0xff59('0x3a')](_0x48bf16[_0xff59('0x38')],_0x48bf16[_0xff59('0x39')]);_0x1406ce[_0xff59('0x3b')]=_[_0xff59('0x3a')](_0x48bf16['model'],qs['fields'](_0x18e6c6['query'][_0xff59('0x3c')]));_0x1406ce[_0xff59('0x3b')]=_0x1406ce[_0xff59('0x3b')][_0xff59('0x3d')]?_0x1406ce[_0xff59('0x3b')]:_0x48bf16[_0xff59('0x38')];if(_0x18e6c6[_0xff59('0x39')][_0xff59('0x47')]){_0x1406ce[_0xff59('0x48')]=[{'all':!![]}];}_0x1406ce=_[_0xff59('0x44')]({},_0x1406ce,_0x18e6c6[_0xff59('0x46')]);return db['Pause'][_0xff59('0x4e')](_0x1406ce)[_0xff59('0x2a')](handleEntityNotFound(_0x3a334b,null))[_0xff59('0x2a')](respondWithResult(_0x3a334b,null))['catch'](handleError(_0x3a334b,null));};exports[_0xff59('0x4f')]=function(_0x1c4df3,_0x43577e){return db[_0xff59('0x34')]['create'](_0x1c4df3[_0xff59('0x50')],{})[_0xff59('0x2a')](function(_0x59dda3){var _0x40d480=_0x1c4df3['user']['get']({'plain':!![]});if(!_0x40d480)throw new Error(_0xff59('0x51'));if(_0x40d480[_0xff59('0x52')]==='user'){var _0x417cf1=_0x59dda3[_0xff59('0x2b')]({'plain':!![]});var _0x530501=_0xff59('0x2c');return db[_0xff59('0x53')][_0xff59('0x4e')]({'where':{'name':_0x530501,'userProfileId':_0x40d480[_0xff59('0x54')]},'raw':!![]})['then'](function(_0x37bc17){if(_0x37bc17&&_0x37bc17[_0xff59('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x417cf1['name'],'resourceId':_0x417cf1['id'],'type':_0x37bc17[_0xff59('0x30')],'sectionId':_0x37bc17['id']},{})[_0xff59('0x2a')](function(){return _0x59dda3;});}else{return _0x59dda3;}})[_0xff59('0x4a')](function(_0x371480){logger[_0xff59('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371480);throw _0x371480;});}return _0x59dda3;})['then'](respondWithResult(_0x43577e,0xc9))[_0xff59('0x4a')](handleError(_0x43577e,null));};exports[_0xff59('0x28')]=function(_0x4e0e51,_0x25b80e){if(_0x4e0e51[_0xff59('0x50')]['id']){delete _0x4e0e51[_0xff59('0x50')]['id'];}return db[_0xff59('0x34')][_0xff59('0x4e')]({'where':{'id':_0x4e0e51['params']['id']}})[_0xff59('0x2a')](handleEntityNotFound(_0x25b80e,null))[_0xff59('0x2a')](saveUpdates(_0x4e0e51[_0xff59('0x50')],null))[_0xff59('0x2a')](respondWithResult(_0x25b80e,null))[_0xff59('0x4a')](handleError(_0x25b80e,null));};exports['destroy']=function(_0x50ea75,_0x36caf9){return db[_0xff59('0x34')][_0xff59('0x4e')]({'where':{'id':_0x50ea75[_0xff59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36caf9,null))[_0xff59('0x2a')](removeEntity(_0x36caf9,null))[_0xff59('0x4a')](handleError(_0x36caf9,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 9b68998..57748d9 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5ad0c6,_0x56ee17){_0x5ad0c6=_0x5ad0c6-0x0;var _0x167958=_0x7fbe[_0x5ad0c6];return _0x167958;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x40f3e6,_0x177028){var _0x49f0f0=function(_0x46df72){while(--_0x46df72){_0x40f3e6['push'](_0x40f3e6['shift']());}};_0x49f0f0(++_0x177028);}(_0x8ef6,0xf2));var _0x68ef=function(_0x58b382,_0x5e4e20){_0x58b382=_0x58b382-0x0;var _0x2ed024=_0x8ef6[_0x58b382];return _0x2ed024;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 27455ad..2b0cc74 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x49dff5,_0x5b17d2){var _0x125e04=function(_0x2fe633){while(--_0x2fe633){_0x49dff5['push'](_0x49dff5['shift']());}};_0x125e04(++_0x5b17d2);}(_0xb10b,0x12a));var _0xbb10=function(_0x45521d,_0x169dfe){_0x45521d=_0x45521d-0x0;var _0x24f9ed=_0xb10b[_0x45521d];return _0x24f9ed;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x177969,_0x3fe6f8){var _0x3dadd3=function(_0x3096f6){while(--_0x3096f6){_0x177969['push'](_0x177969['shift']());}};_0x3dadd3(++_0x3fe6f8);}(_0x7a54,0x106));var _0x47a5=function(_0x435b0b,_0x6b6430){_0x435b0b=_0x435b0b-0x0;var _0x1e4475=_0x7a54[_0x435b0b];return _0x1e4475;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index bde82d1..6eab58e 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b9b=['single','file','webhookPost','put','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','root','server/files/plugins','originalname','format','basename','extname','now','post'];(function(_0x23e121,_0x14580c){var _0x21b1bd=function(_0x13d9e9){while(--_0x13d9e9){_0x23e121['push'](_0x23e121['shift']());}};_0x21b1bd(++_0x14580c);}(_0x9b9b,0x114));var _0xb9b9=function(_0x558eb1,_0x502908){_0x558eb1=_0x558eb1-0x0;var _0x2f0b9e=_0x9b9b[_0x558eb1];return _0x2f0b9e;};'use strict';var multer=require('multer');var util=require(_0xb9b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9b9('0x1'));var router=express[_0xb9b9('0x2')]();var fs_extra=require(_0xb9b9('0x3'));var auth=require(_0xb9b9('0x4'));var interaction=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var controller=require(_0xb9b9('0x7'));router[_0xb9b9('0x8')]('/',auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xa')]);router[_0xb9b9('0x8')](_0xb9b9('0xb'),controller[_0xb9b9('0xc')]);router[_0xb9b9('0x8')](_0xb9b9('0xd'),auth[_0xb9b9('0x9')](),controller['show']);router['get'](_0xb9b9('0xe'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3949d0,_0x3b6bb9,_0x1122bb){_0x1122bb(null,path['join'](config[_0xb9b9('0x10')],_0xb9b9('0x11')));},'filename':function(_0xbc5a42,_0x26fa04,_0x230fea){_0x26fa04[_0xb9b9('0x12')]=_0x26fa04['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x230fea(null,util[_0xb9b9('0x13')]('%s-%s%s',path[_0xb9b9('0x14')](_0x26fa04['originalname'],path[_0xb9b9('0x15')](_0x26fa04[_0xb9b9('0x12')])),Date[_0xb9b9('0x16')](),path[_0xb9b9('0x15')](_0x26fa04[_0xb9b9('0x12')])));}})});router[_0xb9b9('0x17')]('/',upload[_0xb9b9('0x18')](_0xb9b9('0x19')),controller['upload']);router[_0xb9b9('0x17')]('/webhook',controller[_0xb9b9('0x1a')]);router[_0xb9b9('0x1b')](_0xb9b9('0xd'),auth[_0xb9b9('0x9')](),controller['update']);router[_0xb9b9('0x1c')](_0xb9b9('0xd'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0x1c')]);module[_0xb9b9('0x1d')]=router; \ No newline at end of file +var _0x4b84=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/webhook','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','upload','webhookPost','/:id','isAuthenticated','delete'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x4b84[_0x4605dc];return _0x5d3e81;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),controller['webhookGet']);router[_0x44b8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0x8')](_0x44b8('0xa'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);var upload=multer({'storage':multer[_0x44b8('0xc')]({'destination':function(_0x4315f6,_0x9b6048,_0x24dd10){_0x24dd10(null,path[_0x44b8('0xd')](config[_0x44b8('0xe')],'server/files/plugins'));},'filename':function(_0x147529,_0x4301a6,_0x4bcc43){_0x4301a6[_0x44b8('0xf')]=_0x4301a6['originalname'][_0x44b8('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bcc43(null,util[_0x44b8('0x11')]('%s-%s%s',path[_0x44b8('0x12')](_0x4301a6['originalname'],path['extname'](_0x4301a6[_0x44b8('0xf')])),Date[_0x44b8('0x13')](),path[_0x44b8('0x14')](_0x4301a6[_0x44b8('0xf')])));}})});router['post']('/',upload['single']('file'),controller[_0x44b8('0x15')]);router['post'](_0x44b8('0x7'),controller[_0x44b8('0x16')]);router['put'](_0x44b8('0x17'),auth[_0x44b8('0x18')](),controller['update']);router[_0x44b8('0x19')](_0x44b8('0x17'),auth['isAuthenticated'](),controller[_0x44b8('0x19')]);module[_0x44b8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index f97bfc7..3bbc27b 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b03=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x50f338,_0x517f20){var _0x5e9f07=function(_0x2b32b0){while(--_0x2b32b0){_0x50f338['push'](_0x50f338['shift']());}};_0x5e9f07(++_0x517f20);}(_0x7b03,0x18d));var _0x37b0=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x7b03[_0x16cb03];return _0x10944e;};'use strict';var Sequelize=require(_0x37b0('0x0'));module[_0x37b0('0x1')]={'name':{'type':Sequelize[_0x37b0('0x2')]},'type':{'type':Sequelize[_0x37b0('0x3')]('html',_0x37b0('0x4'))},'description':{'type':Sequelize[_0x37b0('0x5')]},'version':{'type':Sequelize[_0x37b0('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x37b0('0x6')},'active':{'type':Sequelize[_0x37b0('0x7')],'defaultValue':0x0,'comment':_0x37b0('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x37b0('0x9'),_0x37b0('0xa'),_0x37b0('0xb'),_0x37b0('0xc')),'defaultValue':'always','comment':_0x37b0('0xd')},'icon':{'type':Sequelize[_0x37b0('0x2')]},'adminUrl':{'type':Sequelize[_0x37b0('0x2')]},'agentUrl':{'type':Sequelize[_0x37b0('0x2')]},'scriptName':{'type':Sequelize[_0x37b0('0x2')]},'scriptPath':{'type':Sequelize[_0x37b0('0x2')]}}; \ No newline at end of file +var _0x48c7=['STRING','ENUM','html','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','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x4c11d1,_0x30aef1){var _0xa4b5bc=function(_0x20a137){while(--_0x20a137){_0x4c11d1['push'](_0x4c11d1['shift']());}};_0xa4b5bc(++_0x30aef1);}(_0x48c7,0x66));var _0x748c=function(_0x245505,_0x2cfe7b){_0x245505=_0x245505-0x0;var _0x424bcb=_0x48c7[_0x245505];return _0x424bcb;};'use strict';var Sequelize=require(_0x748c('0x0'));module[_0x748c('0x1')]={'name':{'type':Sequelize[_0x748c('0x2')]},'type':{'type':Sequelize[_0x748c('0x3')](_0x748c('0x4'),'script')},'description':{'type':Sequelize[_0x748c('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x748c('0x2')],'comment':_0x748c('0x6')},'active':{'type':Sequelize[_0x748c('0x7')],'defaultValue':0x0,'comment':_0x748c('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x748c('0x9'),_0x748c('0xa'),_0x748c('0xb'),'never'),'defaultValue':_0x748c('0xb'),'comment':_0x748c('0xc')},'icon':{'type':Sequelize[_0x748c('0x2')]},'adminUrl':{'type':Sequelize[_0x748c('0x2')]},'agentUrl':{'type':Sequelize[_0x748c('0x2')]},'scriptName':{'type':Sequelize[_0x748c('0x2')]},'scriptPath':{'type':Sequelize[_0x748c('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 01b15bc..314c092 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc69f=['%s.zip','basename','createWriteStream','zip','warning','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','existsSync','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','agent','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','find','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','Plugins','UserProfileResource','stack','name','send','index','map','Plugin','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','params','path','join','root','server/files/plugins','format'];(function(_0x39dc2b,_0x7d266){var _0x56be71=function(_0x3d08b7){while(--_0x3d08b7){_0x39dc2b['push'](_0x39dc2b['shift']());}};_0x56be71(++_0x7d266);}(_0xc69f,0x104));var _0xfc69=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc69f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc69('0x0'));var zipdir=require(_0xfc69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfc69('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfc69('0x3'));var util=require(_0xfc69('0x4'));var path=require('path');var sox=require(_0xfc69('0x5'));var csv=require('to-csv');var ejs=require(_0xfc69('0x6'));var fs=require('fs');var fs_extra=require(_0xfc69('0x7'));var _=require(_0xfc69('0x8'));var squel=require(_0xfc69('0x9'));var crypto=require(_0xfc69('0xa'));var jsforce=require(_0xfc69('0xb'));var deskjs=require(_0xfc69('0xc'));var toCsv=require(_0xfc69('0xd'));var querystring=require(_0xfc69('0xe'));var Papa=require(_0xfc69('0xf'));var extract=require('extract-zip');var rimraf=require(_0xfc69('0x0'));var archiver=require(_0xfc69('0x10'));var Redis=require(_0xfc69('0x11'));var authService=require(_0xfc69('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfc69('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc69('0x14'))(_0xfc69('0x15'));var utils=require(_0xfc69('0x16'));var config=require(_0xfc69('0x17'));var licenseUtil=require(_0xfc69('0x18'));var db=require(_0xfc69('0x19'))['db'];config[_0xfc69('0x1a')]=_[_0xfc69('0x1b')](config['redis'],{'host':_0xfc69('0x1c'),'port':0x18eb});var socket=require(_0xfc69('0x1d'))(new Redis(config[_0xfc69('0x1a')]));require(_0xfc69('0x1e'))[_0xfc69('0x1f')](socket);function respondWithStatusCode(_0x2a3742,_0x23bf1e){_0x23bf1e=_0x23bf1e||0xcc;return function(_0x424331){if(_0x424331){return _0x2a3742[_0xfc69('0x20')](_0x23bf1e);}return _0x2a3742[_0xfc69('0x21')](_0x23bf1e)['end']();};}function respondWithResult(_0x975920,_0x2c7164){_0x2c7164=_0x2c7164||0xc8;return function(_0x1e9ae3){if(_0x1e9ae3){return _0x975920[_0xfc69('0x21')](_0x2c7164)[_0xfc69('0x22')](_0x1e9ae3);}};}function respondWithFilteredResult(_0x4ab5ec,_0x589d51){return function(_0x3f66af){if(_0x3f66af){var _0x148aa6=typeof _0x589d51[_0xfc69('0x23')]==='undefined'&&typeof _0x589d51[_0xfc69('0x24')]===_0xfc69('0x25');var _0xe56ea1=_0x3f66af[_0xfc69('0x26')];var _0x523543=_0x148aa6?0x0:_0x589d51['offset'];var _0x4e8255=_0x148aa6?_0x3f66af[_0xfc69('0x26')]:_0x589d51['offset']+_0x589d51[_0xfc69('0x24')];var _0x18eb25;if(_0x4e8255>=_0xe56ea1){_0x4e8255=_0xe56ea1;_0x18eb25=0xc8;}else{_0x18eb25=0xce;}_0x4ab5ec['status'](_0x18eb25);return _0x4ab5ec['set'](_0xfc69('0x27'),_0x523543+'-'+_0x4e8255+'/'+_0xe56ea1)['json'](_0x3f66af);}return null;};}function patchUpdates(_0x308ca2){return function(_0x5dd32f){try{jsonpatch['apply'](_0x5dd32f,_0x308ca2,!![]);}catch(_0x1db57e){return BPromise[_0xfc69('0x28')](_0x1db57e);}return _0x5dd32f[_0xfc69('0x29')]();};}function saveUpdates(_0x4bdc9b,_0x4c03fe){return function(_0x2bc95d){if(_0x2bc95d){return _0x2bc95d[_0xfc69('0x2a')](_0x4bdc9b)[_0xfc69('0x2b')](function(_0x423518){return _0x423518;});}return null;};}function removeEntity(_0x299608,_0x54c044){return function(_0x1f6c4b){if(_0x1f6c4b){return _0x1f6c4b[_0xfc69('0x2c')]()[_0xfc69('0x2b')](function(){var _0x226731=_0x1f6c4b[_0xfc69('0x2d')]({'plain':!![]});var _0xacfeba=_0xfc69('0x2e');return db[_0xfc69('0x2f')][_0xfc69('0x2c')]({'where':{'type':_0xacfeba,'resourceId':_0x226731['id']}})[_0xfc69('0x2b')](function(){return _0x1f6c4b;});})[_0xfc69('0x2b')](function(){_0x299608[_0xfc69('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3980f0,_0x286a08){return function(_0x436039){if(!_0x436039){_0x3980f0[_0xfc69('0x20')](0x194);}return _0x436039;};}function handleError(_0x51af0f,_0x48a707){_0x48a707=_0x48a707||0x1f4;return function(_0x2ac2b1){logger['error'](_0x2ac2b1[_0xfc69('0x30')]);if(_0x2ac2b1[_0xfc69('0x31')]){delete _0x2ac2b1['name'];}_0x51af0f[_0xfc69('0x21')](_0x48a707)[_0xfc69('0x32')](_0x2ac2b1);};}exports[_0xfc69('0x33')]=function(_0x501d3e,_0x41ce5e){var _0x15736e={},_0x4a1378={},_0x8c71fa={'count':0x0,'rows':[]};var _0xd48578=_[_0xfc69('0x34')](db[_0xfc69('0x35')][_0xfc69('0x36')],function(_0x40e3fd){return{'name':_0x40e3fd['fieldName'],'type':_0x40e3fd[_0xfc69('0x37')][_0xfc69('0x38')]};});_0x4a1378[_0xfc69('0x39')]=_[_0xfc69('0x34')](_0xd48578,'name');_0x4a1378['query']=_[_0xfc69('0x3a')](_0x501d3e[_0xfc69('0x3b')]);_0x4a1378[_0xfc69('0x3c')]=_[_0xfc69('0x3d')](_0x4a1378[_0xfc69('0x39')],_0x4a1378[_0xfc69('0x3b')]);_0x15736e['attributes']=_[_0xfc69('0x3d')](_0x4a1378[_0xfc69('0x39')],qs[_0xfc69('0x3e')](_0x501d3e[_0xfc69('0x3b')][_0xfc69('0x3e')]));_0x15736e[_0xfc69('0x3f')]=_0x15736e[_0xfc69('0x3f')][_0xfc69('0x40')]?_0x15736e[_0xfc69('0x3f')]:_0x4a1378[_0xfc69('0x39')];if(!_0x501d3e[_0xfc69('0x3b')][_0xfc69('0x41')](_0xfc69('0x42'))){_0x15736e[_0xfc69('0x24')]=qs[_0xfc69('0x24')](_0x501d3e[_0xfc69('0x3b')][_0xfc69('0x24')]);_0x15736e['offset']=qs[_0xfc69('0x23')](_0x501d3e[_0xfc69('0x3b')][_0xfc69('0x23')]);}_0x15736e[_0xfc69('0x43')]=qs[_0xfc69('0x44')](_0x501d3e['query'][_0xfc69('0x44')]);_0x15736e[_0xfc69('0x45')]=qs['filters'](_[_0xfc69('0x46')](_0x501d3e[_0xfc69('0x3b')],_0x4a1378[_0xfc69('0x3c')]),_0xd48578);if(_0x501d3e[_0xfc69('0x3b')][_0xfc69('0x47')]){_0x15736e[_0xfc69('0x45')]=_[_0xfc69('0x48')](_0x15736e[_0xfc69('0x45')],{'$or':_[_0xfc69('0x34')](_0xd48578,function(_0x404aa8){if(_0x404aa8[_0xfc69('0x37')]!==_0xfc69('0x49')){var _0x2ac4ef={};_0x2ac4ef[_0x404aa8[_0xfc69('0x31')]]={'$like':'%'+_0x501d3e['query'][_0xfc69('0x47')]+'%'};return _0x2ac4ef;}})});}_0x15736e=_[_0xfc69('0x48')]({},_0x15736e,_0x501d3e[_0xfc69('0x4a')]);var _0x481068={'where':_0x15736e['where']};return db[_0xfc69('0x35')][_0xfc69('0x26')](_0x481068)[_0xfc69('0x2b')](function(_0xf6461){_0x8c71fa[_0xfc69('0x26')]=_0xf6461;if(_0x501d3e[_0xfc69('0x3b')]['includeAll']){_0x15736e[_0xfc69('0x4b')]=[{'all':!![]}];}return db[_0xfc69('0x35')]['findAll'](_0x15736e);})[_0xfc69('0x2b')](function(_0x39a42c){_0x8c71fa[_0xfc69('0x4c')]=_0x39a42c;return _0x8c71fa;})[_0xfc69('0x2b')](respondWithFilteredResult(_0x41ce5e,_0x15736e))[_0xfc69('0x4d')](handleError(_0x41ce5e,null));};exports[_0xfc69('0x4e')]=function(_0x2960f0,_0x5052cf){var _0x1f227e={'raw':!![],'where':{'id':_0x2960f0['params']['id']}},_0x4e2f38={};_0x4e2f38['model']=_[_0xfc69('0x3a')](db['Plugin']['rawAttributes']);_0x4e2f38['query']=_['keys'](_0x2960f0['query']);_0x4e2f38[_0xfc69('0x3c')]=_[_0xfc69('0x3d')](_0x4e2f38[_0xfc69('0x39')],_0x4e2f38[_0xfc69('0x3b')]);_0x1f227e['attributes']=_[_0xfc69('0x3d')](_0x4e2f38['model'],qs[_0xfc69('0x3e')](_0x2960f0[_0xfc69('0x3b')][_0xfc69('0x3e')]));_0x1f227e[_0xfc69('0x3f')]=_0x1f227e[_0xfc69('0x3f')]['length']?_0x1f227e[_0xfc69('0x3f')]:_0x4e2f38[_0xfc69('0x39')];if(_0x2960f0['query'][_0xfc69('0x4f')]){_0x1f227e['include']=[{'all':!![]}];}_0x1f227e=_[_0xfc69('0x48')]({},_0x1f227e,_0x2960f0[_0xfc69('0x4a')]);return db[_0xfc69('0x35')]['find'](_0x1f227e)[_0xfc69('0x2b')](handleEntityNotFound(_0x5052cf,null))['then'](respondWithResult(_0x5052cf,null))[_0xfc69('0x4d')](handleError(_0x5052cf,null));};exports['download']=function(_0x95829c,_0x54028f,_0x4cdb25){return db['Plugin']['find']({'where':{'id':_0x95829c[_0xfc69('0x50')]['id']},'attributes':[_0xfc69('0x31'),_0xfc69('0x51')],'raw':!![]})[_0xfc69('0x2b')](handleEntityNotFound(_0x54028f,null))[_0xfc69('0x2b')](function(_0x2df017){if(_0x2df017){var _0x4dfd00=path[_0xfc69('0x52')](config[_0xfc69('0x53')],_0xfc69('0x54'),util[_0xfc69('0x55')](_0xfc69('0x56'),path[_0xfc69('0x57')](_0x2df017['path'])));var _0x2ca874=fs[_0xfc69('0x58')](_0x4dfd00);var _0x1b1f06=archiver(_0xfc69('0x59'),{'zlib':{'level':0x9}});_0x1b1f06['on'](_0xfc69('0x5a'),function(_0x1c9ee7){if(_0x1c9ee7['code']===_0xfc69('0x5b')){logger[_0xfc69('0x5c')](_0x1c9ee7);}else{throw new db[(_0xfc69('0x5d'))]['Error'](_0xfc69('0x5e'));}});_0x1b1f06['on'](_0xfc69('0x5c'),function(_0x44526c){throw new db['Sequelize']['Error'](_0xfc69('0x5e'));});_0x1b1f06[_0xfc69('0x5f')](_0x2ca874);_0x1b1f06[_0xfc69('0x60')](_0xfc69('0x61'),{'cwd':path['join'](config['root'],_0xfc69('0x54'),path['dirname'](_0x2df017['path'])),'ignore':[path[_0xfc69('0x52')](path[_0xfc69('0x57')](_0x2df017[_0xfc69('0x51')]),_0xfc69('0x62')),path[_0xfc69('0x52')](path[_0xfc69('0x57')](_0x2df017[_0xfc69('0x51')]),_0xfc69('0x63'))],'nodir':!![]})[_0xfc69('0x64')]();_0x2ca874['on']('close',function(){if(!fs[_0xfc69('0x65')](_0x4dfd00)){throw new db[(_0xfc69('0x5d'))][(_0xfc69('0x66'))](_0xfc69('0x67'));}return _0x54028f['download'](_0x4dfd00,util[_0xfc69('0x55')](_0xfc69('0x56'),path[_0xfc69('0x57')](_0x2df017[_0xfc69('0x51')])),function(_0x4b0d62){if(_0x4b0d62){throw new db[(_0xfc69('0x5d'))]['Error'](_0xfc69('0x68'));}fs[_0xfc69('0x69')](_0x4dfd00);logger['info'](_0xfc69('0x6a'));logger[_0xfc69('0x6b')](_0xfc69('0x6c'));});});}return null;})['catch'](handleError(_0x54028f,null));};exports[_0xfc69('0x6d')]=function(_0x41a4b0,_0x5c58c9,_0x5d0ee8){var _0x54c20d=path[_0xfc69('0x57')](_0x41a4b0[_0xfc69('0x6e')][_0xfc69('0x6f')],path['extname'](_0x41a4b0[_0xfc69('0x6e')][_0xfc69('0x6f')]));var _0x5c8543=path[_0xfc69('0x52')](config[_0xfc69('0x53')],_0xfc69('0x54'),_0x41a4b0[_0xfc69('0x6e')][_0xfc69('0x6f')]);var _0x12afef=path['join'](config[_0xfc69('0x53')],_0xfc69('0x54'),_0x54c20d);logger['info'](_0xfc69('0x70'),_0x5c8543);logger['info'](_0xfc69('0x71'),_0x12afef);try{fs[_0xfc69('0x72')](_0x5c8543,parseInt('0777',0x8));extract(_0x5c8543,{'dir':_0x12afef},function(_0x39c23a){if(_0x39c23a){logger['error'](_0x39c23a);handleError(_0x39c23a,!![]);};var _0x41c46c=fs[_0xfc69('0x73')](_0x12afef);if(_0x41c46c[_0xfc69('0x40')]>0x1){removeReferences(_0x5c8543,_0x12afef);logger[_0xfc69('0x5c')](_0xfc69('0x74'));return _0x5d0ee8(new Error('Invalid\x20plugin\x20structure'));}var _0x2653f6=fs[_0xfc69('0x75')](path['join'](_0x12afef,_0x41c46c[0x0]));if(_0x2653f6[_0xfc69('0x76')]()){removeReferences(_0x5c8543,_0x12afef);logger[_0xfc69('0x5c')](_0xfc69('0x74'));return _0x5d0ee8(new Error(_0xfc69('0x74')));}if(_0x2653f6[_0xfc69('0x77')]()){var _0x388fb5=fs[_0xfc69('0x73')](path[_0xfc69('0x52')](_0x12afef,_0x41c46c[0x0]));if(_0x388fb5[_0xfc69('0x40')]===0x0){removeReferences(_0x5c8543,_0x12afef);logger[_0xfc69('0x5c')](_0xfc69('0x74'));return _0x5d0ee8(new Error(_0xfc69('0x74')));}var _0xd5ed6b=_0x388fb5[_0xfc69('0x78')](function(_0x8074d7){return _0x8074d7===_0xfc69('0x79');});if(!_0xd5ed6b){return _0x5d0ee8(new Error(_0xfc69('0x7a')));}var _0x2ca501=fs[_0xfc69('0x7b')](path[_0xfc69('0x52')](_0x12afef,_0x41c46c[0x0],_0xfc69('0x79')));var _0x4bc5b6=JSON[_0xfc69('0x7c')](_0x2ca501);if(_0xfc69('0x25')==typeof _0x4bc5b6[_0xfc69('0x31')]){return _0x5d0ee8(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xfc69('0x25')==typeof _0x4bc5b6[_0xfc69('0x37')]){return _0x5d0ee8(new Error(_0xfc69('0x7d')));}if('undefined'==typeof _0x4bc5b6[_0xfc69('0x7e')]){return _0x5d0ee8(new Error(_0xfc69('0x7f')));}if(_0xfc69('0x25')==typeof _0x4bc5b6[_0xfc69('0x80')]){return _0x5d0ee8(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4bc5b6[_0xfc69('0x37')]===_0xfc69('0x81')){if('undefined'==typeof _0x4bc5b6['parameters']['views']){return _0x5d0ee8(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xfc69('0x25')==typeof _0x4bc5b6[_0xfc69('0x80')]['views']['admin']&&_0xfc69('0x25')==typeof _0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')][_0xfc69('0x83')]){return _0x5d0ee8(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4bc5b6[_0xfc69('0x37')]===_0xfc69('0x84')){if('undefined'==typeof _0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x85')]){return _0x5d0ee8(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xfc69('0x25')==typeof _0x4bc5b6['parameters'][_0xfc69('0x86')]){return _0x5d0ee8(new Error(_0xfc69('0x87')));}}else{return _0x5d0ee8(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x4c01e6=_0x4bc5b6[_0xfc69('0x31')];var _0x1a752b=_0x4bc5b6[_0xfc69('0x88')];var _0x177420=_0x4bc5b6[_0xfc69('0x37')];var _0xbcdea=_0x4bc5b6[_0xfc69('0x89')]?_0x4bc5b6[_0xfc69('0x89')]:_0xfc69('0x8a');var _0x55e4ce=_0x4bc5b6[_0xfc69('0x8b')]?_0x4bc5b6[_0xfc69('0x8b')]:_0xfc69('0x8c');var _0x36d617='';var _0x4cc24f='';var _0x549690='';var _0x1e3c06='';var _0x4ad806=_0x4bc5b6[_0xfc69('0x7e')];if(_0x177420==='html'){if(_0xfc69('0x25')!=typeof _0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')][_0xfc69('0x8d')]){var _0x2910e9=_0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')][_0xfc69('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xfc69('0x8e')](_0x2910e9)){_0x36d617=path[_0xfc69('0x52')](_0xfc69('0x8f'),_0x54c20d,_0x41c46c[0x0],_0x2910e9);}else{_0x36d617=_0x2910e9;}}else{logger[_0xfc69('0x6b')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xfc69('0x25')!=typeof _0x4bc5b6['parameters'][_0xfc69('0x82')][_0xfc69('0x83')]){var _0x23dcdb=_0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')][_0xfc69('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xfc69('0x8e')](_0x23dcdb)){_0x4cc24f=path[_0xfc69('0x52')](_0xfc69('0x8f'),_0x54c20d,_0x41c46c[0x0],_0x23dcdb);}else{_0x4cc24f=_0x23dcdb;}}else{logger['info'](_0xfc69('0x90'));}}else if(_0x177420==='script'){_0x549690=_0x4bc5b6['parameters']['scriptName'];_0x1e3c06=_0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x86')];if(_0xfc69('0x25')!=typeof _0x4bc5b6['parameters'][_0xfc69('0x82')]){if(_0xfc69('0x25')!=typeof _0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')]['admin']){var _0x2910e9=_0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')][_0xfc69('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xfc69('0x8e')](_0x2910e9)){_0x36d617=path[_0xfc69('0x52')](_0xfc69('0x8f'),_0x54c20d,_0x41c46c[0x0],_0x2910e9);}else{_0x36d617=_0x2910e9;}}if(_0xfc69('0x25')!=typeof _0x4bc5b6[_0xfc69('0x80')][_0xfc69('0x82')][_0xfc69('0x83')]){var _0x23dcdb=_0x4bc5b6[_0xfc69('0x80')]['views'][_0xfc69('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xfc69('0x8e')](_0x23dcdb)){_0x4cc24f=path['join']('plugins',_0x54c20d,_0x41c46c[0x0],_0x23dcdb);}else{_0x4cc24f=_0x23dcdb;}}}}var _0x2e48f4={'name':_0x4c01e6,'description':_0x1a752b,'path':path['join'](_0x54c20d,_0x41c46c[0x0]),'type':_0x177420,'sidebar':_0xbcdea,'icon':_0x55e4ce,'adminUrl':_0x36d617,'agentUrl':_0x4cc24f,'scriptName':_0x549690,'scriptPath':_0x1e3c06,'version':_0x4ad806};removeReferences(_0x5c8543,null);return db[_0xfc69('0x35')][_0xfc69('0x91')](_0x2e48f4)[_0xfc69('0x2b')](function(_0x4d7b92){var _0x32e35d={'role':_0x41a4b0['body'][_0xfc69('0x92')],'userProfileId':_0x41a4b0[_0xfc69('0x93')]['userProfileId']};if(!_0x32e35d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32e35d['role']===_0xfc69('0x94')){var _0xf56d64=_0x4d7b92[_0xfc69('0x2d')]({'plain':!![]});return db[_0xfc69('0x95')]['find']({'where':{'name':'Plugins','userProfileId':_0x32e35d[_0xfc69('0x96')]},'raw':!![]})['then'](function(_0x1a8cec){if(_0x1a8cec&&_0x1a8cec[_0xfc69('0x97')]===0x0){return db[_0xfc69('0x2f')]['create']({'name':_0xf56d64[_0xfc69('0x31')],'resourceId':_0xf56d64['id'],'type':_0x1a8cec[_0xfc69('0x31')],'sectionId':_0x1a8cec['id']},{})[_0xfc69('0x2b')](function(){return _0x4d7b92;});}else{return _0x4d7b92;}})['catch'](function(_0x4adc67){logger[_0xfc69('0x5c')](_0xfc69('0x98'),_0x4adc67);throw _0x4adc67;});}return _0x4d7b92;})[_0xfc69('0x2b')](respondWithResult(_0x5c58c9,null))[_0xfc69('0x4d')](handleError(_0x5c58c9,null));}});}catch(_0x141e0f){_0x5c58c9[_0xfc69('0x21')](0x1f4)['send'](_0x141e0f);}};function removeReferences(_0x5f2c0e,_0x18127f){try{if(_0x5f2c0e){fs[_0xfc69('0x69')](_0x5f2c0e);logger[_0xfc69('0x6b')](_0xfc69('0x99'));}if(_0x18127f){rimraf(_0x18127f,function(){});logger[_0xfc69('0x6b')](_0xfc69('0x9a'));}}catch(_0x3ecac3){logger[_0xfc69('0x5c')](_0x3ecac3);}}exports['update']=function(_0x39c110,_0x18fc02,_0x4cceb7){return db[_0xfc69('0x35')][_0xfc69('0x9b')]({'where':{'id':_0x39c110[_0xfc69('0x50')]['id']}})[_0xfc69('0x2b')](handleEntityNotFound(_0x18fc02,null))[_0xfc69('0x2b')](saveUpdates(_0x39c110['body'],null))[_0xfc69('0x2b')](respondWithResult(_0x18fc02,null))[_0xfc69('0x4d')](handleError(_0x18fc02,null));};exports[_0xfc69('0x9c')]=function(_0x2344fd,_0xeb653,_0x48560e){return db['Plugin'][_0xfc69('0x9b')]({'where':{'id':_0x2344fd[_0xfc69('0x50')]['id']}})['then'](function(_0x82a5b0){if(_0x82a5b0){return _0x82a5b0[_0xfc69('0x2c')]();}})['then'](function(_0x59782f){rimraf(path[_0xfc69('0x52')](config['root'],_0xfc69('0x54'),path['dirname'](_0x59782f[_0xfc69('0x51')])),function(){});return _0x59782f;})[_0xfc69('0x2b')](handleEntityNotFound(_0xeb653,null))[_0xfc69('0x2b')](respondWithStatusCode(_0xeb653,null))[_0xfc69('0x4d')](handleError(_0xeb653,null));};exports[_0xfc69('0x9d')]=function(_0x359782,_0x43aaaf,_0x3d3f78){return BPromise[_0xfc69('0x9e')]()[_0xfc69('0x2b')](function(){if(!_0x359782['query'][_0xfc69('0x51')]){throw new Error(_0xfc69('0x9f'));}if(!_0x359782[_0xfc69('0x3b')][_0xfc69('0xa0')]){throw new Error(_0xfc69('0xa1'));}var _0x4bd4af=_0x359782[_0xfc69('0x3b')][_0xfc69('0xa2')]?_0x359782['query']['hostname']+':'+_0x359782[_0xfc69('0x3b')][_0xfc69('0xa0')]:_0xfc69('0xa3')+_0x359782[_0xfc69('0x3b')][_0xfc69('0xa0')];var _0x52ecd0=_0x359782[_0xfc69('0x3b')][_0xfc69('0x22')]?_0x359782[_0xfc69('0x3b')][_0xfc69('0x22')]:!![];var _0x5dc67a=_0x359782[_0xfc69('0x3b')][_0xfc69('0xa4')]?_0x359782[_0xfc69('0x3b')][_0xfc69('0xa4')]:null;var _0x2c588a={'method':_0x359782[_0xfc69('0xa5')],'uri':util['format'](_0xfc69('0xa6'),_0x4bd4af,_0x359782[_0xfc69('0x3b')][_0xfc69('0x51')]),'json':_0x52ecd0,'resolveWithFullResponse':!![],'encoding':_0x5dc67a,'qs':_0x359782[_0xfc69('0x3b')]};if(_0x359782[_0xfc69('0xa7')]){_0x2c588a[_0xfc69('0xa7')]=_0x359782[_0xfc69('0xa7')];if(_0x2c588a[_0xfc69('0xa7')][_0xfc69('0xa8')]){delete _0x2c588a[_0xfc69('0xa7')][_0xfc69('0xa8')];}}if(_0x2c588a[_0xfc69('0xa7')][_0xfc69('0xa9')]){delete _0x2c588a['headers'][_0xfc69('0xa9')];}return rp(_0x2c588a);})[_0xfc69('0x2b')](function(_0x372f43){if(_0x372f43){_0x43aaaf[_0xfc69('0xaa')](_0x372f43['headers']);logger[_0xfc69('0x6b')](_0x372f43['body']);if(_[_0xfc69('0xab')](_0x359782['query']['path'],'download')&&_0x372f43[_0xfc69('0xac')]==0x1f4){return _0x43aaaf[_0xfc69('0x20')](_0x372f43['statusCode']);}else{return _0x43aaaf[_0xfc69('0x21')](_0x372f43[_0xfc69('0xac')])[_0xfc69('0x32')](_0x372f43[_0xfc69('0x93')]);}}else{return _0x43aaaf[_0xfc69('0x20')](0xc8);}})['catch'](handleError(_0x43aaaf,null));};exports['webhookPost']=function(_0x356d41,_0x4254e1,_0x5335b3){return BPromise[_0xfc69('0x9e')]()[_0xfc69('0x2b')](function(){if(!_0x356d41[_0xfc69('0x3b')]['path']){throw new Error(_0xfc69('0x9f'));}if(!_0x356d41[_0xfc69('0x3b')][_0xfc69('0xa0')]){throw new Error(_0xfc69('0xa1'));}var _0x583f72=_0x356d41[_0xfc69('0x3b')][_0xfc69('0xa2')]?_0x356d41[_0xfc69('0x3b')][_0xfc69('0xa2')]+':'+_0x356d41[_0xfc69('0x3b')]['port']:'http://localhost:'+_0x356d41[_0xfc69('0x3b')][_0xfc69('0xa0')];var _0x549642=_0x356d41[_0xfc69('0x3b')]['json']?_0x356d41[_0xfc69('0x3b')]['json']:!![];var _0xd091f8=_0x356d41[_0xfc69('0x3b')][_0xfc69('0xa4')]?_0x356d41[_0xfc69('0x3b')][_0xfc69('0xa4')]:null;var _0x14614f={'method':_0x356d41[_0xfc69('0xa5')],'uri':util[_0xfc69('0x55')]('%s%s',_0x583f72,_0x356d41['query'][_0xfc69('0x51')]),'json':_0x549642,'resolveWithFullResponse':!![],'encoding':_0xd091f8,'body':_0x356d41[_0xfc69('0x93')]};if(_0x356d41[_0xfc69('0xa7')]){_0x14614f[_0xfc69('0xa7')]=_0x356d41['headers'];if(_0x14614f[_0xfc69('0xa7')][_0xfc69('0xa8')]){delete _0x14614f[_0xfc69('0xa7')][_0xfc69('0xa8')];}}if(_0x14614f[_0xfc69('0xa7')][_0xfc69('0xa9')]){delete _0x14614f[_0xfc69('0xa7')][_0xfc69('0xa9')];}return rp(_0x14614f);})[_0xfc69('0x2b')](function(_0xeab58a){if(_0xeab58a){_0x4254e1[_0xfc69('0xaa')](_0xeab58a[_0xfc69('0xa7')]);logger[_0xfc69('0x6b')](_0xeab58a[_0xfc69('0x93')]);return _0x4254e1[_0xfc69('0x21')](_0xeab58a[_0xfc69('0xac')])['send'](_0xeab58a['body']);}else{return _0x4254e1[_0xfc69('0x20')](0xc8);}})[_0xfc69('0x4d')](handleError(_0x4254e1,null));}; \ No newline at end of file +var _0x7885=['where','filter','merge','map','VIRTUAL','includeAll','include','Plugin','findAll','rows','catch','show','params','keys','rawAttributes','options','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon-apps','version','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','webhookGet','hostname','port','http://localhost:','encoding','headers','content-length','content-type','set','endsWith','statusCode','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','get','Plugins','UserProfileResource','then','error','stack','name','send','index','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x31d833,_0x9590c2){var _0x2927a2=function(_0x29b17a){while(--_0x29b17a){_0x31d833['push'](_0x31d833['shift']());}};_0x2927a2(++_0x9590c2);}(_0x7885,0x113));var _0x5788=function(_0x474f1b,_0x4a5d60){_0x474f1b=_0x474f1b-0x0;var _0x4a7461=_0x7885[_0x474f1b];return _0x4a7461;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5788('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5788('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5788('0x2'));var Mustache=require(_0x5788('0x3'));var util=require(_0x5788('0x4'));var path=require(_0x5788('0x5'));var sox=require(_0x5788('0x6'));var csv=require('to-csv');var ejs=require(_0x5788('0x7'));var fs=require('fs');var fs_extra=require(_0x5788('0x8'));var _=require(_0x5788('0x9'));var squel=require(_0x5788('0xa'));var crypto=require(_0x5788('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5788('0xc'));var querystring=require(_0x5788('0xd'));var Papa=require(_0x5788('0xe'));var extract=require(_0x5788('0xf'));var rimraf=require(_0x5788('0x0'));var archiver=require('archiver');var Redis=require(_0x5788('0x10'));var authService=require(_0x5788('0x11'));var qs=require(_0x5788('0x12'));var as=require(_0x5788('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5788('0x14'))(_0x5788('0x15'));var utils=require(_0x5788('0x16'));var config=require(_0x5788('0x17'));var licenseUtil=require(_0x5788('0x18'));var db=require('../../mysqldb')['db'];config[_0x5788('0x19')]=_[_0x5788('0x1a')](config['redis'],{'host':_0x5788('0x1b'),'port':0x18eb});var socket=require(_0x5788('0x1c'))(new Redis(config[_0x5788('0x19')]));require(_0x5788('0x1d'))[_0x5788('0x1e')](socket);function respondWithStatusCode(_0x5747ef,_0x56a34){_0x56a34=_0x56a34||0xcc;return function(_0xe2b2d0){if(_0xe2b2d0){return _0x5747ef[_0x5788('0x1f')](_0x56a34);}return _0x5747ef['status'](_0x56a34)[_0x5788('0x20')]();};}function respondWithResult(_0x287947,_0x2379a5){_0x2379a5=_0x2379a5||0xc8;return function(_0x311325){if(_0x311325){return _0x287947[_0x5788('0x21')](_0x2379a5)[_0x5788('0x22')](_0x311325);}};}function respondWithFilteredResult(_0x138201,_0x4de9c9){return function(_0x583197){if(_0x583197){var _0x13e84b=typeof _0x4de9c9[_0x5788('0x23')]===_0x5788('0x24')&&typeof _0x4de9c9[_0x5788('0x25')]===_0x5788('0x24');var _0x4a7e01=_0x583197[_0x5788('0x26')];var _0x3b08f8=_0x13e84b?0x0:_0x4de9c9[_0x5788('0x23')];var _0x51a3d0=_0x13e84b?_0x583197['count']:_0x4de9c9[_0x5788('0x23')]+_0x4de9c9[_0x5788('0x25')];var _0x3893b2;if(_0x51a3d0>=_0x4a7e01){_0x51a3d0=_0x4a7e01;_0x3893b2=0xc8;}else{_0x3893b2=0xce;}_0x138201[_0x5788('0x21')](_0x3893b2);return _0x138201['set'](_0x5788('0x27'),_0x3b08f8+'-'+_0x51a3d0+'/'+_0x4a7e01)[_0x5788('0x22')](_0x583197);}return null;};}function patchUpdates(_0x1e6350){return function(_0x5dced3){try{jsonpatch['apply'](_0x5dced3,_0x1e6350,!![]);}catch(_0x13f6ad){return BPromise[_0x5788('0x28')](_0x13f6ad);}return _0x5dced3['save']();};}function saveUpdates(_0x1a55bc,_0x48392e){return function(_0x57acf1){if(_0x57acf1){return _0x57acf1[_0x5788('0x29')](_0x1a55bc)['then'](function(_0x2aca65){return _0x2aca65;});}return null;};}function removeEntity(_0x13e2be,_0x30e88f){return function(_0x3b33f0){if(_0x3b33f0){return _0x3b33f0[_0x5788('0x2a')]()['then'](function(){var _0x50c14b=_0x3b33f0[_0x5788('0x2b')]({'plain':!![]});var _0xad0eec=_0x5788('0x2c');return db[_0x5788('0x2d')][_0x5788('0x2a')]({'where':{'type':_0xad0eec,'resourceId':_0x50c14b['id']}})[_0x5788('0x2e')](function(){return _0x3b33f0;});})['then'](function(){_0x13e2be[_0x5788('0x21')](0xcc)[_0x5788('0x20')]();});}};}function handleEntityNotFound(_0x308f6d,_0xc1b07a){return function(_0xb74a8b){if(!_0xb74a8b){_0x308f6d[_0x5788('0x1f')](0x194);}return _0xb74a8b;};}function handleError(_0x409601,_0x48c091){_0x48c091=_0x48c091||0x1f4;return function(_0xe1425b){logger[_0x5788('0x2f')](_0xe1425b[_0x5788('0x30')]);if(_0xe1425b[_0x5788('0x31')]){delete _0xe1425b[_0x5788('0x31')];}_0x409601[_0x5788('0x21')](_0x48c091)[_0x5788('0x32')](_0xe1425b);};}exports[_0x5788('0x33')]=function(_0x703ec1,_0x411d69){var _0x53d465={},_0x199b26={},_0x15584b={'count':0x0,'rows':[]};var _0x2b0f4e=_['map'](db['Plugin']['rawAttributes'],function(_0x109d7c){return{'name':_0x109d7c[_0x5788('0x34')],'type':_0x109d7c[_0x5788('0x35')]['key']};});_0x199b26['model']=_['map'](_0x2b0f4e,_0x5788('0x31'));_0x199b26[_0x5788('0x36')]=_['keys'](_0x703ec1[_0x5788('0x36')]);_0x199b26[_0x5788('0x37')]=_[_0x5788('0x38')](_0x199b26[_0x5788('0x39')],_0x199b26['query']);_0x53d465[_0x5788('0x3a')]=_[_0x5788('0x38')](_0x199b26[_0x5788('0x39')],qs[_0x5788('0x3b')](_0x703ec1[_0x5788('0x36')][_0x5788('0x3b')]));_0x53d465['attributes']=_0x53d465[_0x5788('0x3a')][_0x5788('0x3c')]?_0x53d465[_0x5788('0x3a')]:_0x199b26[_0x5788('0x39')];if(!_0x703ec1[_0x5788('0x36')][_0x5788('0x3d')](_0x5788('0x3e'))){_0x53d465['limit']=qs[_0x5788('0x25')](_0x703ec1[_0x5788('0x36')]['limit']);_0x53d465[_0x5788('0x23')]=qs[_0x5788('0x23')](_0x703ec1['query'][_0x5788('0x23')]);}_0x53d465[_0x5788('0x3f')]=qs[_0x5788('0x40')](_0x703ec1[_0x5788('0x36')][_0x5788('0x40')]);_0x53d465[_0x5788('0x41')]=qs[_0x5788('0x37')](_['pick'](_0x703ec1[_0x5788('0x36')],_0x199b26[_0x5788('0x37')]),_0x2b0f4e);if(_0x703ec1[_0x5788('0x36')][_0x5788('0x42')]){_0x53d465['where']=_[_0x5788('0x43')](_0x53d465['where'],{'$or':_[_0x5788('0x44')](_0x2b0f4e,function(_0x4f018c){if(_0x4f018c[_0x5788('0x35')]!==_0x5788('0x45')){var _0x5d3f9f={};_0x5d3f9f[_0x4f018c[_0x5788('0x31')]]={'$like':'%'+_0x703ec1[_0x5788('0x36')]['filter']+'%'};return _0x5d3f9f;}})});}_0x53d465=_[_0x5788('0x43')]({},_0x53d465,_0x703ec1['options']);var _0x2b2224={'where':_0x53d465[_0x5788('0x41')]};return db['Plugin'][_0x5788('0x26')](_0x2b2224)[_0x5788('0x2e')](function(_0x1883c5){_0x15584b[_0x5788('0x26')]=_0x1883c5;if(_0x703ec1[_0x5788('0x36')][_0x5788('0x46')]){_0x53d465[_0x5788('0x47')]=[{'all':!![]}];}return db[_0x5788('0x48')][_0x5788('0x49')](_0x53d465);})[_0x5788('0x2e')](function(_0xa5f4fb){_0x15584b[_0x5788('0x4a')]=_0xa5f4fb;return _0x15584b;})[_0x5788('0x2e')](respondWithFilteredResult(_0x411d69,_0x53d465))[_0x5788('0x4b')](handleError(_0x411d69,null));};exports[_0x5788('0x4c')]=function(_0x129163,_0x4db0a1){var _0x47d7d7={'raw':!![],'where':{'id':_0x129163[_0x5788('0x4d')]['id']}},_0x3df56e={};_0x3df56e[_0x5788('0x39')]=_[_0x5788('0x4e')](db[_0x5788('0x48')][_0x5788('0x4f')]);_0x3df56e[_0x5788('0x36')]=_[_0x5788('0x4e')](_0x129163[_0x5788('0x36')]);_0x3df56e[_0x5788('0x37')]=_[_0x5788('0x38')](_0x3df56e['model'],_0x3df56e['query']);_0x47d7d7[_0x5788('0x3a')]=_['intersection'](_0x3df56e[_0x5788('0x39')],qs['fields'](_0x129163[_0x5788('0x36')]['fields']));_0x47d7d7[_0x5788('0x3a')]=_0x47d7d7[_0x5788('0x3a')][_0x5788('0x3c')]?_0x47d7d7['attributes']:_0x3df56e[_0x5788('0x39')];if(_0x129163['query']['includeAll']){_0x47d7d7[_0x5788('0x47')]=[{'all':!![]}];}_0x47d7d7=_['merge']({},_0x47d7d7,_0x129163[_0x5788('0x50')]);return db[_0x5788('0x48')][_0x5788('0x51')](_0x47d7d7)[_0x5788('0x2e')](handleEntityNotFound(_0x4db0a1,null))[_0x5788('0x2e')](respondWithResult(_0x4db0a1,null))[_0x5788('0x4b')](handleError(_0x4db0a1,null));};exports[_0x5788('0x52')]=function(_0x14551e,_0xc9d453,_0x3ab621){return db[_0x5788('0x48')][_0x5788('0x51')]({'where':{'id':_0x14551e[_0x5788('0x4d')]['id']},'attributes':[_0x5788('0x31'),_0x5788('0x5')],'raw':!![]})[_0x5788('0x2e')](handleEntityNotFound(_0xc9d453,null))['then'](function(_0x1604cc){if(_0x1604cc){var _0x1e35fc=path[_0x5788('0x53')](config[_0x5788('0x54')],_0x5788('0x55'),util[_0x5788('0x56')](_0x5788('0x57'),path[_0x5788('0x58')](_0x1604cc[_0x5788('0x5')])));var _0x2e5c2e=fs[_0x5788('0x59')](_0x1e35fc);var _0x5d3342=archiver(_0x5788('0x5a'),{'zlib':{'level':0x9}});_0x5d3342['on'](_0x5788('0x5b'),function(_0x19761f){if(_0x19761f[_0x5788('0x5c')]==='ENOENT'){logger[_0x5788('0x2f')](_0x19761f);}else{throw new db[(_0x5788('0x5d'))][(_0x5788('0x5e'))](_0x5788('0x5f'));}});_0x5d3342['on']('error',function(_0xccf139){throw new db[(_0x5788('0x5d'))][(_0x5788('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5d3342[_0x5788('0x60')](_0x2e5c2e);_0x5d3342['glob'](_0x5788('0x61'),{'cwd':path['join'](config[_0x5788('0x54')],'server/files/plugins',path[_0x5788('0x62')](_0x1604cc['path'])),'ignore':[path['join'](path[_0x5788('0x58')](_0x1604cc[_0x5788('0x5')]),'node_modules/**/*'),path[_0x5788('0x53')](path['basename'](_0x1604cc[_0x5788('0x5')]),_0x5788('0x63'))],'nodir':!![]})[_0x5788('0x64')]();_0x2e5c2e['on'](_0x5788('0x65'),function(){if(!fs[_0x5788('0x66')](_0x1e35fc)){throw new db[(_0x5788('0x5d'))][(_0x5788('0x5e'))]('Plugin\x20not\x20found');}return _0xc9d453[_0x5788('0x52')](_0x1e35fc,util[_0x5788('0x56')]('%s.zip',path[_0x5788('0x58')](_0x1604cc[_0x5788('0x5')])),function(_0x232070){if(_0x232070){throw new db['Sequelize']['Error'](_0x5788('0x67'));}fs[_0x5788('0x68')](_0x1e35fc);logger[_0x5788('0x69')](_0x5788('0x6a'));logger[_0x5788('0x69')](_0x5788('0x6b'));});});}return null;})[_0x5788('0x4b')](handleError(_0xc9d453,null));};exports[_0x5788('0x6c')]=function(_0x4da716,_0x19d679,_0x70342){var _0x20ea87=path[_0x5788('0x58')](_0x4da716[_0x5788('0x6d')][_0x5788('0x6e')],path[_0x5788('0x6f')](_0x4da716[_0x5788('0x6d')][_0x5788('0x6e')]));var _0x4e39ad=path['join'](config[_0x5788('0x54')],_0x5788('0x55'),_0x4da716[_0x5788('0x6d')]['filename']);var _0x4bcb05=path[_0x5788('0x53')](config['root'],_0x5788('0x55'),_0x20ea87);logger[_0x5788('0x69')](_0x5788('0x70'),_0x4e39ad);logger[_0x5788('0x69')](_0x5788('0x71'),_0x4bcb05);try{fs['chmodSync'](_0x4e39ad,parseInt(_0x5788('0x72'),0x8));extract(_0x4e39ad,{'dir':_0x4bcb05},function(_0x1b6d5c){if(_0x1b6d5c){logger[_0x5788('0x2f')](_0x1b6d5c);handleError(_0x1b6d5c,!![]);};var _0x439a63=fs['readdirSync'](_0x4bcb05);if(_0x439a63[_0x5788('0x3c')]>0x1){removeReferences(_0x4e39ad,_0x4bcb05);logger[_0x5788('0x2f')]('Invalid\x20plugin\x20structure');return _0x70342(new Error(_0x5788('0x73')));}var _0x3ca266=fs[_0x5788('0x74')](path[_0x5788('0x53')](_0x4bcb05,_0x439a63[0x0]));if(_0x3ca266[_0x5788('0x75')]()){removeReferences(_0x4e39ad,_0x4bcb05);logger[_0x5788('0x2f')]('Invalid\x20plugin\x20structure');return _0x70342(new Error(_0x5788('0x73')));}if(_0x3ca266[_0x5788('0x76')]()){var _0x25a1d0=fs[_0x5788('0x77')](path[_0x5788('0x53')](_0x4bcb05,_0x439a63[0x0]));if(_0x25a1d0['length']===0x0){removeReferences(_0x4e39ad,_0x4bcb05);logger[_0x5788('0x2f')](_0x5788('0x73'));return _0x70342(new Error('Invalid\x20plugin\x20structure'));}var _0x118167=_0x25a1d0[_0x5788('0x78')](function(_0x5e780e){return _0x5e780e===_0x5788('0x79');});if(!_0x118167){return _0x70342(new Error(_0x5788('0x7a')));}var _0x32a1aa=fs[_0x5788('0x7b')](path[_0x5788('0x53')](_0x4bcb05,_0x439a63[0x0],'manifest.json'));var _0x4196b7=JSON[_0x5788('0x7c')](_0x32a1aa);if('undefined'==typeof _0x4196b7[_0x5788('0x31')]){return _0x70342(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x4196b7['type']){return _0x70342(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x4196b7['version']){return _0x70342(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x4196b7[_0x5788('0x7d')]){return _0x70342(new Error(_0x5788('0x7e')));}if(_0x4196b7[_0x5788('0x35')]===_0x5788('0x7f')){if(_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')]){return _0x70342(new Error(_0x5788('0x81')));}if(_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x82')]&&_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')]['agent']){return _0x70342(new Error(_0x5788('0x83')));}}else if(_0x4196b7[_0x5788('0x35')]===_0x5788('0x84')){if(_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x85')]){return _0x70342(new Error(_0x5788('0x86')));}if(_0x5788('0x24')==typeof _0x4196b7['parameters'][_0x5788('0x87')]){return _0x70342(new Error(_0x5788('0x88')));}}else{return _0x70342(new Error(_0x5788('0x89')));}var _0x2ecd32=_0x4196b7[_0x5788('0x31')];var _0x5c8f88=_0x4196b7[_0x5788('0x8a')];var _0xbe7431=_0x4196b7[_0x5788('0x35')];var _0x1f038d=_0x4196b7[_0x5788('0x8b')]?_0x4196b7['sidebar']:_0x5788('0x8c');var _0xc791b1=_0x4196b7['icon']?_0x4196b7['icon']:_0x5788('0x8d');var _0x2df0e1='';var _0x140209='';var _0x33b43d='';var _0x129901='';var _0x540594=_0x4196b7[_0x5788('0x8e')];if(_0xbe7431===_0x5788('0x7f')){if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')]['views'][_0x5788('0x82')]){var _0xd42680=_0x4196b7['parameters'][_0x5788('0x80')][_0x5788('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0xd42680)){_0x2df0e1=path['join'](_0x5788('0x8f'),_0x20ea87,_0x439a63[0x0],_0xd42680);}else{_0x2df0e1=_0xd42680;}}else{logger[_0x5788('0x69')](_0x5788('0x90'));}if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')]['views'][_0x5788('0x91')]){var _0x467317=_0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x5788('0x92')](_0x467317)){_0x140209=path['join'](_0x5788('0x8f'),_0x20ea87,_0x439a63[0x0],_0x467317);}else{_0x140209=_0x467317;}}else{logger[_0x5788('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xbe7431===_0x5788('0x84')){_0x33b43d=_0x4196b7['parameters']['scriptName'];_0x129901=_0x4196b7[_0x5788('0x7d')][_0x5788('0x87')];if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')]){if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x82')]){var _0xd42680=_0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x5788('0x92')](_0xd42680)){_0x2df0e1=path[_0x5788('0x53')]('plugins',_0x20ea87,_0x439a63[0x0],_0xd42680);}else{_0x2df0e1=_0xd42680;}}if(_0x5788('0x24')!=typeof _0x4196b7['parameters']['views'][_0x5788('0x91')]){var _0x467317=_0x4196b7['parameters']['views'][_0x5788('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x5788('0x92')](_0x467317)){_0x140209=path[_0x5788('0x53')](_0x5788('0x8f'),_0x20ea87,_0x439a63[0x0],_0x467317);}else{_0x140209=_0x467317;}}}}var _0x1cf6b4={'name':_0x2ecd32,'description':_0x5c8f88,'path':path[_0x5788('0x53')](_0x20ea87,_0x439a63[0x0]),'type':_0xbe7431,'sidebar':_0x1f038d,'icon':_0xc791b1,'adminUrl':_0x2df0e1,'agentUrl':_0x140209,'scriptName':_0x33b43d,'scriptPath':_0x129901,'version':_0x540594};removeReferences(_0x4e39ad,null);return db[_0x5788('0x48')][_0x5788('0x93')](_0x1cf6b4)['then'](function(_0x103907){var _0x54d233={'role':_0x4da716[_0x5788('0x94')]['role'],'userProfileId':_0x4da716['body'][_0x5788('0x95')]};if(!_0x54d233)throw new Error(_0x5788('0x96'));if(_0x54d233['role']===_0x5788('0x97')){var _0x54d897=_0x103907[_0x5788('0x2b')]({'plain':!![]});return db[_0x5788('0x98')][_0x5788('0x51')]({'where':{'name':_0x5788('0x2c'),'userProfileId':_0x54d233['userProfileId']},'raw':!![]})[_0x5788('0x2e')](function(_0x2074c6){if(_0x2074c6&&_0x2074c6[_0x5788('0x99')]===0x0){return db[_0x5788('0x2d')]['create']({'name':_0x54d897[_0x5788('0x31')],'resourceId':_0x54d897['id'],'type':_0x2074c6['name'],'sectionId':_0x2074c6['id']},{})[_0x5788('0x2e')](function(){return _0x103907;});}else{return _0x103907;}})[_0x5788('0x4b')](function(_0x5748fc){logger[_0x5788('0x2f')](_0x5788('0x9a'),_0x5748fc);throw _0x5748fc;});}return _0x103907;})[_0x5788('0x2e')](respondWithResult(_0x19d679,null))[_0x5788('0x4b')](handleError(_0x19d679,null));}});}catch(_0x543a40){_0x19d679[_0x5788('0x21')](0x1f4)[_0x5788('0x32')](_0x543a40);}};function removeReferences(_0x1d49ce,_0x19e942){try{if(_0x1d49ce){fs[_0x5788('0x68')](_0x1d49ce);logger[_0x5788('0x69')]('Zip\x20archive\x20removed');}if(_0x19e942){rimraf(_0x19e942,function(){});logger[_0x5788('0x69')](_0x5788('0x9b'));}}catch(_0x36be2d){logger[_0x5788('0x2f')](_0x36be2d);}}exports[_0x5788('0x29')]=function(_0x5249aa,_0x209832,_0x3ea70b){return db[_0x5788('0x48')]['find']({'where':{'id':_0x5249aa[_0x5788('0x4d')]['id']}})[_0x5788('0x2e')](handleEntityNotFound(_0x209832,null))[_0x5788('0x2e')](saveUpdates(_0x5249aa['body'],null))[_0x5788('0x2e')](respondWithResult(_0x209832,null))[_0x5788('0x4b')](handleError(_0x209832,null));};exports['delete']=function(_0x3a633e,_0x83adf4,_0x4ce43a){return db[_0x5788('0x48')][_0x5788('0x51')]({'where':{'id':_0x3a633e[_0x5788('0x4d')]['id']}})[_0x5788('0x2e')](function(_0x39116d){if(_0x39116d){return _0x39116d['destroy']();}})['then'](function(_0x586420){rimraf(path[_0x5788('0x53')](config[_0x5788('0x54')],_0x5788('0x55'),path['dirname'](_0x586420[_0x5788('0x5')])),function(){});return _0x586420;})[_0x5788('0x2e')](handleEntityNotFound(_0x83adf4,null))[_0x5788('0x2e')](respondWithStatusCode(_0x83adf4,null))[_0x5788('0x4b')](handleError(_0x83adf4,null));};exports[_0x5788('0x9c')]=function(_0x211c1f,_0x429a9f,_0x3677c1){return BPromise['resolve']()[_0x5788('0x2e')](function(){if(!_0x211c1f[_0x5788('0x36')][_0x5788('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x211c1f[_0x5788('0x36')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2816d6=_0x211c1f[_0x5788('0x36')][_0x5788('0x9d')]?_0x211c1f[_0x5788('0x36')]['hostname']+':'+_0x211c1f[_0x5788('0x36')][_0x5788('0x9e')]:_0x5788('0x9f')+_0x211c1f['query'][_0x5788('0x9e')];var _0x1a18a5=_0x211c1f[_0x5788('0x36')][_0x5788('0x22')]?_0x211c1f['query']['json']:!![];var _0x4dc6f9=_0x211c1f[_0x5788('0x36')][_0x5788('0xa0')]?_0x211c1f[_0x5788('0x36')][_0x5788('0xa0')]:null;var _0x49a93e={'method':_0x211c1f['method'],'uri':util[_0x5788('0x56')]('%s%s',_0x2816d6,_0x211c1f[_0x5788('0x36')][_0x5788('0x5')]),'json':_0x1a18a5,'resolveWithFullResponse':!![],'encoding':_0x4dc6f9,'qs':_0x211c1f['query']};if(_0x211c1f['headers']){_0x49a93e['headers']=_0x211c1f[_0x5788('0xa1')];if(_0x49a93e[_0x5788('0xa1')][_0x5788('0xa2')]){delete _0x49a93e[_0x5788('0xa1')][_0x5788('0xa2')];}}if(_0x49a93e[_0x5788('0xa1')][_0x5788('0xa3')]){delete _0x49a93e[_0x5788('0xa1')][_0x5788('0xa3')];}return rp(_0x49a93e);})[_0x5788('0x2e')](function(_0x251b9e){if(_0x251b9e){_0x429a9f[_0x5788('0xa4')](_0x251b9e[_0x5788('0xa1')]);logger[_0x5788('0x69')](_0x251b9e['body']);if(_[_0x5788('0xa5')](_0x211c1f[_0x5788('0x36')]['path'],_0x5788('0x52'))&&_0x251b9e['statusCode']==0x1f4){return _0x429a9f[_0x5788('0x1f')](_0x251b9e[_0x5788('0xa6')]);}else{return _0x429a9f[_0x5788('0x21')](_0x251b9e[_0x5788('0xa6')])['send'](_0x251b9e[_0x5788('0x94')]);}}else{return _0x429a9f[_0x5788('0x1f')](0xc8);}})[_0x5788('0x4b')](handleError(_0x429a9f,null));};exports['webhookPost']=function(_0x40a5b0,_0x5117c2,_0x4bc918){return BPromise[_0x5788('0xa7')]()[_0x5788('0x2e')](function(){if(!_0x40a5b0['query'][_0x5788('0x5')]){throw new Error(_0x5788('0xa8'));}if(!_0x40a5b0[_0x5788('0x36')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1ea8f9=_0x40a5b0[_0x5788('0x36')][_0x5788('0x9d')]?_0x40a5b0['query']['hostname']+':'+_0x40a5b0['query'][_0x5788('0x9e')]:_0x5788('0x9f')+_0x40a5b0[_0x5788('0x36')][_0x5788('0x9e')];var _0x120c0e=_0x40a5b0[_0x5788('0x36')][_0x5788('0x22')]?_0x40a5b0[_0x5788('0x36')][_0x5788('0x22')]:!![];var _0x56726a=_0x40a5b0['query'][_0x5788('0xa0')]?_0x40a5b0[_0x5788('0x36')][_0x5788('0xa0')]:null;var _0x107027={'method':_0x40a5b0['method'],'uri':util['format'](_0x5788('0xa9'),_0x1ea8f9,_0x40a5b0[_0x5788('0x36')][_0x5788('0x5')]),'json':_0x120c0e,'resolveWithFullResponse':!![],'encoding':_0x56726a,'body':_0x40a5b0[_0x5788('0x94')]};if(_0x40a5b0[_0x5788('0xa1')]){_0x107027[_0x5788('0xa1')]=_0x40a5b0[_0x5788('0xa1')];if(_0x107027['headers']['content-length']){delete _0x107027['headers'][_0x5788('0xa2')];}}if(_0x107027[_0x5788('0xa1')][_0x5788('0xa3')]){delete _0x107027[_0x5788('0xa1')][_0x5788('0xa3')];}return rp(_0x107027);})['then'](function(_0x19b243){if(_0x19b243){_0x5117c2[_0x5788('0xa4')](_0x19b243[_0x5788('0xa1')]);logger[_0x5788('0x69')](_0x19b243[_0x5788('0x94')]);return _0x5117c2[_0x5788('0x21')](_0x19b243[_0x5788('0xa6')])[_0x5788('0x32')](_0x19b243[_0x5788('0x94')]);}else{return _0x5117c2['sendStatus'](0xc8);}})['catch'](handleError(_0x5117c2,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b55aa40..cd4d746 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc21c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4202fd,_0x397387){var _0x37fcac=function(_0x4771ad){while(--_0x4771ad){_0x4202fd['push'](_0x4202fd['shift']());}};_0x37fcac(++_0x397387);}(_0xc21c,0x166));var _0xcc21=function(_0x1ce0ab,_0x5c9a29){_0x1ce0ab=_0x1ce0ab-0x0;var _0x56a956=_0xc21c[_0x1ce0ab];return _0x56a956;};'use strict';var EventEmitter=require(_0xcc21('0x0'));var Plugin=require(_0xcc21('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xcc21('0x2')](0x0);var events={'afterCreate':_0xcc21('0x3'),'afterUpdate':_0xcc21('0x4'),'afterDestroy':_0xcc21('0x5')};function emitEvent(_0x4e17e8){return function(_0x3e29df,_0x31bf8b,_0x18866a){PluginEvents[_0xcc21('0x6')](_0x4e17e8+':'+_0x3e29df['id'],_0x3e29df);PluginEvents[_0xcc21('0x6')](_0x4e17e8,_0x3e29df);_0x18866a(null);};}for(var e in events){if(events[_0xcc21('0x7')](e)){var event=events[e];Plugin[_0xcc21('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xa6bb=['update','emit','hook','exports','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x43d3db,_0x192606){var _0x346f2e=function(_0x2b9381){while(--_0x2b9381){_0x43d3db['push'](_0x43d3db['shift']());}};_0x346f2e(++_0x192606);}(_0xa6bb,0x12c));var _0xba6b=function(_0x9a0883,_0x87325b){_0x9a0883=_0x9a0883-0x0;var _0x41c406=_0xa6bb[_0x9a0883];return _0x41c406;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xba6b('0x0'))['db'][_0xba6b('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xba6b('0x2')](0x0);var events={'afterCreate':_0xba6b('0x3'),'afterUpdate':_0xba6b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52e835){return function(_0x5d1f87,_0x17e34b,_0x25733d){PluginEvents[_0xba6b('0x5')](_0x52e835+':'+_0x5d1f87['id'],_0x5d1f87);PluginEvents['emit'](_0x52e835,_0x5d1f87);_0x25733d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xba6b('0x6')](e,emitEvent(event));}}module[_0xba6b('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 83bf88f..cc94cd1 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe126=['define','plugins','util','api','bluebird','request-promise','path','rimraf','./plugin.attributes','exports'];(function(_0x47e46b,_0x5f488e){var _0x2a2cc1=function(_0x5343d1){while(--_0x5343d1){_0x47e46b['push'](_0x47e46b['shift']());}};_0x2a2cc1(++_0x5f488e);}(_0xe126,0xf2));var _0x6e12=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xe126[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require('lodash');var util=require(_0x6e12('0x0'));var logger=require('../../config/logger')(_0x6e12('0x1'));var moment=require('moment');var BPromise=require(_0x6e12('0x2'));var rp=require(_0x6e12('0x3'));var fs=require('fs');var path=require(_0x6e12('0x4'));var rimraf=require(_0x6e12('0x5'));var config=require('../../config/environment');var attributes=require(_0x6e12('0x6'));module[_0x6e12('0x7')]=function(_0x332df2,_0x1695d5){return _0x332df2[_0x6e12('0x8')]('Plugin',attributes,{'tableName':_0x6e12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb82=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x17f050,_0x2cb1db){var _0xd28b90=function(_0x2fa453){while(--_0x2fa453){_0x17f050['push'](_0x17f050['shift']());}};_0xd28b90(++_0x2cb1db);}(_0xfb82,0x17f));var _0x2fb8=function(_0x170502,_0x4e3a90){_0x170502=_0x170502-0x0;var _0x343be3=_0xfb82[_0x170502];return _0x343be3;};'use strict';var _=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var logger=require(_0x2fb8('0x2'))('api');var moment=require(_0x2fb8('0x3'));var BPromise=require(_0x2fb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fb8('0x5'));var rimraf=require(_0x2fb8('0x6'));var config=require(_0x2fb8('0x7'));var attributes=require(_0x2fb8('0x8'));module[_0x2fb8('0x9')]=function(_0xe9a5b5,_0x3e6900){return _0xe9a5b5[_0x2fb8('0xa')](_0x2fb8('0xb'),attributes,{'tableName':_0x2fb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index ed9f7cd..3041d0e 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1186=['error','code','message','CreatePlugin','Plugin','create','body','options','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x1186,0x75));var _0x6118=function(_0x52ba12,_0x6fd9cb){_0x52ba12=_0x52ba12-0x0;var _0x1b80ad=_0x1186[_0x52ba12];return _0x1b80ad;};'use strict';var _=require(_0x6118('0x0'));var util=require(_0x6118('0x1'));var moment=require('moment');var BPromise=require(_0x6118('0x2'));var rs=require(_0x6118('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6118('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6118('0x5'))('rpc');var config=require(_0x6118('0x6'));var jayson=require(_0x6118('0x7'));var client=jayson[_0x6118('0x8')][_0x6118('0x9')]({'port':0x232a});config['redis']=_[_0x6118('0xa')](config[_0x6118('0xb')],{'host':_0x6118('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6118('0xd'))[_0x6118('0xe')](socket);function respondWithRpcPromise(_0x30e232,_0x327eda,_0xb99464){return new BPromise(function(_0x4c78d0,_0x25ddd3){return client['request'](_0x30e232,_0xb99464)['then'](function(_0x584dec){logger[_0x6118('0xf')](_0x6118('0x10'),_0x327eda,_0x6118('0x11'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x327eda,'request\x20sent',JSON['stringify'](_0x584dec));if(_0x584dec[_0x6118('0x12')]){if(_0x584dec['error'][_0x6118('0x13')]===0x1f4){logger['error'](_0x6118('0x10'),_0x327eda,_0x584dec['error'][_0x6118('0x14')]);return _0x25ddd3(_0x584dec[_0x6118('0x12')][_0x6118('0x14')]);}logger[_0x6118('0x12')](_0x6118('0x10'),_0x327eda,_0x584dec[_0x6118('0x12')][_0x6118('0x14')]);return _0x4c78d0(_0x584dec[_0x6118('0x12')][_0x6118('0x14')]);}else{logger[_0x6118('0xf')](_0x6118('0x10'),_0x327eda,'request\x20sent');_0x4c78d0(_0x584dec['result'][_0x6118('0x14')]);}})['catch'](function(_0x442d8b){logger['error'](_0x6118('0x10'),_0x327eda,_0x442d8b);_0x25ddd3(_0x442d8b);});});}exports[_0x6118('0x15')]=function(_0x446396){var _0x788491=this;return new Promise(function(_0x3ec3fa,_0x18a2c0){return db[_0x6118('0x16')][_0x6118('0x17')](_0x446396[_0x6118('0x18')],{'raw':_0x446396[_0x6118('0x19')]?_0x446396[_0x6118('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33fc31){logger['info']('CreatePlugin',_0x446396);logger['debug'](_0x6118('0x15'),_0x446396,JSON['stringify'](_0x33fc31));_0x3ec3fa(_0x33fc31);})[_0x6118('0x1a')](function(_0x44bc41){logger[_0x6118('0x12')](_0x6118('0x15'),_0x44bc41['message'],_0x446396);_0x18a2c0(_0x788491[_0x6118('0x12')](0x1f4,_0x44bc41[_0x6118('0x14')]));});});}; \ No newline at end of file +var _0x0536=['stringify','error','message','Plugin,\x20%s,\x20%s','info','catch','CreatePlugin','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./plugin.socket','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x1be3e0,_0x41e201){var _0x5855b1=function(_0x1b12ce){while(--_0x1b12ce){_0x1be3e0['push'](_0x1be3e0['shift']());}};_0x5855b1(++_0x41e201);}(_0x0536,0xc6));var _0x6053=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0536[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6053('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6053('0x1'));var rs=require(_0x6053('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6053('0x3'))['db'];var utils=require(_0x6053('0x4'));var logger=require('../../config/logger')(_0x6053('0x5'));var config=require(_0x6053('0x6'));var jayson=require(_0x6053('0x7'));var client=jayson[_0x6053('0x8')][_0x6053('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6053('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6053('0xb'))(new Redis(config[_0x6053('0xa')]));require(_0x6053('0xc'))['register'](socket);function respondWithRpcPromise(_0x3c30e9,_0xb51f0,_0x22d74c){return new BPromise(function(_0x10a6e5,_0x22f512){return client[_0x6053('0xd')](_0x3c30e9,_0x22d74c)[_0x6053('0xe')](function(_0x44a1ec){logger['info']('Plugin,\x20%s,\x20%s',_0xb51f0,_0x6053('0xf'));logger[_0x6053('0x10')](_0x6053('0x11'),_0xb51f0,_0x6053('0xf'),JSON[_0x6053('0x12')](_0x44a1ec));if(_0x44a1ec[_0x6053('0x13')]){if(_0x44a1ec[_0x6053('0x13')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xb51f0,_0x44a1ec['error']['message']);return _0x22f512(_0x44a1ec[_0x6053('0x13')][_0x6053('0x14')]);}logger[_0x6053('0x13')](_0x6053('0x15'),_0xb51f0,_0x44a1ec['error'][_0x6053('0x14')]);return _0x10a6e5(_0x44a1ec[_0x6053('0x13')][_0x6053('0x14')]);}else{logger[_0x6053('0x16')]('Plugin,\x20%s,\x20%s',_0xb51f0,_0x6053('0xf'));_0x10a6e5(_0x44a1ec['result'][_0x6053('0x14')]);}})[_0x6053('0x17')](function(_0x3a3716){logger['error']('Plugin,\x20%s,\x20%s',_0xb51f0,_0x3a3716);_0x22f512(_0x3a3716);});});}exports[_0x6053('0x18')]=function(_0x1bd093){var _0x5afa01=this;return new Promise(function(_0x2d9099,_0x3e720c){return db['Plugin']['create'](_0x1bd093['body'],{'raw':_0x1bd093[_0x6053('0x19')]?_0x1bd093[_0x6053('0x19')][_0x6053('0x1a')]===undefined?!![]:![]:!![]})[_0x6053('0xe')](function(_0x357c79){logger[_0x6053('0x16')](_0x6053('0x18'),_0x1bd093);logger[_0x6053('0x10')](_0x6053('0x18'),_0x1bd093,JSON[_0x6053('0x12')](_0x357c79));_0x2d9099(_0x357c79);})['catch'](function(_0xc7fd39){logger[_0x6053('0x13')](_0x6053('0x18'),_0xc7fd39['message'],_0x1bd093);_0x3e720c(_0x5afa01[_0x6053('0x13')](0x1f4,_0xc7fd39[_0x6053('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 6633e55..e88c872 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7038=['register','length','plugin:','save','remove','update','emit','removeListener'];(function(_0x64bec,_0x37225c){var _0x46b9c6=function(_0x4cd9af){while(--_0x4cd9af){_0x64bec['push'](_0x64bec['shift']());}};_0x46b9c6(++_0x37225c);}(_0x7038,0xdb));var _0x8703=function(_0x92c7c4,_0x7ef533){_0x92c7c4=_0x92c7c4-0x0;var _0x598004=_0x7038[_0x92c7c4];return _0x598004;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x8703('0x0'),_0x8703('0x1'),_0x8703('0x2')];function createListener(_0x3e7562,_0x571672){return function(_0x286777){_0x571672[_0x8703('0x3')](_0x3e7562,_0x286777);};}function removeListener(_0x1137e7,_0x42318a){return function(){PluginEvents[_0x8703('0x4')](_0x1137e7,_0x42318a);};}exports[_0x8703('0x5')]=function(_0x5c6db0){for(var _0x48cfe5=0x0,_0x45a2e9=events[_0x8703('0x6')];_0x48cfe5<_0x45a2e9;_0x48cfe5++){var _0x71cacc=events[_0x48cfe5];var _0x352d38=createListener(_0x8703('0x7')+_0x71cacc,_0x5c6db0);PluginEvents['on'](_0x71cacc,_0x352d38);}}; \ No newline at end of file +var _0xd982=['removeListener','register','length','plugin:','save','remove','update','emit'];(function(_0x25b125,_0x3c33a0){var _0x141b47=function(_0x2eeea0){while(--_0x2eeea0){_0x25b125['push'](_0x25b125['shift']());}};_0x141b47(++_0x3c33a0);}(_0xd982,0x18c));var _0x2d98=function(_0x2eb0ba,_0x174584){_0x2eb0ba=_0x2eb0ba-0x0;var _0x109c0d=_0xd982[_0x2eb0ba];return _0x109c0d;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2d98('0x0'),_0x2d98('0x1'),_0x2d98('0x2')];function createListener(_0x5c3975,_0x3aefe4){return function(_0x1d79aa){_0x3aefe4[_0x2d98('0x3')](_0x5c3975,_0x1d79aa);};}function removeListener(_0x2b6808,_0x563d41){return function(){PluginEvents[_0x2d98('0x4')](_0x2b6808,_0x563d41);};}exports[_0x2d98('0x5')]=function(_0x2bf04b){for(var _0x427a41=0x0,_0x3b4a2f=events[_0x2d98('0x6')];_0x427a41<_0x3b4a2f;_0x427a41++){var _0x20d256=events[_0x427a41];var _0x2562e0=createListener(_0x2d98('0x7')+_0x20d256,_0x2bf04b);PluginEvents['on'](_0x20d256,_0x2562e0);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f211916..a6f6c2b 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x4646a9,_0x518653){var _0x4afce6=function(_0x58d397){while(--_0x58d397){_0x4646a9['push'](_0x4646a9['shift']());}};_0x4afce6(++_0x518653);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x39aba5,_0x55de65){var _0x4a08df=function(_0x5df3e6){while(--_0x5df3e6){_0x39aba5['push'](_0x39aba5['shift']());}};_0x4a08df(++_0x55de65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 5f504e7..4f93f8d 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x4c7994,_0x1b27fb){var _0x5db2db=function(_0x58e678){while(--_0x58e678){_0x4c7994['push'](_0x4c7994['shift']());}};_0x5db2db(++_0x1b27fb);}(_0x2750,0x13b));var _0x0275=function(_0x4a9076,_0x4758a6){_0x4a9076=_0x4a9076-0x0;var _0x3d4d64=_0x2750[_0x4a9076];return _0x3d4d64;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xf72b=['hasOwnProperty','Unknown\x20status','destroy','params','delete','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','json','stack','name','npm\x20install','info','index','then','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xf72b,0x1d9));var _0xbf72=function(_0x12e1bb,_0xae6d9f){_0x12e1bb=_0x12e1bb-0x0;var _0x336b5f=_0xf72b[_0x12e1bb];return _0x336b5f;};'use strict';var _=require(_0xbf72('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbf72('0x1'))('api');var path=require(_0xbf72('0x2'));var exec=require(_0xbf72('0x3'))['exec'];var BPromise=require(_0xbf72('0x4'));function handleEntityNotFound(_0x550a9e,_0x37afc8){return function(_0x3d3a6f){if(!_0x3d3a6f){_0x550a9e[_0xbf72('0x5')](0x194);;}return _0x3d3a6f;};}function respondWithResult(_0x2b8440,_0x5ee060){_0x5ee060=_0x5ee060||0xc8;return function(_0x41c11d){if(_0x41c11d){return _0x2b8440[_0xbf72('0x6')](_0x5ee060)[_0xbf72('0x7')](_0x41c11d);}return null;};}function handleError(_0xd0402c,_0xdd6177){_0xdd6177=_0xdd6177||0x1f4;return function(_0x1b6d38){logger['error'](_0x1b6d38[_0xbf72('0x8')]);if(_0x1b6d38['name']){delete _0x1b6d38[_0xbf72('0x9')];}_0xd0402c[_0xbf72('0x6')](_0xdd6177)['send'](_0x1b6d38);};}function execChildProcess(){return new BPromise(function(_0xaec095,_0x1c3453){exec(_0xbf72('0xa'),function(_0x145acb,_0x2957c5,_0x44ce73){logger[_0xbf72('0xb')](_0x2957c5);logger[_0xbf72('0xb')](_0x44ce73);if(_0x145acb){logger['error'](_0x145acb);return _0x1c3453(_0x145acb);}return _0xaec095(_0x2957c5);});});}exports[_0xbf72('0xc')]=function(_0x227a35,_0x57cccf){return pm2['list']()[_0xbf72('0xd')](function(_0x4f4fa5){if(_0x4f4fa5){var _0x5625b3=_['reject'](_0x4f4fa5,function(_0x32a0a5){return _0x32a0a5[_0xbf72('0x9')]===_0xbf72('0xe')||_0x32a0a5[_0xbf72('0x9')]===_0xbf72('0xf');});return{'rows':_0x5625b3,'count':_0x5625b3[_0xbf72('0x10')]};}return null;})['then'](respondWithResult(_0x57cccf,null))[_0xbf72('0x11')](handleError(_0x57cccf,null));};exports[_0xbf72('0x12')]=function(_0x2a8609,_0x3d4dea){return pm2[_0xbf72('0x13')](_0x2a8609['params']['id'])['then'](respondWithResult(_0x3d4dea,null))[_0xbf72('0xd')](handleEntityNotFound(_0x3d4dea,null))[_0xbf72('0x11')](handleError(_0x3d4dea,null));};exports[_0xbf72('0x14')]=function(_0x2584d9,_0x27e58e){if(_0x2584d9[_0xbf72('0x15')][_0xbf72('0x9')]&&_0x2584d9['body'][_0xbf72('0x16')]){var _0x42a193=path[_0xbf72('0x17')](__dirname,_0xbf72('0x18'),_0x2584d9[_0xbf72('0x15')]['script']);var _0x3cd181=process[_0xbf72('0x19')]();process['chdir'](path[_0xbf72('0x1a')](_0x42a193));return execChildProcess()[_0xbf72('0xd')](function(_0x267c41){process['chdir'](_0x3cd181);return pm2[_0xbf72('0x1b')]({'name':_0x2584d9[_0xbf72('0x15')][_0xbf72('0x9')],'script':_0x42a193});})[_0xbf72('0xd')](function(_0x4f4dc0){pm2[_0xbf72('0x1c')]();return _0x4f4dc0[0x0];})[_0xbf72('0xd')](respondWithResult(_0x27e58e,0xc9))[_0xbf72('0x11')](handleError(_0x27e58e,null));}else{return _0x27e58e['status'](0x1f4)[_0xbf72('0x1d')]({'message':_0xbf72('0x1e')});}};exports[_0xbf72('0x1f')]=function(_0x1a2f55,_0x15d60d){if(_0x1a2f55[_0xbf72('0x15')]['id']){delete _0x1a2f55[_0xbf72('0x15')]['id'];}var _0x25ecdf={'online':_0xbf72('0x20'),'stopped':_0xbf72('0x21')};if(_0x25ecdf[_0xbf72('0x22')](_0x1a2f55[_0xbf72('0x15')][_0xbf72('0x6')])){return pm2[_0x25ecdf[_0x1a2f55[_0xbf72('0x15')][_0xbf72('0x6')]]](_0x1a2f55['params']['id'])[_0xbf72('0xd')](respondWithResult(_0x15d60d,0xc8))[_0xbf72('0x11')](handleError(_0x15d60d,null));}else{return _0x15d60d[_0xbf72('0x6')](0x1f4)[_0xbf72('0x1d')]({'message':_0xbf72('0x23')});}};exports[_0xbf72('0x24')]=function(_0x35ecdc,_0x209b2b){if(_0x35ecdc[_0xbf72('0x15')]['id']){delete _0x35ecdc[_0xbf72('0x15')]['id'];}if(_0x35ecdc[_0xbf72('0x25')]['id']){return pm2[_0xbf72('0x26')](_0x35ecdc[_0xbf72('0x25')]['id'])[_0xbf72('0xd')](function(_0x4e2472){pm2[_0xbf72('0x1c')]();return _0x4e2472[0x0];})[_0xbf72('0xd')](respondWithResult(_0x209b2b,null))[_0xbf72('0x11')](handleError(_0x209b2b,null));}else{return _0x209b2b['status'](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 594ff80..d675de3 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff7d=['isAuthenticated','exports','express','Router','./realtime.controller','get','/agents','getAgents','/queues'];(function(_0x5172f9,_0x2121ed){var _0x2430bc=function(_0x2c0efd){while(--_0x2c0efd){_0x5172f9['push'](_0x5172f9['shift']());}};_0x2430bc(++_0x2121ed);}(_0xff7d,0x77));var _0xdff7=function(_0x586903,_0x1b8b3e){_0x586903=_0x586903-0x0;var _0x3e1acd=_0xff7d[_0x586903];return _0x3e1acd;};'use strict';var express=require(_0xdff7('0x0'));var router=express[_0xdff7('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdff7('0x2'));router[_0xdff7('0x3')](_0xdff7('0x4'),auth['isAuthenticated'](),controller[_0xdff7('0x5')]);router['get'](_0xdff7('0x6'),auth[_0xdff7('0x7')](),controller['getQueues']);module[_0xdff7('0x8')]=router; \ No newline at end of file +var _0x9075=['/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','get'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x9075,0x13c));var _0x5907=function(_0x53263b,_0x299c08){_0x53263b=_0x53263b-0x0;var _0x3fd94b=_0x9075[_0x53263b];return _0x3fd94b;};'use strict';var express=require(_0x5907('0x0'));var router=express[_0x5907('0x1')]();var auth=require(_0x5907('0x2'));var controller=require('./realtime.controller');router[_0x5907('0x3')](_0x5907('0x4'),auth[_0x5907('0x5')](),controller[_0x5907('0x6')]);router[_0x5907('0x3')](_0x5907('0x7'),auth[_0x5907('0x5')](),controller[_0x5907('0x8')]);module[_0x5907('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 94330aa..8be4ced 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebe7=['isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','online','raw','length','sequelize','literal','FIELD(id,','forEach','*pause','push','Pause','where','merge','user','userProfileId','agent','UserProfile','getResources','findAndCountAll','Status','pick','catch','resolve','startCase','Queue','dialMethod','join','voice','outbound','QueueCampaigns','Queues','filter','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','then','channel'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0xebe7,0x11d));var _0x7ebe=function(_0x68ca65,_0x3392ec){_0x68ca65=_0x68ca65-0x0;var _0x24f842=_0xebe7[_0x68ca65];return _0x24f842;};'use strict';var _=require('lodash');var util=require(_0x7ebe('0x0'));var rta=require(_0x7ebe('0x1'));var rtq=require(_0x7ebe('0x2'));var qs=require(_0x7ebe('0x3'));var utils=require(_0x7ebe('0x4'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x7ebe('0x5'))[_0x7ebe('0x6')];var APIHandleError=require(_0x7ebe('0x5'))[_0x7ebe('0x7')];function respondWithFilteredResult(_0x11ed7e,_0x5cca2b){return function(_0x214037){if(_0x214037){var _0x3bb40e=typeof _0x5cca2b[_0x7ebe('0x8')]===_0x7ebe('0x9')&&typeof _0x5cca2b[_0x7ebe('0xa')]===_0x7ebe('0x9');var _0x32bde9=_0x214037[_0x7ebe('0xb')];var _0x1abf39=_0x3bb40e?0x0:_0x5cca2b[_0x7ebe('0x8')];var _0x22e96e=_0x3bb40e?_0x214037[_0x7ebe('0xb')]:_0x5cca2b['offset']+_0x5cca2b[_0x7ebe('0xa')];var _0x340ebf;if(_0x22e96e>=_0x32bde9){_0x22e96e=_0x32bde9;_0x340ebf=0xc8;}else{_0x340ebf=0xce;}_0x11ed7e[_0x7ebe('0xc')](_0x340ebf);return _0x11ed7e[_0x7ebe('0xd')](_0x7ebe('0xe'),_0x1abf39+'-'+_0x22e96e+'/'+_0x32bde9)[_0x7ebe('0xf')](_0x214037);}return null;};}exports['getAgents']=function(_0x208dda,_0x15438c){var _0x165db4={'count':0x0,'rows':[]};var _0x17cb47={};var _0x148d34;var _0x9ddf6d=utils[_0x7ebe('0x10')]();var _0x4e168f;var _0x432ad7;var _0x7f96d9=_0x208dda[_0x7ebe('0x11')]['globalQueueFilter'];var _0x46a808=_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x12')];var _0x41af9f=_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x13')];var _0x232c3d=_0x46a808===_0x7ebe('0x14')||_0x46a808==='*pause'?!![]:![];var _0x440b75=[];var _0x1c6e9a;var _0x51c372;Promise['resolve']()[_0x7ebe('0x15')](function(){if(_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x16')]){if(!utils[_0x7ebe('0x17')](_0x208dda['query']['channel'])){throw new APIBadRequestError(util[_0x7ebe('0x18')](_0x7ebe('0x19'),_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x16')]));}_0x148d34=_0x208dda['query'][_0x7ebe('0x16')][_0x7ebe('0x1a')]();}if(!_0x208dda[_0x7ebe('0x11')]['sort']||!_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x1b')][_0x7ebe('0x1c')](_0x7ebe('0x1d'))){_0x208dda[_0x7ebe('0x11')]['sort']=rta[_0x7ebe('0x1e')](_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x1b')]);return;}var _0x47f759=rta['getUpdatedSortOptions'](_0x208dda['query'][_0x7ebe('0x1b')]);_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x1b')]=_0x47f759[_0x7ebe('0x1f')]['join'](',');_0x1c6e9a=_0x47f759[_0x7ebe('0x20')];})['then'](function(){if(!_0x7f96d9){return[];}return rta[_0x7ebe('0x21')](_0x7f96d9,_0x148d34);})[_0x7ebe('0x15')](function(_0x22f067){_0x440b75=_0x22f067;return rta['getRealtimeAgents']();})[_0x7ebe('0x15')](function(_0x13d8db){_0x432ad7=_0x13d8db[_0x7ebe('0x22')];if((!_0x46a808||_0x232c3d)&&!_0x1c6e9a){return _0x440b75;}if(_0x1c6e9a&&!_0x46a808){return rta[_0x7ebe('0x23')](_0x432ad7,_0x440b75,_0x1c6e9a);}else{return rta[_0x7ebe('0x24')](_0x432ad7,_0x440b75,_0x46a808);}})['then'](function(_0x5e9ef8){_0x440b75=_0x5e9ef8;var _0x29feec=![];if(_0x440b75['length']===0x0){if(_0x7f96d9||_0x46a808){_0x29feec=!![];}if(_0x232c3d){_0x29feec=![];}}if(_0x29feec){return _0x165db4;}var _0xd9d775=_[_0x7ebe('0x25')](db[_0x7ebe('0x26')][_0x7ebe('0x27')],function(_0x49e646){return{'name':_0x49e646[_0x7ebe('0x28')],'type':_0x49e646[_0x7ebe('0x29')][_0x7ebe('0x2a')]};});_0x208dda[_0x7ebe('0x11')][_0x7ebe('0x2b')]='agent';_0x208dda['query'][_0x7ebe('0x2c')]=!![];_0x17cb47=qs['getOptions'](_0xd9d775,_0x208dda);_0x17cb47[_0x7ebe('0x2d')]=!![];var _0x333da1=[];if(_0x440b75[_0x7ebe('0x2e')]>0x0){_0x333da1['push']({'id':{'$in':_0x440b75}});if(_0x1c6e9a&&!_0x46a808){_0x51c372=[db[_0x7ebe('0x2f')][_0x7ebe('0x30')](_0x7ebe('0x31')+_0x440b75+')')];_0x17cb47[_0x7ebe('0x20')]=_0x51c372;}}if(_0x232c3d){_0x9ddf6d[_0x7ebe('0x32')](function(_0x17cea8){var _0x556c1f=!![];if(_0x46a808===_0x7ebe('0x33')&&_0x148d34!==_0x17cea8){_0x556c1f=![];}_0x333da1[_0x7ebe('0x34')]({[_0x17cea8+_0x7ebe('0x35')]:_0x556c1f});});if(_0x41af9f){_0x333da1[_0x7ebe('0x34')]({'pauseType':_0x41af9f});}}else if(_0x46a808){_0x9ddf6d[_0x7ebe('0x32')](function(_0x4376f7){_0x333da1[_0x7ebe('0x34')]({[_0x4376f7+_0x7ebe('0x35')]:![]});});}_0x17cb47[_0x7ebe('0x36')]=_[_0x7ebe('0x37')](_0x17cb47[_0x7ebe('0x36')],{'$and':_0x333da1});if(_0x208dda[_0x7ebe('0x38')]['role']===_0x7ebe('0x38')){var _0x27d156={'params':{'id':_0x208dda['user'][_0x7ebe('0x39')]},'query':{'section':'Agents','role':_0x7ebe('0x3a'),'online':!![],'raw':!![],'ids':_0x440b75,'customSorting':_0x51c372}};if(_0x232c3d){_0x27d156['query']['extraQueryConditions']=_0x333da1;}_0x27d156[_0x7ebe('0x11')]=Object['assign'](_0x27d156[_0x7ebe('0x11')],_0x208dda['query']);delete _0x27d156[_0x7ebe('0x11')]['id'];return db[_0x7ebe('0x3b')][_0x7ebe('0x3c')](_0x27d156);}return db[_0x7ebe('0x26')][_0x7ebe('0x3d')](_0x17cb47);})[_0x7ebe('0x15')](function(_0x481ad6){_0x165db4[_0x7ebe('0xb')]=_0x481ad6[_0x7ebe('0xb')];_0x4e168f=_0x481ad6['rows'];return _0x4e168f[_0x7ebe('0x25')](function(_0x58fa7f){var _0x515323=_['find'](_0x432ad7,['id',_0x58fa7f['id']]);if(_0x515323){var _0x9fb231=rta['filterAgentAttributes'](_0x515323);_[_0x7ebe('0x37')](_0x58fa7f,_0x9fb231);}_0x58fa7f['globalStatus']=rta['getAgentStatus'](_0x58fa7f);if(_0x58fa7f[_0x7ebe('0x1d')]['includes'](_0x7ebe('0x14'))){_0x9ddf6d[_0x7ebe('0x32')](function(_0x4c8009){if(_0x58fa7f[_0x4c8009+_0x7ebe('0x35')]){_0x58fa7f[_0x4c8009+_0x7ebe('0x3e')]=_0x7ebe('0x14');}});}return _0x58fa7f;});})[_0x7ebe('0x15')](function(_0x1d4bbf){if(!_0x1c6e9a||_0x51c372){return _0x1d4bbf;}return rta['sortAgentsByStatus'](_0x1d4bbf,_0x1c6e9a);})[_0x7ebe('0x15')](function(_0x43c64a){var _0x189c6e=null;if(_0x208dda['query'][_0x7ebe('0x1f')]){var _0x9b7bda=_0x208dda['query'][_0x7ebe('0x1f')]['split'](',');_0x189c6e=_0x43c64a[_0x7ebe('0x25')](function(_0x5f367b){return _[_0x7ebe('0x3f')](_0x5f367b,_0x9b7bda);});}_0x165db4['rows']=_0x189c6e||_0x43c64a;return _0x165db4;})[_0x7ebe('0x15')](respondWithFilteredResult(_0x15438c,_0x17cb47))[_0x7ebe('0x40')](APIHandleError(_0x15438c));};exports['getQueues']=function(_0xb8dbf7,_0x2d6fa8){var _0x2ecf80={'count':0x0,'rows':[]};var _0x59e69d={};var _0x322221;var _0x1b69fa;var _0x4a5e85;Promise[_0x7ebe('0x41')]()['then'](function(){if(_0xb8dbf7['query'][_0x7ebe('0x16')]){if(!utils[_0x7ebe('0x17')](_0xb8dbf7['query'][_0x7ebe('0x16')])){throw new APIBadRequestError(util[_0x7ebe('0x18')](_0x7ebe('0x19'),_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x16')]));}_0x322221=_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x16')][_0x7ebe('0x1a')]();}var _0x14bf4e=_[_0x7ebe('0x42')](_0x322221)+_0x7ebe('0x43');var _0x4e7e1f=_[_0x7ebe('0x25')](db[_0x14bf4e][_0x7ebe('0x27')],function(_0xff1a3a){return{'name':_0xff1a3a['fieldName'],'type':_0xff1a3a[_0x7ebe('0x29')][_0x7ebe('0x2a')]};});if(!_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x1f')]){var _0x402f6d=['id','name'];if(_0x322221==='voice'){_0x402f6d['push']('type');if(_0xb8dbf7['query'][_0x7ebe('0x29')]==='outbound'){_0x402f6d[_0x7ebe('0x34')](['dialActive',_0x7ebe('0x44')]);}}_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x1f')]=_0x402f6d[_0x7ebe('0x45')](',');}_0x59e69d=qs['getOptions'](_0x4e7e1f,_0xb8dbf7);if(_0xb8dbf7[_0x7ebe('0x38')][_0x7ebe('0x2b')]===_0x7ebe('0x38')){var _0x531254={'params':{'id':_0xb8dbf7['user'][_0x7ebe('0x39')]},'query':{'section':_0x322221===_0x7ebe('0x46')&&_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x29')]===_0x7ebe('0x47')?_0x7ebe('0x48'):_[_0x7ebe('0x42')](_0x322221)+_0x7ebe('0x49'),'type':_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x29')],'nolimit':!![],'sort':'name','filter':_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x4a')]}};return db[_0x7ebe('0x3b')][_0x7ebe('0x3c')](_0x531254);}return db[_0x14bf4e]['findAndCountAll'](_0x59e69d);})['then'](function(_0x5f15e1){_0x2ecf80[_0x7ebe('0xb')]=_0x5f15e1[_0x7ebe('0xb')];_0x1b69fa=_0x5f15e1['rows'];return rtq[_0x7ebe('0x4b')](_0xb8dbf7,_0x322221);})[_0x7ebe('0x15')](function(_0x311525){_0x4a5e85=_0x311525[_0x7ebe('0x22')];return rtq[_0x7ebe('0x4c')](_0x1b69fa,_0x4a5e85,_0x322221,_0xb8dbf7[_0x7ebe('0x11')][_0x7ebe('0x29')]);})[_0x7ebe('0x15')](function(_0x390b39){_0x2ecf80[_0x7ebe('0x22')]=_0x390b39;return _0x2ecf80;})[_0x7ebe('0x15')](respondWithFilteredResult(_0x2d6fa8,_0x59e69d))['catch'](APIHandleError(_0x2d6fa8));}; \ No newline at end of file +var _0x950d=['role','agent','online','raw','literal','FIELD(id,','forEach','push','Pause','where','user','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','getAgentStatus','sortAgentsByStatus','fields','catch','getQueues','startCase','Queue','key','outbound','dialActive','dialMethod','voice','QueueCampaigns','Queues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','Content-Range','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','rows','length','map','User','rawAttributes','fieldName','type'];(function(_0x296f1c,_0x31f7c7){var _0x12056f=function(_0x38c7b0){while(--_0x38c7b0){_0x296f1c['push'](_0x296f1c['shift']());}};_0x12056f(++_0x31f7c7);}(_0x950d,0x151));var _0xd950=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x950d[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xd950('0x0'));var util=require(_0xd950('0x1'));var rta=require(_0xd950('0x2'));var rtq=require(_0xd950('0x3'));var qs=require(_0xd950('0x4'));var utils=require(_0xd950('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xd950('0x6'))[_0xd950('0x7')];var APIHandleError=require(_0xd950('0x6'))[_0xd950('0x8')];function respondWithFilteredResult(_0x1acf91,_0x1bd99f){return function(_0x37c70c){if(_0x37c70c){var _0x47ee5b=typeof _0x1bd99f[_0xd950('0x9')]===_0xd950('0xa')&&typeof _0x1bd99f[_0xd950('0xb')]==='undefined';var _0x46a7b1=_0x37c70c[_0xd950('0xc')];var _0x5789a7=_0x47ee5b?0x0:_0x1bd99f[_0xd950('0x9')];var _0x17a1f9=_0x47ee5b?_0x37c70c['count']:_0x1bd99f['offset']+_0x1bd99f[_0xd950('0xb')];var _0x221b34;if(_0x17a1f9>=_0x46a7b1){_0x17a1f9=_0x46a7b1;_0x221b34=0xc8;}else{_0x221b34=0xce;}_0x1acf91[_0xd950('0xd')](_0x221b34);return _0x1acf91['set'](_0xd950('0xe'),_0x5789a7+'-'+_0x17a1f9+'/'+_0x46a7b1)[_0xd950('0xf')](_0x37c70c);}return null;};}exports['getAgents']=function(_0x4c4634,_0x2f5309){var _0x18d367={'count':0x0,'rows':[]};var _0x464bdf={};var _0x26c6a3;var _0x3a4ba5=utils[_0xd950('0x10')]();var _0x308873;var _0x40cc12;var _0x4a8efa=_0x4c4634[_0xd950('0x11')][_0xd950('0x12')];var _0x20af5b=_0x4c4634[_0xd950('0x11')][_0xd950('0x13')];var _0x42e4a1=_0x4c4634['query'][_0xd950('0x14')];var _0xcafa25=_0x20af5b===_0xd950('0x15')||_0x20af5b==='*pause'?!![]:![];var _0x26fa68=[];var _0x1f5906;var _0x83abb7;Promise[_0xd950('0x16')]()[_0xd950('0x17')](function(){if(_0x4c4634[_0xd950('0x11')][_0xd950('0x18')]){if(!utils[_0xd950('0x19')](_0x4c4634[_0xd950('0x11')][_0xd950('0x18')])){throw new APIBadRequestError(util[_0xd950('0x1a')](_0xd950('0x1b'),_0x4c4634[_0xd950('0x11')]['channel']));}_0x26c6a3=_0x4c4634[_0xd950('0x11')][_0xd950('0x18')][_0xd950('0x1c')]();}if(!_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]||!_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]['includes'](_0xd950('0x1e'))){_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]=rta[_0xd950('0x1f')](_0x4c4634['query'][_0xd950('0x1d')]);return;}var _0x4ad17c=rta[_0xd950('0x20')](_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]);_0x4c4634[_0xd950('0x11')]['sort']=_0x4ad17c['fields'][_0xd950('0x21')](',');_0x1f5906=_0x4ad17c[_0xd950('0x22')];})[_0xd950('0x17')](function(){if(!_0x4a8efa){return[];}return rta[_0xd950('0x23')](_0x4a8efa,_0x26c6a3);})[_0xd950('0x17')](function(_0x105856){_0x26fa68=_0x105856;return rta['getRealtimeAgents']();})[_0xd950('0x17')](function(_0x125045){_0x40cc12=_0x125045[_0xd950('0x24')];if((!_0x20af5b||_0xcafa25)&&!_0x1f5906){return _0x26fa68;}if(_0x1f5906&&!_0x20af5b){return rta['getSortedAgentsIdsByStatus'](_0x40cc12,_0x26fa68,_0x1f5906);}else{return rta['getAgentIdsByStatus'](_0x40cc12,_0x26fa68,_0x20af5b);}})['then'](function(_0x3093d9){_0x26fa68=_0x3093d9;var _0x1551d2=![];if(_0x26fa68[_0xd950('0x25')]===0x0){if(_0x4a8efa||_0x20af5b){_0x1551d2=!![];}if(_0xcafa25){_0x1551d2=![];}}if(_0x1551d2){return _0x18d367;}var _0x2e4899=_[_0xd950('0x26')](db[_0xd950('0x27')][_0xd950('0x28')],function(_0x1e8bf3){return{'name':_0x1e8bf3[_0xd950('0x29')],'type':_0x1e8bf3[_0xd950('0x2a')]['key']};});_0x4c4634['query'][_0xd950('0x2b')]=_0xd950('0x2c');_0x4c4634[_0xd950('0x11')][_0xd950('0x2d')]=!![];_0x464bdf=qs['getOptions'](_0x2e4899,_0x4c4634);_0x464bdf[_0xd950('0x2e')]=!![];var _0x5e860f=[];if(_0x26fa68[_0xd950('0x25')]>0x0){_0x5e860f['push']({'id':{'$in':_0x26fa68}});if(_0x1f5906&&!_0x20af5b){_0x83abb7=[db['sequelize'][_0xd950('0x2f')](_0xd950('0x30')+_0x26fa68+')')];_0x464bdf['order']=_0x83abb7;}}if(_0xcafa25){_0x3a4ba5[_0xd950('0x31')](function(_0xea3f3a){var _0x24a69f=!![];if(_0x20af5b==='*pause'&&_0x26c6a3!==_0xea3f3a){_0x24a69f=![];}_0x5e860f[_0xd950('0x32')]({[_0xea3f3a+_0xd950('0x33')]:_0x24a69f});});if(_0x42e4a1){_0x5e860f[_0xd950('0x32')]({'pauseType':_0x42e4a1});}}else if(_0x20af5b){_0x3a4ba5['forEach'](function(_0xa21154){_0x5e860f[_0xd950('0x32')]({[_0xa21154+_0xd950('0x33')]:![]});});}_0x464bdf['where']=_['merge'](_0x464bdf[_0xd950('0x34')],{'$and':_0x5e860f});if(_0x4c4634[_0xd950('0x35')][_0xd950('0x2b')]===_0xd950('0x35')){var _0x286044={'params':{'id':_0x4c4634[_0xd950('0x35')][_0xd950('0x36')]},'query':{'section':'Agents','role':_0xd950('0x2c'),'online':!![],'raw':!![],'ids':_0x26fa68,'customSorting':_0x83abb7}};if(_0xcafa25){_0x286044[_0xd950('0x11')][_0xd950('0x37')]=_0x5e860f;}_0x286044['query']=Object[_0xd950('0x38')](_0x286044[_0xd950('0x11')],_0x4c4634[_0xd950('0x11')]);delete _0x286044[_0xd950('0x11')]['id'];return db[_0xd950('0x39')][_0xd950('0x3a')](_0x286044);}return db[_0xd950('0x27')][_0xd950('0x3b')](_0x464bdf);})[_0xd950('0x17')](function(_0x4406e7){_0x18d367[_0xd950('0xc')]=_0x4406e7[_0xd950('0xc')];_0x308873=_0x4406e7['rows'];return _0x308873[_0xd950('0x26')](function(_0x2c836d){var _0x4fba45=_[_0xd950('0x3c')](_0x40cc12,['id',_0x2c836d['id']]);if(_0x4fba45){var _0x245be3=rta[_0xd950('0x3d')](_0x4fba45);_['merge'](_0x2c836d,_0x245be3);}_0x2c836d[_0xd950('0x1e')]=rta[_0xd950('0x3e')](_0x2c836d);if(_0x2c836d[_0xd950('0x1e')]['includes'](_0xd950('0x15'))){_0x3a4ba5[_0xd950('0x31')](function(_0x333fb9){if(_0x2c836d[_0x333fb9+_0xd950('0x33')]){_0x2c836d[_0x333fb9+'Status']=_0xd950('0x15');}});}return _0x2c836d;});})[_0xd950('0x17')](function(_0xde763){if(!_0x1f5906||_0x83abb7){return _0xde763;}return rta[_0xd950('0x3f')](_0xde763,_0x1f5906);})[_0xd950('0x17')](function(_0x2e5518){var _0x1219f3=null;if(_0x4c4634[_0xd950('0x11')][_0xd950('0x40')]){var _0x26f357=_0x4c4634[_0xd950('0x11')]['fields']['split'](',');_0x1219f3=_0x2e5518[_0xd950('0x26')](function(_0x54e69a){return _['pick'](_0x54e69a,_0x26f357);});}_0x18d367[_0xd950('0x24')]=_0x1219f3||_0x2e5518;return _0x18d367;})[_0xd950('0x17')](respondWithFilteredResult(_0x2f5309,_0x464bdf))[_0xd950('0x41')](APIHandleError(_0x2f5309));};exports[_0xd950('0x42')]=function(_0x2c6ee0,_0x108380){var _0xbf97c0={'count':0x0,'rows':[]};var _0x525ad4={};var _0x1fa849;var _0x157a3a;var _0x1d401e;Promise[_0xd950('0x16')]()[_0xd950('0x17')](function(){if(_0x2c6ee0[_0xd950('0x11')]['channel']){if(!utils[_0xd950('0x19')](_0x2c6ee0[_0xd950('0x11')][_0xd950('0x18')])){throw new APIBadRequestError(util[_0xd950('0x1a')](_0xd950('0x1b'),_0x2c6ee0[_0xd950('0x11')][_0xd950('0x18')]));}_0x1fa849=_0x2c6ee0[_0xd950('0x11')][_0xd950('0x18')][_0xd950('0x1c')]();}var _0x585055=_[_0xd950('0x43')](_0x1fa849)+_0xd950('0x44');var _0x67a901=_['map'](db[_0x585055][_0xd950('0x28')],function(_0x38dcaf){return{'name':_0x38dcaf[_0xd950('0x29')],'type':_0x38dcaf[_0xd950('0x2a')][_0xd950('0x45')]};});if(!_0x2c6ee0[_0xd950('0x11')][_0xd950('0x40')]){var _0x332299=['id','name'];if(_0x1fa849==='voice'){_0x332299[_0xd950('0x32')](_0xd950('0x2a'));if(_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')]===_0xd950('0x46')){_0x332299[_0xd950('0x32')]([_0xd950('0x47'),_0xd950('0x48')]);}}_0x2c6ee0[_0xd950('0x11')][_0xd950('0x40')]=_0x332299['join'](',');}_0x525ad4=qs['getOptions'](_0x67a901,_0x2c6ee0);if(_0x2c6ee0[_0xd950('0x35')][_0xd950('0x2b')]==='user'){var _0x588acf={'params':{'id':_0x2c6ee0[_0xd950('0x35')]['userProfileId']},'query':{'section':_0x1fa849===_0xd950('0x49')&&_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')]===_0xd950('0x46')?_0xd950('0x4a'):_[_0xd950('0x43')](_0x1fa849)+_0xd950('0x4b'),'type':_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')],'nolimit':!![],'sort':'name','filter':_0x2c6ee0[_0xd950('0x11')]['filter']}};return db[_0xd950('0x39')][_0xd950('0x3a')](_0x588acf);}return db[_0x585055][_0xd950('0x3b')](_0x525ad4);})[_0xd950('0x17')](function(_0x590d19){_0xbf97c0[_0xd950('0xc')]=_0x590d19['count'];_0x157a3a=_0x590d19['rows'];return rtq['getRealtimeQueues'](_0x2c6ee0,_0x1fa849);})[_0xd950('0x17')](function(_0x38db4e){_0x1d401e=_0x38db4e[_0xd950('0x24')];return rtq['initializeQueues'](_0x157a3a,_0x1d401e,_0x1fa849,_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')]);})['then'](function(_0xcf448d){_0xbf97c0[_0xd950('0x24')]=_0xcf448d;return _0xbf97c0;})[_0xd950('0x17')](respondWithFilteredResult(_0x108380,_0x525ad4))[_0xd950('0x41')](APIHandleError(_0x108380));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 44ff6ba..7797f92 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5ecd9f,_0x5451fa){var _0x2e6980=function(_0x1d51b8){while(--_0x1d51b8){_0x5ecd9f['push'](_0x5ecd9f['shift']());}};_0x2e6980(++_0x5451fa);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 87bfd64..1ac7f80 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5398=['STRING','DATE','exports','INTEGER'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5398,0xe2));var _0x8539=function(_0x2b4f71,_0x5a1fe3){_0x2b4f71=_0x2b4f71-0x0;var _0x40fc89=_0x5398[_0x2b4f71];return _0x40fc89;};'use strict';var Sequelize=require('sequelize');module[_0x8539('0x0')]={'state':{'type':Sequelize[_0x8539('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x8539('0x2')]},'scheduledat':{'type':Sequelize[_0x8539('0x3')]},'uniqueid':{'type':Sequelize[_0x8539('0x2')]},'starttime':{'type':Sequelize[_0x8539('0x3')]},'responsetime':{'type':Sequelize[_0x8539('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x8539('0x2')]},'membername':{'type':Sequelize[_0x8539('0x2')]}}; \ No newline at end of file +var _0x9d5c=['sequelize','INTEGER','STRING','DATE'];(function(_0x3acfd2,_0x33d99c){var _0x4d0a18=function(_0x240a8a){while(--_0x240a8a){_0x3acfd2['push'](_0x3acfd2['shift']());}};_0x4d0a18(++_0x33d99c);}(_0x9d5c,0x98));var _0xc9d5=function(_0x1e34ca,_0x1d543f){_0x1e34ca=_0x1e34ca-0x0;var _0xcb4f8f=_0x9d5c[_0x1e34ca];return _0xcb4f8f;};'use strict';var Sequelize=require(_0xc9d5('0x0'));module['exports']={'state':{'type':Sequelize[_0xc9d5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc9d5('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xc9d5('0x2')]},'starttime':{'type':Sequelize[_0xc9d5('0x3')]},'responsetime':{'type':Sequelize[_0xc9d5('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc9d5('0x2')]},'campaigntype':{'type':Sequelize[_0xc9d5('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3a91829..337384d 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39e4=['rimraf','./reportAgentPreview.attributes','exports','report_agent_preview','lodash','util','moment','bluebird','request-promise','path'];(function(_0x458c31,_0x5d4ba0){var _0x3937be=function(_0x5539a9){while(--_0x5539a9){_0x458c31['push'](_0x458c31['shift']());}};_0x3937be(++_0x5d4ba0);}(_0x39e4,0x19e));var _0x439e=function(_0x502365,_0x8736e2){_0x502365=_0x502365-0x0;var _0x1f536f=_0x39e4[_0x502365];return _0x1f536f;};'use strict';var _=require(_0x439e('0x0'));var util=require(_0x439e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x439e('0x2'));var BPromise=require(_0x439e('0x3'));var rp=require(_0x439e('0x4'));var fs=require('fs');var path=require(_0x439e('0x5'));var rimraf=require(_0x439e('0x6'));var config=require('../../config/environment');var attributes=require(_0x439e('0x7'));module[_0x439e('0x8')]=function(_0x3bb950,_0x1c8510){return _0x3bb950['define']('ReportAgentPreview',attributes,{'tableName':_0x439e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3b2=['bluebird','request-promise','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','moment'];(function(_0x39876b,_0x146f93){var _0x40476d=function(_0x2f212d){while(--_0x2f212d){_0x39876b['push'](_0x39876b['shift']());}};_0x40476d(++_0x146f93);}(_0xc3b2,0x115));var _0x2c3b=function(_0x187856,_0xd8bb22){_0x187856=_0x187856-0x0;var _0x46fe6a=_0xc3b2[_0x187856];return _0x46fe6a;};'use strict';var _=require(_0x2c3b('0x0'));var util=require('util');var logger=require(_0x2c3b('0x1'))('api');var moment=require(_0x2c3b('0x2'));var BPromise=require(_0x2c3b('0x3'));var rp=require(_0x2c3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2c3b('0x5'));module[_0x2c3b('0x6')]=function(_0x348119,_0x463a70){return _0x348119[_0x2c3b('0x7')](_0x2c3b('0x8'),attributes,{'tableName':_0x2c3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index c583f1f..89b96a2 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06fc=['options','CreateReportAgentPreview','debug','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','create'];(function(_0x520820,_0x38cbec){var _0x28b01d=function(_0x71c8bc){while(--_0x71c8bc){_0x520820['push'](_0x520820['shift']());}};_0x28b01d(++_0x38cbec);}(_0x06fc,0x14d));var _0xc06f=function(_0x2a7996,_0x135a9e){_0x2a7996=_0x2a7996-0x0;var _0xe8b2c9=_0x06fc[_0x2a7996];return _0xe8b2c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc06f('0x0'));var BPromise=require('bluebird');var rs=require(_0xc06f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc06f('0x2'))['db'];var utils=require(_0xc06f('0x3'));var logger=require(_0xc06f('0x4'))(_0xc06f('0x5'));var config=require('../../config/environment');var jayson=require(_0xc06f('0x6'));var client=jayson[_0xc06f('0x7')][_0xc06f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20eb4b,_0x460d86,_0x436ee0){return new BPromise(function(_0x38dbba,_0x35f59d){return client['request'](_0x20eb4b,_0x436ee0)[_0xc06f('0x9')](function(_0x540ff3){logger[_0xc06f('0xa')](_0xc06f('0xb'),_0x460d86,_0xc06f('0xc'));logger['debug'](_0xc06f('0xd'),_0x460d86,_0xc06f('0xc'),JSON[_0xc06f('0xe')](_0x540ff3));if(_0x540ff3['error']){if(_0x540ff3[_0xc06f('0xf')]['code']===0x1f4){logger['error'](_0xc06f('0xb'),_0x460d86,_0x540ff3[_0xc06f('0xf')][_0xc06f('0x10')]);return _0x35f59d(_0x540ff3[_0xc06f('0xf')][_0xc06f('0x10')]);}logger[_0xc06f('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x460d86,_0x540ff3[_0xc06f('0xf')][_0xc06f('0x10')]);return _0x38dbba(_0x540ff3[_0xc06f('0xf')][_0xc06f('0x10')]);}else{logger[_0xc06f('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x460d86,_0xc06f('0xc'));_0x38dbba(_0x540ff3['result'][_0xc06f('0x10')]);}})[_0xc06f('0x11')](function(_0x2dc338){logger[_0xc06f('0xf')](_0xc06f('0xb'),_0x460d86,_0x2dc338);_0x35f59d(_0x2dc338);});});}exports['CreateReportAgentPreview']=function(_0x2cead8){var _0x4f81dd=this;return new Promise(function(_0x231234,_0x344afe){return db['ReportAgentPreview'][_0xc06f('0x12')](_0x2cead8['body'],{'raw':_0x2cead8[_0xc06f('0x13')]?_0x2cead8[_0xc06f('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xc06f('0x9')](function(_0x2df054){logger[_0xc06f('0xa')](_0xc06f('0x14'),_0x2cead8);logger[_0xc06f('0x15')](_0xc06f('0x14'),_0x2cead8,JSON[_0xc06f('0xe')](_0x2df054));_0x231234(_0x2df054);})[_0xc06f('0x11')](function(_0x207e61){logger[_0xc06f('0xf')](_0xc06f('0x14'),_0x207e61[_0xc06f('0x10')],_0x2cead8);_0x344afe(_0x4f81dd[_0xc06f('0xf')](0x1f4,_0x207e61[_0xc06f('0x10')]));});});}; \ No newline at end of file +var _0xd960=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xd960,0x86));var _0x0d96=function(_0x51df2b,_0xe67866){_0x51df2b=_0x51df2b-0x0;var _0xbf533a=_0xd960[_0x51df2b];return _0xbf533a;};'use strict';var _=require('lodash');var util=require(_0x0d96('0x0'));var moment=require(_0x0d96('0x1'));var BPromise=require(_0x0d96('0x2'));var rs=require(_0x0d96('0x3'));var fs=require('fs');var Redis=require(_0x0d96('0x4'));var db=require(_0x0d96('0x5'))['db'];var utils=require(_0x0d96('0x6'));var logger=require('../../config/logger')(_0x0d96('0x7'));var config=require(_0x0d96('0x8'));var jayson=require(_0x0d96('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ec473,_0x3d2aa7,_0x19d67d){return new BPromise(function(_0x5da00d,_0x3b02bc){return client[_0x0d96('0xa')](_0x4ec473,_0x19d67d)[_0x0d96('0xb')](function(_0x36861d){logger[_0x0d96('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x3d2aa7,_0x0d96('0xd'));logger[_0x0d96('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3d2aa7,_0x0d96('0xd'),JSON[_0x0d96('0xf')](_0x36861d));if(_0x36861d[_0x0d96('0x10')]){if(_0x36861d[_0x0d96('0x10')][_0x0d96('0x11')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3d2aa7,_0x36861d[_0x0d96('0x10')]['message']);return _0x3b02bc(_0x36861d[_0x0d96('0x10')][_0x0d96('0x12')]);}logger[_0x0d96('0x10')](_0x0d96('0x13'),_0x3d2aa7,_0x36861d['error']['message']);return _0x5da00d(_0x36861d['error'][_0x0d96('0x12')]);}else{logger[_0x0d96('0xc')](_0x0d96('0x13'),_0x3d2aa7,'request\x20sent');_0x5da00d(_0x36861d[_0x0d96('0x14')][_0x0d96('0x12')]);}})[_0x0d96('0x15')](function(_0x56519a){logger[_0x0d96('0x10')](_0x0d96('0x13'),_0x3d2aa7,_0x56519a);_0x3b02bc(_0x56519a);});});}exports[_0x0d96('0x16')]=function(_0x551923){var _0x50ec8a=this;return new Promise(function(_0x46f1b0,_0x4b11fa){return db[_0x0d96('0x17')][_0x0d96('0x18')](_0x551923[_0x0d96('0x19')],{'raw':_0x551923[_0x0d96('0x1a')]?_0x551923[_0x0d96('0x1a')][_0x0d96('0x1b')]===undefined?!![]:![]:!![]})[_0x0d96('0xb')](function(_0x577709){logger[_0x0d96('0xc')](_0x0d96('0x16'),_0x551923);logger[_0x0d96('0xe')](_0x0d96('0x16'),_0x551923,JSON[_0x0d96('0xf')](_0x577709));_0x46f1b0(_0x577709);})['catch'](function(_0x459d59){logger[_0x0d96('0x10')](_0x0d96('0x16'),_0x459d59[_0x0d96('0x12')],_0x551923);_0x4b11fa(_0x50ec8a[_0x0d96('0x10')](0x1f4,_0x459d59[_0x0d96('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index db241ba..df2bdf0 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9771=['whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','post','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues'];(function(_0x5b333b,_0x4d1f41){var _0x2f81db=function(_0x30c121){while(--_0x30c121){_0x5b333b['push'](_0x5b333b['shift']());}};_0x2f81db(++_0x4d1f41);}(_0x9771,0x135));var _0x1977=function(_0x1f6ce6,_0x286fd4){_0x1f6ce6=_0x1f6ce6-0x0;var _0x2749f0=_0x9771[_0x1f6ce6];return _0x2749f0;};'use strict';var multer=require(_0x1977('0x0'));var util=require(_0x1977('0x1'));var path=require(_0x1977('0x2'));var express=require(_0x1977('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1977('0x4'));router[_0x1977('0x5')](_0x1977('0x6'),auth[_0x1977('0x7')](),controller[_0x1977('0x8')]);router['get'](_0x1977('0x9'),auth[_0x1977('0x7')](),controller[_0x1977('0xa')]);router[_0x1977('0x5')](_0x1977('0xb'),auth[_0x1977('0x7')](),controller[_0x1977('0xc')]);router[_0x1977('0x5')](_0x1977('0xd'),auth['isAuthenticated'](),controller[_0x1977('0xe')]);router[_0x1977('0x5')](_0x1977('0xf'),auth[_0x1977('0x7')](),controller[_0x1977('0x10')]);router[_0x1977('0x5')]('/mail/queues',auth[_0x1977('0x7')](),controller['mailQueues']);router[_0x1977('0x5')](_0x1977('0x11'),auth[_0x1977('0x7')](),controller[_0x1977('0x12')]);router[_0x1977('0x5')](_0x1977('0x13'),auth[_0x1977('0x7')](),controller['openchannelQueues']);router[_0x1977('0x5')](_0x1977('0x14'),auth[_0x1977('0x7')](),controller[_0x1977('0x15')]);router[_0x1977('0x5')](_0x1977('0x16'),auth[_0x1977('0x7')](),controller[_0x1977('0x17')]);router[_0x1977('0x5')](_0x1977('0x18'),auth[_0x1977('0x7')](),controller[_0x1977('0x19')]);router[_0x1977('0x5')](_0x1977('0x1a'),auth['isAuthenticated'](),controller[_0x1977('0x1b')]);router[_0x1977('0x5')](_0x1977('0x1c'),auth[_0x1977('0x7')](),controller[_0x1977('0x1d')]);router[_0x1977('0x5')](_0x1977('0x1e'),auth[_0x1977('0x7')](),controller[_0x1977('0x1f')]);router['get'](_0x1977('0x20'),auth[_0x1977('0x7')](),controller[_0x1977('0x21')]);router['get'](_0x1977('0x22'),auth['isAuthenticated'](),controller[_0x1977('0x23')]);router[_0x1977('0x5')](_0x1977('0x24'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x1977('0x25')](_0x1977('0x24'),auth[_0x1977('0x7')](),controller['updateVoiceQueue']);router[_0x1977('0x5')](_0x1977('0x26'),auth['isAuthenticated'](),controller[_0x1977('0x27')]);router['get'](_0x1977('0x28'),auth[_0x1977('0x7')](),controller[_0x1977('0x29')]);router[_0x1977('0x5')]('/agents',auth[_0x1977('0x7')](),controller[_0x1977('0x2a')]);router[_0x1977('0x25')](_0x1977('0x2b'),auth[_0x1977('0x7')](),controller[_0x1977('0x2c')]);router[_0x1977('0x5')](_0x1977('0x2d'),auth[_0x1977('0x7')](),controller[_0x1977('0x2e')]);router[_0x1977('0x5')]('/trunks',auth[_0x1977('0x7')](),controller[_0x1977('0x2f')]);router[_0x1977('0x5')](_0x1977('0x30'),auth[_0x1977('0x7')](),controller['campaigns']);router[_0x1977('0x5')](_0x1977('0x31'),auth[_0x1977('0x7')](),controller[_0x1977('0x32')]);router['get'](_0x1977('0x33'),auth[_0x1977('0x7')](),controller[_0x1977('0x34')]);router[_0x1977('0x5')]('/mail/queues/waitinginteractions',auth[_0x1977('0x7')](),controller[_0x1977('0x35')]);router['get'](_0x1977('0x36'),auth[_0x1977('0x7')](),controller[_0x1977('0x37')]);router[_0x1977('0x5')](_0x1977('0x38'),auth[_0x1977('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1977('0x5')]('/sms/queues/waitinginteractions',auth[_0x1977('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x1977('0x5')](_0x1977('0x39'),auth[_0x1977('0x7')](),controller[_0x1977('0x3a')]);router[_0x1977('0x5')](_0x1977('0x3b'),auth[_0x1977('0x7')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x1977('0x3c'),auth[_0x1977('0x7')](),controller[_0x1977('0x3d')](_0x1977('0x3e')));router[_0x1977('0x5')](_0x1977('0x3f'),auth[_0x1977('0x7')](),controller[_0x1977('0x40')]);router['post'](_0x1977('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x1977('0x42')));router[_0x1977('0x5')](_0x1977('0x43'),auth[_0x1977('0x7')](),controller[_0x1977('0x44')]);router[_0x1977('0x45')]('/fax/queues/:id/notify',auth[_0x1977('0x7')](),controller['queueNotify']('fax'));router[_0x1977('0x5')](_0x1977('0x46'),auth[_0x1977('0x7')](),controller[_0x1977('0x47')]);router[_0x1977('0x45')](_0x1977('0x48'),auth['isAuthenticated'](),controller[_0x1977('0x3d')](_0x1977('0x49')));router['get'](_0x1977('0x4a'),auth[_0x1977('0x7')](),controller[_0x1977('0x4b')]);router[_0x1977('0x45')](_0x1977('0x4c'),auth[_0x1977('0x7')](),controller[_0x1977('0x3d')]('sms'));router[_0x1977('0x45')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x1977('0x3d')]('whatsapp'));router[_0x1977('0x5')](_0x1977('0x4d'),auth[_0x1977('0x7')](),controller[_0x1977('0x4e')]);router[_0x1977('0x5')](_0x1977('0x4f'),auth['isAuthenticated'](),controller[_0x1977('0x50')]);router[_0x1977('0x45')]('/agents/:id/notify',auth[_0x1977('0x7')](),controller[_0x1977('0x51')]);module[_0x1977('0x52')]=router; \ No newline at end of file +var _0x3a15=['get','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','multer','path','Router','../../components/auth/service','./rpc.controller','isAuthenticated'];(function(_0x26d431,_0x365362){var _0x5c6375=function(_0x58028d){while(--_0x58028d){_0x26d431['push'](_0x26d431['shift']());}};_0x5c6375(++_0x365362);}(_0x3a15,0xde));var _0x53a1=function(_0x12a695,_0x56cd60){_0x12a695=_0x12a695-0x0;var _0x536966=_0x3a15[_0x12a695];return _0x536966;};'use strict';var multer=require(_0x53a1('0x0'));var util=require('util');var path=require(_0x53a1('0x1'));var express=require('express');var router=express[_0x53a1('0x2')]();var auth=require(_0x53a1('0x3'));var controller=require(_0x53a1('0x4'));router['get']('/voice/channels',auth[_0x53a1('0x5')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x53a1('0x5')](),controller['voiceChannelMixMonitor']);router[_0x53a1('0x6')](_0x53a1('0x7'),auth[_0x53a1('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0x53a1('0x6')](_0x53a1('0x8'),auth['isAuthenticated'](),controller['voiceQueues']);router['get'](_0x53a1('0x9'),auth[_0x53a1('0x5')](),controller[_0x53a1('0xa')]);router[_0x53a1('0x6')]('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x53a1('0x6')](_0x53a1('0xb'),auth['isAuthenticated'](),controller[_0x53a1('0xc')]);router[_0x53a1('0x6')](_0x53a1('0xd'),auth['isAuthenticated'](),controller[_0x53a1('0xe')]);router[_0x53a1('0x6')](_0x53a1('0xf'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x10')]);router[_0x53a1('0x6')](_0x53a1('0x11'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x12')]);router['get'](_0x53a1('0x13'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x14')]);router[_0x53a1('0x6')](_0x53a1('0x15'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x16')]);router['get'](_0x53a1('0x17'),auth['isAuthenticated'](),controller[_0x53a1('0x18')]);router[_0x53a1('0x6')](_0x53a1('0x19'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x1a')]);router[_0x53a1('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x53a1('0x5')](),controller[_0x53a1('0x1b')]);router['get'](_0x53a1('0x1c'),auth[_0x53a1('0x5')](),controller['voiceQueuesChannelRedirect']);router[_0x53a1('0x6')](_0x53a1('0x1d'),auth['isAuthenticated'](),controller[_0x53a1('0x1e')]);router[_0x53a1('0x1f')]('/voice/queues/:id',auth[_0x53a1('0x5')](),controller[_0x53a1('0x20')]);router[_0x53a1('0x6')](_0x53a1('0x21'),auth['isAuthenticated'](),controller[_0x53a1('0x22')]);router[_0x53a1('0x6')](_0x53a1('0x23'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x24')]);router[_0x53a1('0x6')]('/agents',auth[_0x53a1('0x5')](),controller[_0x53a1('0x25')]);router[_0x53a1('0x1f')](_0x53a1('0x26'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x27')]);router[_0x53a1('0x6')](_0x53a1('0x28'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x29')]);router[_0x53a1('0x6')](_0x53a1('0x2a'),auth['isAuthenticated'](),controller[_0x53a1('0x2b')]);router[_0x53a1('0x6')](_0x53a1('0x2c'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x2d')]);router[_0x53a1('0x6')](_0x53a1('0x2e'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x53a1('0x6')](_0x53a1('0x2f'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x30')]);router[_0x53a1('0x6')](_0x53a1('0x31'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x53a1('0x6')](_0x53a1('0x32'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x33')]);router[_0x53a1('0x6')](_0x53a1('0x34'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x35')]);router[_0x53a1('0x6')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x53a1('0x36')]);router[_0x53a1('0x6')](_0x53a1('0x37'),auth['isAuthenticated'](),controller[_0x53a1('0x38')]);router[_0x53a1('0x6')](_0x53a1('0x39'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x3a')]);router[_0x53a1('0x3b')]('/mail/queues/:id/notify',auth[_0x53a1('0x5')](),controller[_0x53a1('0x3c')](_0x53a1('0x3d')));router[_0x53a1('0x6')]('/mail/queues/:id',auth[_0x53a1('0x5')](),controller['showMailQueues']);router[_0x53a1('0x3b')](_0x53a1('0x3e'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x3c')](_0x53a1('0x3f')));router[_0x53a1('0x6')](_0x53a1('0x40'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x41')]);router['post'](_0x53a1('0x42'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x3c')](_0x53a1('0x43')));router[_0x53a1('0x6')]('/fax/queues/:id',auth[_0x53a1('0x5')](),controller[_0x53a1('0x44')]);router[_0x53a1('0x3b')](_0x53a1('0x45'),auth[_0x53a1('0x5')](),controller['queueNotify']('openchannel'));router[_0x53a1('0x6')](_0x53a1('0x46'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x47')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x53a1('0x3c')](_0x53a1('0x48')));router[_0x53a1('0x3b')](_0x53a1('0x49'),auth['isAuthenticated'](),controller[_0x53a1('0x3c')]('whatsapp'));router['get'](_0x53a1('0x4a'),auth['isAuthenticated'](),controller[_0x53a1('0x4b')]);router[_0x53a1('0x6')]('/whatsapp/queues/:id',auth[_0x53a1('0x5')](),controller['showWhatsappQueues']);router[_0x53a1('0x3b')]('/agents/:id/notify',auth[_0x53a1('0x5')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 001ba12..afcf611 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xac9d,0x14d));var _0xdac9=function(_0x38deb6,_0x587445){_0x38deb6=_0x38deb6-0x0;var _0x3cf12e=_0xac9d[_0x38deb6];return _0x3cf12e;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));}; \ No newline at end of file +var _0x2eb2=['map','value','indexOf','filter','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','update','queue','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','channel','InteractionId','Start','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','status','json','stack','name','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','format','SIP/%s','interface','agent','internal','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type'];(function(_0x512b48,_0xa3924f){var _0x278a76=function(_0x2360ec){while(--_0x2360ec){_0x512b48['push'](_0x512b48['shift']());}};_0x278a76(++_0xa3924f);}(_0x2eb2,0x19f));var _0x22eb=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x2eb2[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));var util=require(_0x22eb('0x2'));var db=require(_0x22eb('0x3'))['db'];var logger=require(_0x22eb('0x4'))(_0x22eb('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x22eb('0x6')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x22eb('0x7')]({'port':0x232b});var routingClient=jayson[_0x22eb('0x6')][_0x22eb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){var _0x419601=_0x396806?_0x396806:amiClient;return _0x419601[_0x22eb('0x8')](_0x2a9850,_0x4539d0)[_0x22eb('0x9')](function(_0x3008e0){if(_0x3008e0['error']){if(_0x3008e0[_0x22eb('0xa')]['code']===0x1f4){return _0x3375d6(_0x3008e0['error'][_0x22eb('0xb')]);}return _0x33ddef(_0x3008e0['error'][_0x22eb('0xb')]);}else{_0x33ddef(_0x3008e0[_0x22eb('0xc')]);}})['catch'](function(_0x5068ea){_0x3375d6(_0x5068ea);});});}function respondWithResult(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xc8;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0xd')](_0x189f05)[_0x22eb('0xe')](_0x128d43);}return _0x1f286c['sendStatus'](0x194);};}function handleError(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0x1f4;return function(_0x1f5089){logger['error'](_0x1f5089[_0x22eb('0xf')]);if(_0x1f5089[_0x22eb('0x10')]){delete _0x1f5089['name'];}_0x350ade['status'](_0x53f14e)['send'](_0x1f5089);};}function findById(_0x2ed8a7){return function(_0x5245fe){if(!_['isNil'](_0x2ed8a7)&&!_[_0x22eb('0x11')](_0x5245fe)&&!_['isNil'](_0x5245fe['rows'])){return _[_0x22eb('0x12')](_0x5245fe[_0x22eb('0x13')],function(_0x385bcb){return _0x385bcb['id']==_0x2ed8a7;});}return null;};}exports[_0x22eb('0x14')]=function(_0x3b0940,_0x4bc0a2){return respondWithRpcPromise(_0x22eb('0x15'),_0x3b0940[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4bc0a2,null))[_0x22eb('0x17')](handleError(_0x4bc0a2,null));};exports[_0x22eb('0x18')]=function(_0x517313,_0x2eb115){return respondWithRpcPromise(_0x22eb('0x19'),_[_0x22eb('0x1a')](_0x517313['query'],_0x517313['params']))[_0x22eb('0x9')](respondWithResult(_0x2eb115,null))[_0x22eb('0x17')](handleError(_0x2eb115,null));};exports[_0x22eb('0x1b')]=function(_0x44639a,_0x2d95f0){return respondWithRpcPromise(_0x22eb('0x1c'),_[_0x22eb('0x1a')](_0x44639a['query'],_0x44639a[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x2d95f0,null))[_0x22eb('0x17')](handleError(_0x2d95f0,null));};exports[_0x22eb('0x1e')]=function(_0x420d4f,_0x4da252){return respondWithRpcPromise(_0x22eb('0x1f'),_0x420d4f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4da252,null))['catch'](handleError(_0x4da252,null));};exports[_0x22eb('0x20')]=function(_0x259847,_0x4b409a){return respondWithRpcPromise(_0x22eb('0x1f'),_0x259847[_0x22eb('0x16')])[_0x22eb('0x9')](findById(_0x259847[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x4b409a,null))['catch'](handleError(_0x4b409a,null));};exports['updateVoiceQueue']=function(_0x2a950e,_0x25e5bc){return respondWithRpcPromise(_0x22eb('0x21'),_[_0x22eb('0x1a')](_0x2a950e[_0x22eb('0x22')],_0x2a950e[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x25e5bc,null))[_0x22eb('0x17')](handleError(_0x25e5bc,null));};exports[_0x22eb('0x23')]=function(_0x39cec1,_0x24e9dc){return respondWithRpcPromise(_0x22eb('0x24'),_['merge'](_0x39cec1[_0x22eb('0x16')],_0x39cec1['params']))[_0x22eb('0x9')](respondWithResult(_0x24e9dc,null))[_0x22eb('0x17')](handleError(_0x24e9dc,null));};exports[_0x22eb('0x25')]=function(_0x11199f,_0x351ed8){return respondWithRpcPromise(_0x22eb('0x26'),_0x11199f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x351ed8,null))[_0x22eb('0x17')](handleError(_0x351ed8,null));};exports[_0x22eb('0x27')]=function(_0x509bb7,_0x49259f){return respondWithRpcPromise(_0x22eb('0x28'),_['merge'](_0x509bb7['query'],_0x509bb7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x49259f,null))[_0x22eb('0x17')](handleError(_0x49259f,null));};exports[_0x22eb('0x29')]=function(_0x45c53e,_0x332e9a){return respondWithRpcPromise(_0x22eb('0x2a'),_[_0x22eb('0x1a')](_0x45c53e[_0x22eb('0x16')],_0x45c53e[_0x22eb('0x1d')]))['then'](respondWithResult(_0x332e9a,null))[_0x22eb('0x17')](handleError(_0x332e9a,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c43e7,_0x35a264){return respondWithRpcPromise(_0x22eb('0x2b'),_['merge'](_0x5c43e7[_0x22eb('0x16')],_0x5c43e7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x35a264,null))[_0x22eb('0x17')](handleError(_0x35a264,null));};exports[_0x22eb('0x2c')]=function(_0x574555,_0x25f140){return respondWithRpcPromise(_0x22eb('0x2d'),_0x574555['query'])[_0x22eb('0x9')](respondWithResult(_0x25f140,null))[_0x22eb('0x17')](handleError(_0x25f140,null));};exports[_0x22eb('0x2e')]=function(_0x2cc77c,_0x9353f1){return respondWithRpcPromise('OutboundChannels',_0x2cc77c['query'])[_0x22eb('0x9')](respondWithResult(_0x9353f1,null))[_0x22eb('0x17')](handleError(_0x9353f1,null));};exports['agents']=function(_0x595d76,_0x2e2a0c){var _0x46c6a1;return respondWithRpcPromise('Agents',_0x595d76[_0x22eb('0x16')])[_0x22eb('0x9')](function(_0x382163){_0x46c6a1=_0x382163;return respondWithRpcPromise(_0x22eb('0x2f'),_0x595d76[_0x22eb('0x16')],routingClient);})[_0x22eb('0x9')](function(_0x513b65){return _[_0x22eb('0x1a')]({},_0x513b65,_0x46c6a1);})[_0x22eb('0x9')](respondWithResult(_0x2e2a0c,null))['catch'](handleError(_0x2e2a0c,null));};exports[_0x22eb('0x30')]=function(_0x44d39f,_0x204092){if(_0x44d39f[_0x22eb('0x22')]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]&&_0x44d39f[_0x22eb('0x32')]&&_0x44d39f[_0x22eb('0x32')][_0x22eb('0x10')]){for(var _0x82ace8 in _0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]){if(_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x22eb('0x33')](_0x82ace8)){db[_0x22eb('0x34')][_0x22eb('0x35')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f[_0x22eb('0x32')]['name'],'type':_0x22eb('0x36'),'exitAt':null,'uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length']?{'$notIn':_0x44d39f['body']['interaction'][_0x82ace8]}:{'$ne':null}}})[_0x22eb('0x9')](function(_0x1efc65){var _0x4e4c6d=moment()['format'](_0x22eb('0x37'));for(var _0x43f771=0x0,_0x326b24=_0x1efc65[_0x22eb('0x38')];_0x43f771<_0x326b24;_0x43f771+=0x1){_0x1efc65[_0x43f771][_0x22eb('0x39')]({'exitAt':_0x4e4c6d});}});for(var _0x3b30a3=0x0;_0x3b30a3<_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length'];_0x3b30a3+=0x1){db['MemberReport'][_0x22eb('0x3a')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f['user'][_0x22eb('0x10')],'type':'INTERACTION','uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8][_0x3b30a3],'exitAt':null},'defaults':{'channel':_0x82ace8,'membername':_0x44d39f['user']['name'],'interface':_['isNil'](_0x44d39f[_0x22eb('0x32')]['interface'])?util[_0x22eb('0x3b')](_0x22eb('0x3c'),_0x44d39f['user'][_0x22eb('0x10')]):_0x44d39f['user'][_0x22eb('0x3d')],'type':_0x22eb('0x36'),'enterAt':moment()[_0x22eb('0x3b')](_0x22eb('0x37')),'role':_0x22eb('0x3e'),'internal':_0x44d39f[_0x22eb('0x32')][_0x22eb('0x3f')],'uniqueid':_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8][_0x3b30a3]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x44d39f[_0x22eb('0x1d')]['id'],'capacity':_0x44d39f[_0x22eb('0x22')]['capacity']},routingClient)[_0x22eb('0x9')](respondWithResult(_0x204092,null))[_0x22eb('0x17')](handleError(_0x204092,null));};exports[_0x22eb('0x40')]=function(_0x31216f,_0x4fee5c){return respondWithRpcPromise(_0x22eb('0x41'),_0x31216f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fee5c,null))[_0x22eb('0x17')](handleError(_0x4fee5c,null));};exports[_0x22eb('0x42')]=function(_0x10393b,_0x5effca){return respondWithRpcPromise(_0x22eb('0x43'),_0x10393b['query'])[_0x22eb('0x9')](respondWithResult(_0x5effca,null))['catch'](handleError(_0x5effca,null));};exports[_0x22eb('0x44')]=function(_0x254b53,_0x4028ef){return respondWithRpcPromise(_0x22eb('0x45'),_0x254b53[_0x22eb('0x16')])['then'](respondWithResult(_0x4028ef,null))['catch'](handleError(_0x4028ef,null));};exports[_0x22eb('0x46')]=function(_0x8e3864,_0x490110){return respondWithRpcPromise(_0x22eb('0x47'),_0x8e3864[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x490110,null))[_0x22eb('0x17')](handleError(_0x490110,null));};exports[_0x22eb('0x48')]=function(_0x27756b,_0x3a8588){return respondWithRpcPromise(_0x22eb('0x47'),_0x27756b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x27756b[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x3a8588,null))[_0x22eb('0x17')](handleError(_0x3a8588,null));};exports[_0x22eb('0x49')]=function(_0x3764d4,_0x2562a1){return respondWithRpcPromise(_0x22eb('0x4a'),_0x3764d4[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x2562a1,null))[_0x22eb('0x17')](handleError(_0x2562a1,null));};exports[_0x22eb('0x4b')]=function(_0x9f8465,_0x3e9ab5){return respondWithRpcPromise(_0x22eb('0x4a'),_0x9f8465[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x9f8465['params']['id']))['then'](respondWithResult(_0x3e9ab5,null))[_0x22eb('0x17')](handleError(_0x3e9ab5,null));};exports[_0x22eb('0x4c')]=function(_0x165e79,_0x38c02f){return respondWithRpcPromise(_0x22eb('0x4d'),_0x165e79['query'],mailClient)[_0x22eb('0x9')](respondWithResult(_0x38c02f,null))[_0x22eb('0x17')](handleError(_0x38c02f,null));};exports['openchannelQueues']=function(_0x485408,_0x341a1c){return respondWithRpcPromise(_0x22eb('0x4e'),_0x485408[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x341a1c,null))[_0x22eb('0x17')](handleError(_0x341a1c,null));};exports[_0x22eb('0x4f')]=function(_0x16099e,_0x22104f){return respondWithRpcPromise(_0x22eb('0x4e'),_0x16099e[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x16099e[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x22104f,null))[_0x22eb('0x17')](handleError(_0x22104f,null));};exports['smsQueues']=function(_0x29dd8b,_0x46ba3b){return respondWithRpcPromise(_0x22eb('0x50'),_0x29dd8b['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x46ba3b,null))['catch'](handleError(_0x46ba3b,null));};exports[_0x22eb('0x51')]=function(_0x5347b4,_0x1919d0){return respondWithRpcPromise(_0x22eb('0x50'),_0x5347b4['query'],routingClient)[_0x22eb('0x9')](findById(_0x5347b4[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x1919d0,null))['catch'](handleError(_0x1919d0,null));};exports[_0x22eb('0x52')]=function(_0x3073b1,_0x1984f0){return respondWithRpcPromise(_0x22eb('0x53'),_0x3073b1[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1984f0,null))['catch'](handleError(_0x1984f0,null));};exports[_0x22eb('0x54')]=function(_0x5d035b,_0x5f4ea3){return respondWithRpcPromise(_0x22eb('0x53'),_0x5d035b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x5d035b[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x5f4ea3,null))[_0x22eb('0x17')](handleError(_0x5f4ea3,null));};exports[_0x22eb('0x55')]=function(_0x109f7f,_0x50d914){return respondWithRpcPromise('FaxQueues',_0x109f7f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x50d914,null))['catch'](handleError(_0x50d914,null));};exports[_0x22eb('0x56')]=function(_0x3f7405,_0x25f1b2){return respondWithRpcPromise(_0x22eb('0x57'),_0x3f7405[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x3f7405['params']['id']))[_0x22eb('0x9')](respondWithResult(_0x25f1b2,null))[_0x22eb('0x17')](handleError(_0x25f1b2,null));};exports[_0x22eb('0x58')]=function(_0x5e46b0,_0x4fcc2c){return respondWithRpcPromise(_0x22eb('0x59'),_0x5e46b0[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fcc2c,null))['catch'](handleError(_0x4fcc2c,null));};exports[_0x22eb('0x5a')]=function(_0x4b6cf3,_0x1a305d){return respondWithRpcPromise(_0x22eb('0x5b'),_0x4b6cf3[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1a305d,null))['catch'](handleError(_0x1a305d,null));};exports[_0x22eb('0x5c')]=function(_0x2e35b0,_0x304492){return respondWithRpcPromise(_0x22eb('0x5d'),_0x2e35b0[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x304492,null))[_0x22eb('0x17')](handleError(_0x304492,null));};exports[_0x22eb('0x5e')]=function(_0x47865e,_0x1c5b0b){return respondWithRpcPromise(_0x22eb('0x5f'),_0x47865e['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1c5b0b,null))[_0x22eb('0x17')](handleError(_0x1c5b0b,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5cc383,_0x51d9f4){return respondWithRpcPromise(_0x22eb('0x5f'),_0x5cc383[_0x22eb('0x16')],routingClient)['then'](function(_0x10726f){if(_0x5cc383[_0x22eb('0x16')][_0x22eb('0x60')]!==undefined){var _0x41c50e=_(_0x10726f[_0x22eb('0x13')])['filter']([_0x5cc383['query'][_0x22eb('0x60')],_0x5cc383[_0x22eb('0x1d')]['id']])[_0x22eb('0x61')]('queue_id')['uniq']()[_0x22eb('0x62')]();return _0x10726f['rows']['filter'](function(_0x3568bc){return _0x41c50e[_0x22eb('0x63')](_0x3568bc['queue_id'])>-0x1;});}else{return _0x10726f['rows'][_0x22eb('0x64')](function(_0x2dd41a){return _0x2dd41a['queue_id']===parseInt(_0x5cc383[_0x22eb('0x1d')]['id']);});}})[_0x22eb('0x9')](respondWithResult(_0x51d9f4,null))[_0x22eb('0x17')](handleError(_0x51d9f4,null));};exports['smsQueuesWaitingInteractions']=function(_0x464f4f,_0x26fb52){return respondWithRpcPromise(_0x22eb('0x65'),_0x464f4f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x26fb52,null))['catch'](handleError(_0x26fb52,null));};exports[_0x22eb('0x66')]=function(_0x2ecc24,_0x3f429b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2ecc24['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x3f429b,null))[_0x22eb('0x17')](handleError(_0x3f429b,null));};exports[_0x22eb('0x67')]=function(_0x557c03,_0x215472){return respondWithRpcPromise(_0x22eb('0x68'),_0x557c03[_0x22eb('0x16')],routingClient)['then'](respondWithResult(_0x215472,null))[_0x22eb('0x17')](handleError(_0x215472,null));};exports['queueNotify']=function(_0x532a59){return function(_0x222616,_0x1e541f){var _0x1057f2,_0x49f362;var _0x3fc402=_[_0x22eb('0x69')](_0x532a59);var _0x2d422b=_0x532a59===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db[_0x3fc402+_0x22eb('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x222616[_0x22eb('0x1d')]['id']}})[_0x22eb('0x9')](function(_0x37d7c6){if(_['isNil'](_0x37d7c6)){throw new Error(_0x3fc402+_0x22eb('0x6d'));}_0x1057f2=_0x37d7c6;return db[_0x3fc402+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x222616[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x3fc402+_0x22eb('0x71')],'as':_0x22eb('0x71')},{'model':db[_0x3fc402+_0x2d422b],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x42d6fa){if(_[_0x22eb('0x11')](_0x42d6fa)){throw new Error(_0x3fc402+'\x20Message\x20not\x20found');}_0x49f362=_0x42d6fa;return _0x42d6fa[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x40999d={'uniqueid':_0x532a59+'.'+_0x49f362['id']+'.'+_0x49f362[_0x22eb('0x71')]['id'],'FromUserId':_0x222616['user']['id'],'type':_0x22eb('0x74')};_0x40999d[_0x3fc402+_0x22eb('0x75')]=_0x49f362['id'];_0x40999d[_0x3fc402+'InteractionId']=_0x49f362[_0x22eb('0x71')]['id'];_0x40999d[_0x22eb('0x76')+_0x3fc402+_0x2d422b+'Id']=_0x49f362[_0x22eb('0x72')]['id'];_0x40999d['To'+_0x3fc402+_0x22eb('0x77')]=_0x1057f2['id'];return db[_0x3fc402+_0x22eb('0x78')][_0x22eb('0x79')](_0x40999d);})[_0x22eb('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x532a59,'interaction':_0x49f362[_0x22eb('0x71')],'message':_0x49f362,'account':_0x49f362[_0x22eb('0x72')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1057f2['name']+','+(_0x49f362[_0x22eb('0x72')][_0x22eb('0x7a')]||0x12c),'interval':_0x22eb('0x7b')}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x1e541f,null))[_0x22eb('0x17')](handleError(_0x1e541f,null));};};exports['agentNotify']=function(_0x4e6fa6,_0x41fa99){var _0x18abf4,_0x5cf5e5;if(_[_0x22eb('0x11')](_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x448fea=_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')];var _0x402c2c=_[_0x22eb('0x69')](_0x448fea);var _0x195f58=_0x448fea===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e6fa6[_0x22eb('0x1d')]['id'],'role':'agent'}})['then'](function(_0x4170a5){if(_[_0x22eb('0x11')](_0x4170a5)){throw new Error('Agent\x20not\x20found');}_0x18abf4=_0x4170a5;return db[_0x402c2c+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x402c2c+'Interaction'],'as':_0x22eb('0x71')},{'model':db[_0x402c2c+_0x195f58],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x536f29){if(_['isNil'](_0x536f29)){throw new Error(_0x402c2c+'\x20Message\x20not\x20found');}_0x5cf5e5=_0x536f29;return _0x536f29[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x48fa11={'uniqueid':_0x448fea+'.'+_0x5cf5e5['id']+'.'+_0x5cf5e5['Interaction']['id'],'FromUserId':_0x4e6fa6[_0x22eb('0x32')]['id'],'type':'queue','ToUserId':_0x18abf4['id']};_0x48fa11[_0x402c2c+'MessageId']=_0x5cf5e5['id'];_0x48fa11[_0x402c2c+_0x22eb('0x7d')]=_0x5cf5e5[_0x22eb('0x71')]['id'];_0x48fa11['From'+_0x402c2c+_0x195f58+'Id']=_0x5cf5e5['Account']['id'];return db[_0x402c2c+_0x22eb('0x78')][_0x22eb('0x79')](_0x48fa11);})[_0x22eb('0x9')](function(){return respondWithRpcPromise(_0x22eb('0x7e'),{'channel':_0x448fea,'interaction':_0x5cf5e5[_0x22eb('0x71')],'message':_0x5cf5e5,'account':_0x5cf5e5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x18abf4[_0x22eb('0x10')]+','+(_0x5cf5e5[_0x22eb('0x72')][_0x22eb('0x7f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x41fa99,null))['catch'](handleError(_0x41fa99,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 1a94c9e..4a76077 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c4d=['/:id','show','/:id/run','run','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9c4d,0xab));var _0xd9c4=function(_0x1b8755,_0x5b86bb){_0x1b8755=_0x1b8755-0x0;var _0x687dd9=_0x9c4d[_0x1b8755];return _0x687dd9;};'use strict';var multer=require(_0xd9c4('0x0'));var util=require(_0xd9c4('0x1'));var path=require(_0xd9c4('0x2'));var timeout=require(_0xd9c4('0x3'));var express=require(_0xd9c4('0x4'));var router=express[_0xd9c4('0x5')]();var fs_extra=require(_0xd9c4('0x6'));var auth=require(_0xd9c4('0x7'));var interaction=require(_0xd9c4('0x8'));var config=require('../../config/environment');var controller=require(_0xd9c4('0x9'));router[_0xd9c4('0xa')]('/',auth[_0xd9c4('0xb')](),controller[_0xd9c4('0xc')]);router['get'](_0xd9c4('0xd'),auth['isAuthenticated'](),controller[_0xd9c4('0xe')]);router[_0xd9c4('0xa')](_0xd9c4('0xf'),auth[_0xd9c4('0xb')](),controller[_0xd9c4('0x10')]);router[_0xd9c4('0x11')]('/',auth[_0xd9c4('0xb')](),controller[_0xd9c4('0x12')]);router[_0xd9c4('0x13')](_0xd9c4('0xd'),auth['isAuthenticated'](),controller[_0xd9c4('0x14')]);router['delete'](_0xd9c4('0xd'),auth[_0xd9c4('0xb')](),controller[_0xd9c4('0x15')]);module[_0xd9c4('0x16')]=router; \ No newline at end of file +var _0xb830=['../../config/environment','isAuthenticated','get','show','/:id/run','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x189cbc,_0x18aa5a){var _0x31d0db=function(_0x2d4280){while(--_0x2d4280){_0x189cbc['push'](_0x189cbc['shift']());}};_0x31d0db(++_0x18aa5a);}(_0xb830,0xd4));var _0x0b83=function(_0x5c07ce,_0x2a2da9){_0x5c07ce=_0x5c07ce-0x0;var _0x14499d=_0xb830[_0x5c07ce];return _0x14499d;};'use strict';var multer=require(_0x0b83('0x0'));var util=require(_0x0b83('0x1'));var path=require(_0x0b83('0x2'));var timeout=require(_0x0b83('0x3'));var express=require(_0x0b83('0x4'));var router=express[_0x0b83('0x5')]();var fs_extra=require(_0x0b83('0x6'));var auth=require(_0x0b83('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0b83('0x8'));var controller=require('./schedule.controller');router['get']('/',auth[_0x0b83('0x9')](),controller['index']);router[_0x0b83('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0b83('0xb')]);router[_0x0b83('0xa')](_0x0b83('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x0b83('0xd')]('/',auth[_0x0b83('0x9')](),controller[_0x0b83('0xe')]);router[_0x0b83('0xf')](_0x0b83('0x10'),auth[_0x0b83('0x9')](),controller[_0x0b83('0x11')]);router[_0x0b83('0x12')](_0x0b83('0x10'),auth[_0x0b83('0x9')](),controller[_0x0b83('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 39efc12..fa921bc 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6c8=['minutes','csv','pdf','xlsx','default','custom','BOOLEAN','TEXT','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb6c8,0x194));var _0x8b6c=function(_0x5f19ef,_0x5603f7){_0x5f19ef=_0x5f19ef-0x0;var _0xd740b8=_0xb6c8[_0x5f19ef];return _0xd740b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8b6c('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8b6c('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8b6c('0x0')],'allowNull':![],'defaultValue':_0x8b6c('0x1')},'startAt':{'type':Sequelize[_0x8b6c('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8b6c('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8b6c('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8b6c('0x4')](_0x8b6c('0x5'),_0x8b6c('0x6'),_0x8b6c('0x7'),_0x8b6c('0x8'),_0x8b6c('0x9'),'hours',_0x8b6c('0xa')),'allowNull':![],'defaultValue':_0x8b6c('0x9')},'output':{'type':Sequelize[_0x8b6c('0x4')](_0x8b6c('0xb'),_0x8b6c('0xc'),_0x8b6c('0xd')),'allowNull':![],'defaultValue':_0x8b6c('0xb')},'type':{'type':Sequelize[_0x8b6c('0x4')]('custom',_0x8b6c('0xe')),'allowNull':![],'defaultValue':_0x8b6c('0xf')},'sendMail':{'type':Sequelize[_0x8b6c('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x8b6c('0x0')]},'cc':{'type':Sequelize[_0x8b6c('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x8b6c('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0xddc4=['BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','days','hours','minutes','csv','pdf','xlsx','default','custom'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xddc4,0xd3));var _0x4ddc=function(_0x215fd8,_0x8a1309){_0x215fd8=_0x215fd8-0x0;var _0x5e453a=_0xddc4[_0x215fd8];return _0x5e453a;};'use strict';var Sequelize=require(_0x4ddc('0x0'));module[_0x4ddc('0x1')]={'name':{'type':Sequelize[_0x4ddc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4ddc('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4ddc('0x2')],'allowNull':![],'defaultValue':_0x4ddc('0x3')},'startAt':{'type':Sequelize[_0x4ddc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4ddc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4ddc('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4ddc('0x6')](_0x4ddc('0x7'),'quarters',_0x4ddc('0x8'),'weeks',_0x4ddc('0x9'),_0x4ddc('0xa'),_0x4ddc('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x4ddc('0xc'),_0x4ddc('0xd'),_0x4ddc('0xe')),'allowNull':![],'defaultValue':_0x4ddc('0xc')},'type':{'type':Sequelize[_0x4ddc('0x6')]('custom',_0x4ddc('0xf')),'allowNull':![],'defaultValue':_0x4ddc('0x10')},'sendMail':{'type':Sequelize[_0x4ddc('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4ddc('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d93b924..9678a01 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b85=['nolimit','limit','order','sort','pick','filter','merge','options','where','includeAll','findAll','rows','show','params','find','catch','create','body','user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','apply','then','destroy','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2de4e6,_0x2dbab4){var _0x156984=function(_0x3c17c4){while(--_0x3c17c4){_0x2de4e6['push'](_0x2de4e6['shift']());}};_0x156984(++_0x2dbab4);}(_0x0b85,0x196));var _0x50b8=function(_0x51394b,_0x228887){_0x51394b=_0x51394b-0x0;var _0x2439b5=_0x0b85[_0x51394b];return _0x2439b5;};'use strict';var emlformat=require(_0x50b8('0x0'));var rimraf=require(_0x50b8('0x1'));var zipdir=require(_0x50b8('0x2'));var jsonpatch=require(_0x50b8('0x3'));var rp=require(_0x50b8('0x4'));var moment=require(_0x50b8('0x5'));var BPromise=require(_0x50b8('0x6'));var Mustache=require('mustache');var util=require(_0x50b8('0x7'));var path=require(_0x50b8('0x8'));var sox=require(_0x50b8('0x9'));var csv=require(_0x50b8('0xa'));var ejs=require(_0x50b8('0xb'));var fs=require('fs');var fs_extra=require(_0x50b8('0xc'));var _=require(_0x50b8('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x50b8('0xe'));var toCsv=require(_0x50b8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x50b8('0xf'));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(_0x50b8('0x10'))(_0x50b8('0x11'));var utils=require(_0x50b8('0x12'));var config=require(_0x50b8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x50b8('0x14'))['db'];function respondWithStatusCode(_0x42c864,_0x123fcd){_0x123fcd=_0x123fcd||0xcc;return function(_0x52d2ba){if(_0x52d2ba){return _0x42c864[_0x50b8('0x15')](_0x123fcd);}return _0x42c864[_0x50b8('0x16')](_0x123fcd)[_0x50b8('0x17')]();};}function respondWithResult(_0x5428f8,_0x5f3b90){_0x5f3b90=_0x5f3b90||0xc8;return function(_0x5228e1){if(_0x5228e1){return _0x5428f8['status'](_0x5f3b90)['json'](_0x5228e1);}};}function respondWithFilteredResult(_0x3ccf28,_0x5efe78){return function(_0x3d27f4){if(_0x3d27f4){var _0x73e131=typeof _0x5efe78[_0x50b8('0x18')]===_0x50b8('0x19')&&typeof _0x5efe78['limit']==='undefined';var _0x524d50=_0x3d27f4[_0x50b8('0x1a')];var _0x4818d5=_0x73e131?0x0:_0x5efe78['offset'];var _0x38d821=_0x73e131?_0x3d27f4[_0x50b8('0x1a')]:_0x5efe78[_0x50b8('0x18')]+_0x5efe78['limit'];var _0x254153;if(_0x38d821>=_0x524d50){_0x38d821=_0x524d50;_0x254153=0xc8;}else{_0x254153=0xce;}_0x3ccf28[_0x50b8('0x16')](_0x254153);return _0x3ccf28['set'](_0x50b8('0x1b'),_0x4818d5+'-'+_0x38d821+'/'+_0x524d50)['json'](_0x3d27f4);}return null;};}function patchUpdates(_0x5996da){return function(_0xf5c267){try{jsonpatch[_0x50b8('0x1c')](_0xf5c267,_0x5996da,!![]);}catch(_0x3969b7){return BPromise['reject'](_0x3969b7);}return _0xf5c267['save']();};}function saveUpdates(_0x4e7ddc,_0x375754){return function(_0x5f117c){if(_0x5f117c){return _0x5f117c['update'](_0x4e7ddc)[_0x50b8('0x1d')](function(_0x409582){return _0x409582;});}return null;};}function removeEntity(_0x1d6c01,_0x5c8366){return function(_0x1d4952){if(_0x1d4952){return _0x1d4952[_0x50b8('0x1e')]()[_0x50b8('0x1d')](function(){var _0x121515=_0x1d4952['get']({'plain':!![]});var _0x1f612d='Scheduler';return db['UserProfileResource'][_0x50b8('0x1e')]({'where':{'type':_0x1f612d,'resourceId':_0x121515['id']}})[_0x50b8('0x1d')](function(){return _0x1d4952;});})[_0x50b8('0x1d')](function(){_0x1d6c01[_0x50b8('0x16')](0xcc)[_0x50b8('0x17')]();});}};}function handleEntityNotFound(_0x31278f,_0x257813){return function(_0x14e3b6){if(!_0x14e3b6){_0x31278f['sendStatus'](0x194);}return _0x14e3b6;};}function handleError(_0x2a3713,_0x52ab07){_0x52ab07=_0x52ab07||0x1f4;return function(_0x1b6575){logger[_0x50b8('0x1f')](_0x1b6575[_0x50b8('0x20')]);if(_0x1b6575[_0x50b8('0x21')]){delete _0x1b6575[_0x50b8('0x21')];}_0x2a3713[_0x50b8('0x16')](_0x52ab07)[_0x50b8('0x22')](_0x1b6575);};}exports['index']=function(_0x1a6211,_0x61d4b8){var _0x55893f={},_0x1f52d1={},_0x2bd022={'count':0x0,'rows':[]};var _0x59af15=_[_0x50b8('0x23')](db[_0x50b8('0x24')][_0x50b8('0x25')],function(_0x3d7eb2){return{'name':_0x3d7eb2[_0x50b8('0x26')],'type':_0x3d7eb2[_0x50b8('0x27')][_0x50b8('0x28')]};});_0x1f52d1[_0x50b8('0x29')]=_[_0x50b8('0x23')](_0x59af15,_0x50b8('0x21'));_0x1f52d1[_0x50b8('0x2a')]=_[_0x50b8('0x2b')](_0x1a6211[_0x50b8('0x2a')]);_0x1f52d1[_0x50b8('0x2c')]=_[_0x50b8('0x2d')](_0x1f52d1['model'],_0x1f52d1[_0x50b8('0x2a')]);_0x55893f[_0x50b8('0x2e')]=_[_0x50b8('0x2d')](_0x1f52d1[_0x50b8('0x29')],qs['fields'](_0x1a6211['query'][_0x50b8('0x2f')]));_0x55893f[_0x50b8('0x2e')]=_0x55893f['attributes'][_0x50b8('0x30')]?_0x55893f[_0x50b8('0x2e')]:_0x1f52d1[_0x50b8('0x29')];if(!_0x1a6211['query'][_0x50b8('0x31')](_0x50b8('0x32'))){_0x55893f[_0x50b8('0x33')]=qs[_0x50b8('0x33')](_0x1a6211[_0x50b8('0x2a')][_0x50b8('0x33')]);_0x55893f[_0x50b8('0x18')]=qs['offset'](_0x1a6211['query'][_0x50b8('0x18')]);}_0x55893f[_0x50b8('0x34')]=qs[_0x50b8('0x35')](_0x1a6211['query'][_0x50b8('0x35')]);_0x55893f['where']=qs[_0x50b8('0x2c')](_[_0x50b8('0x36')](_0x1a6211[_0x50b8('0x2a')],_0x1f52d1[_0x50b8('0x2c')]),_0x59af15);if(_0x1a6211[_0x50b8('0x2a')][_0x50b8('0x37')]){_0x55893f['where']=_[_0x50b8('0x38')](_0x55893f['where'],{'$or':_[_0x50b8('0x23')](_0x59af15,function(_0x3728db){if(_0x3728db[_0x50b8('0x27')]!=='VIRTUAL'){var _0x1d4ba4={};_0x1d4ba4[_0x3728db['name']]={'$like':'%'+_0x1a6211[_0x50b8('0x2a')]['filter']+'%'};return _0x1d4ba4;}})});}_0x55893f=_[_0x50b8('0x38')]({},_0x55893f,_0x1a6211[_0x50b8('0x39')]);var _0x42e416={'where':_0x55893f[_0x50b8('0x3a')]};return db['Schedule'][_0x50b8('0x1a')](_0x42e416)[_0x50b8('0x1d')](function(_0x32bc8e){_0x2bd022[_0x50b8('0x1a')]=_0x32bc8e;if(_0x1a6211[_0x50b8('0x2a')][_0x50b8('0x3b')]){_0x55893f['include']=[{'all':!![]}];}return db[_0x50b8('0x24')][_0x50b8('0x3c')](_0x55893f);})['then'](function(_0x4cd0b1){_0x2bd022[_0x50b8('0x3d')]=_0x4cd0b1;return _0x2bd022;})[_0x50b8('0x1d')](respondWithFilteredResult(_0x61d4b8,_0x55893f))['catch'](handleError(_0x61d4b8,null));};exports[_0x50b8('0x3e')]=function(_0x3b13f3,_0x1604c6){var _0x250779={'raw':![],'where':{'id':_0x3b13f3[_0x50b8('0x3f')]['id']}},_0x1bba43={};_0x1bba43[_0x50b8('0x29')]=_[_0x50b8('0x2b')](db['Schedule'][_0x50b8('0x25')]);_0x1bba43['query']=_['keys'](_0x3b13f3[_0x50b8('0x2a')]);_0x1bba43[_0x50b8('0x2c')]=_[_0x50b8('0x2d')](_0x1bba43[_0x50b8('0x29')],_0x1bba43[_0x50b8('0x2a')]);_0x250779[_0x50b8('0x2e')]=_['intersection'](_0x1bba43['model'],qs[_0x50b8('0x2f')](_0x3b13f3[_0x50b8('0x2a')]['fields']));_0x250779[_0x50b8('0x2e')]=_0x250779['attributes'][_0x50b8('0x30')]?_0x250779[_0x50b8('0x2e')]:_0x1bba43[_0x50b8('0x29')];if(_0x3b13f3[_0x50b8('0x2a')][_0x50b8('0x3b')]){_0x250779['include']=[{'all':!![]}];}_0x250779=_[_0x50b8('0x38')]({},_0x250779,_0x3b13f3['options']);return db[_0x50b8('0x24')][_0x50b8('0x40')](_0x250779)['then'](handleEntityNotFound(_0x1604c6,null))['then'](respondWithResult(_0x1604c6,null))[_0x50b8('0x41')](handleError(_0x1604c6,null));};exports[_0x50b8('0x42')]=function(_0x426d0b,_0x3570a6){return db[_0x50b8('0x24')]['create'](_0x426d0b[_0x50b8('0x43')],{})[_0x50b8('0x1d')](function(_0x707ffa){var _0x2a806d=_0x426d0b[_0x50b8('0x44')]['get']({'plain':!![]});if(!_0x2a806d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a806d[_0x50b8('0x45')]===_0x50b8('0x44')){var _0x5b8b1d=_0x707ffa['get']({'plain':!![]});var _0x554bd0=_0x50b8('0x46');return db[_0x50b8('0x47')][_0x50b8('0x40')]({'where':{'name':_0x554bd0,'userProfileId':_0x2a806d[_0x50b8('0x48')]},'raw':!![]})[_0x50b8('0x1d')](function(_0x55e0aa){if(_0x55e0aa&&_0x55e0aa[_0x50b8('0x49')]===0x0){return db['UserProfileResource'][_0x50b8('0x42')]({'name':_0x5b8b1d[_0x50b8('0x21')],'resourceId':_0x5b8b1d['id'],'type':_0x55e0aa['name'],'sectionId':_0x55e0aa['id']},{})['then'](function(){return _0x707ffa;});}else{return _0x707ffa;}})[_0x50b8('0x41')](function(_0x4623b0){logger[_0x50b8('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4623b0);throw _0x4623b0;});}return _0x707ffa;})[_0x50b8('0x1d')](respondWithResult(_0x3570a6,0xc9))['catch'](handleError(_0x3570a6,null));};exports['update']=function(_0x4c07da,_0x5d88f9){if(_0x4c07da[_0x50b8('0x43')]['id']){delete _0x4c07da[_0x50b8('0x43')]['id'];}return db[_0x50b8('0x24')][_0x50b8('0x40')]({'where':{'id':_0x4c07da[_0x50b8('0x3f')]['id']}})[_0x50b8('0x1d')](handleEntityNotFound(_0x5d88f9,null))[_0x50b8('0x1d')](saveUpdates(_0x4c07da[_0x50b8('0x43')],null))[_0x50b8('0x1d')](respondWithResult(_0x5d88f9,null))['catch'](handleError(_0x5d88f9,null));};exports['destroy']=function(_0x14d974,_0x549d03){return db[_0x50b8('0x24')][_0x50b8('0x40')]({'where':{'id':_0x14d974['params']['id']}})[_0x50b8('0x1d')](handleEntityNotFound(_0x549d03,null))['then'](removeEntity(_0x549d03,null))[_0x50b8('0x41')](handleError(_0x549d03,null));};exports['run']=function(_0x3c7f45,_0x2f2945,_0x23b1fc){var _0x213070=require(_0x50b8('0x4a'));return db[_0x50b8('0x24')][_0x50b8('0x40')]({'where':{'id':_0x3c7f45[_0x50b8('0x3f')]['id']},'raw':!![]})[_0x50b8('0x1d')](handleEntityNotFound(_0x2f2945,null))['then'](function(){_0x213070[_0x50b8('0x4b')](_0x3c7f45[_0x50b8('0x3f')]['id']);})[_0x50b8('0x1d')](respondWithStatusCode(_0x2f2945,null))[_0x50b8('0x41')](handleError(_0x2f2945,null));}; \ No newline at end of file +var _0x6a6a=['jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','json','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','error','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','crypto'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6a6a,0x1a4));var _0xa6a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6a6a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa6a6('0x0'));var jsonpatch=require(_0xa6a6('0x1'));var rp=require(_0xa6a6('0x2'));var moment=require(_0xa6a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa6a6('0x4'));var util=require(_0xa6a6('0x5'));var path=require(_0xa6a6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6a6('0x7'));var fs=require('fs');var fs_extra=require(_0xa6a6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa6a6('0x9'));var jsforce=require(_0xa6a6('0xa'));var deskjs=require(_0xa6a6('0xb'));var toCsv=require(_0xa6a6('0xc'));var querystring=require(_0xa6a6('0xd'));var Papa=require('papaparse');var Redis=require(_0xa6a6('0xe'));var authService=require(_0xa6a6('0xf'));var qs=require(_0xa6a6('0x10'));var as=require(_0xa6a6('0x11'));var hardwareService=require(_0xa6a6('0x12'));var logger=require(_0xa6a6('0x13'))(_0xa6a6('0x14'));var utils=require(_0xa6a6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa6a6('0x16'));var db=require(_0xa6a6('0x17'))['db'];function respondWithStatusCode(_0x2b5053,_0x4666d1){_0x4666d1=_0x4666d1||0xcc;return function(_0x3a822c){if(_0x3a822c){return _0x2b5053[_0xa6a6('0x18')](_0x4666d1);}return _0x2b5053[_0xa6a6('0x19')](_0x4666d1)[_0xa6a6('0x1a')]();};}function respondWithResult(_0x257c29,_0x576dc7){_0x576dc7=_0x576dc7||0xc8;return function(_0x1c00ad){if(_0x1c00ad){return _0x257c29['status'](_0x576dc7)['json'](_0x1c00ad);}};}function respondWithFilteredResult(_0x3acc1f,_0x81c7b8){return function(_0x2f2b19){if(_0x2f2b19){var _0x41e6f=typeof _0x81c7b8['offset']===_0xa6a6('0x1b')&&typeof _0x81c7b8['limit']==='undefined';var _0x555f9a=_0x2f2b19[_0xa6a6('0x1c')];var _0x32240a=_0x41e6f?0x0:_0x81c7b8[_0xa6a6('0x1d')];var _0x1c19d5=_0x41e6f?_0x2f2b19[_0xa6a6('0x1c')]:_0x81c7b8[_0xa6a6('0x1d')]+_0x81c7b8['limit'];var _0x548f79;if(_0x1c19d5>=_0x555f9a){_0x1c19d5=_0x555f9a;_0x548f79=0xc8;}else{_0x548f79=0xce;}_0x3acc1f[_0xa6a6('0x19')](_0x548f79);return _0x3acc1f['set'](_0xa6a6('0x1e'),_0x32240a+'-'+_0x1c19d5+'/'+_0x555f9a)[_0xa6a6('0x1f')](_0x2f2b19);}return null;};}function patchUpdates(_0x3b01d7){return function(_0x21d015){try{jsonpatch[_0xa6a6('0x20')](_0x21d015,_0x3b01d7,!![]);}catch(_0x3e31f5){return BPromise[_0xa6a6('0x21')](_0x3e31f5);}return _0x21d015[_0xa6a6('0x22')]();};}function saveUpdates(_0x278970,_0x3ed457){return function(_0x91a235){if(_0x91a235){return _0x91a235['update'](_0x278970)[_0xa6a6('0x23')](function(_0xb2ff6f){return _0xb2ff6f;});}return null;};}function removeEntity(_0x5ab4ef,_0x552b40){return function(_0x30eaed){if(_0x30eaed){return _0x30eaed[_0xa6a6('0x24')]()['then'](function(){var _0x445449=_0x30eaed[_0xa6a6('0x25')]({'plain':!![]});var _0x1c6bf9=_0xa6a6('0x26');return db[_0xa6a6('0x27')][_0xa6a6('0x24')]({'where':{'type':_0x1c6bf9,'resourceId':_0x445449['id']}})[_0xa6a6('0x23')](function(){return _0x30eaed;});})['then'](function(){_0x5ab4ef[_0xa6a6('0x19')](0xcc)[_0xa6a6('0x1a')]();});}};}function handleEntityNotFound(_0x3f48b8,_0x1cb2f0){return function(_0x19b22d){if(!_0x19b22d){_0x3f48b8[_0xa6a6('0x18')](0x194);}return _0x19b22d;};}function handleError(_0x13ffe9,_0x49535c){_0x49535c=_0x49535c||0x1f4;return function(_0x5b337f){logger[_0xa6a6('0x28')](_0x5b337f['stack']);if(_0x5b337f[_0xa6a6('0x29')]){delete _0x5b337f[_0xa6a6('0x29')];}_0x13ffe9[_0xa6a6('0x19')](_0x49535c)[_0xa6a6('0x2a')](_0x5b337f);};}exports[_0xa6a6('0x2b')]=function(_0x5b2b09,_0x5f508f){var _0x25dea1={},_0x2aca50={},_0x379b4a={'count':0x0,'rows':[]};var _0x4f8eb4=_[_0xa6a6('0x2c')](db[_0xa6a6('0x2d')]['rawAttributes'],function(_0x19ee62){return{'name':_0x19ee62[_0xa6a6('0x2e')],'type':_0x19ee62[_0xa6a6('0x2f')][_0xa6a6('0x30')]};});_0x2aca50[_0xa6a6('0x31')]=_[_0xa6a6('0x2c')](_0x4f8eb4,_0xa6a6('0x29'));_0x2aca50[_0xa6a6('0x32')]=_[_0xa6a6('0x33')](_0x5b2b09[_0xa6a6('0x32')]);_0x2aca50[_0xa6a6('0x34')]=_[_0xa6a6('0x35')](_0x2aca50[_0xa6a6('0x31')],_0x2aca50[_0xa6a6('0x32')]);_0x25dea1[_0xa6a6('0x36')]=_['intersection'](_0x2aca50['model'],qs[_0xa6a6('0x37')](_0x5b2b09['query']['fields']));_0x25dea1[_0xa6a6('0x36')]=_0x25dea1[_0xa6a6('0x36')][_0xa6a6('0x38')]?_0x25dea1[_0xa6a6('0x36')]:_0x2aca50[_0xa6a6('0x31')];if(!_0x5b2b09[_0xa6a6('0x32')]['hasOwnProperty'](_0xa6a6('0x39'))){_0x25dea1['limit']=qs[_0xa6a6('0x3a')](_0x5b2b09['query'][_0xa6a6('0x3a')]);_0x25dea1['offset']=qs['offset'](_0x5b2b09[_0xa6a6('0x32')][_0xa6a6('0x1d')]);}_0x25dea1[_0xa6a6('0x3b')]=qs[_0xa6a6('0x3c')](_0x5b2b09['query'][_0xa6a6('0x3c')]);_0x25dea1['where']=qs[_0xa6a6('0x34')](_[_0xa6a6('0x3d')](_0x5b2b09[_0xa6a6('0x32')],_0x2aca50['filters']),_0x4f8eb4);if(_0x5b2b09[_0xa6a6('0x32')][_0xa6a6('0x3e')]){_0x25dea1[_0xa6a6('0x3f')]=_[_0xa6a6('0x40')](_0x25dea1['where'],{'$or':_[_0xa6a6('0x2c')](_0x4f8eb4,function(_0x345076){if(_0x345076['type']!==_0xa6a6('0x41')){var _0xe65868={};_0xe65868[_0x345076[_0xa6a6('0x29')]]={'$like':'%'+_0x5b2b09[_0xa6a6('0x32')][_0xa6a6('0x3e')]+'%'};return _0xe65868;}})});}_0x25dea1=_[_0xa6a6('0x40')]({},_0x25dea1,_0x5b2b09[_0xa6a6('0x42')]);var _0x42f88d={'where':_0x25dea1[_0xa6a6('0x3f')]};return db[_0xa6a6('0x2d')][_0xa6a6('0x1c')](_0x42f88d)['then'](function(_0x3c0600){_0x379b4a[_0xa6a6('0x1c')]=_0x3c0600;if(_0x5b2b09[_0xa6a6('0x32')]['includeAll']){_0x25dea1[_0xa6a6('0x43')]=[{'all':!![]}];}return db[_0xa6a6('0x2d')][_0xa6a6('0x44')](_0x25dea1);})[_0xa6a6('0x23')](function(_0xe85b13){_0x379b4a[_0xa6a6('0x45')]=_0xe85b13;return _0x379b4a;})[_0xa6a6('0x23')](respondWithFilteredResult(_0x5f508f,_0x25dea1))[_0xa6a6('0x46')](handleError(_0x5f508f,null));};exports[_0xa6a6('0x47')]=function(_0xe8b5fd,_0x149cd1){var _0x26379b={'raw':![],'where':{'id':_0xe8b5fd[_0xa6a6('0x48')]['id']}},_0x1337e1={};_0x1337e1[_0xa6a6('0x31')]=_[_0xa6a6('0x33')](db[_0xa6a6('0x2d')][_0xa6a6('0x49')]);_0x1337e1[_0xa6a6('0x32')]=_[_0xa6a6('0x33')](_0xe8b5fd[_0xa6a6('0x32')]);_0x1337e1[_0xa6a6('0x34')]=_['intersection'](_0x1337e1[_0xa6a6('0x31')],_0x1337e1[_0xa6a6('0x32')]);_0x26379b[_0xa6a6('0x36')]=_['intersection'](_0x1337e1[_0xa6a6('0x31')],qs[_0xa6a6('0x37')](_0xe8b5fd[_0xa6a6('0x32')][_0xa6a6('0x37')]));_0x26379b[_0xa6a6('0x36')]=_0x26379b[_0xa6a6('0x36')][_0xa6a6('0x38')]?_0x26379b['attributes']:_0x1337e1[_0xa6a6('0x31')];if(_0xe8b5fd[_0xa6a6('0x32')][_0xa6a6('0x4a')]){_0x26379b[_0xa6a6('0x43')]=[{'all':!![]}];}_0x26379b=_[_0xa6a6('0x40')]({},_0x26379b,_0xe8b5fd['options']);return db[_0xa6a6('0x2d')][_0xa6a6('0x4b')](_0x26379b)['then'](handleEntityNotFound(_0x149cd1,null))[_0xa6a6('0x23')](respondWithResult(_0x149cd1,null))[_0xa6a6('0x46')](handleError(_0x149cd1,null));};exports[_0xa6a6('0x4c')]=function(_0x3ddcd5,_0x5bf24b){return db[_0xa6a6('0x2d')][_0xa6a6('0x4c')](_0x3ddcd5['body'],{})[_0xa6a6('0x23')](function(_0x40905d){var _0x3d6daa=_0x3ddcd5['user']['get']({'plain':!![]});if(!_0x3d6daa)throw new Error(_0xa6a6('0x4d'));if(_0x3d6daa[_0xa6a6('0x4e')]===_0xa6a6('0x4f')){var _0x96cee8=_0x40905d[_0xa6a6('0x25')]({'plain':!![]});var _0x392c2e='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x392c2e,'userProfileId':_0x3d6daa[_0xa6a6('0x50')]},'raw':!![]})['then'](function(_0x5ed19c){if(_0x5ed19c&&_0x5ed19c[_0xa6a6('0x51')]===0x0){return db[_0xa6a6('0x27')][_0xa6a6('0x4c')]({'name':_0x96cee8[_0xa6a6('0x29')],'resourceId':_0x96cee8['id'],'type':_0x5ed19c['name'],'sectionId':_0x5ed19c['id']},{})[_0xa6a6('0x23')](function(){return _0x40905d;});}else{return _0x40905d;}})['catch'](function(_0x3eb208){logger[_0xa6a6('0x28')](_0xa6a6('0x52'),_0x3eb208);throw _0x3eb208;});}return _0x40905d;})[_0xa6a6('0x23')](respondWithResult(_0x5bf24b,0xc9))[_0xa6a6('0x46')](handleError(_0x5bf24b,null));};exports['update']=function(_0x3ed78f,_0x476122){if(_0x3ed78f[_0xa6a6('0x53')]['id']){delete _0x3ed78f[_0xa6a6('0x53')]['id'];}return db['Schedule'][_0xa6a6('0x4b')]({'where':{'id':_0x3ed78f[_0xa6a6('0x48')]['id']}})[_0xa6a6('0x23')](handleEntityNotFound(_0x476122,null))[_0xa6a6('0x23')](saveUpdates(_0x3ed78f[_0xa6a6('0x53')],null))['then'](respondWithResult(_0x476122,null))['catch'](handleError(_0x476122,null));};exports[_0xa6a6('0x24')]=function(_0xd4eb02,_0x55fe89){return db[_0xa6a6('0x2d')]['find']({'where':{'id':_0xd4eb02[_0xa6a6('0x48')]['id']}})['then'](handleEntityNotFound(_0x55fe89,null))[_0xa6a6('0x23')](removeEntity(_0x55fe89,null))[_0xa6a6('0x46')](handleError(_0x55fe89,null));};exports[_0xa6a6('0x54')]=function(_0x5ea729,_0x29eb0f,_0x2b5c89){var _0x2b518d=require(_0xa6a6('0x55'));return db['Schedule'][_0xa6a6('0x4b')]({'where':{'id':_0x5ea729[_0xa6a6('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x29eb0f,null))[_0xa6a6('0x23')](function(){_0x2b518d[_0xa6a6('0x54')](_0x5ea729[_0xa6a6('0x48')]['id']);})[_0xa6a6('0x23')](respondWithStatusCode(_0x29eb0f,null))['catch'](handleError(_0x29eb0f,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7c7dd33..575f451 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4e8=['Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xd4e8,0xe2));var _0x8d4e=function(_0x3fd7ab,_0x3dd0bc){_0x3fd7ab=_0x3fd7ab-0x0;var _0x56cb4b=_0xd4e8[_0x3fd7ab];return _0x56cb4b;};'use strict';var _=require(_0x8d4e('0x0'));var util=require(_0x8d4e('0x1'));var logger=require(_0x8d4e('0x2'))(_0x8d4e('0x3'));var moment=require(_0x8d4e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d4e('0x5'));var fs=require('fs');var path=require(_0x8d4e('0x6'));var rimraf=require(_0x8d4e('0x7'));var config=require(_0x8d4e('0x8'));var attributes=require(_0x8d4e('0x9'));module[_0x8d4e('0xa')]=function(_0x5d948f,_0x2765f5){return _0x5d948f[_0x8d4e('0xb')](_0x8d4e('0xc'),attributes,{'tableName':_0x8d4e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9611=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x24f6c1,_0x4107b1){var _0x306978=function(_0x5433d0){while(--_0x5433d0){_0x24f6c1['push'](_0x24f6c1['shift']());}};_0x306978(++_0x4107b1);}(_0x9611,0xb6));var _0x1961=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x9611[_0x3b76f7];return _0x43984e;};'use strict';var _=require(_0x1961('0x0'));var util=require(_0x1961('0x1'));var logger=require(_0x1961('0x2'))('api');var moment=require(_0x1961('0x3'));var BPromise=require(_0x1961('0x4'));var rp=require(_0x1961('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1961('0x6'));var config=require(_0x1961('0x7'));var attributes=require(_0x1961('0x8'));module[_0x1961('0x9')]=function(_0x3c1ae8,_0x4efd5c){return _0x3c1ae8[_0x1961('0xa')](_0x1961('0xb'),attributes,{'tableName':_0x1961('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 7045431..150143a 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38f6=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2d33c7,_0x20e736){var _0x3f5a29=function(_0x41f9fb){while(--_0x41f9fb){_0x2d33c7['push'](_0x2d33c7['shift']());}};_0x3f5a29(++_0x20e736);}(_0x38f6,0x182));var _0x638f=function(_0x3a4f91,_0x5146f6){_0x3a4f91=_0x3a4f91-0x0;var _0x251fa2=_0x38f6[_0x3a4f91];return _0x251fa2;};'use strict';var _=require(_0x638f('0x0'));var util=require(_0x638f('0x1'));var moment=require(_0x638f('0x2'));var BPromise=require('bluebird');var rs=require(_0x638f('0x3'));var fs=require('fs');var Redis=require(_0x638f('0x4'));var db=require(_0x638f('0x5'))['db'];var utils=require(_0x638f('0x6'));var logger=require('../../config/logger')(_0x638f('0x7'));var config=require(_0x638f('0x8'));var jayson=require(_0x638f('0x9'));var client=jayson[_0x638f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9f47,_0x4baaeb,_0x3fc389){return new BPromise(function(_0x36391f,_0x581bfc){return client[_0x638f('0xb')](_0x4e9f47,_0x3fc389)[_0x638f('0xc')](function(_0xf66883){logger['info'](_0x638f('0xd'),_0x4baaeb,_0x638f('0xe'));logger[_0x638f('0xf')](_0x638f('0x10'),_0x4baaeb,'request\x20sent',JSON[_0x638f('0x11')](_0xf66883));if(_0xf66883[_0x638f('0x12')]){if(_0xf66883[_0x638f('0x12')][_0x638f('0x13')]===0x1f4){logger[_0x638f('0x12')](_0x638f('0xd'),_0x4baaeb,_0xf66883[_0x638f('0x12')][_0x638f('0x14')]);return _0x581bfc(_0xf66883['error'][_0x638f('0x14')]);}logger[_0x638f('0x12')]('Schedule,\x20%s,\x20%s',_0x4baaeb,_0xf66883[_0x638f('0x12')][_0x638f('0x14')]);return _0x36391f(_0xf66883['error'][_0x638f('0x14')]);}else{logger[_0x638f('0x15')]('Schedule,\x20%s,\x20%s',_0x4baaeb,_0x638f('0xe'));_0x36391f(_0xf66883[_0x638f('0x16')][_0x638f('0x14')]);}})[_0x638f('0x17')](function(_0x2484a4){logger[_0x638f('0x12')](_0x638f('0xd'),_0x4baaeb,_0x2484a4);_0x581bfc(_0x2484a4);});});} \ No newline at end of file +var _0xeafa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x1e2f27,_0x1f40f3){var _0x538a96=function(_0x1ae561){while(--_0x1ae561){_0x1e2f27['push'](_0x1e2f27['shift']());}};_0x538a96(++_0x1f40f3);}(_0xeafa,0x133));var _0xaeaf=function(_0x4541c8,_0x19be87){_0x4541c8=_0x4541c8-0x0;var _0x1065d8=_0xeafa[_0x4541c8];return _0x1065d8;};'use strict';var _=require(_0xaeaf('0x0'));var util=require(_0xaeaf('0x1'));var moment=require('moment');var BPromise=require(_0xaeaf('0x2'));var rs=require(_0xaeaf('0x3'));var fs=require('fs');var Redis=require(_0xaeaf('0x4'));var db=require(_0xaeaf('0x5'))['db'];var utils=require(_0xaeaf('0x6'));var logger=require('../../config/logger')(_0xaeaf('0x7'));var config=require(_0xaeaf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaeaf('0x9')][_0xaeaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a119b,_0x10cda3,_0x40b7e5){return new BPromise(function(_0x322f21,_0x49ad5b){return client[_0xaeaf('0xb')](_0x5a119b,_0x40b7e5)[_0xaeaf('0xc')](function(_0x1125ff){logger[_0xaeaf('0xd')](_0xaeaf('0xe'),_0x10cda3,_0xaeaf('0xf'));logger[_0xaeaf('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x10cda3,_0xaeaf('0xf'),JSON[_0xaeaf('0x11')](_0x1125ff));if(_0x1125ff[_0xaeaf('0x12')]){if(_0x1125ff[_0xaeaf('0x12')]['code']===0x1f4){logger[_0xaeaf('0x12')](_0xaeaf('0xe'),_0x10cda3,_0x1125ff[_0xaeaf('0x12')][_0xaeaf('0x13')]);return _0x49ad5b(_0x1125ff[_0xaeaf('0x12')][_0xaeaf('0x13')]);}logger[_0xaeaf('0x12')]('Schedule,\x20%s,\x20%s',_0x10cda3,_0x1125ff[_0xaeaf('0x12')][_0xaeaf('0x13')]);return _0x322f21(_0x1125ff[_0xaeaf('0x12')]['message']);}else{logger[_0xaeaf('0xd')](_0xaeaf('0xe'),_0x10cda3,_0xaeaf('0xf'));_0x322f21(_0x1125ff[_0xaeaf('0x14')][_0xaeaf('0x13')]);}})[_0xaeaf('0x15')](function(_0x112ac4){logger[_0xaeaf('0x12')](_0xaeaf('0xe'),_0x10cda3,_0x112ac4);_0x49ad5b(_0x112ac4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8d5b6ce..12f51e9 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd16=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd16,0xfa));var _0x6fd1=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xfd16[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require('multer');var util=require(_0x6fd1('0x0'));var path=require(_0x6fd1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6fd1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6fd1('0x3'));var interaction=require(_0x6fd1('0x4'));var config=require(_0x6fd1('0x5'));var controller=require(_0x6fd1('0x6'));router[_0x6fd1('0x7')]('/',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0x9')]);router[_0x6fd1('0x7')]('/describe',auth[_0x6fd1('0x8')](),controller['describe']);router[_0x6fd1('0x7')](_0x6fd1('0xa'),auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xb')]);router[_0x6fd1('0x7')](_0x6fd1('0xc'),auth['isAuthenticated'](),controller[_0x6fd1('0xd')]);router['post']('/',auth[_0x6fd1('0x8')](),controller[_0x6fd1('0xe')]);router[_0x6fd1('0xf')](_0x6fd1('0xa'),auth['isAuthenticated'](),controller[_0x6fd1('0x10')]);router['delete'](_0x6fd1('0xa'),auth[_0x6fd1('0x8')](),controller['destroy']);module[_0x6fd1('0x11')]=router; \ No newline at end of file +var _0x3757=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','download','post','create','delete','destroy'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3757,0x1a4));var _0x7375=function(_0x4b64c5,_0x433190){_0x4b64c5=_0x4b64c5-0x0;var _0x26a98d=_0x3757[_0x4b64c5];return _0x26a98d;};'use strict';var multer=require(_0x7375('0x0'));var util=require(_0x7375('0x1'));var path=require(_0x7375('0x2'));var timeout=require(_0x7375('0x3'));var express=require(_0x7375('0x4'));var router=express['Router']();var fs_extra=require(_0x7375('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7375('0x6'));var config=require(_0x7375('0x7'));var controller=require(_0x7375('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7375('0x9')]);router[_0x7375('0xa')](_0x7375('0xb'),auth[_0x7375('0xc')](),controller[_0x7375('0xd')]);router[_0x7375('0xa')](_0x7375('0xe'),auth[_0x7375('0xc')](),controller['show']);router[_0x7375('0xa')](_0x7375('0xf'),auth[_0x7375('0xc')](),controller[_0x7375('0x10')]);router[_0x7375('0x11')]('/',auth[_0x7375('0xc')](),controller[_0x7375('0x12')]);router['put'](_0x7375('0xe'),auth[_0x7375('0xc')](),controller['update']);router[_0x7375('0x13')]('/:id',auth[_0x7375('0xc')](),controller[_0x7375('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 22a85d8..371161c 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c77=['value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','startedAt','format','MM-DD-YYYY\x20HH:mm','DATE','toString','createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL'];(function(_0x37f85a,_0x240e20){var _0x190eeb=function(_0x2ae374){while(--_0x2ae374){_0x37f85a['push'](_0x37f85a['shift']());}};_0x190eeb(++_0x240e20);}(_0x1c77,0xed));var _0x71c7=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x1c77[_0x25a42a];return _0x1129b1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x71c7('0x0'));var path=require(_0x71c7('0x1'));var config=require(_0x71c7('0x2'));module[_0x71c7('0x3')]={'format':{'type':Sequelize[_0x71c7('0x4')],'get':function(){return this['getDataValue'](_0x71c7('0x5'))?path[_0x71c7('0x6')](this[_0x71c7('0x7')](_0x71c7('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x71c7('0x8')]},'channel':{'type':Sequelize[_0x71c7('0x8')]},'value':{'type':Sequelize[_0x71c7('0x8')],'set':function(_0x57fb10){var _0x57bbb6=_0x57fb10[_0x71c7('0x9')](/\\/g,'/');this[_0x71c7('0xa')](_0x71c7('0x5'),_0x57bbb6);}},'rating':{'type':Sequelize[_0x71c7('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x1f5fc9){this['setDataValue']('startedAt',moment()[_0x71c7('0xc')](_0x1f5fc9,'ms'));this[_0x71c7('0xa')](_0x71c7('0xd'),moment());this[_0x71c7('0xa')](_0x71c7('0xe'),_0x1f5fc9);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x71c7('0x7')](_0x71c7('0xf')))[_0x71c7('0x10')](_0x71c7('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x71c7('0x12')],'get':function(){return moment(this[_0x71c7('0x7')](_0x71c7('0xd')))[_0x71c7('0x10')](_0x71c7('0x11'))[_0x71c7('0x13')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x71c7('0x14')))[_0x71c7('0x10')](_0x71c7('0x11'))[_0x71c7('0x13')]();}},'updatedAt':{'type':Sequelize[_0x71c7('0x12')],'get':function(){return moment(this[_0x71c7('0x7')](_0x71c7('0x15')))[_0x71c7('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x71c7('0x13')]();}}}; \ No newline at end of file +var _0x88c3=['subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','path','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x88c3,0x1ee));var _0x388c=function(_0x27d99b,_0xfe7beb){_0x27d99b=_0x27d99b-0x0;var _0x1e1315=_0x88c3[_0x27d99b];return _0x1e1315;};'use strict';var Sequelize=require(_0x388c('0x0'));var moment=require('moment');var path=require(_0x388c('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x388c('0x2')],'get':function(){return this['getDataValue']('value')?path[_0x388c('0x3')](this[_0x388c('0x4')](_0x388c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x388c('0x6')]},'channel':{'type':Sequelize[_0x388c('0x6')]},'value':{'type':Sequelize[_0x388c('0x6')],'set':function(_0x5a1c0d){var _0x3e79d8=_0x5a1c0d[_0x388c('0x7')](/\\/g,'/');this[_0x388c('0x8')](_0x388c('0x5'),_0x3e79d8);}},'rating':{'type':Sequelize[_0x388c('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x388c('0x9')],'set':function(_0x2debe9){this[_0x388c('0x8')]('startedAt',moment()[_0x388c('0xa')](_0x2debe9,'ms'));this['setDataValue']('closedAt',moment());this[_0x388c('0x8')](_0x388c('0xb'),_0x2debe9);}},'startedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this[_0x388c('0x4')](_0x388c('0xd')))[_0x388c('0xe')](_0x388c('0xf'))[_0x388c('0x10')]();}},'closedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this['getDataValue']('closedAt'))['format'](_0x388c('0xf'))[_0x388c('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x388c('0x4')](_0x388c('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0x388c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this[_0x388c('0x4')]('updatedAt'))[_0x388c('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x388c('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 647bb97..efa5332 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x18fe54,_0xff789){_0x18fe54=_0x18fe54-0x0;var _0xccb1ee=_0xd0bb[_0x18fe54];return _0xccb1ee;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));}; \ No newline at end of file +var _0x7bae=['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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x1b701a,_0x126512){var _0xb92894=function(_0x17f1be){while(--_0x17f1be){_0x1b701a['push'](_0x1b701a['shift']());}};_0xb92894(++_0x126512);}(_0x7bae,0x13b));var _0xe7ba=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7bae[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3fc2bce..f4c58a9 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97b2=['bluebird','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x97b2,0x174));var _0x297b=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x97b2[_0x16ea87];return _0x6e7b1c;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var logger=require(_0x297b('0x2'))(_0x297b('0x3'));var moment=require(_0x297b('0x4'));var BPromise=require(_0x297b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x297b('0x6'));var config=require(_0x297b('0x7'));var attributes=require(_0x297b('0x8'));module['exports']=function(_0x42928a,_0x21158e){return _0x42928a[_0x297b('0x9')](_0x297b('0xa'),attributes,{'tableName':_0x297b('0xb'),'paranoid':![],'indexes':[{'name':_0x297b('0xc'),'fields':[_0x297b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x42f9=['interactionid','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings'];(function(_0x5ebfa6,_0x35ea00){var _0x2b4bad=function(_0x25ab3d){while(--_0x25ab3d){_0x5ebfa6['push'](_0x5ebfa6['shift']());}};_0x2b4bad(++_0x35ea00);}(_0x42f9,0x15d));var _0x942f=function(_0x1b684c,_0x4c9932){_0x1b684c=_0x1b684c-0x0;var _0x513f02=_0x42f9[_0x1b684c];return _0x513f02;};'use strict';var _=require('lodash');var util=require(_0x942f('0x0'));var logger=require('../../config/logger')(_0x942f('0x1'));var moment=require('moment');var BPromise=require(_0x942f('0x2'));var rp=require(_0x942f('0x3'));var fs=require('fs');var path=require(_0x942f('0x4'));var rimraf=require(_0x942f('0x5'));var config=require(_0x942f('0x6'));var attributes=require(_0x942f('0x7'));module[_0x942f('0x8')]=function(_0x449487,_0x398028){return _0x449487['define'](_0x942f('0x9'),attributes,{'tableName':_0x942f('0xa'),'paranoid':![],'indexes':[{'name':_0x942f('0xb'),'fields':[_0x942f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 56acbfa..542e5e0 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0297=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring'];(function(_0x2f8749,_0x7aa1ee){var _0x552837=function(_0x509a38){while(--_0x509a38){_0x2f8749['push'](_0x2f8749['shift']());}};_0x552837(++_0x7aa1ee);}(_0x0297,0xa5));var _0x7029=function(_0x3abea2,_0x42b714){_0x3abea2=_0x3abea2-0x0;var _0x1522c3=_0x0297[_0x3abea2];return _0x1522c3;};'use strict';var _=require(_0x7029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7029('0x1'));var rs=require(_0x7029('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7029('0x3'));var logger=require(_0x7029('0x4'))(_0x7029('0x5'));var config=require(_0x7029('0x6'));var jayson=require(_0x7029('0x7'));var client=jayson['client'][_0x7029('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4be368,_0x58b953,_0x55a73c){return new BPromise(function(_0xbb437,_0x36cf67){return client[_0x7029('0x9')](_0x4be368,_0x55a73c)[_0x7029('0xa')](function(_0x75136){logger[_0x7029('0xb')](_0x7029('0xc'),_0x58b953,_0x7029('0xd'));logger[_0x7029('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x58b953,'request\x20sent',JSON[_0x7029('0xf')](_0x75136));if(_0x75136[_0x7029('0x10')]){if(_0x75136['error'][_0x7029('0x11')]===0x1f4){logger[_0x7029('0x10')](_0x7029('0xc'),_0x58b953,_0x75136[_0x7029('0x10')][_0x7029('0x12')]);return _0x36cf67(_0x75136[_0x7029('0x10')][_0x7029('0x12')]);}logger[_0x7029('0x10')](_0x7029('0xc'),_0x58b953,_0x75136[_0x7029('0x10')][_0x7029('0x12')]);return _0xbb437(_0x75136[_0x7029('0x10')]['message']);}else{logger[_0x7029('0xb')](_0x7029('0xc'),_0x58b953,_0x7029('0xd'));_0xbb437(_0x75136[_0x7029('0x13')][_0x7029('0x12')]);}})[_0x7029('0x14')](function(_0x5323ea){logger[_0x7029('0x10')](_0x7029('0xc'),_0x58b953,_0x5323ea);_0x36cf67(_0x5323ea);});});} \ No newline at end of file +var _0x2852=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment'];(function(_0x521b61,_0x47e2b4){var _0x476cdf=function(_0xbca2ca){while(--_0xbca2ca){_0x521b61['push'](_0x521b61['shift']());}};_0x476cdf(++_0x47e2b4);}(_0x2852,0xf4));var _0x2285=function(_0x1c85d4,_0x41da14){_0x1c85d4=_0x1c85d4-0x0;var _0x273da8=_0x2852[_0x1c85d4];return _0x273da8;};'use strict';var _=require(_0x2285('0x0'));var util=require(_0x2285('0x1'));var moment=require(_0x2285('0x2'));var BPromise=require(_0x2285('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2285('0x4'));var db=require(_0x2285('0x5'))['db'];var utils=require(_0x2285('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2285('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2285('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326873,_0x42324b,_0x59a77f){return new BPromise(function(_0x473cfd,_0x32e81e){return client[_0x2285('0x9')](_0x326873,_0x59a77f)[_0x2285('0xa')](function(_0x4313fd){logger[_0x2285('0xb')](_0x2285('0xc'),_0x42324b,_0x2285('0xd'));logger[_0x2285('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x42324b,_0x2285('0xd'),JSON['stringify'](_0x4313fd));if(_0x4313fd['error']){if(_0x4313fd[_0x2285('0xf')][_0x2285('0x10')]===0x1f4){logger[_0x2285('0xf')](_0x2285('0xc'),_0x42324b,_0x4313fd[_0x2285('0xf')][_0x2285('0x11')]);return _0x32e81e(_0x4313fd['error']['message']);}logger[_0x2285('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x42324b,_0x4313fd['error'][_0x2285('0x11')]);return _0x473cfd(_0x4313fd[_0x2285('0xf')][_0x2285('0x11')]);}else{logger[_0x2285('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x42324b,_0x2285('0xd'));_0x473cfd(_0x4313fd['result']['message']);}})[_0x2285('0x12')](function(_0x1926c2){logger[_0x2285('0xf')](_0x2285('0xc'),_0x42324b,_0x1926c2);_0x32e81e(_0x1926c2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 1ec61a0..09f54da 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53c4=['server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','addLogoLogin','preferred','addPreferred','/:id/favicon','addFavicon','put','/:id','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','diskStorage','join','root'];(function(_0x1678d7,_0x3a36d4){var _0x591741=function(_0x150e20){while(--_0x150e20){_0x1678d7['push'](_0x1678d7['shift']());}};_0x591741(++_0x3a36d4);}(_0x53c4,0xae));var _0x453c=function(_0x4f4934,_0x614c32){_0x4f4934=_0x4f4934-0x0;var _0x48446d=_0x53c4[_0x4f4934];return _0x48446d;};'use strict';var multer=require(_0x453c('0x0'));var util=require(_0x453c('0x1'));var path=require('path');var timeout=require(_0x453c('0x2'));var express=require(_0x453c('0x3'));var router=express['Router']();var fs_extra=require(_0x453c('0x4'));var auth=require(_0x453c('0x5'));var interaction=require(_0x453c('0x6'));var config=require(_0x453c('0x7'));var controller=require('./setting.controller');router[_0x453c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x453c('0x8')](_0x453c('0x9'),controller[_0x453c('0xa')]);router[_0x453c('0x8')]('/:id',controller['show']);router['get'](_0x453c('0xb'),controller[_0x453c('0xc')]);router[_0x453c('0x8')](_0x453c('0xd'),controller[_0x453c('0xe')]);router[_0x453c('0x8')]('/:id/gdpr',controller[_0x453c('0xf')]);router[_0x453c('0x8')](_0x453c('0x10'),controller[_0x453c('0x11')]);router['get']('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x453c('0x12')]({'destination':function(_0x464aee,_0x6c35a1,_0xc8fab8){_0xc8fab8(null,path[_0x453c('0x13')](config[_0x453c('0x14')],_0x453c('0x15')));},'filename':function(_0x225740,_0x4ba1f6,_0x32c974){_0x32c974(null,util[_0x453c('0x16')](_0x453c('0x17'),_0x453c('0x18'),path[_0x453c('0x19')](_0x4ba1f6[_0x453c('0x1a')])));}})});router[_0x453c('0x1b')]('/:id/logo',upload[_0x453c('0x1c')](_0x453c('0x1d')),controller[_0x453c('0x1e')]);var upload=multer({'storage':multer[_0x453c('0x12')]({'destination':function(_0x1947cc,_0x1a223f,_0x1f3eec){_0x1f3eec(null,path[_0x453c('0x13')](config['root'],_0x453c('0x15')));},'filename':function(_0x45130c,_0x5af686,_0x2992ec){_0x2992ec(null,util[_0x453c('0x16')](_0x453c('0x17'),'logologin',path['extname'](_0x5af686[_0x453c('0x1a')])));}})});router[_0x453c('0x1b')](_0x453c('0xd'),upload['single'](_0x453c('0x1d')),controller[_0x453c('0x1f')]);var upload=multer({'storage':multer[_0x453c('0x12')]({'destination':function(_0x4678e9,_0x37b6c8,_0x55080e){_0x55080e(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x33819c,_0x5e4d30,_0x4a629b){_0x4a629b(null,util['format'](_0x453c('0x17'),_0x453c('0x20'),path['extname'](_0x5e4d30[_0x453c('0x1a')])));}})});router[_0x453c('0x1b')](_0x453c('0x10'),upload['single']('file'),controller[_0x453c('0x21')]);var upload=multer({'storage':multer[_0x453c('0x12')]({'destination':function(_0x1a0dd9,_0x3e91cb,_0x595f13){_0x595f13(null,path[_0x453c('0x13')](config[_0x453c('0x14')],_0x453c('0x15')));},'filename':function(_0x3e8cfe,_0x5293b8,_0x21d89c){_0x21d89c(null,util[_0x453c('0x16')](_0x453c('0x17'),'favicon',path[_0x453c('0x19')](_0x5293b8[_0x453c('0x1a')])));}})});router[_0x453c('0x1b')](_0x453c('0x22'),upload[_0x453c('0x1c')]('file'),controller[_0x453c('0x23')]);router[_0x453c('0x24')](_0x453c('0x25'),auth['isAuthenticated'](),controller['update']);module[_0x453c('0x26')]=router; \ No newline at end of file +var _0x4cc1=['extname','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','./setting.controller','get','isAuthenticated','/now','getDate','/:id','getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','single','file','addLogo','logologin'];(function(_0x569025,_0x685ff3){var _0x555208=function(_0x402782){while(--_0x402782){_0x569025['push'](_0x569025['shift']());}};_0x555208(++_0x685ff3);}(_0x4cc1,0x151));var _0x14cc=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x4cc1[_0x3817a9];return _0x443f30;};'use strict';var multer=require(_0x14cc('0x0'));var util=require(_0x14cc('0x1'));var path=require(_0x14cc('0x2'));var timeout=require(_0x14cc('0x3'));var express=require('express');var router=express[_0x14cc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x14cc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x14cc('0x6'));router[_0x14cc('0x7')]('/',auth[_0x14cc('0x8')](),controller['index']);router[_0x14cc('0x7')](_0x14cc('0x9'),controller[_0x14cc('0xa')]);router['get'](_0x14cc('0xb'),controller['show']);router[_0x14cc('0x7')]('/:id/logo',controller[_0x14cc('0xc')]);router['get']('/:id/logo_login',controller[_0x14cc('0xd')]);router[_0x14cc('0x7')]('/:id/gdpr',controller[_0x14cc('0xe')]);router[_0x14cc('0x7')](_0x14cc('0xf'),controller[_0x14cc('0x10')]);router[_0x14cc('0x7')](_0x14cc('0x11'),controller[_0x14cc('0x12')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x15a0ba,_0xea64c3,_0x5647af){_0x5647af(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0xfc4d0d,_0x39a436,_0x123c38){_0x123c38(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x19'),path['extname'](_0x39a436[_0x14cc('0x1a')])));}})});router[_0x14cc('0x1b')]('/:id/logo',upload[_0x14cc('0x1c')](_0x14cc('0x1d')),controller[_0x14cc('0x1e')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x58628e,_0x195f59,_0x5430b4){_0x5430b4(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0x28bc19,_0x461a9b,_0x45f9c7){_0x45f9c7(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x1f'),path[_0x14cc('0x20')](_0x461a9b['originalname'])));}})});router[_0x14cc('0x1b')](_0x14cc('0x21'),upload['single'](_0x14cc('0x1d')),controller[_0x14cc('0x22')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x400787,_0x2ae250,_0x416cdb){_0x416cdb(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0x33d1e9,_0x29bcbb,_0x176664){_0x176664(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x23'),path[_0x14cc('0x20')](_0x29bcbb[_0x14cc('0x1a')])));}})});router[_0x14cc('0x1b')](_0x14cc('0xf'),upload[_0x14cc('0x1c')](_0x14cc('0x1d')),controller[_0x14cc('0x24')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x17361c,_0xafa697,_0x1576d1){_0x1576d1(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0x3d499a,_0x4c59d7,_0x5749aa){_0x5749aa(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x25'),path[_0x14cc('0x20')](_0x4c59d7[_0x14cc('0x1a')])));}})});router['post'](_0x14cc('0x11'),upload['single'](_0x14cc('0x1d')),controller[_0x14cc('0x26')]);router[_0x14cc('0x27')](_0x14cc('0xb'),auth[_0x14cc('0x8')](),controller[_0x14cc('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7d48921..e51eb45 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xe251e,_0xe81141){var _0x4e1c98=function(_0x20e3f1){while(--_0x20e3f1){_0xe251e['push'](_0xe251e['shift']());}};_0x4e1c98(++_0xe81141);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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(_0x526a25,_0x38323f){var _0x361e04=function(_0x194f43){while(--_0x194f43){_0x526a25['push'](_0x526a25['shift']());}};_0x361e04(++_0x38323f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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 diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8e58c58..7dd3006 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71ec=['count','set','Content-Range','apply','reject','save','update','name','Setting','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','length','find','catch','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','download','getLogoLogin','server/files/images/logos','defaultLoginLogo','default_loginLogo.svg','custom','\x20not\x20found','securePassword','addPreferred','getPreferred','getLicense','default_preferred.png','addFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x1653bb,_0x2575c5){var _0x4f9850=function(_0x1392ce){while(--_0x1392ce){_0x1653bb['push'](_0x1653bb['shift']());}};_0x4f9850(++_0x2575c5);}(_0x71ec,0x13d));var _0xc71e=function(_0x3cba1d,_0x2825ae){_0x3cba1d=_0x3cba1d-0x0;var _0x5f192b=_0x71ec[_0x3cba1d];return _0x5f192b;};'use strict';var emlformat=require(_0xc71e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc71e('0x1'));var jsonpatch=require(_0xc71e('0x2'));var rp=require(_0xc71e('0x3'));var moment=require(_0xc71e('0x4'));var BPromise=require(_0xc71e('0x5'));var Mustache=require('mustache');var util=require(_0xc71e('0x6'));var path=require(_0xc71e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc71e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc71e('0x9'));var squel=require(_0xc71e('0xa'));var crypto=require(_0xc71e('0xb'));var jsforce=require(_0xc71e('0xc'));var deskjs=require(_0xc71e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc71e('0xe'));var Papa=require(_0xc71e('0xf'));var Redis=require(_0xc71e('0x10'));var authService=require(_0xc71e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc71e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc71e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc71e('0x14'));var db=require(_0xc71e('0x15'))['db'];var jayson=require(_0xc71e('0x16'));var client=jayson[_0xc71e('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48c93c,_0x2b9281,_0x1bb164,_0x4c0914){return new BPromise(function(_0x1394d2,_0x56bf08){var _0x59d45f=_0x4c0914||client;return _0x59d45f[_0xc71e('0x18')](_0x48c93c,_0x1bb164)[_0xc71e('0x19')](function(_0x5d6cbf){logger['info'](_0xc71e('0x1a'),_0x2b9281,_0xc71e('0x1b'));logger[_0xc71e('0x1c')](_0xc71e('0x1d'),_0x2b9281,_0xc71e('0x1b'),JSON[_0xc71e('0x1e')](_0x5d6cbf));if(_0x5d6cbf[_0xc71e('0x1f')]){if(_0x5d6cbf[_0xc71e('0x1f')][_0xc71e('0x20')]===0x1f4){logger[_0xc71e('0x1f')]('Setting,\x20%s,\x20%s',_0x2b9281,_0x5d6cbf['error'][_0xc71e('0x21')]);return _0x56bf08(_0x5d6cbf[_0xc71e('0x1f')][_0xc71e('0x21')]);}logger[_0xc71e('0x1f')]('Setting,\x20%s,\x20%s',_0x2b9281,_0x5d6cbf[_0xc71e('0x1f')]['message']);return _0x1394d2(_0x5d6cbf['error'][_0xc71e('0x21')]);}else{logger[_0xc71e('0x22')](_0xc71e('0x1a'),_0x2b9281,_0xc71e('0x1b'));_0x1394d2(_0x5d6cbf[_0xc71e('0x23')][_0xc71e('0x21')]);}})['catch'](function(_0x1ea7a7){logger['error'](_0xc71e('0x1a'),_0x2b9281,_0x1ea7a7);_0x56bf08(_0x1ea7a7);});});}function respondWithStatusCode(_0x30e291,_0x4eef41){_0x4eef41=_0x4eef41||0xcc;return function(_0x3341ea){if(_0x3341ea){return _0x30e291[_0xc71e('0x24')](_0x4eef41);}return _0x30e291[_0xc71e('0x25')](_0x4eef41)[_0xc71e('0x26')]();};}function respondWithResult(_0x4e309d,_0x340a1e){_0x340a1e=_0x340a1e||0xc8;return function(_0x422f6f){if(_0x422f6f){return _0x4e309d[_0xc71e('0x25')](_0x340a1e)[_0xc71e('0x27')](_0x422f6f);}};}function respondWithFilteredResult(_0x1dd34d,_0x595aba){return function(_0x1b7604){if(_0x1b7604){var _0x1a38ac=typeof _0x595aba[_0xc71e('0x28')]==='undefined'&&typeof _0x595aba[_0xc71e('0x29')]===_0xc71e('0x2a');var _0x52e6d9=_0x1b7604[_0xc71e('0x2b')];var _0x52f712=_0x1a38ac?0x0:_0x595aba[_0xc71e('0x28')];var _0xb3f06a=_0x1a38ac?_0x1b7604['count']:_0x595aba[_0xc71e('0x28')]+_0x595aba['limit'];var _0x20e474;if(_0xb3f06a>=_0x52e6d9){_0xb3f06a=_0x52e6d9;_0x20e474=0xc8;}else{_0x20e474=0xce;}_0x1dd34d[_0xc71e('0x25')](_0x20e474);return _0x1dd34d[_0xc71e('0x2c')](_0xc71e('0x2d'),_0x52f712+'-'+_0xb3f06a+'/'+_0x52e6d9)[_0xc71e('0x27')](_0x1b7604);}return null;};}function patchUpdates(_0x4b2ccf){return function(_0x3bb1d7){try{jsonpatch[_0xc71e('0x2e')](_0x3bb1d7,_0x4b2ccf,!![]);}catch(_0x2cab3a){return BPromise[_0xc71e('0x2f')](_0x2cab3a);}return _0x3bb1d7[_0xc71e('0x30')]();};}function saveUpdates(_0x3d8f7b,_0x464de0){return function(_0x31886e){if(_0x31886e){return _0x31886e[_0xc71e('0x31')](_0x3d8f7b)[_0xc71e('0x19')](function(_0xa8e535){return _0xa8e535;});}return null;};}function removeEntity(_0x50736f,_0x59ce27){return function(_0xdac51e){if(_0xdac51e){return _0xdac51e['destroy']()[_0xc71e('0x19')](function(){_0x50736f['status'](0xcc)[_0xc71e('0x26')]();});}};}function handleEntityNotFound(_0x55969e,_0x31e262){return function(_0x41d012){if(!_0x41d012){_0x55969e[_0xc71e('0x24')](0x194);}return _0x41d012;};}function handleError(_0x385150,_0x113e2e){_0x113e2e=_0x113e2e||0x1f4;return function(_0x512fb2){logger[_0xc71e('0x1f')](_0x512fb2['stack']);if(_0x512fb2['name']){delete _0x512fb2[_0xc71e('0x32')];}_0x385150[_0xc71e('0x25')](_0x113e2e)['send'](_0x512fb2);};}exports['index']=function(_0x2c03a7,_0xad6e7f){var _0x1a795a={},_0x3d543c={},_0xe35b35={'count':0x0,'rows':[]};var _0x2adbf3=_['map'](db[_0xc71e('0x33')]['rawAttributes'],function(_0x51d4b8){return{'name':_0x51d4b8[_0xc71e('0x34')],'type':_0x51d4b8[_0xc71e('0x35')][_0xc71e('0x36')]};});_0x3d543c[_0xc71e('0x37')]=_['map'](_0x2adbf3,'name');_0x3d543c[_0xc71e('0x38')]=_[_0xc71e('0x39')](_0x2c03a7['query']);_0x3d543c['filters']=_[_0xc71e('0x3a')](_0x3d543c[_0xc71e('0x37')],_0x3d543c[_0xc71e('0x38')]);_0x1a795a[_0xc71e('0x3b')]=_[_0xc71e('0x3a')](_0x3d543c[_0xc71e('0x37')],qs['fields'](_0x2c03a7[_0xc71e('0x38')][_0xc71e('0x3c')]));_0x1a795a[_0xc71e('0x3b')]=_0x1a795a[_0xc71e('0x3b')]['length']?_0x1a795a['attributes']:_0x3d543c[_0xc71e('0x37')];if(!_0x2c03a7[_0xc71e('0x38')][_0xc71e('0x3d')](_0xc71e('0x3e'))){_0x1a795a['limit']=qs['limit'](_0x2c03a7['query'][_0xc71e('0x29')]);_0x1a795a['offset']=qs['offset'](_0x2c03a7['query'][_0xc71e('0x28')]);}_0x1a795a[_0xc71e('0x3f')]=qs[_0xc71e('0x40')](_0x2c03a7[_0xc71e('0x38')][_0xc71e('0x40')]);_0x1a795a[_0xc71e('0x41')]=qs[_0xc71e('0x42')](_['pick'](_0x2c03a7[_0xc71e('0x38')],_0x3d543c['filters']),_0x2adbf3);if(_0x2c03a7[_0xc71e('0x38')][_0xc71e('0x43')]){_0x1a795a[_0xc71e('0x41')]=_[_0xc71e('0x44')](_0x1a795a[_0xc71e('0x41')],{'$or':_['map'](_0x2adbf3,function(_0x551a7b){if(_0x551a7b[_0xc71e('0x35')]!==_0xc71e('0x45')){var _0x114d1d={};_0x114d1d[_0x551a7b[_0xc71e('0x32')]]={'$like':'%'+_0x2c03a7[_0xc71e('0x38')][_0xc71e('0x43')]+'%'};return _0x114d1d;}})});}_0x1a795a=_['merge']({},_0x1a795a,_0x2c03a7[_0xc71e('0x46')]);var _0x1524e7={'where':_0x1a795a['where']};return db[_0xc71e('0x33')][_0xc71e('0x2b')](_0x1524e7)['then'](function(_0x41ef9f){_0xe35b35[_0xc71e('0x2b')]=_0x41ef9f;if(_0x2c03a7[_0xc71e('0x38')][_0xc71e('0x47')]){_0x1a795a['include']=[{'all':!![]}];}return db[_0xc71e('0x33')][_0xc71e('0x48')](_0x1a795a);})[_0xc71e('0x19')](function(_0x57a38a){_0xe35b35[_0xc71e('0x49')]=_0x57a38a;return _0xe35b35;})[_0xc71e('0x19')](respondWithFilteredResult(_0xad6e7f,_0x1a795a))['catch'](handleError(_0xad6e7f,null));};exports[_0xc71e('0x4a')]=function(_0xb3ed9d,_0xe216f6){var _0x45baea={'raw':![],'where':{'id':_0xb3ed9d['params']['id']}},_0xf25975={};_0xf25975[_0xc71e('0x37')]=_[_0xc71e('0x39')](db[_0xc71e('0x33')][_0xc71e('0x4b')]);_0xf25975[_0xc71e('0x38')]=_['keys'](_0xb3ed9d[_0xc71e('0x38')]);_0xf25975[_0xc71e('0x42')]=_[_0xc71e('0x3a')](_0xf25975['model'],_0xf25975[_0xc71e('0x38')]);_0x45baea['attributes']=_[_0xc71e('0x3a')](_0xf25975[_0xc71e('0x37')],qs['fields'](_0xb3ed9d[_0xc71e('0x38')][_0xc71e('0x3c')]));_0x45baea[_0xc71e('0x3b')]=_0x45baea[_0xc71e('0x3b')][_0xc71e('0x4c')]?_0x45baea['attributes']:_0xf25975[_0xc71e('0x37')];if(_0xb3ed9d[_0xc71e('0x38')][_0xc71e('0x47')]){_0x45baea['include']=[{'all':!![]}];}_0x45baea=_[_0xc71e('0x44')]({},_0x45baea,_0xb3ed9d[_0xc71e('0x46')]);return db[_0xc71e('0x33')][_0xc71e('0x4d')](_0x45baea)[_0xc71e('0x19')](handleEntityNotFound(_0xe216f6,null))[_0xc71e('0x19')](respondWithResult(_0xe216f6,null))[_0xc71e('0x4e')](handleError(_0xe216f6,null));};exports[_0xc71e('0x31')]=function(_0xd93bbb,_0x115714){if(_0xd93bbb[_0xc71e('0x4f')]['id']){delete _0xd93bbb[_0xc71e('0x4f')]['id'];}return db['Setting'][_0xc71e('0x4d')]({'where':{'id':_0xd93bbb[_0xc71e('0x50')]['id']}})[_0xc71e('0x19')](handleEntityNotFound(_0x115714,null))[_0xc71e('0x19')](saveUpdates(_0xd93bbb['body'],null))['then'](respondWithResult(_0x115714,null))[_0xc71e('0x4e')](handleError(_0x115714,null));};exports[_0xc71e('0x51')]=function(_0x171b89,_0x523030,_0x186a7){if(_0x171b89[_0xc71e('0x52')]&&_0x171b89['file'][_0xc71e('0x53')]){_0x171b89[_0xc71e('0x4f')][_0xc71e('0x54')]=_0x171b89[_0xc71e('0x52')]['filename'];}return db['Setting'][_0xc71e('0x4d')]({'where':{'id':_0x171b89[_0xc71e('0x50')]['id']}})[_0xc71e('0x19')](handleEntityNotFound(_0x523030,null))[_0xc71e('0x19')](saveUpdates(_0x171b89[_0xc71e('0x4f')],null))['then'](respondWithResult(_0x523030,null))[_0xc71e('0x4e')](handleError(_0x523030,null));};exports[_0xc71e('0x55')]=function(_0x368f89,_0x52e18d,_0x3a9c54){if(_0x368f89[_0xc71e('0x52')]&&_0x368f89[_0xc71e('0x52')][_0xc71e('0x53')]){_0x368f89['body'][_0xc71e('0x56')]=_0x368f89['file'][_0xc71e('0x53')];}return db[_0xc71e('0x33')]['find']({'where':{'id':_0x368f89[_0xc71e('0x50')]['id']}})['then'](handleEntityNotFound(_0x52e18d,null))['then'](saveUpdates(_0x368f89[_0xc71e('0x4f')],null))[_0xc71e('0x19')](respondWithResult(_0x52e18d,null))[_0xc71e('0x4e')](handleError(_0x52e18d,null));};var utilLicense=require(_0xc71e('0x14'));exports[_0xc71e('0x57')]=function(_0x5c506d,_0x2d1c8e,_0x47baca){var _0x517f09='server/files/images/logos';var _0xb7a259={'custom':![]};return utilLicense['getLicense']()[_0xc71e('0x19')](function(_0x1c7a91){if(_0x1c7a91){_0xb7a259=_0x1c7a91;}return db['Setting'][_0xc71e('0x4d')]({'where':{'id':_0x5c506d[_0xc71e('0x50')]['id']},'attributes':['logo',_0xc71e('0x56'),_0xc71e('0x58'),_0xc71e('0x59'),_0xc71e('0x5a'),'defaultLoginLogo',_0xc71e('0x5b'),_0xc71e('0x5c')],'raw':!![]});})[_0xc71e('0x19')](handleEntityNotFound(_0x2d1c8e,null))[_0xc71e('0x19')](function(_0x58bd0d){if(_0x58bd0d){var _0x13c5ca=_0x58bd0d[_0xc71e('0x54')]&&fs[_0xc71e('0x5d')](path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x517f09,_[_0xc71e('0x60')](_0x58bd0d['logo'])))?path['join'](config[_0xc71e('0x5f')],_0x517f09,_['toLower'](_0x58bd0d[_0xc71e('0x54')])):path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x517f09,_[_0xc71e('0x60')](_0xc71e('0x61')));var _0x4dd55a=_0xc71e('0x62')+_[_0xc71e('0x63')](_0xc71e('0x54'));if(_0x58bd0d[_0x4dd55a]||!_0xb7a259['custom']){_0x13c5ca=path[_0xc71e('0x5e')](config['root'],_0x517f09,_['toLower'](_0xc71e('0x61')));}if(!fs[_0xc71e('0x5d')](_0x13c5ca)){throw new db[(_0xc71e('0x64'))][(_0xc71e('0x65'))](_[_0xc71e('0x63')](_0xc71e('0x54'))+'\x20not\x20found');}return _0x2d1c8e[_0xc71e('0x66')](_0x13c5ca);}})[_0xc71e('0x4e')](handleError(_0x2d1c8e,null));};var utilLicense=require(_0xc71e('0x14'));exports[_0xc71e('0x67')]=function(_0x3b7195,_0x1f0119,_0x5ddcb9){var _0x21c1d5=_0xc71e('0x68');var _0x1341e5={'custom':![]};return utilLicense['getLicense']()[_0xc71e('0x19')](function(_0x5a4b3b){if(_0x5a4b3b){_0x1341e5=_0x5a4b3b;}return db[_0xc71e('0x33')][_0xc71e('0x4d')]({'where':{'id':_0x3b7195['params']['id']},'attributes':[_0xc71e('0x54'),_0xc71e('0x56'),'preferred',_0xc71e('0x59'),_0xc71e('0x5a'),_0xc71e('0x69'),'defaultPreferred',_0xc71e('0x5c')],'raw':!![]});})[_0xc71e('0x19')](handleEntityNotFound(_0x1f0119,null))[_0xc71e('0x19')](function(_0x4e3125){if(_0x4e3125){var _0x77c45f=_0x4e3125[_0xc71e('0x56')]&&fs[_0xc71e('0x5d')](path[_0xc71e('0x5e')](config['root'],_0x21c1d5,_[_0xc71e('0x60')](_0x4e3125['loginLogo'])))?path['join'](config[_0xc71e('0x5f')],_0x21c1d5,_[_0xc71e('0x60')](_0x4e3125[_0xc71e('0x56')])):path['join'](config[_0xc71e('0x5f')],_0x21c1d5,_[_0xc71e('0x60')](_0xc71e('0x6a')));var _0xf8c756=_0xc71e('0x62')+_[_0xc71e('0x63')](_0xc71e('0x56'));if(_0x4e3125[_0xf8c756]||!_0x1341e5[_0xc71e('0x6b')]){_0x77c45f=path[_0xc71e('0x5e')](config['root'],_0x21c1d5,_[_0xc71e('0x60')]('default_loginLogo.svg'));}if(!fs[_0xc71e('0x5d')](_0x77c45f)){throw new db[(_0xc71e('0x64'))]['ValidationError'](_[_0xc71e('0x63')](_0xc71e('0x56'))+_0xc71e('0x6c'));}return _0x1f0119[_0xc71e('0x66')](_0x77c45f);}})[_0xc71e('0x4e')](handleError(_0x1f0119,null));};exports['gdpr']=function(_0xc9d87f,_0x4fa9cb){return db[_0xc71e('0x33')][_0xc71e('0x4d')]({'where':{'id':_0xc9d87f[_0xc71e('0x50')]['id']},'attributes':[_0xc71e('0x6d')]})[_0xc71e('0x19')](respondWithResult(_0x4fa9cb,null))[_0xc71e('0x4e')](handleError(_0x4fa9cb,null));};exports[_0xc71e('0x6e')]=function(_0x49f981,_0x43f586,_0x24616f){if(_0x49f981[_0xc71e('0x52')]&&_0x49f981[_0xc71e('0x52')][_0xc71e('0x53')]){_0x49f981[_0xc71e('0x4f')][_0xc71e('0x58')]=_0x49f981[_0xc71e('0x52')][_0xc71e('0x53')];}return db[_0xc71e('0x33')][_0xc71e('0x4d')]({'where':{'id':_0x49f981[_0xc71e('0x50')]['id']}})[_0xc71e('0x19')](handleEntityNotFound(_0x43f586,null))[_0xc71e('0x19')](saveUpdates(_0x49f981[_0xc71e('0x4f')],null))[_0xc71e('0x19')](respondWithResult(_0x43f586,null))[_0xc71e('0x4e')](handleError(_0x43f586,null));};var utilLicense=require(_0xc71e('0x14'));exports[_0xc71e('0x6f')]=function(_0x454225,_0x1a263c,_0x7049dc){var _0x5a8b89=_0xc71e('0x68');var _0x5cdfc8={'custom':![]};return utilLicense[_0xc71e('0x70')]()[_0xc71e('0x19')](function(_0x50e8f4){if(_0x50e8f4){_0x5cdfc8=_0x50e8f4;}return db[_0xc71e('0x33')][_0xc71e('0x4d')]({'where':{'id':_0x454225[_0xc71e('0x50')]['id']},'attributes':['logo',_0xc71e('0x56'),_0xc71e('0x58'),'favicon','defaultLogo',_0xc71e('0x69'),_0xc71e('0x5b'),_0xc71e('0x5c')],'raw':!![]});})[_0xc71e('0x19')](handleEntityNotFound(_0x1a263c,null))[_0xc71e('0x19')](function(_0x4cd9b4){if(_0x4cd9b4){var _0x48153b=_0x4cd9b4['preferred']&&fs['existsSync'](path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x5a8b89,_['toLower'](_0x4cd9b4[_0xc71e('0x58')])))?path[_0xc71e('0x5e')](config['root'],_0x5a8b89,_[_0xc71e('0x60')](_0x4cd9b4['preferred'])):path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x5a8b89,_[_0xc71e('0x60')](_0xc71e('0x71')));var _0xddd6c7=_0xc71e('0x62')+_['upperFirst'](_0xc71e('0x58'));if(_0x4cd9b4[_0xddd6c7]||!_0x5cdfc8['custom']||!_0x5cdfc8[_0xc71e('0x58')]){_0x48153b=path['join'](config['root'],_0x5a8b89,_['toLower']('default_preferred.png'));}if(!fs['existsSync'](_0x48153b)){throw new db[(_0xc71e('0x64'))][(_0xc71e('0x65'))](_[_0xc71e('0x63')]('preferred')+_0xc71e('0x6c'));}return _0x1a263c[_0xc71e('0x66')](_0x48153b);}})[_0xc71e('0x4e')](handleError(_0x1a263c,null));};exports[_0xc71e('0x72')]=function(_0x1b58ea,_0x4d7bc3,_0x582250){if(_0x1b58ea[_0xc71e('0x52')]&&_0x1b58ea[_0xc71e('0x52')]['filename']){_0x1b58ea['body'][_0xc71e('0x59')]=_0x1b58ea['file'][_0xc71e('0x53')];}return db[_0xc71e('0x33')][_0xc71e('0x4d')]({'where':{'id':_0x1b58ea[_0xc71e('0x50')]['id']}})[_0xc71e('0x19')](handleEntityNotFound(_0x4d7bc3,null))[_0xc71e('0x19')](saveUpdates(_0x1b58ea[_0xc71e('0x4f')],null))['then'](respondWithResult(_0x4d7bc3,null))[_0xc71e('0x4e')](handleError(_0x4d7bc3,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x42967b,_0x50b306,_0x6b2ecf){var _0x509cb8=_0xc71e('0x68');var _0x606e01={'custom':![]};return utilLicense[_0xc71e('0x70')]()[_0xc71e('0x19')](function(_0x3486f3){if(_0x3486f3){_0x606e01=_0x3486f3;}return db[_0xc71e('0x33')][_0xc71e('0x4d')]({'where':{'id':_0x42967b[_0xc71e('0x50')]['id']},'attributes':[_0xc71e('0x54'),_0xc71e('0x56'),_0xc71e('0x58'),_0xc71e('0x59'),_0xc71e('0x5a'),_0xc71e('0x69'),_0xc71e('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xc71e('0x19')](handleEntityNotFound(_0x50b306,null))[_0xc71e('0x19')](function(_0x322447){if(_0x322447){var _0x249bf2=_0x322447['favicon']&&fs['existsSync'](path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x509cb8,_[_0xc71e('0x60')](_0x322447['favicon'])))?path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x509cb8,_[_0xc71e('0x60')](_0x322447['favicon'])):path[_0xc71e('0x5e')](config[_0xc71e('0x5f')],_0x509cb8,_[_0xc71e('0x60')](_0xc71e('0x73')));var _0x2e9b9a=_0xc71e('0x62')+_[_0xc71e('0x63')](_0xc71e('0x59'));if(_0x322447[_0x2e9b9a]||!_0x606e01[_0xc71e('0x6b')]){_0x249bf2=path[_0xc71e('0x5e')](config['root'],_0x509cb8,_[_0xc71e('0x60')](_0xc71e('0x73')));}if(!fs['existsSync'](_0x249bf2)){throw new db['Sequelize'][(_0xc71e('0x65'))](_['upperFirst'](_0xc71e('0x59'))+'\x20not\x20found');}return _0x50b306[_0xc71e('0x66')](_0x249bf2);}})[_0xc71e('0x4e')](handleError(_0x50b306,null));};exports['getDate']=function(_0x55cffc,_0x2677a){var _0x250711={'offset':moment()[_0xc71e('0x74')]()};_0x250711['now']=moment()['utcOffset'](_0x250711[_0xc71e('0x28')])[_0xc71e('0x75')](_0xc71e('0x76'));return _0x2677a[_0xc71e('0x25')](0xc8)[_0xc71e('0x77')](_0x250711);}; \ No newline at end of file +var _0x8128=['code','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','stack','name','index','Setting','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','params','includeAll','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','upperFirst','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','now','send','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd8b86f,_0x544db1){var _0x417622=function(_0x39efd8){while(--_0x39efd8){_0xd8b86f['push'](_0xd8b86f['shift']());}};_0x417622(++_0x544db1);}(_0x8128,0x1b1));var _0x8812=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x8128[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0x8812('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8812('0x1'));var rp=require(_0x8812('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8812('0x3'));var util=require(_0x8812('0x4'));var path=require(_0x8812('0x5'));var sox=require('sox');var csv=require(_0x8812('0x6'));var ejs=require(_0x8812('0x7'));var fs=require('fs');var fs_extra=require(_0x8812('0x8'));var _=require(_0x8812('0x9'));var squel=require('squel');var crypto=require(_0x8812('0xa'));var jsforce=require(_0x8812('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8812('0xc'));var Redis=require(_0x8812('0xd'));var authService=require(_0x8812('0xe'));var qs=require(_0x8812('0xf'));var as=require(_0x8812('0x10'));var hardwareService=require(_0x8812('0x11'));var logger=require(_0x8812('0x12'))(_0x8812('0x13'));var utils=require(_0x8812('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8812('0x15'));var db=require(_0x8812('0x16'))['db'];var jayson=require(_0x8812('0x17'));var client=jayson[_0x8812('0x18')][_0x8812('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x8386f1,_0x53be83,_0x1b1ab2,_0x43bb44){return new BPromise(function(_0x589fd9,_0x557c5c){var _0x4b37fa=_0x43bb44||client;return _0x4b37fa[_0x8812('0x1a')](_0x8386f1,_0x1b1ab2)[_0x8812('0x1b')](function(_0x554ddb){logger['info']('Setting,\x20%s,\x20%s',_0x53be83,'request\x20sent');logger['debug'](_0x8812('0x1c'),_0x53be83,'request\x20sent',JSON[_0x8812('0x1d')](_0x554ddb));if(_0x554ddb['error']){if(_0x554ddb[_0x8812('0x1e')][_0x8812('0x1f')]===0x1f4){logger['error'](_0x8812('0x20'),_0x53be83,_0x554ddb[_0x8812('0x1e')][_0x8812('0x21')]);return _0x557c5c(_0x554ddb['error']['message']);}logger[_0x8812('0x1e')](_0x8812('0x20'),_0x53be83,_0x554ddb[_0x8812('0x1e')][_0x8812('0x21')]);return _0x589fd9(_0x554ddb[_0x8812('0x1e')][_0x8812('0x21')]);}else{logger['info'](_0x8812('0x20'),_0x53be83,_0x8812('0x22'));_0x589fd9(_0x554ddb[_0x8812('0x23')]['message']);}})[_0x8812('0x24')](function(_0x3fbf5a){logger['error'](_0x8812('0x20'),_0x53be83,_0x3fbf5a);_0x557c5c(_0x3fbf5a);});});}function respondWithStatusCode(_0x545ec7,_0x29572a){_0x29572a=_0x29572a||0xcc;return function(_0x16e486){if(_0x16e486){return _0x545ec7[_0x8812('0x25')](_0x29572a);}return _0x545ec7['status'](_0x29572a)[_0x8812('0x26')]();};}function respondWithResult(_0x1e1a93,_0x115215){_0x115215=_0x115215||0xc8;return function(_0x465f1f){if(_0x465f1f){return _0x1e1a93['status'](_0x115215)[_0x8812('0x27')](_0x465f1f);}};}function respondWithFilteredResult(_0x108a0f,_0x2c2420){return function(_0x2015de){if(_0x2015de){var _0x31b575=typeof _0x2c2420[_0x8812('0x28')]===_0x8812('0x29')&&typeof _0x2c2420[_0x8812('0x2a')]===_0x8812('0x29');var _0xdea554=_0x2015de['count'];var _0x501d4a=_0x31b575?0x0:_0x2c2420['offset'];var _0x53b2e1=_0x31b575?_0x2015de[_0x8812('0x2b')]:_0x2c2420[_0x8812('0x28')]+_0x2c2420[_0x8812('0x2a')];var _0x1cbc0e;if(_0x53b2e1>=_0xdea554){_0x53b2e1=_0xdea554;_0x1cbc0e=0xc8;}else{_0x1cbc0e=0xce;}_0x108a0f[_0x8812('0x2c')](_0x1cbc0e);return _0x108a0f['set'](_0x8812('0x2d'),_0x501d4a+'-'+_0x53b2e1+'/'+_0xdea554)[_0x8812('0x27')](_0x2015de);}return null;};}function patchUpdates(_0x2ca077){return function(_0x288092){try{jsonpatch['apply'](_0x288092,_0x2ca077,!![]);}catch(_0x1c557f){return BPromise[_0x8812('0x2e')](_0x1c557f);}return _0x288092[_0x8812('0x2f')]();};}function saveUpdates(_0x381fbf,_0x172afd){return function(_0xefc4cc){if(_0xefc4cc){return _0xefc4cc[_0x8812('0x30')](_0x381fbf)['then'](function(_0x1a815e){return _0x1a815e;});}return null;};}function removeEntity(_0x309ca1,_0x453ad6){return function(_0x3cc888){if(_0x3cc888){return _0x3cc888['destroy']()['then'](function(){_0x309ca1['status'](0xcc)[_0x8812('0x26')]();});}};}function handleEntityNotFound(_0x2c3672,_0x24ca05){return function(_0x4e23e5){if(!_0x4e23e5){_0x2c3672['sendStatus'](0x194);}return _0x4e23e5;};}function handleError(_0x5e7b1f,_0x36da1e){_0x36da1e=_0x36da1e||0x1f4;return function(_0x471bf2){logger['error'](_0x471bf2[_0x8812('0x31')]);if(_0x471bf2[_0x8812('0x32')]){delete _0x471bf2[_0x8812('0x32')];}_0x5e7b1f[_0x8812('0x2c')](_0x36da1e)['send'](_0x471bf2);};}exports[_0x8812('0x33')]=function(_0x20659e,_0x5287d9){var _0x5de672={},_0xe7dccd={},_0x2d8bc8={'count':0x0,'rows':[]};var _0x588460=_['map'](db[_0x8812('0x34')][_0x8812('0x35')],function(_0x4b29e8){return{'name':_0x4b29e8[_0x8812('0x36')],'type':_0x4b29e8['type']['key']};});_0xe7dccd[_0x8812('0x37')]=_[_0x8812('0x38')](_0x588460,_0x8812('0x32'));_0xe7dccd['query']=_[_0x8812('0x39')](_0x20659e[_0x8812('0x3a')]);_0xe7dccd[_0x8812('0x3b')]=_['intersection'](_0xe7dccd['model'],_0xe7dccd[_0x8812('0x3a')]);_0x5de672[_0x8812('0x3c')]=_[_0x8812('0x3d')](_0xe7dccd[_0x8812('0x37')],qs['fields'](_0x20659e[_0x8812('0x3a')][_0x8812('0x3e')]));_0x5de672[_0x8812('0x3c')]=_0x5de672[_0x8812('0x3c')][_0x8812('0x3f')]?_0x5de672[_0x8812('0x3c')]:_0xe7dccd[_0x8812('0x37')];if(!_0x20659e[_0x8812('0x3a')]['hasOwnProperty']('nolimit')){_0x5de672[_0x8812('0x2a')]=qs['limit'](_0x20659e[_0x8812('0x3a')][_0x8812('0x2a')]);_0x5de672[_0x8812('0x28')]=qs[_0x8812('0x28')](_0x20659e[_0x8812('0x3a')][_0x8812('0x28')]);}_0x5de672['order']=qs[_0x8812('0x40')](_0x20659e['query'][_0x8812('0x40')]);_0x5de672[_0x8812('0x41')]=qs[_0x8812('0x3b')](_[_0x8812('0x42')](_0x20659e[_0x8812('0x3a')],_0xe7dccd[_0x8812('0x3b')]),_0x588460);if(_0x20659e[_0x8812('0x3a')][_0x8812('0x43')]){_0x5de672[_0x8812('0x41')]=_[_0x8812('0x44')](_0x5de672[_0x8812('0x41')],{'$or':_[_0x8812('0x38')](_0x588460,function(_0x2911d5){if(_0x2911d5['type']!==_0x8812('0x45')){var _0x5bc47f={};_0x5bc47f[_0x2911d5['name']]={'$like':'%'+_0x20659e[_0x8812('0x3a')][_0x8812('0x43')]+'%'};return _0x5bc47f;}})});}_0x5de672=_[_0x8812('0x44')]({},_0x5de672,_0x20659e[_0x8812('0x46')]);var _0x5626a5={'where':_0x5de672['where']};return db[_0x8812('0x34')][_0x8812('0x2b')](_0x5626a5)['then'](function(_0x19addb){_0x2d8bc8['count']=_0x19addb;if(_0x20659e['query']['includeAll']){_0x5de672[_0x8812('0x47')]=[{'all':!![]}];}return db[_0x8812('0x34')][_0x8812('0x48')](_0x5de672);})['then'](function(_0x35b5b0){_0x2d8bc8['rows']=_0x35b5b0;return _0x2d8bc8;})[_0x8812('0x1b')](respondWithFilteredResult(_0x5287d9,_0x5de672))[_0x8812('0x24')](handleError(_0x5287d9,null));};exports['show']=function(_0x44fb4a,_0x15264b){var _0x2baeda={'raw':![],'where':{'id':_0x44fb4a[_0x8812('0x49')]['id']}},_0x572304={};_0x572304[_0x8812('0x37')]=_[_0x8812('0x39')](db['Setting'][_0x8812('0x35')]);_0x572304['query']=_[_0x8812('0x39')](_0x44fb4a[_0x8812('0x3a')]);_0x572304[_0x8812('0x3b')]=_[_0x8812('0x3d')](_0x572304[_0x8812('0x37')],_0x572304['query']);_0x2baeda[_0x8812('0x3c')]=_[_0x8812('0x3d')](_0x572304[_0x8812('0x37')],qs[_0x8812('0x3e')](_0x44fb4a['query'][_0x8812('0x3e')]));_0x2baeda[_0x8812('0x3c')]=_0x2baeda[_0x8812('0x3c')][_0x8812('0x3f')]?_0x2baeda[_0x8812('0x3c')]:_0x572304['model'];if(_0x44fb4a[_0x8812('0x3a')][_0x8812('0x4a')]){_0x2baeda[_0x8812('0x47')]=[{'all':!![]}];}_0x2baeda=_[_0x8812('0x44')]({},_0x2baeda,_0x44fb4a[_0x8812('0x46')]);return db['Setting'][_0x8812('0x4b')](_0x2baeda)[_0x8812('0x1b')](handleEntityNotFound(_0x15264b,null))[_0x8812('0x1b')](respondWithResult(_0x15264b,null))[_0x8812('0x24')](handleError(_0x15264b,null));};exports['update']=function(_0x4e0324,_0x3f68e3){if(_0x4e0324[_0x8812('0x4c')]['id']){delete _0x4e0324['body']['id'];}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x4e0324[_0x8812('0x49')]['id']}})[_0x8812('0x1b')](handleEntityNotFound(_0x3f68e3,null))[_0x8812('0x1b')](saveUpdates(_0x4e0324[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x3f68e3,null))[_0x8812('0x24')](handleError(_0x3f68e3,null));};exports[_0x8812('0x4d')]=function(_0x4ca570,_0x219528,_0x211e99){if(_0x4ca570['file']&&_0x4ca570[_0x8812('0x4e')][_0x8812('0x4f')]){_0x4ca570['body']['logo']=_0x4ca570['file'][_0x8812('0x4f')];}return db[_0x8812('0x34')]['find']({'where':{'id':_0x4ca570['params']['id']}})[_0x8812('0x1b')](handleEntityNotFound(_0x219528,null))[_0x8812('0x1b')](saveUpdates(_0x4ca570[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x219528,null))['catch'](handleError(_0x219528,null));};exports[_0x8812('0x50')]=function(_0x4b068d,_0x49218,_0x26b55b){if(_0x4b068d[_0x8812('0x4e')]&&_0x4b068d[_0x8812('0x4e')][_0x8812('0x4f')]){_0x4b068d[_0x8812('0x4c')][_0x8812('0x51')]=_0x4b068d[_0x8812('0x4e')]['filename'];}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x4b068d['params']['id']}})['then'](handleEntityNotFound(_0x49218,null))[_0x8812('0x1b')](saveUpdates(_0x4b068d[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x49218,null))[_0x8812('0x24')](handleError(_0x49218,null));};var utilLicense=require(_0x8812('0x15'));exports[_0x8812('0x52')]=function(_0x21155d,_0x3d16ab,_0x2f3c07){var _0x2549fb=_0x8812('0x53');var _0x5cc842={'custom':![]};return utilLicense[_0x8812('0x54')]()['then'](function(_0x20489d){if(_0x20489d){_0x5cc842=_0x20489d;}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x21155d[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),_0x8812('0x51'),_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),_0x8812('0x59'),_0x8812('0x5a'),_0x8812('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x3d16ab,null))[_0x8812('0x1b')](function(_0xd6c4d){if(_0xd6c4d){var _0x26b2d2=_0xd6c4d['logo']&&fs[_0x8812('0x5c')](path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x2549fb,_[_0x8812('0x5f')](_0xd6c4d[_0x8812('0x55')])))?path['join'](config[_0x8812('0x5e')],_0x2549fb,_[_0x8812('0x5f')](_0xd6c4d['logo'])):path[_0x8812('0x5d')](config['root'],_0x2549fb,_[_0x8812('0x5f')](_0x8812('0x60')));var _0x44d8d8=_0x8812('0x61')+_['upperFirst']('logo');if(_0xd6c4d[_0x44d8d8]||!_0x5cc842[_0x8812('0x62')]){_0x26b2d2=path[_0x8812('0x5d')](config['root'],_0x2549fb,_['toLower']('default_logo.svg'));}if(!fs[_0x8812('0x5c')](_0x26b2d2)){throw new db[(_0x8812('0x63'))][(_0x8812('0x64'))](_['upperFirst']('logo')+_0x8812('0x65'));}return _0x3d16ab[_0x8812('0x66')](_0x26b2d2);}})['catch'](handleError(_0x3d16ab,null));};var utilLicense=require(_0x8812('0x15'));exports[_0x8812('0x67')]=function(_0x4d63d0,_0x2ebea6,_0x2a4e16){var _0xeca8d5=_0x8812('0x53');var _0x1cf6ec={'custom':![]};return utilLicense[_0x8812('0x54')]()[_0x8812('0x1b')](function(_0x21d063){if(_0x21d063){_0x1cf6ec=_0x21d063;}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x4d63d0[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),'loginLogo',_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),_0x8812('0x59'),_0x8812('0x5a'),_0x8812('0x5b')],'raw':!![]});})[_0x8812('0x1b')](handleEntityNotFound(_0x2ebea6,null))[_0x8812('0x1b')](function(_0x5260dd){if(_0x5260dd){var _0x530dca=_0x5260dd['loginLogo']&&fs[_0x8812('0x5c')](path['join'](config['root'],_0xeca8d5,_[_0x8812('0x5f')](_0x5260dd[_0x8812('0x51')])))?path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0xeca8d5,_[_0x8812('0x5f')](_0x5260dd[_0x8812('0x51')])):path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0xeca8d5,_[_0x8812('0x5f')]('default_loginLogo.svg'));var _0x460bec=_0x8812('0x61')+_[_0x8812('0x68')]('loginLogo');if(_0x5260dd[_0x460bec]||!_0x1cf6ec[_0x8812('0x62')]){_0x530dca=path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0xeca8d5,_['toLower'](_0x8812('0x69')));}if(!fs[_0x8812('0x5c')](_0x530dca)){throw new db['Sequelize'][(_0x8812('0x64'))](_[_0x8812('0x68')]('loginLogo')+_0x8812('0x65'));}return _0x2ebea6[_0x8812('0x66')](_0x530dca);}})[_0x8812('0x24')](handleError(_0x2ebea6,null));};exports[_0x8812('0x6a')]=function(_0x46f034,_0x145875){return db['Setting'][_0x8812('0x4b')]({'where':{'id':_0x46f034[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x6b')]})[_0x8812('0x1b')](respondWithResult(_0x145875,null))[_0x8812('0x24')](handleError(_0x145875,null));};exports[_0x8812('0x6c')]=function(_0x1aa1cf,_0xe89fb3,_0xbef92){if(_0x1aa1cf[_0x8812('0x4e')]&&_0x1aa1cf[_0x8812('0x4e')]['filename']){_0x1aa1cf[_0x8812('0x4c')][_0x8812('0x56')]=_0x1aa1cf[_0x8812('0x4e')][_0x8812('0x4f')];}return db['Setting'][_0x8812('0x4b')]({'where':{'id':_0x1aa1cf['params']['id']}})[_0x8812('0x1b')](handleEntityNotFound(_0xe89fb3,null))[_0x8812('0x1b')](saveUpdates(_0x1aa1cf[_0x8812('0x4c')],null))['then'](respondWithResult(_0xe89fb3,null))['catch'](handleError(_0xe89fb3,null));};var utilLicense=require(_0x8812('0x15'));exports[_0x8812('0x6d')]=function(_0x1aa8de,_0x21a927,_0x265184){var _0x3b06a1=_0x8812('0x53');var _0x177744={'custom':![]};return utilLicense[_0x8812('0x54')]()[_0x8812('0x1b')](function(_0x466bf6){if(_0x466bf6){_0x177744=_0x466bf6;}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x1aa8de[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),_0x8812('0x51'),_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),'defaultLoginLogo',_0x8812('0x5a'),_0x8812('0x5b')],'raw':!![]});})[_0x8812('0x1b')](handleEntityNotFound(_0x21a927,null))[_0x8812('0x1b')](function(_0x36e2e2){if(_0x36e2e2){var _0x13be66=_0x36e2e2[_0x8812('0x56')]&&fs['existsSync'](path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3b06a1,_[_0x8812('0x5f')](_0x36e2e2[_0x8812('0x56')])))?path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3b06a1,_['toLower'](_0x36e2e2[_0x8812('0x56')])):path[_0x8812('0x5d')](config['root'],_0x3b06a1,_[_0x8812('0x5f')](_0x8812('0x6e')));var _0x17ef2d='default'+_[_0x8812('0x68')](_0x8812('0x56'));if(_0x36e2e2[_0x17ef2d]||!_0x177744[_0x8812('0x62')]||!_0x177744[_0x8812('0x56')]){_0x13be66=path[_0x8812('0x5d')](config['root'],_0x3b06a1,_[_0x8812('0x5f')](_0x8812('0x6e')));}if(!fs['existsSync'](_0x13be66)){throw new db[(_0x8812('0x63'))][(_0x8812('0x64'))](_[_0x8812('0x68')]('preferred')+_0x8812('0x65'));}return _0x21a927[_0x8812('0x66')](_0x13be66);}})['catch'](handleError(_0x21a927,null));};exports['addFavicon']=function(_0x39498a,_0x4dfaeb,_0x564f80){if(_0x39498a[_0x8812('0x4e')]&&_0x39498a[_0x8812('0x4e')]['filename']){_0x39498a['body'][_0x8812('0x57')]=_0x39498a[_0x8812('0x4e')][_0x8812('0x4f')];}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x39498a[_0x8812('0x49')]['id']}})['then'](handleEntityNotFound(_0x4dfaeb,null))['then'](saveUpdates(_0x39498a[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x4dfaeb,null))['catch'](handleError(_0x4dfaeb,null));};var utilLicense=require('../../config/license/util');exports[_0x8812('0x6f')]=function(_0x5e5d72,_0x1150b0,_0x263a69){var _0x3445f8=_0x8812('0x53');var _0x154052={'custom':![]};return utilLicense[_0x8812('0x54')]()[_0x8812('0x1b')](function(_0x5eb2d9){if(_0x5eb2d9){_0x154052=_0x5eb2d9;}return db['Setting'][_0x8812('0x4b')]({'where':{'id':_0x5e5d72[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),'loginLogo',_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),_0x8812('0x59'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x8812('0x1b')](handleEntityNotFound(_0x1150b0,null))[_0x8812('0x1b')](function(_0x35fd6a){if(_0x35fd6a){var _0x32a2d7=_0x35fd6a['favicon']&&fs[_0x8812('0x5c')](path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3445f8,_[_0x8812('0x5f')](_0x35fd6a[_0x8812('0x57')])))?path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3445f8,_[_0x8812('0x5f')](_0x35fd6a[_0x8812('0x57')])):path[_0x8812('0x5d')](config['root'],_0x3445f8,_[_0x8812('0x5f')](_0x8812('0x70')));var _0xb1d51a='default'+_[_0x8812('0x68')](_0x8812('0x57'));if(_0x35fd6a[_0xb1d51a]||!_0x154052[_0x8812('0x62')]){_0x32a2d7=path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3445f8,_[_0x8812('0x5f')](_0x8812('0x70')));}if(!fs[_0x8812('0x5c')](_0x32a2d7)){throw new db[(_0x8812('0x63'))][(_0x8812('0x64'))](_[_0x8812('0x68')](_0x8812('0x57'))+_0x8812('0x65'));}return _0x1150b0[_0x8812('0x66')](_0x32a2d7);}})[_0x8812('0x24')](handleError(_0x1150b0,null));};exports['getDate']=function(_0xff63e,_0x24cf16){var _0x41ef7d={'offset':moment()[_0x8812('0x71')]()};_0x41ef7d[_0x8812('0x72')]=moment()[_0x8812('0x71')](_0x41ef7d[_0x8812('0x28')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x24cf16[_0x8812('0x2c')](0xc8)[_0x8812('0x73')](_0x41ef7d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 92c714e..8d40a2f 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x222529,_0x5f0c50){var _0x4384ab=function(_0x318a68){while(--_0x318a68){_0x222529['push'](_0x222529['shift']());}};_0x4384ab(++_0x5f0c50);}(_0xe14b,0x93));var _0xbe14=function(_0x521140,_0x3e815f){_0x521140=_0x521140-0x0;var _0x542ff0=_0xe14b[_0x521140];return _0x542ff0;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x4cf3b4,_0x4ab198){var _0x55c476=function(_0x258f6f){while(--_0x258f6f){_0x4cf3b4['push'](_0x4cf3b4['shift']());}};_0x55c476(++_0x4ab198);}(_0xedd9,0xfc));var _0x9edd=function(_0x51aab0,_0x537d99){_0x51aab0=_0x51aab0-0x0;var _0x3652cc=_0xedd9[_0x51aab0];return _0x3652cc;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 39de78d..62236fa 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaceb=['stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2af443,_0x5b28b5){var _0x5397a2=function(_0x19d302){while(--_0x19d302){_0x2af443['push'](_0x2af443['shift']());}};_0x5397a2(++_0x5b28b5);}(_0xaceb,0x1c1));var _0xbace=function(_0x2281be,_0x429b4e){_0x2281be=_0x2281be-0x0;var _0xc2c38f=_0xaceb[_0x2281be];return _0xc2c38f;};'use strict';var _=require('lodash');var util=require(_0xbace('0x0'));var moment=require('moment');var BPromise=require(_0xbace('0x1'));var rs=require(_0xbace('0x2'));var fs=require('fs');var Redis=require(_0xbace('0x3'));var db=require(_0xbace('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbace('0x5'))(_0xbace('0x6'));var config=require(_0xbace('0x7'));var jayson=require(_0xbace('0x8'));var client=jayson['client'][_0xbace('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18d6b6,_0x3ec774,_0x1260da){return new BPromise(function(_0x4da20f,_0xd57ccd){return client[_0xbace('0xa')](_0x18d6b6,_0x1260da)[_0xbace('0xb')](function(_0x3b83a5){logger[_0xbace('0xc')](_0xbace('0xd'),_0x3ec774,_0xbace('0xe'));logger[_0xbace('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x3ec774,_0xbace('0xe'),JSON[_0xbace('0x10')](_0x3b83a5));if(_0x3b83a5[_0xbace('0x11')]){if(_0x3b83a5[_0xbace('0x11')][_0xbace('0x12')]===0x1f4){logger[_0xbace('0x11')]('Setting,\x20%s,\x20%s',_0x3ec774,_0x3b83a5[_0xbace('0x11')][_0xbace('0x13')]);return _0xd57ccd(_0x3b83a5[_0xbace('0x11')]['message']);}logger[_0xbace('0x11')](_0xbace('0xd'),_0x3ec774,_0x3b83a5['error'][_0xbace('0x13')]);return _0x4da20f(_0x3b83a5[_0xbace('0x11')][_0xbace('0x13')]);}else{logger[_0xbace('0xc')](_0xbace('0xd'),_0x3ec774,'request\x20sent');_0x4da20f(_0x3b83a5['result'][_0xbace('0x13')]);}})[_0xbace('0x14')](function(_0x26e74c){logger[_0xbace('0x11')](_0xbace('0xd'),_0x3ec774,_0x26e74c);_0xd57ccd(_0x26e74c);});});}exports[_0xbace('0x15')]=function(_0x45f8d7){var _0x303f1c=this;return new Promise(function(_0x11846e,_0x4b81e4){return db[_0xbace('0x16')][_0xbace('0x17')]({'raw':_0x45f8d7[_0xbace('0x18')]?_0x45f8d7['options'][_0xbace('0x19')]===undefined?!![]:![]:!![],'where':_0x45f8d7['options']?_0x45f8d7[_0xbace('0x18')][_0xbace('0x1a')]||null:null,'attributes':_0x45f8d7['options']?_0x45f8d7[_0xbace('0x18')][_0xbace('0x1b')]||null:null,'include':_0x45f8d7[_0xbace('0x18')]?_0x45f8d7[_0xbace('0x18')][_0xbace('0x1c')]?_[_0xbace('0x1d')](_0x45f8d7[_0xbace('0x18')][_0xbace('0x1c')],function(_0x516fdf){return{'model':db[_0x516fdf[_0xbace('0x1e')]],'as':_0x516fdf['as'],'attributes':_0x516fdf['attributes'],'include':_0x516fdf[_0xbace('0x1c')]?_[_0xbace('0x1d')](_0x516fdf['include'],function(_0x27ad1b){return{'model':db[_0x27ad1b[_0xbace('0x1e')]],'as':_0x27ad1b['as'],'attributes':_0x27ad1b[_0xbace('0x1b')],'include':_0x27ad1b[_0xbace('0x1c')]?_[_0xbace('0x1d')](_0x27ad1b[_0xbace('0x1c')],function(_0x4b3c85){return{'model':db[_0x4b3c85['model']],'as':_0x4b3c85['as'],'attributes':_0x4b3c85[_0xbace('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbace('0xb')](function(_0x1ff053){logger['info']('ShowSetting',_0x45f8d7);logger['debug']('ShowSetting',_0x45f8d7,JSON[_0xbace('0x10')](_0x1ff053));_0x11846e(_0x1ff053);})['catch'](function(_0xd638c3){logger[_0xbace('0x11')](_0xbace('0x15'),_0xd638c3[_0xbace('0x13')],_0x45f8d7);_0x4b81e4(_0x303f1c[_0xbace('0x11')](0x1f4,_0xd638c3[_0xbace('0x13')]));});});}; \ No newline at end of file +var _0xe301=['Setting','find','options','raw','where','include','map','model','attributes','ShowSetting','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0x5ceaf3,_0x1cec19){var _0xb12401=function(_0x1e851e){while(--_0x1e851e){_0x5ceaf3['push'](_0x5ceaf3['shift']());}};_0xb12401(++_0x1cec19);}(_0xe301,0xbe));var _0x1e30=function(_0x53bb74,_0x590c3e){_0x53bb74=_0x53bb74-0x0;var _0x286b70=_0xe301[_0x53bb74];return _0x286b70;};'use strict';var _=require('lodash');var util=require(_0x1e30('0x0'));var moment=require('moment');var BPromise=require(_0x1e30('0x1'));var rs=require(_0x1e30('0x2'));var fs=require('fs');var Redis=require(_0x1e30('0x3'));var db=require(_0x1e30('0x4'))['db'];var utils=require(_0x1e30('0x5'));var logger=require(_0x1e30('0x6'))('rpc');var config=require(_0x1e30('0x7'));var jayson=require(_0x1e30('0x8'));var client=jayson[_0x1e30('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a76ec,_0x5db6b5,_0x1a1f07){return new BPromise(function(_0x4d1383,_0x48d7e8){return client[_0x1e30('0xa')](_0x2a76ec,_0x1a1f07)['then'](function(_0x547b50){logger[_0x1e30('0xb')]('Setting,\x20%s,\x20%s',_0x5db6b5,_0x1e30('0xc'));logger[_0x1e30('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x5db6b5,_0x1e30('0xc'),JSON[_0x1e30('0xe')](_0x547b50));if(_0x547b50[_0x1e30('0xf')]){if(_0x547b50['error'][_0x1e30('0x10')]===0x1f4){logger[_0x1e30('0xf')](_0x1e30('0x11'),_0x5db6b5,_0x547b50[_0x1e30('0xf')][_0x1e30('0x12')]);return _0x48d7e8(_0x547b50['error'][_0x1e30('0x12')]);}logger[_0x1e30('0xf')](_0x1e30('0x11'),_0x5db6b5,_0x547b50['error'][_0x1e30('0x12')]);return _0x4d1383(_0x547b50[_0x1e30('0xf')][_0x1e30('0x12')]);}else{logger[_0x1e30('0xb')](_0x1e30('0x11'),_0x5db6b5,_0x1e30('0xc'));_0x4d1383(_0x547b50[_0x1e30('0x13')][_0x1e30('0x12')]);}})['catch'](function(_0x53053b){logger[_0x1e30('0xf')]('Setting,\x20%s,\x20%s',_0x5db6b5,_0x53053b);_0x48d7e8(_0x53053b);});});}exports['ShowSetting']=function(_0x542cb9){var _0x75182f=this;return new Promise(function(_0x2b215b,_0x218286){return db[_0x1e30('0x14')][_0x1e30('0x15')]({'raw':_0x542cb9[_0x1e30('0x16')]?_0x542cb9[_0x1e30('0x16')][_0x1e30('0x17')]===undefined?!![]:![]:!![],'where':_0x542cb9['options']?_0x542cb9[_0x1e30('0x16')][_0x1e30('0x18')]||null:null,'attributes':_0x542cb9[_0x1e30('0x16')]?_0x542cb9[_0x1e30('0x16')]['attributes']||null:null,'include':_0x542cb9[_0x1e30('0x16')]?_0x542cb9[_0x1e30('0x16')][_0x1e30('0x19')]?_[_0x1e30('0x1a')](_0x542cb9[_0x1e30('0x16')][_0x1e30('0x19')],function(_0x2e2810){return{'model':db[_0x2e2810[_0x1e30('0x1b')]],'as':_0x2e2810['as'],'attributes':_0x2e2810[_0x1e30('0x1c')],'include':_0x2e2810[_0x1e30('0x19')]?_[_0x1e30('0x1a')](_0x2e2810[_0x1e30('0x19')],function(_0xb75d47){return{'model':db[_0xb75d47[_0x1e30('0x1b')]],'as':_0xb75d47['as'],'attributes':_0xb75d47[_0x1e30('0x1c')],'include':_0xb75d47[_0x1e30('0x19')]?_['map'](_0xb75d47[_0x1e30('0x19')],function(_0x4f2160){return{'model':db[_0x4f2160[_0x1e30('0x1b')]],'as':_0x4f2160['as'],'attributes':_0x4f2160[_0x1e30('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x961e0e){logger['info'](_0x1e30('0x1d'),_0x542cb9);logger[_0x1e30('0xd')](_0x1e30('0x1d'),_0x542cb9,JSON[_0x1e30('0xe')](_0x961e0e));_0x2b215b(_0x961e0e);})['catch'](function(_0x31f4f4){logger[_0x1e30('0xf')](_0x1e30('0x1d'),_0x31f4f4[_0x1e30('0x12')],_0x542cb9);_0x218286(_0x75182f['error'](0x1f4,_0x31f4f4[_0x1e30('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4e9397a..737793f 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x104993,_0x3f9a6b){var _0x105a96=function(_0x4ad1cb){while(--_0x4ad1cb){_0x104993['push'](_0x104993['shift']());}};_0x105a96(++_0x3f9a6b);}(_0x814b,0x1a2));var _0xb814=function(_0x378891,_0x4e3e16){_0x378891=_0x378891-0x0;var _0xfbfda2=_0x814b[_0x378891];return _0xfbfda2;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'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['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 6b3852d..cc31c18 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4730=['clickatell','bandwidth','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo'];(function(_0x5b1ef1,_0x487026){var _0x3643f0=function(_0x27045c){while(--_0x27045c){_0x5b1ef1['push'](_0x5b1ef1['shift']());}};_0x3643f0(++_0x487026);}(_0x4730,0xde));var _0x0473=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x4730[_0x120376];return _0x28c529;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x0473('0x0')]={'name':{'type':Sequelize[_0x0473('0x1')],'unique':_0x0473('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0473('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0473('0x1')],'defaultValue':function(){return rs[_0x0473('0x3')]();}},'phone':{'type':Sequelize[_0x0473('0x1')]},'type':{'type':Sequelize[_0x0473('0x4')](_0x0473('0x5'),_0x0473('0x6'),_0x0473('0x7'),'clicksend',_0x0473('0x8'),_0x0473('0x9'),_0x0473('0xa'),'csc',_0x0473('0xb'),_0x0473('0xc'))},'accountSid':{'type':Sequelize[_0x0473('0x1')]},'authId':{'type':Sequelize[_0x0473('0x1')]},'authToken':{'type':Sequelize[_0x0473('0x1')]},'smsMethod':{'type':Sequelize[_0x0473('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0473('0x1')]},'password':{'type':Sequelize[_0x0473('0x1')]},'apiKey':{'type':Sequelize[_0x0473('0x1')]},'applicationId':{'type':Sequelize[_0x0473('0x1')]},'accountId':{'type':Sequelize[_0x0473('0x1')]},'senderString':{'type':Sequelize[_0x0473('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0473('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0473('0xd')],'defaultValue':function(){return _0x0473('0xe');}},'notificationSound':{'type':Sequelize[_0x0473('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0473('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0473('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0473('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0473('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0473('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0473('0x11'),'set':function(_0x18bee9){if(!_0x18bee9)this[_0x0473('0x12')](_0x0473('0x13'),null);this[_0x0473('0x12')](_0x0473('0x14'),_0x18bee9);}}}; \ No newline at end of file +var _0x84ca=['mandatoryDispositionPauseId','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x84ca,0x169));var _0xa84c=function(_0x3e3a79,_0x292e01){_0x3e3a79=_0x3e3a79-0x0;var _0x46df88=_0x84ca[_0x3e3a79];return _0x46df88;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa84c('0x0'));module[_0xa84c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa84c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa84c('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa84c('0x2')],'defaultValue':function(){return rs[_0xa84c('0x3')]();}},'phone':{'type':Sequelize[_0xa84c('0x2')]},'type':{'type':Sequelize[_0xa84c('0x4')](_0xa84c('0x5'),_0xa84c('0x6'),_0xa84c('0x7'),_0xa84c('0x8'),_0xa84c('0x9'),'clickatell','bandwidth',_0xa84c('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa84c('0x2')]},'authToken':{'type':Sequelize[_0xa84c('0x2')]},'smsMethod':{'type':Sequelize[_0xa84c('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa84c('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xa84c('0x2')]},'senderString':{'type':Sequelize[_0xa84c('0x2')]},'deliveryReport':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xa84c('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa84c('0xc')],'defaultValue':function(){return _0xa84c('0xd');}},'notificationSound':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa84c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa84c('0xe')],'comment':_0xa84c('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x27cfbd){if(!_0x27cfbd)this[_0xa84c('0x10')](_0xa84c('0x11'),null);this[_0xa84c('0x10')]('mandatoryDisposition',_0x27cfbd);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 10775e7..95bc9b0 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c20=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','addDisposition','SmsAccountId','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','ListId','mobile','twilio','from','From','Body','MessageSid','skebby','sender','connectel','clicksend','message_id','plivo','messageId','infobip','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','stack','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','user','out','SmsMessage','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','results','groupName','DELIVERED','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','received\x20delivery\x20report\x20from','message-id','state','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x575d3d,_0x1b92d7){var _0x49e231=function(_0x524fe4){while(--_0x524fe4){_0x575d3d['push'](_0x575d3d['shift']());}};_0x49e231(++_0x1b92d7);}(_0x2c20,0x1bc));var _0x02c2=function(_0xc56b79,_0x31ff15){_0xc56b79=_0xc56b79-0x0;var _0x4c0536=_0x2c20[_0xc56b79];return _0x4c0536;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02c2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02c2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x02c2('0x2'));var Mustache=require(_0x02c2('0x3'));var util=require(_0x02c2('0x4'));var path=require(_0x02c2('0x5'));var sox=require(_0x02c2('0x6'));var csv=require(_0x02c2('0x7'));var ejs=require(_0x02c2('0x8'));var fs=require('fs');var fs_extra=require(_0x02c2('0x9'));var _=require(_0x02c2('0xa'));var squel=require(_0x02c2('0xb'));var crypto=require(_0x02c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x02c2('0xd'));var toCsv=require(_0x02c2('0x7'));var querystring=require(_0x02c2('0xe'));var Papa=require(_0x02c2('0xf'));var Redis=require(_0x02c2('0x10'));var authService=require(_0x02c2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x02c2('0x12'));var hardwareService=require(_0x02c2('0x13'));var logger=require(_0x02c2('0x14'))('api');var utils=require(_0x02c2('0x15'));var config=require(_0x02c2('0x16'));var licenseUtil=require(_0x02c2('0x17'));var db=require(_0x02c2('0x18'))['db'];config[_0x02c2('0x19')]=_[_0x02c2('0x1a')](config[_0x02c2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x02c2('0x1b'))(new Redis(config[_0x02c2('0x19')]));require('./smsAccount.socket')[_0x02c2('0x1c')](socket);var jayson=require(_0x02c2('0x1d'));var client=jayson[_0x02c2('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4d2515,_0x16b369,_0x1efeb5,_0x1ff51d){return new BPromise(function(_0x228f8b,_0x48545b){var _0x1ce2fb=_0x1ff51d||client;return _0x1ce2fb[_0x02c2('0x1f')](_0x4d2515,_0x1efeb5)[_0x02c2('0x20')](function(_0x314173){logger[_0x02c2('0x21')](_0x02c2('0x22'),_0x16b369,'request\x20sent');logger[_0x02c2('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x16b369,'request\x20sent',JSON[_0x02c2('0x24')](_0x314173));if(_0x314173[_0x02c2('0x25')]){if(_0x314173['error'][_0x02c2('0x26')]===0x1f4){logger['error'](_0x02c2('0x22'),_0x16b369,_0x314173[_0x02c2('0x25')][_0x02c2('0x27')]);return _0x48545b(_0x314173[_0x02c2('0x25')]['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x16b369,_0x314173[_0x02c2('0x25')][_0x02c2('0x27')]);return _0x228f8b(_0x314173['error'][_0x02c2('0x27')]);}else{logger[_0x02c2('0x21')](_0x02c2('0x22'),_0x16b369,'request\x20sent');_0x228f8b(_0x314173[_0x02c2('0x28')][_0x02c2('0x27')]);}})[_0x02c2('0x29')](function(_0x357914){logger[_0x02c2('0x25')](_0x02c2('0x22'),_0x16b369,_0x357914);_0x48545b(_0x357914);});});}function respondWithStatusCode(_0x4bad0f,_0x4ca986){_0x4ca986=_0x4ca986||0xcc;return function(_0x11c240){if(_0x11c240){return _0x4bad0f[_0x02c2('0x2a')](_0x4ca986);}return _0x4bad0f[_0x02c2('0x2b')](_0x4ca986)[_0x02c2('0x2c')]();};}function respondWithResult(_0xe7a550,_0x2ab13e){_0x2ab13e=_0x2ab13e||0xc8;return function(_0x6e5535){if(_0x6e5535){return _0xe7a550['status'](_0x2ab13e)['json'](_0x6e5535);}};}function respondWithFilteredResult(_0x254ab7,_0x27c7d5){return function(_0x5dd80b){if(_0x5dd80b){var _0x424466=typeof _0x27c7d5[_0x02c2('0x2d')]===_0x02c2('0x2e')&&typeof _0x27c7d5[_0x02c2('0x2f')]===_0x02c2('0x2e');var _0x1b14f6=_0x5dd80b['count'];var _0x2aea95=_0x424466?0x0:_0x27c7d5[_0x02c2('0x2d')];var _0x28555d=_0x424466?_0x5dd80b[_0x02c2('0x30')]:_0x27c7d5['offset']+_0x27c7d5[_0x02c2('0x2f')];var _0x25f97f;if(_0x28555d>=_0x1b14f6){_0x28555d=_0x1b14f6;_0x25f97f=0xc8;}else{_0x25f97f=0xce;}_0x254ab7['status'](_0x25f97f);return _0x254ab7['set'](_0x02c2('0x31'),_0x2aea95+'-'+_0x28555d+'/'+_0x1b14f6)[_0x02c2('0x32')](_0x5dd80b);}return null;};}function patchUpdates(_0x57a90d){return function(_0x25d301){try{jsonpatch[_0x02c2('0x33')](_0x25d301,_0x57a90d,!![]);}catch(_0x167f80){return BPromise[_0x02c2('0x34')](_0x167f80);}return _0x25d301[_0x02c2('0x35')]();};}function saveUpdates(_0x5e96fc,_0x483b70){return function(_0xe5832c){if(_0xe5832c){return _0xe5832c['update'](_0x5e96fc)[_0x02c2('0x20')](function(_0x23d0a2){return _0x23d0a2;});}return null;};}function removeEntity(_0xfcde25,_0x29a31c){return function(_0x991939){if(_0x991939){return _0x991939['destroy']()[_0x02c2('0x20')](function(){var _0x4498cb=_0x991939[_0x02c2('0x36')]({'plain':!![]});var _0x4758a8=_0x02c2('0x37');return db[_0x02c2('0x38')]['destroy']({'where':{'type':_0x4758a8,'resourceId':_0x4498cb['id']}})['then'](function(){return _0x991939;});})[_0x02c2('0x20')](function(){_0xfcde25['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fc65c,_0x22433b){return function(_0x59ad18){if(!_0x59ad18){_0x1fc65c['sendStatus'](0x194);}return _0x59ad18;};}function handleError(_0x477e4e,_0x12044d){_0x12044d=_0x12044d||0x1f4;return function(_0x489232){logger[_0x02c2('0x25')](_0x489232['stack']);if(_0x489232[_0x02c2('0x39')]){delete _0x489232['name'];}_0x477e4e['status'](_0x12044d)[_0x02c2('0x3a')](_0x489232);};}exports['index']=function(_0x18c6c6,_0x1c7519){var _0x55c902={'include':[{'model':db[_0x02c2('0x3b')],'as':_0x02c2('0x3c')}]},_0xe6e31b={},_0x5f548a={'count':0x0,'rows':[]};var _0x2bc97d=_[_0x02c2('0x3d')](db[_0x02c2('0x3e')][_0x02c2('0x3f')],function(_0x13a29e){return{'name':_0x13a29e['fieldName'],'type':_0x13a29e[_0x02c2('0x40')][_0x02c2('0x41')]};});_0xe6e31b[_0x02c2('0x42')]=_[_0x02c2('0x3d')](_0x2bc97d,_0x02c2('0x39'));_0xe6e31b['query']=_[_0x02c2('0x43')](_0x18c6c6['query']);_0xe6e31b[_0x02c2('0x44')]=_[_0x02c2('0x45')](_0xe6e31b[_0x02c2('0x42')],_0xe6e31b['query']);_0x55c902[_0x02c2('0x46')]=_[_0x02c2('0x45')](_0xe6e31b[_0x02c2('0x42')],qs[_0x02c2('0x47')](_0x18c6c6[_0x02c2('0x48')]['fields']));_0x55c902['attributes']=_0x55c902['attributes']['length']?_0x55c902['attributes']:_0xe6e31b[_0x02c2('0x42')];if(!_0x18c6c6[_0x02c2('0x48')][_0x02c2('0x49')](_0x02c2('0x4a'))){_0x55c902[_0x02c2('0x2f')]=qs['limit'](_0x18c6c6[_0x02c2('0x48')][_0x02c2('0x2f')]);_0x55c902['offset']=qs[_0x02c2('0x2d')](_0x18c6c6[_0x02c2('0x48')][_0x02c2('0x2d')]);}_0x55c902[_0x02c2('0x4b')]=qs[_0x02c2('0x4c')](_0x18c6c6[_0x02c2('0x48')][_0x02c2('0x4c')]);_0x55c902[_0x02c2('0x4d')]=qs[_0x02c2('0x44')](_['pick'](_0x18c6c6[_0x02c2('0x48')],_0xe6e31b[_0x02c2('0x44')]),_0x2bc97d);if(_0x18c6c6[_0x02c2('0x48')]['filter']){_0x55c902[_0x02c2('0x4d')]=_[_0x02c2('0x4e')](_0x55c902[_0x02c2('0x4d')],{'$or':_['map'](_0x2bc97d,function(_0x1f4c7e){if(_0x1f4c7e['type']!==_0x02c2('0x4f')){var _0x777ba2={};_0x777ba2[_0x1f4c7e[_0x02c2('0x39')]]={'$like':'%'+_0x18c6c6[_0x02c2('0x48')][_0x02c2('0x50')]+'%'};return _0x777ba2;}})});}_0x55c902=_[_0x02c2('0x4e')]({},_0x55c902,_0x18c6c6[_0x02c2('0x51')]);var _0x35a7de={'where':_0x55c902[_0x02c2('0x4d')]};return db['SmsAccount'][_0x02c2('0x30')](_0x35a7de)[_0x02c2('0x20')](function(_0x25fea4){_0x5f548a[_0x02c2('0x30')]=_0x25fea4;if(_0x18c6c6[_0x02c2('0x48')][_0x02c2('0x52')]){_0x55c902[_0x02c2('0x53')]=[{'all':!![]}];}return db[_0x02c2('0x3e')][_0x02c2('0x54')](_0x55c902);})[_0x02c2('0x20')](function(_0x464f79){_0x5f548a['rows']=_0x464f79;return _0x5f548a;})[_0x02c2('0x20')](respondWithFilteredResult(_0x1c7519,_0x55c902))['catch'](handleError(_0x1c7519,null));};exports[_0x02c2('0x55')]=function(_0x3c15cc,_0x78c62f){var _0x399537={'raw':![],'where':{'id':_0x3c15cc[_0x02c2('0x56')]['id']},'include':[{'model':db[_0x02c2('0x3b')],'as':_0x02c2('0x3c')}]},_0x75bbf9={};_0x75bbf9[_0x02c2('0x42')]=_[_0x02c2('0x43')](db[_0x02c2('0x3e')][_0x02c2('0x3f')]);_0x75bbf9[_0x02c2('0x48')]=_[_0x02c2('0x43')](_0x3c15cc[_0x02c2('0x48')]);_0x75bbf9[_0x02c2('0x44')]=_[_0x02c2('0x45')](_0x75bbf9['model'],_0x75bbf9[_0x02c2('0x48')]);_0x399537['attributes']=_[_0x02c2('0x45')](_0x75bbf9['model'],qs[_0x02c2('0x47')](_0x3c15cc[_0x02c2('0x48')][_0x02c2('0x47')]));_0x399537[_0x02c2('0x46')]=_0x399537[_0x02c2('0x46')][_0x02c2('0x57')]?_0x399537['attributes']:_0x75bbf9[_0x02c2('0x42')];if(_0x3c15cc['query'][_0x02c2('0x52')]){_0x399537[_0x02c2('0x53')]=[{'all':!![]}];}_0x399537=_[_0x02c2('0x4e')]({},_0x399537,_0x3c15cc['options']);return db[_0x02c2('0x3e')]['find'](_0x399537)[_0x02c2('0x20')](handleEntityNotFound(_0x78c62f,null))[_0x02c2('0x20')](respondWithResult(_0x78c62f,null))['catch'](handleError(_0x78c62f,null));};exports[_0x02c2('0x58')]=function(_0x13a822,_0x5c0110){return db[_0x02c2('0x3e')][_0x02c2('0x58')](_0x13a822['body'],{})[_0x02c2('0x20')](function(_0x567a8f){var _0x24bc16=_0x13a822['user'][_0x02c2('0x36')]({'plain':!![]});if(!_0x24bc16)throw new Error(_0x02c2('0x59'));if(_0x24bc16['role']==='user'){var _0x520441=_0x567a8f[_0x02c2('0x36')]({'plain':!![]});var _0x5df9ab=_0x02c2('0x37');return db[_0x02c2('0x5a')][_0x02c2('0x5b')]({'where':{'name':_0x5df9ab,'userProfileId':_0x24bc16[_0x02c2('0x5c')]},'raw':!![]})[_0x02c2('0x20')](function(_0x5d7583){if(_0x5d7583&&_0x5d7583['autoAssociation']===0x0){return db['UserProfileResource'][_0x02c2('0x58')]({'name':_0x520441[_0x02c2('0x39')],'resourceId':_0x520441['id'],'type':_0x5d7583[_0x02c2('0x39')],'sectionId':_0x5d7583['id']},{})[_0x02c2('0x20')](function(){return _0x567a8f;});}else{return _0x567a8f;}})['catch'](function(_0x2c196a){logger['error'](_0x02c2('0x5d'),_0x2c196a);throw _0x2c196a;});}return _0x567a8f;})[_0x02c2('0x20')](respondWithResult(_0x5c0110,0xc9))[_0x02c2('0x29')](handleError(_0x5c0110,null));};exports[_0x02c2('0x5e')]=function(_0x3e45e5,_0x730584){if(_0x3e45e5['body']['id']){delete _0x3e45e5['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x3e45e5['params']['id']},'include':[{'model':db[_0x02c2('0x3b')],'as':_0x02c2('0x3c')}]})[_0x02c2('0x20')](handleEntityNotFound(_0x730584,null))['then'](saveUpdates(_0x3e45e5[_0x02c2('0x5f')],null))[_0x02c2('0x20')](respondWithResult(_0x730584,null))['catch'](handleError(_0x730584,null));};exports[_0x02c2('0x60')]=function(_0x2b3bb1,_0x50ce3c){return db[_0x02c2('0x3e')]['find']({'where':{'id':_0x2b3bb1[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x50ce3c,null))[_0x02c2('0x20')](removeEntity(_0x50ce3c,null))[_0x02c2('0x29')](handleError(_0x50ce3c,null));};exports['describe']=function(_0x5e8a8d,_0x4d0625){return db[_0x02c2('0x3e')][_0x02c2('0x61')]()[_0x02c2('0x20')](respondWithResult(_0x4d0625,null))['catch'](handleError(_0x4d0625,null));};exports[_0x02c2('0x62')]=function(_0x55fe3f,_0x1639a4,_0x13de03){if(_0x55fe3f[_0x02c2('0x5f')]['id']){delete _0x55fe3f['body']['id'];}return db[_0x02c2('0x3e')]['find']({'where':{'id':_0x55fe3f[_0x02c2('0x56')]['id']}})['then'](handleEntityNotFound(_0x1639a4,null))['then'](function(_0x543922){if(_0x543922){_0x55fe3f['body'][_0x02c2('0x63')]=_0x543922['id'];return db['Disposition'][_0x02c2('0x58')](_0x55fe3f[_0x02c2('0x5f')]);}})[_0x02c2('0x20')](respondWithResult(_0x1639a4,null))['catch'](handleError(_0x1639a4,null));};exports['getDispositions']=function(_0x2995e0,_0xea1930,_0x27d357){var _0x30d73b={'raw':![],'where':{}};var _0xcff2e4={};var _0x1a1794={'count':0x0,'rows':[]};return db['SmsAccount'][_0x02c2('0x64')]({'where':{'id':_0x2995e0['params']['id']}})['then'](handleEntityNotFound(_0xea1930,null))[_0x02c2('0x20')](function(_0x16e0f6){if(_0x16e0f6){_0xcff2e4['model']=_['keys'](db[_0x02c2('0x65')][_0x02c2('0x3f')]);_0xcff2e4['query']=_['keys'](_0x2995e0[_0x02c2('0x48')]);_0xcff2e4['filters']=_[_0x02c2('0x45')](_0xcff2e4[_0x02c2('0x42')],_0xcff2e4[_0x02c2('0x48')]);_0x30d73b[_0x02c2('0x46')]=_[_0x02c2('0x45')](_0xcff2e4[_0x02c2('0x42')],qs[_0x02c2('0x47')](_0x2995e0[_0x02c2('0x48')][_0x02c2('0x47')]));_0x30d73b[_0x02c2('0x46')]=_0x30d73b['attributes'][_0x02c2('0x57')]?_0x30d73b[_0x02c2('0x46')]:_0xcff2e4[_0x02c2('0x42')];if(!_0x2995e0[_0x02c2('0x48')]['hasOwnProperty'](_0x02c2('0x4a'))){_0x30d73b['limit']=qs[_0x02c2('0x2f')](_0x2995e0['query'][_0x02c2('0x2f')]);_0x30d73b[_0x02c2('0x2d')]=qs[_0x02c2('0x2d')](_0x2995e0[_0x02c2('0x48')][_0x02c2('0x2d')]);}_0x30d73b[_0x02c2('0x4b')]=qs['sort'](_0x2995e0[_0x02c2('0x48')][_0x02c2('0x4c')]);_0x30d73b[_0x02c2('0x4d')]=qs[_0x02c2('0x44')](_['pick'](_0x2995e0[_0x02c2('0x48')],_0xcff2e4[_0x02c2('0x44')]));_0x30d73b[_0x02c2('0x4d')]['SmsAccountId']=_0x16e0f6['id'];if(_0x2995e0['query']['filter']){_0x30d73b[_0x02c2('0x4d')]=_[_0x02c2('0x4e')](_0x30d73b[_0x02c2('0x4d')],{'$or':_[_0x02c2('0x3d')](_0x30d73b['attributes'],function(_0x266f78){var _0x4053e4={};_0x4053e4[_0x266f78]={'$like':'%'+_0x2995e0[_0x02c2('0x48')][_0x02c2('0x50')]+'%'};return _0x4053e4;})});}_0x30d73b=_[_0x02c2('0x4e')]({},_0x30d73b,_0x2995e0['options']);return db['Disposition'][_0x02c2('0x30')]({'where':_0x30d73b[_0x02c2('0x4d')]})['then'](function(_0x28ee82){_0x1a1794[_0x02c2('0x30')]=_0x28ee82;if(_0x2995e0[_0x02c2('0x48')][_0x02c2('0x52')]){_0x30d73b[_0x02c2('0x53')]=[{'all':!![]}];}return db[_0x02c2('0x65')][_0x02c2('0x54')](_0x30d73b);})['then'](function(_0x2ed284){_0x1a1794[_0x02c2('0x66')]=_0x2ed284;return _0x1a1794;});}})[_0x02c2('0x20')](respondWithFilteredResult(_0xea1930,_0x30d73b))['catch'](handleError(_0xea1930,null));};exports[_0x02c2('0x67')]=function(_0xff57b8,_0x164a30,_0x74a59c){return db['SmsAccount'][_0x02c2('0x5b')]({'where':{'id':_0xff57b8[_0x02c2('0x56')]['id']}})['then'](handleEntityNotFound(_0x164a30,null))[_0x02c2('0x20')](function(_0x45a71e){if(_0x45a71e){return _0x45a71e[_0x02c2('0x67')](_0xff57b8['query'][_0x02c2('0x68')]);}})[_0x02c2('0x20')](respondWithStatusCode(_0x164a30,null))[_0x02c2('0x29')](handleError(_0x164a30,null));};exports[_0x02c2('0x69')]=function(_0x1f6e4b,_0x45697b,_0xab2c50){if(_0x1f6e4b[_0x02c2('0x5f')]['id']){delete _0x1f6e4b[_0x02c2('0x5f')]['id'];}return db[_0x02c2('0x3e')][_0x02c2('0x5b')]({'where':{'id':_0x1f6e4b['params']['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x45697b,null))['then'](function(_0x40e92b){if(_0x40e92b){_0x1f6e4b['body'][_0x02c2('0x63')]=_0x40e92b['id'];return db[_0x02c2('0x6a')][_0x02c2('0x58')](_0x1f6e4b[_0x02c2('0x5f')]);}})['then'](respondWithResult(_0x45697b,null))[_0x02c2('0x29')](handleError(_0x45697b,null));};exports['getAnswers']=function(_0x4392e7,_0x1db721,_0xf0b6b9){var _0x260efb={'raw':![],'where':{}};var _0x3e03aa={};var _0x466e2d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x02c2('0x64')]({'where':{'id':_0x4392e7[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x1db721,null))['then'](function(_0x15adf2){if(_0x15adf2){_0x3e03aa['model']=_[_0x02c2('0x43')](db[_0x02c2('0x6a')]['rawAttributes']);_0x3e03aa[_0x02c2('0x48')]=_[_0x02c2('0x43')](_0x4392e7[_0x02c2('0x48')]);_0x3e03aa[_0x02c2('0x44')]=_[_0x02c2('0x45')](_0x3e03aa[_0x02c2('0x42')],_0x3e03aa['query']);_0x260efb['attributes']=_[_0x02c2('0x45')](_0x3e03aa[_0x02c2('0x42')],qs['fields'](_0x4392e7['query'][_0x02c2('0x47')]));_0x260efb[_0x02c2('0x46')]=_0x260efb[_0x02c2('0x46')][_0x02c2('0x57')]?_0x260efb['attributes']:_0x3e03aa['model'];if(!_0x4392e7['query']['hasOwnProperty'](_0x02c2('0x4a'))){_0x260efb['limit']=qs[_0x02c2('0x2f')](_0x4392e7[_0x02c2('0x48')][_0x02c2('0x2f')]);_0x260efb[_0x02c2('0x2d')]=qs[_0x02c2('0x2d')](_0x4392e7[_0x02c2('0x48')][_0x02c2('0x2d')]);}_0x260efb[_0x02c2('0x4b')]=qs[_0x02c2('0x4c')](_0x4392e7[_0x02c2('0x48')]['sort']);_0x260efb[_0x02c2('0x4d')]=qs['filters'](_[_0x02c2('0x6b')](_0x4392e7[_0x02c2('0x48')],_0x3e03aa[_0x02c2('0x44')]));_0x260efb[_0x02c2('0x4d')][_0x02c2('0x63')]=_0x15adf2['id'];if(_0x4392e7['query'][_0x02c2('0x50')]){_0x260efb[_0x02c2('0x4d')]=_[_0x02c2('0x4e')](_0x260efb['where'],{'$or':_['map'](_0x260efb['attributes'],function(_0x4dc8ef){var _0xfcf283={};_0xfcf283[_0x4dc8ef]={'$like':'%'+_0x4392e7[_0x02c2('0x48')]['filter']+'%'};return _0xfcf283;})});}_0x260efb=_[_0x02c2('0x4e')]({},_0x260efb,_0x4392e7[_0x02c2('0x51')]);return db[_0x02c2('0x6a')][_0x02c2('0x30')]({'where':_0x260efb[_0x02c2('0x4d')]})['then'](function(_0x25aaa9){_0x466e2d[_0x02c2('0x30')]=_0x25aaa9;if(_0x4392e7[_0x02c2('0x48')][_0x02c2('0x52')]){_0x260efb[_0x02c2('0x53')]=[{'all':!![]}];}return db[_0x02c2('0x6a')][_0x02c2('0x54')](_0x260efb);})['then'](function(_0x33e5fb){_0x466e2d[_0x02c2('0x66')]=_0x33e5fb;return _0x466e2d;});}})[_0x02c2('0x20')](respondWithFilteredResult(_0x1db721,_0x260efb))[_0x02c2('0x29')](handleError(_0x1db721,null));};exports[_0x02c2('0x6c')]=function(_0x45357a,_0x37941a,_0x1afba5){return db['SmsAccount'][_0x02c2('0x5b')]({'where':{'id':_0x45357a['params']['id']}})['then'](handleEntityNotFound(_0x37941a,null))[_0x02c2('0x20')](function(_0x14f96b){if(_0x14f96b){return _0x14f96b[_0x02c2('0x6c')](_0x45357a[_0x02c2('0x48')][_0x02c2('0x68')]);}})[_0x02c2('0x20')](respondWithStatusCode(_0x37941a,null))[_0x02c2('0x29')](handleError(_0x37941a,null));};exports[_0x02c2('0x6d')]=function(_0x4305f3,_0x43584e,_0x5f0176){var _0x2b469b={'channel':_0x02c2('0x6e')};var _0x30336e=[];var _0x1f8e9a=[];var _0xc6482f={};return db[_0x02c2('0x3e')][_0x02c2('0x5b')]({'where':{'id':_0x4305f3[_0x02c2('0x56')]['id']},'include':[{'model':db[_0x02c2('0x6f')],'as':_0x02c2('0x70')}]})[_0x02c2('0x20')](handleEntityNotFound(_0x43584e,null))[_0x02c2('0x20')](function(_0x2202f8){_0x2b469b[_0x02c2('0x71')]=_0x2202f8;_0x2b469b[_0x02c2('0x72')]=_[_0x02c2('0x73')](_0x2202f8['Applications'],[_0x02c2('0x74')],[_0x02c2('0x75')]);if(_0x2b469b[_0x02c2('0x71')][_0x02c2('0x70')]){delete _0x2b469b[_0x02c2('0x71')][_0x02c2('0x70')];}return db[_0x02c2('0x76')][_0x02c2('0x61')]();})[_0x02c2('0x20')](function(_0x4e5139){if(!_0x4e5139){throw new db[(_0x02c2('0x77'))][(_0x02c2('0x78'))]('no\x20available\x20attributes');}_0x30336e=_[_0x02c2('0x79')](_['keys'](_0x4e5139),[_0x02c2('0x7a'),'updatedAt']);_0x1f8e9a=_[_0x02c2('0x79')](_['keys'](_0x4e5139),[_0x02c2('0x7a'),'updatedAt','CompanyId',_0x02c2('0x7b')]);_0x2b469b[_0x02c2('0x5f')]={'mapKey':_0x02c2('0x7c')};if(_0x2b469b[_0x02c2('0x71')][_0x02c2('0x40')]){switch(_0x2b469b[_0x02c2('0x71')][_0x02c2('0x40')]){case _0x02c2('0x7d'):_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x7e')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x7f')];_0x2b469b['body'][_0x02c2('0x5f')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x80')];_0x2b469b['body']['messageId']=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x81')];break;case _0x02c2('0x82'):_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x7e')]='+'+_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x83')];_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x5f')]=_0x4305f3['body']['text'];break;case _0x02c2('0x84'):_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x7e')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x7e')];_0x2b469b[_0x02c2('0x5f')]['body']=_0x4305f3[_0x02c2('0x5f')]['message'];break;case _0x02c2('0x85'):_0x2b469b['body'][_0x02c2('0x7e')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x7e')];_0x2b469b[_0x02c2('0x5f')]['body']=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x5f')];_0x2b469b['body']['messageId']=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x86')];break;case _0x02c2('0x87'):_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x7e')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x7f')];_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x5f')]=_0x4305f3[_0x02c2('0x5f')]['Text'];_0x2b469b['body'][_0x02c2('0x88')]=_0x4305f3['body']['MessageUUID'];break;case _0x02c2('0x89'):_0x2b469b[_0x02c2('0x5f')]['from']='+'+_0x4305f3[_0x02c2('0x5f')]['results'][0x0][_0x02c2('0x7e')];_0x2b469b['body'][_0x02c2('0x5f')]=_0x4305f3[_0x02c2('0x5f')]['results'][0x0]['text'];_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x88')]=_0x4305f3['body']['results'][0x0][_0x02c2('0x88')];break;case _0x02c2('0x8a'):_0x2b469b[_0x02c2('0x5f')]['from']=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x8b')];_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x5f')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x8c')][_0x02c2('0x27')];break;case _0x02c2('0x8d'):_0x2b469b[_0x02c2('0x5f')]['from']=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x8e')];_0x2b469b['body'][_0x02c2('0x5f')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x8f')];_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x88')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x90')];break;case'bandwidth':_0x2b469b[_0x02c2('0x5f')]['messageId']=_0x4305f3[_0x02c2('0x5f')][0x0]['message']['id'];_0x2b469b['body'][_0x02c2('0x7e')]=_0x4305f3[_0x02c2('0x5f')][0x0]['message'][_0x02c2('0x7e')];_0x2b469b[_0x02c2('0x5f')]['body']=_0x4305f3[_0x02c2('0x5f')][0x0][_0x02c2('0x27')][_0x02c2('0x8f')];break;case _0x02c2('0x91'):_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x7e')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x7e')];_0x2b469b[_0x02c2('0x5f')]['body']=_0x4305f3[_0x02c2('0x5f')]['message'];_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x88')]=_0x4305f3[_0x02c2('0x5f')][_0x02c2('0x92')];break;}}if(_0x2b469b[_0x02c2('0x5f')]['id']){delete _0x2b469b[_0x02c2('0x5f')]['id'];}if(_[_0x02c2('0x93')](_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x7e')])){throw new db['Sequelize']['ValidationError'](_0x02c2('0x94'));}if(_[_0x02c2('0x93')](_0x2b469b['body'][_0x02c2('0x5f')])||_0x2b469b['body'][_0x02c2('0x5f')]===''){throw new db[(_0x02c2('0x77'))][(_0x02c2('0x78'))](_0x02c2('0x95'));}if(_['isNil'](_0x2b469b['body']['mapKey'])){throw new db[(_0x02c2('0x77'))]['ValidationError'](_0x02c2('0x96')+_0x1f8e9a);}if(!_[_0x02c2('0x97')](_0x1f8e9a,_0x2b469b['body'][_0x02c2('0x98')])){throw new db[(_0x02c2('0x77'))][(_0x02c2('0x78'))](_0x02c2('0x99')+_0x1f8e9a);}_0xc6482f[_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x98')]]=_0x2b469b['body'][_0x02c2('0x7e')];return db[_0x02c2('0x9a')][_0x02c2('0x5b')]({'where':{'id':_0x2b469b[_0x02c2('0x71')]['ListId']},'include':[{'model':db[_0x02c2('0x76')],'as':_0x02c2('0x9b'),'where':_0xc6482f,'limit':0x1,'order':[[_0x02c2('0x9c'),_0x02c2('0x9d')]]}]});})[_0x02c2('0x20')](handleEntityNotFound(_0x43584e,null))['then'](function(_0x1270e3){if(_0x1270e3){_0x2b469b[_0x02c2('0x9e')]=_[_0x02c2('0x9f')](_0x1270e3,[_0x02c2('0x9b')]);if(_0x1270e3['Contacts']['length']){return _0x1270e3[_0x02c2('0x9b')][0x0];}var _0xd01d8a=_[_0x02c2('0x1a')](_0x2b469b[_0x02c2('0x5f')],{'firstName':_0x2b469b[_0x02c2('0x5f')]['from'],'ListId':_0x1270e3['id']});_0xd01d8a[_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x98')]]=_0x2b469b[_0x02c2('0x5f')]['from'];return db[_0x02c2('0x76')]['create'](_0xd01d8a,{'fields':_0x30336e,'raw':!![]});}})[_0x02c2('0x20')](handleEntityNotFound(_0x43584e,null))[_0x02c2('0x20')](function(_0x48d54d){if(_0x48d54d){_0x2b469b[_0x02c2('0xa0')]=_0x48d54d;var _0x17e8cc={'ContactId':_0x48d54d['id'],'phone':_0x2b469b['body'][_0x02c2('0x7e')],'SmsAccountId':_0x4305f3[_0x02c2('0x56')]['id']};var _0x178405={'ContactId':_0x48d54d['id'],'SmsAccountId':_0x4305f3['params']['id'],'closed':![]};return db[_0x02c2('0xa1')][_0x02c2('0x5b')]({'where':_0x178405})[_0x02c2('0x20')](function(_0x27c588){if(_0x27c588){return[_0x27c588,![]];}return db[_0x02c2('0xa1')][_0x02c2('0x58')](_0x17e8cc)[_0x02c2('0x20')](function(_0x343795){return[_0x343795,!![]];});});}})[_0x02c2('0xa2')](function(_0x30fad6,_0x4177f9){_0x2b469b[_0x02c2('0xa3')]=_0x30fad6[_0x02c2('0x36')]({'plain':!![]});_0x2b469b[_0x02c2('0xa3')][_0x02c2('0xa4')]=![];if(_0x4177f9){if(_0x2b469b[_0x02c2('0x71')][_0x02c2('0xa5')]){_0x2b469b['applications'][_0x02c2('0xa6')]({'id':0x0,'priority':_0x2b469b[_0x02c2('0x72')][_0x02c2('0x57')]+0x1,'app':_0x02c2('0xa7'),'appdata':_0x02c2('0xa8'),'interval':_0x02c2('0xa9')});}_0x2b469b[_0x02c2('0xa3')][_0x02c2('0xa4')]=!![];}return db['SmsMessage'][_0x02c2('0x58')]({'phone':_0x2b469b[_0x02c2('0x5f')]['from'],'messageId':_0x2b469b[_0x02c2('0x5f')]['messageId'],'body':_0x2b469b[_0x02c2('0x5f')][_0x02c2('0x5f')],'SmsAccountId':_0x4305f3['params']['id'],'SmsInteractionId':_0x30fad6['id'],'direction':'in','ContactId':_0x30fad6[_0x02c2('0xaa')],'AttachmentId':_0x2b469b[_0x02c2('0x5f')][_0x02c2('0xab')]});})[_0x02c2('0x20')](function(_0x1bc381){_0x2b469b[_0x02c2('0x27')]=_0x1bc381;if(_0x2b469b[_0x02c2('0xa3')][_0x02c2('0xac')]){return db[_0x02c2('0xad')][_0x02c2('0x5b')]({'attributes':['id',_0x02c2('0x39')],'where':{'id':_0x2b469b[_0x02c2('0xa3')][_0x02c2('0xac')]}})[_0x02c2('0x20')](function(_0x214fe8){if(_0x214fe8){_0x2b469b[_0x02c2('0x72')][_0x02c2('0xae')]({'id':0x0,'priority':0x0,'app':_0x02c2('0xaf'),'appdata':_0x214fe8['name']+','+(_0x2b469b['account'][_0x02c2('0xb0')]||0xa),'interval':_0x02c2('0xa9')});}return respondWithRpcPromise(_0x02c2('0xb1'),_0x02c2('0xb2'),_0x2b469b);});}return respondWithRpcPromise(_0x02c2('0xb1'),_0x02c2('0xb2'),_0x2b469b);})['then'](function(_0x406623){if(_0x406623){var _0x22eb84=0xc8;var _0x503e37=_0x02c2('0xb3');logger['info'](_0x02c2('0xb4'),_0x503e37,_0x22eb84,_0x02c2('0xb5'));logger[_0x02c2('0x23')](_0x02c2('0xb6'),_0x503e37,_0x22eb84,'entity\x20found',JSON[_0x02c2('0x24')](_0x406623));if(_0x2b469b[_0x02c2('0x71')][_0x02c2('0x40')]===_0x02c2('0x7d')){return _0x43584e[_0x02c2('0x2b')](_0x22eb84)['set'](_0x02c2('0xb7'),_0x02c2('0xb8'))[_0x02c2('0x3a')](_0x02c2('0xb9'));}else{return _0x43584e[_0x02c2('0x2b')](_0x22eb84)['json'](_0x406623);}}})[_0x02c2('0x29')](handleError(_0x43584e,null));};exports[_0x02c2('0xba')]=function(_0x1795f2,_0xd337fc){var _0x1c7328=_0x1795f2[_0x02c2('0x56')]['id'];var _0x3264f8=_0x1795f2['body'];var _0x192c7b=0xc8;var _0x418944=null;return db[_0x02c2('0xbb')][_0x02c2('0xbc')]({'isolationLevel':db[_0x02c2('0xbb')][_0x02c2('0xbd')][_0x02c2('0xbe')]['READ_COMMITTED']},function(_0x5ec981){return db['SmsAccount'][_0x02c2('0x64')]({'where':{'id':_0x1c7328},'transaction':_0x5ec981})[_0x02c2('0x20')](function(_0x57e7e6){if(_0x57e7e6){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x1c7328},'transaction':_0x5ec981})['then'](function(){var _0x18defe=_[_0x02c2('0x3d')](_0x3264f8,function(_0x128eaf){_0x128eaf[_0x02c2('0x63')]=_0x1c7328;return _0x128eaf;});return db[_0x02c2('0x6f')][_0x02c2('0xbf')](_0x18defe,{'transaction':_0x5ec981});});}else{_0x192c7b=0x194;_0x418944=[];}});})['then'](function(){if(_0x192c7b!==0x194){return db[_0x02c2('0x6f')]['findAndCountAll']({'where':{'SmsAccountId':_0x1c7328},'order':_0x02c2('0x74')})['then'](function(_0x178d10){_0x418944=_0x178d10;});}})[_0x02c2('0x29')](function(_0x2b8563){_0x192c7b=0x1f4;logger['error'](_0x2b8563[_0x02c2('0xc0')]);if(_0x2b8563['name']){delete _0x2b8563[_0x02c2('0x39')];}_0x418944=_0x2b8563;})['finally'](function(){if(_0x418944===null){_0xd337fc[_0x02c2('0x2a')](_0x192c7b);}else{if(_0x192c7b===0x1f4){_0xd337fc['status'](_0x192c7b)['send'](_0x418944);}else{_0xd337fc['status'](_0x192c7b)[_0x02c2('0x32')](_0x418944);}}});};exports['getApplications']=function(_0x5e10cd,_0xbd7d9a,_0x3a08a5){var _0x7f03a1={};var _0x18f330={};var _0x16d19c;var _0x5893d9;return db[_0x02c2('0x3e')][_0x02c2('0x64')]({'where':{'id':_0x5e10cd[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0xbd7d9a,null))[_0x02c2('0x20')](function(_0x538a1b){if(_0x538a1b){_0x16d19c=_0x538a1b;_0x18f330[_0x02c2('0x42')]=_[_0x02c2('0x43')](db[_0x02c2('0x6f')][_0x02c2('0x3f')]);_0x18f330[_0x02c2('0x48')]=_['keys'](_0x5e10cd['query']);_0x18f330[_0x02c2('0x44')]=_[_0x02c2('0x45')](_0x18f330[_0x02c2('0x42')],_0x18f330['query']);_0x7f03a1[_0x02c2('0x46')]=_[_0x02c2('0x45')](_0x18f330[_0x02c2('0x42')],qs['fields'](_0x5e10cd['query'][_0x02c2('0x47')]));_0x7f03a1[_0x02c2('0x46')]=_0x7f03a1[_0x02c2('0x46')][_0x02c2('0x57')]?_0x7f03a1[_0x02c2('0x46')]:_0x18f330[_0x02c2('0x42')];_0x7f03a1['order']=qs['sort'](_0x5e10cd[_0x02c2('0x48')][_0x02c2('0x4c')]);_0x7f03a1['where']=qs[_0x02c2('0x44')](_[_0x02c2('0x6b')](_0x5e10cd[_0x02c2('0x48')],_0x18f330[_0x02c2('0x44')]));if(_0x5e10cd['query'][_0x02c2('0x50')]){_0x7f03a1[_0x02c2('0x4d')]=_[_0x02c2('0x4e')](_0x7f03a1['where'],{'$or':_[_0x02c2('0x3d')](_0x7f03a1['attributes'],function(_0x24328f){var _0xbd85f8={};_0xbd85f8[_0x24328f]={'$like':'%'+_0x5e10cd[_0x02c2('0x48')][_0x02c2('0x50')]+'%'};return _0xbd85f8;})});}_0x7f03a1=_[_0x02c2('0x4e')]({},_0x7f03a1,_0x5e10cd[_0x02c2('0x51')]);return _0x16d19c[_0x02c2('0xc1')](_0x7f03a1);}})[_0x02c2('0x20')](function(_0x3e136c){if(_0x3e136c){_0x5893d9=_0x3e136c[_0x02c2('0x57')];if(!_0x5e10cd[_0x02c2('0x48')][_0x02c2('0x49')](_0x02c2('0x4a'))){_0x7f03a1['limit']=qs[_0x02c2('0x2f')](_0x5e10cd['query']['limit']);_0x7f03a1['offset']=qs[_0x02c2('0x2d')](_0x5e10cd[_0x02c2('0x48')]['offset']);}return _0x16d19c[_0x02c2('0xc1')](_0x7f03a1);}})[_0x02c2('0x20')](function(_0x4bc6c7){if(_0x4bc6c7){return _0x4bc6c7?{'count':_0x5893d9,'rows':_0x4bc6c7}:null;}})[_0x02c2('0x20')](respondWithResult(_0xbd7d9a,null))[_0x02c2('0x29')](handleError(_0xbd7d9a,null));};exports[_0x02c2('0xc2')]=function(_0x85b180,_0x56b57b,_0x6f12cb){var _0x27294c={'raw':![],'where':{}};var _0x39d059={};var _0x4531b6={'count':0x0,'rows':[]};return db[_0x02c2('0x3e')][_0x02c2('0x64')]({'where':{'id':_0x85b180[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x56b57b,null))[_0x02c2('0x20')](function(_0x30af09){if(_0x30af09){_0x39d059[_0x02c2('0x42')]=_[_0x02c2('0x43')](db[_0x02c2('0xa1')][_0x02c2('0x3f')]);_0x39d059[_0x02c2('0x48')]=_['keys'](_0x85b180['query']);_0x39d059['filters']=_[_0x02c2('0x45')](_0x39d059[_0x02c2('0x42')],_0x39d059[_0x02c2('0x48')]);_0x27294c[_0x02c2('0x46')]=_[_0x02c2('0x45')](_0x39d059[_0x02c2('0x42')],qs[_0x02c2('0x47')](_0x85b180[_0x02c2('0x48')][_0x02c2('0x47')]));_0x27294c[_0x02c2('0x46')]=_0x27294c['attributes'][_0x02c2('0x57')]?_0x27294c[_0x02c2('0x46')]:_0x39d059[_0x02c2('0x42')];if(!_0x85b180[_0x02c2('0x48')][_0x02c2('0x49')]('nolimit')){_0x27294c[_0x02c2('0x2f')]=qs[_0x02c2('0x2f')](_0x85b180[_0x02c2('0x48')][_0x02c2('0x2f')]);_0x27294c[_0x02c2('0x2d')]=qs[_0x02c2('0x2d')](_0x85b180['query'][_0x02c2('0x2d')]);}_0x27294c[_0x02c2('0x4b')]=qs[_0x02c2('0x4c')](_0x85b180[_0x02c2('0x48')]['sort']);_0x27294c[_0x02c2('0x4d')]=qs[_0x02c2('0x44')](_[_0x02c2('0x6b')](_0x85b180[_0x02c2('0x48')],_0x39d059[_0x02c2('0x44')]));_0x27294c[_0x02c2('0x4d')]['SmsAccountId']=_0x30af09['id'];if(_0x85b180[_0x02c2('0x48')][_0x02c2('0x50')]){_0x27294c[_0x02c2('0x4d')]=_[_0x02c2('0x4e')](_0x27294c[_0x02c2('0x4d')],{'$or':_[_0x02c2('0x3d')](_0x27294c[_0x02c2('0x46')],function(_0xbea770){var _0x14c223={};_0x14c223[_0xbea770]={'$like':'%'+_0x85b180['query']['filter']+'%'};return _0x14c223;})});}_0x27294c=_['merge']({},_0x27294c,_0x85b180[_0x02c2('0x51')]);return db[_0x02c2('0xa1')]['count']({'where':_0x27294c['where']})['then'](function(_0x2abbf0){_0x4531b6['count']=_0x2abbf0;if(_0x85b180['query'][_0x02c2('0x52')]){_0x27294c['include']=[{'model':db[_0x02c2('0x76')],'as':_0x02c2('0xc3'),'required':![]},{'model':db['User'],'as':_0x02c2('0xc4'),'attributes':[_0x02c2('0x39'),_0x02c2('0xc5'),_0x02c2('0xc6')],'required':![]},{'model':db[_0x02c2('0xc7')],'as':_0x02c2('0xc8'),'attributes':['id','name',_0x02c2('0xc9')],'where':_0x85b180[_0x02c2('0x48')][_0x02c2('0xca')]?{'id':_0x85b180[_0x02c2('0x48')][_0x02c2('0xca')]}:undefined,'required':_0x85b180[_0x02c2('0x48')][_0x02c2('0xca')]?!![]:![]}];}return db[_0x02c2('0xa1')][_0x02c2('0x54')](_0x27294c);})['then'](function(_0x3f2746){_0x4531b6['rows']=_0x3f2746;return _0x4531b6;});}})[_0x02c2('0x20')](respondWithFilteredResult(_0x56b57b,_0x27294c))[_0x02c2('0x29')](handleError(_0x56b57b,null));};exports[_0x02c2('0x3a')]=function(_0x387050,_0x2330f0,_0x39386c){var _0x2375f7,_0x422603,_0x39a7d6;if(_['isNil'](_0x387050['body'][_0x02c2('0x5f')])||_0x387050[_0x02c2('0x5f')]['body']===''){throw new db['Sequelize'][(_0x02c2('0x78'))](_0x02c2('0x95'));}if(_['isNil'](_0x387050[_0x02c2('0x5f')]['to'])){throw new db['Sequelize'][(_0x02c2('0x78'))](_0x02c2('0xcb'));}_0x2375f7=_0x387050['body']['to'];return db[_0x02c2('0x3e')][_0x02c2('0x5b')]({'where':{'id':_0x387050[_0x02c2('0x56')]['id']},'include':[{'model':db[_0x02c2('0x9a')],'as':_0x02c2('0xcc'),'include':[{'model':db[_0x02c2('0x76')],'as':_0x02c2('0x9b'),'where':{'mobile':_0x2375f7},'limit':0x1,'order':[[_0x02c2('0x9c'),_0x02c2('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x2330f0,null))[_0x02c2('0x20')](function(_0x4194d3){if(_0x4194d3&&_0x4194d3['List']){_0x422603=_0x4194d3['get']({'plain':!![]});if(_0x422603[_0x02c2('0xcc')]&&_0x422603[_0x02c2('0xcc')]['Contacts'][_0x02c2('0x57')]){return _0x422603[_0x02c2('0xcc')][_0x02c2('0x9b')][0x0];}return db[_0x02c2('0x76')]['create'](_[_0x02c2('0x1a')](_0x387050[_0x02c2('0x5f')],{'firstName':_0x2375f7,'mobile':_0x2375f7,'phone':_0x2375f7,'ListId':_0x422603['ListId']}));}})[_0x02c2('0x20')](handleEntityNotFound(_0x2330f0,null))[_0x02c2('0x20')](function(_0xdeebb5){if(_0xdeebb5){_0x39a7d6=_0xdeebb5;return db[_0x02c2('0xa1')][_0x02c2('0x5b')]({'where':{'ContactId':_0x39a7d6['id'],'closed':![],'SmsAccountId':_0x422603['id']}})[_0x02c2('0x20')](function(_0x270ec2){if(_0x270ec2){return[_0x270ec2,![]];}return db['SmsInteraction'][_0x02c2('0x58')]({'UserId':_0x387050[_0x02c2('0xcd')]['id'],'ContactId':_0x39a7d6['id'],'SmsAccountId':_0x422603['id'],'phone':_0x2375f7,'firstMsgDirection':_0x02c2('0xce'),'Messages':[_['merge'](_0x387050[_0x02c2('0x5f')],{'read':![],'body':_0x387050[_0x02c2('0x5f')][_0x02c2('0x5f')],'phone':_0x2375f7,'SmsAccountId':_0x422603['id'],'UserId':_0x387050[_0x02c2('0xcd')]['id'],'ContactId':_0x39a7d6['id']})]},{'include':[{'model':db[_0x02c2('0xcf')],'as':'Messages'}]})['then'](function(_0x1ffe3e){return[_0x1ffe3e,!![]];});});}})[_0x02c2('0xa2')](function(_0x48370b,_0x19a223){if(_0x19a223){return _0x48370b;}return db[_0x02c2('0xcf')][_0x02c2('0x58')](_[_0x02c2('0x4e')](_0x387050['body'],{'read':![],'body':_0x387050[_0x02c2('0x5f')][_0x02c2('0x5f')],'phone':_0x2375f7,'SmsAccountId':_0x422603['id'],'SmsInteractionId':_0x48370b['id'],'UserId':_0x387050[_0x02c2('0xcd')]['id'],'ContactId':_0x39a7d6['id']}))[_0x02c2('0x20')](function(_0x141425){_0x48370b['dataValues'][_0x02c2('0xd0')]=[];_0x48370b[_0x02c2('0xd1')][_0x02c2('0xd0')][_0x02c2('0xa6')](_0x141425[_0x02c2('0xd1')]);return _0x48370b;});})[_0x02c2('0x20')](respondWithResult(_0x2330f0,null))[_0x02c2('0x29')](handleError(_0x2330f0,null));};exports[_0x02c2('0x2b')]=function(_0x68c07f,_0x10aa0f,_0x43ee03){if(_0x68c07f[_0x02c2('0x5f')]['id']){delete _0x68c07f[_0x02c2('0x5f')]['id'];}var _0x18d2a5,_0x493e37,_0x433c53;return db[_0x02c2('0x3e')][_0x02c2('0x5b')]({'where':{'id':_0x68c07f[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x10aa0f,null))['then'](function(_0x25a658){if(_0x25a658){_0x433c53=_0x25a658;logger[_0x02c2('0x23')](_0x02c2('0xb4'),'status','received\x20delivery\x20report\x20from',_0x25a658[_0x02c2('0x40')],util[_0x02c2('0xd2')](_0x68c07f[_0x02c2('0x5f')],{'showHidden':![],'depth':null}));switch(_0x25a658[_0x02c2('0x40')]){case _0x02c2('0x82'):if(_0x68c07f[_0x02c2('0x5f')]['skebby_dispatch_id']&&_0x68c07f[_0x02c2('0x5f')][_0x02c2('0x2b')]){_0x493e37=_0x68c07f['body'][_0x02c2('0x2b')];return db['SmsMessage'][_0x02c2('0x5b')]({'where':{'messageId':_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xd3')]}});}break;case _0x02c2('0x84'):if(_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xd4')]&&_0x68c07f[_0x02c2('0x5f')]['statusInt']){_0x493e37=_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xd5')];return db[_0x02c2('0xcf')][_0x02c2('0x5b')]({'where':{'messageId':_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xd4')]}});}break;case _0x02c2('0x85'):if(_0x68c07f['body'][_0x02c2('0x86')]&&_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xd6')]){_0x493e37=_0x68c07f['body'][_0x02c2('0xd6')];return db[_0x02c2('0xcf')]['find']({'where':{'messageId':_0x68c07f['body'][_0x02c2('0x86')]}});}break;case _0x02c2('0x89'):var _0x1690e0=_0x68c07f['body'][_0x02c2('0xd7')][0x0];if(_0x1690e0[_0x02c2('0x88')]&&_0x1690e0[_0x02c2('0x2b')][_0x02c2('0xd8')]===_0x02c2('0xd9')){_0x493e37=_0x1690e0[_0x02c2('0x2b')]['groupName'];return db['SmsMessage'][_0x02c2('0x5b')]({'where':{'messageId':_0x1690e0[_0x02c2('0x88')]}});}break;case'clickatell':if(_0x68c07f[_0x02c2('0x5f')][_0x02c2('0x88')]&&_0x68c07f[_0x02c2('0x5f')][_0x02c2('0x2b')]){_0x493e37=_0x68c07f['body'][_0x02c2('0x2b')];return db['SmsMessage'][_0x02c2('0x5b')]({'where':{'messageId':_0x68c07f['body'][_0x02c2('0x88')]}});}break;case _0x02c2('0xda'):if(_0x68c07f[_0x02c2('0x5f')][0x0]['message']['id']){_0x493e37=_0x68c07f[_0x02c2('0x5f')][0x0][_0x02c2('0x40')];return db[_0x02c2('0xcf')][_0x02c2('0x5b')]({'where':{'messageId':_0x68c07f[_0x02c2('0x5f')][0x0]['message']['id']}});}break;case _0x02c2('0x91'):if(_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xdb')]&&_0x68c07f[_0x02c2('0x5f')][_0x02c2('0x2b')]){_0x493e37=_0x68c07f['body']['status'];return db[_0x02c2('0xcf')][_0x02c2('0x5b')]({'where':{'messageId':_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x10aa0f,null))[_0x02c2('0x20')](function(_0x24ae85){if(_0x24ae85){_0x18d2a5=_0x24ae85;switch(_0x433c53[_0x02c2('0x40')]){case _0x02c2('0x82'):if(_0x493e37===_0x02c2('0xd9')){return _0x18d2a5['update']({'read':!![]});}else{logger[_0x02c2('0x25')](_0x02c2('0xb4'),_0x02c2('0x2b'),_0x02c2('0x82'),util['inspect'](_0x68c07f[_0x02c2('0x5f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x493e37==='1'){return _0x18d2a5[_0x02c2('0x5e')]({'read':!![]});}else{logger[_0x02c2('0x25')](_0x02c2('0xb4'),_0x02c2('0x2b'),'skebby',util[_0x02c2('0xd2')](_0x68c07f['body'],{'showHidden':![],'depth':null}));}break;case _0x02c2('0x85'):if(!_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xdc')]&&_0x493e37>=0xc8&&_0x493e37<=0xce){return _0x18d2a5[_0x02c2('0x5e')]({'read':!![]});}else{logger[_0x02c2('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x02c2('0x2b'),_0x02c2('0x85'),util[_0x02c2('0xd2')](_0x68c07f['body'],{'showHidden':![],'depth':null}));}break;case _0x02c2('0x89'):var _0x4a84da=_0x68c07f[_0x02c2('0x5f')][_0x02c2('0xd7')][0x0];if(_0x4a84da['status'][_0x02c2('0xd8')]===_0x02c2('0xd9')){return _0x18d2a5['update']({'read':!![]});}else{logger[_0x02c2('0x25')](_0x02c2('0xb4'),_0x02c2('0x2b'),_0x02c2('0x89'),util['inspect'](_0x68c07f[_0x02c2('0x5f')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x493e37==_0x02c2('0xdd')||_0x493e37==_0x02c2('0xde')){return _0x18d2a5[_0x02c2('0x5e')]({'read':!![]});}else{logger[_0x02c2('0x25')](_0x02c2('0xb4'),_0x02c2('0x2b'),'clickatell',util[_0x02c2('0xd2')](_0x68c07f['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x493e37=='message-delivered'){return _0x18d2a5['update']({'read':!![]});}else{logger[_0x02c2('0x25')](_0x02c2('0xb4'),'status',_0x02c2('0xda'),util['inspect'](_0x68c07f['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x493e37==='DELIVRD'||_0x493e37==='ACCEPTD'){return _0x18d2a5['update']({'read':!![]});}else{logger[_0x02c2('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x02c2('0x2b'),_0x02c2('0x91'),util[_0x02c2('0xd2')](_0x68c07f['body'],{'showHidden':![],'depth':null}));}break;}return _0x18d2a5;}})[_0x02c2('0x20')](respondWithResult(_0x10aa0f,null))[_0x02c2('0x29')](handleError(_0x10aa0f,null));};exports['statusGet']=function(_0xea2ced,_0x5074a3,_0x3ce6eb){var _0x16b44e,_0x20849d,_0x1b368a;return db[_0x02c2('0x3e')]['find']({'where':{'id':_0xea2ced[_0x02c2('0x56')]['id']}})['then'](handleEntityNotFound(_0x5074a3,null))[_0x02c2('0x20')](function(_0x3f9a67){if(_0x3f9a67){_0x1b368a=_0x3f9a67;logger[_0x02c2('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x02c2('0xdf'),_0x3f9a67[_0x02c2('0x40')],util['inspect'](_0xea2ced[_0x02c2('0x48')],{'showHidden':![],'depth':null}));switch(_0x3f9a67[_0x02c2('0x40')]){case _0x02c2('0x8a'):if(_0xea2ced['query'][_0x02c2('0xe0')]&&_0xea2ced['query'][_0x02c2('0xe1')]){_0x20849d=_0xea2ced[_0x02c2('0x48')][_0x02c2('0xe1')];return db['SmsMessage'][_0x02c2('0x5b')]({'where':{'messageId':_0xea2ced[_0x02c2('0x48')][_0x02c2('0xe0')]}});}break;}}})[_0x02c2('0x20')](handleEntityNotFound(_0x5074a3,null))[_0x02c2('0x20')](function(_0x49ef2b){if(_0x49ef2b){_0x16b44e=_0x49ef2b;switch(_0x1b368a[_0x02c2('0x40')]){case _0x02c2('0x8a'):if(_0x20849d==='2'||_0x20849d==='6'){return _0x16b44e[_0x02c2('0x5e')]({'read':!![]});}else{logger[_0x02c2('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x02c2('0x8a'),util[_0x02c2('0xd2')](_0xea2ced[_0x02c2('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x16b44e;}})[_0x02c2('0x20')](respondWithResult(_0x5074a3,null))[_0x02c2('0x29')](handleError(_0x5074a3,null));};exports['addAgents']=function(_0x2e1ffe,_0x373c3f,_0x54a38a){return db[_0x02c2('0x3e')][_0x02c2('0x5b')]({'where':{'id':_0x2e1ffe[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x373c3f,null))[_0x02c2('0x20')](function(_0x33e322){if(_0x33e322){return _0x33e322['addAgents'](_0x2e1ffe[_0x02c2('0x5f')]['ids'],_[_0x02c2('0x9f')](_0x2e1ffe['body'],[_0x02c2('0x68'),'id'])||{})[_0x02c2('0xa2')](function(_0xa7572e){for(var _0x2cb706=0x0;_0x2cb706<_0x2e1ffe[_0x02c2('0x5f')][_0x02c2('0x68')][_0x02c2('0x57')];_0x2cb706+=0x1){socket['emit'](_0x02c2('0xe2'),{'UserId':Number(_0x2e1ffe[_0x02c2('0x5f')][_0x02c2('0x68')][_0x2cb706]),'SmsAccountId':Number(_0x2e1ffe[_0x02c2('0x56')]['id'])});}return _0xa7572e;});}})[_0x02c2('0x20')](respondWithResult(_0x373c3f,null))[_0x02c2('0x29')](handleError(_0x373c3f,null));};exports['removeAgents']=function(_0x570b4f,_0x24f6cb,_0x570f62){return db[_0x02c2('0x3e')][_0x02c2('0x5b')]({'where':{'id':_0x570b4f[_0x02c2('0x56')]['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x24f6cb,null))[_0x02c2('0x20')](function(_0x1175b7){if(_0x1175b7){return _0x1175b7[_0x02c2('0xe3')](_0x570b4f[_0x02c2('0x48')]['ids'])[_0x02c2('0x20')](function(){if(_[_0x02c2('0xe4')](_0x570b4f[_0x02c2('0x48')]['ids'])){for(var _0x1467c1=0x0;_0x1467c1<_0x570b4f[_0x02c2('0x48')][_0x02c2('0x68')][_0x02c2('0x57')];_0x1467c1+=0x1){socket['emit'](_0x02c2('0xe5'),{'UserId':Number(_0x570b4f[_0x02c2('0x48')][_0x02c2('0x68')][_0x1467c1]),'SmsAccountId':Number(_0x570b4f[_0x02c2('0x56')]['id'])});}}else{socket[_0x02c2('0xe6')]('userSmsAccount:remove',{'UserId':Number(_0x570b4f[_0x02c2('0x48')]['ids']),'SmsAccountId':Number(_0x570b4f[_0x02c2('0x56')]['id'])});}});}})[_0x02c2('0x20')](respondWithStatusCode(_0x24f6cb,null))['catch'](handleError(_0x24f6cb,null));};exports[_0x02c2('0xe7')]=function(_0x18544e,_0x1c5f85,_0x36d6ef){var _0x5c21a8={};var _0x1a309a={};var _0xe644b3;var _0x38767f;return db['SmsAccount']['findOne']({'where':{'id':_0x18544e['params']['id']}})[_0x02c2('0x20')](handleEntityNotFound(_0x1c5f85,null))[_0x02c2('0x20')](function(_0x34168f){if(_0x34168f){_0xe644b3=_0x34168f;_0x1a309a['model']=_['keys'](db['User'][_0x02c2('0x3f')]);_0x1a309a['query']=_['keys'](_0x18544e[_0x02c2('0x48')]);_0x1a309a['filters']=_[_0x02c2('0x45')](_0x1a309a[_0x02c2('0x42')],_0x1a309a[_0x02c2('0x48')]);_0x5c21a8[_0x02c2('0x46')]=_[_0x02c2('0x45')](_0x1a309a[_0x02c2('0x42')],qs[_0x02c2('0x47')](_0x18544e[_0x02c2('0x48')][_0x02c2('0x47')]));_0x5c21a8[_0x02c2('0x46')]=_0x5c21a8['attributes'][_0x02c2('0x57')]?_0x5c21a8[_0x02c2('0x46')]:_0x1a309a['model'];_0x5c21a8[_0x02c2('0x4b')]=qs[_0x02c2('0x4c')](_0x18544e['query'][_0x02c2('0x4c')]);_0x5c21a8[_0x02c2('0x4d')]=qs[_0x02c2('0x44')](_[_0x02c2('0x6b')](_0x18544e[_0x02c2('0x48')],_0x1a309a[_0x02c2('0x44')]));if(_0x18544e['query']['filter']){_0x5c21a8[_0x02c2('0x4d')]=_[_0x02c2('0x4e')](_0x5c21a8[_0x02c2('0x4d')],{'$or':_[_0x02c2('0x3d')](_0x5c21a8[_0x02c2('0x46')],function(_0x470ad9){var _0x187e14={};_0x187e14[_0x470ad9]={'$like':'%'+_0x18544e[_0x02c2('0x48')][_0x02c2('0x50')]+'%'};return _0x187e14;})});}_0x5c21a8=_[_0x02c2('0x4e')]({},_0x5c21a8,_0x18544e[_0x02c2('0x51')]);return _0xe644b3[_0x02c2('0xe7')](_0x5c21a8);}})[_0x02c2('0x20')](function(_0xf8a553){if(_0xf8a553){_0x38767f=_0xf8a553['length'];if(!_0x18544e[_0x02c2('0x48')][_0x02c2('0x49')](_0x02c2('0x4a'))){_0x5c21a8[_0x02c2('0x2f')]=qs['limit'](_0x18544e[_0x02c2('0x48')][_0x02c2('0x2f')]);_0x5c21a8['offset']=qs[_0x02c2('0x2d')](_0x18544e[_0x02c2('0x48')]['offset']);}return _0xe644b3['getAgents'](_0x5c21a8);}})[_0x02c2('0x20')](function(_0x3378b7){if(_0x3378b7){return _0x3378b7?{'count':_0x38767f,'rows':_0x3378b7}:null;}})[_0x02c2('0x20')](respondWithResult(_0x1c5f85,null))[_0x02c2('0x29')](handleError(_0x1c5f85,null));}; \ No newline at end of file +var _0x9e67=['Content-Range','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','Sequelize','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','status_code','message_id','groupName','clickatell','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x9e67,0x199));var _0x79e6=function(_0x14ffb8,_0x41cec7){_0x14ffb8=_0x14ffb8-0x0;var _0x12b1f8=_0x9e67[_0x14ffb8];return _0x12b1f8;};'use strict';var emlformat=require(_0x79e6('0x0'));var rimraf=require(_0x79e6('0x1'));var zipdir=require(_0x79e6('0x2'));var jsonpatch=require(_0x79e6('0x3'));var rp=require('request-promise');var moment=require(_0x79e6('0x4'));var BPromise=require(_0x79e6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79e6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x79e6('0x7'));var fs=require('fs');var fs_extra=require(_0x79e6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79e6('0x9'));var deskjs=require(_0x79e6('0xa'));var toCsv=require(_0x79e6('0xb'));var querystring=require(_0x79e6('0xc'));var Papa=require(_0x79e6('0xd'));var Redis=require(_0x79e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x79e6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79e6('0x10'));var logger=require(_0x79e6('0x11'))('api');var utils=require(_0x79e6('0x12'));var config=require(_0x79e6('0x13'));var licenseUtil=require(_0x79e6('0x14'));var db=require(_0x79e6('0x15'))['db'];config[_0x79e6('0x16')]=_[_0x79e6('0x17')](config[_0x79e6('0x16')],{'host':_0x79e6('0x18'),'port':0x18eb});var socket=require(_0x79e6('0x19'))(new Redis(config[_0x79e6('0x16')]));require(_0x79e6('0x1a'))[_0x79e6('0x1b')](socket);var jayson=require(_0x79e6('0x1c'));var client=jayson[_0x79e6('0x1d')][_0x79e6('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x52dd00,_0x2489a8,_0x199fc6,_0x2eb415){return new BPromise(function(_0x2d70ac,_0xfc0975){var _0x1e0724=_0x2eb415||client;return _0x1e0724['request'](_0x52dd00,_0x199fc6)[_0x79e6('0x1f')](function(_0x472b9c){logger[_0x79e6('0x20')](_0x79e6('0x21'),_0x2489a8,_0x79e6('0x22'));logger['debug'](_0x79e6('0x23'),_0x2489a8,'request\x20sent',JSON[_0x79e6('0x24')](_0x472b9c));if(_0x472b9c[_0x79e6('0x25')]){if(_0x472b9c['error'][_0x79e6('0x26')]===0x1f4){logger[_0x79e6('0x25')](_0x79e6('0x21'),_0x2489a8,_0x472b9c[_0x79e6('0x25')]['message']);return _0xfc0975(_0x472b9c['error'][_0x79e6('0x27')]);}logger[_0x79e6('0x25')](_0x79e6('0x21'),_0x2489a8,_0x472b9c['error'][_0x79e6('0x27')]);return _0x2d70ac(_0x472b9c[_0x79e6('0x25')]['message']);}else{logger[_0x79e6('0x20')](_0x79e6('0x21'),_0x2489a8,'request\x20sent');_0x2d70ac(_0x472b9c[_0x79e6('0x28')]['message']);}})[_0x79e6('0x29')](function(_0x504370){logger[_0x79e6('0x25')](_0x79e6('0x21'),_0x2489a8,_0x504370);_0xfc0975(_0x504370);});});}function respondWithStatusCode(_0x4d1631,_0x5efcf9){_0x5efcf9=_0x5efcf9||0xcc;return function(_0x26fa3f){if(_0x26fa3f){return _0x4d1631[_0x79e6('0x2a')](_0x5efcf9);}return _0x4d1631[_0x79e6('0x2b')](_0x5efcf9)[_0x79e6('0x2c')]();};}function respondWithResult(_0x2255ac,_0x509a69){_0x509a69=_0x509a69||0xc8;return function(_0x4f6004){if(_0x4f6004){return _0x2255ac[_0x79e6('0x2b')](_0x509a69)[_0x79e6('0x2d')](_0x4f6004);}};}function respondWithFilteredResult(_0x33ec89,_0x16b233){return function(_0x4352fb){if(_0x4352fb){var _0x4bfcf0=typeof _0x16b233['offset']===_0x79e6('0x2e')&&typeof _0x16b233[_0x79e6('0x2f')]===_0x79e6('0x2e');var _0x1cdffd=_0x4352fb['count'];var _0x16f429=_0x4bfcf0?0x0:_0x16b233['offset'];var _0x386990=_0x4bfcf0?_0x4352fb[_0x79e6('0x30')]:_0x16b233[_0x79e6('0x31')]+_0x16b233[_0x79e6('0x2f')];var _0x84395f;if(_0x386990>=_0x1cdffd){_0x386990=_0x1cdffd;_0x84395f=0xc8;}else{_0x84395f=0xce;}_0x33ec89[_0x79e6('0x2b')](_0x84395f);return _0x33ec89[_0x79e6('0x32')](_0x79e6('0x33'),_0x16f429+'-'+_0x386990+'/'+_0x1cdffd)['json'](_0x4352fb);}return null;};}function patchUpdates(_0x59cbf0){return function(_0x392b7e){try{jsonpatch['apply'](_0x392b7e,_0x59cbf0,!![]);}catch(_0x53efb1){return BPromise[_0x79e6('0x34')](_0x53efb1);}return _0x392b7e[_0x79e6('0x35')]();};}function saveUpdates(_0x179669,_0x5265a5){return function(_0x4571f6){if(_0x4571f6){return _0x4571f6['update'](_0x179669)[_0x79e6('0x1f')](function(_0x117758){return _0x117758;});}return null;};}function removeEntity(_0x3ef4b1,_0x1d6713){return function(_0x5d7eb0){if(_0x5d7eb0){return _0x5d7eb0[_0x79e6('0x36')]()['then'](function(){var _0x362230=_0x5d7eb0[_0x79e6('0x37')]({'plain':!![]});var _0x4f40e9='SmsAccounts';return db[_0x79e6('0x38')][_0x79e6('0x36')]({'where':{'type':_0x4f40e9,'resourceId':_0x362230['id']}})[_0x79e6('0x1f')](function(){return _0x5d7eb0;});})[_0x79e6('0x1f')](function(){_0x3ef4b1[_0x79e6('0x2b')](0xcc)[_0x79e6('0x2c')]();});}};}function handleEntityNotFound(_0xe1c48c,_0x338e68){return function(_0x43a7a1){if(!_0x43a7a1){_0xe1c48c[_0x79e6('0x2a')](0x194);}return _0x43a7a1;};}function handleError(_0x55b7be,_0x30053f){_0x30053f=_0x30053f||0x1f4;return function(_0x471e63){logger[_0x79e6('0x25')](_0x471e63[_0x79e6('0x39')]);if(_0x471e63[_0x79e6('0x3a')]){delete _0x471e63[_0x79e6('0x3a')];}_0x55b7be[_0x79e6('0x2b')](_0x30053f)[_0x79e6('0x3b')](_0x471e63);};}exports[_0x79e6('0x3c')]=function(_0x5c2c85,_0x3486b4){var _0x44e11b={'include':[{'model':db[_0x79e6('0x3d')],'as':_0x79e6('0x3e')}]},_0x1391f5={},_0x3b136a={'count':0x0,'rows':[]};var _0x5b79bc=_[_0x79e6('0x3f')](db[_0x79e6('0x40')][_0x79e6('0x41')],function(_0x3a72b8){return{'name':_0x3a72b8[_0x79e6('0x42')],'type':_0x3a72b8['type']['key']};});_0x1391f5[_0x79e6('0x43')]=_[_0x79e6('0x3f')](_0x5b79bc,_0x79e6('0x3a'));_0x1391f5['query']=_[_0x79e6('0x44')](_0x5c2c85[_0x79e6('0x45')]);_0x1391f5[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x1391f5['model'],_0x1391f5[_0x79e6('0x45')]);_0x44e11b[_0x79e6('0x48')]=_['intersection'](_0x1391f5[_0x79e6('0x43')],qs[_0x79e6('0x49')](_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x49')]));_0x44e11b[_0x79e6('0x48')]=_0x44e11b[_0x79e6('0x48')]['length']?_0x44e11b['attributes']:_0x1391f5[_0x79e6('0x43')];if(!_0x5c2c85['query'][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0x44e11b['limit']=qs[_0x79e6('0x2f')](_0x5c2c85['query'][_0x79e6('0x2f')]);_0x44e11b[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x31')]);}_0x44e11b[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x5c2c85[_0x79e6('0x45')]['sort']);_0x44e11b[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x5c2c85[_0x79e6('0x45')],_0x1391f5[_0x79e6('0x46')]),_0x5b79bc);if(_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x50')]){_0x44e11b['where']=_[_0x79e6('0x51')](_0x44e11b['where'],{'$or':_[_0x79e6('0x3f')](_0x5b79bc,function(_0x44901b){if(_0x44901b[_0x79e6('0x52')]!==_0x79e6('0x53')){var _0x10011f={};_0x10011f[_0x44901b[_0x79e6('0x3a')]]={'$like':'%'+_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x50')]+'%'};return _0x10011f;}})});}_0x44e11b=_[_0x79e6('0x51')]({},_0x44e11b,_0x5c2c85[_0x79e6('0x54')]);var _0x4fc4eb={'where':_0x44e11b[_0x79e6('0x4e')]};return db[_0x79e6('0x40')][_0x79e6('0x30')](_0x4fc4eb)[_0x79e6('0x1f')](function(_0x5f208e){_0x3b136a[_0x79e6('0x30')]=_0x5f208e;if(_0x5c2c85['query'][_0x79e6('0x55')]){_0x44e11b['include']=[{'all':!![]}];}return db['SmsAccount'][_0x79e6('0x56')](_0x44e11b);})[_0x79e6('0x1f')](function(_0x1f4c48){_0x3b136a[_0x79e6('0x57')]=_0x1f4c48;return _0x3b136a;})[_0x79e6('0x1f')](respondWithFilteredResult(_0x3486b4,_0x44e11b))[_0x79e6('0x29')](handleError(_0x3486b4,null));};exports[_0x79e6('0x58')]=function(_0x12b455,_0x3d6bd3){var _0xb9960={'raw':![],'where':{'id':_0x12b455['params']['id']},'include':[{'model':db[_0x79e6('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5725bc={};_0x5725bc['model']=_[_0x79e6('0x44')](db['SmsAccount'][_0x79e6('0x41')]);_0x5725bc['query']=_[_0x79e6('0x44')](_0x12b455[_0x79e6('0x45')]);_0x5725bc[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x5725bc[_0x79e6('0x43')],_0x5725bc[_0x79e6('0x45')]);_0xb9960[_0x79e6('0x48')]=_[_0x79e6('0x47')](_0x5725bc[_0x79e6('0x43')],qs['fields'](_0x12b455[_0x79e6('0x45')]['fields']));_0xb9960[_0x79e6('0x48')]=_0xb9960[_0x79e6('0x48')]['length']?_0xb9960[_0x79e6('0x48')]:_0x5725bc[_0x79e6('0x43')];if(_0x12b455[_0x79e6('0x45')][_0x79e6('0x55')]){_0xb9960[_0x79e6('0x59')]=[{'all':!![]}];}_0xb9960=_['merge']({},_0xb9960,_0x12b455[_0x79e6('0x54')]);return db[_0x79e6('0x40')][_0x79e6('0x5a')](_0xb9960)['then'](handleEntityNotFound(_0x3d6bd3,null))[_0x79e6('0x1f')](respondWithResult(_0x3d6bd3,null))[_0x79e6('0x29')](handleError(_0x3d6bd3,null));};exports[_0x79e6('0x5b')]=function(_0xfcf1ec,_0x2ebbef){return db[_0x79e6('0x40')][_0x79e6('0x5b')](_0xfcf1ec['body'],{})[_0x79e6('0x1f')](function(_0x36d3e3){var _0x220ba9=_0xfcf1ec[_0x79e6('0x5c')][_0x79e6('0x37')]({'plain':!![]});if(!_0x220ba9)throw new Error(_0x79e6('0x5d'));if(_0x220ba9[_0x79e6('0x5e')]===_0x79e6('0x5c')){var _0x330201=_0x36d3e3['get']({'plain':!![]});var _0x407796=_0x79e6('0x5f');return db[_0x79e6('0x60')][_0x79e6('0x5a')]({'where':{'name':_0x407796,'userProfileId':_0x220ba9[_0x79e6('0x61')]},'raw':!![]})[_0x79e6('0x1f')](function(_0x3c54b5){if(_0x3c54b5&&_0x3c54b5['autoAssociation']===0x0){return db[_0x79e6('0x38')][_0x79e6('0x5b')]({'name':_0x330201[_0x79e6('0x3a')],'resourceId':_0x330201['id'],'type':_0x3c54b5[_0x79e6('0x3a')],'sectionId':_0x3c54b5['id']},{})[_0x79e6('0x1f')](function(){return _0x36d3e3;});}else{return _0x36d3e3;}})['catch'](function(_0x1af3a2){logger[_0x79e6('0x25')](_0x79e6('0x62'),_0x1af3a2);throw _0x1af3a2;});}return _0x36d3e3;})['then'](respondWithResult(_0x2ebbef,0xc9))[_0x79e6('0x29')](handleError(_0x2ebbef,null));};exports[_0x79e6('0x63')]=function(_0x32a3bd,_0x2083bb){if(_0x32a3bd[_0x79e6('0x64')]['id']){delete _0x32a3bd[_0x79e6('0x64')]['id'];}return db[_0x79e6('0x40')]['find']({'where':{'id':_0x32a3bd[_0x79e6('0x65')]['id']},'include':[{'model':db[_0x79e6('0x3d')],'as':_0x79e6('0x3e')}]})['then'](handleEntityNotFound(_0x2083bb,null))[_0x79e6('0x1f')](saveUpdates(_0x32a3bd[_0x79e6('0x64')],null))[_0x79e6('0x1f')](respondWithResult(_0x2083bb,null))[_0x79e6('0x29')](handleError(_0x2083bb,null));};exports[_0x79e6('0x36')]=function(_0x415297,_0xd6cb3a){return db[_0x79e6('0x40')]['find']({'where':{'id':_0x415297['params']['id']}})['then'](handleEntityNotFound(_0xd6cb3a,null))[_0x79e6('0x1f')](removeEntity(_0xd6cb3a,null))[_0x79e6('0x29')](handleError(_0xd6cb3a,null));};exports[_0x79e6('0x66')]=function(_0x3b78e6,_0x2d84b2){return db['SmsAccount'][_0x79e6('0x66')]()[_0x79e6('0x1f')](respondWithResult(_0x2d84b2,null))[_0x79e6('0x29')](handleError(_0x2d84b2,null));};exports['addDisposition']=function(_0x28973b,_0x65eabf,_0x21238d){if(_0x28973b[_0x79e6('0x64')]['id']){delete _0x28973b[_0x79e6('0x64')]['id'];}return db[_0x79e6('0x40')]['find']({'where':{'id':_0x28973b[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x65eabf,null))['then'](function(_0x5aa7c9){if(_0x5aa7c9){_0x28973b[_0x79e6('0x64')][_0x79e6('0x67')]=_0x5aa7c9['id'];return db[_0x79e6('0x68')][_0x79e6('0x5b')](_0x28973b['body']);}})[_0x79e6('0x1f')](respondWithResult(_0x65eabf,null))[_0x79e6('0x29')](handleError(_0x65eabf,null));};exports[_0x79e6('0x69')]=function(_0x31e579,_0x384095,_0x4fc211){var _0x9e728a={'raw':![],'where':{}};var _0x2805d6={};var _0x249287={'count':0x0,'rows':[]};return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x31e579['params']['id']}})['then'](handleEntityNotFound(_0x384095,null))['then'](function(_0x5576a3){if(_0x5576a3){_0x2805d6[_0x79e6('0x43')]=_[_0x79e6('0x44')](db['Disposition'][_0x79e6('0x41')]);_0x2805d6[_0x79e6('0x45')]=_[_0x79e6('0x44')](_0x31e579['query']);_0x2805d6[_0x79e6('0x46')]=_['intersection'](_0x2805d6[_0x79e6('0x43')],_0x2805d6[_0x79e6('0x45')]);_0x9e728a[_0x79e6('0x48')]=_[_0x79e6('0x47')](_0x2805d6[_0x79e6('0x43')],qs[_0x79e6('0x49')](_0x31e579['query'][_0x79e6('0x49')]));_0x9e728a[_0x79e6('0x48')]=_0x9e728a['attributes']['length']?_0x9e728a[_0x79e6('0x48')]:_0x2805d6['model'];if(!_0x31e579['query'][_0x79e6('0x4a')]('nolimit')){_0x9e728a[_0x79e6('0x2f')]=qs['limit'](_0x31e579['query']['limit']);_0x9e728a[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x31e579['query'][_0x79e6('0x31')]);}_0x9e728a[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x31e579['query']['sort']);_0x9e728a['where']=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x31e579[_0x79e6('0x45')],_0x2805d6[_0x79e6('0x46')]));_0x9e728a[_0x79e6('0x4e')][_0x79e6('0x67')]=_0x5576a3['id'];if(_0x31e579[_0x79e6('0x45')][_0x79e6('0x50')]){_0x9e728a[_0x79e6('0x4e')]=_[_0x79e6('0x51')](_0x9e728a[_0x79e6('0x4e')],{'$or':_[_0x79e6('0x3f')](_0x9e728a[_0x79e6('0x48')],function(_0x192e82){var _0x1fbe07={};_0x1fbe07[_0x192e82]={'$like':'%'+_0x31e579['query'][_0x79e6('0x50')]+'%'};return _0x1fbe07;})});}_0x9e728a=_[_0x79e6('0x51')]({},_0x9e728a,_0x31e579[_0x79e6('0x54')]);return db[_0x79e6('0x68')][_0x79e6('0x30')]({'where':_0x9e728a[_0x79e6('0x4e')]})[_0x79e6('0x1f')](function(_0x5f396c){_0x249287['count']=_0x5f396c;if(_0x31e579[_0x79e6('0x45')][_0x79e6('0x55')]){_0x9e728a[_0x79e6('0x59')]=[{'all':!![]}];}return db[_0x79e6('0x68')][_0x79e6('0x56')](_0x9e728a);})[_0x79e6('0x1f')](function(_0x549bf7){_0x249287[_0x79e6('0x57')]=_0x549bf7;return _0x249287;});}})[_0x79e6('0x1f')](respondWithFilteredResult(_0x384095,_0x9e728a))['catch'](handleError(_0x384095,null));};exports[_0x79e6('0x6b')]=function(_0x19fe0d,_0x364120,_0x2ac63f){return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x19fe0d[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x364120,null))['then'](function(_0x3af4b3){if(_0x3af4b3){return _0x3af4b3['removeDispositions'](_0x19fe0d[_0x79e6('0x45')][_0x79e6('0x6c')]);}})[_0x79e6('0x1f')](respondWithStatusCode(_0x364120,null))['catch'](handleError(_0x364120,null));};exports[_0x79e6('0x6d')]=function(_0x35f6de,_0x207abd,_0x477356){if(_0x35f6de[_0x79e6('0x64')]['id']){delete _0x35f6de[_0x79e6('0x64')]['id'];}return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x35f6de[_0x79e6('0x65')]['id']}})['then'](handleEntityNotFound(_0x207abd,null))[_0x79e6('0x1f')](function(_0xf13063){if(_0xf13063){_0x35f6de[_0x79e6('0x64')]['SmsAccountId']=_0xf13063['id'];return db[_0x79e6('0x6e')]['create'](_0x35f6de[_0x79e6('0x64')]);}})[_0x79e6('0x1f')](respondWithResult(_0x207abd,null))[_0x79e6('0x29')](handleError(_0x207abd,null));};exports[_0x79e6('0x6f')]=function(_0x54a2c3,_0x240294,_0x23fbc0){var _0x2f11d7={'raw':![],'where':{}};var _0x15ad74={};var _0x5e1eaa={'count':0x0,'rows':[]};return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x54a2c3[_0x79e6('0x65')]['id']}})['then'](handleEntityNotFound(_0x240294,null))[_0x79e6('0x1f')](function(_0xb71681){if(_0xb71681){_0x15ad74['model']=_[_0x79e6('0x44')](db['CannedAnswer']['rawAttributes']);_0x15ad74[_0x79e6('0x45')]=_['keys'](_0x54a2c3[_0x79e6('0x45')]);_0x15ad74[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x15ad74['model'],_0x15ad74[_0x79e6('0x45')]);_0x2f11d7[_0x79e6('0x48')]=_['intersection'](_0x15ad74[_0x79e6('0x43')],qs[_0x79e6('0x49')](_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x49')]));_0x2f11d7[_0x79e6('0x48')]=_0x2f11d7['attributes'][_0x79e6('0x70')]?_0x2f11d7[_0x79e6('0x48')]:_0x15ad74[_0x79e6('0x43')];if(!_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0x2f11d7[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x54a2c3['query']['limit']);_0x2f11d7['offset']=qs[_0x79e6('0x31')](_0x54a2c3['query'][_0x79e6('0x31')]);}_0x2f11d7[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x54a2c3['query'][_0x79e6('0x4d')]);_0x2f11d7[_0x79e6('0x4e')]=qs['filters'](_['pick'](_0x54a2c3[_0x79e6('0x45')],_0x15ad74['filters']));_0x2f11d7[_0x79e6('0x4e')]['SmsAccountId']=_0xb71681['id'];if(_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x50')]){_0x2f11d7['where']=_['merge'](_0x2f11d7['where'],{'$or':_['map'](_0x2f11d7[_0x79e6('0x48')],function(_0x527cae){var _0x565fca={};_0x565fca[_0x527cae]={'$like':'%'+_0x54a2c3[_0x79e6('0x45')]['filter']+'%'};return _0x565fca;})});}_0x2f11d7=_[_0x79e6('0x51')]({},_0x2f11d7,_0x54a2c3[_0x79e6('0x54')]);return db['CannedAnswer'][_0x79e6('0x30')]({'where':_0x2f11d7[_0x79e6('0x4e')]})['then'](function(_0x21c34a){_0x5e1eaa[_0x79e6('0x30')]=_0x21c34a;if(_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x55')]){_0x2f11d7[_0x79e6('0x59')]=[{'all':!![]}];}return db[_0x79e6('0x6e')]['findAll'](_0x2f11d7);})[_0x79e6('0x1f')](function(_0x4a73a3){_0x5e1eaa[_0x79e6('0x57')]=_0x4a73a3;return _0x5e1eaa;});}})[_0x79e6('0x1f')](respondWithFilteredResult(_0x240294,_0x2f11d7))[_0x79e6('0x29')](handleError(_0x240294,null));};exports[_0x79e6('0x71')]=function(_0x360d27,_0x55fa7b,_0x1ea749){return db[_0x79e6('0x40')]['find']({'where':{'id':_0x360d27[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x55fa7b,null))[_0x79e6('0x1f')](function(_0x24522f){if(_0x24522f){return _0x24522f[_0x79e6('0x71')](_0x360d27[_0x79e6('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x55fa7b,null))['catch'](handleError(_0x55fa7b,null));};exports[_0x79e6('0x72')]=function(_0x3de75b,_0x5501a8,_0x154bb5){var _0x20069f={'channel':'sms'};var _0x48edb4=[];var _0x8e3f36=[];var _0x179144={};return db['SmsAccount'][_0x79e6('0x5a')]({'where':{'id':_0x3de75b['params']['id']},'include':[{'model':db[_0x79e6('0x73')],'as':_0x79e6('0x74')}]})[_0x79e6('0x1f')](handleEntityNotFound(_0x5501a8,null))[_0x79e6('0x1f')](function(_0x10c5e9){_0x20069f[_0x79e6('0x75')]=_0x10c5e9;_0x20069f[_0x79e6('0x76')]=_[_0x79e6('0x77')](_0x10c5e9['Applications'],[_0x79e6('0x78')],[_0x79e6('0x79')]);if(_0x20069f[_0x79e6('0x75')][_0x79e6('0x74')]){delete _0x20069f[_0x79e6('0x75')][_0x79e6('0x74')];}return db[_0x79e6('0x7a')]['describe']();})['then'](function(_0x463d93){if(!_0x463d93){throw new db['Sequelize']['ValidationError'](_0x79e6('0x7b'));}_0x48edb4=_[_0x79e6('0x7c')](_[_0x79e6('0x44')](_0x463d93),[_0x79e6('0x7d'),_0x79e6('0x7e')]);_0x8e3f36=_[_0x79e6('0x7c')](_[_0x79e6('0x44')](_0x463d93),['createdAt',_0x79e6('0x7e'),'CompanyId',_0x79e6('0x7f')]);_0x20069f['body']={'mapKey':_0x79e6('0x80')};if(_0x20069f['account'][_0x79e6('0x52')]){switch(_0x20069f['account'][_0x79e6('0x52')]){case'twilio':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x82')];_0x20069f['body']['body']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x83')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x85')];break;case _0x79e6('0x86'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]='+'+_0x3de75b['body']['sender'];_0x20069f['body'][_0x79e6('0x64')]=_0x3de75b['body'][_0x79e6('0x87')];break;case _0x79e6('0x88'):_0x20069f[_0x79e6('0x64')]['from']=_0x3de75b['body'][_0x79e6('0x81')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x27')];break;case _0x79e6('0x89'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')]['from'];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x64')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b['body']['message_id'];break;case'plivo':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x82')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b['body'][_0x79e6('0x8a')];_0x20069f['body'][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x8b')];break;case _0x79e6('0x8c'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]='+'+_0x3de75b['body'][_0x79e6('0x8d')][0x0][_0x79e6('0x81')];_0x20069f[_0x79e6('0x64')]['body']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x8d')][0x0][_0x79e6('0x87')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b['body']['results'][0x0][_0x79e6('0x84')];break;case _0x79e6('0x8e'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x8f')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b['body'][_0x79e6('0x90')][_0x79e6('0x27')];break;case'clickatell':_0x20069f[_0x79e6('0x64')]['from']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x91')];_0x20069f[_0x79e6('0x64')]['body']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x87')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x92')];break;case _0x79e6('0x93'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][0x0][_0x79e6('0x27')]['id'];_0x20069f[_0x79e6('0x64')]['from']=_0x3de75b[_0x79e6('0x64')][0x0][_0x79e6('0x27')][_0x79e6('0x81')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b['body'][0x0]['message']['text'];break;case _0x79e6('0x94'):_0x20069f['body'][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')]['from'];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x27')];_0x20069f[_0x79e6('0x64')]['messageId']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x95')];break;}}if(_0x20069f[_0x79e6('0x64')]['id']){delete _0x20069f['body']['id'];}if(_['isNil'](_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')])){throw new db[(_0x79e6('0x96'))]['ValidationError'](_0x79e6('0x97'));}if(_[_0x79e6('0x98')](_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')])||_0x20069f['body']['body']===''){throw new db['Sequelize'][(_0x79e6('0x99'))](_0x79e6('0x9a'));}if(_[_0x79e6('0x98')](_0x20069f[_0x79e6('0x64')]['mapKey'])){throw new db[(_0x79e6('0x96'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8e3f36);}if(!_[_0x79e6('0x9b')](_0x8e3f36,_0x20069f[_0x79e6('0x64')][_0x79e6('0x9c')])){throw new db['Sequelize'][(_0x79e6('0x99'))](_0x79e6('0x9d')+_0x8e3f36);}_0x179144[_0x20069f[_0x79e6('0x64')][_0x79e6('0x9c')]]=_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')];return db[_0x79e6('0x9e')][_0x79e6('0x5a')]({'where':{'id':_0x20069f[_0x79e6('0x75')][_0x79e6('0x7f')]},'include':[{'model':db[_0x79e6('0x7a')],'as':'Contacts','where':_0x179144,'limit':0x1,'order':[['updatedAt',_0x79e6('0x9f')]]}]});})[_0x79e6('0x1f')](handleEntityNotFound(_0x5501a8,null))[_0x79e6('0x1f')](function(_0x4008ef){if(_0x4008ef){_0x20069f[_0x79e6('0xa0')]=_[_0x79e6('0xa1')](_0x4008ef,[_0x79e6('0xa2')]);if(_0x4008ef[_0x79e6('0xa2')][_0x79e6('0x70')]){return _0x4008ef['Contacts'][0x0];}var _0x33ab2c=_['defaults'](_0x20069f[_0x79e6('0x64')],{'firstName':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')],'ListId':_0x4008ef['id']});_0x33ab2c[_0x20069f['body'][_0x79e6('0x9c')]]=_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')];return db[_0x79e6('0x7a')][_0x79e6('0x5b')](_0x33ab2c,{'fields':_0x48edb4,'raw':!![]});}})[_0x79e6('0x1f')](handleEntityNotFound(_0x5501a8,null))[_0x79e6('0x1f')](function(_0x1d17ec){if(_0x1d17ec){_0x20069f[_0x79e6('0xa3')]=_0x1d17ec;var _0x42c1f4={'ContactId':_0x1d17ec['id'],'phone':_0x20069f[_0x79e6('0x64')]['from'],'SmsAccountId':_0x3de75b[_0x79e6('0x65')]['id']};var _0x20ac96={'ContactId':_0x1d17ec['id'],'SmsAccountId':_0x3de75b[_0x79e6('0x65')]['id'],'closed':![]};return db[_0x79e6('0xa4')][_0x79e6('0x5a')]({'where':_0x20ac96})[_0x79e6('0x1f')](function(_0x4faeb4){if(_0x4faeb4){return[_0x4faeb4,![]];}return db['SmsInteraction']['create'](_0x42c1f4)[_0x79e6('0x1f')](function(_0x4e0097){return[_0x4e0097,!![]];});});}})['spread'](function(_0x1ef837,_0x1d802c){_0x20069f[_0x79e6('0xa5')]=_0x1ef837[_0x79e6('0x37')]({'plain':!![]});_0x20069f[_0x79e6('0xa5')][_0x79e6('0xa6')]=![];if(_0x1d802c){if(_0x20069f[_0x79e6('0x75')][_0x79e6('0xa7')]){_0x20069f[_0x79e6('0x76')]['push']({'id':0x0,'priority':_0x20069f[_0x79e6('0x76')]['length']+0x1,'app':_0x79e6('0xa8'),'appdata':_0x79e6('0xa9'),'interval':'*,*,*,*'});}_0x20069f['interaction'][_0x79e6('0xa6')]=!![];}return db[_0x79e6('0xaa')][_0x79e6('0x5b')]({'phone':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')],'messageId':_0x20069f[_0x79e6('0x64')]['messageId'],'body':_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')],'SmsAccountId':_0x3de75b['params']['id'],'SmsInteractionId':_0x1ef837['id'],'direction':'in','ContactId':_0x1ef837['ContactId'],'AttachmentId':_0x20069f[_0x79e6('0x64')][_0x79e6('0xab')]});})[_0x79e6('0x1f')](function(_0xe3d4f4){_0x20069f['message']=_0xe3d4f4;if(_0x20069f[_0x79e6('0xa5')][_0x79e6('0xac')]){return db[_0x79e6('0xad')][_0x79e6('0x5a')]({'attributes':['id',_0x79e6('0x3a')],'where':{'id':_0x20069f[_0x79e6('0xa5')][_0x79e6('0xac')]}})['then'](function(_0x1ed7f7){if(_0x1ed7f7){_0x20069f[_0x79e6('0x76')][_0x79e6('0xae')]({'id':0x0,'priority':0x0,'app':_0x79e6('0xaf'),'appdata':_0x1ed7f7[_0x79e6('0x3a')]+','+(_0x20069f[_0x79e6('0x75')][_0x79e6('0xb0')]||0xa),'interval':_0x79e6('0xb1')});}return respondWithRpcPromise(_0x79e6('0xb2'),_0x79e6('0xb3'),_0x20069f);});}return respondWithRpcPromise('Start',_0x79e6('0xb3'),_0x20069f);})[_0x79e6('0x1f')](function(_0x57babf){if(_0x57babf){var _0x422bf9=0xc8;var _0x3a4a31=_0x79e6('0xb4');logger[_0x79e6('0x20')](_0x79e6('0x23'),_0x3a4a31,_0x422bf9,_0x79e6('0xb5'));logger['debug'](_0x79e6('0xb6'),_0x3a4a31,_0x422bf9,'entity\x20found',JSON['stringify'](_0x57babf));if(_0x20069f['account'][_0x79e6('0x52')]===_0x79e6('0xb7')){return _0x5501a8[_0x79e6('0x2b')](_0x422bf9)['set'](_0x79e6('0xb8'),_0x79e6('0xb9'))[_0x79e6('0x3b')]('\x0a');}else{return _0x5501a8[_0x79e6('0x2b')](_0x422bf9)[_0x79e6('0x2d')](_0x57babf);}}})['catch'](handleError(_0x5501a8,null));};exports['addApplications']=function(_0xa6031,_0x54f6a4){var _0x304465=_0xa6031['params']['id'];var _0x565461=_0xa6031[_0x79e6('0x64')];var _0x3f0cba=0xc8;var _0x110695=null;return db[_0x79e6('0xba')][_0x79e6('0xbb')]({'isolationLevel':db[_0x79e6('0xba')][_0x79e6('0xbc')][_0x79e6('0xbd')]['READ_COMMITTED']},function(_0x5c727b){return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x304465},'transaction':_0x5c727b})[_0x79e6('0x1f')](function(_0x1ad6eb){if(_0x1ad6eb){return db['SmsApplication'][_0x79e6('0x36')]({'where':{'SmsAccountId':_0x304465},'transaction':_0x5c727b})[_0x79e6('0x1f')](function(){var _0x4519d1=_['map'](_0x565461,function(_0x3b0d44){_0x3b0d44['SmsAccountId']=_0x304465;return _0x3b0d44;});return db[_0x79e6('0x73')]['bulkCreate'](_0x4519d1,{'transaction':_0x5c727b});});}else{_0x3f0cba=0x194;_0x110695=[];}});})[_0x79e6('0x1f')](function(){if(_0x3f0cba!==0x194){return db['SmsApplication'][_0x79e6('0xbe')]({'where':{'SmsAccountId':_0x304465},'order':'priority'})[_0x79e6('0x1f')](function(_0x2d8040){_0x110695=_0x2d8040;});}})[_0x79e6('0x29')](function(_0x4ae904){_0x3f0cba=0x1f4;logger['error'](_0x4ae904[_0x79e6('0x39')]);if(_0x4ae904[_0x79e6('0x3a')]){delete _0x4ae904[_0x79e6('0x3a')];}_0x110695=_0x4ae904;})[_0x79e6('0xbf')](function(){if(_0x110695===null){_0x54f6a4[_0x79e6('0x2a')](_0x3f0cba);}else{if(_0x3f0cba===0x1f4){_0x54f6a4['status'](_0x3f0cba)['send'](_0x110695);}else{_0x54f6a4[_0x79e6('0x2b')](_0x3f0cba)[_0x79e6('0x2d')](_0x110695);}}});};exports[_0x79e6('0xc0')]=function(_0x5a063c,_0x22d9dd,_0x1fdf13){var _0x25cb94={};var _0x59d4e7={};var _0x3f33ef;var _0x21766a;return db['SmsAccount'][_0x79e6('0x6a')]({'where':{'id':_0x5a063c[_0x79e6('0x65')]['id']}})['then'](handleEntityNotFound(_0x22d9dd,null))[_0x79e6('0x1f')](function(_0x599a9f){if(_0x599a9f){_0x3f33ef=_0x599a9f;_0x59d4e7['model']=_['keys'](db[_0x79e6('0x73')]['rawAttributes']);_0x59d4e7[_0x79e6('0x45')]=_[_0x79e6('0x44')](_0x5a063c[_0x79e6('0x45')]);_0x59d4e7['filters']=_['intersection'](_0x59d4e7[_0x79e6('0x43')],_0x59d4e7[_0x79e6('0x45')]);_0x25cb94[_0x79e6('0x48')]=_['intersection'](_0x59d4e7['model'],qs['fields'](_0x5a063c[_0x79e6('0x45')][_0x79e6('0x49')]));_0x25cb94['attributes']=_0x25cb94[_0x79e6('0x48')][_0x79e6('0x70')]?_0x25cb94[_0x79e6('0x48')]:_0x59d4e7[_0x79e6('0x43')];_0x25cb94[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x5a063c[_0x79e6('0x45')][_0x79e6('0x4d')]);_0x25cb94[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x5a063c[_0x79e6('0x45')],_0x59d4e7[_0x79e6('0x46')]));if(_0x5a063c[_0x79e6('0x45')][_0x79e6('0x50')]){_0x25cb94['where']=_[_0x79e6('0x51')](_0x25cb94[_0x79e6('0x4e')],{'$or':_[_0x79e6('0x3f')](_0x25cb94[_0x79e6('0x48')],function(_0x5e482d){var _0x3e2f15={};_0x3e2f15[_0x5e482d]={'$like':'%'+_0x5a063c[_0x79e6('0x45')]['filter']+'%'};return _0x3e2f15;})});}_0x25cb94=_[_0x79e6('0x51')]({},_0x25cb94,_0x5a063c[_0x79e6('0x54')]);return _0x3f33ef[_0x79e6('0xc0')](_0x25cb94);}})[_0x79e6('0x1f')](function(_0x18a248){if(_0x18a248){_0x21766a=_0x18a248['length'];if(!_0x5a063c[_0x79e6('0x45')][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0x25cb94[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x5a063c['query']['limit']);_0x25cb94[_0x79e6('0x31')]=qs['offset'](_0x5a063c['query'][_0x79e6('0x31')]);}return _0x3f33ef['getApplications'](_0x25cb94);}})[_0x79e6('0x1f')](function(_0x5b7bfb){if(_0x5b7bfb){return _0x5b7bfb?{'count':_0x21766a,'rows':_0x5b7bfb}:null;}})[_0x79e6('0x1f')](respondWithResult(_0x22d9dd,null))[_0x79e6('0x29')](handleError(_0x22d9dd,null));};exports[_0x79e6('0xc1')]=function(_0x3d8cce,_0x19de46,_0xe096b2){var _0x4e82bd={'raw':![],'where':{}};var _0x207cba={};var _0x31f1e5={'count':0x0,'rows':[]};return db['SmsAccount'][_0x79e6('0x6a')]({'where':{'id':_0x3d8cce[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x19de46,null))[_0x79e6('0x1f')](function(_0x19854e){if(_0x19854e){_0x207cba[_0x79e6('0x43')]=_[_0x79e6('0x44')](db[_0x79e6('0xa4')][_0x79e6('0x41')]);_0x207cba['query']=_[_0x79e6('0x44')](_0x3d8cce[_0x79e6('0x45')]);_0x207cba[_0x79e6('0x46')]=_['intersection'](_0x207cba[_0x79e6('0x43')],_0x207cba[_0x79e6('0x45')]);_0x4e82bd['attributes']=_['intersection'](_0x207cba[_0x79e6('0x43')],qs['fields'](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x49')]));_0x4e82bd[_0x79e6('0x48')]=_0x4e82bd[_0x79e6('0x48')][_0x79e6('0x70')]?_0x4e82bd[_0x79e6('0x48')]:_0x207cba['model'];if(!_0x3d8cce[_0x79e6('0x45')]['hasOwnProperty'](_0x79e6('0x4b'))){_0x4e82bd[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x2f')]);_0x4e82bd[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x31')]);}_0x4e82bd['order']=qs[_0x79e6('0x4d')](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x4d')]);_0x4e82bd[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x3d8cce[_0x79e6('0x45')],_0x207cba['filters']));_0x4e82bd[_0x79e6('0x4e')][_0x79e6('0x67')]=_0x19854e['id'];if(_0x3d8cce['query'][_0x79e6('0x50')]){_0x4e82bd[_0x79e6('0x4e')]=_['merge'](_0x4e82bd[_0x79e6('0x4e')],{'$or':_[_0x79e6('0x3f')](_0x4e82bd['attributes'],function(_0x46baee){var _0x21deb0={};_0x21deb0[_0x46baee]={'$like':'%'+_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x50')]+'%'};return _0x21deb0;})});}_0x4e82bd=_[_0x79e6('0x51')]({},_0x4e82bd,_0x3d8cce[_0x79e6('0x54')]);return db[_0x79e6('0xa4')][_0x79e6('0x30')]({'where':_0x4e82bd[_0x79e6('0x4e')]})[_0x79e6('0x1f')](function(_0x30ac27){_0x31f1e5[_0x79e6('0x30')]=_0x30ac27;if(_0x3d8cce['query']['includeAll']){_0x4e82bd[_0x79e6('0x59')]=[{'model':db[_0x79e6('0x7a')],'as':_0x79e6('0xc2'),'required':![]},{'model':db[_0x79e6('0xad')],'as':'Owner','attributes':[_0x79e6('0x3a'),_0x79e6('0xc3'),_0x79e6('0xc4')],'required':![]},{'model':db[_0x79e6('0xc5')],'as':_0x79e6('0xc6'),'attributes':['id',_0x79e6('0x3a'),'color'],'where':_0x3d8cce[_0x79e6('0x45')][_0x79e6('0xc7')]?{'id':_0x3d8cce['query'][_0x79e6('0xc7')]}:undefined,'required':_0x3d8cce['query'][_0x79e6('0xc7')]?!![]:![]}];}return db['SmsInteraction'][_0x79e6('0x56')](_0x4e82bd);})[_0x79e6('0x1f')](function(_0x5a6690){_0x31f1e5[_0x79e6('0x57')]=_0x5a6690;return _0x31f1e5;});}})[_0x79e6('0x1f')](respondWithFilteredResult(_0x19de46,_0x4e82bd))[_0x79e6('0x29')](handleError(_0x19de46,null));};exports[_0x79e6('0x3b')]=function(_0x169e8f,_0x3511ad,_0x1e82e6){var _0x1811cd,_0x593742,_0x43d696;if(_['isNil'](_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')])||_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')]===''){throw new db[(_0x79e6('0x96'))][(_0x79e6('0x99'))](_0x79e6('0x9a'));}if(_[_0x79e6('0x98')](_0x169e8f[_0x79e6('0x64')]['to'])){throw new db[(_0x79e6('0x96'))][(_0x79e6('0x99'))](_0x79e6('0xc8'));}_0x1811cd=_0x169e8f['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x169e8f[_0x79e6('0x65')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x79e6('0x7a')],'as':'Contacts','where':{'mobile':_0x1811cd},'limit':0x1,'order':[['updatedAt',_0x79e6('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x3511ad,null))['then'](function(_0x116acb){if(_0x116acb&&_0x116acb[_0x79e6('0xc9')]){_0x593742=_0x116acb[_0x79e6('0x37')]({'plain':!![]});if(_0x593742[_0x79e6('0xc9')]&&_0x593742[_0x79e6('0xc9')][_0x79e6('0xa2')][_0x79e6('0x70')]){return _0x593742[_0x79e6('0xc9')][_0x79e6('0xa2')][0x0];}return db[_0x79e6('0x7a')][_0x79e6('0x5b')](_['defaults'](_0x169e8f['body'],{'firstName':_0x1811cd,'mobile':_0x1811cd,'phone':_0x1811cd,'ListId':_0x593742['ListId']}));}})[_0x79e6('0x1f')](handleEntityNotFound(_0x3511ad,null))['then'](function(_0x5a1847){if(_0x5a1847){_0x43d696=_0x5a1847;return db[_0x79e6('0xa4')][_0x79e6('0x5a')]({'where':{'ContactId':_0x43d696['id'],'closed':![],'SmsAccountId':_0x593742['id']}})[_0x79e6('0x1f')](function(_0x2fb50f){if(_0x2fb50f){return[_0x2fb50f,![]];}return db[_0x79e6('0xa4')]['create']({'UserId':_0x169e8f['user']['id'],'ContactId':_0x43d696['id'],'SmsAccountId':_0x593742['id'],'phone':_0x1811cd,'firstMsgDirection':_0x79e6('0xca'),'Messages':[_['merge'](_0x169e8f[_0x79e6('0x64')],{'read':![],'body':_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')],'phone':_0x1811cd,'SmsAccountId':_0x593742['id'],'UserId':_0x169e8f['user']['id'],'ContactId':_0x43d696['id']})]},{'include':[{'model':db[_0x79e6('0xaa')],'as':_0x79e6('0xcb')}]})[_0x79e6('0x1f')](function(_0x2718fb){return[_0x2718fb,!![]];});});}})[_0x79e6('0xcc')](function(_0x2ace09,_0x57b553){if(_0x57b553){return _0x2ace09;}return db['SmsMessage'][_0x79e6('0x5b')](_['merge'](_0x169e8f[_0x79e6('0x64')],{'read':![],'body':_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')],'phone':_0x1811cd,'SmsAccountId':_0x593742['id'],'SmsInteractionId':_0x2ace09['id'],'UserId':_0x169e8f['user']['id'],'ContactId':_0x43d696['id']}))[_0x79e6('0x1f')](function(_0x18009f){_0x2ace09[_0x79e6('0xcd')]['Messages']=[];_0x2ace09[_0x79e6('0xcd')][_0x79e6('0xcb')][_0x79e6('0xce')](_0x18009f[_0x79e6('0xcd')]);return _0x2ace09;});})['then'](respondWithResult(_0x3511ad,null))[_0x79e6('0x29')](handleError(_0x3511ad,null));};exports['status']=function(_0x34844a,_0x390031,_0x4c3509){if(_0x34844a['body']['id']){delete _0x34844a['body']['id'];}var _0x43a61e,_0x55bef1,_0x246ff4;return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x34844a['params']['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x390031,null))[_0x79e6('0x1f')](function(_0xe9a75){if(_0xe9a75){_0x246ff4=_0xe9a75;logger['debug'](_0x79e6('0x23'),'status',_0x79e6('0xcf'),_0xe9a75[_0x79e6('0x52')],util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));switch(_0xe9a75['type']){case'skebby':if(_0x34844a[_0x79e6('0x64')][_0x79e6('0xd1')]&&_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')]){_0x55bef1=_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')]['skebby_dispatch_id']}});}break;case _0x79e6('0x88'):if(_0x34844a[_0x79e6('0x64')][_0x79e6('0xd2')]&&_0x34844a[_0x79e6('0x64')]['statusInt']){_0x55bef1=_0x34844a[_0x79e6('0x64')]['statusInt'];return db['SmsMessage'][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a['body'][_0x79e6('0xd2')]}});}break;case _0x79e6('0x89'):if(_0x34844a['body']['message_id']&&_0x34844a[_0x79e6('0x64')][_0x79e6('0xd3')]){_0x55bef1=_0x34844a['body']['status_code'];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')][_0x79e6('0xd4')]}});}break;case _0x79e6('0x8c'):var _0x5835e9=_0x34844a[_0x79e6('0x64')][_0x79e6('0x8d')][0x0];if(_0x5835e9[_0x79e6('0x84')]&&_0x5835e9[_0x79e6('0x2b')][_0x79e6('0xd5')]==='DELIVERED'){_0x55bef1=_0x5835e9[_0x79e6('0x2b')][_0x79e6('0xd5')];return db[_0x79e6('0xaa')]['find']({'where':{'messageId':_0x5835e9['messageId']}});}break;case _0x79e6('0xd6'):if(_0x34844a['body'][_0x79e6('0x84')]&&_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')]){_0x55bef1=_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')]['messageId']}});}break;case _0x79e6('0x93'):if(_0x34844a['body'][0x0]['message']['id']){_0x55bef1=_0x34844a[_0x79e6('0x64')][0x0][_0x79e6('0x52')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')][0x0][_0x79e6('0x27')]['id']}});}break;case'intelepeer':if(_0x34844a[_0x79e6('0x64')]['redif']&&_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')]){_0x55bef1=_0x34844a['body'][_0x79e6('0x2b')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x390031,null))[_0x79e6('0x1f')](function(_0x565c4d){if(_0x565c4d){_0x43a61e=_0x565c4d;switch(_0x246ff4[_0x79e6('0x52')]){case _0x79e6('0x86'):if(_0x55bef1==='DELIVERED'){return _0x43a61e[_0x79e6('0x63')]({'read':!![]});}else{logger[_0x79e6('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x79e6('0x2b'),_0x79e6('0x86'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case _0x79e6('0x88'):if(_0x55bef1==='1'){return _0x43a61e['update']({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),_0x79e6('0x2b'),_0x79e6('0x86'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x34844a[_0x79e6('0x64')][_0x79e6('0xd7')]&&_0x55bef1>=0xc8&&_0x55bef1<=0xce){return _0x43a61e['update']({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),_0x79e6('0x2b'),'clicksend',util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2db146=_0x34844a[_0x79e6('0x64')][_0x79e6('0x8d')][0x0];if(_0x2db146['status'][_0x79e6('0xd5')]===_0x79e6('0xd8')){return _0x43a61e['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x79e6('0x8c'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x55bef1==_0x79e6('0xd9')||_0x55bef1==_0x79e6('0xda')){return _0x43a61e[_0x79e6('0x63')]({'read':!![]});}else{logger[_0x79e6('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x79e6('0x2b'),_0x79e6('0xd6'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case _0x79e6('0x93'):if(_0x55bef1=='message-delivered'){return _0x43a61e['update']({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),'status',_0x79e6('0x93'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case _0x79e6('0x94'):if(_0x55bef1===_0x79e6('0xdb')||_0x55bef1==='ACCEPTD'){return _0x43a61e[_0x79e6('0x63')]({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),'status',_0x79e6('0x94'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;}return _0x43a61e;}})[_0x79e6('0x1f')](respondWithResult(_0x390031,null))[_0x79e6('0x29')](handleError(_0x390031,null));};exports[_0x79e6('0xdc')]=function(_0x5ecd74,_0x2cbf4c,_0x441a01){var _0x1847c3,_0x45288d,_0x957c2e;return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x5ecd74[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x2cbf4c,null))['then'](function(_0x597e31){if(_0x597e31){_0x957c2e=_0x597e31;logger['debug'](_0x79e6('0x23'),_0x79e6('0x2b'),_0x79e6('0xcf'),_0x597e31[_0x79e6('0x52')],util[_0x79e6('0xd0')](_0x5ecd74[_0x79e6('0x45')],{'showHidden':![],'depth':null}));switch(_0x597e31['type']){case _0x79e6('0x8e'):if(_0x5ecd74[_0x79e6('0x45')][_0x79e6('0xdd')]&&_0x5ecd74[_0x79e6('0x45')]['state']){_0x45288d=_0x5ecd74['query'][_0x79e6('0xde')];return db['SmsMessage']['find']({'where':{'messageId':_0x5ecd74[_0x79e6('0x45')][_0x79e6('0xdd')]}});}break;}}})[_0x79e6('0x1f')](handleEntityNotFound(_0x2cbf4c,null))['then'](function(_0x24aa4d){if(_0x24aa4d){_0x1847c3=_0x24aa4d;switch(_0x957c2e['type']){case _0x79e6('0x8e'):if(_0x45288d==='2'||_0x45288d==='6'){return _0x1847c3[_0x79e6('0x63')]({'read':!![]});}else{logger['error'](_0x79e6('0x23'),_0x79e6('0x2b'),_0x79e6('0x8e'),util[_0x79e6('0xd0')](_0x5ecd74[_0x79e6('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x1847c3;}})[_0x79e6('0x1f')](respondWithResult(_0x2cbf4c,null))[_0x79e6('0x29')](handleError(_0x2cbf4c,null));};exports['addAgents']=function(_0x4d138f,_0xf3b5df,_0x2231d8){return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x4d138f[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0xf3b5df,null))[_0x79e6('0x1f')](function(_0x215e5c){if(_0x215e5c){return _0x215e5c[_0x79e6('0xdf')](_0x4d138f[_0x79e6('0x64')][_0x79e6('0x6c')],_['omit'](_0x4d138f['body'],[_0x79e6('0x6c'),'id'])||{})['spread'](function(_0x2b6ae4){for(var _0x59cd34=0x0;_0x59cd34<_0x4d138f['body'][_0x79e6('0x6c')]['length'];_0x59cd34+=0x1){socket[_0x79e6('0xe0')](_0x79e6('0xe1'),{'UserId':Number(_0x4d138f[_0x79e6('0x64')][_0x79e6('0x6c')][_0x59cd34]),'SmsAccountId':Number(_0x4d138f['params']['id'])});}return _0x2b6ae4;});}})[_0x79e6('0x1f')](respondWithResult(_0xf3b5df,null))['catch'](handleError(_0xf3b5df,null));};exports[_0x79e6('0xe2')]=function(_0x46a5b6,_0x3b250a,_0x1ff661){return db[_0x79e6('0x40')]['find']({'where':{'id':_0x46a5b6[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x3b250a,null))[_0x79e6('0x1f')](function(_0x1b0752){if(_0x1b0752){return _0x1b0752[_0x79e6('0xe2')](_0x46a5b6[_0x79e6('0x45')]['ids'])['then'](function(){if(_[_0x79e6('0xe3')](_0x46a5b6[_0x79e6('0x45')][_0x79e6('0x6c')])){for(var _0x5646b0=0x0;_0x5646b0<_0x46a5b6['query'][_0x79e6('0x6c')]['length'];_0x5646b0+=0x1){socket[_0x79e6('0xe0')](_0x79e6('0xe4'),{'UserId':Number(_0x46a5b6[_0x79e6('0x45')][_0x79e6('0x6c')][_0x5646b0]),'SmsAccountId':Number(_0x46a5b6[_0x79e6('0x65')]['id'])});}}else{socket[_0x79e6('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x46a5b6[_0x79e6('0x45')]['ids']),'SmsAccountId':Number(_0x46a5b6[_0x79e6('0x65')]['id'])});}});}})[_0x79e6('0x1f')](respondWithStatusCode(_0x3b250a,null))[_0x79e6('0x29')](handleError(_0x3b250a,null));};exports[_0x79e6('0xe5')]=function(_0x4e65af,_0xf015b7,_0x39d431){var _0xa0052e={};var _0x1b8db1={};var _0x2360b9;var _0x52ee17;return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x4e65af[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0xf015b7,null))[_0x79e6('0x1f')](function(_0x1f0fa1){if(_0x1f0fa1){_0x2360b9=_0x1f0fa1;_0x1b8db1[_0x79e6('0x43')]=_[_0x79e6('0x44')](db['User'][_0x79e6('0x41')]);_0x1b8db1['query']=_['keys'](_0x4e65af['query']);_0x1b8db1[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x1b8db1[_0x79e6('0x43')],_0x1b8db1[_0x79e6('0x45')]);_0xa0052e['attributes']=_['intersection'](_0x1b8db1[_0x79e6('0x43')],qs['fields'](_0x4e65af['query'][_0x79e6('0x49')]));_0xa0052e['attributes']=_0xa0052e[_0x79e6('0x48')][_0x79e6('0x70')]?_0xa0052e[_0x79e6('0x48')]:_0x1b8db1['model'];_0xa0052e[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x4e65af[_0x79e6('0x45')][_0x79e6('0x4d')]);_0xa0052e[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x4e65af[_0x79e6('0x45')],_0x1b8db1[_0x79e6('0x46')]));if(_0x4e65af[_0x79e6('0x45')][_0x79e6('0x50')]){_0xa0052e['where']=_[_0x79e6('0x51')](_0xa0052e['where'],{'$or':_[_0x79e6('0x3f')](_0xa0052e['attributes'],function(_0x396672){var _0xf2bf19={};_0xf2bf19[_0x396672]={'$like':'%'+_0x4e65af[_0x79e6('0x45')]['filter']+'%'};return _0xf2bf19;})});}_0xa0052e=_[_0x79e6('0x51')]({},_0xa0052e,_0x4e65af[_0x79e6('0x54')]);return _0x2360b9['getAgents'](_0xa0052e);}})['then'](function(_0x18e38d){if(_0x18e38d){_0x52ee17=_0x18e38d['length'];if(!_0x4e65af['query'][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0xa0052e[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x4e65af[_0x79e6('0x45')][_0x79e6('0x2f')]);_0xa0052e[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x4e65af[_0x79e6('0x45')][_0x79e6('0x31')]);}return _0x2360b9[_0x79e6('0xe5')](_0xa0052e);}})['then'](function(_0x5d1980){if(_0x5d1980){return _0x5d1980?{'count':_0x52ee17,'rows':_0x5d1980}:null;}})[_0x79e6('0x1f')](respondWithResult(_0xf015b7,null))[_0x79e6('0x29')](handleError(_0xf015b7,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ae0ac48..f2880e2 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x793d=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x56a7ee,_0x226185){var _0x202b71=function(_0x3e16fb){while(--_0x3e16fb){_0x56a7ee['push'](_0x56a7ee['shift']());}};_0x202b71(++_0x226185);}(_0x793d,0x106));var _0xd793=function(_0x48edc0,_0x2c616b){_0x48edc0=_0x48edc0-0x0;var _0x326b92=_0x793d[_0x48edc0];return _0x326b92;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xd793('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd793('0x1')](0x0);var events={'afterCreate':_0xd793('0x2'),'afterUpdate':'update','afterDestroy':_0xd793('0x3')};function emitEvent(_0x31fc84){return function(_0x1bf5a0,_0x209f5c,_0x459d83){SmsAccountEvents[_0xd793('0x4')](_0x31fc84+':'+_0x1bf5a0['id'],_0x1bf5a0);SmsAccountEvents['emit'](_0x31fc84,_0x1bf5a0);_0x459d83(null);};}for(var e in events){if(events[_0xd793('0x5')](e)){var event=events[e];SmsAccount[_0xd793('0x6')](e,emitEvent(event));}}module[_0xd793('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x52ee=['exports','events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x510fad,_0x283c39){var _0x249cc9=function(_0x5a9740){while(--_0x5a9740){_0x510fad['push'](_0x510fad['shift']());}};_0x249cc9(++_0x283c39);}(_0x52ee,0x1c9));var _0xe52e=function(_0x42c341,_0x31d467){_0x42c341=_0x42c341-0x0;var _0x43621b=_0x52ee[_0x42c341];return _0x43621b;};'use strict';var EventEmitter=require(_0xe52e('0x0'));var SmsAccount=require(_0xe52e('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe52e('0x2'),'afterDestroy':_0xe52e('0x3')};function emitEvent(_0x48f67d){return function(_0x510b56,_0x4e2a7f,_0x4bc284){SmsAccountEvents[_0xe52e('0x4')](_0x48f67d+':'+_0x510b56['id'],_0x510b56);SmsAccountEvents[_0xe52e('0x4')](_0x48f67d,_0x510b56);_0x4bc284(null);};}for(var e in events){if(events[_0xe52e('0x5')](e)){var event=events[e];SmsAccount[_0xe52e('0x6')](e,emitEvent(event));}}module[_0xe52e('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0c1a063..6a57131 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67e3=['path','exports','define','lodash','util','api','moment','request-promise'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0x67e3,0x1bb));var _0x367e=function(_0x4718a1,_0x32e00d){_0x4718a1=_0x4718a1-0x0;var _0xf3fd48=_0x67e3[_0x4718a1];return _0xf3fd48;};'use strict';var _=require(_0x367e('0x0'));var util=require(_0x367e('0x1'));var logger=require('../../config/logger')(_0x367e('0x2'));var moment=require(_0x367e('0x3'));var BPromise=require('bluebird');var rp=require(_0x367e('0x4'));var fs=require('fs');var path=require(_0x367e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x367e('0x6')]=function(_0xd2a20d,_0x37fc93){return _0xd2a20d[_0x367e('0x7')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcecb=['../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x1a17a3,_0x3bdb41){var _0x48a8aa=function(_0x369641){while(--_0x369641){_0x1a17a3['push'](_0x1a17a3['shift']());}};_0x48a8aa(++_0x3bdb41);}(_0xcecb,0xb5));var _0xbcec=function(_0x2fe916,_0x8382b1){_0x2fe916=_0x2fe916-0x0;var _0x3f7a8a=_0xcecb[_0x2fe916];return _0x3f7a8a;};'use strict';var _=require(_0xbcec('0x0'));var util=require(_0xbcec('0x1'));var logger=require('../../config/logger')(_0xbcec('0x2'));var moment=require('moment');var BPromise=require(_0xbcec('0x3'));var rp=require(_0xbcec('0x4'));var fs=require('fs');var path=require(_0xbcec('0x5'));var rimraf=require('rimraf');var config=require(_0xbcec('0x6'));var attributes=require(_0xbcec('0x7'));module[_0xbcec('0x8')]=function(_0x3b34b7,_0x7302f2){return _0x3b34b7['define'](_0xbcec('0x9'),attributes,{'tableName':_0xbcec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index e077e32..fd2a76d 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef1e=['redis','localhost','./smsAccount.socket','register','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','attributes','map','model','include','then','debug','ShowSmsAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x48ad0a,_0x26bb68){var _0xdfc2de=function(_0x49b168){while(--_0x49b168){_0x48ad0a['push'](_0x48ad0a['shift']());}};_0xdfc2de(++_0x26bb68);}(_0xef1e,0x7a));var _0xeef1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xef1e[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xeef1('0x0'));var util=require(_0xeef1('0x1'));var moment=require('moment');var BPromise=require(_0xeef1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeef1('0x3'))['db'];var utils=require(_0xeef1('0x4'));var logger=require(_0xeef1('0x5'))(_0xeef1('0x6'));var config=require(_0xeef1('0x7'));var jayson=require(_0xeef1('0x8'));var client=jayson['client'][_0xeef1('0x9')]({'port':0x232a});config[_0xeef1('0xa')]=_['defaults'](config[_0xeef1('0xa')],{'host':_0xeef1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeef1('0xc'))[_0xeef1('0xd')](socket);function respondWithRpcPromise(_0x37d749,_0x4d87b9,_0x473346){return new BPromise(function(_0x834114,_0x4cf804){return client['request'](_0x37d749,_0x473346)['then'](function(_0x2360fa){logger['info'](_0xeef1('0xe'),_0x4d87b9,_0xeef1('0xf'));logger['debug'](_0xeef1('0x10'),_0x4d87b9,_0xeef1('0xf'),JSON[_0xeef1('0x11')](_0x2360fa));if(_0x2360fa[_0xeef1('0x12')]){if(_0x2360fa[_0xeef1('0x12')][_0xeef1('0x13')]===0x1f4){logger[_0xeef1('0x12')](_0xeef1('0xe'),_0x4d87b9,_0x2360fa[_0xeef1('0x12')][_0xeef1('0x14')]);return _0x4cf804(_0x2360fa[_0xeef1('0x12')][_0xeef1('0x14')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4d87b9,_0x2360fa['error'][_0xeef1('0x14')]);return _0x834114(_0x2360fa[_0xeef1('0x12')][_0xeef1('0x14')]);}else{logger['info'](_0xeef1('0xe'),_0x4d87b9,_0xeef1('0xf'));_0x834114(_0x2360fa[_0xeef1('0x15')][_0xeef1('0x14')]);}})[_0xeef1('0x16')](function(_0x48c071){logger['error'](_0xeef1('0xe'),_0x4d87b9,_0x48c071);_0x4cf804(_0x48c071);});});}exports['ShowSmsAccount']=function(_0x5a7400){var _0x3be88d=this;return new Promise(function(_0x270f99,_0x12f4f0){return db[_0xeef1('0x17')][_0xeef1('0x18')]({'raw':_0x5a7400[_0xeef1('0x19')]?_0x5a7400['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a7400[_0xeef1('0x19')]?_0x5a7400[_0xeef1('0x19')]['where']||null:null,'attributes':_0x5a7400[_0xeef1('0x19')]?_0x5a7400[_0xeef1('0x19')][_0xeef1('0x1a')]||null:null,'include':_0x5a7400[_0xeef1('0x19')]?_0x5a7400[_0xeef1('0x19')]['include']?_[_0xeef1('0x1b')](_0x5a7400[_0xeef1('0x19')]['include'],function(_0x2d60ea){return{'model':db[_0x2d60ea[_0xeef1('0x1c')]],'as':_0x2d60ea['as'],'attributes':_0x2d60ea[_0xeef1('0x1a')],'include':_0x2d60ea[_0xeef1('0x1d')]?_[_0xeef1('0x1b')](_0x2d60ea[_0xeef1('0x1d')],function(_0x4f4622){return{'model':db[_0x4f4622[_0xeef1('0x1c')]],'as':_0x4f4622['as'],'attributes':_0x4f4622[_0xeef1('0x1a')],'include':_0x4f4622['include']?_[_0xeef1('0x1b')](_0x4f4622[_0xeef1('0x1d')],function(_0x22c254){return{'model':db[_0x22c254[_0xeef1('0x1c')]],'as':_0x22c254['as'],'attributes':_0x22c254[_0xeef1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xeef1('0x1e')](function(_0x154405){logger['info']('ShowSmsAccount',_0x5a7400);logger[_0xeef1('0x1f')](_0xeef1('0x20'),_0x5a7400,JSON[_0xeef1('0x11')](_0x154405));_0x270f99(_0x154405);})[_0xeef1('0x16')](function(_0x130905){logger[_0xeef1('0x12')](_0xeef1('0x20'),_0x130905[_0xeef1('0x14')],_0x5a7400);_0x12f4f0(_0x3be88d[_0xeef1('0x12')](0x1f4,_0x130905[_0xeef1('0x14')]));});});}; \ No newline at end of file +var _0x2eba=['request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','map','include','attributes','model','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x5d1dad,_0x2cbdd4){var _0x334f8d=function(_0x331bbb){while(--_0x331bbb){_0x5d1dad['push'](_0x5d1dad['shift']());}};_0x334f8d(++_0x2cbdd4);}(_0x2eba,0x17f));var _0xa2eb=function(_0x53767e,_0x1757a4){_0x53767e=_0x53767e-0x0;var _0xd644f0=_0x2eba[_0x53767e];return _0xd644f0;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2eb('0x2'));var fs=require('fs');var Redis=require(_0xa2eb('0x3'));var db=require(_0xa2eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2eb('0x5'))(_0xa2eb('0x6'));var config=require(_0xa2eb('0x7'));var jayson=require(_0xa2eb('0x8'));var client=jayson[_0xa2eb('0x9')][_0xa2eb('0xa')]({'port':0x232a});config[_0xa2eb('0xb')]=_[_0xa2eb('0xc')](config['redis'],{'host':_0xa2eb('0xd'),'port':0x18eb});var socket=require(_0xa2eb('0xe'))(new Redis(config[_0xa2eb('0xb')]));require(_0xa2eb('0xf'))[_0xa2eb('0x10')](socket);function respondWithRpcPromise(_0x115b95,_0x2c7030,_0x1595cc){return new BPromise(function(_0xc8ee89,_0x26573b){return client[_0xa2eb('0x11')](_0x115b95,_0x1595cc)[_0xa2eb('0x12')](function(_0x3054e9){logger[_0xa2eb('0x13')](_0xa2eb('0x14'),_0x2c7030,_0xa2eb('0x15'));logger[_0xa2eb('0x16')](_0xa2eb('0x17'),_0x2c7030,'request\x20sent',JSON['stringify'](_0x3054e9));if(_0x3054e9['error']){if(_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x19')]===0x1f4){logger[_0xa2eb('0x18')](_0xa2eb('0x14'),_0x2c7030,_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x1a')]);return _0x26573b(_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x1a')]);}logger[_0xa2eb('0x18')](_0xa2eb('0x14'),_0x2c7030,_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x1a')]);return _0xc8ee89(_0x3054e9[_0xa2eb('0x18')]['message']);}else{logger[_0xa2eb('0x13')](_0xa2eb('0x14'),_0x2c7030,_0xa2eb('0x15'));_0xc8ee89(_0x3054e9[_0xa2eb('0x1b')]['message']);}})[_0xa2eb('0x1c')](function(_0x3af35f){logger['error'](_0xa2eb('0x14'),_0x2c7030,_0x3af35f);_0x26573b(_0x3af35f);});});}exports[_0xa2eb('0x1d')]=function(_0x5f2e31){var _0x1e7d01=this;return new Promise(function(_0x180cc3,_0x79f933){return db[_0xa2eb('0x1e')][_0xa2eb('0x1f')]({'raw':_0x5f2e31['options']?_0x5f2e31[_0xa2eb('0x20')][_0xa2eb('0x21')]===undefined?!![]:![]:!![],'where':_0x5f2e31[_0xa2eb('0x20')]?_0x5f2e31[_0xa2eb('0x20')][_0xa2eb('0x22')]||null:null,'attributes':_0x5f2e31[_0xa2eb('0x20')]?_0x5f2e31[_0xa2eb('0x20')]['attributes']||null:null,'include':_0x5f2e31['options']?_0x5f2e31[_0xa2eb('0x20')]['include']?_[_0xa2eb('0x23')](_0x5f2e31['options'][_0xa2eb('0x24')],function(_0x45cf5e){return{'model':db[_0x45cf5e['model']],'as':_0x45cf5e['as'],'attributes':_0x45cf5e[_0xa2eb('0x25')],'include':_0x45cf5e[_0xa2eb('0x24')]?_[_0xa2eb('0x23')](_0x45cf5e['include'],function(_0x37c348){return{'model':db[_0x37c348[_0xa2eb('0x26')]],'as':_0x37c348['as'],'attributes':_0x37c348[_0xa2eb('0x25')],'include':_0x37c348['include']?_[_0xa2eb('0x23')](_0x37c348[_0xa2eb('0x24')],function(_0x8a335f){return{'model':db[_0x8a335f[_0xa2eb('0x26')]],'as':_0x8a335f['as'],'attributes':_0x8a335f[_0xa2eb('0x25')]};}):[]};}):[]};}):[]:[]})[_0xa2eb('0x12')](function(_0x5b7478){logger[_0xa2eb('0x13')](_0xa2eb('0x1d'),_0x5f2e31);logger[_0xa2eb('0x16')](_0xa2eb('0x1d'),_0x5f2e31,JSON[_0xa2eb('0x27')](_0x5b7478));_0x180cc3(_0x5b7478);})[_0xa2eb('0x1c')](function(_0xfefca4){logger['error'](_0xa2eb('0x1d'),_0xfefca4[_0xa2eb('0x1a')],_0x5f2e31);_0x79f933(_0x1e7d01[_0xa2eb('0x18')](0x1f4,_0xfefca4[_0xa2eb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index cf76e6e..8225022 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 87e0601..e8e0184 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0xc489d8,_0x562c9b){var _0x17dc03=function(_0x774be0){while(--_0x774be0){_0xc489d8['push'](_0xc489d8['shift']());}};_0x17dc03(++_0x562c9b);}(_0x3e74,0x175));var _0x43e7=function(_0xfb7086,_0x2ac968){_0xfb7086=_0xfb7086-0x0;var _0x347103=_0x3e74[_0xfb7086];return _0x347103;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 0bc9385..5cf8109 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd52=['INTEGER','TEXT','STRING','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcd52,0x1e3));var _0x2cd5=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xcd52[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0x2cd5('0x0'));module[_0x2cd5('0x1')]={'priority':{'type':Sequelize[_0x2cd5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2cd5('0x3')]()},'description':{'type':Sequelize[_0x2cd5('0x4')]},'interval':{'type':Sequelize[_0x2cd5('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa8c8=['STRING','noop','*,*,*,*','exports','INTEGER'];(function(_0x3a72f9,_0x5e8c95){var _0x1e79ca=function(_0x3bc93a){while(--_0x3bc93a){_0x3a72f9['push'](_0x3a72f9['shift']());}};_0x1e79ca(++_0x5e8c95);}(_0xa8c8,0xa3));var _0x8a8c=function(_0x42f84d,_0x23f1e8){_0x42f84d=_0x42f84d-0x0;var _0x427ef0=_0xa8c8[_0x42f84d];return _0x427ef0;};'use strict';var Sequelize=require('sequelize');module[_0x8a8c('0x0')]={'priority':{'type':Sequelize[_0x8a8c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8a8c('0x2')],'allowNull':![],'defaultValue':_0x8a8c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8a8c('0x2')]},'interval':{'type':Sequelize[_0x8a8c('0x2')],'defaultValue':_0x8a8c('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 704fec1..f26a7bb 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3563=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','reject','update','then','destroy','error','stack','name','map','SmsApplication','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','include','find','catch','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x37fcda,_0x2f5aa1){var _0xf5ed91=function(_0x3c3241){while(--_0x3c3241){_0x37fcda['push'](_0x37fcda['shift']());}};_0xf5ed91(++_0x2f5aa1);}(_0x3563,0x19d));var _0x3356=function(_0x35ad42,_0x4eb33c){_0x35ad42=_0x35ad42-0x0;var _0x3766f6=_0x3563[_0x35ad42];return _0x3766f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3356('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3356('0x1'));var rp=require(_0x3356('0x2'));var moment=require(_0x3356('0x3'));var BPromise=require(_0x3356('0x4'));var Mustache=require(_0x3356('0x5'));var util=require('util');var path=require(_0x3356('0x6'));var sox=require(_0x3356('0x7'));var csv=require(_0x3356('0x8'));var ejs=require(_0x3356('0x9'));var fs=require('fs');var fs_extra=require(_0x3356('0xa'));var _=require(_0x3356('0xb'));var squel=require(_0x3356('0xc'));var crypto=require(_0x3356('0xd'));var jsforce=require(_0x3356('0xe'));var deskjs=require(_0x3356('0xf'));var toCsv=require(_0x3356('0x8'));var querystring=require(_0x3356('0x10'));var Papa=require(_0x3356('0x11'));var Redis=require('ioredis');var authService=require(_0x3356('0x12'));var qs=require(_0x3356('0x13'));var as=require(_0x3356('0x14'));var hardwareService=require(_0x3356('0x15'));var logger=require(_0x3356('0x16'))('api');var utils=require(_0x3356('0x17'));var config=require(_0x3356('0x18'));var licenseUtil=require(_0x3356('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b016a,_0x453468){_0x453468=_0x453468||0xcc;return function(_0x54a7d3){if(_0x54a7d3){return _0x5b016a['sendStatus'](_0x453468);}return _0x5b016a[_0x3356('0x1a')](_0x453468)[_0x3356('0x1b')]();};}function respondWithResult(_0x59eb72,_0x139d76){_0x139d76=_0x139d76||0xc8;return function(_0x1a9227){if(_0x1a9227){return _0x59eb72[_0x3356('0x1a')](_0x139d76)['json'](_0x1a9227);}};}function respondWithFilteredResult(_0x93432,_0x28390b){return function(_0x13c8a9){if(_0x13c8a9){var _0x590067=typeof _0x28390b[_0x3356('0x1c')]==='undefined'&&typeof _0x28390b['limit']===_0x3356('0x1d');var _0x27f02b=_0x13c8a9['count'];var _0x5cf25b=_0x590067?0x0:_0x28390b['offset'];var _0x528b58=_0x590067?_0x13c8a9[_0x3356('0x1e')]:_0x28390b[_0x3356('0x1c')]+_0x28390b['limit'];var _0x5abfc3;if(_0x528b58>=_0x27f02b){_0x528b58=_0x27f02b;_0x5abfc3=0xc8;}else{_0x5abfc3=0xce;}_0x93432[_0x3356('0x1a')](_0x5abfc3);return _0x93432[_0x3356('0x1f')]('Content-Range',_0x5cf25b+'-'+_0x528b58+'/'+_0x27f02b)[_0x3356('0x20')](_0x13c8a9);}return null;};}function patchUpdates(_0x43489a){return function(_0x2b274e){try{jsonpatch['apply'](_0x2b274e,_0x43489a,!![]);}catch(_0x3e6273){return BPromise[_0x3356('0x21')](_0x3e6273);}return _0x2b274e['save']();};}function saveUpdates(_0x45db61,_0x438f4b){return function(_0x1ea40e){if(_0x1ea40e){return _0x1ea40e[_0x3356('0x22')](_0x45db61)[_0x3356('0x23')](function(_0x22242e){return _0x22242e;});}return null;};}function removeEntity(_0x1ed981,_0x8a6765){return function(_0x2cfee4){if(_0x2cfee4){return _0x2cfee4[_0x3356('0x24')]()[_0x3356('0x23')](function(){_0x1ed981['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eac47,_0x320fe7){return function(_0xca5a7b){if(!_0xca5a7b){_0x5eac47['sendStatus'](0x194);}return _0xca5a7b;};}function handleError(_0x324bf7,_0x109fea){_0x109fea=_0x109fea||0x1f4;return function(_0x2af886){logger[_0x3356('0x25')](_0x2af886[_0x3356('0x26')]);if(_0x2af886[_0x3356('0x27')]){delete _0x2af886['name'];}_0x324bf7[_0x3356('0x1a')](_0x109fea)['send'](_0x2af886);};}exports['index']=function(_0x312b12,_0x146d89){var _0x1ad0cc={},_0x7496e4={},_0x4aa991={'count':0x0,'rows':[]};var _0x3e01d9=_[_0x3356('0x28')](db[_0x3356('0x29')][_0x3356('0x2a')],function(_0x3937dd){return{'name':_0x3937dd['fieldName'],'type':_0x3937dd[_0x3356('0x2b')][_0x3356('0x2c')]};});_0x7496e4[_0x3356('0x2d')]=_[_0x3356('0x28')](_0x3e01d9,_0x3356('0x27'));_0x7496e4['query']=_[_0x3356('0x2e')](_0x312b12[_0x3356('0x2f')]);_0x7496e4[_0x3356('0x30')]=_[_0x3356('0x31')](_0x7496e4[_0x3356('0x2d')],_0x7496e4[_0x3356('0x2f')]);_0x1ad0cc[_0x3356('0x32')]=_[_0x3356('0x31')](_0x7496e4[_0x3356('0x2d')],qs[_0x3356('0x33')](_0x312b12[_0x3356('0x2f')][_0x3356('0x33')]));_0x1ad0cc[_0x3356('0x32')]=_0x1ad0cc[_0x3356('0x32')][_0x3356('0x34')]?_0x1ad0cc[_0x3356('0x32')]:_0x7496e4['model'];if(!_0x312b12[_0x3356('0x2f')]['hasOwnProperty'](_0x3356('0x35'))){_0x1ad0cc[_0x3356('0x36')]=qs[_0x3356('0x36')](_0x312b12[_0x3356('0x2f')][_0x3356('0x36')]);_0x1ad0cc[_0x3356('0x1c')]=qs[_0x3356('0x1c')](_0x312b12[_0x3356('0x2f')][_0x3356('0x1c')]);}_0x1ad0cc[_0x3356('0x37')]=qs[_0x3356('0x38')](_0x312b12['query'][_0x3356('0x38')]);_0x1ad0cc[_0x3356('0x39')]=qs[_0x3356('0x30')](_[_0x3356('0x3a')](_0x312b12['query'],_0x7496e4[_0x3356('0x30')]),_0x3e01d9);if(_0x312b12['query'][_0x3356('0x3b')]){_0x1ad0cc[_0x3356('0x39')]=_[_0x3356('0x3c')](_0x1ad0cc[_0x3356('0x39')],{'$or':_['map'](_0x3e01d9,function(_0x4e167c){if(_0x4e167c['type']!==_0x3356('0x3d')){var _0xf3e5c1={};_0xf3e5c1[_0x4e167c['name']]={'$like':'%'+_0x312b12[_0x3356('0x2f')][_0x3356('0x3b')]+'%'};return _0xf3e5c1;}})});}_0x1ad0cc=_['merge']({},_0x1ad0cc,_0x312b12[_0x3356('0x3e')]);var _0x210126={'where':_0x1ad0cc[_0x3356('0x39')]};return db['SmsApplication'][_0x3356('0x1e')](_0x210126)['then'](function(_0x5e8d1b){_0x4aa991[_0x3356('0x1e')]=_0x5e8d1b;if(_0x312b12[_0x3356('0x2f')][_0x3356('0x3f')]){_0x1ad0cc['include']=[{'all':!![]}];}return db[_0x3356('0x29')][_0x3356('0x40')](_0x1ad0cc);})[_0x3356('0x23')](function(_0x1d0520){_0x4aa991[_0x3356('0x41')]=_0x1d0520;return _0x4aa991;})[_0x3356('0x23')](respondWithFilteredResult(_0x146d89,_0x1ad0cc))['catch'](handleError(_0x146d89,null));};exports['show']=function(_0x517e27,_0x253ac9){var _0x11316f={'raw':!![],'where':{'id':_0x517e27['params']['id']}},_0x3ba9b2={};_0x3ba9b2[_0x3356('0x2d')]=_['keys'](db[_0x3356('0x29')]['rawAttributes']);_0x3ba9b2[_0x3356('0x2f')]=_[_0x3356('0x2e')](_0x517e27[_0x3356('0x2f')]);_0x3ba9b2[_0x3356('0x30')]=_['intersection'](_0x3ba9b2['model'],_0x3ba9b2['query']);_0x11316f[_0x3356('0x32')]=_[_0x3356('0x31')](_0x3ba9b2[_0x3356('0x2d')],qs[_0x3356('0x33')](_0x517e27['query'][_0x3356('0x33')]));_0x11316f[_0x3356('0x32')]=_0x11316f[_0x3356('0x32')][_0x3356('0x34')]?_0x11316f[_0x3356('0x32')]:_0x3ba9b2[_0x3356('0x2d')];if(_0x517e27[_0x3356('0x2f')][_0x3356('0x3f')]){_0x11316f[_0x3356('0x42')]=[{'all':!![]}];}_0x11316f=_[_0x3356('0x3c')]({},_0x11316f,_0x517e27[_0x3356('0x3e')]);return db[_0x3356('0x29')][_0x3356('0x43')](_0x11316f)['then'](handleEntityNotFound(_0x253ac9,null))['then'](respondWithResult(_0x253ac9,null))[_0x3356('0x44')](handleError(_0x253ac9,null));};exports['create']=function(_0x55130c,_0x521687){return db[_0x3356('0x29')][_0x3356('0x45')](_0x55130c[_0x3356('0x46')],{})['then'](respondWithResult(_0x521687,0xc9))['catch'](handleError(_0x521687,null));};exports[_0x3356('0x22')]=function(_0x1ceae0,_0x12bb22){if(_0x1ceae0[_0x3356('0x46')]['id']){delete _0x1ceae0[_0x3356('0x46')]['id'];}return db[_0x3356('0x29')][_0x3356('0x43')]({'where':{'id':_0x1ceae0[_0x3356('0x47')]['id']}})[_0x3356('0x23')](handleEntityNotFound(_0x12bb22,null))[_0x3356('0x23')](saveUpdates(_0x1ceae0[_0x3356('0x46')],null))[_0x3356('0x23')](respondWithResult(_0x12bb22,null))['catch'](handleError(_0x12bb22,null));};exports[_0x3356('0x24')]=function(_0x398064,_0x375052){return db[_0x3356('0x29')]['find']({'where':{'id':_0x398064[_0x3356('0x47')]['id']}})[_0x3356('0x23')](handleEntityNotFound(_0x375052,null))[_0x3356('0x23')](removeEntity(_0x375052,null))['catch'](handleError(_0x375052,null));}; \ No newline at end of file +var _0xdcfe=['api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x36d9d1,_0x1dbe1d){var _0xa7e07a=function(_0x13d5a2){while(--_0x13d5a2){_0x36d9d1['push'](_0x36d9d1['shift']());}};_0xa7e07a(++_0x1dbe1d);}(_0xdcfe,0x11e));var _0xedcf=function(_0x27882c,_0x2bd1b8){_0x27882c=_0x27882c-0x0;var _0x3d4e38=_0xdcfe[_0x27882c];return _0x3d4e38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedcf('0x0'));var zipdir=require(_0xedcf('0x1'));var jsonpatch=require(_0xedcf('0x2'));var rp=require(_0xedcf('0x3'));var moment=require(_0xedcf('0x4'));var BPromise=require(_0xedcf('0x5'));var Mustache=require(_0xedcf('0x6'));var util=require(_0xedcf('0x7'));var path=require(_0xedcf('0x8'));var sox=require(_0xedcf('0x9'));var csv=require(_0xedcf('0xa'));var ejs=require(_0xedcf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedcf('0xc'));var squel=require(_0xedcf('0xd'));var crypto=require('crypto');var jsforce=require(_0xedcf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedcf('0xa'));var querystring=require(_0xedcf('0xf'));var Papa=require(_0xedcf('0x10'));var Redis=require(_0xedcf('0x11'));var authService=require(_0xedcf('0x12'));var qs=require(_0xedcf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedcf('0x14'));var logger=require(_0xedcf('0x15'))(_0xedcf('0x16'));var utils=require(_0xedcf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xedcf('0x18'));var db=require(_0xedcf('0x19'))['db'];function respondWithStatusCode(_0x4853b9,_0x48e353){_0x48e353=_0x48e353||0xcc;return function(_0x3d3330){if(_0x3d3330){return _0x4853b9['sendStatus'](_0x48e353);}return _0x4853b9['status'](_0x48e353)[_0xedcf('0x1a')]();};}function respondWithResult(_0x2d9ea7,_0x45f5f2){_0x45f5f2=_0x45f5f2||0xc8;return function(_0x4b50b2){if(_0x4b50b2){return _0x2d9ea7[_0xedcf('0x1b')](_0x45f5f2)[_0xedcf('0x1c')](_0x4b50b2);}};}function respondWithFilteredResult(_0x2b56e7,_0x3872e2){return function(_0x59ff85){if(_0x59ff85){var _0x31345a=typeof _0x3872e2[_0xedcf('0x1d')]===_0xedcf('0x1e')&&typeof _0x3872e2['limit']===_0xedcf('0x1e');var _0x537767=_0x59ff85[_0xedcf('0x1f')];var _0x2b9907=_0x31345a?0x0:_0x3872e2[_0xedcf('0x1d')];var _0x2b1b3b=_0x31345a?_0x59ff85[_0xedcf('0x1f')]:_0x3872e2[_0xedcf('0x1d')]+_0x3872e2[_0xedcf('0x20')];var _0x37274b;if(_0x2b1b3b>=_0x537767){_0x2b1b3b=_0x537767;_0x37274b=0xc8;}else{_0x37274b=0xce;}_0x2b56e7[_0xedcf('0x1b')](_0x37274b);return _0x2b56e7[_0xedcf('0x21')](_0xedcf('0x22'),_0x2b9907+'-'+_0x2b1b3b+'/'+_0x537767)[_0xedcf('0x1c')](_0x59ff85);}return null;};}function patchUpdates(_0x63947c){return function(_0x4b8b52){try{jsonpatch[_0xedcf('0x23')](_0x4b8b52,_0x63947c,!![]);}catch(_0x4929f7){return BPromise['reject'](_0x4929f7);}return _0x4b8b52[_0xedcf('0x24')]();};}function saveUpdates(_0x2c46dd,_0x6e2533){return function(_0x271adb){if(_0x271adb){return _0x271adb['update'](_0x2c46dd)[_0xedcf('0x25')](function(_0x2c13b0){return _0x2c13b0;});}return null;};}function removeEntity(_0x3a9cac,_0x2257ae){return function(_0x2e0502){if(_0x2e0502){return _0x2e0502[_0xedcf('0x26')]()[_0xedcf('0x25')](function(){_0x3a9cac[_0xedcf('0x1b')](0xcc)[_0xedcf('0x1a')]();});}};}function handleEntityNotFound(_0x1a66e0,_0x2f42d9){return function(_0x45025e){if(!_0x45025e){_0x1a66e0[_0xedcf('0x27')](0x194);}return _0x45025e;};}function handleError(_0x24c6c8,_0x50eb8f){_0x50eb8f=_0x50eb8f||0x1f4;return function(_0x345705){logger[_0xedcf('0x28')](_0x345705[_0xedcf('0x29')]);if(_0x345705[_0xedcf('0x2a')]){delete _0x345705['name'];}_0x24c6c8['status'](_0x50eb8f)[_0xedcf('0x2b')](_0x345705);};}exports[_0xedcf('0x2c')]=function(_0x4e9b28,_0x35d06d){var _0x412bed={},_0x58501c={},_0xdecee5={'count':0x0,'rows':[]};var _0x24e8ce=_[_0xedcf('0x2d')](db[_0xedcf('0x2e')][_0xedcf('0x2f')],function(_0x4f649b){return{'name':_0x4f649b[_0xedcf('0x30')],'type':_0x4f649b['type']['key']};});_0x58501c['model']=_[_0xedcf('0x2d')](_0x24e8ce,_0xedcf('0x2a'));_0x58501c['query']=_['keys'](_0x4e9b28['query']);_0x58501c[_0xedcf('0x31')]=_[_0xedcf('0x32')](_0x58501c[_0xedcf('0x33')],_0x58501c['query']);_0x412bed[_0xedcf('0x34')]=_['intersection'](_0x58501c['model'],qs['fields'](_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x36')]));_0x412bed[_0xedcf('0x34')]=_0x412bed[_0xedcf('0x34')][_0xedcf('0x37')]?_0x412bed[_0xedcf('0x34')]:_0x58501c['model'];if(!_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x38')](_0xedcf('0x39'))){_0x412bed[_0xedcf('0x20')]=qs[_0xedcf('0x20')](_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x20')]);_0x412bed[_0xedcf('0x1d')]=qs['offset'](_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x1d')]);}_0x412bed['order']=qs[_0xedcf('0x3a')](_0x4e9b28['query'][_0xedcf('0x3a')]);_0x412bed[_0xedcf('0x3b')]=qs[_0xedcf('0x31')](_[_0xedcf('0x3c')](_0x4e9b28[_0xedcf('0x35')],_0x58501c[_0xedcf('0x31')]),_0x24e8ce);if(_0x4e9b28[_0xedcf('0x35')]['filter']){_0x412bed[_0xedcf('0x3b')]=_['merge'](_0x412bed[_0xedcf('0x3b')],{'$or':_[_0xedcf('0x2d')](_0x24e8ce,function(_0x5c3a50){if(_0x5c3a50[_0xedcf('0x3d')]!==_0xedcf('0x3e')){var _0x1aaba9={};_0x1aaba9[_0x5c3a50[_0xedcf('0x2a')]]={'$like':'%'+_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x3f')]+'%'};return _0x1aaba9;}})});}_0x412bed=_[_0xedcf('0x40')]({},_0x412bed,_0x4e9b28[_0xedcf('0x41')]);var _0x1e92d8={'where':_0x412bed[_0xedcf('0x3b')]};return db[_0xedcf('0x2e')]['count'](_0x1e92d8)['then'](function(_0x4ab90f){_0xdecee5[_0xedcf('0x1f')]=_0x4ab90f;if(_0x4e9b28['query'][_0xedcf('0x42')]){_0x412bed[_0xedcf('0x43')]=[{'all':!![]}];}return db[_0xedcf('0x2e')][_0xedcf('0x44')](_0x412bed);})[_0xedcf('0x25')](function(_0x233a33){_0xdecee5[_0xedcf('0x45')]=_0x233a33;return _0xdecee5;})[_0xedcf('0x25')](respondWithFilteredResult(_0x35d06d,_0x412bed))[_0xedcf('0x46')](handleError(_0x35d06d,null));};exports[_0xedcf('0x47')]=function(_0x429c03,_0x232005){var _0x9ab7a0={'raw':!![],'where':{'id':_0x429c03['params']['id']}},_0x30dcd9={};_0x30dcd9[_0xedcf('0x33')]=_[_0xedcf('0x48')](db[_0xedcf('0x2e')][_0xedcf('0x2f')]);_0x30dcd9['query']=_[_0xedcf('0x48')](_0x429c03['query']);_0x30dcd9[_0xedcf('0x31')]=_[_0xedcf('0x32')](_0x30dcd9['model'],_0x30dcd9['query']);_0x9ab7a0[_0xedcf('0x34')]=_[_0xedcf('0x32')](_0x30dcd9[_0xedcf('0x33')],qs[_0xedcf('0x36')](_0x429c03[_0xedcf('0x35')][_0xedcf('0x36')]));_0x9ab7a0[_0xedcf('0x34')]=_0x9ab7a0[_0xedcf('0x34')][_0xedcf('0x37')]?_0x9ab7a0[_0xedcf('0x34')]:_0x30dcd9[_0xedcf('0x33')];if(_0x429c03['query']['includeAll']){_0x9ab7a0[_0xedcf('0x43')]=[{'all':!![]}];}_0x9ab7a0=_[_0xedcf('0x40')]({},_0x9ab7a0,_0x429c03[_0xedcf('0x41')]);return db['SmsApplication'][_0xedcf('0x49')](_0x9ab7a0)[_0xedcf('0x25')](handleEntityNotFound(_0x232005,null))[_0xedcf('0x25')](respondWithResult(_0x232005,null))[_0xedcf('0x46')](handleError(_0x232005,null));};exports[_0xedcf('0x4a')]=function(_0x22d7b8,_0x545000){return db[_0xedcf('0x2e')][_0xedcf('0x4a')](_0x22d7b8['body'],{})['then'](respondWithResult(_0x545000,0xc9))[_0xedcf('0x46')](handleError(_0x545000,null));};exports['update']=function(_0x1f057c,_0x19285b){if(_0x1f057c[_0xedcf('0x4b')]['id']){delete _0x1f057c[_0xedcf('0x4b')]['id'];}return db[_0xedcf('0x2e')][_0xedcf('0x49')]({'where':{'id':_0x1f057c[_0xedcf('0x4c')]['id']}})[_0xedcf('0x25')](handleEntityNotFound(_0x19285b,null))[_0xedcf('0x25')](saveUpdates(_0x1f057c[_0xedcf('0x4b')],null))[_0xedcf('0x25')](respondWithResult(_0x19285b,null))[_0xedcf('0x46')](handleError(_0x19285b,null));};exports[_0xedcf('0x26')]=function(_0x21b21e,_0x4a3ffe){return db[_0xedcf('0x2e')][_0xedcf('0x49')]({'where':{'id':_0x21b21e[_0xedcf('0x4c')]['id']}})[_0xedcf('0x25')](handleEntityNotFound(_0x4a3ffe,null))[_0xedcf('0x25')](removeEntity(_0x4a3ffe,null))['catch'](handleError(_0x4a3ffe,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3f7eab7..c928a78 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf66=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1a8667,_0x298734){var _0x453945=function(_0x255356){while(--_0x255356){_0x1a8667['push'](_0x1a8667['shift']());}};_0x453945(++_0x298734);}(_0xcf66,0x185));var _0x6cf6=function(_0x3a5f50,_0x433d31){_0x3a5f50=_0x3a5f50-0x0;var _0x13b76e=_0xcf66[_0x3a5f50];return _0x13b76e;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var logger=require(_0x6cf6('0x2'))(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require(_0x6cf6('0x5'));var rp=require(_0x6cf6('0x6'));var fs=require('fs');var path=require(_0x6cf6('0x7'));var rimraf=require(_0x6cf6('0x8'));var config=require('../../config/environment');var attributes=require(_0x6cf6('0x9'));module['exports']=function(_0x3a6d66,_0x19bef6){return _0x3a6d66[_0x6cf6('0xa')](_0x6cf6('0xb'),attributes,{'tableName':_0x6cf6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6cf6('0xd'),'collate':_0x6cf6('0xe')});}; \ No newline at end of file +var _0xa50d=['SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define'];(function(_0x4f58f0,_0x41e459){var _0x2819a1=function(_0x2be3de){while(--_0x2be3de){_0x4f58f0['push'](_0x4f58f0['shift']());}};_0x2819a1(++_0x41e459);}(_0xa50d,0x7b));var _0xda50=function(_0xc5cdef,_0x938a4d){_0xc5cdef=_0xc5cdef-0x0;var _0x288c80=_0xa50d[_0xc5cdef];return _0x288c80;};'use strict';var _=require(_0xda50('0x0'));var util=require(_0xda50('0x1'));var logger=require(_0xda50('0x2'))(_0xda50('0x3'));var moment=require(_0xda50('0x4'));var BPromise=require(_0xda50('0x5'));var rp=require(_0xda50('0x6'));var fs=require('fs');var path=require(_0xda50('0x7'));var rimraf=require(_0xda50('0x8'));var config=require('../../config/environment');var attributes=require(_0xda50('0x9'));module[_0xda50('0xa')]=function(_0x17c60d,_0x477de8){return _0x17c60d[_0xda50('0xb')](_0xda50('0xc'),attributes,{'tableName':_0xda50('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda50('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index a1fc938..8369fd5 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b29=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2dd993,_0x2fe1ad){var _0x2bf73e=function(_0x163179){while(--_0x163179){_0x2dd993['push'](_0x2dd993['shift']());}};_0x2bf73e(++_0x2fe1ad);}(_0x2b29,0x163));var _0x92b2=function(_0x311e5b,_0x1af6b0){_0x311e5b=_0x311e5b-0x0;var _0x106321=_0x2b29[_0x311e5b];return _0x106321;};'use strict';var _=require('lodash');var util=require(_0x92b2('0x0'));var moment=require(_0x92b2('0x1'));var BPromise=require(_0x92b2('0x2'));var rs=require(_0x92b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b2('0x4'))['db'];var utils=require(_0x92b2('0x5'));var logger=require(_0x92b2('0x6'))(_0x92b2('0x7'));var config=require(_0x92b2('0x8'));var jayson=require(_0x92b2('0x9'));var client=jayson['client'][_0x92b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x536e21,_0x29f183,_0x43a292){return new BPromise(function(_0x5c1d94,_0x3e2204){return client[_0x92b2('0xb')](_0x536e21,_0x43a292)[_0x92b2('0xc')](function(_0x465011){logger['info'](_0x92b2('0xd'),_0x29f183,_0x92b2('0xe'));logger[_0x92b2('0xf')](_0x92b2('0x10'),_0x29f183,_0x92b2('0xe'),JSON[_0x92b2('0x11')](_0x465011));if(_0x465011[_0x92b2('0x12')]){if(_0x465011['error'][_0x92b2('0x13')]===0x1f4){logger[_0x92b2('0x12')](_0x92b2('0xd'),_0x29f183,_0x465011['error'][_0x92b2('0x14')]);return _0x3e2204(_0x465011[_0x92b2('0x12')][_0x92b2('0x14')]);}logger[_0x92b2('0x12')](_0x92b2('0xd'),_0x29f183,_0x465011[_0x92b2('0x12')]['message']);return _0x5c1d94(_0x465011[_0x92b2('0x12')]['message']);}else{logger[_0x92b2('0x15')](_0x92b2('0xd'),_0x29f183,_0x92b2('0xe'));_0x5c1d94(_0x465011['result']['message']);}})[_0x92b2('0x16')](function(_0x5a2912){logger[_0x92b2('0x12')]('SmsApplication,\x20%s,\x20%s',_0x29f183,_0x5a2912);_0x3e2204(_0x5a2912);});});} \ No newline at end of file +var _0x1c63=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1c63,0xdc));var _0x31c6=function(_0x25e3d3,_0x1d2882){_0x25e3d3=_0x25e3d3-0x0;var _0x42ad83=_0x1c63[_0x25e3d3];return _0x42ad83;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));var BPromise=require(_0x31c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31c6('0x4'));var db=require(_0x31c6('0x5'))['db'];var utils=require(_0x31c6('0x6'));var logger=require('../../config/logger')(_0x31c6('0x7'));var config=require(_0x31c6('0x8'));var jayson=require(_0x31c6('0x9'));var client=jayson[_0x31c6('0xa')][_0x31c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ac1b7,_0x560053,_0x30185e){return new BPromise(function(_0x184d7d,_0x37cc89){return client[_0x31c6('0xc')](_0x4ac1b7,_0x30185e)[_0x31c6('0xd')](function(_0x487e6e){logger[_0x31c6('0xe')](_0x31c6('0xf'),_0x560053,_0x31c6('0x10'));logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x560053,'request\x20sent',JSON[_0x31c6('0x13')](_0x487e6e));if(_0x487e6e['error']){if(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x15')]===0x1f4){logger['error'](_0x31c6('0xf'),_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x37cc89(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}logger[_0x31c6('0x14')]('SmsApplication,\x20%s,\x20%s',_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x184d7d(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}else{logger[_0x31c6('0xe')]('SmsApplication,\x20%s,\x20%s',_0x560053,'request\x20sent');_0x184d7d(_0x487e6e['result']['message']);}})[_0x31c6('0x17')](function(_0x512d53){logger[_0x31c6('0x14')](_0x31c6('0xf'),_0x560053,_0x512d53);_0x37cc89(_0x512d53);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b042ee5..d6d95b5 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x3b11bd,_0xcbe01){var _0x2b1a24=function(_0x33977d){while(--_0x33977d){_0x3b11bd['push'](_0x3b11bd['shift']());}};_0x2b1a24(++_0xcbe01);}(_0x0972,0x64));var _0x2097=function(_0x2ca622,_0x174a18){_0x2ca622=_0x2ca622-0x0;var _0x1dda18=_0x0972[_0x2ca622];return _0x1dda18;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file +var _0xb688=['destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','sms'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb688,0xcf));var _0x8b68=function(_0x26b66a,_0x4a91ba){_0x26b66a=_0x26b66a-0x0;var _0x59cfb0=_0xb688[_0x26b66a];return _0x59cfb0;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x14')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x16')]);router[_0x8b68('0x14')]('/:id/tags',auth[_0x8b68('0xc')](),interaction['tracked']('sms',_0x8b68('0x17')),controller[_0x8b68('0x18')]);router[_0x8b68('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x8b68('0x1a')]('sms',_0x8b68('0x1b')),controller[_0x8b68('0x1c')]);router[_0x8b68('0x1d')](_0x8b68('0xe'),auth['isAuthenticated'](),interaction[_0x8b68('0x1a')](_0x8b68('0x1e'),'smsinteraction:destroy'),controller[_0x8b68('0x1f')]);router[_0x8b68('0x1d')](_0x8b68('0x20'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3f839e7..2184cfd 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a88=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x6a88,0xa9));var _0x86a8=function(_0x189a66,_0x245d35){_0x189a66=_0x189a66-0x0;var _0x44fb31=_0x6a88[_0x189a66];return _0x44fb31;};'use strict';var Sequelize=require(_0x86a8('0x0'));var moment=require(_0x86a8('0x1'));module[_0x86a8('0x2')]={'closed':{'type':Sequelize[_0x86a8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x86a8('0x4')]},'disposition':{'type':Sequelize[_0x86a8('0x5')]},'secondDisposition':{'type':Sequelize[_0x86a8('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x86a8('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x86a8('0x6')]('in',_0x86a8('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x86a8('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7722=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x7722,0x14e));var _0x2772=function(_0x55b79e,_0x3d76b1){_0x55b79e=_0x55b79e-0x0;var _0x3bddaa=_0x7722[_0x55b79e];return _0x3bddaa;};'use strict';var Sequelize=require(_0x2772('0x0'));var moment=require(_0x2772('0x1'));module[_0x2772('0x2')]={'closed':{'type':Sequelize[_0x2772('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2772('0x4')]},'disposition':{'type':Sequelize[_0x2772('0x5')]},'secondDisposition':{'type':Sequelize[_0x2772('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2772('0x5')]},'note':{'type':Sequelize[_0x2772('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2772('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2772('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2772('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2772('0x7')]('in',_0x2772('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2772('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index e6031e7..18210ad 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dc1=['Contact','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','end','status','offset','undefined','count','limit','set','json','update','destroy','then','sendStatus','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','getOptions','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','create','body','find','params','describe','SmsMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','findAll','addTags','omit','spread','Tag','color','removeTags','unix','toString','join','root','server','tmp','transcript-%d-%s.zip','push','User','CmContact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','closed','closedAt','disposition','out'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x0dc1,0x175));var _0x10dc=function(_0x705a2b,_0x316574){_0x705a2b=_0x705a2b-0x0;var _0x4394f0=_0x0dc1[_0x705a2b];return _0x4394f0;};'use strict';var rimraf=require(_0x10dc('0x0'));var zipdir=require(_0x10dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x10dc('0x2'));var path=require(_0x10dc('0x3'));var ejs=require(_0x10dc('0x4'));var fs=require('fs');var _=require(_0x10dc('0x5'));var Redis=require(_0x10dc('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x10dc('0x7'));var logger=require(_0x10dc('0x8'))(_0x10dc('0x9'));var config=require('../../config/environment');var db=require(_0x10dc('0xa'))['db'];config['redis']=_[_0x10dc('0xb')](config[_0x10dc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x10dc('0xd'))(new Redis(config[_0x10dc('0xc')]));require(_0x10dc('0xe'))[_0x10dc('0xf')](socket);function respondWithStatusCode(_0x3976b3,_0x2515a2){_0x2515a2=_0x2515a2||0xcc;return function(_0x4b91c5){if(_0x4b91c5){return _0x3976b3['sendStatus'](_0x2515a2);}return _0x3976b3['status'](_0x2515a2)[_0x10dc('0x10')]();};}function respondWithResult(_0x4af55d,_0x4a9eb4){_0x4a9eb4=_0x4a9eb4||0xc8;return function(_0x13aca7){if(_0x13aca7){return _0x4af55d[_0x10dc('0x11')](_0x4a9eb4)['json'](_0x13aca7);}};}function respondWithFilteredResult(_0x28cf06,_0x1b27e4){return function(_0x10c379){if(_0x10c379){var _0x2dee79=typeof _0x1b27e4[_0x10dc('0x12')]===_0x10dc('0x13')&&typeof _0x1b27e4['limit']===_0x10dc('0x13');var _0x116ad1=_0x10c379[_0x10dc('0x14')];var _0x9ad0bf=_0x2dee79?0x0:_0x1b27e4[_0x10dc('0x12')];var _0x442280=_0x2dee79?_0x10c379[_0x10dc('0x14')]:_0x1b27e4[_0x10dc('0x12')]+_0x1b27e4[_0x10dc('0x15')];var _0x358b17;if(_0x442280>=_0x116ad1){_0x442280=_0x116ad1;_0x358b17=0xc8;}else{_0x358b17=0xce;}_0x28cf06['status'](_0x358b17);return _0x28cf06[_0x10dc('0x16')]('Content-Range',_0x9ad0bf+'-'+_0x442280+'/'+_0x116ad1)[_0x10dc('0x17')](_0x10c379);}return null;};}function saveUpdates(_0x4693f6){return function(_0x3cc434){if(_0x3cc434){return _0x3cc434[_0x10dc('0x18')](_0x4693f6)['then'](function(_0x739396){return _0x739396;});}return null;};}function removeEntity(_0x81252d){return function(_0x523dc9){if(_0x523dc9){return _0x523dc9[_0x10dc('0x19')]()[_0x10dc('0x1a')](function(){_0x81252d[_0x10dc('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8b56c8){return function(_0x120c73){if(!_0x120c73){_0x8b56c8[_0x10dc('0x1b')](0x194);}return _0x120c73;};}function handleError(_0x444316,_0x531f8e){_0x531f8e=_0x531f8e||0x1f4;return function(_0x3e3f69){logger[_0x10dc('0x1c')](_0x3e3f69[_0x10dc('0x1d')]);if(_0x3e3f69['name']){delete _0x3e3f69[_0x10dc('0x1e')];}_0x444316[_0x10dc('0x11')](_0x531f8e)[_0x10dc('0x1f')](_0x3e3f69);};}exports[_0x10dc('0x20')]=function(_0x14abb3,_0x183058){var _0x1d496b={};var _0x17c6ad=_[_0x10dc('0x21')](db[_0x10dc('0x22')][_0x10dc('0x23')],function(_0x2fd403){return{'name':_0x2fd403[_0x10dc('0x24')],'type':_0x2fd403['type']['key']};});_0x1d496b=qs[_0x10dc('0x25')](_0x17c6ad,_0x14abb3);return interaction['findAll']('sms',_0x14abb3[_0x10dc('0x26')],_0x14abb3[_0x10dc('0x27')],_0x1d496b,_0x17c6ad)[_0x10dc('0x1a')](respondWithFilteredResult(_0x183058,_0x1d496b))[_0x10dc('0x28')](handleError(_0x183058,null));};exports[_0x10dc('0x29')]=function(_0x7ea045,_0x517975){var _0x3ee97a={'raw':![],'where':{'id':_0x7ea045['params']['id']}},_0x56cd9d={};_0x56cd9d[_0x10dc('0x2a')]=_[_0x10dc('0x2b')](db[_0x10dc('0x22')][_0x10dc('0x23')]);_0x56cd9d[_0x10dc('0x26')]=_[_0x10dc('0x2b')](_0x7ea045[_0x10dc('0x26')]);_0x56cd9d[_0x10dc('0x2c')]=_[_0x10dc('0x2d')](_0x56cd9d[_0x10dc('0x2a')],_0x56cd9d['query']);_0x3ee97a[_0x10dc('0x2e')]=_[_0x10dc('0x2d')](_0x56cd9d[_0x10dc('0x2a')],qs[_0x10dc('0x2f')](_0x7ea045['query'][_0x10dc('0x2f')]));_0x3ee97a['attributes']=_0x3ee97a['attributes'][_0x10dc('0x30')]?_0x3ee97a[_0x10dc('0x2e')]:_0x56cd9d[_0x10dc('0x2a')];if(_0x7ea045[_0x10dc('0x26')][_0x10dc('0x31')]){_0x3ee97a[_0x10dc('0x32')]=[{'all':!![]}];}_0x3ee97a=_['merge']({},_0x3ee97a,_0x7ea045[_0x10dc('0x33')]);return db[_0x10dc('0x22')]['find'](_0x3ee97a)[_0x10dc('0x1a')](handleEntityNotFound(_0x517975,null))[_0x10dc('0x1a')](respondWithResult(_0x517975,null))['catch'](handleError(_0x517975,null));};exports[_0x10dc('0x34')]=function(_0x1cd418,_0xa93f09){return db[_0x10dc('0x22')][_0x10dc('0x34')](_0x1cd418['body'],{})[_0x10dc('0x1a')](respondWithResult(_0xa93f09,0xc9))['catch'](handleError(_0xa93f09,null));};exports[_0x10dc('0x18')]=function(_0x4651b0,_0x109f06){if(_0x4651b0[_0x10dc('0x35')]['id']){delete _0x4651b0['body']['id'];}return db[_0x10dc('0x22')][_0x10dc('0x36')]({'where':{'id':_0x4651b0['params']['id']}})['then'](handleEntityNotFound(_0x109f06,null))[_0x10dc('0x1a')](saveUpdates(_0x4651b0['body'],null))[_0x10dc('0x1a')](respondWithResult(_0x109f06,null))[_0x10dc('0x28')](handleError(_0x109f06,null));};exports[_0x10dc('0x19')]=function(_0xc02d33,_0x236e75){return db['SmsInteraction']['find']({'where':{'id':_0xc02d33[_0x10dc('0x37')]['id']}})[_0x10dc('0x1a')](handleEntityNotFound(_0x236e75,null))[_0x10dc('0x1a')](removeEntity(_0x236e75,null))[_0x10dc('0x28')](handleError(_0x236e75,null));};exports[_0x10dc('0x38')]=function(_0x4a4fe9,_0x5aed64){return db[_0x10dc('0x22')][_0x10dc('0x38')]()[_0x10dc('0x1a')](respondWithResult(_0x5aed64,null))[_0x10dc('0x28')](handleError(_0x5aed64,null));};exports['addMessage']=function(_0x47c158,_0x4f9733){return db[_0x10dc('0x39')]['find']({'where':{'id':_0x47c158[_0x10dc('0x37')]['id']}})['then'](handleEntityNotFound(_0x4f9733,null))[_0x10dc('0x1a')](function(_0x19c12d){if(_0x19c12d){return _0x19c12d[_0x10dc('0x3a')](_0x47c158[_0x10dc('0x35')][_0x10dc('0x3b')],_['omit'](_0x47c158[_0x10dc('0x35')],[_0x10dc('0x3b'),'id'])||{});}})[_0x10dc('0x1a')](respondWithResult(_0x4f9733,null))['catch'](handleError(_0x4f9733,null));};exports[_0x10dc('0x3c')]=function(_0x2ae35c,_0xe16009){var _0x12a0fe={'raw':![],'where':{}};var _0x4d1d06={};var _0x58cd3b={'count':0x0,'rows':[]};return db[_0x10dc('0x22')][_0x10dc('0x3d')]({'where':{'id':_0x2ae35c['params']['id']}})[_0x10dc('0x1a')](handleEntityNotFound(_0xe16009,null))[_0x10dc('0x1a')](function(_0x88183b){if(_0x88183b){_0x4d1d06[_0x10dc('0x2a')]=_[_0x10dc('0x2b')](db[_0x10dc('0x39')][_0x10dc('0x23')]);_0x4d1d06[_0x10dc('0x26')]=_['keys'](_0x2ae35c[_0x10dc('0x26')]);_0x4d1d06['filters']=_[_0x10dc('0x2d')](_0x4d1d06[_0x10dc('0x2a')],_0x4d1d06['query']);_0x12a0fe[_0x10dc('0x2e')]=_[_0x10dc('0x2d')](_0x4d1d06[_0x10dc('0x2a')],qs['fields'](_0x2ae35c['query'][_0x10dc('0x2f')]));_0x12a0fe[_0x10dc('0x2e')]=_0x12a0fe['attributes']['length']?_0x12a0fe[_0x10dc('0x2e')]:_0x4d1d06[_0x10dc('0x2a')];if(!_0x2ae35c[_0x10dc('0x26')][_0x10dc('0x3e')](_0x10dc('0x3f'))){_0x12a0fe[_0x10dc('0x15')]=qs[_0x10dc('0x15')](_0x2ae35c[_0x10dc('0x26')]['limit']);_0x12a0fe[_0x10dc('0x12')]=qs[_0x10dc('0x12')](_0x2ae35c['query']['offset']);}_0x12a0fe[_0x10dc('0x40')]=qs[_0x10dc('0x41')](_0x2ae35c['query'][_0x10dc('0x41')]);_0x12a0fe[_0x10dc('0x42')]=qs[_0x10dc('0x2c')](_[_0x10dc('0x43')](_0x2ae35c[_0x10dc('0x26')],_0x4d1d06[_0x10dc('0x2c')]));_0x12a0fe[_0x10dc('0x42')][_0x10dc('0x44')]=_0x88183b['id'];if(_0x2ae35c[_0x10dc('0x26')][_0x10dc('0x45')]){_0x12a0fe['where']=_['merge'](_0x12a0fe[_0x10dc('0x42')],{'$or':_['map'](_0x12a0fe[_0x10dc('0x2e')],function(_0x4099b3){var _0x2d17b7={};_0x2d17b7[_0x4099b3]={'$like':'%'+_0x2ae35c[_0x10dc('0x26')][_0x10dc('0x45')]+'%'};return _0x2d17b7;})});}if(_0x2ae35c[_0x10dc('0x26')]['$gte']){var _0x2107c7=_0x2ae35c['query'][_0x10dc('0x46')][_0x10dc('0x47')](',');var _0x31d56d={};_0x31d56d[_0x2107c7[0x0]]={'$gte':moment(_0x2107c7[0x1])[_0x10dc('0x48')](_0x10dc('0x49'))};_0x12a0fe['where']=_[_0x10dc('0x4a')](_0x12a0fe[_0x10dc('0x42')],_0x31d56d);}_0x12a0fe=_[_0x10dc('0x4a')]({},_0x12a0fe,_0x2ae35c[_0x10dc('0x33')]);return db['SmsMessage'][_0x10dc('0x14')]({'where':_0x12a0fe[_0x10dc('0x42')]})['then'](function(_0xb60a43){_0x58cd3b[_0x10dc('0x14')]=_0xb60a43;if(_0x2ae35c[_0x10dc('0x26')][_0x10dc('0x31')]){_0x12a0fe['include']=[{'all':!![]}];}return db['SmsMessage'][_0x10dc('0x4b')](_0x12a0fe);})[_0x10dc('0x1a')](function(_0x40e477){_0x58cd3b['rows']=_0x40e477;return _0x58cd3b;});}})[_0x10dc('0x1a')](respondWithFilteredResult(_0xe16009,_0x12a0fe))[_0x10dc('0x28')](handleError(_0xe16009,null));};exports[_0x10dc('0x4c')]=function(_0x86265d,_0x243804){return db[_0x10dc('0x22')][_0x10dc('0x36')]({'where':{'id':_0x86265d[_0x10dc('0x37')]['id']}})[_0x10dc('0x1a')](handleEntityNotFound(_0x243804,null))[_0x10dc('0x1a')](function(_0x331f3c){if(_0x331f3c){return _0x331f3c['setTags'](_0x86265d[_0x10dc('0x35')][_0x10dc('0x3b')],_[_0x10dc('0x4d')](_0x86265d['body'],['ids','id'])||{})[_0x10dc('0x4e')](function(){return db[_0x10dc('0x4f')]['findAll']({'attributes':['id','name',_0x10dc('0x50')],'where':{'id':_0x86265d[_0x10dc('0x35')][_0x10dc('0x3b')]}});})[_0x10dc('0x1a')](function(_0x36fb1f){socket['emit']('smsInteractionTags:save',{'id':Number(_0x86265d[_0x10dc('0x37')]['id']),'tags':_0x36fb1f||[]});return{'id':Number(_0x86265d[_0x10dc('0x37')]['id']),'tags':_0x36fb1f||[]};});}})[_0x10dc('0x1a')](respondWithResult(_0x243804,null))['catch'](handleError(_0x243804,null));};exports['removeTags']=function(_0x58643d,_0x936c1d){return db['SmsInteraction']['find']({'where':{'id':_0x58643d[_0x10dc('0x37')]['id']}})[_0x10dc('0x1a')](handleEntityNotFound(_0x936c1d,null))[_0x10dc('0x1a')](function(_0x2e84ba){if(_0x2e84ba){return _0x2e84ba[_0x10dc('0x51')](_0x58643d[_0x10dc('0x26')]['ids']);}})[_0x10dc('0x1a')](respondWithStatusCode(_0x936c1d,null))[_0x10dc('0x28')](handleError(_0x936c1d,null));};exports['download']=function(_0x1b685a,_0x32d0da){var _0x5353c5=moment()[_0x10dc('0x52')]()[_0x10dc('0x53')]();var _0x234a86=path[_0x10dc('0x54')](config[_0x10dc('0x55')],_0x10dc('0x56'),'files',_0x10dc('0x57'));var _0x22f0bf=path[_0x10dc('0x54')](_0x234a86,_0x5353c5);var _0x39d13f=util[_0x10dc('0x48')](_0x10dc('0x58'),_0x1b685a[_0x10dc('0x37')]['id'],_0x5353c5);var _0x211a4f=path[_0x10dc('0x54')](_0x234a86,_0x39d13f);var _0x3e6057=[];_0x3e6057[_0x10dc('0x59')]({'model':db[_0x10dc('0x5a')],'as':_0x10dc('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x3e6057['push']({'model':db[_0x10dc('0x5b')],'as':'Contact','attributes':['id',_0x10dc('0x5c'),_0x10dc('0x5d')],'raw':!![]});var _0x404e82=[{'model':db[_0x10dc('0x39')],'as':_0x10dc('0x5e'),'attributes':['id','body',_0x10dc('0x5f'),_0x10dc('0x60'),_0x10dc('0x61'),_0x10dc('0x62')],'include':_0x3e6057}];_0x404e82[_0x10dc('0x59')]({'model':db[_0x10dc('0x63')],'as':_0x10dc('0x64'),'attributes':['id',_0x10dc('0x1e')]});_0x404e82[_0x10dc('0x59')]({'model':db[_0x10dc('0x5a')],'as':'Owner','attributes':['id',_0x10dc('0x65')]});return db[_0x10dc('0x22')][_0x10dc('0x36')]({'where':{'id':_0x1b685a[_0x10dc('0x37')]['id']},'include':_0x404e82})[_0x10dc('0x1a')](handleEntityNotFound(_0x32d0da,null))[_0x10dc('0x1a')](function(_0x5f38c0){if(_0x5f38c0){var _0x2de60e=_0x5f38c0[_0x10dc('0x66')]({'plain':!![]});fs[_0x10dc('0x67')](_0x22f0bf);var _0x3cd0a0={'channel':_0x10dc('0x68'),'account':_0x2de60e[_0x10dc('0x64')][_0x10dc('0x1e')],'agent':_0x2de60e[_0x10dc('0x69')]?_0x2de60e['Owner']['fullname']:_0x10dc('0x6a'),'createdAt':moment(_0x2de60e[_0x10dc('0x5f')])[_0x10dc('0x48')](_0x10dc('0x49'))['toString'](),'closedAt':_0x2de60e[_0x10dc('0x6b')]?moment(_0x2de60e[_0x10dc('0x6c')])[_0x10dc('0x48')](_0x10dc('0x49'))[_0x10dc('0x53')]():'','disposition':_0x2de60e[_0x10dc('0x6d')],'messages':_(_0x2de60e[_0x10dc('0x5e')])[_0x10dc('0x45')]({'secret':![]})[_0x10dc('0x21')](function(_0x2e5f91){return{'date':moment(_0x2e5f91[_0x10dc('0x5f')])[_0x10dc('0x48')](_0x10dc('0x49'))['toString'](),'sender':_0x2e5f91[_0x10dc('0x60')]===_0x10dc('0x6e')?_0x2e5f91['User']?_0x2e5f91['User'][_0x10dc('0x65')]:'System':_0x2e5f91[_0x10dc('0x6f')]['firstName']+(_0x2e5f91['Contact'][_0x10dc('0x5d')]?'\x20'+_0x2e5f91['Contact'][_0x10dc('0x5d')]:''),'body':_0x2e5f91[_0x10dc('0x35')],'direction':_0x2e5f91[_0x10dc('0x60')]===_0x10dc('0x6e')?'A':'C','secret':_0x2e5f91[_0x10dc('0x61')],'read':_0x2e5f91[_0x10dc('0x62')]};})[_0x10dc('0x70')]()};return ejs[_0x10dc('0x71')](path[_0x10dc('0x54')](config[_0x10dc('0x55')],_0x10dc('0x56'),_0x10dc('0x72'),_0x10dc('0x73')),{'interaction':_0x3cd0a0})[_0x10dc('0x1a')](function(_0x2553e8){var _0x272874=path['join'](_0x22f0bf,_0x10dc('0x74')+_0x2de60e['id']+'-'+_0x5353c5+_0x10dc('0x75'));var _0x5b5e80={'path':_0x272874,'channel':_0x10dc('0x68'),'interactionId':_0x2de60e['id']};return pdf['createPdfFromHTML'](_0x2553e8,_0x5b5e80);})[_0x10dc('0x1a')](function(){return new BPromise(function(_0xee3a8e,_0x5e9d6c){zipdir(_0x22f0bf,{'saveTo':_0x211a4f},function(_0x593279,_0x2c4add){if(_0x593279)return _0x5e9d6c(_0x593279);return _0xee3a8e(_0x2c4add);});})['then'](function(){return new BPromise(function(_0x1e2b5a,_0x2117e0){rimraf(_0x22f0bf,function(_0x19e473){if(_0x19e473)_0x2117e0(_0x19e473);return _0x1e2b5a();});});})[_0x10dc('0x1a')](function(){return _0x32d0da[_0x10dc('0x76')](_0x211a4f,_0x39d13f,function(_0x1c0350){if(_0x1c0350){console[_0x10dc('0x77')]('err',_0x1c0350);}else{fs[_0x10dc('0x78')](_0x211a4f);}});});});}else{return _0x32d0da['sendStatus'](0xc8);}})['catch'](handleError(_0x32d0da,null));}; \ No newline at end of file +var _0x8129=['query','user','catch','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','create','body','find','params','addMessage','SmsMessage','ids','findOne','hasOwnProperty','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','omit','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','push','User','fullname','CmContact','firstName','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','N.A.','closed','map','out','System','Contact','read','renderFile','views','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','log','err','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','index','SmsInteraction','rawAttributes','fieldName','getOptions','findAll','sms'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8129,0x13b));var _0x9812=function(_0x16b1bb,_0x45d61a){_0x16b1bb=_0x16b1bb-0x0;var _0x1516b2=_0x8129[_0x16b1bb];return _0x1516b2;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x9812('0x0'));var moment=require(_0x9812('0x1'));var BPromise=require(_0x9812('0x2'));var util=require(_0x9812('0x3'));var path=require(_0x9812('0x4'));var ejs=require(_0x9812('0x5'));var fs=require('fs');var _=require(_0x9812('0x6'));var Redis=require('ioredis');var interaction=require(_0x9812('0x7'));var qs=require(_0x9812('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x9812('0x9'))(_0x9812('0xa'));var config=require(_0x9812('0xb'));var db=require(_0x9812('0xc'))['db'];config['redis']=_['defaults'](config[_0x9812('0xd')],{'host':_0x9812('0xe'),'port':0x18eb});var socket=require(_0x9812('0xf'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x14e009,_0x5a6385){_0x5a6385=_0x5a6385||0xcc;return function(_0x48d9e9){if(_0x48d9e9){return _0x14e009['sendStatus'](_0x5a6385);}return _0x14e009[_0x9812('0x10')](_0x5a6385)[_0x9812('0x11')]();};}function respondWithResult(_0x4effb7,_0x42458c){_0x42458c=_0x42458c||0xc8;return function(_0x3d6478){if(_0x3d6478){return _0x4effb7['status'](_0x42458c)[_0x9812('0x12')](_0x3d6478);}};}function respondWithFilteredResult(_0x51eb59,_0x3e7a92){return function(_0xacf543){if(_0xacf543){var _0x5908cf=typeof _0x3e7a92[_0x9812('0x13')]===_0x9812('0x14')&&typeof _0x3e7a92[_0x9812('0x15')]===_0x9812('0x14');var _0x1e67d0=_0xacf543[_0x9812('0x16')];var _0xad175a=_0x5908cf?0x0:_0x3e7a92[_0x9812('0x13')];var _0x17f032=_0x5908cf?_0xacf543['count']:_0x3e7a92['offset']+_0x3e7a92['limit'];var _0x486792;if(_0x17f032>=_0x1e67d0){_0x17f032=_0x1e67d0;_0x486792=0xc8;}else{_0x486792=0xce;}_0x51eb59[_0x9812('0x10')](_0x486792);return _0x51eb59[_0x9812('0x17')](_0x9812('0x18'),_0xad175a+'-'+_0x17f032+'/'+_0x1e67d0)[_0x9812('0x12')](_0xacf543);}return null;};}function saveUpdates(_0x25d3c0){return function(_0x34f37e){if(_0x34f37e){return _0x34f37e[_0x9812('0x19')](_0x25d3c0)[_0x9812('0x1a')](function(_0x19fb15){return _0x19fb15;});}return null;};}function removeEntity(_0x13444e){return function(_0x7f7ef9){if(_0x7f7ef9){return _0x7f7ef9[_0x9812('0x1b')]()[_0x9812('0x1a')](function(){_0x13444e[_0x9812('0x10')](0xcc)[_0x9812('0x11')]();});}};}function handleEntityNotFound(_0x11bfec){return function(_0x445b73){if(!_0x445b73){_0x11bfec[_0x9812('0x1c')](0x194);}return _0x445b73;};}function handleError(_0x2bb316,_0x4e22be){_0x4e22be=_0x4e22be||0x1f4;return function(_0x54dcc0){logger[_0x9812('0x1d')](_0x54dcc0['stack']);if(_0x54dcc0['name']){delete _0x54dcc0[_0x9812('0x1e')];}_0x2bb316[_0x9812('0x10')](_0x4e22be)[_0x9812('0x1f')](_0x54dcc0);};}exports[_0x9812('0x20')]=function(_0x26b89a,_0x37c367){var _0x4510d4={};var _0x3312a3=_['map'](db[_0x9812('0x21')][_0x9812('0x22')],function(_0x453878){return{'name':_0x453878[_0x9812('0x23')],'type':_0x453878['type']['key']};});_0x4510d4=qs[_0x9812('0x24')](_0x3312a3,_0x26b89a);return interaction[_0x9812('0x25')](_0x9812('0x26'),_0x26b89a[_0x9812('0x27')],_0x26b89a[_0x9812('0x28')],_0x4510d4,_0x3312a3)['then'](respondWithFilteredResult(_0x37c367,_0x4510d4))[_0x9812('0x29')](handleError(_0x37c367,null));};exports['show']=function(_0x117ee0,_0x3f87c3){var _0x4c112b={'raw':![],'where':{'id':_0x117ee0['params']['id']}},_0x2777f1={};_0x2777f1[_0x9812('0x2a')]=_[_0x9812('0x2b')](db[_0x9812('0x21')]['rawAttributes']);_0x2777f1[_0x9812('0x27')]=_['keys'](_0x117ee0[_0x9812('0x27')]);_0x2777f1[_0x9812('0x2c')]=_['intersection'](_0x2777f1[_0x9812('0x2a')],_0x2777f1['query']);_0x4c112b[_0x9812('0x2d')]=_[_0x9812('0x2e')](_0x2777f1[_0x9812('0x2a')],qs[_0x9812('0x2f')](_0x117ee0[_0x9812('0x27')]['fields']));_0x4c112b[_0x9812('0x2d')]=_0x4c112b[_0x9812('0x2d')][_0x9812('0x30')]?_0x4c112b[_0x9812('0x2d')]:_0x2777f1[_0x9812('0x2a')];if(_0x117ee0[_0x9812('0x27')][_0x9812('0x31')]){_0x4c112b['include']=[{'all':!![]}];}_0x4c112b=_[_0x9812('0x32')]({},_0x4c112b,_0x117ee0[_0x9812('0x33')]);return db['SmsInteraction']['find'](_0x4c112b)[_0x9812('0x1a')](handleEntityNotFound(_0x3f87c3,null))[_0x9812('0x1a')](respondWithResult(_0x3f87c3,null))[_0x9812('0x29')](handleError(_0x3f87c3,null));};exports[_0x9812('0x34')]=function(_0x2ff29e,_0x16607f){return db[_0x9812('0x21')]['create'](_0x2ff29e[_0x9812('0x35')],{})[_0x9812('0x1a')](respondWithResult(_0x16607f,0xc9))[_0x9812('0x29')](handleError(_0x16607f,null));};exports['update']=function(_0x29357a,_0x43df78){if(_0x29357a[_0x9812('0x35')]['id']){delete _0x29357a[_0x9812('0x35')]['id'];}return db['SmsInteraction'][_0x9812('0x36')]({'where':{'id':_0x29357a[_0x9812('0x37')]['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x43df78,null))[_0x9812('0x1a')](saveUpdates(_0x29357a['body'],null))['then'](respondWithResult(_0x43df78,null))['catch'](handleError(_0x43df78,null));};exports['destroy']=function(_0x4a8774,_0x37d4b1){return db[_0x9812('0x21')][_0x9812('0x36')]({'where':{'id':_0x4a8774[_0x9812('0x37')]['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x37d4b1,null))['then'](removeEntity(_0x37d4b1,null))[_0x9812('0x29')](handleError(_0x37d4b1,null));};exports['describe']=function(_0x57bd48,_0x432aee){return db[_0x9812('0x21')]['describe']()[_0x9812('0x1a')](respondWithResult(_0x432aee,null))[_0x9812('0x29')](handleError(_0x432aee,null));};exports[_0x9812('0x38')]=function(_0x441050,_0x25ef89){return db[_0x9812('0x39')]['find']({'where':{'id':_0x441050['params']['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x25ef89,null))[_0x9812('0x1a')](function(_0x4e8119){if(_0x4e8119){return _0x4e8119[_0x9812('0x38')](_0x441050[_0x9812('0x35')][_0x9812('0x3a')],_['omit'](_0x441050[_0x9812('0x35')],[_0x9812('0x3a'),'id'])||{});}})[_0x9812('0x1a')](respondWithResult(_0x25ef89,null))[_0x9812('0x29')](handleError(_0x25ef89,null));};exports['getMessages']=function(_0xf8b7fc,_0x5989b4){var _0x59ff25={'raw':![],'where':{}};var _0x19720b={};var _0x5f0419={'count':0x0,'rows':[]};return db[_0x9812('0x21')][_0x9812('0x3b')]({'where':{'id':_0xf8b7fc[_0x9812('0x37')]['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x5989b4,null))['then'](function(_0x2d5663){if(_0x2d5663){_0x19720b[_0x9812('0x2a')]=_[_0x9812('0x2b')](db['SmsMessage'][_0x9812('0x22')]);_0x19720b[_0x9812('0x27')]=_['keys'](_0xf8b7fc[_0x9812('0x27')]);_0x19720b[_0x9812('0x2c')]=_[_0x9812('0x2e')](_0x19720b[_0x9812('0x2a')],_0x19720b[_0x9812('0x27')]);_0x59ff25[_0x9812('0x2d')]=_['intersection'](_0x19720b['model'],qs['fields'](_0xf8b7fc[_0x9812('0x27')]['fields']));_0x59ff25[_0x9812('0x2d')]=_0x59ff25[_0x9812('0x2d')][_0x9812('0x30')]?_0x59ff25['attributes']:_0x19720b['model'];if(!_0xf8b7fc[_0x9812('0x27')][_0x9812('0x3c')]('nolimit')){_0x59ff25['limit']=qs['limit'](_0xf8b7fc[_0x9812('0x27')][_0x9812('0x15')]);_0x59ff25[_0x9812('0x13')]=qs[_0x9812('0x13')](_0xf8b7fc[_0x9812('0x27')][_0x9812('0x13')]);}_0x59ff25[_0x9812('0x3d')]=qs['sort'](_0xf8b7fc['query'][_0x9812('0x3e')]);_0x59ff25[_0x9812('0x3f')]=qs['filters'](_['pick'](_0xf8b7fc['query'],_0x19720b[_0x9812('0x2c')]));_0x59ff25['where'][_0x9812('0x40')]=_0x2d5663['id'];if(_0xf8b7fc[_0x9812('0x27')][_0x9812('0x41')]){_0x59ff25[_0x9812('0x3f')]=_['merge'](_0x59ff25[_0x9812('0x3f')],{'$or':_['map'](_0x59ff25[_0x9812('0x2d')],function(_0x5a1a20){var _0xcf6fc6={};_0xcf6fc6[_0x5a1a20]={'$like':'%'+_0xf8b7fc['query'][_0x9812('0x41')]+'%'};return _0xcf6fc6;})});}if(_0xf8b7fc[_0x9812('0x27')]['$gte']){var _0x4aefc2=_0xf8b7fc['query'][_0x9812('0x42')][_0x9812('0x43')](',');var _0x5d11e0={};_0x5d11e0[_0x4aefc2[0x0]]={'$gte':moment(_0x4aefc2[0x1])[_0x9812('0x44')](_0x9812('0x45'))};_0x59ff25[_0x9812('0x3f')]=_['merge'](_0x59ff25[_0x9812('0x3f')],_0x5d11e0);}_0x59ff25=_[_0x9812('0x32')]({},_0x59ff25,_0xf8b7fc[_0x9812('0x33')]);return db[_0x9812('0x39')]['count']({'where':_0x59ff25[_0x9812('0x3f')]})['then'](function(_0xcf7dc6){_0x5f0419[_0x9812('0x16')]=_0xcf7dc6;if(_0xf8b7fc[_0x9812('0x27')][_0x9812('0x31')]){_0x59ff25[_0x9812('0x46')]=[{'all':!![]}];}return db['SmsMessage'][_0x9812('0x25')](_0x59ff25);})[_0x9812('0x1a')](function(_0x6ef7d1){_0x5f0419[_0x9812('0x47')]=_0x6ef7d1;return _0x5f0419;});}})[_0x9812('0x1a')](respondWithFilteredResult(_0x5989b4,_0x59ff25))[_0x9812('0x29')](handleError(_0x5989b4,null));};exports[_0x9812('0x48')]=function(_0x249227,_0x5490af){return db[_0x9812('0x21')][_0x9812('0x36')]({'where':{'id':_0x249227[_0x9812('0x37')]['id']}})['then'](handleEntityNotFound(_0x5490af,null))[_0x9812('0x1a')](function(_0x10d597){if(_0x10d597){return _0x10d597['setTags'](_0x249227['body'][_0x9812('0x3a')],_[_0x9812('0x49')](_0x249227[_0x9812('0x35')],['ids','id'])||{})[_0x9812('0x4a')](function(){return db[_0x9812('0x4b')][_0x9812('0x25')]({'attributes':['id','name',_0x9812('0x4c')],'where':{'id':_0x249227[_0x9812('0x35')][_0x9812('0x3a')]}});})[_0x9812('0x1a')](function(_0x2f7168){socket[_0x9812('0x4d')](_0x9812('0x4e'),{'id':Number(_0x249227[_0x9812('0x37')]['id']),'tags':_0x2f7168||[]});return{'id':Number(_0x249227['params']['id']),'tags':_0x2f7168||[]};});}})[_0x9812('0x1a')](respondWithResult(_0x5490af,null))['catch'](handleError(_0x5490af,null));};exports['removeTags']=function(_0x327fae,_0x2b865b){return db['SmsInteraction']['find']({'where':{'id':_0x327fae['params']['id']}})['then'](handleEntityNotFound(_0x2b865b,null))[_0x9812('0x1a')](function(_0x12f378){if(_0x12f378){return _0x12f378[_0x9812('0x4f')](_0x327fae['query'][_0x9812('0x3a')]);}})[_0x9812('0x1a')](respondWithStatusCode(_0x2b865b,null))[_0x9812('0x29')](handleError(_0x2b865b,null));};exports[_0x9812('0x50')]=function(_0x3755fc,_0x17e798){var _0x31cd14=moment()[_0x9812('0x51')]()[_0x9812('0x52')]();var _0x1c708f=path[_0x9812('0x53')](config[_0x9812('0x54')],_0x9812('0x55'),_0x9812('0x56'),_0x9812('0x57'));var _0x2324bc=path[_0x9812('0x53')](_0x1c708f,_0x31cd14);var _0x3af487=util[_0x9812('0x44')]('transcript-%d-%s.zip',_0x3755fc[_0x9812('0x37')]['id'],_0x31cd14);var _0x595f68=path[_0x9812('0x53')](_0x1c708f,_0x3af487);var _0x351ab9=[];_0x351ab9[_0x9812('0x58')]({'model':db[_0x9812('0x59')],'as':_0x9812('0x59'),'attributes':['id',_0x9812('0x5a')],'raw':!![]});_0x351ab9['push']({'model':db[_0x9812('0x5b')],'as':'Contact','attributes':['id',_0x9812('0x5c'),_0x9812('0x5d')],'raw':!![]});var _0x403a72=[{'model':db['SmsMessage'],'as':_0x9812('0x5e'),'attributes':['id',_0x9812('0x35'),_0x9812('0x5f'),_0x9812('0x60'),_0x9812('0x61'),'read'],'include':_0x351ab9}];_0x403a72['push']({'model':db[_0x9812('0x62')],'as':_0x9812('0x63'),'attributes':['id','name']});_0x403a72[_0x9812('0x58')]({'model':db[_0x9812('0x59')],'as':_0x9812('0x64'),'attributes':['id',_0x9812('0x5a')]});return db[_0x9812('0x21')]['find']({'where':{'id':_0x3755fc[_0x9812('0x37')]['id']},'include':_0x403a72})[_0x9812('0x1a')](handleEntityNotFound(_0x17e798,null))['then'](function(_0x4c788e){if(_0x4c788e){var _0x1f1105=_0x4c788e[_0x9812('0x65')]({'plain':!![]});fs[_0x9812('0x66')](_0x2324bc);var _0x11b40f={'channel':'Sms','account':_0x1f1105[_0x9812('0x63')]['name'],'agent':_0x1f1105[_0x9812('0x64')]?_0x1f1105[_0x9812('0x64')][_0x9812('0x5a')]:_0x9812('0x67'),'createdAt':moment(_0x1f1105[_0x9812('0x5f')])[_0x9812('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1f1105[_0x9812('0x68')]?moment(_0x1f1105['closedAt'])[_0x9812('0x44')](_0x9812('0x45'))[_0x9812('0x52')]():'','disposition':_0x1f1105['disposition'],'messages':_(_0x1f1105[_0x9812('0x5e')])[_0x9812('0x41')]({'secret':![]})[_0x9812('0x69')](function(_0x2e10eb){return{'date':moment(_0x2e10eb[_0x9812('0x5f')])[_0x9812('0x44')](_0x9812('0x45'))[_0x9812('0x52')](),'sender':_0x2e10eb['direction']===_0x9812('0x6a')?_0x2e10eb[_0x9812('0x59')]?_0x2e10eb[_0x9812('0x59')][_0x9812('0x5a')]:_0x9812('0x6b'):_0x2e10eb['Contact'][_0x9812('0x5c')]+(_0x2e10eb[_0x9812('0x6c')][_0x9812('0x5d')]?'\x20'+_0x2e10eb[_0x9812('0x6c')][_0x9812('0x5d')]:''),'body':_0x2e10eb[_0x9812('0x35')],'direction':_0x2e10eb['direction']==='out'?'A':'C','secret':_0x2e10eb['secret'],'read':_0x2e10eb[_0x9812('0x6d')]};})['value']()};return ejs[_0x9812('0x6e')](path[_0x9812('0x53')](config[_0x9812('0x54')],_0x9812('0x55'),_0x9812('0x6f'),_0x9812('0x70')),{'interaction':_0x11b40f})[_0x9812('0x1a')](function(_0x9fe0f2){var _0x342223=path['join'](_0x2324bc,_0x9812('0x71')+_0x1f1105['id']+'-'+_0x31cd14+'.pdf');var _0x2bae8f={'path':_0x342223,'channel':_0x9812('0x72'),'interactionId':_0x1f1105['id']};return pdf[_0x9812('0x73')](_0x9fe0f2,_0x2bae8f);})[_0x9812('0x1a')](function(){return new BPromise(function(_0x8faa7d,_0x432de1){zipdir(_0x2324bc,{'saveTo':_0x595f68},function(_0x26bd5b,_0x2d9fbc){if(_0x26bd5b)return _0x432de1(_0x26bd5b);return _0x8faa7d(_0x2d9fbc);});})[_0x9812('0x1a')](function(){return new BPromise(function(_0xdbcd9e,_0xeb952f){rimraf(_0x2324bc,function(_0x17a82a){if(_0x17a82a)_0xeb952f(_0x17a82a);return _0xdbcd9e();});});})[_0x9812('0x1a')](function(){return _0x17e798['download'](_0x595f68,_0x3af487,function(_0x404926){if(_0x404926){console[_0x9812('0x74')](_0x9812('0x75'),_0x404926);}else{fs['unlinkSync'](_0x595f68);}});});});}else{return _0x17e798[_0x9812('0x1c')](0xc8);}})[_0x9812('0x29')](handleError(_0x17e798,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 13f5986..6526867 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x1a5528,_0x29743d){var _0x20a24c=function(_0x4b7506){while(--_0x4b7506){_0x1a5528['push'](_0x1a5528['shift']());}};_0x20a24c(++_0x29743d);}(_0x3266,0x6a));var _0x6326=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x3266[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x32f4=['remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x55c6a3,_0x28ec5a){var _0x16fb3e=function(_0x5ac2fc){while(--_0x5ac2fc){_0x55c6a3['push'](_0x55c6a3['shift']());}};_0x16fb3e(++_0x28ec5a);}(_0x32f4,0x154));var _0x432f=function(_0x171b51,_0x469487){_0x171b51=_0x171b51-0x0;var _0x383d9f=_0x32f4[_0x171b51];return _0x383d9f;};'use strict';var EventEmitter=require(_0x432f('0x0'));var SmsInteraction=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var SmsMessage=require(_0x432f('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x432f('0x3')](0x0);var events={'afterCreate':_0x432f('0x4'),'afterUpdate':'update','afterDestroy':_0x432f('0x5')};function emitEvent(_0x1eabac){return function(_0x344a29,_0x355b02,_0x2f5f03){_0x344a29['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f66fd){_0x344a29[_0x432f('0x6')]('Users',_0x2f66fd[_0x432f('0x7')](function(_0x5aaf1a){return{'id':_0x5aaf1a['id']};}));return SmsMessage[_0x432f('0x8')]({'where':{'SmsInteractionId':_0x344a29['id'],'direction':'in','read':![]},'raw':!![]});})[_0x432f('0x9')](function(_0x3a0d4b){_0x344a29[_0x432f('0x6')](_0x432f('0xa'),_0x3a0d4b['length']);SmsInteractionEvents[_0x432f('0xb')](_0x1eabac+':'+_0x344a29['id'],_0x344a29);SmsInteractionEvents['emit'](_0x1eabac,_0x344a29);_0x2f5f03(null);})[_0x432f('0xc')](_0x2f5f03(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x432f('0xd')](e,emitEvent(event));}}module[_0x432f('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b9e806a..c99a40b 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2159=['util','../../config/logger','bluebird','request-promise','rimraf','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x4c8e92,_0x446dd1){var _0x45a7bb=function(_0x5bfba0){while(--_0x5bfba0){_0x4c8e92['push'](_0x4c8e92['shift']());}};_0x45a7bb(++_0x446dd1);}(_0x2159,0x8e));var _0x9215=function(_0x2a46ba,_0x502e08){_0x2a46ba=_0x2a46ba-0x0;var _0x124440=_0x2159[_0x2a46ba];return _0x124440;};'use strict';var _=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var logger=require(_0x9215('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9215('0x3'));var rp=require(_0x9215('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9215('0x5'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x50f58d,_0x49a362){return _0x50f58d[_0x9215('0x6')](_0x9215('0x7'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x447710,_0x4b2764,_0x5122cc){if(_0x447710[_0x9215('0x8')](_0x9215('0x9'))){_0x447710[_0x9215('0xa')]=moment()[_0x9215('0xb')](_0x9215('0xc'));}_0x5122cc(null,_0x447710);}}});}; \ No newline at end of file +var _0x4283=['../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','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);}(_0x4283,0xc4));var _0x3428=function(_0x5d4436,_0xd554b2){_0x5d4436=_0x5d4436-0x0;var _0x24121f=_0x4283[_0x5d4436];return _0x24121f;};'use strict';var _=require(_0x3428('0x0'));var util=require(_0x3428('0x1'));var logger=require(_0x3428('0x2'))(_0x3428('0x3'));var moment=require(_0x3428('0x4'));var BPromise=require(_0x3428('0x5'));var rp=require(_0x3428('0x6'));var fs=require('fs');var path=require(_0x3428('0x7'));var rimraf=require('rimraf');var config=require(_0x3428('0x8'));var attributes=require(_0x3428('0x9'));module[_0x3428('0xa')]=function(_0x4d6496,_0x3304b2){return _0x4d6496[_0x3428('0xb')]('SmsInteraction',attributes,{'tableName':_0x3428('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd5fe59,_0x61fe45,_0x539445){if(_0xd5fe59[_0x3428('0xd')](_0x3428('0xe'))){_0xd5fe59[_0x3428('0xf')]=moment()['format'](_0x3428('0x10'));}_0x539445(null,_0xd5fe59);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 98fedec..5dbe5d4 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b7=['info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','then'];(function(_0x5a05fd,_0x530fca){var _0x4d7b3c=function(_0x5791b0){while(--_0x5791b0){_0x5a05fd['push'](_0x5a05fd['shift']());}};_0x4d7b3c(++_0x530fca);}(_0xa6b7,0x1a8));var _0x7a6b=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0xa6b7[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0x7a6b('0x0'));var util=require(_0x7a6b('0x1'));var moment=require(_0x7a6b('0x2'));var BPromise=require(_0x7a6b('0x3'));var rs=require(_0x7a6b('0x4'));var fs=require('fs');var Redis=require(_0x7a6b('0x5'));var db=require(_0x7a6b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a6b('0x7'))(_0x7a6b('0x8'));var config=require(_0x7a6b('0x9'));var jayson=require(_0x7a6b('0xa'));var client=jayson['client'][_0x7a6b('0xb')]({'port':0x232a});config[_0x7a6b('0xc')]=_['defaults'](config[_0x7a6b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a6b('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x7a6b('0xe')](socket);function respondWithRpcPromise(_0x19094c,_0x4403eb,_0x4e00dd){return new BPromise(function(_0x5a9350,_0x43c262){return client['request'](_0x19094c,_0x4e00dd)[_0x7a6b('0xf')](function(_0x1e0243){logger[_0x7a6b('0x10')](_0x7a6b('0x11'),_0x4403eb,_0x7a6b('0x12'));logger[_0x7a6b('0x13')](_0x7a6b('0x14'),_0x4403eb,_0x7a6b('0x12'),JSON[_0x7a6b('0x15')](_0x1e0243));if(_0x1e0243[_0x7a6b('0x16')]){if(_0x1e0243[_0x7a6b('0x16')]['code']===0x1f4){logger['error'](_0x7a6b('0x11'),_0x4403eb,_0x1e0243['error'][_0x7a6b('0x17')]);return _0x43c262(_0x1e0243['error']['message']);}logger[_0x7a6b('0x16')](_0x7a6b('0x11'),_0x4403eb,_0x1e0243[_0x7a6b('0x16')][_0x7a6b('0x17')]);return _0x5a9350(_0x1e0243[_0x7a6b('0x16')][_0x7a6b('0x17')]);}else{logger[_0x7a6b('0x10')](_0x7a6b('0x11'),_0x4403eb,'request\x20sent');_0x5a9350(_0x1e0243[_0x7a6b('0x18')][_0x7a6b('0x17')]);}})[_0x7a6b('0x19')](function(_0x5d874c){logger['error'](_0x7a6b('0x11'),_0x4403eb,_0x5d874c);_0x43c262(_0x5d874c);});});}exports[_0x7a6b('0x1a')]=function(_0x2bc475){var _0x3f7688=this;return new Promise(function(_0x5c0c98,_0x3a0376){return db[_0x7a6b('0x1b')][_0x7a6b('0x1c')](_0x2bc475[_0x7a6b('0x1d')],{'raw':_0x2bc475[_0x7a6b('0x1e')]?_0x2bc475[_0x7a6b('0x1e')][_0x7a6b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bc475[_0x7a6b('0x1e')]?_0x2bc475[_0x7a6b('0x1e')][_0x7a6b('0x20')]||null:null,'attributes':_0x2bc475['options']?_0x2bc475['options']['attributes']||null:null,'limit':_0x2bc475[_0x7a6b('0x1e')]?_0x2bc475[_0x7a6b('0x1e')][_0x7a6b('0x21')]||null:null})[_0x7a6b('0xf')](function(_0x4e3e51){logger['info'](_0x7a6b('0x1a'),_0x2bc475);logger['debug'](_0x7a6b('0x1a'),_0x2bc475,JSON[_0x7a6b('0x15')](_0x4e3e51));_0x5c0c98(_0x4e3e51);})[_0x7a6b('0x19')](function(_0x31321e){logger[_0x7a6b('0x16')](_0x7a6b('0x1a'),_0x31321e['message'],_0x2bc475);_0x3a0376(_0x3f7688[_0x7a6b('0x16')](0x1f4,_0x31321e['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x2397af){return new Promise(function(_0x4535c6,_0x441294){return db[_0x7a6b('0x1b')][_0x7a6b('0x22')]({'where':_0x2397af[_0x7a6b('0x1e')]?_0x2397af['options'][_0x7a6b('0x20')]||null:null})['then'](function(_0xc05b94){if(_0xc05b94){return _0xc05b94[_0x7a6b('0x23')](_0x2397af[_0x7a6b('0x1d')][_0x7a6b('0x24')],_[_0x7a6b('0x25')](_0x2397af[_0x7a6b('0x1d')],[_0x7a6b('0x24'),'id'])||{});}})[_0x7a6b('0x26')](function(_0x14988e){logger[_0x7a6b('0x10')]('AddTags',_0x2397af);logger[_0x7a6b('0x13')](_0x7a6b('0x27'),_0x2397af,JSON[_0x7a6b('0x15')](_0x14988e));_0x4535c6(_0x14988e);})[_0x7a6b('0x19')](function(_0x3ae91e){logger[_0x7a6b('0x16')](_0x7a6b('0x27'),_0x3ae91e[_0x7a6b('0x17')],_0x2397af);_0x441294(_this[_0x7a6b('0x16')](0x1f4,_0x3ae91e[_0x7a6b('0x17')]));});});}; \ No newline at end of file +var _0xf12a=['../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateSmsInteraction','update','body','options','raw','where','limit','debug','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','omit','AddTags','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x401080,_0x380c3f){var _0x1cf798=function(_0x130c91){while(--_0x130c91){_0x401080['push'](_0x401080['shift']());}};_0x1cf798(++_0x380c3f);}(_0xf12a,0x13c));var _0xaf12=function(_0x1ca66c,_0x3e3868){_0x1ca66c=_0x1ca66c-0x0;var _0x5a78ce=_0xf12a[_0x1ca66c];return _0x5a78ce;};'use strict';var _=require(_0xaf12('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf12('0x1'));var fs=require('fs');var Redis=require(_0xaf12('0x2'));var db=require(_0xaf12('0x3'))['db'];var utils=require(_0xaf12('0x4'));var logger=require('../../config/logger')(_0xaf12('0x5'));var config=require(_0xaf12('0x6'));var jayson=require(_0xaf12('0x7'));var client=jayson['client'][_0xaf12('0x8')]({'port':0x232a});config['redis']=_[_0xaf12('0x9')](config[_0xaf12('0xa')],{'host':_0xaf12('0xb'),'port':0x18eb});var socket=require(_0xaf12('0xc'))(new Redis(config[_0xaf12('0xa')]));require(_0xaf12('0xd'))[_0xaf12('0xe')](socket);function respondWithRpcPromise(_0x4aa8c0,_0x5f0aa6,_0x2afb65){return new BPromise(function(_0x1b859f,_0x43ab11){return client[_0xaf12('0xf')](_0x4aa8c0,_0x2afb65)[_0xaf12('0x10')](function(_0x11f606){logger['info'](_0xaf12('0x11'),_0x5f0aa6,'request\x20sent');logger['debug'](_0xaf12('0x12'),_0x5f0aa6,_0xaf12('0x13'),JSON[_0xaf12('0x14')](_0x11f606));if(_0x11f606[_0xaf12('0x15')]){if(_0x11f606[_0xaf12('0x15')]['code']===0x1f4){logger[_0xaf12('0x15')](_0xaf12('0x11'),_0x5f0aa6,_0x11f606[_0xaf12('0x15')][_0xaf12('0x16')]);return _0x43ab11(_0x11f606['error'][_0xaf12('0x16')]);}logger['error'](_0xaf12('0x11'),_0x5f0aa6,_0x11f606[_0xaf12('0x15')][_0xaf12('0x16')]);return _0x1b859f(_0x11f606[_0xaf12('0x15')][_0xaf12('0x16')]);}else{logger[_0xaf12('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x5f0aa6,_0xaf12('0x13'));_0x1b859f(_0x11f606[_0xaf12('0x18')]['message']);}})[_0xaf12('0x19')](function(_0x19f954){logger[_0xaf12('0x15')](_0xaf12('0x11'),_0x5f0aa6,_0x19f954);_0x43ab11(_0x19f954);});});}exports[_0xaf12('0x1a')]=function(_0x781dc0){var _0x392eac=this;return new Promise(function(_0x55cb4f,_0x552e3b){return db['SmsInteraction'][_0xaf12('0x1b')](_0x781dc0[_0xaf12('0x1c')],{'raw':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0[_0xaf12('0x1d')][_0xaf12('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0[_0xaf12('0x1d')][_0xaf12('0x1f')]||null:null,'attributes':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0[_0xaf12('0x1d')]['attributes']||null:null,'limit':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0['options'][_0xaf12('0x20')]||null:null})[_0xaf12('0x10')](function(_0x20c2e9){logger[_0xaf12('0x17')](_0xaf12('0x1a'),_0x781dc0);logger[_0xaf12('0x21')](_0xaf12('0x1a'),_0x781dc0,JSON[_0xaf12('0x14')](_0x20c2e9));_0x55cb4f(_0x20c2e9);})[_0xaf12('0x19')](function(_0x164c9c){logger[_0xaf12('0x15')](_0xaf12('0x1a'),_0x164c9c[_0xaf12('0x16')],_0x781dc0);_0x552e3b(_0x392eac[_0xaf12('0x15')](0x1f4,_0x164c9c['message']));});});};exports[_0xaf12('0x22')]=function(_0x3f03ed){return new Promise(function(_0x3c7496,_0x4fbc9d){return db[_0xaf12('0x23')]['find']({'where':_0x3f03ed['options']?_0x3f03ed['options'][_0xaf12('0x1f')]||null:null})[_0xaf12('0x10')](function(_0x13a80e){if(_0x13a80e){return _0x13a80e[_0xaf12('0x24')](_0x3f03ed[_0xaf12('0x1c')][_0xaf12('0x25')],_[_0xaf12('0x26')](_0x3f03ed['body'],['ids','id'])||{});}})['spread'](function(_0x1b2199){logger[_0xaf12('0x17')](_0xaf12('0x27'),_0x3f03ed);logger[_0xaf12('0x21')](_0xaf12('0x27'),_0x3f03ed,JSON[_0xaf12('0x14')](_0x1b2199));_0x3c7496(_0x1b2199);})[_0xaf12('0x19')](function(_0x388000){logger[_0xaf12('0x15')](_0xaf12('0x27'),_0x388000['message'],_0x3f03ed);_0x4fbc9d(_this[_0xaf12('0x15')](0x1f4,_0x388000[_0xaf12('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 141814b..1e0a54e 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x862a=['save','remove','update','emit','removeListener','smsInteraction:','./smsInteraction.events'];(function(_0x184394,_0x3bf79c){var _0x106c1a=function(_0x257ab8){while(--_0x257ab8){_0x184394['push'](_0x184394['shift']());}};_0x106c1a(++_0x3bf79c);}(_0x862a,0xb5));var _0xa862=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x862a[_0x1c34e7];return _0x378cb1;};'use strict';var SmsInteractionEvents=require(_0xa862('0x0'));var events=[_0xa862('0x1'),_0xa862('0x2'),_0xa862('0x3')];function createListener(_0x3c7b20,_0x2441e4){return function(_0x5c8ed7){_0x2441e4[_0xa862('0x4')](_0x3c7b20,_0x5c8ed7);};}function removeListener(_0x5539f1,_0x1c5853){return function(){SmsInteractionEvents[_0xa862('0x5')](_0x5539f1,_0x1c5853);};}exports['register']=function(_0x2b0f87){for(var _0x1386f4=0x0,_0x13ab6e=events['length'];_0x1386f4<_0x13ab6e;_0x1386f4++){var _0x4c97b0=events[_0x1386f4];var _0x25ed9f=createListener(_0xa862('0x6')+_0x4c97b0,_0x2b0f87);SmsInteractionEvents['on'](_0x4c97b0,_0x25ed9f);}}; \ No newline at end of file +var _0x319d=['emit','removeListener','length','smsInteraction:','save','update'];(function(_0x243426,_0x71a7c5){var _0x4e8604=function(_0x4e8fd4){while(--_0x4e8fd4){_0x243426['push'](_0x243426['shift']());}};_0x4e8604(++_0x71a7c5);}(_0x319d,0x190));var _0xd319=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x319d[_0x540dcb];return _0x49353c;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xd319('0x0'),'remove',_0xd319('0x1')];function createListener(_0x13993d,_0x24d413){return function(_0x52eae7){_0x24d413[_0xd319('0x2')](_0x13993d,_0x52eae7);};}function removeListener(_0xfb667f,_0x1a0ebd){return function(){SmsInteractionEvents[_0xd319('0x3')](_0xfb667f,_0x1a0ebd);};}exports['register']=function(_0x46eafb){for(var _0x27e09a=0x0,_0x4da934=events[_0xd319('0x4')];_0x27e09a<_0x4da934;_0x27e09a++){var _0x411d1c=events[_0x27e09a];var _0x516800=createListener(_0xd319('0x5')+_0x411d1c,_0x46eafb);SmsInteractionEvents['on'](_0x411d1c,_0x516800);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9cfc290..e02e38c 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc493=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','tracked','sms','create','post','put','/:id','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc493,0xba));var _0x3c49=function(_0x40727d,_0x5294a8){_0x40727d=_0x40727d-0x0;var _0x128089=_0xc493[_0x40727d];return _0x128089;};'use strict';var multer=require(_0x3c49('0x0'));var util=require(_0x3c49('0x1'));var path=require('path');var timeout=require(_0x3c49('0x2'));var express=require(_0x3c49('0x3'));var router=express[_0x3c49('0x4')]();var fs_extra=require(_0x3c49('0x5'));var auth=require(_0x3c49('0x6'));var interaction=require(_0x3c49('0x7'));var config=require(_0x3c49('0x8'));var controller=require(_0x3c49('0x9'));router[_0x3c49('0xa')]('/',auth[_0x3c49('0xb')](),controller[_0x3c49('0xc')]);router[_0x3c49('0xa')]('/describe',auth[_0x3c49('0xb')](),controller[_0x3c49('0xd')]);router[_0x3c49('0xa')]('/:id',auth[_0x3c49('0xb')](),controller['show']);router['post']('/',auth[_0x3c49('0xb')](),interaction[_0x3c49('0xe')](_0x3c49('0xf'),'smsmessage:create'),controller[_0x3c49('0x10')]);router[_0x3c49('0x11')]('/:id/status',controller['status']);router[_0x3c49('0x12')](_0x3c49('0x13'),auth[_0x3c49('0xb')](),controller[_0x3c49('0x14')]);router[_0x3c49('0x12')](_0x3c49('0x15'),auth[_0x3c49('0xb')](),controller[_0x3c49('0x16')]);router['put']('/:id/reject',auth[_0x3c49('0xb')](),controller[_0x3c49('0x17')]);router[_0x3c49('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x3c49('0x19')]);module[_0x3c49('0x1a')]=router; \ No newline at end of file +var _0xd63a=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms','smsmessage:create','post','status','put','update','/:id/accept','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x114fef,_0x1224a7){var _0x1629d2=function(_0x52da10){while(--_0x52da10){_0x114fef['push'](_0x114fef['shift']());}};_0x1629d2(++_0x1224a7);}(_0xd63a,0xed));var _0xad63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd63a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xad63('0x0'));var path=require(_0xad63('0x1'));var timeout=require(_0xad63('0x2'));var express=require(_0xad63('0x3'));var router=express[_0xad63('0x4')]();var fs_extra=require(_0xad63('0x5'));var auth=require(_0xad63('0x6'));var interaction=require(_0xad63('0x7'));var config=require('../../config/environment');var controller=require(_0xad63('0x8'));router[_0xad63('0x9')]('/',auth[_0xad63('0xa')](),controller[_0xad63('0xb')]);router[_0xad63('0x9')](_0xad63('0xc'),auth['isAuthenticated'](),controller[_0xad63('0xd')]);router[_0xad63('0x9')](_0xad63('0xe'),auth[_0xad63('0xa')](),controller[_0xad63('0xf')]);router['post']('/',auth[_0xad63('0xa')](),interaction[_0xad63('0x10')](_0xad63('0x11'),_0xad63('0x12')),controller['create']);router[_0xad63('0x13')]('/:id/status',controller[_0xad63('0x14')]);router[_0xad63('0x15')](_0xad63('0xe'),auth[_0xad63('0xa')](),controller[_0xad63('0x16')]);router[_0xad63('0x15')](_0xad63('0x17'),auth['isAuthenticated'](),controller['accept']);router[_0xad63('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xad63('0x18')]);router[_0xad63('0x19')]('/:id',auth[_0xad63('0xa')](),controller['destroy']);module[_0xad63('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a1e710a..d4a8213 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x585a=['ENUM','out','STRING','DATE','sequelize','TEXT','BOOLEAN'];(function(_0x2c4a5d,_0x433514){var _0x22f7e9=function(_0x603e97){while(--_0x603e97){_0x2c4a5d['push'](_0x2c4a5d['shift']());}};_0x22f7e9(++_0x433514);}(_0x585a,0xf2));var _0xa585=function(_0x386812,_0x27c823){_0x386812=_0x386812-0x0;var _0x4704d2=_0x585a[_0x386812];return _0x4704d2;};'use strict';var Sequelize=require(_0xa585('0x0'));module['exports']={'body':{'type':Sequelize[_0xa585('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa585('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa585('0x3')]('in',_0xa585('0x4')),'defaultValue':_0xa585('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa585('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa585('0x5')]},'readAt':{'type':Sequelize[_0xa585('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa585('0x5')]},'providerResponse':{'type':Sequelize[_0xa585('0x1')]}}; \ No newline at end of file +var _0x15a5=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x2fcbf5,_0x1ee4fd){var _0xc7a5bd=function(_0x3ff704){while(--_0x3ff704){_0x2fcbf5['push'](_0x2fcbf5['shift']());}};_0xc7a5bd(++_0x1ee4fd);}(_0x15a5,0x1e5));var _0x515a=function(_0x36697b,_0x51b9fe){_0x36697b=_0x36697b-0x0;var _0x4e80f3=_0x15a5[_0x36697b];return _0x4e80f3;};'use strict';var Sequelize=require(_0x515a('0x0'));module['exports']={'body':{'type':Sequelize[_0x515a('0x1')](_0x515a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x515a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x515a('0x4')]('in',_0x515a('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x515a('0x6')](0xbe)},'phone':{'type':Sequelize[_0x515a('0x6')]},'readAt':{'type':Sequelize[_0x515a('0x7')]},'secret':{'type':Sequelize[_0x515a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x515a('0x6')]},'providerResponse':{'type':Sequelize[_0x515a('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index cb3c4b2..0dbb951 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc177=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','sendStatus','stack','name','send','SmsMessage','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','destroy','describe','sms-interactions','accept','sms','read','UserId','user','agent','get','SmsInteraction','SmsInteractionId','update','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','SELECT','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0x3975c0,_0x3e8f4c){var _0xe75022=function(_0x3df9f7){while(--_0x3df9f7){_0x3975c0['push'](_0x3975c0['shift']());}};_0xe75022(++_0x3e8f4c);}(_0xc177,0x1b2));var _0x7c17=function(_0x476858,_0x159c4d){_0x476858=_0x476858-0x0;var _0x1109fe=_0xc177[_0x476858];return _0x1109fe;};'use strict';var emlformat=require(_0x7c17('0x0'));var rimraf=require(_0x7c17('0x1'));var zipdir=require(_0x7c17('0x2'));var jsonpatch=require(_0x7c17('0x3'));var rp=require(_0x7c17('0x4'));var moment=require('moment');var BPromise=require(_0x7c17('0x5'));var Mustache=require(_0x7c17('0x6'));var util=require(_0x7c17('0x7'));var path=require(_0x7c17('0x8'));var sox=require('sox');var csv=require(_0x7c17('0x9'));var ejs=require(_0x7c17('0xa'));var fs=require('fs');var fs_extra=require(_0x7c17('0xb'));var _=require('lodash');var squel=require(_0x7c17('0xc'));var crypto=require(_0x7c17('0xd'));var jsforce=require(_0x7c17('0xe'));var deskjs=require(_0x7c17('0xf'));var toCsv=require(_0x7c17('0x9'));var querystring=require(_0x7c17('0x10'));var Papa=require(_0x7c17('0x11'));var Redis=require(_0x7c17('0x12'));var authService=require(_0x7c17('0x13'));var qs=require(_0x7c17('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c17('0x15'));var utils=require(_0x7c17('0x16'));var config=require(_0x7c17('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c17('0x18'))['db'];config[_0x7c17('0x19')]=_[_0x7c17('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7c17('0x1b'))(new Redis(config[_0x7c17('0x19')]));require('./smsMessage.socket')[_0x7c17('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7c17('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x7c17('0x1d')][_0x7c17('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x675894,_0x33f9cc,_0x2f9348,_0x296211){return new BPromise(function(_0x87715a,_0x186812){var _0x37af8c=_0x296211||client;return _0x37af8c[_0x7c17('0x1f')](_0x675894,_0x2f9348)[_0x7c17('0x20')](function(_0x47307a){logger[_0x7c17('0x21')](_0x7c17('0x22'),_0x33f9cc,'request\x20sent');logger[_0x7c17('0x23')](_0x7c17('0x24'),_0x33f9cc,'request\x20sent',JSON[_0x7c17('0x25')](_0x47307a));if(_0x47307a['error']){if(_0x47307a['error'][_0x7c17('0x26')]===0x1f4){logger[_0x7c17('0x27')](_0x7c17('0x22'),_0x33f9cc,_0x47307a['error'][_0x7c17('0x28')]);return _0x186812(_0x47307a[_0x7c17('0x27')]['message']);}logger[_0x7c17('0x27')](_0x7c17('0x22'),_0x33f9cc,_0x47307a[_0x7c17('0x27')]['message']);return _0x87715a(_0x47307a[_0x7c17('0x27')][_0x7c17('0x28')]);}else{logger[_0x7c17('0x21')]('SmsMessage,\x20%s,\x20%s',_0x33f9cc,_0x7c17('0x29'));_0x87715a(_0x47307a[_0x7c17('0x2a')]['message']);}})['catch'](function(_0x42260f){logger[_0x7c17('0x27')](_0x7c17('0x22'),_0x33f9cc,_0x42260f);_0x186812(_0x42260f);});});}function respondWithStatusCode(_0x36b5ed,_0x2b99b3){_0x2b99b3=_0x2b99b3||0xcc;return function(_0x33f63c){if(_0x33f63c){return _0x36b5ed['sendStatus'](_0x2b99b3);}return _0x36b5ed[_0x7c17('0x2b')](_0x2b99b3)[_0x7c17('0x2c')]();};}function respondWithResult(_0x44513e,_0xf2c46c){_0xf2c46c=_0xf2c46c||0xc8;return function(_0x34bd11){if(_0x34bd11){return _0x44513e[_0x7c17('0x2b')](_0xf2c46c)[_0x7c17('0x2d')](_0x34bd11);}};}function respondWithFilteredResult(_0x467bde,_0x3a4a58){return function(_0x3a2e61){if(_0x3a2e61){var _0x4776cc=typeof _0x3a4a58[_0x7c17('0x2e')]===_0x7c17('0x2f')&&typeof _0x3a4a58[_0x7c17('0x30')]===_0x7c17('0x2f');var _0x1caab8=_0x3a2e61['count'];var _0x1378e7=_0x4776cc?0x0:_0x3a4a58[_0x7c17('0x2e')];var _0x4dd018=_0x4776cc?_0x3a2e61[_0x7c17('0x31')]:_0x3a4a58[_0x7c17('0x2e')]+_0x3a4a58[_0x7c17('0x30')];var _0x5760be;if(_0x4dd018>=_0x1caab8){_0x4dd018=_0x1caab8;_0x5760be=0xc8;}else{_0x5760be=0xce;}_0x467bde[_0x7c17('0x2b')](_0x5760be);return _0x467bde['set'](_0x7c17('0x32'),_0x1378e7+'-'+_0x4dd018+'/'+_0x1caab8)[_0x7c17('0x2d')](_0x3a2e61);}return null;};}function patchUpdates(_0x1a1d70){return function(_0x2d982e){try{jsonpatch['apply'](_0x2d982e,_0x1a1d70,!![]);}catch(_0x9d0d1f){return BPromise[_0x7c17('0x33')](_0x9d0d1f);}return _0x2d982e[_0x7c17('0x34')]();};}function saveUpdates(_0xd8eb47,_0x456379){return function(_0x2543d5){if(_0x2543d5){return _0x2543d5['update'](_0xd8eb47)[_0x7c17('0x20')](function(_0xeb50bf){return _0xeb50bf;});}return null;};}function removeEntity(_0x521461,_0x36c445){return function(_0x23beca){if(_0x23beca){return _0x23beca['destroy']()[_0x7c17('0x20')](function(){_0x521461['status'](0xcc)[_0x7c17('0x2c')]();});}};}function handleEntityNotFound(_0x35d249,_0x600877){return function(_0x496c97){if(!_0x496c97){_0x35d249[_0x7c17('0x35')](0x194);}return _0x496c97;};}function handleError(_0x397137,_0x9675fd){_0x9675fd=_0x9675fd||0x1f4;return function(_0x51a040){logger['error'](_0x51a040[_0x7c17('0x36')]);if(_0x51a040['name']){delete _0x51a040[_0x7c17('0x37')];}_0x397137[_0x7c17('0x2b')](_0x9675fd)[_0x7c17('0x38')](_0x51a040);};}exports['index']=function(_0x369c70,_0x124074){var _0xf6cc70={},_0x9cdc10={},_0x40671a={'count':0x0,'rows':[]};var _0x19710c=_['map'](db[_0x7c17('0x39')][_0x7c17('0x3a')],function(_0x328860){return{'name':_0x328860[_0x7c17('0x3b')],'type':_0x328860['type'][_0x7c17('0x3c')]};});_0x9cdc10[_0x7c17('0x3d')]=_['map'](_0x19710c,_0x7c17('0x37'));_0x9cdc10['query']=_['keys'](_0x369c70['query']);_0x9cdc10[_0x7c17('0x3e')]=_[_0x7c17('0x3f')](_0x9cdc10['model'],_0x9cdc10[_0x7c17('0x40')]);_0xf6cc70[_0x7c17('0x41')]=_[_0x7c17('0x3f')](_0x9cdc10[_0x7c17('0x3d')],qs[_0x7c17('0x42')](_0x369c70[_0x7c17('0x40')][_0x7c17('0x42')]));_0xf6cc70['attributes']=_0xf6cc70[_0x7c17('0x41')]['length']?_0xf6cc70[_0x7c17('0x41')]:_0x9cdc10['model'];if(!_0x369c70['query'][_0x7c17('0x43')]('nolimit')){_0xf6cc70[_0x7c17('0x30')]=qs[_0x7c17('0x30')](_0x369c70[_0x7c17('0x40')][_0x7c17('0x30')]);_0xf6cc70[_0x7c17('0x2e')]=qs[_0x7c17('0x2e')](_0x369c70[_0x7c17('0x40')][_0x7c17('0x2e')]);}_0xf6cc70[_0x7c17('0x44')]=qs[_0x7c17('0x45')](_0x369c70[_0x7c17('0x40')][_0x7c17('0x45')]);_0xf6cc70[_0x7c17('0x46')]=qs[_0x7c17('0x3e')](_[_0x7c17('0x47')](_0x369c70['query'],_0x9cdc10[_0x7c17('0x3e')]),_0x19710c);if(_0x369c70['query'][_0x7c17('0x48')]){_0xf6cc70[_0x7c17('0x46')]=_['merge'](_0xf6cc70['where'],{'$or':_['map'](_0x19710c,function(_0x453629){if(_0x453629['type']!=='VIRTUAL'){var _0x32ee4b={};_0x32ee4b[_0x453629[_0x7c17('0x37')]]={'$like':'%'+_0x369c70['query']['filter']+'%'};return _0x32ee4b;}})});}_0xf6cc70=_[_0x7c17('0x49')]({},_0xf6cc70,_0x369c70['options']);var _0x27ae7e={'where':_0xf6cc70[_0x7c17('0x46')]};return db[_0x7c17('0x39')]['count'](_0x27ae7e)[_0x7c17('0x20')](function(_0x2f2b25){_0x40671a[_0x7c17('0x31')]=_0x2f2b25;if(_0x369c70['query'][_0x7c17('0x4a')]){_0xf6cc70[_0x7c17('0x4b')]=[{'all':!![]}];}return db[_0x7c17('0x39')][_0x7c17('0x4c')](_0xf6cc70);})[_0x7c17('0x20')](function(_0x5512e1){_0x40671a[_0x7c17('0x4d')]=_0x5512e1;return _0x40671a;})[_0x7c17('0x20')](respondWithFilteredResult(_0x124074,_0xf6cc70))[_0x7c17('0x4e')](handleError(_0x124074,null));};exports[_0x7c17('0x4f')]=function(_0x644049,_0x3b136f){var _0x471328={'raw':!![],'where':{'id':_0x644049[_0x7c17('0x50')]['id']}},_0x147d4e={};_0x147d4e['model']=_['keys'](db[_0x7c17('0x39')]['rawAttributes']);_0x147d4e[_0x7c17('0x40')]=_['keys'](_0x644049[_0x7c17('0x40')]);_0x147d4e[_0x7c17('0x3e')]=_['intersection'](_0x147d4e['model'],_0x147d4e[_0x7c17('0x40')]);_0x471328[_0x7c17('0x41')]=_[_0x7c17('0x3f')](_0x147d4e['model'],qs[_0x7c17('0x42')](_0x644049[_0x7c17('0x40')][_0x7c17('0x42')]));_0x471328[_0x7c17('0x41')]=_0x471328[_0x7c17('0x41')][_0x7c17('0x51')]?_0x471328['attributes']:_0x147d4e[_0x7c17('0x3d')];if(_0x644049[_0x7c17('0x40')][_0x7c17('0x4a')]){_0x471328[_0x7c17('0x4b')]=[{'all':!![]}];}_0x471328=_[_0x7c17('0x49')]({},_0x471328,_0x644049[_0x7c17('0x52')]);return db[_0x7c17('0x39')]['find'](_0x471328)[_0x7c17('0x20')](handleEntityNotFound(_0x3b136f,null))['then'](respondWithResult(_0x3b136f,null))['catch'](handleError(_0x3b136f,null));};exports[_0x7c17('0x53')]=function(_0x337a28,_0x1b0679){return db[_0x7c17('0x39')][_0x7c17('0x53')](_0x337a28[_0x7c17('0x54')],{})[_0x7c17('0x20')](respondWithResult(_0x1b0679,0xc9))[_0x7c17('0x4e')](handleError(_0x1b0679,null));};exports['update']=function(_0x8d3c79,_0x1090fc){if(_0x8d3c79[_0x7c17('0x54')]['id']){delete _0x8d3c79['body']['id'];}return db[_0x7c17('0x39')][_0x7c17('0x55')]({'where':{'id':_0x8d3c79['params']['id']}})[_0x7c17('0x20')](handleEntityNotFound(_0x1090fc,null))[_0x7c17('0x20')](saveUpdates(_0x8d3c79[_0x7c17('0x54')],null))['then'](respondWithResult(_0x1090fc,null))[_0x7c17('0x4e')](handleError(_0x1090fc,null));};exports[_0x7c17('0x56')]=function(_0x1cedb7,_0xacae9e){return db['SmsMessage'][_0x7c17('0x55')]({'where':{'id':_0x1cedb7[_0x7c17('0x50')]['id']}})[_0x7c17('0x20')](handleEntityNotFound(_0xacae9e,null))[_0x7c17('0x20')](removeEntity(_0xacae9e,null))[_0x7c17('0x4e')](handleError(_0xacae9e,null));};exports[_0x7c17('0x57')]=function(_0x1b3858,_0x2c6bd8){return db[_0x7c17('0x39')][_0x7c17('0x57')]()[_0x7c17('0x20')](respondWithResult(_0x2c6bd8,null))['catch'](handleError(_0x2c6bd8,null));};var interaction_log=require('../../config/logger')(_0x7c17('0x58'));exports[_0x7c17('0x59')]=function(_0x511ffe,_0x373652,_0x26a6d9){var _0x39bfeb={'agent':{},'channel':_0x7c17('0x5a')};if(_0x511ffe['body']['id']){delete _0x511ffe[_0x7c17('0x54')]['id'];}_0x511ffe[_0x7c17('0x54')][_0x7c17('0x5b')]=!![];_0x511ffe[_0x7c17('0x54')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x511ffe['body'][_0x7c17('0x5c')]=_0x511ffe[_0x7c17('0x54')]['UserId']||_0x511ffe[_0x7c17('0x5d')]['id'];_0x39bfeb[_0x7c17('0x5e')]['id']=_0x511ffe['body'][_0x7c17('0x5c')];return db['SmsMessage'][_0x7c17('0x55')]({'where':{'id':_0x511ffe[_0x7c17('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x373652,null))['then'](saveUpdates(_0x511ffe[_0x7c17('0x54')],null))[_0x7c17('0x20')](function(_0x7278ef){if(_0x7278ef){_0x39bfeb[_0x7c17('0x28')]=_0x7278ef[_0x7c17('0x5f')]({'plain':!![]});return db[_0x7c17('0x60')][_0x7c17('0x55')]({'where':{'id':_0x7278ef[_0x7c17('0x61')]}});}return null;})[_0x7c17('0x20')](handleEntityNotFound(_0x373652,null))[_0x7c17('0x20')](function(_0x32af61){if(_0x32af61){return _0x32af61[_0x7c17('0x62')]({'UserId':_0x511ffe[_0x7c17('0x54')][_0x7c17('0x5c')],'read1stAt':_['isNil'](_0x32af61[_0x7c17('0x63')])?moment()['format'](_0x7c17('0x64')):undefined});}return null;})[_0x7c17('0x20')](function(_0x2b6eab){if(_0x2b6eab){_0x39bfeb['interaction']=_0x2b6eab['get']({'plain':!![]});interaction_log[_0x7c17('0x21')](_0x7c17('0x65'),_0x511ffe[_0x7c17('0x5d')]['id'],_0x511ffe[_0x7c17('0x5d')]['name'],_0x511ffe['user'][_0x7c17('0x66')],_0x39bfeb['interaction']['id'],_0x511ffe[_0x7c17('0x54')]?JSON[_0x7c17('0x25')](_0x511ffe['body']):_0x7c17('0x67'));return respondWithRpcPromise(_0x7c17('0x68'),_0x7c17('0x69'),_0x39bfeb);}return null;})[_0x7c17('0x20')](function(_0x1277ca){var _0x5ebd0d=_0x7c17('0x6a')+_0x1277ca[_0x7c17('0x28')][_0x7c17('0x6b')];return db['sequelize'][_0x7c17('0x40')](_0x5ebd0d,{'type':db[_0x7c17('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7c17('0x20')](function(_0x49b926){return _0x49b926;});})[_0x7c17('0x20')](function(_0x1f84fe){if(_0x1f84fe){_0x39bfeb['message'][_0x7c17('0x6d')]=_0x1f84fe[0x0];if(!_0x511ffe[_0x7c17('0x54')]['UserId'])return;return db[_0x7c17('0x6e')][_0x7c17('0x55')]({'where':{'id':_0x511ffe[_0x7c17('0x54')]['UserId'],'role':_0x7c17('0x5e')},'attributes':['id',_0x7c17('0x37'),_0x7c17('0x6f'),_0x7c17('0x70'),_0x7c17('0x71')],'raw':!![]});}return null;})['then'](function(_0x324e4a){if(!_0x324e4a)return null;_0x39bfeb[_0x7c17('0x28')][_0x7c17('0x5e')]=_0x324e4a;return _0x39bfeb;})[_0x7c17('0x20')](function(_0x345c98){if(_0x345c98){if(_0x511ffe[_0x7c17('0x54')][_0x7c17('0x72')]){_0x39bfeb[_0x7c17('0x28')][_0x7c17('0x73')]=util[_0x7c17('0x74')](_0x7c17('0x75'),_0x511ffe['user'][_0x7c17('0x37')]);_0x39bfeb[_0x7c17('0x28')][_0x7c17('0x76')]=_0x39bfeb['channel'];_0x39bfeb[_0x7c17('0x28')][_0x7c17('0x77')]=_0x39bfeb['channel'];_0x39bfeb[_0x7c17('0x28')][_0x7c17('0x78')]='accept';return respondWithRpcPromise('EventManager',_0x7c17('0x79'),{'event':_0x7c17('0x7a'),'message':_0x39bfeb['message']},client9002)['then'](function(){return _0x39bfeb;});}return _0x39bfeb;}return null;})[_0x7c17('0x20')](respondWithResult(_0x373652,null))['catch'](handleError(_0x373652,null));};var interaction_log=require(_0x7c17('0x7b'))(_0x7c17('0x58'));exports['reject']=function(_0x47dd9b,_0x4027ff,_0x7b24bf){var _0x3208b4={'agent':{},'channel':_0x7c17('0x5a')};if(_0x47dd9b[_0x7c17('0x54')]['id']){delete _0x47dd9b[_0x7c17('0x54')]['id'];}_0x47dd9b[_0x7c17('0x54')][_0x7c17('0x5c')]=_0x47dd9b['body'][_0x7c17('0x5c')]||_0x47dd9b['user']['id'];_0x3208b4[_0x7c17('0x5e')]['id']=_0x47dd9b['body'][_0x7c17('0x5c')];return db[_0x7c17('0x39')][_0x7c17('0x55')]({'where':{'id':_0x47dd9b['params']['id'],'UserId':null}})[_0x7c17('0x20')](handleEntityNotFound(_0x4027ff,null))[_0x7c17('0x20')](function(_0x32dfca){if(_0x32dfca){_0x3208b4[_0x7c17('0x28')]=_0x32dfca[_0x7c17('0x5f')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x32dfca[_0x7c17('0x61')]}});}return null;})[_0x7c17('0x20')](handleEntityNotFound(_0x4027ff,null))[_0x7c17('0x20')](function(_0x3122c6){if(_0x3122c6){_0x3208b4[_0x7c17('0x7c')]=_0x3122c6[_0x7c17('0x5f')]({'plain':!![]});interaction_log[_0x7c17('0x21')](_0x7c17('0x7d'),_0x47dd9b[_0x7c17('0x5d')]['id'],_0x47dd9b[_0x7c17('0x5d')][_0x7c17('0x37')],_0x47dd9b[_0x7c17('0x5d')][_0x7c17('0x66')],_0x3208b4[_0x7c17('0x7c')]['id'],_0x47dd9b[_0x7c17('0x54')]?JSON[_0x7c17('0x25')](_0x47dd9b[_0x7c17('0x54')]):_0x7c17('0x67'));return respondWithRpcPromise('RejectMessage',_0x7c17('0x7e'),_0x3208b4);}return null;})[_0x7c17('0x20')](function(_0x22338b){var _0x2c0a4f=_0x7c17('0x6a')+_0x22338b[_0x7c17('0x28')]['ContactId'];return db[_0x7c17('0x7f')][_0x7c17('0x40')](_0x2c0a4f,{'type':db[_0x7c17('0x6c')]['QueryTypes'][_0x7c17('0x80')],'raw':!![]})[_0x7c17('0x20')](function(_0x25f748){return _0x25f748;});})[_0x7c17('0x20')](function(_0x38676d){if(_0x38676d){_0x3208b4[_0x7c17('0x28')]['contact']=_0x38676d[0x0];if(!_0x47dd9b[_0x7c17('0x54')][_0x7c17('0x5c')])return;return db['User'][_0x7c17('0x55')]({'where':{'id':_0x47dd9b[_0x7c17('0x54')]['UserId'],'role':_0x7c17('0x5e')},'attributes':['id','name',_0x7c17('0x6f'),_0x7c17('0x70'),_0x7c17('0x71')],'raw':!![]});}return null;})['then'](function(_0x5e92d9){if(!_0x5e92d9)return null;_0x3208b4[_0x7c17('0x28')][_0x7c17('0x5e')]=_0x5e92d9;return _0x3208b4;})['then'](function(_0x13f5db){if(_0x13f5db){_0x13f5db[_0x7c17('0x28')][_0x7c17('0x73')]=util[_0x7c17('0x74')](_0x7c17('0x75'),_0x47dd9b['user'][_0x7c17('0x37')]);_0x13f5db[_0x7c17('0x28')][_0x7c17('0x76')]=_0x3208b4[_0x7c17('0x76')];_0x13f5db[_0x7c17('0x28')][_0x7c17('0x77')]=_0x3208b4[_0x7c17('0x76')];_0x13f5db[_0x7c17('0x28')][_0x7c17('0x78')]=_0x7c17('0x33');respondWithRpcPromise(_0x7c17('0x79'),_0x7c17('0x79'),{'event':_0x7c17('0x81'),'message':_0x13f5db[_0x7c17('0x28')]},client9002);return _0x3208b4;}return null;})[_0x7c17('0x20')](respondWithResult(_0x4027ff,null))[_0x7c17('0x4e')](handleError(_0x4027ff,null));};exports[_0x7c17('0x2b')]=function(_0x2d568b,_0x1e1861,_0x250286){if(_0x2d568b[_0x7c17('0x54')]['id']){delete _0x2d568b[_0x7c17('0x54')]['id'];}var _0x430d1a;return db['SmsMessage'][_0x7c17('0x55')]({'where':{'id':_0x2d568b[_0x7c17('0x50')]['id']}})[_0x7c17('0x20')](handleEntityNotFound(_0x1e1861,null))[_0x7c17('0x20')](function(_0x5e7a85){if(_0x5e7a85){_0x430d1a=_0x5e7a85;return db[_0x7c17('0x82')][_0x7c17('0x55')]({'where':{'id':_0x5e7a85[_0x7c17('0x83')]}});}})[_0x7c17('0x20')](handleEntityNotFound(_0x1e1861,null))[_0x7c17('0x20')](function(_0x1c7337){if(_0x1c7337){logger[_0x7c17('0x23')](_0x7c17('0x24'),_0x7c17('0x2b'),_0x7c17('0x84'),_0x1c7337[_0x7c17('0x85')],util[_0x7c17('0x86')](_0x2d568b['body'],{'showHidden':![],'depth':null}));switch(_0x1c7337[_0x7c17('0x85')]){case _0x7c17('0x87'):if(_0x2d568b['body'][_0x7c17('0x88')]&&_0x2d568b[_0x7c17('0x54')][_0x7c17('0x88')]===_0x430d1a[_0x7c17('0x89')]){return _0x430d1a[_0x7c17('0x62')]({'read':!![]});}else{logger[_0x7c17('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7c17('0x2b'),_0x7c17('0x87'),util[_0x7c17('0x86')](_0x2d568b['body'],{'showHidden':![],'depth':null}));}break;case _0x7c17('0x8a'):if(_0x2d568b['body'][_0x7c17('0x8b')]&&_0x2d568b[_0x7c17('0x54')][_0x7c17('0x8b')]===_0x430d1a[_0x7c17('0x89')]&&_[_0x7c17('0x8c')]([_0x7c17('0x8d'),_0x7c17('0x8e')],_0x2d568b[_0x7c17('0x54')]['Status'])>=0x0){return _0x430d1a[_0x7c17('0x62')]({'read':!![]});}else{logger['error'](_0x7c17('0x8f'),_0x7c17('0x2b'),_0x7c17('0x90'),util['inspect'](_0x2d568b[_0x7c17('0x54')],{'showHidden':![],'depth':null}));}break;case _0x7c17('0x91'):var _0x5196c3=_0x2d568b[_0x7c17('0x54')][_0x7c17('0x92')][0x0];if(_0x5196c3[_0x7c17('0x2b')]['groupName']===_0x7c17('0x93')){return _0x430d1a[_0x7c17('0x62')]({'read':!![]});}else{logger[_0x7c17('0x27')](_0x7c17('0x8f'),_0x7c17('0x2b'),_0x7c17('0x91'),util['inspect'](_0x2d568b[_0x7c17('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x430d1a;}})[_0x7c17('0x20')](respondWithResult(_0x1e1861,null))['catch'](handleError(_0x1e1861,null));}; \ No newline at end of file +var _0x1e44=['SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','QueryTypes','fullname','email','SIP/%s','rejectmessage','SmsAccount','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','name','send','index','map','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','SmsMessage','findAll','rows','show','params','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','UserId','agent','get','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','user','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','internal','manual','interface','channel','motionChannel','event','EventManager','../../config/logger'];(function(_0x348bef,_0x3e1674){var _0x1a059f=function(_0xedce38){while(--_0xedce38){_0x348bef['push'](_0x348bef['shift']());}};_0x1a059f(++_0x3e1674);}(_0x1e44,0xb3));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x41e4('0x0'));var rimraf=require(_0x41e4('0x1'));var zipdir=require(_0x41e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41e4('0x3'));var moment=require(_0x41e4('0x4'));var BPromise=require(_0x41e4('0x5'));var Mustache=require(_0x41e4('0x6'));var util=require('util');var path=require(_0x41e4('0x7'));var sox=require(_0x41e4('0x8'));var csv=require(_0x41e4('0x9'));var ejs=require(_0x41e4('0xa'));var fs=require('fs');var fs_extra=require(_0x41e4('0xb'));var _=require(_0x41e4('0xc'));var squel=require(_0x41e4('0xd'));var crypto=require(_0x41e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x41e4('0xf'));var toCsv=require(_0x41e4('0x9'));var querystring=require(_0x41e4('0x10'));var Papa=require(_0x41e4('0x11'));var Redis=require(_0x41e4('0x12'));var authService=require(_0x41e4('0x13'));var qs=require(_0x41e4('0x14'));var as=require(_0x41e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x41e4('0x16'));var utils=require('../../config/utils');var config=require(_0x41e4('0x17'));var licenseUtil=require(_0x41e4('0x18'));var db=require(_0x41e4('0x19'))['db'];config[_0x41e4('0x1a')]=_[_0x41e4('0x1b')](config[_0x41e4('0x1a')],{'host':_0x41e4('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x41e4('0x1d'))['register'](socket);var jayson=require(_0x41e4('0x1e'));var client=jayson['client'][_0x41e4('0x1f')]({'port':0x232c});var client9002=jayson[_0x41e4('0x20')][_0x41e4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x508caa,_0x41238a,_0x2e9500,_0x5b207d){return new BPromise(function(_0x5bbe36,_0x56d8d1){var _0x4b5fb6=_0x5b207d||client;return _0x4b5fb6[_0x41e4('0x21')](_0x508caa,_0x2e9500)[_0x41e4('0x22')](function(_0xdd9766){logger[_0x41e4('0x23')](_0x41e4('0x24'),_0x41238a,'request\x20sent');logger['debug'](_0x41e4('0x25'),_0x41238a,_0x41e4('0x26'),JSON[_0x41e4('0x27')](_0xdd9766));if(_0xdd9766[_0x41e4('0x28')]){if(_0xdd9766[_0x41e4('0x28')][_0x41e4('0x29')]===0x1f4){logger[_0x41e4('0x28')](_0x41e4('0x24'),_0x41238a,_0xdd9766['error'][_0x41e4('0x2a')]);return _0x56d8d1(_0xdd9766['error'][_0x41e4('0x2a')]);}logger[_0x41e4('0x28')](_0x41e4('0x24'),_0x41238a,_0xdd9766[_0x41e4('0x28')][_0x41e4('0x2a')]);return _0x5bbe36(_0xdd9766[_0x41e4('0x28')]['message']);}else{logger[_0x41e4('0x23')]('SmsMessage,\x20%s,\x20%s',_0x41238a,_0x41e4('0x26'));_0x5bbe36(_0xdd9766[_0x41e4('0x2b')][_0x41e4('0x2a')]);}})[_0x41e4('0x2c')](function(_0x18fac9){logger[_0x41e4('0x28')](_0x41e4('0x24'),_0x41238a,_0x18fac9);_0x56d8d1(_0x18fac9);});});}function respondWithStatusCode(_0xe9bc87,_0x297fa1){_0x297fa1=_0x297fa1||0xcc;return function(_0x2dd222){if(_0x2dd222){return _0xe9bc87[_0x41e4('0x2d')](_0x297fa1);}return _0xe9bc87[_0x41e4('0x2e')](_0x297fa1)[_0x41e4('0x2f')]();};}function respondWithResult(_0x74ea28,_0x3f2749){_0x3f2749=_0x3f2749||0xc8;return function(_0x136fc5){if(_0x136fc5){return _0x74ea28[_0x41e4('0x2e')](_0x3f2749)[_0x41e4('0x30')](_0x136fc5);}};}function respondWithFilteredResult(_0xff795e,_0x3599c8){return function(_0x4fe8b2){if(_0x4fe8b2){var _0x16fa1b=typeof _0x3599c8[_0x41e4('0x31')]===_0x41e4('0x32')&&typeof _0x3599c8['limit']===_0x41e4('0x32');var _0x163fef=_0x4fe8b2[_0x41e4('0x33')];var _0x103e28=_0x16fa1b?0x0:_0x3599c8[_0x41e4('0x31')];var _0x1f3a8b=_0x16fa1b?_0x4fe8b2[_0x41e4('0x33')]:_0x3599c8['offset']+_0x3599c8[_0x41e4('0x34')];var _0x31b1b8;if(_0x1f3a8b>=_0x163fef){_0x1f3a8b=_0x163fef;_0x31b1b8=0xc8;}else{_0x31b1b8=0xce;}_0xff795e[_0x41e4('0x2e')](_0x31b1b8);return _0xff795e['set'](_0x41e4('0x35'),_0x103e28+'-'+_0x1f3a8b+'/'+_0x163fef)[_0x41e4('0x30')](_0x4fe8b2);}return null;};}function patchUpdates(_0x130ad0){return function(_0x530fcd){try{jsonpatch[_0x41e4('0x36')](_0x530fcd,_0x130ad0,!![]);}catch(_0x2c86fe){return BPromise[_0x41e4('0x37')](_0x2c86fe);}return _0x530fcd[_0x41e4('0x38')]();};}function saveUpdates(_0x4e1b3f,_0xec2833){return function(_0x1160da){if(_0x1160da){return _0x1160da[_0x41e4('0x39')](_0x4e1b3f)[_0x41e4('0x22')](function(_0x3b86ff){return _0x3b86ff;});}return null;};}function removeEntity(_0x5687d4,_0x22267a){return function(_0xbc5c7a){if(_0xbc5c7a){return _0xbc5c7a[_0x41e4('0x3a')]()[_0x41e4('0x22')](function(){_0x5687d4['status'](0xcc)[_0x41e4('0x2f')]();});}};}function handleEntityNotFound(_0x13164b,_0x311a05){return function(_0x31702c){if(!_0x31702c){_0x13164b['sendStatus'](0x194);}return _0x31702c;};}function handleError(_0x5c3dec,_0x5ef1c1){_0x5ef1c1=_0x5ef1c1||0x1f4;return function(_0x19362c){logger[_0x41e4('0x28')](_0x19362c['stack']);if(_0x19362c[_0x41e4('0x3b')]){delete _0x19362c['name'];}_0x5c3dec['status'](_0x5ef1c1)[_0x41e4('0x3c')](_0x19362c);};}exports[_0x41e4('0x3d')]=function(_0x210e83,_0x3de587){var _0x3696e6={},_0x2eb0aa={},_0x3a8114={'count':0x0,'rows':[]};var _0x298d05=_[_0x41e4('0x3e')](db['SmsMessage']['rawAttributes'],function(_0x54678d){return{'name':_0x54678d[_0x41e4('0x3f')],'type':_0x54678d['type'][_0x41e4('0x40')]};});_0x2eb0aa['model']=_[_0x41e4('0x3e')](_0x298d05,_0x41e4('0x3b'));_0x2eb0aa[_0x41e4('0x41')]=_[_0x41e4('0x42')](_0x210e83[_0x41e4('0x41')]);_0x2eb0aa[_0x41e4('0x43')]=_['intersection'](_0x2eb0aa['model'],_0x2eb0aa[_0x41e4('0x41')]);_0x3696e6[_0x41e4('0x44')]=_[_0x41e4('0x45')](_0x2eb0aa[_0x41e4('0x46')],qs[_0x41e4('0x47')](_0x210e83[_0x41e4('0x41')]['fields']));_0x3696e6['attributes']=_0x3696e6[_0x41e4('0x44')][_0x41e4('0x48')]?_0x3696e6[_0x41e4('0x44')]:_0x2eb0aa[_0x41e4('0x46')];if(!_0x210e83[_0x41e4('0x41')]['hasOwnProperty']('nolimit')){_0x3696e6[_0x41e4('0x34')]=qs['limit'](_0x210e83[_0x41e4('0x41')][_0x41e4('0x34')]);_0x3696e6[_0x41e4('0x31')]=qs['offset'](_0x210e83[_0x41e4('0x41')][_0x41e4('0x31')]);}_0x3696e6[_0x41e4('0x49')]=qs[_0x41e4('0x4a')](_0x210e83[_0x41e4('0x41')][_0x41e4('0x4a')]);_0x3696e6[_0x41e4('0x4b')]=qs[_0x41e4('0x43')](_[_0x41e4('0x4c')](_0x210e83[_0x41e4('0x41')],_0x2eb0aa[_0x41e4('0x43')]),_0x298d05);if(_0x210e83['query'][_0x41e4('0x4d')]){_0x3696e6['where']=_[_0x41e4('0x4e')](_0x3696e6[_0x41e4('0x4b')],{'$or':_[_0x41e4('0x3e')](_0x298d05,function(_0x448892){if(_0x448892[_0x41e4('0x4f')]!==_0x41e4('0x50')){var _0x21b983={};_0x21b983[_0x448892[_0x41e4('0x3b')]]={'$like':'%'+_0x210e83[_0x41e4('0x41')][_0x41e4('0x4d')]+'%'};return _0x21b983;}})});}_0x3696e6=_['merge']({},_0x3696e6,_0x210e83['options']);var _0x16cb47={'where':_0x3696e6[_0x41e4('0x4b')]};return db['SmsMessage']['count'](_0x16cb47)[_0x41e4('0x22')](function(_0x235ada){_0x3a8114['count']=_0x235ada;if(_0x210e83[_0x41e4('0x41')][_0x41e4('0x51')]){_0x3696e6[_0x41e4('0x52')]=[{'all':!![]}];}return db[_0x41e4('0x53')][_0x41e4('0x54')](_0x3696e6);})[_0x41e4('0x22')](function(_0x3330c1){_0x3a8114[_0x41e4('0x55')]=_0x3330c1;return _0x3a8114;})['then'](respondWithFilteredResult(_0x3de587,_0x3696e6))[_0x41e4('0x2c')](handleError(_0x3de587,null));};exports[_0x41e4('0x56')]=function(_0x5a1ac8,_0x5a594e){var _0x490948={'raw':!![],'where':{'id':_0x5a1ac8[_0x41e4('0x57')]['id']}},_0xdf65c6={};_0xdf65c6[_0x41e4('0x46')]=_[_0x41e4('0x42')](db[_0x41e4('0x53')][_0x41e4('0x58')]);_0xdf65c6[_0x41e4('0x41')]=_[_0x41e4('0x42')](_0x5a1ac8[_0x41e4('0x41')]);_0xdf65c6[_0x41e4('0x43')]=_[_0x41e4('0x45')](_0xdf65c6['model'],_0xdf65c6[_0x41e4('0x41')]);_0x490948[_0x41e4('0x44')]=_[_0x41e4('0x45')](_0xdf65c6[_0x41e4('0x46')],qs[_0x41e4('0x47')](_0x5a1ac8[_0x41e4('0x41')][_0x41e4('0x47')]));_0x490948[_0x41e4('0x44')]=_0x490948[_0x41e4('0x44')][_0x41e4('0x48')]?_0x490948[_0x41e4('0x44')]:_0xdf65c6[_0x41e4('0x46')];if(_0x5a1ac8[_0x41e4('0x41')]['includeAll']){_0x490948[_0x41e4('0x52')]=[{'all':!![]}];}_0x490948=_['merge']({},_0x490948,_0x5a1ac8['options']);return db['SmsMessage'][_0x41e4('0x59')](_0x490948)[_0x41e4('0x22')](handleEntityNotFound(_0x5a594e,null))[_0x41e4('0x22')](respondWithResult(_0x5a594e,null))[_0x41e4('0x2c')](handleError(_0x5a594e,null));};exports[_0x41e4('0x5a')]=function(_0x422f50,_0x4830da){return db['SmsMessage'][_0x41e4('0x5a')](_0x422f50[_0x41e4('0x5b')],{})[_0x41e4('0x22')](respondWithResult(_0x4830da,0xc9))[_0x41e4('0x2c')](handleError(_0x4830da,null));};exports['update']=function(_0x26fd45,_0x1cd8cc){if(_0x26fd45['body']['id']){delete _0x26fd45['body']['id'];}return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x26fd45[_0x41e4('0x57')]['id']}})[_0x41e4('0x22')](handleEntityNotFound(_0x1cd8cc,null))[_0x41e4('0x22')](saveUpdates(_0x26fd45[_0x41e4('0x5b')],null))['then'](respondWithResult(_0x1cd8cc,null))[_0x41e4('0x2c')](handleError(_0x1cd8cc,null));};exports[_0x41e4('0x3a')]=function(_0x30a948,_0x242323){return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x30a948[_0x41e4('0x57')]['id']}})[_0x41e4('0x22')](handleEntityNotFound(_0x242323,null))[_0x41e4('0x22')](removeEntity(_0x242323,null))[_0x41e4('0x2c')](handleError(_0x242323,null));};exports['describe']=function(_0x16bae9,_0x4911e9){return db['SmsMessage'][_0x41e4('0x5c')]()[_0x41e4('0x22')](respondWithResult(_0x4911e9,null))[_0x41e4('0x2c')](handleError(_0x4911e9,null));};var interaction_log=require('../../config/logger')(_0x41e4('0x5d'));exports[_0x41e4('0x5e')]=function(_0x37416d,_0x49185d,_0xf1c89e){var _0x2c29c1={'agent':{},'channel':_0x41e4('0x5f')};if(_0x37416d[_0x41e4('0x5b')]['id']){delete _0x37416d[_0x41e4('0x5b')]['id'];}_0x37416d[_0x41e4('0x5b')]['read']=!![];_0x37416d[_0x41e4('0x5b')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37416d[_0x41e4('0x5b')]['UserId']=_0x37416d[_0x41e4('0x5b')][_0x41e4('0x60')]||_0x37416d['user']['id'];_0x2c29c1[_0x41e4('0x61')]['id']=_0x37416d['body'][_0x41e4('0x60')];return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x37416d[_0x41e4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49185d,null))[_0x41e4('0x22')](saveUpdates(_0x37416d[_0x41e4('0x5b')],null))['then'](function(_0x3cc255){if(_0x3cc255){_0x2c29c1[_0x41e4('0x2a')]=_0x3cc255[_0x41e4('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3cc255[_0x41e4('0x63')]}});}return null;})[_0x41e4('0x22')](handleEntityNotFound(_0x49185d,null))[_0x41e4('0x22')](function(_0xe7826){if(_0xe7826){return _0xe7826[_0x41e4('0x39')]({'UserId':_0x37416d[_0x41e4('0x5b')][_0x41e4('0x60')],'read1stAt':_[_0x41e4('0x64')](_0xe7826[_0x41e4('0x65')])?moment()[_0x41e4('0x66')](_0x41e4('0x67')):undefined});}return null;})[_0x41e4('0x22')](function(_0x21cb55){if(_0x21cb55){_0x2c29c1['interaction']=_0x21cb55[_0x41e4('0x62')]({'plain':!![]});interaction_log[_0x41e4('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x37416d[_0x41e4('0x68')]['id'],_0x37416d[_0x41e4('0x68')][_0x41e4('0x3b')],_0x37416d[_0x41e4('0x68')]['role'],_0x2c29c1[_0x41e4('0x69')]['id'],_0x37416d[_0x41e4('0x5b')]?JSON[_0x41e4('0x27')](_0x37416d[_0x41e4('0x5b')]):_0x41e4('0x6a'));return respondWithRpcPromise(_0x41e4('0x6b'),_0x41e4('0x6c'),_0x2c29c1);}return null;})[_0x41e4('0x22')](function(_0x539257){var _0x1df624=_0x41e4('0x6d')+_0x539257['message']['ContactId'];return db[_0x41e4('0x6e')][_0x41e4('0x41')](_0x1df624,{'type':db[_0x41e4('0x6f')]['QueryTypes'][_0x41e4('0x70')],'raw':!![]})[_0x41e4('0x22')](function(_0x462f8f){return _0x462f8f;});})[_0x41e4('0x22')](function(_0x7665){if(_0x7665){_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x71')]=_0x7665[0x0];if(!_0x37416d['body'][_0x41e4('0x60')])return;return db[_0x41e4('0x72')][_0x41e4('0x59')]({'where':{'id':_0x37416d[_0x41e4('0x5b')][_0x41e4('0x60')],'role':_0x41e4('0x61')},'attributes':['id','name','fullname','email',_0x41e4('0x73')],'raw':!![]});}return null;})['then'](function(_0x59a579){if(!_0x59a579)return null;_0x2c29c1[_0x41e4('0x2a')]['agent']=_0x59a579;return _0x2c29c1;})[_0x41e4('0x22')](function(_0x2c83ca){if(_0x2c83ca){if(_0x37416d[_0x41e4('0x5b')][_0x41e4('0x74')]){_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x75')]=util[_0x41e4('0x66')]('SIP/%s',_0x37416d[_0x41e4('0x68')][_0x41e4('0x3b')]);_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x76')]=_0x2c29c1[_0x41e4('0x76')];_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x77')]=_0x2c29c1[_0x41e4('0x76')];_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x78')]=_0x41e4('0x5e');return respondWithRpcPromise(_0x41e4('0x79'),'EventManager',{'event':'acceptmessage','message':_0x2c29c1['message']},client9002)[_0x41e4('0x22')](function(){return _0x2c29c1;});}return _0x2c29c1;}return null;})[_0x41e4('0x22')](respondWithResult(_0x49185d,null))['catch'](handleError(_0x49185d,null));};var interaction_log=require(_0x41e4('0x7a'))(_0x41e4('0x5d'));exports['reject']=function(_0x4ca991,_0x504e8d,_0x5ca509){var _0x431c9a={'agent':{},'channel':_0x41e4('0x5f')};if(_0x4ca991[_0x41e4('0x5b')]['id']){delete _0x4ca991[_0x41e4('0x5b')]['id'];}_0x4ca991[_0x41e4('0x5b')][_0x41e4('0x60')]=_0x4ca991[_0x41e4('0x5b')][_0x41e4('0x60')]||_0x4ca991['user']['id'];_0x431c9a[_0x41e4('0x61')]['id']=_0x4ca991['body'][_0x41e4('0x60')];return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x4ca991[_0x41e4('0x57')]['id'],'UserId':null}})[_0x41e4('0x22')](handleEntityNotFound(_0x504e8d,null))[_0x41e4('0x22')](function(_0x50c4c6){if(_0x50c4c6){_0x431c9a[_0x41e4('0x2a')]=_0x50c4c6[_0x41e4('0x62')]({'plain':!![]});return db[_0x41e4('0x7b')][_0x41e4('0x59')]({'where':{'id':_0x50c4c6['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x504e8d,null))[_0x41e4('0x22')](function(_0x258177){if(_0x258177){_0x431c9a[_0x41e4('0x69')]=_0x258177['get']({'plain':!![]});interaction_log[_0x41e4('0x23')](_0x41e4('0x7c'),_0x4ca991[_0x41e4('0x68')]['id'],_0x4ca991['user'][_0x41e4('0x3b')],_0x4ca991[_0x41e4('0x68')][_0x41e4('0x7d')],_0x431c9a[_0x41e4('0x69')]['id'],_0x4ca991[_0x41e4('0x5b')]?JSON[_0x41e4('0x27')](_0x4ca991[_0x41e4('0x5b')]):_0x41e4('0x6a'));return respondWithRpcPromise(_0x41e4('0x7e'),'rejectMessage',_0x431c9a);}return null;})[_0x41e4('0x22')](function(_0x5aeb70){var _0x534796=_0x41e4('0x6d')+_0x5aeb70[_0x41e4('0x2a')][_0x41e4('0x7f')];return db[_0x41e4('0x6e')][_0x41e4('0x41')](_0x534796,{'type':db[_0x41e4('0x6f')][_0x41e4('0x80')]['SELECT'],'raw':!![]})[_0x41e4('0x22')](function(_0x52bdc0){return _0x52bdc0;});})[_0x41e4('0x22')](function(_0x2702e6){if(_0x2702e6){_0x431c9a[_0x41e4('0x2a')][_0x41e4('0x71')]=_0x2702e6[0x0];if(!_0x4ca991['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x4ca991['body'][_0x41e4('0x60')],'role':_0x41e4('0x61')},'attributes':['id','name',_0x41e4('0x81'),_0x41e4('0x82'),'internal'],'raw':!![]});}return null;})[_0x41e4('0x22')](function(_0x5c0702){if(!_0x5c0702)return null;_0x431c9a[_0x41e4('0x2a')]['agent']=_0x5c0702;return _0x431c9a;})[_0x41e4('0x22')](function(_0x3c4151){if(_0x3c4151){_0x3c4151['message']['interface']=util[_0x41e4('0x66')](_0x41e4('0x83'),_0x4ca991[_0x41e4('0x68')][_0x41e4('0x3b')]);_0x3c4151[_0x41e4('0x2a')][_0x41e4('0x76')]=_0x431c9a['channel'];_0x3c4151['message'][_0x41e4('0x77')]=_0x431c9a[_0x41e4('0x76')];_0x3c4151['message'][_0x41e4('0x78')]=_0x41e4('0x37');respondWithRpcPromise(_0x41e4('0x79'),_0x41e4('0x79'),{'event':_0x41e4('0x84'),'message':_0x3c4151['message']},client9002);return _0x431c9a;}return null;})[_0x41e4('0x22')](respondWithResult(_0x504e8d,null))[_0x41e4('0x2c')](handleError(_0x504e8d,null));};exports[_0x41e4('0x2e')]=function(_0x543551,_0x2c7de1,_0x2a211e){if(_0x543551['body']['id']){delete _0x543551[_0x41e4('0x5b')]['id'];}var _0x36b4ad;return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x543551[_0x41e4('0x57')]['id']}})[_0x41e4('0x22')](handleEntityNotFound(_0x2c7de1,null))[_0x41e4('0x22')](function(_0x5dd2b8){if(_0x5dd2b8){_0x36b4ad=_0x5dd2b8;return db[_0x41e4('0x85')]['find']({'where':{'id':_0x5dd2b8['SmsAccountId']}});}})[_0x41e4('0x22')](handleEntityNotFound(_0x2c7de1,null))[_0x41e4('0x22')](function(_0x365fc1){if(_0x365fc1){logger[_0x41e4('0x86')](_0x41e4('0x25'),_0x41e4('0x2e'),_0x41e4('0x87'),_0x365fc1[_0x41e4('0x4f')],util[_0x41e4('0x88')](_0x543551[_0x41e4('0x5b')],{'showHidden':![],'depth':null}));switch(_0x365fc1['type']){case _0x41e4('0x89'):if(_0x543551['body'][_0x41e4('0x8a')]&&_0x543551['body']['MessageSid']===_0x36b4ad[_0x41e4('0x8b')]){return _0x36b4ad['update']({'read':!![]});}else{logger[_0x41e4('0x28')](_0x41e4('0x8c'),_0x41e4('0x2e'),_0x41e4('0x89'),util[_0x41e4('0x88')](_0x543551[_0x41e4('0x5b')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x543551['body'][_0x41e4('0x8d')]&&_0x543551[_0x41e4('0x5b')]['MessageUUID']===_0x36b4ad['messageId']&&_[_0x41e4('0x8e')]([_0x41e4('0x8f'),_0x41e4('0x90')],_0x543551[_0x41e4('0x5b')][_0x41e4('0x91')])>=0x0){return _0x36b4ad[_0x41e4('0x39')]({'read':!![]});}else{logger[_0x41e4('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x41e4('0x2e'),_0x41e4('0x92'),util[_0x41e4('0x88')](_0x543551['body'],{'showHidden':![],'depth':null}));}break;case _0x41e4('0x93'):var _0xb7c4d9=_0x543551[_0x41e4('0x5b')][_0x41e4('0x94')][0x0];if(_0xb7c4d9[_0x41e4('0x2e')][_0x41e4('0x95')]===_0x41e4('0x96')){return _0x36b4ad['update']({'read':!![]});}else{logger[_0x41e4('0x28')](_0x41e4('0x8c'),_0x41e4('0x2e'),_0x41e4('0x93'),util[_0x41e4('0x88')](_0x543551['body'],{'showHidden':![],'depth':null}));}break;}return _0x36b4ad;}})[_0x41e4('0x22')](respondWithResult(_0x2c7de1,null))[_0x41e4('0x2c')](handleError(_0x2c7de1,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 682f1ae..803d9d1 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x888d=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x484b38,_0x501278){var _0x1e8a55=function(_0x2a23c1){while(--_0x2a23c1){_0x484b38['push'](_0x484b38['shift']());}};_0x1e8a55(++_0x501278);}(_0x888d,0xf2));var _0xd888=function(_0x2096cd,_0x4fba4d){_0x2096cd=_0x2096cd-0x0;var _0x415d57=_0x888d[_0x2096cd];return _0x415d57;};'use strict';var EventEmitter=require(_0xd888('0x0'));var SmsMessage=require(_0xd888('0x1'))['db'][_0xd888('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd888('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd888('0x4'),'afterDestroy':_0xd888('0x5')};function emitEvent(_0x4c86bd){return function(_0x4f4251,_0x8e7ac3,_0x11d961){SmsMessageEvents[_0xd888('0x6')](_0x4c86bd+':'+_0x4f4251['id'],_0x4f4251);SmsMessageEvents[_0xd888('0x6')](_0x4c86bd,_0x4f4251);_0x11d961(null);};}for(var e in events){if(events[_0xd888('0x7')](e)){var event=events[e];SmsMessage[_0xd888('0x8')](e,emitEvent(event));}}module[_0xd888('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x210e=['setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb','SmsMessage'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x210e,0xb1));var _0xe210=function(_0x2142ea,_0x5a8f39){_0x2142ea=_0x2142ea-0x0;var _0x53e2a9=_0x210e[_0x2142ea];return _0x53e2a9;};'use strict';var EventEmitter=require(_0xe210('0x0'));var SmsMessage=require(_0xe210('0x1'))['db'][_0xe210('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe210('0x3')](0x0);var events={'afterCreate':_0xe210('0x4'),'afterUpdate':_0xe210('0x5'),'afterDestroy':_0xe210('0x6')};function emitEvent(_0x180c16){return function(_0x267595,_0x1753b1,_0x4508de){SmsMessageEvents['emit'](_0x180c16+':'+_0x267595['id'],_0x267595);SmsMessageEvents['emit'](_0x180c16,_0x267595);_0x4508de(null);};}for(var e in events){if(events[_0xe210('0x7')](e)){var event=events[e];SmsMessage[_0xe210('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ba754bd..51476d7 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b72=['code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','define','SmsMessage','sms_messages','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteractionId','SmsInteraction','findOne','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','body','phone','remote','/status?token=','token','then','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','smsMethod','sender','&password=','GET','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','password','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','head','data','message_id','clickSend','plivo','authId','/api/sms/messages/','message_uuid','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','clickatell','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','Bearer\x20'];(function(_0x1d4521,_0x339b0d){var _0x557ff2=function(_0x538e1f){while(--_0x538e1f){_0x1d4521['push'](_0x1d4521['shift']());}};_0x557ff2(++_0x339b0d);}(_0x7b72,0x1ea));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x27b7('0x0'))(_0x27b7('0x1'));var moment=require(_0x27b7('0x2'));var BPromise=require(_0x27b7('0x3'));var rp=require(_0x27b7('0x4'));var fs=require('fs');var path=require(_0x27b7('0x5'));var rimraf=require(_0x27b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x27b7('0x7'));module['exports']=function(_0x4cc543,_0x7dd28d){return _0x4cc543[_0x27b7('0x8')](_0x27b7('0x9'),attributes,{'tableName':_0x27b7('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x27b7('0xb'),'fields':['body'],'type':_0x27b7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cfde8,_0x4e495a,_0xd33c4d){var _0x29ad5a=_0x4cc543[_0x27b7('0xd')];var _0x28abfe=_0x5cfde8[_0x27b7('0xe')]({'plain':!![]});if(_0x28abfe[_0x27b7('0xf')][_0x27b7('0x10')]()==='in'||_0x28abfe[_0x27b7('0xf')][_0x27b7('0x10')]()===_0x27b7('0x11')&&!_0x28abfe[_0x27b7('0x12')]&&!_['isNil'](_0x28abfe[_0x27b7('0x13')])&&!_['isNil'](_0x28abfe[_0x27b7('0x14')])){_0x29ad5a[_0x27b7('0x15')][_0x27b7('0x16')]({'where':{'id':_0x28abfe[_0x27b7('0x14')]}})['then'](function(_0x42529d){if(_0x42529d){_0x42529d['update']({'lastMsgAt':_0x28abfe[_0x27b7('0x17')],'lastMsgDirection':_0x28abfe['direction'][_0x27b7('0x10')]()});}})[_0x27b7('0x18')](function(_0x397893){console[_0x27b7('0x19')](_0x397893);});}if(_0x28abfe[_0x27b7('0xf')]===_0x27b7('0x11')&&!_0x28abfe[_0x27b7('0x12')]){var _0x8ba19b;_0x29ad5a[_0x27b7('0x1a')][_0x27b7('0x1b')]({'where':{'id':_0x28abfe[_0x27b7('0x1c')]},'raw':!![]})['then'](function(_0x40281a){_0x8ba19b=_0x40281a;if(_0x8ba19b&&_0x8ba19b[_0x27b7('0x1d')]){switch(_0x8ba19b[_0x27b7('0x1d')]){case'twilio':var _0xc785a9=require(_0x27b7('0x1e'));if(_0x8ba19b[_0x27b7('0x1f')]&&_0x8ba19b[_0x27b7('0x20')]&&_0x8ba19b['phone']){var _0x434d99=new _0xc785a9(_0x8ba19b[_0x27b7('0x1f')],_0x8ba19b[_0x27b7('0x20')]);_0x434d99[_0x27b7('0x21')][_0x27b7('0x22')]({'body':_0x28abfe[_0x27b7('0x23')],'to':_0x28abfe[_0x27b7('0x24')],'from':_0x8ba19b['phone'],'statusCallback':_0x8ba19b[_0x27b7('0x25')]+'/api/sms/messages/'+_0x28abfe['id']+_0x27b7('0x26')+_0x8ba19b[_0x27b7('0x27')]})[_0x27b7('0x28')](function(_0xdf4ca4){if(_0xdf4ca4[_0x27b7('0x29')]){return _0x5cfde8[_0x27b7('0x2a')]({'messageId':_0xdf4ca4[_0x27b7('0x29')]});}})[_0x27b7('0x18')](function(_0x1bf51d){logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),'twilio',util[_0x27b7('0x2d')](_0x1bf51d,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27b7('0x1e'),_0x27b7('0x2e'));}break;case'skebby':var _0x4bc3df='https://api.skebby.it/API/v1.0/REST/';if(_0x8ba19b[_0x27b7('0x2f')]&&_0x8ba19b['password']){var _0x5751ec={'recipient':[_0x28abfe[_0x27b7('0x24')]],'message':_0x28abfe[_0x27b7('0x23')],'message_type':_0x8ba19b[_0x27b7('0x30')]};if(_0x8ba19b[_0x27b7('0x30')]&&_0x8ba19b['smsMethod']!=='SI'){_0x5751ec[_0x27b7('0x31')]=_0x8ba19b[_0x27b7('0x24')];}var _0x502f0c={'url':_0x4bc3df+'login?username='+_0x8ba19b['username']+_0x27b7('0x32')+_0x8ba19b['password'],'method':_0x27b7('0x33')};rp(_0x502f0c)['then'](function(_0x437d91){var _0x39359c=_0x437d91['split'](';');var _0x509183={'user_key':_0x39359c[0x0],'session_key':_0x39359c[0x1]};_0x502f0c={'url':_0x4bc3df+_0x27b7('0x34'),'method':_0x27b7('0x35'),'headers':{'user_key':_0x509183['user_key'],'Session_key':_0x509183[_0x27b7('0x36')]},'json':!![],'body':_0x5751ec};return rp(_0x502f0c);})[_0x27b7('0x28')](function(_0x368c7f){if(_0x368c7f[_0x27b7('0x37')]>=0x1){var _0x5d4eef={'messageId':_0x368c7f[_0x27b7('0x38')]};if(_0x8ba19b['smsMethod']!=='GP'||!_0x8ba19b[_0x27b7('0x39')]){_0x5d4eef[_0x27b7('0x3a')]=!![];}return _0x5cfde8['update'](_0x5d4eef);}else{return logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),_0x27b7('0x3b'),util['inspect'](_0x368c7f,{'showHidden':![],'depth':null}));}})[_0x27b7('0x18')](function(_0x5b1000){return logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),_0x27b7('0x3b'),util[_0x27b7('0x2d')](_0x5b1000,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x3b'),_0x27b7('0x3c'));}break;case _0x27b7('0x3d'):if(_0x8ba19b[_0x27b7('0x20')]){var _0x30ef97={'recipient':_0x28abfe[_0x27b7('0x24')],'message':_0x28abfe[_0x27b7('0x23')],'sender':_0x8ba19b[_0x27b7('0x3e')]||_0x8ba19b[_0x27b7('0x24')],'authorization':_0x8ba19b[_0x27b7('0x20')]};var _0x4e495a={'method':_0x27b7('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x30ef97,'json':!![]};rp(_0x4e495a)[_0x27b7('0x28')](function(_0x55b4fb){var _0x1e26de={'messageId':_0x55b4fb[_0x27b7('0x3f')]};if(!_0x8ba19b[_0x27b7('0x39')]){_0x1e26de[_0x27b7('0x3a')]=!![];}return _0x5cfde8['update'](_0x1e26de);})[_0x27b7('0x18')](function(_0x4916aa){logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x3d'),util[_0x27b7('0x2d')](_0x4916aa,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),'afterCreate',_0x27b7('0x3d'),_0x27b7('0x40'));}break;case _0x27b7('0x41'):if(_0x8ba19b[_0x27b7('0x2f')]&&_0x8ba19b[_0x27b7('0x42')]){var _0x30ef97={'messages':[{'source':_0x27b7('0x43'),'to':_0x28abfe[_0x27b7('0x24')],'body':_0x28abfe[_0x27b7('0x23')],'from':_0x8ba19b['senderString']||_0x8ba19b[_0x27b7('0x24')]}]};var _0x53b961=util[_0x27b7('0x44')](_0x27b7('0x45'),_0x8ba19b[_0x27b7('0x2f')],_0x8ba19b[_0x27b7('0x42')]);var _0x4e495a={'method':_0x27b7('0x35'),'uri':_0x27b7('0x46'),'body':_0x30ef97,'headers':{'Authorization':util[_0x27b7('0x44')](_0x27b7('0x47'),new Buffer(_0x53b961)[_0x27b7('0x48')](_0x27b7('0x49')))},'json':!![]};rp(_0x4e495a)[_0x27b7('0x28')](function(_0x46d509){if(_0x46d509[_0x27b7('0x4a')]>=0xc8&&_0x46d509[_0x27b7('0x4a')]<=0xce){if(_0x46d509['data']&&_0x46d509['data']['queued_count']>0x0){var _0x3d6751=_[_0x27b7('0x4b')](_0x46d509[_0x27b7('0x4c')][_0x27b7('0x21')]);var _0xa64ca7={'messageId':_0x3d6751[_0x27b7('0x4d')]};if(!_0x8ba19b[_0x27b7('0x39')]){_0xa64ca7[_0x27b7('0x3a')]=!![];}return _0x5cfde8[_0x27b7('0x2a')](_0xa64ca7);}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x4e'),util['inspect'](_0x46d509,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x4e'),util[_0x27b7('0x2d')](_0x46d509,{'showHidden':![],'depth':null}));}})[_0x27b7('0x18')](function(_0x304e28){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27b7('0x4e'),util['inspect'](_0x304e28,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),_0x27b7('0x4e'),_0x27b7('0x3c'));}break;case _0x27b7('0x4f'):if(_0x8ba19b[_0x27b7('0x50')]&&_0x8ba19b[_0x27b7('0x20')]){var _0x30ef97={'dst':_0x28abfe[_0x27b7('0x24')],'text':_0x28abfe[_0x27b7('0x23')],'src':_0x8ba19b[_0x27b7('0x3e')]||_0x8ba19b[_0x27b7('0x24')],'url':_0x8ba19b[_0x27b7('0x25')]+_0x27b7('0x51')+_0x28abfe['id']+_0x27b7('0x26')+_0x8ba19b['token']};var _0x53b961=util[_0x27b7('0x44')](_0x27b7('0x45'),_0x8ba19b[_0x27b7('0x50')],_0x8ba19b[_0x27b7('0x20')]);var _0x4e495a={'method':_0x27b7('0x35'),'uri':util[_0x27b7('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x8ba19b[_0x27b7('0x50')]),'body':_0x30ef97,'headers':{'Authorization':util['format'](_0x27b7('0x47'),new Buffer(_0x53b961)[_0x27b7('0x48')](_0x27b7('0x49')))},'json':!![]};rp(_0x4e495a)[_0x27b7('0x28')](function(_0x581660){var _0x2dafb5={'messageId':_0x581660[_0x27b7('0x52')][0x0]};return _0x5cfde8['update'](_0x2dafb5);})[_0x27b7('0x18')](function(_0x135ff6){logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),_0x27b7('0x4f'),util[_0x27b7('0x2d')](_0x135ff6,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x4f'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x27b7('0x53'):if(_0x8ba19b[_0x27b7('0x2f')]&&_0x8ba19b['password']){if(_0x8ba19b[_0x27b7('0x54')]){var _0x1ed3af={'method':_0x27b7('0x35'),'uri':_0x8ba19b[_0x27b7('0x54')]+'/auth/1/session','body':{'username':_0x8ba19b[_0x27b7('0x2f')],'password':_0x8ba19b['password']},'json':!![]};return rp(_0x1ed3af)['then'](function(_0x415120){var _0x3f17a2={'method':'POST','uri':_0x8ba19b[_0x27b7('0x54')]+_0x27b7('0x55'),'body':{'messages':[{'from':_0x8ba19b[_0x27b7('0x24')],'destinations':[{'to':_0x28abfe[_0x27b7('0x24')]}],'text':_0x28abfe[_0x27b7('0x23')],'notifyUrl':_0x8ba19b[_0x27b7('0x25')]+_0x27b7('0x51')+_0x28abfe['id']+'/status?token='+_0x8ba19b[_0x27b7('0x27')],'notifyContentType':_0x27b7('0x56'),'callbackData':_0x8ba19b['phone']+';'+_0x28abfe[_0x27b7('0x23')]}]},'headers':{'Authorization':_0x27b7('0x57')+_0x415120[_0x27b7('0x27')]},'json':!![]};return rp(_0x3f17a2)[_0x27b7('0x28')](function(_0x3822dc){if(_0x3822dc[_0x27b7('0x21')]){var _0x4aaca2={'messageId':_0x3822dc[_0x27b7('0x21')][0x0]['messageId']};if(!_0x8ba19b[_0x27b7('0x39')]){_0x4aaca2['read']=!![];}return _0x5cfde8[_0x27b7('0x2a')](_0x4aaca2);}else{return logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x53'),util[_0x27b7('0x2d')](_0x3822dc,{'showHidden':![],'depth':null}));}});})[_0x27b7('0x18')](function(_0x3796a0){return logger['error'](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x53'),util[_0x27b7('0x2d')](_0x3796a0,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x53'),_0x27b7('0x58'));}}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x53'),_0x27b7('0x3c'));}break;case _0x27b7('0x59'):var _0x439f00=require(_0x27b7('0x5a'));if(_0x8ba19b[_0x27b7('0x5b')]){var _0x20911c={};_0x20911c[_0x27b7('0x5c')]=_0x8ba19b['username'];_0x20911c[_0x27b7('0x24')]=_0x28abfe['phone'];_0x20911c['sender']=_0x8ba19b[_0x27b7('0x24')];_0x20911c[_0x27b7('0x5d')]=_0x28abfe[_0x27b7('0x23')];_0x20911c[_0x27b7('0x5e')]=+new Date();var _0xacb623='';var _0x27bbea='';var _0x5d3a1f=Object[_0x27b7('0x5f')](_0x20911c);_0x5d3a1f[_0x27b7('0x60')]();for(var _0x43a9c4=0x0;_0x43a9c4<_0x5d3a1f[_0x27b7('0x61')];_0x43a9c4++){if(_0xacb623!=''){_0xacb623+='&';}_0xacb623+=_0x5d3a1f[_0x43a9c4]+'='+encodeURIComponent(_0x20911c[_0x5d3a1f[_0x43a9c4]]);_0x27bbea+=_0x20911c[_0x5d3a1f[_0x43a9c4]];}_0x27bbea+=_0x8ba19b[_0x27b7('0x5b')];_0x27bbea=_0x439f00[_0x27b7('0x62')](_0x27b7('0x63'))[_0x27b7('0x2a')](_0x27bbea)[_0x27b7('0x64')](_0x27b7('0x65'));if(_0xacb623!==''){_0xacb623+='&';}_0xacb623+=_0x27b7('0x66')+_0x27bbea;var _0x502f0c={'method':_0x27b7('0x33'),'uri':_0x8ba19b[_0x27b7('0x54')]+_0x27b7('0x67')+_0xacb623,'json':!![]};return rp(_0x502f0c)[_0x27b7('0x28')](function(_0x5a02c0){var _0x1324c4=Object[_0x27b7('0x5f')](_0x5a02c0);if(_0x5a02c0[_0x1324c4[0x0]]['error']&&parseInt(_0x5a02c0[_0x1324c4[0x0]]['error'])===0x0){var _0x3ca04a={'messageId':_0x5a02c0[_0x1324c4[0x0]][_0x27b7('0x68')]};if(!_0x8ba19b[_0x27b7('0x39')]){_0x3ca04a[_0x27b7('0x3a')]=!![];}return _0x5cfde8[_0x27b7('0x2a')](_0x3ca04a);}else{return logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),'csc',util['inspect'](_0x5a02c0[_0x27b7('0x19')],{'showHidden':![],'depth':null}));}})[_0x27b7('0x18')](function(_0x9d269d){return logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),_0x27b7('0x59'),util['inspect'](_0x9d269d,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27b7('0x59'),'Missing\x20parameters:\x20apiKey');}break;case _0x27b7('0x69'):if(_0x8ba19b['apiKey']){var _0x4378d5={'method':_0x27b7('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x8ba19b[_0x27b7('0x5b')]},'body':{'content':_0x28abfe['body'],'to':[_0x28abfe[_0x27b7('0x24')]],'from':_0x8ba19b['phone'],'binary':![],'clientMessageId':_0x27b7('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x4378d5)[_0x27b7('0x28')](function(_0x51416c){if(!_0x51416c[_0x27b7('0x19')]){var _0x1dc639={'messageId':_0x51416c[_0x27b7('0x21')][0x0][_0x27b7('0x6b')]};if(!_0x8ba19b[_0x27b7('0x39')]){_0x1dc639['read']=!![];}return _0x5cfde8[_0x27b7('0x2a')](_0x1dc639);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),_0x27b7('0x69'),util[_0x27b7('0x2d')](_0x51416c[_0x27b7('0x19')],{'showHidden':![],'depth':null}));}})[_0x27b7('0x18')](function(_0x3104da){return logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0x27b7('0x2d')](_0x3104da,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27b7('0x2c'),'clickatell',_0x27b7('0x6c'));}break;case _0x27b7('0x6d'):if(_0x8ba19b[_0x27b7('0x2f')]&&_0x8ba19b[_0x27b7('0x42')]){var _0x53b961=util[_0x27b7('0x44')]('%s:%s',_0x8ba19b[_0x27b7('0x2f')],_0x8ba19b[_0x27b7('0x42')]);var _0x4e495a={'method':'POST','uri':_0x27b7('0x6e')+_0x8ba19b['accountId']+_0x27b7('0x6f'),'body':{'to':[_0x28abfe['phone']],'text':_0x28abfe[_0x27b7('0x23')],'from':_0x8ba19b[_0x27b7('0x24')],'applicationId':_0x8ba19b[_0x27b7('0x70')]},'headers':{'Authorization':util[_0x27b7('0x44')](_0x27b7('0x47'),new Buffer(_0x53b961)[_0x27b7('0x48')]('base64'))},'json':!![]};rp(_0x4e495a)[_0x27b7('0x28')](function(_0x864fb4){if(_0x864fb4['id']){var _0x321c05={'messageId':_0x864fb4['id']};return _0x5cfde8[_0x27b7('0x2a')](_0x321c05);}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x6d'),util[_0x27b7('0x2d')](_0x864fb4,{'showHidden':![],'depth':null}));}})[_0x27b7('0x18')](function(_0x1df71d){logger[_0x27b7('0x19')](_0x27b7('0x2b'),'afterCreate',_0x27b7('0x6d'),util[_0x27b7('0x2d')](_0x1df71d,{'showHidden':![],'depth':null}));});}else{logger[_0x27b7('0x19')](_0x27b7('0x2b'),'afterCreate',_0x27b7('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x27b7('0x71'):if(_0x8ba19b[_0x27b7('0x5b')]){var _0x6d50f3={};var _0x502f0c={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x27b7('0x72')+_0x8ba19b[_0x27b7('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x8ba19b[_0x27b7('0x24')],'to':_0x28abfe[_0x27b7('0x24')],'text':_0x28abfe[_0x27b7('0x23')]},'json':!![]};return rp(_0x502f0c)[_0x27b7('0x28')](function(_0x452486){if(_0x452486[_0x27b7('0x73')]==0xca){_0x6d50f3[_0x27b7('0x74')]=_0x452486;var _0x320c0a={'method':_0x27b7('0x35'),'uri':_0x27b7('0x75'),'headers':{'Authorization':_0x27b7('0x72')+_0x8ba19b[_0x27b7('0x5b')],'Content-Type':_0x27b7('0x56')},'body':{'refid':_0x6d50f3[_0x27b7('0x74')]['refid']},'json':!![]};return rp(_0x320c0a)['then'](function(_0x1df650){_0x6d50f3[_0x27b7('0x76')]=_0x1df650;var _0x23e630={'messageId':_0x6d50f3[_0x27b7('0x74')]['refid'],'read':!![]};return _0x5cfde8['update'](_0x23e630);});}else{return logger[_0x27b7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27b7('0x71'),util[_0x27b7('0x2d')](_0x452486,{'showHidden':![],'depth':null}));}})[_0x27b7('0x18')](function(_0x390583){return logger[_0x27b7('0x19')](_0x27b7('0x2b'),_0x27b7('0x2c'),_0x27b7('0x71'),util[_0x27b7('0x2d')](_0x390583,{'showHidden':![],'depth':null}));});}else{return logger[_0x27b7('0x19')](_0x27b7('0x2b'),'afterCreate',_0x27b7('0x71'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0xd33c4d();});}else{_0xd33c4d();}}},'charset':_0x27b7('0x77'),'collate':_0x27b7('0x78')});}; \ No newline at end of file +var _0x0360=['sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','authToken','https://smsapi.connectel.se/api/v2/send/','clicksend','xCALLY\x20Motion','senderString','%s:%s','format','Basic\x20%s','base64','http_code','data','queued_count','messages','clickSend','plivo','authId','remote','/api/sms/messages/','POST','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','csc','apiKey','login','keys','length','createHash','md5','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','refid','Token\x20not\x20received','finally','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','/status?token=','token','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','phone','smsMethod','sender','login?username=','GET','split'];(function(_0x25c4ba,_0x596159){var _0x2c3b40=function(_0x476e37){while(--_0x476e37){_0x25c4ba['push'](_0x25c4ba['shift']());}};_0x2c3b40(++_0x596159);}(_0x0360,0xb1));var _0x0036=function(_0x4cd60f,_0x41b5c6){_0x4cd60f=_0x4cd60f-0x0;var _0x29d357=_0x0360[_0x4cd60f];return _0x29d357;};'use strict';var _=require(_0x0036('0x0'));var util=require('util');var logger=require(_0x0036('0x1'))(_0x0036('0x2'));var moment=require(_0x0036('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0036('0x4'));var config=require(_0x0036('0x5'));var attributes=require(_0x0036('0x6'));module[_0x0036('0x7')]=function(_0x43cc51,_0x2713c5){return _0x43cc51[_0x0036('0x8')]('SmsMessage',attributes,{'tableName':_0x0036('0x9'),'paranoid':![],'indexes':[{'name':_0x0036('0xa'),'fields':[_0x0036('0xa')]},{'name':_0x0036('0xb'),'fields':[_0x0036('0xc')],'type':_0x0036('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36d092,_0x2f3447,_0x3ac2f9){var _0x3662ff=_0x43cc51['models'];var _0x276149=_0x36d092[_0x0036('0xe')]({'plain':!![]});if(_0x276149[_0x0036('0xf')][_0x0036('0x10')]()==='in'||_0x276149['direction'][_0x0036('0x10')]()===_0x0036('0x11')&&!_0x276149[_0x0036('0x12')]&&!_[_0x0036('0x13')](_0x276149[_0x0036('0x14')])&&!_[_0x0036('0x13')](_0x276149['SmsInteractionId'])){_0x3662ff['SmsInteraction'][_0x0036('0x15')]({'where':{'id':_0x276149[_0x0036('0x16')]}})[_0x0036('0x17')](function(_0x57fefe){if(_0x57fefe){_0x57fefe[_0x0036('0x18')]({'lastMsgAt':_0x276149[_0x0036('0x19')],'lastMsgDirection':_0x276149[_0x0036('0xf')][_0x0036('0x10')]()});}})[_0x0036('0x1a')](function(_0x169b3f){console[_0x0036('0x1b')](_0x169b3f);});}if(_0x276149['direction']===_0x0036('0x11')&&!_0x276149['secret']){var _0x4e7d91;_0x3662ff[_0x0036('0x1c')][_0x0036('0x1d')]({'where':{'id':_0x276149[_0x0036('0x1e')]},'raw':!![]})['then'](function(_0x513b5c){_0x4e7d91=_0x513b5c;if(_0x4e7d91&&_0x4e7d91[_0x0036('0x1f')]){switch(_0x4e7d91[_0x0036('0x1f')]){case _0x0036('0x20'):var _0x40c1b3=require('twilio');if(_0x4e7d91[_0x0036('0x21')]&&_0x4e7d91['authToken']&&_0x4e7d91['phone']){var _0x4d9f32=new _0x40c1b3(_0x4e7d91[_0x0036('0x21')],_0x4e7d91['authToken']);_0x4d9f32['messages']['create']({'body':_0x276149[_0x0036('0xc')],'to':_0x276149['phone'],'from':_0x4e7d91['phone'],'statusCallback':_0x4e7d91['remote']+'/api/sms/messages/'+_0x276149['id']+_0x0036('0x22')+_0x4e7d91[_0x0036('0x23')]})[_0x0036('0x17')](function(_0x20ba54){if(_0x20ba54[_0x0036('0x24')]){return _0x36d092[_0x0036('0x18')]({'messageId':_0x20ba54['sid']});}})['catch'](function(_0x5e534d){logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0036('0x20'),util[_0x0036('0x25')](_0x5e534d,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x20'),_0x0036('0x28'));}break;case'skebby':var _0x10a83a='https://api.skebby.it/API/v1.0/REST/';if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){var _0x925f9f={'recipient':[_0x276149[_0x0036('0x2b')]],'message':_0x276149[_0x0036('0xc')],'message_type':_0x4e7d91[_0x0036('0x2c')]};if(_0x4e7d91['smsMethod']&&_0x4e7d91['smsMethod']!=='SI'){_0x925f9f[_0x0036('0x2d')]=_0x4e7d91[_0x0036('0x2b')];}var _0x5d1243={'url':_0x10a83a+_0x0036('0x2e')+_0x4e7d91[_0x0036('0x29')]+'&password='+_0x4e7d91[_0x0036('0x2a')],'method':_0x0036('0x2f')};rp(_0x5d1243)[_0x0036('0x17')](function(_0x277d0e){var _0x324456=_0x277d0e[_0x0036('0x30')](';');var _0x51430b={'user_key':_0x324456[0x0],'session_key':_0x324456[0x1]};_0x5d1243={'url':_0x10a83a+_0x0036('0x31'),'method':'POST','headers':{'user_key':_0x51430b[_0x0036('0x32')],'Session_key':_0x51430b[_0x0036('0x33')]},'json':!![],'body':_0x925f9f};return rp(_0x5d1243);})[_0x0036('0x17')](function(_0xbf78f2){if(_0xbf78f2[_0x0036('0x34')]>=0x1){var _0x426208={'messageId':_0xbf78f2[_0x0036('0x35')]};if(_0x4e7d91[_0x0036('0x2c')]!=='GP'||!_0x4e7d91[_0x0036('0x36')]){_0x426208[_0x0036('0x37')]=!![];}return _0x36d092['update'](_0x426208);}else{return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x38'),util['inspect'](_0xbf78f2,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x30fd41){return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x38'),util[_0x0036('0x25')](_0x30fd41,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x38'),_0x0036('0x39'));}break;case _0x0036('0x3a'):if(_0x4e7d91[_0x0036('0x3b')]){var _0x32a9b9={'recipient':_0x276149[_0x0036('0x2b')],'message':_0x276149[_0x0036('0xc')],'sender':_0x4e7d91['senderString']||_0x4e7d91[_0x0036('0x2b')],'authorization':_0x4e7d91[_0x0036('0x3b')]};var _0x2f3447={'method':'POST','uri':_0x0036('0x3c'),'body':_0x32a9b9,'json':!![]};rp(_0x2f3447)['then'](function(_0x29717b){var _0x16c508={'messageId':_0x29717b['requestid']};if(!_0x4e7d91[_0x0036('0x36')]){_0x16c508[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x16c508);})[_0x0036('0x1a')](function(_0x541e21){logger[_0x0036('0x1b')](_0x0036('0x26'),'afterCreate',_0x0036('0x3a'),util[_0x0036('0x25')](_0x541e21,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x3a'),'Missing\x20parameters:\x20authToken');}break;case _0x0036('0x3d'):if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){var _0x32a9b9={'messages':[{'source':_0x0036('0x3e'),'to':_0x276149[_0x0036('0x2b')],'body':_0x276149[_0x0036('0xc')],'from':_0x4e7d91[_0x0036('0x3f')]||_0x4e7d91[_0x0036('0x2b')]}]};var _0x36cf75=util['format'](_0x0036('0x40'),_0x4e7d91[_0x0036('0x29')],_0x4e7d91[_0x0036('0x2a')]);var _0x2f3447={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x32a9b9,'headers':{'Authorization':util[_0x0036('0x41')](_0x0036('0x42'),new Buffer(_0x36cf75)['toString'](_0x0036('0x43')))},'json':!![]};rp(_0x2f3447)[_0x0036('0x17')](function(_0x2db433){if(_0x2db433[_0x0036('0x44')]>=0xc8&&_0x2db433[_0x0036('0x44')]<=0xce){if(_0x2db433['data']&&_0x2db433[_0x0036('0x45')][_0x0036('0x46')]>0x0){var _0x403ef3=_['head'](_0x2db433['data'][_0x0036('0x47')]);var _0x21dddc={'messageId':_0x403ef3['message_id']};if(!_0x4e7d91[_0x0036('0x36')]){_0x21dddc[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x21dddc);}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x48'),util['inspect'](_0x2db433,{'showHidden':![],'depth':null}));}}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x48'),util[_0x0036('0x25')](_0x2db433,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x48145d){logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),'clickSend',util[_0x0036('0x25')](_0x48145d,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x48'),_0x0036('0x39'));}break;case _0x0036('0x49'):if(_0x4e7d91[_0x0036('0x4a')]&&_0x4e7d91['authToken']){var _0x32a9b9={'dst':_0x276149[_0x0036('0x2b')],'text':_0x276149[_0x0036('0xc')],'src':_0x4e7d91[_0x0036('0x3f')]||_0x4e7d91[_0x0036('0x2b')],'url':_0x4e7d91[_0x0036('0x4b')]+_0x0036('0x4c')+_0x276149['id']+_0x0036('0x22')+_0x4e7d91['token']};var _0x36cf75=util[_0x0036('0x41')](_0x0036('0x40'),_0x4e7d91[_0x0036('0x4a')],_0x4e7d91[_0x0036('0x3b')]);var _0x2f3447={'method':_0x0036('0x4d'),'uri':util[_0x0036('0x41')](_0x0036('0x4e'),_0x4e7d91[_0x0036('0x4a')]),'body':_0x32a9b9,'headers':{'Authorization':util[_0x0036('0x41')](_0x0036('0x42'),new Buffer(_0x36cf75)[_0x0036('0x4f')](_0x0036('0x43')))},'json':!![]};rp(_0x2f3447)['then'](function(_0x1a8f89){var _0x190373={'messageId':_0x1a8f89[_0x0036('0x50')][0x0]};return _0x36d092[_0x0036('0x18')](_0x190373);})['catch'](function(_0x5bd575){logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),'plivo',util[_0x0036('0x25')](_0x5bd575,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x49'),_0x0036('0x51'));}break;case _0x0036('0x52'):if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){if(_0x4e7d91[_0x0036('0x53')]){var _0xba121f={'method':_0x0036('0x4d'),'uri':_0x4e7d91[_0x0036('0x53')]+_0x0036('0x54'),'body':{'username':_0x4e7d91['username'],'password':_0x4e7d91[_0x0036('0x2a')]},'json':!![]};return rp(_0xba121f)[_0x0036('0x17')](function(_0x1cc369){var _0x5960c5={'method':'POST','uri':_0x4e7d91['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x4e7d91[_0x0036('0x2b')],'destinations':[{'to':_0x276149[_0x0036('0x2b')]}],'text':_0x276149[_0x0036('0xc')],'notifyUrl':_0x4e7d91['remote']+_0x0036('0x4c')+_0x276149['id']+'/status?token='+_0x4e7d91['token'],'notifyContentType':'application/json','callbackData':_0x4e7d91['phone']+';'+_0x276149[_0x0036('0xc')]}]},'headers':{'Authorization':_0x0036('0x55')+_0x1cc369[_0x0036('0x23')]},'json':!![]};return rp(_0x5960c5)[_0x0036('0x17')](function(_0x56a6c9){if(_0x56a6c9['messages']){var _0x49b570={'messageId':_0x56a6c9['messages'][0x0][_0x0036('0xa')]};if(!_0x4e7d91[_0x0036('0x36')]){_0x49b570[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x49b570);}else{return logger['error'](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x52'),util[_0x0036('0x25')](_0x56a6c9,{'showHidden':![],'depth':null}));}});})[_0x0036('0x1a')](function(_0x9b14d3){return logger['error'](_0x0036('0x26'),'afterCreate',_0x0036('0x52'),util[_0x0036('0x25')](_0x9b14d3,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x52'),_0x0036('0x39'));}break;case _0x0036('0x56'):var _0x3139c6=require('crypto');if(_0x4e7d91[_0x0036('0x57')]){var _0x3c62cd={};_0x3c62cd[_0x0036('0x58')]=_0x4e7d91[_0x0036('0x29')];_0x3c62cd[_0x0036('0x2b')]=_0x276149[_0x0036('0x2b')];_0x3c62cd[_0x0036('0x2d')]=_0x4e7d91[_0x0036('0x2b')];_0x3c62cd['text']=_0x276149['body'];_0x3c62cd['timestamp']=+new Date();var _0x56440='';var _0x5b2cf8='';var _0x2fa66b=Object[_0x0036('0x59')](_0x3c62cd);_0x2fa66b['sort']();for(var _0x44bdd0=0x0;_0x44bdd0<_0x2fa66b[_0x0036('0x5a')];_0x44bdd0++){if(_0x56440!=''){_0x56440+='&';}_0x56440+=_0x2fa66b[_0x44bdd0]+'='+encodeURIComponent(_0x3c62cd[_0x2fa66b[_0x44bdd0]]);_0x5b2cf8+=_0x3c62cd[_0x2fa66b[_0x44bdd0]];}_0x5b2cf8+=_0x4e7d91[_0x0036('0x57')];_0x5b2cf8=_0x3139c6[_0x0036('0x5b')](_0x0036('0x5c'))[_0x0036('0x18')](_0x5b2cf8)[_0x0036('0x5d')](_0x0036('0x5e'));if(_0x56440!==''){_0x56440+='&';}_0x56440+='signature='+_0x5b2cf8;var _0x5d1243={'method':_0x0036('0x2f'),'uri':_0x4e7d91[_0x0036('0x53')]+_0x0036('0x5f')+_0x56440,'json':!![]};return rp(_0x5d1243)[_0x0036('0x17')](function(_0xd3b487){var _0x11385c=Object[_0x0036('0x59')](_0xd3b487);if(_0xd3b487[_0x11385c[0x0]][_0x0036('0x1b')]&&parseInt(_0xd3b487[_0x11385c[0x0]][_0x0036('0x1b')])===0x0){var _0x12690e={'messageId':_0xd3b487[_0x11385c[0x0]][_0x0036('0x60')]};if(!_0x4e7d91['deliveryReport']){_0x12690e[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x12690e);}else{return logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x56'),util[_0x0036('0x25')](_0xd3b487[_0x0036('0x1b')],{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x1011bd){return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x56'),util[_0x0036('0x25')](_0x1011bd,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),'afterCreate','csc',_0x0036('0x61'));}break;case'clickatell':if(_0x4e7d91[_0x0036('0x57')]){var _0x5ebf33={'method':_0x0036('0x4d'),'uri':_0x0036('0x62'),'headers':{'Authorization':_0x4e7d91[_0x0036('0x57')]},'body':{'content':_0x276149[_0x0036('0xc')],'to':[_0x276149['phone']],'from':_0x4e7d91[_0x0036('0x2b')],'binary':![],'clientMessageId':_0x0036('0x63'),'charset':'UTF-8'},'json':!![]};rp(_0x5ebf33)[_0x0036('0x17')](function(_0x3a8d73){if(!_0x3a8d73[_0x0036('0x1b')]){var _0x196643={'messageId':_0x3a8d73[_0x0036('0x47')][0x0][_0x0036('0x64')]};if(!_0x4e7d91[_0x0036('0x36')]){_0x196643[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x196643);}else{return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x65'),util[_0x0036('0x25')](_0x3a8d73[_0x0036('0x1b')],{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x35c69a){return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x65'),util[_0x0036('0x25')](_0x35c69a,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x65'),_0x0036('0x61'));}break;case _0x0036('0x66'):if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){var _0x36cf75=util[_0x0036('0x41')](_0x0036('0x40'),_0x4e7d91[_0x0036('0x29')],_0x4e7d91[_0x0036('0x2a')]);var _0x2f3447={'method':'POST','uri':_0x0036('0x67')+_0x4e7d91['accountId']+_0x0036('0x68'),'body':{'to':[_0x276149[_0x0036('0x2b')]],'text':_0x276149[_0x0036('0xc')],'from':_0x4e7d91[_0x0036('0x2b')],'applicationId':_0x4e7d91['applicationId']},'headers':{'Authorization':util[_0x0036('0x41')](_0x0036('0x42'),new Buffer(_0x36cf75)[_0x0036('0x4f')]('base64'))},'json':!![]};rp(_0x2f3447)[_0x0036('0x17')](function(_0x1bad50){if(_0x1bad50['id']){var _0x53826e={'messageId':_0x1bad50['id']};return _0x36d092[_0x0036('0x18')](_0x53826e);}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x66'),util['inspect'](_0x1bad50,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x329aaa){logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x66'),util['inspect'](_0x329aaa,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x66'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0036('0x69'):if(_0x4e7d91[_0x0036('0x57')]){var _0x2e4dce={};var _0x5d1243={'method':_0x0036('0x4d'),'uri':_0x0036('0x6a'),'headers':{'Authorization':_0x0036('0x6b')+_0x4e7d91[_0x0036('0x57')],'Content-Type':_0x0036('0x6c')},'body':{'from':_0x4e7d91[_0x0036('0x2b')],'to':_0x276149[_0x0036('0x2b')],'text':_0x276149[_0x0036('0xc')]},'json':!![]};return rp(_0x5d1243)[_0x0036('0x17')](function(_0x58d84f){if(_0x58d84f['code']==0xca){_0x2e4dce['message']=_0x58d84f;var _0x3d3297={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0036('0x6b')+_0x4e7d91[_0x0036('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x2e4dce[_0x0036('0x6d')][_0x0036('0x6e')]},'json':!![]};return rp(_0x3d3297)[_0x0036('0x17')](function(_0x33d49f){_0x2e4dce['status']=_0x33d49f;var _0x924b30={'messageId':_0x2e4dce['message'][_0x0036('0x6e')],'read':!![]};return _0x36d092[_0x0036('0x18')](_0x924b30);});}else{return logger[_0x0036('0x1b')](_0x0036('0x26'),'afterCreate','intelepeer',util[_0x0036('0x25')](_0x58d84f,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x5e9c38){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x69'),util[_0x0036('0x25')](_0x5e9c38,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x69'),_0x0036('0x6f'));}break;}}})[_0x0036('0x70')](function(){_0x3ac2f9();});}else{_0x3ac2f9();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index c719a54..70bd840 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94f0=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','CreateSmsMessage','SmsMessage','create','body','options','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug'];(function(_0x3a8b69,_0x5c9fe2){var _0x17897c=function(_0x3e5b40){while(--_0x3e5b40){_0x3a8b69['push'](_0x3a8b69['shift']());}};_0x17897c(++_0x5c9fe2);}(_0x94f0,0x1a5));var _0x094f=function(_0x35335f,_0x472815){_0x35335f=_0x35335f-0x0;var _0x27068d=_0x94f0[_0x35335f];return _0x27068d;};'use strict';var _=require('lodash');var util=require(_0x094f('0x0'));var moment=require(_0x094f('0x1'));var BPromise=require(_0x094f('0x2'));var rs=require(_0x094f('0x3'));var fs=require('fs');var Redis=require(_0x094f('0x4'));var db=require(_0x094f('0x5'))['db'];var utils=require(_0x094f('0x6'));var logger=require(_0x094f('0x7'))(_0x094f('0x8'));var config=require(_0x094f('0x9'));var jayson=require(_0x094f('0xa'));var client=jayson['client'][_0x094f('0xb')]({'port':0x232a});config[_0x094f('0xc')]=_[_0x094f('0xd')](config[_0x094f('0xc')],{'host':_0x094f('0xe'),'port':0x18eb});var socket=require(_0x094f('0xf'))(new Redis(config[_0x094f('0xc')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3132a6,_0x3d7e5d,_0x29805a){return new BPromise(function(_0x5aeacd,_0x9410ed){return client[_0x094f('0x10')](_0x3132a6,_0x29805a)[_0x094f('0x11')](function(_0x30d6ba){logger[_0x094f('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3d7e5d,_0x094f('0x13'));logger[_0x094f('0x14')](_0x094f('0x15'),_0x3d7e5d,_0x094f('0x13'),JSON[_0x094f('0x16')](_0x30d6ba));if(_0x30d6ba[_0x094f('0x17')]){if(_0x30d6ba[_0x094f('0x17')][_0x094f('0x18')]===0x1f4){logger[_0x094f('0x17')](_0x094f('0x19'),_0x3d7e5d,_0x30d6ba[_0x094f('0x17')][_0x094f('0x1a')]);return _0x9410ed(_0x30d6ba[_0x094f('0x17')][_0x094f('0x1a')]);}logger[_0x094f('0x17')](_0x094f('0x19'),_0x3d7e5d,_0x30d6ba[_0x094f('0x17')][_0x094f('0x1a')]);return _0x5aeacd(_0x30d6ba[_0x094f('0x17')][_0x094f('0x1a')]);}else{logger[_0x094f('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3d7e5d,_0x094f('0x13'));_0x5aeacd(_0x30d6ba[_0x094f('0x1b')][_0x094f('0x1a')]);}})['catch'](function(_0x299002){logger[_0x094f('0x17')](_0x094f('0x19'),_0x3d7e5d,_0x299002);_0x9410ed(_0x299002);});});}exports[_0x094f('0x1c')]=function(_0x24c8be){var _0x3e409a=this;return new Promise(function(_0x1deecb,_0x3be334){return db[_0x094f('0x1d')][_0x094f('0x1e')](_0x24c8be[_0x094f('0x1f')],{'raw':_0x24c8be[_0x094f('0x20')]?_0x24c8be['options']['raw']===undefined?!![]:![]:!![]})[_0x094f('0x11')](function(_0x190026){logger['info'](_0x094f('0x1c'),_0x24c8be);logger['debug'](_0x094f('0x1c'),_0x24c8be,JSON[_0x094f('0x16')](_0x190026));_0x1deecb(_0x190026);})[_0x094f('0x21')](function(_0x173441){logger[_0x094f('0x17')](_0x094f('0x1c'),_0x173441[_0x094f('0x1a')],_0x24c8be);_0x3be334(_0x3e409a[_0x094f('0x17')](0x1f4,_0x173441[_0x094f('0x1a')]));});});}; \ No newline at end of file +var _0xd060=['create','body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x32c04b,_0x187085){var _0x2947b1=function(_0x3dc2b4){while(--_0x3dc2b4){_0x32c04b['push'](_0x32c04b['shift']());}};_0x2947b1(++_0x187085);}(_0xd060,0x140));var _0x0d06=function(_0xfc775e,_0x342a76){_0xfc775e=_0xfc775e-0x0;var _0x4c4a40=_0xd060[_0xfc775e];return _0x4c4a40;};'use strict';var _=require('lodash');var util=require(_0x0d06('0x0'));var moment=require(_0x0d06('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d06('0x2'));var fs=require('fs');var Redis=require(_0x0d06('0x3'));var db=require(_0x0d06('0x4'))['db'];var utils=require(_0x0d06('0x5'));var logger=require(_0x0d06('0x6'))(_0x0d06('0x7'));var config=require(_0x0d06('0x8'));var jayson=require(_0x0d06('0x9'));var client=jayson[_0x0d06('0xa')][_0x0d06('0xb')]({'port':0x232a});config[_0x0d06('0xc')]=_['defaults'](config[_0x0d06('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d06('0xd'))(new Redis(config['redis']));require(_0x0d06('0xe'))[_0x0d06('0xf')](socket);function respondWithRpcPromise(_0x500005,_0x3e709a,_0x588d6a){return new BPromise(function(_0x2df518,_0x887b0a){return client[_0x0d06('0x10')](_0x500005,_0x588d6a)[_0x0d06('0x11')](function(_0x323880){logger[_0x0d06('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x0d06('0x13'));logger[_0x0d06('0x14')](_0x0d06('0x15'),_0x3e709a,_0x0d06('0x13'),JSON['stringify'](_0x323880));if(_0x323880['error']){if(_0x323880['error'][_0x0d06('0x16')]===0x1f4){logger[_0x0d06('0x17')]('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x323880[_0x0d06('0x17')][_0x0d06('0x18')]);return _0x887b0a(_0x323880[_0x0d06('0x17')][_0x0d06('0x18')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x323880[_0x0d06('0x17')]['message']);return _0x2df518(_0x323880['error'][_0x0d06('0x18')]);}else{logger[_0x0d06('0x12')](_0x0d06('0x19'),_0x3e709a,_0x0d06('0x13'));_0x2df518(_0x323880[_0x0d06('0x1a')][_0x0d06('0x18')]);}})[_0x0d06('0x1b')](function(_0x5b9edd){logger[_0x0d06('0x17')]('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x5b9edd);_0x887b0a(_0x5b9edd);});});}exports[_0x0d06('0x1c')]=function(_0x312433){var _0x4abef7=this;return new Promise(function(_0x80e288,_0x5cc8f9){return db[_0x0d06('0x1d')][_0x0d06('0x1e')](_0x312433[_0x0d06('0x1f')],{'raw':_0x312433[_0x0d06('0x20')]?_0x312433[_0x0d06('0x20')][_0x0d06('0x21')]===undefined?!![]:![]:!![]})[_0x0d06('0x11')](function(_0x1779af){logger[_0x0d06('0x12')](_0x0d06('0x1c'),_0x312433);logger['debug'](_0x0d06('0x1c'),_0x312433,JSON[_0x0d06('0x22')](_0x1779af));_0x80e288(_0x1779af);})['catch'](function(_0x415d54){logger[_0x0d06('0x17')]('CreateSmsMessage',_0x415d54[_0x0d06('0x18')],_0x312433);_0x5cc8f9(_0x4abef7[_0x0d06('0x17')](0x1f4,_0x415d54[_0x0d06('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 179c105..5a704cc 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0573=['removeListener','register','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x0573,0x1db));var _0x3057=function(_0xf0402b,_0x48c1ff){_0xf0402b=_0xf0402b-0x0;var _0x28ea11=_0x0573[_0xf0402b];return _0x28ea11;};'use strict';var SmsMessageEvents=require(_0x3057('0x0'));var events=[_0x3057('0x1'),_0x3057('0x2'),_0x3057('0x3')];function createListener(_0x57ffad,_0x4c09b8){return function(_0x536946){_0x4c09b8[_0x3057('0x4')](_0x57ffad,_0x536946);};}function removeListener(_0x56ab28,_0x1889eb){return function(){SmsMessageEvents[_0x3057('0x5')](_0x56ab28,_0x1889eb);};}exports[_0x3057('0x6')]=function(_0x2dfb8c){for(var _0x27b918=0x0,_0x4c93d3=events['length'];_0x27b918<_0x4c93d3;_0x27b918++){var _0x20bb46=events[_0x27b918];var _0x3320bf=createListener(_0x3057('0x7')+_0x20bb46,_0x2dfb8c);SmsMessageEvents['on'](_0x20bb46,_0x3320bf);}}; \ No newline at end of file +var _0x6ac1=['length','smsMessage:','./smsMessage.events','save','update','emit','register'];(function(_0x207785,_0x40e205){var _0x332792=function(_0x7cd13f){while(--_0x7cd13f){_0x207785['push'](_0x207785['shift']());}};_0x332792(++_0x40e205);}(_0x6ac1,0x113));var _0x16ac=function(_0x40cdc3,_0x76825d){_0x40cdc3=_0x40cdc3-0x0;var _0x5bda2b=_0x6ac1[_0x40cdc3];return _0x5bda2b;};'use strict';var SmsMessageEvents=require(_0x16ac('0x0'));var events=[_0x16ac('0x1'),'remove',_0x16ac('0x2')];function createListener(_0x5f1ca9,_0x578892){return function(_0x52fa43){_0x578892[_0x16ac('0x3')](_0x5f1ca9,_0x52fa43);};}function removeListener(_0x32f020,_0x4c0763){return function(){SmsMessageEvents['removeListener'](_0x32f020,_0x4c0763);};}exports[_0x16ac('0x4')]=function(_0x461617){for(var _0xb247a6=0x0,_0x23b200=events[_0x16ac('0x5')];_0xb247a6<_0x23b200;_0xb247a6++){var _0x23ad4b=events[_0xb247a6];var _0x33899a=createListener(_0x16ac('0x6')+_0x23ad4b,_0x461617);SmsMessageEvents['on'](_0x23ad4b,_0x33899a);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b3e6adf..f717c5c 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb33=['../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','isAuthenticated','describe','show','getMembers','/:id/teams','getTeams','create','addTeams','post','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xfb33,0x19d));var _0x3fb3=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xfb33[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0x3fb3('0x0'));var util=require(_0x3fb3('0x1'));var path=require(_0x3fb3('0x2'));var timeout=require(_0x3fb3('0x3'));var express=require(_0x3fb3('0x4'));var router=express['Router']();var fs_extra=require(_0x3fb3('0x5'));var auth=require(_0x3fb3('0x6'));var interaction=require(_0x3fb3('0x7'));var config=require(_0x3fb3('0x8'));var controller=require(_0x3fb3('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3fb3('0xa')]);router[_0x3fb3('0xb')]('/describe',auth[_0x3fb3('0xc')](),controller[_0x3fb3('0xd')]);router[_0x3fb3('0xb')]('/:id',auth[_0x3fb3('0xc')](),controller[_0x3fb3('0xe')]);router[_0x3fb3('0xb')]('/:id/members',auth[_0x3fb3('0xc')](),controller[_0x3fb3('0xf')]);router[_0x3fb3('0xb')](_0x3fb3('0x10'),auth[_0x3fb3('0xc')](),controller[_0x3fb3('0x11')]);router[_0x3fb3('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x3fb3('0xc')](),controller[_0x3fb3('0x12')]);router['post']('/:id/teams',auth[_0x3fb3('0xc')](),controller[_0x3fb3('0x13')]);router[_0x3fb3('0x14')](_0x3fb3('0x15'),auth[_0x3fb3('0xc')](),controller[_0x3fb3('0x16')]);router[_0x3fb3('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x3fb3('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3fb3('0x19')](_0x3fb3('0x10'),auth[_0x3fb3('0xc')](),controller['removeTeams']);router[_0x3fb3('0x19')](_0x3fb3('0x15'),auth['isAuthenticated'](),controller[_0x3fb3('0x1a')]);module[_0x3fb3('0x1b')]=router; \ No newline at end of file +var _0xb914=['get','isAuthenticated','index','/describe','describe','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','delete','destroy','/:id/teams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xb914,0x83));var _0x4b91=function(_0x54aff6,_0xc4c096){_0x54aff6=_0x54aff6-0x0;var _0x487a36=_0xb914[_0x54aff6];return _0x487a36;};'use strict';var multer=require(_0x4b91('0x0'));var util=require(_0x4b91('0x1'));var path=require(_0x4b91('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b91('0x3'));var router=express[_0x4b91('0x4')]();var fs_extra=require(_0x4b91('0x5'));var auth=require(_0x4b91('0x6'));var interaction=require(_0x4b91('0x7'));var config=require('../../config/environment');var controller=require(_0x4b91('0x8'));router[_0x4b91('0x9')]('/',auth[_0x4b91('0xa')](),controller[_0x4b91('0xb')]);router[_0x4b91('0x9')](_0x4b91('0xc'),auth['isAuthenticated'](),controller[_0x4b91('0xd')]);router['get']('/:id',auth[_0x4b91('0xa')](),controller['show']);router[_0x4b91('0x9')]('/:id/members',auth[_0x4b91('0xa')](),controller[_0x4b91('0xe')]);router[_0x4b91('0x9')]('/:id/teams',auth[_0x4b91('0xa')](),controller['getTeams']);router[_0x4b91('0x9')]('/:id/users',auth[_0x4b91('0xa')](),controller[_0x4b91('0xf')]);router[_0x4b91('0x10')]('/',auth['isAuthenticated'](),controller[_0x4b91('0x11')]);router[_0x4b91('0x10')]('/:id/teams',auth[_0x4b91('0xa')](),controller[_0x4b91('0x12')]);router[_0x4b91('0x10')](_0x4b91('0x13'),auth[_0x4b91('0xa')](),controller[_0x4b91('0x14')]);router[_0x4b91('0x15')](_0x4b91('0x16'),auth[_0x4b91('0xa')](),controller['update']);router[_0x4b91('0x17')](_0x4b91('0x16'),auth[_0x4b91('0xa')](),controller[_0x4b91('0x18')]);router['delete'](_0x4b91('0x19'),auth[_0x4b91('0xa')](),controller['removeTeams']);router[_0x4b91('0x17')](_0x4b91('0x13'),auth[_0x4b91('0xa')](),controller[_0x4b91('0x1a')]);module[_0x4b91('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 165d2b5..4437163 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f85=['exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9f85,0x8a));var _0x59f8=function(_0x142e05,_0x1a871f){_0x142e05=_0x142e05-0x0;var _0x4ba176=_0x9f85[_0x142e05];return _0x4ba176;};'use strict';var Sequelize=require('sequelize');module[_0x59f8('0x0')]={'name':{'type':Sequelize[_0x59f8('0x1')],'unique':_0x59f8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x59f8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x59f8('0x4')](_0x59f8('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x28fe=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2f4b9f,_0x47a25d){var _0x1439cd=function(_0x437913){while(--_0x437913){_0x2f4b9f['push'](_0x2f4b9f['shift']());}};_0x1439cd(++_0x47a25d);}(_0x28fe,0x142));var _0xe28f=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x28fe[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require(_0xe28f('0x0'));module[_0xe28f('0x1')]={'name':{'type':Sequelize[_0xe28f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe28f('0x2')]},'timeout':{'type':Sequelize[_0xe28f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe28f('0x4')](_0xe28f('0x5'),_0xe28f('0x6'),_0xe28f('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a0fda6e..d4cdb21 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1103=['all','union','compact','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','length','options','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','getMembers','findOne','UserSmsQueue','rawAttributes','findAll','User','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1103,0x97));var _0x3110=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1103[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3110('0x0'));var zipdir=require(_0x3110('0x1'));var jsonpatch=require(_0x3110('0x2'));var rp=require(_0x3110('0x3'));var moment=require(_0x3110('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3110('0x5'));var util=require(_0x3110('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3110('0x7'));var ejs=require(_0x3110('0x8'));var fs=require('fs');var fs_extra=require(_0x3110('0x9'));var _=require(_0x3110('0xa'));var squel=require(_0x3110('0xb'));var crypto=require(_0x3110('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3110('0x7'));var querystring=require('querystring');var Papa=require(_0x3110('0xd'));var Redis=require(_0x3110('0xe'));var authService=require(_0x3110('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3110('0x10'));var hardwareService=require(_0x3110('0x11'));var logger=require(_0x3110('0x12'))('api');var utils=require(_0x3110('0x13'));var config=require(_0x3110('0x14'));var licenseUtil=require(_0x3110('0x15'));var db=require('../../mysqldb')['db'];config[_0x3110('0x16')]=_[_0x3110('0x17')](config[_0x3110('0x16')],{'host':_0x3110('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3110('0x16')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x3c2d82,_0x560483){_0x560483=_0x560483||0xcc;return function(_0x5b3998){if(_0x5b3998){return _0x3c2d82[_0x3110('0x19')](_0x560483);}return _0x3c2d82['status'](_0x560483)[_0x3110('0x1a')]();};}function respondWithResult(_0x1a042e,_0x3651ed){_0x3651ed=_0x3651ed||0xc8;return function(_0x3b6d3f){if(_0x3b6d3f){return _0x1a042e[_0x3110('0x1b')](_0x3651ed)[_0x3110('0x1c')](_0x3b6d3f);}};}function respondWithFilteredResult(_0x648967,_0x34bc26){return function(_0x534c46){if(_0x534c46){var _0x2a583a=typeof _0x34bc26[_0x3110('0x1d')]===_0x3110('0x1e')&&typeof _0x34bc26[_0x3110('0x1f')]===_0x3110('0x1e');var _0x178b37=_0x534c46['count'];var _0x26844a=_0x2a583a?0x0:_0x34bc26[_0x3110('0x1d')];var _0x2b0906=_0x2a583a?_0x534c46['count']:_0x34bc26[_0x3110('0x1d')]+_0x34bc26[_0x3110('0x1f')];var _0x2dac6d;if(_0x2b0906>=_0x178b37){_0x2b0906=_0x178b37;_0x2dac6d=0xc8;}else{_0x2dac6d=0xce;}_0x648967['status'](_0x2dac6d);return _0x648967[_0x3110('0x20')](_0x3110('0x21'),_0x26844a+'-'+_0x2b0906+'/'+_0x178b37)[_0x3110('0x1c')](_0x534c46);}return null;};}function patchUpdates(_0x1c98af){return function(_0xf37b91){try{jsonpatch[_0x3110('0x22')](_0xf37b91,_0x1c98af,!![]);}catch(_0x9ad721){return BPromise['reject'](_0x9ad721);}return _0xf37b91[_0x3110('0x23')]();};}function saveUpdates(_0x284f5c,_0x80132f){return function(_0x2b8b06){if(_0x2b8b06){return _0x2b8b06[_0x3110('0x24')](_0x284f5c)[_0x3110('0x25')](function(_0x4fa2cb){return _0x4fa2cb;});}return null;};}function removeEntity(_0x5f2c68,_0x27f145){return function(_0x2aab25){if(_0x2aab25){return _0x2aab25[_0x3110('0x26')]()['then'](function(){var _0x2f0f6b=_0x2aab25[_0x3110('0x27')]({'plain':!![]});var _0x223f41=_0x3110('0x28');return db[_0x3110('0x29')][_0x3110('0x26')]({'where':{'type':_0x223f41,'resourceId':_0x2f0f6b['id']}})[_0x3110('0x25')](function(){return _0x2aab25;});})[_0x3110('0x25')](function(){_0x5f2c68[_0x3110('0x1b')](0xcc)[_0x3110('0x1a')]();});}};}function handleEntityNotFound(_0x2f4a92,_0x2b6fc1){return function(_0x16e825){if(!_0x16e825){_0x2f4a92[_0x3110('0x19')](0x194);}return _0x16e825;};}function handleError(_0x52b7fa,_0x545072){_0x545072=_0x545072||0x1f4;return function(_0x2c7eb5){logger[_0x3110('0x2a')](_0x2c7eb5[_0x3110('0x2b')]);if(_0x2c7eb5[_0x3110('0x2c')]){delete _0x2c7eb5[_0x3110('0x2c')];}_0x52b7fa['status'](_0x545072)[_0x3110('0x2d')](_0x2c7eb5);};}exports[_0x3110('0x2e')]=function(_0x4a6644,_0x4c65ed){var _0x1d0901={},_0x4461cb={},_0x1e2c8f={'count':0x0,'rows':[]};var _0x5c8e2a=_[_0x3110('0x2f')](db[_0x3110('0x30')]['rawAttributes'],function(_0x248388){return{'name':_0x248388[_0x3110('0x31')],'type':_0x248388[_0x3110('0x32')][_0x3110('0x33')]};});_0x4461cb[_0x3110('0x34')]=_[_0x3110('0x2f')](_0x5c8e2a,_0x3110('0x2c'));_0x4461cb[_0x3110('0x35')]=_[_0x3110('0x36')](_0x4a6644[_0x3110('0x35')]);_0x4461cb[_0x3110('0x37')]=_['intersection'](_0x4461cb[_0x3110('0x34')],_0x4461cb[_0x3110('0x35')]);_0x1d0901[_0x3110('0x38')]=_[_0x3110('0x39')](_0x4461cb[_0x3110('0x34')],qs[_0x3110('0x3a')](_0x4a6644[_0x3110('0x35')][_0x3110('0x3a')]));_0x1d0901[_0x3110('0x38')]=_0x1d0901[_0x3110('0x38')]['length']?_0x1d0901[_0x3110('0x38')]:_0x4461cb[_0x3110('0x34')];if(!_0x4a6644[_0x3110('0x35')][_0x3110('0x3b')](_0x3110('0x3c'))){_0x1d0901[_0x3110('0x1f')]=qs[_0x3110('0x1f')](_0x4a6644['query'][_0x3110('0x1f')]);_0x1d0901[_0x3110('0x1d')]=qs[_0x3110('0x1d')](_0x4a6644[_0x3110('0x35')]['offset']);}_0x1d0901[_0x3110('0x3d')]=qs['sort'](_0x4a6644['query'][_0x3110('0x3e')]);_0x1d0901[_0x3110('0x3f')]=qs[_0x3110('0x37')](_[_0x3110('0x40')](_0x4a6644[_0x3110('0x35')],_0x4461cb[_0x3110('0x37')]),_0x5c8e2a);if(_0x4a6644[_0x3110('0x35')][_0x3110('0x41')]){_0x1d0901['where']=_[_0x3110('0x42')](_0x1d0901['where'],{'$or':_[_0x3110('0x2f')](_0x5c8e2a,function(_0x5ae959){if(_0x5ae959[_0x3110('0x32')]!==_0x3110('0x43')){var _0x388943={};_0x388943[_0x5ae959[_0x3110('0x2c')]]={'$like':'%'+_0x4a6644[_0x3110('0x35')][_0x3110('0x41')]+'%'};return _0x388943;}})});}_0x1d0901=_[_0x3110('0x42')]({},_0x1d0901,_0x4a6644['options']);var _0x43b374={'where':_0x1d0901['where']};return db[_0x3110('0x30')][_0x3110('0x44')](_0x43b374)[_0x3110('0x25')](function(_0x2f2272){_0x1e2c8f[_0x3110('0x44')]=_0x2f2272;if(_0x4a6644[_0x3110('0x35')][_0x3110('0x45')]){_0x1d0901[_0x3110('0x46')]=[{'all':!![]}];}return db[_0x3110('0x30')]['findAll'](_0x1d0901);})['then'](function(_0x4122c2){_0x1e2c8f[_0x3110('0x47')]=_0x4122c2;return _0x1e2c8f;})[_0x3110('0x25')](respondWithFilteredResult(_0x4c65ed,_0x1d0901))[_0x3110('0x48')](handleError(_0x4c65ed,null));};exports[_0x3110('0x49')]=function(_0x11abc1,_0x5662c8){var _0x3031eb={'raw':!![],'where':{'id':_0x11abc1[_0x3110('0x4a')]['id']}},_0x3c3731={};_0x3c3731[_0x3110('0x34')]=_[_0x3110('0x36')](db[_0x3110('0x30')]['rawAttributes']);_0x3c3731[_0x3110('0x35')]=_[_0x3110('0x36')](_0x11abc1[_0x3110('0x35')]);_0x3c3731[_0x3110('0x37')]=_[_0x3110('0x39')](_0x3c3731[_0x3110('0x34')],_0x3c3731[_0x3110('0x35')]);_0x3031eb['attributes']=_[_0x3110('0x39')](_0x3c3731[_0x3110('0x34')],qs['fields'](_0x11abc1[_0x3110('0x35')]['fields']));_0x3031eb[_0x3110('0x38')]=_0x3031eb['attributes'][_0x3110('0x4b')]?_0x3031eb['attributes']:_0x3c3731[_0x3110('0x34')];if(_0x11abc1[_0x3110('0x35')][_0x3110('0x45')]){_0x3031eb[_0x3110('0x46')]=[{'all':!![]}];}_0x3031eb=_['merge']({},_0x3031eb,_0x11abc1[_0x3110('0x4c')]);return db['SmsQueue'][_0x3110('0x4d')](_0x3031eb)['then'](handleEntityNotFound(_0x5662c8,null))[_0x3110('0x25')](respondWithResult(_0x5662c8,null))['catch'](handleError(_0x5662c8,null));};exports[_0x3110('0x4e')]=function(_0x3ec77e,_0x4383c9){return db[_0x3110('0x30')][_0x3110('0x4e')](_0x3ec77e['body'],{})[_0x3110('0x25')](function(_0x572fa7){var _0x15a699=_0x3ec77e[_0x3110('0x4f')][_0x3110('0x27')]({'plain':!![]});if(!_0x15a699)throw new Error(_0x3110('0x50'));if(_0x15a699[_0x3110('0x51')]===_0x3110('0x4f')){var _0x2417db=_0x572fa7[_0x3110('0x27')]({'plain':!![]});var _0x366c97=_0x3110('0x28');return db[_0x3110('0x52')]['find']({'where':{'name':_0x366c97,'userProfileId':_0x15a699[_0x3110('0x53')]},'raw':!![]})[_0x3110('0x25')](function(_0x31e766){if(_0x31e766&&_0x31e766[_0x3110('0x54')]===0x0){return db[_0x3110('0x29')][_0x3110('0x4e')]({'name':_0x2417db[_0x3110('0x2c')],'resourceId':_0x2417db['id'],'type':_0x31e766[_0x3110('0x2c')],'sectionId':_0x31e766['id']},{})[_0x3110('0x25')](function(){return _0x572fa7;});}else{return _0x572fa7;}})[_0x3110('0x48')](function(_0x1dcf46){logger[_0x3110('0x2a')](_0x3110('0x55'),_0x1dcf46);throw _0x1dcf46;});}return _0x572fa7;})['then'](respondWithResult(_0x4383c9,0xc9))[_0x3110('0x48')](handleError(_0x4383c9,null));};exports[_0x3110('0x24')]=function(_0x346752,_0x1b4bbc){if(_0x346752[_0x3110('0x56')]['id']){delete _0x346752['body']['id'];}return db[_0x3110('0x30')][_0x3110('0x4d')]({'where':{'id':_0x346752[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](handleEntityNotFound(_0x1b4bbc,null))[_0x3110('0x25')](saveUpdates(_0x346752[_0x3110('0x56')],null))[_0x3110('0x25')](respondWithResult(_0x1b4bbc,null))['catch'](handleError(_0x1b4bbc,null));};exports[_0x3110('0x26')]=function(_0x40446b,_0xf6b55b){return db[_0x3110('0x30')]['find']({'where':{'id':_0x40446b[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](handleEntityNotFound(_0xf6b55b,null))['then'](removeEntity(_0xf6b55b,null))['catch'](handleError(_0xf6b55b,null));};exports[_0x3110('0x57')]=function(_0x57a98e,_0x28f0d9){return db[_0x3110('0x30')][_0x3110('0x57')]()['then'](respondWithResult(_0x28f0d9,null))['catch'](handleError(_0x28f0d9,null));};exports[_0x3110('0x58')]=function(_0x524cf3,_0x2fbdc4,_0x478670){var _0x4382cc={'raw':!![],'where':{}},_0x409d5a={},_0x136b71;return db[_0x3110('0x30')][_0x3110('0x59')]({'where':{'id':_0x524cf3[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](handleEntityNotFound(_0x2fbdc4,null))[_0x3110('0x25')](function(_0x178ea1){if(_0x178ea1){_0x136b71=_0x178ea1[_0x3110('0x27')]({'plain':!![]});_0x409d5a[_0x3110('0x34')]=_[_0x3110('0x36')](db[_0x3110('0x5a')][_0x3110('0x5b')]);_0x409d5a[_0x3110('0x35')]=_[_0x3110('0x36')](_0x524cf3['query']);_0x409d5a[_0x3110('0x37')]=_[_0x3110('0x39')](_0x409d5a[_0x3110('0x34')],_0x409d5a[_0x3110('0x35')]);_0x4382cc['attributes']=_[_0x3110('0x39')](_0x409d5a[_0x3110('0x34')],qs[_0x3110('0x3a')](_0x524cf3['query']['fields']));_0x4382cc['attributes']=_0x4382cc[_0x3110('0x38')]['length']?_0x4382cc['attributes']:_0x409d5a[_0x3110('0x34')];if(!_0x524cf3['query'][_0x3110('0x3b')](_0x3110('0x3c'))){_0x4382cc[_0x3110('0x1f')]=qs[_0x3110('0x1f')](_0x524cf3[_0x3110('0x35')][_0x3110('0x1f')]);_0x4382cc[_0x3110('0x1d')]=qs[_0x3110('0x1d')](_0x524cf3[_0x3110('0x35')][_0x3110('0x1d')]);}_0x4382cc['order']=qs[_0x3110('0x3e')](_0x524cf3[_0x3110('0x35')][_0x3110('0x3e')]);_0x4382cc[_0x3110('0x3f')]=qs['filters'](_[_0x3110('0x40')](_0x524cf3[_0x3110('0x35')],_0x409d5a[_0x3110('0x37')]));_0x4382cc['where']['SmsQueueId']=_0x178ea1['id'];if(_0x524cf3[_0x3110('0x35')]['filter']){_0x4382cc['where']=_[_0x3110('0x42')](_0x4382cc[_0x3110('0x3f')],{'$or':_[_0x3110('0x2f')](_0x4382cc[_0x3110('0x38')],function(_0x1814ad){var _0x1e585e={};_0x1e585e[_0x1814ad]={'$like':'%'+_0x524cf3[_0x3110('0x35')][_0x3110('0x41')]+'%'};return _0x1e585e;})});}_0x4382cc=_[_0x3110('0x42')]({},_0x4382cc,_0x524cf3[_0x3110('0x4c')]);return db['UserSmsQueue'][_0x3110('0x5c')](_0x4382cc);}})[_0x3110('0x25')](function(_0x212a0e){if(_0x212a0e){return db[_0x3110('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x212a0e,'UserId'),'role':_0x3110('0x5e')},'attributes':['id',_0x3110('0x2c'),_0x3110('0x5f'),_0x3110('0x60'),'createdAt']});}})['then'](function(_0x2dad3f){if(_0x2dad3f){return{'count':_0x2dad3f[_0x3110('0x44')],'rows':_[_0x3110('0x2f')](_0x2dad3f[_0x3110('0x47')],function(_0xd6b5c1){return{'membername':_0xd6b5c1[_0x3110('0x2c')],'UserId':_0xd6b5c1['id'],'queue_name':_0x136b71['name'],'SmsQueueId':_0x136b71['id'],'interface':util[_0x3110('0x61')](_0x3110('0x62'),_0x3110('0x63'),_0xd6b5c1[_0x3110('0x2c')]),'penalty':0x0,'paused':_0xd6b5c1[_0x3110('0x5f')],'createdAt':_0xd6b5c1[_0x3110('0x64')],'updatedAt':_0xd6b5c1[_0x3110('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3110('0x25')](respondWithFilteredResult(_0x2fbdc4,_0x4382cc))[_0x3110('0x48')](handleError(_0x2fbdc4,null));};exports[_0x3110('0x65')]=function(_0x3e2acb,_0x1175e3,_0x2a53c4){var _0x1a269d={};var _0x2375e8={};var _0x5df4b5;var _0x512ac3;return db['SmsQueue']['findOne']({'where':{'id':_0x3e2acb[_0x3110('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1175e3,null))[_0x3110('0x25')](function(_0x4183d4){if(_0x4183d4){_0x5df4b5=_0x4183d4;_0x2375e8[_0x3110('0x34')]=_[_0x3110('0x36')](db[_0x3110('0x66')]['rawAttributes']);_0x2375e8[_0x3110('0x35')]=_[_0x3110('0x36')](_0x3e2acb[_0x3110('0x35')]);_0x2375e8[_0x3110('0x37')]=_['intersection'](_0x2375e8['model'],_0x2375e8[_0x3110('0x35')]);_0x1a269d[_0x3110('0x38')]=_['intersection'](_0x2375e8[_0x3110('0x34')],qs[_0x3110('0x3a')](_0x3e2acb[_0x3110('0x35')][_0x3110('0x3a')]));_0x1a269d[_0x3110('0x38')]=_0x1a269d['attributes'][_0x3110('0x4b')]?_0x1a269d[_0x3110('0x38')]:_0x2375e8['model'];_0x1a269d['order']=qs[_0x3110('0x3e')](_0x3e2acb[_0x3110('0x35')][_0x3110('0x3e')]);_0x1a269d['where']=qs[_0x3110('0x37')](_['pick'](_0x3e2acb[_0x3110('0x35')],_0x2375e8[_0x3110('0x37')]));if(_0x3e2acb['query']['filter']){_0x1a269d[_0x3110('0x3f')]=_[_0x3110('0x42')](_0x1a269d[_0x3110('0x3f')],{'$or':_[_0x3110('0x2f')](_0x1a269d[_0x3110('0x38')],function(_0xdcf20){var _0x4276a5={};_0x4276a5[_0xdcf20]={'$like':'%'+_0x3e2acb[_0x3110('0x35')]['filter']+'%'};return _0x4276a5;})});}_0x1a269d=_[_0x3110('0x42')]({},_0x1a269d,_0x3e2acb['options']);return _0x5df4b5[_0x3110('0x65')](_0x1a269d);}})[_0x3110('0x25')](function(_0x3b9468){if(_0x3b9468){_0x512ac3=_0x3b9468[_0x3110('0x4b')];if(!_0x3e2acb[_0x3110('0x35')]['hasOwnProperty'](_0x3110('0x3c'))){_0x1a269d['limit']=qs[_0x3110('0x1f')](_0x3e2acb[_0x3110('0x35')]['limit']);_0x1a269d['offset']=qs[_0x3110('0x1d')](_0x3e2acb['query'][_0x3110('0x1d')]);}return _0x5df4b5[_0x3110('0x65')](_0x1a269d);}})[_0x3110('0x25')](function(_0x1569dd){if(_0x1569dd){return _0x1569dd?{'count':_0x512ac3,'rows':_0x1569dd}:null;}})['then'](respondWithResult(_0x1175e3,null))[_0x3110('0x48')](handleError(_0x1175e3,null));};exports[_0x3110('0x67')]=function(_0x501785,_0x5c3648,_0x1f355e){var _0x404040=_0x501785[_0x3110('0x56')][_0x3110('0x68')];return db[_0x3110('0x66')]['findAll']({'where':{'id':_0x404040},'attributes':['id'],'include':[{'model':db[_0x3110('0x5d')],'as':_0x3110('0x69'),'attributes':['id',_0x3110('0x2c'),_0x3110('0x6a'),_0x3110('0x6b'),'interface'],'raw':!![]}]})[_0x3110('0x25')](function(_0x47c305){if(_0x47c305){var _0x23bab3=_['flatMap'](_0x47c305,function(_0x493868){var _0x41a022=_0x493868[_0x3110('0x27')]({'plain':!![]});return _0x41a022['Agents'];});return db[_0x3110('0x30')][_0x3110('0x4d')]({'where':{'id':_0x501785[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](function(_0x34d401){return db[_0x3110('0x6c')]['transaction'](function(_0x23ada9){return _0x34d401[_0x3110('0x67')](_0x404040,{'transaction':_0x23ada9})[_0x3110('0x25')](function(){return BPromise[_0x3110('0x6d')](_0x23bab3,function(_0x1f19b9){return db[_0x3110('0x5a')][_0x3110('0x6e')]({'where':{'UserId':_0x1f19b9['id'],'SmsQueueId':_0x501785['params']['id']},'transaction':_0x23ada9});});})[_0x3110('0x25')](function(){_0x23bab3[_0x3110('0x6f')](function(_0x3e2fab){socket[_0x3110('0x70')](_0x3110('0x71'),{'UserId':_0x3e2fab['id'],'SmsQueueId':_0x34d401['id']});});});});});}})['then'](respondWithStatusCode(_0x5c3648,null))['catch'](handleError(_0x5c3648,null));};exports['removeTeams']=function(_0x515b20,_0x2e82b7,_0x569c59){return db[_0x3110('0x66')][_0x3110('0x5c')]({'where':{'id':_0x515b20['query'][_0x3110('0x68')]},'attributes':['id'],'include':[{'model':db[_0x3110('0x5d')],'as':_0x3110('0x69'),'attributes':['id'],'raw':!![]}]})[_0x3110('0x25')](handleEntityNotFound(_0x2e82b7,null))[_0x3110('0x25')](function(_0x490d64){var _0x538b2c=_[_0x3110('0x2f')](_0x490d64,'id');var _0x4484aa=[];var _0x2d8852=[];var _0x4663fd=squel[_0x3110('0x72')]();_0x4663fd[_0x3110('0x73')](_0x3110('0x74'))[_0x3110('0x75')](_0x3110('0x76'),'tq')[_0x3110('0x77')]('user_has_teams','ut',_0x3110('0x78'))[_0x3110('0x3f')]('SmsQueueId\x20=\x20?',_0x515b20['params']['id']);for(var _0x59c24b=0x0;_0x59c24b<_0x490d64['length'];_0x59c24b+=0x1){let _0x26dcdc=_0x490d64[_0x59c24b];for(var _0x27fc78=0x0;_0x27fc78<_0x26dcdc[_0x3110('0x69')][_0x3110('0x4b')];_0x27fc78+=0x1){let _0x2cd22f=_0x26dcdc[_0x3110('0x69')][_0x27fc78];var _0x2c383e=_0x4663fd['clone']();_0x2c383e[_0x3110('0x3f')](_0x3110('0x79'),_0x2cd22f['id']);_0x2d8852[_0x3110('0x7a')](db['sequelize']['query'](_0x2c383e[_0x3110('0x7b')](),{'type':db[_0x3110('0x6c')][_0x3110('0x7c')]['SELECT']})[_0x3110('0x25')](function(_0x231e2b){if(_0x231e2b[_0x3110('0x4b')]===0x1){return _0x2cd22f['id'];}else{var _0x37ccb8=_[_0x3110('0x7d')](_['map'](_0x231e2b,'TeamId'),function(_0x1b4cd4){return _[_0x3110('0x7e')](_0x538b2c,_0x1b4cd4);});if(_0x37ccb8){return _0x2cd22f['id'];}}}));}}return BPromise[_0x3110('0x7f')](_0x2d8852)[_0x3110('0x25')](function(_0x1fe005){_0x4484aa=_(_0x4484aa)[_0x3110('0x80')](_0x1fe005)[_0x3110('0x81')]()[_0x3110('0x82')]();return db[_0x3110('0x30')][_0x3110('0x4d')]({'where':{'id':_0x515b20[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](function(_0x14f859){return db[_0x3110('0x6c')][_0x3110('0x83')](function(_0xa04568){return _0x14f859['removeTeams'](_0x515b20[_0x3110('0x35')]['ids'],{'transaction':_0xa04568})[_0x3110('0x25')](function(){if(!_[_0x3110('0x84')](_0x4484aa)){return _0x14f859[_0x3110('0x85')](_0x4484aa,{'transaction':_0xa04568});}})[_0x3110('0x25')](function(){_0x4484aa['forEach'](function(_0x2937cf){socket['emit'](_0x3110('0x86'),{'UserId':_0x2937cf,'SmsQueueId':_0x14f859['id']});});});});});});})[_0x3110('0x25')](respondWithStatusCode(_0x2e82b7,null))[_0x3110('0x48')](handleError(_0x2e82b7,null));};exports[_0x3110('0x87')]=function(_0x26b3a6,_0x11c06f,_0x3f8ce3){return db[_0x3110('0x30')][_0x3110('0x4d')]({'where':{'id':_0x26b3a6[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](handleEntityNotFound(_0x11c06f,null))[_0x3110('0x25')](function(_0x3ee56a){if(_0x3ee56a){return _0x3ee56a[_0x3110('0x87')](_0x26b3a6[_0x3110('0x56')]['ids'],_[_0x3110('0x88')](_0x26b3a6[_0x3110('0x56')],[_0x3110('0x68'),'id'])||{})[_0x3110('0x89')](function(_0x527f01){for(var _0xda9a44=0x0;_0xda9a44<_0x26b3a6[_0x3110('0x56')]['ids']['length'];_0xda9a44+=0x1){socket[_0x3110('0x70')]('userSmsQueue:save',{'UserId':Number(_0x26b3a6[_0x3110('0x56')]['ids'][_0xda9a44]),'SmsQueueId':Number(_0x26b3a6['params']['id'])});}return _0x527f01;});}})[_0x3110('0x25')](respondWithResult(_0x11c06f,null))[_0x3110('0x48')](handleError(_0x11c06f,null));};exports[_0x3110('0x85')]=function(_0x696a67,_0x38e340,_0x3b08bf){return db[_0x3110('0x30')]['find']({'where':{'id':_0x696a67[_0x3110('0x4a')]['id']}})[_0x3110('0x25')](handleEntityNotFound(_0x38e340,null))[_0x3110('0x25')](function(_0x1fe78f){if(_0x1fe78f){return _0x1fe78f['removeAgents'](_0x696a67[_0x3110('0x35')]['ids'])[_0x3110('0x25')](function(){if(_['isArray'](_0x696a67[_0x3110('0x35')][_0x3110('0x68')])){for(var _0x4e1583=0x0;_0x4e1583<_0x696a67['query'][_0x3110('0x68')][_0x3110('0x4b')];_0x4e1583+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x696a67[_0x3110('0x35')][_0x3110('0x68')][_0x4e1583]),'SmsQueueId':Number(_0x696a67[_0x3110('0x4a')]['id'])});}}else{socket[_0x3110('0x70')](_0x3110('0x86'),{'UserId':Number(_0x696a67[_0x3110('0x35')][_0x3110('0x68')]),'SmsQueueId':Number(_0x696a67[_0x3110('0x4a')]['id'])});}});}})[_0x3110('0x25')](respondWithStatusCode(_0x38e340,null))[_0x3110('0x48')](handleError(_0x38e340,null));};exports['getAgents']=function(_0x2a8cd0,_0x454124,_0x38fc43){var _0x677448={};var _0x187ce0={};var _0x4371bb;var _0x499d09;return db['SmsQueue'][_0x3110('0x59')]({'where':{'id':_0x2a8cd0[_0x3110('0x4a')]['id']}})['then'](handleEntityNotFound(_0x454124,null))['then'](function(_0x4a249b){if(_0x4a249b){_0x4371bb=_0x4a249b;_0x187ce0[_0x3110('0x34')]=_[_0x3110('0x36')](db[_0x3110('0x5d')][_0x3110('0x5b')]);_0x187ce0[_0x3110('0x35')]=_['keys'](_0x2a8cd0['query']);_0x187ce0[_0x3110('0x37')]=_[_0x3110('0x39')](_0x187ce0[_0x3110('0x34')],_0x187ce0[_0x3110('0x35')]);_0x677448[_0x3110('0x38')]=_[_0x3110('0x39')](_0x187ce0[_0x3110('0x34')],qs[_0x3110('0x3a')](_0x2a8cd0[_0x3110('0x35')][_0x3110('0x3a')]));_0x677448[_0x3110('0x38')]=_0x677448[_0x3110('0x38')][_0x3110('0x4b')]?_0x677448['attributes']:_0x187ce0[_0x3110('0x34')];_0x677448[_0x3110('0x3d')]=qs[_0x3110('0x3e')](_0x2a8cd0['query']['sort']);_0x677448[_0x3110('0x3f')]=qs[_0x3110('0x37')](_[_0x3110('0x40')](_0x2a8cd0[_0x3110('0x35')],_0x187ce0[_0x3110('0x37')]));if(_0x2a8cd0[_0x3110('0x35')][_0x3110('0x41')]){_0x677448[_0x3110('0x3f')]=_[_0x3110('0x42')](_0x677448[_0x3110('0x3f')],{'$or':_['map'](_0x677448[_0x3110('0x38')],function(_0x153bc0){var _0xabf29f={};_0xabf29f[_0x153bc0]={'$like':'%'+_0x2a8cd0['query'][_0x3110('0x41')]+'%'};return _0xabf29f;})});}_0x677448=_['merge']({},_0x677448,_0x2a8cd0['options']);return _0x4371bb[_0x3110('0x8a')](_0x677448);}})[_0x3110('0x25')](function(_0x237f4d){if(_0x237f4d){_0x499d09=_0x237f4d['length'];if(!_0x2a8cd0['query']['hasOwnProperty'](_0x3110('0x3c'))){_0x677448['limit']=qs['limit'](_0x2a8cd0[_0x3110('0x35')][_0x3110('0x1f')]);_0x677448['offset']=qs[_0x3110('0x1d')](_0x2a8cd0[_0x3110('0x35')][_0x3110('0x1d')]);}return _0x4371bb[_0x3110('0x8a')](_0x677448);}})[_0x3110('0x25')](function(_0x45c5b5){if(_0x45c5b5){return _0x45c5b5?{'count':_0x499d09,'rows':_0x45c5b5}:null;}})['then'](respondWithResult(_0x454124,null))[_0x3110('0x48')](handleError(_0x454124,null));}; \ No newline at end of file +var _0x86bc=['voicePause','interface','flatMap','transaction','each','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','all','union','compact','forEach','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','map','SmsQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','catch','create','body','user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','nolimit','pick','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online'];(function(_0x2725ab,_0x469dcb){var _0xf77ae6=function(_0x3067ad){while(--_0x3067ad){_0x2725ab['push'](_0x2725ab['shift']());}};_0xf77ae6(++_0x469dcb);}(_0x86bc,0x1b1));var _0xc86b=function(_0x4a2bd2,_0x5bba90){_0x4a2bd2=_0x4a2bd2-0x0;var _0x25356a=_0x86bc[_0x4a2bd2];return _0x25356a;};'use strict';var emlformat=require(_0xc86b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc86b('0x1'));var jsonpatch=require(_0xc86b('0x2'));var rp=require(_0xc86b('0x3'));var moment=require(_0xc86b('0x4'));var BPromise=require(_0xc86b('0x5'));var Mustache=require(_0xc86b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc86b('0x7'));var csv=require('to-csv');var ejs=require(_0xc86b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc86b('0x9'));var crypto=require(_0xc86b('0xa'));var jsforce=require(_0xc86b('0xb'));var deskjs=require(_0xc86b('0xc'));var toCsv=require(_0xc86b('0xd'));var querystring=require('querystring');var Papa=require(_0xc86b('0xe'));var Redis=require(_0xc86b('0xf'));var authService=require(_0xc86b('0x10'));var qs=require(_0xc86b('0x11'));var as=require(_0xc86b('0x12'));var hardwareService=require(_0xc86b('0x13'));var logger=require(_0xc86b('0x14'))(_0xc86b('0x15'));var utils=require('../../config/utils');var config=require(_0xc86b('0x16'));var licenseUtil=require(_0xc86b('0x17'));var db=require(_0xc86b('0x18'))['db'];config['redis']=_[_0xc86b('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc86b('0x1a'))(new Redis(config[_0xc86b('0x1b')]));require('./smsQueue.socket')[_0xc86b('0x1c')](socket);function respondWithStatusCode(_0x59d5bf,_0x12dab3){_0x12dab3=_0x12dab3||0xcc;return function(_0x244fea){if(_0x244fea){return _0x59d5bf[_0xc86b('0x1d')](_0x12dab3);}return _0x59d5bf[_0xc86b('0x1e')](_0x12dab3)[_0xc86b('0x1f')]();};}function respondWithResult(_0x534b48,_0x360916){_0x360916=_0x360916||0xc8;return function(_0x22beec){if(_0x22beec){return _0x534b48[_0xc86b('0x1e')](_0x360916)[_0xc86b('0x20')](_0x22beec);}};}function respondWithFilteredResult(_0x53dcf3,_0x346ed7){return function(_0x42479a){if(_0x42479a){var _0x36d681=typeof _0x346ed7[_0xc86b('0x21')]==='undefined'&&typeof _0x346ed7[_0xc86b('0x22')]===_0xc86b('0x23');var _0x4c0a21=_0x42479a[_0xc86b('0x24')];var _0x2ade00=_0x36d681?0x0:_0x346ed7['offset'];var _0x58446d=_0x36d681?_0x42479a[_0xc86b('0x24')]:_0x346ed7['offset']+_0x346ed7[_0xc86b('0x22')];var _0x517b18;if(_0x58446d>=_0x4c0a21){_0x58446d=_0x4c0a21;_0x517b18=0xc8;}else{_0x517b18=0xce;}_0x53dcf3[_0xc86b('0x1e')](_0x517b18);return _0x53dcf3[_0xc86b('0x25')]('Content-Range',_0x2ade00+'-'+_0x58446d+'/'+_0x4c0a21)[_0xc86b('0x20')](_0x42479a);}return null;};}function patchUpdates(_0x4e0322){return function(_0xc71c29){try{jsonpatch[_0xc86b('0x26')](_0xc71c29,_0x4e0322,!![]);}catch(_0x276c72){return BPromise[_0xc86b('0x27')](_0x276c72);}return _0xc71c29['save']();};}function saveUpdates(_0x819baf,_0x1a2c27){return function(_0x212be7){if(_0x212be7){return _0x212be7[_0xc86b('0x28')](_0x819baf)[_0xc86b('0x29')](function(_0x4ef627){return _0x4ef627;});}return null;};}function removeEntity(_0x41b99c,_0x564f1){return function(_0xe7dc4b){if(_0xe7dc4b){return _0xe7dc4b[_0xc86b('0x2a')]()[_0xc86b('0x29')](function(){var _0x4d66bd=_0xe7dc4b[_0xc86b('0x2b')]({'plain':!![]});var _0x57c7fd=_0xc86b('0x2c');return db[_0xc86b('0x2d')][_0xc86b('0x2a')]({'where':{'type':_0x57c7fd,'resourceId':_0x4d66bd['id']}})[_0xc86b('0x29')](function(){return _0xe7dc4b;});})[_0xc86b('0x29')](function(){_0x41b99c[_0xc86b('0x1e')](0xcc)[_0xc86b('0x1f')]();});}};}function handleEntityNotFound(_0x259db7,_0x37fc26){return function(_0x35ca48){if(!_0x35ca48){_0x259db7[_0xc86b('0x1d')](0x194);}return _0x35ca48;};}function handleError(_0x5ca37b,_0x5101f0){_0x5101f0=_0x5101f0||0x1f4;return function(_0x58767a){logger[_0xc86b('0x2e')](_0x58767a['stack']);if(_0x58767a['name']){delete _0x58767a[_0xc86b('0x2f')];}_0x5ca37b[_0xc86b('0x1e')](_0x5101f0)[_0xc86b('0x30')](_0x58767a);};}exports[_0xc86b('0x31')]=function(_0x1597f7,_0x519770){var _0x56f3f5={},_0x115223={},_0x282301={'count':0x0,'rows':[]};var _0x9e4348=_[_0xc86b('0x32')](db[_0xc86b('0x33')][_0xc86b('0x34')],function(_0x42ca71){return{'name':_0x42ca71['fieldName'],'type':_0x42ca71[_0xc86b('0x35')]['key']};});_0x115223[_0xc86b('0x36')]=_[_0xc86b('0x32')](_0x9e4348,_0xc86b('0x2f'));_0x115223[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x1597f7['query']);_0x115223[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x115223[_0xc86b('0x36')],_0x115223['query']);_0x56f3f5[_0xc86b('0x3b')]=_['intersection'](_0x115223['model'],qs[_0xc86b('0x3c')](_0x1597f7['query']['fields']));_0x56f3f5[_0xc86b('0x3b')]=_0x56f3f5[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x56f3f5['attributes']:_0x115223['model'];if(!_0x1597f7[_0xc86b('0x37')][_0xc86b('0x3e')]('nolimit')){_0x56f3f5['limit']=qs[_0xc86b('0x22')](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x22')]);_0x56f3f5[_0xc86b('0x21')]=qs['offset'](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x21')]);}_0x56f3f5[_0xc86b('0x3f')]=qs[_0xc86b('0x40')](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x40')]);_0x56f3f5[_0xc86b('0x41')]=qs[_0xc86b('0x39')](_['pick'](_0x1597f7[_0xc86b('0x37')],_0x115223[_0xc86b('0x39')]),_0x9e4348);if(_0x1597f7[_0xc86b('0x37')][_0xc86b('0x42')]){_0x56f3f5[_0xc86b('0x41')]=_[_0xc86b('0x43')](_0x56f3f5[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x9e4348,function(_0x4105cb){if(_0x4105cb[_0xc86b('0x35')]!=='VIRTUAL'){var _0x132860={};_0x132860[_0x4105cb[_0xc86b('0x2f')]]={'$like':'%'+_0x1597f7['query'][_0xc86b('0x42')]+'%'};return _0x132860;}})});}_0x56f3f5=_[_0xc86b('0x43')]({},_0x56f3f5,_0x1597f7[_0xc86b('0x44')]);var _0x3e3ce5={'where':_0x56f3f5[_0xc86b('0x41')]};return db[_0xc86b('0x33')]['count'](_0x3e3ce5)['then'](function(_0x5d7693){_0x282301[_0xc86b('0x24')]=_0x5d7693;if(_0x1597f7[_0xc86b('0x37')][_0xc86b('0x45')]){_0x56f3f5[_0xc86b('0x46')]=[{'all':!![]}];}return db[_0xc86b('0x33')]['findAll'](_0x56f3f5);})['then'](function(_0x134e76){_0x282301['rows']=_0x134e76;return _0x282301;})[_0xc86b('0x29')](respondWithFilteredResult(_0x519770,_0x56f3f5))[_0xc86b('0x47')](handleError(_0x519770,null));};exports['show']=function(_0x45f33f,_0x5b5815){var _0x485671={'raw':!![],'where':{'id':_0x45f33f['params']['id']}},_0x55228c={};_0x55228c[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x33')]['rawAttributes']);_0x55228c['query']=_[_0xc86b('0x38')](_0x45f33f[_0xc86b('0x37')]);_0x55228c[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x55228c['model'],_0x55228c[_0xc86b('0x37')]);_0x485671[_0xc86b('0x3b')]=_['intersection'](_0x55228c[_0xc86b('0x36')],qs[_0xc86b('0x3c')](_0x45f33f['query'][_0xc86b('0x3c')]));_0x485671[_0xc86b('0x3b')]=_0x485671[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x485671[_0xc86b('0x3b')]:_0x55228c[_0xc86b('0x36')];if(_0x45f33f[_0xc86b('0x37')][_0xc86b('0x45')]){_0x485671[_0xc86b('0x46')]=[{'all':!![]}];}_0x485671=_[_0xc86b('0x43')]({},_0x485671,_0x45f33f[_0xc86b('0x44')]);return db[_0xc86b('0x33')]['find'](_0x485671)['then'](handleEntityNotFound(_0x5b5815,null))[_0xc86b('0x29')](respondWithResult(_0x5b5815,null))['catch'](handleError(_0x5b5815,null));};exports[_0xc86b('0x48')]=function(_0x28f9a6,_0x5e8bcc){return db['SmsQueue'][_0xc86b('0x48')](_0x28f9a6[_0xc86b('0x49')],{})[_0xc86b('0x29')](function(_0x405068){var _0x47c43a=_0x28f9a6[_0xc86b('0x4a')][_0xc86b('0x2b')]({'plain':!![]});if(!_0x47c43a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c43a[_0xc86b('0x4b')]===_0xc86b('0x4a')){var _0x40e35e=_0x405068[_0xc86b('0x2b')]({'plain':!![]});var _0x6f806c='SmsQueues';return db['UserProfileSection'][_0xc86b('0x4c')]({'where':{'name':_0x6f806c,'userProfileId':_0x47c43a['userProfileId']},'raw':!![]})['then'](function(_0x389bf3){if(_0x389bf3&&_0x389bf3['autoAssociation']===0x0){return db[_0xc86b('0x2d')][_0xc86b('0x48')]({'name':_0x40e35e[_0xc86b('0x2f')],'resourceId':_0x40e35e['id'],'type':_0x389bf3[_0xc86b('0x2f')],'sectionId':_0x389bf3['id']},{})['then'](function(){return _0x405068;});}else{return _0x405068;}})[_0xc86b('0x47')](function(_0x29d1d0){logger[_0xc86b('0x2e')](_0xc86b('0x4d'),_0x29d1d0);throw _0x29d1d0;});}return _0x405068;})[_0xc86b('0x29')](respondWithResult(_0x5e8bcc,0xc9))[_0xc86b('0x47')](handleError(_0x5e8bcc,null));};exports[_0xc86b('0x28')]=function(_0x435858,_0x186019){if(_0x435858[_0xc86b('0x49')]['id']){delete _0x435858[_0xc86b('0x49')]['id'];}return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x435858[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x186019,null))[_0xc86b('0x29')](saveUpdates(_0x435858[_0xc86b('0x49')],null))['then'](respondWithResult(_0x186019,null))['catch'](handleError(_0x186019,null));};exports[_0xc86b('0x2a')]=function(_0x4f26c1,_0x3cc6d8){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x4f26c1[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x3cc6d8,null))['then'](removeEntity(_0x3cc6d8,null))[_0xc86b('0x47')](handleError(_0x3cc6d8,null));};exports[_0xc86b('0x4f')]=function(_0x3a276b,_0x15516c){return db[_0xc86b('0x33')]['describe']()[_0xc86b('0x29')](respondWithResult(_0x15516c,null))[_0xc86b('0x47')](handleError(_0x15516c,null));};exports[_0xc86b('0x50')]=function(_0x468218,_0x15a461,_0x598df0){var _0x4e6219={'raw':!![],'where':{}},_0x403dfe={},_0x11077c;return db[_0xc86b('0x33')][_0xc86b('0x51')]({'where':{'id':_0x468218[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x15a461,null))[_0xc86b('0x29')](function(_0x1be7cf){if(_0x1be7cf){_0x11077c=_0x1be7cf['get']({'plain':!![]});_0x403dfe[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x52')][_0xc86b('0x34')]);_0x403dfe[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x468218['query']);_0x403dfe[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x403dfe[_0xc86b('0x36')],_0x403dfe['query']);_0x4e6219[_0xc86b('0x3b')]=_[_0xc86b('0x3a')](_0x403dfe['model'],qs[_0xc86b('0x3c')](_0x468218[_0xc86b('0x37')][_0xc86b('0x3c')]));_0x4e6219['attributes']=_0x4e6219[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x4e6219[_0xc86b('0x3b')]:_0x403dfe[_0xc86b('0x36')];if(!_0x468218['query'][_0xc86b('0x3e')](_0xc86b('0x53'))){_0x4e6219[_0xc86b('0x22')]=qs[_0xc86b('0x22')](_0x468218[_0xc86b('0x37')][_0xc86b('0x22')]);_0x4e6219[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x468218[_0xc86b('0x37')][_0xc86b('0x21')]);}_0x4e6219['order']=qs[_0xc86b('0x40')](_0x468218[_0xc86b('0x37')][_0xc86b('0x40')]);_0x4e6219[_0xc86b('0x41')]=qs[_0xc86b('0x39')](_[_0xc86b('0x54')](_0x468218[_0xc86b('0x37')],_0x403dfe['filters']));_0x4e6219[_0xc86b('0x41')][_0xc86b('0x55')]=_0x1be7cf['id'];if(_0x468218[_0xc86b('0x37')][_0xc86b('0x42')]){_0x4e6219['where']=_[_0xc86b('0x43')](_0x4e6219[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x4e6219[_0xc86b('0x3b')],function(_0x432d39){var _0x3a9022={};_0x3a9022[_0x432d39]={'$like':'%'+_0x468218[_0xc86b('0x37')]['filter']+'%'};return _0x3a9022;})});}_0x4e6219=_[_0xc86b('0x43')]({},_0x4e6219,_0x468218[_0xc86b('0x44')]);return db[_0xc86b('0x52')][_0xc86b('0x56')](_0x4e6219);}})[_0xc86b('0x29')](function(_0x4b126c){if(_0x4b126c){return db[_0xc86b('0x57')][_0xc86b('0x58')]({'where':{'id':_[_0xc86b('0x32')](_0x4b126c,_0xc86b('0x59')),'role':_0xc86b('0x5a')},'attributes':['id','name',_0xc86b('0x5b'),_0xc86b('0x5c'),_0xc86b('0x5d')]});}})['then'](function(_0x31b971){if(_0x31b971){return{'count':_0x31b971[_0xc86b('0x24')],'rows':_[_0xc86b('0x32')](_0x31b971['rows'],function(_0x137721){return{'membername':_0x137721['name'],'UserId':_0x137721['id'],'queue_name':_0x11077c[_0xc86b('0x2f')],'SmsQueueId':_0x11077c['id'],'interface':util[_0xc86b('0x5e')](_0xc86b('0x5f'),_0xc86b('0x60'),_0x137721['name']),'penalty':0x0,'paused':_0x137721['smsPause'],'createdAt':_0x137721['createdAt'],'updatedAt':_0x137721[_0xc86b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc86b('0x29')](respondWithFilteredResult(_0x15a461,_0x4e6219))[_0xc86b('0x47')](handleError(_0x15a461,null));};exports[_0xc86b('0x61')]=function(_0x593f4f,_0x2a017e,_0x159cad){var _0x49acc7={};var _0x3be667={};var _0x2984ac;var _0x4534f2;return db['SmsQueue'][_0xc86b('0x51')]({'where':{'id':_0x593f4f[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a017e,null))[_0xc86b('0x29')](function(_0x428fb7){if(_0x428fb7){_0x2984ac=_0x428fb7;_0x3be667[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x62')][_0xc86b('0x34')]);_0x3be667[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x593f4f[_0xc86b('0x37')]);_0x3be667['filters']=_[_0xc86b('0x3a')](_0x3be667['model'],_0x3be667[_0xc86b('0x37')]);_0x49acc7[_0xc86b('0x3b')]=_['intersection'](_0x3be667[_0xc86b('0x36')],qs['fields'](_0x593f4f[_0xc86b('0x37')]['fields']));_0x49acc7[_0xc86b('0x3b')]=_0x49acc7[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x49acc7[_0xc86b('0x3b')]:_0x3be667['model'];_0x49acc7['order']=qs[_0xc86b('0x40')](_0x593f4f[_0xc86b('0x37')][_0xc86b('0x40')]);_0x49acc7[_0xc86b('0x41')]=qs['filters'](_[_0xc86b('0x54')](_0x593f4f[_0xc86b('0x37')],_0x3be667[_0xc86b('0x39')]));if(_0x593f4f['query']['filter']){_0x49acc7[_0xc86b('0x41')]=_[_0xc86b('0x43')](_0x49acc7[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x49acc7[_0xc86b('0x3b')],function(_0x5ac108){var _0x271ddc={};_0x271ddc[_0x5ac108]={'$like':'%'+_0x593f4f[_0xc86b('0x37')][_0xc86b('0x42')]+'%'};return _0x271ddc;})});}_0x49acc7=_[_0xc86b('0x43')]({},_0x49acc7,_0x593f4f['options']);return _0x2984ac['getTeams'](_0x49acc7);}})[_0xc86b('0x29')](function(_0x20a6bf){if(_0x20a6bf){_0x4534f2=_0x20a6bf[_0xc86b('0x3d')];if(!_0x593f4f[_0xc86b('0x37')]['hasOwnProperty']('nolimit')){_0x49acc7['limit']=qs[_0xc86b('0x22')](_0x593f4f[_0xc86b('0x37')][_0xc86b('0x22')]);_0x49acc7[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x593f4f['query'][_0xc86b('0x21')]);}return _0x2984ac[_0xc86b('0x61')](_0x49acc7);}})[_0xc86b('0x29')](function(_0x494a77){if(_0x494a77){return _0x494a77?{'count':_0x4534f2,'rows':_0x494a77}:null;}})[_0xc86b('0x29')](respondWithResult(_0x2a017e,null))[_0xc86b('0x47')](handleError(_0x2a017e,null));};exports[_0xc86b('0x63')]=function(_0x2f628c,_0x16c138,_0x356664){var _0x303aa8=_0x2f628c[_0xc86b('0x49')][_0xc86b('0x64')];return db[_0xc86b('0x62')][_0xc86b('0x56')]({'where':{'id':_0x303aa8},'attributes':['id'],'include':[{'model':db[_0xc86b('0x57')],'as':_0xc86b('0x65'),'attributes':['id',_0xc86b('0x2f'),_0xc86b('0x66'),_0xc86b('0x67'),_0xc86b('0x68')],'raw':!![]}]})[_0xc86b('0x29')](function(_0x1d589d){if(_0x1d589d){var _0x1c3316=_[_0xc86b('0x69')](_0x1d589d,function(_0x21572e){var _0x4fd0af=_0x21572e[_0xc86b('0x2b')]({'plain':!![]});return _0x4fd0af[_0xc86b('0x65')];});return db[_0xc86b('0x33')]['find']({'where':{'id':_0x2f628c['params']['id']}})['then'](function(_0xc965f){return db['sequelize'][_0xc86b('0x6a')](function(_0x314233){return _0xc965f[_0xc86b('0x63')](_0x303aa8,{'transaction':_0x314233})['then'](function(){return BPromise[_0xc86b('0x6b')](_0x1c3316,function(_0x29ad21){return db[_0xc86b('0x52')]['findOrCreate']({'where':{'UserId':_0x29ad21['id'],'SmsQueueId':_0x2f628c['params']['id']},'transaction':_0x314233});});})[_0xc86b('0x29')](function(){_0x1c3316['forEach'](function(_0x39440f){socket[_0xc86b('0x6c')](_0xc86b('0x6d'),{'UserId':_0x39440f['id'],'SmsQueueId':_0xc965f['id']});});});});});}})[_0xc86b('0x29')](respondWithStatusCode(_0x16c138,null))[_0xc86b('0x47')](handleError(_0x16c138,null));};exports[_0xc86b('0x6e')]=function(_0x1ac7f9,_0x4b4cbb,_0x5db4d2){return db[_0xc86b('0x62')][_0xc86b('0x56')]({'where':{'id':_0x1ac7f9[_0xc86b('0x37')][_0xc86b('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc86b('0x65'),'attributes':['id'],'raw':!![]}]})[_0xc86b('0x29')](handleEntityNotFound(_0x4b4cbb,null))[_0xc86b('0x29')](function(_0x5d779f){var _0x5b30f3=_[_0xc86b('0x32')](_0x5d779f,'id');var _0x11787c=[];var _0x5f23e0=[];var _0x256d80=squel[_0xc86b('0x6f')]();_0x256d80[_0xc86b('0x70')](_0xc86b('0x71'))['from'](_0xc86b('0x72'),'tq')[_0xc86b('0x73')](_0xc86b('0x74'),'ut',_0xc86b('0x75'))[_0xc86b('0x41')]('SmsQueueId\x20=\x20?',_0x1ac7f9[_0xc86b('0x4e')]['id']);for(var _0x15996b=0x0;_0x15996b<_0x5d779f[_0xc86b('0x3d')];_0x15996b+=0x1){let _0x3a0f1d=_0x5d779f[_0x15996b];for(var _0x407be0=0x0;_0x407be0<_0x3a0f1d[_0xc86b('0x65')][_0xc86b('0x3d')];_0x407be0+=0x1){let _0x17a4bb=_0x3a0f1d[_0xc86b('0x65')][_0x407be0];var _0x1981a9=_0x256d80[_0xc86b('0x76')]();_0x1981a9[_0xc86b('0x41')](_0xc86b('0x77'),_0x17a4bb['id']);_0x5f23e0['push'](db[_0xc86b('0x78')][_0xc86b('0x37')](_0x1981a9[_0xc86b('0x79')](),{'type':db[_0xc86b('0x78')][_0xc86b('0x7a')][_0xc86b('0x7b')]})[_0xc86b('0x29')](function(_0x291219){if(_0x291219[_0xc86b('0x3d')]===0x1){return _0x17a4bb['id'];}else{var _0x5a58d9=_['every'](_[_0xc86b('0x32')](_0x291219,'TeamId'),function(_0x4ba809){return _['includes'](_0x5b30f3,_0x4ba809);});if(_0x5a58d9){return _0x17a4bb['id'];}}}));}}return BPromise[_0xc86b('0x7c')](_0x5f23e0)[_0xc86b('0x29')](function(_0x1ae55d){_0x11787c=_(_0x11787c)[_0xc86b('0x7d')](_0x1ae55d)[_0xc86b('0x7e')]()['value']();return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x1ac7f9['params']['id']}})[_0xc86b('0x29')](function(_0x59ce29){return db['sequelize'][_0xc86b('0x6a')](function(_0x569dec){return _0x59ce29[_0xc86b('0x6e')](_0x1ac7f9[_0xc86b('0x37')]['ids'],{'transaction':_0x569dec})[_0xc86b('0x29')](function(){if(!_['isEmpty'](_0x11787c)){return _0x59ce29['removeAgents'](_0x11787c,{'transaction':_0x569dec});}})['then'](function(){_0x11787c[_0xc86b('0x7f')](function(_0x5f03d){socket['emit'](_0xc86b('0x80'),{'UserId':_0x5f03d,'SmsQueueId':_0x59ce29['id']});});});});});});})['then'](respondWithStatusCode(_0x4b4cbb,null))[_0xc86b('0x47')](handleError(_0x4b4cbb,null));};exports['addAgents']=function(_0x3cac00,_0x4c5c12,_0x44b661){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x3cac00[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c5c12,null))[_0xc86b('0x29')](function(_0x43f556){if(_0x43f556){return _0x43f556[_0xc86b('0x81')](_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')],_[_0xc86b('0x82')](_0x3cac00[_0xc86b('0x49')],[_0xc86b('0x64'),'id'])||{})['spread'](function(_0x539077){for(var _0x3f90fe=0x0;_0x3f90fe<_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')][_0xc86b('0x3d')];_0x3f90fe+=0x1){socket['emit'](_0xc86b('0x6d'),{'UserId':Number(_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')][_0x3f90fe]),'SmsQueueId':Number(_0x3cac00[_0xc86b('0x4e')]['id'])});}return _0x539077;});}})[_0xc86b('0x29')](respondWithResult(_0x4c5c12,null))[_0xc86b('0x47')](handleError(_0x4c5c12,null));};exports['removeAgents']=function(_0x16a00f,_0x37444f,_0x177a8e){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x16a00f[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x37444f,null))[_0xc86b('0x29')](function(_0x155027){if(_0x155027){return _0x155027[_0xc86b('0x83')](_0x16a00f[_0xc86b('0x37')]['ids'])[_0xc86b('0x29')](function(){if(_[_0xc86b('0x84')](_0x16a00f[_0xc86b('0x37')][_0xc86b('0x64')])){for(var _0x4e27bb=0x0;_0x4e27bb<_0x16a00f[_0xc86b('0x37')]['ids'][_0xc86b('0x3d')];_0x4e27bb+=0x1){socket[_0xc86b('0x6c')](_0xc86b('0x80'),{'UserId':Number(_0x16a00f[_0xc86b('0x37')][_0xc86b('0x64')][_0x4e27bb]),'SmsQueueId':Number(_0x16a00f[_0xc86b('0x4e')]['id'])});}}else{socket[_0xc86b('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x16a00f['query']['ids']),'SmsQueueId':Number(_0x16a00f[_0xc86b('0x4e')]['id'])});}});}})[_0xc86b('0x29')](respondWithStatusCode(_0x37444f,null))['catch'](handleError(_0x37444f,null));};exports[_0xc86b('0x85')]=function(_0x570705,_0x3de6af,_0x325407){var _0x1d4f56={};var _0x297113={};var _0x547759;var _0x2ae6d3;return db['SmsQueue']['findOne']({'where':{'id':_0x570705[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x3de6af,null))[_0xc86b('0x29')](function(_0x5c37f6){if(_0x5c37f6){_0x547759=_0x5c37f6;_0x297113['model']=_[_0xc86b('0x38')](db[_0xc86b('0x57')][_0xc86b('0x34')]);_0x297113[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x570705[_0xc86b('0x37')]);_0x297113[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x297113[_0xc86b('0x36')],_0x297113[_0xc86b('0x37')]);_0x1d4f56[_0xc86b('0x3b')]=_[_0xc86b('0x3a')](_0x297113[_0xc86b('0x36')],qs[_0xc86b('0x3c')](_0x570705[_0xc86b('0x37')][_0xc86b('0x3c')]));_0x1d4f56[_0xc86b('0x3b')]=_0x1d4f56[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x1d4f56[_0xc86b('0x3b')]:_0x297113[_0xc86b('0x36')];_0x1d4f56[_0xc86b('0x3f')]=qs[_0xc86b('0x40')](_0x570705[_0xc86b('0x37')][_0xc86b('0x40')]);_0x1d4f56[_0xc86b('0x41')]=qs['filters'](_[_0xc86b('0x54')](_0x570705['query'],_0x297113[_0xc86b('0x39')]));if(_0x570705[_0xc86b('0x37')][_0xc86b('0x42')]){_0x1d4f56[_0xc86b('0x41')]=_['merge'](_0x1d4f56['where'],{'$or':_[_0xc86b('0x32')](_0x1d4f56[_0xc86b('0x3b')],function(_0x450f5c){var _0x49f911={};_0x49f911[_0x450f5c]={'$like':'%'+_0x570705[_0xc86b('0x37')][_0xc86b('0x42')]+'%'};return _0x49f911;})});}_0x1d4f56=_['merge']({},_0x1d4f56,_0x570705[_0xc86b('0x44')]);return _0x547759[_0xc86b('0x85')](_0x1d4f56);}})['then'](function(_0x24c34e){if(_0x24c34e){_0x2ae6d3=_0x24c34e['length'];if(!_0x570705[_0xc86b('0x37')][_0xc86b('0x3e')](_0xc86b('0x53'))){_0x1d4f56[_0xc86b('0x22')]=qs[_0xc86b('0x22')](_0x570705[_0xc86b('0x37')]['limit']);_0x1d4f56[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x570705[_0xc86b('0x37')][_0xc86b('0x21')]);}return _0x547759[_0xc86b('0x85')](_0x1d4f56);}})[_0xc86b('0x29')](function(_0x2f0a81){if(_0x2f0a81){return _0x2f0a81?{'count':_0x2ae6d3,'rows':_0x2f0a81}:null;}})['then'](respondWithResult(_0x3de6af,null))[_0xc86b('0x47')](handleError(_0x3de6af,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 73e20ea..b62b9c4 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ac6=['update','remove','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x587fe7,_0xe4bd7c){var _0x22db15=function(_0x582d10){while(--_0x582d10){_0x587fe7['push'](_0x587fe7['shift']());}};_0x22db15(++_0xe4bd7c);}(_0x5ac6,0x70));var _0x65ac=function(_0x403617,_0x1e1e85){_0x403617=_0x403617-0x0;var _0x4ded50=_0x5ac6[_0x403617];return _0x4ded50;};'use strict';var EventEmitter=require(_0x65ac('0x0'));var SmsQueue=require(_0x65ac('0x1'))['db'][_0x65ac('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x65ac('0x3')](0x0);var events={'afterCreate':_0x65ac('0x4'),'afterUpdate':_0x65ac('0x5'),'afterDestroy':_0x65ac('0x6')};function emitEvent(_0x2bdccf){return function(_0x4ab226,_0x310662,_0x3575e8){SmsQueueEvents['emit'](_0x2bdccf+':'+_0x4ab226['id'],_0x4ab226);SmsQueueEvents['emit'](_0x2bdccf,_0x4ab226);_0x3575e8(null);};}for(var e in events){if(events[_0x65ac('0x7')](e)){var event=events[e];SmsQueue[_0x65ac('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x489d=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x489d,0x178));var _0xd489=function(_0x4937b7,_0x30a7d7){_0x4937b7=_0x4937b7-0x0;var _0x4bf326=_0x489d[_0x4937b7];return _0x4bf326;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xd489('0x0'))['db'][_0xd489('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd489('0x2')](0x0);var events={'afterCreate':_0xd489('0x3'),'afterUpdate':'update','afterDestroy':_0xd489('0x4')};function emitEvent(_0x5bcc84){return function(_0x158e6f,_0x1b698d,_0x2f68db){SmsQueueEvents[_0xd489('0x5')](_0x5bcc84+':'+_0x158e6f['id'],_0x158e6f);SmsQueueEvents[_0xd489('0x5')](_0x5bcc84,_0x158e6f);_0x2f68db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xd489('0x6')](e,emitEvent(event));}}module[_0xd489('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 0030939..eb661d2 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7455=['moment','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define','sms_queues','util','../../config/logger','api'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x7455,0x17d));var _0x5745=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7455[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x5745('0x0'));var logger=require(_0x5745('0x1'))(_0x5745('0x2'));var moment=require(_0x5745('0x3'));var BPromise=require(_0x5745('0x4'));var rp=require(_0x5745('0x5'));var fs=require('fs');var path=require(_0x5745('0x6'));var rimraf=require(_0x5745('0x7'));var config=require('../../config/environment');var attributes=require(_0x5745('0x8'));module[_0x5745('0x9')]=function(_0x1868cd,_0x3c06e6){return _0x1868cd[_0x5745('0xa')]('SmsQueue',attributes,{'tableName':_0x5745('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93b6=['api','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x93b6,0x173));var _0x693b=function(_0x2e5fe6,_0x1ea59a){_0x2e5fe6=_0x2e5fe6-0x0;var _0x40f361=_0x93b6[_0x2e5fe6];return _0x40f361;};'use strict';var _=require(_0x693b('0x0'));var util=require(_0x693b('0x1'));var logger=require(_0x693b('0x2'))(_0x693b('0x3'));var moment=require('moment');var BPromise=require(_0x693b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x693b('0x5'));var rimraf=require(_0x693b('0x6'));var config=require(_0x693b('0x7'));var attributes=require(_0x693b('0x8'));module['exports']=function(_0x3cea6b,_0x38b1d4){return _0x3cea6b[_0x693b('0x9')](_0x693b('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 9a0b2d2..7f8a0a0 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d84=['redis','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowSmsQueue','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x1abb11,_0xd68915){var _0x149a9f=function(_0x5c74d5){while(--_0x5c74d5){_0x1abb11['push'](_0x1abb11['shift']());}};_0x149a9f(++_0xd68915);}(_0x4d84,0x132));var _0x44d8=function(_0x5bbb86,_0x31386a){_0x5bbb86=_0x5bbb86-0x0;var _0x41f61d=_0x4d84[_0x5bbb86];return _0x41f61d;};'use strict';var _=require(_0x44d8('0x0'));var util=require(_0x44d8('0x1'));var moment=require(_0x44d8('0x2'));var BPromise=require(_0x44d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44d8('0x4'));var db=require(_0x44d8('0x5'))['db'];var utils=require(_0x44d8('0x6'));var logger=require(_0x44d8('0x7'))(_0x44d8('0x8'));var config=require(_0x44d8('0x9'));var jayson=require(_0x44d8('0xa'));var client=jayson[_0x44d8('0xb')][_0x44d8('0xc')]({'port':0x232a});config['redis']=_[_0x44d8('0xd')](config[_0x44d8('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x44d8('0xf'))(new Redis(config[_0x44d8('0xe')]));require(_0x44d8('0x10'))['register'](socket);function respondWithRpcPromise(_0x445ed6,_0x581519,_0x2047f4){return new BPromise(function(_0x5b3480,_0x537ca7){return client['request'](_0x445ed6,_0x2047f4)[_0x44d8('0x11')](function(_0x22a9aa){logger[_0x44d8('0x12')](_0x44d8('0x13'),_0x581519,_0x44d8('0x14'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x581519,_0x44d8('0x14'),JSON['stringify'](_0x22a9aa));if(_0x22a9aa[_0x44d8('0x15')]){if(_0x22a9aa[_0x44d8('0x15')][_0x44d8('0x16')]===0x1f4){logger[_0x44d8('0x15')](_0x44d8('0x13'),_0x581519,_0x22a9aa[_0x44d8('0x15')][_0x44d8('0x17')]);return _0x537ca7(_0x22a9aa[_0x44d8('0x15')][_0x44d8('0x17')]);}logger[_0x44d8('0x15')](_0x44d8('0x13'),_0x581519,_0x22a9aa['error'][_0x44d8('0x17')]);return _0x5b3480(_0x22a9aa[_0x44d8('0x15')][_0x44d8('0x17')]);}else{logger[_0x44d8('0x12')](_0x44d8('0x13'),_0x581519,'request\x20sent');_0x5b3480(_0x22a9aa[_0x44d8('0x18')][_0x44d8('0x17')]);}})['catch'](function(_0x52f616){logger[_0x44d8('0x15')](_0x44d8('0x13'),_0x581519,_0x52f616);_0x537ca7(_0x52f616);});});}exports[_0x44d8('0x19')]=function(_0x121a8b){var _0x1e9c7c=this;return new Promise(function(_0x18c70c,_0x4f360a){return db[_0x44d8('0x1a')][_0x44d8('0x1b')]({'raw':_0x121a8b[_0x44d8('0x1c')]?_0x121a8b['options'][_0x44d8('0x1d')]===undefined?!![]:![]:!![],'where':_0x121a8b[_0x44d8('0x1c')]?_0x121a8b['options'][_0x44d8('0x1e')]||null:null,'attributes':_0x121a8b['options']?_0x121a8b[_0x44d8('0x1c')][_0x44d8('0x1f')]||null:null,'limit':_0x121a8b[_0x44d8('0x1c')]?_0x121a8b[_0x44d8('0x1c')][_0x44d8('0x20')]||null:null,'include':_0x121a8b[_0x44d8('0x1c')]?_0x121a8b['options'][_0x44d8('0x21')]?_[_0x44d8('0x22')](_0x121a8b[_0x44d8('0x1c')]['include'],function(_0x25a7cc){return{'model':db[_0x25a7cc['model']],'as':_0x25a7cc['as'],'attributes':_0x25a7cc[_0x44d8('0x1f')],'include':_0x25a7cc[_0x44d8('0x21')]?_['map'](_0x25a7cc['include'],function(_0x240710){return{'model':db[_0x240710[_0x44d8('0x23')]],'as':_0x240710['as'],'attributes':_0x240710['attributes'],'include':_0x240710['include']?_['map'](_0x240710['include'],function(_0x531546){return{'model':db[_0x531546[_0x44d8('0x23')]],'as':_0x531546['as'],'attributes':_0x531546[_0x44d8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cd3d1){logger[_0x44d8('0x12')](_0x44d8('0x19'),_0x121a8b);logger['debug']('GetSmsQueue',_0x121a8b,JSON[_0x44d8('0x24')](_0x3cd3d1));_0x18c70c(_0x3cd3d1);})[_0x44d8('0x25')](function(_0xe42665){logger['error']('GetSmsQueue',_0xe42665[_0x44d8('0x17')],_0x121a8b);_0x4f360a(_0x1e9c7c['error'](0x1f4,_0xe42665[_0x44d8('0x17')]));});});};exports[_0x44d8('0x26')]=function(_0x4363b3){var _0x5cc977=this;return new Promise(function(_0x3be457,_0xa78d50){return db[_0x44d8('0x1a')]['find']({'raw':_0x4363b3[_0x44d8('0x1c')]?_0x4363b3[_0x44d8('0x1c')][_0x44d8('0x1d')]===undefined?!![]:![]:!![],'where':_0x4363b3['options']?_0x4363b3[_0x44d8('0x1c')][_0x44d8('0x1e')]||null:null,'attributes':_0x4363b3[_0x44d8('0x1c')]?_0x4363b3[_0x44d8('0x1c')]['attributes']||null:null,'include':_0x4363b3[_0x44d8('0x1c')]?_0x4363b3['options'][_0x44d8('0x21')]?_['map'](_0x4363b3[_0x44d8('0x1c')][_0x44d8('0x21')],function(_0x5dc0c3){return{'model':db[_0x5dc0c3['model']],'as':_0x5dc0c3['as'],'attributes':_0x5dc0c3[_0x44d8('0x1f')],'include':_0x5dc0c3[_0x44d8('0x21')]?_[_0x44d8('0x22')](_0x5dc0c3[_0x44d8('0x21')],function(_0x4653e6){return{'model':db[_0x4653e6[_0x44d8('0x23')]],'as':_0x4653e6['as'],'attributes':_0x4653e6[_0x44d8('0x1f')],'include':_0x4653e6['include']?_[_0x44d8('0x22')](_0x4653e6[_0x44d8('0x21')],function(_0x1d77f9){return{'model':db[_0x1d77f9['model']],'as':_0x1d77f9['as'],'attributes':_0x1d77f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x44d8('0x11')](function(_0xcfb466){logger[_0x44d8('0x12')](_0x44d8('0x26'),_0x4363b3);logger[_0x44d8('0x27')](_0x44d8('0x26'),_0x4363b3,JSON[_0x44d8('0x24')](_0xcfb466));_0x3be457(_0xcfb466);})[_0x44d8('0x25')](function(_0x7715c1){logger[_0x44d8('0x15')](_0x44d8('0x26'),_0x7715c1['message'],_0x4363b3);_0xa78d50(_0x5cc977[_0x44d8('0x15')](0x1f4,_0x7715c1[_0x44d8('0x17')]));});});}; \ No newline at end of file +var _0xd22b=['request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','SmsQueue,\x20%s,\x20%s'];(function(_0x53931e,_0x1f5c9b){var _0x3f2e8c=function(_0x39f324){while(--_0x39f324){_0x53931e['push'](_0x53931e['shift']());}};_0x3f2e8c(++_0x1f5c9b);}(_0xd22b,0x16b));var _0xbd22=function(_0x51deea,_0x247904){_0x51deea=_0x51deea-0x0;var _0xaee237=_0xd22b[_0x51deea];return _0xaee237;};'use strict';var _=require(_0xbd22('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbd22('0x1'));var rs=require(_0xbd22('0x2'));var fs=require('fs');var Redis=require(_0xbd22('0x3'));var db=require(_0xbd22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd22('0x5'))(_0xbd22('0x6'));var config=require(_0xbd22('0x7'));var jayson=require(_0xbd22('0x8'));var client=jayson[_0xbd22('0x9')][_0xbd22('0xa')]({'port':0x232a});config[_0xbd22('0xb')]=_[_0xbd22('0xc')](config[_0xbd22('0xb')],{'host':_0xbd22('0xd'),'port':0x18eb});var socket=require(_0xbd22('0xe'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3f5f99,_0x1096ea,_0x19ea89){return new BPromise(function(_0xbd484c,_0x47f7b9){return client['request'](_0x3f5f99,_0x19ea89)[_0xbd22('0xf')](function(_0x240785){logger['info'](_0xbd22('0x10'),_0x1096ea,_0xbd22('0x11'));logger[_0xbd22('0x12')](_0xbd22('0x13'),_0x1096ea,_0xbd22('0x11'),JSON['stringify'](_0x240785));if(_0x240785[_0xbd22('0x14')]){if(_0x240785[_0xbd22('0x14')]['code']===0x1f4){logger[_0xbd22('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1096ea,_0x240785[_0xbd22('0x14')][_0xbd22('0x15')]);return _0x47f7b9(_0x240785['error'][_0xbd22('0x15')]);}logger[_0xbd22('0x14')](_0xbd22('0x10'),_0x1096ea,_0x240785['error'][_0xbd22('0x15')]);return _0xbd484c(_0x240785['error']['message']);}else{logger[_0xbd22('0x16')](_0xbd22('0x10'),_0x1096ea,_0xbd22('0x11'));_0xbd484c(_0x240785['result'][_0xbd22('0x15')]);}})[_0xbd22('0x17')](function(_0xd4c5ab){logger[_0xbd22('0x14')](_0xbd22('0x10'),_0x1096ea,_0xd4c5ab);_0x47f7b9(_0xd4c5ab);});});}exports['GetSmsQueue']=function(_0x1d6d90){var _0x300fb2=this;return new Promise(function(_0x2e265b,_0x5e03f9){return db[_0xbd22('0x18')][_0xbd22('0x19')]({'raw':_0x1d6d90['options']?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1c')]||null:null,'attributes':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1d')]||null:null,'limit':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1e')]||null:null,'include':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1f')]?_[_0xbd22('0x20')](_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1f')],function(_0x439adf){return{'model':db[_0x439adf['model']],'as':_0x439adf['as'],'attributes':_0x439adf[_0xbd22('0x1d')],'include':_0x439adf[_0xbd22('0x1f')]?_['map'](_0x439adf['include'],function(_0x40b192){return{'model':db[_0x40b192[_0xbd22('0x21')]],'as':_0x40b192['as'],'attributes':_0x40b192[_0xbd22('0x1d')],'include':_0x40b192[_0xbd22('0x1f')]?_[_0xbd22('0x20')](_0x40b192['include'],function(_0x2b5422){return{'model':db[_0x2b5422['model']],'as':_0x2b5422['as'],'attributes':_0x2b5422[_0xbd22('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbd22('0xf')](function(_0xe28415){logger['info'](_0xbd22('0x22'),_0x1d6d90);logger[_0xbd22('0x12')](_0xbd22('0x22'),_0x1d6d90,JSON['stringify'](_0xe28415));_0x2e265b(_0xe28415);})[_0xbd22('0x17')](function(_0x153121){logger[_0xbd22('0x14')](_0xbd22('0x22'),_0x153121[_0xbd22('0x15')],_0x1d6d90);_0x5e03f9(_0x300fb2[_0xbd22('0x14')](0x1f4,_0x153121['message']));});});};exports[_0xbd22('0x23')]=function(_0x61631){var _0xcc3fd=this;return new Promise(function(_0x23840d,_0x453134){return db[_0xbd22('0x18')][_0xbd22('0x24')]({'raw':_0x61631[_0xbd22('0x1a')]?_0x61631['options'][_0xbd22('0x1b')]===undefined?!![]:![]:!![],'where':_0x61631['options']?_0x61631[_0xbd22('0x1a')][_0xbd22('0x1c')]||null:null,'attributes':_0x61631[_0xbd22('0x1a')]?_0x61631[_0xbd22('0x1a')]['attributes']||null:null,'include':_0x61631['options']?_0x61631[_0xbd22('0x1a')][_0xbd22('0x1f')]?_['map'](_0x61631[_0xbd22('0x1a')][_0xbd22('0x1f')],function(_0x2826af){return{'model':db[_0x2826af[_0xbd22('0x21')]],'as':_0x2826af['as'],'attributes':_0x2826af[_0xbd22('0x1d')],'include':_0x2826af[_0xbd22('0x1f')]?_[_0xbd22('0x20')](_0x2826af[_0xbd22('0x1f')],function(_0x4f9c0e){return{'model':db[_0x4f9c0e[_0xbd22('0x21')]],'as':_0x4f9c0e['as'],'attributes':_0x4f9c0e['attributes'],'include':_0x4f9c0e[_0xbd22('0x1f')]?_['map'](_0x4f9c0e['include'],function(_0x111ede){return{'model':db[_0x111ede[_0xbd22('0x21')]],'as':_0x111ede['as'],'attributes':_0x111ede[_0xbd22('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbd22('0xf')](function(_0xbb3600){logger[_0xbd22('0x16')](_0xbd22('0x23'),_0x61631);logger[_0xbd22('0x12')](_0xbd22('0x23'),_0x61631,JSON[_0xbd22('0x25')](_0xbb3600));_0x23840d(_0xbb3600);})[_0xbd22('0x17')](function(_0x2779fc){logger[_0xbd22('0x14')]('ShowSmsQueue',_0x2779fc[_0xbd22('0x15')],_0x61631);_0x453134(_0xcc3fd[_0xbd22('0x14')](0x1f4,_0x2779fc[_0xbd22('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index cba1bf0..daa71ff 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3154=['register','length','save','remove','update','removeListener'];(function(_0x5e269a,_0x3c7c20){var _0x4f2acc=function(_0x536d13){while(--_0x536d13){_0x5e269a['push'](_0x5e269a['shift']());}};_0x4f2acc(++_0x3c7c20);}(_0x3154,0x18e));var _0x4315=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3154[_0x5a776b];return _0xbbef59;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x4315('0x0'),_0x4315('0x1'),_0x4315('0x2')];function createListener(_0x36aa25,_0x11885d){return function(_0x8264d1){_0x11885d['emit'](_0x36aa25,_0x8264d1);};}function removeListener(_0xe9fb3b,_0x4bd518){return function(){SmsQueueEvents[_0x4315('0x3')](_0xe9fb3b,_0x4bd518);};}exports[_0x4315('0x4')]=function(_0x283a04){for(var _0x8f9fbc=0x0,_0x4073d9=events[_0x4315('0x5')];_0x8f9fbc<_0x4073d9;_0x8f9fbc++){var _0x43c4b0=events[_0x8f9fbc];var _0x5a8445=createListener('smsQueue:'+_0x43c4b0,_0x283a04);SmsQueueEvents['on'](_0x43c4b0,_0x5a8445);}}; \ No newline at end of file +var _0x8ec6=['length','smsQueue:','./smsQueue.events','remove','register'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x8ec6,0x1ce));var _0x68ec=function(_0x31f824,_0x79833d){_0x31f824=_0x31f824-0x0;var _0x14b241=_0x8ec6[_0x31f824];return _0x14b241;};'use strict';var SmsQueueEvents=require(_0x68ec('0x0'));var events=['save',_0x68ec('0x1'),'update'];function createListener(_0x2a54e2,_0x45fa51){return function(_0x3c46f7){_0x45fa51['emit'](_0x2a54e2,_0x3c46f7);};}function removeListener(_0x39b6d5,_0x4dccbd){return function(){SmsQueueEvents['removeListener'](_0x39b6d5,_0x4dccbd);};}exports[_0x68ec('0x2')]=function(_0xc80a14){for(var _0x12dba2=0x0,_0x1a5a0e=events[_0x68ec('0x3')];_0x12dba2<_0x1a5a0e;_0x12dba2++){var _0x5a71e2=events[_0x12dba2];var _0x50b988=createListener(_0x68ec('0x4')+_0x5a71e2,_0xc80a14);SmsQueueEvents['on'](_0x5a71e2,_0x50b988);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 7e4904e..e68cff9 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0298=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','post','create','update'];(function(_0x5a7cd0,_0x24a81d){var _0x4ab236=function(_0x29c69e){while(--_0x29c69e){_0x5a7cd0['push'](_0x5a7cd0['shift']());}};_0x4ab236(++_0x24a81d);}(_0x0298,0x95));var _0x8029=function(_0xb8f8ba,_0x56a48f){_0xb8f8ba=_0xb8f8ba-0x0;var _0x426419=_0x0298[_0xb8f8ba];return _0x426419;};'use strict';var multer=require(_0x8029('0x0'));var util=require('util');var path=require(_0x8029('0x1'));var timeout=require(_0x8029('0x2'));var express=require(_0x8029('0x3'));var router=express[_0x8029('0x4')]();var fs_extra=require(_0x8029('0x5'));var auth=require(_0x8029('0x6'));var interaction=require(_0x8029('0x7'));var config=require(_0x8029('0x8'));var controller=require(_0x8029('0x9'));router['get']('/',auth[_0x8029('0xa')](),controller[_0x8029('0xb')]);router['get'](_0x8029('0xc'),auth[_0x8029('0xa')](),controller[_0x8029('0xd')]);router[_0x8029('0xe')](_0x8029('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8029('0x10')]('/',auth[_0x8029('0xa')](),controller[_0x8029('0x11')]);router['put']('/:id',auth[_0x8029('0xa')](),controller[_0x8029('0x12')]);router['delete'](_0x8029('0xf'),auth['isAuthenticated'](),controller[_0x8029('0x13')]);module[_0x8029('0x14')]=router; \ No newline at end of file +var _0x2f41=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x2f41,0x94));var _0x12f4=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x2f41[_0x1bc0ae];return _0x501104;};'use strict';var multer=require(_0x12f4('0x0'));var util=require(_0x12f4('0x1'));var path=require('path');var timeout=require(_0x12f4('0x2'));var express=require(_0x12f4('0x3'));var router=express['Router']();var fs_extra=require(_0x12f4('0x4'));var auth=require(_0x12f4('0x5'));var interaction=require(_0x12f4('0x6'));var config=require(_0x12f4('0x7'));var controller=require('./smsQueueReport.controller');router[_0x12f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x12f4('0x9')]);router[_0x12f4('0x8')](_0x12f4('0xa'),auth[_0x12f4('0xb')](),controller[_0x12f4('0xc')]);router[_0x12f4('0x8')](_0x12f4('0xd'),auth['isAuthenticated'](),controller[_0x12f4('0xe')]);router[_0x12f4('0xf')]('/',auth[_0x12f4('0xb')](),controller[_0x12f4('0x10')]);router[_0x12f4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x12f4('0x12')]);router['delete'](_0x12f4('0xd'),auth[_0x12f4('0xb')](),controller[_0x12f4('0x13')]);module[_0x12f4('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 6f8bb78..70f1e46 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e90=['DATE','sequelize','STRING'];(function(_0x455353,_0x36e376){var _0x18952f=function(_0xbf9937){while(--_0xbf9937){_0x455353['push'](_0x455353['shift']());}};_0x18952f(++_0x36e376);}(_0x8e90,0x11e));var _0x08e9=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0x8e90[_0x507597];return _0x110a0f;};'use strict';var moment=require('moment');var Sequelize=require(_0x08e9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x08e9('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x08e9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x08e9('0x2')]},'acceptAt':{'type':Sequelize[_0x08e9('0x2')]},'exitAt':{'type':Sequelize[_0x08e9('0x2')]},'reason':{'type':Sequelize[_0x08e9('0x1')]}}; \ No newline at end of file +var _0xb2cf=['exports','STRING','DATE','moment','sequelize'];(function(_0x2617cb,_0xebf82a){var _0x19468e=function(_0x33addb){while(--_0x33addb){_0x2617cb['push'](_0x2617cb['shift']());}};_0x19468e(++_0xebf82a);}(_0xb2cf,0x10c));var _0xfb2c=function(_0x2fa739,_0x2fb4e6){_0x2fa739=_0x2fa739-0x0;var _0x82118e=_0xb2cf[_0x2fa739];return _0x82118e;};'use strict';var moment=require(_0xfb2c('0x0'));var Sequelize=require(_0xfb2c('0x1'));module[_0xfb2c('0x2')]={'uniqueid':{'type':Sequelize[_0xfb2c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfb2c('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfb2c('0x4')]},'acceptAt':{'type':Sequelize[_0xfb2c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfb2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a78a6a8..1712c6f 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b0c=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','SmsQueueReport','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x49b65e,_0x326954){var _0x3a18a5=function(_0x528944){while(--_0x528944){_0x49b65e['push'](_0x49b65e['shift']());}};_0x3a18a5(++_0x326954);}(_0x5b0c,0x88));var _0xc5b0=function(_0x33e4a7,_0x2e80a2){_0x33e4a7=_0x33e4a7-0x0;var _0x598620=_0x5b0c[_0x33e4a7];return _0x598620;};'use strict';var emlformat=require(_0xc5b0('0x0'));var rimraf=require(_0xc5b0('0x1'));var zipdir=require(_0xc5b0('0x2'));var jsonpatch=require(_0xc5b0('0x3'));var rp=require(_0xc5b0('0x4'));var moment=require(_0xc5b0('0x5'));var BPromise=require(_0xc5b0('0x6'));var Mustache=require(_0xc5b0('0x7'));var util=require('util');var path=require(_0xc5b0('0x8'));var sox=require(_0xc5b0('0x9'));var csv=require(_0xc5b0('0xa'));var ejs=require(_0xc5b0('0xb'));var fs=require('fs');var fs_extra=require(_0xc5b0('0xc'));var _=require(_0xc5b0('0xd'));var squel=require(_0xc5b0('0xe'));var crypto=require(_0xc5b0('0xf'));var jsforce=require(_0xc5b0('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc5b0('0xa'));var querystring=require(_0xc5b0('0x11'));var Papa=require('papaparse');var Redis=require(_0xc5b0('0x12'));var authService=require(_0xc5b0('0x13'));var qs=require(_0xc5b0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5b0('0x15'));var logger=require(_0xc5b0('0x16'))(_0xc5b0('0x17'));var utils=require(_0xc5b0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc5b0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9bcc5,_0xfcffc1){_0xfcffc1=_0xfcffc1||0xcc;return function(_0x287ada){if(_0x287ada){return _0x9bcc5[_0xc5b0('0x1a')](_0xfcffc1);}return _0x9bcc5['status'](_0xfcffc1)[_0xc5b0('0x1b')]();};}function respondWithResult(_0x428e77,_0x17624f){_0x17624f=_0x17624f||0xc8;return function(_0x4463f6){if(_0x4463f6){return _0x428e77[_0xc5b0('0x1c')](_0x17624f)[_0xc5b0('0x1d')](_0x4463f6);}};}function respondWithFilteredResult(_0x3d79eb,_0x45dd17){return function(_0x1d3a89){if(_0x1d3a89){var _0x98a113=typeof _0x45dd17['offset']===_0xc5b0('0x1e')&&typeof _0x45dd17[_0xc5b0('0x1f')]===_0xc5b0('0x1e');var _0xbe30a2=_0x1d3a89[_0xc5b0('0x20')];var _0xd12d0a=_0x98a113?0x0:_0x45dd17[_0xc5b0('0x21')];var _0x376b6d=_0x98a113?_0x1d3a89[_0xc5b0('0x20')]:_0x45dd17[_0xc5b0('0x21')]+_0x45dd17[_0xc5b0('0x1f')];var _0x584d87;if(_0x376b6d>=_0xbe30a2){_0x376b6d=_0xbe30a2;_0x584d87=0xc8;}else{_0x584d87=0xce;}_0x3d79eb['status'](_0x584d87);return _0x3d79eb[_0xc5b0('0x22')](_0xc5b0('0x23'),_0xd12d0a+'-'+_0x376b6d+'/'+_0xbe30a2)[_0xc5b0('0x1d')](_0x1d3a89);}return null;};}function patchUpdates(_0x3f25ca){return function(_0x45c062){try{jsonpatch[_0xc5b0('0x24')](_0x45c062,_0x3f25ca,!![]);}catch(_0x4b4573){return BPromise[_0xc5b0('0x25')](_0x4b4573);}return _0x45c062['save']();};}function saveUpdates(_0x15310e,_0x142c51){return function(_0x2fc864){if(_0x2fc864){return _0x2fc864[_0xc5b0('0x26')](_0x15310e)[_0xc5b0('0x27')](function(_0x4751f2){return _0x4751f2;});}return null;};}function removeEntity(_0x3b8b62,_0x4db9b8){return function(_0x130573){if(_0x130573){return _0x130573[_0xc5b0('0x28')]()[_0xc5b0('0x27')](function(){_0x3b8b62['status'](0xcc)[_0xc5b0('0x1b')]();});}};}function handleEntityNotFound(_0x12b900,_0x5a673a){return function(_0x311aae){if(!_0x311aae){_0x12b900['sendStatus'](0x194);}return _0x311aae;};}function handleError(_0x56ed9a,_0x3f532e){_0x3f532e=_0x3f532e||0x1f4;return function(_0x3b12c9){logger[_0xc5b0('0x29')](_0x3b12c9[_0xc5b0('0x2a')]);if(_0x3b12c9[_0xc5b0('0x2b')]){delete _0x3b12c9[_0xc5b0('0x2b')];}_0x56ed9a['status'](_0x3f532e)[_0xc5b0('0x2c')](_0x3b12c9);};}exports[_0xc5b0('0x2d')]=function(_0x262236,_0x4120d3){var _0x51847c={},_0x5a83ae={},_0x1014e1={'count':0x0,'rows':[]};var _0x12c0ce=_[_0xc5b0('0x2e')](db['SmsQueueReport'][_0xc5b0('0x2f')],function(_0x67abc9){return{'name':_0x67abc9[_0xc5b0('0x30')],'type':_0x67abc9[_0xc5b0('0x31')][_0xc5b0('0x32')]};});_0x5a83ae[_0xc5b0('0x33')]=_['map'](_0x12c0ce,_0xc5b0('0x2b'));_0x5a83ae[_0xc5b0('0x34')]=_[_0xc5b0('0x35')](_0x262236[_0xc5b0('0x34')]);_0x5a83ae[_0xc5b0('0x36')]=_[_0xc5b0('0x37')](_0x5a83ae[_0xc5b0('0x33')],_0x5a83ae[_0xc5b0('0x34')]);_0x51847c[_0xc5b0('0x38')]=_[_0xc5b0('0x37')](_0x5a83ae[_0xc5b0('0x33')],qs['fields'](_0x262236[_0xc5b0('0x34')][_0xc5b0('0x39')]));_0x51847c['attributes']=_0x51847c['attributes'][_0xc5b0('0x3a')]?_0x51847c['attributes']:_0x5a83ae['model'];if(!_0x262236[_0xc5b0('0x34')][_0xc5b0('0x3b')](_0xc5b0('0x3c'))){_0x51847c[_0xc5b0('0x1f')]=qs[_0xc5b0('0x1f')](_0x262236[_0xc5b0('0x34')][_0xc5b0('0x1f')]);_0x51847c[_0xc5b0('0x21')]=qs[_0xc5b0('0x21')](_0x262236[_0xc5b0('0x34')][_0xc5b0('0x21')]);}_0x51847c[_0xc5b0('0x3d')]=qs[_0xc5b0('0x3e')](_0x262236[_0xc5b0('0x34')][_0xc5b0('0x3e')]);_0x51847c['where']=qs['filters'](_[_0xc5b0('0x3f')](_0x262236[_0xc5b0('0x34')],_0x5a83ae['filters']),_0x12c0ce);if(_0x262236[_0xc5b0('0x34')][_0xc5b0('0x40')]){_0x51847c[_0xc5b0('0x41')]=_[_0xc5b0('0x42')](_0x51847c[_0xc5b0('0x41')],{'$or':_[_0xc5b0('0x2e')](_0x12c0ce,function(_0x253e46){if(_0x253e46[_0xc5b0('0x31')]!=='VIRTUAL'){var _0x4f8f46={};_0x4f8f46[_0x253e46['name']]={'$like':'%'+_0x262236[_0xc5b0('0x34')][_0xc5b0('0x40')]+'%'};return _0x4f8f46;}})});}_0x51847c=_[_0xc5b0('0x42')]({},_0x51847c,_0x262236[_0xc5b0('0x43')]);var _0x2ede20={'where':_0x51847c[_0xc5b0('0x41')]};return db['SmsQueueReport']['count'](_0x2ede20)[_0xc5b0('0x27')](function(_0x3643ee){_0x1014e1[_0xc5b0('0x20')]=_0x3643ee;if(_0x262236['query'][_0xc5b0('0x44')]){_0x51847c['include']=[{'all':!![]}];}return db[_0xc5b0('0x45')][_0xc5b0('0x46')](_0x51847c);})['then'](function(_0x441969){_0x1014e1['rows']=_0x441969;return _0x1014e1;})[_0xc5b0('0x27')](respondWithFilteredResult(_0x4120d3,_0x51847c))[_0xc5b0('0x47')](handleError(_0x4120d3,null));};exports[_0xc5b0('0x48')]=function(_0x30d2b0,_0x14addd){var _0x2dee65={'raw':!![],'where':{'id':_0x30d2b0['params']['id']}},_0x319366={};_0x319366[_0xc5b0('0x33')]=_[_0xc5b0('0x35')](db['SmsQueueReport']['rawAttributes']);_0x319366[_0xc5b0('0x34')]=_['keys'](_0x30d2b0[_0xc5b0('0x34')]);_0x319366[_0xc5b0('0x36')]=_[_0xc5b0('0x37')](_0x319366[_0xc5b0('0x33')],_0x319366['query']);_0x2dee65['attributes']=_['intersection'](_0x319366[_0xc5b0('0x33')],qs[_0xc5b0('0x39')](_0x30d2b0[_0xc5b0('0x34')][_0xc5b0('0x39')]));_0x2dee65[_0xc5b0('0x38')]=_0x2dee65[_0xc5b0('0x38')][_0xc5b0('0x3a')]?_0x2dee65[_0xc5b0('0x38')]:_0x319366[_0xc5b0('0x33')];if(_0x30d2b0['query'][_0xc5b0('0x44')]){_0x2dee65['include']=[{'all':!![]}];}_0x2dee65=_[_0xc5b0('0x42')]({},_0x2dee65,_0x30d2b0['options']);return db[_0xc5b0('0x45')][_0xc5b0('0x49')](_0x2dee65)[_0xc5b0('0x27')](handleEntityNotFound(_0x14addd,null))[_0xc5b0('0x27')](respondWithResult(_0x14addd,null))[_0xc5b0('0x47')](handleError(_0x14addd,null));};exports[_0xc5b0('0x4a')]=function(_0x402554,_0x3ac9aa){return db[_0xc5b0('0x45')][_0xc5b0('0x4a')](_0x402554[_0xc5b0('0x4b')],{})[_0xc5b0('0x27')](respondWithResult(_0x3ac9aa,0xc9))[_0xc5b0('0x47')](handleError(_0x3ac9aa,null));};exports[_0xc5b0('0x26')]=function(_0x10ed2d,_0x190d69){if(_0x10ed2d['body']['id']){delete _0x10ed2d[_0xc5b0('0x4b')]['id'];}return db[_0xc5b0('0x45')][_0xc5b0('0x49')]({'where':{'id':_0x10ed2d[_0xc5b0('0x4c')]['id']}})[_0xc5b0('0x27')](handleEntityNotFound(_0x190d69,null))['then'](saveUpdates(_0x10ed2d['body'],null))[_0xc5b0('0x27')](respondWithResult(_0x190d69,null))[_0xc5b0('0x47')](handleError(_0x190d69,null));};exports[_0xc5b0('0x28')]=function(_0x56c46d,_0x8c1509){return db[_0xc5b0('0x45')][_0xc5b0('0x49')]({'where':{'id':_0x56c46d[_0xc5b0('0x4c')]['id']}})[_0xc5b0('0x27')](handleEntityNotFound(_0x8c1509,null))[_0xc5b0('0x27')](removeEntity(_0x8c1509,null))[_0xc5b0('0x47')](handleError(_0x8c1509,null));};exports[_0xc5b0('0x4d')]=function(_0x2878d,_0x2e0c6c){return db[_0xc5b0('0x45')][_0xc5b0('0x4d')]()[_0xc5b0('0x27')](respondWithResult(_0x2e0c6c,null))[_0xc5b0('0x47')](handleError(_0x2e0c6c,null));}; \ No newline at end of file +var _0x1bae=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x8e3df,_0x322a72){var _0x3c487d=function(_0x4bdf8c){while(--_0x4bdf8c){_0x8e3df['push'](_0x8e3df['shift']());}};_0x3c487d(++_0x322a72);}(_0x1bae,0x7e));var _0xe1ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1bae[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1ba('0x0'));var zipdir=require(_0xe1ba('0x1'));var jsonpatch=require(_0xe1ba('0x2'));var rp=require('request-promise');var moment=require(_0xe1ba('0x3'));var BPromise=require(_0xe1ba('0x4'));var Mustache=require(_0xe1ba('0x5'));var util=require(_0xe1ba('0x6'));var path=require(_0xe1ba('0x7'));var sox=require(_0xe1ba('0x8'));var csv=require('to-csv');var ejs=require(_0xe1ba('0x9'));var fs=require('fs');var fs_extra=require(_0xe1ba('0xa'));var _=require(_0xe1ba('0xb'));var squel=require(_0xe1ba('0xc'));var crypto=require(_0xe1ba('0xd'));var jsforce=require(_0xe1ba('0xe'));var deskjs=require(_0xe1ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe1ba('0x10'));var Papa=require('papaparse');var Redis=require(_0xe1ba('0x11'));var authService=require(_0xe1ba('0x12'));var qs=require(_0xe1ba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe1ba('0x14'));var utils=require(_0xe1ba('0x15'));var config=require(_0xe1ba('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1ba('0x17'))['db'];function respondWithStatusCode(_0x44568d,_0x429067){_0x429067=_0x429067||0xcc;return function(_0x122aeb){if(_0x122aeb){return _0x44568d[_0xe1ba('0x18')](_0x429067);}return _0x44568d[_0xe1ba('0x19')](_0x429067)[_0xe1ba('0x1a')]();};}function respondWithResult(_0x5610ba,_0x4b1456){_0x4b1456=_0x4b1456||0xc8;return function(_0x1af9b){if(_0x1af9b){return _0x5610ba['status'](_0x4b1456)[_0xe1ba('0x1b')](_0x1af9b);}};}function respondWithFilteredResult(_0x21f7d8,_0x3c028e){return function(_0x2f2a69){if(_0x2f2a69){var _0x43ffe8=typeof _0x3c028e[_0xe1ba('0x1c')]===_0xe1ba('0x1d')&&typeof _0x3c028e['limit']===_0xe1ba('0x1d');var _0x4d673e=_0x2f2a69['count'];var _0x128f62=_0x43ffe8?0x0:_0x3c028e['offset'];var _0x47c3f3=_0x43ffe8?_0x2f2a69[_0xe1ba('0x1e')]:_0x3c028e['offset']+_0x3c028e[_0xe1ba('0x1f')];var _0x29fa2a;if(_0x47c3f3>=_0x4d673e){_0x47c3f3=_0x4d673e;_0x29fa2a=0xc8;}else{_0x29fa2a=0xce;}_0x21f7d8['status'](_0x29fa2a);return _0x21f7d8[_0xe1ba('0x20')](_0xe1ba('0x21'),_0x128f62+'-'+_0x47c3f3+'/'+_0x4d673e)['json'](_0x2f2a69);}return null;};}function patchUpdates(_0x14dc6f){return function(_0x814f88){try{jsonpatch[_0xe1ba('0x22')](_0x814f88,_0x14dc6f,!![]);}catch(_0x562b60){return BPromise[_0xe1ba('0x23')](_0x562b60);}return _0x814f88[_0xe1ba('0x24')]();};}function saveUpdates(_0x464287,_0x332376){return function(_0x8af2ff){if(_0x8af2ff){return _0x8af2ff[_0xe1ba('0x25')](_0x464287)[_0xe1ba('0x26')](function(_0x4dfca1){return _0x4dfca1;});}return null;};}function removeEntity(_0x1f625c,_0x5efa0b){return function(_0x382ec0){if(_0x382ec0){return _0x382ec0[_0xe1ba('0x27')]()[_0xe1ba('0x26')](function(){_0x1f625c[_0xe1ba('0x19')](0xcc)[_0xe1ba('0x1a')]();});}};}function handleEntityNotFound(_0x2e9379,_0x334d20){return function(_0x5a9ad4){if(!_0x5a9ad4){_0x2e9379[_0xe1ba('0x18')](0x194);}return _0x5a9ad4;};}function handleError(_0x4a2951,_0x585f14){_0x585f14=_0x585f14||0x1f4;return function(_0xc66f3b){logger[_0xe1ba('0x28')](_0xc66f3b[_0xe1ba('0x29')]);if(_0xc66f3b[_0xe1ba('0x2a')]){delete _0xc66f3b['name'];}_0x4a2951[_0xe1ba('0x19')](_0x585f14)['send'](_0xc66f3b);};}exports[_0xe1ba('0x2b')]=function(_0x55364e,_0x2148bf){var _0x1c07fa={},_0x3099d2={},_0xc72561={'count':0x0,'rows':[]};var _0x5d1367=_[_0xe1ba('0x2c')](db[_0xe1ba('0x2d')][_0xe1ba('0x2e')],function(_0x16ed9b){return{'name':_0x16ed9b[_0xe1ba('0x2f')],'type':_0x16ed9b[_0xe1ba('0x30')][_0xe1ba('0x31')]};});_0x3099d2[_0xe1ba('0x32')]=_['map'](_0x5d1367,'name');_0x3099d2[_0xe1ba('0x33')]=_[_0xe1ba('0x34')](_0x55364e[_0xe1ba('0x33')]);_0x3099d2[_0xe1ba('0x35')]=_[_0xe1ba('0x36')](_0x3099d2[_0xe1ba('0x32')],_0x3099d2[_0xe1ba('0x33')]);_0x1c07fa[_0xe1ba('0x37')]=_[_0xe1ba('0x36')](_0x3099d2[_0xe1ba('0x32')],qs[_0xe1ba('0x38')](_0x55364e[_0xe1ba('0x33')]['fields']));_0x1c07fa['attributes']=_0x1c07fa[_0xe1ba('0x37')]['length']?_0x1c07fa[_0xe1ba('0x37')]:_0x3099d2[_0xe1ba('0x32')];if(!_0x55364e[_0xe1ba('0x33')]['hasOwnProperty'](_0xe1ba('0x39'))){_0x1c07fa[_0xe1ba('0x1f')]=qs[_0xe1ba('0x1f')](_0x55364e[_0xe1ba('0x33')][_0xe1ba('0x1f')]);_0x1c07fa['offset']=qs[_0xe1ba('0x1c')](_0x55364e['query'][_0xe1ba('0x1c')]);}_0x1c07fa['order']=qs[_0xe1ba('0x3a')](_0x55364e[_0xe1ba('0x33')][_0xe1ba('0x3a')]);_0x1c07fa[_0xe1ba('0x3b')]=qs['filters'](_[_0xe1ba('0x3c')](_0x55364e[_0xe1ba('0x33')],_0x3099d2[_0xe1ba('0x35')]),_0x5d1367);if(_0x55364e[_0xe1ba('0x33')][_0xe1ba('0x3d')]){_0x1c07fa[_0xe1ba('0x3b')]=_[_0xe1ba('0x3e')](_0x1c07fa[_0xe1ba('0x3b')],{'$or':_[_0xe1ba('0x2c')](_0x5d1367,function(_0x4f3e2f){if(_0x4f3e2f[_0xe1ba('0x30')]!==_0xe1ba('0x3f')){var _0x1c63d2={};_0x1c63d2[_0x4f3e2f[_0xe1ba('0x2a')]]={'$like':'%'+_0x55364e[_0xe1ba('0x33')]['filter']+'%'};return _0x1c63d2;}})});}_0x1c07fa=_[_0xe1ba('0x3e')]({},_0x1c07fa,_0x55364e[_0xe1ba('0x40')]);var _0x2be404={'where':_0x1c07fa[_0xe1ba('0x3b')]};return db[_0xe1ba('0x2d')][_0xe1ba('0x1e')](_0x2be404)[_0xe1ba('0x26')](function(_0x112e9b){_0xc72561['count']=_0x112e9b;if(_0x55364e[_0xe1ba('0x33')]['includeAll']){_0x1c07fa[_0xe1ba('0x41')]=[{'all':!![]}];}return db[_0xe1ba('0x2d')][_0xe1ba('0x42')](_0x1c07fa);})[_0xe1ba('0x26')](function(_0x26d344){_0xc72561['rows']=_0x26d344;return _0xc72561;})[_0xe1ba('0x26')](respondWithFilteredResult(_0x2148bf,_0x1c07fa))[_0xe1ba('0x43')](handleError(_0x2148bf,null));};exports[_0xe1ba('0x44')]=function(_0xe14a19,_0x579423){var _0x2742bf={'raw':!![],'where':{'id':_0xe14a19[_0xe1ba('0x45')]['id']}},_0x171ed6={};_0x171ed6[_0xe1ba('0x32')]=_['keys'](db[_0xe1ba('0x2d')][_0xe1ba('0x2e')]);_0x171ed6['query']=_[_0xe1ba('0x34')](_0xe14a19[_0xe1ba('0x33')]);_0x171ed6[_0xe1ba('0x35')]=_[_0xe1ba('0x36')](_0x171ed6[_0xe1ba('0x32')],_0x171ed6[_0xe1ba('0x33')]);_0x2742bf[_0xe1ba('0x37')]=_[_0xe1ba('0x36')](_0x171ed6[_0xe1ba('0x32')],qs[_0xe1ba('0x38')](_0xe14a19[_0xe1ba('0x33')][_0xe1ba('0x38')]));_0x2742bf[_0xe1ba('0x37')]=_0x2742bf[_0xe1ba('0x37')][_0xe1ba('0x46')]?_0x2742bf[_0xe1ba('0x37')]:_0x171ed6['model'];if(_0xe14a19['query'][_0xe1ba('0x47')]){_0x2742bf[_0xe1ba('0x41')]=[{'all':!![]}];}_0x2742bf=_[_0xe1ba('0x3e')]({},_0x2742bf,_0xe14a19[_0xe1ba('0x40')]);return db[_0xe1ba('0x2d')][_0xe1ba('0x48')](_0x2742bf)[_0xe1ba('0x26')](handleEntityNotFound(_0x579423,null))['then'](respondWithResult(_0x579423,null))[_0xe1ba('0x43')](handleError(_0x579423,null));};exports[_0xe1ba('0x49')]=function(_0x6b5d74,_0x1eabe4){return db[_0xe1ba('0x2d')][_0xe1ba('0x49')](_0x6b5d74[_0xe1ba('0x4a')],{})[_0xe1ba('0x26')](respondWithResult(_0x1eabe4,0xc9))[_0xe1ba('0x43')](handleError(_0x1eabe4,null));};exports['update']=function(_0x1969fe,_0x3d90ff){if(_0x1969fe['body']['id']){delete _0x1969fe[_0xe1ba('0x4a')]['id'];}return db[_0xe1ba('0x2d')]['find']({'where':{'id':_0x1969fe['params']['id']}})[_0xe1ba('0x26')](handleEntityNotFound(_0x3d90ff,null))['then'](saveUpdates(_0x1969fe[_0xe1ba('0x4a')],null))[_0xe1ba('0x26')](respondWithResult(_0x3d90ff,null))[_0xe1ba('0x43')](handleError(_0x3d90ff,null));};exports[_0xe1ba('0x27')]=function(_0x53ff7e,_0x37f8cb){return db[_0xe1ba('0x2d')]['find']({'where':{'id':_0x53ff7e['params']['id']}})[_0xe1ba('0x26')](handleEntityNotFound(_0x37f8cb,null))[_0xe1ba('0x26')](removeEntity(_0x37f8cb,null))[_0xe1ba('0x43')](handleError(_0x37f8cb,null));};exports[_0xe1ba('0x4b')]=function(_0x56506a,_0x52b525){return db[_0xe1ba('0x2d')][_0xe1ba('0x4b')]()[_0xe1ba('0x26')](respondWithResult(_0x52b525,null))[_0xe1ba('0x43')](handleError(_0x52b525,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3b665cc..3bacfc2 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1b4aa0,_0x24f3aa){var _0x24d0b1=function(_0xbcff02){while(--_0xbcff02){_0x1b4aa0['push'](_0x1b4aa0['shift']());}};_0x24d0b1(++_0x24f3aa);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x112771,_0xd7d6de){var _0x3939d8=function(_0x5e6cf0){while(--_0x5e6cf0){_0x112771['push'](_0x112771['shift']());}};_0x3939d8(++_0xd7d6de);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xcb91[_0x26fc81];return _0x9feece;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 9c0cb62..9f62e6e 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf15c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','SmsQueueReport','create','options','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','body','raw','then','lodash','util','moment','bluebird'];(function(_0x4f75a9,_0x3af473){var _0x3dcf80=function(_0x2f583c){while(--_0x2f583c){_0x4f75a9['push'](_0x4f75a9['shift']());}};_0x3dcf80(++_0x3af473);}(_0xf15c,0x10a));var _0xcf15=function(_0x50ec59,_0x55de51){_0x50ec59=_0x50ec59-0x0;var _0x46087f=_0xf15c[_0x50ec59];return _0x46087f;};'use strict';var _=require(_0xcf15('0x0'));var util=require(_0xcf15('0x1'));var moment=require(_0xcf15('0x2'));var BPromise=require(_0xcf15('0x3'));var rs=require(_0xcf15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf15('0x5'))['db'];var utils=require(_0xcf15('0x6'));var logger=require(_0xcf15('0x7'))('rpc');var config=require(_0xcf15('0x8'));var jayson=require(_0xcf15('0x9'));var client=jayson[_0xcf15('0xa')][_0xcf15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3661f5,_0x4aeb74,_0x18e14f){return new BPromise(function(_0x315b2b,_0x1bb858){return client['request'](_0x3661f5,_0x18e14f)['then'](function(_0x58a5c6){logger[_0xcf15('0xc')](_0xcf15('0xd'),_0x4aeb74,_0xcf15('0xe'));logger[_0xcf15('0xf')](_0xcf15('0x10'),_0x4aeb74,_0xcf15('0xe'),JSON['stringify'](_0x58a5c6));if(_0x58a5c6[_0xcf15('0x11')]){if(_0x58a5c6['error']['code']===0x1f4){logger[_0xcf15('0x11')](_0xcf15('0xd'),_0x4aeb74,_0x58a5c6[_0xcf15('0x11')][_0xcf15('0x12')]);return _0x1bb858(_0x58a5c6[_0xcf15('0x11')][_0xcf15('0x12')]);}logger[_0xcf15('0x11')](_0xcf15('0xd'),_0x4aeb74,_0x58a5c6['error'][_0xcf15('0x12')]);return _0x315b2b(_0x58a5c6[_0xcf15('0x11')][_0xcf15('0x12')]);}else{logger['info'](_0xcf15('0xd'),_0x4aeb74,_0xcf15('0xe'));_0x315b2b(_0x58a5c6['result'][_0xcf15('0x12')]);}})[_0xcf15('0x13')](function(_0x56895d){logger[_0xcf15('0x11')](_0xcf15('0xd'),_0x4aeb74,_0x56895d);_0x1bb858(_0x56895d);});});}exports['CreateSmsQueueReport']=function(_0x343480){var _0x65017b=this;return new Promise(function(_0x2af936,_0x3c83d5){return db[_0xcf15('0x14')][_0xcf15('0x15')](_0x343480['body'],{'raw':_0x343480[_0xcf15('0x16')]?_0x343480[_0xcf15('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4290c1){logger['info'](_0xcf15('0x17'),_0x343480);logger[_0xcf15('0xf')](_0xcf15('0x17'),_0x343480,JSON[_0xcf15('0x18')](_0x4290c1));_0x2af936(_0x4290c1);})[_0xcf15('0x13')](function(_0x45223d){logger[_0xcf15('0x11')](_0xcf15('0x17'),_0x45223d[_0xcf15('0x12')],_0x343480);_0x3c83d5(_0x65017b[_0xcf15('0x11')](0x1f4,_0x45223d['message']));});});};exports[_0xcf15('0x19')]=function(_0x4d8697){var _0x3a0d27=this;return new Promise(function(_0x40c294,_0x7286c){return db[_0xcf15('0x14')][_0xcf15('0x1a')](_0x4d8697[_0xcf15('0x1b')],{'raw':_0x4d8697[_0xcf15('0x16')]?_0x4d8697['options'][_0xcf15('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d8697[_0xcf15('0x16')]?_0x4d8697[_0xcf15('0x16')]['where']||null:null,'attributes':_0x4d8697[_0xcf15('0x16')]?_0x4d8697[_0xcf15('0x16')]['attributes']||null:null,'limit':_0x4d8697[_0xcf15('0x16')]?_0x4d8697['options']['limit']||null:null})[_0xcf15('0x1d')](function(_0x1348ca){logger[_0xcf15('0xc')](_0xcf15('0x19'),_0x4d8697);logger['debug'](_0xcf15('0x19'),_0x4d8697,JSON[_0xcf15('0x18')](_0x1348ca));_0x40c294(_0x1348ca);})[_0xcf15('0x13')](function(_0x20445c){logger['error']('UpdateSmsQueueReport',_0x20445c[_0xcf15('0x12')],_0x4d8697);_0x7286c(_0x3a0d27[_0xcf15('0x11')](0x1f4,_0x20445c['message']));});});}; \ No newline at end of file +var _0x24f6=['lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsQueueReport','create','options','debug','UpdateSmsQueueReport','SmsQueueReport','update','body','raw','where','limit'];(function(_0x5e495b,_0x351a01){var _0x270ada=function(_0x4b4500){while(--_0x4b4500){_0x5e495b['push'](_0x5e495b['shift']());}};_0x270ada(++_0x351a01);}(_0x24f6,0x100));var _0x624f=function(_0x26ea23,_0x287faa){_0x26ea23=_0x26ea23-0x0;var _0x4c3556=_0x24f6[_0x26ea23];return _0x4c3556;};'use strict';var _=require(_0x624f('0x0'));var util=require('util');var moment=require(_0x624f('0x1'));var BPromise=require(_0x624f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x624f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x624f('0x4'));var logger=require(_0x624f('0x5'))(_0x624f('0x6'));var config=require(_0x624f('0x7'));var jayson=require(_0x624f('0x8'));var client=jayson[_0x624f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45aeca,_0x1d610c,_0x5f258a){return new BPromise(function(_0x336115,_0x38f42d){return client[_0x624f('0xa')](_0x45aeca,_0x5f258a)[_0x624f('0xb')](function(_0x2516e6){logger[_0x624f('0xc')](_0x624f('0xd'),_0x1d610c,_0x624f('0xe'));logger['debug'](_0x624f('0xf'),_0x1d610c,_0x624f('0xe'),JSON[_0x624f('0x10')](_0x2516e6));if(_0x2516e6[_0x624f('0x11')]){if(_0x2516e6[_0x624f('0x11')][_0x624f('0x12')]===0x1f4){logger[_0x624f('0x11')](_0x624f('0xd'),_0x1d610c,_0x2516e6[_0x624f('0x11')][_0x624f('0x13')]);return _0x38f42d(_0x2516e6['error'][_0x624f('0x13')]);}logger[_0x624f('0x11')](_0x624f('0xd'),_0x1d610c,_0x2516e6['error']['message']);return _0x336115(_0x2516e6[_0x624f('0x11')]['message']);}else{logger[_0x624f('0xc')](_0x624f('0xd'),_0x1d610c,_0x624f('0xe'));_0x336115(_0x2516e6['result'][_0x624f('0x13')]);}})[_0x624f('0x14')](function(_0x20be12){logger['error'](_0x624f('0xd'),_0x1d610c,_0x20be12);_0x38f42d(_0x20be12);});});}exports[_0x624f('0x15')]=function(_0x2133bc){var _0xd7fd79=this;return new Promise(function(_0x449ecf,_0x5ae0d4){return db['SmsQueueReport'][_0x624f('0x16')](_0x2133bc['body'],{'raw':_0x2133bc[_0x624f('0x17')]?_0x2133bc[_0x624f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x624f('0xb')](function(_0x584668){logger['info'](_0x624f('0x15'),_0x2133bc);logger[_0x624f('0x18')](_0x624f('0x15'),_0x2133bc,JSON['stringify'](_0x584668));_0x449ecf(_0x584668);})[_0x624f('0x14')](function(_0x367ca5){logger[_0x624f('0x11')]('CreateSmsQueueReport',_0x367ca5[_0x624f('0x13')],_0x2133bc);_0x5ae0d4(_0xd7fd79['error'](0x1f4,_0x367ca5[_0x624f('0x13')]));});});};exports[_0x624f('0x19')]=function(_0x592f90){var _0x242ae0=this;return new Promise(function(_0x40f9bc,_0x44a851){return db[_0x624f('0x1a')][_0x624f('0x1b')](_0x592f90[_0x624f('0x1c')],{'raw':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')][_0x624f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')][_0x624f('0x1e')]||null:null,'attributes':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')]['attributes']||null:null,'limit':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')][_0x624f('0x1f')]||null:null})[_0x624f('0xb')](function(_0x50bb03){logger['info']('UpdateSmsQueueReport',_0x592f90);logger[_0x624f('0x18')]('UpdateSmsQueueReport',_0x592f90,JSON[_0x624f('0x10')](_0x50bb03));_0x40f9bc(_0x50bb03);})[_0x624f('0x14')](function(_0x45dc19){logger[_0x624f('0x11')]('UpdateSmsQueueReport',_0x45dc19[_0x624f('0x13')],_0x592f90);_0x44a851(_0x242ae0[_0x624f('0x11')](0x1f4,_0x45dc19[_0x624f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 39ac458..b6c841c 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x19e278,_0x61439f){var _0x5a4577=function(_0x346ab7){while(--_0x346ab7){_0x19e278['push'](_0x19e278['shift']());}};_0x5a4577(++_0x61439f);}(_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 _0x7217=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x7217,0x19e));var _0x7721=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7217[_0x521929];return _0x632436;};'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('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a656a46..15d5d7d 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x5174f6,_0xd5522){var _0x25b5df=function(_0x7b50c9){while(--_0x7b50c9){_0x5174f6['push'](_0x5174f6['shift']());}};_0x25b5df(++_0xd5522);}(_0xe706,0xa3));var _0x6e70=function(_0x174583,_0x468485){_0x174583=_0x174583-0x0;var _0x14e46f=_0xe706[_0x174583];return _0x14e46f;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x43fda2,_0x1c5662){var _0xa492a2=function(_0x3a92c4){while(--_0x3a92c4){_0x43fda2['push'](_0x43fda2['shift']());}};_0xa492a2(++_0x1c5662);}(_0x34e8,0x12c));var _0x834e=function(_0x42309b,_0x4a02a6){_0x42309b=_0x42309b-0x0;var _0x1509af=_0x34e8[_0x42309b];return _0x1509af;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6771669..7c5939e 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11af=['rimraf','zip-dir','moment','util','path','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model','keys','query','intersection','attributes','fields','length','limit','order','sort','pick','filters','filter','where','merge','VIRTUAL','SmsTransferReport','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','eml-format'];(function(_0x262b0d,_0x106a3a){var _0x407583=function(_0x5e7824){while(--_0x5e7824){_0x262b0d['push'](_0x262b0d['shift']());}};_0x407583(++_0x106a3a);}(_0x11af,0xd7));var _0xf11a=function(_0x5b3d75,_0x560a74){_0x5b3d75=_0x5b3d75-0x0;var _0x10dc8d=_0x11af[_0x5b3d75];return _0x10dc8d;};'use strict';var emlformat=require(_0xf11a('0x0'));var rimraf=require(_0xf11a('0x1'));var zipdir=require(_0xf11a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf11a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf11a('0x4'));var path=require(_0xf11a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf11a('0x6'));var _=require('lodash');var squel=require(_0xf11a('0x7'));var crypto=require(_0xf11a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf11a('0x9'));var toCsv=require(_0xf11a('0xa'));var querystring=require(_0xf11a('0xb'));var Papa=require(_0xf11a('0xc'));var Redis=require(_0xf11a('0xd'));var authService=require(_0xf11a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf11a('0xf'));var hardwareService=require(_0xf11a('0x10'));var logger=require(_0xf11a('0x11'))(_0xf11a('0x12'));var utils=require(_0xf11a('0x13'));var config=require(_0xf11a('0x14'));var licenseUtil=require(_0xf11a('0x15'));var db=require(_0xf11a('0x16'))['db'];function respondWithStatusCode(_0x48523e,_0x536955){_0x536955=_0x536955||0xcc;return function(_0x49bc32){if(_0x49bc32){return _0x48523e['sendStatus'](_0x536955);}return _0x48523e[_0xf11a('0x17')](_0x536955)['end']();};}function respondWithResult(_0x3e1025,_0x1da9b0){_0x1da9b0=_0x1da9b0||0xc8;return function(_0x14cfdb){if(_0x14cfdb){return _0x3e1025[_0xf11a('0x17')](_0x1da9b0)[_0xf11a('0x18')](_0x14cfdb);}};}function respondWithFilteredResult(_0x525769,_0x19a9b7){return function(_0x14e063){if(_0x14e063){var _0x6fbdc2=typeof _0x19a9b7['offset']==='undefined'&&typeof _0x19a9b7['limit']===_0xf11a('0x19');var _0x454724=_0x14e063[_0xf11a('0x1a')];var _0x51f906=_0x6fbdc2?0x0:_0x19a9b7[_0xf11a('0x1b')];var _0x1aafaf=_0x6fbdc2?_0x14e063[_0xf11a('0x1a')]:_0x19a9b7[_0xf11a('0x1b')]+_0x19a9b7['limit'];var _0x5e71c6;if(_0x1aafaf>=_0x454724){_0x1aafaf=_0x454724;_0x5e71c6=0xc8;}else{_0x5e71c6=0xce;}_0x525769[_0xf11a('0x17')](_0x5e71c6);return _0x525769['set'](_0xf11a('0x1c'),_0x51f906+'-'+_0x1aafaf+'/'+_0x454724)[_0xf11a('0x18')](_0x14e063);}return null;};}function patchUpdates(_0x4d4e59){return function(_0x1e70ff){try{jsonpatch[_0xf11a('0x1d')](_0x1e70ff,_0x4d4e59,!![]);}catch(_0x523c9f){return BPromise[_0xf11a('0x1e')](_0x523c9f);}return _0x1e70ff[_0xf11a('0x1f')]();};}function saveUpdates(_0x533f8f,_0x2e0795){return function(_0x4b73bc){if(_0x4b73bc){return _0x4b73bc[_0xf11a('0x20')](_0x533f8f)[_0xf11a('0x21')](function(_0x23d44a){return _0x23d44a;});}return null;};}function removeEntity(_0x291290,_0x8082da){return function(_0x392213){if(_0x392213){return _0x392213[_0xf11a('0x22')]()['then'](function(){_0x291290['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5316,_0x3624d6){return function(_0x3398b3){if(!_0x3398b3){_0x5b5316[_0xf11a('0x23')](0x194);}return _0x3398b3;};}function handleError(_0x254f51,_0x5cc1ad){_0x5cc1ad=_0x5cc1ad||0x1f4;return function(_0x1d4ef6){logger[_0xf11a('0x24')](_0x1d4ef6[_0xf11a('0x25')]);if(_0x1d4ef6[_0xf11a('0x26')]){delete _0x1d4ef6['name'];}_0x254f51[_0xf11a('0x17')](_0x5cc1ad)[_0xf11a('0x27')](_0x1d4ef6);};}exports['index']=function(_0xb1cc6b,_0x4f700b){var _0x1999ee={},_0x281ab3={},_0x51d547={'count':0x0,'rows':[]};var _0x3f28be=_[_0xf11a('0x28')](db['SmsTransferReport']['rawAttributes'],function(_0x452ef6){return{'name':_0x452ef6[_0xf11a('0x29')],'type':_0x452ef6[_0xf11a('0x2a')]['key']};});_0x281ab3[_0xf11a('0x2b')]=_[_0xf11a('0x28')](_0x3f28be,_0xf11a('0x26'));_0x281ab3['query']=_[_0xf11a('0x2c')](_0xb1cc6b[_0xf11a('0x2d')]);_0x281ab3['filters']=_[_0xf11a('0x2e')](_0x281ab3[_0xf11a('0x2b')],_0x281ab3[_0xf11a('0x2d')]);_0x1999ee[_0xf11a('0x2f')]=_['intersection'](_0x281ab3[_0xf11a('0x2b')],qs[_0xf11a('0x30')](_0xb1cc6b[_0xf11a('0x2d')]['fields']));_0x1999ee['attributes']=_0x1999ee[_0xf11a('0x2f')][_0xf11a('0x31')]?_0x1999ee[_0xf11a('0x2f')]:_0x281ab3['model'];if(!_0xb1cc6b['query']['hasOwnProperty']('nolimit')){_0x1999ee[_0xf11a('0x32')]=qs[_0xf11a('0x32')](_0xb1cc6b[_0xf11a('0x2d')][_0xf11a('0x32')]);_0x1999ee['offset']=qs[_0xf11a('0x1b')](_0xb1cc6b[_0xf11a('0x2d')][_0xf11a('0x1b')]);}_0x1999ee[_0xf11a('0x33')]=qs[_0xf11a('0x34')](_0xb1cc6b['query'][_0xf11a('0x34')]);_0x1999ee['where']=qs['filters'](_[_0xf11a('0x35')](_0xb1cc6b[_0xf11a('0x2d')],_0x281ab3[_0xf11a('0x36')]),_0x3f28be);if(_0xb1cc6b[_0xf11a('0x2d')][_0xf11a('0x37')]){_0x1999ee[_0xf11a('0x38')]=_[_0xf11a('0x39')](_0x1999ee['where'],{'$or':_['map'](_0x3f28be,function(_0x32aee7){if(_0x32aee7[_0xf11a('0x2a')]!==_0xf11a('0x3a')){var _0x328e94={};_0x328e94[_0x32aee7[_0xf11a('0x26')]]={'$like':'%'+_0xb1cc6b['query'][_0xf11a('0x37')]+'%'};return _0x328e94;}})});}_0x1999ee=_[_0xf11a('0x39')]({},_0x1999ee,_0xb1cc6b['options']);var _0x705512={'where':_0x1999ee[_0xf11a('0x38')]};return db[_0xf11a('0x3b')][_0xf11a('0x1a')](_0x705512)[_0xf11a('0x21')](function(_0x44bf28){_0x51d547[_0xf11a('0x1a')]=_0x44bf28;if(_0xb1cc6b[_0xf11a('0x2d')]['includeAll']){_0x1999ee[_0xf11a('0x3c')]=[{'all':!![]}];}return db[_0xf11a('0x3b')][_0xf11a('0x3d')](_0x1999ee);})[_0xf11a('0x21')](function(_0x21f2da){_0x51d547['rows']=_0x21f2da;return _0x51d547;})[_0xf11a('0x21')](respondWithFilteredResult(_0x4f700b,_0x1999ee))[_0xf11a('0x3e')](handleError(_0x4f700b,null));};exports[_0xf11a('0x3f')]=function(_0x337618,_0x39d81d){var _0x5490a7={'raw':!![],'where':{'id':_0x337618[_0xf11a('0x40')]['id']}},_0x290003={};_0x290003[_0xf11a('0x2b')]=_[_0xf11a('0x2c')](db[_0xf11a('0x3b')][_0xf11a('0x41')]);_0x290003['query']=_[_0xf11a('0x2c')](_0x337618[_0xf11a('0x2d')]);_0x290003[_0xf11a('0x36')]=_[_0xf11a('0x2e')](_0x290003['model'],_0x290003[_0xf11a('0x2d')]);_0x5490a7[_0xf11a('0x2f')]=_[_0xf11a('0x2e')](_0x290003[_0xf11a('0x2b')],qs['fields'](_0x337618['query']['fields']));_0x5490a7[_0xf11a('0x2f')]=_0x5490a7['attributes'][_0xf11a('0x31')]?_0x5490a7[_0xf11a('0x2f')]:_0x290003[_0xf11a('0x2b')];if(_0x337618[_0xf11a('0x2d')][_0xf11a('0x42')]){_0x5490a7[_0xf11a('0x3c')]=[{'all':!![]}];}_0x5490a7=_['merge']({},_0x5490a7,_0x337618[_0xf11a('0x43')]);return db[_0xf11a('0x3b')][_0xf11a('0x44')](_0x5490a7)[_0xf11a('0x21')](handleEntityNotFound(_0x39d81d,null))[_0xf11a('0x21')](respondWithResult(_0x39d81d,null))[_0xf11a('0x3e')](handleError(_0x39d81d,null));};exports[_0xf11a('0x45')]=function(_0x249789,_0x50a39e){return db['SmsTransferReport'][_0xf11a('0x45')](_0x249789['body'],{})[_0xf11a('0x21')](respondWithResult(_0x50a39e,0xc9))[_0xf11a('0x3e')](handleError(_0x50a39e,null));};exports[_0xf11a('0x20')]=function(_0x429ffa,_0x3773e4){if(_0x429ffa['body']['id']){delete _0x429ffa[_0xf11a('0x46')]['id'];}return db[_0xf11a('0x3b')]['find']({'where':{'id':_0x429ffa[_0xf11a('0x40')]['id']}})[_0xf11a('0x21')](handleEntityNotFound(_0x3773e4,null))[_0xf11a('0x21')](saveUpdates(_0x429ffa[_0xf11a('0x46')],null))[_0xf11a('0x21')](respondWithResult(_0x3773e4,null))[_0xf11a('0x3e')](handleError(_0x3773e4,null));};exports[_0xf11a('0x22')]=function(_0x16ab41,_0x5679d8){return db['SmsTransferReport'][_0xf11a('0x44')]({'where':{'id':_0x16ab41[_0xf11a('0x40')]['id']}})[_0xf11a('0x21')](handleEntityNotFound(_0x5679d8,null))[_0xf11a('0x21')](removeEntity(_0x5679d8,null))['catch'](handleError(_0x5679d8,null));};exports[_0xf11a('0x47')]=function(_0x4319db,_0x8feb4){return db[_0xf11a('0x3b')][_0xf11a('0x47')]()['then'](respondWithResult(_0x8feb4,null))[_0xf11a('0x3e')](handleError(_0x8feb4,null));}; \ No newline at end of file +var _0x6f8a=['show','params','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch'];(function(_0x594774,_0x3fc4a7){var _0x2e032d=function(_0x4e9640){while(--_0x4e9640){_0x594774['push'](_0x594774['shift']());}};_0x2e032d(++_0x3fc4a7);}(_0x6f8a,0x1b0));var _0xa6f8=function(_0x3292c3,_0x2f1e3b){_0x3292c3=_0x3292c3-0x0;var _0x572074=_0x6f8a[_0x3292c3];return _0x572074;};'use strict';var emlformat=require(_0xa6f8('0x0'));var rimraf=require(_0xa6f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa6f8('0x2'));var moment=require('moment');var BPromise=require(_0xa6f8('0x3'));var Mustache=require(_0xa6f8('0x4'));var util=require(_0xa6f8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6f8('0x6'));var fs=require('fs');var fs_extra=require(_0xa6f8('0x7'));var _=require(_0xa6f8('0x8'));var squel=require(_0xa6f8('0x9'));var crypto=require(_0xa6f8('0xa'));var jsforce=require(_0xa6f8('0xb'));var deskjs=require(_0xa6f8('0xc'));var toCsv=require(_0xa6f8('0xd'));var querystring=require(_0xa6f8('0xe'));var Papa=require(_0xa6f8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa6f8('0x10'));var as=require(_0xa6f8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa6f8('0x12'));var utils=require(_0xa6f8('0x13'));var config=require(_0xa6f8('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5871,_0x35c138){_0x35c138=_0x35c138||0xcc;return function(_0x894dc1){if(_0x894dc1){return _0x2b5871[_0xa6f8('0x15')](_0x35c138);}return _0x2b5871[_0xa6f8('0x16')](_0x35c138)[_0xa6f8('0x17')]();};}function respondWithResult(_0x3dae3d,_0x4c4c39){_0x4c4c39=_0x4c4c39||0xc8;return function(_0x3ee060){if(_0x3ee060){return _0x3dae3d[_0xa6f8('0x16')](_0x4c4c39)[_0xa6f8('0x18')](_0x3ee060);}};}function respondWithFilteredResult(_0x2286e6,_0x42fb79){return function(_0x4a7f23){if(_0x4a7f23){var _0xbeda=typeof _0x42fb79[_0xa6f8('0x19')]===_0xa6f8('0x1a')&&typeof _0x42fb79[_0xa6f8('0x1b')]==='undefined';var _0x1273d0=_0x4a7f23['count'];var _0x31ccd5=_0xbeda?0x0:_0x42fb79['offset'];var _0x47bc07=_0xbeda?_0x4a7f23[_0xa6f8('0x1c')]:_0x42fb79['offset']+_0x42fb79[_0xa6f8('0x1b')];var _0x4093c6;if(_0x47bc07>=_0x1273d0){_0x47bc07=_0x1273d0;_0x4093c6=0xc8;}else{_0x4093c6=0xce;}_0x2286e6[_0xa6f8('0x16')](_0x4093c6);return _0x2286e6[_0xa6f8('0x1d')](_0xa6f8('0x1e'),_0x31ccd5+'-'+_0x47bc07+'/'+_0x1273d0)['json'](_0x4a7f23);}return null;};}function patchUpdates(_0x230f69){return function(_0x4bc992){try{jsonpatch['apply'](_0x4bc992,_0x230f69,!![]);}catch(_0x10568b){return BPromise['reject'](_0x10568b);}return _0x4bc992[_0xa6f8('0x1f')]();};}function saveUpdates(_0x2bb694,_0x39638c){return function(_0x79d03e){if(_0x79d03e){return _0x79d03e[_0xa6f8('0x20')](_0x2bb694)[_0xa6f8('0x21')](function(_0x3521ad){return _0x3521ad;});}return null;};}function removeEntity(_0x34d2b5,_0xd5defd){return function(_0x41337d){if(_0x41337d){return _0x41337d[_0xa6f8('0x22')]()[_0xa6f8('0x21')](function(){_0x34d2b5['status'](0xcc)[_0xa6f8('0x17')]();});}};}function handleEntityNotFound(_0x9cad0d,_0x5178f6){return function(_0x3d7277){if(!_0x3d7277){_0x9cad0d[_0xa6f8('0x15')](0x194);}return _0x3d7277;};}function handleError(_0x273570,_0x475f8c){_0x475f8c=_0x475f8c||0x1f4;return function(_0x3ce575){logger[_0xa6f8('0x23')](_0x3ce575[_0xa6f8('0x24')]);if(_0x3ce575[_0xa6f8('0x25')]){delete _0x3ce575[_0xa6f8('0x25')];}_0x273570[_0xa6f8('0x16')](_0x475f8c)[_0xa6f8('0x26')](_0x3ce575);};}exports[_0xa6f8('0x27')]=function(_0x4bfd24,_0x58deff){var _0x2556cd={},_0x26e715={},_0x262e98={'count':0x0,'rows':[]};var _0x4bb668=_[_0xa6f8('0x28')](db[_0xa6f8('0x29')][_0xa6f8('0x2a')],function(_0x23065e){return{'name':_0x23065e[_0xa6f8('0x2b')],'type':_0x23065e[_0xa6f8('0x2c')][_0xa6f8('0x2d')]};});_0x26e715[_0xa6f8('0x2e')]=_[_0xa6f8('0x28')](_0x4bb668,_0xa6f8('0x25'));_0x26e715[_0xa6f8('0x2f')]=_[_0xa6f8('0x30')](_0x4bfd24[_0xa6f8('0x2f')]);_0x26e715[_0xa6f8('0x31')]=_[_0xa6f8('0x32')](_0x26e715[_0xa6f8('0x2e')],_0x26e715[_0xa6f8('0x2f')]);_0x2556cd[_0xa6f8('0x33')]=_[_0xa6f8('0x32')](_0x26e715[_0xa6f8('0x2e')],qs[_0xa6f8('0x34')](_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x34')]));_0x2556cd[_0xa6f8('0x33')]=_0x2556cd[_0xa6f8('0x33')][_0xa6f8('0x35')]?_0x2556cd[_0xa6f8('0x33')]:_0x26e715[_0xa6f8('0x2e')];if(!_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x36')](_0xa6f8('0x37'))){_0x2556cd[_0xa6f8('0x1b')]=qs[_0xa6f8('0x1b')](_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x1b')]);_0x2556cd[_0xa6f8('0x19')]=qs[_0xa6f8('0x19')](_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x19')]);}_0x2556cd['order']=qs[_0xa6f8('0x38')](_0x4bfd24['query'][_0xa6f8('0x38')]);_0x2556cd[_0xa6f8('0x39')]=qs[_0xa6f8('0x31')](_['pick'](_0x4bfd24['query'],_0x26e715[_0xa6f8('0x31')]),_0x4bb668);if(_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x3a')]){_0x2556cd[_0xa6f8('0x39')]=_[_0xa6f8('0x3b')](_0x2556cd[_0xa6f8('0x39')],{'$or':_['map'](_0x4bb668,function(_0x32225b){if(_0x32225b['type']!=='VIRTUAL'){var _0x437358={};_0x437358[_0x32225b[_0xa6f8('0x25')]]={'$like':'%'+_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x3a')]+'%'};return _0x437358;}})});}_0x2556cd=_['merge']({},_0x2556cd,_0x4bfd24[_0xa6f8('0x3c')]);var _0x569e25={'where':_0x2556cd[_0xa6f8('0x39')]};return db['SmsTransferReport'][_0xa6f8('0x1c')](_0x569e25)['then'](function(_0x5cb0ba){_0x262e98['count']=_0x5cb0ba;if(_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x3d')]){_0x2556cd[_0xa6f8('0x3e')]=[{'all':!![]}];}return db[_0xa6f8('0x29')][_0xa6f8('0x3f')](_0x2556cd);})['then'](function(_0x160c4e){_0x262e98['rows']=_0x160c4e;return _0x262e98;})['then'](respondWithFilteredResult(_0x58deff,_0x2556cd))[_0xa6f8('0x40')](handleError(_0x58deff,null));};exports[_0xa6f8('0x41')]=function(_0x8ea0e8,_0x320e5e){var _0x2c2cc6={'raw':!![],'where':{'id':_0x8ea0e8[_0xa6f8('0x42')]['id']}},_0x5dc655={};_0x5dc655['model']=_['keys'](db[_0xa6f8('0x29')][_0xa6f8('0x2a')]);_0x5dc655[_0xa6f8('0x2f')]=_[_0xa6f8('0x30')](_0x8ea0e8[_0xa6f8('0x2f')]);_0x5dc655[_0xa6f8('0x31')]=_[_0xa6f8('0x32')](_0x5dc655[_0xa6f8('0x2e')],_0x5dc655[_0xa6f8('0x2f')]);_0x2c2cc6[_0xa6f8('0x33')]=_[_0xa6f8('0x32')](_0x5dc655[_0xa6f8('0x2e')],qs[_0xa6f8('0x34')](_0x8ea0e8['query']['fields']));_0x2c2cc6[_0xa6f8('0x33')]=_0x2c2cc6['attributes'][_0xa6f8('0x35')]?_0x2c2cc6[_0xa6f8('0x33')]:_0x5dc655[_0xa6f8('0x2e')];if(_0x8ea0e8[_0xa6f8('0x2f')]['includeAll']){_0x2c2cc6['include']=[{'all':!![]}];}_0x2c2cc6=_[_0xa6f8('0x3b')]({},_0x2c2cc6,_0x8ea0e8['options']);return db['SmsTransferReport'][_0xa6f8('0x43')](_0x2c2cc6)['then'](handleEntityNotFound(_0x320e5e,null))[_0xa6f8('0x21')](respondWithResult(_0x320e5e,null))['catch'](handleError(_0x320e5e,null));};exports[_0xa6f8('0x44')]=function(_0x96ed20,_0x2d0c62){return db[_0xa6f8('0x29')]['create'](_0x96ed20[_0xa6f8('0x45')],{})[_0xa6f8('0x21')](respondWithResult(_0x2d0c62,0xc9))['catch'](handleError(_0x2d0c62,null));};exports['update']=function(_0x3a8901,_0x11c1bd){if(_0x3a8901['body']['id']){delete _0x3a8901['body']['id'];}return db[_0xa6f8('0x29')][_0xa6f8('0x43')]({'where':{'id':_0x3a8901['params']['id']}})[_0xa6f8('0x21')](handleEntityNotFound(_0x11c1bd,null))[_0xa6f8('0x21')](saveUpdates(_0x3a8901[_0xa6f8('0x45')],null))['then'](respondWithResult(_0x11c1bd,null))['catch'](handleError(_0x11c1bd,null));};exports[_0xa6f8('0x22')]=function(_0x209a88,_0x22a202){return db['SmsTransferReport']['find']({'where':{'id':_0x209a88[_0xa6f8('0x42')]['id']}})['then'](handleEntityNotFound(_0x22a202,null))[_0xa6f8('0x21')](removeEntity(_0x22a202,null))[_0xa6f8('0x40')](handleError(_0x22a202,null));};exports[_0xa6f8('0x46')]=function(_0x191510,_0x27b186){return db['SmsTransferReport'][_0xa6f8('0x46')]()[_0xa6f8('0x21')](respondWithResult(_0x27b186,null))['catch'](handleError(_0x27b186,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4cc6af1..64d5529 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0298=['rimraf','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b87cc,_0x44ef41){var _0x3808d2=function(_0x5d249c){while(--_0x5d249c){_0x2b87cc['push'](_0x2b87cc['shift']());}};_0x3808d2(++_0x44ef41);}(_0x0298,0x95));var _0x8029=function(_0x1c0d3a,_0x5917c1){_0x1c0d3a=_0x1c0d3a-0x0;var _0x115215=_0x0298[_0x1c0d3a];return _0x115215;};'use strict';var _=require(_0x8029('0x0'));var util=require('util');var logger=require(_0x8029('0x1'))(_0x8029('0x2'));var moment=require(_0x8029('0x3'));var BPromise=require(_0x8029('0x4'));var rp=require(_0x8029('0x5'));var fs=require('fs');var path=require(_0x8029('0x6'));var rimraf=require(_0x8029('0x7'));var config=require(_0x8029('0x8'));var attributes=require(_0x8029('0x9'));module['exports']=function(_0x37b617,_0xeae01){return _0x37b617['define'](_0x8029('0xa'),attributes,{'tableName':_0x8029('0xb'),'paranoid':![],'indexes':[{'name':_0x8029('0xc'),'fields':[_0x8029('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b12=['request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b12,0x1b6));var _0x21b1=function(_0x5db643,_0x3cd4ee){_0x5db643=_0x5db643-0x0;var _0x58850a=_0x1b12[_0x5db643];return _0x58850a;};'use strict';var _=require(_0x21b1('0x0'));var util=require('util');var logger=require(_0x21b1('0x1'))(_0x21b1('0x2'));var moment=require(_0x21b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x21b1('0x4'));var fs=require('fs');var path=require(_0x21b1('0x5'));var rimraf=require(_0x21b1('0x6'));var config=require(_0x21b1('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0x21b1('0x8')]=function(_0x16ab91,_0x34ed01){return _0x16ab91[_0x21b1('0x9')](_0x21b1('0xa'),attributes,{'tableName':_0x21b1('0xb'),'paranoid':![],'indexes':[{'name':_0x21b1('0xc'),'fields':[_0x21b1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 517c9f7..d219ea8 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3435=['request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x453222,_0xd17a0e){var _0x236ed6=function(_0x35bb82){while(--_0x35bb82){_0x453222['push'](_0x453222['shift']());}};_0x236ed6(++_0xd17a0e);}(_0x3435,0xfa));var _0x5343=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x3435[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x544b29,_0x13641f,_0x1e1911){return new BPromise(function(_0x9ea9b6,_0x245034){return client[_0x5343('0xa')](_0x544b29,_0x1e1911)['then'](function(_0x44421c){logger['info'](_0x5343('0xb'),_0x13641f,_0x5343('0xc'));logger[_0x5343('0xd')](_0x5343('0xe'),_0x13641f,_0x5343('0xc'),JSON['stringify'](_0x44421c));if(_0x44421c[_0x5343('0xf')]){if(_0x44421c[_0x5343('0xf')][_0x5343('0x10')]===0x1f4){logger['error'](_0x5343('0xb'),_0x13641f,_0x44421c['error'][_0x5343('0x11')]);return _0x245034(_0x44421c[_0x5343('0xf')]['message']);}logger[_0x5343('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x13641f,_0x44421c[_0x5343('0xf')][_0x5343('0x11')]);return _0x9ea9b6(_0x44421c[_0x5343('0xf')][_0x5343('0x11')]);}else{logger['info'](_0x5343('0xb'),_0x13641f,_0x5343('0xc'));_0x9ea9b6(_0x44421c[_0x5343('0x12')][_0x5343('0x11')]);}})[_0x5343('0x13')](function(_0x2913e8){logger[_0x5343('0xf')](_0x5343('0xb'),_0x13641f,_0x2913e8);_0x245034(_0x2913e8);});});} \ No newline at end of file +var _0xae1c=['message','info','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xae1c,0xff));var _0xcae1=function(_0x2e1474,_0x1dd6bd){_0x2e1474=_0x2e1474-0x0;var _0x3d8136=_0xae1c[_0x2e1474];return _0x3d8136;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcae1('0x0'));var fs=require('fs');var Redis=require(_0xcae1('0x1'));var db=require(_0xcae1('0x2'))['db'];var utils=require(_0xcae1('0x3'));var logger=require(_0xcae1('0x4'))(_0xcae1('0x5'));var config=require(_0xcae1('0x6'));var jayson=require(_0xcae1('0x7'));var client=jayson[_0xcae1('0x8')][_0xcae1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c35c7,_0x38099e,_0x7a27b8){return new BPromise(function(_0x50d451,_0x4e419d){return client[_0xcae1('0xa')](_0x3c35c7,_0x7a27b8)[_0xcae1('0xb')](function(_0x3284aa){logger['info'](_0xcae1('0xc'),_0x38099e,_0xcae1('0xd'));logger[_0xcae1('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x38099e,_0xcae1('0xd'),JSON[_0xcae1('0xf')](_0x3284aa));if(_0x3284aa['error']){if(_0x3284aa['error'][_0xcae1('0x10')]===0x1f4){logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);return _0x4e419d(_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);}logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);return _0x50d451(_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);}else{logger[_0xcae1('0x13')](_0xcae1('0xc'),_0x38099e,'request\x20sent');_0x50d451(_0x3284aa[_0xcae1('0x14')][_0xcae1('0x12')]);}})['catch'](function(_0x4a7ef7){logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x4a7ef7);_0x4e419d(_0x4a7ef7);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0ca7595..3bd48fe 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdd2=['extname','post','single','create','/:id','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id/download','join','root','originalname','replace','format','%s-%s%s','basename','now'];(function(_0x4b8b98,_0x178c88){var _0x1fb023=function(_0x53aa9b){while(--_0x53aa9b){_0x4b8b98['push'](_0x4b8b98['shift']());}};_0x1fb023(++_0x178c88);}(_0xcdd2,0xc5));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2cdd('0x0'));var path=require(_0x2cdd('0x1'));var timeout=require(_0x2cdd('0x2'));var express=require('express');var router=express[_0x2cdd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cdd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2cdd('0x5'));var controller=require(_0x2cdd('0x6'));router[_0x2cdd('0x7')]('/',auth[_0x2cdd('0x8')](),controller[_0x2cdd('0x9')]);router[_0x2cdd('0x7')]('/:id',auth[_0x2cdd('0x8')](),controller['show']);router[_0x2cdd('0x7')](_0x2cdd('0xa'),auth[_0x2cdd('0x8')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2404a1,_0x25829b,_0x27680b){_0x27680b(null,path[_0x2cdd('0xb')](config[_0x2cdd('0xc')],'server/files/sounds/original/'));},'filename':function(_0x31089f,_0x34222f,_0x554e64){_0x34222f[_0x2cdd('0xd')]=_0x34222f[_0x2cdd('0xd')][_0x2cdd('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x554e64(null,util[_0x2cdd('0xf')](_0x2cdd('0x10'),path[_0x2cdd('0x11')](_0x34222f[_0x2cdd('0xd')],path['extname'](_0x34222f[_0x2cdd('0xd')])),Date[_0x2cdd('0x12')](),path[_0x2cdd('0x13')](_0x34222f[_0x2cdd('0xd')])));}})});router[_0x2cdd('0x14')]('/',upload[_0x2cdd('0x15')]('file'),controller[_0x2cdd('0x16')]);router['put'](_0x2cdd('0x17'),auth[_0x2cdd('0x8')](),controller[_0x2cdd('0x18')]);router['delete']('/:id',auth[_0x2cdd('0x8')](),controller[_0x2cdd('0x19')]);module[_0x2cdd('0x1a')]=router; \ No newline at end of file +var _0xdfb9=['format','%s-%s%s','basename','now','extname','post','single','file','put','update','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','originalname','replace'];(function(_0x1c7f48,_0x255687){var _0x274c31=function(_0x58e252){while(--_0x58e252){_0x1c7f48['push'](_0x1c7f48['shift']());}};_0x274c31(++_0x255687);}(_0xdfb9,0x12d));var _0x9dfb=function(_0x373277,_0x3f916d){_0x373277=_0x373277-0x0;var _0xcd5b33=_0xdfb9[_0x373277];return _0xcd5b33;};'use strict';var multer=require(_0x9dfb('0x0'));var util=require(_0x9dfb('0x1'));var path=require(_0x9dfb('0x2'));var timeout=require('connect-timeout');var express=require(_0x9dfb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9dfb('0x4'));var interaction=require(_0x9dfb('0x5'));var config=require(_0x9dfb('0x6'));var controller=require(_0x9dfb('0x7'));router[_0x9dfb('0x8')]('/',auth[_0x9dfb('0x9')](),controller[_0x9dfb('0xa')]);router[_0x9dfb('0x8')](_0x9dfb('0xb'),auth[_0x9dfb('0x9')](),controller[_0x9dfb('0xc')]);router['get'](_0x9dfb('0xd'),auth[_0x9dfb('0x9')](),controller[_0x9dfb('0xe')]);var upload=multer({'storage':multer[_0x9dfb('0xf')]({'destination':function(_0x6350bc,_0x47043d,_0x447c5e){_0x447c5e(null,path['join'](config['root'],'server/files/sounds/original/'));},'filename':function(_0x1edb7d,_0x446b6f,_0x5a4ccc){_0x446b6f[_0x9dfb('0x10')]=_0x446b6f[_0x9dfb('0x10')][_0x9dfb('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a4ccc(null,util[_0x9dfb('0x12')](_0x9dfb('0x13'),path[_0x9dfb('0x14')](_0x446b6f['originalname'],path['extname'](_0x446b6f[_0x9dfb('0x10')])),Date[_0x9dfb('0x15')](),path[_0x9dfb('0x16')](_0x446b6f[_0x9dfb('0x10')])));}})});router[_0x9dfb('0x17')]('/',upload[_0x9dfb('0x18')](_0x9dfb('0x19')),controller['create']);router[_0x9dfb('0x1a')](_0x9dfb('0xb'),auth['isAuthenticated'](),controller[_0x9dfb('0x1b')]);router[_0x9dfb('0x1c')](_0x9dfb('0xb'),auth[_0x9dfb('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 24480a2..6ff652d 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dbc=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x1b6293,_0x265c05){var _0x546581=function(_0x2098cb){while(--_0x2098cb){_0x1b6293['push'](_0x1b6293['shift']());}};_0x546581(++_0x265c05);}(_0x0dbc,0x1e8));var _0xc0db=function(_0x2e3e25,_0x4966a1){_0x2e3e25=_0x2e3e25-0x0;var _0x4c3714=_0x0dbc[_0x2e3e25];return _0x4c3714;};'use strict';var Sequelize=require(_0xc0db('0x0'));module[_0xc0db('0x1')]={'name':{'type':Sequelize[_0xc0db('0x2')],'unique':_0xc0db('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc0db('0x2')]},'display_name':{'type':Sequelize[_0xc0db('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xc0db('0x2')]},'original_duration':{'type':Sequelize[_0xc0db('0x4')]},'original_sampleCount':{'type':Sequelize[_0xc0db('0x5')]},'original_channelCount':{'type':Sequelize[_0xc0db('0x6')]},'original_bitRate':{'type':Sequelize[_0xc0db('0x5')]},'original_sampleRate':{'type':Sequelize[_0xc0db('0x6')]},'converted_format':{'type':Sequelize[_0xc0db('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc0db('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc0db('0x6')]},'converted_bitRate':{'type':Sequelize[_0xc0db('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xc0db('0x6')]}}; \ No newline at end of file +var _0x26a4=['STRING','name','FLOAT','INTEGER','BIGINT','exports'];(function(_0x2c3fb3,_0x2ed960){var _0x336b5f=function(_0x2734cb){while(--_0x2734cb){_0x2c3fb3['push'](_0x2c3fb3['shift']());}};_0x336b5f(++_0x2ed960);}(_0x26a4,0x119));var _0x426a=function(_0x32df0c,_0x5e8e0c){_0x32df0c=_0x32df0c-0x0;var _0x495c7f=_0x26a4[_0x32df0c];return _0x495c7f;};'use strict';var Sequelize=require('sequelize');module[_0x426a('0x0')]={'name':{'type':Sequelize[_0x426a('0x1')],'unique':_0x426a('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x426a('0x1')]},'display_name':{'type':Sequelize[_0x426a('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x426a('0x1')]},'original_format':{'type':Sequelize[_0x426a('0x1')]},'original_duration':{'type':Sequelize[_0x426a('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x426a('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x426a('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x426a('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x426a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x426a('0x4')]},'converted_bitRate':{'type':Sequelize[_0x426a('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x426a('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0c22ed5..810e154 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd977=['intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','download','find','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','%s.%s','create','basename','file','extname','filename','originalname','server/files/sounds/original','format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','delete','original_format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','get','end','error','name','map','Sound','type','key','model','keys','query','filters'];(function(_0xd92e6f,_0x38d6f5){var _0x70eb4b=function(_0x19c4cb){while(--_0x19c4cb){_0xd92e6f['push'](_0xd92e6f['shift']());}};_0x70eb4b(++_0x38d6f5);}(_0xd977,0xb7));var _0x7d97=function(_0x58af0b,_0x52fbf5){_0x58af0b=_0x58af0b-0x0;var _0x210c68=_0xd977[_0x58af0b];return _0x210c68;};'use strict';var emlformat=require(_0x7d97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d97('0x1'));var jsonpatch=require(_0x7d97('0x2'));var rp=require('request-promise');var moment=require(_0x7d97('0x3'));var BPromise=require(_0x7d97('0x4'));var Mustache=require(_0x7d97('0x5'));var util=require(_0x7d97('0x6'));var path=require(_0x7d97('0x7'));var sox=require(_0x7d97('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d97('0x9'));var _=require(_0x7d97('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7d97('0xb'));var deskjs=require(_0x7d97('0xc'));var toCsv=require(_0x7d97('0xd'));var querystring=require('querystring');var Papa=require(_0x7d97('0xe'));var Redis=require('ioredis');var authService=require(_0x7d97('0xf'));var qs=require(_0x7d97('0x10'));var as=require(_0x7d97('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d97('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7d97('0x13'));var licenseUtil=require(_0x7d97('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe706,_0x229494){_0x229494=_0x229494||0xcc;return function(_0x7a135){if(_0x7a135){return _0x3fe706[_0x7d97('0x15')](_0x229494);}return _0x3fe706[_0x7d97('0x16')](_0x229494)['end']();};}function respondWithResult(_0x4f8ad9,_0x182342){_0x182342=_0x182342||0xc8;return function(_0x544e88){if(_0x544e88){return _0x4f8ad9[_0x7d97('0x16')](_0x182342)[_0x7d97('0x17')](_0x544e88);}};}function respondWithFilteredResult(_0x3b5222,_0x2e30fe){return function(_0x586000){if(_0x586000){var _0x45d89a=typeof _0x2e30fe['offset']===_0x7d97('0x18')&&typeof _0x2e30fe[_0x7d97('0x19')]==='undefined';var _0x3d7e4a=_0x586000[_0x7d97('0x1a')];var _0x138eaa=_0x45d89a?0x0:_0x2e30fe[_0x7d97('0x1b')];var _0x23caf4=_0x45d89a?_0x586000['count']:_0x2e30fe[_0x7d97('0x1b')]+_0x2e30fe[_0x7d97('0x19')];var _0x4295c2;if(_0x23caf4>=_0x3d7e4a){_0x23caf4=_0x3d7e4a;_0x4295c2=0xc8;}else{_0x4295c2=0xce;}_0x3b5222[_0x7d97('0x16')](_0x4295c2);return _0x3b5222[_0x7d97('0x1c')]('Content-Range',_0x138eaa+'-'+_0x23caf4+'/'+_0x3d7e4a)[_0x7d97('0x17')](_0x586000);}return null;};}function patchUpdates(_0x170797){return function(_0x1d240b){try{jsonpatch[_0x7d97('0x1d')](_0x1d240b,_0x170797,!![]);}catch(_0x44ce15){return BPromise[_0x7d97('0x1e')](_0x44ce15);}return _0x1d240b[_0x7d97('0x1f')]();};}function saveUpdates(_0x540f95,_0x3a3a51){return function(_0x5d8a09){if(_0x5d8a09){return _0x5d8a09[_0x7d97('0x20')](_0x540f95)['then'](function(_0x340269){return _0x340269;});}return null;};}function removeEntity(_0x384ab1,_0x31f6c9){return function(_0x510627){if(_0x510627){return _0x510627[_0x7d97('0x21')]()[_0x7d97('0x22')](function(){var _0xb26418=_0x510627[_0x7d97('0x23')]({'plain':!![]});var _0x5b908e='Sounds';return db['UserProfileResource'][_0x7d97('0x21')]({'where':{'type':_0x5b908e,'resourceId':_0xb26418['id']}})[_0x7d97('0x22')](function(){return _0x510627;});})['then'](function(){_0x384ab1['status'](0xcc)[_0x7d97('0x24')]();});}};}function handleEntityNotFound(_0x4eee6e,_0x58ab73){return function(_0x2dd6d5){if(!_0x2dd6d5){_0x4eee6e[_0x7d97('0x15')](0x194);}return _0x2dd6d5;};}function handleError(_0x156cec,_0x33fd61){_0x33fd61=_0x33fd61||0x1f4;return function(_0x9a083f){logger[_0x7d97('0x25')](_0x9a083f['stack']);if(_0x9a083f[_0x7d97('0x26')]){delete _0x9a083f[_0x7d97('0x26')];}_0x156cec[_0x7d97('0x16')](_0x33fd61)['send'](_0x9a083f);};}exports['index']=function(_0x4d4b1f,_0x37066c){var _0x1050ad={},_0x20ab00={},_0x38adb8={'count':0x0,'rows':[]};var _0x544818=_[_0x7d97('0x27')](db[_0x7d97('0x28')]['rawAttributes'],function(_0x5e5ea2){return{'name':_0x5e5ea2['fieldName'],'type':_0x5e5ea2[_0x7d97('0x29')][_0x7d97('0x2a')]};});_0x20ab00[_0x7d97('0x2b')]=_[_0x7d97('0x27')](_0x544818,'name');_0x20ab00['query']=_[_0x7d97('0x2c')](_0x4d4b1f[_0x7d97('0x2d')]);_0x20ab00[_0x7d97('0x2e')]=_['intersection'](_0x20ab00[_0x7d97('0x2b')],_0x20ab00[_0x7d97('0x2d')]);_0x1050ad['attributes']=_[_0x7d97('0x2f')](_0x20ab00['model'],qs[_0x7d97('0x30')](_0x4d4b1f[_0x7d97('0x2d')][_0x7d97('0x30')]));_0x1050ad[_0x7d97('0x31')]=_0x1050ad['attributes'][_0x7d97('0x32')]?_0x1050ad[_0x7d97('0x31')]:_0x20ab00[_0x7d97('0x2b')];if(!_0x4d4b1f[_0x7d97('0x2d')]['hasOwnProperty'](_0x7d97('0x33'))){_0x1050ad[_0x7d97('0x19')]=qs[_0x7d97('0x19')](_0x4d4b1f[_0x7d97('0x2d')][_0x7d97('0x19')]);_0x1050ad['offset']=qs[_0x7d97('0x1b')](_0x4d4b1f[_0x7d97('0x2d')][_0x7d97('0x1b')]);}_0x1050ad['order']=qs[_0x7d97('0x34')](_0x4d4b1f[_0x7d97('0x2d')][_0x7d97('0x34')]);_0x1050ad['where']=qs['filters'](_[_0x7d97('0x35')](_0x4d4b1f[_0x7d97('0x2d')],_0x20ab00[_0x7d97('0x2e')]),_0x544818);if(_0x4d4b1f['query'][_0x7d97('0x36')]){_0x1050ad[_0x7d97('0x37')]=_[_0x7d97('0x38')](_0x1050ad[_0x7d97('0x37')],{'$or':_['map'](_0x544818,function(_0x391c24){if(_0x391c24[_0x7d97('0x29')]!==_0x7d97('0x39')){var _0x259423={};_0x259423[_0x391c24[_0x7d97('0x26')]]={'$like':'%'+_0x4d4b1f[_0x7d97('0x2d')]['filter']+'%'};return _0x259423;}})});}_0x1050ad=_[_0x7d97('0x38')]({},_0x1050ad,_0x4d4b1f[_0x7d97('0x3a')]);var _0xff9764={'where':_0x1050ad[_0x7d97('0x37')]};return db[_0x7d97('0x28')][_0x7d97('0x1a')](_0xff9764)['then'](function(_0x3d1358){_0x38adb8['count']=_0x3d1358;if(_0x4d4b1f[_0x7d97('0x2d')][_0x7d97('0x3b')]){_0x1050ad[_0x7d97('0x3c')]=[{'all':!![]}];}return db[_0x7d97('0x28')]['findAll'](_0x1050ad);})[_0x7d97('0x22')](function(_0x5a5c8c){_0x38adb8[_0x7d97('0x3d')]=_0x5a5c8c;return _0x38adb8;})[_0x7d97('0x22')](respondWithFilteredResult(_0x37066c,_0x1050ad))[_0x7d97('0x3e')](handleError(_0x37066c,null));};exports[_0x7d97('0x3f')]=function(_0x2bb45e,_0x4e13c8){var _0x195042={'raw':!![],'where':{'id':_0x2bb45e['params']['id']}},_0x1cfb53={};_0x1cfb53[_0x7d97('0x2b')]=_[_0x7d97('0x2c')](db[_0x7d97('0x28')][_0x7d97('0x40')]);_0x1cfb53[_0x7d97('0x2d')]=_['keys'](_0x2bb45e[_0x7d97('0x2d')]);_0x1cfb53['filters']=_[_0x7d97('0x2f')](_0x1cfb53[_0x7d97('0x2b')],_0x1cfb53['query']);_0x195042['attributes']=_['intersection'](_0x1cfb53[_0x7d97('0x2b')],qs[_0x7d97('0x30')](_0x2bb45e[_0x7d97('0x2d')][_0x7d97('0x30')]));_0x195042[_0x7d97('0x31')]=_0x195042[_0x7d97('0x31')]['length']?_0x195042[_0x7d97('0x31')]:_0x1cfb53[_0x7d97('0x2b')];if(_0x2bb45e[_0x7d97('0x2d')][_0x7d97('0x3b')]){_0x195042['include']=[{'all':!![]}];}_0x195042=_[_0x7d97('0x38')]({},_0x195042,_0x2bb45e[_0x7d97('0x3a')]);return db['Sound']['find'](_0x195042)['then'](handleEntityNotFound(_0x4e13c8,null))[_0x7d97('0x22')](respondWithResult(_0x4e13c8,null))['catch'](handleError(_0x4e13c8,null));};exports[_0x7d97('0x41')]=function(_0x9f8c2d,_0x365d7c,_0x396413){return db[_0x7d97('0x28')][_0x7d97('0x42')]({'where':{'id':_0x9f8c2d[_0x7d97('0x43')]['id']},'attributes':[_0x7d97('0x26'),_0x7d97('0x44'),_0x7d97('0x45')],'raw':!![]})['then'](handleEntityNotFound(_0x365d7c,null))['then'](function(_0x3b6c15){if(_0x3b6c15){if(!fs[_0x7d97('0x46')](path[_0x7d97('0x47')](config[_0x7d97('0x48')],_0x7d97('0x49'),_0x3b6c15[_0x7d97('0x44')]+'.'+_0x3b6c15[_0x7d97('0x45')]))){throw new db[(_0x7d97('0x4a'))][(_0x7d97('0x4b'))]('Sound\x20not\x20found');}return _0x365d7c[_0x7d97('0x41')](path[_0x7d97('0x47')](config[_0x7d97('0x48')],_0x7d97('0x49'),util['format'](_0x7d97('0x4c'),_0x3b6c15['save_name'],_0x3b6c15[_0x7d97('0x45')])),util['format']('%s.%s',_0x3b6c15['name'],_0x3b6c15['converted_format']));}return null;})['catch'](handleError(_0x365d7c,null));};exports[_0x7d97('0x4d')]=function(_0x2c6eda,_0xa0bb98,_0x557ded){var _0x4d5b3e={'name':path[_0x7d97('0x4e')](_0x2c6eda[_0x7d97('0x4f')]['originalname'],path[_0x7d97('0x50')](_0x2c6eda[_0x7d97('0x4f')]['originalname'])),'save_name':path[_0x7d97('0x4e')](_0x2c6eda[_0x7d97('0x4f')][_0x7d97('0x51')],path[_0x7d97('0x50')](_0x2c6eda['file'][_0x7d97('0x51')])),'original_format':path[_0x7d97('0x50')](_0x2c6eda[_0x7d97('0x4f')][_0x7d97('0x52')])['substring'](0x1),'converted_format':'wav'};var _0x2c05d3=path[_0x7d97('0x47')](config[_0x7d97('0x48')],_0x7d97('0x53'),_0x2c6eda[_0x7d97('0x4f')][_0x7d97('0x51')]);var _0x3c86b7=path[_0x7d97('0x47')](config[_0x7d97('0x48')],_0x7d97('0x49'),util[_0x7d97('0x54')]('%s.%s',path[_0x7d97('0x4e')](_0x2c6eda[_0x7d97('0x4f')][_0x7d97('0x51')],path['extname'](_0x2c6eda[_0x7d97('0x4f')][_0x7d97('0x51')])),_0x4d5b3e['converted_format']));logger[_0x7d97('0x55')](_0x7d97('0x56'),_0x2c05d3);logger[_0x7d97('0x55')](_0x7d97('0x57'),_0x3c86b7);try{fs['chmodSync'](_0x2c05d3,parseInt(_0x7d97('0x58'),0x8));var _0x6e7aef=sox[_0x7d97('0x59')](_0x2c05d3,_0x3c86b7,{'sampleRate':0x1f40,'format':_0x7d97('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6e7aef['on'](_0x7d97('0x25'),function(_0x416c61){fs[_0x7d97('0x5b')](_0x2c05d3);_0xa0bb98[_0x7d97('0x16')](0x1f4)[_0x7d97('0x5c')](_0x416c61);});_0x6e7aef['on'](_0x7d97('0x5d'),function(_0x58680b){_0x4d5b3e[_0x7d97('0x5e')]=isNaN(_0x58680b[_0x7d97('0x5f')])?null:_0x58680b[_0x7d97('0x5f')]*0x3e8;_0x4d5b3e[_0x7d97('0x60')]=isNaN(_0x58680b[_0x7d97('0x61')])?null:_0x58680b[_0x7d97('0x61')];_0x4d5b3e['original_channelCount']=isNaN(_0x58680b[_0x7d97('0x62')])?null:_0x58680b['channelCount'];_0x4d5b3e['original_bitRate']=isNaN(_0x58680b[_0x7d97('0x63')])?null:_0x58680b[_0x7d97('0x63')];_0x4d5b3e[_0x7d97('0x64')]=isNaN(_0x58680b[_0x7d97('0x65')])?null:_0x58680b[_0x7d97('0x65')];});_0x6e7aef['on'](_0x7d97('0x66'),function(_0x181deb){_0x4d5b3e['converted_duration']=isNaN(_0x181deb[_0x7d97('0x5f')])?null:_0x181deb['duration']*0x3e8;_0x4d5b3e['converted_sampleCount']=isNaN(_0x181deb['sampleCount'])?null:_0x181deb['sampleCount'];_0x4d5b3e[_0x7d97('0x67')]=isNaN(_0x181deb[_0x7d97('0x62')])?null:_0x181deb[_0x7d97('0x62')];_0x4d5b3e[_0x7d97('0x68')]=isNaN(_0x181deb[_0x7d97('0x63')])?null:_0x181deb[_0x7d97('0x63')];_0x4d5b3e[_0x7d97('0x69')]=isNaN(_0x181deb[_0x7d97('0x65')])?null:_0x181deb[_0x7d97('0x65')];});_0x6e7aef['on'](_0x7d97('0x24'),function(){fs['chmodSync'](_0x3c86b7,parseInt('0777',0x8));return db['Sound']['create'](_0x4d5b3e)[_0x7d97('0x22')](function(_0xddb2c3){var _0x166fd1={'role':_0x2c6eda['body'][_0x7d97('0x6a')],'userProfileId':_0x2c6eda[_0x7d97('0x6b')]['userProfileId']};if(!_0x166fd1)throw new Error(_0x7d97('0x6c'));if(_0x166fd1[_0x7d97('0x6a')]===_0x7d97('0x6d')){var _0x236643=_0xddb2c3[_0x7d97('0x23')]({'plain':!![]});return db[_0x7d97('0x6e')]['find']({'where':{'name':'Sounds','userProfileId':_0x166fd1[_0x7d97('0x6f')]},'raw':!![]})['then'](function(_0x404356){if(_0x404356&&_0x404356['autoAssociation']===0x0){return db[_0x7d97('0x70')][_0x7d97('0x4d')]({'name':_0x236643[_0x7d97('0x26')],'resourceId':_0x236643['id'],'type':_0x404356['name'],'sectionId':_0x404356['id']},{})[_0x7d97('0x22')](function(){return _0xddb2c3;});}else{return _0xddb2c3;}})[_0x7d97('0x3e')](function(_0x395048){logger[_0x7d97('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x395048);throw _0x395048;});}return _0xddb2c3;})[_0x7d97('0x22')](respondWithResult(_0xa0bb98,null))[_0x7d97('0x3e')](handleError(_0xa0bb98,null));});_0x6e7aef['start']();}catch(_0x4006c8){_0xa0bb98[_0x7d97('0x16')](0x1f4)[_0x7d97('0x5c')](_0x4006c8);}};exports[_0x7d97('0x20')]=function(_0x43c4ea,_0x5d5a69,_0xb671e2){return db[_0x7d97('0x28')]['find']({'where':{'id':_0x43c4ea[_0x7d97('0x43')]['id']}})[_0x7d97('0x22')](handleEntityNotFound(_0x5d5a69,null))['then'](saveUpdates(_[_0x7d97('0x35')](_0x43c4ea[_0x7d97('0x6b')],[_0x7d97('0x26'),'description']),null))['then'](respondWithResult(_0x5d5a69,null))[_0x7d97('0x3e')](handleError(_0x5d5a69,null));};exports[_0x7d97('0x71')]=function(_0x3a5d2c,_0x1957fd,_0x4e5cee){return db['Sound'][_0x7d97('0x42')]({'where':{'id':_0x3a5d2c[_0x7d97('0x43')]['id']}})[_0x7d97('0x22')](function(_0x4fa7ce){if(_0x4fa7ce){return _0x4fa7ce[_0x7d97('0x21')]();}})[_0x7d97('0x22')](function(_0x4282b5){var _0xdd4b59=path[_0x7d97('0x47')](config[_0x7d97('0x48')],_0x7d97('0x53'),util[_0x7d97('0x54')](_0x7d97('0x4c'),_0x4282b5[_0x7d97('0x44')],_0x4282b5[_0x7d97('0x72')]));var _0x4ec068=path[_0x7d97('0x47')](config[_0x7d97('0x48')],_0x7d97('0x49'),util[_0x7d97('0x54')](_0x7d97('0x4c'),_0x4282b5[_0x7d97('0x44')],_0x4282b5[_0x7d97('0x45')]));fs[_0x7d97('0x5b')](_0xdd4b59);fs[_0x7d97('0x5b')](_0x4ec068);return _0x4282b5;})[_0x7d97('0x22')](function(_0x1d64ea){if(_0x1d64ea){return _0x1957fd[_0x7d97('0x16')](0xcc)[_0x7d97('0x24')]();}})[_0x7d97('0x22')](handleEntityNotFound(_0x1957fd,null))['catch'](handleError(_0x1957fd,null));}; \ No newline at end of file +var _0x4cbd=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','get','Sounds','UserProfileResource','destroy','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','download','save_name','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','%s.%s','catch','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','format','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','start','update','description','delete','root','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5d5a70,_0x3ca3df){var _0x2959a6=function(_0x118b23){while(--_0x118b23){_0x5d5a70['push'](_0x5d5a70['shift']());}};_0x2959a6(++_0x3ca3df);}(_0x4cbd,0x1f1));var _0xd4cb=function(_0x3cda26,_0x31a42a){_0x3cda26=_0x3cda26-0x0;var _0x45469f=_0x4cbd[_0x3cda26];return _0x45469f;};'use strict';var emlformat=require(_0xd4cb('0x0'));var rimraf=require(_0xd4cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cb('0x2'));var rp=require(_0xd4cb('0x3'));var moment=require(_0xd4cb('0x4'));var BPromise=require(_0xd4cb('0x5'));var Mustache=require(_0xd4cb('0x6'));var util=require(_0xd4cb('0x7'));var path=require(_0xd4cb('0x8'));var sox=require(_0xd4cb('0x9'));var csv=require(_0xd4cb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4cb('0xb'));var _=require(_0xd4cb('0xc'));var squel=require(_0xd4cb('0xd'));var crypto=require(_0xd4cb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd4cb('0xf'));var toCsv=require(_0xd4cb('0xa'));var querystring=require('querystring');var Papa=require(_0xd4cb('0x10'));var Redis=require(_0xd4cb('0x11'));var authService=require(_0xd4cb('0x12'));var qs=require(_0xd4cb('0x13'));var as=require(_0xd4cb('0x14'));var hardwareService=require(_0xd4cb('0x15'));var logger=require(_0xd4cb('0x16'))(_0xd4cb('0x17'));var utils=require('../../config/utils');var config=require(_0xd4cb('0x18'));var licenseUtil=require(_0xd4cb('0x19'));var db=require(_0xd4cb('0x1a'))['db'];function respondWithStatusCode(_0x3bf312,_0x314fac){_0x314fac=_0x314fac||0xcc;return function(_0x39c61f){if(_0x39c61f){return _0x3bf312[_0xd4cb('0x1b')](_0x314fac);}return _0x3bf312[_0xd4cb('0x1c')](_0x314fac)[_0xd4cb('0x1d')]();};}function respondWithResult(_0x24989b,_0x4bb11f){_0x4bb11f=_0x4bb11f||0xc8;return function(_0x536a7f){if(_0x536a7f){return _0x24989b['status'](_0x4bb11f)[_0xd4cb('0x1e')](_0x536a7f);}};}function respondWithFilteredResult(_0x5a1f84,_0x5ce013){return function(_0x2a2115){if(_0x2a2115){var _0x41694d=typeof _0x5ce013[_0xd4cb('0x1f')]===_0xd4cb('0x20')&&typeof _0x5ce013[_0xd4cb('0x21')]===_0xd4cb('0x20');var _0x2c4850=_0x2a2115['count'];var _0x70977=_0x41694d?0x0:_0x5ce013['offset'];var _0x5a25ee=_0x41694d?_0x2a2115['count']:_0x5ce013[_0xd4cb('0x1f')]+_0x5ce013[_0xd4cb('0x21')];var _0x49e81a;if(_0x5a25ee>=_0x2c4850){_0x5a25ee=_0x2c4850;_0x49e81a=0xc8;}else{_0x49e81a=0xce;}_0x5a1f84['status'](_0x49e81a);return _0x5a1f84[_0xd4cb('0x22')]('Content-Range',_0x70977+'-'+_0x5a25ee+'/'+_0x2c4850)[_0xd4cb('0x1e')](_0x2a2115);}return null;};}function patchUpdates(_0x19d8d7){return function(_0x46ca80){try{jsonpatch[_0xd4cb('0x23')](_0x46ca80,_0x19d8d7,!![]);}catch(_0x31f182){return BPromise[_0xd4cb('0x24')](_0x31f182);}return _0x46ca80[_0xd4cb('0x25')]();};}function saveUpdates(_0x39667c,_0x239ac1){return function(_0x543538){if(_0x543538){return _0x543538['update'](_0x39667c)[_0xd4cb('0x26')](function(_0x54adf2){return _0x54adf2;});}return null;};}function removeEntity(_0x3e9a1e,_0x468be9){return function(_0xd1fe2d){if(_0xd1fe2d){return _0xd1fe2d['destroy']()['then'](function(){var _0x22068f=_0xd1fe2d[_0xd4cb('0x27')]({'plain':!![]});var _0xc1f9a8=_0xd4cb('0x28');return db[_0xd4cb('0x29')][_0xd4cb('0x2a')]({'where':{'type':_0xc1f9a8,'resourceId':_0x22068f['id']}})[_0xd4cb('0x26')](function(){return _0xd1fe2d;});})['then'](function(){_0x3e9a1e[_0xd4cb('0x1c')](0xcc)[_0xd4cb('0x1d')]();});}};}function handleEntityNotFound(_0x1b2417,_0x2e4789){return function(_0x59f0c6){if(!_0x59f0c6){_0x1b2417[_0xd4cb('0x1b')](0x194);}return _0x59f0c6;};}function handleError(_0x417c2d,_0x3613fb){_0x3613fb=_0x3613fb||0x1f4;return function(_0x4d05c5){logger[_0xd4cb('0x2b')](_0x4d05c5['stack']);if(_0x4d05c5[_0xd4cb('0x2c')]){delete _0x4d05c5[_0xd4cb('0x2c')];}_0x417c2d[_0xd4cb('0x1c')](_0x3613fb)[_0xd4cb('0x2d')](_0x4d05c5);};}exports[_0xd4cb('0x2e')]=function(_0x5eec6c,_0x2315f5){var _0x2c6269={},_0x3b980c={},_0x479db8={'count':0x0,'rows':[]};var _0x1b9e49=_[_0xd4cb('0x2f')](db[_0xd4cb('0x30')][_0xd4cb('0x31')],function(_0x10d06e){return{'name':_0x10d06e[_0xd4cb('0x32')],'type':_0x10d06e[_0xd4cb('0x33')][_0xd4cb('0x34')]};});_0x3b980c[_0xd4cb('0x35')]=_[_0xd4cb('0x2f')](_0x1b9e49,_0xd4cb('0x2c'));_0x3b980c[_0xd4cb('0x36')]=_[_0xd4cb('0x37')](_0x5eec6c[_0xd4cb('0x36')]);_0x3b980c[_0xd4cb('0x38')]=_[_0xd4cb('0x39')](_0x3b980c[_0xd4cb('0x35')],_0x3b980c[_0xd4cb('0x36')]);_0x2c6269['attributes']=_['intersection'](_0x3b980c[_0xd4cb('0x35')],qs[_0xd4cb('0x3a')](_0x5eec6c['query'][_0xd4cb('0x3a')]));_0x2c6269[_0xd4cb('0x3b')]=_0x2c6269['attributes'][_0xd4cb('0x3c')]?_0x2c6269['attributes']:_0x3b980c[_0xd4cb('0x35')];if(!_0x5eec6c[_0xd4cb('0x36')][_0xd4cb('0x3d')]('nolimit')){_0x2c6269[_0xd4cb('0x21')]=qs[_0xd4cb('0x21')](_0x5eec6c['query']['limit']);_0x2c6269[_0xd4cb('0x1f')]=qs['offset'](_0x5eec6c['query'][_0xd4cb('0x1f')]);}_0x2c6269[_0xd4cb('0x3e')]=qs[_0xd4cb('0x3f')](_0x5eec6c[_0xd4cb('0x36')]['sort']);_0x2c6269[_0xd4cb('0x40')]=qs['filters'](_[_0xd4cb('0x41')](_0x5eec6c[_0xd4cb('0x36')],_0x3b980c[_0xd4cb('0x38')]),_0x1b9e49);if(_0x5eec6c[_0xd4cb('0x36')][_0xd4cb('0x42')]){_0x2c6269[_0xd4cb('0x40')]=_[_0xd4cb('0x43')](_0x2c6269['where'],{'$or':_[_0xd4cb('0x2f')](_0x1b9e49,function(_0x1c01f7){if(_0x1c01f7[_0xd4cb('0x33')]!==_0xd4cb('0x44')){var _0x457170={};_0x457170[_0x1c01f7[_0xd4cb('0x2c')]]={'$like':'%'+_0x5eec6c['query'][_0xd4cb('0x42')]+'%'};return _0x457170;}})});}_0x2c6269=_[_0xd4cb('0x43')]({},_0x2c6269,_0x5eec6c[_0xd4cb('0x45')]);var _0xe6f6d8={'where':_0x2c6269[_0xd4cb('0x40')]};return db[_0xd4cb('0x30')][_0xd4cb('0x46')](_0xe6f6d8)[_0xd4cb('0x26')](function(_0x567e7e){_0x479db8[_0xd4cb('0x46')]=_0x567e7e;if(_0x5eec6c[_0xd4cb('0x36')][_0xd4cb('0x47')]){_0x2c6269[_0xd4cb('0x48')]=[{'all':!![]}];}return db['Sound'][_0xd4cb('0x49')](_0x2c6269);})[_0xd4cb('0x26')](function(_0x4d0841){_0x479db8[_0xd4cb('0x4a')]=_0x4d0841;return _0x479db8;})['then'](respondWithFilteredResult(_0x2315f5,_0x2c6269))['catch'](handleError(_0x2315f5,null));};exports[_0xd4cb('0x4b')]=function(_0x1bfb7b,_0x199120){var _0x413740={'raw':!![],'where':{'id':_0x1bfb7b[_0xd4cb('0x4c')]['id']}},_0x5adab4={};_0x5adab4['model']=_[_0xd4cb('0x37')](db['Sound']['rawAttributes']);_0x5adab4[_0xd4cb('0x36')]=_[_0xd4cb('0x37')](_0x1bfb7b[_0xd4cb('0x36')]);_0x5adab4[_0xd4cb('0x38')]=_[_0xd4cb('0x39')](_0x5adab4[_0xd4cb('0x35')],_0x5adab4[_0xd4cb('0x36')]);_0x413740[_0xd4cb('0x3b')]=_['intersection'](_0x5adab4['model'],qs[_0xd4cb('0x3a')](_0x1bfb7b[_0xd4cb('0x36')][_0xd4cb('0x3a')]));_0x413740['attributes']=_0x413740[_0xd4cb('0x3b')][_0xd4cb('0x3c')]?_0x413740[_0xd4cb('0x3b')]:_0x5adab4[_0xd4cb('0x35')];if(_0x1bfb7b[_0xd4cb('0x36')][_0xd4cb('0x47')]){_0x413740[_0xd4cb('0x48')]=[{'all':!![]}];}_0x413740=_[_0xd4cb('0x43')]({},_0x413740,_0x1bfb7b[_0xd4cb('0x45')]);return db[_0xd4cb('0x30')][_0xd4cb('0x4d')](_0x413740)[_0xd4cb('0x26')](handleEntityNotFound(_0x199120,null))[_0xd4cb('0x26')](respondWithResult(_0x199120,null))['catch'](handleError(_0x199120,null));};exports[_0xd4cb('0x4e')]=function(_0x1b6b8f,_0x23f838,_0x34edff){return db[_0xd4cb('0x30')]['find']({'where':{'id':_0x1b6b8f[_0xd4cb('0x4c')]['id']},'attributes':[_0xd4cb('0x2c'),_0xd4cb('0x4f'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x23f838,null))[_0xd4cb('0x26')](function(_0x5e762f){if(_0x5e762f){if(!fs[_0xd4cb('0x50')](path['join'](config['root'],_0xd4cb('0x51'),_0x5e762f[_0xd4cb('0x4f')]+'.'+_0x5e762f[_0xd4cb('0x52')]))){throw new db[(_0xd4cb('0x53'))][(_0xd4cb('0x54'))]('Sound\x20not\x20found');}return _0x23f838[_0xd4cb('0x4e')](path[_0xd4cb('0x55')](config['root'],_0xd4cb('0x51'),util['format'](_0xd4cb('0x56'),_0x5e762f[_0xd4cb('0x4f')],_0x5e762f['converted_format'])),util['format'](_0xd4cb('0x56'),_0x5e762f[_0xd4cb('0x2c')],_0x5e762f['converted_format']));}return null;})[_0xd4cb('0x57')](handleError(_0x23f838,null));};exports[_0xd4cb('0x58')]=function(_0x2d0fe8,_0x29f240,_0x4d7db0){var _0x3298fe={'name':path[_0xd4cb('0x59')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5b')],path[_0xd4cb('0x5c')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5b')])),'save_name':path[_0xd4cb('0x59')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')],path[_0xd4cb('0x5c')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')])),'original_format':path['extname'](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5b')])[_0xd4cb('0x5e')](0x1),'converted_format':_0xd4cb('0x5f')};var _0x1c8df6=path[_0xd4cb('0x55')](config['root'],_0xd4cb('0x60'),_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')]);var _0x8c0e86=path[_0xd4cb('0x55')](config['root'],_0xd4cb('0x51'),util[_0xd4cb('0x61')](_0xd4cb('0x56'),path[_0xd4cb('0x59')](_0x2d0fe8['file'][_0xd4cb('0x5d')],path[_0xd4cb('0x5c')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')])),_0x3298fe['converted_format']));logger[_0xd4cb('0x62')](_0xd4cb('0x63'),_0x1c8df6);logger[_0xd4cb('0x62')]('Sound\x20upload\x20destination:\x20%s',_0x8c0e86);try{fs['chmodSync'](_0x1c8df6,parseInt(_0xd4cb('0x64'),0x8));var _0x1d2dfc=sox[_0xd4cb('0x65')](_0x1c8df6,_0x8c0e86,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1d2dfc['on'](_0xd4cb('0x2b'),function(_0x29c8d4){fs[_0xd4cb('0x66')](_0x1c8df6);_0x29f240[_0xd4cb('0x1c')](0x1f4)[_0xd4cb('0x2d')](_0x29c8d4);});_0x1d2dfc['on'](_0xd4cb('0x67'),function(_0x583793){_0x3298fe[_0xd4cb('0x68')]=isNaN(_0x583793['duration'])?null:_0x583793[_0xd4cb('0x69')]*0x3e8;_0x3298fe[_0xd4cb('0x6a')]=isNaN(_0x583793[_0xd4cb('0x6b')])?null:_0x583793[_0xd4cb('0x6b')];_0x3298fe[_0xd4cb('0x6c')]=isNaN(_0x583793[_0xd4cb('0x6d')])?null:_0x583793[_0xd4cb('0x6d')];_0x3298fe[_0xd4cb('0x6e')]=isNaN(_0x583793[_0xd4cb('0x6f')])?null:_0x583793['bitRate'];_0x3298fe[_0xd4cb('0x70')]=isNaN(_0x583793[_0xd4cb('0x71')])?null:_0x583793[_0xd4cb('0x71')];});_0x1d2dfc['on']('dest',function(_0x5bfd60){_0x3298fe['converted_duration']=isNaN(_0x5bfd60[_0xd4cb('0x69')])?null:_0x5bfd60[_0xd4cb('0x69')]*0x3e8;_0x3298fe[_0xd4cb('0x72')]=isNaN(_0x5bfd60[_0xd4cb('0x6b')])?null:_0x5bfd60[_0xd4cb('0x6b')];_0x3298fe[_0xd4cb('0x73')]=isNaN(_0x5bfd60[_0xd4cb('0x6d')])?null:_0x5bfd60[_0xd4cb('0x6d')];_0x3298fe[_0xd4cb('0x74')]=isNaN(_0x5bfd60[_0xd4cb('0x6f')])?null:_0x5bfd60[_0xd4cb('0x6f')];_0x3298fe['converted_sampleRate']=isNaN(_0x5bfd60[_0xd4cb('0x71')])?null:_0x5bfd60['sampleRate'];});_0x1d2dfc['on'](_0xd4cb('0x1d'),function(){fs[_0xd4cb('0x75')](_0x8c0e86,parseInt('0777',0x8));return db[_0xd4cb('0x30')][_0xd4cb('0x58')](_0x3298fe)[_0xd4cb('0x26')](function(_0x53470a){var _0x3e6812={'role':_0x2d0fe8[_0xd4cb('0x76')][_0xd4cb('0x77')],'userProfileId':_0x2d0fe8[_0xd4cb('0x76')]['userProfileId']};if(!_0x3e6812)throw new Error(_0xd4cb('0x78'));if(_0x3e6812[_0xd4cb('0x77')]===_0xd4cb('0x79')){var _0x56c424=_0x53470a['get']({'plain':!![]});return db[_0xd4cb('0x7a')][_0xd4cb('0x4d')]({'where':{'name':'Sounds','userProfileId':_0x3e6812[_0xd4cb('0x7b')]},'raw':!![]})[_0xd4cb('0x26')](function(_0x1d5872){if(_0x1d5872&&_0x1d5872[_0xd4cb('0x7c')]===0x0){return db[_0xd4cb('0x29')][_0xd4cb('0x58')]({'name':_0x56c424[_0xd4cb('0x2c')],'resourceId':_0x56c424['id'],'type':_0x1d5872[_0xd4cb('0x2c')],'sectionId':_0x1d5872['id']},{})[_0xd4cb('0x26')](function(){return _0x53470a;});}else{return _0x53470a;}})['catch'](function(_0x18f167){logger[_0xd4cb('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18f167);throw _0x18f167;});}return _0x53470a;})[_0xd4cb('0x26')](respondWithResult(_0x29f240,null))[_0xd4cb('0x57')](handleError(_0x29f240,null));});_0x1d2dfc[_0xd4cb('0x7d')]();}catch(_0x4cb8c9){_0x29f240[_0xd4cb('0x1c')](0x1f4)[_0xd4cb('0x2d')](_0x4cb8c9);}};exports[_0xd4cb('0x7e')]=function(_0xed1cd1,_0x548a08,_0x31e887){return db[_0xd4cb('0x30')][_0xd4cb('0x4d')]({'where':{'id':_0xed1cd1['params']['id']}})['then'](handleEntityNotFound(_0x548a08,null))[_0xd4cb('0x26')](saveUpdates(_[_0xd4cb('0x41')](_0xed1cd1[_0xd4cb('0x76')],[_0xd4cb('0x2c'),_0xd4cb('0x7f')]),null))[_0xd4cb('0x26')](respondWithResult(_0x548a08,null))[_0xd4cb('0x57')](handleError(_0x548a08,null));};exports[_0xd4cb('0x80')]=function(_0x127ed0,_0x26c747,_0x9dab20){return db[_0xd4cb('0x30')][_0xd4cb('0x4d')]({'where':{'id':_0x127ed0[_0xd4cb('0x4c')]['id']}})[_0xd4cb('0x26')](function(_0xa3372d){if(_0xa3372d){return _0xa3372d[_0xd4cb('0x2a')]();}})['then'](function(_0x1b4b2a){var _0x568afc=path[_0xd4cb('0x55')](config[_0xd4cb('0x81')],_0xd4cb('0x60'),util[_0xd4cb('0x61')](_0xd4cb('0x56'),_0x1b4b2a[_0xd4cb('0x4f')],_0x1b4b2a['original_format']));var _0x53ddde=path[_0xd4cb('0x55')](config['root'],'server/files/sounds/converted',util[_0xd4cb('0x61')](_0xd4cb('0x56'),_0x1b4b2a[_0xd4cb('0x4f')],_0x1b4b2a[_0xd4cb('0x52')]));fs[_0xd4cb('0x66')](_0x568afc);fs[_0xd4cb('0x66')](_0x53ddde);return _0x1b4b2a;})[_0xd4cb('0x26')](function(_0x49b5cf){if(_0x49b5cf){return _0x26c747[_0xd4cb('0x1c')](0xcc)[_0xd4cb('0x1d')]();}})['then'](handleEntityNotFound(_0x26c747,null))[_0xd4cb('0x57')](handleError(_0x26c747,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index ce80eae..6cf0d57 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a24=['path','../../config/environment','./sound.attributes','exports','define','tools_sounds','util','api','bluebird','request-promise'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x6a24,0x92));var _0x46a2=function(_0x4496fc,_0x3e4bdb){_0x4496fc=_0x4496fc-0x0;var _0x5dcf3d=_0x6a24[_0x4496fc];return _0x5dcf3d;};'use strict';var _=require('lodash');var util=require(_0x46a2('0x0'));var logger=require('../../config/logger')(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var fs=require('fs');var path=require(_0x46a2('0x4'));var rimraf=require('rimraf');var config=require(_0x46a2('0x5'));var attributes=require(_0x46a2('0x6'));module[_0x46a2('0x7')]=function(_0x402c79,_0x4d3f5c){return _0x402c79[_0x46a2('0x8')]('Sound',attributes,{'tableName':_0x46a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9313=['path','../../config/environment','./sound.attributes','Sound','tools_sounds','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x9313,0x177));var _0x3931=function(_0x99ea32,_0x385c64){_0x99ea32=_0x99ea32-0x0;var _0x5d8fc6=_0x9313[_0x99ea32];return _0x5d8fc6;};'use strict';var _=require(_0x3931('0x0'));var util=require('util');var logger=require(_0x3931('0x1'))(_0x3931('0x2'));var moment=require('moment');var BPromise=require(_0x3931('0x3'));var rp=require(_0x3931('0x4'));var fs=require('fs');var path=require(_0x3931('0x5'));var rimraf=require('rimraf');var config=require(_0x3931('0x6'));var attributes=require(_0x3931('0x7'));module['exports']=function(_0x309875,_0x10bb45){return _0x309875['define'](_0x3931('0x8'),attributes,{'tableName':_0x3931('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 5565a78..30f78bc 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb934=['model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','info','result','ShowSound','find','options','raw','where','attributes','map','include'];(function(_0xb6afda,_0x55854e){var _0x8c25e3=function(_0x550be5){while(--_0x550be5){_0xb6afda['push'](_0xb6afda['shift']());}};_0x8c25e3(++_0x55854e);}(_0xb934,0x111));var _0x4b93=function(_0x1c8d3b,_0x57c66b){_0x1c8d3b=_0x1c8d3b-0x0;var _0x4f1b34=_0xb934[_0x1c8d3b];return _0x4f1b34;};'use strict';var _=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var moment=require(_0x4b93('0x2'));var BPromise=require(_0x4b93('0x3'));var rs=require(_0x4b93('0x4'));var fs=require('fs');var Redis=require(_0x4b93('0x5'));var db=require(_0x4b93('0x6'))['db'];var utils=require(_0x4b93('0x7'));var logger=require(_0x4b93('0x8'))(_0x4b93('0x9'));var config=require(_0x4b93('0xa'));var jayson=require(_0x4b93('0xb'));var client=jayson[_0x4b93('0xc')][_0x4b93('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c45ad,_0xda89f4,_0x2c063c){return new BPromise(function(_0x34caee,_0x289647){return client[_0x4b93('0xe')](_0x4c45ad,_0x2c063c)[_0x4b93('0xf')](function(_0x10418a){logger['info']('Sound,\x20%s,\x20%s',_0xda89f4,_0x4b93('0x10'));logger['debug'](_0x4b93('0x11'),_0xda89f4,_0x4b93('0x10'),JSON[_0x4b93('0x12')](_0x10418a));if(_0x10418a[_0x4b93('0x13')]){if(_0x10418a[_0x4b93('0x13')][_0x4b93('0x14')]===0x1f4){logger[_0x4b93('0x13')](_0x4b93('0x15'),_0xda89f4,_0x10418a['error']['message']);return _0x289647(_0x10418a[_0x4b93('0x13')][_0x4b93('0x16')]);}logger[_0x4b93('0x13')](_0x4b93('0x15'),_0xda89f4,_0x10418a[_0x4b93('0x13')][_0x4b93('0x16')]);return _0x34caee(_0x10418a[_0x4b93('0x13')]['message']);}else{logger[_0x4b93('0x17')](_0x4b93('0x15'),_0xda89f4,_0x4b93('0x10'));_0x34caee(_0x10418a[_0x4b93('0x18')][_0x4b93('0x16')]);}})['catch'](function(_0x14709d){logger['error'](_0x4b93('0x15'),_0xda89f4,_0x14709d);_0x289647(_0x14709d);});});}exports[_0x4b93('0x19')]=function(_0x573aa7){var _0x5d7d8a=this;return new Promise(function(_0x4c814d,_0x1f4c23){return db['Sound'][_0x4b93('0x1a')]({'raw':_0x573aa7['options']?_0x573aa7[_0x4b93('0x1b')][_0x4b93('0x1c')]===undefined?!![]:![]:!![],'where':_0x573aa7['options']?_0x573aa7[_0x4b93('0x1b')][_0x4b93('0x1d')]||null:null,'attributes':_0x573aa7[_0x4b93('0x1b')]?_0x573aa7[_0x4b93('0x1b')][_0x4b93('0x1e')]||null:null,'include':_0x573aa7[_0x4b93('0x1b')]?_0x573aa7['options']['include']?_[_0x4b93('0x1f')](_0x573aa7[_0x4b93('0x1b')][_0x4b93('0x20')],function(_0x4e06b2){return{'model':db[_0x4e06b2[_0x4b93('0x21')]],'as':_0x4e06b2['as'],'attributes':_0x4e06b2['attributes'],'include':_0x4e06b2[_0x4b93('0x20')]?_['map'](_0x4e06b2['include'],function(_0x5c8672){return{'model':db[_0x5c8672[_0x4b93('0x21')]],'as':_0x5c8672['as'],'attributes':_0x5c8672[_0x4b93('0x1e')],'include':_0x5c8672[_0x4b93('0x20')]?_[_0x4b93('0x1f')](_0x5c8672['include'],function(_0x321431){return{'model':db[_0x321431['model']],'as':_0x321431['as'],'attributes':_0x321431[_0x4b93('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b93('0xf')](function(_0x37cbc3){logger[_0x4b93('0x17')](_0x4b93('0x19'),_0x573aa7);logger['debug'](_0x4b93('0x19'),_0x573aa7,JSON[_0x4b93('0x12')](_0x37cbc3));_0x4c814d(_0x37cbc3);})['catch'](function(_0x404045){logger['error'](_0x4b93('0x19'),_0x404045[_0x4b93('0x16')],_0x573aa7);_0x1f4c23(_0x5d7d8a[_0x4b93('0x13')](0x1f4,_0x404045[_0x4b93('0x16')]));});});}; \ No newline at end of file +var _0x70aa=['catch','find','options','raw','attributes','include','map','model','ShowSound','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x265e0e,_0x38b2bb){var _0x518157=function(_0x1e3eab){while(--_0x1e3eab){_0x265e0e['push'](_0x265e0e['shift']());}};_0x518157(++_0x38b2bb);}(_0x70aa,0x19d));var _0xa70a=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x70aa[_0x81e39d];return _0x548fbb;};'use strict';var _=require('lodash');var util=require(_0xa70a('0x0'));var moment=require('moment');var BPromise=require(_0xa70a('0x1'));var rs=require(_0xa70a('0x2'));var fs=require('fs');var Redis=require(_0xa70a('0x3'));var db=require(_0xa70a('0x4'))['db'];var utils=require(_0xa70a('0x5'));var logger=require(_0xa70a('0x6'))(_0xa70a('0x7'));var config=require('../../config/environment');var jayson=require(_0xa70a('0x8'));var client=jayson[_0xa70a('0x9')][_0xa70a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fb000,_0x5c61d2,_0x5c3514){return new BPromise(function(_0x4453e,_0x3ee98e){return client[_0xa70a('0xb')](_0x7fb000,_0x5c3514)[_0xa70a('0xc')](function(_0x4692b3){logger[_0xa70a('0xd')](_0xa70a('0xe'),_0x5c61d2,_0xa70a('0xf'));logger[_0xa70a('0x10')](_0xa70a('0x11'),_0x5c61d2,_0xa70a('0xf'),JSON['stringify'](_0x4692b3));if(_0x4692b3['error']){if(_0x4692b3[_0xa70a('0x12')]['code']===0x1f4){logger[_0xa70a('0x12')](_0xa70a('0xe'),_0x5c61d2,_0x4692b3['error'][_0xa70a('0x13')]);return _0x3ee98e(_0x4692b3[_0xa70a('0x12')]['message']);}logger[_0xa70a('0x12')]('Sound,\x20%s,\x20%s',_0x5c61d2,_0x4692b3[_0xa70a('0x12')][_0xa70a('0x13')]);return _0x4453e(_0x4692b3['error'][_0xa70a('0x13')]);}else{logger[_0xa70a('0xd')]('Sound,\x20%s,\x20%s',_0x5c61d2,_0xa70a('0xf'));_0x4453e(_0x4692b3[_0xa70a('0x14')][_0xa70a('0x13')]);}})[_0xa70a('0x15')](function(_0x3d95e9){logger[_0xa70a('0x12')](_0xa70a('0xe'),_0x5c61d2,_0x3d95e9);_0x3ee98e(_0x3d95e9);});});}exports['ShowSound']=function(_0x6c2dc0){var _0x327b5=this;return new Promise(function(_0x2b54ca,_0x145f15){return db['Sound'][_0xa70a('0x16')]({'raw':_0x6c2dc0[_0xa70a('0x17')]?_0x6c2dc0[_0xa70a('0x17')][_0xa70a('0x18')]===undefined?!![]:![]:!![],'where':_0x6c2dc0[_0xa70a('0x17')]?_0x6c2dc0[_0xa70a('0x17')]['where']||null:null,'attributes':_0x6c2dc0['options']?_0x6c2dc0[_0xa70a('0x17')][_0xa70a('0x19')]||null:null,'include':_0x6c2dc0[_0xa70a('0x17')]?_0x6c2dc0[_0xa70a('0x17')][_0xa70a('0x1a')]?_[_0xa70a('0x1b')](_0x6c2dc0[_0xa70a('0x17')]['include'],function(_0x2a1b32){return{'model':db[_0x2a1b32[_0xa70a('0x1c')]],'as':_0x2a1b32['as'],'attributes':_0x2a1b32[_0xa70a('0x19')],'include':_0x2a1b32['include']?_['map'](_0x2a1b32[_0xa70a('0x1a')],function(_0x38dc0c){return{'model':db[_0x38dc0c[_0xa70a('0x1c')]],'as':_0x38dc0c['as'],'attributes':_0x38dc0c['attributes'],'include':_0x38dc0c[_0xa70a('0x1a')]?_[_0xa70a('0x1b')](_0x38dc0c[_0xa70a('0x1a')],function(_0xde5839){return{'model':db[_0xde5839['model']],'as':_0xde5839['as'],'attributes':_0xde5839[_0xa70a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a3170){logger[_0xa70a('0xd')](_0xa70a('0x1d'),_0x6c2dc0);logger[_0xa70a('0x10')](_0xa70a('0x1d'),_0x6c2dc0,JSON[_0xa70a('0x1e')](_0x4a3170));_0x2b54ca(_0x4a3170);})[_0xa70a('0x15')](function(_0x2a8e8b){logger[_0xa70a('0x12')](_0xa70a('0x1d'),_0x2a8e8b[_0xa70a('0x13')],_0x6c2dc0);_0x145f15(_0x327b5[_0xa70a('0x12')](0x1f4,_0x2a8e8b[_0xa70a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ac8e0fd..da12fb2 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x5338fe,_0x5e71d1){var _0xf0a1be=function(_0x306a01){while(--_0x306a01){_0x5338fe['push'](_0x5338fe['shift']());}};_0xf0a1be(++_0x5e71d1);}(_0x4fc2,0x111));var _0x24fc=function(_0x1d4bdb,_0x58f77b){_0x1d4bdb=_0x1d4bdb-0x0;var _0x288bea=_0x4fc2[_0x1d4bdb];return _0x288bea;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0xde9638,_0x42f841){var _0x52d144=function(_0x565cde){while(--_0x565cde){_0xde9638['push'](_0xde9638['shift']());}};_0x52d144(++_0x42f841);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 375e907..2bcfbd5 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x913e=['STRING','TEXT','medium','out','exports'];(function(_0x1418f8,_0xc62d19){var _0x40f59b=function(_0x14736d){while(--_0x14736d){_0x1418f8['push'](_0x1418f8['shift']());}};_0x40f59b(++_0xc62d19);}(_0x913e,0x1d0));var _0xe913=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x913e[_0x3ce2c4];return _0x4047c1;};'use strict';var Sequelize=require('sequelize');module[_0xe913('0x0')]={'uniqueid':{'type':Sequelize[_0xe913('0x1')]},'body':{'type':Sequelize[_0xe913('0x2')](_0xe913('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe913('0x4')),'defaultValue':_0xe913('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe913('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe330=['ENUM','out','exports','STRING','TEXT','medium'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe330,0x1be));var _0x0e33=function(_0x26bb15,_0x39b070){_0x26bb15=_0x26bb15-0x0;var _0x7aa58a=_0xe330[_0x26bb15];return _0x7aa58a;};'use strict';var Sequelize=require('sequelize');module[_0x0e33('0x0')]={'uniqueid':{'type':Sequelize[_0x0e33('0x1')]},'body':{'type':Sequelize[_0x0e33('0x2')](_0x0e33('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x0e33('0x4')]('in',_0x0e33('0x5')),'defaultValue':_0x0e33('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0e33('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 192a4ee..5aef2ec 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x383b=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','show','params','include','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x43d267,_0x364eec){var _0x3c3882=function(_0x55e3b2){while(--_0x55e3b2){_0x43d267['push'](_0x43d267['shift']());}};_0x3c3882(++_0x364eec);}(_0x383b,0x89));var _0xb383=function(_0x4746ec,_0x2b42d1){_0x4746ec=_0x4746ec-0x0;var _0x13fce3=_0x383b[_0x4746ec];return _0x13fce3;};'use strict';var emlformat=require(_0xb383('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb383('0x1'));var jsonpatch=require(_0xb383('0x2'));var rp=require(_0xb383('0x3'));var moment=require('moment');var BPromise=require(_0xb383('0x4'));var Mustache=require('mustache');var util=require(_0xb383('0x5'));var path=require(_0xb383('0x6'));var sox=require(_0xb383('0x7'));var csv=require(_0xb383('0x8'));var ejs=require(_0xb383('0x9'));var fs=require('fs');var fs_extra=require(_0xb383('0xa'));var _=require('lodash');var squel=require(_0xb383('0xb'));var crypto=require(_0xb383('0xc'));var jsforce=require(_0xb383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb383('0xe'));var Papa=require(_0xb383('0xf'));var Redis=require(_0xb383('0x10'));var authService=require(_0xb383('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb383('0x12'));var hardwareService=require(_0xb383('0x13'));var logger=require(_0xb383('0x14'))(_0xb383('0x15'));var utils=require(_0xb383('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb383('0x17'));var db=require(_0xb383('0x18'))['db'];function respondWithStatusCode(_0x590783,_0x22001f){_0x22001f=_0x22001f||0xcc;return function(_0x16091f){if(_0x16091f){return _0x590783[_0xb383('0x19')](_0x22001f);}return _0x590783[_0xb383('0x1a')](_0x22001f)[_0xb383('0x1b')]();};}function respondWithResult(_0x1e8107,_0x41f716){_0x41f716=_0x41f716||0xc8;return function(_0x5f1c6e){if(_0x5f1c6e){return _0x1e8107[_0xb383('0x1a')](_0x41f716)[_0xb383('0x1c')](_0x5f1c6e);}};}function respondWithFilteredResult(_0x1cdcb7,_0xfbc68f){return function(_0x4b3cb5){if(_0x4b3cb5){var _0x41cf3f=typeof _0xfbc68f[_0xb383('0x1d')]===_0xb383('0x1e')&&typeof _0xfbc68f['limit']===_0xb383('0x1e');var _0x24a72e=_0x4b3cb5[_0xb383('0x1f')];var _0x11d0ed=_0x41cf3f?0x0:_0xfbc68f[_0xb383('0x1d')];var _0x421a36=_0x41cf3f?_0x4b3cb5['count']:_0xfbc68f[_0xb383('0x1d')]+_0xfbc68f['limit'];var _0x151642;if(_0x421a36>=_0x24a72e){_0x421a36=_0x24a72e;_0x151642=0xc8;}else{_0x151642=0xce;}_0x1cdcb7[_0xb383('0x1a')](_0x151642);return _0x1cdcb7[_0xb383('0x20')](_0xb383('0x21'),_0x11d0ed+'-'+_0x421a36+'/'+_0x24a72e)[_0xb383('0x1c')](_0x4b3cb5);}return null;};}function patchUpdates(_0x58bedb){return function(_0x1c9b4f){try{jsonpatch[_0xb383('0x22')](_0x1c9b4f,_0x58bedb,!![]);}catch(_0x1c0246){return BPromise['reject'](_0x1c0246);}return _0x1c9b4f[_0xb383('0x23')]();};}function saveUpdates(_0x45158e,_0x3c354c){return function(_0x571f83){if(_0x571f83){return _0x571f83['update'](_0x45158e)[_0xb383('0x24')](function(_0x127d1b){return _0x127d1b;});}return null;};}function removeEntity(_0x306dd7,_0x38d029){return function(_0xb0d2a8){if(_0xb0d2a8){return _0xb0d2a8[_0xb383('0x25')]()[_0xb383('0x24')](function(){_0x306dd7[_0xb383('0x1a')](0xcc)[_0xb383('0x1b')]();});}};}function handleEntityNotFound(_0x48ceef,_0x30f704){return function(_0x509ea6){if(!_0x509ea6){_0x48ceef[_0xb383('0x19')](0x194);}return _0x509ea6;};}function handleError(_0xbab0f6,_0xa5c39a){_0xa5c39a=_0xa5c39a||0x1f4;return function(_0x39f1fb){logger[_0xb383('0x26')](_0x39f1fb[_0xb383('0x27')]);if(_0x39f1fb[_0xb383('0x28')]){delete _0x39f1fb['name'];}_0xbab0f6[_0xb383('0x1a')](_0xa5c39a)[_0xb383('0x29')](_0x39f1fb);};}exports[_0xb383('0x2a')]=function(_0x2d304c,_0x4daf45){var _0x3797b7={},_0x10ea31={},_0x4ccb9c={'count':0x0,'rows':[]};var _0x1178db=_[_0xb383('0x2b')](db[_0xb383('0x2c')][_0xb383('0x2d')],function(_0x5d0a58){return{'name':_0x5d0a58[_0xb383('0x2e')],'type':_0x5d0a58[_0xb383('0x2f')]['key']};});_0x10ea31[_0xb383('0x30')]=_[_0xb383('0x2b')](_0x1178db,_0xb383('0x28'));_0x10ea31[_0xb383('0x31')]=_[_0xb383('0x32')](_0x2d304c[_0xb383('0x31')]);_0x10ea31['filters']=_[_0xb383('0x33')](_0x10ea31[_0xb383('0x30')],_0x10ea31[_0xb383('0x31')]);_0x3797b7[_0xb383('0x34')]=_[_0xb383('0x33')](_0x10ea31[_0xb383('0x30')],qs[_0xb383('0x35')](_0x2d304c[_0xb383('0x31')]['fields']));_0x3797b7[_0xb383('0x34')]=_0x3797b7[_0xb383('0x34')][_0xb383('0x36')]?_0x3797b7['attributes']:_0x10ea31[_0xb383('0x30')];if(!_0x2d304c[_0xb383('0x31')]['hasOwnProperty'](_0xb383('0x37'))){_0x3797b7[_0xb383('0x38')]=qs[_0xb383('0x38')](_0x2d304c['query'][_0xb383('0x38')]);_0x3797b7[_0xb383('0x1d')]=qs[_0xb383('0x1d')](_0x2d304c[_0xb383('0x31')][_0xb383('0x1d')]);}_0x3797b7[_0xb383('0x39')]=qs['sort'](_0x2d304c[_0xb383('0x31')][_0xb383('0x3a')]);_0x3797b7[_0xb383('0x3b')]=qs['filters'](_[_0xb383('0x3c')](_0x2d304c[_0xb383('0x31')],_0x10ea31[_0xb383('0x3d')]),_0x1178db);if(_0x2d304c[_0xb383('0x31')][_0xb383('0x3e')]){_0x3797b7[_0xb383('0x3b')]=_[_0xb383('0x3f')](_0x3797b7['where'],{'$or':_['map'](_0x1178db,function(_0x354295){if(_0x354295[_0xb383('0x2f')]!==_0xb383('0x40')){var _0x9fa900={};_0x9fa900[_0x354295[_0xb383('0x28')]]={'$like':'%'+_0x2d304c[_0xb383('0x31')][_0xb383('0x3e')]+'%'};return _0x9fa900;}})});}_0x3797b7=_[_0xb383('0x3f')]({},_0x3797b7,_0x2d304c['options']);var _0x232598={'where':_0x3797b7[_0xb383('0x3b')]};return db[_0xb383('0x2c')][_0xb383('0x1f')](_0x232598)['then'](function(_0x20c0c4){_0x4ccb9c[_0xb383('0x1f')]=_0x20c0c4;if(_0x2d304c['query'][_0xb383('0x41')]){_0x3797b7['include']=[{'all':!![]}];}return db[_0xb383('0x2c')][_0xb383('0x42')](_0x3797b7);})[_0xb383('0x24')](function(_0x1d50ea){_0x4ccb9c['rows']=_0x1d50ea;return _0x4ccb9c;})[_0xb383('0x24')](respondWithFilteredResult(_0x4daf45,_0x3797b7))['catch'](handleError(_0x4daf45,null));};exports[_0xb383('0x43')]=function(_0x4bb0ee,_0x282fd2){var _0x118b25={'raw':!![],'where':{'id':_0x4bb0ee[_0xb383('0x44')]['id']}},_0x272b35={};_0x272b35[_0xb383('0x30')]=_[_0xb383('0x32')](db[_0xb383('0x2c')][_0xb383('0x2d')]);_0x272b35[_0xb383('0x31')]=_[_0xb383('0x32')](_0x4bb0ee[_0xb383('0x31')]);_0x272b35['filters']=_[_0xb383('0x33')](_0x272b35[_0xb383('0x30')],_0x272b35[_0xb383('0x31')]);_0x118b25['attributes']=_[_0xb383('0x33')](_0x272b35[_0xb383('0x30')],qs[_0xb383('0x35')](_0x4bb0ee['query']['fields']));_0x118b25[_0xb383('0x34')]=_0x118b25[_0xb383('0x34')]['length']?_0x118b25[_0xb383('0x34')]:_0x272b35[_0xb383('0x30')];if(_0x4bb0ee[_0xb383('0x31')][_0xb383('0x41')]){_0x118b25[_0xb383('0x45')]=[{'all':!![]}];}_0x118b25=_[_0xb383('0x3f')]({},_0x118b25,_0x4bb0ee['options']);return db[_0xb383('0x2c')][_0xb383('0x46')](_0x118b25)['then'](handleEntityNotFound(_0x282fd2,null))['then'](respondWithResult(_0x282fd2,null))[_0xb383('0x47')](handleError(_0x282fd2,null));};exports['create']=function(_0x43cd23,_0x10d814){return db['SquareMessage'][_0xb383('0x48')](_0x43cd23[_0xb383('0x49')],{})[_0xb383('0x24')](respondWithResult(_0x10d814,0xc9))[_0xb383('0x47')](handleError(_0x10d814,null));};exports[_0xb383('0x4a')]=function(_0x4292c4,_0x4d7ddd){if(_0x4292c4['body']['id']){delete _0x4292c4[_0xb383('0x49')]['id'];}return db['SquareMessage'][_0xb383('0x46')]({'where':{'id':_0x4292c4[_0xb383('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d7ddd,null))[_0xb383('0x24')](saveUpdates(_0x4292c4['body'],null))['then'](respondWithResult(_0x4d7ddd,null))['catch'](handleError(_0x4d7ddd,null));};exports[_0xb383('0x25')]=function(_0x4e2b7c,_0x451947){return db['SquareMessage'][_0xb383('0x46')]({'where':{'id':_0x4e2b7c[_0xb383('0x44')]['id']}})['then'](handleEntityNotFound(_0x451947,null))['then'](removeEntity(_0x451947,null))[_0xb383('0x47')](handleError(_0x451947,null));}; \ No newline at end of file +var _0xd0cd=['create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','catch','show','params','rawAttributes'];(function(_0x5735d0,_0x423963){var _0x5e1c52=function(_0x55d80a){while(--_0x55d80a){_0x5735d0['push'](_0x5735d0['shift']());}};_0x5e1c52(++_0x423963);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x19fa95,_0x1cca0a){_0x19fa95=_0x19fa95-0x0;var _0x58a835=_0xd0cd[_0x19fa95];return _0x58a835;};'use strict';var emlformat=require(_0xdd0c('0x0'));var rimraf=require(_0xdd0c('0x1'));var zipdir=require(_0xdd0c('0x2'));var jsonpatch=require(_0xdd0c('0x3'));var rp=require('request-promise');var moment=require(_0xdd0c('0x4'));var BPromise=require(_0xdd0c('0x5'));var Mustache=require(_0xdd0c('0x6'));var util=require(_0xdd0c('0x7'));var path=require(_0xdd0c('0x8'));var sox=require(_0xdd0c('0x9'));var csv=require(_0xdd0c('0xa'));var ejs=require(_0xdd0c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd0c('0xc'));var crypto=require(_0xdd0c('0xd'));var jsforce=require(_0xdd0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd0c('0xf'));var Papa=require(_0xdd0c('0x10'));var Redis=require(_0xdd0c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd0c('0x12'));var as=require(_0xdd0c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd0c('0x14'))(_0xdd0c('0x15'));var utils=require(_0xdd0c('0x16'));var config=require(_0xdd0c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd0c('0x18'))['db'];function respondWithStatusCode(_0x80c14c,_0x2dbec6){_0x2dbec6=_0x2dbec6||0xcc;return function(_0x35cfca){if(_0x35cfca){return _0x80c14c[_0xdd0c('0x19')](_0x2dbec6);}return _0x80c14c[_0xdd0c('0x1a')](_0x2dbec6)[_0xdd0c('0x1b')]();};}function respondWithResult(_0x28eb5b,_0x37158b){_0x37158b=_0x37158b||0xc8;return function(_0x4da50c){if(_0x4da50c){return _0x28eb5b[_0xdd0c('0x1a')](_0x37158b)['json'](_0x4da50c);}};}function respondWithFilteredResult(_0x32cd62,_0x206f1c){return function(_0x2e26a0){if(_0x2e26a0){var _0x5c05e1=typeof _0x206f1c['offset']==='undefined'&&typeof _0x206f1c[_0xdd0c('0x1c')]===_0xdd0c('0x1d');var _0x331b92=_0x2e26a0['count'];var _0x233360=_0x5c05e1?0x0:_0x206f1c[_0xdd0c('0x1e')];var _0x1c959b=_0x5c05e1?_0x2e26a0[_0xdd0c('0x1f')]:_0x206f1c[_0xdd0c('0x1e')]+_0x206f1c[_0xdd0c('0x1c')];var _0x1362a0;if(_0x1c959b>=_0x331b92){_0x1c959b=_0x331b92;_0x1362a0=0xc8;}else{_0x1362a0=0xce;}_0x32cd62[_0xdd0c('0x1a')](_0x1362a0);return _0x32cd62[_0xdd0c('0x20')](_0xdd0c('0x21'),_0x233360+'-'+_0x1c959b+'/'+_0x331b92)[_0xdd0c('0x22')](_0x2e26a0);}return null;};}function patchUpdates(_0x36acba){return function(_0x25e6a3){try{jsonpatch['apply'](_0x25e6a3,_0x36acba,!![]);}catch(_0x3b5de9){return BPromise[_0xdd0c('0x23')](_0x3b5de9);}return _0x25e6a3['save']();};}function saveUpdates(_0x4d46a1,_0x3a8bb0){return function(_0x5a5471){if(_0x5a5471){return _0x5a5471[_0xdd0c('0x24')](_0x4d46a1)[_0xdd0c('0x25')](function(_0x3c1194){return _0x3c1194;});}return null;};}function removeEntity(_0x5b5bdf,_0x5a0f16){return function(_0x14ef79){if(_0x14ef79){return _0x14ef79[_0xdd0c('0x26')]()['then'](function(){_0x5b5bdf[_0xdd0c('0x1a')](0xcc)[_0xdd0c('0x1b')]();});}};}function handleEntityNotFound(_0x551745,_0x18a6c8){return function(_0x38a5c9){if(!_0x38a5c9){_0x551745['sendStatus'](0x194);}return _0x38a5c9;};}function handleError(_0x4608f4,_0x2daa37){_0x2daa37=_0x2daa37||0x1f4;return function(_0x2d4084){logger[_0xdd0c('0x27')](_0x2d4084[_0xdd0c('0x28')]);if(_0x2d4084[_0xdd0c('0x29')]){delete _0x2d4084[_0xdd0c('0x29')];}_0x4608f4[_0xdd0c('0x1a')](_0x2daa37)[_0xdd0c('0x2a')](_0x2d4084);};}exports['index']=function(_0x5d59da,_0xe91a4f){var _0x49e480={},_0x13b18f={},_0x13d80e={'count':0x0,'rows':[]};var _0x4e367f=_[_0xdd0c('0x2b')](db['SquareMessage']['rawAttributes'],function(_0x56f94f){return{'name':_0x56f94f[_0xdd0c('0x2c')],'type':_0x56f94f[_0xdd0c('0x2d')][_0xdd0c('0x2e')]};});_0x13b18f[_0xdd0c('0x2f')]=_[_0xdd0c('0x2b')](_0x4e367f,_0xdd0c('0x29'));_0x13b18f[_0xdd0c('0x30')]=_[_0xdd0c('0x31')](_0x5d59da[_0xdd0c('0x30')]);_0x13b18f[_0xdd0c('0x32')]=_[_0xdd0c('0x33')](_0x13b18f[_0xdd0c('0x2f')],_0x13b18f[_0xdd0c('0x30')]);_0x49e480[_0xdd0c('0x34')]=_[_0xdd0c('0x33')](_0x13b18f[_0xdd0c('0x2f')],qs['fields'](_0x5d59da['query'][_0xdd0c('0x35')]));_0x49e480[_0xdd0c('0x34')]=_0x49e480[_0xdd0c('0x34')][_0xdd0c('0x36')]?_0x49e480[_0xdd0c('0x34')]:_0x13b18f['model'];if(!_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x37')](_0xdd0c('0x38'))){_0x49e480['limit']=qs[_0xdd0c('0x1c')](_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x1c')]);_0x49e480['offset']=qs['offset'](_0x5d59da[_0xdd0c('0x30')]['offset']);}_0x49e480[_0xdd0c('0x39')]=qs[_0xdd0c('0x3a')](_0x5d59da['query'][_0xdd0c('0x3a')]);_0x49e480[_0xdd0c('0x3b')]=qs['filters'](_[_0xdd0c('0x3c')](_0x5d59da[_0xdd0c('0x30')],_0x13b18f['filters']),_0x4e367f);if(_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x3d')]){_0x49e480['where']=_[_0xdd0c('0x3e')](_0x49e480[_0xdd0c('0x3b')],{'$or':_[_0xdd0c('0x2b')](_0x4e367f,function(_0x266bab){if(_0x266bab[_0xdd0c('0x2d')]!==_0xdd0c('0x3f')){var _0x2b6f38={};_0x2b6f38[_0x266bab['name']]={'$like':'%'+_0x5d59da[_0xdd0c('0x30')]['filter']+'%'};return _0x2b6f38;}})});}_0x49e480=_[_0xdd0c('0x3e')]({},_0x49e480,_0x5d59da[_0xdd0c('0x40')]);var _0xe1e84b={'where':_0x49e480[_0xdd0c('0x3b')]};return db[_0xdd0c('0x41')][_0xdd0c('0x1f')](_0xe1e84b)[_0xdd0c('0x25')](function(_0x37b49d){_0x13d80e[_0xdd0c('0x1f')]=_0x37b49d;if(_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x42')]){_0x49e480[_0xdd0c('0x43')]=[{'all':!![]}];}return db['SquareMessage'][_0xdd0c('0x44')](_0x49e480);})[_0xdd0c('0x25')](function(_0x5db0d4){_0x13d80e['rows']=_0x5db0d4;return _0x13d80e;})[_0xdd0c('0x25')](respondWithFilteredResult(_0xe91a4f,_0x49e480))[_0xdd0c('0x45')](handleError(_0xe91a4f,null));};exports[_0xdd0c('0x46')]=function(_0xba8400,_0x11eb6d){var _0x29edad={'raw':!![],'where':{'id':_0xba8400[_0xdd0c('0x47')]['id']}},_0x11d05e={};_0x11d05e['model']=_[_0xdd0c('0x31')](db[_0xdd0c('0x41')][_0xdd0c('0x48')]);_0x11d05e[_0xdd0c('0x30')]=_[_0xdd0c('0x31')](_0xba8400[_0xdd0c('0x30')]);_0x11d05e['filters']=_[_0xdd0c('0x33')](_0x11d05e[_0xdd0c('0x2f')],_0x11d05e[_0xdd0c('0x30')]);_0x29edad['attributes']=_[_0xdd0c('0x33')](_0x11d05e[_0xdd0c('0x2f')],qs[_0xdd0c('0x35')](_0xba8400[_0xdd0c('0x30')][_0xdd0c('0x35')]));_0x29edad[_0xdd0c('0x34')]=_0x29edad['attributes'][_0xdd0c('0x36')]?_0x29edad['attributes']:_0x11d05e[_0xdd0c('0x2f')];if(_0xba8400['query'][_0xdd0c('0x42')]){_0x29edad[_0xdd0c('0x43')]=[{'all':!![]}];}_0x29edad=_[_0xdd0c('0x3e')]({},_0x29edad,_0xba8400[_0xdd0c('0x40')]);return db[_0xdd0c('0x41')]['find'](_0x29edad)[_0xdd0c('0x25')](handleEntityNotFound(_0x11eb6d,null))['then'](respondWithResult(_0x11eb6d,null))[_0xdd0c('0x45')](handleError(_0x11eb6d,null));};exports['create']=function(_0x31aac7,_0x411d94){return db[_0xdd0c('0x41')][_0xdd0c('0x49')](_0x31aac7['body'],{})['then'](respondWithResult(_0x411d94,0xc9))[_0xdd0c('0x45')](handleError(_0x411d94,null));};exports[_0xdd0c('0x24')]=function(_0x1bbf1f,_0x280349){if(_0x1bbf1f['body']['id']){delete _0x1bbf1f[_0xdd0c('0x4a')]['id'];}return db[_0xdd0c('0x41')]['find']({'where':{'id':_0x1bbf1f['params']['id']}})[_0xdd0c('0x25')](handleEntityNotFound(_0x280349,null))[_0xdd0c('0x25')](saveUpdates(_0x1bbf1f[_0xdd0c('0x4a')],null))['then'](respondWithResult(_0x280349,null))[_0xdd0c('0x45')](handleError(_0x280349,null));};exports[_0xdd0c('0x26')]=function(_0x4ef741,_0x195132){return db[_0xdd0c('0x41')][_0xdd0c('0x4b')]({'where':{'id':_0x4ef741[_0xdd0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x195132,null))[_0xdd0c('0x25')](removeEntity(_0x195132,null))['catch'](handleError(_0x195132,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index b84626d..36e510e 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9f7=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','api','moment','bluebird','request-promise'];(function(_0x38c5a9,_0x3db609){var _0x5b7f7d=function(_0x1ecd06){while(--_0x1ecd06){_0x38c5a9['push'](_0x38c5a9['shift']());}};_0x5b7f7d(++_0x3db609);}(_0xa9f7,0x9c));var _0x7a9f=function(_0x44bbdb,_0x4099a2){_0x44bbdb=_0x44bbdb-0x0;var _0x1d4892=_0xa9f7[_0x44bbdb];return _0x1d4892;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7a9f('0x0'));var moment=require(_0x7a9f('0x1'));var BPromise=require(_0x7a9f('0x2'));var rp=require(_0x7a9f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a9f('0x4'));var config=require(_0x7a9f('0x5'));var attributes=require(_0x7a9f('0x6'));module[_0x7a9f('0x7')]=function(_0x17b483,_0x5f00af){return _0x17b483[_0x7a9f('0x8')](_0x7a9f('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6716=['square_messages','../../config/logger','moment','bluebird','request-promise','../../config/environment','define','SquareMessage'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6716,0x1e1));var _0x6671=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0x6716[_0x1b3a09];return _0x357bb8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6671('0x0'))('api');var moment=require(_0x6671('0x1'));var BPromise=require(_0x6671('0x2'));var rp=require(_0x6671('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6671('0x4'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x4b2571,_0x43f289){return _0x4b2571[_0x6671('0x5')](_0x6671('0x6'),attributes,{'tableName':_0x6671('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 75d28ff..88caca0 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f6a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareMessage','SquareMessage','create','options','catch','util'];(function(_0x3ef815,_0x5c8f74){var _0x4a144f=function(_0x1d92f5){while(--_0x1d92f5){_0x3ef815['push'](_0x3ef815['shift']());}};_0x4a144f(++_0x5c8f74);}(_0x4f6a,0xe0));var _0xa4f6=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0x4f6a[_0x39e2d7];return _0x413d0d;};'use strict';var _=require('lodash');var util=require(_0xa4f6('0x0'));var moment=require('moment');var BPromise=require(_0xa4f6('0x1'));var rs=require(_0xa4f6('0x2'));var fs=require('fs');var Redis=require(_0xa4f6('0x3'));var db=require(_0xa4f6('0x4'))['db'];var utils=require(_0xa4f6('0x5'));var logger=require(_0xa4f6('0x6'))(_0xa4f6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4f6('0x8')][_0xa4f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3413f1,_0x1cca8f,_0x5dace0){return new BPromise(function(_0x118519,_0x2525b5){return client['request'](_0x3413f1,_0x5dace0)[_0xa4f6('0xa')](function(_0x553022){logger[_0xa4f6('0xb')](_0xa4f6('0xc'),_0x1cca8f,_0xa4f6('0xd'));logger[_0xa4f6('0xe')](_0xa4f6('0xf'),_0x1cca8f,_0xa4f6('0xd'),JSON[_0xa4f6('0x10')](_0x553022));if(_0x553022[_0xa4f6('0x11')]){if(_0x553022[_0xa4f6('0x11')]['code']===0x1f4){logger['error'](_0xa4f6('0xc'),_0x1cca8f,_0x553022[_0xa4f6('0x11')][_0xa4f6('0x12')]);return _0x2525b5(_0x553022[_0xa4f6('0x11')][_0xa4f6('0x12')]);}logger[_0xa4f6('0x11')](_0xa4f6('0xc'),_0x1cca8f,_0x553022[_0xa4f6('0x11')][_0xa4f6('0x12')]);return _0x118519(_0x553022[_0xa4f6('0x11')][_0xa4f6('0x12')]);}else{logger['info'](_0xa4f6('0xc'),_0x1cca8f,_0xa4f6('0xd'));_0x118519(_0x553022[_0xa4f6('0x13')][_0xa4f6('0x12')]);}})['catch'](function(_0x13ad29){logger['error'](_0xa4f6('0xc'),_0x1cca8f,_0x13ad29);_0x2525b5(_0x13ad29);});});}exports[_0xa4f6('0x14')]=function(_0x419715){var _0x242d54=this;return new Promise(function(_0x307ec9,_0x4809f3){return db[_0xa4f6('0x15')][_0xa4f6('0x16')](_0x419715['body'],{'raw':_0x419715['options']?_0x419715[_0xa4f6('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xa4f6('0xa')](function(_0xeaf617){logger[_0xa4f6('0xb')](_0xa4f6('0x14'),_0x419715);logger[_0xa4f6('0xe')]('CreateSquareMessage',_0x419715,JSON[_0xa4f6('0x10')](_0xeaf617));_0x307ec9(_0xeaf617);})[_0xa4f6('0x18')](function(_0x3b1733){logger['error']('CreateSquareMessage',_0x3b1733[_0xa4f6('0x12')],_0x419715);_0x4809f3(_0x242d54['error'](0x1f4,_0x3b1733[_0xa4f6('0x12')]));});});}; \ No newline at end of file +var _0x059c=['CreateSquareMessage','create','body','options','raw','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','catch'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x059c,0xcd));var _0xc059=function(_0x4361c1,_0x175703){_0x4361c1=_0x4361c1-0x0;var _0x7d47bd=_0x059c[_0x4361c1];return _0x7d47bd;};'use strict';var _=require(_0xc059('0x0'));var util=require(_0xc059('0x1'));var moment=require(_0xc059('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc059('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc059('0x4'))(_0xc059('0x5'));var config=require(_0xc059('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc059('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d5284,_0x173a9,_0x12c5df){return new BPromise(function(_0x59eb58,_0x5884e1){return client[_0xc059('0x8')](_0x5d5284,_0x12c5df)[_0xc059('0x9')](function(_0xc75e7){logger[_0xc059('0xa')]('SquareMessage,\x20%s,\x20%s',_0x173a9,_0xc059('0xb'));logger[_0xc059('0xc')](_0xc059('0xd'),_0x173a9,_0xc059('0xb'),JSON[_0xc059('0xe')](_0xc75e7));if(_0xc75e7[_0xc059('0xf')]){if(_0xc75e7[_0xc059('0xf')][_0xc059('0x10')]===0x1f4){logger[_0xc059('0xf')]('SquareMessage,\x20%s,\x20%s',_0x173a9,_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);return _0x5884e1(_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);}logger[_0xc059('0xf')]('SquareMessage,\x20%s,\x20%s',_0x173a9,_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);return _0x59eb58(_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);}else{logger[_0xc059('0xa')](_0xc059('0x12'),_0x173a9,'request\x20sent');_0x59eb58(_0xc75e7['result']['message']);}})[_0xc059('0x13')](function(_0x1423c8){logger[_0xc059('0xf')](_0xc059('0x12'),_0x173a9,_0x1423c8);_0x5884e1(_0x1423c8);});});}exports[_0xc059('0x14')]=function(_0xadce3b){var _0x26b480=this;return new Promise(function(_0x4faf8b,_0x12853f){return db['SquareMessage'][_0xc059('0x15')](_0xadce3b[_0xc059('0x16')],{'raw':_0xadce3b[_0xc059('0x17')]?_0xadce3b['options'][_0xc059('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x233cb3){logger[_0xc059('0xa')](_0xc059('0x14'),_0xadce3b);logger[_0xc059('0xc')](_0xc059('0x14'),_0xadce3b,JSON[_0xc059('0xe')](_0x233cb3));_0x4faf8b(_0x233cb3);})[_0xc059('0x13')](function(_0x3feedb){logger['error']('CreateSquareMessage',_0x3feedb[_0xc059('0x11')],_0xadce3b);_0x12853f(_0x26b480['error'](0x1f4,_0x3feedb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 86f5892..e00f19e 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9789=['put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','index','/:id','show','test','post','isAuthenticated','create'];(function(_0x256096,_0x4dbb5e){var _0x5c5ad8=function(_0x43fb17){while(--_0x43fb17){_0x256096['push'](_0x256096['shift']());}};_0x5c5ad8(++_0x4dbb5e);}(_0x9789,0xd5));var _0x9978=function(_0x545b4a,_0x1de254){_0x545b4a=_0x545b4a-0x0;var _0x1e5849=_0x9789[_0x545b4a];return _0x1e5849;};'use strict';var multer=require(_0x9978('0x0'));var util=require(_0x9978('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9978('0x2'));var router=express[_0x9978('0x3')]();var fs_extra=require(_0x9978('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9978('0x5'));var config=require('../../config/environment');var controller=require(_0x9978('0x6'));router[_0x9978('0x7')]('/',auth['isAuthenticated'](),controller[_0x9978('0x8')]);router[_0x9978('0x7')](_0x9978('0x9'),auth['isAuthenticated'](),controller[_0x9978('0xa')]);router['get']('/:id/test',auth['isAuthenticated'](),timeout('15s'),controller[_0x9978('0xb')]);router[_0x9978('0xc')]('/',auth[_0x9978('0xd')](),controller[_0x9978('0xe')]);router[_0x9978('0xf')](_0x9978('0x9'),auth[_0x9978('0xd')](),controller[_0x9978('0x10')]);router[_0x9978('0x11')](_0x9978('0x9'),auth[_0x9978('0xd')](),controller[_0x9978('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3fa4=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','index','show','/:id/test','isAuthenticated','test','post','create','put'];(function(_0x5d402b,_0x3874f4){var _0x14028f=function(_0x473b0d){while(--_0x473b0d){_0x5d402b['push'](_0x5d402b['shift']());}};_0x14028f(++_0x3874f4);}(_0x3fa4,0x65));var _0x43fa=function(_0x35c0ba,_0x45d774){_0x35c0ba=_0x35c0ba-0x0;var _0x5e6dba=_0x3fa4[_0x35c0ba];return _0x5e6dba;};'use strict';var multer=require(_0x43fa('0x0'));var util=require(_0x43fa('0x1'));var path=require(_0x43fa('0x2'));var timeout=require(_0x43fa('0x3'));var express=require(_0x43fa('0x4'));var router=express[_0x43fa('0x5')]();var fs_extra=require(_0x43fa('0x6'));var auth=require(_0x43fa('0x7'));var interaction=require(_0x43fa('0x8'));var config=require('../../config/environment');var controller=require(_0x43fa('0x9'));router[_0x43fa('0xa')]('/',auth['isAuthenticated'](),controller[_0x43fa('0xb')]);router[_0x43fa('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x43fa('0xc')]);router[_0x43fa('0xa')](_0x43fa('0xd'),auth[_0x43fa('0xe')](),timeout('15s'),controller[_0x43fa('0xf')]);router[_0x43fa('0x10')]('/',auth[_0x43fa('0xe')](),controller[_0x43fa('0x11')]);router[_0x43fa('0x12')](_0x43fa('0x13'),auth[_0x43fa('0xe')](),controller[_0x43fa('0x14')]);router[_0x43fa('0x15')]('/:id',auth[_0x43fa('0xe')](),controller[_0x43fa('0x16')]);module[_0x43fa('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5eda51b..0907257 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7b3=['STRING','name','sequelize'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xd7b3,0x12e));var _0x3d7b=function(_0x478970,_0x5df032){_0x478970=_0x478970-0x0;var _0x1759f1=_0xd7b3[_0x478970];return _0x1759f1;};'use strict';var Sequelize=require(_0x3d7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d7b('0x1')],'unique':_0x3d7b('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3d7b('0x1')]},'description':{'type':Sequelize[_0x3d7b('0x1')]}}; \ No newline at end of file +var _0xb1fd=['sequelize','exports','name','STRING'];(function(_0x54c655,_0x3682b7){var _0x2ac4d5=function(_0x42c4ba){while(--_0x42c4ba){_0x54c655['push'](_0x54c655['shift']());}};_0x2ac4d5(++_0x3682b7);}(_0xb1fd,0x164));var _0xdb1f=function(_0x16c730,_0x38b6ed){_0x16c730=_0x16c730-0x0;var _0x374e82=_0xb1fd[_0x16c730];return _0x374e82;};'use strict';var Sequelize=require(_0xdb1f('0x0'));module[_0xdb1f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xdb1f('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xdb1f('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cb9927f..19a5f6e 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x344d=['index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','show','params','length','include','options','find','catch','create','body','user','ODBC','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name'];(function(_0x1cb571,_0x1e039c){var _0x2ea8b9=function(_0x223c0a){while(--_0x223c0a){_0x1cb571['push'](_0x1cb571['shift']());}};_0x2ea8b9(++_0x1e039c);}(_0x344d,0x1e3));var _0xd344=function(_0x58063b,_0x1a76a1){_0x58063b=_0x58063b-0x0;var _0x313a60=_0x344d[_0x58063b];return _0x313a60;};'use strict';var emlformat=require(_0xd344('0x0'));var rimraf=require(_0xd344('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd344('0x2'));var rp=require('request-promise');var moment=require(_0xd344('0x3'));var BPromise=require(_0xd344('0x4'));var Mustache=require(_0xd344('0x5'));var util=require(_0xd344('0x6'));var path=require(_0xd344('0x7'));var sox=require(_0xd344('0x8'));var csv=require(_0xd344('0x9'));var ejs=require(_0xd344('0xa'));var fs=require('fs');var fs_extra=require(_0xd344('0xb'));var _=require(_0xd344('0xc'));var squel=require(_0xd344('0xd'));var crypto=require(_0xd344('0xe'));var jsforce=require(_0xd344('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd344('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd344('0x10'));var authService=require(_0xd344('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd344('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd344('0x13'))(_0xd344('0x14'));var utils=require(_0xd344('0x15'));var config=require(_0xd344('0x16'));var licenseUtil=require(_0xd344('0x17'));var db=require(_0xd344('0x18'))['db'];function respondWithStatusCode(_0xd65c74,_0x3f8321){_0x3f8321=_0x3f8321||0xcc;return function(_0x371155){if(_0x371155){return _0xd65c74[_0xd344('0x19')](_0x3f8321);}return _0xd65c74['status'](_0x3f8321)[_0xd344('0x1a')]();};}function respondWithResult(_0x10421a,_0xee4a53){_0xee4a53=_0xee4a53||0xc8;return function(_0x170169){if(_0x170169){return _0x10421a[_0xd344('0x1b')](_0xee4a53)[_0xd344('0x1c')](_0x170169);}};}function respondWithFilteredResult(_0x57c9ce,_0x28206e){return function(_0xcafb53){if(_0xcafb53){var _0x43e89a=typeof _0x28206e[_0xd344('0x1d')]==='undefined'&&typeof _0x28206e[_0xd344('0x1e')]===_0xd344('0x1f');var _0x197bde=_0xcafb53[_0xd344('0x20')];var _0x4e4742=_0x43e89a?0x0:_0x28206e[_0xd344('0x1d')];var _0x3ea5fe=_0x43e89a?_0xcafb53['count']:_0x28206e[_0xd344('0x1d')]+_0x28206e[_0xd344('0x1e')];var _0x5f4f33;if(_0x3ea5fe>=_0x197bde){_0x3ea5fe=_0x197bde;_0x5f4f33=0xc8;}else{_0x5f4f33=0xce;}_0x57c9ce['status'](_0x5f4f33);return _0x57c9ce[_0xd344('0x21')](_0xd344('0x22'),_0x4e4742+'-'+_0x3ea5fe+'/'+_0x197bde)[_0xd344('0x1c')](_0xcafb53);}return null;};}function patchUpdates(_0x4e1d65){return function(_0x170bca){try{jsonpatch[_0xd344('0x23')](_0x170bca,_0x4e1d65,!![]);}catch(_0x5aff64){return BPromise[_0xd344('0x24')](_0x5aff64);}return _0x170bca[_0xd344('0x25')]();};}function saveUpdates(_0x3a1300,_0x1dac49){return function(_0x429f0f){if(_0x429f0f){return _0x429f0f[_0xd344('0x26')](_0x3a1300)[_0xd344('0x27')](function(_0x15d58d){return _0x15d58d;});}return null;};}function removeEntity(_0x27e6c5,_0x580e6a){return function(_0x3a544b){if(_0x3a544b){return _0x3a544b[_0xd344('0x28')]()[_0xd344('0x27')](function(){var _0x4b8fe6=_0x3a544b[_0xd344('0x29')]({'plain':!![]});var _0x3b683d='ODBC';return db[_0xd344('0x2a')]['destroy']({'where':{'type':_0x3b683d,'resourceId':_0x4b8fe6['id']}})[_0xd344('0x27')](function(){return _0x3a544b;});})[_0xd344('0x27')](function(){_0x27e6c5[_0xd344('0x1b')](0xcc)[_0xd344('0x1a')]();});}};}function handleEntityNotFound(_0x540ec6,_0x4ea4c6){return function(_0x2765a8){if(!_0x2765a8){_0x540ec6[_0xd344('0x19')](0x194);}return _0x2765a8;};}function handleError(_0x435feb,_0x4c7787){_0x4c7787=_0x4c7787||0x1f4;return function(_0x4c00cf){logger[_0xd344('0x2b')](_0x4c00cf['stack']);if(_0x4c00cf[_0xd344('0x2c')]){delete _0x4c00cf[_0xd344('0x2c')];}_0x435feb['status'](_0x4c7787)['send'](_0x4c00cf);};}exports[_0xd344('0x2d')]=function(_0x1c73ac,_0xf34eea){var _0xaaf81a={},_0x499397={},_0x14634e={'count':0x0,'rows':[]};var _0x3e1f9d=_[_0xd344('0x2e')](db[_0xd344('0x2f')][_0xd344('0x30')],function(_0x5cbf1c){return{'name':_0x5cbf1c[_0xd344('0x31')],'type':_0x5cbf1c[_0xd344('0x32')]['key']};});_0x499397[_0xd344('0x33')]=_['map'](_0x3e1f9d,_0xd344('0x2c'));_0x499397[_0xd344('0x34')]=_[_0xd344('0x35')](_0x1c73ac['query']);_0x499397[_0xd344('0x36')]=_['intersection'](_0x499397['model'],_0x499397['query']);_0xaaf81a['attributes']=_[_0xd344('0x37')](_0x499397['model'],qs[_0xd344('0x38')](_0x1c73ac[_0xd344('0x34')][_0xd344('0x38')]));_0xaaf81a[_0xd344('0x39')]=_0xaaf81a[_0xd344('0x39')]['length']?_0xaaf81a[_0xd344('0x39')]:_0x499397['model'];if(!_0x1c73ac[_0xd344('0x34')][_0xd344('0x3a')](_0xd344('0x3b'))){_0xaaf81a[_0xd344('0x1e')]=qs[_0xd344('0x1e')](_0x1c73ac[_0xd344('0x34')][_0xd344('0x1e')]);_0xaaf81a['offset']=qs['offset'](_0x1c73ac[_0xd344('0x34')][_0xd344('0x1d')]);}_0xaaf81a[_0xd344('0x3c')]=qs[_0xd344('0x3d')](_0x1c73ac[_0xd344('0x34')][_0xd344('0x3d')]);_0xaaf81a[_0xd344('0x3e')]=qs[_0xd344('0x36')](_[_0xd344('0x3f')](_0x1c73ac[_0xd344('0x34')],_0x499397[_0xd344('0x36')]),_0x3e1f9d);if(_0x1c73ac['query'][_0xd344('0x40')]){_0xaaf81a[_0xd344('0x3e')]=_[_0xd344('0x41')](_0xaaf81a[_0xd344('0x3e')],{'$or':_['map'](_0x3e1f9d,function(_0x5b25e3){if(_0x5b25e3['type']!=='VIRTUAL'){var _0x4ff118={};_0x4ff118[_0x5b25e3['name']]={'$like':'%'+_0x1c73ac[_0xd344('0x34')][_0xd344('0x40')]+'%'};return _0x4ff118;}})});}_0xaaf81a=_['merge']({},_0xaaf81a,_0x1c73ac['options']);var _0xcc8c18={'where':_0xaaf81a[_0xd344('0x3e')]};return db[_0xd344('0x2f')]['count'](_0xcc8c18)[_0xd344('0x27')](function(_0x4403a0){_0x14634e[_0xd344('0x20')]=_0x4403a0;if(_0x1c73ac['query'][_0xd344('0x42')]){_0xaaf81a['include']=[{'all':!![]}];}return db[_0xd344('0x2f')]['findAll'](_0xaaf81a);})[_0xd344('0x27')](function(_0x576bcb){_0x14634e[_0xd344('0x43')]=_0x576bcb;return _0x14634e;})[_0xd344('0x27')](respondWithFilteredResult(_0xf34eea,_0xaaf81a))['catch'](handleError(_0xf34eea,null));};exports[_0xd344('0x44')]=function(_0x57908b,_0x273412){var _0x541264={'raw':!![],'where':{'id':_0x57908b[_0xd344('0x45')]['id']}},_0x177735={};_0x177735[_0xd344('0x33')]=_[_0xd344('0x35')](db[_0xd344('0x2f')][_0xd344('0x30')]);_0x177735[_0xd344('0x34')]=_[_0xd344('0x35')](_0x57908b[_0xd344('0x34')]);_0x177735['filters']=_['intersection'](_0x177735[_0xd344('0x33')],_0x177735[_0xd344('0x34')]);_0x541264[_0xd344('0x39')]=_[_0xd344('0x37')](_0x177735[_0xd344('0x33')],qs[_0xd344('0x38')](_0x57908b[_0xd344('0x34')][_0xd344('0x38')]));_0x541264['attributes']=_0x541264[_0xd344('0x39')][_0xd344('0x46')]?_0x541264[_0xd344('0x39')]:_0x177735['model'];if(_0x57908b['query'][_0xd344('0x42')]){_0x541264[_0xd344('0x47')]=[{'all':!![]}];}_0x541264=_[_0xd344('0x41')]({},_0x541264,_0x57908b[_0xd344('0x48')]);return db[_0xd344('0x2f')][_0xd344('0x49')](_0x541264)['then'](handleEntityNotFound(_0x273412,null))[_0xd344('0x27')](respondWithResult(_0x273412,null))[_0xd344('0x4a')](handleError(_0x273412,null));};exports['create']=function(_0x297d89,_0x4209b7){return db[_0xd344('0x2f')][_0xd344('0x4b')](_0x297d89[_0xd344('0x4c')],{})[_0xd344('0x27')](function(_0xd2ac91){var _0x24470a=_0x297d89[_0xd344('0x4d')][_0xd344('0x29')]({'plain':!![]});if(!_0x24470a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24470a['role']===_0xd344('0x4d')){var _0x27a906=_0xd2ac91[_0xd344('0x29')]({'plain':!![]});var _0x5e10e7=_0xd344('0x4e');return db[_0xd344('0x4f')]['find']({'where':{'name':_0x5e10e7,'userProfileId':_0x24470a[_0xd344('0x50')]},'raw':!![]})[_0xd344('0x27')](function(_0x3f375d){if(_0x3f375d&&_0x3f375d[_0xd344('0x51')]===0x0){return db[_0xd344('0x2a')]['create']({'name':_0x27a906['name'],'resourceId':_0x27a906['id'],'type':_0x3f375d[_0xd344('0x2c')],'sectionId':_0x3f375d['id']},{})[_0xd344('0x27')](function(){return _0xd2ac91;});}else{return _0xd2ac91;}})[_0xd344('0x4a')](function(_0x3c990a){logger[_0xd344('0x2b')](_0xd344('0x52'),_0x3c990a);throw _0x3c990a;});}return _0xd2ac91;})[_0xd344('0x27')](respondWithResult(_0x4209b7,0xc9))[_0xd344('0x4a')](handleError(_0x4209b7,null));};exports[_0xd344('0x26')]=function(_0x2a8920,_0x2ef101){if(_0x2a8920[_0xd344('0x4c')]['id']){delete _0x2a8920['body']['id'];}return db[_0xd344('0x2f')][_0xd344('0x49')]({'where':{'id':_0x2a8920[_0xd344('0x45')]['id']}})[_0xd344('0x27')](handleEntityNotFound(_0x2ef101,null))[_0xd344('0x27')](saveUpdates(_0x2a8920[_0xd344('0x4c')],null))['then'](respondWithResult(_0x2ef101,null))[_0xd344('0x4a')](handleError(_0x2ef101,null));};exports[_0xd344('0x28')]=function(_0xff94bf,_0x258df6){return db[_0xd344('0x2f')][_0xd344('0x49')]({'where':{'id':_0xff94bf[_0xd344('0x45')]['id']}})[_0xd344('0x27')](handleEntityNotFound(_0x258df6,null))[_0xd344('0x27')](removeEntity(_0x258df6,null))[_0xd344('0x4a')](handleError(_0x258df6,null));};exports[_0xd344('0x53')]=function(_0x24a484,_0x5863b8,_0x2d8163){var _0x57f434;return db[_0xd344('0x2f')][_0xd344('0x49')]({'where':{'id':_0x24a484['params']['id']},'attributes':['id',_0xd344('0x54')]})[_0xd344('0x27')](handleEntityNotFound(_0x5863b8,null))[_0xd344('0x27')](function(_0xa68286){if(_0xa68286){var _0x19c41f=require(_0xd344('0x55'))();_0x19c41f[_0xd344('0x56')](_0xa68286[_0xd344('0x54')]);_0x19c41f[_0xd344('0x57')]();return _0xa68286;}})['then'](respondWithResult(_0x5863b8,null))[_0xd344('0x4a')](handleError(_0x5863b8,null));}; \ No newline at end of file +var _0xd5e6=['bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','SquareOdbc','findAll','catch','show','params','keys','rawAttributes','merge','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd5e6,0xf9));var _0x6d5e=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xd5e6[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0x6d5e('0x0'));var rimraf=require(_0x6d5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d5e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6d5e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6d5e('0x4'));var csv=require(_0x6d5e('0x5'));var ejs=require(_0x6d5e('0x6'));var fs=require('fs');var fs_extra=require(_0x6d5e('0x7'));var _=require(_0x6d5e('0x8'));var squel=require(_0x6d5e('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d5e('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6d5e('0xb'));var Papa=require(_0x6d5e('0xc'));var Redis=require(_0x6d5e('0xd'));var authService=require(_0x6d5e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d5e('0xf'));var logger=require(_0x6d5e('0x10'))(_0x6d5e('0x11'));var utils=require(_0x6d5e('0x12'));var config=require(_0x6d5e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d5e('0x14'))['db'];function respondWithStatusCode(_0x21e905,_0x5ba8c0){_0x5ba8c0=_0x5ba8c0||0xcc;return function(_0x5d600d){if(_0x5d600d){return _0x21e905['sendStatus'](_0x5ba8c0);}return _0x21e905['status'](_0x5ba8c0)[_0x6d5e('0x15')]();};}function respondWithResult(_0x53df42,_0x5c0c1e){_0x5c0c1e=_0x5c0c1e||0xc8;return function(_0x1afaa4){if(_0x1afaa4){return _0x53df42['status'](_0x5c0c1e)[_0x6d5e('0x16')](_0x1afaa4);}};}function respondWithFilteredResult(_0x32f232,_0xde9c3c){return function(_0x2ebdc2){if(_0x2ebdc2){var _0x1a4106=typeof _0xde9c3c[_0x6d5e('0x17')]===_0x6d5e('0x18')&&typeof _0xde9c3c[_0x6d5e('0x19')]===_0x6d5e('0x18');var _0x5136d5=_0x2ebdc2[_0x6d5e('0x1a')];var _0x5984be=_0x1a4106?0x0:_0xde9c3c[_0x6d5e('0x17')];var _0x450108=_0x1a4106?_0x2ebdc2['count']:_0xde9c3c[_0x6d5e('0x17')]+_0xde9c3c[_0x6d5e('0x19')];var _0x586c73;if(_0x450108>=_0x5136d5){_0x450108=_0x5136d5;_0x586c73=0xc8;}else{_0x586c73=0xce;}_0x32f232[_0x6d5e('0x1b')](_0x586c73);return _0x32f232[_0x6d5e('0x1c')](_0x6d5e('0x1d'),_0x5984be+'-'+_0x450108+'/'+_0x5136d5)[_0x6d5e('0x16')](_0x2ebdc2);}return null;};}function patchUpdates(_0x1de1fc){return function(_0x5ddd42){try{jsonpatch[_0x6d5e('0x1e')](_0x5ddd42,_0x1de1fc,!![]);}catch(_0x2f2f6f){return BPromise[_0x6d5e('0x1f')](_0x2f2f6f);}return _0x5ddd42[_0x6d5e('0x20')]();};}function saveUpdates(_0x1b3f40,_0x98f7d9){return function(_0x46d603){if(_0x46d603){return _0x46d603[_0x6d5e('0x21')](_0x1b3f40)[_0x6d5e('0x22')](function(_0x50a874){return _0x50a874;});}return null;};}function removeEntity(_0x24056f,_0x3c22d4){return function(_0x2301db){if(_0x2301db){return _0x2301db[_0x6d5e('0x23')]()['then'](function(){var _0x25a635=_0x2301db[_0x6d5e('0x24')]({'plain':!![]});var _0x45ae42=_0x6d5e('0x25');return db[_0x6d5e('0x26')][_0x6d5e('0x23')]({'where':{'type':_0x45ae42,'resourceId':_0x25a635['id']}})[_0x6d5e('0x22')](function(){return _0x2301db;});})[_0x6d5e('0x22')](function(){_0x24056f['status'](0xcc)[_0x6d5e('0x15')]();});}};}function handleEntityNotFound(_0x1e4d7c,_0x43f145){return function(_0x3b5730){if(!_0x3b5730){_0x1e4d7c[_0x6d5e('0x27')](0x194);}return _0x3b5730;};}function handleError(_0x28b920,_0x2af1d5){_0x2af1d5=_0x2af1d5||0x1f4;return function(_0x1071d3){logger[_0x6d5e('0x28')](_0x1071d3['stack']);if(_0x1071d3[_0x6d5e('0x29')]){delete _0x1071d3[_0x6d5e('0x29')];}_0x28b920[_0x6d5e('0x1b')](_0x2af1d5)[_0x6d5e('0x2a')](_0x1071d3);};}exports[_0x6d5e('0x2b')]=function(_0x32f274,_0x42564f){var _0x24f994={},_0x4482a6={},_0x206234={'count':0x0,'rows':[]};var _0x2edb9f=_[_0x6d5e('0x2c')](db['SquareOdbc']['rawAttributes'],function(_0x40e5fb){return{'name':_0x40e5fb[_0x6d5e('0x2d')],'type':_0x40e5fb[_0x6d5e('0x2e')][_0x6d5e('0x2f')]};});_0x4482a6[_0x6d5e('0x30')]=_[_0x6d5e('0x2c')](_0x2edb9f,_0x6d5e('0x29'));_0x4482a6['query']=_['keys'](_0x32f274[_0x6d5e('0x31')]);_0x4482a6[_0x6d5e('0x32')]=_[_0x6d5e('0x33')](_0x4482a6[_0x6d5e('0x30')],_0x4482a6[_0x6d5e('0x31')]);_0x24f994[_0x6d5e('0x34')]=_[_0x6d5e('0x33')](_0x4482a6[_0x6d5e('0x30')],qs[_0x6d5e('0x35')](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x35')]));_0x24f994[_0x6d5e('0x34')]=_0x24f994[_0x6d5e('0x34')]['length']?_0x24f994[_0x6d5e('0x34')]:_0x4482a6[_0x6d5e('0x30')];if(!_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x36')](_0x6d5e('0x37'))){_0x24f994['limit']=qs['limit'](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x19')]);_0x24f994[_0x6d5e('0x17')]=qs['offset'](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x17')]);}_0x24f994['order']=qs[_0x6d5e('0x38')](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x38')]);_0x24f994[_0x6d5e('0x39')]=qs[_0x6d5e('0x32')](_['pick'](_0x32f274[_0x6d5e('0x31')],_0x4482a6[_0x6d5e('0x32')]),_0x2edb9f);if(_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x3a')]){_0x24f994[_0x6d5e('0x39')]=_['merge'](_0x24f994[_0x6d5e('0x39')],{'$or':_['map'](_0x2edb9f,function(_0x6b52ae){if(_0x6b52ae[_0x6d5e('0x2e')]!==_0x6d5e('0x3b')){var _0x19b437={};_0x19b437[_0x6b52ae['name']]={'$like':'%'+_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x3a')]+'%'};return _0x19b437;}})});}_0x24f994=_['merge']({},_0x24f994,_0x32f274[_0x6d5e('0x3c')]);var _0x4b948d={'where':_0x24f994[_0x6d5e('0x39')]};return db['SquareOdbc'][_0x6d5e('0x1a')](_0x4b948d)['then'](function(_0x5c0a1a){_0x206234['count']=_0x5c0a1a;if(_0x32f274['query'][_0x6d5e('0x3d')]){_0x24f994[_0x6d5e('0x3e')]=[{'all':!![]}];}return db[_0x6d5e('0x3f')][_0x6d5e('0x40')](_0x24f994);})['then'](function(_0x2b2292){_0x206234['rows']=_0x2b2292;return _0x206234;})['then'](respondWithFilteredResult(_0x42564f,_0x24f994))[_0x6d5e('0x41')](handleError(_0x42564f,null));};exports[_0x6d5e('0x42')]=function(_0x539127,_0x1f2c7f){var _0x118743={'raw':!![],'where':{'id':_0x539127[_0x6d5e('0x43')]['id']}},_0x33449f={};_0x33449f['model']=_[_0x6d5e('0x44')](db['SquareOdbc'][_0x6d5e('0x45')]);_0x33449f[_0x6d5e('0x31')]=_[_0x6d5e('0x44')](_0x539127[_0x6d5e('0x31')]);_0x33449f[_0x6d5e('0x32')]=_['intersection'](_0x33449f[_0x6d5e('0x30')],_0x33449f[_0x6d5e('0x31')]);_0x118743[_0x6d5e('0x34')]=_['intersection'](_0x33449f['model'],qs[_0x6d5e('0x35')](_0x539127[_0x6d5e('0x31')][_0x6d5e('0x35')]));_0x118743[_0x6d5e('0x34')]=_0x118743['attributes']['length']?_0x118743['attributes']:_0x33449f[_0x6d5e('0x30')];if(_0x539127[_0x6d5e('0x31')][_0x6d5e('0x3d')]){_0x118743[_0x6d5e('0x3e')]=[{'all':!![]}];}_0x118743=_[_0x6d5e('0x46')]({},_0x118743,_0x539127[_0x6d5e('0x3c')]);return db['SquareOdbc'][_0x6d5e('0x47')](_0x118743)[_0x6d5e('0x22')](handleEntityNotFound(_0x1f2c7f,null))[_0x6d5e('0x22')](respondWithResult(_0x1f2c7f,null))[_0x6d5e('0x41')](handleError(_0x1f2c7f,null));};exports[_0x6d5e('0x48')]=function(_0x5f499e,_0x6d39d9){return db['SquareOdbc'][_0x6d5e('0x48')](_0x5f499e['body'],{})[_0x6d5e('0x22')](function(_0x315d6a){var _0x29eb03=_0x5f499e['user']['get']({'plain':!![]});if(!_0x29eb03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29eb03[_0x6d5e('0x49')]===_0x6d5e('0x4a')){var _0x166e13=_0x315d6a['get']({'plain':!![]});var _0x1a4b48=_0x6d5e('0x25');return db[_0x6d5e('0x4b')]['find']({'where':{'name':_0x1a4b48,'userProfileId':_0x29eb03['userProfileId']},'raw':!![]})['then'](function(_0x390feb){if(_0x390feb&&_0x390feb[_0x6d5e('0x4c')]===0x0){return db['UserProfileResource'][_0x6d5e('0x48')]({'name':_0x166e13[_0x6d5e('0x29')],'resourceId':_0x166e13['id'],'type':_0x390feb[_0x6d5e('0x29')],'sectionId':_0x390feb['id']},{})['then'](function(){return _0x315d6a;});}else{return _0x315d6a;}})[_0x6d5e('0x41')](function(_0x55ae89){logger['error'](_0x6d5e('0x4d'),_0x55ae89);throw _0x55ae89;});}return _0x315d6a;})[_0x6d5e('0x22')](respondWithResult(_0x6d39d9,0xc9))[_0x6d5e('0x41')](handleError(_0x6d39d9,null));};exports[_0x6d5e('0x21')]=function(_0x77af01,_0x30baf2){if(_0x77af01['body']['id']){delete _0x77af01['body']['id'];}return db[_0x6d5e('0x3f')][_0x6d5e('0x47')]({'where':{'id':_0x77af01[_0x6d5e('0x43')]['id']}})[_0x6d5e('0x22')](handleEntityNotFound(_0x30baf2,null))[_0x6d5e('0x22')](saveUpdates(_0x77af01[_0x6d5e('0x4e')],null))[_0x6d5e('0x22')](respondWithResult(_0x30baf2,null))['catch'](handleError(_0x30baf2,null));};exports['destroy']=function(_0x2b8317,_0x23b8ff){return db[_0x6d5e('0x3f')]['find']({'where':{'id':_0x2b8317[_0x6d5e('0x43')]['id']}})[_0x6d5e('0x22')](handleEntityNotFound(_0x23b8ff,null))[_0x6d5e('0x22')](removeEntity(_0x23b8ff,null))[_0x6d5e('0x41')](handleError(_0x23b8ff,null));};exports[_0x6d5e('0x4f')]=function(_0x1a8248,_0x4a998f,_0x382fb2){var _0x3813bb;return db[_0x6d5e('0x3f')][_0x6d5e('0x47')]({'where':{'id':_0x1a8248[_0x6d5e('0x43')]['id']},'attributes':['id',_0x6d5e('0x50')]})[_0x6d5e('0x22')](handleEntityNotFound(_0x4a998f,null))[_0x6d5e('0x22')](function(_0x4d02f4){if(_0x4d02f4){var _0x2c4674=require(_0x6d5e('0x51'))();_0x2c4674[_0x6d5e('0x52')](_0x4d02f4['dsn']);_0x2c4674[_0x6d5e('0x53')]();return _0x4d02f4;}})[_0x6d5e('0x22')](respondWithResult(_0x4a998f,null))[_0x6d5e('0x41')](handleError(_0x4a998f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 226c611..0215486 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x935b=['exports','SquareOdbc','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x935b,0x176));var _0xb935=function(_0x2e0da4,_0x5e362a){_0x2e0da4=_0x2e0da4-0x0;var _0x3dfb09=_0x935b[_0x2e0da4];return _0x3dfb09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb935('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb935('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb935('0x2'));var config=require(_0xb935('0x3'));var attributes=require('./squareOdbc.attributes');module[_0xb935('0x4')]=function(_0x2eb61e,_0x3ffffb){return _0x2eb61e['define'](_0xb935('0x5'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a00=['../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4c52cc,_0x3f219f){var _0x174a12=function(_0x46942e){while(--_0x46942e){_0x4c52cc['push'](_0x4c52cc['shift']());}};_0x174a12(++_0x3f219f);}(_0x3a00,0xfc));var _0x03a0=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x3a00[_0x4169d8];return _0x32084a;};'use strict';var _=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var logger=require(_0x03a0('0x2'))(_0x03a0('0x3'));var moment=require(_0x03a0('0x4'));var BPromise=require(_0x03a0('0x5'));var rp=require(_0x03a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03a0('0x7'));var config=require(_0x03a0('0x8'));var attributes=require(_0x03a0('0x9'));module['exports']=function(_0x1601f4,_0x446865){return _0x1601f4[_0x03a0('0xa')](_0x03a0('0xb'),attributes,{'tableName':_0x03a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index d518adb..eced494 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9587=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x315b1b,_0x4ff3db){var _0x3327ab=function(_0x57dbc4){while(--_0x57dbc4){_0x315b1b['push'](_0x315b1b['shift']());}};_0x3327ab(++_0x4ff3db);}(_0x9587,0x111));var _0x7958=function(_0x4d9a48,_0x20bc50){_0x4d9a48=_0x4d9a48-0x0;var _0xef464d=_0x9587[_0x4d9a48];return _0xef464d;};'use strict';var _=require(_0x7958('0x0'));var util=require(_0x7958('0x1'));var moment=require(_0x7958('0x2'));var BPromise=require(_0x7958('0x3'));var rs=require(_0x7958('0x4'));var fs=require('fs');var Redis=require(_0x7958('0x5'));var db=require(_0x7958('0x6'))['db'];var utils=require(_0x7958('0x7'));var logger=require(_0x7958('0x8'))(_0x7958('0x9'));var config=require(_0x7958('0xa'));var jayson=require(_0x7958('0xb'));var client=jayson[_0x7958('0xc')][_0x7958('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x43d987,_0x264e67,_0xab9216){return new BPromise(function(_0x22241c,_0x456f63){return client[_0x7958('0xe')](_0x43d987,_0xab9216)[_0x7958('0xf')](function(_0xd6fad5){logger[_0x7958('0x10')](_0x7958('0x11'),_0x264e67,_0x7958('0x12'));logger['debug'](_0x7958('0x13'),_0x264e67,_0x7958('0x12'),JSON[_0x7958('0x14')](_0xd6fad5));if(_0xd6fad5[_0x7958('0x15')]){if(_0xd6fad5[_0x7958('0x15')]['code']===0x1f4){logger[_0x7958('0x15')](_0x7958('0x11'),_0x264e67,_0xd6fad5[_0x7958('0x15')]['message']);return _0x456f63(_0xd6fad5[_0x7958('0x15')][_0x7958('0x16')]);}logger[_0x7958('0x15')](_0x7958('0x11'),_0x264e67,_0xd6fad5[_0x7958('0x15')][_0x7958('0x16')]);return _0x22241c(_0xd6fad5[_0x7958('0x15')][_0x7958('0x16')]);}else{logger[_0x7958('0x10')](_0x7958('0x11'),_0x264e67,'request\x20sent');_0x22241c(_0xd6fad5[_0x7958('0x17')][_0x7958('0x16')]);}})['catch'](function(_0x29eef9){logger[_0x7958('0x15')]('SquareOdbc,\x20%s,\x20%s',_0x264e67,_0x29eef9);_0x456f63(_0x29eef9);});});}exports[_0x7958('0x18')]=function(_0x5a4410){var _0xbc334a=this;return new Promise(function(_0x37857f,_0x498316){return db[_0x7958('0x19')][_0x7958('0x1a')]({'raw':_0x5a4410[_0x7958('0x1b')]?_0x5a4410[_0x7958('0x1b')][_0x7958('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a4410['options']?_0x5a4410[_0x7958('0x1b')][_0x7958('0x1d')]||null:null,'attributes':_0x5a4410[_0x7958('0x1b')]?_0x5a4410[_0x7958('0x1b')][_0x7958('0x1e')]||null:null,'include':_0x5a4410[_0x7958('0x1b')]?_0x5a4410[_0x7958('0x1b')][_0x7958('0x1f')]?_[_0x7958('0x20')](_0x5a4410[_0x7958('0x1b')][_0x7958('0x1f')],function(_0x1a2791){return{'model':db[_0x1a2791['model']],'as':_0x1a2791['as'],'attributes':_0x1a2791[_0x7958('0x1e')],'include':_0x1a2791[_0x7958('0x1f')]?_[_0x7958('0x20')](_0x1a2791[_0x7958('0x1f')],function(_0x72bde3){return{'model':db[_0x72bde3[_0x7958('0x21')]],'as':_0x72bde3['as'],'attributes':_0x72bde3[_0x7958('0x1e')],'include':_0x72bde3[_0x7958('0x1f')]?_[_0x7958('0x20')](_0x72bde3['include'],function(_0x119f6e){return{'model':db[_0x119f6e['model']],'as':_0x119f6e['as'],'attributes':_0x119f6e[_0x7958('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7958('0xf')](function(_0x1ba11e){logger[_0x7958('0x10')]('ShowSquareOdbc',_0x5a4410);logger['debug']('ShowSquareOdbc',_0x5a4410,JSON[_0x7958('0x14')](_0x1ba11e));_0x37857f(_0x1ba11e);})[_0x7958('0x22')](function(_0x1b6682){logger[_0x7958('0x15')](_0x7958('0x18'),_0x1b6682['message'],_0x5a4410);_0x498316(_0xbc334a[_0x7958('0x15')](0x1f4,_0x1b6682['message']));});});}; \ No newline at end of file +var _0xb9ad=['catch','ShowSquareOdbc','find','options','raw','where','attributes','map','model','include','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0xb9ad,0x12a));var _0xdb9a=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb9ad[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xdb9a('0x0'));var moment=require(_0xdb9a('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb9a('0x3'))['db'];var utils=require(_0xdb9a('0x4'));var logger=require(_0xdb9a('0x5'))(_0xdb9a('0x6'));var config=require(_0xdb9a('0x7'));var jayson=require(_0xdb9a('0x8'));var client=jayson[_0xdb9a('0x9')][_0xdb9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2655f2,_0x216a4f,_0x43be6a){return new BPromise(function(_0x515278,_0x3f7a2a){return client[_0xdb9a('0xb')](_0x2655f2,_0x43be6a)[_0xdb9a('0xc')](function(_0x26e286){logger[_0xdb9a('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x216a4f,'request\x20sent');logger[_0xdb9a('0xe')](_0xdb9a('0xf'),_0x216a4f,_0xdb9a('0x10'),JSON[_0xdb9a('0x11')](_0x26e286));if(_0x26e286[_0xdb9a('0x12')]){if(_0x26e286['error'][_0xdb9a('0x13')]===0x1f4){logger[_0xdb9a('0x12')](_0xdb9a('0x14'),_0x216a4f,_0x26e286[_0xdb9a('0x12')]['message']);return _0x3f7a2a(_0x26e286['error'][_0xdb9a('0x15')]);}logger[_0xdb9a('0x12')](_0xdb9a('0x14'),_0x216a4f,_0x26e286['error']['message']);return _0x515278(_0x26e286[_0xdb9a('0x12')]['message']);}else{logger['info'](_0xdb9a('0x14'),_0x216a4f,_0xdb9a('0x10'));_0x515278(_0x26e286['result'][_0xdb9a('0x15')]);}})[_0xdb9a('0x16')](function(_0x5d03a6){logger['error'](_0xdb9a('0x14'),_0x216a4f,_0x5d03a6);_0x3f7a2a(_0x5d03a6);});});}exports[_0xdb9a('0x17')]=function(_0x4e5cde){var _0x495b8e=this;return new Promise(function(_0x3f3ba4,_0x3f6d50){return db['SquareOdbc'][_0xdb9a('0x18')]({'raw':_0x4e5cde[_0xdb9a('0x19')]?_0x4e5cde[_0xdb9a('0x19')][_0xdb9a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e5cde['options']?_0x4e5cde['options'][_0xdb9a('0x1b')]||null:null,'attributes':_0x4e5cde[_0xdb9a('0x19')]?_0x4e5cde['options'][_0xdb9a('0x1c')]||null:null,'include':_0x4e5cde[_0xdb9a('0x19')]?_0x4e5cde['options']['include']?_[_0xdb9a('0x1d')](_0x4e5cde['options']['include'],function(_0x1b5b13){return{'model':db[_0x1b5b13[_0xdb9a('0x1e')]],'as':_0x1b5b13['as'],'attributes':_0x1b5b13[_0xdb9a('0x1c')],'include':_0x1b5b13[_0xdb9a('0x1f')]?_['map'](_0x1b5b13['include'],function(_0x1d7c81){return{'model':db[_0x1d7c81[_0xdb9a('0x1e')]],'as':_0x1d7c81['as'],'attributes':_0x1d7c81[_0xdb9a('0x1c')],'include':_0x1d7c81[_0xdb9a('0x1f')]?_[_0xdb9a('0x1d')](_0x1d7c81['include'],function(_0x3bd812){return{'model':db[_0x3bd812[_0xdb9a('0x1e')]],'as':_0x3bd812['as'],'attributes':_0x3bd812[_0xdb9a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523337){logger['info'](_0xdb9a('0x17'),_0x4e5cde);logger[_0xdb9a('0xe')](_0xdb9a('0x17'),_0x4e5cde,JSON[_0xdb9a('0x11')](_0x523337));_0x3f3ba4(_0x523337);})[_0xdb9a('0x16')](function(_0x22b48e){logger['error'](_0xdb9a('0x17'),_0x22b48e['message'],_0x4e5cde);_0x3f6d50(_0x495b8e['error'](0x1f4,_0x22b48e[_0xdb9a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 6dfccc5..e62d4d6 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2074=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x9bc6d4,_0x4f4d97){var _0xbbb477=function(_0x5197cc){while(--_0x5197cc){_0x9bc6d4['push'](_0x9bc6d4['shift']());}};_0xbbb477(++_0x4f4d97);}(_0x2074,0x157));var _0x4207=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x2074[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x4207('0x0'));var util=require('util');var path=require(_0x4207('0x1'));var timeout=require(_0x4207('0x2'));var express=require('express');var router=express[_0x4207('0x3')]();var fs_extra=require(_0x4207('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4207('0x5'));var config=require(_0x4207('0x6'));var controller=require(_0x4207('0x7'));router[_0x4207('0x8')]('/',auth[_0x4207('0x9')](),controller[_0x4207('0xa')]);router[_0x4207('0x8')](_0x4207('0xb'),auth['isAuthenticated'](),controller[_0x4207('0xc')]);router['post']('/',auth[_0x4207('0x9')](),controller[_0x4207('0xd')]);router[_0x4207('0xe')](_0x4207('0xb'),auth['isAuthenticated'](),controller[_0x4207('0xf')]);router[_0x4207('0x10')](_0x4207('0xb'),auth[_0x4207('0x9')](),controller[_0x4207('0x11')]);module[_0x4207('0x12')]=router; \ No newline at end of file +var _0x3895=['create','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated'];(function(_0x17c487,_0x2b72f1){var _0x3feeb8=function(_0x49aaa1){while(--_0x49aaa1){_0x17c487['push'](_0x17c487['shift']());}};_0x3feeb8(++_0x2b72f1);}(_0x3895,0x102));var _0x5389=function(_0x13706f,_0x503c3f){_0x13706f=_0x13706f-0x0;var _0x5959a0=_0x3895[_0x13706f];return _0x5959a0;};'use strict';var multer=require(_0x5389('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5389('0x1'));var express=require('express');var router=express[_0x5389('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5389('0x3'));var interaction=require(_0x5389('0x4'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x5389('0x5')]('/',auth['isAuthenticated'](),controller[_0x5389('0x6')]);router[_0x5389('0x5')]('/:id',auth[_0x5389('0x7')](),controller['show']);router['post']('/',auth[_0x5389('0x7')](),controller[_0x5389('0x8')]);router['put'](_0x5389('0x9'),auth['isAuthenticated'](),controller[_0x5389('0xa')]);router[_0x5389('0xb')](_0x5389('0x9'),auth['isAuthenticated'](),controller[_0x5389('0xc')]);module[_0x5389('0xd')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0e859d6..7fef578 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa595=['preproduction','utf8','production','toString','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long','getDataValue'];(function(_0x50328b,_0x27266f){var _0x17f9ca=function(_0x35802c){while(--_0x35802c){_0x50328b['push'](_0x50328b['shift']());}};_0x17f9ca(++_0x27266f);}(_0xa595,0x198));var _0x5a59=function(_0x574e65,_0x3d8d9){_0x574e65=_0x574e65-0x0;var _0x4e7315=_0xa595[_0x574e65];return _0x4e7315;};'use strict';var Sequelize=require(_0x5a59('0x0'));module[_0x5a59('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5a59('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5a59('0x3')]},'notes':{'type':Sequelize[_0x5a59('0x4')]},'preproduction':{'type':Sequelize[_0x5a59('0x5')](_0x5a59('0x6')),'get':function(){if(this[_0x5a59('0x7')](_0x5a59('0x8'))){return this[_0x5a59('0x7')](_0x5a59('0x8'))['toString'](_0x5a59('0x9'));}}},'production':{'type':Sequelize[_0x5a59('0x5')](_0x5a59('0x6')),'get':function(){if(this[_0x5a59('0x7')]('production')){return this[_0x5a59('0x7')](_0x5a59('0xa'))[_0x5a59('0xb')](_0x5a59('0x9'));}}},'savedAt':{'type':Sequelize[_0x5a59('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xfbfc=['toString','DATE','sequelize','STRING','name','TEXT','BLOB','preproduction','getDataValue','utf8','long','production'];(function(_0x3a86a7,_0x12ade0){var _0x19b1b6=function(_0x2af9d0){while(--_0x2af9d0){_0x3a86a7['push'](_0x3a86a7['shift']());}};_0x19b1b6(++_0x12ade0);}(_0xfbfc,0x1be));var _0xcfbf=function(_0x4e1750,_0x4f7f3c){_0x4e1750=_0x4e1750-0x0;var _0x5ab29f=_0xfbfc[_0x4e1750];return _0x5ab29f;};'use strict';var Sequelize=require(_0xcfbf('0x0'));module['exports']={'name':{'type':Sequelize[_0xcfbf('0x1')],'unique':_0xcfbf('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcfbf('0x1')]},'notes':{'type':Sequelize[_0xcfbf('0x3')]},'preproduction':{'type':Sequelize[_0xcfbf('0x4')]('long'),'get':function(){if(this['getDataValue'](_0xcfbf('0x5'))){return this[_0xcfbf('0x6')](_0xcfbf('0x5'))['toString'](_0xcfbf('0x7'));}}},'production':{'type':Sequelize[_0xcfbf('0x4')](_0xcfbf('0x8')),'get':function(){if(this[_0xcfbf('0x6')](_0xcfbf('0x9'))){return this['getDataValue'](_0xcfbf('0x9'))[_0xcfbf('0xa')](_0xcfbf('0x7'));}}},'savedAt':{'type':Sequelize[_0xcfbf('0xb')]},'publishedAt':{'type':Sequelize[_0xcfbf('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 85140dd..ad1b056 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a43=['include','findAll','rows','catch','show','params','find','create','body','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','publish','pick','ioredis','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','Content-Range','then','destroy','get','SquareProjects','agi','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','merge','options','includeAll'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x8a43,0x147));var _0x38a4=function(_0x16576e,_0x4e7379){_0x16576e=_0x16576e-0x0;var _0x10ba19=_0x8a43[_0x16576e];return _0x10ba19;};'use strict';var _=require('lodash');var Redis=require(_0x38a4('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x38a4('0x1'))(_0x38a4('0x2'));var config=require(_0x38a4('0x3'));var db=require('../../mysqldb')['db'];config[_0x38a4('0x4')]=_['defaults'](config[_0x38a4('0x4')],{'host':_0x38a4('0x5'),'port':0x18eb});var socket=require(_0x38a4('0x6'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x46df03,_0x42bd84){_0x42bd84=_0x42bd84||0xc8;return function(_0x2d26cb){if(_0x2d26cb){return _0x46df03[_0x38a4('0x7')](_0x42bd84)[_0x38a4('0x8')](_0x2d26cb);}};}function respondWithFilteredResult(_0x301664,_0x3a007b){return function(_0x3c8fbe){if(_0x3c8fbe){var _0x10695b=typeof _0x3a007b[_0x38a4('0x9')]===_0x38a4('0xa')&&typeof _0x3a007b[_0x38a4('0xb')]==='undefined';var _0x290104=_0x3c8fbe[_0x38a4('0xc')];var _0x52ec6d=_0x10695b?0x0:_0x3a007b[_0x38a4('0x9')];var _0x4ba7f2=_0x10695b?_0x3c8fbe[_0x38a4('0xc')]:_0x3a007b[_0x38a4('0x9')]+_0x3a007b['limit'];var _0x408865;if(_0x4ba7f2>=_0x290104){_0x4ba7f2=_0x290104;_0x408865=0xc8;}else{_0x408865=0xce;}_0x301664[_0x38a4('0x7')](_0x408865);return _0x301664['set'](_0x38a4('0xd'),_0x52ec6d+'-'+_0x4ba7f2+'/'+_0x290104)['json'](_0x3c8fbe);}return null;};}function saveUpdates(_0x41dac5){return function(_0x306b9f){if(_0x306b9f){return _0x306b9f['update'](_0x41dac5)[_0x38a4('0xe')](function(_0x1c5ff6){return _0x1c5ff6;});}return null;};}function removeEntity(_0x27e69b){return function(_0x27abb8){if(_0x27abb8){return _0x27abb8[_0x38a4('0xf')]()[_0x38a4('0xe')](function(){var _0x5e232e=_0x27abb8[_0x38a4('0x10')]({'plain':!![]});var _0x223b69=_0x38a4('0x11');return db['UserProfileResource'][_0x38a4('0xf')]({'where':{'type':_0x223b69,'resourceId':_0x5e232e['id']}})[_0x38a4('0xe')](function(){return _0x27abb8;});})[_0x38a4('0xe')](function(){var _0x241607=new Redis(config[_0x38a4('0x4')]);_0x241607['publish'](_0x38a4('0x12'),JSON['stringify']({'id':_0x27abb8['id'],'deleted':!![]}));})[_0x38a4('0xe')](function(){_0x27e69b[_0x38a4('0x7')](0xcc)[_0x38a4('0x13')]();});}};}function handleEntityNotFound(_0x4ff89a){return function(_0x3f4497){if(!_0x3f4497){_0x4ff89a[_0x38a4('0x14')](0x194);}return _0x3f4497;};}function handleError(_0x399ad9,_0x55909b){_0x55909b=_0x55909b||0x1f4;return function(_0xd6e381){logger[_0x38a4('0x15')](_0xd6e381[_0x38a4('0x16')]);if(_0xd6e381[_0x38a4('0x17')]){delete _0xd6e381[_0x38a4('0x17')];}_0x399ad9[_0x38a4('0x7')](_0x55909b)[_0x38a4('0x18')](_0xd6e381);};}exports[_0x38a4('0x19')]=function(_0x3ec452,_0x2842ac){var _0x217a05={},_0x556c82={},_0x48be85={'count':0x0,'rows':[]};var _0x5c49fc=_[_0x38a4('0x1a')](db[_0x38a4('0x1b')][_0x38a4('0x1c')],function(_0x18faaf){return{'name':_0x18faaf['fieldName'],'type':_0x18faaf[_0x38a4('0x1d')][_0x38a4('0x1e')]};});_0x556c82[_0x38a4('0x1f')]=_[_0x38a4('0x1a')](_0x5c49fc,_0x38a4('0x17'));_0x556c82[_0x38a4('0x20')]=_[_0x38a4('0x21')](_0x3ec452['query']);_0x556c82[_0x38a4('0x22')]=_['intersection'](_0x556c82[_0x38a4('0x1f')],_0x556c82[_0x38a4('0x20')]);_0x217a05[_0x38a4('0x23')]=_[_0x38a4('0x24')](_0x556c82['model'],qs[_0x38a4('0x25')](_0x3ec452[_0x38a4('0x20')]['fields']));_0x217a05[_0x38a4('0x23')]=_0x217a05[_0x38a4('0x23')][_0x38a4('0x26')]?_0x217a05[_0x38a4('0x23')]:_0x556c82[_0x38a4('0x1f')];if(!_0x3ec452['query']['hasOwnProperty']('nolimit')){_0x217a05[_0x38a4('0xb')]=qs['limit'](_0x3ec452['query'][_0x38a4('0xb')]);_0x217a05[_0x38a4('0x9')]=qs[_0x38a4('0x9')](_0x3ec452['query'][_0x38a4('0x9')]);}_0x217a05[_0x38a4('0x27')]=qs[_0x38a4('0x28')](_0x3ec452[_0x38a4('0x20')][_0x38a4('0x28')]);_0x217a05['where']=qs['filters'](_['pick'](_0x3ec452[_0x38a4('0x20')],_0x556c82['filters']),_0x5c49fc);if(_0x3ec452['query']['filter']){_0x217a05[_0x38a4('0x29')]=_[_0x38a4('0x2a')](_0x217a05[_0x38a4('0x29')],{'$or':_[_0x38a4('0x1a')](_0x5c49fc,function(_0x4faf69){if(_0x4faf69[_0x38a4('0x1d')]!=='VIRTUAL'){var _0x437639={};_0x437639[_0x4faf69[_0x38a4('0x17')]]={'$like':'%'+_0x3ec452[_0x38a4('0x20')]['filter']+'%'};return _0x437639;}})});}_0x217a05=_[_0x38a4('0x2a')]({},_0x217a05,_0x3ec452[_0x38a4('0x2b')]);var _0x101eaa={'where':_0x217a05[_0x38a4('0x29')]};return db[_0x38a4('0x1b')][_0x38a4('0xc')](_0x101eaa)['then'](function(_0x372951){_0x48be85[_0x38a4('0xc')]=_0x372951;if(_0x3ec452[_0x38a4('0x20')][_0x38a4('0x2c')]){_0x217a05[_0x38a4('0x2d')]=[{'all':!![]}];}return db[_0x38a4('0x1b')][_0x38a4('0x2e')](_0x217a05);})[_0x38a4('0xe')](function(_0x4353c2){_0x48be85[_0x38a4('0x2f')]=_0x4353c2;return _0x48be85;})['then'](respondWithFilteredResult(_0x2842ac,_0x217a05))[_0x38a4('0x30')](handleError(_0x2842ac,null));};exports[_0x38a4('0x31')]=function(_0x4f667b,_0x4d1c95){var _0x389d5f={'raw':![],'where':{'id':_0x4f667b[_0x38a4('0x32')]['id']}},_0x502f41={};_0x502f41[_0x38a4('0x1f')]=_[_0x38a4('0x21')](db[_0x38a4('0x1b')][_0x38a4('0x1c')]);_0x502f41[_0x38a4('0x20')]=_[_0x38a4('0x21')](_0x4f667b['query']);_0x502f41[_0x38a4('0x22')]=_[_0x38a4('0x24')](_0x502f41[_0x38a4('0x1f')],_0x502f41[_0x38a4('0x20')]);_0x389d5f['attributes']=_['intersection'](_0x502f41[_0x38a4('0x1f')],qs[_0x38a4('0x25')](_0x4f667b[_0x38a4('0x20')][_0x38a4('0x25')]));_0x389d5f[_0x38a4('0x23')]=_0x389d5f['attributes'][_0x38a4('0x26')]?_0x389d5f[_0x38a4('0x23')]:_0x502f41[_0x38a4('0x1f')];if(_0x4f667b[_0x38a4('0x20')][_0x38a4('0x2c')]){_0x389d5f[_0x38a4('0x2d')]=[{'all':!![]}];}_0x389d5f=_[_0x38a4('0x2a')]({},_0x389d5f,_0x4f667b[_0x38a4('0x2b')]);return db[_0x38a4('0x1b')][_0x38a4('0x33')](_0x389d5f)[_0x38a4('0xe')](handleEntityNotFound(_0x4d1c95,null))[_0x38a4('0xe')](respondWithResult(_0x4d1c95,null))[_0x38a4('0x30')](handleError(_0x4d1c95,null));};exports[_0x38a4('0x34')]=function(_0x469b0f,_0x18ddb1){return db[_0x38a4('0x1b')][_0x38a4('0x34')](_0x469b0f[_0x38a4('0x35')],{})[_0x38a4('0xe')](function(_0x37a7f3){var _0x475ea0=_0x469b0f[_0x38a4('0x36')][_0x38a4('0x10')]({'plain':!![]});if(!_0x475ea0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x475ea0['role']===_0x38a4('0x36')){var _0x164d8b=_0x37a7f3[_0x38a4('0x10')]({'plain':!![]});var _0x22bf4f=_0x38a4('0x11');return db['UserProfileSection'][_0x38a4('0x33')]({'where':{'name':_0x22bf4f,'userProfileId':_0x475ea0[_0x38a4('0x37')]},'raw':!![]})['then'](function(_0x3cdcbc){if(_0x3cdcbc&&_0x3cdcbc[_0x38a4('0x38')]===0x0){return db[_0x38a4('0x39')][_0x38a4('0x34')]({'name':_0x164d8b[_0x38a4('0x17')],'resourceId':_0x164d8b['id'],'type':_0x3cdcbc[_0x38a4('0x17')],'sectionId':_0x3cdcbc['id']},{})[_0x38a4('0xe')](function(){return _0x37a7f3;});}else{return _0x37a7f3;}})[_0x38a4('0x30')](function(_0x368be2){logger[_0x38a4('0x15')](_0x38a4('0x3a'),_0x368be2);throw _0x368be2;});}return _0x37a7f3;})['then'](respondWithResult(_0x18ddb1,0xc9))['catch'](handleError(_0x18ddb1,null));};exports[_0x38a4('0x3b')]=function(_0x15f55f,_0xc6caa4){if(_0x15f55f[_0x38a4('0x35')]['id']){delete _0x15f55f[_0x38a4('0x35')]['id'];}return db[_0x38a4('0x1b')][_0x38a4('0x33')]({'where':{'id':_0x15f55f[_0x38a4('0x32')]['id']}})[_0x38a4('0xe')](handleEntityNotFound(_0xc6caa4,null))['then'](saveUpdates(_0x15f55f[_0x38a4('0x35')],null))[_0x38a4('0xe')](function(_0xf64bbd){if(!_0xf64bbd)return;var _0x4a4620=_0xf64bbd[_0x38a4('0x10')]({'plain':!![]});return _0x4a4620;})[_0x38a4('0xe')](function(_0x27597a){var _0x1e573c=new Redis(config[_0x38a4('0x4')]);_0x1e573c[_0x38a4('0x3c')]('agi',JSON['stringify'](_[_0x38a4('0x3d')](_0x27597a,['id',_0x38a4('0x17'),'production'])));return _0x27597a;})[_0x38a4('0xe')](respondWithResult(_0xc6caa4,null))['catch'](handleError(_0xc6caa4,null));};exports[_0x38a4('0xf')]=function(_0x263c36,_0xa99163){return db[_0x38a4('0x1b')][_0x38a4('0x33')]({'where':{'id':_0x263c36[_0x38a4('0x32')]['id']}})[_0x38a4('0xe')](handleEntityNotFound(_0xa99163,null))[_0x38a4('0xe')](removeEntity(_0xa99163,null))['catch'](handleError(_0xa99163,null));}; \ No newline at end of file +var _0xdeeb=['map','query','keys','filters','attributes','intersection','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','fields','find','create','role','user','autoAssociation','UserProfileResource','body','get','stringify','params','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','json','undefined','limit','offset','count','status','set','Content-Range','destroy','SquareProjects','then','publish','agi','error','stack','name','send','SquareProject','rawAttributes','fieldName','key'];(function(_0x5a6a82,_0x21de5a){var _0x24773d=function(_0x9c41da){while(--_0x9c41da){_0x5a6a82['push'](_0x5a6a82['shift']());}};_0x24773d(++_0x21de5a);}(_0xdeeb,0x64));var _0xbdee=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xdeeb[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0xbdee('0x0'));var Redis=require(_0xbdee('0x1'));var qs=require(_0xbdee('0x2'));var logger=require('../../config/logger')('api');var config=require(_0xbdee('0x3'));var db=require(_0xbdee('0x4'))['db'];config[_0xbdee('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbdee('0x6'))(new Redis(config['redis']));require(_0xbdee('0x7'))[_0xbdee('0x8')](socket);function respondWithResult(_0x44fe95,_0x72f1b4){_0x72f1b4=_0x72f1b4||0xc8;return function(_0x6e4263){if(_0x6e4263){return _0x44fe95['status'](_0x72f1b4)[_0xbdee('0x9')](_0x6e4263);}};}function respondWithFilteredResult(_0x269324,_0x2af846){return function(_0x33afad){if(_0x33afad){var _0x196f99=typeof _0x2af846['offset']===_0xbdee('0xa')&&typeof _0x2af846[_0xbdee('0xb')]==='undefined';var _0x3e1758=_0x33afad['count'];var _0x18b1b9=_0x196f99?0x0:_0x2af846[_0xbdee('0xc')];var _0xa39f89=_0x196f99?_0x33afad[_0xbdee('0xd')]:_0x2af846[_0xbdee('0xc')]+_0x2af846[_0xbdee('0xb')];var _0xc80523;if(_0xa39f89>=_0x3e1758){_0xa39f89=_0x3e1758;_0xc80523=0xc8;}else{_0xc80523=0xce;}_0x269324[_0xbdee('0xe')](_0xc80523);return _0x269324[_0xbdee('0xf')](_0xbdee('0x10'),_0x18b1b9+'-'+_0xa39f89+'/'+_0x3e1758)['json'](_0x33afad);}return null;};}function saveUpdates(_0x3b3be8){return function(_0x35ddec){if(_0x35ddec){return _0x35ddec['update'](_0x3b3be8)['then'](function(_0x3846c2){return _0x3846c2;});}return null;};}function removeEntity(_0x58d7d7){return function(_0x28e4c5){if(_0x28e4c5){return _0x28e4c5[_0xbdee('0x11')]()['then'](function(){var _0x102f8c=_0x28e4c5['get']({'plain':!![]});var _0x40f185=_0xbdee('0x12');return db['UserProfileResource'][_0xbdee('0x11')]({'where':{'type':_0x40f185,'resourceId':_0x102f8c['id']}})[_0xbdee('0x13')](function(){return _0x28e4c5;});})[_0xbdee('0x13')](function(){var _0x5f5d55=new Redis(config[_0xbdee('0x5')]);_0x5f5d55[_0xbdee('0x14')](_0xbdee('0x15'),JSON['stringify']({'id':_0x28e4c5['id'],'deleted':!![]}));})[_0xbdee('0x13')](function(){_0x58d7d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ad649){return function(_0x1469c1){if(!_0x1469c1){_0x4ad649['sendStatus'](0x194);}return _0x1469c1;};}function handleError(_0x1b2bf3,_0x39362a){_0x39362a=_0x39362a||0x1f4;return function(_0x2208bc){logger[_0xbdee('0x16')](_0x2208bc[_0xbdee('0x17')]);if(_0x2208bc[_0xbdee('0x18')]){delete _0x2208bc[_0xbdee('0x18')];}_0x1b2bf3[_0xbdee('0xe')](_0x39362a)[_0xbdee('0x19')](_0x2208bc);};}exports['index']=function(_0x5e8ca9,_0x2fb413){var _0x5880f1={},_0x225c9b={},_0x471fef={'count':0x0,'rows':[]};var _0x3a72e5=_['map'](db[_0xbdee('0x1a')][_0xbdee('0x1b')],function(_0x2efb7b){return{'name':_0x2efb7b[_0xbdee('0x1c')],'type':_0x2efb7b['type'][_0xbdee('0x1d')]};});_0x225c9b['model']=_[_0xbdee('0x1e')](_0x3a72e5,_0xbdee('0x18'));_0x225c9b[_0xbdee('0x1f')]=_[_0xbdee('0x20')](_0x5e8ca9[_0xbdee('0x1f')]);_0x225c9b[_0xbdee('0x21')]=_['intersection'](_0x225c9b['model'],_0x225c9b[_0xbdee('0x1f')]);_0x5880f1[_0xbdee('0x22')]=_[_0xbdee('0x23')](_0x225c9b['model'],qs['fields'](_0x5e8ca9[_0xbdee('0x1f')]['fields']));_0x5880f1[_0xbdee('0x22')]=_0x5880f1[_0xbdee('0x22')][_0xbdee('0x24')]?_0x5880f1[_0xbdee('0x22')]:_0x225c9b[_0xbdee('0x25')];if(!_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x26')](_0xbdee('0x27'))){_0x5880f1[_0xbdee('0xb')]=qs['limit'](_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0xb')]);_0x5880f1['offset']=qs['offset'](_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0xc')]);}_0x5880f1[_0xbdee('0x28')]=qs[_0xbdee('0x29')](_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x29')]);_0x5880f1['where']=qs[_0xbdee('0x21')](_[_0xbdee('0x2a')](_0x5e8ca9['query'],_0x225c9b['filters']),_0x3a72e5);if(_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x2b')]){_0x5880f1[_0xbdee('0x2c')]=_[_0xbdee('0x2d')](_0x5880f1[_0xbdee('0x2c')],{'$or':_['map'](_0x3a72e5,function(_0x771e3b){if(_0x771e3b[_0xbdee('0x2e')]!==_0xbdee('0x2f')){var _0x1c30dd={};_0x1c30dd[_0x771e3b[_0xbdee('0x18')]]={'$like':'%'+_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x2b')]+'%'};return _0x1c30dd;}})});}_0x5880f1=_[_0xbdee('0x2d')]({},_0x5880f1,_0x5e8ca9[_0xbdee('0x30')]);var _0x2d88ee={'where':_0x5880f1[_0xbdee('0x2c')]};return db[_0xbdee('0x1a')][_0xbdee('0xd')](_0x2d88ee)[_0xbdee('0x13')](function(_0x476b36){_0x471fef[_0xbdee('0xd')]=_0x476b36;if(_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x31')]){_0x5880f1[_0xbdee('0x32')]=[{'all':!![]}];}return db[_0xbdee('0x1a')][_0xbdee('0x33')](_0x5880f1);})[_0xbdee('0x13')](function(_0x297352){_0x471fef[_0xbdee('0x34')]=_0x297352;return _0x471fef;})[_0xbdee('0x13')](respondWithFilteredResult(_0x2fb413,_0x5880f1))[_0xbdee('0x35')](handleError(_0x2fb413,null));};exports['show']=function(_0x233eb3,_0x3270c5){var _0x75f279={'raw':![],'where':{'id':_0x233eb3['params']['id']}},_0x517470={};_0x517470[_0xbdee('0x25')]=_[_0xbdee('0x20')](db[_0xbdee('0x1a')][_0xbdee('0x1b')]);_0x517470['query']=_[_0xbdee('0x20')](_0x233eb3[_0xbdee('0x1f')]);_0x517470[_0xbdee('0x21')]=_[_0xbdee('0x23')](_0x517470[_0xbdee('0x25')],_0x517470[_0xbdee('0x1f')]);_0x75f279[_0xbdee('0x22')]=_[_0xbdee('0x23')](_0x517470[_0xbdee('0x25')],qs[_0xbdee('0x36')](_0x233eb3[_0xbdee('0x1f')][_0xbdee('0x36')]));_0x75f279[_0xbdee('0x22')]=_0x75f279[_0xbdee('0x22')][_0xbdee('0x24')]?_0x75f279[_0xbdee('0x22')]:_0x517470[_0xbdee('0x25')];if(_0x233eb3[_0xbdee('0x1f')][_0xbdee('0x31')]){_0x75f279['include']=[{'all':!![]}];}_0x75f279=_[_0xbdee('0x2d')]({},_0x75f279,_0x233eb3[_0xbdee('0x30')]);return db[_0xbdee('0x1a')][_0xbdee('0x37')](_0x75f279)['then'](handleEntityNotFound(_0x3270c5,null))['then'](respondWithResult(_0x3270c5,null))[_0xbdee('0x35')](handleError(_0x3270c5,null));};exports['create']=function(_0x5fe40c,_0x4ec058){return db[_0xbdee('0x1a')][_0xbdee('0x38')](_0x5fe40c['body'],{})['then'](function(_0x64ee65){var _0x1fc26c=_0x5fe40c['user']['get']({'plain':!![]});if(!_0x1fc26c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fc26c[_0xbdee('0x39')]===_0xbdee('0x3a')){var _0x4c05c4=_0x64ee65['get']({'plain':!![]});var _0x551ceb=_0xbdee('0x12');return db['UserProfileSection']['find']({'where':{'name':_0x551ceb,'userProfileId':_0x1fc26c['userProfileId']},'raw':!![]})['then'](function(_0x389ab2){if(_0x389ab2&&_0x389ab2[_0xbdee('0x3b')]===0x0){return db[_0xbdee('0x3c')]['create']({'name':_0x4c05c4[_0xbdee('0x18')],'resourceId':_0x4c05c4['id'],'type':_0x389ab2[_0xbdee('0x18')],'sectionId':_0x389ab2['id']},{})[_0xbdee('0x13')](function(){return _0x64ee65;});}else{return _0x64ee65;}})[_0xbdee('0x35')](function(_0x4c8670){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c8670);throw _0x4c8670;});}return _0x64ee65;})[_0xbdee('0x13')](respondWithResult(_0x4ec058,0xc9))['catch'](handleError(_0x4ec058,null));};exports['update']=function(_0x4213bf,_0x238a85){if(_0x4213bf[_0xbdee('0x3d')]['id']){delete _0x4213bf[_0xbdee('0x3d')]['id'];}return db[_0xbdee('0x1a')]['find']({'where':{'id':_0x4213bf['params']['id']}})[_0xbdee('0x13')](handleEntityNotFound(_0x238a85,null))[_0xbdee('0x13')](saveUpdates(_0x4213bf['body'],null))['then'](function(_0x2558fa){if(!_0x2558fa)return;var _0x5606be=_0x2558fa[_0xbdee('0x3e')]({'plain':!![]});return _0x5606be;})['then'](function(_0xf0cc4a){var _0x4f186b=new Redis(config[_0xbdee('0x5')]);_0x4f186b[_0xbdee('0x14')]('agi',JSON[_0xbdee('0x3f')](_[_0xbdee('0x2a')](_0xf0cc4a,['id',_0xbdee('0x18'),'production'])));return _0xf0cc4a;})[_0xbdee('0x13')](respondWithResult(_0x238a85,null))[_0xbdee('0x35')](handleError(_0x238a85,null));};exports[_0xbdee('0x11')]=function(_0x5d1cda,_0x1c63dc){return db[_0xbdee('0x1a')][_0xbdee('0x37')]({'where':{'id':_0x5d1cda[_0xbdee('0x40')]['id']}})[_0xbdee('0x13')](handleEntityNotFound(_0x1c63dc,null))[_0xbdee('0x13')](removeEntity(_0x1c63dc,null))[_0xbdee('0x35')](handleError(_0x1c63dc,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9fd7166..362748f 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x298f=['remove','emit','hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x16c824,_0x363c1d){var _0x267974=function(_0x58ab1f){while(--_0x58ab1f){_0x16c824['push'](_0x16c824['shift']());}};_0x267974(++_0x363c1d);}(_0x298f,0x1d8));var _0xf298=function(_0xbbcf16,_0x5a7910){_0xbbcf16=_0xbbcf16-0x0;var _0x5adf6f=_0x298f[_0xbbcf16];return _0x5adf6f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xf298('0x0'))['db'][_0xf298('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf298('0x2')](0x0);var events={'afterCreate':_0xf298('0x3'),'afterUpdate':_0xf298('0x4'),'afterDestroy':_0xf298('0x5')};function emitEvent(_0x267c4b){return function(_0x4a3b8b,_0x47e1f1,_0x4ce7d2){SquareProjectEvents['emit'](_0x267c4b+':'+_0x4a3b8b['id'],_0x4a3b8b);SquareProjectEvents[_0xf298('0x6')](_0x267c4b,_0x4a3b8b);_0x4ce7d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xf298('0x7')](e,emitEvent(event));}}module[_0xf298('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x8daa=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x92485e,_0xc66c99){var _0x5bdbe2=function(_0x2410d9){while(--_0x2410d9){_0x92485e['push'](_0x92485e['shift']());}};_0x5bdbe2(++_0xc66c99);}(_0x8daa,0xe2));var _0xa8da=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0x8daa[_0x132558];return _0x34f138;};'use strict';var EventEmitter=require(_0xa8da('0x0'));var SquareProject=require(_0xa8da('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa8da('0x2')](0x0);var events={'afterCreate':_0xa8da('0x3'),'afterUpdate':_0xa8da('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d8389){return function(_0x2949af,_0x50ccba,_0x22475b){SquareProjectEvents[_0xa8da('0x5')](_0x2d8389+':'+_0x2949af['id'],_0x2949af);SquareProjectEvents[_0xa8da('0x5')](_0x2d8389,_0x2949af);_0x22475b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xa8da('0x6')](e,emitEvent(event));}}module[_0xa8da('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2eb2893..8fdd10c 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dff=['savedAt','YYYY-MM-DD\x20HH:mm:ss','production','format','lodash','util','api','moment','request-promise','path','rimraf','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7dff,0x1e0));var _0xf7df=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x7dff[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xf7df('0x0'));var util=require(_0xf7df('0x1'));var logger=require('../../config/logger')(_0xf7df('0x2'));var moment=require(_0xf7df('0x3'));var BPromise=require('bluebird');var rp=require(_0xf7df('0x4'));var fs=require('fs');var path=require(_0xf7df('0x5'));var rimraf=require(_0xf7df('0x6'));var config=require('../../config/environment');var attributes=require(_0xf7df('0x7'));module[_0xf7df('0x8')]=function(_0x42eb7b,_0x3a60cf){return _0x42eb7b['define'](_0xf7df('0x9'),attributes,{'tableName':_0xf7df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d475b,_0x4170bd,_0x221db5){if(_0x1d475b[_0xf7df('0xb')](_0xf7df('0xc'))){_0x1d475b[_0xf7df('0xd')]=moment()['format'](_0xf7df('0xe'));}if(_0x1d475b[_0xf7df('0xb')](_0xf7df('0xf'))){_0x1d475b['publishedAt']=moment()[_0xf7df('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x221db5(null,_0x1d475b);}}});}; \ No newline at end of file +var _0xa62d=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','SquareProject','square_projects','changed'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0xa62d,0x1b6));var _0xda62=function(_0xa3b47a,_0x17c744){_0xa3b47a=_0xa3b47a-0x0;var _0xd57826=_0xa62d[_0xa3b47a];return _0xd57826;};'use strict';var _=require(_0xda62('0x0'));var util=require(_0xda62('0x1'));var logger=require(_0xda62('0x2'))(_0xda62('0x3'));var moment=require(_0xda62('0x4'));var BPromise=require(_0xda62('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda62('0x6'));var rimraf=require(_0xda62('0x7'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xda62('0x8')]=function(_0x44a3b4,_0x353f50){return _0x44a3b4['define'](_0xda62('0x9'),attributes,{'tableName':_0xda62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2834eb,_0x38fa9d,_0x8481a1){if(_0x2834eb[_0xda62('0xb')](_0xda62('0xc'))){_0x2834eb[_0xda62('0xd')]=moment()[_0xda62('0xe')](_0xda62('0xf'));}if(_0x2834eb[_0xda62('0xb')](_0xda62('0x10'))){_0x2834eb[_0xda62('0x11')]=moment()['format'](_0xda62('0xf'));}_0x8481a1(null,_0x2834eb);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 7d8ae36..b1347b8 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7814=['debug','stringify','catch','error','message','find','raw','info','ShowSquareProject','ioredis','../../mysqldb','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','where','attributes','limit','map','include','model'];(function(_0x4738b7,_0x9096f0){var _0x47cb9e=function(_0x45ee49){while(--_0x45ee49){_0x4738b7['push'](_0x4738b7['shift']());}};_0x47cb9e(++_0x9096f0);}(_0x7814,0x90));var _0x4781=function(_0x4a5205,_0x58f899){_0x4a5205=_0x4a5205-0x0;var _0x17ec60=_0x7814[_0x4a5205];return _0x17ec60;};'use strict';var _=require('lodash');var Redis=require(_0x4781('0x0'));var db=require(_0x4781('0x1'))['db'];var logger=require(_0x4781('0x2'))('rpc');var config=require('../../config/environment');config[_0x4781('0x3')]=_[_0x4781('0x4')](config[_0x4781('0x3')],{'host':_0x4781('0x5'),'port':0x18eb});var socket=require(_0x4781('0x6'))(new Redis(config[_0x4781('0x3')]));require('./squareProject.socket')[_0x4781('0x7')](socket);exports[_0x4781('0x8')]=function(_0x368f39){var _0x42bb45=this;return new Promise(function(_0x5e1ade,_0x554b97){return db[_0x4781('0x9')][_0x4781('0xa')]({'raw':_0x368f39['options']?_0x368f39[_0x4781('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x368f39[_0x4781('0xb')]?_0x368f39['options'][_0x4781('0xc')]||null:null,'attributes':_0x368f39[_0x4781('0xb')]?_0x368f39[_0x4781('0xb')][_0x4781('0xd')]||null:null,'limit':_0x368f39[_0x4781('0xb')]?_0x368f39[_0x4781('0xb')][_0x4781('0xe')]||null:null,'include':_0x368f39[_0x4781('0xb')]?_0x368f39[_0x4781('0xb')]['include']?_[_0x4781('0xf')](_0x368f39['options'][_0x4781('0x10')],function(_0xe4cfbd){return{'model':db[_0xe4cfbd[_0x4781('0x11')]],'as':_0xe4cfbd['as'],'attributes':_0xe4cfbd[_0x4781('0xd')],'include':_0xe4cfbd[_0x4781('0x10')]?_['map'](_0xe4cfbd[_0x4781('0x10')],function(_0x195447){return{'model':db[_0x195447['model']],'as':_0x195447['as'],'attributes':_0x195447['attributes'],'include':_0x195447[_0x4781('0x10')]?_[_0x4781('0xf')](_0x195447[_0x4781('0x10')],function(_0x4ae399){return{'model':db[_0x4ae399['model']],'as':_0x4ae399['as'],'attributes':_0x4ae399['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x271c4a){logger['info'](_0x4781('0x8'),_0x368f39);logger[_0x4781('0x12')]('GetSquareProjects',_0x368f39,JSON[_0x4781('0x13')](_0x271c4a));_0x5e1ade(_0x271c4a);})[_0x4781('0x14')](function(_0x487004){logger[_0x4781('0x15')](_0x4781('0x8'),_0x487004['message'],_0x368f39);_0x554b97(_0x42bb45[_0x4781('0x15')](0x1f4,_0x487004[_0x4781('0x16')]));});});};exports['ShowSquareProject']=function(_0x5addf1){var _0x55fc74=this;return new Promise(function(_0x50e9ba,_0x441dec){return db[_0x4781('0x9')][_0x4781('0x17')]({'raw':_0x5addf1[_0x4781('0xb')]?_0x5addf1[_0x4781('0xb')][_0x4781('0x18')]===undefined?!![]:![]:!![],'where':_0x5addf1[_0x4781('0xb')]?_0x5addf1['options'][_0x4781('0xc')]||null:null,'attributes':_0x5addf1['options']?_0x5addf1[_0x4781('0xb')]['attributes']||null:null,'include':_0x5addf1[_0x4781('0xb')]?_0x5addf1[_0x4781('0xb')][_0x4781('0x10')]?_[_0x4781('0xf')](_0x5addf1[_0x4781('0xb')][_0x4781('0x10')],function(_0x17e244){return{'model':db[_0x17e244[_0x4781('0x11')]],'as':_0x17e244['as'],'attributes':_0x17e244[_0x4781('0xd')],'include':_0x17e244[_0x4781('0x10')]?_[_0x4781('0xf')](_0x17e244[_0x4781('0x10')],function(_0x5a059a){return{'model':db[_0x5a059a['model']],'as':_0x5a059a['as'],'attributes':_0x5a059a[_0x4781('0xd')],'include':_0x5a059a[_0x4781('0x10')]?_['map'](_0x5a059a[_0x4781('0x10')],function(_0x33e0b9){return{'model':db[_0x33e0b9[_0x4781('0x11')]],'as':_0x33e0b9['as'],'attributes':_0x33e0b9[_0x4781('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52b990){logger[_0x4781('0x19')](_0x4781('0x1a'),_0x5addf1);logger['debug']('ShowSquareProject',_0x5addf1,JSON['stringify'](_0x52b990));_0x50e9ba(_0x52b990);})[_0x4781('0x14')](function(_0x282136){logger[_0x4781('0x15')](_0x4781('0x1a'),_0x282136[_0x4781('0x16')],_0x5addf1);_0x441dec(_0x55fc74[_0x4781('0x15')](0x1f4,_0x282136[_0x4781('0x16')]));});});}; \ No newline at end of file +var _0xdb9d=['SquareProject','findAll','options','raw','attributes','limit','include','model','map','then','info','debug','stringify','catch','message','error','where','ShowSquareProject','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects'];(function(_0x1d02eb,_0x525276){var _0x38f5eb=function(_0x1e8fa4){while(--_0x1e8fa4){_0x1d02eb['push'](_0x1d02eb['shift']());}};_0x38f5eb(++_0x525276);}(_0xdb9d,0xc6));var _0xddb9=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0xdb9d[_0x263f9d];return _0x4c4efa;};'use strict';var _=require(_0xddb9('0x0'));var Redis=require(_0xddb9('0x1'));var db=require(_0xddb9('0x2'))['db'];var logger=require(_0xddb9('0x3'))('rpc');var config=require(_0xddb9('0x4'));config[_0xddb9('0x5')]=_[_0xddb9('0x6')](config[_0xddb9('0x5')],{'host':_0xddb9('0x7'),'port':0x18eb});var socket=require(_0xddb9('0x8'))(new Redis(config[_0xddb9('0x5')]));require(_0xddb9('0x9'))[_0xddb9('0xa')](socket);exports[_0xddb9('0xb')]=function(_0x19a7ba){var _0x553b46=this;return new Promise(function(_0x136559,_0x3fcb5a){return db[_0xddb9('0xc')][_0xddb9('0xd')]({'raw':_0x19a7ba['options']?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0xf')]===undefined?!![]:![]:!![],'where':_0x19a7ba[_0xddb9('0xe')]?_0x19a7ba[_0xddb9('0xe')]['where']||null:null,'attributes':_0x19a7ba[_0xddb9('0xe')]?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x10')]||null:null,'limit':_0x19a7ba[_0xddb9('0xe')]?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x11')]||null:null,'include':_0x19a7ba['options']?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x12')]?_['map'](_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x12')],function(_0x4ae1b3){return{'model':db[_0x4ae1b3[_0xddb9('0x13')]],'as':_0x4ae1b3['as'],'attributes':_0x4ae1b3[_0xddb9('0x10')],'include':_0x4ae1b3[_0xddb9('0x12')]?_['map'](_0x4ae1b3['include'],function(_0x1d123){return{'model':db[_0x1d123['model']],'as':_0x1d123['as'],'attributes':_0x1d123[_0xddb9('0x10')],'include':_0x1d123['include']?_[_0xddb9('0x14')](_0x1d123[_0xddb9('0x12')],function(_0x487caa){return{'model':db[_0x487caa[_0xddb9('0x13')]],'as':_0x487caa['as'],'attributes':_0x487caa[_0xddb9('0x10')]};}):[]};}):[]};}):[]:[]})[_0xddb9('0x15')](function(_0x2cbeb4){logger[_0xddb9('0x16')]('GetSquareProjects',_0x19a7ba);logger[_0xddb9('0x17')](_0xddb9('0xb'),_0x19a7ba,JSON[_0xddb9('0x18')](_0x2cbeb4));_0x136559(_0x2cbeb4);})[_0xddb9('0x19')](function(_0x17d480){logger['error'](_0xddb9('0xb'),_0x17d480[_0xddb9('0x1a')],_0x19a7ba);_0x3fcb5a(_0x553b46[_0xddb9('0x1b')](0x1f4,_0x17d480['message']));});});};exports['ShowSquareProject']=function(_0x2c64b6){var _0x4e1799=this;return new Promise(function(_0x4dd3c3,_0x3d7ddf){return db[_0xddb9('0xc')]['find']({'raw':_0x2c64b6['options']?_0x2c64b6['options'][_0xddb9('0xf')]===undefined?!![]:![]:!![],'where':_0x2c64b6[_0xddb9('0xe')]?_0x2c64b6['options'][_0xddb9('0x1c')]||null:null,'attributes':_0x2c64b6['options']?_0x2c64b6[_0xddb9('0xe')][_0xddb9('0x10')]||null:null,'include':_0x2c64b6[_0xddb9('0xe')]?_0x2c64b6[_0xddb9('0xe')][_0xddb9('0x12')]?_[_0xddb9('0x14')](_0x2c64b6[_0xddb9('0xe')][_0xddb9('0x12')],function(_0x312184){return{'model':db[_0x312184['model']],'as':_0x312184['as'],'attributes':_0x312184[_0xddb9('0x10')],'include':_0x312184[_0xddb9('0x12')]?_['map'](_0x312184[_0xddb9('0x12')],function(_0x27cc1c){return{'model':db[_0x27cc1c['model']],'as':_0x27cc1c['as'],'attributes':_0x27cc1c[_0xddb9('0x10')],'include':_0x27cc1c[_0xddb9('0x12')]?_[_0xddb9('0x14')](_0x27cc1c['include'],function(_0x37ecaf){return{'model':db[_0x37ecaf['model']],'as':_0x37ecaf['as'],'attributes':_0x37ecaf[_0xddb9('0x10')]};}):[]};}):[]};}):[]:[]})[_0xddb9('0x15')](function(_0x34016c){logger['info'](_0xddb9('0x1d'),_0x2c64b6);logger[_0xddb9('0x17')](_0xddb9('0x1d'),_0x2c64b6,JSON[_0xddb9('0x18')](_0x34016c));_0x4dd3c3(_0x34016c);})[_0xddb9('0x19')](function(_0x2eb0de){logger[_0xddb9('0x1b')](_0xddb9('0x1d'),_0x2eb0de[_0xddb9('0x1a')],_0x2c64b6);_0x3d7ddf(_0x4e1799[_0xddb9('0x1b')](0x1f4,_0x2eb0de[_0xddb9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 772630a..eca72e3 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['removeListener','register','length','squareProject:','save','update'];(function(_0x49ff38,_0x274be1){var _0xda4c48=function(_0x47b59c){while(--_0x47b59c){_0x49ff38['push'](_0x49ff38['shift']());}};_0xda4c48(++_0x274be1);}(_0xb016,0xee));var _0x6b01=function(_0x469741,_0x28991d){_0x469741=_0x469741-0x0;var _0x47aa01=_0xb016[_0x469741];return _0x47aa01;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6b01('0x0'),'remove',_0x6b01('0x1')];function createListener(_0x450904,_0x4382bb){return function(_0x3d28ec){_0x4382bb['emit'](_0x450904,_0x3d28ec);};}function removeListener(_0x4886c7,_0x3954b8){return function(){SquareProjectEvents[_0x6b01('0x2')](_0x4886c7,_0x3954b8);};}exports[_0x6b01('0x3')]=function(_0x4d574e){for(var _0x41e1a5=0x0,_0x498452=events[_0x6b01('0x4')];_0x41e1a5<_0x498452;_0x41e1a5++){var _0x5bd33d=events[_0x41e1a5];var _0x2f97ae=createListener(_0x6b01('0x5')+_0x5bd33d,_0x4d574e);SquareProjectEvents['on'](_0x5bd33d,_0x2f97ae);}}; \ No newline at end of file +var _0xb688=['squareProject:','./squareProject.events','save','remove','update','emit','register','length'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xb688,0x189));var _0x8b68=function(_0x3aeac7,_0x47f064){_0x3aeac7=_0x3aeac7-0x0;var _0xb05f74=_0xb688[_0x3aeac7];return _0xb05f74;};'use strict';var SquareProjectEvents=require(_0x8b68('0x0'));var events=[_0x8b68('0x1'),_0x8b68('0x2'),_0x8b68('0x3')];function createListener(_0x4b3154,_0x30617c){return function(_0x44bb8a){_0x30617c[_0x8b68('0x4')](_0x4b3154,_0x44bb8a);};}function removeListener(_0x542c24,_0x358085){return function(){SquareProjectEvents['removeListener'](_0x542c24,_0x358085);};}exports[_0x8b68('0x5')]=function(_0x4af8e2){for(var _0x1734c1=0x0,_0x5aafe4=events[_0x8b68('0x6')];_0x1734c1<_0x5aafe4;_0x1734c1++){var _0x5e1740=events[_0x1734c1];var _0x20234b=createListener(_0x8b68('0x7')+_0x5e1740,_0x4af8e2);SquareProjectEvents['on'](_0x5e1740,_0x20234b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index af392e1..c56c5e2 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0xc2dfff,_0x5e5a6f){var _0x52a91d=function(_0x4d7add){while(--_0x4d7add){_0xc2dfff['push'](_0xc2dfff['shift']());}};_0x52a91d(++_0x5e5a6f);}(_0x4975,0x86));var _0x5497=function(_0x30a321,_0x28c260){_0x30a321=_0x30a321-0x0;var _0x237514=_0x4975[_0x30a321];return _0x237514;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x44ffdc,_0x4c06d0){var _0x83816a=function(_0x243d48){while(--_0x243d48){_0x44ffdc['push'](_0x44ffdc['shift']());}};_0x83816a(++_0x4c06d0);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 11670ae..cb7d5ad 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x1a16e9,_0x3fb049){var _0x23f010=function(_0x483191){while(--_0x483191){_0x1a16e9['push'](_0x1a16e9['shift']());}};_0x23f010(++_0x3fb049);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7995('0x2')]},'extension':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7995('0x2')]},'saveName':{'type':Sequelize[_0x7995('0x2')]},'filename':{'type':Sequelize[_0x7995('0x2')]},'savePath':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize[_0x7995('0x3')],'get':function(){var _0x326741='';var _0x4996ca=this[_0x7995('0x4')](_0x7995('0x5'));if(_0x4996ca){_0x326741=_0x4996ca['substring'](_0x4996ca[_0x7995('0x6')]('.'));}return _0x326741;}}}; \ No newline at end of file +var _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0x17430e,_0x2b33be){var _0x233b23=function(_0x22cad5){while(--_0x22cad5){_0x17430e['push'](_0x17430e['shift']());}};_0x233b23(++_0x2b33be);}(_0xae24,0x182));var _0x4ae2=function(_0x43d71c,_0x525e5d){_0x43d71c=_0x43d71c-0x0;var _0x5453f5=_0xae24[_0x43d71c];return _0x5453f5;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4ae2('0x1')]},'context':{'type':Sequelize[_0x4ae2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ae2('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4ae2('0x1')]},'saveName':{'type':Sequelize[_0x4ae2('0x1')]},'filename':{'type':Sequelize[_0x4ae2('0x1')]},'savePath':{'type':Sequelize[_0x4ae2('0x1')]},'format':{'type':Sequelize[_0x4ae2('0x2')],'get':function(){var _0x307247='';var _0x4f2e84=this['getDataValue'](_0x4ae2('0x3'));if(_0x4f2e84){_0x307247=_0x4f2e84['substring'](_0x4f2e84['lastIndexOf']('.'));}return _0x307247;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 69248cc..7aa98f9 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe99a=['SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','Content-Range','update','then','sendStatus','stack','name','send','index','map','SquareRecording','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','options','find','catch','body','../../components/encryptor','type','uniqueid','params','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError'];(function(_0x51badd,_0x59b76c){var _0x16e30f=function(_0x457a45){while(--_0x457a45){_0x51badd['push'](_0x51badd['shift']());}};_0x16e30f(++_0x59b76c);}(_0xe99a,0x68));var _0xae99=function(_0x3f9c0a,_0x357d5e){_0x3f9c0a=_0x3f9c0a-0x0;var _0x5df8b2=_0xe99a[_0x3f9c0a];return _0x5df8b2;};'use strict';var emlformat=require(_0xae99('0x0'));var rimraf=require(_0xae99('0x1'));var zipdir=require(_0xae99('0x2'));var jsonpatch=require(_0xae99('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xae99('0x4'));var Mustache=require('mustache');var util=require(_0xae99('0x5'));var path=require(_0xae99('0x6'));var sox=require('sox');var csv=require(_0xae99('0x7'));var ejs=require(_0xae99('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae99('0x9'));var squel=require(_0xae99('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xae99('0xb'));var toCsv=require(_0xae99('0x7'));var querystring=require('querystring');var Papa=require(_0xae99('0xc'));var Redis=require(_0xae99('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xae99('0xe'));var as=require(_0xae99('0xf'));var hardwareService=require(_0xae99('0x10'));var logger=require(_0xae99('0x11'))(_0xae99('0x12'));var utils=require('../../config/utils');var config=require(_0xae99('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xae99('0x14'))['db'];function respondWithStatusCode(_0x34b242,_0x3d8727){_0x3d8727=_0x3d8727||0xcc;return function(_0x4b4332){if(_0x4b4332){return _0x34b242['sendStatus'](_0x3d8727);}return _0x34b242['status'](_0x3d8727)[_0xae99('0x15')]();};}function respondWithResult(_0x572900,_0x137778){_0x137778=_0x137778||0xc8;return function(_0x11d8d7){if(_0x11d8d7){return _0x572900[_0xae99('0x16')](_0x137778)[_0xae99('0x17')](_0x11d8d7);}};}function respondWithFilteredResult(_0x146a77,_0x8c59dc){return function(_0x36199e){if(_0x36199e){var _0x3f3068=typeof _0x8c59dc[_0xae99('0x18')]==='undefined'&&typeof _0x8c59dc[_0xae99('0x19')]===_0xae99('0x1a');var _0x183dfb=_0x36199e[_0xae99('0x1b')];var _0x1e7f19=_0x3f3068?0x0:_0x8c59dc['offset'];var _0x29ddf9=_0x3f3068?_0x36199e[_0xae99('0x1b')]:_0x8c59dc[_0xae99('0x18')]+_0x8c59dc['limit'];var _0x2d80e5;if(_0x29ddf9>=_0x183dfb){_0x29ddf9=_0x183dfb;_0x2d80e5=0xc8;}else{_0x2d80e5=0xce;}_0x146a77[_0xae99('0x16')](_0x2d80e5);return _0x146a77['set'](_0xae99('0x1c'),_0x1e7f19+'-'+_0x29ddf9+'/'+_0x183dfb)[_0xae99('0x17')](_0x36199e);}return null;};}function patchUpdates(_0x495ad3){return function(_0x2b5811){try{jsonpatch['apply'](_0x2b5811,_0x495ad3,!![]);}catch(_0x596275){return BPromise['reject'](_0x596275);}return _0x2b5811['save']();};}function saveUpdates(_0xb041af,_0x31e7ac){return function(_0x5ba404){if(_0x5ba404){return _0x5ba404[_0xae99('0x1d')](_0xb041af)[_0xae99('0x1e')](function(_0x2ef1bd){return _0x2ef1bd;});}return null;};}function removeEntity(_0x40c08b,_0x584fb5){return function(_0x25df53){if(_0x25df53){return _0x25df53['destroy']()[_0xae99('0x1e')](function(){_0x40c08b[_0xae99('0x16')](0xcc)[_0xae99('0x15')]();});}};}function handleEntityNotFound(_0xb1766a,_0x2e0e9e){return function(_0x12c2f0){if(!_0x12c2f0){_0xb1766a[_0xae99('0x1f')](0x194);}return _0x12c2f0;};}function handleError(_0x36e80a,_0xbc79de){_0xbc79de=_0xbc79de||0x1f4;return function(_0x10986e){logger['error'](_0x10986e[_0xae99('0x20')]);if(_0x10986e[_0xae99('0x21')]){delete _0x10986e['name'];}_0x36e80a[_0xae99('0x16')](_0xbc79de)[_0xae99('0x22')](_0x10986e);};}exports[_0xae99('0x23')]=function(_0x121979,_0x4c9ca4){var _0x533550={},_0x35b1a1={},_0x5234fd={'count':0x0,'rows':[]};var _0x1c6991=_[_0xae99('0x24')](db[_0xae99('0x25')]['rawAttributes'],function(_0x4144e3){return{'name':_0x4144e3['fieldName'],'type':_0x4144e3['type'][_0xae99('0x26')]};});_0x35b1a1[_0xae99('0x27')]=_[_0xae99('0x24')](_0x1c6991,'name');_0x35b1a1[_0xae99('0x28')]=_['keys'](_0x121979['query']);_0x35b1a1['filters']=_[_0xae99('0x29')](_0x35b1a1[_0xae99('0x27')],_0x35b1a1[_0xae99('0x28')]);_0x533550['attributes']=_[_0xae99('0x29')](_0x35b1a1['model'],qs['fields'](_0x121979[_0xae99('0x28')][_0xae99('0x2a')]));_0x533550['attributes']=_0x533550['attributes'][_0xae99('0x2b')]?_0x533550[_0xae99('0x2c')]:_0x35b1a1[_0xae99('0x27')];if(!_0x121979[_0xae99('0x28')][_0xae99('0x2d')](_0xae99('0x2e'))){_0x533550[_0xae99('0x19')]=qs[_0xae99('0x19')](_0x121979['query'][_0xae99('0x19')]);_0x533550[_0xae99('0x18')]=qs['offset'](_0x121979[_0xae99('0x28')]['offset']);}_0x533550['order']=qs['sort'](_0x121979['query']['sort']);_0x533550['where']=qs[_0xae99('0x2f')](_[_0xae99('0x30')](_0x121979[_0xae99('0x28')],_0x35b1a1[_0xae99('0x2f')]),_0x1c6991);if(_0x121979[_0xae99('0x28')][_0xae99('0x31')]){_0x533550[_0xae99('0x32')]=_[_0xae99('0x33')](_0x533550['where'],{'$or':_[_0xae99('0x24')](_0x1c6991,function(_0x47fc14){if(_0x47fc14['type']!==_0xae99('0x34')){var _0x306b60={};_0x306b60[_0x47fc14[_0xae99('0x21')]]={'$like':'%'+_0x121979['query'][_0xae99('0x31')]+'%'};return _0x306b60;}})});}_0x533550=_[_0xae99('0x33')]({},_0x533550,_0x121979['options']);var _0x210666={'where':_0x533550['where']};return db[_0xae99('0x25')][_0xae99('0x1b')](_0x210666)[_0xae99('0x1e')](function(_0x217243){_0x5234fd['count']=_0x217243;if(_0x121979[_0xae99('0x28')][_0xae99('0x35')]){_0x533550[_0xae99('0x36')]=[{'all':!![]}];}return db[_0xae99('0x25')][_0xae99('0x37')](_0x533550);})[_0xae99('0x1e')](function(_0x345c09){_0x5234fd[_0xae99('0x38')]=_0x345c09;return _0x5234fd;})[_0xae99('0x1e')](respondWithFilteredResult(_0x4c9ca4,_0x533550))['catch'](handleError(_0x4c9ca4,null));};exports[_0xae99('0x39')]=function(_0x50c2bb,_0x2a83e0){var _0x30eed1={'raw':!![],'where':{'id':_0x50c2bb['params']['id']}},_0x2b017={};_0x2b017[_0xae99('0x27')]=_[_0xae99('0x3a')](db[_0xae99('0x25')]['rawAttributes']);_0x2b017[_0xae99('0x28')]=_['keys'](_0x50c2bb[_0xae99('0x28')]);_0x2b017[_0xae99('0x2f')]=_[_0xae99('0x29')](_0x2b017[_0xae99('0x27')],_0x2b017['query']);_0x30eed1[_0xae99('0x2c')]=_[_0xae99('0x29')](_0x2b017[_0xae99('0x27')],qs['fields'](_0x50c2bb[_0xae99('0x28')][_0xae99('0x2a')]));_0x30eed1[_0xae99('0x2c')]=_0x30eed1[_0xae99('0x2c')]['length']?_0x30eed1[_0xae99('0x2c')]:_0x2b017['model'];if(_0x50c2bb['query']['includeAll']){_0x30eed1[_0xae99('0x36')]=[{'all':!![]}];}_0x30eed1=_[_0xae99('0x33')]({},_0x30eed1,_0x50c2bb[_0xae99('0x3b')]);return db['SquareRecording'][_0xae99('0x3c')](_0x30eed1)[_0xae99('0x1e')](handleEntityNotFound(_0x2a83e0,null))[_0xae99('0x1e')](respondWithResult(_0x2a83e0,null))[_0xae99('0x3d')](handleError(_0x2a83e0,null));};exports['create']=function(_0x909c43,_0x2e4b07){return db[_0xae99('0x25')]['create'](_0x909c43[_0xae99('0x3e')],{})[_0xae99('0x1e')](respondWithResult(_0x2e4b07,0xc9))[_0xae99('0x3d')](handleError(_0x2e4b07,null));};exports[_0xae99('0x1d')]=function(_0x270537,_0x1aaa3b){if(_0x270537[_0xae99('0x3e')]['id']){delete _0x270537[_0xae99('0x3e')]['id'];}return db['SquareRecording'][_0xae99('0x3c')]({'where':{'id':_0x270537['params']['id']}})[_0xae99('0x1e')](handleEntityNotFound(_0x1aaa3b,null))[_0xae99('0x1e')](saveUpdates(_0x270537['body'],null))['then'](respondWithResult(_0x1aaa3b,null))[_0xae99('0x3d')](handleError(_0x1aaa3b,null));};exports['download']=function(_0x6d932e,_0x34a106,_0x1f7c5d){var _0x2db5b5=require(_0xae99('0x3f'));var _0x18230d=![];var _0x5b4cdc={};if(_0x6d932e[_0xae99('0x28')]['type']&&_0x6d932e[_0xae99('0x28')][_0xae99('0x40')]===_0xae99('0x41')){_0x5b4cdc['uniqueid']=_0x6d932e[_0xae99('0x42')]['id'];}else{_0x5b4cdc['id']=_0x6d932e[_0xae99('0x42')]['id'];}return db['SquareRecording'][_0xae99('0x3c')]({'where':_0x5b4cdc,'attributes':['id',_0xae99('0x43'),_0xae99('0x44')],'raw':!![]})[_0xae99('0x1e')](handleEntityNotFound(_0x34a106,null))['then'](function(_0x58df2e){if(_0x58df2e){var _0x5b8250=_0x58df2e[_0xae99('0x43')];var _0x317c65=util[_0xae99('0x45')](_0xae99('0x46'),_0x5b8250);if(fs[_0xae99('0x47')](_0x317c65)){_0x18230d=!![];return _0x2db5b5[_0xae99('0x48')](_0x317c65,_0x5b8250,config[_0xae99('0x49')]['recording'])[_0xae99('0x1e')](function(){return _0x58df2e;});}return _0x58df2e;}})[_0xae99('0x1e')](function(_0x29e83c){if(_0x29e83c){var _0x2d82b0=_0x29e83c['savePath'];if(!fs['existsSync'](_0x2d82b0)){throw new db[(_0xae99('0x4a'))][(_0xae99('0x4b'))](_0xae99('0x4c'));}if(_0x29e83c[_0xae99('0x44')]){return _0x34a106[_0xae99('0x4d')](_0x2d82b0,_0x29e83c[_0xae99('0x44')]+path[_0xae99('0x4e')](_0x2d82b0),function(){if(_0x18230d){fs['unlink'](_0x2d82b0);}});}else{return _0x34a106[_0xae99('0x4d')](_0x2d82b0,function(_0x20aa19){if(_0x18230d){fs[_0xae99('0x4f')](_0x2d82b0);}});}}})[_0xae99('0x3d')](function(_0x4907a2){if(_0x4907a2[_0xae99('0x50')]==='SquareRecording\x20not\x20found'){_0x34a106[_0xae99('0x16')](0x194)[_0xae99('0x22')](_0xae99('0x51'));}else{return handleError(_0x34a106,null);}});};exports['destroy']=function(_0x594e55,_0x17e088){return db['SquareRecording']['find']({'where':{'id':_0x594e55[_0xae99('0x42')]['id']}})[_0xae99('0x1e')](function(_0x3f37d8){if(_[_0xae99('0x52')](_0x3f37d8)){throw new ReferenceError(_0xae99('0x53'));}return _0x3f37d8;})[_0xae99('0x1e')](function(_0x5d6f2d){var _0x30901a=_0x5d6f2d[_0xae99('0x43')];logger[_0xae99('0x54')](_0xae99('0x55'),_0x30901a);if(!_[_0xae99('0x52')](_0x5d6f2d[_0xae99('0x43')])&&fs['existsSync'](_0x30901a)){logger[_0xae99('0x54')](_0xae99('0x56')+_0x30901a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x30901a);}_0x30901a=_0x30901a+_0xae99('0x57');if(!_[_0xae99('0x52')](_0x5d6f2d[_0xae99('0x43')])&&fs['existsSync'](_0x30901a)){logger[_0xae99('0x54')](_0xae99('0x56')+_0x30901a+_0xae99('0x58'));fs['unlinkSync'](_0x30901a);}return _0x5d6f2d;})[_0xae99('0x1e')](function(_0x1701d0){if(!_0x1701d0)throw new InternalError();return _0x1701d0[_0xae99('0x59')]();})['then'](function(){_0x17e088[_0xae99('0x16')](0xcc)[_0xae99('0x15')]();})[_0xae99('0x3d')](handleError(_0x17e088,null));}; \ No newline at end of file +var _0x9a5e=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','SquareRecording','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','eml-format','rimraf'];(function(_0x23e2a2,_0x7e7cab){var _0x576a76=function(_0xae4462){while(--_0xae4462){_0x23e2a2['push'](_0x23e2a2['shift']());}};_0x576a76(++_0x7e7cab);}(_0x9a5e,0x69));var _0xe9a5=function(_0x2a139d,_0x12784a){_0x2a139d=_0x2a139d-0x0;var _0x41699a=_0x9a5e[_0x2a139d];return _0x41699a;};'use strict';var emlformat=require(_0xe9a5('0x0'));var rimraf=require(_0xe9a5('0x1'));var zipdir=require(_0xe9a5('0x2'));var jsonpatch=require(_0xe9a5('0x3'));var rp=require('request-promise');var moment=require(_0xe9a5('0x4'));var BPromise=require(_0xe9a5('0x5'));var Mustache=require(_0xe9a5('0x6'));var util=require(_0xe9a5('0x7'));var path=require(_0xe9a5('0x8'));var sox=require(_0xe9a5('0x9'));var csv=require(_0xe9a5('0xa'));var ejs=require(_0xe9a5('0xb'));var fs=require('fs');var fs_extra=require(_0xe9a5('0xc'));var _=require(_0xe9a5('0xd'));var squel=require(_0xe9a5('0xe'));var crypto=require(_0xe9a5('0xf'));var jsforce=require(_0xe9a5('0x10'));var deskjs=require(_0xe9a5('0x11'));var toCsv=require(_0xe9a5('0xa'));var querystring=require(_0xe9a5('0x12'));var Papa=require(_0xe9a5('0x13'));var Redis=require(_0xe9a5('0x14'));var authService=require(_0xe9a5('0x15'));var qs=require(_0xe9a5('0x16'));var as=require(_0xe9a5('0x17'));var hardwareService=require(_0xe9a5('0x18'));var logger=require(_0xe9a5('0x19'))('api');var utils=require(_0xe9a5('0x1a'));var config=require(_0xe9a5('0x1b'));var licenseUtil=require(_0xe9a5('0x1c'));var db=require(_0xe9a5('0x1d'))['db'];function respondWithStatusCode(_0x3e8d4c,_0x5ef5f0){_0x5ef5f0=_0x5ef5f0||0xcc;return function(_0x862553){if(_0x862553){return _0x3e8d4c[_0xe9a5('0x1e')](_0x5ef5f0);}return _0x3e8d4c[_0xe9a5('0x1f')](_0x5ef5f0)[_0xe9a5('0x20')]();};}function respondWithResult(_0x24e0e2,_0x40b80d){_0x40b80d=_0x40b80d||0xc8;return function(_0x3a81da){if(_0x3a81da){return _0x24e0e2[_0xe9a5('0x1f')](_0x40b80d)[_0xe9a5('0x21')](_0x3a81da);}};}function respondWithFilteredResult(_0x21c409,_0x1866e2){return function(_0x1fb46a){if(_0x1fb46a){var _0x5df58e=typeof _0x1866e2[_0xe9a5('0x22')]===_0xe9a5('0x23')&&typeof _0x1866e2[_0xe9a5('0x24')]===_0xe9a5('0x23');var _0x7c05a2=_0x1fb46a['count'];var _0xe08029=_0x5df58e?0x0:_0x1866e2[_0xe9a5('0x22')];var _0x3c2cb4=_0x5df58e?_0x1fb46a[_0xe9a5('0x25')]:_0x1866e2[_0xe9a5('0x22')]+_0x1866e2[_0xe9a5('0x24')];var _0xa018be;if(_0x3c2cb4>=_0x7c05a2){_0x3c2cb4=_0x7c05a2;_0xa018be=0xc8;}else{_0xa018be=0xce;}_0x21c409[_0xe9a5('0x1f')](_0xa018be);return _0x21c409[_0xe9a5('0x26')]('Content-Range',_0xe08029+'-'+_0x3c2cb4+'/'+_0x7c05a2)[_0xe9a5('0x21')](_0x1fb46a);}return null;};}function patchUpdates(_0x41a7f9){return function(_0x3cd20f){try{jsonpatch[_0xe9a5('0x27')](_0x3cd20f,_0x41a7f9,!![]);}catch(_0x115469){return BPromise[_0xe9a5('0x28')](_0x115469);}return _0x3cd20f[_0xe9a5('0x29')]();};}function saveUpdates(_0x4c3f03,_0x3e89fd){return function(_0x4886d2){if(_0x4886d2){return _0x4886d2['update'](_0x4c3f03)[_0xe9a5('0x2a')](function(_0x34b02e){return _0x34b02e;});}return null;};}function removeEntity(_0x3904dc,_0x1db8f1){return function(_0x504bcf){if(_0x504bcf){return _0x504bcf['destroy']()[_0xe9a5('0x2a')](function(){_0x3904dc[_0xe9a5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8b32,_0x178dd2){return function(_0x1a5475){if(!_0x1a5475){_0x4e8b32[_0xe9a5('0x1e')](0x194);}return _0x1a5475;};}function handleError(_0x3c5ac6,_0x2fe4c6){_0x2fe4c6=_0x2fe4c6||0x1f4;return function(_0x3c21d9){logger[_0xe9a5('0x2b')](_0x3c21d9[_0xe9a5('0x2c')]);if(_0x3c21d9[_0xe9a5('0x2d')]){delete _0x3c21d9[_0xe9a5('0x2d')];}_0x3c5ac6['status'](_0x2fe4c6)[_0xe9a5('0x2e')](_0x3c21d9);};}exports[_0xe9a5('0x2f')]=function(_0x330c1f,_0x3cfa14){var _0x2a6ec4={},_0x3508c9={},_0x315c28={'count':0x0,'rows':[]};var _0x3aff42=_[_0xe9a5('0x30')](db[_0xe9a5('0x31')]['rawAttributes'],function(_0x4cb0bb){return{'name':_0x4cb0bb[_0xe9a5('0x32')],'type':_0x4cb0bb['type'][_0xe9a5('0x33')]};});_0x3508c9[_0xe9a5('0x34')]=_[_0xe9a5('0x30')](_0x3aff42,_0xe9a5('0x2d'));_0x3508c9[_0xe9a5('0x35')]=_[_0xe9a5('0x36')](_0x330c1f[_0xe9a5('0x35')]);_0x3508c9['filters']=_[_0xe9a5('0x37')](_0x3508c9[_0xe9a5('0x34')],_0x3508c9[_0xe9a5('0x35')]);_0x2a6ec4[_0xe9a5('0x38')]=_[_0xe9a5('0x37')](_0x3508c9['model'],qs[_0xe9a5('0x39')](_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x39')]));_0x2a6ec4['attributes']=_0x2a6ec4[_0xe9a5('0x38')][_0xe9a5('0x3a')]?_0x2a6ec4[_0xe9a5('0x38')]:_0x3508c9[_0xe9a5('0x34')];if(!_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x3b')]('nolimit')){_0x2a6ec4[_0xe9a5('0x24')]=qs[_0xe9a5('0x24')](_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x24')]);_0x2a6ec4[_0xe9a5('0x22')]=qs['offset'](_0x330c1f[_0xe9a5('0x35')]['offset']);}_0x2a6ec4[_0xe9a5('0x3c')]=qs[_0xe9a5('0x3d')](_0x330c1f['query'][_0xe9a5('0x3d')]);_0x2a6ec4['where']=qs[_0xe9a5('0x3e')](_[_0xe9a5('0x3f')](_0x330c1f['query'],_0x3508c9['filters']),_0x3aff42);if(_0x330c1f['query'][_0xe9a5('0x40')]){_0x2a6ec4[_0xe9a5('0x41')]=_[_0xe9a5('0x42')](_0x2a6ec4[_0xe9a5('0x41')],{'$or':_[_0xe9a5('0x30')](_0x3aff42,function(_0x116b2f){if(_0x116b2f[_0xe9a5('0x43')]!==_0xe9a5('0x44')){var _0x5d9289={};_0x5d9289[_0x116b2f['name']]={'$like':'%'+_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x40')]+'%'};return _0x5d9289;}})});}_0x2a6ec4=_[_0xe9a5('0x42')]({},_0x2a6ec4,_0x330c1f[_0xe9a5('0x45')]);var _0x1d2c0b={'where':_0x2a6ec4[_0xe9a5('0x41')]};return db['SquareRecording'][_0xe9a5('0x25')](_0x1d2c0b)['then'](function(_0x56648f){_0x315c28[_0xe9a5('0x25')]=_0x56648f;if(_0x330c1f['query']['includeAll']){_0x2a6ec4[_0xe9a5('0x46')]=[{'all':!![]}];}return db['SquareRecording'][_0xe9a5('0x47')](_0x2a6ec4);})[_0xe9a5('0x2a')](function(_0x2d20a5){_0x315c28[_0xe9a5('0x48')]=_0x2d20a5;return _0x315c28;})[_0xe9a5('0x2a')](respondWithFilteredResult(_0x3cfa14,_0x2a6ec4))[_0xe9a5('0x49')](handleError(_0x3cfa14,null));};exports[_0xe9a5('0x4a')]=function(_0x49e65c,_0x317739){var _0x3fa8a0={'raw':!![],'where':{'id':_0x49e65c[_0xe9a5('0x4b')]['id']}},_0x3ba99a={};_0x3ba99a[_0xe9a5('0x34')]=_['keys'](db['SquareRecording']['rawAttributes']);_0x3ba99a[_0xe9a5('0x35')]=_['keys'](_0x49e65c['query']);_0x3ba99a[_0xe9a5('0x3e')]=_[_0xe9a5('0x37')](_0x3ba99a[_0xe9a5('0x34')],_0x3ba99a[_0xe9a5('0x35')]);_0x3fa8a0[_0xe9a5('0x38')]=_[_0xe9a5('0x37')](_0x3ba99a[_0xe9a5('0x34')],qs[_0xe9a5('0x39')](_0x49e65c[_0xe9a5('0x35')]['fields']));_0x3fa8a0['attributes']=_0x3fa8a0[_0xe9a5('0x38')]['length']?_0x3fa8a0['attributes']:_0x3ba99a[_0xe9a5('0x34')];if(_0x49e65c['query'][_0xe9a5('0x4c')]){_0x3fa8a0[_0xe9a5('0x46')]=[{'all':!![]}];}_0x3fa8a0=_[_0xe9a5('0x42')]({},_0x3fa8a0,_0x49e65c[_0xe9a5('0x45')]);return db['SquareRecording'][_0xe9a5('0x4d')](_0x3fa8a0)[_0xe9a5('0x2a')](handleEntityNotFound(_0x317739,null))[_0xe9a5('0x2a')](respondWithResult(_0x317739,null))[_0xe9a5('0x49')](handleError(_0x317739,null));};exports['create']=function(_0x247591,_0xdef587){return db[_0xe9a5('0x31')][_0xe9a5('0x4e')](_0x247591['body'],{})[_0xe9a5('0x2a')](respondWithResult(_0xdef587,0xc9))[_0xe9a5('0x49')](handleError(_0xdef587,null));};exports[_0xe9a5('0x4f')]=function(_0x347cc4,_0x6d2bf2){if(_0x347cc4['body']['id']){delete _0x347cc4['body']['id'];}return db[_0xe9a5('0x31')][_0xe9a5('0x4d')]({'where':{'id':_0x347cc4[_0xe9a5('0x4b')]['id']}})[_0xe9a5('0x2a')](handleEntityNotFound(_0x6d2bf2,null))[_0xe9a5('0x2a')](saveUpdates(_0x347cc4[_0xe9a5('0x50')],null))[_0xe9a5('0x2a')](respondWithResult(_0x6d2bf2,null))[_0xe9a5('0x49')](handleError(_0x6d2bf2,null));};exports[_0xe9a5('0x51')]=function(_0xd1b6af,_0x1dfc04,_0x4f4d64){var _0x50a913=require(_0xe9a5('0x52'));var _0x4d22d2=![];var _0x4ac32c={};if(_0xd1b6af['query'][_0xe9a5('0x43')]&&_0xd1b6af[_0xe9a5('0x35')][_0xe9a5('0x43')]===_0xe9a5('0x53')){_0x4ac32c[_0xe9a5('0x53')]=_0xd1b6af[_0xe9a5('0x4b')]['id'];}else{_0x4ac32c['id']=_0xd1b6af[_0xe9a5('0x4b')]['id'];}return db['SquareRecording'][_0xe9a5('0x4d')]({'where':_0x4ac32c,'attributes':['id',_0xe9a5('0x54'),_0xe9a5('0x55')],'raw':!![]})[_0xe9a5('0x2a')](handleEntityNotFound(_0x1dfc04,null))['then'](function(_0x13402a){if(_0x13402a){var _0x242b3e=_0x13402a[_0xe9a5('0x54')];var _0x6ab895=util[_0xe9a5('0x56')](_0xe9a5('0x57'),_0x242b3e);if(fs['existsSync'](_0x6ab895)){_0x4d22d2=!![];return _0x50a913[_0xe9a5('0x58')](_0x6ab895,_0x242b3e,config[_0xe9a5('0x59')][_0xe9a5('0x5a')])[_0xe9a5('0x2a')](function(){return _0x13402a;});}return _0x13402a;}})[_0xe9a5('0x2a')](function(_0x585162){if(_0x585162){var _0x5635d3=_0x585162['savePath'];if(!fs[_0xe9a5('0x5b')](_0x5635d3)){throw new db[(_0xe9a5('0x5c'))][(_0xe9a5('0x5d'))](_0xe9a5('0x5e'));}if(_0x585162[_0xe9a5('0x55')]){return _0x1dfc04['download'](_0x5635d3,_0x585162[_0xe9a5('0x55')]+path[_0xe9a5('0x5f')](_0x5635d3),function(){if(_0x4d22d2){fs[_0xe9a5('0x60')](_0x5635d3);}});}else{return _0x1dfc04[_0xe9a5('0x51')](_0x5635d3,function(_0x27ad95){if(_0x4d22d2){fs[_0xe9a5('0x60')](_0x5635d3);}});}}})['catch'](function(_0xecd94f){if(_0xecd94f['message']===_0xe9a5('0x5e')){_0x1dfc04[_0xe9a5('0x1f')](0x194)[_0xe9a5('0x2e')](_0xe9a5('0x61'));}else{return handleError(_0x1dfc04,null);}});};exports['destroy']=function(_0x18f22a,_0x4cca96){return db[_0xe9a5('0x31')][_0xe9a5('0x4d')]({'where':{'id':_0x18f22a[_0xe9a5('0x4b')]['id']}})[_0xe9a5('0x2a')](function(_0x35d97a){if(_['isNil'](_0x35d97a)){throw new ReferenceError(_0xe9a5('0x62'));}return _0x35d97a;})['then'](function(_0x34c680){var _0x43e5b9=_0x34c680[_0xe9a5('0x54')];logger[_0xe9a5('0x63')](_0xe9a5('0x64'),_0x43e5b9);if(!_[_0xe9a5('0x65')](_0x34c680['savePath'])&&fs[_0xe9a5('0x5b')](_0x43e5b9)){logger['info'](_0xe9a5('0x66')+_0x43e5b9+_0xe9a5('0x67'));fs[_0xe9a5('0x68')](_0x43e5b9);}_0x43e5b9=_0x43e5b9+_0xe9a5('0x69');if(!_['isNil'](_0x34c680[_0xe9a5('0x54')])&&fs[_0xe9a5('0x5b')](_0x43e5b9)){logger[_0xe9a5('0x63')](_0xe9a5('0x66')+_0x43e5b9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe9a5('0x68')](_0x43e5b9);}return _0x34c680;})[_0xe9a5('0x2a')](function(_0x42d8ec){if(!_0x42d8ec)throw new InternalError();return _0x42d8ec[_0xe9a5('0x6a')]();})[_0xe9a5('0x2a')](function(){_0x4cca96[_0xe9a5('0x1f')](0xcc)['end']();})[_0xe9a5('0x49')](handleError(_0x4cca96,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 06a9fab..9733094 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27a0=['define','SquareRecording','util','../../config/logger','api','moment','bluebird','./squareRecording.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x27a0,0xbf));var _0x027a=function(_0x432ff5,_0x4b03d1){_0x432ff5=_0x432ff5-0x0;var _0x38d145=_0x27a0[_0x432ff5];return _0x38d145;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('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(_0x027a('0x5'));module[_0x027a('0x6')]=function(_0x137b09,_0x639bec){return _0x137b09[_0x027a('0x7')](_0x027a('0x8'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaee6=['square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SquareRecording'];(function(_0x5303fe,_0x4a1a8d){var _0xa3222=function(_0x1858ae){while(--_0x1858ae){_0x5303fe['push'](_0x5303fe['shift']());}};_0xa3222(++_0x4a1a8d);}(_0xaee6,0x187));var _0x6aee=function(_0x414d66,_0x27d2f1){_0x414d66=_0x414d66-0x0;var _0x34617f=_0xaee6[_0x414d66];return _0x34617f;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var logger=require(_0x6aee('0x2'))(_0x6aee('0x3'));var moment=require(_0x6aee('0x4'));var BPromise=require(_0x6aee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aee('0x6'));var rimraf=require(_0x6aee('0x7'));var config=require(_0x6aee('0x8'));var attributes=require('./squareRecording.attributes');module[_0x6aee('0x9')]=function(_0x377d0b,_0x2eec1b){return _0x377d0b[_0x6aee('0xa')](_0x6aee('0xb'),attributes,{'tableName':_0x6aee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 60f59c7..5bc1713 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe52f=['info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5efb3c,_0x852a5a){var _0x349be3=function(_0x44b9de){while(--_0x44b9de){_0x5efb3c['push'](_0x5efb3c['shift']());}};_0x349be3(++_0x852a5a);}(_0xe52f,0x16c));var _0xfe52=function(_0x1299b1,_0xd402d8){_0x1299b1=_0x1299b1-0x0;var _0x551943=_0xe52f[_0x1299b1];return _0x551943;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe52('0x0'));var BPromise=require(_0xfe52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe52('0x2'));var db=require(_0xfe52('0x3'))['db'];var utils=require(_0xfe52('0x4'));var logger=require(_0xfe52('0x5'))(_0xfe52('0x6'));var config=require(_0xfe52('0x7'));var jayson=require(_0xfe52('0x8'));var client=jayson[_0xfe52('0x9')][_0xfe52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc71f4,_0x19e89b,_0x26436a){return new BPromise(function(_0x18dd0d,_0x2f560b){return client[_0xfe52('0xb')](_0xfc71f4,_0x26436a)[_0xfe52('0xc')](function(_0x1771e8){logger[_0xfe52('0xd')](_0xfe52('0xe'),_0x19e89b,_0xfe52('0xf'));logger[_0xfe52('0x10')](_0xfe52('0x11'),_0x19e89b,_0xfe52('0xf'),JSON[_0xfe52('0x12')](_0x1771e8));if(_0x1771e8[_0xfe52('0x13')]){if(_0x1771e8['error'][_0xfe52('0x14')]===0x1f4){logger[_0xfe52('0x13')](_0xfe52('0xe'),_0x19e89b,_0x1771e8[_0xfe52('0x13')][_0xfe52('0x15')]);return _0x2f560b(_0x1771e8[_0xfe52('0x13')][_0xfe52('0x15')]);}logger['error'](_0xfe52('0xe'),_0x19e89b,_0x1771e8[_0xfe52('0x13')][_0xfe52('0x15')]);return _0x18dd0d(_0x1771e8[_0xfe52('0x13')][_0xfe52('0x15')]);}else{logger['info'](_0xfe52('0xe'),_0x19e89b,_0xfe52('0xf'));_0x18dd0d(_0x1771e8['result']['message']);}})[_0xfe52('0x16')](function(_0x5a8cfc){logger['error'](_0xfe52('0xe'),_0x19e89b,_0x5a8cfc);_0x2f560b(_0x5a8cfc);});});}exports[_0xfe52('0x17')]=function(_0x568b56){var _0x18ffcd=this;return new Promise(function(_0x1f4d43,_0x62ab95){return db[_0xfe52('0x18')][_0xfe52('0x19')](_0x568b56[_0xfe52('0x1a')],{'raw':_0x568b56[_0xfe52('0x1b')]?_0x568b56[_0xfe52('0x1b')][_0xfe52('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x40bfea){logger[_0xfe52('0xd')](_0xfe52('0x17'),_0x568b56);logger['debug'](_0xfe52('0x17'),_0x568b56,JSON['stringify'](_0x40bfea));_0x1f4d43(_0x40bfea);})[_0xfe52('0x16')](function(_0x14524b){logger[_0xfe52('0x13')]('CreateSquareRecording',_0x14524b[_0xfe52('0x15')],_0x568b56);_0x62ab95(_0x18ffcd[_0xfe52('0x13')](0x1f4,_0x14524b[_0xfe52('0x15')]));});});}; \ No newline at end of file +var _0xbf92=['code','error','SquareRecording,\x20%s,\x20%s','message','info','result','catch','create','options','raw','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4dfd10,_0x3169d5){var _0x267950=function(_0x15b4ae){while(--_0x15b4ae){_0x4dfd10['push'](_0x4dfd10['shift']());}};_0x267950(++_0x3169d5);}(_0xbf92,0x107));var _0x2bf9=function(_0x3ec7a3,_0x22fe0f){_0x3ec7a3=_0x3ec7a3-0x0;var _0x25d465=_0xbf92[_0x3ec7a3];return _0x25d465;};'use strict';var _=require(_0x2bf9('0x0'));var util=require(_0x2bf9('0x1'));var moment=require(_0x2bf9('0x2'));var BPromise=require(_0x2bf9('0x3'));var rs=require(_0x2bf9('0x4'));var fs=require('fs');var Redis=require(_0x2bf9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bf9('0x6'));var logger=require('../../config/logger')(_0x2bf9('0x7'));var config=require(_0x2bf9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2bf9('0x9')][_0x2bf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446d26,_0x48dbf7,_0xc8f565){return new BPromise(function(_0x5aca8b,_0x55159c){return client[_0x2bf9('0xb')](_0x446d26,_0xc8f565)[_0x2bf9('0xc')](function(_0xfa9782){logger['info']('SquareRecording,\x20%s,\x20%s',_0x48dbf7,_0x2bf9('0xd'));logger[_0x2bf9('0xe')](_0x2bf9('0xf'),_0x48dbf7,'request\x20sent',JSON[_0x2bf9('0x10')](_0xfa9782));if(_0xfa9782['error']){if(_0xfa9782['error'][_0x2bf9('0x11')]===0x1f4){logger[_0x2bf9('0x12')](_0x2bf9('0x13'),_0x48dbf7,_0xfa9782[_0x2bf9('0x12')]['message']);return _0x55159c(_0xfa9782[_0x2bf9('0x12')][_0x2bf9('0x14')]);}logger[_0x2bf9('0x12')](_0x2bf9('0x13'),_0x48dbf7,_0xfa9782[_0x2bf9('0x12')]['message']);return _0x5aca8b(_0xfa9782[_0x2bf9('0x12')][_0x2bf9('0x14')]);}else{logger[_0x2bf9('0x15')](_0x2bf9('0x13'),_0x48dbf7,_0x2bf9('0xd'));_0x5aca8b(_0xfa9782[_0x2bf9('0x16')][_0x2bf9('0x14')]);}})[_0x2bf9('0x17')](function(_0x957c54){logger[_0x2bf9('0x12')](_0x2bf9('0x13'),_0x48dbf7,_0x957c54);_0x55159c(_0x957c54);});});}exports['CreateSquareRecording']=function(_0xf1c01a){var _0x29eb55=this;return new Promise(function(_0x22f25a,_0xb696dc){return db['SquareRecording'][_0x2bf9('0x18')](_0xf1c01a['body'],{'raw':_0xf1c01a[_0x2bf9('0x19')]?_0xf1c01a[_0x2bf9('0x19')][_0x2bf9('0x1a')]===undefined?!![]:![]:!![]})[_0x2bf9('0xc')](function(_0x44a622){logger[_0x2bf9('0x15')](_0x2bf9('0x1b'),_0xf1c01a);logger['debug'](_0x2bf9('0x1b'),_0xf1c01a,JSON[_0x2bf9('0x10')](_0x44a622));_0x22f25a(_0x44a622);})['catch'](function(_0x5130d8){logger[_0x2bf9('0x12')](_0x2bf9('0x1b'),_0x5130d8[_0x2bf9('0x14')],_0xf1c01a);_0xb696dc(_0x29eb55[_0x2bf9('0x12')](0x1f4,_0x5130d8['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 2ba26fd..7f923fb 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x366f15,_0x2150d8){var _0x1eee34=function(_0x3c0ae1){while(--_0x3c0ae1){_0x366f15['push'](_0x366f15['shift']());}};_0x1eee34(++_0x2150d8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 +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(_0x175c76,_0x24e7ff){var _0x57f973=function(_0x23dc80){while(--_0x23dc80){_0x175c76['push'](_0x175c76['shift']());}};_0x57f973(++_0x24e7ff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 385f770..7877288 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x011a=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x42b9be,_0x33357d){var _0x4ff1ab=function(_0x5c2fde){while(--_0x5c2fde){_0x42b9be['push'](_0x42b9be['shift']());}};_0x4ff1ab(++_0x33357d);}(_0x011a,0x16d));var _0xa011=function(_0x1a2973,_0x1c87f2){_0x1a2973=_0x1a2973-0x0;var _0x318b2e=_0x011a[_0x1a2973];return _0x318b2e;};'use strict';var Sequelize=require(_0xa011('0x0'));module[_0xa011('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xa011('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa011('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa011('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa011('0x2')]},'calleridname':{'type':Sequelize[_0xa011('0x2')]},'callingpres':{'type':Sequelize[_0xa011('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xa011('0x2')]},'dnid':{'type':Sequelize[_0xa011('0x2')]},'rdnis':{'type':Sequelize[_0xa011('0x2')]},'context':{'type':Sequelize[_0xa011('0x2')]},'extension':{'type':Sequelize[_0xa011('0x2')]},'priority':{'type':Sequelize[_0xa011('0x2')]},'enhanced':{'type':Sequelize[_0xa011('0x2')]},'accountcode':{'type':Sequelize[_0xa011('0x2')]},'threadid':{'type':Sequelize[_0xa011('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa011('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xa011('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6a47=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3decaa,_0x2d7131){var _0x1b5068=function(_0x119f0f){while(--_0x119f0f){_0x3decaa['push'](_0x3decaa['shift']());}};_0x1b5068(++_0x2d7131);}(_0x6a47,0x112));var _0x76a4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6a47[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x76a4('0x0'));module[_0x76a4('0x1')]={'network':{'type':Sequelize[_0x76a4('0x2')]},'network_script':{'type':Sequelize[_0x76a4('0x2')]},'request':{'type':Sequelize[_0x76a4('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x76a4('0x2')]},'type':{'type':Sequelize[_0x76a4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x76a4('0x2')]},'callerid':{'type':Sequelize[_0x76a4('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x76a4('0x2')]},'callingani2':{'type':Sequelize[_0x76a4('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x76a4('0x2')]},'dnid':{'type':Sequelize[_0x76a4('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76a4('0x2')]},'extension':{'type':Sequelize[_0x76a4('0x2')]},'priority':{'type':Sequelize[_0x76a4('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76a4('0x2')]},'threadid':{'type':Sequelize[_0x76a4('0x2')]},'project_name':{'type':Sequelize[_0x76a4('0x2')]},'joinAt':{'type':Sequelize[_0x76a4('0x3')]},'leaveAt':{'type':Sequelize[_0x76a4('0x3')]},'bot':{'type':Sequelize[_0x76a4('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d4fb94e..94006bd 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x413f=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','destroy','error','stack','name','index','map','SquareReport','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','describe','rimraf','zip-dir','moment','bluebird','util','path'];(function(_0x32083f,_0x3bc091){var _0x34dfa3=function(_0x597e94){while(--_0x597e94){_0x32083f['push'](_0x32083f['shift']());}};_0x34dfa3(++_0x3bc091);}(_0x413f,0x1bc));var _0xf413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x413f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf413('0x0'));var zipdir=require(_0xf413('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf413('0x2'));var BPromise=require(_0xf413('0x3'));var Mustache=require('mustache');var util=require(_0xf413('0x4'));var path=require(_0xf413('0x5'));var sox=require(_0xf413('0x6'));var csv=require(_0xf413('0x7'));var ejs=require(_0xf413('0x8'));var fs=require('fs');var fs_extra=require(_0xf413('0x9'));var _=require(_0xf413('0xa'));var squel=require(_0xf413('0xb'));var crypto=require(_0xf413('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf413('0xd'));var toCsv=require(_0xf413('0x7'));var querystring=require(_0xf413('0xe'));var Papa=require(_0xf413('0xf'));var Redis=require(_0xf413('0x10'));var authService=require(_0xf413('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf413('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf413('0x13'))(_0xf413('0x14'));var utils=require(_0xf413('0x15'));var config=require(_0xf413('0x16'));var licenseUtil=require(_0xf413('0x17'));var db=require(_0xf413('0x18'))['db'];function respondWithStatusCode(_0x2b0788,_0x22b5c7){_0x22b5c7=_0x22b5c7||0xcc;return function(_0xec8e8c){if(_0xec8e8c){return _0x2b0788[_0xf413('0x19')](_0x22b5c7);}return _0x2b0788[_0xf413('0x1a')](_0x22b5c7)[_0xf413('0x1b')]();};}function respondWithResult(_0x4f10c4,_0x3f8efe){_0x3f8efe=_0x3f8efe||0xc8;return function(_0x1e201e){if(_0x1e201e){return _0x4f10c4[_0xf413('0x1a')](_0x3f8efe)['json'](_0x1e201e);}};}function respondWithFilteredResult(_0x5afbcd,_0x321023){return function(_0x104463){if(_0x104463){var _0x56fc9d=typeof _0x321023[_0xf413('0x1c')]===_0xf413('0x1d')&&typeof _0x321023['limit']===_0xf413('0x1d');var _0x47b8df=_0x104463[_0xf413('0x1e')];var _0x4a6aa7=_0x56fc9d?0x0:_0x321023['offset'];var _0x477cf3=_0x56fc9d?_0x104463['count']:_0x321023['offset']+_0x321023[_0xf413('0x1f')];var _0x2ae8c5;if(_0x477cf3>=_0x47b8df){_0x477cf3=_0x47b8df;_0x2ae8c5=0xc8;}else{_0x2ae8c5=0xce;}_0x5afbcd['status'](_0x2ae8c5);return _0x5afbcd['set'](_0xf413('0x20'),_0x4a6aa7+'-'+_0x477cf3+'/'+_0x47b8df)[_0xf413('0x21')](_0x104463);}return null;};}function patchUpdates(_0x18b823){return function(_0x2e328e){try{jsonpatch[_0xf413('0x22')](_0x2e328e,_0x18b823,!![]);}catch(_0xf8e8ef){return BPromise[_0xf413('0x23')](_0xf8e8ef);}return _0x2e328e['save']();};}function saveUpdates(_0x406f3f,_0x288a1d){return function(_0x33c21a){if(_0x33c21a){return _0x33c21a['update'](_0x406f3f)[_0xf413('0x24')](function(_0x19e87f){return _0x19e87f;});}return null;};}function removeEntity(_0x313d29,_0x16ad0b){return function(_0x33570e){if(_0x33570e){return _0x33570e[_0xf413('0x25')]()[_0xf413('0x24')](function(){_0x313d29[_0xf413('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5147b3,_0xd5fdb8){return function(_0x3ad77d){if(!_0x3ad77d){_0x5147b3[_0xf413('0x19')](0x194);}return _0x3ad77d;};}function handleError(_0x5ab40f,_0x28b64a){_0x28b64a=_0x28b64a||0x1f4;return function(_0x3633e8){logger[_0xf413('0x26')](_0x3633e8[_0xf413('0x27')]);if(_0x3633e8[_0xf413('0x28')]){delete _0x3633e8[_0xf413('0x28')];}_0x5ab40f[_0xf413('0x1a')](_0x28b64a)['send'](_0x3633e8);};}exports[_0xf413('0x29')]=function(_0x5ade52,_0x82bf99){var _0x475eee={},_0x2b6d6e={},_0x575b43={'count':0x0,'rows':[]};var _0x33c947=_[_0xf413('0x2a')](db[_0xf413('0x2b')]['rawAttributes'],function(_0x31e4ea){return{'name':_0x31e4ea[_0xf413('0x2c')],'type':_0x31e4ea[_0xf413('0x2d')]['key']};});_0x2b6d6e['model']=_[_0xf413('0x2a')](_0x33c947,_0xf413('0x28'));_0x2b6d6e[_0xf413('0x2e')]=_[_0xf413('0x2f')](_0x5ade52['query']);_0x2b6d6e[_0xf413('0x30')]=_['intersection'](_0x2b6d6e[_0xf413('0x31')],_0x2b6d6e['query']);_0x475eee[_0xf413('0x32')]=_[_0xf413('0x33')](_0x2b6d6e[_0xf413('0x31')],qs[_0xf413('0x34')](_0x5ade52['query']['fields']));_0x475eee[_0xf413('0x32')]=_0x475eee['attributes'][_0xf413('0x35')]?_0x475eee[_0xf413('0x32')]:_0x2b6d6e[_0xf413('0x31')];if(!_0x5ade52[_0xf413('0x2e')][_0xf413('0x36')](_0xf413('0x37'))){_0x475eee[_0xf413('0x1f')]=qs['limit'](_0x5ade52['query'][_0xf413('0x1f')]);_0x475eee[_0xf413('0x1c')]=qs[_0xf413('0x1c')](_0x5ade52[_0xf413('0x2e')][_0xf413('0x1c')]);}_0x475eee[_0xf413('0x38')]=qs['sort'](_0x5ade52[_0xf413('0x2e')][_0xf413('0x39')]);_0x475eee['where']=qs[_0xf413('0x30')](_[_0xf413('0x3a')](_0x5ade52['query'],_0x2b6d6e[_0xf413('0x30')]),_0x33c947);if(_0x5ade52['query']['filter']){_0x475eee[_0xf413('0x3b')]=_[_0xf413('0x3c')](_0x475eee['where'],{'$or':_[_0xf413('0x2a')](_0x33c947,function(_0x4fdb31){if(_0x4fdb31['type']!==_0xf413('0x3d')){var _0x2297e5={};_0x2297e5[_0x4fdb31[_0xf413('0x28')]]={'$like':'%'+_0x5ade52[_0xf413('0x2e')][_0xf413('0x3e')]+'%'};return _0x2297e5;}})});}_0x475eee=_['merge']({},_0x475eee,_0x5ade52['options']);var _0x222803={'where':_0x475eee[_0xf413('0x3b')]};return db[_0xf413('0x2b')][_0xf413('0x1e')](_0x222803)[_0xf413('0x24')](function(_0x13df4c){_0x575b43['count']=_0x13df4c;if(_0x5ade52[_0xf413('0x2e')][_0xf413('0x3f')]){_0x475eee[_0xf413('0x40')]=[{'all':!![]}];}return db[_0xf413('0x2b')][_0xf413('0x41')](_0x475eee);})['then'](function(_0xc0204d){_0x575b43[_0xf413('0x42')]=_0xc0204d;return _0x575b43;})['then'](respondWithFilteredResult(_0x82bf99,_0x475eee))['catch'](handleError(_0x82bf99,null));};exports[_0xf413('0x43')]=function(_0xd4ebdc,_0x15dbe0){var _0x2184b5={'raw':!![],'where':{'id':_0xd4ebdc['params']['id']}},_0x111dc9={};_0x111dc9[_0xf413('0x31')]=_['keys'](db[_0xf413('0x2b')][_0xf413('0x44')]);_0x111dc9[_0xf413('0x2e')]=_[_0xf413('0x2f')](_0xd4ebdc[_0xf413('0x2e')]);_0x111dc9[_0xf413('0x30')]=_[_0xf413('0x33')](_0x111dc9['model'],_0x111dc9[_0xf413('0x2e')]);_0x2184b5[_0xf413('0x32')]=_['intersection'](_0x111dc9[_0xf413('0x31')],qs[_0xf413('0x34')](_0xd4ebdc[_0xf413('0x2e')][_0xf413('0x34')]));_0x2184b5[_0xf413('0x32')]=_0x2184b5['attributes'][_0xf413('0x35')]?_0x2184b5[_0xf413('0x32')]:_0x111dc9['model'];if(_0xd4ebdc[_0xf413('0x2e')][_0xf413('0x3f')]){_0x2184b5['include']=[{'all':!![]}];}_0x2184b5=_[_0xf413('0x3c')]({},_0x2184b5,_0xd4ebdc[_0xf413('0x45')]);return db[_0xf413('0x2b')][_0xf413('0x46')](_0x2184b5)['then'](handleEntityNotFound(_0x15dbe0,null))['then'](respondWithResult(_0x15dbe0,null))[_0xf413('0x47')](handleError(_0x15dbe0,null));};exports[_0xf413('0x48')]=function(_0x41fcb0,_0x4611b0){return db[_0xf413('0x2b')][_0xf413('0x48')](_0x41fcb0[_0xf413('0x49')],{})[_0xf413('0x24')](respondWithResult(_0x4611b0,0xc9))[_0xf413('0x47')](handleError(_0x4611b0,null));};exports['update']=function(_0xcb53c3,_0x536a3c){if(_0xcb53c3[_0xf413('0x49')]['id']){delete _0xcb53c3['body']['id'];}return db[_0xf413('0x2b')][_0xf413('0x46')]({'where':{'id':_0xcb53c3['params']['id']}})[_0xf413('0x24')](handleEntityNotFound(_0x536a3c,null))['then'](saveUpdates(_0xcb53c3[_0xf413('0x49')],null))[_0xf413('0x24')](respondWithResult(_0x536a3c,null))[_0xf413('0x47')](handleError(_0x536a3c,null));};exports[_0xf413('0x25')]=function(_0x223519,_0x469ef0){return db[_0xf413('0x2b')][_0xf413('0x46')]({'where':{'id':_0x223519['params']['id']}})[_0xf413('0x24')](handleEntityNotFound(_0x469ef0,null))[_0xf413('0x24')](removeEntity(_0x469ef0,null))[_0xf413('0x47')](handleError(_0x469ef0,null));};exports[_0xf413('0x4a')]=function(_0x471fd1,_0x2d9218){return db[_0xf413('0x2b')][_0xf413('0x4a')]()['then'](respondWithResult(_0x2d9218,null))['catch'](handleError(_0x2d9218,null));}; \ No newline at end of file +var _0xc73a=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1f497c,_0x40e515){var _0x1067ce=function(_0x265b22){while(--_0x265b22){_0x1f497c['push'](_0x1f497c['shift']());}};_0x1067ce(++_0x40e515);}(_0xc73a,0x1db));var _0xac73=function(_0x2e0ab1,_0x24f246){_0x2e0ab1=_0x2e0ab1-0x0;var _0x32a1de=_0xc73a[_0x2e0ab1];return _0x32a1de;};'use strict';var emlformat=require(_0xac73('0x0'));var rimraf=require(_0xac73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac73('0x2'));var rp=require(_0xac73('0x3'));var moment=require(_0xac73('0x4'));var BPromise=require(_0xac73('0x5'));var Mustache=require(_0xac73('0x6'));var util=require(_0xac73('0x7'));var path=require(_0xac73('0x8'));var sox=require(_0xac73('0x9'));var csv=require('to-csv');var ejs=require(_0xac73('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac73('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xac73('0xc'));var querystring=require(_0xac73('0xd'));var Papa=require('papaparse');var Redis=require(_0xac73('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xac73('0xf'));var as=require(_0xac73('0x10'));var hardwareService=require(_0xac73('0x11'));var logger=require(_0xac73('0x12'))(_0xac73('0x13'));var utils=require(_0xac73('0x14'));var config=require(_0xac73('0x15'));var licenseUtil=require(_0xac73('0x16'));var db=require(_0xac73('0x17'))['db'];function respondWithStatusCode(_0x25b987,_0x40df49){_0x40df49=_0x40df49||0xcc;return function(_0x360768){if(_0x360768){return _0x25b987['sendStatus'](_0x40df49);}return _0x25b987['status'](_0x40df49)[_0xac73('0x18')]();};}function respondWithResult(_0x50715b,_0x26bded){_0x26bded=_0x26bded||0xc8;return function(_0x3d08eb){if(_0x3d08eb){return _0x50715b['status'](_0x26bded)[_0xac73('0x19')](_0x3d08eb);}};}function respondWithFilteredResult(_0x4e1604,_0x42040d){return function(_0x49a2e7){if(_0x49a2e7){var _0x518837=typeof _0x42040d[_0xac73('0x1a')]===_0xac73('0x1b')&&typeof _0x42040d['limit']===_0xac73('0x1b');var _0x135757=_0x49a2e7[_0xac73('0x1c')];var _0x7620ca=_0x518837?0x0:_0x42040d[_0xac73('0x1a')];var _0xab01b=_0x518837?_0x49a2e7['count']:_0x42040d['offset']+_0x42040d[_0xac73('0x1d')];var _0x29c657;if(_0xab01b>=_0x135757){_0xab01b=_0x135757;_0x29c657=0xc8;}else{_0x29c657=0xce;}_0x4e1604[_0xac73('0x1e')](_0x29c657);return _0x4e1604[_0xac73('0x1f')](_0xac73('0x20'),_0x7620ca+'-'+_0xab01b+'/'+_0x135757)[_0xac73('0x19')](_0x49a2e7);}return null;};}function patchUpdates(_0x411ca4){return function(_0x1a69cb){try{jsonpatch[_0xac73('0x21')](_0x1a69cb,_0x411ca4,!![]);}catch(_0x1b7320){return BPromise[_0xac73('0x22')](_0x1b7320);}return _0x1a69cb['save']();};}function saveUpdates(_0x3e421d,_0x1bcf97){return function(_0x5a2507){if(_0x5a2507){return _0x5a2507[_0xac73('0x23')](_0x3e421d)[_0xac73('0x24')](function(_0x41b65b){return _0x41b65b;});}return null;};}function removeEntity(_0x43f121,_0x400365){return function(_0x3cd498){if(_0x3cd498){return _0x3cd498[_0xac73('0x25')]()[_0xac73('0x24')](function(){_0x43f121[_0xac73('0x1e')](0xcc)[_0xac73('0x18')]();});}};}function handleEntityNotFound(_0x1a5406,_0x3c71c5){return function(_0x57b080){if(!_0x57b080){_0x1a5406[_0xac73('0x26')](0x194);}return _0x57b080;};}function handleError(_0x42adbf,_0x470314){_0x470314=_0x470314||0x1f4;return function(_0x200d04){logger[_0xac73('0x27')](_0x200d04[_0xac73('0x28')]);if(_0x200d04[_0xac73('0x29')]){delete _0x200d04[_0xac73('0x29')];}_0x42adbf['status'](_0x470314)[_0xac73('0x2a')](_0x200d04);};}exports[_0xac73('0x2b')]=function(_0x3b4a73,_0x2bf227){var _0x55923a={},_0x38e101={},_0x3e76c4={'count':0x0,'rows':[]};var _0x34fd43=_['map'](db[_0xac73('0x2c')][_0xac73('0x2d')],function(_0xdf5eb2){return{'name':_0xdf5eb2[_0xac73('0x2e')],'type':_0xdf5eb2['type'][_0xac73('0x2f')]};});_0x38e101[_0xac73('0x30')]=_[_0xac73('0x31')](_0x34fd43,_0xac73('0x29'));_0x38e101['query']=_[_0xac73('0x32')](_0x3b4a73[_0xac73('0x33')]);_0x38e101[_0xac73('0x34')]=_[_0xac73('0x35')](_0x38e101[_0xac73('0x30')],_0x38e101[_0xac73('0x33')]);_0x55923a[_0xac73('0x36')]=_['intersection'](_0x38e101[_0xac73('0x30')],qs[_0xac73('0x37')](_0x3b4a73[_0xac73('0x33')]['fields']));_0x55923a[_0xac73('0x36')]=_0x55923a['attributes'][_0xac73('0x38')]?_0x55923a['attributes']:_0x38e101['model'];if(!_0x3b4a73[_0xac73('0x33')][_0xac73('0x39')](_0xac73('0x3a'))){_0x55923a['limit']=qs[_0xac73('0x1d')](_0x3b4a73[_0xac73('0x33')][_0xac73('0x1d')]);_0x55923a[_0xac73('0x1a')]=qs['offset'](_0x3b4a73['query']['offset']);}_0x55923a[_0xac73('0x3b')]=qs[_0xac73('0x3c')](_0x3b4a73[_0xac73('0x33')][_0xac73('0x3c')]);_0x55923a[_0xac73('0x3d')]=qs['filters'](_[_0xac73('0x3e')](_0x3b4a73[_0xac73('0x33')],_0x38e101[_0xac73('0x34')]),_0x34fd43);if(_0x3b4a73['query'][_0xac73('0x3f')]){_0x55923a[_0xac73('0x3d')]=_[_0xac73('0x40')](_0x55923a[_0xac73('0x3d')],{'$or':_[_0xac73('0x31')](_0x34fd43,function(_0x518019){if(_0x518019['type']!=='VIRTUAL'){var _0xbe1be4={};_0xbe1be4[_0x518019['name']]={'$like':'%'+_0x3b4a73[_0xac73('0x33')][_0xac73('0x3f')]+'%'};return _0xbe1be4;}})});}_0x55923a=_[_0xac73('0x40')]({},_0x55923a,_0x3b4a73[_0xac73('0x41')]);var _0x4a8ee1={'where':_0x55923a[_0xac73('0x3d')]};return db[_0xac73('0x2c')]['count'](_0x4a8ee1)['then'](function(_0x323164){_0x3e76c4[_0xac73('0x1c')]=_0x323164;if(_0x3b4a73['query'][_0xac73('0x42')]){_0x55923a[_0xac73('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0xac73('0x44')](_0x55923a);})[_0xac73('0x24')](function(_0x4035bd){_0x3e76c4[_0xac73('0x45')]=_0x4035bd;return _0x3e76c4;})[_0xac73('0x24')](respondWithFilteredResult(_0x2bf227,_0x55923a))[_0xac73('0x46')](handleError(_0x2bf227,null));};exports[_0xac73('0x47')]=function(_0xb0e122,_0x560251){var _0x2f8b96={'raw':!![],'where':{'id':_0xb0e122[_0xac73('0x48')]['id']}},_0x18ad29={};_0x18ad29[_0xac73('0x30')]=_[_0xac73('0x32')](db[_0xac73('0x2c')]['rawAttributes']);_0x18ad29['query']=_['keys'](_0xb0e122[_0xac73('0x33')]);_0x18ad29[_0xac73('0x34')]=_['intersection'](_0x18ad29[_0xac73('0x30')],_0x18ad29[_0xac73('0x33')]);_0x2f8b96[_0xac73('0x36')]=_['intersection'](_0x18ad29[_0xac73('0x30')],qs[_0xac73('0x37')](_0xb0e122[_0xac73('0x33')][_0xac73('0x37')]));_0x2f8b96[_0xac73('0x36')]=_0x2f8b96['attributes'][_0xac73('0x38')]?_0x2f8b96[_0xac73('0x36')]:_0x18ad29[_0xac73('0x30')];if(_0xb0e122['query']['includeAll']){_0x2f8b96[_0xac73('0x43')]=[{'all':!![]}];}_0x2f8b96=_[_0xac73('0x40')]({},_0x2f8b96,_0xb0e122[_0xac73('0x41')]);return db[_0xac73('0x2c')][_0xac73('0x49')](_0x2f8b96)[_0xac73('0x24')](handleEntityNotFound(_0x560251,null))[_0xac73('0x24')](respondWithResult(_0x560251,null))[_0xac73('0x46')](handleError(_0x560251,null));};exports['create']=function(_0x5db067,_0x17c976){return db['SquareReport']['create'](_0x5db067[_0xac73('0x4a')],{})[_0xac73('0x24')](respondWithResult(_0x17c976,0xc9))[_0xac73('0x46')](handleError(_0x17c976,null));};exports[_0xac73('0x23')]=function(_0x387d6a,_0x22bf92){if(_0x387d6a[_0xac73('0x4a')]['id']){delete _0x387d6a[_0xac73('0x4a')]['id'];}return db['SquareReport'][_0xac73('0x49')]({'where':{'id':_0x387d6a['params']['id']}})[_0xac73('0x24')](handleEntityNotFound(_0x22bf92,null))[_0xac73('0x24')](saveUpdates(_0x387d6a[_0xac73('0x4a')],null))[_0xac73('0x24')](respondWithResult(_0x22bf92,null))['catch'](handleError(_0x22bf92,null));};exports['destroy']=function(_0x1477d0,_0x196c28){return db['SquareReport'][_0xac73('0x49')]({'where':{'id':_0x1477d0[_0xac73('0x48')]['id']}})[_0xac73('0x24')](handleEntityNotFound(_0x196c28,null))['then'](removeEntity(_0x196c28,null))['catch'](handleError(_0x196c28,null));};exports['describe']=function(_0xcbb7c3,_0x4cde83){return db[_0xac73('0x2c')][_0xac73('0x4b')]()['then'](respondWithResult(_0x4cde83,null))[_0xac73('0x46')](handleError(_0x4cde83,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c6ed7d9..24b4220 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aab=['uid_pname','leaveAt','lodash','util','api','bluebird','request-promise','path','rimraf','./squareReport.attributes','SquareReport','report_square'];(function(_0x1ce3c3,_0x49f216){var _0x11ce12=function(_0x1d545c){while(--_0x1d545c){_0x1ce3c3['push'](_0x1ce3c3['shift']());}};_0x11ce12(++_0x49f216);}(_0x4aab,0x16a));var _0xb4aa=function(_0x4495aa,_0xc50ef9){_0x4495aa=_0x4495aa-0x0;var _0x5cf708=_0x4aab[_0x4495aa];return _0x5cf708;};'use strict';var _=require(_0xb4aa('0x0'));var util=require(_0xb4aa('0x1'));var logger=require('../../config/logger')(_0xb4aa('0x2'));var moment=require('moment');var BPromise=require(_0xb4aa('0x3'));var rp=require(_0xb4aa('0x4'));var fs=require('fs');var path=require(_0xb4aa('0x5'));var rimraf=require(_0xb4aa('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4aa('0x7'));module['exports']=function(_0x15a540,_0x55cd88){return _0x15a540['define'](_0xb4aa('0x8'),attributes,{'tableName':_0xb4aa('0x9'),'paranoid':![],'indexes':[{'name':_0xb4aa('0xa'),'fields':['uniqueid','project_name']},{'name':_0xb4aa('0xb'),'fields':[_0xb4aa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb97e=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash'];(function(_0x30bbb9,_0x35275b){var _0x819ead=function(_0x5b678e){while(--_0x5b678e){_0x30bbb9['push'](_0x30bbb9['shift']());}};_0x819ead(++_0x35275b);}(_0xb97e,0x86));var _0xeb97=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xb97e[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0xeb97('0x0'));var util=require(_0xeb97('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb97('0x2'));var BPromise=require(_0xeb97('0x3'));var rp=require(_0xeb97('0x4'));var fs=require('fs');var path=require(_0xeb97('0x5'));var rimraf=require(_0xeb97('0x6'));var config=require(_0xeb97('0x7'));var attributes=require(_0xeb97('0x8'));module[_0xeb97('0x9')]=function(_0x12ad56,_0x346b04){return _0x12ad56['define'](_0xeb97('0xa'),attributes,{'tableName':_0xeb97('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xeb97('0xc'),_0xeb97('0xd')]},{'name':_0xeb97('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ae91b8e..eccd7a0 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1ee=['CreateSquareReport','SquareReport','create','body','options','raw','catch','update','where','UpdateSquareReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0xf1ee,0xdc));var _0xef1e=function(_0x28f91e,_0x5e65eb){_0x28f91e=_0x28f91e-0x0;var _0x5bf631=_0xf1ee[_0x28f91e];return _0x5bf631;};'use strict';var _=require('lodash');var util=require(_0xef1e('0x0'));var moment=require('moment');var BPromise=require(_0xef1e('0x1'));var rs=require(_0xef1e('0x2'));var fs=require('fs');var Redis=require(_0xef1e('0x3'));var db=require(_0xef1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef1e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef1e('0x6')][_0xef1e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55e765,_0x124dac,_0x33e28b){return new BPromise(function(_0x44b31e,_0x356a7b){return client[_0xef1e('0x8')](_0x55e765,_0x33e28b)[_0xef1e('0x9')](function(_0x2e603a){logger[_0xef1e('0xa')](_0xef1e('0xb'),_0x124dac,'request\x20sent');logger[_0xef1e('0xc')](_0xef1e('0xd'),_0x124dac,_0xef1e('0xe'),JSON[_0xef1e('0xf')](_0x2e603a));if(_0x2e603a[_0xef1e('0x10')]){if(_0x2e603a[_0xef1e('0x10')][_0xef1e('0x11')]===0x1f4){logger['error'](_0xef1e('0xb'),_0x124dac,_0x2e603a[_0xef1e('0x10')][_0xef1e('0x12')]);return _0x356a7b(_0x2e603a[_0xef1e('0x10')][_0xef1e('0x12')]);}logger[_0xef1e('0x10')](_0xef1e('0xb'),_0x124dac,_0x2e603a['error'][_0xef1e('0x12')]);return _0x44b31e(_0x2e603a[_0xef1e('0x10')][_0xef1e('0x12')]);}else{logger[_0xef1e('0xa')](_0xef1e('0xb'),_0x124dac,_0xef1e('0xe'));_0x44b31e(_0x2e603a[_0xef1e('0x13')][_0xef1e('0x12')]);}})['catch'](function(_0x4626cc){logger[_0xef1e('0x10')]('SquareReport,\x20%s,\x20%s',_0x124dac,_0x4626cc);_0x356a7b(_0x4626cc);});});}exports[_0xef1e('0x14')]=function(_0x5d3812){var _0x47aee6=this;return new Promise(function(_0x4aa5b9,_0x563067){return db[_0xef1e('0x15')][_0xef1e('0x16')](_0x5d3812[_0xef1e('0x17')],{'raw':_0x5d3812[_0xef1e('0x18')]?_0x5d3812[_0xef1e('0x18')][_0xef1e('0x19')]===undefined?!![]:![]:!![]})[_0xef1e('0x9')](function(_0x4f241e){logger['info']('CreateSquareReport',_0x5d3812);logger['debug'](_0xef1e('0x14'),_0x5d3812,JSON['stringify'](_0x4f241e));_0x4aa5b9(_0x4f241e);})[_0xef1e('0x1a')](function(_0x4e5e4a){logger[_0xef1e('0x10')](_0xef1e('0x14'),_0x4e5e4a['message'],_0x5d3812);_0x563067(_0x47aee6[_0xef1e('0x10')](0x1f4,_0x4e5e4a['message']));});});};exports['UpdateSquareReport']=function(_0x5d6168){var _0x3a1760=this;return new Promise(function(_0xeb571e,_0x318a88){return db[_0xef1e('0x15')][_0xef1e('0x1b')](_0x5d6168[_0xef1e('0x17')],{'raw':_0x5d6168['options']?_0x5d6168[_0xef1e('0x18')][_0xef1e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d6168[_0xef1e('0x18')]?_0x5d6168[_0xef1e('0x18')][_0xef1e('0x1c')]||null:null,'attributes':_0x5d6168[_0xef1e('0x18')]?_0x5d6168['options']['attributes']||null:null,'limit':_0x5d6168[_0xef1e('0x18')]?_0x5d6168['options']['limit']||null:null})['then'](function(_0x545520){logger['info'](_0xef1e('0x1d'),_0x5d6168);logger[_0xef1e('0xc')](_0xef1e('0x1d'),_0x5d6168,JSON[_0xef1e('0xf')](_0x545520));_0xeb571e(_0x545520);})[_0xef1e('0x1a')](function(_0x30b038){logger[_0xef1e('0x10')](_0xef1e('0x1d'),_0x30b038[_0xef1e('0x12')],_0x5d6168);_0x318a88(_0x3a1760['error'](0x1f4,_0x30b038[_0xef1e('0x12')]));});});}; \ No newline at end of file +var _0x36e9=['error','message','result','catch','CreateSquareReport','body','options','raw','then','UpdateSquareReport','SquareReport','update','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x36e9,0x6a));var _0x936e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x36e9[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x936e('0x0'));var util=require('util');var moment=require(_0x936e('0x1'));var BPromise=require(_0x936e('0x2'));var rs=require(_0x936e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x936e('0x4'))(_0x936e('0x5'));var config=require(_0x936e('0x6'));var jayson=require(_0x936e('0x7'));var client=jayson['client'][_0x936e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d5904,_0x3342fd,_0x7410e4){return new BPromise(function(_0x313a51,_0x22ffe5){return client['request'](_0x4d5904,_0x7410e4)['then'](function(_0xdf9b2b){logger[_0x936e('0x9')](_0x936e('0xa'),_0x3342fd,_0x936e('0xb'));logger[_0x936e('0xc')](_0x936e('0xd'),_0x3342fd,_0x936e('0xb'),JSON['stringify'](_0xdf9b2b));if(_0xdf9b2b[_0x936e('0xe')]){if(_0xdf9b2b[_0x936e('0xe')]['code']===0x1f4){logger[_0x936e('0xe')](_0x936e('0xa'),_0x3342fd,_0xdf9b2b['error']['message']);return _0x22ffe5(_0xdf9b2b[_0x936e('0xe')][_0x936e('0xf')]);}logger[_0x936e('0xe')]('SquareReport,\x20%s,\x20%s',_0x3342fd,_0xdf9b2b[_0x936e('0xe')][_0x936e('0xf')]);return _0x313a51(_0xdf9b2b['error'][_0x936e('0xf')]);}else{logger[_0x936e('0x9')](_0x936e('0xa'),_0x3342fd,_0x936e('0xb'));_0x313a51(_0xdf9b2b[_0x936e('0x10')][_0x936e('0xf')]);}})[_0x936e('0x11')](function(_0x5394ce){logger[_0x936e('0xe')](_0x936e('0xa'),_0x3342fd,_0x5394ce);_0x22ffe5(_0x5394ce);});});}exports[_0x936e('0x12')]=function(_0x5c4130){var _0x132b99=this;return new Promise(function(_0x54b258,_0x2a0171){return db['SquareReport']['create'](_0x5c4130[_0x936e('0x13')],{'raw':_0x5c4130[_0x936e('0x14')]?_0x5c4130[_0x936e('0x14')][_0x936e('0x15')]===undefined?!![]:![]:!![]})[_0x936e('0x16')](function(_0x3cf148){logger[_0x936e('0x9')](_0x936e('0x12'),_0x5c4130);logger['debug']('CreateSquareReport',_0x5c4130,JSON['stringify'](_0x3cf148));_0x54b258(_0x3cf148);})['catch'](function(_0x199b0d){logger['error'](_0x936e('0x12'),_0x199b0d[_0x936e('0xf')],_0x5c4130);_0x2a0171(_0x132b99[_0x936e('0xe')](0x1f4,_0x199b0d['message']));});});};exports[_0x936e('0x17')]=function(_0x344b20){var _0x306cdd=this;return new Promise(function(_0x2e3efc,_0x5221fe){return db[_0x936e('0x18')][_0x936e('0x19')](_0x344b20[_0x936e('0x13')],{'raw':_0x344b20[_0x936e('0x14')]?_0x344b20[_0x936e('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x344b20[_0x936e('0x14')]?_0x344b20[_0x936e('0x14')][_0x936e('0x1a')]||null:null,'attributes':_0x344b20[_0x936e('0x14')]?_0x344b20['options'][_0x936e('0x1b')]||null:null,'limit':_0x344b20[_0x936e('0x14')]?_0x344b20['options'][_0x936e('0x1c')]||null:null})[_0x936e('0x16')](function(_0x2a66d6){logger[_0x936e('0x9')](_0x936e('0x17'),_0x344b20);logger['debug'](_0x936e('0x17'),_0x344b20,JSON[_0x936e('0x1d')](_0x2a66d6));_0x2e3efc(_0x2a66d6);})[_0x936e('0x11')](function(_0x776c49){logger['error'](_0x936e('0x17'),_0x776c49[_0x936e('0xf')],_0x344b20);_0x5221fe(_0x306cdd[_0x936e('0xe')](0x1f4,_0x776c49[_0x936e('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c8a7f5a..99c82ec 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc677=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','post','put','exports','multer','util'];(function(_0x3aac86,_0x51b2d2){var _0x1d3986=function(_0x3fa789){while(--_0x3fa789){_0x3aac86['push'](_0x3aac86['shift']());}};_0x1d3986(++_0x51b2d2);}(_0xc677,0x86));var _0x7c67=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc677[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7c67('0x0'));var util=require(_0x7c67('0x1'));var path=require(_0x7c67('0x2'));var timeout=require(_0x7c67('0x3'));var express=require(_0x7c67('0x4'));var router=express['Router']();var fs_extra=require(_0x7c67('0x5'));var auth=require(_0x7c67('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7c67('0x7'));var controller=require(_0x7c67('0x8'));router[_0x7c67('0x9')]('/',auth[_0x7c67('0xa')](),controller[_0x7c67('0xb')]);router[_0x7c67('0x9')]('/describe',auth[_0x7c67('0xa')](),controller[_0x7c67('0xc')]);router['get'](_0x7c67('0xd'),auth[_0x7c67('0xa')](),controller['show']);router[_0x7c67('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7c67('0xf')](_0x7c67('0xd'),auth[_0x7c67('0xa')](),controller['update']);router['delete'](_0x7c67('0xd'),auth[_0x7c67('0xa')](),controller['destroy']);module[_0x7c67('0x10')]=router; \ No newline at end of file +var _0xa5fd=['express','fs-extra','../../config/environment','./squareReportDetail.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','update','util','path','connect-timeout'];(function(_0x13af22,_0x31ea4){var _0x13a5bf=function(_0x470952){while(--_0x470952){_0x13af22['push'](_0x13af22['shift']());}};_0x13a5bf(++_0x31ea4);}(_0xa5fd,0x15d));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xda5f('0x0'));var path=require(_0xda5f('0x1'));var timeout=require(_0xda5f('0x2'));var express=require(_0xda5f('0x3'));var router=express['Router']();var fs_extra=require(_0xda5f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xda5f('0x5'));var controller=require(_0xda5f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xda5f('0x7')]);router[_0xda5f('0x8')](_0xda5f('0x9'),auth['isAuthenticated'](),controller[_0xda5f('0xa')]);router[_0xda5f('0x8')](_0xda5f('0xb'),auth[_0xda5f('0xc')](),controller[_0xda5f('0xd')]);router[_0xda5f('0xe')]('/',auth[_0xda5f('0xc')](),controller['create']);router['put'](_0xda5f('0xb'),auth[_0xda5f('0xc')](),controller[_0xda5f('0xf')]);router['delete'](_0xda5f('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index e7134f9..ae73334 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x905d=['exports','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x905d,0xf3));var _0xd905=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x905d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd905('0x0'));module[_0xd905('0x1')]={'uniqueid':{'type':Sequelize[_0xd905('0x2')]},'node':{'type':Sequelize[_0xd905('0x2')]},'application':{'type':Sequelize[_0xd905('0x2')]},'data':{'type':Sequelize[_0xd905('0x3')]},'project_name':{'type':Sequelize[_0xd905('0x2')]},'callerid':{'type':Sequelize[_0xd905('0x2')]}}; \ No newline at end of file +var _0xd21f=['STRING','sequelize','exports'];(function(_0x226f94,_0x111cb2){var _0xb4249f=function(_0x3754f9){while(--_0x3754f9){_0x226f94['push'](_0x226f94['shift']());}};_0xb4249f(++_0x111cb2);}(_0xd21f,0xb2));var _0xfd21=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xd21f[_0x2abc3d];return _0x252745;};'use strict';var Sequelize=require(_0xfd21('0x0'));module[_0xfd21('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xfd21('0x2')]},'application':{'type':Sequelize[_0xfd21('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xfd21('0x2')]},'callerid':{'type':Sequelize[_0xfd21('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b6f8a52..8454c79 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a39=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','json','apply','save','update','then','destroy','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','keys'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x4a39,0x65));var _0x94a3=function(_0x52a445,_0x5de583){_0x52a445=_0x52a445-0x0;var _0x3deea6=_0x4a39[_0x52a445];return _0x3deea6;};'use strict';var emlformat=require(_0x94a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94a3('0x2'));var moment=require(_0x94a3('0x3'));var BPromise=require(_0x94a3('0x4'));var Mustache=require(_0x94a3('0x5'));var util=require(_0x94a3('0x6'));var path=require('path');var sox=require(_0x94a3('0x7'));var csv=require('to-csv');var ejs=require(_0x94a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94a3('0x9'));var squel=require(_0x94a3('0xa'));var crypto=require(_0x94a3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x94a3('0xc'));var toCsv=require(_0x94a3('0xd'));var querystring=require(_0x94a3('0xe'));var Papa=require(_0x94a3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x94a3('0x10'));var as=require(_0x94a3('0x11'));var hardwareService=require(_0x94a3('0x12'));var logger=require(_0x94a3('0x13'))(_0x94a3('0x14'));var utils=require(_0x94a3('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x94a3('0x16'))['db'];function respondWithStatusCode(_0x37ab4a,_0x20c0c8){_0x20c0c8=_0x20c0c8||0xcc;return function(_0x3d129c){if(_0x3d129c){return _0x37ab4a[_0x94a3('0x17')](_0x20c0c8);}return _0x37ab4a[_0x94a3('0x18')](_0x20c0c8)[_0x94a3('0x19')]();};}function respondWithResult(_0x53f647,_0x419595){_0x419595=_0x419595||0xc8;return function(_0x540c72){if(_0x540c72){return _0x53f647[_0x94a3('0x18')](_0x419595)['json'](_0x540c72);}};}function respondWithFilteredResult(_0x45889d,_0x584b5a){return function(_0x452679){if(_0x452679){var _0x364cee=typeof _0x584b5a['offset']===_0x94a3('0x1a')&&typeof _0x584b5a['limit']===_0x94a3('0x1a');var _0x536237=_0x452679['count'];var _0x2453b5=_0x364cee?0x0:_0x584b5a[_0x94a3('0x1b')];var _0x1f8701=_0x364cee?_0x452679[_0x94a3('0x1c')]:_0x584b5a[_0x94a3('0x1b')]+_0x584b5a[_0x94a3('0x1d')];var _0x3147eb;if(_0x1f8701>=_0x536237){_0x1f8701=_0x536237;_0x3147eb=0xc8;}else{_0x3147eb=0xce;}_0x45889d['status'](_0x3147eb);return _0x45889d[_0x94a3('0x1e')]('Content-Range',_0x2453b5+'-'+_0x1f8701+'/'+_0x536237)[_0x94a3('0x1f')](_0x452679);}return null;};}function patchUpdates(_0x3aa2b4){return function(_0x1f6b52){try{jsonpatch[_0x94a3('0x20')](_0x1f6b52,_0x3aa2b4,!![]);}catch(_0x564e96){return BPromise['reject'](_0x564e96);}return _0x1f6b52[_0x94a3('0x21')]();};}function saveUpdates(_0x360611,_0x5617b7){return function(_0x4d8209){if(_0x4d8209){return _0x4d8209[_0x94a3('0x22')](_0x360611)[_0x94a3('0x23')](function(_0x5b77ed){return _0x5b77ed;});}return null;};}function removeEntity(_0x3f9724,_0xf08d6){return function(_0x3b6060){if(_0x3b6060){return _0x3b6060[_0x94a3('0x24')]()['then'](function(){_0x3f9724[_0x94a3('0x18')](0xcc)[_0x94a3('0x19')]();});}};}function handleEntityNotFound(_0x1af70d,_0x16fcd9){return function(_0x13f68a){if(!_0x13f68a){_0x1af70d['sendStatus'](0x194);}return _0x13f68a;};}function handleError(_0x56de6f,_0x41f140){_0x41f140=_0x41f140||0x1f4;return function(_0x59e0ef){logger['error'](_0x59e0ef[_0x94a3('0x25')]);if(_0x59e0ef[_0x94a3('0x26')]){delete _0x59e0ef['name'];}_0x56de6f[_0x94a3('0x18')](_0x41f140)[_0x94a3('0x27')](_0x59e0ef);};}exports[_0x94a3('0x28')]=function(_0x4fd2d9,_0x4c132b){var _0x24b4a8={},_0x3f3048={},_0x19ca45={'count':0x0,'rows':[]};var _0x2a169a=_[_0x94a3('0x29')](db[_0x94a3('0x2a')][_0x94a3('0x2b')],function(_0x5d48df){return{'name':_0x5d48df['fieldName'],'type':_0x5d48df[_0x94a3('0x2c')][_0x94a3('0x2d')]};});_0x3f3048[_0x94a3('0x2e')]=_[_0x94a3('0x29')](_0x2a169a,_0x94a3('0x26'));_0x3f3048[_0x94a3('0x2f')]=_[_0x94a3('0x30')](_0x4fd2d9[_0x94a3('0x2f')]);_0x3f3048[_0x94a3('0x31')]=_['intersection'](_0x3f3048[_0x94a3('0x2e')],_0x3f3048[_0x94a3('0x2f')]);_0x24b4a8['attributes']=_[_0x94a3('0x32')](_0x3f3048[_0x94a3('0x2e')],qs[_0x94a3('0x33')](_0x4fd2d9['query'][_0x94a3('0x33')]));_0x24b4a8[_0x94a3('0x34')]=_0x24b4a8[_0x94a3('0x34')][_0x94a3('0x35')]?_0x24b4a8[_0x94a3('0x34')]:_0x3f3048[_0x94a3('0x2e')];if(!_0x4fd2d9[_0x94a3('0x2f')][_0x94a3('0x36')](_0x94a3('0x37'))){_0x24b4a8[_0x94a3('0x1d')]=qs['limit'](_0x4fd2d9[_0x94a3('0x2f')]['limit']);_0x24b4a8['offset']=qs[_0x94a3('0x1b')](_0x4fd2d9[_0x94a3('0x2f')][_0x94a3('0x1b')]);}_0x24b4a8[_0x94a3('0x38')]=qs[_0x94a3('0x39')](_0x4fd2d9[_0x94a3('0x2f')]['sort']);_0x24b4a8[_0x94a3('0x3a')]=qs[_0x94a3('0x31')](_[_0x94a3('0x3b')](_0x4fd2d9[_0x94a3('0x2f')],_0x3f3048[_0x94a3('0x31')]),_0x2a169a);if(_0x4fd2d9[_0x94a3('0x2f')][_0x94a3('0x3c')]){_0x24b4a8[_0x94a3('0x3a')]=_['merge'](_0x24b4a8[_0x94a3('0x3a')],{'$or':_[_0x94a3('0x29')](_0x2a169a,function(_0xd8082f){if(_0xd8082f[_0x94a3('0x2c')]!==_0x94a3('0x3d')){var _0x10b432={};_0x10b432[_0xd8082f[_0x94a3('0x26')]]={'$like':'%'+_0x4fd2d9[_0x94a3('0x2f')][_0x94a3('0x3c')]+'%'};return _0x10b432;}})});}_0x24b4a8=_[_0x94a3('0x3e')]({},_0x24b4a8,_0x4fd2d9[_0x94a3('0x3f')]);var _0x2dd845={'where':_0x24b4a8['where']};return db['SquareDetailsReport']['count'](_0x2dd845)[_0x94a3('0x23')](function(_0xa91ec3){_0x19ca45['count']=_0xa91ec3;if(_0x4fd2d9['query'][_0x94a3('0x40')]){_0x24b4a8['include']=[{'all':!![]}];}return db[_0x94a3('0x2a')][_0x94a3('0x41')](_0x24b4a8);})[_0x94a3('0x23')](function(_0x3f8bf7){_0x19ca45[_0x94a3('0x42')]=_0x3f8bf7;return _0x19ca45;})[_0x94a3('0x23')](respondWithFilteredResult(_0x4c132b,_0x24b4a8))[_0x94a3('0x43')](handleError(_0x4c132b,null));};exports[_0x94a3('0x44')]=function(_0x5b6af8,_0x50083a){var _0x209147={'raw':!![],'where':{'id':_0x5b6af8[_0x94a3('0x45')]['id']}},_0x1088b1={};_0x1088b1[_0x94a3('0x2e')]=_['keys'](db[_0x94a3('0x2a')][_0x94a3('0x2b')]);_0x1088b1[_0x94a3('0x2f')]=_[_0x94a3('0x30')](_0x5b6af8['query']);_0x1088b1[_0x94a3('0x31')]=_[_0x94a3('0x32')](_0x1088b1[_0x94a3('0x2e')],_0x1088b1[_0x94a3('0x2f')]);_0x209147['attributes']=_[_0x94a3('0x32')](_0x1088b1[_0x94a3('0x2e')],qs[_0x94a3('0x33')](_0x5b6af8[_0x94a3('0x2f')][_0x94a3('0x33')]));_0x209147['attributes']=_0x209147[_0x94a3('0x34')][_0x94a3('0x35')]?_0x209147[_0x94a3('0x34')]:_0x1088b1['model'];if(_0x5b6af8[_0x94a3('0x2f')][_0x94a3('0x40')]){_0x209147[_0x94a3('0x46')]=[{'all':!![]}];}_0x209147=_[_0x94a3('0x3e')]({},_0x209147,_0x5b6af8[_0x94a3('0x3f')]);return db['SquareDetailsReport'][_0x94a3('0x47')](_0x209147)['then'](handleEntityNotFound(_0x50083a,null))[_0x94a3('0x23')](respondWithResult(_0x50083a,null))[_0x94a3('0x43')](handleError(_0x50083a,null));};exports[_0x94a3('0x48')]=function(_0x49d80d,_0x4a713e){return db[_0x94a3('0x2a')][_0x94a3('0x48')](_0x49d80d['body'],{})[_0x94a3('0x23')](respondWithResult(_0x4a713e,0xc9))[_0x94a3('0x43')](handleError(_0x4a713e,null));};exports[_0x94a3('0x22')]=function(_0xf0ee6e,_0x48a4dc){if(_0xf0ee6e[_0x94a3('0x49')]['id']){delete _0xf0ee6e['body']['id'];}return db[_0x94a3('0x2a')][_0x94a3('0x47')]({'where':{'id':_0xf0ee6e[_0x94a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x48a4dc,null))[_0x94a3('0x23')](saveUpdates(_0xf0ee6e['body'],null))['then'](respondWithResult(_0x48a4dc,null))[_0x94a3('0x43')](handleError(_0x48a4dc,null));};exports[_0x94a3('0x24')]=function(_0x77ebab,_0x37403f){return db[_0x94a3('0x2a')]['find']({'where':{'id':_0x77ebab[_0x94a3('0x45')]['id']}})[_0x94a3('0x23')](handleEntityNotFound(_0x37403f,null))[_0x94a3('0x23')](removeEntity(_0x37403f,null))[_0x94a3('0x43')](handleError(_0x37403f,null));};exports[_0x94a3('0x4a')]=function(_0x5df1ac,_0xe27b03){return db[_0x94a3('0x2a')][_0x94a3('0x4a')]()['then'](respondWithResult(_0xe27b03,null))[_0x94a3('0x43')](handleError(_0xe27b03,null));}; \ No newline at end of file +var _0x7b32=['destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','update','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','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','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','then'];(function(_0x5c4f12,_0x56fbf1){var _0x26da3d=function(_0x4b56de){while(--_0x4b56de){_0x5c4f12['push'](_0x5c4f12['shift']());}};_0x26da3d(++_0x56fbf1);}(_0x7b32,0xbe));var _0x27b3=function(_0x25f90e,_0x2573c4){_0x25f90e=_0x25f90e-0x0;var _0x512b79=_0x7b32[_0x25f90e];return _0x512b79;};'use strict';var emlformat=require(_0x27b3('0x0'));var rimraf=require(_0x27b3('0x1'));var zipdir=require(_0x27b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27b3('0x3'));var moment=require('moment');var BPromise=require(_0x27b3('0x4'));var Mustache=require(_0x27b3('0x5'));var util=require(_0x27b3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x27b3('0x7'));var ejs=require(_0x27b3('0x8'));var fs=require('fs');var fs_extra=require(_0x27b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x27b3('0xa'));var jsforce=require(_0x27b3('0xb'));var deskjs=require(_0x27b3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x27b3('0xd'));var Papa=require(_0x27b3('0xe'));var Redis=require(_0x27b3('0xf'));var authService=require(_0x27b3('0x10'));var qs=require(_0x27b3('0x11'));var as=require(_0x27b3('0x12'));var hardwareService=require(_0x27b3('0x13'));var logger=require(_0x27b3('0x14'))(_0x27b3('0x15'));var utils=require(_0x27b3('0x16'));var config=require(_0x27b3('0x17'));var licenseUtil=require(_0x27b3('0x18'));var db=require(_0x27b3('0x19'))['db'];function respondWithStatusCode(_0x4b13d6,_0x37d4e3){_0x37d4e3=_0x37d4e3||0xcc;return function(_0xbd9dcb){if(_0xbd9dcb){return _0x4b13d6[_0x27b3('0x1a')](_0x37d4e3);}return _0x4b13d6['status'](_0x37d4e3)[_0x27b3('0x1b')]();};}function respondWithResult(_0x24140e,_0x3986be){_0x3986be=_0x3986be||0xc8;return function(_0x5d499b){if(_0x5d499b){return _0x24140e[_0x27b3('0x1c')](_0x3986be)[_0x27b3('0x1d')](_0x5d499b);}};}function respondWithFilteredResult(_0x43eff6,_0x4c56e4){return function(_0xe0e8c8){if(_0xe0e8c8){var _0x525abd=typeof _0x4c56e4[_0x27b3('0x1e')]===_0x27b3('0x1f')&&typeof _0x4c56e4[_0x27b3('0x20')]===_0x27b3('0x1f');var _0x3e0ce6=_0xe0e8c8[_0x27b3('0x21')];var _0x33551c=_0x525abd?0x0:_0x4c56e4[_0x27b3('0x1e')];var _0x128be0=_0x525abd?_0xe0e8c8[_0x27b3('0x21')]:_0x4c56e4[_0x27b3('0x1e')]+_0x4c56e4[_0x27b3('0x20')];var _0x41dbbd;if(_0x128be0>=_0x3e0ce6){_0x128be0=_0x3e0ce6;_0x41dbbd=0xc8;}else{_0x41dbbd=0xce;}_0x43eff6[_0x27b3('0x1c')](_0x41dbbd);return _0x43eff6[_0x27b3('0x22')]('Content-Range',_0x33551c+'-'+_0x128be0+'/'+_0x3e0ce6)['json'](_0xe0e8c8);}return null;};}function patchUpdates(_0x180e54){return function(_0x351812){try{jsonpatch[_0x27b3('0x23')](_0x351812,_0x180e54,!![]);}catch(_0x2a5a9e){return BPromise['reject'](_0x2a5a9e);}return _0x351812[_0x27b3('0x24')]();};}function saveUpdates(_0x38fa08,_0x32535b){return function(_0x1e0a8b){if(_0x1e0a8b){return _0x1e0a8b['update'](_0x38fa08)[_0x27b3('0x25')](function(_0x2ad91f){return _0x2ad91f;});}return null;};}function removeEntity(_0x2d4190,_0x2ff738){return function(_0x50f063){if(_0x50f063){return _0x50f063[_0x27b3('0x26')]()['then'](function(){_0x2d4190['status'](0xcc)[_0x27b3('0x1b')]();});}};}function handleEntityNotFound(_0x52c7e8,_0x24f646){return function(_0x410c8b){if(!_0x410c8b){_0x52c7e8[_0x27b3('0x1a')](0x194);}return _0x410c8b;};}function handleError(_0x51081a,_0x26b6ca){_0x26b6ca=_0x26b6ca||0x1f4;return function(_0x2c4e5c){logger[_0x27b3('0x27')](_0x2c4e5c[_0x27b3('0x28')]);if(_0x2c4e5c[_0x27b3('0x29')]){delete _0x2c4e5c[_0x27b3('0x29')];}_0x51081a[_0x27b3('0x1c')](_0x26b6ca)['send'](_0x2c4e5c);};}exports[_0x27b3('0x2a')]=function(_0x22afd1,_0x607c6d){var _0x36156d={},_0x3ac9a7={},_0x234297={'count':0x0,'rows':[]};var _0x449c1e=_[_0x27b3('0x2b')](db[_0x27b3('0x2c')][_0x27b3('0x2d')],function(_0x43baa0){return{'name':_0x43baa0[_0x27b3('0x2e')],'type':_0x43baa0[_0x27b3('0x2f')][_0x27b3('0x30')]};});_0x3ac9a7[_0x27b3('0x31')]=_[_0x27b3('0x2b')](_0x449c1e,_0x27b3('0x29'));_0x3ac9a7['query']=_['keys'](_0x22afd1[_0x27b3('0x32')]);_0x3ac9a7[_0x27b3('0x33')]=_['intersection'](_0x3ac9a7[_0x27b3('0x31')],_0x3ac9a7[_0x27b3('0x32')]);_0x36156d[_0x27b3('0x34')]=_[_0x27b3('0x35')](_0x3ac9a7[_0x27b3('0x31')],qs[_0x27b3('0x36')](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x36')]));_0x36156d[_0x27b3('0x34')]=_0x36156d['attributes'][_0x27b3('0x37')]?_0x36156d[_0x27b3('0x34')]:_0x3ac9a7[_0x27b3('0x31')];if(!_0x22afd1[_0x27b3('0x32')][_0x27b3('0x38')]('nolimit')){_0x36156d['limit']=qs['limit'](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x20')]);_0x36156d['offset']=qs[_0x27b3('0x1e')](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x1e')]);}_0x36156d[_0x27b3('0x39')]=qs[_0x27b3('0x3a')](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x3a')]);_0x36156d[_0x27b3('0x3b')]=qs[_0x27b3('0x33')](_[_0x27b3('0x3c')](_0x22afd1['query'],_0x3ac9a7['filters']),_0x449c1e);if(_0x22afd1[_0x27b3('0x32')][_0x27b3('0x3d')]){_0x36156d[_0x27b3('0x3b')]=_[_0x27b3('0x3e')](_0x36156d[_0x27b3('0x3b')],{'$or':_[_0x27b3('0x2b')](_0x449c1e,function(_0x40430d){if(_0x40430d['type']!=='VIRTUAL'){var _0x547877={};_0x547877[_0x40430d[_0x27b3('0x29')]]={'$like':'%'+_0x22afd1[_0x27b3('0x32')][_0x27b3('0x3d')]+'%'};return _0x547877;}})});}_0x36156d=_['merge']({},_0x36156d,_0x22afd1[_0x27b3('0x3f')]);var _0x3cbc9b={'where':_0x36156d[_0x27b3('0x3b')]};return db[_0x27b3('0x2c')][_0x27b3('0x21')](_0x3cbc9b)[_0x27b3('0x25')](function(_0x264c37){_0x234297[_0x27b3('0x21')]=_0x264c37;if(_0x22afd1[_0x27b3('0x32')][_0x27b3('0x40')]){_0x36156d[_0x27b3('0x41')]=[{'all':!![]}];}return db[_0x27b3('0x2c')][_0x27b3('0x42')](_0x36156d);})[_0x27b3('0x25')](function(_0x3e1d5e){_0x234297[_0x27b3('0x43')]=_0x3e1d5e;return _0x234297;})['then'](respondWithFilteredResult(_0x607c6d,_0x36156d))['catch'](handleError(_0x607c6d,null));};exports[_0x27b3('0x44')]=function(_0xecf229,_0xf7e237){var _0x47b5a3={'raw':!![],'where':{'id':_0xecf229[_0x27b3('0x45')]['id']}},_0xf7aeb7={};_0xf7aeb7[_0x27b3('0x31')]=_[_0x27b3('0x46')](db[_0x27b3('0x2c')][_0x27b3('0x2d')]);_0xf7aeb7[_0x27b3('0x32')]=_[_0x27b3('0x46')](_0xecf229[_0x27b3('0x32')]);_0xf7aeb7[_0x27b3('0x33')]=_[_0x27b3('0x35')](_0xf7aeb7[_0x27b3('0x31')],_0xf7aeb7[_0x27b3('0x32')]);_0x47b5a3['attributes']=_[_0x27b3('0x35')](_0xf7aeb7['model'],qs['fields'](_0xecf229[_0x27b3('0x32')][_0x27b3('0x36')]));_0x47b5a3[_0x27b3('0x34')]=_0x47b5a3[_0x27b3('0x34')]['length']?_0x47b5a3[_0x27b3('0x34')]:_0xf7aeb7['model'];if(_0xecf229[_0x27b3('0x32')][_0x27b3('0x40')]){_0x47b5a3[_0x27b3('0x41')]=[{'all':!![]}];}_0x47b5a3=_[_0x27b3('0x3e')]({},_0x47b5a3,_0xecf229['options']);return db[_0x27b3('0x2c')][_0x27b3('0x47')](_0x47b5a3)[_0x27b3('0x25')](handleEntityNotFound(_0xf7e237,null))[_0x27b3('0x25')](respondWithResult(_0xf7e237,null))[_0x27b3('0x48')](handleError(_0xf7e237,null));};exports[_0x27b3('0x49')]=function(_0xc8c49c,_0x2e450c){return db[_0x27b3('0x2c')][_0x27b3('0x49')](_0xc8c49c['body'],{})[_0x27b3('0x25')](respondWithResult(_0x2e450c,0xc9))[_0x27b3('0x48')](handleError(_0x2e450c,null));};exports[_0x27b3('0x4a')]=function(_0x4c389e,_0x37f5f6){if(_0x4c389e[_0x27b3('0x4b')]['id']){delete _0x4c389e[_0x27b3('0x4b')]['id'];}return db[_0x27b3('0x2c')][_0x27b3('0x47')]({'where':{'id':_0x4c389e[_0x27b3('0x45')]['id']}})['then'](handleEntityNotFound(_0x37f5f6,null))['then'](saveUpdates(_0x4c389e[_0x27b3('0x4b')],null))[_0x27b3('0x25')](respondWithResult(_0x37f5f6,null))['catch'](handleError(_0x37f5f6,null));};exports[_0x27b3('0x26')]=function(_0x33428f,_0x43af38){return db[_0x27b3('0x2c')][_0x27b3('0x47')]({'where':{'id':_0x33428f[_0x27b3('0x45')]['id']}})['then'](handleEntityNotFound(_0x43af38,null))['then'](removeEntity(_0x43af38,null))['catch'](handleError(_0x43af38,null));};exports['describe']=function(_0x5a086b,_0x28cec0){return db[_0x27b3('0x2c')]['describe']()['then'](respondWithResult(_0x28cec0,null))[_0x27b3('0x48')](handleError(_0x28cec0,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 77e1e15..1baf931 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d50=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','path','./squareReportDetail.attributes','exports'];(function(_0x1d5370,_0x363f29){var _0x24e2e1=function(_0x4c6ce7){while(--_0x4c6ce7){_0x1d5370['push'](_0x1d5370['shift']());}};_0x24e2e1(++_0x363f29);}(_0x3d50,0x19c));var _0x03d5=function(_0x322435,_0x15e952){_0x322435=_0x322435-0x0;var _0xffa769=_0x3d50[_0x322435];return _0xffa769;};'use strict';var _=require(_0x03d5('0x0'));var util=require(_0x03d5('0x1'));var logger=require(_0x03d5('0x2'))(_0x03d5('0x3'));var moment=require(_0x03d5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x03d5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x03d5('0x6'));module[_0x03d5('0x7')]=function(_0xf097e5,_0x1bea03){return _0xf097e5['define'](_0x03d5('0x8'),attributes,{'tableName':_0x03d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a1c=['path','rimraf','../../config/environment','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8a1c,0x13f));var _0xc8a1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8a1c[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xc8a1('0x0'));var util=require(_0xc8a1('0x1'));var logger=require(_0xc8a1('0x2'))(_0xc8a1('0x3'));var moment=require('moment');var BPromise=require(_0xc8a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8a1('0x5'));var rimraf=require(_0xc8a1('0x6'));var config=require(_0xc8a1('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0xc8a1('0x8')]=function(_0x180639,_0x5e298c){return _0x180639[_0xc8a1('0x9')](_0xc8a1('0xa'),attributes,{'tableName':_0xc8a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 0875cd9..d6d6b5c 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareDetailsReport'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x5c00,0x17e));var _0x05c0=function(_0x172298,_0x542449){_0x172298=_0x172298-0x0;var _0x44856d=_0x5c00[_0x172298];return _0x44856d;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}exports[_0x05c0('0x16')]=function(_0x521cbd){var _0x422401=this;return new Promise(function(_0x1230e5,_0x4613c0){return db['SquareDetailsReport'][_0x05c0('0x17')](_0x521cbd[_0x05c0('0x18')],{'raw':_0x521cbd[_0x05c0('0x19')]?_0x521cbd[_0x05c0('0x19')][_0x05c0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x407c1f){logger[_0x05c0('0xc')]('CreateSquareDetailsReport',_0x521cbd);logger['debug']('CreateSquareDetailsReport',_0x521cbd,JSON[_0x05c0('0x10')](_0x407c1f));_0x1230e5(_0x407c1f);})[_0x05c0('0x15')](function(_0x83f29){logger[_0x05c0('0x11')](_0x05c0('0x16'),_0x83f29[_0x05c0('0x13')],_0x521cbd);_0x4613c0(_0x422401[_0x05c0('0x11')](0x1f4,_0x83f29['message']));});});}; \ No newline at end of file +var _0xea28=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','debug','lodash','util','moment','bluebird','randomstring'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xea28,0x13a));var _0x8ea2=function(_0x37288f,_0x370d31){_0x37288f=_0x37288f-0x0;var _0xb8f198=_0xea28[_0x37288f];return _0xb8f198;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}exports[_0x8ea2('0x17')]=function(_0x1b64cf){var _0x174ef2=this;return new Promise(function(_0x467045,_0x2a0329){return db[_0x8ea2('0x18')][_0x8ea2('0x19')](_0x1b64cf[_0x8ea2('0x1a')],{'raw':_0x1b64cf[_0x8ea2('0x1b')]?_0x1b64cf['options']['raw']===undefined?!![]:![]:!![]})[_0x8ea2('0xd')](function(_0x248c18){logger[_0x8ea2('0xe')]('CreateSquareDetailsReport',_0x1b64cf);logger[_0x8ea2('0x1c')](_0x8ea2('0x17'),_0x1b64cf,JSON['stringify'](_0x248c18));_0x467045(_0x248c18);})[_0x8ea2('0x16')](function(_0x283f00){logger[_0x8ea2('0x12')](_0x8ea2('0x17'),_0x283f00[_0x8ea2('0x14')],_0x1b64cf);_0x2a0329(_0x174ef2[_0x8ea2('0x12')](0x1f4,_0x283f00[_0x8ea2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 11e2e95..c986d7e 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa18f=['index','killProcess','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x745e75,_0x2bf2a9){var _0x2138af=function(_0x24bba6){while(--_0x24bba6){_0x745e75['push'](_0x745e75['shift']());}};_0x2138af(++_0x2bf2a9);}(_0xa18f,0x152));var _0xfa18=function(_0x16a995,_0x48680b){_0x16a995=_0x16a995-0x0;var _0x59f77a=_0xa18f[_0x16a995];return _0x59f77a;};'use strict';var express=require(_0xfa18('0x0'));var router=express[_0xfa18('0x1')]();var auth=require(_0xfa18('0x2'));var controller=require(_0xfa18('0x3'));router['get']('/',auth[_0xfa18('0x4')](),controller[_0xfa18('0x5')]);router['get']('/process/:pid/kill',auth['isAuthenticated'](),controller[_0xfa18('0x6')]);module['exports']=router; \ No newline at end of file +var _0x4135=['express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','killProcess'];(function(_0x50d9c1,_0x14f696){var _0x2e3e1c=function(_0xda6bf2){while(--_0xda6bf2){_0x50d9c1['push'](_0x50d9c1['shift']());}};_0x2e3e1c(++_0x14f696);}(_0x4135,0xd0));var _0x5413=function(_0x5ad966,_0x635bc3){_0x5ad966=_0x5ad966-0x0;var _0x2988b6=_0x4135[_0x5ad966];return _0x2988b6;};'use strict';var express=require(_0x5413('0x0'));var router=express[_0x5413('0x1')]();var auth=require(_0x5413('0x2'));var controller=require(_0x5413('0x3'));router[_0x5413('0x4')]('/',auth['isAuthenticated'](),controller[_0x5413('0x5')]);router['get'](_0x5413('0x6'),auth['isAuthenticated'](),controller[_0x5413('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f8bedfb..ae2d41e 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cc4=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','getAllData','then','status','json','catch','killProcess','components/import/cm','format','params','pid','length','indexOf'];(function(_0x336f35,_0xaffa7e){var _0x59cda2=function(_0x197526){while(--_0x197526){_0x336f35['push'](_0x336f35['shift']());}};_0x59cda2(++_0xaffa7e);}(_0x9cc4,0x154));var _0x49cc=function(_0x1a8f46,_0x10eebc){_0x1a8f46=_0x1a8f46-0x0;var _0x296e1d=_0x9cc4[_0x1a8f46];return _0x296e1d;};'use strict';var info=require(_0x49cc('0x0'));var exec=require(_0x49cc('0x1'))[_0x49cc('0x2')];var logger=require(_0x49cc('0x3'))(_0x49cc('0x4'));var util=require('util');var BPromise=require(_0x49cc('0x5'));var _=require(_0x49cc('0x6'));function handleError(_0x564e30,_0x31436e,_0x28ce1c){_0x31436e=_0x31436e||0x1f4;return function(_0x1a1551){logger[_0x49cc('0x7')](_0x49cc('0x8'),_0x28ce1c,_0x31436e,util[_0x49cc('0x9')](_0x1a1551,{'showHidden':![],'depth':null}));delete _0x1a1551[_0x49cc('0xa')];_0x564e30['status'](_0x31436e)[_0x49cc('0xb')](_0x1a1551);};}exports['index']=function(_0x52948a,_0x22265c){return info[_0x49cc('0xc')]()[_0x49cc('0xd')](function(_0x3ad4f3){return _0x22265c[_0x49cc('0xe')](0xc8)[_0x49cc('0xf')](_0x3ad4f3);})[_0x49cc('0x10')](function(_0x66a12f){return _0x22265c[_0x49cc('0xe')](0x1f4)[_0x49cc('0xf')](_0x66a12f);});};exports[_0x49cc('0x11')]=function(_0xf8cac2,_0x213a52){var _0x860c95=[_0x49cc('0x12')];return new BPromise(function(_0x38a84d,_0x373cfb){return exec(util[_0x49cc('0x13')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xf8cac2[_0x49cc('0x14')][_0x49cc('0x15')]),function(_0x30338e,_0x5161fd,_0x495412){if(_0x30338e){return _0x373cfb(_0x30338e);}return _0x38a84d(_0x5161fd);});})[_0x49cc('0xd')](function(_0x294e3a){var _0x544dc=![];var _0x5e33fd=_0x294e3a['split'](/\n/);for(var _0x45f47c=0x0,_0x498385=_0x860c95[_0x49cc('0x16')];_0x45f47c<_0x498385,_0x544dc===![];_0x45f47c+=0x1){if(_0x294e3a[_0x49cc('0x17')](_0x860c95[_0x45f47c])>=0x0){_0x544dc=!![];}}if(!_0x544dc){throw new Error(util[_0x49cc('0x13')](_0x49cc('0x18'),_0xf8cac2['params'][_0x49cc('0x15')]));}process[_0x49cc('0x19')](_0xf8cac2['params'][_0x49cc('0x15')],_0x49cc('0x1a'));return _0x213a52[_0x49cc('0xe')](0xc8)['json']({'message':util[_0x49cc('0x13')](_0x49cc('0x1b'),_0xf8cac2['params'][_0x49cc('0x15')])});})['catch'](handleError(_0x213a52,null,_0x49cc('0x11')));}; \ No newline at end of file +var _0x7879=['pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','util','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x3edebb,_0x24270c){var _0x403888=function(_0x56b314){while(--_0x56b314){_0x3edebb['push'](_0x3edebb['shift']());}};_0x403888(++_0x24270c);}(_0x7879,0x73));var _0x9787=function(_0xe6f1ba,_0x5770ab){_0xe6f1ba=_0xe6f1ba-0x0;var _0x131e8b=_0x7879[_0xe6f1ba];return _0x131e8b;};'use strict';var info=require(_0x9787('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x9787('0x1'))('api');var util=require(_0x9787('0x2'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x4e2463,_0x15aef4,_0x3107ee){_0x15aef4=_0x15aef4||0x1f4;return function(_0x2d6992){logger['error'](_0x9787('0x3'),_0x3107ee,_0x15aef4,util[_0x9787('0x4')](_0x2d6992,{'showHidden':![],'depth':null}));delete _0x2d6992[_0x9787('0x5')];_0x4e2463[_0x9787('0x6')](_0x15aef4)[_0x9787('0x7')](_0x2d6992);};}exports[_0x9787('0x8')]=function(_0x5989dc,_0x2e3c6b){return info[_0x9787('0x9')]()[_0x9787('0xa')](function(_0x2bdab9){return _0x2e3c6b[_0x9787('0x6')](0xc8)['json'](_0x2bdab9);})[_0x9787('0xb')](function(_0x50f09d){return _0x2e3c6b[_0x9787('0x6')](0x1f4)['json'](_0x50f09d);});};exports[_0x9787('0xc')]=function(_0x59f9f0,_0x381ca3){var _0xaf251d=[_0x9787('0xd')];return new BPromise(function(_0x4394e6,_0x19c91b){return exec(util[_0x9787('0xe')](_0x9787('0xf'),_0x59f9f0[_0x9787('0x10')][_0x9787('0x11')]),function(_0x261b9f,_0x24a793,_0x4ab31b){if(_0x261b9f){return _0x19c91b(_0x261b9f);}return _0x4394e6(_0x24a793);});})[_0x9787('0xa')](function(_0x1f66b0){var _0x82e909=![];var _0x1195d5=_0x1f66b0['split'](/\n/);for(var _0xfb9403=0x0,_0x5d5165=_0xaf251d[_0x9787('0x12')];_0xfb9403<_0x5d5165,_0x82e909===![];_0xfb9403+=0x1){if(_0x1f66b0['indexOf'](_0xaf251d[_0xfb9403])>=0x0){_0x82e909=!![];}}if(!_0x82e909){throw new Error(util[_0x9787('0xe')](_0x9787('0x13'),_0x59f9f0[_0x9787('0x10')]['pid']));}process['kill'](_0x59f9f0[_0x9787('0x10')][_0x9787('0x11')],_0x9787('0x14'));return _0x381ca3[_0x9787('0x6')](0xc8)['json']({'message':util['format'](_0x9787('0x15'),_0x59f9f0[_0x9787('0x10')][_0x9787('0x11')])});})['catch'](handleError(_0x381ca3,null,_0x9787('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index ca14486..05bf84f 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd6f=['show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','get'];(function(_0x2b8234,_0x32b33a){var _0x5c3001=function(_0x4d527b){while(--_0x4d527b){_0x2b8234['push'](_0x2b8234['shift']());}};_0x5c3001(++_0x32b33a);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x405fe8,_0xa55e2f){_0x405fe8=_0x405fe8-0x0;var _0x50e490=_0xcd6f[_0x405fe8];return _0x50e490;};'use strict';var multer=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var path=require(_0xfcd6('0x2'));var timeout=require(_0xfcd6('0x3'));var express=require(_0xfcd6('0x4'));var router=express[_0xfcd6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfcd6('0x6'));var interaction=require(_0xfcd6('0x7'));var config=require(_0xfcd6('0x8'));var controller=require(_0xfcd6('0x9'));router['get']('/',auth[_0xfcd6('0xa')](),controller['index']);router[_0xfcd6('0xb')]('/:id',auth[_0xfcd6('0xa')](),controller[_0xfcd6('0xc')]);router['post']('/',auth[_0xfcd6('0xa')](),controller['create']);router[_0xfcd6('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfcd6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfcd6('0xf')]);module[_0xfcd6('0x10')]=router; \ No newline at end of file +var _0x3e5b=['put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0x3e5b,0x1e9));var _0xb3e5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3e5b[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xb3e5('0x0'));var path=require(_0xb3e5('0x1'));var timeout=require(_0xb3e5('0x2'));var express=require(_0xb3e5('0x3'));var router=express['Router']();var fs_extra=require(_0xb3e5('0x4'));var auth=require(_0xb3e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3e5('0x6'));var controller=require(_0xb3e5('0x7'));router['get']('/',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x9')]);router[_0xb3e5('0xa')](_0xb3e5('0xb'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0xc')]);router[_0xb3e5('0xd')]('/',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0xe')]);router[_0xb3e5('0xf')]('/:id',auth[_0xb3e5('0x8')](),controller['update']);router['delete'](_0xb3e5('0xb'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x10')]);module[_0xb3e5('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d42cf1a..ba8ea09 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ffe=['STRING','#0091EA','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4ffe,0x172));var _0xe4ff=function(_0x493df0,_0x3808fe){_0x493df0=_0x493df0-0x0;var _0x4b6a03=_0x4ffe[_0x493df0];return _0x4b6a03;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe4ff('0x2')],'defaultValue':_0xe4ff('0x3')},'description':{'type':Sequelize[_0xe4ff('0x2')]}}; \ No newline at end of file +var _0xb9be=['name','#0091EA','sequelize','exports','STRING'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0xb9be,0xc5));var _0xeb9b=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0xb9be[_0x2f3ecd];return _0xffdc44;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'name':{'type':Sequelize[_0xeb9b('0x2')],'unique':_0xeb9b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':_0xeb9b('0x4')},'description':{'type':Sequelize[_0xeb9b('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 5a7c5a6..cae26ae 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Tag','includeAll','include','findAll','rows','catch','params','find','create','body','role','UserProfileResource','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','Tags','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xd0bb[_0x41bdd4];return _0x5c03a6;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){var _0x4b0924=_0x58a721[_0xbd0b('0x26')]({'plain':!![]});var _0xfd9f82=_0xbd0b('0x27');return db['UserProfileResource'][_0xbd0b('0x25')]({'where':{'type':_0xfd9f82,'resourceId':_0x4b0924['id']}})[_0xbd0b('0x24')](function(){return _0x58a721;});})[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0x122893,_0x47f6f5){return function(_0x149403){if(!_0x149403){_0x122893[_0xbd0b('0x17')](0x194);}return _0x149403;};}function handleError(_0x82d326,_0x4f877a){_0x4f877a=_0x4f877a||0x1f4;return function(_0x4dfe76){logger[_0xbd0b('0x28')](_0x4dfe76[_0xbd0b('0x29')]);if(_0x4dfe76[_0xbd0b('0x2a')]){delete _0x4dfe76[_0xbd0b('0x2a')];}_0x82d326[_0xbd0b('0x18')](_0x4f877a)[_0xbd0b('0x2b')](_0x4dfe76);};}exports[_0xbd0b('0x2c')]=function(_0x4bc752,_0x45f7d6){var _0x3b70b4={},_0x5e1cb3={},_0x5e5e69={'count':0x0,'rows':[]};var _0x206c6a=_[_0xbd0b('0x2d')](db['Tag'][_0xbd0b('0x2e')],function(_0x2f7d61){return{'name':_0x2f7d61[_0xbd0b('0x2f')],'type':_0x2f7d61[_0xbd0b('0x30')][_0xbd0b('0x31')]};});_0x5e1cb3[_0xbd0b('0x32')]=_['map'](_0x206c6a,_0xbd0b('0x2a'));_0x5e1cb3[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x4bc752[_0xbd0b('0x33')]);_0x5e1cb3[_0xbd0b('0x35')]=_[_0xbd0b('0x36')](_0x5e1cb3[_0xbd0b('0x32')],_0x5e1cb3[_0xbd0b('0x33')]);_0x3b70b4[_0xbd0b('0x37')]=_[_0xbd0b('0x36')](_0x5e1cb3[_0xbd0b('0x32')],qs[_0xbd0b('0x38')](_0x4bc752[_0xbd0b('0x33')][_0xbd0b('0x38')]));_0x3b70b4['attributes']=_0x3b70b4[_0xbd0b('0x37')][_0xbd0b('0x39')]?_0x3b70b4['attributes']:_0x5e1cb3[_0xbd0b('0x32')];if(!_0x4bc752[_0xbd0b('0x33')][_0xbd0b('0x3a')](_0xbd0b('0x3b'))){_0x3b70b4[_0xbd0b('0x1d')]=qs[_0xbd0b('0x1d')](_0x4bc752['query'][_0xbd0b('0x1d')]);_0x3b70b4[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4bc752[_0xbd0b('0x33')][_0xbd0b('0x1a')]);}_0x3b70b4['order']=qs['sort'](_0x4bc752[_0xbd0b('0x33')][_0xbd0b('0x3c')]);_0x3b70b4[_0xbd0b('0x3d')]=qs[_0xbd0b('0x35')](_['pick'](_0x4bc752['query'],_0x5e1cb3[_0xbd0b('0x35')]),_0x206c6a);if(_0x4bc752['query'][_0xbd0b('0x3e')]){_0x3b70b4[_0xbd0b('0x3d')]=_[_0xbd0b('0x3f')](_0x3b70b4[_0xbd0b('0x3d')],{'$or':_[_0xbd0b('0x2d')](_0x206c6a,function(_0x1f48ba){if(_0x1f48ba[_0xbd0b('0x30')]!==_0xbd0b('0x40')){var _0x2acc9f={};_0x2acc9f[_0x1f48ba[_0xbd0b('0x2a')]]={'$like':'%'+_0x4bc752[_0xbd0b('0x33')][_0xbd0b('0x3e')]+'%'};return _0x2acc9f;}})});}_0x3b70b4=_[_0xbd0b('0x3f')]({},_0x3b70b4,_0x4bc752[_0xbd0b('0x41')]);var _0x11b1a0={'where':_0x3b70b4[_0xbd0b('0x3d')]};return db[_0xbd0b('0x42')][_0xbd0b('0x1c')](_0x11b1a0)['then'](function(_0x32bde9){_0x5e5e69[_0xbd0b('0x1c')]=_0x32bde9;if(_0x4bc752[_0xbd0b('0x33')][_0xbd0b('0x43')]){_0x3b70b4[_0xbd0b('0x44')]=[{'all':!![]}];}return db[_0xbd0b('0x42')][_0xbd0b('0x45')](_0x3b70b4);})[_0xbd0b('0x24')](function(_0x2a1a1d){_0x5e5e69[_0xbd0b('0x46')]=_0x2a1a1d;return _0x5e5e69;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x45f7d6,_0x3b70b4))[_0xbd0b('0x47')](handleError(_0x45f7d6,null));};exports['show']=function(_0x4023c4,_0x49ad96){var _0x5dc0b3={'raw':!![],'where':{'id':_0x4023c4[_0xbd0b('0x48')]['id']}},_0x1fe06e={};_0x1fe06e[_0xbd0b('0x32')]=_['keys'](db[_0xbd0b('0x42')][_0xbd0b('0x2e')]);_0x1fe06e[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x4023c4[_0xbd0b('0x33')]);_0x1fe06e['filters']=_[_0xbd0b('0x36')](_0x1fe06e[_0xbd0b('0x32')],_0x1fe06e[_0xbd0b('0x33')]);_0x5dc0b3[_0xbd0b('0x37')]=_[_0xbd0b('0x36')](_0x1fe06e[_0xbd0b('0x32')],qs['fields'](_0x4023c4[_0xbd0b('0x33')][_0xbd0b('0x38')]));_0x5dc0b3[_0xbd0b('0x37')]=_0x5dc0b3[_0xbd0b('0x37')][_0xbd0b('0x39')]?_0x5dc0b3[_0xbd0b('0x37')]:_0x1fe06e[_0xbd0b('0x32')];if(_0x4023c4[_0xbd0b('0x33')][_0xbd0b('0x43')]){_0x5dc0b3[_0xbd0b('0x44')]=[{'all':!![]}];}_0x5dc0b3=_[_0xbd0b('0x3f')]({},_0x5dc0b3,_0x4023c4[_0xbd0b('0x41')]);return db[_0xbd0b('0x42')][_0xbd0b('0x49')](_0x5dc0b3)[_0xbd0b('0x24')](handleEntityNotFound(_0x49ad96,null))[_0xbd0b('0x24')](respondWithResult(_0x49ad96,null))[_0xbd0b('0x47')](handleError(_0x49ad96,null));};exports[_0xbd0b('0x4a')]=function(_0x3d40fc,_0x2ed890){return db[_0xbd0b('0x42')][_0xbd0b('0x4a')](_0x3d40fc[_0xbd0b('0x4b')],{})['then'](function(_0x12d3e7){var _0x1c13da=_0x3d40fc['user']['get']({'plain':!![]});if(!_0x1c13da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c13da[_0xbd0b('0x4c')]==='user'){var _0x1b9c00=_0x12d3e7[_0xbd0b('0x26')]({'plain':!![]});var _0xa97987=_0xbd0b('0x27');return db['UserProfileSection'][_0xbd0b('0x49')]({'where':{'name':_0xa97987,'userProfileId':_0x1c13da['userProfileId']},'raw':!![]})[_0xbd0b('0x24')](function(_0x5c5d9d){if(_0x5c5d9d&&_0x5c5d9d['autoAssociation']===0x0){return db[_0xbd0b('0x4d')][_0xbd0b('0x4a')]({'name':_0x1b9c00[_0xbd0b('0x2a')],'resourceId':_0x1b9c00['id'],'type':_0x5c5d9d[_0xbd0b('0x2a')],'sectionId':_0x5c5d9d['id']},{})[_0xbd0b('0x24')](function(){return _0x12d3e7;});}else{return _0x12d3e7;}})[_0xbd0b('0x47')](function(_0x319ace){logger[_0xbd0b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x319ace);throw _0x319ace;});}return _0x12d3e7;})['then'](respondWithResult(_0x2ed890,0xc9))[_0xbd0b('0x47')](handleError(_0x2ed890,null));};exports[_0xbd0b('0x23')]=function(_0x5094bd,_0x514985){if(_0x5094bd[_0xbd0b('0x4b')]['id']){delete _0x5094bd[_0xbd0b('0x4b')]['id'];}return db[_0xbd0b('0x42')][_0xbd0b('0x49')]({'where':{'id':_0x5094bd['params']['id']}})[_0xbd0b('0x24')](handleEntityNotFound(_0x514985,null))[_0xbd0b('0x24')](saveUpdates(_0x5094bd[_0xbd0b('0x4b')],null))[_0xbd0b('0x24')](respondWithResult(_0x514985,null))['catch'](handleError(_0x514985,null));};exports[_0xbd0b('0x25')]=function(_0x3c62c4,_0x4bd549){return db[_0xbd0b('0x42')][_0xbd0b('0x49')]({'where':{'id':_0x3c62c4[_0xbd0b('0x48')]['id']}})[_0xbd0b('0x24')](handleEntityNotFound(_0x4bd549,null))[_0xbd0b('0x24')](removeEntity(_0x4bd549,null))[_0xbd0b('0x47')](handleError(_0x4bd549,null));}; \ No newline at end of file +var _0xa588=['apply','reject','save','update','then','destroy','get','Tags','sendStatus','error','index','map','Tag','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','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','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x56de2e,_0x1e9fdd){var _0x51c2f5=function(_0x4d8d1c){while(--_0x4d8d1c){_0x56de2e['push'](_0x56de2e['shift']());}};_0x51c2f5(++_0x1e9fdd);}(_0xa588,0xe1));var _0x8a58=function(_0x1d2b08,_0x3a430f){_0x1d2b08=_0x1d2b08-0x0;var _0x41d019=_0xa588[_0x1d2b08];return _0x41d019;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a58('0x0'));var zipdir=require(_0x8a58('0x1'));var jsonpatch=require(_0x8a58('0x2'));var rp=require(_0x8a58('0x3'));var moment=require(_0x8a58('0x4'));var BPromise=require(_0x8a58('0x5'));var Mustache=require(_0x8a58('0x6'));var util=require(_0x8a58('0x7'));var path=require(_0x8a58('0x8'));var sox=require('sox');var csv=require(_0x8a58('0x9'));var ejs=require(_0x8a58('0xa'));var fs=require('fs');var fs_extra=require(_0x8a58('0xb'));var _=require(_0x8a58('0xc'));var squel=require(_0x8a58('0xd'));var crypto=require(_0x8a58('0xe'));var jsforce=require(_0x8a58('0xf'));var deskjs=require(_0x8a58('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a58('0x11'));var Papa=require(_0x8a58('0x12'));var Redis=require(_0x8a58('0x13'));var authService=require(_0x8a58('0x14'));var qs=require(_0x8a58('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a58('0x16'));var logger=require(_0x8a58('0x17'))(_0x8a58('0x18'));var utils=require(_0x8a58('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a58('0x1a'))['db'];function respondWithStatusCode(_0x5ec103,_0x21208d){_0x21208d=_0x21208d||0xcc;return function(_0xc5d2fa){if(_0xc5d2fa){return _0x5ec103['sendStatus'](_0x21208d);}return _0x5ec103[_0x8a58('0x1b')](_0x21208d)[_0x8a58('0x1c')]();};}function respondWithResult(_0x56a61d,_0x3d40a5){_0x3d40a5=_0x3d40a5||0xc8;return function(_0x268506){if(_0x268506){return _0x56a61d['status'](_0x3d40a5)[_0x8a58('0x1d')](_0x268506);}};}function respondWithFilteredResult(_0x18a33c,_0x3010ae){return function(_0x3ff39e){if(_0x3ff39e){var _0x26e3a8=typeof _0x3010ae[_0x8a58('0x1e')]===_0x8a58('0x1f')&&typeof _0x3010ae['limit']==='undefined';var _0x31de8d=_0x3ff39e[_0x8a58('0x20')];var _0x18a14d=_0x26e3a8?0x0:_0x3010ae['offset'];var _0x282f2d=_0x26e3a8?_0x3ff39e[_0x8a58('0x20')]:_0x3010ae['offset']+_0x3010ae[_0x8a58('0x21')];var _0x15b527;if(_0x282f2d>=_0x31de8d){_0x282f2d=_0x31de8d;_0x15b527=0xc8;}else{_0x15b527=0xce;}_0x18a33c[_0x8a58('0x1b')](_0x15b527);return _0x18a33c[_0x8a58('0x22')](_0x8a58('0x23'),_0x18a14d+'-'+_0x282f2d+'/'+_0x31de8d)[_0x8a58('0x1d')](_0x3ff39e);}return null;};}function patchUpdates(_0x284bb8){return function(_0x115e19){try{jsonpatch[_0x8a58('0x24')](_0x115e19,_0x284bb8,!![]);}catch(_0xbf556a){return BPromise[_0x8a58('0x25')](_0xbf556a);}return _0x115e19[_0x8a58('0x26')]();};}function saveUpdates(_0x3758fa,_0x34adb8){return function(_0x561a9a){if(_0x561a9a){return _0x561a9a[_0x8a58('0x27')](_0x3758fa)[_0x8a58('0x28')](function(_0x20a6c5){return _0x20a6c5;});}return null;};}function removeEntity(_0x3f07ab,_0x22c898){return function(_0x415946){if(_0x415946){return _0x415946[_0x8a58('0x29')]()['then'](function(){var _0x1ff181=_0x415946[_0x8a58('0x2a')]({'plain':!![]});var _0x30c96b=_0x8a58('0x2b');return db['UserProfileResource'][_0x8a58('0x29')]({'where':{'type':_0x30c96b,'resourceId':_0x1ff181['id']}})[_0x8a58('0x28')](function(){return _0x415946;});})[_0x8a58('0x28')](function(){_0x3f07ab['status'](0xcc)[_0x8a58('0x1c')]();});}};}function handleEntityNotFound(_0x31abcc,_0x4426ff){return function(_0x27d7c8){if(!_0x27d7c8){_0x31abcc[_0x8a58('0x2c')](0x194);}return _0x27d7c8;};}function handleError(_0x3e317f,_0x1a411a){_0x1a411a=_0x1a411a||0x1f4;return function(_0x4d5041){logger[_0x8a58('0x2d')](_0x4d5041['stack']);if(_0x4d5041['name']){delete _0x4d5041['name'];}_0x3e317f['status'](_0x1a411a)['send'](_0x4d5041);};}exports[_0x8a58('0x2e')]=function(_0x175235,_0x1b2d9e){var _0x205b41={},_0x5dc010={},_0x261096={'count':0x0,'rows':[]};var _0x2a20ad=_[_0x8a58('0x2f')](db[_0x8a58('0x30')][_0x8a58('0x31')],function(_0x8ab99c){return{'name':_0x8ab99c[_0x8a58('0x32')],'type':_0x8ab99c[_0x8a58('0x33')]['key']};});_0x5dc010[_0x8a58('0x34')]=_[_0x8a58('0x2f')](_0x2a20ad,_0x8a58('0x35'));_0x5dc010[_0x8a58('0x36')]=_[_0x8a58('0x37')](_0x175235[_0x8a58('0x36')]);_0x5dc010['filters']=_[_0x8a58('0x38')](_0x5dc010[_0x8a58('0x34')],_0x5dc010[_0x8a58('0x36')]);_0x205b41[_0x8a58('0x39')]=_[_0x8a58('0x38')](_0x5dc010[_0x8a58('0x34')],qs[_0x8a58('0x3a')](_0x175235['query'][_0x8a58('0x3a')]));_0x205b41[_0x8a58('0x39')]=_0x205b41[_0x8a58('0x39')]['length']?_0x205b41['attributes']:_0x5dc010['model'];if(!_0x175235[_0x8a58('0x36')][_0x8a58('0x3b')](_0x8a58('0x3c'))){_0x205b41[_0x8a58('0x21')]=qs['limit'](_0x175235[_0x8a58('0x36')][_0x8a58('0x21')]);_0x205b41[_0x8a58('0x1e')]=qs[_0x8a58('0x1e')](_0x175235['query'][_0x8a58('0x1e')]);}_0x205b41[_0x8a58('0x3d')]=qs['sort'](_0x175235[_0x8a58('0x36')][_0x8a58('0x3e')]);_0x205b41[_0x8a58('0x3f')]=qs[_0x8a58('0x40')](_[_0x8a58('0x41')](_0x175235[_0x8a58('0x36')],_0x5dc010['filters']),_0x2a20ad);if(_0x175235['query'][_0x8a58('0x42')]){_0x205b41[_0x8a58('0x3f')]=_['merge'](_0x205b41[_0x8a58('0x3f')],{'$or':_[_0x8a58('0x2f')](_0x2a20ad,function(_0x478454){if(_0x478454[_0x8a58('0x33')]!==_0x8a58('0x43')){var _0x4e9e04={};_0x4e9e04[_0x478454[_0x8a58('0x35')]]={'$like':'%'+_0x175235['query'][_0x8a58('0x42')]+'%'};return _0x4e9e04;}})});}_0x205b41=_[_0x8a58('0x44')]({},_0x205b41,_0x175235[_0x8a58('0x45')]);var _0x40ca09={'where':_0x205b41[_0x8a58('0x3f')]};return db[_0x8a58('0x30')][_0x8a58('0x20')](_0x40ca09)['then'](function(_0x5cd9d8){_0x261096[_0x8a58('0x20')]=_0x5cd9d8;if(_0x175235['query']['includeAll']){_0x205b41[_0x8a58('0x46')]=[{'all':!![]}];}return db[_0x8a58('0x30')][_0x8a58('0x47')](_0x205b41);})['then'](function(_0x56a410){_0x261096[_0x8a58('0x48')]=_0x56a410;return _0x261096;})['then'](respondWithFilteredResult(_0x1b2d9e,_0x205b41))[_0x8a58('0x49')](handleError(_0x1b2d9e,null));};exports[_0x8a58('0x4a')]=function(_0x3feec0,_0x3faae2){var _0x4c9c56={'raw':!![],'where':{'id':_0x3feec0[_0x8a58('0x4b')]['id']}},_0x417951={};_0x417951['model']=_[_0x8a58('0x37')](db[_0x8a58('0x30')][_0x8a58('0x31')]);_0x417951[_0x8a58('0x36')]=_['keys'](_0x3feec0[_0x8a58('0x36')]);_0x417951['filters']=_[_0x8a58('0x38')](_0x417951[_0x8a58('0x34')],_0x417951['query']);_0x4c9c56[_0x8a58('0x39')]=_['intersection'](_0x417951['model'],qs[_0x8a58('0x3a')](_0x3feec0[_0x8a58('0x36')][_0x8a58('0x3a')]));_0x4c9c56[_0x8a58('0x39')]=_0x4c9c56[_0x8a58('0x39')][_0x8a58('0x4c')]?_0x4c9c56['attributes']:_0x417951['model'];if(_0x3feec0[_0x8a58('0x36')][_0x8a58('0x4d')]){_0x4c9c56[_0x8a58('0x46')]=[{'all':!![]}];}_0x4c9c56=_[_0x8a58('0x44')]({},_0x4c9c56,_0x3feec0[_0x8a58('0x45')]);return db[_0x8a58('0x30')][_0x8a58('0x4e')](_0x4c9c56)[_0x8a58('0x28')](handleEntityNotFound(_0x3faae2,null))[_0x8a58('0x28')](respondWithResult(_0x3faae2,null))[_0x8a58('0x49')](handleError(_0x3faae2,null));};exports[_0x8a58('0x4f')]=function(_0x392c32,_0x1ea824){return db[_0x8a58('0x30')]['create'](_0x392c32[_0x8a58('0x50')],{})[_0x8a58('0x28')](function(_0xeb5231){var _0x409f9e=_0x392c32[_0x8a58('0x51')][_0x8a58('0x2a')]({'plain':!![]});if(!_0x409f9e)throw new Error(_0x8a58('0x52'));if(_0x409f9e['role']==='user'){var _0x5ab682=_0xeb5231[_0x8a58('0x2a')]({'plain':!![]});var _0xe0ed75=_0x8a58('0x2b');return db['UserProfileSection'][_0x8a58('0x4e')]({'where':{'name':_0xe0ed75,'userProfileId':_0x409f9e[_0x8a58('0x53')]},'raw':!![]})[_0x8a58('0x28')](function(_0x3ad78c){if(_0x3ad78c&&_0x3ad78c[_0x8a58('0x54')]===0x0){return db[_0x8a58('0x55')][_0x8a58('0x4f')]({'name':_0x5ab682[_0x8a58('0x35')],'resourceId':_0x5ab682['id'],'type':_0x3ad78c[_0x8a58('0x35')],'sectionId':_0x3ad78c['id']},{})[_0x8a58('0x28')](function(){return _0xeb5231;});}else{return _0xeb5231;}})[_0x8a58('0x49')](function(_0x130406){logger['error'](_0x8a58('0x56'),_0x130406);throw _0x130406;});}return _0xeb5231;})[_0x8a58('0x28')](respondWithResult(_0x1ea824,0xc9))['catch'](handleError(_0x1ea824,null));};exports[_0x8a58('0x27')]=function(_0xfab1e4,_0x1ce5e0){if(_0xfab1e4['body']['id']){delete _0xfab1e4[_0x8a58('0x50')]['id'];}return db['Tag'][_0x8a58('0x4e')]({'where':{'id':_0xfab1e4[_0x8a58('0x4b')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x1ce5e0,null))[_0x8a58('0x28')](saveUpdates(_0xfab1e4[_0x8a58('0x50')],null))[_0x8a58('0x28')](respondWithResult(_0x1ce5e0,null))[_0x8a58('0x49')](handleError(_0x1ce5e0,null));};exports[_0x8a58('0x29')]=function(_0x2c4a18,_0x53fbde){return db[_0x8a58('0x30')][_0x8a58('0x4e')]({'where':{'id':_0x2c4a18[_0x8a58('0x4b')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x53fbde,null))[_0x8a58('0x28')](removeEntity(_0x53fbde,null))['catch'](handleError(_0x53fbde,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index e9aa43a..afd30d2 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0624=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Tag','tools_tags'];(function(_0x3f0553,_0x1ee7d8){var _0x185007=function(_0x47adc1){while(--_0x47adc1){_0x3f0553['push'](_0x3f0553['shift']());}};_0x185007(++_0x1ee7d8);}(_0x0624,0x132));var _0x4062=function(_0xd215b0,_0x209320){_0xd215b0=_0xd215b0-0x0;var _0x35718d=_0x0624[_0xd215b0];return _0x35718d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4062('0x0'));var BPromise=require(_0x4062('0x1'));var rp=require(_0x4062('0x2'));var fs=require('fs');var path=require(_0x4062('0x3'));var rimraf=require(_0x4062('0x4'));var config=require(_0x4062('0x5'));var attributes=require('./tag.attributes');module['exports']=function(_0x353a85,_0x2ec6dd){return _0x353a85[_0x4062('0x6')](_0x4062('0x7'),attributes,{'tableName':_0x4062('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6c1=['exports','define','Tag','tools_tags','lodash','util','moment','request-promise','rimraf','../../config/environment'];(function(_0x19c7a8,_0x10508d){var _0x1462ce=function(_0x33f2c8){while(--_0x33f2c8){_0x19c7a8['push'](_0x19c7a8['shift']());}};_0x1462ce(++_0x10508d);}(_0xe6c1,0x1da));var _0x1e6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe6c1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1e6c('0x0'));var util=require(_0x1e6c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e6c('0x2'));var BPromise=require('bluebird');var rp=require(_0x1e6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e6c('0x4'));var config=require(_0x1e6c('0x5'));var attributes=require('./tag.attributes');module[_0x1e6c('0x6')]=function(_0x24ec5c,_0x3a3e3a){return _0x24ec5c[_0x1e6c('0x7')](_0x1e6c('0x8'),attributes,{'tableName':_0x1e6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 17cb8ba..7d5f52f 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3768e8,_0x4dc649){var _0x5e57a4=function(_0x4f8f5a){while(--_0x4f8f5a){_0x3768e8['push'](_0x3768e8['shift']());}};_0x5e57a4(++_0x4dc649);}(_0x6aa7,0x178));var _0x76aa=function(_0x4e1719,_0x2d563b){_0x4e1719=_0x4e1719-0x0;var _0x35b26a=_0x6aa7[_0x4e1719];return _0x35b26a;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file +var _0xc3b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x2e27dd,_0x550941){var _0x3f6b81=function(_0x260508){while(--_0x260508){_0x2e27dd['push'](_0x2e27dd['shift']());}};_0x3f6b81(++_0x550941);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xc27537,_0x43f170){_0xc27537=_0xc27537-0x0;var _0x13e6da=_0xc3b5[_0xc27537];return _0x13e6da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568a28,_0x30a08f,_0x420839){return new BPromise(function(_0x3892ad,_0x5be9ee){return client[_0x5c3b('0xa')](_0x568a28,_0x420839)[_0x5c3b('0xb')](function(_0x159db5){logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,_0x5c3b('0xd'));logger[_0x5c3b('0xe')](_0x5c3b('0xf'),_0x30a08f,_0x5c3b('0xd'),JSON[_0x5c3b('0x10')](_0x159db5));if(_0x159db5['error']){if(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x12')]===0x1f4){logger['error'](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')]['message']);return _0x5be9ee(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);}logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);return _0x3892ad(_0x159db5[_0x5c3b('0x11')]['message']);}else{logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,'request\x20sent');_0x3892ad(_0x159db5[_0x5c3b('0x15')][_0x5c3b('0x14')]);}})[_0x5c3b('0x16')](function(_0x589797){logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x589797);_0x5be9ee(_0x589797);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 3382739..35e4386 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 7b9d804..4b43082 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x45ccdb,_0x1d440e){var _0x3fed0e=function(_0x46f134){while(--_0x46f134){_0x45ccdb['push'](_0x45ccdb['shift']());}};_0x3fed0e(++_0x1d440e);}(_0x2032,0xd9));var _0x2203=function(_0x56259c,_0x47d3eb){_0x56259c=_0x56259c-0x0;var _0x5440fb=_0x2032[_0x56259c];return _0x5440fb;};'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 _0x0713=['STRING','name'];(function(_0x5f1e6f,_0x12f575){var _0x53deee=function(_0x497669){while(--_0x497669){_0x5f1e6f['push'](_0x5f1e6f['shift']());}};_0x53deee(++_0x12f575);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 0657ca4..17b6791 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39c6=['Unknown\x20channel','capitalize','Queue','order','toLowerCase','Queues','addQueues','ValidationError','add','ids','removeQueues','remove','isArray','Mail','Sms','Fax','Whatsapp','Voice','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','spread','removeAgents','Chat','UserVoicePrefix','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','offset','undefined','limit','count','set','save','update','sendStatus','error','stack','name','send','Team','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','rows','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','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','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x39c6,0x160));var _0x639c=function(_0x4810e3,_0x23527c){_0x4810e3=_0x4810e3-0x0;var _0x45bfc9=_0x39c6[_0x4810e3];return _0x45bfc9;};'use strict';var emlformat=require(_0x639c('0x0'));var rimraf=require(_0x639c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x639c('0x2'));var rp=require(_0x639c('0x3'));var moment=require(_0x639c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x639c('0x5'));var util=require(_0x639c('0x6'));var path=require(_0x639c('0x7'));var sox=require(_0x639c('0x8'));var csv=require(_0x639c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x639c('0xa'));var _=require(_0x639c('0xb'));var squel=require(_0x639c('0xc'));var crypto=require(_0x639c('0xd'));var jsforce=require(_0x639c('0xe'));var deskjs=require(_0x639c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x639c('0x10'));var Papa=require('papaparse');var Redis=require(_0x639c('0x11'));var authService=require(_0x639c('0x12'));var qs=require(_0x639c('0x13'));var as=require(_0x639c('0x14'));var hardwareService=require(_0x639c('0x15'));var logger=require(_0x639c('0x16'))(_0x639c('0x17'));var utils=require(_0x639c('0x18'));var config=require(_0x639c('0x19'));var licenseUtil=require(_0x639c('0x1a'));var db=require(_0x639c('0x1b'))['db'];config[_0x639c('0x1c')]=_[_0x639c('0x1d')](config[_0x639c('0x1c')],{'host':_0x639c('0x1e'),'port':0x18eb});var socket=require(_0x639c('0x1f'))(new Redis(config[_0x639c('0x1c')]));require(_0x639c('0x20'))[_0x639c('0x21')](socket);function respondWithStatusCode(_0x1157ca,_0x4e3c79){_0x4e3c79=_0x4e3c79||0xcc;return function(_0x53123b){if(_0x53123b){return _0x1157ca['sendStatus'](_0x4e3c79);}return _0x1157ca['status'](_0x4e3c79)['end']();};}function respondWithResult(_0x4da85c,_0x3fcacd){_0x3fcacd=_0x3fcacd||0xc8;return function(_0x135ef0){if(_0x135ef0){return _0x4da85c[_0x639c('0x22')](_0x3fcacd)[_0x639c('0x23')](_0x135ef0);}};}function respondWithFilteredResult(_0x4a750a,_0x13e0ef){return function(_0x1f09be){if(_0x1f09be){var _0x29943a=typeof _0x13e0ef[_0x639c('0x24')]===_0x639c('0x25')&&typeof _0x13e0ef[_0x639c('0x26')]===_0x639c('0x25');var _0x47a09a=_0x1f09be[_0x639c('0x27')];var _0x49cd29=_0x29943a?0x0:_0x13e0ef[_0x639c('0x24')];var _0x2c9f1b=_0x29943a?_0x1f09be[_0x639c('0x27')]:_0x13e0ef['offset']+_0x13e0ef[_0x639c('0x26')];var _0x5466c0;if(_0x2c9f1b>=_0x47a09a){_0x2c9f1b=_0x47a09a;_0x5466c0=0xc8;}else{_0x5466c0=0xce;}_0x4a750a[_0x639c('0x22')](_0x5466c0);return _0x4a750a[_0x639c('0x28')]('Content-Range',_0x49cd29+'-'+_0x2c9f1b+'/'+_0x47a09a)[_0x639c('0x23')](_0x1f09be);}return null;};}function patchUpdates(_0x17af67){return function(_0x4650d4){try{jsonpatch['apply'](_0x4650d4,_0x17af67,!![]);}catch(_0x3fb3be){return BPromise['reject'](_0x3fb3be);}return _0x4650d4[_0x639c('0x29')]();};}function saveUpdates(_0x43ba5c,_0x1b4326){return function(_0x45574e){if(_0x45574e){return _0x45574e[_0x639c('0x2a')](_0x43ba5c)['then'](function(_0x539a66){return _0x539a66;});}return null;};}function handleEntityNotFound(_0x215fa3,_0x56b7fa){return function(_0x1c29f7){if(!_0x1c29f7){_0x215fa3[_0x639c('0x2b')](0x194);}return _0x1c29f7;};}function handleError(_0x16631a,_0x37c1de){_0x37c1de=_0x37c1de||0x1f4;return function(_0x390d9b){logger[_0x639c('0x2c')](_0x390d9b[_0x639c('0x2d')]);if(_0x390d9b[_0x639c('0x2e')]){delete _0x390d9b[_0x639c('0x2e')];}_0x16631a[_0x639c('0x22')](_0x37c1de)[_0x639c('0x2f')](_0x390d9b);};}exports['index']=function(_0x4e0c5b,_0x2c61e6){var _0x1f9bc2={},_0x2fdc14={},_0x2fe151={'count':0x0,'rows':[]};var _0x567fca=_['map'](db[_0x639c('0x30')][_0x639c('0x31')],function(_0x2cdfde){return{'name':_0x2cdfde['fieldName'],'type':_0x2cdfde[_0x639c('0x32')][_0x639c('0x33')]};});_0x2fdc14[_0x639c('0x34')]=_[_0x639c('0x35')](_0x567fca,'name');_0x2fdc14['query']=_[_0x639c('0x36')](_0x4e0c5b[_0x639c('0x37')]);_0x2fdc14[_0x639c('0x38')]=_[_0x639c('0x39')](_0x2fdc14['model'],_0x2fdc14[_0x639c('0x37')]);_0x1f9bc2[_0x639c('0x3a')]=_[_0x639c('0x39')](_0x2fdc14['model'],qs['fields'](_0x4e0c5b[_0x639c('0x37')][_0x639c('0x3b')]));_0x1f9bc2[_0x639c('0x3a')]=_0x1f9bc2[_0x639c('0x3a')][_0x639c('0x3c')]?_0x1f9bc2[_0x639c('0x3a')]:_0x2fdc14['model'];if(!_0x4e0c5b[_0x639c('0x37')][_0x639c('0x3d')](_0x639c('0x3e'))){_0x1f9bc2[_0x639c('0x26')]=qs[_0x639c('0x26')](_0x4e0c5b[_0x639c('0x37')][_0x639c('0x26')]);_0x1f9bc2[_0x639c('0x24')]=qs[_0x639c('0x24')](_0x4e0c5b[_0x639c('0x37')][_0x639c('0x24')]);}_0x1f9bc2['order']=qs[_0x639c('0x3f')](_0x4e0c5b['query'][_0x639c('0x3f')]);_0x1f9bc2['where']=qs[_0x639c('0x38')](_[_0x639c('0x40')](_0x4e0c5b[_0x639c('0x37')],_0x2fdc14[_0x639c('0x38')]),_0x567fca);if(_0x4e0c5b['query'][_0x639c('0x41')]){_0x1f9bc2[_0x639c('0x42')]=_[_0x639c('0x43')](_0x1f9bc2[_0x639c('0x42')],{'$or':_[_0x639c('0x35')](_0x567fca,function(_0xa74343){if(_0xa74343[_0x639c('0x32')]!==_0x639c('0x44')){var _0x3b7f0d={};_0x3b7f0d[_0xa74343[_0x639c('0x2e')]]={'$like':'%'+_0x4e0c5b[_0x639c('0x37')]['filter']+'%'};return _0x3b7f0d;}})});}_0x1f9bc2=_[_0x639c('0x43')]({},_0x1f9bc2,_0x4e0c5b['options']);var _0x5a1a00={'where':_0x1f9bc2[_0x639c('0x42')]};return db[_0x639c('0x30')]['count'](_0x5a1a00)[_0x639c('0x45')](function(_0x58e375){_0x2fe151[_0x639c('0x27')]=_0x58e375;if(_0x4e0c5b['query'][_0x639c('0x46')]){_0x1f9bc2[_0x639c('0x47')]=[{'all':!![]}];}return db[_0x639c('0x30')]['findAll'](_0x1f9bc2);})[_0x639c('0x45')](function(_0x577ce5){_0x2fe151[_0x639c('0x48')]=_0x577ce5;return _0x2fe151;})[_0x639c('0x45')](respondWithFilteredResult(_0x2c61e6,_0x1f9bc2))['catch'](handleError(_0x2c61e6,null));};exports['show']=function(_0x237f33,_0x4366cb){var _0x2bee38={'raw':![],'where':{'id':_0x237f33[_0x639c('0x49')]['id']}},_0x4fd097={};_0x4fd097['model']=_[_0x639c('0x36')](db[_0x639c('0x30')][_0x639c('0x31')]);_0x4fd097['query']=_[_0x639c('0x36')](_0x237f33[_0x639c('0x37')]);_0x4fd097[_0x639c('0x38')]=_[_0x639c('0x39')](_0x4fd097[_0x639c('0x34')],_0x4fd097[_0x639c('0x37')]);_0x2bee38['attributes']=_[_0x639c('0x39')](_0x4fd097[_0x639c('0x34')],qs['fields'](_0x237f33['query']['fields']));_0x2bee38['attributes']=_0x2bee38[_0x639c('0x3a')][_0x639c('0x3c')]?_0x2bee38[_0x639c('0x3a')]:_0x4fd097['model'];if(_0x237f33[_0x639c('0x37')]['includeAll']){_0x2bee38['include']=[{'all':!![]}];}_0x2bee38=_[_0x639c('0x43')]({},_0x2bee38,_0x237f33[_0x639c('0x4a')]);return db[_0x639c('0x30')][_0x639c('0x4b')](_0x2bee38)['then'](handleEntityNotFound(_0x4366cb,null))[_0x639c('0x45')](respondWithResult(_0x4366cb,null))['catch'](handleError(_0x4366cb,null));};exports[_0x639c('0x4c')]=function(_0x2ed926,_0x6f02b){return db[_0x639c('0x30')][_0x639c('0x4c')](_0x2ed926[_0x639c('0x4d')],{})['then'](function(_0x41a2e7){var _0x1ca378=_0x2ed926[_0x639c('0x4e')][_0x639c('0x4f')]({'plain':!![]});if(!_0x1ca378)throw new Error(_0x639c('0x50'));if(_0x1ca378[_0x639c('0x51')]===_0x639c('0x4e')){var _0x43ddb3=_0x41a2e7['get']({'plain':!![]});var _0x56741e=_0x639c('0x52');return db[_0x639c('0x53')][_0x639c('0x4b')]({'where':{'name':_0x56741e,'userProfileId':_0x1ca378[_0x639c('0x54')]},'raw':!![]})[_0x639c('0x45')](function(_0x1cf6b7){if(_0x1cf6b7&&_0x1cf6b7[_0x639c('0x55')]===0x0){return db[_0x639c('0x56')]['create']({'name':_0x43ddb3[_0x639c('0x2e')],'resourceId':_0x43ddb3['id'],'type':_0x1cf6b7[_0x639c('0x2e')],'sectionId':_0x1cf6b7['id']},{})['then'](function(){return _0x41a2e7;});}else{return _0x41a2e7;}})['catch'](function(_0x532fb4){logger[_0x639c('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x532fb4);throw _0x532fb4;});}return _0x41a2e7;})[_0x639c('0x45')](respondWithResult(_0x6f02b,0xc9))[_0x639c('0x57')](handleError(_0x6f02b,null));};exports['update']=function(_0x20c930,_0x58b02b){if(_0x20c930[_0x639c('0x4d')]['id']){delete _0x20c930['body']['id'];}return db[_0x639c('0x30')][_0x639c('0x4b')]({'where':{'id':_0x20c930['params']['id']}})['then'](handleEntityNotFound(_0x58b02b,null))['then'](saveUpdates(_0x20c930[_0x639c('0x4d')],null))[_0x639c('0x45')](respondWithResult(_0x58b02b,null))[_0x639c('0x57')](handleError(_0x58b02b,null));};exports[_0x639c('0x58')]=function(_0x54015e,_0x3f849d){var _0x24d409=_0x54015e[_0x639c('0x49')]['id'];var _0x31a85c=[];return db[_0x639c('0x59')][_0x639c('0x5a')](function(_0x5bed35){var _0x15c564='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x24d409;return db['sequelize']['query'](_0x15c564,{'type':db[_0x639c('0x5b')][_0x639c('0x5c')][_0x639c('0x5d')],'raw':!![],'transaction':_0x5bed35})[_0x639c('0x45')](function(_0x3cd99c){_0x31a85c=_[_0x639c('0x35')](_0x3cd99c,function(_0x33dc57){return Number(_0x33dc57[_0x639c('0x5e')]);});})[_0x639c('0x45')](function(){var _0x4952ef='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x24d409;return db[_0x639c('0x59')][_0x639c('0x37')](_0x4952ef,{'type':db[_0x639c('0x5b')]['QueryTypes'][_0x639c('0x5d')],'raw':!![],'transaction':_0x5bed35});})['then'](function(_0x2495f6){var _0x1ceae0=_[_0x639c('0x35')](_0x2495f6,function(_0x5d7e23){return Number(_0x5d7e23[_0x639c('0x5f')]);});return db[_0x639c('0x60')][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'VoiceQueueId':{'$in':_0x1ceae0}},'transaction':_0x5bed35});})['then'](function(){var _0x302f5f=_0x639c('0x61')+_0x24d409;return db[_0x639c('0x59')][_0x639c('0x37')](_0x302f5f,{'type':db['Sequelize'][_0x639c('0x5c')][_0x639c('0x5d')],'raw':!![],'transaction':_0x5bed35});})['then'](function(_0x29fb0e){var _0x5202ca=_[_0x639c('0x35')](_0x29fb0e,function(_0x343f75){return Number(_0x343f75[_0x639c('0x62')]);});return db[_0x639c('0x63')]['destroy']({'where':{'UserId':{'$in':_0x31a85c},'MailQueueId':{'$in':_0x5202ca}},'transaction':_0x5bed35});})['then'](function(){var _0x40e9a2=_0x639c('0x64')+_0x24d409;return db['sequelize'][_0x639c('0x37')](_0x40e9a2,{'type':db[_0x639c('0x5b')][_0x639c('0x5c')]['SELECT'],'raw':!![],'transaction':_0x5bed35});})[_0x639c('0x45')](function(_0x52a176){var _0x35bad7=_[_0x639c('0x35')](_0x52a176,function(_0x41a5f2){return Number(_0x41a5f2[_0x639c('0x65')]);});return db[_0x639c('0x66')][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'SmsQueueId':{'$in':_0x35bad7}},'transaction':_0x5bed35});})[_0x639c('0x45')](function(){var _0xe6c1d3='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x24d409;return db[_0x639c('0x59')][_0x639c('0x37')](_0xe6c1d3,{'type':db['Sequelize'][_0x639c('0x5c')]['SELECT'],'raw':!![],'transaction':_0x5bed35});})[_0x639c('0x45')](function(_0x252b3d){var _0x11b3ae=_[_0x639c('0x35')](_0x252b3d,function(_0x48079b){return Number(_0x48079b[_0x639c('0x67')]);});return db[_0x639c('0x68')][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'ChatQueueId':{'$in':_0x11b3ae}},'transaction':_0x5bed35});})[_0x639c('0x45')](function(){var _0x48918f=_0x639c('0x69')+_0x24d409;return db[_0x639c('0x59')][_0x639c('0x37')](_0x48918f,{'type':db[_0x639c('0x5b')][_0x639c('0x5c')][_0x639c('0x5d')],'raw':!![],'transaction':_0x5bed35});})[_0x639c('0x45')](function(_0x54cc4){var _0x1c8a61=_['map'](_0x54cc4,function(_0x46557d){return Number(_0x46557d[_0x639c('0x6a')]);});return db[_0x639c('0x6b')][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'FaxQueueId':{'$in':_0x1c8a61}},'transaction':_0x5bed35});})[_0x639c('0x45')](function(){var _0x20377d=_0x639c('0x6c')+_0x24d409;return db['sequelize']['query'](_0x20377d,{'type':db['Sequelize']['QueryTypes'][_0x639c('0x5d')],'raw':!![],'transaction':_0x5bed35});})[_0x639c('0x45')](function(_0x435053){var _0x46bdb7=_[_0x639c('0x35')](_0x435053,function(_0x5d8092){return Number(_0x5d8092[_0x639c('0x6d')]);});return db['UserOpenchannelQueue'][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'OpenchannelQueueId':{'$in':_0x46bdb7}},'transaction':_0x5bed35});})[_0x639c('0x45')](function(){var _0x34a45a=_0x639c('0x6e')+_0x24d409;return db[_0x639c('0x59')][_0x639c('0x37')](_0x34a45a,{'type':db[_0x639c('0x5b')][_0x639c('0x5c')][_0x639c('0x5d')],'raw':!![],'transaction':_0x5bed35});})[_0x639c('0x45')](function(_0x54e920){var _0x1dd703=_[_0x639c('0x35')](_0x54e920,function(_0x11c49b){return Number(_0x11c49b['WhatsappQueueId']);});return db[_0x639c('0x6f')][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'WhatsappQueueId':{'$in':_0x1dd703}},'transaction':_0x5bed35});})[_0x639c('0x45')](function(){return db[_0x639c('0x70')][_0x639c('0x4b')]({'where':{'TeamId':_0x24d409}});})[_0x639c('0x45')](function(_0x5f0a9b){if(_0x5f0a9b===null){return;}return db['UserVoicePrefix'][_0x639c('0x58')]({'where':{'UserId':{'$in':_0x31a85c},'VoicePrefixId':_0x5f0a9b[_0x639c('0x71')]},'transaction':_0x5bed35});})[_0x639c('0x45')](function(){return db[_0x639c('0x30')][_0x639c('0x58')]({'where':{'id':_0x24d409},'cascade':!![],'transaction':_0x5bed35});})['then'](function(_0x1d1a1c){if(_0x1d1a1c===0x0){_0x3f849d['sendStatus'](0x194);}else{return db[_0x639c('0x56')]['destroy']({'where':{'type':_0x639c('0x52'),'resourceId':_0x24d409},'cascade':!![],'transaction':_0x5bed35})[_0x639c('0x45')](function(){_0x3f849d[_0x639c('0x22')](0xcc)[_0x639c('0x72')]();});}})[_0x639c('0x57')](function(_0x13e05f){_0x3f849d[_0x639c('0x22')](0x1f4)[_0x639c('0x2f')](_0x13e05f);});});};exports[_0x639c('0x73')]=function(_0x1bd7a5,_0x3b5150,_0x5b8552){return db[_0x639c('0x30')][_0x639c('0x74')]({'where':{'id':_0x1bd7a5[_0x639c('0x49')]['id']}})[_0x639c('0x45')](handleEntityNotFound(_0x3b5150,null))[_0x639c('0x45')](function(_0x5231c0){if(!_0x1bd7a5[_0x639c('0x37')][_0x639c('0x75')]||!utils[_0x639c('0x76')](_0x1bd7a5[_0x639c('0x37')]['channel'])){throw new db[(_0x639c('0x5b'))]['ValidationError'](_0x639c('0x77'));}var _0xfa9391={};var _0x8af213={};_0x8af213[_0x639c('0x34')]=_[_0x639c('0x36')](db[_[_0x639c('0x78')](_0x1bd7a5['query'][_0x639c('0x75')]['toLowerCase']())+_0x639c('0x79')][_0x639c('0x31')]);_0x8af213['query']=_['keys'](_0x1bd7a5['query']);_0x8af213[_0x639c('0x38')]=_['intersection'](_0x8af213[_0x639c('0x34')],_0x8af213[_0x639c('0x37')]);_0xfa9391[_0x639c('0x3a')]=_['intersection'](_0x8af213[_0x639c('0x34')],qs['fields'](_0x1bd7a5['query']['fields']));_0xfa9391[_0x639c('0x3a')]=_0xfa9391[_0x639c('0x3a')][_0x639c('0x3c')]?_0xfa9391[_0x639c('0x3a')]:_0x8af213[_0x639c('0x34')];_0xfa9391[_0x639c('0x26')]=qs[_0x639c('0x26')](_0x1bd7a5['query'][_0x639c('0x26')]);_0xfa9391[_0x639c('0x24')]=qs[_0x639c('0x24')](_0x1bd7a5[_0x639c('0x37')]['offset']);_0xfa9391[_0x639c('0x7a')]=qs[_0x639c('0x3f')](_0x1bd7a5[_0x639c('0x37')][_0x639c('0x3f')]);_0xfa9391[_0x639c('0x42')]=qs[_0x639c('0x38')](_[_0x639c('0x40')](_0x1bd7a5[_0x639c('0x37')],_0x8af213[_0x639c('0x38')]));_0xfa9391=_[_0x639c('0x43')]({},_0xfa9391,_0x1bd7a5[_0x639c('0x4a')]);return _0x5231c0[_0x639c('0x4f')+_[_0x639c('0x78')](_0x1bd7a5['query'][_0x639c('0x75')][_0x639c('0x7b')]())+_0x639c('0x7c')](_0xfa9391);})[_0x639c('0x45')](respondWithResult(_0x3b5150,null))[_0x639c('0x57')](handleError(_0x3b5150,null));};exports[_0x639c('0x7d')]=function(_0x3d5a1b,_0x534fef,_0x4dccc0){return db[_0x639c('0x30')][_0x639c('0x74')]({'where':{'id':_0x3d5a1b[_0x639c('0x49')]['id']}})[_0x639c('0x45')](function(_0x49db6e){if(_0x49db6e){if(!_0x3d5a1b['body']['channel']||!utils[_0x639c('0x76')](_0x3d5a1b[_0x639c('0x4d')][_0x639c('0x75')])){throw new db[(_0x639c('0x5b'))][(_0x639c('0x7e'))](_0x639c('0x77'));}return _0x49db6e[_0x639c('0x7f')+_['capitalize'](_0x3d5a1b[_0x639c('0x4d')][_0x639c('0x75')]['toLowerCase']())+'Queues'](_0x3d5a1b['body'][_0x639c('0x80')]);}return null;})[_0x639c('0x45')](handleEntityNotFound(_0x534fef,null))[_0x639c('0x45')](respondWithStatusCode(_0x534fef,null))['catch'](handleError(_0x534fef,null));};exports[_0x639c('0x81')]=function(_0x448a51,_0x3a7293,_0x529f73){return db[_0x639c('0x30')]['findOne']({'where':{'id':_0x448a51[_0x639c('0x49')]['id']}})[_0x639c('0x45')](function(_0x4808bb){if(_0x4808bb){if(!_0x448a51[_0x639c('0x37')][_0x639c('0x75')]||!utils['isValidChannel'](_0x448a51['query'][_0x639c('0x75')])){throw new db['Sequelize'][(_0x639c('0x7e'))]('Unknown\x20channel');}return _0x4808bb[_0x639c('0x82')+_[_0x639c('0x78')](_0x448a51['query'][_0x639c('0x75')][_0x639c('0x7b')]())+_0x639c('0x7c')](_0x448a51['query'][_0x639c('0x80')]);}return null;})[_0x639c('0x45')](handleEntityNotFound(_0x3a7293,null))[_0x639c('0x45')](respondWithStatusCode(_0x3a7293,null))[_0x639c('0x57')](handleError(_0x3a7293,null));};exports['addAgents']=function(_0x4b0182,_0x4a3905){var _0x54c52c=_[_0x639c('0x83')](_0x4b0182[_0x639c('0x4d')][_0x639c('0x80')])?_0x4b0182[_0x639c('0x4d')][_0x639c('0x80')]:[_0x4b0182[_0x639c('0x4d')][_0x639c('0x80')]];var _0x5dcef3=_0x4b0182[_0x639c('0x49')]['id'];return db[_0x639c('0x30')]['find']({'where':{'id':_0x5dcef3}})[_0x639c('0x45')](handleEntityNotFound(_0x4a3905,null))[_0x639c('0x45')](function(_0x215d0e){if(_0x215d0e){var _0x39f0fe=['Voice','Chat',_0x639c('0x84'),_0x639c('0x85'),_0x639c('0x86'),'Openchannel',_0x639c('0x87')];return db[_0x639c('0x59')][_0x639c('0x5a')](function(_0x299dfb){var _0x1c188f=_['map'](_0x39f0fe,function(_0x4265bd){var _0x5cc87c={'attributes':['id',_0x639c('0x2e')]};if(_0x4265bd===_0x639c('0x88')){_0x5cc87c['through']={'attributes':['penalty']};}return _0x215d0e[_0x639c('0x4f')+_0x4265bd+'Queues'](_0x5cc87c)[_0x639c('0x45')](function(_0x2db406){var _0x22749d=_['map'](_0x2db406,function(_0x359436){var _0x4ec80b=_[_0x639c('0x35')](_0x54c52c,function(_0x3d99c3){var _0x831a8e={'where':{'UserId':_0x3d99c3,[_0x4265bd+_0x639c('0x89')]:_0x359436['id']},'transaction':_0x299dfb};if(_0x4265bd===_0x639c('0x88')){_0x831a8e['defaults']={'penalty':_0x359436[_0x639c('0x8a')][_0x639c('0x8b')]};}return db[_0x639c('0x8c')+_0x4265bd+'Queue'][_0x639c('0x8d')](_0x831a8e)[_0x639c('0x45')](function(){socket[_0x639c('0x8e')]('user'+_0x4265bd+'Queue:save',{'UserId':_0x3d99c3,[_0x4265bd+_0x639c('0x89')]:_0x359436['id']});if(_0x4265bd!==_0x639c('0x88')){return;}return db[_0x639c('0x8c')][_0x639c('0x8f')]({'where':{'id':_0x54c52c,'online':0x1},'attributes':['id',_0x639c('0x2e'),_0x639c('0x90'),_0x639c('0x91'),_0x639c('0x92')],'raw':!![]})[_0x639c('0x45')](function(_0x384806){var _0x4c3b51=_[_0x639c('0x35')](_0x384806,function(_0x4664c2){return db[_0x639c('0x93')][_0x639c('0x94')]({'membername':_0x4664c2[_0x639c('0x2e')],'UserId':_0x4664c2['id'],'queue_name':_0x359436[_0x639c('0x2e')],'VoiceQueueId':_0x359436['id'],'interface':_[_0x639c('0x95')](_0x4664c2[_0x639c('0x92')])?util['format'](_0x639c('0x96'),_0x4664c2[_0x639c('0x2e')]):_0x4664c2[_0x639c('0x92')],'paused':_0x4664c2[_0x639c('0x91')]||![],'penalty':_0x359436[_0x639c('0x8a')]['penalty']},{'transaction':_0x299dfb});});return Promise['all'](_0x4c3b51);});});});return Promise[_0x639c('0x97')](_0x4ec80b);});return Promise[_0x639c('0x97')](_0x22749d);})[_0x639c('0x45')](function(){return db[_0x639c('0x70')][_0x639c('0x74')]({'where':{'teamId':_0x5dcef3}})['then'](function(_0x4ac631){if(_0x4ac631){var _0x4a3854=_['map'](_0x54c52c,function(_0x44bb3c){db['UserVoicePrefix']['upsert']({'UserId':_0x44bb3c,'VoicePrefixId':_0x4ac631[_0x639c('0x71')]});});return Promise[_0x639c('0x97')](_0x4a3854);}});});});return Promise[_0x639c('0x97')](_0x1c188f)[_0x639c('0x45')](function(){return _0x215d0e['addAgents'](_0x54c52c,{'transaction':_0x299dfb})[_0x639c('0x98')](function(_0x3f09f1){return _0x3f09f1;});});});}})[_0x639c('0x45')](respondWithResult(_0x4a3905,null))['catch'](handleError(_0x4a3905,null));};exports[_0x639c('0x99')]=function(_0x54b55a,_0x432572){var _0x459788=_[_0x639c('0x83')](_0x54b55a[_0x639c('0x37')][_0x639c('0x80')])?_0x54b55a[_0x639c('0x37')][_0x639c('0x80')]:[_0x54b55a['query'][_0x639c('0x80')]];var _0x785c85=_0x54b55a[_0x639c('0x49')]['id'];return db[_0x639c('0x30')]['find']({'where':{'id':_0x785c85}})[_0x639c('0x45')](handleEntityNotFound(_0x432572,null))['then'](function(_0x23f323){if(_0x23f323){var _0x59e6bf=[_0x639c('0x88'),_0x639c('0x9a'),_0x639c('0x84'),'Sms',_0x639c('0x86'),'Openchannel',_0x639c('0x87')];return db[_0x639c('0x59')][_0x639c('0x5a')](function(_0x11da56){var _0x4a98a2=_[_0x639c('0x35')](_0x59e6bf,function(_0x3ec943){var _0xc7d343={'attributes':['id',_0x639c('0x2e')]};return _0x23f323[_0x639c('0x4f')+_0x3ec943+'Queues'](_0xc7d343)['then'](function(_0x550827){var _0x41e6d2=_['map'](_0x550827,function(_0x508b9a){return _0x508b9a[_0x639c('0x99')](_0x459788,{'transaction':_0x11da56})[_0x639c('0x45')](function(){var _0x3ef1c8=_[_0x639c('0x35')](_0x459788,function(_0x3e6d7a){socket[_0x639c('0x8e')]('user'+_0x3ec943+'Queue:remove',{'UserId':Number(_0x3e6d7a),[_0x3ec943+_0x639c('0x89')]:_0x508b9a['id']});if(_0x3ec943!==_0x639c('0x88')){return;}return db[_0x639c('0x93')][_0x639c('0x58')]({'where':{'VoiceQueueId':_0x508b9a['id'],'UserId':_0x3e6d7a},'transaction':_0x11da56});});return Promise[_0x639c('0x97')](_0x3ef1c8);});});return Promise['all'](_0x41e6d2);});});return Promise[_0x639c('0x97')](_0x4a98a2)[_0x639c('0x45')](function(){return _0x23f323['removeAgents'](_0x459788,{'transaction':_0x11da56});})[_0x639c('0x45')](function(){return db[_0x639c('0x70')][_0x639c('0x74')]({'where':{'teamId':_0x785c85}})[_0x639c('0x45')](function(_0x39fffb){if(_0x39fffb){var _0x1712b4=_[_0x639c('0x35')](_0x459788,function(_0x3e0c1e){db[_0x639c('0x9b')][_0x639c('0x58')]({'where':{'UserId':_0x3e0c1e,'VoicePrefixId':_0x39fffb[_0x639c('0x71')]}});});return Promise['all'](_0x1712b4);}});});});}})[_0x639c('0x45')](respondWithStatusCode(_0x432572,null))[_0x639c('0x57')](handleError(_0x432572,null));};exports['getAgents']=function(_0x4d7202,_0x2bed5a,_0x3b20df){var _0x543cdc={};var _0x2f260b={};var _0x1c530a;var _0x2c93de;return db['Team'][_0x639c('0x74')]({'where':{'id':_0x4d7202[_0x639c('0x49')]['id']}})[_0x639c('0x45')](handleEntityNotFound(_0x2bed5a,null))[_0x639c('0x45')](function(_0xd65e93){if(_0xd65e93){_0x1c530a=_0xd65e93;_0x2f260b['model']=_[_0x639c('0x36')](db[_0x639c('0x8c')][_0x639c('0x31')]);_0x2f260b[_0x639c('0x37')]=_['keys'](_0x4d7202['query']);_0x2f260b[_0x639c('0x38')]=_[_0x639c('0x39')](_0x2f260b[_0x639c('0x34')],_0x2f260b[_0x639c('0x37')]);_0x543cdc[_0x639c('0x3a')]=_[_0x639c('0x39')](_0x2f260b[_0x639c('0x34')],qs[_0x639c('0x3b')](_0x4d7202[_0x639c('0x37')][_0x639c('0x3b')]));_0x543cdc[_0x639c('0x3a')]=_0x543cdc[_0x639c('0x3a')]['length']?_0x543cdc[_0x639c('0x3a')]:_0x2f260b[_0x639c('0x34')];_0x543cdc[_0x639c('0x7a')]=qs[_0x639c('0x3f')](_0x4d7202[_0x639c('0x37')][_0x639c('0x3f')]);_0x543cdc['where']=qs[_0x639c('0x38')](_['pick'](_0x4d7202[_0x639c('0x37')],_0x2f260b['filters']));if(_0x4d7202[_0x639c('0x37')][_0x639c('0x41')]){_0x543cdc[_0x639c('0x42')]=_[_0x639c('0x43')](_0x543cdc[_0x639c('0x42')],{'$or':_[_0x639c('0x35')](_0x543cdc['attributes'],function(_0x4a08a5){var _0xd8fd47={};_0xd8fd47[_0x4a08a5]={'$like':'%'+_0x4d7202[_0x639c('0x37')][_0x639c('0x41')]+'%'};return _0xd8fd47;})});}_0x543cdc=_[_0x639c('0x43')]({},_0x543cdc,_0x4d7202[_0x639c('0x4a')]);return _0x1c530a[_0x639c('0x9c')](_0x543cdc);}})['then'](function(_0x23f4bf){if(_0x23f4bf){_0x2c93de=_0x23f4bf[_0x639c('0x3c')];if(!_0x4d7202[_0x639c('0x37')][_0x639c('0x3d')]('nolimit')){_0x543cdc[_0x639c('0x26')]=qs[_0x639c('0x26')](_0x4d7202[_0x639c('0x37')][_0x639c('0x26')]);_0x543cdc[_0x639c('0x24')]=qs[_0x639c('0x24')](_0x4d7202[_0x639c('0x37')][_0x639c('0x24')]);}return _0x1c530a[_0x639c('0x9c')](_0x543cdc);}})[_0x639c('0x45')](function(_0x445b54){if(_0x445b54){return _0x445b54?{'count':_0x2c93de,'rows':_0x445b54}:null;}})[_0x639c('0x45')](respondWithResult(_0x2bed5a,null))[_0x639c('0x57')](handleError(_0x2bed5a,null));}; \ No newline at end of file +var _0xbcd5=['isValidChannel','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','ValidationError','add','ids','removeQueues','remove','capitalize','isArray','Voice','Sms','Fax','Whatsapp','through','penalty','TeamVoiceQueue','User','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','Chat','removeAgents','Queue:remove','QueueId','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','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','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel'];(function(_0x4c6839,_0x4c8f6a){var _0x1e0daf=function(_0xe26636){while(--_0xe26636){_0x4c6839['push'](_0x4c6839['shift']());}};_0x1e0daf(++_0x4c8f6a);}(_0xbcd5,0x162));var _0x5bcd=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xbcd5[_0x737a1f];return _0x16eba1;};'use strict';var emlformat=require(_0x5bcd('0x0'));var rimraf=require(_0x5bcd('0x1'));var zipdir=require(_0x5bcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bcd('0x3'));var moment=require(_0x5bcd('0x4'));var BPromise=require(_0x5bcd('0x5'));var Mustache=require(_0x5bcd('0x6'));var util=require(_0x5bcd('0x7'));var path=require(_0x5bcd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5bcd('0x9'));var fs=require('fs');var fs_extra=require(_0x5bcd('0xa'));var _=require('lodash');var squel=require(_0x5bcd('0xb'));var crypto=require(_0x5bcd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5bcd('0xd'));var toCsv=require(_0x5bcd('0xe'));var querystring=require('querystring');var Papa=require(_0x5bcd('0xf'));var Redis=require(_0x5bcd('0x10'));var authService=require(_0x5bcd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5bcd('0x12'));var hardwareService=require(_0x5bcd('0x13'));var logger=require(_0x5bcd('0x14'))(_0x5bcd('0x15'));var utils=require(_0x5bcd('0x16'));var config=require(_0x5bcd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bcd('0x18'))['db'];config[_0x5bcd('0x19')]=_[_0x5bcd('0x1a')](config[_0x5bcd('0x19')],{'host':_0x5bcd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bcd('0x19')]));require(_0x5bcd('0x1c'))['register'](socket);function respondWithStatusCode(_0x4cd605,_0x22c549){_0x22c549=_0x22c549||0xcc;return function(_0x302d55){if(_0x302d55){return _0x4cd605[_0x5bcd('0x1d')](_0x22c549);}return _0x4cd605[_0x5bcd('0x1e')](_0x22c549)[_0x5bcd('0x1f')]();};}function respondWithResult(_0x59c56d,_0x6fd92b){_0x6fd92b=_0x6fd92b||0xc8;return function(_0x1b350d){if(_0x1b350d){return _0x59c56d[_0x5bcd('0x1e')](_0x6fd92b)['json'](_0x1b350d);}};}function respondWithFilteredResult(_0x540cb8,_0x57ee1c){return function(_0x321180){if(_0x321180){var _0x4de031=typeof _0x57ee1c[_0x5bcd('0x20')]===_0x5bcd('0x21')&&typeof _0x57ee1c[_0x5bcd('0x22')]===_0x5bcd('0x21');var _0x409389=_0x321180[_0x5bcd('0x23')];var _0x50bbca=_0x4de031?0x0:_0x57ee1c[_0x5bcd('0x20')];var _0x5109fa=_0x4de031?_0x321180['count']:_0x57ee1c[_0x5bcd('0x20')]+_0x57ee1c['limit'];var _0x275ef6;if(_0x5109fa>=_0x409389){_0x5109fa=_0x409389;_0x275ef6=0xc8;}else{_0x275ef6=0xce;}_0x540cb8[_0x5bcd('0x1e')](_0x275ef6);return _0x540cb8[_0x5bcd('0x24')](_0x5bcd('0x25'),_0x50bbca+'-'+_0x5109fa+'/'+_0x409389)['json'](_0x321180);}return null;};}function patchUpdates(_0x5a2a96){return function(_0x501d57){try{jsonpatch[_0x5bcd('0x26')](_0x501d57,_0x5a2a96,!![]);}catch(_0x393f60){return BPromise[_0x5bcd('0x27')](_0x393f60);}return _0x501d57['save']();};}function saveUpdates(_0x2c40e2,_0x470f63){return function(_0x28790f){if(_0x28790f){return _0x28790f[_0x5bcd('0x28')](_0x2c40e2)[_0x5bcd('0x29')](function(_0x4b5233){return _0x4b5233;});}return null;};}function handleEntityNotFound(_0x27e1fd,_0x21d038){return function(_0x2807de){if(!_0x2807de){_0x27e1fd[_0x5bcd('0x1d')](0x194);}return _0x2807de;};}function handleError(_0x3afac6,_0x3848ad){_0x3848ad=_0x3848ad||0x1f4;return function(_0x37c17c){logger[_0x5bcd('0x2a')](_0x37c17c[_0x5bcd('0x2b')]);if(_0x37c17c[_0x5bcd('0x2c')]){delete _0x37c17c[_0x5bcd('0x2c')];}_0x3afac6[_0x5bcd('0x1e')](_0x3848ad)[_0x5bcd('0x2d')](_0x37c17c);};}exports[_0x5bcd('0x2e')]=function(_0xacfc5f,_0x4e3617){var _0x3c6950={},_0x5d0305={},_0x5f23ed={'count':0x0,'rows':[]};var _0x21821a=_[_0x5bcd('0x2f')](db[_0x5bcd('0x30')]['rawAttributes'],function(_0x415281){return{'name':_0x415281[_0x5bcd('0x31')],'type':_0x415281[_0x5bcd('0x32')][_0x5bcd('0x33')]};});_0x5d0305[_0x5bcd('0x34')]=_['map'](_0x21821a,'name');_0x5d0305[_0x5bcd('0x35')]=_[_0x5bcd('0x36')](_0xacfc5f['query']);_0x5d0305[_0x5bcd('0x37')]=_['intersection'](_0x5d0305[_0x5bcd('0x34')],_0x5d0305[_0x5bcd('0x35')]);_0x3c6950['attributes']=_[_0x5bcd('0x38')](_0x5d0305[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x39')]));_0x3c6950[_0x5bcd('0x3a')]=_0x3c6950[_0x5bcd('0x3a')][_0x5bcd('0x3b')]?_0x3c6950[_0x5bcd('0x3a')]:_0x5d0305[_0x5bcd('0x34')];if(!_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x3c')](_0x5bcd('0x3d'))){_0x3c6950[_0x5bcd('0x22')]=qs[_0x5bcd('0x22')](_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x22')]);_0x3c6950[_0x5bcd('0x20')]=qs[_0x5bcd('0x20')](_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x20')]);}_0x3c6950[_0x5bcd('0x3e')]=qs[_0x5bcd('0x3f')](_0xacfc5f['query'][_0x5bcd('0x3f')]);_0x3c6950[_0x5bcd('0x40')]=qs[_0x5bcd('0x37')](_[_0x5bcd('0x41')](_0xacfc5f[_0x5bcd('0x35')],_0x5d0305[_0x5bcd('0x37')]),_0x21821a);if(_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x42')]){_0x3c6950[_0x5bcd('0x40')]=_[_0x5bcd('0x43')](_0x3c6950[_0x5bcd('0x40')],{'$or':_['map'](_0x21821a,function(_0xafeaa2){if(_0xafeaa2[_0x5bcd('0x32')]!==_0x5bcd('0x44')){var _0x19ab21={};_0x19ab21[_0xafeaa2[_0x5bcd('0x2c')]]={'$like':'%'+_0xacfc5f[_0x5bcd('0x35')]['filter']+'%'};return _0x19ab21;}})});}_0x3c6950=_[_0x5bcd('0x43')]({},_0x3c6950,_0xacfc5f[_0x5bcd('0x45')]);var _0x1b92d7={'where':_0x3c6950[_0x5bcd('0x40')]};return db['Team']['count'](_0x1b92d7)['then'](function(_0x507af8){_0x5f23ed['count']=_0x507af8;if(_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x46')]){_0x3c6950['include']=[{'all':!![]}];}return db['Team'][_0x5bcd('0x47')](_0x3c6950);})[_0x5bcd('0x29')](function(_0x1f5beb){_0x5f23ed[_0x5bcd('0x48')]=_0x1f5beb;return _0x5f23ed;})['then'](respondWithFilteredResult(_0x4e3617,_0x3c6950))[_0x5bcd('0x49')](handleError(_0x4e3617,null));};exports[_0x5bcd('0x4a')]=function(_0x4446f,_0x4b9923){var _0x5c8925={'raw':![],'where':{'id':_0x4446f['params']['id']}},_0x232cbf={};_0x232cbf[_0x5bcd('0x34')]=_['keys'](db[_0x5bcd('0x30')][_0x5bcd('0x4b')]);_0x232cbf[_0x5bcd('0x35')]=_[_0x5bcd('0x36')](_0x4446f[_0x5bcd('0x35')]);_0x232cbf['filters']=_[_0x5bcd('0x38')](_0x232cbf[_0x5bcd('0x34')],_0x232cbf['query']);_0x5c8925[_0x5bcd('0x3a')]=_[_0x5bcd('0x38')](_0x232cbf[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0x4446f[_0x5bcd('0x35')][_0x5bcd('0x39')]));_0x5c8925[_0x5bcd('0x3a')]=_0x5c8925[_0x5bcd('0x3a')]['length']?_0x5c8925['attributes']:_0x232cbf[_0x5bcd('0x34')];if(_0x4446f[_0x5bcd('0x35')][_0x5bcd('0x46')]){_0x5c8925[_0x5bcd('0x4c')]=[{'all':!![]}];}_0x5c8925=_[_0x5bcd('0x43')]({},_0x5c8925,_0x4446f[_0x5bcd('0x45')]);return db[_0x5bcd('0x30')]['find'](_0x5c8925)[_0x5bcd('0x29')](handleEntityNotFound(_0x4b9923,null))[_0x5bcd('0x29')](respondWithResult(_0x4b9923,null))['catch'](handleError(_0x4b9923,null));};exports['create']=function(_0x2486f3,_0x34a63e){return db[_0x5bcd('0x30')][_0x5bcd('0x4d')](_0x2486f3[_0x5bcd('0x4e')],{})[_0x5bcd('0x29')](function(_0x404a33){var _0x20f748=_0x2486f3[_0x5bcd('0x4f')][_0x5bcd('0x50')]({'plain':!![]});if(!_0x20f748)throw new Error(_0x5bcd('0x51'));if(_0x20f748[_0x5bcd('0x52')]==='user'){var _0x111495=_0x404a33[_0x5bcd('0x50')]({'plain':!![]});var _0x5e218b=_0x5bcd('0x53');return db[_0x5bcd('0x54')]['find']({'where':{'name':_0x5e218b,'userProfileId':_0x20f748[_0x5bcd('0x55')]},'raw':!![]})[_0x5bcd('0x29')](function(_0x365fa8){if(_0x365fa8&&_0x365fa8[_0x5bcd('0x56')]===0x0){return db[_0x5bcd('0x57')][_0x5bcd('0x4d')]({'name':_0x111495[_0x5bcd('0x2c')],'resourceId':_0x111495['id'],'type':_0x365fa8[_0x5bcd('0x2c')],'sectionId':_0x365fa8['id']},{})['then'](function(){return _0x404a33;});}else{return _0x404a33;}})[_0x5bcd('0x49')](function(_0x57588e){logger['error'](_0x5bcd('0x58'),_0x57588e);throw _0x57588e;});}return _0x404a33;})['then'](respondWithResult(_0x34a63e,0xc9))[_0x5bcd('0x49')](handleError(_0x34a63e,null));};exports[_0x5bcd('0x28')]=function(_0xf3fb06,_0x8cead8){if(_0xf3fb06['body']['id']){delete _0xf3fb06[_0x5bcd('0x4e')]['id'];}return db['Team'][_0x5bcd('0x59')]({'where':{'id':_0xf3fb06[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](handleEntityNotFound(_0x8cead8,null))[_0x5bcd('0x29')](saveUpdates(_0xf3fb06[_0x5bcd('0x4e')],null))[_0x5bcd('0x29')](respondWithResult(_0x8cead8,null))[_0x5bcd('0x49')](handleError(_0x8cead8,null));};exports[_0x5bcd('0x5b')]=function(_0x853c17,_0x3a5f1a){var _0x51a5c7=_0x853c17[_0x5bcd('0x5a')]['id'];var _0x329c11=[];return db[_0x5bcd('0x5c')][_0x5bcd('0x5d')](function(_0x57d96e){var _0x4251db=_0x5bcd('0x5e')+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x4251db,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e})[_0x5bcd('0x29')](function(_0xc206de){_0x329c11=_[_0x5bcd('0x2f')](_0xc206de,function(_0x61cbc1){return Number(_0x61cbc1[_0x5bcd('0x62')]);});})['then'](function(){var _0x284b02=_0x5bcd('0x63')+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x284b02,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x284a21){var _0x13b14d=_[_0x5bcd('0x2f')](_0x284a21,function(_0x89b0ad){return Number(_0x89b0ad[_0x5bcd('0x64')]);});return db[_0x5bcd('0x65')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'VoiceQueueId':{'$in':_0x13b14d}},'transaction':_0x57d96e});})['then'](function(){var _0x5d26c5=_0x5bcd('0x66')+_0x51a5c7;return db[_0x5bcd('0x5c')][_0x5bcd('0x35')](_0x5d26c5,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')]['SELECT'],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x14372f){var _0x1264ab=_[_0x5bcd('0x2f')](_0x14372f,function(_0xe468c6){return Number(_0xe468c6['MailQueueId']);});return db['UserMailQueue'][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'MailQueueId':{'$in':_0x1264ab}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x473831=_0x5bcd('0x67')+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x473831,{'type':db[_0x5bcd('0x5f')]['QueryTypes'][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x1a3229){var _0x4b26d5=_[_0x5bcd('0x2f')](_0x1a3229,function(_0x71b63c){return Number(_0x71b63c[_0x5bcd('0x68')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x329c11},'SmsQueueId':{'$in':_0x4b26d5}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x26ec94=_0x5bcd('0x69')+_0x51a5c7;return db['sequelize'][_0x5bcd('0x35')](_0x26ec94,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x2c49a9){var _0x4dd671=_[_0x5bcd('0x2f')](_0x2c49a9,function(_0x21205d){return Number(_0x21205d[_0x5bcd('0x6a')]);});return db[_0x5bcd('0x6b')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'ChatQueueId':{'$in':_0x4dd671}},'transaction':_0x57d96e});})['then'](function(){var _0x4c6877=_0x5bcd('0x6c')+_0x51a5c7;return db['sequelize']['query'](_0x4c6877,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')]['SELECT'],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x5212f7){var _0x4c929b=_[_0x5bcd('0x2f')](_0x5212f7,function(_0x48ebe7){return Number(_0x48ebe7[_0x5bcd('0x6d')]);});return db['UserFaxQueue'][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'FaxQueueId':{'$in':_0x4c929b}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x47cba0='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x51a5c7;return db['sequelize']['query'](_0x47cba0,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x75444){var _0x3db9d0=_['map'](_0x75444,function(_0x620b0f){return Number(_0x620b0f[_0x5bcd('0x6e')]);});return db[_0x5bcd('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x329c11},'OpenchannelQueueId':{'$in':_0x3db9d0}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x4421ed='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x4421ed,{'type':db[_0x5bcd('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x47c7cf){var _0x3b477b=_[_0x5bcd('0x2f')](_0x47c7cf,function(_0xd84efa){return Number(_0xd84efa[_0x5bcd('0x70')]);});return db[_0x5bcd('0x71')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'WhatsappQueueId':{'$in':_0x3b477b}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x72')]['find']({'where':{'TeamId':_0x51a5c7}});})[_0x5bcd('0x29')](function(_0x3f73ba){if(_0x3f73ba===null){return;}return db[_0x5bcd('0x73')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'VoicePrefixId':_0x3f73ba[_0x5bcd('0x74')]},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x30')][_0x5bcd('0x5b')]({'where':{'id':_0x51a5c7},'cascade':!![],'transaction':_0x57d96e});})['then'](function(_0x3c6e5a){if(_0x3c6e5a===0x0){_0x3a5f1a[_0x5bcd('0x1d')](0x194);}else{return db['UserProfileResource'][_0x5bcd('0x5b')]({'where':{'type':_0x5bcd('0x53'),'resourceId':_0x51a5c7},'cascade':!![],'transaction':_0x57d96e})['then'](function(){_0x3a5f1a[_0x5bcd('0x1e')](0xcc)[_0x5bcd('0x1f')]();});}})[_0x5bcd('0x49')](function(_0x4c6068){_0x3a5f1a[_0x5bcd('0x1e')](0x1f4)[_0x5bcd('0x2d')](_0x4c6068);});});};exports[_0x5bcd('0x75')]=function(_0x269f10,_0x5031e0,_0xa6f7d){return db['Team'][_0x5bcd('0x76')]({'where':{'id':_0x269f10[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](handleEntityNotFound(_0x5031e0,null))[_0x5bcd('0x29')](function(_0x13a686){if(!_0x269f10['query'][_0x5bcd('0x77')]||!utils[_0x5bcd('0x78')](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x77')])){throw new db[(_0x5bcd('0x5f'))]['ValidationError'](_0x5bcd('0x79'));}var _0x1636d8={};var _0xeec9fd={};_0xeec9fd[_0x5bcd('0x34')]=_['keys'](db[_['capitalize'](_0x269f10['query'][_0x5bcd('0x77')][_0x5bcd('0x7a')]())+_0x5bcd('0x7b')][_0x5bcd('0x4b')]);_0xeec9fd[_0x5bcd('0x35')]=_[_0x5bcd('0x36')](_0x269f10[_0x5bcd('0x35')]);_0xeec9fd['filters']=_['intersection'](_0xeec9fd[_0x5bcd('0x34')],_0xeec9fd[_0x5bcd('0x35')]);_0x1636d8['attributes']=_['intersection'](_0xeec9fd[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x39')]));_0x1636d8[_0x5bcd('0x3a')]=_0x1636d8['attributes']['length']?_0x1636d8[_0x5bcd('0x3a')]:_0xeec9fd['model'];_0x1636d8['limit']=qs['limit'](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x22')]);_0x1636d8[_0x5bcd('0x20')]=qs['offset'](_0x269f10['query'][_0x5bcd('0x20')]);_0x1636d8[_0x5bcd('0x3e')]=qs[_0x5bcd('0x3f')](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x3f')]);_0x1636d8['where']=qs[_0x5bcd('0x37')](_[_0x5bcd('0x41')](_0x269f10[_0x5bcd('0x35')],_0xeec9fd[_0x5bcd('0x37')]));_0x1636d8=_[_0x5bcd('0x43')]({},_0x1636d8,_0x269f10[_0x5bcd('0x45')]);return _0x13a686[_0x5bcd('0x50')+_['capitalize'](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x77')][_0x5bcd('0x7a')]())+_0x5bcd('0x7c')](_0x1636d8);})[_0x5bcd('0x29')](respondWithResult(_0x5031e0,null))[_0x5bcd('0x49')](handleError(_0x5031e0,null));};exports[_0x5bcd('0x7d')]=function(_0x5085a0,_0x5f5ad5,_0x5b8d09){return db['Team']['findOne']({'where':{'id':_0x5085a0[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](function(_0x585604){if(_0x585604){if(!_0x5085a0['body']['channel']||!utils[_0x5bcd('0x78')](_0x5085a0[_0x5bcd('0x4e')][_0x5bcd('0x77')])){throw new db['Sequelize'][(_0x5bcd('0x7e'))]('Unknown\x20channel');}return _0x585604[_0x5bcd('0x7f')+_['capitalize'](_0x5085a0[_0x5bcd('0x4e')]['channel']['toLowerCase']())+_0x5bcd('0x7c')](_0x5085a0[_0x5bcd('0x4e')][_0x5bcd('0x80')]);}return null;})['then'](handleEntityNotFound(_0x5f5ad5,null))[_0x5bcd('0x29')](respondWithStatusCode(_0x5f5ad5,null))['catch'](handleError(_0x5f5ad5,null));};exports[_0x5bcd('0x81')]=function(_0x5d037e,_0x326fa1,_0x71ef0e){return db['Team'][_0x5bcd('0x76')]({'where':{'id':_0x5d037e[_0x5bcd('0x5a')]['id']}})['then'](function(_0x5a54d8){if(_0x5a54d8){if(!_0x5d037e[_0x5bcd('0x35')]['channel']||!utils['isValidChannel'](_0x5d037e[_0x5bcd('0x35')][_0x5bcd('0x77')])){throw new db[(_0x5bcd('0x5f'))]['ValidationError'](_0x5bcd('0x79'));}return _0x5a54d8[_0x5bcd('0x82')+_[_0x5bcd('0x83')](_0x5d037e[_0x5bcd('0x35')][_0x5bcd('0x77')][_0x5bcd('0x7a')]())+'Queues'](_0x5d037e[_0x5bcd('0x35')][_0x5bcd('0x80')]);}return null;})[_0x5bcd('0x29')](handleEntityNotFound(_0x326fa1,null))['then'](respondWithStatusCode(_0x326fa1,null))['catch'](handleError(_0x326fa1,null));};exports['addAgents']=function(_0x4dfa2f,_0x2a3c28){var _0x2d88c6=_[_0x5bcd('0x84')](_0x4dfa2f[_0x5bcd('0x4e')][_0x5bcd('0x80')])?_0x4dfa2f[_0x5bcd('0x4e')]['ids']:[_0x4dfa2f[_0x5bcd('0x4e')][_0x5bcd('0x80')]];var _0x5be1e2=_0x4dfa2f[_0x5bcd('0x5a')]['id'];return db[_0x5bcd('0x30')][_0x5bcd('0x59')]({'where':{'id':_0x5be1e2}})[_0x5bcd('0x29')](handleEntityNotFound(_0x2a3c28,null))[_0x5bcd('0x29')](function(_0x3bf853){if(_0x3bf853){var _0x3ea745=[_0x5bcd('0x85'),'Chat','Mail',_0x5bcd('0x86'),_0x5bcd('0x87'),'Openchannel',_0x5bcd('0x88')];return db[_0x5bcd('0x5c')]['transaction'](function(_0x600699){var _0x150b00=_[_0x5bcd('0x2f')](_0x3ea745,function(_0x57f6c5){var _0x33b2b8={'attributes':['id',_0x5bcd('0x2c')]};if(_0x57f6c5===_0x5bcd('0x85')){_0x33b2b8[_0x5bcd('0x89')]={'attributes':[_0x5bcd('0x8a')]};}return _0x3bf853[_0x5bcd('0x50')+_0x57f6c5+_0x5bcd('0x7c')](_0x33b2b8)[_0x5bcd('0x29')](function(_0x2f04b7){var _0x49b0c0=_[_0x5bcd('0x2f')](_0x2f04b7,function(_0x28be43){var _0x374ba5=_[_0x5bcd('0x2f')](_0x2d88c6,function(_0x36ade2){var _0x221514={'where':{'UserId':_0x36ade2,[_0x57f6c5+'QueueId']:_0x28be43['id']},'transaction':_0x600699};if(_0x57f6c5===_0x5bcd('0x85')){_0x221514['defaults']={'penalty':_0x28be43[_0x5bcd('0x8b')]['penalty']};}return db[_0x5bcd('0x8c')+_0x57f6c5+_0x5bcd('0x7b')][_0x5bcd('0x8d')](_0x221514)[_0x5bcd('0x29')](function(){socket['emit'](_0x5bcd('0x4f')+_0x57f6c5+_0x5bcd('0x8e'),{'UserId':_0x36ade2,[_0x57f6c5+'QueueId']:_0x28be43['id']});if(_0x57f6c5!==_0x5bcd('0x85')){return;}return db[_0x5bcd('0x8c')][_0x5bcd('0x47')]({'where':{'id':_0x2d88c6,'online':0x1},'attributes':['id',_0x5bcd('0x2c'),_0x5bcd('0x8f'),_0x5bcd('0x90'),_0x5bcd('0x91')],'raw':!![]})[_0x5bcd('0x29')](function(_0x33cfe9){var _0x5756d9=_['map'](_0x33cfe9,function(_0x4fcbdc){return db[_0x5bcd('0x92')][_0x5bcd('0x93')]({'membername':_0x4fcbdc[_0x5bcd('0x2c')],'UserId':_0x4fcbdc['id'],'queue_name':_0x28be43[_0x5bcd('0x2c')],'VoiceQueueId':_0x28be43['id'],'interface':_[_0x5bcd('0x94')](_0x4fcbdc[_0x5bcd('0x91')])?util[_0x5bcd('0x95')](_0x5bcd('0x96'),_0x4fcbdc[_0x5bcd('0x2c')]):_0x4fcbdc[_0x5bcd('0x91')],'paused':_0x4fcbdc[_0x5bcd('0x90')]||![],'penalty':_0x28be43[_0x5bcd('0x8b')][_0x5bcd('0x8a')]},{'transaction':_0x600699});});return Promise[_0x5bcd('0x97')](_0x5756d9);});});});return Promise['all'](_0x374ba5);});return Promise[_0x5bcd('0x97')](_0x49b0c0);})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x72')][_0x5bcd('0x76')]({'where':{'teamId':_0x5be1e2}})[_0x5bcd('0x29')](function(_0x4a9048){if(_0x4a9048){var _0x382fef=_[_0x5bcd('0x2f')](_0x2d88c6,function(_0x331255){db[_0x5bcd('0x73')][_0x5bcd('0x93')]({'UserId':_0x331255,'VoicePrefixId':_0x4a9048[_0x5bcd('0x74')]});});return Promise['all'](_0x382fef);}});});});return Promise[_0x5bcd('0x97')](_0x150b00)[_0x5bcd('0x29')](function(){return _0x3bf853[_0x5bcd('0x98')](_0x2d88c6,{'transaction':_0x600699})['spread'](function(_0x57385d){return _0x57385d;});});});}})[_0x5bcd('0x29')](respondWithResult(_0x2a3c28,null))[_0x5bcd('0x49')](handleError(_0x2a3c28,null));};exports['removeAgents']=function(_0x38e303,_0x413ade){var _0x2f37c8=_['isArray'](_0x38e303[_0x5bcd('0x35')][_0x5bcd('0x80')])?_0x38e303['query'][_0x5bcd('0x80')]:[_0x38e303[_0x5bcd('0x35')]['ids']];var _0x2fddd5=_0x38e303['params']['id'];return db[_0x5bcd('0x30')][_0x5bcd('0x59')]({'where':{'id':_0x2fddd5}})[_0x5bcd('0x29')](handleEntityNotFound(_0x413ade,null))['then'](function(_0x11a0ae){if(_0x11a0ae){var _0x552384=[_0x5bcd('0x85'),_0x5bcd('0x99'),'Mail',_0x5bcd('0x86'),_0x5bcd('0x87'),'Openchannel',_0x5bcd('0x88')];return db[_0x5bcd('0x5c')]['transaction'](function(_0x1416b3){var _0x535d67=_[_0x5bcd('0x2f')](_0x552384,function(_0xdf6449){var _0x91e1c3={'attributes':['id',_0x5bcd('0x2c')]};return _0x11a0ae[_0x5bcd('0x50')+_0xdf6449+_0x5bcd('0x7c')](_0x91e1c3)[_0x5bcd('0x29')](function(_0x2341c2){var _0x5e7446=_[_0x5bcd('0x2f')](_0x2341c2,function(_0x25d9b9){return _0x25d9b9[_0x5bcd('0x9a')](_0x2f37c8,{'transaction':_0x1416b3})[_0x5bcd('0x29')](function(){var _0x7df2d1=_[_0x5bcd('0x2f')](_0x2f37c8,function(_0x3c2985){socket['emit'](_0x5bcd('0x4f')+_0xdf6449+_0x5bcd('0x9b'),{'UserId':Number(_0x3c2985),[_0xdf6449+_0x5bcd('0x9c')]:_0x25d9b9['id']});if(_0xdf6449!==_0x5bcd('0x85')){return;}return db[_0x5bcd('0x92')]['destroy']({'where':{'VoiceQueueId':_0x25d9b9['id'],'UserId':_0x3c2985},'transaction':_0x1416b3});});return Promise['all'](_0x7df2d1);});});return Promise[_0x5bcd('0x97')](_0x5e7446);});});return Promise[_0x5bcd('0x97')](_0x535d67)['then'](function(){return _0x11a0ae[_0x5bcd('0x9a')](_0x2f37c8,{'transaction':_0x1416b3});})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x72')][_0x5bcd('0x76')]({'where':{'teamId':_0x2fddd5}})['then'](function(_0x3fe9a4){if(_0x3fe9a4){var _0xab9eaf=_['map'](_0x2f37c8,function(_0x433821){db['UserVoicePrefix'][_0x5bcd('0x5b')]({'where':{'UserId':_0x433821,'VoicePrefixId':_0x3fe9a4[_0x5bcd('0x74')]}});});return Promise[_0x5bcd('0x97')](_0xab9eaf);}});});});}})[_0x5bcd('0x29')](respondWithStatusCode(_0x413ade,null))[_0x5bcd('0x49')](handleError(_0x413ade,null));};exports[_0x5bcd('0x9d')]=function(_0x3b4701,_0x3e050f,_0x282bc3){var _0x49a789={};var _0x586cfe={};var _0x5d0d3a;var _0x50fd7b;return db['Team']['findOne']({'where':{'id':_0x3b4701[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](handleEntityNotFound(_0x3e050f,null))[_0x5bcd('0x29')](function(_0x1d8874){if(_0x1d8874){_0x5d0d3a=_0x1d8874;_0x586cfe[_0x5bcd('0x34')]=_['keys'](db[_0x5bcd('0x8c')][_0x5bcd('0x4b')]);_0x586cfe['query']=_[_0x5bcd('0x36')](_0x3b4701['query']);_0x586cfe[_0x5bcd('0x37')]=_[_0x5bcd('0x38')](_0x586cfe[_0x5bcd('0x34')],_0x586cfe[_0x5bcd('0x35')]);_0x49a789[_0x5bcd('0x3a')]=_[_0x5bcd('0x38')](_0x586cfe[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0x3b4701['query']['fields']));_0x49a789[_0x5bcd('0x3a')]=_0x49a789[_0x5bcd('0x3a')][_0x5bcd('0x3b')]?_0x49a789[_0x5bcd('0x3a')]:_0x586cfe[_0x5bcd('0x34')];_0x49a789[_0x5bcd('0x3e')]=qs[_0x5bcd('0x3f')](_0x3b4701['query'][_0x5bcd('0x3f')]);_0x49a789[_0x5bcd('0x40')]=qs[_0x5bcd('0x37')](_[_0x5bcd('0x41')](_0x3b4701[_0x5bcd('0x35')],_0x586cfe['filters']));if(_0x3b4701['query']['filter']){_0x49a789[_0x5bcd('0x40')]=_[_0x5bcd('0x43')](_0x49a789[_0x5bcd('0x40')],{'$or':_['map'](_0x49a789[_0x5bcd('0x3a')],function(_0x386dea){var _0x5be4a1={};_0x5be4a1[_0x386dea]={'$like':'%'+_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x42')]+'%'};return _0x5be4a1;})});}_0x49a789=_[_0x5bcd('0x43')]({},_0x49a789,_0x3b4701[_0x5bcd('0x45')]);return _0x5d0d3a[_0x5bcd('0x9d')](_0x49a789);}})[_0x5bcd('0x29')](function(_0xd3c485){if(_0xd3c485){_0x50fd7b=_0xd3c485[_0x5bcd('0x3b')];if(!_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x3c')](_0x5bcd('0x3d'))){_0x49a789[_0x5bcd('0x22')]=qs[_0x5bcd('0x22')](_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x22')]);_0x49a789[_0x5bcd('0x20')]=qs[_0x5bcd('0x20')](_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x20')]);}return _0x5d0d3a[_0x5bcd('0x9d')](_0x49a789);}})[_0x5bcd('0x29')](function(_0x475498){if(_0x475498){return _0x475498?{'count':_0x50fd7b,'rows':_0x475498}:null;}})[_0x5bcd('0x29')](respondWithResult(_0x3e050f,null))[_0x5bcd('0x49')](handleError(_0x3e050f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 7ebfca5..b9a1463 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4659=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','save','update'];(function(_0x22ed3e,_0xb04e3f){var _0x194d99=function(_0x1643e8){while(--_0x1643e8){_0x22ed3e['push'](_0x22ed3e['shift']());}};_0x194d99(++_0xb04e3f);}(_0x4659,0x13b));var _0x9465=function(_0x41f039,_0x2cdd58){_0x41f039=_0x41f039-0x0;var _0x97be15=_0x4659[_0x41f039];return _0x97be15;};'use strict';var EventEmitter=require(_0x9465('0x0'));var Team=require(_0x9465('0x1'))['db'][_0x9465('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9465('0x3'),'afterUpdate':_0x9465('0x4'),'afterDestroy':_0x9465('0x5')};function emitEvent(_0x1c77b9){return function(_0x1ebc84,_0x263593,_0x59c308){TeamEvents[_0x9465('0x6')](_0x1c77b9+':'+_0x1ebc84['id'],_0x1ebc84);TeamEvents[_0x9465('0x6')](_0x1c77b9,_0x1ebc84);_0x59c308(null);};}for(var e in events){if(events[_0x9465('0x7')](e)){var event=events[e];Team[_0x9465('0x8')](e,emitEvent(event));}}module[_0x9465('0x9')]=TeamEvents; \ No newline at end of file +var _0x01c2=['update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x4789ba,_0x4740e8){var _0xf1ef85=function(_0x26ec0d){while(--_0x26ec0d){_0x4789ba['push'](_0x4789ba['shift']());}};_0xf1ef85(++_0x4740e8);}(_0x01c2,0x17c));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x201c('0x0'));var Team=require(_0x201c('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x201c('0x2')](0x0);var events={'afterCreate':_0x201c('0x3'),'afterUpdate':_0x201c('0x4'),'afterDestroy':_0x201c('0x5')};function emitEvent(_0x1fa209){return function(_0x123ffa,_0x3fe569,_0x8873dd){TeamEvents[_0x201c('0x6')](_0x1fa209+':'+_0x123ffa['id'],_0x123ffa);TeamEvents[_0x201c('0x6')](_0x1fa209,_0x123ffa);_0x8873dd(null);};}for(var e in events){if(events[_0x201c('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 3759641..fda7080 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd37c=['Chat','Fax','Mail','Openchannel','Whatsapp','resolve','all','lodash','./team.attributes','Queues','then','map','setDataValue','channel','catch','exports','define','Team'];(function(_0x12143d,_0x38299f){var _0xf007db=function(_0xe98497){while(--_0xe98497){_0x12143d['push'](_0x12143d['shift']());}};_0xf007db(++_0x38299f);}(_0xd37c,0x15d));var _0xcd37=function(_0x4f1572,_0x1ec764){_0x4f1572=_0x4f1572-0x0;var _0x58bb3b=_0xd37c[_0x4f1572];return _0x58bb3b;};'use strict';var _=require(_0xcd37('0x0'));var attributes=require(_0xcd37('0x1'));function getQueuesByChannel(_0x1d4e66,_0x1176ff){var _0xda28a8='get'+_0x1176ff+_0xcd37('0x2');return _0x1d4e66[_0xda28a8]()[_0xcd37('0x3')](function(_0x5bcf7f){return _[_0xcd37('0x4')](_0x5bcf7f,function(_0x2f417d){_0x2f417d[_0xcd37('0x5')](_0xcd37('0x6'),_0x1176ff);return _0x2f417d;});})[_0xcd37('0x7')](function(_0xe3627a){throw _0xe3627a;});}module[_0xcd37('0x8')]=function(_0x394352){return _0x394352[_0xcd37('0x9')](_0xcd37('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1045f5=this;var _0x24f371=[_0xcd37('0xb'),_0xcd37('0xc'),_0xcd37('0xd'),_0xcd37('0xe'),'Sms','Voice',_0xcd37('0xf')];return Promise[_0xcd37('0x10')]()[_0xcd37('0x3')](function(){var _0x3a1430=_[_0xcd37('0x4')](_0x24f371,function(_0x124e1a){return getQueuesByChannel(_0x1045f5,_0x124e1a);});return Promise[_0xcd37('0x11')](_0x3a1430);})[_0xcd37('0x7')](function(_0x407f9a){throw _0x407f9a;});}}});}; \ No newline at end of file +var _0xf76d=['then','map','lodash','./team.attributes','get','Queues','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Sms','Whatsapp','resolve'];(function(_0x8b6a57,_0x87143e){var _0x8ff90f=function(_0x4186a6){while(--_0x4186a6){_0x8b6a57['push'](_0x8b6a57['shift']());}};_0x8ff90f(++_0x87143e);}(_0xf76d,0xda));var _0xdf76=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0xf76d[_0x5b8685];return _0xa3ef57;};'use strict';var _=require(_0xdf76('0x0'));var attributes=require(_0xdf76('0x1'));function getQueuesByChannel(_0x14378a,_0x5b48ce){var _0x37f4c5=_0xdf76('0x2')+_0x5b48ce+_0xdf76('0x3');return _0x14378a[_0x37f4c5]()['then'](function(_0x106c35){return _['map'](_0x106c35,function(_0x530c75){_0x530c75['setDataValue'](_0xdf76('0x4'),_0x5b48ce);return _0x530c75;});})[_0xdf76('0x5')](function(_0x29bc0b){throw _0x29bc0b;});}module[_0xdf76('0x6')]=function(_0x3a2e23){return _0x3a2e23[_0xdf76('0x7')](_0xdf76('0x8'),attributes,{'tableName':_0xdf76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xaf5ba8=this;var _0x379912=[_0xdf76('0xa'),_0xdf76('0xb'),_0xdf76('0xc'),'Openchannel',_0xdf76('0xd'),'Voice',_0xdf76('0xe')];return Promise[_0xdf76('0xf')]()[_0xdf76('0x10')](function(){var _0x52dc95=_[_0xdf76('0x11')](_0x379912,function(_0x2e1610){return getQueuesByChannel(_0xaf5ba8,_0x2e1610);});return Promise['all'](_0x52dc95);})[_0xdf76('0x5')](function(_0x5b6aad){throw _0x5b6aad;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 789c0b9..70409ca 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0c0=['Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xf0c0,0xee));var _0x0f0c=function(_0xd13cf5,_0x301806){_0xd13cf5=_0xd13cf5-0x0;var _0x550f9c=_0xf0c0[_0xd13cf5];return _0x550f9c;};'use strict';var _=require('lodash');var util=require(_0x0f0c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f0c('0x1'));var fs=require('fs');var Redis=require(_0x0f0c('0x2'));var db=require(_0x0f0c('0x3'))['db'];var utils=require(_0x0f0c('0x4'));var logger=require(_0x0f0c('0x5'))(_0x0f0c('0x6'));var config=require(_0x0f0c('0x7'));var jayson=require(_0x0f0c('0x8'));var client=jayson[_0x0f0c('0x9')][_0x0f0c('0xa')]({'port':0x232a});config[_0x0f0c('0xb')]=_[_0x0f0c('0xc')](config[_0x0f0c('0xb')],{'host':_0x0f0c('0xd'),'port':0x18eb});var socket=require(_0x0f0c('0xe'))(new Redis(config[_0x0f0c('0xb')]));require(_0x0f0c('0xf'))[_0x0f0c('0x10')](socket);function respondWithRpcPromise(_0x5d3b06,_0x710e97,_0x193a7a){return new BPromise(function(_0x13c939,_0x4c48a8){return client[_0x0f0c('0x11')](_0x5d3b06,_0x193a7a)[_0x0f0c('0x12')](function(_0x122f2a){logger[_0x0f0c('0x13')](_0x0f0c('0x14'),_0x710e97,_0x0f0c('0x15'));logger[_0x0f0c('0x16')](_0x0f0c('0x17'),_0x710e97,_0x0f0c('0x15'),JSON[_0x0f0c('0x18')](_0x122f2a));if(_0x122f2a[_0x0f0c('0x19')]){if(_0x122f2a[_0x0f0c('0x19')]['code']===0x1f4){logger['error'](_0x0f0c('0x14'),_0x710e97,_0x122f2a[_0x0f0c('0x19')]['message']);return _0x4c48a8(_0x122f2a['error'][_0x0f0c('0x1a')]);}logger[_0x0f0c('0x19')](_0x0f0c('0x14'),_0x710e97,_0x122f2a[_0x0f0c('0x19')][_0x0f0c('0x1a')]);return _0x13c939(_0x122f2a[_0x0f0c('0x19')][_0x0f0c('0x1a')]);}else{logger['info'](_0x0f0c('0x14'),_0x710e97,_0x0f0c('0x15'));_0x13c939(_0x122f2a[_0x0f0c('0x1b')][_0x0f0c('0x1a')]);}})[_0x0f0c('0x1c')](function(_0x37aecc){logger[_0x0f0c('0x19')](_0x0f0c('0x14'),_0x710e97,_0x37aecc);_0x4c48a8(_0x37aecc);});});} \ No newline at end of file +var _0x5b07=['request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','localhost','redis','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x5b07,0x1b5));var _0x75b0=function(_0x2f429c,_0xbab4cc){_0x2f429c=_0x2f429c-0x0;var _0x3041c3=_0x5b07[_0x2f429c];return _0x3041c3;};'use strict';var _=require(_0x75b0('0x0'));var util=require(_0x75b0('0x1'));var moment=require(_0x75b0('0x2'));var BPromise=require(_0x75b0('0x3'));var rs=require(_0x75b0('0x4'));var fs=require('fs');var Redis=require(_0x75b0('0x5'));var db=require(_0x75b0('0x6'))['db'];var utils=require(_0x75b0('0x7'));var logger=require(_0x75b0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x75b0('0x9'));var client=jayson[_0x75b0('0xa')]['http']({'port':0x232a});config['redis']=_[_0x75b0('0xb')](config['redis'],{'host':_0x75b0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75b0('0xd')]));require('./team.socket')[_0x75b0('0xe')](socket);function respondWithRpcPromise(_0x5417fc,_0x2bd5f1,_0x1c8641){return new BPromise(function(_0x193ebd,_0x3da89c){return client[_0x75b0('0xf')](_0x5417fc,_0x1c8641)[_0x75b0('0x10')](function(_0x31118a){logger[_0x75b0('0x11')](_0x75b0('0x12'),_0x2bd5f1,_0x75b0('0x13'));logger[_0x75b0('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x2bd5f1,_0x75b0('0x13'),JSON['stringify'](_0x31118a));if(_0x31118a[_0x75b0('0x15')]){if(_0x31118a[_0x75b0('0x15')][_0x75b0('0x16')]===0x1f4){logger[_0x75b0('0x15')](_0x75b0('0x12'),_0x2bd5f1,_0x31118a[_0x75b0('0x15')]['message']);return _0x3da89c(_0x31118a[_0x75b0('0x15')][_0x75b0('0x17')]);}logger['error'](_0x75b0('0x12'),_0x2bd5f1,_0x31118a['error']['message']);return _0x193ebd(_0x31118a[_0x75b0('0x15')][_0x75b0('0x17')]);}else{logger[_0x75b0('0x11')](_0x75b0('0x12'),_0x2bd5f1,'request\x20sent');_0x193ebd(_0x31118a['result'][_0x75b0('0x17')]);}})['catch'](function(_0xf620f9){logger[_0x75b0('0x15')](_0x75b0('0x12'),_0x2bd5f1,_0xf620f9);_0x3da89c(_0xf620f9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 05489b2..7a97347 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['emit','removeListener','length','team:','remove'];(function(_0x55a39d,_0x53791b){var _0x11e560=function(_0x2b93c3){while(--_0x2b93c3){_0x55a39d['push'](_0x55a39d['shift']());}};_0x11e560(++_0x53791b);}(_0xa74f,0x9a));var _0xfa74=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xa74f[_0x2bf466];return _0x856885;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0xfa74('0x0'),'update'];function createListener(_0x4b5765,_0x29e4c8){return function(_0x110824){_0x29e4c8[_0xfa74('0x1')](_0x4b5765,_0x110824);};}function removeListener(_0x25a9b7,_0x5b367b){return function(){TeamEvents[_0xfa74('0x2')](_0x25a9b7,_0x5b367b);};}exports['register']=function(_0x543cfe){for(var _0x43dd2f=0x0,_0x9ddbd2=events[_0xfa74('0x3')];_0x43dd2f<_0x9ddbd2;_0x43dd2f++){var _0x2d9fa9=events[_0x43dd2f];var _0x287921=createListener(_0xfa74('0x4')+_0x2d9fa9,_0x543cfe);TeamEvents['on'](_0x2d9fa9,_0x287921);}}; \ No newline at end of file +var _0xb3e6=['length','./team.events','remove','update','emit','removeListener'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb3e6,0x13f));var _0x6b3e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb3e6[_0x53ccf2];return _0x5a2964;};'use strict';var TeamEvents=require(_0x6b3e('0x0'));var events=['save',_0x6b3e('0x1'),_0x6b3e('0x2')];function createListener(_0x405703,_0x119be2){return function(_0x2993f5){_0x119be2[_0x6b3e('0x3')](_0x405703,_0x2993f5);};}function removeListener(_0x30030c,_0x3c549a){return function(){TeamEvents[_0x6b3e('0x4')](_0x30030c,_0x3c549a);};}exports['register']=function(_0x184797){for(var _0x22c902=0x0,_0xe21cbe=events[_0x6b3e('0x5')];_0x22c902<_0xe21cbe;_0x22c902++){var _0x1e77b7=events[_0x22c902];var _0x5f3a2a=createListener('team:'+_0x1e77b7,_0x184797);TeamEvents['on'](_0x1e77b7,_0x5f3a2a);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 573ca9c..6394ce0 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c4b=['sequelize','exports','INTEGER'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x6c4b,0x93));var _0xb6c4=function(_0x1e46e0,_0x5c4908){_0x1e46e0=_0x1e46e0-0x0;var _0x330742=_0x6c4b[_0x1e46e0];return _0x330742;};'use strict';var Sequelize=require(_0xb6c4('0x0'));module[_0xb6c4('0x1')]={'TeamId':{'type':Sequelize[_0xb6c4('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7daf=['exports','INTEGER'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x7daf,0xaa));var _0xf7da=function(_0x28e78c,_0x1819c1){_0x28e78c=_0x28e78c-0x0;var _0x164e5c=_0x7daf[_0x28e78c];return _0x164e5c;};'use strict';var Sequelize=require('sequelize');module[_0xf7da('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf7da('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 7051ba2..381d454 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63c6=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x63c6,0xbb));var _0x663c=function(_0x48e954,_0x4546e8){_0x48e954=_0x48e954-0x0;var _0x124016=_0x63c6[_0x48e954];return _0x124016;};'use strict';var _=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x663c('0x2'));var BPromise=require(_0x663c('0x3'));var rp=require(_0x663c('0x4'));var fs=require('fs');var path=require(_0x663c('0x5'));var rimraf=require(_0x663c('0x6'));var config=require(_0x663c('0x7'));var attributes=require(_0x663c('0x8'));module[_0x663c('0x9')]=function(_0x6bdbd1,_0x4fedf8){return _0x6bdbd1[_0x663c('0xa')](_0x663c('0xb'),attributes,{'tableName':_0x663c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcabe=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xcabe,0x1ef));var _0xecab=function(_0x304a51,_0x3f7af1){_0x304a51=_0x304a51-0x0;var _0x516132=_0xcabe[_0x304a51];return _0x516132;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var logger=require(_0xecab('0x1'))(_0xecab('0x2'));var moment=require('moment');var BPromise=require(_0xecab('0x3'));var rp=require(_0xecab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecab('0x5'));var config=require(_0xecab('0x6'));var attributes=require(_0xecab('0x7'));module['exports']=function(_0x2ef298,_0x2ace9c){return _0x2ef298[_0xecab('0x8')](_0xecab('0x9'),attributes,{'tableName':_0xecab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a2ed580..21ab69a 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x574f2c,_0x4dcff7){var _0x3d2e59=function(_0x30e993){while(--_0x30e993){_0x574f2c['push'](_0x574f2c['shift']());}};_0x3d2e59(++_0x4dcff7);}(_0x70e0,0x17b));var _0x070e=function(_0x4c1a3b,_0x200ce8){_0x4c1a3b=_0x4c1a3b-0x0;var _0xe53986=_0x70e0[_0x4c1a3b];return _0xe53986;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 6c032f7..7021778 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe436=['exports','sequelize'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0xe436,0x1af));var _0x6e43=function(_0x4d9c62,_0x51f760){_0x4d9c62=_0x4d9c62-0x0;var _0x522e2c=_0xe436[_0x4d9c62];return _0x522e2c;};'use strict';var Sequelize=require(_0x6e43('0x0'));module[_0x6e43('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x47f4=['exports','INTEGER'];(function(_0x2cb742,_0x16184d){var _0x4e9847=function(_0x16ce9d){while(--_0x16ce9d){_0x2cb742['push'](_0x2cb742['shift']());}};_0x4e9847(++_0x16184d);}(_0x47f4,0x86));var _0x447f=function(_0x145480,_0x2a9538){_0x145480=_0x145480-0x0;var _0x39633d=_0x47f4[_0x145480];return _0x39633d;};'use strict';var Sequelize=require('sequelize');module[_0x447f('0x0')]={'penalty':{'type':Sequelize[_0x447f('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 6d92d08..02bf90d 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x777f=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x777f,0x9f));var _0xf777=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x777f[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var logger=require(_0xf777('0x2'))(_0xf777('0x3'));var moment=require(_0xf777('0x4'));var BPromise=require(_0xf777('0x5'));var rp=require(_0xf777('0x6'));var fs=require('fs');var path=require(_0xf777('0x7'));var rimraf=require('rimraf');var config=require(_0xf777('0x8'));var attributes=require(_0xf777('0x9'));module['exports']=function(_0x5b7903,_0x5df5dc){return _0x5b7903[_0xf777('0xa')](_0xf777('0xb'),attributes,{'tableName':_0xf777('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04de=['./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x04de,0x107));var _0xe04d=function(_0x299a52,_0x305640){_0x299a52=_0x299a52-0x0;var _0x152cf8=_0x04de[_0x299a52];return _0x152cf8;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 0fb19a1..f748494 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb64e=['http','request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x38f386,_0x223e5e){var _0x501672=function(_0xbc392c){while(--_0xbc392c){_0x38f386['push'](_0x38f386['shift']());}};_0x501672(++_0x223e5e);}(_0xb64e,0x89));var _0xeb64=function(_0xb0be8e,_0x3a1258){_0xb0be8e=_0xb0be8e-0x0;var _0x4ee710=_0xb64e[_0xb0be8e];return _0x4ee710;};'use strict';var _=require(_0xeb64('0x0'));var util=require(_0xeb64('0x1'));var moment=require('moment');var BPromise=require(_0xeb64('0x2'));var rs=require(_0xeb64('0x3'));var fs=require('fs');var Redis=require(_0xeb64('0x4'));var db=require(_0xeb64('0x5'))['db'];var utils=require(_0xeb64('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xeb64('0x7'));var jayson=require(_0xeb64('0x8'));var client=jayson[_0xeb64('0x9')][_0xeb64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27410b,_0x2a212d,_0xe843e7){return new BPromise(function(_0x303707,_0x5a2c1b){return client[_0xeb64('0xb')](_0x27410b,_0xe843e7)['then'](function(_0x33ecb7){logger['info'](_0xeb64('0xc'),_0x2a212d,_0xeb64('0xd'));logger[_0xeb64('0xe')](_0xeb64('0xf'),_0x2a212d,_0xeb64('0xd'),JSON['stringify'](_0x33ecb7));if(_0x33ecb7[_0xeb64('0x10')]){if(_0x33ecb7[_0xeb64('0x10')][_0xeb64('0x11')]===0x1f4){logger['error'](_0xeb64('0xc'),_0x2a212d,_0x33ecb7[_0xeb64('0x10')][_0xeb64('0x12')]);return _0x5a2c1b(_0x33ecb7[_0xeb64('0x10')][_0xeb64('0x12')]);}logger[_0xeb64('0x10')](_0xeb64('0xc'),_0x2a212d,_0x33ecb7[_0xeb64('0x10')][_0xeb64('0x12')]);return _0x303707(_0x33ecb7[_0xeb64('0x10')][_0xeb64('0x12')]);}else{logger[_0xeb64('0x13')](_0xeb64('0xc'),_0x2a212d,_0xeb64('0xd'));_0x303707(_0x33ecb7['result']['message']);}})[_0xeb64('0x14')](function(_0x17087b){logger[_0xeb64('0x10')](_0xeb64('0xc'),_0x2a212d,_0x17087b);_0x5a2c1b(_0x17087b);});});} \ No newline at end of file +var _0xea67=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2832fd,_0x1f8201){var _0x1fece1=function(_0x212e95){while(--_0x212e95){_0x2832fd['push'](_0x2832fd['shift']());}};_0x1fece1(++_0x1f8201);}(_0xea67,0x172));var _0x7ea6=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0xea67[_0x329905];return _0x3aa42;};'use strict';var _=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var moment=require(_0x7ea6('0x2'));var BPromise=require(_0x7ea6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ea6('0x4'));var db=require(_0x7ea6('0x5'))['db'];var utils=require(_0x7ea6('0x6'));var logger=require('../../config/logger')(_0x7ea6('0x7'));var config=require(_0x7ea6('0x8'));var jayson=require(_0x7ea6('0x9'));var client=jayson[_0x7ea6('0xa')][_0x7ea6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b5ce8,_0x2cc5cb,_0x14904f){return new BPromise(function(_0x3dabab,_0x59f2c9){return client[_0x7ea6('0xc')](_0x1b5ce8,_0x14904f)['then'](function(_0x383f6e){logger[_0x7ea6('0xd')](_0x7ea6('0xe'),_0x2cc5cb,_0x7ea6('0xf'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2cc5cb,_0x7ea6('0xf'),JSON[_0x7ea6('0x10')](_0x383f6e));if(_0x383f6e[_0x7ea6('0x11')]){if(_0x383f6e['error'][_0x7ea6('0x12')]===0x1f4){logger[_0x7ea6('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2cc5cb,_0x383f6e[_0x7ea6('0x11')][_0x7ea6('0x13')]);return _0x59f2c9(_0x383f6e[_0x7ea6('0x11')]['message']);}logger[_0x7ea6('0x11')](_0x7ea6('0xe'),_0x2cc5cb,_0x383f6e['error']['message']);return _0x3dabab(_0x383f6e[_0x7ea6('0x11')][_0x7ea6('0x13')]);}else{logger[_0x7ea6('0xd')](_0x7ea6('0xe'),_0x2cc5cb,_0x7ea6('0xf'));_0x3dabab(_0x383f6e[_0x7ea6('0x14')]['message']);}})[_0x7ea6('0x15')](function(_0x17f588){logger['error'](_0x7ea6('0xe'),_0x2cc5cb,_0x17f588);_0x59f2c9(_0x17f588);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ff351ea..bf83dd5 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4d9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb4d9,0xce));var _0x9b4d=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xb4d9[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var path=require('path');var timeout=require(_0x9b4d('0x2'));var express=require(_0x9b4d('0x3'));var router=express[_0x9b4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b4d('0x5'));var interaction=require(_0x9b4d('0x6'));var config=require(_0x9b4d('0x7'));var controller=require(_0x9b4d('0x8'));router[_0x9b4d('0x9')]('/',auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xb')]);router[_0x9b4d('0x9')](_0x9b4d('0xc'),auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xd')]);router['post']('/',auth[_0x9b4d('0xa')](),controller['create']);router[_0x9b4d('0xe')]('/:id',auth[_0x9b4d('0xa')](),controller[_0x9b4d('0xf')]);router[_0x9b4d('0x10')](_0x9b4d('0xc'),auth[_0x9b4d('0xa')](),controller[_0x9b4d('0x11')]);module[_0x9b4d('0x12')]=router; \ No newline at end of file +var _0x1b0e=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports'];(function(_0x4a79c2,_0x3e5e45){var _0x6385e9=function(_0x3afad2){while(--_0x3afad2){_0x4a79c2['push'](_0x4a79c2['shift']());}};_0x6385e9(++_0x3e5e45);}(_0x1b0e,0x132));var _0xe1b0=function(_0x4458c6,_0x17d62f){_0x4458c6=_0x4458c6-0x0;var _0x4e9557=_0x1b0e[_0x4458c6];return _0x4e9557;};'use strict';var multer=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var path=require(_0xe1b0('0x2'));var timeout=require(_0xe1b0('0x3'));var express=require(_0xe1b0('0x4'));var router=express[_0xe1b0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var controller=require('./template.controller');router[_0xe1b0('0x8')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xa')]);router['get'](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['show']);router[_0xe1b0('0xc')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xd')]);router[_0xe1b0('0xe')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xf')]);router[_0xe1b0('0x10')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['destroy']);module[_0xe1b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b74bab8..eb1bd9e 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9098=['STRING','sequelize','exports'];(function(_0xc22d61,_0x29a510){var _0xd25cdc=function(_0x2cf642){while(--_0x2cf642){_0xc22d61['push'](_0xc22d61['shift']());}};_0xd25cdc(++_0x29a510);}(_0x9098,0xbe));var _0x8909=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9098[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x8909('0x0'));module[_0x8909('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8909('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x57dc=['STRING','TEXT'];(function(_0x1a0145,_0x4cbc1e){var _0xd3a095=function(_0xd94985){while(--_0xd94985){_0x1a0145['push'](_0x1a0145['shift']());}};_0xd3a095(++_0x4cbc1e);}(_0x57dc,0x178));var _0xc57d=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x57dc[_0x337748];return _0x3bb03f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc57d('0x0')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xc57d('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 493d2b5..473a7a1 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb70=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../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','save','update','then','destroy','get','Templates','UserProfileResource','name','send','Template','rawAttributes','type','key','model','filters','query','attributes','intersection','fields','length'];(function(_0x480957,_0x2632b7){var _0x5101d3=function(_0xca6835){while(--_0xca6835){_0x480957['push'](_0x480957['shift']());}};_0x5101d3(++_0x2632b7);}(_0xbb70,0x1e4));var _0x0bb7=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xbb70[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0x0bb7('0x0'));var rimraf=require(_0x0bb7('0x1'));var zipdir=require(_0x0bb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bb7('0x3'));var moment=require('moment');var BPromise=require(_0x0bb7('0x4'));var Mustache=require(_0x0bb7('0x5'));var util=require(_0x0bb7('0x6'));var path=require(_0x0bb7('0x7'));var sox=require(_0x0bb7('0x8'));var csv=require('to-csv');var ejs=require(_0x0bb7('0x9'));var fs=require('fs');var fs_extra=require(_0x0bb7('0xa'));var _=require(_0x0bb7('0xb'));var squel=require(_0x0bb7('0xc'));var crypto=require('crypto');var jsforce=require(_0x0bb7('0xd'));var deskjs=require(_0x0bb7('0xe'));var toCsv=require(_0x0bb7('0xf'));var querystring=require(_0x0bb7('0x10'));var Papa=require('papaparse');var Redis=require(_0x0bb7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bb7('0x12'));var hardwareService=require(_0x0bb7('0x13'));var logger=require(_0x0bb7('0x14'))(_0x0bb7('0x15'));var utils=require(_0x0bb7('0x16'));var config=require(_0x0bb7('0x17'));var licenseUtil=require(_0x0bb7('0x18'));var db=require(_0x0bb7('0x19'))['db'];function respondWithStatusCode(_0x36da10,_0x1d7a15){_0x1d7a15=_0x1d7a15||0xcc;return function(_0x3c508c){if(_0x3c508c){return _0x36da10['sendStatus'](_0x1d7a15);}return _0x36da10[_0x0bb7('0x1a')](_0x1d7a15)[_0x0bb7('0x1b')]();};}function respondWithResult(_0x5d3a25,_0x4c14fb){_0x4c14fb=_0x4c14fb||0xc8;return function(_0x3ab296){if(_0x3ab296){return _0x5d3a25['status'](_0x4c14fb)[_0x0bb7('0x1c')](_0x3ab296);}};}function respondWithFilteredResult(_0x62cea2,_0x31456c){return function(_0x2363d6){if(_0x2363d6){var _0x14e390=typeof _0x31456c[_0x0bb7('0x1d')]===_0x0bb7('0x1e')&&typeof _0x31456c[_0x0bb7('0x1f')]===_0x0bb7('0x1e');var _0x547af2=_0x2363d6[_0x0bb7('0x20')];var _0xb8a7d1=_0x14e390?0x0:_0x31456c['offset'];var _0x3c4a73=_0x14e390?_0x2363d6[_0x0bb7('0x20')]:_0x31456c[_0x0bb7('0x1d')]+_0x31456c[_0x0bb7('0x1f')];var _0x385378;if(_0x3c4a73>=_0x547af2){_0x3c4a73=_0x547af2;_0x385378=0xc8;}else{_0x385378=0xce;}_0x62cea2['status'](_0x385378);return _0x62cea2[_0x0bb7('0x21')](_0x0bb7('0x22'),_0xb8a7d1+'-'+_0x3c4a73+'/'+_0x547af2)[_0x0bb7('0x1c')](_0x2363d6);}return null;};}function patchUpdates(_0x1bfcc4){return function(_0x3d0bba){try{jsonpatch['apply'](_0x3d0bba,_0x1bfcc4,!![]);}catch(_0x23b140){return BPromise['reject'](_0x23b140);}return _0x3d0bba[_0x0bb7('0x23')]();};}function saveUpdates(_0x37d71f,_0x4b8ae0){return function(_0xcadda3){if(_0xcadda3){return _0xcadda3[_0x0bb7('0x24')](_0x37d71f)[_0x0bb7('0x25')](function(_0x2f3d42){return _0x2f3d42;});}return null;};}function removeEntity(_0x4953f9,_0x11792a){return function(_0x18e656){if(_0x18e656){return _0x18e656[_0x0bb7('0x26')]()[_0x0bb7('0x25')](function(){var _0x7816cd=_0x18e656[_0x0bb7('0x27')]({'plain':!![]});var _0x47c4b4=_0x0bb7('0x28');return db[_0x0bb7('0x29')][_0x0bb7('0x26')]({'where':{'type':_0x47c4b4,'resourceId':_0x7816cd['id']}})[_0x0bb7('0x25')](function(){return _0x18e656;});})['then'](function(){_0x4953f9[_0x0bb7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fbed,_0x557fe6){return function(_0x29d03a){if(!_0x29d03a){_0x56fbed['sendStatus'](0x194);}return _0x29d03a;};}function handleError(_0x3cd5a6,_0x1a3e01){_0x1a3e01=_0x1a3e01||0x1f4;return function(_0x25b0e7){logger['error'](_0x25b0e7['stack']);if(_0x25b0e7[_0x0bb7('0x2a')]){delete _0x25b0e7[_0x0bb7('0x2a')];}_0x3cd5a6[_0x0bb7('0x1a')](_0x1a3e01)[_0x0bb7('0x2b')](_0x25b0e7);};}exports['index']=function(_0x7a79ae,_0x2f7eb8){var _0x5e445a={},_0x2d08a9={},_0x548304={'count':0x0,'rows':[]};var _0x213db9=_['map'](db[_0x0bb7('0x2c')][_0x0bb7('0x2d')],function(_0x3be436){return{'name':_0x3be436['fieldName'],'type':_0x3be436[_0x0bb7('0x2e')][_0x0bb7('0x2f')]};});_0x2d08a9[_0x0bb7('0x30')]=_['map'](_0x213db9,_0x0bb7('0x2a'));_0x2d08a9['query']=_['keys'](_0x7a79ae['query']);_0x2d08a9[_0x0bb7('0x31')]=_['intersection'](_0x2d08a9[_0x0bb7('0x30')],_0x2d08a9[_0x0bb7('0x32')]);_0x5e445a[_0x0bb7('0x33')]=_[_0x0bb7('0x34')](_0x2d08a9[_0x0bb7('0x30')],qs[_0x0bb7('0x35')](_0x7a79ae[_0x0bb7('0x32')]['fields']));_0x5e445a[_0x0bb7('0x33')]=_0x5e445a[_0x0bb7('0x33')][_0x0bb7('0x36')]?_0x5e445a[_0x0bb7('0x33')]:_0x2d08a9[_0x0bb7('0x30')];if(!_0x7a79ae['query'][_0x0bb7('0x37')](_0x0bb7('0x38'))){_0x5e445a[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x7a79ae[_0x0bb7('0x32')][_0x0bb7('0x1f')]);_0x5e445a[_0x0bb7('0x1d')]=qs[_0x0bb7('0x1d')](_0x7a79ae[_0x0bb7('0x32')]['offset']);}_0x5e445a[_0x0bb7('0x39')]=qs[_0x0bb7('0x3a')](_0x7a79ae['query'][_0x0bb7('0x3a')]);_0x5e445a[_0x0bb7('0x3b')]=qs[_0x0bb7('0x31')](_[_0x0bb7('0x3c')](_0x7a79ae[_0x0bb7('0x32')],_0x2d08a9['filters']),_0x213db9);if(_0x7a79ae['query'][_0x0bb7('0x3d')]){_0x5e445a[_0x0bb7('0x3b')]=_[_0x0bb7('0x3e')](_0x5e445a['where'],{'$or':_[_0x0bb7('0x3f')](_0x213db9,function(_0x3398b2){if(_0x3398b2[_0x0bb7('0x2e')]!==_0x0bb7('0x40')){var _0x1ea0f6={};_0x1ea0f6[_0x3398b2[_0x0bb7('0x2a')]]={'$like':'%'+_0x7a79ae[_0x0bb7('0x32')]['filter']+'%'};return _0x1ea0f6;}})});}_0x5e445a=_['merge']({},_0x5e445a,_0x7a79ae[_0x0bb7('0x41')]);var _0x17d767={'where':_0x5e445a[_0x0bb7('0x3b')]};return db['Template']['count'](_0x17d767)[_0x0bb7('0x25')](function(_0x5db73e){_0x548304['count']=_0x5db73e;if(_0x7a79ae[_0x0bb7('0x32')][_0x0bb7('0x42')]){_0x5e445a[_0x0bb7('0x43')]=[{'all':!![]}];}return db['Template'][_0x0bb7('0x44')](_0x5e445a);})['then'](function(_0x4d460f){_0x548304['rows']=_0x4d460f;return _0x548304;})[_0x0bb7('0x25')](respondWithFilteredResult(_0x2f7eb8,_0x5e445a))['catch'](handleError(_0x2f7eb8,null));};exports[_0x0bb7('0x45')]=function(_0x2b4b7d,_0x1c5fa3){var _0x266729={'raw':!![],'where':{'id':_0x2b4b7d[_0x0bb7('0x46')]['id']}},_0x35aad6={};_0x35aad6['model']=_[_0x0bb7('0x47')](db[_0x0bb7('0x2c')][_0x0bb7('0x2d')]);_0x35aad6[_0x0bb7('0x32')]=_[_0x0bb7('0x47')](_0x2b4b7d[_0x0bb7('0x32')]);_0x35aad6['filters']=_[_0x0bb7('0x34')](_0x35aad6[_0x0bb7('0x30')],_0x35aad6[_0x0bb7('0x32')]);_0x266729['attributes']=_[_0x0bb7('0x34')](_0x35aad6[_0x0bb7('0x30')],qs['fields'](_0x2b4b7d[_0x0bb7('0x32')][_0x0bb7('0x35')]));_0x266729[_0x0bb7('0x33')]=_0x266729[_0x0bb7('0x33')][_0x0bb7('0x36')]?_0x266729[_0x0bb7('0x33')]:_0x35aad6[_0x0bb7('0x30')];if(_0x2b4b7d['query'][_0x0bb7('0x42')]){_0x266729[_0x0bb7('0x43')]=[{'all':!![]}];}_0x266729=_[_0x0bb7('0x3e')]({},_0x266729,_0x2b4b7d['options']);return db['Template'][_0x0bb7('0x48')](_0x266729)[_0x0bb7('0x25')](handleEntityNotFound(_0x1c5fa3,null))[_0x0bb7('0x25')](respondWithResult(_0x1c5fa3,null))[_0x0bb7('0x49')](handleError(_0x1c5fa3,null));};exports['create']=function(_0x1f9903,_0x4f0c5a){return db[_0x0bb7('0x2c')][_0x0bb7('0x4a')](_0x1f9903[_0x0bb7('0x4b')],{})[_0x0bb7('0x25')](function(_0x2cad25){var _0x218f38=_0x1f9903['user'][_0x0bb7('0x27')]({'plain':!![]});if(!_0x218f38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x218f38['role']==='user'){var _0x4c0e92=_0x2cad25[_0x0bb7('0x27')]({'plain':!![]});var _0x1868cc=_0x0bb7('0x28');return db['UserProfileSection'][_0x0bb7('0x48')]({'where':{'name':_0x1868cc,'userProfileId':_0x218f38['userProfileId']},'raw':!![]})['then'](function(_0x42db28){if(_0x42db28&&_0x42db28['autoAssociation']===0x0){return db[_0x0bb7('0x29')][_0x0bb7('0x4a')]({'name':_0x4c0e92['name'],'resourceId':_0x4c0e92['id'],'type':_0x42db28[_0x0bb7('0x2a')],'sectionId':_0x42db28['id']},{})[_0x0bb7('0x25')](function(){return _0x2cad25;});}else{return _0x2cad25;}})['catch'](function(_0x4e9bfc){logger['error'](_0x0bb7('0x4c'),_0x4e9bfc);throw _0x4e9bfc;});}return _0x2cad25;})[_0x0bb7('0x25')](respondWithResult(_0x4f0c5a,0xc9))[_0x0bb7('0x49')](handleError(_0x4f0c5a,null));};exports[_0x0bb7('0x24')]=function(_0x4f7d9f,_0x1fd9d7){if(_0x4f7d9f[_0x0bb7('0x4b')]['id']){delete _0x4f7d9f[_0x0bb7('0x4b')]['id'];}return db['Template']['find']({'where':{'id':_0x4f7d9f['params']['id']}})[_0x0bb7('0x25')](handleEntityNotFound(_0x1fd9d7,null))[_0x0bb7('0x25')](saveUpdates(_0x4f7d9f[_0x0bb7('0x4b')],null))[_0x0bb7('0x25')](respondWithResult(_0x1fd9d7,null))[_0x0bb7('0x49')](handleError(_0x1fd9d7,null));};exports['destroy']=function(_0xfcfb7b,_0x4cd62f){return db[_0x0bb7('0x2c')][_0x0bb7('0x48')]({'where':{'id':_0xfcfb7b[_0x0bb7('0x46')]['id']}})[_0x0bb7('0x25')](handleEntityNotFound(_0x4cd62f,null))[_0x0bb7('0x25')](removeEntity(_0x4cd62f,null))['catch'](handleError(_0x4cd62f,null));}; \ No newline at end of file +var _0x63a5=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes'];(function(_0x54a6d3,_0x35688b){var _0x58c1d7=function(_0x129ac7){while(--_0x129ac7){_0x54a6d3['push'](_0x54a6d3['shift']());}};_0x58c1d7(++_0x35688b);}(_0x63a5,0xc4));var _0x563a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x63a5[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x563a('0x1'));var jsonpatch=require(_0x563a('0x2'));var rp=require(_0x563a('0x3'));var moment=require(_0x563a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require(_0x563a('0x8'));var csv=require(_0x563a('0x9'));var ejs=require(_0x563a('0xa'));var fs=require('fs');var fs_extra=require(_0x563a('0xb'));var _=require('lodash');var squel=require(_0x563a('0xc'));var crypto=require(_0x563a('0xd'));var jsforce=require(_0x563a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x563a('0x9'));var querystring=require('querystring');var Papa=require(_0x563a('0xf'));var Redis=require(_0x563a('0x10'));var authService=require(_0x563a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x563a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x563a('0x13'))(_0x563a('0x14'));var utils=require(_0x563a('0x15'));var config=require(_0x563a('0x16'));var licenseUtil=require(_0x563a('0x17'));var db=require(_0x563a('0x18'))['db'];function respondWithStatusCode(_0x263259,_0x43ecbc){_0x43ecbc=_0x43ecbc||0xcc;return function(_0x300f39){if(_0x300f39){return _0x263259[_0x563a('0x19')](_0x43ecbc);}return _0x263259[_0x563a('0x1a')](_0x43ecbc)['end']();};}function respondWithResult(_0x1f3e91,_0x506852){_0x506852=_0x506852||0xc8;return function(_0x54e34d){if(_0x54e34d){return _0x1f3e91['status'](_0x506852)[_0x563a('0x1b')](_0x54e34d);}};}function respondWithFilteredResult(_0x25f6ef,_0x59816f){return function(_0xeddad9){if(_0xeddad9){var _0x30f4dd=typeof _0x59816f[_0x563a('0x1c')]===_0x563a('0x1d')&&typeof _0x59816f[_0x563a('0x1e')]==='undefined';var _0x355f7f=_0xeddad9[_0x563a('0x1f')];var _0x5e93a7=_0x30f4dd?0x0:_0x59816f[_0x563a('0x1c')];var _0x276dee=_0x30f4dd?_0xeddad9['count']:_0x59816f[_0x563a('0x1c')]+_0x59816f[_0x563a('0x1e')];var _0x515066;if(_0x276dee>=_0x355f7f){_0x276dee=_0x355f7f;_0x515066=0xc8;}else{_0x515066=0xce;}_0x25f6ef[_0x563a('0x1a')](_0x515066);return _0x25f6ef['set'](_0x563a('0x20'),_0x5e93a7+'-'+_0x276dee+'/'+_0x355f7f)[_0x563a('0x1b')](_0xeddad9);}return null;};}function patchUpdates(_0x226c66){return function(_0x4d60af){try{jsonpatch[_0x563a('0x21')](_0x4d60af,_0x226c66,!![]);}catch(_0x4027cc){return BPromise[_0x563a('0x22')](_0x4027cc);}return _0x4d60af['save']();};}function saveUpdates(_0x40b5b8,_0xea8ef1){return function(_0x49bcba){if(_0x49bcba){return _0x49bcba[_0x563a('0x23')](_0x40b5b8)[_0x563a('0x24')](function(_0x552324){return _0x552324;});}return null;};}function removeEntity(_0x4f8d4b,_0x15efa5){return function(_0x3e76a8){if(_0x3e76a8){return _0x3e76a8[_0x563a('0x25')]()[_0x563a('0x24')](function(){var _0x3665e=_0x3e76a8[_0x563a('0x26')]({'plain':!![]});var _0x36970c=_0x563a('0x27');return db[_0x563a('0x28')][_0x563a('0x25')]({'where':{'type':_0x36970c,'resourceId':_0x3665e['id']}})[_0x563a('0x24')](function(){return _0x3e76a8;});})[_0x563a('0x24')](function(){_0x4f8d4b[_0x563a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ef6a,_0x3f1c58){return function(_0x962ebf){if(!_0x962ebf){_0x43ef6a[_0x563a('0x19')](0x194);}return _0x962ebf;};}function handleError(_0x9fc593,_0x49f04e){_0x49f04e=_0x49f04e||0x1f4;return function(_0x4b4a55){logger[_0x563a('0x29')](_0x4b4a55[_0x563a('0x2a')]);if(_0x4b4a55[_0x563a('0x2b')]){delete _0x4b4a55['name'];}_0x9fc593[_0x563a('0x1a')](_0x49f04e)['send'](_0x4b4a55);};}exports[_0x563a('0x2c')]=function(_0x121a71,_0x54a931){var _0x251b86={},_0x59180f={},_0x5a31a1={'count':0x0,'rows':[]};var _0x49fdb5=_[_0x563a('0x2d')](db[_0x563a('0x2e')][_0x563a('0x2f')],function(_0x20042c){return{'name':_0x20042c[_0x563a('0x30')],'type':_0x20042c[_0x563a('0x31')][_0x563a('0x32')]};});_0x59180f['model']=_[_0x563a('0x2d')](_0x49fdb5,_0x563a('0x2b'));_0x59180f[_0x563a('0x33')]=_[_0x563a('0x34')](_0x121a71[_0x563a('0x33')]);_0x59180f[_0x563a('0x35')]=_['intersection'](_0x59180f[_0x563a('0x36')],_0x59180f['query']);_0x251b86[_0x563a('0x37')]=_['intersection'](_0x59180f[_0x563a('0x36')],qs[_0x563a('0x38')](_0x121a71['query'][_0x563a('0x38')]));_0x251b86[_0x563a('0x37')]=_0x251b86[_0x563a('0x37')][_0x563a('0x39')]?_0x251b86[_0x563a('0x37')]:_0x59180f[_0x563a('0x36')];if(!_0x121a71[_0x563a('0x33')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x251b86[_0x563a('0x1e')]=qs['limit'](_0x121a71[_0x563a('0x33')][_0x563a('0x1e')]);_0x251b86[_0x563a('0x1c')]=qs[_0x563a('0x1c')](_0x121a71['query']['offset']);}_0x251b86[_0x563a('0x3c')]=qs['sort'](_0x121a71[_0x563a('0x33')][_0x563a('0x3d')]);_0x251b86[_0x563a('0x3e')]=qs[_0x563a('0x35')](_[_0x563a('0x3f')](_0x121a71[_0x563a('0x33')],_0x59180f[_0x563a('0x35')]),_0x49fdb5);if(_0x121a71[_0x563a('0x33')][_0x563a('0x40')]){_0x251b86[_0x563a('0x3e')]=_[_0x563a('0x41')](_0x251b86['where'],{'$or':_[_0x563a('0x2d')](_0x49fdb5,function(_0x10fa42){if(_0x10fa42['type']!==_0x563a('0x42')){var _0x1a18d6={};_0x1a18d6[_0x10fa42['name']]={'$like':'%'+_0x121a71['query'][_0x563a('0x40')]+'%'};return _0x1a18d6;}})});}_0x251b86=_[_0x563a('0x41')]({},_0x251b86,_0x121a71[_0x563a('0x43')]);var _0x575222={'where':_0x251b86[_0x563a('0x3e')]};return db[_0x563a('0x2e')][_0x563a('0x1f')](_0x575222)['then'](function(_0x587535){_0x5a31a1['count']=_0x587535;if(_0x121a71['query']['includeAll']){_0x251b86[_0x563a('0x44')]=[{'all':!![]}];}return db[_0x563a('0x2e')][_0x563a('0x45')](_0x251b86);})[_0x563a('0x24')](function(_0x2385d9){_0x5a31a1[_0x563a('0x46')]=_0x2385d9;return _0x5a31a1;})['then'](respondWithFilteredResult(_0x54a931,_0x251b86))[_0x563a('0x47')](handleError(_0x54a931,null));};exports[_0x563a('0x48')]=function(_0x94f189,_0x5790f8){var _0x1275e={'raw':!![],'where':{'id':_0x94f189[_0x563a('0x49')]['id']}},_0x4b1dc7={};_0x4b1dc7[_0x563a('0x36')]=_['keys'](db[_0x563a('0x2e')]['rawAttributes']);_0x4b1dc7[_0x563a('0x33')]=_[_0x563a('0x34')](_0x94f189['query']);_0x4b1dc7[_0x563a('0x35')]=_[_0x563a('0x4a')](_0x4b1dc7[_0x563a('0x36')],_0x4b1dc7[_0x563a('0x33')]);_0x1275e[_0x563a('0x37')]=_[_0x563a('0x4a')](_0x4b1dc7[_0x563a('0x36')],qs[_0x563a('0x38')](_0x94f189[_0x563a('0x33')][_0x563a('0x38')]));_0x1275e[_0x563a('0x37')]=_0x1275e['attributes'][_0x563a('0x39')]?_0x1275e[_0x563a('0x37')]:_0x4b1dc7['model'];if(_0x94f189[_0x563a('0x33')]['includeAll']){_0x1275e['include']=[{'all':!![]}];}_0x1275e=_[_0x563a('0x41')]({},_0x1275e,_0x94f189['options']);return db['Template'][_0x563a('0x4b')](_0x1275e)[_0x563a('0x24')](handleEntityNotFound(_0x5790f8,null))['then'](respondWithResult(_0x5790f8,null))[_0x563a('0x47')](handleError(_0x5790f8,null));};exports['create']=function(_0x386e52,_0x36d64c){return db[_0x563a('0x2e')][_0x563a('0x4c')](_0x386e52[_0x563a('0x4d')],{})['then'](function(_0x406b00){var _0xfc2dd3=_0x386e52[_0x563a('0x4e')][_0x563a('0x26')]({'plain':!![]});if(!_0xfc2dd3)throw new Error(_0x563a('0x4f'));if(_0xfc2dd3[_0x563a('0x50')]===_0x563a('0x4e')){var _0x4a70f0=_0x406b00[_0x563a('0x26')]({'plain':!![]});var _0xa498ee='Templates';return db[_0x563a('0x51')][_0x563a('0x4b')]({'where':{'name':_0xa498ee,'userProfileId':_0xfc2dd3[_0x563a('0x52')]},'raw':!![]})[_0x563a('0x24')](function(_0x40dde0){if(_0x40dde0&&_0x40dde0['autoAssociation']===0x0){return db[_0x563a('0x28')][_0x563a('0x4c')]({'name':_0x4a70f0[_0x563a('0x2b')],'resourceId':_0x4a70f0['id'],'type':_0x40dde0[_0x563a('0x2b')],'sectionId':_0x40dde0['id']},{})[_0x563a('0x24')](function(){return _0x406b00;});}else{return _0x406b00;}})[_0x563a('0x47')](function(_0x382d40){logger[_0x563a('0x29')](_0x563a('0x53'),_0x382d40);throw _0x382d40;});}return _0x406b00;})[_0x563a('0x24')](respondWithResult(_0x36d64c,0xc9))[_0x563a('0x47')](handleError(_0x36d64c,null));};exports['update']=function(_0xb08470,_0x2e4161){if(_0xb08470[_0x563a('0x4d')]['id']){delete _0xb08470[_0x563a('0x4d')]['id'];}return db[_0x563a('0x2e')]['find']({'where':{'id':_0xb08470[_0x563a('0x49')]['id']}})[_0x563a('0x24')](handleEntityNotFound(_0x2e4161,null))[_0x563a('0x24')](saveUpdates(_0xb08470[_0x563a('0x4d')],null))[_0x563a('0x24')](respondWithResult(_0x2e4161,null))[_0x563a('0x47')](handleError(_0x2e4161,null));};exports[_0x563a('0x25')]=function(_0x582b79,_0x2e65a5){return db[_0x563a('0x2e')][_0x563a('0x4b')]({'where':{'id':_0x582b79[_0x563a('0x49')]['id']}})[_0x563a('0x24')](handleEntityNotFound(_0x2e65a5,null))[_0x563a('0x24')](removeEntity(_0x2e65a5,null))[_0x563a('0x47')](handleError(_0x2e65a5,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3f7e60f..9a4da9d 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24bb=['bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','../../config/logger','api','moment'];(function(_0x238d76,_0x3fd972){var _0x26fa29=function(_0x50b03c){while(--_0x50b03c){_0x238d76['push'](_0x238d76['shift']());}};_0x26fa29(++_0x3fd972);}(_0x24bb,0x19d));var _0xb24b=function(_0x40c522,_0x1de007){_0x40c522=_0x40c522-0x0;var _0x4288b0=_0x24bb[_0x40c522];return _0x4288b0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb24b('0x0'))(_0xb24b('0x1'));var moment=require(_0xb24b('0x2'));var BPromise=require(_0xb24b('0x3'));var rp=require(_0xb24b('0x4'));var fs=require('fs');var path=require(_0xb24b('0x5'));var rimraf=require(_0xb24b('0x6'));var config=require(_0xb24b('0x7'));var attributes=require(_0xb24b('0x8'));module[_0xb24b('0x9')]=function(_0x20c854,_0x24ee85){return _0x20c854[_0xb24b('0xa')](_0xb24b('0xb'),attributes,{'tableName':_0xb24b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d2c=['./template.attributes','exports','define','Template','tools_templates','../../config/logger','bluebird','request-promise','rimraf'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1d2c,0x137));var _0xc1d2=function(_0x501021,_0x4837e5){_0x501021=_0x501021-0x0;var _0x14695f=_0x1d2c[_0x501021];return _0x14695f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc1d2('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc1d2('0x1'));var rp=require(_0xc1d2('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d2('0x3'));var config=require('../../config/environment');var attributes=require(_0xc1d2('0x4'));module[_0xc1d2('0x5')]=function(_0x523a88,_0x1d74e5){return _0x523a88[_0xc1d2('0x6')](_0xc1d2('0x7'),attributes,{'tableName':_0xc1d2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 7b9a6a2..6fe730e 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bee=['../../config/utils','../../config/logger','rpc','jayson/promise','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','Template','findAll','options','raw','where','attributes','include','map','model','GetTemplate','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x541203,_0xd0afcf){var _0x422daf=function(_0x4523d8){while(--_0x4523d8){_0x541203['push'](_0x541203['shift']());}};_0x422daf(++_0xd0afcf);}(_0x9bee,0xfa));var _0xe9be=function(_0x3e2ff2,_0x36dfe5){_0x3e2ff2=_0x3e2ff2-0x0;var _0x1ea1b2=_0x9bee[_0x3e2ff2];return _0x1ea1b2;};'use strict';var _=require(_0xe9be('0x0'));var util=require(_0xe9be('0x1'));var moment=require(_0xe9be('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9be('0x3'));var fs=require('fs');var Redis=require(_0xe9be('0x4'));var db=require(_0xe9be('0x5'))['db'];var utils=require(_0xe9be('0x6'));var logger=require(_0xe9be('0x7'))(_0xe9be('0x8'));var config=require('../../config/environment');var jayson=require(_0xe9be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51ba72,_0x5333c4,_0x2346b7){return new BPromise(function(_0x22102f,_0x54c1b9){return client['request'](_0x51ba72,_0x2346b7)[_0xe9be('0xa')](function(_0x13fdf9){logger[_0xe9be('0xb')]('Template,\x20%s,\x20%s',_0x5333c4,_0xe9be('0xc'));logger['debug'](_0xe9be('0xd'),_0x5333c4,_0xe9be('0xc'),JSON[_0xe9be('0xe')](_0x13fdf9));if(_0x13fdf9[_0xe9be('0xf')]){if(_0x13fdf9[_0xe9be('0xf')][_0xe9be('0x10')]===0x1f4){logger[_0xe9be('0xf')](_0xe9be('0x11'),_0x5333c4,_0x13fdf9[_0xe9be('0xf')][_0xe9be('0x12')]);return _0x54c1b9(_0x13fdf9['error'][_0xe9be('0x12')]);}logger[_0xe9be('0xf')]('Template,\x20%s,\x20%s',_0x5333c4,_0x13fdf9[_0xe9be('0xf')][_0xe9be('0x12')]);return _0x22102f(_0x13fdf9[_0xe9be('0xf')][_0xe9be('0x12')]);}else{logger[_0xe9be('0xb')]('Template,\x20%s,\x20%s',_0x5333c4,'request\x20sent');_0x22102f(_0x13fdf9[_0xe9be('0x13')]['message']);}})[_0xe9be('0x14')](function(_0x1cf199){logger[_0xe9be('0xf')]('Template,\x20%s,\x20%s',_0x5333c4,_0x1cf199);_0x54c1b9(_0x1cf199);});});}exports['GetTemplate']=function(_0x339fb6){var _0x15bb63=this;return new Promise(function(_0x2d23ad,_0x255521){return db[_0xe9be('0x15')][_0xe9be('0x16')]({'raw':_0x339fb6['options']?_0x339fb6[_0xe9be('0x17')][_0xe9be('0x18')]===undefined?!![]:![]:!![],'where':_0x339fb6[_0xe9be('0x17')]?_0x339fb6[_0xe9be('0x17')][_0xe9be('0x19')]||null:null,'attributes':_0x339fb6['options']?_0x339fb6[_0xe9be('0x17')][_0xe9be('0x1a')]||null:null,'limit':_0x339fb6['options']?_0x339fb6[_0xe9be('0x17')]['limit']||null:null,'include':_0x339fb6[_0xe9be('0x17')]?_0x339fb6['options'][_0xe9be('0x1b')]?_[_0xe9be('0x1c')](_0x339fb6['options']['include'],function(_0xd6237b){return{'model':db[_0xd6237b[_0xe9be('0x1d')]],'as':_0xd6237b['as'],'attributes':_0xd6237b['attributes'],'include':_0xd6237b[_0xe9be('0x1b')]?_[_0xe9be('0x1c')](_0xd6237b[_0xe9be('0x1b')],function(_0x426ef5){return{'model':db[_0x426ef5[_0xe9be('0x1d')]],'as':_0x426ef5['as'],'attributes':_0x426ef5['attributes'],'include':_0x426ef5[_0xe9be('0x1b')]?_[_0xe9be('0x1c')](_0x426ef5[_0xe9be('0x1b')],function(_0x39562e){return{'model':db[_0x39562e[_0xe9be('0x1d')]],'as':_0x39562e['as'],'attributes':_0x39562e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9be('0xa')](function(_0x33dc99){logger[_0xe9be('0xb')](_0xe9be('0x1e'),_0x339fb6);logger[_0xe9be('0x1f')](_0xe9be('0x1e'),_0x339fb6,JSON[_0xe9be('0xe')](_0x33dc99));_0x2d23ad(_0x33dc99);})[_0xe9be('0x14')](function(_0x338da5){logger['error']('GetTemplate',_0x338da5[_0xe9be('0x12')],_0x339fb6);_0x255521(_0x15bb63['error'](0x1f4,_0x338da5['message']));});});}; \ No newline at end of file +var _0xd982=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','map','attributes','GetTemplate','lodash','util','bluebird'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0xd982,0x19d));var _0x2d98=function(_0x5d5ad9,_0x9fe65c){_0x5d5ad9=_0x5d5ad9-0x0;var _0x461f64=_0xd982[_0x5d5ad9];return _0x461f64;};'use strict';var _=require(_0x2d98('0x0'));var util=require(_0x2d98('0x1'));var moment=require('moment');var BPromise=require(_0x2d98('0x2'));var rs=require(_0x2d98('0x3'));var fs=require('fs');var Redis=require(_0x2d98('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d98('0x5'));var config=require(_0x2d98('0x6'));var jayson=require(_0x2d98('0x7'));var client=jayson[_0x2d98('0x8')][_0x2d98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2927bf,_0x571dd3,_0x4b5701){return new BPromise(function(_0x288d5d,_0x126fdd){return client[_0x2d98('0xa')](_0x2927bf,_0x4b5701)[_0x2d98('0xb')](function(_0x222372){logger[_0x2d98('0xc')](_0x2d98('0xd'),_0x571dd3,_0x2d98('0xe'));logger[_0x2d98('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x571dd3,_0x2d98('0xe'),JSON[_0x2d98('0x10')](_0x222372));if(_0x222372[_0x2d98('0x11')]){if(_0x222372['error'][_0x2d98('0x12')]===0x1f4){logger['error'](_0x2d98('0xd'),_0x571dd3,_0x222372[_0x2d98('0x11')][_0x2d98('0x13')]);return _0x126fdd(_0x222372['error'][_0x2d98('0x13')]);}logger[_0x2d98('0x11')](_0x2d98('0xd'),_0x571dd3,_0x222372[_0x2d98('0x11')][_0x2d98('0x13')]);return _0x288d5d(_0x222372[_0x2d98('0x11')][_0x2d98('0x13')]);}else{logger[_0x2d98('0xc')](_0x2d98('0xd'),_0x571dd3,_0x2d98('0xe'));_0x288d5d(_0x222372[_0x2d98('0x14')][_0x2d98('0x13')]);}})[_0x2d98('0x15')](function(_0x566545){logger[_0x2d98('0x11')](_0x2d98('0xd'),_0x571dd3,_0x566545);_0x126fdd(_0x566545);});});}exports['GetTemplate']=function(_0x4a1069){var _0x2f77e4=this;return new Promise(function(_0x15e3ad,_0x2eb7ad){return db['Template'][_0x2d98('0x16')]({'raw':_0x4a1069['options']?_0x4a1069[_0x2d98('0x17')][_0x2d98('0x18')]===undefined?!![]:![]:!![],'where':_0x4a1069['options']?_0x4a1069[_0x2d98('0x17')][_0x2d98('0x19')]||null:null,'attributes':_0x4a1069[_0x2d98('0x17')]?_0x4a1069[_0x2d98('0x17')]['attributes']||null:null,'limit':_0x4a1069[_0x2d98('0x17')]?_0x4a1069['options'][_0x2d98('0x1a')]||null:null,'include':_0x4a1069['options']?_0x4a1069[_0x2d98('0x17')][_0x2d98('0x1b')]?_['map'](_0x4a1069[_0x2d98('0x17')][_0x2d98('0x1b')],function(_0x968da4){return{'model':db[_0x968da4[_0x2d98('0x1c')]],'as':_0x968da4['as'],'attributes':_0x968da4['attributes'],'include':_0x968da4[_0x2d98('0x1b')]?_[_0x2d98('0x1d')](_0x968da4['include'],function(_0x302815){return{'model':db[_0x302815[_0x2d98('0x1c')]],'as':_0x302815['as'],'attributes':_0x302815[_0x2d98('0x1e')],'include':_0x302815[_0x2d98('0x1b')]?_['map'](_0x302815[_0x2d98('0x1b')],function(_0x531d47){return{'model':db[_0x531d47[_0x2d98('0x1c')]],'as':_0x531d47['as'],'attributes':_0x531d47[_0x2d98('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d98('0xb')](function(_0x36e5a5){logger['info'](_0x2d98('0x1f'),_0x4a1069);logger[_0x2d98('0xf')](_0x2d98('0x1f'),_0x4a1069,JSON['stringify'](_0x36e5a5));_0x15e3ad(_0x36e5a5);})['catch'](function(_0x17fcb1){logger[_0x2d98('0x11')](_0x2d98('0x1f'),_0x17fcb1[_0x2d98('0x13')],_0x4a1069);_0x2eb7ad(_0x2f77e4[_0x2d98('0x11')](0x1f4,_0x17fcb1[_0x2d98('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index e290df3..0ce868a 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5546=['post','addAllCondition','/:id/actions','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x5546,0x79));var _0x6554=function(_0x359656,_0x41804f){_0x359656=_0x359656-0x0;var _0x2a9d82=_0x5546[_0x359656];return _0x2a9d82;};'use strict';var multer=require(_0x6554('0x0'));var util=require(_0x6554('0x1'));var path=require(_0x6554('0x2'));var timeout=require(_0x6554('0x3'));var express=require(_0x6554('0x4'));var router=express[_0x6554('0x5')]();var fs_extra=require(_0x6554('0x6'));var auth=require(_0x6554('0x7'));var interaction=require(_0x6554('0x8'));var config=require('../../config/environment');var controller=require(_0x6554('0x9'));router[_0x6554('0xa')]('/',auth[_0x6554('0xb')](),controller[_0x6554('0xc')]);router[_0x6554('0xa')](_0x6554('0xd'),auth[_0x6554('0xb')](),controller['show']);router[_0x6554('0xa')](_0x6554('0xe'),auth[_0x6554('0xb')](),controller[_0x6554('0xf')]);router['get'](_0x6554('0x10'),auth['isAuthenticated'](),controller[_0x6554('0x11')]);router[_0x6554('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0x6554('0x12')]);router[_0x6554('0x13')]('/',auth[_0x6554('0xb')](),controller['create']);router[_0x6554('0x13')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x6554('0x14')]);router[_0x6554('0x13')](_0x6554('0x10'),auth[_0x6554('0xb')](),controller['addAnyCondition']);router[_0x6554('0x13')](_0x6554('0x15'),auth[_0x6554('0xb')](),controller[_0x6554('0x16')]);router[_0x6554('0x17')](_0x6554('0xd'),auth[_0x6554('0xb')](),controller[_0x6554('0x18')]);router[_0x6554('0x19')](_0x6554('0xd'),auth[_0x6554('0xb')](),controller[_0x6554('0x1a')]);module[_0x6554('0x1b')]=router; \ No newline at end of file +var _0x7348=['/:id/any_conditions','getAnyConditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAction','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','get','/:id','getAllConditions'];(function(_0xe8789a,_0x2d8230){var _0x5b83a6=function(_0x28b93e){while(--_0x28b93e){_0xe8789a['push'](_0xe8789a['shift']());}};_0x5b83a6(++_0x2d8230);}(_0x7348,0x16b));var _0x8734=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7348[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x8734('0x0'));var path=require(_0x8734('0x1'));var timeout=require('connect-timeout');var express=require(_0x8734('0x2'));var router=express[_0x8734('0x3')]();var fs_extra=require(_0x8734('0x4'));var auth=require(_0x8734('0x5'));var interaction=require(_0x8734('0x6'));var config=require('../../config/environment');var controller=require(_0x8734('0x7'));router['get']('/',auth[_0x8734('0x8')](),controller['index']);router[_0x8734('0x9')](_0x8734('0xa'),auth[_0x8734('0x8')](),controller['show']);router[_0x8734('0x9')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x8734('0xb')]);router['get'](_0x8734('0xc'),auth['isAuthenticated'](),controller[_0x8734('0xd')]);router[_0x8734('0x9')](_0x8734('0xe'),auth[_0x8734('0x8')](),controller['getActions']);router[_0x8734('0xf')]('/',auth[_0x8734('0x8')](),controller[_0x8734('0x10')]);router[_0x8734('0xf')](_0x8734('0x11'),auth[_0x8734('0x8')](),controller[_0x8734('0x12')]);router['post'](_0x8734('0xc'),auth['isAuthenticated'](),controller['addAnyCondition']);router['post'](_0x8734('0xe'),auth[_0x8734('0x8')](),controller[_0x8734('0x13')]);router[_0x8734('0x14')](_0x8734('0xa'),auth['isAuthenticated'](),controller[_0x8734('0x15')]);router[_0x8734('0x16')]('/:id',auth[_0x8734('0x8')](),controller[_0x8734('0x17')]);module[_0x8734('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d122427..07d4f80 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb25=['BOOLEAN','STRING'];(function(_0x1ee2f8,_0x28b42f){var _0x48d644=function(_0x2c8fac){while(--_0x2c8fac){_0x1ee2f8['push'](_0x1ee2f8['shift']());}};_0x48d644(++_0x28b42f);}(_0xfb25,0x14f));var _0x5fb2=function(_0x18a84f,_0x26add7){_0x18a84f=_0x18a84f-0x0;var _0x4cfb46=_0xfb25[_0x18a84f];return _0x4cfb46;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5fb2('0x0')]},'channel':{'type':Sequelize[_0x5fb2('0x0')]},'description':{'type':Sequelize[_0x5fb2('0x0')]},'status':{'type':Sequelize[_0x5fb2('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x03d5=['sequelize','exports','STRING'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x03d5,0xde));var _0x503d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03d5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x503d('0x0'));module[_0x503d('0x1')]={'name':{'type':Sequelize[_0x503d('0x2')]},'channel':{'type':Sequelize[_0x503d('0x2')]},'description':{'type':Sequelize[_0x503d('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 064079c..4d1373c 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9027=['eml-format','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','reject','save','update','then','Triggers','UserProfileResource','name','send','index','map','Trigger','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','user','get','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions'];(function(_0xf0add2,_0x271f85){var _0x1d5808=function(_0x24763d){while(--_0x24763d){_0xf0add2['push'](_0xf0add2['shift']());}};_0x1d5808(++_0x271f85);}(_0x9027,0xbc));var _0x7902=function(_0x58e6f7,_0x1446eb){_0x58e6f7=_0x58e6f7-0x0;var _0x2fdbe2=_0x9027[_0x58e6f7];return _0x2fdbe2;};'use strict';var emlformat=require(_0x7902('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7902('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7902('0x2'));var Mustache=require(_0x7902('0x3'));var util=require('util');var path=require(_0x7902('0x4'));var sox=require(_0x7902('0x5'));var csv=require(_0x7902('0x6'));var ejs=require(_0x7902('0x7'));var fs=require('fs');var fs_extra=require(_0x7902('0x8'));var _=require(_0x7902('0x9'));var squel=require(_0x7902('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7902('0xb'));var toCsv=require(_0x7902('0x6'));var querystring=require(_0x7902('0xc'));var Papa=require(_0x7902('0xd'));var Redis=require(_0x7902('0xe'));var authService=require(_0x7902('0xf'));var qs=require(_0x7902('0x10'));var as=require(_0x7902('0x11'));var hardwareService=require(_0x7902('0x12'));var logger=require(_0x7902('0x13'))('api');var utils=require(_0x7902('0x14'));var config=require(_0x7902('0x15'));var licenseUtil=require(_0x7902('0x16'));var db=require(_0x7902('0x17'))['db'];function respondWithStatusCode(_0x114523,_0x2a397c){_0x2a397c=_0x2a397c||0xcc;return function(_0x207bd7){if(_0x207bd7){return _0x114523[_0x7902('0x18')](_0x2a397c);}return _0x114523['status'](_0x2a397c)[_0x7902('0x19')]();};}function respondWithResult(_0x14b86a,_0x42e8ec){_0x42e8ec=_0x42e8ec||0xc8;return function(_0x56704d){if(_0x56704d){return _0x14b86a[_0x7902('0x1a')](_0x42e8ec)[_0x7902('0x1b')](_0x56704d);}};}function respondWithFilteredResult(_0x1ffe44,_0x91a4fa){return function(_0x10cf1a){if(_0x10cf1a){var _0x2e2851=typeof _0x91a4fa[_0x7902('0x1c')]===_0x7902('0x1d')&&typeof _0x91a4fa['limit']===_0x7902('0x1d');var _0x4634d4=_0x10cf1a[_0x7902('0x1e')];var _0x4b9ebd=_0x2e2851?0x0:_0x91a4fa[_0x7902('0x1c')];var _0x487200=_0x2e2851?_0x10cf1a[_0x7902('0x1e')]:_0x91a4fa['offset']+_0x91a4fa['limit'];var _0x20807e;if(_0x487200>=_0x4634d4){_0x487200=_0x4634d4;_0x20807e=0xc8;}else{_0x20807e=0xce;}_0x1ffe44[_0x7902('0x1a')](_0x20807e);return _0x1ffe44[_0x7902('0x1f')]('Content-Range',_0x4b9ebd+'-'+_0x487200+'/'+_0x4634d4)[_0x7902('0x1b')](_0x10cf1a);}return null;};}function patchUpdates(_0x449f7a){return function(_0x16be57){try{jsonpatch['apply'](_0x16be57,_0x449f7a,!![]);}catch(_0x20e251){return BPromise[_0x7902('0x20')](_0x20e251);}return _0x16be57[_0x7902('0x21')]();};}function saveUpdates(_0x242756,_0x41e070){return function(_0x19159f){if(_0x19159f){return _0x19159f[_0x7902('0x22')](_0x242756)['then'](function(_0x1ee1c2){return _0x1ee1c2;});}return null;};}function removeEntity(_0x134b67,_0x355a7c){return function(_0x53492f){if(_0x53492f){return _0x53492f['destroy']()[_0x7902('0x23')](function(){var _0x2885ed=_0x53492f['get']({'plain':!![]});var _0x54a699=_0x7902('0x24');return db[_0x7902('0x25')]['destroy']({'where':{'type':_0x54a699,'resourceId':_0x2885ed['id']}})[_0x7902('0x23')](function(){return _0x53492f;});})[_0x7902('0x23')](function(){_0x134b67['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbedd,_0x41659a){return function(_0x2414c5){if(!_0x2414c5){_0x2cbedd['sendStatus'](0x194);}return _0x2414c5;};}function handleError(_0x2adf61,_0x32e093){_0x32e093=_0x32e093||0x1f4;return function(_0x527d5b){logger['error'](_0x527d5b['stack']);if(_0x527d5b[_0x7902('0x26')]){delete _0x527d5b[_0x7902('0x26')];}_0x2adf61[_0x7902('0x1a')](_0x32e093)[_0x7902('0x27')](_0x527d5b);};}exports[_0x7902('0x28')]=function(_0x31ad46,_0x534344){var _0x41e1e7={},_0x11ab24={},_0x26ea93={'count':0x0,'rows':[]};var _0x345c49=_[_0x7902('0x29')](db[_0x7902('0x2a')]['rawAttributes'],function(_0x241726){return{'name':_0x241726[_0x7902('0x2b')],'type':_0x241726[_0x7902('0x2c')]['key']};});_0x11ab24[_0x7902('0x2d')]=_['map'](_0x345c49,_0x7902('0x26'));_0x11ab24[_0x7902('0x2e')]=_[_0x7902('0x2f')](_0x31ad46['query']);_0x11ab24[_0x7902('0x30')]=_[_0x7902('0x31')](_0x11ab24[_0x7902('0x2d')],_0x11ab24['query']);_0x41e1e7[_0x7902('0x32')]=_['intersection'](_0x11ab24[_0x7902('0x2d')],qs[_0x7902('0x33')](_0x31ad46[_0x7902('0x2e')][_0x7902('0x33')]));_0x41e1e7[_0x7902('0x32')]=_0x41e1e7[_0x7902('0x32')][_0x7902('0x34')]?_0x41e1e7[_0x7902('0x32')]:_0x11ab24[_0x7902('0x2d')];if(!_0x31ad46['query'][_0x7902('0x35')](_0x7902('0x36'))){_0x41e1e7['limit']=qs['limit'](_0x31ad46['query'][_0x7902('0x37')]);_0x41e1e7['offset']=qs[_0x7902('0x1c')](_0x31ad46[_0x7902('0x2e')][_0x7902('0x1c')]);}_0x41e1e7[_0x7902('0x38')]=qs[_0x7902('0x39')](_0x31ad46[_0x7902('0x2e')][_0x7902('0x39')]);_0x41e1e7['where']=qs[_0x7902('0x30')](_[_0x7902('0x3a')](_0x31ad46[_0x7902('0x2e')],_0x11ab24[_0x7902('0x30')]),_0x345c49);if(_0x31ad46[_0x7902('0x2e')][_0x7902('0x3b')]){_0x41e1e7[_0x7902('0x3c')]=_[_0x7902('0x3d')](_0x41e1e7[_0x7902('0x3c')],{'$or':_[_0x7902('0x29')](_0x345c49,function(_0x264cb3){if(_0x264cb3[_0x7902('0x2c')]!==_0x7902('0x3e')){var _0x2f5d21={};_0x2f5d21[_0x264cb3[_0x7902('0x26')]]={'$like':'%'+_0x31ad46[_0x7902('0x2e')]['filter']+'%'};return _0x2f5d21;}})});}_0x41e1e7=_[_0x7902('0x3d')]({},_0x41e1e7,_0x31ad46[_0x7902('0x3f')]);var _0x5c263f={'where':_0x41e1e7[_0x7902('0x3c')]};return db[_0x7902('0x2a')][_0x7902('0x1e')](_0x5c263f)[_0x7902('0x23')](function(_0xd6a123){_0x26ea93[_0x7902('0x1e')]=_0xd6a123;if(_0x31ad46[_0x7902('0x2e')]['includeAll']){_0x41e1e7[_0x7902('0x40')]=[{'all':!![]}];}return db[_0x7902('0x2a')][_0x7902('0x41')](_0x41e1e7);})[_0x7902('0x23')](function(_0x36c100){_0x26ea93[_0x7902('0x42')]=_0x36c100;return _0x26ea93;})[_0x7902('0x23')](respondWithFilteredResult(_0x534344,_0x41e1e7))[_0x7902('0x43')](handleError(_0x534344,null));};exports[_0x7902('0x44')]=function(_0xd6f5fc,_0x2315f3){var _0x58c794={'raw':![],'where':{'id':_0xd6f5fc[_0x7902('0x45')]['id']}},_0x54659e={};_0x54659e[_0x7902('0x2d')]=_['keys'](db[_0x7902('0x2a')][_0x7902('0x46')]);_0x54659e['query']=_[_0x7902('0x2f')](_0xd6f5fc['query']);_0x54659e[_0x7902('0x30')]=_[_0x7902('0x31')](_0x54659e[_0x7902('0x2d')],_0x54659e[_0x7902('0x2e')]);_0x58c794[_0x7902('0x32')]=_['intersection'](_0x54659e[_0x7902('0x2d')],qs[_0x7902('0x33')](_0xd6f5fc['query'][_0x7902('0x33')]));_0x58c794['attributes']=_0x58c794[_0x7902('0x32')][_0x7902('0x34')]?_0x58c794[_0x7902('0x32')]:_0x54659e['model'];if(_0xd6f5fc[_0x7902('0x2e')][_0x7902('0x47')]){_0x58c794[_0x7902('0x40')]=[{'all':!![]}];}_0x58c794=_[_0x7902('0x3d')]({},_0x58c794,_0xd6f5fc[_0x7902('0x3f')]);return db[_0x7902('0x2a')][_0x7902('0x48')](_0x58c794)[_0x7902('0x23')](handleEntityNotFound(_0x2315f3,null))[_0x7902('0x23')](respondWithResult(_0x2315f3,null))[_0x7902('0x43')](handleError(_0x2315f3,null));};exports[_0x7902('0x49')]=function(_0x48db01,_0x2cd326){return db[_0x7902('0x2a')][_0x7902('0x49')](_0x48db01['body'],{})[_0x7902('0x23')](function(_0x1d255b){var _0x15a6d4=_0x48db01[_0x7902('0x4a')][_0x7902('0x4b')]({'plain':!![]});if(!_0x15a6d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a6d4[_0x7902('0x4c')]===_0x7902('0x4a')){var _0x4cfd38=_0x1d255b[_0x7902('0x4b')]({'plain':!![]});var _0x588cc5=_0x7902('0x24');return db['UserProfileSection'][_0x7902('0x48')]({'where':{'name':_0x588cc5,'userProfileId':_0x15a6d4[_0x7902('0x4d')]},'raw':!![]})[_0x7902('0x23')](function(_0x26cca8){if(_0x26cca8&&_0x26cca8[_0x7902('0x4e')]===0x0){return db[_0x7902('0x25')][_0x7902('0x49')]({'name':_0x4cfd38[_0x7902('0x26')],'resourceId':_0x4cfd38['id'],'type':_0x26cca8[_0x7902('0x26')],'sectionId':_0x26cca8['id']},{})['then'](function(){return _0x1d255b;});}else{return _0x1d255b;}})['catch'](function(_0xc6830e){logger[_0x7902('0x4f')](_0x7902('0x50'),_0xc6830e);throw _0xc6830e;});}return _0x1d255b;})[_0x7902('0x23')](respondWithResult(_0x2cd326,0xc9))['catch'](handleError(_0x2cd326,null));};exports[_0x7902('0x22')]=function(_0x131a30,_0x53f851){if(_0x131a30[_0x7902('0x51')]['id']){delete _0x131a30[_0x7902('0x51')]['id'];}return db[_0x7902('0x2a')][_0x7902('0x48')]({'where':{'id':_0x131a30[_0x7902('0x45')]['id']}})['then'](handleEntityNotFound(_0x53f851,null))[_0x7902('0x23')](saveUpdates(_0x131a30[_0x7902('0x51')],null))[_0x7902('0x23')](respondWithResult(_0x53f851,null))[_0x7902('0x43')](handleError(_0x53f851,null));};exports[_0x7902('0x52')]=function(_0x308af5,_0x248042){return db[_0x7902('0x2a')][_0x7902('0x48')]({'where':{'id':_0x308af5['params']['id']}})['then'](handleEntityNotFound(_0x248042,null))['then'](removeEntity(_0x248042,null))['catch'](handleError(_0x248042,null));};exports['addAllCondition']=function(_0x1d7d22,_0x243290,_0x3a879c){if(_0x1d7d22[_0x7902('0x51')]['id']){delete _0x1d7d22[_0x7902('0x51')]['id'];}return db[_0x7902('0x2a')][_0x7902('0x48')]({'where':{'id':_0x1d7d22[_0x7902('0x45')]['id']}})[_0x7902('0x23')](handleEntityNotFound(_0x243290,null))[_0x7902('0x23')](function(_0x2a78d8){if(_0x2a78d8){_0x1d7d22[_0x7902('0x51')][_0x7902('0x53')]=_0x2a78d8['id'];return db[_0x7902('0x54')]['create'](_0x1d7d22[_0x7902('0x51')]);}})[_0x7902('0x23')](respondWithResult(_0x243290,null))[_0x7902('0x43')](handleError(_0x243290,null));};exports[_0x7902('0x55')]=function(_0x18991f,_0x51f5ae,_0x2a2b73){if(_0x18991f[_0x7902('0x51')]['id']){delete _0x18991f[_0x7902('0x51')]['id'];}return db[_0x7902('0x2a')][_0x7902('0x48')]({'where':{'id':_0x18991f[_0x7902('0x45')]['id']}})[_0x7902('0x23')](handleEntityNotFound(_0x51f5ae,null))['then'](function(_0x25bacc){if(_0x25bacc){_0x18991f[_0x7902('0x51')][_0x7902('0x56')]=_0x25bacc['id'];return db[_0x7902('0x54')][_0x7902('0x49')](_0x18991f['body']);}})['then'](respondWithResult(_0x51f5ae,null))[_0x7902('0x43')](handleError(_0x51f5ae,null));};exports[_0x7902('0x57')]=function(_0x5f26c5,_0x1cd4a0,_0x4c4e79){var _0xa8fcaa={};var _0x293c0e={};var _0x2282d6;var _0x481f5d;return db[_0x7902('0x2a')][_0x7902('0x58')]({'where':{'id':_0x5f26c5['params']['id']}})[_0x7902('0x23')](handleEntityNotFound(_0x1cd4a0,null))[_0x7902('0x23')](function(_0x270cff){if(_0x270cff){_0x2282d6=_0x270cff;_0x293c0e[_0x7902('0x2d')]=_[_0x7902('0x2f')](db[_0x7902('0x54')]['rawAttributes']);_0x293c0e[_0x7902('0x2e')]=_[_0x7902('0x2f')](_0x5f26c5[_0x7902('0x2e')]);_0x293c0e['filters']=_[_0x7902('0x31')](_0x293c0e[_0x7902('0x2d')],_0x293c0e['query']);_0xa8fcaa[_0x7902('0x32')]=_[_0x7902('0x31')](_0x293c0e[_0x7902('0x2d')],qs[_0x7902('0x33')](_0x5f26c5[_0x7902('0x2e')][_0x7902('0x33')]));_0xa8fcaa[_0x7902('0x32')]=_0xa8fcaa[_0x7902('0x32')][_0x7902('0x34')]?_0xa8fcaa['attributes']:_0x293c0e[_0x7902('0x2d')];_0xa8fcaa[_0x7902('0x38')]=qs['sort'](_0x5f26c5['query'][_0x7902('0x39')]);_0xa8fcaa[_0x7902('0x3c')]=qs[_0x7902('0x30')](_[_0x7902('0x3a')](_0x5f26c5['query'],_0x293c0e[_0x7902('0x30')]));if(_0x5f26c5[_0x7902('0x2e')][_0x7902('0x3b')]){_0xa8fcaa[_0x7902('0x3c')]=_[_0x7902('0x3d')](_0xa8fcaa[_0x7902('0x3c')],{'$or':_[_0x7902('0x29')](_0xa8fcaa[_0x7902('0x32')],function(_0xb96546){var _0x3441={};_0x3441[_0xb96546]={'$like':'%'+_0x5f26c5[_0x7902('0x2e')]['filter']+'%'};return _0x3441;})});}_0xa8fcaa=_[_0x7902('0x3d')]({},_0xa8fcaa,_0x5f26c5[_0x7902('0x3f')]);return _0x2282d6[_0x7902('0x57')](_0xa8fcaa);}})[_0x7902('0x23')](function(_0x32a96e){if(_0x32a96e){_0x481f5d=_0x32a96e[_0x7902('0x34')];if(!_0x5f26c5[_0x7902('0x2e')][_0x7902('0x35')]('nolimit')){_0xa8fcaa[_0x7902('0x37')]=qs[_0x7902('0x37')](_0x5f26c5[_0x7902('0x2e')][_0x7902('0x37')]);_0xa8fcaa[_0x7902('0x1c')]=qs[_0x7902('0x1c')](_0x5f26c5[_0x7902('0x2e')]['offset']);}return _0x2282d6[_0x7902('0x57')](_0xa8fcaa);}})[_0x7902('0x23')](function(_0x3647a3){if(_0x3647a3){return _0x3647a3?{'count':_0x481f5d,'rows':_0x3647a3}:null;}})['then'](respondWithResult(_0x1cd4a0,null))[_0x7902('0x43')](handleError(_0x1cd4a0,null));};exports['getAnyConditions']=function(_0x5aaa75,_0x1603cf,_0x3e669b){var _0x57feeb={};var _0x1fae2e={};var _0x43ec3c;var _0x18e8cf;return db[_0x7902('0x2a')][_0x7902('0x58')]({'where':{'id':_0x5aaa75[_0x7902('0x45')]['id']}})[_0x7902('0x23')](handleEntityNotFound(_0x1603cf,null))[_0x7902('0x23')](function(_0x2987da){if(_0x2987da){_0x43ec3c=_0x2987da;_0x1fae2e[_0x7902('0x2d')]=_[_0x7902('0x2f')](db['Condition'][_0x7902('0x46')]);_0x1fae2e[_0x7902('0x2e')]=_[_0x7902('0x2f')](_0x5aaa75[_0x7902('0x2e')]);_0x1fae2e['filters']=_[_0x7902('0x31')](_0x1fae2e[_0x7902('0x2d')],_0x1fae2e[_0x7902('0x2e')]);_0x57feeb[_0x7902('0x32')]=_['intersection'](_0x1fae2e[_0x7902('0x2d')],qs[_0x7902('0x33')](_0x5aaa75['query'][_0x7902('0x33')]));_0x57feeb[_0x7902('0x32')]=_0x57feeb['attributes'][_0x7902('0x34')]?_0x57feeb[_0x7902('0x32')]:_0x1fae2e[_0x7902('0x2d')];_0x57feeb[_0x7902('0x38')]=qs['sort'](_0x5aaa75[_0x7902('0x2e')]['sort']);_0x57feeb[_0x7902('0x3c')]=qs['filters'](_[_0x7902('0x3a')](_0x5aaa75['query'],_0x1fae2e[_0x7902('0x30')]));if(_0x5aaa75[_0x7902('0x2e')][_0x7902('0x3b')]){_0x57feeb[_0x7902('0x3c')]=_[_0x7902('0x3d')](_0x57feeb[_0x7902('0x3c')],{'$or':_[_0x7902('0x29')](_0x57feeb[_0x7902('0x32')],function(_0x440aa8){var _0x28d9d7={};_0x28d9d7[_0x440aa8]={'$like':'%'+_0x5aaa75['query']['filter']+'%'};return _0x28d9d7;})});}_0x57feeb=_[_0x7902('0x3d')]({},_0x57feeb,_0x5aaa75[_0x7902('0x3f')]);return _0x43ec3c[_0x7902('0x59')](_0x57feeb);}})['then'](function(_0x4eb494){if(_0x4eb494){_0x18e8cf=_0x4eb494[_0x7902('0x34')];if(!_0x5aaa75['query'][_0x7902('0x35')](_0x7902('0x36'))){_0x57feeb[_0x7902('0x37')]=qs['limit'](_0x5aaa75['query']['limit']);_0x57feeb[_0x7902('0x1c')]=qs['offset'](_0x5aaa75[_0x7902('0x2e')][_0x7902('0x1c')]);}return _0x43ec3c[_0x7902('0x59')](_0x57feeb);}})[_0x7902('0x23')](function(_0x5ccf6a){if(_0x5ccf6a){return _0x5ccf6a?{'count':_0x18e8cf,'rows':_0x5ccf6a}:null;}})[_0x7902('0x23')](respondWithResult(_0x1603cf,null))[_0x7902('0x43')](handleError(_0x1603cf,null));};exports[_0x7902('0x5a')]=function(_0x191ee4,_0x2c610d,_0x5ca950){if(_0x191ee4[_0x7902('0x51')]['id']){delete _0x191ee4[_0x7902('0x51')]['id'];}return db[_0x7902('0x2a')][_0x7902('0x48')]({'where':{'id':_0x191ee4[_0x7902('0x45')]['id']}})[_0x7902('0x23')](handleEntityNotFound(_0x2c610d,null))[_0x7902('0x23')](function(_0x5b8c76){if(_0x5b8c76){_0x191ee4[_0x7902('0x51')][_0x7902('0x5b')]=_0x5b8c76['id'];return db[_0x7902('0x5c')][_0x7902('0x49')](_0x191ee4[_0x7902('0x51')]);}})['then'](respondWithResult(_0x2c610d,null))['catch'](handleError(_0x2c610d,null));};exports[_0x7902('0x5d')]=function(_0x1cc27f,_0x4157c5,_0x34c22d){var _0x2af948={};var _0x1430b5={};var _0x23b786;var _0x899323;return db[_0x7902('0x2a')][_0x7902('0x58')]({'where':{'id':_0x1cc27f[_0x7902('0x45')]['id']}})[_0x7902('0x23')](handleEntityNotFound(_0x4157c5,null))['then'](function(_0x2ce6af){if(_0x2ce6af){_0x23b786=_0x2ce6af;_0x1430b5[_0x7902('0x2d')]=_[_0x7902('0x2f')](db['Action']['rawAttributes']);_0x1430b5[_0x7902('0x2e')]=_[_0x7902('0x2f')](_0x1cc27f['query']);_0x1430b5['filters']=_[_0x7902('0x31')](_0x1430b5[_0x7902('0x2d')],_0x1430b5[_0x7902('0x2e')]);_0x2af948['attributes']=_[_0x7902('0x31')](_0x1430b5[_0x7902('0x2d')],qs[_0x7902('0x33')](_0x1cc27f[_0x7902('0x2e')][_0x7902('0x33')]));_0x2af948[_0x7902('0x32')]=_0x2af948[_0x7902('0x32')][_0x7902('0x34')]?_0x2af948['attributes']:_0x1430b5[_0x7902('0x2d')];_0x2af948[_0x7902('0x38')]=qs['sort'](_0x1cc27f[_0x7902('0x2e')][_0x7902('0x39')]);_0x2af948[_0x7902('0x3c')]=qs[_0x7902('0x30')](_['pick'](_0x1cc27f[_0x7902('0x2e')],_0x1430b5['filters']));if(_0x1cc27f[_0x7902('0x2e')]['filter']){_0x2af948['where']=_[_0x7902('0x3d')](_0x2af948[_0x7902('0x3c')],{'$or':_['map'](_0x2af948[_0x7902('0x32')],function(_0x13bab5){var _0x3646de={};_0x3646de[_0x13bab5]={'$like':'%'+_0x1cc27f[_0x7902('0x2e')][_0x7902('0x3b')]+'%'};return _0x3646de;})});}_0x2af948=_[_0x7902('0x3d')]({},_0x2af948,_0x1cc27f[_0x7902('0x3f')]);return _0x23b786['getActions'](_0x2af948);}})[_0x7902('0x23')](function(_0x1327a0){if(_0x1327a0){_0x899323=_0x1327a0[_0x7902('0x34')];if(!_0x1cc27f['query'][_0x7902('0x35')]('nolimit')){_0x2af948[_0x7902('0x37')]=qs[_0x7902('0x37')](_0x1cc27f[_0x7902('0x2e')][_0x7902('0x37')]);_0x2af948['offset']=qs[_0x7902('0x1c')](_0x1cc27f[_0x7902('0x2e')]['offset']);}return _0x23b786[_0x7902('0x5d')](_0x2af948);}})[_0x7902('0x23')](function(_0x163758){if(_0x163758){return _0x163758?{'count':_0x899323,'rows':_0x163758}:null;}})[_0x7902('0x23')](respondWithResult(_0x4157c5,null))['catch'](handleError(_0x4157c5,null));}; \ No newline at end of file +var _0xb141=['rawAttributes','order','pick','hasOwnProperty','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','merge','filter','options','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne'];(function(_0x360cf4,_0x5913d6){var _0x5176c4=function(_0x3e4849){while(--_0x3e4849){_0x360cf4['push'](_0x360cf4['shift']());}};_0x5176c4(++_0x5913d6);}(_0xb141,0x18e));var _0x1b14=function(_0x580831,_0x5e8653){_0x580831=_0x580831-0x0;var _0x111222=_0xb141[_0x580831];return _0x111222;};'use strict';var emlformat=require(_0x1b14('0x0'));var rimraf=require(_0x1b14('0x1'));var zipdir=require(_0x1b14('0x2'));var jsonpatch=require(_0x1b14('0x3'));var rp=require(_0x1b14('0x4'));var moment=require(_0x1b14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b14('0x6'));var util=require(_0x1b14('0x7'));var path=require('path');var sox=require(_0x1b14('0x8'));var csv=require(_0x1b14('0x9'));var ejs=require(_0x1b14('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b14('0xb'));var squel=require(_0x1b14('0xc'));var crypto=require('crypto');var jsforce=require(_0x1b14('0xd'));var deskjs=require(_0x1b14('0xe'));var toCsv=require(_0x1b14('0x9'));var querystring=require(_0x1b14('0xf'));var Papa=require(_0x1b14('0x10'));var Redis=require(_0x1b14('0x11'));var authService=require(_0x1b14('0x12'));var qs=require(_0x1b14('0x13'));var as=require(_0x1b14('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b14('0x15'))('api');var utils=require(_0x1b14('0x16'));var config=require(_0x1b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b14('0x18'))['db'];function respondWithStatusCode(_0x9236a3,_0x59e946){_0x59e946=_0x59e946||0xcc;return function(_0x376cb1){if(_0x376cb1){return _0x9236a3[_0x1b14('0x19')](_0x59e946);}return _0x9236a3[_0x1b14('0x1a')](_0x59e946)[_0x1b14('0x1b')]();};}function respondWithResult(_0x1998ae,_0x424da){_0x424da=_0x424da||0xc8;return function(_0x427c77){if(_0x427c77){return _0x1998ae[_0x1b14('0x1a')](_0x424da)['json'](_0x427c77);}};}function respondWithFilteredResult(_0x4b7524,_0x14080e){return function(_0x209193){if(_0x209193){var _0x367154=typeof _0x14080e[_0x1b14('0x1c')]===_0x1b14('0x1d')&&typeof _0x14080e[_0x1b14('0x1e')]===_0x1b14('0x1d');var _0x3e7a00=_0x209193[_0x1b14('0x1f')];var _0x118979=_0x367154?0x0:_0x14080e[_0x1b14('0x1c')];var _0x5b2908=_0x367154?_0x209193[_0x1b14('0x1f')]:_0x14080e[_0x1b14('0x1c')]+_0x14080e[_0x1b14('0x1e')];var _0x4673eb;if(_0x5b2908>=_0x3e7a00){_0x5b2908=_0x3e7a00;_0x4673eb=0xc8;}else{_0x4673eb=0xce;}_0x4b7524[_0x1b14('0x1a')](_0x4673eb);return _0x4b7524[_0x1b14('0x20')](_0x1b14('0x21'),_0x118979+'-'+_0x5b2908+'/'+_0x3e7a00)[_0x1b14('0x22')](_0x209193);}return null;};}function patchUpdates(_0x4e9607){return function(_0x211b18){try{jsonpatch[_0x1b14('0x23')](_0x211b18,_0x4e9607,!![]);}catch(_0x55d242){return BPromise[_0x1b14('0x24')](_0x55d242);}return _0x211b18[_0x1b14('0x25')]();};}function saveUpdates(_0x398de0,_0x249d55){return function(_0xee66e7){if(_0xee66e7){return _0xee66e7[_0x1b14('0x26')](_0x398de0)[_0x1b14('0x27')](function(_0x57adf){return _0x57adf;});}return null;};}function removeEntity(_0x5e4865,_0x484b01){return function(_0x4b8728){if(_0x4b8728){return _0x4b8728['destroy']()[_0x1b14('0x27')](function(){var _0x3b1a6c=_0x4b8728[_0x1b14('0x28')]({'plain':!![]});var _0x19e112=_0x1b14('0x29');return db[_0x1b14('0x2a')][_0x1b14('0x2b')]({'where':{'type':_0x19e112,'resourceId':_0x3b1a6c['id']}})['then'](function(){return _0x4b8728;});})[_0x1b14('0x27')](function(){_0x5e4865[_0x1b14('0x1a')](0xcc)[_0x1b14('0x1b')]();});}};}function handleEntityNotFound(_0x533064,_0x564d3d){return function(_0x37c607){if(!_0x37c607){_0x533064[_0x1b14('0x19')](0x194);}return _0x37c607;};}function handleError(_0x4f5129,_0x4ca576){_0x4ca576=_0x4ca576||0x1f4;return function(_0x4cd0f3){logger[_0x1b14('0x2c')](_0x4cd0f3[_0x1b14('0x2d')]);if(_0x4cd0f3[_0x1b14('0x2e')]){delete _0x4cd0f3[_0x1b14('0x2e')];}_0x4f5129[_0x1b14('0x1a')](_0x4ca576)[_0x1b14('0x2f')](_0x4cd0f3);};}exports[_0x1b14('0x30')]=function(_0x5d5565,_0x18601c){var _0x287dab={},_0x2b5573={},_0x28710c={'count':0x0,'rows':[]};var _0xfba8b4=_[_0x1b14('0x31')](db[_0x1b14('0x32')]['rawAttributes'],function(_0x30754c){return{'name':_0x30754c[_0x1b14('0x33')],'type':_0x30754c[_0x1b14('0x34')][_0x1b14('0x35')]};});_0x2b5573[_0x1b14('0x36')]=_['map'](_0xfba8b4,_0x1b14('0x2e'));_0x2b5573['query']=_[_0x1b14('0x37')](_0x5d5565[_0x1b14('0x38')]);_0x2b5573[_0x1b14('0x39')]=_[_0x1b14('0x3a')](_0x2b5573['model'],_0x2b5573[_0x1b14('0x38')]);_0x287dab[_0x1b14('0x3b')]=_['intersection'](_0x2b5573[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x5d5565[_0x1b14('0x38')][_0x1b14('0x3c')]));_0x287dab[_0x1b14('0x3b')]=_0x287dab[_0x1b14('0x3b')][_0x1b14('0x3d')]?_0x287dab[_0x1b14('0x3b')]:_0x2b5573['model'];if(!_0x5d5565['query']['hasOwnProperty']('nolimit')){_0x287dab[_0x1b14('0x1e')]=qs[_0x1b14('0x1e')](_0x5d5565[_0x1b14('0x38')][_0x1b14('0x1e')]);_0x287dab[_0x1b14('0x1c')]=qs[_0x1b14('0x1c')](_0x5d5565[_0x1b14('0x38')][_0x1b14('0x1c')]);}_0x287dab['order']=qs[_0x1b14('0x3e')](_0x5d5565['query'][_0x1b14('0x3e')]);_0x287dab[_0x1b14('0x3f')]=qs[_0x1b14('0x39')](_['pick'](_0x5d5565[_0x1b14('0x38')],_0x2b5573[_0x1b14('0x39')]),_0xfba8b4);if(_0x5d5565['query']['filter']){_0x287dab[_0x1b14('0x3f')]=_[_0x1b14('0x40')](_0x287dab[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0xfba8b4,function(_0x517951){if(_0x517951[_0x1b14('0x34')]!=='VIRTUAL'){var _0x972fce={};_0x972fce[_0x517951[_0x1b14('0x2e')]]={'$like':'%'+_0x5d5565[_0x1b14('0x38')][_0x1b14('0x41')]+'%'};return _0x972fce;}})});}_0x287dab=_['merge']({},_0x287dab,_0x5d5565[_0x1b14('0x42')]);var _0x1b777b={'where':_0x287dab[_0x1b14('0x3f')]};return db[_0x1b14('0x32')][_0x1b14('0x1f')](_0x1b777b)['then'](function(_0x34fe73){_0x28710c['count']=_0x34fe73;if(_0x5d5565['query'][_0x1b14('0x43')]){_0x287dab[_0x1b14('0x44')]=[{'all':!![]}];}return db[_0x1b14('0x32')]['findAll'](_0x287dab);})[_0x1b14('0x27')](function(_0x101fb7){_0x28710c[_0x1b14('0x45')]=_0x101fb7;return _0x28710c;})[_0x1b14('0x27')](respondWithFilteredResult(_0x18601c,_0x287dab))['catch'](handleError(_0x18601c,null));};exports[_0x1b14('0x46')]=function(_0x1a5425,_0xb046a1){var _0xdf058e={'raw':![],'where':{'id':_0x1a5425[_0x1b14('0x47')]['id']}},_0x584302={};_0x584302[_0x1b14('0x36')]=_[_0x1b14('0x37')](db[_0x1b14('0x32')]['rawAttributes']);_0x584302['query']=_[_0x1b14('0x37')](_0x1a5425['query']);_0x584302[_0x1b14('0x39')]=_[_0x1b14('0x3a')](_0x584302['model'],_0x584302[_0x1b14('0x38')]);_0xdf058e[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x584302[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x1a5425[_0x1b14('0x38')][_0x1b14('0x3c')]));_0xdf058e[_0x1b14('0x3b')]=_0xdf058e[_0x1b14('0x3b')]['length']?_0xdf058e[_0x1b14('0x3b')]:_0x584302[_0x1b14('0x36')];if(_0x1a5425[_0x1b14('0x38')]['includeAll']){_0xdf058e[_0x1b14('0x44')]=[{'all':!![]}];}_0xdf058e=_[_0x1b14('0x40')]({},_0xdf058e,_0x1a5425[_0x1b14('0x42')]);return db['Trigger'][_0x1b14('0x48')](_0xdf058e)[_0x1b14('0x27')](handleEntityNotFound(_0xb046a1,null))['then'](respondWithResult(_0xb046a1,null))['catch'](handleError(_0xb046a1,null));};exports[_0x1b14('0x49')]=function(_0x488006,_0x244ac0){return db['Trigger'][_0x1b14('0x49')](_0x488006[_0x1b14('0x4a')],{})[_0x1b14('0x27')](function(_0x295f27){var _0x5c8823=_0x488006[_0x1b14('0x4b')][_0x1b14('0x28')]({'plain':!![]});if(!_0x5c8823)throw new Error(_0x1b14('0x4c'));if(_0x5c8823[_0x1b14('0x4d')]===_0x1b14('0x4b')){var _0xb1389b=_0x295f27[_0x1b14('0x28')]({'plain':!![]});var _0x1f494c=_0x1b14('0x29');return db[_0x1b14('0x4e')][_0x1b14('0x48')]({'where':{'name':_0x1f494c,'userProfileId':_0x5c8823[_0x1b14('0x4f')]},'raw':!![]})[_0x1b14('0x27')](function(_0x4e9178){if(_0x4e9178&&_0x4e9178['autoAssociation']===0x0){return db[_0x1b14('0x2a')][_0x1b14('0x49')]({'name':_0xb1389b[_0x1b14('0x2e')],'resourceId':_0xb1389b['id'],'type':_0x4e9178['name'],'sectionId':_0x4e9178['id']},{})['then'](function(){return _0x295f27;});}else{return _0x295f27;}})[_0x1b14('0x50')](function(_0x4f8223){logger[_0x1b14('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f8223);throw _0x4f8223;});}return _0x295f27;})[_0x1b14('0x27')](respondWithResult(_0x244ac0,0xc9))[_0x1b14('0x50')](handleError(_0x244ac0,null));};exports[_0x1b14('0x26')]=function(_0x1a02a9,_0x403da8){if(_0x1a02a9[_0x1b14('0x4a')]['id']){delete _0x1a02a9[_0x1b14('0x4a')]['id'];}return db['Trigger'][_0x1b14('0x48')]({'where':{'id':_0x1a02a9[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x403da8,null))[_0x1b14('0x27')](saveUpdates(_0x1a02a9[_0x1b14('0x4a')],null))[_0x1b14('0x27')](respondWithResult(_0x403da8,null))[_0x1b14('0x50')](handleError(_0x403da8,null));};exports[_0x1b14('0x2b')]=function(_0x5b77c8,_0x2dfe01){return db['Trigger'][_0x1b14('0x48')]({'where':{'id':_0x5b77c8['params']['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x2dfe01,null))[_0x1b14('0x27')](removeEntity(_0x2dfe01,null))[_0x1b14('0x50')](handleError(_0x2dfe01,null));};exports[_0x1b14('0x51')]=function(_0x5db469,_0x70336b,_0x2090df){if(_0x5db469[_0x1b14('0x4a')]['id']){delete _0x5db469[_0x1b14('0x4a')]['id'];}return db[_0x1b14('0x32')][_0x1b14('0x48')]({'where':{'id':_0x5db469[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x70336b,null))['then'](function(_0x5f48e8){if(_0x5f48e8){_0x5db469[_0x1b14('0x4a')]['TriggerAllId']=_0x5f48e8['id'];return db[_0x1b14('0x52')][_0x1b14('0x49')](_0x5db469[_0x1b14('0x4a')]);}})[_0x1b14('0x27')](respondWithResult(_0x70336b,null))[_0x1b14('0x50')](handleError(_0x70336b,null));};exports[_0x1b14('0x53')]=function(_0x35520f,_0x583cbe,_0x5c5e61){if(_0x35520f[_0x1b14('0x4a')]['id']){delete _0x35520f[_0x1b14('0x4a')]['id'];}return db[_0x1b14('0x32')][_0x1b14('0x48')]({'where':{'id':_0x35520f['params']['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x583cbe,null))[_0x1b14('0x27')](function(_0x13c360){if(_0x13c360){_0x35520f['body'][_0x1b14('0x54')]=_0x13c360['id'];return db[_0x1b14('0x52')][_0x1b14('0x49')](_0x35520f[_0x1b14('0x4a')]);}})['then'](respondWithResult(_0x583cbe,null))[_0x1b14('0x50')](handleError(_0x583cbe,null));};exports[_0x1b14('0x55')]=function(_0x199902,_0x88f18f,_0x389025){var _0x34c9c5={};var _0x59745c={};var _0x4e615d;var _0x594b4d;return db[_0x1b14('0x32')][_0x1b14('0x56')]({'where':{'id':_0x199902[_0x1b14('0x47')]['id']}})['then'](handleEntityNotFound(_0x88f18f,null))[_0x1b14('0x27')](function(_0x2e98fc){if(_0x2e98fc){_0x4e615d=_0x2e98fc;_0x59745c[_0x1b14('0x36')]=_[_0x1b14('0x37')](db[_0x1b14('0x52')][_0x1b14('0x57')]);_0x59745c[_0x1b14('0x38')]=_[_0x1b14('0x37')](_0x199902[_0x1b14('0x38')]);_0x59745c['filters']=_[_0x1b14('0x3a')](_0x59745c[_0x1b14('0x36')],_0x59745c[_0x1b14('0x38')]);_0x34c9c5[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x59745c[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x199902['query'][_0x1b14('0x3c')]));_0x34c9c5[_0x1b14('0x3b')]=_0x34c9c5[_0x1b14('0x3b')][_0x1b14('0x3d')]?_0x34c9c5[_0x1b14('0x3b')]:_0x59745c[_0x1b14('0x36')];_0x34c9c5[_0x1b14('0x58')]=qs['sort'](_0x199902['query'][_0x1b14('0x3e')]);_0x34c9c5['where']=qs[_0x1b14('0x39')](_[_0x1b14('0x59')](_0x199902[_0x1b14('0x38')],_0x59745c[_0x1b14('0x39')]));if(_0x199902['query'][_0x1b14('0x41')]){_0x34c9c5['where']=_[_0x1b14('0x40')](_0x34c9c5[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0x34c9c5[_0x1b14('0x3b')],function(_0x32120b){var _0x5ae7fd={};_0x5ae7fd[_0x32120b]={'$like':'%'+_0x199902[_0x1b14('0x38')][_0x1b14('0x41')]+'%'};return _0x5ae7fd;})});}_0x34c9c5=_['merge']({},_0x34c9c5,_0x199902[_0x1b14('0x42')]);return _0x4e615d[_0x1b14('0x55')](_0x34c9c5);}})['then'](function(_0x353d66){if(_0x353d66){_0x594b4d=_0x353d66[_0x1b14('0x3d')];if(!_0x199902[_0x1b14('0x38')][_0x1b14('0x5a')](_0x1b14('0x5b'))){_0x34c9c5[_0x1b14('0x1e')]=qs[_0x1b14('0x1e')](_0x199902[_0x1b14('0x38')][_0x1b14('0x1e')]);_0x34c9c5[_0x1b14('0x1c')]=qs[_0x1b14('0x1c')](_0x199902['query'][_0x1b14('0x1c')]);}return _0x4e615d[_0x1b14('0x55')](_0x34c9c5);}})[_0x1b14('0x27')](function(_0x2504bf){if(_0x2504bf){return _0x2504bf?{'count':_0x594b4d,'rows':_0x2504bf}:null;}})[_0x1b14('0x27')](respondWithResult(_0x88f18f,null))[_0x1b14('0x50')](handleError(_0x88f18f,null));};exports[_0x1b14('0x5c')]=function(_0x383cc6,_0x141a6b,_0x57921d){var _0x45914a={};var _0x4a5178={};var _0x14ea6a;var _0x34e6e0;return db['Trigger'][_0x1b14('0x56')]({'where':{'id':_0x383cc6[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x141a6b,null))[_0x1b14('0x27')](function(_0x3f7a3a){if(_0x3f7a3a){_0x14ea6a=_0x3f7a3a;_0x4a5178[_0x1b14('0x36')]=_['keys'](db[_0x1b14('0x52')]['rawAttributes']);_0x4a5178[_0x1b14('0x38')]=_[_0x1b14('0x37')](_0x383cc6[_0x1b14('0x38')]);_0x4a5178[_0x1b14('0x39')]=_[_0x1b14('0x3a')](_0x4a5178[_0x1b14('0x36')],_0x4a5178[_0x1b14('0x38')]);_0x45914a[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x4a5178[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x383cc6[_0x1b14('0x38')][_0x1b14('0x3c')]));_0x45914a[_0x1b14('0x3b')]=_0x45914a[_0x1b14('0x3b')][_0x1b14('0x3d')]?_0x45914a['attributes']:_0x4a5178[_0x1b14('0x36')];_0x45914a['order']=qs[_0x1b14('0x3e')](_0x383cc6[_0x1b14('0x38')]['sort']);_0x45914a[_0x1b14('0x3f')]=qs[_0x1b14('0x39')](_[_0x1b14('0x59')](_0x383cc6[_0x1b14('0x38')],_0x4a5178[_0x1b14('0x39')]));if(_0x383cc6[_0x1b14('0x38')][_0x1b14('0x41')]){_0x45914a[_0x1b14('0x3f')]=_[_0x1b14('0x40')](_0x45914a[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0x45914a['attributes'],function(_0x4c02f1){var _0x1d6873={};_0x1d6873[_0x4c02f1]={'$like':'%'+_0x383cc6['query'][_0x1b14('0x41')]+'%'};return _0x1d6873;})});}_0x45914a=_[_0x1b14('0x40')]({},_0x45914a,_0x383cc6['options']);return _0x14ea6a[_0x1b14('0x5c')](_0x45914a);}})[_0x1b14('0x27')](function(_0x278a26){if(_0x278a26){_0x34e6e0=_0x278a26[_0x1b14('0x3d')];if(!_0x383cc6['query'][_0x1b14('0x5a')](_0x1b14('0x5b'))){_0x45914a['limit']=qs['limit'](_0x383cc6['query'][_0x1b14('0x1e')]);_0x45914a[_0x1b14('0x1c')]=qs[_0x1b14('0x1c')](_0x383cc6['query'][_0x1b14('0x1c')]);}return _0x14ea6a[_0x1b14('0x5c')](_0x45914a);}})[_0x1b14('0x27')](function(_0x1e6b15){if(_0x1e6b15){return _0x1e6b15?{'count':_0x34e6e0,'rows':_0x1e6b15}:null;}})['then'](respondWithResult(_0x141a6b,null))[_0x1b14('0x50')](handleError(_0x141a6b,null));};exports[_0x1b14('0x5d')]=function(_0x1a30ed,_0x3a9c41,_0x31ad2c){if(_0x1a30ed['body']['id']){delete _0x1a30ed[_0x1b14('0x4a')]['id'];}return db['Trigger'][_0x1b14('0x48')]({'where':{'id':_0x1a30ed[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x3a9c41,null))['then'](function(_0x572f73){if(_0x572f73){_0x1a30ed[_0x1b14('0x4a')][_0x1b14('0x5e')]=_0x572f73['id'];return db[_0x1b14('0x5f')][_0x1b14('0x49')](_0x1a30ed[_0x1b14('0x4a')]);}})[_0x1b14('0x27')](respondWithResult(_0x3a9c41,null))[_0x1b14('0x50')](handleError(_0x3a9c41,null));};exports[_0x1b14('0x60')]=function(_0x53f1a3,_0x167a28,_0x1c4282){var _0x3c9489={};var _0x3e2a70={};var _0x2c6b3c;var _0x3adfff;return db[_0x1b14('0x32')][_0x1b14('0x56')]({'where':{'id':_0x53f1a3[_0x1b14('0x47')]['id']}})['then'](handleEntityNotFound(_0x167a28,null))[_0x1b14('0x27')](function(_0x27466b){if(_0x27466b){_0x2c6b3c=_0x27466b;_0x3e2a70[_0x1b14('0x36')]=_['keys'](db[_0x1b14('0x5f')]['rawAttributes']);_0x3e2a70['query']=_[_0x1b14('0x37')](_0x53f1a3[_0x1b14('0x38')]);_0x3e2a70[_0x1b14('0x39')]=_['intersection'](_0x3e2a70[_0x1b14('0x36')],_0x3e2a70['query']);_0x3c9489[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x3e2a70['model'],qs[_0x1b14('0x3c')](_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x3c')]));_0x3c9489['attributes']=_0x3c9489['attributes'][_0x1b14('0x3d')]?_0x3c9489[_0x1b14('0x3b')]:_0x3e2a70[_0x1b14('0x36')];_0x3c9489[_0x1b14('0x58')]=qs['sort'](_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x3e')]);_0x3c9489['where']=qs[_0x1b14('0x39')](_[_0x1b14('0x59')](_0x53f1a3['query'],_0x3e2a70[_0x1b14('0x39')]));if(_0x53f1a3['query'][_0x1b14('0x41')]){_0x3c9489[_0x1b14('0x3f')]=_[_0x1b14('0x40')](_0x3c9489[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0x3c9489[_0x1b14('0x3b')],function(_0x5b3c6e){var _0x882299={};_0x882299[_0x5b3c6e]={'$like':'%'+_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x41')]+'%'};return _0x882299;})});}_0x3c9489=_[_0x1b14('0x40')]({},_0x3c9489,_0x53f1a3[_0x1b14('0x42')]);return _0x2c6b3c[_0x1b14('0x60')](_0x3c9489);}})[_0x1b14('0x27')](function(_0xba505d){if(_0xba505d){_0x3adfff=_0xba505d[_0x1b14('0x3d')];if(!_0x53f1a3[_0x1b14('0x38')]['hasOwnProperty'](_0x1b14('0x5b'))){_0x3c9489[_0x1b14('0x1e')]=qs[_0x1b14('0x1e')](_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x1e')]);_0x3c9489['offset']=qs[_0x1b14('0x1c')](_0x53f1a3['query'][_0x1b14('0x1c')]);}return _0x2c6b3c[_0x1b14('0x60')](_0x3c9489);}})['then'](function(_0x48fd05){if(_0x48fd05){return _0x48fd05?{'count':_0x3adfff,'rows':_0x48fd05}:null;}})[_0x1b14('0x27')](respondWithResult(_0x167a28,null))[_0x1b14('0x50')](handleError(_0x167a28,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index b95551a..3d43afc 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe132=['Trigger','tools_triggers','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x1f058b,_0x4a47cf){var _0x5c5232=function(_0x11eee8){while(--_0x11eee8){_0x1f058b['push'](_0x1f058b['shift']());}};_0x5c5232(++_0x4a47cf);}(_0xe132,0x162));var _0x2e13=function(_0x134d4b,_0x5f44a2){_0x134d4b=_0x134d4b-0x0;var _0x26a9fb=_0xe132[_0x134d4b];return _0x26a9fb;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./trigger.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bde=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','../../config/logger','api','bluebird'];(function(_0x3c9a48,_0x94ee9f){var _0x4e5118=function(_0x389f99){while(--_0x389f99){_0x3c9a48['push'](_0x3c9a48['shift']());}};_0x4e5118(++_0x94ee9f);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var moment=require('moment');var BPromise=require(_0xe0bd('0x3'));var rp=require(_0xe0bd('0x4'));var fs=require('fs');var path=require(_0xe0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xe0bd('0x6'));var attributes=require(_0xe0bd('0x7'));module[_0xe0bd('0x8')]=function(_0x3a3cd2,_0x37289f){return _0x3a3cd2[_0xe0bd('0x9')](_0xe0bd('0xa'),attributes,{'tableName':_0xe0bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index f012c25..3224307 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e3e=['stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','error','code','result','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','message','ShowTrigger','find'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5e3e,0x1d6));var _0xe5e3=function(_0x404f55,_0x2814e3){_0x404f55=_0x404f55-0x0;var _0x395a9e=_0x5e3e[_0x404f55];return _0x395a9e;};'use strict';var _=require(_0xe5e3('0x0'));var util=require(_0xe5e3('0x1'));var moment=require(_0xe5e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xe5e3('0x3'));var fs=require('fs');var Redis=require(_0xe5e3('0x4'));var db=require(_0xe5e3('0x5'))['db'];var utils=require(_0xe5e3('0x6'));var logger=require('../../config/logger')(_0xe5e3('0x7'));var config=require(_0xe5e3('0x8'));var jayson=require(_0xe5e3('0x9'));var client=jayson['client'][_0xe5e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x173058,_0x3f5dce,_0x362f9a){return new BPromise(function(_0x21b516,_0xaf4f1a){return client[_0xe5e3('0xb')](_0x173058,_0x362f9a)[_0xe5e3('0xc')](function(_0x110504){logger[_0xe5e3('0xd')](_0xe5e3('0xe'),_0x3f5dce,_0xe5e3('0xf'));logger[_0xe5e3('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3f5dce,'request\x20sent',JSON['stringify'](_0x110504));if(_0x110504[_0xe5e3('0x11')]){if(_0x110504[_0xe5e3('0x11')][_0xe5e3('0x12')]===0x1f4){logger[_0xe5e3('0x11')](_0xe5e3('0xe'),_0x3f5dce,_0x110504['error']['message']);return _0xaf4f1a(_0x110504[_0xe5e3('0x11')]['message']);}logger[_0xe5e3('0x11')](_0xe5e3('0xe'),_0x3f5dce,_0x110504[_0xe5e3('0x11')]['message']);return _0x21b516(_0x110504[_0xe5e3('0x11')]['message']);}else{logger[_0xe5e3('0xd')](_0xe5e3('0xe'),_0x3f5dce,_0xe5e3('0xf'));_0x21b516(_0x110504[_0xe5e3('0x13')]['message']);}})['catch'](function(_0x9bdee8){logger[_0xe5e3('0x11')](_0xe5e3('0xe'),_0x3f5dce,_0x9bdee8);_0xaf4f1a(_0x9bdee8);});});}exports['GetTrigger']=function(_0x33fa74){var _0x127dcd=this;return new Promise(function(_0x23beb9,_0x3e77d5){return db[_0xe5e3('0x14')][_0xe5e3('0x15')]({'raw':_0x33fa74[_0xe5e3('0x16')]?_0x33fa74[_0xe5e3('0x16')][_0xe5e3('0x17')]===undefined?!![]:![]:!![],'where':_0x33fa74['options']?_0x33fa74[_0xe5e3('0x16')][_0xe5e3('0x18')]||null:null,'attributes':_0x33fa74[_0xe5e3('0x16')]?_0x33fa74[_0xe5e3('0x16')][_0xe5e3('0x19')]||null:null,'limit':_0x33fa74[_0xe5e3('0x16')]?_0x33fa74[_0xe5e3('0x16')][_0xe5e3('0x1a')]||null:null,'include':_0x33fa74[_0xe5e3('0x16')]?_0x33fa74[_0xe5e3('0x16')][_0xe5e3('0x1b')]?_[_0xe5e3('0x1c')](_0x33fa74[_0xe5e3('0x16')][_0xe5e3('0x1b')],function(_0x1aeb79){return{'model':db[_0x1aeb79[_0xe5e3('0x1d')]],'as':_0x1aeb79['as'],'attributes':_0x1aeb79[_0xe5e3('0x19')],'include':_0x1aeb79[_0xe5e3('0x1b')]?_[_0xe5e3('0x1c')](_0x1aeb79['include'],function(_0x2e2613){return{'model':db[_0x2e2613[_0xe5e3('0x1d')]],'as':_0x2e2613['as'],'attributes':_0x2e2613['attributes'],'include':_0x2e2613[_0xe5e3('0x1b')]?_[_0xe5e3('0x1c')](_0x2e2613[_0xe5e3('0x1b')],function(_0x53c8d0){return{'model':db[_0x53c8d0[_0xe5e3('0x1d')]],'as':_0x53c8d0['as'],'attributes':_0x53c8d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5e3('0xc')](function(_0x2dd2f4){logger['info'](_0xe5e3('0x1e'),_0x33fa74);logger[_0xe5e3('0x10')](_0xe5e3('0x1e'),_0x33fa74,JSON['stringify'](_0x2dd2f4));_0x23beb9(_0x2dd2f4);})['catch'](function(_0xf2abc3){logger[_0xe5e3('0x11')](_0xe5e3('0x1e'),_0xf2abc3[_0xe5e3('0x1f')],_0x33fa74);_0x3e77d5(_0x127dcd[_0xe5e3('0x11')](0x1f4,_0xf2abc3['message']));});});};exports[_0xe5e3('0x20')]=function(_0x352a0f){var _0x1b6b2e=this;return new Promise(function(_0x531796,_0x1cc9db){return db[_0xe5e3('0x14')][_0xe5e3('0x21')]({'raw':_0x352a0f[_0xe5e3('0x16')]?_0x352a0f[_0xe5e3('0x16')][_0xe5e3('0x17')]===undefined?!![]:![]:!![],'where':_0x352a0f[_0xe5e3('0x16')]?_0x352a0f['options'][_0xe5e3('0x18')]||null:null,'attributes':_0x352a0f[_0xe5e3('0x16')]?_0x352a0f['options'][_0xe5e3('0x19')]||null:null,'include':_0x352a0f[_0xe5e3('0x16')]?_0x352a0f['options'][_0xe5e3('0x1b')]?_['map'](_0x352a0f[_0xe5e3('0x16')][_0xe5e3('0x1b')],function(_0x12b579){return{'model':db[_0x12b579['model']],'as':_0x12b579['as'],'attributes':_0x12b579[_0xe5e3('0x19')],'include':_0x12b579[_0xe5e3('0x1b')]?_['map'](_0x12b579[_0xe5e3('0x1b')],function(_0x531252){return{'model':db[_0x531252[_0xe5e3('0x1d')]],'as':_0x531252['as'],'attributes':_0x531252[_0xe5e3('0x19')],'include':_0x531252[_0xe5e3('0x1b')]?_[_0xe5e3('0x1c')](_0x531252['include'],function(_0x90162c){return{'model':db[_0x90162c[_0xe5e3('0x1d')]],'as':_0x90162c['as'],'attributes':_0x90162c[_0xe5e3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe5e3('0xc')](function(_0x32a795){logger['info'](_0xe5e3('0x20'),_0x352a0f);logger[_0xe5e3('0x10')]('ShowTrigger',_0x352a0f,JSON[_0xe5e3('0x22')](_0x32a795));_0x531796(_0x32a795);})[_0xe5e3('0x23')](function(_0x2f1599){logger[_0xe5e3('0x11')](_0xe5e3('0x20'),_0x2f1599[_0xe5e3('0x1f')],_0x352a0f);_0x1cc9db(_0x1b6b2e[_0xe5e3('0x11')](0x1f4,_0x2f1599[_0xe5e3('0x1f')]));});});}; \ No newline at end of file +var _0x7651=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','Trigger','findAll','options','raw','attributes','limit','include','model','map','GetTrigger','stringify','find','where','ShowTrigger'];(function(_0x489eb9,_0x5037ca){var _0x5598c5=function(_0x5efcb2){while(--_0x5efcb2){_0x489eb9['push'](_0x489eb9['shift']());}};_0x5598c5(++_0x5037ca);}(_0x7651,0x6c));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1765('0x0'));var util=require(_0x1765('0x1'));var moment=require(_0x1765('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1765('0x3'));var db=require(_0x1765('0x4'))['db'];var utils=require(_0x1765('0x5'));var logger=require(_0x1765('0x6'))(_0x1765('0x7'));var config=require(_0x1765('0x8'));var jayson=require(_0x1765('0x9'));var client=jayson[_0x1765('0xa')][_0x1765('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x315d15,_0x2ebd95,_0x1d267d){return new BPromise(function(_0x5c2b80,_0x2306eb){return client['request'](_0x315d15,_0x1d267d)[_0x1765('0xc')](function(_0x407bda){logger['info'](_0x1765('0xd'),_0x2ebd95,_0x1765('0xe'));logger[_0x1765('0xf')](_0x1765('0x10'),_0x2ebd95,'request\x20sent',JSON['stringify'](_0x407bda));if(_0x407bda[_0x1765('0x11')]){if(_0x407bda[_0x1765('0x11')]['code']===0x1f4){logger[_0x1765('0x11')](_0x1765('0xd'),_0x2ebd95,_0x407bda[_0x1765('0x11')][_0x1765('0x12')]);return _0x2306eb(_0x407bda['error'][_0x1765('0x12')]);}logger['error'](_0x1765('0xd'),_0x2ebd95,_0x407bda[_0x1765('0x11')][_0x1765('0x12')]);return _0x5c2b80(_0x407bda[_0x1765('0x11')][_0x1765('0x12')]);}else{logger[_0x1765('0x13')](_0x1765('0xd'),_0x2ebd95,_0x1765('0xe'));_0x5c2b80(_0x407bda[_0x1765('0x14')][_0x1765('0x12')]);}})[_0x1765('0x15')](function(_0xfce9a4){logger[_0x1765('0x11')](_0x1765('0xd'),_0x2ebd95,_0xfce9a4);_0x2306eb(_0xfce9a4);});});}exports['GetTrigger']=function(_0xdf0e44){var _0x2c15be=this;return new Promise(function(_0x1892b5,_0x3a074d){return db[_0x1765('0x16')][_0x1765('0x17')]({'raw':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')][_0x1765('0x19')]===undefined?!![]:![]:!![],'where':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')]['where']||null:null,'attributes':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')][_0x1765('0x1a')]||null:null,'limit':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')][_0x1765('0x1b')]||null:null,'include':_0xdf0e44['options']?_0xdf0e44[_0x1765('0x18')][_0x1765('0x1c')]?_['map'](_0xdf0e44['options']['include'],function(_0x4e4c2a){return{'model':db[_0x4e4c2a[_0x1765('0x1d')]],'as':_0x4e4c2a['as'],'attributes':_0x4e4c2a[_0x1765('0x1a')],'include':_0x4e4c2a[_0x1765('0x1c')]?_[_0x1765('0x1e')](_0x4e4c2a['include'],function(_0x293003){return{'model':db[_0x293003[_0x1765('0x1d')]],'as':_0x293003['as'],'attributes':_0x293003[_0x1765('0x1a')],'include':_0x293003[_0x1765('0x1c')]?_['map'](_0x293003[_0x1765('0x1c')],function(_0x2936f){return{'model':db[_0x2936f[_0x1765('0x1d')]],'as':_0x2936f['as'],'attributes':_0x2936f[_0x1765('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1765('0xc')](function(_0x51f760){logger[_0x1765('0x13')](_0x1765('0x1f'),_0xdf0e44);logger[_0x1765('0xf')](_0x1765('0x1f'),_0xdf0e44,JSON[_0x1765('0x20')](_0x51f760));_0x1892b5(_0x51f760);})[_0x1765('0x15')](function(_0x65137c){logger[_0x1765('0x11')](_0x1765('0x1f'),_0x65137c[_0x1765('0x12')],_0xdf0e44);_0x3a074d(_0x2c15be[_0x1765('0x11')](0x1f4,_0x65137c[_0x1765('0x12')]));});});};exports['ShowTrigger']=function(_0x51c2a7){var _0x24e1e4=this;return new Promise(function(_0x58f978,_0x5f1399){return db[_0x1765('0x16')][_0x1765('0x21')]({'raw':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')][_0x1765('0x22')]||null:null,'attributes':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')]['attributes']||null:null,'include':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')][_0x1765('0x1c')]?_['map'](_0x51c2a7[_0x1765('0x18')][_0x1765('0x1c')],function(_0x29fb78){return{'model':db[_0x29fb78[_0x1765('0x1d')]],'as':_0x29fb78['as'],'attributes':_0x29fb78[_0x1765('0x1a')],'include':_0x29fb78[_0x1765('0x1c')]?_[_0x1765('0x1e')](_0x29fb78['include'],function(_0x541ff7){return{'model':db[_0x541ff7[_0x1765('0x1d')]],'as':_0x541ff7['as'],'attributes':_0x541ff7['attributes'],'include':_0x541ff7['include']?_[_0x1765('0x1e')](_0x541ff7[_0x1765('0x1c')],function(_0x253cde){return{'model':db[_0x253cde[_0x1765('0x1d')]],'as':_0x253cde['as'],'attributes':_0x253cde[_0x1765('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1765('0xc')](function(_0x34789d){logger[_0x1765('0x13')]('ShowTrigger',_0x51c2a7);logger[_0x1765('0xf')](_0x1765('0x23'),_0x51c2a7,JSON[_0x1765('0x20')](_0x34789d));_0x58f978(_0x34789d);})[_0x1765('0x15')](function(_0x2b4e49){logger[_0x1765('0x11')](_0x1765('0x23'),_0x2b4e49['message'],_0x51c2a7);_0x5f1399(_0x24e1e4[_0x1765('0x11')](0x1f4,_0x2b4e49['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index a57c5f4..9b9ac0d 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4388=['/:id','show','/:id/clone','clone','post','create','put','update','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index'];(function(_0x184c80,_0x4f13dc){var _0x569191=function(_0x8a58de){while(--_0x8a58de){_0x184c80['push'](_0x184c80['shift']());}};_0x569191(++_0x4f13dc);}(_0x4388,0x8f));var _0x8438=function(_0x43cd8c,_0x53b715){_0x43cd8c=_0x43cd8c-0x0;var _0x4f879e=_0x4388[_0x43cd8c];return _0x4f879e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8438('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8438('0x1')]();var fs_extra=require(_0x8438('0x2'));var auth=require(_0x8438('0x3'));var interaction=require(_0x8438('0x4'));var config=require(_0x8438('0x5'));var controller=require(_0x8438('0x6'));router['get']('/',auth[_0x8438('0x7')](),controller[_0x8438('0x8')]);router['get'](_0x8438('0x9'),auth[_0x8438('0x7')](),controller[_0x8438('0xa')]);router['post'](_0x8438('0xb'),auth['isAuthenticated'](),controller[_0x8438('0xc')]);router[_0x8438('0xd')]('/',auth[_0x8438('0x7')](),controller[_0x8438('0xe')]);router[_0x8438('0xf')]('/:id',auth[_0x8438('0x7')](),controller[_0x8438('0x10')]);router['delete'](_0x8438('0x9'),auth['isAuthenticated'](),controller[_0x8438('0x11')]);module[_0x8438('0x12')]=router; \ No newline at end of file +var _0x0d70=['clone','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0d70,0xe1));var _0x00d7=function(_0x119ef1,_0x17c4e5){_0x119ef1=_0x119ef1-0x0;var _0x33fcc5=_0x0d70[_0x119ef1];return _0x33fcc5;};'use strict';var multer=require('multer');var util=require(_0x00d7('0x0'));var path=require(_0x00d7('0x1'));var timeout=require(_0x00d7('0x2'));var express=require(_0x00d7('0x3'));var router=express[_0x00d7('0x4')]();var fs_extra=require(_0x00d7('0x5'));var auth=require(_0x00d7('0x6'));var interaction=require(_0x00d7('0x7'));var config=require(_0x00d7('0x8'));var controller=require(_0x00d7('0x9'));router[_0x00d7('0xa')]('/',auth[_0x00d7('0xb')](),controller[_0x00d7('0xc')]);router[_0x00d7('0xa')](_0x00d7('0xd'),auth[_0x00d7('0xb')](),controller[_0x00d7('0xe')]);router[_0x00d7('0xf')](_0x00d7('0x10'),auth[_0x00d7('0xb')](),controller[_0x00d7('0x11')]);router[_0x00d7('0xf')]('/',auth[_0x00d7('0xb')](),controller[_0x00d7('0x12')]);router[_0x00d7('0x13')](_0x00d7('0xd'),auth[_0x00d7('0xb')](),controller[_0x00d7('0x14')]);router[_0x00d7('0x15')](_0x00d7('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 698e581..3f48022 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x334b=['nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','getDataValue','split','ENUM','rfc2833','info','auto','yes','update','force_rport,comedia','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','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]','INTEGER','always','refuse','originate','uas','fingerprint','active','passive','actpass'];(function(_0x146a54,_0xdc746b){var _0x1aea53=function(_0x213fe2){while(--_0x213fe2){_0x146a54['push'](_0x146a54['shift']());}};_0x1aea53(++_0xdc746b);}(_0x334b,0xbf));var _0xb334=function(_0x3b6964,_0x2445e1){_0x3b6964=_0x3b6964-0x0;var _0x11ad10=_0x334b[_0x3b6964];return _0x11ad10;};'use strict';var Sequelize=require(_0xb334('0x0'));module[_0xb334('0x1')]={'name':{'type':Sequelize[_0xb334('0x2')],'allowNull':![],'unique':_0xb334('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xb334('0x4'),_0xb334('0x5'),_0xb334('0x6')),'allowNull':![],'defaultValue':_0xb334('0x4')},'context':{'type':Sequelize[_0xb334('0x2')],'allowNull':![],'defaultValue':_0xb334('0x7')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xb334('0x8'),_0xb334('0x9'),_0xb334('0xa'),_0xb334('0xb'),_0xb334('0xc'),_0xb334('0xd'),_0xb334('0xe'))},'deny':{'type':Sequelize[_0xb334('0x2')]},'permit':{'type':Sequelize[_0xb334('0x2')]},'secret':{'type':Sequelize[_0xb334('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xb334('0x2')]},'transport':{'type':Sequelize[_0xb334('0x2')],'defaultValue':_0xb334('0xf'),'set':function(_0x384287){this['setDataValue']('transport',_0x384287?_0x384287['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xb334('0x10')]('transport')[_0xb334('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x13'),_0xb334('0x14'),'shortinfo','inband',_0xb334('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no','nonat',_0xb334('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb334('0x12')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb334('0x2')]},'directmediadeny':{'type':Sequelize[_0xb334('0x2')]},'nat':{'type':Sequelize[_0xb334('0x2')],'defaultValue':_0xb334('0x18'),'set':function(_0x31f49e){this[_0xb334('0x19')](_0xb334('0x1a'),_0x31f49e?_0x31f49e[_0xb334('0x1b')](','):null);},'get':function(){return this[_0xb334('0x10')](_0xb334('0x1a'))?this[_0xb334('0x10')]('nat')['split'](','):null;},'comment':_0xb334('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xb334('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb334('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb334('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb334('0x2')],'defaultValue':_0xb334('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb334('0x1e'),'set':function(_0x307780){this[_0xb334('0x19')]('allow',_0x307780?_0x307780['join'](';'):_0xb334('0x1e'));},'get':function(){return this[_0xb334('0x10')]('allow')?this[_0xb334('0x10')]('allow')[_0xb334('0x11')](';'):null;},'comment':_0xb334('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0xb334('0x16'),'no')},'insecure':{'type':Sequelize[_0xb334('0x2')],'defaultValue':_0xb334('0x20'),'set':function(_0xc493c6){this['setDataValue'](_0xb334('0x21'),_0xc493c6?_0xc493c6[_0xb334('0x1b')](','):null);},'get':function(){return this[_0xb334('0x10')](_0xb334('0x21'))?this[_0xb334('0x10')](_0xb334('0x21'))[_0xb334('0x11')](','):null;},'comment':_0xb334('0x22')},'trustrpid':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xb334('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0xb334('0x12')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0xb334('0x16'),'no')},'accountcode':{'type':Sequelize[_0xb334('0x23')](0xb)},'setvar':{'type':Sequelize[_0xb334('0x2')]},'callerid':{'type':Sequelize[_0xb334('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xb334('0x2')]},'callcounter':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no'),'defaultValue':_0xb334('0x16')},'busylevel':{'type':Sequelize[_0xb334('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xb334('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xb334('0x12')]('yes','no',_0xb334('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb334('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'mailbox':{'type':Sequelize[_0xb334('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xb334('0x25'),_0xb334('0x26'))},'session_expires':{'type':Sequelize[_0xb334('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xb334('0x12')]('uac',_0xb334('0x27')),'defaultValue':_0xb334('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xb334('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xb334('0x2')]},'fromuser':{'type':Sequelize[_0xb334('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xb334('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xb334('0x2')]},'defaultuser':{'type':Sequelize[_0xb334('0x2')]},'rtptimeout':{'type':Sequelize[_0xb334('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb334('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb334('0x2')]},'callbackextension':{'type':Sequelize[_0xb334('0x2')]},'timert1':{'type':Sequelize[_0xb334('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xb334('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xb334('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xb334('0x2')]},'use_q850_reason':{'type':Sequelize[_0xb334('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'force_avp':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no',_0xb334('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xb334('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xb334('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xb334('0x2')]},'dtlscapath':{'type':Sequelize[_0xb334('0x2')]},'dtlssetup':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x29'),_0xb334('0x2a'),_0xb334('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb334('0x2')]},'recordofffeature':{'type':Sequelize[_0xb334('0x2')]},'call_limit':{'type':Sequelize[_0xb334('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xb334('0x12')](_0xb334('0x16'),'no')},'vmexten':{'type':Sequelize[_0xb334('0x2')]},'mohinterpret':{'type':Sequelize[_0xb334('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xb334('0x2')]},'description':{'type':Sequelize[_0xb334('0x2')]},'host':{'type':Sequelize[_0xb334('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xb334('0x12')]('yes','no',_0xb334('0x2c'),'update',_0xb334('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb334('0x2')]},'otherFields':{'type':Sequelize[_0xb334('0x2')]},'active':{'type':Sequelize[_0xb334('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb334('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x7fb3=['yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','update,nonat','name','ENUM','friend','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband'];(function(_0xafcd29,_0x316aa5){var _0x4bb909=function(_0x3a9a55){while(--_0x3a9a55){_0xafcd29['push'](_0xafcd29['shift']());}};_0x4bb909(++_0x316aa5);}(_0x7fb3,0x16d));var _0x37fb=function(_0x2130f1,_0x4dbcba){_0x2130f1=_0x2130f1-0x0;var _0x3e4b16=_0x7fb3[_0x2130f1];return _0x3e4b16;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37fb('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x2'),'user',_0x37fb('0x3')),'allowNull':![],'defaultValue':_0x37fb('0x2')},'context':{'type':Sequelize[_0x37fb('0x4')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x37fb('0x1')]('ALLOWED_NOT_SCREENED',_0x37fb('0x5'),'ALLOWED_FAILED_SCREEN',_0x37fb('0x6'),'PROHIB_NOT_SCREENED',_0x37fb('0x7'),_0x37fb('0x8'),_0x37fb('0x9'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x37fb('0x4')]},'secret':{'type':Sequelize[_0x37fb('0x4')]},'md5secret':{'type':Sequelize[_0x37fb('0x4')]},'remotesecret':{'type':Sequelize[_0x37fb('0x4')]},'transport':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'udp','set':function(_0x1aeee8){this['setDataValue'](_0x37fb('0xa'),_0x1aeee8?_0x1aeee8[_0x37fb('0xb')](','):null);},'get':function(){return this[_0x37fb('0xc')](_0x37fb('0xa'))?this[_0x37fb('0xc')](_0x37fb('0xa'))[_0x37fb('0xd')](','):null;},'comment':_0x37fb('0xe')},'dtmfmode':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0xf'),_0x37fb('0x10'),_0x37fb('0x11'),_0x37fb('0x12'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x14'),_0x37fb('0x15'),_0x37fb('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x37fb('0x4')]},'directmediadeny':{'type':Sequelize[_0x37fb('0x4')]},'nat':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':_0x37fb('0x17'),'set':function(_0x5916a1){this[_0x37fb('0x18')](_0x37fb('0x19'),_0x5916a1?_0x5916a1[_0x37fb('0xb')](','):null);},'get':function(){return this['getDataValue'](_0x37fb('0x19'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0x37fb('0x1a')},'callgroup':{'type':Sequelize[_0x37fb('0x4')]},'namedcallgroup':{'type':Sequelize[_0x37fb('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x37fb('0x4')]},'language':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x1b')},'allow':{'type':Sequelize[_0x37fb('0x4')],'allowNull':![],'defaultValue':_0x37fb('0x1c'),'set':function(_0x3328a4){this[_0x37fb('0x18')](_0x37fb('0x1d'),_0x3328a4?_0x3328a4[_0x37fb('0xb')](';'):_0x37fb('0x1c'));},'get':function(){return this[_0x37fb('0xc')](_0x37fb('0x1d'))?this[_0x37fb('0xc')](_0x37fb('0x1d'))[_0x37fb('0xd')](';'):null;},'comment':_0x37fb('0x1e')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':_0x37fb('0x1f'),'set':function(_0x132130){this['setDataValue'](_0x37fb('0x20'),_0x132130?_0x132130['join'](','):null);},'get':function(){return this[_0x37fb('0xc')](_0x37fb('0x20'))?this[_0x37fb('0xc')](_0x37fb('0x20'))[_0x37fb('0xd')](','):null;},'comment':_0x37fb('0x21')},'trustrpid':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x37fb('0x1')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x37fb('0x1')]('yes','no',_0x37fb('0x22'))},'promiscredir':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x37fb('0x4')]},'callerid':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':_0x37fb('0x23')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x37fb('0x1')]('yes','no'),'defaultValue':_0x37fb('0x13')},'busylevel':{'type':Sequelize[_0x37fb('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x37fb('0x4')]},'template':{'type':Sequelize[_0x37fb('0x4')]},'videosupport':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x37fb('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'mailbox':{'type':Sequelize[_0x37fb('0x4')]},'session_timers':{'type':Sequelize['ENUM'](_0x37fb('0x26'),_0x37fb('0x27'),_0x37fb('0x28'))},'session_expires':{'type':Sequelize[_0x37fb('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x37fb('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x37fb('0x1')]('uac',_0x37fb('0x29')),'defaultValue':_0x37fb('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x37fb('0x4')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x37fb('0x4')]},'port':{'type':Sequelize[_0x37fb('0x24')](0x5)},'qualify':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':_0x37fb('0x13')},'keepalive':{'type':Sequelize[_0x37fb('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x37fb('0x4')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x37fb('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x37fb('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x37fb('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x37fb('0x4')]},'timert1':{'type':Sequelize[_0x37fb('0x24')](0xb)},'timerb':{'type':Sequelize[_0x37fb('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x37fb('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x37fb('0x4')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x37fb('0x4')]},'unsolicited_mailbox':{'type':Sequelize[_0x37fb('0x4')]},'use_q850_reason':{'type':Sequelize[_0x37fb('0x4')]},'maxforwards':{'type':Sequelize[_0x37fb('0x24')](0xb)},'encryption':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'force_avp':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'icesupport':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x2b'),_0x37fb('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x37fb('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x37fb('0x4')]},'dtlsprivatekey':{'type':Sequelize[_0x37fb('0x4')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x37fb('0x4')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x2d'),_0x37fb('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x37fb('0x4')]},'usereqphone':{'type':Sequelize[_0x37fb('0x1')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x37fb('0x4')]},'recordofffeature':{'type':Sequelize[_0x37fb('0x4')]},'call_limit':{'type':Sequelize[_0x37fb('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0x37fb('0x1')]('yes','no')},'vmexten':{'type':Sequelize[_0x37fb('0x4')]},'mohinterpret':{'type':Sequelize[_0x37fb('0x4')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x37fb('0x4')]},'description':{'type':Sequelize[_0x37fb('0x4')]},'host':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x14'),_0x37fb('0x15'),_0x37fb('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x37fb('0x4')]},'otherFields':{'type':Sequelize[_0x37fb('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index d78d168..92ab247 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5e93f3,_0x57e9c3){var _0x183e24=function(_0xd63c52){while(--_0xd63c52){_0x5e93f3['push'](_0x5e93f3['shift']());}};_0x183e24(++_0x57e9c3);}(_0x24ca,0x1bc));var _0xa24c=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x24ca[_0xcfc44];return _0x307a25;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file +var _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x4d5b04,_0x256d30){var _0x2b12d7=function(_0x431c9c){while(--_0x431c9c){_0x4d5b04['push'](_0x4d5b04['shift']());}};_0x2b12d7(++_0x256d30);}(_0xdace,0xc5));var _0xedac=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xdace[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 2083044..a5c9295 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd21=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28f75c,_0x1b218b){var _0x1e3b8a=function(_0x3e1595){while(--_0x3e1595){_0x28f75c['push'](_0x28f75c['shift']());}};_0x1e3b8a(++_0x1b218b);}(_0xfd21,0xbc));var _0x1fd2=function(_0x246050,_0x39b817){_0x246050=_0x246050-0x0;var _0xf31c15=_0xfd21[_0x246050];return _0xf31c15;};'use strict';var _=require('lodash');var util=require(_0x1fd2('0x0'));var logger=require(_0x1fd2('0x1'))(_0x1fd2('0x2'));var moment=require(_0x1fd2('0x3'));var BPromise=require(_0x1fd2('0x4'));var rp=require(_0x1fd2('0x5'));var fs=require('fs');var path=require(_0x1fd2('0x6'));var rimraf=require(_0x1fd2('0x7'));var config=require(_0x1fd2('0x8'));var attributes=require(_0x1fd2('0x9'));module[_0x1fd2('0xa')]=function(_0xec07d9,_0x274b47){return _0xec07d9[_0x1fd2('0xb')](_0x1fd2('0xc'),attributes,{'tableName':_0x1fd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c47=['tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','Trunk'];(function(_0x472cd4,_0x92fd52){var _0x496b32=function(_0xbe3132){while(--_0xbe3132){_0x472cd4['push'](_0x472cd4['shift']());}};_0x496b32(++_0x92fd52);}(_0x1c47,0x7a));var _0x71c4=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x1c47[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require('lodash');var util=require(_0x71c4('0x0'));var logger=require(_0x71c4('0x1'))(_0x71c4('0x2'));var moment=require(_0x71c4('0x3'));var BPromise=require(_0x71c4('0x4'));var rp=require(_0x71c4('0x5'));var fs=require('fs');var path=require(_0x71c4('0x6'));var rimraf=require(_0x71c4('0x7'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module['exports']=function(_0x535299,_0x5ad203){return _0x535299[_0x71c4('0x8')](_0x71c4('0x9'),attributes,{'tableName':_0x71c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 3fd8ce5..44cbefe 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d8d=['Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','where','attributes','limit','include','map','model','GetTrunk','ShowTrunk','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info'];(function(_0x482af3,_0xf39f41){var _0x7cecfb=function(_0x3ec4b6){while(--_0x3ec4b6){_0x482af3['push'](_0x482af3['shift']());}};_0x7cecfb(++_0xf39f41);}(_0x0d8d,0x1f4));var _0xd0d8=function(_0x12b367,_0x137901){_0x12b367=_0x12b367-0x0;var _0x4913fb=_0x0d8d[_0x12b367];return _0x4913fb;};'use strict';var _=require(_0xd0d8('0x0'));var util=require(_0xd0d8('0x1'));var moment=require(_0xd0d8('0x2'));var BPromise=require(_0xd0d8('0x3'));var rs=require(_0xd0d8('0x4'));var fs=require('fs');var Redis=require(_0xd0d8('0x5'));var db=require(_0xd0d8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0d8('0x7'))(_0xd0d8('0x8'));var config=require('../../config/environment');var jayson=require(_0xd0d8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3ebf,_0x3c50a4,_0xf1a31c){return new BPromise(function(_0x3e8c9b,_0x21cb44){return client['request'](_0x5f3ebf,_0xf1a31c)[_0xd0d8('0xa')](function(_0x20798a){logger[_0xd0d8('0xb')](_0xd0d8('0xc'),_0x3c50a4,_0xd0d8('0xd'));logger[_0xd0d8('0xe')](_0xd0d8('0xf'),_0x3c50a4,'request\x20sent',JSON[_0xd0d8('0x10')](_0x20798a));if(_0x20798a[_0xd0d8('0x11')]){if(_0x20798a[_0xd0d8('0x11')][_0xd0d8('0x12')]===0x1f4){logger['error'](_0xd0d8('0xc'),_0x3c50a4,_0x20798a[_0xd0d8('0x11')][_0xd0d8('0x13')]);return _0x21cb44(_0x20798a[_0xd0d8('0x11')][_0xd0d8('0x13')]);}logger['error'](_0xd0d8('0xc'),_0x3c50a4,_0x20798a[_0xd0d8('0x11')]['message']);return _0x3e8c9b(_0x20798a['error'][_0xd0d8('0x13')]);}else{logger[_0xd0d8('0xb')](_0xd0d8('0xc'),_0x3c50a4,_0xd0d8('0xd'));_0x3e8c9b(_0x20798a[_0xd0d8('0x14')]['message']);}})['catch'](function(_0x51f53d){logger['error'](_0xd0d8('0xc'),_0x3c50a4,_0x51f53d);_0x21cb44(_0x51f53d);});});}exports['GetTrunk']=function(_0x4ff357){var _0x55c95a=this;return new Promise(function(_0x385e25,_0x391f2e){return db['Trunk']['findAll']({'raw':_0x4ff357[_0xd0d8('0x15')]?_0x4ff357[_0xd0d8('0x15')][_0xd0d8('0x16')]===undefined?!![]:![]:!![],'where':_0x4ff357[_0xd0d8('0x15')]?_0x4ff357[_0xd0d8('0x15')][_0xd0d8('0x17')]||null:null,'attributes':_0x4ff357['options']?_0x4ff357[_0xd0d8('0x15')][_0xd0d8('0x18')]||null:null,'limit':_0x4ff357[_0xd0d8('0x15')]?_0x4ff357['options'][_0xd0d8('0x19')]||null:null,'include':_0x4ff357['options']?_0x4ff357[_0xd0d8('0x15')][_0xd0d8('0x1a')]?_[_0xd0d8('0x1b')](_0x4ff357[_0xd0d8('0x15')][_0xd0d8('0x1a')],function(_0x18d305){return{'model':db[_0x18d305[_0xd0d8('0x1c')]],'as':_0x18d305['as'],'attributes':_0x18d305[_0xd0d8('0x18')],'include':_0x18d305['include']?_[_0xd0d8('0x1b')](_0x18d305[_0xd0d8('0x1a')],function(_0x377784){return{'model':db[_0x377784[_0xd0d8('0x1c')]],'as':_0x377784['as'],'attributes':_0x377784[_0xd0d8('0x18')],'include':_0x377784[_0xd0d8('0x1a')]?_[_0xd0d8('0x1b')](_0x377784[_0xd0d8('0x1a')],function(_0x53382b){return{'model':db[_0x53382b[_0xd0d8('0x1c')]],'as':_0x53382b['as'],'attributes':_0x53382b[_0xd0d8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd0d8('0xa')](function(_0xca6da3){logger[_0xd0d8('0xb')](_0xd0d8('0x1d'),_0x4ff357);logger[_0xd0d8('0xe')](_0xd0d8('0x1d'),_0x4ff357,JSON[_0xd0d8('0x10')](_0xca6da3));_0x385e25(_0xca6da3);})['catch'](function(_0x5b4d69){logger['error']('GetTrunk',_0x5b4d69[_0xd0d8('0x13')],_0x4ff357);_0x391f2e(_0x55c95a[_0xd0d8('0x11')](0x1f4,_0x5b4d69[_0xd0d8('0x13')]));});});};exports[_0xd0d8('0x1e')]=function(_0x2c4dfb){var _0xca207d=this;return new Promise(function(_0x5aa8e8,_0x6bc7e5){return db['Trunk']['find']({'raw':_0x2c4dfb[_0xd0d8('0x15')]?_0x2c4dfb[_0xd0d8('0x15')][_0xd0d8('0x16')]===undefined?!![]:![]:!![],'where':_0x2c4dfb[_0xd0d8('0x15')]?_0x2c4dfb['options'][_0xd0d8('0x17')]||null:null,'attributes':_0x2c4dfb[_0xd0d8('0x15')]?_0x2c4dfb[_0xd0d8('0x15')][_0xd0d8('0x18')]||null:null,'include':_0x2c4dfb[_0xd0d8('0x15')]?_0x2c4dfb[_0xd0d8('0x15')][_0xd0d8('0x1a')]?_[_0xd0d8('0x1b')](_0x2c4dfb[_0xd0d8('0x15')][_0xd0d8('0x1a')],function(_0x34f08b){return{'model':db[_0x34f08b[_0xd0d8('0x1c')]],'as':_0x34f08b['as'],'attributes':_0x34f08b[_0xd0d8('0x18')],'include':_0x34f08b['include']?_['map'](_0x34f08b[_0xd0d8('0x1a')],function(_0x28b971){return{'model':db[_0x28b971[_0xd0d8('0x1c')]],'as':_0x28b971['as'],'attributes':_0x28b971[_0xd0d8('0x18')],'include':_0x28b971[_0xd0d8('0x1a')]?_[_0xd0d8('0x1b')](_0x28b971['include'],function(_0x1eb658){return{'model':db[_0x1eb658[_0xd0d8('0x1c')]],'as':_0x1eb658['as'],'attributes':_0x1eb658[_0xd0d8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x230ca9){logger[_0xd0d8('0xb')](_0xd0d8('0x1e'),_0x2c4dfb);logger[_0xd0d8('0xe')](_0xd0d8('0x1e'),_0x2c4dfb,JSON[_0xd0d8('0x10')](_0x230ca9));_0x5aa8e8(_0x230ca9);})[_0xd0d8('0x1f')](function(_0x6cb8fc){logger[_0xd0d8('0x11')](_0xd0d8('0x1e'),_0x6cb8fc[_0xd0d8('0x13')],_0x2c4dfb);_0x6bc7e5(_0xca207d[_0xd0d8('0x11')](0x1f4,_0x6cb8fc[_0xd0d8('0x13')]));});});}; \ No newline at end of file +var _0xa304=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','Trunk','options','raw','attributes','limit','include','map','model','GetTrunk','stringify','catch','ShowTrunk','find','where','lodash','util'];(function(_0xff6599,_0x3d75a7){var _0x565d40=function(_0x5f470d){while(--_0x5f470d){_0xff6599['push'](_0xff6599['shift']());}};_0x565d40(++_0x3d75a7);}(_0xa304,0x1e8));var _0x4a30=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0xa304[_0x4ee9cd];return _0x328a5b;};'use strict';var _=require(_0x4a30('0x0'));var util=require(_0x4a30('0x1'));var moment=require('moment');var BPromise=require(_0x4a30('0x2'));var rs=require(_0x4a30('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a30('0x4'))['db'];var utils=require(_0x4a30('0x5'));var logger=require(_0x4a30('0x6'))('rpc');var config=require(_0x4a30('0x7'));var jayson=require(_0x4a30('0x8'));var client=jayson[_0x4a30('0x9')][_0x4a30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522263,_0x110ddb,_0x29535f){return new BPromise(function(_0x30d6f0,_0x2dcf62){return client[_0x4a30('0xb')](_0x522263,_0x29535f)[_0x4a30('0xc')](function(_0x1f0ac9){logger[_0x4a30('0xd')](_0x4a30('0xe'),_0x110ddb,_0x4a30('0xf'));logger[_0x4a30('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x110ddb,_0x4a30('0xf'),JSON['stringify'](_0x1f0ac9));if(_0x1f0ac9[_0x4a30('0x11')]){if(_0x1f0ac9['error'][_0x4a30('0x12')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x110ddb,_0x1f0ac9[_0x4a30('0x11')][_0x4a30('0x13')]);return _0x2dcf62(_0x1f0ac9[_0x4a30('0x11')][_0x4a30('0x13')]);}logger['error'](_0x4a30('0xe'),_0x110ddb,_0x1f0ac9['error'][_0x4a30('0x13')]);return _0x30d6f0(_0x1f0ac9[_0x4a30('0x11')][_0x4a30('0x13')]);}else{logger[_0x4a30('0xd')](_0x4a30('0xe'),_0x110ddb,_0x4a30('0xf'));_0x30d6f0(_0x1f0ac9[_0x4a30('0x14')][_0x4a30('0x13')]);}})['catch'](function(_0x1ad9de){logger['error']('Trunk,\x20%s,\x20%s',_0x110ddb,_0x1ad9de);_0x2dcf62(_0x1ad9de);});});}exports['GetTrunk']=function(_0x19bbcc){var _0xab9de3=this;return new Promise(function(_0x2e6a44,_0x36a59b){return db[_0x4a30('0x15')]['findAll']({'raw':_0x19bbcc['options']?_0x19bbcc[_0x4a30('0x16')][_0x4a30('0x17')]===undefined?!![]:![]:!![],'where':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc['options']['where']||null:null,'attributes':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc[_0x4a30('0x16')][_0x4a30('0x18')]||null:null,'limit':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc['options'][_0x4a30('0x19')]||null:null,'include':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc['options'][_0x4a30('0x1a')]?_[_0x4a30('0x1b')](_0x19bbcc[_0x4a30('0x16')][_0x4a30('0x1a')],function(_0x4bb5d9){return{'model':db[_0x4bb5d9[_0x4a30('0x1c')]],'as':_0x4bb5d9['as'],'attributes':_0x4bb5d9[_0x4a30('0x18')],'include':_0x4bb5d9[_0x4a30('0x1a')]?_[_0x4a30('0x1b')](_0x4bb5d9[_0x4a30('0x1a')],function(_0x1d2cfd){return{'model':db[_0x1d2cfd['model']],'as':_0x1d2cfd['as'],'attributes':_0x1d2cfd[_0x4a30('0x18')],'include':_0x1d2cfd[_0x4a30('0x1a')]?_['map'](_0x1d2cfd[_0x4a30('0x1a')],function(_0x2a838b){return{'model':db[_0x2a838b['model']],'as':_0x2a838b['as'],'attributes':_0x2a838b[_0x4a30('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4a30('0xc')](function(_0x56eb2a){logger[_0x4a30('0xd')]('GetTrunk',_0x19bbcc);logger[_0x4a30('0x10')](_0x4a30('0x1d'),_0x19bbcc,JSON[_0x4a30('0x1e')](_0x56eb2a));_0x2e6a44(_0x56eb2a);})[_0x4a30('0x1f')](function(_0x6697d6){logger[_0x4a30('0x11')](_0x4a30('0x1d'),_0x6697d6[_0x4a30('0x13')],_0x19bbcc);_0x36a59b(_0xab9de3[_0x4a30('0x11')](0x1f4,_0x6697d6[_0x4a30('0x13')]));});});};exports[_0x4a30('0x20')]=function(_0x153d74){var _0x44cd49=this;return new Promise(function(_0x4a2e62,_0x1e4dc5){return db[_0x4a30('0x15')][_0x4a30('0x21')]({'raw':_0x153d74[_0x4a30('0x16')]?_0x153d74['options'][_0x4a30('0x17')]===undefined?!![]:![]:!![],'where':_0x153d74[_0x4a30('0x16')]?_0x153d74[_0x4a30('0x16')][_0x4a30('0x22')]||null:null,'attributes':_0x153d74['options']?_0x153d74[_0x4a30('0x16')][_0x4a30('0x18')]||null:null,'include':_0x153d74['options']?_0x153d74[_0x4a30('0x16')][_0x4a30('0x1a')]?_[_0x4a30('0x1b')](_0x153d74[_0x4a30('0x16')][_0x4a30('0x1a')],function(_0xba5c6f){return{'model':db[_0xba5c6f[_0x4a30('0x1c')]],'as':_0xba5c6f['as'],'attributes':_0xba5c6f[_0x4a30('0x18')],'include':_0xba5c6f['include']?_[_0x4a30('0x1b')](_0xba5c6f['include'],function(_0x3bc30b){return{'model':db[_0x3bc30b[_0x4a30('0x1c')]],'as':_0x3bc30b['as'],'attributes':_0x3bc30b[_0x4a30('0x18')],'include':_0x3bc30b[_0x4a30('0x1a')]?_['map'](_0x3bc30b['include'],function(_0x4fed32){return{'model':db[_0x4fed32[_0x4a30('0x1c')]],'as':_0x4fed32['as'],'attributes':_0x4fed32[_0x4a30('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a01f9){logger['info']('ShowTrunk',_0x153d74);logger[_0x4a30('0x10')](_0x4a30('0x20'),_0x153d74,JSON['stringify'](_0x3a01f9));_0x4a2e62(_0x3a01f9);})[_0x4a30('0x1f')](function(_0xc84d45){logger['error'](_0x4a30('0x20'),_0xc84d45[_0x4a30('0x13')],_0x153d74);_0x1e4dc5(_0x44cd49['error'](0x1f4,_0xc84d45[_0x4a30('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index eafa489..40df49a 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8456=['update','exports','express','Router','../../components/auth/service','/:id','isAuthenticated'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x8456,0x13d));var _0x6845=function(_0x377bfb,_0x40a6b8){_0x377bfb=_0x377bfb-0x0;var _0x4bb900=_0x8456[_0x377bfb];return _0x4bb900;};'use strict';var express=require(_0x6845('0x0'));var router=express[_0x6845('0x1')]();var auth=require(_0x6845('0x2'));var controller=require('./user-setting.controller');router['put'](_0x6845('0x3'),auth[_0x6845('0x4')](),controller[_0x6845('0x5')]);module[_0x6845('0x6')]=router; \ No newline at end of file +var _0x6cd4=['/:id','isAuthenticated','update','exports'];(function(_0x4cac21,_0x5ed66e){var _0x49e5f0=function(_0x407902){while(--_0x407902){_0x4cac21['push'](_0x4cac21['shift']());}};_0x49e5f0(++_0x5ed66e);}(_0x6cd4,0x1c4));var _0x46cd=function(_0x5461c5,_0x3e0848){_0x5461c5=_0x5461c5-0x0;var _0x13b12f=_0x6cd4[_0x5461c5];return _0x13b12f;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router['put'](_0x46cd('0x0'),auth[_0x46cd('0x1')](),controller[_0x46cd('0x2')]);module[_0x46cd('0x3')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 3f108c4..99b46d7 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd094=['sequelize','error','warning','info','ENUM','BOOLEAN','DATE'];(function(_0x561950,_0x3b4b29){var _0x4d0631=function(_0x345ebe){while(--_0x345ebe){_0x561950['push'](_0x561950['shift']());}};_0x4d0631(++_0x3b4b29);}(_0xd094,0x142));var _0x4d09=function(_0x498468,_0x4c3715){_0x498468=_0x498468-0x0;var _0x61ba70=_0xd094[_0x498468];return _0x61ba70;};'use strict';var Sequelize=require(_0x4d09('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4d09('0x1'),_0x4d09('0x2'),_0x4d09('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x4d09('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4d09('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4d09('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x4d09('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0xfbc3=['TEXT','DATE','sequelize','warning','info','debug','exports','ENUM','error','BOOLEAN'];(function(_0x3bad58,_0x45d5db){var _0xd5d092=function(_0x382664){while(--_0x382664){_0x3bad58['push'](_0x3bad58['shift']());}};_0xd5d092(++_0x45d5db);}(_0xfbc3,0x1e2));var _0x3fbc=function(_0x53fa9c,_0x398322){_0x53fa9c=_0x53fa9c-0x0;var _0x440439=_0xfbc3[_0x53fa9c];return _0x440439;};'use strict';var Sequelize=require(_0x3fbc('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x3fbc('0x1'),_0x3fbc('0x2'),_0x3fbc('0x3')];module[_0x3fbc('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3fbc('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3fbc('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3fbc('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3fbc('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3fbc('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 0d31a53..7e71abc 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['Invalid\x20user\x20setting\x20id','UserSetting','find','body','ioredis','api','../../config/environment','../../mysqldb','./user-setting.socket','register','redis','defaults','localhost','status','then','sendStatus','error','send','update','user','role','admin','Unauthorized','params'];(function(_0x14e5c2,_0x5766dd){var _0x4f6d55=function(_0x17d6e0){while(--_0x17d6e0){_0x14e5c2['push'](_0x14e5c2['shift']());}};_0x4f6d55(++_0x5766dd);}(_0x9f62,0x154));var _0x29f6=function(_0x5dd170,_0x33018e){_0x5dd170=_0x5dd170-0x0;var _0x5f58b6=_0x9f62[_0x5dd170];return _0x5f58b6;};'use strict';var _=require('lodash');var Redis=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var config=require(_0x29f6('0x2'));var db=require(_0x29f6('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x29f6('0x4'))[_0x29f6('0x5')](socket);config[_0x29f6('0x6')]=_[_0x29f6('0x7')](config['redis'],{'host':_0x29f6('0x8'),'port':0x18eb});function respondWithResult(_0x272876,_0x9a43fe){_0x9a43fe=_0x9a43fe||0xc8;return function(_0x2ba602){if(_0x2ba602){return _0x272876[_0x29f6('0x9')](_0x9a43fe)['json'](_0x2ba602);}};}function saveUpdates(_0x5ec7aa){return function(_0x5f43bb){if(_0x5f43bb){return _0x5f43bb['update'](_0x5ec7aa)[_0x29f6('0xa')](function(_0x44db16){return _0x44db16;});}return null;};}function handleEntityNotFound(_0x4fb455){return function(_0x5a0724){if(!_0x5a0724){_0x4fb455[_0x29f6('0xb')](0x194);}return _0x5a0724;};}function handleError(_0x442623,_0x4909e0){_0x4909e0=_0x4909e0||0x1f4;return function(_0x17b69c){logger[_0x29f6('0xc')](_0x17b69c['stack']);if(_0x17b69c['name']){delete _0x17b69c['name'];}_0x442623['status'](_0x4909e0)[_0x29f6('0xd')](_0x17b69c);};}exports[_0x29f6('0xe')]=function(_0x189344,_0x11a1fd){if(_0x189344[_0x29f6('0xf')][_0x29f6('0x10')]!==_0x29f6('0x11'))throw new Error(_0x29f6('0x12'));if(isNaN(Number(_0x189344[_0x29f6('0x13')]['id'])))throw new Error(_0x29f6('0x14'));return db[_0x29f6('0x15')][_0x29f6('0x16')]({'where':{'id':_0x189344[_0x29f6('0x13')]['id']}})[_0x29f6('0xa')](handleEntityNotFound(_0x11a1fd,null))[_0x29f6('0xa')](saveUpdates(_0x189344[_0x29f6('0x17')],null))[_0x29f6('0xa')](respondWithResult(_0x11a1fd,null))['catch'](handleError(_0x11a1fd,null));}; \ No newline at end of file +var _0xbd50=['params','UserSetting','find','then','body','catch','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','localhost','update','sendStatus','error','stack','name','status','send','user','role','Unauthorized'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x334ba9,_0x35409f){_0x334ba9=_0x334ba9-0x0;var _0x28361a=_0xbd50[_0x334ba9];return _0x28361a;};'use strict';var _=require(_0x0bd5('0x0'));var Redis=require(_0x0bd5('0x1'));var logger=require(_0x0bd5('0x2'))('api');var config=require(_0x0bd5('0x3'));var db=require(_0x0bd5('0x4'))['db'];var socket=require(_0x0bd5('0x5'))(new Redis(config[_0x0bd5('0x6')]));require(_0x0bd5('0x7'))['register'](socket);config['redis']=_['defaults'](config[_0x0bd5('0x6')],{'host':_0x0bd5('0x8'),'port':0x18eb});function respondWithResult(_0xcc6cfa,_0x2c0db1){_0x2c0db1=_0x2c0db1||0xc8;return function(_0x1b99f3){if(_0x1b99f3){return _0xcc6cfa['status'](_0x2c0db1)['json'](_0x1b99f3);}};}function saveUpdates(_0x1a5cb9){return function(_0x25e31e){if(_0x25e31e){return _0x25e31e[_0x0bd5('0x9')](_0x1a5cb9)['then'](function(_0xa98f54){return _0xa98f54;});}return null;};}function handleEntityNotFound(_0x2fa7d1){return function(_0x519bc6){if(!_0x519bc6){_0x2fa7d1[_0x0bd5('0xa')](0x194);}return _0x519bc6;};}function handleError(_0x7db86e,_0x4d7d17){_0x4d7d17=_0x4d7d17||0x1f4;return function(_0x1ce7dd){logger[_0x0bd5('0xb')](_0x1ce7dd[_0x0bd5('0xc')]);if(_0x1ce7dd['name']){delete _0x1ce7dd[_0x0bd5('0xd')];}_0x7db86e[_0x0bd5('0xe')](_0x4d7d17)[_0x0bd5('0xf')](_0x1ce7dd);};}exports[_0x0bd5('0x9')]=function(_0xfa1eed,_0x557be0){if(_0xfa1eed[_0x0bd5('0x10')][_0x0bd5('0x11')]!=='admin')throw new Error(_0x0bd5('0x12'));if(isNaN(Number(_0xfa1eed[_0x0bd5('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x0bd5('0x14')][_0x0bd5('0x15')]({'where':{'id':_0xfa1eed[_0x0bd5('0x13')]['id']}})[_0x0bd5('0x16')](handleEntityNotFound(_0x557be0,null))['then'](saveUpdates(_0xfa1eed[_0x0bd5('0x17')],null))[_0x0bd5('0x16')](respondWithResult(_0x557be0,null))[_0x0bd5('0x18')](handleError(_0x557be0,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 58d4d67..dab6179 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc312=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserSetting'];(function(_0x1e947f,_0x59c3c0){var _0x31cd93=function(_0x2dee8b){while(--_0x2dee8b){_0x1e947f['push'](_0x1e947f['shift']());}};_0x31cd93(++_0x59c3c0);}(_0xc312,0x1e4));var _0x2c31=function(_0x2e53ae,_0xebda49){_0x2e53ae=_0x2e53ae-0x0;var _0x4dffb5=_0xc312[_0x2e53ae];return _0x4dffb5;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x2c31('0x0'))['db'][_0x2c31('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x2c31('0x2')](0x0);var events={'afterCreate':_0x2c31('0x3'),'afterUpdate':'update','afterDestroy':_0x2c31('0x4')};function emitEvent(_0x3f1f7e){return function(_0x5cff45,_0x40a5db,_0x2e99b0){UserSettingEvents['emit'](_0x3f1f7e+':'+_0x5cff45['id'],_0x5cff45);UserSettingEvents[_0x2c31('0x5')](_0x3f1f7e,_0x5cff45);_0x2e99b0(null);};}for(var e in events){if(events[_0x2c31('0x6')](e)){var event=events[e];UserSetting[_0x2c31('0x7')](e,emitEvent(event));}}module[_0x2c31('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x2023=['../../mysqldb','UserSetting','setMaxListeners','emit','hook'];(function(_0x208b1e,_0x5f4a61){var _0x574ff7=function(_0x2aa302){while(--_0x2aa302){_0x208b1e['push'](_0x208b1e['shift']());}};_0x574ff7(++_0x5f4a61);}(_0x2023,0x186));var _0x3202=function(_0x2926f1,_0x49f145){_0x2926f1=_0x2926f1-0x0;var _0xad4f2f=_0x2023[_0x2926f1];return _0xad4f2f;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x3202('0x0'))['db'][_0x3202('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x3202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3859ad){return function(_0x2cc9a3,_0x30e5b6,_0x2f39d2){UserSettingEvents[_0x3202('0x3')](_0x3859ad+':'+_0x2cc9a3['id'],_0x2cc9a3);UserSettingEvents[_0x3202('0x3')](_0x3859ad,_0x2cc9a3);_0x2f39d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x3202('0x4')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index e1ab0c0..f007729 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1beb=['./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x22f862,_0x379b50){var _0x20b9bc=function(_0x5b10c5){while(--_0x5b10c5){_0x22f862['push'](_0x22f862['shift']());}};_0x20b9bc(++_0x379b50);}(_0x1beb,0x165));var _0xb1be=function(_0x1d0213,_0x545dff){_0x1d0213=_0x1d0213-0x0;var _0x1726b5=_0x1beb[_0x1d0213];return _0x1726b5;};'use strict';var attributes=require(_0xb1be('0x0'));module[_0xb1be('0x1')]=function(_0x56672f){return _0x56672f[_0xb1be('0x2')](_0xb1be('0x3'),attributes,{'tableName':_0xb1be('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55259c){if(!_0x55259c[_0xb1be('0x5')])_0x55259c[_0xb1be('0x6')]=null;else if(_0x55259c['clientSideLoggingEnabledSince']===null)_0x55259c[_0xb1be('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x373d=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting','user_settings'];(function(_0x10a2ea,_0x487cf2){var _0x347b66=function(_0x592edb){while(--_0x592edb){_0x10a2ea['push'](_0x10a2ea['shift']());}};_0x347b66(++_0x487cf2);}(_0x373d,0x1e2));var _0xd373=function(_0x30ed7d,_0x238acb){_0x30ed7d=_0x30ed7d-0x0;var _0x50e1fb=_0x373d[_0x30ed7d];return _0x50e1fb;};'use strict';var attributes=require(_0xd373('0x0'));module['exports']=function(_0x3d3d31){return _0x3d3d31[_0xd373('0x1')](_0xd373('0x2'),attributes,{'tableName':_0xd373('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50ed19){if(!_0x50ed19[_0xd373('0x4')])_0x50ed19[_0xd373('0x5')]=null;else if(_0x50ed19[_0xd373('0x5')]===null)_0x50ed19['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index f2ac3f3..0b31294 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35cd=['user-setting:','./user-setting.events','remove','user-setting:update','emit','user-setting:update:user-','UserId','length'];(function(_0x328ab0,_0x3c9cf9){var _0x3f5954=function(_0x39e1b4){while(--_0x39e1b4){_0x328ab0['push'](_0x328ab0['shift']());}};_0x3f5954(++_0x3c9cf9);}(_0x35cd,0x199));var _0xd35c=function(_0x45682b,_0x22ef44){_0x45682b=_0x45682b-0x0;var _0x28c3cd=_0x35cd[_0x45682b];return _0x28c3cd;};'use strict';var UserSettingEvents=require(_0xd35c('0x0'));var events=['save',_0xd35c('0x1'),'update'];function createListener(_0x3ddd5f,_0x539eca){return function(_0x33c08e){_0x539eca['emit'](_0x3ddd5f,_0x33c08e);if(_0x3ddd5f===_0xd35c('0x2')){_0x539eca[_0xd35c('0x3')](_0xd35c('0x4')+_0x33c08e[_0xd35c('0x5')],_0x33c08e);}};}exports['register']=function(_0x20f6fd){for(var _0x316e0a=0x0,_0x30517c=events[_0xd35c('0x6')];_0x316e0a<_0x30517c;_0x316e0a++){var _0x32b67a=events[_0x316e0a];var _0x2b6b20=createListener(_0xd35c('0x7')+_0x32b67a,_0x20f6fd);UserSettingEvents['on'](_0x32b67a,_0x2b6b20);}}; \ No newline at end of file +var _0x4a6e=['register','length','user-setting:','./user-setting.events','save','remove','emit','user-setting:update:user-','UserId'];(function(_0x1e937c,_0x11f03e){var _0x3b5971=function(_0x3fdb21){while(--_0x3fdb21){_0x1e937c['push'](_0x1e937c['shift']());}};_0x3b5971(++_0x11f03e);}(_0x4a6e,0x11a));var _0xe4a6=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4a6e[_0x4e9628];return _0x27bc8c;};'use strict';var UserSettingEvents=require(_0xe4a6('0x0'));var events=[_0xe4a6('0x1'),_0xe4a6('0x2'),'update'];function createListener(_0x252037,_0x456731){return function(_0x20e40d){_0x456731[_0xe4a6('0x3')](_0x252037,_0x20e40d);if(_0x252037==='user-setting:update'){_0x456731[_0xe4a6('0x3')](_0xe4a6('0x4')+_0x20e40d[_0xe4a6('0x5')],_0x20e40d);}};}exports[_0xe4a6('0x6')]=function(_0x237cda){for(var _0x38a79a=0x0,_0x1025da=events[_0xe4a6('0x7')];_0x38a79a<_0x1025da;_0x38a79a++){var _0x46b5c0=events[_0x38a79a];var _0x5d96c1=createListener(_0xe4a6('0x8')+_0x46b5c0,_0x237cda);UserSettingEvents['on'](_0x46b5c0,_0x5d96c1);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index bbbbbe3..5fd7f17 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1364=['getContacts','getQueues','/:id/queues_rt','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','now','single','file','addAvatar','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','/:id/mail_interactions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/whoami','whoami','getPresence','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts'];(function(_0x44d32f,_0x50898d){var _0x1fa392=function(_0x22b51e){while(--_0x22b51e){_0x44d32f['push'](_0x44d32f['shift']());}};_0x1fa392(++_0x50898d);}(_0x1364,0x1eb));var _0x4136=function(_0x3acf5e,_0x145883){_0x3acf5e=_0x3acf5e-0x0;var _0x23c14f=_0x1364[_0x3acf5e];return _0x23c14f;};'use strict';var multer=require(_0x4136('0x0'));var util=require('util');var path=require(_0x4136('0x1'));var timeout=require(_0x4136('0x2'));var express=require('express');var router=express[_0x4136('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4136('0x4'));var interaction=require(_0x4136('0x5'));var config=require(_0x4136('0x6'));var controller=require('./user.controller');router['get']('/',auth[_0x4136('0x7')](),controller['index']);router[_0x4136('0x8')](_0x4136('0x9'),auth[_0x4136('0x7')](),controller[_0x4136('0xa')]);router[_0x4136('0x8')](_0x4136('0xb'),auth['isAuthenticated'](),controller[_0x4136('0xc')]);router[_0x4136('0x8')]('/presence',auth[_0x4136('0x7')](),controller[_0x4136('0xd')]);router[_0x4136('0x8')](_0x4136('0xe'),auth[_0x4136('0x7')](),controller['show']);router[_0x4136('0x8')](_0x4136('0xf'),controller['getAvatar']);router['get'](_0x4136('0x10'),auth[_0x4136('0x7')](),controller[_0x4136('0x11')]);router['get'](_0x4136('0x12'),auth[_0x4136('0x7')](),controller[_0x4136('0x13')]);router[_0x4136('0x8')]('/:id/queues',auth[_0x4136('0x7')](),controller[_0x4136('0x14')]);router[_0x4136('0x8')](_0x4136('0x15'),auth[_0x4136('0x7')](),controller['getVoiceQueuesRt']);router[_0x4136('0x8')]('/:id/groups',auth['isAuthenticated'](),controller[_0x4136('0x16')]);router[_0x4136('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x4136('0x8')](_0x4136('0x17'),auth['isAuthenticated'](),controller[_0x4136('0x18')]);router[_0x4136('0x8')](_0x4136('0x19'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x4136('0x8')]('/:id/openchannel/interactions',auth[_0x4136('0x7')](),controller[_0x4136('0x1a')]);router['get'](_0x4136('0x1b'),auth[_0x4136('0x7')](),controller['getMailInteractions']);router[_0x4136('0x8')](_0x4136('0x1c'),auth[_0x4136('0x7')](),controller[_0x4136('0x1d')]);router[_0x4136('0x8')](_0x4136('0x1e'),auth[_0x4136('0x7')](),controller[_0x4136('0x1f')]);router[_0x4136('0x8')]('/:id/whatsapp/interactions',auth[_0x4136('0x7')](),controller['getWhatsappInteractions']);router[_0x4136('0x8')](_0x4136('0x20'),auth['isAuthenticated'](),controller[_0x4136('0x21')]);router[_0x4136('0x8')]('/:id/lists',auth[_0x4136('0x7')](),controller['getLists']);router[_0x4136('0x8')]('/:id/agents',auth[_0x4136('0x7')](),controller[_0x4136('0x22')]);router['get'](_0x4136('0x23'),auth[_0x4136('0x7')](),controller[_0x4136('0x24')]);router[_0x4136('0x8')]('/:id/fax_accounts',auth[_0x4136('0x7')](),controller[_0x4136('0x25')]);router['get'](_0x4136('0x26'),auth['isAuthenticated'](),controller[_0x4136('0x27')]);router[_0x4136('0x8')](_0x4136('0x28'),auth[_0x4136('0x7')](),controller[_0x4136('0x29')]);router['get'](_0x4136('0x2a'),auth[_0x4136('0x7')](),controller[_0x4136('0x2b')]);router[_0x4136('0x8')](_0x4136('0x2c'),auth[_0x4136('0x7')](),controller[_0x4136('0x2d')]);router[_0x4136('0x8')](_0x4136('0x2e'),auth[_0x4136('0x7')](),controller['getWhatsappAccounts']);router[_0x4136('0x8')](_0x4136('0x2f'),auth[_0x4136('0x7')](),controller[_0x4136('0x30')]);router[_0x4136('0x8')](_0x4136('0x31'),auth[_0x4136('0x7')](),controller[_0x4136('0x32')]);router[_0x4136('0x33')](_0x4136('0x12'),auth[_0x4136('0x7')](),controller['addContacts']);router[_0x4136('0x33')]('/',auth[_0x4136('0x7')](),controller[_0x4136('0x34')]);router[_0x4136('0x33')]('/create_many',auth[_0x4136('0x7')](),controller[_0x4136('0x35')]);router[_0x4136('0x33')](_0x4136('0x36'),auth[_0x4136('0x7')](),controller[_0x4136('0x37')]);var upload=multer({'storage':multer[_0x4136('0x38')]({'destination':function(_0x34f52e,_0x2c8e66,_0x452f10){_0x452f10(null,path[_0x4136('0x39')](config[_0x4136('0x3a')],_0x4136('0x3b')));},'filename':function(_0x267195,_0xfc28aa,_0x584531){_0x584531(null,util[_0x4136('0x3c')]('%s-%s',Date[_0x4136('0x3d')](),_0xfc28aa['originalname']));}})});router[_0x4136('0x33')](_0x4136('0xf'),upload[_0x4136('0x3e')](_0x4136('0x3f')),controller[_0x4136('0x40')]);router[_0x4136('0x33')]('/:id/login',auth[_0x4136('0x7')](),controller['login']);router[_0x4136('0x33')]('/:id/logout',auth[_0x4136('0x7')](),controller['logout']);router[_0x4136('0x33')](_0x4136('0x41'),auth[_0x4136('0x7')](),controller[_0x4136('0x42')]);router[_0x4136('0x33')](_0x4136('0x43'),auth['isAuthenticated'](),controller['unpause']);router[_0x4136('0x33')](_0x4136('0x20'),auth[_0x4136('0x7')](),controller[_0x4136('0x44')]);router[_0x4136('0x33')](_0x4136('0x45'),auth[_0x4136('0x7')](),controller[_0x4136('0x46')]);router[_0x4136('0x33')]('/:id/mail_interactions',auth[_0x4136('0x7')](),controller['addMailInteractions']);router[_0x4136('0x33')]('/:id/fax_interactions',auth[_0x4136('0x7')](),controller['addFaxInteractions']);router[_0x4136('0x33')](_0x4136('0x47'),auth[_0x4136('0x7')](),controller['addSmsInteractions']);router['post'](_0x4136('0x48'),auth[_0x4136('0x7')](),controller[_0x4136('0x49')]);router[_0x4136('0x33')](_0x4136('0x4a'),auth[_0x4136('0x7')](),controller[_0x4136('0x4b')]);router[_0x4136('0x33')](_0x4136('0x4c'),auth[_0x4136('0x7')](),controller[_0x4136('0x4d')]);router['post'](_0x4136('0x26'),auth['isAuthenticated'](),controller[_0x4136('0x4e')]);router[_0x4136('0x33')](_0x4136('0x28'),auth[_0x4136('0x7')](),controller[_0x4136('0x4f')]);router[_0x4136('0x33')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x4136('0x50')]);router[_0x4136('0x33')](_0x4136('0x2c'),auth[_0x4136('0x7')](),controller[_0x4136('0x51')]);router[_0x4136('0x33')](_0x4136('0x2e'),auth[_0x4136('0x7')](),controller[_0x4136('0x52')]);router[_0x4136('0x33')]('/:id/api_key',auth[_0x4136('0x7')](),controller[_0x4136('0x53')]);router[_0x4136('0x54')](_0x4136('0xe'),auth[_0x4136('0x7')](),controller[_0x4136('0x55')]);router[_0x4136('0x54')](_0x4136('0x56'),auth['isAuthenticated'](),controller[_0x4136('0x57')]);router[_0x4136('0x58')]('/:id/queues',auth[_0x4136('0x7')](),controller[_0x4136('0x59')]);router[_0x4136('0x58')](_0x4136('0x20'),auth[_0x4136('0x7')](),controller['removeTeams']);router[_0x4136('0x58')](_0x4136('0xe'),auth['isAuthenticated'](),controller[_0x4136('0x5a')]);router[_0x4136('0x58')](_0x4136('0x45'),auth[_0x4136('0x7')](),controller['removeChatInteractions']);router[_0x4136('0x58')](_0x4136('0x5b'),auth[_0x4136('0x7')](),controller['removeMailInteractions']);router['delete'](_0x4136('0x5c'),auth[_0x4136('0x7')](),controller['removeFaxInteractions']);router['delete'](_0x4136('0x47'),auth[_0x4136('0x7')](),controller[_0x4136('0x5d')]);router[_0x4136('0x58')](_0x4136('0x48'),auth[_0x4136('0x7')](),controller[_0x4136('0x5e')]);router[_0x4136('0x58')](_0x4136('0x4a'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x4136('0x58')](_0x4136('0x4c'),auth['isAuthenticated'](),controller[_0x4136('0x5f')]);router[_0x4136('0x58')](_0x4136('0x26'),auth['isAuthenticated'](),controller[_0x4136('0x60')]);router['delete'](_0x4136('0x28'),auth[_0x4136('0x7')](),controller[_0x4136('0x61')]);router['delete'](_0x4136('0x2a'),auth[_0x4136('0x7')](),controller[_0x4136('0x62')]);router[_0x4136('0x58')](_0x4136('0x2c'),auth['isAuthenticated'](),controller[_0x4136('0x63')]);router[_0x4136('0x58')]('/:id/whatsapp_accounts',auth[_0x4136('0x7')](),controller['removeWhatsappAccounts']);router['delete'](_0x4136('0x31'),auth[_0x4136('0x7')](),controller[_0x4136('0x64')]);module[_0x4136('0x65')]=router; \ No newline at end of file +var _0x8192=['removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','%s-%s','now','single','file','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x8192,0x82));var _0x2819=function(_0x3f6099,_0x47acf5){_0x3f6099=_0x3f6099-0x0;var _0x2fb1a5=_0x8192[_0x3f6099];return _0x2fb1a5;};'use strict';var multer=require(_0x2819('0x0'));var util=require(_0x2819('0x1'));var path=require(_0x2819('0x2'));var timeout=require(_0x2819('0x3'));var express=require(_0x2819('0x4'));var router=express['Router']();var fs_extra=require(_0x2819('0x5'));var auth=require(_0x2819('0x6'));var interaction=require(_0x2819('0x7'));var config=require(_0x2819('0x8'));var controller=require(_0x2819('0x9'));router[_0x2819('0xa')]('/',auth[_0x2819('0xb')](),controller[_0x2819('0xc')]);router['get'](_0x2819('0xd'),auth[_0x2819('0xb')](),controller[_0x2819('0xe')]);router['get']('/whoami',auth[_0x2819('0xb')](),controller[_0x2819('0xf')]);router[_0x2819('0xa')](_0x2819('0x10'),auth[_0x2819('0xb')](),controller[_0x2819('0x11')]);router[_0x2819('0xa')](_0x2819('0x12'),auth[_0x2819('0xb')](),controller[_0x2819('0x13')]);router[_0x2819('0xa')](_0x2819('0x14'),controller[_0x2819('0x15')]);router[_0x2819('0xa')](_0x2819('0x16'),auth[_0x2819('0xb')](),controller['getOpenTabs']);router[_0x2819('0xa')](_0x2819('0x17'),auth[_0x2819('0xb')](),controller[_0x2819('0x18')]);router['get'](_0x2819('0x19'),auth[_0x2819('0xb')](),controller[_0x2819('0x1a')]);router['get'](_0x2819('0x1b'),auth['isAuthenticated'](),controller[_0x2819('0x1c')]);router[_0x2819('0xa')](_0x2819('0x1d'),auth[_0x2819('0xb')](),controller[_0x2819('0x1e')]);router[_0x2819('0xa')](_0x2819('0x1f'),auth[_0x2819('0xb')](),controller[_0x2819('0x20')]);router[_0x2819('0xa')](_0x2819('0x21'),auth[_0x2819('0xb')](),controller[_0x2819('0x22')]);router[_0x2819('0xa')](_0x2819('0x23'),auth[_0x2819('0xb')](),controller[_0x2819('0x24')]);router['get'](_0x2819('0x25'),auth[_0x2819('0xb')](),controller[_0x2819('0x26')]);router[_0x2819('0xa')]('/:id/mail/interactions',auth[_0x2819('0xb')](),controller['getMailInteractions']);router[_0x2819('0xa')](_0x2819('0x27'),auth[_0x2819('0xb')](),controller[_0x2819('0x28')]);router[_0x2819('0xa')](_0x2819('0x29'),auth[_0x2819('0xb')](),controller['getFaxInteractions']);router['get'](_0x2819('0x2a'),auth[_0x2819('0xb')](),controller[_0x2819('0x2b')]);router[_0x2819('0xa')](_0x2819('0x2c'),auth['isAuthenticated'](),controller[_0x2819('0x2d')]);router[_0x2819('0xa')](_0x2819('0x2e'),auth[_0x2819('0xb')](),controller[_0x2819('0x2f')]);router['get'](_0x2819('0x30'),auth['isAuthenticated'](),controller[_0x2819('0x31')]);router[_0x2819('0xa')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x2819('0x32')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x2819('0xa')]('/:id/mail_accounts',auth[_0x2819('0xb')](),controller[_0x2819('0x33')]);router[_0x2819('0xa')](_0x2819('0x34'),auth[_0x2819('0xb')](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0x2819('0xb')](),controller[_0x2819('0x35')]);router[_0x2819('0xa')](_0x2819('0x36'),auth[_0x2819('0xb')](),controller[_0x2819('0x37')]);router['get'](_0x2819('0x38'),auth[_0x2819('0xb')](),controller[_0x2819('0x39')]);router[_0x2819('0xa')]('/:id/scheduled_calls',auth[_0x2819('0xb')](),controller[_0x2819('0x3a')]);router[_0x2819('0xa')](_0x2819('0x3b'),auth[_0x2819('0xb')](),controller[_0x2819('0x3c')]);router[_0x2819('0x3d')](_0x2819('0x17'),auth['isAuthenticated'](),controller[_0x2819('0x3e')]);router[_0x2819('0x3d')]('/',auth[_0x2819('0xb')](),controller['create']);router[_0x2819('0x3d')](_0x2819('0x3f'),auth[_0x2819('0xb')](),controller[_0x2819('0x40')]);router[_0x2819('0x3d')](_0x2819('0x19'),auth[_0x2819('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x2819('0x41')]({'destination':function(_0x30f19f,_0x4af7b4,_0x11fabd){_0x11fabd(null,path[_0x2819('0x42')](config[_0x2819('0x43')],_0x2819('0x44')));},'filename':function(_0xd1917c,_0x33feb7,_0x239fd4){_0x239fd4(null,util['format'](_0x2819('0x45'),Date[_0x2819('0x46')](),_0x33feb7['originalname']));}})});router[_0x2819('0x3d')]('/:id/avatar',upload[_0x2819('0x47')](_0x2819('0x48')),controller[_0x2819('0x49')]);router[_0x2819('0x3d')](_0x2819('0x4a'),auth['isAuthenticated'](),controller['login']);router[_0x2819('0x3d')](_0x2819('0x4b'),auth[_0x2819('0xb')](),controller['logout']);router[_0x2819('0x3d')](_0x2819('0x4c'),auth[_0x2819('0xb')](),controller[_0x2819('0x4d')]);router['post'](_0x2819('0x4e'),auth[_0x2819('0xb')](),controller[_0x2819('0x4f')]);router[_0x2819('0x3d')](_0x2819('0x2c'),auth[_0x2819('0xb')](),controller[_0x2819('0x50')]);router[_0x2819('0x3d')](_0x2819('0x51'),auth[_0x2819('0xb')](),controller[_0x2819('0x52')]);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x2819('0x53')]);router[_0x2819('0x3d')](_0x2819('0x54'),auth[_0x2819('0xb')](),controller[_0x2819('0x55')]);router['post']('/:id/sms_interactions',auth[_0x2819('0xb')](),controller[_0x2819('0x56')]);router['post'](_0x2819('0x57'),auth[_0x2819('0xb')](),controller[_0x2819('0x58')]);router[_0x2819('0x3d')](_0x2819('0x59'),auth[_0x2819('0xb')](),controller[_0x2819('0x5a')]);router[_0x2819('0x3d')](_0x2819('0x5b'),auth[_0x2819('0xb')](),controller[_0x2819('0x5c')]);router[_0x2819('0x3d')](_0x2819('0x5d'),auth['isAuthenticated'](),controller[_0x2819('0x5e')]);router[_0x2819('0x3d')](_0x2819('0x34'),auth[_0x2819('0xb')](),controller[_0x2819('0x5f')]);router[_0x2819('0x3d')](_0x2819('0x60'),auth[_0x2819('0xb')](),controller[_0x2819('0x61')]);router['post'](_0x2819('0x36'),auth[_0x2819('0xb')](),controller['addChatWebsites']);router['post'](_0x2819('0x38'),auth[_0x2819('0xb')](),controller[_0x2819('0x62')]);router[_0x2819('0x3d')]('/:id/api_key',auth[_0x2819('0xb')](),controller[_0x2819('0x63')]);router['put']('/:id',auth[_0x2819('0xb')](),controller['update']);router[_0x2819('0x64')](_0x2819('0x65'),auth[_0x2819('0xb')](),controller[_0x2819('0x66')]);router[_0x2819('0x67')]('/:id/queues',auth[_0x2819('0xb')](),controller[_0x2819('0x68')]);router['delete'](_0x2819('0x2c'),auth[_0x2819('0xb')](),controller['removeTeams']);router[_0x2819('0x67')](_0x2819('0x12'),auth[_0x2819('0xb')](),controller['destroy']);router[_0x2819('0x67')]('/:id/chat_interactions',auth[_0x2819('0xb')](),controller[_0x2819('0x69')]);router[_0x2819('0x67')](_0x2819('0x6a'),auth[_0x2819('0xb')](),controller[_0x2819('0x6b')]);router[_0x2819('0x67')](_0x2819('0x54'),auth[_0x2819('0xb')](),controller[_0x2819('0x6c')]);router[_0x2819('0x67')](_0x2819('0x6d'),auth['isAuthenticated'](),controller[_0x2819('0x6e')]);router[_0x2819('0x67')](_0x2819('0x57'),auth[_0x2819('0xb')](),controller[_0x2819('0x6f')]);router[_0x2819('0x67')](_0x2819('0x59'),auth[_0x2819('0xb')](),controller[_0x2819('0x70')]);router[_0x2819('0x67')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2819('0x71')]);router[_0x2819('0x67')](_0x2819('0x5d'),auth[_0x2819('0xb')](),controller[_0x2819('0x72')]);router[_0x2819('0x67')](_0x2819('0x34'),auth[_0x2819('0xb')](),controller[_0x2819('0x73')]);router[_0x2819('0x67')](_0x2819('0x60'),auth[_0x2819('0xb')](),controller[_0x2819('0x74')]);router[_0x2819('0x67')](_0x2819('0x36'),auth[_0x2819('0xb')](),controller[_0x2819('0x75')]);router[_0x2819('0x67')](_0x2819('0x38'),auth['isAuthenticated'](),controller[_0x2819('0x76')]);router['delete'](_0x2819('0x3b'),auth[_0x2819('0xb')](),controller['removeApiKey']);module[_0x2819('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9c3658c..b670796 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x162772,_0x3e9a40){var _0x90ff02=function(_0x3877a5){while(--_0x3877a5){_0x162772['push'](_0x162772['shift']());}};_0x90ff02(++_0x3e9a40);}(_0xe706,0xa3));var _0x6e70=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0xe706[_0x7a3247];return _0x1bfde5;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index f1d4150..74217d2 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8404=['telephone','filter','map','value','includes','UserProfileResource','sendStatus','name','send','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','query','includeAll','true','include','UserSetting','userSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','params','model','keys','filters','intersection','merge','options','find','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','isNil','min_internal','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','102','103','113','105','106','107','108','109','111','115','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','userProfileId','create','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','isEmpty','changePassword','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','ValidationError','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','VoiceQueue','interface','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','channel','QueueId','Queue:remove','voice','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','sort','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Unknown\x20channel','fields','order','pick','get','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','count','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','UserId','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','LOCAL/%s@from-sip/n','intrf','user:%s','x-forwarded-for','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','MemberReport','bulkCreate','LOGININPAUSE','isMiddleware','resolve','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','faxPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','sequelize','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Queue:save','removeTeams','Team','getAssociatedQueues','flattenDeep','removeAgent','Voice','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','firstName','lastName','CmContact','Contact','Queue','getApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','inbound','flatten','lower','toString','asc','desc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','toUpperCase','slice','QueryTypes','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','util','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','./user.socket','register','redis','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','end','undefined','offset','limit','set','Content-Range','json','update','role','agent','emit','userNotification:recalc:','destroy','admin','Agents','Telephones'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x8404,0x15b));var _0x4840=function(_0x5269a9,_0x43e598){_0x5269a9=_0x5269a9-0x0;var _0x42f094=_0x8404[_0x5269a9];return _0x42f094;};'use strict';var moment=require('moment');var util=require(_0x4840('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x4840('0x1'));var squel=require(_0x4840('0x2'));var jayson=require(_0x4840('0x3'));var Redis=require(_0x4840('0x4'));var authService=require(_0x4840('0x5'));var qs=require(_0x4840('0x6'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4840('0x7'));var APIBadRequestError=require(_0x4840('0x8'))[_0x4840('0x9')];var APINotFoundError=require('../../errors/api')[_0x4840('0xa')];var APIHandleError=require(_0x4840('0x8'))[_0x4840('0xb')];var db=require(_0x4840('0xc'))['db'];var socket=require(_0x4840('0xd'))(new Redis(config['redis']));require(_0x4840('0xe'))[_0x4840('0xf')](socket);config[_0x4840('0x10')]=_['defaults'](config[_0x4840('0x10')],{'host':'localhost','port':0x18eb});var amiClient=jayson['client'][_0x4840('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5e9f95,_0x5b6833,_0x2e67db,_0x1b8d9c){return new Promise(function(_0x3ac2ef,_0x24fb3b){var _0x43555c=_0x1b8d9c||amiClient;return _0x43555c['request'](_0x5e9f95,_0x2e67db)[_0x4840('0x12')](function(_0x49e9f0){logger[_0x4840('0x13')](_0x4840('0x14'),_0x5b6833,_0x4840('0x15'));logger[_0x4840('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x5b6833,_0x4840('0x15'),JSON['stringify'](_0x49e9f0));if(_0x49e9f0[_0x4840('0x17')]){if(_0x49e9f0['error'][_0x4840('0x18')]===0x1f4){logger['error'](_0x4840('0x14'),_0x5b6833,_0x49e9f0[_0x4840('0x17')][_0x4840('0x19')]);return _0x24fb3b(_0x49e9f0['error']['message']);}logger[_0x4840('0x17')]('User,\x20%s,\x20%s',_0x5b6833,_0x49e9f0[_0x4840('0x17')]['message']);return _0x3ac2ef(_0x49e9f0[_0x4840('0x17')][_0x4840('0x19')]);}else{logger[_0x4840('0x13')]('User,\x20%s,\x20%s',_0x5b6833,_0x4840('0x15'));_0x3ac2ef(_0x49e9f0[_0x4840('0x1a')]['message']);}})['catch'](function(_0x12c082){logger['error'](_0x4840('0x14'),_0x5b6833,_0x12c082);_0x24fb3b(_0x12c082);});});}function respondWithStatusCode(_0x1b5a7d,_0x4fd712){_0x4fd712=_0x4fd712||0xcc;return function(_0x333b2d){if(_0x333b2d){return _0x1b5a7d['sendStatus'](_0x4fd712);}return _0x1b5a7d[_0x4840('0x1b')](_0x4fd712)[_0x4840('0x1c')]();};}function respondWithResult(_0x2b4278,_0x5756b5){_0x5756b5=_0x5756b5||0xc8;return function(_0x4300c0){if(_0x4300c0){return _0x2b4278[_0x4840('0x1b')](_0x5756b5)['json'](_0x4300c0);}};}function respondWithFilteredResult(_0x12f3a8,_0x6ea9c){return function(_0xc82a01){if(_0xc82a01){var _0x481a2f=typeof _0x6ea9c['offset']===_0x4840('0x1d')&&typeof _0x6ea9c['limit']===_0x4840('0x1d');var _0x5e8a9c=_0xc82a01['count'];var _0x13545c=_0x481a2f?0x0:_0x6ea9c['offset'];var _0x3a85ec=_0x481a2f?_0xc82a01['count']:_0x6ea9c[_0x4840('0x1e')]+_0x6ea9c[_0x4840('0x1f')];var _0x39280b;if(_0x3a85ec>=_0x5e8a9c){_0x3a85ec=_0x5e8a9c;_0x39280b=0xc8;}else{_0x39280b=0xce;}_0x12f3a8['status'](_0x39280b);return _0x12f3a8[_0x4840('0x20')](_0x4840('0x21'),_0x13545c+'-'+_0x3a85ec+'/'+_0x5e8a9c)[_0x4840('0x22')](_0xc82a01);}return null;};}function saveUpdates(_0x1e0ef0){return function(_0x32dc20){if(_0x32dc20){return _0x32dc20[_0x4840('0x23')](_0x1e0ef0)[_0x4840('0x12')](function(_0x47ad87){if(_0x47ad87[_0x4840('0x24')]===_0x4840('0x25')){socket[_0x4840('0x26')](_0x4840('0x27')+_0x47ad87['id'],_0x47ad87);}return _0x47ad87;});}return null;};}function removeEntity(_0x14bdcd){return function(_0xc82d81){if(_0xc82d81){return _0xc82d81[_0x4840('0x28')]()['then'](function(){var _0x238d05=_0xc82d81['get']({'plain':!![]});if(_0x238d05[_0x4840('0x24')]===_0x4840('0x29'))return;var _0x36b004=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x4840('0x2a'),'value':_0x4840('0x25'),'ignore':![]},{'name':_0x4840('0x2b'),'value':_0x4840('0x2c'),'ignore':![]}];var _0x1a4097=_(_0x36b004)[_0x4840('0x2d')]('ignore')[_0x4840('0x2e')](_0x4840('0x2f'))['value']();if(_[_0x4840('0x30')](_0x1a4097,_0x238d05[_0x4840('0x24')])){return;}var _0x59c429=_['find'](_0x36b004,[_0x4840('0x2f'),_0x238d05['role']])['name'];return db[_0x4840('0x31')][_0x4840('0x28')]({'where':{'type':_0x59c429,'resourceId':_0x238d05['id']}})[_0x4840('0x12')](function(){return _0xc82d81;});})['then'](function(){_0x14bdcd[_0x4840('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f37f2){return function(_0x34c18e){if(!_0x34c18e){_0x2f37f2[_0x4840('0x32')](0x194);}return _0x34c18e;};}function handleError(_0x102683,_0x3aaa59){_0x3aaa59=_0x3aaa59||0x1f4;return function(_0x4a5ab9){logger[_0x4840('0x17')](_0x4a5ab9['stack']);if(_0x4a5ab9['name']){delete _0x4a5ab9[_0x4840('0x33')];}_0x102683['status'](_0x3aaa59)[_0x4840('0x34')](_0x4a5ab9);};}exports[_0x4840('0x35')]=function(_0xb943af,_0x27faa2){var _0x56c8ea={},_0x3372e0={'count':0x0,'rows':[]};var _0x1d600e=_(db[_0x4840('0x36')][_0x4840('0x37')])[_0x4840('0x2e')](function(_0xc46fad){return{'name':_0xc46fad[_0x4840('0x38')],'type':_0xc46fad[_0x4840('0x39')][_0x4840('0x3a')]};})[_0x4840('0x2d')](function(_0x10511d){return!_[_0x4840('0x30')]([_0x4840('0x3b'),_0x4840('0x3c')],_0x10511d['name']);})['value']();_0x56c8ea=qs[_0x4840('0x3d')](_0x1d600e,_0xb943af);var _0x34042b={'where':_0x56c8ea[_0x4840('0x3e')]};return db[_0x4840('0x36')]['count'](_0x34042b)[_0x4840('0x12')](function(_0x34ed8a){_0x3372e0['count']=_0x34ed8a;if(_0xb943af[_0x4840('0x3f')][_0x4840('0x40')]){_0x56c8ea['include']=[{'all':!![]}];}if(_0xb943af[_0x4840('0x3f')]['userSetting']===_0x4840('0x41')){_0x56c8ea[_0x4840('0x42')]=[{'model':db[_0x4840('0x43')],'as':_0x4840('0x44')}];}if(!_[_0x4840('0x30')](_0x56c8ea[_0x4840('0x45')],'id')){_0x56c8ea[_0x4840('0x45')][_0x4840('0x46')]('id');}return db[_0x4840('0x36')][_0x4840('0x47')](_0x56c8ea);})[_0x4840('0x12')](function(_0x487dab){_0x3372e0[_0x4840('0x48')]=_0x487dab;if(_0xb943af[_0x4840('0x3f')][_0x4840('0x49')]===_0x4840('0x41')){var _0x311228=[];for(var _0x4ba663=0x0;_0x4ba663<_0x3372e0[_0x4840('0x48')][_0x4840('0x4a')];_0x4ba663++){_0x311228[_0x4840('0x46')](get_open_tabs(_0x4840('0x4b'),_0x3372e0[_0x4840('0x48')][_0x4ba663][_0x4840('0x4c')]));_0x311228[_0x4840('0x46')](get_open_tabs(_0x4840('0x4d'),_0x3372e0['rows'][_0x4ba663]['dataValues']));_0x311228[_0x4840('0x46')](get_open_tabs(_0x4840('0x4e'),_0x3372e0[_0x4840('0x48')][_0x4ba663][_0x4840('0x4c')]));_0x311228[_0x4840('0x46')](get_open_tabs(_0x4840('0x4f'),_0x3372e0['rows'][_0x4ba663][_0x4840('0x4c')]));_0x311228[_0x4840('0x46')](get_open_tabs(_0x4840('0x50'),_0x3372e0[_0x4840('0x48')][_0x4ba663][_0x4840('0x4c')]));_0x311228[_0x4840('0x46')](get_open_tabs(_0x4840('0x51'),_0x3372e0['rows'][_0x4ba663][_0x4840('0x4c')]));}return Promise[_0x4840('0x52')](_0x311228)[_0x4840('0x12')](function(){return _0x3372e0;});}else{return _0x3372e0;}})[_0x4840('0x12')](respondWithFilteredResult(_0x27faa2,_0x56c8ea))[_0x4840('0x53')](handleError(_0x27faa2,null));};exports[_0x4840('0x54')]=function(_0x2dce94,_0x2b44e4){var _0x2b7ef2={'raw':![],'where':{'id':_0x2dce94[_0x4840('0x55')]['id']}},_0x617052={};_0x617052[_0x4840('0x56')]=_['differenceBy'](_['keys'](db[_0x4840('0x36')][_0x4840('0x37')]),[_0x4840('0x3b'),_0x4840('0x3c')]);_0x617052[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x2dce94[_0x4840('0x3f')]);_0x617052[_0x4840('0x58')]=_[_0x4840('0x59')](_0x617052[_0x4840('0x56')],_0x617052[_0x4840('0x3f')]);_0x2b7ef2[_0x4840('0x45')]=_[_0x4840('0x59')](_0x617052[_0x4840('0x56')],qs['fields'](_0x2dce94['query']['fields']));_0x2b7ef2[_0x4840('0x45')]=_0x2b7ef2['attributes']['length']?_0x2b7ef2['attributes']:_0x617052['model'];if(_0x2dce94[_0x4840('0x3f')][_0x4840('0x40')]){_0x2b7ef2[_0x4840('0x42')]=[{'all':!![]}];}if(_0x2dce94['query']['userSetting']===_0x4840('0x41')){_0x2b7ef2[_0x4840('0x42')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x2b7ef2=_[_0x4840('0x5a')]({},_0x2b7ef2,_0x2dce94[_0x4840('0x5b')]);if(!_[_0x4840('0x30')](_0x2b7ef2['attributes'],'id')){_0x2b7ef2[_0x4840('0x45')][_0x4840('0x46')]('id');}return db[_0x4840('0x36')][_0x4840('0x5c')](_0x2b7ef2)[_0x4840('0x12')](handleEntityNotFound(_0x2b44e4,null))['then'](function(_0x28e4f3){var _0x3a814a=[];values=_0x28e4f3;if(_0x2dce94[_0x4840('0x3f')]['openTabs']===_0x4840('0x41')){_0x3a814a[_0x4840('0x46')](get_open_tabs(_0x4840('0x4b'),_0x28e4f3['dataValues']));_0x3a814a['push'](get_open_tabs(_0x4840('0x4d'),_0x28e4f3[_0x4840('0x4c')]));_0x3a814a['push'](get_open_tabs(_0x4840('0x50'),_0x28e4f3[_0x4840('0x4c')]));_0x3a814a[_0x4840('0x46')](get_open_tabs('whatsapp',_0x28e4f3['dataValues']));_0x3a814a['push'](get_open_tabs(_0x4840('0x4e'),_0x28e4f3[_0x4840('0x4c')]));_0x3a814a[_0x4840('0x46')](get_open_tabs(_0x4840('0x4f'),_0x28e4f3[_0x4840('0x4c')]));return Promise[_0x4840('0x52')](_0x3a814a);}else{return values;}})[_0x4840('0x12')](function(){return values;})[_0x4840('0x12')](respondWithResult(_0x2b44e4,null))[_0x4840('0x53')](handleError(_0x2b44e4,null));};exports['update']=function(_0x82ae7b,_0x284835){if(_0x82ae7b[_0x4840('0x5d')]['id']){delete _0x82ae7b[_0x4840('0x5d')]['id'];}delete _0x82ae7b[_0x4840('0x5d')][_0x4840('0x24')];return db[_0x4840('0x36')]['find']({'where':{'id':_0x82ae7b[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x284835,null))['then'](saveUpdates(_0x82ae7b[_0x4840('0x5d')],null))['then'](respondWithResult(_0x284835,null))[_0x4840('0x53')](handleError(_0x284835,null));};exports[_0x4840('0x5e')]=function(_0x2240b6,_0x426a56){return db['User'][_0x4840('0x5e')]()['then'](respondWithResult(_0x426a56,null))['catch'](handleError(_0x426a56,null));};exports[_0x4840('0x5f')]=function(_0x52f083,_0x21bdbb){return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0x52f083[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x21bdbb,null))[_0x4840('0x12')](function(_0x50af52){if(_0x50af52){return _0x50af52[_0x4840('0x5f')](_0x52f083[_0x4840('0x5d')][_0x4840('0x60')],_[_0x4840('0x61')](_0x52f083['body'],['ids','id'])||{});}})[_0x4840('0x12')](respondWithResult(_0x21bdbb,null))[_0x4840('0x53')](handleError(_0x21bdbb,null));};function validateUser(_0x4e25f5){return new Promise(function(_0x31c009,_0x4175f8){if(_0x4e25f5[_0x4840('0x62')])return _0x31c009(_0x4e25f5);return db[_0x4840('0x63')][_0x4840('0x64')](0x1)[_0x4840('0x12')](function(_0x297e72){if(_0x297e72[_0x4840('0x65')])authService['validatePasswordPattern'](_0x4e25f5[_0x4840('0x3b')]);db[_0x4840('0x36')]['max'](_0x4840('0x62'))[_0x4840('0x12')](function(_0x156fc0){if(_[_0x4840('0x66')](_0x156fc0)){_0x4e25f5[_0x4840('0x62')]=_0x297e72['min_internal']||0x1;return;}if(_[_0x4840('0x66')](_0x297e72['min_internal'])||_0x297e72[_0x4840('0x67')]===_0x156fc0){_0x4e25f5[_0x4840('0x62')]=_0x156fc0+0x1;return;}if(_0x297e72[_0x4840('0x67')]>_0x156fc0){_0x4e25f5[_0x4840('0x62')]=_0x297e72['min_internal'];return;}return db['sequelize'][_0x4840('0x3f')]('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)',{'type':db['sequelize']['QueryTypes'][_0x4840('0x68')]})[_0x4840('0x12')](function(_0x4f5e2c){if(_0x4f5e2c&&_0x4f5e2c[_0x4840('0x4a')]){for(var _0xaf1153=0x0,_0x445101=_0x4f5e2c[_0x4840('0x4a')];_0xaf1153<_0x445101&&_[_0x4840('0x66')](_0x4e25f5[_0x4840('0x62')]);_0xaf1153++){if(_0x297e72[_0x4840('0x67')]<=_0x4f5e2c[_0xaf1153][_0x4840('0x69')]){_0x4e25f5['internal']=_0x4f5e2c[_0xaf1153][_0x4840('0x69')];}else if(_0x297e72['min_internal']>_0x4f5e2c[_0xaf1153][_0x4840('0x69')]&&_0x297e72[_0x4840('0x67')]<=_0x4f5e2c[_0xaf1153]['to']){_0x4e25f5[_0x4840('0x62')]=_0x297e72[_0x4840('0x67')];}}}if(_[_0x4840('0x66')](_0x4e25f5[_0x4840('0x62')])){_0x4e25f5[_0x4840('0x62')]=_0x156fc0+0x1;}return _0x31c009(_0x4e25f5);});});})[_0x4840('0x53')](function(_0x4d66c0){_0x4175f8(_0x4d66c0);});});}function updateUser(_0x1ff6e1){return new Promise(function(_0x58e102,_0x11125c){try{if(_0x1ff6e1['voicemail']){_0x1ff6e1[_0x4840('0x6a')]=_0x1ff6e1[_0x4840('0x62')];_0x1ff6e1[_0x4840('0x6b')]={'mailbox':_0x1ff6e1['internal'],'password':_0x1ff6e1[_0x4840('0x3b')],'fullname':_0x1ff6e1[_0x4840('0x6c')],'email':_0x1ff6e1[_0x4840('0x6d')]};}if(_0x1ff6e1[_0x4840('0x24')]===_0x4840('0x25')){if(!_0x1ff6e1[_0x4840('0x6e')])_0x1ff6e1[_0x4840('0x6e')]=['101',_0x4840('0x6f'),_0x4840('0x70'),_0x4840('0x71'),'110','104',_0x4840('0x72'),_0x4840('0x73'),_0x4840('0x74'),_0x4840('0x75'),_0x4840('0x76'),'100',_0x4840('0x77'),'114',_0x4840('0x78')];}_0x58e102(_0x1ff6e1);}catch(_0x25990d){_0x11125c(_0x25990d);}});}exports['create']=function(_0x292404,_0x3655e8){if(_0x292404['user']['role']===_0x4840('0x25'))throw new Error(_0x4840('0x79'));if(_0x292404['body'][_0x4840('0x24')]==='user'&&_0x292404[_0x4840('0x7a')]['role']!=='admin'){throw new Error(_0x4840('0x7b'));}if(_0x292404['body'][_0x4840('0x24')]===_0x4840('0x29')&&_0x292404[_0x4840('0x7a')][_0x4840('0x24')]!==_0x4840('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x292404['body']])[_0x4840('0x12')](function(){return validateUser(_0x292404['body']);})[_0x4840('0x12')](function(_0x2e3e5a){return updateUser(_0x2e3e5a)[_0x4840('0x12')](function(_0x4ae9a9){if(_0x4ae9a9[_0x4840('0x24')]===_0x4840('0x29')){_0x4ae9a9['settingsEnabled']=_0x292404[_0x4840('0x7a')]['settingsEnabled'];delete _0x4ae9a9[_0x4840('0x7c')];}return _0x4ae9a9;});})[_0x4840('0x12')](function(_0x450bc7){return db['User'][_0x4840('0x7d')](_0x450bc7,{'include':[{'model':db[_0x4840('0x6b')],'as':_0x4840('0x6b')}]});})[_0x4840('0x12')](function(_0x55cc9d){if(_0x292404[_0x4840('0x5d')][_0x4840('0x24')]==='user')return _0x55cc9d;if(_0x292404[_0x4840('0x7a')][_0x4840('0x24')]!==_0x4840('0x7a'))return _0x55cc9d;return db['UserProfileSection']['find']({'where':{'name':_0x55cc9d[_0x4840('0x24')]===_0x4840('0x25')?_0x4840('0x2a'):_0x4840('0x2b'),'userProfileId':_0x292404['user']['userProfileId']},'raw':!![]})['then'](function(_0x16ecae){if(!_0x16ecae||_0x16ecae[_0x4840('0x7e')]!=0x0)return _0x55cc9d;return db['UserProfileResource']['create']({'name':_0x55cc9d['name'],'resourceId':_0x55cc9d['id'],'type':_0x16ecae[_0x4840('0x33')],'sectionId':_0x16ecae['id']},{})[_0x4840('0x12')](function(){return _0x55cc9d;});})['catch'](function(_0x45769d){logger[_0x4840('0x17')](_0x4840('0x7f'),_0x45769d);throw _0x45769d;});})[_0x4840('0x12')](respondWithResult(_0x3655e8,0xc9))[_0x4840('0x53')](handleError(_0x3655e8,null));};exports['bulkCreate']=function(_0x349f10,_0x165d27){var _0x3b9447=_0x349f10[_0x4840('0x5d')];var _0x54c757=[];if(_0x349f10[_0x4840('0x7a')][_0x4840('0x24')]==='agent')throw new Error('Unauthorized');if(_['some'](_0x3b9447,[_0x4840('0x24'),_0x4840('0x7a')])&&_0x349f10[_0x4840('0x7a')]['role']!==_0x4840('0x29')){throw new Error(_0x4840('0x7b'));}if(_[_0x4840('0x80')](_0x3b9447,[_0x4840('0x24'),_0x4840('0x29')])&&_0x349f10[_0x4840('0x7a')]['role']!=='admin'){throw new Error(_0x4840('0x81'));}return licenseUtil['checkUserLimits'](_0x3b9447)[_0x4840('0x12')](function(){return validateUser(_0x3b9447[0x0]);})['then'](function(){for(var _0x5b269d=0x1;_0x5b269d<_0x3b9447[_0x4840('0x4a')];_0x5b269d++){var _0x475af4=_0x3b9447[_0x5b269d-0x1][_0x4840('0x62')];if(!_0x3b9447[_0x5b269d][_0x4840('0x62')])_0x3b9447[_0x5b269d][_0x4840('0x62')]=_0x475af4+0x1;_0x54c757[_0x4840('0x46')](validateUser(_0x3b9447[_0x5b269d]));}return Promise[_0x4840('0x52')](_0x54c757);})['then'](function(){_0x54c757=[];for(var _0x6baf89=0x0;_0x6baf89<_0x3b9447[_0x4840('0x4a')];_0x6baf89++){_0x54c757[_0x4840('0x46')](updateUser(_0x3b9447[_0x6baf89]));}return Promise['all'](_0x54c757);})['then'](function(){_0x54c757=_0x3b9447[_0x4840('0x2e')](function(_0x16e011){return db[_0x4840('0x36')][_0x4840('0x7d')](_0x16e011,{'include':[{'model':db[_0x4840('0x6b')],'as':_0x4840('0x6b')}]})['then'](function(_0x2d8703){_0x16e011['id']=_0x2d8703['id'];return _0x16e011;});});return Promise[_0x4840('0x52')](_0x54c757);})[_0x4840('0x12')](function(_0x1824fd){if(_0x349f10[_0x4840('0x5d')][_0x4840('0x24')]===_0x4840('0x7a'))return _0x1824fd;if(_0x349f10[_0x4840('0x7a')][_0x4840('0x24')]!=='user')return _0x1824fd;var _0x3c43ec=_[_0x4840('0x80')](_0x1824fd,function(_0x52e492){return _0x52e492[_0x4840('0x24')]===_0x4840('0x25')||_0x52e492[_0x4840('0x24')]===_0x4840('0x2c');});if(!_0x3c43ec)return _0x1824fd;return db[_0x4840('0x82')]['findAll']({'where':{'name':{'$or':[_0x4840('0x2a'),_0x4840('0x2b')]},'userProfileId':_0x349f10[_0x4840('0x7a')]['userProfileId']},'raw':!![]})[_0x4840('0x12')](function(_0x2aa4f1){if(_[_0x4840('0x83')](_0x2aa4f1)||!_[_0x4840('0x80')](_0x2aa4f1,[_0x4840('0x7e'),0x0]))return _0x1824fd;_0x54c757=[];var _0x1d1e2e=_(_0x2aa4f1)[_0x4840('0x2e')](function(_0x412f37){if(_0x412f37[_0x4840('0x7e')]===0x1)return;return _0x412f37[_0x4840('0x33')]===_0x4840('0x2a')?'agent':_0x4840('0x2c');})['compact']()['value']();for(var _0x3292e5=0x0;_0x3292e5<_0x1824fd[_0x4840('0x4a')];_0x3292e5++){if(!_[_0x4840('0x30')](_0x1d1e2e,_0x1824fd[_0x3292e5][_0x4840('0x24')]))return;var _0x1ea203=_0x1824fd[_0x3292e5][_0x4840('0x24')]===_0x4840('0x25')?'Agents':_0x4840('0x2b');_0x54c757[_0x4840('0x46')](db['UserProfileResource'][_0x4840('0x7d')]({'name':_0x1824fd[_0x3292e5][_0x4840('0x33')],'resourceId':_0x1824fd[_0x3292e5]['id'],'type':_0x1ea203,'sectionId':_[_0x4840('0x5c')](_0x2aa4f1,[_0x4840('0x33'),_0x1ea203])['id']},{}));}return Promise[_0x4840('0x52')](_0x54c757);});})[_0x4840('0x12')](respondWithResult(_0x165d27,0xc9))[_0x4840('0x53')](handleError(_0x165d27,null));};exports[_0x4840('0x84')]=function(_0x31f672,_0x5d4b2f){if(_0x31f672[_0x4840('0x5d')]['id']){delete _0x31f672[_0x4840('0x5d')]['id'];}return db[_0x4840('0x36')]['find']({'where':{'id':_0x31f672[_0x4840('0x55')]['id']}})[_0x4840('0x12')](function(_0x3a6e9f){if(!_0x3a6e9f)return null;if(_0x3a6e9f['id']===_0x31f672[_0x4840('0x7a')]['id']){if(!_0x31f672[_0x4840('0x5d')]['oldPassword']||!_0x31f672[_0x4840('0x5d')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x4840('0x85'));}if(!_0x3a6e9f[_0x4840('0x86')](_0x31f672[_0x4840('0x5d')][_0x4840('0x87')])){throw new db['Sequelize'][(_0x4840('0x88'))]('Wrong\x20credentials');}if(_0x31f672['body'][_0x4840('0x87')]===_0x31f672[_0x4840('0x5d')]['newPassword']){throw new db[(_0x4840('0x89'))][(_0x4840('0x88'))](_0x4840('0x8a'));}}else if(_0x31f672['user'][_0x4840('0x24')]===_0x4840('0x29')){if(!_0x31f672['body']['newPassword']){throw new db[(_0x4840('0x89'))][(_0x4840('0x88'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x31f672[_0x4840('0x7a')][_0x4840('0x24')]===_0x4840('0x7a')){if(!_0x31f672[_0x4840('0x5d')][_0x4840('0x8b')]){throw new db[(_0x4840('0x89'))]['ValidationError'](_0x4840('0x8c'));}if(_0x3a6e9f['role']!==_0x4840('0x25')){throw new db[(_0x4840('0x89'))][(_0x4840('0x88'))](_0x4840('0x79'));}}else{throw new db[(_0x4840('0x89'))][(_0x4840('0x88'))](_0x4840('0x79'));}return _0x3a6e9f;})[_0x4840('0x12')](handleEntityNotFound(_0x5d4b2f,null))[_0x4840('0x12')](function(_0x3be4f1){return db[_0x4840('0x63')][_0x4840('0x8d')]({'attributes':['id',_0x4840('0x65'),_0x4840('0x8e'),_0x4840('0x8f')]})[_0x4840('0x12')](function(_0x13e93d){if(_0x13e93d[_0x4840('0x65')])authService[_0x4840('0x90')](_0x31f672[_0x4840('0x5d')][_0x4840('0x8b')]);if(!_0x13e93d[_0x4840('0x8e')]||!_0x3be4f1[_0x4840('0x91')])return _0x3be4f1;authService['validatePasswordHistory'](_0x31f672[_0x4840('0x5d')]['newPassword'],_0x3be4f1[_0x4840('0x91')],_0x13e93d[_0x4840('0x8f')]);return _0x3be4f1;})['then'](saveUpdates({'password':_0x31f672[_0x4840('0x5d')]['newPassword'],'passwordResetAt':_0x31f672[_0x4840('0x7a')]['id']==_0x31f672[_0x4840('0x55')]['id']?moment():null,'previousPasswords':authService[_0x4840('0x92')](_0x31f672[_0x4840('0x5d')][_0x4840('0x8b')],_0x3be4f1[_0x4840('0x91')])},null));})['then'](respondWithResult(_0x5d4b2f,null))[_0x4840('0x53')](handleError(_0x5d4b2f,null));};exports[_0x4840('0x93')]=function(_0x171927,_0x48aa07){var _0x10da15=_0x171927[_0x4840('0x5d')]['channel'];return db['User'][_0x4840('0x5c')]({'where':{'id':_0x171927[_0x4840('0x55')]['id']},'attributes':['id',_0x4840('0x33'),_0x4840('0x24'),_0x4840('0x94'),_0x4840('0x95'),_0x4840('0x96'),'interface']})[_0x4840('0x12')](handleEntityNotFound(_0x48aa07,null))['then'](function(_0x25ec9e){if(_0x25ec9e){if(!utils[_0x4840('0x97')](_0x10da15)){throw new db['Sequelize'][(_0x4840('0x88'))]('Unknown\x20channel');}return _0x25ec9e[_0x4840('0x98')+_[_0x4840('0x99')](_0x10da15[_0x4840('0x9a')]())+_0x4840('0x9b')](_0x171927[_0x4840('0x5d')][_0x4840('0x60')],{'penalty':_0x171927['body'][_0x4840('0x9c')]||0x0})[_0x4840('0x9d')](function(_0x15cd35){for(var _0x232cf0=0x0;_0x232cf0<_0x171927[_0x4840('0x5d')][_0x4840('0x60')][_0x4840('0x4a')];_0x232cf0+=0x1){var _0x588cc4={'UserId':Number(_0x171927[_0x4840('0x55')]['id'])};_0x588cc4[_[_0x4840('0x99')](_0x10da15[_0x4840('0x9a')]())+'QueueId']=Number(_0x171927['body'][_0x4840('0x60')][_0x232cf0]);socket[_0x4840('0x26')](_0x4840('0x7a')+_[_0x4840('0x99')](_0x10da15[_0x4840('0x9a')]())+'Queue:save',_0x588cc4);}return _0x15cd35;})[_0x4840('0x12')](function(){if(_0x10da15==='voice'){return db[_0x4840('0x9e')]['findAll']({'where':{'id':_0x171927[_0x4840('0x5d')][_0x4840('0x60')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x4840('0x12')](function(_0x54e8ef){var _0x2a998b=_0x25ec9e['get']({'plain':!![]});var _0x1ff90d=[];if(_0x10da15==='voice'&&_0x2a998b[_0x4840('0x24')]===_0x4840('0x25')&&_0x2a998b[_0x4840('0x94')]){for(let _0x5cb9d5=0x0;_0x5cb9d5<_0x54e8ef[_0x4840('0x4a')];_0x5cb9d5+=0x1){_0x1ff90d[_0x4840('0x46')]({'membername':_0x2a998b[_0x4840('0x33')],'UserId':_0x2a998b['id'],'queue_name':_0x54e8ef[_0x5cb9d5][_0x4840('0x33')],'VoiceQueueId':_0x54e8ef[_0x5cb9d5]['id'],'interface':_[_0x4840('0x66')](_0x2a998b[_0x4840('0x9f')])?util[_0x4840('0xa0')](_0x4840('0xa1'),_0x2a998b[_0x4840('0x33')]):_0x2a998b['interface'],'paused':_0x2a998b[_0x4840('0x96')]||![],'penalty':_0x171927[_0x4840('0x5d')]['penalty']||0x0});}return Promise[_0x4840('0x52')](_0x1ff90d[_0x4840('0x2e')](function(_0x6f345d){return db[_0x4840('0xa2')][_0x4840('0xa3')](_0x6f345d);}));}return _0x25ec9e;});}})[_0x4840('0x12')](respondWithStatusCode(_0x48aa07,null))[_0x4840('0x53')](handleError(_0x48aa07,null));};exports[_0x4840('0xa4')]=function(_0x1b0712,_0x42c5c6){var _0x3f24f8,_0x801f5f;return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0x1b0712[_0x4840('0x55')]['id']},'attributes':['id','name',_0x4840('0x24')]})[_0x4840('0x12')](handleEntityNotFound(_0x42c5c6,null))[_0x4840('0x12')](function(_0x1d43e8){if(_0x1d43e8){_0x3f24f8=_0x1d43e8;if(!_0x1b0712[_0x4840('0x3f')]['channel']||!utils[_0x4840('0x97')](_0x1b0712['query']['channel'])){throw new db[(_0x4840('0x89'))][(_0x4840('0x88'))]('Unknown\x20channel');}return _0x1d43e8[_0x4840('0xa5')+_[_0x4840('0x99')](_0x1b0712[_0x4840('0x3f')]['channel'][_0x4840('0x9a')]())+'Queues'](_0x1b0712[_0x4840('0x3f')][_0x4840('0x60')]);}})[_0x4840('0x12')](function(_0x3c148f){if(_[_0x4840('0xa6')](_0x1b0712[_0x4840('0x3f')]['ids'])){for(var _0x2bee10=0x0;_0x2bee10<_0x1b0712['query'][_0x4840('0x60')]['length'];_0x2bee10+=0x1){_0x801f5f={'UserId':Number(_0x1b0712[_0x4840('0x55')]['id'])};_0x801f5f[_[_0x4840('0x99')](_0x1b0712[_0x4840('0x3f')][_0x4840('0xa7')]['toLowerCase']())+_0x4840('0xa8')]=Number(_0x1b0712[_0x4840('0x3f')]['ids'][_0x2bee10]);socket[_0x4840('0x26')](_0x4840('0x7a')+_[_0x4840('0x99')](_0x1b0712[_0x4840('0x3f')]['channel']['toLowerCase']())+_0x4840('0xa9'),_0x801f5f);}}else{_0x801f5f={'UserId':Number(_0x1b0712[_0x4840('0x55')]['id'])};_0x801f5f[_[_0x4840('0x99')](_0x1b0712[_0x4840('0x3f')][_0x4840('0xa7')][_0x4840('0x9a')]())+_0x4840('0xa8')]=Number(_0x1b0712[_0x4840('0x3f')][_0x4840('0x60')]);socket['emit'](_0x4840('0x7a')+_[_0x4840('0x99')](_0x1b0712[_0x4840('0x3f')][_0x4840('0xa7')][_0x4840('0x9a')]())+_0x4840('0xa9'),_0x801f5f);}return _0x3c148f;})[_0x4840('0x12')](function(){if(_0x1b0712[_0x4840('0x3f')][_0x4840('0xa7')]===_0x4840('0xaa')){return db[_0x4840('0xa2')]['destroy']({'where':{'UserId':_0x1b0712[_0x4840('0x55')]['id'],'VoiceQueueId':_0x1b0712['query'][_0x4840('0x60')]},'individualHooks':!![]})[_0x4840('0x12')](function(){return _0x3f24f8;});}return _0x3f24f8;})['then'](respondWithStatusCode(_0x42c5c6,null))['catch'](handleError(_0x42c5c6,null));};exports['addAvatar']=function(_0xfa8c70,_0xf5882c){_0xfa8c70['body']['userpic']=_0xfa8c70[_0x4840('0xab')][_0x4840('0xac')];return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0xfa8c70[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0xf5882c,null))[_0x4840('0x12')](saveUpdates(_0xfa8c70[_0x4840('0x5d')],null))[_0x4840('0x12')](respondWithResult(_0xf5882c,null))[_0x4840('0x53')](handleError(_0xf5882c,null));};exports[_0x4840('0xad')]=function(_0x3c9aa5,_0x5b4b99){var _0xa712a9=path[_0x4840('0xae')](config[_0x4840('0xaf')],_0x4840('0xb0'));return db[_0x4840('0x36')]['find']({'where':{'id':_0x3c9aa5['params']['id']},'attributes':['id',_0x4840('0xb1')],'raw':!![]})[_0x4840('0x12')](handleEntityNotFound(_0x5b4b99,null))['then'](function(_0x5871e8){if(_0x5871e8){if(_[_0x4840('0x66')](_0x5871e8['userpic'])){return _0x5b4b99['download'](_0xa712a9);}else{if(!fs['existsSync'](path['join'](config[_0x4840('0xaf')],_0x4840('0xb2'),_0x5871e8[_0x4840('0xb1')]))){return _0x5b4b99[_0x4840('0xb3')](_0xa712a9);}return _0x5b4b99[_0x4840('0xb3')](path[_0x4840('0xae')](config[_0x4840('0xaf')],'server/files/images/',_0x5871e8[_0x4840('0xb1')]));}}})[_0x4840('0x53')](handleError(_0x5b4b99,null));};exports[_0x4840('0xb4')]=function(_0x168b7b,_0x30a46a){return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0x168b7b[_0x4840('0x55')]['id']},'attributes':['id']})[_0x4840('0x12')](handleEntityNotFound(_0x30a46a,null))[_0x4840('0x12')](function(_0x13a9a8){var _0x125fc3=[];values=_0x13a9a8['dataValues'];_0x125fc3[_0x4840('0x46')](get_open_tabs(_0x4840('0x4b'),_0x13a9a8[_0x4840('0x4c')]));_0x125fc3['push'](get_open_tabs(_0x4840('0x4d'),_0x13a9a8[_0x4840('0x4c')]));_0x125fc3[_0x4840('0x46')](get_open_tabs('openchannel',_0x13a9a8[_0x4840('0x4c')]));_0x125fc3['push'](get_open_tabs(_0x4840('0x51'),_0x13a9a8[_0x4840('0x4c')]));_0x125fc3['push'](get_open_tabs('fax',_0x13a9a8[_0x4840('0x4c')]));_0x125fc3[_0x4840('0x46')](get_open_tabs('mail',_0x13a9a8[_0x4840('0x4c')]));return Promise[_0x4840('0x52')](_0x125fc3);})[_0x4840('0x12')](function(_0x328c42){if(_0x328c42){var _0x3ab4b3=_[_0x4840('0x2e')](values[_0x4840('0xb5')],function(_0x3932cd){return{'channel':_0x4840('0xb6'),'id':_0x3932cd['id'],'createdAt':_0x3932cd[_0x4840('0xb7')]};});var _0x317d29=_['map'](values[_0x4840('0xb8')],function(_0x2a7c19){return{'channel':_0x4840('0xb9'),'id':_0x2a7c19['id'],'createdAt':_0x2a7c19[_0x4840('0xb7')]};});var _0x44b3aa=_['map'](values[_0x4840('0xba')],function(_0x821f6c){return{'channel':_0x4840('0xbb'),'id':_0x821f6c['id'],'createdAt':_0x821f6c[_0x4840('0xb7')]};});var _0x8418be=_[_0x4840('0x2e')](values[_0x4840('0xbc')],function(_0x1e646b){return{'channel':_0x4840('0xbd'),'id':_0x1e646b['id'],'createdAt':_0x1e646b[_0x4840('0xb7')]};});var _0x2a6649=_[_0x4840('0x2e')](values[_0x4840('0xbe')],function(_0x4533e3){return{'channel':'SMS','id':_0x4533e3['id'],'createdAt':_0x4533e3[_0x4840('0xb7')]};});var _0x284ec0=_[_0x4840('0x2e')](values[_0x4840('0xbf')],function(_0x263025){return{'channel':_0x4840('0xc0'),'id':_0x263025['id'],'createdAt':_0x263025[_0x4840('0xb7')]};});var _0x451a27=_[_0x4840('0xc1')](_0x3ab4b3,_0x317d29,_0x44b3aa,_0x8418be,_0x2a6649,_0x284ec0);var _0x3dabe6={'count':_0x451a27[_0x4840('0x4a')],'rows':_0x451a27};return _0x3dabe6;}else return null;})['then'](respondWithResult(_0x30a46a,null))[_0x4840('0x53')](handleError(_0x30a46a,null));};exports[_0x4840('0xc2')]=function(_0x16efa4,_0x2cd767){var _0x1425b4={};var _0x228dbe={};var _0x38c413;var _0x2bf58a;return db['User'][_0x4840('0x8d')]({'where':{'id':_0x16efa4[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x2cd767,null))[_0x4840('0x12')](function(_0x5b8bdf){if(_0x5b8bdf){_0x38c413=_0x5b8bdf;_0x228dbe[_0x4840('0x56')]=_[_0x4840('0x57')](db['CmContact'][_0x4840('0x37')]);_0x228dbe[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x16efa4['query']);_0x228dbe[_0x4840('0x58')]=_[_0x4840('0x59')](_0x228dbe[_0x4840('0x56')],_0x228dbe['query']);_0x1425b4[_0x4840('0x45')]=_['intersection'](_0x228dbe[_0x4840('0x56')],qs['fields'](_0x16efa4[_0x4840('0x3f')]['fields']));_0x1425b4[_0x4840('0x45')]=_0x1425b4['attributes'][_0x4840('0x4a')]?_0x1425b4[_0x4840('0x45')]:_0x228dbe['model'];_0x1425b4['order']=qs['sort'](_0x16efa4[_0x4840('0x3f')][_0x4840('0xc3')]);_0x1425b4[_0x4840('0x3e')]=qs[_0x4840('0x58')](_['pick'](_0x16efa4[_0x4840('0x3f')],_0x228dbe['filters']));if(_0x16efa4[_0x4840('0x3f')][_0x4840('0x2d')]){_0x1425b4['where']=_[_0x4840('0x5a')](_0x1425b4[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x1425b4['attributes'],function(_0x123afe){var _0x21a110={};_0x21a110[_0x123afe]={'$like':'%'+_0x16efa4[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x21a110;})});}_0x1425b4=_[_0x4840('0x5a')]({},_0x1425b4,_0x16efa4['options']);return _0x38c413['getContacts'](_0x1425b4);}})[_0x4840('0x12')](function(_0x2eba0e){if(_0x2eba0e){_0x2bf58a=_0x2eba0e[_0x4840('0x4a')];if(_0x16efa4[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0x40'))){_0x1425b4['include']=[{'model':db[_0x4840('0xc5')],'as':_0x4840('0xc6'),'required':![]},{'model':db[_0x4840('0xc7')],'as':_0x4840('0xc8'),'attributes':['id',_0x4840('0x33'),_0x4840('0xc9')],'where':_0x16efa4[_0x4840('0x3f')][_0x4840('0xca')]?{'id':_0x16efa4[_0x4840('0x3f')][_0x4840('0xca')]}:undefined,'required':_0x16efa4[_0x4840('0x3f')][_0x4840('0xca')]?!![]:![]}];}if(!_0x16efa4['query'][_0x4840('0xc4')](_0x4840('0xcb'))){_0x1425b4['limit']=qs[_0x4840('0x1f')](_0x16efa4[_0x4840('0x3f')][_0x4840('0x1f')]);_0x1425b4[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x16efa4['query'][_0x4840('0x1e')]);}return _0x38c413[_0x4840('0xc2')](_0x1425b4);}})['then'](function(_0x243336){if(_0x243336){return _0x243336?{'count':_0x2bf58a,'rows':_0x243336}:null;}})['then'](respondWithResult(_0x2cd767,null))[_0x4840('0x53')](handleError(_0x2cd767,null));};exports[_0x4840('0xcc')]=function(_0x39199a,_0x52f025){var _0x357bb7;var _0x34c1a0={};var _0x2cf0f2;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x39199a[_0x4840('0x55')]['id']},'attributes':['id',_0x4840('0x33'),_0x4840('0x24')]})[_0x4840('0x12')](handleEntityNotFound(_0x52f025,null))[_0x4840('0x12')](function(_0x483b23){if(!utils[_0x4840('0x97')](_0x39199a['query'][_0x4840('0xa7')])){throw new db[(_0x4840('0x89'))]['ValidationError'](_0x4840('0xcd'));}_0x357bb7=_0x483b23;var _0x108567={};_0x108567[_0x4840('0x56')]=_[_0x4840('0x57')](db[_[_0x4840('0x99')](_0x39199a[_0x4840('0x3f')][_0x4840('0xa7')])+'Queue']['rawAttributes']);_0x108567[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x39199a[_0x4840('0x3f')]);_0x108567['filters']=_[_0x4840('0x59')](_0x108567[_0x4840('0x56')],_0x108567[_0x4840('0x3f')]);_0x34c1a0[_0x4840('0x45')]=_['intersection'](_0x108567[_0x4840('0x56')],qs[_0x4840('0xce')](_0x39199a['query']['fields']));_0x34c1a0[_0x4840('0x45')]=_0x34c1a0[_0x4840('0x45')]['length']?_0x34c1a0[_0x4840('0x45')]:_0x108567[_0x4840('0x56')];_0x34c1a0[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x39199a[_0x4840('0x3f')][_0x4840('0xc3')]);_0x34c1a0[_0x4840('0x3e')]=qs[_0x4840('0x58')](_[_0x4840('0xd0')](_0x39199a['query'],_0x108567[_0x4840('0x58')]));if(_0x39199a[_0x4840('0x3f')][_0x4840('0x2d')]){_0x34c1a0[_0x4840('0x3e')]=_['merge'](_0x34c1a0[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x34c1a0[_0x4840('0x45')],function(_0x1596b6){var _0x1ccdeb={};_0x1ccdeb[_0x1596b6]={'$like':'%'+_0x39199a['query'][_0x4840('0x2d')]+'%'};return _0x1ccdeb;})});}_0x34c1a0=_[_0x4840('0x5a')]({},_0x34c1a0,_0x39199a[_0x4840('0x5b')]);switch(_0x357bb7[_0x4840('0x24')]){case'admin':return db[_['capitalize'](_0x39199a[_0x4840('0x3f')][_0x4840('0xa7')])+'Queue'][_0x4840('0x47')](_0x34c1a0);case'user':case'agent':return _0x357bb7[_0x4840('0xd1')+_[_0x4840('0x99')](_0x39199a[_0x4840('0x3f')]['channel'])+_0x4840('0x9b')](_0x34c1a0);default:throw new db[(_0x4840('0x89'))][(_0x4840('0x88'))]('Unknown\x20role');}})[_0x4840('0x12')](function(_0x2510b0){_0x2cf0f2=_0x2510b0[_0x4840('0x4a')];if(!_0x39199a[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x34c1a0['limit']=qs[_0x4840('0x1f')](_0x39199a[_0x4840('0x3f')]['limit']);_0x34c1a0[_0x4840('0x1e')]=qs['offset'](_0x39199a[_0x4840('0x3f')][_0x4840('0x1e')]);}switch(_0x357bb7['role']){case _0x4840('0x29'):return db[_['capitalize'](_0x39199a['query'][_0x4840('0xa7')])+'Queue'][_0x4840('0x47')](_0x34c1a0);case _0x4840('0x7a'):case _0x4840('0x25'):return _0x357bb7[_0x4840('0xd1')+_[_0x4840('0x99')](_0x39199a['query']['channel'])+'Queues'](_0x34c1a0);}})[_0x4840('0x12')](function(_0x580eef){return{'count':_0x2cf0f2,'rows':_0x580eef};})[_0x4840('0x12')](respondWithResult(_0x52f025,null))['catch'](handleError(_0x52f025,null));};exports[_0x4840('0xd2')]=function(_0x574881,_0x1d10db){var _0x557f00={};var _0x3c28de={};var _0x10e036;var _0x1567bf;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x574881[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x1d10db,null))[_0x4840('0x12')](function(_0x1b514c){if(_0x1b514c){_0x10e036=_0x1b514c;_0x3c28de[_0x4840('0x56')]=_[_0x4840('0x57')](db['UserVoiceQueueRt'][_0x4840('0x37')]);_0x3c28de[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x574881[_0x4840('0x3f')]);_0x3c28de[_0x4840('0x58')]=_[_0x4840('0x59')](_0x3c28de[_0x4840('0x56')],_0x3c28de[_0x4840('0x3f')]);_0x557f00[_0x4840('0x45')]=_[_0x4840('0x59')](_0x3c28de[_0x4840('0x56')],qs['fields'](_0x574881[_0x4840('0x3f')][_0x4840('0xce')]));_0x557f00[_0x4840('0x45')]=_0x557f00[_0x4840('0x45')][_0x4840('0x4a')]?_0x557f00['attributes']:_0x3c28de[_0x4840('0x56')];_0x557f00[_0x4840('0xcf')]=qs['sort'](_0x574881['query'][_0x4840('0xc3')]);_0x557f00[_0x4840('0x3e')]=qs['filters'](_[_0x4840('0xd0')](_0x574881[_0x4840('0x3f')],_0x3c28de[_0x4840('0x58')]));if(_0x574881[_0x4840('0x3f')]['filter']){_0x557f00[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x557f00[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x557f00['attributes'],function(_0x54878c){var _0x1b3392={};_0x1b3392[_0x54878c]={'$like':'%'+_0x574881[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x1b3392;})});}_0x557f00=_[_0x4840('0x5a')]({},_0x557f00,_0x574881[_0x4840('0x5b')]);return _0x10e036[_0x4840('0xd2')](_0x557f00);}})[_0x4840('0x12')](function(_0x46a39f){if(_0x46a39f){_0x1567bf=_0x46a39f[_0x4840('0x4a')];if(!_0x574881[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x557f00[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x574881[_0x4840('0x3f')][_0x4840('0x1f')]);_0x557f00[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x574881['query'][_0x4840('0x1e')]);}return _0x10e036[_0x4840('0xd2')](_0x557f00);}})[_0x4840('0x12')](function(_0x93e845){if(_0x93e845){return _0x93e845?{'count':_0x1567bf,'rows':_0x93e845}:null;}})[_0x4840('0x12')](respondWithResult(_0x1d10db,null))[_0x4840('0x53')](handleError(_0x1d10db,null));};exports[_0x4840('0xd3')]=function(_0x679e77,_0x57aa1d){var _0xccd2ac={};var _0x13edb8={};var _0xe4b404;var _0x17a776;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x679e77[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x57aa1d,null))[_0x4840('0x12')](function(_0x1915c1){if(_0x1915c1){_0xe4b404=_0x1915c1;_0x13edb8['model']=_[_0x4840('0x57')](db['ChatGroup'][_0x4840('0x37')]);_0x13edb8[_0x4840('0x3f')]=_['keys'](_0x679e77[_0x4840('0x3f')]);_0x13edb8[_0x4840('0x58')]=_['intersection'](_0x13edb8['model'],_0x13edb8['query']);_0xccd2ac['attributes']=_[_0x4840('0x59')](_0x13edb8[_0x4840('0x56')],qs[_0x4840('0xce')](_0x679e77[_0x4840('0x3f')][_0x4840('0xce')]));_0xccd2ac[_0x4840('0x45')]=_0xccd2ac[_0x4840('0x45')][_0x4840('0x4a')]?_0xccd2ac[_0x4840('0x45')]:_0x13edb8['model'];_0xccd2ac[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x679e77[_0x4840('0x3f')][_0x4840('0xc3')]);_0xccd2ac['where']=qs[_0x4840('0x58')](_['pick'](_0x679e77[_0x4840('0x3f')],_0x13edb8[_0x4840('0x58')]));if(_0x679e77[_0x4840('0x3f')][_0x4840('0x2d')]){_0xccd2ac['where']=_[_0x4840('0x5a')](_0xccd2ac[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0xccd2ac['attributes'],function(_0x48fe22){var _0x14d908={};_0x14d908[_0x48fe22]={'$like':'%'+_0x679e77['query'][_0x4840('0x2d')]+'%'};return _0x14d908;})});}_0xccd2ac=_['merge']({},_0xccd2ac,_0x679e77[_0x4840('0x5b')]);return _0xe4b404['getGroups'](_0xccd2ac);}})[_0x4840('0x12')](function(_0x53fa60){if(_0x53fa60){_0x17a776=_0x53fa60[_0x4840('0x4a')];if(!_0x679e77['query'][_0x4840('0xc4')](_0x4840('0xcb'))){_0xccd2ac[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x679e77[_0x4840('0x3f')]['limit']);_0xccd2ac['offset']=qs[_0x4840('0x1e')](_0x679e77[_0x4840('0x3f')]['offset']);}return _0xe4b404['getGroups'](_0xccd2ac);}})[_0x4840('0x12')](function(_0x37e26a){if(_0x37e26a){return _0x37e26a?{'count':_0x17a776,'rows':_0x37e26a}:null;}})[_0x4840('0x12')](respondWithResult(_0x57aa1d,null))[_0x4840('0x53')](handleError(_0x57aa1d,null));};exports[_0x4840('0xd4')]=function(_0x5bf56d,_0x599d1c){var _0x51d9d1={'raw':!![],'where':{}};var _0x421e0f={};var _0x349fdf={'count':0x0,'rows':[]};return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x5bf56d[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x599d1c,null))[_0x4840('0x12')](function(_0x534738){if(_0x534738){_0x421e0f[_0x4840('0x56')]=_[_0x4840('0x57')](db['VoiceRecording'][_0x4840('0x37')]);_0x421e0f[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x5bf56d[_0x4840('0x3f')]);_0x421e0f['filters']=_[_0x4840('0x59')](_0x421e0f['model'],_0x421e0f[_0x4840('0x3f')]);_0x51d9d1[_0x4840('0x45')]=_['intersection'](_0x421e0f[_0x4840('0x56')],qs[_0x4840('0xce')](_0x5bf56d[_0x4840('0x3f')]['fields']));_0x51d9d1[_0x4840('0x45')]=_0x51d9d1[_0x4840('0x45')][_0x4840('0x4a')]?_0x51d9d1[_0x4840('0x45')]:_0x421e0f[_0x4840('0x56')];if(!_0x5bf56d[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x51d9d1[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x5bf56d['query'][_0x4840('0x1f')]);_0x51d9d1['offset']=qs['offset'](_0x5bf56d[_0x4840('0x3f')][_0x4840('0x1e')]);}_0x51d9d1[_0x4840('0xcf')]=qs['sort'](_0x5bf56d[_0x4840('0x3f')][_0x4840('0xc3')]);_0x51d9d1[_0x4840('0x3e')]=qs[_0x4840('0x58')](_[_0x4840('0xd0')](_0x5bf56d[_0x4840('0x3f')],_0x421e0f[_0x4840('0x58')]));_0x51d9d1[_0x4840('0x3e')]['UserId']=_0x534738['id'];if(_0x5bf56d['query'][_0x4840('0x2d')]){_0x51d9d1[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x51d9d1[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x51d9d1[_0x4840('0x45')],function(_0x64a238){var _0x39dcfb={};_0x39dcfb[_0x64a238]={'$like':'%'+_0x5bf56d[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x39dcfb;})});}_0x51d9d1=_[_0x4840('0x5a')]({},_0x51d9d1,_0x5bf56d['options']);return db[_0x4840('0xd5')]['count']({'where':_0x51d9d1[_0x4840('0x3e')]})[_0x4840('0x12')](function(_0x368df4){_0x349fdf[_0x4840('0xd6')]=_0x368df4;if(_0x5bf56d[_0x4840('0x3f')][_0x4840('0x40')]){_0x51d9d1[_0x4840('0x42')]=[{'all':!![]}];}return db[_0x4840('0xd5')]['findAll'](_0x51d9d1);})[_0x4840('0x12')](function(_0x1eed10){_0x349fdf[_0x4840('0x48')]=_0x1eed10;return _0x349fdf;});}})[_0x4840('0x12')](respondWithFilteredResult(_0x599d1c,_0x51d9d1))[_0x4840('0x53')](handleError(_0x599d1c,null));};exports[_0x4840('0xd7')]=function(_0x3ee57f,_0x40dbf0){var _0xc4ca91={'raw':!![],'where':{}};var _0x5a8db8={};var _0x12f408={'count':0x0,'rows':[]};return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x3ee57f[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x40dbf0,null))[_0x4840('0x12')](function(_0xcc0b26){if(_0xcc0b26){_0x5a8db8[_0x4840('0x56')]=_[_0x4840('0x57')](db[_0x4840('0xd8')][_0x4840('0x37')]);_0x5a8db8[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x3ee57f[_0x4840('0x3f')]);_0x5a8db8['filters']=_[_0x4840('0x59')](_0x5a8db8[_0x4840('0x56')],_0x5a8db8[_0x4840('0x3f')]);_0xc4ca91[_0x4840('0x45')]=_['intersection'](_0x5a8db8[_0x4840('0x56')],qs[_0x4840('0xce')](_0x3ee57f['query'][_0x4840('0xce')]));_0xc4ca91['attributes']=_0xc4ca91['attributes'][_0x4840('0x4a')]?_0xc4ca91[_0x4840('0x45')]:_0x5a8db8[_0x4840('0x56')];if(!_0x3ee57f[_0x4840('0x3f')][_0x4840('0xc4')]('nolimit')){_0xc4ca91[_0x4840('0x1f')]=qs['limit'](_0x3ee57f['query']['limit']);_0xc4ca91[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x3ee57f[_0x4840('0x3f')][_0x4840('0x1e')]);}_0xc4ca91[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x3ee57f[_0x4840('0x3f')]['sort']);_0xc4ca91[_0x4840('0x3e')]=qs['filters'](_[_0x4840('0xd0')](_0x3ee57f['query'],_0x5a8db8[_0x4840('0x58')]));_0xc4ca91['where']['UserId']=_0xcc0b26['id'];if(_0x3ee57f['query'][_0x4840('0x2d')]){_0xc4ca91[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0xc4ca91[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0xc4ca91[_0x4840('0x45')],function(_0xc83ffc){var _0x4110b0={};_0x4110b0[_0xc83ffc]={'$like':'%'+_0x3ee57f[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x4110b0;})});}_0xc4ca91=_[_0x4840('0x5a')]({},_0xc4ca91,_0x3ee57f['options']);return db[_0x4840('0xd8')][_0x4840('0xd6')]({'where':_0xc4ca91[_0x4840('0x3e')]})[_0x4840('0x12')](function(_0x4d1af6){_0x12f408[_0x4840('0xd6')]=_0x4d1af6;if(_0x3ee57f[_0x4840('0x3f')][_0x4840('0x40')]){_0xc4ca91[_0x4840('0x42')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4840('0x47')](_0xc4ca91);})[_0x4840('0x12')](function(_0x1fc520){_0x12f408[_0x4840('0x48')]=_0x1fc520;return _0x12f408;});}})[_0x4840('0x12')](respondWithFilteredResult(_0x40dbf0,_0xc4ca91))[_0x4840('0x53')](handleError(_0x40dbf0,null));};exports['getChatInteractions']=function(_0x4554ed,_0x1a8817){var _0x3affc9={};var _0x5dff6e={};var _0x3e0dde;var _0x27d1b7;return db['User'][_0x4840('0x8d')]({'where':{'id':_0x4554ed[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x1a8817,null))[_0x4840('0x12')](function(_0x471a90){if(_0x471a90){_0x3e0dde=_0x471a90;_0x5dff6e[_0x4840('0x56')]=_[_0x4840('0x57')](db['ChatInteraction'][_0x4840('0x37')]);_0x5dff6e['query']=_['keys'](_0x4554ed[_0x4840('0x3f')]);_0x5dff6e[_0x4840('0x58')]=_[_0x4840('0x59')](_0x5dff6e[_0x4840('0x56')],_0x5dff6e['query']);_0x3affc9['attributes']=_[_0x4840('0x59')](_0x5dff6e[_0x4840('0x56')],qs[_0x4840('0xce')](_0x4554ed[_0x4840('0x3f')][_0x4840('0xce')]));_0x3affc9[_0x4840('0x45')]=_0x3affc9[_0x4840('0x45')]['length']?_0x3affc9['attributes']:_0x5dff6e[_0x4840('0x56')];_0x3affc9[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x4554ed[_0x4840('0x3f')][_0x4840('0xc3')]);_0x3affc9[_0x4840('0x3e')]=qs[_0x4840('0x58')](_['pick'](_0x4554ed['query'],_0x5dff6e[_0x4840('0x58')]));if(_0x4554ed[_0x4840('0x3f')][_0x4840('0x2d')]){_0x3affc9[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x3affc9[_0x4840('0x3e')],{'$or':_['map'](_0x3affc9[_0x4840('0x45')],function(_0x3657d1){var _0xa39fcf={};_0xa39fcf[_0x3657d1]={'$like':'%'+_0x4554ed['query']['filter']+'%'};return _0xa39fcf;})});}_0x3affc9=_[_0x4840('0x5a')]({},_0x3affc9,_0x4554ed[_0x4840('0x5b')]);return _0x3e0dde[_0x4840('0xd9')](_0x3affc9);}})[_0x4840('0x12')](function(_0x1c4e0b){if(_0x1c4e0b){_0x27d1b7=_0x1c4e0b[_0x4840('0x4a')];if(!_0x4554ed[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x3affc9[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x4554ed[_0x4840('0x3f')][_0x4840('0x1f')]);_0x3affc9[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x4554ed[_0x4840('0x3f')]['offset']);}return _0x3e0dde['getChatInteractions'](_0x3affc9);}})[_0x4840('0x12')](function(_0x262020){if(_0x262020){return _0x262020?{'count':_0x27d1b7,'rows':_0x262020}:null;}})[_0x4840('0x12')](respondWithResult(_0x1a8817,null))[_0x4840('0x53')](handleError(_0x1a8817,null));};exports[_0x4840('0xda')]=function(_0x51212c,_0x15ef28){var _0x5ddaff={};var _0x4b17ca={};var _0x1df200;var _0x48d762;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x51212c[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x15ef28,null))['then'](function(_0x10e4f7){if(_0x10e4f7){_0x1df200=_0x10e4f7;_0x4b17ca[_0x4840('0x56')]=_[_0x4840('0x57')](db[_0x4840('0xdb')][_0x4840('0x37')]);_0x4b17ca[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x51212c[_0x4840('0x3f')]);_0x4b17ca[_0x4840('0x58')]=_[_0x4840('0x59')](_0x4b17ca[_0x4840('0x56')],_0x4b17ca[_0x4840('0x3f')]);_0x5ddaff[_0x4840('0x45')]=_[_0x4840('0x59')](_0x4b17ca[_0x4840('0x56')],qs[_0x4840('0xce')](_0x51212c['query'][_0x4840('0xce')]));_0x5ddaff[_0x4840('0x45')]=_0x5ddaff[_0x4840('0x45')]['length']?_0x5ddaff[_0x4840('0x45')]:_0x4b17ca[_0x4840('0x56')];_0x5ddaff[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x51212c[_0x4840('0x3f')][_0x4840('0xc3')]);_0x5ddaff['where']=qs[_0x4840('0x58')](_[_0x4840('0xd0')](_0x51212c[_0x4840('0x3f')],_0x4b17ca['filters']));if(_0x51212c['query']['filter']){_0x5ddaff[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x5ddaff['where'],{'$or':_[_0x4840('0x2e')](_0x5ddaff[_0x4840('0x45')],function(_0xfec660){var _0x133d37={};_0x133d37[_0xfec660]={'$like':'%'+_0x51212c[_0x4840('0x3f')]['filter']+'%'};return _0x133d37;})});}_0x5ddaff=_[_0x4840('0x5a')]({},_0x5ddaff,_0x51212c[_0x4840('0x5b')]);return _0x1df200[_0x4840('0xda')](_0x5ddaff);}})[_0x4840('0x12')](function(_0x114468){if(_0x114468){_0x48d762=_0x114468[_0x4840('0x4a')];if(!_0x51212c[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x5ddaff[_0x4840('0x1f')]=qs['limit'](_0x51212c[_0x4840('0x3f')][_0x4840('0x1f')]);_0x5ddaff[_0x4840('0x1e')]=qs['offset'](_0x51212c[_0x4840('0x3f')][_0x4840('0x1e')]);}return _0x1df200[_0x4840('0xda')](_0x5ddaff);}})['then'](function(_0x3d122a){if(_0x3d122a){return _0x3d122a?{'count':_0x48d762,'rows':_0x3d122a}:null;}})[_0x4840('0x12')](respondWithResult(_0x15ef28,null))[_0x4840('0x53')](handleError(_0x15ef28,null));};exports[_0x4840('0xdc')]=function(_0x4e664d,_0x1fd425){var _0x1f5cd8={'raw':!![],'where':{}};var _0x525bef={};var _0x31812f={'count':0x0,'rows':[]};return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x4e664d[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x1fd425,null))[_0x4840('0x12')](function(_0x5dd042){if(_0x5dd042){_0x525bef[_0x4840('0x56')]=_['keys'](db[_0x4840('0xdd')]['rawAttributes']);_0x525bef[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x4e664d[_0x4840('0x3f')]);_0x525bef[_0x4840('0x58')]=_['intersection'](_0x525bef[_0x4840('0x56')],_0x525bef['query']);_0x1f5cd8['attributes']=_[_0x4840('0x59')](_0x525bef[_0x4840('0x56')],qs[_0x4840('0xce')](_0x4e664d['query']['fields']));_0x1f5cd8[_0x4840('0x45')]=_0x1f5cd8[_0x4840('0x45')][_0x4840('0x4a')]?_0x1f5cd8[_0x4840('0x45')]:_0x525bef[_0x4840('0x56')];if(!_0x4e664d[_0x4840('0x3f')]['hasOwnProperty'](_0x4840('0xcb'))){_0x1f5cd8[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x4e664d['query']['limit']);_0x1f5cd8['offset']=qs[_0x4840('0x1e')](_0x4e664d[_0x4840('0x3f')][_0x4840('0x1e')]);}_0x1f5cd8[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x4e664d['query'][_0x4840('0xc3')]);_0x1f5cd8[_0x4840('0x3e')]=qs['filters'](_[_0x4840('0xd0')](_0x4e664d[_0x4840('0x3f')],_0x525bef[_0x4840('0x58')]));_0x1f5cd8['where'][_0x4840('0xde')]=_0x5dd042['id'];if(_0x4e664d[_0x4840('0x3f')][_0x4840('0x2d')]){_0x1f5cd8[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x1f5cd8[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x1f5cd8[_0x4840('0x45')],function(_0x529383){var _0x439da8={};_0x439da8[_0x529383]={'$like':'%'+_0x4e664d['query'][_0x4840('0x2d')]+'%'};return _0x439da8;})});}_0x1f5cd8=_[_0x4840('0x5a')]({},_0x1f5cd8,_0x4e664d[_0x4840('0x5b')]);return db[_0x4840('0xdd')][_0x4840('0xd6')]({'where':_0x1f5cd8[_0x4840('0x3e')]})[_0x4840('0x12')](function(_0x249b71){_0x31812f[_0x4840('0xd6')]=_0x249b71;if(_0x4e664d[_0x4840('0x3f')][_0x4840('0x40')]){_0x1f5cd8[_0x4840('0x42')]=[{'all':!![]}];}return db[_0x4840('0xdd')][_0x4840('0x47')](_0x1f5cd8);})[_0x4840('0x12')](function(_0x2c3136){_0x31812f[_0x4840('0x48')]=_0x2c3136;return _0x31812f;});}})[_0x4840('0x12')](respondWithFilteredResult(_0x1fd425,_0x1f5cd8))[_0x4840('0x53')](handleError(_0x1fd425,null));};exports[_0x4840('0xdf')]=function(_0x1fa7c3,_0x1853b7){var _0x5d2862={};var _0x36835c={};var _0x3b1153;var _0x254972;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x1fa7c3[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x1853b7,null))[_0x4840('0x12')](function(_0x49c85f){if(_0x49c85f){_0x3b1153=_0x49c85f;_0x36835c[_0x4840('0x56')]=_[_0x4840('0x57')](db['SmsInteraction'][_0x4840('0x37')]);_0x36835c[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x1fa7c3['query']);_0x36835c[_0x4840('0x58')]=_[_0x4840('0x59')](_0x36835c[_0x4840('0x56')],_0x36835c[_0x4840('0x3f')]);_0x5d2862[_0x4840('0x45')]=_[_0x4840('0x59')](_0x36835c[_0x4840('0x56')],qs[_0x4840('0xce')](_0x1fa7c3[_0x4840('0x3f')][_0x4840('0xce')]));_0x5d2862[_0x4840('0x45')]=_0x5d2862[_0x4840('0x45')][_0x4840('0x4a')]?_0x5d2862[_0x4840('0x45')]:_0x36835c['model'];_0x5d2862[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x1fa7c3[_0x4840('0x3f')][_0x4840('0xc3')]);_0x5d2862[_0x4840('0x3e')]=qs[_0x4840('0x58')](_['pick'](_0x1fa7c3[_0x4840('0x3f')],_0x36835c[_0x4840('0x58')]));if(_0x1fa7c3[_0x4840('0x3f')][_0x4840('0x2d')]){_0x5d2862[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x5d2862[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x5d2862[_0x4840('0x45')],function(_0x308298){var _0x745e02={};_0x745e02[_0x308298]={'$like':'%'+_0x1fa7c3[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x745e02;})});}_0x5d2862=_[_0x4840('0x5a')]({},_0x5d2862,_0x1fa7c3[_0x4840('0x5b')]);return _0x3b1153[_0x4840('0xdf')](_0x5d2862);}})[_0x4840('0x12')](function(_0x60c991){if(_0x60c991){_0x254972=_0x60c991[_0x4840('0x4a')];if(!_0x1fa7c3[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x5d2862[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x1fa7c3[_0x4840('0x3f')]['limit']);_0x5d2862[_0x4840('0x1e')]=qs['offset'](_0x1fa7c3['query'][_0x4840('0x1e')]);}return _0x3b1153['getSmsInteractions'](_0x5d2862);}})[_0x4840('0x12')](function(_0x165499){if(_0x165499){return _0x165499?{'count':_0x254972,'rows':_0x165499}:null;}})[_0x4840('0x12')](respondWithResult(_0x1853b7,null))['catch'](handleError(_0x1853b7,null));};exports['getFaxInteractions']=function(_0x3c44f4,_0x543760){var _0x2a2dc6={};var _0x593718={};var _0x581968;var _0x2e176e;return db['User'][_0x4840('0x8d')]({'where':{'id':_0x3c44f4[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x543760,null))[_0x4840('0x12')](function(_0x1587b5){if(_0x1587b5){_0x581968=_0x1587b5;_0x593718[_0x4840('0x56')]=_[_0x4840('0x57')](db[_0x4840('0xe0')]['rawAttributes']);_0x593718[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x3c44f4[_0x4840('0x3f')]);_0x593718[_0x4840('0x58')]=_[_0x4840('0x59')](_0x593718[_0x4840('0x56')],_0x593718[_0x4840('0x3f')]);_0x2a2dc6[_0x4840('0x45')]=_['intersection'](_0x593718[_0x4840('0x56')],qs['fields'](_0x3c44f4[_0x4840('0x3f')]['fields']));_0x2a2dc6[_0x4840('0x45')]=_0x2a2dc6[_0x4840('0x45')][_0x4840('0x4a')]?_0x2a2dc6['attributes']:_0x593718[_0x4840('0x56')];_0x2a2dc6['order']=qs[_0x4840('0xc3')](_0x3c44f4[_0x4840('0x3f')][_0x4840('0xc3')]);_0x2a2dc6['where']=qs[_0x4840('0x58')](_[_0x4840('0xd0')](_0x3c44f4['query'],_0x593718['filters']));if(_0x3c44f4[_0x4840('0x3f')][_0x4840('0x2d')]){_0x2a2dc6[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x2a2dc6[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x2a2dc6[_0x4840('0x45')],function(_0x35ef69){var _0x15c2fa={};_0x15c2fa[_0x35ef69]={'$like':'%'+_0x3c44f4[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x15c2fa;})});}_0x2a2dc6=_[_0x4840('0x5a')]({},_0x2a2dc6,_0x3c44f4[_0x4840('0x5b')]);return _0x581968['getFaxInteractions'](_0x2a2dc6);}})['then'](function(_0x520b51){if(_0x520b51){_0x2e176e=_0x520b51[_0x4840('0x4a')];if(!_0x3c44f4[_0x4840('0x3f')][_0x4840('0xc4')]('nolimit')){_0x2a2dc6[_0x4840('0x1f')]=qs[_0x4840('0x1f')](_0x3c44f4['query'][_0x4840('0x1f')]);_0x2a2dc6[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x3c44f4[_0x4840('0x3f')][_0x4840('0x1e')]);}return _0x581968[_0x4840('0xe1')](_0x2a2dc6);}})[_0x4840('0x12')](function(_0x4a3824){if(_0x4a3824){return _0x4a3824?{'count':_0x2e176e,'rows':_0x4a3824}:null;}})[_0x4840('0x12')](respondWithResult(_0x543760,null))['catch'](handleError(_0x543760,null));};exports[_0x4840('0xe2')]=function(_0x582cd6,_0xf96ef9){var _0x56aebb={};var _0x1d31d9={};var _0x36a7b6;var _0x5f4f1f;return db['User'][_0x4840('0x8d')]({'where':{'id':_0x582cd6[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0xf96ef9,null))[_0x4840('0x12')](function(_0x3b1f63){if(_0x3b1f63){_0x36a7b6=_0x3b1f63;_0x1d31d9['model']=_[_0x4840('0x57')](db[_0x4840('0xe3')][_0x4840('0x37')]);_0x1d31d9['query']=_[_0x4840('0x57')](_0x582cd6[_0x4840('0x3f')]);_0x1d31d9[_0x4840('0x58')]=_['intersection'](_0x1d31d9[_0x4840('0x56')],_0x1d31d9[_0x4840('0x3f')]);_0x56aebb[_0x4840('0x45')]=_[_0x4840('0x59')](_0x1d31d9[_0x4840('0x56')],qs['fields'](_0x582cd6['query'][_0x4840('0xce')]));_0x56aebb['attributes']=_0x56aebb['attributes'][_0x4840('0x4a')]?_0x56aebb['attributes']:_0x1d31d9[_0x4840('0x56')];_0x56aebb[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x582cd6[_0x4840('0x3f')][_0x4840('0xc3')]);_0x56aebb[_0x4840('0x3e')]=qs[_0x4840('0x58')](_['pick'](_0x582cd6[_0x4840('0x3f')],_0x1d31d9[_0x4840('0x58')]));if(_0x582cd6[_0x4840('0x3f')][_0x4840('0x2d')]){_0x56aebb[_0x4840('0x3e')]=_['merge'](_0x56aebb[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x56aebb['attributes'],function(_0x675fab){var _0x4de9b3={};_0x4de9b3[_0x675fab]={'$like':'%'+_0x582cd6[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x4de9b3;})});}_0x56aebb=_[_0x4840('0x5a')]({},_0x56aebb,_0x582cd6[_0x4840('0x5b')]);return _0x36a7b6[_0x4840('0xe2')](_0x56aebb);}})[_0x4840('0x12')](function(_0x6483ee){if(_0x6483ee){_0x5f4f1f=_0x6483ee['length'];if(!_0x582cd6['query']['hasOwnProperty'](_0x4840('0xcb'))){_0x56aebb[_0x4840('0x1f')]=qs['limit'](_0x582cd6[_0x4840('0x3f')][_0x4840('0x1f')]);_0x56aebb[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x582cd6[_0x4840('0x3f')][_0x4840('0x1e')]);}return _0x36a7b6[_0x4840('0xe2')](_0x56aebb);}})[_0x4840('0x12')](function(_0x4bcd73){if(_0x4bcd73){return _0x4bcd73?{'count':_0x5f4f1f,'rows':_0x4bcd73}:null;}})['then'](respondWithResult(_0xf96ef9,null))['catch'](handleError(_0xf96ef9,null));};exports['login']=function(_0x3965d6,_0x477d08,_0x5dbcde){var _0x2ad2d7;var _0x321938;var _0x4edeb4;var _0x153943=!_[_0x4840('0x66')](_0x3965d6[_0x4840('0x55')]['id'])?_0x3965d6['params']['id']:!_[_0x4840('0x66')](_0x3965d6[_0x4840('0x7a')]['id'])?_0x3965d6[_0x4840('0x7a')]['id']:null;return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0x153943,'role':{'$or':[_0x4840('0x29'),'user',_0x4840('0x25')]}},'attributes':['id',_0x4840('0x33'),_0x4840('0xe4'),'mobile',_0x4840('0x24'),_0x4840('0x62'),_0x4840('0x95')]})['then'](function(_0xf69017){if(_0xf69017){if(_0xf69017['role']==='agent'){_0x2ad2d7=_0xf69017;if(_0x3965d6[_0x4840('0x5d')]['interface']){_0x4edeb4=util[_0x4840('0xa0')](_0x4840('0xe5'),_0x2ad2d7[_0x3965d6[_0x4840('0x5d')][_0x4840('0x9f')]]);}else if(_0x3965d6[_0x4840('0x5d')][_0x4840('0xe6')]){_0x4edeb4=util[_0x4840('0xa0')](_0x4840('0xa1'),_0x3965d6[_0x4840('0x5d')][_0x4840('0xe6')]);}else{_0x4edeb4=util[_0x4840('0xa0')](_0x4840('0xa1'),_0x2ad2d7[_0x4840('0x33')]);}socket['to'](util[_0x4840('0xa0')](_0x4840('0xe7'),_0x2ad2d7[_0x4840('0x33')]))['emit']('user:forcelogout',{'user':{'id':_0x2ad2d7['id'],'name':_0x2ad2d7[_0x4840('0x33')]},'ip':_0x3965d6['headers'][_0x4840('0xe8')]||_0x3965d6['connection'][_0x4840('0xe9')]||_0x3965d6['socket'][_0x4840('0xe9')]||_0x3965d6[_0x4840('0xea')]['socket'][_0x4840('0xe9')]});return db['UserVoiceQueueRt'][_0x4840('0x28')]({'where':{'membername':_0x2ad2d7[_0x4840('0x33')]},'individualHooks':!![]});}}else{throw new db[(_0x4840('0x89'))]['ValidationError'](_0x4840('0xeb'));}})[_0x4840('0x12')](function(){if(_0x2ad2d7){return _0x2ad2d7[_0x4840('0xec')]({'raw':!![]});}})['then'](function(_0x49eb4f){if(_0x2ad2d7){if(_0x49eb4f){_0x321938=_0x49eb4f;if(_0x321938[_0x4840('0x4a')]){var _0x50886b=_0x321938[_0x4840('0x2e')](function(_0x48d362){var _0x382018={'membername':_0x2ad2d7[_0x4840('0x33')],'UserId':_0x2ad2d7['id'],'queue_name':_0x48d362['name'],'VoiceQueueId':_0x48d362['id'],'interface':_0x4edeb4,'paused':_0x2ad2d7[_0x4840('0x95')]||![],'penalty':_0x48d362[_0x4840('0xed')]||0x0};return db[_0x4840('0xa2')][_0x4840('0xa3')](_0x382018);});return Promise[_0x4840('0x52')](_0x50886b);}}}})[_0x4840('0x12')](function(){if(_0x2ad2d7){return db['MemberReport'][_0x4840('0x47')]({'where':{'membername':_0x2ad2d7[_0x4840('0x33')],'exitAt':null}});}})[_0x4840('0x12')](function(_0x204426){if(_0x2ad2d7){var _0x254eec=[];_0x204426[_0x4840('0xee')](function(_0x153e54){_0x254eec[_0x4840('0x46')](_0x153e54[_0x4840('0x23')]({'exitAt':moment()[_0x4840('0xa0')](_0x4840('0xef'))}));});return Promise[_0x4840('0x52')](_0x254eec);}})['then'](function(){if(_0x2ad2d7){var _0x568bec=[];var _0x13b023=[];var _0x48f7eb=utils['getChannels']();var _0x547dbf={'membername':_0x2ad2d7[_0x4840('0x33')],'interface':_0x4edeb4,'enterAt':moment()[_0x4840('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2ad2d7['role'],'internal':_0x2ad2d7[_0x4840('0x62')]};_0x48f7eb[_0x4840('0xee')](function(_0x43b397){_0x568bec[_0x4840('0x46')](_['merge']({'channel':_0x43b397,'type':_0x4840('0xf0'),'data1':_0x3965d6[_0x4840('0x5d')][_0x4840('0xf1')],'data2':_0x4edeb4},_0x547dbf));if(_0x2ad2d7['loginInPause']){_0x13b023[_0x4840('0x46')](_[_0x4840('0x5a')]({'channel':_0x43b397,'type':_0x4840('0xf2'),'data1':'LOGININPAUSE'},_0x547dbf));}});return db[_0x4840('0xf3')][_0x4840('0xf4')](_0x568bec[_0x4840('0xc1')](_0x13b023),{'individualHooks':!![]});}})['then'](function(){if(_0x2ad2d7){return _0x2ad2d7[_0x4840('0x23')]({'online':!![],'lastLoginAt':moment()[_0x4840('0xa0')](_0x4840('0xef')),'voicePause':_0x2ad2d7[_0x4840('0x95')]||![],'mailPause':_0x2ad2d7[_0x4840('0x95')]||![],'chatPause':_0x2ad2d7[_0x4840('0x95')]||![],'faxPause':_0x2ad2d7[_0x4840('0x95')]||![],'smsPause':_0x2ad2d7[_0x4840('0x95')]||![],'openchannelPause':_0x2ad2d7[_0x4840('0x95')]||![],'whatsappPause':_0x2ad2d7[_0x4840('0x95')]||![],'pauseType':_0x2ad2d7[_0x4840('0x95')]?_0x4840('0xf5'):null,'interface':_0x4edeb4,'lastPauseAt':moment()[_0x4840('0xa0')](_0x4840('0xef'))});}})['then'](function(_0x349929){if(_0x3965d6[_0x4840('0xf6')]){return _0x5dbcde();}else{return Promise[_0x4840('0xf7')](_0x349929)[_0x4840('0x12')](respondWithResult(_0x477d08,null));}})[_0x4840('0x53')](handleError(_0x477d08,null));};exports['logout']=function(_0x2378a6,_0x4f56d0){var _0x30ec9c;return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0x2378a6[_0x4840('0x55')]['id'],'role':_0x4840('0x25')},'attributes':['id',_0x4840('0x33'),'role']})[_0x4840('0x12')](handleEntityNotFound(_0x4f56d0,null))['then'](function(_0x20b385){if(_0x20b385){_0x30ec9c=_0x20b385;return db[_0x4840('0xa2')][_0x4840('0x28')]({'where':{'membername':_0x30ec9c[_0x4840('0x33')]},'individualHooks':!![]});}})[_0x4840('0x12')](function(){return db[_0x4840('0xf3')][_0x4840('0x47')]({'where':{'membername':_0x30ec9c[_0x4840('0x33')],'exitAt':null}});})['then'](function(_0x4cc9ac){var _0x38d986=[];_0x4cc9ac['forEach'](function(_0xd35051){_0x38d986[_0x4840('0x46')](_0xd35051[_0x4840('0x23')]({'exitAt':moment()[_0x4840('0xa0')](_0x4840('0xef'))}));});return Promise['all'](_0x38d986);})[_0x4840('0x12')](function(){return _0x30ec9c[_0x4840('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x4f56d0,null))['catch'](handleError(_0x4f56d0,null));};exports[_0x4840('0xf8')]=function(_0x3ddadc,_0x139b68){var _0x4507eb;return db[_0x4840('0xa2')][_0x4840('0x23')]({'paused':0x1},{'where':{'UserId':_0x3ddadc[_0x4840('0x55')]['id']},'individualHooks':!![]})['then'](function(){return db['User']['find']({'where':{'id':_0x3ddadc[_0x4840('0x55')]['id'],'role':_0x4840('0x25')},'attributes':['id',_0x4840('0x33'),_0x4840('0x24'),_0x4840('0x62'),'interface',_0x4840('0x94')]});})[_0x4840('0x12')](handleEntityNotFound(_0x139b68,null))['then'](function(_0x11d2c1){if(_0x11d2c1){_0x4507eb=_0x11d2c1;return respondWithRpcPromise(_0x4840('0xf9'),'pause',{'id':_0x4507eb['id'],'name':_0x4507eb['name'],'pause':!![]});}})[_0x4840('0x12')](function(){if(_0x4507eb){return db['MemberReport'][_0x4840('0x47')]({'where':{'membername':_0x4507eb[_0x4840('0x33')],'type':_0x4840('0xf2'),'exitAt':null}});}})[_0x4840('0x12')](function(_0x23b099){if(_0x23b099[_0x4840('0x4a')]){var _0x431b23=moment()[_0x4840('0xa0')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3e586b=0x0,_0x3eeb52=_0x23b099[_0x4840('0x4a')];_0x3e586b<_0x3eeb52;_0x3e586b++){_0x23b099[_0x3e586b][_0x4840('0xfa')]({'exitAt':_0x431b23});}}})[_0x4840('0x12')](function(){var _0x375304=[];var _0x51da17=utils[_0x4840('0xfb')]();_0x51da17['forEach'](function(_0x2acc70){_0x375304[_0x4840('0x46')]({'channel':_0x2acc70,'membername':_0x4507eb[_0x4840('0x33')],'interface':_[_0x4840('0x66')](_0x4507eb['interface'])?util['format']('SIP/%s',_0x4507eb[_0x4840('0x33')]):_0x4507eb[_0x4840('0x9f')],'type':_0x4840('0xf2'),'enterAt':moment()[_0x4840('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3ddadc['body'][_0x4840('0x39')]||_0x4840('0xfc'),'role':_0x4507eb[_0x4840('0x24')],'internal':_0x4507eb[_0x4840('0x62')]});});return db[_0x4840('0xf3')][_0x4840('0xf4')](_0x375304,{'individualHooks':!![]});})['then'](function(){return _0x4507eb[_0x4840('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3ddadc[_0x4840('0x5d')][_0x4840('0x39')]||_0x4840('0xfc'),'lastPauseAt':moment()[_0x4840('0xa0')](_0x4840('0xef'))});})[_0x4840('0x12')](respondWithResult(_0x139b68,null))[_0x4840('0x53')](handleError(_0x139b68,null));};exports[_0x4840('0xfd')]=function(_0x1b35e6,_0x44e7f4){if(_0x1b35e6[_0x4840('0x5d')]['channel']&&!utils[_0x4840('0x97')](_0x1b35e6['body'][_0x4840('0xa7')])){throw new APIBadRequestError(util['format'](_0x4840('0xfe'),_0x1b35e6[_0x4840('0x5d')][_0x4840('0xa7')]));}return db[_0x4840('0x36')][_0x4840('0x5c')]({'where':{'id':_0x1b35e6[_0x4840('0x55')]['id']},'attributes':['id','name','role',_0x4840('0x62'),_0x4840('0x9f'),'online','voicePause','mailPause','chatPause',_0x4840('0xff'),_0x4840('0x100'),'smsPause',_0x4840('0x101'),_0x4840('0x102'),_0x4840('0x103')]})[_0x4840('0x12')](function(_0x5a9cbc){if(!_0x5a9cbc){throw new APINotFoundError(util[_0x4840('0xa0')](_0x4840('0x104'),_0x1b35e6[_0x4840('0x55')]['id']));}return _0x5a9cbc['unpause'](_0x1b35e6[_0x4840('0x5d')][_0x4840('0xa7')]);})[_0x4840('0x12')](respondWithResult(_0x44e7f4,null))[_0x4840('0x53')](APIHandleError(_0x44e7f4));};exports[_0x4840('0x105')]=function(_0x393475,_0x461496){var _0x3d1f90={};var _0x41acc4={};var _0x6af807;var _0x2f5285;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x393475[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x461496,null))[_0x4840('0x12')](function(_0x90fa4e){if(_0x90fa4e){_0x6af807=_0x90fa4e;_0x41acc4[_0x4840('0x56')]=_[_0x4840('0x57')](db['Team'][_0x4840('0x37')]);_0x41acc4[_0x4840('0x3f')]=_[_0x4840('0x57')](_0x393475['query']);_0x41acc4[_0x4840('0x58')]=_[_0x4840('0x59')](_0x41acc4['model'],_0x41acc4[_0x4840('0x3f')]);_0x3d1f90[_0x4840('0x45')]=_[_0x4840('0x59')](_0x41acc4[_0x4840('0x56')],qs[_0x4840('0xce')](_0x393475[_0x4840('0x3f')]['fields']));_0x3d1f90[_0x4840('0x45')]=_0x3d1f90[_0x4840('0x45')]['length']?_0x3d1f90['attributes']:_0x41acc4[_0x4840('0x56')];_0x3d1f90[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x393475[_0x4840('0x3f')][_0x4840('0xc3')]);_0x3d1f90[_0x4840('0x3e')]=qs[_0x4840('0x58')](_['pick'](_0x393475[_0x4840('0x3f')],_0x41acc4[_0x4840('0x58')]));if(_0x393475[_0x4840('0x3f')]['filter']){_0x3d1f90[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x3d1f90[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x3d1f90['attributes'],function(_0x38ba51){var _0x4adaec={};_0x4adaec[_0x38ba51]={'$like':'%'+_0x393475[_0x4840('0x3f')]['filter']+'%'};return _0x4adaec;})});}_0x3d1f90=_[_0x4840('0x5a')]({},_0x3d1f90,_0x393475[_0x4840('0x5b')]);return _0x6af807[_0x4840('0x105')](_0x3d1f90);}})[_0x4840('0x12')](function(_0x866d22){if(_0x866d22){_0x2f5285=_0x866d22[_0x4840('0x4a')];if(!_0x393475['query']['hasOwnProperty'](_0x4840('0xcb'))){_0x3d1f90[_0x4840('0x1f')]=qs['limit'](_0x393475['query'][_0x4840('0x1f')]);_0x3d1f90['offset']=qs[_0x4840('0x1e')](_0x393475[_0x4840('0x3f')][_0x4840('0x1e')]);}return _0x6af807['getTeams'](_0x3d1f90);}})[_0x4840('0x12')](function(_0x5fba1){if(_0x5fba1){return _0x5fba1?{'count':_0x2f5285,'rows':_0x5fba1}:null;}})[_0x4840('0x12')](respondWithResult(_0x461496,null))[_0x4840('0x53')](handleError(_0x461496,null));};exports[_0x4840('0x106')]=function(_0x2c2a08,_0x20d4dd){var _0x1533a8=_0x2c2a08[_0x4840('0x55')]['id'];var _0x1c7649=_0x2c2a08['body']?_0x2c2a08[_0x4840('0x5d')][_0x4840('0x60')]:null;var _0x3e5ed6=[];return Promise[_0x4840('0xf7')]()['then'](function(){if(!_0x1c7649)throw new APIBadRequestError(_0x4840('0x107'));})['then'](function(){return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x1533a8}});})[_0x4840('0x12')](function(_0x2015a0){if(!_0x2015a0)throw new APINotFoundError(util['format'](_0x4840('0x104'),_0x2c2a08[_0x4840('0x55')]['id']));return db[_0x4840('0x108')][_0x4840('0x109')](function(_0x378466){return _0x2015a0['addTeams'](_0x1c7649,{'transaction':_0x378466})[_0x4840('0x12')](function(){return db['Team'][_0x4840('0x47')]({'where':{'id':{'$in':_0x1c7649}}});})['then'](function(_0x48c5c2){var _0x327f15=_[_0x4840('0x2e')](_0x48c5c2,function(_0x4fb8c9){return _0x4fb8c9['getAssociatedQueues']();});return Promise[_0x4840('0x52')](_0x327f15);})['then'](function(_0x4f7b9d){_0x3e5ed6=_['flattenDeep'](_0x4f7b9d);var _0x301825=_['map'](_0x3e5ed6,function(_0x1c3a95){return _0x1c3a95[_0x4840('0x10a')](_0x2015a0['id'],{'transaction':_0x378466});});return Promise[_0x4840('0x52')](_0x301825);})[_0x4840('0x12')](function(){if(!_0x2015a0[_0x4840('0x94')])return;var _0x135ef3=_[_0x4840('0x2d')](_0x3e5ed6,function(_0x375ff6){return _0x375ff6[_0x4840('0x10b')](_0x4840('0xa7'))==='Voice';});var _0xf91e00=_[_0x4840('0x2e')](_0x135ef3,function(_0x292df4){return db[_0x4840('0xa2')][_0x4840('0xa3')]({'membername':_0x2015a0[_0x4840('0x33')],'UserId':_0x2015a0['id'],'queue_name':_0x292df4['name'],'VoiceQueueId':_0x292df4['id'],'interface':_[_0x4840('0x66')](_0x2015a0[_0x4840('0x9f')])?util[_0x4840('0xa0')](_0x4840('0xa1'),_0x2015a0[_0x4840('0x33')]):_0x2015a0['interface'],'paused':_0x2015a0[_0x4840('0x96')]||![],'penalty':_0x2015a0[_0x4840('0x9c')]},{'transaction':_0x378466});});return Promise[_0x4840('0x52')](_0xf91e00);})['then'](function(){return db[_0x4840('0x10c')][_0x4840('0x47')]({'where':{'teamId':{'$in':_0x1c7649}}});})[_0x4840('0x12')](function(_0x4038e4){var _0x2e0713=_[_0x4840('0x2e')](_0x4038e4,function(_0x373dc2){return db[_0x4840('0x10d')][_0x4840('0x7d')]({'UserId':_0x2015a0['id'],'VoicePrefixId':_0x373dc2[_0x4840('0x10e')]},{'transaction':_0x378466});});return Promise[_0x4840('0x52')](_0x2e0713);});});})['then'](function(){for(var _0x2c7e31=0x0;_0x2c7e31<_0x3e5ed6[_0x4840('0x4a')];_0x2c7e31++){var _0x28789c=_0x3e5ed6[_0x2c7e31][_0x4840('0x10b')]('channel');var _0x118b47=_0x28789c+'QueueId';socket[_0x4840('0x26')](_0x4840('0x7a')+_0x28789c+_0x4840('0x10f'),{'UserId':_0x1533a8,['queueField']:_0x3e5ed6[_0x2c7e31]['id']});}})['then'](respondWithStatusCode(_0x20d4dd,null))['catch'](APIHandleError(_0x20d4dd));};exports[_0x4840('0x110')]=function(_0x3794a2,_0x2b6f8a){var _0x4d56be=_0x3794a2[_0x4840('0x55')]['id'];var _0x5a76f4=null;if(_0x3794a2[_0x4840('0x3f')][_0x4840('0x60')]){_0x5a76f4=_[_0x4840('0xa6')](_0x3794a2[_0x4840('0x3f')][_0x4840('0x60')])?_0x3794a2[_0x4840('0x3f')][_0x4840('0x60')]:[_0x3794a2[_0x4840('0x3f')][_0x4840('0x60')]];}var _0x200c9e=[];return Promise[_0x4840('0xf7')]()[_0x4840('0x12')](function(){if(!_0x5a76f4)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x4840('0x12')](function(){return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x4d56be}});})[_0x4840('0x12')](function(_0x28e5b4){if(!_0x28e5b4)throw new APINotFoundError(util[_0x4840('0xa0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3794a2[_0x4840('0x55')]['id']));return db[_0x4840('0x108')][_0x4840('0x109')](function(_0x1222de){return _0x28e5b4[_0x4840('0x110')](_0x5a76f4,{'transaction':_0x1222de})[_0x4840('0x12')](function(){return db[_0x4840('0x111')][_0x4840('0x47')]({'where':{'id':{'$in':_0x5a76f4}}});})[_0x4840('0x12')](function(_0x2d412b){var _0x21c105=_['map'](_0x2d412b,function(_0x505650){return _0x505650[_0x4840('0x112')]();});return Promise[_0x4840('0x52')](_0x21c105);})['then'](function(_0x56c6be){_0x200c9e=_[_0x4840('0x113')](_0x56c6be);var _0x1c03a3=_[_0x4840('0x2e')](_0x200c9e,function(_0x52115c){return _0x52115c[_0x4840('0x114')](_0x28e5b4['id'],{'transaction':_0x1222de});});return Promise['all'](_0x1c03a3);})[_0x4840('0x12')](function(){if(!_0x28e5b4[_0x4840('0x94')])return;var _0x59c061=_[_0x4840('0x2d')](_0x200c9e,function(_0x3b9126){return _0x3b9126[_0x4840('0x10b')]('channel')===_0x4840('0x115');});var _0xc0e44b=_[_0x4840('0x2e')](_0x59c061,function(_0x376820){return db[_0x4840('0xa2')][_0x4840('0x28')]({'where':{'VoiceQueueId':_0x376820['id'],'UserId':_0x28e5b4['id']},'transaction':_0x1222de});});return Promise[_0x4840('0x52')](_0xc0e44b);})['then'](function(){return db[_0x4840('0x10c')][_0x4840('0x47')]({'where':{'teamId':{'$in':_0x5a76f4}}});})[_0x4840('0x12')](function(_0x11fc5a){var _0x4da6e5=_['map'](_0x11fc5a,function(_0x3bcc2b){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x28e5b4['id'],'VoicePrefixId':_0x3bcc2b[_0x4840('0x10e')]}},{'transaction':_0x1222de});});return Promise[_0x4840('0x52')](_0x4da6e5);});});})[_0x4840('0x12')](function(){for(var _0x3f4e77=0x0;_0x3f4e77<_0x200c9e[_0x4840('0x4a')];_0x3f4e77++){var _0xf4f574=_0x200c9e[_0x3f4e77]['getDataValue']('channel');var _0x4501cf=_0xf4f574+'QueueId';socket[_0x4840('0x26')](_0x4840('0x7a')+_0xf4f574+'Queue:remove',{'UserId':_0x4d56be,['queueField']:_0x200c9e[_0x3f4e77]['id']});}})[_0x4840('0x12')](respondWithStatusCode(_0x2b6f8a,null))[_0x4840('0x53')](APIHandleError(_0x2b6f8a));};exports[_0x4840('0x116')]=function(_0x22693f,_0x4c5a76){var _0x4056e1={};var _0x22128e={};var _0x23f24a;var _0x56a9af;return db[_0x4840('0x36')][_0x4840('0x8d')]({'where':{'id':_0x22693f[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x4c5a76,null))[_0x4840('0x12')](function(_0x22b9cf){if(_0x22b9cf){_0x23f24a=_0x22b9cf;_0x22128e[_0x4840('0x56')]=_['keys'](db[_0x4840('0xc5')][_0x4840('0x37')]);_0x22128e[_0x4840('0x3f')]=_['keys'](_0x22693f[_0x4840('0x3f')]);_0x22128e[_0x4840('0x58')]=_[_0x4840('0x59')](_0x22128e[_0x4840('0x56')],_0x22128e[_0x4840('0x3f')]);_0x4056e1['attributes']=_[_0x4840('0x59')](_0x22128e['model'],qs['fields'](_0x22693f[_0x4840('0x3f')][_0x4840('0xce')]));_0x4056e1[_0x4840('0x45')]=_0x4056e1[_0x4840('0x45')][_0x4840('0x4a')]?_0x4056e1[_0x4840('0x45')]:_0x22128e[_0x4840('0x56')];_0x4056e1[_0x4840('0xcf')]=qs[_0x4840('0xc3')](_0x22693f[_0x4840('0x3f')]['sort']);_0x4056e1[_0x4840('0x3e')]=qs[_0x4840('0x58')](_[_0x4840('0xd0')](_0x22693f[_0x4840('0x3f')],_0x22128e[_0x4840('0x58')]));if(_0x22693f[_0x4840('0x3f')]['filter']){_0x4056e1['where']=_[_0x4840('0x5a')](_0x4056e1[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x4056e1[_0x4840('0x45')],function(_0x4ba636){var _0x3eefb7={};_0x3eefb7[_0x4ba636]={'$like':'%'+_0x22693f[_0x4840('0x3f')]['filter']+'%'};return _0x3eefb7;})});}_0x4056e1=_[_0x4840('0x5a')]({},_0x4056e1,_0x22693f[_0x4840('0x5b')]);return _0x23f24a[_0x4840('0x116')](_0x4056e1);}})['then'](function(_0x4cecb9){if(_0x4cecb9){_0x56a9af=_0x4cecb9[_0x4840('0x4a')];if(!_0x22693f[_0x4840('0x3f')][_0x4840('0xc4')](_0x4840('0xcb'))){_0x4056e1[_0x4840('0x1f')]=qs['limit'](_0x22693f[_0x4840('0x3f')][_0x4840('0x1f')]);_0x4056e1[_0x4840('0x1e')]=qs[_0x4840('0x1e')](_0x22693f[_0x4840('0x3f')][_0x4840('0x1e')]);}return _0x23f24a['getLists'](_0x4056e1);}})[_0x4840('0x12')](function(_0xf96982){if(_0xf96982){return _0xf96982?{'count':_0x56a9af,'rows':_0xf96982}:null;}})['then'](respondWithResult(_0x4c5a76,null))[_0x4840('0x53')](handleError(_0x4c5a76,null));};exports[_0x4840('0x117')]=function(_0x4fa3b5,_0x3fc7c6){var _0x25dec1={};var _0x165754={};var _0x38c7e0;return db[_0x4840('0x36')]['findOne']({'where':{'id':_0x4fa3b5[_0x4840('0x55')]['id']}})[_0x4840('0x12')](handleEntityNotFound(_0x3fc7c6,null))[_0x4840('0x12')](function(_0x354350){if(_0x354350){_0x38c7e0=_0x354350;_0x165754[_0x4840('0x56')]=_[_0x4840('0x57')](db['User']['rawAttributes']);_0x165754[_0x4840('0x3f')]=_['keys'](_0x4fa3b5[_0x4840('0x3f')]);_0x165754[_0x4840('0x58')]=_['intersection'](_0x165754[_0x4840('0x56')],_0x165754['query']);_0x25dec1[_0x4840('0x45')]=_[_0x4840('0x59')](_0x165754[_0x4840('0x56')],qs['fields'](_0x4fa3b5[_0x4840('0x3f')][_0x4840('0xce')]));_0x25dec1[_0x4840('0x45')]=_0x25dec1[_0x4840('0x45')][_0x4840('0x4a')]?_0x25dec1[_0x4840('0x45')]:_0x165754[_0x4840('0x56')];_0x25dec1['order']=qs[_0x4840('0xc3')](_0x4fa3b5[_0x4840('0x3f')]['sort']);_0x25dec1['where']=qs['filters'](_[_0x4840('0xd0')](_0x4fa3b5[_0x4840('0x3f')],_0x165754[_0x4840('0x58')]));if(_0x4fa3b5[_0x4840('0x3f')]['filter']){_0x25dec1[_0x4840('0x3e')]=_[_0x4840('0x5a')](_0x25dec1[_0x4840('0x3e')],{'$or':_[_0x4840('0x2e')](_0x25dec1[_0x4840('0x45')],function(_0x2b8fd0){var _0x24bc0c={};_0x24bc0c[_0x2b8fd0]={'$like':'%'+_0x4fa3b5[_0x4840('0x3f')][_0x4840('0x2d')]+'%'};return _0x24bc0c;})});}_0x25dec1[_0x4840('0x56')]=db[_0x4840('0x36')];_0x25dec1['as']=_0x4840('0x2a');_0x25dec1=_[_0x4840('0x5a')]({},_0x25dec1,_0x4fa3b5[_0x4840('0x5b')]);return _0x38c7e0[_0x4840('0xec')]({'include':[_0x25dec1]});}})[_0x4840('0x12')](function(_0x56c893){if(_0x56c893){var _0x272ca1={},_0x2ed3f9=[];for(var _0xa9648e=0x0;_0xa9648e<_0x56c893[_0x4840('0x4a')];_0xa9648e+=0x1){for(var _0x73b038=0x0,_0x29cc98;_0x73b038<_0x56c893[_0xa9648e][_0x4840('0x2a')][_0x4840('0x4a')];_0x73b038+=0x1){_0x29cc98=_0x56c893[_0xa9648e][_0x4840('0x2a')][_0x73b038]['get']({'plain':!![]});_0x272ca1[_0x29cc98['id']]=_0x29cc98;}}_0x272ca1=_['values'](_0x272ca1);for(var _0x4f320b=qs['offset'](_0x4fa3b5[_0x4840('0x3f')][_0x4840('0x1e')]);_0x4f320b<_0x272ca1[_0x4840('0x4a')]&&_0x2ed3f9[_0x4840('0x4a')]=_0x546729){_0xea118b=_0x546729;_0x416e38=0xc8;}else{_0x416e38=0xce;}_0x1200c3[_0x38d3('0x23')](_0x416e38);return _0x1200c3[_0x38d3('0x29')]('Content-Range',_0x103e54+'-'+_0xea118b+'/'+_0x546729)[_0x38d3('0x25')](_0x74e2c4);}return null;};}function saveUpdates(_0x43b47f){return function(_0x5e37ed){if(_0x5e37ed){return _0x5e37ed['update'](_0x43b47f)[_0x38d3('0x17')](function(_0x3d6335){if(_0x3d6335[_0x38d3('0x2a')]==='agent'){socket[_0x38d3('0x2b')](_0x38d3('0x2c')+_0x3d6335['id'],_0x3d6335);}return _0x3d6335;});}return null;};}function removeEntity(_0x585d0a){return function(_0x41eab1){if(_0x41eab1){return _0x41eab1['destroy']()['then'](function(){var _0x28b29d=_0x41eab1[_0x38d3('0x2d')]({'plain':!![]});if(_0x28b29d[_0x38d3('0x2a')]===_0x38d3('0x2e'))return;var _0xcc4c38=[{'name':'Users','value':_0x38d3('0x2f'),'ignore':!![]},{'name':_0x38d3('0x30'),'value':'agent','ignore':![]},{'name':_0x38d3('0x31'),'value':_0x38d3('0x32'),'ignore':![]}];var _0x186837=_(_0xcc4c38)[_0x38d3('0x33')]('ignore')[_0x38d3('0x34')](_0x38d3('0x35'))[_0x38d3('0x35')]();if(_['includes'](_0x186837,_0x28b29d[_0x38d3('0x2a')])){return;}var _0x1e80e5=_['find'](_0xcc4c38,['value',_0x28b29d[_0x38d3('0x2a')]])[_0x38d3('0x36')];return db[_0x38d3('0x37')][_0x38d3('0x38')]({'where':{'type':_0x1e80e5,'resourceId':_0x28b29d['id']}})['then'](function(){return _0x41eab1;});})[_0x38d3('0x17')](function(){_0x585d0a[_0x38d3('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20eafa){return function(_0x3a3e64){if(!_0x3a3e64){_0x20eafa['sendStatus'](0x194);}return _0x3a3e64;};}function handleError(_0x362620,_0x271e44){_0x271e44=_0x271e44||0x1f4;return function(_0x369e9c){logger[_0x38d3('0x1e')](_0x369e9c[_0x38d3('0x39')]);if(_0x369e9c[_0x38d3('0x36')]){delete _0x369e9c[_0x38d3('0x36')];}_0x362620[_0x38d3('0x23')](_0x271e44)[_0x38d3('0x3a')](_0x369e9c);};}exports[_0x38d3('0x3b')]=function(_0x33fea9,_0x1dd2ed){var _0x31c187={},_0x86c584={'count':0x0,'rows':[]};var _0x5d8aaf=_(db[_0x38d3('0x3c')][_0x38d3('0x3d')])[_0x38d3('0x34')](function(_0x3bdc17){return{'name':_0x3bdc17[_0x38d3('0x3e')],'type':_0x3bdc17[_0x38d3('0x3f')][_0x38d3('0x40')]};})[_0x38d3('0x33')](function(_0x2e1e1e){return!_[_0x38d3('0x41')](['password',_0x38d3('0x42')],_0x2e1e1e['name']);})[_0x38d3('0x35')]();_0x31c187=qs[_0x38d3('0x43')](_0x5d8aaf,_0x33fea9);var _0x6cf94e={'where':_0x31c187[_0x38d3('0x44')]};return db[_0x38d3('0x3c')]['count'](_0x6cf94e)[_0x38d3('0x17')](function(_0x40e97f){_0x86c584[_0x38d3('0x28')]=_0x40e97f;if(_0x33fea9['query'][_0x38d3('0x45')]){_0x31c187[_0x38d3('0x46')]=[{'all':!![]}];}if(_0x33fea9['query'][_0x38d3('0x47')]==='true'){_0x31c187[_0x38d3('0x46')]=[{'model':db[_0x38d3('0x48')],'as':_0x38d3('0x47')}];}if(!_[_0x38d3('0x41')](_0x31c187[_0x38d3('0x49')],'id')){_0x31c187['attributes']['push']('id');}return db[_0x38d3('0x3c')]['findAll'](_0x31c187);})[_0x38d3('0x17')](function(_0xc35a37){_0x86c584[_0x38d3('0x4a')]=_0xc35a37;if(_0x33fea9[_0x38d3('0x4b')][_0x38d3('0x4c')]===_0x38d3('0x4d')){var _0x4dd247=[];for(var _0x3d36b8=0x0;_0x3d36b8<_0x86c584[_0x38d3('0x4a')][_0x38d3('0x4e')];_0x3d36b8++){_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x50'),_0x86c584['rows'][_0x3d36b8][_0x38d3('0x51')]));_0x4dd247[_0x38d3('0x4f')](get_open_tabs('sms',_0x86c584[_0x38d3('0x4a')][_0x3d36b8]['dataValues']));_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x52'),_0x86c584[_0x38d3('0x4a')][_0x3d36b8]['dataValues']));_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x53'),_0x86c584[_0x38d3('0x4a')][_0x3d36b8][_0x38d3('0x51')]));_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x54'),_0x86c584[_0x38d3('0x4a')][_0x3d36b8][_0x38d3('0x51')]));_0x4dd247[_0x38d3('0x4f')](get_open_tabs('whatsapp',_0x86c584[_0x38d3('0x4a')][_0x3d36b8][_0x38d3('0x51')]));}return Promise[_0x38d3('0x55')](_0x4dd247)['then'](function(){return _0x86c584;});}else{return _0x86c584;}})[_0x38d3('0x17')](respondWithFilteredResult(_0x1dd2ed,_0x31c187))[_0x38d3('0x22')](handleError(_0x1dd2ed,null));};exports['show']=function(_0x213c24,_0x12d464){var _0x59295a={'raw':![],'where':{'id':_0x213c24['params']['id']}},_0x12f5c4={};_0x12f5c4['model']=_['differenceBy'](_['keys'](db[_0x38d3('0x3c')][_0x38d3('0x3d')]),[_0x38d3('0x56'),_0x38d3('0x42')]);_0x12f5c4[_0x38d3('0x4b')]=_['keys'](_0x213c24['query']);_0x12f5c4[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x12f5c4[_0x38d3('0x59')],_0x12f5c4[_0x38d3('0x4b')]);_0x59295a[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x12f5c4[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x213c24[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x59295a[_0x38d3('0x49')]=_0x59295a[_0x38d3('0x49')]['length']?_0x59295a['attributes']:_0x12f5c4['model'];if(_0x213c24['query'][_0x38d3('0x45')]){_0x59295a['include']=[{'all':!![]}];}if(_0x213c24[_0x38d3('0x4b')][_0x38d3('0x47')]===_0x38d3('0x4d')){_0x59295a[_0x38d3('0x46')]=[{'model':db[_0x38d3('0x48')],'as':_0x38d3('0x47')}];}_0x59295a=_[_0x38d3('0x5b')]({},_0x59295a,_0x213c24[_0x38d3('0x5c')]);if(!_['includes'](_0x59295a[_0x38d3('0x49')],'id')){_0x59295a[_0x38d3('0x49')][_0x38d3('0x4f')]('id');}return db[_0x38d3('0x3c')][_0x38d3('0x5d')](_0x59295a)['then'](handleEntityNotFound(_0x12d464,null))[_0x38d3('0x17')](function(_0x1fa7e9){var _0x9ab8ac=[];values=_0x1fa7e9;if(_0x213c24[_0x38d3('0x4b')][_0x38d3('0x4c')]===_0x38d3('0x4d')){_0x9ab8ac['push'](get_open_tabs(_0x38d3('0x50'),_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x5e'),_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x54'),_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs('whatsapp',_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x52'),_0x1fa7e9['dataValues']));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x53'),_0x1fa7e9['dataValues']));return Promise[_0x38d3('0x55')](_0x9ab8ac);}else{return values;}})[_0x38d3('0x17')](function(){return values;})[_0x38d3('0x17')](respondWithResult(_0x12d464,null))[_0x38d3('0x22')](handleError(_0x12d464,null));};exports[_0x38d3('0x5f')]=function(_0x3c4147,_0x502399){if(_0x3c4147['body']['id']){delete _0x3c4147[_0x38d3('0x60')]['id'];}delete _0x3c4147[_0x38d3('0x60')]['role'];return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x3c4147['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x502399,null))[_0x38d3('0x17')](saveUpdates(_0x3c4147[_0x38d3('0x60')],null))['then'](respondWithResult(_0x502399,null))[_0x38d3('0x22')](handleError(_0x502399,null));};exports[_0x38d3('0x61')]=function(_0x153d2a,_0x1c9122){return db['User'][_0x38d3('0x61')]()[_0x38d3('0x17')](respondWithResult(_0x1c9122,null))[_0x38d3('0x22')](handleError(_0x1c9122,null));};exports[_0x38d3('0x62')]=function(_0x4f9645,_0x1f21fe){return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x4f9645[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x1f21fe,null))[_0x38d3('0x17')](function(_0x487000){if(_0x487000){return _0x487000['addContacts'](_0x4f9645['body']['ids'],_[_0x38d3('0x64')](_0x4f9645[_0x38d3('0x60')],[_0x38d3('0x65'),'id'])||{});}})['then'](respondWithResult(_0x1f21fe,null))[_0x38d3('0x22')](handleError(_0x1f21fe,null));};function validateUser(_0x568f7a){return new Promise(function(_0x36656f,_0x348234){if(_0x568f7a['internal'])return _0x36656f(_0x568f7a);return db['Setting'][_0x38d3('0x66')](0x1)[_0x38d3('0x17')](function(_0x24f15f){if(_0x24f15f[_0x38d3('0x67')])authService[_0x38d3('0x68')](_0x568f7a['password']);db[_0x38d3('0x3c')][_0x38d3('0x69')](_0x38d3('0x6a'))['then'](function(_0xc79222){if(_[_0x38d3('0x6b')](_0xc79222)){_0x568f7a[_0x38d3('0x6a')]=_0x24f15f['min_internal']||0x1;return;}if(_[_0x38d3('0x6b')](_0x24f15f[_0x38d3('0x6c')])||_0x24f15f['min_internal']===_0xc79222){_0x568f7a[_0x38d3('0x6a')]=_0xc79222+0x1;return;}if(_0x24f15f[_0x38d3('0x6c')]>_0xc79222){_0x568f7a['internal']=_0x24f15f[_0x38d3('0x6c')];return;}return db[_0x38d3('0x6d')][_0x38d3('0x4b')](_0x38d3('0x6e'),{'type':db[_0x38d3('0x6d')][_0x38d3('0x6f')][_0x38d3('0x70')]})[_0x38d3('0x17')](function(_0x5734a6){if(_0x5734a6&&_0x5734a6[_0x38d3('0x4e')]){for(var _0x4ba94c=0x0,_0x17bceb=_0x5734a6['length'];_0x4ba94c<_0x17bceb&&_[_0x38d3('0x6b')](_0x568f7a[_0x38d3('0x6a')]);_0x4ba94c++){if(_0x24f15f[_0x38d3('0x6c')]<=_0x5734a6[_0x4ba94c][_0x38d3('0x71')]){_0x568f7a['internal']=_0x5734a6[_0x4ba94c][_0x38d3('0x71')];}else if(_0x24f15f[_0x38d3('0x6c')]>_0x5734a6[_0x4ba94c]['from']&&_0x24f15f['min_internal']<=_0x5734a6[_0x4ba94c]['to']){_0x568f7a[_0x38d3('0x6a')]=_0x24f15f[_0x38d3('0x6c')];}}}if(_[_0x38d3('0x6b')](_0x568f7a['internal'])){_0x568f7a[_0x38d3('0x6a')]=_0xc79222+0x1;}return _0x36656f(_0x568f7a);});});})[_0x38d3('0x22')](function(_0x2018d2){_0x348234(_0x2018d2);});});}function updateUser(_0x27cd0c){return new Promise(function(_0x11ac4c,_0x2bf2da){try{if(_0x27cd0c[_0x38d3('0x72')]){_0x27cd0c[_0x38d3('0x73')]=_0x27cd0c[_0x38d3('0x6a')];_0x27cd0c[_0x38d3('0x74')]={'mailbox':_0x27cd0c[_0x38d3('0x6a')],'password':_0x27cd0c['password'],'fullname':_0x27cd0c[_0x38d3('0x75')],'email':_0x27cd0c['email']};}if(_0x27cd0c[_0x38d3('0x2a')]===_0x38d3('0x76')){if(!_0x27cd0c[_0x38d3('0x77')])_0x27cd0c['permissions']=[_0x38d3('0x78'),_0x38d3('0x79'),_0x38d3('0x7a'),_0x38d3('0x7b'),'110','104',_0x38d3('0x7c'),_0x38d3('0x7d'),'107',_0x38d3('0x7e'),'109',_0x38d3('0x7f'),_0x38d3('0x80'),_0x38d3('0x81'),_0x38d3('0x82')];}_0x11ac4c(_0x27cd0c);}catch(_0x2c46ad){_0x2bf2da(_0x2c46ad);}});}exports['create']=function(_0x3f9204,_0x1193dd){if(_0x3f9204['user'][_0x38d3('0x2a')]===_0x38d3('0x76'))throw new Error(_0x38d3('0x83'));if(_0x3f9204['body'][_0x38d3('0x2a')]===_0x38d3('0x2f')&&_0x3f9204[_0x38d3('0x2f')][_0x38d3('0x2a')]!==_0x38d3('0x2e')){throw new Error(_0x38d3('0x84'));}if(_0x3f9204[_0x38d3('0x60')][_0x38d3('0x2a')]===_0x38d3('0x2e')&&_0x3f9204[_0x38d3('0x2f')]['role']!==_0x38d3('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x38d3('0x85')]([_0x3f9204[_0x38d3('0x60')]])[_0x38d3('0x17')](function(){return validateUser(_0x3f9204[_0x38d3('0x60')]);})[_0x38d3('0x17')](function(_0xb0f06e){return updateUser(_0xb0f06e)[_0x38d3('0x17')](function(_0x114ce2){if(_0x114ce2[_0x38d3('0x2a')]===_0x38d3('0x2e')){_0x114ce2['settingsEnabled']=_0x3f9204['user'][_0x38d3('0x86')];delete _0x114ce2[_0x38d3('0x87')];}return _0x114ce2;});})[_0x38d3('0x17')](function(_0x13e1f2){return db['User'][_0x38d3('0x88')](_0x13e1f2,{'include':[{'model':db[_0x38d3('0x74')],'as':'VoiceMail'}]});})[_0x38d3('0x17')](function(_0x55c6fe){if(_0x3f9204['body'][_0x38d3('0x2a')]==='user')return _0x55c6fe;if(_0x3f9204[_0x38d3('0x2f')]['role']!==_0x38d3('0x2f'))return _0x55c6fe;return db[_0x38d3('0x89')][_0x38d3('0x5d')]({'where':{'name':_0x55c6fe['role']===_0x38d3('0x76')?_0x38d3('0x30'):_0x38d3('0x31'),'userProfileId':_0x3f9204[_0x38d3('0x2f')][_0x38d3('0x87')]},'raw':!![]})[_0x38d3('0x17')](function(_0x3d3bb9){if(!_0x3d3bb9||_0x3d3bb9[_0x38d3('0x8a')]!=0x0)return _0x55c6fe;return db['UserProfileResource']['create']({'name':_0x55c6fe[_0x38d3('0x36')],'resourceId':_0x55c6fe['id'],'type':_0x3d3bb9[_0x38d3('0x36')],'sectionId':_0x3d3bb9['id']},{})[_0x38d3('0x17')](function(){return _0x55c6fe;});})[_0x38d3('0x22')](function(_0x559d14){logger['error'](_0x38d3('0x8b'),_0x559d14);throw _0x559d14;});})[_0x38d3('0x17')](respondWithResult(_0x1193dd,0xc9))[_0x38d3('0x22')](handleError(_0x1193dd,null));};exports[_0x38d3('0x8c')]=function(_0x3ada6c,_0x10c469){var _0x5d37dd=_0x3ada6c[_0x38d3('0x60')];var _0x50e76a=[];if(_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]===_0x38d3('0x76'))throw new Error(_0x38d3('0x83'));if(_[_0x38d3('0x8d')](_0x5d37dd,[_0x38d3('0x2a'),'user'])&&_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]!==_0x38d3('0x2e')){throw new Error(_0x38d3('0x84'));}if(_[_0x38d3('0x8d')](_0x5d37dd,['role',_0x38d3('0x2e')])&&_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]!==_0x38d3('0x2e')){throw new Error(_0x38d3('0x8e'));}return licenseUtil['checkUserLimits'](_0x5d37dd)[_0x38d3('0x17')](function(){return validateUser(_0x5d37dd[0x0]);})['then'](function(){for(var _0x1b1544=0x1;_0x1b1544<_0x5d37dd[_0x38d3('0x4e')];_0x1b1544++){var _0x4897e9=_0x5d37dd[_0x1b1544-0x1][_0x38d3('0x6a')];if(!_0x5d37dd[_0x1b1544][_0x38d3('0x6a')])_0x5d37dd[_0x1b1544][_0x38d3('0x6a')]=_0x4897e9+0x1;_0x50e76a[_0x38d3('0x4f')](validateUser(_0x5d37dd[_0x1b1544]));}return Promise[_0x38d3('0x55')](_0x50e76a);})[_0x38d3('0x17')](function(){_0x50e76a=[];for(var _0x2afab8=0x0;_0x2afab8<_0x5d37dd[_0x38d3('0x4e')];_0x2afab8++){_0x50e76a['push'](updateUser(_0x5d37dd[_0x2afab8]));}return Promise[_0x38d3('0x55')](_0x50e76a);})['then'](function(){_0x50e76a=_0x5d37dd[_0x38d3('0x34')](function(_0x31f1fa){return db[_0x38d3('0x3c')][_0x38d3('0x88')](_0x31f1fa,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x38d3('0x17')](function(_0x2f46f3){_0x31f1fa['id']=_0x2f46f3['id'];return _0x31f1fa;});});return Promise[_0x38d3('0x55')](_0x50e76a);})[_0x38d3('0x17')](function(_0x15bb77){if(_0x3ada6c['body'][_0x38d3('0x2a')]===_0x38d3('0x2f'))return _0x15bb77;if(_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]!=='user')return _0x15bb77;var _0x155127=_[_0x38d3('0x8d')](_0x15bb77,function(_0x2ded61){return _0x2ded61[_0x38d3('0x2a')]===_0x38d3('0x76')||_0x2ded61[_0x38d3('0x2a')]==='telephone';});if(!_0x155127)return _0x15bb77;return db[_0x38d3('0x89')][_0x38d3('0x8f')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x3ada6c['user'][_0x38d3('0x87')]},'raw':!![]})['then'](function(_0x58f732){if(_[_0x38d3('0x90')](_0x58f732)||!_[_0x38d3('0x8d')](_0x58f732,[_0x38d3('0x8a'),0x0]))return _0x15bb77;_0x50e76a=[];var _0x29ff13=_(_0x58f732)[_0x38d3('0x34')](function(_0x3e4e91){if(_0x3e4e91[_0x38d3('0x8a')]===0x1)return;return _0x3e4e91[_0x38d3('0x36')]===_0x38d3('0x30')?_0x38d3('0x76'):_0x38d3('0x32');})[_0x38d3('0x91')]()[_0x38d3('0x35')]();for(var _0x157425=0x0;_0x157425<_0x15bb77['length'];_0x157425++){if(!_[_0x38d3('0x41')](_0x29ff13,_0x15bb77[_0x157425]['role']))return;var _0x5a9846=_0x15bb77[_0x157425][_0x38d3('0x2a')]===_0x38d3('0x76')?_0x38d3('0x30'):'Telephones';_0x50e76a[_0x38d3('0x4f')](db[_0x38d3('0x37')][_0x38d3('0x88')]({'name':_0x15bb77[_0x157425][_0x38d3('0x36')],'resourceId':_0x15bb77[_0x157425]['id'],'type':_0x5a9846,'sectionId':_[_0x38d3('0x5d')](_0x58f732,[_0x38d3('0x36'),_0x5a9846])['id']},{}));}return Promise[_0x38d3('0x55')](_0x50e76a);});})['then'](respondWithResult(_0x10c469,0xc9))[_0x38d3('0x22')](handleError(_0x10c469,null));};exports['changePassword']=function(_0x5cba70,_0x1965fc){if(_0x5cba70[_0x38d3('0x60')]['id']){delete _0x5cba70['body']['id'];}return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x5cba70['params']['id']}})['then'](function(_0xb53d5){if(!_0xb53d5)return null;if(_0xb53d5['id']===_0x5cba70[_0x38d3('0x2f')]['id']){if(!_0x5cba70[_0x38d3('0x60')][_0x38d3('0x92')]||!_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')]){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x96'));}if(!_0xb53d5[_0x38d3('0x97')](_0x5cba70[_0x38d3('0x60')]['oldPassword'])){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x98'));}if(_0x5cba70['body'][_0x38d3('0x92')]===_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')]){throw new db['Sequelize'][(_0x38d3('0x95'))](_0x38d3('0x99'));}}else if(_0x5cba70['user']['role']==='admin'){if(!_0x5cba70[_0x38d3('0x60')]['newPassword']){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x9a'));}}else if(_0x5cba70[_0x38d3('0x2f')][_0x38d3('0x2a')]==='user'){if(!_0x5cba70[_0x38d3('0x60')]['newPassword']){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x9a'));}if(_0xb53d5[_0x38d3('0x2a')]!=='agent'){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))]('Unauthorized');}}else{throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x83'));}return _0xb53d5;})['then'](handleEntityNotFound(_0x1965fc,null))[_0x38d3('0x17')](function(_0x394d88){return db[_0x38d3('0x9b')]['findOne']({'attributes':['id',_0x38d3('0x67'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x38d3('0x17')](function(_0x5aff04){if(_0x5aff04[_0x38d3('0x67')])authService['validatePasswordPattern'](_0x5cba70['body'][_0x38d3('0x93')]);if(!_0x5aff04[_0x38d3('0x9c')]||!_0x394d88['previousPasswords'])return _0x394d88;authService[_0x38d3('0x9d')](_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')],_0x394d88[_0x38d3('0x9e')],_0x5aff04['passwordHistoryLimit']);return _0x394d88;})[_0x38d3('0x17')](saveUpdates({'password':_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')],'passwordResetAt':_0x5cba70[_0x38d3('0x2f')]['id']==_0x5cba70[_0x38d3('0x63')]['id']?moment():null,'previousPasswords':authService[_0x38d3('0x9f')](_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')],_0x394d88[_0x38d3('0x9e')])},null));})[_0x38d3('0x17')](respondWithResult(_0x1965fc,null))['catch'](handleError(_0x1965fc,null));};exports['addQueues']=function(_0x3491ba,_0x276a9b){var _0x2972fa=_0x3491ba['body'][_0x38d3('0xa0')];return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x3491ba[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0x36'),_0x38d3('0x2a'),'online',_0x38d3('0xa1'),_0x38d3('0xa2'),_0x38d3('0xa3')]})[_0x38d3('0x17')](handleEntityNotFound(_0x276a9b,null))[_0x38d3('0x17')](function(_0x4961a5){if(_0x4961a5){if(!utils[_0x38d3('0xa4')](_0x2972fa)){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xa5'));}return _0x4961a5[_0x38d3('0xa6')+_['capitalize'](_0x2972fa[_0x38d3('0xa7')]())+_0x38d3('0xa8')](_0x3491ba[_0x38d3('0x60')][_0x38d3('0x65')],{'penalty':_0x3491ba[_0x38d3('0x60')]['penalty']||0x0})[_0x38d3('0xa9')](function(_0x51a3bc){for(var _0x133395=0x0;_0x133395<_0x3491ba[_0x38d3('0x60')][_0x38d3('0x65')]['length'];_0x133395+=0x1){var _0xd3019b={'UserId':Number(_0x3491ba[_0x38d3('0x63')]['id'])};_0xd3019b[_[_0x38d3('0xaa')](_0x2972fa[_0x38d3('0xa7')]())+_0x38d3('0xab')]=Number(_0x3491ba['body'][_0x38d3('0x65')][_0x133395]);socket[_0x38d3('0x2b')](_0x38d3('0x2f')+_[_0x38d3('0xaa')](_0x2972fa['toLowerCase']())+_0x38d3('0xac'),_0xd3019b);}return _0x51a3bc;})[_0x38d3('0x17')](function(){if(_0x2972fa===_0x38d3('0xad')){return db[_0x38d3('0xae')][_0x38d3('0x8f')]({'where':{'id':_0x3491ba[_0x38d3('0x60')][_0x38d3('0x65')]||[]},'raw':!![],'attributes':['id',_0x38d3('0x36')]});}})['then'](function(_0x20601d){var _0x3eec9e=_0x4961a5[_0x38d3('0x2d')]({'plain':!![]});var _0x4afeae=[];if(_0x2972fa===_0x38d3('0xad')&&_0x3eec9e[_0x38d3('0x2a')]==='agent'&&_0x3eec9e[_0x38d3('0xaf')]){for(let _0x18cce0=0x0;_0x18cce0<_0x20601d['length'];_0x18cce0+=0x1){_0x4afeae[_0x38d3('0x4f')]({'membername':_0x3eec9e[_0x38d3('0x36')],'UserId':_0x3eec9e['id'],'queue_name':_0x20601d[_0x18cce0][_0x38d3('0x36')],'VoiceQueueId':_0x20601d[_0x18cce0]['id'],'interface':_[_0x38d3('0x6b')](_0x3eec9e[_0x38d3('0xa3')])?util['format'](_0x38d3('0xb0'),_0x3eec9e[_0x38d3('0x36')]):_0x3eec9e[_0x38d3('0xa3')],'paused':_0x3eec9e['voicePause']||![],'penalty':_0x3491ba[_0x38d3('0x60')][_0x38d3('0xb1')]||0x0});}return Promise[_0x38d3('0x55')](_0x4afeae[_0x38d3('0x34')](function(_0x33e10a){return db[_0x38d3('0xb2')][_0x38d3('0xb3')](_0x33e10a);}));}return _0x4961a5;});}})[_0x38d3('0x17')](respondWithStatusCode(_0x276a9b,null))[_0x38d3('0x22')](handleError(_0x276a9b,null));};exports[_0x38d3('0xb4')]=function(_0x44aea8,_0x398eba){var _0x137c91,_0x536220;return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x44aea8[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0x36'),'role']})[_0x38d3('0x17')](handleEntityNotFound(_0x398eba,null))['then'](function(_0x597c00){if(_0x597c00){_0x137c91=_0x597c00;if(!_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')]||!utils[_0x38d3('0xa4')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')])){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xa5'));}return _0x597c00[_0x38d3('0xb5')+_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+'Queues'](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0x65')]);}})[_0x38d3('0x17')](function(_0x57c805){if(_[_0x38d3('0xb6')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0x65')])){for(var _0xe6775c=0x0;_0xe6775c<_0x44aea8['query'][_0x38d3('0x65')]['length'];_0xe6775c+=0x1){_0x536220={'UserId':Number(_0x44aea8['params']['id'])};_0x536220[_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')]['channel'][_0x38d3('0xa7')]())+_0x38d3('0xab')]=Number(_0x44aea8['query'][_0x38d3('0x65')][_0xe6775c]);socket['emit'](_0x38d3('0x2f')+_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+_0x38d3('0xb7'),_0x536220);}}else{_0x536220={'UserId':Number(_0x44aea8[_0x38d3('0x63')]['id'])};_0x536220[_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+_0x38d3('0xab')]=Number(_0x44aea8[_0x38d3('0x4b')]['ids']);socket[_0x38d3('0x2b')]('user'+_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+_0x38d3('0xb7'),_0x536220);}return _0x57c805;})[_0x38d3('0x17')](function(){if(_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')]===_0x38d3('0xad')){return db[_0x38d3('0xb2')]['destroy']({'where':{'UserId':_0x44aea8['params']['id'],'VoiceQueueId':_0x44aea8[_0x38d3('0x4b')][_0x38d3('0x65')]},'individualHooks':!![]})['then'](function(){return _0x137c91;});}return _0x137c91;})[_0x38d3('0x17')](respondWithStatusCode(_0x398eba,null))[_0x38d3('0x22')](handleError(_0x398eba,null));};exports[_0x38d3('0xb8')]=function(_0x4a094f,_0x232ae1){_0x4a094f[_0x38d3('0x60')]['userpic']=_0x4a094f['file']['filename'];return db['User'][_0x38d3('0x5d')]({'where':{'id':_0x4a094f[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x232ae1,null))[_0x38d3('0x17')](saveUpdates(_0x4a094f[_0x38d3('0x60')],null))['then'](respondWithResult(_0x232ae1,null))[_0x38d3('0x22')](handleError(_0x232ae1,null));};exports[_0x38d3('0xb9')]=function(_0x225ec8,_0x3ad6ef){var _0x44780c=path['join'](config['root'],_0x38d3('0xba'));return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x225ec8[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0xbb')],'raw':!![]})[_0x38d3('0x17')](handleEntityNotFound(_0x3ad6ef,null))['then'](function(_0x43a558){if(_0x43a558){if(_['isNil'](_0x43a558[_0x38d3('0xbb')])){return _0x3ad6ef[_0x38d3('0xbc')](_0x44780c);}else{if(!fs[_0x38d3('0xbd')](path['join'](config[_0x38d3('0xbe')],_0x38d3('0xbf'),_0x43a558[_0x38d3('0xbb')]))){return _0x3ad6ef[_0x38d3('0xbc')](_0x44780c);}return _0x3ad6ef[_0x38d3('0xbc')](path['join'](config['root'],_0x38d3('0xbf'),_0x43a558[_0x38d3('0xbb')]));}}})[_0x38d3('0x22')](handleError(_0x3ad6ef,null));};exports[_0x38d3('0xc0')]=function(_0x430282,_0x86c6a4){return db['User'][_0x38d3('0x5d')]({'where':{'id':_0x430282[_0x38d3('0x63')]['id']},'attributes':['id']})[_0x38d3('0x17')](handleEntityNotFound(_0x86c6a4,null))[_0x38d3('0x17')](function(_0x1c71fa){var _0x3ff768=[];values=_0x1c71fa[_0x38d3('0x51')];_0x3ff768[_0x38d3('0x4f')](get_open_tabs('chat',_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x5e'),_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x54'),_0x1c71fa[_0x38d3('0x51')]));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0xc1'),_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x52'),_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs('mail',_0x1c71fa[_0x38d3('0x51')]));return Promise[_0x38d3('0x55')](_0x3ff768);})['then'](function(_0x1a2855){if(_0x1a2855){var _0xdceefc=_['map'](values[_0x38d3('0xc2')],function(_0x5e0c76){return{'channel':_0x38d3('0xc3'),'id':_0x5e0c76['id'],'createdAt':_0x5e0c76['createdAt']};});var _0x4dd1aa=_['map'](values[_0x38d3('0xc4')],function(_0x4bee8f){return{'channel':_0x38d3('0xc5'),'id':_0x4bee8f['id'],'createdAt':_0x4bee8f[_0x38d3('0xc6')]};});var _0xd7c4bd=_[_0x38d3('0x34')](values['OpenchannelOpenTabs'],function(_0x13f5bc){return{'channel':'OPENCHANNEL','id':_0x13f5bc['id'],'createdAt':_0x13f5bc[_0x38d3('0xc6')]};});var _0x57b7d2=_['map'](values[_0x38d3('0xc7')],function(_0x1b3984){return{'channel':_0x38d3('0xc8'),'id':_0x1b3984['id'],'createdAt':_0x1b3984[_0x38d3('0xc6')]};});var _0x528945=_[_0x38d3('0x34')](values[_0x38d3('0xc9')],function(_0x30d758){return{'channel':_0x38d3('0xca'),'id':_0x30d758['id'],'createdAt':_0x30d758['createdAt']};});var _0x193298=_[_0x38d3('0x34')](values['WhatsappOpenTabs'],function(_0x4c3791){return{'channel':'WHATSAPP','id':_0x4c3791['id'],'createdAt':_0x4c3791[_0x38d3('0xc6')]};});var _0x320ae4=_[_0x38d3('0xcb')](_0xdceefc,_0x4dd1aa,_0xd7c4bd,_0x57b7d2,_0x528945,_0x193298);var _0x5255ef={'count':_0x320ae4['length'],'rows':_0x320ae4};return _0x5255ef;}else return null;})[_0x38d3('0x17')](respondWithResult(_0x86c6a4,null))[_0x38d3('0x22')](handleError(_0x86c6a4,null));};exports[_0x38d3('0xcc')]=function(_0x2be6df,_0xfedf4f){var _0x51e81b={};var _0xbb35f8={};var _0x32bde7;var _0x35efef;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x2be6df['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0xfedf4f,null))[_0x38d3('0x17')](function(_0x4b21be){if(_0x4b21be){_0x32bde7=_0x4b21be;_0xbb35f8['model']=_[_0x38d3('0xce')](db[_0x38d3('0xcf')][_0x38d3('0x3d')]);_0xbb35f8['query']=_[_0x38d3('0xce')](_0x2be6df['query']);_0xbb35f8['filters']=_['intersection'](_0xbb35f8[_0x38d3('0x59')],_0xbb35f8[_0x38d3('0x4b')]);_0x51e81b[_0x38d3('0x49')]=_['intersection'](_0xbb35f8['model'],qs['fields'](_0x2be6df[_0x38d3('0x4b')]['fields']));_0x51e81b[_0x38d3('0x49')]=_0x51e81b[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x51e81b[_0x38d3('0x49')]:_0xbb35f8[_0x38d3('0x59')];_0x51e81b[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x51e81b['where']=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2be6df[_0x38d3('0x4b')],_0xbb35f8[_0x38d3('0x57')]));if(_0x2be6df[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x51e81b[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x51e81b[_0x38d3('0x44')],{'$or':_['map'](_0x51e81b['attributes'],function(_0x3ebdc7){var _0x522924={};_0x522924[_0x3ebdc7]={'$like':'%'+_0x2be6df[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x522924;})});}_0x51e81b=_[_0x38d3('0x5b')]({},_0x51e81b,_0x2be6df[_0x38d3('0x5c')]);return _0x32bde7[_0x38d3('0xcc')](_0x51e81b);}})['then'](function(_0x4b72c9){if(_0x4b72c9){_0x35efef=_0x4b72c9['length'];if(_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0x45'))){_0x51e81b[_0x38d3('0x46')]=[{'model':db['CmList'],'as':_0x38d3('0xd4'),'required':![]},{'model':db[_0x38d3('0xd5')],'as':_0x38d3('0xd6'),'attributes':['id',_0x38d3('0x36'),_0x38d3('0xd7')],'where':_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd8')]?{'id':_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd8')]}:undefined,'required':_0x2be6df[_0x38d3('0x4b')]['tag']?!![]:![]}];}if(!_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x51e81b[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x2be6df['query']['limit']);_0x51e81b[_0x38d3('0xda')]=qs['offset'](_0x2be6df['query'][_0x38d3('0xda')]);}return _0x32bde7['getContacts'](_0x51e81b);}})[_0x38d3('0x17')](function(_0x2618c0){if(_0x2618c0){return _0x2618c0?{'count':_0x35efef,'rows':_0x2618c0}:null;}})['then'](respondWithResult(_0xfedf4f,null))[_0x38d3('0x22')](handleError(_0xfedf4f,null));};exports['getQueues']=function(_0x5d8ea9,_0xdc2145){var _0x3da47e;var _0x1b68ab={};var _0x14451b;return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x5d8ea9[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0x36'),_0x38d3('0x2a')]})[_0x38d3('0x17')](handleEntityNotFound(_0xdc2145,null))[_0x38d3('0x17')](function(_0x45db78){if(!utils[_0x38d3('0xa4')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])){throw new db['Sequelize'][(_0x38d3('0x95'))](_0x38d3('0xa5'));}_0x3da47e=_0x45db78;var _0x4a2184={};_0x4a2184[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])+'Queue'][_0x38d3('0x3d')]);_0x4a2184[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x5d8ea9[_0x38d3('0x4b')]);_0x4a2184[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x4a2184[_0x38d3('0x59')],_0x4a2184[_0x38d3('0x4b')]);_0x1b68ab[_0x38d3('0x49')]=_['intersection'](_0x4a2184[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x1b68ab[_0x38d3('0x49')]=_0x1b68ab[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x1b68ab['attributes']:_0x4a2184[_0x38d3('0x59')];_0x1b68ab[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x1b68ab['where']=qs[_0x38d3('0x57')](_['pick'](_0x5d8ea9[_0x38d3('0x4b')],_0x4a2184['filters']));if(_0x5d8ea9[_0x38d3('0x4b')]['filter']){_0x1b68ab[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x1b68ab[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x1b68ab[_0x38d3('0x49')],function(_0x3460fe){var _0x446b6e={};_0x446b6e[_0x3460fe]={'$like':'%'+_0x5d8ea9['query'][_0x38d3('0x33')]+'%'};return _0x446b6e;})});}_0x1b68ab=_[_0x38d3('0x5b')]({},_0x1b68ab,_0x5d8ea9[_0x38d3('0x5c')]);switch(_0x3da47e['role']){case _0x38d3('0x2e'):return db[_['capitalize'](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])+_0x38d3('0xdb')][_0x38d3('0x8f')](_0x1b68ab);case _0x38d3('0x2f'):case _0x38d3('0x76'):return _0x3da47e[_0x38d3('0x2d')+_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])+_0x38d3('0xa8')](_0x1b68ab);default:throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xdc'));}})['then'](function(_0x548218){_0x14451b=_0x548218[_0x38d3('0x4e')];if(!_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x1b68ab[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x1b68ab[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xda')]);}switch(_0x3da47e[_0x38d3('0x2a')]){case _0x38d3('0x2e'):return db[_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')]['channel'])+_0x38d3('0xdb')][_0x38d3('0x8f')](_0x1b68ab);case _0x38d3('0x2f'):case _0x38d3('0x76'):return _0x3da47e['get'+_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')]['channel'])+_0x38d3('0xa8')](_0x1b68ab);}})[_0x38d3('0x17')](function(_0x453de5){return{'count':_0x14451b,'rows':_0x453de5};})[_0x38d3('0x17')](respondWithResult(_0xdc2145,null))[_0x38d3('0x22')](handleError(_0xdc2145,null));};exports[_0x38d3('0xdd')]=function(_0x1871a2,_0x705706){var _0x2bc0e7={};var _0x34071f={};var _0x2d06fd;var _0x324f5d;return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x1871a2[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x705706,null))[_0x38d3('0x17')](function(_0x564705){if(_0x564705){_0x2d06fd=_0x564705;_0x34071f[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xb2')][_0x38d3('0x3d')]);_0x34071f[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x1871a2[_0x38d3('0x4b')]);_0x34071f[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x34071f[_0x38d3('0x59')],_0x34071f[_0x38d3('0x4b')]);_0x2bc0e7[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x34071f[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x1871a2[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x2bc0e7[_0x38d3('0x49')]=_0x2bc0e7[_0x38d3('0x49')]['length']?_0x2bc0e7[_0x38d3('0x49')]:_0x34071f[_0x38d3('0x59')];_0x2bc0e7[_0x38d3('0xd0')]=qs['sort'](_0x1871a2[_0x38d3('0x4b')]['sort']);_0x2bc0e7[_0x38d3('0x44')]=qs['filters'](_[_0x38d3('0xd2')](_0x1871a2[_0x38d3('0x4b')],_0x34071f[_0x38d3('0x57')]));if(_0x1871a2[_0x38d3('0x4b')]['filter']){_0x2bc0e7['where']=_[_0x38d3('0x5b')](_0x2bc0e7[_0x38d3('0x44')],{'$or':_['map'](_0x2bc0e7['attributes'],function(_0xa9be12){var _0x1c0621={};_0x1c0621[_0xa9be12]={'$like':'%'+_0x1871a2['query'][_0x38d3('0x33')]+'%'};return _0x1c0621;})});}_0x2bc0e7=_[_0x38d3('0x5b')]({},_0x2bc0e7,_0x1871a2['options']);return _0x2d06fd['getVoiceQueuesRt'](_0x2bc0e7);}})[_0x38d3('0x17')](function(_0x27004f){if(_0x27004f){_0x324f5d=_0x27004f[_0x38d3('0x4e')];if(!_0x1871a2[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x2bc0e7[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x1871a2[_0x38d3('0x4b')]['limit']);_0x2bc0e7[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x1871a2['query']['offset']);}return _0x2d06fd['getVoiceQueuesRt'](_0x2bc0e7);}})[_0x38d3('0x17')](function(_0x3d9ab3){if(_0x3d9ab3){return _0x3d9ab3?{'count':_0x324f5d,'rows':_0x3d9ab3}:null;}})[_0x38d3('0x17')](respondWithResult(_0x705706,null))['catch'](handleError(_0x705706,null));};exports[_0x38d3('0xde')]=function(_0xa222b2,_0xabfae8){var _0x1f20d9={};var _0x381fd2={};var _0x22f688;var _0x19f1b3;return db['User']['findOne']({'where':{'id':_0xa222b2[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0xabfae8,null))[_0x38d3('0x17')](function(_0x57e929){if(_0x57e929){_0x22f688=_0x57e929;_0x381fd2[_0x38d3('0x59')]=_['keys'](db[_0x38d3('0xdf')][_0x38d3('0x3d')]);_0x381fd2[_0x38d3('0x4b')]=_['keys'](_0xa222b2['query']);_0x381fd2[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x381fd2[_0x38d3('0x59')],_0x381fd2[_0x38d3('0x4b')]);_0x1f20d9[_0x38d3('0x49')]=_['intersection'](_0x381fd2['model'],qs['fields'](_0xa222b2['query']['fields']));_0x1f20d9['attributes']=_0x1f20d9[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x1f20d9['attributes']:_0x381fd2[_0x38d3('0x59')];_0x1f20d9['order']=qs[_0x38d3('0xd1')](_0xa222b2[_0x38d3('0x4b')]['sort']);_0x1f20d9['where']=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0xa222b2[_0x38d3('0x4b')],_0x381fd2['filters']));if(_0xa222b2[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x1f20d9['where']=_[_0x38d3('0x5b')](_0x1f20d9[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x1f20d9[_0x38d3('0x49')],function(_0x87e14b){var _0x2d9949={};_0x2d9949[_0x87e14b]={'$like':'%'+_0xa222b2['query'][_0x38d3('0x33')]+'%'};return _0x2d9949;})});}_0x1f20d9=_['merge']({},_0x1f20d9,_0xa222b2[_0x38d3('0x5c')]);return _0x22f688[_0x38d3('0xde')](_0x1f20d9);}})[_0x38d3('0x17')](function(_0x39ccd3){if(_0x39ccd3){_0x19f1b3=_0x39ccd3['length'];if(!_0xa222b2[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x1f20d9[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0xa222b2[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x1f20d9[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0xa222b2[_0x38d3('0x4b')][_0x38d3('0xda')]);}return _0x22f688[_0x38d3('0xde')](_0x1f20d9);}})[_0x38d3('0x17')](function(_0x5ee2f9){if(_0x5ee2f9){return _0x5ee2f9?{'count':_0x19f1b3,'rows':_0x5ee2f9}:null;}})[_0x38d3('0x17')](respondWithResult(_0xabfae8,null))[_0x38d3('0x22')](handleError(_0xabfae8,null));};exports[_0x38d3('0xe0')]=function(_0x5c83be,_0x3fd373){var _0x51cef5={'raw':!![],'where':{}};var _0x24ec21={};var _0x41d28c={'count':0x0,'rows':[]};return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x5c83be[_0x38d3('0x63')]['id']}})['then'](handleEntityNotFound(_0x3fd373,null))['then'](function(_0x3c13df){if(_0x3c13df){_0x24ec21[_0x38d3('0x59')]=_[_0x38d3('0xce')](db['VoiceRecording'][_0x38d3('0x3d')]);_0x24ec21[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x5c83be['query']);_0x24ec21[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x24ec21['model'],_0x24ec21[_0x38d3('0x4b')]);_0x51cef5[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x24ec21['model'],qs[_0x38d3('0x5a')](_0x5c83be[_0x38d3('0x4b')]['fields']));_0x51cef5['attributes']=_0x51cef5['attributes']['length']?_0x51cef5[_0x38d3('0x49')]:_0x24ec21[_0x38d3('0x59')];if(!_0x5c83be[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x51cef5[_0x38d3('0x27')]=qs['limit'](_0x5c83be[_0x38d3('0x4b')]['limit']);_0x51cef5[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x5c83be['query'][_0x38d3('0xda')]);}_0x51cef5['order']=qs[_0x38d3('0xd1')](_0x5c83be[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x51cef5[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_['pick'](_0x5c83be[_0x38d3('0x4b')],_0x24ec21[_0x38d3('0x57')]));_0x51cef5[_0x38d3('0x44')][_0x38d3('0xe1')]=_0x3c13df['id'];if(_0x5c83be[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x51cef5[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x51cef5[_0x38d3('0x44')],{'$or':_['map'](_0x51cef5[_0x38d3('0x49')],function(_0x5ad76b){var _0xf5edcb={};_0xf5edcb[_0x5ad76b]={'$like':'%'+_0x5c83be['query'][_0x38d3('0x33')]+'%'};return _0xf5edcb;})});}_0x51cef5=_[_0x38d3('0x5b')]({},_0x51cef5,_0x5c83be['options']);return db['VoiceRecording'][_0x38d3('0x28')]({'where':_0x51cef5[_0x38d3('0x44')]})[_0x38d3('0x17')](function(_0x3adbe6){_0x41d28c[_0x38d3('0x28')]=_0x3adbe6;if(_0x5c83be[_0x38d3('0x4b')]['includeAll']){_0x51cef5[_0x38d3('0x46')]=[{'all':!![]}];}return db[_0x38d3('0xe2')][_0x38d3('0x8f')](_0x51cef5);})[_0x38d3('0x17')](function(_0xb838eb){_0x41d28c[_0x38d3('0x4a')]=_0xb838eb;return _0x41d28c;});}})[_0x38d3('0x17')](respondWithFilteredResult(_0x3fd373,_0x51cef5))[_0x38d3('0x22')](handleError(_0x3fd373,null));};exports['getScreenRecordings']=function(_0x58ef12,_0x56dc1e){var _0x1ef84d={'raw':!![],'where':{}};var _0x4a22cc={};var _0x1d03b6={'count':0x0,'rows':[]};return db[_0x38d3('0x3c')]['findOne']({'where':{'id':_0x58ef12[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x56dc1e,null))[_0x38d3('0x17')](function(_0x2ce084){if(_0x2ce084){_0x4a22cc['model']=_[_0x38d3('0xce')](db[_0x38d3('0xe3')][_0x38d3('0x3d')]);_0x4a22cc[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x58ef12[_0x38d3('0x4b')]);_0x4a22cc['filters']=_[_0x38d3('0x58')](_0x4a22cc['model'],_0x4a22cc[_0x38d3('0x4b')]);_0x1ef84d[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x4a22cc[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x58ef12[_0x38d3('0x4b')]['fields']));_0x1ef84d[_0x38d3('0x49')]=_0x1ef84d['attributes'][_0x38d3('0x4e')]?_0x1ef84d['attributes']:_0x4a22cc[_0x38d3('0x59')];if(!_0x58ef12[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x1ef84d[_0x38d3('0x27')]=qs['limit'](_0x58ef12[_0x38d3('0x4b')]['limit']);_0x1ef84d[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x58ef12[_0x38d3('0x4b')]['offset']);}_0x1ef84d['order']=qs[_0x38d3('0xd1')](_0x58ef12[_0x38d3('0x4b')]['sort']);_0x1ef84d[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x58ef12['query'],_0x4a22cc['filters']));_0x1ef84d[_0x38d3('0x44')]['UserId']=_0x2ce084['id'];if(_0x58ef12[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x1ef84d[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x1ef84d[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x1ef84d['attributes'],function(_0x3309af){var _0x49028a={};_0x49028a[_0x3309af]={'$like':'%'+_0x58ef12[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x49028a;})});}_0x1ef84d=_[_0x38d3('0x5b')]({},_0x1ef84d,_0x58ef12[_0x38d3('0x5c')]);return db[_0x38d3('0xe3')][_0x38d3('0x28')]({'where':_0x1ef84d[_0x38d3('0x44')]})['then'](function(_0x4cacaf){_0x1d03b6[_0x38d3('0x28')]=_0x4cacaf;if(_0x58ef12[_0x38d3('0x4b')][_0x38d3('0x45')]){_0x1ef84d[_0x38d3('0x46')]=[{'all':!![]}];}return db[_0x38d3('0xe3')]['findAll'](_0x1ef84d);})[_0x38d3('0x17')](function(_0x33abef){_0x1d03b6['rows']=_0x33abef;return _0x1d03b6;});}})[_0x38d3('0x17')](respondWithFilteredResult(_0x56dc1e,_0x1ef84d))[_0x38d3('0x22')](handleError(_0x56dc1e,null));};exports[_0x38d3('0xe4')]=function(_0x2a1ffc,_0x2d7d62){var _0x27836a={};var _0x32c942={};var _0x5878e6;var _0x32ff62;return db['User']['findOne']({'where':{'id':_0x2a1ffc[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x2d7d62,null))[_0x38d3('0x17')](function(_0x983379){if(_0x983379){_0x5878e6=_0x983379;_0x32c942[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xe5')][_0x38d3('0x3d')]);_0x32c942[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x2a1ffc[_0x38d3('0x4b')]);_0x32c942[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x32c942[_0x38d3('0x59')],_0x32c942[_0x38d3('0x4b')]);_0x27836a['attributes']=_[_0x38d3('0x58')](_0x32c942[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x27836a[_0x38d3('0x49')]=_0x27836a[_0x38d3('0x49')]['length']?_0x27836a['attributes']:_0x32c942[_0x38d3('0x59')];_0x27836a[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x27836a[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2a1ffc[_0x38d3('0x4b')],_0x32c942['filters']));if(_0x2a1ffc['query']['filter']){_0x27836a[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x27836a['where'],{'$or':_[_0x38d3('0x34')](_0x27836a[_0x38d3('0x49')],function(_0x2d9a6c){var _0x5a8e0e={};_0x5a8e0e[_0x2d9a6c]={'$like':'%'+_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x5a8e0e;})});}_0x27836a=_['merge']({},_0x27836a,_0x2a1ffc['options']);return _0x5878e6[_0x38d3('0xe4')](_0x27836a);}})[_0x38d3('0x17')](function(_0x1dc5a3){if(_0x1dc5a3){_0x32ff62=_0x1dc5a3[_0x38d3('0x4e')];if(!_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x27836a[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x27836a['offset']=qs[_0x38d3('0xda')](_0x2a1ffc['query'][_0x38d3('0xda')]);}return _0x5878e6[_0x38d3('0xe4')](_0x27836a);}})[_0x38d3('0x17')](function(_0x4e6a76){if(_0x4e6a76){return _0x4e6a76?{'count':_0x32ff62,'rows':_0x4e6a76}:null;}})[_0x38d3('0x17')](respondWithResult(_0x2d7d62,null))['catch'](handleError(_0x2d7d62,null));};exports[_0x38d3('0xe6')]=function(_0x2ec254,_0x9e2afb){var _0x41965f={};var _0x19bc60={};var _0x1d380d;var _0xf964d6;return db['User']['findOne']({'where':{'id':_0x2ec254[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x9e2afb,null))[_0x38d3('0x17')](function(_0x578a1d){if(_0x578a1d){_0x1d380d=_0x578a1d;_0x19bc60['model']=_[_0x38d3('0xce')](db['OpenchannelInteraction']['rawAttributes']);_0x19bc60['query']=_[_0x38d3('0xce')](_0x2ec254[_0x38d3('0x4b')]);_0x19bc60[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x19bc60[_0x38d3('0x59')],_0x19bc60[_0x38d3('0x4b')]);_0x41965f[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x19bc60[_0x38d3('0x59')],qs['fields'](_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x41965f[_0x38d3('0x49')]=_0x41965f['attributes'][_0x38d3('0x4e')]?_0x41965f[_0x38d3('0x49')]:_0x19bc60['model'];_0x41965f[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2ec254[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x41965f[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2ec254[_0x38d3('0x4b')],_0x19bc60[_0x38d3('0x57')]));if(_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x41965f[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x41965f[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x41965f[_0x38d3('0x49')],function(_0x1e2f03){var _0x29614d={};_0x29614d[_0x1e2f03]={'$like':'%'+_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x29614d;})});}_0x41965f=_[_0x38d3('0x5b')]({},_0x41965f,_0x2ec254[_0x38d3('0x5c')]);return _0x1d380d[_0x38d3('0xe6')](_0x41965f);}})[_0x38d3('0x17')](function(_0xb1a845){if(_0xb1a845){_0xf964d6=_0xb1a845[_0x38d3('0x4e')];if(!_0x2ec254[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x41965f[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x41965f[_0x38d3('0xda')]=qs['offset'](_0x2ec254['query'][_0x38d3('0xda')]);}return _0x1d380d[_0x38d3('0xe6')](_0x41965f);}})['then'](function(_0x55ba4d){if(_0x55ba4d){return _0x55ba4d?{'count':_0xf964d6,'rows':_0x55ba4d}:null;}})['then'](respondWithResult(_0x9e2afb,null))[_0x38d3('0x22')](handleError(_0x9e2afb,null));};exports[_0x38d3('0xe7')]=function(_0x34b08c,_0x3accdc){var _0x2801ca={'raw':!![],'where':{}};var _0x37f9f9={};var _0x39cd78={'count':0x0,'rows':[]};return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x34b08c[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x3accdc,null))[_0x38d3('0x17')](function(_0x57ba93){if(_0x57ba93){_0x37f9f9[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xe8')][_0x38d3('0x3d')]);_0x37f9f9[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x34b08c[_0x38d3('0x4b')]);_0x37f9f9['filters']=_[_0x38d3('0x58')](_0x37f9f9[_0x38d3('0x59')],_0x37f9f9[_0x38d3('0x4b')]);_0x2801ca[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x37f9f9[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x34b08c[_0x38d3('0x4b')]['fields']));_0x2801ca[_0x38d3('0x49')]=_0x2801ca[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x2801ca[_0x38d3('0x49')]:_0x37f9f9[_0x38d3('0x59')];if(!_0x34b08c[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x2801ca[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x2801ca[_0x38d3('0xda')]=qs['offset'](_0x34b08c[_0x38d3('0x4b')][_0x38d3('0xda')]);}_0x2801ca['order']=qs[_0x38d3('0xd1')](_0x34b08c[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x2801ca['where']=qs[_0x38d3('0x57')](_['pick'](_0x34b08c[_0x38d3('0x4b')],_0x37f9f9['filters']));_0x2801ca[_0x38d3('0x44')][_0x38d3('0xe1')]=_0x57ba93['id'];if(_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x2801ca[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x2801ca[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x2801ca['attributes'],function(_0x2370a4){var _0x5464b9={};_0x5464b9[_0x2370a4]={'$like':'%'+_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x5464b9;})});}_0x2801ca=_[_0x38d3('0x5b')]({},_0x2801ca,_0x34b08c['options']);return db[_0x38d3('0xe8')][_0x38d3('0x28')]({'where':_0x2801ca['where']})[_0x38d3('0x17')](function(_0x494bee){_0x39cd78['count']=_0x494bee;if(_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x45')]){_0x2801ca[_0x38d3('0x46')]=[{'all':!![]}];}return db[_0x38d3('0xe8')][_0x38d3('0x8f')](_0x2801ca);})[_0x38d3('0x17')](function(_0x5150c7){_0x39cd78['rows']=_0x5150c7;return _0x39cd78;});}})[_0x38d3('0x17')](respondWithFilteredResult(_0x3accdc,_0x2801ca))['catch'](handleError(_0x3accdc,null));};exports[_0x38d3('0xe9')]=function(_0x40ed69,_0x141cf6){var _0x43466f={};var _0xfba3f1={};var _0x16478c;var _0x7d819b;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x40ed69[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x141cf6,null))[_0x38d3('0x17')](function(_0x2f9e13){if(_0x2f9e13){_0x16478c=_0x2f9e13;_0xfba3f1[_0x38d3('0x59')]=_[_0x38d3('0xce')](db['SmsInteraction'][_0x38d3('0x3d')]);_0xfba3f1['query']=_[_0x38d3('0xce')](_0x40ed69[_0x38d3('0x4b')]);_0xfba3f1[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0xfba3f1[_0x38d3('0x59')],_0xfba3f1[_0x38d3('0x4b')]);_0x43466f[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0xfba3f1[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x40ed69[_0x38d3('0x4b')]['fields']));_0x43466f['attributes']=_0x43466f['attributes'][_0x38d3('0x4e')]?_0x43466f['attributes']:_0xfba3f1['model'];_0x43466f[_0x38d3('0xd0')]=qs['sort'](_0x40ed69[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x43466f['where']=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x40ed69[_0x38d3('0x4b')],_0xfba3f1[_0x38d3('0x57')]));if(_0x40ed69['query'][_0x38d3('0x33')]){_0x43466f[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x43466f['where'],{'$or':_[_0x38d3('0x34')](_0x43466f['attributes'],function(_0x5a66bb){var _0x481485={};_0x481485[_0x5a66bb]={'$like':'%'+_0x40ed69[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x481485;})});}_0x43466f=_[_0x38d3('0x5b')]({},_0x43466f,_0x40ed69[_0x38d3('0x5c')]);return _0x16478c[_0x38d3('0xe9')](_0x43466f);}})[_0x38d3('0x17')](function(_0x1a6b43){if(_0x1a6b43){_0x7d819b=_0x1a6b43[_0x38d3('0x4e')];if(!_0x40ed69[_0x38d3('0x4b')][_0x38d3('0xd3')]('nolimit')){_0x43466f[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x40ed69['query'][_0x38d3('0x27')]);_0x43466f[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x40ed69[_0x38d3('0x4b')][_0x38d3('0xda')]);}return _0x16478c[_0x38d3('0xe9')](_0x43466f);}})[_0x38d3('0x17')](function(_0xc783ea){if(_0xc783ea){return _0xc783ea?{'count':_0x7d819b,'rows':_0xc783ea}:null;}})[_0x38d3('0x17')](respondWithResult(_0x141cf6,null))[_0x38d3('0x22')](handleError(_0x141cf6,null));};exports[_0x38d3('0xea')]=function(_0x1dea62,_0x4fc3f5){var _0xb1995e={};var _0xe527bb={};var _0x54eeb6;var _0x59b66e;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x1dea62[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x4fc3f5,null))['then'](function(_0x244fe1){if(_0x244fe1){_0x54eeb6=_0x244fe1;_0xe527bb[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xeb')][_0x38d3('0x3d')]);_0xe527bb[_0x38d3('0x4b')]=_['keys'](_0x1dea62[_0x38d3('0x4b')]);_0xe527bb['filters']=_['intersection'](_0xe527bb[_0x38d3('0x59')],_0xe527bb[_0x38d3('0x4b')]);_0xb1995e[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0xe527bb[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x1dea62['query']['fields']));_0xb1995e[_0x38d3('0x49')]=_0xb1995e['attributes'][_0x38d3('0x4e')]?_0xb1995e['attributes']:_0xe527bb[_0x38d3('0x59')];_0xb1995e[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x1dea62[_0x38d3('0x4b')]['sort']);_0xb1995e[_0x38d3('0x44')]=qs['filters'](_[_0x38d3('0xd2')](_0x1dea62[_0x38d3('0x4b')],_0xe527bb[_0x38d3('0x57')]));if(_0x1dea62[_0x38d3('0x4b')][_0x38d3('0x33')]){_0xb1995e[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0xb1995e[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0xb1995e[_0x38d3('0x49')],function(_0x3e478b){var _0x5bf3d4={};_0x5bf3d4[_0x3e478b]={'$like':'%'+_0x1dea62[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x5bf3d4;})});}_0xb1995e=_['merge']({},_0xb1995e,_0x1dea62[_0x38d3('0x5c')]);return _0x54eeb6['getFaxInteractions'](_0xb1995e);}})[_0x38d3('0x17')](function(_0x447932){if(_0x447932){_0x59b66e=_0x447932['length'];if(!_0x1dea62['query'][_0x38d3('0xd3')]('nolimit')){_0xb1995e[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x1dea62['query']['limit']);_0xb1995e[_0x38d3('0xda')]=qs['offset'](_0x1dea62['query'][_0x38d3('0xda')]);}return _0x54eeb6[_0x38d3('0xea')](_0xb1995e);}})[_0x38d3('0x17')](function(_0x1a7f40){if(_0x1a7f40){return _0x1a7f40?{'count':_0x59b66e,'rows':_0x1a7f40}:null;}})[_0x38d3('0x17')](respondWithResult(_0x4fc3f5,null))[_0x38d3('0x22')](handleError(_0x4fc3f5,null));};exports[_0x38d3('0xec')]=function(_0x52a07f,_0x3b04b4){var _0x2dfcfe={};var _0x46a633={};var _0x551b77;var _0x13f2ea;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x52a07f['params']['id']}})['then'](handleEntityNotFound(_0x3b04b4,null))[_0x38d3('0x17')](function(_0x3b24cb){if(_0x3b24cb){_0x551b77=_0x3b24cb;_0x46a633[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xed')][_0x38d3('0x3d')]);_0x46a633[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x52a07f[_0x38d3('0x4b')]);_0x46a633[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x46a633[_0x38d3('0x59')],_0x46a633[_0x38d3('0x4b')]);_0x2dfcfe['attributes']=_[_0x38d3('0x58')](_0x46a633[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x52a07f[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x2dfcfe[_0x38d3('0x49')]=_0x2dfcfe[_0x38d3('0x49')]['length']?_0x2dfcfe[_0x38d3('0x49')]:_0x46a633[_0x38d3('0x59')];_0x2dfcfe[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x52a07f[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x2dfcfe[_0x38d3('0x44')]=qs['filters'](_[_0x38d3('0xd2')](_0x52a07f[_0x38d3('0x4b')],_0x46a633['filters']));if(_0x52a07f[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x2dfcfe[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x2dfcfe[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x2dfcfe['attributes'],function(_0x48b23b){var _0x3b5442={};_0x3b5442[_0x48b23b]={'$like':'%'+_0x52a07f[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x3b5442;})});}_0x2dfcfe=_[_0x38d3('0x5b')]({},_0x2dfcfe,_0x52a07f[_0x38d3('0x5c')]);return _0x551b77['getWhatsappInteractions'](_0x2dfcfe);}})[_0x38d3('0x17')](function(_0x346d85){if(_0x346d85){_0x13f2ea=_0x346d85['length'];if(!_0x52a07f[_0x38d3('0x4b')][_0x38d3('0xd3')]('nolimit')){_0x2dfcfe[_0x38d3('0x27')]=qs['limit'](_0x52a07f[_0x38d3('0x4b')]['limit']);_0x2dfcfe['offset']=qs['offset'](_0x52a07f['query']['offset']);}return _0x551b77[_0x38d3('0xec')](_0x2dfcfe);}})[_0x38d3('0x17')](function(_0x58add5){if(_0x58add5){return _0x58add5?{'count':_0x13f2ea,'rows':_0x58add5}:null;}})[_0x38d3('0x17')](respondWithResult(_0x3b04b4,null))['catch'](handleError(_0x3b04b4,null));};exports[_0x38d3('0xee')]=function(_0x7a2eea,_0x2cf0e8,_0x42ec1c){var _0x2c6c27;var _0x1bc67b;var _0x16dcce;var _0x13a6be=!_[_0x38d3('0x6b')](_0x7a2eea[_0x38d3('0x63')]['id'])?_0x7a2eea[_0x38d3('0x63')]['id']:!_[_0x38d3('0x6b')](_0x7a2eea[_0x38d3('0x2f')]['id'])?_0x7a2eea[_0x38d3('0x2f')]['id']:null;return db['User'][_0x38d3('0x5d')]({'where':{'id':_0x13a6be,'role':{'$or':[_0x38d3('0x2e'),_0x38d3('0x2f'),_0x38d3('0x76')]}},'attributes':['id',_0x38d3('0x36'),_0x38d3('0xef'),'mobile','role','internal','loginInPause']})[_0x38d3('0x17')](function(_0x589ce2){if(_0x589ce2){if(_0x589ce2[_0x38d3('0x2a')]==='agent'){_0x2c6c27=_0x589ce2;if(_0x7a2eea[_0x38d3('0x60')]['interface']){_0x16dcce=util[_0x38d3('0xf0')](_0x38d3('0xf1'),_0x2c6c27[_0x7a2eea[_0x38d3('0x60')][_0x38d3('0xa3')]]);}else if(_0x7a2eea['body'][_0x38d3('0xf2')]){_0x16dcce=util[_0x38d3('0xf0')](_0x38d3('0xb0'),_0x7a2eea['body'][_0x38d3('0xf2')]);}else{_0x16dcce=util[_0x38d3('0xf0')](_0x38d3('0xb0'),_0x2c6c27['name']);}socket['to'](util['format'](_0x38d3('0xf3'),_0x2c6c27[_0x38d3('0x36')]))[_0x38d3('0x2b')](_0x38d3('0xf4'),{'user':{'id':_0x2c6c27['id'],'name':_0x2c6c27[_0x38d3('0x36')]},'ip':_0x7a2eea['headers'][_0x38d3('0xf5')]||_0x7a2eea[_0x38d3('0xf6')][_0x38d3('0xf7')]||_0x7a2eea[_0x38d3('0xf8')][_0x38d3('0xf7')]||_0x7a2eea[_0x38d3('0xf6')][_0x38d3('0xf8')][_0x38d3('0xf7')]});return db[_0x38d3('0xb2')][_0x38d3('0x38')]({'where':{'membername':_0x2c6c27[_0x38d3('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xf9'));}})[_0x38d3('0x17')](function(){if(_0x2c6c27){return _0x2c6c27['getVoiceQueues']({'raw':!![]});}})[_0x38d3('0x17')](function(_0x43fd82){if(_0x2c6c27){if(_0x43fd82){_0x1bc67b=_0x43fd82;if(_0x1bc67b[_0x38d3('0x4e')]){var _0x43633f=_0x1bc67b[_0x38d3('0x34')](function(_0x206125){var _0x42fef7={'membername':_0x2c6c27[_0x38d3('0x36')],'UserId':_0x2c6c27['id'],'queue_name':_0x206125[_0x38d3('0x36')],'VoiceQueueId':_0x206125['id'],'interface':_0x16dcce,'paused':_0x2c6c27[_0x38d3('0xa1')]||![],'penalty':_0x206125[_0x38d3('0xfa')]||0x0};return db[_0x38d3('0xb2')][_0x38d3('0xb3')](_0x42fef7);});return Promise['all'](_0x43633f);}}}})[_0x38d3('0x17')](function(){if(_0x2c6c27){return db[_0x38d3('0xfb')][_0x38d3('0x8f')]({'where':{'membername':_0x2c6c27[_0x38d3('0x36')],'exitAt':null}});}})[_0x38d3('0x17')](function(_0x58e97d){if(_0x2c6c27){var _0x25cea4=[];_0x58e97d[_0x38d3('0xfc')](function(_0x4d42d5){_0x25cea4['push'](_0x4d42d5[_0x38d3('0x5f')]({'exitAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd'))}));});return Promise[_0x38d3('0x55')](_0x25cea4);}})[_0x38d3('0x17')](function(){if(_0x2c6c27){var _0x5150f8=[];var _0x1a2338=[];var _0x141a85=utils[_0x38d3('0xfe')]();var _0x3bf68c={'membername':_0x2c6c27[_0x38d3('0x36')],'interface':_0x16dcce,'enterAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd')),'role':_0x2c6c27['role'],'internal':_0x2c6c27[_0x38d3('0x6a')]};_0x141a85[_0x38d3('0xfc')](function(_0x508fcf){_0x5150f8[_0x38d3('0x4f')](_['merge']({'channel':_0x508fcf,'type':_0x38d3('0xff'),'data1':_0x7a2eea['body'][_0x38d3('0x100')],'data2':_0x16dcce},_0x3bf68c));if(_0x2c6c27[_0x38d3('0xa1')]){_0x1a2338[_0x38d3('0x4f')](_['merge']({'channel':_0x508fcf,'type':_0x38d3('0x101'),'data1':'LOGININPAUSE'},_0x3bf68c));}});return db['MemberReport'][_0x38d3('0x8c')](_0x5150f8['concat'](_0x1a2338),{'individualHooks':!![]});}})[_0x38d3('0x17')](function(){if(_0x2c6c27){return _0x2c6c27[_0x38d3('0x5f')]({'online':!![],'lastLoginAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd')),'voicePause':_0x2c6c27['loginInPause']||![],'mailPause':_0x2c6c27[_0x38d3('0xa1')]||![],'chatPause':_0x2c6c27[_0x38d3('0xa1')]||![],'faxPause':_0x2c6c27[_0x38d3('0xa1')]||![],'smsPause':_0x2c6c27[_0x38d3('0xa1')]||![],'openchannelPause':_0x2c6c27[_0x38d3('0xa1')]||![],'whatsappPause':_0x2c6c27[_0x38d3('0xa1')]||![],'pauseType':_0x2c6c27[_0x38d3('0xa1')]?_0x38d3('0x102'):null,'interface':_0x16dcce,'lastPauseAt':moment()[_0x38d3('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x47e637){if(_0x7a2eea[_0x38d3('0x103')]){return _0x42ec1c();}else{return Promise['resolve'](_0x47e637)[_0x38d3('0x17')](respondWithResult(_0x2cf0e8,null));}})[_0x38d3('0x22')](handleError(_0x2cf0e8,null));};exports[_0x38d3('0x104')]=function(_0x18ce23,_0x511e20){var _0x352404;return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x18ce23[_0x38d3('0x63')]['id'],'role':_0x38d3('0x76')},'attributes':['id',_0x38d3('0x36'),'role']})[_0x38d3('0x17')](handleEntityNotFound(_0x511e20,null))['then'](function(_0xfc4b08){if(_0xfc4b08){_0x352404=_0xfc4b08;return db[_0x38d3('0xb2')][_0x38d3('0x38')]({'where':{'membername':_0x352404[_0x38d3('0x36')]},'individualHooks':!![]});}})[_0x38d3('0x17')](function(){return db['MemberReport'][_0x38d3('0x8f')]({'where':{'membername':_0x352404['name'],'exitAt':null}});})[_0x38d3('0x17')](function(_0x5d5a7c){var _0x4e4205=[];_0x5d5a7c[_0x38d3('0xfc')](function(_0x2f431c){_0x4e4205[_0x38d3('0x4f')](_0x2f431c[_0x38d3('0x5f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x4e4205);})[_0x38d3('0x17')](function(){return _0x352404['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x38d3('0x17')](respondWithResult(_0x511e20,null))[_0x38d3('0x22')](handleError(_0x511e20,null));};exports[_0x38d3('0x105')]=function(_0x4f7442,_0x3c699f){var _0xc94660;return db[_0x38d3('0xb2')][_0x38d3('0x5f')]({'paused':0x1},{'where':{'UserId':_0x4f7442['params']['id']},'individualHooks':!![]})[_0x38d3('0x17')](function(){return db['User']['find']({'where':{'id':_0x4f7442['params']['id'],'role':_0x38d3('0x76')},'attributes':['id','name',_0x38d3('0x2a'),_0x38d3('0x6a'),_0x38d3('0xa3'),_0x38d3('0xaf')]});})[_0x38d3('0x17')](handleEntityNotFound(_0x3c699f,null))[_0x38d3('0x17')](function(_0x1b693b){if(_0x1b693b){_0xc94660=_0x1b693b;return respondWithRpcPromise('QueuePause',_0x38d3('0x105'),{'id':_0xc94660['id'],'name':_0xc94660[_0x38d3('0x36')],'pause':!![]});}})['then'](function(){if(_0xc94660){return db[_0x38d3('0xfb')][_0x38d3('0x8f')]({'where':{'membername':_0xc94660['name'],'type':_0x38d3('0x101'),'exitAt':null}});}})['then'](function(_0x57cce4){if(_0x57cce4[_0x38d3('0x4e')]){var _0x393960=moment()[_0x38d3('0xf0')](_0x38d3('0xfd'));for(var _0x226c5b=0x0,_0x5caced=_0x57cce4[_0x38d3('0x4e')];_0x226c5b<_0x5caced;_0x226c5b++){_0x57cce4[_0x226c5b][_0x38d3('0x106')]({'exitAt':_0x393960});}}})[_0x38d3('0x17')](function(){var _0x2c9126=[];var _0x14001a=utils[_0x38d3('0xfe')]();_0x14001a[_0x38d3('0xfc')](function(_0x3c1835){_0x2c9126[_0x38d3('0x4f')]({'channel':_0x3c1835,'membername':_0xc94660[_0x38d3('0x36')],'interface':_[_0x38d3('0x6b')](_0xc94660[_0x38d3('0xa3')])?util[_0x38d3('0xf0')](_0x38d3('0xb0'),_0xc94660[_0x38d3('0x36')]):_0xc94660[_0x38d3('0xa3')],'type':_0x38d3('0x101'),'enterAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd')),'data1':_0x4f7442['body'][_0x38d3('0x3f')]||'DEFAULT\x20PAUSE','role':_0xc94660[_0x38d3('0x2a')],'internal':_0xc94660[_0x38d3('0x6a')]});});return db[_0x38d3('0xfb')][_0x38d3('0x8c')](_0x2c9126,{'individualHooks':!![]});})[_0x38d3('0x17')](function(){return _0xc94660[_0x38d3('0x5f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4f7442[_0x38d3('0x60')][_0x38d3('0x3f')]||_0x38d3('0x107'),'lastPauseAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd'))});})[_0x38d3('0x17')](respondWithResult(_0x3c699f,null))[_0x38d3('0x22')](handleError(_0x3c699f,null));};exports[_0x38d3('0x108')]=function(_0x626b8a,_0x526b58){if(_0x626b8a[_0x38d3('0x60')]['channel']&&!utils[_0x38d3('0xa4')](_0x626b8a[_0x38d3('0x60')][_0x38d3('0xa0')])){throw new APIBadRequestError(util[_0x38d3('0xf0')](_0x38d3('0x109'),_0x626b8a[_0x38d3('0x60')][_0x38d3('0xa0')]));}return db['User']['find']({'where':{'id':_0x626b8a['params']['id']},'attributes':['id',_0x38d3('0x36'),_0x38d3('0x2a'),'internal',_0x38d3('0xa3'),_0x38d3('0xaf'),_0x38d3('0xa2'),_0x38d3('0x10a'),_0x38d3('0x10b'),_0x38d3('0x10c'),_0x38d3('0x10d'),_0x38d3('0x10e'),_0x38d3('0x10f'),_0x38d3('0x110'),_0x38d3('0x111')]})[_0x38d3('0x17')](function(_0x353cf9){if(!_0x353cf9){throw new APINotFoundError(util[_0x38d3('0xf0')](_0x38d3('0x112'),_0x626b8a['params']['id']));}return _0x353cf9[_0x38d3('0x108')](_0x626b8a[_0x38d3('0x60')][_0x38d3('0xa0')]);})[_0x38d3('0x17')](respondWithResult(_0x526b58,null))[_0x38d3('0x22')](APIHandleError(_0x526b58));};exports[_0x38d3('0x113')]=function(_0x168c5a,_0x3303c7){var _0x3c9cc2={};var _0xb49f5f={};var _0x1258be;var _0x4650bb;return db[_0x38d3('0x3c')]['findOne']({'where':{'id':_0x168c5a[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x3303c7,null))[_0x38d3('0x17')](function(_0x41acbf){if(_0x41acbf){_0x1258be=_0x41acbf;_0xb49f5f['model']=_[_0x38d3('0xce')](db[_0x38d3('0x114')][_0x38d3('0x3d')]);_0xb49f5f[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x168c5a[_0x38d3('0x4b')]);_0xb49f5f['filters']=_[_0x38d3('0x58')](_0xb49f5f[_0x38d3('0x59')],_0xb49f5f[_0x38d3('0x4b')]);_0x3c9cc2[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0xb49f5f['model'],qs['fields'](_0x168c5a['query'][_0x38d3('0x5a')]));_0x3c9cc2[_0x38d3('0x49')]=_0x3c9cc2[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x3c9cc2[_0x38d3('0x49')]:_0xb49f5f[_0x38d3('0x59')];_0x3c9cc2[_0x38d3('0xd0')]=qs['sort'](_0x168c5a[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x3c9cc2['where']=qs[_0x38d3('0x57')](_['pick'](_0x168c5a[_0x38d3('0x4b')],_0xb49f5f[_0x38d3('0x57')]));if(_0x168c5a[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x3c9cc2[_0x38d3('0x44')]=_['merge'](_0x3c9cc2[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x3c9cc2[_0x38d3('0x49')],function(_0x14ac3f){var _0x440517={};_0x440517[_0x14ac3f]={'$like':'%'+_0x168c5a['query'][_0x38d3('0x33')]+'%'};return _0x440517;})});}_0x3c9cc2=_['merge']({},_0x3c9cc2,_0x168c5a[_0x38d3('0x5c')]);return _0x1258be['getTeams'](_0x3c9cc2);}})[_0x38d3('0x17')](function(_0x22e604){if(_0x22e604){_0x4650bb=_0x22e604[_0x38d3('0x4e')];if(!_0x168c5a[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x3c9cc2[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x168c5a[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x3c9cc2[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x168c5a['query'][_0x38d3('0xda')]);}return _0x1258be['getTeams'](_0x3c9cc2);}})[_0x38d3('0x17')](function(_0x55fde4){if(_0x55fde4){return _0x55fde4?{'count':_0x4650bb,'rows':_0x55fde4}:null;}})[_0x38d3('0x17')](respondWithResult(_0x3303c7,null))[_0x38d3('0x22')](handleError(_0x3303c7,null));};exports[_0x38d3('0x115')]=function(_0x324970,_0x56fd8e){var _0x2ba168=_0x324970[_0x38d3('0x63')]['id'];var _0x430dda=_0x324970[_0x38d3('0x60')]?_0x324970['body'][_0x38d3('0x65')]:null;var _0x530d1c=[];return Promise['resolve']()[_0x38d3('0x17')](function(){if(!_0x430dda)throw new APIBadRequestError(_0x38d3('0x116'));})['then'](function(){return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x2ba168}});})[_0x38d3('0x17')](function(_0x30ac40){if(!_0x30ac40)throw new APINotFoundError(util[_0x38d3('0xf0')](_0x38d3('0x112'),_0x324970[_0x38d3('0x63')]['id']));return db[_0x38d3('0x6d')]['transaction'](function(_0x345d8d){return _0x30ac40[_0x38d3('0x115')](_0x430dda,{'transaction':_0x345d8d})[_0x38d3('0x17')](function(){return db[_0x38d3('0x114')][_0x38d3('0x8f')]({'where':{'id':{'$in':_0x430dda}}});})['then'](function(_0x3704b3){var _0x1eaa90=_[_0x38d3('0x34')](_0x3704b3,function(_0x4d483c){return _0x4d483c[_0x38d3('0x117')]();});return Promise[_0x38d3('0x55')](_0x1eaa90);})[_0x38d3('0x17')](function(_0x51ca43){_0x530d1c=_['flattenDeep'](_0x51ca43);var _0x4f9d0a=_['map'](_0x530d1c,function(_0x217326){return _0x217326[_0x38d3('0x118')](_0x30ac40['id'],{'transaction':_0x345d8d});});return Promise[_0x38d3('0x55')](_0x4f9d0a);})[_0x38d3('0x17')](function(){if(!_0x30ac40[_0x38d3('0xaf')])return;var _0x2774ed=_[_0x38d3('0x33')](_0x530d1c,function(_0x1e8ab4){return _0x1e8ab4['getDataValue'](_0x38d3('0xa0'))===_0x38d3('0x119');});var _0x40fa08=_[_0x38d3('0x34')](_0x2774ed,function(_0x1dabd7){return db[_0x38d3('0xb2')]['upsert']({'membername':_0x30ac40[_0x38d3('0x36')],'UserId':_0x30ac40['id'],'queue_name':_0x1dabd7[_0x38d3('0x36')],'VoiceQueueId':_0x1dabd7['id'],'interface':_[_0x38d3('0x6b')](_0x30ac40[_0x38d3('0xa3')])?util['format'](_0x38d3('0xb0'),_0x30ac40['name']):_0x30ac40[_0x38d3('0xa3')],'paused':_0x30ac40[_0x38d3('0xa2')]||![],'penalty':_0x30ac40['penalty']},{'transaction':_0x345d8d});});return Promise[_0x38d3('0x55')](_0x40fa08);})[_0x38d3('0x17')](function(){return db['TeamVoicePrefix'][_0x38d3('0x8f')]({'where':{'teamId':{'$in':_0x430dda}}});})[_0x38d3('0x17')](function(_0x1e05fe){var _0x387c8b=_[_0x38d3('0x34')](_0x1e05fe,function(_0x2b52ee){return db['UserVoicePrefix'][_0x38d3('0x88')]({'UserId':_0x30ac40['id'],'VoicePrefixId':_0x2b52ee[_0x38d3('0x11a')]},{'transaction':_0x345d8d});});return Promise[_0x38d3('0x55')](_0x387c8b);});});})['then'](function(){for(var _0x27cd11=0x0;_0x27cd11<_0x530d1c['length'];_0x27cd11++){var _0x55d252=_0x530d1c[_0x27cd11]['getDataValue'](_0x38d3('0xa0'));var _0x458208=_0x55d252+_0x38d3('0xab');socket['emit'](_0x38d3('0x2f')+_0x55d252+_0x38d3('0xac'),{'UserId':_0x2ba168,['queueField']:_0x530d1c[_0x27cd11]['id']});}})[_0x38d3('0x17')](respondWithStatusCode(_0x56fd8e,null))[_0x38d3('0x22')](APIHandleError(_0x56fd8e));};exports['removeTeams']=function(_0x7e5ab3,_0x1a719e){var _0x770cc2=_0x7e5ab3['params']['id'];var _0x2ddaac=null;if(_0x7e5ab3[_0x38d3('0x4b')][_0x38d3('0x65')]){_0x2ddaac=_[_0x38d3('0xb6')](_0x7e5ab3['query'][_0x38d3('0x65')])?_0x7e5ab3['query'][_0x38d3('0x65')]:[_0x7e5ab3['query'][_0x38d3('0x65')]];}var _0x2be947=[];return Promise['resolve']()[_0x38d3('0x17')](function(){if(!_0x2ddaac)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x770cc2}});})['then'](function(_0x4dc049){if(!_0x4dc049)throw new APINotFoundError(util[_0x38d3('0xf0')](_0x38d3('0x112'),_0x7e5ab3[_0x38d3('0x63')]['id']));return db[_0x38d3('0x6d')][_0x38d3('0x11b')](function(_0x3761cd){return _0x4dc049['removeTeams'](_0x2ddaac,{'transaction':_0x3761cd})['then'](function(){return db['Team'][_0x38d3('0x8f')]({'where':{'id':{'$in':_0x2ddaac}}});})['then'](function(_0x19a930){var _0x1ade24=_['map'](_0x19a930,function(_0x55ece2){return _0x55ece2[_0x38d3('0x117')]();});return Promise['all'](_0x1ade24);})[_0x38d3('0x17')](function(_0xf816b2){_0x2be947=_[_0x38d3('0x11c')](_0xf816b2);var _0x5b63ab=_[_0x38d3('0x34')](_0x2be947,function(_0x1e9df5){return _0x1e9df5[_0x38d3('0x11d')](_0x4dc049['id'],{'transaction':_0x3761cd});});return Promise[_0x38d3('0x55')](_0x5b63ab);})[_0x38d3('0x17')](function(){if(!_0x4dc049[_0x38d3('0xaf')])return;var _0x2ec15a=_['filter'](_0x2be947,function(_0x58f0cb){return _0x58f0cb[_0x38d3('0x11e')](_0x38d3('0xa0'))==='Voice';});var _0x4a1d87=_[_0x38d3('0x34')](_0x2ec15a,function(_0x485e2e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x485e2e['id'],'UserId':_0x4dc049['id']},'transaction':_0x3761cd});});return Promise[_0x38d3('0x55')](_0x4a1d87);})[_0x38d3('0x17')](function(){return db[_0x38d3('0x11f')]['findAll']({'where':{'teamId':{'$in':_0x2ddaac}}});})[_0x38d3('0x17')](function(_0x3e6b57){var _0x50aec2=_[_0x38d3('0x34')](_0x3e6b57,function(_0x2baee5){return db[_0x38d3('0x120')][_0x38d3('0x38')]({'where':{'UserId':_0x4dc049['id'],'VoicePrefixId':_0x2baee5[_0x38d3('0x11a')]}},{'transaction':_0x3761cd});});return Promise[_0x38d3('0x55')](_0x50aec2);});});})['then'](function(){for(var _0x4e990a=0x0;_0x4e990a<_0x2be947['length'];_0x4e990a++){var _0x301c23=_0x2be947[_0x4e990a][_0x38d3('0x11e')](_0x38d3('0xa0'));var _0x47faa9=_0x301c23+_0x38d3('0xab');socket['emit'](_0x38d3('0x2f')+_0x301c23+'Queue:remove',{'UserId':_0x770cc2,['queueField']:_0x2be947[_0x4e990a]['id']});}})[_0x38d3('0x17')](respondWithStatusCode(_0x1a719e,null))[_0x38d3('0x22')](APIHandleError(_0x1a719e));};exports['getLists']=function(_0x23643b,_0x553043){var _0x55bcc4={};var _0x70a1dd={};var _0xaa6484;var _0x2c07ba;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x23643b['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x553043,null))[_0x38d3('0x17')](function(_0x99df83){if(_0x99df83){_0xaa6484=_0x99df83;_0x70a1dd[_0x38d3('0x59')]=_['keys'](db[_0x38d3('0x121')][_0x38d3('0x3d')]);_0x70a1dd[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x23643b[_0x38d3('0x4b')]);_0x70a1dd[_0x38d3('0x57')]=_['intersection'](_0x70a1dd[_0x38d3('0x59')],_0x70a1dd['query']);_0x55bcc4[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x70a1dd[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x23643b[_0x38d3('0x4b')]['fields']));_0x55bcc4[_0x38d3('0x49')]=_0x55bcc4[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x55bcc4['attributes']:_0x70a1dd['model'];_0x55bcc4[_0x38d3('0xd0')]=qs['sort'](_0x23643b['query'][_0x38d3('0xd1')]);_0x55bcc4[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x23643b[_0x38d3('0x4b')],_0x70a1dd[_0x38d3('0x57')]));if(_0x23643b['query'][_0x38d3('0x33')]){_0x55bcc4['where']=_[_0x38d3('0x5b')](_0x55bcc4[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x55bcc4[_0x38d3('0x49')],function(_0x20bdf9){var _0x21bd7f={};_0x21bd7f[_0x20bdf9]={'$like':'%'+_0x23643b[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x21bd7f;})});}_0x55bcc4=_[_0x38d3('0x5b')]({},_0x55bcc4,_0x23643b[_0x38d3('0x5c')]);return _0xaa6484[_0x38d3('0x122')](_0x55bcc4);}})['then'](function(_0x2a5d6b){if(_0x2a5d6b){_0x2c07ba=_0x2a5d6b['length'];if(!_0x23643b[_0x38d3('0x4b')][_0x38d3('0xd3')]('nolimit')){_0x55bcc4[_0x38d3('0x27')]=qs['limit'](_0x23643b[_0x38d3('0x4b')]['limit']);_0x55bcc4[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x23643b[_0x38d3('0x4b')][_0x38d3('0xda')]);}return _0xaa6484['getLists'](_0x55bcc4);}})[_0x38d3('0x17')](function(_0x57600b){if(_0x57600b){return _0x57600b?{'count':_0x2c07ba,'rows':_0x57600b}:null;}})['then'](respondWithResult(_0x553043,null))[_0x38d3('0x22')](handleError(_0x553043,null));};exports['getAgents']=function(_0x2d63b2,_0x253566){var _0x4b4fc2={};var _0x310c7c={};var _0x2d4750;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x2d63b2['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x253566,null))[_0x38d3('0x17')](function(_0x581dab){if(_0x581dab){_0x2d4750=_0x581dab;_0x310c7c[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0x3c')]['rawAttributes']);_0x310c7c[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x2d63b2[_0x38d3('0x4b')]);_0x310c7c[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x310c7c['model'],_0x310c7c[_0x38d3('0x4b')]);_0x4b4fc2['attributes']=_[_0x38d3('0x58')](_0x310c7c[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x2d63b2[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x4b4fc2['attributes']=_0x4b4fc2[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x4b4fc2['attributes']:_0x310c7c[_0x38d3('0x59')];_0x4b4fc2[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2d63b2[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x4b4fc2[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2d63b2[_0x38d3('0x4b')],_0x310c7c[_0x38d3('0x57')]));if(_0x2d63b2['query']['filter']){_0x4b4fc2[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x4b4fc2[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x4b4fc2[_0x38d3('0x49')],function(_0x1ce0dd){var _0x64d503={};_0x64d503[_0x1ce0dd]={'$like':'%'+_0x2d63b2[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x64d503;})});}_0x4b4fc2['model']=db[_0x38d3('0x3c')];_0x4b4fc2['as']=_0x38d3('0x30');_0x4b4fc2=_[_0x38d3('0x5b')]({},_0x4b4fc2,_0x2d63b2[_0x38d3('0x5c')]);return _0x2d4750[_0x38d3('0x123')]({'include':[_0x4b4fc2]});}})[_0x38d3('0x17')](function(_0x481098){if(_0x481098){var _0x4823db={},_0xb0f3c2=[];for(var _0x2871bd=0x0;_0x2871bd<_0x481098[_0x38d3('0x4e')];_0x2871bd+=0x1){for(var _0x30594c=0x0,_0x1fc6a9;_0x30594c<_0x481098[_0x2871bd][_0x38d3('0x30')][_0x38d3('0x4e')];_0x30594c+=0x1){_0x1fc6a9=_0x481098[_0x2871bd][_0x38d3('0x30')][_0x30594c]['get']({'plain':!![]});_0x4823db[_0x1fc6a9['id']]=_0x1fc6a9;}}_0x4823db=_[_0x38d3('0x124')](_0x4823db);for(var _0x350c3c=qs[_0x38d3('0xda')](_0x2d63b2[_0x38d3('0x4b')]['offset']);_0x350c3c<_0x4823db[_0x38d3('0x4e')]&&_0xb0f3c2[_0x38d3('0x4e')]=_0x1b257f[_0x8a64('0x4d')]){throw new Error(_0x8a64('0x4e'));}})[_0x8a64('0x18')](function(){if(_0x405528){return db[_0x8a64('0x44')]['destroy']({'where':{'membername':_0x405528[_0x8a64('0x21')]},'individualHooks':!![]});}})[_0x8a64('0x18')](function(){if(_0x405528){return _0x405528['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x177b1d){if(_0x405528){if(_0x177b1d){var _0x2e014a=[];_0x1eac8d=_0x177b1d;if(_0x1eac8d[_0x8a64('0x27')]){for(var _0x283214=0x0;_0x283214<_0x1eac8d[_0x8a64('0x27')];_0x283214++){_0x2e014a[_0x8a64('0x2c')](db[_0x8a64('0x44')]['upsert']({'membername':_0x405528[_0x8a64('0x21')],'UserId':_0x405528['id'],'queue_name':_0x1eac8d[_0x283214][_0x8a64('0x21')],'VoiceQueueId':_0x1eac8d[_0x283214]['id'],'interface':_0x50445d,'paused':_0x405528[_0x8a64('0x4f')]||![],'penalty':_0x1eac8d[_0x283214][_0x8a64('0x50')]||0x0}));}return BPromise[_0x8a64('0x46')](_0x2e014a);}}}})[_0x8a64('0x18')](function(){if(_0x405528){return db[_0x8a64('0x33')]['findAll']({'where':{'membername':_0x405528[_0x8a64('0x21')],'exitAt':null}});}})[_0x8a64('0x18')](function(_0x2d49a0){if(_0x405528){if(_0x2d49a0&&_0x2d49a0[_0x8a64('0x27')]){var _0x322242=[];_0x2d49a0[_0x8a64('0x45')](function(_0x266e3f){_0x322242['push'](_0x266e3f[_0x8a64('0x25')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8a64('0x46')](_0x322242);}}})[_0x8a64('0x18')](function(){if(_0x405528){var _0x347040=[];var _0x397c9a=[];var _0x3ac27a=utils[_0x8a64('0x2b')]();var _0x580b2b={'membername':_0x405528[_0x8a64('0x21')],'interface':_0x50445d,'enterAt':moment()[_0x8a64('0x28')](_0x8a64('0x29')),'role':_0x405528[_0x8a64('0x22')],'internal':_0x405528['internal']};_0x3ac27a[_0x8a64('0x45')](function(_0x30ff70){_0x347040[_0x8a64('0x2c')](_[_0x8a64('0x51')]({'channel':_0x30ff70,'type':_0x8a64('0x52'),'data1':_0x8a64('0x53'),'data2':_0x50445d},_0x580b2b));if(_0x405528[_0x8a64('0x4f')]){_0x397c9a[_0x8a64('0x2c')](_['merge']({'channel':_0x30ff70,'type':_0x8a64('0x2e'),'data1':'LOGININPAUSE'},_0x580b2b));}});return db['MemberReport'][_0x8a64('0x34')](_0x347040[_0x8a64('0x54')](_0x397c9a),{'individualHooks':!![]});}})[_0x8a64('0x18')](function(){if(_0x405528){return _0x405528[_0x8a64('0x25')]({'online':!![],'lastLoginAt':moment()['format'](_0x8a64('0x29')),'voicePause':_0x405528[_0x8a64('0x4f')]||![],'mailPause':_0x405528['loginInPause']||![],'chatPause':_0x405528[_0x8a64('0x4f')]||![],'faxPause':_0x405528[_0x8a64('0x4f')]||![],'smsPause':_0x405528[_0x8a64('0x4f')]||![],'openchannelPause':_0x405528[_0x8a64('0x4f')]||![],'pauseType':_0x405528[_0x8a64('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x8a64('0x28')](_0x8a64('0x29')),'interface':_0x50445d});}})[_0x8a64('0x18')](function(_0xd56232){_0x3c06dd(_0xd56232);})[_0x8a64('0x1b')](function(_0x57e5d4){_0x442ce7(_0x910074[_0x8a64('0x1c')](0x1f4,_0x57e5d4['message']));});});}; \ No newline at end of file +var _0x6f92=['lodash','util','moment','ioredis','../../config/utils','redis','defaults','register','GetUser','User','findAll','options','limit','include','model','attributes','map','then','info','debug','stringify','catch','error','message','ShowUser','find','raw','where','name','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','update','MemberReport','PAUSE','length','updateAttributes','getChannels','forEach','push','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','DEFAULT\x20PAUSE','role','body','uniqueid','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','findOne','UserVoiceQueueRt','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','LOGIN','merge','LOGININPAUSE','concat'];(function(_0xf537a8,_0x3f713a){var _0x5d9cc4=function(_0x126d4a){while(--_0x126d4a){_0xf537a8['push'](_0xf537a8['shift']());}};_0x5d9cc4(++_0x3f713a);}(_0x6f92,0x150));var _0x26f9=function(_0x40d179,_0x46cdb9){_0x40d179=_0x40d179-0x0;var _0x4f1915=_0x6f92[_0x40d179];return _0x4f1915;};'use strict';var _=require(_0x26f9('0x0'));var util=require(_0x26f9('0x1'));var moment=require(_0x26f9('0x2'));var BPromise=require('bluebird');var Redis=require(_0x26f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x26f9('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');config[_0x26f9('0x5')]=_[_0x26f9('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26f9('0x5')]));require('./user.socket')[_0x26f9('0x7')](socket);exports[_0x26f9('0x8')]=function(_0x441707){var _0x5a0bd7=this;return new Promise(function(_0x5400a0,_0x531074){return db[_0x26f9('0x9')][_0x26f9('0xa')]({'raw':_0x441707[_0x26f9('0xb')]?_0x441707['options']['raw']===undefined?!![]:![]:!![],'where':_0x441707['options']?_0x441707['options']['where']||null:null,'attributes':_0x441707[_0x26f9('0xb')]?_0x441707[_0x26f9('0xb')]['attributes']||null:null,'limit':_0x441707['options']?_0x441707[_0x26f9('0xb')][_0x26f9('0xc')]||null:null,'include':_0x441707[_0x26f9('0xb')]?_0x441707[_0x26f9('0xb')]['include']?_['map'](_0x441707[_0x26f9('0xb')][_0x26f9('0xd')],function(_0x440d77){return{'model':db[_0x440d77[_0x26f9('0xe')]],'as':_0x440d77['as'],'attributes':_0x440d77['attributes'],'include':_0x440d77['include']?_['map'](_0x440d77[_0x26f9('0xd')],function(_0x5275de){return{'model':db[_0x5275de[_0x26f9('0xe')]],'as':_0x5275de['as'],'attributes':_0x5275de[_0x26f9('0xf')],'include':_0x5275de['include']?_[_0x26f9('0x10')](_0x5275de[_0x26f9('0xd')],function(_0x4c83a7){return{'model':db[_0x4c83a7[_0x26f9('0xe')]],'as':_0x4c83a7['as'],'attributes':_0x4c83a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x26f9('0x11')](function(_0x1e1948){logger[_0x26f9('0x12')]('GetUser',_0x441707);logger[_0x26f9('0x13')](_0x26f9('0x8'),_0x441707,JSON[_0x26f9('0x14')](_0x1e1948));_0x5400a0(_0x1e1948);})[_0x26f9('0x15')](function(_0x45cb75){logger[_0x26f9('0x16')](_0x26f9('0x8'),_0x45cb75[_0x26f9('0x17')],_0x441707);_0x531074(_0x5a0bd7[_0x26f9('0x16')](0x1f4,_0x45cb75[_0x26f9('0x17')]));});});};exports[_0x26f9('0x18')]=function(_0x75dcd){var _0x117d0d=this;return new Promise(function(_0x24ad9d,_0x4c1c42){return db[_0x26f9('0x9')][_0x26f9('0x19')]({'raw':_0x75dcd[_0x26f9('0xb')]?_0x75dcd[_0x26f9('0xb')][_0x26f9('0x1a')]===undefined?!![]:![]:!![],'where':_0x75dcd[_0x26f9('0xb')]?_0x75dcd['options'][_0x26f9('0x1b')]||null:null,'attributes':_0x75dcd[_0x26f9('0xb')]?_0x75dcd[_0x26f9('0xb')][_0x26f9('0xf')]||null:null,'include':_0x75dcd[_0x26f9('0xb')]?_0x75dcd[_0x26f9('0xb')][_0x26f9('0xd')]?_[_0x26f9('0x10')](_0x75dcd[_0x26f9('0xb')][_0x26f9('0xd')],function(_0x437fb6){return{'model':db[_0x437fb6[_0x26f9('0xe')]],'as':_0x437fb6['as'],'attributes':_0x437fb6[_0x26f9('0xf')],'include':_0x437fb6[_0x26f9('0xd')]?_['map'](_0x437fb6[_0x26f9('0xd')],function(_0x506052){return{'model':db[_0x506052[_0x26f9('0xe')]],'as':_0x506052['as'],'attributes':_0x506052[_0x26f9('0xf')],'include':_0x506052[_0x26f9('0xd')]?_['map'](_0x506052['include'],function(_0x567472){return{'model':db[_0x567472[_0x26f9('0xe')]],'as':_0x567472['as'],'attributes':_0x567472['attributes']};}):[]};}):[]};}):[]:[]})[_0x26f9('0x11')](function(_0x40261b){logger[_0x26f9('0x12')](_0x26f9('0x18'),_0x75dcd);logger['debug'](_0x26f9('0x18'),_0x75dcd,JSON[_0x26f9('0x14')](_0x40261b));_0x24ad9d(_0x40261b);})[_0x26f9('0x15')](function(_0x2efe91){logger['error'](_0x26f9('0x18'),_0x2efe91[_0x26f9('0x17')],_0x75dcd);_0x4c1c42(_0x117d0d[_0x26f9('0x16')](0x1f4,_0x2efe91[_0x26f9('0x17')]));});});};exports['PauseUser']=function(_0x30efeb){var _0x59df2f;return db[_0x26f9('0x9')][_0x26f9('0x19')]({'where':_0x30efeb[_0x26f9('0xb')]['where']||{},'attributes':['id',_0x26f9('0x1c'),'role',_0x26f9('0x1d'),_0x26f9('0x1e')]})['then'](function(_0xfb9387){if(!_0xfb9387){throw new Error(util[_0x26f9('0x1f')](_0x26f9('0x20'),_0x30efeb[_0x26f9('0x21')]['id']));}_0x59df2f=_0xfb9387;return db['UserVoiceQueueRt'][_0x26f9('0x22')]({'paused':0x1},{'where':{'UserId':_0x59df2f['id']},'individualHooks':!![]});})[_0x26f9('0x11')](function(){return db[_0x26f9('0x23')][_0x26f9('0xa')]({'where':{'membername':_0x59df2f['name'],'type':_0x26f9('0x24'),'exitAt':null}});})[_0x26f9('0x11')](function(_0x197bf2){if(_0x197bf2&&_0x197bf2[_0x26f9('0x25')]){var _0x525777=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x32c227=0x0,_0x429e38=_0x197bf2[_0x26f9('0x25')];_0x32c227<_0x429e38;_0x32c227++){_0x197bf2[_0x32c227][_0x26f9('0x26')]({'exitAt':_0x525777});}}})['then'](function(){var _0x942d=[];var _0x2b2fde=utils[_0x26f9('0x27')]();_0x2b2fde[_0x26f9('0x28')](function(_0x1de3de){_0x942d[_0x26f9('0x29')]({'channel':_0x1de3de,'membername':_0x59df2f['name'],'interface':_['isNil'](_0x59df2f[_0x26f9('0x1e')])?util[_0x26f9('0x1f')](_0x26f9('0x2a'),_0x59df2f[_0x26f9('0x1c')]):_0x59df2f[_0x26f9('0x1e')],'type':'PAUSE','enterAt':moment()['format'](_0x26f9('0x2b')),'data1':_0x30efeb['body']['type']||_0x26f9('0x2c'),'role':_0x59df2f[_0x26f9('0x2d')],'internal':_0x59df2f[_0x26f9('0x1d')],'uniqueid':_0x30efeb[_0x26f9('0x2e')][_0x26f9('0x2f')]||null});});return db[_0x26f9('0x23')][_0x26f9('0x30')](_0x942d,{'individualHooks':!![]});})[_0x26f9('0x11')](function(){return _0x59df2f[_0x26f9('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x30efeb[_0x26f9('0x2e')]['type']||_0x26f9('0x2c'),'lastPauseAt':moment()[_0x26f9('0x1f')](_0x26f9('0x2b'))});})[_0x26f9('0x15')](function(_0x263164){throw _0x263164;});};exports[_0x26f9('0x31')]=function(_0xd91571){return Promise[_0x26f9('0x32')]()[_0x26f9('0x11')](function(){if(_0xd91571[_0x26f9('0x2e')][_0x26f9('0x33')]&&!utils[_0x26f9('0x34')](_0xd91571[_0x26f9('0x2e')][_0x26f9('0x33')])){throw new Error(util[_0x26f9('0x1f')](_0x26f9('0x35'),_0xd91571['body'][_0x26f9('0x33')]));}return db['User']['findOne']({'where':_0xd91571[_0x26f9('0xb')][_0x26f9('0x1b')]||{},'attributes':['id',_0x26f9('0x1c'),_0x26f9('0x2d'),_0x26f9('0x1d'),'interface',_0x26f9('0x36'),_0x26f9('0x37'),_0x26f9('0x38'),_0x26f9('0x39'),_0x26f9('0x3a'),_0x26f9('0x3b'),_0x26f9('0x3c'),_0x26f9('0x3d'),_0x26f9('0x3e'),_0x26f9('0x3f')]});})[_0x26f9('0x11')](function(_0x47ab08){if(!_0x47ab08){throw new Error(util[_0x26f9('0x1f')](_0x26f9('0x20'),_0xd91571[_0x26f9('0x21')]['id']));}return _0x47ab08['unpause'](_0xd91571['body'][_0x26f9('0x33')],'system');})[_0x26f9('0x15')](function(_0x3e5000){throw _0x3e5000;});};exports['LogoutUser']=function(_0x2a69de){var _0x408107=this;return new Promise(function(_0x3874d7,_0x363719){var _0x57a882;return db['User'][_0x26f9('0x40')]({'where':_0x2a69de[_0x26f9('0xb')]['where']||{},'attributes':['id',_0x26f9('0x1c')]})[_0x26f9('0x11')](function(_0x5e8359){if(_0x5e8359){_0x57a882=_0x5e8359;return db[_0x26f9('0x41')][_0x26f9('0x42')]({'where':{'membername':_0x57a882[_0x26f9('0x1c')]},'individualHooks':!![]});}})[_0x26f9('0x11')](function(){if(_0x57a882){return db['MemberReport'][_0x26f9('0xa')]({'where':{'membername':_0x57a882['name'],'exitAt':null}});}})[_0x26f9('0x11')](function(_0x934b10){if(_0x57a882){if(_0x934b10&&_0x934b10[_0x26f9('0x25')]){var _0x3e6474=[];_0x934b10[_0x26f9('0x28')](function(_0x53c4c4){_0x3e6474[_0x26f9('0x29')](_0x53c4c4['update']({'exitAt':moment()[_0x26f9('0x1f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x26f9('0x43')](_0x3e6474);}}})['then'](function(){if(_0x57a882){return _0x57a882[_0x26f9('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x3dfb46){_0x3874d7(_0x3dfb46);})[_0x26f9('0x15')](function(_0x59ff3e){_0x363719(_0x408107['error'](0x1f4,_0x59ff3e['message']));});});};exports[_0x26f9('0x44')]=function(_0x398e9f){var _0xfeaee6=this;return new Promise(function(_0x575a20,_0x76976b){var _0x787ca0;var _0xfdc547;var _0x487a95;var _0x67544;return db[_0x26f9('0x9')][_0x26f9('0x40')]({'where':_0x398e9f[_0x26f9('0xb')][_0x26f9('0x1b')]||{},'attributes':['id',_0x26f9('0x1c'),_0x26f9('0x2d'),_0x26f9('0x45'),_0x26f9('0x46'),_0x26f9('0x1d'),_0x26f9('0x47'),'interface']})[_0x26f9('0x11')](function(_0x47b5eb){if(_0x47b5eb){_0x787ca0=_0x47b5eb;_0x67544=_0x398e9f[_0x26f9('0x2e')][_0x26f9('0x1e')]?_0x398e9f['body'][_0x26f9('0x1e')]:util[_0x26f9('0x1f')](_0x26f9('0x2a'),_0x787ca0[_0x26f9('0x1c')]);return db[_0x26f9('0x9')][_0x26f9('0x48')]({'where':{'role':_0x26f9('0x49'),'online':!![],'id':{'$ne':_0x787ca0['id']}}});}})[_0x26f9('0x11')](function(_0x5ded99){if(_0x5ded99){_0x487a95=_0x5ded99;return require(_0x26f9('0x4a'))[_0x26f9('0x4b')]();}})[_0x26f9('0x11')](function(_0x11cf9d){if(_0x11cf9d&&_0x11cf9d[_0x26f9('0x4c')]&&_0x487a95>=_0x11cf9d[_0x26f9('0x4c')]){throw new Error(_0x26f9('0x4d'));}})[_0x26f9('0x11')](function(){if(_0x787ca0){return db[_0x26f9('0x41')][_0x26f9('0x42')]({'where':{'membername':_0x787ca0[_0x26f9('0x1c')]},'individualHooks':!![]});}})[_0x26f9('0x11')](function(){if(_0x787ca0){return _0x787ca0[_0x26f9('0x4e')]({'raw':!![]});}})[_0x26f9('0x11')](function(_0x283b9a){if(_0x787ca0){if(_0x283b9a){var _0x378297=[];_0xfdc547=_0x283b9a;if(_0xfdc547[_0x26f9('0x25')]){for(var _0x3a99da=0x0;_0x3a99da<_0xfdc547[_0x26f9('0x25')];_0x3a99da++){_0x378297[_0x26f9('0x29')](db[_0x26f9('0x41')]['upsert']({'membername':_0x787ca0[_0x26f9('0x1c')],'UserId':_0x787ca0['id'],'queue_name':_0xfdc547[_0x3a99da][_0x26f9('0x1c')],'VoiceQueueId':_0xfdc547[_0x3a99da]['id'],'interface':_0x67544,'paused':_0x787ca0[_0x26f9('0x47')]||![],'penalty':_0xfdc547[_0x3a99da][_0x26f9('0x4f')]||0x0}));}return BPromise[_0x26f9('0x43')](_0x378297);}}}})['then'](function(){if(_0x787ca0){return db['MemberReport'][_0x26f9('0xa')]({'where':{'membername':_0x787ca0[_0x26f9('0x1c')],'exitAt':null}});}})[_0x26f9('0x11')](function(_0x2327dc){if(_0x787ca0){if(_0x2327dc&&_0x2327dc[_0x26f9('0x25')]){var _0x17233f=[];_0x2327dc[_0x26f9('0x28')](function(_0x30cdb2){_0x17233f[_0x26f9('0x29')](_0x30cdb2['update']({'exitAt':moment()[_0x26f9('0x1f')](_0x26f9('0x2b'))}));});return BPromise[_0x26f9('0x43')](_0x17233f);}}})[_0x26f9('0x11')](function(){if(_0x787ca0){var _0x598217=[];var _0x4aa691=[];var _0x5563da=utils['getChannels']();var _0x466c3f={'membername':_0x787ca0[_0x26f9('0x1c')],'interface':_0x67544,'enterAt':moment()['format'](_0x26f9('0x2b')),'role':_0x787ca0[_0x26f9('0x2d')],'internal':_0x787ca0[_0x26f9('0x1d')]};_0x5563da[_0x26f9('0x28')](function(_0x593061){_0x598217[_0x26f9('0x29')](_['merge']({'channel':_0x593061,'type':_0x26f9('0x50'),'data1':'callysquare','data2':_0x67544},_0x466c3f));if(_0x787ca0['loginInPause']){_0x4aa691['push'](_[_0x26f9('0x51')]({'channel':_0x593061,'type':_0x26f9('0x24'),'data1':_0x26f9('0x52')},_0x466c3f));}});return db[_0x26f9('0x23')][_0x26f9('0x30')](_0x598217[_0x26f9('0x53')](_0x4aa691),{'individualHooks':!![]});}})['then'](function(){if(_0x787ca0){return _0x787ca0['update']({'online':!![],'lastLoginAt':moment()['format'](_0x26f9('0x2b')),'voicePause':_0x787ca0[_0x26f9('0x47')]||![],'mailPause':_0x787ca0[_0x26f9('0x47')]||![],'chatPause':_0x787ca0[_0x26f9('0x47')]||![],'faxPause':_0x787ca0['loginInPause']||![],'smsPause':_0x787ca0[_0x26f9('0x47')]||![],'openchannelPause':_0x787ca0['loginInPause']||![],'pauseType':_0x787ca0['loginInPause']?_0x26f9('0x52'):null,'lastPauseAt':moment()[_0x26f9('0x1f')](_0x26f9('0x2b')),'interface':_0x67544});}})[_0x26f9('0x11')](function(_0x5e0c07){_0x575a20(_0x5e0c07);})[_0x26f9('0x15')](function(_0x6f75e2){_0x76976b(_0xfeaee6[_0x26f9('0x16')](0x1f4,_0x6f75e2[_0x26f9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 201d16c..7fd1aab 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71a4=['removeListener','register','length','save','remove'];(function(_0x39f85c,_0x54d68b){var _0x124ff3=function(_0x291cdc){while(--_0x291cdc){_0x39f85c['push'](_0x39f85c['shift']());}};_0x124ff3(++_0x54d68b);}(_0x71a4,0x1de));var _0x471a=function(_0x465c38,_0x290e5d){_0x465c38=_0x465c38-0x0;var _0x4dc91f=_0x71a4[_0x465c38];return _0x4dc91f;};'use strict';var UserEvents=require('./user.events');var events=[_0x471a('0x0'),_0x471a('0x1'),'update'];function createListener(_0x5bc603,_0x2991f3){return function(_0x464e9b){_0x2991f3['emit'](_0x5bc603,_0x464e9b);};}function removeListener(_0x4d5549,_0x4709cb){return function(){UserEvents[_0x471a('0x2')](_0x4d5549,_0x4709cb);};}exports[_0x471a('0x3')]=function(_0x2778b4){for(var _0x169cf5=0x0,_0x10ee94=events[_0x471a('0x4')];_0x169cf5<_0x10ee94;_0x169cf5++){var _0xa6dfdb=events[_0x169cf5];var _0x24bc56=createListener('user:'+_0xa6dfdb,_0x2778b4);UserEvents['on'](_0xa6dfdb,_0x24bc56);}}; \ No newline at end of file +var _0x3068=['update','emit','removeListener','register','length','user:'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x3068,0x7e));var _0x8306=function(_0x2dc209,_0x145989){_0x2dc209=_0x2dc209-0x0;var _0x4d8008=_0x3068[_0x2dc209];return _0x4d8008;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x8306('0x0')];function createListener(_0x5cfe7e,_0x4368d3){return function(_0x398d05){_0x4368d3[_0x8306('0x1')](_0x5cfe7e,_0x398d05);};}function removeListener(_0x582520,_0x40f9c1){return function(){UserEvents[_0x8306('0x2')](_0x582520,_0x40f9c1);};}exports[_0x8306('0x3')]=function(_0x572ee0){for(var _0x961dd8=0x0,_0x1a6f8e=events[_0x8306('0x4')];_0x961dd8<_0x1a6f8e;_0x961dd8++){var _0x50b193=events[_0x961dd8];var _0x56956b=createListener(_0x8306('0x5')+_0x50b193,_0x572ee0);UserEvents['on'](_0x50b193,_0x56956b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 23d3e71..21e3784 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4f9d4e,_0x546f3d){var _0x3c8998=function(_0x1e93b5){while(--_0x1e93b5){_0x4f9d4e['push'](_0x4f9d4e['shift']());}};_0x3c8998(++_0x546f3d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0xcb91[_0x3a04ab];return _0x4bff6d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xbff2a1,_0x47429f){var _0x19767f=function(_0x2c2679){while(--_0x2c2679){_0xbff2a1['push'](_0xbff2a1['shift']());}};_0x19767f(++_0x47429f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 27a1ecd..e5e1e15 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3d1=['exports','INTEGER'];(function(_0x1fabd7,_0x3bed33){var _0x5314a1=function(_0x30e23b){while(--_0x30e23b){_0x1fabd7['push'](_0x1fabd7['shift']());}};_0x5314a1(++_0x3bed33);}(_0xf3d1,0x1da));var _0x1f3d=function(_0x1e9dd1,_0x2e180a){_0x1e9dd1=_0x1e9dd1-0x0;var _0x1752dc=_0xf3d1[_0x1e9dd1];return _0x1752dc;};'use strict';var Sequelize=require('sequelize');module[_0x1f3d('0x0')]={'penalty':{'type':Sequelize[_0x1f3d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3863=['INTEGER'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x3863,0x72));var _0x3386=function(_0x1c7adc,_0xa9404a){_0x1c7adc=_0x1c7adc-0x0;var _0x2d8cf5=_0x3863[_0x1c7adc];return _0x2d8cf5;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3386('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index b337c17..776bf1d 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x554f=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','request-promise','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x554f,0x1d2));var _0xf554=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x554f[_0x45d3f0];return _0x314b79;};'use strict';var _=require('lodash');var util=require(_0xf554('0x0'));var logger=require(_0xf554('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf554('0x2'));var fs=require('fs');var path=require(_0xf554('0x3'));var rimraf=require('rimraf');var config=require(_0xf554('0x4'));var attributes=require(_0xf554('0x5'));module[_0xf554('0x6')]=function(_0x309bda,_0x5dfc3d){return _0x309bda[_0xf554('0x7')](_0xf554('0x8'),attributes,{'tableName':_0xf554('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbfb=['user_has_chat_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xfee47a,_0x448287){var _0x9820c=function(_0x4a96c0){while(--_0x4a96c0){_0xfee47a['push'](_0xfee47a['shift']());}};_0x9820c(++_0x448287);}(_0xdbfb,0xd2));var _0xbdbf=function(_0x266b1f,_0x2c210d){_0x266b1f=_0x266b1f-0x0;var _0x15b85e=_0xdbfb[_0x266b1f];return _0x15b85e;};'use strict';var _=require(_0xbdbf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdbf('0x1'));var moment=require(_0xbdbf('0x2'));var BPromise=require(_0xbdbf('0x3'));var rp=require(_0xbdbf('0x4'));var fs=require('fs');var path=require(_0xbdbf('0x5'));var rimraf=require(_0xbdbf('0x6'));var config=require(_0xbdbf('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xbdbf('0x8')]=function(_0x4915b5,_0x30392b){return _0x4915b5[_0xbdbf('0x9')]('UserChatQueue',attributes,{'tableName':_0xbdbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 5e832e0..6d76a2d 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6118=['http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x53f3a3,_0x5c6645){var _0x192038=function(_0x253791){while(--_0x253791){_0x53f3a3['push'](_0x53f3a3['shift']());}};_0x192038(++_0x5c6645);}(_0x6118,0x12b));var _0x8611=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6118[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x8611('0x0'));var util=require(_0x8611('0x1'));var moment=require(_0x8611('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8611('0x3'));var db=require(_0x8611('0x4'))['db'];var utils=require(_0x8611('0x5'));var logger=require(_0x8611('0x6'))(_0x8611('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8611('0x8')][_0x8611('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49cb3f,_0x1c27f0,_0x167b62){return new BPromise(function(_0x55df10,_0x99bfad){return client[_0x8611('0xa')](_0x49cb3f,_0x167b62)[_0x8611('0xb')](function(_0x1349c9){logger[_0x8611('0xc')](_0x8611('0xd'),_0x1c27f0,_0x8611('0xe'));logger['debug'](_0x8611('0xf'),_0x1c27f0,'request\x20sent',JSON[_0x8611('0x10')](_0x1349c9));if(_0x1349c9[_0x8611('0x11')]){if(_0x1349c9['error'][_0x8611('0x12')]===0x1f4){logger[_0x8611('0x11')](_0x8611('0xd'),_0x1c27f0,_0x1349c9[_0x8611('0x11')][_0x8611('0x13')]);return _0x99bfad(_0x1349c9['error']['message']);}logger[_0x8611('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x1c27f0,_0x1349c9[_0x8611('0x11')][_0x8611('0x13')]);return _0x55df10(_0x1349c9[_0x8611('0x11')]['message']);}else{logger[_0x8611('0xc')](_0x8611('0xd'),_0x1c27f0,_0x8611('0xe'));_0x55df10(_0x1349c9[_0x8611('0x14')]['message']);}})[_0x8611('0x15')](function(_0x2733ba){logger[_0x8611('0x11')](_0x8611('0xd'),_0x1c27f0,_0x2733ba);_0x99bfad(_0x2733ba);});});} \ No newline at end of file +var _0x1bba=['message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2755fc,_0x3ba057){var _0x440986=function(_0x1a465d){while(--_0x1a465d){_0x2755fc['push'](_0x2755fc['shift']());}};_0x440986(++_0x3ba057);}(_0x1bba,0xb3));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 moment=require('moment');var BPromise=require(_0xa1bb('0x1'));var rs=require(_0xa1bb('0x2'));var fs=require('fs');var Redis=require(_0xa1bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1bb('0x4'));var logger=require(_0xa1bb('0x5'))(_0xa1bb('0x6'));var config=require(_0xa1bb('0x7'));var jayson=require(_0xa1bb('0x8'));var client=jayson['client'][_0xa1bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc9320b,_0x4e762c,_0x2c00c0){return new BPromise(function(_0x826f5b,_0x38dba3){return client[_0xa1bb('0xa')](_0xc9320b,_0x2c00c0)[_0xa1bb('0xb')](function(_0x4b25bc){logger[_0xa1bb('0xc')](_0xa1bb('0xd'),_0x4e762c,'request\x20sent');logger[_0xa1bb('0xe')](_0xa1bb('0xf'),_0x4e762c,'request\x20sent',JSON[_0xa1bb('0x10')](_0x4b25bc));if(_0x4b25bc[_0xa1bb('0x11')]){if(_0x4b25bc[_0xa1bb('0x11')][_0xa1bb('0x12')]===0x1f4){logger[_0xa1bb('0x11')](_0xa1bb('0xd'),_0x4e762c,_0x4b25bc[_0xa1bb('0x11')]['message']);return _0x38dba3(_0x4b25bc['error'][_0xa1bb('0x13')]);}logger[_0xa1bb('0x11')](_0xa1bb('0xd'),_0x4e762c,_0x4b25bc[_0xa1bb('0x11')][_0xa1bb('0x13')]);return _0x826f5b(_0x4b25bc[_0xa1bb('0x11')][_0xa1bb('0x13')]);}else{logger[_0xa1bb('0xc')](_0xa1bb('0xd'),_0x4e762c,_0xa1bb('0x14'));_0x826f5b(_0x4b25bc['result']['message']);}})[_0xa1bb('0x15')](function(_0x10bd4c){logger[_0xa1bb('0x11')](_0xa1bb('0xd'),_0x4e762c,_0x10bd4c);_0x38dba3(_0x10bd4c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 351375a..a85d54a 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x21f449,_0x1fa685){var _0x58f2ae=function(_0x52c003){while(--_0x52c003){_0x21f449['push'](_0x21f449['shift']());}};_0x58f2ae(++_0x1fa685);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xcb91[_0x166742];return _0xb7814a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2c1524,_0x311a60){var _0x4ddd51=function(_0x2f7fa5){while(--_0x2f7fa5){_0x2c1524['push'](_0x2c1524['shift']());}};_0x4ddd51(++_0x311a60);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 8633c76..b583cee 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45e7=['exports','INTEGER','STRING','sequelize'];(function(_0x51bc61,_0x4bec20){var _0x19fc7a=function(_0x43cf3d){while(--_0x43cf3d){_0x51bc61['push'](_0x51bc61['shift']());}};_0x19fc7a(++_0x4bec20);}(_0x45e7,0x177));var _0x745e=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x45e7[_0x22431e];return _0xd978e9;};'use strict';var Sequelize=require(_0x745e('0x0'));module[_0x745e('0x1')]={'penalty':{'type':Sequelize[_0x745e('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x745e('0x3')]}}; \ No newline at end of file +var _0x75d9=['sequelize','exports','INTEGER'];(function(_0x3704d5,_0x51d71c){var _0x421308=function(_0x5f394e){while(--_0x5f394e){_0x3704d5['push'](_0x3704d5['shift']());}};_0x421308(++_0x51d71c);}(_0x75d9,0x174));var _0x975d=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x75d9[_0x5959c9];return _0x4ffcbc;};'use strict';var Sequelize=require(_0x975d('0x0'));module[_0x975d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index e7cd86d..2cdccd8 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf3d=['../../config/logger','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','user_has_fax_queues'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xbf3d,0x70));var _0xdbf3=function(_0x528737,_0x1a0d76){_0x528737=_0x528737-0x0;var _0x2fe56b=_0xbf3d[_0x528737];return _0x2fe56b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdbf3('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdbf3('0x1'));var fs=require('fs');var path=require(_0xdbf3('0x2'));var rimraf=require(_0xdbf3('0x3'));var config=require(_0xdbf3('0x4'));var attributes=require(_0xdbf3('0x5'));module['exports']=function(_0x1c91e1,_0x2e8e93){return _0x1c91e1[_0xdbf3('0x6')]('UserFaxQueue',attributes,{'tableName':_0xdbf3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd19=['path','rimraf','define','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3b711a,_0x1c2d26){var _0x4d5dd5=function(_0x29f8f1){while(--_0x29f8f1){_0x3b711a['push'](_0x3b711a['shift']());}};_0x4d5dd5(++_0x1c2d26);}(_0xbd19,0x1bc));var _0x9bd1=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xbd19[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var logger=require(_0x9bd1('0x2'))(_0x9bd1('0x3'));var moment=require(_0x9bd1('0x4'));var BPromise=require(_0x9bd1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bd1('0x6'));var rimraf=require(_0x9bd1('0x7'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x186917,_0x1b55c1){return _0x186917[_0x9bd1('0x8')](_0x9bd1('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index ffb8b36..2fe3d64 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10aa=['code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1be184,_0x280366){var _0x5be223=function(_0x23ada3){while(--_0x23ada3){_0x1be184['push'](_0x1be184['shift']());}};_0x5be223(++_0x280366);}(_0x10aa,0x17b));var _0xa10a=function(_0x4ad512,_0x9a88a0){_0x4ad512=_0x4ad512-0x0;var _0x1bfba7=_0x10aa[_0x4ad512];return _0x1bfba7;};'use strict';var _=require(_0xa10a('0x0'));var util=require('util');var moment=require(_0xa10a('0x1'));var BPromise=require(_0xa10a('0x2'));var rs=require(_0xa10a('0x3'));var fs=require('fs');var Redis=require(_0xa10a('0x4'));var db=require(_0xa10a('0x5'))['db'];var utils=require(_0xa10a('0x6'));var logger=require(_0xa10a('0x7'))(_0xa10a('0x8'));var config=require(_0xa10a('0x9'));var jayson=require(_0xa10a('0xa'));var client=jayson['client'][_0xa10a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16c2f8,_0x5a1680,_0x417e25){return new BPromise(function(_0x60cb50,_0x5be624){return client['request'](_0x16c2f8,_0x417e25)['then'](function(_0x11e8f0){logger[_0xa10a('0xc')](_0xa10a('0xd'),_0x5a1680,_0xa10a('0xe'));logger['debug'](_0xa10a('0xf'),_0x5a1680,_0xa10a('0xe'),JSON[_0xa10a('0x10')](_0x11e8f0));if(_0x11e8f0['error']){if(_0x11e8f0['error'][_0xa10a('0x11')]===0x1f4){logger['error'](_0xa10a('0xd'),_0x5a1680,_0x11e8f0['error']['message']);return _0x5be624(_0x11e8f0[_0xa10a('0x12')][_0xa10a('0x13')]);}logger[_0xa10a('0x12')](_0xa10a('0xd'),_0x5a1680,_0x11e8f0[_0xa10a('0x12')][_0xa10a('0x13')]);return _0x60cb50(_0x11e8f0[_0xa10a('0x12')]['message']);}else{logger[_0xa10a('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x5a1680,_0xa10a('0xe'));_0x60cb50(_0x11e8f0[_0xa10a('0x14')][_0xa10a('0x13')]);}})[_0xa10a('0x15')](function(_0x3a14c6){logger[_0xa10a('0x12')](_0xa10a('0xd'),_0x5a1680,_0x3a14c6);_0x5be624(_0x3a14c6);});});} \ No newline at end of file +var _0xcdeb=['UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36d6d0,_0xab6a44){var _0x426abc=function(_0x2e65ea){while(--_0x2e65ea){_0x36d6d0['push'](_0x36d6d0['shift']());}};_0x426abc(++_0xab6a44);}(_0xcdeb,0xd9));var _0xbcde=function(_0x5e9976,_0xcd4751){_0x5e9976=_0x5e9976-0x0;var _0x1d3895=_0xcdeb[_0x5e9976];return _0x1d3895;};'use strict';var _=require(_0xbcde('0x0'));var util=require('util');var moment=require(_0xbcde('0x1'));var BPromise=require(_0xbcde('0x2'));var rs=require(_0xbcde('0x3'));var fs=require('fs');var Redis=require(_0xbcde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcde('0x5'));var logger=require(_0xbcde('0x6'))('rpc');var config=require(_0xbcde('0x7'));var jayson=require(_0xbcde('0x8'));var client=jayson[_0xbcde('0x9')][_0xbcde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24cee0,_0x56f945,_0x316663){return new BPromise(function(_0x3f9f3e,_0x2e7587){return client[_0xbcde('0xb')](_0x24cee0,_0x316663)[_0xbcde('0xc')](function(_0x30299e){logger['info'](_0xbcde('0xd'),_0x56f945,'request\x20sent');logger[_0xbcde('0xe')](_0xbcde('0xf'),_0x56f945,_0xbcde('0x10'),JSON[_0xbcde('0x11')](_0x30299e));if(_0x30299e[_0xbcde('0x12')]){if(_0x30299e[_0xbcde('0x12')][_0xbcde('0x13')]===0x1f4){logger[_0xbcde('0x12')](_0xbcde('0xd'),_0x56f945,_0x30299e['error']['message']);return _0x2e7587(_0x30299e[_0xbcde('0x12')][_0xbcde('0x14')]);}logger[_0xbcde('0x12')](_0xbcde('0xd'),_0x56f945,_0x30299e[_0xbcde('0x12')][_0xbcde('0x14')]);return _0x3f9f3e(_0x30299e[_0xbcde('0x12')][_0xbcde('0x14')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x56f945,'request\x20sent');_0x3f9f3e(_0x30299e[_0xbcde('0x15')][_0xbcde('0x14')]);}})[_0xbcde('0x16')](function(_0x38a56a){logger['error'](_0xbcde('0xd'),_0x56f945,_0x38a56a);_0x2e7587(_0x38a56a);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8b388dd..bd5e657 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5ac92d,_0x14061b){var _0x1abd6e=function(_0x241e4e){while(--_0x241e4e){_0x5ac92d['push'](_0x5ac92d['shift']());}};_0x1abd6e(++_0x14061b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b97d4,_0x461d54){var _0x37b741=function(_0x30ed53){while(--_0x30ed53){_0x2b97d4['push'](_0x2b97d4['shift']());}};_0x37b741(++_0x461d54);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0xe706[_0x2c1101];return _0x56f52f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 4a5b69f..2062e4b 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08aa=['exports','INTEGER'];(function(_0x386d12,_0x3a8cc8){var _0x4e2d68=function(_0x76107e){while(--_0x76107e){_0x386d12['push'](_0x386d12['shift']());}};_0x4e2d68(++_0x3a8cc8);}(_0x08aa,0x9a));var _0xa08a=function(_0x1ce5e0,_0x17c973){_0x1ce5e0=_0x1ce5e0-0x0;var _0x1b7a74=_0x08aa[_0x1ce5e0];return _0x1b7a74;};'use strict';var Sequelize=require('sequelize');module[_0xa08a('0x0')]={'penalty':{'type':Sequelize[_0xa08a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9c4=['INTEGER','sequelize','exports'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xa9c4,0x11e));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4a9c('0x0'));module[_0x4a9c('0x1')]={'penalty':{'type':Sequelize[_0x4a9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 9de76d2..c2b0e9d 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca14=['../../config/logger','api','moment','bluebird','path','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues'];(function(_0x50a69c,_0x302258){var _0x197d9b=function(_0x380449){while(--_0x380449){_0x50a69c['push'](_0x50a69c['shift']());}};_0x197d9b(++_0x302258);}(_0xca14,0x172));var _0x4ca1=function(_0x5869f5,_0x176fd5){_0x5869f5=_0x5869f5-0x0;var _0x6beba1=_0xca14[_0x5869f5];return _0x6beba1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ca1('0x0'))(_0x4ca1('0x1'));var moment=require(_0x4ca1('0x2'));var BPromise=require(_0x4ca1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ca1('0x4'));var rimraf=require('rimraf');var config=require(_0x4ca1('0x5'));var attributes=require(_0x4ca1('0x6'));module[_0x4ca1('0x7')]=function(_0x196349,_0x31e952){return _0x196349['define'](_0x4ca1('0x8'),attributes,{'tableName':_0x4ca1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9512=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x9512,0x73));var _0x2951=function(_0x4d830b,_0x27f78d){_0x4d830b=_0x4d830b-0x0;var _0x238c89=_0x9512[_0x4d830b];return _0x238c89;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var logger=require(_0x2951('0x2'))('api');var moment=require(_0x2951('0x3'));var BPromise=require(_0x2951('0x4'));var rp=require(_0x2951('0x5'));var fs=require('fs');var path=require(_0x2951('0x6'));var rimraf=require(_0x2951('0x7'));var config=require('../../config/environment');var attributes=require(_0x2951('0x8'));module[_0x2951('0x9')]=function(_0x55c3f1,_0x13822e){return _0x55c3f1[_0x2951('0xa')](_0x2951('0xb'),attributes,{'tableName':_0x2951('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 22a2fdf..ad88223 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1959fa,_0x5cd425){var _0x54c038=function(_0x43d1a2){while(--_0x43d1a2){_0x1959fa['push'](_0x1959fa['shift']());}};_0x54c038(++_0x5cd425);}(_0x6aa7,0x178));var _0x76aa=function(_0x1cc7bf,_0x143305){_0x1cc7bf=_0x1cc7bf-0x0;var _0x2ca440=_0x6aa7[_0x1cc7bf];return _0x2ca440;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ 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(_0x3f7eb3,_0x9416d1){var _0x32c913=function(_0x591483){while(--_0x591483){_0x3f7eb3['push'](_0x3f7eb3['shift']());}};_0x32c913(++_0x9416d1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x493bcc,_0x3e9066){_0x493bcc=_0x493bcc-0x0;var _0x51ddd9=_0x7fbe[_0x493bcc];return _0x51ddd9;};'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 diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 8531df3..966d574 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85b5=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x110e3c,_0x23f15c){var _0x26d2f4=function(_0x5a5697){while(--_0x5a5697){_0x110e3c['push'](_0x110e3c['shift']());}};_0x26d2f4(++_0x23f15c);}(_0x85b5,0xc6));var _0x585b=function(_0x205473,_0x550f04){_0x205473=_0x205473-0x0;var _0x60d838=_0x85b5[_0x205473];return _0x60d838;};'use strict';var multer=require('multer');var util=require(_0x585b('0x0'));var path=require(_0x585b('0x1'));var timeout=require(_0x585b('0x2'));var express=require(_0x585b('0x3'));var router=express[_0x585b('0x4')]();var fs_extra=require(_0x585b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x585b('0x6'));var config=require(_0x585b('0x7'));var controller=require(_0x585b('0x8'));router[_0x585b('0x9')]('/',auth[_0x585b('0xa')](),controller['sendUserNotification']);module[_0x585b('0xb')]=router; \ No newline at end of file +var _0xf26a=['sendUserNotification','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xf26a,0x18e));var _0xaf26=function(_0x199c97,_0x2c3300){_0x199c97=_0x199c97-0x0;var _0x2f7742=_0xf26a[_0x199c97];return _0x2f7742;};'use strict';var multer=require('multer');var util=require(_0xaf26('0x0'));var path=require(_0xaf26('0x1'));var timeout=require(_0xaf26('0x2'));var express=require(_0xaf26('0x3'));var router=express['Router']();var fs_extra=require(_0xaf26('0x4'));var auth=require(_0xaf26('0x5'));var interaction=require(_0xaf26('0x6'));var config=require(_0xaf26('0x7'));var controller=require(_0xaf26('0x8'));router[_0xaf26('0x9')]('/',auth['isAuthenticated'](),controller[_0xaf26('0xa')]);module[_0xaf26('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 47f3f22..0816d96 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30c5=['exports','TEXT','STRING','BOOLEAN'];(function(_0x180edc,_0x2be29c){var _0x15cbe2=function(_0x5e6015){while(--_0x5e6015){_0x180edc['push'](_0x180edc['shift']());}};_0x15cbe2(++_0x2be29c);}(_0x30c5,0x158));var _0x530c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x30c5[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0x530c('0x0')]={'body':{'type':Sequelize[_0x530c('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x530c('0x2')]},'beep':{'type':Sequelize[_0x530c('0x3')]}}; \ No newline at end of file +var _0xcd68=['sequelize','STRING','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd68,0xb8));var _0x8cd6=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xcd68[_0x2a0183];return _0x158c3a;};'use strict';var Sequelize=require(_0x8cd6('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x8cd6('0x1')]},'recipientsId':{'type':Sequelize[_0x8cd6('0x2')]},'recipientsDescription':{'type':Sequelize[_0x8cd6('0x1')]},'beep':{'type':Sequelize[_0x8cd6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f582c61..8408d30 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc52c=['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','localhost','redis','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','recipient','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','model','toLowerCase','union','ids','replace','Queue','push','all','flatten','map','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x39f060,_0xe1b897){var _0x3593e5=function(_0xaa7d0d){while(--_0xaa7d0d){_0x39f060['push'](_0x39f060['shift']());}};_0x3593e5(++_0xe1b897);}(_0xc52c,0x121));var _0xcc52=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0xc52c[_0x38841c];return _0x500610;};'use strict';var emlformat=require(_0xcc52('0x0'));var rimraf=require(_0xcc52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcc52('0x2'));var BPromise=require(_0xcc52('0x3'));var Mustache=require('mustache');var util=require(_0xcc52('0x4'));var path=require(_0xcc52('0x5'));var sox=require(_0xcc52('0x6'));var csv=require(_0xcc52('0x7'));var ejs=require(_0xcc52('0x8'));var fs=require('fs');var fs_extra=require(_0xcc52('0x9'));var _=require(_0xcc52('0xa'));var squel=require(_0xcc52('0xb'));var crypto=require(_0xcc52('0xc'));var jsforce=require(_0xcc52('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcc52('0x7'));var querystring=require(_0xcc52('0xe'));var Papa=require(_0xcc52('0xf'));var Redis=require(_0xcc52('0x10'));var authService=require(_0xcc52('0x11'));var qs=require(_0xcc52('0x12'));var as=require(_0xcc52('0x13'));var hardwareService=require(_0xcc52('0x14'));var logger=require(_0xcc52('0x15'))(_0xcc52('0x16'));var utils=require(_0xcc52('0x17'));var config=require(_0xcc52('0x18'));var licenseUtil=require(_0xcc52('0x19'));var db=require(_0xcc52('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xcc52('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc52('0x1c')]));require(_0xcc52('0x1d'))['register'](socket);function respondWithStatusCode(_0x37b152,_0x1d035c){_0x1d035c=_0x1d035c||0xcc;return function(_0x544664){if(_0x544664){return _0x37b152[_0xcc52('0x1e')](_0x1d035c);}return _0x37b152[_0xcc52('0x1f')](_0x1d035c)[_0xcc52('0x20')]();};}function respondWithResult(_0x15eb75,_0x41c6e0){_0x41c6e0=_0x41c6e0||0xc8;return function(_0x13b8d9){if(_0x13b8d9){return _0x15eb75[_0xcc52('0x1f')](_0x41c6e0)[_0xcc52('0x21')](_0x13b8d9);}};}function respondWithFilteredResult(_0x3591ca,_0x17fa5d){return function(_0x6902e6){if(_0x6902e6){var _0x1d0da0=typeof _0x17fa5d[_0xcc52('0x22')]===_0xcc52('0x23')&&typeof _0x17fa5d[_0xcc52('0x24')]===_0xcc52('0x23');var _0x32e79f=_0x6902e6[_0xcc52('0x25')];var _0x134190=_0x1d0da0?0x0:_0x17fa5d[_0xcc52('0x22')];var _0x12e09f=_0x1d0da0?_0x6902e6[_0xcc52('0x25')]:_0x17fa5d[_0xcc52('0x22')]+_0x17fa5d[_0xcc52('0x24')];var _0x3cb5df;if(_0x12e09f>=_0x32e79f){_0x12e09f=_0x32e79f;_0x3cb5df=0xc8;}else{_0x3cb5df=0xce;}_0x3591ca[_0xcc52('0x1f')](_0x3cb5df);return _0x3591ca[_0xcc52('0x26')]('Content-Range',_0x134190+'-'+_0x12e09f+'/'+_0x32e79f)['json'](_0x6902e6);}return null;};}function patchUpdates(_0x36b5ed){return function(_0x45f78f){try{jsonpatch['apply'](_0x45f78f,_0x36b5ed,!![]);}catch(_0x58a0c2){return BPromise['reject'](_0x58a0c2);}return _0x45f78f[_0xcc52('0x27')]();};}function saveUpdates(_0x49df77,_0x446a47){return function(_0x468661){if(_0x468661){return _0x468661['update'](_0x49df77)[_0xcc52('0x28')](function(_0x48a974){return _0x48a974;});}return null;};}function removeEntity(_0x2571fc,_0x27a454){return function(_0x26630b){if(_0x26630b){return _0x26630b[_0xcc52('0x29')]()[_0xcc52('0x28')](function(){_0x2571fc['status'](0xcc)[_0xcc52('0x20')]();});}};}function handleEntityNotFound(_0xc05041,_0x516609){return function(_0x198f15){if(!_0x198f15){_0xc05041['sendStatus'](0x194);}return _0x198f15;};}function handleError(_0x2844e1,_0x10ffba){_0x10ffba=_0x10ffba||0x1f4;return function(_0x23997d){logger[_0xcc52('0x2a')](_0x23997d[_0xcc52('0x2b')]);if(_0x23997d[_0xcc52('0x2c')]){delete _0x23997d['name'];}_0x2844e1['status'](_0x10ffba)[_0xcc52('0x2d')](_0x23997d);};}exports[_0xcc52('0x2e')]=function(_0x3594cd,_0x4bc5aa,_0x2c3e19){if(!_0x3594cd[_0xcc52('0x2f')]['hasOwnProperty']('text')&&!_0x3594cd[_0xcc52('0x2f')][_0xcc52('0x30')](_0xcc52('0x31'))){throw new db[(_0xcc52('0x32'))]['ValidationError'](_0xcc52('0x33'));}else{if(_0x3594cd['body'][_0xcc52('0x30')](_0xcc52('0x31'))&&!_0x3594cd[_0xcc52('0x2f')][_0xcc52('0x30')]('view')){throw new db[(_0xcc52('0x32'))][(_0xcc52('0x34'))](_0xcc52('0x35'));}if(!_0x3594cd[_0xcc52('0x2f')]['hasOwnProperty'](_0xcc52('0x36'))){throw new db['Sequelize'][(_0xcc52('0x34'))](_0xcc52('0x37'));}else{try{var _0x4a311b=JSON[_0xcc52('0x38')](_0x3594cd[_0xcc52('0x2f')][_0xcc52('0x36')]);}catch(_0x203ca0){logger['error'](_0x203ca0);throw new db[(_0xcc52('0x32'))][(_0xcc52('0x34'))](_0xcc52('0x39'));}var _0x9a0b76=[_0xcc52('0x3a'),_0xcc52('0x3b'),_0xcc52('0x3c'),_0xcc52('0x3d'),_0xcc52('0x3e'),_0xcc52('0x3f'),_0xcc52('0x40'),_0xcc52('0x41'),_0xcc52('0x42')];if(_['some'](_0x4a311b,function(_0x2bed08){return!_[_0xcc52('0x43')](_0x9a0b76,_0x2bed08['model']['toLowerCase']());})){throw new db[(_0xcc52('0x32'))][(_0xcc52('0x34'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x36acd9={};_0x36acd9['senderName']=_0x3594cd[_0xcc52('0x2f')]['hasOwnProperty'](_0xcc52('0x44'))?_0x3594cd[_0xcc52('0x2f')]['senderName']:_0x3594cd[_0xcc52('0x42')][_0xcc52('0x45')];_0x36acd9[_0xcc52('0x46')]=_['isEmpty'](_0x3594cd['body'][_0xcc52('0x46')])?null:_0x3594cd['body']['recipientsDescription'];_0x36acd9[_0xcc52('0x47')]=_0x3594cd['body']['beep']||![];_0x36acd9[_0xcc52('0x48')]=_0x3594cd['user']['id'];return getContent(_0x3594cd[_0xcc52('0x2f')])[_0xcc52('0x28')](function(_0x3d2925){_0x36acd9[_0xcc52('0x2f')]=_0x3d2925;return getRecipients(_0x4a311b);})[_0xcc52('0x28')](function(_0x34f77d){_0x36acd9[_0xcc52('0x49')]=_[_0xcc52('0x4a')](_0x34f77d)[_0xcc52('0x4b')](',');return db[_0xcc52('0x4c')][_0xcc52('0x4d')](function(_0xd3d36a){return db['UserNotification'][_0xcc52('0x4e')](_0x36acd9,{'raw':!![],'transaction':_0xd3d36a})[_0xcc52('0x28')](function(_0x457355){var _0x55a3ba={'sender':_0x36acd9[_0xcc52('0x44')],'description':_0x36acd9[_0xcc52('0x46')],'content':_0x36acd9[_0xcc52('0x2f')],'beep':_0x36acd9[_0xcc52('0x47')]};_0x34f77d[_0xcc52('0x4f')](function(_0x27fea0){_0x55a3ba[_0xcc52('0x50')]=_0x27fea0;socket[_0xcc52('0x51')](_0xcc52('0x52'),_0x55a3ba);});return _0x457355;});});})['then'](respondWithResult(_0x4bc5aa,0xc9))[_0xcc52('0x53')](handleError(_0x4bc5aa,null));};function getContent(_0x1ca69e){return new BPromise(function(_0x18e43a,_0x1039bb){if(_0x1ca69e[_0xcc52('0x54')]){_0x18e43a(_0x1ca69e[_0xcc52('0x54')]);return;}return db[_0xcc52('0x55')]['findOne']({'attributes':[_0xcc52('0x56')],'where':{'id':_0x1ca69e[_0xcc52('0x31')]},'raw':!![]})[_0xcc52('0x28')](function(_0x49998f){if(!_0x49998f)throw new db[(_0xcc52('0x32'))][(_0xcc52('0x34'))](_0xcc52('0x57'));var _0x22ef58=Mustache[_0xcc52('0x58')](_0x49998f[_0xcc52('0x56')],_0x1ca69e[_0xcc52('0x59')]);_0x18e43a(_0x22ef58);})[_0xcc52('0x53')](function(_0x3c20db){_0x1039bb(_0x3c20db);});});}function getRecipients(_0x481be4){return new BPromise(function(_0x2a0805,_0x519b3d){var _0x44ac75=[];var _0x54c75b=[];_0x481be4[_0xcc52('0x4f')](function(_0x382c5a){var _0x2ce21d=_['startCase'](_0x382c5a[_0xcc52('0x5a')][_0xcc52('0x5b')]());if(_0x2ce21d==='User'){_0x44ac75=_[_0xcc52('0x5c')](_0x44ac75,_0x382c5a[_0xcc52('0x5d')]);}else{if(_['includes'](_0x2ce21d,'queue'))_0x2ce21d=_0x2ce21d[_0xcc52('0x5e')]('queue',_0xcc52('0x5f'));_0x382c5a[_0xcc52('0x5d')][_0xcc52('0x4f')](function(_0x5890ea){_0x54c75b[_0xcc52('0x60')](getAgents(_0x2ce21d,_0x5890ea));});}});return BPromise[_0xcc52('0x61')](_0x54c75b)[_0xcc52('0x28')](function(_0x28c686){_0x44ac75=_[_0xcc52('0x5c')](_0x44ac75,_[_0xcc52('0x62')](_0x28c686));_0x2a0805(_0x44ac75);})[_0xcc52('0x53')](function(_0x49df9c){_0x519b3d(_0x49df9c);});});}function getAgents(_0x1ae80c,_0xe6917f){return new BPromise(function(_0x93af92,_0x1c5d66){return db[_0x1ae80c]['findOne']({'where':{'id':_0xe6917f}})[_0xcc52('0x28')](function(_0x1495f9){return _0x1495f9['getAgents']({'attributes':['id'],'raw':!![]})[_0xcc52('0x28')](function(_0x208c4f){var _0x48ffd1=_[_0xcc52('0x63')](_0x208c4f,'id');_0x93af92(_0x48ffd1);});})['catch'](function(_0x4b91cc){_0x1c5d66(_0x4b91cc);});});} \ No newline at end of file +var _0x72a4=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','chatqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','includes','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset'];(function(_0x47f9b7,_0x647c98){var _0xd519cd=function(_0x3a08f0){while(--_0x3a08f0){_0x47f9b7['push'](_0x47f9b7['shift']());}};_0xd519cd(++_0x647c98);}(_0x72a4,0xb1));var _0x472a=function(_0xf8aecd,_0x4631e1){_0xf8aecd=_0xf8aecd-0x0;var _0x41b3a1=_0x72a4[_0xf8aecd];return _0x41b3a1;};'use strict';var emlformat=require(_0x472a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x472a('0x1'));var rp=require('request-promise');var moment=require(_0x472a('0x2'));var BPromise=require(_0x472a('0x3'));var Mustache=require(_0x472a('0x4'));var util=require(_0x472a('0x5'));var path=require(_0x472a('0x6'));var sox=require(_0x472a('0x7'));var csv=require(_0x472a('0x8'));var ejs=require(_0x472a('0x9'));var fs=require('fs');var fs_extra=require(_0x472a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x472a('0xb'));var jsforce=require(_0x472a('0xc'));var deskjs=require(_0x472a('0xd'));var toCsv=require(_0x472a('0x8'));var querystring=require(_0x472a('0xe'));var Papa=require(_0x472a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x472a('0x10'));var as=require(_0x472a('0x11'));var hardwareService=require(_0x472a('0x12'));var logger=require(_0x472a('0x13'))(_0x472a('0x14'));var utils=require(_0x472a('0x15'));var config=require(_0x472a('0x16'));var licenseUtil=require(_0x472a('0x17'));var db=require(_0x472a('0x18'))['db'];config['redis']=_[_0x472a('0x19')](config[_0x472a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x472a('0x1b'))(new Redis(config[_0x472a('0x1a')]));require(_0x472a('0x1c'))[_0x472a('0x1d')](socket);function respondWithStatusCode(_0x3328f3,_0x2dbce9){_0x2dbce9=_0x2dbce9||0xcc;return function(_0x2cb573){if(_0x2cb573){return _0x3328f3[_0x472a('0x1e')](_0x2dbce9);}return _0x3328f3[_0x472a('0x1f')](_0x2dbce9)[_0x472a('0x20')]();};}function respondWithResult(_0x3903d1,_0x3b9050){_0x3b9050=_0x3b9050||0xc8;return function(_0x3b4a6b){if(_0x3b4a6b){return _0x3903d1[_0x472a('0x1f')](_0x3b9050)[_0x472a('0x21')](_0x3b4a6b);}};}function respondWithFilteredResult(_0x1142ae,_0x2cb995){return function(_0x3ac62c){if(_0x3ac62c){var _0x10ad9b=typeof _0x2cb995[_0x472a('0x22')]===_0x472a('0x23')&&typeof _0x2cb995[_0x472a('0x24')]==='undefined';var _0x54a53b=_0x3ac62c[_0x472a('0x25')];var _0x587d0c=_0x10ad9b?0x0:_0x2cb995[_0x472a('0x22')];var _0x5bffcc=_0x10ad9b?_0x3ac62c['count']:_0x2cb995['offset']+_0x2cb995[_0x472a('0x24')];var _0x55a5e0;if(_0x5bffcc>=_0x54a53b){_0x5bffcc=_0x54a53b;_0x55a5e0=0xc8;}else{_0x55a5e0=0xce;}_0x1142ae[_0x472a('0x1f')](_0x55a5e0);return _0x1142ae[_0x472a('0x26')](_0x472a('0x27'),_0x587d0c+'-'+_0x5bffcc+'/'+_0x54a53b)[_0x472a('0x21')](_0x3ac62c);}return null;};}function patchUpdates(_0x41d23e){return function(_0x1c064e){try{jsonpatch[_0x472a('0x28')](_0x1c064e,_0x41d23e,!![]);}catch(_0xaa3a1){return BPromise[_0x472a('0x29')](_0xaa3a1);}return _0x1c064e[_0x472a('0x2a')]();};}function saveUpdates(_0x5855c0,_0x3b5257){return function(_0x5a4269){if(_0x5a4269){return _0x5a4269[_0x472a('0x2b')](_0x5855c0)[_0x472a('0x2c')](function(_0x2ccc9c){return _0x2ccc9c;});}return null;};}function removeEntity(_0x2d6943,_0x387fad){return function(_0x49ac6a){if(_0x49ac6a){return _0x49ac6a[_0x472a('0x2d')]()[_0x472a('0x2c')](function(){_0x2d6943['status'](0xcc)[_0x472a('0x20')]();});}};}function handleEntityNotFound(_0x525a1a,_0x11a613){return function(_0x4c7cef){if(!_0x4c7cef){_0x525a1a[_0x472a('0x1e')](0x194);}return _0x4c7cef;};}function handleError(_0x3b1bd6,_0x5a8703){_0x5a8703=_0x5a8703||0x1f4;return function(_0x2796c9){logger['error'](_0x2796c9['stack']);if(_0x2796c9[_0x472a('0x2e')]){delete _0x2796c9[_0x472a('0x2e')];}_0x3b1bd6[_0x472a('0x1f')](_0x5a8703)[_0x472a('0x2f')](_0x2796c9);};}exports[_0x472a('0x30')]=function(_0x264569,_0x54fb28,_0x1f3fd9){if(!_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x33'))&&!_0x264569[_0x472a('0x31')][_0x472a('0x32')]('TemplateId')){throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x36'));}else{if(_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x37'))&&!_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x38'))){throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x39'));}if(!_0x264569['body'][_0x472a('0x32')]('recipients')){throw new db['Sequelize'][(_0x472a('0x35'))](_0x472a('0x3a'));}else{try{var _0x3d888e=JSON[_0x472a('0x3b')](_0x264569['body'][_0x472a('0x3c')]);}catch(_0x2dfd3a){logger[_0x472a('0x3d')](_0x2dfd3a);throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x407434=[_0x472a('0x3e'),'faxqueue','mailqueue',_0x472a('0x3f'),_0x472a('0x40'),'voicequeue',_0x472a('0x41'),'team',_0x472a('0x42')];if(_[_0x472a('0x43')](_0x3d888e,function(_0x3f666e){return!_['includes'](_0x407434,_0x3f666e[_0x472a('0x44')][_0x472a('0x45')]());})){throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x46'));}}}var _0x166bce={};_0x166bce[_0x472a('0x47')]=_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x47'))?_0x264569['body'][_0x472a('0x47')]:_0x264569[_0x472a('0x42')][_0x472a('0x48')];_0x166bce[_0x472a('0x49')]=_[_0x472a('0x4a')](_0x264569['body'][_0x472a('0x49')])?null:_0x264569['body']['recipientsDescription'];_0x166bce['beep']=_0x264569[_0x472a('0x31')][_0x472a('0x4b')]||![];_0x166bce['SenderId']=_0x264569[_0x472a('0x42')]['id'];return getContent(_0x264569[_0x472a('0x31')])[_0x472a('0x2c')](function(_0x474b96){_0x166bce[_0x472a('0x31')]=_0x474b96;return getRecipients(_0x3d888e);})[_0x472a('0x2c')](function(_0x4ee5f9){_0x166bce[_0x472a('0x4c')]=_[_0x472a('0x4d')](_0x4ee5f9)[_0x472a('0x4e')](',');return db[_0x472a('0x4f')][_0x472a('0x50')](function(_0x236fb7){return db[_0x472a('0x51')][_0x472a('0x52')](_0x166bce,{'raw':!![],'transaction':_0x236fb7})[_0x472a('0x2c')](function(_0x3d3b54){var _0xda7327={'sender':_0x166bce[_0x472a('0x47')],'description':_0x166bce[_0x472a('0x49')],'content':_0x166bce[_0x472a('0x31')],'beep':_0x166bce['beep']};_0x4ee5f9[_0x472a('0x53')](function(_0x35c631){_0xda7327[_0x472a('0x54')]=_0x35c631;socket[_0x472a('0x55')](_0x472a('0x56'),_0xda7327);});return _0x3d3b54;});});})[_0x472a('0x2c')](respondWithResult(_0x54fb28,0xc9))['catch'](handleError(_0x54fb28,null));};function getContent(_0x5c5c09){return new BPromise(function(_0x25e6aa,_0x45e8c4){if(_0x5c5c09['text']){_0x25e6aa(_0x5c5c09[_0x472a('0x33')]);return;}return db[_0x472a('0x57')][_0x472a('0x58')]({'attributes':[_0x472a('0x59')],'where':{'id':_0x5c5c09[_0x472a('0x37')]},'raw':!![]})[_0x472a('0x2c')](function(_0x18216d){if(!_0x18216d)throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x5a'));var _0x383e7b=Mustache[_0x472a('0x5b')](_0x18216d['html'],_0x5c5c09[_0x472a('0x38')]);_0x25e6aa(_0x383e7b);})[_0x472a('0x5c')](function(_0x3773fc){_0x45e8c4(_0x3773fc);});});}function getRecipients(_0x5513eb){return new BPromise(function(_0x28029a,_0x43e2f7){var _0x4be71b=[];var _0x17a451=[];_0x5513eb[_0x472a('0x53')](function(_0x114d14){var _0x893f45=_[_0x472a('0x5d')](_0x114d14[_0x472a('0x44')][_0x472a('0x45')]());if(_0x893f45===_0x472a('0x5e')){_0x4be71b=_[_0x472a('0x5f')](_0x4be71b,_0x114d14[_0x472a('0x60')]);}else{if(_[_0x472a('0x61')](_0x893f45,_0x472a('0x62')))_0x893f45=_0x893f45[_0x472a('0x63')](_0x472a('0x62'),_0x472a('0x64'));_0x114d14[_0x472a('0x60')][_0x472a('0x53')](function(_0x303158){_0x17a451[_0x472a('0x65')](getAgents(_0x893f45,_0x303158));});}});return BPromise[_0x472a('0x66')](_0x17a451)[_0x472a('0x2c')](function(_0x2d3468){_0x4be71b=_['union'](_0x4be71b,_[_0x472a('0x67')](_0x2d3468));_0x28029a(_0x4be71b);})['catch'](function(_0x749bb3){_0x43e2f7(_0x749bb3);});});}function getAgents(_0x31b9c9,_0x489d40){return new BPromise(function(_0x4d71df,_0x587ae5){return db[_0x31b9c9][_0x472a('0x58')]({'where':{'id':_0x489d40}})[_0x472a('0x2c')](function(_0x6d1f9e){return _0x6d1f9e[_0x472a('0x68')]({'attributes':['id'],'raw':!![]})[_0x472a('0x2c')](function(_0x2f607e){var _0x187752=_[_0x472a('0x69')](_0x2f607e,'id');_0x4d71df(_0x187752);});})[_0x472a('0x5c')](function(_0x41f4dd){_0x587ae5(_0x41f4dd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 5d173f9..a783833 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf98f=['remove','emit','hasOwnProperty','exports','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf98f,0x94));var _0xff98=function(_0x4e3915,_0x5b5efa){_0x4e3915=_0x4e3915-0x0;var _0x1a609a=_0xf98f[_0x4e3915];return _0x1a609a;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xff98('0x0'))['db'][_0xff98('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xff98('0x2')](0x0);var events={'afterCreate':_0xff98('0x3'),'afterUpdate':_0xff98('0x4'),'afterDestroy':_0xff98('0x5')};function emitEvent(_0xf087a3){return function(_0x21424e,_0xf9cd77,_0x5c0f73){UserNotificationEvents[_0xff98('0x6')](_0xf087a3+':'+_0x21424e['id'],_0x21424e);UserNotificationEvents[_0xff98('0x6')](_0xf087a3,_0x21424e);_0x5c0f73(null);};}for(var e in events){if(events[_0xff98('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xff98('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x4a3a=['events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5af8c2,_0x2aa6d8){var _0x2f2cc4=function(_0x2bc4db){while(--_0x2bc4db){_0x5af8c2['push'](_0x5af8c2['shift']());}};_0x2f2cc4(++_0x2aa6d8);}(_0x4a3a,0xb4));var _0xa4a3=function(_0x1a15a4,_0x13ed3b){_0x1a15a4=_0x1a15a4-0x0;var _0x214d03=_0x4a3a[_0x1a15a4];return _0x214d03;};'use strict';var EventEmitter=require(_0xa4a3('0x0'));var UserNotification=require(_0xa4a3('0x1'))['db'][_0xa4a3('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa4a3('0x3')](0x0);var events={'afterCreate':_0xa4a3('0x4'),'afterUpdate':'update','afterDestroy':_0xa4a3('0x5')};function emitEvent(_0x31e327){return function(_0xad4d06,_0x58b8c1,_0x59cd19){UserNotificationEvents[_0xa4a3('0x6')](_0x31e327+':'+_0xad4d06['id'],_0xad4d06);UserNotificationEvents[_0xa4a3('0x6')](_0x31e327,_0xad4d06);_0x59cd19(null);};}for(var e in events){if(events[_0xa4a3('0x7')](e)){var event=events[e];UserNotification[_0xa4a3('0x8')](e,emitEvent(event));}}module[_0xa4a3('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 605af4c..0ddabc8 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9323=['lodash','util','../../config/logger','api','moment','path','rimraf','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4'];(function(_0x1b4cb5,_0x243d8a){var _0xad10c7=function(_0x14f899){while(--_0x14f899){_0x1b4cb5['push'](_0x1b4cb5['shift']());}};_0xad10c7(++_0x243d8a);}(_0x9323,0x84));var _0x3932=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9323[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3932('0x0'));var util=require(_0x3932('0x1'));var logger=require(_0x3932('0x2'))(_0x3932('0x3'));var moment=require(_0x3932('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3932('0x5'));var rimraf=require(_0x3932('0x6'));var config=require('../../config/environment');var attributes=require(_0x3932('0x7'));module['exports']=function(_0x452e01,_0x416095){return _0x452e01[_0x3932('0x8')](_0x3932('0x9'),attributes,{'tableName':_0x3932('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3932('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8a56=['api','moment','request-promise','path','rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x316c50,_0x3811f1){var _0x150e8b=function(_0x4fbdcf){while(--_0x4fbdcf){_0x316c50['push'](_0x316c50['shift']());}};_0x150e8b(++_0x3811f1);}(_0x8a56,0x131));var _0x68a5=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x8a56[_0x5cc51f];return _0x315a2f;};'use strict';var _=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var logger=require(_0x68a5('0x2'))(_0x68a5('0x3'));var moment=require(_0x68a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x68a5('0x5'));var fs=require('fs');var path=require(_0x68a5('0x6'));var rimraf=require(_0x68a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x68a5('0x8'));module[_0x68a5('0x9')]=function(_0x3010a7,_0x254eaa){return _0x3010a7['define'](_0x68a5('0xa'),attributes,{'tableName':_0x68a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68a5('0xc'),'collate':_0x68a5('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index edba825..b37ea99 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8763=['redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2c2f5e,_0x58c448){var _0x5ec1b2=function(_0x4dd6d0){while(--_0x4dd6d0){_0x2c2f5e['push'](_0x2c2f5e['shift']());}};_0x5ec1b2(++_0x58c448);}(_0x8763,0x117));var _0x3876=function(_0x2e2b8f,_0x2a1b39){_0x2e2b8f=_0x2e2b8f-0x0;var _0x1c1af4=_0x8763[_0x2e2b8f];return _0x1c1af4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3876('0x0'));var BPromise=require('bluebird');var rs=require(_0x3876('0x1'));var fs=require('fs');var Redis=require(_0x3876('0x2'));var db=require(_0x3876('0x3'))['db'];var utils=require(_0x3876('0x4'));var logger=require(_0x3876('0x5'))(_0x3876('0x6'));var config=require(_0x3876('0x7'));var jayson=require(_0x3876('0x8'));var client=jayson[_0x3876('0x9')][_0x3876('0xa')]({'port':0x232a});config[_0x3876('0xb')]=_[_0x3876('0xc')](config[_0x3876('0xb')],{'host':_0x3876('0xd'),'port':0x18eb});var socket=require(_0x3876('0xe'))(new Redis(config['redis']));require(_0x3876('0xf'))['register'](socket);function respondWithRpcPromise(_0x452fd3,_0x4ddf4f,_0x1abfaa){return new BPromise(function(_0xb5bf8b,_0x411b9c){return client[_0x3876('0x10')](_0x452fd3,_0x1abfaa)[_0x3876('0x11')](function(_0x278cfa){logger[_0x3876('0x12')](_0x3876('0x13'),_0x4ddf4f,_0x3876('0x14'));logger[_0x3876('0x15')](_0x3876('0x16'),_0x4ddf4f,_0x3876('0x14'),JSON[_0x3876('0x17')](_0x278cfa));if(_0x278cfa[_0x3876('0x18')]){if(_0x278cfa[_0x3876('0x18')][_0x3876('0x19')]===0x1f4){logger[_0x3876('0x18')]('UserNotification,\x20%s,\x20%s',_0x4ddf4f,_0x278cfa['error']['message']);return _0x411b9c(_0x278cfa[_0x3876('0x18')][_0x3876('0x1a')]);}logger[_0x3876('0x18')](_0x3876('0x13'),_0x4ddf4f,_0x278cfa[_0x3876('0x18')][_0x3876('0x1a')]);return _0xb5bf8b(_0x278cfa[_0x3876('0x18')][_0x3876('0x1a')]);}else{logger['info'](_0x3876('0x13'),_0x4ddf4f,_0x3876('0x14'));_0xb5bf8b(_0x278cfa[_0x3876('0x1b')][_0x3876('0x1a')]);}})[_0x3876('0x1c')](function(_0x550a54){logger[_0x3876('0x18')]('UserNotification,\x20%s,\x20%s',_0x4ddf4f,_0x550a54);_0x411b9c(_0x550a54);});});} \ No newline at end of file +var _0x9921=['../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1e69e9,_0x5c47ba){var _0x4d4a14=function(_0x5ae945){while(--_0x5ae945){_0x1e69e9['push'](_0x1e69e9['shift']());}};_0x4d4a14(++_0x5c47ba);}(_0x9921,0x190));var _0x1992=function(_0x4f3e3f,_0x5126b6){_0x4f3e3f=_0x4f3e3f-0x0;var _0x597218=_0x9921[_0x4f3e3f];return _0x597218;};'use strict';var _=require('lodash');var util=require(_0x1992('0x0'));var moment=require(_0x1992('0x1'));var BPromise=require(_0x1992('0x2'));var rs=require(_0x1992('0x3'));var fs=require('fs');var Redis=require(_0x1992('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1992('0x5'))('rpc');var config=require(_0x1992('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1992('0x7')][_0x1992('0x8')]({'port':0x232a});config[_0x1992('0x9')]=_[_0x1992('0xa')](config['redis'],{'host':_0x1992('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1992('0x9')]));require(_0x1992('0xc'))[_0x1992('0xd')](socket);function respondWithRpcPromise(_0x44f30d,_0xd337a5,_0x28579e){return new BPromise(function(_0x3ab322,_0xfcfb2f){return client[_0x1992('0xe')](_0x44f30d,_0x28579e)[_0x1992('0xf')](function(_0x107071){logger['info'](_0x1992('0x10'),_0xd337a5,_0x1992('0x11'));logger[_0x1992('0x12')](_0x1992('0x13'),_0xd337a5,_0x1992('0x11'),JSON[_0x1992('0x14')](_0x107071));if(_0x107071[_0x1992('0x15')]){if(_0x107071[_0x1992('0x15')][_0x1992('0x16')]===0x1f4){logger['error'](_0x1992('0x10'),_0xd337a5,_0x107071[_0x1992('0x15')][_0x1992('0x17')]);return _0xfcfb2f(_0x107071['error']['message']);}logger[_0x1992('0x15')]('UserNotification,\x20%s,\x20%s',_0xd337a5,_0x107071[_0x1992('0x15')][_0x1992('0x17')]);return _0x3ab322(_0x107071['error'][_0x1992('0x17')]);}else{logger[_0x1992('0x18')](_0x1992('0x10'),_0xd337a5,_0x1992('0x11'));_0x3ab322(_0x107071[_0x1992('0x19')][_0x1992('0x17')]);}})[_0x1992('0x1a')](function(_0x34c76b){logger['error'](_0x1992('0x10'),_0xd337a5,_0x34c76b);_0xfcfb2f(_0x34c76b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 9e824a0..f7af635 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d09=['update','register','userNotification:','save','remove'];(function(_0x45451b,_0x5e62d5){var _0x5be78f=function(_0x2c8553){while(--_0x2c8553){_0x45451b['push'](_0x45451b['shift']());}};_0x5be78f(++_0x5e62d5);}(_0x3d09,0x9e));var _0x93d0=function(_0xbf8ea8,_0x324f4e){_0xbf8ea8=_0xbf8ea8-0x0;var _0x41ed2d=_0x3d09[_0xbf8ea8];return _0x41ed2d;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x93d0('0x0'),_0x93d0('0x1'),_0x93d0('0x2')];function createListener(_0x498475,_0x1834ae){return function(_0x1fce75){_0x1834ae['emit'](_0x498475,_0x1fce75);};}function removeListener(_0x37f397,_0x3c0b8f){return function(){UserNotificationEvents['removeListener'](_0x37f397,_0x3c0b8f);};}exports[_0x93d0('0x3')]=function(_0x3adb2e){for(var _0x2663f0=0x0,_0xd51eef=events['length'];_0x2663f0<_0xd51eef;_0x2663f0++){var _0x11fb30=events[_0x2663f0];var _0x2a331e=createListener(_0x93d0('0x4')+_0x11fb30,_0x3adb2e);UserNotificationEvents['on'](_0x11fb30,_0x2a331e);}}; \ No newline at end of file +var _0x2bb1=['remove','update','emit','register','length','userNotification:','./userNotification.events','save'];(function(_0x2a2e95,_0x5c626e){var _0x54e62e=function(_0x4b1ace){while(--_0x4b1ace){_0x2a2e95['push'](_0x2a2e95['shift']());}};_0x54e62e(++_0x5c626e);}(_0x2bb1,0x1a6));var _0x12bb=function(_0x2cf565,_0x267a66){_0x2cf565=_0x2cf565-0x0;var _0x42a3fe=_0x2bb1[_0x2cf565];return _0x42a3fe;};'use strict';var UserNotificationEvents=require(_0x12bb('0x0'));var events=[_0x12bb('0x1'),_0x12bb('0x2'),_0x12bb('0x3')];function createListener(_0x3c273f,_0x2648a7){return function(_0x3dcb6b){_0x2648a7[_0x12bb('0x4')](_0x3c273f,_0x3dcb6b);};}function removeListener(_0x10cbea,_0x5ac7bf){return function(){UserNotificationEvents['removeListener'](_0x10cbea,_0x5ac7bf);};}exports[_0x12bb('0x5')]=function(_0x285111){for(var _0x4d066d=0x0,_0x33b877=events[_0x12bb('0x6')];_0x4d066d<_0x33b877;_0x4d066d++){var _0x4f3a40=events[_0x4d066d];var _0xe5a0d9=createListener(_0x12bb('0x7')+_0x4f3a40,_0x285111);UserNotificationEvents['on'](_0x4f3a40,_0xe5a0d9);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 822362c..7145e6a 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c4d45,_0x3bf4f1){var _0x42ee3a=function(_0x29d62b){while(--_0x29d62b){_0x3c4d45['push'](_0x3c4d45['shift']());}};_0x42ee3a(++_0x3bf4f1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0xcb91[_0x2f3ecd];return _0xffdc44;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x22e794,_0x4bab6e){var _0x1b1954=function(_0x428931){while(--_0x428931){_0x22e794['push'](_0x22e794['shift']());}};_0x1b1954(++_0x4bab6e);}(_0xedd9,0xfc));var _0x9edd=function(_0x179550,_0x1cee4c){_0x179550=_0x179550-0x0;var _0x4165bc=_0xedd9[_0x179550];return _0x4165bc;};'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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 412d223..e91092a 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc090=['INTEGER','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc090,0x112));var _0x0c09=function(_0x4ceb58,_0x93010e){_0x4ceb58=_0x4ceb58-0x0;var _0x26c987=_0xc090[_0x4ceb58];return _0x26c987;};'use strict';var Sequelize=require(_0x0c09('0x0'));module[_0x0c09('0x1')]={'penalty':{'type':Sequelize[_0x0c09('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x80ea=['INTEGER','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x80ea,0x1cf));var _0xa80e=function(_0x1bdef8,_0x5c8d75){_0x1bdef8=_0x1bdef8-0x0;var _0x45755a=_0x80ea[_0x1bdef8];return _0x45755a;};'use strict';var Sequelize=require(_0xa80e('0x0'));module[_0xa80e('0x1')]={'penalty':{'type':Sequelize[_0xa80e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index a5838a6..d4051b2 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50ef=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x493c48,_0x4a41a8){var _0x598d76=function(_0xf25c10){while(--_0xf25c10){_0x493c48['push'](_0x493c48['shift']());}};_0x598d76(++_0x4a41a8);}(_0x50ef,0x173));var _0xf50e=function(_0x3e5349,_0x143a5c){_0x3e5349=_0x3e5349-0x0;var _0x5d8637=_0x50ef[_0x3e5349];return _0x5d8637;};'use strict';var _=require(_0xf50e('0x0'));var util=require(_0xf50e('0x1'));var logger=require(_0xf50e('0x2'))(_0xf50e('0x3'));var moment=require(_0xf50e('0x4'));var BPromise=require('bluebird');var rp=require(_0xf50e('0x5'));var fs=require('fs');var path=require(_0xf50e('0x6'));var rimraf=require(_0xf50e('0x7'));var config=require(_0xf50e('0x8'));var attributes=require(_0xf50e('0x9'));module[_0xf50e('0xa')]=function(_0x14a823,_0x893f22){return _0x14a823[_0xf50e('0xb')](_0xf50e('0xc'),attributes,{'tableName':_0xf50e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x574a=['path','rimraf','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1a4050,_0x3d27c9){var _0x20c621=function(_0x18f7ae){while(--_0x18f7ae){_0x1a4050['push'](_0x1a4050['shift']());}};_0x20c621(++_0x3d27c9);}(_0x574a,0x13a));var _0xa574=function(_0x585f6c,_0x537b7a){_0x585f6c=_0x585f6c-0x0;var _0x598331=_0x574a[_0x585f6c];return _0x598331;};'use strict';var _=require(_0xa574('0x0'));var util=require('util');var logger=require(_0xa574('0x1'))('api');var moment=require(_0xa574('0x2'));var BPromise=require(_0xa574('0x3'));var rp=require(_0xa574('0x4'));var fs=require('fs');var path=require(_0xa574('0x5'));var rimraf=require(_0xa574('0x6'));var config=require('../../config/environment');var attributes=require(_0xa574('0x7'));module[_0xa574('0x8')]=function(_0xa9bbc8,_0x2ff3d9){return _0xa9bbc8[_0xa574('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xa574('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index acd192e..8e8eab1 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8797=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8797,0x79));var _0x7879=function(_0x86597f,_0x5dc3b3){_0x86597f=_0x86597f-0x0;var _0x1f4e98=_0x8797[_0x86597f];return _0x1f4e98;};'use strict';var _=require(_0x7879('0x0'));var util=require(_0x7879('0x1'));var moment=require(_0x7879('0x2'));var BPromise=require('bluebird');var rs=require(_0x7879('0x3'));var fs=require('fs');var Redis=require(_0x7879('0x4'));var db=require(_0x7879('0x5'))['db'];var utils=require(_0x7879('0x6'));var logger=require(_0x7879('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7879('0x8'));var client=jayson[_0x7879('0x9')][_0x7879('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16b00d,_0x507d72,_0x56a268){return new BPromise(function(_0x53a2b4,_0x570484){return client[_0x7879('0xb')](_0x16b00d,_0x56a268)[_0x7879('0xc')](function(_0x2fc33a){logger[_0x7879('0xd')](_0x7879('0xe'),_0x507d72,_0x7879('0xf'));logger['debug'](_0x7879('0x10'),_0x507d72,_0x7879('0xf'),JSON[_0x7879('0x11')](_0x2fc33a));if(_0x2fc33a[_0x7879('0x12')]){if(_0x2fc33a[_0x7879('0x12')][_0x7879('0x13')]===0x1f4){logger[_0x7879('0x12')](_0x7879('0xe'),_0x507d72,_0x2fc33a[_0x7879('0x12')][_0x7879('0x14')]);return _0x570484(_0x2fc33a['error'][_0x7879('0x14')]);}logger[_0x7879('0x12')](_0x7879('0xe'),_0x507d72,_0x2fc33a[_0x7879('0x12')][_0x7879('0x14')]);return _0x53a2b4(_0x2fc33a[_0x7879('0x12')][_0x7879('0x14')]);}else{logger[_0x7879('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x507d72,_0x7879('0xf'));_0x53a2b4(_0x2fc33a[_0x7879('0x15')][_0x7879('0x14')]);}})[_0x7879('0x16')](function(_0x425ad9){logger[_0x7879('0x12')](_0x7879('0xe'),_0x507d72,_0x425ad9);_0x570484(_0x425ad9);});});} \ No newline at end of file +var _0x8786=['UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x2eee93,_0x2953b4){var _0x371bf9=function(_0x1594e8){while(--_0x1594e8){_0x2eee93['push'](_0x2eee93['shift']());}};_0x371bf9(++_0x2953b4);}(_0x8786,0x138));var _0x6878=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8786[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6878('0x0'));var util=require('util');var moment=require(_0x6878('0x1'));var BPromise=require(_0x6878('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6878('0x3'))['db'];var utils=require(_0x6878('0x4'));var logger=require('../../config/logger')(_0x6878('0x5'));var config=require(_0x6878('0x6'));var jayson=require(_0x6878('0x7'));var client=jayson[_0x6878('0x8')][_0x6878('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1517d7,_0x153b9a,_0x1146bd){return new BPromise(function(_0x5ca7ec,_0x4b707d){return client['request'](_0x1517d7,_0x1146bd)['then'](function(_0x43a7b8){logger[_0x6878('0xa')](_0x6878('0xb'),_0x153b9a,'request\x20sent');logger['debug'](_0x6878('0xc'),_0x153b9a,_0x6878('0xd'),JSON['stringify'](_0x43a7b8));if(_0x43a7b8['error']){if(_0x43a7b8[_0x6878('0xe')]['code']===0x1f4){logger[_0x6878('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x153b9a,_0x43a7b8[_0x6878('0xe')]['message']);return _0x4b707d(_0x43a7b8[_0x6878('0xe')][_0x6878('0xf')]);}logger['error'](_0x6878('0xb'),_0x153b9a,_0x43a7b8[_0x6878('0xe')]['message']);return _0x5ca7ec(_0x43a7b8[_0x6878('0xe')][_0x6878('0xf')]);}else{logger[_0x6878('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x153b9a,_0x6878('0xd'));_0x5ca7ec(_0x43a7b8[_0x6878('0x10')][_0x6878('0xf')]);}})['catch'](function(_0x11efbf){logger[_0x6878('0xe')](_0x6878('0xb'),_0x153b9a,_0x11efbf);_0x4b707d(_0x11efbf);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b5685c0..a28be37 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a00=['show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','addSections','addResources','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a00,0x1ef));var _0x08a0=function(_0x581e81,_0x13cf76){_0x581e81=_0x581e81-0x0;var _0x1a61bc=_0x8a00[_0x581e81];return _0x1a61bc;};'use strict';var multer=require(_0x08a0('0x0'));var util=require(_0x08a0('0x1'));var path=require(_0x08a0('0x2'));var timeout=require(_0x08a0('0x3'));var express=require(_0x08a0('0x4'));var router=express[_0x08a0('0x5')]();var fs_extra=require(_0x08a0('0x6'));var auth=require(_0x08a0('0x7'));var interaction=require(_0x08a0('0x8'));var config=require(_0x08a0('0x9'));var controller=require(_0x08a0('0xa'));router[_0x08a0('0xb')]('/',auth[_0x08a0('0xc')](),controller[_0x08a0('0xd')]);router['get'](_0x08a0('0xe'),auth[_0x08a0('0xc')](),controller[_0x08a0('0xf')]);router[_0x08a0('0xb')](_0x08a0('0x10'),auth[_0x08a0('0xc')](),controller[_0x08a0('0x11')]);router[_0x08a0('0xb')](_0x08a0('0x12'),auth[_0x08a0('0xc')](),controller[_0x08a0('0x13')]);router[_0x08a0('0xb')](_0x08a0('0x14'),auth['isAuthenticated'](),controller[_0x08a0('0x15')]);router['post']('/',auth[_0x08a0('0xc')](),controller[_0x08a0('0x16')]);router[_0x08a0('0x17')](_0x08a0('0x18'),auth[_0x08a0('0xc')](),controller['clone']);router['post'](_0x08a0('0x12'),auth[_0x08a0('0xc')](),controller[_0x08a0('0x19')]);router[_0x08a0('0x17')](_0x08a0('0x14'),auth['isAuthenticated'](),controller[_0x08a0('0x1a')]);router['put'](_0x08a0('0x10'),auth[_0x08a0('0xc')](),controller['update']);router[_0x08a0('0x1b')](_0x08a0('0x10'),auth['isAuthenticated'](),controller[_0x08a0('0x1c')]);router['delete'](_0x08a0('0x12'),auth[_0x08a0('0xc')](),controller[_0x08a0('0x1d')]);router['delete'](_0x08a0('0x14'),auth[_0x08a0('0xc')](),controller[_0x08a0('0x1e')]);module[_0x08a0('0x1f')]=router; \ No newline at end of file +var _0x177e=['post','create','/:id/clone','clone','addSections','addResources','put','update','delete','exports','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/sections','getSections','/:id/resources'];(function(_0x1c6ea4,_0x21e492){var _0x24da5c=function(_0x361506){while(--_0x361506){_0x1c6ea4['push'](_0x1c6ea4['shift']());}};_0x24da5c(++_0x21e492);}(_0x177e,0xd0));var _0xe177=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x177e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe177('0x0'));var interaction=require(_0xe177('0x1'));var config=require(_0xe177('0x2'));var controller=require('./userProfile.controller');router['get']('/',auth[_0xe177('0x3')](),controller[_0xe177('0x4')]);router[_0xe177('0x5')]('/describe',auth[_0xe177('0x3')](),controller[_0xe177('0x6')]);router['get'](_0xe177('0x7'),auth[_0xe177('0x3')](),controller[_0xe177('0x8')]);router[_0xe177('0x5')](_0xe177('0x9'),auth['isAuthenticated'](),controller[_0xe177('0xa')]);router[_0xe177('0x5')](_0xe177('0xb'),auth[_0xe177('0x3')](),controller['getResources']);router[_0xe177('0xc')]('/',auth[_0xe177('0x3')](),controller[_0xe177('0xd')]);router[_0xe177('0xc')](_0xe177('0xe'),auth[_0xe177('0x3')](),controller[_0xe177('0xf')]);router['post']('/:id/sections',auth[_0xe177('0x3')](),controller[_0xe177('0x10')]);router[_0xe177('0xc')]('/:id/resources',auth[_0xe177('0x3')](),controller[_0xe177('0x11')]);router[_0xe177('0x12')](_0xe177('0x7'),auth[_0xe177('0x3')](),controller[_0xe177('0x13')]);router['delete']('/:id',auth[_0xe177('0x3')](),controller['destroy']);router['delete']('/:id/sections',auth[_0xe177('0x3')](),controller['removeSections']);router[_0xe177('0x14')]('/:id/resources',auth[_0xe177('0x3')](),controller['removeResources']);module[_0xe177('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 22c6de3..09937ff 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd927=['getDataValue','split','BOOLEAN','exports','STRING','name','crudPermissions','join'];(function(_0x52af16,_0x59cb6f){var _0x7e642c=function(_0x2c0ccc){while(--_0x2c0ccc){_0x52af16['push'](_0x52af16['shift']());}};_0x7e642c(++_0x59cb6f);}(_0xd927,0x1d3));var _0x7d92=function(_0x51a556,_0x54aec4){_0x51a556=_0x51a556-0x0;var _0x30cdb6=_0xd927[_0x51a556];return _0x30cdb6;};'use strict';var Sequelize=require('sequelize');module[_0x7d92('0x0')]={'name':{'type':Sequelize[_0x7d92('0x1')],'allowNull':![],'unique':_0x7d92('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x293255){this['setDataValue'](_0x7d92('0x3'),_0x293255?_0x293255[_0x7d92('0x4')](''):[]);},'get':function(){return this[_0x7d92('0x5')](_0x7d92('0x3'))?this['getDataValue']('crudPermissions')[_0x7d92('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7d92('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7d92('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7d92('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7d92('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7d92('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7d92('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5759=['STRING','name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x6e0d59,_0x4ffd88){var _0x11601d=function(_0x2b73ad){while(--_0x2b73ad){_0x6e0d59['push'](_0x6e0d59['shift']());}};_0x11601d(++_0x4ffd88);}(_0x5759,0x1c0));var _0x9575=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5759[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x9575('0x0'));module[_0x9575('0x1')]={'name':{'type':Sequelize[_0x9575('0x2')],'allowNull':![],'unique':_0x9575('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x31c8c7){this[_0x9575('0x4')](_0x9575('0x5'),_0x31c8c7?_0x31c8c7['join'](''):[]);},'get':function(){return this[_0x9575('0x6')]('crudPermissions')?this[_0x9575('0x6')](_0x9575('0x5'))[_0x9575('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9575('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9575('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e87fa91..9a2494a 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68e5=['status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','rows','catch','show','params','keys','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','findAll','each','autoAssociation','userProfileId','Resources','UserProfileResource','describe','addSections','sequelize','sectionId','push','removeSections','ids','getSections','includes','subsections','enabled','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus'];(function(_0x4bdabe,_0x2c8066){var _0x22eb41=function(_0x1e32d2){while(--_0x1e32d2){_0x4bdabe['push'](_0x4bdabe['shift']());}};_0x22eb41(++_0x2c8066);}(_0x68e5,0x13f));var _0x568e=function(_0x4f2488,_0x21a90a){_0x4f2488=_0x4f2488-0x0;var _0x3e20f5=_0x68e5[_0x4f2488];return _0x3e20f5;};'use strict';var emlformat=require(_0x568e('0x0'));var rimraf=require(_0x568e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x568e('0x2'));var rp=require(_0x568e('0x3'));var moment=require(_0x568e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x568e('0x5'));var util=require(_0x568e('0x6'));var path=require(_0x568e('0x7'));var sox=require(_0x568e('0x8'));var csv=require(_0x568e('0x9'));var ejs=require(_0x568e('0xa'));var fs=require('fs');var fs_extra=require(_0x568e('0xb'));var _=require(_0x568e('0xc'));var squel=require(_0x568e('0xd'));var crypto=require('crypto');var jsforce=require(_0x568e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x568e('0x9'));var querystring=require(_0x568e('0xf'));var Papa=require(_0x568e('0x10'));var Redis=require('ioredis');var authService=require(_0x568e('0x11'));var qs=require(_0x568e('0x12'));var as=require(_0x568e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x568e('0x14'))(_0x568e('0x15'));var utils=require('../../config/utils');var config=require(_0x568e('0x16'));var licenseUtil=require(_0x568e('0x17'));var db=require(_0x568e('0x18'))['db'];config[_0x568e('0x19')]=_[_0x568e('0x1a')](config[_0x568e('0x19')],{'host':_0x568e('0x1b'),'port':0x18eb});var socket=require(_0x568e('0x1c'))(new Redis(config[_0x568e('0x19')]));require(_0x568e('0x1d'))[_0x568e('0x1e')](socket);function respondWithStatusCode(_0x3d5351,_0x3c7722){_0x3c7722=_0x3c7722||0xcc;return function(_0x1ef6a1){if(_0x1ef6a1){return _0x3d5351[_0x568e('0x1f')](_0x3c7722);}return _0x3d5351[_0x568e('0x20')](_0x3c7722)[_0x568e('0x21')]();};}function respondWithResult(_0x26cde8,_0x36d089){_0x36d089=_0x36d089||0xc8;return function(_0x1642c4){if(_0x1642c4){return _0x26cde8[_0x568e('0x20')](_0x36d089)['json'](_0x1642c4);}};}function respondWithFilteredResult(_0x299a80,_0x240383){return function(_0x49829d){if(_0x49829d){var _0x369530=typeof _0x240383[_0x568e('0x22')]===_0x568e('0x23')&&typeof _0x240383[_0x568e('0x24')]===_0x568e('0x23');var _0x492ee2=_0x49829d[_0x568e('0x25')];var _0x3c6619=_0x369530?0x0:_0x240383['offset'];var _0x73896e=_0x369530?_0x49829d[_0x568e('0x25')]:_0x240383[_0x568e('0x22')]+_0x240383[_0x568e('0x24')];var _0x581b3a;if(_0x73896e>=_0x492ee2){_0x73896e=_0x492ee2;_0x581b3a=0xc8;}else{_0x581b3a=0xce;}_0x299a80['status'](_0x581b3a);return _0x299a80[_0x568e('0x26')](_0x568e('0x27'),_0x3c6619+'-'+_0x73896e+'/'+_0x492ee2)[_0x568e('0x28')](_0x49829d);}return null;};}function patchUpdates(_0x47abb7){return function(_0x4a2bfc){try{jsonpatch['apply'](_0x4a2bfc,_0x47abb7,!![]);}catch(_0x1f17c4){return BPromise[_0x568e('0x29')](_0x1f17c4);}return _0x4a2bfc[_0x568e('0x2a')]();};}function saveUpdates(_0x41515e,_0x131c3b){return function(_0x3513a6){if(_0x3513a6){return _0x3513a6[_0x568e('0x2b')](_0x41515e)[_0x568e('0x2c')](function(_0x1b5343){return _0x1b5343;});}return null;};}function removeEntity(_0x326bc8,_0x1fdada){return function(_0x95d203){if(_0x95d203){return _0x95d203[_0x568e('0x2d')]()[_0x568e('0x2c')](function(){_0x326bc8[_0x568e('0x20')](0xcc)[_0x568e('0x21')]();});}};}function handleEntityNotFound(_0x1dbda5,_0x535941){return function(_0x50389c){if(!_0x50389c){_0x1dbda5[_0x568e('0x1f')](0x194);}return _0x50389c;};}function handleError(_0x253acb,_0x16fe03){_0x16fe03=_0x16fe03||0x1f4;return function(_0x1d468e){logger['error'](_0x1d468e[_0x568e('0x2e')]);if(_0x1d468e[_0x568e('0x2f')]){delete _0x1d468e[_0x568e('0x2f')];}_0x253acb['status'](_0x16fe03)['send'](_0x1d468e);};}exports[_0x568e('0x30')]=function(_0x6e1c58,_0x52fb75){var _0x4fd95a={},_0x208128={},_0x34979d={'count':0x0,'rows':[]};var _0x14d6ad=_[_0x568e('0x31')](db[_0x568e('0x32')][_0x568e('0x33')],function(_0x437d7a){return{'name':_0x437d7a[_0x568e('0x34')],'type':_0x437d7a[_0x568e('0x35')][_0x568e('0x36')]};});_0x208128[_0x568e('0x37')]=_[_0x568e('0x31')](_0x14d6ad,'name');_0x208128['query']=_['keys'](_0x6e1c58['query']);_0x208128[_0x568e('0x38')]=_[_0x568e('0x39')](_0x208128[_0x568e('0x37')],_0x208128[_0x568e('0x3a')]);_0x4fd95a[_0x568e('0x3b')]=_[_0x568e('0x39')](_0x208128[_0x568e('0x37')],qs[_0x568e('0x3c')](_0x6e1c58[_0x568e('0x3a')][_0x568e('0x3c')]));_0x4fd95a[_0x568e('0x3b')]=_0x4fd95a[_0x568e('0x3b')][_0x568e('0x3d')]?_0x4fd95a[_0x568e('0x3b')]:_0x208128[_0x568e('0x37')];if(!_0x6e1c58[_0x568e('0x3a')][_0x568e('0x3e')](_0x568e('0x3f'))){_0x4fd95a[_0x568e('0x24')]=qs[_0x568e('0x24')](_0x6e1c58['query'][_0x568e('0x24')]);_0x4fd95a['offset']=qs[_0x568e('0x22')](_0x6e1c58[_0x568e('0x3a')][_0x568e('0x22')]);}_0x4fd95a['order']=qs['sort'](_0x6e1c58[_0x568e('0x3a')][_0x568e('0x40')]);_0x4fd95a['where']=qs['filters'](_['pick'](_0x6e1c58['query'],_0x208128[_0x568e('0x38')]),_0x14d6ad);if(_0x6e1c58['query'][_0x568e('0x41')]){_0x4fd95a['where']=_[_0x568e('0x42')](_0x4fd95a[_0x568e('0x43')],{'$or':_[_0x568e('0x31')](_0x14d6ad,function(_0x491f48){if(_0x491f48[_0x568e('0x35')]!=='VIRTUAL'){var _0x7f6ce1={};_0x7f6ce1[_0x491f48[_0x568e('0x2f')]]={'$like':'%'+_0x6e1c58[_0x568e('0x3a')][_0x568e('0x41')]+'%'};return _0x7f6ce1;}})});}_0x4fd95a=_[_0x568e('0x42')]({},_0x4fd95a,_0x6e1c58[_0x568e('0x44')]);var _0x1fdf52={'where':_0x4fd95a[_0x568e('0x43')]};return db[_0x568e('0x32')]['count'](_0x1fdf52)['then'](function(_0x3724f4){_0x34979d[_0x568e('0x25')]=_0x3724f4;if(_0x6e1c58['query'][_0x568e('0x45')]){_0x4fd95a[_0x568e('0x46')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x4fd95a);})['then'](function(_0x5f02eb){_0x34979d[_0x568e('0x47')]=_0x5f02eb;return _0x34979d;})['then'](respondWithFilteredResult(_0x52fb75,_0x4fd95a))[_0x568e('0x48')](handleError(_0x52fb75,null));};exports[_0x568e('0x49')]=function(_0x12603f,_0x259284){var _0x29108f={'raw':![],'where':{'id':_0x12603f[_0x568e('0x4a')]['id']}},_0x358373={};_0x358373['model']=_['keys'](db['UserProfile'][_0x568e('0x33')]);_0x358373[_0x568e('0x3a')]=_[_0x568e('0x4b')](_0x12603f[_0x568e('0x3a')]);_0x358373[_0x568e('0x38')]=_['intersection'](_0x358373[_0x568e('0x37')],_0x358373[_0x568e('0x3a')]);_0x29108f[_0x568e('0x3b')]=_[_0x568e('0x39')](_0x358373[_0x568e('0x37')],qs[_0x568e('0x3c')](_0x12603f[_0x568e('0x3a')][_0x568e('0x3c')]));_0x29108f['attributes']=_0x29108f['attributes'][_0x568e('0x3d')]?_0x29108f[_0x568e('0x3b')]:_0x358373['model'];if(_0x12603f[_0x568e('0x3a')][_0x568e('0x45')]){_0x29108f[_0x568e('0x46')]=[{'all':!![]}];}_0x29108f=_['merge']({},_0x29108f,_0x12603f[_0x568e('0x44')]);return db['UserProfile'][_0x568e('0x4c')](_0x29108f)[_0x568e('0x2c')](handleEntityNotFound(_0x259284,null))[_0x568e('0x2c')](respondWithResult(_0x259284,null))[_0x568e('0x48')](handleError(_0x259284,null));};exports[_0x568e('0x4d')]=function(_0x270128,_0x412945){return db['UserProfile']['create'](_0x270128[_0x568e('0x4e')],{})[_0x568e('0x2c')](respondWithResult(_0x412945,0xc9))[_0x568e('0x48')](handleError(_0x412945,null));};exports[_0x568e('0x4f')]=function(_0x21827c,_0x40b17a){var _0x4a5ef7={'where':{'id':_0x21827c[_0x568e('0x4a')]['id']}},_0x308eb3={};_0x308eb3[_0x568e('0x37')]=_[_0x568e('0x4b')](db['UserProfile']['rawAttributes']);_0x4a5ef7[_0x568e('0x3b')]=_['intersection'](_0x308eb3[_0x568e('0x37')],qs[_0x568e('0x3c')](_0x21827c[_0x568e('0x3a')][_0x568e('0x3c')]));_0x4a5ef7[_0x568e('0x3b')]=_0x4a5ef7['attributes'][_0x568e('0x3d')]?_0x4a5ef7[_0x568e('0x3b')]:_0x308eb3[_0x568e('0x37')];if(_0x21827c[_0x568e('0x3a')][_0x568e('0x45')]){_0x4a5ef7[_0x568e('0x46')]=[{'all':!![]}];}_0x4a5ef7=_['merge']({},_0x4a5ef7,_0x21827c['options']);return db[_0x568e('0x32')]['find'](_0x4a5ef7)['then'](handleEntityNotFound(_0x40b17a,null))['then'](function(_0x5cdd09){if(_0x5cdd09){var _0x4b3572=_0x5cdd09[_0x568e('0x50')]({'plain':!![]});_0x4b3572=qs[_0x568e('0x51')](_0x4b3572,['id',_0x568e('0x52'),_0x568e('0x53'),_0x568e('0x54')]);_0x21827c['body']=_[_0x568e('0x51')](_0x21827c['body'],['id',_0x568e('0x52'),_0x568e('0x53')]);return db['sequelize'][_0x568e('0x55')](function(_0x301444){return db[_0x568e('0x32')]['create'](_[_0x568e('0x42')](_0x4b3572,_0x21827c[_0x568e('0x4e')]),{'include':_0x21827c[_0x568e('0x3a')][_0x568e('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x301444})[_0x568e('0x2c')](function(_0x5994f0){var _0x2bd45d=_0x5994f0[_0x568e('0x50')]({'plain':!![]});return db[_0x568e('0x56')][_0x568e('0x57')]({'where':{'userProfileId':_0x21827c[_0x568e('0x4a')]['id']},'raw':!![]})[_0x568e('0x2c')](function(_0x149321){if(_0x149321){return BPromise[_0x568e('0x58')](_0x149321,function(_0x5a8cc4){return new BPromise(function(_0x1feb9b,_0x2dd74b){if(_0x5a8cc4[_0x568e('0x59')]===null||_0x5a8cc4[_0x568e('0x59')]===0x1)_0x1feb9b(null);return db['UserProfileResource'][_0x568e('0x57')]({'where':{'sectionId':_0x5a8cc4['id']},'raw':!![]})[_0x568e('0x2c')](function(_0x52f369){var _0x3ed2df=_[_0x568e('0x31')](_0x52f369,function(_0x259009){return qs[_0x568e('0x51')](_0x259009,['id','createdAt',_0x568e('0x53'),'sectionId']);});_0x1feb9b(_0x3ed2df);})[_0x568e('0x48')](function(_0xcb0266){_0x2dd74b(_0xcb0266);});})['then'](function(_0x4af2ee){var _0x5d756b=qs[_0x568e('0x51')](_0x5a8cc4,['id',_0x568e('0x52'),_0x568e('0x53')]);_0x5d756b[_0x568e('0x5a')]=_0x2bd45d['id'];if(_0x4af2ee)_0x5d756b[_0x568e('0x5b')]=_0x4af2ee;return _0x5d756b;})[_0x568e('0x2c')](function(_0x397e39){return db[_0x568e('0x56')][_0x568e('0x4d')](_0x397e39,{'include':[{'model':db[_0x568e('0x5c')],'as':_0x568e('0x5b')}],'raw':!![],'transaction':_0x301444});});})[_0x568e('0x2c')](function(){return _0x2bd45d;});}});});});}})[_0x568e('0x2c')](respondWithResult(_0x40b17a,0xc9))['catch'](handleError(_0x40b17a,null));};exports[_0x568e('0x2b')]=function(_0x52ad17,_0x12122c){if(_0x52ad17[_0x568e('0x4e')]['id']){delete _0x52ad17['body']['id'];}return db[_0x568e('0x32')][_0x568e('0x4c')]({'where':{'id':_0x52ad17[_0x568e('0x4a')]['id']}})[_0x568e('0x2c')](handleEntityNotFound(_0x12122c,null))[_0x568e('0x2c')](saveUpdates(_0x52ad17[_0x568e('0x4e')],null))[_0x568e('0x2c')](respondWithResult(_0x12122c,null))[_0x568e('0x48')](handleError(_0x12122c,null));};exports[_0x568e('0x2d')]=function(_0x2c6c42,_0x20dd76){return db[_0x568e('0x32')][_0x568e('0x4c')]({'where':{'id':_0x2c6c42[_0x568e('0x4a')]['id']}})[_0x568e('0x2c')](handleEntityNotFound(_0x20dd76,null))[_0x568e('0x2c')](removeEntity(_0x20dd76,null))[_0x568e('0x48')](handleError(_0x20dd76,null));};exports['describe']=function(_0x53cf1b,_0x56386e){return db[_0x568e('0x32')][_0x568e('0x5d')]()[_0x568e('0x2c')](respondWithResult(_0x56386e,null))[_0x568e('0x48')](handleError(_0x56386e,null));};exports[_0x568e('0x5e')]=function(_0x48f7a6,_0x556a48){var _0x2bbb82=_0x48f7a6['body'];return db[_0x568e('0x32')][_0x568e('0x4c')]({'where':{'id':_0x48f7a6[_0x568e('0x4a')]['id']}})[_0x568e('0x2c')](handleEntityNotFound(_0x556a48,null))[_0x568e('0x2c')](function(_0x5d8a8d){if(_0x5d8a8d){return db[_0x568e('0x5f')][_0x568e('0x55')](function(_0x31bd68){return db['UserProfileSection'][_0x568e('0x2d')]({'where':{'userProfileId':_0x48f7a6['params']['id'],'sectionId':_[_0x568e('0x31')](_0x2bbb82,function(_0x157b6c){return _0x157b6c[_0x568e('0x60')];})},'transaction':_0x31bd68})['then'](function(){var _0x2efc9a=_['map'](_0x2bbb82,function(_0x133d5e){_0x133d5e['userProfileId']=_0x48f7a6[_0x568e('0x4a')]['id'];return _0x133d5e;});var _0x574248=[];return BPromise[_0x568e('0x58')](_0x2efc9a,function(_0x5dd470){return db['UserProfileSection'][_0x568e('0x4d')](_0x5dd470,{'include':[{'model':db[_0x568e('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x31bd68})[_0x568e('0x2c')](function(_0x351218){_0x574248[_0x568e('0x61')](_0x351218[_0x568e('0x50')]({'plain':!![]}));});})[_0x568e('0x2c')](function(){return _0x574248;});});});}})[_0x568e('0x2c')](function(_0x455933){return _0x455933;})[_0x568e('0x2c')](respondWithResult(_0x556a48,null))[_0x568e('0x48')](handleError(_0x556a48,null));};exports[_0x568e('0x62')]=function(_0x49a036,_0x86e1b4){var _0x2b6afd;return db[_0x568e('0x32')][_0x568e('0x4c')]({'where':{'id':_0x49a036[_0x568e('0x4a')]['id']},'attributes':['id',_0x568e('0x2f')]})[_0x568e('0x2c')](handleEntityNotFound(_0x86e1b4,null))['then'](function(_0x3fe0b5){if(_0x3fe0b5){_0x2b6afd=_0x3fe0b5;return db['UserProfileSection'][_0x568e('0x2d')]({'where':{'userProfileId':_0x49a036[_0x568e('0x4a')]['id'],'sectionId':_0x49a036[_0x568e('0x3a')][_0x568e('0x63')]}});}})[_0x568e('0x2c')](function(){return _0x2b6afd;})[_0x568e('0x2c')](respondWithStatusCode(_0x86e1b4,null))[_0x568e('0x48')](handleError(_0x86e1b4,null));};exports[_0x568e('0x64')]=function(_0x20b592,_0x2e1a5e){var _0x2fa407=[];var _0x246826=[];return db[_0x568e('0x56')][_0x568e('0x57')]({'where':{'userProfileId':_0x20b592[_0x568e('0x4a')]['id']},'raw':!![]})['then'](function(_0x52d3b5){_0x2fa407=_[_0x568e('0x41')](_0x52d3b5,function(_0x186775){return _0x186775['enabled']===0x1||_[_0x568e('0x65')]([0x3eb,0x709],_0x186775['sectionId']);});if(!_['isEmpty'](_0x2fa407)){return _[_0x568e('0x31')](_0x2fa407,function(_0x24cf29){return _0x24cf29[_0x568e('0x60')];});}else{return;}})[_0x568e('0x2c')](function(_0x1a523f){if(_0x1a523f)_0x246826=_0x1a523f;if(_[_0x568e('0x65')](_0x246826,0x64)){var _0x1f3986=_[_0x568e('0x4c')](_0x2fa407,{'sectionId':0x64});return hasDefaultDashboard(_0x1f3986)[_0x568e('0x2c')](function(_0x479276){return _['map'](_0x2fa407,function(_0x16426c){if(_0x16426c['sectionId']===0x64){_0x16426c[_0x568e('0x66')]=_0x479276;}return _0x16426c;});});}else{return;}})[_0x568e('0x2c')](function(_0x37bbd6){if(_0x37bbd6)_0x2fa407=_0x37bbd6;if(_[_0x568e('0x65')](_0x246826,0x3eb)){var _0x56d379=_['find'](_0x2fa407,{'sectionId':0x3eb});return getCustomDashboards(_0x56d379)[_0x568e('0x2c')](function(_0x1afc2b){return _[_0x568e('0x31')](_0x2fa407,function(_0x4720d8){if(_0x56d379[_0x568e('0x67')]){if(_0x4720d8['sectionId']===0x3eb){_0x4720d8['subsections']=_0x1afc2b;}}else{if(_0x4720d8[_0x568e('0x60')]===0x64){if(!_0x4720d8[_0x568e('0x66')]){_0x4720d8[_0x568e('0x66')]=[];}_0x4720d8[_0x568e('0x66')]=_0x4720d8[_0x568e('0x66')][_0x568e('0x68')](_0x1afc2b);}}return _0x4720d8;});});}else{return;}})[_0x568e('0x2c')](function(_0x16ba0f){if(_0x16ba0f)_0x2fa407=_0x16ba0f;if(_['includes'](_0x246826,0x709)){var _0x15ef89=_[_0x568e('0x4c')](_0x2fa407,{'sectionId':0x709});return getPlugins(_0x15ef89)[_0x568e('0x2c')](function(_0x341f54){if(_0x15ef89[_0x568e('0x67')]){return _[_0x568e('0x31')](_0x2fa407,function(_0x3e1f3e){if(_0x3e1f3e[_0x568e('0x60')]===0x709){_0x3e1f3e['subsections']=_0x341f54;}return _0x3e1f3e;});}else{var _0x5bf8ee={'sectionId':0x76c,'enabled':0x1,'subsections':_0x341f54};var _0x510b0c=_[_0x568e('0x31')](_0x2fa407);_0x510b0c[_0x568e('0x61')](_0x5bf8ee);return _0x510b0c;}});}else{return;}})[_0x568e('0x2c')](function(_0x50669a){if(_0x50669a)_0x2fa407=_0x50669a;return _[_0x568e('0x41')](_0x2fa407,['enabled',0x1]);})[_0x568e('0x2c')](respondWithResult(_0x2e1a5e,null))['catch'](handleError(_0x2e1a5e,null));};function hasDefaultDashboard(_0x44270d){var _0xc06dc3=[0x65];return new BPromise(function(_0x3c7bd4,_0x4cdcd8){try{if(_0x44270d[_0x568e('0x59')]){_0x3c7bd4(_0xc06dc3);}else{return db[_0x568e('0x5c')][_0x568e('0x69')]({'where':{'sectionId':_0x44270d['id']},'raw':!![]})[_0x568e('0x2c')](function(_0x4dc46a){_0x4dc46a?_0x3c7bd4(_0xc06dc3):_0x3c7bd4();});}}catch(_0x4b147a){_0x4cdcd8(_0x4b147a);}});}function getCustomDashboards(_0x1425c6){var _0x2f51d9=[];return new BPromise(function(_0x3b1fd2,_0x3d0ffc){try{if(_0x1425c6['autoAssociation']){return db[_0x568e('0x6a')]['findAll']({'raw':!![]})[_0x568e('0x2c')](function(_0xcde7e2){_0xcde7e2[_0x568e('0x6b')](function(_0x1bd003){_0x2f51d9['push'](_0x1bd003['id']+0x1869f);});_0x3b1fd2(_0x2f51d9);});}else{return db[_0x568e('0x5c')][_0x568e('0x57')]({'where':{'sectionId':_0x1425c6['id']},'raw':!![]})[_0x568e('0x2c')](function(_0x10212f){_0x10212f[_0x568e('0x6b')](function(_0x581f9a){_0x2f51d9[_0x568e('0x61')](_0x581f9a[_0x568e('0x6c')]+0x1869f);});_0x3b1fd2(_0x2f51d9);});}}catch(_0x1dfa13){_0x3d0ffc(_0x1dfa13);}});}function getPlugins(_0x23df60){var _0x3c5885=[];return new BPromise(function(_0x4073b5,_0x26544a){try{if(_0x23df60[_0x568e('0x59')]){return db[_0x568e('0x6d')]['findAll']({'raw':!![]})['then'](function(_0x1b1c43){_0x1b1c43['forEach'](function(_0x221207){_0x3c5885[_0x568e('0x61')](_0x221207['id']+0x15b38);});_0x4073b5(_0x3c5885);});}else{return db[_0x568e('0x5c')][_0x568e('0x57')]({'where':{'sectionId':_0x23df60['id']},'raw':!![]})[_0x568e('0x2c')](function(_0x3efc7d){_0x3efc7d[_0x568e('0x6b')](function(_0xcc86c9){_0x3c5885[_0x568e('0x61')](_0xcc86c9[_0x568e('0x6c')]+0x15b38);});_0x4073b5(_0x3c5885);});}}catch(_0x181b0b){_0x26544a(_0x181b0b);}});}exports[_0x568e('0x6e')]=function(_0x9fc672,_0x209c30){return db['UserProfile'][_0x568e('0x4c')]({'where':{'id':_0x9fc672['params']['id']}})[_0x568e('0x2c')](handleEntityNotFound(_0x209c30,null))[_0x568e('0x2c')](function(_0x2ab837){if(_0x2ab837){return db['sequelize'][_0x568e('0x55')](function(_0x1b8bff){return db[_0x568e('0x56')][_0x568e('0x57')]({'where':{'userProfileId':_0x9fc672[_0x568e('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x568e('0x2c')](function(_0x2ebcc7){if(_0x2ebcc7){return db['UserProfileSection'][_0x568e('0x2d')]({'where':{'userProfileId':_0x9fc672[_0x568e('0x4a')]['id'],'id':_[_0x568e('0x31')](_0x2ebcc7,function(_0x149291){return _0x149291['id'];})},'transaction':_0x1b8bff});}})[_0x568e('0x2c')](function(_0x32b256){var _0x55d2a9=_[_0x568e('0x31')](_0x9fc672[_0x568e('0x4e')],function(_0x3648b4){_0x3648b4[_0x568e('0x5a')]=_0x9fc672[_0x568e('0x4a')]['id'];return _0x3648b4;});return db['UserProfileSection'][_0x568e('0x6f')](_0x55d2a9,{'raw':!![],'transaction':_0x1b8bff});})[_0x568e('0x2c')](function(_0x3c117d){var _0x8ddb58=_[_0x568e('0x41')](_[_0x568e('0x31')](_0x3c117d,function(_0xa44b23){return _0xa44b23[_0x568e('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x8ddb58){return db['UserProfileSection'][_0x568e('0x57')]({'where':{'userProfileId':_0x9fc672[_0x568e('0x4a')]['id'],'sectionId':_[_0x568e('0x31')](_0x8ddb58,function(_0x4948b3){return _0x4948b3[_0x568e('0x60')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x568e('0x2c')](function(_0x13498f){var _0x4bfff9=_[_0x568e('0x31')](_0x9fc672[_0x568e('0x4e')],function(_0x18ff1f){_0x18ff1f[_0x568e('0x5a')]=_0x9fc672['params']['id'];return _0x18ff1f;});return db['UserProfileResource'][_0x568e('0x6f')](_0x4bfff9,{'raw':!![],'transaction':_0x1b8bff});});}})[_0x568e('0x48')](handleError(_0x209c30,null));});}})['then'](function(_0x17840d){var _0xf2dbfc=_['map'](_0x17840d,function(_0x4083d7){return _0x4083d7[_0x568e('0x50')]({'plain':!![]});});})[_0x568e('0x2c')](respondWithResult(_0x209c30,null))[_0x568e('0x48')](handleError(_0x209c30,null));};exports[_0x568e('0x70')]=function(_0x566866,_0x2ee810,_0x45d63c){return db[_0x568e('0x32')][_0x568e('0x4c')]({'where':{'id':_0x566866[_0x568e('0x4a')]['id']}})[_0x568e('0x2c')](handleEntityNotFound(_0x2ee810,null))[_0x568e('0x2c')](function(_0x4a7c9f){if(_0x4a7c9f){return _0x4a7c9f[_0x568e('0x70')](_0x566866[_0x568e('0x3a')][_0x568e('0x63')]);}})[_0x568e('0x2c')](respondWithStatusCode(_0x2ee810,null))[_0x568e('0x48')](handleError(_0x2ee810,null));};exports[_0x568e('0x71')]=function(_0x1a292a,_0x1b1f07){var _0x10cadf={};if(!_0x1a292a[_0x568e('0x3a')][_0x568e('0x72')])throw new Error(_0x568e('0x73'));if(!_0x1a292a[_0x568e('0x3a')]['hasOwnProperty'](_0x568e('0x3f'))){_0x10cadf[_0x568e('0x24')]=qs[_0x568e('0x24')](_0x1a292a[_0x568e('0x3a')][_0x568e('0x24')]);_0x10cadf['offset']=qs[_0x568e('0x22')](_0x1a292a[_0x568e('0x3a')][_0x568e('0x22')]);}return db[_0x568e('0x32')]['find']({'where':{'id':_0x1a292a[_0x568e('0x4a')]['id']}})[_0x568e('0x2c')](function(_0x3be942){if(!_0x3be942)throw new Error(_0x568e('0x74')+_0x1a292a[_0x568e('0x4a')]['id']);return db[_0x568e('0x32')][_0x568e('0x71')](_0x1a292a);})[_0x568e('0x2c')](respondWithFilteredResult(_0x1b1f07,_0x10cadf))[_0x568e('0x48')](handleError(_0x1b1f07,null));}; \ No newline at end of file +var _0x6ab2=['findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','length','find','catch','create','body','clone','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection'];(function(_0x107424,_0x44e257){var _0x2675d4=function(_0x1960b5){while(--_0x1960b5){_0x107424['push'](_0x107424['shift']());}};_0x2675d4(++_0x44e257);}(_0x6ab2,0x8b));var _0x26ab=function(_0x1bc669,_0x55a207){_0x1bc669=_0x1bc669-0x0;var _0x1fe31b=_0x6ab2[_0x1bc669];return _0x1fe31b;};'use strict';var emlformat=require(_0x26ab('0x0'));var rimraf=require(_0x26ab('0x1'));var zipdir=require(_0x26ab('0x2'));var jsonpatch=require(_0x26ab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x26ab('0x4'));var Mustache=require(_0x26ab('0x5'));var util=require(_0x26ab('0x6'));var path=require(_0x26ab('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26ab('0x8'));var fs=require('fs');var fs_extra=require(_0x26ab('0x9'));var _=require(_0x26ab('0xa'));var squel=require(_0x26ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x26ab('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x26ab('0xd'));var querystring=require(_0x26ab('0xe'));var Papa=require(_0x26ab('0xf'));var Redis=require(_0x26ab('0x10'));var authService=require(_0x26ab('0x11'));var qs=require(_0x26ab('0x12'));var as=require(_0x26ab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26ab('0x14'))(_0x26ab('0x15'));var utils=require(_0x26ab('0x16'));var config=require(_0x26ab('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x26ab('0x18'))['db'];config[_0x26ab('0x19')]=_['defaults'](config[_0x26ab('0x19')],{'host':_0x26ab('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26ab('0x19')]));require(_0x26ab('0x1b'))['register'](socket);function respondWithStatusCode(_0xa48957,_0x22a21a){_0x22a21a=_0x22a21a||0xcc;return function(_0x5ec067){if(_0x5ec067){return _0xa48957[_0x26ab('0x1c')](_0x22a21a);}return _0xa48957[_0x26ab('0x1d')](_0x22a21a)[_0x26ab('0x1e')]();};}function respondWithResult(_0x5103b8,_0x1450b8){_0x1450b8=_0x1450b8||0xc8;return function(_0x2a8e66){if(_0x2a8e66){return _0x5103b8['status'](_0x1450b8)[_0x26ab('0x1f')](_0x2a8e66);}};}function respondWithFilteredResult(_0x182734,_0x21458e){return function(_0x212121){if(_0x212121){var _0xfdb0d0=typeof _0x21458e[_0x26ab('0x20')]==='undefined'&&typeof _0x21458e[_0x26ab('0x21')]===_0x26ab('0x22');var _0x3df4c8=_0x212121['count'];var _0x3d0825=_0xfdb0d0?0x0:_0x21458e['offset'];var _0x3668e5=_0xfdb0d0?_0x212121['count']:_0x21458e[_0x26ab('0x20')]+_0x21458e['limit'];var _0x508aca;if(_0x3668e5>=_0x3df4c8){_0x3668e5=_0x3df4c8;_0x508aca=0xc8;}else{_0x508aca=0xce;}_0x182734[_0x26ab('0x1d')](_0x508aca);return _0x182734['set'](_0x26ab('0x23'),_0x3d0825+'-'+_0x3668e5+'/'+_0x3df4c8)[_0x26ab('0x1f')](_0x212121);}return null;};}function patchUpdates(_0x41e159){return function(_0x1c6b15){try{jsonpatch[_0x26ab('0x24')](_0x1c6b15,_0x41e159,!![]);}catch(_0x401168){return BPromise[_0x26ab('0x25')](_0x401168);}return _0x1c6b15[_0x26ab('0x26')]();};}function saveUpdates(_0x1352b9,_0xf0f3e6){return function(_0x4c6950){if(_0x4c6950){return _0x4c6950[_0x26ab('0x27')](_0x1352b9)[_0x26ab('0x28')](function(_0x25db91){return _0x25db91;});}return null;};}function removeEntity(_0x25cd6b,_0xf32791){return function(_0x32db5c){if(_0x32db5c){return _0x32db5c[_0x26ab('0x29')]()[_0x26ab('0x28')](function(){_0x25cd6b[_0x26ab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e0bc,_0x1a1b63){return function(_0x1db3a8){if(!_0x1db3a8){_0x34e0bc[_0x26ab('0x1c')](0x194);}return _0x1db3a8;};}function handleError(_0x16ad6c,_0x312244){_0x312244=_0x312244||0x1f4;return function(_0x13f624){logger['error'](_0x13f624['stack']);if(_0x13f624[_0x26ab('0x2a')]){delete _0x13f624[_0x26ab('0x2a')];}_0x16ad6c[_0x26ab('0x1d')](_0x312244)[_0x26ab('0x2b')](_0x13f624);};}exports[_0x26ab('0x2c')]=function(_0x11806c,_0x806a33){var _0x510bfb={},_0x23c105={},_0x1ee3a1={'count':0x0,'rows':[]};var _0x2e7dd7=_['map'](db[_0x26ab('0x2d')][_0x26ab('0x2e')],function(_0x23556c){return{'name':_0x23556c[_0x26ab('0x2f')],'type':_0x23556c[_0x26ab('0x30')][_0x26ab('0x31')]};});_0x23c105[_0x26ab('0x32')]=_['map'](_0x2e7dd7,_0x26ab('0x2a'));_0x23c105[_0x26ab('0x33')]=_[_0x26ab('0x34')](_0x11806c['query']);_0x23c105[_0x26ab('0x35')]=_['intersection'](_0x23c105[_0x26ab('0x32')],_0x23c105[_0x26ab('0x33')]);_0x510bfb[_0x26ab('0x36')]=_[_0x26ab('0x37')](_0x23c105[_0x26ab('0x32')],qs[_0x26ab('0x38')](_0x11806c[_0x26ab('0x33')][_0x26ab('0x38')]));_0x510bfb[_0x26ab('0x36')]=_0x510bfb[_0x26ab('0x36')]['length']?_0x510bfb[_0x26ab('0x36')]:_0x23c105[_0x26ab('0x32')];if(!_0x11806c['query'][_0x26ab('0x39')](_0x26ab('0x3a'))){_0x510bfb[_0x26ab('0x21')]=qs[_0x26ab('0x21')](_0x11806c['query'][_0x26ab('0x21')]);_0x510bfb[_0x26ab('0x20')]=qs[_0x26ab('0x20')](_0x11806c[_0x26ab('0x33')][_0x26ab('0x20')]);}_0x510bfb[_0x26ab('0x3b')]=qs[_0x26ab('0x3c')](_0x11806c[_0x26ab('0x33')][_0x26ab('0x3c')]);_0x510bfb[_0x26ab('0x3d')]=qs[_0x26ab('0x35')](_['pick'](_0x11806c['query'],_0x23c105[_0x26ab('0x35')]),_0x2e7dd7);if(_0x11806c[_0x26ab('0x33')][_0x26ab('0x3e')]){_0x510bfb['where']=_['merge'](_0x510bfb[_0x26ab('0x3d')],{'$or':_[_0x26ab('0x3f')](_0x2e7dd7,function(_0x4b3439){if(_0x4b3439[_0x26ab('0x30')]!==_0x26ab('0x40')){var _0x742a48={};_0x742a48[_0x4b3439[_0x26ab('0x2a')]]={'$like':'%'+_0x11806c[_0x26ab('0x33')][_0x26ab('0x3e')]+'%'};return _0x742a48;}})});}_0x510bfb=_[_0x26ab('0x41')]({},_0x510bfb,_0x11806c[_0x26ab('0x42')]);var _0x1aeb7c={'where':_0x510bfb[_0x26ab('0x3d')]};return db[_0x26ab('0x2d')][_0x26ab('0x43')](_0x1aeb7c)[_0x26ab('0x28')](function(_0x353399){_0x1ee3a1[_0x26ab('0x43')]=_0x353399;if(_0x11806c[_0x26ab('0x33')][_0x26ab('0x44')]){_0x510bfb[_0x26ab('0x45')]=[{'all':!![]}];}return db[_0x26ab('0x2d')]['findAll'](_0x510bfb);})[_0x26ab('0x28')](function(_0x5052d6){_0x1ee3a1[_0x26ab('0x46')]=_0x5052d6;return _0x1ee3a1;})['then'](respondWithFilteredResult(_0x806a33,_0x510bfb))['catch'](handleError(_0x806a33,null));};exports[_0x26ab('0x47')]=function(_0x1c28b7,_0x2aa1ac){var _0x4e4433={'raw':![],'where':{'id':_0x1c28b7[_0x26ab('0x48')]['id']}},_0x3123e2={};_0x3123e2['model']=_['keys'](db[_0x26ab('0x2d')][_0x26ab('0x2e')]);_0x3123e2[_0x26ab('0x33')]=_[_0x26ab('0x34')](_0x1c28b7[_0x26ab('0x33')]);_0x3123e2[_0x26ab('0x35')]=_['intersection'](_0x3123e2[_0x26ab('0x32')],_0x3123e2['query']);_0x4e4433[_0x26ab('0x36')]=_[_0x26ab('0x37')](_0x3123e2['model'],qs[_0x26ab('0x38')](_0x1c28b7[_0x26ab('0x33')][_0x26ab('0x38')]));_0x4e4433[_0x26ab('0x36')]=_0x4e4433[_0x26ab('0x36')][_0x26ab('0x49')]?_0x4e4433['attributes']:_0x3123e2[_0x26ab('0x32')];if(_0x1c28b7[_0x26ab('0x33')][_0x26ab('0x44')]){_0x4e4433['include']=[{'all':!![]}];}_0x4e4433=_[_0x26ab('0x41')]({},_0x4e4433,_0x1c28b7[_0x26ab('0x42')]);return db[_0x26ab('0x2d')][_0x26ab('0x4a')](_0x4e4433)['then'](handleEntityNotFound(_0x2aa1ac,null))[_0x26ab('0x28')](respondWithResult(_0x2aa1ac,null))[_0x26ab('0x4b')](handleError(_0x2aa1ac,null));};exports[_0x26ab('0x4c')]=function(_0x5dc7f5,_0x2eda8b){return db[_0x26ab('0x2d')][_0x26ab('0x4c')](_0x5dc7f5[_0x26ab('0x4d')],{})[_0x26ab('0x28')](respondWithResult(_0x2eda8b,0xc9))[_0x26ab('0x4b')](handleError(_0x2eda8b,null));};exports[_0x26ab('0x4e')]=function(_0x46a90d,_0x563060){var _0xe1523d={'where':{'id':_0x46a90d[_0x26ab('0x48')]['id']}},_0x5eb8a2={};_0x5eb8a2[_0x26ab('0x32')]=_[_0x26ab('0x34')](db[_0x26ab('0x2d')][_0x26ab('0x2e')]);_0xe1523d[_0x26ab('0x36')]=_[_0x26ab('0x37')](_0x5eb8a2['model'],qs[_0x26ab('0x38')](_0x46a90d['query']['fields']));_0xe1523d[_0x26ab('0x36')]=_0xe1523d[_0x26ab('0x36')][_0x26ab('0x49')]?_0xe1523d[_0x26ab('0x36')]:_0x5eb8a2['model'];if(_0x46a90d[_0x26ab('0x33')][_0x26ab('0x44')]){_0xe1523d[_0x26ab('0x45')]=[{'all':!![]}];}_0xe1523d=_[_0x26ab('0x41')]({},_0xe1523d,_0x46a90d['options']);return db[_0x26ab('0x2d')][_0x26ab('0x4a')](_0xe1523d)[_0x26ab('0x28')](handleEntityNotFound(_0x563060,null))[_0x26ab('0x28')](function(_0x15881f){if(_0x15881f){var _0x48de96=_0x15881f[_0x26ab('0x4f')]({'plain':!![]});_0x48de96=qs['omit'](_0x48de96,['id',_0x26ab('0x50'),_0x26ab('0x51'),_0x26ab('0x52')]);_0x46a90d['body']=_[_0x26ab('0x53')](_0x46a90d[_0x26ab('0x4d')],['id','createdAt',_0x26ab('0x51')]);return db[_0x26ab('0x54')][_0x26ab('0x55')](function(_0xec6d9b){return db[_0x26ab('0x2d')]['create'](_[_0x26ab('0x41')](_0x48de96,_0x46a90d[_0x26ab('0x4d')]),{'include':_0x46a90d[_0x26ab('0x33')][_0x26ab('0x44')]?[{'all':!![]}]:undefined,'transaction':_0xec6d9b})[_0x26ab('0x28')](function(_0x51e276){var _0x146be7=_0x51e276[_0x26ab('0x4f')]({'plain':!![]});return db[_0x26ab('0x56')][_0x26ab('0x57')]({'where':{'userProfileId':_0x46a90d[_0x26ab('0x48')]['id']},'raw':!![]})['then'](function(_0x223626){if(_0x223626){return BPromise[_0x26ab('0x58')](_0x223626,function(_0x9c83a1){return new BPromise(function(_0x433abb,_0x520446){if(_0x9c83a1['autoAssociation']===null||_0x9c83a1[_0x26ab('0x59')]===0x1)_0x433abb(null);return db[_0x26ab('0x5a')][_0x26ab('0x57')]({'where':{'sectionId':_0x9c83a1['id']},'raw':!![]})['then'](function(_0xfd09b0){var _0x548680=_[_0x26ab('0x3f')](_0xfd09b0,function(_0x3feeb6){return qs['omit'](_0x3feeb6,['id','createdAt',_0x26ab('0x51'),_0x26ab('0x5b')]);});_0x433abb(_0x548680);})[_0x26ab('0x4b')](function(_0x4813fe){_0x520446(_0x4813fe);});})['then'](function(_0x3902f9){var _0x4d5564=qs[_0x26ab('0x53')](_0x9c83a1,['id',_0x26ab('0x50'),_0x26ab('0x51')]);_0x4d5564[_0x26ab('0x5c')]=_0x146be7['id'];if(_0x3902f9)_0x4d5564[_0x26ab('0x5d')]=_0x3902f9;return _0x4d5564;})[_0x26ab('0x28')](function(_0x2c15cc){return db[_0x26ab('0x56')]['create'](_0x2c15cc,{'include':[{'model':db[_0x26ab('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0xec6d9b});});})[_0x26ab('0x28')](function(){return _0x146be7;});}});});});}})[_0x26ab('0x28')](respondWithResult(_0x563060,0xc9))['catch'](handleError(_0x563060,null));};exports[_0x26ab('0x27')]=function(_0x2c4f13,_0x32a40b){if(_0x2c4f13[_0x26ab('0x4d')]['id']){delete _0x2c4f13['body']['id'];}return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x2c4f13[_0x26ab('0x48')]['id']}})[_0x26ab('0x28')](handleEntityNotFound(_0x32a40b,null))[_0x26ab('0x28')](saveUpdates(_0x2c4f13[_0x26ab('0x4d')],null))[_0x26ab('0x28')](respondWithResult(_0x32a40b,null))[_0x26ab('0x4b')](handleError(_0x32a40b,null));};exports[_0x26ab('0x29')]=function(_0x4e6fad,_0x1d2b9b){return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x4e6fad['params']['id']}})[_0x26ab('0x28')](handleEntityNotFound(_0x1d2b9b,null))[_0x26ab('0x28')](removeEntity(_0x1d2b9b,null))[_0x26ab('0x4b')](handleError(_0x1d2b9b,null));};exports[_0x26ab('0x5e')]=function(_0x57aabb,_0x53168a){return db['UserProfile'][_0x26ab('0x5e')]()[_0x26ab('0x28')](respondWithResult(_0x53168a,null))['catch'](handleError(_0x53168a,null));};exports['addSections']=function(_0x26bf88,_0x5c840f){var _0x155040=_0x26bf88[_0x26ab('0x4d')];return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x26bf88['params']['id']}})['then'](handleEntityNotFound(_0x5c840f,null))['then'](function(_0x480d7a){if(_0x480d7a){return db['sequelize'][_0x26ab('0x55')](function(_0x327e94){return db['UserProfileSection'][_0x26ab('0x29')]({'where':{'userProfileId':_0x26bf88['params']['id'],'sectionId':_[_0x26ab('0x3f')](_0x155040,function(_0x30bcd8){return _0x30bcd8['sectionId'];})},'transaction':_0x327e94})[_0x26ab('0x28')](function(){var _0x15d178=_[_0x26ab('0x3f')](_0x155040,function(_0x15d601){_0x15d601[_0x26ab('0x5c')]=_0x26bf88[_0x26ab('0x48')]['id'];return _0x15d601;});var _0x182341=[];return BPromise['each'](_0x15d178,function(_0x427fbb){return db[_0x26ab('0x56')][_0x26ab('0x4c')](_0x427fbb,{'include':[{'model':db['UserProfileResource'],'as':_0x26ab('0x5d')}],'raw':!![],'transaction':_0x327e94})[_0x26ab('0x28')](function(_0x213734){_0x182341[_0x26ab('0x5f')](_0x213734[_0x26ab('0x4f')]({'plain':!![]}));});})[_0x26ab('0x28')](function(){return _0x182341;});});});}})[_0x26ab('0x28')](function(_0x406882){return _0x406882;})[_0x26ab('0x28')](respondWithResult(_0x5c840f,null))[_0x26ab('0x4b')](handleError(_0x5c840f,null));};exports[_0x26ab('0x60')]=function(_0x27831c,_0x4635ca){var _0x1c525a;return db[_0x26ab('0x2d')]['find']({'where':{'id':_0x27831c['params']['id']},'attributes':['id',_0x26ab('0x2a')]})[_0x26ab('0x28')](handleEntityNotFound(_0x4635ca,null))[_0x26ab('0x28')](function(_0x3a6d30){if(_0x3a6d30){_0x1c525a=_0x3a6d30;return db[_0x26ab('0x56')][_0x26ab('0x29')]({'where':{'userProfileId':_0x27831c[_0x26ab('0x48')]['id'],'sectionId':_0x27831c['query'][_0x26ab('0x61')]}});}})['then'](function(){return _0x1c525a;})['then'](respondWithStatusCode(_0x4635ca,null))[_0x26ab('0x4b')](handleError(_0x4635ca,null));};exports[_0x26ab('0x62')]=function(_0x35beeb,_0x3fd783){var _0x48e966=[];var _0xb2c519=[];return db[_0x26ab('0x56')][_0x26ab('0x57')]({'where':{'userProfileId':_0x35beeb[_0x26ab('0x48')]['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x536c41){_0x48e966=_[_0x26ab('0x3e')](_0x536c41,function(_0x2d83d5){return _0x2d83d5[_0x26ab('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x2d83d5[_0x26ab('0x5b')]);});if(!_[_0x26ab('0x64')](_0x48e966)){return _[_0x26ab('0x3f')](_0x48e966,function(_0x4f66eb){return _0x4f66eb[_0x26ab('0x5b')];});}else{return;}})['then'](function(_0x5c69a2){if(_0x5c69a2)_0xb2c519=_0x5c69a2;if(_[_0x26ab('0x65')](_0xb2c519,0x64)){var _0x3ec224=_[_0x26ab('0x4a')](_0x48e966,{'sectionId':0x64});return hasDefaultDashboard(_0x3ec224)[_0x26ab('0x28')](function(_0x259163){return _[_0x26ab('0x3f')](_0x48e966,function(_0x28cfeb){if(_0x28cfeb['sectionId']===0x64){_0x28cfeb['subsections']=_0x259163;}return _0x28cfeb;});});}else{return;}})[_0x26ab('0x28')](function(_0x3c0abd){if(_0x3c0abd)_0x48e966=_0x3c0abd;if(_[_0x26ab('0x65')](_0xb2c519,0x3eb)){var _0x4b6ba1=_['find'](_0x48e966,{'sectionId':0x3eb});return getCustomDashboards(_0x4b6ba1)[_0x26ab('0x28')](function(_0x22dfa7){return _['map'](_0x48e966,function(_0x30422f){if(_0x4b6ba1[_0x26ab('0x63')]){if(_0x30422f['sectionId']===0x3eb){_0x30422f[_0x26ab('0x66')]=_0x22dfa7;}}else{if(_0x30422f[_0x26ab('0x5b')]===0x64){if(!_0x30422f[_0x26ab('0x66')]){_0x30422f[_0x26ab('0x66')]=[];}_0x30422f[_0x26ab('0x66')]=_0x30422f[_0x26ab('0x66')]['concat'](_0x22dfa7);}}return _0x30422f;});});}else{return;}})[_0x26ab('0x28')](function(_0x3e8a28){if(_0x3e8a28)_0x48e966=_0x3e8a28;if(_[_0x26ab('0x65')](_0xb2c519,0x709)){var _0x1e501a=_['find'](_0x48e966,{'sectionId':0x709});return getPlugins(_0x1e501a)['then'](function(_0x31874c){if(_0x1e501a[_0x26ab('0x63')]){return _[_0x26ab('0x3f')](_0x48e966,function(_0x38a5ac){if(_0x38a5ac[_0x26ab('0x5b')]===0x709){_0x38a5ac[_0x26ab('0x66')]=_0x31874c;}return _0x38a5ac;});}else{var _0xde460b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x31874c};var _0x16b890=_[_0x26ab('0x3f')](_0x48e966);_0x16b890[_0x26ab('0x5f')](_0xde460b);return _0x16b890;}});}else{return;}})[_0x26ab('0x28')](function(_0x4fb907){if(_0x4fb907)_0x48e966=_0x4fb907;return _[_0x26ab('0x3e')](_0x48e966,[_0x26ab('0x63'),0x1]);})[_0x26ab('0x28')](respondWithResult(_0x3fd783,null))[_0x26ab('0x4b')](handleError(_0x3fd783,null));};function hasDefaultDashboard(_0x4cdc2f){var _0x4f39eb=[0x65];return new BPromise(function(_0x739d0e,_0xd799c){try{if(_0x4cdc2f[_0x26ab('0x59')]){_0x739d0e(_0x4f39eb);}else{return db['UserProfileResource'][_0x26ab('0x67')]({'where':{'sectionId':_0x4cdc2f['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x45b5cf){_0x45b5cf?_0x739d0e(_0x4f39eb):_0x739d0e();});}}catch(_0x199daa){_0xd799c(_0x199daa);}});}function getCustomDashboards(_0x4e4893){var _0x2fabd0=[];return new BPromise(function(_0x191f42,_0x30dc0e){try{if(_0x4e4893[_0x26ab('0x59')]){return db[_0x26ab('0x68')]['findAll']({'raw':!![]})['then'](function(_0x4bf465){_0x4bf465['forEach'](function(_0x5f17c4){_0x2fabd0[_0x26ab('0x5f')](_0x5f17c4['id']+0x1869f);});_0x191f42(_0x2fabd0);});}else{return db[_0x26ab('0x5a')][_0x26ab('0x57')]({'where':{'sectionId':_0x4e4893['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x360764){_0x360764[_0x26ab('0x69')](function(_0x2f5b84){_0x2fabd0[_0x26ab('0x5f')](_0x2f5b84[_0x26ab('0x6a')]+0x1869f);});_0x191f42(_0x2fabd0);});}}catch(_0x672b57){_0x30dc0e(_0x672b57);}});}function getPlugins(_0x494abb){var _0x413495=[];return new BPromise(function(_0x502e41,_0x289fe3){try{if(_0x494abb['autoAssociation']){return db[_0x26ab('0x6b')][_0x26ab('0x57')]({'raw':!![]})[_0x26ab('0x28')](function(_0x51fc96){_0x51fc96[_0x26ab('0x69')](function(_0x2e4da0){_0x413495['push'](_0x2e4da0['id']+0x15b38);});_0x502e41(_0x413495);});}else{return db[_0x26ab('0x5a')][_0x26ab('0x57')]({'where':{'sectionId':_0x494abb['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x1d59d3){_0x1d59d3[_0x26ab('0x69')](function(_0x3ee376){_0x413495['push'](_0x3ee376[_0x26ab('0x6a')]+0x15b38);});_0x502e41(_0x413495);});}}catch(_0x1c5628){_0x289fe3(_0x1c5628);}});}exports[_0x26ab('0x6c')]=function(_0x2f952e,_0x426a67){return db[_0x26ab('0x2d')]['find']({'where':{'id':_0x2f952e[_0x26ab('0x48')]['id']}})[_0x26ab('0x28')](handleEntityNotFound(_0x426a67,null))[_0x26ab('0x28')](function(_0x2ad124){if(_0x2ad124){return db[_0x26ab('0x54')][_0x26ab('0x55')](function(_0x2c4476){return db[_0x26ab('0x56')]['findAll']({'where':{'userProfileId':_0x2f952e[_0x26ab('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x26ab('0x28')](function(_0x5c910f){if(_0x5c910f){return db[_0x26ab('0x56')]['destroy']({'where':{'userProfileId':_0x2f952e[_0x26ab('0x48')]['id'],'id':_[_0x26ab('0x3f')](_0x5c910f,function(_0x4f688b){return _0x4f688b['id'];})},'transaction':_0x2c4476});}})[_0x26ab('0x28')](function(_0x5703eb){var _0x5c714e=_[_0x26ab('0x3f')](_0x2f952e[_0x26ab('0x4d')],function(_0x3a8310){_0x3a8310[_0x26ab('0x5c')]=_0x2f952e['params']['id'];return _0x3a8310;});return db[_0x26ab('0x56')][_0x26ab('0x6d')](_0x5c714e,{'raw':!![],'transaction':_0x2c4476});})[_0x26ab('0x28')](function(_0x5b05c7){var _0x2c6be5=_['filter'](_[_0x26ab('0x3f')](_0x5b05c7,function(_0x169ebe){return _0x169ebe[_0x26ab('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x2c6be5){return db[_0x26ab('0x56')][_0x26ab('0x57')]({'where':{'userProfileId':_0x2f952e[_0x26ab('0x48')]['id'],'sectionId':_[_0x26ab('0x3f')](_0x2c6be5,function(_0x527bd2){return _0x527bd2['sectionId'];})},'attributes':['id',_0x26ab('0x5b')],'raw':!![]})[_0x26ab('0x28')](function(_0x43141f){var _0xf7bf49=_[_0x26ab('0x3f')](_0x2f952e[_0x26ab('0x4d')],function(_0x78e019){_0x78e019[_0x26ab('0x5c')]=_0x2f952e['params']['id'];return _0x78e019;});return db[_0x26ab('0x5a')][_0x26ab('0x6d')](_0xf7bf49,{'raw':!![],'transaction':_0x2c4476});});}})[_0x26ab('0x4b')](handleError(_0x426a67,null));});}})[_0x26ab('0x28')](function(_0x4a8676){var _0x952627=_[_0x26ab('0x3f')](_0x4a8676,function(_0x352d75){return _0x352d75['get']({'plain':!![]});});})[_0x26ab('0x28')](respondWithResult(_0x426a67,null))['catch'](handleError(_0x426a67,null));};exports['removeResources']=function(_0x2f8a30,_0x1cd36f,_0x802527){return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x2f8a30[_0x26ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x1cd36f,null))[_0x26ab('0x28')](function(_0x405008){if(_0x405008){return _0x405008[_0x26ab('0x6e')](_0x2f8a30[_0x26ab('0x33')][_0x26ab('0x61')]);}})['then'](respondWithStatusCode(_0x1cd36f,null))[_0x26ab('0x4b')](handleError(_0x1cd36f,null));};exports[_0x26ab('0x6f')]=function(_0x3d0167,_0x32c755){var _0x26bbda={};if(!_0x3d0167[_0x26ab('0x33')][_0x26ab('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0x3d0167[_0x26ab('0x33')][_0x26ab('0x39')](_0x26ab('0x3a'))){_0x26bbda['limit']=qs[_0x26ab('0x21')](_0x3d0167[_0x26ab('0x33')]['limit']);_0x26bbda[_0x26ab('0x20')]=qs[_0x26ab('0x20')](_0x3d0167[_0x26ab('0x33')][_0x26ab('0x20')]);}return db['UserProfile'][_0x26ab('0x4a')]({'where':{'id':_0x3d0167[_0x26ab('0x48')]['id']}})[_0x26ab('0x28')](function(_0x3a33c5){if(!_0x3a33c5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3d0167[_0x26ab('0x48')]['id']);return db['UserProfile'][_0x26ab('0x6f')](_0x3d0167);})['then'](respondWithFilteredResult(_0x32c755,_0x26bbda))['catch'](handleError(_0x32c755,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4a6af1a..051cfbd 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb11=['hasOwnProperty','exports','events','UserProfile','setMaxListeners','update','emit'];(function(_0x10c1bb,_0x3c861c){var _0x1691cf=function(_0x253193){while(--_0x253193){_0x10c1bb['push'](_0x10c1bb['shift']());}};_0x1691cf(++_0x3c861c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfb11[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x1fb1('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1fb1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18108f){return function(_0x5a830e,_0x190f74,_0x2ae20f){UserProfileEvents['emit'](_0x18108f+':'+_0x5a830e['id'],_0x5a830e);UserProfileEvents[_0x1fb1('0x4')](_0x18108f,_0x5a830e);_0x2ae20f(null);};}for(var e in events){if(events[_0x1fb1('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x1fb1('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x27fb=['exports','events','../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty','hook'];(function(_0x111b37,_0x1012aa){var _0x335dd0=function(_0x15d5bf){while(--_0x15d5bf){_0x111b37['push'](_0x111b37['shift']());}};_0x335dd0(++_0x1012aa);}(_0x27fb,0x1de));var _0xb27f=function(_0x4c7de1,_0x3f7bef){_0x4c7de1=_0x4c7de1-0x0;var _0x3f1864=_0x27fb[_0x4c7de1];return _0x3f1864;};'use strict';var EventEmitter=require(_0xb27f('0x0'));var UserProfile=require(_0xb27f('0x1'))['db'][_0xb27f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb27f('0x3'),'afterUpdate':'update','afterDestroy':_0xb27f('0x4')};function emitEvent(_0x111753){return function(_0xba5409,_0x5e0641,_0x403dc4){UserProfileEvents['emit'](_0x111753+':'+_0xba5409['id'],_0xba5409);UserProfileEvents[_0xb27f('0x5')](_0x111753,_0xba5409);_0x403dc4(null);};}for(var e in events){if(events[_0xb27f('0x6')](e)){var event=events[e];UserProfile[_0xb27f('0x7')](e,emitEvent(event));}}module[_0xb27f('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 9bc2c30..611a1cf 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x650b=['internalroutes','outboundroutes','voicemails','voicerecordings','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','QueueCampaigns','users','telephones','admin','zendeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','Pause','scheduler','Schedule','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Plugin','Reports','AnalyticMetric','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','push','rawAttributes','keys','intersection','attributes','fields','nolimit','limit','offset','order','sort','pick','filters','merge','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','include','Tags','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','then','associatedResources','map','catch','value','model','findAll','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projects','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes'];(function(_0xa56ac1,_0x8234e7){var _0x525a0f=function(_0x327421){while(--_0x327421){_0xa56ac1['push'](_0xa56ac1['shift']());}};_0x525a0f(++_0x8234e7);}(_0x650b,0x142));var _0xb650=function(_0x3f43ef,_0x4c2ba9){_0x3f43ef=_0x3f43ef-0x0;var _0x20af43=_0x650b[_0x3f43ef];return _0x20af43;};'use strict';var _=require(_0xb650('0x0'));var attributes=require(_0xb650('0x1'));var qs=require(_0xb650('0x2'));var squel=require(_0xb650('0x3'));module[_0xb650('0x4')]=function(_0x231cd5){var _0x209aff=_0x231cd5[_0xb650('0x5')];function _0x2c63bb(_0x33b924,_0x2e73ba){return new Promise(function(_0x3b3e29,_0x3ad497){if(!_0x2e73ba)return _0x3b3e29(null);var _0x3451f6=_0x2e73ba[_0xb650('0x6')]?{[_0x2e73ba['filter'][_0xb650('0x7')]]:_0x2e73ba[_0xb650('0x6')]['value']}:undefined;return _0x209aff[_0x33b924]['findAll']({'where':_0x3451f6,'raw':!![]})[_0xb650('0x8')](function(_0x1db0b2){_0x2e73ba[_0xb650('0x9')]=_[_0xb650('0xa')](_0x1db0b2,'id');_0x3b3e29(_0x2e73ba);})[_0xb650('0xb')](function(_0x2e5c09){_0x3ad497(_0x2e5c09);});});}function _0x24ba6e(_0xe39173,_0x46d716){return new Promise(function(_0x351515,_0x2012a7){var _0x2080dc=_0xe39173[_0xb650('0x6')]?{[_0xe39173['filter'][_0xb650('0x7')]]:_0xe39173['filter'][_0xb650('0xc')]}:undefined;return _0x209aff[_0xe39173[_0xb650('0xd')]][_0xb650('0xe')]({'where':_0x2080dc,'raw':!![]})[_0xb650('0x8')](function(_0x3b5992){_0x46d716[_0xb650('0x9')]=_[_0xb650('0xa')](_0x3b5992,function(_0x8858e4){return _0x8858e4[_0xb650('0xf')];});_0x351515(_0x46d716);})[_0xb650('0xb')](function(_0x1519b0){_0x2012a7(_0x1519b0);});});}function _0x3a30d6(_0x8a064f,_0x57d07f,_0xcb9937){if(!_0x57d07f)return Promise['resolve'](null);return new Promise(function(_0x2cb565,_0x39cf34){return _0x209aff[_0xb650('0x10')][_0xb650('0xe')]({'where':{'sectionId':_0x57d07f['id']},'raw':!![]})[_0xb650('0x8')](function(_0x12c57a){if(_0x8a064f[_0xb650('0x7')]&&_0x8a064f[_0xb650('0x7')]!=='id'){_0x57d07f['associatedResources']=_[_0xb650('0xa')](_0x12c57a,function(_0x22e511){return _0x22e511[_0x8a064f['field']];});}else{if(_0xcb9937===_0xb650('0x11')){_0x57d07f[_0xb650('0x9')]=_[_0xb650('0xa')](_0x12c57a,function(_0x59651d){return{'id':_0x59651d[_0xb650('0x12')],'type':_0x59651d[_0xb650('0x13')]};});}else{_0x57d07f[_0xb650('0x9')]=_['map'](_0x12c57a,function(_0x176ca0){return _0x176ca0['resourceId'];});}}_0x2cb565(_0x57d07f);})[_0xb650('0xb')](function(_0x2fe904){_0x39cf34(_0x2fe904);});});}function _0x3f6ee3(_0x420a01,_0x3335c9){var _0x380feb={'parentSections':[]};switch(_0x420a01['toLowerCase']()){case _0xb650('0x14'):_0x380feb[_0xb650('0x15')]=_0xb650('0x16');break;case _0xb650('0x17'):_0x380feb[_0xb650('0x15')]='SquareOdbc';break;case _0xb650('0x18'):_0x380feb[_0xb650('0x15')]=_0xb650('0x19');_0x380feb['parentSections']=[{'name':_0xb650('0x1a'),'field':_0xb650('0xf'),'foreignKey':'projectName'}];break;case _0xb650('0x1b'):_0x380feb[_0xb650('0x15')]='JscriptyProject';break;case _0xb650('0x1c'):_0x380feb[_0xb650('0x15')]=_0xb650('0x1d');_0x380feb[_0xb650('0x1e')]=[{'name':_0xb650('0x1f'),'field':'id','foreignKey':_0xb650('0x20')}];break;case _0xb650('0x21'):_0x380feb[_0xb650('0x15')]=_0xb650('0x22');break;case _0xb650('0x23'):_0x380feb[_0xb650('0x15')]='CmCompany';break;case'globalcustomfields':_0x380feb[_0xb650('0x15')]=_0xb650('0x24');break;case _0xb650('0x25'):_0x380feb[_0xb650('0x15')]=_0xb650('0x26');break;case _0xb650('0x27'):_0x380feb[_0xb650('0x15')]='ChatWebsite';break;case _0xb650('0x28'):_0x380feb[_0xb650('0x15')]='FaxQueue';break;case _0xb650('0x29'):_0x380feb[_0xb650('0x15')]=_0xb650('0x2a');break;case _0xb650('0x2b'):case _0xb650('0x2c'):case _0xb650('0x2d'):_0x380feb[_0xb650('0x15')]='VoiceExtension';break;case'contexts':_0x380feb[_0xb650('0x15')]='VoiceContext';break;case _0xb650('0x2e'):_0x380feb[_0xb650('0x15')]='VoiceMail';break;case _0xb650('0x2f'):_0x380feb[_0xb650('0x15')]='VoiceRecording';_0x380feb[_0xb650('0x1e')]=[{'name':_0xb650('0x30'),'field':_0xb650('0xf'),'foreignKey':_0xb650('0x31'),'model':_0xb650('0x32'),'filter':{'field':_0xb650('0x33'),'value':[_0xb650('0x34')]}},{'name':_0xb650('0x35'),'field':_0xb650('0xf'),'foreignKey':'membername','model':_0xb650('0x32'),'filter':{'field':_0xb650('0x33'),'value':[_0xb650('0x36')]}},{'name':_0xb650('0x37'),'field':_0xb650('0xf'),'foreignKey':_0xb650('0x38'),'model':_0xb650('0x39'),'filter':{'field':'type','value':[_0xb650('0x3a')]}},{'name':'QueueCampaigns','field':_0xb650('0xf'),'foreignKey':_0xb650('0x38'),'model':_0xb650('0x39'),'filter':{'field':'type','value':[_0xb650('0x3b')]}}];break;case'musiconholds':_0x380feb['childModel']='VoiceMusicOnHold';break;case _0xb650('0x3c'):_0x380feb[_0xb650('0x15')]=_0xb650('0x3d');break;case'voiceprefixes':_0x380feb['childModel']=_0xb650('0x3e');break;case _0xb650('0x3f'):_0x380feb['childModel']=_0xb650('0x40');break;case _0xb650('0x41'):_0x380feb[_0xb650('0x15')]='MailQueue';break;case _0xb650('0x42'):_0x380feb['childModel']=_0xb650('0x43');break;case _0xb650('0x44'):_0x380feb[_0xb650('0x15')]=_0xb650('0x45');break;case'openchannelqueues':_0x380feb[_0xb650('0x15')]=_0xb650('0x46');break;case'openchannelaccounts':_0x380feb[_0xb650('0x15')]=_0xb650('0x47');break;case _0xb650('0x48'):_0x380feb[_0xb650('0x15')]=_0xb650('0x49');break;case _0xb650('0x4a'):_0x380feb['childModel']=_0xb650('0x4b');break;case'whatsappqueues':_0x380feb[_0xb650('0x15')]=_0xb650('0x4c');break;case _0xb650('0x4d'):_0x380feb[_0xb650('0x15')]=_0xb650('0x4e');break;case _0xb650('0x4f'):_0x380feb[_0xb650('0x15')]=_0xb650('0x50');break;case'voicequeues':case _0xb650('0x51'):_0x380feb['childModel']=_0xb650('0x39');if(_0x3335c9){_0x380feb[_0xb650('0x1e')]=[{'name':_0xb650('0x37')},{'name':_0xb650('0x52')}];}break;case _0xb650('0x53'):case'agents':case _0xb650('0x54'):_0x380feb[_0xb650('0x15')]=_0xb650('0x32');if(_0x3335c9){_0x380feb[_0xb650('0x1e')]=[{'name':'Users','filter':{'field':_0xb650('0x33'),'value':[_0xb650('0x55'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0xb650('0x35')}];}break;case _0xb650('0x56'):_0x380feb[_0xb650('0x15')]='ZendeskAccount';break;case'salesforceaccounts':_0x380feb[_0xb650('0x15')]='SalesforceAccount';break;case'freshdeskaccounts':_0x380feb[_0xb650('0x15')]=_0xb650('0x57');break;case _0xb650('0x58'):_0x380feb[_0xb650('0x15')]=_0xb650('0x59');break;case'deskaccounts':_0x380feb[_0xb650('0x15')]=_0xb650('0x5a');break;case _0xb650('0x5b'):_0x380feb[_0xb650('0x15')]=_0xb650('0x5c');break;case'vtigeraccounts':_0x380feb['childModel']=_0xb650('0x32');break;case'cannedanswers':_0x380feb['childModel']=_0xb650('0x5d');break;case _0xb650('0x5e'):_0x380feb[_0xb650('0x15')]=_0xb650('0x5f');break;case'customdashboards':_0x380feb[_0xb650('0x15')]=_0xb650('0x60');break;case _0xb650('0x61'):_0x380feb[_0xb650('0x15')]=_0xb650('0x62');break;case'pauses':_0x380feb[_0xb650('0x15')]=_0xb650('0x63');break;case _0xb650('0x64'):_0x380feb[_0xb650('0x15')]=_0xb650('0x65');break;case'sounds':_0x380feb[_0xb650('0x15')]=_0xb650('0x66');break;case'tags':_0x380feb[_0xb650('0x15')]=_0xb650('0x67');break;case _0xb650('0x68'):_0x380feb[_0xb650('0x15')]=_0xb650('0x69');break;case'triggers':_0x380feb['childModel']=_0xb650('0x6a');break;case _0xb650('0x6b'):_0x380feb[_0xb650('0x15')]=_0xb650('0x6c');break;case _0xb650('0x6d'):_0x380feb[_0xb650('0x15')]='Variable';break;case'plugins':_0x380feb[_0xb650('0x15')]=_0xb650('0x6e');break;case'extractedreports':_0x380feb[_0xb650('0x15')]='AnalyticExtractedReport';_0x380feb['parentSections']=[{'name':_0xb650('0x6f'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x380feb[_0xb650('0x15')]=_0xb650('0x70');break;}return _0x380feb;}function _0x4dd255(_0x451c6c,_0x348eed){var _0x49e8bf=_0x451c6c[_0xb650('0x71')](0x0)[_0xb650('0x72')]()+_0x451c6c['slice'](0x1);var _0x32b9af={'type':_0x209aff['Sequelize'][_0xb650('0x73')][_0xb650('0x74')],'raw':!![]};return new Promise(function(_0x81c17,_0x3030fa){var _0x15d008=squel[_0xb650('0x75')]()[_0xb650('0x7')](_0xb650('0x76')+_0x49e8bf+_0xb650('0x77'),'id')[_0xb650('0x7')](_0xb650('0x78'))[_0xb650('0x79')]('user_has_'+_0x451c6c+'_interactions','ui')[_0xb650('0x7a')](_0xb650('0x7b'),_0x348eed['id']);return _0x209aff[_0xb650('0x7c')][_0xb650('0x7d')](_0x15d008[_0xb650('0x7e')](),_0x32b9af)[_0xb650('0x8')](function(_0xfe2a4d){_0x348eed[_0x49e8bf+_0xb650('0x7f')]=_0xfe2a4d;_0x81c17(_0xfe2a4d);})['catch'](function(_0x542370){_0x3030fa(_0x542370);});});}return _0x231cd5[_0xb650('0x80')](_0xb650('0x81'),attributes,{'tableName':_0xb650('0x82'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2ff199){var _0x563ba0={'raw':_0x2ff199[_0xb650('0x7d')][_0xb650('0x83')],'where':{}};var _0x43a34f={};var _0x2e6dd8={'count':0x0,'rows':[]};var _0x31da54=_0x2ff199['query']['section'];var _0x1e1484=_0x2ff199[_0xb650('0x7d')][_0xb650('0x84')]||![];var _0x1efca5=_0x3f6ee3(_0x31da54,_0x1e1484);if(!_0x1efca5['childModel'])throw new Error(_0xb650('0x85')+_0x31da54+'\x27');var _0xd4d801=[{'name':_0x31da54}];if(!_[_0xb650('0x86')](_0x1efca5[_0xb650('0x1e')]))_0xd4d801=_0x1efca5[_0xb650('0x1e')];var _0x963f5d=[];for(var _0x6bf9f1=0x0;_0x6bf9f1<_0xd4d801[_0xb650('0x87')];_0x6bf9f1++){_0x963f5d['push'](_0x209aff[_0xb650('0x88')][_0xb650('0x89')]({'where':{'userProfileId':_0x2ff199[_0xb650('0x8a')]['id'],'name':_0xd4d801[_0x6bf9f1][_0xb650('0xf')]},'raw':!![]}));}return Promise[_0xb650('0x8b')](_0x963f5d)[_0xb650('0x8')](function(_0x3dee5e){var _0x429dea=_[_0xb650('0x6')](_0x3dee5e,function(_0x207a7d){return _0x207a7d?_0x207a7d:undefined;});var _0x597430=_[_0xb650('0x6')](_0xd4d801,[_0xb650('0x8c'),!![]]);var _0x2185f4=_['isEmpty'](_0x429dea)&&_[_0xb650('0x86')](_0x597430)?null:_['union'](_0x597430,_0x429dea);if(!_0x2185f4)return null;var _0x50593e=[];for(var _0x497e27=0x0;_0x497e27<_0x2185f4[_0xb650('0x87')];_0x497e27++){var _0x576f41=_['find'](_0xd4d801,function(_0x2ee9df){return _0x2185f4[_0x497e27]?_0x2ee9df['name']===_0x2185f4[_0x497e27][_0xb650('0xf')]:null;});if(_0x576f41){if(_0x2185f4[_0x497e27]['ignore']){_0x50593e['push'](_0x2c63bb(_0x1efca5[_0xb650('0x15')],_0x2185f4[_0x497e27]));}else{if(!_0x2185f4[_0x497e27]['autoAssociation']){_0x50593e['push'](_0x3a30d6(_0x576f41,_0x2185f4[_0x497e27],_0x1efca5['childModel']));}else{if(_0x576f41[_0xb650('0xd')]){_0x50593e[_0xb650('0x8d')](_0x24ba6e(_0x576f41,_0x2185f4[_0x497e27]));}}}}}return Promise[_0xb650('0x8b')](_0x50593e);})[_0xb650('0x8')](function(_0x422f56){var _0x34a50c=_0x422f56;var _0x19a553=null;if(_0x34a50c){_0x19a553=_0x34a50c[_0xb650('0x87')]===0x1?_0x34a50c[0x0]:null;}if(!_0x19a553&&!_0x34a50c)return _0x2e6dd8;var _0x184569=_0x209aff[_0x1efca5[_0xb650('0x15')]][_0xb650('0x8e')];_0x43a34f[_0xb650('0xd')]=_[_0xb650('0x8f')](_0x184569);_0x43a34f['query']=_[_0xb650('0x8f')](_0x2ff199[_0xb650('0x7d')]);_0x43a34f['filters']=_[_0xb650('0x90')](_0x43a34f[_0xb650('0xd')],_0x43a34f[_0xb650('0x7d')]);_0x563ba0[_0xb650('0x91')]=_['intersection'](_0x43a34f['model'],qs['fields'](_0x2ff199[_0xb650('0x7d')][_0xb650('0x92')]));_0x563ba0[_0xb650('0x91')]=_0x563ba0[_0xb650('0x91')][_0xb650('0x87')]?_0x563ba0[_0xb650('0x91')]:_0x43a34f[_0xb650('0xd')];if(!_0x2ff199[_0xb650('0x7d')]['hasOwnProperty'](_0xb650('0x93'))){_0x563ba0[_0xb650('0x94')]=qs[_0xb650('0x94')](_0x2ff199[_0xb650('0x7d')][_0xb650('0x94')]);_0x563ba0[_0xb650('0x95')]=qs[_0xb650('0x95')](_0x2ff199[_0xb650('0x7d')][_0xb650('0x95')]);}_0x563ba0[_0xb650('0x96')]=qs[_0xb650('0x97')](_0x2ff199[_0xb650('0x7d')]['sort']);_0x563ba0[_0xb650('0x7a')]=qs['filters'](_[_0xb650('0x98')](_0x2ff199[_0xb650('0x7d')],_0x43a34f[_0xb650('0x99')]));if(_0x2ff199[_0xb650('0x7d')][_0xb650('0x6')]){_0x563ba0[_0xb650('0x7a')]=_[_0xb650('0x9a')](_0x563ba0[_0xb650('0x7a')],{'$or':_['map'](_0x184569,function(_0x3c105c){if(_0x3c105c[_0xb650('0x13')]['key']!==_0xb650('0x9b')){var _0x356047={};_0x356047[_0x3c105c['field']]={'$like':'%'+_0x2ff199[_0xb650('0x7d')][_0xb650('0x6')]+'%'};return _0x356047;}})});}var _0x1f7a82=[];var _0x15d9f4=null;var _0x4f1cbc={};if(_0x19a553){_0x15d9f4=_[_0xb650('0x89')](_0xd4d801,[_0xb650('0xf'),_0x19a553['name']]);if(_0x15d9f4[_0xb650('0x7')]){_0x4f1cbc={};if(_0x1efca5['childModel']==='AnalyticExtractedReport'){_0x4f1cbc[_0x15d9f4['foreignKey']]=_[_0xb650('0xa')](_0x19a553[_0xb650('0x9')],'id');}else{_0x4f1cbc[_0x15d9f4['foreignKey']]=_0x19a553['associatedResources'];}_0x1f7a82[_0xb650('0x8d')](_0x4f1cbc);}else{_0x563ba0[_0xb650('0x7a')]['id']=_0x19a553[_0xb650('0x9')];}}else{for(var _0x4b6b3e=0x0;_0x4b6b3e<_0x34a50c['length'];_0x4b6b3e++){_0x15d9f4=_[_0xb650('0x89')](_0xd4d801,['name',_0x34a50c[_0x4b6b3e][_0xb650('0xf')]]);if(_0x15d9f4[_0xb650('0x7')]){_0x4f1cbc={};_0x4f1cbc[_0x15d9f4[_0xb650('0x9c')]]=_0x34a50c[_0x4b6b3e][_0xb650('0x9')];_0x1f7a82[_0xb650('0x8d')](_0x4f1cbc);}else{if(!_0x563ba0['where']['id'])_0x563ba0[_0xb650('0x7a')]['id']=[];_0x34a50c[_0x4b6b3e][_0xb650('0x9')][_0xb650('0x9d')](function(_0x5d54d2){_0x563ba0[_0xb650('0x7a')]['id'][_0xb650('0x8d')](_0x5d54d2);});}}}if(!_[_0xb650('0x86')](_0x1f7a82)){_0x563ba0[_0xb650('0x7a')]=_[_0xb650('0x9a')](_0x563ba0['where'],{'$and':{'$or':_0x1f7a82}});}_0x563ba0=_[_0xb650('0x9a')]({},_0x563ba0,_0x2ff199[_0xb650('0x9e')]);if(_0x19a553&&!_0x19a553[_0xb650('0x9f')]&&_0x1efca5[_0xb650('0x15')]===_0xb650('0x11')){if(_0x2ff199[_0xb650('0x7d')][_0xb650('0xa0')]){_0x563ba0['include']=[{'all':!![]}];}return _0x209aff[_0x1efca5['childModel']]['findAll'](_0x563ba0)['then'](function(_0xdc474a){var _0xac6ab=[];_0xdc474a[_0xb650('0x9d')](function(_0x1af4e2){var _0x3f9710;switch(_0x1af4e2[_0xb650('0xa1')]){case _0xb650('0xa2'):_0x3f9710=_[_0xb650('0x89')](_0x19a553[_0xb650('0x9')],function(_0x4ab7ce){return _0x4ab7ce['id']===_0x1af4e2[_0xb650('0xa3')]&&_0x4ab7ce[_0xb650('0x13')]===_0xb650('0xa4');});break;case _0xb650('0xa5'):_0x3f9710=_['find'](_0x19a553[_0xb650('0x9')],function(_0x4deabd){return _0x4deabd['id']===_0x1af4e2[_0xb650('0xa3')]&&_0x4deabd[_0xb650('0x13')]===_0xb650('0xa6');});break;}if(_0x3f9710)_0xac6ab[_0xb650('0x8d')](_0x1af4e2);});_0x2e6dd8[_0xb650('0xa7')]=_0xac6ab[_0xb650('0x87')];_0x2e6dd8[_0xb650('0xa8')]=_0xac6ab;return _0x2e6dd8;});}else{if(!_[_0xb650('0x86')](_0x2ff199[_0xb650('0x7d')][_0xb650('0xa9')])){_0x563ba0['where']['id']=_0x563ba0[_0xb650('0x7a')]['id']?_[_0xb650('0x90')](_0x563ba0[_0xb650('0x7a')]['id'],_0x2ff199[_0xb650('0x7d')][_0xb650('0xa9')]):_0x2ff199[_0xb650('0x7d')][_0xb650('0xa9')];if(_0x2ff199[_0xb650('0x7d')][_0xb650('0xaa')]){_0x563ba0[_0xb650('0x96')]=_0x2ff199[_0xb650('0x7d')]['customSorting'];}}if(_0x2ff199['query']['extraQueryConditions']){_0x563ba0[_0xb650('0x7a')]=_[_0xb650('0x9a')](_0x563ba0['where'],{'$and':_0x2ff199[_0xb650('0x7d')][_0xb650('0xab')]});}return _0x209aff[_0x1efca5[_0xb650('0x15')]][_0xb650('0xa7')]({'where':_0x563ba0[_0xb650('0x7a')]})['then'](function(_0x39431e){_0x2e6dd8[_0xb650('0xa7')]=_0x39431e;if(_0x2ff199[_0xb650('0x7d')]['includeAll']){if(_0x1efca5['childModel']===_0xb650('0x1d')){_0x563ba0[_0xb650('0xac')]=[{'model':_0x209aff[_0xb650('0x67')],'as':_0xb650('0xad'),'attributes':['id',_0xb650('0xf'),'color'],'required':_0x2ff199['query'][_0xb650('0xae')]?!![]:![]},{'model':_0x209aff[_0xb650('0x67')],'as':'ThroughTags','attributes':['id','name','color'],'through':_0x2ff199['query'][_0xb650('0xae')]?{'attributes':[],'where':{'TagId':_0x2ff199[_0xb650('0x7d')][_0xb650('0xae')]||undefined}}:{},'required':_0x2ff199[_0xb650('0x7d')][_0xb650('0xae')]?!![]:![]}];}else{_0x563ba0[_0xb650('0xac')]=[{'all':!![]}];}}return _0x209aff[_0x1efca5[_0xb650('0x15')]][_0xb650('0xe')](_0x563ba0);})[_0xb650('0x8')](function(_0x1fd77f){_0x2e6dd8[_0xb650('0xa8')]=_0x1fd77f;if(_0x31da54===_0xb650('0x30')&&_0x2ff199[_0xb650('0x7d')][_0xb650('0xaf')]===_0xb650('0xb0')){var _0x1020b1=[];for(var _0x232bad=0x0;_0x232bad<_0x2e6dd8['rows'][_0xb650('0x87')];_0x232bad++){_0x1020b1['push'](_0x4dd255(_0xb650('0xb1'),_0x2e6dd8[_0xb650('0xa8')][_0x232bad][_0xb650('0xb2')]));_0x1020b1[_0xb650('0x8d')](_0x4dd255(_0xb650('0xb3'),_0x2e6dd8[_0xb650('0xa8')][_0x232bad][_0xb650('0xb2')]));_0x1020b1[_0xb650('0x8d')](_0x4dd255(_0xb650('0xb4'),_0x2e6dd8['rows'][_0x232bad][_0xb650('0xb2')]));_0x1020b1[_0xb650('0x8d')](_0x4dd255(_0xb650('0xb5'),_0x2e6dd8[_0xb650('0xa8')][_0x232bad][_0xb650('0xb2')]));_0x1020b1[_0xb650('0x8d')](_0x4dd255(_0xb650('0xb6'),_0x2e6dd8[_0xb650('0xa8')][_0x232bad]['dataValues']));_0x1020b1[_0xb650('0x8d')](_0x4dd255('whatsapp',_0x2e6dd8['rows'][_0x232bad][_0xb650('0xb2')]));}return Promise[_0xb650('0x8b')](_0x1020b1)[_0xb650('0x8')](function(){return _0x2e6dd8;});}return _0x2e6dd8;});}});}}});}; \ No newline at end of file +var _0xdd51=['SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','ZohoAccount','Disposition','customdashboards','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','user_profiles','raw','mergeResources','isEmpty','length','push','find','params','all','union','ignore','autoAssociation','rawAttributes','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','findAll','then','map','catch','field','value','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','OpenchannelAccount','smsqueues'];(function(_0x4bc97d,_0x499a11){var _0x3282be=function(_0x1c142b){while(--_0x1c142b){_0x4bc97d['push'](_0x4bc97d['shift']());}};_0x3282be(++_0x499a11);}(_0xdd51,0x1ed));var _0x1dd5=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xdd51[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x1dd5('0x0'));var attributes=require(_0x1dd5('0x1'));var qs=require(_0x1dd5('0x2'));var squel=require('squel');module[_0x1dd5('0x3')]=function(_0x3b0a98){var _0x42cf9e=_0x3b0a98['models'];function _0x75fba5(_0xc47543,_0x3f10da){return new Promise(function(_0x3092fa,_0x484dbb){if(!_0x3f10da)return _0x3092fa(null);var _0x1074c0=_0x3f10da[_0x1dd5('0x4')]?{[_0x3f10da[_0x1dd5('0x4')]['field']]:_0x3f10da['filter']['value']}:undefined;return _0x42cf9e[_0xc47543][_0x1dd5('0x5')]({'where':_0x1074c0,'raw':!![]})[_0x1dd5('0x6')](function(_0x26c5c6){_0x3f10da['associatedResources']=_[_0x1dd5('0x7')](_0x26c5c6,'id');_0x3092fa(_0x3f10da);})[_0x1dd5('0x8')](function(_0x3ab76e){_0x484dbb(_0x3ab76e);});});}function _0x441aae(_0xbcbf9f,_0x3d40e4){return new Promise(function(_0x507508,_0x488e0c){var _0x1febf3=_0xbcbf9f[_0x1dd5('0x4')]?{[_0xbcbf9f[_0x1dd5('0x4')][_0x1dd5('0x9')]]:_0xbcbf9f['filter'][_0x1dd5('0xa')]}:undefined;return _0x42cf9e[_0xbcbf9f[_0x1dd5('0xb')]]['findAll']({'where':_0x1febf3,'raw':!![]})['then'](function(_0x3e378b){_0x3d40e4[_0x1dd5('0xc')]=_['map'](_0x3e378b,function(_0x56d460){return _0x56d460[_0x1dd5('0xd')];});_0x507508(_0x3d40e4);})['catch'](function(_0x43c6a8){_0x488e0c(_0x43c6a8);});});}function _0x249250(_0x397391,_0x1a8818,_0x165cec){if(!_0x1a8818)return Promise[_0x1dd5('0xe')](null);return new Promise(function(_0x2449db,_0x1a9258){return _0x42cf9e[_0x1dd5('0xf')]['findAll']({'where':{'sectionId':_0x1a8818['id']},'raw':!![]})['then'](function(_0x53a4b9){if(_0x397391[_0x1dd5('0x9')]&&_0x397391[_0x1dd5('0x9')]!=='id'){_0x1a8818[_0x1dd5('0xc')]=_['map'](_0x53a4b9,function(_0x1f87a5){return _0x1f87a5[_0x397391[_0x1dd5('0x9')]];});}else{if(_0x165cec===_0x1dd5('0x10')){_0x1a8818[_0x1dd5('0xc')]=_[_0x1dd5('0x7')](_0x53a4b9,function(_0x3076b7){return{'id':_0x3076b7[_0x1dd5('0x11')],'type':_0x3076b7[_0x1dd5('0x12')]};});}else{_0x1a8818[_0x1dd5('0xc')]=_['map'](_0x53a4b9,function(_0x47febe){return _0x47febe['resourceId'];});}}_0x2449db(_0x1a8818);})[_0x1dd5('0x8')](function(_0x3851fd){_0x1a9258(_0x3851fd);});});}function _0x5eaae7(_0x4a33d6,_0x1bdb99){var _0x36d228={'parentSections':[]};switch(_0x4a33d6[_0x1dd5('0x13')]()){case'squareprojects':_0x36d228[_0x1dd5('0x14')]='SquareProject';break;case _0x1dd5('0x15'):_0x36d228[_0x1dd5('0x14')]='SquareOdbc';break;case _0x1dd5('0x16'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x17');_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x19'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x1a')}];break;case _0x1dd5('0x1b'):_0x36d228[_0x1dd5('0x14')]='JscriptyProject';break;case'contacts':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x1c');_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x1d'),'field':'id','foreignKey':_0x1dd5('0x1e')}];break;case _0x1dd5('0x1f'):_0x36d228['childModel']=_0x1dd5('0x20');break;case _0x1dd5('0x21'):_0x36d228['childModel']=_0x1dd5('0x22');break;case'globalcustomfields':_0x36d228['childModel']=_0x1dd5('0x23');break;case _0x1dd5('0x24'):_0x36d228[_0x1dd5('0x14')]='ChatQueue';break;case'chatwebsites':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x25');break;case _0x1dd5('0x26'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x27');break;case'faxaccounts':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x28');break;case _0x1dd5('0x29'):case _0x1dd5('0x2a'):case'outboundroutes':_0x36d228['childModel']='VoiceExtension';break;case _0x1dd5('0x2b'):_0x36d228[_0x1dd5('0x14')]='VoiceContext';break;case'voicemails':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x2c');break;case _0x1dd5('0x2d'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x2e');_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x2f'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x30'),'model':_0x1dd5('0x31'),'filter':{'field':_0x1dd5('0x32'),'value':[_0x1dd5('0x33')]}},{'name':_0x1dd5('0x34'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x30'),'model':_0x1dd5('0x31'),'filter':{'field':_0x1dd5('0x32'),'value':[_0x1dd5('0x35')]}},{'name':_0x1dd5('0x36'),'field':_0x1dd5('0xd'),'foreignKey':'queue','model':_0x1dd5('0x37'),'filter':{'field':_0x1dd5('0x12'),'value':[_0x1dd5('0x38')]}},{'name':_0x1dd5('0x39'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x3a'),'model':_0x1dd5('0x37'),'filter':{'field':_0x1dd5('0x12'),'value':[_0x1dd5('0x3b')]}}];break;case _0x1dd5('0x3c'):_0x36d228['childModel']=_0x1dd5('0x3d');break;case _0x1dd5('0x3e'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x3f');break;case _0x1dd5('0x40'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x41');break;case _0x1dd5('0x42'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x43');break;case _0x1dd5('0x44'):_0x36d228[_0x1dd5('0x14')]='MailQueue';break;case _0x1dd5('0x45'):_0x36d228['childModel']=_0x1dd5('0x46');break;case _0x1dd5('0x47'):_0x36d228[_0x1dd5('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x36d228[_0x1dd5('0x14')]='OpenchannelQueue';break;case'openchannelaccounts':_0x36d228['childModel']=_0x1dd5('0x48');break;case _0x1dd5('0x49'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4a');break;case _0x1dd5('0x4b'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4c');break;case'whatsappqueues':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4d');break;case _0x1dd5('0x4e'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4f');break;case _0x1dd5('0x50'):_0x36d228['childModel']=_0x1dd5('0x51');break;case _0x1dd5('0x52'):case _0x1dd5('0x53'):_0x36d228[_0x1dd5('0x14')]='VoiceQueue';if(_0x1bdb99){_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x36')},{'name':_0x1dd5('0x39')}];}break;case _0x1dd5('0x54'):case'agents':case _0x1dd5('0x55'):_0x36d228[_0x1dd5('0x14')]='User';if(_0x1bdb99){_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x56'),'filter':{'field':'role','value':[_0x1dd5('0x57'),_0x1dd5('0x58')]},'ignore':!![]},{'name':_0x1dd5('0x2f')},{'name':_0x1dd5('0x34')}];}break;case _0x1dd5('0x59'):_0x36d228[_0x1dd5('0x14')]='ZendeskAccount';break;case _0x1dd5('0x5a'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x5b');break;case _0x1dd5('0x5c'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x5d');break;case'sugarcrmaccounts':_0x36d228[_0x1dd5('0x14')]='SugarcrmAccount';break;case _0x1dd5('0x5e'):_0x36d228[_0x1dd5('0x14')]='DeskAccount';break;case'zohoaccounts':_0x36d228['childModel']=_0x1dd5('0x5f');break;case'vtigeraccounts':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x31');break;case'cannedanswers':_0x36d228['childModel']='CannedAnswer';break;case'dispositions':_0x36d228['childModel']=_0x1dd5('0x60');break;case _0x1dd5('0x61'):_0x36d228[_0x1dd5('0x14')]='Dashboard';break;case'intervals':_0x36d228['childModel']=_0x1dd5('0x62');break;case _0x1dd5('0x63'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x64');break;case'scheduler':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x65');break;case _0x1dd5('0x66'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x67');break;case _0x1dd5('0x68'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x69');break;case _0x1dd5('0x6a'):_0x36d228['childModel']='Template';break;case _0x1dd5('0x6b'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x6c');break;case _0x1dd5('0x6d'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x6e');break;case _0x1dd5('0x6f'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x70');break;case _0x1dd5('0x71'):_0x36d228['childModel']=_0x1dd5('0x72');break;case _0x1dd5('0x73'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x10');_0x36d228['parentSections']=[{'name':_0x1dd5('0x74'),'field':'id','foreignKey':_0x1dd5('0x75')}];break;case _0x1dd5('0x76'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x77');break;}return _0x36d228;}function _0x496dc9(_0x75f93b,_0x3bc27a){var _0x5c7f62=_0x75f93b[_0x1dd5('0x78')](0x0)[_0x1dd5('0x79')]()+_0x75f93b[_0x1dd5('0x7a')](0x1);var _0x4a95fe={'type':_0x42cf9e[_0x1dd5('0x7b')]['QueryTypes'][_0x1dd5('0x7c')],'raw':!![]};return new Promise(function(_0x27ff98,_0x2b7453){var _0x326516=squel[_0x1dd5('0x7d')]()['field'](_0x1dd5('0x7e')+_0x5c7f62+_0x1dd5('0x7f'),'id')['field'](_0x1dd5('0x80'))[_0x1dd5('0x81')]('user_has_'+_0x75f93b+_0x1dd5('0x82'),'ui')[_0x1dd5('0x83')](_0x1dd5('0x84'),_0x3bc27a['id']);return _0x42cf9e[_0x1dd5('0x85')][_0x1dd5('0x86')](_0x326516['toString'](),_0x4a95fe)[_0x1dd5('0x6')](function(_0x4aaedd){_0x3bc27a[_0x5c7f62+_0x1dd5('0x87')]=_0x4aaedd;_0x27ff98(_0x4aaedd);})[_0x1dd5('0x8')](function(_0x17ae12){_0x2b7453(_0x17ae12);});});}return _0x3b0a98['define'](_0x1dd5('0x88'),attributes,{'tableName':_0x1dd5('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x54dc3e){var _0xa27821={'raw':_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x8a')],'where':{}};var _0x22806b={};var _0x2e4d7a={'count':0x0,'rows':[]};var _0x482e27=_0x54dc3e[_0x1dd5('0x86')]['section'];var _0x1ac37f=_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x8b')]||![];var _0x517569=_0x5eaae7(_0x482e27,_0x1ac37f);if(!_0x517569['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x482e27+'\x27');var _0x36f0d9=[{'name':_0x482e27}];if(!_[_0x1dd5('0x8c')](_0x517569[_0x1dd5('0x18')]))_0x36f0d9=_0x517569[_0x1dd5('0x18')];var _0x40ba28=[];for(var _0x10ac44=0x0;_0x10ac44<_0x36f0d9[_0x1dd5('0x8d')];_0x10ac44++){_0x40ba28[_0x1dd5('0x8e')](_0x42cf9e['UserProfileSection'][_0x1dd5('0x8f')]({'where':{'userProfileId':_0x54dc3e[_0x1dd5('0x90')]['id'],'name':_0x36f0d9[_0x10ac44][_0x1dd5('0xd')]},'raw':!![]}));}return Promise[_0x1dd5('0x91')](_0x40ba28)[_0x1dd5('0x6')](function(_0x56aa6d){var _0x2c459f=_[_0x1dd5('0x4')](_0x56aa6d,function(_0x1f24c5){return _0x1f24c5?_0x1f24c5:undefined;});var _0x46d288=_[_0x1dd5('0x4')](_0x36f0d9,['ignore',!![]]);var _0x36e77f=_['isEmpty'](_0x2c459f)&&_['isEmpty'](_0x46d288)?null:_[_0x1dd5('0x92')](_0x46d288,_0x2c459f);if(!_0x36e77f)return null;var _0xfb6be0=[];for(var _0x519862=0x0;_0x519862<_0x36e77f['length'];_0x519862++){var _0x108aa8=_[_0x1dd5('0x8f')](_0x36f0d9,function(_0x357a79){return _0x36e77f[_0x519862]?_0x357a79[_0x1dd5('0xd')]===_0x36e77f[_0x519862][_0x1dd5('0xd')]:null;});if(_0x108aa8){if(_0x36e77f[_0x519862][_0x1dd5('0x93')]){_0xfb6be0[_0x1dd5('0x8e')](_0x75fba5(_0x517569[_0x1dd5('0x14')],_0x36e77f[_0x519862]));}else{if(!_0x36e77f[_0x519862][_0x1dd5('0x94')]){_0xfb6be0[_0x1dd5('0x8e')](_0x249250(_0x108aa8,_0x36e77f[_0x519862],_0x517569[_0x1dd5('0x14')]));}else{if(_0x108aa8[_0x1dd5('0xb')]){_0xfb6be0[_0x1dd5('0x8e')](_0x441aae(_0x108aa8,_0x36e77f[_0x519862]));}}}}}return Promise[_0x1dd5('0x91')](_0xfb6be0);})['then'](function(_0x363239){var _0x60dff=_0x363239;var _0xba936c=null;if(_0x60dff){_0xba936c=_0x60dff[_0x1dd5('0x8d')]===0x1?_0x60dff[0x0]:null;}if(!_0xba936c&&!_0x60dff)return _0x2e4d7a;var _0x39ba37=_0x42cf9e[_0x517569[_0x1dd5('0x14')]][_0x1dd5('0x95')];_0x22806b['model']=_[_0x1dd5('0x96')](_0x39ba37);_0x22806b['query']=_[_0x1dd5('0x96')](_0x54dc3e[_0x1dd5('0x86')]);_0x22806b['filters']=_['intersection'](_0x22806b[_0x1dd5('0xb')],_0x22806b['query']);_0xa27821[_0x1dd5('0x97')]=_[_0x1dd5('0x98')](_0x22806b[_0x1dd5('0xb')],qs['fields'](_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x99')]));_0xa27821[_0x1dd5('0x97')]=_0xa27821[_0x1dd5('0x97')]['length']?_0xa27821['attributes']:_0x22806b[_0x1dd5('0xb')];if(!_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x9a')](_0x1dd5('0x9b'))){_0xa27821[_0x1dd5('0x9c')]=qs['limit'](_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x9c')]);_0xa27821[_0x1dd5('0x9d')]=qs[_0x1dd5('0x9d')](_0x54dc3e[_0x1dd5('0x86')]['offset']);}_0xa27821[_0x1dd5('0x9e')]=qs[_0x1dd5('0x9f')](_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x9f')]);_0xa27821[_0x1dd5('0x83')]=qs[_0x1dd5('0xa0')](_[_0x1dd5('0xa1')](_0x54dc3e[_0x1dd5('0x86')],_0x22806b[_0x1dd5('0xa0')]));if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x4')]){_0xa27821[_0x1dd5('0x83')]=_[_0x1dd5('0xa2')](_0xa27821[_0x1dd5('0x83')],{'$or':_['map'](_0x39ba37,function(_0x556967){if(_0x556967[_0x1dd5('0x12')][_0x1dd5('0xa3')]!==_0x1dd5('0xa4')){var _0x9a09ea={};_0x9a09ea[_0x556967[_0x1dd5('0x9')]]={'$like':'%'+_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x4')]+'%'};return _0x9a09ea;}})});}var _0x13bcf9=[];var _0x227c00=null;var _0x13e3f9={};if(_0xba936c){_0x227c00=_[_0x1dd5('0x8f')](_0x36f0d9,[_0x1dd5('0xd'),_0xba936c[_0x1dd5('0xd')]]);if(_0x227c00[_0x1dd5('0x9')]){_0x13e3f9={};if(_0x517569['childModel']===_0x1dd5('0x10')){_0x13e3f9[_0x227c00[_0x1dd5('0xa5')]]=_[_0x1dd5('0x7')](_0xba936c[_0x1dd5('0xc')],'id');}else{_0x13e3f9[_0x227c00[_0x1dd5('0xa5')]]=_0xba936c[_0x1dd5('0xc')];}_0x13bcf9[_0x1dd5('0x8e')](_0x13e3f9);}else{_0xa27821[_0x1dd5('0x83')]['id']=_0xba936c[_0x1dd5('0xc')];}}else{for(var _0x192020=0x0;_0x192020<_0x60dff[_0x1dd5('0x8d')];_0x192020++){_0x227c00=_[_0x1dd5('0x8f')](_0x36f0d9,[_0x1dd5('0xd'),_0x60dff[_0x192020][_0x1dd5('0xd')]]);if(_0x227c00[_0x1dd5('0x9')]){_0x13e3f9={};_0x13e3f9[_0x227c00['foreignKey']]=_0x60dff[_0x192020][_0x1dd5('0xc')];_0x13bcf9[_0x1dd5('0x8e')](_0x13e3f9);}else{if(!_0xa27821[_0x1dd5('0x83')]['id'])_0xa27821[_0x1dd5('0x83')]['id']=[];_0x60dff[_0x192020][_0x1dd5('0xc')][_0x1dd5('0xa6')](function(_0x4c7340){_0xa27821['where']['id'][_0x1dd5('0x8e')](_0x4c7340);});}}}if(!_[_0x1dd5('0x8c')](_0x13bcf9)){_0xa27821[_0x1dd5('0x83')]=_[_0x1dd5('0xa2')](_0xa27821[_0x1dd5('0x83')],{'$and':{'$or':_0x13bcf9}});}_0xa27821=_[_0x1dd5('0xa2')]({},_0xa27821,_0x54dc3e[_0x1dd5('0xa7')]);if(_0xba936c&&!_0xba936c[_0x1dd5('0x94')]&&_0x517569['childModel']==='AnalyticExtractedReport'){if(_0x54dc3e['query'][_0x1dd5('0xa8')]){_0xa27821[_0x1dd5('0xa9')]=[{'all':!![]}];}return _0x42cf9e[_0x517569[_0x1dd5('0x14')]][_0x1dd5('0x5')](_0xa27821)['then'](function(_0x26e526){var _0x294119=[];_0x26e526[_0x1dd5('0xa6')](function(_0x5ecec0){var _0x5cd4a3;switch(_0x5ecec0[_0x1dd5('0xaa')]){case _0x1dd5('0xab'):_0x5cd4a3=_[_0x1dd5('0x8f')](_0xba936c[_0x1dd5('0xc')],function(_0x463c77){return _0x463c77['id']===_0x5ecec0[_0x1dd5('0x75')]&&_0x463c77[_0x1dd5('0x12')]===_0x1dd5('0xac');});break;case _0x1dd5('0xad'):_0x5cd4a3=_[_0x1dd5('0x8f')](_0xba936c[_0x1dd5('0xc')],function(_0xf52bf3){return _0xf52bf3['id']===_0x5ecec0[_0x1dd5('0x75')]&&_0xf52bf3[_0x1dd5('0x12')]==='CustomReports';});break;}if(_0x5cd4a3)_0x294119['push'](_0x5ecec0);});_0x2e4d7a['count']=_0x294119['length'];_0x2e4d7a[_0x1dd5('0xae')]=_0x294119;return _0x2e4d7a;});}else{if(!_[_0x1dd5('0x8c')](_0x54dc3e['query']['ids'])){_0xa27821[_0x1dd5('0x83')]['id']=_0xa27821[_0x1dd5('0x83')]['id']?_[_0x1dd5('0x98')](_0xa27821[_0x1dd5('0x83')]['id'],_0x54dc3e['query'][_0x1dd5('0xaf')]):_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xaf')];if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb0')]){_0xa27821[_0x1dd5('0x9e')]=_0x54dc3e[_0x1dd5('0x86')]['customSorting'];}}if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb1')]){_0xa27821[_0x1dd5('0x83')]=_['merge'](_0xa27821[_0x1dd5('0x83')],{'$and':_0x54dc3e['query'][_0x1dd5('0xb1')]});}return _0x42cf9e[_0x517569[_0x1dd5('0x14')]][_0x1dd5('0xb2')]({'where':_0xa27821['where']})[_0x1dd5('0x6')](function(_0x3c6dfa){_0x2e4d7a['count']=_0x3c6dfa;if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xa8')]){if(_0x517569[_0x1dd5('0x14')]==='CmContact'){_0xa27821[_0x1dd5('0xa9')]=[{'model':_0x42cf9e[_0x1dd5('0x69')],'as':'Tags','attributes':['id',_0x1dd5('0xd'),_0x1dd5('0xb3')],'required':_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb4')]?!![]:![]},{'model':_0x42cf9e['Tag'],'as':_0x1dd5('0xb5'),'attributes':['id',_0x1dd5('0xd'),'color'],'through':_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb4')]?{'attributes':[],'where':{'TagId':_0x54dc3e['query'][_0x1dd5('0xb4')]||undefined}}:{},'required':_0x54dc3e['query']['tag']?!![]:![]}];}else{_0xa27821[_0x1dd5('0xa9')]=[{'all':!![]}];}}return _0x42cf9e[_0x517569['childModel']][_0x1dd5('0x5')](_0xa27821);})[_0x1dd5('0x6')](function(_0x3585a5){_0x2e4d7a[_0x1dd5('0xae')]=_0x3585a5;if(_0x482e27===_0x1dd5('0x2f')&&_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb6')]==='true'){var _0x2f67b4=[];for(var _0x29a751=0x0;_0x29a751<_0x2e4d7a[_0x1dd5('0xae')][_0x1dd5('0x8d')];_0x29a751++){_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xb7'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751][_0x1dd5('0xb8')]));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xb9'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751]['dataValues']));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xba'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751][_0x1dd5('0xb8')]));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9('mail',_0x2e4d7a['rows'][_0x29a751]['dataValues']));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xbb'),_0x2e4d7a['rows'][_0x29a751][_0x1dd5('0xb8')]));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xbc'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751][_0x1dd5('0xb8')]));}return Promise[_0x1dd5('0x91')](_0x2f67b4)[_0x1dd5('0x6')](function(){return _0x2e4d7a;});}return _0x2e4d7a;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 5b085c5..03f8d85 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc373=['./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x25e378,_0x50d078){var _0x3e5149=function(_0x435cae){while(--_0x435cae){_0x25e378['push'](_0x25e378['shift']());}};_0x3e5149(++_0x50d078);}(_0xc373,0x1c7));var _0x3c37=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0xc373[_0x238830];return _0x5917f0;};'use strict';var _=require('lodash');var util=require(_0x3c37('0x0'));var moment=require(_0x3c37('0x1'));var BPromise=require(_0x3c37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c37('0x3'))['db'];var utils=require(_0x3c37('0x4'));var logger=require(_0x3c37('0x5'))(_0x3c37('0x6'));var config=require(_0x3c37('0x7'));var jayson=require(_0x3c37('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x3c37('0x9')]=_[_0x3c37('0xa')](config[_0x3c37('0x9')],{'host':_0x3c37('0xb'),'port':0x18eb});var socket=require(_0x3c37('0xc'))(new Redis(config[_0x3c37('0x9')]));require(_0x3c37('0xd'))[_0x3c37('0xe')](socket);function respondWithRpcPromise(_0xa015c8,_0x57349e,_0x4bf38e){return new BPromise(function(_0x444545,_0x3d493c){return client[_0x3c37('0xf')](_0xa015c8,_0x4bf38e)[_0x3c37('0x10')](function(_0x17a164){logger[_0x3c37('0x11')](_0x3c37('0x12'),_0x57349e,'request\x20sent');logger[_0x3c37('0x13')](_0x3c37('0x14'),_0x57349e,_0x3c37('0x15'),JSON['stringify'](_0x17a164));if(_0x17a164['error']){if(_0x17a164[_0x3c37('0x16')]['code']===0x1f4){logger['error'](_0x3c37('0x12'),_0x57349e,_0x17a164[_0x3c37('0x16')][_0x3c37('0x17')]);return _0x3d493c(_0x17a164[_0x3c37('0x16')][_0x3c37('0x17')]);}logger[_0x3c37('0x16')](_0x3c37('0x12'),_0x57349e,_0x17a164[_0x3c37('0x16')][_0x3c37('0x17')]);return _0x444545(_0x17a164['error'][_0x3c37('0x17')]);}else{logger[_0x3c37('0x11')]('UserProfile,\x20%s,\x20%s',_0x57349e,'request\x20sent');_0x444545(_0x17a164[_0x3c37('0x18')][_0x3c37('0x17')]);}})[_0x3c37('0x19')](function(_0xaf1f45){logger[_0x3c37('0x16')](_0x3c37('0x12'),_0x57349e,_0xaf1f45);_0x3d493c(_0xaf1f45);});});} \ No newline at end of file +var _0x1c63=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1826f7,_0x5c7c64){var _0x3bcebf=function(_0x5f4577){while(--_0x5f4577){_0x1826f7['push'](_0x1826f7['shift']());}};_0x3bcebf(++_0x5c7c64);}(_0x1c63,0xdc));var _0x31c6=function(_0x508a0a,_0x3ed316){_0x508a0a=_0x508a0a-0x0;var _0x4acf06=_0x1c63[_0x508a0a];return _0x4acf06;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));var BPromise=require(_0x31c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31c6('0x4'));var db=require(_0x31c6('0x5'))['db'];var utils=require(_0x31c6('0x6'));var logger=require('../../config/logger')(_0x31c6('0x7'));var config=require(_0x31c6('0x8'));var jayson=require(_0x31c6('0x9'));var client=jayson[_0x31c6('0xa')][_0x31c6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x31c6('0xc')],{'host':_0x31c6('0xd'),'port':0x18eb});var socket=require(_0x31c6('0xe'))(new Redis(config[_0x31c6('0xc')]));require(_0x31c6('0xf'))['register'](socket);function respondWithRpcPromise(_0x731d0f,_0x1172bb,_0xb21602){return new BPromise(function(_0x2ee25a,_0x45466b){return client['request'](_0x731d0f,_0xb21602)[_0x31c6('0x10')](function(_0x4d02f1){logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x1172bb,'request\x20sent');logger[_0x31c6('0x13')](_0x31c6('0x14'),_0x1172bb,_0x31c6('0x15'),JSON[_0x31c6('0x16')](_0x4d02f1));if(_0x4d02f1[_0x31c6('0x17')]){if(_0x4d02f1[_0x31c6('0x17')]['code']===0x1f4){logger[_0x31c6('0x17')](_0x31c6('0x12'),_0x1172bb,_0x4d02f1[_0x31c6('0x17')][_0x31c6('0x18')]);return _0x45466b(_0x4d02f1[_0x31c6('0x17')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x1172bb,_0x4d02f1['error'][_0x31c6('0x18')]);return _0x2ee25a(_0x4d02f1['error'][_0x31c6('0x18')]);}else{logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x1172bb,_0x31c6('0x15'));_0x2ee25a(_0x4d02f1[_0x31c6('0x19')][_0x31c6('0x18')]);}})[_0x31c6('0x1a')](function(_0x2fd91f){logger['error']('UserProfile,\x20%s,\x20%s',_0x1172bb,_0x2fd91f);_0x45466b(_0x2fd91f);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 6c405fc..4f65540 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c6a=['update','emit','removeListener','register','length','userProfile:','save','remove'];(function(_0x529d3d,_0xa005c8){var _0x522c21=function(_0x43ecac){while(--_0x43ecac){_0x529d3d['push'](_0x529d3d['shift']());}};_0x522c21(++_0xa005c8);}(_0x4c6a,0x1b6));var _0xa4c6=function(_0x5af491,_0x4ad2fd){_0x5af491=_0x5af491-0x0;var _0x6ec62f=_0x4c6a[_0x5af491];return _0x6ec62f;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xa4c6('0x0'),_0xa4c6('0x1'),_0xa4c6('0x2')];function createListener(_0x3fa2f0,_0x44d1c9){return function(_0x266680){_0x44d1c9[_0xa4c6('0x3')](_0x3fa2f0,_0x266680);};}function removeListener(_0x12ae82,_0x4cf637){return function(){UserProfileEvents[_0xa4c6('0x4')](_0x12ae82,_0x4cf637);};}exports[_0xa4c6('0x5')]=function(_0x4bc5c9){for(var _0x4ad502=0x0,_0x5cf6af=events[_0xa4c6('0x6')];_0x4ad502<_0x5cf6af;_0x4ad502++){var _0x48d5ab=events[_0x4ad502];var _0x43bef6=createListener(_0xa4c6('0x7')+_0x48d5ab,_0x4bc5c9);UserProfileEvents['on'](_0x48d5ab,_0x43bef6);}}; \ No newline at end of file +var _0xf24f=['userProfile:','save','remove','update','register'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf24f,0x1dc));var _0xff24=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xf24f[_0x41cfd4];return _0x190f48;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xff24('0x0'),_0xff24('0x1'),_0xff24('0x2')];function createListener(_0xdf8524,_0x45ac9c){return function(_0x358a18){_0x45ac9c['emit'](_0xdf8524,_0x358a18);};}function removeListener(_0x408bb0,_0x21ee44){return function(){UserProfileEvents['removeListener'](_0x408bb0,_0x21ee44);};}exports[_0xff24('0x3')]=function(_0x32b089){for(var _0x2d8c2b=0x0,_0x5d5fdf=events['length'];_0x2d8c2b<_0x5d5fdf;_0x2d8c2b++){var _0x4f2a8d=events[_0x2d8c2b];var _0x2a6dfc=createListener(_0xff24('0x4')+_0x4f2a8d,_0x32b089);UserProfileEvents['on'](_0x4f2a8d,_0x2a6dfc);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 93c6fe8..d58cbec 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6707=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get'];(function(_0x147c53,_0x2a4a43){var _0x4d2012=function(_0x397ec6){while(--_0x397ec6){_0x147c53['push'](_0x147c53['shift']());}};_0x4d2012(++_0x2a4a43);}(_0x6707,0x165));var _0x7670=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x6707[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require(_0x7670('0x0'));var util=require('util');var path=require(_0x7670('0x1'));var timeout=require(_0x7670('0x2'));var express=require(_0x7670('0x3'));var router=express[_0x7670('0x4')]();var fs_extra=require(_0x7670('0x5'));var auth=require(_0x7670('0x6'));var interaction=require(_0x7670('0x7'));var config=require(_0x7670('0x8'));var controller=require(_0x7670('0x9'));router[_0x7670('0xa')]('/',auth[_0x7670('0xb')](),controller[_0x7670('0xc')]);router['get'](_0x7670('0xd'),auth[_0x7670('0xb')](),controller[_0x7670('0xe')]);router[_0x7670('0xa')](_0x7670('0xf'),auth['isAuthenticated'](),controller[_0x7670('0x10')]);router[_0x7670('0x11')]('/',auth['isAuthenticated'](),controller[_0x7670('0x12')]);router[_0x7670('0x13')](_0x7670('0xf'),auth[_0x7670('0xb')](),controller['update']);router[_0x7670('0x14')](_0x7670('0xf'),auth[_0x7670('0xb')](),controller[_0x7670('0x15')]);module[_0x7670('0x16')]=router; \ No newline at end of file +var _0xf7c7=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','/describe','isAuthenticated','describe','get','/:id','create','update','delete','destroy','exports','multer'];(function(_0x28a534,_0x52af08){var _0x4e24c5=function(_0x5307d5){while(--_0x5307d5){_0x28a534['push'](_0x28a534['shift']());}};_0x4e24c5(++_0x52af08);}(_0xf7c7,0x7d));var _0x7f7c=function(_0xa6c407,_0x178882){_0xa6c407=_0xa6c407-0x0;var _0x5c5753=_0xf7c7[_0xa6c407];return _0x5c5753;};'use strict';var multer=require(_0x7f7c('0x0'));var util=require('util');var path=require(_0x7f7c('0x1'));var timeout=require(_0x7f7c('0x2'));var express=require(_0x7f7c('0x3'));var router=express['Router']();var fs_extra=require(_0x7f7c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7f7c('0x5'));var config=require(_0x7f7c('0x6'));var controller=require(_0x7f7c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7f7c('0x8'),auth[_0x7f7c('0x9')](),controller[_0x7f7c('0xa')]);router[_0x7f7c('0xb')](_0x7f7c('0xc'),auth[_0x7f7c('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7f7c('0xd')]);router['put'](_0x7f7c('0xc'),auth[_0x7f7c('0x9')](),controller[_0x7f7c('0xe')]);router[_0x7f7c('0xf')](_0x7f7c('0xc'),auth[_0x7f7c('0x9')](),controller[_0x7f7c('0x10')]);module[_0x7f7c('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 89ee85b..180243a 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c38=['INTEGER','exports','STRING'];(function(_0x361c81,_0x15fa34){var _0x185866=function(_0x3607d5){while(--_0x3607d5){_0x361c81['push'](_0x361c81['shift']());}};_0x185866(++_0x15fa34);}(_0x8c38,0x8b));var _0x88c3=function(_0x44e91a,_0xfac909){_0x44e91a=_0x44e91a-0x0;var _0x3aad4d=_0x8c38[_0x44e91a];return _0x3aad4d;};'use strict';var Sequelize=require('sequelize');module[_0x88c3('0x0')]={'name':{'type':Sequelize[_0x88c3('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x88c3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x88c3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x84fc=['exports','STRING'];(function(_0x3fd152,_0x42ddaf){var _0xcfc148=function(_0xc6c072){while(--_0xc6c072){_0x3fd152['push'](_0x3fd152['shift']());}};_0xcfc148(++_0x42ddaf);}(_0x84fc,0x18a));var _0xc84f=function(_0x5316d3,_0x5cba98){_0x5316d3=_0x5316d3-0x0;var _0x27d9fa=_0x84fc[_0x5316d3];return _0x27d9fa;};'use strict';var Sequelize=require('sequelize');module[_0xc84f('0x0')]={'name':{'type':Sequelize[_0xc84f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xc84f('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index b0ec37b..96ab8a6 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file +var _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','UserProfileResource','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(_0xe98589,_0x1b3c02){var _0x496299=function(_0x887dcb){while(--_0x887dcb){_0xe98589['push'](_0xe98589['shift']());}};_0x496299(++_0x1b3c02);}(_0x2542,0x169));var _0x2254=function(_0x27c2b0,_0x38833){_0x27c2b0=_0x27c2b0-0x0;var _0x50817c=_0x2542[_0x27c2b0];return _0x50817c;};'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['UserProfileResource'][_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 diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index deb520d..7c4f877 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4deb=['moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api'];(function(_0xbb6de5,_0x34d871){var _0x5642dd=function(_0x3e484d){while(--_0x3e484d){_0xbb6de5['push'](_0xbb6de5['shift']());}};_0x5642dd(++_0x34d871);}(_0x4deb,0x8c));var _0xb4de=function(_0x5e80a1,_0x5558fa){_0x5e80a1=_0x5e80a1-0x0;var _0x2290fc=_0x4deb[_0x5e80a1];return _0x2290fc;};'use strict';var _=require(_0xb4de('0x0'));var util=require(_0xb4de('0x1'));var logger=require(_0xb4de('0x2'))(_0xb4de('0x3'));var moment=require(_0xb4de('0x4'));var BPromise=require(_0xb4de('0x5'));var rp=require(_0xb4de('0x6'));var fs=require('fs');var path=require(_0xb4de('0x7'));var rimraf=require('rimraf');var config=require(_0xb4de('0x8'));var attributes=require(_0xb4de('0x9'));module[_0xb4de('0xa')]=function(_0x4f0027,_0x4ee009){return _0x4f0027[_0xb4de('0xb')](_0xb4de('0xc'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xb4de('0xd'),'fields':[_0xb4de('0xe'),_0xb4de('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde04=['user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','moment','request-promise','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xde04,0xe0));var _0x4de0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde04[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4de0('0x0'));var util=require(_0x4de0('0x1'));var logger=require(_0x4de0('0x2'))('api');var moment=require(_0x4de0('0x3'));var BPromise=require('bluebird');var rp=require(_0x4de0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4de0('0x5'));var config=require('../../config/environment');var attributes=require(_0x4de0('0x6'));module[_0x4de0('0x7')]=function(_0x464a80,_0x561f9a){return _0x464a80[_0x4de0('0x8')](_0x4de0('0x9'),attributes,{'tableName':_0x4de0('0xa'),'paranoid':![],'indexes':[{'name':_0x4de0('0xb'),'fields':[_0x4de0('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 118e9ed..1dd2b06 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e5e=['result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x5e5e,0x10a));var _0xe5e5=function(_0x56a7a3,_0x49cbc1){_0x56a7a3=_0x56a7a3-0x0;var _0xd1dd22=_0x5e5e[_0x56a7a3];return _0xd1dd22;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe5e5('0x0'));var rs=require(_0xe5e5('0x1'));var fs=require('fs');var Redis=require(_0xe5e5('0x2'));var db=require(_0xe5e5('0x3'))['db'];var utils=require(_0xe5e5('0x4'));var logger=require(_0xe5e5('0x5'))(_0xe5e5('0x6'));var config=require('../../config/environment');var jayson=require(_0xe5e5('0x7'));var client=jayson[_0xe5e5('0x8')][_0xe5e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x93a532,_0x3fef99,_0x59e6a4){return new BPromise(function(_0x47d538,_0xafc6b6){return client[_0xe5e5('0xa')](_0x93a532,_0x59e6a4)[_0xe5e5('0xb')](function(_0x393900){logger[_0xe5e5('0xc')](_0xe5e5('0xd'),_0x3fef99,_0xe5e5('0xe'));logger[_0xe5e5('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3fef99,_0xe5e5('0xe'),JSON[_0xe5e5('0x10')](_0x393900));if(_0x393900[_0xe5e5('0x11')]){if(_0x393900[_0xe5e5('0x11')][_0xe5e5('0x12')]===0x1f4){logger[_0xe5e5('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3fef99,_0x393900[_0xe5e5('0x11')]['message']);return _0xafc6b6(_0x393900[_0xe5e5('0x11')][_0xe5e5('0x13')]);}logger['error'](_0xe5e5('0xd'),_0x3fef99,_0x393900[_0xe5e5('0x11')]['message']);return _0x47d538(_0x393900['error'][_0xe5e5('0x13')]);}else{logger[_0xe5e5('0xc')](_0xe5e5('0xd'),_0x3fef99,_0xe5e5('0xe'));_0x47d538(_0x393900[_0xe5e5('0x14')][_0xe5e5('0x13')]);}})[_0xe5e5('0x15')](function(_0xdc9fb3){logger['error'](_0xe5e5('0xd'),_0x3fef99,_0xdc9fb3);_0xafc6b6(_0xdc9fb3);});});} \ No newline at end of file +var _0xb055=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x12382f,_0x81f0dd){var _0x5e4733=function(_0x54b1cf){while(--_0x54b1cf){_0x12382f['push'](_0x12382f['shift']());}};_0x5e4733(++_0x81f0dd);}(_0xb055,0x18b));var _0x5b05=function(_0x14d5f9,_0x391035){_0x14d5f9=_0x14d5f9-0x0;var _0x8dbbef=_0xb055[_0x14d5f9];return _0x8dbbef;};'use strict';var _=require(_0x5b05('0x0'));var util=require(_0x5b05('0x1'));var moment=require(_0x5b05('0x2'));var BPromise=require(_0x5b05('0x3'));var rs=require(_0x5b05('0x4'));var fs=require('fs');var Redis=require(_0x5b05('0x5'));var db=require(_0x5b05('0x6'))['db'];var utils=require(_0x5b05('0x7'));var logger=require(_0x5b05('0x8'))('rpc');var config=require(_0x5b05('0x9'));var jayson=require(_0x5b05('0xa'));var client=jayson[_0x5b05('0xb')][_0x5b05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26f58a,_0x1341d6,_0xfe2bbd){return new BPromise(function(_0x1f8402,_0x1879c0){return client['request'](_0x26f58a,_0xfe2bbd)[_0x5b05('0xd')](function(_0x167669){logger[_0x5b05('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x1341d6,_0x5b05('0xf'));logger[_0x5b05('0x10')](_0x5b05('0x11'),_0x1341d6,_0x5b05('0xf'),JSON[_0x5b05('0x12')](_0x167669));if(_0x167669[_0x5b05('0x13')]){if(_0x167669['error'][_0x5b05('0x14')]===0x1f4){logger['error'](_0x5b05('0x15'),_0x1341d6,_0x167669[_0x5b05('0x13')]['message']);return _0x1879c0(_0x167669[_0x5b05('0x13')][_0x5b05('0x16')]);}logger[_0x5b05('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1341d6,_0x167669[_0x5b05('0x13')][_0x5b05('0x16')]);return _0x1f8402(_0x167669[_0x5b05('0x13')]['message']);}else{logger[_0x5b05('0xe')](_0x5b05('0x15'),_0x1341d6,_0x5b05('0xf'));_0x1f8402(_0x167669[_0x5b05('0x17')]['message']);}})[_0x5b05('0x18')](function(_0x16e837){logger[_0x5b05('0x13')](_0x5b05('0x15'),_0x1341d6,_0x16e837);_0x1879c0(_0x16e837);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3e57cf8..bbb0300 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd45d=['update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','index','isAuthenticated','describe','/:id','show','post','put'];(function(_0x3f517d,_0x57fb5b){var _0xa50a5=function(_0x476b3a){while(--_0x476b3a){_0x3f517d['push'](_0x3f517d['shift']());}};_0xa50a5(++_0x57fb5b);}(_0xd45d,0x17c));var _0xdd45=function(_0x15e2fb,_0x341089){_0x15e2fb=_0x15e2fb-0x0;var _0x393205=_0xd45d[_0x15e2fb];return _0x393205;};'use strict';var multer=require('multer');var util=require(_0xdd45('0x0'));var path=require(_0xdd45('0x1'));var timeout=require(_0xdd45('0x2'));var express=require('express');var router=express[_0xdd45('0x3')]();var fs_extra=require(_0xdd45('0x4'));var auth=require(_0xdd45('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdd45('0x6'));var controller=require(_0xdd45('0x7'));router[_0xdd45('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd45('0x9')]);router[_0xdd45('0x8')]('/describe',auth[_0xdd45('0xa')](),controller[_0xdd45('0xb')]);router['get'](_0xdd45('0xc'),auth[_0xdd45('0xa')](),controller[_0xdd45('0xd')]);router[_0xdd45('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd45('0xf')](_0xdd45('0xc'),auth['isAuthenticated'](),controller[_0xdd45('0x10')]);router['delete'](_0xdd45('0xc'),auth[_0xdd45('0xa')](),controller['destroy']);module[_0xdd45('0x11')]=router; \ No newline at end of file +var _0x6ddb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','path'];(function(_0x5afd24,_0x165b99){var _0x2bc0b6=function(_0xcc8d55){while(--_0xcc8d55){_0x5afd24['push'](_0x5afd24['shift']());}};_0x2bc0b6(++_0x165b99);}(_0x6ddb,0x155));var _0xb6dd=function(_0x4c0f69,_0x448095){_0x4c0f69=_0x4c0f69-0x0;var _0x5e6765=_0x6ddb[_0x4c0f69];return _0x5e6765;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb6dd('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb6dd('0x1')]();var fs_extra=require(_0xb6dd('0x2'));var auth=require(_0xb6dd('0x3'));var interaction=require(_0xb6dd('0x4'));var config=require(_0xb6dd('0x5'));var controller=require(_0xb6dd('0x6'));router[_0xb6dd('0x7')]('/',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x9')]);router[_0xb6dd('0x7')]('/describe',auth[_0xb6dd('0x8')](),controller['describe']);router[_0xb6dd('0x7')]('/:id',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xa')]);router[_0xb6dd('0xb')]('/',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xc')]);router[_0xb6dd('0xd')](_0xb6dd('0xe'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xf')]);router['delete'](_0xb6dd('0xe'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x10')]);module[_0xb6dd('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index cb1cd07..d98d302 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb03e=['setDataValue','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER','BOOLEAN'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0xb03e,0x1eb));var _0xeb03=function(_0x1dd91c,_0x13f2e1){_0x1dd91c=_0x1dd91c-0x0;var _0x433fb8=_0xb03e[_0x1dd91c];return _0x433fb8;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'name':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xeb03('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb03('0x1')],'set':function(_0x1fe650){this[_0xeb03('0x4')](_0xeb03('0x5'),_0x1fe650?_0x1fe650[_0xeb03('0x6')](''):[]);},'get':function(){return this[_0xeb03('0x7')]('crudPermissions')?this[_0xeb03('0x7')](_0xeb03('0x5'))[_0xeb03('0x8')](''):[];}}}; \ No newline at end of file +var _0x0713=['getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x2545e5,_0x430b52){var _0x353ced=function(_0x3f22d2){while(--_0x3f22d2){_0x2545e5['push'](_0x2545e5['shift']());}};_0x353ced(++_0x430b52);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x3071('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3071('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3071('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2c547f){this[_0x3071('0x3')](_0x3071('0x4'),_0x2c547f?_0x2c547f[_0x3071('0x5')](''):[]);},'get':function(){return this[_0x3071('0x6')](_0x3071('0x4'))?this[_0x3071('0x6')](_0x3071('0x4'))[_0x3071('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index b384f44..0c3aacc 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0782=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','stack','name','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','catch','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch'];(function(_0xe6df9d,_0x8fad94){var _0x29ffad=function(_0xba933c){while(--_0xba933c){_0xe6df9d['push'](_0xe6df9d['shift']());}};_0x29ffad(++_0x8fad94);}(_0x0782,0x1b3));var _0x2078=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x0782[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0x2078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2078('0x1'));var jsonpatch=require(_0x2078('0x2'));var rp=require(_0x2078('0x3'));var moment=require(_0x2078('0x4'));var BPromise=require(_0x2078('0x5'));var Mustache=require(_0x2078('0x6'));var util=require(_0x2078('0x7'));var path=require(_0x2078('0x8'));var sox=require('sox');var csv=require(_0x2078('0x9'));var ejs=require(_0x2078('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2078('0xb'));var squel=require(_0x2078('0xc'));var crypto=require('crypto');var jsforce=require(_0x2078('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2078('0x9'));var querystring=require(_0x2078('0xe'));var Papa=require(_0x2078('0xf'));var Redis=require(_0x2078('0x10'));var authService=require(_0x2078('0x11'));var qs=require(_0x2078('0x12'));var as=require(_0x2078('0x13'));var hardwareService=require(_0x2078('0x14'));var logger=require(_0x2078('0x15'))(_0x2078('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2078('0x17'));var db=require(_0x2078('0x18'))['db'];function respondWithStatusCode(_0x928162,_0x240208){_0x240208=_0x240208||0xcc;return function(_0x50d341){if(_0x50d341){return _0x928162[_0x2078('0x19')](_0x240208);}return _0x928162['status'](_0x240208)[_0x2078('0x1a')]();};}function respondWithResult(_0x11ec93,_0x3ccc30){_0x3ccc30=_0x3ccc30||0xc8;return function(_0x2aafcc){if(_0x2aafcc){return _0x11ec93[_0x2078('0x1b')](_0x3ccc30)[_0x2078('0x1c')](_0x2aafcc);}};}function respondWithFilteredResult(_0x445c70,_0x441da9){return function(_0x18c074){if(_0x18c074){var _0x508ec2=typeof _0x441da9[_0x2078('0x1d')]===_0x2078('0x1e')&&typeof _0x441da9['limit']===_0x2078('0x1e');var _0x44ff8e=_0x18c074['count'];var _0x40b596=_0x508ec2?0x0:_0x441da9[_0x2078('0x1d')];var _0x5202f8=_0x508ec2?_0x18c074['count']:_0x441da9[_0x2078('0x1d')]+_0x441da9[_0x2078('0x1f')];var _0x2274fa;if(_0x5202f8>=_0x44ff8e){_0x5202f8=_0x44ff8e;_0x2274fa=0xc8;}else{_0x2274fa=0xce;}_0x445c70[_0x2078('0x1b')](_0x2274fa);return _0x445c70['set'](_0x2078('0x20'),_0x40b596+'-'+_0x5202f8+'/'+_0x44ff8e)[_0x2078('0x1c')](_0x18c074);}return null;};}function patchUpdates(_0x1a8e16){return function(_0x405240){try{jsonpatch[_0x2078('0x21')](_0x405240,_0x1a8e16,!![]);}catch(_0x1bae7a){return BPromise[_0x2078('0x22')](_0x1bae7a);}return _0x405240[_0x2078('0x23')]();};}function saveUpdates(_0x8bce75,_0x1b4892){return function(_0x1eab5d){if(_0x1eab5d){return _0x1eab5d[_0x2078('0x24')](_0x8bce75)[_0x2078('0x25')](function(_0x3a1684){return _0x3a1684;});}return null;};}function removeEntity(_0x2e3440,_0x18be2e){return function(_0x29d90f){if(_0x29d90f){return _0x29d90f['destroy']()[_0x2078('0x25')](function(){_0x2e3440['status'](0xcc)[_0x2078('0x1a')]();});}};}function handleEntityNotFound(_0x1b4662,_0x5ddbd9){return function(_0x5ce973){if(!_0x5ce973){_0x1b4662[_0x2078('0x19')](0x194);}return _0x5ce973;};}function handleError(_0x1318db,_0x449005){_0x449005=_0x449005||0x1f4;return function(_0xd74734){logger[_0x2078('0x26')](_0xd74734[_0x2078('0x27')]);if(_0xd74734[_0x2078('0x28')]){delete _0xd74734['name'];}_0x1318db[_0x2078('0x1b')](_0x449005)['send'](_0xd74734);};}exports['index']=function(_0x56951d,_0x285476){var _0x1cedba={},_0x15517c={},_0x4b3044={'count':0x0,'rows':[]};var _0x34a071=_[_0x2078('0x29')](db[_0x2078('0x2a')][_0x2078('0x2b')],function(_0x50b8eb){return{'name':_0x50b8eb['fieldName'],'type':_0x50b8eb[_0x2078('0x2c')][_0x2078('0x2d')]};});_0x15517c[_0x2078('0x2e')]=_[_0x2078('0x29')](_0x34a071,_0x2078('0x28'));_0x15517c[_0x2078('0x2f')]=_[_0x2078('0x30')](_0x56951d['query']);_0x15517c[_0x2078('0x31')]=_[_0x2078('0x32')](_0x15517c[_0x2078('0x2e')],_0x15517c[_0x2078('0x2f')]);_0x1cedba[_0x2078('0x33')]=_[_0x2078('0x32')](_0x15517c[_0x2078('0x2e')],qs['fields'](_0x56951d[_0x2078('0x2f')][_0x2078('0x34')]));_0x1cedba[_0x2078('0x33')]=_0x1cedba[_0x2078('0x33')]['length']?_0x1cedba[_0x2078('0x33')]:_0x15517c[_0x2078('0x2e')];if(!_0x56951d[_0x2078('0x2f')][_0x2078('0x35')](_0x2078('0x36'))){_0x1cedba['limit']=qs['limit'](_0x56951d[_0x2078('0x2f')][_0x2078('0x1f')]);_0x1cedba[_0x2078('0x1d')]=qs['offset'](_0x56951d[_0x2078('0x2f')][_0x2078('0x1d')]);}_0x1cedba[_0x2078('0x37')]=qs['sort'](_0x56951d['query']['sort']);_0x1cedba[_0x2078('0x38')]=qs[_0x2078('0x31')](_[_0x2078('0x39')](_0x56951d['query'],_0x15517c['filters']),_0x34a071);if(_0x56951d[_0x2078('0x2f')]['filter']){_0x1cedba[_0x2078('0x38')]=_[_0x2078('0x3a')](_0x1cedba[_0x2078('0x38')],{'$or':_[_0x2078('0x29')](_0x34a071,function(_0x374027){if(_0x374027[_0x2078('0x2c')]!==_0x2078('0x3b')){var _0x2691fb={};_0x2691fb[_0x374027['name']]={'$like':'%'+_0x56951d[_0x2078('0x2f')][_0x2078('0x3c')]+'%'};return _0x2691fb;}})});}_0x1cedba=_['merge']({},_0x1cedba,_0x56951d[_0x2078('0x3d')]);var _0x17f4dc={'where':_0x1cedba['where']};return db[_0x2078('0x2a')][_0x2078('0x3e')](_0x17f4dc)[_0x2078('0x25')](function(_0x11b463){_0x4b3044[_0x2078('0x3e')]=_0x11b463;if(_0x56951d['query']['includeAll']){_0x1cedba[_0x2078('0x3f')]=[{'all':!![]}];}return db[_0x2078('0x2a')][_0x2078('0x40')](_0x1cedba);})['then'](function(_0x1b3ecf){_0x4b3044['rows']=_0x1b3ecf;return _0x4b3044;})[_0x2078('0x25')](respondWithFilteredResult(_0x285476,_0x1cedba))[_0x2078('0x41')](handleError(_0x285476,null));};exports['show']=function(_0x5a4bd7,_0x17b22b){var _0x4312d0={'raw':![],'where':{'id':_0x5a4bd7[_0x2078('0x42')]['id']}},_0x2773d2={};_0x2773d2[_0x2078('0x2e')]=_[_0x2078('0x30')](db['UserProfileSection'][_0x2078('0x2b')]);_0x2773d2[_0x2078('0x2f')]=_['keys'](_0x5a4bd7[_0x2078('0x2f')]);_0x2773d2[_0x2078('0x31')]=_[_0x2078('0x32')](_0x2773d2[_0x2078('0x2e')],_0x2773d2['query']);_0x4312d0[_0x2078('0x33')]=_[_0x2078('0x32')](_0x2773d2[_0x2078('0x2e')],qs[_0x2078('0x34')](_0x5a4bd7[_0x2078('0x2f')]['fields']));_0x4312d0[_0x2078('0x33')]=_0x4312d0[_0x2078('0x33')]['length']?_0x4312d0[_0x2078('0x33')]:_0x2773d2['model'];if(_0x5a4bd7['query'][_0x2078('0x43')]){_0x4312d0[_0x2078('0x3f')]=[{'all':!![]}];}_0x4312d0=_[_0x2078('0x3a')]({},_0x4312d0,_0x5a4bd7['options']);return db[_0x2078('0x2a')][_0x2078('0x44')](_0x4312d0)[_0x2078('0x25')](handleEntityNotFound(_0x17b22b,null))[_0x2078('0x25')](respondWithResult(_0x17b22b,null))[_0x2078('0x41')](handleError(_0x17b22b,null));};exports[_0x2078('0x45')]=function(_0x1986e8,_0x2536da){return db['UserProfileSection']['create'](_0x1986e8['body'],{})[_0x2078('0x25')](respondWithResult(_0x2536da,0xc9))[_0x2078('0x41')](handleError(_0x2536da,null));};exports[_0x2078('0x24')]=function(_0x322acd,_0xd086fb){if(_0x322acd[_0x2078('0x46')]['id']){delete _0x322acd[_0x2078('0x46')]['id'];}return db[_0x2078('0x2a')][_0x2078('0x44')]({'where':{'id':_0x322acd[_0x2078('0x42')]['id']}})[_0x2078('0x25')](handleEntityNotFound(_0xd086fb,null))[_0x2078('0x25')](saveUpdates(_0x322acd[_0x2078('0x46')],null))[_0x2078('0x25')](respondWithResult(_0xd086fb,null))['catch'](handleError(_0xd086fb,null));};exports[_0x2078('0x47')]=function(_0x12eefd,_0x50a8e5){return db[_0x2078('0x2a')][_0x2078('0x44')]({'where':{'id':_0x12eefd[_0x2078('0x42')]['id']}})[_0x2078('0x25')](handleEntityNotFound(_0x50a8e5,null))[_0x2078('0x25')](removeEntity(_0x50a8e5,null))[_0x2078('0x41')](handleError(_0x50a8e5,null));};exports[_0x2078('0x48')]=function(_0x2b7b9d,_0xfc4181){return db[_0x2078('0x2a')][_0x2078('0x48')]()[_0x2078('0x25')](respondWithResult(_0xfc4181,null))[_0x2078('0x41')](handleError(_0xfc4181,null));}; \ No newline at end of file +var _0x6914=['sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','send','index','map','UserProfileSection','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6914,0x154));var _0x4691=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6914[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x4691('0x0'));var rimraf=require(_0x4691('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4691('0x2'));var moment=require(_0x4691('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4691('0x4'));var util=require(_0x4691('0x5'));var path=require(_0x4691('0x6'));var sox=require(_0x4691('0x7'));var csv=require(_0x4691('0x8'));var ejs=require(_0x4691('0x9'));var fs=require('fs');var fs_extra=require(_0x4691('0xa'));var _=require(_0x4691('0xb'));var squel=require(_0x4691('0xc'));var crypto=require(_0x4691('0xd'));var jsforce=require(_0x4691('0xe'));var deskjs=require(_0x4691('0xf'));var toCsv=require(_0x4691('0x8'));var querystring=require(_0x4691('0x10'));var Papa=require(_0x4691('0x11'));var Redis=require(_0x4691('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4691('0x13'));var hardwareService=require(_0x4691('0x14'));var logger=require('../../config/logger')(_0x4691('0x15'));var utils=require(_0x4691('0x16'));var config=require(_0x4691('0x17'));var licenseUtil=require(_0x4691('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x469cef,_0x1af0d2){_0x1af0d2=_0x1af0d2||0xcc;return function(_0x4a1be1){if(_0x4a1be1){return _0x469cef[_0x4691('0x19')](_0x1af0d2);}return _0x469cef['status'](_0x1af0d2)['end']();};}function respondWithResult(_0x49e6e0,_0x1a7e0d){_0x1a7e0d=_0x1a7e0d||0xc8;return function(_0x29b622){if(_0x29b622){return _0x49e6e0[_0x4691('0x1a')](_0x1a7e0d)[_0x4691('0x1b')](_0x29b622);}};}function respondWithFilteredResult(_0x4ee1cf,_0x395250){return function(_0x1c49cb){if(_0x1c49cb){var _0x252979=typeof _0x395250[_0x4691('0x1c')]===_0x4691('0x1d')&&typeof _0x395250[_0x4691('0x1e')]==='undefined';var _0x3364c9=_0x1c49cb[_0x4691('0x1f')];var _0x448d71=_0x252979?0x0:_0x395250[_0x4691('0x1c')];var _0x181f1d=_0x252979?_0x1c49cb['count']:_0x395250[_0x4691('0x1c')]+_0x395250[_0x4691('0x1e')];var _0x305734;if(_0x181f1d>=_0x3364c9){_0x181f1d=_0x3364c9;_0x305734=0xc8;}else{_0x305734=0xce;}_0x4ee1cf[_0x4691('0x1a')](_0x305734);return _0x4ee1cf[_0x4691('0x20')]('Content-Range',_0x448d71+'-'+_0x181f1d+'/'+_0x3364c9)['json'](_0x1c49cb);}return null;};}function patchUpdates(_0x50ac1c){return function(_0x2732cf){try{jsonpatch[_0x4691('0x21')](_0x2732cf,_0x50ac1c,!![]);}catch(_0x16bd71){return BPromise['reject'](_0x16bd71);}return _0x2732cf[_0x4691('0x22')]();};}function saveUpdates(_0x35a53b,_0x24b22c){return function(_0x4e5073){if(_0x4e5073){return _0x4e5073[_0x4691('0x23')](_0x35a53b)['then'](function(_0x2c4412){return _0x2c4412;});}return null;};}function removeEntity(_0x2456f1,_0x436560){return function(_0x357b0c){if(_0x357b0c){return _0x357b0c['destroy']()[_0x4691('0x24')](function(){_0x2456f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3848f5,_0x26f528){return function(_0x142036){if(!_0x142036){_0x3848f5[_0x4691('0x19')](0x194);}return _0x142036;};}function handleError(_0x13eb22,_0x12d924){_0x12d924=_0x12d924||0x1f4;return function(_0x5b5ae8){logger[_0x4691('0x25')](_0x5b5ae8['stack']);if(_0x5b5ae8['name']){delete _0x5b5ae8[_0x4691('0x26')];}_0x13eb22[_0x4691('0x1a')](_0x12d924)[_0x4691('0x27')](_0x5b5ae8);};}exports[_0x4691('0x28')]=function(_0x14e148,_0x44ec5a){var _0x1e46ad={},_0x565200={},_0x41f331={'count':0x0,'rows':[]};var _0x4a0f36=_[_0x4691('0x29')](db[_0x4691('0x2a')][_0x4691('0x2b')],function(_0x30e128){return{'name':_0x30e128['fieldName'],'type':_0x30e128['type'][_0x4691('0x2c')]};});_0x565200['model']=_['map'](_0x4a0f36,_0x4691('0x26'));_0x565200[_0x4691('0x2d')]=_['keys'](_0x14e148[_0x4691('0x2d')]);_0x565200[_0x4691('0x2e')]=_[_0x4691('0x2f')](_0x565200['model'],_0x565200[_0x4691('0x2d')]);_0x1e46ad['attributes']=_[_0x4691('0x2f')](_0x565200[_0x4691('0x30')],qs[_0x4691('0x31')](_0x14e148[_0x4691('0x2d')]['fields']));_0x1e46ad[_0x4691('0x32')]=_0x1e46ad[_0x4691('0x32')][_0x4691('0x33')]?_0x1e46ad[_0x4691('0x32')]:_0x565200[_0x4691('0x30')];if(!_0x14e148[_0x4691('0x2d')][_0x4691('0x34')](_0x4691('0x35'))){_0x1e46ad[_0x4691('0x1e')]=qs['limit'](_0x14e148[_0x4691('0x2d')][_0x4691('0x1e')]);_0x1e46ad[_0x4691('0x1c')]=qs[_0x4691('0x1c')](_0x14e148[_0x4691('0x2d')]['offset']);}_0x1e46ad['order']=qs[_0x4691('0x36')](_0x14e148[_0x4691('0x2d')][_0x4691('0x36')]);_0x1e46ad[_0x4691('0x37')]=qs['filters'](_[_0x4691('0x38')](_0x14e148[_0x4691('0x2d')],_0x565200[_0x4691('0x2e')]),_0x4a0f36);if(_0x14e148['query']['filter']){_0x1e46ad['where']=_[_0x4691('0x39')](_0x1e46ad['where'],{'$or':_[_0x4691('0x29')](_0x4a0f36,function(_0x358b4c){if(_0x358b4c[_0x4691('0x3a')]!=='VIRTUAL'){var _0x2b2e11={};_0x2b2e11[_0x358b4c[_0x4691('0x26')]]={'$like':'%'+_0x14e148[_0x4691('0x2d')][_0x4691('0x3b')]+'%'};return _0x2b2e11;}})});}_0x1e46ad=_[_0x4691('0x39')]({},_0x1e46ad,_0x14e148[_0x4691('0x3c')]);var _0x14acc1={'where':_0x1e46ad[_0x4691('0x37')]};return db[_0x4691('0x2a')][_0x4691('0x1f')](_0x14acc1)[_0x4691('0x24')](function(_0x3faacd){_0x41f331['count']=_0x3faacd;if(_0x14e148['query'][_0x4691('0x3d')]){_0x1e46ad['include']=[{'all':!![]}];}return db[_0x4691('0x2a')][_0x4691('0x3e')](_0x1e46ad);})['then'](function(_0x59eb8c){_0x41f331[_0x4691('0x3f')]=_0x59eb8c;return _0x41f331;})[_0x4691('0x24')](respondWithFilteredResult(_0x44ec5a,_0x1e46ad))[_0x4691('0x40')](handleError(_0x44ec5a,null));};exports[_0x4691('0x41')]=function(_0x406eaa,_0xdb2097){var _0x146d90={'raw':![],'where':{'id':_0x406eaa['params']['id']}},_0x25e63d={};_0x25e63d['model']=_['keys'](db[_0x4691('0x2a')][_0x4691('0x2b')]);_0x25e63d['query']=_[_0x4691('0x42')](_0x406eaa[_0x4691('0x2d')]);_0x25e63d['filters']=_[_0x4691('0x2f')](_0x25e63d[_0x4691('0x30')],_0x25e63d[_0x4691('0x2d')]);_0x146d90[_0x4691('0x32')]=_[_0x4691('0x2f')](_0x25e63d[_0x4691('0x30')],qs['fields'](_0x406eaa[_0x4691('0x2d')][_0x4691('0x31')]));_0x146d90[_0x4691('0x32')]=_0x146d90[_0x4691('0x32')]['length']?_0x146d90[_0x4691('0x32')]:_0x25e63d[_0x4691('0x30')];if(_0x406eaa[_0x4691('0x2d')][_0x4691('0x3d')]){_0x146d90['include']=[{'all':!![]}];}_0x146d90=_[_0x4691('0x39')]({},_0x146d90,_0x406eaa[_0x4691('0x3c')]);return db[_0x4691('0x2a')][_0x4691('0x43')](_0x146d90)['then'](handleEntityNotFound(_0xdb2097,null))[_0x4691('0x24')](respondWithResult(_0xdb2097,null))[_0x4691('0x40')](handleError(_0xdb2097,null));};exports[_0x4691('0x44')]=function(_0x3ab48b,_0x28c7fc){return db[_0x4691('0x2a')][_0x4691('0x44')](_0x3ab48b[_0x4691('0x45')],{})[_0x4691('0x24')](respondWithResult(_0x28c7fc,0xc9))[_0x4691('0x40')](handleError(_0x28c7fc,null));};exports['update']=function(_0x24873d,_0x3663ac){if(_0x24873d[_0x4691('0x45')]['id']){delete _0x24873d[_0x4691('0x45')]['id'];}return db[_0x4691('0x2a')][_0x4691('0x43')]({'where':{'id':_0x24873d[_0x4691('0x46')]['id']}})[_0x4691('0x24')](handleEntityNotFound(_0x3663ac,null))[_0x4691('0x24')](saveUpdates(_0x24873d['body'],null))['then'](respondWithResult(_0x3663ac,null))[_0x4691('0x40')](handleError(_0x3663ac,null));};exports[_0x4691('0x47')]=function(_0x5d8c06,_0x4eb7b1){return db[_0x4691('0x2a')][_0x4691('0x43')]({'where':{'id':_0x5d8c06[_0x4691('0x46')]['id']}})[_0x4691('0x24')](handleEntityNotFound(_0x4eb7b1,null))[_0x4691('0x24')](removeEntity(_0x4eb7b1,null))['catch'](handleError(_0x4eb7b1,null));};exports[_0x4691('0x48')]=function(_0xed2246,_0x1a8190){return db[_0x4691('0x2a')][_0x4691('0x48')]()[_0x4691('0x24')](respondWithResult(_0x1a8190,null))[_0x4691('0x40')](handleError(_0x1a8190,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c0d3404..26379a0 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4ab=['sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x4496cd,_0x112c71){var _0x33d882=function(_0x4e729d){while(--_0x4e729d){_0x4496cd['push'](_0x4496cd['shift']());}};_0x33d882(++_0x112c71);}(_0xb4ab,0x112));var _0xbb4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbb4a('0x0'));var util=require(_0xbb4a('0x1'));var logger=require(_0xbb4a('0x2'))(_0xbb4a('0x3'));var moment=require('moment');var BPromise=require(_0xbb4a('0x4'));var rp=require(_0xbb4a('0x5'));var fs=require('fs');var path=require(_0xbb4a('0x6'));var rimraf=require(_0xbb4a('0x7'));var config=require(_0xbb4a('0x8'));var attributes=require('./userProfileSection.attributes');module[_0xbb4a('0x9')]=function(_0x1de31c,_0x398bd4){return _0x1de31c[_0xbb4a('0xa')](_0xbb4a('0xb'),attributes,{'tableName':_0xbb4a('0xc'),'paranoid':![],'indexes':[{'name':_0xbb4a('0xd'),'fields':[_0xbb4a('0xe'),_0xbb4a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc405=['define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc405,0x1f2));var _0x5c40=function(_0x256c49,_0x53f00a){_0x256c49=_0x256c49-0x0;var _0x280282=_0xc405[_0x256c49];return _0x280282;};'use strict';var _=require(_0x5c40('0x0'));var util=require(_0x5c40('0x1'));var logger=require(_0x5c40('0x2'))(_0x5c40('0x3'));var moment=require(_0x5c40('0x4'));var BPromise=require(_0x5c40('0x5'));var rp=require(_0x5c40('0x6'));var fs=require('fs');var path=require(_0x5c40('0x7'));var rimraf=require(_0x5c40('0x8'));var config=require(_0x5c40('0x9'));var attributes=require(_0x5c40('0xa'));module[_0x5c40('0xb')]=function(_0x1cafd5,_0x59446b){return _0x1cafd5[_0x5c40('0xc')](_0x5c40('0xd'),attributes,{'tableName':_0x5c40('0xe'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5c40('0xf'),_0x5c40('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 4c1b82d..db46992 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ed3=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','debug'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x7ed3,0x1c0));var _0x37ed=function(_0x43f425,_0x1c52bf){_0x43f425=_0x43f425-0x0;var _0x39ac46=_0x7ed3[_0x43f425];return _0x39ac46;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37ed('0x0'));var BPromise=require(_0x37ed('0x1'));var rs=require(_0x37ed('0x2'));var fs=require('fs');var Redis=require(_0x37ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x37ed('0x4'));var jayson=require(_0x37ed('0x5'));var client=jayson[_0x37ed('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18bb2e,_0x401065,_0x5e2b58){return new BPromise(function(_0x25da0b,_0x56974c){return client[_0x37ed('0x7')](_0x18bb2e,_0x5e2b58)[_0x37ed('0x8')](function(_0x7abcc3){logger[_0x37ed('0x9')](_0x37ed('0xa'),_0x401065,'request\x20sent');logger[_0x37ed('0xb')](_0x37ed('0xc'),_0x401065,'request\x20sent',JSON[_0x37ed('0xd')](_0x7abcc3));if(_0x7abcc3[_0x37ed('0xe')]){if(_0x7abcc3[_0x37ed('0xe')][_0x37ed('0xf')]===0x1f4){logger[_0x37ed('0xe')](_0x37ed('0xa'),_0x401065,_0x7abcc3[_0x37ed('0xe')][_0x37ed('0x10')]);return _0x56974c(_0x7abcc3[_0x37ed('0xe')][_0x37ed('0x10')]);}logger['error'](_0x37ed('0xa'),_0x401065,_0x7abcc3[_0x37ed('0xe')][_0x37ed('0x10')]);return _0x25da0b(_0x7abcc3[_0x37ed('0xe')][_0x37ed('0x10')]);}else{logger[_0x37ed('0x9')](_0x37ed('0xa'),_0x401065,_0x37ed('0x11'));_0x25da0b(_0x7abcc3[_0x37ed('0x12')][_0x37ed('0x10')]);}})[_0x37ed('0x13')](function(_0x4b1e38){logger[_0x37ed('0xe')](_0x37ed('0xa'),_0x401065,_0x4b1e38);_0x56974c(_0x4b1e38);});});} \ No newline at end of file +var _0x0263=['error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0263,0x75));var _0x3026=function(_0x1a288,_0x5eb9c7){_0x1a288=_0x1a288-0x0;var _0x4e53d4=_0x0263[_0x1a288];return _0x4e53d4;};'use strict';var _=require('lodash');var util=require(_0x3026('0x0'));var moment=require(_0x3026('0x1'));var BPromise=require(_0x3026('0x2'));var rs=require(_0x3026('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3026('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3026('0x5'))(_0x3026('0x6'));var config=require(_0x3026('0x7'));var jayson=require(_0x3026('0x8'));var client=jayson['client'][_0x3026('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5651f5,_0x48ab0e,_0x2ae3d7){return new BPromise(function(_0x2528a7,_0x4f7ab4){return client[_0x3026('0xa')](_0x5651f5,_0x2ae3d7)['then'](function(_0x5b5a92){logger[_0x3026('0xb')](_0x3026('0xc'),_0x48ab0e,_0x3026('0xd'));logger['debug'](_0x3026('0xe'),_0x48ab0e,'request\x20sent',JSON[_0x3026('0xf')](_0x5b5a92));if(_0x5b5a92['error']){if(_0x5b5a92[_0x3026('0x10')]['code']===0x1f4){logger[_0x3026('0x10')](_0x3026('0xc'),_0x48ab0e,_0x5b5a92[_0x3026('0x10')][_0x3026('0x11')]);return _0x4f7ab4(_0x5b5a92[_0x3026('0x10')][_0x3026('0x11')]);}logger[_0x3026('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x48ab0e,_0x5b5a92[_0x3026('0x10')]['message']);return _0x2528a7(_0x5b5a92[_0x3026('0x10')][_0x3026('0x11')]);}else{logger[_0x3026('0xb')](_0x3026('0xc'),_0x48ab0e,_0x3026('0xd'));_0x2528a7(_0x5b5a92['result'][_0x3026('0x11')]);}})[_0x3026('0x12')](function(_0x20b5bf){logger['error'](_0x3026('0xc'),_0x48ab0e,_0x20b5bf);_0x4f7ab4(_0x20b5bf);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a20dcbf..c9ba8a2 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x140b6f,_0x17c890){var _0x3ad053=function(_0x59d4b8){while(--_0x59d4b8){_0x140b6f['push'](_0x140b6f['shift']());}};_0x3ad053(++_0x17c890);}(_0xe706,0xa3));var _0x6e70=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0xe706[_0x23f8c8];return _0x3dc718;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x10b306,_0xc16433){var _0x3852ee=function(_0x1160ab){while(--_0x1160ab){_0x10b306['push'](_0x10b306['shift']());}};_0x3852ee(++_0xc16433);}(_0xe706,0xa3));var _0x6e70=function(_0x235884,_0x1c4355){_0x235884=_0x235884-0x0;var _0x211158=_0xe706[_0x235884];return _0x211158;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 67e4bab..a3501b1 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3e1=['exports','INTEGER'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd3e1,0xa0));var _0x1d3e=function(_0x3034a9,_0x44e256){_0x3034a9=_0x3034a9-0x0;var _0x4d0cef=_0xd3e1[_0x3034a9];return _0x4d0cef;};'use strict';var Sequelize=require('sequelize');module[_0x1d3e('0x0')]={'penalty':{'type':Sequelize[_0x1d3e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x01c0=['INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01c0,0x105));var _0x001c=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x01c0[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x001c('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 733cf1e..8789346 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x199c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x199c,0x1d8));var _0xc199=function(_0x2359a0,_0x51ab9c){_0x2359a0=_0x2359a0-0x0;var _0x269f47=_0x199c[_0x2359a0];return _0x269f47;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc199('0x0'))(_0xc199('0x1'));var moment=require(_0xc199('0x2'));var BPromise=require(_0xc199('0x3'));var rp=require(_0xc199('0x4'));var fs=require('fs');var path=require(_0xc199('0x5'));var rimraf=require(_0xc199('0x6'));var config=require(_0xc199('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xc199('0x8')]=function(_0x2ff172,_0x499721){return _0x2ff172['define'](_0xc199('0x9'),attributes,{'tableName':_0xc199('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','UserSmsQueue','user_has_sms_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports'];(function(_0x548177,_0x32bfc5){var _0x431a7a=function(_0x1589ac){while(--_0x1589ac){_0x548177['push'](_0x548177['shift']());}};_0x431a7a(++_0x32bfc5);}(_0xacf4,0xe7));var _0x4acf=function(_0x50da1d,_0x1fa929){_0x50da1d=_0x50da1d-0x0;var _0x30cd08=_0xacf4[_0x50da1d];return _0x30cd08;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index a345606..ceb48a6 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x920e=['client','http','request','info','request\x20sent','debug','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x41b53d,_0x5467d3){var _0x1054e9=function(_0x1589f0){while(--_0x1589f0){_0x41b53d['push'](_0x41b53d['shift']());}};_0x1054e9(++_0x5467d3);}(_0x920e,0x121));var _0xe920=function(_0x132dfd,_0x1dfad9){_0x132dfd=_0x132dfd-0x0;var _0xb6926e=_0x920e[_0x132dfd];return _0xb6926e;};'use strict';var _=require(_0xe920('0x0'));var util=require(_0xe920('0x1'));var moment=require(_0xe920('0x2'));var BPromise=require(_0xe920('0x3'));var rs=require(_0xe920('0x4'));var fs=require('fs');var Redis=require(_0xe920('0x5'));var db=require(_0xe920('0x6'))['db'];var utils=require(_0xe920('0x7'));var logger=require('../../config/logger')(_0xe920('0x8'));var config=require('../../config/environment');var jayson=require(_0xe920('0x9'));var client=jayson[_0xe920('0xa')][_0xe920('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f1f49,_0x251230,_0x1108d7){return new BPromise(function(_0x1d3831,_0x3f6bcc){return client[_0xe920('0xc')](_0x2f1f49,_0x1108d7)['then'](function(_0x92c375){logger[_0xe920('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x251230,_0xe920('0xe'));logger[_0xe920('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x251230,_0xe920('0xe'),JSON[_0xe920('0x10')](_0x92c375));if(_0x92c375['error']){if(_0x92c375[_0xe920('0x11')][_0xe920('0x12')]===0x1f4){logger[_0xe920('0x11')](_0xe920('0x13'),_0x251230,_0x92c375[_0xe920('0x11')][_0xe920('0x14')]);return _0x3f6bcc(_0x92c375[_0xe920('0x11')]['message']);}logger[_0xe920('0x11')](_0xe920('0x13'),_0x251230,_0x92c375[_0xe920('0x11')][_0xe920('0x14')]);return _0x1d3831(_0x92c375['error']['message']);}else{logger[_0xe920('0xd')](_0xe920('0x13'),_0x251230,_0xe920('0xe'));_0x1d3831(_0x92c375[_0xe920('0x15')]['message']);}})[_0xe920('0x16')](function(_0x1f7961){logger[_0xe920('0x11')](_0xe920('0x13'),_0x251230,_0x1f7961);_0x3f6bcc(_0x1f7961);});});} \ No newline at end of file +var _0x6aef=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','UserSmsQueue,\x20%s,\x20%s','message'];(function(_0x5ca5b0,_0x8a4bee){var _0x3abdc0=function(_0x62e4ca){while(--_0x62e4ca){_0x5ca5b0['push'](_0x5ca5b0['shift']());}};_0x3abdc0(++_0x8a4bee);}(_0x6aef,0xdd));var _0xf6ae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6aef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf6ae('0x0'));var util=require(_0xf6ae('0x1'));var moment=require(_0xf6ae('0x2'));var BPromise=require(_0xf6ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6ae('0x4'))['db'];var utils=require(_0xf6ae('0x5'));var logger=require(_0xf6ae('0x6'))(_0xf6ae('0x7'));var config=require('../../config/environment');var jayson=require(_0xf6ae('0x8'));var client=jayson[_0xf6ae('0x9')][_0xf6ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d8503,_0x57b0f3,_0x52191b){return new BPromise(function(_0x161d8d,_0x333748){return client[_0xf6ae('0xb')](_0x5d8503,_0x52191b)[_0xf6ae('0xc')](function(_0x30028b){logger[_0xf6ae('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x57b0f3,_0xf6ae('0xe'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x57b0f3,_0xf6ae('0xe'),JSON[_0xf6ae('0xf')](_0x30028b));if(_0x30028b[_0xf6ae('0x10')]){if(_0x30028b[_0xf6ae('0x10')]['code']===0x1f4){logger['error'](_0xf6ae('0x11'),_0x57b0f3,_0x30028b[_0xf6ae('0x10')][_0xf6ae('0x12')]);return _0x333748(_0x30028b[_0xf6ae('0x10')][_0xf6ae('0x12')]);}logger[_0xf6ae('0x10')](_0xf6ae('0x11'),_0x57b0f3,_0x30028b[_0xf6ae('0x10')]['message']);return _0x161d8d(_0x30028b[_0xf6ae('0x10')][_0xf6ae('0x12')]);}else{logger[_0xf6ae('0xd')](_0xf6ae('0x11'),_0x57b0f3,_0xf6ae('0xe'));_0x161d8d(_0x30028b['result'][_0xf6ae('0x12')]);}})[_0xf6ae('0x13')](function(_0x3d98bb){logger[_0xf6ae('0x10')](_0xf6ae('0x11'),_0x57b0f3,_0x3d98bb);_0x333748(_0x3d98bb);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index d6c88e7..5ce591a 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3473=['sequelize','exports','INTEGER'];(function(_0x355141,_0x4ce3bd){var _0x328382=function(_0x44e03c){while(--_0x44e03c){_0x355141['push'](_0x355141['shift']());}};_0x328382(++_0x4ce3bd);}(_0x3473,0xb7));var _0x3347=function(_0x4a0b21,_0x1d310d){_0x4a0b21=_0x4a0b21-0x0;var _0xbc48b8=_0x3473[_0x4a0b21];return _0xbc48b8;};'use strict';var Sequelize=require(_0x3347('0x0'));module[_0x3347('0x1')]={'UserId':{'type':Sequelize[_0x3347('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x3347('0x2')]}}; \ No newline at end of file +var _0xccbd=['INTEGER','exports'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0xccbd,0x1db));var _0xdccb=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xccbd[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0xdccb('0x0')]={'UserId':{'type':Sequelize[_0xdccb('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 8a24128..4f2b349 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4750e8,_0x14111f){var _0x395452=function(_0x3ac3fd){while(--_0x3ac3fd){_0x4750e8['push'](_0x4750e8['shift']());}};_0x395452(++_0x14111f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0xb320a4,_0x14b8a3){var _0x3a7933=function(_0x472315){while(--_0x472315){_0xb320a4['push'](_0xb320a4['shift']());}};_0x3a7933(++_0x14b8a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 3d72185..b001cc6 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x54fc68,_0x4d6cd3){var _0x23d6d8=function(_0x4dcf30){while(--_0x4dcf30){_0x54fc68['push'](_0x54fc68['shift']());}};_0x23d6d8(++_0x4d6cd3);}(_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');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(_0x2cb4c2,_0xa294fa){var _0x45a313=function(_0x39bbb6){while(--_0x39bbb6){_0x2cb4c2['push'](_0x2cb4c2['shift']());}};_0x45a313(++_0xa294fa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0xcb91[_0x529f1c];return _0x4d57ab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ea3acf0..9499a2a 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35b5=['sequelize','exports','INTEGER'];(function(_0x3a1dda,_0x5c56d7){var _0x5ca3e1=function(_0x303fd9){while(--_0x303fd9){_0x3a1dda['push'](_0x3a1dda['shift']());}};_0x5ca3e1(++_0x5c56d7);}(_0x35b5,0x14a));var _0x535b=function(_0x9feaee,_0x1226bd){_0x9feaee=_0x9feaee-0x0;var _0x262bc7=_0x35b5[_0x9feaee];return _0x262bc7;};'use strict';var Sequelize=require(_0x535b('0x0'));module[_0x535b('0x1')]={'penalty':{'type':Sequelize[_0x535b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdf81=['exports','INTEGER'];(function(_0x379a70,_0x367de6){var _0x3ddaa4=function(_0x5a2582){while(--_0x5a2582){_0x379a70['push'](_0x379a70['shift']());}};_0x3ddaa4(++_0x367de6);}(_0xdf81,0x92));var _0x1df8=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xdf81[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require('sequelize');module[_0x1df8('0x0')]={'penalty':{'type':Sequelize[_0x1df8('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 95f4d1b..267002f 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x766d=['moment','bluebird','request-promise','path','rimraf','exports','define','UserVoiceQueue','util','../../config/logger','api'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x766d,0x126));var _0xd766=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x766d[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd766('0x0'));var logger=require(_0xd766('0x1'))(_0xd766('0x2'));var moment=require(_0xd766('0x3'));var BPromise=require(_0xd766('0x4'));var rp=require(_0xd766('0x5'));var fs=require('fs');var path=require(_0xd766('0x6'));var rimraf=require(_0xd766('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0xd766('0x8')]=function(_0x39004d,_0x51960c){return _0x39004d[_0xd766('0x9')](_0xd766('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf0c=['bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x70e299,_0x598c1b){var _0xb6c5b=function(_0x16545a){while(--_0x16545a){_0x70e299['push'](_0x70e299['shift']());}};_0xb6c5b(++_0x598c1b);}(_0xdf0c,0xb2));var _0xcdf0=function(_0x22de09,_0x3db597){_0x22de09=_0x22de09-0x0;var _0x4a13dc=_0xdf0c[_0x22de09];return _0x4a13dc;};'use strict';var _=require(_0xcdf0('0x0'));var util=require(_0xcdf0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcdf0('0x2'));var rp=require(_0xcdf0('0x3'));var fs=require('fs');var path=require(_0xcdf0('0x4'));var rimraf=require('rimraf');var config=require(_0xcdf0('0x5'));var attributes=require(_0xcdf0('0x6'));module['exports']=function(_0x4575dc,_0x3e89ae){return _0x4575dc[_0xcdf0('0x7')](_0xcdf0('0x8'),attributes,{'tableName':_0xcdf0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 785c905..9629a87 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d56=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x3aad,_0x1a8930){var _0xc1545f=function(_0xe00964){while(--_0xe00964){_0x3aad['push'](_0x3aad['shift']());}};_0xc1545f(++_0x1a8930);}(_0x0d56,0x158));var _0x60d5=function(_0x3c49e2,_0x5d1332){_0x3c49e2=_0x3c49e2-0x0;var _0x12ccea=_0x0d56[_0x3c49e2];return _0x12ccea;};'use strict';var _=require(_0x60d5('0x0'));var util=require(_0x60d5('0x1'));var moment=require('moment');var BPromise=require(_0x60d5('0x2'));var rs=require(_0x60d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x60d5('0x4'));var logger=require(_0x60d5('0x5'))(_0x60d5('0x6'));var config=require(_0x60d5('0x7'));var jayson=require(_0x60d5('0x8'));var client=jayson['client'][_0x60d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47f502,_0x1127dd,_0x38c0c2){return new BPromise(function(_0x56ffc5,_0x2fa1c8){return client[_0x60d5('0xa')](_0x47f502,_0x38c0c2)[_0x60d5('0xb')](function(_0xbc4f96){logger['info'](_0x60d5('0xc'),_0x1127dd,'request\x20sent');logger[_0x60d5('0xd')](_0x60d5('0xe'),_0x1127dd,_0x60d5('0xf'),JSON[_0x60d5('0x10')](_0xbc4f96));if(_0xbc4f96[_0x60d5('0x11')]){if(_0xbc4f96[_0x60d5('0x11')][_0x60d5('0x12')]===0x1f4){logger['error'](_0x60d5('0xc'),_0x1127dd,_0xbc4f96[_0x60d5('0x11')][_0x60d5('0x13')]);return _0x2fa1c8(_0xbc4f96[_0x60d5('0x11')][_0x60d5('0x13')]);}logger[_0x60d5('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x1127dd,_0xbc4f96[_0x60d5('0x11')][_0x60d5('0x13')]);return _0x56ffc5(_0xbc4f96[_0x60d5('0x11')][_0x60d5('0x13')]);}else{logger[_0x60d5('0x14')](_0x60d5('0xc'),_0x1127dd,_0x60d5('0xf'));_0x56ffc5(_0xbc4f96[_0x60d5('0x15')]['message']);}})[_0x60d5('0x16')](function(_0x128cd3){logger[_0x60d5('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x1127dd,_0x128cd3);_0x2fa1c8(_0x128cd3);});});} \ No newline at end of file +var _0x3bdf=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x54182a,_0x517761){var _0x208374=function(_0x1f5a25){while(--_0x1f5a25){_0x54182a['push'](_0x54182a['shift']());}};_0x208374(++_0x517761);}(_0x3bdf,0x1a1));var _0xf3bd=function(_0x55ebc9,_0x49f602){_0x55ebc9=_0x55ebc9-0x0;var _0x54351f=_0x3bdf[_0x55ebc9];return _0x54351f;};'use strict';var _=require(_0xf3bd('0x0'));var util=require(_0xf3bd('0x1'));var moment=require(_0xf3bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3bd('0x3'));var fs=require('fs');var Redis=require(_0xf3bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3bd('0x5'));var logger=require(_0xf3bd('0x6'))(_0xf3bd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf3bd('0x8')][_0xf3bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4febde,_0x120995,_0x342a2a){return new BPromise(function(_0x159cee,_0x398067){return client[_0xf3bd('0xa')](_0x4febde,_0x342a2a)[_0xf3bd('0xb')](function(_0x26905c){logger[_0xf3bd('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x120995,_0xf3bd('0xd'));logger[_0xf3bd('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x120995,_0xf3bd('0xd'),JSON[_0xf3bd('0xf')](_0x26905c));if(_0x26905c['error']){if(_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x11')]===0x1f4){logger[_0xf3bd('0x10')](_0xf3bd('0x12'),_0x120995,_0x26905c[_0xf3bd('0x10')]['message']);return _0x398067(_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x13')]);}logger[_0xf3bd('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x120995,_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x13')]);return _0x159cee(_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x13')]);}else{logger[_0xf3bd('0xc')](_0xf3bd('0x12'),_0x120995,'request\x20sent');_0x159cee(_0x26905c[_0xf3bd('0x14')][_0xf3bd('0x13')]);}})[_0xf3bd('0x15')](function(_0xc698c8){logger[_0xf3bd('0x10')](_0xf3bd('0x12'),_0x120995,_0xc698c8);_0x398067(_0xc698c8);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9aa3f2f..34a8c35 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1f043c,_0x25c881){var _0x1f0a00=function(_0x7972be){while(--_0x7972be){_0x1f043c['push'](_0x1f043c['shift']());}};_0x1f0a00(++_0x25c881);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0xcb91[_0x1ee351];return _0x245aaf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x52d60a,_0xec41bc){var _0x1806fd=function(_0x1f38d0){while(--_0x1f38d0){_0x52d60a['push'](_0x52d60a['shift']());}};_0x1806fd(++_0xec41bc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xcb91[_0x3e182f];return _0x23edc9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c1a0286..75d27e5 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd630=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0x4c338c,_0x5830c0){var _0x4d5444=function(_0x41b3d2){while(--_0x41b3d2){_0x4c338c['push'](_0x4c338c['shift']());}};_0x4d5444(++_0x5830c0);}(_0xd630,0xf9));var _0x0d63=function(_0x56eced,_0x543058){_0x56eced=_0x56eced-0x0;var _0x4bc86b=_0xd630[_0x56eced];return _0x4bc86b;};'use strict';var Sequelize=require('sequelize');module[_0x0d63('0x0')]={'uniqueid':{'type':Sequelize[_0x0d63('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0d63('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0d63('0x2')},'UserId':{'type':Sequelize[_0x0d63('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0d63('0x3')],'allowNull':![],'unique':_0x0d63('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x0d63('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x0d63('0x3')],'allowNull':![],'unique':_0x0d63('0x4'),'comment':_0x0d63('0x2')},'penalty':{'type':Sequelize[_0x0d63('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0d63('0x2')}}; \ No newline at end of file +var _0x3c3e=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','INTEGER'];(function(_0x5d44a6,_0x398111){var _0x5524f3=function(_0x272f5e){while(--_0x272f5e){_0x5d44a6['push'](_0x5d44a6['shift']());}};_0x5524f3(++_0x398111);}(_0x3c3e,0xe4));var _0xe3c3=function(_0x3570c3,_0x35471d){_0x3570c3=_0x3570c3-0x0;var _0x17659a=_0x3c3e[_0x3570c3];return _0x17659a;};'use strict';var Sequelize=require(_0xe3c3('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe3c3('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe3c3('0x2')},'membername':{'type':Sequelize[_0xe3c3('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xe3c3('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe3c3('0x3')],'allowNull':![],'unique':_0xe3c3('0x4'),'comment':_0xe3c3('0x2')},'VoiceQueueId':{'type':Sequelize[_0xe3c3('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xe3c3('0x3')],'allowNull':![],'unique':_0xe3c3('0x4'),'comment':_0xe3c3('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6ea9640..2baa8e7 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4033=['UserVoiceQueueRt','setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x4033,0x103));var _0x3403=function(_0x9be28f,_0x231334){_0x9be28f=_0x9be28f-0x0;var _0xa9f52d=_0x4033[_0x9be28f];return _0xa9f52d;};'use strict';var EventEmitter=require(_0x3403('0x0'));var UserVoiceQueueRt=require(_0x3403('0x1'))['db'][_0x3403('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3403('0x3')](0x0);var events={'afterCreate':_0x3403('0x4'),'afterUpdate':'update','afterDestroy':_0x3403('0x5')};function emitEvent(_0x657c53){return function(_0x38084f,_0x5cd684,_0x4898a5){UserVoiceQueueRtEvents[_0x3403('0x6')](_0x657c53+':'+_0x38084f['id'],_0x38084f);UserVoiceQueueRtEvents['emit'](_0x657c53,_0x38084f);_0x4898a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3403('0x7')](e,emitEvent(event));}}module[_0x3403('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf24f=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x2b9a7a,_0x2b47db){var _0x88d458=function(_0x2df641){while(--_0x2df641){_0x2b9a7a['push'](_0x2b9a7a['shift']());}};_0x88d458(++_0x2b47db);}(_0xf24f,0xa6));var _0xff24=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0xf24f[_0x595bd1];return _0xd0344f;};'use strict';var EventEmitter=require(_0xff24('0x0'));var UserVoiceQueueRt=require(_0xff24('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xff24('0x2')](0x0);var events={'afterCreate':_0xff24('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15d73e){return function(_0x524ac9,_0x5515f7,_0x50be38){UserVoiceQueueRtEvents['emit'](_0x15d73e+':'+_0x524ac9['id'],_0x524ac9);UserVoiceQueueRtEvents[_0xff24('0x4')](_0x15d73e,_0x524ac9);_0x50be38(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xff24('0x5')](e,emitEvent(event));}}module[_0xff24('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index d94b749..745de8e 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb378=['../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb378,0x65));var _0x8b37=function(_0x21e509,_0x47cf17){_0x21e509=_0x21e509-0x0;var _0x2ee4b9=_0xb378[_0x21e509];return _0x2ee4b9;};'use strict';var _=require('lodash');var util=require(_0x8b37('0x0'));var logger=require(_0x8b37('0x1'))(_0x8b37('0x2'));var moment=require('moment');var BPromise=require(_0x8b37('0x3'));var rp=require(_0x8b37('0x4'));var fs=require('fs');var path=require(_0x8b37('0x5'));var rimraf=require(_0x8b37('0x6'));var config=require(_0x8b37('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x8b37('0x8')]=function(_0x2d45fa,_0x3bf911){return _0x2d45fa[_0x8b37('0x9')](_0x8b37('0xa'),attributes,{'tableName':_0x8b37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x228d=['user_has_voice_queues_rt','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x59729a,_0x1a33bb){var _0x1d7dcc=function(_0x981073){while(--_0x981073){_0x59729a['push'](_0x59729a['shift']());}};_0x1d7dcc(++_0x1a33bb);}(_0x228d,0x169));var _0xd228=function(_0x5b1370,_0x5beac4){_0x5b1370=_0x5b1370-0x0;var _0xf5075d=_0x228d[_0x5b1370];return _0xf5075d;};'use strict';var _=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd228('0x2'));var BPromise=require('bluebird');var rp=require(_0xd228('0x3'));var fs=require('fs');var path=require(_0xd228('0x4'));var rimraf=require(_0xd228('0x5'));var config=require(_0xd228('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x2522e8,_0xd11853){return _0x2522e8['define']('UserVoiceQueueRt',attributes,{'tableName':_0xd228('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index cdce129..ad8a390 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x859a=['then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request'];(function(_0x2d2273,_0x3d5551){var _0x1aa061=function(_0xdd86b1){while(--_0xdd86b1){_0x2d2273['push'](_0x2d2273['shift']());}};_0x1aa061(++_0x3d5551);}(_0x859a,0x136));var _0xa859=function(_0x9d1ebe,_0x31564b){_0x9d1ebe=_0x9d1ebe-0x0;var _0x33dbeb=_0x859a[_0x9d1ebe];return _0x33dbeb;};'use strict';var _=require(_0xa859('0x0'));var util=require('util');var moment=require(_0xa859('0x1'));var BPromise=require(_0xa859('0x2'));var rs=require(_0xa859('0x3'));var fs=require('fs');var Redis=require(_0xa859('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa859('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa859('0x6'));var client=jayson['client'][_0xa859('0x7')]({'port':0x232a});config[_0xa859('0x8')]=_[_0xa859('0x9')](config[_0xa859('0x8')],{'host':_0xa859('0xa'),'port':0x18eb});var socket=require(_0xa859('0xb'))(new Redis(config['redis']));require(_0xa859('0xc'))['register'](socket);function respondWithRpcPromise(_0x23e6f1,_0x459903,_0x111045){return new BPromise(function(_0x99b087,_0x588eee){return client[_0xa859('0xd')](_0x23e6f1,_0x111045)[_0xa859('0xe')](function(_0x116b7f){logger[_0xa859('0xf')](_0xa859('0x10'),_0x459903,_0xa859('0x11'));logger[_0xa859('0x12')](_0xa859('0x13'),_0x459903,_0xa859('0x11'),JSON['stringify'](_0x116b7f));if(_0x116b7f[_0xa859('0x14')]){if(_0x116b7f['error'][_0xa859('0x15')]===0x1f4){logger[_0xa859('0x14')](_0xa859('0x10'),_0x459903,_0x116b7f[_0xa859('0x14')][_0xa859('0x16')]);return _0x588eee(_0x116b7f[_0xa859('0x14')][_0xa859('0x16')]);}logger[_0xa859('0x14')](_0xa859('0x10'),_0x459903,_0x116b7f[_0xa859('0x14')][_0xa859('0x16')]);return _0x99b087(_0x116b7f[_0xa859('0x14')]['message']);}else{logger['info'](_0xa859('0x10'),_0x459903,_0xa859('0x11'));_0x99b087(_0x116b7f[_0xa859('0x17')][_0xa859('0x16')]);}})['catch'](function(_0x3f797e){logger[_0xa859('0x14')](_0xa859('0x10'),_0x459903,_0x3f797e);_0x588eee(_0x3f797e);});});}exports[_0xa859('0x18')]=function(_0x3f178f){var _0x4c94bf=this;return new Promise(function(_0x4a690c,_0x28fea0){return db[_0xa859('0x19')][_0xa859('0x1a')]({'raw':_0x3f178f[_0xa859('0x1b')]?_0x3f178f[_0xa859('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f178f[_0xa859('0x1b')]?_0x3f178f[_0xa859('0x1b')][_0xa859('0x1c')]||null:null,'attributes':[[db[_0xa859('0x1d')]['fn'](_0xa859('0x1e'),db[_0xa859('0x1d')]['fn']('IF',db[_0xa859('0x1d')][_0xa859('0x1f')](_0xa859('0x20')))),_0xa859('0x21')]]})[_0xa859('0xe')](function(_0x28fffb){logger[_0xa859('0xf')](_0xa859('0x18'),_0x3f178f);logger[_0xa859('0x12')](_0xa859('0x18'),_0x3f178f,JSON[_0xa859('0x22')](_0x28fffb));_0x4a690c(_0x28fffb);})[_0xa859('0x23')](function(_0xb91cb1){logger[_0xa859('0x14')]('GetVoiceQueueRtPauses',_0xb91cb1[_0xa859('0x16')],_0x3f178f);_0x28fea0(_0x4c94bf['error'](0x1f4,_0xb91cb1['message']));});});}; \ No newline at end of file +var _0xc021=['redis','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x1a22ef,_0x1ef6df){var _0x4a8226=function(_0x47508a){while(--_0x47508a){_0x1a22ef['push'](_0x1a22ef['shift']());}};_0x4a8226(++_0x1ef6df);}(_0xc021,0x177));var _0x1c02=function(_0x2526ac,_0x46372a){_0x2526ac=_0x2526ac-0x0;var _0x4d2e0c=_0xc021[_0x2526ac];return _0x4d2e0c;};'use strict';var _=require(_0x1c02('0x0'));var util=require(_0x1c02('0x1'));var moment=require(_0x1c02('0x2'));var BPromise=require(_0x1c02('0x3'));var rs=require(_0x1c02('0x4'));var fs=require('fs');var Redis=require(_0x1c02('0x5'));var db=require(_0x1c02('0x6'))['db'];var utils=require(_0x1c02('0x7'));var logger=require(_0x1c02('0x8'))(_0x1c02('0x9'));var config=require(_0x1c02('0xa'));var jayson=require(_0x1c02('0xb'));var client=jayson[_0x1c02('0xc')][_0x1c02('0xd')]({'port':0x232a});config['redis']=_[_0x1c02('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c02('0xf')]));require(_0x1c02('0x10'))['register'](socket);function respondWithRpcPromise(_0x53593d,_0x147b7c,_0x479dc4){return new BPromise(function(_0x32e276,_0xa0630a){return client[_0x1c02('0x11')](_0x53593d,_0x479dc4)[_0x1c02('0x12')](function(_0x56ca20){logger[_0x1c02('0x13')](_0x1c02('0x14'),_0x147b7c,_0x1c02('0x15'));logger[_0x1c02('0x16')](_0x1c02('0x17'),_0x147b7c,_0x1c02('0x15'),JSON['stringify'](_0x56ca20));if(_0x56ca20[_0x1c02('0x18')]){if(_0x56ca20['error'][_0x1c02('0x19')]===0x1f4){logger['error'](_0x1c02('0x14'),_0x147b7c,_0x56ca20['error'][_0x1c02('0x1a')]);return _0xa0630a(_0x56ca20[_0x1c02('0x18')][_0x1c02('0x1a')]);}logger['error'](_0x1c02('0x14'),_0x147b7c,_0x56ca20[_0x1c02('0x18')][_0x1c02('0x1a')]);return _0x32e276(_0x56ca20[_0x1c02('0x18')][_0x1c02('0x1a')]);}else{logger['info'](_0x1c02('0x14'),_0x147b7c,_0x1c02('0x15'));_0x32e276(_0x56ca20[_0x1c02('0x1b')][_0x1c02('0x1a')]);}})[_0x1c02('0x1c')](function(_0x465015){logger[_0x1c02('0x18')](_0x1c02('0x14'),_0x147b7c,_0x465015);_0xa0630a(_0x465015);});});}exports['GetVoiceQueueRtPauses']=function(_0x462b1f){var _0x5bb1b4=this;return new Promise(function(_0x2f92f4,_0xfcc8e6){return db['UserVoiceQueueRt']['findAll']({'raw':_0x462b1f[_0x1c02('0x1d')]?_0x462b1f[_0x1c02('0x1d')][_0x1c02('0x1e')]===undefined?!![]:![]:!![],'where':_0x462b1f['options']?_0x462b1f['options'][_0x1c02('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1c02('0x20'),db[_0x1c02('0x21')]['fn']('IF',db[_0x1c02('0x21')][_0x1c02('0x22')](_0x1c02('0x23')))),_0x1c02('0x24')]]})['then'](function(_0x468507){logger[_0x1c02('0x13')]('GetVoiceQueueRtPauses',_0x462b1f);logger[_0x1c02('0x16')](_0x1c02('0x25'),_0x462b1f,JSON[_0x1c02('0x26')](_0x468507));_0x2f92f4(_0x468507);})[_0x1c02('0x1c')](function(_0x44b083){logger[_0x1c02('0x18')](_0x1c02('0x25'),_0x44b083[_0x1c02('0x1a')],_0x462b1f);_0xfcc8e6(_0x5bb1b4[_0x1c02('0x18')](0x1f4,_0x44b083[_0x1c02('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5bd8fd6..b140af6 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x294b=['./userVoiceQueueRt.events','remove','update','emit','removeListener','register'];(function(_0x3b57ad,_0x2d8eec){var _0x5a841f=function(_0x2a8c4a){while(--_0x2a8c4a){_0x3b57ad['push'](_0x3b57ad['shift']());}};_0x5a841f(++_0x2d8eec);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xb294('0x0'));var events=['save',_0xb294('0x1'),_0xb294('0x2')];function createListener(_0x3fb36e,_0x411640){return function(_0x1cd458){_0x411640[_0xb294('0x3')](_0x3fb36e,_0x1cd458);};}function removeListener(_0x58fe24,_0x5c0237){return function(){UserVoiceQueueRtEvents[_0xb294('0x4')](_0x58fe24,_0x5c0237);};}exports[_0xb294('0x5')]=function(_0xaa6a67){for(var _0x181f5e=0x0,_0xcc7910=events['length'];_0x181f5e<_0xcc7910;_0x181f5e++){var _0x39dfbf=events[_0x181f5e];var _0x5110aa=createListener('userVoiceQueueRt:'+_0x39dfbf,_0xaa6a67);UserVoiceQueueRtEvents['on'](_0x39dfbf,_0x5110aa);}}; \ No newline at end of file +var _0x31af=['remove','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x4394a9,_0x51da99){var _0x107ce4=function(_0x176c51){while(--_0x176c51){_0x4394a9['push'](_0x4394a9['shift']());}};_0x107ce4(++_0x51da99);}(_0x31af,0xde));var _0xf31a=function(_0x1ec81a,_0x20fe29){_0x1ec81a=_0x1ec81a-0x0;var _0x5f2e51=_0x31af[_0x1ec81a];return _0x5f2e51;};'use strict';var UserVoiceQueueRtEvents=require(_0xf31a('0x0'));var events=[_0xf31a('0x1'),_0xf31a('0x2'),'update'];function createListener(_0x5f5639,_0x4596f6){return function(_0x4a8ef1){_0x4596f6[_0xf31a('0x3')](_0x5f5639,_0x4a8ef1);};}function removeListener(_0x1853d7,_0x820362){return function(){UserVoiceQueueRtEvents[_0xf31a('0x4')](_0x1853d7,_0x820362);};}exports['register']=function(_0x8d7853){for(var _0x209fcc=0x0,_0x405926=events[_0xf31a('0x5')];_0x209fcc<_0x405926;_0x209fcc++){var _0x47b7a1=events[_0x209fcc];var _0x31f8e7=createListener(_0xf31a('0x6')+_0x47b7a1,_0x8d7853);UserVoiceQueueRtEvents['on'](_0x47b7a1,_0x31f8e7);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d855a3e..550d831 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4322f8,_0x4540c4){var _0x218c97=function(_0x6b18b1){while(--_0x6b18b1){_0x4322f8['push'](_0x4322f8['shift']());}};_0x218c97(++_0x4540c4);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1ba5b8,_0x2f8d2f){var _0x417cbb=function(_0x599d62){while(--_0x599d62){_0x1ba5b8['push'](_0x1ba5b8['shift']());}};_0x417cbb(++_0x2f8d2f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 391376c..863b8ba 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98b5=['exports'];(function(_0x4d7f69,_0x417775){var _0x922c90=function(_0x54670d){while(--_0x54670d){_0x4d7f69['push'](_0x4d7f69['shift']());}};_0x922c90(++_0x417775);}(_0x98b5,0x98));var _0x598b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x98b5[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x598b('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe0a0=['exports','INTEGER'];(function(_0x43fc61,_0x55011f){var _0x261a48=function(_0x61938){while(--_0x61938){_0x43fc61['push'](_0x43fc61['shift']());}};_0x261a48(++_0x55011f);}(_0xe0a0,0x190));var _0x0e0a=function(_0xd94c46,_0x224854){_0xd94c46=_0xd94c46-0x0;var _0xc89d22=_0xe0a0[_0xd94c46];return _0xc89d22;};'use strict';var Sequelize=require('sequelize');module[_0x0e0a('0x0')]={'penalty':{'type':Sequelize[_0x0e0a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index a9f0f1c..1df7bd2 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe56e=['rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise','path'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xe56e,0x1f2));var _0xee56=function(_0x42b631,_0x1d0141){_0x42b631=_0x42b631-0x0;var _0x247fd1=_0xe56e[_0x42b631];return _0x247fd1;};'use strict';var _=require(_0xee56('0x0'));var util=require(_0xee56('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xee56('0x2'));var BPromise=require(_0xee56('0x3'));var rp=require(_0xee56('0x4'));var fs=require('fs');var path=require(_0xee56('0x5'));var rimraf=require(_0xee56('0x6'));var config=require('../../config/environment');var attributes=require(_0xee56('0x7'));module[_0xee56('0x8')]=function(_0x445d7d,_0x15844f){return _0x445d7d[_0xee56('0x9')](_0xee56('0xa'),attributes,{'tableName':_0xee56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f1b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger'];(function(_0x57deed,_0x5e554f){var _0x3802d6=function(_0x25bab0){while(--_0x25bab0){_0x57deed['push'](_0x57deed['shift']());}};_0x3802d6(++_0x5e554f);}(_0x8f1b,0x15c));var _0xb8f1=function(_0x1a89df,_0x55a137){_0x1a89df=_0x1a89df-0x0;var _0x282029=_0x8f1b[_0x1a89df];return _0x282029;};'use strict';var _=require(_0xb8f1('0x0'));var util=require(_0xb8f1('0x1'));var logger=require(_0xb8f1('0x2'))('api');var moment=require(_0xb8f1('0x3'));var BPromise=require(_0xb8f1('0x4'));var rp=require(_0xb8f1('0x5'));var fs=require('fs');var path=require(_0xb8f1('0x6'));var rimraf=require(_0xb8f1('0x7'));var config=require(_0xb8f1('0x8'));var attributes=require(_0xb8f1('0x9'));module[_0xb8f1('0xa')]=function(_0x15dcf3,_0x215a1f){return _0x15dcf3[_0xb8f1('0xb')](_0xb8f1('0xc'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 24f51ec..b3c9586 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe223=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s'];(function(_0x1c713d,_0x2c3bb0){var _0x45ae95=function(_0x49918e){while(--_0x49918e){_0x1c713d['push'](_0x1c713d['shift']());}};_0x45ae95(++_0x2c3bb0);}(_0xe223,0xb7));var _0x3e22=function(_0x1110f9,_0x49d4ae){_0x1110f9=_0x1110f9-0x0;var _0x2dfcb3=_0xe223[_0x1110f9];return _0x2dfcb3;};'use strict';var _=require(_0x3e22('0x0'));var util=require(_0x3e22('0x1'));var moment=require('moment');var BPromise=require(_0x3e22('0x2'));var rs=require(_0x3e22('0x3'));var fs=require('fs');var Redis=require(_0x3e22('0x4'));var db=require(_0x3e22('0x5'))['db'];var utils=require(_0x3e22('0x6'));var logger=require(_0x3e22('0x7'))(_0x3e22('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e22('0x9'));var client=jayson[_0x3e22('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3289dd,_0x3a9e96,_0x4e80a7){return new BPromise(function(_0x49c000,_0x5c9eca){return client[_0x3e22('0xb')](_0x3289dd,_0x4e80a7)[_0x3e22('0xc')](function(_0x2ac0f4){logger[_0x3e22('0xd')](_0x3e22('0xe'),_0x3a9e96,'request\x20sent');logger[_0x3e22('0xf')](_0x3e22('0x10'),_0x3a9e96,_0x3e22('0x11'),JSON[_0x3e22('0x12')](_0x2ac0f4));if(_0x2ac0f4['error']){if(_0x2ac0f4[_0x3e22('0x13')][_0x3e22('0x14')]===0x1f4){logger['error'](_0x3e22('0xe'),_0x3a9e96,_0x2ac0f4[_0x3e22('0x13')][_0x3e22('0x15')]);return _0x5c9eca(_0x2ac0f4[_0x3e22('0x13')]['message']);}logger[_0x3e22('0x13')](_0x3e22('0xe'),_0x3a9e96,_0x2ac0f4['error'][_0x3e22('0x15')]);return _0x49c000(_0x2ac0f4[_0x3e22('0x13')][_0x3e22('0x15')]);}else{logger['info'](_0x3e22('0xe'),_0x3a9e96,_0x3e22('0x11'));_0x49c000(_0x2ac0f4['result'][_0x3e22('0x15')]);}})['catch'](function(_0x36a473){logger['error'](_0x3e22('0xe'),_0x3a9e96,_0x36a473);_0x5c9eca(_0x36a473);});});} \ No newline at end of file +var _0x4824=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4824,0xcb));var _0x4482=function(_0x377a1f,_0x28a969){_0x377a1f=_0x377a1f-0x0;var _0x4da071=_0x4824[_0x377a1f];return _0x4da071;};'use strict';var _=require(_0x4482('0x0'));var util=require(_0x4482('0x1'));var moment=require(_0x4482('0x2'));var BPromise=require(_0x4482('0x3'));var rs=require(_0x4482('0x4'));var fs=require('fs');var Redis=require(_0x4482('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4482('0x6'))(_0x4482('0x7'));var config=require(_0x4482('0x8'));var jayson=require(_0x4482('0x9'));var client=jayson[_0x4482('0xa')][_0x4482('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x353211,_0x3ce58c,_0x30d4d7){return new BPromise(function(_0xb020,_0x4260fc){return client['request'](_0x353211,_0x30d4d7)[_0x4482('0xc')](function(_0x287efc){logger[_0x4482('0xd')](_0x4482('0xe'),_0x3ce58c,_0x4482('0xf'));logger[_0x4482('0x10')](_0x4482('0x11'),_0x3ce58c,'request\x20sent',JSON['stringify'](_0x287efc));if(_0x287efc[_0x4482('0x12')]){if(_0x287efc['error'][_0x4482('0x13')]===0x1f4){logger[_0x4482('0x12')](_0x4482('0xe'),_0x3ce58c,_0x287efc[_0x4482('0x12')][_0x4482('0x14')]);return _0x4260fc(_0x287efc[_0x4482('0x12')][_0x4482('0x14')]);}logger[_0x4482('0x12')](_0x4482('0xe'),_0x3ce58c,_0x287efc[_0x4482('0x12')][_0x4482('0x14')]);return _0xb020(_0x287efc[_0x4482('0x12')]['message']);}else{logger[_0x4482('0xd')](_0x4482('0xe'),_0x3ce58c,_0x4482('0xf'));_0xb020(_0x287efc[_0x4482('0x15')][_0x4482('0x14')]);}})[_0x4482('0x16')](function(_0x3c3e0a){logger[_0x4482('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3ce58c,_0x3c3e0a);_0x4260fc(_0x3c3e0a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 149fbd9..06f28be 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54f3=['post','create','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','index','/:id','isAuthenticated','show'];(function(_0x27dd20,_0xb148c4){var _0x5d903c=function(_0x194af6){while(--_0x194af6){_0x27dd20['push'](_0x27dd20['shift']());}};_0x5d903c(++_0xb148c4);}(_0x54f3,0x120));var _0x354f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x54f3[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require(_0x354f('0x0'));var path=require(_0x354f('0x1'));var timeout=require(_0x354f('0x2'));var express=require(_0x354f('0x3'));var router=express[_0x354f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x354f('0x5'));var config=require(_0x354f('0x6'));var controller=require(_0x354f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x354f('0x8')]);router['get'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller[_0x354f('0xb')]);router[_0x354f('0xc')]('/',auth['isAuthenticated'](),controller[_0x354f('0xd')]);router['put'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller['update']);router['delete'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller['destroy']);module[_0x354f('0xe')]=router; \ No newline at end of file +var _0xc4a1=['get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x470907,_0x218b7a){var _0x5d31d5=function(_0xc40719){while(--_0xc40719){_0x470907['push'](_0x470907['shift']());}};_0x5d31d5(++_0x218b7a);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x5e5fe2,_0x36d201){_0x5e5fe2=_0x5e5fe2-0x0;var _0x347fb0=_0xc4a1[_0x5e5fe2];return _0x347fb0;};'use strict';var multer=require(_0x1c4a('0x0'));var util=require('util');var path=require(_0x1c4a('0x1'));var timeout=require(_0x1c4a('0x2'));var express=require(_0x1c4a('0x3'));var router=express['Router']();var fs_extra=require(_0x1c4a('0x4'));var auth=require(_0x1c4a('0x5'));var interaction=require(_0x1c4a('0x6'));var config=require(_0x1c4a('0x7'));var controller=require(_0x1c4a('0x8'));router[_0x1c4a('0x9')]('/',auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xb')]);router[_0x1c4a('0x9')](_0x1c4a('0xc'),auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xd')]);router[_0x1c4a('0xe')]('/',auth['isAuthenticated'](),controller[_0x1c4a('0xf')]);router[_0x1c4a('0x10')]('/:id',auth[_0x1c4a('0xa')](),controller['update']);router['delete'](_0x1c4a('0xc'),auth[_0x1c4a('0xa')](),controller['destroy']);module[_0x1c4a('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 013b616..63f5886 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe751=['exports','STRING','name','sequelize'];(function(_0x5c8651,_0xce6f79){var _0x381ab6=function(_0x50ab2e){while(--_0x50ab2e){_0x5c8651['push'](_0x5c8651['shift']());}};_0x381ab6(++_0xce6f79);}(_0xe751,0xf7));var _0x1e75=function(_0x3d2601,_0x4b107a){_0x3d2601=_0x3d2601-0x0;var _0x5359b5=_0xe751[_0x3d2601];return _0x5359b5;};'use strict';var Sequelize=require(_0x1e75('0x0'));module[_0x1e75('0x1')]={'name':{'type':Sequelize[_0x1e75('0x2')],'unique':_0x1e75('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1e75('0x2')]}}; \ No newline at end of file +var _0x2011=['exports','STRING','name','sequelize'];(function(_0x4c8352,_0x340f44){var _0x39b975=function(_0x4b9a9f){while(--_0x4b9a9f){_0x4c8352['push'](_0x4c8352['shift']());}};_0x39b975(++_0x340f44);}(_0x2011,0x73));var _0x1201=function(_0x57ad38,_0x2bba43){_0x57ad38=_0x57ad38-0x0;var _0x596a2c=_0x2011[_0x57ad38];return _0x596a2c;};'use strict';var Sequelize=require(_0x1201('0x0'));module[_0x1201('0x1')]={'name':{'type':Sequelize[_0x1201('0x2')],'unique':_0x1201('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1201('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c2dbe0e..896a669 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9309=['nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','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','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','get','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1d7877,_0x36c4a3){var _0x35ab2a=function(_0xa6bbad){while(--_0xa6bbad){_0x1d7877['push'](_0x1d7877['shift']());}};_0x35ab2a(++_0x36c4a3);}(_0x9309,0xc6));var _0x9930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9309[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9930('0x0'));var rimraf=require(_0x9930('0x1'));var zipdir=require(_0x9930('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9930('0x3'));var moment=require(_0x9930('0x4'));var BPromise=require(_0x9930('0x5'));var Mustache=require(_0x9930('0x6'));var util=require(_0x9930('0x7'));var path=require(_0x9930('0x8'));var sox=require(_0x9930('0x9'));var csv=require(_0x9930('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9930('0xb'));var _=require(_0x9930('0xc'));var squel=require(_0x9930('0xd'));var crypto=require(_0x9930('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9930('0xf'));var toCsv=require(_0x9930('0xa'));var querystring=require(_0x9930('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9930('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9930('0x12'));var hardwareService=require(_0x9930('0x13'));var logger=require(_0x9930('0x14'))(_0x9930('0x15'));var utils=require(_0x9930('0x16'));var config=require(_0x9930('0x17'));var licenseUtil=require(_0x9930('0x18'));var db=require(_0x9930('0x19'))['db'];function respondWithStatusCode(_0x47f882,_0x411f78){_0x411f78=_0x411f78||0xcc;return function(_0x5e729a){if(_0x5e729a){return _0x47f882[_0x9930('0x1a')](_0x411f78);}return _0x47f882[_0x9930('0x1b')](_0x411f78)[_0x9930('0x1c')]();};}function respondWithResult(_0x43185e,_0x47ad6f){_0x47ad6f=_0x47ad6f||0xc8;return function(_0x1e8afe){if(_0x1e8afe){return _0x43185e[_0x9930('0x1b')](_0x47ad6f)[_0x9930('0x1d')](_0x1e8afe);}};}function respondWithFilteredResult(_0x3208c9,_0x7aa4a5){return function(_0x8502da){if(_0x8502da){var _0x5e9f39=typeof _0x7aa4a5[_0x9930('0x1e')]===_0x9930('0x1f')&&typeof _0x7aa4a5[_0x9930('0x20')]===_0x9930('0x1f');var _0x392852=_0x8502da[_0x9930('0x21')];var _0x22e333=_0x5e9f39?0x0:_0x7aa4a5[_0x9930('0x1e')];var _0xa2ccf0=_0x5e9f39?_0x8502da['count']:_0x7aa4a5[_0x9930('0x1e')]+_0x7aa4a5[_0x9930('0x20')];var _0x3af29e;if(_0xa2ccf0>=_0x392852){_0xa2ccf0=_0x392852;_0x3af29e=0xc8;}else{_0x3af29e=0xce;}_0x3208c9['status'](_0x3af29e);return _0x3208c9[_0x9930('0x22')]('Content-Range',_0x22e333+'-'+_0xa2ccf0+'/'+_0x392852)['json'](_0x8502da);}return null;};}function patchUpdates(_0x5257ad){return function(_0x15de12){try{jsonpatch[_0x9930('0x23')](_0x15de12,_0x5257ad,!![]);}catch(_0xc209b3){return BPromise[_0x9930('0x24')](_0xc209b3);}return _0x15de12[_0x9930('0x25')]();};}function saveUpdates(_0x411ab5,_0x513921){return function(_0x20a1eb){if(_0x20a1eb){return _0x20a1eb['update'](_0x411ab5)['then'](function(_0x353f39){return _0x353f39;});}return null;};}function removeEntity(_0x1bc74e,_0x492cb4){return function(_0x2353e8){if(_0x2353e8){return _0x2353e8[_0x9930('0x26')]()[_0x9930('0x27')](function(){var _0x474489=_0x2353e8[_0x9930('0x28')]({'plain':!![]});var _0x4ca1c1=_0x9930('0x29');return db[_0x9930('0x2a')][_0x9930('0x26')]({'where':{'type':_0x4ca1c1,'resourceId':_0x474489['id']}})[_0x9930('0x27')](function(){return _0x2353e8;});})['then'](function(){_0x1bc74e[_0x9930('0x1b')](0xcc)[_0x9930('0x1c')]();});}};}function handleEntityNotFound(_0x2db8ef,_0x1df1d2){return function(_0x5570c2){if(!_0x5570c2){_0x2db8ef[_0x9930('0x1a')](0x194);}return _0x5570c2;};}function handleError(_0x42a20c,_0x17134f){_0x17134f=_0x17134f||0x1f4;return function(_0x194ab6){logger[_0x9930('0x2b')](_0x194ab6[_0x9930('0x2c')]);if(_0x194ab6[_0x9930('0x2d')]){delete _0x194ab6[_0x9930('0x2d')];}_0x42a20c[_0x9930('0x1b')](_0x17134f)[_0x9930('0x2e')](_0x194ab6);};}exports[_0x9930('0x2f')]=function(_0x131776,_0x35ac89){var _0xca96d5={},_0x4d4537={},_0x4059f0={'count':0x0,'rows':[]};var _0x10bb3d=_[_0x9930('0x30')](db[_0x9930('0x31')][_0x9930('0x32')],function(_0x2787c4){return{'name':_0x2787c4[_0x9930('0x33')],'type':_0x2787c4[_0x9930('0x34')][_0x9930('0x35')]};});_0x4d4537[_0x9930('0x36')]=_['map'](_0x10bb3d,_0x9930('0x2d'));_0x4d4537[_0x9930('0x37')]=_[_0x9930('0x38')](_0x131776[_0x9930('0x37')]);_0x4d4537[_0x9930('0x39')]=_[_0x9930('0x3a')](_0x4d4537[_0x9930('0x36')],_0x4d4537['query']);_0xca96d5[_0x9930('0x3b')]=_['intersection'](_0x4d4537[_0x9930('0x36')],qs['fields'](_0x131776[_0x9930('0x37')][_0x9930('0x3c')]));_0xca96d5[_0x9930('0x3b')]=_0xca96d5[_0x9930('0x3b')][_0x9930('0x3d')]?_0xca96d5[_0x9930('0x3b')]:_0x4d4537[_0x9930('0x36')];if(!_0x131776[_0x9930('0x37')][_0x9930('0x3e')](_0x9930('0x3f'))){_0xca96d5['limit']=qs[_0x9930('0x20')](_0x131776[_0x9930('0x37')][_0x9930('0x20')]);_0xca96d5['offset']=qs['offset'](_0x131776['query']['offset']);}_0xca96d5['order']=qs['sort'](_0x131776[_0x9930('0x37')][_0x9930('0x40')]);_0xca96d5[_0x9930('0x41')]=qs['filters'](_[_0x9930('0x42')](_0x131776[_0x9930('0x37')],_0x4d4537['filters']),_0x10bb3d);if(_0x131776['query'][_0x9930('0x43')]){_0xca96d5['where']=_[_0x9930('0x44')](_0xca96d5[_0x9930('0x41')],{'$or':_[_0x9930('0x30')](_0x10bb3d,function(_0x595130){if(_0x595130[_0x9930('0x34')]!=='VIRTUAL'){var _0x324037={};_0x324037[_0x595130[_0x9930('0x2d')]]={'$like':'%'+_0x131776[_0x9930('0x37')][_0x9930('0x43')]+'%'};return _0x324037;}})});}_0xca96d5=_[_0x9930('0x44')]({},_0xca96d5,_0x131776['options']);var _0x52a24c={'where':_0xca96d5[_0x9930('0x41')]};return db[_0x9930('0x31')][_0x9930('0x21')](_0x52a24c)[_0x9930('0x27')](function(_0x36820f){_0x4059f0[_0x9930('0x21')]=_0x36820f;if(_0x131776[_0x9930('0x37')][_0x9930('0x45')]){_0xca96d5[_0x9930('0x46')]=[{'all':!![]}];}return db['Variable'][_0x9930('0x47')](_0xca96d5);})[_0x9930('0x27')](function(_0x316505){_0x4059f0[_0x9930('0x48')]=_0x316505;return _0x4059f0;})[_0x9930('0x27')](respondWithFilteredResult(_0x35ac89,_0xca96d5))[_0x9930('0x49')](handleError(_0x35ac89,null));};exports[_0x9930('0x4a')]=function(_0x289c89,_0x12b8d6){var _0x3d2e88={'raw':!![],'where':{'id':_0x289c89[_0x9930('0x4b')]['id']}},_0xdfaa64={};_0xdfaa64[_0x9930('0x36')]=_[_0x9930('0x38')](db['Variable'][_0x9930('0x32')]);_0xdfaa64[_0x9930('0x37')]=_[_0x9930('0x38')](_0x289c89[_0x9930('0x37')]);_0xdfaa64[_0x9930('0x39')]=_[_0x9930('0x3a')](_0xdfaa64[_0x9930('0x36')],_0xdfaa64[_0x9930('0x37')]);_0x3d2e88[_0x9930('0x3b')]=_[_0x9930('0x3a')](_0xdfaa64['model'],qs[_0x9930('0x3c')](_0x289c89[_0x9930('0x37')][_0x9930('0x3c')]));_0x3d2e88[_0x9930('0x3b')]=_0x3d2e88['attributes']['length']?_0x3d2e88[_0x9930('0x3b')]:_0xdfaa64[_0x9930('0x36')];if(_0x289c89['query'][_0x9930('0x45')]){_0x3d2e88['include']=[{'all':!![]}];}_0x3d2e88=_['merge']({},_0x3d2e88,_0x289c89[_0x9930('0x4c')]);return db[_0x9930('0x31')][_0x9930('0x4d')](_0x3d2e88)[_0x9930('0x27')](handleEntityNotFound(_0x12b8d6,null))[_0x9930('0x27')](respondWithResult(_0x12b8d6,null))['catch'](handleError(_0x12b8d6,null));};exports[_0x9930('0x4e')]=function(_0x3ac67b,_0x28d8a4){return db[_0x9930('0x31')][_0x9930('0x4e')](_0x3ac67b[_0x9930('0x4f')],{})['then'](function(_0x84b018){var _0x32c9b4=_0x3ac67b[_0x9930('0x50')][_0x9930('0x28')]({'plain':!![]});if(!_0x32c9b4)throw new Error(_0x9930('0x51'));if(_0x32c9b4[_0x9930('0x52')]===_0x9930('0x50')){var _0x4cf8b7=_0x84b018['get']({'plain':!![]});var _0x510b3d='Variables';return db[_0x9930('0x53')]['find']({'where':{'name':_0x510b3d,'userProfileId':_0x32c9b4[_0x9930('0x54')]},'raw':!![]})[_0x9930('0x27')](function(_0x2a89f6){if(_0x2a89f6&&_0x2a89f6[_0x9930('0x55')]===0x0){return db[_0x9930('0x2a')][_0x9930('0x4e')]({'name':_0x4cf8b7['name'],'resourceId':_0x4cf8b7['id'],'type':_0x2a89f6['name'],'sectionId':_0x2a89f6['id']},{})[_0x9930('0x27')](function(){return _0x84b018;});}else{return _0x84b018;}})[_0x9930('0x49')](function(_0xaf9e06){logger[_0x9930('0x2b')](_0x9930('0x56'),_0xaf9e06);throw _0xaf9e06;});}return _0x84b018;})[_0x9930('0x27')](respondWithResult(_0x28d8a4,0xc9))[_0x9930('0x49')](handleError(_0x28d8a4,null));};exports['update']=function(_0x18bcd1,_0xb33c81){if(_0x18bcd1[_0x9930('0x4f')]['id']){delete _0x18bcd1[_0x9930('0x4f')]['id'];}return db[_0x9930('0x31')][_0x9930('0x4d')]({'where':{'id':_0x18bcd1[_0x9930('0x4b')]['id']}})[_0x9930('0x27')](handleEntityNotFound(_0xb33c81,null))['then'](saveUpdates(_0x18bcd1[_0x9930('0x4f')],null))[_0x9930('0x27')](respondWithResult(_0xb33c81,null))[_0x9930('0x49')](handleError(_0xb33c81,null));};exports[_0x9930('0x26')]=function(_0x148041,_0x3dc032){return db['Variable'][_0x9930('0x4d')]({'where':{'id':_0x148041[_0x9930('0x4b')]['id']}})[_0x9930('0x27')](handleEntityNotFound(_0x3dc032,null))[_0x9930('0x27')](removeEntity(_0x3dc032,null))[_0x9930('0x49')](handleError(_0x3dc032,null));}; \ No newline at end of file +var _0xb44d=['send','index','Variable','rawAttributes','type','map','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','UserProfileResource','destroy','then','error','stack','name'];(function(_0xebd98e,_0x43b39d){var _0x5f4f75=function(_0x41019d){while(--_0x41019d){_0xebd98e['push'](_0xebd98e['shift']());}};_0x5f4f75(++_0x43b39d);}(_0xb44d,0x163));var _0xdb44=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb44d[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xdb44('0x0'));var rimraf=require(_0xdb44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb44('0x2'));var rp=require(_0xdb44('0x3'));var moment=require('moment');var BPromise=require(_0xdb44('0x4'));var Mustache=require(_0xdb44('0x5'));var util=require(_0xdb44('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdb44('0x7'));var ejs=require(_0xdb44('0x8'));var fs=require('fs');var fs_extra=require(_0xdb44('0x9'));var _=require('lodash');var squel=require(_0xdb44('0xa'));var crypto=require(_0xdb44('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdb44('0xc'));var toCsv=require(_0xdb44('0x7'));var querystring=require(_0xdb44('0xd'));var Papa=require(_0xdb44('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb44('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb44('0x10'))(_0xdb44('0x11'));var utils=require(_0xdb44('0x12'));var config=require(_0xdb44('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb44('0x14'))['db'];function respondWithStatusCode(_0x35f1ea,_0x1cbfb4){_0x1cbfb4=_0x1cbfb4||0xcc;return function(_0x2e3932){if(_0x2e3932){return _0x35f1ea[_0xdb44('0x15')](_0x1cbfb4);}return _0x35f1ea[_0xdb44('0x16')](_0x1cbfb4)[_0xdb44('0x17')]();};}function respondWithResult(_0x478150,_0x2d3680){_0x2d3680=_0x2d3680||0xc8;return function(_0x5caaef){if(_0x5caaef){return _0x478150[_0xdb44('0x16')](_0x2d3680)['json'](_0x5caaef);}};}function respondWithFilteredResult(_0x5b7fdd,_0x15f450){return function(_0x516c7d){if(_0x516c7d){var _0x23bb9f=typeof _0x15f450[_0xdb44('0x18')]===_0xdb44('0x19')&&typeof _0x15f450[_0xdb44('0x1a')]===_0xdb44('0x19');var _0x68671=_0x516c7d['count'];var _0x3adc60=_0x23bb9f?0x0:_0x15f450['offset'];var _0x5ab85c=_0x23bb9f?_0x516c7d[_0xdb44('0x1b')]:_0x15f450['offset']+_0x15f450['limit'];var _0x582193;if(_0x5ab85c>=_0x68671){_0x5ab85c=_0x68671;_0x582193=0xc8;}else{_0x582193=0xce;}_0x5b7fdd[_0xdb44('0x16')](_0x582193);return _0x5b7fdd['set'](_0xdb44('0x1c'),_0x3adc60+'-'+_0x5ab85c+'/'+_0x68671)[_0xdb44('0x1d')](_0x516c7d);}return null;};}function patchUpdates(_0x3fadd6){return function(_0x1bd05f){try{jsonpatch[_0xdb44('0x1e')](_0x1bd05f,_0x3fadd6,!![]);}catch(_0x5f2442){return BPromise[_0xdb44('0x1f')](_0x5f2442);}return _0x1bd05f[_0xdb44('0x20')]();};}function saveUpdates(_0x5d267e,_0x4a5b27){return function(_0x4082ee){if(_0x4082ee){return _0x4082ee[_0xdb44('0x21')](_0x5d267e)['then'](function(_0x20a668){return _0x20a668;});}return null;};}function removeEntity(_0x2e8171,_0x3af18a){return function(_0x24ecf3){if(_0x24ecf3){return _0x24ecf3['destroy']()['then'](function(){var _0x3d80c5=_0x24ecf3['get']({'plain':!![]});var _0x196842='Variables';return db[_0xdb44('0x22')][_0xdb44('0x23')]({'where':{'type':_0x196842,'resourceId':_0x3d80c5['id']}})['then'](function(){return _0x24ecf3;});})[_0xdb44('0x24')](function(){_0x2e8171[_0xdb44('0x16')](0xcc)[_0xdb44('0x17')]();});}};}function handleEntityNotFound(_0x3f5072,_0x2de6fb){return function(_0x114dd8){if(!_0x114dd8){_0x3f5072[_0xdb44('0x15')](0x194);}return _0x114dd8;};}function handleError(_0x21012f,_0x446364){_0x446364=_0x446364||0x1f4;return function(_0x2f5f81){logger[_0xdb44('0x25')](_0x2f5f81[_0xdb44('0x26')]);if(_0x2f5f81[_0xdb44('0x27')]){delete _0x2f5f81['name'];}_0x21012f['status'](_0x446364)[_0xdb44('0x28')](_0x2f5f81);};}exports[_0xdb44('0x29')]=function(_0x38fd9f,_0x32e356){var _0x4490e5={},_0x3f7b98={},_0x4a0310={'count':0x0,'rows':[]};var _0xfb7c09=_['map'](db[_0xdb44('0x2a')][_0xdb44('0x2b')],function(_0x1a7005){return{'name':_0x1a7005['fieldName'],'type':_0x1a7005[_0xdb44('0x2c')]['key']};});_0x3f7b98['model']=_[_0xdb44('0x2d')](_0xfb7c09,_0xdb44('0x27'));_0x3f7b98[_0xdb44('0x2e')]=_[_0xdb44('0x2f')](_0x38fd9f['query']);_0x3f7b98[_0xdb44('0x30')]=_['intersection'](_0x3f7b98[_0xdb44('0x31')],_0x3f7b98['query']);_0x4490e5[_0xdb44('0x32')]=_[_0xdb44('0x33')](_0x3f7b98[_0xdb44('0x31')],qs[_0xdb44('0x34')](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x34')]));_0x4490e5[_0xdb44('0x32')]=_0x4490e5[_0xdb44('0x32')]['length']?_0x4490e5[_0xdb44('0x32')]:_0x3f7b98[_0xdb44('0x31')];if(!_0x38fd9f[_0xdb44('0x2e')]['hasOwnProperty'](_0xdb44('0x35'))){_0x4490e5[_0xdb44('0x1a')]=qs[_0xdb44('0x1a')](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x1a')]);_0x4490e5[_0xdb44('0x18')]=qs[_0xdb44('0x18')](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x18')]);}_0x4490e5[_0xdb44('0x36')]=qs['sort'](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x37')]);_0x4490e5[_0xdb44('0x38')]=qs['filters'](_[_0xdb44('0x39')](_0x38fd9f['query'],_0x3f7b98[_0xdb44('0x30')]),_0xfb7c09);if(_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x3a')]){_0x4490e5['where']=_['merge'](_0x4490e5['where'],{'$or':_[_0xdb44('0x2d')](_0xfb7c09,function(_0x18c32b){if(_0x18c32b[_0xdb44('0x2c')]!=='VIRTUAL'){var _0x2d6358={};_0x2d6358[_0x18c32b[_0xdb44('0x27')]]={'$like':'%'+_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x3a')]+'%'};return _0x2d6358;}})});}_0x4490e5=_[_0xdb44('0x3b')]({},_0x4490e5,_0x38fd9f['options']);var _0x1d1b7a={'where':_0x4490e5[_0xdb44('0x38')]};return db[_0xdb44('0x2a')]['count'](_0x1d1b7a)[_0xdb44('0x24')](function(_0x22e9c4){_0x4a0310[_0xdb44('0x1b')]=_0x22e9c4;if(_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x3c')]){_0x4490e5[_0xdb44('0x3d')]=[{'all':!![]}];}return db['Variable'][_0xdb44('0x3e')](_0x4490e5);})[_0xdb44('0x24')](function(_0x357b3f){_0x4a0310[_0xdb44('0x3f')]=_0x357b3f;return _0x4a0310;})['then'](respondWithFilteredResult(_0x32e356,_0x4490e5))[_0xdb44('0x40')](handleError(_0x32e356,null));};exports[_0xdb44('0x41')]=function(_0x28f69a,_0x38e0a2){var _0x3d93ce={'raw':!![],'where':{'id':_0x28f69a[_0xdb44('0x42')]['id']}},_0x1d5f17={};_0x1d5f17['model']=_[_0xdb44('0x2f')](db[_0xdb44('0x2a')]['rawAttributes']);_0x1d5f17['query']=_[_0xdb44('0x2f')](_0x28f69a[_0xdb44('0x2e')]);_0x1d5f17['filters']=_[_0xdb44('0x33')](_0x1d5f17['model'],_0x1d5f17['query']);_0x3d93ce[_0xdb44('0x32')]=_['intersection'](_0x1d5f17[_0xdb44('0x31')],qs['fields'](_0x28f69a['query'][_0xdb44('0x34')]));_0x3d93ce['attributes']=_0x3d93ce['attributes'][_0xdb44('0x43')]?_0x3d93ce[_0xdb44('0x32')]:_0x1d5f17[_0xdb44('0x31')];if(_0x28f69a['query'][_0xdb44('0x3c')]){_0x3d93ce[_0xdb44('0x3d')]=[{'all':!![]}];}_0x3d93ce=_[_0xdb44('0x3b')]({},_0x3d93ce,_0x28f69a['options']);return db[_0xdb44('0x2a')][_0xdb44('0x44')](_0x3d93ce)[_0xdb44('0x24')](handleEntityNotFound(_0x38e0a2,null))[_0xdb44('0x24')](respondWithResult(_0x38e0a2,null))[_0xdb44('0x40')](handleError(_0x38e0a2,null));};exports[_0xdb44('0x45')]=function(_0x529019,_0x2a29a2){return db[_0xdb44('0x2a')]['create'](_0x529019[_0xdb44('0x46')],{})[_0xdb44('0x24')](function(_0x1c8713){var _0x1411bd=_0x529019[_0xdb44('0x47')][_0xdb44('0x48')]({'plain':!![]});if(!_0x1411bd)throw new Error(_0xdb44('0x49'));if(_0x1411bd[_0xdb44('0x4a')]===_0xdb44('0x47')){var _0xbb43d6=_0x1c8713[_0xdb44('0x48')]({'plain':!![]});var _0x17a586=_0xdb44('0x4b');return db[_0xdb44('0x4c')][_0xdb44('0x44')]({'where':{'name':_0x17a586,'userProfileId':_0x1411bd[_0xdb44('0x4d')]},'raw':!![]})[_0xdb44('0x24')](function(_0x12f5c3){if(_0x12f5c3&&_0x12f5c3[_0xdb44('0x4e')]===0x0){return db[_0xdb44('0x22')][_0xdb44('0x45')]({'name':_0xbb43d6[_0xdb44('0x27')],'resourceId':_0xbb43d6['id'],'type':_0x12f5c3[_0xdb44('0x27')],'sectionId':_0x12f5c3['id']},{})[_0xdb44('0x24')](function(){return _0x1c8713;});}else{return _0x1c8713;}})['catch'](function(_0x54fc37){logger[_0xdb44('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fc37);throw _0x54fc37;});}return _0x1c8713;})['then'](respondWithResult(_0x2a29a2,0xc9))[_0xdb44('0x40')](handleError(_0x2a29a2,null));};exports[_0xdb44('0x21')]=function(_0x5e64db,_0x2b4ac3){if(_0x5e64db[_0xdb44('0x46')]['id']){delete _0x5e64db[_0xdb44('0x46')]['id'];}return db['Variable'][_0xdb44('0x44')]({'where':{'id':_0x5e64db[_0xdb44('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b4ac3,null))[_0xdb44('0x24')](saveUpdates(_0x5e64db[_0xdb44('0x46')],null))['then'](respondWithResult(_0x2b4ac3,null))[_0xdb44('0x40')](handleError(_0x2b4ac3,null));};exports[_0xdb44('0x23')]=function(_0x21a7d5,_0x3115d9){return db[_0xdb44('0x2a')]['find']({'where':{'id':_0x21a7d5['params']['id']}})[_0xdb44('0x24')](handleEntityNotFound(_0x3115d9,null))['then'](removeEntity(_0x3115d9,null))[_0xdb44('0x40')](handleError(_0x3115d9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index bbc42b8..0a8cff9 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3858=['api','bluebird','rimraf','../../config/environment','define','util','../../config/logger'];(function(_0x2cc9fb,_0x114789){var _0x27f802=function(_0x4eab9d){while(--_0x4eab9d){_0x2cc9fb['push'](_0x2cc9fb['shift']());}};_0x27f802(++_0x114789);}(_0x3858,0x116));var _0x8385=function(_0x545c73,_0x1d886f){_0x545c73=_0x545c73-0x0;var _0x194561=_0x3858[_0x545c73];return _0x194561;};'use strict';var _=require('lodash');var util=require(_0x8385('0x0'));var logger=require(_0x8385('0x1'))(_0x8385('0x2'));var moment=require('moment');var BPromise=require(_0x8385('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8385('0x4'));var config=require(_0x8385('0x5'));var attributes=require('./variable.attributes');module['exports']=function(_0xe2f940,_0x4bdaee){return _0xe2f940[_0x8385('0x6')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d3a=['request-promise','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','util','api','moment','bluebird'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x8d3a,0x75));var _0xa8d3=function(_0x332d0a,_0x155185){_0x332d0a=_0x332d0a-0x0;var _0x13270f=_0x8d3a[_0x332d0a];return _0x13270f;};'use strict';var _=require('lodash');var util=require(_0xa8d3('0x0'));var logger=require('../../config/logger')(_0xa8d3('0x1'));var moment=require(_0xa8d3('0x2'));var BPromise=require(_0xa8d3('0x3'));var rp=require(_0xa8d3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8d3('0x5'));var config=require(_0xa8d3('0x6'));var attributes=require(_0xa8d3('0x7'));module['exports']=function(_0x57bbb2,_0x3ba805){return _0x57bbb2[_0xa8d3('0x8')](_0xa8d3('0x9'),attributes,{'tableName':_0xa8d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 2ac625e..3403053 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x37cb61,_0xa49d0){var _0x4ca1c7=function(_0x4201f9){while(--_0x4201f9){_0x37cb61['push'](_0x37cb61['shift']());}};_0x4ca1c7(++_0xa49d0);}(_0x3e74,0x175));var _0x43e7=function(_0x3156b9,_0x3127fb){_0x3156b9=_0x3156b9-0x0;var _0x592158=_0x3e74[_0x3156b9];return _0x592158;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x138144,_0x14a733){var _0x489bbd=function(_0x5324c1){while(--_0x5324c1){_0x138144['push'](_0x138144['shift']());}};_0x489bbd(++_0x14a733);}(_0xf494,0x1c6));var _0x4f49=function(_0x4fd23e,_0x28c245){_0x4fd23e=_0x4fd23e-0x0;var _0x3e6dfc=_0xf494[_0x4fd23e];return _0x3e6dfc;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3cfbdc3..195aa07 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d3f=['canUpdate','fetch','/reset','reset','/pull','pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated'];(function(_0x208bc9,_0x4f36f6){var _0x2675a8=function(_0x452e72){while(--_0x452e72){_0x208bc9['push'](_0x208bc9['shift']());}};_0x2675a8(++_0x4f36f6);}(_0x1d3f,0x196));var _0xf1d3=function(_0x2cf062,_0x3c15c6){_0x2cf062=_0x2cf062-0x0;var _0x376203=_0x1d3f[_0x2cf062];return _0x376203;};'use strict';var express=require(_0xf1d3('0x0'));var router=express[_0xf1d3('0x1')]();var auth=require(_0xf1d3('0x2'));var controller=require(_0xf1d3('0x3'));router['get']('/',controller[_0xf1d3('0x4')]);router[_0xf1d3('0x5')](_0xf1d3('0x6'),auth[_0xf1d3('0x7')](),auth[_0xf1d3('0x8')](),controller[_0xf1d3('0x9')]);router[_0xf1d3('0x5')](_0xf1d3('0xa'),auth[_0xf1d3('0x7')](),auth[_0xf1d3('0x8')](),controller[_0xf1d3('0xb')]);router['get'](_0xf1d3('0xc'),auth['isAuthenticated'](),auth[_0xf1d3('0x8')](),controller[_0xf1d3('0xd')]);router[_0xf1d3('0x5')]('/restart',auth[_0xf1d3('0x7')](),controller[_0xf1d3('0xe')]);router[_0xf1d3('0x5')](_0xf1d3('0xf'),controller[_0xf1d3('0x10')]);module[_0xf1d3('0x11')]=router; \ No newline at end of file +var _0x8b79=['migrations','exports','express','./version.controller','get','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','pull','/restart','/migrations'];(function(_0x2c3c90,_0x35da39){var _0x324c4a=function(_0x55a2b8){while(--_0x55a2b8){_0x2c3c90['push'](_0x2c3c90['shift']());}};_0x324c4a(++_0x35da39);}(_0x8b79,0x136));var _0x98b7=function(_0x29c773,_0xb8a852){_0x29c773=_0x29c773-0x0;var _0x2bfc4d=_0x8b79[_0x29c773];return _0x2bfc4d;};'use strict';var express=require(_0x98b7('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x98b7('0x1'));router['get']('/',controller['index']);router[_0x98b7('0x2')]('/fetch',auth['isAuthenticated'](),auth[_0x98b7('0x3')](),controller[_0x98b7('0x4')]);router[_0x98b7('0x2')](_0x98b7('0x5'),auth[_0x98b7('0x6')](),auth[_0x98b7('0x3')](),controller[_0x98b7('0x7')]);router[_0x98b7('0x2')](_0x98b7('0x8'),auth['isAuthenticated'](),auth[_0x98b7('0x3')](),controller[_0x98b7('0x9')]);router[_0x98b7('0x2')](_0x98b7('0xa'),auth[_0x98b7('0x6')](),controller['restart']);router[_0x98b7('0x2')](_0x98b7('0xb'),controller[_0x98b7('0xc')]);module[_0x98b7('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 476d67b..6cac9de 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x375a=['child_process','exec','../../mysqldb','../../config/pm2','simple-git','index','query','latest','fetch','tags','json','status','origin','master','error','info','reset','--hard','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','length','replace','exports','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.','.js','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions'];(function(_0x3072eb,_0x455321){var _0x55db4b=function(_0x333eda){while(--_0x333eda){_0x3072eb['push'](_0x3072eb['shift']());}};_0x55db4b(++_0x455321);}(_0x375a,0x94));var _0xa375=function(_0x375239,_0x25af14){_0x375239=_0x375239-0x0;var _0x11e43b=_0x375a[_0x375239];return _0x11e43b;};'use strict';var Umzug=require(_0xa375('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xa375('0x1'));var pkginfo=require(_0xa375('0x2'))(module,_0xa375('0x3'));var compareVersions=require(_0xa375('0x4'));var exec=require(_0xa375('0x5'))[_0xa375('0x6')];var db=require(_0xa375('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0xa375('0x8'));var logger=require('../../config/logger')('update');var git=require(_0xa375('0x9'))(config['root']);exports[_0xa375('0xa')]=function(_0x16ffef,_0x2340af){var _0x1a2d4d={'current':module['exports']['version'],'phonebar':0x2};if(_0x16ffef[_0xa375('0xb')]&&_0x16ffef[_0xa375('0xb')][_0xa375('0xc')]){return git[_0xa375('0xd')]()[_0xa375('0xe')](function(_0x85e4bd,_0x1ddf93){_0x1a2d4d[_0xa375('0xc')]=(_0x85e4bd?module['exports'][_0xa375('0x3')]:_0x1ddf93['latest'])||'2.0.0';return _0x2340af['status'](0xc8)[_0xa375('0xf')](_0x1a2d4d);});}else{return _0x2340af[_0xa375('0x10')](0xc8)[_0xa375('0xf')](_0x1a2d4d);}};exports[_0xa375('0xd')]=function(_0x5d6893,_0x4faf8b){return git['fetch']([_0xa375('0x11'),_0xa375('0x12')],function(_0x48da89){if(_0x48da89){logger[_0xa375('0x13')](_0x48da89);return _0x4faf8b[_0xa375('0x10')](0x1f4)[_0xa375('0xf')](_0x48da89);}logger[_0xa375('0x14')]('git\x20fetch');return _0x4faf8b['status'](0xc8)[_0xa375('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xa375('0x15')]=function(_0x3f68b9,_0xf12608){return git[_0xa375('0x15')]([_0xa375('0x16'),'FETCH_HEAD'],function(_0x4d4f14){if(_0x4d4f14){logger[_0xa375('0x13')](_0x4d4f14);return _0xf12608[_0xa375('0x10')](0x1f4)[_0xa375('0xf')](_0x4d4f14);}logger[_0xa375('0x14')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xf12608[_0xa375('0x10')](0xc8)[_0xa375('0xf')]({'output':_0xa375('0x17')});});};exports[_0xa375('0x18')]=function(_0x234656,_0x3b2207){exec(_0xa375('0x19'),function(_0x19ca2c,_0x541238,_0x780fa){logger[_0xa375('0x14')](_0x541238);logger[_0xa375('0x14')](_0x780fa);if(_0x19ca2c){logger[_0xa375('0x13')](_0x19ca2c);return _0x3b2207[_0xa375('0x10')](0x1f4)[_0xa375('0xf')](_0x19ca2c);}return _0x3b2207[_0xa375('0x10')](0xc8)[_0xa375('0xf')]({'output':_0x541238});});};exports[_0xa375('0x1a')]=function(_0x50f875,_0x302d2e){return pm2[_0xa375('0x1a')](_0xa375('0x1b'))[_0xa375('0x1c')](function(_0x4241c6){logger[_0xa375('0x14')](_0xa375('0x1d'),_0x4241c6);return _0x302d2e[_0xa375('0x10')](0xc8)['json']({'output':_0xa375('0x1e')});})['catch'](function(_0x2f73c1){logger['error'](_0x2f73c1);return _0x302d2e['status'](0x1f4)['json'](_0x2f73c1);});};exports[_0xa375('0x1f')]=function(_0x18ea9d,_0x188594){var _0x4f79ea=fs[_0xa375('0x20')](path[_0xa375('0x21')](config[_0xa375('0x22')],_0xa375('0x23'),_0xa375('0x1f')));var _0x4b500a=[];for(var _0x36f19e=0x0;_0x36f19e<_0x4f79ea[_0xa375('0x24')];_0x36f19e++){var _0x4c70d2=_0x4f79ea[_0x36f19e][_0xa375('0x25')]('.js','');if(compareVersions(module[_0xa375('0x26')][_0xa375('0x3')],_0x4c70d2)===-0x1){_0x4b500a[_0xa375('0x27')](_0x4c70d2);}}if(_0x4b500a[_0xa375('0x24')]){var _0x105845=_0x4b500a[_0xa375('0x28')](compareVersions);var _0x286c3d=new Umzug({'storage':_0xa375('0x29'),'storageOptions':{'model':db[_0xa375('0x2a')],'modelName':_0xa375('0x2a'),'columnName':_0xa375('0x3')},'migrations':{'params':[db[_0xa375('0x29')][_0xa375('0x2b')](),db[_0xa375('0x29')][_0xa375('0x2c')],function(){throw new Error(_0xa375('0x2d'));}],'path':path[_0xa375('0x21')](config['root'],'server',_0xa375('0x1f')),'pattern':/\.js$/}});_0x286c3d['up']({'migrations':_['map'](_0x105845,function(_0x1dd08c){return _0x1dd08c+_0xa375('0x2e');})})['then'](function(){return _0x188594[_0xa375('0x10')](0xc8)[_0xa375('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xa375('0x26')][_0xa375('0x3')]+_0xa375('0x2f')+_[_0xa375('0x30')](_0x105845),'migrations':_[_0xa375('0x21')](_0x105845)});})['catch'](function(_0x354512){if(_0x354512 instanceof db[_0xa375('0x29')][_0xa375('0x31')]){return _0x188594[_0xa375('0x10')](0xc8)['json']({'output':_0xa375('0x32')});}else{return _0x188594[_0xa375('0x10')](0x1f4)[_0xa375('0xf')](_0x354512);}});}else{return _0x188594['status'](0xc8)[_0xa375('0xf')]({'output':_0xa375('0x32')});}}; \ No newline at end of file +var _0x2827=['exports','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','migrations','replace','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../config/pm2','update','simple-git','index'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0x2827,0x9d));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require(_0x7282('0x0'));var path=require(_0x7282('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x7282('0x2'))(module,_0x7282('0x3'));var compareVersions=require(_0x7282('0x4'));var exec=require(_0x7282('0x5'))[_0x7282('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x7282('0x7'));var logger=require('../../config/logger')(_0x7282('0x8'));var git=require(_0x7282('0x9'))(config['root']);exports[_0x7282('0xa')]=function(_0x35aaf1,_0x158278){var _0x2b527f={'current':module[_0x7282('0xb')][_0x7282('0x3')],'phonebar':0x2};if(_0x35aaf1[_0x7282('0xc')]&&_0x35aaf1[_0x7282('0xc')][_0x7282('0xd')]){return git[_0x7282('0xe')]()[_0x7282('0xf')](function(_0x35ad76,_0x3c0040){_0x2b527f[_0x7282('0xd')]=(_0x35ad76?module[_0x7282('0xb')][_0x7282('0x3')]:_0x3c0040[_0x7282('0xd')])||_0x7282('0x10');return _0x158278[_0x7282('0x11')](0xc8)[_0x7282('0x12')](_0x2b527f);});}else{return _0x158278[_0x7282('0x11')](0xc8)[_0x7282('0x12')](_0x2b527f);}};exports[_0x7282('0xe')]=function(_0x7cfa6b,_0x3a90fc){return git['fetch']([_0x7282('0x13'),'master'],function(_0x39d00d){if(_0x39d00d){logger[_0x7282('0x14')](_0x39d00d);return _0x3a90fc[_0x7282('0x11')](0x1f4)[_0x7282('0x12')](_0x39d00d);}logger[_0x7282('0x15')](_0x7282('0x16'));return _0x3a90fc['status'](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x17')});});};exports['reset']=function(_0x12b33d,_0x7ee64d){return git['reset']([_0x7282('0x18'),_0x7282('0x19')],function(_0xf81efa){if(_0xf81efa){logger[_0x7282('0x14')](_0xf81efa);return _0x7ee64d['status'](0x1f4)['json'](_0xf81efa);}logger['info'](_0x7282('0x1a'));return _0x7ee64d[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x1b')});});};exports[_0x7282('0x1c')]=function(_0x2f0b36,_0x3f31c3){exec(_0x7282('0x1d'),function(_0x3cbaa1,_0x31dd73,_0x19a561){logger[_0x7282('0x15')](_0x31dd73);logger['info'](_0x19a561);if(_0x3cbaa1){logger[_0x7282('0x14')](_0x3cbaa1);return _0x3f31c3['status'](0x1f4)[_0x7282('0x12')](_0x3cbaa1);}return _0x3f31c3[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x31dd73});});};exports[_0x7282('0x1e')]=function(_0xe9d76f,_0x5844d9){return pm2['restart'](_0x7282('0x1f'))[_0x7282('0x20')](function(_0x121b9b){logger['info'](_0x7282('0x21'),_0x121b9b);return _0x5844d9[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x22')});})[_0x7282('0x23')](function(_0x3cda07){logger[_0x7282('0x14')](_0x3cda07);return _0x5844d9['status'](0x1f4)[_0x7282('0x12')](_0x3cda07);});};exports['migrations']=function(_0x4f1ef1,_0x48bc26){var _0x32cb91=fs[_0x7282('0x24')](path[_0x7282('0x25')](config[_0x7282('0x26')],'server',_0x7282('0x27')));var _0x15bf61=[];for(var _0xd21429=0x0;_0xd21429<_0x32cb91['length'];_0xd21429++){var _0x4320a7=_0x32cb91[_0xd21429][_0x7282('0x28')]('.js','');if(compareVersions(module[_0x7282('0xb')][_0x7282('0x3')],_0x4320a7)===-0x1){_0x15bf61[_0x7282('0x29')](_0x4320a7);}}if(_0x15bf61[_0x7282('0x2a')]){var _0x3863bb=_0x15bf61[_0x7282('0x2b')](compareVersions);var _0x1aaa10=new Umzug({'storage':_0x7282('0x2c'),'storageOptions':{'model':db[_0x7282('0x2d')],'modelName':_0x7282('0x2d'),'columnName':_0x7282('0x3')},'migrations':{'params':[db['sequelize'][_0x7282('0x2e')](),db[_0x7282('0x2c')][_0x7282('0x2f')],function(){throw new Error(_0x7282('0x30'));}],'path':path[_0x7282('0x25')](config[_0x7282('0x26')],_0x7282('0x31'),_0x7282('0x27')),'pattern':/\.js$/}});_0x1aaa10['up']({'migrations':_[_0x7282('0x32')](_0x3863bb,function(_0xbc7a1){return _0xbc7a1+_0x7282('0x33');})})['then'](function(){return _0x48bc26[_0x7282('0x11')](0xc8)['json']({'output':_0x7282('0x34')+module[_0x7282('0xb')][_0x7282('0x3')]+_0x7282('0x35')+_[_0x7282('0x36')](_0x3863bb),'migrations':_[_0x7282('0x25')](_0x3863bb)});})[_0x7282('0x23')](function(_0x567ec5){if(_0x567ec5 instanceof db[_0x7282('0x2c')]['UniqueConstraintError']){return _0x48bc26[_0x7282('0x11')](0xc8)['json']({'output':_0x7282('0x37')});}else{return _0x48bc26[_0x7282('0x11')](0x1f4)[_0x7282('0x12')](_0x567ec5);}});}else{return _0x48bc26[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 22b4f19..b99a517 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf06f=['/describe','isAuthenticated','describe','show','post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get'];(function(_0x281ef6,_0x3059d1){var _0x4e967f=function(_0x2cd142){while(--_0x2cd142){_0x281ef6['push'](_0x281ef6['shift']());}};_0x4e967f(++_0x3059d1);}(_0xf06f,0x15f));var _0xff06=function(_0x2ecc32,_0x5e7bbd){_0x2ecc32=_0x2ecc32-0x0;var _0x4b6781=_0xf06f[_0x2ecc32];return _0x4b6781;};'use strict';var multer=require(_0xff06('0x0'));var util=require(_0xff06('0x1'));var path=require(_0xff06('0x2'));var timeout=require(_0xff06('0x3'));var express=require(_0xff06('0x4'));var router=express['Router']();var fs_extra=require(_0xff06('0x5'));var auth=require(_0xff06('0x6'));var interaction=require(_0xff06('0x7'));var config=require('../../config/environment');var controller=require(_0xff06('0x8'));router[_0xff06('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff06('0x9')](_0xff06('0xa'),auth[_0xff06('0xb')](),controller[_0xff06('0xc')]);router[_0xff06('0x9')]('/:id',auth[_0xff06('0xb')](),controller[_0xff06('0xd')]);router[_0xff06('0xe')]('/',auth['isAuthenticated'](),controller[_0xff06('0xf')]);router['put'](_0xff06('0x10'),auth[_0xff06('0xb')](),controller['update']);router[_0xff06('0x11')](_0xff06('0x10'),auth[_0xff06('0xb')](),controller[_0xff06('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2f9e=['post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4b3358,_0x5cda77){var _0x1ea011=function(_0x1a17ea){while(--_0x1a17ea){_0x4b3358['push'](_0x4b3358['shift']());}};_0x1ea011(++_0x5cda77);}(_0x2f9e,0x117));var _0xe2f9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2f9e[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xe2f9('0x0'));var util=require(_0xe2f9('0x1'));var path=require('path');var timeout=require(_0xe2f9('0x2'));var express=require(_0xe2f9('0x3'));var router=express[_0xe2f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe2f9('0x5'));var interaction=require(_0xe2f9('0x6'));var config=require(_0xe2f9('0x7'));var controller=require(_0xe2f9('0x8'));router[_0xe2f9('0x9')]('/',auth[_0xe2f9('0xa')](),controller['index']);router[_0xe2f9('0x9')](_0xe2f9('0xb'),auth['isAuthenticated'](),controller[_0xe2f9('0xc')]);router[_0xe2f9('0x9')](_0xe2f9('0xd'),auth['isAuthenticated'](),controller[_0xe2f9('0xe')]);router[_0xe2f9('0xf')]('/',auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x10')]);router[_0xe2f9('0x11')](_0xe2f9('0xd'),auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x12')]);router['delete'](_0xe2f9('0xd'),auth['isAuthenticated'](),controller[_0xe2f9('0x13')]);module[_0xe2f9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index bdc427d..94d337f 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14b7=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x14b7,0x144));var _0x714b=function(_0x593fa0,_0x23b388){_0x593fa0=_0x593fa0-0x0;var _0x452eee=_0x14b7[_0x593fa0];return _0x452eee;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'type':{'type':Sequelize[_0x714b('0x2')]},'uniqueid':{'type':Sequelize[_0x714b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x714b('0x2')]},'queue':{'type':Sequelize[_0x714b('0x2')]},'interface':{'type':Sequelize[_0x714b('0x2')]},'membername':{'type':Sequelize[_0x714b('0x2')]},'agentcalledAt':{'type':Sequelize[_0x714b('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x714b('0x3')]},'agentdumpAt':{'type':Sequelize[_0x714b('0x3')]},'holdtime':{'type':Sequelize[_0x714b('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x714b('0x4')]},'agentacw':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x714b('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x714b('0x2')]},'channel':{'type':Sequelize[_0x714b('0x2')]},'channelstate':{'type':Sequelize[_0x714b('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x714b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x714b('0x2')]},'context':{'type':Sequelize[_0x714b('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x714b('0x2')]},'destchannel':{'type':Sequelize[_0x714b('0x2')]},'destchannelstate':{'type':Sequelize[_0x714b('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x714b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x714b('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x714b('0x2')]},'destlanguage':{'type':Sequelize[_0x714b('0x2')]},'destaccountcode':{'type':Sequelize[_0x714b('0x2')]},'destcontext':{'type':Sequelize[_0x714b('0x2')]},'destexten':{'type':Sequelize[_0x714b('0x2')]},'destpriority':{'type':Sequelize[_0x714b('0x2')]},'destuniqueid':{'type':Sequelize[_0x714b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x714b('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x714b('0x2')]},'transfer':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x714b('0x2')],'comment':_0x714b('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x714b('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c71=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x0c71,0xfb));var _0x10c7=function(_0x4f1e30,_0xa05885){_0x4f1e30=_0x4f1e30-0x0;var _0x13efa6=_0x0c71[_0x4f1e30];return _0x13efa6;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x10c7('0x1')]},'calleridnum':{'type':Sequelize[_0x10c7('0x1')]},'calleridname':{'type':Sequelize[_0x10c7('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x10c7('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x10c7('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x10c7('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x10c7('0x2')]},'agentdumpAt':{'type':Sequelize[_0x10c7('0x2')]},'holdtime':{'type':Sequelize[_0x10c7('0x3')]},'agentcomplete':{'type':Sequelize[_0x10c7('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x10c7('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x10c7('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x10c7('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x10c7('0x1')]},'channelstate':{'type':Sequelize[_0x10c7('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x10c7('0x1')]},'connectedlinename':{'type':Sequelize[_0x10c7('0x1')]},'language':{'type':Sequelize[_0x10c7('0x1')]},'accountcode':{'type':Sequelize[_0x10c7('0x1')]},'context':{'type':Sequelize[_0x10c7('0x1')]},'exten':{'type':Sequelize[_0x10c7('0x1')]},'priority':{'type':Sequelize[_0x10c7('0x1')]},'destchannel':{'type':Sequelize[_0x10c7('0x1')]},'destchannelstate':{'type':Sequelize[_0x10c7('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x10c7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x10c7('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x10c7('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x10c7('0x1')]},'destlanguage':{'type':Sequelize[_0x10c7('0x1')]},'destaccountcode':{'type':Sequelize[_0x10c7('0x1')]},'destcontext':{'type':Sequelize[_0x10c7('0x1')]},'destexten':{'type':Sequelize[_0x10c7('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x10c7('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x10c7('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x10c7('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x10c7('0x1')],'comment':_0x10c7('0x5')},'transferexten':{'type':Sequelize[_0x10c7('0x1')]},'transferuniqueid':{'type':Sequelize[_0x10c7('0x1')]},'agententerreason':{'type':Sequelize[_0x10c7('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index e3e05c3..5b69732 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index c79a3bf..36168e7 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x7995('0xc'),_0x7995('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79d3=['VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x79d3,0x15f));var _0x379d=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x79d3[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x379d('0x0'));var util=require('util');var logger=require(_0x379d('0x1'))('api');var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x4'));var rimraf=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var attributes=require(_0x379d('0x7'));module[_0x379d('0x8')]=function(_0x2078a6,_0x2a1b43){return _0x2078a6['define'](_0x379d('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x379d('0xa'),_0x379d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 492c211..531c42a 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x394d=['info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','then','UpdateVoiceAgentReport','body','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x394d,0xcd));var _0xd394=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x394d[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xd394('0x0'));var util=require(_0xd394('0x1'));var moment=require(_0xd394('0x2'));var BPromise=require(_0xd394('0x3'));var rs=require(_0xd394('0x4'));var fs=require('fs');var Redis=require(_0xd394('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd394('0x6'))(_0xd394('0x7'));var config=require(_0xd394('0x8'));var jayson=require(_0xd394('0x9'));var client=jayson[_0xd394('0xa')][_0xd394('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a4332,_0x1d4a0d,_0x30407e){return new BPromise(function(_0x2ce7d4,_0x30c299){return client['request'](_0x4a4332,_0x30407e)['then'](function(_0x4b8e73){logger[_0xd394('0xc')](_0xd394('0xd'),_0x1d4a0d,_0xd394('0xe'));logger[_0xd394('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1d4a0d,_0xd394('0xe'),JSON[_0xd394('0x10')](_0x4b8e73));if(_0x4b8e73[_0xd394('0x11')]){if(_0x4b8e73[_0xd394('0x11')][_0xd394('0x12')]===0x1f4){logger[_0xd394('0x11')](_0xd394('0xd'),_0x1d4a0d,_0x4b8e73[_0xd394('0x11')]['message']);return _0x30c299(_0x4b8e73['error'][_0xd394('0x13')]);}logger[_0xd394('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d4a0d,_0x4b8e73['error'][_0xd394('0x13')]);return _0x2ce7d4(_0x4b8e73[_0xd394('0x11')][_0xd394('0x13')]);}else{logger[_0xd394('0xc')](_0xd394('0xd'),_0x1d4a0d,_0xd394('0xe'));_0x2ce7d4(_0x4b8e73[_0xd394('0x14')][_0xd394('0x13')]);}})[_0xd394('0x15')](function(_0x3984e8){logger[_0xd394('0x11')](_0xd394('0xd'),_0x1d4a0d,_0x3984e8);_0x30c299(_0x3984e8);});});}exports[_0xd394('0x16')]=function(_0x52057a){var _0x26e68f=this;return new Promise(function(_0x5916e7,_0x3c92e2){return db[_0xd394('0x17')][_0xd394('0x18')](_0x52057a['body'],{'raw':_0x52057a[_0xd394('0x19')]?_0x52057a['options']['raw']===undefined?!![]:![]:!![]})[_0xd394('0x1a')](function(_0xd764cb){logger[_0xd394('0xc')](_0xd394('0x16'),_0x52057a);logger[_0xd394('0xf')](_0xd394('0x16'),_0x52057a,JSON[_0xd394('0x10')](_0xd764cb));_0x5916e7(_0xd764cb);})['catch'](function(_0x1ccc10){logger[_0xd394('0x11')](_0xd394('0x16'),_0x1ccc10[_0xd394('0x13')],_0x52057a);_0x3c92e2(_0x26e68f[_0xd394('0x11')](0x1f4,_0x1ccc10[_0xd394('0x13')]));});});};exports[_0xd394('0x1b')]=function(_0x4e9844){var _0x5a0c85=this;return new Promise(function(_0x3b1498,_0xb9f777){return db['VoiceAgentReport']['update'](_0x4e9844[_0xd394('0x1c')],{'raw':_0x4e9844[_0xd394('0x19')]?_0x4e9844['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9844[_0xd394('0x19')]?_0x4e9844['options']['where']||null:null,'attributes':_0x4e9844[_0xd394('0x19')]?_0x4e9844['options'][_0xd394('0x1d')]||null:null,'limit':_0x4e9844[_0xd394('0x19')]?_0x4e9844['options'][_0xd394('0x1e')]||null:null})[_0xd394('0x1a')](function(_0x596e1d){logger['info'](_0xd394('0x1b'),_0x4e9844);logger[_0xd394('0xf')]('UpdateVoiceAgentReport',_0x4e9844,JSON['stringify'](_0x596e1d));_0x3b1498(_0x596e1d);})[_0xd394('0x15')](function(_0x320519){logger[_0xd394('0x11')](_0xd394('0x1b'),_0x320519[_0xd394('0x13')],_0x4e9844);_0xb9f777(_0x5a0c85[_0xd394('0x11')](0x1f4,_0x320519['message']));});});}; \ No newline at end of file +var _0x903a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','options','catch','UpdateVoiceAgentReport','update','raw','attributes','limit','lodash'];(function(_0x2ee90c,_0x4337b2){var _0x3561fc=function(_0x5a27e9){while(--_0x5a27e9){_0x2ee90c['push'](_0x2ee90c['shift']());}};_0x3561fc(++_0x4337b2);}(_0x903a,0x19f));var _0xa903=function(_0x36ad3c,_0x33949d){_0x36ad3c=_0x36ad3c-0x0;var _0x23e226=_0x903a[_0x36ad3c];return _0x23e226;};'use strict';var _=require(_0xa903('0x0'));var util=require(_0xa903('0x1'));var moment=require(_0xa903('0x2'));var BPromise=require('bluebird');var rs=require(_0xa903('0x3'));var fs=require('fs');var Redis=require(_0xa903('0x4'));var db=require(_0xa903('0x5'))['db'];var utils=require(_0xa903('0x6'));var logger=require(_0xa903('0x7'))('rpc');var config=require(_0xa903('0x8'));var jayson=require(_0xa903('0x9'));var client=jayson[_0xa903('0xa')][_0xa903('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186d2b,_0x4c2d67,_0x200377){return new BPromise(function(_0x2f0cdb,_0x5d2f8b){return client['request'](_0x186d2b,_0x200377)[_0xa903('0xc')](function(_0x16a38f){logger[_0xa903('0xd')](_0xa903('0xe'),_0x4c2d67,_0xa903('0xf'));logger[_0xa903('0x10')](_0xa903('0x11'),_0x4c2d67,_0xa903('0xf'),JSON[_0xa903('0x12')](_0x16a38f));if(_0x16a38f['error']){if(_0x16a38f[_0xa903('0x13')]['code']===0x1f4){logger[_0xa903('0x13')](_0xa903('0xe'),_0x4c2d67,_0x16a38f['error']['message']);return _0x5d2f8b(_0x16a38f[_0xa903('0x13')]['message']);}logger['error'](_0xa903('0xe'),_0x4c2d67,_0x16a38f[_0xa903('0x13')][_0xa903('0x14')]);return _0x2f0cdb(_0x16a38f[_0xa903('0x13')]['message']);}else{logger[_0xa903('0xd')](_0xa903('0xe'),_0x4c2d67,_0xa903('0xf'));_0x2f0cdb(_0x16a38f[_0xa903('0x15')][_0xa903('0x14')]);}})['catch'](function(_0x2cc4fc){logger[_0xa903('0x13')](_0xa903('0xe'),_0x4c2d67,_0x2cc4fc);_0x5d2f8b(_0x2cc4fc);});});}exports[_0xa903('0x16')]=function(_0x1799fc){var _0x285a49=this;return new Promise(function(_0x230c1a,_0x373bc2){return db[_0xa903('0x17')]['create'](_0x1799fc[_0xa903('0x18')],{'raw':_0x1799fc['options']?_0x1799fc[_0xa903('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xa53aac){logger['info'](_0xa903('0x16'),_0x1799fc);logger[_0xa903('0x10')](_0xa903('0x16'),_0x1799fc,JSON[_0xa903('0x12')](_0xa53aac));_0x230c1a(_0xa53aac);})[_0xa903('0x1a')](function(_0x140cb3){logger[_0xa903('0x13')](_0xa903('0x16'),_0x140cb3[_0xa903('0x14')],_0x1799fc);_0x373bc2(_0x285a49['error'](0x1f4,_0x140cb3['message']));});});};exports[_0xa903('0x1b')]=function(_0xaab2e6){var _0x41abf5=this;return new Promise(function(_0x17e126,_0x34c134){return db[_0xa903('0x17')][_0xa903('0x1c')](_0xaab2e6[_0xa903('0x18')],{'raw':_0xaab2e6[_0xa903('0x19')]?_0xaab2e6[_0xa903('0x19')][_0xa903('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaab2e6[_0xa903('0x19')]?_0xaab2e6['options']['where']||null:null,'attributes':_0xaab2e6['options']?_0xaab2e6[_0xa903('0x19')][_0xa903('0x1e')]||null:null,'limit':_0xaab2e6[_0xa903('0x19')]?_0xaab2e6['options'][_0xa903('0x1f')]||null:null})[_0xa903('0xc')](function(_0x248d46){logger[_0xa903('0xd')]('UpdateVoiceAgentReport',_0xaab2e6);logger[_0xa903('0x10')](_0xa903('0x1b'),_0xaab2e6,JSON['stringify'](_0x248d46));_0x17e126(_0x248d46);})['catch'](function(_0x2b4579){logger[_0xa903('0x13')](_0xa903('0x1b'),_0x2b4579[_0xa903('0x14')],_0xaab2e6);_0x34c134(_0x41abf5[_0xa903('0x13')](0x1f4,_0x2b4579[_0xa903('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 14f3fc2..53fe735 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','util','path','express','Router'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_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']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x20c0('0x9')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0xe')]('/',auth[_0x20c0('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x20c0('0xf')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x425d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1eb786,_0x1b5f72){var _0x460cad=function(_0x3ec7a6){while(--_0x3ec7a6){_0x1eb786['push'](_0x1eb786['shift']());}};_0x460cad(++_0x1b5f72);}(_0x425d,0x1e0));var _0xd425=function(_0x370be6,_0x17c8c8){_0x370be6=_0x370be6-0x0;var _0xb512b2=_0x425d[_0x370be6];return _0xb512b2;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x14')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x15')]);module[_0xd425('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 1d29c33..76e7237 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe195=['dialer','TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal','outbound','outbound-fax'];(function(_0x31bad1,_0x163160){var _0x30c64e=function(_0x1c0df5){while(--_0x1c0df5){_0x31bad1['push'](_0x31bad1['shift']());}};_0x30c64e(++_0x163160);}(_0xe195,0x1c6));var _0x5e19=function(_0x45a9be,_0x584397){_0x45a9be=_0x45a9be-0x0;var _0x1dbafb=_0xe195[_0x45a9be];return _0x1dbafb;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5e19('0x0')]},'type':{'type':Sequelize[_0x5e19('0x1')](_0x5e19('0x2'),_0x5e19('0x3'),_0x5e19('0x4'),'inbound-fax',_0x5e19('0x5'),_0x5e19('0x6'))},'tag':{'type':Sequelize[_0x5e19('0x0')]},'accountcode':{'type':Sequelize[_0x5e19('0x0')]},'source':{'type':Sequelize[_0x5e19('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x5e19('0x0')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5e19('0x0')]},'destinationchannel':{'type':Sequelize[_0x5e19('0x0')]},'lastapplication':{'type':Sequelize[_0x5e19('0x0')]},'lastdata':{'type':Sequelize[_0x5e19('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x5e19('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5e19('0x8')]},'duration':{'type':Sequelize[_0x5e19('0x9')]},'billableseconds':{'type':Sequelize[_0x5e19('0x9')]},'mohtime':{'type':Sequelize[_0x5e19('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e19('0x0')]},'amaflags':{'type':Sequelize[_0x5e19('0x0')]},'userfield':{'type':Sequelize[_0x5e19('0x0')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x5e19('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x5e19('0x0')]},'note':{'type':Sequelize[_0x5e19('0x0')]},'prefix':{'type':Sequelize[_0x5e19('0x0')]},'routeid':{'type':Sequelize[_0x5e19('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac8e=['ENUM','inbound','internal','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x2bd9cd,_0x58d8f0){var _0x5f21cb=function(_0x8e8001){while(--_0x8e8001){_0x2bd9cd['push'](_0x2bd9cd['shift']());}};_0x5f21cb(++_0x58d8f0);}(_0xac8e,0x19f));var _0xeac8=function(_0x2eec9b,_0x2f6dbc){_0x2eec9b=_0x2eec9b-0x0;var _0x2910d1=_0xac8e[_0x2eec9b];return _0x2910d1;};'use strict';var Sequelize=require(_0xeac8('0x0'));module[_0xeac8('0x1')]={'uniqueid':{'type':Sequelize[_0xeac8('0x2')]},'type':{'type':Sequelize[_0xeac8('0x3')](_0xeac8('0x4'),_0xeac8('0x5'),'outbound',_0xeac8('0x6'),'outbound-fax',_0xeac8('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xeac8('0x2')]},'destination':{'type':Sequelize[_0xeac8('0x2')]},'destinationcontext':{'type':Sequelize[_0xeac8('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xeac8('0x2')]},'destinationchannel':{'type':Sequelize[_0xeac8('0x2')]},'lastapplication':{'type':Sequelize[_0xeac8('0x2')]},'lastdata':{'type':Sequelize[_0xeac8('0x8')]},'starttime':{'type':Sequelize[_0xeac8('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xeac8('0x9')]},'endtime':{'type':Sequelize[_0xeac8('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xeac8('0xa')]},'mohtime':{'type':Sequelize[_0xeac8('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xeac8('0x2')]},'amaflags':{'type':Sequelize[_0xeac8('0x2')]},'userfield':{'type':Sequelize[_0xeac8('0x2')]},'userDisposition':{'type':Sequelize[_0xeac8('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xeac8('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xeac8('0x2')]},'note':{'type':Sequelize[_0xeac8('0x2')]},'prefix':{'type':Sequelize[_0xeac8('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xeac8('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index de7f0d6..7476379 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x2ef3,0xba));var _0x32ef=function(_0x29dac1,_0xce1f83){_0x29dac1=_0x29dac1-0x0;var _0x1f4e4b=_0x2ef3[_0x29dac1];return _0x1f4e4b;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x4f2729,_0x1b08a6){var _0x1fdcd6=function(_0x31f5bb){while(--_0x31f5bb){_0x4f2729['push'](_0x4f2729['shift']());}};_0x1fdcd6(++_0x1b08a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x239650,_0x56aeda){_0x239650=_0x239650-0x0;var _0xee0bd6=_0xb10b[_0x239650];return _0xee0bd6;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index b1a30fc..4e3155d 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2df=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x1c0fc3,_0x3537bb){var _0x338237=function(_0x4ebb72){while(--_0x4ebb72){_0x1c0fc3['push'](_0x1c0fc3['shift']());}};_0x338237(++_0x3537bb);}(_0xc2df,0x197));var _0xfc2d=function(_0xf177bd,_0x5869d8){_0xf177bd=_0xf177bd-0x0;var _0x3319e1=_0xc2df[_0xf177bd];return _0x3319e1;};'use strict';var _=require(_0xfc2d('0x0'));var util=require(_0xfc2d('0x1'));var logger=require('../../config/logger')(_0xfc2d('0x2'));var moment=require(_0xfc2d('0x3'));var BPromise=require(_0xfc2d('0x4'));var rp=require(_0xfc2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc2d('0x6'));var config=require(_0xfc2d('0x7'));var attributes=require(_0xfc2d('0x8'));module['exports']=function(_0x2ad876,_0x501529){return _0x2ad876['define'](_0xfc2d('0x9'),attributes,{'tableName':_0xfc2d('0xa'),'paranoid':![],'indexes':[{'fields':[_0xfc2d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11d9=['define','report_call','uniqueid','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3d9ba7,_0x1c8b5f){var _0x4621ce=function(_0x5e3283){while(--_0x5e3283){_0x3d9ba7['push'](_0x3d9ba7['shift']());}};_0x4621ce(++_0x1c8b5f);}(_0x11d9,0x87));var _0x911d=function(_0x51be87,_0x4ff2ac){_0x51be87=_0x51be87-0x0;var _0xc9426f=_0x11d9[_0x51be87];return _0xc9426f;};'use strict';var _=require(_0x911d('0x0'));var util=require(_0x911d('0x1'));var logger=require('../../config/logger')(_0x911d('0x2'));var moment=require('moment');var BPromise=require(_0x911d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x911d('0x4'));var rimraf=require(_0x911d('0x5'));var config=require(_0x911d('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x911d('0x7')]=function(_0x5c7b5e,_0x2ec9c5){return _0x5c7b5e[_0x911d('0x8')]('VoiceCallReport',attributes,{'tableName':_0x911d('0x9'),'paranoid':![],'indexes':[{'fields':[_0x911d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 09b0a84..114b74d 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aca=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceCallReport','findAll','options','raw','where','attributes','map','include','model','then','GetVoiceCallReport','debug','stringify','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','body','lodash','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7aca,0x67));var _0xa7ac=function(_0x1dcd38,_0x4199d0){_0x1dcd38=_0x1dcd38-0x0;var _0x5743c2=_0x7aca[_0x1dcd38];return _0x5743c2;};'use strict';var _=require(_0xa7ac('0x0'));var util=require(_0xa7ac('0x1'));var moment=require('moment');var BPromise=require(_0xa7ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7ac('0x3'));var db=require(_0xa7ac('0x4'))['db'];var utils=require(_0xa7ac('0x5'));var logger=require('../../config/logger')(_0xa7ac('0x6'));var config=require('../../config/environment');var jayson=require(_0xa7ac('0x7'));var client=jayson['client'][_0xa7ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ad2a2,_0x34a266,_0xa3e230){return new BPromise(function(_0x2dea8f,_0x3d0fe2){return client[_0xa7ac('0x9')](_0x4ad2a2,_0xa3e230)['then'](function(_0x582795){logger[_0xa7ac('0xa')](_0xa7ac('0xb'),_0x34a266,'request\x20sent');logger['debug'](_0xa7ac('0xc'),_0x34a266,_0xa7ac('0xd'),JSON['stringify'](_0x582795));if(_0x582795[_0xa7ac('0xe')]){if(_0x582795[_0xa7ac('0xe')][_0xa7ac('0xf')]===0x1f4){logger[_0xa7ac('0xe')](_0xa7ac('0xb'),_0x34a266,_0x582795[_0xa7ac('0xe')][_0xa7ac('0x10')]);return _0x3d0fe2(_0x582795[_0xa7ac('0xe')]['message']);}logger[_0xa7ac('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x34a266,_0x582795[_0xa7ac('0xe')][_0xa7ac('0x10')]);return _0x2dea8f(_0x582795[_0xa7ac('0xe')][_0xa7ac('0x10')]);}else{logger[_0xa7ac('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x34a266,_0xa7ac('0xd'));_0x2dea8f(_0x582795['result']['message']);}})['catch'](function(_0x180376){logger[_0xa7ac('0xe')](_0xa7ac('0xb'),_0x34a266,_0x180376);_0x3d0fe2(_0x180376);});});}exports['GetVoiceCallReport']=function(_0x365c9d){var _0x396d4a=this;return new Promise(function(_0x44d16d,_0x4877e4){return db[_0xa7ac('0x11')][_0xa7ac('0x12')]({'raw':_0x365c9d[_0xa7ac('0x13')]?_0x365c9d[_0xa7ac('0x13')][_0xa7ac('0x14')]===undefined?!![]:![]:!![],'where':_0x365c9d[_0xa7ac('0x13')]?_0x365c9d[_0xa7ac('0x13')][_0xa7ac('0x15')]||null:null,'attributes':_0x365c9d[_0xa7ac('0x13')]?_0x365c9d[_0xa7ac('0x13')][_0xa7ac('0x16')]||null:null,'limit':_0x365c9d[_0xa7ac('0x13')]?_0x365c9d['options']['limit']||null:null,'include':_0x365c9d[_0xa7ac('0x13')]?_0x365c9d[_0xa7ac('0x13')]['include']?_[_0xa7ac('0x17')](_0x365c9d['options'][_0xa7ac('0x18')],function(_0x94d3c3){return{'model':db[_0x94d3c3[_0xa7ac('0x19')]],'as':_0x94d3c3['as'],'attributes':_0x94d3c3['attributes'],'include':_0x94d3c3[_0xa7ac('0x18')]?_['map'](_0x94d3c3['include'],function(_0xe120f2){return{'model':db[_0xe120f2[_0xa7ac('0x19')]],'as':_0xe120f2['as'],'attributes':_0xe120f2['attributes'],'include':_0xe120f2['include']?_[_0xa7ac('0x17')](_0xe120f2[_0xa7ac('0x18')],function(_0x5d41a6){return{'model':db[_0x5d41a6[_0xa7ac('0x19')]],'as':_0x5d41a6['as'],'attributes':_0x5d41a6[_0xa7ac('0x16')]};}):[]};}):[]};}):[]:[]})[_0xa7ac('0x1a')](function(_0x3bad21){logger['info'](_0xa7ac('0x1b'),_0x365c9d);logger[_0xa7ac('0x1c')](_0xa7ac('0x1b'),_0x365c9d,JSON[_0xa7ac('0x1d')](_0x3bad21));_0x44d16d(_0x3bad21);})[_0xa7ac('0x1e')](function(_0x3cfb34){logger[_0xa7ac('0xe')]('GetVoiceCallReport',_0x3cfb34['message'],_0x365c9d);_0x4877e4(_0x396d4a[_0xa7ac('0xe')](0x1f4,_0x3cfb34['message']));});});};exports[_0xa7ac('0x1f')]=function(_0x1ba33d){var _0x5c3ca5=this;return new Promise(function(_0x4274e2,_0x1b4dd9){return db[_0xa7ac('0x11')][_0xa7ac('0x20')](_0x1ba33d['body'],{'raw':_0x1ba33d[_0xa7ac('0x13')]?_0x1ba33d[_0xa7ac('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xa7ac('0x1a')](function(_0x39d625){logger[_0xa7ac('0xa')]('CreateVoiceCallReport',_0x1ba33d);logger[_0xa7ac('0x1c')](_0xa7ac('0x1f'),_0x1ba33d,JSON['stringify'](_0x39d625));_0x4274e2(_0x39d625);})['catch'](function(_0x579ff3){logger['error'](_0xa7ac('0x1f'),_0x579ff3['message'],_0x1ba33d);_0x1b4dd9(_0x5c3ca5[_0xa7ac('0xe')](0x1f4,_0x579ff3[_0xa7ac('0x10')]));});});};exports[_0xa7ac('0x21')]=function(_0x50fe51){var _0x291bae=this;return new Promise(function(_0x4531ff,_0xd7c69d){return db[_0xa7ac('0x11')]['update'](_0x50fe51[_0xa7ac('0x22')],{'raw':_0x50fe51[_0xa7ac('0x13')]?_0x50fe51[_0xa7ac('0x13')][_0xa7ac('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50fe51['options']?_0x50fe51[_0xa7ac('0x13')]['where']||null:null,'attributes':_0x50fe51[_0xa7ac('0x13')]?_0x50fe51[_0xa7ac('0x13')]['attributes']||null:null,'limit':_0x50fe51['options']?_0x50fe51[_0xa7ac('0x13')]['limit']||null:null})['then'](function(_0x2b89a0){logger[_0xa7ac('0xa')](_0xa7ac('0x21'),_0x50fe51);logger[_0xa7ac('0x1c')](_0xa7ac('0x21'),_0x50fe51,JSON[_0xa7ac('0x1d')](_0x2b89a0));_0x4531ff(_0x2b89a0);})[_0xa7ac('0x1e')](function(_0xf054c){logger['error']('UpdateVoiceCallReport',_0xf054c['message'],_0x50fe51);_0xd7c69d(_0x291bae[_0xa7ac('0xe')](0x1f4,_0xf054c[_0xa7ac('0x10')]));});});}; \ No newline at end of file +var _0x8066=['map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include'];(function(_0x2edc72,_0x5b1576){var _0x43d470=function(_0x4707d6){while(--_0x4707d6){_0x2edc72['push'](_0x2edc72['shift']());}};_0x43d470(++_0x5b1576);}(_0x8066,0x127));var _0x6806=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x8066[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rs=require(_0x6806('0x4'));var fs=require('fs');var Redis=require(_0x6806('0x5'));var db=require(_0x6806('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6806('0x7'));var jayson=require(_0x6806('0x8'));var client=jayson[_0x6806('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b7ab3,_0x493245,_0x1eb93a){return new BPromise(function(_0x40bea8,_0x2186b5){return client[_0x6806('0xa')](_0x4b7ab3,_0x1eb93a)[_0x6806('0xb')](function(_0x90faf){logger[_0x6806('0xc')](_0x6806('0xd'),_0x493245,_0x6806('0xe'));logger[_0x6806('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x493245,_0x6806('0xe'),JSON[_0x6806('0x10')](_0x90faf));if(_0x90faf['error']){if(_0x90faf[_0x6806('0x11')]['code']===0x1f4){logger['error'](_0x6806('0xd'),_0x493245,_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);return _0x2186b5(_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);}logger[_0x6806('0x11')](_0x6806('0xd'),_0x493245,_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);return _0x40bea8(_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);}else{logger[_0x6806('0xc')](_0x6806('0xd'),_0x493245,'request\x20sent');_0x40bea8(_0x90faf[_0x6806('0x13')][_0x6806('0x12')]);}})[_0x6806('0x14')](function(_0x168e4d){logger[_0x6806('0x11')](_0x6806('0xd'),_0x493245,_0x168e4d);_0x2186b5(_0x168e4d);});});}exports[_0x6806('0x15')]=function(_0x362883){var _0x1dd52a=this;return new Promise(function(_0x26a284,_0x4b73de){return db[_0x6806('0x16')][_0x6806('0x17')]({'raw':_0x362883[_0x6806('0x18')]?_0x362883[_0x6806('0x18')][_0x6806('0x19')]===undefined?!![]:![]:!![],'where':_0x362883[_0x6806('0x18')]?_0x362883['options'][_0x6806('0x1a')]||null:null,'attributes':_0x362883['options']?_0x362883[_0x6806('0x18')][_0x6806('0x1b')]||null:null,'limit':_0x362883['options']?_0x362883[_0x6806('0x18')]['limit']||null:null,'include':_0x362883[_0x6806('0x18')]?_0x362883['options'][_0x6806('0x1c')]?_['map'](_0x362883[_0x6806('0x18')][_0x6806('0x1c')],function(_0x4daf36){return{'model':db[_0x4daf36['model']],'as':_0x4daf36['as'],'attributes':_0x4daf36[_0x6806('0x1b')],'include':_0x4daf36[_0x6806('0x1c')]?_[_0x6806('0x1d')](_0x4daf36[_0x6806('0x1c')],function(_0x221335){return{'model':db[_0x221335[_0x6806('0x1e')]],'as':_0x221335['as'],'attributes':_0x221335[_0x6806('0x1b')],'include':_0x221335[_0x6806('0x1c')]?_[_0x6806('0x1d')](_0x221335[_0x6806('0x1c')],function(_0x3a5da0){return{'model':db[_0x3a5da0[_0x6806('0x1e')]],'as':_0x3a5da0['as'],'attributes':_0x3a5da0[_0x6806('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bafd3){logger[_0x6806('0xc')](_0x6806('0x15'),_0x362883);logger[_0x6806('0xf')](_0x6806('0x15'),_0x362883,JSON[_0x6806('0x10')](_0x1bafd3));_0x26a284(_0x1bafd3);})[_0x6806('0x14')](function(_0x50633f){logger[_0x6806('0x11')](_0x6806('0x15'),_0x50633f[_0x6806('0x12')],_0x362883);_0x4b73de(_0x1dd52a[_0x6806('0x11')](0x1f4,_0x50633f[_0x6806('0x12')]));});});};exports[_0x6806('0x1f')]=function(_0x593e13){var _0x23051c=this;return new Promise(function(_0x437c96,_0x576241){return db[_0x6806('0x16')][_0x6806('0x20')](_0x593e13[_0x6806('0x21')],{'raw':_0x593e13[_0x6806('0x18')]?_0x593e13[_0x6806('0x18')][_0x6806('0x19')]===undefined?!![]:![]:!![]})[_0x6806('0xb')](function(_0x45043d){logger[_0x6806('0xc')](_0x6806('0x1f'),_0x593e13);logger[_0x6806('0xf')]('CreateVoiceCallReport',_0x593e13,JSON['stringify'](_0x45043d));_0x437c96(_0x45043d);})[_0x6806('0x14')](function(_0x3c4dd7){logger['error'](_0x6806('0x1f'),_0x3c4dd7[_0x6806('0x12')],_0x593e13);_0x576241(_0x23051c[_0x6806('0x11')](0x1f4,_0x3c4dd7[_0x6806('0x12')]));});});};exports[_0x6806('0x22')]=function(_0x52edac){var _0x35d44d=this;return new Promise(function(_0x1e6bb5,_0x57cecd){return db[_0x6806('0x16')]['update'](_0x52edac[_0x6806('0x21')],{'raw':_0x52edac[_0x6806('0x18')]?_0x52edac[_0x6806('0x18')][_0x6806('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52edac[_0x6806('0x18')]?_0x52edac['options'][_0x6806('0x1a')]||null:null,'attributes':_0x52edac['options']?_0x52edac[_0x6806('0x18')][_0x6806('0x1b')]||null:null,'limit':_0x52edac['options']?_0x52edac[_0x6806('0x18')][_0x6806('0x23')]||null:null})[_0x6806('0xb')](function(_0x528102){logger['info'](_0x6806('0x22'),_0x52edac);logger[_0x6806('0xf')]('UpdateVoiceCallReport',_0x52edac,JSON['stringify'](_0x528102));_0x1e6bb5(_0x528102);})[_0x6806('0x14')](function(_0x51ba19){logger[_0x6806('0x11')](_0x6806('0x22'),_0x51ba19['message'],_0x52edac);_0x57cecd(_0x35d44d[_0x6806('0x11')](0x1f4,_0x51ba19[_0x6806('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 2a0b912..85793d2 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46f4=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46f4,0xe6));var _0x446f=function(_0x21444c,_0x12e8ad){_0x21444c=_0x21444c-0x0;var _0x5bbc48=_0x46f4[_0x21444c];return _0x5bbc48;};'use strict';var multer=require(_0x446f('0x0'));var util=require(_0x446f('0x1'));var path=require(_0x446f('0x2'));var timeout=require('connect-timeout');var express=require(_0x446f('0x3'));var router=express[_0x446f('0x4')]();var fs_extra=require(_0x446f('0x5'));var auth=require(_0x446f('0x6'));var interaction=require(_0x446f('0x7'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x446f('0x8')]('/',auth[_0x446f('0x9')](),controller[_0x446f('0xa')]);router[_0x446f('0x8')](_0x446f('0xb'),auth['isAuthenticated'](),controller[_0x446f('0xc')]);router[_0x446f('0xd')]('/',auth[_0x446f('0x9')](),controller['create']);router[_0x446f('0xe')](_0x446f('0xb'),auth[_0x446f('0x9')](),controller[_0x446f('0xf')]);router[_0x446f('0x10')]('/:id',auth[_0x446f('0x9')](),controller[_0x446f('0x11')]);module[_0x446f('0x12')]=router; \ No newline at end of file +var _0x471e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','/:id','show','create','put','update','destroy','multer','util'];(function(_0x26578c,_0x286c7e){var _0x52ce85=function(_0x2e03f7){while(--_0x2e03f7){_0x26578c['push'](_0x26578c['shift']());}};_0x52ce85(++_0x286c7e);}(_0x471e,0x1ce));var _0xe471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe471('0x0'));var util=require(_0xe471('0x1'));var path=require('path');var timeout=require(_0xe471('0x2'));var express=require('express');var router=express[_0xe471('0x3')]();var fs_extra=require(_0xe471('0x4'));var auth=require(_0xe471('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe471('0x6'));var controller=require(_0xe471('0x7'));router['get']('/',auth[_0xe471('0x8')](),controller[_0xe471('0x9')]);router['get'](_0xe471('0xa'),auth[_0xe471('0x8')](),controller[_0xe471('0xb')]);router['post']('/',auth[_0xe471('0x8')](),controller[_0xe471('0xc')]);router[_0xe471('0xd')](_0xe471('0xa'),auth['isAuthenticated'](),controller[_0xe471('0xe')]);router['delete']('/:id',auth[_0xe471('0x8')](),controller[_0xe471('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ee08051..817d6b6 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x325d=['getDataValue','BOOLEAN','exports','STRING','setDataValue','options','join'];(function(_0x204910,_0x28cbbb){var _0x4db9cd=function(_0x326232){while(--_0x326232){_0x204910['push'](_0x204910['shift']());}};_0x4db9cd(++_0x28cbbb);}(_0x325d,0x167));var _0xd325=function(_0xef9210,_0x57bc5){_0xef9210=_0xef9210-0x0;var _0x5c24c5=_0x325d[_0xef9210];return _0x5c24c5;};'use strict';var Sequelize=require('sequelize');module[_0xd325('0x0')]={'name':{'type':Sequelize[_0xd325('0x1')]},'prefix':{'type':Sequelize[_0xd325('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xd325('0x1')],'set':function(_0xcc5ec9){this[_0xd325('0x2')](_0xd325('0x3'),_0xcc5ec9?_0xcc5ec9[_0xd325('0x4')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0xd325('0x5')](_0xd325('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0xd325('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xd325('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd325('0x1')]},'description':{'type':Sequelize[_0xd325('0x1')]}}; \ No newline at end of file +var _0xea61=['sequelize','STRING','name','join','getDataValue','options','split','BOOLEAN'];(function(_0x58a946,_0x40a9d9){var _0x3de861=function(_0x2d6808){while(--_0x2d6808){_0x58a946['push'](_0x58a946['shift']());}};_0x3de861(++_0x40a9d9);}(_0xea61,0xc0));var _0x1ea6=function(_0x556964,_0x79cf6b){_0x556964=_0x556964-0x0;var _0x3615cb=_0xea61[_0x556964];return _0x3615cb;};'use strict';var Sequelize=require(_0x1ea6('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ea6('0x1')]},'prefix':{'type':Sequelize[_0x1ea6('0x1')],'unique':_0x1ea6('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x1ea6('0x1')],'set':function(_0x322bbb){this['setDataValue']('options',_0x322bbb?_0x322bbb[_0x1ea6('0x3')](''):[]);},'get':function(){return this[_0x1ea6('0x4')]('options')?this['getDataValue'](_0x1ea6('0x5'))[_0x1ea6('0x6')](''):[];}},'auth':{'type':Sequelize[_0x1ea6('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1ea6('0x1')]},'description':{'type':Sequelize[_0x1ea6('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index b363cfe..c8b7474 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8164=['save','update','then','destroy','get','ChanSpies','stack','name','send','index','VoiceChanSpy','rawAttributes','type','key','model','map','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x4f77dc,_0x2ef0c1){var _0xb9053=function(_0x369773){while(--_0x369773){_0x4f77dc['push'](_0x4f77dc['shift']());}};_0xb9053(++_0x2ef0c1);}(_0x8164,0x170));var _0x4816=function(_0x40b241,_0x2ce6cc){_0x40b241=_0x40b241-0x0;var _0x22b4b1=_0x8164[_0x40b241];return _0x22b4b1;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c173b,_0x51a5f8){_0x51a5f8=_0x51a5f8||0xcc;return function(_0x5c4d42){if(_0x5c4d42){return _0x3c173b[_0x4816('0x15')](_0x51a5f8);}return _0x3c173b['status'](_0x51a5f8)[_0x4816('0x16')]();};}function respondWithResult(_0x2554b4,_0x13a685){_0x13a685=_0x13a685||0xc8;return function(_0x316f36){if(_0x316f36){return _0x2554b4[_0x4816('0x17')](_0x13a685)[_0x4816('0x18')](_0x316f36);}};}function respondWithFilteredResult(_0x1eb683,_0x2a58b7){return function(_0x45c006){if(_0x45c006){var _0x21354c=typeof _0x2a58b7[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x2a58b7[_0x4816('0x1b')]===_0x4816('0x1a');var _0x1961a5=_0x45c006[_0x4816('0x1c')];var _0x4803d0=_0x21354c?0x0:_0x2a58b7['offset'];var _0x8d4393=_0x21354c?_0x45c006[_0x4816('0x1c')]:_0x2a58b7[_0x4816('0x19')]+_0x2a58b7[_0x4816('0x1b')];var _0xc8ffd5;if(_0x8d4393>=_0x1961a5){_0x8d4393=_0x1961a5;_0xc8ffd5=0xc8;}else{_0xc8ffd5=0xce;}_0x1eb683[_0x4816('0x17')](_0xc8ffd5);return _0x1eb683[_0x4816('0x1d')](_0x4816('0x1e'),_0x4803d0+'-'+_0x8d4393+'/'+_0x1961a5)[_0x4816('0x18')](_0x45c006);}return null;};}function patchUpdates(_0x53189e){return function(_0x1ab50d){try{jsonpatch['apply'](_0x1ab50d,_0x53189e,!![]);}catch(_0x521472){return BPromise[_0x4816('0x1f')](_0x521472);}return _0x1ab50d[_0x4816('0x20')]();};}function saveUpdates(_0x5de184,_0x2bbaf4){return function(_0x576221){if(_0x576221){return _0x576221[_0x4816('0x21')](_0x5de184)[_0x4816('0x22')](function(_0x571c81){return _0x571c81;});}return null;};}function removeEntity(_0x504851,_0xe484b2){return function(_0x2c8dc4){if(_0x2c8dc4){return _0x2c8dc4[_0x4816('0x23')]()['then'](function(){var _0x9b1a4c=_0x2c8dc4[_0x4816('0x24')]({'plain':!![]});var _0x126c60=_0x4816('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x126c60,'resourceId':_0x9b1a4c['id']}})[_0x4816('0x22')](function(){return _0x2c8dc4;});})[_0x4816('0x22')](function(){_0x504851['status'](0xcc)[_0x4816('0x16')]();});}};}function handleEntityNotFound(_0x4f9386,_0x551d15){return function(_0x386a16){if(!_0x386a16){_0x4f9386[_0x4816('0x15')](0x194);}return _0x386a16;};}function handleError(_0x2d8514,_0x5a1e61){_0x5a1e61=_0x5a1e61||0x1f4;return function(_0xbeb8fb){logger['error'](_0xbeb8fb[_0x4816('0x26')]);if(_0xbeb8fb[_0x4816('0x27')]){delete _0xbeb8fb['name'];}_0x2d8514[_0x4816('0x17')](_0x5a1e61)[_0x4816('0x28')](_0xbeb8fb);};}exports[_0x4816('0x29')]=function(_0x17037a,_0x1ba256){var _0x332af7={},_0x2e9a77={},_0x327a07={'count':0x0,'rows':[]};var _0x11ba1a=_['map'](db[_0x4816('0x2a')][_0x4816('0x2b')],function(_0x56ed76){return{'name':_0x56ed76['fieldName'],'type':_0x56ed76[_0x4816('0x2c')][_0x4816('0x2d')]};});_0x2e9a77[_0x4816('0x2e')]=_[_0x4816('0x2f')](_0x11ba1a,_0x4816('0x27'));_0x2e9a77['query']=_['keys'](_0x17037a['query']);_0x2e9a77[_0x4816('0x30')]=_[_0x4816('0x31')](_0x2e9a77[_0x4816('0x2e')],_0x2e9a77[_0x4816('0x32')]);_0x332af7[_0x4816('0x33')]=_[_0x4816('0x31')](_0x2e9a77['model'],qs[_0x4816('0x34')](_0x17037a['query'][_0x4816('0x34')]));_0x332af7[_0x4816('0x33')]=_0x332af7[_0x4816('0x33')][_0x4816('0x35')]?_0x332af7[_0x4816('0x33')]:_0x2e9a77['model'];if(!_0x17037a[_0x4816('0x32')]['hasOwnProperty']('nolimit')){_0x332af7[_0x4816('0x1b')]=qs['limit'](_0x17037a['query']['limit']);_0x332af7['offset']=qs[_0x4816('0x19')](_0x17037a[_0x4816('0x32')]['offset']);}_0x332af7[_0x4816('0x36')]=qs[_0x4816('0x37')](_0x17037a['query'][_0x4816('0x37')]);_0x332af7[_0x4816('0x38')]=qs[_0x4816('0x30')](_[_0x4816('0x39')](_0x17037a['query'],_0x2e9a77[_0x4816('0x30')]),_0x11ba1a);if(_0x17037a[_0x4816('0x32')][_0x4816('0x3a')]){_0x332af7[_0x4816('0x38')]=_[_0x4816('0x3b')](_0x332af7[_0x4816('0x38')],{'$or':_[_0x4816('0x2f')](_0x11ba1a,function(_0x1ef378){if(_0x1ef378[_0x4816('0x2c')]!==_0x4816('0x3c')){var _0xcbded0={};_0xcbded0[_0x1ef378[_0x4816('0x27')]]={'$like':'%'+_0x17037a[_0x4816('0x32')]['filter']+'%'};return _0xcbded0;}})});}_0x332af7=_[_0x4816('0x3b')]({},_0x332af7,_0x17037a[_0x4816('0x3d')]);var _0x4cbb05={'where':_0x332af7[_0x4816('0x38')]};return db[_0x4816('0x2a')][_0x4816('0x1c')](_0x4cbb05)[_0x4816('0x22')](function(_0x5d441a){_0x327a07[_0x4816('0x1c')]=_0x5d441a;if(_0x17037a['query']['includeAll']){_0x332af7[_0x4816('0x3e')]=[{'all':!![]}];}return db[_0x4816('0x2a')]['findAll'](_0x332af7);})[_0x4816('0x22')](function(_0x432bce){_0x327a07[_0x4816('0x3f')]=_0x432bce;return _0x327a07;})['then'](respondWithFilteredResult(_0x1ba256,_0x332af7))[_0x4816('0x40')](handleError(_0x1ba256,null));};exports[_0x4816('0x41')]=function(_0x178e62,_0xdec91c){var _0x40115d={'raw':![],'where':{'id':_0x178e62['params']['id']}},_0x39c713={};_0x39c713[_0x4816('0x2e')]=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x39c713[_0x4816('0x32')]=_[_0x4816('0x42')](_0x178e62[_0x4816('0x32')]);_0x39c713[_0x4816('0x30')]=_[_0x4816('0x31')](_0x39c713[_0x4816('0x2e')],_0x39c713[_0x4816('0x32')]);_0x40115d[_0x4816('0x33')]=_[_0x4816('0x31')](_0x39c713[_0x4816('0x2e')],qs['fields'](_0x178e62['query'][_0x4816('0x34')]));_0x40115d[_0x4816('0x33')]=_0x40115d[_0x4816('0x33')][_0x4816('0x35')]?_0x40115d[_0x4816('0x33')]:_0x39c713[_0x4816('0x2e')];if(_0x178e62[_0x4816('0x32')][_0x4816('0x43')]){_0x40115d['include']=[{'all':!![]}];}_0x40115d=_[_0x4816('0x3b')]({},_0x40115d,_0x178e62[_0x4816('0x3d')]);return db[_0x4816('0x2a')]['find'](_0x40115d)['then'](handleEntityNotFound(_0xdec91c,null))[_0x4816('0x22')](respondWithResult(_0xdec91c,null))[_0x4816('0x40')](handleError(_0xdec91c,null));};exports[_0x4816('0x44')]=function(_0x5d8b92,_0x247adb){return db[_0x4816('0x2a')][_0x4816('0x44')](_0x5d8b92[_0x4816('0x45')],{})[_0x4816('0x22')](function(_0x4401c6){var _0xbc898a=_0x5d8b92['user'][_0x4816('0x24')]({'plain':!![]});if(!_0xbc898a)throw new Error(_0x4816('0x46'));if(_0xbc898a[_0x4816('0x47')]===_0x4816('0x48')){var _0x158127=_0x4401c6[_0x4816('0x24')]({'plain':!![]});var _0x309778=_0x4816('0x25');return db[_0x4816('0x49')][_0x4816('0x4a')]({'where':{'name':_0x309778,'userProfileId':_0xbc898a[_0x4816('0x4b')]},'raw':!![]})[_0x4816('0x22')](function(_0x2b2f24){if(_0x2b2f24&&_0x2b2f24[_0x4816('0x4c')]===0x0){return db[_0x4816('0x4d')][_0x4816('0x44')]({'name':_0x158127[_0x4816('0x27')],'resourceId':_0x158127['id'],'type':_0x2b2f24[_0x4816('0x27')],'sectionId':_0x2b2f24['id']},{})[_0x4816('0x22')](function(){return _0x4401c6;});}else{return _0x4401c6;}})[_0x4816('0x40')](function(_0x1702bf){logger[_0x4816('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1702bf);throw _0x1702bf;});}return _0x4401c6;})[_0x4816('0x22')](respondWithResult(_0x247adb,0xc9))[_0x4816('0x40')](handleError(_0x247adb,null));};exports['update']=function(_0x3604e6,_0xa2a654){if(_0x3604e6[_0x4816('0x45')]['id']){delete _0x3604e6[_0x4816('0x45')]['id'];}return db[_0x4816('0x2a')][_0x4816('0x4a')]({'where':{'id':_0x3604e6[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0xa2a654,null))[_0x4816('0x22')](saveUpdates(_0x3604e6[_0x4816('0x45')],null))['then'](respondWithResult(_0xa2a654,null))[_0x4816('0x40')](handleError(_0xa2a654,null));};exports['destroy']=function(_0x440ba5,_0x199363){return db['VoiceChanSpy'][_0x4816('0x4a')]({'where':{'id':_0x440ba5[_0x4816('0x4f')]['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x199363,null))[_0x4816('0x22')](removeEntity(_0x199363,null))[_0x4816('0x40')](handleError(_0x199363,null));}; \ No newline at end of file +var _0x7daf=['request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0x7daf,0xaa));var _0xf7da=function(_0x5412b8,_0x467f34){_0x5412b8=_0x5412b8-0x0;var _0x377de6=_0x7daf[_0x5412b8];return _0x377de6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7da('0x1'));var rp=require(_0xf7da('0x2'));var moment=require('moment');var BPromise=require(_0xf7da('0x3'));var Mustache=require(_0xf7da('0x4'));var util=require(_0xf7da('0x5'));var path=require(_0xf7da('0x6'));var sox=require(_0xf7da('0x7'));var csv=require('to-csv');var ejs=require(_0xf7da('0x8'));var fs=require('fs');var fs_extra=require(_0xf7da('0x9'));var _=require(_0xf7da('0xa'));var squel=require(_0xf7da('0xb'));var crypto=require(_0xf7da('0xc'));var jsforce=require(_0xf7da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7da('0xe'));var querystring=require(_0xf7da('0xf'));var Papa=require(_0xf7da('0x10'));var Redis=require(_0xf7da('0x11'));var authService=require(_0xf7da('0x12'));var qs=require(_0xf7da('0x13'));var as=require(_0xf7da('0x14'));var hardwareService=require(_0xf7da('0x15'));var logger=require(_0xf7da('0x16'))(_0xf7da('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7da('0x18'));var db=require(_0xf7da('0x19'))['db'];function respondWithStatusCode(_0x2a5afc,_0x392244){_0x392244=_0x392244||0xcc;return function(_0x2da6bd){if(_0x2da6bd){return _0x2a5afc[_0xf7da('0x1a')](_0x392244);}return _0x2a5afc['status'](_0x392244)[_0xf7da('0x1b')]();};}function respondWithResult(_0x61af71,_0x5bfc67){_0x5bfc67=_0x5bfc67||0xc8;return function(_0x1958dd){if(_0x1958dd){return _0x61af71[_0xf7da('0x1c')](_0x5bfc67)[_0xf7da('0x1d')](_0x1958dd);}};}function respondWithFilteredResult(_0x37d3f7,_0xe82d40){return function(_0x26f112){if(_0x26f112){var _0x4f5afa=typeof _0xe82d40['offset']==='undefined'&&typeof _0xe82d40[_0xf7da('0x1e')]===_0xf7da('0x1f');var _0x231d6e=_0x26f112[_0xf7da('0x20')];var _0x336fca=_0x4f5afa?0x0:_0xe82d40[_0xf7da('0x21')];var _0xb75a2c=_0x4f5afa?_0x26f112[_0xf7da('0x20')]:_0xe82d40[_0xf7da('0x21')]+_0xe82d40[_0xf7da('0x1e')];var _0x303459;if(_0xb75a2c>=_0x231d6e){_0xb75a2c=_0x231d6e;_0x303459=0xc8;}else{_0x303459=0xce;}_0x37d3f7[_0xf7da('0x1c')](_0x303459);return _0x37d3f7[_0xf7da('0x22')](_0xf7da('0x23'),_0x336fca+'-'+_0xb75a2c+'/'+_0x231d6e)['json'](_0x26f112);}return null;};}function patchUpdates(_0x3f5f58){return function(_0x3b0913){try{jsonpatch[_0xf7da('0x24')](_0x3b0913,_0x3f5f58,!![]);}catch(_0xa43acc){return BPromise[_0xf7da('0x25')](_0xa43acc);}return _0x3b0913[_0xf7da('0x26')]();};}function saveUpdates(_0x119f49,_0x35ac94){return function(_0x3affce){if(_0x3affce){return _0x3affce['update'](_0x119f49)[_0xf7da('0x27')](function(_0x1b68d3){return _0x1b68d3;});}return null;};}function removeEntity(_0x265192,_0x4b627e){return function(_0x3bf5d1){if(_0x3bf5d1){return _0x3bf5d1[_0xf7da('0x28')]()[_0xf7da('0x27')](function(){var _0x4630ae=_0x3bf5d1[_0xf7da('0x29')]({'plain':!![]});var _0x9d2da='ChanSpies';return db[_0xf7da('0x2a')][_0xf7da('0x28')]({'where':{'type':_0x9d2da,'resourceId':_0x4630ae['id']}})[_0xf7da('0x27')](function(){return _0x3bf5d1;});})['then'](function(){_0x265192[_0xf7da('0x1c')](0xcc)[_0xf7da('0x1b')]();});}};}function handleEntityNotFound(_0x3fa1f2,_0x3509a5){return function(_0x13dc9f){if(!_0x13dc9f){_0x3fa1f2['sendStatus'](0x194);}return _0x13dc9f;};}function handleError(_0x3fd76a,_0x545b15){_0x545b15=_0x545b15||0x1f4;return function(_0x258c74){logger[_0xf7da('0x2b')](_0x258c74[_0xf7da('0x2c')]);if(_0x258c74[_0xf7da('0x2d')]){delete _0x258c74['name'];}_0x3fd76a[_0xf7da('0x1c')](_0x545b15)[_0xf7da('0x2e')](_0x258c74);};}exports[_0xf7da('0x2f')]=function(_0x1d3662,_0x3a765e){var _0xccc6cb={},_0x10d731={},_0x21ee49={'count':0x0,'rows':[]};var _0x495fb0=_[_0xf7da('0x30')](db[_0xf7da('0x31')][_0xf7da('0x32')],function(_0x302b92){return{'name':_0x302b92[_0xf7da('0x33')],'type':_0x302b92['type'][_0xf7da('0x34')]};});_0x10d731[_0xf7da('0x35')]=_['map'](_0x495fb0,_0xf7da('0x2d'));_0x10d731['query']=_[_0xf7da('0x36')](_0x1d3662[_0xf7da('0x37')]);_0x10d731[_0xf7da('0x38')]=_[_0xf7da('0x39')](_0x10d731[_0xf7da('0x35')],_0x10d731[_0xf7da('0x37')]);_0xccc6cb['attributes']=_[_0xf7da('0x39')](_0x10d731[_0xf7da('0x35')],qs[_0xf7da('0x3a')](_0x1d3662['query']['fields']));_0xccc6cb[_0xf7da('0x3b')]=_0xccc6cb['attributes']['length']?_0xccc6cb['attributes']:_0x10d731['model'];if(!_0x1d3662[_0xf7da('0x37')]['hasOwnProperty'](_0xf7da('0x3c'))){_0xccc6cb['limit']=qs[_0xf7da('0x1e')](_0x1d3662['query'][_0xf7da('0x1e')]);_0xccc6cb[_0xf7da('0x21')]=qs[_0xf7da('0x21')](_0x1d3662[_0xf7da('0x37')][_0xf7da('0x21')]);}_0xccc6cb['order']=qs[_0xf7da('0x3d')](_0x1d3662[_0xf7da('0x37')][_0xf7da('0x3d')]);_0xccc6cb[_0xf7da('0x3e')]=qs[_0xf7da('0x38')](_[_0xf7da('0x3f')](_0x1d3662['query'],_0x10d731[_0xf7da('0x38')]),_0x495fb0);if(_0x1d3662[_0xf7da('0x37')][_0xf7da('0x40')]){_0xccc6cb[_0xf7da('0x3e')]=_[_0xf7da('0x41')](_0xccc6cb['where'],{'$or':_[_0xf7da('0x30')](_0x495fb0,function(_0x4262fb){if(_0x4262fb[_0xf7da('0x42')]!=='VIRTUAL'){var _0x858885={};_0x858885[_0x4262fb['name']]={'$like':'%'+_0x1d3662['query']['filter']+'%'};return _0x858885;}})});}_0xccc6cb=_[_0xf7da('0x41')]({},_0xccc6cb,_0x1d3662[_0xf7da('0x43')]);var _0x2ea896={'where':_0xccc6cb[_0xf7da('0x3e')]};return db[_0xf7da('0x31')][_0xf7da('0x20')](_0x2ea896)[_0xf7da('0x27')](function(_0x3e64de){_0x21ee49[_0xf7da('0x20')]=_0x3e64de;if(_0x1d3662[_0xf7da('0x37')][_0xf7da('0x44')]){_0xccc6cb[_0xf7da('0x45')]=[{'all':!![]}];}return db[_0xf7da('0x31')][_0xf7da('0x46')](_0xccc6cb);})[_0xf7da('0x27')](function(_0x5c9235){_0x21ee49[_0xf7da('0x47')]=_0x5c9235;return _0x21ee49;})[_0xf7da('0x27')](respondWithFilteredResult(_0x3a765e,_0xccc6cb))['catch'](handleError(_0x3a765e,null));};exports[_0xf7da('0x48')]=function(_0x3d1c64,_0xb08527){var _0x1e4c73={'raw':![],'where':{'id':_0x3d1c64[_0xf7da('0x49')]['id']}},_0x4d3be3={};_0x4d3be3['model']=_[_0xf7da('0x36')](db[_0xf7da('0x31')][_0xf7da('0x32')]);_0x4d3be3[_0xf7da('0x37')]=_[_0xf7da('0x36')](_0x3d1c64[_0xf7da('0x37')]);_0x4d3be3[_0xf7da('0x38')]=_[_0xf7da('0x39')](_0x4d3be3[_0xf7da('0x35')],_0x4d3be3[_0xf7da('0x37')]);_0x1e4c73['attributes']=_[_0xf7da('0x39')](_0x4d3be3[_0xf7da('0x35')],qs['fields'](_0x3d1c64[_0xf7da('0x37')][_0xf7da('0x3a')]));_0x1e4c73[_0xf7da('0x3b')]=_0x1e4c73[_0xf7da('0x3b')]['length']?_0x1e4c73[_0xf7da('0x3b')]:_0x4d3be3[_0xf7da('0x35')];if(_0x3d1c64[_0xf7da('0x37')][_0xf7da('0x44')]){_0x1e4c73[_0xf7da('0x45')]=[{'all':!![]}];}_0x1e4c73=_['merge']({},_0x1e4c73,_0x3d1c64[_0xf7da('0x43')]);return db[_0xf7da('0x31')][_0xf7da('0x4a')](_0x1e4c73)[_0xf7da('0x27')](handleEntityNotFound(_0xb08527,null))[_0xf7da('0x27')](respondWithResult(_0xb08527,null))[_0xf7da('0x4b')](handleError(_0xb08527,null));};exports[_0xf7da('0x4c')]=function(_0x1b3b96,_0x27bfe2){return db[_0xf7da('0x31')][_0xf7da('0x4c')](_0x1b3b96[_0xf7da('0x4d')],{})['then'](function(_0x1f43ed){var _0x17450a=_0x1b3b96['user'][_0xf7da('0x29')]({'plain':!![]});if(!_0x17450a)throw new Error(_0xf7da('0x4e'));if(_0x17450a[_0xf7da('0x4f')]==='user'){var _0x1aedb4=_0x1f43ed[_0xf7da('0x29')]({'plain':!![]});var _0x4b0255=_0xf7da('0x50');return db[_0xf7da('0x51')][_0xf7da('0x4a')]({'where':{'name':_0x4b0255,'userProfileId':_0x17450a[_0xf7da('0x52')]},'raw':!![]})[_0xf7da('0x27')](function(_0x24f079){if(_0x24f079&&_0x24f079[_0xf7da('0x53')]===0x0){return db[_0xf7da('0x2a')][_0xf7da('0x4c')]({'name':_0x1aedb4[_0xf7da('0x2d')],'resourceId':_0x1aedb4['id'],'type':_0x24f079[_0xf7da('0x2d')],'sectionId':_0x24f079['id']},{})['then'](function(){return _0x1f43ed;});}else{return _0x1f43ed;}})[_0xf7da('0x4b')](function(_0x6a3b1f){logger[_0xf7da('0x2b')](_0xf7da('0x54'),_0x6a3b1f);throw _0x6a3b1f;});}return _0x1f43ed;})[_0xf7da('0x27')](respondWithResult(_0x27bfe2,0xc9))['catch'](handleError(_0x27bfe2,null));};exports[_0xf7da('0x55')]=function(_0x3bec85,_0x1da66e){if(_0x3bec85['body']['id']){delete _0x3bec85[_0xf7da('0x4d')]['id'];}return db[_0xf7da('0x31')]['find']({'where':{'id':_0x3bec85['params']['id']}})[_0xf7da('0x27')](handleEntityNotFound(_0x1da66e,null))['then'](saveUpdates(_0x3bec85[_0xf7da('0x4d')],null))['then'](respondWithResult(_0x1da66e,null))['catch'](handleError(_0x1da66e,null));};exports[_0xf7da('0x28')]=function(_0x1a07c2,_0xbfc595){return db[_0xf7da('0x31')][_0xf7da('0x4a')]({'where':{'id':_0x1a07c2[_0xf7da('0x49')]['id']}})[_0xf7da('0x27')](handleEntityNotFound(_0xbfc595,null))[_0xf7da('0x27')](removeEntity(_0xbfc595,null))['catch'](handleError(_0xbfc595,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e4771cf..56db841 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7e6=['lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','password','name','options','StopMixMonitor','internal','concat','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','then'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xd7e6,0x17c));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d7e('0x0'));var util=require(_0x6d7e('0x1'));var BPromise=require(_0x6d7e('0x2'));var attributes=require(_0x6d7e('0x3'));var getUserApplications=function(_0x4d9321,_0x44eb0d,_0x4bc5b6){var _0x5b961e=0x1;var _0x3050b7=[];var _0x417496={'context':_0x44eb0d['context']||_0x6d7e('0x4'),'exten':util[_0x6d7e('0x5')](_0x6d7e('0x6'),_0x4d9321[_0x6d7e('0x7')],_0x4bc5b6),'type':_0x6d7e('0x8'),'isApp':![],'ChanSpyId':_0x4d9321['id'],'UserId':_0x44eb0d['id']};_0x3050b7[_0x6d7e('0x9')](_[_0x6d7e('0xa')]({'app':_0x6d7e('0xb'),'appdata':util[_0x6d7e('0x5')](_0x6d7e('0xc'),_0x6d7e('0xd')),'priority':_0x5b961e++},_0x417496));if(_0x4d9321[_0x6d7e('0xe')]){_0x3050b7[_0x6d7e('0x9')](_[_0x6d7e('0xa')]({'app':_0x6d7e('0xf'),'appdata':util['format'](_0x6d7e('0x10'),_0x4d9321['recordingFormat']),'priority':_0x5b961e++},_0x417496));}if(_0x4d9321[_0x6d7e('0x11')]){_0x3050b7[_0x6d7e('0x9')](_[_0x6d7e('0xa')]({'app':'Authenticate','appdata':_0x4d9321[_0x6d7e('0x12')],'priority':_0x5b961e++},_0x417496));}_0x3050b7[_0x6d7e('0x9')](_['merge']({'app':'ChanSpy','appdata':util[_0x6d7e('0x5')]('SIP/%s,%s',_0x44eb0d[_0x6d7e('0x13')],_0x4d9321[_0x6d7e('0x14')]?_0x4d9321[_0x6d7e('0x14')]['join'](''):''),'priority':_0x5b961e++},_0x417496));if(_0x4d9321[_0x6d7e('0xe')]){_0x3050b7['push'](_[_0x6d7e('0xa')]({'app':_0x6d7e('0x15'),'priority':_0x5b961e++},_0x417496));}return _0x3050b7;};var getChanSpyApplications=function(_0x1a7d67,_0x3ecc91){var _0x5e4ed8=[];for(var _0x1cb0ff=0x0,_0xcf3f92=0x1;_0x1cb0ff<_0x3ecc91['length'];_0x1cb0ff++,_0xcf3f92=0x1){_0x5e4ed8=_0x5e4ed8['concat'](getUserApplications(_0x1a7d67,_0x3ecc91[_0x1cb0ff],_0x3ecc91[_0x1cb0ff][_0x6d7e('0x16')]));if(_0x3ecc91[_0x1cb0ff][_0x6d7e('0x16')]!=_0x3ecc91[_0x1cb0ff][_0x6d7e('0x13')]){_0x5e4ed8=_0x5e4ed8[_0x6d7e('0x17')](getUserApplications(_0x1a7d67,_0x3ecc91[_0x1cb0ff],_0x3ecc91[_0x1cb0ff][_0x6d7e('0x13')]));}}return _0x5e4ed8;};var getChanSpyPromise=function(_0x3ee768,_0x5a19ae){return new BPromise(function(_0x369049,_0x5497a5){return _0x3ee768[_0x6d7e('0x18')][_0x6d7e('0x19')]({'attributes':['id',_0x6d7e('0x13'),_0x6d7e('0x16')],'where':{'role':_0x6d7e('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x46d6c5){if(_0x46d6c5){return _0x369049(getChanSpyApplications(_0x5a19ae,_0x46d6c5));}return _0x369049([]);})[_0x6d7e('0x1b')](function(_0xc6bce1){_0x5497a5(_0xc6bce1);});});};module[_0x6d7e('0x1c')]=function(_0x4af66e,_0x42b748){var _0x318feb=_0x4af66e[_0x6d7e('0x1d')];return _0x4af66e[_0x6d7e('0x1e')](_0x6d7e('0x1f'),attributes,{'tableName':_0x6d7e('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x419fad,_0x49d477,_0x56f7f8){return getChanSpyPromise(_0x318feb,_0x419fad)['then'](function(_0x337958){if(_0x337958&&_0x337958[_0x6d7e('0x21')]){return _0x318feb[_0x6d7e('0x22')][_0x6d7e('0x23')](_0x337958);}})['then'](function(){_0x56f7f8();})[_0x6d7e('0x1b')](function(_0x545751){_0x56f7f8(_0x545751);});},'afterUpdate':function(_0x1d4d5c,_0x25d19e,_0x26c550){return _0x318feb['VoiceExtension'][_0x6d7e('0x24')]({'where':{'ChanSpyId':_0x1d4d5c['id']}})[_0x6d7e('0x25')](function(){return getChanSpyPromise(_0x318feb,_0x1d4d5c);})['then'](function(_0x5b1498){if(_0x5b1498&&_0x5b1498['length']){return _0x318feb[_0x6d7e('0x22')][_0x6d7e('0x23')](_0x5b1498);}})[_0x6d7e('0x25')](function(){_0x26c550();})['catch'](function(_0x4b6989){_0x26c550(_0x4b6989);});},'afterDestroy':function(_0xb75b1f,_0x5928c5,_0x8b0d19){return _0x318feb['VoiceExtension'][_0x6d7e('0x24')]({'where':{'ChanSpyId':_0xb75b1f['id']}})[_0x6d7e('0x25')](function(){_0x8b0d19();})['catch'](function(_0x3c48e0){_0x8b0d19(_0x3c48e0);});}}});}; \ No newline at end of file +var _0x829d=['StopMixMonitor','length','concat','internal','User','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','then','destroy','lodash','util','./voiceChanSpy.attributes','context','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','SIP/%s,%s','name','options','join'];(function(_0x3fdd6e,_0x40c47b){var _0x1c6fbc=function(_0x48f9e9){while(--_0x48f9e9){_0x3fdd6e['push'](_0x3fdd6e['shift']());}};_0x1c6fbc(++_0x40c47b);}(_0x829d,0x10b));var _0xd829=function(_0x1f09b3,_0xc79c9e){_0x1f09b3=_0x1f09b3-0x0;var _0x34cc23=_0x829d[_0x1f09b3];return _0x34cc23;};'use strict';var _=require(_0xd829('0x0'));var util=require(_0xd829('0x1'));var BPromise=require('bluebird');var attributes=require(_0xd829('0x2'));var getUserApplications=function(_0x181c9c,_0x42549,_0xd80f59){var _0x50e093=0x1;var _0x5ccaab=[];var _0x225d13={'context':_0x42549[_0xd829('0x3')]||'from-sip','exten':util[_0xd829('0x4')]('%s%s',_0x181c9c[_0xd829('0x5')],_0xd80f59),'type':_0xd829('0x6'),'isApp':![],'ChanSpyId':_0x181c9c['id'],'UserId':_0x42549['id']};_0x5ccaab['push'](_[_0xd829('0x7')]({'app':_0xd829('0x8'),'appdata':util[_0xd829('0x4')](_0xd829('0x9'),_0xd829('0xa')),'priority':_0x50e093++},_0x225d13));if(_0x181c9c[_0xd829('0xb')]){_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':_0xd829('0xd'),'appdata':util[_0xd829('0x4')](_0xd829('0xe'),_0x181c9c[_0xd829('0xf')]),'priority':_0x50e093++},_0x225d13));}if(_0x181c9c['auth']){_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':_0xd829('0x10'),'appdata':_0x181c9c['password'],'priority':_0x50e093++},_0x225d13));}_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':'ChanSpy','appdata':util[_0xd829('0x4')](_0xd829('0x11'),_0x42549[_0xd829('0x12')],_0x181c9c[_0xd829('0x13')]?_0x181c9c[_0xd829('0x13')][_0xd829('0x14')](''):''),'priority':_0x50e093++},_0x225d13));if(_0x181c9c[_0xd829('0xb')]){_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':_0xd829('0x15'),'priority':_0x50e093++},_0x225d13));}return _0x5ccaab;};var getChanSpyApplications=function(_0x53fc90,_0x1bfba0){var _0x48e792=[];for(var _0xf449f1=0x0,_0x16c638=0x1;_0xf449f1<_0x1bfba0[_0xd829('0x16')];_0xf449f1++,_0x16c638=0x1){_0x48e792=_0x48e792[_0xd829('0x17')](getUserApplications(_0x53fc90,_0x1bfba0[_0xf449f1],_0x1bfba0[_0xf449f1][_0xd829('0x18')]));if(_0x1bfba0[_0xf449f1][_0xd829('0x18')]!=_0x1bfba0[_0xf449f1][_0xd829('0x12')]){_0x48e792=_0x48e792[_0xd829('0x17')](getUserApplications(_0x53fc90,_0x1bfba0[_0xf449f1],_0x1bfba0[_0xf449f1][_0xd829('0x12')]));}}return _0x48e792;};var getChanSpyPromise=function(_0x172ffe,_0x42b70d){return new BPromise(function(_0x5bd976,_0xf16364){return _0x172ffe[_0xd829('0x19')][_0xd829('0x1a')]({'attributes':['id',_0xd829('0x12'),_0xd829('0x18')],'where':{'role':_0xd829('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x342f61){if(_0x342f61){return _0x5bd976(getChanSpyApplications(_0x42b70d,_0x342f61));}return _0x5bd976([]);})[_0xd829('0x1c')](function(_0x596af0){_0xf16364(_0x596af0);});});};module['exports']=function(_0x554664,_0x4df383){var _0x31fe73=_0x554664[_0xd829('0x1d')];return _0x554664[_0xd829('0x1e')](_0xd829('0x1f'),attributes,{'tableName':_0xd829('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x428d0b,_0xcee9e8,_0x2f4a0f){return getChanSpyPromise(_0x31fe73,_0x428d0b)['then'](function(_0x3c5cb9){if(_0x3c5cb9&&_0x3c5cb9[_0xd829('0x16')]){return _0x31fe73[_0xd829('0x21')]['bulkCreate'](_0x3c5cb9);}})[_0xd829('0x22')](function(){_0x2f4a0f();})['catch'](function(_0x52eed2){_0x2f4a0f(_0x52eed2);});},'afterUpdate':function(_0x29853a,_0x4c8d9b,_0x1d0b85){return _0x31fe73[_0xd829('0x21')][_0xd829('0x23')]({'where':{'ChanSpyId':_0x29853a['id']}})['then'](function(){return getChanSpyPromise(_0x31fe73,_0x29853a);})['then'](function(_0x50b54e){if(_0x50b54e&&_0x50b54e['length']){return _0x31fe73[_0xd829('0x21')]['bulkCreate'](_0x50b54e);}})[_0xd829('0x22')](function(){_0x1d0b85();})[_0xd829('0x1c')](function(_0x5bc3c7){_0x1d0b85(_0x5bc3c7);});},'afterDestroy':function(_0x52db19,_0x2e4be1,_0x337f95){return _0x31fe73['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x52db19['id']}})['then'](function(){_0x337f95();})['catch'](function(_0x2699bc){_0x337f95(_0x2699bc);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 0b8dc95..d38eb43 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5db8=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5db8,0xbb));var _0x85db=function(_0x570c8a,_0x4a11cc){_0x570c8a=_0x570c8a-0x0;var _0x25dc12=_0x5db8[_0x570c8a];return _0x25dc12;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});} \ No newline at end of file +var _0x9567=['info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x9567,0xdc));var _0x7956=function(_0x3bee2d,_0x3f939e){_0x3bee2d=_0x3bee2d-0x0;var _0x4f9b9=_0x9567[_0x3bee2d];return _0x4f9b9;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e6dc00c..710f57d 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a15=['/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./voiceContext.controller','isAuthenticated','get'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7a15,0x9c));var _0x57a1=function(_0x45c03b,_0x30ffcf){_0x45c03b=_0x45c03b-0x0;var _0x6378d9=_0x7a15[_0x45c03b];return _0x6378d9;};'use strict';var multer=require(_0x57a1('0x0'));var util=require(_0x57a1('0x1'));var path=require(_0x57a1('0x2'));var timeout=require(_0x57a1('0x3'));var express=require('express');var router=express[_0x57a1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x57a1('0x5'));var controller=require(_0x57a1('0x6'));router['get']('/',auth[_0x57a1('0x7')](),controller['index']);router[_0x57a1('0x8')](_0x57a1('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x57a1('0xa')]('/',auth[_0x57a1('0x7')](),controller['create']);router[_0x57a1('0xb')](_0x57a1('0x9'),auth[_0x57a1('0x7')](),controller['update']);router[_0x57a1('0xc')](_0x57a1('0x9'),auth[_0x57a1('0x7')](),controller[_0x57a1('0xd')]);module[_0x57a1('0xe')]=router; \ No newline at end of file +var _0x83ec=['../../components/interaction/service','./voiceContext.controller','get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x147dc1,_0x566e6d){var _0x8ac885=function(_0xe219b){while(--_0xe219b){_0x147dc1['push'](_0x147dc1['shift']());}};_0x8ac885(++_0x566e6d);}(_0x83ec,0x19b));var _0xc83e=function(_0x2c237e,_0x5d5cde){_0x2c237e=_0x2c237e-0x0;var _0x1d9501=_0x83ec[_0x2c237e];return _0x1d9501;};'use strict';var multer=require(_0xc83e('0x0'));var util=require(_0xc83e('0x1'));var path=require(_0xc83e('0x2'));var timeout=require(_0xc83e('0x3'));var express=require(_0xc83e('0x4'));var router=express['Router']();var fs_extra=require(_0xc83e('0x5'));var auth=require(_0xc83e('0x6'));var interaction=require(_0xc83e('0x7'));var config=require('../../config/environment');var controller=require(_0xc83e('0x8'));router[_0xc83e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc83e('0xa')]);router[_0xc83e('0x9')](_0xc83e('0xb'),auth[_0xc83e('0xc')](),controller['show']);router[_0xc83e('0xd')]('/',auth['isAuthenticated'](),controller[_0xc83e('0xe')]);router['put'](_0xc83e('0xb'),auth[_0xc83e('0xc')](),controller[_0xc83e('0xf')]);router[_0xc83e('0x10')](_0xc83e('0xb'),auth[_0xc83e('0xc')](),controller[_0xc83e('0x11')]);module[_0xc83e('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f59d160..387e019 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32d2=['sequelize','STRING','BOOLEAN'];(function(_0x1ada2a,_0x2cf5bb){var _0x2ef07b=function(_0x2b4d03){while(--_0x2b4d03){_0x1ada2a['push'](_0x1ada2a['shift']());}};_0x2ef07b(++_0x2cf5bb);}(_0x32d2,0x1aa));var _0x232d=function(_0x505891,_0x230df0){_0x505891=_0x505891-0x0;var _0x1cbc11=_0x32d2[_0x505891];return _0x1cbc11;};'use strict';var Sequelize=require(_0x232d('0x0'));module['exports']={'name':{'type':Sequelize[_0x232d('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x232d('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x232d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x966f=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x966f,0x1af));var _0xf966=function(_0x3b9a3a,_0x372db3){_0x3b9a3a=_0x3b9a3a-0x0;var _0x456941=_0x966f[_0x3b9a3a];return _0x456941;};'use strict';var Sequelize=require(_0xf966('0x0'));module[_0xf966('0x1')]={'name':{'type':Sequelize[_0xf966('0x2')],'unique':_0xf966('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf966('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 2b68b7b..74ca495 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39bc=['readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','root','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoiceContext','include','findAll','rawAttributes','includeAll','catch','create','body'];(function(_0x4b866e,_0x3991dd){var _0x29bcd1=function(_0xc923c3){while(--_0xc923c3){_0x4b866e['push'](_0x4b866e['shift']());}};_0x29bcd1(++_0x3991dd);}(_0x39bc,0xdc));var _0xc39b=function(_0x10255d,_0x4ffe63){_0x10255d=_0x10255d-0x0;var _0xdbbd8e=_0x39bc[_0x10255d];return _0xdbbd8e;};'use strict';var emlformat=require(_0xc39b('0x0'));var rimraf=require(_0xc39b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc39b('0x2'));var rp=require(_0xc39b('0x3'));var moment=require(_0xc39b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc39b('0x5'));var util=require('util');var path=require(_0xc39b('0x6'));var sox=require(_0xc39b('0x7'));var csv=require('to-csv');var ejs=require(_0xc39b('0x8'));var fs=require('fs');var fs_extra=require(_0xc39b('0x9'));var _=require(_0xc39b('0xa'));var squel=require('squel');var crypto=require(_0xc39b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc39b('0xc'));var toCsv=require(_0xc39b('0xd'));var querystring=require('querystring');var Papa=require(_0xc39b('0xe'));var Redis=require(_0xc39b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc39b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc39b('0x11'))('api');var utils=require(_0xc39b('0x12'));var config=require(_0xc39b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc39b('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc39b('0x15')][_0xc39b('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x23ba33,_0x1802d0,_0x2daa5a,_0x9de36b){return new BPromise(function(_0x2007df,_0x38fd35){var _0x4de5ae=_0x9de36b||client;return _0x4de5ae[_0xc39b('0x17')](_0x23ba33,_0x2daa5a)[_0xc39b('0x18')](function(_0x387e47){logger[_0xc39b('0x19')](_0xc39b('0x1a'),_0x1802d0,_0xc39b('0x1b'));logger[_0xc39b('0x1c')](_0xc39b('0x1d'),_0x1802d0,_0xc39b('0x1b'),JSON[_0xc39b('0x1e')](_0x387e47));if(_0x387e47[_0xc39b('0x1f')]){if(_0x387e47[_0xc39b('0x1f')][_0xc39b('0x20')]===0x1f4){logger['error'](_0xc39b('0x1a'),_0x1802d0,_0x387e47[_0xc39b('0x1f')][_0xc39b('0x21')]);return _0x38fd35(_0x387e47[_0xc39b('0x1f')][_0xc39b('0x21')]);}logger[_0xc39b('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x1802d0,_0x387e47[_0xc39b('0x1f')][_0xc39b('0x21')]);return _0x2007df(_0x387e47[_0xc39b('0x1f')][_0xc39b('0x21')]);}else{logger[_0xc39b('0x19')](_0xc39b('0x1a'),_0x1802d0,_0xc39b('0x1b'));_0x2007df(_0x387e47[_0xc39b('0x22')][_0xc39b('0x21')]);}})['catch'](function(_0x222184){logger[_0xc39b('0x1f')](_0xc39b('0x1a'),_0x1802d0,_0x222184);_0x38fd35(_0x222184);});});}function respondWithStatusCode(_0x1cc508,_0x5e1a81){_0x5e1a81=_0x5e1a81||0xcc;return function(_0x2ce5aa){if(_0x2ce5aa){return _0x1cc508[_0xc39b('0x23')](_0x5e1a81);}return _0x1cc508[_0xc39b('0x24')](_0x5e1a81)[_0xc39b('0x25')]();};}function respondWithResult(_0x3abad3,_0x6ab5ad){_0x6ab5ad=_0x6ab5ad||0xc8;return function(_0x206b89){if(_0x206b89){return _0x3abad3[_0xc39b('0x24')](_0x6ab5ad)['json'](_0x206b89);}};}function respondWithFilteredResult(_0x15dd47,_0x12cc7d){return function(_0x5b165c){if(_0x5b165c){var _0x3f9cb6=typeof _0x12cc7d['offset']===_0xc39b('0x26')&&typeof _0x12cc7d[_0xc39b('0x27')]===_0xc39b('0x26');var _0x170005=_0x5b165c['count'];var _0x547575=_0x3f9cb6?0x0:_0x12cc7d[_0xc39b('0x28')];var _0x286ac7=_0x3f9cb6?_0x5b165c[_0xc39b('0x29')]:_0x12cc7d['offset']+_0x12cc7d[_0xc39b('0x27')];var _0x198a39;if(_0x286ac7>=_0x170005){_0x286ac7=_0x170005;_0x198a39=0xc8;}else{_0x198a39=0xce;}_0x15dd47[_0xc39b('0x24')](_0x198a39);return _0x15dd47[_0xc39b('0x2a')](_0xc39b('0x2b'),_0x547575+'-'+_0x286ac7+'/'+_0x170005)[_0xc39b('0x2c')](_0x5b165c);}return null;};}function patchUpdates(_0x114b10){return function(_0x4152e7){try{jsonpatch[_0xc39b('0x2d')](_0x4152e7,_0x114b10,!![]);}catch(_0x2bb922){return BPromise[_0xc39b('0x2e')](_0x2bb922);}return _0x4152e7[_0xc39b('0x2f')]();};}function saveUpdates(_0x9d137f,_0x17541e){return function(_0x2d0f6c){if(_0x2d0f6c){return _0x2d0f6c[_0xc39b('0x30')](_0x9d137f)['then'](function(_0xe60e2d){return _0xe60e2d;});}return null;};}function removeEntity(_0x263dda,_0x3b1224){return function(_0x166923){if(_0x166923){return _0x166923[_0xc39b('0x31')]()[_0xc39b('0x18')](function(){var _0x2447fb=_0x166923['get']({'plain':!![]});var _0x3de34a=_0xc39b('0x32');return db[_0xc39b('0x33')][_0xc39b('0x31')]({'where':{'type':_0x3de34a,'resourceId':_0x2447fb['id']}})[_0xc39b('0x18')](function(){return _0x166923;});})[_0xc39b('0x18')](function(){_0x263dda['status'](0xcc)[_0xc39b('0x25')]();});}};}function handleEntityNotFound(_0x43a1a6,_0xf981ab){return function(_0xda0261){if(!_0xda0261){_0x43a1a6[_0xc39b('0x23')](0x194);}return _0xda0261;};}function handleError(_0x5e4d38,_0x1264e5){_0x1264e5=_0x1264e5||0x1f4;return function(_0x115fe5){logger['error'](_0x115fe5[_0xc39b('0x34')]);if(_0x115fe5[_0xc39b('0x35')]){delete _0x115fe5[_0xc39b('0x35')];}_0x5e4d38[_0xc39b('0x24')](_0x1264e5)[_0xc39b('0x36')](_0x115fe5);};}exports[_0xc39b('0x37')]=function(_0x567666,_0x1ed22c){var _0x3241e4={},_0x4cc16d={},_0x25e2ca={'count':0x0,'rows':[]};var _0xbfdf5a=_[_0xc39b('0x38')](db['VoiceContext']['rawAttributes'],function(_0x42c906){return{'name':_0x42c906['fieldName'],'type':_0x42c906[_0xc39b('0x39')][_0xc39b('0x3a')]};});_0x4cc16d[_0xc39b('0x3b')]=_['map'](_0xbfdf5a,_0xc39b('0x35'));_0x4cc16d[_0xc39b('0x3c')]=_[_0xc39b('0x3d')](_0x567666[_0xc39b('0x3c')]);_0x4cc16d[_0xc39b('0x3e')]=_['intersection'](_0x4cc16d[_0xc39b('0x3b')],_0x4cc16d[_0xc39b('0x3c')]);_0x3241e4[_0xc39b('0x3f')]=_[_0xc39b('0x40')](_0x4cc16d['model'],qs[_0xc39b('0x41')](_0x567666[_0xc39b('0x3c')]['fields']));_0x3241e4['attributes']=_0x3241e4[_0xc39b('0x3f')][_0xc39b('0x42')]?_0x3241e4[_0xc39b('0x3f')]:_0x4cc16d[_0xc39b('0x3b')];if(!_0x567666[_0xc39b('0x3c')][_0xc39b('0x43')](_0xc39b('0x44'))){_0x3241e4['limit']=qs['limit'](_0x567666[_0xc39b('0x3c')][_0xc39b('0x27')]);_0x3241e4[_0xc39b('0x28')]=qs[_0xc39b('0x28')](_0x567666[_0xc39b('0x3c')][_0xc39b('0x28')]);}_0x3241e4['order']=qs[_0xc39b('0x45')](_0x567666[_0xc39b('0x3c')][_0xc39b('0x45')]);_0x3241e4[_0xc39b('0x46')]=qs[_0xc39b('0x3e')](_[_0xc39b('0x47')](_0x567666[_0xc39b('0x3c')],_0x4cc16d[_0xc39b('0x3e')]),_0xbfdf5a);if(_0x567666[_0xc39b('0x3c')]['filter']){_0x3241e4[_0xc39b('0x46')]=_['merge'](_0x3241e4[_0xc39b('0x46')],{'$or':_[_0xc39b('0x38')](_0xbfdf5a,function(_0xc180c5){if(_0xc180c5[_0xc39b('0x39')]!=='VIRTUAL'){var _0x1a20c8={};_0x1a20c8[_0xc180c5[_0xc39b('0x35')]]={'$like':'%'+_0x567666[_0xc39b('0x3c')][_0xc39b('0x48')]+'%'};return _0x1a20c8;}})});}_0x3241e4=_[_0xc39b('0x49')]({},_0x3241e4,_0x567666[_0xc39b('0x4a')]);var _0x3872de={'where':_0x3241e4[_0xc39b('0x46')]};return db[_0xc39b('0x4b')][_0xc39b('0x29')](_0x3872de)['then'](function(_0x37ca0e){_0x25e2ca[_0xc39b('0x29')]=_0x37ca0e;if(_0x567666['query']['includeAll']){_0x3241e4[_0xc39b('0x4c')]=[{'all':!![]}];}return db['VoiceContext'][_0xc39b('0x4d')](_0x3241e4);})[_0xc39b('0x18')](function(_0x2ca7d7){_0x25e2ca['rows']=_0x2ca7d7;return _0x25e2ca;})[_0xc39b('0x18')](respondWithFilteredResult(_0x1ed22c,_0x3241e4))['catch'](handleError(_0x1ed22c,null));};exports['show']=function(_0x57085b,_0x382247){var _0x3705bb={'raw':![],'where':{'id':_0x57085b['params']['id']}},_0x20411e={};_0x20411e[_0xc39b('0x3b')]=_[_0xc39b('0x3d')](db[_0xc39b('0x4b')][_0xc39b('0x4e')]);_0x20411e[_0xc39b('0x3c')]=_[_0xc39b('0x3d')](_0x57085b[_0xc39b('0x3c')]);_0x20411e['filters']=_[_0xc39b('0x40')](_0x20411e[_0xc39b('0x3b')],_0x20411e[_0xc39b('0x3c')]);_0x3705bb[_0xc39b('0x3f')]=_[_0xc39b('0x40')](_0x20411e[_0xc39b('0x3b')],qs['fields'](_0x57085b[_0xc39b('0x3c')][_0xc39b('0x41')]));_0x3705bb[_0xc39b('0x3f')]=_0x3705bb[_0xc39b('0x3f')][_0xc39b('0x42')]?_0x3705bb['attributes']:_0x20411e[_0xc39b('0x3b')];if(_0x57085b[_0xc39b('0x3c')][_0xc39b('0x4f')]){_0x3705bb['include']=[{'all':!![]}];}_0x3705bb=_['merge']({},_0x3705bb,_0x57085b[_0xc39b('0x4a')]);return db[_0xc39b('0x4b')]['find'](_0x3705bb)[_0xc39b('0x18')](handleEntityNotFound(_0x382247,null))['then'](respondWithResult(_0x382247,null))[_0xc39b('0x50')](handleError(_0x382247,null));};exports['create']=function(_0x566856,_0x31e296,_0x5d59c6){var _0xc08df5;return db[_0xc39b('0x4b')][_0xc39b('0x51')](_0x566856[_0xc39b('0x52')],{'raw':!![]})[_0xc39b('0x18')](function(_0x34c33b){_0xc08df5=_0x34c33b;return db[_0xc39b('0x4b')]['findAll']({'raw':!![]});})[_0xc39b('0x18')](function(_0x2b7100){var _0x96ed41=fs[_0xc39b('0x53')](path[_0xc39b('0x54')](config['root'],_0xc39b('0x55')),_0xc39b('0x56'));var _0xabe36=ejs[_0xc39b('0x57')](_0x96ed41,{'contexts':_0x2b7100||[]});fs[_0xc39b('0x58')](_0xc39b('0x59'),_0xabe36);})['then'](function(){return respondWithRpcPromise(_0xc39b('0x5a'),_0xc39b('0x51'),{'module':_0xc39b('0x5b')});})[_0xc39b('0x18')](function(){var _0x55fbae=_0x566856['user'][_0xc39b('0x5c')]({'plain':!![]});if(!_0x55fbae)throw new Error(_0xc39b('0x5d'));if(_0x55fbae[_0xc39b('0x5e')]===_0xc39b('0x5f')){var _0x569345=_0xc08df5['get']({'plain':!![]});return db['UserProfileSection'][_0xc39b('0x60')]({'where':{'name':_0xc39b('0x32'),'userProfileId':_0x55fbae['userProfileId']},'raw':!![]})['then'](function(_0xfa68ac){if(_0xfa68ac&&_0xfa68ac[_0xc39b('0x61')]===0x0){return db[_0xc39b('0x33')][_0xc39b('0x51')]({'name':_0x569345[_0xc39b('0x35')],'resourceId':_0x569345['id'],'type':_0xfa68ac[_0xc39b('0x35')],'sectionId':_0xfa68ac['id']},{})['then'](function(){return _0xc08df5;});}else{return _0xc08df5;}})[_0xc39b('0x50')](function(_0x5390e8){logger[_0xc39b('0x1f')](_0xc39b('0x62'),_0x5390e8);throw _0x5390e8;});}return _0xc08df5;})[_0xc39b('0x18')](respondWithResult(_0x31e296,0xc9))['catch'](handleError(_0x31e296,null));};exports[_0xc39b('0x30')]=function(_0x1b1ee2,_0x2b3c30,_0xc6e3fa){var _0x589dc1;return db[_0xc39b('0x4b')][_0xc39b('0x60')]({'where':{'id':_0x1b1ee2[_0xc39b('0x63')]['id']}})[_0xc39b('0x18')](handleEntityNotFound(_0x2b3c30,null))['then'](saveUpdates(_0x1b1ee2[_0xc39b('0x52')],null))[_0xc39b('0x18')](function(_0x2b8539){if(_0x2b8539){_0x589dc1=_0x2b8539;return db[_0xc39b('0x4b')][_0xc39b('0x4d')]({'raw':!![]});}})['then'](function(_0x581f2b){var _0x2ffa53=fs[_0xc39b('0x53')](path['join'](config[_0xc39b('0x64')],_0xc39b('0x55')),'utf8');var _0x144626=ejs[_0xc39b('0x57')](_0x2ffa53,{'contexts':_0x581f2b||[]});fs[_0xc39b('0x58')](_0xc39b('0x59'),_0x144626);})[_0xc39b('0x18')](function(){return respondWithRpcPromise(_0xc39b('0x5a'),'update',{'module':'chan_sip.so'});})[_0xc39b('0x18')](function(){return _0x589dc1;})[_0xc39b('0x18')](respondWithResult(_0x2b3c30,null))[_0xc39b('0x50')](handleError(_0x2b3c30,null));};exports['destroy']=function(_0x50d5ce,_0x48175f,_0x4b506f){var _0x31bfe1;return db[_0xc39b('0x4b')][_0xc39b('0x60')]({'where':{'id':_0x50d5ce[_0xc39b('0x63')]['id']}})[_0xc39b('0x18')](handleEntityNotFound(_0x48175f,null))[_0xc39b('0x18')](removeEntity(_0x48175f,null))[_0xc39b('0x18')](function(){return db[_0xc39b('0x4b')]['findAll']({'raw':!![]});})[_0xc39b('0x18')](function(_0x5d40e5){var _0x2c9835=fs[_0xc39b('0x53')](path['join'](config[_0xc39b('0x64')],_0xc39b('0x55')),_0xc39b('0x56'));var _0x4d4b92=ejs['render'](_0x2c9835,{'contexts':_0x5d40e5});fs[_0xc39b('0x58')](_0xc39b('0x59'),_0x4d4b92);return respondWithRpcPromise(_0xc39b('0x5a'),_0xc39b('0x31'),{'module':_0xc39b('0x5b')});})[_0xc39b('0x50')](handleError(_0x48175f,null));}; \ No newline at end of file +var _0x4e52=['update','destroy','then','get','Contexts','UserProfileResource','end','sendStatus','stack','name','send','map','VoiceContext','rawAttributes','key','model','keys','query','filters','intersection','attributes','length','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','chan_sip.so','readFileSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x1ae12d,_0x27346f){var _0x5170d0=function(_0x25028c){while(--_0x25028c){_0x1ae12d['push'](_0x1ae12d['shift']());}};_0x5170d0(++_0x27346f);}(_0x4e52,0xfb));var _0x24e5=function(_0x14d1b0,_0x497f75){_0x14d1b0=_0x14d1b0-0x0;var _0x24a73c=_0x4e52[_0x14d1b0];return _0x24a73c;};'use strict';var emlformat=require(_0x24e5('0x0'));var rimraf=require(_0x24e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24e5('0x2'));var rp=require(_0x24e5('0x3'));var moment=require('moment');var BPromise=require(_0x24e5('0x4'));var Mustache=require(_0x24e5('0x5'));var util=require(_0x24e5('0x6'));var path=require(_0x24e5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x24e5('0x8'));var fs=require('fs');var fs_extra=require(_0x24e5('0x9'));var _=require(_0x24e5('0xa'));var squel=require(_0x24e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x24e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x24e5('0xd'));var querystring=require(_0x24e5('0xe'));var Papa=require(_0x24e5('0xf'));var Redis=require(_0x24e5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24e5('0x11'));var hardwareService=require(_0x24e5('0x12'));var logger=require(_0x24e5('0x13'))('api');var utils=require(_0x24e5('0x14'));var config=require(_0x24e5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x24e5('0x16'))['db'];var jayson=require(_0x24e5('0x17'));var client=jayson[_0x24e5('0x18')][_0x24e5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x40f71d,_0x7d5f41,_0x5ba9c7,_0x37ac17){return new BPromise(function(_0x3e38e0,_0x4bb68a){var _0xfcb027=_0x37ac17||client;return _0xfcb027[_0x24e5('0x1a')](_0x40f71d,_0x5ba9c7)['then'](function(_0x4f13ec){logger['info']('VoiceContext,\x20%s,\x20%s',_0x7d5f41,_0x24e5('0x1b'));logger[_0x24e5('0x1c')](_0x24e5('0x1d'),_0x7d5f41,_0x24e5('0x1b'),JSON[_0x24e5('0x1e')](_0x4f13ec));if(_0x4f13ec[_0x24e5('0x1f')]){if(_0x4f13ec[_0x24e5('0x1f')]['code']===0x1f4){logger[_0x24e5('0x1f')](_0x24e5('0x20'),_0x7d5f41,_0x4f13ec[_0x24e5('0x1f')][_0x24e5('0x21')]);return _0x4bb68a(_0x4f13ec['error'][_0x24e5('0x21')]);}logger[_0x24e5('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x7d5f41,_0x4f13ec[_0x24e5('0x1f')]['message']);return _0x3e38e0(_0x4f13ec[_0x24e5('0x1f')]['message']);}else{logger['info'](_0x24e5('0x20'),_0x7d5f41,_0x24e5('0x1b'));_0x3e38e0(_0x4f13ec[_0x24e5('0x22')][_0x24e5('0x21')]);}})[_0x24e5('0x23')](function(_0x43ec9d){logger['error']('VoiceContext,\x20%s,\x20%s',_0x7d5f41,_0x43ec9d);_0x4bb68a(_0x43ec9d);});});}function respondWithStatusCode(_0x5d5fb0,_0x41da48){_0x41da48=_0x41da48||0xcc;return function(_0xd0ad3){if(_0xd0ad3){return _0x5d5fb0['sendStatus'](_0x41da48);}return _0x5d5fb0[_0x24e5('0x24')](_0x41da48)['end']();};}function respondWithResult(_0x3f25c1,_0x326516){_0x326516=_0x326516||0xc8;return function(_0x1d7d56){if(_0x1d7d56){return _0x3f25c1[_0x24e5('0x24')](_0x326516)[_0x24e5('0x25')](_0x1d7d56);}};}function respondWithFilteredResult(_0x1f5e9e,_0x172f56){return function(_0x339a80){if(_0x339a80){var _0x9fbc92=typeof _0x172f56[_0x24e5('0x26')]===_0x24e5('0x27')&&typeof _0x172f56[_0x24e5('0x28')]===_0x24e5('0x27');var _0x2d13d1=_0x339a80['count'];var _0x644fe8=_0x9fbc92?0x0:_0x172f56[_0x24e5('0x26')];var _0x1dea53=_0x9fbc92?_0x339a80[_0x24e5('0x29')]:_0x172f56[_0x24e5('0x26')]+_0x172f56[_0x24e5('0x28')];var _0x32b3d1;if(_0x1dea53>=_0x2d13d1){_0x1dea53=_0x2d13d1;_0x32b3d1=0xc8;}else{_0x32b3d1=0xce;}_0x1f5e9e[_0x24e5('0x24')](_0x32b3d1);return _0x1f5e9e[_0x24e5('0x2a')](_0x24e5('0x2b'),_0x644fe8+'-'+_0x1dea53+'/'+_0x2d13d1)['json'](_0x339a80);}return null;};}function patchUpdates(_0x1a4e39){return function(_0x18f3a6){try{jsonpatch[_0x24e5('0x2c')](_0x18f3a6,_0x1a4e39,!![]);}catch(_0xd9a0fa){return BPromise[_0x24e5('0x2d')](_0xd9a0fa);}return _0x18f3a6['save']();};}function saveUpdates(_0x7d4b29,_0x317c1a){return function(_0x421cea){if(_0x421cea){return _0x421cea[_0x24e5('0x2e')](_0x7d4b29)['then'](function(_0x3c6fe6){return _0x3c6fe6;});}return null;};}function removeEntity(_0x349c7b,_0x20180a){return function(_0x12f801){if(_0x12f801){return _0x12f801[_0x24e5('0x2f')]()[_0x24e5('0x30')](function(){var _0xd12e50=_0x12f801[_0x24e5('0x31')]({'plain':!![]});var _0xa32240=_0x24e5('0x32');return db[_0x24e5('0x33')]['destroy']({'where':{'type':_0xa32240,'resourceId':_0xd12e50['id']}})[_0x24e5('0x30')](function(){return _0x12f801;});})[_0x24e5('0x30')](function(){_0x349c7b['status'](0xcc)[_0x24e5('0x34')]();});}};}function handleEntityNotFound(_0x5df882,_0x1a4492){return function(_0x55b512){if(!_0x55b512){_0x5df882[_0x24e5('0x35')](0x194);}return _0x55b512;};}function handleError(_0x1a6bd4,_0x41fb95){_0x41fb95=_0x41fb95||0x1f4;return function(_0xda082e){logger[_0x24e5('0x1f')](_0xda082e[_0x24e5('0x36')]);if(_0xda082e[_0x24e5('0x37')]){delete _0xda082e[_0x24e5('0x37')];}_0x1a6bd4[_0x24e5('0x24')](_0x41fb95)[_0x24e5('0x38')](_0xda082e);};}exports['index']=function(_0x7fbaf6,_0x3b910a){var _0x2c5063={},_0x296d96={},_0x7d0b8c={'count':0x0,'rows':[]};var _0x248660=_[_0x24e5('0x39')](db[_0x24e5('0x3a')][_0x24e5('0x3b')],function(_0x59285d){return{'name':_0x59285d['fieldName'],'type':_0x59285d['type'][_0x24e5('0x3c')]};});_0x296d96[_0x24e5('0x3d')]=_[_0x24e5('0x39')](_0x248660,_0x24e5('0x37'));_0x296d96['query']=_[_0x24e5('0x3e')](_0x7fbaf6[_0x24e5('0x3f')]);_0x296d96[_0x24e5('0x40')]=_[_0x24e5('0x41')](_0x296d96[_0x24e5('0x3d')],_0x296d96[_0x24e5('0x3f')]);_0x2c5063[_0x24e5('0x42')]=_['intersection'](_0x296d96[_0x24e5('0x3d')],qs['fields'](_0x7fbaf6[_0x24e5('0x3f')]['fields']));_0x2c5063['attributes']=_0x2c5063[_0x24e5('0x42')][_0x24e5('0x43')]?_0x2c5063['attributes']:_0x296d96['model'];if(!_0x7fbaf6[_0x24e5('0x3f')]['hasOwnProperty']('nolimit')){_0x2c5063[_0x24e5('0x28')]=qs[_0x24e5('0x28')](_0x7fbaf6[_0x24e5('0x3f')][_0x24e5('0x28')]);_0x2c5063[_0x24e5('0x26')]=qs[_0x24e5('0x26')](_0x7fbaf6[_0x24e5('0x3f')][_0x24e5('0x26')]);}_0x2c5063[_0x24e5('0x44')]=qs[_0x24e5('0x45')](_0x7fbaf6[_0x24e5('0x3f')]['sort']);_0x2c5063[_0x24e5('0x46')]=qs[_0x24e5('0x40')](_['pick'](_0x7fbaf6[_0x24e5('0x3f')],_0x296d96[_0x24e5('0x40')]),_0x248660);if(_0x7fbaf6[_0x24e5('0x3f')]['filter']){_0x2c5063[_0x24e5('0x46')]=_[_0x24e5('0x47')](_0x2c5063[_0x24e5('0x46')],{'$or':_[_0x24e5('0x39')](_0x248660,function(_0x47dd14){if(_0x47dd14[_0x24e5('0x48')]!==_0x24e5('0x49')){var _0x3b0830={};_0x3b0830[_0x47dd14[_0x24e5('0x37')]]={'$like':'%'+_0x7fbaf6[_0x24e5('0x3f')]['filter']+'%'};return _0x3b0830;}})});}_0x2c5063=_[_0x24e5('0x47')]({},_0x2c5063,_0x7fbaf6[_0x24e5('0x4a')]);var _0x5cac1a={'where':_0x2c5063[_0x24e5('0x46')]};return db[_0x24e5('0x3a')][_0x24e5('0x29')](_0x5cac1a)[_0x24e5('0x30')](function(_0x57f4db){_0x7d0b8c[_0x24e5('0x29')]=_0x57f4db;if(_0x7fbaf6[_0x24e5('0x3f')][_0x24e5('0x4b')]){_0x2c5063[_0x24e5('0x4c')]=[{'all':!![]}];}return db[_0x24e5('0x3a')][_0x24e5('0x4d')](_0x2c5063);})['then'](function(_0x4b68dd){_0x7d0b8c[_0x24e5('0x4e')]=_0x4b68dd;return _0x7d0b8c;})[_0x24e5('0x30')](respondWithFilteredResult(_0x3b910a,_0x2c5063))[_0x24e5('0x23')](handleError(_0x3b910a,null));};exports['show']=function(_0x3ef92a,_0x296b8b){var _0x3299ad={'raw':![],'where':{'id':_0x3ef92a[_0x24e5('0x4f')]['id']}},_0xcdc2b7={};_0xcdc2b7[_0x24e5('0x3d')]=_[_0x24e5('0x3e')](db['VoiceContext'][_0x24e5('0x3b')]);_0xcdc2b7['query']=_[_0x24e5('0x3e')](_0x3ef92a[_0x24e5('0x3f')]);_0xcdc2b7['filters']=_[_0x24e5('0x41')](_0xcdc2b7[_0x24e5('0x3d')],_0xcdc2b7[_0x24e5('0x3f')]);_0x3299ad['attributes']=_[_0x24e5('0x41')](_0xcdc2b7[_0x24e5('0x3d')],qs['fields'](_0x3ef92a[_0x24e5('0x3f')]['fields']));_0x3299ad[_0x24e5('0x42')]=_0x3299ad['attributes']['length']?_0x3299ad['attributes']:_0xcdc2b7[_0x24e5('0x3d')];if(_0x3ef92a[_0x24e5('0x3f')]['includeAll']){_0x3299ad[_0x24e5('0x4c')]=[{'all':!![]}];}_0x3299ad=_[_0x24e5('0x47')]({},_0x3299ad,_0x3ef92a[_0x24e5('0x4a')]);return db[_0x24e5('0x3a')][_0x24e5('0x50')](_0x3299ad)[_0x24e5('0x30')](handleEntityNotFound(_0x296b8b,null))[_0x24e5('0x30')](respondWithResult(_0x296b8b,null))['catch'](handleError(_0x296b8b,null));};exports[_0x24e5('0x51')]=function(_0x8e7a49,_0x2acc52,_0x1aaadf){var _0x33ff7f;return db[_0x24e5('0x3a')][_0x24e5('0x51')](_0x8e7a49[_0x24e5('0x52')],{'raw':!![]})['then'](function(_0x3340a9){_0x33ff7f=_0x3340a9;return db[_0x24e5('0x3a')][_0x24e5('0x4d')]({'raw':!![]});})[_0x24e5('0x30')](function(_0x531d29){var _0x509176=fs['readFileSync'](path[_0x24e5('0x53')](config[_0x24e5('0x54')],_0x24e5('0x55')),_0x24e5('0x56'));var _0x5ac9c7=ejs[_0x24e5('0x57')](_0x509176,{'contexts':_0x531d29||[]});fs[_0x24e5('0x58')](_0x24e5('0x59'),_0x5ac9c7);})[_0x24e5('0x30')](function(){return respondWithRpcPromise(_0x24e5('0x5a'),_0x24e5('0x51'),{'module':'chan_sip.so'});})[_0x24e5('0x30')](function(){var _0x101272=_0x8e7a49[_0x24e5('0x5b')][_0x24e5('0x31')]({'plain':!![]});if(!_0x101272)throw new Error(_0x24e5('0x5c'));if(_0x101272[_0x24e5('0x5d')]==='user'){var _0x2ef5b4=_0x33ff7f[_0x24e5('0x31')]({'plain':!![]});return db[_0x24e5('0x5e')][_0x24e5('0x50')]({'where':{'name':_0x24e5('0x32'),'userProfileId':_0x101272[_0x24e5('0x5f')]},'raw':!![]})[_0x24e5('0x30')](function(_0x5d7beb){if(_0x5d7beb&&_0x5d7beb[_0x24e5('0x60')]===0x0){return db[_0x24e5('0x33')]['create']({'name':_0x2ef5b4[_0x24e5('0x37')],'resourceId':_0x2ef5b4['id'],'type':_0x5d7beb[_0x24e5('0x37')],'sectionId':_0x5d7beb['id']},{})['then'](function(){return _0x33ff7f;});}else{return _0x33ff7f;}})[_0x24e5('0x23')](function(_0x2d8522){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d8522);throw _0x2d8522;});}return _0x33ff7f;})[_0x24e5('0x30')](respondWithResult(_0x2acc52,0xc9))['catch'](handleError(_0x2acc52,null));};exports['update']=function(_0x2d42a6,_0x2e575b,_0x32474e){var _0x316bcf;return db[_0x24e5('0x3a')]['find']({'where':{'id':_0x2d42a6[_0x24e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2e575b,null))[_0x24e5('0x30')](saveUpdates(_0x2d42a6['body'],null))[_0x24e5('0x30')](function(_0x330e13){if(_0x330e13){_0x316bcf=_0x330e13;return db[_0x24e5('0x3a')][_0x24e5('0x4d')]({'raw':!![]});}})['then'](function(_0x35bec7){var _0x24d8c7=fs['readFileSync'](path[_0x24e5('0x53')](config['root'],_0x24e5('0x55')),_0x24e5('0x56'));var _0x10d7fe=ejs[_0x24e5('0x57')](_0x24d8c7,{'contexts':_0x35bec7||[]});fs[_0x24e5('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x10d7fe);})[_0x24e5('0x30')](function(){return respondWithRpcPromise(_0x24e5('0x5a'),_0x24e5('0x2e'),{'module':_0x24e5('0x61')});})[_0x24e5('0x30')](function(){return _0x316bcf;})[_0x24e5('0x30')](respondWithResult(_0x2e575b,null))[_0x24e5('0x23')](handleError(_0x2e575b,null));};exports[_0x24e5('0x2f')]=function(_0x500bb1,_0x1cdbaf,_0x532f0e){var _0x4ef5fc;return db['VoiceContext'][_0x24e5('0x50')]({'where':{'id':_0x500bb1[_0x24e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1cdbaf,null))[_0x24e5('0x30')](removeEntity(_0x1cdbaf,null))[_0x24e5('0x30')](function(){return db[_0x24e5('0x3a')][_0x24e5('0x4d')]({'raw':!![]});})[_0x24e5('0x30')](function(_0x10febf){var _0x46de11=fs[_0x24e5('0x62')](path[_0x24e5('0x53')](config[_0x24e5('0x54')],_0x24e5('0x55')),_0x24e5('0x56'));var _0x2973da=ejs['render'](_0x46de11,{'contexts':_0x10febf});fs[_0x24e5('0x58')](_0x24e5('0x59'),_0x2973da);return respondWithRpcPromise('Reload',_0x24e5('0x2f'),{'module':'chan_sip.so'});})[_0x24e5('0x23')](handleError(_0x1cdbaf,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 5e990d6..be9f307 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cfa=['./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5ca033,_0x2483a2){var _0x519e52=function(_0x247fd2){while(--_0x247fd2){_0x5ca033['push'](_0x5ca033['shift']());}};_0x519e52(++_0x2483a2);}(_0x7cfa,0xac));var _0xa7cf=function(_0xade0af,_0x5abd2a){_0xade0af=_0xade0af-0x0;var _0x2a2582=_0x7cfa[_0xade0af];return _0x2a2582;};'use strict';var _=require(_0xa7cf('0x0'));var util=require(_0xa7cf('0x1'));var logger=require(_0xa7cf('0x2'))('api');var moment=require(_0xa7cf('0x3'));var BPromise=require(_0xa7cf('0x4'));var rp=require(_0xa7cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7cf('0x6'));var config=require(_0xa7cf('0x7'));var attributes=require(_0xa7cf('0x8'));module[_0xa7cf('0x9')]=function(_0x2e5701,_0x283110){return _0x2e5701[_0xa7cf('0xa')](_0xa7cf('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f3e=['VoiceContext','voice_contexts','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x0f3e,0x1e6));var _0xe0f3=function(_0x36769d,_0x2da274){_0x36769d=_0x36769d-0x0;var _0x124470=_0x0f3e[_0x36769d];return _0x124470;};'use strict';var _=require(_0xe0f3('0x0'));var util=require('util');var logger=require(_0xe0f3('0x1'))(_0xe0f3('0x2'));var moment=require('moment');var BPromise=require(_0xe0f3('0x3'));var rp=require(_0xe0f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0f3('0x5'));var config=require(_0xe0f3('0x6'));var attributes=require('./voiceContext.attributes');module[_0xe0f3('0x7')]=function(_0x4422ae,_0x3d98df){return _0x4422ae[_0xe0f3('0x8')](_0xe0f3('0x9'),attributes,{'tableName':_0xe0f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 353e589..aeff859 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a83=['VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x2018f7,_0x5533b5){var _0x95f603=function(_0x35b6de){while(--_0x35b6de){_0x2018f7['push'](_0x2018f7['shift']());}};_0x95f603(++_0x5533b5);}(_0x1a83,0x1c0));var _0x31a8=function(_0x78b85,_0x195038){_0x78b85=_0x78b85-0x0;var _0xb5e91=_0x1a83[_0x78b85];return _0xb5e91;};'use strict';var _=require(_0x31a8('0x0'));var util=require(_0x31a8('0x1'));var moment=require(_0x31a8('0x2'));var BPromise=require('bluebird');var rs=require(_0x31a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31a8('0x4'))['db'];var utils=require(_0x31a8('0x5'));var logger=require(_0x31a8('0x6'))(_0x31a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x31a8('0x8')][_0x31a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf3c7,_0x2c4b45,_0x471ae1){return new BPromise(function(_0x21f054,_0x1159a9){return client[_0x31a8('0xa')](_0x2bf3c7,_0x471ae1)[_0x31a8('0xb')](function(_0x2d4e94){logger['info'](_0x31a8('0xc'),_0x2c4b45,'request\x20sent');logger['debug'](_0x31a8('0xd'),_0x2c4b45,_0x31a8('0xe'),JSON['stringify'](_0x2d4e94));if(_0x2d4e94[_0x31a8('0xf')]){if(_0x2d4e94[_0x31a8('0xf')][_0x31a8('0x10')]===0x1f4){logger[_0x31a8('0xf')]('VoiceContext,\x20%s,\x20%s',_0x2c4b45,_0x2d4e94['error'][_0x31a8('0x11')]);return _0x1159a9(_0x2d4e94['error'][_0x31a8('0x11')]);}logger['error'](_0x31a8('0xc'),_0x2c4b45,_0x2d4e94[_0x31a8('0xf')][_0x31a8('0x11')]);return _0x21f054(_0x2d4e94['error'][_0x31a8('0x11')]);}else{logger[_0x31a8('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2c4b45,_0x31a8('0xe'));_0x21f054(_0x2d4e94['result'][_0x31a8('0x11')]);}})[_0x31a8('0x13')](function(_0x507797){logger[_0x31a8('0xf')](_0x31a8('0xc'),_0x2c4b45,_0x507797);_0x1159a9(_0x507797);});});} \ No newline at end of file +var _0xbfcc=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0x8505e8,_0x59587b){var _0x3c3e07=function(_0x2bee5d){while(--_0x2bee5d){_0x8505e8['push'](_0x8505e8['shift']());}};_0x3c3e07(++_0x59587b);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xbfcc[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('VoiceContext,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c6946a3..724b4b8 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2392=['describe','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe'];(function(_0x55d56f,_0x26fa0f){var _0x17096f=function(_0x2cd511){while(--_0x2cd511){_0x55d56f['push'](_0x55d56f['shift']());}};_0x17096f(++_0x26fa0f);}(_0x2392,0xd0));var _0x2239=function(_0x126149,_0x17109f){_0x126149=_0x126149-0x0;var _0x1ceb00=_0x2392[_0x126149];return _0x1ceb00;};'use strict';var multer=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var path=require('path');var timeout=require(_0x2239('0x2'));var express=require(_0x2239('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2239('0x4'));var interaction=require(_0x2239('0x5'));var config=require(_0x2239('0x6'));var controller=require(_0x2239('0x7'));router[_0x2239('0x8')]('/',auth[_0x2239('0x9')](),controller[_0x2239('0xa')]);router[_0x2239('0x8')](_0x2239('0xb'),auth[_0x2239('0x9')](),controller[_0x2239('0xc')]);router[_0x2239('0x8')](_0x2239('0xd'),auth['isAuthenticated'](),controller[_0x2239('0xe')]);router[_0x2239('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2239('0x10')](_0x2239('0xd'),auth[_0x2239('0x9')](),controller[_0x2239('0x11')]);router[_0x2239('0x12')](_0x2239('0xd'),auth[_0x2239('0x9')](),controller['destroy']);module[_0x2239('0x13')]=router; \ No newline at end of file +var _0xde94=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xde94,0x134));var _0x4de9=function(_0x1f4400,_0x3c8593){_0x1f4400=_0x1f4400-0x0;var _0x2dd98a=_0xde94[_0x1f4400];return _0x2dd98a;};'use strict';var multer=require(_0x4de9('0x0'));var util=require(_0x4de9('0x1'));var path=require(_0x4de9('0x2'));var timeout=require(_0x4de9('0x3'));var express=require(_0x4de9('0x4'));var router=express[_0x4de9('0x5')]();var fs_extra=require(_0x4de9('0x6'));var auth=require(_0x4de9('0x7'));var interaction=require(_0x4de9('0x8'));var config=require(_0x4de9('0x9'));var controller=require('./voiceDialReport.controller');router[_0x4de9('0xa')]('/',auth[_0x4de9('0xb')](),controller[_0x4de9('0xc')]);router['get'](_0x4de9('0xd'),auth[_0x4de9('0xb')](),controller['describe']);router[_0x4de9('0xa')]('/:id',auth[_0x4de9('0xb')](),controller[_0x4de9('0xe')]);router['post']('/',auth[_0x4de9('0xb')](),controller[_0x4de9('0xf')]);router[_0x4de9('0x10')](_0x4de9('0x11'),auth[_0x4de9('0xb')](),controller[_0x4de9('0x12')]);router['delete']('/:id',auth[_0x4de9('0xb')](),controller[_0x4de9('0x13')]);module[_0x4de9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6ccab39..93535c3 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x5f1e26,_0x56beab){var _0x295a3c=function(_0x2432d7){while(--_0x2432d7){_0x5f1e26['push'](_0x5f1e26['shift']());}};_0x295a3c(++_0x56beab);}(_0x9a19,0x114));var _0x99a1=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x9a19[_0x15cdcb];return _0x37b069;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x11f9d7,_0x443cbc){var _0x51db81=function(_0x39f9f0){while(--_0x39f9f0){_0x11f9d7['push'](_0x11f9d7['shift']());}};_0x51db81(++_0x443cbc);}(_0x55ca,0x126));var _0xa55c=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x55ca[_0x431ff8];return _0x84ccd4;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a99b3df..a688958 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75e0=['sort','where','filters','pick','merge','VIRTUAL','filter','then','findAll','rows','catch','show','includeAll','include','options','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2f4c28,_0xa63509){var _0x49f6b3=function(_0xc48296){while(--_0xc48296){_0x2f4c28['push'](_0x2f4c28['shift']());}};_0x49f6b3(++_0xa63509);}(_0x75e0,0x19f));var _0x075e=function(_0x1a65f6,_0x3412c8){_0x1a65f6=_0x1a65f6-0x0;var _0x3a8b3c=_0x75e0[_0x1a65f6];return _0x3a8b3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x075e('0x0'));var zipdir=require(_0x075e('0x1'));var jsonpatch=require(_0x075e('0x2'));var rp=require(_0x075e('0x3'));var moment=require(_0x075e('0x4'));var BPromise=require(_0x075e('0x5'));var Mustache=require(_0x075e('0x6'));var util=require(_0x075e('0x7'));var path=require(_0x075e('0x8'));var sox=require(_0x075e('0x9'));var csv=require(_0x075e('0xa'));var ejs=require(_0x075e('0xb'));var fs=require('fs');var fs_extra=require(_0x075e('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x075e('0xd'));var jsforce=require(_0x075e('0xe'));var deskjs=require(_0x075e('0xf'));var toCsv=require(_0x075e('0xa'));var querystring=require('querystring');var Papa=require(_0x075e('0x10'));var Redis=require('ioredis');var authService=require(_0x075e('0x11'));var qs=require(_0x075e('0x12'));var as=require(_0x075e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x075e('0x14'))(_0x075e('0x15'));var utils=require(_0x075e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x075e('0x17'));var db=require(_0x075e('0x18'))['db'];function respondWithStatusCode(_0xa589db,_0x1e8a65){_0x1e8a65=_0x1e8a65||0xcc;return function(_0x546e3e){if(_0x546e3e){return _0xa589db[_0x075e('0x19')](_0x1e8a65);}return _0xa589db[_0x075e('0x1a')](_0x1e8a65)[_0x075e('0x1b')]();};}function respondWithResult(_0x5156de,_0xd02722){_0xd02722=_0xd02722||0xc8;return function(_0x18ee53){if(_0x18ee53){return _0x5156de[_0x075e('0x1a')](_0xd02722)[_0x075e('0x1c')](_0x18ee53);}};}function respondWithFilteredResult(_0x434692,_0x4af534){return function(_0x54c038){if(_0x54c038){var _0x47b866=typeof _0x4af534[_0x075e('0x1d')]==='undefined'&&typeof _0x4af534[_0x075e('0x1e')]===_0x075e('0x1f');var _0x412b67=_0x54c038[_0x075e('0x20')];var _0xf23184=_0x47b866?0x0:_0x4af534[_0x075e('0x1d')];var _0xba07b3=_0x47b866?_0x54c038[_0x075e('0x20')]:_0x4af534[_0x075e('0x1d')]+_0x4af534[_0x075e('0x1e')];var _0x57cb7f;if(_0xba07b3>=_0x412b67){_0xba07b3=_0x412b67;_0x57cb7f=0xc8;}else{_0x57cb7f=0xce;}_0x434692[_0x075e('0x1a')](_0x57cb7f);return _0x434692[_0x075e('0x21')]('Content-Range',_0xf23184+'-'+_0xba07b3+'/'+_0x412b67)[_0x075e('0x1c')](_0x54c038);}return null;};}function patchUpdates(_0x48c8e4){return function(_0x365b4b){try{jsonpatch[_0x075e('0x22')](_0x365b4b,_0x48c8e4,!![]);}catch(_0x154d14){return BPromise[_0x075e('0x23')](_0x154d14);}return _0x365b4b[_0x075e('0x24')]();};}function saveUpdates(_0x57eeb0,_0x22ef35){return function(_0x59d240){if(_0x59d240){return _0x59d240[_0x075e('0x25')](_0x57eeb0)['then'](function(_0x551574){return _0x551574;});}return null;};}function removeEntity(_0x2f011c,_0xb07b81){return function(_0x358296){if(_0x358296){return _0x358296[_0x075e('0x26')]()['then'](function(){_0x2f011c[_0x075e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x85d180,_0x1a4ebc){return function(_0x43c47e){if(!_0x43c47e){_0x85d180[_0x075e('0x19')](0x194);}return _0x43c47e;};}function handleError(_0x99c89f,_0x13f6bf){_0x13f6bf=_0x13f6bf||0x1f4;return function(_0x27212d){logger[_0x075e('0x27')](_0x27212d[_0x075e('0x28')]);if(_0x27212d[_0x075e('0x29')]){delete _0x27212d[_0x075e('0x29')];}_0x99c89f[_0x075e('0x1a')](_0x13f6bf)[_0x075e('0x2a')](_0x27212d);};}exports[_0x075e('0x2b')]=function(_0x1e6558,_0x1373d3){var _0x19d9da={},_0x1477dc={},_0x349250={'count':0x0,'rows':[]};var _0x25d069=_[_0x075e('0x2c')](db[_0x075e('0x2d')][_0x075e('0x2e')],function(_0x3bf86){return{'name':_0x3bf86[_0x075e('0x2f')],'type':_0x3bf86[_0x075e('0x30')]['key']};});_0x1477dc[_0x075e('0x31')]=_[_0x075e('0x2c')](_0x25d069,_0x075e('0x29'));_0x1477dc[_0x075e('0x32')]=_[_0x075e('0x33')](_0x1e6558[_0x075e('0x32')]);_0x1477dc['filters']=_[_0x075e('0x34')](_0x1477dc[_0x075e('0x31')],_0x1477dc[_0x075e('0x32')]);_0x19d9da[_0x075e('0x35')]=_[_0x075e('0x34')](_0x1477dc[_0x075e('0x31')],qs[_0x075e('0x36')](_0x1e6558[_0x075e('0x32')][_0x075e('0x36')]));_0x19d9da[_0x075e('0x35')]=_0x19d9da[_0x075e('0x35')][_0x075e('0x37')]?_0x19d9da['attributes']:_0x1477dc[_0x075e('0x31')];if(!_0x1e6558['query'][_0x075e('0x38')](_0x075e('0x39'))){_0x19d9da[_0x075e('0x1e')]=qs['limit'](_0x1e6558[_0x075e('0x32')][_0x075e('0x1e')]);_0x19d9da[_0x075e('0x1d')]=qs['offset'](_0x1e6558['query'][_0x075e('0x1d')]);}_0x19d9da[_0x075e('0x3a')]=qs[_0x075e('0x3b')](_0x1e6558[_0x075e('0x32')]['sort']);_0x19d9da[_0x075e('0x3c')]=qs[_0x075e('0x3d')](_[_0x075e('0x3e')](_0x1e6558['query'],_0x1477dc[_0x075e('0x3d')]),_0x25d069);if(_0x1e6558[_0x075e('0x32')]['filter']){_0x19d9da['where']=_[_0x075e('0x3f')](_0x19d9da[_0x075e('0x3c')],{'$or':_[_0x075e('0x2c')](_0x25d069,function(_0x36534f){if(_0x36534f['type']!==_0x075e('0x40')){var _0x183fae={};_0x183fae[_0x36534f[_0x075e('0x29')]]={'$like':'%'+_0x1e6558[_0x075e('0x32')][_0x075e('0x41')]+'%'};return _0x183fae;}})});}_0x19d9da=_[_0x075e('0x3f')]({},_0x19d9da,_0x1e6558['options']);var _0x2689c7={'where':_0x19d9da[_0x075e('0x3c')]};return db[_0x075e('0x2d')][_0x075e('0x20')](_0x2689c7)[_0x075e('0x42')](function(_0x1ffd2c){_0x349250[_0x075e('0x20')]=_0x1ffd2c;if(_0x1e6558[_0x075e('0x32')]['includeAll']){_0x19d9da['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x075e('0x43')](_0x19d9da);})[_0x075e('0x42')](function(_0x3dbeca){_0x349250[_0x075e('0x44')]=_0x3dbeca;return _0x349250;})[_0x075e('0x42')](respondWithFilteredResult(_0x1373d3,_0x19d9da))[_0x075e('0x45')](handleError(_0x1373d3,null));};exports[_0x075e('0x46')]=function(_0x3c1fc6,_0x295d60){var _0x4df77e={'raw':!![],'where':{'id':_0x3c1fc6['params']['id']}},_0x35261e={};_0x35261e[_0x075e('0x31')]=_['keys'](db[_0x075e('0x2d')]['rawAttributes']);_0x35261e[_0x075e('0x32')]=_[_0x075e('0x33')](_0x3c1fc6[_0x075e('0x32')]);_0x35261e['filters']=_['intersection'](_0x35261e['model'],_0x35261e['query']);_0x4df77e['attributes']=_[_0x075e('0x34')](_0x35261e[_0x075e('0x31')],qs[_0x075e('0x36')](_0x3c1fc6[_0x075e('0x32')][_0x075e('0x36')]));_0x4df77e[_0x075e('0x35')]=_0x4df77e[_0x075e('0x35')][_0x075e('0x37')]?_0x4df77e[_0x075e('0x35')]:_0x35261e[_0x075e('0x31')];if(_0x3c1fc6[_0x075e('0x32')][_0x075e('0x47')]){_0x4df77e[_0x075e('0x48')]=[{'all':!![]}];}_0x4df77e=_[_0x075e('0x3f')]({},_0x4df77e,_0x3c1fc6[_0x075e('0x49')]);return db[_0x075e('0x2d')]['find'](_0x4df77e)[_0x075e('0x42')](handleEntityNotFound(_0x295d60,null))[_0x075e('0x42')](respondWithResult(_0x295d60,null))[_0x075e('0x45')](handleError(_0x295d60,null));};exports[_0x075e('0x4a')]=function(_0x561ad6,_0x3246d2){return db[_0x075e('0x2d')][_0x075e('0x4a')](_0x561ad6[_0x075e('0x4b')],{})['then'](respondWithResult(_0x3246d2,0xc9))['catch'](handleError(_0x3246d2,null));};exports[_0x075e('0x25')]=function(_0x2cce40,_0x2404a5){if(_0x2cce40[_0x075e('0x4b')]['id']){delete _0x2cce40[_0x075e('0x4b')]['id'];}return db[_0x075e('0x2d')][_0x075e('0x4c')]({'where':{'id':_0x2cce40[_0x075e('0x4d')]['id']}})[_0x075e('0x42')](handleEntityNotFound(_0x2404a5,null))[_0x075e('0x42')](saveUpdates(_0x2cce40[_0x075e('0x4b')],null))[_0x075e('0x42')](respondWithResult(_0x2404a5,null))[_0x075e('0x45')](handleError(_0x2404a5,null));};exports[_0x075e('0x26')]=function(_0x2bf25c,_0x1e8333){return db[_0x075e('0x2d')]['find']({'where':{'id':_0x2bf25c[_0x075e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1e8333,null))[_0x075e('0x42')](removeEntity(_0x1e8333,null))[_0x075e('0x45')](handleError(_0x1e8333,null));};exports[_0x075e('0x4e')]=function(_0x570c45,_0x556a13){return db[_0x075e('0x2d')][_0x075e('0x4e')]()[_0x075e('0x42')](respondWithResult(_0x556a13,null))[_0x075e('0x45')](handleError(_0x556a13,null));}; \ No newline at end of file +var _0x49c1=['destroy','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','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','findAll','catch','show','params','includeAll','include','merge','find','create','body'];(function(_0x21b74b,_0x543c76){var _0x518cc6=function(_0x5b3010){while(--_0x5b3010){_0x21b74b['push'](_0x21b74b['shift']());}};_0x518cc6(++_0x543c76);}(_0x49c1,0x132));var _0x149c=function(_0x208c41,_0x244d82){_0x208c41=_0x208c41-0x0;var _0x537811=_0x49c1[_0x208c41];return _0x537811;};'use strict';var emlformat=require(_0x149c('0x0'));var rimraf=require(_0x149c('0x1'));var zipdir=require(_0x149c('0x2'));var jsonpatch=require(_0x149c('0x3'));var rp=require(_0x149c('0x4'));var moment=require(_0x149c('0x5'));var BPromise=require(_0x149c('0x6'));var Mustache=require(_0x149c('0x7'));var util=require(_0x149c('0x8'));var path=require(_0x149c('0x9'));var sox=require(_0x149c('0xa'));var csv=require(_0x149c('0xb'));var ejs=require(_0x149c('0xc'));var fs=require('fs');var fs_extra=require(_0x149c('0xd'));var _=require(_0x149c('0xe'));var squel=require(_0x149c('0xf'));var crypto=require(_0x149c('0x10'));var jsforce=require(_0x149c('0x11'));var deskjs=require(_0x149c('0x12'));var toCsv=require(_0x149c('0xb'));var querystring=require(_0x149c('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x149c('0x14'));var qs=require(_0x149c('0x15'));var as=require(_0x149c('0x16'));var hardwareService=require(_0x149c('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x149c('0x18'));var config=require(_0x149c('0x19'));var licenseUtil=require(_0x149c('0x1a'));var db=require(_0x149c('0x1b'))['db'];function respondWithStatusCode(_0x14fd90,_0x24b4b5){_0x24b4b5=_0x24b4b5||0xcc;return function(_0x158d6d){if(_0x158d6d){return _0x14fd90[_0x149c('0x1c')](_0x24b4b5);}return _0x14fd90[_0x149c('0x1d')](_0x24b4b5)[_0x149c('0x1e')]();};}function respondWithResult(_0x128950,_0x50c0ac){_0x50c0ac=_0x50c0ac||0xc8;return function(_0x48ba48){if(_0x48ba48){return _0x128950[_0x149c('0x1d')](_0x50c0ac)[_0x149c('0x1f')](_0x48ba48);}};}function respondWithFilteredResult(_0x141863,_0xbabfa9){return function(_0x1fa75b){if(_0x1fa75b){var _0x365a7c=typeof _0xbabfa9[_0x149c('0x20')]===_0x149c('0x21')&&typeof _0xbabfa9[_0x149c('0x22')]===_0x149c('0x21');var _0x557644=_0x1fa75b['count'];var _0x4c86df=_0x365a7c?0x0:_0xbabfa9[_0x149c('0x20')];var _0x2f6684=_0x365a7c?_0x1fa75b[_0x149c('0x23')]:_0xbabfa9['offset']+_0xbabfa9['limit'];var _0x1182f6;if(_0x2f6684>=_0x557644){_0x2f6684=_0x557644;_0x1182f6=0xc8;}else{_0x1182f6=0xce;}_0x141863[_0x149c('0x1d')](_0x1182f6);return _0x141863[_0x149c('0x24')](_0x149c('0x25'),_0x4c86df+'-'+_0x2f6684+'/'+_0x557644)[_0x149c('0x1f')](_0x1fa75b);}return null;};}function patchUpdates(_0x5dfc8b){return function(_0x5b7cee){try{jsonpatch[_0x149c('0x26')](_0x5b7cee,_0x5dfc8b,!![]);}catch(_0x1ea1c7){return BPromise['reject'](_0x1ea1c7);}return _0x5b7cee[_0x149c('0x27')]();};}function saveUpdates(_0x54dc34,_0x350f15){return function(_0x3b86ac){if(_0x3b86ac){return _0x3b86ac[_0x149c('0x28')](_0x54dc34)[_0x149c('0x29')](function(_0x5c554d){return _0x5c554d;});}return null;};}function removeEntity(_0x36947d,_0xc2b47d){return function(_0x45d5f0){if(_0x45d5f0){return _0x45d5f0['destroy']()[_0x149c('0x29')](function(){_0x36947d[_0x149c('0x1d')](0xcc)[_0x149c('0x1e')]();});}};}function handleEntityNotFound(_0x38e6be,_0x381dc9){return function(_0x40a959){if(!_0x40a959){_0x38e6be['sendStatus'](0x194);}return _0x40a959;};}function handleError(_0x55112d,_0x5cdefa){_0x5cdefa=_0x5cdefa||0x1f4;return function(_0x239f9b){logger['error'](_0x239f9b['stack']);if(_0x239f9b[_0x149c('0x2a')]){delete _0x239f9b[_0x149c('0x2a')];}_0x55112d[_0x149c('0x1d')](_0x5cdefa)['send'](_0x239f9b);};}exports['index']=function(_0xeaa917,_0x47b53b){var _0x2ed79a={},_0x440af8={},_0x146275={'count':0x0,'rows':[]};var _0x19df33=_['map'](db[_0x149c('0x2b')][_0x149c('0x2c')],function(_0x4d0903){return{'name':_0x4d0903[_0x149c('0x2d')],'type':_0x4d0903[_0x149c('0x2e')][_0x149c('0x2f')]};});_0x440af8[_0x149c('0x30')]=_[_0x149c('0x31')](_0x19df33,_0x149c('0x2a'));_0x440af8[_0x149c('0x32')]=_[_0x149c('0x33')](_0xeaa917['query']);_0x440af8[_0x149c('0x34')]=_['intersection'](_0x440af8[_0x149c('0x30')],_0x440af8['query']);_0x2ed79a[_0x149c('0x35')]=_[_0x149c('0x36')](_0x440af8[_0x149c('0x30')],qs[_0x149c('0x37')](_0xeaa917['query'][_0x149c('0x37')]));_0x2ed79a['attributes']=_0x2ed79a['attributes'][_0x149c('0x38')]?_0x2ed79a[_0x149c('0x35')]:_0x440af8['model'];if(!_0xeaa917[_0x149c('0x32')]['hasOwnProperty'](_0x149c('0x39'))){_0x2ed79a[_0x149c('0x22')]=qs['limit'](_0xeaa917[_0x149c('0x32')][_0x149c('0x22')]);_0x2ed79a[_0x149c('0x20')]=qs[_0x149c('0x20')](_0xeaa917[_0x149c('0x32')][_0x149c('0x20')]);}_0x2ed79a['order']=qs[_0x149c('0x3a')](_0xeaa917['query'][_0x149c('0x3a')]);_0x2ed79a[_0x149c('0x3b')]=qs['filters'](_[_0x149c('0x3c')](_0xeaa917[_0x149c('0x32')],_0x440af8[_0x149c('0x34')]),_0x19df33);if(_0xeaa917[_0x149c('0x32')][_0x149c('0x3d')]){_0x2ed79a['where']=_['merge'](_0x2ed79a[_0x149c('0x3b')],{'$or':_[_0x149c('0x31')](_0x19df33,function(_0x27a93f){if(_0x27a93f[_0x149c('0x2e')]!==_0x149c('0x3e')){var _0x4d6f29={};_0x4d6f29[_0x27a93f[_0x149c('0x2a')]]={'$like':'%'+_0xeaa917[_0x149c('0x32')][_0x149c('0x3d')]+'%'};return _0x4d6f29;}})});}_0x2ed79a=_['merge']({},_0x2ed79a,_0xeaa917[_0x149c('0x3f')]);var _0x562eea={'where':_0x2ed79a['where']};return db[_0x149c('0x2b')][_0x149c('0x23')](_0x562eea)['then'](function(_0x556180){_0x146275[_0x149c('0x23')]=_0x556180;if(_0xeaa917['query']['includeAll']){_0x2ed79a['include']=[{'all':!![]}];}return db[_0x149c('0x2b')][_0x149c('0x40')](_0x2ed79a);})['then'](function(_0x5f30a6){_0x146275['rows']=_0x5f30a6;return _0x146275;})[_0x149c('0x29')](respondWithFilteredResult(_0x47b53b,_0x2ed79a))[_0x149c('0x41')](handleError(_0x47b53b,null));};exports[_0x149c('0x42')]=function(_0x95777e,_0x2a8c3c){var _0x4977e6={'raw':!![],'where':{'id':_0x95777e[_0x149c('0x43')]['id']}},_0x138ee3={};_0x138ee3['model']=_[_0x149c('0x33')](db[_0x149c('0x2b')][_0x149c('0x2c')]);_0x138ee3['query']=_[_0x149c('0x33')](_0x95777e[_0x149c('0x32')]);_0x138ee3[_0x149c('0x34')]=_['intersection'](_0x138ee3[_0x149c('0x30')],_0x138ee3[_0x149c('0x32')]);_0x4977e6[_0x149c('0x35')]=_['intersection'](_0x138ee3['model'],qs[_0x149c('0x37')](_0x95777e['query'][_0x149c('0x37')]));_0x4977e6['attributes']=_0x4977e6['attributes'][_0x149c('0x38')]?_0x4977e6['attributes']:_0x138ee3[_0x149c('0x30')];if(_0x95777e[_0x149c('0x32')][_0x149c('0x44')]){_0x4977e6[_0x149c('0x45')]=[{'all':!![]}];}_0x4977e6=_[_0x149c('0x46')]({},_0x4977e6,_0x95777e[_0x149c('0x3f')]);return db[_0x149c('0x2b')][_0x149c('0x47')](_0x4977e6)[_0x149c('0x29')](handleEntityNotFound(_0x2a8c3c,null))['then'](respondWithResult(_0x2a8c3c,null))[_0x149c('0x41')](handleError(_0x2a8c3c,null));};exports[_0x149c('0x48')]=function(_0x1cac92,_0x36e74c){return db[_0x149c('0x2b')][_0x149c('0x48')](_0x1cac92[_0x149c('0x49')],{})['then'](respondWithResult(_0x36e74c,0xc9))['catch'](handleError(_0x36e74c,null));};exports[_0x149c('0x28')]=function(_0x1768ef,_0x1f1d6e){if(_0x1768ef[_0x149c('0x49')]['id']){delete _0x1768ef[_0x149c('0x49')]['id'];}return db[_0x149c('0x2b')]['find']({'where':{'id':_0x1768ef[_0x149c('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f1d6e,null))[_0x149c('0x29')](saveUpdates(_0x1768ef[_0x149c('0x49')],null))[_0x149c('0x29')](respondWithResult(_0x1f1d6e,null))[_0x149c('0x41')](handleError(_0x1f1d6e,null));};exports[_0x149c('0x4a')]=function(_0x59650a,_0x21e901){return db[_0x149c('0x2b')][_0x149c('0x47')]({'where':{'id':_0x59650a[_0x149c('0x43')]['id']}})[_0x149c('0x29')](handleEntityNotFound(_0x21e901,null))[_0x149c('0x29')](removeEntity(_0x21e901,null))['catch'](handleError(_0x21e901,null));};exports[_0x149c('0x4b')]=function(_0x48ad9a,_0x1fde6e){return db[_0x149c('0x2b')][_0x149c('0x4b')]()[_0x149c('0x29')](respondWithResult(_0x1fde6e,null))[_0x149c('0x41')](handleError(_0x1fde6e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 08d09a4..f3dd43a 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07bd=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x07bd,0xea));var _0xd07b=function(_0x4ce57f,_0x1a084d){_0x4ce57f=_0x4ce57f-0x0;var _0x4de043=_0x07bd[_0x4ce57f];return _0x4de043;};'use strict';var _=require(_0xd07b('0x0'));var util=require(_0xd07b('0x1'));var logger=require(_0xd07b('0x2'))(_0xd07b('0x3'));var moment=require(_0xd07b('0x4'));var BPromise=require('bluebird');var rp=require(_0xd07b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd07b('0x6'));var config=require('../../config/environment');var attributes=require(_0xd07b('0x7'));module[_0xd07b('0x8')]=function(_0x242abf,_0x188caa){return _0x242abf[_0xd07b('0x9')](_0xd07b('0xa'),attributes,{'tableName':_0xd07b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd07b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc4e=['moment','request-promise','path','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api'];(function(_0x4b5b25,_0x30816d){var _0x44b6ca=function(_0x507e31){while(--_0x507e31){_0x4b5b25['push'](_0x4b5b25['shift']());}};_0x44b6ca(++_0x30816d);}(_0xcc4e,0x174));var _0xecc4=function(_0x35d30d,_0x3979c8){_0x35d30d=_0x35d30d-0x0;var _0x322326=_0xcc4e[_0x35d30d];return _0x322326;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xecc4('0x0'))(_0xecc4('0x1'));var moment=require(_0xecc4('0x2'));var BPromise=require('bluebird');var rp=require(_0xecc4('0x3'));var fs=require('fs');var path=require(_0xecc4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xecc4('0x5'));module[_0xecc4('0x6')]=function(_0x5c29c7,_0x3eeb7d){return _0x5c29c7[_0xecc4('0x7')](_0xecc4('0x8'),attributes,{'tableName':_0xecc4('0x9'),'paranoid':![],'indexes':[{'fields':[_0xecc4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7f995dc..cba6c1e 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78c6=['info','update','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then'];(function(_0x472fdb,_0x33facc){var _0x3e632e=function(_0x5b00f7){while(--_0x5b00f7){_0x472fdb['push'](_0x472fdb['shift']());}};_0x3e632e(++_0x33facc);}(_0x78c6,0x10e));var _0x678c=function(_0x2d6db5,_0x159148){_0x2d6db5=_0x2d6db5-0x0;var _0x5a73ee=_0x78c6[_0x2d6db5];return _0x5a73ee;};'use strict';var _=require(_0x678c('0x0'));var util=require(_0x678c('0x1'));var moment=require(_0x678c('0x2'));var BPromise=require(_0x678c('0x3'));var rs=require(_0x678c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x678c('0x5'))['db'];var utils=require(_0x678c('0x6'));var logger=require(_0x678c('0x7'))(_0x678c('0x8'));var config=require(_0x678c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x678c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8fff49,_0x7949a4,_0x32c03f){return new BPromise(function(_0x2af037,_0xe3d394){return client['request'](_0x8fff49,_0x32c03f)['then'](function(_0x10af4c){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x7949a4,_0x678c('0xb'));logger[_0x678c('0xc')](_0x678c('0xd'),_0x7949a4,_0x678c('0xb'),JSON[_0x678c('0xe')](_0x10af4c));if(_0x10af4c[_0x678c('0xf')]){if(_0x10af4c[_0x678c('0xf')][_0x678c('0x10')]===0x1f4){logger['error'](_0x678c('0x11'),_0x7949a4,_0x10af4c['error'][_0x678c('0x12')]);return _0xe3d394(_0x10af4c[_0x678c('0xf')]['message']);}logger[_0x678c('0xf')](_0x678c('0x11'),_0x7949a4,_0x10af4c[_0x678c('0xf')][_0x678c('0x12')]);return _0x2af037(_0x10af4c['error']['message']);}else{logger['info'](_0x678c('0x11'),_0x7949a4,'request\x20sent');_0x2af037(_0x10af4c['result'][_0x678c('0x12')]);}})[_0x678c('0x13')](function(_0x86a496){logger[_0x678c('0xf')](_0x678c('0x11'),_0x7949a4,_0x86a496);_0xe3d394(_0x86a496);});});}exports[_0x678c('0x14')]=function(_0x806b84){var _0x20fc78=this;return new Promise(function(_0xda9e75,_0x4e4fbe){return db[_0x678c('0x15')][_0x678c('0x16')](_0x806b84[_0x678c('0x17')],{'raw':_0x806b84[_0x678c('0x18')]?_0x806b84[_0x678c('0x18')][_0x678c('0x19')]===undefined?!![]:![]:!![]})[_0x678c('0x1a')](function(_0x502ad4){logger[_0x678c('0x1b')](_0x678c('0x14'),_0x806b84);logger[_0x678c('0xc')]('CreateVoiceDialReport',_0x806b84,JSON[_0x678c('0xe')](_0x502ad4));_0xda9e75(_0x502ad4);})[_0x678c('0x13')](function(_0x406961){logger[_0x678c('0xf')](_0x678c('0x14'),_0x406961[_0x678c('0x12')],_0x806b84);_0x4e4fbe(_0x20fc78[_0x678c('0xf')](0x1f4,_0x406961[_0x678c('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0x873cfc){var _0x36e929=this;return new Promise(function(_0x1aaf7c,_0x5f4c43){return db[_0x678c('0x15')][_0x678c('0x1c')](_0x873cfc[_0x678c('0x17')],{'raw':_0x873cfc['options']?_0x873cfc['options'][_0x678c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x873cfc[_0x678c('0x18')]?_0x873cfc[_0x678c('0x18')][_0x678c('0x1d')]||null:null,'attributes':_0x873cfc['options']?_0x873cfc[_0x678c('0x18')][_0x678c('0x1e')]||null:null,'limit':_0x873cfc[_0x678c('0x18')]?_0x873cfc[_0x678c('0x18')][_0x678c('0x1f')]||null:null})['then'](function(_0x455ff5){logger[_0x678c('0x1b')](_0x678c('0x20'),_0x873cfc);logger['debug'](_0x678c('0x20'),_0x873cfc,JSON[_0x678c('0xe')](_0x455ff5));_0x1aaf7c(_0x455ff5);})[_0x678c('0x13')](function(_0x2cd968){logger[_0x678c('0xf')](_0x678c('0x20'),_0x2cd968[_0x678c('0x12')],_0x873cfc);_0x5f4c43(_0x36e929[_0x678c('0xf')](0x1f4,_0x2cd968[_0x678c('0x12')]));});});}; \ No newline at end of file +var _0x40a9=['../../config/logger','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','UpdateVoiceDialReport','body','where','lodash','util','../../mysqldb','../../config/utils'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x40a9,0xb2));var _0x940a=function(_0x317fd3,_0x1536e7){_0x317fd3=_0x317fd3-0x0;var _0x281ac8=_0x40a9[_0x317fd3];return _0x281ac8;};'use strict';var _=require(_0x940a('0x0'));var util=require(_0x940a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x940a('0x2'))['db'];var utils=require(_0x940a('0x3'));var logger=require(_0x940a('0x4'))('rpc');var config=require(_0x940a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x940a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3fa8a8,_0x508ec7,_0x5c9e91){return new BPromise(function(_0x4bf34b,_0x2fd526){return client[_0x940a('0x7')](_0x3fa8a8,_0x5c9e91)[_0x940a('0x8')](function(_0x3e9239){logger[_0x940a('0x9')](_0x940a('0xa'),_0x508ec7,_0x940a('0xb'));logger[_0x940a('0xc')](_0x940a('0xd'),_0x508ec7,_0x940a('0xb'),JSON[_0x940a('0xe')](_0x3e9239));if(_0x3e9239[_0x940a('0xf')]){if(_0x3e9239[_0x940a('0xf')]['code']===0x1f4){logger[_0x940a('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x508ec7,_0x3e9239['error'][_0x940a('0x10')]);return _0x2fd526(_0x3e9239[_0x940a('0xf')][_0x940a('0x10')]);}logger[_0x940a('0xf')](_0x940a('0xa'),_0x508ec7,_0x3e9239[_0x940a('0xf')][_0x940a('0x10')]);return _0x4bf34b(_0x3e9239[_0x940a('0xf')][_0x940a('0x10')]);}else{logger[_0x940a('0x9')](_0x940a('0xa'),_0x508ec7,_0x940a('0xb'));_0x4bf34b(_0x3e9239[_0x940a('0x11')][_0x940a('0x10')]);}})[_0x940a('0x12')](function(_0x509d73){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x508ec7,_0x509d73);_0x2fd526(_0x509d73);});});}exports[_0x940a('0x13')]=function(_0x2c1690){var _0x4d7ca3=this;return new Promise(function(_0x2aec1a,_0x26153d){return db[_0x940a('0x14')]['create'](_0x2c1690['body'],{'raw':_0x2c1690[_0x940a('0x15')]?_0x2c1690[_0x940a('0x15')][_0x940a('0x16')]===undefined?!![]:![]:!![]})[_0x940a('0x8')](function(_0x1fa6c9){logger[_0x940a('0x9')]('CreateVoiceDialReport',_0x2c1690);logger[_0x940a('0xc')](_0x940a('0x13'),_0x2c1690,JSON[_0x940a('0xe')](_0x1fa6c9));_0x2aec1a(_0x1fa6c9);})[_0x940a('0x12')](function(_0x49b3fd){logger[_0x940a('0xf')](_0x940a('0x13'),_0x49b3fd[_0x940a('0x10')],_0x2c1690);_0x26153d(_0x4d7ca3[_0x940a('0xf')](0x1f4,_0x49b3fd[_0x940a('0x10')]));});});};exports[_0x940a('0x17')]=function(_0x5dbe1a){var _0x509ac1=this;return new Promise(function(_0x52c78d,_0xb83d57){return db['VoiceDialReport']['update'](_0x5dbe1a[_0x940a('0x18')],{'raw':_0x5dbe1a[_0x940a('0x15')]?_0x5dbe1a[_0x940a('0x15')][_0x940a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dbe1a[_0x940a('0x15')]?_0x5dbe1a[_0x940a('0x15')][_0x940a('0x19')]||null:null,'attributes':_0x5dbe1a['options']?_0x5dbe1a[_0x940a('0x15')]['attributes']||null:null,'limit':_0x5dbe1a[_0x940a('0x15')]?_0x5dbe1a[_0x940a('0x15')]['limit']||null:null})[_0x940a('0x8')](function(_0x3c7efa){logger[_0x940a('0x9')](_0x940a('0x17'),_0x5dbe1a);logger[_0x940a('0xc')](_0x940a('0x17'),_0x5dbe1a,JSON[_0x940a('0xe')](_0x3c7efa));_0x52c78d(_0x3c7efa);})['catch'](function(_0xf3d08d){logger['error'](_0x940a('0x17'),_0xf3d08d[_0x940a('0x10')],_0x5dbe1a);_0xb83d57(_0x509ac1['error'](0x1f4,_0xf3d08d[_0x940a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 0538b87..1eb3ea1 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83de=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0xd5160a,_0x572c4b){var _0x576cf9=function(_0xa95da6){while(--_0xa95da6){_0xd5160a['push'](_0xd5160a['shift']());}};_0x576cf9(++_0x572c4b);}(_0x83de,0xe9));var _0xe83d=function(_0x2b90e1,_0x430e18){_0x2b90e1=_0x2b90e1-0x0;var _0x243683=_0x83de[_0x2b90e1];return _0x243683;};'use strict';var multer=require(_0xe83d('0x0'));var util=require(_0xe83d('0x1'));var path=require('path');var timeout=require(_0xe83d('0x2'));var express=require('express');var router=express[_0xe83d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe83d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe83d('0x5'));var controller=require(_0xe83d('0x6'));router[_0xe83d('0x7')]('/',auth[_0xe83d('0x8')](),controller[_0xe83d('0x9')]);router['get']('/:id',auth[_0xe83d('0x8')](),controller[_0xe83d('0xa')]);router[_0xe83d('0xb')]('/',auth[_0xe83d('0x8')](),controller['create']);router[_0xe83d('0xb')]('/:id/applications',auth[_0xe83d('0x8')](),controller['addApplications']);router[_0xe83d('0xc')](_0xe83d('0xd'),auth[_0xe83d('0x8')](),controller[_0xe83d('0xe')]);router[_0xe83d('0xf')](_0xe83d('0xd'),auth['isAuthenticated'](),controller[_0xe83d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x011d=['post','/:id/applications','addApplications','/:id','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x44d752,_0x41bcdc){var _0x3c616e=function(_0x372911){while(--_0x372911){_0x44d752['push'](_0x44d752['shift']());}};_0x3c616e(++_0x41bcdc);}(_0x011d,0x1e0));var _0xd011=function(_0x157c61,_0x30bd32){_0x157c61=_0x157c61-0x0;var _0x2da230=_0x011d[_0x157c61];return _0x2da230;};'use strict';var multer=require(_0xd011('0x0'));var util=require('util');var path=require(_0xd011('0x1'));var timeout=require(_0xd011('0x2'));var express=require(_0xd011('0x3'));var router=express[_0xd011('0x4')]();var fs_extra=require(_0xd011('0x5'));var auth=require(_0xd011('0x6'));var interaction=require(_0xd011('0x7'));var config=require(_0xd011('0x8'));var controller=require('./voiceExtension.controller');router[_0xd011('0x9')]('/',auth[_0xd011('0xa')](),controller[_0xd011('0xb')]);router['get']('/:id',auth[_0xd011('0xa')](),controller[_0xd011('0xc')]);router['post']('/',auth[_0xd011('0xa')](),controller[_0xd011('0xd')]);router[_0xd011('0xe')](_0xd011('0xf'),auth[_0xd011('0xa')](),controller[_0xd011('0x10')]);router['put'](_0xd011('0x11'),auth[_0xd011('0xa')](),controller['update']);router[_0xd011('0x12')]('/:id',auth[_0xd011('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 3b4b10b..b32418d 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a5d=['system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax'];(function(_0x4d2c47,_0x5e78db){var _0x572e4a=function(_0x3b4608){while(--_0x3b4608){_0x4d2c47['push'](_0x4d2c47['shift']());}};_0x572e4a(++_0x5e78db);}(_0x2a5d,0x149));var _0xd2a5=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x2a5d[_0x310a1b];return _0xdea206;};'use strict';var Sequelize=require(_0xd2a5('0x0'));module[_0xd2a5('0x1')]={'context':{'type':Sequelize[_0xd2a5('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd2a5('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xd2a5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd2a5('0x2')],'allowNull':![],'defaultValue':_0xd2a5('0x4')},'appdata':{'type':Sequelize[_0xd2a5('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd2a5('0x5')](_0xd2a5('0x6'),_0xd2a5('0x7'),_0xd2a5('0x8'),_0xd2a5('0x9'),_0xd2a5('0xa'),_0xd2a5('0xb'),_0xd2a5('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0xd2a5('0x2')]},'interval':{'type':Sequelize[_0xd2a5('0x2')],'allowNull':![],'defaultValue':_0xd2a5('0xd')},'IntervalId':{'type':Sequelize[_0xd2a5('0xe')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd2a5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd2a5('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xd2a5('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd2a5('0xe')]},'recordingFormat':{'type':Sequelize[_0xd2a5('0x2')],'defaultValue':_0xd2a5('0x10')},'answer':{'type':Sequelize[_0xd2a5('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd2a5('0x11')],'get':function(_0x1bd8bd){return this[_0xd2a5('0x12')](_0xd2a5('0x13'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd6e3=['wav','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN'];(function(_0x54761b,_0x3e65be){var _0x4caf3d=function(_0x569b0d){while(--_0x569b0d){_0x54761b['push'](_0x54761b['shift']());}};_0x4caf3d(++_0x3e65be);}(_0xd6e3,0x1b2));var _0x3d6e=function(_0x53c1cf,_0x4ff3ac){_0x53c1cf=_0x53c1cf-0x0;var _0x4e1dd9=_0xd6e3[_0x53c1cf];return _0x4e1dd9;};'use strict';var Sequelize=require(_0x3d6e('0x0'));module[_0x3d6e('0x1')]={'context':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'unique':_0x3d6e('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'unique':_0x3d6e('0x3')},'priority':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x3d6e('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d6e('0x4')},'appdata':{'type':Sequelize[_0x3d6e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3d6e('0x5')]('inbound',_0x3d6e('0x6'),_0x3d6e('0x7'),_0x3d6e('0x8'),_0x3d6e('0x9'),_0x3d6e('0xa'),_0x3d6e('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x3d6e('0x2')]},'interval':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x3d6e('0xc')]},'isApp':{'type':Sequelize[_0x3d6e('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3d6e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x3d6e('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3d6e('0xc')]},'recordingFormat':{'type':Sequelize[_0x3d6e('0x2')],'defaultValue':_0x3d6e('0xe')},'answer':{'type':Sequelize[_0x3d6e('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x25c86c){return this[_0x3d6e('0xf')]('exten');}},'alias':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 276f3bc..e033604 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc063=['sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','then','InboundRoutes','inbound','InternalRoutes','internal','filter','map','value','type','find','name','UserProfileResource','end','error','send','index','VoiceExtension','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','destroy','body','outbound','startsWith','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias'];(function(_0x3a9570,_0x5232a6){var _0x211ecb=function(_0x3af373){while(--_0x3af373){_0x3a9570['push'](_0x3a9570['shift']());}};_0x211ecb(++_0x5232a6);}(_0xc063,0x64));var _0x3c06=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0xc063[_0x45d56b];return _0xd62e37;};'use strict';var _=require(_0x3c06('0x0'));var Redis=require(_0x3c06('0x1'));var qs=require(_0x3c06('0x2'));var logger=require(_0x3c06('0x3'))(_0x3c06('0x4'));var config=require(_0x3c06('0x5'));var db=require('../../mysqldb')['db'];config[_0x3c06('0x6')]=_[_0x3c06('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c06('0x8'))(new Redis(config[_0x3c06('0x6')]));require(_0x3c06('0x9'))[_0x3c06('0xa')](socket);function respondWithStatusCode(_0x59ed54,_0x34ca8d){_0x34ca8d=_0x34ca8d||0xcc;return function(_0x55a4e6){if(_0x55a4e6){return _0x59ed54[_0x3c06('0xb')](_0x34ca8d);}return _0x59ed54[_0x3c06('0xc')](_0x34ca8d)['end']();};}function respondWithResult(_0x146186,_0x52579c){_0x52579c=_0x52579c||0xc8;return function(_0xf8a9a){if(_0xf8a9a){return _0x146186[_0x3c06('0xc')](_0x52579c)[_0x3c06('0xd')](_0xf8a9a);}};}function respondWithFilteredResult(_0x2d405b,_0x49aacc){return function(_0x2869bd){if(_0x2869bd){var _0x2efca2=typeof _0x49aacc[_0x3c06('0xe')]===_0x3c06('0xf')&&typeof _0x49aacc['limit']===_0x3c06('0xf');var _0xcde166=_0x2869bd[_0x3c06('0x10')];var _0x891d79=_0x2efca2?0x0:_0x49aacc[_0x3c06('0xe')];var _0x575ea4=_0x2efca2?_0x2869bd[_0x3c06('0x10')]:_0x49aacc['offset']+_0x49aacc[_0x3c06('0x11')];var _0x4dd21c;if(_0x575ea4>=_0xcde166){_0x575ea4=_0xcde166;_0x4dd21c=0xc8;}else{_0x4dd21c=0xce;}_0x2d405b[_0x3c06('0xc')](_0x4dd21c);return _0x2d405b[_0x3c06('0x12')]('Content-Range',_0x891d79+'-'+_0x575ea4+'/'+_0xcde166)[_0x3c06('0xd')](_0x2869bd);}return null;};}function removeEntity(_0x7d8682){return function(_0x7a0a56){if(_0x7a0a56){return _0x7a0a56['destroy']()[_0x3c06('0x13')](function(){var _0x484568=_0x7a0a56['get']({'plain':!![]});var _0x230d04=[{'name':_0x3c06('0x14'),'value':_0x3c06('0x15'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x3c06('0x16'),'value':_0x3c06('0x17'),'ignore':![]}];var _0x5b15ca=_(_0x230d04)[_0x3c06('0x18')]('ignore')[_0x3c06('0x19')](_0x3c06('0x1a'))['value']();if(_['includes'](_0x5b15ca,_0x484568[_0x3c06('0x1b')])){return;}var _0x2554c4=_[_0x3c06('0x1c')](_0x230d04,[_0x3c06('0x1a'),_0x484568[_0x3c06('0x1b')]])[_0x3c06('0x1d')];return db[_0x3c06('0x1e')]['destroy']({'where':{'type':_0x2554c4,'resourceId':_0x484568['id']}})[_0x3c06('0x13')](function(){return _0x7a0a56;});})[_0x3c06('0x13')](function(){_0x7d8682['status'](0xcc)[_0x3c06('0x1f')]();});}};}function handleEntityNotFound(_0x1a8247){return function(_0x4d319b){if(!_0x4d319b){_0x1a8247[_0x3c06('0xb')](0x194);}return _0x4d319b;};}function handleError(_0x4d0bda,_0x21c4d4){_0x21c4d4=_0x21c4d4||0x1f4;return function(_0x5def15){logger[_0x3c06('0x20')](_0x5def15['stack']);if(_0x5def15[_0x3c06('0x1d')]){delete _0x5def15[_0x3c06('0x1d')];}_0x4d0bda[_0x3c06('0xc')](_0x21c4d4)[_0x3c06('0x21')](_0x5def15);};}exports[_0x3c06('0x22')]=function(_0x409641,_0x59942e){var _0x368919={},_0x52c661={},_0x552f2f={'count':0x0,'rows':[]};var _0x5cdec7=_[_0x3c06('0x19')](db[_0x3c06('0x23')]['rawAttributes'],function(_0x1267c1){return{'name':_0x1267c1[_0x3c06('0x24')],'type':_0x1267c1[_0x3c06('0x1b')]['key']};});_0x52c661['model']=_[_0x3c06('0x19')](_0x5cdec7,_0x3c06('0x1d'));_0x52c661[_0x3c06('0x25')]=_[_0x3c06('0x26')](_0x409641[_0x3c06('0x25')]);_0x52c661[_0x3c06('0x27')]=_[_0x3c06('0x28')](_0x52c661[_0x3c06('0x29')],_0x52c661[_0x3c06('0x25')]);_0x368919['attributes']=_['intersection'](_0x52c661[_0x3c06('0x29')],qs[_0x3c06('0x2a')](_0x409641[_0x3c06('0x25')][_0x3c06('0x2a')]));_0x368919['attributes']=_0x368919[_0x3c06('0x2b')][_0x3c06('0x2c')]?_0x368919[_0x3c06('0x2b')]:_0x52c661['model'];if(!_0x409641[_0x3c06('0x25')][_0x3c06('0x2d')](_0x3c06('0x2e'))){_0x368919[_0x3c06('0x11')]=qs[_0x3c06('0x11')](_0x409641[_0x3c06('0x25')][_0x3c06('0x11')]);_0x368919[_0x3c06('0xe')]=qs[_0x3c06('0xe')](_0x409641[_0x3c06('0x25')][_0x3c06('0xe')]);}_0x368919['order']=qs[_0x3c06('0x2f')](_0x409641[_0x3c06('0x25')]['sort']);_0x368919[_0x3c06('0x30')]=qs['filters'](_[_0x3c06('0x31')](_0x409641[_0x3c06('0x25')],_0x52c661[_0x3c06('0x27')]),_0x5cdec7);if(_0x409641['query']['filter']){_0x368919[_0x3c06('0x30')]=_[_0x3c06('0x32')](_0x368919[_0x3c06('0x30')],{'$or':_[_0x3c06('0x19')](_0x5cdec7,function(_0x557c3a){if(_0x557c3a[_0x3c06('0x1b')]!==_0x3c06('0x33')){var _0x1e6e55={};_0x1e6e55[_0x557c3a[_0x3c06('0x1d')]]={'$like':'%'+_0x409641[_0x3c06('0x25')]['filter']+'%'};return _0x1e6e55;}})});}_0x368919=_['merge']({},_0x368919,_0x409641[_0x3c06('0x34')]);var _0x5d803a={'where':_0x368919['where']};return db['VoiceExtension'][_0x3c06('0x10')](_0x5d803a)[_0x3c06('0x13')](function(_0x1bdbdc){_0x552f2f[_0x3c06('0x10')]=_0x1bdbdc;if(_0x409641['query'][_0x3c06('0x35')]){_0x368919[_0x3c06('0x36')]=[{'all':!![]}];}return db[_0x3c06('0x23')][_0x3c06('0x37')](_0x368919);})['then'](function(_0x2093d6){_0x552f2f[_0x3c06('0x38')]=_0x2093d6;return _0x552f2f;})[_0x3c06('0x13')](respondWithFilteredResult(_0x59942e,_0x368919))[_0x3c06('0x39')](handleError(_0x59942e,null));};exports['show']=function(_0x39c564,_0x5b5f63){var _0xe9b9f={'raw':![],'where':{'id':_0x39c564[_0x3c06('0x3a')]['id']}},_0x146af9={};_0x146af9[_0x3c06('0x29')]=_[_0x3c06('0x26')](db[_0x3c06('0x23')]['rawAttributes']);_0x146af9[_0x3c06('0x25')]=_[_0x3c06('0x26')](_0x39c564['query']);_0x146af9['filters']=_[_0x3c06('0x28')](_0x146af9[_0x3c06('0x29')],_0x146af9[_0x3c06('0x25')]);_0xe9b9f[_0x3c06('0x2b')]=_[_0x3c06('0x28')](_0x146af9[_0x3c06('0x29')],qs['fields'](_0x39c564[_0x3c06('0x25')][_0x3c06('0x2a')]));_0xe9b9f[_0x3c06('0x2b')]=_0xe9b9f['attributes'][_0x3c06('0x2c')]?_0xe9b9f[_0x3c06('0x2b')]:_0x146af9['model'];if(_0x39c564[_0x3c06('0x25')]['includeAll']){_0xe9b9f['include']=[{'all':!![]}];}_0xe9b9f=_[_0x3c06('0x32')]({},_0xe9b9f,_0x39c564[_0x3c06('0x34')]);return db[_0x3c06('0x23')][_0x3c06('0x1c')](_0xe9b9f)[_0x3c06('0x13')](handleEntityNotFound(_0x5b5f63,null))[_0x3c06('0x13')](respondWithResult(_0x5b5f63,null))[_0x3c06('0x39')](handleError(_0x5b5f63,null));};exports[_0x3c06('0x3b')]=function(_0x385a0e,_0x48464c){return db['VoiceExtension'][_0x3c06('0x1c')]({'where':{'id':_0x385a0e['params']['id']}})[_0x3c06('0x13')](handleEntityNotFound(_0x48464c,null))[_0x3c06('0x13')](removeEntity(_0x48464c,null))[_0x3c06('0x39')](handleError(_0x48464c,null));};exports['create']=function(_0x52d57b,_0x1e603b){if(_0x52d57b[_0x3c06('0x3c')][_0x3c06('0x1b')]===_0x3c06('0x3d')&&!_[_0x3c06('0x3e')](_0x52d57b[_0x3c06('0x3c')]['exten'],'_')){_0x52d57b['body'][_0x3c06('0x3f')]='_'[_0x3c06('0x40')](_0x52d57b[_0x3c06('0x3c')][_0x3c06('0x3f')]);}return db['VoiceExtension'][_0x3c06('0x41')](_0x52d57b['body'],{'raw':![]})[_0x3c06('0x13')](function(_0x391894){var _0x88552b=_0x52d57b[_0x3c06('0x42')][_0x3c06('0x43')]({'plain':!![]});if(!_0x88552b)throw new Error(_0x3c06('0x44'));if(_0x88552b[_0x3c06('0x45')]===_0x3c06('0x42')){var _0x426a6a=_0x391894[_0x3c06('0x43')]({'plain':!![]});var _0x41f2f8=[{'name':_0x3c06('0x14'),'value':_0x3c06('0x15')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x3c06('0x16'),'value':'internal'}];var _0x27130b=_[_0x3c06('0x1c')](_0x41f2f8,[_0x3c06('0x1a'),_0x426a6a[_0x3c06('0x1b')]])[_0x3c06('0x1d')];return db[_0x3c06('0x46')][_0x3c06('0x1c')]({'where':{'name':_0x27130b,'userProfileId':_0x88552b['userProfileId']},'raw':!![]})[_0x3c06('0x13')](function(_0x56fbf1){if(_0x56fbf1&&_0x56fbf1[_0x3c06('0x47')]===0x0){return db[_0x3c06('0x1e')][_0x3c06('0x41')]({'name':_0x426a6a[_0x3c06('0x1d')],'resourceId':_0x426a6a['id'],'type':_0x56fbf1['name'],'sectionId':_0x56fbf1['id']},{})['then'](function(){return _0x391894;});}else{return _0x391894;}})['catch'](function(_0x560515){logger[_0x3c06('0x20')](_0x3c06('0x48'),_0x560515);throw _0x560515;});}return _0x391894;})[_0x3c06('0x13')](respondWithResult(_0x1e603b,0xc9))['catch'](handleError(_0x1e603b,null));};exports[_0x3c06('0x49')]=function(_0x4b21cb,_0x36ac89){if(_0x4b21cb['body']['id']){delete _0x4b21cb[_0x3c06('0x3c')]['id'];}return db['VoiceExtension'][_0x3c06('0x1c')]({'where':{'id':_0x4b21cb[_0x3c06('0x3a')]['id']}})['then'](handleEntityNotFound(_0x36ac89,null))[_0x3c06('0x13')](function(_0xa9c640){if(_0xa9c640){return db[_0x3c06('0x23')][_0x3c06('0x49')](_['pick'](_0x4b21cb['body'],[_0x3c06('0x3f'),_0x3c06('0x4a'),_0x3c06('0x4b'),_0x3c06('0x4c'),_0x3c06('0x4d'),_0x3c06('0x4e'),_0x3c06('0x4f')]),{'where':{'context':_0xa9c640[_0x3c06('0x4a')],'exten':_0xa9c640[_0x3c06('0x3f')]},'individualHooks':!![]})[_0x3c06('0x13')](function(_0x376c96){return _0x376c96;});}return null;})[_0x3c06('0x13')](respondWithStatusCode(_0x36ac89,null))['catch'](handleError(_0x36ac89,null));};exports['addApplications']=function(_0x23ed7c,_0x2579a5){var _0x2ba38b=_0x23ed7c[_0x3c06('0x3a')]['id'];var _0xebf006=_0x23ed7c[_0x3c06('0x3c')];var _0x5676e1=0xc8;var _0x276d34=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x3c06('0x50')][_0x3c06('0x51')][_0x3c06('0x52')][_0x3c06('0x53')]},function(_0xba0eee){return db[_0x3c06('0x23')]['findOne']({'where':{'id':_0x2ba38b},'transaction':_0xba0eee})['then'](function(_0x2d37e7){if(_0x2d37e7){return db[_0x3c06('0x23')]['destroy']({'where':{'VoiceExtensionId':_0x2ba38b},'transaction':_0xba0eee})[_0x3c06('0x13')](function(){var _0x435b62=_[_0x3c06('0x19')](_0xebf006,function(_0x529806){_0x529806['VoiceExtensionId']=_0x2ba38b;_0x529806[_0x3c06('0x54')]=!![];return _0x529806;});return _0x2d37e7[_0x3c06('0x55')](_0x435b62);})['then'](function(_0x452bd5){return db[_0x3c06('0x23')][_0x3c06('0x56')](_0x452bd5,{'transaction':_0xba0eee});});}else{_0x5676e1=0x194;_0x276d34=[];}});})['then'](function(){if(_0x5676e1!==0x194){return db['VoiceExtension'][_0x3c06('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2ba38b},'order':_0x3c06('0x58')})[_0x3c06('0x13')](function(_0x5581bb){_0x276d34=_0x5581bb;});}})['catch'](function(_0x26e793){_0x5676e1=0x1f4;logger[_0x3c06('0x20')](_0x26e793['stack']);if(_0x26e793[_0x3c06('0x1d')]){delete _0x26e793['name'];}_0x276d34=_0x26e793;})[_0x3c06('0x59')](function(){if(_0x276d34===null){_0x2579a5[_0x3c06('0xb')](_0x5676e1);}else{if(_0x5676e1===0x1f4){_0x2579a5[_0x3c06('0xc')](_0x5676e1)['send'](_0x276d34);}else{_0x2579a5[_0x3c06('0xc')](_0x5676e1)[_0x3c06('0xd')](_0x276d34);}}});}; \ No newline at end of file +var _0x2468=['hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','update','context','description','recordingFormat','cutdigits','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','destroy','then','error','stack','name','send','VoiceExtension','fieldName','model','query','keys','filters','attributes','fields'];(function(_0x4634f8,_0x1ac5ec){var _0x2374f1=function(_0x7dcc77){while(--_0x7dcc77){_0x4634f8['push'](_0x4634f8['shift']());}};_0x2374f1(++_0x1ac5ec);}(_0x2468,0x1a2));var _0x8246=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2468[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x8246('0x0'));var Redis=require(_0x8246('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8246('0x2'));var config=require(_0x8246('0x3'));var db=require('../../mysqldb')['db'];config[_0x8246('0x4')]=_[_0x8246('0x5')](config['redis'],{'host':_0x8246('0x6'),'port':0x18eb});var socket=require(_0x8246('0x7'))(new Redis(config[_0x8246('0x4')]));require(_0x8246('0x8'))[_0x8246('0x9')](socket);function respondWithStatusCode(_0x2fe889,_0x32b9a8){_0x32b9a8=_0x32b9a8||0xcc;return function(_0x3dbdfd){if(_0x3dbdfd){return _0x2fe889[_0x8246('0xa')](_0x32b9a8);}return _0x2fe889[_0x8246('0xb')](_0x32b9a8)['end']();};}function respondWithResult(_0x4783b0,_0x55830d){_0x55830d=_0x55830d||0xc8;return function(_0x495bab){if(_0x495bab){return _0x4783b0[_0x8246('0xb')](_0x55830d)['json'](_0x495bab);}};}function respondWithFilteredResult(_0x27f6fe,_0x2ea0d2){return function(_0x5cdc5a){if(_0x5cdc5a){var _0x1fda7d=typeof _0x2ea0d2[_0x8246('0xc')]===_0x8246('0xd')&&typeof _0x2ea0d2[_0x8246('0xe')]===_0x8246('0xd');var _0x33f320=_0x5cdc5a[_0x8246('0xf')];var _0x3bada0=_0x1fda7d?0x0:_0x2ea0d2[_0x8246('0xc')];var _0x48e677=_0x1fda7d?_0x5cdc5a[_0x8246('0xf')]:_0x2ea0d2['offset']+_0x2ea0d2[_0x8246('0xe')];var _0x1fb52d;if(_0x48e677>=_0x33f320){_0x48e677=_0x33f320;_0x1fb52d=0xc8;}else{_0x1fb52d=0xce;}_0x27f6fe['status'](_0x1fb52d);return _0x27f6fe[_0x8246('0x10')](_0x8246('0x11'),_0x3bada0+'-'+_0x48e677+'/'+_0x33f320)[_0x8246('0x12')](_0x5cdc5a);}return null;};}function removeEntity(_0x2a56ca){return function(_0x470f6d){if(_0x470f6d){return _0x470f6d['destroy']()['then'](function(){var _0x4326f7=_0x470f6d[_0x8246('0x13')]({'plain':!![]});var _0x8ca745=[{'name':_0x8246('0x14'),'value':_0x8246('0x15'),'ignore':![]},{'name':_0x8246('0x16'),'value':_0x8246('0x17'),'ignore':![]},{'name':_0x8246('0x18'),'value':_0x8246('0x19'),'ignore':![]}];var _0x2ce7d8=_(_0x8ca745)[_0x8246('0x1a')](_0x8246('0x1b'))[_0x8246('0x1c')](_0x8246('0x1d'))['value']();if(_[_0x8246('0x1e')](_0x2ce7d8,_0x4326f7[_0x8246('0x1f')])){return;}var _0x2cf7de=_[_0x8246('0x20')](_0x8ca745,[_0x8246('0x1d'),_0x4326f7[_0x8246('0x1f')]])['name'];return db['UserProfileResource'][_0x8246('0x21')]({'where':{'type':_0x2cf7de,'resourceId':_0x4326f7['id']}})[_0x8246('0x22')](function(){return _0x470f6d;});})[_0x8246('0x22')](function(){_0x2a56ca[_0x8246('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3376e6){return function(_0x31d058){if(!_0x31d058){_0x3376e6['sendStatus'](0x194);}return _0x31d058;};}function handleError(_0x18dcb6,_0x2fdfc5){_0x2fdfc5=_0x2fdfc5||0x1f4;return function(_0x4545ed){logger[_0x8246('0x23')](_0x4545ed[_0x8246('0x24')]);if(_0x4545ed[_0x8246('0x25')]){delete _0x4545ed[_0x8246('0x25')];}_0x18dcb6[_0x8246('0xb')](_0x2fdfc5)[_0x8246('0x26')](_0x4545ed);};}exports['index']=function(_0x529e1c,_0x277a7b){var _0x556b23={},_0x55ba06={},_0x5c505a={'count':0x0,'rows':[]};var _0x5510e2=_['map'](db[_0x8246('0x27')]['rawAttributes'],function(_0x19a628){return{'name':_0x19a628[_0x8246('0x28')],'type':_0x19a628[_0x8246('0x1f')]['key']};});_0x55ba06[_0x8246('0x29')]=_[_0x8246('0x1c')](_0x5510e2,_0x8246('0x25'));_0x55ba06[_0x8246('0x2a')]=_[_0x8246('0x2b')](_0x529e1c['query']);_0x55ba06[_0x8246('0x2c')]=_['intersection'](_0x55ba06[_0x8246('0x29')],_0x55ba06[_0x8246('0x2a')]);_0x556b23[_0x8246('0x2d')]=_['intersection'](_0x55ba06[_0x8246('0x29')],qs[_0x8246('0x2e')](_0x529e1c[_0x8246('0x2a')][_0x8246('0x2e')]));_0x556b23[_0x8246('0x2d')]=_0x556b23[_0x8246('0x2d')]['length']?_0x556b23[_0x8246('0x2d')]:_0x55ba06[_0x8246('0x29')];if(!_0x529e1c[_0x8246('0x2a')][_0x8246('0x2f')](_0x8246('0x30'))){_0x556b23[_0x8246('0xe')]=qs[_0x8246('0xe')](_0x529e1c[_0x8246('0x2a')][_0x8246('0xe')]);_0x556b23[_0x8246('0xc')]=qs[_0x8246('0xc')](_0x529e1c[_0x8246('0x2a')]['offset']);}_0x556b23[_0x8246('0x31')]=qs[_0x8246('0x32')](_0x529e1c[_0x8246('0x2a')][_0x8246('0x32')]);_0x556b23['where']=qs['filters'](_[_0x8246('0x33')](_0x529e1c[_0x8246('0x2a')],_0x55ba06[_0x8246('0x2c')]),_0x5510e2);if(_0x529e1c[_0x8246('0x2a')][_0x8246('0x1a')]){_0x556b23[_0x8246('0x34')]=_[_0x8246('0x35')](_0x556b23[_0x8246('0x34')],{'$or':_[_0x8246('0x1c')](_0x5510e2,function(_0xc686dc){if(_0xc686dc[_0x8246('0x1f')]!==_0x8246('0x36')){var _0x539743={};_0x539743[_0xc686dc['name']]={'$like':'%'+_0x529e1c[_0x8246('0x2a')][_0x8246('0x1a')]+'%'};return _0x539743;}})});}_0x556b23=_[_0x8246('0x35')]({},_0x556b23,_0x529e1c[_0x8246('0x37')]);var _0x2348d5={'where':_0x556b23[_0x8246('0x34')]};return db[_0x8246('0x27')]['count'](_0x2348d5)[_0x8246('0x22')](function(_0xecf3d){_0x5c505a[_0x8246('0xf')]=_0xecf3d;if(_0x529e1c[_0x8246('0x2a')][_0x8246('0x38')]){_0x556b23[_0x8246('0x39')]=[{'all':!![]}];}return db[_0x8246('0x27')][_0x8246('0x3a')](_0x556b23);})['then'](function(_0x4ae43c){_0x5c505a[_0x8246('0x3b')]=_0x4ae43c;return _0x5c505a;})[_0x8246('0x22')](respondWithFilteredResult(_0x277a7b,_0x556b23))[_0x8246('0x3c')](handleError(_0x277a7b,null));};exports[_0x8246('0x3d')]=function(_0x134c9d,_0x1f2043){var _0x398380={'raw':![],'where':{'id':_0x134c9d[_0x8246('0x3e')]['id']}},_0x2ffbd4={};_0x2ffbd4[_0x8246('0x29')]=_[_0x8246('0x2b')](db[_0x8246('0x27')]['rawAttributes']);_0x2ffbd4[_0x8246('0x2a')]=_[_0x8246('0x2b')](_0x134c9d[_0x8246('0x2a')]);_0x2ffbd4[_0x8246('0x2c')]=_[_0x8246('0x3f')](_0x2ffbd4[_0x8246('0x29')],_0x2ffbd4[_0x8246('0x2a')]);_0x398380[_0x8246('0x2d')]=_[_0x8246('0x3f')](_0x2ffbd4[_0x8246('0x29')],qs['fields'](_0x134c9d['query'][_0x8246('0x2e')]));_0x398380[_0x8246('0x2d')]=_0x398380[_0x8246('0x2d')][_0x8246('0x40')]?_0x398380['attributes']:_0x2ffbd4[_0x8246('0x29')];if(_0x134c9d['query'][_0x8246('0x38')]){_0x398380[_0x8246('0x39')]=[{'all':!![]}];}_0x398380=_[_0x8246('0x35')]({},_0x398380,_0x134c9d[_0x8246('0x37')]);return db[_0x8246('0x27')]['find'](_0x398380)['then'](handleEntityNotFound(_0x1f2043,null))[_0x8246('0x22')](respondWithResult(_0x1f2043,null))['catch'](handleError(_0x1f2043,null));};exports[_0x8246('0x21')]=function(_0x4dc489,_0x14125d){return db[_0x8246('0x27')][_0x8246('0x20')]({'where':{'id':_0x4dc489[_0x8246('0x3e')]['id']}})[_0x8246('0x22')](handleEntityNotFound(_0x14125d,null))['then'](removeEntity(_0x14125d,null))['catch'](handleError(_0x14125d,null));};exports['create']=function(_0x3d6274,_0x2341bc){if(_0x3d6274[_0x8246('0x41')][_0x8246('0x1f')]===_0x8246('0x17')&&!_[_0x8246('0x42')](_0x3d6274[_0x8246('0x41')]['exten'],'_')){_0x3d6274[_0x8246('0x41')][_0x8246('0x43')]='_'[_0x8246('0x44')](_0x3d6274['body']['exten']);}return db[_0x8246('0x27')][_0x8246('0x45')](_0x3d6274[_0x8246('0x41')],{'raw':![]})[_0x8246('0x22')](function(_0x36c738){var _0x5515c4=_0x3d6274[_0x8246('0x46')]['get']({'plain':!![]});if(!_0x5515c4)throw new Error(_0x8246('0x47'));if(_0x5515c4['role']==='user'){var _0x5bd913=_0x36c738[_0x8246('0x13')]({'plain':!![]});var _0x344f56=[{'name':_0x8246('0x14'),'value':_0x8246('0x15')},{'name':_0x8246('0x16'),'value':'outbound'},{'name':'InternalRoutes','value':_0x8246('0x19')}];var _0x49e64b=_[_0x8246('0x20')](_0x344f56,[_0x8246('0x1d'),_0x5bd913['type']])[_0x8246('0x25')];return db[_0x8246('0x48')][_0x8246('0x20')]({'where':{'name':_0x49e64b,'userProfileId':_0x5515c4[_0x8246('0x49')]},'raw':!![]})['then'](function(_0x40fe7b){if(_0x40fe7b&&_0x40fe7b['autoAssociation']===0x0){return db[_0x8246('0x4a')][_0x8246('0x45')]({'name':_0x5bd913[_0x8246('0x25')],'resourceId':_0x5bd913['id'],'type':_0x40fe7b[_0x8246('0x25')],'sectionId':_0x40fe7b['id']},{})[_0x8246('0x22')](function(){return _0x36c738;});}else{return _0x36c738;}})[_0x8246('0x3c')](function(_0x554880){logger[_0x8246('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x554880);throw _0x554880;});}return _0x36c738;})[_0x8246('0x22')](respondWithResult(_0x2341bc,0xc9))[_0x8246('0x3c')](handleError(_0x2341bc,null));};exports[_0x8246('0x4b')]=function(_0x2a2666,_0x1c54d6){if(_0x2a2666[_0x8246('0x41')]['id']){delete _0x2a2666['body']['id'];}return db[_0x8246('0x27')][_0x8246('0x20')]({'where':{'id':_0x2a2666[_0x8246('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1c54d6,null))[_0x8246('0x22')](function(_0x446710){if(_0x446710){return db[_0x8246('0x27')]['update'](_[_0x8246('0x33')](_0x2a2666[_0x8246('0x41')],[_0x8246('0x43'),_0x8246('0x4c'),_0x8246('0x4d'),_0x8246('0x4e'),_0x8246('0x4f'),'mandatoryDisposition',_0x8246('0x50')]),{'where':{'context':_0x446710['context'],'exten':_0x446710['exten']},'individualHooks':!![]})[_0x8246('0x22')](function(_0x52a0c4){return _0x52a0c4;});}return null;})[_0x8246('0x22')](respondWithStatusCode(_0x1c54d6,null))[_0x8246('0x3c')](handleError(_0x1c54d6,null));};exports[_0x8246('0x51')]=function(_0x278694,_0x528538){var _0x50fb90=_0x278694['params']['id'];var _0x259cdc=_0x278694[_0x8246('0x41')];var _0x4a78c4=0xc8;var _0x1bee2f=null;return db['sequelize'][_0x8246('0x52')]({'isolationLevel':db[_0x8246('0x53')][_0x8246('0x54')][_0x8246('0x55')][_0x8246('0x56')]},function(_0x15fc23){return db[_0x8246('0x27')][_0x8246('0x57')]({'where':{'id':_0x50fb90},'transaction':_0x15fc23})[_0x8246('0x22')](function(_0xdc7cb9){if(_0xdc7cb9){return db[_0x8246('0x27')][_0x8246('0x21')]({'where':{'VoiceExtensionId':_0x50fb90},'transaction':_0x15fc23})[_0x8246('0x22')](function(){var _0x593254=_[_0x8246('0x1c')](_0x259cdc,function(_0x56212f){_0x56212f[_0x8246('0x58')]=_0x50fb90;_0x56212f[_0x8246('0x59')]=!![];return _0x56212f;});return _0xdc7cb9[_0x8246('0x5a')](_0x593254);})[_0x8246('0x22')](function(_0x1413c2){return db['VoiceExtension'][_0x8246('0x5b')](_0x1413c2,{'transaction':_0x15fc23});});}else{_0x4a78c4=0x194;_0x1bee2f=[];}});})[_0x8246('0x22')](function(){if(_0x4a78c4!==0x194){return db[_0x8246('0x27')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x50fb90},'order':_0x8246('0x5c')})[_0x8246('0x22')](function(_0x2f4085){_0x1bee2f=_0x2f4085;});}})['catch'](function(_0x3685a4){_0x4a78c4=0x1f4;logger[_0x8246('0x23')](_0x3685a4[_0x8246('0x24')]);if(_0x3685a4[_0x8246('0x25')]){delete _0x3685a4['name'];}_0x1bee2f=_0x3685a4;})['finally'](function(){if(_0x1bee2f===null){_0x528538['sendStatus'](_0x4a78c4);}else{if(_0x4a78c4===0x1f4){_0x528538[_0x8246('0xb')](_0x4a78c4)[_0x8246('0x26')](_0x1bee2f);}else{_0x528538[_0x8246('0xb')](_0x4a78c4)[_0x8246('0x12')](_0x1bee2f);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 11f454a..d4e50f4 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd912=['hasOwnProperty','events','../../mysqldb','VoiceExtension','save','remove','emit'];(function(_0x1e191d,_0x42eba2){var _0x3b772d=function(_0x43bc81){while(--_0x43bc81){_0x1e191d['push'](_0x1e191d['shift']());}};_0x3b772d(++_0x42eba2);}(_0xd912,0xb0));var _0x2d91=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd912[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x2d91('0x0'));var VoiceExtension=require(_0x2d91('0x1'))['db'][_0x2d91('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d91('0x3'),'afterUpdate':'update','afterDestroy':_0x2d91('0x4')};function emitEvent(_0x43123e){return function(_0x5dd46a,_0x5054a5,_0x39513a){VoiceExtensionEvents[_0x2d91('0x5')](_0x43123e+':'+_0x5dd46a['id'],_0x5dd46a);VoiceExtensionEvents['emit'](_0x43123e,_0x5dd46a);_0x39513a(null);};}for(var e in events){if(events[_0x2d91('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x1efe=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1efe,0x108));var _0xe1ef=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x1efe[_0x4709c0];return _0x13348b;};'use strict';var EventEmitter=require(_0xe1ef('0x0'));var VoiceExtension=require(_0xe1ef('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe1ef('0x2')](0x0);var events={'afterCreate':_0xe1ef('0x3'),'afterUpdate':'update','afterDestroy':_0xe1ef('0x4')};function emitEvent(_0x4c00b0){return function(_0x107b27,_0x2acc93,_0x45f814){VoiceExtensionEvents[_0xe1ef('0x5')](_0x4c00b0+':'+_0x107b27['id'],_0x107b27);VoiceExtensionEvents[_0xe1ef('0x5')](_0x4c00b0,_0x107b27);_0x45f814(null);};}for(var e in events){if(events[_0xe1ef('0x6')](e)){var event=events[e];VoiceExtension[_0xe1ef('0x7')](e,emitEvent(event));}}module[_0xe1ef('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 731d68d..2e2d273 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54da=['last','concat','catch','define','voice_extensions','get','Hangup','lodash','exports','models','type','context','Set','NoOp','alias','No\x20alias\x20set','push','inbound','XCALLY-MOTION-ANSWER=0','exten','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(routeAlias)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','trunk','timeout','length','split','param','prefix','phone','${EXTEN:','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','IntervalId','interval','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority'];(function(_0x535aba,_0x456915){var _0x2182ca=function(_0x5f51d7){while(--_0x5f51d7){_0x535aba['push'](_0x535aba['shift']());}};_0x2182ca(++_0x456915);}(_0x54da,0x9d));var _0xa54d=function(_0x4f217f,_0x313163){_0x4f217f=_0x4f217f-0x0;var _0x3b583a=_0x54da[_0x4f217f];return _0x3b583a;};'use strict';var _=require(_0xa54d('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa54d('0x1')]=function(_0x4e4b1b){var _0x52e168=_0x4e4b1b[_0xa54d('0x2')];function _0x50cff1(_0x22184a){var _0x280f78=0x2;var _0x936fe1=[{'type':_0x22184a[_0xa54d('0x3')],'app':'Set','appdata':'CDR(type)='+_0x22184a[_0xa54d('0x3')],'context':_0x22184a[_0xa54d('0x4')],'exten':_0x22184a['exten'],'priority':_0x280f78++,'VoiceExtensionId':_0x22184a['id']},{'type':_0x22184a['type'],'app':_0x22184a['alias']?_0xa54d('0x5'):_0xa54d('0x6'),'appdata':_0x22184a[_0xa54d('0x7')]?'CDR(routeAlias)='+_0x22184a[_0xa54d('0x7')]:_0xa54d('0x8'),'context':_0x22184a['context'],'exten':_0x22184a['exten'],'priority':_0x280f78++,'VoiceExtensionId':_0x22184a['id']}];if(_0x22184a[_0xa54d('0x3')]==='inbound'){_0x936fe1[_0xa54d('0x9')]({'type':_0xa54d('0xa'),'app':_0xa54d('0x5'),'appdata':'CDR(routeid)='+_0x22184a['id'],'context':_0x22184a[_0xa54d('0x4')],'exten':_0x22184a['exten'],'priority':_0x280f78++,'VoiceExtensionId':_0x22184a['id']});}_0x936fe1['push']({'type':_0x22184a['type'],'app':_0xa54d('0x5'),'appdata':_0xa54d('0xb'),'context':_0x22184a[_0xa54d('0x4')],'exten':_0x22184a[_0xa54d('0xc')],'priority':_0x280f78++,'VoiceExtensionId':_0x22184a['id']},{'type':_0x22184a[_0xa54d('0x3')],'app':'Set','appdata':_0xa54d('0xd'),'context':_0x22184a[_0xa54d('0x4')],'exten':_0x22184a[_0xa54d('0xc')],'priority':_0x280f78++,'VoiceExtensionId':_0x22184a['id']},{'type':_0x22184a[_0xa54d('0x3')],'app':_0xa54d('0x5'),'appdata':_0xa54d('0xe'),'context':_0x22184a[_0xa54d('0x4')],'exten':_0x22184a[_0xa54d('0xc')],'priority':_0x280f78++,'VoiceExtensionId':_0x22184a['id']});return _0x936fe1;}function _0x300ca1(_0x398877){var _0x3227f7=0x2;var _0x27362d=[{'type':'outbound','app':_0xa54d('0x5'),'appdata':_0xa54d('0xf'),'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':_0x398877[_0xa54d('0x7')]?'Set':'NoOp','appdata':_0x398877[_0xa54d('0x7')]?_0xa54d('0x11')+_0x398877[_0xa54d('0x7')]:_0xa54d('0x8'),'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':_0xa54d('0x5'),'appdata':'CDR(destination)='+(_0x398877[_0xa54d('0x12')]?'${EXTEN:'+_0x398877['cutdigits']+'}':_0xa54d('0x13')),'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877['exten'],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':'outbound','app':_0xa54d('0x5'),'appdata':'CDR(routeid)='+_0x398877['id'],'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':_0xa54d('0x14'),'appdata':_0xa54d('0x15')+(_0x3227f7+0x2)+_0xa54d('0x16')+(_0x3227f7+0x1)+')','context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':_0xa54d('0x5'),'appdata':_0x398877[_0xa54d('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x398877[_0xa54d('0x12')]+'}':_0xa54d('0x17'),'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877['exten'],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':_0xa54d('0x5'),'appdata':_0xa54d('0xb'),'context':_0x398877['context'],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':'Set','appdata':_0xa54d('0xd'),'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877['exten'],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':_0xa54d('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x398877['context'],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':'Set','appdata':'outboundrouteid='+_0x398877['id'],'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']}];if(_0x398877[_0xa54d('0x18')]('recordingFormat')&&_0x398877['recordingFormat']!=='none'){_0x27362d[_0xa54d('0x9')]({'type':_0xa54d('0x10'),'app':'Set','appdata':_0xa54d('0x19'),'context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']},{'type':_0xa54d('0x10'),'app':'Set','appdata':_0xa54d('0x1a')+_0x398877[_0xa54d('0x1b')]||'wav','context':_0x398877[_0xa54d('0x4')],'exten':_0x398877[_0xa54d('0xc')],'priority':_0x3227f7++,'VoiceExtensionId':_0x398877['id']});}return _0x27362d;}function _0x3d5794(_0xd4c692,_0x2ecf81){var _0x69b869=[{'name':_0xa54d('0x1c'),'param':0x0},{'name':_0xa54d('0x1d'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x2b6ec7={};var _0x15b1c5=_0x2ecf81['split'](',');var _0x49d4b8=[];for(var _0x45c98b=0x0;_0x45c98b<_0x69b869[_0xa54d('0x1e')];_0x45c98b++){switch(_0x69b869[_0x45c98b]['name']){case _0xa54d('0x1c'):_0x2b6ec7[_0xa54d('0x1c')]=_0x15b1c5[_0x69b869[_0x45c98b]['param']][_0xa54d('0x1f')]('/')[0x1];_0x2b6ec7['phone']=_0x15b1c5[_0x69b869[_0x45c98b][_0xa54d('0x20')]][_0xa54d('0x1f')]('/')[0x2];_0x2b6ec7[_0xa54d('0x21')]=_0x2b6ec7['phone']?_0x2b6ec7['phone'][_0xa54d('0x1f')]('$')[0x0]:undefined;_0x2b6ec7[_0xa54d('0x22')]=_0xd4c692[_0xa54d('0x12')]?(_0x2b6ec7[_0xa54d('0x21')]||'')+_0xa54d('0x23')+_0xd4c692[_0xa54d('0x12')]+'}':(_0x2b6ec7[_0xa54d('0x21')]||'')+_0xa54d('0x13');_0x49d4b8[_0x69b869[_0x45c98b][_0xa54d('0x20')]]=[_0xa54d('0x24'),_0x2b6ec7[_0xa54d('0x1c')],_0x2b6ec7['phone']][_0xa54d('0x25')]('/');break;case'options':_0x2b6ec7[_0xa54d('0x26')]=_0x15b1c5[_0x69b869[_0x45c98b]['param']];if(_0xd4c692[_0xa54d('0x1b')]!==_0xa54d('0x27')){if(_0x2b6ec7[_0xa54d('0x26')][_0xa54d('0x28')](_0xa54d('0x29'))<0x0){_0x2b6ec7[_0xa54d('0x26')]+=_0xa54d('0x29');}}else{_0x2b6ec7[_0xa54d('0x26')]=_0x2b6ec7[_0xa54d('0x26')][_0xa54d('0x2a')](_0xa54d('0x29'),'');}_0x49d4b8[_0x69b869[_0x45c98b][_0xa54d('0x20')]]=_0x2b6ec7[_0xa54d('0x26')];break;default:_0x49d4b8[_0x69b869[_0x45c98b][_0xa54d('0x20')]]=_0x15b1c5[_0x69b869[_0x45c98b][_0xa54d('0x20')]];}}return _0x49d4b8['join'](',');}function _0x51ee7c(_0x3600f4,_0x28dbe3,_0x2caf9b){return new Promise(function(_0x38e26a,_0xd7c19a){var _0x3570a7=[];if(_['isEmpty'](_0x28dbe3))return _0x38e26a(_0x3570a7);_0x52e168['Interval']['findAll']({'attributes':['id','interval',_0xa54d('0x2b')],'raw':!![]})['then'](function(_0x4bb6fe){for(var _0x287ecb=0x0,_0x3e2f0d=0x0;_0x287ecb<_0x28dbe3['length'];_0x287ecb++,_0x3e2f0d=0x0){var _0x32dcee=_0x28dbe3[_0x287ecb];var _0xc0814=[];var _0x3b1075=[];delete _0x32dcee['id'];if(_0x32dcee[_0xa54d('0x2c')]!==_0xa54d('0x2d')){_0x32dcee[_0xa54d('0x2e')]=[_0x32dcee['interval']];}else{_0x32dcee[_0xa54d('0x2e')]=_0x32dcee['IntervalId']?_[_0xa54d('0x2f')](_['filter'](_0x4bb6fe,{'IntervalId':_0x32dcee[_0xa54d('0x2b')]}),_0xa54d('0x2c')):[];}_0x32dcee[_0xa54d('0x4')]=_0x3600f4[_0xa54d('0x4')];_0x32dcee[_0xa54d('0xc')]=_0x3600f4[_0xa54d('0xc')];if(_0x32dcee[_0xa54d('0x3')])_0x32dcee[_0xa54d('0x3')]=_0x32dcee['type'][_0xa54d('0x30')]();if(_0x3600f4[_0xa54d('0x3')]===_0xa54d('0x10')){if(_0x32dcee[_0xa54d('0x18')](_0xa54d('0x31'))&&_0x32dcee['tag']&&_0x32dcee[_0xa54d('0x31')]!=='--'){_0xc0814[_0xa54d('0x9')]({'type':_0x32dcee[_0xa54d('0x3')][_0xa54d('0x30')](),'app':_0xa54d('0x5'),'appdata':_0xa54d('0x32')+_0x32dcee['tag'],'context':_0x3600f4[_0xa54d('0x4')],'exten':_0x3600f4[_0xa54d('0xc')],'priority':_0x32dcee['intervals']['length']+_0x2caf9b+_0x3e2f0d++,'VoiceExtensionId':_0x3600f4['id']});}_0xc0814[_0xa54d('0x9')]({'type':_0x32dcee[_0xa54d('0x3')][_0xa54d('0x30')](),'app':'ExecIf','appdata':_0xa54d('0x33')+(_0x32dcee['callerID']?_0xa54d('0x34')+_0x32dcee[_0xa54d('0x35')]+')':_0xa54d('0x36')),'context':_0x3600f4[_0xa54d('0x4')],'exten':_0x3600f4[_0xa54d('0xc')],'priority':_0x32dcee[_0xa54d('0x2e')]['length']+_0x2caf9b+_0x3e2f0d++,'VoiceExtensionId':_0x3600f4['id']});}else{if(_0x32dcee[_0xa54d('0x18')](_0xa54d('0x37'))){if([_0xa54d('0x38'),_0xa54d('0x39')][_0xa54d('0x3a')](_0x32dcee['app']['toLowerCase']())&&_0x32dcee[_0xa54d('0x3b')]!=='custom'){if(_0x32dcee[_0xa54d('0x37')]){_0xc0814[_0xa54d('0x9')]({'type':_0x32dcee[_0xa54d('0x3')][_0xa54d('0x30')](),'app':_0xa54d('0x14'),'appdata':_0xa54d('0x3c'),'context':_0x3600f4['context'],'exten':_0x3600f4[_0xa54d('0xc')],'priority':_0x32dcee[_0xa54d('0x2e')]['length']+_0x2caf9b+_0x3e2f0d++,'VoiceExtensionId':_0x3600f4['id']});_0xc0814[_0xa54d('0x9')]({'type':_0x32dcee[_0xa54d('0x3')][_0xa54d('0x30')](),'app':'Set','appdata':_0xa54d('0x3d'),'context':_0x3600f4[_0xa54d('0x4')],'exten':_0x3600f4[_0xa54d('0xc')],'priority':_0x32dcee[_0xa54d('0x2e')][_0xa54d('0x1e')]+_0x2caf9b+_0x3e2f0d++,'VoiceExtensionId':_0x3600f4['id']});}else{_0xc0814['push']({'type':_0x32dcee[_0xa54d('0x3')][_0xa54d('0x30')](),'app':_0xa54d('0x14'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3600f4[_0xa54d('0x4')],'exten':_0x3600f4[_0xa54d('0xc')],'priority':_0x32dcee[_0xa54d('0x2e')][_0xa54d('0x1e')]+_0x2caf9b+_0x3e2f0d++,'VoiceExtensionId':_0x3600f4['id']});_0xc0814[_0xa54d('0x9')]({'type':_0x32dcee[_0xa54d('0x3')][_0xa54d('0x30')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3600f4['context'],'exten':_0x3600f4[_0xa54d('0xc')],'priority':_0x32dcee[_0xa54d('0x2e')][_0xa54d('0x1e')]+_0x2caf9b+_0x3e2f0d++,'VoiceExtensionId':_0x3600f4['id']});}}}}for(var _0x3eef59=0x0;_0x3eef59<_0x32dcee[_0xa54d('0x2e')][_0xa54d('0x1e')];_0x3eef59++){var _0x572da0=_0x2caf9b+_0x32dcee[_0xa54d('0x2e')]['length'];var _0x16809a=_0x3eef59===_0x32dcee['intervals'][_0xa54d('0x1e')]-0x1?_0x2caf9b+_0xc0814['length']+_0x3b1075['length']+0x2:_0x2caf9b+_0x3eef59+0x1;_0xc0814[_0xa54d('0x3e')](_0x3eef59,0x0,{'type':_0x3600f4[_0xa54d('0x3')],'app':_0xa54d('0x3f'),'appdata':_0x32dcee[_0xa54d('0x2e')][_0x3eef59]+'?'+_0x3600f4[_0xa54d('0x4')]+_0xa54d('0x40')+_0x572da0+':'+_0x3600f4[_0xa54d('0x4')]+_0xa54d('0x40')+_0x16809a,'exten':_0x3600f4[_0xa54d('0xc')],'context':_0x3600f4[_0xa54d('0x4')],'priority':_0x2caf9b+_0x3eef59,'VoiceExtensionId':_0x3600f4['id']});}if(_0x32dcee[_0xa54d('0x3b')]===_0xa54d('0x41'))_0x32dcee['appdata']=_0x3d5794(_0x3600f4,_0x32dcee[_0xa54d('0x42')]);_0x32dcee[_0xa54d('0x43')]=_0xc0814[_0xa54d('0x1e')]?_[_0xa54d('0x44')](_0xc0814)[_0xa54d('0x43')]+0x1:_0x2caf9b;_0x3570a7=_[_0xa54d('0x45')](_0x3570a7,_0xc0814,[_0x32dcee],_0x3b1075);_0x2caf9b=_[_0xa54d('0x44')](_0x3570a7)['priority']+0x1;}return _0x38e26a(_0x3570a7);})[_0xa54d('0x46')](function(_0x32128c){_0xd7c19a(_0x32128c);});});}return _0x4e4b1b[_0xa54d('0x47')]('VoiceExtension',attributes,{'tableName':_0xa54d('0x48'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1525d1){var _0x5d29f8=this[_0xa54d('0x49')]({'plain':!![]});var _0x3fef5b=_0x5d29f8[_0xa54d('0x3')]===_0xa54d('0x10')?_0x300ca1(_0x5d29f8):_0x50cff1(_0x5d29f8);return _0x51ee7c(_0x5d29f8,_0x1525d1,_[_0xa54d('0x44')](_0x3fef5b)[_0xa54d('0x43')]+0x1)['then'](function(_0x41131c){var _0x264280=_[_0xa54d('0x45')](_0x3fef5b,_0x41131c);_0x264280['push']({'type':_0x5d29f8[_0xa54d('0x3')],'app':_0xa54d('0x4a'),'exten':_0x5d29f8['exten'],'context':_0x5d29f8[_0xa54d('0x4')],'priority':_[_0xa54d('0x44')](_0x264280)[_0xa54d('0x43')]+0x1,'VoiceExtensionId':_0x5d29f8['id']});return _0x264280;});}}});}; \ No newline at end of file +var _0xf0db=['CDR(routeid)=','exten','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','prefix','phone','param','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','callerID','queue','playback','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push'];(function(_0x2f055a,_0x7b49f6){var _0x148b5a=function(_0xb94b51){while(--_0xb94b51){_0x2f055a['push'](_0x2f055a['shift']());}};_0x148b5a(++_0x7b49f6);}(_0xf0db,0x12b));var _0xbf0d=function(_0xa75d70,_0x3b7fc3){_0xa75d70=_0xa75d70-0x0;var _0xd5d47f=_0xf0db[_0xa75d70];return _0xd5d47f;};'use strict';var _=require(_0xbf0d('0x0'));var attributes=require(_0xbf0d('0x1'));module['exports']=function(_0x138814){var _0x1a6fea=_0x138814[_0xbf0d('0x2')];function _0x5db968(_0x47436c){var _0x2ccd6c=0x2;var _0x56f648=[{'type':_0x47436c['type'],'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x4')+_0x47436c[_0xbf0d('0x5')],'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c['exten'],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']},{'type':_0x47436c[_0xbf0d('0x5')],'app':_0x47436c[_0xbf0d('0x7')]?_0xbf0d('0x3'):_0xbf0d('0x8'),'appdata':_0x47436c[_0xbf0d('0x7')]?_0xbf0d('0x9')+_0x47436c[_0xbf0d('0x7')]:_0xbf0d('0xa'),'context':_0x47436c['context'],'exten':_0x47436c['exten'],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']}];if(_0x47436c[_0xbf0d('0x5')]===_0xbf0d('0xb')){_0x56f648[_0xbf0d('0xc')]({'type':_0xbf0d('0xb'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xd')+_0x47436c['id'],'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']});}_0x56f648['push']({'type':_0x47436c[_0xbf0d('0x5')],'app':_0xbf0d('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']},{'type':_0x47436c[_0xbf0d('0x5')],'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xf'),'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']},{'type':_0x47436c[_0xbf0d('0x5')],'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x10'),'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']});return _0x56f648;}function _0x474ac2(_0x1d1eb4){var _0x523802=0x2;var _0x11a5f1=[{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x12'),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0x1d1eb4['alias']?_0xbf0d('0x3'):'NoOp','appdata':_0x1d1eb4[_0xbf0d('0x7')]?_0xbf0d('0x9')+_0x1d1eb4[_0xbf0d('0x7')]:_0xbf0d('0xa'),'context':_0x1d1eb4['context'],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':'CDR(destination)='+(_0x1d1eb4['cutdigits']?_0xbf0d('0x13')+_0x1d1eb4['cutdigits']+'}':_0xbf0d('0x14')),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xd')+_0x1d1eb4['id'],'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x15'),'appdata':_0xbf0d('0x16')+(_0x523802+0x2)+_0xbf0d('0x17')+(_0x523802+0x1)+')','context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0x1d1eb4[_0xbf0d('0x18')]?_0xbf0d('0x19')+_0x1d1eb4[_0xbf0d('0x18')]+'}':'CDR(prefix)=noprefix','context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x1a'),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xf'),'context':_0x1d1eb4['context'],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':'outbound','app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x1b')+_0x1d1eb4['id'],'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']}];if(_0x1d1eb4[_0xbf0d('0x1c')](_0xbf0d('0x1d'))&&_0x1d1eb4[_0xbf0d('0x1d')]!==_0xbf0d('0x1e')){_0x11a5f1[_0xbf0d('0xc')]({'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x1f'),'context':_0x1d1eb4['context'],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':'Set','appdata':_0xbf0d('0x20')+_0x1d1eb4[_0xbf0d('0x1d')]||_0xbf0d('0x21'),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']});}return _0x11a5f1;}function _0x330b37(_0x549692,_0x24586e){var _0x2e5dcf=[{'name':_0xbf0d('0x22'),'param':0x0},{'name':_0xbf0d('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0xbf0d('0x24'),'param':0x3}];var _0x4b0ee9={};var _0x3faf27=_0x24586e[_0xbf0d('0x25')](',');var _0x1ed208=[];for(var _0x20cd8c=0x0;_0x20cd8c<_0x2e5dcf[_0xbf0d('0x26')];_0x20cd8c++){switch(_0x2e5dcf[_0x20cd8c]['name']){case _0xbf0d('0x22'):_0x4b0ee9[_0xbf0d('0x22')]=_0x3faf27[_0x2e5dcf[_0x20cd8c]['param']][_0xbf0d('0x25')]('/')[0x1];_0x4b0ee9['phone']=_0x3faf27[_0x2e5dcf[_0x20cd8c]['param']][_0xbf0d('0x25')]('/')[0x2];_0x4b0ee9[_0xbf0d('0x27')]=_0x4b0ee9['phone']?_0x4b0ee9[_0xbf0d('0x28')]['split']('$')[0x0]:undefined;_0x4b0ee9[_0xbf0d('0x28')]=_0x549692['cutdigits']?(_0x4b0ee9[_0xbf0d('0x27')]||'')+_0xbf0d('0x13')+_0x549692[_0xbf0d('0x18')]+'}':(_0x4b0ee9[_0xbf0d('0x27')]||'')+'${EXTEN}';_0x1ed208[_0x2e5dcf[_0x20cd8c][_0xbf0d('0x29')]]=[_0xbf0d('0x2a'),_0x4b0ee9['trunk'],_0x4b0ee9[_0xbf0d('0x28')]][_0xbf0d('0x2b')]('/');break;case _0xbf0d('0x2c'):_0x4b0ee9[_0xbf0d('0x2c')]=_0x3faf27[_0x2e5dcf[_0x20cd8c]['param']];if(_0x549692[_0xbf0d('0x1d')]!==_0xbf0d('0x1e')){if(_0x4b0ee9[_0xbf0d('0x2c')][_0xbf0d('0x2d')](_0xbf0d('0x2e'))<0x0){_0x4b0ee9[_0xbf0d('0x2c')]+=_0xbf0d('0x2e');}}else{_0x4b0ee9[_0xbf0d('0x2c')]=_0x4b0ee9['options'][_0xbf0d('0x2f')](_0xbf0d('0x2e'),'');}_0x1ed208[_0x2e5dcf[_0x20cd8c][_0xbf0d('0x29')]]=_0x4b0ee9[_0xbf0d('0x2c')];break;default:_0x1ed208[_0x2e5dcf[_0x20cd8c]['param']]=_0x3faf27[_0x2e5dcf[_0x20cd8c][_0xbf0d('0x29')]];}}return _0x1ed208['join'](',');}function _0x271bcf(_0x1aade1,_0x30d96e,_0x2d5193){return new Promise(function(_0x13a39e,_0x55a8d7){var _0x10261a=[];if(_['isEmpty'](_0x30d96e))return _0x13a39e(_0x10261a);_0x1a6fea[_0xbf0d('0x30')][_0xbf0d('0x31')]({'attributes':['id',_0xbf0d('0x32'),_0xbf0d('0x33')],'raw':!![]})[_0xbf0d('0x34')](function(_0x4997b7){for(var _0x31b8d0=0x0,_0x19c446=0x0;_0x31b8d0<_0x30d96e['length'];_0x31b8d0++,_0x19c446=0x0){var _0x3aefd8=_0x30d96e[_0x31b8d0];var _0x530b2d=[];var _0x2bcbc9=[];delete _0x3aefd8['id'];if(_0x3aefd8['interval']!==_0xbf0d('0x35')){_0x3aefd8[_0xbf0d('0x36')]=[_0x3aefd8['interval']];}else{_0x3aefd8[_0xbf0d('0x36')]=_0x3aefd8[_0xbf0d('0x33')]?_[_0xbf0d('0x37')](_[_0xbf0d('0x38')](_0x4997b7,{'IntervalId':_0x3aefd8[_0xbf0d('0x33')]}),'interval'):[];}_0x3aefd8[_0xbf0d('0x6')]=_0x1aade1['context'];_0x3aefd8['exten']=_0x1aade1['exten'];if(_0x3aefd8[_0xbf0d('0x5')])_0x3aefd8['type']=_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')]();if(_0x1aade1[_0xbf0d('0x5')]===_0xbf0d('0x11')){if(_0x3aefd8[_0xbf0d('0x1c')](_0xbf0d('0x3a'))&&_0x3aefd8[_0xbf0d('0x3a')]&&_0x3aefd8[_0xbf0d('0x3a')]!=='--'){_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')](),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x3b')+_0x3aefd8[_0xbf0d('0x3a')],'context':_0x1aade1['context'],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8['type'][_0xbf0d('0x39')](),'app':_0xbf0d('0x15'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3aefd8[_0xbf0d('0x3c')]?'Set(CALLERID(all)='+_0x3aefd8[_0xbf0d('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x1aade1['context'],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')]['length']+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}else{if(_0x3aefd8[_0xbf0d('0x1c')]('answer')){if([_0xbf0d('0x3d'),_0xbf0d('0x3e')]['includes'](_0x3aefd8[_0xbf0d('0x3f')][_0xbf0d('0x39')]())&&_0x3aefd8[_0xbf0d('0x40')]!=='custom'){if(_0x3aefd8['answer']){_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')](),'app':'ExecIf','appdata':_0xbf0d('0x41'),'context':_0x1aade1[_0xbf0d('0x6')],'exten':_0x1aade1['exten'],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8[_0xbf0d('0x5')]['toLowerCase'](),'app':'Set','appdata':_0xbf0d('0x42'),'context':_0x1aade1[_0xbf0d('0x6')],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}else{_0x530b2d['push']({'type':_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1aade1['context'],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8['type'][_0xbf0d('0x39')](),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x43'),'context':_0x1aade1[_0xbf0d('0x6')],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')]['length']+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}}}}for(var _0x52f5ca=0x0;_0x52f5ca<_0x3aefd8['intervals'][_0xbf0d('0x26')];_0x52f5ca++){var _0x345cde=_0x2d5193+_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')];var _0x4f1002=_0x52f5ca===_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]-0x1?_0x2d5193+_0x530b2d[_0xbf0d('0x26')]+_0x2bcbc9[_0xbf0d('0x26')]+0x2:_0x2d5193+_0x52f5ca+0x1;_0x530b2d['splice'](_0x52f5ca,0x0,{'type':_0x1aade1[_0xbf0d('0x5')],'app':'GotoIfTime','appdata':_0x3aefd8[_0xbf0d('0x36')][_0x52f5ca]+'?'+_0x1aade1['context']+_0xbf0d('0x44')+_0x345cde+':'+_0x1aade1[_0xbf0d('0x6')]+_0xbf0d('0x44')+_0x4f1002,'exten':_0x1aade1['exten'],'context':_0x1aade1[_0xbf0d('0x6')],'priority':_0x2d5193+_0x52f5ca,'VoiceExtensionId':_0x1aade1['id']});}if(_0x3aefd8[_0xbf0d('0x40')]===_0xbf0d('0x45'))_0x3aefd8[_0xbf0d('0x46')]=_0x330b37(_0x1aade1,_0x3aefd8['appdata']);_0x3aefd8[_0xbf0d('0x47')]=_0x530b2d[_0xbf0d('0x26')]?_[_0xbf0d('0x48')](_0x530b2d)[_0xbf0d('0x47')]+0x1:_0x2d5193;_0x10261a=_['concat'](_0x10261a,_0x530b2d,[_0x3aefd8],_0x2bcbc9);_0x2d5193=_[_0xbf0d('0x48')](_0x10261a)[_0xbf0d('0x47')]+0x1;}return _0x13a39e(_0x10261a);})[_0xbf0d('0x49')](function(_0x1128b9){_0x55a8d7(_0x1128b9);});});}return _0x138814[_0xbf0d('0x4a')](_0xbf0d('0x4b'),attributes,{'tableName':_0xbf0d('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xbd0fd8){var _0x204570=this[_0xbf0d('0x4d')]({'plain':!![]});var _0x4e8da9=_0x204570[_0xbf0d('0x5')]===_0xbf0d('0x11')?_0x474ac2(_0x204570):_0x5db968(_0x204570);return _0x271bcf(_0x204570,_0xbd0fd8,_['last'](_0x4e8da9)[_0xbf0d('0x47')]+0x1)[_0xbf0d('0x34')](function(_0x277046){var _0x35f2af=_['concat'](_0x4e8da9,_0x277046);_0x35f2af[_0xbf0d('0xc')]({'type':_0x204570[_0xbf0d('0x5')],'app':'Hangup','exten':_0x204570[_0xbf0d('0xe')],'context':_0x204570[_0xbf0d('0x6')],'priority':_['last'](_0x35f2af)['priority']+0x1,'VoiceExtensionId':_0x204570['id']});return _0x35f2af;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index f8747d0..6e2bfd3 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb2a=['raw','where','attributes','limit','include','map','model','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceExtension.socket','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options'];(function(_0x549eb9,_0x155e11){var _0x280dc1=function(_0x12a44d){while(--_0x12a44d){_0x549eb9['push'](_0x549eb9['shift']());}};_0x280dc1(++_0x155e11);}(_0xdb2a,0x16f));var _0xadb2=function(_0x1fdd6d,_0x58acfb){_0x1fdd6d=_0x1fdd6d-0x0;var _0x30b56f=_0xdb2a[_0x1fdd6d];return _0x30b56f;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var moment=require(_0xadb2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadb2('0x3'));var db=require(_0xadb2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xadb2('0x5'))('rpc');var config=require(_0xadb2('0x6'));var jayson=require(_0xadb2('0x7'));var client=jayson[_0xadb2('0x8')][_0xadb2('0x9')]({'port':0x232a});config[_0xadb2('0xa')]=_['defaults'](config[_0xadb2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xadb2('0xb'))(new Redis(config[_0xadb2('0xa')]));require(_0xadb2('0xc'))['register'](socket);function respondWithRpcPromise(_0x407b26,_0xe47423,_0x15f179){return new BPromise(function(_0x49706f,_0x23d553){return client['request'](_0x407b26,_0x15f179)[_0xadb2('0xd')](function(_0x4fac30){logger['info'](_0xadb2('0xe'),_0xe47423,_0xadb2('0xf'));logger[_0xadb2('0x10')](_0xadb2('0x11'),_0xe47423,'request\x20sent',JSON[_0xadb2('0x12')](_0x4fac30));if(_0x4fac30[_0xadb2('0x13')]){if(_0x4fac30[_0xadb2('0x13')][_0xadb2('0x14')]===0x1f4){logger[_0xadb2('0x13')](_0xadb2('0xe'),_0xe47423,_0x4fac30[_0xadb2('0x13')][_0xadb2('0x15')]);return _0x23d553(_0x4fac30[_0xadb2('0x13')]['message']);}logger[_0xadb2('0x13')](_0xadb2('0xe'),_0xe47423,_0x4fac30['error'][_0xadb2('0x15')]);return _0x49706f(_0x4fac30['error'][_0xadb2('0x15')]);}else{logger[_0xadb2('0x16')](_0xadb2('0xe'),_0xe47423,'request\x20sent');_0x49706f(_0x4fac30[_0xadb2('0x17')][_0xadb2('0x15')]);}})[_0xadb2('0x18')](function(_0x58dfa3){logger[_0xadb2('0x13')](_0xadb2('0xe'),_0xe47423,_0x58dfa3);_0x23d553(_0x58dfa3);});});}exports[_0xadb2('0x19')]=function(_0x1eeefb){var _0x2a66a6=this;return new Promise(function(_0x1dd0d0,_0xca90c4){return db[_0xadb2('0x1a')][_0xadb2('0x1b')]({'raw':_0x1eeefb['options']?_0x1eeefb[_0xadb2('0x1c')][_0xadb2('0x1d')]===undefined?!![]:![]:!![],'where':_0x1eeefb['options']?_0x1eeefb[_0xadb2('0x1c')][_0xadb2('0x1e')]||null:null,'attributes':_0x1eeefb[_0xadb2('0x1c')]?_0x1eeefb['options'][_0xadb2('0x1f')]||null:null,'limit':_0x1eeefb['options']?_0x1eeefb[_0xadb2('0x1c')][_0xadb2('0x20')]||null:null,'include':_0x1eeefb[_0xadb2('0x1c')]?_0x1eeefb[_0xadb2('0x1c')][_0xadb2('0x21')]?_[_0xadb2('0x22')](_0x1eeefb[_0xadb2('0x1c')][_0xadb2('0x21')],function(_0xc95bd0){return{'model':db[_0xc95bd0[_0xadb2('0x23')]],'as':_0xc95bd0['as'],'attributes':_0xc95bd0['attributes'],'include':_0xc95bd0['include']?_[_0xadb2('0x22')](_0xc95bd0[_0xadb2('0x21')],function(_0xb01ff4){return{'model':db[_0xb01ff4[_0xadb2('0x23')]],'as':_0xb01ff4['as'],'attributes':_0xb01ff4[_0xadb2('0x1f')],'include':_0xb01ff4[_0xadb2('0x21')]?_[_0xadb2('0x22')](_0xb01ff4[_0xadb2('0x21')],function(_0x44a76b){return{'model':db[_0x44a76b['model']],'as':_0x44a76b['as'],'attributes':_0x44a76b['attributes']};}):[]};}):[]};}):[]:[]})[_0xadb2('0xd')](function(_0x5592b9){logger['info'](_0xadb2('0x19'),_0x1eeefb);logger['debug']('GetVoiceExtension',_0x1eeefb,JSON[_0xadb2('0x12')](_0x5592b9));_0x1dd0d0(_0x5592b9);})[_0xadb2('0x18')](function(_0x2a16c3){logger[_0xadb2('0x13')](_0xadb2('0x19'),_0x2a16c3[_0xadb2('0x15')],_0x1eeefb);_0xca90c4(_0x2a66a6[_0xadb2('0x13')](0x1f4,_0x2a16c3[_0xadb2('0x15')]));});});}; \ No newline at end of file +var _0x5294=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetVoiceExtension','findAll','options','raw','attributes','include','map','model'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x5294,0x111));var _0x4529=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x5294[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x4529('0x0'));var util=require(_0x4529('0x1'));var moment=require(_0x4529('0x2'));var BPromise=require(_0x4529('0x3'));var rs=require(_0x4529('0x4'));var fs=require('fs');var Redis=require(_0x4529('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4529('0x6'));var logger=require(_0x4529('0x7'))(_0x4529('0x8'));var config=require('../../config/environment');var jayson=require(_0x4529('0x9'));var client=jayson[_0x4529('0xa')][_0x4529('0xb')]({'port':0x232a});config[_0x4529('0xc')]=_['defaults'](config[_0x4529('0xc')],{'host':_0x4529('0xd'),'port':0x18eb});var socket=require(_0x4529('0xe'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x350678,_0x2532f4,_0x19777f){return new BPromise(function(_0x579574,_0x1a13b6){return client[_0x4529('0xf')](_0x350678,_0x19777f)[_0x4529('0x10')](function(_0x3143ba){logger[_0x4529('0x11')](_0x4529('0x12'),_0x2532f4,'request\x20sent');logger['debug'](_0x4529('0x13'),_0x2532f4,_0x4529('0x14'),JSON['stringify'](_0x3143ba));if(_0x3143ba[_0x4529('0x15')]){if(_0x3143ba['error'][_0x4529('0x16')]===0x1f4){logger[_0x4529('0x15')](_0x4529('0x12'),_0x2532f4,_0x3143ba[_0x4529('0x15')]['message']);return _0x1a13b6(_0x3143ba[_0x4529('0x15')][_0x4529('0x17')]);}logger[_0x4529('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x2532f4,_0x3143ba[_0x4529('0x15')][_0x4529('0x17')]);return _0x579574(_0x3143ba[_0x4529('0x15')][_0x4529('0x17')]);}else{logger['info'](_0x4529('0x12'),_0x2532f4,_0x4529('0x14'));_0x579574(_0x3143ba['result'][_0x4529('0x17')]);}})[_0x4529('0x18')](function(_0x10b3e1){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2532f4,_0x10b3e1);_0x1a13b6(_0x10b3e1);});});}exports[_0x4529('0x19')]=function(_0x722e24){var _0x3e4467=this;return new Promise(function(_0x1c70d4,_0x32b8dc){return db['VoiceExtension'][_0x4529('0x1a')]({'raw':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')][_0x4529('0x1c')]===undefined?!![]:![]:!![],'where':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')]['where']||null:null,'attributes':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')][_0x4529('0x1d')]||null:null,'limit':_0x722e24['options']?_0x722e24[_0x4529('0x1b')]['limit']||null:null,'include':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')][_0x4529('0x1e')]?_[_0x4529('0x1f')](_0x722e24[_0x4529('0x1b')][_0x4529('0x1e')],function(_0x2647d3){return{'model':db[_0x2647d3[_0x4529('0x20')]],'as':_0x2647d3['as'],'attributes':_0x2647d3[_0x4529('0x1d')],'include':_0x2647d3['include']?_['map'](_0x2647d3['include'],function(_0x43c608){return{'model':db[_0x43c608[_0x4529('0x20')]],'as':_0x43c608['as'],'attributes':_0x43c608[_0x4529('0x1d')],'include':_0x43c608[_0x4529('0x1e')]?_[_0x4529('0x1f')](_0x43c608['include'],function(_0x534c2d){return{'model':db[_0x534c2d[_0x4529('0x20')]],'as':_0x534c2d['as'],'attributes':_0x534c2d[_0x4529('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4529('0x10')](function(_0x3e0d2c){logger['info']('GetVoiceExtension',_0x722e24);logger[_0x4529('0x21')](_0x4529('0x19'),_0x722e24,JSON['stringify'](_0x3e0d2c));_0x1c70d4(_0x3e0d2c);})[_0x4529('0x18')](function(_0x25519e){logger[_0x4529('0x15')](_0x4529('0x19'),_0x25519e[_0x4529('0x17')],_0x722e24);_0x32b8dc(_0x3e4467[_0x4529('0x15')](0x1f4,_0x25519e[_0x4529('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 791f957..85fb724 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x27ba23,_0x56e2b9){var _0x289948=function(_0x5f5294){while(--_0x5f5294){_0x27ba23['push'](_0x27ba23['shift']());}};_0x289948(++_0x56e2b9);}(_0x7a54,0x106));var _0x47a5=function(_0xb96758,_0x37169c){_0xb96758=_0xb96758-0x0;var _0x5e6181=_0x7a54[_0xb96758];return _0x5e6181;};'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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x5b5882,_0x3e86ec){var _0x7c8d0b=function(_0x5d4bb2){while(--_0x5d4bb2){_0x5b5882['push'](_0x5b5882['shift']());}};_0x7c8d0b(++_0x3e86ec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 85dcff3..f3437c1 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['getMessages','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x2a07,0x74));var _0x72a0=function(_0x1aac1d,_0x1dca6c){_0x1aac1d=_0x1aac1d-0x0;var _0x140f0d=_0x2a07[_0x1aac1d];return _0x140f0d;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['post']('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0x11')]);router['put'](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);router[_0x72a0('0x13')](_0x72a0('0xd'),auth['isAuthenticated'](),controller[_0x72a0('0x14')]);module[_0x72a0('0x15')]=router; \ No newline at end of file +var _0x5430=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x5430,0x10c));var _0x0543=function(_0x4850e8,_0x5f438e){_0x4850e8=_0x4850e8-0x0;var _0xb97c5b=_0x5430[_0x4850e8];return _0xb97c5b;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/',auth['isAuthenticated'](),controller[_0x0543('0xf')]);router[_0x0543('0x10')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0x11')]);router[_0x0543('0x12')](_0x0543('0xa'),auth[_0x0543('0x8')](),controller[_0x0543('0x13')]);module[_0x0543('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 001a851..48cfccd 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe19=['trim','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','string'];(function(_0x2cdd4d,_0x394c2f){var _0x55cbc8=function(_0x3b92cb){while(--_0x3b92cb){_0x2cdd4d['push'](_0x2cdd4d['shift']());}};_0x55cbc8(++_0x394c2f);}(_0xbe19,0x1ba));var _0x9be1=function(_0x924ba1,_0x3f45de){_0x924ba1=_0x924ba1-0x0;var _0x443539=_0xbe19[_0x924ba1];return _0x443539;};'use strict';var Sequelize=require(_0x9be1('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x9be1('0x1')]},'context':{'type':Sequelize[_0x9be1('0x1')],'defaultValue':_0x9be1('0x2'),'unique':_0x9be1('0x3')},'mailbox':{'type':Sequelize[_0x9be1('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x9be1('0x1')]},'fullname':{'type':Sequelize[_0x9be1('0x1')]},'email':{'type':Sequelize[_0x9be1('0x1')],'validate':{'isEmail':!![]},'set':function(_0x117e82){this[_0x9be1('0x4')]('email',typeof _0x117e82===_0x9be1('0x5')&&_0x117e82[_0x9be1('0x6')]()?_0x117e82[_0x9be1('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x9be1('0x7')](_0x9be1('0x8'),'no'),'defaultValue':_0x9be1('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9be1('0x7')](_0x9be1('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x9be1('0x1')]},'review':{'type':Sequelize[_0x9be1('0x7')](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9be1('0x7')](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9be1('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9be1('0x7')](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9be1('0x7')](_0x9be1('0x8'),'no'),'defaultValue':_0x9be1('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x9be1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9be1('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x9be1('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x9be1('0x1')]},'maxsecs':{'type':Sequelize[_0x9be1('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9be1('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9be1('0xb')],'get':function(){return this['getDataValue'](_0x9be1('0xc'))+_0x9be1('0xd')+this[_0x9be1('0xe')](_0x9be1('0xf'));}}}; \ No newline at end of file +var _0x41a0=['string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','exports','STRING','contest_mailbox','setDataValue','email'];(function(_0x2eff8d,_0x18fc8c){var _0x2a9b8c=function(_0x30edff){while(--_0x30edff){_0x2eff8d['push'](_0x2eff8d['shift']());}};_0x2a9b8c(++_0x18fc8c);}(_0x41a0,0xaf));var _0x041a=function(_0x1a7b88,_0x53607b){_0x1a7b88=_0x1a7b88-0x0;var _0x524e8f=_0x41a0[_0x1a7b88];return _0x524e8f;};'use strict';var Sequelize=require('sequelize');module[_0x041a('0x0')]={'customer_id':{'type':Sequelize[_0x041a('0x1')]},'context':{'type':Sequelize[_0x041a('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x041a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x041a('0x2')},'password':{'type':Sequelize[_0x041a('0x1')]},'fullname':{'type':Sequelize[_0x041a('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x496dea){this[_0x041a('0x3')](_0x041a('0x4'),typeof _0x496dea===_0x041a('0x5')&&_0x496dea[_0x041a('0x6')]()?_0x496dea[_0x041a('0x6')]():null);}},'pager':{'type':Sequelize[_0x041a('0x1')]},'tz':{'type':Sequelize[_0x041a('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':_0x041a('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x041a('0x7')]('yes','no'),'defaultValue':_0x041a('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x041a('0x1')]},'callback':{'type':Sequelize[_0x041a('0x1')]},'review':{'type':Sequelize[_0x041a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x041a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x041a('0x9')},'emailsubject':{'type':Sequelize[_0x041a('0x1')]},'emailbody':{'type':Sequelize[_0x041a('0x1')]},'maxsecs':{'type':Sequelize[_0x041a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x041a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x041a('0xb')],'get':function(){return this[_0x041a('0xc')](_0x041a('0xd'))+'\x20-\x20'+this[_0x041a('0xc')](_0x041a('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3c3130c..e9a246b 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6324=['then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','fieldName','type','keys','query','filters','intersection','model','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','rawAttributes','hasOwnProperty','pick','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x455893,_0x909838){var _0x3851e8=function(_0x32ac8a){while(--_0x32ac8a){_0x455893['push'](_0x455893['shift']());}};_0x3851e8(++_0x909838);}(_0x6324,0x142));var _0x4632=function(_0x49a1a0,_0x48f776){_0x49a1a0=_0x49a1a0-0x0;var _0x518a4f=_0x6324[_0x49a1a0];return _0x518a4f;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){var _0x3b0823=_0x1e1b86[_0x4632('0x28')]({'plain':!![]});var _0xb074d=_0x4632('0x29');return db[_0x4632('0x2a')][_0x4632('0x27')]({'where':{'type':_0xb074d,'resourceId':_0x3b0823['id']}})[_0x4632('0x26')](function(){return _0x1e1b86;});})[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0x438354,_0x4d9098){return function(_0x57798a){if(!_0x57798a){_0x438354[_0x4632('0x18')](0x194);}return _0x57798a;};}function handleError(_0x244743,_0x2f6656){_0x2f6656=_0x2f6656||0x1f4;return function(_0x35a533){logger[_0x4632('0x2b')](_0x35a533[_0x4632('0x2c')]);if(_0x35a533[_0x4632('0x2d')]){delete _0x35a533['name'];}_0x244743[_0x4632('0x19')](_0x2f6656)[_0x4632('0x2e')](_0x35a533);};}exports['index']=function(_0x216119,_0x5316f7){var _0x6599ad={},_0x4cb661={},_0x4fda35={'count':0x0,'rows':[]};var _0x1973eb=_[_0x4632('0x2f')](db[_0x4632('0x30')]['rawAttributes'],function(_0x5ed4d6){return{'name':_0x5ed4d6[_0x4632('0x31')],'type':_0x5ed4d6[_0x4632('0x32')]['key']};});_0x4cb661['model']=_[_0x4632('0x2f')](_0x1973eb,_0x4632('0x2d'));_0x4cb661['query']=_[_0x4632('0x33')](_0x216119[_0x4632('0x34')]);_0x4cb661[_0x4632('0x35')]=_[_0x4632('0x36')](_0x4cb661[_0x4632('0x37')],_0x4cb661['query']);_0x6599ad[_0x4632('0x38')]=_[_0x4632('0x36')](_0x4cb661['model'],qs['fields'](_0x216119[_0x4632('0x34')]['fields']));_0x6599ad['attributes']=_0x6599ad[_0x4632('0x38')]['length']?_0x6599ad[_0x4632('0x38')]:_0x4cb661[_0x4632('0x37')];if(!_0x216119[_0x4632('0x34')]['hasOwnProperty'](_0x4632('0x39'))){_0x6599ad[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x216119[_0x4632('0x34')][_0x4632('0x1e')]);_0x6599ad['offset']=qs['offset'](_0x216119[_0x4632('0x34')][_0x4632('0x1c')]);}_0x6599ad[_0x4632('0x3a')]=qs['sort'](_0x216119['query']['sort']);_0x6599ad[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x216119[_0x4632('0x34')],_0x4cb661[_0x4632('0x35')]),_0x1973eb);if(_0x216119[_0x4632('0x34')][_0x4632('0x3c')]){_0x6599ad[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x6599ad[_0x4632('0x3b')],{'$or':_[_0x4632('0x2f')](_0x1973eb,function(_0x21c6a5){if(_0x21c6a5[_0x4632('0x32')]!==_0x4632('0x3e')){var _0x3b6258={};_0x3b6258[_0x21c6a5['name']]={'$like':'%'+_0x216119[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x3b6258;}})});}_0x6599ad=_['merge']({},_0x6599ad,_0x216119[_0x4632('0x3f')]);var _0x1c39bc={'where':_0x6599ad['where']};return db[_0x4632('0x30')]['count'](_0x1c39bc)[_0x4632('0x26')](function(_0x28df3b){_0x4fda35[_0x4632('0x1f')]=_0x28df3b;if(_0x216119[_0x4632('0x34')]['includeAll']){_0x6599ad[_0x4632('0x40')]=[{'all':!![]}];}return db[_0x4632('0x30')][_0x4632('0x41')](_0x6599ad);})[_0x4632('0x26')](function(_0x5cc716){_0x4fda35['rows']=_0x5cc716;return _0x4fda35;})[_0x4632('0x26')](respondWithFilteredResult(_0x5316f7,_0x6599ad))[_0x4632('0x42')](handleError(_0x5316f7,null));};exports[_0x4632('0x43')]=function(_0x512db1,_0x330f21){var _0x1467c8={'raw':!![],'where':{'id':_0x512db1[_0x4632('0x44')]['id']}},_0x66598d={};_0x66598d[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x30')]['rawAttributes']);_0x66598d[_0x4632('0x34')]=_[_0x4632('0x33')](_0x512db1[_0x4632('0x34')]);_0x66598d[_0x4632('0x35')]=_[_0x4632('0x36')](_0x66598d['model'],_0x66598d['query']);_0x1467c8[_0x4632('0x38')]=_[_0x4632('0x36')](_0x66598d[_0x4632('0x37')],qs[_0x4632('0x45')](_0x512db1['query'][_0x4632('0x45')]));_0x1467c8[_0x4632('0x38')]=_0x1467c8[_0x4632('0x38')][_0x4632('0x46')]?_0x1467c8[_0x4632('0x38')]:_0x66598d['model'];if(_0x512db1[_0x4632('0x34')][_0x4632('0x47')]){_0x1467c8[_0x4632('0x40')]=[{'all':!![]}];}_0x1467c8=_[_0x4632('0x3d')]({},_0x1467c8,_0x512db1[_0x4632('0x3f')]);return db[_0x4632('0x30')][_0x4632('0x48')](_0x1467c8)[_0x4632('0x26')](handleEntityNotFound(_0x330f21,null))[_0x4632('0x26')](respondWithResult(_0x330f21,null))[_0x4632('0x42')](handleError(_0x330f21,null));};exports[_0x4632('0x49')]=function(_0x517584,_0xc3ffd0){return db[_0x4632('0x30')][_0x4632('0x49')](_0x517584['body'],{})[_0x4632('0x26')](function(_0x5f4fb5){var _0x1309aa=_0x517584[_0x4632('0x4a')][_0x4632('0x28')]({'plain':!![]});if(!_0x1309aa)throw new Error(_0x4632('0x4b'));if(_0x1309aa[_0x4632('0x4c')]===_0x4632('0x4a')){var _0x1f43b6=_0x5f4fb5[_0x4632('0x28')]({'plain':!![]});var _0x4e89e3=_0x4632('0x29');return db[_0x4632('0x4d')]['find']({'where':{'name':_0x4e89e3,'userProfileId':_0x1309aa[_0x4632('0x4e')]},'raw':!![]})[_0x4632('0x26')](function(_0x18cc47){if(_0x18cc47&&_0x18cc47[_0x4632('0x4f')]===0x0){return db[_0x4632('0x2a')][_0x4632('0x49')]({'name':_0x1f43b6[_0x4632('0x2d')],'resourceId':_0x1f43b6['id'],'type':_0x18cc47[_0x4632('0x2d')],'sectionId':_0x18cc47['id']},{})[_0x4632('0x26')](function(){return _0x5f4fb5;});}else{return _0x5f4fb5;}})[_0x4632('0x42')](function(_0x3e66d8){logger[_0x4632('0x2b')](_0x4632('0x50'),_0x3e66d8);throw _0x3e66d8;});}return _0x5f4fb5;})[_0x4632('0x26')](respondWithResult(_0xc3ffd0,0xc9))[_0x4632('0x42')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x25')]=function(_0x32cd35,_0x6c2864){if(_0x32cd35[_0x4632('0x51')]['id']){delete _0x32cd35[_0x4632('0x51')]['id'];}return db['VoiceMail'][_0x4632('0x48')]({'where':{'id':_0x32cd35[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x6c2864,null))[_0x4632('0x26')](saveUpdates(_0x32cd35[_0x4632('0x51')],null))[_0x4632('0x26')](respondWithResult(_0x6c2864,null))['catch'](handleError(_0x6c2864,null));};exports[_0x4632('0x27')]=function(_0x433fea,_0x41409d){return db['VoiceMail'][_0x4632('0x48')]({'where':{'id':_0x433fea[_0x4632('0x44')]['id']}})['then'](handleEntityNotFound(_0x41409d,null))[_0x4632('0x26')](removeEntity(_0x41409d,null))[_0x4632('0x42')](handleError(_0x41409d,null));};exports[_0x4632('0x52')]=function(_0x4b91cf,_0x3aeefd,_0x334a8e){return db[_0x4632('0x30')][_0x4632('0x53')]({'where':{'id':_0x4b91cf[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x3aeefd,null))[_0x4632('0x26')](function(_0x4658de){var _0x2965df;var _0x3abcbf={},_0x58d39a={};_0x58d39a[_0x4632('0x37')]=_[_0x4632('0x33')](db['VoiceMailMessage'][_0x4632('0x54')]);_0x58d39a['query']=_['keys'](_0x4b91cf[_0x4632('0x34')]);_0x58d39a[_0x4632('0x35')]=_[_0x4632('0x36')](_0x58d39a[_0x4632('0x37')],_0x58d39a[_0x4632('0x34')]);_0x3abcbf[_0x4632('0x38')]=_[_0x4632('0x36')](_0x58d39a[_0x4632('0x37')],qs[_0x4632('0x45')](_0x4b91cf[_0x4632('0x34')][_0x4632('0x45')]));_0x3abcbf[_0x4632('0x38')]=_0x3abcbf[_0x4632('0x38')][_0x4632('0x46')]?_0x3abcbf['attributes']:_0x58d39a['model'];if(!_0x4b91cf[_0x4632('0x34')][_0x4632('0x55')](_0x4632('0x39'))){_0x3abcbf[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x4b91cf[_0x4632('0x34')]['limit']);_0x3abcbf[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x4b91cf[_0x4632('0x34')][_0x4632('0x1c')]);}_0x3abcbf['order']=qs['sort'](_0x4b91cf[_0x4632('0x34')]['sort']);_0x3abcbf[_0x4632('0x3b')]=qs[_0x4632('0x35')](_[_0x4632('0x56')](_0x4b91cf[_0x4632('0x34')],_0x58d39a[_0x4632('0x35')]));if(_0x4b91cf['query'][_0x4632('0x3c')]){_0x3abcbf[_0x4632('0x3b')]=_['merge'](_0x3abcbf['where'],{'$or':_[_0x4632('0x2f')](_0x3abcbf[_0x4632('0x38')],function(_0x47391f){var _0x3090d6={};_0x3090d6[_0x47391f]={'$like':'%'+_0x4b91cf['query']['filter']+'%'};return _0x3090d6;})});}_0x3abcbf['where']=_[_0x4632('0x3d')](_0x3abcbf['where'],{'mailboxuser':_0x4658de[_0x4632('0x57')]});_0x3abcbf=_[_0x4632('0x3d')]({},_0x3abcbf,_0x4b91cf[_0x4632('0x3f')]);return db[_0x4632('0x58')][_0x4632('0x59')](_0x3abcbf)[_0x4632('0x26')](respondWithFilteredResult(_0x3aeefd,_0x3abcbf));})[_0x4632('0x42')](handleError(_0x3aeefd,null));}; \ No newline at end of file +var _0xbee3=['map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','nolimit','order','mailbox','findAndCountAll','rimraf','request-promise','moment','mustache','util','path','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x5f1b1a,_0x34a1fc){var _0x441330=function(_0x3b0da3){while(--_0x3b0da3){_0x5f1b1a['push'](_0x5f1b1a['shift']());}};_0x441330(++_0x34a1fc);}(_0xbee3,0xd5));var _0x3bee=function(_0x3462e7,_0x4e47ca){_0x3462e7=_0x3462e7-0x0;var _0x1f2967=_0xbee3[_0x3462e7];return _0x1f2967;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){var _0x45249c=_0x1fed5a[_0x3bee('0x26')]({'plain':!![]});var _0x1e0111='Voicemails';return db['UserProfileResource'][_0x3bee('0x25')]({'where':{'type':_0x1e0111,'resourceId':_0x45249c['id']}})[_0x3bee('0x24')](function(){return _0x1fed5a;});})['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x27')]();});}};}function handleEntityNotFound(_0x2e666a,_0x5b1eec){return function(_0x1984c4){if(!_0x1984c4){_0x2e666a[_0x3bee('0x17')](0x194);}return _0x1984c4;};}function handleError(_0x150766,_0x4f2066){_0x4f2066=_0x4f2066||0x1f4;return function(_0x239fa4){logger[_0x3bee('0x28')](_0x239fa4[_0x3bee('0x29')]);if(_0x239fa4['name']){delete _0x239fa4[_0x3bee('0x2a')];}_0x150766[_0x3bee('0x18')](_0x4f2066)[_0x3bee('0x2b')](_0x239fa4);};}exports[_0x3bee('0x2c')]=function(_0x3433aa,_0x559c2b){var _0x564e45={},_0x3fbc8c={},_0x1e1529={'count':0x0,'rows':[]};var _0x10bae0=_[_0x3bee('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x38f93c){return{'name':_0x38f93c[_0x3bee('0x2e')],'type':_0x38f93c['type']['key']};});_0x3fbc8c[_0x3bee('0x2f')]=_[_0x3bee('0x2d')](_0x10bae0,_0x3bee('0x2a'));_0x3fbc8c[_0x3bee('0x30')]=_[_0x3bee('0x31')](_0x3433aa[_0x3bee('0x30')]);_0x3fbc8c[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0x3fbc8c[_0x3bee('0x2f')],_0x3fbc8c[_0x3bee('0x30')]);_0x564e45['attributes']=_['intersection'](_0x3fbc8c[_0x3bee('0x2f')],qs['fields'](_0x3433aa['query'][_0x3bee('0x34')]));_0x564e45[_0x3bee('0x35')]=_0x564e45[_0x3bee('0x35')][_0x3bee('0x36')]?_0x564e45[_0x3bee('0x35')]:_0x3fbc8c[_0x3bee('0x2f')];if(!_0x3433aa[_0x3bee('0x30')][_0x3bee('0x37')]('nolimit')){_0x564e45[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x3433aa['query'][_0x3bee('0x1d')]);_0x564e45[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x564e45['order']=qs['sort'](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x38')]);_0x564e45[_0x3bee('0x39')]=qs[_0x3bee('0x32')](_[_0x3bee('0x3a')](_0x3433aa[_0x3bee('0x30')],_0x3fbc8c[_0x3bee('0x32')]),_0x10bae0);if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]){_0x564e45[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x564e45[_0x3bee('0x39')],{'$or':_['map'](_0x10bae0,function(_0xaceed4){if(_0xaceed4[_0x3bee('0x3d')]!==_0x3bee('0x3e')){var _0x45cf81={};_0x45cf81[_0xaceed4[_0x3bee('0x2a')]]={'$like':'%'+_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]+'%'};return _0x45cf81;}})});}_0x564e45=_[_0x3bee('0x3c')]({},_0x564e45,_0x3433aa[_0x3bee('0x3f')]);var _0x12ba6f={'where':_0x564e45[_0x3bee('0x39')]};return db[_0x3bee('0x40')][_0x3bee('0x1c')](_0x12ba6f)['then'](function(_0x2b773d){_0x1e1529[_0x3bee('0x1c')]=_0x2b773d;if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x41')]){_0x564e45[_0x3bee('0x42')]=[{'all':!![]}];}return db[_0x3bee('0x40')][_0x3bee('0x43')](_0x564e45);})[_0x3bee('0x24')](function(_0x5d9e1b){_0x1e1529[_0x3bee('0x44')]=_0x5d9e1b;return _0x1e1529;})[_0x3bee('0x24')](respondWithFilteredResult(_0x559c2b,_0x564e45))[_0x3bee('0x45')](handleError(_0x559c2b,null));};exports['show']=function(_0x4567f2,_0x57113b){var _0x2b1677={'raw':!![],'where':{'id':_0x4567f2['params']['id']}},_0x48325e={};_0x48325e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db[_0x3bee('0x40')][_0x3bee('0x46')]);_0x48325e[_0x3bee('0x30')]=_['keys'](_0x4567f2['query']);_0x48325e[_0x3bee('0x32')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],_0x48325e['query']);_0x2b1677[_0x3bee('0x35')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],qs[_0x3bee('0x34')](_0x4567f2[_0x3bee('0x30')][_0x3bee('0x34')]));_0x2b1677['attributes']=_0x2b1677['attributes'][_0x3bee('0x36')]?_0x2b1677['attributes']:_0x48325e['model'];if(_0x4567f2['query'][_0x3bee('0x41')]){_0x2b1677['include']=[{'all':!![]}];}_0x2b1677=_[_0x3bee('0x3c')]({},_0x2b1677,_0x4567f2[_0x3bee('0x3f')]);return db[_0x3bee('0x40')]['find'](_0x2b1677)[_0x3bee('0x24')](handleEntityNotFound(_0x57113b,null))['then'](respondWithResult(_0x57113b,null))[_0x3bee('0x45')](handleError(_0x57113b,null));};exports['create']=function(_0x26ccd7,_0x16b096){return db[_0x3bee('0x40')]['create'](_0x26ccd7[_0x3bee('0x47')],{})[_0x3bee('0x24')](function(_0x477de2){var _0x504382=_0x26ccd7['user'][_0x3bee('0x26')]({'plain':!![]});if(!_0x504382)throw new Error(_0x3bee('0x48'));if(_0x504382[_0x3bee('0x49')]===_0x3bee('0x4a')){var _0x3b5d7a=_0x477de2[_0x3bee('0x26')]({'plain':!![]});var _0x4005a3='Voicemails';return db[_0x3bee('0x4b')][_0x3bee('0x4c')]({'where':{'name':_0x4005a3,'userProfileId':_0x504382['userProfileId']},'raw':!![]})['then'](function(_0x3730c5){if(_0x3730c5&&_0x3730c5['autoAssociation']===0x0){return db[_0x3bee('0x4d')][_0x3bee('0x4e')]({'name':_0x3b5d7a[_0x3bee('0x2a')],'resourceId':_0x3b5d7a['id'],'type':_0x3730c5['name'],'sectionId':_0x3730c5['id']},{})[_0x3bee('0x24')](function(){return _0x477de2;});}else{return _0x477de2;}})[_0x3bee('0x45')](function(_0x127cb8){logger['error'](_0x3bee('0x4f'),_0x127cb8);throw _0x127cb8;});}return _0x477de2;})[_0x3bee('0x24')](respondWithResult(_0x16b096,0xc9))['catch'](handleError(_0x16b096,null));};exports[_0x3bee('0x23')]=function(_0x14940e,_0x53c881){if(_0x14940e[_0x3bee('0x47')]['id']){delete _0x14940e[_0x3bee('0x47')]['id'];}return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x14940e[_0x3bee('0x50')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x53c881,null))[_0x3bee('0x24')](saveUpdates(_0x14940e[_0x3bee('0x47')],null))['then'](respondWithResult(_0x53c881,null))['catch'](handleError(_0x53c881,null));};exports[_0x3bee('0x25')]=function(_0x5e13e8,_0x38b82a){return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x5e13e8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x38b82a,null))[_0x3bee('0x24')](removeEntity(_0x38b82a,null))[_0x3bee('0x45')](handleError(_0x38b82a,null));};exports['getMessages']=function(_0x19cbb8,_0x52a327,_0x3cb900){return db[_0x3bee('0x40')][_0x3bee('0x51')]({'where':{'id':_0x19cbb8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x52a327,null))[_0x3bee('0x24')](function(_0x282300){var _0x526551;var _0x5d95a7={},_0xb9f53e={};_0xb9f53e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db['VoiceMailMessage']['rawAttributes']);_0xb9f53e[_0x3bee('0x30')]=_['keys'](_0x19cbb8['query']);_0xb9f53e[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],_0xb9f53e['query']);_0x5d95a7['attributes']=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],qs['fields'](_0x19cbb8[_0x3bee('0x30')]['fields']));_0x5d95a7[_0x3bee('0x35')]=_0x5d95a7[_0x3bee('0x35')][_0x3bee('0x36')]?_0x5d95a7[_0x3bee('0x35')]:_0xb9f53e[_0x3bee('0x2f')];if(!_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x37')](_0x3bee('0x52'))){_0x5d95a7[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x19cbb8[_0x3bee('0x30')]['limit']);_0x5d95a7['offset']=qs['offset'](_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x5d95a7[_0x3bee('0x53')]=qs[_0x3bee('0x38')](_0x19cbb8['query'][_0x3bee('0x38')]);_0x5d95a7[_0x3bee('0x39')]=qs['filters'](_['pick'](_0x19cbb8[_0x3bee('0x30')],_0xb9f53e[_0x3bee('0x32')]));if(_0x19cbb8[_0x3bee('0x30')]['filter']){_0x5d95a7[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'$or':_['map'](_0x5d95a7[_0x3bee('0x35')],function(_0x412e0d){var _0x1bfb3a={};_0x1bfb3a[_0x412e0d]={'$like':'%'+_0x19cbb8[_0x3bee('0x30')]['filter']+'%'};return _0x1bfb3a;})});}_0x5d95a7['where']=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'mailboxuser':_0x282300[_0x3bee('0x54')]});_0x5d95a7=_[_0x3bee('0x3c')]({},_0x5d95a7,_0x19cbb8[_0x3bee('0x3f')]);return db['VoiceMailMessage'][_0x3bee('0x55')](_0x5d95a7)['then'](respondWithFilteredResult(_0x52a327,_0x5d95a7));})[_0x3bee('0x45')](handleError(_0x52a327,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 6a3d094..de50576 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bbb=['mailbox','lodash','../../config/logger','path','rimraf','../../config/environment','./voiceMail.attributes','voice_voicemail','mailbox_context'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x4bbb,0x1c3));var _0xb4bb=function(_0x2b3b45,_0x129a02){_0x2b3b45=_0x2b3b45-0x0;var _0x5d951a=_0x4bbb[_0x2b3b45];return _0x5d951a;};'use strict';var _=require(_0xb4bb('0x0'));var util=require('util');var logger=require(_0xb4bb('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4bb('0x2'));var rimraf=require(_0xb4bb('0x3'));var config=require(_0xb4bb('0x4'));var attributes=require(_0xb4bb('0x5'));module['exports']=function(_0xff135c,_0x28b702){return _0xff135c['define']('VoiceMail',attributes,{'tableName':_0xb4bb('0x6'),'paranoid':![],'indexes':[{'name':_0xb4bb('0x7'),'fields':[_0xb4bb('0x8'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xeab0=['VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceMail.attributes','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xeab0,0x156));var _0x0eab=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xeab0[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x0eab('0x0'));var util=require(_0x0eab('0x1'));var logger=require(_0x0eab('0x2'))(_0x0eab('0x3'));var moment=require(_0x0eab('0x4'));var BPromise=require('bluebird');var rp=require(_0x0eab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0eab('0x6'));var config=require('../../config/environment');var attributes=require(_0x0eab('0x7'));module[_0x0eab('0x8')]=function(_0x452af7,_0x5e45ec){return _0x452af7['define'](_0x0eab('0x9'),attributes,{'tableName':_0x0eab('0xa'),'paranoid':![],'indexes':[{'name':_0x0eab('0xb'),'fields':['mailbox',_0x0eab('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index beea0b7..460172e 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4344=['then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4344,0x1ec));var _0x4434=function(_0x49818a,_0x4e961f){_0x49818a=_0x49818a-0x0;var _0x3f58c5=_0x4344[_0x49818a];return _0x3f58c5;};'use strict';var _=require(_0x4434('0x0'));var util=require(_0x4434('0x1'));var moment=require(_0x4434('0x2'));var BPromise=require(_0x4434('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4434('0x4'))['db'];var utils=require(_0x4434('0x5'));var logger=require(_0x4434('0x6'))(_0x4434('0x7'));var config=require(_0x4434('0x8'));var jayson=require(_0x4434('0x9'));var client=jayson[_0x4434('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x127524,_0x2e41e4,_0x573e22){return new BPromise(function(_0x20d81e,_0x35c105){return client[_0x4434('0xb')](_0x127524,_0x573e22)[_0x4434('0xc')](function(_0x3fb639){logger[_0x4434('0xd')](_0x4434('0xe'),_0x2e41e4,_0x4434('0xf'));logger[_0x4434('0x10')](_0x4434('0x11'),_0x2e41e4,_0x4434('0xf'),JSON[_0x4434('0x12')](_0x3fb639));if(_0x3fb639[_0x4434('0x13')]){if(_0x3fb639[_0x4434('0x13')]['code']===0x1f4){logger[_0x4434('0x13')]('VoiceMail,\x20%s,\x20%s',_0x2e41e4,_0x3fb639[_0x4434('0x13')]['message']);return _0x35c105(_0x3fb639[_0x4434('0x13')]['message']);}logger[_0x4434('0x13')](_0x4434('0xe'),_0x2e41e4,_0x3fb639[_0x4434('0x13')][_0x4434('0x14')]);return _0x20d81e(_0x3fb639[_0x4434('0x13')][_0x4434('0x14')]);}else{logger[_0x4434('0xd')](_0x4434('0xe'),_0x2e41e4,'request\x20sent');_0x20d81e(_0x3fb639['result'][_0x4434('0x14')]);}})['catch'](function(_0x2529b8){logger['error'](_0x4434('0xe'),_0x2e41e4,_0x2529b8);_0x35c105(_0x2529b8);});});} \ No newline at end of file +var _0xbddd=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xbddd,0x192));var _0xdbdd=function(_0x35165c,_0x33b479){_0x35165c=_0x35165c-0x0;var _0xb98013=_0xbddd[_0x35165c];return _0xb98013;};'use strict';var _=require(_0xdbdd('0x0'));var util=require('util');var moment=require(_0xdbdd('0x1'));var BPromise=require(_0xdbdd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbdd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbdd('0x4'));var logger=require(_0xdbdd('0x5'))(_0xdbdd('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbdd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x558bb8,_0x5753c3,_0x3cc5b0){return new BPromise(function(_0x619b28,_0x5d9453){return client[_0xdbdd('0x8')](_0x558bb8,_0x3cc5b0)[_0xdbdd('0x9')](function(_0x4b200){logger[_0xdbdd('0xa')](_0xdbdd('0xb'),_0x5753c3,'request\x20sent');logger[_0xdbdd('0xc')](_0xdbdd('0xd'),_0x5753c3,_0xdbdd('0xe'),JSON['stringify'](_0x4b200));if(_0x4b200[_0xdbdd('0xf')]){if(_0x4b200[_0xdbdd('0xf')]['code']===0x1f4){logger[_0xdbdd('0xf')](_0xdbdd('0xb'),_0x5753c3,_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);return _0x5d9453(_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x5753c3,_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);return _0x619b28(_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);}else{logger[_0xdbdd('0xa')]('VoiceMail,\x20%s,\x20%s',_0x5753c3,_0xdbdd('0xe'));_0x619b28(_0x4b200[_0xdbdd('0x11')][_0xdbdd('0x10')]);}})['catch'](function(_0x414c5c){logger['error']('VoiceMail,\x20%s,\x20%s',_0x5753c3,_0x414c5c);_0x5d9453(_0x414c5c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 8e951b5..9e952bc 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96a3=['/:id','show','/:id/download','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x191674,_0x5b3d48){var _0x2fd9cb=function(_0x53f67d){while(--_0x53f67d){_0x191674['push'](_0x191674['shift']());}};_0x2fd9cb(++_0x5b3d48);}(_0x96a3,0xf2));var _0x396a=function(_0x16d04a,_0x23f5f8){_0x16d04a=_0x16d04a-0x0;var _0x4ec0c2=_0x96a3[_0x16d04a];return _0x4ec0c2;};'use strict';var multer=require(_0x396a('0x0'));var util=require(_0x396a('0x1'));var path=require('path');var timeout=require(_0x396a('0x2'));var express=require(_0x396a('0x3'));var router=express[_0x396a('0x4')]();var fs_extra=require(_0x396a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x396a('0x6'));var controller=require(_0x396a('0x7'));router[_0x396a('0x8')]('/',auth[_0x396a('0x9')](),controller['index']);router[_0x396a('0x8')](_0x396a('0xa'),auth['isAuthenticated'](),controller[_0x396a('0xb')]);router[_0x396a('0x8')](_0x396a('0xc'),auth[_0x396a('0x9')](),controller['download']);router[_0x396a('0xd')]('/',auth[_0x396a('0x9')](),controller[_0x396a('0xe')]);router['put'](_0x396a('0xa'),auth[_0x396a('0x9')](),controller['update']);router[_0x396a('0xf')]('/:id',auth[_0x396a('0x9')](),controller[_0x396a('0x10')]);module[_0x396a('0x11')]=router; \ No newline at end of file +var _0xc5ca=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5ca,0x9b));var _0xac5c=function(_0x54c6b0,_0x400655){_0x54c6b0=_0x54c6b0-0x0;var _0x43a6e9=_0xc5ca[_0x54c6b0];return _0x43a6e9;};'use strict';var multer=require(_0xac5c('0x0'));var util=require(_0xac5c('0x1'));var path=require(_0xac5c('0x2'));var timeout=require(_0xac5c('0x3'));var express=require(_0xac5c('0x4'));var router=express[_0xac5c('0x5')]();var fs_extra=require(_0xac5c('0x6'));var auth=require(_0xac5c('0x7'));var interaction=require(_0xac5c('0x8'));var config=require(_0xac5c('0x9'));var controller=require(_0xac5c('0xa'));router['get']('/',auth[_0xac5c('0xb')](),controller[_0xac5c('0xc')]);router[_0xac5c('0xd')](_0xac5c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xac5c('0xd')](_0xac5c('0xf'),auth[_0xac5c('0xb')](),controller[_0xac5c('0x10')]);router[_0xac5c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xac5c('0x12')](_0xac5c('0xe'),auth[_0xac5c('0xb')](),controller[_0xac5c('0x13')]);router[_0xac5c('0x14')](_0xac5c('0xe'),auth['isAuthenticated'](),controller[_0xac5c('0x15')]);module[_0xac5c('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f3a0847..39a1180 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e40=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0x1277a6,_0x12f4e3){var _0x347020=function(_0x34972d){while(--_0x34972d){_0x1277a6['push'](_0x1277a6['shift']());}};_0x347020(++_0x12f4e3);}(_0x7e40,0x81));var _0x07e4=function(_0x4244f8,_0x42dd75){_0x4244f8=_0x4244f8-0x0;var _0x49fd44=_0x7e40[_0x4244f8];return _0x49fd44;};'use strict';var Sequelize=require('sequelize');module[_0x07e4('0x0')]={'name':{'type':Sequelize[_0x07e4('0x1')],'get':function(_0x2a9e34){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x07e4('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x07e4('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x07e4('0x3')],'defaultValue':''},'stamp':{'type':_0x07e4('0x5'),'defaultValue':Sequelize[_0x07e4('0x6')](_0x07e4('0x7'))}}; \ No newline at end of file +var _0xbdce=['VIRTUAL','INTEGER','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x48cdfe,_0x32c6c1){var _0xbd78be=function(_0x316e01){while(--_0x316e01){_0x48cdfe['push'](_0x48cdfe['shift']());}};_0xbd78be(++_0x32c6c1);}(_0xbdce,0x7c));var _0xebdc=function(_0x54f72a,_0x17ea1c){_0x54f72a=_0x54f72a-0x0;var _0x168c6a=_0xbdce[_0x54f72a];return _0x168c6a;};'use strict';var Sequelize=require(_0xebdc('0x0'));module[_0xebdc('0x1')]={'name':{'type':Sequelize[_0xebdc('0x2')],'get':function(_0x302588){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xebdc('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xebdc('0x5')](_0xebdc('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1660dea..4a756ff 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cf9=['params','options','find','create','body','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','fast-json-patch','moment','bluebird','mustache','util','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0x5cf9,0x165));var _0x95cf=function(_0x149573,_0x3be55a){_0x149573=_0x149573-0x0;var _0x36a940=_0x5cf9[_0x149573];return _0x36a940;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95cf('0x1'));var rp=require('request-promise');var moment=require(_0x95cf('0x2'));var BPromise=require(_0x95cf('0x3'));var Mustache=require(_0x95cf('0x4'));var util=require(_0x95cf('0x5'));var path=require('path');var sox=require(_0x95cf('0x6'));var csv=require(_0x95cf('0x7'));var ejs=require(_0x95cf('0x8'));var fs=require('fs');var fs_extra=require(_0x95cf('0x9'));var _=require(_0x95cf('0xa'));var squel=require(_0x95cf('0xb'));var crypto=require(_0x95cf('0xc'));var jsforce=require(_0x95cf('0xd'));var deskjs=require(_0x95cf('0xe'));var toCsv=require(_0x95cf('0x7'));var querystring=require('querystring');var Papa=require(_0x95cf('0xf'));var Redis=require(_0x95cf('0x10'));var authService=require(_0x95cf('0x11'));var qs=require(_0x95cf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95cf('0x13'));var logger=require(_0x95cf('0x14'))(_0x95cf('0x15'));var utils=require(_0x95cf('0x16'));var config=require(_0x95cf('0x17'));var licenseUtil=require(_0x95cf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aebb7,_0x6d43a0){_0x6d43a0=_0x6d43a0||0xcc;return function(_0x39f623){if(_0x39f623){return _0x2aebb7[_0x95cf('0x19')](_0x6d43a0);}return _0x2aebb7[_0x95cf('0x1a')](_0x6d43a0)[_0x95cf('0x1b')]();};}function respondWithResult(_0x47acd2,_0x28a1fb){_0x28a1fb=_0x28a1fb||0xc8;return function(_0x5e19eb){if(_0x5e19eb){return _0x47acd2[_0x95cf('0x1a')](_0x28a1fb)[_0x95cf('0x1c')](_0x5e19eb);}};}function respondWithFilteredResult(_0x51cb92,_0x5c0c12){return function(_0x25240e){if(_0x25240e){var _0x25f484=typeof _0x5c0c12[_0x95cf('0x1d')]===_0x95cf('0x1e')&&typeof _0x5c0c12[_0x95cf('0x1f')]===_0x95cf('0x1e');var _0x215dcd=_0x25240e[_0x95cf('0x20')];var _0x3ba017=_0x25f484?0x0:_0x5c0c12[_0x95cf('0x1d')];var _0x191ac9=_0x25f484?_0x25240e[_0x95cf('0x20')]:_0x5c0c12[_0x95cf('0x1d')]+_0x5c0c12['limit'];var _0x18842e;if(_0x191ac9>=_0x215dcd){_0x191ac9=_0x215dcd;_0x18842e=0xc8;}else{_0x18842e=0xce;}_0x51cb92[_0x95cf('0x1a')](_0x18842e);return _0x51cb92[_0x95cf('0x21')](_0x95cf('0x22'),_0x3ba017+'-'+_0x191ac9+'/'+_0x215dcd)['json'](_0x25240e);}return null;};}function patchUpdates(_0xe50025){return function(_0x107eed){try{jsonpatch[_0x95cf('0x23')](_0x107eed,_0xe50025,!![]);}catch(_0x2d6446){return BPromise[_0x95cf('0x24')](_0x2d6446);}return _0x107eed[_0x95cf('0x25')]();};}function saveUpdates(_0x27cb6e,_0x12c46f){return function(_0x432401){if(_0x432401){return _0x432401[_0x95cf('0x26')](_0x27cb6e)[_0x95cf('0x27')](function(_0x882728){return _0x882728;});}return null;};}function removeEntity(_0x3859ad,_0x2bfb1d){return function(_0xcf8a6c){if(_0xcf8a6c){return _0xcf8a6c['destroy']()[_0x95cf('0x27')](function(){_0x3859ad[_0x95cf('0x1a')](0xcc)[_0x95cf('0x1b')]();});}};}function handleEntityNotFound(_0x1fac4a,_0x20e427){return function(_0x5e4fe4){if(!_0x5e4fe4){_0x1fac4a[_0x95cf('0x19')](0x194);}return _0x5e4fe4;};}function handleError(_0x4911dc,_0x44f453){_0x44f453=_0x44f453||0x1f4;return function(_0x3b0b60){logger[_0x95cf('0x28')](_0x3b0b60[_0x95cf('0x29')]);if(_0x3b0b60['name']){delete _0x3b0b60[_0x95cf('0x2a')];}_0x4911dc[_0x95cf('0x1a')](_0x44f453)[_0x95cf('0x2b')](_0x3b0b60);};}exports[_0x95cf('0x2c')]=function(_0x5f1edd,_0x27ea72){var _0x30fef2={},_0x950520={},_0x597045={'count':0x0,'rows':[]};var _0x223cd2=_[_0x95cf('0x2d')](db[_0x95cf('0x2e')][_0x95cf('0x2f')],function(_0x4bb1ef){return{'name':_0x4bb1ef[_0x95cf('0x30')],'type':_0x4bb1ef[_0x95cf('0x31')][_0x95cf('0x32')]};});_0x950520['model']=_[_0x95cf('0x33')](_['map'](_0x223cd2,_0x95cf('0x2a')),['name']);_0x950520[_0x95cf('0x34')]=_[_0x95cf('0x35')](_0x5f1edd[_0x95cf('0x34')]);_0x950520[_0x95cf('0x36')]=_[_0x95cf('0x37')](_0x950520[_0x95cf('0x38')],_0x950520[_0x95cf('0x34')]);_0x30fef2[_0x95cf('0x39')]=_[_0x95cf('0x37')](_0x950520[_0x95cf('0x38')],qs['fields'](_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x3a')]));_0x30fef2['attributes']=_0x30fef2['attributes'][_0x95cf('0x3b')]?_0x30fef2[_0x95cf('0x39')]:_0x950520['model'];if(!_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x3c')](_0x95cf('0x3d'))){_0x30fef2[_0x95cf('0x1f')]=qs[_0x95cf('0x1f')](_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x1f')]);_0x30fef2['offset']=qs[_0x95cf('0x1d')](_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x1d')]);}_0x30fef2['order']=qs[_0x95cf('0x3e')](_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x3e')]);_0x30fef2[_0x95cf('0x3f')]=qs[_0x95cf('0x36')](_[_0x95cf('0x40')](_0x5f1edd[_0x95cf('0x34')],_0x950520[_0x95cf('0x36')]),_0x223cd2);if(_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x41')]){_0x30fef2[_0x95cf('0x3f')]=_[_0x95cf('0x42')](_0x30fef2[_0x95cf('0x3f')],{'$or':_[_0x95cf('0x2d')](_0x223cd2,function(_0x6c001d){if(_0x6c001d[_0x95cf('0x31')]!=='VIRTUAL'){var _0x118609={};_0x118609[_0x6c001d['name']]={'$like':'%'+_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x41')]+'%'};return _0x118609;}})});}_0x30fef2=_['merge']({},_0x30fef2,_0x5f1edd['options']);var _0x11aadc={'where':_0x30fef2[_0x95cf('0x3f')]};return db[_0x95cf('0x2e')]['count'](_0x11aadc)[_0x95cf('0x27')](function(_0x320ae0){_0x597045[_0x95cf('0x20')]=_0x320ae0;if(_0x5f1edd[_0x95cf('0x34')][_0x95cf('0x43')]){_0x30fef2[_0x95cf('0x44')]=[{'all':!![]}];}return db[_0x95cf('0x2e')][_0x95cf('0x45')](_0x30fef2);})[_0x95cf('0x27')](function(_0x44c56e){_0x597045[_0x95cf('0x46')]=_0x44c56e;return _0x597045;})[_0x95cf('0x27')](respondWithFilteredResult(_0x27ea72,_0x30fef2))[_0x95cf('0x47')](handleError(_0x27ea72,null));};exports[_0x95cf('0x48')]=function(_0x402485,_0x2ff4bc){var _0x1a3ac6={'raw':!![],'where':{'id':_0x402485[_0x95cf('0x49')]['id']}},_0x492ed5={};_0x492ed5['model']=_[_0x95cf('0x35')](db[_0x95cf('0x2e')]['rawAttributes']);_0x492ed5[_0x95cf('0x34')]=_[_0x95cf('0x35')](_0x402485['query']);_0x492ed5[_0x95cf('0x36')]=_[_0x95cf('0x37')](_0x492ed5[_0x95cf('0x38')],_0x492ed5[_0x95cf('0x34')]);_0x1a3ac6['attributes']=_[_0x95cf('0x37')](_0x492ed5[_0x95cf('0x38')],qs[_0x95cf('0x3a')](_0x402485[_0x95cf('0x34')]['fields']));_0x1a3ac6['attributes']=_0x1a3ac6[_0x95cf('0x39')][_0x95cf('0x3b')]?_0x1a3ac6[_0x95cf('0x39')]:_0x492ed5[_0x95cf('0x38')];if(_0x402485[_0x95cf('0x34')][_0x95cf('0x43')]){_0x1a3ac6[_0x95cf('0x44')]=[{'all':!![]}];}_0x1a3ac6=_[_0x95cf('0x42')]({},_0x1a3ac6,_0x402485[_0x95cf('0x4a')]);return db[_0x95cf('0x2e')][_0x95cf('0x4b')](_0x1a3ac6)['then'](handleEntityNotFound(_0x2ff4bc,null))['then'](respondWithResult(_0x2ff4bc,null))[_0x95cf('0x47')](handleError(_0x2ff4bc,null));};exports[_0x95cf('0x4c')]=function(_0x53436e,_0x27880a){return db[_0x95cf('0x2e')]['create'](_0x53436e[_0x95cf('0x4d')],{})['then'](respondWithResult(_0x27880a,0xc9))[_0x95cf('0x47')](handleError(_0x27880a,null));};exports[_0x95cf('0x26')]=function(_0x4d74e6,_0x1f6235){if(_0x4d74e6[_0x95cf('0x4d')]['id']){delete _0x4d74e6[_0x95cf('0x4d')]['id'];}return db[_0x95cf('0x2e')]['find']({'where':{'id':_0x4d74e6[_0x95cf('0x49')]['id']}})[_0x95cf('0x27')](handleEntityNotFound(_0x1f6235,null))['then'](saveUpdates(_0x4d74e6[_0x95cf('0x4d')],null))[_0x95cf('0x27')](respondWithResult(_0x1f6235,null))[_0x95cf('0x47')](handleError(_0x1f6235,null));};exports['destroy']=function(_0x40ac41,_0x498b47){return db[_0x95cf('0x2e')][_0x95cf('0x4b')]({'where':{'id':_0x40ac41[_0x95cf('0x49')]['id']}})[_0x95cf('0x27')](handleEntityNotFound(_0x498b47,null))[_0x95cf('0x27')](removeEntity(_0x498b47,null))[_0x95cf('0x47')](handleError(_0x498b47,null));};exports['download']=function(_0x3c7fa1,_0x2dfdc3,_0x1ff0f9){return db['VoiceMailMessage']['find']({'where':{'id':_0x3c7fa1['params']['id']},'attributes':['id',_0x95cf('0x4e'),_0x95cf('0x4f')]})['then'](handleEntityNotFound(_0x2dfdc3,null))['then'](function(_0x3b1df8){if(_0x3b1df8){if(!_0x3b1df8[_0x95cf('0x4e')]){throw new db[(_0x95cf('0x50'))]['ValidationError'](_0x95cf('0x51'));}var _0x463d88={'Content-Type':_0x95cf('0x52'),'Content-Disposition':'attachment'};if(_0x3b1df8[_0x95cf('0x4f')]){_0x463d88[_0x95cf('0x53')]=_0x95cf('0x54')+_0x3b1df8[_0x95cf('0x4f')]+_0x95cf('0x55');}_0x2dfdc3[_0x95cf('0x21')](_0x463d88);return _0x2dfdc3[_0x95cf('0x2b')](new Buffer(_0x3b1df8['recording']));}})[_0x95cf('0x47')](handleError(_0x2dfdc3,null));}; \ No newline at end of file +var _0xafca=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','include','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafca,0x139));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaafc('0x0'));var rimraf=require(_0xaafc('0x1'));var zipdir=require(_0xaafc('0x2'));var jsonpatch=require(_0xaafc('0x3'));var rp=require(_0xaafc('0x4'));var moment=require(_0xaafc('0x5'));var BPromise=require(_0xaafc('0x6'));var Mustache=require(_0xaafc('0x7'));var util=require(_0xaafc('0x8'));var path=require('path');var sox=require(_0xaafc('0x9'));var csv=require(_0xaafc('0xa'));var ejs=require(_0xaafc('0xb'));var fs=require('fs');var fs_extra=require(_0xaafc('0xc'));var _=require(_0xaafc('0xd'));var squel=require(_0xaafc('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaafc('0xf'));var Papa=require(_0xaafc('0x10'));var Redis=require(_0xaafc('0x11'));var authService=require(_0xaafc('0x12'));var qs=require(_0xaafc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaafc('0x14'));var logger=require(_0xaafc('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaafc('0x16'));var db=require(_0xaafc('0x17'))['db'];function respondWithStatusCode(_0x8efb3b,_0x6f31c0){_0x6f31c0=_0x6f31c0||0xcc;return function(_0x161593){if(_0x161593){return _0x8efb3b['sendStatus'](_0x6f31c0);}return _0x8efb3b[_0xaafc('0x18')](_0x6f31c0)[_0xaafc('0x19')]();};}function respondWithResult(_0x17b986,_0x307adb){_0x307adb=_0x307adb||0xc8;return function(_0x2aa7f2){if(_0x2aa7f2){return _0x17b986['status'](_0x307adb)['json'](_0x2aa7f2);}};}function respondWithFilteredResult(_0x196f41,_0x17961a){return function(_0xe24787){if(_0xe24787){var _0x17d1d0=typeof _0x17961a[_0xaafc('0x1a')]===_0xaafc('0x1b')&&typeof _0x17961a[_0xaafc('0x1c')]==='undefined';var _0x4c9cd6=_0xe24787[_0xaafc('0x1d')];var _0x459363=_0x17d1d0?0x0:_0x17961a[_0xaafc('0x1a')];var _0x40b404=_0x17d1d0?_0xe24787[_0xaafc('0x1d')]:_0x17961a[_0xaafc('0x1a')]+_0x17961a[_0xaafc('0x1c')];var _0x1cd542;if(_0x40b404>=_0x4c9cd6){_0x40b404=_0x4c9cd6;_0x1cd542=0xc8;}else{_0x1cd542=0xce;}_0x196f41[_0xaafc('0x18')](_0x1cd542);return _0x196f41[_0xaafc('0x1e')](_0xaafc('0x1f'),_0x459363+'-'+_0x40b404+'/'+_0x4c9cd6)['json'](_0xe24787);}return null;};}function patchUpdates(_0x76a47f){return function(_0x27564b){try{jsonpatch[_0xaafc('0x20')](_0x27564b,_0x76a47f,!![]);}catch(_0xa3c9cd){return BPromise[_0xaafc('0x21')](_0xa3c9cd);}return _0x27564b['save']();};}function saveUpdates(_0x3aad7a,_0x158faa){return function(_0x153481){if(_0x153481){return _0x153481[_0xaafc('0x22')](_0x3aad7a)[_0xaafc('0x23')](function(_0x5d868a){return _0x5d868a;});}return null;};}function removeEntity(_0x2dc5b3,_0x2693a4){return function(_0x4c8424){if(_0x4c8424){return _0x4c8424[_0xaafc('0x24')]()['then'](function(){_0x2dc5b3[_0xaafc('0x18')](0xcc)[_0xaafc('0x19')]();});}};}function handleEntityNotFound(_0x2bb586,_0x174606){return function(_0xe37cb8){if(!_0xe37cb8){_0x2bb586[_0xaafc('0x25')](0x194);}return _0xe37cb8;};}function handleError(_0x4abaab,_0x17071c){_0x17071c=_0x17071c||0x1f4;return function(_0x1e82bf){logger[_0xaafc('0x26')](_0x1e82bf[_0xaafc('0x27')]);if(_0x1e82bf['name']){delete _0x1e82bf[_0xaafc('0x28')];}_0x4abaab[_0xaafc('0x18')](_0x17071c)['send'](_0x1e82bf);};}exports[_0xaafc('0x29')]=function(_0x311886,_0x143c0b){var _0x1cff38={},_0x540be9={},_0x28ce7a={'count':0x0,'rows':[]};var _0xb1dc81=_['map'](db[_0xaafc('0x2a')][_0xaafc('0x2b')],function(_0x4c0c54){return{'name':_0x4c0c54['fieldName'],'type':_0x4c0c54[_0xaafc('0x2c')][_0xaafc('0x2d')]};});_0x540be9[_0xaafc('0x2e')]=_[_0xaafc('0x2f')](_[_0xaafc('0x30')](_0xb1dc81,_0xaafc('0x28')),['name']);_0x540be9[_0xaafc('0x31')]=_[_0xaafc('0x32')](_0x311886[_0xaafc('0x31')]);_0x540be9['filters']=_['intersection'](_0x540be9[_0xaafc('0x2e')],_0x540be9[_0xaafc('0x31')]);_0x1cff38[_0xaafc('0x33')]=_[_0xaafc('0x34')](_0x540be9[_0xaafc('0x2e')],qs[_0xaafc('0x35')](_0x311886['query'][_0xaafc('0x35')]));_0x1cff38['attributes']=_0x1cff38[_0xaafc('0x33')][_0xaafc('0x36')]?_0x1cff38[_0xaafc('0x33')]:_0x540be9[_0xaafc('0x2e')];if(!_0x311886['query'][_0xaafc('0x37')]('nolimit')){_0x1cff38[_0xaafc('0x1c')]=qs['limit'](_0x311886[_0xaafc('0x31')][_0xaafc('0x1c')]);_0x1cff38[_0xaafc('0x1a')]=qs[_0xaafc('0x1a')](_0x311886[_0xaafc('0x31')][_0xaafc('0x1a')]);}_0x1cff38['order']=qs[_0xaafc('0x38')](_0x311886[_0xaafc('0x31')][_0xaafc('0x38')]);_0x1cff38[_0xaafc('0x39')]=qs[_0xaafc('0x3a')](_[_0xaafc('0x3b')](_0x311886['query'],_0x540be9[_0xaafc('0x3a')]),_0xb1dc81);if(_0x311886[_0xaafc('0x31')][_0xaafc('0x3c')]){_0x1cff38[_0xaafc('0x39')]=_[_0xaafc('0x3d')](_0x1cff38[_0xaafc('0x39')],{'$or':_[_0xaafc('0x30')](_0xb1dc81,function(_0x59e23f){if(_0x59e23f[_0xaafc('0x2c')]!==_0xaafc('0x3e')){var _0x1351b1={};_0x1351b1[_0x59e23f['name']]={'$like':'%'+_0x311886[_0xaafc('0x31')]['filter']+'%'};return _0x1351b1;}})});}_0x1cff38=_[_0xaafc('0x3d')]({},_0x1cff38,_0x311886[_0xaafc('0x3f')]);var _0x1843c0={'where':_0x1cff38['where']};return db[_0xaafc('0x2a')][_0xaafc('0x1d')](_0x1843c0)[_0xaafc('0x23')](function(_0x27265d){_0x28ce7a[_0xaafc('0x1d')]=_0x27265d;if(_0x311886[_0xaafc('0x31')][_0xaafc('0x40')]){_0x1cff38['include']=[{'all':!![]}];}return db[_0xaafc('0x2a')]['findAll'](_0x1cff38);})[_0xaafc('0x23')](function(_0x13c50e){_0x28ce7a['rows']=_0x13c50e;return _0x28ce7a;})[_0xaafc('0x23')](respondWithFilteredResult(_0x143c0b,_0x1cff38))[_0xaafc('0x41')](handleError(_0x143c0b,null));};exports['show']=function(_0x5f01f5,_0x24b640){var _0x37565f={'raw':!![],'where':{'id':_0x5f01f5[_0xaafc('0x42')]['id']}},_0x26058a={};_0x26058a[_0xaafc('0x2e')]=_[_0xaafc('0x32')](db[_0xaafc('0x2a')][_0xaafc('0x2b')]);_0x26058a[_0xaafc('0x31')]=_['keys'](_0x5f01f5[_0xaafc('0x31')]);_0x26058a[_0xaafc('0x3a')]=_[_0xaafc('0x34')](_0x26058a['model'],_0x26058a[_0xaafc('0x31')]);_0x37565f[_0xaafc('0x33')]=_[_0xaafc('0x34')](_0x26058a[_0xaafc('0x2e')],qs[_0xaafc('0x35')](_0x5f01f5['query'][_0xaafc('0x35')]));_0x37565f[_0xaafc('0x33')]=_0x37565f[_0xaafc('0x33')][_0xaafc('0x36')]?_0x37565f[_0xaafc('0x33')]:_0x26058a['model'];if(_0x5f01f5[_0xaafc('0x31')]['includeAll']){_0x37565f[_0xaafc('0x43')]=[{'all':!![]}];}_0x37565f=_['merge']({},_0x37565f,_0x5f01f5[_0xaafc('0x3f')]);return db['VoiceMailMessage'][_0xaafc('0x44')](_0x37565f)[_0xaafc('0x23')](handleEntityNotFound(_0x24b640,null))[_0xaafc('0x23')](respondWithResult(_0x24b640,null))[_0xaafc('0x41')](handleError(_0x24b640,null));};exports[_0xaafc('0x45')]=function(_0x3b2ee8,_0x29b63d){return db['VoiceMailMessage'][_0xaafc('0x45')](_0x3b2ee8[_0xaafc('0x46')],{})[_0xaafc('0x23')](respondWithResult(_0x29b63d,0xc9))['catch'](handleError(_0x29b63d,null));};exports[_0xaafc('0x22')]=function(_0x186efb,_0x4f0c91){if(_0x186efb['body']['id']){delete _0x186efb[_0xaafc('0x46')]['id'];}return db['VoiceMailMessage'][_0xaafc('0x44')]({'where':{'id':_0x186efb['params']['id']}})[_0xaafc('0x23')](handleEntityNotFound(_0x4f0c91,null))[_0xaafc('0x23')](saveUpdates(_0x186efb[_0xaafc('0x46')],null))['then'](respondWithResult(_0x4f0c91,null))[_0xaafc('0x41')](handleError(_0x4f0c91,null));};exports[_0xaafc('0x24')]=function(_0x3d7cbf,_0x5c238a){return db[_0xaafc('0x2a')][_0xaafc('0x44')]({'where':{'id':_0x3d7cbf[_0xaafc('0x42')]['id']}})[_0xaafc('0x23')](handleEntityNotFound(_0x5c238a,null))[_0xaafc('0x23')](removeEntity(_0x5c238a,null))['catch'](handleError(_0x5c238a,null));};exports[_0xaafc('0x47')]=function(_0x3516ed,_0x108668,_0x18d416){return db[_0xaafc('0x2a')][_0xaafc('0x44')]({'where':{'id':_0x3516ed[_0xaafc('0x42')]['id']},'attributes':['id',_0xaafc('0x48'),_0xaafc('0x49')]})[_0xaafc('0x23')](handleEntityNotFound(_0x108668,null))['then'](function(_0xa7ce08){if(_0xa7ce08){if(!_0xa7ce08[_0xaafc('0x48')]){throw new db[(_0xaafc('0x4a'))][(_0xaafc('0x4b'))](_0xaafc('0x4c'));}var _0x5e9ef6={'Content-Type':_0xaafc('0x4d'),'Content-Disposition':_0xaafc('0x4e')};if(_0xa7ce08[_0xaafc('0x49')]){_0x5e9ef6[_0xaafc('0x4f')]=_0xaafc('0x50')+_0xa7ce08[_0xaafc('0x49')]+_0xaafc('0x51');}_0x108668['set'](_0x5e9ef6);return _0x108668[_0xaafc('0x52')](new Buffer(_0xa7ce08[_0xaafc('0x48')]));}})[_0xaafc('0x41')](handleError(_0x108668,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3529838..6c4d848 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x454c=['dir','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x48f03b,_0x4484b6){var _0x272b72=function(_0x371c8e){while(--_0x371c8e){_0x48f03b['push'](_0x48f03b['shift']());}};_0x272b72(++_0x4484b6);}(_0x454c,0x1f0));var _0xc454=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x454c[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xc454('0x0'));var util=require(_0xc454('0x1'));var logger=require('../../config/logger')(_0xc454('0x2'));var moment=require(_0xc454('0x3'));var BPromise=require(_0xc454('0x4'));var rp=require(_0xc454('0x5'));var fs=require('fs');var path=require(_0xc454('0x6'));var rimraf=require(_0xc454('0x7'));var config=require(_0xc454('0x8'));var attributes=require(_0xc454('0x9'));module[_0xc454('0xa')]=function(_0x509f9f,_0x121c35){return _0x509f9f[_0xc454('0xb')](_0xc454('0xc'),attributes,{'tableName':_0xc454('0xd'),'paranoid':![],'indexes':[{'name':_0xc454('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xb26c=['rimraf','../../config/environment','define','VoiceMailMessage','voice_voicemail_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x453881,_0x2c2702){var _0xc4eba8=function(_0x5ae1e5){while(--_0x5ae1e5){_0x453881['push'](_0x453881['shift']());}};_0xc4eba8(++_0x2c2702);}(_0xb26c,0x1bf));var _0xcb26=function(_0x3b28fd,_0x5f4ad9){_0x3b28fd=_0x3b28fd-0x0;var _0xf00b1a=_0xb26c[_0x3b28fd];return _0xf00b1a;};'use strict';var _=require(_0xcb26('0x0'));var util=require(_0xcb26('0x1'));var logger=require(_0xcb26('0x2'))(_0xcb26('0x3'));var moment=require(_0xcb26('0x4'));var BPromise=require(_0xcb26('0x5'));var rp=require(_0xcb26('0x6'));var fs=require('fs');var path=require(_0xcb26('0x7'));var rimraf=require(_0xcb26('0x8'));var config=require(_0xcb26('0x9'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x376f0c,_0x1d7759){return _0x376f0c[_0xcb26('0xa')](_0xcb26('0xb'),attributes,{'tableName':_0xcb26('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index b2d4307..41179a0 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5f3=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf5f3,0x15f));var _0x3f5f=function(_0x15c6f2,_0x4a7db3){_0x15c6f2=_0x15c6f2-0x0;var _0x32dc53=_0xf5f3[_0x15c6f2];return _0x32dc53;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f5f('0x0'));var BPromise=require(_0x3f5f('0x1'));var rs=require(_0x3f5f('0x2'));var fs=require('fs');var Redis=require(_0x3f5f('0x3'));var db=require(_0x3f5f('0x4'))['db'];var utils=require(_0x3f5f('0x5'));var logger=require(_0x3f5f('0x6'))(_0x3f5f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f5f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5a2d,_0x2a1384,_0x27a4de){return new BPromise(function(_0x116432,_0x35112a){return client['request'](_0x4b5a2d,_0x27a4de)[_0x3f5f('0x9')](function(_0x1b427f){logger[_0x3f5f('0xa')](_0x3f5f('0xb'),_0x2a1384,_0x3f5f('0xc'));logger[_0x3f5f('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2a1384,_0x3f5f('0xc'),JSON[_0x3f5f('0xe')](_0x1b427f));if(_0x1b427f[_0x3f5f('0xf')]){if(_0x1b427f[_0x3f5f('0xf')][_0x3f5f('0x10')]===0x1f4){logger[_0x3f5f('0xf')](_0x3f5f('0xb'),_0x2a1384,_0x1b427f['error'][_0x3f5f('0x11')]);return _0x35112a(_0x1b427f[_0x3f5f('0xf')][_0x3f5f('0x11')]);}logger[_0x3f5f('0xf')](_0x3f5f('0xb'),_0x2a1384,_0x1b427f['error']['message']);return _0x116432(_0x1b427f[_0x3f5f('0xf')][_0x3f5f('0x11')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x2a1384,_0x3f5f('0xc'));_0x116432(_0x1b427f[_0x3f5f('0x12')]['message']);}})['catch'](function(_0x9f5e75){logger[_0x3f5f('0xf')](_0x3f5f('0xb'),_0x2a1384,_0x9f5e75);_0x35112a(_0x9f5e75);});});} \ No newline at end of file +var _0x38a6=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x38a6,0x116));var _0x638a=function(_0x4d7d88,_0x434163){_0x4d7d88=_0x4d7d88-0x0;var _0x25da1e=_0x38a6[_0x4d7d88];return _0x25da1e;};'use strict';var _=require(_0x638a('0x0'));var util=require(_0x638a('0x1'));var moment=require(_0x638a('0x2'));var BPromise=require(_0x638a('0x3'));var rs=require(_0x638a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x638a('0x5'));var logger=require('../../config/logger')(_0x638a('0x6'));var config=require(_0x638a('0x7'));var jayson=require(_0x638a('0x8'));var client=jayson[_0x638a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a3c78,_0x499ad3,_0x59a65a){return new BPromise(function(_0x8b463,_0x49a060){return client[_0x638a('0xa')](_0x2a3c78,_0x59a65a)[_0x638a('0xb')](function(_0x50ae91){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x499ad3,_0x638a('0xc'));logger[_0x638a('0xd')](_0x638a('0xe'),_0x499ad3,_0x638a('0xc'),JSON[_0x638a('0xf')](_0x50ae91));if(_0x50ae91[_0x638a('0x10')]){if(_0x50ae91[_0x638a('0x10')][_0x638a('0x11')]===0x1f4){logger['error'](_0x638a('0x12'),_0x499ad3,_0x50ae91['error'][_0x638a('0x13')]);return _0x49a060(_0x50ae91[_0x638a('0x10')]['message']);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x499ad3,_0x50ae91[_0x638a('0x10')]['message']);return _0x8b463(_0x50ae91[_0x638a('0x10')]['message']);}else{logger[_0x638a('0x14')](_0x638a('0x12'),_0x499ad3,_0x638a('0xc'));_0x8b463(_0x50ae91[_0x638a('0x15')][_0x638a('0x13')]);}})[_0x638a('0x16')](function(_0x1559a9){logger[_0x638a('0x10')](_0x638a('0x12'),_0x499ad3,_0x1559a9);_0x49a060(_0x1559a9);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index d611d15..17c7b06 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa695=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','create','post','addSound','put','/:id','update','destroy','/:id/sounds/:id2','removeSound','exports','multer'];(function(_0x4cfb98,_0xe60dfe){var _0x38b42a=function(_0x53a68d){while(--_0x53a68d){_0x4cfb98['push'](_0x4cfb98['shift']());}};_0x38b42a(++_0xe60dfe);}(_0xa695,0x1df));var _0x5a69=function(_0x390533,_0x414258){_0x390533=_0x390533-0x0;var _0x315f75=_0xa695[_0x390533];return _0x315f75;};'use strict';var multer=require(_0x5a69('0x0'));var util=require('util');var path=require(_0x5a69('0x1'));var timeout=require(_0x5a69('0x2'));var express=require(_0x5a69('0x3'));var router=express[_0x5a69('0x4')]();var fs_extra=require(_0x5a69('0x5'));var auth=require(_0x5a69('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5a69('0x7'));router[_0x5a69('0x8')]('/',auth[_0x5a69('0x9')](),controller[_0x5a69('0xa')]);router[_0x5a69('0x8')]('/:id',auth[_0x5a69('0x9')](),controller[_0x5a69('0xb')]);router[_0x5a69('0x8')](_0x5a69('0xc'),auth['isAuthenticated'](),controller[_0x5a69('0xd')]);router['post']('/',auth[_0x5a69('0x9')](),controller[_0x5a69('0xe')]);router[_0x5a69('0xf')](_0x5a69('0xc'),auth[_0x5a69('0x9')](),controller[_0x5a69('0x10')]);router[_0x5a69('0x11')](_0x5a69('0x12'),auth[_0x5a69('0x9')](),controller[_0x5a69('0x13')]);router['delete']('/:id',auth[_0x5a69('0x9')](),controller[_0x5a69('0x14')]);router['delete'](_0x5a69('0x15'),auth['isAuthenticated'](),controller[_0x5a69('0x16')]);module[_0x5a69('0x17')]=router; \ No newline at end of file +var _0x5f5e=['destroy','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','post','create','addSound','update','delete'];(function(_0x362e54,_0x437b93){var _0x4d36c1=function(_0x162824){while(--_0x162824){_0x362e54['push'](_0x362e54['shift']());}};_0x4d36c1(++_0x437b93);}(_0x5f5e,0x1e4));var _0xe5f5=function(_0xfeadd9,_0x39a3b0){_0xfeadd9=_0xfeadd9-0x0;var _0x26088b=_0x5f5e[_0xfeadd9];return _0x26088b;};'use strict';var multer=require('multer');var util=require(_0xe5f5('0x0'));var path=require('path');var timeout=require(_0xe5f5('0x1'));var express=require(_0xe5f5('0x2'));var router=express['Router']();var fs_extra=require(_0xe5f5('0x3'));var auth=require(_0xe5f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe5f5('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0xe5f5('0x6')]('/',auth[_0xe5f5('0x7')](),controller[_0xe5f5('0x8')]);router[_0xe5f5('0x6')](_0xe5f5('0x9'),auth[_0xe5f5('0x7')](),controller['show']);router[_0xe5f5('0x6')](_0xe5f5('0xa'),auth['isAuthenticated'](),controller['getSounds']);router[_0xe5f5('0xb')]('/',auth[_0xe5f5('0x7')](),controller[_0xe5f5('0xc')]);router[_0xe5f5('0xb')](_0xe5f5('0xa'),auth['isAuthenticated'](),controller[_0xe5f5('0xd')]);router['put'](_0xe5f5('0x9'),auth[_0xe5f5('0x7')](),controller[_0xe5f5('0xe')]);router[_0xe5f5('0xf')](_0xe5f5('0x9'),auth['isAuthenticated'](),controller[_0xe5f5('0x10')]);router['delete'](_0xe5f5('0x11'),auth[_0xe5f5('0x7')](),controller[_0xe5f5('0x12')]);module[_0xe5f5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index fd251b1..a62c70b 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab1c=['mp3','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x2e2720,_0x1ae995){var _0x3f9d2d=function(_0x5067a2){while(--_0x5067a2){_0x2e2720['push'](_0x2e2720['shift']());}};_0x3f9d2d(++_0x1ae995);}(_0xab1c,0x1cb));var _0xcab1=function(_0x23df83,_0x2f87f3){_0x23df83=_0x23df83-0x0;var _0x3203d2=_0xab1c[_0x23df83];return _0x3203d2;};'use strict';var Sequelize=require(_0xcab1('0x0'));module['exports']={'name':{'type':Sequelize[_0xcab1('0x1')],'allowNull':![],'unique':_0xcab1('0x2')},'mode':{'type':Sequelize[_0xcab1('0x3')](_0xcab1('0x4'),_0xcab1('0x5'),_0xcab1('0x6'),_0xcab1('0x7'),_0xcab1('0x8'),_0xcab1('0x9')),'allowNull':!![],'defaultValue':_0xcab1('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xcab1('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcab1('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcab1('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xcab1('0x1')],'allowNull':!![]},'stamp':{'type':_0xcab1('0xa')},'defaultEntry':{'type':Sequelize[_0xcab1('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x788b=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x788b,0x179));var _0xb788=function(_0x28f51f,_0x7e340f){_0x28f51f=_0x28f51f-0x0;var _0x3762e9=_0x788b[_0x28f51f];return _0x3762e9;};'use strict';var Sequelize=require('sequelize');module[_0xb788('0x0')]={'name':{'type':Sequelize[_0xb788('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xb788('0x2')](_0xb788('0x3'),_0xb788('0x4'),_0xb788('0x5'),_0xb788('0x6'),_0xb788('0x7'),_0xb788('0x8')),'allowNull':!![],'defaultValue':_0xb788('0x4')},'directory':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![],'defaultValue':_0xb788('0x9')},'format':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'stamp':{'type':_0xb788('0xa')},'defaultEntry':{'type':Sequelize[_0xb788('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index e7ad43b..40d03cf 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb281=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','destroy','end','error','name','send','index','VoiceMusicOnHold','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','update','body','find','catch','create','transaction','mode','files','directory','join','root','mkdirSync','0777','user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','sequelize','readdirSync','forEach','unlinkSync','ValidationError','message','addSound','Sound','save_name','format','converted_format','server/files/moh','%s.%s','Sequelize','removeSound','findOne','id2','getSounds','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x532710,_0x52195f){var _0x6d7ca=function(_0x56f45d){while(--_0x56f45d){_0x532710['push'](_0x532710['shift']());}};_0x6d7ca(++_0x52195f);}(_0xb281,0xc9));var _0x1b28=function(_0x4c4b81,_0xdcdd0d){_0x4c4b81=_0x4c4b81-0x0;var _0x454b18=_0xb281[_0x4c4b81];return _0x454b18;};'use strict';var emlformat=require(_0x1b28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b28('0x1'));var jsonpatch=require(_0x1b28('0x2'));var rp=require(_0x1b28('0x3'));var moment=require(_0x1b28('0x4'));var BPromise=require(_0x1b28('0x5'));var Mustache=require('mustache');var util=require(_0x1b28('0x6'));var path=require(_0x1b28('0x7'));var sox=require('sox');var csv=require(_0x1b28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b28('0x9'));var _=require(_0x1b28('0xa'));var squel=require(_0x1b28('0xb'));var crypto=require(_0x1b28('0xc'));var jsforce=require(_0x1b28('0xd'));var deskjs=require(_0x1b28('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b28('0xf'));var Papa=require(_0x1b28('0x10'));var Redis=require(_0x1b28('0x11'));var authService=require(_0x1b28('0x12'));var qs=require(_0x1b28('0x13'));var as=require(_0x1b28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b28('0x15'))('api');var utils=require(_0x1b28('0x16'));var config=require(_0x1b28('0x17'));var licenseUtil=require(_0x1b28('0x18'));var db=require(_0x1b28('0x19'))['db'];function respondWithStatusCode(_0x432306,_0x43c6d3){_0x43c6d3=_0x43c6d3||0xcc;return function(_0x4acda2){if(_0x4acda2){return _0x432306[_0x1b28('0x1a')](_0x43c6d3);}return _0x432306[_0x1b28('0x1b')](_0x43c6d3)['end']();};}function respondWithResult(_0x1602a1,_0x385b48){_0x385b48=_0x385b48||0xc8;return function(_0x3038ea){if(_0x3038ea){return _0x1602a1[_0x1b28('0x1b')](_0x385b48)[_0x1b28('0x1c')](_0x3038ea);}};}function respondWithFilteredResult(_0xa4fcd9,_0x31e621){return function(_0x548c3f){if(_0x548c3f){var _0x15611a=typeof _0x31e621[_0x1b28('0x1d')]==='undefined'&&typeof _0x31e621[_0x1b28('0x1e')]===_0x1b28('0x1f');var _0x3cefe1=_0x548c3f[_0x1b28('0x20')];var _0x17659=_0x15611a?0x0:_0x31e621[_0x1b28('0x1d')];var _0x51df1f=_0x15611a?_0x548c3f['count']:_0x31e621[_0x1b28('0x1d')]+_0x31e621['limit'];var _0x576c0c;if(_0x51df1f>=_0x3cefe1){_0x51df1f=_0x3cefe1;_0x576c0c=0xc8;}else{_0x576c0c=0xce;}_0xa4fcd9['status'](_0x576c0c);return _0xa4fcd9[_0x1b28('0x21')](_0x1b28('0x22'),_0x17659+'-'+_0x51df1f+'/'+_0x3cefe1)[_0x1b28('0x1c')](_0x548c3f);}return null;};}function patchUpdates(_0x326bc9){return function(_0x213e01){try{jsonpatch[_0x1b28('0x23')](_0x213e01,_0x326bc9,!![]);}catch(_0x16dd46){return BPromise[_0x1b28('0x24')](_0x16dd46);}return _0x213e01[_0x1b28('0x25')]();};}function saveUpdates(_0x2250fc,_0x28da26){return function(_0x47d4b1){if(_0x47d4b1){return _0x47d4b1['update'](_0x2250fc)[_0x1b28('0x26')](function(_0x1eb66e){return _0x1eb66e;});}return null;};}function removeEntity(_0x420525,_0x232d8e){return function(_0x3a67a4){if(_0x3a67a4){return _0x3a67a4['destroy']()[_0x1b28('0x26')](function(){var _0x42537e=_0x3a67a4[_0x1b28('0x27')]({'plain':!![]});var _0x588a95='MusicOnHolds';return db['UserProfileResource'][_0x1b28('0x28')]({'where':{'type':_0x588a95,'resourceId':_0x42537e['id']}})[_0x1b28('0x26')](function(){return _0x3a67a4;});})[_0x1b28('0x26')](function(){_0x420525[_0x1b28('0x1b')](0xcc)[_0x1b28('0x29')]();});}};}function handleEntityNotFound(_0x58cdd5,_0x1f7eed){return function(_0x527076){if(!_0x527076){_0x58cdd5[_0x1b28('0x1a')](0x194);}return _0x527076;};}function handleError(_0x1b55c3,_0x3d1fee){_0x3d1fee=_0x3d1fee||0x1f4;return function(_0x4fb84d){logger[_0x1b28('0x2a')](_0x4fb84d['stack']);if(_0x4fb84d[_0x1b28('0x2b')]){delete _0x4fb84d['name'];}_0x1b55c3[_0x1b28('0x1b')](_0x3d1fee)[_0x1b28('0x2c')](_0x4fb84d);};}exports[_0x1b28('0x2d')]=function(_0x470b8e,_0x24e137){var _0x523dd7={},_0x46691d={},_0x37bdce={'count':0x0,'rows':[]};var _0x492bb4=_['map'](db[_0x1b28('0x2e')]['rawAttributes'],function(_0x52ad21){return{'name':_0x52ad21['fieldName'],'type':_0x52ad21[_0x1b28('0x2f')][_0x1b28('0x30')]};});_0x46691d['model']=_[_0x1b28('0x31')](_0x492bb4,_0x1b28('0x2b'));_0x46691d[_0x1b28('0x32')]=_[_0x1b28('0x33')](_0x470b8e[_0x1b28('0x32')]);_0x46691d[_0x1b28('0x34')]=_['intersection'](_0x46691d[_0x1b28('0x35')],_0x46691d[_0x1b28('0x32')]);_0x523dd7[_0x1b28('0x36')]=_[_0x1b28('0x37')](_0x46691d[_0x1b28('0x35')],qs[_0x1b28('0x38')](_0x470b8e['query'][_0x1b28('0x38')]));_0x523dd7['attributes']=_0x523dd7[_0x1b28('0x36')][_0x1b28('0x39')]?_0x523dd7['attributes']:_0x46691d[_0x1b28('0x35')];if(!_0x470b8e[_0x1b28('0x32')][_0x1b28('0x3a')](_0x1b28('0x3b'))){_0x523dd7['limit']=qs[_0x1b28('0x1e')](_0x470b8e['query'][_0x1b28('0x1e')]);_0x523dd7['offset']=qs[_0x1b28('0x1d')](_0x470b8e[_0x1b28('0x32')]['offset']);}_0x523dd7['order']=qs['sort'](_0x470b8e[_0x1b28('0x32')][_0x1b28('0x3c')]);delete _0x470b8e[_0x1b28('0x32')][_0x1b28('0x3c')];_0x523dd7[_0x1b28('0x3d')]=qs['filters'](_[_0x1b28('0x3e')](_0x470b8e[_0x1b28('0x32')],_0x46691d['filters']),_0x492bb4);if(_0x470b8e[_0x1b28('0x32')][_0x1b28('0x3f')]){_0x523dd7[_0x1b28('0x3d')]=_[_0x1b28('0x40')](_0x523dd7[_0x1b28('0x3d')],{'$or':_[_0x1b28('0x31')](_0x492bb4,function(_0x328800){if(_0x328800[_0x1b28('0x2f')]!==_0x1b28('0x41')){var _0x134e3c={};_0x134e3c[_0x328800[_0x1b28('0x2b')]]={'$like':'%'+_0x470b8e[_0x1b28('0x32')][_0x1b28('0x3f')]+'%'};return _0x134e3c;}})});}_0x523dd7=_[_0x1b28('0x40')]({},_0x523dd7,_0x470b8e[_0x1b28('0x42')]);var _0x1230a8={'where':_0x523dd7[_0x1b28('0x3d')]};return db[_0x1b28('0x2e')]['count'](_0x1230a8)[_0x1b28('0x26')](function(_0x295376){_0x37bdce[_0x1b28('0x20')]=_0x295376;if(_0x470b8e['query']['includeAll']){_0x523dd7[_0x1b28('0x43')]=[{'all':!![]}];}return db[_0x1b28('0x2e')][_0x1b28('0x44')](_0x523dd7);})[_0x1b28('0x26')](function(_0x4351a1){_0x37bdce[_0x1b28('0x45')]=_0x4351a1;return _0x37bdce;})[_0x1b28('0x26')](respondWithFilteredResult(_0x24e137,_0x523dd7))['catch'](handleError(_0x24e137,null));};exports[_0x1b28('0x46')]=function(_0xebe122,_0x8e6677){var _0x193230={'raw':![],'where':{'id':_0xebe122[_0x1b28('0x47')]['id']}},_0x168c9b={};_0x168c9b['model']=_[_0x1b28('0x33')](db[_0x1b28('0x2e')]['rawAttributes']);_0x168c9b[_0x1b28('0x32')]=_['keys'](_0xebe122[_0x1b28('0x32')]);_0x168c9b[_0x1b28('0x34')]=_[_0x1b28('0x37')](_0x168c9b['model'],_0x168c9b[_0x1b28('0x32')]);_0x193230[_0x1b28('0x36')]=_[_0x1b28('0x37')](_0x168c9b[_0x1b28('0x35')],qs[_0x1b28('0x38')](_0xebe122['query']['fields']));_0x193230[_0x1b28('0x36')]=_0x193230['attributes'][_0x1b28('0x39')]?_0x193230[_0x1b28('0x36')]:_0x168c9b['model'];if(_0xebe122['query']['includeAll']){_0x193230[_0x1b28('0x43')]=[{'all':!![]}];}_0x193230=_[_0x1b28('0x40')]({},_0x193230,_0xebe122[_0x1b28('0x42')]);return db[_0x1b28('0x2e')]['find'](_0x193230)[_0x1b28('0x26')](handleEntityNotFound(_0x8e6677,null))[_0x1b28('0x26')](respondWithResult(_0x8e6677,null))['catch'](handleError(_0x8e6677,null));};exports[_0x1b28('0x48')]=function(_0x551dee,_0x405423){if(_0x551dee[_0x1b28('0x49')]['id']){delete _0x551dee[_0x1b28('0x49')]['id'];}return db[_0x1b28('0x2e')][_0x1b28('0x4a')]({'where':{'id':_0x551dee[_0x1b28('0x47')]['id']}})[_0x1b28('0x26')](handleEntityNotFound(_0x405423,null))['then'](saveUpdates(_0x551dee[_0x1b28('0x49')],null))[_0x1b28('0x26')](respondWithResult(_0x405423,null))[_0x1b28('0x4b')](handleError(_0x405423,null));};exports[_0x1b28('0x4c')]=function(_0x2aedf6,_0xb0fb70,_0x22b9c1){return db['sequelize'][_0x1b28('0x4d')](function(_0x345f6d){if(_0x2aedf6[_0x1b28('0x49')][_0x1b28('0x4e')]===_0x1b28('0x4f')){_0x2aedf6[_0x1b28('0x49')][_0x1b28('0x50')]=path[_0x1b28('0x51')](config[_0x1b28('0x52')],'server/files/moh',_0x2aedf6[_0x1b28('0x49')][_0x1b28('0x2b')]);}return db[_0x1b28('0x2e')][_0x1b28('0x4c')](_0x2aedf6[_0x1b28('0x49')],{'transaction':_0x345f6d})[_0x1b28('0x26')](function(_0x375d87){if(_0x2aedf6[_0x1b28('0x49')][_0x1b28('0x4e')]===_0x1b28('0x4f')){fs[_0x1b28('0x53')](_0x375d87[_0x1b28('0x50')],parseInt(_0x1b28('0x54'),0x8));}var _0x15ede=_0x2aedf6[_0x1b28('0x55')][_0x1b28('0x27')]({'plain':!![]});if(!_0x15ede)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15ede[_0x1b28('0x56')]===_0x1b28('0x55')){var _0x553d33=_0x375d87[_0x1b28('0x27')]({'plain':!![]});return db[_0x1b28('0x57')][_0x1b28('0x4a')]({'where':{'name':_0x1b28('0x58'),'userProfileId':_0x15ede[_0x1b28('0x59')]},'raw':!![]})[_0x1b28('0x26')](function(_0x20ec64){if(_0x20ec64&&_0x20ec64[_0x1b28('0x5a')]===0x0){return db[_0x1b28('0x5b')][_0x1b28('0x4c')]({'name':_0x553d33[_0x1b28('0x2b')],'resourceId':_0x553d33['id'],'type':_0x20ec64['name'],'sectionId':_0x20ec64['id']},{})[_0x1b28('0x26')](function(){return _0x375d87;});}else{return _0x375d87;}})[_0x1b28('0x4b')](function(_0x353fa1){logger[_0x1b28('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353fa1);});}return _0x375d87;});})[_0x1b28('0x26')](respondWithResult(_0xb0fb70,0xc9))[_0x1b28('0x4b')](handleError(_0xb0fb70,null));};exports[_0x1b28('0x28')]=function(_0x28862d,_0x3f2a4a,_0x556582){var _0x2bcbcf;return db['VoiceMusicOnHold'][_0x1b28('0x4a')]({'where':{'id':_0x28862d['params']['id']}})[_0x1b28('0x26')](function(_0x4a39aa){if(_0x4a39aa){return db[_0x1b28('0x5c')]['transaction'](function(_0x174d24){return _0x4a39aa[_0x1b28('0x28')]({'transaction':_0x174d24,'raw':!![]})[_0x1b28('0x26')](function(_0x2f3ce8){if(_0x2f3ce8['directory']){fs[_0x1b28('0x5d')](_0x2f3ce8[_0x1b28('0x50')])[_0x1b28('0x5e')](function(_0x27f95e){fs[_0x1b28('0x5f')](path[_0x1b28('0x51')](_0x2f3ce8[_0x1b28('0x50')],_0x27f95e));});fs['rmdirSync'](_0x2f3ce8[_0x1b28('0x50')]);}return _0x2f3ce8;});})[_0x1b28('0x4b')](function(_0x40b0e1){throw new db['Sequelize'][(_0x1b28('0x60'))](_0x40b0e1[_0x1b28('0x61')]);});}})[_0x1b28('0x26')](handleEntityNotFound(_0x3f2a4a,null))[_0x1b28('0x26')](removeEntity(_0x3f2a4a,null))[_0x1b28('0x4b')](handleError(_0x3f2a4a,null));};exports[_0x1b28('0x62')]=function(_0x34fe08,_0x10a35a,_0x666cd){return db[_0x1b28('0x5c')][_0x1b28('0x4d')](function(_0x5a0a4d){var _0x29105c;return db[_0x1b28('0x2e')][_0x1b28('0x4a')]({'where':{'id':_0x34fe08[_0x1b28('0x47')]['id']}})['then'](function(_0xca3e8f){if(_0xca3e8f){_0x29105c=_0xca3e8f;return _0xca3e8f['addSound'](_0x34fe08[_0x1b28('0x49')]['id'],{'transaction':_0x5a0a4d});}})[_0x1b28('0x26')](function(_0x352307){if(_0x352307){return db[_0x1b28('0x63')]['findOne']({'where':{'id':_0x34fe08[_0x1b28('0x49')]['id']},'attributes':['id',_0x1b28('0x2b'),_0x1b28('0x64'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x5cb834){if(_0x5cb834){var _0x4edecb=path[_0x1b28('0x51')](config[_0x1b28('0x52')],'server/files/sounds/converted',util[_0x1b28('0x65')]('%s.%s',path['basename'](_0x5cb834[_0x1b28('0x64')],path['extname'](_0x5cb834['save_name'])),_0x5cb834[_0x1b28('0x66')]));var _0x200fb8=path[_0x1b28('0x51')](config[_0x1b28('0x52')],_0x1b28('0x67'),_0x29105c[_0x1b28('0x2b')],util[_0x1b28('0x65')](_0x1b28('0x68'),_0x5cb834['name'],_0x5cb834[_0x1b28('0x66')]));fs['symlinkSync'](_0x4edecb,_0x200fb8);return _0x5cb834;}})[_0x1b28('0x4b')](function(_0x2246ba){throw new db[(_0x1b28('0x69'))][(_0x1b28('0x60'))](_0x2246ba[_0x1b28('0x61')]);});})[_0x1b28('0x26')](handleEntityNotFound(_0x10a35a,null))['then'](respondWithResult(_0x10a35a,0xc9))[_0x1b28('0x4b')](handleError(_0x10a35a,null));};exports[_0x1b28('0x6a')]=function(_0x38f203,_0x36880c,_0x580eae){return db[_0x1b28('0x5c')][_0x1b28('0x4d')](function(_0x2b83e2){var _0x1b8e6a;return db['VoiceMusicOnHold'][_0x1b28('0x6b')]({'where':{'id':_0x38f203['params']['id']}})['then'](handleEntityNotFound(_0x36880c,null))[_0x1b28('0x26')](function(_0x1f1679){if(_0x1f1679){_0x1b8e6a=_0x1f1679;return _0x1f1679[_0x1b28('0x6a')](_0x38f203[_0x1b28('0x47')][_0x1b28('0x6c')]);}})[_0x1b28('0x26')](function(_0x54d3cb){if(_0x54d3cb){return db[_0x1b28('0x63')][_0x1b28('0x6b')]({'where':{'id':_0x38f203[_0x1b28('0x47')][_0x1b28('0x6c')]},'attributes':['id',_0x1b28('0x2b'),_0x1b28('0x64'),_0x1b28('0x66'),'createdAt'],'raw':!![]});}})[_0x1b28('0x26')](function(_0x3c2fa1){if(_0x3c2fa1){fs[_0x1b28('0x5f')](path[_0x1b28('0x51')](_0x1b8e6a[_0x1b28('0x50')],util['format'](_0x1b28('0x68'),_0x3c2fa1['name'],_0x3c2fa1[_0x1b28('0x66')])));return _0x3c2fa1;}})['catch'](function(_0x2ab880){throw new db['Sequelize'][(_0x1b28('0x60'))](_0x2ab880[_0x1b28('0x61')]);});})['then'](handleEntityNotFound(_0x36880c,null))[_0x1b28('0x26')](respondWithStatusCode(_0x36880c,0xcc))['catch'](handleError(_0x36880c,null));};exports[_0x1b28('0x6d')]=function(_0x20a7a8,_0x1c2b92,_0x27b545){var _0xd6ecab={};var _0x356b91={};var _0xddcf97;var _0x1ec85d;return db[_0x1b28('0x2e')][_0x1b28('0x6b')]({'where':{'id':_0x20a7a8[_0x1b28('0x47')]['id']}})[_0x1b28('0x26')](handleEntityNotFound(_0x1c2b92,null))[_0x1b28('0x26')](function(_0x402074){if(_0x402074){_0xddcf97=_0x402074;_0x356b91['model']=_['keys'](db[_0x1b28('0x63')]['rawAttributes']);_0x356b91[_0x1b28('0x32')]=_[_0x1b28('0x33')](_0x20a7a8[_0x1b28('0x32')]);_0x356b91['filters']=_[_0x1b28('0x37')](_0x356b91[_0x1b28('0x35')],_0x356b91[_0x1b28('0x32')]);_0xd6ecab[_0x1b28('0x36')]=_[_0x1b28('0x37')](_0x356b91[_0x1b28('0x35')],qs['fields'](_0x20a7a8[_0x1b28('0x32')]['fields']));_0xd6ecab[_0x1b28('0x36')]=_0xd6ecab[_0x1b28('0x36')]['length']?_0xd6ecab[_0x1b28('0x36')]:_0x356b91['model'];_0xd6ecab[_0x1b28('0x6e')]=qs[_0x1b28('0x3c')](_0x20a7a8[_0x1b28('0x32')][_0x1b28('0x3c')]);_0xd6ecab[_0x1b28('0x3d')]=qs[_0x1b28('0x34')](_['pick'](_0x20a7a8[_0x1b28('0x32')],_0x356b91[_0x1b28('0x34')]));if(_0x20a7a8[_0x1b28('0x32')][_0x1b28('0x3f')]){_0xd6ecab[_0x1b28('0x3d')]=_[_0x1b28('0x40')](_0xd6ecab[_0x1b28('0x3d')],{'$or':_[_0x1b28('0x31')](_0xd6ecab['attributes'],function(_0x2c7630){var _0x4282b5={};_0x4282b5[_0x2c7630]={'$like':'%'+_0x20a7a8[_0x1b28('0x32')][_0x1b28('0x3f')]+'%'};return _0x4282b5;})});}_0xd6ecab=_[_0x1b28('0x40')]({},_0xd6ecab,_0x20a7a8[_0x1b28('0x42')]);return _0xddcf97[_0x1b28('0x6d')](_0xd6ecab);}})[_0x1b28('0x26')](function(_0x35196b){if(_0x35196b){_0x1ec85d=_0x35196b[_0x1b28('0x39')];if(!_0x20a7a8[_0x1b28('0x32')][_0x1b28('0x3a')](_0x1b28('0x3b'))){_0xd6ecab[_0x1b28('0x1e')]=qs['limit'](_0x20a7a8[_0x1b28('0x32')][_0x1b28('0x1e')]);_0xd6ecab[_0x1b28('0x1d')]=qs[_0x1b28('0x1d')](_0x20a7a8[_0x1b28('0x32')]['offset']);}return _0xddcf97[_0x1b28('0x6d')](_0xd6ecab);}})[_0x1b28('0x26')](function(_0x324d56){if(_0x324d56){return _0x324d56?{'count':_0x1ec85d,'rows':_0x324d56}:null;}})[_0x1b28('0x26')](respondWithResult(_0x1c2b92,null))[_0x1b28('0x4b')](handleError(_0x1c2b92,null));}; \ No newline at end of file +var _0x7a0b=['sequelize','transaction','directory','join','root','server/files/moh','mode','files','mkdirSync','0777','role','user','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','unlinkSync','getSounds','order','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','model','keys','find','body'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a0b,0x114));var _0xb7a0=function(_0x2b7fb8,_0x55d77e){_0x2b7fb8=_0x2b7fb8-0x0;var _0x419e92=_0x7a0b[_0x2b7fb8];return _0x419e92;};'use strict';var emlformat=require(_0xb7a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7a0('0x1'));var jsonpatch=require(_0xb7a0('0x2'));var rp=require(_0xb7a0('0x3'));var moment=require(_0xb7a0('0x4'));var BPromise=require(_0xb7a0('0x5'));var Mustache=require(_0xb7a0('0x6'));var util=require(_0xb7a0('0x7'));var path=require(_0xb7a0('0x8'));var sox=require(_0xb7a0('0x9'));var csv=require(_0xb7a0('0xa'));var ejs=require(_0xb7a0('0xb'));var fs=require('fs');var fs_extra=require(_0xb7a0('0xc'));var _=require('lodash');var squel=require(_0xb7a0('0xd'));var crypto=require(_0xb7a0('0xe'));var jsforce=require(_0xb7a0('0xf'));var deskjs=require(_0xb7a0('0x10'));var toCsv=require(_0xb7a0('0xa'));var querystring=require(_0xb7a0('0x11'));var Papa=require(_0xb7a0('0x12'));var Redis=require(_0xb7a0('0x13'));var authService=require(_0xb7a0('0x14'));var qs=require(_0xb7a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7a0('0x16'));var logger=require('../../config/logger')(_0xb7a0('0x17'));var utils=require(_0xb7a0('0x18'));var config=require(_0xb7a0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7a0('0x1a'))['db'];function respondWithStatusCode(_0x29af82,_0x1c74a5){_0x1c74a5=_0x1c74a5||0xcc;return function(_0x3ec6da){if(_0x3ec6da){return _0x29af82[_0xb7a0('0x1b')](_0x1c74a5);}return _0x29af82[_0xb7a0('0x1c')](_0x1c74a5)[_0xb7a0('0x1d')]();};}function respondWithResult(_0x4381e0,_0x154299){_0x154299=_0x154299||0xc8;return function(_0x1e4120){if(_0x1e4120){return _0x4381e0[_0xb7a0('0x1c')](_0x154299)[_0xb7a0('0x1e')](_0x1e4120);}};}function respondWithFilteredResult(_0xc704c3,_0x599796){return function(_0x5e617b){if(_0x5e617b){var _0x172355=typeof _0x599796[_0xb7a0('0x1f')]===_0xb7a0('0x20')&&typeof _0x599796['limit']==='undefined';var _0x30cc1b=_0x5e617b['count'];var _0x2f341c=_0x172355?0x0:_0x599796[_0xb7a0('0x1f')];var _0x485ed9=_0x172355?_0x5e617b[_0xb7a0('0x21')]:_0x599796[_0xb7a0('0x1f')]+_0x599796[_0xb7a0('0x22')];var _0x15feda;if(_0x485ed9>=_0x30cc1b){_0x485ed9=_0x30cc1b;_0x15feda=0xc8;}else{_0x15feda=0xce;}_0xc704c3['status'](_0x15feda);return _0xc704c3[_0xb7a0('0x23')](_0xb7a0('0x24'),_0x2f341c+'-'+_0x485ed9+'/'+_0x30cc1b)[_0xb7a0('0x1e')](_0x5e617b);}return null;};}function patchUpdates(_0x2a0bac){return function(_0x201133){try{jsonpatch[_0xb7a0('0x25')](_0x201133,_0x2a0bac,!![]);}catch(_0x269bc1){return BPromise[_0xb7a0('0x26')](_0x269bc1);}return _0x201133[_0xb7a0('0x27')]();};}function saveUpdates(_0x325315,_0x470bd4){return function(_0x403de9){if(_0x403de9){return _0x403de9[_0xb7a0('0x28')](_0x325315)[_0xb7a0('0x29')](function(_0x3331c3){return _0x3331c3;});}return null;};}function removeEntity(_0x39b8ac,_0x1c735c){return function(_0x16f13d){if(_0x16f13d){return _0x16f13d[_0xb7a0('0x2a')]()[_0xb7a0('0x29')](function(){var _0x5348ef=_0x16f13d[_0xb7a0('0x2b')]({'plain':!![]});var _0x2ba8c7='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ba8c7,'resourceId':_0x5348ef['id']}})['then'](function(){return _0x16f13d;});})[_0xb7a0('0x29')](function(){_0x39b8ac[_0xb7a0('0x1c')](0xcc)[_0xb7a0('0x1d')]();});}};}function handleEntityNotFound(_0x4484ec,_0xd9b8c8){return function(_0x39492b){if(!_0x39492b){_0x4484ec['sendStatus'](0x194);}return _0x39492b;};}function handleError(_0x10e0ba,_0x5bac11){_0x5bac11=_0x5bac11||0x1f4;return function(_0x271598){logger[_0xb7a0('0x2c')](_0x271598[_0xb7a0('0x2d')]);if(_0x271598[_0xb7a0('0x2e')]){delete _0x271598['name'];}_0x10e0ba[_0xb7a0('0x1c')](_0x5bac11)[_0xb7a0('0x2f')](_0x271598);};}exports['index']=function(_0x15736b,_0x167d08){var _0x2b3780={},_0x355906={},_0x56cb6e={'count':0x0,'rows':[]};var _0x1800f9=_[_0xb7a0('0x30')](db[_0xb7a0('0x31')][_0xb7a0('0x32')],function(_0x53a05c){return{'name':_0x53a05c['fieldName'],'type':_0x53a05c[_0xb7a0('0x33')]['key']};});_0x355906['model']=_[_0xb7a0('0x30')](_0x1800f9,_0xb7a0('0x2e'));_0x355906['query']=_['keys'](_0x15736b[_0xb7a0('0x34')]);_0x355906[_0xb7a0('0x35')]=_[_0xb7a0('0x36')](_0x355906['model'],_0x355906[_0xb7a0('0x34')]);_0x2b3780['attributes']=_[_0xb7a0('0x36')](_0x355906['model'],qs['fields'](_0x15736b['query'][_0xb7a0('0x37')]));_0x2b3780[_0xb7a0('0x38')]=_0x2b3780[_0xb7a0('0x38')][_0xb7a0('0x39')]?_0x2b3780['attributes']:_0x355906['model'];if(!_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3a')](_0xb7a0('0x3b'))){_0x2b3780['limit']=qs[_0xb7a0('0x22')](_0x15736b[_0xb7a0('0x34')]['limit']);_0x2b3780[_0xb7a0('0x1f')]=qs[_0xb7a0('0x1f')](_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x1f')]);}_0x2b3780['order']=qs[_0xb7a0('0x3c')](_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3c')]);delete _0x15736b['query']['sort'];_0x2b3780[_0xb7a0('0x3d')]=qs[_0xb7a0('0x35')](_[_0xb7a0('0x3e')](_0x15736b[_0xb7a0('0x34')],_0x355906[_0xb7a0('0x35')]),_0x1800f9);if(_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3f')]){_0x2b3780[_0xb7a0('0x3d')]=_[_0xb7a0('0x40')](_0x2b3780[_0xb7a0('0x3d')],{'$or':_['map'](_0x1800f9,function(_0x4484df){if(_0x4484df[_0xb7a0('0x33')]!==_0xb7a0('0x41')){var _0xc5bcf4={};_0xc5bcf4[_0x4484df[_0xb7a0('0x2e')]]={'$like':'%'+_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3f')]+'%'};return _0xc5bcf4;}})});}_0x2b3780=_['merge']({},_0x2b3780,_0x15736b[_0xb7a0('0x42')]);var _0x68cdfa={'where':_0x2b3780[_0xb7a0('0x3d')]};return db['VoiceMusicOnHold']['count'](_0x68cdfa)[_0xb7a0('0x29')](function(_0x146d5c){_0x56cb6e[_0xb7a0('0x21')]=_0x146d5c;if(_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x43')]){_0x2b3780[_0xb7a0('0x44')]=[{'all':!![]}];}return db[_0xb7a0('0x31')][_0xb7a0('0x45')](_0x2b3780);})[_0xb7a0('0x29')](function(_0x3f16d4){_0x56cb6e[_0xb7a0('0x46')]=_0x3f16d4;return _0x56cb6e;})[_0xb7a0('0x29')](respondWithFilteredResult(_0x167d08,_0x2b3780))[_0xb7a0('0x47')](handleError(_0x167d08,null));};exports[_0xb7a0('0x48')]=function(_0x38f1b6,_0x3aa724){var _0x1ef321={'raw':![],'where':{'id':_0x38f1b6[_0xb7a0('0x49')]['id']}},_0x13ddae={};_0x13ddae[_0xb7a0('0x4a')]=_[_0xb7a0('0x4b')](db['VoiceMusicOnHold']['rawAttributes']);_0x13ddae[_0xb7a0('0x34')]=_[_0xb7a0('0x4b')](_0x38f1b6[_0xb7a0('0x34')]);_0x13ddae[_0xb7a0('0x35')]=_['intersection'](_0x13ddae[_0xb7a0('0x4a')],_0x13ddae[_0xb7a0('0x34')]);_0x1ef321[_0xb7a0('0x38')]=_['intersection'](_0x13ddae[_0xb7a0('0x4a')],qs[_0xb7a0('0x37')](_0x38f1b6[_0xb7a0('0x34')][_0xb7a0('0x37')]));_0x1ef321['attributes']=_0x1ef321['attributes'][_0xb7a0('0x39')]?_0x1ef321[_0xb7a0('0x38')]:_0x13ddae['model'];if(_0x38f1b6['query']['includeAll']){_0x1ef321[_0xb7a0('0x44')]=[{'all':!![]}];}_0x1ef321=_[_0xb7a0('0x40')]({},_0x1ef321,_0x38f1b6[_0xb7a0('0x42')]);return db['VoiceMusicOnHold'][_0xb7a0('0x4c')](_0x1ef321)[_0xb7a0('0x29')](handleEntityNotFound(_0x3aa724,null))[_0xb7a0('0x29')](respondWithResult(_0x3aa724,null))[_0xb7a0('0x47')](handleError(_0x3aa724,null));};exports[_0xb7a0('0x28')]=function(_0x2dbee5,_0x12d44e){if(_0x2dbee5[_0xb7a0('0x4d')]['id']){delete _0x2dbee5[_0xb7a0('0x4d')]['id'];}return db[_0xb7a0('0x31')][_0xb7a0('0x4c')]({'where':{'id':_0x2dbee5[_0xb7a0('0x49')]['id']}})[_0xb7a0('0x29')](handleEntityNotFound(_0x12d44e,null))[_0xb7a0('0x29')](saveUpdates(_0x2dbee5[_0xb7a0('0x4d')],null))[_0xb7a0('0x29')](respondWithResult(_0x12d44e,null))[_0xb7a0('0x47')](handleError(_0x12d44e,null));};exports['create']=function(_0x14b802,_0x1afc76,_0x42ef4e){return db[_0xb7a0('0x4e')][_0xb7a0('0x4f')](function(_0x4e2d32){if(_0x14b802[_0xb7a0('0x4d')]['mode']==='files'){_0x14b802[_0xb7a0('0x4d')][_0xb7a0('0x50')]=path[_0xb7a0('0x51')](config[_0xb7a0('0x52')],_0xb7a0('0x53'),_0x14b802['body'][_0xb7a0('0x2e')]);}return db[_0xb7a0('0x31')]['create'](_0x14b802[_0xb7a0('0x4d')],{'transaction':_0x4e2d32})['then'](function(_0x162107){if(_0x14b802[_0xb7a0('0x4d')][_0xb7a0('0x54')]===_0xb7a0('0x55')){fs[_0xb7a0('0x56')](_0x162107[_0xb7a0('0x50')],parseInt(_0xb7a0('0x57'),0x8));}var _0x21a7fe=_0x14b802['user'][_0xb7a0('0x2b')]({'plain':!![]});if(!_0x21a7fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21a7fe[_0xb7a0('0x58')]===_0xb7a0('0x59')){var _0x2eba90=_0x162107[_0xb7a0('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0xb7a0('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x21a7fe[_0xb7a0('0x5a')]},'raw':!![]})[_0xb7a0('0x29')](function(_0x3eb2ff){if(_0x3eb2ff&&_0x3eb2ff[_0xb7a0('0x5b')]===0x0){return db[_0xb7a0('0x5c')][_0xb7a0('0x5d')]({'name':_0x2eba90['name'],'resourceId':_0x2eba90['id'],'type':_0x3eb2ff['name'],'sectionId':_0x3eb2ff['id']},{})[_0xb7a0('0x29')](function(){return _0x162107;});}else{return _0x162107;}})[_0xb7a0('0x47')](function(_0x1c8e26){logger['error'](_0xb7a0('0x5e'),_0x1c8e26);});}return _0x162107;});})[_0xb7a0('0x29')](respondWithResult(_0x1afc76,0xc9))[_0xb7a0('0x47')](handleError(_0x1afc76,null));};exports['destroy']=function(_0x33d59d,_0x1a81a5,_0x5bdffa){var _0x476c04;return db[_0xb7a0('0x31')][_0xb7a0('0x4c')]({'where':{'id':_0x33d59d[_0xb7a0('0x49')]['id']}})['then'](function(_0x48b0ba){if(_0x48b0ba){return db[_0xb7a0('0x4e')]['transaction'](function(_0x826e07){return _0x48b0ba[_0xb7a0('0x2a')]({'transaction':_0x826e07,'raw':!![]})[_0xb7a0('0x29')](function(_0x2d8355){if(_0x2d8355['directory']){fs[_0xb7a0('0x5f')](_0x2d8355[_0xb7a0('0x50')])[_0xb7a0('0x60')](function(_0x39785d){fs['unlinkSync'](path[_0xb7a0('0x51')](_0x2d8355[_0xb7a0('0x50')],_0x39785d));});fs[_0xb7a0('0x61')](_0x2d8355[_0xb7a0('0x50')]);}return _0x2d8355;});})[_0xb7a0('0x47')](function(_0x3ecd8b){throw new db[(_0xb7a0('0x62'))][(_0xb7a0('0x63'))](_0x3ecd8b[_0xb7a0('0x64')]);});}})['then'](handleEntityNotFound(_0x1a81a5,null))[_0xb7a0('0x29')](removeEntity(_0x1a81a5,null))[_0xb7a0('0x47')](handleError(_0x1a81a5,null));};exports[_0xb7a0('0x65')]=function(_0x58c96b,_0x1937d3,_0x4db5e6){return db[_0xb7a0('0x4e')][_0xb7a0('0x4f')](function(_0x42a2f6){var _0x102083;return db[_0xb7a0('0x31')][_0xb7a0('0x4c')]({'where':{'id':_0x58c96b[_0xb7a0('0x49')]['id']}})[_0xb7a0('0x29')](function(_0x14d031){if(_0x14d031){_0x102083=_0x14d031;return _0x14d031['addSound'](_0x58c96b['body']['id'],{'transaction':_0x42a2f6});}})[_0xb7a0('0x29')](function(_0xe3896c){if(_0xe3896c){return db[_0xb7a0('0x66')][_0xb7a0('0x67')]({'where':{'id':_0x58c96b['body']['id']},'attributes':['id',_0xb7a0('0x2e'),_0xb7a0('0x68'),_0xb7a0('0x69'),_0xb7a0('0x6a')],'raw':!![]});}})[_0xb7a0('0x29')](function(_0x38d1b0){if(_0x38d1b0){var _0x5beeb3=path[_0xb7a0('0x51')](config[_0xb7a0('0x52')],_0xb7a0('0x6b'),util[_0xb7a0('0x6c')](_0xb7a0('0x6d'),path[_0xb7a0('0x6e')](_0x38d1b0[_0xb7a0('0x68')],path[_0xb7a0('0x6f')](_0x38d1b0['save_name'])),_0x38d1b0[_0xb7a0('0x69')]));var _0x1706ff=path[_0xb7a0('0x51')](config[_0xb7a0('0x52')],'server/files/moh',_0x102083[_0xb7a0('0x2e')],util['format'](_0xb7a0('0x6d'),_0x38d1b0[_0xb7a0('0x2e')],_0x38d1b0['converted_format']));fs[_0xb7a0('0x70')](_0x5beeb3,_0x1706ff);return _0x38d1b0;}})[_0xb7a0('0x47')](function(_0x211c6d){throw new db[(_0xb7a0('0x62'))][(_0xb7a0('0x63'))](_0x211c6d[_0xb7a0('0x64')]);});})[_0xb7a0('0x29')](handleEntityNotFound(_0x1937d3,null))[_0xb7a0('0x29')](respondWithResult(_0x1937d3,0xc9))[_0xb7a0('0x47')](handleError(_0x1937d3,null));};exports['removeSound']=function(_0x591a27,_0xb31e98,_0x3370ed){return db['sequelize'][_0xb7a0('0x4f')](function(_0x6b17b1){var _0x218021;return db[_0xb7a0('0x31')]['findOne']({'where':{'id':_0x591a27['params']['id']}})['then'](handleEntityNotFound(_0xb31e98,null))['then'](function(_0x3ab685){if(_0x3ab685){_0x218021=_0x3ab685;return _0x3ab685[_0xb7a0('0x71')](_0x591a27[_0xb7a0('0x49')][_0xb7a0('0x72')]);}})['then'](function(_0x443a78){if(_0x443a78){return db[_0xb7a0('0x66')][_0xb7a0('0x67')]({'where':{'id':_0x591a27[_0xb7a0('0x49')][_0xb7a0('0x72')]},'attributes':['id',_0xb7a0('0x2e'),_0xb7a0('0x68'),_0xb7a0('0x69'),_0xb7a0('0x6a')],'raw':!![]});}})[_0xb7a0('0x29')](function(_0x5604ec){if(_0x5604ec){fs[_0xb7a0('0x73')](path[_0xb7a0('0x51')](_0x218021[_0xb7a0('0x50')],util[_0xb7a0('0x6c')]('%s.%s',_0x5604ec[_0xb7a0('0x2e')],_0x5604ec[_0xb7a0('0x69')])));return _0x5604ec;}})['catch'](function(_0x2ebe40){throw new db[(_0xb7a0('0x62'))][(_0xb7a0('0x63'))](_0x2ebe40[_0xb7a0('0x64')]);});})[_0xb7a0('0x29')](handleEntityNotFound(_0xb31e98,null))[_0xb7a0('0x29')](respondWithStatusCode(_0xb31e98,0xcc))['catch'](handleError(_0xb31e98,null));};exports[_0xb7a0('0x74')]=function(_0x4630f3,_0x316e85,_0x35db89){var _0x249c34={};var _0x192125={};var _0x2c9335;var _0x7c1f86;return db[_0xb7a0('0x31')][_0xb7a0('0x67')]({'where':{'id':_0x4630f3[_0xb7a0('0x49')]['id']}})[_0xb7a0('0x29')](handleEntityNotFound(_0x316e85,null))['then'](function(_0x458bbb){if(_0x458bbb){_0x2c9335=_0x458bbb;_0x192125[_0xb7a0('0x4a')]=_[_0xb7a0('0x4b')](db[_0xb7a0('0x66')]['rawAttributes']);_0x192125[_0xb7a0('0x34')]=_['keys'](_0x4630f3[_0xb7a0('0x34')]);_0x192125[_0xb7a0('0x35')]=_[_0xb7a0('0x36')](_0x192125[_0xb7a0('0x4a')],_0x192125[_0xb7a0('0x34')]);_0x249c34['attributes']=_[_0xb7a0('0x36')](_0x192125['model'],qs[_0xb7a0('0x37')](_0x4630f3[_0xb7a0('0x34')]['fields']));_0x249c34[_0xb7a0('0x38')]=_0x249c34[_0xb7a0('0x38')][_0xb7a0('0x39')]?_0x249c34[_0xb7a0('0x38')]:_0x192125[_0xb7a0('0x4a')];_0x249c34[_0xb7a0('0x75')]=qs[_0xb7a0('0x3c')](_0x4630f3[_0xb7a0('0x34')]['sort']);_0x249c34[_0xb7a0('0x3d')]=qs[_0xb7a0('0x35')](_['pick'](_0x4630f3['query'],_0x192125['filters']));if(_0x4630f3[_0xb7a0('0x34')][_0xb7a0('0x3f')]){_0x249c34[_0xb7a0('0x3d')]=_[_0xb7a0('0x40')](_0x249c34[_0xb7a0('0x3d')],{'$or':_[_0xb7a0('0x30')](_0x249c34[_0xb7a0('0x38')],function(_0x2ae505){var _0x3094bc={};_0x3094bc[_0x2ae505]={'$like':'%'+_0x4630f3['query'][_0xb7a0('0x3f')]+'%'};return _0x3094bc;})});}_0x249c34=_[_0xb7a0('0x40')]({},_0x249c34,_0x4630f3[_0xb7a0('0x42')]);return _0x2c9335[_0xb7a0('0x74')](_0x249c34);}})[_0xb7a0('0x29')](function(_0x91a052){if(_0x91a052){_0x7c1f86=_0x91a052['length'];if(!_0x4630f3[_0xb7a0('0x34')][_0xb7a0('0x3a')]('nolimit')){_0x249c34[_0xb7a0('0x22')]=qs['limit'](_0x4630f3[_0xb7a0('0x34')]['limit']);_0x249c34[_0xb7a0('0x1f')]=qs[_0xb7a0('0x1f')](_0x4630f3['query'][_0xb7a0('0x1f')]);}return _0x2c9335[_0xb7a0('0x74')](_0x249c34);}})['then'](function(_0x1471f2){if(_0x1471f2){return _0x1471f2?{'count':_0x7c1f86,'rows':_0x1471f2}:null;}})['then'](respondWithResult(_0x316e85,null))[_0xb7a0('0x47')](handleError(_0x316e85,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index d473102..358e764 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f74=['path','rimraf','../../config/environment','exports','voice_musiconhold','lodash','util','bluebird','request-promise'];(function(_0xf1f2e0,_0x37c415){var _0x991373=function(_0x5baf7f){while(--_0x5baf7f){_0xf1f2e0['push'](_0xf1f2e0['shift']());}};_0x991373(++_0x37c415);}(_0x5f74,0x17f));var _0x45f7=function(_0x599cc,_0x87ba60){_0x599cc=_0x599cc-0x0;var _0x4db909=_0x5f74[_0x599cc];return _0x4db909;};'use strict';var _=require(_0x45f7('0x0'));var util=require(_0x45f7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x45f7('0x2'));var rp=require(_0x45f7('0x3'));var fs=require('fs');var path=require(_0x45f7('0x4'));var rimraf=require(_0x45f7('0x5'));var config=require(_0x45f7('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x45f7('0x7')]=function(_0x15c7ac,_0x2147c5){return _0x15c7ac['define']('VoiceMusicOnHold',attributes,{'tableName':_0x45f7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6be=['VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6be,0xab));var _0xea6b=function(_0x4a89fe,_0x4ac07d){_0x4a89fe=_0x4a89fe-0x0;var _0x5ba5d3=_0xa6be[_0x4a89fe];return _0x5ba5d3;};'use strict';var _=require(_0xea6b('0x0'));var util=require(_0xea6b('0x1'));var logger=require(_0xea6b('0x2'))(_0xea6b('0x3'));var moment=require(_0xea6b('0x4'));var BPromise=require(_0xea6b('0x5'));var rp=require(_0xea6b('0x6'));var fs=require('fs');var path=require(_0xea6b('0x7'));var rimraf=require(_0xea6b('0x8'));var config=require(_0xea6b('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xea6b('0xa')]=function(_0x21755c,_0x75b2e){return _0x21755c['define'](_0xea6b('0xb'),attributes,{'tableName':_0xea6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d9292f9..5d74e9e 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2b3ec4,_0x213666){var _0x92d0d3=function(_0x5d0421){while(--_0x5d0421){_0x2b3ec4['push'](_0x2b3ec4['shift']());}};_0x92d0d3(++_0x213666);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x5bf468,_0x21dece){var _0x52bf74=function(_0x38cc9c){while(--_0x38cc9c){_0x5bf468['push'](_0x5bf468['shift']());}};_0x52bf74(++_0x21dece);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a6cd55e..7f96646 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x665c=['index','get','/describe','/:id','isAuthenticated','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x26a2d1,_0x2b87e5){var _0x29ee30=function(_0xd4cad6){while(--_0xd4cad6){_0x26a2d1['push'](_0x26a2d1['shift']());}};_0x29ee30(++_0x2b87e5);}(_0x665c,0x1a9));var _0xc665=function(_0x2bf88a,_0x3b65d4){_0x2bf88a=_0x2bf88a-0x0;var _0x289b72=_0x665c[_0x2bf88a];return _0x289b72;};'use strict';var multer=require(_0xc665('0x0'));var util=require(_0xc665('0x1'));var path=require(_0xc665('0x2'));var timeout=require(_0xc665('0x3'));var express=require(_0xc665('0x4'));var router=express[_0xc665('0x5')]();var fs_extra=require(_0xc665('0x6'));var auth=require(_0xc665('0x7'));var interaction=require(_0xc665('0x8'));var config=require(_0xc665('0x9'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc665('0xa')]);router[_0xc665('0xb')](_0xc665('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc665('0xb')](_0xc665('0xd'),auth[_0xc665('0xe')](),controller[_0xc665('0xf')]);router[_0xc665('0xb')](_0xc665('0x10'),auth[_0xc665('0xe')](),controller[_0xc665('0x11')]);router['get'](_0xc665('0x12'),auth['isAuthenticated'](),controller[_0xc665('0x13')]);router[_0xc665('0x14')]('/',auth[_0xc665('0xe')](),controller[_0xc665('0x15')]);router[_0xc665('0x14')](_0xc665('0x10'),auth[_0xc665('0xe')](),controller['addAgents']);router[_0xc665('0x14')](_0xc665('0x12'),auth[_0xc665('0xe')](),controller['addTeams']);router[_0xc665('0x16')](_0xc665('0xd'),auth[_0xc665('0xe')](),controller[_0xc665('0x17')]);router[_0xc665('0x18')](_0xc665('0xd'),auth['isAuthenticated'](),controller[_0xc665('0x19')]);router['delete'](_0xc665('0x10'),auth[_0xc665('0xe')](),controller[_0xc665('0x1a')]);router['delete'](_0xc665('0x12'),auth[_0xc665('0xe')](),controller[_0xc665('0x1b')]);module[_0xc665('0x1c')]=router; \ No newline at end of file +var _0xac22=['delete','removeAgents','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac22,0x138));var _0x2ac2=function(_0x858cdd,_0x6232c8){_0x858cdd=_0x858cdd-0x0;var _0xab57d5=_0xac22[_0x858cdd];return _0xab57d5;};'use strict';var multer=require('multer');var util=require(_0x2ac2('0x0'));var path=require(_0x2ac2('0x1'));var timeout=require(_0x2ac2('0x2'));var express=require(_0x2ac2('0x3'));var router=express[_0x2ac2('0x4')]();var fs_extra=require(_0x2ac2('0x5'));var auth=require(_0x2ac2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ac2('0x7'));var controller=require(_0x2ac2('0x8'));router[_0x2ac2('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ac2('0xa')]);router[_0x2ac2('0x9')]('/describe',auth[_0x2ac2('0xb')](),controller[_0x2ac2('0xc')]);router[_0x2ac2('0x9')](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0xe')]);router[_0x2ac2('0x9')](_0x2ac2('0xf'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x10')]);router[_0x2ac2('0x9')](_0x2ac2('0x11'),auth['isAuthenticated'](),controller[_0x2ac2('0x12')]);router[_0x2ac2('0x13')]('/',auth['isAuthenticated'](),controller[_0x2ac2('0x14')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x2ac2('0x11'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x15')]);router[_0x2ac2('0x16')](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x17')]);router['delete'](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller['destroy']);router[_0x2ac2('0x18')]('/:id/users',auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x19')]);router[_0x2ac2('0x18')](_0x2ac2('0x11'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x1a')]);module[_0x2ac2('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a8e9fea..c706c75 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc57c=['name','VIRTUAL','system-','getDataValue','INTEGER','exports','STRING'];(function(_0x2c0d05,_0x2f95dc){var _0x2c543a=function(_0x2cddd9){while(--_0x2cddd9){_0x2c0d05['push'](_0x2c0d05['shift']());}};_0x2c543a(++_0x2f95dc);}(_0xc57c,0x1b7));var _0xcc57=function(_0x5b5b7b,_0xfc8a0a){_0x5b5b7b=_0x5b5b7b-0x0;var _0x338f67=_0xc57c[_0x5b5b7b];return _0x338f67;};'use strict';var Sequelize=require('sequelize');module[_0xcc57('0x0')]={'name':{'type':Sequelize[_0xcc57('0x1')],'allowNull':![],'unique':_0xcc57('0x2')},'prefix':{'type':Sequelize[_0xcc57('0x3')],'get':function(_0x45d799){return _0xcc57('0x4')+this[_0xcc57('0x5')](_0xcc57('0x2'))+'-';}},'description':{'type':Sequelize[_0xcc57('0x1')]},'callerIdAll':{'type':Sequelize[_0xcc57('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xcc57('0x6')]}}; \ No newline at end of file +var _0x8927=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x43e74f,_0x1a362b){var _0x369155=function(_0xb20b25){while(--_0xb20b25){_0x43e74f['push'](_0x43e74f['shift']());}};_0x369155(++_0x1a362b);}(_0x8927,0x17a));var _0x7892=function(_0x5a9077,_0x467f0c){_0x5a9077=_0x5a9077-0x0;var _0xdad46b=_0x8927[_0x5a9077];return _0xdad46b;};'use strict';var Sequelize=require(_0x7892('0x0'));module[_0x7892('0x1')]={'name':{'type':Sequelize[_0x7892('0x2')],'allowNull':![],'unique':_0x7892('0x3')},'prefix':{'type':Sequelize[_0x7892('0x4')],'get':function(_0x1e4d8c){return _0x7892('0x5')+this[_0x7892('0x6')](_0x7892('0x3'))+'-';}},'description':{'type':Sequelize[_0x7892('0x2')]},'callerIdAll':{'type':Sequelize[_0x7892('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7892('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9e339d2..d617e27 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eba=['UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','removeTeams','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','index','map','VoicePrefix','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','voicePause','flatMap','Agents','addTeams','each'];(function(_0x110171,_0x1c5afc){var _0x3fc862=function(_0x2b2082){while(--_0x2b2082){_0x110171['push'](_0x110171['shift']());}};_0x3fc862(++_0x1c5afc);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x1eba[_0x49e584];return _0x58b1be;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];config[_0xa1eb('0x19')]=_['defaults'](config[_0xa1eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1eb('0x19')]));require('./voicePrefix.socket')[_0xa1eb('0x1a')](socket);function respondWithStatusCode(_0x2178e2,_0x14e048){_0x14e048=_0x14e048||0xcc;return function(_0x2877cb){if(_0x2877cb){return _0x2178e2[_0xa1eb('0x1b')](_0x14e048);}return _0x2178e2[_0xa1eb('0x1c')](_0x14e048)[_0xa1eb('0x1d')]();};}function respondWithResult(_0x45d6dd,_0x211e42){_0x211e42=_0x211e42||0xc8;return function(_0x4aa527){if(_0x4aa527){return _0x45d6dd[_0xa1eb('0x1c')](_0x211e42)['json'](_0x4aa527);}};}function respondWithFilteredResult(_0x1401ef,_0x3dafcd){return function(_0x33c4e3){if(_0x33c4e3){var _0x1a5d2c=typeof _0x3dafcd['offset']===_0xa1eb('0x1e')&&typeof _0x3dafcd[_0xa1eb('0x1f')]===_0xa1eb('0x1e');var _0xcf45c1=_0x33c4e3[_0xa1eb('0x20')];var _0x3b8607=_0x1a5d2c?0x0:_0x3dafcd[_0xa1eb('0x21')];var _0x166f7f=_0x1a5d2c?_0x33c4e3['count']:_0x3dafcd[_0xa1eb('0x21')]+_0x3dafcd['limit'];var _0x2258d1;if(_0x166f7f>=_0xcf45c1){_0x166f7f=_0xcf45c1;_0x2258d1=0xc8;}else{_0x2258d1=0xce;}_0x1401ef[_0xa1eb('0x1c')](_0x2258d1);return _0x1401ef[_0xa1eb('0x22')](_0xa1eb('0x23'),_0x3b8607+'-'+_0x166f7f+'/'+_0xcf45c1)['json'](_0x33c4e3);}return null;};}function patchUpdates(_0x539634){return function(_0x168221){try{jsonpatch[_0xa1eb('0x24')](_0x168221,_0x539634,!![]);}catch(_0x5b0903){return BPromise[_0xa1eb('0x25')](_0x5b0903);}return _0x168221[_0xa1eb('0x26')]();};}function saveUpdates(_0x258d3a,_0xa6b20c){return function(_0x23b49e){if(_0x23b49e){return _0x23b49e[_0xa1eb('0x27')](_0x258d3a)[_0xa1eb('0x28')](function(_0x364b1c){return _0x364b1c;});}return null;};}function removeEntity(_0xd7bb88,_0x352796){return function(_0xb77fd6){if(_0xb77fd6){return _0xb77fd6[_0xa1eb('0x29')]()['then'](function(){var _0x7c617e=_0xb77fd6[_0xa1eb('0x2a')]({'plain':!![]});var _0x491f37=_0xa1eb('0x2b');return db['UserProfileResource'][_0xa1eb('0x29')]({'where':{'type':_0x491f37,'resourceId':_0x7c617e['id']}})[_0xa1eb('0x28')](function(){return _0xb77fd6;});})['then'](function(){_0xd7bb88[_0xa1eb('0x1c')](0xcc)[_0xa1eb('0x1d')]();});}};}function handleEntityNotFound(_0x136835,_0x4f64bb){return function(_0x12cf56){if(!_0x12cf56){_0x136835[_0xa1eb('0x1b')](0x194);}return _0x12cf56;};}function handleError(_0x55f5cc,_0x273a42){_0x273a42=_0x273a42||0x1f4;return function(_0xb27bf9){logger[_0xa1eb('0x2c')](_0xb27bf9[_0xa1eb('0x2d')]);if(_0xb27bf9[_0xa1eb('0x2e')]){delete _0xb27bf9['name'];}_0x55f5cc[_0xa1eb('0x1c')](_0x273a42)[_0xa1eb('0x2f')](_0xb27bf9);};}exports[_0xa1eb('0x30')]=function(_0x2ae21d,_0x383e26){var _0xcd9efd={},_0x1d5b64={},_0xcfda64={'count':0x0,'rows':[]};var _0x254727=_[_0xa1eb('0x31')](db[_0xa1eb('0x32')]['rawAttributes'],function(_0x563b11){return{'name':_0x563b11[_0xa1eb('0x33')],'type':_0x563b11[_0xa1eb('0x34')][_0xa1eb('0x35')]};});_0x1d5b64[_0xa1eb('0x36')]=_[_0xa1eb('0x31')](_0x254727,'name');_0x1d5b64['query']=_[_0xa1eb('0x37')](_0x2ae21d[_0xa1eb('0x38')]);_0x1d5b64['filters']=_['intersection'](_0x1d5b64[_0xa1eb('0x36')],_0x1d5b64['query']);_0xcd9efd[_0xa1eb('0x39')]=_['intersection'](_0x1d5b64[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x2ae21d[_0xa1eb('0x38')]['fields']));_0xcd9efd[_0xa1eb('0x39')]=_0xcd9efd[_0xa1eb('0x39')][_0xa1eb('0x3b')]?_0xcd9efd['attributes']:_0x1d5b64[_0xa1eb('0x36')];if(!_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x3c')](_0xa1eb('0x3d'))){_0xcd9efd[_0xa1eb('0x1f')]=qs['limit'](_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0xcd9efd[_0xa1eb('0x21')]=qs[_0xa1eb('0x21')](_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x21')]);}_0xcd9efd[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x2ae21d['query'][_0xa1eb('0x3f')]);_0xcd9efd[_0xa1eb('0x40')]=qs[_0xa1eb('0x41')](_[_0xa1eb('0x42')](_0x2ae21d[_0xa1eb('0x38')],_0x1d5b64['filters']),_0x254727);if(_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x43')]){_0xcd9efd[_0xa1eb('0x40')]=_['merge'](_0xcd9efd[_0xa1eb('0x40')],{'$or':_[_0xa1eb('0x31')](_0x254727,function(_0x2ae6d8){if(_0x2ae6d8[_0xa1eb('0x34')]!==_0xa1eb('0x44')){var _0x1e5b3b={};_0x1e5b3b[_0x2ae6d8[_0xa1eb('0x2e')]]={'$like':'%'+_0x2ae21d['query'][_0xa1eb('0x43')]+'%'};return _0x1e5b3b;}})});}_0xcd9efd=_[_0xa1eb('0x45')]({},_0xcd9efd,_0x2ae21d['options']);var _0xf6c04b={'where':_0xcd9efd['where']};return db[_0xa1eb('0x32')][_0xa1eb('0x20')](_0xf6c04b)[_0xa1eb('0x28')](function(_0x361675){_0xcfda64[_0xa1eb('0x20')]=_0x361675;if(_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x46')]){_0xcd9efd[_0xa1eb('0x47')]=[{'all':!![]}];}return db[_0xa1eb('0x32')][_0xa1eb('0x48')](_0xcd9efd);})[_0xa1eb('0x28')](function(_0x3c4690){_0xcfda64[_0xa1eb('0x49')]=_0x3c4690;return _0xcfda64;})[_0xa1eb('0x28')](respondWithFilteredResult(_0x383e26,_0xcd9efd))[_0xa1eb('0x4a')](handleError(_0x383e26,null));};exports[_0xa1eb('0x4b')]=function(_0x4e068d,_0x10f983){var _0x4fd053={'raw':![],'where':{'id':_0x4e068d[_0xa1eb('0x4c')]['id']}},_0x3edc6b={};_0x3edc6b['model']=_['keys'](db[_0xa1eb('0x32')][_0xa1eb('0x4d')]);_0x3edc6b[_0xa1eb('0x38')]=_['keys'](_0x4e068d[_0xa1eb('0x38')]);_0x3edc6b[_0xa1eb('0x41')]=_[_0xa1eb('0x4e')](_0x3edc6b[_0xa1eb('0x36')],_0x3edc6b[_0xa1eb('0x38')]);_0x4fd053[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x3edc6b[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x4e068d[_0xa1eb('0x38')][_0xa1eb('0x3a')]));_0x4fd053[_0xa1eb('0x39')]=_0x4fd053[_0xa1eb('0x39')][_0xa1eb('0x3b')]?_0x4fd053['attributes']:_0x3edc6b[_0xa1eb('0x36')];if(_0x4e068d[_0xa1eb('0x38')][_0xa1eb('0x46')]){_0x4fd053[_0xa1eb('0x47')]=[{'all':!![]}];}_0x4fd053=_[_0xa1eb('0x45')]({},_0x4fd053,_0x4e068d[_0xa1eb('0x4f')]);return db[_0xa1eb('0x32')]['find'](_0x4fd053)[_0xa1eb('0x28')](handleEntityNotFound(_0x10f983,null))[_0xa1eb('0x28')](respondWithResult(_0x10f983,null))[_0xa1eb('0x4a')](handleError(_0x10f983,null));};exports[_0xa1eb('0x29')]=function(_0x8975a1,_0x1302f6){return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x8975a1[_0xa1eb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1302f6,null))[_0xa1eb('0x28')](removeEntity(_0x1302f6,null))['catch'](handleError(_0x1302f6,null));};exports[_0xa1eb('0x51')]=function(_0x495c01,_0x1a815e){return db[_0xa1eb('0x32')][_0xa1eb('0x51')]()['then'](respondWithResult(_0x1a815e,null))[_0xa1eb('0x4a')](handleError(_0x1a815e,null));};exports[_0xa1eb('0x52')]=function(_0x549c95,_0x10d6d5){var _0x2926e7;return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x11cc84){return db[_0xa1eb('0x32')][_0xa1eb('0x52')](_0x549c95[_0xa1eb('0x55')],{'transaction':_0x11cc84})[_0xa1eb('0x28')](function(_0x3d9a41){_0x2926e7=_0x3d9a41[_0xa1eb('0x2a')]({'plain':!![]});return db[_0xa1eb('0x56')][_0xa1eb('0x50')]({'where':{'id':_0x2926e7[_0xa1eb('0x57')]},'raw':!![]})[_0xa1eb('0x28')](function(_0x2ba6c0){return createVoicePrefixExtensions(_0x2926e7,_0x2ba6c0,_0x11cc84);});});})[_0xa1eb('0x28')](function(){var _0x589186=_0x549c95[_0xa1eb('0x58')][_0xa1eb('0x2a')]({'plain':!![]});if(!_0x589186)throw new Error(_0xa1eb('0x59'));if(_0x589186[_0xa1eb('0x5a')]===_0xa1eb('0x58')){var _0x1f5da6=_0x2926e7;return db['UserProfileSection'][_0xa1eb('0x50')]({'where':{'name':_0xa1eb('0x2b'),'userProfileId':_0x589186[_0xa1eb('0x5b')]},'raw':!![]})[_0xa1eb('0x28')](function(_0xa46d79){if(_0xa46d79&&_0xa46d79[_0xa1eb('0x5c')]===0x0){return db[_0xa1eb('0x5d')]['create']({'name':_0x1f5da6[_0xa1eb('0x2e')],'resourceId':_0x1f5da6['id'],'type':_0xa46d79[_0xa1eb('0x2e')],'sectionId':_0xa46d79['id']},{})[_0xa1eb('0x28')](function(){return _0x2926e7;});}else{return _0x2926e7;}})[_0xa1eb('0x4a')](function(_0x4c30ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c30ad);throw _0x4c30ad;});}return _0x2926e7;})['then'](respondWithResult(_0x10d6d5,null))[_0xa1eb('0x4a')](handleError(_0x10d6d5,null));};function Extension(_0x1e1e5d,_0x591907,_0x4643f3,_0x3e2d2f){this[_0xa1eb('0x5e')]=_0xa1eb('0x5f');this['exten']=_0x1e1e5d;this['app']=_0x4643f3;this[_0xa1eb('0x34')]=_0xa1eb('0x60');this[_0xa1eb('0x61')]=_0xa1eb('0x62');this[_0xa1eb('0x63')]=_0x591907;this[_0xa1eb('0x64')]=_0x3e2d2f;}function createVoicePrefixExtensions(_0x51580f,_0x532dfa,_0x43f223){return new BPromise(function(_0x5afc3e,_0x3ea940){var _0x57172d=new Extension(formatPrefixName(_0x51580f[_0xa1eb('0x65')]),0x1,_0xa1eb('0x66'),'Voice\x20Prefix');_0x57172d[_0xa1eb('0x67')]=_0x51580f['id'];return db[_0xa1eb('0x56')]['create'](_0x57172d,{'transaction':_0x43f223})[_0xa1eb('0x28')](function(_0x17feb5){var _0x3b97c7=_0x17feb5['get']({'plain':!![]});var _0x9799d3=_[_0xa1eb('0x31')](addVoicePrefixExtensions(_0x51580f,_0x532dfa),function(_0x4af59a){_0x4af59a[_0xa1eb('0x57')]=_0x3b97c7['id'];_0x4af59a[_0xa1eb('0x67')]=_0x51580f['id'];return _0x4af59a;});return db[_0xa1eb('0x56')]['bulkCreate'](_0x9799d3,{'transaction':_0x43f223})[_0xa1eb('0x28')](function(_0x5aa916){if(!_0x5aa916){return _0x3ea940(_0xa1eb('0x68'));}else{return _0x5afc3e(_0x5aa916);}})[_0xa1eb('0x4a')](function(_0x40eae0){return _0x3ea940(_0x40eae0);});});;});};function addVoicePrefixExtensions(_0x331a80,_0x2df867){var _0x48f49d=[];var _0x2aba03=formatPrefixName(_0x331a80[_0xa1eb('0x65')]);_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x2,'Set',_0xa1eb('0x6a')+_0x331a80['name']));if(_0x331a80['callerIdAll']){_0x48f49d['push'](new Extension(_0x2aba03,0x3,'Set',_0xa1eb('0x6b')+_0x331a80[_0xa1eb('0x6c')]));}else{_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x3,_0xa1eb('0x66'),_0xa1eb('0x6d')));}_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x4,_0xa1eb('0x6e'),_0x2df867[_0xa1eb('0x5e')]+','+_0xa1eb('0x6f')+(0x8+_0x331a80[_0xa1eb('0x2e')]['length'])+'}'+','+0x1));return _0x48f49d;}function formatPrefixName(_0x79bee8){var _0x1d1c91='_';for(var _0x46207c=0x0;_0x46207c<_0x79bee8[_0xa1eb('0x3b')];_0x46207c++){if(_0x79bee8[_0xa1eb('0x70')](_0x46207c)=='-'){_0x1d1c91+=_0x79bee8[_0xa1eb('0x70')](_0x46207c);}else{_0x1d1c91+='['+_0x79bee8['charAt'](_0x46207c)+']';}}_0x1d1c91+='.';return _0x1d1c91;}exports[_0xa1eb('0x27')]=function(_0x2b6996,_0x16c5a3,_0x58147f){var _0x1434a1=_0x2b6996[_0xa1eb('0x55')];_0x1434a1[_0xa1eb('0x65')]=_0xa1eb('0x71')+_0x1434a1[_0xa1eb('0x2e')]+'-';return db['sequelize'][_0xa1eb('0x54')](function(_0x50eff6){return db[_0xa1eb('0x32')]['update'](_0x1434a1,{'where':{'id':_0x1434a1['id']},'transaction':_0x50eff6})[_0xa1eb('0x28')](function(){return db[_0xa1eb('0x56')][_0xa1eb('0x29')]({'where':{'VoicePrefixId':_0x1434a1['id']},'transaction':_0x50eff6})[_0xa1eb('0x28')](function(){return db['VoiceExtension'][_0xa1eb('0x50')]({'where':{'id':_0x1434a1[_0xa1eb('0x57')]},'raw':!![]})[_0xa1eb('0x28')](function(_0x293f74){return createVoicePrefixExtensions(_0x1434a1,_0x293f74,_0x50eff6);});});});})['then'](function(){return db[_0xa1eb('0x32')][_0xa1eb('0x72')](_0x1434a1['id']);})[_0xa1eb('0x28')](respondWithResult(_0x16c5a3,null))[_0xa1eb('0x4a')](handleError(_0x16c5a3,null));};exports[_0xa1eb('0x73')]=function(_0x22a7cb,_0x389e44,_0x471633){return db[_0xa1eb('0x32')]['find']({'where':{'id':_0x22a7cb['params']['id']}})['then'](handleEntityNotFound(_0x389e44,null))[_0xa1eb('0x28')](function(_0x5b7785){if(_0x5b7785){return _0x5b7785[_0xa1eb('0x73')](_0x22a7cb[_0xa1eb('0x55')]['ids'],_['omit'](_0x22a7cb[_0xa1eb('0x55')],[_0xa1eb('0x74'),'id'])||{})[_0xa1eb('0x75')](function(_0x6027f7){for(var _0x470489=0x0;_0x470489<_0x22a7cb['body']['ids'][_0xa1eb('0x3b')];_0x470489+=0x1){socket[_0xa1eb('0x76')](_0xa1eb('0x77'),{'UserId':Number(_0x22a7cb[_0xa1eb('0x55')]['ids'][_0x470489]),'VoicePrefixId':Number(_0x22a7cb[_0xa1eb('0x4c')]['id'])});}return _0x6027f7;});}})[_0xa1eb('0x28')](respondWithResult(_0x389e44,null))[_0xa1eb('0x4a')](handleError(_0x389e44,null));};exports[_0xa1eb('0x78')]=function(_0x3863ce,_0x37d8c4,_0x3fd52a){return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x3863ce[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x37d8c4,null))['then'](function(_0x21d884){if(_0x21d884){return _0x21d884[_0xa1eb('0x78')](_0x3863ce[_0xa1eb('0x38')][_0xa1eb('0x74')])[_0xa1eb('0x28')](function(){if(_[_0xa1eb('0x79')](_0x3863ce['query'][_0xa1eb('0x74')])){for(var _0x36a94f=0x0;_0x36a94f<_0x3863ce[_0xa1eb('0x38')][_0xa1eb('0x74')]['length'];_0x36a94f+=0x1){socket['emit'](_0xa1eb('0x7a'),{'UserId':Number(_0x3863ce['query'][_0xa1eb('0x74')][_0x36a94f]),'VoicePrefixId':Number(_0x3863ce[_0xa1eb('0x4c')]['id'])});}}else{socket['emit'](_0xa1eb('0x7a'),{'UserId':Number(_0x3863ce[_0xa1eb('0x38')]['ids']),'VoicePrefixId':Number(_0x3863ce[_0xa1eb('0x4c')]['id'])});}});}})[_0xa1eb('0x28')](respondWithStatusCode(_0x37d8c4,null))[_0xa1eb('0x4a')](handleError(_0x37d8c4,null));};exports[_0xa1eb('0x7b')]=function(_0x3d9034,_0x20cf70,_0x824123){var _0x2ce2e1={};var _0x3d32da={};var _0x64943f;var _0x3b4851;return db['VoicePrefix'][_0xa1eb('0x7c')]({'where':{'id':_0x3d9034[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x20cf70,null))[_0xa1eb('0x28')](function(_0x49e563){if(_0x49e563){_0x64943f=_0x49e563;_0x3d32da[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](db[_0xa1eb('0x7d')]['rawAttributes']);_0x3d32da[_0xa1eb('0x38')]=_[_0xa1eb('0x37')](_0x3d9034[_0xa1eb('0x38')]);_0x3d32da['filters']=_[_0xa1eb('0x4e')](_0x3d32da['model'],_0x3d32da[_0xa1eb('0x38')]);_0x2ce2e1[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x3d32da[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x3a')]));_0x2ce2e1[_0xa1eb('0x39')]=_0x2ce2e1['attributes'][_0xa1eb('0x3b')]?_0x2ce2e1[_0xa1eb('0x39')]:_0x3d32da[_0xa1eb('0x36')];_0x2ce2e1[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x3d9034['query'][_0xa1eb('0x3f')]);_0x2ce2e1[_0xa1eb('0x40')]=qs['filters'](_[_0xa1eb('0x42')](_0x3d9034['query'],_0x3d32da['filters']));if(_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x43')]){_0x2ce2e1['where']=_[_0xa1eb('0x45')](_0x2ce2e1[_0xa1eb('0x40')],{'$or':_['map'](_0x2ce2e1[_0xa1eb('0x39')],function(_0x2c49d1){var _0x4d2598={};_0x4d2598[_0x2c49d1]={'$like':'%'+_0x3d9034['query'][_0xa1eb('0x43')]+'%'};return _0x4d2598;})});}_0x2ce2e1=_['merge']({},_0x2ce2e1,_0x3d9034[_0xa1eb('0x4f')]);return _0x64943f[_0xa1eb('0x7b')](_0x2ce2e1);}})[_0xa1eb('0x28')](function(_0x316a75){if(_0x316a75){_0x3b4851=_0x316a75[_0xa1eb('0x3b')];if(!_0x3d9034[_0xa1eb('0x38')]['hasOwnProperty'](_0xa1eb('0x3d'))){_0x2ce2e1['limit']=qs[_0xa1eb('0x1f')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0x2ce2e1[_0xa1eb('0x21')]=qs[_0xa1eb('0x21')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x21')]);}return _0x64943f['getAgents'](_0x2ce2e1);}})[_0xa1eb('0x28')](function(_0x4effc0){if(_0x4effc0){return _0x4effc0?{'count':_0x3b4851,'rows':_0x4effc0}:null;}})['then'](respondWithResult(_0x20cf70,null))[_0xa1eb('0x4a')](handleError(_0x20cf70,null));};exports[_0xa1eb('0x7e')]=function(_0x456ddb,_0x559d58,_0x14eff1){var _0x717fbf={};var _0x5ef8c1={};var _0x2dd909;var _0x58d694;return db[_0xa1eb('0x32')]['findOne']({'where':{'id':_0x456ddb[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x559d58,null))['then'](function(_0x52c3d6){if(_0x52c3d6){_0x2dd909=_0x52c3d6;_0x5ef8c1[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](db[_0xa1eb('0x7f')][_0xa1eb('0x4d')]);_0x5ef8c1[_0xa1eb('0x38')]=_[_0xa1eb('0x37')](_0x456ddb[_0xa1eb('0x38')]);_0x5ef8c1[_0xa1eb('0x41')]=_[_0xa1eb('0x4e')](_0x5ef8c1[_0xa1eb('0x36')],_0x5ef8c1[_0xa1eb('0x38')]);_0x717fbf[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x5ef8c1[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x456ddb['query'][_0xa1eb('0x3a')]));_0x717fbf[_0xa1eb('0x39')]=_0x717fbf['attributes'][_0xa1eb('0x3b')]?_0x717fbf['attributes']:_0x5ef8c1[_0xa1eb('0x36')];_0x717fbf[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x456ddb['query'][_0xa1eb('0x3f')]);_0x717fbf[_0xa1eb('0x40')]=qs[_0xa1eb('0x41')](_[_0xa1eb('0x42')](_0x456ddb['query'],_0x5ef8c1[_0xa1eb('0x41')]));if(_0x456ddb['query'][_0xa1eb('0x43')]){_0x717fbf[_0xa1eb('0x40')]=_[_0xa1eb('0x45')](_0x717fbf[_0xa1eb('0x40')],{'$or':_[_0xa1eb('0x31')](_0x717fbf[_0xa1eb('0x39')],function(_0xc27d40){var _0x1e3d9c={};_0x1e3d9c[_0xc27d40]={'$like':'%'+_0x456ddb['query'][_0xa1eb('0x43')]+'%'};return _0x1e3d9c;})});}_0x717fbf=_[_0xa1eb('0x45')]({},_0x717fbf,_0x456ddb[_0xa1eb('0x4f')]);return _0x2dd909[_0xa1eb('0x7e')](_0x717fbf);}})[_0xa1eb('0x28')](function(_0x322728){if(_0x322728){_0x58d694=_0x322728[_0xa1eb('0x3b')];if(!_0x456ddb[_0xa1eb('0x38')][_0xa1eb('0x3c')](_0xa1eb('0x3d'))){_0x717fbf[_0xa1eb('0x1f')]=qs[_0xa1eb('0x1f')](_0x456ddb[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0x717fbf['offset']=qs[_0xa1eb('0x21')](_0x456ddb[_0xa1eb('0x38')]['offset']);}return _0x2dd909['getTeams'](_0x717fbf);}})[_0xa1eb('0x28')](function(_0x106dd9){if(_0x106dd9){return _0x106dd9?{'count':_0x58d694,'rows':_0x106dd9}:null;}})[_0xa1eb('0x28')](respondWithResult(_0x559d58,null))[_0xa1eb('0x4a')](handleError(_0x559d58,null));};exports['addTeams']=function(_0x402acb,_0x49441f,_0x3ad4ca){var _0x2151a8=_0x402acb[_0xa1eb('0x55')][_0xa1eb('0x74')];var _0x33a90e;return db[_0xa1eb('0x7f')][_0xa1eb('0x48')]({'where':{'id':_0x2151a8},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xa1eb('0x80'),'interface'],'raw':!![]}]})[_0xa1eb('0x28')](function(_0x2c97f8){if(_0x2c97f8){_0x33a90e=_0x2c97f8;var _0x1c1a59=_[_0xa1eb('0x81')](_0x2c97f8,function(_0x438746){var _0x16528e=_0x438746[_0xa1eb('0x2a')]({'plain':!![]});return _0x16528e[_0xa1eb('0x82')];});return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x402acb[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](function(_0x3d9f66){return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x562666){return _0x3d9f66[_0xa1eb('0x83')](_0x2151a8,{'transaction':_0x562666})['then'](function(){return BPromise[_0xa1eb('0x84')](_0x33a90e,function(_0x230a07){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x230a07['id'],'VoicePrefixId':_0x402acb[_0xa1eb('0x4c')]['id']},{'transaction':_0x562666});});})[_0xa1eb('0x28')](function(){return BPromise[_0xa1eb('0x84')](_0x1c1a59,function(_0x38451d){return db[_0xa1eb('0x85')][_0xa1eb('0x86')]({'where':{'UserId':_0x38451d['id'],'VoicePrefixId':_0x402acb['params']['id']},'transaction':_0x562666});});})[_0xa1eb('0x28')](function(){_0x1c1a59[_0xa1eb('0x87')](function(_0x11d0ab){socket[_0xa1eb('0x76')](_0xa1eb('0x77'),{'UserId':_0x11d0ab['id'],'VoicePrefixId':_0x3d9f66['id']});});});});});}})[_0xa1eb('0x28')](respondWithStatusCode(_0x49441f,null))[_0xa1eb('0x4a')](handleError(_0x49441f,null));};exports['removeTeams']=function(_0x37e2d5,_0x1cfec1,_0x4d9d0b){return db['Team'][_0xa1eb('0x48')]({'where':{'id':_0x37e2d5['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa1eb('0x7d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa1eb('0x28')](handleEntityNotFound(_0x1cfec1,null))[_0xa1eb('0x28')](function(_0x5b8b32){var _0xe47df5=_[_0xa1eb('0x31')](_0x5b8b32,'id');var _0x382643=[];var _0x89e33c=[];var _0x4f535b=squel[_0xa1eb('0x88')]();_0x4f535b[_0xa1eb('0x89')](_0xa1eb('0x8a'))[_0xa1eb('0x8b')](_0xa1eb('0x8c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1eb('0x40')](_0xa1eb('0x8d'),_0x37e2d5[_0xa1eb('0x4c')]['id']);for(var _0x3da094=0x0;_0x3da094<_0x5b8b32[_0xa1eb('0x3b')];_0x3da094+=0x1){let _0x41e608=_0x5b8b32[_0x3da094];for(var _0x934746=0x0;_0x934746<_0x41e608[_0xa1eb('0x82')][_0xa1eb('0x3b')];_0x934746+=0x1){let _0x34e1ae=_0x41e608[_0xa1eb('0x82')][_0x934746];var _0x368e4e=_0x4f535b[_0xa1eb('0x8e')]();_0x368e4e[_0xa1eb('0x40')](_0xa1eb('0x8f'),_0x34e1ae['id']);_0x89e33c[_0xa1eb('0x69')](db[_0xa1eb('0x53')]['query'](_0x368e4e[_0xa1eb('0x90')](),{'type':db[_0xa1eb('0x53')]['QueryTypes'][_0xa1eb('0x91')]})[_0xa1eb('0x28')](function(_0x155a90){if(_0x155a90[_0xa1eb('0x3b')]===0x1){return _0x34e1ae['id'];}else{var _0x1d018a=_['every'](_['map'](_0x155a90,_0xa1eb('0x92')),function(_0x4ab784){return _[_0xa1eb('0x93')](_0xe47df5,_0x4ab784);});if(_0x1d018a){return _0x34e1ae['id'];}}}));}}return BPromise[_0xa1eb('0x94')](_0x89e33c)['then'](function(_0x4e3121){_0x382643=_(_0x382643)['union'](_0x4e3121)[_0xa1eb('0x95')]()['value']();return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x37e2d5[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](function(_0x29ecae){return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x5a0dd4){return _0x29ecae[_0xa1eb('0x96')](_0x37e2d5[_0xa1eb('0x38')][_0xa1eb('0x74')],{'transaction':_0x5a0dd4})['then'](function(){if(!_['isEmpty'](_0x382643)){return _0x29ecae[_0xa1eb('0x78')](_0x382643,{'transaction':_0x5a0dd4});}})[_0xa1eb('0x28')](function(){_0x382643[_0xa1eb('0x87')](function(_0x42720b){socket[_0xa1eb('0x76')]('userVoicePrefix:remove',{'UserId':_0x42720b,'VoicePrefixId':_0x29ecae['id']});});});});});});})[_0xa1eb('0x28')](respondWithStatusCode(_0x1cfec1,null))['catch'](handleError(_0x1cfec1,null));}; \ No newline at end of file +var _0x58a4=['addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','getTeams','Team','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','catch','describe','create','sequelize','transaction','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','findById'];(function(_0x10055a,_0x44efaf){var _0x49eb68=function(_0x136e2f){while(--_0x136e2f){_0x10055a['push'](_0x10055a['shift']());}};_0x49eb68(++_0x44efaf);}(_0x58a4,0xbf));var _0x458a=function(_0x589cdf,_0x53f463){_0x589cdf=_0x589cdf-0x0;var _0x5f0774=_0x58a4[_0x589cdf];return _0x5f0774;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];config[_0x458a('0x1a')]=_[_0x458a('0x1b')](config[_0x458a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458a('0x1a')]));require('./voicePrefix.socket')[_0x458a('0x1c')](socket);function respondWithStatusCode(_0x44f683,_0x10133b){_0x10133b=_0x10133b||0xcc;return function(_0x3b74f9){if(_0x3b74f9){return _0x44f683[_0x458a('0x1d')](_0x10133b);}return _0x44f683[_0x458a('0x1e')](_0x10133b)['end']();};}function respondWithResult(_0x4b26be,_0x5c7993){_0x5c7993=_0x5c7993||0xc8;return function(_0x2faf6a){if(_0x2faf6a){return _0x4b26be[_0x458a('0x1e')](_0x5c7993)[_0x458a('0x1f')](_0x2faf6a);}};}function respondWithFilteredResult(_0x5c5b41,_0x310569){return function(_0x260c87){if(_0x260c87){var _0x18504d=typeof _0x310569[_0x458a('0x20')]===_0x458a('0x21')&&typeof _0x310569['limit']==='undefined';var _0x178db9=_0x260c87['count'];var _0x3302b7=_0x18504d?0x0:_0x310569[_0x458a('0x20')];var _0x47a202=_0x18504d?_0x260c87[_0x458a('0x22')]:_0x310569['offset']+_0x310569[_0x458a('0x23')];var _0x1c79cb;if(_0x47a202>=_0x178db9){_0x47a202=_0x178db9;_0x1c79cb=0xc8;}else{_0x1c79cb=0xce;}_0x5c5b41['status'](_0x1c79cb);return _0x5c5b41[_0x458a('0x24')](_0x458a('0x25'),_0x3302b7+'-'+_0x47a202+'/'+_0x178db9)['json'](_0x260c87);}return null;};}function patchUpdates(_0xa6b8ff){return function(_0x5ad95a){try{jsonpatch[_0x458a('0x26')](_0x5ad95a,_0xa6b8ff,!![]);}catch(_0x5bca42){return BPromise[_0x458a('0x27')](_0x5bca42);}return _0x5ad95a['save']();};}function saveUpdates(_0x36b08e,_0x911eaf){return function(_0xcb0756){if(_0xcb0756){return _0xcb0756[_0x458a('0x28')](_0x36b08e)[_0x458a('0x29')](function(_0x19bd5){return _0x19bd5;});}return null;};}function removeEntity(_0x340375,_0x3012c7){return function(_0x1f2d0){if(_0x1f2d0){return _0x1f2d0[_0x458a('0x2a')]()[_0x458a('0x29')](function(){var _0x327fcb=_0x1f2d0[_0x458a('0x2b')]({'plain':!![]});var _0x5a55b7=_0x458a('0x2c');return db[_0x458a('0x2d')]['destroy']({'where':{'type':_0x5a55b7,'resourceId':_0x327fcb['id']}})['then'](function(){return _0x1f2d0;});})[_0x458a('0x29')](function(){_0x340375['status'](0xcc)[_0x458a('0x2e')]();});}};}function handleEntityNotFound(_0x29f9b5,_0x223f73){return function(_0x4a49e4){if(!_0x4a49e4){_0x29f9b5[_0x458a('0x1d')](0x194);}return _0x4a49e4;};}function handleError(_0x2531f7,_0x1426a8){_0x1426a8=_0x1426a8||0x1f4;return function(_0x562c36){logger['error'](_0x562c36[_0x458a('0x2f')]);if(_0x562c36['name']){delete _0x562c36[_0x458a('0x30')];}_0x2531f7['status'](_0x1426a8)[_0x458a('0x31')](_0x562c36);};}exports[_0x458a('0x32')]=function(_0x492843,_0x309a6a){var _0x269f53={},_0x625ae3={},_0x525caf={'count':0x0,'rows':[]};var _0x3371c3=_[_0x458a('0x33')](db[_0x458a('0x34')][_0x458a('0x35')],function(_0x5267fe){return{'name':_0x5267fe['fieldName'],'type':_0x5267fe[_0x458a('0x36')][_0x458a('0x37')]};});_0x625ae3[_0x458a('0x38')]=_[_0x458a('0x33')](_0x3371c3,_0x458a('0x30'));_0x625ae3[_0x458a('0x39')]=_['keys'](_0x492843[_0x458a('0x39')]);_0x625ae3[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],_0x625ae3[_0x458a('0x39')]);_0x269f53[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x492843['query'][_0x458a('0x3d')]));_0x269f53[_0x458a('0x3c')]=_0x269f53[_0x458a('0x3c')][_0x458a('0x3e')]?_0x269f53[_0x458a('0x3c')]:_0x625ae3[_0x458a('0x38')];if(!_0x492843[_0x458a('0x39')][_0x458a('0x3f')](_0x458a('0x40'))){_0x269f53[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x492843[_0x458a('0x39')][_0x458a('0x23')]);_0x269f53[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x492843['query'][_0x458a('0x20')]);}_0x269f53[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x492843[_0x458a('0x39')][_0x458a('0x42')]);_0x269f53[_0x458a('0x43')]=qs[_0x458a('0x3a')](_[_0x458a('0x44')](_0x492843[_0x458a('0x39')],_0x625ae3[_0x458a('0x3a')]),_0x3371c3);if(_0x492843[_0x458a('0x39')]['filter']){_0x269f53[_0x458a('0x43')]=_[_0x458a('0x45')](_0x269f53['where'],{'$or':_[_0x458a('0x33')](_0x3371c3,function(_0x422b45){if(_0x422b45[_0x458a('0x36')]!=='VIRTUAL'){var _0x406312={};_0x406312[_0x422b45[_0x458a('0x30')]]={'$like':'%'+_0x492843[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0x406312;}})});}_0x269f53=_[_0x458a('0x45')]({},_0x269f53,_0x492843[_0x458a('0x47')]);var _0x21d2d4={'where':_0x269f53[_0x458a('0x43')]};return db['VoicePrefix'][_0x458a('0x22')](_0x21d2d4)[_0x458a('0x29')](function(_0x2b9030){_0x525caf['count']=_0x2b9030;if(_0x492843[_0x458a('0x39')][_0x458a('0x48')]){_0x269f53['include']=[{'all':!![]}];}return db[_0x458a('0x34')][_0x458a('0x49')](_0x269f53);})[_0x458a('0x29')](function(_0x36c391){_0x525caf[_0x458a('0x4a')]=_0x36c391;return _0x525caf;})['then'](respondWithFilteredResult(_0x309a6a,_0x269f53))['catch'](handleError(_0x309a6a,null));};exports[_0x458a('0x4b')]=function(_0x301e61,_0x33a31d){var _0x18e4e2={'raw':![],'where':{'id':_0x301e61[_0x458a('0x4c')]['id']}},_0x5afd24={};_0x5afd24[_0x458a('0x38')]=_['keys'](db[_0x458a('0x34')]['rawAttributes']);_0x5afd24[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x301e61[_0x458a('0x39')]);_0x5afd24['filters']=_[_0x458a('0x3b')](_0x5afd24[_0x458a('0x38')],_0x5afd24[_0x458a('0x39')]);_0x18e4e2['attributes']=_['intersection'](_0x5afd24[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x301e61[_0x458a('0x39')]['fields']));_0x18e4e2['attributes']=_0x18e4e2[_0x458a('0x3c')][_0x458a('0x3e')]?_0x18e4e2[_0x458a('0x3c')]:_0x5afd24[_0x458a('0x38')];if(_0x301e61[_0x458a('0x39')][_0x458a('0x48')]){_0x18e4e2[_0x458a('0x4e')]=[{'all':!![]}];}_0x18e4e2=_[_0x458a('0x45')]({},_0x18e4e2,_0x301e61[_0x458a('0x47')]);return db[_0x458a('0x34')][_0x458a('0x4f')](_0x18e4e2)[_0x458a('0x29')](handleEntityNotFound(_0x33a31d,null))[_0x458a('0x29')](respondWithResult(_0x33a31d,null))[_0x458a('0x50')](handleError(_0x33a31d,null));};exports[_0x458a('0x2a')]=function(_0x25b44c,_0x51669b){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x25b44c[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x51669b,null))[_0x458a('0x29')](removeEntity(_0x51669b,null))['catch'](handleError(_0x51669b,null));};exports['describe']=function(_0x514d82,_0x2abf75){return db['VoicePrefix'][_0x458a('0x51')]()[_0x458a('0x29')](respondWithResult(_0x2abf75,null))[_0x458a('0x50')](handleError(_0x2abf75,null));};exports[_0x458a('0x52')]=function(_0xfa6e65,_0x5f0151){var _0x48f68e;return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x2587a1){return db[_0x458a('0x34')][_0x458a('0x52')](_0xfa6e65['body'],{'transaction':_0x2587a1})[_0x458a('0x29')](function(_0x4eed01){_0x48f68e=_0x4eed01[_0x458a('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x458a('0x4f')]({'where':{'id':_0x48f68e['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b9928){return createVoicePrefixExtensions(_0x48f68e,_0x4b9928,_0x2587a1);});});})[_0x458a('0x29')](function(){var _0x3eb267=_0xfa6e65['user'][_0x458a('0x2b')]({'plain':!![]});if(!_0x3eb267)throw new Error(_0x458a('0x55'));if(_0x3eb267[_0x458a('0x56')]==='user'){var _0x2c1230=_0x48f68e;return db[_0x458a('0x57')][_0x458a('0x4f')]({'where':{'name':_0x458a('0x2c'),'userProfileId':_0x3eb267[_0x458a('0x58')]},'raw':!![]})[_0x458a('0x29')](function(_0x597e74){if(_0x597e74&&_0x597e74[_0x458a('0x59')]===0x0){return db[_0x458a('0x2d')][_0x458a('0x52')]({'name':_0x2c1230[_0x458a('0x30')],'resourceId':_0x2c1230['id'],'type':_0x597e74[_0x458a('0x30')],'sectionId':_0x597e74['id']},{})[_0x458a('0x29')](function(){return _0x48f68e;});}else{return _0x48f68e;}})[_0x458a('0x50')](function(_0x3b6cf9){logger['error'](_0x458a('0x5a'),_0x3b6cf9);throw _0x3b6cf9;});}return _0x48f68e;})['then'](respondWithResult(_0x5f0151,null))[_0x458a('0x50')](handleError(_0x5f0151,null));};function Extension(_0x2921ba,_0x222aa4,_0x42b748,_0x4da240){this['context']=_0x458a('0x5b');this[_0x458a('0x5c')]=_0x2921ba;this[_0x458a('0x5d')]=_0x42b748;this[_0x458a('0x36')]=_0x458a('0x5e');this[_0x458a('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x458a('0x60')]=_0x222aa4;this[_0x458a('0x61')]=_0x4da240;}function createVoicePrefixExtensions(_0x4f6913,_0x18d83a,_0x47b334){return new BPromise(function(_0x425a0f,_0x338127){var _0xa37d44=new Extension(formatPrefixName(_0x4f6913[_0x458a('0x62')]),0x1,_0x458a('0x63'),_0x458a('0x64'));_0xa37d44[_0x458a('0x65')]=_0x4f6913['id'];return db[_0x458a('0x66')]['create'](_0xa37d44,{'transaction':_0x47b334})[_0x458a('0x29')](function(_0x3ed05d){var _0x5d41a2=_0x3ed05d[_0x458a('0x2b')]({'plain':!![]});var _0x3da617=_['map'](addVoicePrefixExtensions(_0x4f6913,_0x18d83a),function(_0xaf7b50){_0xaf7b50[_0x458a('0x67')]=_0x5d41a2['id'];_0xaf7b50['VoicePrefixId']=_0x4f6913['id'];return _0xaf7b50;});return db[_0x458a('0x66')][_0x458a('0x68')](_0x3da617,{'transaction':_0x47b334})['then'](function(_0x16f82f){if(!_0x16f82f){return _0x338127(_0x458a('0x69'));}else{return _0x425a0f(_0x16f82f);}})[_0x458a('0x50')](function(_0x404d93){return _0x338127(_0x404d93);});});;});};function addVoicePrefixExtensions(_0x541375,_0x27d1f2){var _0x4199a7=[];var _0x397595=formatPrefixName(_0x541375['prefix']);_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x2,_0x458a('0x6b'),_0x458a('0x6c')+_0x541375[_0x458a('0x30')]));if(_0x541375[_0x458a('0x6d')]){_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,_0x458a('0x6b'),_0x458a('0x6e')+_0x541375[_0x458a('0x6d')]));}else{_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,'NoOp',_0x458a('0x6f')));}_0x4199a7['push'](new Extension(_0x397595,0x4,_0x458a('0x70'),_0x27d1f2[_0x458a('0x71')]+','+_0x458a('0x72')+(0x8+_0x541375[_0x458a('0x30')][_0x458a('0x3e')])+'}'+','+0x1));return _0x4199a7;}function formatPrefixName(_0x3d1d37){var _0x2c6a00='_';for(var _0x3745d5=0x0;_0x3745d5<_0x3d1d37[_0x458a('0x3e')];_0x3745d5++){if(_0x3d1d37[_0x458a('0x73')](_0x3745d5)=='-'){_0x2c6a00+=_0x3d1d37[_0x458a('0x73')](_0x3745d5);}else{_0x2c6a00+='['+_0x3d1d37[_0x458a('0x73')](_0x3745d5)+']';}}_0x2c6a00+='.';return _0x2c6a00;}exports[_0x458a('0x28')]=function(_0x435884,_0x3948aa,_0x2c131b){var _0x4c426a=_0x435884[_0x458a('0x74')];_0x4c426a['prefix']=_0x458a('0x75')+_0x4c426a[_0x458a('0x30')]+'-';return db['sequelize'][_0x458a('0x54')](function(_0xb028b3){return db[_0x458a('0x34')]['update'](_0x4c426a,{'where':{'id':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x2a')]({'where':{'VoicePrefixId':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x4f')]({'where':{'id':_0x4c426a['VoiceExtensionId']},'raw':!![]})[_0x458a('0x29')](function(_0x54abb1){return createVoicePrefixExtensions(_0x4c426a,_0x54abb1,_0xb028b3);});});});})['then'](function(){return db[_0x458a('0x34')][_0x458a('0x76')](_0x4c426a['id']);})[_0x458a('0x29')](respondWithResult(_0x3948aa,null))[_0x458a('0x50')](handleError(_0x3948aa,null));};exports[_0x458a('0x77')]=function(_0x434d04,_0x42eae7,_0x5aee0d){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x434d04[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x42eae7,null))[_0x458a('0x29')](function(_0x17398f){if(_0x17398f){return _0x17398f['addAgents'](_0x434d04['body']['ids'],_[_0x458a('0x78')](_0x434d04['body'],[_0x458a('0x79'),'id'])||{})[_0x458a('0x7a')](function(_0x46ef02){for(var _0x3d73d1=0x0;_0x3d73d1<_0x434d04[_0x458a('0x74')][_0x458a('0x79')][_0x458a('0x3e')];_0x3d73d1+=0x1){socket['emit'](_0x458a('0x7b'),{'UserId':Number(_0x434d04[_0x458a('0x74')]['ids'][_0x3d73d1]),'VoicePrefixId':Number(_0x434d04[_0x458a('0x4c')]['id'])});}return _0x46ef02;});}})['then'](respondWithResult(_0x42eae7,null))[_0x458a('0x50')](handleError(_0x42eae7,null));};exports['removeAgents']=function(_0x26b3f7,_0x177457,_0xce45b5){return db[_0x458a('0x34')]['find']({'where':{'id':_0x26b3f7[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x177457,null))[_0x458a('0x29')](function(_0x239e2f){if(_0x239e2f){return _0x239e2f[_0x458a('0x7c')](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])[_0x458a('0x29')](function(){if(_['isArray'](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])){for(var _0x12e367=0x0;_0x12e367<_0x26b3f7[_0x458a('0x39')]['ids'][_0x458a('0x3e')];_0x12e367+=0x1){socket[_0x458a('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')][_0x12e367]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}}else{socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':Number(_0x26b3f7['query'][_0x458a('0x79')]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}});}})[_0x458a('0x29')](respondWithStatusCode(_0x177457,null))[_0x458a('0x50')](handleError(_0x177457,null));};exports[_0x458a('0x7f')]=function(_0x46ac5c,_0x2eecf0,_0x573f46){var _0x1f9925={};var _0x4d3790={};var _0x396af9;var _0x36e650;return db[_0x458a('0x34')]['findOne']({'where':{'id':_0x46ac5c[_0x458a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2eecf0,null))['then'](function(_0x2574a3){if(_0x2574a3){_0x396af9=_0x2574a3;_0x4d3790[_0x458a('0x38')]=_['keys'](db['User'][_0x458a('0x35')]);_0x4d3790[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x46ac5c[_0x458a('0x39')]);_0x4d3790[_0x458a('0x3a')]=_['intersection'](_0x4d3790[_0x458a('0x38')],_0x4d3790['query']);_0x1f9925[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x4d3790[_0x458a('0x38')],qs['fields'](_0x46ac5c[_0x458a('0x39')][_0x458a('0x3d')]));_0x1f9925['attributes']=_0x1f9925[_0x458a('0x3c')]['length']?_0x1f9925[_0x458a('0x3c')]:_0x4d3790[_0x458a('0x38')];_0x1f9925[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x46ac5c['query'][_0x458a('0x42')]);_0x1f9925['where']=qs['filters'](_[_0x458a('0x44')](_0x46ac5c[_0x458a('0x39')],_0x4d3790[_0x458a('0x3a')]));if(_0x46ac5c[_0x458a('0x39')][_0x458a('0x46')]){_0x1f9925[_0x458a('0x43')]=_['merge'](_0x1f9925[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x1f9925[_0x458a('0x3c')],function(_0x222dcb){var _0x17099e={};_0x17099e[_0x222dcb]={'$like':'%'+_0x46ac5c[_0x458a('0x39')]['filter']+'%'};return _0x17099e;})});}_0x1f9925=_[_0x458a('0x45')]({},_0x1f9925,_0x46ac5c[_0x458a('0x47')]);return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})['then'](function(_0x2903c2){if(_0x2903c2){_0x36e650=_0x2903c2[_0x458a('0x3e')];if(!_0x46ac5c[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x1f9925[_0x458a('0x23')]=qs['limit'](_0x46ac5c['query']['limit']);_0x1f9925['offset']=qs['offset'](_0x46ac5c[_0x458a('0x39')]['offset']);}return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})[_0x458a('0x29')](function(_0x2adefe){if(_0x2adefe){return _0x2adefe?{'count':_0x36e650,'rows':_0x2adefe}:null;}})[_0x458a('0x29')](respondWithResult(_0x2eecf0,null))[_0x458a('0x50')](handleError(_0x2eecf0,null));};exports[_0x458a('0x80')]=function(_0x555190,_0x11ebe7,_0x59ad9c){var _0x24b1ee={};var _0x4e1d44={};var _0x23428c;var _0x333d74;return db['VoicePrefix']['findOne']({'where':{'id':_0x555190['params']['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x11ebe7,null))[_0x458a('0x29')](function(_0x21d8a9){if(_0x21d8a9){_0x23428c=_0x21d8a9;_0x4e1d44[_0x458a('0x38')]=_[_0x458a('0x4d')](db['Team'][_0x458a('0x35')]);_0x4e1d44[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x555190[_0x458a('0x39')]);_0x4e1d44[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],_0x4e1d44[_0x458a('0x39')]);_0x24b1ee['attributes']=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x555190[_0x458a('0x39')][_0x458a('0x3d')]));_0x24b1ee[_0x458a('0x3c')]=_0x24b1ee[_0x458a('0x3c')]['length']?_0x24b1ee['attributes']:_0x4e1d44['model'];_0x24b1ee['order']=qs[_0x458a('0x42')](_0x555190[_0x458a('0x39')][_0x458a('0x42')]);_0x24b1ee[_0x458a('0x43')]=qs['filters'](_[_0x458a('0x44')](_0x555190[_0x458a('0x39')],_0x4e1d44[_0x458a('0x3a')]));if(_0x555190[_0x458a('0x39')]['filter']){_0x24b1ee['where']=_[_0x458a('0x45')](_0x24b1ee[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x24b1ee[_0x458a('0x3c')],function(_0x4ff826){var _0xbb80ab={};_0xbb80ab[_0x4ff826]={'$like':'%'+_0x555190[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0xbb80ab;})});}_0x24b1ee=_[_0x458a('0x45')]({},_0x24b1ee,_0x555190[_0x458a('0x47')]);return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})[_0x458a('0x29')](function(_0xd05241){if(_0xd05241){_0x333d74=_0xd05241[_0x458a('0x3e')];if(!_0x555190[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x24b1ee[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x555190[_0x458a('0x39')][_0x458a('0x23')]);_0x24b1ee[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x555190[_0x458a('0x39')]['offset']);}return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})['then'](function(_0x165b0d){if(_0x165b0d){return _0x165b0d?{'count':_0x333d74,'rows':_0x165b0d}:null;}})[_0x458a('0x29')](respondWithResult(_0x11ebe7,null))[_0x458a('0x50')](handleError(_0x11ebe7,null));};exports['addTeams']=function(_0x589496,_0x4ee34,_0x1c9f4c){var _0x241c72=_0x589496[_0x458a('0x74')][_0x458a('0x79')];var _0x53d065;return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x241c72},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id',_0x458a('0x30'),_0x458a('0x84'),_0x458a('0x85'),_0x458a('0x86')],'raw':!![]}]})[_0x458a('0x29')](function(_0x52b844){if(_0x52b844){_0x53d065=_0x52b844;var _0x3051d2=_['flatMap'](_0x52b844,function(_0x2e496b){var _0x442b4a=_0x2e496b[_0x458a('0x2b')]({'plain':!![]});return _0x442b4a['Agents'];});return db['VoicePrefix'][_0x458a('0x4f')]({'where':{'id':_0x589496['params']['id']}})[_0x458a('0x29')](function(_0x5d97cc){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x1b8558){return _0x5d97cc['addTeams'](_0x241c72,{'transaction':_0x1b8558})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x53d065,function(_0x5dbeed){return db[_0x458a('0x88')]['upsert']({'TeamId':_0x5dbeed['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},{'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x3051d2,function(_0x49bdfc){return db[_0x458a('0x89')][_0x458a('0x8a')]({'where':{'UserId':_0x49bdfc['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){_0x3051d2[_0x458a('0x8b')](function(_0x477402){socket['emit'](_0x458a('0x7b'),{'UserId':_0x477402['id'],'VoicePrefixId':_0x5d97cc['id']});});});});});}})[_0x458a('0x29')](respondWithStatusCode(_0x4ee34,null))['catch'](handleError(_0x4ee34,null));};exports[_0x458a('0x8c')]=function(_0x187bc8,_0x197858,_0x48622f){return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x187bc8[_0x458a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id'],'raw':!![]}]})[_0x458a('0x29')](handleEntityNotFound(_0x197858,null))[_0x458a('0x29')](function(_0x2334f3){var _0x46bfc7=_[_0x458a('0x33')](_0x2334f3,'id');var _0x43cb92=[];var _0x5c42a4=[];var _0x3c3c7b=squel['select']();_0x3c3c7b['field'](_0x458a('0x8d'))[_0x458a('0x8e')]('team_has_voice_prefixes','tq')[_0x458a('0x8f')]('user_has_teams','ut',_0x458a('0x90'))['where'](_0x458a('0x91'),_0x187bc8[_0x458a('0x4c')]['id']);for(var _0x20ad0b=0x0;_0x20ad0b<_0x2334f3[_0x458a('0x3e')];_0x20ad0b+=0x1){let _0x55eab3=_0x2334f3[_0x20ad0b];for(var _0x4677a6=0x0;_0x4677a6<_0x55eab3[_0x458a('0x83')][_0x458a('0x3e')];_0x4677a6+=0x1){let _0x4df0b4=_0x55eab3[_0x458a('0x83')][_0x4677a6];var _0xfd1b68=_0x3c3c7b[_0x458a('0x92')]();_0xfd1b68[_0x458a('0x43')]('ut.UserId\x20=\x20?',_0x4df0b4['id']);_0x5c42a4[_0x458a('0x6a')](db['sequelize']['query'](_0xfd1b68['toString'](),{'type':db[_0x458a('0x53')][_0x458a('0x93')]['SELECT']})[_0x458a('0x29')](function(_0x49297c){if(_0x49297c[_0x458a('0x3e')]===0x1){return _0x4df0b4['id'];}else{var _0x4bfd6b=_[_0x458a('0x94')](_['map'](_0x49297c,_0x458a('0x95')),function(_0x3c9685){return _[_0x458a('0x96')](_0x46bfc7,_0x3c9685);});if(_0x4bfd6b){return _0x4df0b4['id'];}}}));}}return BPromise[_0x458a('0x97')](_0x5c42a4)[_0x458a('0x29')](function(_0x2e24aa){_0x43cb92=_(_0x43cb92)[_0x458a('0x98')](_0x2e24aa)['compact']()[_0x458a('0x99')]();return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x187bc8['params']['id']}})['then'](function(_0x334129){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x330330){return _0x334129[_0x458a('0x8c')](_0x187bc8['query'][_0x458a('0x79')],{'transaction':_0x330330})[_0x458a('0x29')](function(){if(!_[_0x458a('0x9a')](_0x43cb92)){return _0x334129[_0x458a('0x7c')](_0x43cb92,{'transaction':_0x330330});}})[_0x458a('0x29')](function(){_0x43cb92['forEach'](function(_0x16a747){socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':_0x16a747,'VoicePrefixId':_0x334129['id']});});});});});});})[_0x458a('0x29')](respondWithStatusCode(_0x197858,null))[_0x458a('0x50')](handleError(_0x197858,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1942072..5e53e5a 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff66=['VoicePrefix','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f8e44,_0x25e114){var _0x57b567=function(_0x233b43){while(--_0x233b43){_0x2f8e44['push'](_0x2f8e44['shift']());}};_0x57b567(++_0x25e114);}(_0xff66,0x7d));var _0x6ff6=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xff66[_0x26b5ff];return _0x58603e;};'use strict';var EventEmitter=require(_0x6ff6('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x6ff6('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6ff6('0x2'),'afterUpdate':_0x6ff6('0x3'),'afterDestroy':_0x6ff6('0x4')};function emitEvent(_0x5ec705){return function(_0x174eaa,_0x4e09f6,_0x3815de){VoicePrefixEvents['emit'](_0x5ec705+':'+_0x174eaa['id'],_0x174eaa);VoicePrefixEvents[_0x6ff6('0x5')](_0x5ec705,_0x174eaa);_0x3815de(null);};}for(var e in events){if(events[_0x6ff6('0x6')](e)){var event=events[e];VoicePrefix[_0x6ff6('0x7')](e,emitEvent(event));}}module[_0x6ff6('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xf75c=['emit','hasOwnProperty','hook','exports','events','VoicePrefix','save','update','remove'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0xf75c,0xc1));var _0xcf75=function(_0x5a6393,_0x569c16){_0x5a6393=_0x5a6393-0x0;var _0x411967=_0xf75c[_0x5a6393];return _0x411967;};'use strict';var EventEmitter=require(_0xcf75('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xcf75('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf75('0x2'),'afterUpdate':_0xcf75('0x3'),'afterDestroy':_0xcf75('0x4')};function emitEvent(_0xe183bc){return function(_0x23a827,_0x5a0b04,_0x503e0b){VoicePrefixEvents[_0xcf75('0x5')](_0xe183bc+':'+_0x23a827['id'],_0x23a827);VoicePrefixEvents[_0xcf75('0x5')](_0xe183bc,_0x23a827);_0x503e0b(null);};}for(var e in events){if(events[_0xcf75('0x6')](e)){var event=events[e];VoicePrefix[_0xcf75('0x7')](e,emitEvent(event));}}module[_0xcf75('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 1e93311..64e2747 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5116=['rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','util','api','bluebird','request-promise','path'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x5116,0x1c9));var _0x6511=function(_0xadf085,_0x578770){_0xadf085=_0xadf085-0x0;var _0x124df8=_0x5116[_0xadf085];return _0x124df8;};'use strict';var _=require('lodash');var util=require(_0x6511('0x0'));var logger=require('../../config/logger')(_0x6511('0x1'));var moment=require('moment');var BPromise=require(_0x6511('0x2'));var rp=require(_0x6511('0x3'));var fs=require('fs');var path=require(_0x6511('0x4'));var rimraf=require(_0x6511('0x5'));var config=require(_0x6511('0x6'));var attributes=require(_0x6511('0x7'));module[_0x6511('0x8')]=function(_0x54b76b,_0x117ed9){return _0x54b76b['define'](_0x6511('0x9'),attributes,{'tableName':_0x6511('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x116d=['path','rimraf','../../config/environment','exports','define','voice_prefixes','lodash','../../config/logger','moment','bluebird'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x116d,0x13c));var _0xd116=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x116d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd116('0x0'));var util=require('util');var logger=require(_0xd116('0x1'))('api');var moment=require(_0xd116('0x2'));var BPromise=require(_0xd116('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd116('0x4'));var rimraf=require(_0xd116('0x5'));var config=require(_0xd116('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xd116('0x7')]=function(_0x5f546c,_0x4f1542){return _0x5f546c[_0xd116('0x8')]('VoicePrefix',attributes,{'tableName':_0xd116('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 005c077..aed42b2 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d07=['../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x2d07,0x13a));var _0x72d0=function(_0x4b9b78,_0x1dc74a){_0x4b9b78=_0x4b9b78-0x0;var _0x330388=_0x2d07[_0x4b9b78];return _0x330388;};'use strict';var _=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var moment=require('moment');var BPromise=require(_0x72d0('0x2'));var rs=require(_0x72d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d0('0x4'))['db'];var utils=require(_0x72d0('0x5'));var logger=require(_0x72d0('0x6'))(_0x72d0('0x7'));var config=require(_0x72d0('0x8'));var jayson=require(_0x72d0('0x9'));var client=jayson['client'][_0x72d0('0xa')]({'port':0x232a});config[_0x72d0('0xb')]=_[_0x72d0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x72d0('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0xb6293,_0x4116c1,_0x1d8102){return new BPromise(function(_0x36c904,_0x4b545f){return client['request'](_0xb6293,_0x1d8102)['then'](function(_0x17f795){logger[_0x72d0('0xe')](_0x72d0('0xf'),_0x4116c1,_0x72d0('0x10'));logger[_0x72d0('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4116c1,_0x72d0('0x10'),JSON[_0x72d0('0x12')](_0x17f795));if(_0x17f795[_0x72d0('0x13')]){if(_0x17f795['error'][_0x72d0('0x14')]===0x1f4){logger[_0x72d0('0x13')](_0x72d0('0xf'),_0x4116c1,_0x17f795[_0x72d0('0x13')][_0x72d0('0x15')]);return _0x4b545f(_0x17f795[_0x72d0('0x13')]['message']);}logger[_0x72d0('0x13')](_0x72d0('0xf'),_0x4116c1,_0x17f795[_0x72d0('0x13')][_0x72d0('0x15')]);return _0x36c904(_0x17f795[_0x72d0('0x13')][_0x72d0('0x15')]);}else{logger[_0x72d0('0xe')](_0x72d0('0xf'),_0x4116c1,_0x72d0('0x10'));_0x36c904(_0x17f795['result'][_0x72d0('0x15')]);}})[_0x72d0('0x16')](function(_0x2cd4aa){logger[_0x72d0('0x13')](_0x72d0('0xf'),_0x4116c1,_0x2cd4aa);_0x4b545f(_0x2cd4aa);});});} \ No newline at end of file +var _0xef66=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','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','lodash'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xef66,0x1db));var _0x6ef6=function(_0x22f03c,_0x56a13e){_0x22f03c=_0x22f03c-0x0;var _0x531a6b=_0xef66[_0x22f03c];return _0x531a6b;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var moment=require(_0x6ef6('0x2'));var BPromise=require(_0x6ef6('0x3'));var rs=require(_0x6ef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ef6('0x5'));var logger=require(_0x6ef6('0x6'))(_0x6ef6('0x7'));var config=require(_0x6ef6('0x8'));var jayson=require(_0x6ef6('0x9'));var client=jayson[_0x6ef6('0xa')][_0x6ef6('0xb')]({'port':0x232a});config[_0x6ef6('0xc')]=_[_0x6ef6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ef6('0xe'))(new Redis(config[_0x6ef6('0xc')]));require(_0x6ef6('0xf'))[_0x6ef6('0x10')](socket);function respondWithRpcPromise(_0xc0ace,_0x49fed5,_0x1c719e){return new BPromise(function(_0x4bf459,_0x53db5e){return client[_0x6ef6('0x11')](_0xc0ace,_0x1c719e)['then'](function(_0x107bb4){logger[_0x6ef6('0x12')](_0x6ef6('0x13'),_0x49fed5,_0x6ef6('0x14'));logger['debug'](_0x6ef6('0x15'),_0x49fed5,_0x6ef6('0x14'),JSON[_0x6ef6('0x16')](_0x107bb4));if(_0x107bb4[_0x6ef6('0x17')]){if(_0x107bb4['error'][_0x6ef6('0x18')]===0x1f4){logger['error'](_0x6ef6('0x13'),_0x49fed5,_0x107bb4[_0x6ef6('0x17')]['message']);return _0x53db5e(_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);}logger[_0x6ef6('0x17')](_0x6ef6('0x13'),_0x49fed5,_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);return _0x4bf459(_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);}else{logger[_0x6ef6('0x12')](_0x6ef6('0x13'),_0x49fed5,'request\x20sent');_0x4bf459(_0x107bb4[_0x6ef6('0x1a')][_0x6ef6('0x19')]);}})[_0x6ef6('0x1b')](function(_0x37d2ef){logger[_0x6ef6('0x17')](_0x6ef6('0x13'),_0x49fed5,_0x37d2ef);_0x53db5e(_0x37d2ef);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f89afda..ad3c19f 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd3a=['save','remove','update','emit','removeListener','length','./voicePrefix.events'];(function(_0x242ee8,_0x18b946){var _0x1c5740=function(_0x19d135){while(--_0x19d135){_0x242ee8['push'](_0x242ee8['shift']());}};_0x1c5740(++_0x18b946);}(_0xfd3a,0x179));var _0xafd3=function(_0xae0b69,_0x2bd756){_0xae0b69=_0xae0b69-0x0;var _0x5e183e=_0xfd3a[_0xae0b69];return _0x5e183e;};'use strict';var VoicePrefixEvents=require(_0xafd3('0x0'));var events=[_0xafd3('0x1'),_0xafd3('0x2'),_0xafd3('0x3')];function createListener(_0x4ce05e,_0x488608){return function(_0x160b0d){_0x488608[_0xafd3('0x4')](_0x4ce05e,_0x160b0d);};}function removeListener(_0x328118,_0x415217){return function(){VoicePrefixEvents[_0xafd3('0x5')](_0x328118,_0x415217);};}exports['register']=function(_0x9db715){for(var _0x1a72eb=0x0,_0x1f7e16=events[_0xafd3('0x6')];_0x1a72eb<_0x1f7e16;_0x1a72eb++){var _0xd2d780=events[_0x1a72eb];var _0x4c4dcd=createListener('voicePrefix:'+_0xd2d780,_0x9db715);VoicePrefixEvents['on'](_0xd2d780,_0x4c4dcd);}}; \ No newline at end of file +var _0x8721=['./voicePrefix.events','save','remove','removeListener','register','length','voicePrefix:'];(function(_0x85ff04,_0x1c2e9a){var _0x3ddd4b=function(_0x52c84b){while(--_0x52c84b){_0x85ff04['push'](_0x85ff04['shift']());}};_0x3ddd4b(++_0x1c2e9a);}(_0x8721,0xd9));var _0x1872=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x8721[_0x50f392];return _0x5926f2;};'use strict';var VoicePrefixEvents=require(_0x1872('0x0'));var events=[_0x1872('0x1'),_0x1872('0x2'),'update'];function createListener(_0x4edc0b,_0x43f8e9){return function(_0x532ce1){_0x43f8e9['emit'](_0x4edc0b,_0x532ce1);};}function removeListener(_0x50a1c5,_0x40690e){return function(){VoicePrefixEvents[_0x1872('0x3')](_0x50a1c5,_0x40690e);};}exports[_0x1872('0x4')]=function(_0x47ca3a){for(var _0x4befaf=0x0,_0x2dc064=events[_0x1872('0x5')];_0x4befaf<_0x2dc064;_0x4befaf++){var _0x4230d7=events[_0x4befaf];var _0x4d019e=createListener(_0x1872('0x6')+_0x4230d7,_0x47ca3a);VoicePrefixEvents['on'](_0x4230d7,_0x4d019e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6c8e7a2..1abf07c 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x4ba102,_0x3dc213){var _0x1f35e7=function(_0xceae5a){while(--_0xceae5a){_0x4ba102['push'](_0x4ba102['shift']());}};_0x1f35e7(++_0x3dc213);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0xb10b,0x12a));var _0xbb10=function(_0xd8a448,_0x25c7a2){_0xd8a448=_0xd8a448-0x0;var _0x4771df=_0xb10b[_0xd8a448];return _0x4771df;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 6f7778a..ac286e3 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8371=['Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','leastrecent','rrmemory','linear','wrandom','rrordered','ringall','strategy','getDataValue','preview','booked','roundrobin','includes','setDataValue','INTEGER','yes','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','Active/Disactive\x20Campaign','progressive','power'];(function(_0x418209,_0x29858e){var _0x17e00d=function(_0x5a3f4d){while(--_0x5a3f4d){_0x418209['push'](_0x418209['shift']());}};_0x17e00d(++_0x29858e);}(_0x8371,0x123));var _0x1837=function(_0x2aa1c1,_0x223b3e){_0x2aa1c1=_0x2aa1c1-0x0;var _0x449db7=_0x8371[_0x2aa1c1];return _0x449db7;};'use strict';var Sequelize=require(_0x1837('0x0'));module[_0x1837('0x1')]={'name':{'type':Sequelize[_0x1837('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x4'),_0x1837('0x5')),'allowNull':![],'defaultValue':_0x1837('0x4')},'musiconhold':{'type':Sequelize[_0x1837('0x2')],'defaultValue':_0x1837('0x6')},'announce':{'type':Sequelize[_0x1837('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1837('0x3')]('rr','ringall',_0x1837('0x7'),'fewestcalls','random',_0x1837('0x8'),_0x1837('0x9'),_0x1837('0xa'),_0x1837('0xb')),'allowNull':![],'defaultValue':_0x1837('0xc'),'set':function(_0x2407ef){this['setDataValue'](_0x1837('0xd'),_0x2407ef?_0x2407ef:_0x1837('0x8'));},'get':function(){var _0x2567ee=this['getDataValue']('type');var _0x4f85a2=this[_0x1837('0xe')]('dialMethod');var _0x5b5505=this[_0x1837('0xe')](_0x1837('0xd'));if(_0x2567ee==='outbound'){if(_0x4f85a2===_0x1837('0xf')){return null;}if(_0x4f85a2===_0x1837('0x10')&&![_0x1837('0x8'),_0x1837('0x11')][_0x1837('0x12')](_0x5b5505)){this[_0x1837('0x13')](_0x1837('0xd'),_0x1837('0x8'));}}return _0x5b5505;}},'servicelevel':{'type':Sequelize[_0x1837('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1837('0x14')](0xb)},'timeout':{'type':Sequelize[_0x1837('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1837('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1837('0x2')]},'weight':{'type':Sequelize[_0x1837('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no'),'defaultValue':_0x1837('0x15')},'autopause':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1837('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x1837('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x1837('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1837('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1837('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1837('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no'),'defaultValue':_0x1837('0x15')},'announce_holdtime':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no',_0x1837('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1837('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x1837('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1837('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1837('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1837('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1837('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1837('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1837('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1837('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1837('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1837('0x2')]},'queue_quantity1':{'type':Sequelize[_0x1837('0x2')]},'queue_quantity2':{'type':Sequelize[_0x1837('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x246460){this[_0x1837('0x13')]('periodic_announce',_0x246460?_0x246460[_0x1837('0x17')](','):[]);},'get':function(){return this[_0x1837('0xe')](_0x1837('0x18'))?this[_0x1837('0xe')](_0x1837('0x18'))[_0x1837('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x1837('0x2')],'defaultValue':_0x1837('0x15'),'set':function(_0x46135b){this[_0x1837('0x13')]('joinempty',_0x46135b?_0x46135b['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x1837('0x1a'))?this[_0x1837('0xe')]('joinempty')[_0x1837('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1837('0x2')],'defaultValue':'no','set':function(_0x412593){this[_0x1837('0x13')]('leavewhenempty',_0x412593?_0x412593[_0x1837('0x17')](','):undefined);},'get':function(){return this['getDataValue'](_0x1837('0x1b'))?this[_0x1837('0xe')](_0x1837('0x1b'))[_0x1837('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1837('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x1837('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1837('0x2')]},'description':{'type':Sequelize[_0x1837('0x2')]},'acw':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':0x0,'set':function(_0x5b048f){this[_0x1837('0x13')](_0x1837('0x1d'),_0x5b048f);if(_0x5b048f){if(this['getDataValue']('wrapuptime')<0x2){this[_0x1837('0x13')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1837('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':0x0,'comment':_0x1837('0x1e')},'dialMethod':{'type':Sequelize[_0x1837('0x3')](_0x1837('0xf'),_0x1837('0x1f'),_0x1837('0x20'),'predictive',_0x1837('0x10')),'defaultValue':_0x1837('0x1f'),'comment':_0x1837('0x21')},'dialLimitChannel':{'type':Sequelize[_0x1837('0x14')](0x4)[_0x1837('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1837('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x1837('0x24')](0x2)[_0x1837('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1837('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x26'),_0x1837('0x27')),'defaultValue':_0x1837('0x27'),'comment':_0x1837('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1837('0x24')](0x2)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1837('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1837('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1837('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1837('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1837('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x1837('0x2')],'defaultValue':_0x1837('0x2c'),'comment':_0x1837('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x1837('0x2')],'comment':_0x1837('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1837('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1837('0x14')](0x5)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1837('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1837('0x14')](0x5)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1837('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x3,'comment':_0x1837('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1837('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1837('0x34')},'dialTimezone':{'type':Sequelize[_0x1837('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1837('0x2')],'defaultValue':_0x1837('0x35')},'dialPrefix':{'type':Sequelize[_0x1837('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1837('0x36'),_0x1837('0x37'),_0x1837('0x38')),'defaultValue':_0x1837('0x36')},'dialAMDActive':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':0x0,'comment':_0x1837('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x1837('0x14')](0x9)[_0x1837('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1837('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x1837('0x14')](0x9)[_0x1837('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1837('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1837('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1837('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1837('0x14')](0x9)[_0x1837('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1837('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x1837('0x14')](0x9)[_0x1837('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1837('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1837('0x14')](0x9)[_0x1837('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1837('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1837('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1837('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1837('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1837('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x1837('0x14')](0x5)[_0x1837('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1837('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1837('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1837('0x3')](_0x1837('0x43'),_0x1837('0x44')),'defaultValue':_0x1837('0x43')},'dialQueueProject2':{'type':Sequelize[_0x1837('0x2')],'comment':_0x1837('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1837('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1837('0x45')},'dialCutDigit':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1837('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1837('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1837('0x14')](0x5)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1837('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1837('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1837('0x14')](0x5)[_0x1837('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1837('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1837('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1837('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1837('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1837('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x1837('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':![],'comment':_0x1837('0x4e'),'set':function(_0x190d42){if(!_0x190d42)this[_0x1837('0x13')](_0x1837('0x4f'),null);this[_0x1837('0x13')](_0x1837('0x50'),_0x190d42);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1837('0x14')](0x3)[_0x1837('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1837('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x1837('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1837('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0x7bc8=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','getDataValue','type','strategy','outbound','booked','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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)'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x7bc8,0x1ac));var _0x87bc=function(_0x525c40,_0x37d16d){_0x525c40=_0x525c40-0x0;var _0x209f7f=_0x7bc8[_0x525c40];return _0x209f7f;};'use strict';var Sequelize=require(_0x87bc('0x0'));module[_0x87bc('0x1')]={'name':{'type':Sequelize[_0x87bc('0x2')],'allowNull':![],'unique':_0x87bc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x87bc('0x5')},'musiconhold':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':_0x87bc('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x87bc('0x4')]('rr','ringall','leastrecent',_0x87bc('0x7'),_0x87bc('0x8'),_0x87bc('0x9'),_0x87bc('0xa'),_0x87bc('0xb'),_0x87bc('0xc')),'allowNull':![],'defaultValue':_0x87bc('0xd'),'set':function(_0x53a19e){this[_0x87bc('0xe')]('strategy',_0x53a19e?_0x53a19e:'rrmemory');},'get':function(){var _0x55e849=this[_0x87bc('0xf')](_0x87bc('0x10'));var _0x40ce15=this[_0x87bc('0xf')]('dialMethod');var _0x372528=this[_0x87bc('0xf')](_0x87bc('0x11'));if(_0x55e849===_0x87bc('0x12')){if(_0x40ce15==='preview'){return null;}if(_0x40ce15===_0x87bc('0x13')&&![_0x87bc('0x9'),'roundrobin'][_0x87bc('0x14')](_0x372528)){this[_0x87bc('0xe')](_0x87bc('0x11'),'rrmemory');}}return _0x372528;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x87bc('0x15')](0xb)},'timeout':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x87bc('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x87bc('0x16'),'no',_0x87bc('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x87bc('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x87bc('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':_0x87bc('0x16')},'announce_holdtime':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no',_0x87bc('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x87bc('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x87bc('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x87bc('0x2')]},'queue_youarenext':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x87bc('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x87bc('0x2')]},'queue_quantity1':{'type':Sequelize[_0x87bc('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x87bc('0x2')]},'queue_less_than':{'type':Sequelize[_0x87bc('0x2')]},'periodic_announce':{'type':Sequelize[_0x87bc('0x19')],'set':function(_0x4155ca){this['setDataValue']('periodic_announce',_0x4155ca?_0x4155ca[_0x87bc('0x1a')](','):[]);},'get':function(){return this[_0x87bc('0xf')](_0x87bc('0x1b'))?this[_0x87bc('0xf')](_0x87bc('0x1b'))[_0x87bc('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':_0x87bc('0x16'),'set':function(_0x3f0b33){this['setDataValue']('joinempty',_0x3f0b33?_0x3f0b33['join'](','):undefined);},'get':function(){return this[_0x87bc('0xf')](_0x87bc('0x1d'))?this[_0x87bc('0xf')](_0x87bc('0x1d'))[_0x87bc('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':'no','set':function(_0x2b72a7){this['setDataValue'](_0x87bc('0x1e'),_0x2b72a7?_0x2b72a7[_0x87bc('0x1a')](','):undefined);},'get':function(){return this[_0x87bc('0xf')](_0x87bc('0x1e'))?this[_0x87bc('0xf')]('leavewhenempty')[_0x87bc('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'set':function(_0x273e26){this[_0x87bc('0xe')](_0x87bc('0x20'),_0x273e26);if(_0x273e26){if(this[_0x87bc('0xf')](_0x87bc('0x21'))<0x2){this[_0x87bc('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x22'),_0x87bc('0x23'),_0x87bc('0x24'),'predictive',_0x87bc('0x13')),'defaultValue':_0x87bc('0x23'),'comment':_0x87bc('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x87bc('0x26')},'dialLimitQueue':{'type':Sequelize[_0x87bc('0x15')](0x4)[_0x87bc('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x87bc('0x28')},'dialPowerLevel':{'type':Sequelize[_0x87bc('0x29')](0x2)[_0x87bc('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x87bc('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x2b'),_0x87bc('0x2c')),'defaultValue':_0x87bc('0x2c'),'comment':_0x87bc('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x87bc('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x87bc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x87bc('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x87bc('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':_0x87bc('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x31')},'dialQueueProject':{'type':Sequelize[_0x87bc('0x2')],'comment':_0x87bc('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'comment':_0x87bc('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x87bc('0x38')},'dialTimezone':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x39'),_0x87bc('0x3a'),_0x87bc('0x3b')),'defaultValue':_0x87bc('0x39')},'dialAMDActive':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'comment':_0x87bc('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x87bc('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x87bc('0x3d')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x87bc('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x87bc('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x87bc('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x87bc('0x40')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x87bc('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x87bc('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x87bc('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x87bc('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x87bc('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x87bc('0x44')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x87bc('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'comment':_0x87bc('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x87bc('0x4')]('DESC',_0x87bc('0x46')),'defaultValue':_0x87bc('0x47')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x87bc('0x48')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x87bc('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x87bc('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x87bc('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':![],'comment':_0x87bc('0x52'),'set':function(_0x20a2af){if(!_0x20a2af)this[_0x87bc('0xe')]('mandatoryDispositionPauseId',null);this[_0x87bc('0xe')](_0x87bc('0x53'),_0x20a2af);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x87bc('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a32f77d..1130332 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1fa=['model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','userProfileId','getHoppers','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','transaction','each','upsert','findOrCreate','isNil','format','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','spread','voicePause','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ListId','scheduledAt','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','value','includes','find','type','name','UserProfileResource','end','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','key'];(function(_0x1efa26,_0x2a2295){var _0x4bdc5f=function(_0x155bee){while(--_0x155bee){_0x1efa26['push'](_0x1efa26['shift']());}};_0x4bdc5f(++_0x2a2295);}(_0xc1fa,0x83));var _0xac1f=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xc1fa[_0x39f34f];return _0x59fee1;};'use strict';var emlformat=require(_0xac1f('0x0'));var rimraf=require(_0xac1f('0x1'));var zipdir=require(_0xac1f('0x2'));var jsonpatch=require(_0xac1f('0x3'));var rp=require(_0xac1f('0x4'));var moment=require(_0xac1f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xac1f('0x6'));var util=require(_0xac1f('0x7'));var path=require(_0xac1f('0x8'));var sox=require(_0xac1f('0x9'));var csv=require(_0xac1f('0xa'));var ejs=require(_0xac1f('0xb'));var fs=require('fs');var fs_extra=require(_0xac1f('0xc'));var _=require(_0xac1f('0xd'));var squel=require(_0xac1f('0xe'));var crypto=require(_0xac1f('0xf'));var jsforce=require(_0xac1f('0x10'));var deskjs=require(_0xac1f('0x11'));var toCsv=require('to-csv');var querystring=require(_0xac1f('0x12'));var Papa=require(_0xac1f('0x13'));var Redis=require(_0xac1f('0x14'));var authService=require(_0xac1f('0x15'));var qs=require(_0xac1f('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xac1f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xac1f('0x18'));var licenseUtil=require(_0xac1f('0x19'));var db=require('../../mysqldb')['db'];config[_0xac1f('0x1a')]=_[_0xac1f('0x1b')](config[_0xac1f('0x1a')],{'host':_0xac1f('0x1c'),'port':0x18eb});var socket=require(_0xac1f('0x1d'))(new Redis(config[_0xac1f('0x1a')]));require(_0xac1f('0x1e'))[_0xac1f('0x1f')](socket);function respondWithStatusCode(_0x2c7411,_0x1ab6dc){_0x1ab6dc=_0x1ab6dc||0xcc;return function(_0x38bb3a){if(_0x38bb3a){return _0x2c7411[_0xac1f('0x20')](_0x1ab6dc);}return _0x2c7411[_0xac1f('0x21')](_0x1ab6dc)['end']();};}function respondWithResult(_0xeeff2e,_0x1c7610){_0x1c7610=_0x1c7610||0xc8;return function(_0x6f5a10){if(_0x6f5a10){return _0xeeff2e['status'](_0x1c7610)[_0xac1f('0x22')](_0x6f5a10);}};}function respondWithFilteredResult(_0x5c7847,_0xb825f3){return function(_0x1c5e74){if(_0x1c5e74){var _0x120b4e=typeof _0xb825f3[_0xac1f('0x23')]==='undefined'&&typeof _0xb825f3[_0xac1f('0x24')]===_0xac1f('0x25');var _0x558519=_0x1c5e74[_0xac1f('0x26')];var _0x4b5c14=_0x120b4e?0x0:_0xb825f3[_0xac1f('0x23')];var _0x3ce2fa=_0x120b4e?_0x1c5e74[_0xac1f('0x26')]:_0xb825f3[_0xac1f('0x23')]+_0xb825f3[_0xac1f('0x24')];var _0x1d1158;if(_0x3ce2fa>=_0x558519){_0x3ce2fa=_0x558519;_0x1d1158=0xc8;}else{_0x1d1158=0xce;}_0x5c7847[_0xac1f('0x21')](_0x1d1158);return _0x5c7847[_0xac1f('0x27')]('Content-Range',_0x4b5c14+'-'+_0x3ce2fa+'/'+_0x558519)['json'](_0x1c5e74);}return null;};}function patchUpdates(_0x3a773a){return function(_0x3a56ff){try{jsonpatch[_0xac1f('0x28')](_0x3a56ff,_0x3a773a,!![]);}catch(_0x4107dd){return BPromise[_0xac1f('0x29')](_0x4107dd);}return _0x3a56ff[_0xac1f('0x2a')]();};}function saveUpdates(_0x3a991f,_0x494021){return function(_0x46048f){if(_0x46048f){return _0x46048f[_0xac1f('0x2b')](_0x3a991f)[_0xac1f('0x2c')](function(_0x5b69ce){return _0x5b69ce;});}return null;};}function removeEntity(_0x479293,_0x25f1fd){return function(_0x3dab27){if(_0x3dab27){return _0x3dab27[_0xac1f('0x2d')]()[_0xac1f('0x2c')](function(){var _0x1f1472=_0x3dab27[_0xac1f('0x2e')]({'plain':!![]});var _0x381046=[{'name':_0xac1f('0x2f'),'value':_0xac1f('0x30'),'ignore':![]},{'name':'QueueCampaigns','value':_0xac1f('0x31'),'ignore':![]}];var _0x28216e=_(_0x381046)[_0xac1f('0x32')]('ignore')['map'](_0xac1f('0x33'))[_0xac1f('0x33')]();if(_[_0xac1f('0x34')](_0x28216e,_0x1f1472['type'])){return;}var _0x59d945=_[_0xac1f('0x35')](_0x381046,[_0xac1f('0x33'),_0x1f1472[_0xac1f('0x36')]])[_0xac1f('0x37')];return db[_0xac1f('0x38')][_0xac1f('0x2d')]({'where':{'type':_0x59d945,'resourceId':_0x1f1472['id']}})[_0xac1f('0x2c')](function(){return _0x3dab27;});})[_0xac1f('0x2c')](function(){_0x479293[_0xac1f('0x21')](0xcc)[_0xac1f('0x39')]();});}};}function handleEntityNotFound(_0x3464a4,_0x2cce9f){return function(_0x3f9faf){if(!_0x3f9faf){_0x3464a4[_0xac1f('0x20')](0x194);}return _0x3f9faf;};}function handleError(_0x1bb37a,_0x1bf6d0){_0x1bf6d0=_0x1bf6d0||0x1f4;return function(_0x1c0111){logger['error'](_0x1c0111[_0xac1f('0x3a')]);if(_0x1c0111[_0xac1f('0x37')]){delete _0x1c0111[_0xac1f('0x37')];}_0x1bb37a['status'](_0x1bf6d0)[_0xac1f('0x3b')](_0x1c0111);};}exports[_0xac1f('0x3c')]=function(_0x1c461a,_0xfc5dbe){var _0x3f7847={},_0x4a8d06={},_0x2777ca={'count':0x0,'rows':[]};var _0x1a94e6=_[_0xac1f('0x3d')](db[_0xac1f('0x3e')][_0xac1f('0x3f')],function(_0x1e3e7e){return{'name':_0x1e3e7e[_0xac1f('0x40')],'type':_0x1e3e7e[_0xac1f('0x36')][_0xac1f('0x41')]};});_0x4a8d06[_0xac1f('0x42')]=_[_0xac1f('0x3d')](_0x1a94e6,_0xac1f('0x37'));_0x4a8d06[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x1c461a[_0xac1f('0x43')]);_0x4a8d06[_0xac1f('0x45')]=_['intersection'](_0x4a8d06['model'],_0x4a8d06[_0xac1f('0x43')]);_0x3f7847[_0xac1f('0x46')]=_[_0xac1f('0x47')](_0x4a8d06['model'],qs[_0xac1f('0x48')](_0x1c461a[_0xac1f('0x43')][_0xac1f('0x48')]));_0x3f7847[_0xac1f('0x46')]=_0x3f7847[_0xac1f('0x46')][_0xac1f('0x49')]?_0x3f7847['attributes']:_0x4a8d06['model'];if(!_0x1c461a['query']['hasOwnProperty']('nolimit')){_0x3f7847['limit']=qs[_0xac1f('0x24')](_0x1c461a[_0xac1f('0x43')][_0xac1f('0x24')]);_0x3f7847[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x1c461a['query'][_0xac1f('0x23')]);}_0x3f7847[_0xac1f('0x4a')]=qs[_0xac1f('0x4b')](_0x1c461a['query']['sort']);_0x3f7847['where']=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x1c461a[_0xac1f('0x43')],_0x4a8d06[_0xac1f('0x45')]),_0x1a94e6);if(_0x1c461a[_0xac1f('0x43')][_0xac1f('0x32')]){_0x3f7847[_0xac1f('0x4d')]=_['merge'](_0x3f7847['where'],{'$or':_[_0xac1f('0x3d')](_0x1a94e6,function(_0x53c36c){if(_0x53c36c['type']!=='VIRTUAL'){var _0xb31e1a={};_0xb31e1a[_0x53c36c[_0xac1f('0x37')]]={'$like':'%'+_0x1c461a[_0xac1f('0x43')][_0xac1f('0x32')]+'%'};return _0xb31e1a;}})});}_0x3f7847=_[_0xac1f('0x4e')]({},_0x3f7847,_0x1c461a[_0xac1f('0x4f')]);var _0x42bc66={'where':_0x3f7847[_0xac1f('0x4d')]};return db[_0xac1f('0x3e')][_0xac1f('0x26')](_0x42bc66)['then'](function(_0xe6ae1a){_0x2777ca['count']=_0xe6ae1a;if(_0x1c461a[_0xac1f('0x43')][_0xac1f('0x50')]){_0x3f7847[_0xac1f('0x51')]=[{'all':!![]}];}return db[_0xac1f('0x3e')][_0xac1f('0x52')](_0x3f7847);})['then'](function(_0x2871ef){_0x2777ca[_0xac1f('0x53')]=_0x2871ef;return _0x2777ca;})['then'](respondWithFilteredResult(_0xfc5dbe,_0x3f7847))[_0xac1f('0x54')](handleError(_0xfc5dbe,null));};exports[_0xac1f('0x55')]=function(_0xe112f7,_0x497b59){var _0x980cd5={'raw':![],'where':{'id':_0xe112f7[_0xac1f('0x56')]['id']}},_0x14a94e={};_0x14a94e[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0x3e')][_0xac1f('0x3f')]);_0x14a94e[_0xac1f('0x43')]=_['keys'](_0xe112f7['query']);_0x14a94e[_0xac1f('0x45')]=_[_0xac1f('0x47')](_0x14a94e[_0xac1f('0x42')],_0x14a94e[_0xac1f('0x43')]);_0x980cd5['attributes']=_[_0xac1f('0x47')](_0x14a94e[_0xac1f('0x42')],qs[_0xac1f('0x48')](_0xe112f7[_0xac1f('0x43')][_0xac1f('0x48')]));_0x980cd5[_0xac1f('0x46')]=_0x980cd5['attributes'][_0xac1f('0x49')]?_0x980cd5[_0xac1f('0x46')]:_0x14a94e[_0xac1f('0x42')];if(_0xe112f7[_0xac1f('0x43')][_0xac1f('0x50')]){_0x980cd5['include']=[{'all':!![]}];}_0x980cd5=_[_0xac1f('0x4e')]({},_0x980cd5,_0xe112f7[_0xac1f('0x4f')]);return db[_0xac1f('0x3e')][_0xac1f('0x35')](_0x980cd5)[_0xac1f('0x2c')](handleEntityNotFound(_0x497b59,null))['then'](respondWithResult(_0x497b59,null))['catch'](handleError(_0x497b59,null));};exports['create']=function(_0x2bd4a4,_0x46f153){return db['VoiceQueue'][_0xac1f('0x57')](_0x2bd4a4['body'],{})[_0xac1f('0x2c')](function(_0x51c9c8){var _0x2e381=_0x2bd4a4[_0xac1f('0x58')][_0xac1f('0x2e')]({'plain':!![]});if(!_0x2e381)throw new Error(_0xac1f('0x59'));if(_0x2e381['role']===_0xac1f('0x58')){var _0x18aa51=_0x51c9c8['get']({'plain':!![]});var _0x2a659d=[{'name':_0xac1f('0x2f'),'value':_0xac1f('0x30')},{'name':_0xac1f('0x5a'),'value':_0xac1f('0x31')}];var _0x477b05=_[_0xac1f('0x35')](_0x2a659d,[_0xac1f('0x33'),_0x18aa51['type']])['name'];return db[_0xac1f('0x5b')][_0xac1f('0x35')]({'where':{'name':_0x477b05,'userProfileId':_0x2e381['userProfileId']},'raw':!![]})['then'](function(_0x49170b){if(_0x49170b&&_0x49170b[_0xac1f('0x5c')]===0x0){return db[_0xac1f('0x38')]['create']({'name':_0x18aa51['name'],'resourceId':_0x18aa51['id'],'type':_0x49170b[_0xac1f('0x37')],'sectionId':_0x49170b['id']},{})[_0xac1f('0x2c')](function(){return _0x51c9c8;});}else{return _0x51c9c8;}})[_0xac1f('0x54')](function(_0xbdc913){logger['error'](_0xac1f('0x5d'),_0xbdc913);throw _0xbdc913;});}return _0x51c9c8;})[_0xac1f('0x2c')](respondWithResult(_0x46f153,0xc9))['catch'](handleError(_0x46f153,null));};exports['clone']=function(_0x4ecf14,_0x4406e6){var _0x364462={'where':{'id':_0x4ecf14['params']['id']}},_0x3d3615={};_0x3d3615['model']=_[_0xac1f('0x44')](db[_0xac1f('0x3e')][_0xac1f('0x3f')]);_0x364462[_0xac1f('0x46')]=_['intersection'](_0x3d3615[_0xac1f('0x42')],qs['fields'](_0x4ecf14[_0xac1f('0x43')][_0xac1f('0x48')]));_0x364462[_0xac1f('0x46')]=_0x364462[_0xac1f('0x46')][_0xac1f('0x49')]?_0x364462[_0xac1f('0x46')]:_0x3d3615[_0xac1f('0x42')];if(_0x4ecf14['query']['includeAll']){_0x364462[_0xac1f('0x51')]=[{'all':!![]}];}_0x364462=_['merge']({},_0x364462,_0x4ecf14[_0xac1f('0x4f')]);return db[_0xac1f('0x3e')][_0xac1f('0x35')](_0x364462)[_0xac1f('0x2c')](handleEntityNotFound(_0x4406e6,null))[_0xac1f('0x2c')](function(_0x18d4ec){if(_0x18d4ec){var _0xb4da10=_0x18d4ec[_0xac1f('0x2e')]({'plain':!![]});_0xb4da10=qs[_0xac1f('0x5e')](_0xb4da10,['id',_0xac1f('0x5f'),_0xac1f('0x60')]);_0x4ecf14[_0xac1f('0x61')]=_['omit'](_0x4ecf14[_0xac1f('0x61')],['id',_0xac1f('0x5f'),'updatedAt']);return db[_0xac1f('0x3e')][_0xac1f('0x57')](_[_0xac1f('0x4e')](_0xb4da10,_0x4ecf14[_0xac1f('0x61')]),{'include':_0x4ecf14[_0xac1f('0x43')][_0xac1f('0x50')]?[{'all':!![]}]:undefined})[_0xac1f('0x2c')](function(_0x4cf37c){var _0x4b95ba=_0x4ecf14[_0xac1f('0x58')][_0xac1f('0x2e')]({'plain':!![]});if(!_0x4b95ba)throw new Error(_0xac1f('0x59'));if(_0x4b95ba['role']===_0xac1f('0x58')){var _0x437be8=_0x4cf37c[_0xac1f('0x2e')]({'plain':!![]});var _0xbe2775=[{'name':_0xac1f('0x2f'),'value':_0xac1f('0x30')},{'name':_0xac1f('0x5a'),'value':'outbound'}];var _0x29c799=_[_0xac1f('0x35')](_0xbe2775,[_0xac1f('0x33'),_0x437be8[_0xac1f('0x36')]])[_0xac1f('0x37')];return db[_0xac1f('0x5b')][_0xac1f('0x35')]({'where':{'name':_0x29c799,'userProfileId':_0x4b95ba[_0xac1f('0x62')]},'raw':!![]})[_0xac1f('0x2c')](function(_0x2df5f3){if(_0x2df5f3&&_0x2df5f3['autoAssociation']===0x0){return db['UserProfileResource'][_0xac1f('0x57')]({'name':_0x437be8[_0xac1f('0x37')],'resourceId':_0x437be8['id'],'type':_0x2df5f3[_0xac1f('0x37')],'sectionId':_0x2df5f3['id']},{})[_0xac1f('0x2c')](function(){return _0x4cf37c;});}else{return _0x4cf37c;}})[_0xac1f('0x54')](function(_0x1918a3){logger['error'](_0xac1f('0x5d'),_0x1918a3);throw _0x1918a3;});}return _0x4cf37c;});}})['then'](respondWithResult(_0x4406e6,0xc9))[_0xac1f('0x54')](handleError(_0x4406e6,null));};exports[_0xac1f('0x2b')]=function(_0x3f3517,_0x2c8967){if(_0x3f3517[_0xac1f('0x61')]['id']){delete _0x3f3517['body']['id'];}return db[_0xac1f('0x3e')]['find']({'where':{'id':_0x3f3517[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x2c8967,null))[_0xac1f('0x2c')](saveUpdates(_0x3f3517[_0xac1f('0x61')],null))['then'](respondWithResult(_0x2c8967,null))[_0xac1f('0x54')](handleError(_0x2c8967,null));};exports['destroy']=function(_0x507b7a,_0x45f56d){return db['VoiceQueue']['find']({'where':{'id':_0x507b7a['params']['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x45f56d,null))[_0xac1f('0x2c')](removeEntity(_0x45f56d,null))[_0xac1f('0x54')](handleError(_0x45f56d,null));};exports[_0xac1f('0x63')]=function(_0x11a656,_0x208d72,_0x292583){var _0x5457b4={'raw':![],'where':{}};var _0x83012f={};var _0x46d438={'count':0x0,'rows':[]};return db[_0xac1f('0x3e')]['findOne']({'where':{'id':_0x11a656[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x208d72,null))[_0xac1f('0x2c')](function(_0x50a415){if(_0x50a415){_0x83012f['model']=_['keys'](db[_0xac1f('0x64')][_0xac1f('0x3f')]);_0x83012f['query']=_['keys'](_0x11a656[_0xac1f('0x43')]);_0x83012f['filters']=_[_0xac1f('0x47')](_0x83012f[_0xac1f('0x42')],_0x83012f[_0xac1f('0x43')]);_0x5457b4[_0xac1f('0x46')]=_[_0xac1f('0x47')](_0x83012f['model'],qs[_0xac1f('0x48')](_0x11a656[_0xac1f('0x43')]['fields']));_0x5457b4[_0xac1f('0x46')]=_0x5457b4['attributes'][_0xac1f('0x49')]?_0x5457b4[_0xac1f('0x46')]:_0x83012f[_0xac1f('0x42')];if(!_0x11a656[_0xac1f('0x43')][_0xac1f('0x65')](_0xac1f('0x66'))){_0x5457b4['limit']=qs[_0xac1f('0x24')](_0x11a656['query'][_0xac1f('0x24')]);_0x5457b4[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x11a656['query'][_0xac1f('0x23')]);}_0x5457b4[_0xac1f('0x4a')]=qs[_0xac1f('0x4b')](_0x11a656[_0xac1f('0x43')]['sort']);_0x5457b4[_0xac1f('0x4d')]=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x11a656[_0xac1f('0x43')],_0x83012f['filters']));_0x5457b4['where'][_0xac1f('0x67')]=_0x50a415['id'];if(_0x11a656[_0xac1f('0x43')][_0xac1f('0x32')]){_0x5457b4[_0xac1f('0x4d')]=_[_0xac1f('0x4e')](_0x5457b4[_0xac1f('0x4d')],{'$or':_[_0xac1f('0x3d')](_0x5457b4['attributes'],function(_0x2e1819){var _0x3b2730={};_0x3b2730[_0x2e1819]={'$like':'%'+_0x11a656['query'][_0xac1f('0x32')]+'%'};return _0x3b2730;})});}_0x5457b4=_[_0xac1f('0x4e')]({},_0x5457b4,_0x11a656['options']);return db[_0xac1f('0x64')]['count']({'where':_0x5457b4[_0xac1f('0x4d')]})['then'](function(_0x4b6c04){_0x46d438[_0xac1f('0x26')]=_0x4b6c04;if(_0x11a656[_0xac1f('0x43')][_0xac1f('0x50')]){_0x5457b4[_0xac1f('0x51')]=[{'all':!![]}];}return db[_0xac1f('0x64')][_0xac1f('0x52')](_0x5457b4);})[_0xac1f('0x2c')](function(_0x53d20c){_0x46d438['rows']=_0x53d20c;return _0x46d438;});}})[_0xac1f('0x2c')](respondWithFilteredResult(_0x208d72,_0x5457b4))[_0xac1f('0x54')](handleError(_0x208d72,null));};exports[_0xac1f('0x68')]=function(_0x1e25df,_0x328736,_0x52bfc6){var _0x44f27e={'raw':!![],'where':{}};var _0x40287e={};var _0x1abb46={'count':0x0,'rows':[]};return db[_0xac1f('0x3e')][_0xac1f('0x69')]({'where':{'id':_0x1e25df['params']['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x328736,null))[_0xac1f('0x2c')](function(_0x3b189f){if(_0x3b189f){_0x40287e[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0x6a')][_0xac1f('0x3f')]);_0x40287e[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x1e25df[_0xac1f('0x43')]);_0x40287e[_0xac1f('0x45')]=_[_0xac1f('0x47')](_0x40287e[_0xac1f('0x42')],_0x40287e[_0xac1f('0x43')]);_0x44f27e['attributes']=_[_0xac1f('0x47')](_0x40287e[_0xac1f('0x42')],qs[_0xac1f('0x48')](_0x1e25df[_0xac1f('0x43')][_0xac1f('0x48')]));_0x44f27e[_0xac1f('0x46')]=_0x44f27e[_0xac1f('0x46')][_0xac1f('0x49')]?_0x44f27e[_0xac1f('0x46')]:_0x40287e[_0xac1f('0x42')];if(!_0x1e25df[_0xac1f('0x43')][_0xac1f('0x65')]('nolimit')){_0x44f27e[_0xac1f('0x24')]=qs[_0xac1f('0x24')](_0x1e25df[_0xac1f('0x43')][_0xac1f('0x24')]);_0x44f27e[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x1e25df[_0xac1f('0x43')]['offset']);}_0x44f27e[_0xac1f('0x4a')]=qs[_0xac1f('0x4b')](_0x1e25df[_0xac1f('0x43')][_0xac1f('0x4b')]);_0x44f27e[_0xac1f('0x4d')]=qs[_0xac1f('0x45')](_['pick'](_0x1e25df['query'],_0x40287e[_0xac1f('0x45')]));_0x44f27e[_0xac1f('0x4d')]['VoiceQueueId']=_0x3b189f['id'];if(_0x1e25df['query']['filter']){_0x44f27e[_0xac1f('0x4d')]=_[_0xac1f('0x4e')](_0x44f27e['where'],{'$or':_[_0xac1f('0x3d')](_0x44f27e['attributes'],function(_0x56cc82){var _0x4d254f={};_0x4d254f[_0x56cc82]={'$like':'%'+_0x1e25df[_0xac1f('0x43')]['filter']+'%'};return _0x4d254f;})});}_0x44f27e=_[_0xac1f('0x4e')]({},_0x44f27e,_0x1e25df[_0xac1f('0x4f')]);return db[_0xac1f('0x6a')][_0xac1f('0x26')]({'where':_0x44f27e[_0xac1f('0x4d')]})[_0xac1f('0x2c')](function(_0x5df190){_0x1abb46[_0xac1f('0x26')]=_0x5df190;if(_0x1e25df[_0xac1f('0x43')]['includeAll']){_0x44f27e[_0xac1f('0x51')]=[{'all':!![]}];}return db[_0xac1f('0x6a')]['findAll'](_0x44f27e);})['then'](function(_0x126f96){_0x1abb46[_0xac1f('0x53')]=_0x126f96;return _0x1abb46;});}})['then'](respondWithFilteredResult(_0x328736,_0x44f27e))[_0xac1f('0x54')](handleError(_0x328736,null));};exports[_0xac1f('0x6b')]=function(_0x18ed02,_0x41c77d,_0x320242){var _0x2799d1={'raw':!![],'where':{}};var _0x5a42b9={};var _0x36e18e={'count':0x0,'rows':[]};return db[_0xac1f('0x3e')][_0xac1f('0x69')]({'where':{'id':_0x18ed02[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x41c77d,null))[_0xac1f('0x2c')](function(_0x2b2704){if(_0x2b2704){_0x5a42b9[_0xac1f('0x42')]=_[_0xac1f('0x44')](db['CmHopperFinal'][_0xac1f('0x3f')]);_0x5a42b9['query']=_['keys'](_0x18ed02[_0xac1f('0x43')]);_0x5a42b9[_0xac1f('0x45')]=_[_0xac1f('0x47')](_0x5a42b9[_0xac1f('0x42')],_0x5a42b9[_0xac1f('0x43')]);_0x2799d1[_0xac1f('0x46')]=_[_0xac1f('0x47')](_0x5a42b9[_0xac1f('0x42')],qs[_0xac1f('0x48')](_0x18ed02[_0xac1f('0x43')]['fields']));_0x2799d1[_0xac1f('0x46')]=_0x2799d1[_0xac1f('0x46')][_0xac1f('0x49')]?_0x2799d1['attributes']:_0x5a42b9[_0xac1f('0x42')];if(!_0x18ed02[_0xac1f('0x43')][_0xac1f('0x65')]('nolimit')){_0x2799d1['limit']=qs[_0xac1f('0x24')](_0x18ed02[_0xac1f('0x43')][_0xac1f('0x24')]);_0x2799d1[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x18ed02[_0xac1f('0x43')][_0xac1f('0x23')]);}_0x2799d1[_0xac1f('0x4a')]=qs[_0xac1f('0x4b')](_0x18ed02[_0xac1f('0x43')][_0xac1f('0x4b')]);_0x2799d1['where']=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x18ed02[_0xac1f('0x43')],_0x5a42b9[_0xac1f('0x45')]));_0x2799d1[_0xac1f('0x4d')][_0xac1f('0x67')]=_0x2b2704['id'];if(_0x18ed02[_0xac1f('0x43')][_0xac1f('0x32')]){_0x2799d1[_0xac1f('0x4d')]=_[_0xac1f('0x4e')](_0x2799d1[_0xac1f('0x4d')],{'$or':_[_0xac1f('0x3d')](_0x2799d1['attributes'],function(_0x11527c){var _0x59bd0c={};_0x59bd0c[_0x11527c]={'$like':'%'+_0x18ed02[_0xac1f('0x43')][_0xac1f('0x32')]+'%'};return _0x59bd0c;})});}_0x2799d1=_[_0xac1f('0x4e')]({},_0x2799d1,_0x18ed02[_0xac1f('0x4f')]);return db['CmHopperFinal'][_0xac1f('0x26')]({'where':_0x2799d1[_0xac1f('0x4d')]})['then'](function(_0x36e28e){_0x36e18e[_0xac1f('0x26')]=_0x36e28e;if(_0x18ed02['query'][_0xac1f('0x50')]){_0x2799d1[_0xac1f('0x51')]=[{'all':!![]}];}return db[_0xac1f('0x6c')][_0xac1f('0x52')](_0x2799d1);})[_0xac1f('0x2c')](function(_0x2ce3fb){_0x36e18e[_0xac1f('0x53')]=_0x2ce3fb;return _0x36e18e;});}})[_0xac1f('0x2c')](respondWithFilteredResult(_0x41c77d,_0x2799d1))['catch'](handleError(_0x41c77d,null));};exports[_0xac1f('0x6d')]=function(_0x148486,_0x65a706,_0x25cea7){var _0x1e0ad8={'raw':!![],'where':{}};var _0x2e0326={};var _0x45c038={'count':0x0,'rows':[]};return db[_0xac1f('0x3e')]['findOne']({'where':{'id':_0x148486[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x65a706,null))['then'](function(_0x4335e8){if(_0x4335e8){_0x2e0326['model']=_['keys'](db[_0xac1f('0x6e')][_0xac1f('0x3f')]);_0x2e0326[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x148486[_0xac1f('0x43')]);_0x2e0326['filters']=_[_0xac1f('0x47')](_0x2e0326[_0xac1f('0x42')],_0x2e0326[_0xac1f('0x43')]);_0x1e0ad8[_0xac1f('0x46')]=_[_0xac1f('0x47')](_0x2e0326[_0xac1f('0x42')],qs['fields'](_0x148486[_0xac1f('0x43')][_0xac1f('0x48')]));_0x1e0ad8[_0xac1f('0x46')]=_0x1e0ad8[_0xac1f('0x46')][_0xac1f('0x49')]?_0x1e0ad8[_0xac1f('0x46')]:_0x2e0326[_0xac1f('0x42')];if(!_0x148486[_0xac1f('0x43')][_0xac1f('0x65')](_0xac1f('0x66'))){_0x1e0ad8[_0xac1f('0x24')]=qs[_0xac1f('0x24')](_0x148486[_0xac1f('0x43')][_0xac1f('0x24')]);_0x1e0ad8[_0xac1f('0x23')]=qs['offset'](_0x148486[_0xac1f('0x43')][_0xac1f('0x23')]);}_0x1e0ad8[_0xac1f('0x4a')]=qs['sort'](_0x148486[_0xac1f('0x43')][_0xac1f('0x4b')]);_0x1e0ad8['where']=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x148486[_0xac1f('0x43')],_0x2e0326[_0xac1f('0x45')]));_0x1e0ad8[_0xac1f('0x4d')][_0xac1f('0x67')]=_0x4335e8['id'];if(_0x148486[_0xac1f('0x43')][_0xac1f('0x32')]){_0x1e0ad8[_0xac1f('0x4d')]=_[_0xac1f('0x4e')](_0x1e0ad8[_0xac1f('0x4d')],{'$or':_['map'](_0x1e0ad8[_0xac1f('0x46')],function(_0x1b1bbe){var _0x4db3d7={};_0x4db3d7[_0x1b1bbe]={'$like':'%'+_0x148486['query'][_0xac1f('0x32')]+'%'};return _0x4db3d7;})});}_0x1e0ad8=_[_0xac1f('0x4e')]({},_0x1e0ad8,_0x148486[_0xac1f('0x4f')]);return db[_0xac1f('0x6e')][_0xac1f('0x26')]({'where':_0x1e0ad8[_0xac1f('0x4d')]})['then'](function(_0x2b3b8b){_0x45c038['count']=_0x2b3b8b;if(_0x148486['query']['includeAll']){_0x1e0ad8[_0xac1f('0x51')]=[{'all':!![]}];}return db[_0xac1f('0x6e')][_0xac1f('0x52')](_0x1e0ad8);})[_0xac1f('0x2c')](function(_0x31a1eb){_0x45c038['rows']=_0x31a1eb;return _0x45c038;});}})[_0xac1f('0x2c')](respondWithFilteredResult(_0x65a706,_0x1e0ad8))[_0xac1f('0x54')](handleError(_0x65a706,null));};exports[_0xac1f('0x6f')]=function(_0x1eba14,_0x538ddd,_0x1d11c9){var _0x1a4d69={};var _0x469697={};var _0x2d453f;var _0x2daf7d;return db[_0xac1f('0x3e')]['findOne']({'where':{'id':_0x1eba14[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x538ddd,null))[_0xac1f('0x2c')](function(_0x36e80b){if(_0x36e80b){_0x2d453f=_0x36e80b;_0x469697[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0x70')][_0xac1f('0x3f')]);_0x469697['query']=_[_0xac1f('0x44')](_0x1eba14[_0xac1f('0x43')]);_0x469697[_0xac1f('0x45')]=_[_0xac1f('0x47')](_0x469697[_0xac1f('0x42')],_0x469697[_0xac1f('0x43')]);_0x1a4d69[_0xac1f('0x46')]=_[_0xac1f('0x47')](_0x469697['model'],qs[_0xac1f('0x48')](_0x1eba14[_0xac1f('0x43')][_0xac1f('0x48')]));_0x1a4d69['attributes']=_0x1a4d69['attributes']['length']?_0x1a4d69[_0xac1f('0x46')]:_0x469697['model'];_0x1a4d69[_0xac1f('0x4a')]=qs['sort'](_0x1eba14[_0xac1f('0x43')][_0xac1f('0x4b')]);_0x1a4d69['where']=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x1eba14['query'],_0x469697['filters']));if(_0x1eba14[_0xac1f('0x43')][_0xac1f('0x32')]){_0x1a4d69[_0xac1f('0x4d')]=_[_0xac1f('0x4e')](_0x1a4d69[_0xac1f('0x4d')],{'$or':_['map'](_0x1a4d69[_0xac1f('0x46')],function(_0x4aaa05){var _0x540d1c={};_0x540d1c[_0x4aaa05]={'$like':'%'+_0x1eba14[_0xac1f('0x43')]['filter']+'%'};return _0x540d1c;})});}_0x1a4d69=_['merge']({},_0x1a4d69,_0x1eba14['options']);return _0x2d453f['getTeams'](_0x1a4d69);}})['then'](function(_0x3b72a6){if(_0x3b72a6){_0x2daf7d=_0x3b72a6[_0xac1f('0x49')];if(!_0x1eba14[_0xac1f('0x43')][_0xac1f('0x65')](_0xac1f('0x66'))){_0x1a4d69['limit']=qs[_0xac1f('0x24')](_0x1eba14['query']['limit']);_0x1a4d69[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x1eba14['query']['offset']);}return _0x2d453f['getTeams'](_0x1a4d69);}})[_0xac1f('0x2c')](function(_0x26777b){if(_0x26777b){return _0x26777b?{'count':_0x2daf7d,'rows':_0x26777b}:null;}})[_0xac1f('0x2c')](respondWithResult(_0x538ddd,null))[_0xac1f('0x54')](handleError(_0x538ddd,null));};exports[_0xac1f('0x71')]=function(_0xcaab1e,_0xc0579,_0x4622d6){var _0x12492e=_0xcaab1e['body'][_0xac1f('0x72')];var _0x4c5f09=_[_0xac1f('0x3d')](_0x12492e,'id');return db[_0xac1f('0x70')]['findAll']({'where':{'id':_0x4c5f09},'attributes':['id'],'include':[{'model':db[_0xac1f('0x73')],'as':_0xac1f('0x74'),'attributes':['id',_0xac1f('0x37'),_0xac1f('0x75'),'voicePause',_0xac1f('0x76')],'raw':!![]}]})['then'](function(_0x130f1d){if(_0x130f1d){var _0x56cf27=_[_0xac1f('0x77')](_0x130f1d,function(_0x522b74){var _0x13a40e=_0x522b74[_0xac1f('0x2e')]({'plain':!![]});_0x13a40e[_0xac1f('0x74')][_0xac1f('0x78')](function(_0x1b3f7c){_0x1b3f7c[_0xac1f('0x79')]=_['find'](_0x12492e,{'id':_0x13a40e['id']})[_0xac1f('0x79')];});return _0x13a40e[_0xac1f('0x74')];});return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0xcaab1e[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](function(_0x17f2bf){return db['sequelize'][_0xac1f('0x7a')](function(_0x245d70){return _0x17f2bf[_0xac1f('0x71')](_0x4c5f09,{'transaction':_0x245d70})[_0xac1f('0x2c')](function(){return BPromise[_0xac1f('0x7b')](_0x12492e,function(_0x47b160){return db['TeamVoiceQueue'][_0xac1f('0x7c')]({'TeamId':_0x47b160['id'],'VoiceQueueId':_0xcaab1e[_0xac1f('0x56')]['id'],'penalty':_0x47b160[_0xac1f('0x79')]},{'transaction':_0x245d70});});})[_0xac1f('0x2c')](function(){return BPromise[_0xac1f('0x7b')](_0x56cf27,function(_0x9a22d7){return db['UserVoiceQueue'][_0xac1f('0x7d')]({'where':{'UserId':_0x9a22d7['id'],'VoiceQueueId':_0xcaab1e['params']['id']},'defaults':{'penalty':_0x9a22d7[_0xac1f('0x79')]},'transaction':_0x245d70});});})[_0xac1f('0x2c')](function(){return BPromise['each'](_[_0xac1f('0x32')](_0x56cf27,{'online':!![]}),function(_0xabf16e){return db['UserVoiceQueueRt'][_0xac1f('0x7c')]({'membername':_0xabf16e['name'],'UserId':_0xabf16e['id'],'queue_name':_0x17f2bf['name'],'VoiceQueueId':_0x17f2bf['id'],'interface':_[_0xac1f('0x7e')](_0xabf16e['interface'])?util[_0xac1f('0x7f')]('SIP/%s',_0xabf16e['name']):_0xabf16e[_0xac1f('0x76')],'paused':_0xabf16e['voicePause']||![],'penalty':_0xabf16e['penalty']},{'transaction':_0x245d70});});})[_0xac1f('0x2c')](function(){_0x56cf27[_0xac1f('0x78')](function(_0x37c08a){socket['emit'](_0xac1f('0x80'),{'UserId':_0x37c08a['id'],'VoiceQueueId':_0x17f2bf['id']});});});});});}})[_0xac1f('0x2c')](respondWithStatusCode(_0xc0579,null))['catch'](handleError(_0xc0579,null));};exports[_0xac1f('0x81')]=function(_0x3a43a6,_0x4d9e55,_0xed05cb){return db[_0xac1f('0x70')][_0xac1f('0x52')]({'where':{'id':_0x3a43a6[_0xac1f('0x43')][_0xac1f('0x82')]},'attributes':['id'],'include':[{'model':db[_0xac1f('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xac1f('0x2c')](handleEntityNotFound(_0x4d9e55,null))['then'](function(_0x363238){var _0x213ad4=_['map'](_0x363238,'id');var _0x200b97=[];var _0x16f66d=[];var _0x5d3b1f=squel[_0xac1f('0x83')]();_0x5d3b1f[_0xac1f('0x84')](_0xac1f('0x85'))[_0xac1f('0x86')](_0xac1f('0x87'),'tq')[_0xac1f('0x88')](_0xac1f('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xac1f('0x8a'),_0x3a43a6['params']['id']);for(var _0x547388=0x0;_0x547388<_0x363238[_0xac1f('0x49')];_0x547388+=0x1){let _0x2ad700=_0x363238[_0x547388];for(var _0x279ab6=0x0;_0x279ab6<_0x2ad700[_0xac1f('0x74')][_0xac1f('0x49')];_0x279ab6+=0x1){let _0x1e1da3=_0x2ad700['Agents'][_0x279ab6];var _0x3735e4=_0x5d3b1f[_0xac1f('0x8b')]();_0x3735e4['where'](_0xac1f('0x8c'),_0x1e1da3['id']);_0x16f66d[_0xac1f('0x8d')](db['sequelize'][_0xac1f('0x43')](_0x3735e4['toString'](),{'type':db[_0xac1f('0x8e')]['QueryTypes'][_0xac1f('0x8f')]})['then'](function(_0x5336e7){if(_0x5336e7[_0xac1f('0x49')]===0x1){return _0x1e1da3['id'];}else{var _0x2d4243=_['every'](_[_0xac1f('0x3d')](_0x5336e7,'TeamId'),function(_0x599d82){return _[_0xac1f('0x34')](_0x213ad4,_0x599d82);});if(_0x2d4243){return _0x1e1da3['id'];}}}));}}return BPromise[_0xac1f('0x90')](_0x16f66d)[_0xac1f('0x2c')](function(_0x191501){_0x200b97=_(_0x200b97)[_0xac1f('0x91')](_0x191501)[_0xac1f('0x92')]()[_0xac1f('0x33')]();return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0x3a43a6[_0xac1f('0x56')]['id']}})['then'](function(_0x4fe7d2){return db['sequelize']['transaction'](function(_0x18b971){return _0x4fe7d2[_0xac1f('0x81')](_0x3a43a6[_0xac1f('0x43')][_0xac1f('0x82')],{'transaction':_0x18b971})[_0xac1f('0x2c')](function(){if(!_[_0xac1f('0x93')](_0x200b97)){return _0x4fe7d2[_0xac1f('0x94')](_0x200b97,{'transaction':_0x18b971})['then'](function(){return db[_0xac1f('0x95')]['destroy']({'where':{'VoiceQueueId':_0x3a43a6[_0xac1f('0x56')]['id'],'UserId':_0x200b97},'transaction':_0x18b971});});}})[_0xac1f('0x2c')](function(){_0x200b97['forEach'](function(_0x220c8d){socket[_0xac1f('0x96')](_0xac1f('0x97'),{'UserId':_0x220c8d,'VoiceQueueId':_0x4fe7d2['id']});});});});});});})[_0xac1f('0x2c')](respondWithStatusCode(_0x4d9e55,null))[_0xac1f('0x54')](handleError(_0x4d9e55,null));};exports['addAgents']=function(_0x46df32,_0x4ffa68,_0x230181){var _0x1030ba,_0x2308b9;return db[_0xac1f('0x3e')]['find']({'where':{'id':_0x46df32['params']['id']}})['then'](handleEntityNotFound(_0x4ffa68,null))[_0xac1f('0x2c')](function(_0x35a4c4){if(_0x35a4c4){_0x2308b9=_0x35a4c4;return _0x35a4c4[_0xac1f('0x98')](_0x46df32[_0xac1f('0x61')][_0xac1f('0x82')],_[_0xac1f('0x5e')](_0x46df32['body'],[_0xac1f('0x82'),'id'])||{})[_0xac1f('0x99')](function(_0xcdab2c){for(var _0x4449e5=0x0;_0x4449e5<_0x46df32[_0xac1f('0x61')][_0xac1f('0x82')][_0xac1f('0x49')];_0x4449e5+=0x1){socket[_0xac1f('0x96')](_0xac1f('0x80'),{'UserId':Number(_0x46df32[_0xac1f('0x61')]['ids'][_0x4449e5]),'VoiceQueueId':Number(_0x46df32[_0xac1f('0x56')]['id'])});}return _0xcdab2c;});}})[_0xac1f('0x2c')](function(_0x44faa2){_0x1030ba=_0x44faa2||[];if(_0x2308b9){return db[_0xac1f('0x73')][_0xac1f('0x52')]({'where':{'id':_0x46df32[_0xac1f('0x61')][_0xac1f('0x82')]},'attributes':['id',_0xac1f('0x37'),_0xac1f('0x75'),_0xac1f('0x9a'),_0xac1f('0x76')],'raw':!![]});}})[_0xac1f('0x2c')](function(_0x587a5){if(!_['isEmpty'](_0x587a5)){var _0x3781ef=[];for(var _0xd1c1e=0x0;_0xd1c1e<_0x587a5[_0xac1f('0x49')];_0xd1c1e++){if(_0x587a5[_0xd1c1e]['online']){_0x3781ef[_0xac1f('0x8d')](db[_0xac1f('0x95')][_0xac1f('0x7c')]({'membername':_0x587a5[_0xd1c1e]['name'],'UserId':_0x587a5[_0xd1c1e]['id'],'queue_name':_0x2308b9[_0xac1f('0x37')],'VoiceQueueId':_0x2308b9['id'],'interface':_['isNil'](_0x587a5[_0xd1c1e][_0xac1f('0x76')])?util['format'](_0xac1f('0x9b'),_0x587a5[_0xd1c1e][_0xac1f('0x37')]):_0x587a5[_0xd1c1e][_0xac1f('0x76')],'paused':_0x587a5[_0xd1c1e][_0xac1f('0x9a')]||![],'penalty':_0x46df32[_0xac1f('0x61')][_0xac1f('0x79')]||0x0}));}}return BPromise[_0xac1f('0x90')](_0x3781ef);}})[_0xac1f('0x2c')](function(){return _0x1030ba;})[_0xac1f('0x2c')](respondWithResult(_0x4ffa68,null))[_0xac1f('0x54')](handleError(_0x4ffa68,null));};exports[_0xac1f('0x94')]=function(_0x7d79d9,_0x5a6a49,_0x55e843){return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0x7d79d9[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x5a6a49,null))[_0xac1f('0x2c')](function(_0x43288e){if(_0x43288e){return _0x43288e[_0xac1f('0x94')](_0x7d79d9[_0xac1f('0x43')][_0xac1f('0x82')])['then'](function(){if(_[_0xac1f('0x9c')](_0x7d79d9[_0xac1f('0x43')][_0xac1f('0x82')])){for(var _0x270700=0x0;_0x270700<_0x7d79d9[_0xac1f('0x43')][_0xac1f('0x82')]['length'];_0x270700+=0x1){socket[_0xac1f('0x96')](_0xac1f('0x97'),{'UserId':Number(_0x7d79d9['query']['ids'][_0x270700]),'VoiceQueueId':Number(_0x7d79d9[_0xac1f('0x56')]['id'])});}}else{socket[_0xac1f('0x96')](_0xac1f('0x97'),{'UserId':Number(_0x7d79d9[_0xac1f('0x43')]['ids']),'VoiceQueueId':Number(_0x7d79d9[_0xac1f('0x56')]['id'])});}});}})[_0xac1f('0x2c')](function(_0x56bd76){return db[_0xac1f('0x95')][_0xac1f('0x2d')]({'where':{'VoiceQueueId':_0x7d79d9[_0xac1f('0x56')]['id'],'UserId':_0x7d79d9['query'][_0xac1f('0x82')]}})[_0xac1f('0x2c')](function(){return _0x56bd76;});})[_0xac1f('0x2c')](respondWithStatusCode(_0x5a6a49,null))['catch'](handleError(_0x5a6a49,null));};exports[_0xac1f('0x9d')]=function(_0x407efc,_0x4c40a8,_0x56639f){var _0x434ec0={};var _0x5a3f35={};var _0x5c2ac6;var _0xf86dd;return db[_0xac1f('0x3e')][_0xac1f('0x69')]({'where':{'id':_0x407efc[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x4c40a8,null))[_0xac1f('0x2c')](function(_0x565404){if(_0x565404){_0x5c2ac6=_0x565404;_0x5a3f35[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0x73')][_0xac1f('0x3f')]);_0x5a3f35[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x407efc[_0xac1f('0x43')]);_0x5a3f35[_0xac1f('0x45')]=_[_0xac1f('0x47')](_0x5a3f35[_0xac1f('0x42')],_0x5a3f35[_0xac1f('0x43')]);_0x434ec0[_0xac1f('0x46')]=_[_0xac1f('0x47')](_0x5a3f35['model'],qs[_0xac1f('0x48')](_0x407efc[_0xac1f('0x43')][_0xac1f('0x48')]));_0x434ec0['attributes']=_0x434ec0[_0xac1f('0x46')]['length']?_0x434ec0['attributes']:_0x5a3f35[_0xac1f('0x42')];_0x434ec0[_0xac1f('0x4a')]=qs[_0xac1f('0x4b')](_0x407efc[_0xac1f('0x43')]['sort']);_0x434ec0[_0xac1f('0x4d')]=qs['filters'](_[_0xac1f('0x4c')](_0x407efc[_0xac1f('0x43')],_0x5a3f35['filters']));if(_0x407efc[_0xac1f('0x43')][_0xac1f('0x32')]){_0x434ec0[_0xac1f('0x4d')]=_['merge'](_0x434ec0[_0xac1f('0x4d')],{'$or':_[_0xac1f('0x3d')](_0x434ec0['attributes'],function(_0x1929a3){var _0x14363e={};_0x14363e[_0x1929a3]={'$like':'%'+_0x407efc[_0xac1f('0x43')][_0xac1f('0x32')]+'%'};return _0x14363e;})});}_0x434ec0=_[_0xac1f('0x4e')]({},_0x434ec0,_0x407efc[_0xac1f('0x4f')]);return _0x5c2ac6['getAgents'](_0x434ec0);}})[_0xac1f('0x2c')](function(_0x30afa9){if(_0x30afa9){_0xf86dd=_0x30afa9[_0xac1f('0x49')];if(!_0x407efc[_0xac1f('0x43')][_0xac1f('0x65')](_0xac1f('0x66'))){_0x434ec0[_0xac1f('0x24')]=qs['limit'](_0x407efc[_0xac1f('0x43')]['limit']);_0x434ec0['offset']=qs[_0xac1f('0x23')](_0x407efc['query'][_0xac1f('0x23')]);}return _0x5c2ac6[_0xac1f('0x9d')](_0x434ec0);}})[_0xac1f('0x2c')](function(_0x4ae7f2){if(_0x4ae7f2){return _0x4ae7f2?{'count':_0xf86dd,'rows':_0x4ae7f2}:null;}})[_0xac1f('0x2c')](respondWithResult(_0x4c40a8,null))['catch'](handleError(_0x4c40a8,null));};exports[_0xac1f('0x9e')]=function(_0x12ab7f,_0x4de2d3,_0x1822cb){var _0x43ef76={};var _0x3ddaa0={};var _0x35bbfb;var _0xe231a6;return db[_0xac1f('0x3e')][_0xac1f('0x69')]({'where':{'id':_0x12ab7f[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x4de2d3,null))[_0xac1f('0x2c')](function(_0x548c6f){if(_0x548c6f){_0x35bbfb=_0x548c6f;_0x3ddaa0[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0x95')][_0xac1f('0x3f')]);_0x3ddaa0[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x12ab7f[_0xac1f('0x43')]);_0x3ddaa0[_0xac1f('0x45')]=_[_0xac1f('0x47')](_0x3ddaa0[_0xac1f('0x42')],_0x3ddaa0[_0xac1f('0x43')]);_0x43ef76['attributes']=_[_0xac1f('0x47')](_0x3ddaa0[_0xac1f('0x42')],qs[_0xac1f('0x48')](_0x12ab7f[_0xac1f('0x43')][_0xac1f('0x48')]));_0x43ef76[_0xac1f('0x46')]=_0x43ef76[_0xac1f('0x46')]['length']?_0x43ef76[_0xac1f('0x46')]:_0x3ddaa0['model'];_0x43ef76['order']=qs[_0xac1f('0x4b')](_0x12ab7f[_0xac1f('0x43')][_0xac1f('0x4b')]);_0x43ef76[_0xac1f('0x4d')]=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x12ab7f['query'],_0x3ddaa0[_0xac1f('0x45')]));if(_0x12ab7f['query'][_0xac1f('0x32')]){_0x43ef76[_0xac1f('0x4d')]=_['merge'](_0x43ef76[_0xac1f('0x4d')],{'$or':_[_0xac1f('0x3d')](_0x43ef76['attributes'],function(_0x567983){var _0x31754d={};_0x31754d[_0x567983]={'$like':'%'+_0x12ab7f[_0xac1f('0x43')][_0xac1f('0x32')]+'%'};return _0x31754d;})});}_0x43ef76=_['merge']({},_0x43ef76,_0x12ab7f[_0xac1f('0x4f')]);return _0x35bbfb[_0xac1f('0x9e')](_0x43ef76);}})[_0xac1f('0x2c')](function(_0x109c46){if(_0x109c46){_0xe231a6=_0x109c46[_0xac1f('0x49')];if(!_0x12ab7f[_0xac1f('0x43')]['hasOwnProperty'](_0xac1f('0x66'))){_0x43ef76[_0xac1f('0x24')]=qs[_0xac1f('0x24')](_0x12ab7f[_0xac1f('0x43')][_0xac1f('0x24')]);_0x43ef76[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x12ab7f[_0xac1f('0x43')][_0xac1f('0x23')]);}return _0x35bbfb[_0xac1f('0x9e')](_0x43ef76);}})[_0xac1f('0x2c')](function(_0x300a06){return _0x300a06?{'count':_0xe231a6,'rows':_0x300a06}:null;})[_0xac1f('0x2c')](respondWithResult(_0x4de2d3,null))[_0xac1f('0x54')](handleError(_0x4de2d3,null));};exports[_0xac1f('0x9f')]=function(_0x3067e6,_0x5d7f76,_0x4c190c){var _0x33985e={};var _0x323d73={};var _0x15fddd;var _0x29f27b;return db[_0xac1f('0x3e')]['findOne']({'where':{'id':_0x3067e6[_0xac1f('0x56')]['id']}})['then'](handleEntityNotFound(_0x5d7f76,null))[_0xac1f('0x2c')](function(_0x1f896e){if(_0x1f896e){_0x15fddd=_0x1f896e;_0x323d73[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0xa0')][_0xac1f('0x3f')]);_0x323d73[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x3067e6[_0xac1f('0x43')]);_0x323d73['filters']=_[_0xac1f('0x47')](_0x323d73['model'],_0x323d73[_0xac1f('0x43')]);_0x33985e[_0xac1f('0x46')]=_['intersection'](_0x323d73[_0xac1f('0x42')],qs[_0xac1f('0x48')](_0x3067e6[_0xac1f('0x43')][_0xac1f('0x48')]));_0x33985e['attributes']=_0x33985e[_0xac1f('0x46')][_0xac1f('0x49')]?_0x33985e[_0xac1f('0x46')]:_0x323d73[_0xac1f('0x42')];_0x33985e[_0xac1f('0x4a')]=qs[_0xac1f('0x4b')](_0x3067e6[_0xac1f('0x43')]['sort']);_0x33985e[_0xac1f('0x4d')]=qs[_0xac1f('0x45')](_[_0xac1f('0x4c')](_0x3067e6[_0xac1f('0x43')],_0x323d73[_0xac1f('0x45')]));if(_0x3067e6[_0xac1f('0x43')]['filter']){_0x33985e['where']=_[_0xac1f('0x4e')](_0x33985e['where'],{'$or':_[_0xac1f('0x3d')](_0x33985e['attributes'],function(_0x3ca34b){var _0xde1a1c={};_0xde1a1c[_0x3ca34b]={'$like':'%'+_0x3067e6[_0xac1f('0x43')][_0xac1f('0x32')]+'%'};return _0xde1a1c;})});}_0x33985e=_[_0xac1f('0x4e')]({},_0x33985e,_0x3067e6[_0xac1f('0x4f')]);return _0x15fddd[_0xac1f('0x9f')](_0x33985e);}})[_0xac1f('0x2c')](function(_0x244e72){if(_0x244e72){_0x29f27b=_0x244e72[_0xac1f('0x49')];if(!_0x3067e6['query'][_0xac1f('0x65')](_0xac1f('0x66'))){_0x33985e[_0xac1f('0x24')]=qs[_0xac1f('0x24')](_0x3067e6[_0xac1f('0x43')]['limit']);_0x33985e[_0xac1f('0x23')]=qs['offset'](_0x3067e6['query'][_0xac1f('0x23')]);}return _0x15fddd[_0xac1f('0x9f')](_0x33985e);}})['then'](function(_0x1e7ca3){if(_0x1e7ca3){return _0x1e7ca3?{'count':_0x29f27b,'rows':_0x1e7ca3}:null;}})[_0xac1f('0x2c')](respondWithResult(_0x5d7f76,null))[_0xac1f('0x54')](handleError(_0x5d7f76,null));};exports[_0xac1f('0xa1')]=function(_0x301a4a,_0x48840c,_0x15d006){var _0x261f55=moment()[_0xac1f('0x7f')](_0xac1f('0xa2'));var _0x1ce770,_0x2ec1dc;return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0x301a4a['params']['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x48840c,null))['then'](function(_0x36858d){if(_0x36858d){_0x2ec1dc=_0x36858d;return _0x36858d[_0xac1f('0xa1')](_0x301a4a['body']['ids'],_[_0xac1f('0x5e')](_0x301a4a['body'],['ids','id'])||{});}return null;})[_0xac1f('0x99')](function(_0x18ff95){var _0x2904b6;_0x1ce770=_0x18ff95||[];var _0x5c6778=[];if(_0x18ff95){for(var _0x4a2391=0x0;_0x4a2391<_0x18ff95[_0xac1f('0x49')];_0x4a2391+=0x1){var _0x56a285=_0x18ff95[_0x4a2391][_0xac1f('0x2e')]({'plain':!![]});_0x2ec1dc[_0xac1f('0xa3')]=_0x301a4a[_0xac1f('0x61')][_0xac1f('0xa3')]?_0x301a4a[_0xac1f('0x61')][_0xac1f('0xa3')]:_0x2ec1dc[_0xac1f('0xa3')];switch(_0x2ec1dc[_0xac1f('0xa3')]){case _0xac1f('0xa4'):_0x2904b6=squel['insert']()[_0xac1f('0xa5')](_0xac1f('0xa6'))[_0xac1f('0xa7')]([_0xac1f('0xa8'),'scheduledAt','ContactId',_0xac1f('0xa9'),_0xac1f('0x67'),_0xac1f('0x5f'),_0xac1f('0x60')],squel[_0xac1f('0x83')]()[_0xac1f('0x84')](_0xac1f('0xa8'),'phone')[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27',_0xac1f('0xaa'))[_0xac1f('0x84')]('id',_0xac1f('0xab'))['field'](_0x56a285[_0xac1f('0xac')]['toString'](),_0xac1f('0xa9'))[_0xac1f('0x84')](_0x301a4a[_0xac1f('0x56')]['id']['toString'](),_0xac1f('0x67'))[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27',_0xac1f('0x5f'))[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27','updatedAt')[_0xac1f('0x86')](_0xac1f('0xad'))[_0xac1f('0x4d')](_0xac1f('0xae'))[_0xac1f('0x4d')](_0xac1f('0xaf'),_0x56a285['CmListId'][_0xac1f('0xb0')]())[_0xac1f('0x4d')](_0xac1f('0xb1'))[_0xac1f('0x4d')](_0xac1f('0xb2'),squel[_0xac1f('0x83')]()[_0xac1f('0x84')](_0xac1f('0xb3'))['from'](_0xac1f('0xb4'))[_0xac1f('0x4d')]('VoiceQueueId\x20=\x20?',_0x301a4a['params']['id'][_0xac1f('0xb0')]()))[_0xac1f('0x4d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xac1f('0x83')]()[_0xac1f('0x84')]('COALESCE(phone,\x27\x27)')[_0xac1f('0x86')]('cm_hopper')[_0xac1f('0x4d')](_0xac1f('0x8a'),_0x301a4a['params']['id'][_0xac1f('0xb0')]())))[_0xac1f('0xb0')]();break;case _0xac1f('0xb5'):_0x2904b6=squel[_0xac1f('0xb6')]()[_0xac1f('0xa5')](_0xac1f('0xa6'))[_0xac1f('0xa7')]([_0xac1f('0xa8'),_0xac1f('0xaa'),_0xac1f('0xab'),_0xac1f('0xa9'),_0xac1f('0x67'),'createdAt',_0xac1f('0x60')],squel[_0xac1f('0x83')]()[_0xac1f('0x84')](_0xac1f('0xa8'),_0xac1f('0xa8'))['field']('\x27'+_0x261f55+'\x27',_0xac1f('0xaa'))[_0xac1f('0x84')]('id',_0xac1f('0xab'))['field'](_0x56a285[_0xac1f('0xac')]['toString'](),_0xac1f('0xa9'))[_0xac1f('0x84')](_0x301a4a['params']['id'][_0xac1f('0xb0')](),'VoiceQueueId')['field']('\x27'+_0x261f55+'\x27',_0xac1f('0x5f'))[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27',_0xac1f('0x60'))[_0xac1f('0x86')](_0xac1f('0xad'))[_0xac1f('0x4d')](_0xac1f('0xae'))[_0xac1f('0x4d')](_0xac1f('0xaf'),_0x56a285[_0xac1f('0xac')]['toString']())[_0xac1f('0x4d')](_0xac1f('0xb1'))[_0xac1f('0x4d')](_0xac1f('0xb2'),squel['select']()[_0xac1f('0x84')]('COALESCE(phone,\x27\x27)')[_0xac1f('0x86')]('cm_hopper')[_0xac1f('0x4d')](_0xac1f('0x8a'),_0x301a4a[_0xac1f('0x56')]['id'][_0xac1f('0xb0')]())))[_0xac1f('0xb0')]();break;default:_0x2904b6=squel[_0xac1f('0xb6')]()['into'](_0xac1f('0xa6'))['fromQuery']([_0xac1f('0xa8'),_0xac1f('0xaa'),_0xac1f('0xab'),_0xac1f('0xa9'),'VoiceQueueId',_0xac1f('0x5f'),'updatedAt'],squel[_0xac1f('0x83')]()[_0xac1f('0x84')](_0xac1f('0xa8'),_0xac1f('0xa8'))['field']('\x27'+_0x261f55+'\x27','scheduledAt')[_0xac1f('0x84')]('id','ContactId')[_0xac1f('0x84')](_0x56a285['CmListId'][_0xac1f('0xb0')](),'ListId')[_0xac1f('0x84')](_0x301a4a['params']['id'][_0xac1f('0xb0')](),_0xac1f('0x67'))[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27',_0xac1f('0x5f'))['field']('\x27'+_0x261f55+'\x27',_0xac1f('0x60'))['from'](_0xac1f('0xad'))[_0xac1f('0x4d')]('deletedAt\x20IS\x20NULL')[_0xac1f('0x4d')]('ListId\x20=\x20?',_0x56a285[_0xac1f('0xac')][_0xac1f('0xb0')]())[_0xac1f('0x4d')](_0xac1f('0xb1')))[_0xac1f('0xb0')]();}_0x5c6778['push'](db[_0xac1f('0x8e')][_0xac1f('0x43')](_0x2904b6));}return BPromise[_0xac1f('0x90')](_0x5c6778);}})[_0xac1f('0x2c')](function(){var _0x369dc2=[];var _0x34f06b=squel[_0xac1f('0xb6')]()['into'](_0xac1f('0xb7'))[_0xac1f('0xa7')]([_0xac1f('0xb8'),_0xac1f('0xa8'),_0xac1f('0xb9'),_0xac1f('0x5f'),_0xac1f('0x60')],squel[_0xac1f('0x83')]()[_0xac1f('0x84')](_0xac1f('0xba'))[_0xac1f('0x84')](_0xac1f('0xbb'))[_0xac1f('0x84')]('ci.OrderBy+1')[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27',_0xac1f('0x5f'))[_0xac1f('0x84')]('\x27'+_0x261f55+'\x27',_0xac1f('0x60'))[_0xac1f('0x86')](_0xac1f('0xbc'),'ci')[_0xac1f('0x88')](_0xac1f('0xa6'),'h',_0xac1f('0xbd'))[_0xac1f('0x4d')](_0xac1f('0xbe'),_0x261f55)[_0xac1f('0x4d')]('ci.ItemClass=?',_0xac1f('0xbf')))[_0xac1f('0xb0')]();_0x369dc2[_0xac1f('0x8d')](db['sequelize']['query'](_0x34f06b));return BPromise[_0xac1f('0x90')](_0x369dc2);})[_0xac1f('0x2c')](function(){return _0x1ce770;})['then'](respondWithResult(_0x48840c,null))[_0xac1f('0x54')](handleError(_0x48840c,null));};exports[_0xac1f('0xc0')]=function(_0x1c3940,_0xf68d08,_0xca035c){return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0x1c3940[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0xf68d08,null))['then'](function(_0x1b3490){if(_0x1b3490){return _0x1b3490[_0xac1f('0xc0')](_0x1c3940[_0xac1f('0x43')][_0xac1f('0x82')]);}})['then'](function(_0x1a20a3){if(_0x1a20a3){return db[_0xac1f('0x64')][_0xac1f('0x2d')]({'where':{'ListId':_0x1c3940[_0xac1f('0x43')][_0xac1f('0x82')],'VoiceQueueId':_0x1c3940[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](function(){return _0x1a20a3;});}})['then'](respondWithStatusCode(_0xf68d08,null))['catch'](handleError(_0xf68d08,null));};exports[_0xac1f('0xc1')]=function(_0x7316c4,_0x47138b,_0x5b9f0e){var _0x372a43={};var _0x18f1df={};var _0x2714b7;var _0x339089;return db[_0xac1f('0x3e')][_0xac1f('0x69')]({'where':{'id':_0x7316c4[_0xac1f('0x56')]['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x47138b,null))[_0xac1f('0x2c')](function(_0x5ec98f){if(_0x5ec98f){_0x2714b7=_0x5ec98f;_0x18f1df[_0xac1f('0x42')]=_[_0xac1f('0x44')](db[_0xac1f('0xa0')][_0xac1f('0x3f')]);_0x18f1df[_0xac1f('0x43')]=_[_0xac1f('0x44')](_0x7316c4[_0xac1f('0x43')]);_0x18f1df[_0xac1f('0x45')]=_['intersection'](_0x18f1df[_0xac1f('0x42')],_0x18f1df[_0xac1f('0x43')]);_0x372a43[_0xac1f('0x46')]=_['intersection'](_0x18f1df[_0xac1f('0x42')],qs[_0xac1f('0x48')](_0x7316c4[_0xac1f('0x43')][_0xac1f('0x48')]));_0x372a43[_0xac1f('0x46')]=_0x372a43[_0xac1f('0x46')][_0xac1f('0x49')]?_0x372a43[_0xac1f('0x46')]:_0x18f1df['model'];_0x372a43['order']=qs['sort'](_0x7316c4[_0xac1f('0x43')]['sort']);_0x372a43[_0xac1f('0x4d')]=qs[_0xac1f('0x45')](_['pick'](_0x7316c4[_0xac1f('0x43')],_0x18f1df[_0xac1f('0x45')]));if(_0x7316c4[_0xac1f('0x43')]['filter']){_0x372a43[_0xac1f('0x4d')]=_[_0xac1f('0x4e')](_0x372a43['where'],{'$or':_[_0xac1f('0x3d')](_0x372a43['attributes'],function(_0x208ea3){var _0x4e6565={};_0x4e6565[_0x208ea3]={'$like':'%'+_0x7316c4['query'][_0xac1f('0x32')]+'%'};return _0x4e6565;})});}_0x372a43=_['merge']({},_0x372a43,_0x7316c4[_0xac1f('0x4f')]);return _0x2714b7[_0xac1f('0xc1')](_0x372a43);}})[_0xac1f('0x2c')](function(_0x34d82b){if(_0x34d82b){_0x339089=_0x34d82b[_0xac1f('0x49')];if(!_0x7316c4[_0xac1f('0x43')][_0xac1f('0x65')](_0xac1f('0x66'))){_0x372a43[_0xac1f('0x24')]=qs['limit'](_0x7316c4[_0xac1f('0x43')][_0xac1f('0x24')]);_0x372a43[_0xac1f('0x23')]=qs[_0xac1f('0x23')](_0x7316c4[_0xac1f('0x43')][_0xac1f('0x23')]);}return _0x2714b7[_0xac1f('0xc1')](_0x372a43);}})[_0xac1f('0x2c')](function(_0x156b13){if(_0x156b13){return _0x156b13?{'count':_0x339089,'rows':_0x156b13}:null;}})[_0xac1f('0x2c')](respondWithResult(_0x47138b,null))[_0xac1f('0x54')](handleError(_0x47138b,null));};exports[_0xac1f('0xc2')]=function(_0x55f31a,_0x4bbe57,_0x23e873){var _0xc0b865,_0x3765ff;return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0x55f31a['params']['id']}})['then'](handleEntityNotFound(_0x4bbe57,null))[_0xac1f('0x2c')](function(_0x23f615){if(_0x23f615){_0x3765ff=_0x23f615;return _0x23f615['addBlackLists'](_0x55f31a[_0xac1f('0x61')]['ids'],_['omit'](_0x55f31a['body'],[_0xac1f('0x82'),'id'])||{});}return null;})['spread'](function(_0x2c45f5){var _0x80524b;_0xc0b865=_0x2c45f5||[];var _0x414080=[];if(_0x2c45f5){for(var _0x11a9cf=0x0;_0x11a9cf<_0x2c45f5[_0xac1f('0x49')];_0x11a9cf+=0x1){var _0x1f6fad=_0x2c45f5[_0x11a9cf][_0xac1f('0x2e')]({'plain':!![]});_0x80524b=squel[_0xac1f('0xb6')]()[_0xac1f('0xa5')]('cm_hopper_black')[_0xac1f('0xa7')]([_0xac1f('0xa8'),'ContactId',_0xac1f('0xa9'),'VoiceQueueId',_0xac1f('0x5f'),_0xac1f('0x60')],squel[_0xac1f('0x83')]()[_0xac1f('0x84')](_0xac1f('0xa8'),'phone')['field']('id',_0xac1f('0xab'))[_0xac1f('0x84')](_0x1f6fad['CmListId'][_0xac1f('0xb0')](),_0xac1f('0xa9'))[_0xac1f('0x84')](_0x55f31a[_0xac1f('0x56')]['id'][_0xac1f('0xb0')](),_0xac1f('0x67'))[_0xac1f('0x84')](_0xac1f('0xc3'),_0xac1f('0x5f'))[_0xac1f('0x84')](_0xac1f('0xc3'),_0xac1f('0x60'))[_0xac1f('0x86')](_0xac1f('0xad'))[_0xac1f('0x4d')](_0xac1f('0xae'))[_0xac1f('0x4d')](_0xac1f('0xaf'),_0x1f6fad['CmListId'][_0xac1f('0xb0')]())['where'](_0xac1f('0xb1')))[_0xac1f('0xb0')]();_0x414080[_0xac1f('0x8d')](db[_0xac1f('0x8e')][_0xac1f('0x43')](_0x80524b));}return BPromise[_0xac1f('0x90')](_0x414080);}})['then'](function(){return _0xc0b865;})['then'](respondWithResult(_0x4bbe57,null))[_0xac1f('0x54')](handleError(_0x4bbe57,null));};exports['removeBlackLists']=function(_0x387116,_0x1548af,_0xc00584){return db[_0xac1f('0x3e')][_0xac1f('0x35')]({'where':{'id':_0x387116['params']['id']}})[_0xac1f('0x2c')](handleEntityNotFound(_0x1548af,null))[_0xac1f('0x2c')](function(_0x150311){if(_0x150311){return _0x150311[_0xac1f('0xc4')](_0x387116[_0xac1f('0x43')][_0xac1f('0x82')]);}})['then'](function(_0x322cb9){if(_0x322cb9){return db[_0xac1f('0x6e')][_0xac1f('0x2d')]({'where':{'ListId':_0x387116[_0xac1f('0x43')][_0xac1f('0x82')],'VoiceQueueId':_0x387116['params']['id']}})[_0xac1f('0x2c')](function(){return _0x322cb9;});}})['then'](respondWithStatusCode(_0x1548af,null))[_0xac1f('0x54')](handleError(_0x1548af,null));}; \ No newline at end of file +var _0x870d=['addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','h.id','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','VoiceQueues','inbound','QueueCampaigns','filter','map','value','find','error','name','send','index','VoiceQueue','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','createdAt','updatedAt','omit','destroy','getHoppers','findOne','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','nolimit','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','addAgents','spread','online','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1135b1,_0x644ab2){var _0x387f6b=function(_0x515757){while(--_0x515757){_0x1135b1['push'](_0x1135b1['shift']());}};_0x387f6b(++_0x644ab2);}(_0x870d,0xde));var _0xd870=function(_0x562cd8,_0xa31e8a){_0x562cd8=_0x562cd8-0x0;var _0x282635=_0x870d[_0x562cd8];return _0x282635;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd870('0x0'));var zipdir=require(_0xd870('0x1'));var jsonpatch=require(_0xd870('0x2'));var rp=require(_0xd870('0x3'));var moment=require(_0xd870('0x4'));var BPromise=require(_0xd870('0x5'));var Mustache=require('mustache');var util=require(_0xd870('0x6'));var path=require(_0xd870('0x7'));var sox=require(_0xd870('0x8'));var csv=require(_0xd870('0x9'));var ejs=require(_0xd870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd870('0xb'));var squel=require(_0xd870('0xc'));var crypto=require(_0xd870('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd870('0x9'));var querystring=require(_0xd870('0xe'));var Papa=require(_0xd870('0xf'));var Redis=require(_0xd870('0x10'));var authService=require(_0xd870('0x11'));var qs=require(_0xd870('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd870('0x13'))(_0xd870('0x14'));var utils=require(_0xd870('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd870('0x16'));var db=require(_0xd870('0x17'))['db'];config['redis']=_[_0xd870('0x18')](config[_0xd870('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd870('0x1a'))(new Redis(config['redis']));require(_0xd870('0x1b'))[_0xd870('0x1c')](socket);function respondWithStatusCode(_0x424f06,_0xeeb807){_0xeeb807=_0xeeb807||0xcc;return function(_0x49b5d8){if(_0x49b5d8){return _0x424f06[_0xd870('0x1d')](_0xeeb807);}return _0x424f06[_0xd870('0x1e')](_0xeeb807)['end']();};}function respondWithResult(_0x14e306,_0x356c8e){_0x356c8e=_0x356c8e||0xc8;return function(_0x427f90){if(_0x427f90){return _0x14e306['status'](_0x356c8e)[_0xd870('0x1f')](_0x427f90);}};}function respondWithFilteredResult(_0xc1f658,_0x5bd92c){return function(_0x2b7286){if(_0x2b7286){var _0x232cd7=typeof _0x5bd92c['offset']===_0xd870('0x20')&&typeof _0x5bd92c[_0xd870('0x21')]==='undefined';var _0x2e33a2=_0x2b7286[_0xd870('0x22')];var _0x475d52=_0x232cd7?0x0:_0x5bd92c[_0xd870('0x23')];var _0x503513=_0x232cd7?_0x2b7286['count']:_0x5bd92c[_0xd870('0x23')]+_0x5bd92c[_0xd870('0x21')];var _0x4dd75e;if(_0x503513>=_0x2e33a2){_0x503513=_0x2e33a2;_0x4dd75e=0xc8;}else{_0x4dd75e=0xce;}_0xc1f658['status'](_0x4dd75e);return _0xc1f658[_0xd870('0x24')](_0xd870('0x25'),_0x475d52+'-'+_0x503513+'/'+_0x2e33a2)[_0xd870('0x1f')](_0x2b7286);}return null;};}function patchUpdates(_0x247b90){return function(_0x4af534){try{jsonpatch[_0xd870('0x26')](_0x4af534,_0x247b90,!![]);}catch(_0x134b84){return BPromise['reject'](_0x134b84);}return _0x4af534[_0xd870('0x27')]();};}function saveUpdates(_0x44787d,_0x20cfcc){return function(_0xcbd2bf){if(_0xcbd2bf){return _0xcbd2bf[_0xd870('0x28')](_0x44787d)[_0xd870('0x29')](function(_0x3dbf19){return _0x3dbf19;});}return null;};}function removeEntity(_0xf22ff7,_0x2fa5bd){return function(_0x5c2cb4){if(_0x5c2cb4){return _0x5c2cb4['destroy']()[_0xd870('0x29')](function(){var _0x201c8f=_0x5c2cb4['get']({'plain':!![]});var _0x2ed80a=[{'name':_0xd870('0x2a'),'value':_0xd870('0x2b'),'ignore':![]},{'name':_0xd870('0x2c'),'value':'outbound','ignore':![]}];var _0x335c11=_(_0x2ed80a)[_0xd870('0x2d')]('ignore')[_0xd870('0x2e')]('value')[_0xd870('0x2f')]();if(_['includes'](_0x335c11,_0x201c8f['type'])){return;}var _0x53f41e=_[_0xd870('0x30')](_0x2ed80a,[_0xd870('0x2f'),_0x201c8f['type']])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x53f41e,'resourceId':_0x201c8f['id']}})[_0xd870('0x29')](function(){return _0x5c2cb4;});})['then'](function(){_0xf22ff7[_0xd870('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49176f,_0x156046){return function(_0x57f8f4){if(!_0x57f8f4){_0x49176f[_0xd870('0x1d')](0x194);}return _0x57f8f4;};}function handleError(_0x419354,_0x39c434){_0x39c434=_0x39c434||0x1f4;return function(_0x4ac56e){logger[_0xd870('0x31')](_0x4ac56e['stack']);if(_0x4ac56e[_0xd870('0x32')]){delete _0x4ac56e[_0xd870('0x32')];}_0x419354['status'](_0x39c434)[_0xd870('0x33')](_0x4ac56e);};}exports[_0xd870('0x34')]=function(_0x3306ed,_0x288c17){var _0x41a7af={},_0x56768f={},_0x2b26bc={'count':0x0,'rows':[]};var _0x558d01=_[_0xd870('0x2e')](db[_0xd870('0x35')]['rawAttributes'],function(_0x14a102){return{'name':_0x14a102['fieldName'],'type':_0x14a102[_0xd870('0x36')][_0xd870('0x37')]};});_0x56768f[_0xd870('0x38')]=_[_0xd870('0x2e')](_0x558d01,_0xd870('0x32'));_0x56768f[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x3306ed['query']);_0x56768f[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x56768f[_0xd870('0x38')],_0x56768f['query']);_0x41a7af[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x56768f[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x3306ed['query']['fields']));_0x41a7af[_0xd870('0x3d')]=_0x41a7af[_0xd870('0x3d')][_0xd870('0x3f')]?_0x41a7af[_0xd870('0x3d')]:_0x56768f[_0xd870('0x38')];if(!_0x3306ed['query'][_0xd870('0x40')]('nolimit')){_0x41a7af[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x3306ed[_0xd870('0x39')]['limit']);_0x41a7af['offset']=qs['offset'](_0x3306ed[_0xd870('0x39')][_0xd870('0x23')]);}_0x41a7af[_0xd870('0x41')]=qs['sort'](_0x3306ed[_0xd870('0x39')][_0xd870('0x42')]);_0x41a7af[_0xd870('0x43')]=qs['filters'](_[_0xd870('0x44')](_0x3306ed['query'],_0x56768f[_0xd870('0x3b')]),_0x558d01);if(_0x3306ed[_0xd870('0x39')][_0xd870('0x2d')]){_0x41a7af['where']=_[_0xd870('0x45')](_0x41a7af['where'],{'$or':_['map'](_0x558d01,function(_0x4276af){if(_0x4276af[_0xd870('0x36')]!==_0xd870('0x46')){var _0x3ba47c={};_0x3ba47c[_0x4276af[_0xd870('0x32')]]={'$like':'%'+_0x3306ed['query'][_0xd870('0x2d')]+'%'};return _0x3ba47c;}})});}_0x41a7af=_['merge']({},_0x41a7af,_0x3306ed[_0xd870('0x47')]);var _0x402610={'where':_0x41a7af[_0xd870('0x43')]};return db[_0xd870('0x35')][_0xd870('0x22')](_0x402610)[_0xd870('0x29')](function(_0x2fd79c){_0x2b26bc[_0xd870('0x22')]=_0x2fd79c;if(_0x3306ed[_0xd870('0x39')][_0xd870('0x48')]){_0x41a7af[_0xd870('0x49')]=[{'all':!![]}];}return db[_0xd870('0x35')][_0xd870('0x4a')](_0x41a7af);})[_0xd870('0x29')](function(_0x1f05a9){_0x2b26bc[_0xd870('0x4b')]=_0x1f05a9;return _0x2b26bc;})[_0xd870('0x29')](respondWithFilteredResult(_0x288c17,_0x41a7af))[_0xd870('0x4c')](handleError(_0x288c17,null));};exports['show']=function(_0x574c62,_0x15a97c){var _0x1e2af7={'raw':![],'where':{'id':_0x574c62[_0xd870('0x4d')]['id']}},_0x498d39={};_0x498d39['model']=_[_0xd870('0x3a')](db[_0xd870('0x35')]['rawAttributes']);_0x498d39['query']=_[_0xd870('0x3a')](_0x574c62['query']);_0x498d39[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x498d39[_0xd870('0x38')],_0x498d39[_0xd870('0x39')]);_0x1e2af7[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x498d39[_0xd870('0x38')],qs['fields'](_0x574c62[_0xd870('0x39')][_0xd870('0x3e')]));_0x1e2af7[_0xd870('0x3d')]=_0x1e2af7[_0xd870('0x3d')][_0xd870('0x3f')]?_0x1e2af7[_0xd870('0x3d')]:_0x498d39[_0xd870('0x38')];if(_0x574c62['query']['includeAll']){_0x1e2af7[_0xd870('0x49')]=[{'all':!![]}];}_0x1e2af7=_['merge']({},_0x1e2af7,_0x574c62[_0xd870('0x47')]);return db[_0xd870('0x35')][_0xd870('0x30')](_0x1e2af7)[_0xd870('0x29')](handleEntityNotFound(_0x15a97c,null))[_0xd870('0x29')](respondWithResult(_0x15a97c,null))[_0xd870('0x4c')](handleError(_0x15a97c,null));};exports[_0xd870('0x4e')]=function(_0x5789d4,_0x2c19c6){return db[_0xd870('0x35')][_0xd870('0x4e')](_0x5789d4[_0xd870('0x4f')],{})[_0xd870('0x29')](function(_0x400f4e){var _0x4c9ed7=_0x5789d4[_0xd870('0x50')][_0xd870('0x51')]({'plain':!![]});if(!_0x4c9ed7)throw new Error(_0xd870('0x52'));if(_0x4c9ed7[_0xd870('0x53')]===_0xd870('0x50')){var _0x4bd445=_0x400f4e[_0xd870('0x51')]({'plain':!![]});var _0xa28fba=[{'name':'VoiceQueues','value':_0xd870('0x2b')},{'name':_0xd870('0x2c'),'value':'outbound'}];var _0x27d648=_[_0xd870('0x30')](_0xa28fba,[_0xd870('0x2f'),_0x4bd445[_0xd870('0x36')]])[_0xd870('0x32')];return db[_0xd870('0x54')]['find']({'where':{'name':_0x27d648,'userProfileId':_0x4c9ed7[_0xd870('0x55')]},'raw':!![]})[_0xd870('0x29')](function(_0x16e2f4){if(_0x16e2f4&&_0x16e2f4[_0xd870('0x56')]===0x0){return db[_0xd870('0x57')]['create']({'name':_0x4bd445[_0xd870('0x32')],'resourceId':_0x4bd445['id'],'type':_0x16e2f4[_0xd870('0x32')],'sectionId':_0x16e2f4['id']},{})[_0xd870('0x29')](function(){return _0x400f4e;});}else{return _0x400f4e;}})[_0xd870('0x4c')](function(_0x128b40){logger['error'](_0xd870('0x58'),_0x128b40);throw _0x128b40;});}return _0x400f4e;})[_0xd870('0x29')](respondWithResult(_0x2c19c6,0xc9))['catch'](handleError(_0x2c19c6,null));};exports[_0xd870('0x59')]=function(_0xf1b544,_0x14e4a6){var _0x3feffd={'where':{'id':_0xf1b544[_0xd870('0x4d')]['id']}},_0x5c15a1={};_0x5c15a1['model']=_[_0xd870('0x3a')](db[_0xd870('0x35')][_0xd870('0x5a')]);_0x3feffd[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x5c15a1[_0xd870('0x38')],qs['fields'](_0xf1b544['query'][_0xd870('0x3e')]));_0x3feffd['attributes']=_0x3feffd[_0xd870('0x3d')][_0xd870('0x3f')]?_0x3feffd[_0xd870('0x3d')]:_0x5c15a1['model'];if(_0xf1b544[_0xd870('0x39')][_0xd870('0x48')]){_0x3feffd[_0xd870('0x49')]=[{'all':!![]}];}_0x3feffd=_['merge']({},_0x3feffd,_0xf1b544['options']);return db[_0xd870('0x35')][_0xd870('0x30')](_0x3feffd)['then'](handleEntityNotFound(_0x14e4a6,null))[_0xd870('0x29')](function(_0x746e00){if(_0x746e00){var _0x9c365=_0x746e00[_0xd870('0x51')]({'plain':!![]});_0x9c365=qs['omit'](_0x9c365,['id',_0xd870('0x5b'),_0xd870('0x5c')]);_0xf1b544[_0xd870('0x4f')]=_[_0xd870('0x5d')](_0xf1b544[_0xd870('0x4f')],['id','createdAt','updatedAt']);return db[_0xd870('0x35')][_0xd870('0x4e')](_[_0xd870('0x45')](_0x9c365,_0xf1b544[_0xd870('0x4f')]),{'include':_0xf1b544['query'][_0xd870('0x48')]?[{'all':!![]}]:undefined})[_0xd870('0x29')](function(_0x2adf5e){var _0x51e771=_0xf1b544[_0xd870('0x50')][_0xd870('0x51')]({'plain':!![]});if(!_0x51e771)throw new Error(_0xd870('0x52'));if(_0x51e771[_0xd870('0x53')]===_0xd870('0x50')){var _0x10c08f=_0x2adf5e[_0xd870('0x51')]({'plain':!![]});var _0x25ce00=[{'name':_0xd870('0x2a'),'value':_0xd870('0x2b')},{'name':_0xd870('0x2c'),'value':'outbound'}];var _0x1b335a=_[_0xd870('0x30')](_0x25ce00,['value',_0x10c08f['type']])[_0xd870('0x32')];return db[_0xd870('0x54')]['find']({'where':{'name':_0x1b335a,'userProfileId':_0x51e771['userProfileId']},'raw':!![]})[_0xd870('0x29')](function(_0x206ade){if(_0x206ade&&_0x206ade[_0xd870('0x56')]===0x0){return db[_0xd870('0x57')][_0xd870('0x4e')]({'name':_0x10c08f[_0xd870('0x32')],'resourceId':_0x10c08f['id'],'type':_0x206ade['name'],'sectionId':_0x206ade['id']},{})[_0xd870('0x29')](function(){return _0x2adf5e;});}else{return _0x2adf5e;}})[_0xd870('0x4c')](function(_0x5ee0b0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee0b0);throw _0x5ee0b0;});}return _0x2adf5e;});}})[_0xd870('0x29')](respondWithResult(_0x14e4a6,0xc9))[_0xd870('0x4c')](handleError(_0x14e4a6,null));};exports[_0xd870('0x28')]=function(_0x306f00,_0x149094){if(_0x306f00['body']['id']){delete _0x306f00[_0xd870('0x4f')]['id'];}return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x306f00['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x149094,null))[_0xd870('0x29')](saveUpdates(_0x306f00[_0xd870('0x4f')],null))[_0xd870('0x29')](respondWithResult(_0x149094,null))[_0xd870('0x4c')](handleError(_0x149094,null));};exports[_0xd870('0x5e')]=function(_0x43ce47,_0x2ce180){return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x43ce47[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2ce180,null))[_0xd870('0x29')](removeEntity(_0x2ce180,null))[_0xd870('0x4c')](handleError(_0x2ce180,null));};exports[_0xd870('0x5f')]=function(_0x5b7d55,_0x2f96a5,_0x1d8cbd){var _0x1dd047={'raw':![],'where':{}};var _0x4758eb={};var _0x3daa2e={'count':0x0,'rows':[]};return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x5b7d55[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2f96a5,null))[_0xd870('0x29')](function(_0x51a285){if(_0x51a285){_0x4758eb['model']=_[_0xd870('0x3a')](db['CmHopper'][_0xd870('0x5a')]);_0x4758eb[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x5b7d55[_0xd870('0x39')]);_0x4758eb[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x4758eb[_0xd870('0x38')],_0x4758eb[_0xd870('0x39')]);_0x1dd047[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x4758eb['model'],qs[_0xd870('0x3e')](_0x5b7d55['query']['fields']));_0x1dd047[_0xd870('0x3d')]=_0x1dd047['attributes']['length']?_0x1dd047[_0xd870('0x3d')]:_0x4758eb[_0xd870('0x38')];if(!_0x5b7d55[_0xd870('0x39')]['hasOwnProperty']('nolimit')){_0x1dd047[_0xd870('0x21')]=qs['limit'](_0x5b7d55[_0xd870('0x39')]['limit']);_0x1dd047['offset']=qs[_0xd870('0x23')](_0x5b7d55[_0xd870('0x39')][_0xd870('0x23')]);}_0x1dd047[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x5b7d55[_0xd870('0x39')][_0xd870('0x42')]);_0x1dd047['where']=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x5b7d55[_0xd870('0x39')],_0x4758eb[_0xd870('0x3b')]));_0x1dd047['where'][_0xd870('0x61')]=_0x51a285['id'];if(_0x5b7d55[_0xd870('0x39')]['filter']){_0x1dd047[_0xd870('0x43')]=_[_0xd870('0x45')](_0x1dd047[_0xd870('0x43')],{'$or':_[_0xd870('0x2e')](_0x1dd047['attributes'],function(_0x35bee1){var _0x11cf08={};_0x11cf08[_0x35bee1]={'$like':'%'+_0x5b7d55['query'][_0xd870('0x2d')]+'%'};return _0x11cf08;})});}_0x1dd047=_[_0xd870('0x45')]({},_0x1dd047,_0x5b7d55[_0xd870('0x47')]);return db[_0xd870('0x62')]['count']({'where':_0x1dd047[_0xd870('0x43')]})[_0xd870('0x29')](function(_0x23d3a4){_0x3daa2e[_0xd870('0x22')]=_0x23d3a4;if(_0x5b7d55[_0xd870('0x39')][_0xd870('0x48')]){_0x1dd047[_0xd870('0x49')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1dd047);})[_0xd870('0x29')](function(_0x1dbc13){_0x3daa2e['rows']=_0x1dbc13;return _0x3daa2e;});}})[_0xd870('0x29')](respondWithFilteredResult(_0x2f96a5,_0x1dd047))[_0xd870('0x4c')](handleError(_0x2f96a5,null));};exports[_0xd870('0x63')]=function(_0xddee85,_0x58d4fb,_0x59daa3){var _0x5149df={'raw':!![],'where':{}};var _0x5bca31={};var _0x382c29={'count':0x0,'rows':[]};return db[_0xd870('0x35')]['findOne']({'where':{'id':_0xddee85[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x58d4fb,null))[_0xd870('0x29')](function(_0x1e6a75){if(_0x1e6a75){_0x5bca31[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x64')]['rawAttributes']);_0x5bca31['query']=_[_0xd870('0x3a')](_0xddee85[_0xd870('0x39')]);_0x5bca31[_0xd870('0x3b')]=_['intersection'](_0x5bca31[_0xd870('0x38')],_0x5bca31[_0xd870('0x39')]);_0x5149df[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x5bca31['model'],qs[_0xd870('0x3e')](_0xddee85[_0xd870('0x39')][_0xd870('0x3e')]));_0x5149df[_0xd870('0x3d')]=_0x5149df[_0xd870('0x3d')][_0xd870('0x3f')]?_0x5149df[_0xd870('0x3d')]:_0x5bca31['model'];if(!_0xddee85['query'][_0xd870('0x40')](_0xd870('0x65'))){_0x5149df[_0xd870('0x21')]=qs[_0xd870('0x21')](_0xddee85['query']['limit']);_0x5149df[_0xd870('0x23')]=qs[_0xd870('0x23')](_0xddee85[_0xd870('0x39')][_0xd870('0x23')]);}_0x5149df[_0xd870('0x41')]=qs['sort'](_0xddee85['query'][_0xd870('0x42')]);_0x5149df[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0xddee85[_0xd870('0x39')],_0x5bca31[_0xd870('0x3b')]));_0x5149df[_0xd870('0x43')][_0xd870('0x61')]=_0x1e6a75['id'];if(_0xddee85[_0xd870('0x39')][_0xd870('0x2d')]){_0x5149df[_0xd870('0x43')]=_[_0xd870('0x45')](_0x5149df[_0xd870('0x43')],{'$or':_[_0xd870('0x2e')](_0x5149df[_0xd870('0x3d')],function(_0x5aaca5){var _0x5b4ab3={};_0x5b4ab3[_0x5aaca5]={'$like':'%'+_0xddee85[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x5b4ab3;})});}_0x5149df=_[_0xd870('0x45')]({},_0x5149df,_0xddee85[_0xd870('0x47')]);return db[_0xd870('0x64')][_0xd870('0x22')]({'where':_0x5149df[_0xd870('0x43')]})[_0xd870('0x29')](function(_0x49bd7f){_0x382c29[_0xd870('0x22')]=_0x49bd7f;if(_0xddee85[_0xd870('0x39')][_0xd870('0x48')]){_0x5149df[_0xd870('0x49')]=[{'all':!![]}];}return db[_0xd870('0x64')][_0xd870('0x4a')](_0x5149df);})['then'](function(_0x1886ce){_0x382c29[_0xd870('0x4b')]=_0x1886ce;return _0x382c29;});}})[_0xd870('0x29')](respondWithFilteredResult(_0x58d4fb,_0x5149df))[_0xd870('0x4c')](handleError(_0x58d4fb,null));};exports['getHopperFinals']=function(_0x269233,_0x144d71,_0x4089d4){var _0xb619b8={'raw':!![],'where':{}};var _0x59a66b={};var _0x2f8395={'count':0x0,'rows':[]};return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x269233['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x144d71,null))['then'](function(_0x12db91){if(_0x12db91){_0x59a66b['model']=_[_0xd870('0x3a')](db['CmHopperFinal'][_0xd870('0x5a')]);_0x59a66b['query']=_['keys'](_0x269233[_0xd870('0x39')]);_0x59a66b[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x59a66b['model'],_0x59a66b['query']);_0xb619b8[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x59a66b[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x269233[_0xd870('0x39')][_0xd870('0x3e')]));_0xb619b8['attributes']=_0xb619b8[_0xd870('0x3d')]['length']?_0xb619b8[_0xd870('0x3d')]:_0x59a66b[_0xd870('0x38')];if(!_0x269233[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0xb619b8[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x269233[_0xd870('0x39')]['limit']);_0xb619b8[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x269233[_0xd870('0x39')]['offset']);}_0xb619b8[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x269233[_0xd870('0x39')][_0xd870('0x42')]);_0xb619b8[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x269233[_0xd870('0x39')],_0x59a66b[_0xd870('0x3b')]));_0xb619b8[_0xd870('0x43')][_0xd870('0x61')]=_0x12db91['id'];if(_0x269233[_0xd870('0x39')][_0xd870('0x2d')]){_0xb619b8[_0xd870('0x43')]=_[_0xd870('0x45')](_0xb619b8['where'],{'$or':_['map'](_0xb619b8[_0xd870('0x3d')],function(_0x5da36c){var _0x4af142={};_0x4af142[_0x5da36c]={'$like':'%'+_0x269233[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x4af142;})});}_0xb619b8=_['merge']({},_0xb619b8,_0x269233[_0xd870('0x47')]);return db['CmHopperFinal']['count']({'where':_0xb619b8['where']})[_0xd870('0x29')](function(_0x4cb610){_0x2f8395[_0xd870('0x22')]=_0x4cb610;if(_0x269233[_0xd870('0x39')][_0xd870('0x48')]){_0xb619b8[_0xd870('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd870('0x4a')](_0xb619b8);})[_0xd870('0x29')](function(_0x507995){_0x2f8395[_0xd870('0x4b')]=_0x507995;return _0x2f8395;});}})[_0xd870('0x29')](respondWithFilteredResult(_0x144d71,_0xb619b8))['catch'](handleError(_0x144d71,null));};exports[_0xd870('0x66')]=function(_0x1b4a4c,_0x11fc04,_0x83ed91){var _0x48a835={'raw':!![],'where':{}};var _0x57b228={};var _0x2cfd76={'count':0x0,'rows':[]};return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x1b4a4c[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x11fc04,null))[_0xd870('0x29')](function(_0x4fbd8d){if(_0x4fbd8d){_0x57b228[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x67')][_0xd870('0x5a')]);_0x57b228[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x1b4a4c[_0xd870('0x39')]);_0x57b228[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x57b228['model'],_0x57b228[_0xd870('0x39')]);_0x48a835[_0xd870('0x3d')]=_['intersection'](_0x57b228[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x1b4a4c[_0xd870('0x39')]['fields']));_0x48a835[_0xd870('0x3d')]=_0x48a835['attributes'][_0xd870('0x3f')]?_0x48a835[_0xd870('0x3d')]:_0x57b228[_0xd870('0x38')];if(!_0x1b4a4c[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0x48a835[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x1b4a4c['query']['limit']);_0x48a835[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x1b4a4c[_0xd870('0x39')][_0xd870('0x23')]);}_0x48a835[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x1b4a4c[_0xd870('0x39')][_0xd870('0x42')]);_0x48a835['where']=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x1b4a4c['query'],_0x57b228[_0xd870('0x3b')]));_0x48a835['where'][_0xd870('0x61')]=_0x4fbd8d['id'];if(_0x1b4a4c[_0xd870('0x39')][_0xd870('0x2d')]){_0x48a835[_0xd870('0x43')]=_['merge'](_0x48a835[_0xd870('0x43')],{'$or':_['map'](_0x48a835['attributes'],function(_0x45ec72){var _0x5c8201={};_0x5c8201[_0x45ec72]={'$like':'%'+_0x1b4a4c[_0xd870('0x39')]['filter']+'%'};return _0x5c8201;})});}_0x48a835=_[_0xd870('0x45')]({},_0x48a835,_0x1b4a4c['options']);return db['CmHopperBlack'][_0xd870('0x22')]({'where':_0x48a835['where']})[_0xd870('0x29')](function(_0x1ae4c2){_0x2cfd76[_0xd870('0x22')]=_0x1ae4c2;if(_0x1b4a4c['query'][_0xd870('0x48')]){_0x48a835[_0xd870('0x49')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd870('0x4a')](_0x48a835);})[_0xd870('0x29')](function(_0x278810){_0x2cfd76[_0xd870('0x4b')]=_0x278810;return _0x2cfd76;});}})['then'](respondWithFilteredResult(_0x11fc04,_0x48a835))[_0xd870('0x4c')](handleError(_0x11fc04,null));};exports[_0xd870('0x68')]=function(_0x208dbf,_0x192ce6,_0x3b9758){var _0x5792f2={};var _0x5d6e21={};var _0x2bb53e;var _0x55f51d;return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x208dbf['params']['id']}})['then'](handleEntityNotFound(_0x192ce6,null))[_0xd870('0x29')](function(_0x3ca828){if(_0x3ca828){_0x2bb53e=_0x3ca828;_0x5d6e21['model']=_['keys'](db[_0xd870('0x69')][_0xd870('0x5a')]);_0x5d6e21[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x208dbf[_0xd870('0x39')]);_0x5d6e21[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x5d6e21[_0xd870('0x38')],_0x5d6e21['query']);_0x5792f2[_0xd870('0x3d')]=_['intersection'](_0x5d6e21['model'],qs[_0xd870('0x3e')](_0x208dbf[_0xd870('0x39')][_0xd870('0x3e')]));_0x5792f2[_0xd870('0x3d')]=_0x5792f2['attributes'][_0xd870('0x3f')]?_0x5792f2['attributes']:_0x5d6e21[_0xd870('0x38')];_0x5792f2['order']=qs[_0xd870('0x42')](_0x208dbf[_0xd870('0x39')][_0xd870('0x42')]);_0x5792f2[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x208dbf[_0xd870('0x39')],_0x5d6e21['filters']));if(_0x208dbf[_0xd870('0x39')][_0xd870('0x2d')]){_0x5792f2[_0xd870('0x43')]=_['merge'](_0x5792f2[_0xd870('0x43')],{'$or':_[_0xd870('0x2e')](_0x5792f2[_0xd870('0x3d')],function(_0x2a74c6){var _0x443c6b={};_0x443c6b[_0x2a74c6]={'$like':'%'+_0x208dbf[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x443c6b;})});}_0x5792f2=_['merge']({},_0x5792f2,_0x208dbf[_0xd870('0x47')]);return _0x2bb53e[_0xd870('0x68')](_0x5792f2);}})[_0xd870('0x29')](function(_0x104211){if(_0x104211){_0x55f51d=_0x104211[_0xd870('0x3f')];if(!_0x208dbf[_0xd870('0x39')]['hasOwnProperty']('nolimit')){_0x5792f2['limit']=qs[_0xd870('0x21')](_0x208dbf['query'][_0xd870('0x21')]);_0x5792f2[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x208dbf[_0xd870('0x39')][_0xd870('0x23')]);}return _0x2bb53e[_0xd870('0x68')](_0x5792f2);}})[_0xd870('0x29')](function(_0x5170e2){if(_0x5170e2){return _0x5170e2?{'count':_0x55f51d,'rows':_0x5170e2}:null;}})[_0xd870('0x29')](respondWithResult(_0x192ce6,null))[_0xd870('0x4c')](handleError(_0x192ce6,null));};exports[_0xd870('0x6a')]=function(_0x3d8571,_0x499e62,_0x1748dc){var _0x3a692d=_0x3d8571['body'][_0xd870('0x6b')];var _0x35d85d=_[_0xd870('0x2e')](_0x3a692d,'id');return db[_0xd870('0x69')][_0xd870('0x4a')]({'where':{'id':_0x35d85d},'attributes':['id'],'include':[{'model':db[_0xd870('0x6c')],'as':_0xd870('0x6d'),'attributes':['id',_0xd870('0x32'),'online',_0xd870('0x6e'),_0xd870('0x6f')],'raw':!![]}]})[_0xd870('0x29')](function(_0x39c37b){if(_0x39c37b){var _0x376756=_[_0xd870('0x70')](_0x39c37b,function(_0x4c302d){var _0x2c0984=_0x4c302d[_0xd870('0x51')]({'plain':!![]});_0x2c0984['Agents'][_0xd870('0x71')](function(_0x586d0f){_0x586d0f[_0xd870('0x72')]=_[_0xd870('0x30')](_0x3a692d,{'id':_0x2c0984['id']})[_0xd870('0x72')];});return _0x2c0984['Agents'];});return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x3d8571[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](function(_0x366234){return db[_0xd870('0x73')]['transaction'](function(_0x5e0590){return _0x366234[_0xd870('0x6a')](_0x35d85d,{'transaction':_0x5e0590})[_0xd870('0x29')](function(){return BPromise[_0xd870('0x74')](_0x3a692d,function(_0x2ff264){return db['TeamVoiceQueue'][_0xd870('0x75')]({'TeamId':_0x2ff264['id'],'VoiceQueueId':_0x3d8571['params']['id'],'penalty':_0x2ff264['penalty']},{'transaction':_0x5e0590});});})['then'](function(){return BPromise[_0xd870('0x74')](_0x376756,function(_0x1b07ea){return db[_0xd870('0x76')][_0xd870('0x77')]({'where':{'UserId':_0x1b07ea['id'],'VoiceQueueId':_0x3d8571[_0xd870('0x4d')]['id']},'defaults':{'penalty':_0x1b07ea['penalty']},'transaction':_0x5e0590});});})[_0xd870('0x29')](function(){return BPromise[_0xd870('0x74')](_[_0xd870('0x2d')](_0x376756,{'online':!![]}),function(_0x4c8048){return db[_0xd870('0x78')]['upsert']({'membername':_0x4c8048[_0xd870('0x32')],'UserId':_0x4c8048['id'],'queue_name':_0x366234[_0xd870('0x32')],'VoiceQueueId':_0x366234['id'],'interface':_[_0xd870('0x79')](_0x4c8048[_0xd870('0x6f')])?util[_0xd870('0x7a')](_0xd870('0x7b'),_0x4c8048[_0xd870('0x32')]):_0x4c8048[_0xd870('0x6f')],'paused':_0x4c8048[_0xd870('0x6e')]||![],'penalty':_0x4c8048['penalty']},{'transaction':_0x5e0590});});})[_0xd870('0x29')](function(){_0x376756[_0xd870('0x71')](function(_0xeaeff7){socket[_0xd870('0x7c')](_0xd870('0x7d'),{'UserId':_0xeaeff7['id'],'VoiceQueueId':_0x366234['id']});});});});});}})[_0xd870('0x29')](respondWithStatusCode(_0x499e62,null))[_0xd870('0x4c')](handleError(_0x499e62,null));};exports['removeTeams']=function(_0x118773,_0x833af8,_0x25b337){return db[_0xd870('0x69')]['findAll']({'where':{'id':_0x118773['query'][_0xd870('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xd870('0x6c')],'as':_0xd870('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xd870('0x29')](handleEntityNotFound(_0x833af8,null))[_0xd870('0x29')](function(_0x42b991){var _0x427eb5=_['map'](_0x42b991,'id');var _0x75ed69=[];var _0x2091bf=[];var _0x274915=squel['select']();_0x274915[_0xd870('0x7f')](_0xd870('0x80'))[_0xd870('0x81')]('team_has_voice_queues','tq')[_0xd870('0x82')]('user_has_teams','ut',_0xd870('0x83'))[_0xd870('0x43')]('VoiceQueueId\x20=\x20?',_0x118773[_0xd870('0x4d')]['id']);for(var _0x5a5794=0x0;_0x5a5794<_0x42b991['length'];_0x5a5794+=0x1){let _0x43aa5a=_0x42b991[_0x5a5794];for(var _0x1c5d6f=0x0;_0x1c5d6f<_0x43aa5a[_0xd870('0x6d')][_0xd870('0x3f')];_0x1c5d6f+=0x1){let _0x1d6f0e=_0x43aa5a[_0xd870('0x6d')][_0x1c5d6f];var _0x2a883e=_0x274915['clone']();_0x2a883e[_0xd870('0x43')](_0xd870('0x84'),_0x1d6f0e['id']);_0x2091bf[_0xd870('0x85')](db[_0xd870('0x73')][_0xd870('0x39')](_0x2a883e[_0xd870('0x86')](),{'type':db[_0xd870('0x73')]['QueryTypes'][_0xd870('0x87')]})[_0xd870('0x29')](function(_0x353820){if(_0x353820[_0xd870('0x3f')]===0x1){return _0x1d6f0e['id'];}else{var _0x2ea311=_[_0xd870('0x88')](_[_0xd870('0x2e')](_0x353820,_0xd870('0x89')),function(_0x101e99){return _[_0xd870('0x8a')](_0x427eb5,_0x101e99);});if(_0x2ea311){return _0x1d6f0e['id'];}}}));}}return BPromise[_0xd870('0x8b')](_0x2091bf)[_0xd870('0x29')](function(_0x5819dd){_0x75ed69=_(_0x75ed69)[_0xd870('0x8c')](_0x5819dd)[_0xd870('0x8d')]()[_0xd870('0x2f')]();return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x118773[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](function(_0x29079c){return db[_0xd870('0x73')][_0xd870('0x8e')](function(_0x3f176f){return _0x29079c['removeTeams'](_0x118773[_0xd870('0x39')][_0xd870('0x7e')],{'transaction':_0x3f176f})[_0xd870('0x29')](function(){if(!_[_0xd870('0x8f')](_0x75ed69)){return _0x29079c[_0xd870('0x90')](_0x75ed69,{'transaction':_0x3f176f})[_0xd870('0x29')](function(){return db['UserVoiceQueueRt'][_0xd870('0x5e')]({'where':{'VoiceQueueId':_0x118773[_0xd870('0x4d')]['id'],'UserId':_0x75ed69},'transaction':_0x3f176f});});}})[_0xd870('0x29')](function(){_0x75ed69['forEach'](function(_0x1111e0){socket[_0xd870('0x7c')]('userVoiceQueue:remove',{'UserId':_0x1111e0,'VoiceQueueId':_0x29079c['id']});});});});});});})[_0xd870('0x29')](respondWithStatusCode(_0x833af8,null))[_0xd870('0x4c')](handleError(_0x833af8,null));};exports[_0xd870('0x91')]=function(_0x16ffc3,_0x4fac07,_0x2dd050){var _0x5bd473,_0x34bbcf;return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x16ffc3[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x4fac07,null))['then'](function(_0x127515){if(_0x127515){_0x34bbcf=_0x127515;return _0x127515['addAgents'](_0x16ffc3['body'][_0xd870('0x7e')],_['omit'](_0x16ffc3[_0xd870('0x4f')],[_0xd870('0x7e'),'id'])||{})[_0xd870('0x92')](function(_0x1fceed){for(var _0x4f7eef=0x0;_0x4f7eef<_0x16ffc3[_0xd870('0x4f')]['ids'][_0xd870('0x3f')];_0x4f7eef+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x16ffc3[_0xd870('0x4f')][_0xd870('0x7e')][_0x4f7eef]),'VoiceQueueId':Number(_0x16ffc3[_0xd870('0x4d')]['id'])});}return _0x1fceed;});}})[_0xd870('0x29')](function(_0x3b3218){_0x5bd473=_0x3b3218||[];if(_0x34bbcf){return db[_0xd870('0x6c')][_0xd870('0x4a')]({'where':{'id':_0x16ffc3[_0xd870('0x4f')]['ids']},'attributes':['id',_0xd870('0x32'),_0xd870('0x93'),_0xd870('0x6e'),_0xd870('0x6f')],'raw':!![]});}})['then'](function(_0x47b29a){if(!_[_0xd870('0x8f')](_0x47b29a)){var _0x5cca7a=[];for(var _0x4b5767=0x0;_0x4b5767<_0x47b29a[_0xd870('0x3f')];_0x4b5767++){if(_0x47b29a[_0x4b5767]['online']){_0x5cca7a[_0xd870('0x85')](db[_0xd870('0x78')][_0xd870('0x75')]({'membername':_0x47b29a[_0x4b5767][_0xd870('0x32')],'UserId':_0x47b29a[_0x4b5767]['id'],'queue_name':_0x34bbcf[_0xd870('0x32')],'VoiceQueueId':_0x34bbcf['id'],'interface':_[_0xd870('0x79')](_0x47b29a[_0x4b5767][_0xd870('0x6f')])?util['format'](_0xd870('0x7b'),_0x47b29a[_0x4b5767]['name']):_0x47b29a[_0x4b5767]['interface'],'paused':_0x47b29a[_0x4b5767]['voicePause']||![],'penalty':_0x16ffc3[_0xd870('0x4f')][_0xd870('0x72')]||0x0}));}}return BPromise[_0xd870('0x8b')](_0x5cca7a);}})[_0xd870('0x29')](function(){return _0x5bd473;})['then'](respondWithResult(_0x4fac07,null))['catch'](handleError(_0x4fac07,null));};exports['removeAgents']=function(_0x125ba1,_0x276114,_0x1b0b1d){return db['VoiceQueue'][_0xd870('0x30')]({'where':{'id':_0x125ba1[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x276114,null))[_0xd870('0x29')](function(_0xccadbf){if(_0xccadbf){return _0xccadbf[_0xd870('0x90')](_0x125ba1[_0xd870('0x39')][_0xd870('0x7e')])[_0xd870('0x29')](function(){if(_[_0xd870('0x94')](_0x125ba1[_0xd870('0x39')][_0xd870('0x7e')])){for(var _0x12d247=0x0;_0x12d247<_0x125ba1[_0xd870('0x39')]['ids'][_0xd870('0x3f')];_0x12d247+=0x1){socket[_0xd870('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x125ba1['query']['ids'][_0x12d247]),'VoiceQueueId':Number(_0x125ba1[_0xd870('0x4d')]['id'])});}}else{socket[_0xd870('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x125ba1[_0xd870('0x39')][_0xd870('0x7e')]),'VoiceQueueId':Number(_0x125ba1[_0xd870('0x4d')]['id'])});}});}})[_0xd870('0x29')](function(_0x196013){return db[_0xd870('0x78')][_0xd870('0x5e')]({'where':{'VoiceQueueId':_0x125ba1[_0xd870('0x4d')]['id'],'UserId':_0x125ba1[_0xd870('0x39')]['ids']}})[_0xd870('0x29')](function(){return _0x196013;});})[_0xd870('0x29')](respondWithStatusCode(_0x276114,null))[_0xd870('0x4c')](handleError(_0x276114,null));};exports[_0xd870('0x95')]=function(_0x3f6c54,_0x2b6780,_0x11115e){var _0x407b80={};var _0x1e0b32={};var _0x111ab6;var _0x36884c;return db['VoiceQueue'][_0xd870('0x60')]({'where':{'id':_0x3f6c54['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2b6780,null))[_0xd870('0x29')](function(_0x4e32b8){if(_0x4e32b8){_0x111ab6=_0x4e32b8;_0x1e0b32[_0xd870('0x38')]=_[_0xd870('0x3a')](db['User']['rawAttributes']);_0x1e0b32[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x3f6c54[_0xd870('0x39')]);_0x1e0b32[_0xd870('0x3b')]=_['intersection'](_0x1e0b32[_0xd870('0x38')],_0x1e0b32['query']);_0x407b80['attributes']=_[_0xd870('0x3c')](_0x1e0b32['model'],qs[_0xd870('0x3e')](_0x3f6c54['query'][_0xd870('0x3e')]));_0x407b80['attributes']=_0x407b80[_0xd870('0x3d')][_0xd870('0x3f')]?_0x407b80['attributes']:_0x1e0b32[_0xd870('0x38')];_0x407b80[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x3f6c54[_0xd870('0x39')][_0xd870('0x42')]);_0x407b80[_0xd870('0x43')]=qs['filters'](_[_0xd870('0x44')](_0x3f6c54['query'],_0x1e0b32['filters']));if(_0x3f6c54['query'][_0xd870('0x2d')]){_0x407b80[_0xd870('0x43')]=_[_0xd870('0x45')](_0x407b80['where'],{'$or':_[_0xd870('0x2e')](_0x407b80[_0xd870('0x3d')],function(_0x1eba64){var _0x1f6f80={};_0x1f6f80[_0x1eba64]={'$like':'%'+_0x3f6c54[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x1f6f80;})});}_0x407b80=_[_0xd870('0x45')]({},_0x407b80,_0x3f6c54['options']);return _0x111ab6['getAgents'](_0x407b80);}})[_0xd870('0x29')](function(_0x1c5239){if(_0x1c5239){_0x36884c=_0x1c5239[_0xd870('0x3f')];if(!_0x3f6c54[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0x407b80['limit']=qs[_0xd870('0x21')](_0x3f6c54[_0xd870('0x39')][_0xd870('0x21')]);_0x407b80['offset']=qs['offset'](_0x3f6c54[_0xd870('0x39')]['offset']);}return _0x111ab6[_0xd870('0x95')](_0x407b80);}})[_0xd870('0x29')](function(_0x52b668){if(_0x52b668){return _0x52b668?{'count':_0x36884c,'rows':_0x52b668}:null;}})[_0xd870('0x29')](respondWithResult(_0x2b6780,null))[_0xd870('0x4c')](handleError(_0x2b6780,null));};exports[_0xd870('0x96')]=function(_0x2a2ef9,_0x367a5a,_0x47e6f7){var _0x3bda0c={};var _0x313da5={};var _0x2fc6c0;var _0x510935;return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x2a2ef9[_0xd870('0x4d')]['id']}})['then'](handleEntityNotFound(_0x367a5a,null))[_0xd870('0x29')](function(_0x432cfd){if(_0x432cfd){_0x2fc6c0=_0x432cfd;_0x313da5[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x78')]['rawAttributes']);_0x313da5['query']=_[_0xd870('0x3a')](_0x2a2ef9[_0xd870('0x39')]);_0x313da5[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x313da5[_0xd870('0x38')],_0x313da5[_0xd870('0x39')]);_0x3bda0c[_0xd870('0x3d')]=_['intersection'](_0x313da5['model'],qs['fields'](_0x2a2ef9[_0xd870('0x39')]['fields']));_0x3bda0c[_0xd870('0x3d')]=_0x3bda0c[_0xd870('0x3d')][_0xd870('0x3f')]?_0x3bda0c[_0xd870('0x3d')]:_0x313da5[_0xd870('0x38')];_0x3bda0c[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x2a2ef9['query'][_0xd870('0x42')]);_0x3bda0c[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x2a2ef9['query'],_0x313da5['filters']));if(_0x2a2ef9[_0xd870('0x39')]['filter']){_0x3bda0c[_0xd870('0x43')]=_[_0xd870('0x45')](_0x3bda0c['where'],{'$or':_['map'](_0x3bda0c['attributes'],function(_0x44e25b){var _0x332d17={};_0x332d17[_0x44e25b]={'$like':'%'+_0x2a2ef9[_0xd870('0x39')]['filter']+'%'};return _0x332d17;})});}_0x3bda0c=_[_0xd870('0x45')]({},_0x3bda0c,_0x2a2ef9['options']);return _0x2fc6c0['getMembers'](_0x3bda0c);}})['then'](function(_0x160213){if(_0x160213){_0x510935=_0x160213[_0xd870('0x3f')];if(!_0x2a2ef9['query'][_0xd870('0x40')](_0xd870('0x65'))){_0x3bda0c[_0xd870('0x21')]=qs['limit'](_0x2a2ef9['query']['limit']);_0x3bda0c[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x2a2ef9['query'][_0xd870('0x23')]);}return _0x2fc6c0[_0xd870('0x96')](_0x3bda0c);}})[_0xd870('0x29')](function(_0x425611){return _0x425611?{'count':_0x510935,'rows':_0x425611}:null;})[_0xd870('0x29')](respondWithResult(_0x367a5a,null))[_0xd870('0x4c')](handleError(_0x367a5a,null));};exports[_0xd870('0x97')]=function(_0x53e791,_0xac12af,_0x59912b){var _0x18ac36={};var _0x45d68f={};var _0x5bd974;var _0x29f230;return db['VoiceQueue']['findOne']({'where':{'id':_0x53e791[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0xac12af,null))['then'](function(_0x46a55a){if(_0x46a55a){_0x5bd974=_0x46a55a;_0x45d68f[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x98')]['rawAttributes']);_0x45d68f[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x53e791[_0xd870('0x39')]);_0x45d68f[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x45d68f['model'],_0x45d68f[_0xd870('0x39')]);_0x18ac36[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x45d68f[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x53e791['query']['fields']));_0x18ac36['attributes']=_0x18ac36['attributes'][_0xd870('0x3f')]?_0x18ac36[_0xd870('0x3d')]:_0x45d68f[_0xd870('0x38')];_0x18ac36['order']=qs[_0xd870('0x42')](_0x53e791[_0xd870('0x39')]['sort']);_0x18ac36[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x53e791[_0xd870('0x39')],_0x45d68f[_0xd870('0x3b')]));if(_0x53e791[_0xd870('0x39')][_0xd870('0x2d')]){_0x18ac36['where']=_['merge'](_0x18ac36['where'],{'$or':_['map'](_0x18ac36['attributes'],function(_0x15c84c){var _0x4f1a2c={};_0x4f1a2c[_0x15c84c]={'$like':'%'+_0x53e791[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x4f1a2c;})});}_0x18ac36=_[_0xd870('0x45')]({},_0x18ac36,_0x53e791[_0xd870('0x47')]);return _0x5bd974[_0xd870('0x97')](_0x18ac36);}})[_0xd870('0x29')](function(_0x1101be){if(_0x1101be){_0x29f230=_0x1101be[_0xd870('0x3f')];if(!_0x53e791['query'][_0xd870('0x40')](_0xd870('0x65'))){_0x18ac36[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x53e791[_0xd870('0x39')][_0xd870('0x21')]);_0x18ac36['offset']=qs['offset'](_0x53e791[_0xd870('0x39')]['offset']);}return _0x5bd974[_0xd870('0x97')](_0x18ac36);}})['then'](function(_0x1eb90e){if(_0x1eb90e){return _0x1eb90e?{'count':_0x29f230,'rows':_0x1eb90e}:null;}})['then'](respondWithResult(_0xac12af,null))[_0xd870('0x4c')](handleError(_0xac12af,null));};exports['addLists']=function(_0x1ad4ff,_0x36730e,_0x59c117){var _0x5a89c=moment()[_0xd870('0x7a')](_0xd870('0x99'));var _0x2ad18e,_0x41164a;return db['VoiceQueue']['find']({'where':{'id':_0x1ad4ff['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x36730e,null))[_0xd870('0x29')](function(_0x53b94f){if(_0x53b94f){_0x41164a=_0x53b94f;return _0x53b94f[_0xd870('0x9a')](_0x1ad4ff[_0xd870('0x4f')][_0xd870('0x7e')],_[_0xd870('0x5d')](_0x1ad4ff[_0xd870('0x4f')],[_0xd870('0x7e'),'id'])||{});}return null;})[_0xd870('0x92')](function(_0x29d1cf){var _0x1d5fe5;_0x2ad18e=_0x29d1cf||[];var _0x3be94b=[];if(_0x29d1cf){for(var _0x2377b0=0x0;_0x2377b0<_0x29d1cf[_0xd870('0x3f')];_0x2377b0+=0x1){var _0x8eaa34=_0x29d1cf[_0x2377b0][_0xd870('0x51')]({'plain':!![]});_0x41164a[_0xd870('0x9b')]=_0x1ad4ff['body'][_0xd870('0x9b')]?_0x1ad4ff[_0xd870('0x4f')][_0xd870('0x9b')]:_0x41164a[_0xd870('0x9b')];switch(_0x41164a['dialCheckDuplicateType']){case _0xd870('0x9c'):_0x1d5fe5=squel[_0xd870('0x9d')]()[_0xd870('0x9e')](_0xd870('0x9f'))[_0xd870('0xa0')]([_0xd870('0xa1'),_0xd870('0xa2'),_0xd870('0xa3'),_0xd870('0xa4'),_0xd870('0x61'),'createdAt',_0xd870('0x5c')],squel['select']()[_0xd870('0x7f')]('phone','phone')[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','scheduledAt')['field']('id',_0xd870('0xa3'))['field'](_0x8eaa34[_0xd870('0xa5')][_0xd870('0x86')](),'ListId')[_0xd870('0x7f')](_0x1ad4ff[_0xd870('0x4d')]['id']['toString'](),_0xd870('0x61'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5b'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))['from'](_0xd870('0xa6'))[_0xd870('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0xd870('0xa7'),_0x8eaa34['CmListId']['toString']())['where'](_0xd870('0xa8'))[_0xd870('0x43')](_0xd870('0xa9'),squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xab'))[_0xd870('0x81')](_0xd870('0xac'))[_0xd870('0x43')](_0xd870('0xad'),_0x1ad4ff['params']['id']['toString']()))[_0xd870('0x43')](_0xd870('0xa9'),squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xae'))[_0xd870('0x81')](_0xd870('0x9f'))[_0xd870('0x43')]('VoiceQueueId\x20=\x20?',_0x1ad4ff['params']['id'][_0xd870('0x86')]())))[_0xd870('0x86')]();break;case _0xd870('0xaf'):_0x1d5fe5=squel['insert']()['into'](_0xd870('0x9f'))['fromQuery']([_0xd870('0xa1'),_0xd870('0xa2'),_0xd870('0xa3'),_0xd870('0xa4'),_0xd870('0x61'),'createdAt',_0xd870('0x5c')],squel['select']()[_0xd870('0x7f')]('phone',_0xd870('0xa1'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0xa2'))[_0xd870('0x7f')]('id',_0xd870('0xa3'))[_0xd870('0x7f')](_0x8eaa34[_0xd870('0xa5')][_0xd870('0x86')](),'ListId')[_0xd870('0x7f')](_0x1ad4ff[_0xd870('0x4d')]['id'][_0xd870('0x86')](),'VoiceQueueId')[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5b'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))['from'](_0xd870('0xa6'))[_0xd870('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0xd870('0xa7'),_0x8eaa34[_0xd870('0xa5')][_0xd870('0x86')]())[_0xd870('0x43')](_0xd870('0xa8'))[_0xd870('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd870('0xaa')]()[_0xd870('0x7f')]('COALESCE(phone,\x27\x27)')[_0xd870('0x81')](_0xd870('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0x1ad4ff['params']['id'][_0xd870('0x86')]())))[_0xd870('0x86')]();break;default:_0x1d5fe5=squel['insert']()[_0xd870('0x9e')](_0xd870('0x9f'))['fromQuery']([_0xd870('0xa1'),_0xd870('0xa2'),_0xd870('0xa3'),_0xd870('0xa4'),_0xd870('0x61'),'createdAt',_0xd870('0x5c')],squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xa1'),_0xd870('0xa1'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','scheduledAt')[_0xd870('0x7f')]('id',_0xd870('0xa3'))[_0xd870('0x7f')](_0x8eaa34['CmListId']['toString'](),'ListId')[_0xd870('0x7f')](_0x1ad4ff[_0xd870('0x4d')]['id']['toString'](),_0xd870('0x61'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','createdAt')[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))[_0xd870('0x81')](_0xd870('0xa6'))[_0xd870('0x43')](_0xd870('0xb0'))[_0xd870('0x43')](_0xd870('0xa7'),_0x8eaa34['CmListId'][_0xd870('0x86')]())[_0xd870('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xd870('0x86')]();}_0x3be94b[_0xd870('0x85')](db[_0xd870('0x73')][_0xd870('0x39')](_0x1d5fe5));}return BPromise[_0xd870('0x8b')](_0x3be94b);}})[_0xd870('0x29')](function(){var _0x3a6ea8=[];var _0x3c42fd=squel['insert']()[_0xd870('0x9e')]('cm_hopper_additional_phones')[_0xd870('0xa0')](['CmHopperId',_0xd870('0xa1'),'OrderBy',_0xd870('0x5b'),_0xd870('0x5c')],squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xb1'))[_0xd870('0x7f')]('ci.item')['field'](_0xd870('0xb2'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','createdAt')['field']('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))['from']('cm_contact_has_items','ci')[_0xd870('0x82')](_0xd870('0x9f'),'h',_0xd870('0xb3'))[_0xd870('0x43')](_0xd870('0xb4'),_0x5a89c)[_0xd870('0x43')](_0xd870('0xb5'),_0xd870('0xb6')))[_0xd870('0x86')]();_0x3a6ea8[_0xd870('0x85')](db['sequelize'][_0xd870('0x39')](_0x3c42fd));return BPromise[_0xd870('0x8b')](_0x3a6ea8);})[_0xd870('0x29')](function(){return _0x2ad18e;})['then'](respondWithResult(_0x36730e,null))[_0xd870('0x4c')](handleError(_0x36730e,null));};exports[_0xd870('0xb7')]=function(_0x424011,_0x52cd3a,_0x19bf7a){return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x424011[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x52cd3a,null))['then'](function(_0x5911ec){if(_0x5911ec){return _0x5911ec[_0xd870('0xb7')](_0x424011[_0xd870('0x39')][_0xd870('0x7e')]);}})[_0xd870('0x29')](function(_0x25ff4e){if(_0x25ff4e){return db[_0xd870('0x62')]['destroy']({'where':{'ListId':_0x424011[_0xd870('0x39')][_0xd870('0x7e')],'VoiceQueueId':_0x424011[_0xd870('0x4d')]['id']}})['then'](function(){return _0x25ff4e;});}})[_0xd870('0x29')](respondWithStatusCode(_0x52cd3a,null))[_0xd870('0x4c')](handleError(_0x52cd3a,null));};exports[_0xd870('0xb8')]=function(_0x51c179,_0x2d6ada,_0xb4c132){var _0x467fcf={};var _0xc85aa={};var _0x25fbe5;var _0x16209b;return db[_0xd870('0x35')]['findOne']({'where':{'id':_0x51c179[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2d6ada,null))[_0xd870('0x29')](function(_0x200876){if(_0x200876){_0x25fbe5=_0x200876;_0xc85aa[_0xd870('0x38')]=_[_0xd870('0x3a')](db['CmList'][_0xd870('0x5a')]);_0xc85aa[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x51c179['query']);_0xc85aa[_0xd870('0x3b')]=_['intersection'](_0xc85aa[_0xd870('0x38')],_0xc85aa['query']);_0x467fcf[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0xc85aa[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x51c179['query']['fields']));_0x467fcf['attributes']=_0x467fcf[_0xd870('0x3d')][_0xd870('0x3f')]?_0x467fcf['attributes']:_0xc85aa['model'];_0x467fcf[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x51c179[_0xd870('0x39')][_0xd870('0x42')]);_0x467fcf['where']=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x51c179[_0xd870('0x39')],_0xc85aa[_0xd870('0x3b')]));if(_0x51c179[_0xd870('0x39')][_0xd870('0x2d')]){_0x467fcf[_0xd870('0x43')]=_[_0xd870('0x45')](_0x467fcf['where'],{'$or':_[_0xd870('0x2e')](_0x467fcf[_0xd870('0x3d')],function(_0xc07c57){var _0x1da086={};_0x1da086[_0xc07c57]={'$like':'%'+_0x51c179[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x1da086;})});}_0x467fcf=_[_0xd870('0x45')]({},_0x467fcf,_0x51c179[_0xd870('0x47')]);return _0x25fbe5[_0xd870('0xb8')](_0x467fcf);}})[_0xd870('0x29')](function(_0x339791){if(_0x339791){_0x16209b=_0x339791[_0xd870('0x3f')];if(!_0x51c179[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0x467fcf['limit']=qs['limit'](_0x51c179[_0xd870('0x39')][_0xd870('0x21')]);_0x467fcf[_0xd870('0x23')]=qs['offset'](_0x51c179['query'][_0xd870('0x23')]);}return _0x25fbe5['getBlackLists'](_0x467fcf);}})[_0xd870('0x29')](function(_0x444416){if(_0x444416){return _0x444416?{'count':_0x16209b,'rows':_0x444416}:null;}})[_0xd870('0x29')](respondWithResult(_0x2d6ada,null))['catch'](handleError(_0x2d6ada,null));};exports[_0xd870('0xb9')]=function(_0x437baa,_0x5c8fce,_0x300b1b){var _0x3b6ca9,_0x1ce73c;return db['VoiceQueue'][_0xd870('0x30')]({'where':{'id':_0x437baa[_0xd870('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c8fce,null))['then'](function(_0x4af792){if(_0x4af792){_0x1ce73c=_0x4af792;return _0x4af792[_0xd870('0xb9')](_0x437baa[_0xd870('0x4f')]['ids'],_['omit'](_0x437baa['body'],['ids','id'])||{});}return null;})[_0xd870('0x92')](function(_0x26c79c){var _0x72cba2;_0x3b6ca9=_0x26c79c||[];var _0x3555a3=[];if(_0x26c79c){for(var _0x2ff5da=0x0;_0x2ff5da<_0x26c79c['length'];_0x2ff5da+=0x1){var _0x20e4f6=_0x26c79c[_0x2ff5da]['get']({'plain':!![]});_0x72cba2=squel[_0xd870('0x9d')]()['into'](_0xd870('0xba'))[_0xd870('0xa0')]([_0xd870('0xa1'),_0xd870('0xa3'),_0xd870('0xa4'),'VoiceQueueId',_0xd870('0x5b'),_0xd870('0x5c')],squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xa1'),'phone')[_0xd870('0x7f')]('id','ContactId')[_0xd870('0x7f')](_0x20e4f6[_0xd870('0xa5')][_0xd870('0x86')](),_0xd870('0xa4'))[_0xd870('0x7f')](_0x437baa[_0xd870('0x4d')]['id'][_0xd870('0x86')](),_0xd870('0x61'))[_0xd870('0x7f')]('NOW()','createdAt')[_0xd870('0x7f')]('NOW()',_0xd870('0x5c'))['from']('cm_contacts')[_0xd870('0x43')](_0xd870('0xb0'))['where'](_0xd870('0xa7'),_0x20e4f6[_0xd870('0xa5')]['toString']())[_0xd870('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xd870('0x86')]();_0x3555a3[_0xd870('0x85')](db[_0xd870('0x73')][_0xd870('0x39')](_0x72cba2));}return BPromise[_0xd870('0x8b')](_0x3555a3);}})[_0xd870('0x29')](function(){return _0x3b6ca9;})[_0xd870('0x29')](respondWithResult(_0x5c8fce,null))['catch'](handleError(_0x5c8fce,null));};exports[_0xd870('0xbb')]=function(_0x5ba174,_0x460bcf,_0x2fa8c8){return db['VoiceQueue']['find']({'where':{'id':_0x5ba174['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x460bcf,null))['then'](function(_0x4b4669){if(_0x4b4669){return _0x4b4669[_0xd870('0xbb')](_0x5ba174[_0xd870('0x39')][_0xd870('0x7e')]);}})[_0xd870('0x29')](function(_0x52a9cf){if(_0x52a9cf){return db[_0xd870('0x67')][_0xd870('0x5e')]({'where':{'ListId':_0x5ba174[_0xd870('0x39')]['ids'],'VoiceQueueId':_0x5ba174[_0xd870('0x4d')]['id']}})['then'](function(){return _0x52a9cf;});}})[_0xd870('0x29')](respondWithStatusCode(_0x460bcf,null))[_0xd870('0x4c')](handleError(_0x460bcf,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3513fba..19c15e4 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ca9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ca9,0x1c6));var _0x98ca=function(_0x4026c8,_0x477780){_0x4026c8=_0x4026c8-0x0;var _0xf7aeba=_0x8ca9[_0x4026c8];return _0xf7aeba;};'use strict';var EventEmitter=require(_0x98ca('0x0'));var VoiceQueue=require(_0x98ca('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x98ca('0x2')](0x0);var events={'afterCreate':_0x98ca('0x3'),'afterUpdate':_0x98ca('0x4'),'afterDestroy':_0x98ca('0x5')};function emitEvent(_0x13ba97){return function(_0x2d4578,_0x247344,_0x190351){VoiceQueueEvents[_0x98ca('0x6')](_0x13ba97+':'+_0x2d4578['id'],_0x2d4578);VoiceQueueEvents[_0x98ca('0x6')](_0x13ba97,_0x2d4578);_0x190351(null);};}for(var e in events){if(events[_0x98ca('0x7')](e)){var event=events[e];VoiceQueue[_0x98ca('0x8')](e,emitEvent(event));}}module[_0x98ca('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x0b76=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','VoiceQueue'];(function(_0x323b3d,_0x8b47d0){var _0x76fc8f=function(_0x47dba6){while(--_0x47dba6){_0x323b3d['push'](_0x323b3d['shift']());}};_0x76fc8f(++_0x8b47d0);}(_0x0b76,0x18b));var _0x60b7=function(_0x55a690,_0x15b866){_0x55a690=_0x55a690-0x0;var _0x553a8e=_0x0b76[_0x55a690];return _0x553a8e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x60b7('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x60b7('0x1')](0x0);var events={'afterCreate':_0x60b7('0x2'),'afterUpdate':_0x60b7('0x3'),'afterDestroy':_0x60b7('0x4')};function emitEvent(_0x28e727){return function(_0x348818,_0x4cfd10,_0x4876d3){VoiceQueueEvents[_0x60b7('0x5')](_0x28e727+':'+_0x348818['id'],_0x348818);VoiceQueueEvents['emit'](_0x28e727,_0x348818);_0x4876d3(null);};}for(var e in events){if(events[_0x60b7('0x6')](e)){var event=events[e];VoiceQueue[_0x60b7('0x7')](e,emitEvent(event));}}module[_0x60b7('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 435db3d..004be52 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1f97cd,_0x3d0dc0){var _0x2e78c6=function(_0x24f621){while(--_0x24f621){_0x1f97cd['push'](_0x1f97cd['shift']());}};_0x2e78c6(++_0x3d0dc0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x123035,_0x122952){var _0x516c5f=function(_0x29116c){while(--_0x29116c){_0x123035['push'](_0x123035['shift']());}};_0x516c5f(++_0x122952);}(_0x70e0,0x17b));var _0x070e=function(_0xf6fd1e,_0x2db352){_0xf6fd1e=_0xf6fd1e-0x0;var _0x2c6d23=_0x70e0[_0xf6fd1e];return _0x2c6d23;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 6674410..717c8a4 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c4d=['then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','raw','attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x4c92e2,_0x4c7caa){var _0x4c5ccb=function(_0x338f66){while(--_0x338f66){_0x4c92e2['push'](_0x4c92e2['shift']());}};_0x4c5ccb(++_0x4c7caa);}(_0x5c4d,0x6a));var _0xd5c4=function(_0x5debab,_0x2abef8){_0x5debab=_0x5debab-0x0;var _0x20333e=_0x5c4d[_0x5debab];return _0x20333e;};'use strict';var _=require(_0xd5c4('0x0'));var util=require('util');var moment=require(_0xd5c4('0x1'));var BPromise=require(_0xd5c4('0x2'));var rs=require(_0xd5c4('0x3'));var fs=require('fs');var Redis=require(_0xd5c4('0x4'));var db=require(_0xd5c4('0x5'))['db'];var utils=require(_0xd5c4('0x6'));var logger=require(_0xd5c4('0x7'))(_0xd5c4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd5c4('0x9')][_0xd5c4('0xa')]({'port':0x232a});config['redis']=_[_0xd5c4('0xb')](config[_0xd5c4('0xc')],{'host':_0xd5c4('0xd'),'port':0x18eb});var socket=require(_0xd5c4('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xd5c4('0xf')](socket);function respondWithRpcPromise(_0x45b5b5,_0x14b53f,_0xfb0f9d){return new BPromise(function(_0xf98cb9,_0x56891a){return client[_0xd5c4('0x10')](_0x45b5b5,_0xfb0f9d)[_0xd5c4('0x11')](function(_0x35ca7c){logger[_0xd5c4('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x14b53f,_0xd5c4('0x13'));logger[_0xd5c4('0x14')](_0xd5c4('0x15'),_0x14b53f,_0xd5c4('0x13'),JSON[_0xd5c4('0x16')](_0x35ca7c));if(_0x35ca7c['error']){if(_0x35ca7c[_0xd5c4('0x17')]['code']===0x1f4){logger[_0xd5c4('0x17')](_0xd5c4('0x18'),_0x14b53f,_0x35ca7c[_0xd5c4('0x17')][_0xd5c4('0x19')]);return _0x56891a(_0x35ca7c[_0xd5c4('0x17')][_0xd5c4('0x19')]);}logger[_0xd5c4('0x17')](_0xd5c4('0x18'),_0x14b53f,_0x35ca7c[_0xd5c4('0x17')][_0xd5c4('0x19')]);return _0xf98cb9(_0x35ca7c[_0xd5c4('0x17')]['message']);}else{logger[_0xd5c4('0x12')](_0xd5c4('0x18'),_0x14b53f,'request\x20sent');_0xf98cb9(_0x35ca7c[_0xd5c4('0x1a')]['message']);}})[_0xd5c4('0x1b')](function(_0x12f718){logger[_0xd5c4('0x17')](_0xd5c4('0x18'),_0x14b53f,_0x12f718);_0x56891a(_0x12f718);});});}exports[_0xd5c4('0x1c')]=function(_0x1e9c58){var _0x5679ce=this;return new Promise(function(_0x3bdc44,_0x30a5bb){return db['VoiceQueue'][_0xd5c4('0x1d')]({'raw':_0x1e9c58[_0xd5c4('0x1e')]?_0x1e9c58['options'][_0xd5c4('0x1f')]===undefined?!![]:![]:!![],'where':_0x1e9c58[_0xd5c4('0x1e')]?_0x1e9c58[_0xd5c4('0x1e')]['where']||null:null,'attributes':_0x1e9c58[_0xd5c4('0x1e')]?_0x1e9c58['options'][_0xd5c4('0x20')]||null:null,'limit':_0x1e9c58[_0xd5c4('0x1e')]?_0x1e9c58['options'][_0xd5c4('0x21')]||null:null,'include':_0x1e9c58[_0xd5c4('0x1e')]?_0x1e9c58[_0xd5c4('0x1e')]['include']?_['map'](_0x1e9c58[_0xd5c4('0x1e')]['include'],function(_0x51a680){return{'model':db[_0x51a680['model']],'as':_0x51a680['as'],'attributes':_0x51a680[_0xd5c4('0x20')],'include':_0x51a680['include']?_['map'](_0x51a680['include'],function(_0xe83138){return{'model':db[_0xe83138['model']],'as':_0xe83138['as'],'attributes':_0xe83138[_0xd5c4('0x20')],'include':_0xe83138[_0xd5c4('0x22')]?_[_0xd5c4('0x23')](_0xe83138['include'],function(_0x43c2ef){return{'model':db[_0x43c2ef[_0xd5c4('0x24')]],'as':_0x43c2ef['as'],'attributes':_0x43c2ef['attributes']};}):[]};}):[]};}):[]:[]})[_0xd5c4('0x11')](function(_0x539e75){logger['info'](_0xd5c4('0x1c'),_0x1e9c58);logger[_0xd5c4('0x14')](_0xd5c4('0x1c'),_0x1e9c58,JSON['stringify'](_0x539e75));_0x3bdc44(_0x539e75);})[_0xd5c4('0x1b')](function(_0x2bbfba){logger[_0xd5c4('0x17')](_0xd5c4('0x1c'),_0x2bbfba[_0xd5c4('0x19')],_0x1e9c58);_0x30a5bb(_0x5679ce['error'](0x1f4,_0x2bbfba[_0xd5c4('0x19')]));});});};exports[_0xd5c4('0x25')]=function(_0xf7df01){var _0x342610=this;return new Promise(function(_0x1ce612,_0x44485d){return db[_0xd5c4('0x26')][_0xd5c4('0x27')]({'raw':_0xf7df01[_0xd5c4('0x1e')]?_0xf7df01[_0xd5c4('0x1e')][_0xd5c4('0x1f')]===undefined?!![]:![]:!![],'where':_0xf7df01[_0xd5c4('0x1e')]?_0xf7df01[_0xd5c4('0x1e')][_0xd5c4('0x28')]||null:null,'attributes':_0xf7df01[_0xd5c4('0x1e')]?_0xf7df01[_0xd5c4('0x1e')][_0xd5c4('0x20')]||null:null,'include':_0xf7df01[_0xd5c4('0x1e')]?_0xf7df01['options']['include']?_[_0xd5c4('0x23')](_0xf7df01[_0xd5c4('0x1e')][_0xd5c4('0x22')],function(_0x4f2b1f){return{'model':db[_0x4f2b1f[_0xd5c4('0x24')]],'as':_0x4f2b1f['as'],'attributes':_0x4f2b1f[_0xd5c4('0x20')],'include':_0x4f2b1f['include']?_['map'](_0x4f2b1f[_0xd5c4('0x22')],function(_0x4ca094){return{'model':db[_0x4ca094[_0xd5c4('0x24')]],'as':_0x4ca094['as'],'attributes':_0x4ca094[_0xd5c4('0x20')],'include':_0x4ca094[_0xd5c4('0x22')]?_[_0xd5c4('0x23')](_0x4ca094[_0xd5c4('0x22')],function(_0x5e1caf){return{'model':db[_0x5e1caf[_0xd5c4('0x24')]],'as':_0x5e1caf['as'],'attributes':_0x5e1caf[_0xd5c4('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd5c4('0x11')](function(_0x1e7193){logger[_0xd5c4('0x12')](_0xd5c4('0x25'),_0xf7df01);logger[_0xd5c4('0x14')]('ShowVoiceQueue',_0xf7df01,JSON[_0xd5c4('0x16')](_0x1e7193));_0x1ce612(_0x1e7193);})[_0xd5c4('0x1b')](function(_0x179512){logger[_0xd5c4('0x17')]('ShowVoiceQueue',_0x179512[_0xd5c4('0x19')],_0xf7df01);_0x44485d(_0x342610['error'](0x1f4,_0x179512['message']));});});}; \ No newline at end of file +var _0x090b=['../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','bluebird','randomstring','../../mysqldb'];(function(_0x38b147,_0x248914){var _0x301b12=function(_0x3574ce){while(--_0x3574ce){_0x38b147['push'](_0x38b147['shift']());}};_0x301b12(++_0x248914);}(_0x090b,0x12d));var _0xb090=function(_0xd1ca9b,_0x472c3e){_0xd1ca9b=_0xd1ca9b-0x0;var _0x21df15=_0x090b[_0xd1ca9b];return _0x21df15;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb090('0x0'));var rs=require(_0xb090('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb090('0x2'))['db'];var utils=require(_0xb090('0x3'));var logger=require(_0xb090('0x4'))(_0xb090('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb090('0x6')][_0xb090('0x7')]({'port':0x232a});config[_0xb090('0x8')]=_[_0xb090('0x9')](config[_0xb090('0x8')],{'host':_0xb090('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb090('0x8')]));require(_0xb090('0xb'))['register'](socket);function respondWithRpcPromise(_0x54de0c,_0x3814dc,_0x2bc2a7){return new BPromise(function(_0x57069d,_0x19669b){return client[_0xb090('0xc')](_0x54de0c,_0x2bc2a7)[_0xb090('0xd')](function(_0x44b1b4){logger[_0xb090('0xe')](_0xb090('0xf'),_0x3814dc,'request\x20sent');logger[_0xb090('0x10')](_0xb090('0x11'),_0x3814dc,'request\x20sent',JSON[_0xb090('0x12')](_0x44b1b4));if(_0x44b1b4[_0xb090('0x13')]){if(_0x44b1b4['error'][_0xb090('0x14')]===0x1f4){logger['error'](_0xb090('0xf'),_0x3814dc,_0x44b1b4[_0xb090('0x13')][_0xb090('0x15')]);return _0x19669b(_0x44b1b4[_0xb090('0x13')][_0xb090('0x15')]);}logger[_0xb090('0x13')](_0xb090('0xf'),_0x3814dc,_0x44b1b4['error'][_0xb090('0x15')]);return _0x57069d(_0x44b1b4['error'][_0xb090('0x15')]);}else{logger[_0xb090('0xe')](_0xb090('0xf'),_0x3814dc,_0xb090('0x16'));_0x57069d(_0x44b1b4[_0xb090('0x17')][_0xb090('0x15')]);}})[_0xb090('0x18')](function(_0x29dc77){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3814dc,_0x29dc77);_0x19669b(_0x29dc77);});});}exports[_0xb090('0x19')]=function(_0x1f499c){var _0xf46d33=this;return new Promise(function(_0x4a73e6,_0x177478){return db[_0xb090('0x1a')][_0xb090('0x1b')]({'raw':_0x1f499c[_0xb090('0x1c')]?_0x1f499c[_0xb090('0x1c')][_0xb090('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f499c[_0xb090('0x1c')]?_0x1f499c[_0xb090('0x1c')][_0xb090('0x1e')]||null:null,'attributes':_0x1f499c[_0xb090('0x1c')]?_0x1f499c['options'][_0xb090('0x1f')]||null:null,'limit':_0x1f499c['options']?_0x1f499c[_0xb090('0x1c')][_0xb090('0x20')]||null:null,'include':_0x1f499c['options']?_0x1f499c[_0xb090('0x1c')]['include']?_[_0xb090('0x21')](_0x1f499c[_0xb090('0x1c')][_0xb090('0x22')],function(_0x244499){return{'model':db[_0x244499[_0xb090('0x23')]],'as':_0x244499['as'],'attributes':_0x244499[_0xb090('0x1f')],'include':_0x244499['include']?_[_0xb090('0x21')](_0x244499[_0xb090('0x22')],function(_0x58e745){return{'model':db[_0x58e745['model']],'as':_0x58e745['as'],'attributes':_0x58e745['attributes'],'include':_0x58e745['include']?_[_0xb090('0x21')](_0x58e745['include'],function(_0x27d886){return{'model':db[_0x27d886[_0xb090('0x23')]],'as':_0x27d886['as'],'attributes':_0x27d886[_0xb090('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x493c6a){logger[_0xb090('0xe')]('GetVoiceQueue',_0x1f499c);logger[_0xb090('0x10')](_0xb090('0x19'),_0x1f499c,JSON[_0xb090('0x12')](_0x493c6a));_0x4a73e6(_0x493c6a);})[_0xb090('0x18')](function(_0x2b3364){logger['error']('GetVoiceQueue',_0x2b3364[_0xb090('0x15')],_0x1f499c);_0x177478(_0xf46d33[_0xb090('0x13')](0x1f4,_0x2b3364[_0xb090('0x15')]));});});};exports[_0xb090('0x24')]=function(_0xb54736){var _0x434a0e=this;return new Promise(function(_0x5eb197,_0x8c4737){return db[_0xb090('0x1a')][_0xb090('0x25')]({'raw':_0xb54736[_0xb090('0x1c')]?_0xb54736[_0xb090('0x1c')][_0xb090('0x1d')]===undefined?!![]:![]:!![],'where':_0xb54736[_0xb090('0x1c')]?_0xb54736['options'][_0xb090('0x1e')]||null:null,'attributes':_0xb54736['options']?_0xb54736[_0xb090('0x1c')][_0xb090('0x1f')]||null:null,'include':_0xb54736[_0xb090('0x1c')]?_0xb54736[_0xb090('0x1c')]['include']?_['map'](_0xb54736[_0xb090('0x1c')][_0xb090('0x22')],function(_0xd12561){return{'model':db[_0xd12561[_0xb090('0x23')]],'as':_0xd12561['as'],'attributes':_0xd12561[_0xb090('0x1f')],'include':_0xd12561[_0xb090('0x22')]?_['map'](_0xd12561[_0xb090('0x22')],function(_0x4bc0f7){return{'model':db[_0x4bc0f7['model']],'as':_0x4bc0f7['as'],'attributes':_0x4bc0f7[_0xb090('0x1f')],'include':_0x4bc0f7[_0xb090('0x22')]?_[_0xb090('0x21')](_0x4bc0f7[_0xb090('0x22')],function(_0x33d4ff){return{'model':db[_0x33d4ff['model']],'as':_0x33d4ff['as'],'attributes':_0x33d4ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a872f){logger['info'](_0xb090('0x24'),_0xb54736);logger[_0xb090('0x10')](_0xb090('0x24'),_0xb54736,JSON[_0xb090('0x12')](_0x1a872f));_0x5eb197(_0x1a872f);})['catch'](function(_0x9a9f4b){logger[_0xb090('0x13')](_0xb090('0x24'),_0x9a9f4b[_0xb090('0x15')],_0xb54736);_0x8c4737(_0x434a0e[_0xb090('0x13')](0x1f4,_0x9a9f4b[_0xb090('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 8a7ed73..a9e0db4 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x716e=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x716e,0x13b));var _0xe716=function(_0x804239,_0x4ac7a5){_0x804239=_0x804239-0x0;var _0x4a5199=_0x716e[_0x804239];return _0x4a5199;};'use strict';var VoiceQueueEvents=require(_0xe716('0x0'));var events=[_0xe716('0x1'),_0xe716('0x2'),_0xe716('0x3')];function createListener(_0x477aa1,_0xfcb1d9){return function(_0x43fc78){_0xfcb1d9[_0xe716('0x4')](_0x477aa1,_0x43fc78);};}function removeListener(_0xe6c912,_0x4b5867){return function(){VoiceQueueEvents['removeListener'](_0xe6c912,_0x4b5867);};}exports[_0xe716('0x5')]=function(_0x10d7f9){for(var _0x2a7d31=0x0,_0x5dbba9=events[_0xe716('0x6')];_0x2a7d31<_0x5dbba9;_0x2a7d31++){var _0x337d3b=events[_0x2a7d31];var _0x4f7071=createListener(_0xe716('0x7')+_0x337d3b,_0x10d7f9);VoiceQueueEvents['on'](_0x337d3b,_0x4f7071);}}; \ No newline at end of file +var _0x1afc=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x2a3dde,_0x56f85d){var _0x2977f0=function(_0x50bd6e){while(--_0x50bd6e){_0x2a3dde['push'](_0x2a3dde['shift']());}};_0x2977f0(++_0x56f85d);}(_0x1afc,0x123));var _0xc1af=function(_0x2cc5f8,_0x3994e6){_0x2cc5f8=_0x2cc5f8-0x0;var _0x3a150d=_0x1afc[_0x2cc5f8];return _0x3a150d;};'use strict';var VoiceQueueEvents=require(_0xc1af('0x0'));var events=['save',_0xc1af('0x1'),_0xc1af('0x2')];function createListener(_0x468cb7,_0x1e993a){return function(_0x5afece){_0x1e993a[_0xc1af('0x3')](_0x468cb7,_0x5afece);};}function removeListener(_0x3064d3,_0x36aef4){return function(){VoiceQueueEvents[_0xc1af('0x4')](_0x3064d3,_0x36aef4);};}exports[_0xc1af('0x5')]=function(_0x2824c7){for(var _0x20082d=0x0,_0x2dca91=events['length'];_0x20082d<_0x2dca91;_0x20082d++){var _0x39329e=events[_0x20082d];var _0xf22337=createListener(_0xc1af('0x6')+_0x39329e,_0x2824c7);VoiceQueueEvents['on'](_0x39329e,_0xf22337);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8379e1d..f77e23e 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x047c=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','isAuthenticated','describe','/index','getVoiceQueuesReport','post','put','/:id','update','delete','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x047c,0x1b8));var _0xc047=function(_0xf9cb79,_0x57cb52){_0xf9cb79=_0xf9cb79-0x0;var _0x4358e5=_0x047c[_0xf9cb79];return _0x4358e5;};'use strict';var multer=require(_0xc047('0x0'));var util=require(_0xc047('0x1'));var path=require(_0xc047('0x2'));var timeout=require(_0xc047('0x3'));var express=require(_0xc047('0x4'));var router=express[_0xc047('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc047('0x6'));var config=require(_0xc047('0x7'));var controller=require(_0xc047('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc047('0x9')]);router[_0xc047('0xa')]('/describe',auth[_0xc047('0xb')](),controller[_0xc047('0xc')]);router['get'](_0xc047('0xd'),auth[_0xc047('0xb')](),controller[_0xc047('0xe')]);router[_0xc047('0xa')]('/:id',auth[_0xc047('0xb')](),controller['show']);router[_0xc047('0xf')]('/',auth[_0xc047('0xb')](),controller['create']);router[_0xc047('0x10')](_0xc047('0x11'),auth['isAuthenticated'](),controller[_0xc047('0x12')]);router[_0xc047('0x13')](_0xc047('0x11'),auth[_0xc047('0xb')](),controller['destroy']);module[_0xc047('0x14')]=router; \ No newline at end of file +var _0x9b92=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete','exports','multer','util','path'];(function(_0x30603a,_0x5c2506){var _0x33c3b7=function(_0x5534a3){while(--_0x5534a3){_0x30603a['push'](_0x30603a['shift']());}};_0x33c3b7(++_0x5c2506);}(_0x9b92,0x156));var _0x29b9=function(_0x26b9d7,_0x1e9de1){_0x26b9d7=_0x26b9d7-0x0;var _0x370de3=_0x9b92[_0x26b9d7];return _0x370de3;};'use strict';var multer=require(_0x29b9('0x0'));var util=require(_0x29b9('0x1'));var path=require(_0x29b9('0x2'));var timeout=require(_0x29b9('0x3'));var express=require(_0x29b9('0x4'));var router=express[_0x29b9('0x5')]();var fs_extra=require(_0x29b9('0x6'));var auth=require(_0x29b9('0x7'));var interaction=require(_0x29b9('0x8'));var config=require(_0x29b9('0x9'));var controller=require(_0x29b9('0xa'));router[_0x29b9('0xb')]('/',auth[_0x29b9('0xc')](),controller['index']);router[_0x29b9('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x29b9('0xd')]);router[_0x29b9('0xb')](_0x29b9('0xe'),auth[_0x29b9('0xc')](),controller[_0x29b9('0xf')]);router[_0x29b9('0xb')](_0x29b9('0x10'),auth[_0x29b9('0xc')](),controller[_0x29b9('0x11')]);router[_0x29b9('0x12')]('/',auth['isAuthenticated'](),controller[_0x29b9('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x29b9('0x14')]);router[_0x29b9('0x15')](_0x29b9('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x29b9('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 896a8fb..e600e35 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f6c=['format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt'];(function(_0x4dd81a,_0x3c8236){var _0x4309b9=function(_0x13dbcc){while(--_0x13dbcc){_0x4dd81a['push'](_0x4dd81a['shift']());}};_0x4309b9(++_0x3c8236);}(_0x3f6c,0x7a));var _0xc3f6=function(_0x14709f,_0x2d4534){_0x14709f=_0x14709f-0x0;var _0x5a1e1f=_0x3f6c[_0x14709f];return _0x5a1e1f;};'use strict';var Sequelize=require(_0xc3f6('0x0'));var moment=require(_0xc3f6('0x1'));module[_0xc3f6('0x2')]={'type':{'type':Sequelize[_0xc3f6('0x3')]},'uniqueid':{'type':Sequelize[_0xc3f6('0x3')]},'calleridnum':{'type':Sequelize[_0xc3f6('0x3')]},'calleridname':{'type':Sequelize[_0xc3f6('0x3')]},'queue':{'type':Sequelize[_0xc3f6('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xc3f6('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x41e288){var _0x4e2a01=moment(_0x41e288);var _0x5e5e08=moment(this['getDataValue'](_0xc3f6('0x5')))[_0xc3f6('0x6')](_0xc3f6('0x7'));var _0x5ca306=_0x4e2a01[_0xc3f6('0x8')](_0x5e5e08,_0xc3f6('0x9'));this['setDataValue']('queuecallerleaveAt',_0x41e288);this[_0xc3f6('0xa')](_0xc3f6('0xb'),_0x5ca306||null);}},'position':{'type':Sequelize[_0xc3f6('0xc')]},'count':{'type':Sequelize[_0xc3f6('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xc3f6('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc3f6('0x4')]},'queuecallerexit':{'type':Sequelize[_0xc3f6('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc3f6('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xc3f6('0xe')},'originalposition':{'type':Sequelize[_0xc3f6('0xc')]},'channel':{'type':Sequelize[_0xc3f6('0x3')]},'connectedlinenum':{'type':Sequelize[_0xc3f6('0x3')]},'connectedlinename':{'type':Sequelize[_0xc3f6('0x3')]},'accountcode':{'type':Sequelize[_0xc3f6('0x3')]},'context':{'type':Sequelize[_0xc3f6('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc3f6('0x3')]},'holdtime':{'type':Sequelize[_0xc3f6('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc3f6('0x3')]},'transfer':{'type':Sequelize[_0xc3f6('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc3f6('0x3')],'comment':_0xc3f6('0xf')},'transferexten':{'type':Sequelize[_0xc3f6('0x3')]},'transferuniqueid':{'type':Sequelize[_0xc3f6('0x3')]},'disposition':{'type':Sequelize[_0xc3f6('0x3')]},'secondDisposition':{'type':Sequelize[_0xc3f6('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xc3f6('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xc3f6('0x3')]}}; \ No newline at end of file +var _0x2ce3=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue'];(function(_0x462d95,_0xbd0b6b){var _0x213c65=function(_0x23673a){while(--_0x23673a){_0x462d95['push'](_0x462d95['shift']());}};_0x213c65(++_0xbd0b6b);}(_0x2ce3,0xaf));var _0x32ce=function(_0x428fc7,_0x3094d2){_0x428fc7=_0x428fc7-0x0;var _0x169864=_0x2ce3[_0x428fc7];return _0x169864;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x32ce('0x0'));module[_0x32ce('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x32ce('0x2')]},'calleridnum':{'type':Sequelize[_0x32ce('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x32ce('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x32ce('0x3')],'set':function(_0x31b3a3){var _0x653153=moment(_0x31b3a3);var _0x33df30=moment(this[_0x32ce('0x4')]('queuecallerjoinAt'))['format'](_0x32ce('0x5'));var _0x47a52c=_0x653153[_0x32ce('0x6')](_0x33df30,_0x32ce('0x7'));this[_0x32ce('0x8')](_0x32ce('0x9'),_0x31b3a3);this[_0x32ce('0x8')](_0x32ce('0xa'),_0x47a52c||null);}},'position':{'type':Sequelize[_0x32ce('0xb')]},'count':{'type':Sequelize[_0x32ce('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x32ce('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x32ce('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x32ce('0x2')],'comment':_0x32ce('0xd')},'originalposition':{'type':Sequelize[_0x32ce('0xb')]},'channel':{'type':Sequelize[_0x32ce('0x2')]},'connectedlinenum':{'type':Sequelize[_0x32ce('0x2')]},'connectedlinename':{'type':Sequelize[_0x32ce('0x2')]},'accountcode':{'type':Sequelize[_0x32ce('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x32ce('0x2')]},'priority':{'type':Sequelize[_0x32ce('0x2')]},'holdtime':{'type':Sequelize[_0x32ce('0xb')]},'mohtime':{'type':Sequelize[_0x32ce('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x32ce('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x32ce('0x2')],'comment':_0x32ce('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x32ce('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x32ce('0x2')]},'thirdDisposition':{'type':Sequelize[_0x32ce('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x32ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 7873a93..21bdb2f 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97cc=['options','find','create','body','params','getVoiceQueuesReport','sort','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','VIRTUAL','filter','merge','then','include','findAll','rows','catch','show','length','includeAll'];(function(_0x23975a,_0x3603f0){var _0x35817d=function(_0xc75108){while(--_0xc75108){_0x23975a['push'](_0x23975a['shift']());}};_0x35817d(++_0x3603f0);}(_0x97cc,0xb4));var _0xc97c=function(_0x2700f6,_0x27b670){_0x2700f6=_0x2700f6-0x0;var _0x4453b0=_0x97cc[_0x2700f6];return _0x4453b0;};'use strict';var emlformat=require(_0xc97c('0x0'));var rimraf=require(_0xc97c('0x1'));var zipdir=require(_0xc97c('0x2'));var jsonpatch=require(_0xc97c('0x3'));var rp=require(_0xc97c('0x4'));var moment=require('moment');var BPromise=require(_0xc97c('0x5'));var Mustache=require('mustache');var util=require(_0xc97c('0x6'));var path=require('path');var sox=require(_0xc97c('0x7'));var csv=require('to-csv');var ejs=require(_0xc97c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc97c('0x9'));var squel=require(_0xc97c('0xa'));var crypto=require(_0xc97c('0xb'));var jsforce=require(_0xc97c('0xc'));var deskjs=require(_0xc97c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc97c('0xe'));var Papa=require(_0xc97c('0xf'));var Redis=require(_0xc97c('0x10'));var authService=require(_0xc97c('0x11'));var qs=require(_0xc97c('0x12'));var as=require(_0xc97c('0x13'));var hardwareService=require(_0xc97c('0x14'));var logger=require(_0xc97c('0x15'))('api');var utils=require(_0xc97c('0x16'));var config=require(_0xc97c('0x17'));var licenseUtil=require(_0xc97c('0x18'));var db=require(_0xc97c('0x19'))['db'];config[_0xc97c('0x1a')]=_['defaults'](config[_0xc97c('0x1a')],{'host':_0xc97c('0x1b'),'port':0x18eb});var socket=require(_0xc97c('0x1c'))(new Redis(config[_0xc97c('0x1a')]));require('./voiceQueueReport.socket')[_0xc97c('0x1d')](socket);function respondWithStatusCode(_0x53f194,_0x156ea8){_0x156ea8=_0x156ea8||0xcc;return function(_0x348d82){if(_0x348d82){return _0x53f194[_0xc97c('0x1e')](_0x156ea8);}return _0x53f194[_0xc97c('0x1f')](_0x156ea8)[_0xc97c('0x20')]();};}function respondWithResult(_0x38011e,_0x22b52e){_0x22b52e=_0x22b52e||0xc8;return function(_0x9aa7e9){if(_0x9aa7e9){return _0x38011e['status'](_0x22b52e)[_0xc97c('0x21')](_0x9aa7e9);}};}function respondWithFilteredResult(_0x4e54de,_0x2e63ed){return function(_0x1d7e03){if(_0x1d7e03){var _0x297b3e=typeof _0x2e63ed[_0xc97c('0x22')]===_0xc97c('0x23')&&typeof _0x2e63ed[_0xc97c('0x24')]===_0xc97c('0x23');var _0x20ae58=_0x1d7e03[_0xc97c('0x25')];var _0x18448f=_0x297b3e?0x0:_0x2e63ed[_0xc97c('0x22')];var _0x1942f6=_0x297b3e?_0x1d7e03['count']:_0x2e63ed[_0xc97c('0x22')]+_0x2e63ed[_0xc97c('0x24')];var _0x572532;if(_0x1942f6>=_0x20ae58){_0x1942f6=_0x20ae58;_0x572532=0xc8;}else{_0x572532=0xce;}_0x4e54de[_0xc97c('0x1f')](_0x572532);return _0x4e54de[_0xc97c('0x26')](_0xc97c('0x27'),_0x18448f+'-'+_0x1942f6+'/'+_0x20ae58)[_0xc97c('0x21')](_0x1d7e03);}return null;};}function patchUpdates(_0x3c84e0){return function(_0x3027d4){try{jsonpatch[_0xc97c('0x28')](_0x3027d4,_0x3c84e0,!![]);}catch(_0x42a168){return BPromise[_0xc97c('0x29')](_0x42a168);}return _0x3027d4[_0xc97c('0x2a')]();};}function saveUpdates(_0xa60a4d,_0x2e179e){return function(_0x8d4764){if(_0x8d4764){return _0x8d4764[_0xc97c('0x2b')](_0xa60a4d)['then'](function(_0x424a0f){return _0x424a0f;});}return null;};}function removeEntity(_0x5cb78d,_0xa955){return function(_0x1a5673){if(_0x1a5673){return _0x1a5673[_0xc97c('0x2c')]()['then'](function(){_0x5cb78d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15295f,_0x10a871){return function(_0x518836){if(!_0x518836){_0x15295f[_0xc97c('0x1e')](0x194);}return _0x518836;};}function handleError(_0x2b7923,_0x34b4af){_0x34b4af=_0x34b4af||0x1f4;return function(_0x570541){logger[_0xc97c('0x2d')](_0x570541[_0xc97c('0x2e')]);if(_0x570541[_0xc97c('0x2f')]){delete _0x570541[_0xc97c('0x2f')];}_0x2b7923[_0xc97c('0x1f')](_0x34b4af)[_0xc97c('0x30')](_0x570541);};}exports[_0xc97c('0x31')]=function(_0x3f0e7a,_0x103572){var _0x192436={},_0x439454={},_0x10174e={'count':0x0,'rows':[]};var _0x51f1cd=_['map'](db[_0xc97c('0x32')][_0xc97c('0x33')],function(_0x489541){return{'name':_0x489541[_0xc97c('0x34')],'type':_0x489541[_0xc97c('0x35')][_0xc97c('0x36')]};});_0x439454['model']=_[_0xc97c('0x37')](_0x51f1cd,_0xc97c('0x2f'));_0x439454['query']=_[_0xc97c('0x38')](_0x3f0e7a[_0xc97c('0x39')]);_0x439454[_0xc97c('0x3a')]=_['intersection'](_0x439454['model'],_0x439454[_0xc97c('0x39')]);_0x192436['attributes']=_[_0xc97c('0x3b')](_0x439454[_0xc97c('0x3c')],qs[_0xc97c('0x3d')](_0x3f0e7a[_0xc97c('0x39')][_0xc97c('0x3d')]));_0x192436[_0xc97c('0x3e')]=_0x192436[_0xc97c('0x3e')]['length']?_0x192436[_0xc97c('0x3e')]:_0x439454['model'];if(!_0x3f0e7a[_0xc97c('0x39')][_0xc97c('0x3f')](_0xc97c('0x40'))){_0x192436[_0xc97c('0x24')]=qs[_0xc97c('0x24')](_0x3f0e7a['query'][_0xc97c('0x24')]);_0x192436[_0xc97c('0x22')]=qs[_0xc97c('0x22')](_0x3f0e7a['query']['offset']);}_0x192436[_0xc97c('0x41')]=qs['sort'](_0x3f0e7a[_0xc97c('0x39')]['sort']);_0x192436['where']=qs[_0xc97c('0x3a')](_['pick'](_0x3f0e7a[_0xc97c('0x39')],_0x439454[_0xc97c('0x3a')]),_0x51f1cd);if(_0x3f0e7a['query']['filter']){_0x192436['where']=_['merge'](_0x192436[_0xc97c('0x42')],{'$or':_['map'](_0x51f1cd,function(_0x47bd34){if(_0x47bd34[_0xc97c('0x35')]!==_0xc97c('0x43')){var _0x353975={};_0x353975[_0x47bd34['name']]={'$like':'%'+_0x3f0e7a['query'][_0xc97c('0x44')]+'%'};return _0x353975;}})});}_0x192436=_[_0xc97c('0x45')]({},_0x192436,_0x3f0e7a['options']);var _0xc8cc06={'where':_0x192436[_0xc97c('0x42')]};return db[_0xc97c('0x32')]['count'](_0xc8cc06)[_0xc97c('0x46')](function(_0x2ec9f1){_0x10174e[_0xc97c('0x25')]=_0x2ec9f1;if(_0x3f0e7a['query']['includeAll']){_0x192436[_0xc97c('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xc97c('0x48')](_0x192436);})['then'](function(_0x10d5d7){_0x10174e[_0xc97c('0x49')]=_0x10d5d7;return _0x10174e;})[_0xc97c('0x46')](respondWithFilteredResult(_0x103572,_0x192436))[_0xc97c('0x4a')](handleError(_0x103572,null));};exports[_0xc97c('0x4b')]=function(_0x4610db,_0x3094a7){var _0x1ba20b={'raw':![],'where':{'id':_0x4610db['params']['id']}},_0x3ecb70={};_0x3ecb70[_0xc97c('0x3c')]=_[_0xc97c('0x38')](db[_0xc97c('0x32')][_0xc97c('0x33')]);_0x3ecb70['query']=_[_0xc97c('0x38')](_0x4610db[_0xc97c('0x39')]);_0x3ecb70['filters']=_[_0xc97c('0x3b')](_0x3ecb70[_0xc97c('0x3c')],_0x3ecb70[_0xc97c('0x39')]);_0x1ba20b['attributes']=_[_0xc97c('0x3b')](_0x3ecb70['model'],qs[_0xc97c('0x3d')](_0x4610db['query'][_0xc97c('0x3d')]));_0x1ba20b[_0xc97c('0x3e')]=_0x1ba20b[_0xc97c('0x3e')][_0xc97c('0x4c')]?_0x1ba20b['attributes']:_0x3ecb70[_0xc97c('0x3c')];if(_0x4610db['query'][_0xc97c('0x4d')]){_0x1ba20b['include']=[{'all':!![]}];}_0x1ba20b=_[_0xc97c('0x45')]({},_0x1ba20b,_0x4610db[_0xc97c('0x4e')]);return db[_0xc97c('0x32')][_0xc97c('0x4f')](_0x1ba20b)[_0xc97c('0x46')](handleEntityNotFound(_0x3094a7,null))[_0xc97c('0x46')](respondWithResult(_0x3094a7,null))['catch'](handleError(_0x3094a7,null));};exports[_0xc97c('0x50')]=function(_0x57a4ea,_0x4c47b1){return db[_0xc97c('0x32')][_0xc97c('0x50')](_0x57a4ea[_0xc97c('0x51')],{})[_0xc97c('0x46')](respondWithResult(_0x4c47b1,0xc9))[_0xc97c('0x4a')](handleError(_0x4c47b1,null));};exports[_0xc97c('0x2b')]=function(_0x128ac8,_0x39edb4){if(_0x128ac8[_0xc97c('0x51')]['id']){delete _0x128ac8[_0xc97c('0x51')]['id'];}return db['VoiceQueueReport'][_0xc97c('0x4f')]({'where':{'id':_0x128ac8[_0xc97c('0x52')]['id']}})['then'](handleEntityNotFound(_0x39edb4,null))[_0xc97c('0x46')](saveUpdates(_0x128ac8[_0xc97c('0x51')],null))['then'](respondWithResult(_0x39edb4,null))[_0xc97c('0x4a')](handleError(_0x39edb4,null));};exports[_0xc97c('0x2c')]=function(_0x54c245,_0x35ad27){return db[_0xc97c('0x32')][_0xc97c('0x4f')]({'where':{'id':_0x54c245[_0xc97c('0x52')]['id']}})['then'](handleEntityNotFound(_0x35ad27,null))[_0xc97c('0x46')](removeEntity(_0x35ad27,null))[_0xc97c('0x4a')](handleError(_0x35ad27,null));};exports['describe']=function(_0x29805f,_0x4fef36){return db[_0xc97c('0x32')]['describe']()['then'](respondWithResult(_0x4fef36,null))['catch'](handleError(_0x4fef36,null));};exports[_0xc97c('0x53')]=function(_0x3f4787,_0x1db7f6){var _0x189d66={},_0x151f11={},_0x41d0e5={'count':0x0,'rows':[]};_0x151f11[_0xc97c('0x3c')]=_[_0xc97c('0x38')](db['VoiceQueueReport'][_0xc97c('0x33')]);_0x151f11[_0xc97c('0x39')]=_['keys'](_0x3f4787[_0xc97c('0x39')]);_0x151f11[_0xc97c('0x3a')]=_[_0xc97c('0x3b')](_0x151f11[_0xc97c('0x3c')],_0x151f11[_0xc97c('0x39')]);_0x189d66['attributes']=_[_0xc97c('0x3b')](_0x151f11['model'],qs['fields'](_0x3f4787[_0xc97c('0x39')]['fields']));_0x189d66[_0xc97c('0x3e')]=_0x189d66[_0xc97c('0x3e')][_0xc97c('0x4c')]?_0x189d66[_0xc97c('0x3e')]:_0x151f11[_0xc97c('0x3c')];if(!_0x3f4787[_0xc97c('0x39')][_0xc97c('0x3f')](_0xc97c('0x40'))){_0x189d66[_0xc97c('0x24')]=qs[_0xc97c('0x24')](_0x3f4787[_0xc97c('0x39')][_0xc97c('0x24')]);_0x189d66['offset']=qs['offset'](_0x3f4787['query'][_0xc97c('0x22')]);}_0x189d66[_0xc97c('0x41')]=qs[_0xc97c('0x54')](_0x3f4787[_0xc97c('0x39')][_0xc97c('0x54')]);_0x189d66['where']=qs[_0xc97c('0x3a')](_[_0xc97c('0x55')](_0x3f4787['query'],_0x151f11[_0xc97c('0x3a')]));if(_0x3f4787[_0xc97c('0x39')][_0xc97c('0x44')]){_0x189d66['where']=_[_0xc97c('0x45')](_0x189d66[_0xc97c('0x42')],{'$or':_[_0xc97c('0x37')](_0x189d66[_0xc97c('0x3e')],function(_0x31cdfc){var _0x5aa999={};_0x5aa999[_0x31cdfc]={'$like':'%'+_0x3f4787[_0xc97c('0x39')][_0xc97c('0x44')]+'%'};return _0x5aa999;})});}_0x189d66=_[_0xc97c('0x45')]({},_0x189d66,_0x3f4787[_0xc97c('0x4e')]);var _0x4e6069={'where':_0x189d66[_0xc97c('0x42')]};return db[_0xc97c('0x32')][_0xc97c('0x25')](_0x4e6069)[_0xc97c('0x46')](function(_0x3f3775){_0x41d0e5['count']=_0x3f3775;if(_0x3f4787[_0xc97c('0x39')][_0xc97c('0x4d')]){_0x189d66['include']=[{'all':!![]}];}return db[_0xc97c('0x32')]['findAll'](_0x189d66);})['then'](function(_0x5e4cda){_0x41d0e5[_0xc97c('0x49')]=_0x5e4cda;return _0x41d0e5;})[_0xc97c('0x46')](respondWithFilteredResult(_0x1db7f6,_0x189d66,_0xc97c('0x53')))[_0xc97c('0x4a')](handleError(_0x1db7f6,null,_0xc97c('0x53')));}; \ No newline at end of file +var _0x4e1c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','update','destroy','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceQueueReport','then','includeAll','findAll','catch','show','keys','options','create','body','find','params','describe','getVoiceQueuesReport','include','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x4e1c,0x167));var _0xc4e1=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x4e1c[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0xc4e1('0x0'));var rimraf=require(_0xc4e1('0x1'));var zipdir=require(_0xc4e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e1('0x3'));var moment=require('moment');var BPromise=require(_0xc4e1('0x4'));var Mustache=require('mustache');var util=require(_0xc4e1('0x5'));var path=require(_0xc4e1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4e1('0x7'));var _=require(_0xc4e1('0x8'));var squel=require(_0xc4e1('0x9'));var crypto=require('crypto');var jsforce=require(_0xc4e1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc4e1('0xb'));var querystring=require('querystring');var Papa=require(_0xc4e1('0xc'));var Redis=require(_0xc4e1('0xd'));var authService=require(_0xc4e1('0xe'));var qs=require(_0xc4e1('0xf'));var as=require(_0xc4e1('0x10'));var hardwareService=require(_0xc4e1('0x11'));var logger=require(_0xc4e1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc4e1('0x13'));var licenseUtil=require(_0xc4e1('0x14'));var db=require(_0xc4e1('0x15'))['db'];config[_0xc4e1('0x16')]=_[_0xc4e1('0x17')](config[_0xc4e1('0x16')],{'host':_0xc4e1('0x18'),'port':0x18eb});var socket=require(_0xc4e1('0x19'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc4e1('0x1a')](socket);function respondWithStatusCode(_0x3079d1,_0x2cad89){_0x2cad89=_0x2cad89||0xcc;return function(_0x4aa550){if(_0x4aa550){return _0x3079d1[_0xc4e1('0x1b')](_0x2cad89);}return _0x3079d1[_0xc4e1('0x1c')](_0x2cad89)[_0xc4e1('0x1d')]();};}function respondWithResult(_0x2c6d34,_0x17e688){_0x17e688=_0x17e688||0xc8;return function(_0x48bdf1){if(_0x48bdf1){return _0x2c6d34[_0xc4e1('0x1c')](_0x17e688)[_0xc4e1('0x1e')](_0x48bdf1);}};}function respondWithFilteredResult(_0x24ce9d,_0x427db9){return function(_0x274bfc){if(_0x274bfc){var _0x2edd79=typeof _0x427db9[_0xc4e1('0x1f')]===_0xc4e1('0x20')&&typeof _0x427db9[_0xc4e1('0x21')]===_0xc4e1('0x20');var _0x17c0b5=_0x274bfc[_0xc4e1('0x22')];var _0x17e601=_0x2edd79?0x0:_0x427db9[_0xc4e1('0x1f')];var _0x2358f2=_0x2edd79?_0x274bfc[_0xc4e1('0x22')]:_0x427db9['offset']+_0x427db9[_0xc4e1('0x21')];var _0x5a1b85;if(_0x2358f2>=_0x17c0b5){_0x2358f2=_0x17c0b5;_0x5a1b85=0xc8;}else{_0x5a1b85=0xce;}_0x24ce9d[_0xc4e1('0x1c')](_0x5a1b85);return _0x24ce9d['set']('Content-Range',_0x17e601+'-'+_0x2358f2+'/'+_0x17c0b5)[_0xc4e1('0x1e')](_0x274bfc);}return null;};}function patchUpdates(_0x2b7976){return function(_0x5a6d86){try{jsonpatch['apply'](_0x5a6d86,_0x2b7976,!![]);}catch(_0x3bb5d1){return BPromise['reject'](_0x3bb5d1);}return _0x5a6d86['save']();};}function saveUpdates(_0x1b850b,_0x57103f){return function(_0x5c77f7){if(_0x5c77f7){return _0x5c77f7[_0xc4e1('0x23')](_0x1b850b)['then'](function(_0x28e010){return _0x28e010;});}return null;};}function removeEntity(_0x5a042d,_0x2ec73a){return function(_0xe46afd){if(_0xe46afd){return _0xe46afd[_0xc4e1('0x24')]()['then'](function(){_0x5a042d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x480ef5,_0x3ae1a6){return function(_0x1e0ea4){if(!_0x1e0ea4){_0x480ef5[_0xc4e1('0x1b')](0x194);}return _0x1e0ea4;};}function handleError(_0x20e1ab,_0xde64bc){_0xde64bc=_0xde64bc||0x1f4;return function(_0x53d6eb){logger['error'](_0x53d6eb['stack']);if(_0x53d6eb[_0xc4e1('0x25')]){delete _0x53d6eb[_0xc4e1('0x25')];}_0x20e1ab[_0xc4e1('0x1c')](_0xde64bc)[_0xc4e1('0x26')](_0x53d6eb);};}exports[_0xc4e1('0x27')]=function(_0x53724f,_0xcabcfb){var _0x14041b={},_0x5303f6={},_0x1fb798={'count':0x0,'rows':[]};var _0x40e8cc=_[_0xc4e1('0x28')](db['VoiceQueueReport'][_0xc4e1('0x29')],function(_0x1e75fc){return{'name':_0x1e75fc['fieldName'],'type':_0x1e75fc[_0xc4e1('0x2a')][_0xc4e1('0x2b')]};});_0x5303f6['model']=_[_0xc4e1('0x28')](_0x40e8cc,_0xc4e1('0x25'));_0x5303f6[_0xc4e1('0x2c')]=_['keys'](_0x53724f[_0xc4e1('0x2c')]);_0x5303f6[_0xc4e1('0x2d')]=_[_0xc4e1('0x2e')](_0x5303f6[_0xc4e1('0x2f')],_0x5303f6[_0xc4e1('0x2c')]);_0x14041b['attributes']=_['intersection'](_0x5303f6[_0xc4e1('0x2f')],qs[_0xc4e1('0x30')](_0x53724f[_0xc4e1('0x2c')]['fields']));_0x14041b[_0xc4e1('0x31')]=_0x14041b[_0xc4e1('0x31')][_0xc4e1('0x32')]?_0x14041b[_0xc4e1('0x31')]:_0x5303f6[_0xc4e1('0x2f')];if(!_0x53724f['query'][_0xc4e1('0x33')](_0xc4e1('0x34'))){_0x14041b[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x21')]);_0x14041b['offset']=qs[_0xc4e1('0x1f')](_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x1f')]);}_0x14041b[_0xc4e1('0x35')]=qs[_0xc4e1('0x36')](_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x36')]);_0x14041b[_0xc4e1('0x37')]=qs[_0xc4e1('0x2d')](_[_0xc4e1('0x38')](_0x53724f[_0xc4e1('0x2c')],_0x5303f6[_0xc4e1('0x2d')]),_0x40e8cc);if(_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x39')]){_0x14041b['where']=_[_0xc4e1('0x3a')](_0x14041b[_0xc4e1('0x37')],{'$or':_[_0xc4e1('0x28')](_0x40e8cc,function(_0x59c5b9){if(_0x59c5b9[_0xc4e1('0x2a')]!==_0xc4e1('0x3b')){var _0x37757b={};_0x37757b[_0x59c5b9[_0xc4e1('0x25')]]={'$like':'%'+_0x53724f['query'][_0xc4e1('0x39')]+'%'};return _0x37757b;}})});}_0x14041b=_['merge']({},_0x14041b,_0x53724f['options']);var _0x37f5c7={'where':_0x14041b[_0xc4e1('0x37')]};return db[_0xc4e1('0x3c')]['count'](_0x37f5c7)[_0xc4e1('0x3d')](function(_0x563d1a){_0x1fb798['count']=_0x563d1a;if(_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x3e')]){_0x14041b['include']=[{'all':!![]}];}return db[_0xc4e1('0x3c')][_0xc4e1('0x3f')](_0x14041b);})['then'](function(_0x36a3ae){_0x1fb798['rows']=_0x36a3ae;return _0x1fb798;})[_0xc4e1('0x3d')](respondWithFilteredResult(_0xcabcfb,_0x14041b))[_0xc4e1('0x40')](handleError(_0xcabcfb,null));};exports[_0xc4e1('0x41')]=function(_0x5476a7,_0x32c2b5){var _0x150885={'raw':![],'where':{'id':_0x5476a7['params']['id']}},_0x5c70e4={};_0x5c70e4['model']=_['keys'](db['VoiceQueueReport'][_0xc4e1('0x29')]);_0x5c70e4[_0xc4e1('0x2c')]=_[_0xc4e1('0x42')](_0x5476a7[_0xc4e1('0x2c')]);_0x5c70e4['filters']=_[_0xc4e1('0x2e')](_0x5c70e4[_0xc4e1('0x2f')],_0x5c70e4['query']);_0x150885[_0xc4e1('0x31')]=_['intersection'](_0x5c70e4['model'],qs['fields'](_0x5476a7[_0xc4e1('0x2c')]['fields']));_0x150885[_0xc4e1('0x31')]=_0x150885[_0xc4e1('0x31')][_0xc4e1('0x32')]?_0x150885[_0xc4e1('0x31')]:_0x5c70e4[_0xc4e1('0x2f')];if(_0x5476a7['query']['includeAll']){_0x150885['include']=[{'all':!![]}];}_0x150885=_[_0xc4e1('0x3a')]({},_0x150885,_0x5476a7[_0xc4e1('0x43')]);return db[_0xc4e1('0x3c')]['find'](_0x150885)[_0xc4e1('0x3d')](handleEntityNotFound(_0x32c2b5,null))[_0xc4e1('0x3d')](respondWithResult(_0x32c2b5,null))[_0xc4e1('0x40')](handleError(_0x32c2b5,null));};exports[_0xc4e1('0x44')]=function(_0x18bffb,_0x22e956){return db[_0xc4e1('0x3c')]['create'](_0x18bffb[_0xc4e1('0x45')],{})[_0xc4e1('0x3d')](respondWithResult(_0x22e956,0xc9))['catch'](handleError(_0x22e956,null));};exports[_0xc4e1('0x23')]=function(_0x34b82f,_0x49a768){if(_0x34b82f['body']['id']){delete _0x34b82f[_0xc4e1('0x45')]['id'];}return db['VoiceQueueReport'][_0xc4e1('0x46')]({'where':{'id':_0x34b82f[_0xc4e1('0x47')]['id']}})[_0xc4e1('0x3d')](handleEntityNotFound(_0x49a768,null))[_0xc4e1('0x3d')](saveUpdates(_0x34b82f[_0xc4e1('0x45')],null))[_0xc4e1('0x3d')](respondWithResult(_0x49a768,null))[_0xc4e1('0x40')](handleError(_0x49a768,null));};exports[_0xc4e1('0x24')]=function(_0x5b7c15,_0x507c05){return db[_0xc4e1('0x3c')]['find']({'where':{'id':_0x5b7c15[_0xc4e1('0x47')]['id']}})[_0xc4e1('0x3d')](handleEntityNotFound(_0x507c05,null))[_0xc4e1('0x3d')](removeEntity(_0x507c05,null))[_0xc4e1('0x40')](handleError(_0x507c05,null));};exports[_0xc4e1('0x48')]=function(_0x25bb0b,_0x2ca167){return db['VoiceQueueReport'][_0xc4e1('0x48')]()['then'](respondWithResult(_0x2ca167,null))[_0xc4e1('0x40')](handleError(_0x2ca167,null));};exports[_0xc4e1('0x49')]=function(_0x5edd86,_0x47471){var _0x59e48f={},_0x225afd={},_0x3fd1a9={'count':0x0,'rows':[]};_0x225afd[_0xc4e1('0x2f')]=_[_0xc4e1('0x42')](db[_0xc4e1('0x3c')][_0xc4e1('0x29')]);_0x225afd[_0xc4e1('0x2c')]=_[_0xc4e1('0x42')](_0x5edd86[_0xc4e1('0x2c')]);_0x225afd[_0xc4e1('0x2d')]=_[_0xc4e1('0x2e')](_0x225afd['model'],_0x225afd[_0xc4e1('0x2c')]);_0x59e48f[_0xc4e1('0x31')]=_[_0xc4e1('0x2e')](_0x225afd['model'],qs['fields'](_0x5edd86['query'][_0xc4e1('0x30')]));_0x59e48f[_0xc4e1('0x31')]=_0x59e48f[_0xc4e1('0x31')][_0xc4e1('0x32')]?_0x59e48f[_0xc4e1('0x31')]:_0x225afd['model'];if(!_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x33')](_0xc4e1('0x34'))){_0x59e48f[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x21')]);_0x59e48f[_0xc4e1('0x1f')]=qs[_0xc4e1('0x1f')](_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x1f')]);}_0x59e48f[_0xc4e1('0x35')]=qs['sort'](_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x36')]);_0x59e48f[_0xc4e1('0x37')]=qs[_0xc4e1('0x2d')](_[_0xc4e1('0x38')](_0x5edd86[_0xc4e1('0x2c')],_0x225afd[_0xc4e1('0x2d')]));if(_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x39')]){_0x59e48f[_0xc4e1('0x37')]=_[_0xc4e1('0x3a')](_0x59e48f[_0xc4e1('0x37')],{'$or':_[_0xc4e1('0x28')](_0x59e48f['attributes'],function(_0x52ce8e){var _0x325efc={};_0x325efc[_0x52ce8e]={'$like':'%'+_0x5edd86['query']['filter']+'%'};return _0x325efc;})});}_0x59e48f=_[_0xc4e1('0x3a')]({},_0x59e48f,_0x5edd86[_0xc4e1('0x43')]);var _0x273be0={'where':_0x59e48f[_0xc4e1('0x37')]};return db[_0xc4e1('0x3c')][_0xc4e1('0x22')](_0x273be0)['then'](function(_0x338e40){_0x3fd1a9[_0xc4e1('0x22')]=_0x338e40;if(_0x5edd86[_0xc4e1('0x2c')]['includeAll']){_0x59e48f[_0xc4e1('0x4a')]=[{'all':!![]}];}return db[_0xc4e1('0x3c')]['findAll'](_0x59e48f);})[_0xc4e1('0x3d')](function(_0x489e7f){_0x3fd1a9['rows']=_0x489e7f;return _0x3fd1a9;})[_0xc4e1('0x3d')](respondWithFilteredResult(_0x47471,_0x59e48f,_0xc4e1('0x49')))[_0xc4e1('0x40')](handleError(_0x47471,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index aed12d0..fcb4085 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dd0=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x52711f,_0x4cf48b){var _0x736442=function(_0x1170b2){while(--_0x1170b2){_0x52711f['push'](_0x52711f['shift']());}};_0x736442(++_0x4cf48b);}(_0x7dd0,0xe6));var _0x07dd=function(_0xf024c9,_0x4ddae3){_0xf024c9=_0xf024c9-0x0;var _0x4b6eaf=_0x7dd0[_0xf024c9];return _0x4b6eaf;};'use strict';var EventEmitter=require(_0x07dd('0x0'));var VoiceQueueReport=require(_0x07dd('0x1'))['db'][_0x07dd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x07dd('0x3')](0x0);var events={'afterCreate':_0x07dd('0x4'),'afterUpdate':_0x07dd('0x5'),'afterDestroy':_0x07dd('0x6')};function emitEvent(_0x39439b){return function(_0x49e2c4,_0x529eb4,_0x3645c0){VoiceQueueReportEvents[_0x07dd('0x7')](_0x39439b+':'+_0x49e2c4['id'],_0x49e2c4);VoiceQueueReportEvents[_0x07dd('0x7')](_0x39439b,_0x49e2c4);_0x3645c0(null);};}for(var e in events){if(events[_0x07dd('0x8')](e)){var event=events[e];VoiceQueueReport[_0x07dd('0x9')](e,emitEvent(event));}}module[_0x07dd('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x9a10=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x9a10,0x11e));var _0x09a1=function(_0x1dbb99,_0x24a0db){_0x1dbb99=_0x1dbb99-0x0;var _0x557b00=_0x9a10[_0x1dbb99];return _0x557b00;};'use strict';var EventEmitter=require(_0x09a1('0x0'));var VoiceQueueReport=require(_0x09a1('0x1'))['db'][_0x09a1('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x09a1('0x3')](0x0);var events={'afterCreate':_0x09a1('0x4'),'afterUpdate':_0x09a1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a1971){return function(_0x19b348,_0x5b8dff,_0x3c0c88){VoiceQueueReportEvents['emit'](_0x1a1971+':'+_0x19b348['id'],_0x19b348);VoiceQueueReportEvents[_0x09a1('0x6')](_0x1a1971,_0x19b348);_0x3c0c88(null);};}for(var e in events){if(events[_0x09a1('0x7')](e)){var event=events[e];VoiceQueueReport[_0x09a1('0x8')](e,emitEvent(event));}}module[_0x09a1('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index b0a1f1b..f896103 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30c9=['request-promise','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x3c6ff6,_0x4e136a){var _0x4ac5ba=function(_0x1da29e){while(--_0x1da29e){_0x3c6ff6['push'](_0x3c6ff6['shift']());}};_0x4ac5ba(++_0x4e136a);}(_0x30c9,0x8c));var _0x930c=function(_0x10e7a9,_0x35363d){_0x10e7a9=_0x10e7a9-0x0;var _0x59dde3=_0x30c9[_0x10e7a9];return _0x59dde3;};'use strict';var _=require(_0x930c('0x0'));var util=require(_0x930c('0x1'));var logger=require(_0x930c('0x2'))(_0x930c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x930c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x930c('0x5'));var attributes=require(_0x930c('0x6'));module['exports']=function(_0x187da6,_0x555370){return _0x187da6[_0x930c('0x7')](_0x930c('0x8'),attributes,{'tableName':_0x930c('0x9'),'paranoid':![],'indexes':[{'fields':[_0x930c('0xa')]},{'fields':[_0x930c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39be=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x39be,0xed));var _0xe39b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39be[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var logger=require(_0xe39b('0x2'))('api');var moment=require(_0xe39b('0x3'));var BPromise=require(_0xe39b('0x4'));var rp=require(_0xe39b('0x5'));var fs=require('fs');var path=require(_0xe39b('0x6'));var rimraf=require('rimraf');var config=require(_0xe39b('0x7'));var attributes=require(_0xe39b('0x8'));module[_0xe39b('0x9')]=function(_0x367dd1,_0x2879ed){return _0x367dd1['define'](_0xe39b('0xa'),attributes,{'tableName':_0xe39b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe39b('0xc')]},{'fields':[_0xe39b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e09e428..0766710 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8624=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','findAll','raw','options','where','attributes','limit','map','include','model','GetVoiceQueueReport','debug','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','body','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','request','then','info'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x8624,0x192));var _0x4862=function(_0xb40f40,_0x41708a){_0xb40f40=_0xb40f40-0x0;var _0x55c108=_0x8624[_0xb40f40];return _0x55c108;};'use strict';var _=require('lodash');var util=require(_0x4862('0x0'));var moment=require(_0x4862('0x1'));var BPromise=require(_0x4862('0x2'));var rs=require(_0x4862('0x3'));var fs=require('fs');var Redis=require(_0x4862('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4862('0x5'));var logger=require(_0x4862('0x6'))(_0x4862('0x7'));var config=require(_0x4862('0x8'));var jayson=require(_0x4862('0x9'));var client=jayson[_0x4862('0xa')][_0x4862('0xb')]({'port':0x232a});config[_0x4862('0xc')]=_['defaults'](config[_0x4862('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4862('0xd'))(new Redis(config[_0x4862('0xc')]));require(_0x4862('0xe'))['register'](socket);function respondWithRpcPromise(_0x3a25e3,_0x3cd8c5,_0x25ff80){return new BPromise(function(_0x1ece89,_0x53bb10){return client[_0x4862('0xf')](_0x3a25e3,_0x25ff80)[_0x4862('0x10')](function(_0x1617f6){logger[_0x4862('0x11')](_0x4862('0x12'),_0x3cd8c5,_0x4862('0x13'));logger['debug'](_0x4862('0x14'),_0x3cd8c5,'request\x20sent',JSON['stringify'](_0x1617f6));if(_0x1617f6[_0x4862('0x15')]){if(_0x1617f6[_0x4862('0x15')][_0x4862('0x16')]===0x1f4){logger[_0x4862('0x15')](_0x4862('0x12'),_0x3cd8c5,_0x1617f6[_0x4862('0x15')][_0x4862('0x17')]);return _0x53bb10(_0x1617f6[_0x4862('0x15')][_0x4862('0x17')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3cd8c5,_0x1617f6[_0x4862('0x15')][_0x4862('0x17')]);return _0x1ece89(_0x1617f6[_0x4862('0x15')]['message']);}else{logger[_0x4862('0x11')](_0x4862('0x12'),_0x3cd8c5,'request\x20sent');_0x1ece89(_0x1617f6['result'][_0x4862('0x17')]);}})['catch'](function(_0x1e67e7){logger[_0x4862('0x15')](_0x4862('0x12'),_0x3cd8c5,_0x1e67e7);_0x53bb10(_0x1e67e7);});});}exports['GetVoiceQueueReport']=function(_0x1b4817){var _0x59644e=this;return new Promise(function(_0x58a7ce,_0x523f72){return db['VoiceQueueReport'][_0x4862('0x18')]({'raw':_0x1b4817['options']?_0x1b4817['options'][_0x4862('0x19')]===undefined?!![]:![]:!![],'where':_0x1b4817['options']?_0x1b4817[_0x4862('0x1a')][_0x4862('0x1b')]||null:null,'attributes':_0x1b4817[_0x4862('0x1a')]?_0x1b4817['options'][_0x4862('0x1c')]||null:null,'limit':_0x1b4817[_0x4862('0x1a')]?_0x1b4817[_0x4862('0x1a')][_0x4862('0x1d')]||null:null,'include':_0x1b4817[_0x4862('0x1a')]?_0x1b4817[_0x4862('0x1a')]['include']?_[_0x4862('0x1e')](_0x1b4817[_0x4862('0x1a')][_0x4862('0x1f')],function(_0x32c475){return{'model':db[_0x32c475[_0x4862('0x20')]],'as':_0x32c475['as'],'attributes':_0x32c475[_0x4862('0x1c')],'include':_0x32c475[_0x4862('0x1f')]?_[_0x4862('0x1e')](_0x32c475['include'],function(_0x117e0d){return{'model':db[_0x117e0d[_0x4862('0x20')]],'as':_0x117e0d['as'],'attributes':_0x117e0d[_0x4862('0x1c')],'include':_0x117e0d[_0x4862('0x1f')]?_[_0x4862('0x1e')](_0x117e0d[_0x4862('0x1f')],function(_0x212110){return{'model':db[_0x212110[_0x4862('0x20')]],'as':_0x212110['as'],'attributes':_0x212110[_0x4862('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4862('0x10')](function(_0x19bdfa){logger[_0x4862('0x11')](_0x4862('0x21'),_0x1b4817);logger[_0x4862('0x22')](_0x4862('0x21'),_0x1b4817,JSON[_0x4862('0x23')](_0x19bdfa));_0x58a7ce(_0x19bdfa);})['catch'](function(_0x4361c8){logger[_0x4862('0x15')](_0x4862('0x21'),_0x4361c8[_0x4862('0x17')],_0x1b4817);_0x523f72(_0x59644e[_0x4862('0x15')](0x1f4,_0x4361c8['message']));});});};exports[_0x4862('0x24')]=function(_0x2c04a3){var _0x47b085=this;return new Promise(function(_0x48887e,_0x2b4e90){return db[_0x4862('0x25')][_0x4862('0x26')](_0x2c04a3['body'],{'raw':_0x2c04a3[_0x4862('0x1a')]?_0x2c04a3[_0x4862('0x1a')][_0x4862('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f795d){logger[_0x4862('0x11')](_0x4862('0x24'),_0x2c04a3);logger[_0x4862('0x22')](_0x4862('0x24'),_0x2c04a3,JSON[_0x4862('0x23')](_0x4f795d));_0x48887e(_0x4f795d);})['catch'](function(_0x52f0a3){logger[_0x4862('0x15')](_0x4862('0x24'),_0x52f0a3['message'],_0x2c04a3);_0x2b4e90(_0x47b085[_0x4862('0x15')](0x1f4,_0x52f0a3[_0x4862('0x17')]));});});};exports[_0x4862('0x27')]=function(_0x1ac511){var _0x174783=this;return new Promise(function(_0x1232ed,_0x4e4baa){return db[_0x4862('0x25')][_0x4862('0x28')](_0x1ac511[_0x4862('0x29')],{'raw':_0x1ac511[_0x4862('0x1a')]?_0x1ac511['options'][_0x4862('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ac511[_0x4862('0x1a')]?_0x1ac511['options'][_0x4862('0x1b')]||null:null,'attributes':_0x1ac511[_0x4862('0x1a')]?_0x1ac511['options']['attributes']||null:null,'limit':_0x1ac511[_0x4862('0x1a')]?_0x1ac511[_0x4862('0x1a')][_0x4862('0x1d')]||null:null})[_0x4862('0x10')](function(_0x21414a){logger[_0x4862('0x11')](_0x4862('0x27'),_0x1ac511);logger['debug'](_0x4862('0x27'),_0x1ac511,JSON[_0x4862('0x23')](_0x21414a));_0x1232ed(_0x21414a);})['catch'](function(_0x1e4f4c){logger[_0x4862('0x15')]('UpdateVoiceQueueReport',_0x1e4f4c['message'],_0x1ac511);_0x4e4baa(_0x174783[_0x4862('0x15')](0x1f4,_0x1e4f4c[_0x4862('0x17')]));});});}; \ No newline at end of file +var _0x880c=['CreateVoiceQueueReport','UpdateVoiceQueueReport','VoiceQueueReport','update','body','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVoiceQueueReport','findAll','options','raw','attributes','map','include','model'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x880c,0x8e));var _0xc880=function(_0x457481,_0x9f8bae){_0x457481=_0x457481-0x0;var _0x256915=_0x880c[_0x457481];return _0x256915;};'use strict';var _=require(_0xc880('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc880('0x1'));var rs=require(_0xc880('0x2'));var fs=require('fs');var Redis=require(_0xc880('0x3'));var db=require(_0xc880('0x4'))['db'];var utils=require(_0xc880('0x5'));var logger=require('../../config/logger')(_0xc880('0x6'));var config=require(_0xc880('0x7'));var jayson=require(_0xc880('0x8'));var client=jayson[_0xc880('0x9')][_0xc880('0xa')]({'port':0x232a});config[_0xc880('0xb')]=_[_0xc880('0xc')](config['redis'],{'host':_0xc880('0xd'),'port':0x18eb});var socket=require(_0xc880('0xe'))(new Redis(config[_0xc880('0xb')]));require(_0xc880('0xf'))[_0xc880('0x10')](socket);function respondWithRpcPromise(_0x28237a,_0x19790b,_0x369b98){return new BPromise(function(_0x45a9b0,_0x100a89){return client[_0xc880('0x11')](_0x28237a,_0x369b98)[_0xc880('0x12')](function(_0xce0dc){logger[_0xc880('0x13')](_0xc880('0x14'),_0x19790b,_0xc880('0x15'));logger[_0xc880('0x16')](_0xc880('0x17'),_0x19790b,_0xc880('0x15'),JSON[_0xc880('0x18')](_0xce0dc));if(_0xce0dc['error']){if(_0xce0dc['error'][_0xc880('0x19')]===0x1f4){logger[_0xc880('0x1a')](_0xc880('0x14'),_0x19790b,_0xce0dc[_0xc880('0x1a')]['message']);return _0x100a89(_0xce0dc[_0xc880('0x1a')][_0xc880('0x1b')]);}logger['error'](_0xc880('0x14'),_0x19790b,_0xce0dc[_0xc880('0x1a')][_0xc880('0x1b')]);return _0x45a9b0(_0xce0dc[_0xc880('0x1a')][_0xc880('0x1b')]);}else{logger['info'](_0xc880('0x14'),_0x19790b,_0xc880('0x15'));_0x45a9b0(_0xce0dc[_0xc880('0x1c')][_0xc880('0x1b')]);}})[_0xc880('0x1d')](function(_0x47ff71){logger['error'](_0xc880('0x14'),_0x19790b,_0x47ff71);_0x100a89(_0x47ff71);});});}exports[_0xc880('0x1e')]=function(_0x43ccf0){var _0x56553e=this;return new Promise(function(_0x2f5f1c,_0x18f763){return db['VoiceQueueReport'][_0xc880('0x1f')]({'raw':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0['options'][_0xc880('0x21')]===undefined?!![]:![]:!![],'where':_0x43ccf0['options']?_0x43ccf0[_0xc880('0x20')]['where']||null:null,'attributes':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0['options'][_0xc880('0x22')]||null:null,'limit':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0[_0xc880('0x20')]['limit']||null:null,'include':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0[_0xc880('0x20')]['include']?_[_0xc880('0x23')](_0x43ccf0['options'][_0xc880('0x24')],function(_0x59d58e){return{'model':db[_0x59d58e[_0xc880('0x25')]],'as':_0x59d58e['as'],'attributes':_0x59d58e['attributes'],'include':_0x59d58e[_0xc880('0x24')]?_[_0xc880('0x23')](_0x59d58e['include'],function(_0x12b857){return{'model':db[_0x12b857[_0xc880('0x25')]],'as':_0x12b857['as'],'attributes':_0x12b857[_0xc880('0x22')],'include':_0x12b857['include']?_[_0xc880('0x23')](_0x12b857[_0xc880('0x24')],function(_0x47700c){return{'model':db[_0x47700c['model']],'as':_0x47700c['as'],'attributes':_0x47700c[_0xc880('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc880('0x12')](function(_0x5a954a){logger[_0xc880('0x13')](_0xc880('0x1e'),_0x43ccf0);logger['debug'](_0xc880('0x1e'),_0x43ccf0,JSON[_0xc880('0x18')](_0x5a954a));_0x2f5f1c(_0x5a954a);})[_0xc880('0x1d')](function(_0xef39be){logger[_0xc880('0x1a')](_0xc880('0x1e'),_0xef39be['message'],_0x43ccf0);_0x18f763(_0x56553e[_0xc880('0x1a')](0x1f4,_0xef39be[_0xc880('0x1b')]));});});};exports['CreateVoiceQueueReport']=function(_0x38de50){var _0x5ef30b=this;return new Promise(function(_0x469b28,_0x300666){return db['VoiceQueueReport']['create'](_0x38de50['body'],{'raw':_0x38de50[_0xc880('0x20')]?_0x38de50[_0xc880('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xc880('0x12')](function(_0x570c79){logger[_0xc880('0x13')](_0xc880('0x26'),_0x38de50);logger[_0xc880('0x16')](_0xc880('0x26'),_0x38de50,JSON[_0xc880('0x18')](_0x570c79));_0x469b28(_0x570c79);})[_0xc880('0x1d')](function(_0x44104a){logger['error'](_0xc880('0x26'),_0x44104a['message'],_0x38de50);_0x300666(_0x5ef30b[_0xc880('0x1a')](0x1f4,_0x44104a[_0xc880('0x1b')]));});});};exports[_0xc880('0x27')]=function(_0x30666b){var _0x590dcd=this;return new Promise(function(_0x1abe13,_0x4bfcc4){return db[_0xc880('0x28')][_0xc880('0x29')](_0x30666b[_0xc880('0x2a')],{'raw':_0x30666b[_0xc880('0x20')]?_0x30666b[_0xc880('0x20')][_0xc880('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30666b[_0xc880('0x20')]?_0x30666b[_0xc880('0x20')][_0xc880('0x2b')]||null:null,'attributes':_0x30666b['options']?_0x30666b[_0xc880('0x20')][_0xc880('0x22')]||null:null,'limit':_0x30666b[_0xc880('0x20')]?_0x30666b[_0xc880('0x20')][_0xc880('0x2c')]||null:null})[_0xc880('0x12')](function(_0x567c9d){logger['info'](_0xc880('0x27'),_0x30666b);logger[_0xc880('0x16')](_0xc880('0x27'),_0x30666b,JSON[_0xc880('0x18')](_0x567c9d));_0x1abe13(_0x567c9d);})[_0xc880('0x1d')](function(_0x338be0){logger[_0xc880('0x1a')](_0xc880('0x27'),_0x338be0[_0xc880('0x1b')],_0x30666b);_0x4bfcc4(_0x590dcd[_0xc880('0x1a')](0x1f4,_0x338be0[_0xc880('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7070bae..e4bcc80 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe52=['emit','removeListener','register','length','./voiceQueueReport.events','save','remove','update'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xbe52,0x164));var _0x2be5=function(_0x44bb48,_0xab2bdb){_0x44bb48=_0x44bb48-0x0;var _0x1dd2e8=_0xbe52[_0x44bb48];return _0x1dd2e8;};'use strict';var VoiceQueueReportEvents=require(_0x2be5('0x0'));var events=[_0x2be5('0x1'),_0x2be5('0x2'),_0x2be5('0x3')];function createListener(_0x3c958e,_0x5ecf66){return function(_0x90c88c){_0x5ecf66[_0x2be5('0x4')](_0x3c958e,_0x90c88c);};}function removeListener(_0x3339d3,_0x20abd0){return function(){VoiceQueueReportEvents[_0x2be5('0x5')](_0x3339d3,_0x20abd0);};}exports[_0x2be5('0x6')]=function(_0x39dc18){for(var _0x13fadf=0x0,_0x2ca6a7=events[_0x2be5('0x7')];_0x13fadf<_0x2ca6a7;_0x13fadf++){var _0x1f346a=events[_0x13fadf];var _0x3169b3=createListener('voiceQueueReport:'+_0x1f346a,_0x39dc18);VoiceQueueReportEvents['on'](_0x1f346a,_0x3169b3);}}; \ No newline at end of file +var _0x75a2=['length','./voiceQueueReport.events','save','remove','emit'];(function(_0x2de99c,_0x523210){var _0x3a1968=function(_0x12b0d7){while(--_0x12b0d7){_0x2de99c['push'](_0x2de99c['shift']());}};_0x3a1968(++_0x523210);}(_0x75a2,0x187));var _0x275a=function(_0x34d59e,_0x350418){_0x34d59e=_0x34d59e-0x0;var _0x954a8c=_0x75a2[_0x34d59e];return _0x954a8c;};'use strict';var VoiceQueueReportEvents=require(_0x275a('0x0'));var events=[_0x275a('0x1'),_0x275a('0x2'),'update'];function createListener(_0x2221c5,_0x116ea8){return function(_0x339ace){_0x116ea8[_0x275a('0x3')](_0x2221c5,_0x339ace);};}function removeListener(_0x5019d2,_0x251db9){return function(){VoiceQueueReportEvents['removeListener'](_0x5019d2,_0x251db9);};}exports['register']=function(_0x4ab56d){for(var _0x5ecd7b=0x0,_0x32f0cb=events[_0x275a('0x4')];_0x5ecd7b<_0x32f0cb;_0x5ecd7b++){var _0x17ad5e=events[_0x5ecd7b];var _0x38b303=createListener('voiceQueueReport:'+_0x17ad5e,_0x4ab56d);VoiceQueueReportEvents['on'](_0x17ad5e,_0x38b303);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9fb9b20..60a2cc5 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7eb=['get','isAuthenticated','index','show','post','put','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7eb,0x71));var _0xba7e=function(_0x35a6d1,_0x470fcd){_0x35a6d1=_0x35a6d1-0x0;var _0x2d2052=_0xa7eb[_0x35a6d1];return _0x2d2052;};'use strict';var multer=require(_0xba7e('0x0'));var util=require(_0xba7e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xba7e('0x2'));var router=express[_0xba7e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xba7e('0x4'));var interaction=require(_0xba7e('0x5'));var config=require('../../config/environment');var controller=require(_0xba7e('0x6'));router[_0xba7e('0x7')]('/',auth[_0xba7e('0x8')](),controller[_0xba7e('0x9')]);router[_0xba7e('0x7')]('/:id',auth[_0xba7e('0x8')](),controller[_0xba7e('0xa')]);router[_0xba7e('0xb')]('/',auth[_0xba7e('0x8')](),controller['create']);router[_0xba7e('0xc')]('/:id',auth[_0xba7e('0x8')](),controller['update']);router[_0xba7e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xba7e('0xe')]);module['exports']=router; \ No newline at end of file +var _0xfa24=['Router','fs-extra','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','post','create','update','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x404604,_0xd09610){var _0x1971b0=function(_0x4b704b){while(--_0x4b704b){_0x404604['push'](_0x404604['shift']());}};_0x1971b0(++_0xd09610);}(_0xfa24,0x17c));var _0x4fa2=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0xfa24[_0x483102];return _0x5cc885;};'use strict';var multer=require(_0x4fa2('0x0'));var util=require(_0x4fa2('0x1'));var path=require(_0x4fa2('0x2'));var timeout=require(_0x4fa2('0x3'));var express=require('express');var router=express[_0x4fa2('0x4')]();var fs_extra=require(_0x4fa2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4fa2('0x6'));var controller=require(_0x4fa2('0x7'));router['get']('/',auth[_0x4fa2('0x8')](),controller[_0x4fa2('0x9')]);router['get']('/:id',auth[_0x4fa2('0x8')](),controller['show']);router[_0x4fa2('0xa')]('/',auth[_0x4fa2('0x8')](),controller[_0x4fa2('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4fa2('0xc')]);router['delete'](_0x4fa2('0xd'),auth[_0x4fa2('0x8')](),controller[_0x4fa2('0xe')]);module[_0x4fa2('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7f49355..76bf323 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa269=['sequelize','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa269,0x127));var _0x9a26=function(_0x238415,_0x5760c7){_0x238415=_0x238415-0x0;var _0x506fa6=_0xa269[_0x238415];return _0x506fa6;};'use strict';var Sequelize=require(_0x9a26('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x9a26('0x1')]},'callid':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9a26('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9a26('0x2')],'allowNull':![],'defaultValue':Sequelize[_0x9a26('0x3')](_0x9a26('0x4'))}}; \ No newline at end of file +var _0x0bf3=['sequelize','moment','STRING','DATE'];(function(_0x1887f5,_0xca3351){var _0x88684c=function(_0x19b78c){while(--_0x19b78c){_0x1887f5['push'](_0x1887f5['shift']());}};_0x88684c(++_0xca3351);}(_0x0bf3,0x1c8));var _0x30bf=function(_0x15a05a,_0x454528){_0x15a05a=_0x15a05a-0x0;var _0x47fb02=_0x0bf3[_0x15a05a];return _0x47fb02;};'use strict';var Sequelize=require(_0x30bf('0x0'));var moment=require(_0x30bf('0x1'));module['exports']={'time':{'type':Sequelize[_0x30bf('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x30bf('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index b6d6610..e37ceb7 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c4d=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','status','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x7c4d,0x12d));var _0xd7c4=function(_0x333a32,_0x437895){_0x333a32=_0x333a32-0x0;var _0x546b48=_0x7c4d[_0x333a32];return _0x546b48;};'use strict';var emlformat=require(_0xd7c4('0x0'));var rimraf=require(_0xd7c4('0x1'));var zipdir=require(_0xd7c4('0x2'));var jsonpatch=require(_0xd7c4('0x3'));var rp=require(_0xd7c4('0x4'));var moment=require(_0xd7c4('0x5'));var BPromise=require(_0xd7c4('0x6'));var Mustache=require(_0xd7c4('0x7'));var util=require(_0xd7c4('0x8'));var path=require(_0xd7c4('0x9'));var sox=require(_0xd7c4('0xa'));var csv=require(_0xd7c4('0xb'));var ejs=require(_0xd7c4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7c4('0xd'));var squel=require(_0xd7c4('0xe'));var crypto=require(_0xd7c4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd7c4('0x10'));var toCsv=require(_0xd7c4('0xb'));var querystring=require('querystring');var Papa=require(_0xd7c4('0x11'));var Redis=require(_0xd7c4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd7c4('0x13'));var as=require(_0xd7c4('0x14'));var hardwareService=require(_0xd7c4('0x15'));var logger=require(_0xd7c4('0x16'))(_0xd7c4('0x17'));var utils=require(_0xd7c4('0x18'));var config=require(_0xd7c4('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2779ab,_0x1a73b4){_0x1a73b4=_0x1a73b4||0xcc;return function(_0x50d620){if(_0x50d620){return _0x2779ab[_0xd7c4('0x1a')](_0x1a73b4);}return _0x2779ab['status'](_0x1a73b4)['end']();};}function respondWithResult(_0x465c23,_0x3f5462){_0x3f5462=_0x3f5462||0xc8;return function(_0x59a57c){if(_0x59a57c){return _0x465c23['status'](_0x3f5462)[_0xd7c4('0x1b')](_0x59a57c);}};}function respondWithFilteredResult(_0x2a5f78,_0x4600de){return function(_0x494229){if(_0x494229){var _0x26cf77=typeof _0x4600de[_0xd7c4('0x1c')]===_0xd7c4('0x1d')&&typeof _0x4600de['limit']===_0xd7c4('0x1d');var _0x4752f6=_0x494229[_0xd7c4('0x1e')];var _0x3cbd60=_0x26cf77?0x0:_0x4600de[_0xd7c4('0x1c')];var _0x2bf824=_0x26cf77?_0x494229[_0xd7c4('0x1e')]:_0x4600de[_0xd7c4('0x1c')]+_0x4600de[_0xd7c4('0x1f')];var _0x5cfd89;if(_0x2bf824>=_0x4752f6){_0x2bf824=_0x4752f6;_0x5cfd89=0xc8;}else{_0x5cfd89=0xce;}_0x2a5f78['status'](_0x5cfd89);return _0x2a5f78[_0xd7c4('0x20')](_0xd7c4('0x21'),_0x3cbd60+'-'+_0x2bf824+'/'+_0x4752f6)[_0xd7c4('0x1b')](_0x494229);}return null;};}function patchUpdates(_0x5f0f0d){return function(_0x5dbd71){try{jsonpatch[_0xd7c4('0x22')](_0x5dbd71,_0x5f0f0d,!![]);}catch(_0x50ea2c){return BPromise[_0xd7c4('0x23')](_0x50ea2c);}return _0x5dbd71[_0xd7c4('0x24')]();};}function saveUpdates(_0x43442f,_0x19347e){return function(_0x208ce8){if(_0x208ce8){return _0x208ce8[_0xd7c4('0x25')](_0x43442f)[_0xd7c4('0x26')](function(_0x4069bc){return _0x4069bc;});}return null;};}function removeEntity(_0xbf2856,_0x2c1623){return function(_0x21c1ac){if(_0x21c1ac){return _0x21c1ac[_0xd7c4('0x27')]()[_0xd7c4('0x26')](function(){_0xbf2856['status'](0xcc)[_0xd7c4('0x28')]();});}};}function handleEntityNotFound(_0x39c5a9,_0x15de82){return function(_0x5ecdb5){if(!_0x5ecdb5){_0x39c5a9[_0xd7c4('0x1a')](0x194);}return _0x5ecdb5;};}function handleError(_0x43b206,_0x2c7cc7){_0x2c7cc7=_0x2c7cc7||0x1f4;return function(_0x5ee033){logger[_0xd7c4('0x29')](_0x5ee033[_0xd7c4('0x2a')]);if(_0x5ee033[_0xd7c4('0x2b')]){delete _0x5ee033['name'];}_0x43b206[_0xd7c4('0x2c')](_0x2c7cc7)['send'](_0x5ee033);};}exports[_0xd7c4('0x2d')]=function(_0x1bda47,_0x18cbb2){var _0xdea06={},_0x57ad52={},_0xffdf88={'count':0x0,'rows':[]};var _0xedfd08=_['map'](db[_0xd7c4('0x2e')][_0xd7c4('0x2f')],function(_0x2806ae){return{'name':_0x2806ae[_0xd7c4('0x30')],'type':_0x2806ae[_0xd7c4('0x31')][_0xd7c4('0x32')]};});_0x57ad52[_0xd7c4('0x33')]=_['map'](_0xedfd08,_0xd7c4('0x2b'));_0x57ad52[_0xd7c4('0x34')]=_[_0xd7c4('0x35')](_0x1bda47['query']);_0x57ad52[_0xd7c4('0x36')]=_[_0xd7c4('0x37')](_0x57ad52[_0xd7c4('0x33')],_0x57ad52[_0xd7c4('0x34')]);_0xdea06['attributes']=_[_0xd7c4('0x37')](_0x57ad52[_0xd7c4('0x33')],qs['fields'](_0x1bda47[_0xd7c4('0x34')][_0xd7c4('0x38')]));_0xdea06[_0xd7c4('0x39')]=_0xdea06[_0xd7c4('0x39')]['length']?_0xdea06[_0xd7c4('0x39')]:_0x57ad52['model'];if(!_0x1bda47[_0xd7c4('0x34')]['hasOwnProperty']('nolimit')){_0xdea06[_0xd7c4('0x1f')]=qs[_0xd7c4('0x1f')](_0x1bda47[_0xd7c4('0x34')][_0xd7c4('0x1f')]);_0xdea06[_0xd7c4('0x1c')]=qs[_0xd7c4('0x1c')](_0x1bda47[_0xd7c4('0x34')][_0xd7c4('0x1c')]);}_0xdea06[_0xd7c4('0x3a')]=qs[_0xd7c4('0x3b')](_0x1bda47['query']['sort']);_0xdea06[_0xd7c4('0x3c')]=qs[_0xd7c4('0x36')](_[_0xd7c4('0x3d')](_0x1bda47[_0xd7c4('0x34')],_0x57ad52[_0xd7c4('0x36')]),_0xedfd08);if(_0x1bda47[_0xd7c4('0x34')][_0xd7c4('0x3e')]){_0xdea06[_0xd7c4('0x3c')]=_[_0xd7c4('0x3f')](_0xdea06[_0xd7c4('0x3c')],{'$or':_[_0xd7c4('0x40')](_0xedfd08,function(_0xdd30f6){if(_0xdd30f6[_0xd7c4('0x31')]!=='VIRTUAL'){var _0x42c720={};_0x42c720[_0xdd30f6[_0xd7c4('0x2b')]]={'$like':'%'+_0x1bda47[_0xd7c4('0x34')][_0xd7c4('0x3e')]+'%'};return _0x42c720;}})});}_0xdea06=_[_0xd7c4('0x3f')]({},_0xdea06,_0x1bda47['options']);var _0x51d8c3={'where':_0xdea06[_0xd7c4('0x3c')]};return db[_0xd7c4('0x2e')][_0xd7c4('0x1e')](_0x51d8c3)[_0xd7c4('0x26')](function(_0xbb86d3){_0xffdf88['count']=_0xbb86d3;if(_0x1bda47['query'][_0xd7c4('0x41')]){_0xdea06[_0xd7c4('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xd7c4('0x43')](_0xdea06);})['then'](function(_0x1abcf3){_0xffdf88[_0xd7c4('0x44')]=_0x1abcf3;return _0xffdf88;})[_0xd7c4('0x26')](respondWithFilteredResult(_0x18cbb2,_0xdea06))[_0xd7c4('0x45')](handleError(_0x18cbb2,null));};exports[_0xd7c4('0x46')]=function(_0x554b3c,_0x5d14f0){var _0x4a7ffe={'raw':!![],'where':{'id':_0x554b3c[_0xd7c4('0x47')]['id']}},_0x22b449={};_0x22b449['model']=_[_0xd7c4('0x35')](db[_0xd7c4('0x2e')][_0xd7c4('0x2f')]);_0x22b449[_0xd7c4('0x34')]=_[_0xd7c4('0x35')](_0x554b3c[_0xd7c4('0x34')]);_0x22b449[_0xd7c4('0x36')]=_[_0xd7c4('0x37')](_0x22b449['model'],_0x22b449[_0xd7c4('0x34')]);_0x4a7ffe[_0xd7c4('0x39')]=_[_0xd7c4('0x37')](_0x22b449[_0xd7c4('0x33')],qs[_0xd7c4('0x38')](_0x554b3c[_0xd7c4('0x34')]['fields']));_0x4a7ffe['attributes']=_0x4a7ffe[_0xd7c4('0x39')][_0xd7c4('0x48')]?_0x4a7ffe[_0xd7c4('0x39')]:_0x22b449[_0xd7c4('0x33')];if(_0x554b3c[_0xd7c4('0x34')][_0xd7c4('0x41')]){_0x4a7ffe[_0xd7c4('0x42')]=[{'all':!![]}];}_0x4a7ffe=_[_0xd7c4('0x3f')]({},_0x4a7ffe,_0x554b3c['options']);return db['VoiceQueuesLog'][_0xd7c4('0x49')](_0x4a7ffe)[_0xd7c4('0x26')](handleEntityNotFound(_0x5d14f0,null))[_0xd7c4('0x26')](respondWithResult(_0x5d14f0,null))[_0xd7c4('0x45')](handleError(_0x5d14f0,null));};exports[_0xd7c4('0x4a')]=function(_0x26971a,_0x1778f5){return db[_0xd7c4('0x2e')][_0xd7c4('0x4a')](_0x26971a[_0xd7c4('0x4b')],{})[_0xd7c4('0x26')](respondWithResult(_0x1778f5,0xc9))[_0xd7c4('0x45')](handleError(_0x1778f5,null));};exports[_0xd7c4('0x25')]=function(_0x1b6de5,_0x568723){if(_0x1b6de5[_0xd7c4('0x4b')]['id']){delete _0x1b6de5['body']['id'];}return db[_0xd7c4('0x2e')][_0xd7c4('0x49')]({'where':{'id':_0x1b6de5['params']['id']}})[_0xd7c4('0x26')](handleEntityNotFound(_0x568723,null))[_0xd7c4('0x26')](saveUpdates(_0x1b6de5[_0xd7c4('0x4b')],null))[_0xd7c4('0x26')](respondWithResult(_0x568723,null))['catch'](handleError(_0x568723,null));};exports[_0xd7c4('0x27')]=function(_0x326819,_0x355d39){return db[_0xd7c4('0x2e')][_0xd7c4('0x49')]({'where':{'id':_0x326819[_0xd7c4('0x47')]['id']}})[_0xd7c4('0x26')](handleEntityNotFound(_0x355d39,null))[_0xd7c4('0x26')](removeEntity(_0x355d39,null))['catch'](handleError(_0x355d39,null));}; \ No newline at end of file +var _0x1245=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','length','options','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1245,0x89));var _0x5124=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1245[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x5124('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5124('0x1'));var jsonpatch=require(_0x5124('0x2'));var rp=require(_0x5124('0x3'));var moment=require(_0x5124('0x4'));var BPromise=require(_0x5124('0x5'));var Mustache=require(_0x5124('0x6'));var util=require(_0x5124('0x7'));var path=require(_0x5124('0x8'));var sox=require(_0x5124('0x9'));var csv=require(_0x5124('0xa'));var ejs=require(_0x5124('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5124('0xc'));var jsforce=require(_0x5124('0xd'));var deskjs=require(_0x5124('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5124('0xf'));var Papa=require('papaparse');var Redis=require(_0x5124('0x10'));var authService=require(_0x5124('0x11'));var qs=require(_0x5124('0x12'));var as=require(_0x5124('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5124('0x14'))(_0x5124('0x15'));var utils=require(_0x5124('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5124('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45fcbf,_0x3d4393){_0x3d4393=_0x3d4393||0xcc;return function(_0x4bdace){if(_0x4bdace){return _0x45fcbf['sendStatus'](_0x3d4393);}return _0x45fcbf[_0x5124('0x18')](_0x3d4393)[_0x5124('0x19')]();};}function respondWithResult(_0x4ce4ee,_0xdf91e5){_0xdf91e5=_0xdf91e5||0xc8;return function(_0x42ef76){if(_0x42ef76){return _0x4ce4ee['status'](_0xdf91e5)[_0x5124('0x1a')](_0x42ef76);}};}function respondWithFilteredResult(_0x49665a,_0x4da581){return function(_0x52196a){if(_0x52196a){var _0x1a6536=typeof _0x4da581[_0x5124('0x1b')]===_0x5124('0x1c')&&typeof _0x4da581[_0x5124('0x1d')]==='undefined';var _0x3c6b3c=_0x52196a[_0x5124('0x1e')];var _0x37f24c=_0x1a6536?0x0:_0x4da581['offset'];var _0x40c990=_0x1a6536?_0x52196a[_0x5124('0x1e')]:_0x4da581[_0x5124('0x1b')]+_0x4da581['limit'];var _0x16207f;if(_0x40c990>=_0x3c6b3c){_0x40c990=_0x3c6b3c;_0x16207f=0xc8;}else{_0x16207f=0xce;}_0x49665a[_0x5124('0x18')](_0x16207f);return _0x49665a['set']('Content-Range',_0x37f24c+'-'+_0x40c990+'/'+_0x3c6b3c)[_0x5124('0x1a')](_0x52196a);}return null;};}function patchUpdates(_0x5c9547){return function(_0x2b2844){try{jsonpatch[_0x5124('0x1f')](_0x2b2844,_0x5c9547,!![]);}catch(_0x1cbca1){return BPromise[_0x5124('0x20')](_0x1cbca1);}return _0x2b2844[_0x5124('0x21')]();};}function saveUpdates(_0x3e199e,_0x2f9417){return function(_0x30203e){if(_0x30203e){return _0x30203e[_0x5124('0x22')](_0x3e199e)[_0x5124('0x23')](function(_0xab57eb){return _0xab57eb;});}return null;};}function removeEntity(_0x34ce62,_0x2c8da7){return function(_0x402a54){if(_0x402a54){return _0x402a54[_0x5124('0x24')]()['then'](function(){_0x34ce62[_0x5124('0x18')](0xcc)[_0x5124('0x19')]();});}};}function handleEntityNotFound(_0x1158ae,_0x187154){return function(_0x16d72d){if(!_0x16d72d){_0x1158ae['sendStatus'](0x194);}return _0x16d72d;};}function handleError(_0x3ebf9f,_0x22853e){_0x22853e=_0x22853e||0x1f4;return function(_0x54b721){logger['error'](_0x54b721[_0x5124('0x25')]);if(_0x54b721[_0x5124('0x26')]){delete _0x54b721[_0x5124('0x26')];}_0x3ebf9f['status'](_0x22853e)[_0x5124('0x27')](_0x54b721);};}exports[_0x5124('0x28')]=function(_0xcb424e,_0x551023){var _0x6a418b={},_0x29a6ef={},_0x2d0982={'count':0x0,'rows':[]};var _0x437628=_[_0x5124('0x29')](db[_0x5124('0x2a')][_0x5124('0x2b')],function(_0x33d8f7){return{'name':_0x33d8f7[_0x5124('0x2c')],'type':_0x33d8f7[_0x5124('0x2d')]['key']};});_0x29a6ef[_0x5124('0x2e')]=_[_0x5124('0x29')](_0x437628,_0x5124('0x26'));_0x29a6ef[_0x5124('0x2f')]=_[_0x5124('0x30')](_0xcb424e[_0x5124('0x2f')]);_0x29a6ef[_0x5124('0x31')]=_[_0x5124('0x32')](_0x29a6ef[_0x5124('0x2e')],_0x29a6ef[_0x5124('0x2f')]);_0x6a418b[_0x5124('0x33')]=_[_0x5124('0x32')](_0x29a6ef[_0x5124('0x2e')],qs[_0x5124('0x34')](_0xcb424e[_0x5124('0x2f')][_0x5124('0x34')]));_0x6a418b[_0x5124('0x33')]=_0x6a418b['attributes']['length']?_0x6a418b['attributes']:_0x29a6ef[_0x5124('0x2e')];if(!_0xcb424e[_0x5124('0x2f')]['hasOwnProperty']('nolimit')){_0x6a418b[_0x5124('0x1d')]=qs[_0x5124('0x1d')](_0xcb424e['query']['limit']);_0x6a418b['offset']=qs[_0x5124('0x1b')](_0xcb424e[_0x5124('0x2f')][_0x5124('0x1b')]);}_0x6a418b[_0x5124('0x35')]=qs['sort'](_0xcb424e[_0x5124('0x2f')][_0x5124('0x36')]);_0x6a418b['where']=qs[_0x5124('0x31')](_[_0x5124('0x37')](_0xcb424e[_0x5124('0x2f')],_0x29a6ef[_0x5124('0x31')]),_0x437628);if(_0xcb424e[_0x5124('0x2f')][_0x5124('0x38')]){_0x6a418b[_0x5124('0x39')]=_[_0x5124('0x3a')](_0x6a418b[_0x5124('0x39')],{'$or':_[_0x5124('0x29')](_0x437628,function(_0x34b91c){if(_0x34b91c['type']!==_0x5124('0x3b')){var _0x130379={};_0x130379[_0x34b91c[_0x5124('0x26')]]={'$like':'%'+_0xcb424e[_0x5124('0x2f')][_0x5124('0x38')]+'%'};return _0x130379;}})});}_0x6a418b=_['merge']({},_0x6a418b,_0xcb424e['options']);var _0x218bd7={'where':_0x6a418b[_0x5124('0x39')]};return db[_0x5124('0x2a')][_0x5124('0x1e')](_0x218bd7)[_0x5124('0x23')](function(_0x23125d){_0x2d0982[_0x5124('0x1e')]=_0x23125d;if(_0xcb424e[_0x5124('0x2f')][_0x5124('0x3c')]){_0x6a418b[_0x5124('0x3d')]=[{'all':!![]}];}return db[_0x5124('0x2a')][_0x5124('0x3e')](_0x6a418b);})[_0x5124('0x23')](function(_0x427d57){_0x2d0982[_0x5124('0x3f')]=_0x427d57;return _0x2d0982;})['then'](respondWithFilteredResult(_0x551023,_0x6a418b))['catch'](handleError(_0x551023,null));};exports[_0x5124('0x40')]=function(_0x574365,_0x4cdf02){var _0x24d5c8={'raw':!![],'where':{'id':_0x574365['params']['id']}},_0x55cf78={};_0x55cf78[_0x5124('0x2e')]=_[_0x5124('0x30')](db['VoiceQueuesLog'][_0x5124('0x2b')]);_0x55cf78['query']=_[_0x5124('0x30')](_0x574365[_0x5124('0x2f')]);_0x55cf78[_0x5124('0x31')]=_[_0x5124('0x32')](_0x55cf78[_0x5124('0x2e')],_0x55cf78['query']);_0x24d5c8[_0x5124('0x33')]=_[_0x5124('0x32')](_0x55cf78['model'],qs[_0x5124('0x34')](_0x574365[_0x5124('0x2f')][_0x5124('0x34')]));_0x24d5c8[_0x5124('0x33')]=_0x24d5c8[_0x5124('0x33')][_0x5124('0x41')]?_0x24d5c8[_0x5124('0x33')]:_0x55cf78['model'];if(_0x574365[_0x5124('0x2f')][_0x5124('0x3c')]){_0x24d5c8['include']=[{'all':!![]}];}_0x24d5c8=_[_0x5124('0x3a')]({},_0x24d5c8,_0x574365[_0x5124('0x42')]);return db['VoiceQueuesLog'][_0x5124('0x43')](_0x24d5c8)[_0x5124('0x23')](handleEntityNotFound(_0x4cdf02,null))[_0x5124('0x23')](respondWithResult(_0x4cdf02,null))[_0x5124('0x44')](handleError(_0x4cdf02,null));};exports[_0x5124('0x45')]=function(_0x548ef5,_0x40efbd){return db[_0x5124('0x2a')]['create'](_0x548ef5['body'],{})['then'](respondWithResult(_0x40efbd,0xc9))['catch'](handleError(_0x40efbd,null));};exports['update']=function(_0x54c3a9,_0x43eb8c){if(_0x54c3a9[_0x5124('0x46')]['id']){delete _0x54c3a9[_0x5124('0x46')]['id'];}return db[_0x5124('0x2a')]['find']({'where':{'id':_0x54c3a9['params']['id']}})[_0x5124('0x23')](handleEntityNotFound(_0x43eb8c,null))['then'](saveUpdates(_0x54c3a9[_0x5124('0x46')],null))[_0x5124('0x23')](respondWithResult(_0x43eb8c,null))['catch'](handleError(_0x43eb8c,null));};exports['destroy']=function(_0x4b063c,_0x4f73e7){return db[_0x5124('0x2a')][_0x5124('0x43')]({'where':{'id':_0x4b063c[_0x5124('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f73e7,null))[_0x5124('0x23')](removeEntity(_0x4f73e7,null))['catch'](handleError(_0x4f73e7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a83e9e3..3a17b85 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05d9=['event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log'];(function(_0x4b4eb6,_0x360128){var _0x2e8747=function(_0x3e9eea){while(--_0x3e9eea){_0x4b4eb6['push'](_0x4b4eb6['shift']());}};_0x2e8747(++_0x360128);}(_0x05d9,0x1b3));var _0x905d=function(_0x4fcd09,_0x4a1772){_0x4fcd09=_0x4fcd09-0x0;var _0x2c24b9=_0x05d9[_0x4fcd09];return _0x2c24b9;};'use strict';var _=require(_0x905d('0x0'));var util=require(_0x905d('0x1'));var logger=require(_0x905d('0x2'))(_0x905d('0x3'));var moment=require(_0x905d('0x4'));var BPromise=require(_0x905d('0x5'));var rp=require(_0x905d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x905d('0x7'));var config=require('../../config/environment');var attributes=require(_0x905d('0x8'));module[_0x905d('0x9')]=function(_0x5ac361,_0x37159e){return _0x5ac361[_0x905d('0xa')](_0x905d('0xb'),attributes,{'tableName':_0x905d('0xc'),'paranoid':![],'indexes':[{'name':_0x905d('0xd'),'fields':[_0x905d('0xe'),_0x905d('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xab2a=['dtm','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x43b9af,_0x2c8316){var _0x1df62e=function(_0x2b2e79){while(--_0x2b2e79){_0x43b9af['push'](_0x43b9af['shift']());}};_0x1df62e(++_0x2c8316);}(_0xab2a,0x1a1));var _0xaab2=function(_0x10804c,_0x4fa715){_0x10804c=_0x10804c-0x0;var _0x5b462e=_0xab2a[_0x10804c];return _0x5b462e;};'use strict';var _=require(_0xaab2('0x0'));var util=require(_0xaab2('0x1'));var logger=require(_0xaab2('0x2'))('api');var moment=require(_0xaab2('0x3'));var BPromise=require('bluebird');var rp=require(_0xaab2('0x4'));var fs=require('fs');var path=require(_0xaab2('0x5'));var rimraf=require(_0xaab2('0x6'));var config=require('../../config/environment');var attributes=require(_0xaab2('0x7'));module['exports']=function(_0x5c14f2,_0x53ce4f){return _0x5c14f2['define'](_0xaab2('0x8'),attributes,{'tableName':_0xaab2('0x9'),'paranoid':![],'indexes':[{'name':_0xaab2('0xa'),'fields':[_0xaab2('0xb'),_0xaab2('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 9d4afa9..566e529 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc36a=['request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x558c5e,_0x549052){var _0x492f84=function(_0x1a90b0){while(--_0x1a90b0){_0x558c5e['push'](_0x558c5e['shift']());}};_0x492f84(++_0x549052);}(_0xc36a,0x180));var _0xac36=function(_0x2b8356,_0x42a7a1){_0x2b8356=_0x2b8356-0x0;var _0x4ea7ad=_0xc36a[_0x2b8356];return _0x4ea7ad;};'use strict';var _=require(_0xac36('0x0'));var util=require(_0xac36('0x1'));var moment=require('moment');var BPromise=require(_0xac36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac36('0x3'));var db=require(_0xac36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac36('0x5'));var config=require('../../config/environment');var jayson=require(_0xac36('0x6'));var client=jayson[_0xac36('0x7')][_0xac36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa2f50e,_0x4a72ab,_0x5b8700){return new BPromise(function(_0xe6d230,_0x5e406c){return client['request'](_0xa2f50e,_0x5b8700)[_0xac36('0x9')](function(_0x53c15f){logger[_0xac36('0xa')](_0xac36('0xb'),_0x4a72ab,_0xac36('0xc'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4a72ab,_0xac36('0xc'),JSON[_0xac36('0xd')](_0x53c15f));if(_0x53c15f[_0xac36('0xe')]){if(_0x53c15f[_0xac36('0xe')]['code']===0x1f4){logger[_0xac36('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a72ab,_0x53c15f[_0xac36('0xe')][_0xac36('0xf')]);return _0x5e406c(_0x53c15f[_0xac36('0xe')][_0xac36('0xf')]);}logger[_0xac36('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a72ab,_0x53c15f[_0xac36('0xe')][_0xac36('0xf')]);return _0xe6d230(_0x53c15f[_0xac36('0xe')]['message']);}else{logger['info'](_0xac36('0xb'),_0x4a72ab,'request\x20sent');_0xe6d230(_0x53c15f[_0xac36('0x10')][_0xac36('0xf')]);}})[_0xac36('0x11')](function(_0x19366b){logger[_0xac36('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a72ab,_0x19366b);_0x5e406c(_0x19366b);});});} \ No newline at end of file +var _0x0879=['code','VoiceQueuesLog,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2069b7,_0x212de2){var _0x3a3526=function(_0x4b52d1){while(--_0x4b52d1){_0x2069b7['push'](_0x2069b7['shift']());}};_0x3a3526(++_0x212de2);}(_0x0879,0x1e9));var _0x9087=function(_0x33bc05,_0x243cdc){_0x33bc05=_0x33bc05-0x0;var _0x830049=_0x0879[_0x33bc05];return _0x830049;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var moment=require('moment');var BPromise=require(_0x9087('0x2'));var rs=require(_0x9087('0x3'));var fs=require('fs');var Redis=require(_0x9087('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9087('0x5'));var logger=require(_0x9087('0x6'))(_0x9087('0x7'));var config=require(_0x9087('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9087('0x9')][_0x9087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1296ec,_0x1f2a9a,_0x277d2e){return new BPromise(function(_0x174a24,_0x3608c6){return client['request'](_0x1296ec,_0x277d2e)[_0x9087('0xb')](function(_0x5428ce){logger[_0x9087('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1f2a9a,'request\x20sent');logger[_0x9087('0xd')](_0x9087('0xe'),_0x1f2a9a,'request\x20sent',JSON[_0x9087('0xf')](_0x5428ce));if(_0x5428ce[_0x9087('0x10')]){if(_0x5428ce[_0x9087('0x10')][_0x9087('0x11')]===0x1f4){logger['error'](_0x9087('0x12'),_0x1f2a9a,_0x5428ce[_0x9087('0x10')][_0x9087('0x13')]);return _0x3608c6(_0x5428ce['error'][_0x9087('0x13')]);}logger[_0x9087('0x10')](_0x9087('0x12'),_0x1f2a9a,_0x5428ce['error'][_0x9087('0x13')]);return _0x174a24(_0x5428ce[_0x9087('0x10')][_0x9087('0x13')]);}else{logger[_0x9087('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1f2a9a,_0x9087('0x14'));_0x174a24(_0x5428ce[_0x9087('0x15')][_0x9087('0x13')]);}})['catch'](function(_0x364d17){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1f2a9a,_0x364d17);_0x3608c6(_0x364d17);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 21f59fb..6402747 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd42=['/:id/transcribe','downloadTranscribe','create','post','runTranscribe','/:id','update','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id/download','download','/:id/downloads','downloads'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xdd42,0x1be));var _0x2dd4=function(_0x51f382,_0x477a5c){_0x51f382=_0x51f382-0x0;var _0x4ad235=_0xdd42[_0x51f382];return _0x4ad235;};'use strict';var multer=require('multer');var util=require(_0x2dd4('0x0'));var path=require(_0x2dd4('0x1'));var timeout=require('connect-timeout');var express=require(_0x2dd4('0x2'));var router=express[_0x2dd4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2dd4('0x4'));var config=require(_0x2dd4('0x5'));var controller=require('./voiceRecording.controller');router[_0x2dd4('0x6')]('/',auth['isAuthenticated'](),controller[_0x2dd4('0x7')]);router[_0x2dd4('0x6')]('/describe',auth[_0x2dd4('0x8')](),controller[_0x2dd4('0x9')]);router['get']('/:id',auth[_0x2dd4('0x8')](),controller['show']);router[_0x2dd4('0x6')](_0x2dd4('0xa'),auth[_0x2dd4('0x8')](),controller[_0x2dd4('0xb')]);router[_0x2dd4('0x6')](_0x2dd4('0xc'),controller[_0x2dd4('0xd')]);router[_0x2dd4('0x6')](_0x2dd4('0xe'),auth[_0x2dd4('0x8')](),controller[_0x2dd4('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2dd4('0x10')]);router[_0x2dd4('0x11')](_0x2dd4('0xe'),auth[_0x2dd4('0x8')](),controller[_0x2dd4('0x12')]);router['put'](_0x2dd4('0x13'),auth[_0x2dd4('0x8')](),controller[_0x2dd4('0x14')]);router['delete'](_0x2dd4('0x13'),auth[_0x2dd4('0x8')](),controller[_0x2dd4('0x15')]);module[_0x2dd4('0x16')]=router; \ No newline at end of file +var _0xd51f=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe','runTranscribe','put','update','destroy','exports'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0xd51f,0x104));var _0xfd51=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd51f[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require(_0xfd51('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd51('0x3'));var router=express[_0xfd51('0x4')]();var fs_extra=require(_0xfd51('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd51('0x6'));var config=require(_0xfd51('0x7'));var controller=require('./voiceRecording.controller');router[_0xfd51('0x8')]('/',auth[_0xfd51('0x9')](),controller['index']);router[_0xfd51('0x8')]('/describe',auth[_0xfd51('0x9')](),controller[_0xfd51('0xa')]);router[_0xfd51('0x8')](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller[_0xfd51('0xc')]);router[_0xfd51('0x8')](_0xfd51('0xd'),auth['isAuthenticated'](),controller[_0xfd51('0xe')]);router['get'](_0xfd51('0xf'),controller[_0xfd51('0x10')]);router[_0xfd51('0x8')]('/:id/transcribe',auth[_0xfd51('0x9')](),controller[_0xfd51('0x11')]);router['post']('/',auth[_0xfd51('0x9')](),controller[_0xfd51('0x12')]);router[_0xfd51('0x13')](_0xfd51('0x14'),auth[_0xfd51('0x9')](),controller[_0xfd51('0x15')]);router[_0xfd51('0x16')]('/:id',auth[_0xfd51('0x9')](),controller[_0xfd51('0x17')]);router['delete'](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller[_0xfd51('0x18')]);module[_0xfd51('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 756abe1..df2b287 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 559a195..a41bfb4 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cc8=['undefined','limit','count','set','Content-Range','apply','update','destroy','sendStatus','error','stack','name','send','index','type','key','differenceBy','map','format','query','keys','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','VoiceRecording','then','includeAll','include','findAll','rows','catch','length','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','Sequelize','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','token','push','$and','%s.cypher','ValidationError','VoiceRecording\x20not\x20found','extname','isNil','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','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9cc8,0x113));var _0x89cc=function(_0x21c5f3,_0xe5977){_0x21c5f3=_0x21c5f3-0x0;var _0x1b4e99=_0x9cc8[_0x21c5f3];return _0x1b4e99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89cc('0x0'));var zipdir=require(_0x89cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89cc('0x2'));var moment=require('moment');var BPromise=require(_0x89cc('0x3'));var Mustache=require('mustache');var util=require(_0x89cc('0x4'));var path=require('path');var sox=require(_0x89cc('0x5'));var csv=require(_0x89cc('0x6'));var ejs=require(_0x89cc('0x7'));var fs=require('fs');var fs_extra=require(_0x89cc('0x8'));var _=require(_0x89cc('0x9'));var squel=require(_0x89cc('0xa'));var crypto=require(_0x89cc('0xb'));var jsforce=require(_0x89cc('0xc'));var deskjs=require(_0x89cc('0xd'));var toCsv=require(_0x89cc('0x6'));var querystring=require(_0x89cc('0xe'));var Papa=require(_0x89cc('0xf'));var AWS=require(_0x89cc('0x10'));var uuidv4=require(_0x89cc('0x11'));var Redis=require(_0x89cc('0x12'));var authService=require(_0x89cc('0x13'));var qs=require(_0x89cc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89cc('0x15'));var logger=require(_0x89cc('0x16'))(_0x89cc('0x17'));var utils=require(_0x89cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x89cc('0x19'));var db=require(_0x89cc('0x1a'))['db'];function respondWithStatusCode(_0x2d22df,_0x36ad15){_0x36ad15=_0x36ad15||0xcc;return function(_0x3d3793){if(_0x3d3793){return _0x2d22df['sendStatus'](_0x36ad15);}return _0x2d22df[_0x89cc('0x1b')](_0x36ad15)[_0x89cc('0x1c')]();};}function respondWithResult(_0x436ef5,_0x152ecc){_0x152ecc=_0x152ecc||0xc8;return function(_0x9f5da4){if(_0x9f5da4){return _0x436ef5[_0x89cc('0x1b')](_0x152ecc)[_0x89cc('0x1d')](_0x9f5da4);}};}function respondWithFilteredResult(_0xf1ab38,_0x49af41){return function(_0x1cff2c){if(_0x1cff2c){var _0x466a62=typeof _0x49af41[_0x89cc('0x1e')]===_0x89cc('0x1f')&&typeof _0x49af41[_0x89cc('0x20')]===_0x89cc('0x1f');var _0x1009d8=_0x1cff2c[_0x89cc('0x21')];var _0x3be0a1=_0x466a62?0x0:_0x49af41[_0x89cc('0x1e')];var _0x4f37e1=_0x466a62?_0x1cff2c[_0x89cc('0x21')]:_0x49af41['offset']+_0x49af41[_0x89cc('0x20')];var _0x4193c8;if(_0x4f37e1>=_0x1009d8){_0x4f37e1=_0x1009d8;_0x4193c8=0xc8;}else{_0x4193c8=0xce;}_0xf1ab38['status'](_0x4193c8);return _0xf1ab38[_0x89cc('0x22')](_0x89cc('0x23'),_0x3be0a1+'-'+_0x4f37e1+'/'+_0x1009d8)['json'](_0x1cff2c);}return null;};}function patchUpdates(_0x5c994a){return function(_0x556cac){try{jsonpatch[_0x89cc('0x24')](_0x556cac,_0x5c994a,!![]);}catch(_0x2cc220){return BPromise['reject'](_0x2cc220);}return _0x556cac['save']();};}function saveUpdates(_0x428cd,_0x1856d1){return function(_0x36e108){if(_0x36e108){return _0x36e108[_0x89cc('0x25')](_0x428cd)['then'](function(_0x12a5e7){return _0x12a5e7;});}return null;};}function removeEntity(_0x12582d,_0x2babab){return function(_0x323343){if(_0x323343){return _0x323343[_0x89cc('0x26')]()['then'](function(){_0x12582d[_0x89cc('0x1b')](0xcc)[_0x89cc('0x1c')]();});}};}function handleEntityNotFound(_0x48197,_0x272041){return function(_0xb79472){if(!_0xb79472){_0x48197[_0x89cc('0x27')](0x194);}return _0xb79472;};}function handleError(_0x4e76fe,_0x16bb0d){_0x16bb0d=_0x16bb0d||0x1f4;return function(_0x4f138d){logger[_0x89cc('0x28')](_0x4f138d[_0x89cc('0x29')]);if(_0x4f138d[_0x89cc('0x2a')]){delete _0x4f138d[_0x89cc('0x2a')];}_0x4e76fe[_0x89cc('0x1b')](_0x16bb0d)[_0x89cc('0x2b')](_0x4f138d);};}exports[_0x89cc('0x2c')]=function(_0xbb8253,_0x2dcd42){var _0x5af1c4={},_0x5d2dfb={},_0x3a29c5={'count':0x0,'rows':[]};var _0x108276=_['map'](db['VoiceRecording']['rawAttributes'],function(_0x2fd42e){return{'name':_0x2fd42e['fieldName'],'type':_0x2fd42e[_0x89cc('0x2d')][_0x89cc('0x2e')]};});_0x5d2dfb['model']=_[_0x89cc('0x2f')](_[_0x89cc('0x30')](_0x108276,_0x89cc('0x2a')),[_0x89cc('0x31')]);_0x5d2dfb[_0x89cc('0x32')]=_[_0x89cc('0x33')](_0xbb8253['query']);_0x5d2dfb['filters']=_[_0x89cc('0x34')](_0x5d2dfb['model'],_0x5d2dfb[_0x89cc('0x32')]);_0x5af1c4['attributes']=_[_0x89cc('0x34')](_0x5d2dfb['model'],qs['fields'](_0xbb8253[_0x89cc('0x32')][_0x89cc('0x35')]));_0x5af1c4[_0x89cc('0x36')]=_0x5af1c4[_0x89cc('0x36')]['length']?_0x5af1c4[_0x89cc('0x36')]:_0x5d2dfb[_0x89cc('0x37')];if(!_0xbb8253[_0x89cc('0x32')][_0x89cc('0x38')](_0x89cc('0x39'))){_0x5af1c4[_0x89cc('0x20')]=qs[_0x89cc('0x20')](_0xbb8253[_0x89cc('0x32')][_0x89cc('0x20')]);_0x5af1c4[_0x89cc('0x1e')]=qs[_0x89cc('0x1e')](_0xbb8253['query']['offset']);}_0x5af1c4[_0x89cc('0x3a')]=qs[_0x89cc('0x3b')](_0xbb8253[_0x89cc('0x32')][_0x89cc('0x3b')]);_0x5af1c4[_0x89cc('0x3c')]=qs[_0x89cc('0x3d')](_[_0x89cc('0x3e')](_0xbb8253['query'],_0x5d2dfb[_0x89cc('0x3d')]),_0x108276);if(_0xbb8253[_0x89cc('0x32')][_0x89cc('0x3f')]){_0x5af1c4['where']=_[_0x89cc('0x40')](_0x5af1c4[_0x89cc('0x3c')],{'$or':_[_0x89cc('0x30')](_0x108276,function(_0x459bb1){if(_0x459bb1[_0x89cc('0x2d')]!==_0x89cc('0x41')){var _0x1cab1e={};_0x1cab1e[_0x459bb1[_0x89cc('0x2a')]]={'$like':'%'+_0xbb8253[_0x89cc('0x32')][_0x89cc('0x3f')]+'%'};return _0x1cab1e;}})});}_0x5af1c4=_[_0x89cc('0x40')]({},_0x5af1c4,_0xbb8253['options']);var _0x33c7e2={'where':_0x5af1c4[_0x89cc('0x3c')]};return db[_0x89cc('0x42')]['count'](_0x33c7e2)[_0x89cc('0x43')](function(_0x1ebdc6){_0x3a29c5[_0x89cc('0x21')]=_0x1ebdc6;if(_0xbb8253[_0x89cc('0x32')][_0x89cc('0x44')]){_0x5af1c4[_0x89cc('0x45')]=[{'all':!![]}];}return db['VoiceRecording'][_0x89cc('0x46')](_0x5af1c4);})[_0x89cc('0x43')](function(_0x56a4b2){_0x3a29c5[_0x89cc('0x47')]=_0x56a4b2;return _0x3a29c5;})['then'](respondWithFilteredResult(_0x2dcd42,_0x5af1c4))[_0x89cc('0x48')](handleError(_0x2dcd42,null));};exports['show']=function(_0x190e80,_0x36817b){var _0x256c57={'raw':![],'where':{'id':_0x190e80['params']['id']}},_0x3ff9d4={};_0x3ff9d4[_0x89cc('0x37')]=_[_0x89cc('0x33')](db[_0x89cc('0x42')]['rawAttributes']);_0x3ff9d4['query']=_['keys'](_0x190e80[_0x89cc('0x32')]);_0x3ff9d4[_0x89cc('0x3d')]=_['intersection'](_0x3ff9d4[_0x89cc('0x37')],_0x3ff9d4['query']);_0x256c57['attributes']=_[_0x89cc('0x34')](_0x3ff9d4[_0x89cc('0x37')],qs['fields'](_0x190e80[_0x89cc('0x32')][_0x89cc('0x35')]));_0x256c57['attributes']=_0x256c57[_0x89cc('0x36')][_0x89cc('0x49')]?_0x256c57[_0x89cc('0x36')]:_0x3ff9d4[_0x89cc('0x37')];if(_0x190e80[_0x89cc('0x32')][_0x89cc('0x44')]){_0x256c57[_0x89cc('0x45')]=[{'all':!![]}];}_0x256c57=_[_0x89cc('0x40')]({},_0x256c57,_0x190e80['options']);return db[_0x89cc('0x42')][_0x89cc('0x4a')](_0x256c57)[_0x89cc('0x43')](handleEntityNotFound(_0x36817b,null))[_0x89cc('0x43')](respondWithResult(_0x36817b,null))[_0x89cc('0x48')](handleError(_0x36817b,null));};exports[_0x89cc('0x4b')]=function(_0x1f4842,_0x702261){return db[_0x89cc('0x42')][_0x89cc('0x4b')](_0x1f4842['body'],{})[_0x89cc('0x43')](respondWithResult(_0x702261,0xc9))['catch'](handleError(_0x702261,null));};exports['update']=function(_0x37f132,_0x12aceb){if(_0x37f132[_0x89cc('0x4c')]['id']){delete _0x37f132[_0x89cc('0x4c')]['id'];}return db['VoiceRecording'][_0x89cc('0x4a')]({'where':{'id':_0x37f132[_0x89cc('0x4d')]['id']}})[_0x89cc('0x43')](handleEntityNotFound(_0x12aceb,null))[_0x89cc('0x43')](saveUpdates(_0x37f132['body'],null))['then'](respondWithResult(_0x12aceb,null))[_0x89cc('0x48')](handleError(_0x12aceb,null));};exports[_0x89cc('0x4e')]=function(_0x588794,_0x55a804){return db[_0x89cc('0x42')][_0x89cc('0x4e')]()[_0x89cc('0x43')](respondWithResult(_0x55a804,null))[_0x89cc('0x48')](handleError(_0x55a804,null));};exports[_0x89cc('0x4f')]=function(_0x337348,_0x101957,_0x52dc1a){var _0x5c7819=require(_0x89cc('0x50'));var _0x517ef4=![];var _0x3bd12b={};if(_0x337348[_0x89cc('0x32')][_0x89cc('0x2d')]&&_0x337348[_0x89cc('0x32')]['type']===_0x89cc('0x51')){_0x3bd12b[_0x89cc('0x51')]=_0x337348[_0x89cc('0x4d')]['id'];}else{_0x3bd12b['id']=_0x337348['params']['id'];}return db[_0x89cc('0x42')][_0x89cc('0x4a')]({'where':_0x3bd12b,'attributes':['id',_0x89cc('0x52')],'raw':!![]})[_0x89cc('0x43')](handleEntityNotFound(_0x101957,null))['then'](function(_0x3dfc16){if(_0x3dfc16){var _0x56e675=_0x3dfc16[_0x89cc('0x52')];var _0x188f97=util[_0x89cc('0x31')]('%s.cypher',_0x56e675);if(fs['existsSync'](_0x188f97)){_0x517ef4=!![];return _0x5c7819[_0x89cc('0x53')](_0x188f97,_0x56e675,config[_0x89cc('0x54')][_0x89cc('0x55')])[_0x89cc('0x43')](function(){return _0x3dfc16;});}return _0x3dfc16;}})[_0x89cc('0x43')](function(_0x38ce95){if(_0x38ce95){var _0xdaa7bc=_0x38ce95['value'];if(!fs[_0x89cc('0x56')](_0xdaa7bc)){throw new db[(_0x89cc('0x57'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x38ce95[_0x89cc('0x58')]){return _0x101957[_0x89cc('0x4f')](_0xdaa7bc,_0x38ce95[_0x89cc('0x58')]+path['extname'](_0xdaa7bc),function(){if(_0x517ef4){fs[_0x89cc('0x59')](_0xdaa7bc);}});}else{return _0x101957[_0x89cc('0x4f')](_0xdaa7bc,function(_0x1b4162){if(_0x517ef4){fs[_0x89cc('0x59')](_0xdaa7bc);}});}}})[_0x89cc('0x48')](function(_0x1697c5){if(_0x1697c5[_0x89cc('0x5a')]==='VoiceRecording\x20not\x20found'){_0x101957[_0x89cc('0x1b')](0x194)[_0x89cc('0x2b')](_0x89cc('0x5b'));}else{return handleError(_0x101957,null);}});};exports[_0x89cc('0x5c')]=function(_0x27fa57,_0x3550f0,_0x34af1b){var _0x12a7dd=require(_0x89cc('0x50'));var _0x1bc376=![];var _0x432b76={'$and':[db[_0x89cc('0x5d')][_0x89cc('0x3c')](db[_0x89cc('0x5d')]['fn'](_0x89cc('0x5e'),db[_0x89cc('0x5d')]['col'](_0x89cc('0x51'))),_0x27fa57[_0x89cc('0x32')][_0x89cc('0x5f')])]};if(_0x27fa57[_0x89cc('0x32')][_0x89cc('0x2d')]&&_0x27fa57[_0x89cc('0x32')]['type']===_0x89cc('0x51')){_0x432b76['$and'][_0x89cc('0x60')]({'uniqueid':_0x27fa57[_0x89cc('0x4d')]['id']});}else{_0x432b76[_0x89cc('0x61')]['push']({'id':_0x27fa57[_0x89cc('0x4d')]['id']});}return db['VoiceRecording'][_0x89cc('0x4a')]({'where':_0x432b76,'attributes':['id','value'],'raw':!![]})[_0x89cc('0x43')](handleEntityNotFound(_0x3550f0,null))[_0x89cc('0x43')](function(_0x1c6ee9){if(_0x1c6ee9){var _0x41f7b2=util[_0x89cc('0x31')](_0x89cc('0x62'),_0x1c6ee9[_0x89cc('0x52')]);if(fs['existsSync'](_0x41f7b2)){_0x1bc376=!![];return _0x12a7dd[_0x89cc('0x53')](_0x41f7b2,_0x1c6ee9[_0x89cc('0x52')],config[_0x89cc('0x54')][_0x89cc('0x55')])[_0x89cc('0x43')](function(){return _0x1c6ee9;});}return _0x1c6ee9;}})['then'](function(_0x594c17){if(_0x594c17){if(!fs['existsSync'](_0x594c17['value'])){throw new db[(_0x89cc('0x57'))][(_0x89cc('0x63'))](_0x89cc('0x64'));}if(_0x594c17[_0x89cc('0x58')]){return _0x3550f0[_0x89cc('0x4f')](_0x594c17['value'],_0x594c17[_0x89cc('0x58')]+path[_0x89cc('0x65')](_0x594c17[_0x89cc('0x52')]),function(){if(_0x1bc376){fs[_0x89cc('0x59')](_0x594c17[_0x89cc('0x52')]);}});}else{return _0x3550f0[_0x89cc('0x4f')](_0x594c17['value'],function(_0x10a58e){if(_0x1bc376){fs[_0x89cc('0x59')](_0x594c17[_0x89cc('0x52')]);}});}}})['catch'](handleError(_0x3550f0,null));};exports[_0x89cc('0x26')]=function(_0x17e858,_0x5e11f8){return db[_0x89cc('0x42')][_0x89cc('0x4a')]({'where':{'id':_0x17e858['params']['id']}})['then'](function(_0x314228){if(_[_0x89cc('0x66')](_0x314228)){throw new ReferenceError('Entity\x20not\x20found');}return _0x314228;})[_0x89cc('0x43')](function(_0x374278){var _0x4c1061=_0x374278['value'];logger[_0x89cc('0x67')](_0x89cc('0x68'),_0x4c1061);if(!_['isNil'](_0x374278[_0x89cc('0x52')])&&fs['existsSync'](_0x4c1061)){logger['info'](_0x89cc('0x69')+_0x4c1061+_0x89cc('0x6a'));fs[_0x89cc('0x6b')](_0x4c1061);}_0x4c1061=_0x4c1061+_0x89cc('0x6c');if(!_[_0x89cc('0x66')](_0x374278[_0x89cc('0x52')])&&fs[_0x89cc('0x56')](_0x4c1061)){logger[_0x89cc('0x67')]('File:\x20\x22'+_0x4c1061+_0x89cc('0x6a'));fs[_0x89cc('0x6b')](_0x4c1061);}return _0x374278;})['then'](function(_0x3c665b){if(!_0x3c665b)throw new InternalError();return _0x3c665b['destroy']();})[_0x89cc('0x43')](function(){_0x5e11f8[_0x89cc('0x1b')](0xcc)[_0x89cc('0x1c')]();})[_0x89cc('0x48')](handleError(_0x5e11f8,null));};function getBucketslist(_0x34db73,_0x546d0c,_0x99789e){return new Promise(function(_0xdd03b3,_0x1c7794){var _0x1a1800=new AWS['S3']({'accessKeyId':_0x546d0c,'secretAccessKey':_0x34db73,'region':_0x99789e});_0x1a1800[_0x89cc('0x6d')]({},function(_0x18b190,_0x30686f){if(_0x18b190){return _0x1c7794(_0x18b190);}else{return _0xdd03b3(_0x30686f);}});});}function createBucket(_0x14d1e5,_0x1eef9d,_0x380a8a,_0x14e44f){return new Promise(function(_0xbd5d01,_0xc857e3){var _0x150dfe=new AWS['S3']({'accessKeyId':_0x1eef9d,'secretAccessKey':_0x14d1e5,'region':_0x380a8a});_0x150dfe[_0x89cc('0x6e')]({'Bucket':_0x14e44f},function(_0x29c6dd,_0x258f7c){if(_0x29c6dd){return _0xc857e3(_0x29c6dd);}else{return _0xbd5d01(_0x258f7c);}});});}function uploadFile(_0x411f1e,_0x316646,_0x278d26,_0x100b37,_0x54d631,_0x179a5f){return new Promise(function(_0x431642,_0xb28de3){var _0x35aa1b=new AWS['S3']({'accessKeyId':_0x316646,'secretAccessKey':_0x411f1e,'region':_0x278d26});_0x35aa1b[_0x89cc('0x6f')]({'Bucket':_0x100b37,'Key':_0x54d631,'Body':_0x179a5f},function(_0x3edba0,_0x5773b1){if(_0x3edba0){return _0xb28de3(_0x3edba0);}else{return _0x431642(_0x5773b1);}});});}function startTranscribe(_0x3f364c,_0x424ceb,_0x875252,_0x266367,_0x213389,_0x160a32){return new Promise(function(_0x50e6e4,_0x28c683){var _0x430a1d=new AWS['TranscribeService']({'accessKeyId':_0x424ceb,'secretAccessKey':_0x3f364c,'region':_0x875252});_0x430a1d[_0x89cc('0x70')]({'TranscriptionJobName':_0x266367,'LanguageCode':_0x213389,'Media':{'MediaFileUri':_0x160a32}},function(_0x340424,_0x229182){if(_0x340424){return _0x28c683(_0x340424);}else{return _0x50e6e4(_0x229182);}});});}function transcribe(_0x225aad,_0x1d3525,_0x4de0a0,_0x493362,_0x21ca1a,_0x5b488f,_0x53b75e){return new Promise(function(_0x46ac7f,_0x4f3854){var _0x3c3c8c={};logger[_0x89cc('0x67')](util[_0x89cc('0x31')](_0x89cc('0x71'),_0x225aad,_0x21ca1a));return uploadFile(_0x1d3525,_0x4de0a0,_0x493362,_0x21ca1a,path[_0x89cc('0x72')](_0x5b488f),fs[_0x89cc('0x73')](_0x5b488f))[_0x89cc('0x43')](function(_0x4f1dc3){logger['info'](util['format'](_0x89cc('0x74'),_0x225aad,_0x21ca1a,_0x4f1dc3['Location']));_0x3c3c8c[_0x89cc('0x75')]=_0x4f1dc3[_0x89cc('0x76')];_0x3c3c8c['location']=_0x4f1dc3[_0x89cc('0x77')];logger[_0x89cc('0x67')](util[_0x89cc('0x31')](_0x89cc('0x78'),_0x225aad));return startTranscribe(_0x1d3525,_0x4de0a0,_0x493362,uuidv4(),_0x53b75e,_0x4f1dc3[_0x89cc('0x77')]);})[_0x89cc('0x43')](function(_0x5cfc43){logger[_0x89cc('0x67')](util[_0x89cc('0x31')](_0x89cc('0x79'),_0x225aad,_0x5cfc43['TranscriptionJob'][_0x89cc('0x7a')]));_0x3c3c8c['transcribeName']=_0x5cfc43['TranscriptionJob'][_0x89cc('0x7a')];_0x3c3c8c[_0x89cc('0x7b')]=_0x5cfc43['TranscriptionJob'][_0x89cc('0x7c')];return _0x46ac7f(_0x3c3c8c);})[_0x89cc('0x48')](function(_0x45f018){return _0x4f3854(_0x45f018);});});}exports['runTranscribe']=function(_0xc0a960,_0x3301f1,_0x4d1abf){var _0x6e96e4;var _0x22b5d1;var _0x57b157;var _0x3923c9=require(_0x89cc('0x50'));return db[_0x89cc('0x42')][_0x89cc('0x7d')]({'where':{'id':_0xc0a960[_0x89cc('0x4d')]['id']}})[_0x89cc('0x43')](function(_0x288594){if(_0x288594){var _0x4bcb7b=util[_0x89cc('0x31')](_0x89cc('0x62'),_0x288594['value']);if(fs[_0x89cc('0x56')](_0x4bcb7b)){cypher=!![];return _0x3923c9['decryptFile'](_0x4bcb7b,_0x288594[_0x89cc('0x52')],config[_0x89cc('0x54')]['recording'])['then'](function(){return _0x288594;});}return _0x288594;}})[_0x89cc('0x43')](function(_0x44358e){if(!_0x44358e){throw new db['Sequelize'][(_0x89cc('0x63'))](_0x89cc('0x7e'));}_0x22b5d1=_0x44358e;return db[_0x89cc('0x7f')][_0x89cc('0x7d')]({'where':{'id':0x1}});})[_0x89cc('0x43')](handleEntityNotFound(_0x3301f1,null))[_0x89cc('0x43')](function(_0x2b0e3d){if(_0x2b0e3d){_0x6e96e4=_0x2b0e3d;if(!_0x6e96e4[_0x89cc('0x80')]||!_0x6e96e4[_0x89cc('0x81')]||!_0x6e96e4[_0x89cc('0x82')]||!_0x6e96e4['language']||!_0x6e96e4['bucket']){throw new db[(_0x89cc('0x57'))][(_0x89cc('0x63'))](_0x89cc('0x83'));}if(_0xc0a960[_0x89cc('0x4c')][_0x89cc('0x84')]&&(!_0x6e96e4[_0x89cc('0x85')]||!_0x6e96e4[_0x89cc('0x86')]||!_0x6e96e4[_0x89cc('0x87')]||!_0x6e96e4[_0x89cc('0x88')]||!_0x6e96e4[_0x89cc('0x75')])){throw new db[(_0x89cc('0x57'))][(_0x89cc('0x63'))](_0x89cc('0x89'));}return db['CloudProvider'][_0x89cc('0x7d')]({'where':{'id':_0x6e96e4[_0x89cc('0x81')]}});}})[_0x89cc('0x43')](function(_0x4412c5){if(!_0x4412c5){throw new db['Sequelize'][(_0x89cc('0x63'))](_0x89cc('0x8a'));}if(!_0x4412c5['data1']||!_0x4412c5[_0x89cc('0x8b')]){throw new db[(_0x89cc('0x57'))][(_0x89cc('0x63'))](_0x89cc('0x8c'));}_0x57b157=_0x4412c5;return getBucketslist(_0x57b157[_0x89cc('0x8d')],_0x57b157[_0x89cc('0x8b')],_0x6e96e4[_0x89cc('0x82')]);})[_0x89cc('0x43')](function(_0x2d54d4){if(_0x2d54d4&&_0x2d54d4[_0x89cc('0x8e')]){var _0x3dc0cc=_['find'](_0x2d54d4[_0x89cc('0x8e')],function(_0x5f0c59){return _0x5f0c59[_0x89cc('0x8f')]===_0x6e96e4['bucket'];});if(!_0x3dc0cc){logger[_0x89cc('0x67')](util[_0x89cc('0x31')](_0x89cc('0x90'),_0xc0a960[_0x89cc('0x4d')]['id'],_0x6e96e4[_0x89cc('0x75')]));return createBucket(_0x57b157[_0x89cc('0x8d')],_0x57b157[_0x89cc('0x8b')],_0x6e96e4[_0x89cc('0x82')],_0x6e96e4[_0x89cc('0x75')]);}logger['info'](util['format'](_0x89cc('0x91'),_0xc0a960[_0x89cc('0x4d')]['id'],_0x6e96e4['bucket']));return;}})[_0x89cc('0x43')](function(_0x12e678){if(_0x22b5d1[_0x89cc('0x7b')]===_0x89cc('0x92')){return transcribe(_0xc0a960[_0x89cc('0x4d')]['id'],_0x57b157[_0x89cc('0x8d')],_0x57b157[_0x89cc('0x8b')],_0x6e96e4[_0x89cc('0x82')],_0x6e96e4[_0x89cc('0x75')],_0x22b5d1[_0x89cc('0x52')],_0x6e96e4['language']);}else{logger[_0x89cc('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xc0a960[_0x89cc('0x4d')]['id']));return{'transcribeStatus':_0x89cc('0x93')};}})[_0x89cc('0x43')](function(_0x179768){if(_0x179768){_0x179768[_0x89cc('0x94')]=_0xc0a960['body']['runSentiment'];return _0x22b5d1['updateAttributes'](_0x179768);}})[_0x89cc('0x43')](respondWithResult(_0x3301f1,null))['catch'](handleError(_0x3301f1,null));};function writeFile(_0x5447bd,_0x1244ab){return new Promise(function(_0x33cf05,_0x3946ae){fs[_0x89cc('0x95')](_0x1244ab,_0x5447bd,function(_0x3d5d4b,_0x57b6ed){if(_0x3d5d4b){return _0x3946ae(_0x3d5d4b);}else{return _0x33cf05(_0x57b6ed);}});});}exports[_0x89cc('0x96')]=function(_0x2716d3,_0x30506f,_0x2b0b07){return db[_0x89cc('0x42')]['findOne']({'where':{'id':_0x2716d3['params']['id']}})[_0x89cc('0x43')](handleEntityNotFound(_0x30506f))['then'](function(_0x2e6be9){if(_0x2e6be9&&_0x2e6be9[_0x89cc('0x97')]){var _0x5f0727=_0x2e6be9[_0x89cc('0x97')];var _0x26936c=config['root']+'/server/files/transcribes/transcribe_'+_0x2e6be9['id']+'.txt';if(fs['existsSync'](_0x26936c)){return _0x26936c;}return writeFile(_0x5f0727,_0x26936c)[_0x89cc('0x43')](function(){return _0x26936c;});}else{throw new db[(_0x89cc('0x57'))][(_0x89cc('0x63'))](_0x89cc('0x98'));}})[_0x89cc('0x43')](function(_0x11fde0){return _0x30506f[_0x89cc('0x4f')](_0x11fde0);})[_0x89cc('0x48')](handleError(_0x30506f));}; \ No newline at end of file +var _0x0152=['describe','../../components/encryptor','uniqueid','value','format','existsSync','secrets','recording','Sequelize','filename','unlink','download','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','ValidationError','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','name','index','map','VoiceRecording','rawAttributes','model','differenceBy','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','body'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0152,0xdc));var _0x2015=function(_0x5a52ec,_0x297b65){_0x5a52ec=_0x5a52ec-0x0;var _0x55ffb7=_0x0152[_0x5a52ec];return _0x55ffb7;};'use strict';var emlformat=require(_0x2015('0x0'));var rimraf=require(_0x2015('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2015('0x2'));var BPromise=require(_0x2015('0x3'));var Mustache=require(_0x2015('0x4'));var util=require('util');var path=require(_0x2015('0x5'));var sox=require(_0x2015('0x6'));var csv=require(_0x2015('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2015('0x8'));var _=require('lodash');var squel=require(_0x2015('0x9'));var crypto=require(_0x2015('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2015('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x2015('0xb'));var authService=require(_0x2015('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2015('0xd'));var logger=require(_0x2015('0xe'))(_0x2015('0xf'));var utils=require(_0x2015('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x2015('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279102,_0x26fac9){_0x26fac9=_0x26fac9||0xcc;return function(_0x584c62){if(_0x584c62){return _0x279102['sendStatus'](_0x26fac9);}return _0x279102[_0x2015('0x12')](_0x26fac9)['end']();};}function respondWithResult(_0x182731,_0x41953e){_0x41953e=_0x41953e||0xc8;return function(_0x3606da){if(_0x3606da){return _0x182731[_0x2015('0x12')](_0x41953e)[_0x2015('0x13')](_0x3606da);}};}function respondWithFilteredResult(_0x1013ed,_0x4c7d61){return function(_0x2f0b2f){if(_0x2f0b2f){var _0x267441=typeof _0x4c7d61[_0x2015('0x14')]===_0x2015('0x15')&&typeof _0x4c7d61[_0x2015('0x16')]===_0x2015('0x15');var _0x359664=_0x2f0b2f[_0x2015('0x17')];var _0x12db3d=_0x267441?0x0:_0x4c7d61[_0x2015('0x14')];var _0x100a3c=_0x267441?_0x2f0b2f[_0x2015('0x17')]:_0x4c7d61[_0x2015('0x14')]+_0x4c7d61[_0x2015('0x16')];var _0x83f4e;if(_0x100a3c>=_0x359664){_0x100a3c=_0x359664;_0x83f4e=0xc8;}else{_0x83f4e=0xce;}_0x1013ed[_0x2015('0x12')](_0x83f4e);return _0x1013ed['set'](_0x2015('0x18'),_0x12db3d+'-'+_0x100a3c+'/'+_0x359664)[_0x2015('0x13')](_0x2f0b2f);}return null;};}function patchUpdates(_0x23a267){return function(_0x42ad87){try{jsonpatch[_0x2015('0x19')](_0x42ad87,_0x23a267,!![]);}catch(_0x3cd1e5){return BPromise[_0x2015('0x1a')](_0x3cd1e5);}return _0x42ad87[_0x2015('0x1b')]();};}function saveUpdates(_0x469e7f,_0x37a4ab){return function(_0x309af1){if(_0x309af1){return _0x309af1[_0x2015('0x1c')](_0x469e7f)[_0x2015('0x1d')](function(_0x45cefa){return _0x45cefa;});}return null;};}function removeEntity(_0x14dfe3,_0x46beb6){return function(_0xd57d32){if(_0xd57d32){return _0xd57d32['destroy']()[_0x2015('0x1d')](function(){_0x14dfe3[_0x2015('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca1b7,_0x2b0ed0){return function(_0x122aee){if(!_0x122aee){_0x2ca1b7[_0x2015('0x1e')](0x194);}return _0x122aee;};}function handleError(_0x4fd607,_0x112395){_0x112395=_0x112395||0x1f4;return function(_0x68d37f){logger['error'](_0x68d37f['stack']);if(_0x68d37f[_0x2015('0x1f')]){delete _0x68d37f[_0x2015('0x1f')];}_0x4fd607['status'](_0x112395)['send'](_0x68d37f);};}exports[_0x2015('0x20')]=function(_0x3ff2f5,_0x57e798){var _0x4fe717={},_0x4f8da8={},_0x295bcb={'count':0x0,'rows':[]};var _0x2f0d2a=_[_0x2015('0x21')](db[_0x2015('0x22')][_0x2015('0x23')],function(_0x14f6ac){return{'name':_0x14f6ac['fieldName'],'type':_0x14f6ac['type']['key']};});_0x4f8da8[_0x2015('0x24')]=_[_0x2015('0x25')](_[_0x2015('0x21')](_0x2f0d2a,_0x2015('0x1f')),['format']);_0x4f8da8[_0x2015('0x26')]=_[_0x2015('0x27')](_0x3ff2f5['query']);_0x4f8da8[_0x2015('0x28')]=_['intersection'](_0x4f8da8[_0x2015('0x24')],_0x4f8da8[_0x2015('0x26')]);_0x4fe717['attributes']=_['intersection'](_0x4f8da8[_0x2015('0x24')],qs['fields'](_0x3ff2f5[_0x2015('0x26')][_0x2015('0x29')]));_0x4fe717[_0x2015('0x2a')]=_0x4fe717['attributes'][_0x2015('0x2b')]?_0x4fe717['attributes']:_0x4f8da8[_0x2015('0x24')];if(!_0x3ff2f5[_0x2015('0x26')][_0x2015('0x2c')](_0x2015('0x2d'))){_0x4fe717['limit']=qs[_0x2015('0x16')](_0x3ff2f5['query'][_0x2015('0x16')]);_0x4fe717[_0x2015('0x14')]=qs[_0x2015('0x14')](_0x3ff2f5[_0x2015('0x26')][_0x2015('0x14')]);}_0x4fe717['order']=qs[_0x2015('0x2e')](_0x3ff2f5[_0x2015('0x26')][_0x2015('0x2e')]);_0x4fe717[_0x2015('0x2f')]=qs[_0x2015('0x28')](_[_0x2015('0x30')](_0x3ff2f5[_0x2015('0x26')],_0x4f8da8['filters']),_0x2f0d2a);if(_0x3ff2f5['query'][_0x2015('0x31')]){_0x4fe717['where']=_[_0x2015('0x32')](_0x4fe717[_0x2015('0x2f')],{'$or':_[_0x2015('0x21')](_0x2f0d2a,function(_0x36fd0d){if(_0x36fd0d[_0x2015('0x33')]!=='VIRTUAL'){var _0x11b143={};_0x11b143[_0x36fd0d[_0x2015('0x1f')]]={'$like':'%'+_0x3ff2f5['query']['filter']+'%'};return _0x11b143;}})});}_0x4fe717=_[_0x2015('0x32')]({},_0x4fe717,_0x3ff2f5['options']);var _0x3cbd21={'where':_0x4fe717[_0x2015('0x2f')]};return db[_0x2015('0x22')][_0x2015('0x17')](_0x3cbd21)[_0x2015('0x1d')](function(_0x1d071c){_0x295bcb[_0x2015('0x17')]=_0x1d071c;if(_0x3ff2f5['query'][_0x2015('0x34')]){_0x4fe717['include']=[{'all':!![]}];}return db[_0x2015('0x22')][_0x2015('0x35')](_0x4fe717);})[_0x2015('0x1d')](function(_0x316b9a){_0x295bcb[_0x2015('0x36')]=_0x316b9a;return _0x295bcb;})['then'](respondWithFilteredResult(_0x57e798,_0x4fe717))[_0x2015('0x37')](handleError(_0x57e798,null));};exports[_0x2015('0x38')]=function(_0xb3aed1,_0x37372f){var _0x435721={'raw':![],'where':{'id':_0xb3aed1[_0x2015('0x39')]['id']}},_0x400500={};_0x400500[_0x2015('0x24')]=_['keys'](db[_0x2015('0x22')]['rawAttributes']);_0x400500['query']=_['keys'](_0xb3aed1[_0x2015('0x26')]);_0x400500[_0x2015('0x28')]=_[_0x2015('0x3a')](_0x400500[_0x2015('0x24')],_0x400500['query']);_0x435721['attributes']=_[_0x2015('0x3a')](_0x400500[_0x2015('0x24')],qs['fields'](_0xb3aed1[_0x2015('0x26')][_0x2015('0x29')]));_0x435721['attributes']=_0x435721[_0x2015('0x2a')]['length']?_0x435721[_0x2015('0x2a')]:_0x400500['model'];if(_0xb3aed1['query'][_0x2015('0x34')]){_0x435721[_0x2015('0x3b')]=[{'all':!![]}];}_0x435721=_['merge']({},_0x435721,_0xb3aed1[_0x2015('0x3c')]);return db['VoiceRecording'][_0x2015('0x3d')](_0x435721)[_0x2015('0x1d')](handleEntityNotFound(_0x37372f,null))[_0x2015('0x1d')](respondWithResult(_0x37372f,null))[_0x2015('0x37')](handleError(_0x37372f,null));};exports[_0x2015('0x3e')]=function(_0x420f4a,_0x2e1799){return db[_0x2015('0x22')]['create'](_0x420f4a[_0x2015('0x3f')],{})[_0x2015('0x1d')](respondWithResult(_0x2e1799,0xc9))[_0x2015('0x37')](handleError(_0x2e1799,null));};exports[_0x2015('0x1c')]=function(_0xf32079,_0x22c2b1){if(_0xf32079['body']['id']){delete _0xf32079[_0x2015('0x3f')]['id'];}return db[_0x2015('0x22')][_0x2015('0x3d')]({'where':{'id':_0xf32079['params']['id']}})['then'](handleEntityNotFound(_0x22c2b1,null))['then'](saveUpdates(_0xf32079[_0x2015('0x3f')],null))[_0x2015('0x1d')](respondWithResult(_0x22c2b1,null))[_0x2015('0x37')](handleError(_0x22c2b1,null));};exports[_0x2015('0x40')]=function(_0x26267d,_0x37d98e){return db[_0x2015('0x22')][_0x2015('0x40')]()[_0x2015('0x1d')](respondWithResult(_0x37d98e,null))[_0x2015('0x37')](handleError(_0x37d98e,null));};exports['download']=function(_0x3f9d15,_0x513d38,_0x193c29){var _0x51da2=require(_0x2015('0x41'));var _0x4778ae=![];var _0x94f4d0={};if(_0x3f9d15['query'][_0x2015('0x33')]&&_0x3f9d15[_0x2015('0x26')][_0x2015('0x33')]===_0x2015('0x42')){_0x94f4d0[_0x2015('0x42')]=_0x3f9d15['params']['id'];}else{_0x94f4d0['id']=_0x3f9d15[_0x2015('0x39')]['id'];}return db['VoiceRecording'][_0x2015('0x3d')]({'where':_0x94f4d0,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x513d38,null))[_0x2015('0x1d')](function(_0x1d2781){if(_0x1d2781){var _0x530ce2=_0x1d2781[_0x2015('0x43')];var _0x2e7a7a=util[_0x2015('0x44')]('%s.cypher',_0x530ce2);if(fs[_0x2015('0x45')](_0x2e7a7a)){_0x4778ae=!![];return _0x51da2['decryptFile'](_0x2e7a7a,_0x530ce2,config[_0x2015('0x46')][_0x2015('0x47')])['then'](function(){return _0x1d2781;});}return _0x1d2781;}})[_0x2015('0x1d')](function(_0x33d965){if(_0x33d965){var _0x274a1a=_0x33d965[_0x2015('0x43')];if(!fs['existsSync'](_0x274a1a)){throw new db[(_0x2015('0x48'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x33d965[_0x2015('0x49')]){return _0x513d38['download'](_0x274a1a,_0x33d965['filename']+path['extname'](_0x274a1a),function(){if(_0x4778ae){fs[_0x2015('0x4a')](_0x274a1a);}});}else{return _0x513d38[_0x2015('0x4b')](_0x274a1a,function(_0x106574){if(_0x4778ae){fs[_0x2015('0x4a')](_0x274a1a);}});}}})[_0x2015('0x37')](function(_0x1f50ea){if(_0x1f50ea[_0x2015('0x4c')]===_0x2015('0x4d')){_0x513d38['status'](0x194)['send'](_0x2015('0x4e'));}else{return handleError(_0x513d38,null);}});};exports[_0x2015('0x4f')]=function(_0x28855d,_0x772b48,_0x513b6f){var _0x239130=require(_0x2015('0x41'));var _0x11788c=![];var _0x38cd44={'$and':[db[_0x2015('0x50')][_0x2015('0x2f')](db[_0x2015('0x50')]['fn'](_0x2015('0x51'),db[_0x2015('0x50')][_0x2015('0x52')](_0x2015('0x42'))),_0x28855d[_0x2015('0x26')][_0x2015('0x53')])]};if(_0x28855d[_0x2015('0x26')][_0x2015('0x33')]&&_0x28855d[_0x2015('0x26')]['type']===_0x2015('0x42')){_0x38cd44[_0x2015('0x54')]['push']({'uniqueid':_0x28855d[_0x2015('0x39')]['id']});}else{_0x38cd44[_0x2015('0x54')][_0x2015('0x55')]({'id':_0x28855d[_0x2015('0x39')]['id']});}return db[_0x2015('0x22')][_0x2015('0x3d')]({'where':_0x38cd44,'attributes':['id',_0x2015('0x43')],'raw':!![]})[_0x2015('0x1d')](handleEntityNotFound(_0x772b48,null))[_0x2015('0x1d')](function(_0x41c287){if(_0x41c287){var _0x3202a0=util['format']('%s.cypher',_0x41c287['value']);if(fs['existsSync'](_0x3202a0)){_0x11788c=!![];return _0x239130[_0x2015('0x56')](_0x3202a0,_0x41c287[_0x2015('0x43')],config[_0x2015('0x46')][_0x2015('0x47')])['then'](function(){return _0x41c287;});}return _0x41c287;}})[_0x2015('0x1d')](function(_0x162a1d){if(_0x162a1d){if(!fs[_0x2015('0x45')](_0x162a1d[_0x2015('0x43')])){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x162a1d['filename']){return _0x772b48[_0x2015('0x4b')](_0x162a1d[_0x2015('0x43')],_0x162a1d[_0x2015('0x49')]+path[_0x2015('0x58')](_0x162a1d[_0x2015('0x43')]),function(){if(_0x11788c){fs[_0x2015('0x4a')](_0x162a1d[_0x2015('0x43')]);}});}else{return _0x772b48[_0x2015('0x4b')](_0x162a1d[_0x2015('0x43')],function(_0x12e795){if(_0x11788c){fs[_0x2015('0x4a')](_0x162a1d['value']);}});}}})[_0x2015('0x37')](handleError(_0x772b48,null));};exports[_0x2015('0x59')]=function(_0xe7a6c8,_0xa3c8b6){return db[_0x2015('0x22')][_0x2015('0x3d')]({'where':{'id':_0xe7a6c8[_0x2015('0x39')]['id']}})['then'](function(_0x4f959c){if(_[_0x2015('0x5a')](_0x4f959c)){throw new ReferenceError(_0x2015('0x5b'));}return _0x4f959c;})[_0x2015('0x1d')](function(_0x40660c){var _0x49a099=_0x40660c[_0x2015('0x43')];logger[_0x2015('0x5c')](_0x2015('0x5d'),_0x49a099);if(!_[_0x2015('0x5a')](_0x40660c[_0x2015('0x43')])&&fs[_0x2015('0x45')](_0x49a099)){logger[_0x2015('0x5c')](_0x2015('0x5e')+_0x49a099+_0x2015('0x5f'));fs[_0x2015('0x60')](_0x49a099);}_0x49a099=_0x49a099+_0x2015('0x61');if(!_[_0x2015('0x5a')](_0x40660c[_0x2015('0x43')])&&fs['existsSync'](_0x49a099)){logger[_0x2015('0x5c')](_0x2015('0x5e')+_0x49a099+_0x2015('0x5f'));fs[_0x2015('0x60')](_0x49a099);}return _0x40660c;})[_0x2015('0x1d')](function(_0x598fb2){if(!_0x598fb2)throw new InternalError();return _0x598fb2[_0x2015('0x59')]();})['then'](function(){_0xa3c8b6[_0x2015('0x12')](0xcc)[_0x2015('0x62')]();})[_0x2015('0x37')](handleError(_0xa3c8b6,null));};function getBucketslist(_0x3beeb7,_0x4112d6,_0x56354f){return new Promise(function(_0x11c843,_0x1380db){var _0x2ac8c2=new AWS['S3']({'accessKeyId':_0x4112d6,'secretAccessKey':_0x3beeb7,'region':_0x56354f});_0x2ac8c2['listBuckets']({},function(_0x637d0f,_0x5d664f){if(_0x637d0f){return _0x1380db(_0x637d0f);}else{return _0x11c843(_0x5d664f);}});});}function createBucket(_0x1afcac,_0x5ee0d5,_0x332915,_0x230c27){return new Promise(function(_0x153ddc,_0x510b5a){var _0x49a401=new AWS['S3']({'accessKeyId':_0x5ee0d5,'secretAccessKey':_0x1afcac,'region':_0x332915});_0x49a401[_0x2015('0x63')]({'Bucket':_0x230c27},function(_0x59f722,_0x3f5096){if(_0x59f722){return _0x510b5a(_0x59f722);}else{return _0x153ddc(_0x3f5096);}});});}function uploadFile(_0x314abb,_0x48eea9,_0x10bda1,_0x25f252,_0x249397,_0x5e83f5){return new Promise(function(_0x51ce93,_0x13c02b){var _0x30f4b2=new AWS['S3']({'accessKeyId':_0x48eea9,'secretAccessKey':_0x314abb,'region':_0x10bda1});_0x30f4b2['upload']({'Bucket':_0x25f252,'Key':_0x249397,'Body':_0x5e83f5},function(_0x299858,_0x26adac){if(_0x299858){return _0x13c02b(_0x299858);}else{return _0x51ce93(_0x26adac);}});});}function startTranscribe(_0x353cd9,_0x5106cd,_0x125540,_0xe58a4e,_0x24c75b,_0x2a3f11){return new Promise(function(_0x24e54d,_0x526f5c){var _0x24c101=new AWS[(_0x2015('0x64'))]({'accessKeyId':_0x5106cd,'secretAccessKey':_0x353cd9,'region':_0x125540});_0x24c101[_0x2015('0x65')]({'TranscriptionJobName':_0xe58a4e,'LanguageCode':_0x24c75b,'Media':{'MediaFileUri':_0x2a3f11}},function(_0xc3ed9d,_0x2252d5){if(_0xc3ed9d){return _0x526f5c(_0xc3ed9d);}else{return _0x24e54d(_0x2252d5);}});});}function transcribe(_0x233153,_0x22d775,_0x568df4,_0x10ffb0,_0x3c70a6,_0x3d65f6,_0x5522bc){return new Promise(function(_0x4a42be,_0x3d4b71){var _0x14b53e={};logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x66'),_0x233153,_0x3c70a6));return uploadFile(_0x22d775,_0x568df4,_0x10ffb0,_0x3c70a6,path[_0x2015('0x67')](_0x3d65f6),fs['readFileSync'](_0x3d65f6))[_0x2015('0x1d')](function(_0x17a1ee){logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x68'),_0x233153,_0x3c70a6,_0x17a1ee['Location']));_0x14b53e['bucket']=_0x17a1ee[_0x2015('0x69')];_0x14b53e[_0x2015('0x6a')]=_0x17a1ee[_0x2015('0x6b')];logger['info'](util['format'](_0x2015('0x6c'),_0x233153));return startTranscribe(_0x22d775,_0x568df4,_0x10ffb0,uuidv4(),_0x5522bc,_0x17a1ee[_0x2015('0x6b')]);})['then'](function(_0x3dceaa){logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x6d'),_0x233153,_0x3dceaa['TranscriptionJob'][_0x2015('0x6e')]));_0x14b53e['transcribeName']=_0x3dceaa[_0x2015('0x6f')][_0x2015('0x6e')];_0x14b53e[_0x2015('0x70')]=_0x3dceaa[_0x2015('0x6f')][_0x2015('0x71')];return _0x4a42be(_0x14b53e);})[_0x2015('0x37')](function(_0x3bccbc){return _0x3d4b71(_0x3bccbc);});});}exports['runTranscribe']=function(_0x42bf78,_0x5221a3,_0x3bac59){var _0x120b0d;var _0xe0162a;var _0x50c2d5;var _0x5b6120=require(_0x2015('0x41'));return db['VoiceRecording'][_0x2015('0x72')]({'where':{'id':_0x42bf78['params']['id']}})[_0x2015('0x1d')](function(_0x425559){if(_0x425559){var _0x28a171=util[_0x2015('0x44')]('%s.cypher',_0x425559[_0x2015('0x43')]);if(fs['existsSync'](_0x28a171)){cypher=!![];return _0x5b6120[_0x2015('0x56')](_0x28a171,_0x425559[_0x2015('0x43')],config['secrets'][_0x2015('0x47')])[_0x2015('0x1d')](function(){return _0x425559;});}return _0x425559;}})[_0x2015('0x1d')](function(_0x289864){if(!_0x289864){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x73'));}_0xe0162a=_0x289864;return db[_0x2015('0x74')]['findOne']({'where':{'id':0x1}});})[_0x2015('0x1d')](handleEntityNotFound(_0x5221a3,null))[_0x2015('0x1d')](function(_0x5ea443){if(_0x5ea443){_0x120b0d=_0x5ea443;if(!_0x120b0d[_0x2015('0x75')]||!_0x120b0d[_0x2015('0x76')]||!_0x120b0d[_0x2015('0x77')]||!_0x120b0d[_0x2015('0x78')]||!_0x120b0d[_0x2015('0x79')]){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))]('Transcribe\x20not\x20configured');}if(_0x42bf78[_0x2015('0x3f')][_0x2015('0x7a')]&&(!_0x120b0d['sentiment']||!_0x120b0d['sentimentAccountId']||!_0x120b0d['sentimentRegion']||!_0x120b0d[_0x2015('0x78')]||!_0x120b0d[_0x2015('0x79')])){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x7b'));}return db[_0x2015('0x7c')][_0x2015('0x72')]({'where':{'id':_0x120b0d[_0x2015('0x76')]}});}})[_0x2015('0x1d')](function(_0x2494cf){if(!_0x2494cf){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x7d'));}if(!_0x2494cf['data1']||!_0x2494cf['data2']){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x7e'));}_0x50c2d5=_0x2494cf;return getBucketslist(_0x50c2d5[_0x2015('0x7f')],_0x50c2d5['data2'],_0x120b0d[_0x2015('0x77')]);})[_0x2015('0x1d')](function(_0x104235){if(_0x104235&&_0x104235[_0x2015('0x80')]){var _0x44c4a1=_[_0x2015('0x3d')](_0x104235[_0x2015('0x80')],function(_0x1f3750){return _0x1f3750[_0x2015('0x81')]===_0x120b0d[_0x2015('0x79')];});if(!_0x44c4a1){logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x82'),_0x42bf78[_0x2015('0x39')]['id'],_0x120b0d[_0x2015('0x79')]));return createBucket(_0x50c2d5['data1'],_0x50c2d5[_0x2015('0x83')],_0x120b0d[_0x2015('0x77')],_0x120b0d['bucket']);}logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x84'),_0x42bf78[_0x2015('0x39')]['id'],_0x120b0d[_0x2015('0x79')]));return;}})[_0x2015('0x1d')](function(_0x387545){if(_0xe0162a[_0x2015('0x70')]==='NEW'){return transcribe(_0x42bf78[_0x2015('0x39')]['id'],_0x50c2d5[_0x2015('0x7f')],_0x50c2d5['data2'],_0x120b0d[_0x2015('0x77')],_0x120b0d[_0x2015('0x79')],_0xe0162a[_0x2015('0x43')],_0x120b0d[_0x2015('0x78')]);}else{logger[_0x2015('0x5c')](util['format'](_0x2015('0x85'),_0x42bf78[_0x2015('0x39')]['id']));return{'transcribeStatus':_0x2015('0x86')};}})['then'](function(_0x173be4){if(_0x173be4){_0x173be4['tempSentiment']=_0x42bf78[_0x2015('0x3f')][_0x2015('0x7a')];return _0xe0162a[_0x2015('0x87')](_0x173be4);}})[_0x2015('0x1d')](respondWithResult(_0x5221a3,null))['catch'](handleError(_0x5221a3,null));};function writeFile(_0x4a621a,_0x4f6364){return new Promise(function(_0x4dbbd5,_0x46fedd){fs[_0x2015('0x88')](_0x4f6364,_0x4a621a,function(_0x296d83,_0x5d9f2e){if(_0x296d83){return _0x46fedd(_0x296d83);}else{return _0x4dbbd5(_0x5d9f2e);}});});}exports[_0x2015('0x89')]=function(_0x3e56ba,_0x5cd4ac,_0x3bc08e){return db[_0x2015('0x22')]['findOne']({'where':{'id':_0x3e56ba[_0x2015('0x39')]['id']}})[_0x2015('0x1d')](handleEntityNotFound(_0x5cd4ac))[_0x2015('0x1d')](function(_0xbc39d1){if(_0xbc39d1&&_0xbc39d1[_0x2015('0x8a')]){var _0x6170a6=_0xbc39d1[_0x2015('0x8a')];var _0x44e0c2=config[_0x2015('0x8b')]+_0x2015('0x8c')+_0xbc39d1['id']+'.txt';if(fs['existsSync'](_0x44e0c2)){return _0x44e0c2;}return writeFile(_0x6170a6,_0x44e0c2)[_0x2015('0x1d')](function(){return _0x44e0c2;});}else{throw new db['Sequelize']['ValidationError'](_0x2015('0x8d'));}})[_0x2015('0x1d')](function(_0x1f24b2){return _0x5cd4ac[_0x2015('0x4b')](_0x1f24b2);})[_0x2015('0x37')](handleError(_0x5cd4ac));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 58efd45..e5e1baf 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5089=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x3eece6,_0x32d59e){var _0x216115=function(_0x2c3ac1){while(--_0x2c3ac1){_0x3eece6['push'](_0x3eece6['shift']());}};_0x216115(++_0x32d59e);}(_0x5089,0x1bb));var _0x9508=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x5089[_0x3653c7];return _0x58a021;};'use strict';var attributes=require(_0x9508('0x0'));module[_0x9508('0x1')]=function(_0x5eec86,_0x2d60c7){return _0x5eec86[_0x9508('0x2')](_0x9508('0x3'),attributes,{'tableName':_0x9508('0x4'),'paranoid':![],'indexes':[{'name':_0x9508('0x5'),'fields':['uniqueid']},{'name':_0x9508('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc999=['uniqueid','transcribeStatus','exports'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0xc999,0x176));var _0x9c99=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xc999[_0x354164];return _0x5db9a8;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x9c99('0x0')]=function(_0x7c806,_0x22a35f){return _0x7c806['define']('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9c99('0x1')]},{'name':'transcribeStatus','fields':[_0x9c99('0x2')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index e365247..8ba0cdc 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e3f=['where','attributes','limit','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw'];(function(_0x925658,_0x35e35d){var _0x2b9837=function(_0x19b2f3){while(--_0x19b2f3){_0x925658['push'](_0x925658['shift']());}};_0x2b9837(++_0x35e35d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['update'](_0x11d4cc[_0xf8e3('0x18')],{'raw':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1b')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc['options'][_0xf8e3('0x1c')]||null:null,'limit':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1d')]||null:null})['then'](function(_0x39df34){logger['info'](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x1e')](_0x39df34));_0x2e27e3(_0x39df34);})[_0xf8e3('0x15')](function(_0x3ac384){logger['error'](_0xf8e3('0x16'),_0x3ac384[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3[_0xf8e3('0x12')](0x1f4,_0x3ac384[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x1f')]=function(_0x3b41a1){var _0x2963ed=this;return new Promise(function(_0x157a2d,_0x56fa8e){var _0x356e0a=require(_0xf8e3('0x20'));var _0x12ebd2;return db[_0xf8e3('0x21')][_0xf8e3('0x22')]({'attributes':['id',_0xf8e3('0x23')],'where':{'id':0x1},'raw':!![]})[_0xf8e3('0xc')](function(_0xfaf15d){_0x12ebd2=_0xfaf15d;return db['VoiceRecording'][_0xf8e3('0x24')](_0x3b41a1[_0xf8e3('0x18')]);})[_0xf8e3('0xc')](function(_0x28b2f2){if(_0x12ebd2['callRecordingEncryption']&&fs[_0xf8e3('0x25')](_0x28b2f2[_0xf8e3('0x26')])){var _0x40f64d=util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x28b2f2[_0xf8e3('0x26')]);return _0x356e0a[_0xf8e3('0x29')](_0x28b2f2[_0xf8e3('0x26')],_0x40f64d,config['secrets'][_0xf8e3('0x2a')])[_0xf8e3('0xc')](function(){fs['unlink'](_0x28b2f2['value']);logger['info'](_0xf8e3('0x2b'));return _0x28b2f2;});}return _0x28b2f2;})['then'](function(_0x2559ea){logger[_0xf8e3('0xd')](_0xf8e3('0x1f'),_0x3b41a1);logger[_0xf8e3('0x10')]('CreateVoiceRecording',_0x3b41a1,JSON['stringify'](_0x2559ea));_0x157a2d(_0x2559ea);})[_0xf8e3('0x15')](function(_0x2f87d8){logger[_0xf8e3('0x12')](_0xf8e3('0x1f'),_0x2f87d8[_0xf8e3('0x14')],_0x3b41a1);_0x56fa8e(_0x2963ed[_0xf8e3('0x12')](0x1f4,_0x2f87d8['message']));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','existsSync','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x2ef3,0xba));var _0x32ef=function(_0x40a8b2,_0x2141bf){_0x40a8b2=_0x40a8b2-0x0;var _0x20d716=_0x2ef3[_0x40a8b2];return _0x20d716;};'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')]('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceRecording,\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')]['update'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')]['where']||null:null,'attributes':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1a')]||null:null,'limit':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1b')]||null:null})[_0x32ef('0xb')](function(_0x5e8898){logger['info']('UpdateVoiceRecording',_0x1a9476);logger[_0x32ef('0x1c')](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x5e8898));_0x57863c(_0x5e8898);})['catch'](function(_0x59585f){logger[_0x32ef('0x11')]('UpdateVoiceRecording',_0x59585f['message'],_0x1a9476);_0xbe37f6(_0x286bfb[_0x32ef('0x11')](0x1f4,_0x59585f[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1d')]=function(_0x1dbe98){var _0x15ce54=this;return new Promise(function(_0x234175,_0x1874ea){var _0x38aed5=require(_0x32ef('0x1e'));var _0x2f52d7;return db[_0x32ef('0x1f')][_0x32ef('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x32ef('0xb')](function(_0x2f5d06){_0x2f52d7=_0x2f5d06;return db['VoiceRecording'][_0x32ef('0x21')](_0x1dbe98[_0x32ef('0x17')]);})[_0x32ef('0xb')](function(_0x26e207){if(_0x2f52d7['callRecordingEncryption']&&fs[_0x32ef('0x22')](_0x26e207[_0x32ef('0x23')])){var _0x31dbc3=util[_0x32ef('0x24')](_0x32ef('0x25'),_0x26e207[_0x32ef('0x23')]);return _0x38aed5[_0x32ef('0x26')](_0x26e207['value'],_0x31dbc3,config[_0x32ef('0x27')]['recording'])[_0x32ef('0xb')](function(){fs[_0x32ef('0x28')](_0x26e207['value']);logger[_0x32ef('0xc')](_0x32ef('0x29'));return _0x26e207;});}return _0x26e207;})[_0x32ef('0xb')](function(_0x20b467){logger[_0x32ef('0xc')]('CreateVoiceRecording',_0x1dbe98);logger['debug'](_0x32ef('0x1d'),_0x1dbe98,JSON['stringify'](_0x20b467));_0x234175(_0x20b467);})[_0x32ef('0x14')](function(_0x15b873){logger[_0x32ef('0x11')](_0x32ef('0x1d'),_0x15b873[_0x32ef('0x13')],_0x1dbe98);_0x1874ea(_0x15ce54[_0x32ef('0x11')](0x1f4,_0x15b873['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 51faa2c..fb72099 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0aef=['./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x56a4d8,_0x145c37){var _0x67ab6=function(_0x38c3ad){while(--_0x38c3ad){_0x56a4d8['push'](_0x56a4d8['shift']());}};_0x67ab6(++_0x145c37);}(_0x0aef,0x198));var _0xf0ae=function(_0xc13521,_0x5cbbd6){_0xc13521=_0xc13521-0x0;var _0x604113=_0x0aef[_0xc13521];return _0x604113;};'use strict';var multer=require(_0xf0ae('0x0'));var util=require(_0xf0ae('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf0ae('0x2'));var router=express['Router']();var fs_extra=require(_0xf0ae('0x3'));var auth=require(_0xf0ae('0x4'));var interaction=require(_0xf0ae('0x5'));var config=require('../../config/environment');var controller=require(_0xf0ae('0x6'));router[_0xf0ae('0x7')]('/',auth['isAuthenticated'](),controller[_0xf0ae('0x8')]);router['get'](_0xf0ae('0x9'),auth[_0xf0ae('0xa')](),controller[_0xf0ae('0xb')]);router[_0xf0ae('0x7')](_0xf0ae('0xc'),auth[_0xf0ae('0xa')](),controller['show']);router[_0xf0ae('0xd')]('/',auth[_0xf0ae('0xa')](),controller[_0xf0ae('0xe')]);router['put']('/:id',auth[_0xf0ae('0xa')](),controller['update']);router[_0xf0ae('0xf')](_0xf0ae('0xc'),auth['isAuthenticated'](),controller[_0xf0ae('0x10')]);module[_0xf0ae('0x11')]=router; \ No newline at end of file +var _0xb167=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb167,0x159));var _0x7b16=function(_0x26df12,_0x5b9df4){_0x26df12=_0x26df12-0x0;var _0x2ca213=_0xb167[_0x26df12];return _0x2ca213;};'use strict';var multer=require(_0x7b16('0x0'));var util=require(_0x7b16('0x1'));var path=require(_0x7b16('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b16('0x3'));var router=express[_0x7b16('0x4')]();var fs_extra=require(_0x7b16('0x5'));var auth=require(_0x7b16('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7b16('0x7'));var controller=require(_0x7b16('0x8'));router[_0x7b16('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b16('0xa')]);router[_0x7b16('0x9')](_0x7b16('0xb'),auth[_0x7b16('0xc')](),controller['describe']);router[_0x7b16('0x9')](_0x7b16('0xd'),auth[_0x7b16('0xc')](),controller[_0x7b16('0xe')]);router['post']('/',auth[_0x7b16('0xc')](),controller['create']);router[_0x7b16('0xf')](_0x7b16('0xd'),auth[_0x7b16('0xc')](),controller[_0x7b16('0x10')]);router[_0x7b16('0x11')](_0x7b16('0xd'),auth['isAuthenticated'](),controller[_0x7b16('0x12')]);module[_0x7b16('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c0c37f1..ebc475f 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa722=['ENUM','Yes','sequelize','moment','exports','blind','attended','STRING'];(function(_0x1ccdc9,_0x5cbab3){var _0x470dc8=function(_0x45e2ac){while(--_0x45e2ac){_0x1ccdc9['push'](_0x1ccdc9['shift']());}};_0x470dc8(++_0x5cbab3);}(_0xa722,0x1ca));var _0x2a72=function(_0x4b793b,_0x1ee112){_0x4b793b=_0x4b793b-0x0;var _0xcfbd6a=_0xa722[_0x4b793b];return _0xcfbd6a;};'use strict';var Sequelize=require(_0x2a72('0x0'));var moment=require(_0x2a72('0x1'));module[_0x2a72('0x2')]={'type':{'type':Sequelize['ENUM'](_0x2a72('0x3'),_0x2a72('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x2a72('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x2a72('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2a72('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x2a72('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x2a72('0x5')]},'transferercontext':{'type':Sequelize[_0x2a72('0x5')]},'transfererexten':{'type':Sequelize[_0x2a72('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x2a72('0x5')]},'transfereechannel':{'type':Sequelize[_0x2a72('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2a72('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2a72('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2a72('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2a72('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x2a72('0x5')]},'transfereeexten':{'type':Sequelize[_0x2a72('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2a72('0x5')]},'isexternal':{'type':Sequelize[_0x2a72('0x6')](_0x2a72('0x7'),'No')},'context':{'type':Sequelize[_0x2a72('0x5')]},'extension':{'type':Sequelize[_0x2a72('0x5')]}}; \ No newline at end of file +var _0x4960=['Yes','sequelize','ENUM','blind','STRING'];(function(_0x5b5c4c,_0x587fb6){var _0x1980c4=function(_0x30637b){while(--_0x30637b){_0x5b5c4c['push'](_0x5b5c4c['shift']());}};_0x1980c4(++_0x587fb6);}(_0x4960,0x137));var _0x0496=function(_0x4e5f0d,_0xac055e){_0x4e5f0d=_0x4e5f0d-0x0;var _0x52dcf6=_0x4960[_0x4e5f0d];return _0x52dcf6;};'use strict';var Sequelize=require(_0x0496('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x0496('0x1')](_0x0496('0x2'),'attended')},'result':{'type':Sequelize[_0x0496('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x0496('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0496('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x0496('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x0496('0x3')]},'transferercontext':{'type':Sequelize[_0x0496('0x3')]},'transfererexten':{'type':Sequelize[_0x0496('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x0496('0x3')]},'transfereechannel':{'type':Sequelize[_0x0496('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x0496('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0496('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x0496('0x3')]},'transfereecontext':{'type':Sequelize[_0x0496('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x0496('0x3')]},'isexternal':{'type':Sequelize[_0x0496('0x1')](_0x0496('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 484dc88..a1586aa 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8775=['includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x5ada87,_0x596cfd){var _0x424d8e=function(_0x5458aa){while(--_0x5458aa){_0x5ada87['push'](_0x5ada87['shift']());}};_0x424d8e(++_0x596cfd);}(_0x8775,0x1e3));var _0x5877=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x8775[_0x264b9b];return _0x4c7a0e;};'use strict';var emlformat=require(_0x5877('0x0'));var rimraf=require(_0x5877('0x1'));var zipdir=require(_0x5877('0x2'));var jsonpatch=require(_0x5877('0x3'));var rp=require('request-promise');var moment=require(_0x5877('0x4'));var BPromise=require(_0x5877('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5877('0x6'));var sox=require('sox');var csv=require(_0x5877('0x7'));var ejs=require(_0x5877('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5877('0x9'));var squel=require(_0x5877('0xa'));var crypto=require(_0x5877('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5877('0xc'));var toCsv=require(_0x5877('0x7'));var querystring=require(_0x5877('0xd'));var Papa=require(_0x5877('0xe'));var Redis=require(_0x5877('0xf'));var authService=require(_0x5877('0x10'));var qs=require(_0x5877('0x11'));var as=require(_0x5877('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5877('0x13'))(_0x5877('0x14'));var utils=require(_0x5877('0x15'));var config=require(_0x5877('0x16'));var licenseUtil=require(_0x5877('0x17'));var db=require(_0x5877('0x18'))['db'];function respondWithStatusCode(_0x45ae9e,_0x4a7ae4){_0x4a7ae4=_0x4a7ae4||0xcc;return function(_0x3bbec6){if(_0x3bbec6){return _0x45ae9e[_0x5877('0x19')](_0x4a7ae4);}return _0x45ae9e[_0x5877('0x1a')](_0x4a7ae4)['end']();};}function respondWithResult(_0x234e79,_0xd31a83){_0xd31a83=_0xd31a83||0xc8;return function(_0x4accb2){if(_0x4accb2){return _0x234e79[_0x5877('0x1a')](_0xd31a83)[_0x5877('0x1b')](_0x4accb2);}};}function respondWithFilteredResult(_0x4e3c78,_0x424708){return function(_0xfd7afa){if(_0xfd7afa){var _0x380aff=typeof _0x424708[_0x5877('0x1c')]==='undefined'&&typeof _0x424708[_0x5877('0x1d')]===_0x5877('0x1e');var _0x307194=_0xfd7afa[_0x5877('0x1f')];var _0x53090f=_0x380aff?0x0:_0x424708[_0x5877('0x1c')];var _0x827556=_0x380aff?_0xfd7afa[_0x5877('0x1f')]:_0x424708['offset']+_0x424708[_0x5877('0x1d')];var _0x1af879;if(_0x827556>=_0x307194){_0x827556=_0x307194;_0x1af879=0xc8;}else{_0x1af879=0xce;}_0x4e3c78['status'](_0x1af879);return _0x4e3c78['set'](_0x5877('0x20'),_0x53090f+'-'+_0x827556+'/'+_0x307194)['json'](_0xfd7afa);}return null;};}function patchUpdates(_0x1c4b4f){return function(_0x2fb77e){try{jsonpatch[_0x5877('0x21')](_0x2fb77e,_0x1c4b4f,!![]);}catch(_0x226d85){return BPromise[_0x5877('0x22')](_0x226d85);}return _0x2fb77e[_0x5877('0x23')]();};}function saveUpdates(_0x239b6c,_0x24ea70){return function(_0x28a2d5){if(_0x28a2d5){return _0x28a2d5[_0x5877('0x24')](_0x239b6c)[_0x5877('0x25')](function(_0x1ef04a){return _0x1ef04a;});}return null;};}function removeEntity(_0x3ec9b0,_0x3dded6){return function(_0x178c75){if(_0x178c75){return _0x178c75['destroy']()[_0x5877('0x25')](function(){_0x3ec9b0[_0x5877('0x1a')](0xcc)[_0x5877('0x26')]();});}};}function handleEntityNotFound(_0xb4cac3,_0x199039){return function(_0x1f03fc){if(!_0x1f03fc){_0xb4cac3['sendStatus'](0x194);}return _0x1f03fc;};}function handleError(_0x5020cc,_0x315c97){_0x315c97=_0x315c97||0x1f4;return function(_0x5d646a){logger[_0x5877('0x27')](_0x5d646a[_0x5877('0x28')]);if(_0x5d646a[_0x5877('0x29')]){delete _0x5d646a['name'];}_0x5020cc[_0x5877('0x1a')](_0x315c97)[_0x5877('0x2a')](_0x5d646a);};}exports[_0x5877('0x2b')]=function(_0x459185,_0x78928b){var _0x158f1a={},_0x4648ae={},_0x53668f={'count':0x0,'rows':[]};var _0x2569e1=_[_0x5877('0x2c')](db[_0x5877('0x2d')]['rawAttributes'],function(_0x40a739){return{'name':_0x40a739[_0x5877('0x2e')],'type':_0x40a739[_0x5877('0x2f')][_0x5877('0x30')]};});_0x4648ae[_0x5877('0x31')]=_['map'](_0x2569e1,'name');_0x4648ae[_0x5877('0x32')]=_[_0x5877('0x33')](_0x459185[_0x5877('0x32')]);_0x4648ae[_0x5877('0x34')]=_[_0x5877('0x35')](_0x4648ae[_0x5877('0x31')],_0x4648ae[_0x5877('0x32')]);_0x158f1a[_0x5877('0x36')]=_[_0x5877('0x35')](_0x4648ae['model'],qs[_0x5877('0x37')](_0x459185[_0x5877('0x32')][_0x5877('0x37')]));_0x158f1a[_0x5877('0x36')]=_0x158f1a['attributes']['length']?_0x158f1a[_0x5877('0x36')]:_0x4648ae[_0x5877('0x31')];if(!_0x459185['query'][_0x5877('0x38')](_0x5877('0x39'))){_0x158f1a[_0x5877('0x1d')]=qs['limit'](_0x459185['query'][_0x5877('0x1d')]);_0x158f1a[_0x5877('0x1c')]=qs[_0x5877('0x1c')](_0x459185[_0x5877('0x32')]['offset']);}_0x158f1a[_0x5877('0x3a')]=qs[_0x5877('0x3b')](_0x459185[_0x5877('0x32')]['sort']);_0x158f1a[_0x5877('0x3c')]=qs[_0x5877('0x34')](_['pick'](_0x459185['query'],_0x4648ae[_0x5877('0x34')]),_0x2569e1);if(_0x459185[_0x5877('0x32')][_0x5877('0x3d')]){_0x158f1a[_0x5877('0x3c')]=_['merge'](_0x158f1a['where'],{'$or':_[_0x5877('0x2c')](_0x2569e1,function(_0xe28b13){if(_0xe28b13[_0x5877('0x2f')]!==_0x5877('0x3e')){var _0xcf0f0d={};_0xcf0f0d[_0xe28b13['name']]={'$like':'%'+_0x459185[_0x5877('0x32')][_0x5877('0x3d')]+'%'};return _0xcf0f0d;}})});}_0x158f1a=_['merge']({},_0x158f1a,_0x459185['options']);var _0x4ca080={'where':_0x158f1a[_0x5877('0x3c')]};return db[_0x5877('0x2d')][_0x5877('0x1f')](_0x4ca080)[_0x5877('0x25')](function(_0x5021e1){_0x53668f['count']=_0x5021e1;if(_0x459185[_0x5877('0x32')][_0x5877('0x3f')]){_0x158f1a['include']=[{'all':!![]}];}return db[_0x5877('0x2d')][_0x5877('0x40')](_0x158f1a);})[_0x5877('0x25')](function(_0x445b2d){_0x53668f[_0x5877('0x41')]=_0x445b2d;return _0x53668f;})[_0x5877('0x25')](respondWithFilteredResult(_0x78928b,_0x158f1a))[_0x5877('0x42')](handleError(_0x78928b,null));};exports[_0x5877('0x43')]=function(_0x4eebde,_0x5c7426){var _0x42e4a8={'raw':!![],'where':{'id':_0x4eebde[_0x5877('0x44')]['id']}},_0x8845a9={};_0x8845a9['model']=_[_0x5877('0x33')](db[_0x5877('0x2d')][_0x5877('0x45')]);_0x8845a9['query']=_['keys'](_0x4eebde[_0x5877('0x32')]);_0x8845a9[_0x5877('0x34')]=_[_0x5877('0x35')](_0x8845a9[_0x5877('0x31')],_0x8845a9[_0x5877('0x32')]);_0x42e4a8['attributes']=_[_0x5877('0x35')](_0x8845a9[_0x5877('0x31')],qs[_0x5877('0x37')](_0x4eebde[_0x5877('0x32')]['fields']));_0x42e4a8[_0x5877('0x36')]=_0x42e4a8[_0x5877('0x36')][_0x5877('0x46')]?_0x42e4a8[_0x5877('0x36')]:_0x8845a9[_0x5877('0x31')];if(_0x4eebde[_0x5877('0x32')]['includeAll']){_0x42e4a8[_0x5877('0x47')]=[{'all':!![]}];}_0x42e4a8=_[_0x5877('0x48')]({},_0x42e4a8,_0x4eebde['options']);return db[_0x5877('0x2d')]['find'](_0x42e4a8)[_0x5877('0x25')](handleEntityNotFound(_0x5c7426,null))[_0x5877('0x25')](respondWithResult(_0x5c7426,null))[_0x5877('0x42')](handleError(_0x5c7426,null));};exports[_0x5877('0x49')]=function(_0x90841d,_0x4dfb47){return db[_0x5877('0x2d')]['create'](_0x90841d[_0x5877('0x4a')],{})[_0x5877('0x25')](respondWithResult(_0x4dfb47,0xc9))[_0x5877('0x42')](handleError(_0x4dfb47,null));};exports['update']=function(_0x4f7341,_0x29a605){if(_0x4f7341['body']['id']){delete _0x4f7341[_0x5877('0x4a')]['id'];}return db[_0x5877('0x2d')]['find']({'where':{'id':_0x4f7341[_0x5877('0x44')]['id']}})[_0x5877('0x25')](handleEntityNotFound(_0x29a605,null))[_0x5877('0x25')](saveUpdates(_0x4f7341[_0x5877('0x4a')],null))[_0x5877('0x25')](respondWithResult(_0x29a605,null))[_0x5877('0x42')](handleError(_0x29a605,null));};exports[_0x5877('0x4b')]=function(_0x4ebb8,_0x95641b){return db['VoiceTransferReport'][_0x5877('0x4c')]({'where':{'id':_0x4ebb8[_0x5877('0x44')]['id']}})[_0x5877('0x25')](handleEntityNotFound(_0x95641b,null))[_0x5877('0x25')](removeEntity(_0x95641b,null))[_0x5877('0x42')](handleError(_0x95641b,null));};exports[_0x5877('0x4d')]=function(_0x278450,_0x5938a3){return db[_0x5877('0x2d')][_0x5877('0x4d')]()['then'](respondWithResult(_0x5938a3,null))[_0x5877('0x42')](handleError(_0x5938a3,null));}; \ No newline at end of file +var _0x826e=['bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','filter','options','count','include','findAll','rows','show','params','includeAll','merge','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x31fea3,_0x271aab){var _0x5a2771=function(_0xc054d){while(--_0xc054d){_0x31fea3['push'](_0x31fea3['shift']());}};_0x5a2771(++_0x271aab);}(_0x826e,0x178));var _0xe826=function(_0x96c9a5,_0x229e01){_0x96c9a5=_0x96c9a5-0x0;var _0x1aaa9a=_0x826e[_0x96c9a5];return _0x1aaa9a;};'use strict';var emlformat=require(_0xe826('0x0'));var rimraf=require(_0xe826('0x1'));var zipdir=require(_0xe826('0x2'));var jsonpatch=require(_0xe826('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe826('0x4'));var Mustache=require('mustache');var util=require(_0xe826('0x5'));var path=require(_0xe826('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe826('0x7'));var fs=require('fs');var fs_extra=require(_0xe826('0x8'));var _=require(_0xe826('0x9'));var squel=require(_0xe826('0xa'));var crypto=require(_0xe826('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe826('0xc'));var querystring=require(_0xe826('0xd'));var Papa=require(_0xe826('0xe'));var Redis=require(_0xe826('0xf'));var authService=require(_0xe826('0x10'));var qs=require(_0xe826('0x11'));var as=require(_0xe826('0x12'));var hardwareService=require(_0xe826('0x13'));var logger=require(_0xe826('0x14'))(_0xe826('0x15'));var utils=require('../../config/utils');var config=require(_0xe826('0x16'));var licenseUtil=require(_0xe826('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16bf40,_0x1f0003){_0x1f0003=_0x1f0003||0xcc;return function(_0x1b449a){if(_0x1b449a){return _0x16bf40[_0xe826('0x18')](_0x1f0003);}return _0x16bf40[_0xe826('0x19')](_0x1f0003)[_0xe826('0x1a')]();};}function respondWithResult(_0x5c0388,_0x54f54e){_0x54f54e=_0x54f54e||0xc8;return function(_0x5c2ff7){if(_0x5c2ff7){return _0x5c0388[_0xe826('0x19')](_0x54f54e)[_0xe826('0x1b')](_0x5c2ff7);}};}function respondWithFilteredResult(_0x4c6686,_0x3105d1){return function(_0x3eb693){if(_0x3eb693){var _0xf073c3=typeof _0x3105d1[_0xe826('0x1c')]===_0xe826('0x1d')&&typeof _0x3105d1[_0xe826('0x1e')]===_0xe826('0x1d');var _0x35b31b=_0x3eb693['count'];var _0x24f910=_0xf073c3?0x0:_0x3105d1[_0xe826('0x1c')];var _0x4654ea=_0xf073c3?_0x3eb693['count']:_0x3105d1[_0xe826('0x1c')]+_0x3105d1[_0xe826('0x1e')];var _0x25bed2;if(_0x4654ea>=_0x35b31b){_0x4654ea=_0x35b31b;_0x25bed2=0xc8;}else{_0x25bed2=0xce;}_0x4c6686[_0xe826('0x19')](_0x25bed2);return _0x4c6686[_0xe826('0x1f')](_0xe826('0x20'),_0x24f910+'-'+_0x4654ea+'/'+_0x35b31b)[_0xe826('0x1b')](_0x3eb693);}return null;};}function patchUpdates(_0x46a1cf){return function(_0x54c3f9){try{jsonpatch[_0xe826('0x21')](_0x54c3f9,_0x46a1cf,!![]);}catch(_0x48b9ff){return BPromise[_0xe826('0x22')](_0x48b9ff);}return _0x54c3f9[_0xe826('0x23')]();};}function saveUpdates(_0x2d60dd,_0x5751cb){return function(_0x5aa245){if(_0x5aa245){return _0x5aa245[_0xe826('0x24')](_0x2d60dd)[_0xe826('0x25')](function(_0x5f0380){return _0x5f0380;});}return null;};}function removeEntity(_0x5e2a60,_0x3b899f){return function(_0x2f88cf){if(_0x2f88cf){return _0x2f88cf[_0xe826('0x26')]()[_0xe826('0x25')](function(){_0x5e2a60[_0xe826('0x19')](0xcc)[_0xe826('0x1a')]();});}};}function handleEntityNotFound(_0x56bc50,_0x45b0d0){return function(_0xb3a48a){if(!_0xb3a48a){_0x56bc50[_0xe826('0x18')](0x194);}return _0xb3a48a;};}function handleError(_0x32e6d7,_0x4f7c19){_0x4f7c19=_0x4f7c19||0x1f4;return function(_0x54ed4a){logger[_0xe826('0x27')](_0x54ed4a[_0xe826('0x28')]);if(_0x54ed4a[_0xe826('0x29')]){delete _0x54ed4a[_0xe826('0x29')];}_0x32e6d7[_0xe826('0x19')](_0x4f7c19)[_0xe826('0x2a')](_0x54ed4a);};}exports[_0xe826('0x2b')]=function(_0x20b995,_0x117717){var _0x507c7d={},_0x1bf70d={},_0x341515={'count':0x0,'rows':[]};var _0x463c54=_['map'](db[_0xe826('0x2c')][_0xe826('0x2d')],function(_0x30395c){return{'name':_0x30395c[_0xe826('0x2e')],'type':_0x30395c[_0xe826('0x2f')]['key']};});_0x1bf70d[_0xe826('0x30')]=_[_0xe826('0x31')](_0x463c54,_0xe826('0x29'));_0x1bf70d['query']=_[_0xe826('0x32')](_0x20b995[_0xe826('0x33')]);_0x1bf70d[_0xe826('0x34')]=_[_0xe826('0x35')](_0x1bf70d[_0xe826('0x30')],_0x1bf70d[_0xe826('0x33')]);_0x507c7d[_0xe826('0x36')]=_[_0xe826('0x35')](_0x1bf70d[_0xe826('0x30')],qs['fields'](_0x20b995[_0xe826('0x33')][_0xe826('0x37')]));_0x507c7d[_0xe826('0x36')]=_0x507c7d[_0xe826('0x36')][_0xe826('0x38')]?_0x507c7d[_0xe826('0x36')]:_0x1bf70d[_0xe826('0x30')];if(!_0x20b995['query']['hasOwnProperty'](_0xe826('0x39'))){_0x507c7d[_0xe826('0x1e')]=qs['limit'](_0x20b995[_0xe826('0x33')][_0xe826('0x1e')]);_0x507c7d[_0xe826('0x1c')]=qs['offset'](_0x20b995[_0xe826('0x33')][_0xe826('0x1c')]);}_0x507c7d['order']=qs[_0xe826('0x3a')](_0x20b995[_0xe826('0x33')][_0xe826('0x3a')]);_0x507c7d['where']=qs[_0xe826('0x34')](_[_0xe826('0x3b')](_0x20b995['query'],_0x1bf70d[_0xe826('0x34')]),_0x463c54);if(_0x20b995[_0xe826('0x33')]['filter']){_0x507c7d[_0xe826('0x3c')]=_['merge'](_0x507c7d[_0xe826('0x3c')],{'$or':_['map'](_0x463c54,function(_0x5cd5e1){if(_0x5cd5e1[_0xe826('0x2f')]!=='VIRTUAL'){var _0x1ddd17={};_0x1ddd17[_0x5cd5e1[_0xe826('0x29')]]={'$like':'%'+_0x20b995[_0xe826('0x33')][_0xe826('0x3d')]+'%'};return _0x1ddd17;}})});}_0x507c7d=_['merge']({},_0x507c7d,_0x20b995[_0xe826('0x3e')]);var _0x7c2c8c={'where':_0x507c7d['where']};return db[_0xe826('0x2c')][_0xe826('0x3f')](_0x7c2c8c)['then'](function(_0x190c2b){_0x341515['count']=_0x190c2b;if(_0x20b995['query']['includeAll']){_0x507c7d[_0xe826('0x40')]=[{'all':!![]}];}return db[_0xe826('0x2c')][_0xe826('0x41')](_0x507c7d);})[_0xe826('0x25')](function(_0x134218){_0x341515[_0xe826('0x42')]=_0x134218;return _0x341515;})['then'](respondWithFilteredResult(_0x117717,_0x507c7d))['catch'](handleError(_0x117717,null));};exports[_0xe826('0x43')]=function(_0x4a715f,_0x4581b6){var _0x3ebb48={'raw':!![],'where':{'id':_0x4a715f[_0xe826('0x44')]['id']}},_0x1e48c3={};_0x1e48c3[_0xe826('0x30')]=_[_0xe826('0x32')](db[_0xe826('0x2c')][_0xe826('0x2d')]);_0x1e48c3[_0xe826('0x33')]=_[_0xe826('0x32')](_0x4a715f[_0xe826('0x33')]);_0x1e48c3['filters']=_['intersection'](_0x1e48c3[_0xe826('0x30')],_0x1e48c3['query']);_0x3ebb48[_0xe826('0x36')]=_[_0xe826('0x35')](_0x1e48c3['model'],qs[_0xe826('0x37')](_0x4a715f[_0xe826('0x33')][_0xe826('0x37')]));_0x3ebb48['attributes']=_0x3ebb48[_0xe826('0x36')][_0xe826('0x38')]?_0x3ebb48['attributes']:_0x1e48c3[_0xe826('0x30')];if(_0x4a715f[_0xe826('0x33')][_0xe826('0x45')]){_0x3ebb48[_0xe826('0x40')]=[{'all':!![]}];}_0x3ebb48=_[_0xe826('0x46')]({},_0x3ebb48,_0x4a715f[_0xe826('0x3e')]);return db['VoiceTransferReport'][_0xe826('0x47')](_0x3ebb48)[_0xe826('0x25')](handleEntityNotFound(_0x4581b6,null))[_0xe826('0x25')](respondWithResult(_0x4581b6,null))[_0xe826('0x48')](handleError(_0x4581b6,null));};exports[_0xe826('0x49')]=function(_0x11c029,_0x3efb65){return db[_0xe826('0x2c')]['create'](_0x11c029[_0xe826('0x4a')],{})[_0xe826('0x25')](respondWithResult(_0x3efb65,0xc9))[_0xe826('0x48')](handleError(_0x3efb65,null));};exports['update']=function(_0x50606a,_0x5bb065){if(_0x50606a[_0xe826('0x4a')]['id']){delete _0x50606a['body']['id'];}return db[_0xe826('0x2c')][_0xe826('0x47')]({'where':{'id':_0x50606a[_0xe826('0x44')]['id']}})[_0xe826('0x25')](handleEntityNotFound(_0x5bb065,null))[_0xe826('0x25')](saveUpdates(_0x50606a[_0xe826('0x4a')],null))[_0xe826('0x25')](respondWithResult(_0x5bb065,null))['catch'](handleError(_0x5bb065,null));};exports['destroy']=function(_0x2d6640,_0x56c843){return db[_0xe826('0x2c')][_0xe826('0x47')]({'where':{'id':_0x2d6640['params']['id']}})[_0xe826('0x25')](handleEntityNotFound(_0x56c843,null))[_0xe826('0x25')](removeEntity(_0x56c843,null))[_0xe826('0x48')](handleError(_0x56c843,null));};exports[_0xe826('0x4b')]=function(_0x171e98,_0x3b8130){return db['VoiceTransferReport'][_0xe826('0x4b')]()[_0xe826('0x25')](respondWithResult(_0x3b8130,null))[_0xe826('0x48')](handleError(_0x3b8130,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1f67ea5..48955b2 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2b9=['moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api'];(function(_0x57745d,_0x1e6cca){var _0x4e0cb4=function(_0x2bc3b7){while(--_0x2bc3b7){_0x57745d['push'](_0x57745d['shift']());}};_0x4e0cb4(++_0x1e6cca);}(_0xf2b9,0x183));var _0x9f2b=function(_0x3ae024,_0x5bb823){_0x3ae024=_0x3ae024-0x0;var _0x1a3cfe=_0xf2b9[_0x3ae024];return _0x1a3cfe;};'use strict';var _=require('lodash');var util=require(_0x9f2b('0x0'));var logger=require(_0x9f2b('0x1'))(_0x9f2b('0x2'));var moment=require(_0x9f2b('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f2b('0x4'));var fs=require('fs');var path=require(_0x9f2b('0x5'));var rimraf=require(_0x9f2b('0x6'));var config=require(_0x9f2b('0x7'));var attributes=require(_0x9f2b('0x8'));module[_0x9f2b('0x9')]=function(_0x32b727,_0x309190){return _0x32b727[_0x9f2b('0xa')](_0x9f2b('0xb'),attributes,{'tableName':_0x9f2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3039=['define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x124ec4,_0x31307d){var _0x2a82fd=function(_0x5140dd){while(--_0x5140dd){_0x124ec4['push'](_0x124ec4['shift']());}};_0x2a82fd(++_0x31307d);}(_0x3039,0x19b));var _0x9303=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3039[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9303('0x0'));var util=require(_0x9303('0x1'));var logger=require(_0x9303('0x2'))(_0x9303('0x3'));var moment=require(_0x9303('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9303('0x5'));var rimraf=require(_0x9303('0x6'));var config=require(_0x9303('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x9303('0x8')]=function(_0x57f3bf,_0xe62948){return _0x57f3bf[_0x9303('0x9')](_0x9303('0xa'),attributes,{'tableName':_0x9303('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index d71e2f8..62a1003 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ed0=['create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','catch','VoiceTransferReport'];(function(_0x29deea,_0x2dc067){var _0x522bb1=function(_0x22aebe){while(--_0x22aebe){_0x29deea['push'](_0x29deea['shift']());}};_0x522bb1(++_0x2dc067);}(_0x3ed0,0x19a));var _0x03ed=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x3ed0[_0x420513];return _0x1b44ec;};'use strict';var _=require(_0x03ed('0x0'));var util=require(_0x03ed('0x1'));var moment=require(_0x03ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x03ed('0x3'));var fs=require('fs');var Redis=require(_0x03ed('0x4'));var db=require(_0x03ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x03ed('0x6'))('rpc');var config=require(_0x03ed('0x7'));var jayson=require(_0x03ed('0x8'));var client=jayson[_0x03ed('0x9')][_0x03ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df499,_0x15dfda,_0x5e02bc){return new BPromise(function(_0x406f62,_0x19f2c5){return client['request'](_0x3df499,_0x5e02bc)[_0x03ed('0xb')](function(_0x39c88a){logger[_0x03ed('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x15dfda,_0x03ed('0xd'));logger[_0x03ed('0xe')](_0x03ed('0xf'),_0x15dfda,'request\x20sent',JSON[_0x03ed('0x10')](_0x39c88a));if(_0x39c88a[_0x03ed('0x11')]){if(_0x39c88a[_0x03ed('0x11')]['code']===0x1f4){logger['error'](_0x03ed('0x12'),_0x15dfda,_0x39c88a['error']['message']);return _0x19f2c5(_0x39c88a[_0x03ed('0x11')][_0x03ed('0x13')]);}logger[_0x03ed('0x11')](_0x03ed('0x12'),_0x15dfda,_0x39c88a[_0x03ed('0x11')][_0x03ed('0x13')]);return _0x406f62(_0x39c88a[_0x03ed('0x11')][_0x03ed('0x13')]);}else{logger[_0x03ed('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x15dfda,_0x03ed('0xd'));_0x406f62(_0x39c88a['result'][_0x03ed('0x13')]);}})[_0x03ed('0x14')](function(_0x39e1e8){logger[_0x03ed('0x11')](_0x03ed('0x12'),_0x15dfda,_0x39e1e8);_0x19f2c5(_0x39e1e8);});});}exports['CreateVoiceTransferReport']=function(_0x3851f8){var _0x4af3c2=this;return new Promise(function(_0x2de71a,_0x2e123b){return db[_0x03ed('0x15')][_0x03ed('0x16')](_0x3851f8[_0x03ed('0x17')],{'raw':_0x3851f8[_0x03ed('0x18')]?_0x3851f8[_0x03ed('0x18')][_0x03ed('0x19')]===undefined?!![]:![]:!![]})[_0x03ed('0xb')](function(_0x17ca2b){logger[_0x03ed('0xc')]('CreateVoiceTransferReport',_0x3851f8);logger['debug'](_0x03ed('0x1a'),_0x3851f8,JSON[_0x03ed('0x10')](_0x17ca2b));_0x2de71a(_0x17ca2b);})['catch'](function(_0x2f7777){logger[_0x03ed('0x11')]('CreateVoiceTransferReport',_0x2f7777[_0x03ed('0x13')],_0x3851f8);_0x2e123b(_0x4af3c2[_0x03ed('0x11')](0x1f4,_0x2f7777[_0x03ed('0x13')]));});});}; \ No newline at end of file +var _0xe298=['request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4c825d,_0x10ec2b){var _0x43de87=function(_0xcab4a3){while(--_0xcab4a3){_0x4c825d['push'](_0x4c825d['shift']());}};_0x43de87(++_0x10ec2b);}(_0xe298,0x1c5));var _0x8e29=function(_0x322ef6,_0x42685a){_0x322ef6=_0x322ef6-0x0;var _0x5d3a12=_0xe298[_0x322ef6];return _0x5d3a12;};'use strict';var _=require(_0x8e29('0x0'));var util=require(_0x8e29('0x1'));var moment=require('moment');var BPromise=require(_0x8e29('0x2'));var rs=require(_0x8e29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e29('0x4'))['db'];var utils=require(_0x8e29('0x5'));var logger=require('../../config/logger')(_0x8e29('0x6'));var config=require(_0x8e29('0x7'));var jayson=require(_0x8e29('0x8'));var client=jayson[_0x8e29('0x9')][_0x8e29('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47f83d,_0x16358e,_0x1d1096){return new BPromise(function(_0x21943c,_0x13b507){return client[_0x8e29('0xb')](_0x47f83d,_0x1d1096)[_0x8e29('0xc')](function(_0x123ab9){logger[_0x8e29('0xd')](_0x8e29('0xe'),_0x16358e,_0x8e29('0xf'));logger[_0x8e29('0x10')](_0x8e29('0x11'),_0x16358e,_0x8e29('0xf'),JSON[_0x8e29('0x12')](_0x123ab9));if(_0x123ab9[_0x8e29('0x13')]){if(_0x123ab9['error'][_0x8e29('0x14')]===0x1f4){logger[_0x8e29('0x13')](_0x8e29('0xe'),_0x16358e,_0x123ab9['error'][_0x8e29('0x15')]);return _0x13b507(_0x123ab9[_0x8e29('0x13')]['message']);}logger[_0x8e29('0x13')](_0x8e29('0xe'),_0x16358e,_0x123ab9[_0x8e29('0x13')][_0x8e29('0x15')]);return _0x21943c(_0x123ab9['error'][_0x8e29('0x15')]);}else{logger[_0x8e29('0xd')](_0x8e29('0xe'),_0x16358e,_0x8e29('0xf'));_0x21943c(_0x123ab9[_0x8e29('0x16')][_0x8e29('0x15')]);}})[_0x8e29('0x17')](function(_0x2e274a){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x16358e,_0x2e274a);_0x13b507(_0x2e274a);});});}exports[_0x8e29('0x18')]=function(_0x2bced9){var _0x458bb7=this;return new Promise(function(_0x55b6ca,_0x498a59){return db[_0x8e29('0x19')][_0x8e29('0x1a')](_0x2bced9[_0x8e29('0x1b')],{'raw':_0x2bced9[_0x8e29('0x1c')]?_0x2bced9[_0x8e29('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3bafe7){logger[_0x8e29('0xd')]('CreateVoiceTransferReport',_0x2bced9);logger[_0x8e29('0x10')](_0x8e29('0x18'),_0x2bced9,JSON['stringify'](_0x3bafe7));_0x55b6ca(_0x3bafe7);})['catch'](function(_0x289eef){logger['error']('CreateVoiceTransferReport',_0x289eef[_0x8e29('0x15')],_0x2bced9);_0x498a59(_0x458bb7[_0x8e29('0x13')](0x1f4,_0x289eef[_0x8e29('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index b6121a7..b845493 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x48e58f,_0x50ff2b){var _0x2cc57e=function(_0x18924f){while(--_0x18924f){_0x48e58f['push'](_0x48e58f['shift']());}};_0x2cc57e(++_0x50ff2b);}(_0xaa88,0x137));var _0x8aa8=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0xaa88[_0xd7b0a4];return _0x184e9e;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb821=['/unhold','unhold','/calls','calls','/transfer','Router','../../components/auth/service','/originate','originate','post','/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','answer','/hold','hold'];(function(_0x5eb83e,_0x386039){var _0x2ba972=function(_0x324087){while(--_0x324087){_0x5eb83e['push'](_0x5eb83e['shift']());}};_0x2ba972(++_0x386039);}(_0xb821,0xa7));var _0x1b82=function(_0x3f5ef4,_0x2c7e3d){_0x3f5ef4=_0x3f5ef4-0x0;var _0x2bd9e7=_0xb821[_0x3f5ef4];return _0x2bd9e7;};'use strict';var express=require('express');var router=express[_0x1b82('0x0')]();var auth=require(_0x1b82('0x1'));var controller=require('./webbar.controller');router['post'](_0x1b82('0x2'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x1b82('0x3')]);router[_0x1b82('0x4')](_0x1b82('0x5'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x4')](_0x1b82('0x8'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x4')](_0x1b82('0xb'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0xc')]);router[_0x1b82('0x4')](_0x1b82('0xd'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0x4')](_0x1b82('0xf'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);router[_0x1b82('0x4')](_0x1b82('0x11'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller['transfer']);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 8dff56e..ed8a092 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a9a=['hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','body','length','status','json','userId','callNumber','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','answer','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:'];(function(_0x2476f9,_0x53c193){var _0x5624c3=function(_0x200220){while(--_0x200220){_0x2476f9['push'](_0x2476f9['shift']());}};_0x5624c3(++_0x53c193);}(_0x0a9a,0x183));var _0xa0a9=function(_0xf4bf53,_0x1f7395){_0xf4bf53=_0xf4bf53-0x0;var _0x5e9604=_0x0a9a[_0xf4bf53];return _0x5e9604;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xa0a9('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xa0a9('0x1'));var util=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var jayson=require(_0xa0a9('0x4'));var amiClient=jayson['client'][_0xa0a9('0x5')]({'port':0x232a});var logger=require(_0xa0a9('0x6'))('webbarapi');var Redis=require(_0xa0a9('0x7'));config[_0xa0a9('0x8')]=_[_0xa0a9('0x9')](config[_0xa0a9('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa0a9('0xa'))(new Redis(config['redis']));var Schema=require(_0xa0a9('0xb'));var originateValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'callNumber':{'type':_0xa0a9('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xa0a9('0xe')},'callbackUrl':{'type':_0xa0a9('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':[!![],_0xa0a9('0xf')]},'transferNumber':{'type':_0xa0a9('0xe'),'required':[!![],_0xa0a9('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x176faa,_0x48c315,_0x4a57dd){logger[_0xa0a9('0x11')](_0x176faa,_0x48c315,JSON[_0xa0a9('0x12')](_0x4a57dd));io['to'](_0x176faa)[_0xa0a9('0x13')](_0x48c315,_0x4a57dd);}function handleError(_0x16c3e3){return function(_0x568409){console[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x568409,_0x568409 instanceof RangeError);logger[_0xa0a9('0x16')](_0x568409[_0xa0a9('0x17')]);if(_0x568409 instanceof RangeError){if(_0x568409[_0xa0a9('0x18')]){delete _0x568409[_0xa0a9('0x18')];}_0x16c3e3['status'](0x194)[_0xa0a9('0x19')](_0x568409);}else{if(_0x568409[_0xa0a9('0x18')]){delete _0x568409['name'];}_0x16c3e3['status'](0x1f4)[_0xa0a9('0x19')](_0x568409);}};}function checkError(){return function(_0x1f6955){if(!_0x1f6955){throw new RangeError(_0xa0a9('0x1a'));}return _0x1f6955;};}function respondWithRpcPromise(_0x54a9a9,_0x307d7e){return new BPromise(function(_0x4e6f4c,_0x1fb36b){var _0x5e6148=amiClient;return _0x5e6148[_0xa0a9('0x1b')](_0x54a9a9,_0x307d7e)[_0xa0a9('0x1c')](function(_0x2f0b14){if(_0x2f0b14[_0xa0a9('0x16')]){if(_0x2f0b14['error'][_0xa0a9('0x1d')]===0x1f4){return _0x1fb36b(_0x2f0b14['error'][_0xa0a9('0x1e')]);}return _0x4e6f4c(_0x2f0b14[_0xa0a9('0x16')][_0xa0a9('0x1e')]);}else{_0x4e6f4c(_0x2f0b14[_0xa0a9('0x1f')]);}})['catch'](function(_0x7c1502){_0x1fb36b(_0x7c1502);});});}function getAgent(_0xe49d3b){return db[_0xa0a9('0x20')][_0xa0a9('0x21')]({'where':{'id':_0xe49d3b,'role':'agent'}})[_0xa0a9('0x1c')](checkError());}function getAgentCheckSession(_0x38e454,_0x2eae30){return new BPromise(function(_0x5c446e,_0x54125d){var _0x2b3cbb=respondWithRpcPromise(_0xa0a9('0x22'));var _0x10bbfd=getAgent(_0x38e454);Promise[_0xa0a9('0x23')]([_0x2b3cbb,_0x10bbfd])[_0xa0a9('0x1c')](function(_0xe218ff){var _0x2386c9=_0xe218ff[0x0];var _0x24e744=_0xe218ff[0x1];var _0xc6a4=_[_0xa0a9('0x24')](_0x2386c9[_0xa0a9('0x25')],function(_0x554191){return _0x554191[_0xa0a9('0x26')]==_0x24e744['id']&&_0x554191[_0xa0a9('0x27')]==_0x2eae30;});if(_0xc6a4['length']==0x1){_0x5c446e(_0x24e744);}else{_0x54125d(new RangeError(_0xa0a9('0x28')+_0x2eae30+_0xa0a9('0x29')));}});});}exports['originate']=function(_0x47c19b,_0x45374e){logger['info']('originate\x20fired:',_0x47c19b[_0xa0a9('0x2a')]);var _0x104936=originateValidation[_0xa0a9('0xb')](_0x47c19b[_0xa0a9('0x2a')]);if(_0x104936[_0xa0a9('0x2b')]>0x0){return _0x45374e[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x104936);}var _0x4bbcc2=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x539807=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2f')];var _0x2363e6=_0x47c19b['body']['callerId'];var _0x3b1a11=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x30')];return getAgent(_0x4bbcc2)[_0xa0a9('0x1c')](function(_0x520817){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x520817[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x520817[_0xa0a9('0x18')]),_0xa0a9('0x33'),{'callNumber':_0x539807,'callerId':_0x2363e6,'callbackUrl':_0x3b1a11});return _0x45374e['status'](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x34')});})[_0xa0a9('0x35')](handleError(_0x45374e));};exports[_0xa0a9('0x36')]=function(_0x2e11dc,_0x1d6bae){logger[_0xa0a9('0x11')](_0xa0a9('0x37'),_0x2e11dc[_0xa0a9('0x2a')]);var _0x2ea301=hangupValidation[_0xa0a9('0xb')](_0x2e11dc[_0xa0a9('0x2a')]);if(_0x2ea301[_0xa0a9('0x2b')]>0x0){return _0x1d6bae[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x2ea301);}var _0x1b1aff=_0x2e11dc[_0xa0a9('0x2a')]['userId'];var _0x3f1e4f=_0x2e11dc[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1b1aff)['then'](function(_0x757e10){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x757e10[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x757e10[_0xa0a9('0x18')]),_0xa0a9('0x38'),{'sessionId':_0x3f1e4f});return _0x1d6bae[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0xa0a9('0x35')](handleError(_0x1d6bae));};exports[_0xa0a9('0x39')]=function(_0x39c02a,_0x32d926){logger[_0xa0a9('0x11')]('answer\x20fired:',_0x39c02a[_0xa0a9('0x2a')]);var _0x11c130=answerValidation[_0xa0a9('0xb')](_0x39c02a[_0xa0a9('0x2a')]);if(_0x11c130[_0xa0a9('0x2b')]>0x0){return _0x32d926['status'](0x190)[_0xa0a9('0x2d')](_0x11c130);}var _0x1c8760=_0x39c02a['body']['userId'];var _0x41cd22=_0x39c02a[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1c8760)[_0xa0a9('0x1c')](function(_0x4a128f){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x4a128f[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x4a128f[_0xa0a9('0x18')]),_0xa0a9('0x3b'),{'sessionId':_0x41cd22});return _0x32d926[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3c')});})[_0xa0a9('0x35')](handleError(_0x32d926));};exports[_0xa0a9('0x3d')]=function(_0x2fcc76,_0x3bb0fb){logger[_0xa0a9('0x11')](_0xa0a9('0x3e'),_0x2fcc76[_0xa0a9('0x2a')]);var _0x54e917=holdValidation[_0xa0a9('0xb')](_0x2fcc76['body']);if(_0x54e917[_0xa0a9('0x2b')]>0x0){return _0x3bb0fb[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x54e917);}var _0x132eca=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x38cb0d=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x132eca)['then'](function(_0x5d4162){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5d4162['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5d4162[_0xa0a9('0x18')]),'webbar:hold',{'sessionId':_0x38cb0d});return _0x3bb0fb[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3f')});})[_0xa0a9('0x35')](handleError(_0x3bb0fb));};exports['unhold']=function(_0x398501,_0x45db88){logger[_0xa0a9('0x11')](_0xa0a9('0x40'),_0x398501[_0xa0a9('0x2a')]);var _0x41128b=unholdValidation[_0xa0a9('0xb')](_0x398501['body']);if(_0x41128b[_0xa0a9('0x2b')]>0x0){return _0x45db88[_0xa0a9('0x2c')](0x190)['json'](_0x41128b);}var _0x2cbd5e=_0x398501[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x506168=_0x398501['body'][_0xa0a9('0x27')];return getAgent(_0x2cbd5e)[_0xa0a9('0x1c')](function(_0x3f67ac){logger[_0xa0a9('0x11')]('entityFound:',_0x3f67ac['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x3f67ac['name']),'webbar:unhold',{'sessionId':_0x506168});return _0x45db88[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x41')});})[_0xa0a9('0x35')](handleError(_0x45db88));};exports[_0xa0a9('0x42')]=function(_0x361bf1,_0x24af09){logger[_0xa0a9('0x11')](_0xa0a9('0x43'),_0x24af09[_0xa0a9('0x2a')]);var _0x2da124=callsValidation['validate'](_0x361bf1[_0xa0a9('0x2a')]);if(_0x2da124[_0xa0a9('0x2b')]>0x0){return _0x24af09[_0xa0a9('0x2c')](0x190)['json'](_0x2da124);}var _0x426ddc=_0x361bf1[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x4a1912=respondWithRpcPromise(_0xa0a9('0x22'));var _0x18893f=getAgent(_0x426ddc);return Promise[_0xa0a9('0x23')]([_0x4a1912,_0x18893f])[_0xa0a9('0x1c')](function(_0x3d47b3){var _0x47107f=_0x3d47b3[0x0];var _0x12f97d=_0x3d47b3[0x1];var _0x577c1f=_[_0xa0a9('0x24')](_0x47107f[_0xa0a9('0x25')],function(_0x3f6ef4){return _0x3f6ef4[_0xa0a9('0x26')]==_0x12f97d['id'];});return _0x24af09[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'count':_0x577c1f[_0xa0a9('0x2b')],'rows':_0x577c1f});})['catch'](handleError(_0x24af09));};exports['conference']=function(_0x4a2307,_0x40d0f5){logger['info'](_0xa0a9('0x44'),_0x4a2307['body']);var _0x349f1b=conferenceValidation[_0xa0a9('0xb')](_0x4a2307[_0xa0a9('0x2a')]);if(_0x349f1b[_0xa0a9('0x2b')]>0x0){return _0x40d0f5[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x349f1b);}var _0x1c7191=_0x4a2307[_0xa0a9('0x2a')]['userId'];return getAgent(_0x1c7191)['then'](function(_0x471e1a){logger['info'](_0xa0a9('0x31'),_0x471e1a[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')]('user:%s',_0x471e1a[_0xa0a9('0x18')]),'webbar:conference');return _0x40d0f5[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x45')});})['catch'](handleError(_0x40d0f5));};exports[_0xa0a9('0x46')]=function(_0x478b4e,_0x2648e4){logger['info'](_0xa0a9('0x47'),_0x478b4e['body']);var _0x662a0=transferValidation[_0xa0a9('0xb')](_0x478b4e[_0xa0a9('0x2a')]);if(_0x662a0[_0xa0a9('0x2b')]>0x0){return _0x2648e4[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x662a0);}var _0x4cc06d=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x2e6d3f=_0x478b4e['body'][_0xa0a9('0x27')];var _0x184b0e=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x48')];return getAgent(_0x4cc06d)[_0xa0a9('0x1c')](function(_0x5581c7){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5581c7[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5581c7[_0xa0a9('0x18')]),_0xa0a9('0x49'),{'sessionId':_0x2e6d3f,'transferNumber':_0x184b0e});return _0x2648e4[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x4a')});})['catch'](handleError(_0x2648e4));}; \ No newline at end of file +var _0x0a9a=['hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','body','length','status','json','userId','callNumber','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','answer','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:'];(function(_0x4af3bc,_0x500ff8){var _0x5f1111=function(_0x53fc6a){while(--_0x53fc6a){_0x4af3bc['push'](_0x4af3bc['shift']());}};_0x5f1111(++_0x500ff8);}(_0x0a9a,0x183));var _0xa0a9=function(_0x142345,_0x58d9d0){_0x142345=_0x142345-0x0;var _0x592f4f=_0x0a9a[_0x142345];return _0x592f4f;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xa0a9('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xa0a9('0x1'));var util=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var jayson=require(_0xa0a9('0x4'));var amiClient=jayson['client'][_0xa0a9('0x5')]({'port':0x232a});var logger=require(_0xa0a9('0x6'))('webbarapi');var Redis=require(_0xa0a9('0x7'));config[_0xa0a9('0x8')]=_[_0xa0a9('0x9')](config[_0xa0a9('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa0a9('0xa'))(new Redis(config['redis']));var Schema=require(_0xa0a9('0xb'));var originateValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'callNumber':{'type':_0xa0a9('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xa0a9('0xe')},'callbackUrl':{'type':_0xa0a9('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':[!![],_0xa0a9('0xf')]},'transferNumber':{'type':_0xa0a9('0xe'),'required':[!![],_0xa0a9('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x176faa,_0x48c315,_0x4a57dd){logger[_0xa0a9('0x11')](_0x176faa,_0x48c315,JSON[_0xa0a9('0x12')](_0x4a57dd));io['to'](_0x176faa)[_0xa0a9('0x13')](_0x48c315,_0x4a57dd);}function handleError(_0x16c3e3){return function(_0x568409){console[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x568409,_0x568409 instanceof RangeError);logger[_0xa0a9('0x16')](_0x568409[_0xa0a9('0x17')]);if(_0x568409 instanceof RangeError){if(_0x568409[_0xa0a9('0x18')]){delete _0x568409[_0xa0a9('0x18')];}_0x16c3e3['status'](0x194)[_0xa0a9('0x19')](_0x568409);}else{if(_0x568409[_0xa0a9('0x18')]){delete _0x568409['name'];}_0x16c3e3['status'](0x1f4)[_0xa0a9('0x19')](_0x568409);}};}function checkError(){return function(_0x1f6955){if(!_0x1f6955){throw new RangeError(_0xa0a9('0x1a'));}return _0x1f6955;};}function respondWithRpcPromise(_0x54a9a9,_0x307d7e){return new BPromise(function(_0x4e6f4c,_0x1fb36b){var _0x5e6148=amiClient;return _0x5e6148[_0xa0a9('0x1b')](_0x54a9a9,_0x307d7e)[_0xa0a9('0x1c')](function(_0x2f0b14){if(_0x2f0b14[_0xa0a9('0x16')]){if(_0x2f0b14['error'][_0xa0a9('0x1d')]===0x1f4){return _0x1fb36b(_0x2f0b14['error'][_0xa0a9('0x1e')]);}return _0x4e6f4c(_0x2f0b14[_0xa0a9('0x16')][_0xa0a9('0x1e')]);}else{_0x4e6f4c(_0x2f0b14[_0xa0a9('0x1f')]);}})['catch'](function(_0x7c1502){_0x1fb36b(_0x7c1502);});});}function getAgent(_0xe49d3b){return db[_0xa0a9('0x20')][_0xa0a9('0x21')]({'where':{'id':_0xe49d3b,'role':'agent'}})[_0xa0a9('0x1c')](checkError());}function getAgentCheckSession(_0x38e454,_0x2eae30){return new BPromise(function(_0x5c446e,_0x54125d){var _0x2b3cbb=respondWithRpcPromise(_0xa0a9('0x22'));var _0x10bbfd=getAgent(_0x38e454);Promise[_0xa0a9('0x23')]([_0x2b3cbb,_0x10bbfd])[_0xa0a9('0x1c')](function(_0xe218ff){var _0x2386c9=_0xe218ff[0x0];var _0x24e744=_0xe218ff[0x1];var _0xc6a4=_[_0xa0a9('0x24')](_0x2386c9[_0xa0a9('0x25')],function(_0x554191){return _0x554191[_0xa0a9('0x26')]==_0x24e744['id']&&_0x554191[_0xa0a9('0x27')]==_0x2eae30;});if(_0xc6a4['length']==0x1){_0x5c446e(_0x24e744);}else{_0x54125d(new RangeError(_0xa0a9('0x28')+_0x2eae30+_0xa0a9('0x29')));}});});}exports['originate']=function(_0x47c19b,_0x45374e){logger['info']('originate\x20fired:',_0x47c19b[_0xa0a9('0x2a')]);var _0x104936=originateValidation[_0xa0a9('0xb')](_0x47c19b[_0xa0a9('0x2a')]);if(_0x104936[_0xa0a9('0x2b')]>0x0){return _0x45374e[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x104936);}var _0x4bbcc2=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x539807=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2f')];var _0x2363e6=_0x47c19b['body']['callerId'];var _0x3b1a11=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x30')];return getAgent(_0x4bbcc2)[_0xa0a9('0x1c')](function(_0x520817){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x520817[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x520817[_0xa0a9('0x18')]),_0xa0a9('0x33'),{'callNumber':_0x539807,'callerId':_0x2363e6,'callbackUrl':_0x3b1a11});return _0x45374e['status'](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x34')});})[_0xa0a9('0x35')](handleError(_0x45374e));};exports[_0xa0a9('0x36')]=function(_0x2e11dc,_0x1d6bae){logger[_0xa0a9('0x11')](_0xa0a9('0x37'),_0x2e11dc[_0xa0a9('0x2a')]);var _0x2ea301=hangupValidation[_0xa0a9('0xb')](_0x2e11dc[_0xa0a9('0x2a')]);if(_0x2ea301[_0xa0a9('0x2b')]>0x0){return _0x1d6bae[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x2ea301);}var _0x1b1aff=_0x2e11dc[_0xa0a9('0x2a')]['userId'];var _0x3f1e4f=_0x2e11dc[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1b1aff)['then'](function(_0x757e10){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x757e10[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x757e10[_0xa0a9('0x18')]),_0xa0a9('0x38'),{'sessionId':_0x3f1e4f});return _0x1d6bae[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0xa0a9('0x35')](handleError(_0x1d6bae));};exports[_0xa0a9('0x39')]=function(_0x39c02a,_0x32d926){logger[_0xa0a9('0x11')]('answer\x20fired:',_0x39c02a[_0xa0a9('0x2a')]);var _0x11c130=answerValidation[_0xa0a9('0xb')](_0x39c02a[_0xa0a9('0x2a')]);if(_0x11c130[_0xa0a9('0x2b')]>0x0){return _0x32d926['status'](0x190)[_0xa0a9('0x2d')](_0x11c130);}var _0x1c8760=_0x39c02a['body']['userId'];var _0x41cd22=_0x39c02a[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1c8760)[_0xa0a9('0x1c')](function(_0x4a128f){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x4a128f[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x4a128f[_0xa0a9('0x18')]),_0xa0a9('0x3b'),{'sessionId':_0x41cd22});return _0x32d926[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3c')});})[_0xa0a9('0x35')](handleError(_0x32d926));};exports[_0xa0a9('0x3d')]=function(_0x2fcc76,_0x3bb0fb){logger[_0xa0a9('0x11')](_0xa0a9('0x3e'),_0x2fcc76[_0xa0a9('0x2a')]);var _0x54e917=holdValidation[_0xa0a9('0xb')](_0x2fcc76['body']);if(_0x54e917[_0xa0a9('0x2b')]>0x0){return _0x3bb0fb[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x54e917);}var _0x132eca=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x38cb0d=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x132eca)['then'](function(_0x5d4162){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5d4162['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5d4162[_0xa0a9('0x18')]),'webbar:hold',{'sessionId':_0x38cb0d});return _0x3bb0fb[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3f')});})[_0xa0a9('0x35')](handleError(_0x3bb0fb));};exports['unhold']=function(_0x398501,_0x45db88){logger[_0xa0a9('0x11')](_0xa0a9('0x40'),_0x398501[_0xa0a9('0x2a')]);var _0x41128b=unholdValidation[_0xa0a9('0xb')](_0x398501['body']);if(_0x41128b[_0xa0a9('0x2b')]>0x0){return _0x45db88[_0xa0a9('0x2c')](0x190)['json'](_0x41128b);}var _0x2cbd5e=_0x398501[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x506168=_0x398501['body'][_0xa0a9('0x27')];return getAgent(_0x2cbd5e)[_0xa0a9('0x1c')](function(_0x3f67ac){logger[_0xa0a9('0x11')]('entityFound:',_0x3f67ac['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x3f67ac['name']),'webbar:unhold',{'sessionId':_0x506168});return _0x45db88[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x41')});})[_0xa0a9('0x35')](handleError(_0x45db88));};exports[_0xa0a9('0x42')]=function(_0x361bf1,_0x24af09){logger[_0xa0a9('0x11')](_0xa0a9('0x43'),_0x24af09[_0xa0a9('0x2a')]);var _0x2da124=callsValidation['validate'](_0x361bf1[_0xa0a9('0x2a')]);if(_0x2da124[_0xa0a9('0x2b')]>0x0){return _0x24af09[_0xa0a9('0x2c')](0x190)['json'](_0x2da124);}var _0x426ddc=_0x361bf1[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x4a1912=respondWithRpcPromise(_0xa0a9('0x22'));var _0x18893f=getAgent(_0x426ddc);return Promise[_0xa0a9('0x23')]([_0x4a1912,_0x18893f])[_0xa0a9('0x1c')](function(_0x3d47b3){var _0x47107f=_0x3d47b3[0x0];var _0x12f97d=_0x3d47b3[0x1];var _0x577c1f=_[_0xa0a9('0x24')](_0x47107f[_0xa0a9('0x25')],function(_0x3f6ef4){return _0x3f6ef4[_0xa0a9('0x26')]==_0x12f97d['id'];});return _0x24af09[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'count':_0x577c1f[_0xa0a9('0x2b')],'rows':_0x577c1f});})['catch'](handleError(_0x24af09));};exports['conference']=function(_0x4a2307,_0x40d0f5){logger['info'](_0xa0a9('0x44'),_0x4a2307['body']);var _0x349f1b=conferenceValidation[_0xa0a9('0xb')](_0x4a2307[_0xa0a9('0x2a')]);if(_0x349f1b[_0xa0a9('0x2b')]>0x0){return _0x40d0f5[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x349f1b);}var _0x1c7191=_0x4a2307[_0xa0a9('0x2a')]['userId'];return getAgent(_0x1c7191)['then'](function(_0x471e1a){logger['info'](_0xa0a9('0x31'),_0x471e1a[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')]('user:%s',_0x471e1a[_0xa0a9('0x18')]),'webbar:conference');return _0x40d0f5[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x45')});})['catch'](handleError(_0x40d0f5));};exports[_0xa0a9('0x46')]=function(_0x478b4e,_0x2648e4){logger['info'](_0xa0a9('0x47'),_0x478b4e['body']);var _0x662a0=transferValidation[_0xa0a9('0xb')](_0x478b4e[_0xa0a9('0x2a')]);if(_0x662a0[_0xa0a9('0x2b')]>0x0){return _0x2648e4[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x662a0);}var _0x4cc06d=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x2e6d3f=_0x478b4e['body'][_0xa0a9('0x27')];var _0x184b0e=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x48')];return getAgent(_0x4cc06d)[_0xa0a9('0x1c')](function(_0x5581c7){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5581c7[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5581c7[_0xa0a9('0x18')]),_0xa0a9('0x49'),{'sessionId':_0x2e6d3f,'transferNumber':_0x184b0e});return _0x2648e4[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x4a')});})['catch'](handleError(_0x2648e4));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 118f92d..52fe884 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x232e60,_0x558b4e){var _0xfdb818=function(_0x3f453d){while(--_0x3f453d){_0x232e60['push'](_0x232e60['shift']());}};_0xfdb818(++_0x558b4e);}(_0x5c3c,0x132));var _0xc5c3=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x5c3c[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var fs_extra=require(_0xc5c3('0x5'));var auth=require(_0xc5c3('0x6'));var interaction=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var controller=require(_0xc5c3('0x9'));router[_0xc5c3('0xa')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xa')]('/:id',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xe')]);router['get'](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller['getDispositions']);router[_0xc5c3('0xa')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['getAnswers']);router[_0xc5c3('0xa')](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x12')]);router[_0xc5c3('0xa')](_0xc5c3('0x13'),auth['isAuthenticated'](),controller[_0xc5c3('0x14')]);router[_0xc5c3('0x15')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x16')]);router[_0xc5c3('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc5c3('0x17')]);router[_0xc5c3('0x15')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['addAnswer']);router['post'](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x18')]);router[_0xc5c3('0x15')](_0xc5c3('0x13'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x19')]);router['post'](_0xc5c3('0x1a'),controller[_0xc5c3('0x1b')]);router[_0xc5c3('0x15')](_0xc5c3('0x1c'),auth['isAuthenticated'](),controller[_0xc5c3('0x1d')]);router[_0xc5c3('0x1e')](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x20')]);router['delete'](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x21')]);router[_0xc5c3('0x22')](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x23')]);router['delete']('/:id/canned_answers',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x24')]);router['delete']('/:id/users',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x25')]);module[_0xc5c3('0x26')]=router; \ No newline at end of file +var _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x4c6109,_0x398504){var _0xc9384b=function(_0x2381af){while(--_0x2381af){_0x4c6109['push'](_0x4c6109['shift']());}};_0xc9384b(++_0x398504);}(_0x2a07,0x74));var _0x72a0=function(_0x575446,_0x1a13fa){_0x575446=_0x575446-0x0;var _0x2fb644=_0x2a07[_0x575446];return _0x2fb644;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['get'](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller['getDispositions']);router[_0x72a0('0xa')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x13')]);router[_0x72a0('0xa')]('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x14')]);router[_0x72a0('0xa')](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x16')]);router[_0x72a0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x72a0('0x17')](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x18')]);router[_0x72a0('0x17')](_0x72a0('0x12'),auth['isAuthenticated'](),controller[_0x72a0('0x19')]);router[_0x72a0('0x17')](_0x72a0('0x1a'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1b')]);router['post'](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1c')]);router['post'](_0x72a0('0x1d'),controller[_0x72a0('0x1e')]);router[_0x72a0('0x17')](_0x72a0('0x1f'),auth['isAuthenticated'](),controller[_0x72a0('0x20')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x21')]);router['delete'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x22')]);router[_0x72a0('0x23')]('/:id/dispositions',auth[_0x72a0('0xb')](),controller[_0x72a0('0x24')]);router[_0x72a0('0x23')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x25')]);router['delete']('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x26')]);module[_0x72a0('0x27')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 312d38f..ddadf09 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ae2=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1275b0,_0x3b7d7d){var _0x409ba5=function(_0x476df7){while(--_0x476df7){_0x1275b0['push'](_0x1275b0['shift']());}};_0x409ba5(++_0x3b7d7d);}(_0x3ae2,0x1d4));var _0x23ae=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x3ae2[_0xc77819];return _0x1c9434;};'use strict';var Sequelize=require(_0x23ae('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x23ae('0x1')],'unique':_0x23ae('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x23ae('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x23ae('0x1')],'defaultValue':function(){return rs[_0x23ae('0x3')]();}},'phone':{'type':Sequelize[_0x23ae('0x1')]},'type':{'type':Sequelize[_0x23ae('0x4')](_0x23ae('0x5'),_0x23ae('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x23ae('0x1')]},'notificationTemplate':{'type':Sequelize[_0x23ae('0x7')],'defaultValue':function(){return _0x23ae('0x8');}},'notificationSound':{'type':Sequelize[_0x23ae('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x23ae('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x23ae('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x23ae('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x23ae('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x23ae('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x23ae('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x23ae('0x9')],'defaultValue':![],'comment':_0x23ae('0xc'),'set':function(_0x15ad6f){if(!_0x15ad6f){this[_0x23ae('0xd')](_0x23ae('0xe'),null);}this[_0x23ae('0xd')]('mandatoryDisposition',_0x15ad6f);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x03a3=['name','generate','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING'];(function(_0x10a12a,_0xee7529){var _0x1905af=function(_0x41c8b4){while(--_0x41c8b4){_0x10a12a['push'](_0x10a12a['shift']());}};_0x1905af(++_0xee7529);}(_0x03a3,0x14e));var _0x303a=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x03a3[_0x5806c3];return _0x48ac77;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x303a('0x0')]={'name':{'type':Sequelize[_0x303a('0x1')],'unique':_0x303a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x303a('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x303a('0x1')],'defaultValue':function(){return rs[_0x303a('0x3')]();}},'phone':{'type':Sequelize[_0x303a('0x1')]},'type':{'type':Sequelize['ENUM']('twilio',_0x303a('0x4'))},'accountSid':{'type':Sequelize[_0x303a('0x1')]},'baseUrl':{'type':Sequelize[_0x303a('0x1')]},'authToken':{'type':Sequelize[_0x303a('0x1')]},'notificationTemplate':{'type':Sequelize[_0x303a('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x303a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x303a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x303a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x303a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x303a('0x7')],'comment':_0x303a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4ce51b){if(!_0x4ce51b){this[_0x303a('0x9')](_0x303a('0xa'),null);}this['setDataValue'](_0x303a('0xb'),_0x4ce51b);}},'description':{'type':Sequelize[_0x303a('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 510f158..e9e4ec6 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fae=['body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappAccount','include','rows','show','params','intersection','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','userProfileId','autoAssociation','update','describe','WhatsappAccountId','Disposition','getDispositions','findOne','order','filters','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','orderBy','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','messageId','notifications','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','updatedAt','DESC','list','Contacts','WhatsappInteraction','interaction','autoclose','applications','push','*,*,*,*','created','WhatsappMessage','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a'];(function(_0x80da37,_0x28b1f0){var _0x6578f6=function(_0x2bfd24){while(--_0x2bfd24){_0x80da37['push'](_0x80da37['shift']());}};_0x6578f6(++_0x28b1f0);}(_0x1fae,0xc8));var _0xe1fa=function(_0x29b915,_0x39998e){_0x29b915=_0x29b915-0x0;var _0x2af5e3=_0x1fae[_0x29b915];return _0x2af5e3;};'use strict';var emlformat=require(_0xe1fa('0x0'));var rimraf=require(_0xe1fa('0x1'));var zipdir=require(_0xe1fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe1fa('0x3'));var BPromise=require(_0xe1fa('0x4'));var Mustache=require(_0xe1fa('0x5'));var util=require(_0xe1fa('0x6'));var path=require(_0xe1fa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe1fa('0x8'));var fs=require('fs');var fs_extra=require(_0xe1fa('0x9'));var _=require('lodash');var squel=require(_0xe1fa('0xa'));var crypto=require(_0xe1fa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe1fa('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe1fa('0xd'));var Papa=require(_0xe1fa('0xe'));var Redis=require(_0xe1fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe1fa('0x10'));var as=require(_0xe1fa('0x11'));var hardwareService=require(_0xe1fa('0x12'));var logger=require('../../config/logger')(_0xe1fa('0x13'));var utils=require(_0xe1fa('0x14'));var config=require(_0xe1fa('0x15'));var licenseUtil=require(_0xe1fa('0x16'));var db=require(_0xe1fa('0x17'))['db'];config[_0xe1fa('0x18')]=_[_0xe1fa('0x19')](config[_0xe1fa('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1fa('0x1a'))(new Redis(config[_0xe1fa('0x18')]));require(_0xe1fa('0x1b'))['register'](socket);var jayson=require(_0xe1fa('0x1c'));var client=jayson[_0xe1fa('0x1d')][_0xe1fa('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2679c8,_0x4ee18c,_0x37f41c,_0x28e43f){return new BPromise(function(_0x8e4920,_0xc6e4e){var _0x263404=_0x28e43f||client;return _0x263404[_0xe1fa('0x1f')](_0x2679c8,_0x37f41c)['then'](function(_0x20f122){logger['info'](_0xe1fa('0x20'),_0x4ee18c,_0xe1fa('0x21'));logger[_0xe1fa('0x22')](_0xe1fa('0x23'),_0x4ee18c,_0xe1fa('0x21'),JSON[_0xe1fa('0x24')](_0x20f122));if(_0x20f122['error']){if(_0x20f122[_0xe1fa('0x25')][_0xe1fa('0x26')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4ee18c,_0x20f122[_0xe1fa('0x25')][_0xe1fa('0x27')]);return _0xc6e4e(_0x20f122[_0xe1fa('0x25')][_0xe1fa('0x27')]);}logger[_0xe1fa('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x4ee18c,_0x20f122[_0xe1fa('0x25')][_0xe1fa('0x27')]);return _0x8e4920(_0x20f122[_0xe1fa('0x25')][_0xe1fa('0x27')]);}else{logger[_0xe1fa('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x4ee18c,_0xe1fa('0x21'));_0x8e4920(_0x20f122[_0xe1fa('0x29')][_0xe1fa('0x27')]);}})[_0xe1fa('0x2a')](function(_0x46a75d){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4ee18c,_0x46a75d);_0xc6e4e(_0x46a75d);});});}function respondWithStatusCode(_0xe77418,_0x322e07){_0x322e07=_0x322e07||0xcc;return function(_0x2ceda0){if(_0x2ceda0){return _0xe77418[_0xe1fa('0x2b')](_0x322e07);}return _0xe77418['status'](_0x322e07)[_0xe1fa('0x2c')]();};}function respondWithResult(_0x5cbfa2,_0xe12fe9){_0xe12fe9=_0xe12fe9||0xc8;return function(_0x1090ba){if(_0x1090ba){return _0x5cbfa2[_0xe1fa('0x2d')](_0xe12fe9)[_0xe1fa('0x2e')](_0x1090ba);}};}function respondWithFilteredResult(_0x5ecf91,_0x41918e){return function(_0xba3e5a){if(_0xba3e5a){var _0x52c3ef=typeof _0x41918e['offset']==='undefined'&&typeof _0x41918e[_0xe1fa('0x2f')]===_0xe1fa('0x30');var _0x5cd168=_0xba3e5a[_0xe1fa('0x31')];var _0x25cb61=_0x52c3ef?0x0:_0x41918e[_0xe1fa('0x32')];var _0x417e3d=_0x52c3ef?_0xba3e5a[_0xe1fa('0x31')]:_0x41918e[_0xe1fa('0x32')]+_0x41918e[_0xe1fa('0x2f')];var _0x4aae67;if(_0x417e3d>=_0x5cd168){_0x417e3d=_0x5cd168;_0x4aae67=0xc8;}else{_0x4aae67=0xce;}_0x5ecf91[_0xe1fa('0x2d')](_0x4aae67);return _0x5ecf91[_0xe1fa('0x33')](_0xe1fa('0x34'),_0x25cb61+'-'+_0x417e3d+'/'+_0x5cd168)[_0xe1fa('0x2e')](_0xba3e5a);}return null;};}function patchUpdates(_0x59d822){return function(_0xd1fd64){try{jsonpatch['apply'](_0xd1fd64,_0x59d822,!![]);}catch(_0x195647){return BPromise[_0xe1fa('0x35')](_0x195647);}return _0xd1fd64[_0xe1fa('0x36')]();};}function saveUpdates(_0x2251b0,_0x2f3b49){return function(_0x1b564f){if(_0x1b564f){return _0x1b564f['update'](_0x2251b0)[_0xe1fa('0x37')](function(_0xd99977){return _0xd99977;});}return null;};}function removeEntity(_0x111104,_0x366834){return function(_0x23c570){if(_0x23c570){return _0x23c570[_0xe1fa('0x38')]()[_0xe1fa('0x37')](function(){var _0x22b3ad=_0x23c570['get']({'plain':!![]});var _0x24c891='WhatsappAccounts';return db[_0xe1fa('0x39')][_0xe1fa('0x38')]({'where':{'type':_0x24c891,'resourceId':_0x22b3ad['id']}})['then'](function(){return _0x23c570;});})['then'](function(){_0x111104[_0xe1fa('0x2d')](0xcc)[_0xe1fa('0x2c')]();});}};}function handleEntityNotFound(_0x223caf,_0x2c75f8){return function(_0x578ef4){if(!_0x578ef4){_0x223caf[_0xe1fa('0x2b')](0x194);}return _0x578ef4;};}function handleError(_0x1f1a6d,_0x79bc1){_0x79bc1=_0x79bc1||0x1f4;return function(_0x1f76c5){logger[_0xe1fa('0x25')](_0x1f76c5[_0xe1fa('0x3a')]);if(_0x1f76c5[_0xe1fa('0x3b')]){delete _0x1f76c5[_0xe1fa('0x3b')];}_0x1f1a6d[_0xe1fa('0x2d')](_0x79bc1)['send'](_0x1f76c5);};}exports[_0xe1fa('0x3c')]=function(_0x17faa6,_0x127f3c){var _0x2a05f1={'include':[{'model':db[_0xe1fa('0x3d')],'as':_0xe1fa('0x3e')}]},_0x4f3a23={},_0x12422d={'count':0x0,'rows':[]};var _0x3ed46a=_[_0xe1fa('0x3f')](db['WhatsappAccount'][_0xe1fa('0x40')],function(_0x36eb7b){return{'name':_0x36eb7b['fieldName'],'type':_0x36eb7b[_0xe1fa('0x41')][_0xe1fa('0x42')]};});_0x4f3a23['model']=_[_0xe1fa('0x3f')](_0x3ed46a,_0xe1fa('0x3b'));_0x4f3a23[_0xe1fa('0x43')]=_[_0xe1fa('0x44')](_0x17faa6[_0xe1fa('0x43')]);_0x4f3a23['filters']=_['intersection'](_0x4f3a23['model'],_0x4f3a23[_0xe1fa('0x43')]);_0x2a05f1[_0xe1fa('0x45')]=_['intersection'](_0x4f3a23[_0xe1fa('0x46')],qs[_0xe1fa('0x47')](_0x17faa6[_0xe1fa('0x43')][_0xe1fa('0x47')]));_0x2a05f1[_0xe1fa('0x45')]=_0x2a05f1[_0xe1fa('0x45')][_0xe1fa('0x48')]?_0x2a05f1[_0xe1fa('0x45')]:_0x4f3a23[_0xe1fa('0x46')];if(!_0x17faa6[_0xe1fa('0x43')][_0xe1fa('0x49')](_0xe1fa('0x4a'))){_0x2a05f1[_0xe1fa('0x2f')]=qs['limit'](_0x17faa6[_0xe1fa('0x43')]['limit']);_0x2a05f1[_0xe1fa('0x32')]=qs[_0xe1fa('0x32')](_0x17faa6[_0xe1fa('0x43')][_0xe1fa('0x32')]);}_0x2a05f1['order']=qs[_0xe1fa('0x4b')](_0x17faa6[_0xe1fa('0x43')][_0xe1fa('0x4b')]);_0x2a05f1[_0xe1fa('0x4c')]=qs['filters'](_[_0xe1fa('0x4d')](_0x17faa6['query'],_0x4f3a23['filters']),_0x3ed46a);if(_0x17faa6[_0xe1fa('0x43')][_0xe1fa('0x4e')]){_0x2a05f1['where']=_[_0xe1fa('0x4f')](_0x2a05f1[_0xe1fa('0x4c')],{'$or':_[_0xe1fa('0x3f')](_0x3ed46a,function(_0x36e00b){if(_0x36e00b['type']!==_0xe1fa('0x50')){var _0x2ef26e={};_0x2ef26e[_0x36e00b['name']]={'$like':'%'+_0x17faa6[_0xe1fa('0x43')][_0xe1fa('0x4e')]+'%'};return _0x2ef26e;}})});}_0x2a05f1=_[_0xe1fa('0x4f')]({},_0x2a05f1,_0x17faa6[_0xe1fa('0x51')]);var _0xdf9d4d={'where':_0x2a05f1[_0xe1fa('0x4c')]};return db[_0xe1fa('0x52')]['count'](_0xdf9d4d)['then'](function(_0x2d67fb){_0x12422d[_0xe1fa('0x31')]=_0x2d67fb;if(_0x17faa6['query']['includeAll']){_0x2a05f1[_0xe1fa('0x53')]=[{'all':!![]}];}return db[_0xe1fa('0x52')]['findAll'](_0x2a05f1);})[_0xe1fa('0x37')](function(_0x3989ce){_0x12422d[_0xe1fa('0x54')]=_0x3989ce;return _0x12422d;})[_0xe1fa('0x37')](respondWithFilteredResult(_0x127f3c,_0x2a05f1))['catch'](handleError(_0x127f3c,null));};exports[_0xe1fa('0x55')]=function(_0x4971a0,_0x13225f){var _0x4d8182={'raw':![],'where':{'id':_0x4971a0[_0xe1fa('0x56')]['id']},'include':[{'model':db[_0xe1fa('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3b941a={};_0x3b941a[_0xe1fa('0x46')]=_[_0xe1fa('0x44')](db[_0xe1fa('0x52')]['rawAttributes']);_0x3b941a[_0xe1fa('0x43')]=_[_0xe1fa('0x44')](_0x4971a0[_0xe1fa('0x43')]);_0x3b941a['filters']=_[_0xe1fa('0x57')](_0x3b941a[_0xe1fa('0x46')],_0x3b941a[_0xe1fa('0x43')]);_0x4d8182[_0xe1fa('0x45')]=_[_0xe1fa('0x57')](_0x3b941a[_0xe1fa('0x46')],qs[_0xe1fa('0x47')](_0x4971a0[_0xe1fa('0x43')][_0xe1fa('0x47')]));_0x4d8182[_0xe1fa('0x45')]=_0x4d8182[_0xe1fa('0x45')][_0xe1fa('0x48')]?_0x4d8182[_0xe1fa('0x45')]:_0x3b941a[_0xe1fa('0x46')];if(_0x4971a0[_0xe1fa('0x43')][_0xe1fa('0x58')]){_0x4d8182[_0xe1fa('0x53')]=[{'all':!![]}];}_0x4d8182=_[_0xe1fa('0x4f')]({},_0x4d8182,_0x4971a0[_0xe1fa('0x51')]);return db[_0xe1fa('0x52')][_0xe1fa('0x59')](_0x4d8182)[_0xe1fa('0x37')](handleEntityNotFound(_0x13225f,null))[_0xe1fa('0x37')](respondWithResult(_0x13225f,null))[_0xe1fa('0x2a')](handleError(_0x13225f,null));};exports[_0xe1fa('0x5a')]=function(_0x503e4e,_0x48bea2){return db[_0xe1fa('0x52')]['create'](_0x503e4e[_0xe1fa('0x5b')],{})[_0xe1fa('0x37')](function(_0x1aacd3){var _0x550fd7=_0x503e4e['user'][_0xe1fa('0x5c')]({'plain':!![]});if(!_0x550fd7)throw new Error(_0xe1fa('0x5d'));if(_0x550fd7[_0xe1fa('0x5e')]===_0xe1fa('0x5f')){var _0xd1313e=_0x1aacd3[_0xe1fa('0x5c')]({'plain':!![]});var _0x2d61a1=_0xe1fa('0x60');return db['UserProfileSection']['find']({'where':{'name':_0x2d61a1,'userProfileId':_0x550fd7[_0xe1fa('0x61')]},'raw':!![]})['then'](function(_0x29c48a){if(_0x29c48a&&_0x29c48a[_0xe1fa('0x62')]===0x0){return db['UserProfileResource'][_0xe1fa('0x5a')]({'name':_0xd1313e[_0xe1fa('0x3b')],'resourceId':_0xd1313e['id'],'type':_0x29c48a[_0xe1fa('0x3b')],'sectionId':_0x29c48a['id']},{})[_0xe1fa('0x37')](function(){return _0x1aacd3;});}else{return _0x1aacd3;}})[_0xe1fa('0x2a')](function(_0x5ee079){logger[_0xe1fa('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee079);throw _0x5ee079;});}return _0x1aacd3;})[_0xe1fa('0x37')](respondWithResult(_0x48bea2,0xc9))['catch'](handleError(_0x48bea2,null));};exports[_0xe1fa('0x63')]=function(_0x6da2ca,_0x3e4dd3){if(_0x6da2ca[_0xe1fa('0x5b')]['id']){delete _0x6da2ca[_0xe1fa('0x5b')]['id'];}return db[_0xe1fa('0x52')][_0xe1fa('0x59')]({'where':{'id':_0x6da2ca[_0xe1fa('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xe1fa('0x37')](handleEntityNotFound(_0x3e4dd3,null))['then'](saveUpdates(_0x6da2ca[_0xe1fa('0x5b')],null))['then'](respondWithResult(_0x3e4dd3,null))[_0xe1fa('0x2a')](handleError(_0x3e4dd3,null));};exports[_0xe1fa('0x38')]=function(_0x48e055,_0x1e5d40){return db[_0xe1fa('0x52')][_0xe1fa('0x59')]({'where':{'id':_0x48e055['params']['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x1e5d40,null))[_0xe1fa('0x37')](removeEntity(_0x1e5d40,null))[_0xe1fa('0x2a')](handleError(_0x1e5d40,null));};exports[_0xe1fa('0x64')]=function(_0x1c73a0,_0x10e3cc){return db[_0xe1fa('0x52')][_0xe1fa('0x64')]()[_0xe1fa('0x37')](respondWithResult(_0x10e3cc,null))['catch'](handleError(_0x10e3cc,null));};exports['addDisposition']=function(_0xd809fa,_0x1dbe98,_0x5dc563){if(_0xd809fa[_0xe1fa('0x5b')]['id']){delete _0xd809fa[_0xe1fa('0x5b')]['id'];}return db['WhatsappAccount'][_0xe1fa('0x59')]({'where':{'id':_0xd809fa[_0xe1fa('0x56')]['id']}})['then'](handleEntityNotFound(_0x1dbe98,null))[_0xe1fa('0x37')](function(_0x47544e){if(_0x47544e){_0xd809fa[_0xe1fa('0x5b')][_0xe1fa('0x65')]=_0x47544e['id'];return db[_0xe1fa('0x66')][_0xe1fa('0x5a')](_0xd809fa[_0xe1fa('0x5b')]);}})['then'](respondWithResult(_0x1dbe98,null))[_0xe1fa('0x2a')](handleError(_0x1dbe98,null));};exports[_0xe1fa('0x67')]=function(_0x3d04bf,_0x183195,_0xdd44fd){var _0x530848={'raw':![],'where':{}};var _0x37968b={};var _0xaa07={'count':0x0,'rows':[]};return db[_0xe1fa('0x52')][_0xe1fa('0x68')]({'where':{'id':_0x3d04bf[_0xe1fa('0x56')]['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x183195,null))[_0xe1fa('0x37')](function(_0x405e40){if(_0x405e40){_0x37968b[_0xe1fa('0x46')]=_[_0xe1fa('0x44')](db[_0xe1fa('0x66')]['rawAttributes']);_0x37968b[_0xe1fa('0x43')]=_[_0xe1fa('0x44')](_0x3d04bf[_0xe1fa('0x43')]);_0x37968b['filters']=_[_0xe1fa('0x57')](_0x37968b[_0xe1fa('0x46')],_0x37968b[_0xe1fa('0x43')]);_0x530848[_0xe1fa('0x45')]=_[_0xe1fa('0x57')](_0x37968b['model'],qs[_0xe1fa('0x47')](_0x3d04bf[_0xe1fa('0x43')][_0xe1fa('0x47')]));_0x530848[_0xe1fa('0x45')]=_0x530848[_0xe1fa('0x45')][_0xe1fa('0x48')]?_0x530848[_0xe1fa('0x45')]:_0x37968b[_0xe1fa('0x46')];if(!_0x3d04bf['query'][_0xe1fa('0x49')](_0xe1fa('0x4a'))){_0x530848[_0xe1fa('0x2f')]=qs['limit'](_0x3d04bf[_0xe1fa('0x43')][_0xe1fa('0x2f')]);_0x530848[_0xe1fa('0x32')]=qs[_0xe1fa('0x32')](_0x3d04bf[_0xe1fa('0x43')]['offset']);}_0x530848[_0xe1fa('0x69')]=qs['sort'](_0x3d04bf['query'][_0xe1fa('0x4b')]);_0x530848[_0xe1fa('0x4c')]=qs[_0xe1fa('0x6a')](_[_0xe1fa('0x4d')](_0x3d04bf[_0xe1fa('0x43')],_0x37968b[_0xe1fa('0x6a')]));_0x530848[_0xe1fa('0x4c')][_0xe1fa('0x65')]=_0x405e40['id'];if(_0x3d04bf[_0xe1fa('0x43')][_0xe1fa('0x4e')]){_0x530848[_0xe1fa('0x4c')]=_[_0xe1fa('0x4f')](_0x530848[_0xe1fa('0x4c')],{'$or':_[_0xe1fa('0x3f')](_0x530848[_0xe1fa('0x45')],function(_0x509197){var _0x4860ef={};_0x4860ef[_0x509197]={'$like':'%'+_0x3d04bf['query'][_0xe1fa('0x4e')]+'%'};return _0x4860ef;})});}_0x530848=_[_0xe1fa('0x4f')]({},_0x530848,_0x3d04bf['options']);return db[_0xe1fa('0x66')]['count']({'where':_0x530848[_0xe1fa('0x4c')]})['then'](function(_0x339b41){_0xaa07[_0xe1fa('0x31')]=_0x339b41;if(_0x3d04bf[_0xe1fa('0x43')][_0xe1fa('0x58')]){_0x530848['include']=[{'all':!![]}];}return db[_0xe1fa('0x66')][_0xe1fa('0x6b')](_0x530848);})['then'](function(_0x18e7cc){_0xaa07[_0xe1fa('0x54')]=_0x18e7cc;return _0xaa07;});}})[_0xe1fa('0x37')](respondWithFilteredResult(_0x183195,_0x530848))[_0xe1fa('0x2a')](handleError(_0x183195,null));};exports[_0xe1fa('0x6c')]=function(_0x19dca2,_0x286a08,_0x3ec555){return db[_0xe1fa('0x52')][_0xe1fa('0x59')]({'where':{'id':_0x19dca2['params']['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x286a08,null))[_0xe1fa('0x37')](function(_0x13e7df){if(_0x13e7df){return _0x13e7df['removeDispositions'](_0x19dca2[_0xe1fa('0x43')][_0xe1fa('0x6d')]);}})[_0xe1fa('0x37')](respondWithStatusCode(_0x286a08,null))[_0xe1fa('0x2a')](handleError(_0x286a08,null));};exports[_0xe1fa('0x6e')]=function(_0x43375d,_0x133f3b,_0x34a738){if(_0x43375d[_0xe1fa('0x5b')]['id']){delete _0x43375d[_0xe1fa('0x5b')]['id'];}return db[_0xe1fa('0x52')][_0xe1fa('0x59')]({'where':{'id':_0x43375d['params']['id']}})['then'](handleEntityNotFound(_0x133f3b,null))[_0xe1fa('0x37')](function(_0x2f1b01){if(_0x2f1b01){_0x43375d[_0xe1fa('0x5b')][_0xe1fa('0x65')]=_0x2f1b01['id'];return db['CannedAnswer'][_0xe1fa('0x5a')](_0x43375d[_0xe1fa('0x5b')]);}})['then'](respondWithResult(_0x133f3b,null))['catch'](handleError(_0x133f3b,null));};exports[_0xe1fa('0x6f')]=function(_0x2f2045,_0xc8291,_0x2e1151){var _0x248805={'raw':![],'where':{}};var _0x2056a5={};var _0x71760f={'count':0x0,'rows':[]};return db[_0xe1fa('0x52')][_0xe1fa('0x68')]({'where':{'id':_0x2f2045[_0xe1fa('0x56')]['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0xc8291,null))[_0xe1fa('0x37')](function(_0x179ba2){if(_0x179ba2){_0x2056a5['model']=_['keys'](db[_0xe1fa('0x70')][_0xe1fa('0x40')]);_0x2056a5[_0xe1fa('0x43')]=_[_0xe1fa('0x44')](_0x2f2045['query']);_0x2056a5[_0xe1fa('0x6a')]=_['intersection'](_0x2056a5[_0xe1fa('0x46')],_0x2056a5[_0xe1fa('0x43')]);_0x248805[_0xe1fa('0x45')]=_[_0xe1fa('0x57')](_0x2056a5['model'],qs[_0xe1fa('0x47')](_0x2f2045['query'][_0xe1fa('0x47')]));_0x248805['attributes']=_0x248805[_0xe1fa('0x45')]['length']?_0x248805[_0xe1fa('0x45')]:_0x2056a5[_0xe1fa('0x46')];if(!_0x2f2045['query'][_0xe1fa('0x49')](_0xe1fa('0x4a'))){_0x248805['limit']=qs[_0xe1fa('0x2f')](_0x2f2045[_0xe1fa('0x43')][_0xe1fa('0x2f')]);_0x248805[_0xe1fa('0x32')]=qs[_0xe1fa('0x32')](_0x2f2045[_0xe1fa('0x43')][_0xe1fa('0x32')]);}_0x248805[_0xe1fa('0x69')]=qs[_0xe1fa('0x4b')](_0x2f2045[_0xe1fa('0x43')][_0xe1fa('0x4b')]);_0x248805[_0xe1fa('0x4c')]=qs[_0xe1fa('0x6a')](_[_0xe1fa('0x4d')](_0x2f2045[_0xe1fa('0x43')],_0x2056a5[_0xe1fa('0x6a')]));_0x248805[_0xe1fa('0x4c')][_0xe1fa('0x65')]=_0x179ba2['id'];if(_0x2f2045[_0xe1fa('0x43')][_0xe1fa('0x4e')]){_0x248805['where']=_[_0xe1fa('0x4f')](_0x248805[_0xe1fa('0x4c')],{'$or':_[_0xe1fa('0x3f')](_0x248805[_0xe1fa('0x45')],function(_0x40c3eb){var _0x30280c={};_0x30280c[_0x40c3eb]={'$like':'%'+_0x2f2045[_0xe1fa('0x43')]['filter']+'%'};return _0x30280c;})});}_0x248805=_[_0xe1fa('0x4f')]({},_0x248805,_0x2f2045['options']);return db[_0xe1fa('0x70')]['count']({'where':_0x248805[_0xe1fa('0x4c')]})[_0xe1fa('0x37')](function(_0x504df7){_0x71760f[_0xe1fa('0x31')]=_0x504df7;if(_0x2f2045[_0xe1fa('0x43')]['includeAll']){_0x248805[_0xe1fa('0x53')]=[{'all':!![]}];}return db[_0xe1fa('0x70')][_0xe1fa('0x6b')](_0x248805);})[_0xe1fa('0x37')](function(_0x7a1881){_0x71760f[_0xe1fa('0x54')]=_0x7a1881;return _0x71760f;});}})['then'](respondWithFilteredResult(_0xc8291,_0x248805))['catch'](handleError(_0xc8291,null));};exports['removeAnswers']=function(_0x5ed122,_0xc1155f,_0x40fb9a){return db['WhatsappAccount'][_0xe1fa('0x59')]({'where':{'id':_0x5ed122[_0xe1fa('0x56')]['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0xc1155f,null))[_0xe1fa('0x37')](function(_0x228b15){if(_0x228b15){return _0x228b15[_0xe1fa('0x71')](_0x5ed122[_0xe1fa('0x43')]['ids']);}})['then'](respondWithStatusCode(_0xc1155f,null))[_0xe1fa('0x2a')](handleError(_0xc1155f,null));};exports['addAgents']=function(_0x266203,_0x1b8d3d,_0xd87221){return db[_0xe1fa('0x52')][_0xe1fa('0x59')]({'where':{'id':_0x266203['params']['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x1b8d3d,null))[_0xe1fa('0x37')](function(_0x1da520){if(_0x1da520){return _0x1da520[_0xe1fa('0x72')](_0x266203['body']['ids'],_[_0xe1fa('0x73')](_0x266203[_0xe1fa('0x5b')],[_0xe1fa('0x6d'),'id'])||{})[_0xe1fa('0x74')](function(_0x12386a){for(var _0x175201=0x0;_0x175201<_0x266203[_0xe1fa('0x5b')][_0xe1fa('0x6d')][_0xe1fa('0x48')];_0x175201+=0x1){socket[_0xe1fa('0x75')]('userWhatsappAccount:save',{'UserId':Number(_0x266203[_0xe1fa('0x5b')]['ids'][_0x175201]),'WhatsappAccountId':Number(_0x266203['params']['id'])});}return _0x12386a;});}})[_0xe1fa('0x37')](respondWithResult(_0x1b8d3d,null))[_0xe1fa('0x2a')](handleError(_0x1b8d3d,null));};exports[_0xe1fa('0x76')]=function(_0x153d17,_0x474f08,_0x2660eb){return db['WhatsappAccount'][_0xe1fa('0x59')]({'where':{'id':_0x153d17[_0xe1fa('0x56')]['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x474f08,null))[_0xe1fa('0x37')](function(_0x2f6fc0){if(_0x2f6fc0){return _0x2f6fc0['removeAgents'](_0x153d17[_0xe1fa('0x43')][_0xe1fa('0x6d')])[_0xe1fa('0x37')](function(){if(_[_0xe1fa('0x77')](_0x153d17[_0xe1fa('0x43')][_0xe1fa('0x6d')])){for(var _0x10fa46=0x0;_0x10fa46<_0x153d17[_0xe1fa('0x43')]['ids'][_0xe1fa('0x48')];_0x10fa46+=0x1){socket[_0xe1fa('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x153d17[_0xe1fa('0x43')][_0xe1fa('0x6d')][_0x10fa46]),'WhatsappAccountId':Number(_0x153d17[_0xe1fa('0x56')]['id'])});}}else{socket[_0xe1fa('0x75')](_0xe1fa('0x78'),{'UserId':Number(_0x153d17[_0xe1fa('0x43')][_0xe1fa('0x6d')]),'WhatsappAccountId':Number(_0x153d17['params']['id'])});}});}})[_0xe1fa('0x37')](respondWithStatusCode(_0x474f08,null))[_0xe1fa('0x2a')](handleError(_0x474f08,null));};exports[_0xe1fa('0x79')]=function(_0x56366f,_0x5d2e60,_0x215031){var _0x440eea={};var _0x43c20b={};var _0x417829;var _0x41a327;return db[_0xe1fa('0x52')][_0xe1fa('0x68')]({'where':{'id':_0x56366f[_0xe1fa('0x56')]['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x5d2e60,null))[_0xe1fa('0x37')](function(_0x450e2f){if(_0x450e2f){_0x417829=_0x450e2f;_0x43c20b['model']=_['keys'](db[_0xe1fa('0x7a')]['rawAttributes']);_0x43c20b[_0xe1fa('0x43')]=_[_0xe1fa('0x44')](_0x56366f[_0xe1fa('0x43')]);_0x43c20b['filters']=_[_0xe1fa('0x57')](_0x43c20b[_0xe1fa('0x46')],_0x43c20b[_0xe1fa('0x43')]);_0x440eea[_0xe1fa('0x45')]=_[_0xe1fa('0x57')](_0x43c20b[_0xe1fa('0x46')],qs[_0xe1fa('0x47')](_0x56366f[_0xe1fa('0x43')][_0xe1fa('0x47')]));_0x440eea[_0xe1fa('0x45')]=_0x440eea[_0xe1fa('0x45')]['length']?_0x440eea['attributes']:_0x43c20b[_0xe1fa('0x46')];_0x440eea[_0xe1fa('0x69')]=qs['sort'](_0x56366f[_0xe1fa('0x43')][_0xe1fa('0x4b')]);_0x440eea['where']=qs[_0xe1fa('0x6a')](_[_0xe1fa('0x4d')](_0x56366f[_0xe1fa('0x43')],_0x43c20b[_0xe1fa('0x6a')]));if(_0x56366f[_0xe1fa('0x43')][_0xe1fa('0x4e')]){_0x440eea[_0xe1fa('0x4c')]=_[_0xe1fa('0x4f')](_0x440eea[_0xe1fa('0x4c')],{'$or':_[_0xe1fa('0x3f')](_0x440eea['attributes'],function(_0x34e6a9){var _0x27f80b={};_0x27f80b[_0x34e6a9]={'$like':'%'+_0x56366f[_0xe1fa('0x43')][_0xe1fa('0x4e')]+'%'};return _0x27f80b;})});}_0x440eea=_['merge']({},_0x440eea,_0x56366f[_0xe1fa('0x51')]);return _0x417829[_0xe1fa('0x79')](_0x440eea);}})[_0xe1fa('0x37')](function(_0x442006){if(_0x442006){_0x41a327=_0x442006[_0xe1fa('0x48')];if(!_0x56366f['query']['hasOwnProperty']('nolimit')){_0x440eea[_0xe1fa('0x2f')]=qs[_0xe1fa('0x2f')](_0x56366f[_0xe1fa('0x43')][_0xe1fa('0x2f')]);_0x440eea[_0xe1fa('0x32')]=qs['offset'](_0x56366f[_0xe1fa('0x43')][_0xe1fa('0x32')]);}return _0x417829[_0xe1fa('0x79')](_0x440eea);}})['then'](function(_0x115a1d){if(_0x115a1d){return _0x115a1d?{'count':_0x41a327,'rows':_0x115a1d}:null;}})['then'](respondWithResult(_0x5d2e60,null))[_0xe1fa('0x2a')](handleError(_0x5d2e60,null));};exports['addApplications']=function(_0x2bb54c,_0x246a77){var _0x1f922a=_0x2bb54c['params']['id'];var _0x42e184=_0x2bb54c[_0xe1fa('0x5b')];var _0x502330=0xc8;var _0x4c3888=null;return db[_0xe1fa('0x7b')][_0xe1fa('0x7c')]({'isolationLevel':db[_0xe1fa('0x7b')][_0xe1fa('0x7d')][_0xe1fa('0x7e')][_0xe1fa('0x7f')]},function(_0x10096f){return db[_0xe1fa('0x52')][_0xe1fa('0x68')]({'where':{'id':_0x1f922a},'transaction':_0x10096f})[_0xe1fa('0x37')](function(_0x16f6ea){if(_0x16f6ea){return db[_0xe1fa('0x80')][_0xe1fa('0x38')]({'where':{'WhatsappAccountId':_0x1f922a},'transaction':_0x10096f})[_0xe1fa('0x37')](function(){var _0xd7c72=_[_0xe1fa('0x3f')](_0x42e184,function(_0x1c0e83){_0x1c0e83['WhatsappAccountId']=_0x1f922a;return _0x1c0e83;});return db['WhatsappApplication'][_0xe1fa('0x81')](_0xd7c72,{'transaction':_0x10096f});});}else{_0x502330=0x194;_0x4c3888=[];}});})[_0xe1fa('0x37')](function(){if(_0x502330!==0x194){return db[_0xe1fa('0x80')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x1f922a},'order':_0xe1fa('0x82')})[_0xe1fa('0x37')](function(_0x2f647f){_0x4c3888=_0x2f647f;});}})[_0xe1fa('0x2a')](function(_0x910954){_0x502330=0x1f4;logger['error'](_0x910954[_0xe1fa('0x3a')]);if(_0x910954['name']){delete _0x910954[_0xe1fa('0x3b')];}_0x4c3888=_0x910954;})['finally'](function(){if(_0x4c3888===null){_0x246a77['sendStatus'](_0x502330);}else{if(_0x502330===0x1f4){_0x246a77[_0xe1fa('0x2d')](_0x502330)[_0xe1fa('0x83')](_0x4c3888);}else{_0x246a77[_0xe1fa('0x2d')](_0x502330)['json'](_0x4c3888);}}});};exports['getApplications']=function(_0x219def,_0x6fff84,_0x1aa82c){var _0x35e35a={};var _0x3e6df9={};var _0x4accc8;var _0x385631;return db[_0xe1fa('0x52')][_0xe1fa('0x68')]({'where':{'id':_0x219def[_0xe1fa('0x56')]['id']}})[_0xe1fa('0x37')](handleEntityNotFound(_0x6fff84,null))[_0xe1fa('0x37')](function(_0x3ca35e){if(_0x3ca35e){_0x4accc8=_0x3ca35e;_0x3e6df9[_0xe1fa('0x46')]=_[_0xe1fa('0x44')](db[_0xe1fa('0x80')][_0xe1fa('0x40')]);_0x3e6df9['query']=_['keys'](_0x219def['query']);_0x3e6df9['filters']=_[_0xe1fa('0x57')](_0x3e6df9[_0xe1fa('0x46')],_0x3e6df9[_0xe1fa('0x43')]);_0x35e35a[_0xe1fa('0x45')]=_[_0xe1fa('0x57')](_0x3e6df9[_0xe1fa('0x46')],qs[_0xe1fa('0x47')](_0x219def[_0xe1fa('0x43')][_0xe1fa('0x47')]));_0x35e35a[_0xe1fa('0x45')]=_0x35e35a[_0xe1fa('0x45')][_0xe1fa('0x48')]?_0x35e35a[_0xe1fa('0x45')]:_0x3e6df9[_0xe1fa('0x46')];_0x35e35a['order']=qs[_0xe1fa('0x4b')](_0x219def[_0xe1fa('0x43')][_0xe1fa('0x4b')]);_0x35e35a['where']=qs['filters'](_[_0xe1fa('0x4d')](_0x219def[_0xe1fa('0x43')],_0x3e6df9[_0xe1fa('0x6a')]));if(_0x219def['query'][_0xe1fa('0x4e')]){_0x35e35a['where']=_[_0xe1fa('0x4f')](_0x35e35a[_0xe1fa('0x4c')],{'$or':_[_0xe1fa('0x3f')](_0x35e35a[_0xe1fa('0x45')],function(_0x2a93b0){var _0x37ffd0={};_0x37ffd0[_0x2a93b0]={'$like':'%'+_0x219def[_0xe1fa('0x43')]['filter']+'%'};return _0x37ffd0;})});}_0x35e35a=_[_0xe1fa('0x4f')]({},_0x35e35a,_0x219def[_0xe1fa('0x51')]);return _0x4accc8[_0xe1fa('0x84')](_0x35e35a);}})[_0xe1fa('0x37')](function(_0x401536){if(_0x401536){_0x385631=_0x401536[_0xe1fa('0x48')];if(!_0x219def[_0xe1fa('0x43')][_0xe1fa('0x49')]('nolimit')){_0x35e35a[_0xe1fa('0x2f')]=qs[_0xe1fa('0x2f')](_0x219def[_0xe1fa('0x43')][_0xe1fa('0x2f')]);_0x35e35a['offset']=qs[_0xe1fa('0x32')](_0x219def[_0xe1fa('0x43')][_0xe1fa('0x32')]);}return _0x4accc8['getApplications'](_0x35e35a);}})['then'](function(_0x339633){if(_0x339633){return _0x339633?{'count':_0x385631,'rows':_0x339633}:null;}})['then'](respondWithResult(_0x6fff84,null))['catch'](handleError(_0x6fff84,null));};exports[_0xe1fa('0x85')]=function(_0x5f7a88,_0x2c418f,_0x311c40){var _0x1a0d89={'channel':_0xe1fa('0x86')};var _0x3866f2=[];var _0x2168f9=[];var _0x55491a={};return db['WhatsappAccount'][_0xe1fa('0x59')]({'where':{'id':_0x5f7a88[_0xe1fa('0x56')]['id']},'include':[{'model':db[_0xe1fa('0x80')],'as':_0xe1fa('0x87')}]})['then'](handleEntityNotFound(_0x2c418f,null))['then'](function(_0x6bab49){_0x1a0d89[_0xe1fa('0x88')]=_0x6bab49;if(_0x1a0d89[_0xe1fa('0x88')]&&_0x1a0d89[_0xe1fa('0x88')][_0xe1fa('0x41')]===_0xe1fa('0x89')&&_0x5f7a88['body'][_0xe1fa('0x8a')]){if(_0x5f7a88[_0xe1fa('0x5b')][_0xe1fa('0x8a')][_0xe1fa('0x48')]===0x0)return;if(_0x5f7a88['body'][_0xe1fa('0x8a')][0x0][_0xe1fa('0x8b')]!==_0xe1fa('0x8c'))return;return db['WhatsappMessage'][_0xe1fa('0x63')]({'read':!![],'readAt':_0x5f7a88['body'][_0xe1fa('0x8a')][0x0][_0xe1fa('0x8d')]},{'where':{'messageId':_0x5f7a88[_0xe1fa('0x5b')][_0xe1fa('0x8a')][0x0][_0xe1fa('0x8e')]},'individualHooks':!![]})[_0xe1fa('0x37')](function(_0x30541f){return _0x2c418f[_0xe1fa('0x2d')](0xc8)[_0xe1fa('0x2e')](_0x30541f);});}_0x1a0d89['applications']=_[_0xe1fa('0x8f')](_0x6bab49[_0xe1fa('0x87')],['priority'],['asc']);if(_0x1a0d89[_0xe1fa('0x88')][_0xe1fa('0x87')]){delete _0x1a0d89[_0xe1fa('0x88')]['Applications'];}return db['CmContact'][_0xe1fa('0x64')]()[_0xe1fa('0x37')](function(_0x381b04){if(!_0x381b04){throw new db[(_0xe1fa('0x90'))][(_0xe1fa('0x91'))](_0xe1fa('0x92'));}_0x3866f2=_[_0xe1fa('0x93')](_[_0xe1fa('0x44')](_0x381b04),[_0xe1fa('0x94'),'updatedAt']);_0x2168f9=_['difference'](_[_0xe1fa('0x44')](_0x381b04),['createdAt','updatedAt',_0xe1fa('0x95'),_0xe1fa('0x96')]);_0x1a0d89[_0xe1fa('0x5b')]={'mapKey':'mobile'};if(_0x1a0d89[_0xe1fa('0x88')]&&_0x1a0d89[_0xe1fa('0x88')][_0xe1fa('0x41')]===_0xe1fa('0x97')){_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0x98')]=_0x5f7a88['body'][_0xe1fa('0x99')][_0xe1fa('0x9a')](_0xe1fa('0x9b'),'');_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0x5b')]=_0x5f7a88[_0xe1fa('0x5b')]['Body'];_0x1a0d89['body'][_0xe1fa('0x9c')]=_0x5f7a88['body']['MessageSid'];}if(_0x1a0d89['account']&&_0x1a0d89['account'][_0xe1fa('0x41')]===_0xe1fa('0x89')){_0x1a0d89['body'][_0xe1fa('0x98')]=_0x5f7a88[_0xe1fa('0x5b')][_0xe1fa('0x9d')][0x0][_0xe1fa('0x98')];_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0x5b')]=_0x5f7a88[_0xe1fa('0x5b')][_0xe1fa('0x9d')][0x0]['message'][_0xe1fa('0x5b')];_0x1a0d89[_0xe1fa('0x5b')]['messageId']=_0x5f7a88[_0xe1fa('0x5b')]['notifications'][0x0][_0xe1fa('0x8e')];}if(_0x1a0d89['body']['id']){delete _0x1a0d89[_0xe1fa('0x5b')]['id'];}if(_[_0xe1fa('0x9e')](_0x1a0d89[_0xe1fa('0x5b')]['from'])){throw new db[(_0xe1fa('0x90'))][(_0xe1fa('0x91'))](_0xe1fa('0x9f'));}if(_[_0xe1fa('0x9e')](_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0x5b')])||_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0x5b')]===''){throw new db[(_0xe1fa('0x90'))][(_0xe1fa('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1a0d89['body'][_0xe1fa('0xa0')])){throw new db['Sequelize'][(_0xe1fa('0x91'))](_0xe1fa('0xa1')+_0x2168f9);}if(!_[_0xe1fa('0xa2')](_0x2168f9,_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0xa0')])){throw new db[(_0xe1fa('0x90'))][(_0xe1fa('0x91'))](_0xe1fa('0xa3')+_0x2168f9);}_0x55491a[_0x1a0d89['body']['mapKey']]=_0x1a0d89[_0xe1fa('0x5b')]['from'];return db[_0xe1fa('0xa4')][_0xe1fa('0x59')]({'where':{'id':_0x1a0d89[_0xe1fa('0x88')]['ListId']},'include':[{'model':db[_0xe1fa('0xa5')],'as':'Contacts','where':_0x55491a,'limit':0x1,'order':[[_0xe1fa('0xa6'),_0xe1fa('0xa7')]]}]});})['then'](handleEntityNotFound(_0x2c418f,null))[_0xe1fa('0x37')](function(_0xe44fed){if(_0xe44fed){_0x1a0d89[_0xe1fa('0xa8')]=_[_0xe1fa('0x73')](_0xe44fed,[_0xe1fa('0xa9')]);if(_0xe44fed[_0xe1fa('0xa9')][_0xe1fa('0x48')]){return _0xe44fed['Contacts'][0x0];}var _0xf79857=_[_0xe1fa('0x19')](_0x1a0d89[_0xe1fa('0x5b')],{'firstName':_0x1a0d89[_0xe1fa('0x5b')][_0xe1fa('0x98')],'ListId':_0xe44fed['id']});_0xf79857[_0x1a0d89['body'][_0xe1fa('0xa0')]]=_0x1a0d89[_0xe1fa('0x5b')]['from'];return db[_0xe1fa('0xa5')]['create'](_0xf79857,{'fields':_0x3866f2,'raw':!![]});}})[_0xe1fa('0x37')](handleEntityNotFound(_0x2c418f,null))[_0xe1fa('0x37')](function(_0x42f60a){if(_0x42f60a){_0x1a0d89['contact']=_0x42f60a;var _0x1309b9={'ContactId':_0x42f60a['id'],'phone':_0x1a0d89['body'][_0xe1fa('0x98')],'WhatsappAccountId':_0x5f7a88[_0xe1fa('0x56')]['id']};var _0x12859b={'ContactId':_0x42f60a['id'],'WhatsappAccountId':_0x5f7a88['params']['id'],'closed':![]};return db[_0xe1fa('0xaa')][_0xe1fa('0x59')]({'where':_0x12859b})[_0xe1fa('0x37')](function(_0x4b2462){if(_0x4b2462){return[_0x4b2462,![]];}return db[_0xe1fa('0xaa')][_0xe1fa('0x5a')](_0x1309b9)[_0xe1fa('0x37')](function(_0x4e1116){return[_0x4e1116,!![]];});});}})[_0xe1fa('0x74')](function(_0x258d32,_0x279ba8){_0x1a0d89[_0xe1fa('0xab')]=_0x258d32[_0xe1fa('0x5c')]({'plain':!![]});_0x1a0d89[_0xe1fa('0xab')]['created']=![];if(_0x279ba8){if(_0x1a0d89[_0xe1fa('0x88')][_0xe1fa('0xac')]){_0x1a0d89[_0xe1fa('0xad')][_0xe1fa('0xae')]({'id':0x0,'priority':_0x1a0d89['applications'][_0xe1fa('0x48')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xe1fa('0xaf')});}_0x1a0d89[_0xe1fa('0xab')][_0xe1fa('0xb0')]=!![];}return db[_0xe1fa('0xb1')][_0xe1fa('0x5a')]({'phone':_0x1a0d89[_0xe1fa('0x5b')]['from'],'messageId':_0x1a0d89['body']['messageId'],'body':_0x1a0d89[_0xe1fa('0x5b')]['body'],'WhatsappAccountId':_0x5f7a88['params']['id'],'WhatsappInteractionId':_0x258d32['id'],'direction':'in','ContactId':_0x258d32[_0xe1fa('0xb2')],'AttachmentId':_0x1a0d89[_0xe1fa('0x5b')]['AttachmentId']});})[_0xe1fa('0x37')](function(_0xfb3b4d){_0x1a0d89[_0xe1fa('0x27')]=_0xfb3b4d;if(_0x1a0d89[_0xe1fa('0xab')][_0xe1fa('0xb3')]){return db[_0xe1fa('0x7a')][_0xe1fa('0x59')]({'attributes':['id',_0xe1fa('0x3b')],'where':{'id':_0x1a0d89[_0xe1fa('0xab')][_0xe1fa('0xb3')]}})[_0xe1fa('0x37')](function(_0x51255f){if(_0x51255f){_0x1a0d89[_0xe1fa('0xad')][_0xe1fa('0xb4')]({'id':0x0,'priority':0x0,'app':_0xe1fa('0xb5'),'appdata':_0x51255f[_0xe1fa('0x3b')]+','+(_0x1a0d89[_0xe1fa('0x88')]['waitForTheAssignedAgent']||0xa),'interval':_0xe1fa('0xaf')});}return respondWithRpcPromise(_0xe1fa('0xb6'),_0xe1fa('0xb7'),_0x1a0d89);});}return respondWithRpcPromise(_0xe1fa('0xb6'),_0xe1fa('0xb7'),_0x1a0d89);})[_0xe1fa('0x37')](function(_0x28e09a){if(_0x28e09a){var _0x3f8a31=0xc8;var _0x33604c=_0xe1fa('0xb8');logger[_0xe1fa('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x33604c,_0x3f8a31,_0xe1fa('0xb9'));logger[_0xe1fa('0x22')](_0xe1fa('0xba'),_0x33604c,_0x3f8a31,_0xe1fa('0xb9'),JSON[_0xe1fa('0x24')](_0x28e09a));if(_0x1a0d89[_0xe1fa('0x88')][_0xe1fa('0x41')]===_0xe1fa('0x97')){return _0x2c418f[_0xe1fa('0x2d')](_0x3f8a31)[_0xe1fa('0x33')](_0xe1fa('0xbb'),_0xe1fa('0xbc'))['send'](_0xe1fa('0xbd'));}else{return _0x2c418f[_0xe1fa('0x2d')](_0x3f8a31)[_0xe1fa('0x2e')](_0x28e09a);}}});})[_0xe1fa('0x2a')](handleError(_0x2c418f,null));};exports['send']=function(_0x20aaca,_0x2cb8ca,_0x281765){var _0x3c76d0,_0x5accad,_0x542245;if(_['isNil'](_0x20aaca['body']['body'])||_0x20aaca[_0xe1fa('0x5b')][_0xe1fa('0x5b')]===''){throw new db[(_0xe1fa('0x90'))]['ValidationError'](_0xe1fa('0xbe'));}if(_[_0xe1fa('0x9e')](_0x20aaca[_0xe1fa('0x5b')]['to'])){throw new db[(_0xe1fa('0x90'))][(_0xe1fa('0x91'))]('to\x20is\x20mandatory');}_0x3c76d0=_0x20aaca[_0xe1fa('0x5b')]['to'];return db[_0xe1fa('0x52')][_0xe1fa('0x59')]({'where':{'id':_0x20aaca[_0xe1fa('0x56')]['id']},'include':[{'model':db[_0xe1fa('0xa4')],'as':'List','include':[{'model':db[_0xe1fa('0xa5')],'as':_0xe1fa('0xa9'),'where':{'mobile':_0x3c76d0},'limit':0x1,'order':[[_0xe1fa('0xa6'),'DESC']]}]}]})[_0xe1fa('0x37')](handleEntityNotFound(_0x2cb8ca,null))[_0xe1fa('0x37')](function(_0x7e854e){if(_0x7e854e&&_0x7e854e['List']){_0x5accad=_0x7e854e[_0xe1fa('0x5c')]({'plain':!![]});if(_0x5accad[_0xe1fa('0xbf')]&&_0x5accad[_0xe1fa('0xbf')]['Contacts'][_0xe1fa('0x48')]){return _0x5accad[_0xe1fa('0xbf')]['Contacts'][0x0];}return db[_0xe1fa('0xa5')][_0xe1fa('0x5a')](_[_0xe1fa('0x19')](_0x20aaca[_0xe1fa('0x5b')],{'firstName':_0x3c76d0,'mobile':_0x3c76d0,'phone':_0x3c76d0,'ListId':_0x5accad['ListId']}));}})[_0xe1fa('0x37')](handleEntityNotFound(_0x2cb8ca,null))[_0xe1fa('0x37')](function(_0x2cf5e5){if(_0x2cf5e5){_0x542245=_0x2cf5e5;return db[_0xe1fa('0xaa')][_0xe1fa('0x59')]({'where':{'ContactId':_0x542245['id'],'closed':![],'WhatsappAccountId':_0x5accad['id']}})[_0xe1fa('0x37')](function(_0x14ef08){if(_0x14ef08){return[_0x14ef08,![]];}return db[_0xe1fa('0xaa')][_0xe1fa('0x5a')]({'UserId':_0x20aaca[_0xe1fa('0x5f')]['id'],'ContactId':_0x542245['id'],'WhatsappAccountId':_0x5accad['id'],'phone':_0x3c76d0,'firstMsgDirection':_0xe1fa('0xc0'),'Messages':[_[_0xe1fa('0x4f')](_0x20aaca['body'],{'read':![],'body':_0x20aaca[_0xe1fa('0x5b')][_0xe1fa('0x5b')],'phone':_0x3c76d0,'WhatsappAccountId':_0x5accad['id'],'UserId':_0x20aaca[_0xe1fa('0x5f')]['id'],'ContactId':_0x542245['id']})]},{'include':[{'model':db[_0xe1fa('0xb1')],'as':_0xe1fa('0xc1')}]})[_0xe1fa('0x37')](function(_0x2aecc1){return[_0x2aecc1,!![]];});});}})[_0xe1fa('0x74')](function(_0x1d2951,_0x1c16a7){if(_0x1c16a7){return _0x1d2951;}return db[_0xe1fa('0xb1')]['create'](_[_0xe1fa('0x4f')](_0x20aaca[_0xe1fa('0x5b')],{'read':![],'body':_0x20aaca[_0xe1fa('0x5b')]['body'],'phone':_0x3c76d0,'WhatsappAccountId':_0x5accad['id'],'WhatsappInteractionId':_0x1d2951['id'],'UserId':_0x20aaca[_0xe1fa('0x5f')]['id'],'ContactId':_0x542245['id']}))['then'](function(_0x3668e7){_0x1d2951['dataValues'][_0xe1fa('0xc1')]=[];_0x1d2951[_0xe1fa('0xc2')][_0xe1fa('0xc1')][_0xe1fa('0xae')](_0x3668e7[_0xe1fa('0xc2')]);return _0x1d2951;});})[_0xe1fa('0x37')](respondWithResult(_0x2cb8ca,null))['catch'](handleError(_0x2cb8ca,null));}; \ No newline at end of file +var _0x0641=['../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','json','undefined','count','set','apply','reject','update','WhatsappAccounts','destroy','end','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','offset','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','Pause','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','WhatsappAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','pick','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','message_id','Sequelize','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','defaults','contact','WhatsappInteraction','interaction','created','autoclose','close','*,*,*,*','AttachmentId','User','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x17f9f4,_0x212dda){var _0x4dc32c=function(_0x1ed46d){while(--_0x1ed46d){_0x17f9f4['push'](_0x17f9f4['shift']());}};_0x4dc32c(++_0x212dda);}(_0x0641,0xb1));var _0x1064=function(_0x5ec06c,_0x4d27e7){_0x5ec06c=_0x5ec06c-0x0;var _0x2f95e6=_0x0641[_0x5ec06c];return _0x2f95e6;};'use strict';var emlformat=require(_0x1064('0x0'));var rimraf=require(_0x1064('0x1'));var zipdir=require(_0x1064('0x2'));var jsonpatch=require(_0x1064('0x3'));var rp=require(_0x1064('0x4'));var moment=require(_0x1064('0x5'));var BPromise=require(_0x1064('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1064('0x7'));var sox=require(_0x1064('0x8'));var csv=require('to-csv');var ejs=require(_0x1064('0x9'));var fs=require('fs');var fs_extra=require(_0x1064('0xa'));var _=require(_0x1064('0xb'));var squel=require(_0x1064('0xc'));var crypto=require(_0x1064('0xd'));var jsforce=require(_0x1064('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1064('0xf'));var querystring=require(_0x1064('0x10'));var Papa=require(_0x1064('0x11'));var Redis=require('ioredis');var authService=require(_0x1064('0x12'));var qs=require(_0x1064('0x13'));var as=require(_0x1064('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1064('0x15'))(_0x1064('0x16'));var utils=require(_0x1064('0x17'));var config=require(_0x1064('0x18'));var licenseUtil=require(_0x1064('0x19'));var db=require('../../mysqldb')['db'];config[_0x1064('0x1a')]=_['defaults'](config[_0x1064('0x1a')],{'host':_0x1064('0x1b'),'port':0x18eb});var socket=require(_0x1064('0x1c'))(new Redis(config[_0x1064('0x1a')]));require(_0x1064('0x1d'))[_0x1064('0x1e')](socket);var jayson=require(_0x1064('0x1f'));var client=jayson[_0x1064('0x20')][_0x1064('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2455df,_0x442d4f,_0x310a09,_0xf845a){return new BPromise(function(_0x11e5ea,_0x5093f8){var _0x5dda44=_0xf845a||client;return _0x5dda44[_0x1064('0x22')](_0x2455df,_0x310a09)[_0x1064('0x23')](function(_0x264ebc){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,'request\x20sent');logger[_0x1064('0x24')](_0x1064('0x25'),_0x442d4f,'request\x20sent',JSON[_0x1064('0x26')](_0x264ebc));if(_0x264ebc['error']){if(_0x264ebc[_0x1064('0x27')][_0x1064('0x28')]===0x1f4){logger[_0x1064('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,_0x264ebc['error']['message']);return _0x5093f8(_0x264ebc[_0x1064('0x27')][_0x1064('0x29')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,_0x264ebc[_0x1064('0x27')][_0x1064('0x29')]);return _0x11e5ea(_0x264ebc['error'][_0x1064('0x29')]);}else{logger[_0x1064('0x2a')](_0x1064('0x2b'),_0x442d4f,_0x1064('0x2c'));_0x11e5ea(_0x264ebc[_0x1064('0x2d')]['message']);}})[_0x1064('0x2e')](function(_0xb62ad4){logger[_0x1064('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,_0xb62ad4);_0x5093f8(_0xb62ad4);});});}function respondWithStatusCode(_0x348912,_0x2439d3){_0x2439d3=_0x2439d3||0xcc;return function(_0x1711ad){if(_0x1711ad){return _0x348912[_0x1064('0x2f')](_0x2439d3);}return _0x348912[_0x1064('0x30')](_0x2439d3)['end']();};}function respondWithResult(_0x4c73ef,_0x3e36c9){_0x3e36c9=_0x3e36c9||0xc8;return function(_0x38b266){if(_0x38b266){return _0x4c73ef['status'](_0x3e36c9)[_0x1064('0x31')](_0x38b266);}};}function respondWithFilteredResult(_0x2dbba6,_0x45a8a7){return function(_0x23d82f){if(_0x23d82f){var _0x1c9c04=typeof _0x45a8a7['offset']===_0x1064('0x32')&&typeof _0x45a8a7['limit']===_0x1064('0x32');var _0x1477f4=_0x23d82f[_0x1064('0x33')];var _0x262404=_0x1c9c04?0x0:_0x45a8a7['offset'];var _0x14b201=_0x1c9c04?_0x23d82f['count']:_0x45a8a7['offset']+_0x45a8a7['limit'];var _0x29ad10;if(_0x14b201>=_0x1477f4){_0x14b201=_0x1477f4;_0x29ad10=0xc8;}else{_0x29ad10=0xce;}_0x2dbba6['status'](_0x29ad10);return _0x2dbba6[_0x1064('0x34')]('Content-Range',_0x262404+'-'+_0x14b201+'/'+_0x1477f4)['json'](_0x23d82f);}return null;};}function patchUpdates(_0x455265){return function(_0x5a548a){try{jsonpatch[_0x1064('0x35')](_0x5a548a,_0x455265,!![]);}catch(_0x3f6156){return BPromise[_0x1064('0x36')](_0x3f6156);}return _0x5a548a['save']();};}function saveUpdates(_0x3a9073,_0x21adbb){return function(_0x1fad57){if(_0x1fad57){return _0x1fad57[_0x1064('0x37')](_0x3a9073)['then'](function(_0x3dec31){return _0x3dec31;});}return null;};}function removeEntity(_0xfbd229,_0x210972){return function(_0x29ea45){if(_0x29ea45){return _0x29ea45['destroy']()[_0x1064('0x23')](function(){var _0x5cad88=_0x29ea45['get']({'plain':!![]});var _0x4f2bd7=_0x1064('0x38');return db['UserProfileResource'][_0x1064('0x39')]({'where':{'type':_0x4f2bd7,'resourceId':_0x5cad88['id']}})[_0x1064('0x23')](function(){return _0x29ea45;});})[_0x1064('0x23')](function(){_0xfbd229[_0x1064('0x30')](0xcc)[_0x1064('0x3a')]();});}};}function handleEntityNotFound(_0x3026b5,_0xa70cd){return function(_0x3d05e8){if(!_0x3d05e8){_0x3026b5[_0x1064('0x2f')](0x194);}return _0x3d05e8;};}function handleError(_0x48be8a,_0x31c869){_0x31c869=_0x31c869||0x1f4;return function(_0x27ae90){logger[_0x1064('0x27')](_0x27ae90[_0x1064('0x3b')]);if(_0x27ae90[_0x1064('0x3c')]){delete _0x27ae90[_0x1064('0x3c')];}_0x48be8a['status'](_0x31c869)[_0x1064('0x3d')](_0x27ae90);};}exports[_0x1064('0x3e')]=function(_0x396b0c,_0x1c385c){var _0x45c0fd={'include':[{'model':db['Pause'],'as':_0x1064('0x3f')}]},_0xcc66f0={},_0x52410b={'count':0x0,'rows':[]};var _0x512c64=_[_0x1064('0x40')](db[_0x1064('0x41')][_0x1064('0x42')],function(_0x15e592){return{'name':_0x15e592[_0x1064('0x43')],'type':_0x15e592[_0x1064('0x44')][_0x1064('0x45')]};});_0xcc66f0[_0x1064('0x46')]=_['map'](_0x512c64,_0x1064('0x3c'));_0xcc66f0[_0x1064('0x47')]=_[_0x1064('0x48')](_0x396b0c[_0x1064('0x47')]);_0xcc66f0[_0x1064('0x49')]=_[_0x1064('0x4a')](_0xcc66f0[_0x1064('0x46')],_0xcc66f0[_0x1064('0x47')]);_0x45c0fd[_0x1064('0x4b')]=_['intersection'](_0xcc66f0[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x396b0c['query'][_0x1064('0x4c')]));_0x45c0fd[_0x1064('0x4b')]=_0x45c0fd[_0x1064('0x4b')][_0x1064('0x4d')]?_0x45c0fd[_0x1064('0x4b')]:_0xcc66f0[_0x1064('0x46')];if(!_0x396b0c[_0x1064('0x47')][_0x1064('0x4e')]('nolimit')){_0x45c0fd['limit']=qs[_0x1064('0x4f')](_0x396b0c['query']['limit']);_0x45c0fd[_0x1064('0x50')]=qs[_0x1064('0x50')](_0x396b0c[_0x1064('0x47')][_0x1064('0x50')]);}_0x45c0fd['order']=qs[_0x1064('0x51')](_0x396b0c[_0x1064('0x47')][_0x1064('0x51')]);_0x45c0fd[_0x1064('0x52')]=qs[_0x1064('0x49')](_['pick'](_0x396b0c[_0x1064('0x47')],_0xcc66f0[_0x1064('0x49')]),_0x512c64);if(_0x396b0c[_0x1064('0x47')][_0x1064('0x53')]){_0x45c0fd[_0x1064('0x52')]=_[_0x1064('0x54')](_0x45c0fd[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x512c64,function(_0x406c1e){if(_0x406c1e[_0x1064('0x44')]!==_0x1064('0x55')){var _0x17b962={};_0x17b962[_0x406c1e[_0x1064('0x3c')]]={'$like':'%'+_0x396b0c[_0x1064('0x47')][_0x1064('0x53')]+'%'};return _0x17b962;}})});}_0x45c0fd=_[_0x1064('0x54')]({},_0x45c0fd,_0x396b0c[_0x1064('0x56')]);var _0x5c204f={'where':_0x45c0fd[_0x1064('0x52')]};return db['WhatsappAccount'][_0x1064('0x33')](_0x5c204f)[_0x1064('0x23')](function(_0x4283a1){_0x52410b[_0x1064('0x33')]=_0x4283a1;if(_0x396b0c['query'][_0x1064('0x57')]){_0x45c0fd['include']=[{'all':!![]}];}return db[_0x1064('0x41')][_0x1064('0x58')](_0x45c0fd);})['then'](function(_0x28894a){_0x52410b['rows']=_0x28894a;return _0x52410b;})[_0x1064('0x23')](respondWithFilteredResult(_0x1c385c,_0x45c0fd))[_0x1064('0x2e')](handleError(_0x1c385c,null));};exports[_0x1064('0x59')]=function(_0x2665dc,_0x419f18){var _0x145d75={'raw':![],'where':{'id':_0x2665dc['params']['id']},'include':[{'model':db[_0x1064('0x5a')],'as':_0x1064('0x3f')}]},_0x1ac938={};_0x1ac938[_0x1064('0x46')]=_[_0x1064('0x48')](db[_0x1064('0x41')][_0x1064('0x42')]);_0x1ac938['query']=_[_0x1064('0x48')](_0x2665dc[_0x1064('0x47')]);_0x1ac938['filters']=_[_0x1064('0x4a')](_0x1ac938[_0x1064('0x46')],_0x1ac938[_0x1064('0x47')]);_0x145d75['attributes']=_[_0x1064('0x4a')](_0x1ac938[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x2665dc[_0x1064('0x47')][_0x1064('0x4c')]));_0x145d75[_0x1064('0x4b')]=_0x145d75[_0x1064('0x4b')]['length']?_0x145d75['attributes']:_0x1ac938['model'];if(_0x2665dc[_0x1064('0x47')][_0x1064('0x57')]){_0x145d75[_0x1064('0x5b')]=[{'all':!![]}];}_0x145d75=_[_0x1064('0x54')]({},_0x145d75,_0x2665dc['options']);return db['WhatsappAccount'][_0x1064('0x5c')](_0x145d75)[_0x1064('0x23')](handleEntityNotFound(_0x419f18,null))['then'](respondWithResult(_0x419f18,null))['catch'](handleError(_0x419f18,null));};exports[_0x1064('0x5d')]=function(_0x5d678a,_0x15beb4){return db[_0x1064('0x41')][_0x1064('0x5d')](_0x5d678a[_0x1064('0x5e')],{})[_0x1064('0x23')](function(_0x4351a6){var _0x398887=_0x5d678a[_0x1064('0x5f')][_0x1064('0x60')]({'plain':!![]});if(!_0x398887)throw new Error(_0x1064('0x61'));if(_0x398887[_0x1064('0x62')]===_0x1064('0x5f')){var _0xb6ba7a=_0x4351a6['get']({'plain':!![]});var _0x5b1860='WhatsappAccounts';return db[_0x1064('0x63')][_0x1064('0x5c')]({'where':{'name':_0x5b1860,'userProfileId':_0x398887[_0x1064('0x64')]},'raw':!![]})[_0x1064('0x23')](function(_0x4d473d){if(_0x4d473d&&_0x4d473d['autoAssociation']===0x0){return db[_0x1064('0x65')][_0x1064('0x5d')]({'name':_0xb6ba7a[_0x1064('0x3c')],'resourceId':_0xb6ba7a['id'],'type':_0x4d473d['name'],'sectionId':_0x4d473d['id']},{})[_0x1064('0x23')](function(){return _0x4351a6;});}else{return _0x4351a6;}})['catch'](function(_0x41c246){logger['error'](_0x1064('0x66'),_0x41c246);throw _0x41c246;});}return _0x4351a6;})[_0x1064('0x23')](respondWithResult(_0x15beb4,0xc9))[_0x1064('0x2e')](handleError(_0x15beb4,null));};exports[_0x1064('0x37')]=function(_0x11d186,_0x2db68f){if(_0x11d186[_0x1064('0x5e')]['id']){delete _0x11d186['body']['id'];}return db['WhatsappAccount'][_0x1064('0x5c')]({'where':{'id':_0x11d186['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1064('0x23')](handleEntityNotFound(_0x2db68f,null))[_0x1064('0x23')](saveUpdates(_0x11d186['body'],null))[_0x1064('0x23')](respondWithResult(_0x2db68f,null))[_0x1064('0x2e')](handleError(_0x2db68f,null));};exports['destroy']=function(_0x389be6,_0x7bc961){return db['WhatsappAccount'][_0x1064('0x5c')]({'where':{'id':_0x389be6['params']['id']}})['then'](handleEntityNotFound(_0x7bc961,null))[_0x1064('0x23')](removeEntity(_0x7bc961,null))[_0x1064('0x2e')](handleError(_0x7bc961,null));};exports['describe']=function(_0x129f22,_0x1146c8){return db[_0x1064('0x41')][_0x1064('0x67')]()['then'](respondWithResult(_0x1146c8,null))[_0x1064('0x2e')](handleError(_0x1146c8,null));};exports[_0x1064('0x68')]=function(_0x26ce59,_0xe6026d,_0x153b86){if(_0x26ce59['body']['id']){delete _0x26ce59[_0x1064('0x5e')]['id'];}return db[_0x1064('0x41')]['find']({'where':{'id':_0x26ce59[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0xe6026d,null))[_0x1064('0x23')](function(_0x1da9fd){if(_0x1da9fd){_0x26ce59['body'][_0x1064('0x6a')]=_0x1da9fd['id'];return db[_0x1064('0x6b')][_0x1064('0x5d')](_0x26ce59['body']);}})['then'](respondWithResult(_0xe6026d,null))[_0x1064('0x2e')](handleError(_0xe6026d,null));};exports[_0x1064('0x6c')]=function(_0x55b23d,_0x241521,_0x45c4ab){var _0x54dd02={'raw':![],'where':{}};var _0x4a1301={};var _0x1127b7={'count':0x0,'rows':[]};return db[_0x1064('0x41')][_0x1064('0x6d')]({'where':{'id':_0x55b23d['params']['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x241521,null))[_0x1064('0x23')](function(_0x11a18e){if(_0x11a18e){_0x4a1301[_0x1064('0x46')]=_[_0x1064('0x48')](db['Disposition'][_0x1064('0x42')]);_0x4a1301['query']=_['keys'](_0x55b23d[_0x1064('0x47')]);_0x4a1301[_0x1064('0x49')]=_[_0x1064('0x4a')](_0x4a1301[_0x1064('0x46')],_0x4a1301['query']);_0x54dd02[_0x1064('0x4b')]=_[_0x1064('0x4a')](_0x4a1301[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x55b23d[_0x1064('0x47')][_0x1064('0x4c')]));_0x54dd02[_0x1064('0x4b')]=_0x54dd02[_0x1064('0x4b')][_0x1064('0x4d')]?_0x54dd02[_0x1064('0x4b')]:_0x4a1301[_0x1064('0x46')];if(!_0x55b23d[_0x1064('0x47')][_0x1064('0x4e')]('nolimit')){_0x54dd02[_0x1064('0x4f')]=qs[_0x1064('0x4f')](_0x55b23d[_0x1064('0x47')][_0x1064('0x4f')]);_0x54dd02[_0x1064('0x50')]=qs[_0x1064('0x50')](_0x55b23d[_0x1064('0x47')][_0x1064('0x50')]);}_0x54dd02[_0x1064('0x6e')]=qs[_0x1064('0x51')](_0x55b23d[_0x1064('0x47')]['sort']);_0x54dd02['where']=qs[_0x1064('0x49')](_['pick'](_0x55b23d['query'],_0x4a1301[_0x1064('0x49')]));_0x54dd02['where'][_0x1064('0x6a')]=_0x11a18e['id'];if(_0x55b23d[_0x1064('0x47')]['filter']){_0x54dd02['where']=_[_0x1064('0x54')](_0x54dd02[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x54dd02[_0x1064('0x4b')],function(_0x4de16c){var _0x26f26d={};_0x26f26d[_0x4de16c]={'$like':'%'+_0x55b23d[_0x1064('0x47')]['filter']+'%'};return _0x26f26d;})});}_0x54dd02=_[_0x1064('0x54')]({},_0x54dd02,_0x55b23d['options']);return db[_0x1064('0x6b')]['count']({'where':_0x54dd02[_0x1064('0x52')]})[_0x1064('0x23')](function(_0xe491c9){_0x1127b7[_0x1064('0x33')]=_0xe491c9;if(_0x55b23d[_0x1064('0x47')][_0x1064('0x57')]){_0x54dd02[_0x1064('0x5b')]=[{'all':!![]}];}return db[_0x1064('0x6b')]['findAll'](_0x54dd02);})[_0x1064('0x23')](function(_0x33a5c5){_0x1127b7[_0x1064('0x6f')]=_0x33a5c5;return _0x1127b7;});}})[_0x1064('0x23')](respondWithFilteredResult(_0x241521,_0x54dd02))[_0x1064('0x2e')](handleError(_0x241521,null));};exports['removeDispositions']=function(_0x4a172d,_0x26c8d1,_0x168450){return db[_0x1064('0x41')][_0x1064('0x5c')]({'where':{'id':_0x4a172d[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x26c8d1,null))['then'](function(_0x461cd6){if(_0x461cd6){return _0x461cd6[_0x1064('0x70')](_0x4a172d['query'][_0x1064('0x71')]);}})[_0x1064('0x23')](respondWithStatusCode(_0x26c8d1,null))[_0x1064('0x2e')](handleError(_0x26c8d1,null));};exports[_0x1064('0x72')]=function(_0x279230,_0x977a58,_0x1c3773){if(_0x279230['body']['id']){delete _0x279230['body']['id'];}return db[_0x1064('0x41')][_0x1064('0x5c')]({'where':{'id':_0x279230[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x977a58,null))[_0x1064('0x23')](function(_0x1ee647){if(_0x1ee647){_0x279230[_0x1064('0x5e')]['WhatsappAccountId']=_0x1ee647['id'];return db['CannedAnswer'][_0x1064('0x5d')](_0x279230[_0x1064('0x5e')]);}})[_0x1064('0x23')](respondWithResult(_0x977a58,null))['catch'](handleError(_0x977a58,null));};exports['getAnswers']=function(_0x20aa57,_0x2c033b,_0x13eae0){var _0x31100a={'raw':![],'where':{}};var _0x189b51={};var _0x5bf8d7={'count':0x0,'rows':[]};return db[_0x1064('0x41')]['findOne']({'where':{'id':_0x20aa57[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x2c033b,null))[_0x1064('0x23')](function(_0x35cc76){if(_0x35cc76){_0x189b51[_0x1064('0x46')]=_[_0x1064('0x48')](db[_0x1064('0x73')][_0x1064('0x42')]);_0x189b51[_0x1064('0x47')]=_[_0x1064('0x48')](_0x20aa57[_0x1064('0x47')]);_0x189b51[_0x1064('0x49')]=_['intersection'](_0x189b51[_0x1064('0x46')],_0x189b51[_0x1064('0x47')]);_0x31100a['attributes']=_['intersection'](_0x189b51[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x20aa57[_0x1064('0x47')][_0x1064('0x4c')]));_0x31100a[_0x1064('0x4b')]=_0x31100a[_0x1064('0x4b')]['length']?_0x31100a[_0x1064('0x4b')]:_0x189b51[_0x1064('0x46')];if(!_0x20aa57[_0x1064('0x47')][_0x1064('0x4e')](_0x1064('0x74'))){_0x31100a[_0x1064('0x4f')]=qs[_0x1064('0x4f')](_0x20aa57[_0x1064('0x47')][_0x1064('0x4f')]);_0x31100a[_0x1064('0x50')]=qs['offset'](_0x20aa57[_0x1064('0x47')][_0x1064('0x50')]);}_0x31100a[_0x1064('0x6e')]=qs[_0x1064('0x51')](_0x20aa57['query'][_0x1064('0x51')]);_0x31100a[_0x1064('0x52')]=qs[_0x1064('0x49')](_[_0x1064('0x75')](_0x20aa57['query'],_0x189b51[_0x1064('0x49')]));_0x31100a[_0x1064('0x52')][_0x1064('0x6a')]=_0x35cc76['id'];if(_0x20aa57[_0x1064('0x47')]['filter']){_0x31100a['where']=_[_0x1064('0x54')](_0x31100a['where'],{'$or':_['map'](_0x31100a[_0x1064('0x4b')],function(_0x32f4f7){var _0x2a45bf={};_0x2a45bf[_0x32f4f7]={'$like':'%'+_0x20aa57['query'][_0x1064('0x53')]+'%'};return _0x2a45bf;})});}_0x31100a=_[_0x1064('0x54')]({},_0x31100a,_0x20aa57[_0x1064('0x56')]);return db[_0x1064('0x73')][_0x1064('0x33')]({'where':_0x31100a['where']})['then'](function(_0x22498f){_0x5bf8d7[_0x1064('0x33')]=_0x22498f;if(_0x20aa57['query']['includeAll']){_0x31100a['include']=[{'all':!![]}];}return db[_0x1064('0x73')]['findAll'](_0x31100a);})[_0x1064('0x23')](function(_0x599dcb){_0x5bf8d7['rows']=_0x599dcb;return _0x5bf8d7;});}})[_0x1064('0x23')](respondWithFilteredResult(_0x2c033b,_0x31100a))[_0x1064('0x2e')](handleError(_0x2c033b,null));};exports['removeAnswers']=function(_0x5470bb,_0x184338,_0x14ca9b){return db['WhatsappAccount'][_0x1064('0x5c')]({'where':{'id':_0x5470bb[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x184338,null))[_0x1064('0x23')](function(_0x301d2e){if(_0x301d2e){return _0x301d2e[_0x1064('0x76')](_0x5470bb[_0x1064('0x47')][_0x1064('0x71')]);}})[_0x1064('0x23')](respondWithStatusCode(_0x184338,null))[_0x1064('0x2e')](handleError(_0x184338,null));};exports[_0x1064('0x77')]=function(_0x35a3ca,_0x246d61,_0x3d3099){return db['WhatsappAccount']['find']({'where':{'id':_0x35a3ca['params']['id']}})['then'](handleEntityNotFound(_0x246d61,null))[_0x1064('0x23')](function(_0x2f42ae){if(_0x2f42ae){return _0x2f42ae['addAgents'](_0x35a3ca[_0x1064('0x5e')][_0x1064('0x71')],_[_0x1064('0x78')](_0x35a3ca['body'],[_0x1064('0x71'),'id'])||{})[_0x1064('0x79')](function(_0x4f484e){for(var _0x552817=0x0;_0x552817<_0x35a3ca[_0x1064('0x5e')][_0x1064('0x71')]['length'];_0x552817+=0x1){socket[_0x1064('0x7a')]('userWhatsappAccount:save',{'UserId':Number(_0x35a3ca[_0x1064('0x5e')][_0x1064('0x71')][_0x552817]),'WhatsappAccountId':Number(_0x35a3ca['params']['id'])});}return _0x4f484e;});}})[_0x1064('0x23')](respondWithResult(_0x246d61,null))[_0x1064('0x2e')](handleError(_0x246d61,null));};exports[_0x1064('0x7b')]=function(_0x3d81ce,_0x3012e8,_0x1100e2){return db['WhatsappAccount']['find']({'where':{'id':_0x3d81ce[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x3012e8,null))[_0x1064('0x23')](function(_0x39145c){if(_0x39145c){return _0x39145c['removeAgents'](_0x3d81ce[_0x1064('0x47')][_0x1064('0x71')])[_0x1064('0x23')](function(){if(_[_0x1064('0x7c')](_0x3d81ce[_0x1064('0x47')][_0x1064('0x71')])){for(var _0x108838=0x0;_0x108838<_0x3d81ce[_0x1064('0x47')]['ids'][_0x1064('0x4d')];_0x108838+=0x1){socket[_0x1064('0x7a')](_0x1064('0x7d'),{'UserId':Number(_0x3d81ce[_0x1064('0x47')][_0x1064('0x71')][_0x108838]),'WhatsappAccountId':Number(_0x3d81ce[_0x1064('0x69')]['id'])});}}else{socket[_0x1064('0x7a')](_0x1064('0x7d'),{'UserId':Number(_0x3d81ce[_0x1064('0x47')]['ids']),'WhatsappAccountId':Number(_0x3d81ce[_0x1064('0x69')]['id'])});}});}})[_0x1064('0x23')](respondWithStatusCode(_0x3012e8,null))[_0x1064('0x2e')](handleError(_0x3012e8,null));};exports[_0x1064('0x7e')]=function(_0x29b84c,_0x14e678,_0x361653){var _0x393e8f={};var _0x3206b4={};var _0x15e783;var _0x3eeebf;return db['WhatsappAccount'][_0x1064('0x6d')]({'where':{'id':_0x29b84c[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x14e678,null))[_0x1064('0x23')](function(_0x53985d){if(_0x53985d){_0x15e783=_0x53985d;_0x3206b4[_0x1064('0x46')]=_['keys'](db['User'][_0x1064('0x42')]);_0x3206b4[_0x1064('0x47')]=_[_0x1064('0x48')](_0x29b84c[_0x1064('0x47')]);_0x3206b4[_0x1064('0x49')]=_[_0x1064('0x4a')](_0x3206b4[_0x1064('0x46')],_0x3206b4[_0x1064('0x47')]);_0x393e8f[_0x1064('0x4b')]=_[_0x1064('0x4a')](_0x3206b4[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x29b84c[_0x1064('0x47')][_0x1064('0x4c')]));_0x393e8f[_0x1064('0x4b')]=_0x393e8f[_0x1064('0x4b')][_0x1064('0x4d')]?_0x393e8f['attributes']:_0x3206b4[_0x1064('0x46')];_0x393e8f['order']=qs[_0x1064('0x51')](_0x29b84c[_0x1064('0x47')][_0x1064('0x51')]);_0x393e8f[_0x1064('0x52')]=qs['filters'](_[_0x1064('0x75')](_0x29b84c[_0x1064('0x47')],_0x3206b4[_0x1064('0x49')]));if(_0x29b84c['query'][_0x1064('0x53')]){_0x393e8f[_0x1064('0x52')]=_[_0x1064('0x54')](_0x393e8f[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x393e8f['attributes'],function(_0x59d0bc){var _0x41cfd3={};_0x41cfd3[_0x59d0bc]={'$like':'%'+_0x29b84c[_0x1064('0x47')][_0x1064('0x53')]+'%'};return _0x41cfd3;})});}_0x393e8f=_[_0x1064('0x54')]({},_0x393e8f,_0x29b84c[_0x1064('0x56')]);return _0x15e783['getAgents'](_0x393e8f);}})[_0x1064('0x23')](function(_0x7c2cce){if(_0x7c2cce){_0x3eeebf=_0x7c2cce['length'];if(!_0x29b84c[_0x1064('0x47')][_0x1064('0x4e')](_0x1064('0x74'))){_0x393e8f['limit']=qs[_0x1064('0x4f')](_0x29b84c[_0x1064('0x47')][_0x1064('0x4f')]);_0x393e8f['offset']=qs[_0x1064('0x50')](_0x29b84c[_0x1064('0x47')][_0x1064('0x50')]);}return _0x15e783['getAgents'](_0x393e8f);}})['then'](function(_0x416b02){if(_0x416b02){return _0x416b02?{'count':_0x3eeebf,'rows':_0x416b02}:null;}})[_0x1064('0x23')](respondWithResult(_0x14e678,null))['catch'](handleError(_0x14e678,null));};exports[_0x1064('0x7f')]=function(_0x221f45,_0xcc1904){var _0x1cf06a=_0x221f45[_0x1064('0x69')]['id'];var _0x5b96b0=_0x221f45[_0x1064('0x5e')];var _0x117e4=0xc8;var _0x34a623=null;return db[_0x1064('0x80')][_0x1064('0x81')]({'isolationLevel':db[_0x1064('0x80')][_0x1064('0x82')][_0x1064('0x83')][_0x1064('0x84')]},function(_0xb32de0){return db[_0x1064('0x41')][_0x1064('0x6d')]({'where':{'id':_0x1cf06a},'transaction':_0xb32de0})[_0x1064('0x23')](function(_0x21d5f5){if(_0x21d5f5){return db[_0x1064('0x85')][_0x1064('0x39')]({'where':{'WhatsappAccountId':_0x1cf06a},'transaction':_0xb32de0})['then'](function(){var _0x5e6593=_[_0x1064('0x40')](_0x5b96b0,function(_0x4f4fba){_0x4f4fba[_0x1064('0x6a')]=_0x1cf06a;return _0x4f4fba;});return db[_0x1064('0x85')][_0x1064('0x86')](_0x5e6593,{'transaction':_0xb32de0});});}else{_0x117e4=0x194;_0x34a623=[];}});})[_0x1064('0x23')](function(){if(_0x117e4!==0x194){return db['WhatsappApplication'][_0x1064('0x87')]({'where':{'WhatsappAccountId':_0x1cf06a},'order':_0x1064('0x88')})[_0x1064('0x23')](function(_0x2bb5ab){_0x34a623=_0x2bb5ab;});}})[_0x1064('0x2e')](function(_0x4ea6be){_0x117e4=0x1f4;logger['error'](_0x4ea6be[_0x1064('0x3b')]);if(_0x4ea6be[_0x1064('0x3c')]){delete _0x4ea6be[_0x1064('0x3c')];}_0x34a623=_0x4ea6be;})[_0x1064('0x89')](function(){if(_0x34a623===null){_0xcc1904[_0x1064('0x2f')](_0x117e4);}else{if(_0x117e4===0x1f4){_0xcc1904['status'](_0x117e4)[_0x1064('0x3d')](_0x34a623);}else{_0xcc1904['status'](_0x117e4)[_0x1064('0x31')](_0x34a623);}}});};exports['getApplications']=function(_0x19bfb0,_0x12d0de,_0x4348f4){var _0x8f513e={};var _0x2d8310={};var _0xbeb94d;var _0xdac60d;return db[_0x1064('0x41')][_0x1064('0x6d')]({'where':{'id':_0x19bfb0[_0x1064('0x69')]['id']}})['then'](handleEntityNotFound(_0x12d0de,null))[_0x1064('0x23')](function(_0x30893a){if(_0x30893a){_0xbeb94d=_0x30893a;_0x2d8310['model']=_['keys'](db[_0x1064('0x85')][_0x1064('0x42')]);_0x2d8310[_0x1064('0x47')]=_['keys'](_0x19bfb0[_0x1064('0x47')]);_0x2d8310[_0x1064('0x49')]=_[_0x1064('0x4a')](_0x2d8310[_0x1064('0x46')],_0x2d8310[_0x1064('0x47')]);_0x8f513e[_0x1064('0x4b')]=_[_0x1064('0x4a')](_0x2d8310[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x4c')]));_0x8f513e[_0x1064('0x4b')]=_0x8f513e[_0x1064('0x4b')][_0x1064('0x4d')]?_0x8f513e['attributes']:_0x2d8310[_0x1064('0x46')];_0x8f513e[_0x1064('0x6e')]=qs[_0x1064('0x51')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x51')]);_0x8f513e[_0x1064('0x52')]=qs['filters'](_[_0x1064('0x75')](_0x19bfb0['query'],_0x2d8310[_0x1064('0x49')]));if(_0x19bfb0[_0x1064('0x47')][_0x1064('0x53')]){_0x8f513e[_0x1064('0x52')]=_[_0x1064('0x54')](_0x8f513e[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x8f513e[_0x1064('0x4b')],function(_0xe74f84){var _0x1a6725={};_0x1a6725[_0xe74f84]={'$like':'%'+_0x19bfb0[_0x1064('0x47')][_0x1064('0x53')]+'%'};return _0x1a6725;})});}_0x8f513e=_[_0x1064('0x54')]({},_0x8f513e,_0x19bfb0[_0x1064('0x56')]);return _0xbeb94d['getApplications'](_0x8f513e);}})[_0x1064('0x23')](function(_0x26761a){if(_0x26761a){_0xdac60d=_0x26761a[_0x1064('0x4d')];if(!_0x19bfb0['query'][_0x1064('0x4e')](_0x1064('0x74'))){_0x8f513e[_0x1064('0x4f')]=qs[_0x1064('0x4f')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x4f')]);_0x8f513e[_0x1064('0x50')]=qs[_0x1064('0x50')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x50')]);}return _0xbeb94d[_0x1064('0x8a')](_0x8f513e);}})['then'](function(_0x4407d3){if(_0x4407d3){return _0x4407d3?{'count':_0xdac60d,'rows':_0x4407d3}:null;}})[_0x1064('0x23')](respondWithResult(_0x12d0de,null))['catch'](handleError(_0x12d0de,null));};exports[_0x1064('0x8b')]=function(_0x357b46,_0x40d98b,_0x2e5205){var _0x34e708={'channel':_0x1064('0x8c')};var _0x5899a6=[];var _0x45ba19=[];var _0x2a89cb={};return db[_0x1064('0x41')]['find']({'where':{'id':_0x357b46[_0x1064('0x69')]['id']},'include':[{'model':db[_0x1064('0x85')],'as':_0x1064('0x8d')}]})[_0x1064('0x23')](handleEntityNotFound(_0x40d98b,null))['then'](function(_0x43fe03){_0x34e708[_0x1064('0x8e')]=_0x43fe03;if(_0x34e708[_0x1064('0x8e')]&&_0x34e708[_0x1064('0x8e')][_0x1064('0x44')]==='sinch'&&_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')]){if(_0x357b46['body'][_0x1064('0x8f')][_0x1064('0x4d')]===0x0)return;if(_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')][0x0][_0x1064('0x90')]!=='read')return;return db[_0x1064('0x91')][_0x1064('0x37')]({'read':!![],'readAt':_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')][0x0][_0x1064('0x92')]},{'where':{'messageId':_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x5312f6){return _0x40d98b[_0x1064('0x30')](0xc8)[_0x1064('0x31')](_0x5312f6);});}_0x34e708[_0x1064('0x93')]=_[_0x1064('0x94')](_0x43fe03[_0x1064('0x8d')],[_0x1064('0x88')],[_0x1064('0x95')]);if(_0x34e708[_0x1064('0x8e')][_0x1064('0x8d')]){delete _0x34e708[_0x1064('0x8e')][_0x1064('0x8d')];}return db[_0x1064('0x96')][_0x1064('0x67')]()['then'](function(_0xbc6457){if(!_0xbc6457){throw new db['Sequelize'][(_0x1064('0x97'))]('no\x20available\x20attributes');}_0x5899a6=_['difference'](_['keys'](_0xbc6457),[_0x1064('0x98'),_0x1064('0x99')]);_0x45ba19=_[_0x1064('0x9a')](_[_0x1064('0x48')](_0xbc6457),['createdAt',_0x1064('0x99'),_0x1064('0x9b'),'ListId']);_0x34e708[_0x1064('0x5e')]={'mapKey':_0x1064('0x9c')};if(_0x34e708[_0x1064('0x8e')]&&_0x34e708[_0x1064('0x8e')]['type']===_0x1064('0x9d')){_0x34e708['body'][_0x1064('0x9e')]=_0x357b46[_0x1064('0x5e')]['From'][_0x1064('0x9f')](_0x1064('0xa0'),'');_0x34e708[_0x1064('0x5e')]['body']=_0x357b46[_0x1064('0x5e')][_0x1064('0xa1')];_0x34e708[_0x1064('0x5e')][_0x1064('0xa2')]=_0x357b46[_0x1064('0x5e')][_0x1064('0xa3')];}if(_0x34e708[_0x1064('0x8e')]&&_0x34e708[_0x1064('0x8e')]['type']===_0x1064('0xa4')){_0x34e708[_0x1064('0x5e')][_0x1064('0x9e')]=_0x357b46[_0x1064('0x5e')][_0x1064('0xa5')][0x0]['from'];_0x34e708[_0x1064('0x5e')][_0x1064('0x5e')]=_0x357b46[_0x1064('0x5e')][_0x1064('0xa5')][0x0]['message'][_0x1064('0x5e')];_0x34e708[_0x1064('0x5e')]['messageId']=_0x357b46['body'][_0x1064('0xa5')][0x0][_0x1064('0xa6')];}if(_0x34e708[_0x1064('0x5e')]['id']){delete _0x34e708['body']['id'];}if(_['isNil'](_0x34e708['body'][_0x1064('0x9e')])){throw new db[(_0x1064('0xa7'))]['ValidationError'](_0x1064('0xa8'));}if(_[_0x1064('0xa9')](_0x34e708[_0x1064('0x5e')][_0x1064('0x5e')])||_0x34e708['body']['body']===''){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1064('0xa9')](_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')])){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))](_0x1064('0xab')+_0x45ba19);}if(!_['includes'](_0x45ba19,_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')])){throw new db[(_0x1064('0xa7'))]['ValidationError'](_0x1064('0xac')+_0x45ba19);}_0x2a89cb[_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')]]=_0x34e708[_0x1064('0x5e')]['from'];return db[_0x1064('0xad')][_0x1064('0x5c')]({'where':{'id':_0x34e708[_0x1064('0x8e')][_0x1064('0xae')]},'include':[{'model':db[_0x1064('0x96')],'as':_0x1064('0xaf'),'where':_0x2a89cb,'limit':0x1,'order':[[_0x1064('0x99'),_0x1064('0xb0')]]}]});})['then'](handleEntityNotFound(_0x40d98b,null))['then'](function(_0x2c7686){if(_0x2c7686){_0x34e708[_0x1064('0xb1')]=_[_0x1064('0x78')](_0x2c7686,['Contacts']);if(_0x2c7686[_0x1064('0xaf')][_0x1064('0x4d')]){return _0x2c7686['Contacts'][0x0];}var _0x4f727b=_[_0x1064('0xb2')](_0x34e708[_0x1064('0x5e')],{'firstName':_0x34e708['body']['from'],'ListId':_0x2c7686['id']});_0x4f727b[_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')]]=_0x34e708['body']['from'];return db[_0x1064('0x96')][_0x1064('0x5d')](_0x4f727b,{'fields':_0x5899a6,'raw':!![]});}})['then'](handleEntityNotFound(_0x40d98b,null))[_0x1064('0x23')](function(_0x39d306){if(_0x39d306){_0x34e708[_0x1064('0xb3')]=_0x39d306;var _0x4a8017={'ContactId':_0x39d306['id'],'phone':_0x34e708[_0x1064('0x5e')]['from'],'WhatsappAccountId':_0x357b46[_0x1064('0x69')]['id']};var _0x522377={'ContactId':_0x39d306['id'],'WhatsappAccountId':_0x357b46['params']['id'],'closed':![]};return db[_0x1064('0xb4')][_0x1064('0x5c')]({'where':_0x522377})[_0x1064('0x23')](function(_0x2b290a){if(_0x2b290a){return[_0x2b290a,![]];}return db[_0x1064('0xb4')]['create'](_0x4a8017)['then'](function(_0x58835f){return[_0x58835f,!![]];});});}})['spread'](function(_0x1db316,_0x4064c0){_0x34e708[_0x1064('0xb5')]=_0x1db316[_0x1064('0x60')]({'plain':!![]});_0x34e708[_0x1064('0xb5')][_0x1064('0xb6')]=![];if(_0x4064c0){if(_0x34e708[_0x1064('0x8e')][_0x1064('0xb7')]){_0x34e708[_0x1064('0x93')]['push']({'id':0x0,'priority':_0x34e708[_0x1064('0x93')][_0x1064('0x4d')]+0x1,'app':_0x1064('0xb8'),'appdata':'unmanaged','interval':_0x1064('0xb9')});}_0x34e708[_0x1064('0xb5')][_0x1064('0xb6')]=!![];}return db[_0x1064('0x91')]['create']({'phone':_0x34e708[_0x1064('0x5e')][_0x1064('0x9e')],'messageId':_0x34e708[_0x1064('0x5e')]['messageId'],'body':_0x34e708['body']['body'],'WhatsappAccountId':_0x357b46[_0x1064('0x69')]['id'],'WhatsappInteractionId':_0x1db316['id'],'direction':'in','ContactId':_0x1db316['ContactId'],'AttachmentId':_0x34e708[_0x1064('0x5e')][_0x1064('0xba')]});})[_0x1064('0x23')](function(_0x2b2b34){_0x34e708[_0x1064('0x29')]=_0x2b2b34;if(_0x34e708[_0x1064('0xb5')]['UserId']){return db[_0x1064('0xbb')]['find']({'attributes':['id','name'],'where':{'id':_0x34e708[_0x1064('0xb5')][_0x1064('0xbc')]}})[_0x1064('0x23')](function(_0x4a0999){if(_0x4a0999){_0x34e708['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4a0999[_0x1064('0x3c')]+','+(_0x34e708[_0x1064('0x8e')][_0x1064('0xbd')]||0xa),'interval':_0x1064('0xb9')});}return respondWithRpcPromise(_0x1064('0xbe'),'startRouting',_0x34e708);});}return respondWithRpcPromise(_0x1064('0xbe'),_0x1064('0xbf'),_0x34e708);})[_0x1064('0x23')](function(_0x699635){if(_0x699635){var _0x2a6e12=0xc8;var _0x8f4aab=_0x1064('0xc0');logger['info'](_0x1064('0x25'),_0x8f4aab,_0x2a6e12,'entity\x20found');logger['debug'](_0x1064('0xc1'),_0x8f4aab,_0x2a6e12,'entity\x20found',JSON[_0x1064('0x26')](_0x699635));if(_0x34e708['account'][_0x1064('0x44')]===_0x1064('0x9d')){return _0x40d98b['status'](_0x2a6e12)[_0x1064('0x34')](_0x1064('0xc2'),_0x1064('0xc3'))[_0x1064('0x3d')]('\x0a');}else{return _0x40d98b[_0x1064('0x30')](_0x2a6e12)[_0x1064('0x31')](_0x699635);}}});})[_0x1064('0x2e')](handleError(_0x40d98b,null));};exports[_0x1064('0x3d')]=function(_0x577c0b,_0xddb0f7,_0x70885d){var _0x5a8b96,_0x14278c,_0x46d286;if(_[_0x1064('0xa9')](_0x577c0b[_0x1064('0x5e')][_0x1064('0x5e')])||_0x577c0b[_0x1064('0x5e')][_0x1064('0x5e')]===''){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))](_0x1064('0xc4'));}if(_[_0x1064('0xa9')](_0x577c0b['body']['to'])){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))]('to\x20is\x20mandatory');}_0x5a8b96=_0x577c0b['body']['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x577c0b[_0x1064('0x69')]['id']},'include':[{'model':db[_0x1064('0xad')],'as':_0x1064('0xc5'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5a8b96},'limit':0x1,'order':[[_0x1064('0x99'),_0x1064('0xb0')]]}]}]})[_0x1064('0x23')](handleEntityNotFound(_0xddb0f7,null))[_0x1064('0x23')](function(_0x4df760){if(_0x4df760&&_0x4df760[_0x1064('0xc5')]){_0x14278c=_0x4df760[_0x1064('0x60')]({'plain':!![]});if(_0x14278c[_0x1064('0xc5')]&&_0x14278c['List']['Contacts']['length']){return _0x14278c[_0x1064('0xc5')][_0x1064('0xaf')][0x0];}return db[_0x1064('0x96')]['create'](_['defaults'](_0x577c0b[_0x1064('0x5e')],{'firstName':_0x5a8b96,'mobile':_0x5a8b96,'phone':_0x5a8b96,'ListId':_0x14278c[_0x1064('0xae')]}));}})[_0x1064('0x23')](handleEntityNotFound(_0xddb0f7,null))[_0x1064('0x23')](function(_0x42355d){if(_0x42355d){_0x46d286=_0x42355d;return db[_0x1064('0xb4')][_0x1064('0x5c')]({'where':{'ContactId':_0x46d286['id'],'closed':![],'WhatsappAccountId':_0x14278c['id']}})[_0x1064('0x23')](function(_0x40d581){if(_0x40d581){return[_0x40d581,![]];}return db['WhatsappInteraction'][_0x1064('0x5d')]({'UserId':_0x577c0b[_0x1064('0x5f')]['id'],'ContactId':_0x46d286['id'],'WhatsappAccountId':_0x14278c['id'],'phone':_0x5a8b96,'firstMsgDirection':_0x1064('0xc6'),'Messages':[_['merge'](_0x577c0b['body'],{'read':![],'body':_0x577c0b[_0x1064('0x5e')]['body'],'phone':_0x5a8b96,'WhatsappAccountId':_0x14278c['id'],'UserId':_0x577c0b[_0x1064('0x5f')]['id'],'ContactId':_0x46d286['id']})]},{'include':[{'model':db[_0x1064('0x91')],'as':_0x1064('0xc7')}]})['then'](function(_0x24681b){return[_0x24681b,!![]];});});}})[_0x1064('0x79')](function(_0x1a0872,_0x823749){if(_0x823749){return _0x1a0872;}return db[_0x1064('0x91')]['create'](_[_0x1064('0x54')](_0x577c0b['body'],{'read':![],'body':_0x577c0b[_0x1064('0x5e')][_0x1064('0x5e')],'phone':_0x5a8b96,'WhatsappAccountId':_0x14278c['id'],'WhatsappInteractionId':_0x1a0872['id'],'UserId':_0x577c0b[_0x1064('0x5f')]['id'],'ContactId':_0x46d286['id']}))[_0x1064('0x23')](function(_0x49af04){_0x1a0872[_0x1064('0xc8')][_0x1064('0xc7')]=[];_0x1a0872['dataValues'][_0x1064('0xc7')][_0x1064('0xc9')](_0x49af04[_0x1064('0xc8')]);return _0x1a0872;});})[_0x1064('0x23')](respondWithResult(_0xddb0f7,null))[_0x1064('0x2e')](handleError(_0xddb0f7,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 501698e..f2cb377 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c0=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x1ea43f,_0x46f730){var _0x1bf450=function(_0x54c5b0){while(--_0x54c5b0){_0x1ea43f['push'](_0x1ea43f['shift']());}};_0x1bf450(++_0x46f730);}(_0x49c0,0x7a));var _0x049c=function(_0x4a2d3c,_0x577362){_0x4a2d3c=_0x4a2d3c-0x0;var _0x4c3efa=_0x49c0[_0x4a2d3c];return _0x4c3efa;};'use strict';var EventEmitter=require(_0x049c('0x0'));var WhatsappAccount=require(_0x049c('0x1'))['db'][_0x049c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x049c('0x3')](0x0);var events={'afterCreate':_0x049c('0x4'),'afterUpdate':_0x049c('0x5'),'afterDestroy':_0x049c('0x6')};function emitEvent(_0x14330a){return function(_0x2f0fd9,_0x455698,_0x57a1ce){WhatsappAccountEvents['emit'](_0x14330a+':'+_0x2f0fd9['id'],_0x2f0fd9);WhatsappAccountEvents['emit'](_0x14330a,_0x2f0fd9);_0x57a1ce(null);};}for(var e in events){if(events[_0x049c('0x7')](e)){var event=events[e];WhatsappAccount[_0x049c('0x8')](e,emitEvent(event));}}module[_0x049c('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xe3d1=['remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','update'];(function(_0x2a09bc,_0x20f4a4){var _0x2ec3e3=function(_0x396c3c){while(--_0x396c3c){_0x2a09bc['push'](_0x2a09bc['shift']());}};_0x2ec3e3(++_0x20f4a4);}(_0xe3d1,0x14d));var _0x1e3d=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0xe3d1[_0x5ed54b];return _0x4b58c7;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x1e3d('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1e3d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e3d('0x2'),'afterDestroy':_0x1e3d('0x3')};function emitEvent(_0x130b6d){return function(_0x598d05,_0x4f06e8,_0x17f852){WhatsappAccountEvents[_0x1e3d('0x4')](_0x130b6d+':'+_0x598d05['id'],_0x598d05);WhatsappAccountEvents['emit'](_0x130b6d,_0x598d05);_0x17f852(null);};}for(var e in events){if(events[_0x1e3d('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x1e3d('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a7e7f81..44a9336 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2bb=['./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts','util','../../config/logger','request-promise','path','rimraf'];(function(_0x4a3c7f,_0x266e54){var _0x4b1f2f=function(_0x306981){while(--_0x306981){_0x4a3c7f['push'](_0x4a3c7f['shift']());}};_0x4b1f2f(++_0x266e54);}(_0xf2bb,0x1eb));var _0xbf2b=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0xf2bb[_0x4d337e];return _0x247963;};'use strict';var _=require('lodash');var util=require(_0xbf2b('0x0'));var logger=require(_0xbf2b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf2b('0x2'));var fs=require('fs');var path=require(_0xbf2b('0x3'));var rimraf=require(_0xbf2b('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf2b('0x5'));module['exports']=function(_0x28af35,_0x5d4357){return _0x28af35['define'](_0xbf2b('0x6'),attributes,{'tableName':_0xbf2b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6381=['./whatsappAccount.attributes','exports','WhatsappAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x24bd83,_0x1830c4){var _0x3a047e=function(_0x5d8bc4){while(--_0x5d8bc4){_0x24bd83['push'](_0x24bd83['shift']());}};_0x3a047e(++_0x1830c4);}(_0x6381,0x1ef));var _0x1638=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6381[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1638('0x0'));var util=require(_0x1638('0x1'));var logger=require(_0x1638('0x2'))(_0x1638('0x3'));var moment=require(_0x1638('0x4'));var BPromise=require(_0x1638('0x5'));var rp=require(_0x1638('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1638('0x7'));var config=require(_0x1638('0x8'));var attributes=require(_0x1638('0x9'));module[_0x1638('0xa')]=function(_0x201420,_0x2ac003){return _0x201420['define'](_0x1638('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index a583b1c..4fa1218 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c0c=['map','model','ShowWhatsappAccount','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','WhatsappAccount','find','options','raw','where','attributes','include'];(function(_0x3fa529,_0x3c341e){var _0x350134=function(_0x47368e){while(--_0x47368e){_0x3fa529['push'](_0x3fa529['shift']());}};_0x350134(++_0x3c341e);}(_0x6c0c,0x18f));var _0xc6c0=function(_0x56da3c,_0xe77c78){_0x56da3c=_0x56da3c-0x0;var _0x19ee2a=_0x6c0c[_0x56da3c];return _0x19ee2a;};'use strict';var _=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc6c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6c0('0x3'))['db'];var utils=require(_0xc6c0('0x4'));var logger=require(_0xc6c0('0x5'))(_0xc6c0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc6c0('0x7')][_0xc6c0('0x8')]({'port':0x232a});config[_0xc6c0('0x9')]=_[_0xc6c0('0xa')](config[_0xc6c0('0x9')],{'host':_0xc6c0('0xb'),'port':0x18eb});var socket=require(_0xc6c0('0xc'))(new Redis(config[_0xc6c0('0x9')]));require(_0xc6c0('0xd'))['register'](socket);function respondWithRpcPromise(_0x4a4a63,_0x122d08,_0x465bd6){return new BPromise(function(_0x16107e,_0x1a3783){return client[_0xc6c0('0xe')](_0x4a4a63,_0x465bd6)[_0xc6c0('0xf')](function(_0xdad6fd){logger[_0xc6c0('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x122d08,_0xc6c0('0x11'));logger[_0xc6c0('0x12')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x122d08,_0xc6c0('0x11'),JSON[_0xc6c0('0x13')](_0xdad6fd));if(_0xdad6fd[_0xc6c0('0x14')]){if(_0xdad6fd['error'][_0xc6c0('0x15')]===0x1f4){logger[_0xc6c0('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x122d08,_0xdad6fd['error'][_0xc6c0('0x16')]);return _0x1a3783(_0xdad6fd[_0xc6c0('0x14')]['message']);}logger['error'](_0xc6c0('0x17'),_0x122d08,_0xdad6fd[_0xc6c0('0x14')]['message']);return _0x16107e(_0xdad6fd[_0xc6c0('0x14')][_0xc6c0('0x16')]);}else{logger['info'](_0xc6c0('0x17'),_0x122d08,_0xc6c0('0x11'));_0x16107e(_0xdad6fd[_0xc6c0('0x18')]['message']);}})[_0xc6c0('0x19')](function(_0x43acf7){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x122d08,_0x43acf7);_0x1a3783(_0x43acf7);});});}exports['ShowWhatsappAccount']=function(_0x20ec29){var _0x450dcb=this;return new Promise(function(_0x175695,_0x3e9d09){return db[_0xc6c0('0x1a')][_0xc6c0('0x1b')]({'raw':_0x20ec29[_0xc6c0('0x1c')]?_0x20ec29[_0xc6c0('0x1c')][_0xc6c0('0x1d')]===undefined?!![]:![]:!![],'where':_0x20ec29[_0xc6c0('0x1c')]?_0x20ec29[_0xc6c0('0x1c')][_0xc6c0('0x1e')]||null:null,'attributes':_0x20ec29[_0xc6c0('0x1c')]?_0x20ec29[_0xc6c0('0x1c')][_0xc6c0('0x1f')]||null:null,'include':_0x20ec29[_0xc6c0('0x1c')]?_0x20ec29['options'][_0xc6c0('0x20')]?_[_0xc6c0('0x21')](_0x20ec29[_0xc6c0('0x1c')][_0xc6c0('0x20')],function(_0x320b38){return{'model':db[_0x320b38['model']],'as':_0x320b38['as'],'attributes':_0x320b38[_0xc6c0('0x1f')],'include':_0x320b38[_0xc6c0('0x20')]?_[_0xc6c0('0x21')](_0x320b38[_0xc6c0('0x20')],function(_0x4b42bb){return{'model':db[_0x4b42bb['model']],'as':_0x4b42bb['as'],'attributes':_0x4b42bb[_0xc6c0('0x1f')],'include':_0x4b42bb[_0xc6c0('0x20')]?_[_0xc6c0('0x21')](_0x4b42bb[_0xc6c0('0x20')],function(_0x3e1751){return{'model':db[_0x3e1751[_0xc6c0('0x22')]],'as':_0x3e1751['as'],'attributes':_0x3e1751[_0xc6c0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37687a){logger['info']('ShowWhatsappAccount',_0x20ec29);logger[_0xc6c0('0x12')](_0xc6c0('0x23'),_0x20ec29,JSON['stringify'](_0x37687a));_0x175695(_0x37687a);})[_0xc6c0('0x19')](function(_0x375d76){logger[_0xc6c0('0x14')](_0xc6c0('0x23'),_0x375d76[_0xc6c0('0x16')],_0x20ec29);_0x3e9d09(_0x450dcb['error'](0x1f4,_0x375d76[_0xc6c0('0x16')]));});});}; \ No newline at end of file +var _0x1573=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','model','map','lodash','bluebird','randomstring','ioredis'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x1573,0x193));var _0x3157=function(_0x85d56d,_0x37f5c1){_0x85d56d=_0x85d56d-0x0;var _0x51f613=_0x1573[_0x85d56d];return _0x51f613;};'use strict';var _=require(_0x3157('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3157('0x1'));var rs=require(_0x3157('0x2'));var fs=require('fs');var Redis=require(_0x3157('0x3'));var db=require(_0x3157('0x4'))['db'];var utils=require(_0x3157('0x5'));var logger=require(_0x3157('0x6'))(_0x3157('0x7'));var config=require(_0x3157('0x8'));var jayson=require(_0x3157('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3157('0xa')]=_['defaults'](config[_0x3157('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3157('0xb'))(new Redis(config[_0x3157('0xa')]));require(_0x3157('0xc'))[_0x3157('0xd')](socket);function respondWithRpcPromise(_0x5ba0a7,_0x56d8e7,_0x4e39d8){return new BPromise(function(_0x5a647e,_0x370683){return client[_0x3157('0xe')](_0x5ba0a7,_0x4e39d8)[_0x3157('0xf')](function(_0x2a225b){logger[_0x3157('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x56d8e7,_0x3157('0x11'));logger[_0x3157('0x12')](_0x3157('0x13'),_0x56d8e7,_0x3157('0x11'),JSON[_0x3157('0x14')](_0x2a225b));if(_0x2a225b['error']){if(_0x2a225b[_0x3157('0x15')][_0x3157('0x16')]===0x1f4){logger[_0x3157('0x15')](_0x3157('0x17'),_0x56d8e7,_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);return _0x370683(_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);}logger[_0x3157('0x15')](_0x3157('0x17'),_0x56d8e7,_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);return _0x5a647e(_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);}else{logger[_0x3157('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x56d8e7,_0x3157('0x11'));_0x5a647e(_0x2a225b[_0x3157('0x19')][_0x3157('0x18')]);}})[_0x3157('0x1a')](function(_0x4225ad){logger[_0x3157('0x15')](_0x3157('0x17'),_0x56d8e7,_0x4225ad);_0x370683(_0x4225ad);});});}exports[_0x3157('0x1b')]=function(_0x499084){var _0xfc3927=this;return new Promise(function(_0x3a09d9,_0x21694f){return db[_0x3157('0x1c')][_0x3157('0x1d')]({'raw':_0x499084['options']?_0x499084['options'][_0x3157('0x1e')]===undefined?!![]:![]:!![],'where':_0x499084[_0x3157('0x1f')]?_0x499084[_0x3157('0x1f')][_0x3157('0x20')]||null:null,'attributes':_0x499084['options']?_0x499084[_0x3157('0x1f')][_0x3157('0x21')]||null:null,'include':_0x499084[_0x3157('0x1f')]?_0x499084[_0x3157('0x1f')][_0x3157('0x22')]?_['map'](_0x499084['options'][_0x3157('0x22')],function(_0x5cd093){return{'model':db[_0x5cd093[_0x3157('0x23')]],'as':_0x5cd093['as'],'attributes':_0x5cd093['attributes'],'include':_0x5cd093[_0x3157('0x22')]?_[_0x3157('0x24')](_0x5cd093['include'],function(_0x23fbda){return{'model':db[_0x23fbda[_0x3157('0x23')]],'as':_0x23fbda['as'],'attributes':_0x23fbda[_0x3157('0x21')],'include':_0x23fbda[_0x3157('0x22')]?_[_0x3157('0x24')](_0x23fbda[_0x3157('0x22')],function(_0x1cc4f8){return{'model':db[_0x1cc4f8['model']],'as':_0x1cc4f8['as'],'attributes':_0x1cc4f8[_0x3157('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3157('0xf')](function(_0x1edbd3){logger[_0x3157('0x10')](_0x3157('0x1b'),_0x499084);logger[_0x3157('0x12')](_0x3157('0x1b'),_0x499084,JSON['stringify'](_0x1edbd3));_0x3a09d9(_0x1edbd3);})[_0x3157('0x1a')](function(_0x513075){logger[_0x3157('0x15')]('ShowWhatsappAccount',_0x513075['message'],_0x499084);_0x21694f(_0xfc3927[_0x3157('0x15')](0x1f4,_0x513075[_0x3157('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 91ab357..13c82d0 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x401b=['./whatsappAccount.events','save','remove','update','emit','removeListener','register','whatsappAccount:'];(function(_0xf95790,_0x480b35){var _0x11e45d=function(_0x63b873){while(--_0x63b873){_0xf95790['push'](_0xf95790['shift']());}};_0x11e45d(++_0x480b35);}(_0x401b,0x98));var _0xb401=function(_0x31f2b7,_0xc6ab9a){_0x31f2b7=_0x31f2b7-0x0;var _0x57835d=_0x401b[_0x31f2b7];return _0x57835d;};'use strict';var WhatsappAccountEvents=require(_0xb401('0x0'));var events=[_0xb401('0x1'),_0xb401('0x2'),_0xb401('0x3')];function createListener(_0xfdb114,_0xac9923){return function(_0x2676af){_0xac9923[_0xb401('0x4')](_0xfdb114,_0x2676af);};}function removeListener(_0x3c4a66,_0xe98090){return function(){WhatsappAccountEvents[_0xb401('0x5')](_0x3c4a66,_0xe98090);};}exports[_0xb401('0x6')]=function(_0x28c204){for(var _0xdbe073=0x0,_0x346dff=events['length'];_0xdbe073<_0x346dff;_0xdbe073++){var _0x1da9cc=events[_0xdbe073];var _0x4ff431=createListener(_0xb401('0x7')+_0x1da9cc,_0x28c204);WhatsappAccountEvents['on'](_0x1da9cc,_0x4ff431);}}; \ No newline at end of file +var _0xb1ca=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x20dc39,_0x5f261f){var _0x26a52b=function(_0x54ad3a){while(--_0x54ad3a){_0x20dc39['push'](_0x20dc39['shift']());}};_0x26a52b(++_0x5f261f);}(_0xb1ca,0x14a));var _0xab1c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb1ca[_0x2c7618];return _0x5ce3f0;};'use strict';var WhatsappAccountEvents=require(_0xab1c('0x0'));var events=[_0xab1c('0x1'),_0xab1c('0x2'),_0xab1c('0x3')];function createListener(_0x4e6066,_0x553d8c){return function(_0x2dfa4f){_0x553d8c[_0xab1c('0x4')](_0x4e6066,_0x2dfa4f);};}function removeListener(_0x2a88b6,_0x98266){return function(){WhatsappAccountEvents[_0xab1c('0x5')](_0x2a88b6,_0x98266);};}exports['register']=function(_0xb13ed9){for(var _0x26b468=0x0,_0x5aa9cc=events['length'];_0x26b468<_0x5aa9cc;_0x26b468++){var _0x34bf1f=events[_0x26b468];var _0x2d37fd=createListener(_0xab1c('0x6')+_0x34bf1f,_0xb13ed9);WhatsappAccountEvents['on'](_0x34bf1f,_0x2d37fd);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index fbcf84a..9b899fe 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd587=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x276098,_0x5cb3a9){var _0x48be8d=function(_0x57d90d){while(--_0x57d90d){_0x276098['push'](_0x276098['shift']());}};_0x48be8d(++_0x5cb3a9);}(_0xd587,0x143));var _0x7d58=function(_0x37a636,_0x3f85bb){_0x37a636=_0x37a636-0x0;var _0x1ee1fd=_0xd587[_0x37a636];return _0x1ee1fd;};'use strict';var multer=require(_0x7d58('0x0'));var util=require('util');var path=require(_0x7d58('0x1'));var timeout=require(_0x7d58('0x2'));var express=require(_0x7d58('0x3'));var router=express[_0x7d58('0x4')]();var fs_extra=require(_0x7d58('0x5'));var auth=require(_0x7d58('0x6'));var interaction=require(_0x7d58('0x7'));var config=require(_0x7d58('0x8'));var controller=require(_0x7d58('0x9'));router[_0x7d58('0xa')]('/',auth[_0x7d58('0xb')](),controller['index']);router['get'](_0x7d58('0xc'),auth[_0x7d58('0xb')](),controller[_0x7d58('0xd')]);router[_0x7d58('0xe')]('/',auth[_0x7d58('0xb')](),controller[_0x7d58('0xf')]);router[_0x7d58('0x10')](_0x7d58('0xc'),auth[_0x7d58('0xb')](),controller[_0x7d58('0x11')]);router[_0x7d58('0x12')](_0x7d58('0xc'),auth['isAuthenticated'](),controller[_0x7d58('0x13')]);module['exports']=router; \ No newline at end of file +var _0x68dd=['delete','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x68dd,0x159));var _0xd68d=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x68dd[_0x292f93];return _0x5a94b1;};'use strict';var multer=require(_0xd68d('0x0'));var util=require(_0xd68d('0x1'));var path=require(_0xd68d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd68d('0x3'));var config=require(_0xd68d('0x4'));var controller=require(_0xd68d('0x5'));router[_0xd68d('0x6')]('/',auth[_0xd68d('0x7')](),controller[_0xd68d('0x8')]);router[_0xd68d('0x6')](_0xd68d('0x9'),auth['isAuthenticated'](),controller[_0xd68d('0xa')]);router[_0xd68d('0xb')]('/',auth[_0xd68d('0x7')](),controller[_0xd68d('0xc')]);router[_0xd68d('0xd')](_0xd68d('0x9'),auth['isAuthenticated'](),controller[_0xd68d('0xe')]);router[_0xd68d('0xf')](_0xd68d('0x9'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x10')]);module[_0xd68d('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d08e87d..9b1644d 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a77=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x6a77,0x1b4));var _0x76a7=function(_0x1752f7,_0x5245f2){_0x1752f7=_0x1752f7-0x0;var _0x5abf0e=_0x6a77[_0x1752f7];return _0x5abf0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x76a7('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x76a7('0x1')],'allowNull':![],'defaultValue':_0x76a7('0x2')},'appdata':{'type':Sequelize[_0x76a7('0x3')]()},'description':{'type':Sequelize[_0x76a7('0x1')]},'interval':{'type':Sequelize[_0x76a7('0x1')],'defaultValue':_0x76a7('0x4')}}; \ No newline at end of file +var _0x31a7=['TEXT','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x31a7,0x172));var _0x731a=function(_0x324c27,_0x4383d8){_0x324c27=_0x324c27-0x0;var _0x5782a7=_0x31a7[_0x324c27];return _0x5782a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x731a('0x0')]()},'description':{'type':Sequelize[_0x731a('0x1')]},'interval':{'type':Sequelize[_0x731a('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index c7b408c..e32f9be 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8cb=['lodash','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra'];(function(_0x54e4e6,_0x5a2d7c){var _0x3d4cf9=function(_0x255b63){while(--_0x255b63){_0x54e4e6['push'](_0x54e4e6['shift']());}};_0x3d4cf9(++_0x5a2d7c);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x569dcf,_0x5c2c07){_0x569dcf=_0x569dcf-0x0;var _0x406849=_0xb8cb[_0x569dcf];return _0x406849;};'use strict';var emlformat=require(_0xbb8c('0x0'));var rimraf=require(_0xbb8c('0x1'));var zipdir=require(_0xbb8c('0x2'));var jsonpatch=require(_0xbb8c('0x3'));var rp=require(_0xbb8c('0x4'));var moment=require(_0xbb8c('0x5'));var BPromise=require(_0xbb8c('0x6'));var Mustache=require('mustache');var util=require(_0xbb8c('0x7'));var path=require(_0xbb8c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb8c('0x9'));var fs=require('fs');var fs_extra=require(_0xbb8c('0xa'));var _=require(_0xbb8c('0xb'));var squel=require('squel');var crypto=require(_0xbb8c('0xc'));var jsforce=require(_0xbb8c('0xd'));var deskjs=require(_0xbb8c('0xe'));var toCsv=require(_0xbb8c('0xf'));var querystring=require(_0xbb8c('0x10'));var Papa=require(_0xbb8c('0x11'));var Redis=require(_0xbb8c('0x12'));var authService=require(_0xbb8c('0x13'));var qs=require(_0xbb8c('0x14'));var as=require(_0xbb8c('0x15'));var hardwareService=require(_0xbb8c('0x16'));var logger=require(_0xbb8c('0x17'))('api');var utils=require(_0xbb8c('0x18'));var config=require(_0xbb8c('0x19'));var licenseUtil=require(_0xbb8c('0x1a'));var db=require(_0xbb8c('0x1b'))['db'];function respondWithStatusCode(_0x3ac367,_0x57e624){_0x57e624=_0x57e624||0xcc;return function(_0x275252){if(_0x275252){return _0x3ac367[_0xbb8c('0x1c')](_0x57e624);}return _0x3ac367[_0xbb8c('0x1d')](_0x57e624)[_0xbb8c('0x1e')]();};}function respondWithResult(_0x3a0fe2,_0x151bf2){_0x151bf2=_0x151bf2||0xc8;return function(_0x1de932){if(_0x1de932){return _0x3a0fe2['status'](_0x151bf2)[_0xbb8c('0x1f')](_0x1de932);}};}function respondWithFilteredResult(_0x1e6dc9,_0x425891){return function(_0x403710){if(_0x403710){var _0x2cc079=typeof _0x425891[_0xbb8c('0x20')]===_0xbb8c('0x21')&&typeof _0x425891[_0xbb8c('0x22')]===_0xbb8c('0x21');var _0x187ee5=_0x403710['count'];var _0x67712e=_0x2cc079?0x0:_0x425891[_0xbb8c('0x20')];var _0x2a02c9=_0x2cc079?_0x403710[_0xbb8c('0x23')]:_0x425891[_0xbb8c('0x20')]+_0x425891[_0xbb8c('0x22')];var _0x520ea9;if(_0x2a02c9>=_0x187ee5){_0x2a02c9=_0x187ee5;_0x520ea9=0xc8;}else{_0x520ea9=0xce;}_0x1e6dc9[_0xbb8c('0x1d')](_0x520ea9);return _0x1e6dc9[_0xbb8c('0x24')]('Content-Range',_0x67712e+'-'+_0x2a02c9+'/'+_0x187ee5)[_0xbb8c('0x1f')](_0x403710);}return null;};}function patchUpdates(_0x5e2803){return function(_0x44a56e){try{jsonpatch['apply'](_0x44a56e,_0x5e2803,!![]);}catch(_0x32b961){return BPromise[_0xbb8c('0x25')](_0x32b961);}return _0x44a56e[_0xbb8c('0x26')]();};}function saveUpdates(_0x546215,_0x4b4100){return function(_0x10f265){if(_0x10f265){return _0x10f265['update'](_0x546215)[_0xbb8c('0x27')](function(_0x1b764d){return _0x1b764d;});}return null;};}function removeEntity(_0x36163c,_0xec7fb5){return function(_0x362a2f){if(_0x362a2f){return _0x362a2f[_0xbb8c('0x28')]()[_0xbb8c('0x27')](function(){_0x36163c['status'](0xcc)[_0xbb8c('0x1e')]();});}};}function handleEntityNotFound(_0x5f4f96,_0x4a5684){return function(_0xe7475d){if(!_0xe7475d){_0x5f4f96['sendStatus'](0x194);}return _0xe7475d;};}function handleError(_0x47fb37,_0x26ea5f){_0x26ea5f=_0x26ea5f||0x1f4;return function(_0x283ec3){logger[_0xbb8c('0x29')](_0x283ec3['stack']);if(_0x283ec3['name']){delete _0x283ec3[_0xbb8c('0x2a')];}_0x47fb37[_0xbb8c('0x1d')](_0x26ea5f)['send'](_0x283ec3);};}exports[_0xbb8c('0x2b')]=function(_0x23bf3d,_0x292f11){var _0x4f0f13={},_0x271ad7={},_0x1e0e3={'count':0x0,'rows':[]};var _0x219976=_[_0xbb8c('0x2c')](db[_0xbb8c('0x2d')][_0xbb8c('0x2e')],function(_0x2f3db6){return{'name':_0x2f3db6[_0xbb8c('0x2f')],'type':_0x2f3db6[_0xbb8c('0x30')][_0xbb8c('0x31')]};});_0x271ad7['model']=_['map'](_0x219976,_0xbb8c('0x2a'));_0x271ad7[_0xbb8c('0x32')]=_[_0xbb8c('0x33')](_0x23bf3d[_0xbb8c('0x32')]);_0x271ad7[_0xbb8c('0x34')]=_['intersection'](_0x271ad7[_0xbb8c('0x35')],_0x271ad7[_0xbb8c('0x32')]);_0x4f0f13[_0xbb8c('0x36')]=_[_0xbb8c('0x37')](_0x271ad7[_0xbb8c('0x35')],qs[_0xbb8c('0x38')](_0x23bf3d[_0xbb8c('0x32')][_0xbb8c('0x38')]));_0x4f0f13[_0xbb8c('0x36')]=_0x4f0f13['attributes'][_0xbb8c('0x39')]?_0x4f0f13[_0xbb8c('0x36')]:_0x271ad7[_0xbb8c('0x35')];if(!_0x23bf3d['query']['hasOwnProperty'](_0xbb8c('0x3a'))){_0x4f0f13[_0xbb8c('0x22')]=qs[_0xbb8c('0x22')](_0x23bf3d[_0xbb8c('0x32')]['limit']);_0x4f0f13[_0xbb8c('0x20')]=qs[_0xbb8c('0x20')](_0x23bf3d[_0xbb8c('0x32')][_0xbb8c('0x20')]);}_0x4f0f13[_0xbb8c('0x3b')]=qs['sort'](_0x23bf3d[_0xbb8c('0x32')][_0xbb8c('0x3c')]);_0x4f0f13[_0xbb8c('0x3d')]=qs[_0xbb8c('0x34')](_['pick'](_0x23bf3d[_0xbb8c('0x32')],_0x271ad7[_0xbb8c('0x34')]),_0x219976);if(_0x23bf3d[_0xbb8c('0x32')][_0xbb8c('0x3e')]){_0x4f0f13[_0xbb8c('0x3d')]=_[_0xbb8c('0x3f')](_0x4f0f13[_0xbb8c('0x3d')],{'$or':_[_0xbb8c('0x2c')](_0x219976,function(_0x423bba){if(_0x423bba[_0xbb8c('0x30')]!==_0xbb8c('0x40')){var _0x1f4d03={};_0x1f4d03[_0x423bba['name']]={'$like':'%'+_0x23bf3d[_0xbb8c('0x32')][_0xbb8c('0x3e')]+'%'};return _0x1f4d03;}})});}_0x4f0f13=_[_0xbb8c('0x3f')]({},_0x4f0f13,_0x23bf3d[_0xbb8c('0x41')]);var _0x55a698={'where':_0x4f0f13[_0xbb8c('0x3d')]};return db['WhatsappApplication']['count'](_0x55a698)[_0xbb8c('0x27')](function(_0x1c5197){_0x1e0e3[_0xbb8c('0x23')]=_0x1c5197;if(_0x23bf3d['query'][_0xbb8c('0x42')]){_0x4f0f13[_0xbb8c('0x43')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xbb8c('0x44')](_0x4f0f13);})[_0xbb8c('0x27')](function(_0x3b8311){_0x1e0e3[_0xbb8c('0x45')]=_0x3b8311;return _0x1e0e3;})['then'](respondWithFilteredResult(_0x292f11,_0x4f0f13))[_0xbb8c('0x46')](handleError(_0x292f11,null));};exports[_0xbb8c('0x47')]=function(_0x17ffa5,_0x5b662e){var _0xa601d5={'raw':!![],'where':{'id':_0x17ffa5['params']['id']}},_0xff11d5={};_0xff11d5['model']=_[_0xbb8c('0x33')](db[_0xbb8c('0x2d')]['rawAttributes']);_0xff11d5['query']=_[_0xbb8c('0x33')](_0x17ffa5['query']);_0xff11d5[_0xbb8c('0x34')]=_['intersection'](_0xff11d5[_0xbb8c('0x35')],_0xff11d5['query']);_0xa601d5[_0xbb8c('0x36')]=_[_0xbb8c('0x37')](_0xff11d5[_0xbb8c('0x35')],qs[_0xbb8c('0x38')](_0x17ffa5[_0xbb8c('0x32')][_0xbb8c('0x38')]));_0xa601d5['attributes']=_0xa601d5[_0xbb8c('0x36')]['length']?_0xa601d5[_0xbb8c('0x36')]:_0xff11d5[_0xbb8c('0x35')];if(_0x17ffa5[_0xbb8c('0x32')][_0xbb8c('0x42')]){_0xa601d5[_0xbb8c('0x43')]=[{'all':!![]}];}_0xa601d5=_[_0xbb8c('0x3f')]({},_0xa601d5,_0x17ffa5['options']);return db['WhatsappApplication'][_0xbb8c('0x48')](_0xa601d5)[_0xbb8c('0x27')](handleEntityNotFound(_0x5b662e,null))['then'](respondWithResult(_0x5b662e,null))[_0xbb8c('0x46')](handleError(_0x5b662e,null));};exports[_0xbb8c('0x49')]=function(_0x3f0a8b,_0x599e51){return db[_0xbb8c('0x2d')]['create'](_0x3f0a8b[_0xbb8c('0x4a')],{})[_0xbb8c('0x27')](respondWithResult(_0x599e51,0xc9))[_0xbb8c('0x46')](handleError(_0x599e51,null));};exports['update']=function(_0x1953f7,_0x295bb0){if(_0x1953f7[_0xbb8c('0x4a')]['id']){delete _0x1953f7[_0xbb8c('0x4a')]['id'];}return db[_0xbb8c('0x2d')][_0xbb8c('0x48')]({'where':{'id':_0x1953f7[_0xbb8c('0x4b')]['id']}})[_0xbb8c('0x27')](handleEntityNotFound(_0x295bb0,null))[_0xbb8c('0x27')](saveUpdates(_0x1953f7[_0xbb8c('0x4a')],null))['then'](respondWithResult(_0x295bb0,null))[_0xbb8c('0x46')](handleError(_0x295bb0,null));};exports[_0xbb8c('0x28')]=function(_0x4400c7,_0x5c3373){return db[_0xbb8c('0x2d')][_0xbb8c('0x48')]({'where':{'id':_0x4400c7[_0xbb8c('0x4b')]['id']}})[_0xbb8c('0x27')](handleEntityNotFound(_0x5c3373,null))[_0xbb8c('0x27')](removeEntity(_0x5c3373,null))[_0xbb8c('0x46')](handleError(_0x5c3373,null));}; \ No newline at end of file +var _0xb1fa=['send','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','zip-dir','request-promise','sox','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','sendStatus','error','stack','name'];(function(_0x3ad4e1,_0x3d2ca8){var _0x21ca64=function(_0x13f86a){while(--_0x13f86a){_0x3ad4e1['push'](_0x3ad4e1['shift']());}};_0x21ca64(++_0x3d2ca8);}(_0xb1fa,0x9e));var _0xab1f=function(_0x4a80fa,_0x2eb951){_0x4a80fa=_0x4a80fa-0x0;var _0x56daa0=_0xb1fa[_0x4a80fa];return _0x56daa0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab1f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xab1f('0x2'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab1f('0x3'));var squel=require('squel');var crypto=require(_0xab1f('0x4'));var jsforce=require(_0xab1f('0x5'));var deskjs=require('desk.js');var toCsv=require(_0xab1f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab1f('0x7'));var authService=require(_0xab1f('0x8'));var qs=require(_0xab1f('0x9'));var as=require(_0xab1f('0xa'));var hardwareService=require(_0xab1f('0xb'));var logger=require('../../config/logger')(_0xab1f('0xc'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab1f('0xd'));var db=require(_0xab1f('0xe'))['db'];function respondWithStatusCode(_0x5168bb,_0x4cb402){_0x4cb402=_0x4cb402||0xcc;return function(_0xea4a03){if(_0xea4a03){return _0x5168bb['sendStatus'](_0x4cb402);}return _0x5168bb[_0xab1f('0xf')](_0x4cb402)[_0xab1f('0x10')]();};}function respondWithResult(_0x68b4e4,_0x58a0fb){_0x58a0fb=_0x58a0fb||0xc8;return function(_0x2ee266){if(_0x2ee266){return _0x68b4e4[_0xab1f('0xf')](_0x58a0fb)[_0xab1f('0x11')](_0x2ee266);}};}function respondWithFilteredResult(_0x1c0260,_0x5124d6){return function(_0x33fc3a){if(_0x33fc3a){var _0x4c68b0=typeof _0x5124d6[_0xab1f('0x12')]===_0xab1f('0x13')&&typeof _0x5124d6[_0xab1f('0x14')]==='undefined';var _0x1582bd=_0x33fc3a[_0xab1f('0x15')];var _0x558c52=_0x4c68b0?0x0:_0x5124d6[_0xab1f('0x12')];var _0x4ba3f4=_0x4c68b0?_0x33fc3a[_0xab1f('0x15')]:_0x5124d6[_0xab1f('0x12')]+_0x5124d6[_0xab1f('0x14')];var _0x547fc0;if(_0x4ba3f4>=_0x1582bd){_0x4ba3f4=_0x1582bd;_0x547fc0=0xc8;}else{_0x547fc0=0xce;}_0x1c0260[_0xab1f('0xf')](_0x547fc0);return _0x1c0260[_0xab1f('0x16')]('Content-Range',_0x558c52+'-'+_0x4ba3f4+'/'+_0x1582bd)[_0xab1f('0x11')](_0x33fc3a);}return null;};}function patchUpdates(_0x30f973){return function(_0x4fe6d7){try{jsonpatch['apply'](_0x4fe6d7,_0x30f973,!![]);}catch(_0x3103e1){return BPromise[_0xab1f('0x17')](_0x3103e1);}return _0x4fe6d7[_0xab1f('0x18')]();};}function saveUpdates(_0x425b61,_0x1bd51b){return function(_0x2915b9){if(_0x2915b9){return _0x2915b9[_0xab1f('0x19')](_0x425b61)['then'](function(_0x37ae5e){return _0x37ae5e;});}return null;};}function removeEntity(_0x85f20a,_0x3662b8){return function(_0x33b647){if(_0x33b647){return _0x33b647['destroy']()[_0xab1f('0x1a')](function(){_0x85f20a[_0xab1f('0xf')](0xcc)[_0xab1f('0x10')]();});}};}function handleEntityNotFound(_0x162041,_0x5e5434){return function(_0x153083){if(!_0x153083){_0x162041[_0xab1f('0x1b')](0x194);}return _0x153083;};}function handleError(_0xaae884,_0x173a11){_0x173a11=_0x173a11||0x1f4;return function(_0x27d4c3){logger[_0xab1f('0x1c')](_0x27d4c3[_0xab1f('0x1d')]);if(_0x27d4c3['name']){delete _0x27d4c3[_0xab1f('0x1e')];}_0xaae884['status'](_0x173a11)[_0xab1f('0x1f')](_0x27d4c3);};}exports['index']=function(_0x3357b9,_0xf55a53){var _0x2e9ac4={},_0x449e16={},_0x137042={'count':0x0,'rows':[]};var _0x3a6d9d=_[_0xab1f('0x20')](db[_0xab1f('0x21')][_0xab1f('0x22')],function(_0x5d924b){return{'name':_0x5d924b[_0xab1f('0x23')],'type':_0x5d924b['type'][_0xab1f('0x24')]};});_0x449e16[_0xab1f('0x25')]=_[_0xab1f('0x20')](_0x3a6d9d,_0xab1f('0x1e'));_0x449e16[_0xab1f('0x26')]=_['keys'](_0x3357b9[_0xab1f('0x26')]);_0x449e16[_0xab1f('0x27')]=_[_0xab1f('0x28')](_0x449e16['model'],_0x449e16[_0xab1f('0x26')]);_0x2e9ac4['attributes']=_[_0xab1f('0x28')](_0x449e16['model'],qs[_0xab1f('0x29')](_0x3357b9['query'][_0xab1f('0x29')]));_0x2e9ac4[_0xab1f('0x2a')]=_0x2e9ac4[_0xab1f('0x2a')][_0xab1f('0x2b')]?_0x2e9ac4['attributes']:_0x449e16['model'];if(!_0x3357b9[_0xab1f('0x26')]['hasOwnProperty'](_0xab1f('0x2c'))){_0x2e9ac4[_0xab1f('0x14')]=qs[_0xab1f('0x14')](_0x3357b9[_0xab1f('0x26')][_0xab1f('0x14')]);_0x2e9ac4[_0xab1f('0x12')]=qs['offset'](_0x3357b9[_0xab1f('0x26')][_0xab1f('0x12')]);}_0x2e9ac4['order']=qs['sort'](_0x3357b9[_0xab1f('0x26')][_0xab1f('0x2d')]);_0x2e9ac4[_0xab1f('0x2e')]=qs[_0xab1f('0x27')](_[_0xab1f('0x2f')](_0x3357b9[_0xab1f('0x26')],_0x449e16['filters']),_0x3a6d9d);if(_0x3357b9[_0xab1f('0x26')][_0xab1f('0x30')]){_0x2e9ac4[_0xab1f('0x2e')]=_[_0xab1f('0x31')](_0x2e9ac4[_0xab1f('0x2e')],{'$or':_[_0xab1f('0x20')](_0x3a6d9d,function(_0x2bfbae){if(_0x2bfbae['type']!==_0xab1f('0x32')){var _0x315ea1={};_0x315ea1[_0x2bfbae[_0xab1f('0x1e')]]={'$like':'%'+_0x3357b9[_0xab1f('0x26')][_0xab1f('0x30')]+'%'};return _0x315ea1;}})});}_0x2e9ac4=_[_0xab1f('0x31')]({},_0x2e9ac4,_0x3357b9[_0xab1f('0x33')]);var _0x3579e5={'where':_0x2e9ac4[_0xab1f('0x2e')]};return db['WhatsappApplication'][_0xab1f('0x15')](_0x3579e5)[_0xab1f('0x1a')](function(_0x2879bd){_0x137042[_0xab1f('0x15')]=_0x2879bd;if(_0x3357b9[_0xab1f('0x26')][_0xab1f('0x34')]){_0x2e9ac4[_0xab1f('0x35')]=[{'all':!![]}];}return db[_0xab1f('0x21')][_0xab1f('0x36')](_0x2e9ac4);})[_0xab1f('0x1a')](function(_0xe349a6){_0x137042[_0xab1f('0x37')]=_0xe349a6;return _0x137042;})[_0xab1f('0x1a')](respondWithFilteredResult(_0xf55a53,_0x2e9ac4))[_0xab1f('0x38')](handleError(_0xf55a53,null));};exports[_0xab1f('0x39')]=function(_0x58ec4c,_0x13f7e2){var _0x4e0943={'raw':!![],'where':{'id':_0x58ec4c['params']['id']}},_0x3e12c3={};_0x3e12c3[_0xab1f('0x25')]=_[_0xab1f('0x3a')](db[_0xab1f('0x21')][_0xab1f('0x22')]);_0x3e12c3['query']=_[_0xab1f('0x3a')](_0x58ec4c[_0xab1f('0x26')]);_0x3e12c3[_0xab1f('0x27')]=_['intersection'](_0x3e12c3[_0xab1f('0x25')],_0x3e12c3['query']);_0x4e0943['attributes']=_[_0xab1f('0x28')](_0x3e12c3['model'],qs[_0xab1f('0x29')](_0x58ec4c['query']['fields']));_0x4e0943[_0xab1f('0x2a')]=_0x4e0943[_0xab1f('0x2a')][_0xab1f('0x2b')]?_0x4e0943['attributes']:_0x3e12c3[_0xab1f('0x25')];if(_0x58ec4c['query'][_0xab1f('0x34')]){_0x4e0943[_0xab1f('0x35')]=[{'all':!![]}];}_0x4e0943=_[_0xab1f('0x31')]({},_0x4e0943,_0x58ec4c['options']);return db[_0xab1f('0x21')][_0xab1f('0x3b')](_0x4e0943)['then'](handleEntityNotFound(_0x13f7e2,null))[_0xab1f('0x1a')](respondWithResult(_0x13f7e2,null))[_0xab1f('0x38')](handleError(_0x13f7e2,null));};exports[_0xab1f('0x3c')]=function(_0x4e9683,_0x28b1b8){return db[_0xab1f('0x21')][_0xab1f('0x3c')](_0x4e9683[_0xab1f('0x3d')],{})[_0xab1f('0x1a')](respondWithResult(_0x28b1b8,0xc9))['catch'](handleError(_0x28b1b8,null));};exports[_0xab1f('0x19')]=function(_0xa21313,_0x2c11df){if(_0xa21313[_0xab1f('0x3d')]['id']){delete _0xa21313['body']['id'];}return db[_0xab1f('0x21')]['find']({'where':{'id':_0xa21313[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x2c11df,null))[_0xab1f('0x1a')](saveUpdates(_0xa21313['body'],null))['then'](respondWithResult(_0x2c11df,null))[_0xab1f('0x38')](handleError(_0x2c11df,null));};exports['destroy']=function(_0x4905b0,_0x4a2451){return db[_0xab1f('0x21')][_0xab1f('0x3b')]({'where':{'id':_0x4905b0[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x4a2451,null))['then'](removeEntity(_0x4a2451,null))[_0xab1f('0x38')](handleError(_0x4a2451,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index fbb3ef5..a626c7a 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe57e=['../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe57e,0xf2));var _0xee57=function(_0xf3b159,_0x19f251){_0xf3b159=_0xf3b159-0x0;var _0x2e89ce=_0xe57e[_0xf3b159];return _0x2e89ce;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var logger=require(_0xee57('0x1'))(_0xee57('0x2'));var moment=require(_0xee57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee57('0x4'));var rimraf=require('rimraf');var config=require(_0xee57('0x5'));var attributes=require(_0xee57('0x6'));module[_0xee57('0x7')]=function(_0x4e21c4,_0x491334){return _0x4e21c4[_0xee57('0x8')](_0xee57('0x9'),attributes,{'tableName':_0xee57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee57('0xb'),'collate':_0xee57('0xc')});}; \ No newline at end of file +var _0x447b=['exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x3f2f67,_0x4d1d8b){var _0x4e3afb=function(_0xe32d9a){while(--_0xe32d9a){_0x3f2f67['push'](_0x3f2f67['shift']());}};_0x4e3afb(++_0x4d1d8b);}(_0x447b,0xe4));var _0xb447=function(_0x1bec49,_0x5d673c){_0x1bec49=_0x1bec49-0x0;var _0x5cf497=_0x447b[_0x1bec49];return _0x5cf497;};'use strict';var _=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var logger=require('../../config/logger')(_0xb447('0x2'));var moment=require(_0xb447('0x3'));var BPromise=require(_0xb447('0x4'));var rp=require(_0xb447('0x5'));var fs=require('fs');var path=require(_0xb447('0x6'));var rimraf=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var attributes=require(_0xb447('0x9'));module[_0xb447('0xa')]=function(_0x1f132a,_0x514a91){return _0x1f132a['define'](_0xb447('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb447('0xc'),'collate':_0xb447('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index ba8e1fc..50b4356 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x30f4f3,_0x2242cf){var _0x410e81=function(_0x44b049){while(--_0x44b049){_0x30f4f3['push'](_0x30f4f3['shift']());}};_0x410e81(++_0x2242cf);}(_0xfd28,0x148));var _0x8fd2=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xfd28[_0x12f688];return _0x59c3de;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','WhatsappApplication,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2886ff,_0x2bf412){var _0x514b59=function(_0x344cf3){while(--_0x344cf3){_0x2886ff['push'](_0x2886ff['shift']());}};_0x514b59(++_0x2bf412);}(_0x3e74,0x175));var _0x43e7=function(_0x91fe2c,_0x2a24ea){_0x91fe2c=_0x91fe2c-0x0;var _0x101a59=_0x3e74[_0x91fe2c];return _0x101a59;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 88c26e6..0aee6f2 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe015=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','whatsapp','put','tracked','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe015,0x13b));var _0x5e01=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe015[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/describe',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller[_0x5e01('0xd')]);router['get'](_0x5e01('0xe'),auth['isAuthenticated'](),controller[_0x5e01('0xf')]);router['get'](_0x5e01('0x10'),auth[_0x5e01('0x8')](),controller['download']);router[_0x5e01('0x11')]('/',auth[_0x5e01('0x8')](),controller['create']);router['post'](_0x5e01('0xe'),auth[_0x5e01('0x8')](),controller[_0x5e01('0x12')]);router[_0x5e01('0x11')](_0x5e01('0x13'),auth[_0x5e01('0x8')](),interaction['tracked'](_0x5e01('0x14'),'whatsappinteraction:addtags'),controller['addTags']);router[_0x5e01('0x15')](_0x5e01('0xc'),auth['isAuthenticated'](),interaction[_0x5e01('0x16')]('whatsapp',_0x5e01('0x17')),controller['update']);router[_0x5e01('0x18')]('/:id',auth[_0x5e01('0x8')](),interaction['tracked']('whatsapp',_0x5e01('0x19')),controller[_0x5e01('0x1a')]);router['delete'](_0x5e01('0x13'),auth[_0x5e01('0x8')](),controller[_0x5e01('0x1b')]);module[_0x5e01('0x1c')]=router; \ No newline at end of file +var _0x4074=['destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete'];(function(_0x598ef9,_0xb65f88){var _0x5ca020=function(_0x17cec3){while(--_0x17cec3){_0x598ef9['push'](_0x598ef9['shift']());}};_0x5ca020(++_0xb65f88);}(_0x4074,0xf0));var _0x4407=function(_0x28ebe6,_0xb7a686){_0x28ebe6=_0x28ebe6-0x0;var _0x4c75d7=_0x4074[_0x28ebe6];return _0x4c75d7;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var fs_extra=require(_0x4407('0x5'));var auth=require(_0x4407('0x6'));var interaction=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var controller=require(_0x4407('0x9'));router[_0x4407('0xa')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router['get'](_0x4407('0xd'),auth['isAuthenticated'](),controller[_0x4407('0xe')]);router[_0x4407('0xa')](_0x4407('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4407('0x10'),auth[_0x4407('0xb')](),controller[_0x4407('0x11')]);router[_0x4407('0xa')](_0x4407('0x12'),auth[_0x4407('0xb')](),controller[_0x4407('0x13')]);router[_0x4407('0x14')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0x15')]);router[_0x4407('0x14')]('/:id/messages',auth[_0x4407('0xb')](),controller[_0x4407('0x16')]);router['post'](_0x4407('0x17'),auth['isAuthenticated'](),interaction[_0x4407('0x18')](_0x4407('0x19'),_0x4407('0x1a')),controller[_0x4407('0x1b')]);router[_0x4407('0x1c')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction[_0x4407('0x18')]('whatsapp',_0x4407('0x1d')),controller[_0x4407('0x1e')]);router[_0x4407('0x1f')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction['tracked'](_0x4407('0x19'),'whatsappinteraction:destroy'),controller[_0x4407('0x20')]);router[_0x4407('0x1f')](_0x4407('0x17'),auth[_0x4407('0xb')](),controller[_0x4407('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 3f19841..e07bb72 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14f5=['moment','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3d310e,_0x200571){var _0x23ff86=function(_0x1002c2){while(--_0x1002c2){_0x3d310e['push'](_0x3d310e['shift']());}};_0x23ff86(++_0x200571);}(_0x14f5,0xae));var _0x514f=function(_0x398ec1,_0x1d63d8){_0x398ec1=_0x398ec1-0x0;var _0xcd9efa=_0x14f5[_0x398ec1];return _0xcd9efa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x514f('0x0'));module['exports']={'closed':{'type':Sequelize[_0x514f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x514f('0x2')]},'disposition':{'type':Sequelize[_0x514f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x514f('0x3')]},'note':{'type':Sequelize[_0x514f('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x514f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x514f('0x4')]('in',_0x514f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x514f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x514f('0x4')]('in',_0x514f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x514f('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xce50=['STRING','ENUM','out','moment','exports','BOOLEAN','DATE'];(function(_0x516672,_0x432343){var _0x4906b4=function(_0xf5bd8d){while(--_0xf5bd8d){_0x516672['push'](_0x516672['shift']());}};_0x4906b4(++_0x432343);}(_0xce50,0x1d8));var _0x0ce5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xce50[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0ce5('0x0'));module[_0x0ce5('0x1')]={'closed':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0ce5('0x3')]},'disposition':{'type':Sequelize[_0x0ce5('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0ce5('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0ce5('0x5')]('in',_0x0ce5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0ce5('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0ce5('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a132133..2e35cb5 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7d2=['key','getOptions','user','show','query','keys','filters','intersection','model','attributes','fields','merge','options','catch','create','body','find','params','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','setTags','Tag','findAll','color','removeTags','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','disposition','Attachment','basename','existsSync','pipe','createWriteStream','out','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','util','path','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0xf7d2,0x149));var _0x2f7d=function(_0x19a9b5,_0x198382){_0x19a9b5=_0x19a9b5-0x0;var _0x632733=_0xf7d2[_0x19a9b5];return _0x632733;};'use strict';var rimraf=require(_0x2f7d('0x0'));var zipdir=require(_0x2f7d('0x1'));var moment=require(_0x2f7d('0x2'));var BPromise=require('bluebird');var util=require(_0x2f7d('0x3'));var path=require(_0x2f7d('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x2f7d('0x5'));var qs=require(_0x2f7d('0x6'));var pdf=require(_0x2f7d('0x7'));var logger=require(_0x2f7d('0x8'))('api');var config=require(_0x2f7d('0x9'));var db=require(_0x2f7d('0xa'))['db'];config[_0x2f7d('0xb')]=_[_0x2f7d('0xc')](config[_0x2f7d('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f7d('0xb')]));require(_0x2f7d('0xd'))[_0x2f7d('0xe')](socket);function respondWithStatusCode(_0x54c9e3,_0x135724){_0x135724=_0x135724||0xcc;return function(_0x3b9d52){if(_0x3b9d52){return _0x54c9e3[_0x2f7d('0xf')](_0x135724);}return _0x54c9e3[_0x2f7d('0x10')](_0x135724)[_0x2f7d('0x11')]();};}function respondWithResult(_0x4968b8,_0x4b4ab5){_0x4b4ab5=_0x4b4ab5||0xc8;return function(_0x35c242){if(_0x35c242){return _0x4968b8[_0x2f7d('0x10')](_0x4b4ab5)[_0x2f7d('0x12')](_0x35c242);}};}function respondWithFilteredResult(_0x5ac5a4,_0x4de7d7){return function(_0x12c760){if(_0x12c760){var _0x3c089d=typeof _0x4de7d7[_0x2f7d('0x13')]==='undefined'&&typeof _0x4de7d7[_0x2f7d('0x14')]==='undefined';var _0x358fd5=_0x12c760[_0x2f7d('0x15')];var _0x11e1aa=_0x3c089d?0x0:_0x4de7d7[_0x2f7d('0x13')];var _0x5c3ced=_0x3c089d?_0x12c760['count']:_0x4de7d7[_0x2f7d('0x13')]+_0x4de7d7[_0x2f7d('0x14')];var _0x5d0cb9;if(_0x5c3ced>=_0x358fd5){_0x5c3ced=_0x358fd5;_0x5d0cb9=0xc8;}else{_0x5d0cb9=0xce;}_0x5ac5a4[_0x2f7d('0x10')](_0x5d0cb9);return _0x5ac5a4['set'](_0x2f7d('0x16'),_0x11e1aa+'-'+_0x5c3ced+'/'+_0x358fd5)['json'](_0x12c760);}return null;};}function saveUpdates(_0x552cc9){return function(_0x5264ca){if(_0x5264ca){return _0x5264ca[_0x2f7d('0x17')](_0x552cc9)[_0x2f7d('0x18')](function(_0x4ac70e){return _0x4ac70e;});}return null;};}function removeEntity(_0x2656da){return function(_0x295114){if(_0x295114){return _0x295114[_0x2f7d('0x19')]()[_0x2f7d('0x18')](function(){_0x2656da[_0x2f7d('0x10')](0xcc)[_0x2f7d('0x11')]();});}};}function handleEntityNotFound(_0x43bfb0){return function(_0x27dad7){if(!_0x27dad7){_0x43bfb0[_0x2f7d('0xf')](0x194);}return _0x27dad7;};}function handleError(_0x5b046d,_0x217987){_0x217987=_0x217987||0x1f4;return function(_0x947ac4){logger[_0x2f7d('0x1a')](_0x947ac4[_0x2f7d('0x1b')]);if(_0x947ac4[_0x2f7d('0x1c')]){delete _0x947ac4['name'];}_0x5b046d[_0x2f7d('0x10')](_0x217987)[_0x2f7d('0x1d')](_0x947ac4);};}exports[_0x2f7d('0x1e')]=function(_0x7e2fba,_0x469c5a){var _0x7fece1={};var _0x25704e=_['map'](db[_0x2f7d('0x1f')][_0x2f7d('0x20')],function(_0x38e94f){return{'name':_0x38e94f[_0x2f7d('0x21')],'type':_0x38e94f['type'][_0x2f7d('0x22')]};});_0x7fece1=qs[_0x2f7d('0x23')](_0x25704e,_0x7e2fba);return interaction['findAll']('whatsapp',_0x7e2fba['query'],_0x7e2fba[_0x2f7d('0x24')],_0x7fece1,_0x25704e)[_0x2f7d('0x18')](respondWithFilteredResult(_0x469c5a,_0x7fece1))['catch'](handleError(_0x469c5a,null));};exports[_0x2f7d('0x25')]=function(_0x5308ec,_0xb4c5c5){var _0xbf6a79={'raw':![],'where':{'id':_0x5308ec['params']['id']}},_0x36288a={};_0x36288a['model']=_['keys'](db[_0x2f7d('0x1f')][_0x2f7d('0x20')]);_0x36288a[_0x2f7d('0x26')]=_[_0x2f7d('0x27')](_0x5308ec[_0x2f7d('0x26')]);_0x36288a[_0x2f7d('0x28')]=_[_0x2f7d('0x29')](_0x36288a[_0x2f7d('0x2a')],_0x36288a[_0x2f7d('0x26')]);_0xbf6a79[_0x2f7d('0x2b')]=_['intersection'](_0x36288a[_0x2f7d('0x2a')],qs[_0x2f7d('0x2c')](_0x5308ec[_0x2f7d('0x26')]['fields']));_0xbf6a79['attributes']=_0xbf6a79[_0x2f7d('0x2b')]['length']?_0xbf6a79[_0x2f7d('0x2b')]:_0x36288a['model'];if(_0x5308ec['query']['includeAll']){_0xbf6a79['include']=[{'all':!![]}];}_0xbf6a79=_[_0x2f7d('0x2d')]({},_0xbf6a79,_0x5308ec[_0x2f7d('0x2e')]);return db[_0x2f7d('0x1f')]['find'](_0xbf6a79)[_0x2f7d('0x18')](handleEntityNotFound(_0xb4c5c5,null))[_0x2f7d('0x18')](respondWithResult(_0xb4c5c5,null))[_0x2f7d('0x2f')](handleError(_0xb4c5c5,null));};exports[_0x2f7d('0x30')]=function(_0x3d5217,_0x4ff6f1){return db[_0x2f7d('0x1f')][_0x2f7d('0x30')](_0x3d5217[_0x2f7d('0x31')],{})[_0x2f7d('0x18')](respondWithResult(_0x4ff6f1,0xc9))['catch'](handleError(_0x4ff6f1,null));};exports[_0x2f7d('0x17')]=function(_0x168bc0,_0x44d3c6){if(_0x168bc0[_0x2f7d('0x31')]['id']){delete _0x168bc0[_0x2f7d('0x31')]['id'];}return db[_0x2f7d('0x1f')][_0x2f7d('0x32')]({'where':{'id':_0x168bc0['params']['id']}})[_0x2f7d('0x18')](handleEntityNotFound(_0x44d3c6,null))[_0x2f7d('0x18')](saveUpdates(_0x168bc0[_0x2f7d('0x31')],null))[_0x2f7d('0x18')](respondWithResult(_0x44d3c6,null))[_0x2f7d('0x2f')](handleError(_0x44d3c6,null));};exports[_0x2f7d('0x19')]=function(_0x1b599f,_0x5aea22){return db[_0x2f7d('0x1f')][_0x2f7d('0x32')]({'where':{'id':_0x1b599f[_0x2f7d('0x33')]['id']}})['then'](handleEntityNotFound(_0x5aea22,null))[_0x2f7d('0x18')](removeEntity(_0x5aea22,null))[_0x2f7d('0x2f')](handleError(_0x5aea22,null));};exports[_0x2f7d('0x34')]=function(_0x352eff,_0x3f58f1){return db[_0x2f7d('0x1f')][_0x2f7d('0x34')]()[_0x2f7d('0x18')](respondWithResult(_0x3f58f1,null))['catch'](handleError(_0x3f58f1,null));};exports[_0x2f7d('0x35')]=function(_0x1a5908,_0x19d654){return db[_0x2f7d('0x36')][_0x2f7d('0x32')]({'where':{'id':_0x1a5908[_0x2f7d('0x33')]['id']}})['then'](handleEntityNotFound(_0x19d654,null))[_0x2f7d('0x18')](function(_0x36c71f){if(_0x36c71f){return _0x36c71f['addMessage'](_0x1a5908[_0x2f7d('0x31')][_0x2f7d('0x37')],_[_0x2f7d('0x38')](_0x1a5908[_0x2f7d('0x31')],[_0x2f7d('0x37'),'id'])||{});}})['then'](respondWithResult(_0x19d654,null))[_0x2f7d('0x2f')](handleError(_0x19d654,null));};exports['getMessages']=function(_0x21cbc4,_0x55cf65){var _0x13443a={'raw':![],'where':{}};var _0x833fc4={};var _0x59296c={'count':0x0,'rows':[]};return db[_0x2f7d('0x1f')][_0x2f7d('0x39')]({'where':{'id':_0x21cbc4[_0x2f7d('0x33')]['id']}})['then'](handleEntityNotFound(_0x55cf65,null))[_0x2f7d('0x18')](function(_0xdc5d3b){if(_0xdc5d3b){_0x833fc4[_0x2f7d('0x2a')]=_[_0x2f7d('0x27')](db[_0x2f7d('0x36')]['rawAttributes']);_0x833fc4['query']=_[_0x2f7d('0x27')](_0x21cbc4['query']);_0x833fc4['filters']=_[_0x2f7d('0x29')](_0x833fc4['model'],_0x833fc4['query']);_0x13443a[_0x2f7d('0x2b')]=_[_0x2f7d('0x29')](_0x833fc4[_0x2f7d('0x2a')],qs[_0x2f7d('0x2c')](_0x21cbc4['query'][_0x2f7d('0x2c')]));_0x13443a['attributes']=_0x13443a['attributes']['length']?_0x13443a['attributes']:_0x833fc4[_0x2f7d('0x2a')];if(!_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x3a')](_0x2f7d('0x3b'))){_0x13443a[_0x2f7d('0x14')]=qs[_0x2f7d('0x14')](_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x14')]);_0x13443a['offset']=qs['offset'](_0x21cbc4['query'][_0x2f7d('0x13')]);}_0x13443a[_0x2f7d('0x3c')]=qs[_0x2f7d('0x3d')](_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x3d')]);_0x13443a[_0x2f7d('0x3e')]=qs['filters'](_['pick'](_0x21cbc4[_0x2f7d('0x26')],_0x833fc4[_0x2f7d('0x28')]));_0x13443a['where']['WhatsappInteractionId']=_0xdc5d3b['id'];if(_0x21cbc4['query'][_0x2f7d('0x3f')]){_0x13443a[_0x2f7d('0x3e')]=_['merge'](_0x13443a[_0x2f7d('0x3e')],{'$or':_[_0x2f7d('0x40')](_0x13443a[_0x2f7d('0x2b')],function(_0x5924c0){var _0x8cf61={};_0x8cf61[_0x5924c0]={'$like':'%'+_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x3f')]+'%'};return _0x8cf61;})});}if(_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x41')]){var _0x1e5e04=_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x41')]['split'](',');var _0x22e0d5={};_0x22e0d5[_0x1e5e04[0x0]]={'$gte':moment(_0x1e5e04[0x1])[_0x2f7d('0x42')](_0x2f7d('0x43'))};_0x13443a[_0x2f7d('0x3e')]=_[_0x2f7d('0x2d')](_0x13443a[_0x2f7d('0x3e')],_0x22e0d5);}_0x13443a=_[_0x2f7d('0x2d')]({},_0x13443a,_0x21cbc4['options']);return db[_0x2f7d('0x36')]['count']({'where':_0x13443a[_0x2f7d('0x3e')]})['then'](function(_0x2558a0){_0x59296c[_0x2f7d('0x15')]=_0x2558a0;if(_0x21cbc4[_0x2f7d('0x26')][_0x2f7d('0x44')]){_0x13443a[_0x2f7d('0x45')]=[{'all':!![]}];}return db[_0x2f7d('0x36')]['findAll'](_0x13443a);})[_0x2f7d('0x18')](function(_0x496d9){_0x59296c[_0x2f7d('0x46')]=_0x496d9;return _0x59296c;});}})[_0x2f7d('0x18')](respondWithFilteredResult(_0x55cf65,_0x13443a))[_0x2f7d('0x2f')](handleError(_0x55cf65,null));};exports[_0x2f7d('0x47')]=function(_0x453575,_0x313ecd){return db[_0x2f7d('0x1f')]['find']({'where':{'id':_0x453575['params']['id']}})['then'](handleEntityNotFound(_0x313ecd,null))[_0x2f7d('0x18')](function(_0x462d61){if(_0x462d61){return _0x462d61[_0x2f7d('0x48')](_0x453575[_0x2f7d('0x31')]['ids'],_[_0x2f7d('0x38')](_0x453575[_0x2f7d('0x31')],[_0x2f7d('0x37'),'id'])||{})['spread'](function(){return db[_0x2f7d('0x49')][_0x2f7d('0x4a')]({'attributes':['id',_0x2f7d('0x1c'),_0x2f7d('0x4b')],'where':{'id':_0x453575[_0x2f7d('0x31')][_0x2f7d('0x37')]}});})[_0x2f7d('0x18')](function(_0x4dcb5b){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x453575[_0x2f7d('0x33')]['id']),'tags':_0x4dcb5b||[]});return{'id':Number(_0x453575[_0x2f7d('0x33')]['id']),'tags':_0x4dcb5b||[]};});}})[_0x2f7d('0x18')](respondWithResult(_0x313ecd,null))[_0x2f7d('0x2f')](handleError(_0x313ecd,null));};exports[_0x2f7d('0x4c')]=function(_0x27db89,_0x32887f){return db['WhatsappInteraction'][_0x2f7d('0x32')]({'where':{'id':_0x27db89[_0x2f7d('0x33')]['id']}})[_0x2f7d('0x18')](handleEntityNotFound(_0x32887f,null))['then'](function(_0x368ef8){if(_0x368ef8){return _0x368ef8[_0x2f7d('0x4c')](_0x27db89[_0x2f7d('0x26')][_0x2f7d('0x37')]);}})[_0x2f7d('0x18')](respondWithStatusCode(_0x32887f,null))[_0x2f7d('0x2f')](handleError(_0x32887f,null));};exports['download']=function(_0x154af6,_0x19888a){var _0x2a6fc9=moment()[_0x2f7d('0x4d')]()[_0x2f7d('0x4e')]();var _0x1e844b=path[_0x2f7d('0x4f')](config[_0x2f7d('0x50')],_0x2f7d('0x51'),'files',_0x2f7d('0x52'));var _0x22dfd8=path['join'](config[_0x2f7d('0x50')],_0x2f7d('0x51'),_0x2f7d('0x53'),_0x2f7d('0x54'));var _0x4f0d31=path[_0x2f7d('0x4f')](_0x1e844b,_0x2a6fc9);var _0x4c2231=util[_0x2f7d('0x42')](_0x2f7d('0x55'),_0x154af6[_0x2f7d('0x33')]['id'],_0x2a6fc9);var _0x50bc0f=path[_0x2f7d('0x4f')](_0x1e844b,_0x4c2231);var _0x40c03e=[];_0x40c03e[_0x2f7d('0x56')]({'model':db[_0x2f7d('0x57')],'as':_0x2f7d('0x57'),'attributes':['id',_0x2f7d('0x58')],'raw':!![]});_0x40c03e[_0x2f7d('0x56')]({'model':db[_0x2f7d('0x59')],'as':_0x2f7d('0x5a'),'attributes':['id',_0x2f7d('0x5b'),_0x2f7d('0x5c')],'raw':!![]});if(_0x154af6[_0x2f7d('0x26')]['attachments']){_0x40c03e[_0x2f7d('0x56')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x105630=[{'model':db[_0x2f7d('0x36')],'as':_0x2f7d('0x5d'),'attributes':['id',_0x2f7d('0x31'),'createdAt',_0x2f7d('0x5e'),_0x2f7d('0x5f'),_0x2f7d('0x60')],'include':_0x40c03e}];_0x105630[_0x2f7d('0x56')]({'model':db[_0x2f7d('0x61')],'as':_0x2f7d('0x62'),'attributes':['id',_0x2f7d('0x1c')]});_0x105630[_0x2f7d('0x56')]({'model':db[_0x2f7d('0x57')],'as':_0x2f7d('0x63'),'attributes':['id',_0x2f7d('0x58')]});return db[_0x2f7d('0x1f')][_0x2f7d('0x32')]({'where':{'id':_0x154af6[_0x2f7d('0x33')]['id']},'include':_0x105630})[_0x2f7d('0x18')](handleEntityNotFound(_0x19888a,null))[_0x2f7d('0x18')](function(_0x252f2a){if(_0x252f2a){var _0x2517bc=_0x252f2a['get']({'plain':!![]});fs[_0x2f7d('0x64')](_0x4f0d31);var _0xe4f09e={'channel':_0x2f7d('0x65'),'account':_0x2517bc[_0x2f7d('0x62')][_0x2f7d('0x1c')],'agent':_0x2517bc['Owner']?_0x2517bc[_0x2f7d('0x63')]['fullname']:_0x2f7d('0x66'),'createdAt':moment(_0x2517bc[_0x2f7d('0x67')])[_0x2f7d('0x42')](_0x2f7d('0x43'))[_0x2f7d('0x4e')](),'closedAt':_0x2517bc[_0x2f7d('0x68')]?moment(_0x2517bc[_0x2f7d('0x69')])[_0x2f7d('0x42')](_0x2f7d('0x43'))[_0x2f7d('0x4e')]():'','disposition':_0x2517bc[_0x2f7d('0x6a')],'messages':_(_0x2517bc[_0x2f7d('0x5d')])[_0x2f7d('0x3f')]({'secret':![]})[_0x2f7d('0x40')](function(_0x27eacb){if(_0x27eacb[_0x2f7d('0x6b')]){var _0x3423ab=path[_0x2f7d('0x4f')](_0x22dfd8,_0x27eacb['Attachment'][_0x2f7d('0x6c')]);if(fs[_0x2f7d('0x6d')](_0x3423ab)){fs['createReadStream'](_0x3423ab)[_0x2f7d('0x6e')](fs[_0x2f7d('0x6f')](path[_0x2f7d('0x4f')](_0x4f0d31,_0x27eacb['Attachment'][_0x2f7d('0x6c')])));}}return{'date':moment(_0x27eacb[_0x2f7d('0x67')])[_0x2f7d('0x42')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2f7d('0x4e')](),'sender':_0x27eacb['direction']==='out'?_0x27eacb[_0x2f7d('0x57')]?_0x27eacb[_0x2f7d('0x57')][_0x2f7d('0x58')]:'System':_0x27eacb[_0x2f7d('0x5a')][_0x2f7d('0x5b')]+(_0x27eacb['Contact'][_0x2f7d('0x5c')]?'\x20'+_0x27eacb[_0x2f7d('0x5a')][_0x2f7d('0x5c')]:''),'body':_0x27eacb[_0x2f7d('0x6b')]?_0x27eacb[_0x2f7d('0x6b')][_0x2f7d('0x6c')]:_0x27eacb[_0x2f7d('0x31')],'direction':_0x27eacb[_0x2f7d('0x5e')]===_0x2f7d('0x70')?'A':'C','secret':_0x27eacb[_0x2f7d('0x5f')],'read':_0x27eacb['read'],'attachment':_0x27eacb['Attachment']};})[_0x2f7d('0x71')]()};return ejs['renderFile'](path['join'](config[_0x2f7d('0x50')],'server',_0x2f7d('0x72'),_0x2f7d('0x73')),{'interaction':_0xe4f09e})[_0x2f7d('0x18')](function(_0x1510ab){var _0x41da75=path[_0x2f7d('0x4f')](_0x4f0d31,_0x2f7d('0x74')+_0x2517bc['id']+'-'+_0x2a6fc9+_0x2f7d('0x75'));var _0x28b544={'path':_0x41da75,'channel':'Whatsapp','interactionId':_0x2517bc['id']};return pdf[_0x2f7d('0x76')](_0x1510ab,_0x28b544);})['then'](function(){return new BPromise(function(_0x96d285,_0x2ea900){zipdir(_0x4f0d31,{'saveTo':_0x50bc0f},function(_0x10c60d,_0x2bd75b){if(_0x10c60d)return _0x2ea900(_0x10c60d);return _0x96d285(_0x2bd75b);});})[_0x2f7d('0x18')](function(){return new BPromise(function(_0x510cf9,_0x3b8c0a){rimraf(_0x4f0d31,function(_0x335dc3){if(_0x335dc3)_0x3b8c0a(_0x335dc3);return _0x510cf9();});});})[_0x2f7d('0x18')](function(){return _0x19888a['download'](_0x50bc0f,_0x4c2231,function(_0x29d5ce){if(_0x29d5ce){console['log'](_0x2f7d('0x77'),_0x29d5ce);}else{fs[_0x2f7d('0x78')](_0x50bc0f);}});});});}else{return _0x19888a[_0x2f7d('0xf')](0xc8);}})[_0x2f7d('0x2f')](handleError(_0x19888a,null));}; \ No newline at end of file +var _0x45a0=['tmp','server','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','pipe','createWriteStream','basename','out','System','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','end','stack','name','index','map','WhatsappInteraction','rawAttributes','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','attributes','fields','length','includeAll','include','merge','options','create','body','update','find','describe','addMessage','WhatsappMessage','ids','findOne','intersection','nolimit','sort','where','WhatsappInteractionId','filter','$gte','format','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','files'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x45a0,0x1a2));var _0x045a=function(_0x56a5ff,_0x44bb97){_0x56a5ff=_0x56a5ff-0x0;var _0x596c86=_0x45a0[_0x56a5ff];return _0x596c86;};'use strict';var rimraf=require(_0x045a('0x0'));var zipdir=require(_0x045a('0x1'));var moment=require(_0x045a('0x2'));var BPromise=require(_0x045a('0x3'));var util=require(_0x045a('0x4'));var path=require(_0x045a('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x045a('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x045a('0x7'));var pdf=require(_0x045a('0x8'));var logger=require(_0x045a('0x9'))(_0x045a('0xa'));var config=require(_0x045a('0xb'));var db=require(_0x045a('0xc'))['db'];config['redis']=_[_0x045a('0xd')](config[_0x045a('0xe')],{'host':_0x045a('0xf'),'port':0x18eb});var socket=require(_0x045a('0x10'))(new Redis(config[_0x045a('0xe')]));require(_0x045a('0x11'))[_0x045a('0x12')](socket);function respondWithStatusCode(_0x4886ae,_0x4eaf12){_0x4eaf12=_0x4eaf12||0xcc;return function(_0x289b69){if(_0x289b69){return _0x4886ae[_0x045a('0x13')](_0x4eaf12);}return _0x4886ae[_0x045a('0x14')](_0x4eaf12)['end']();};}function respondWithResult(_0x306b9b,_0x5a4003){_0x5a4003=_0x5a4003||0xc8;return function(_0x4e4ee6){if(_0x4e4ee6){return _0x306b9b['status'](_0x5a4003)[_0x045a('0x15')](_0x4e4ee6);}};}function respondWithFilteredResult(_0x214971,_0x44f19c){return function(_0x30b2d8){if(_0x30b2d8){var _0x47adf5=typeof _0x44f19c[_0x045a('0x16')]===_0x045a('0x17')&&typeof _0x44f19c[_0x045a('0x18')]===_0x045a('0x17');var _0x2f87e2=_0x30b2d8[_0x045a('0x19')];var _0x5171c6=_0x47adf5?0x0:_0x44f19c[_0x045a('0x16')];var _0x11141d=_0x47adf5?_0x30b2d8[_0x045a('0x19')]:_0x44f19c[_0x045a('0x16')]+_0x44f19c[_0x045a('0x18')];var _0x4681fc;if(_0x11141d>=_0x2f87e2){_0x11141d=_0x2f87e2;_0x4681fc=0xc8;}else{_0x4681fc=0xce;}_0x214971[_0x045a('0x14')](_0x4681fc);return _0x214971[_0x045a('0x1a')](_0x045a('0x1b'),_0x5171c6+'-'+_0x11141d+'/'+_0x2f87e2)[_0x045a('0x15')](_0x30b2d8);}return null;};}function saveUpdates(_0x328d76){return function(_0x1ebe1c){if(_0x1ebe1c){return _0x1ebe1c['update'](_0x328d76)['then'](function(_0x1af496){return _0x1af496;});}return null;};}function removeEntity(_0x11d621){return function(_0x4cbc57){if(_0x4cbc57){return _0x4cbc57[_0x045a('0x1c')]()[_0x045a('0x1d')](function(){_0x11d621[_0x045a('0x14')](0xcc)[_0x045a('0x1e')]();});}};}function handleEntityNotFound(_0x1de387){return function(_0x5be490){if(!_0x5be490){_0x1de387[_0x045a('0x13')](0x194);}return _0x5be490;};}function handleError(_0x9785f6,_0x367a69){_0x367a69=_0x367a69||0x1f4;return function(_0x202baa){logger['error'](_0x202baa[_0x045a('0x1f')]);if(_0x202baa[_0x045a('0x20')]){delete _0x202baa[_0x045a('0x20')];}_0x9785f6[_0x045a('0x14')](_0x367a69)['send'](_0x202baa);};}exports[_0x045a('0x21')]=function(_0x4f0aa3,_0x1d6522){var _0x5cf7d6={};var _0x254c99=_[_0x045a('0x22')](db[_0x045a('0x23')][_0x045a('0x24')],function(_0x231080){return{'name':_0x231080['fieldName'],'type':_0x231080['type']['key']};});_0x5cf7d6=qs[_0x045a('0x25')](_0x254c99,_0x4f0aa3);return interaction[_0x045a('0x26')](_0x045a('0x27'),_0x4f0aa3[_0x045a('0x28')],_0x4f0aa3[_0x045a('0x29')],_0x5cf7d6,_0x254c99)[_0x045a('0x1d')](respondWithFilteredResult(_0x1d6522,_0x5cf7d6))[_0x045a('0x2a')](handleError(_0x1d6522,null));};exports[_0x045a('0x2b')]=function(_0x6ae4e3,_0x427b5f){var _0x3f6296={'raw':![],'where':{'id':_0x6ae4e3[_0x045a('0x2c')]['id']}},_0x57f317={};_0x57f317[_0x045a('0x2d')]=_['keys'](db['WhatsappInteraction'][_0x045a('0x24')]);_0x57f317['query']=_[_0x045a('0x2e')](_0x6ae4e3[_0x045a('0x28')]);_0x57f317[_0x045a('0x2f')]=_['intersection'](_0x57f317[_0x045a('0x2d')],_0x57f317[_0x045a('0x28')]);_0x3f6296[_0x045a('0x30')]=_['intersection'](_0x57f317[_0x045a('0x2d')],qs[_0x045a('0x31')](_0x6ae4e3[_0x045a('0x28')][_0x045a('0x31')]));_0x3f6296[_0x045a('0x30')]=_0x3f6296[_0x045a('0x30')][_0x045a('0x32')]?_0x3f6296['attributes']:_0x57f317[_0x045a('0x2d')];if(_0x6ae4e3[_0x045a('0x28')][_0x045a('0x33')]){_0x3f6296[_0x045a('0x34')]=[{'all':!![]}];}_0x3f6296=_[_0x045a('0x35')]({},_0x3f6296,_0x6ae4e3[_0x045a('0x36')]);return db[_0x045a('0x23')]['find'](_0x3f6296)['then'](handleEntityNotFound(_0x427b5f,null))[_0x045a('0x1d')](respondWithResult(_0x427b5f,null))['catch'](handleError(_0x427b5f,null));};exports[_0x045a('0x37')]=function(_0x4b95c7,_0x51efd4){return db[_0x045a('0x23')][_0x045a('0x37')](_0x4b95c7[_0x045a('0x38')],{})[_0x045a('0x1d')](respondWithResult(_0x51efd4,0xc9))['catch'](handleError(_0x51efd4,null));};exports[_0x045a('0x39')]=function(_0x106ddd,_0x14e18f){if(_0x106ddd[_0x045a('0x38')]['id']){delete _0x106ddd[_0x045a('0x38')]['id'];}return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0x106ddd[_0x045a('0x2c')]['id']}})[_0x045a('0x1d')](handleEntityNotFound(_0x14e18f,null))[_0x045a('0x1d')](saveUpdates(_0x106ddd[_0x045a('0x38')],null))['then'](respondWithResult(_0x14e18f,null))[_0x045a('0x2a')](handleError(_0x14e18f,null));};exports['destroy']=function(_0xc7e1e0,_0x1f8386){return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0xc7e1e0[_0x045a('0x2c')]['id']}})[_0x045a('0x1d')](handleEntityNotFound(_0x1f8386,null))['then'](removeEntity(_0x1f8386,null))[_0x045a('0x2a')](handleError(_0x1f8386,null));};exports[_0x045a('0x3b')]=function(_0x78cce1,_0x70b6b4){return db[_0x045a('0x23')][_0x045a('0x3b')]()[_0x045a('0x1d')](respondWithResult(_0x70b6b4,null))[_0x045a('0x2a')](handleError(_0x70b6b4,null));};exports[_0x045a('0x3c')]=function(_0x3cb98b,_0xb9b150){return db[_0x045a('0x3d')][_0x045a('0x3a')]({'where':{'id':_0x3cb98b[_0x045a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xb9b150,null))[_0x045a('0x1d')](function(_0x92871c){if(_0x92871c){return _0x92871c['addMessage'](_0x3cb98b[_0x045a('0x38')]['ids'],_['omit'](_0x3cb98b[_0x045a('0x38')],[_0x045a('0x3e'),'id'])||{});}})[_0x045a('0x1d')](respondWithResult(_0xb9b150,null))['catch'](handleError(_0xb9b150,null));};exports['getMessages']=function(_0x5e8d8f,_0xbc829f){var _0x354fbd={'raw':![],'where':{}};var _0x57be41={};var _0x1ec744={'count':0x0,'rows':[]};return db[_0x045a('0x23')][_0x045a('0x3f')]({'where':{'id':_0x5e8d8f['params']['id']}})['then'](handleEntityNotFound(_0xbc829f,null))[_0x045a('0x1d')](function(_0x3f131d){if(_0x3f131d){_0x57be41[_0x045a('0x2d')]=_[_0x045a('0x2e')](db[_0x045a('0x3d')][_0x045a('0x24')]);_0x57be41[_0x045a('0x28')]=_[_0x045a('0x2e')](_0x5e8d8f['query']);_0x57be41[_0x045a('0x2f')]=_[_0x045a('0x40')](_0x57be41[_0x045a('0x2d')],_0x57be41[_0x045a('0x28')]);_0x354fbd[_0x045a('0x30')]=_[_0x045a('0x40')](_0x57be41['model'],qs[_0x045a('0x31')](_0x5e8d8f['query'][_0x045a('0x31')]));_0x354fbd[_0x045a('0x30')]=_0x354fbd[_0x045a('0x30')]['length']?_0x354fbd[_0x045a('0x30')]:_0x57be41[_0x045a('0x2d')];if(!_0x5e8d8f['query']['hasOwnProperty'](_0x045a('0x41'))){_0x354fbd['limit']=qs['limit'](_0x5e8d8f[_0x045a('0x28')][_0x045a('0x18')]);_0x354fbd[_0x045a('0x16')]=qs[_0x045a('0x16')](_0x5e8d8f[_0x045a('0x28')][_0x045a('0x16')]);}_0x354fbd['order']=qs[_0x045a('0x42')](_0x5e8d8f[_0x045a('0x28')][_0x045a('0x42')]);_0x354fbd[_0x045a('0x43')]=qs[_0x045a('0x2f')](_['pick'](_0x5e8d8f[_0x045a('0x28')],_0x57be41[_0x045a('0x2f')]));_0x354fbd['where'][_0x045a('0x44')]=_0x3f131d['id'];if(_0x5e8d8f[_0x045a('0x28')][_0x045a('0x45')]){_0x354fbd['where']=_[_0x045a('0x35')](_0x354fbd[_0x045a('0x43')],{'$or':_[_0x045a('0x22')](_0x354fbd[_0x045a('0x30')],function(_0x5685d4){var _0x2f2776={};_0x2f2776[_0x5685d4]={'$like':'%'+_0x5e8d8f[_0x045a('0x28')][_0x045a('0x45')]+'%'};return _0x2f2776;})});}if(_0x5e8d8f[_0x045a('0x28')]['$gte']){var _0x2698bb=_0x5e8d8f[_0x045a('0x28')][_0x045a('0x46')]['split'](',');var _0xb909e6={};_0xb909e6[_0x2698bb[0x0]]={'$gte':moment(_0x2698bb[0x1])[_0x045a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x354fbd[_0x045a('0x43')]=_[_0x045a('0x35')](_0x354fbd[_0x045a('0x43')],_0xb909e6);}_0x354fbd=_[_0x045a('0x35')]({},_0x354fbd,_0x5e8d8f[_0x045a('0x36')]);return db[_0x045a('0x3d')][_0x045a('0x19')]({'where':_0x354fbd['where']})[_0x045a('0x1d')](function(_0x4b729b){_0x1ec744[_0x045a('0x19')]=_0x4b729b;if(_0x5e8d8f[_0x045a('0x28')][_0x045a('0x33')]){_0x354fbd[_0x045a('0x34')]=[{'all':!![]}];}return db[_0x045a('0x3d')][_0x045a('0x26')](_0x354fbd);})['then'](function(_0x18f712){_0x1ec744['rows']=_0x18f712;return _0x1ec744;});}})[_0x045a('0x1d')](respondWithFilteredResult(_0xbc829f,_0x354fbd))[_0x045a('0x2a')](handleError(_0xbc829f,null));};exports['addTags']=function(_0x381baf,_0xee9aaf){return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0x381baf[_0x045a('0x2c')]['id']}})[_0x045a('0x1d')](handleEntityNotFound(_0xee9aaf,null))[_0x045a('0x1d')](function(_0x17150e){if(_0x17150e){return _0x17150e[_0x045a('0x48')](_0x381baf[_0x045a('0x38')][_0x045a('0x3e')],_[_0x045a('0x49')](_0x381baf[_0x045a('0x38')],[_0x045a('0x3e'),'id'])||{})[_0x045a('0x4a')](function(){return db[_0x045a('0x4b')][_0x045a('0x26')]({'attributes':['id',_0x045a('0x20'),_0x045a('0x4c')],'where':{'id':_0x381baf['body'][_0x045a('0x3e')]}});})[_0x045a('0x1d')](function(_0x136e18){socket[_0x045a('0x4d')](_0x045a('0x4e'),{'id':Number(_0x381baf[_0x045a('0x2c')]['id']),'tags':_0x136e18||[]});return{'id':Number(_0x381baf[_0x045a('0x2c')]['id']),'tags':_0x136e18||[]};});}})[_0x045a('0x1d')](respondWithResult(_0xee9aaf,null))[_0x045a('0x2a')](handleError(_0xee9aaf,null));};exports[_0x045a('0x4f')]=function(_0x509ab2,_0x16cb62){return db['WhatsappInteraction'][_0x045a('0x3a')]({'where':{'id':_0x509ab2[_0x045a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x16cb62,null))['then'](function(_0x2cbeaa){if(_0x2cbeaa){return _0x2cbeaa[_0x045a('0x4f')](_0x509ab2[_0x045a('0x28')][_0x045a('0x3e')]);}})[_0x045a('0x1d')](respondWithStatusCode(_0x16cb62,null))[_0x045a('0x2a')](handleError(_0x16cb62,null));};exports[_0x045a('0x50')]=function(_0x2ee865,_0x3306e3){var _0x34def3=moment()[_0x045a('0x51')]()[_0x045a('0x52')]();var _0x218131=path[_0x045a('0x53')](config[_0x045a('0x54')],'server',_0x045a('0x55'),_0x045a('0x56'));var _0x480743=path[_0x045a('0x53')](config[_0x045a('0x54')],_0x045a('0x57'),'files',_0x045a('0x58'));var _0x4334e4=path[_0x045a('0x53')](_0x218131,_0x34def3);var _0x225653=util[_0x045a('0x47')](_0x045a('0x59'),_0x2ee865[_0x045a('0x2c')]['id'],_0x34def3);var _0x373d88=path[_0x045a('0x53')](_0x218131,_0x225653);var _0x141ab2=[];_0x141ab2['push']({'model':db['User'],'as':_0x045a('0x5a'),'attributes':['id',_0x045a('0x5b')],'raw':!![]});_0x141ab2[_0x045a('0x5c')]({'model':db[_0x045a('0x5d')],'as':_0x045a('0x5e'),'attributes':['id','firstName',_0x045a('0x5f')],'raw':!![]});if(_0x2ee865['query']['attachments']){_0x141ab2[_0x045a('0x5c')]({'model':db[_0x045a('0x60')],'as':_0x045a('0x60'),'raw':!![]});}var _0x3c8395=[{'model':db[_0x045a('0x3d')],'as':_0x045a('0x61'),'attributes':['id',_0x045a('0x38'),_0x045a('0x62'),_0x045a('0x63'),_0x045a('0x64'),_0x045a('0x65')],'include':_0x141ab2}];_0x3c8395[_0x045a('0x5c')]({'model':db['WhatsappAccount'],'as':_0x045a('0x66'),'attributes':['id','name']});_0x3c8395[_0x045a('0x5c')]({'model':db[_0x045a('0x5a')],'as':_0x045a('0x67'),'attributes':['id',_0x045a('0x5b')]});return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0x2ee865[_0x045a('0x2c')]['id']},'include':_0x3c8395})[_0x045a('0x1d')](handleEntityNotFound(_0x3306e3,null))[_0x045a('0x1d')](function(_0xc0208c){if(_0xc0208c){var _0x990ee4=_0xc0208c[_0x045a('0x68')]({'plain':!![]});fs[_0x045a('0x69')](_0x4334e4);var _0x2a6580={'channel':_0x045a('0x6a'),'account':_0x990ee4[_0x045a('0x66')][_0x045a('0x20')],'agent':_0x990ee4[_0x045a('0x67')]?_0x990ee4[_0x045a('0x67')][_0x045a('0x5b')]:'N.A.','createdAt':moment(_0x990ee4['createdAt'])[_0x045a('0x47')](_0x045a('0x6b'))['toString'](),'closedAt':_0x990ee4[_0x045a('0x6c')]?moment(_0x990ee4[_0x045a('0x6d')])[_0x045a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x990ee4[_0x045a('0x6e')],'messages':_(_0x990ee4['Messages'])[_0x045a('0x45')]({'secret':![]})[_0x045a('0x22')](function(_0x569080){if(_0x569080[_0x045a('0x60')]){var _0x50bbdd=path[_0x045a('0x53')](_0x480743,_0x569080['Attachment']['basename']);if(fs[_0x045a('0x6f')](_0x50bbdd)){fs['createReadStream'](_0x50bbdd)[_0x045a('0x70')](fs[_0x045a('0x71')](path[_0x045a('0x53')](_0x4334e4,_0x569080[_0x045a('0x60')][_0x045a('0x72')])));}}return{'date':moment(_0x569080[_0x045a('0x62')])[_0x045a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x569080[_0x045a('0x63')]===_0x045a('0x73')?_0x569080['User']?_0x569080['User']['fullname']:_0x045a('0x74'):_0x569080[_0x045a('0x5e')][_0x045a('0x75')]+(_0x569080[_0x045a('0x5e')][_0x045a('0x5f')]?'\x20'+_0x569080[_0x045a('0x5e')][_0x045a('0x5f')]:''),'body':_0x569080['Attachment']?_0x569080[_0x045a('0x60')][_0x045a('0x72')]:_0x569080[_0x045a('0x38')],'direction':_0x569080[_0x045a('0x63')]==='out'?'A':'C','secret':_0x569080[_0x045a('0x64')],'read':_0x569080['read'],'attachment':_0x569080['Attachment']};})[_0x045a('0x76')]()};return ejs[_0x045a('0x77')](path[_0x045a('0x53')](config[_0x045a('0x54')],_0x045a('0x57'),_0x045a('0x78'),_0x045a('0x79')),{'interaction':_0x2a6580})[_0x045a('0x1d')](function(_0x120ffd){var _0x4caeaa=path['join'](_0x4334e4,_0x045a('0x7a')+_0x990ee4['id']+'-'+_0x34def3+_0x045a('0x7b'));var _0x1268bd={'path':_0x4caeaa,'channel':_0x045a('0x6a'),'interactionId':_0x990ee4['id']};return pdf[_0x045a('0x7c')](_0x120ffd,_0x1268bd);})[_0x045a('0x1d')](function(){return new BPromise(function(_0x2c8489,_0x54988c){zipdir(_0x4334e4,{'saveTo':_0x373d88},function(_0x4fca25,_0x20a557){if(_0x4fca25)return _0x54988c(_0x4fca25);return _0x2c8489(_0x20a557);});})[_0x045a('0x1d')](function(){return new BPromise(function(_0x3b53c5,_0x3c2256){rimraf(_0x4334e4,function(_0x525f1f){if(_0x525f1f)_0x3c2256(_0x525f1f);return _0x3b53c5();});});})[_0x045a('0x1d')](function(){return _0x3306e3[_0x045a('0x50')](_0x373d88,_0x225653,function(_0x4b7cde){if(_0x4b7cde){console['log']('err',_0x4b7cde);}else{fs[_0x045a('0x7d')](_0x373d88);}});});});}else{return _0x3306e3['sendStatus'](0xc8);}})[_0x045a('0x2a')](handleError(_0x3306e3,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index cdc4a18..41d987e 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6d8=['unreadMessages','length','emit','catch','hook','events','WhatsappInteraction','WhatsappMessage','save','getUsers','then','Users','map','setDataValue'];(function(_0x50395f,_0x1ea864){var _0x5bd21c=function(_0x478183){while(--_0x478183){_0x50395f['push'](_0x50395f['shift']());}};_0x5bd21c(++_0x1ea864);}(_0xc6d8,0xd7));var _0x8c6d=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xc6d8[_0xdbd4f7];return _0x5c3f9d;};'use strict';var EventEmitter=require(_0x8c6d('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x8c6d('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x8c6d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c6d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x352b8c){return function(_0xdff6f,_0x17781d,_0x4f5e8f){_0xdff6f[_0x8c6d('0x4')]({'attributes':['id'],'raw':!![]})[_0x8c6d('0x5')](function(_0x98cae4){_0xdff6f['setDataValue'](_0x8c6d('0x6'),_0x98cae4[_0x8c6d('0x7')](function(_0x16d4b2){return{'id':_0x16d4b2['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xdff6f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8c6d('0x5')](function(_0x1ec65c){_0xdff6f[_0x8c6d('0x8')](_0x8c6d('0x9'),_0x1ec65c[_0x8c6d('0xa')]);WhatsappInteractionEvents[_0x8c6d('0xb')](_0x352b8c+':'+_0xdff6f['id'],_0xdff6f);WhatsappInteractionEvents[_0x8c6d('0xb')](_0x352b8c,_0xdff6f);_0x4f5e8f(null);})[_0x8c6d('0xc')](_0x4f5e8f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x8c6d('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x65d2=['setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65d2,0xb8));var _0x265d=function(_0x5a3024,_0x21586d){_0x5a3024=_0x5a3024-0x0;var _0x1f4424=_0x65d2[_0x5a3024];return _0x1f4424;};'use strict';var EventEmitter=require(_0x265d('0x0'));var WhatsappInteraction=require(_0x265d('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x265d('0x1'))['db'][_0x265d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x265d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x265d('0x4'),'afterDestroy':_0x265d('0x5')};function emitEvent(_0x2f91bf){return function(_0x579b25,_0x3e4ca8,_0xd49e24){_0x579b25[_0x265d('0x6')]({'attributes':['id'],'raw':!![]})[_0x265d('0x7')](function(_0x96e943){_0x579b25['setDataValue'](_0x265d('0x8'),_0x96e943[_0x265d('0x9')](function(_0x258ae0){return{'id':_0x258ae0['id']};}));return WhatsappMessage[_0x265d('0xa')]({'where':{'WhatsappInteractionId':_0x579b25['id'],'direction':'in','read':![]},'raw':!![]});})[_0x265d('0x7')](function(_0x479640){_0x579b25[_0x265d('0xb')](_0x265d('0xc'),_0x479640['length']);WhatsappInteractionEvents[_0x265d('0xd')](_0x2f91bf+':'+_0x579b25['id'],_0x579b25);WhatsappInteractionEvents[_0x265d('0xd')](_0x2f91bf,_0x579b25);_0xd49e24(null);})[_0x265d('0xe')](_0xd49e24(null));};}for(var e in events){if(events[_0x265d('0xf')](e)){var event=events[e];WhatsappInteraction[_0x265d('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8a153c8..e1a5df9 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9eb=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xd9eb,0xca));var _0xbd9e=function(_0x451b32,_0x1eace6){_0x451b32=_0x451b32-0x0;var _0x4ac489=_0xd9eb[_0x451b32];return _0x4ac489;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var logger=require(_0xbd9e('0x2'))(_0xbd9e('0x3'));var moment=require(_0xbd9e('0x4'));var BPromise=require(_0xbd9e('0x5'));var rp=require(_0xbd9e('0x6'));var fs=require('fs');var path=require(_0xbd9e('0x7'));var rimraf=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var attributes=require(_0xbd9e('0xa'));module[_0xbd9e('0xb')]=function(_0x20c36a,_0x4ade3f){return _0x20c36a[_0xbd9e('0xc')](_0xbd9e('0xd'),attributes,{'tableName':_0xbd9e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2dbf84,_0x20cddf,_0x7755b8){if(_0x2dbf84[_0xbd9e('0xf')](_0xbd9e('0x10'))){_0x2dbf84[_0xbd9e('0x11')]=moment()[_0xbd9e('0x12')](_0xbd9e('0x13'));}_0x7755b8(null,_0x2dbf84);}}});}; \ No newline at end of file +var _0xa977=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0xf953fc,_0x3d5e44){var _0x40226d=function(_0x27884b){while(--_0x27884b){_0xf953fc['push'](_0xf953fc['shift']());}};_0x40226d(++_0x3d5e44);}(_0xa977,0x7e));var _0x7a97=function(_0x42c419,_0xefad8c){_0x42c419=_0x42c419-0x0;var _0x45b3b0=_0xa977[_0x42c419];return _0x45b3b0;};'use strict';var _=require(_0x7a97('0x0'));var util=require(_0x7a97('0x1'));var logger=require(_0x7a97('0x2'))(_0x7a97('0x3'));var moment=require('moment');var BPromise=require(_0x7a97('0x4'));var rp=require(_0x7a97('0x5'));var fs=require('fs');var path=require(_0x7a97('0x6'));var rimraf=require('rimraf');var config=require(_0x7a97('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x7a97('0x8')]=function(_0x5260c4,_0x391bfc){return _0x5260c4[_0x7a97('0x9')](_0x7a97('0xa'),attributes,{'tableName':_0x7a97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x445dfa,_0x52557f,_0x55278b){if(_0x445dfa[_0x7a97('0xc')](_0x7a97('0xd'))){_0x445dfa[_0x7a97('0xe')]=moment()['format'](_0x7a97('0xf'));}_0x55278b(null,_0x445dfa);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 15efa53..0a10ee6 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0df5=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x1972de,_0x1e0efb){var _0x1591a3=function(_0x24be21){while(--_0x24be21){_0x1972de['push'](_0x1972de['shift']());}};_0x1591a3(++_0x1e0efb);}(_0x0df5,0x114));var _0x50df=function(_0x2af67a,_0x11e127){_0x2af67a=_0x2af67a-0x0;var _0x14a933=_0x0df5[_0x2af67a];return _0x14a933;};'use strict';var _=require(_0x50df('0x0'));var util=require(_0x50df('0x1'));var moment=require(_0x50df('0x2'));var BPromise=require(_0x50df('0x3'));var rs=require(_0x50df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50df('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x50df('0x6'))(_0x50df('0x7'));var config=require('../../config/environment');var jayson=require(_0x50df('0x8'));var client=jayson['client'][_0x50df('0x9')]({'port':0x232a});config['redis']=_[_0x50df('0xa')](config[_0x50df('0xb')],{'host':_0x50df('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x50df('0xd'))['register'](socket);function respondWithRpcPromise(_0x5e8f62,_0x462494,_0xaeed76){return new BPromise(function(_0x39e3d5,_0x4f9c9f){return client[_0x50df('0xe')](_0x5e8f62,_0xaeed76)[_0x50df('0xf')](function(_0x2557f2){logger[_0x50df('0x10')](_0x50df('0x11'),_0x462494,'request\x20sent');logger['debug'](_0x50df('0x12'),_0x462494,'request\x20sent',JSON['stringify'](_0x2557f2));if(_0x2557f2['error']){if(_0x2557f2[_0x50df('0x13')][_0x50df('0x14')]===0x1f4){logger['error'](_0x50df('0x11'),_0x462494,_0x2557f2[_0x50df('0x13')][_0x50df('0x15')]);return _0x4f9c9f(_0x2557f2['error']['message']);}logger['error'](_0x50df('0x11'),_0x462494,_0x2557f2[_0x50df('0x13')][_0x50df('0x15')]);return _0x39e3d5(_0x2557f2[_0x50df('0x13')][_0x50df('0x15')]);}else{logger[_0x50df('0x10')](_0x50df('0x11'),_0x462494,_0x50df('0x16'));_0x39e3d5(_0x2557f2[_0x50df('0x17')][_0x50df('0x15')]);}})[_0x50df('0x18')](function(_0x452944){logger[_0x50df('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x462494,_0x452944);_0x4f9c9f(_0x452944);});});}exports[_0x50df('0x19')]=function(_0xb476fb){var _0x3037a6=this;return new Promise(function(_0x44b227,_0x51c517){return db[_0x50df('0x1a')][_0x50df('0x1b')](_0xb476fb[_0x50df('0x1c')],{'raw':_0xb476fb['options']?_0xb476fb[_0x50df('0x1d')][_0x50df('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb476fb[_0x50df('0x1d')]?_0xb476fb[_0x50df('0x1d')][_0x50df('0x1f')]||null:null,'attributes':_0xb476fb[_0x50df('0x1d')]?_0xb476fb['options'][_0x50df('0x20')]||null:null,'limit':_0xb476fb[_0x50df('0x1d')]?_0xb476fb[_0x50df('0x1d')][_0x50df('0x21')]||null:null})[_0x50df('0xf')](function(_0x4ad773){logger[_0x50df('0x10')]('UpdateWhatsappInteraction',_0xb476fb);logger['debug'](_0x50df('0x19'),_0xb476fb,JSON[_0x50df('0x22')](_0x4ad773));_0x44b227(_0x4ad773);})[_0x50df('0x18')](function(_0x4ab73e){logger[_0x50df('0x13')](_0x50df('0x19'),_0x4ab73e['message'],_0xb476fb);_0x51c517(_0x3037a6[_0x50df('0x13')](0x1f4,_0x4ab73e[_0x50df('0x15')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x400bdd){return new Promise(function(_0x48fab4,_0x4beabb){return db[_0x50df('0x1a')][_0x50df('0x23')]({'where':_0x400bdd[_0x50df('0x1d')]?_0x400bdd[_0x50df('0x1d')][_0x50df('0x1f')]||null:null})[_0x50df('0xf')](function(_0x853fa){if(_0x853fa){return _0x853fa['addTags'](_0x400bdd[_0x50df('0x1c')][_0x50df('0x24')],_[_0x50df('0x25')](_0x400bdd[_0x50df('0x1c')],['ids','id'])||{});}})[_0x50df('0x26')](function(_0x109aa3){logger[_0x50df('0x10')](_0x50df('0x27'),_0x400bdd);logger['debug'](_0x50df('0x27'),_0x400bdd,JSON[_0x50df('0x22')](_0x109aa3));_0x48fab4(_0x109aa3);})['catch'](function(_0x2afc1c){logger[_0x50df('0x13')](_0x50df('0x27'),_0x2afc1c[_0x50df('0x15')],_0x400bdd);_0x4beabb(_this['error'](0x1f4,_0x2afc1c['message']));});});}; \ No newline at end of file +var _0xfcea=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','moment'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xfcea,0x178));var _0xafce=function(_0x5d7b2a,_0x38b4c6){_0x5d7b2a=_0x5d7b2a-0x0;var _0x1748d6=_0xfcea[_0x5d7b2a];return _0x1748d6;};'use strict';var _=require('lodash');var util=require(_0xafce('0x0'));var moment=require(_0xafce('0x1'));var BPromise=require(_0xafce('0x2'));var rs=require(_0xafce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafce('0x4'))['db'];var utils=require(_0xafce('0x5'));var logger=require(_0xafce('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xafce('0x7')][_0xafce('0x8')]({'port':0x232a});config[_0xafce('0x9')]=_['defaults'](config[_0xafce('0x9')],{'host':_0xafce('0xa'),'port':0x18eb});var socket=require(_0xafce('0xb'))(new Redis(config[_0xafce('0x9')]));require(_0xafce('0xc'))[_0xafce('0xd')](socket);function respondWithRpcPromise(_0x5d6f14,_0x14fcbe,_0x3b40ea){return new BPromise(function(_0x5e5b9f,_0x2f7d06){return client[_0xafce('0xe')](_0x5d6f14,_0x3b40ea)[_0xafce('0xf')](function(_0x59e3d7){logger[_0xafce('0x10')](_0xafce('0x11'),_0x14fcbe,_0xafce('0x12'));logger[_0xafce('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x14fcbe,'request\x20sent',JSON['stringify'](_0x59e3d7));if(_0x59e3d7['error']){if(_0x59e3d7[_0xafce('0x14')][_0xafce('0x15')]===0x1f4){logger['error'](_0xafce('0x11'),_0x14fcbe,_0x59e3d7[_0xafce('0x14')][_0xafce('0x16')]);return _0x2f7d06(_0x59e3d7[_0xafce('0x14')]['message']);}logger['error'](_0xafce('0x11'),_0x14fcbe,_0x59e3d7['error'][_0xafce('0x16')]);return _0x5e5b9f(_0x59e3d7[_0xafce('0x14')][_0xafce('0x16')]);}else{logger[_0xafce('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x14fcbe,_0xafce('0x12'));_0x5e5b9f(_0x59e3d7[_0xafce('0x17')][_0xafce('0x16')]);}})['catch'](function(_0x34d1de){logger[_0xafce('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x14fcbe,_0x34d1de);_0x2f7d06(_0x34d1de);});});}exports[_0xafce('0x18')]=function(_0x2d2edc){var _0x110d7e=this;return new Promise(function(_0x55d7c4,_0xc43089){return db[_0xafce('0x19')][_0xafce('0x1a')](_0x2d2edc[_0xafce('0x1b')],{'raw':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc[_0xafce('0x1c')][_0xafce('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc[_0xafce('0x1c')][_0xafce('0x1e')]||null:null,'attributes':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc['options'][_0xafce('0x1f')]||null:null,'limit':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc[_0xafce('0x1c')][_0xafce('0x20')]||null:null})['then'](function(_0x261343){logger['info'](_0xafce('0x18'),_0x2d2edc);logger[_0xafce('0x13')](_0xafce('0x18'),_0x2d2edc,JSON[_0xafce('0x21')](_0x261343));_0x55d7c4(_0x261343);})[_0xafce('0x22')](function(_0x1ed20a){logger['error'](_0xafce('0x18'),_0x1ed20a[_0xafce('0x16')],_0x2d2edc);_0xc43089(_0x110d7e[_0xafce('0x14')](0x1f4,_0x1ed20a[_0xafce('0x16')]));});});};exports[_0xafce('0x23')]=function(_0x51823b){return new Promise(function(_0x12721e,_0x22064a){return db[_0xafce('0x19')][_0xafce('0x24')]({'where':_0x51823b[_0xafce('0x1c')]?_0x51823b[_0xafce('0x1c')]['where']||null:null})[_0xafce('0xf')](function(_0x1cc5a2){if(_0x1cc5a2){return _0x1cc5a2[_0xafce('0x25')](_0x51823b[_0xafce('0x1b')][_0xafce('0x26')],_[_0xafce('0x27')](_0x51823b[_0xafce('0x1b')],[_0xafce('0x26'),'id'])||{});}})[_0xafce('0x28')](function(_0x490097){logger[_0xafce('0x10')](_0xafce('0x29'),_0x51823b);logger[_0xafce('0x13')](_0xafce('0x29'),_0x51823b,JSON[_0xafce('0x21')](_0x490097));_0x12721e(_0x490097);})[_0xafce('0x22')](function(_0x5556c0){logger[_0xafce('0x14')](_0xafce('0x29'),_0x5556c0[_0xafce('0x16')],_0x51823b);_0x22064a(_this[_0xafce('0x14')](0x1f4,_0x5556c0[_0xafce('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 48a5154..dafcba5 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffdf=['whatsappInteraction:','./whatsappInteraction.events','save','remove','register'];(function(_0x2eff18,_0x5ab475){var _0x34ccb8=function(_0x157bd6){while(--_0x157bd6){_0x2eff18['push'](_0x2eff18['shift']());}};_0x34ccb8(++_0x5ab475);}(_0xffdf,0x1a5));var _0xfffd=function(_0x22df72,_0x53eda7){_0x22df72=_0x22df72-0x0;var _0x289287=_0xffdf[_0x22df72];return _0x289287;};'use strict';var WhatsappInteractionEvents=require(_0xfffd('0x0'));var events=[_0xfffd('0x1'),_0xfffd('0x2'),'update'];function createListener(_0x4f99d3,_0x2cc439){return function(_0x49b491){_0x2cc439['emit'](_0x4f99d3,_0x49b491);};}function removeListener(_0x5c644f,_0x2065b9){return function(){WhatsappInteractionEvents['removeListener'](_0x5c644f,_0x2065b9);};}exports[_0xfffd('0x3')]=function(_0x175fde){for(var _0x47b800=0x0,_0x24309c=events['length'];_0x47b800<_0x24309c;_0x47b800++){var _0x2ac4ad=events[_0x47b800];var _0x5b073a=createListener(_0xfffd('0x4')+_0x2ac4ad,_0x175fde);WhatsappInteractionEvents['on'](_0x2ac4ad,_0x5b073a);}}; \ No newline at end of file +var _0x9df3=['emit','./whatsappInteraction.events','remove','update'];(function(_0x1243b2,_0x2fe5dd){var _0xcb48d3=function(_0x1cd8a6){while(--_0x1cd8a6){_0x1243b2['push'](_0x1243b2['shift']());}};_0xcb48d3(++_0x2fe5dd);}(_0x9df3,0xcd));var _0x39df=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x9df3[_0x484e36];return _0xafc85d;};'use strict';var WhatsappInteractionEvents=require(_0x39df('0x0'));var events=['save',_0x39df('0x1'),_0x39df('0x2')];function createListener(_0x1fec6a,_0x183686){return function(_0x4ca416){_0x183686[_0x39df('0x3')](_0x1fec6a,_0x4ca416);};}function removeListener(_0x4f29d4,_0x14ac7e){return function(){WhatsappInteractionEvents['removeListener'](_0x4f29d4,_0x14ac7e);};}exports['register']=function(_0x20e8ee){for(var _0x410189=0x0,_0x46494d=events['length'];_0x410189<_0x46494d;_0x410189++){var _0x3e6414=events[_0x410189];var _0x318783=createListener('whatsappInteraction:'+_0x3e6414,_0x20e8ee);WhatsappInteractionEvents['on'](_0x3e6414,_0x318783);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index e37223e..becbf85 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4423=['./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','show','tracked','whatsapp','whatsappmessage:create','post','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4423,0x8a));var _0x3442=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4423[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x3442('0x0'));var util=require(_0x3442('0x1'));var path=require(_0x3442('0x2'));var timeout=require(_0x3442('0x3'));var express=require(_0x3442('0x4'));var router=express[_0x3442('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3442('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3442('0x7'));router[_0x3442('0x8')]('/',auth['isAuthenticated'](),controller[_0x3442('0x9')]);router[_0x3442('0x8')](_0x3442('0xa'),auth[_0x3442('0xb')](),controller[_0x3442('0xc')]);router[_0x3442('0x8')]('/:id',auth[_0x3442('0xb')](),controller[_0x3442('0xd')]);router['post']('/',auth[_0x3442('0xb')](),interaction[_0x3442('0xe')](_0x3442('0xf'),_0x3442('0x10')),controller['create']);router[_0x3442('0x11')]('/:id/status',controller[_0x3442('0x12')]);router[_0x3442('0x13')](_0x3442('0x14'),auth[_0x3442('0xb')](),controller[_0x3442('0x15')]);router[_0x3442('0x13')](_0x3442('0x16'),auth['isAuthenticated'](),controller[_0x3442('0x17')]);router[_0x3442('0x13')](_0x3442('0x18'),auth[_0x3442('0xb')](),controller[_0x3442('0x19')]);router[_0x3442('0x1a')](_0x3442('0x14'),auth['isAuthenticated'](),controller[_0x3442('0x1b')]);module[_0x3442('0x1c')]=router; \ No newline at end of file +var _0x0c6f=['put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsappmessage:create','create','/:id/status','status'];(function(_0x3b40e5,_0xd8ca73){var _0x31d8ec=function(_0x1e4127){while(--_0x1e4127){_0x3b40e5['push'](_0x3b40e5['shift']());}};_0x31d8ec(++_0xd8ca73);}(_0x0c6f,0x10b));var _0xf0c6=function(_0xa1bac2,_0x14c67d){_0xa1bac2=_0xa1bac2-0x0;var _0x53092e=_0x0c6f[_0xa1bac2];return _0x53092e;};'use strict';var multer=require(_0xf0c6('0x0'));var util=require('util');var path=require(_0xf0c6('0x1'));var timeout=require(_0xf0c6('0x2'));var express=require('express');var router=express[_0xf0c6('0x3')]();var fs_extra=require(_0xf0c6('0x4'));var auth=require(_0xf0c6('0x5'));var interaction=require(_0xf0c6('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xf0c6('0x7')]('/',auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x9')]);router[_0xf0c6('0x7')](_0xf0c6('0xa'),auth[_0xf0c6('0x8')](),controller[_0xf0c6('0xb')]);router[_0xf0c6('0x7')](_0xf0c6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf0c6('0xd')]('/',auth[_0xf0c6('0x8')](),interaction[_0xf0c6('0xe')]('whatsapp',_0xf0c6('0xf')),controller[_0xf0c6('0x10')]);router['post'](_0xf0c6('0x11'),controller[_0xf0c6('0x12')]);router[_0xf0c6('0x13')]('/:id',auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x14')]);router[_0xf0c6('0x13')](_0xf0c6('0x15'),auth[_0xf0c6('0x8')](),controller['accept']);router[_0xf0c6('0x13')](_0xf0c6('0x16'),auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x17')]);router[_0xf0c6('0x18')](_0xf0c6('0xc'),auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 53f2c0f..ad9aa4f 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3604=['DATE','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x463645,_0x3b9949){var _0x4778cb=function(_0x3624ea){while(--_0x3624ea){_0x463645['push'](_0x463645['shift']());}};_0x4778cb(++_0x3b9949);}(_0x3604,0x174));var _0x4360=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3604[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require('sequelize');module[_0x4360('0x0')]={'body':{'type':Sequelize[_0x4360('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4360('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4360('0x3')]('in',_0x4360('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x4360('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4360('0x5')]},'readAt':{'type':Sequelize[_0x4360('0x6')]},'secret':{'type':Sequelize[_0x4360('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4360('0x1')]}}; \ No newline at end of file +var _0x0bc3=['TEXT','medium','BOOLEAN','ENUM','STRING','DATE','sequelize'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x0bc3,0x6f));var _0x30bc=function(_0x209584,_0x48b48c){_0x209584=_0x209584-0x0;var _0x3b5ea6=_0x0bc3[_0x209584];return _0x3b5ea6;};'use strict';var Sequelize=require(_0x30bc('0x0'));module['exports']={'body':{'type':Sequelize[_0x30bc('0x1')](_0x30bc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x30bc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x30bc('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x30bc('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x30bc('0x6')]},'secret':{'type':Sequelize[_0x30bc('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x30bc('0x5')]},'providerResponse':{'type':Sequelize[_0x30bc('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 988f454..43f042c 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe58a=['MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','limit','apply','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid'];(function(_0x22d2ff,_0x56a793){var _0x4a50b6=function(_0x54512c){while(--_0x54512c){_0x22d2ff['push'](_0x22d2ff['shift']());}};_0x4a50b6(++_0x56a793);}(_0xe58a,0x1bc));var _0xae58=function(_0x6e0c5d,_0x1cef8d){_0x6e0c5d=_0x6e0c5d-0x0;var _0x2c45f0=_0xe58a[_0x6e0c5d];return _0x2c45f0;};'use strict';var emlformat=require(_0xae58('0x0'));var rimraf=require(_0xae58('0x1'));var zipdir=require(_0xae58('0x2'));var jsonpatch=require(_0xae58('0x3'));var rp=require(_0xae58('0x4'));var moment=require(_0xae58('0x5'));var BPromise=require(_0xae58('0x6'));var Mustache=require(_0xae58('0x7'));var util=require(_0xae58('0x8'));var path=require(_0xae58('0x9'));var sox=require(_0xae58('0xa'));var csv=require(_0xae58('0xb'));var ejs=require(_0xae58('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae58('0xd'));var squel=require(_0xae58('0xe'));var crypto=require(_0xae58('0xf'));var jsforce=require(_0xae58('0x10'));var deskjs=require(_0xae58('0x11'));var toCsv=require(_0xae58('0xb'));var querystring=require(_0xae58('0x12'));var Papa=require(_0xae58('0x13'));var Redis=require(_0xae58('0x14'));var authService=require(_0xae58('0x15'));var qs=require(_0xae58('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae58('0x17'));var logger=require(_0xae58('0x18'))(_0xae58('0x19'));var utils=require(_0xae58('0x1a'));var config=require(_0xae58('0x1b'));var licenseUtil=require(_0xae58('0x1c'));var db=require(_0xae58('0x1d'))['db'];config[_0xae58('0x1e')]=_[_0xae58('0x1f')](config[_0xae58('0x1e')],{'host':'localhost','port':0x18eb});var socket=require(_0xae58('0x20'))(new Redis(config[_0xae58('0x1e')]));require(_0xae58('0x21'))['register'](socket);var jayson=require(_0xae58('0x22'));var client=jayson[_0xae58('0x23')][_0xae58('0x24')]({'port':0x232c});var client9002=jayson['client'][_0xae58('0x24')]({'port':0x232a});function respondWithRpcPromise(_0xd5face,_0x1ef172,_0x4036a8,_0x418a4c){return new BPromise(function(_0x1ddce1,_0x25560d){var _0x5cd980=_0x418a4c||client;return _0x5cd980['request'](_0xd5face,_0x4036a8)[_0xae58('0x25')](function(_0x2edb16){logger[_0xae58('0x26')](_0xae58('0x27'),_0x1ef172,_0xae58('0x28'));logger[_0xae58('0x29')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1ef172,'request\x20sent',JSON[_0xae58('0x2a')](_0x2edb16));if(_0x2edb16[_0xae58('0x2b')]){if(_0x2edb16[_0xae58('0x2b')][_0xae58('0x2c')]===0x1f4){logger[_0xae58('0x2b')](_0xae58('0x27'),_0x1ef172,_0x2edb16[_0xae58('0x2b')]['message']);return _0x25560d(_0x2edb16[_0xae58('0x2b')][_0xae58('0x2d')]);}logger[_0xae58('0x2b')](_0xae58('0x27'),_0x1ef172,_0x2edb16[_0xae58('0x2b')][_0xae58('0x2d')]);return _0x1ddce1(_0x2edb16[_0xae58('0x2b')][_0xae58('0x2d')]);}else{logger[_0xae58('0x26')](_0xae58('0x27'),_0x1ef172,_0xae58('0x28'));_0x1ddce1(_0x2edb16[_0xae58('0x2e')][_0xae58('0x2d')]);}})['catch'](function(_0x21b273){logger[_0xae58('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x1ef172,_0x21b273);_0x25560d(_0x21b273);});});}function respondWithStatusCode(_0x10d922,_0x365139){_0x365139=_0x365139||0xcc;return function(_0x5594d9){if(_0x5594d9){return _0x10d922[_0xae58('0x2f')](_0x365139);}return _0x10d922[_0xae58('0x30')](_0x365139)[_0xae58('0x31')]();};}function respondWithResult(_0x275def,_0x58ed9d){_0x58ed9d=_0x58ed9d||0xc8;return function(_0xb4f3ac){if(_0xb4f3ac){return _0x275def[_0xae58('0x30')](_0x58ed9d)[_0xae58('0x32')](_0xb4f3ac);}};}function respondWithFilteredResult(_0x39bb32,_0x4d2637){return function(_0x278948){if(_0x278948){var _0x4e198d=typeof _0x4d2637['offset']===_0xae58('0x33')&&typeof _0x4d2637['limit']==='undefined';var _0x350c4f=_0x278948[_0xae58('0x34')];var _0xf909f1=_0x4e198d?0x0:_0x4d2637[_0xae58('0x35')];var _0x1be7c7=_0x4e198d?_0x278948['count']:_0x4d2637['offset']+_0x4d2637[_0xae58('0x36')];var _0x1e42bf;if(_0x1be7c7>=_0x350c4f){_0x1be7c7=_0x350c4f;_0x1e42bf=0xc8;}else{_0x1e42bf=0xce;}_0x39bb32[_0xae58('0x30')](_0x1e42bf);return _0x39bb32['set']('Content-Range',_0xf909f1+'-'+_0x1be7c7+'/'+_0x350c4f)[_0xae58('0x32')](_0x278948);}return null;};}function patchUpdates(_0x21e06d){return function(_0x25bc9d){try{jsonpatch[_0xae58('0x37')](_0x25bc9d,_0x21e06d,!![]);}catch(_0x45a324){return BPromise['reject'](_0x45a324);}return _0x25bc9d[_0xae58('0x38')]();};}function saveUpdates(_0xa3409,_0x45ee6d){return function(_0x2ea649){if(_0x2ea649){return _0x2ea649[_0xae58('0x39')](_0xa3409)[_0xae58('0x25')](function(_0x16192e){return _0x16192e;});}return null;};}function removeEntity(_0x3911ba,_0x29e6b8){return function(_0x4244a2){if(_0x4244a2){return _0x4244a2[_0xae58('0x3a')]()[_0xae58('0x25')](function(){_0x3911ba['status'](0xcc)[_0xae58('0x31')]();});}};}function handleEntityNotFound(_0x2be82b,_0xc666d8){return function(_0x190a61){if(!_0x190a61){_0x2be82b[_0xae58('0x2f')](0x194);}return _0x190a61;};}function handleError(_0xdaeb7,_0x1d67e3){_0x1d67e3=_0x1d67e3||0x1f4;return function(_0x1fbe54){logger[_0xae58('0x2b')](_0x1fbe54[_0xae58('0x3b')]);if(_0x1fbe54['name']){delete _0x1fbe54[_0xae58('0x3c')];}_0xdaeb7['status'](_0x1d67e3)[_0xae58('0x3d')](_0x1fbe54);};}exports[_0xae58('0x3e')]=function(_0x77620f,_0x45cea3){var _0x49d24a={},_0x2c1816={},_0x19b7f9={'count':0x0,'rows':[]};var _0x34fb33=_[_0xae58('0x3f')](db[_0xae58('0x40')][_0xae58('0x41')],function(_0x5c35be){return{'name':_0x5c35be[_0xae58('0x42')],'type':_0x5c35be['type'][_0xae58('0x43')]};});_0x2c1816[_0xae58('0x44')]=_[_0xae58('0x3f')](_0x34fb33,_0xae58('0x3c'));_0x2c1816[_0xae58('0x45')]=_[_0xae58('0x46')](_0x77620f['query']);_0x2c1816[_0xae58('0x47')]=_[_0xae58('0x48')](_0x2c1816[_0xae58('0x44')],_0x2c1816[_0xae58('0x45')]);_0x49d24a[_0xae58('0x49')]=_[_0xae58('0x48')](_0x2c1816[_0xae58('0x44')],qs[_0xae58('0x4a')](_0x77620f[_0xae58('0x45')][_0xae58('0x4a')]));_0x49d24a['attributes']=_0x49d24a[_0xae58('0x49')][_0xae58('0x4b')]?_0x49d24a['attributes']:_0x2c1816['model'];if(!_0x77620f[_0xae58('0x45')][_0xae58('0x4c')](_0xae58('0x4d'))){_0x49d24a[_0xae58('0x36')]=qs[_0xae58('0x36')](_0x77620f[_0xae58('0x45')][_0xae58('0x36')]);_0x49d24a[_0xae58('0x35')]=qs['offset'](_0x77620f['query'][_0xae58('0x35')]);}_0x49d24a[_0xae58('0x4e')]=qs[_0xae58('0x4f')](_0x77620f['query'][_0xae58('0x4f')]);_0x49d24a[_0xae58('0x50')]=qs[_0xae58('0x47')](_[_0xae58('0x51')](_0x77620f[_0xae58('0x45')],_0x2c1816[_0xae58('0x47')]),_0x34fb33);if(_0x77620f['query'][_0xae58('0x52')]){_0x49d24a[_0xae58('0x50')]=_[_0xae58('0x53')](_0x49d24a[_0xae58('0x50')],{'$or':_['map'](_0x34fb33,function(_0x419591){if(_0x419591[_0xae58('0x54')]!==_0xae58('0x55')){var _0x51026b={};_0x51026b[_0x419591['name']]={'$like':'%'+_0x77620f['query'][_0xae58('0x52')]+'%'};return _0x51026b;}})});}_0x49d24a=_[_0xae58('0x53')]({},_0x49d24a,_0x77620f[_0xae58('0x56')]);var _0x515332={'where':_0x49d24a[_0xae58('0x50')]};return db[_0xae58('0x40')][_0xae58('0x34')](_0x515332)['then'](function(_0x5c6af2){_0x19b7f9[_0xae58('0x34')]=_0x5c6af2;if(_0x77620f['query'][_0xae58('0x57')]){_0x49d24a[_0xae58('0x58')]=[{'all':!![]}];}return db[_0xae58('0x40')][_0xae58('0x59')](_0x49d24a);})[_0xae58('0x25')](function(_0x2fea5d){_0x19b7f9[_0xae58('0x5a')]=_0x2fea5d;return _0x19b7f9;})['then'](respondWithFilteredResult(_0x45cea3,_0x49d24a))[_0xae58('0x5b')](handleError(_0x45cea3,null));};exports[_0xae58('0x5c')]=function(_0x322fc6,_0x2f72ed){var _0x305a22={'raw':!![],'where':{'id':_0x322fc6['params']['id']}},_0x336c6a={};_0x336c6a['model']=_[_0xae58('0x46')](db['WhatsappMessage'][_0xae58('0x41')]);_0x336c6a[_0xae58('0x45')]=_[_0xae58('0x46')](_0x322fc6[_0xae58('0x45')]);_0x336c6a['filters']=_[_0xae58('0x48')](_0x336c6a[_0xae58('0x44')],_0x336c6a[_0xae58('0x45')]);_0x305a22[_0xae58('0x49')]=_[_0xae58('0x48')](_0x336c6a[_0xae58('0x44')],qs[_0xae58('0x4a')](_0x322fc6[_0xae58('0x45')]['fields']));_0x305a22[_0xae58('0x49')]=_0x305a22[_0xae58('0x49')][_0xae58('0x4b')]?_0x305a22[_0xae58('0x49')]:_0x336c6a['model'];if(_0x322fc6[_0xae58('0x45')][_0xae58('0x57')]){_0x305a22[_0xae58('0x58')]=[{'all':!![]}];}_0x305a22=_[_0xae58('0x53')]({},_0x305a22,_0x322fc6[_0xae58('0x56')]);return db[_0xae58('0x40')][_0xae58('0x5d')](_0x305a22)['then'](handleEntityNotFound(_0x2f72ed,null))[_0xae58('0x25')](respondWithResult(_0x2f72ed,null))[_0xae58('0x5b')](handleError(_0x2f72ed,null));};exports[_0xae58('0x5e')]=function(_0x37ad7f,_0x5e145e){return db['WhatsappMessage']['create'](_0x37ad7f[_0xae58('0x5f')],{})[_0xae58('0x25')](respondWithResult(_0x5e145e,0xc9))[_0xae58('0x5b')](handleError(_0x5e145e,null));};exports[_0xae58('0x39')]=function(_0x21d5b6,_0x552578){if(_0x21d5b6[_0xae58('0x5f')]['id']){delete _0x21d5b6['body']['id'];}return db[_0xae58('0x40')]['find']({'where':{'id':_0x21d5b6[_0xae58('0x60')]['id']}})['then'](handleEntityNotFound(_0x552578,null))[_0xae58('0x25')](saveUpdates(_0x21d5b6[_0xae58('0x5f')],null))[_0xae58('0x25')](respondWithResult(_0x552578,null))['catch'](handleError(_0x552578,null));};exports['destroy']=function(_0x2b16c8,_0xdb7710){return db['WhatsappMessage'][_0xae58('0x5d')]({'where':{'id':_0x2b16c8['params']['id']}})[_0xae58('0x25')](handleEntityNotFound(_0xdb7710,null))[_0xae58('0x25')](removeEntity(_0xdb7710,null))[_0xae58('0x5b')](handleError(_0xdb7710,null));};exports[_0xae58('0x61')]=function(_0x8682d0,_0x10b5db){return db[_0xae58('0x40')]['describe']()['then'](respondWithResult(_0x10b5db,null))[_0xae58('0x5b')](handleError(_0x10b5db,null));};var interaction_log=require(_0xae58('0x18'))('whatsapp-interactions');exports[_0xae58('0x62')]=function(_0x4ab34c,_0x4a8a74,_0x42b8ce){var _0x4d5496={'agent':{},'channel':_0xae58('0x63')};if(_0x4ab34c[_0xae58('0x5f')]['id']){delete _0x4ab34c['body']['id'];}_0x4ab34c[_0xae58('0x5f')][_0xae58('0x64')]=!![];_0x4ab34c[_0xae58('0x5f')][_0xae58('0x65')]=moment()[_0xae58('0x66')](_0xae58('0x67'));_0x4ab34c['body'][_0xae58('0x68')]=_0x4ab34c[_0xae58('0x5f')][_0xae58('0x68')]||_0x4ab34c[_0xae58('0x69')]['id'];_0x4d5496[_0xae58('0x6a')]['id']=_0x4ab34c['body'][_0xae58('0x68')];return db['WhatsappMessage'][_0xae58('0x5d')]({'where':{'id':_0x4ab34c[_0xae58('0x60')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a8a74,null))[_0xae58('0x25')](saveUpdates(_0x4ab34c[_0xae58('0x5f')],null))[_0xae58('0x25')](function(_0xcaa5b1){if(_0xcaa5b1){_0x4d5496[_0xae58('0x2d')]=_0xcaa5b1['get']({'plain':!![]});return db['WhatsappInteraction'][_0xae58('0x5d')]({'where':{'id':_0xcaa5b1['WhatsappInteractionId']}});}return null;})[_0xae58('0x25')](handleEntityNotFound(_0x4a8a74,null))['then'](function(_0x320d1c){if(_0x320d1c){return _0x320d1c[_0xae58('0x39')]({'UserId':_0x4ab34c['body'][_0xae58('0x68')],'read1stAt':_[_0xae58('0x6b')](_0x320d1c['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4bb9b3){if(_0x4bb9b3){_0x4d5496[_0xae58('0x6c')]=_0x4bb9b3[_0xae58('0x6d')]({'plain':!![]});interaction_log[_0xae58('0x26')](_0xae58('0x6e'),_0x4ab34c[_0xae58('0x69')]['id'],_0x4ab34c['user']['name'],_0x4ab34c['user'][_0xae58('0x6f')],_0x4d5496[_0xae58('0x6c')]['id'],_0x4ab34c[_0xae58('0x5f')]?JSON[_0xae58('0x2a')](_0x4ab34c[_0xae58('0x5f')]):_0xae58('0x70'));return respondWithRpcPromise(_0xae58('0x71'),_0xae58('0x72'),_0x4d5496);}return null;})['then'](function(_0x262a59){var _0xe30375='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x262a59[_0xae58('0x2d')][_0xae58('0x73')];return db[_0xae58('0x74')][_0xae58('0x45')](_0xe30375,{'type':db[_0xae58('0x75')][_0xae58('0x76')][_0xae58('0x77')],'raw':!![]})[_0xae58('0x25')](function(_0xf2a735){return _0xf2a735;});})['then'](function(_0x45b137){if(_0x45b137){_0x4d5496['message'][_0xae58('0x78')]=_0x45b137[0x0];if(!_0x4ab34c[_0xae58('0x5f')][_0xae58('0x68')])return;return db[_0xae58('0x79')][_0xae58('0x5d')]({'where':{'id':_0x4ab34c[_0xae58('0x5f')]['UserId'],'role':_0xae58('0x6a')},'attributes':['id',_0xae58('0x3c'),_0xae58('0x7a'),_0xae58('0x7b'),_0xae58('0x7c')],'raw':!![]});}return null;})[_0xae58('0x25')](function(_0x2b7279){if(!_0x2b7279)return null;_0x4d5496[_0xae58('0x2d')][_0xae58('0x6a')]=_0x2b7279;return _0x4d5496;})[_0xae58('0x25')](function(_0x37b148){if(_0x37b148){if(_0x4ab34c[_0xae58('0x5f')][_0xae58('0x7d')]){_0x4d5496[_0xae58('0x2d')]['interface']=util[_0xae58('0x66')](_0xae58('0x7e'),_0x4ab34c[_0xae58('0x69')][_0xae58('0x3c')]);_0x4d5496[_0xae58('0x2d')]['channel']=_0x4d5496[_0xae58('0x7f')];_0x4d5496[_0xae58('0x2d')][_0xae58('0x80')]=_0x4d5496[_0xae58('0x7f')];_0x4d5496[_0xae58('0x2d')][_0xae58('0x81')]=_0xae58('0x62');return respondWithRpcPromise('EventManager',_0xae58('0x82'),{'event':_0xae58('0x83'),'message':_0x4d5496[_0xae58('0x2d')]},client9002)[_0xae58('0x25')](function(){return _0x4d5496;});}return _0x4d5496;}return null;})[_0xae58('0x25')](respondWithResult(_0x4a8a74,null))[_0xae58('0x5b')](handleError(_0x4a8a74,null));};var interaction_log=require(_0xae58('0x18'))('whatsapp-interactions');exports[_0xae58('0x84')]=function(_0x150d4e,_0x356b58,_0x764e64){var _0x21546d={'agent':{},'channel':_0xae58('0x63')};if(_0x150d4e[_0xae58('0x5f')]['id']){delete _0x150d4e[_0xae58('0x5f')]['id'];}_0x150d4e[_0xae58('0x5f')][_0xae58('0x68')]=_0x150d4e[_0xae58('0x5f')]['UserId']||_0x150d4e[_0xae58('0x69')]['id'];_0x21546d[_0xae58('0x6a')]['id']=_0x150d4e[_0xae58('0x5f')][_0xae58('0x68')];return db[_0xae58('0x40')][_0xae58('0x5d')]({'where':{'id':_0x150d4e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x356b58,null))[_0xae58('0x25')](function(_0xf91542){if(_0xf91542){_0x21546d[_0xae58('0x2d')]=_0xf91542[_0xae58('0x6d')]({'plain':!![]});return db[_0xae58('0x85')][_0xae58('0x5d')]({'where':{'id':_0xf91542['WhatsappInteractionId']}});}return null;})[_0xae58('0x25')](handleEntityNotFound(_0x356b58,null))[_0xae58('0x25')](function(_0x44abc9){if(_0x44abc9){_0x21546d[_0xae58('0x6c')]=_0x44abc9['get']({'plain':!![]});interaction_log[_0xae58('0x26')](_0xae58('0x86'),_0x150d4e['user']['id'],_0x150d4e['user'][_0xae58('0x3c')],_0x150d4e[_0xae58('0x69')]['role'],_0x21546d['interaction']['id'],_0x150d4e['body']?JSON[_0xae58('0x2a')](_0x150d4e[_0xae58('0x5f')]):'null');return respondWithRpcPromise('RejectMessage',_0xae58('0x87'),_0x21546d);}return null;})[_0xae58('0x25')](function(_0x271d2d){var _0x57b538=_0xae58('0x88')+_0x271d2d[_0xae58('0x2d')][_0xae58('0x73')];return db[_0xae58('0x74')][_0xae58('0x45')](_0x57b538,{'type':db['Sequelize'][_0xae58('0x76')][_0xae58('0x77')],'raw':!![]})[_0xae58('0x25')](function(_0x1d6686){return _0x1d6686;});})[_0xae58('0x25')](function(_0xe8754f){if(_0xe8754f){_0x21546d[_0xae58('0x2d')][_0xae58('0x78')]=_0xe8754f[0x0];if(!_0x150d4e['body']['UserId'])return;return db[_0xae58('0x79')][_0xae58('0x5d')]({'where':{'id':_0x150d4e['body'][_0xae58('0x68')],'role':_0xae58('0x6a')},'attributes':['id',_0xae58('0x3c'),_0xae58('0x7a'),'email','internal'],'raw':!![]});}return null;})[_0xae58('0x25')](function(_0x5c8fc0){if(!_0x5c8fc0)return null;_0x21546d['message'][_0xae58('0x6a')]=_0x5c8fc0;return _0x21546d;})['then'](function(_0x3f4bf1){if(_0x3f4bf1){_0x3f4bf1[_0xae58('0x2d')][_0xae58('0x89')]=util[_0xae58('0x66')](_0xae58('0x7e'),_0x150d4e[_0xae58('0x69')]['name']);_0x3f4bf1['message']['channel']=_0x21546d[_0xae58('0x7f')];_0x3f4bf1['message'][_0xae58('0x80')]=_0x21546d[_0xae58('0x7f')];_0x3f4bf1[_0xae58('0x2d')][_0xae58('0x81')]=_0xae58('0x84');respondWithRpcPromise(_0xae58('0x82'),'EventManager',{'event':'rejectmessage','message':_0x3f4bf1[_0xae58('0x2d')]},client9002);return _0x21546d;}return null;})[_0xae58('0x25')](respondWithResult(_0x356b58,null))[_0xae58('0x5b')](handleError(_0x356b58,null));};exports[_0xae58('0x30')]=function(_0xfe7913,_0x17e9c3,_0x214f9f){if(_0xfe7913[_0xae58('0x5f')]['id']){delete _0xfe7913[_0xae58('0x5f')]['id'];}var _0x4532f3;return db[_0xae58('0x40')][_0xae58('0x5d')]({'where':{'id':_0xfe7913['params']['id']}})[_0xae58('0x25')](handleEntityNotFound(_0x17e9c3,null))[_0xae58('0x25')](function(_0x5ac76d){if(_0x5ac76d){_0x4532f3=_0x5ac76d;return db[_0xae58('0x8a')][_0xae58('0x5d')]({'where':{'id':_0x5ac76d[_0xae58('0x8b')]}});}})[_0xae58('0x25')](handleEntityNotFound(_0x17e9c3,null))[_0xae58('0x25')](function(_0x49b1cb){if(_0x49b1cb){logger[_0xae58('0x29')](_0xae58('0x8c'),'status',_0xae58('0x8d'),_0x49b1cb[_0xae58('0x54')],util[_0xae58('0x8e')](_0xfe7913[_0xae58('0x5f')],{'showHidden':![],'depth':null}));switch(_0x49b1cb[_0xae58('0x54')]){case'twilio':if(_0xfe7913[_0xae58('0x5f')][_0xae58('0x8f')]&&_0xfe7913['body'][_0xae58('0x8f')]===_0x4532f3['messageId']&&_0xfe7913[_0xae58('0x5f')]['MessageStatus']&&_0xfe7913[_0xae58('0x5f')][_0xae58('0x90')]===_0xae58('0x64')){return _0x4532f3['update']({'read':!![]});}else{logger[_0xae58('0x2b')](_0xae58('0x91'),_0xae58('0x30'),_0xae58('0x92'),util[_0xae58('0x8e')](_0xfe7913['body'],{'showHidden':![],'depth':null}));}break;}return _0x4532f3;}})[_0xae58('0x25')](respondWithResult(_0x17e9c3,null))[_0xae58('0x5b')](handleError(_0x17e9c3,null));}; \ No newline at end of file +var _0x3235=['create','body','destroy','describe','accept','whatsapp','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','interface','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','read','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find'];(function(_0x22f75e,_0x4a9e06){var _0x1f6ab3=function(_0x1479d4){while(--_0x1479d4){_0x22f75e['push'](_0x22f75e['shift']());}};_0x1f6ab3(++_0x4a9e06);}(_0x3235,0x145));var _0x5323=function(_0x38388c,_0x1924ff){_0x38388c=_0x38388c-0x0;var _0x314d69=_0x3235[_0x38388c];return _0x314d69;};'use strict';var emlformat=require(_0x5323('0x0'));var rimraf=require(_0x5323('0x1'));var zipdir=require(_0x5323('0x2'));var jsonpatch=require(_0x5323('0x3'));var rp=require('request-promise');var moment=require(_0x5323('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5323('0x5'));var util=require(_0x5323('0x6'));var path=require(_0x5323('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5323('0x8'));var fs=require('fs');var fs_extra=require(_0x5323('0x9'));var _=require(_0x5323('0xa'));var squel=require('squel');var crypto=require(_0x5323('0xb'));var jsforce=require(_0x5323('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5323('0xd'));var Papa=require(_0x5323('0xe'));var Redis=require(_0x5323('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5323('0x10'));var hardwareService=require(_0x5323('0x11'));var logger=require(_0x5323('0x12'))('api');var utils=require(_0x5323('0x13'));var config=require(_0x5323('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5323('0x15'))['db'];config[_0x5323('0x16')]=_['defaults'](config[_0x5323('0x16')],{'host':_0x5323('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5323('0x16')]));require(_0x5323('0x18'))[_0x5323('0x19')](socket);var jayson=require(_0x5323('0x1a'));var client=jayson['client'][_0x5323('0x1b')]({'port':0x232c});var client9002=jayson[_0x5323('0x1c')][_0x5323('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x25bfc7,_0x53ba67,_0x265bee,_0x4740e7){return new BPromise(function(_0x5a4e5c,_0x384893){var _0x208a98=_0x4740e7||client;return _0x208a98[_0x5323('0x1d')](_0x25bfc7,_0x265bee)[_0x5323('0x1e')](function(_0x5b0462){logger[_0x5323('0x1f')](_0x5323('0x20'),_0x53ba67,_0x5323('0x21'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x53ba67,_0x5323('0x21'),JSON[_0x5323('0x22')](_0x5b0462));if(_0x5b0462[_0x5323('0x23')]){if(_0x5b0462[_0x5323('0x23')][_0x5323('0x24')]===0x1f4){logger[_0x5323('0x23')](_0x5323('0x20'),_0x53ba67,_0x5b0462['error'][_0x5323('0x25')]);return _0x384893(_0x5b0462[_0x5323('0x23')][_0x5323('0x25')]);}logger['error'](_0x5323('0x20'),_0x53ba67,_0x5b0462[_0x5323('0x23')][_0x5323('0x25')]);return _0x5a4e5c(_0x5b0462[_0x5323('0x23')]['message']);}else{logger[_0x5323('0x1f')](_0x5323('0x20'),_0x53ba67,_0x5323('0x21'));_0x5a4e5c(_0x5b0462[_0x5323('0x26')]['message']);}})[_0x5323('0x27')](function(_0xce9995){logger['error'](_0x5323('0x20'),_0x53ba67,_0xce9995);_0x384893(_0xce9995);});});}function respondWithStatusCode(_0xb8f7bc,_0x2e1596){_0x2e1596=_0x2e1596||0xcc;return function(_0x3f9105){if(_0x3f9105){return _0xb8f7bc[_0x5323('0x28')](_0x2e1596);}return _0xb8f7bc['status'](_0x2e1596)['end']();};}function respondWithResult(_0x4c4807,_0x219f13){_0x219f13=_0x219f13||0xc8;return function(_0x25fbf2){if(_0x25fbf2){return _0x4c4807['status'](_0x219f13)[_0x5323('0x29')](_0x25fbf2);}};}function respondWithFilteredResult(_0x3882aa,_0x2db4ad){return function(_0x2ed9c4){if(_0x2ed9c4){var _0x5f15d8=typeof _0x2db4ad[_0x5323('0x2a')]===_0x5323('0x2b')&&typeof _0x2db4ad[_0x5323('0x2c')]==='undefined';var _0x287721=_0x2ed9c4[_0x5323('0x2d')];var _0x56eca3=_0x5f15d8?0x0:_0x2db4ad[_0x5323('0x2a')];var _0x353da0=_0x5f15d8?_0x2ed9c4[_0x5323('0x2d')]:_0x2db4ad[_0x5323('0x2a')]+_0x2db4ad['limit'];var _0xfd1080;if(_0x353da0>=_0x287721){_0x353da0=_0x287721;_0xfd1080=0xc8;}else{_0xfd1080=0xce;}_0x3882aa[_0x5323('0x2e')](_0xfd1080);return _0x3882aa[_0x5323('0x2f')](_0x5323('0x30'),_0x56eca3+'-'+_0x353da0+'/'+_0x287721)[_0x5323('0x29')](_0x2ed9c4);}return null;};}function patchUpdates(_0xb3e06d){return function(_0x39989d){try{jsonpatch['apply'](_0x39989d,_0xb3e06d,!![]);}catch(_0x574e1a){return BPromise[_0x5323('0x31')](_0x574e1a);}return _0x39989d[_0x5323('0x32')]();};}function saveUpdates(_0xebea3a,_0x342616){return function(_0x57b2ea){if(_0x57b2ea){return _0x57b2ea['update'](_0xebea3a)['then'](function(_0x900b0c){return _0x900b0c;});}return null;};}function removeEntity(_0x583a4d,_0x442a68){return function(_0x119f70){if(_0x119f70){return _0x119f70['destroy']()[_0x5323('0x1e')](function(){_0x583a4d[_0x5323('0x2e')](0xcc)[_0x5323('0x33')]();});}};}function handleEntityNotFound(_0x442fb9,_0x24b412){return function(_0x2f9903){if(!_0x2f9903){_0x442fb9[_0x5323('0x28')](0x194);}return _0x2f9903;};}function handleError(_0x59917a,_0x4c8e78){_0x4c8e78=_0x4c8e78||0x1f4;return function(_0x6d2682){logger[_0x5323('0x23')](_0x6d2682[_0x5323('0x34')]);if(_0x6d2682['name']){delete _0x6d2682[_0x5323('0x35')];}_0x59917a[_0x5323('0x2e')](_0x4c8e78)[_0x5323('0x36')](_0x6d2682);};}exports[_0x5323('0x37')]=function(_0x134a67,_0x2f5bf7){var _0x32a8de={},_0x17734b={},_0x37dac2={'count':0x0,'rows':[]};var _0x1fc157=_[_0x5323('0x38')](db[_0x5323('0x39')][_0x5323('0x3a')],function(_0x18c68a){return{'name':_0x18c68a[_0x5323('0x3b')],'type':_0x18c68a[_0x5323('0x3c')][_0x5323('0x3d')]};});_0x17734b[_0x5323('0x3e')]=_[_0x5323('0x38')](_0x1fc157,_0x5323('0x35'));_0x17734b['query']=_[_0x5323('0x3f')](_0x134a67['query']);_0x17734b[_0x5323('0x40')]=_[_0x5323('0x41')](_0x17734b[_0x5323('0x3e')],_0x17734b['query']);_0x32a8de[_0x5323('0x42')]=_['intersection'](_0x17734b[_0x5323('0x3e')],qs[_0x5323('0x43')](_0x134a67[_0x5323('0x44')][_0x5323('0x43')]));_0x32a8de[_0x5323('0x42')]=_0x32a8de[_0x5323('0x42')]['length']?_0x32a8de[_0x5323('0x42')]:_0x17734b['model'];if(!_0x134a67[_0x5323('0x44')][_0x5323('0x45')](_0x5323('0x46'))){_0x32a8de[_0x5323('0x2c')]=qs[_0x5323('0x2c')](_0x134a67[_0x5323('0x44')][_0x5323('0x2c')]);_0x32a8de['offset']=qs[_0x5323('0x2a')](_0x134a67[_0x5323('0x44')]['offset']);}_0x32a8de[_0x5323('0x47')]=qs[_0x5323('0x48')](_0x134a67[_0x5323('0x44')][_0x5323('0x48')]);_0x32a8de[_0x5323('0x49')]=qs[_0x5323('0x40')](_['pick'](_0x134a67[_0x5323('0x44')],_0x17734b[_0x5323('0x40')]),_0x1fc157);if(_0x134a67[_0x5323('0x44')][_0x5323('0x4a')]){_0x32a8de[_0x5323('0x49')]=_[_0x5323('0x4b')](_0x32a8de[_0x5323('0x49')],{'$or':_['map'](_0x1fc157,function(_0x450931){if(_0x450931['type']!==_0x5323('0x4c')){var _0x399dc7={};_0x399dc7[_0x450931[_0x5323('0x35')]]={'$like':'%'+_0x134a67['query']['filter']+'%'};return _0x399dc7;}})});}_0x32a8de=_['merge']({},_0x32a8de,_0x134a67[_0x5323('0x4d')]);var _0x2115b5={'where':_0x32a8de[_0x5323('0x49')]};return db[_0x5323('0x39')][_0x5323('0x2d')](_0x2115b5)[_0x5323('0x1e')](function(_0x59a3dc){_0x37dac2[_0x5323('0x2d')]=_0x59a3dc;if(_0x134a67[_0x5323('0x44')][_0x5323('0x4e')]){_0x32a8de[_0x5323('0x4f')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5323('0x50')](_0x32a8de);})[_0x5323('0x1e')](function(_0x7a6245){_0x37dac2[_0x5323('0x51')]=_0x7a6245;return _0x37dac2;})[_0x5323('0x1e')](respondWithFilteredResult(_0x2f5bf7,_0x32a8de))['catch'](handleError(_0x2f5bf7,null));};exports[_0x5323('0x52')]=function(_0x483a5f,_0x3f2432){var _0x3dae2b={'raw':!![],'where':{'id':_0x483a5f[_0x5323('0x53')]['id']}},_0x5c4c57={};_0x5c4c57[_0x5323('0x3e')]=_[_0x5323('0x3f')](db[_0x5323('0x39')][_0x5323('0x3a')]);_0x5c4c57['query']=_[_0x5323('0x3f')](_0x483a5f[_0x5323('0x44')]);_0x5c4c57[_0x5323('0x40')]=_['intersection'](_0x5c4c57['model'],_0x5c4c57[_0x5323('0x44')]);_0x3dae2b[_0x5323('0x42')]=_[_0x5323('0x41')](_0x5c4c57[_0x5323('0x3e')],qs[_0x5323('0x43')](_0x483a5f[_0x5323('0x44')]['fields']));_0x3dae2b['attributes']=_0x3dae2b[_0x5323('0x42')][_0x5323('0x54')]?_0x3dae2b[_0x5323('0x42')]:_0x5c4c57['model'];if(_0x483a5f[_0x5323('0x44')][_0x5323('0x4e')]){_0x3dae2b[_0x5323('0x4f')]=[{'all':!![]}];}_0x3dae2b=_[_0x5323('0x4b')]({},_0x3dae2b,_0x483a5f['options']);return db[_0x5323('0x39')][_0x5323('0x55')](_0x3dae2b)['then'](handleEntityNotFound(_0x3f2432,null))[_0x5323('0x1e')](respondWithResult(_0x3f2432,null))['catch'](handleError(_0x3f2432,null));};exports[_0x5323('0x56')]=function(_0x485d3c,_0x464a74){return db[_0x5323('0x39')]['create'](_0x485d3c[_0x5323('0x57')],{})[_0x5323('0x1e')](respondWithResult(_0x464a74,0xc9))[_0x5323('0x27')](handleError(_0x464a74,null));};exports['update']=function(_0x31483c,_0x5f3435){if(_0x31483c['body']['id']){delete _0x31483c['body']['id'];}return db['WhatsappMessage'][_0x5323('0x55')]({'where':{'id':_0x31483c[_0x5323('0x53')]['id']}})[_0x5323('0x1e')](handleEntityNotFound(_0x5f3435,null))[_0x5323('0x1e')](saveUpdates(_0x31483c['body'],null))[_0x5323('0x1e')](respondWithResult(_0x5f3435,null))['catch'](handleError(_0x5f3435,null));};exports[_0x5323('0x58')]=function(_0x471ac4,_0x4a4446){return db['WhatsappMessage'][_0x5323('0x55')]({'where':{'id':_0x471ac4[_0x5323('0x53')]['id']}})[_0x5323('0x1e')](handleEntityNotFound(_0x4a4446,null))[_0x5323('0x1e')](removeEntity(_0x4a4446,null))[_0x5323('0x27')](handleError(_0x4a4446,null));};exports[_0x5323('0x59')]=function(_0x5d9235,_0xf79be7){return db[_0x5323('0x39')]['describe']()[_0x5323('0x1e')](respondWithResult(_0xf79be7,null))['catch'](handleError(_0xf79be7,null));};var interaction_log=require(_0x5323('0x12'))('whatsapp-interactions');exports[_0x5323('0x5a')]=function(_0x45fbb6,_0x243f40,_0x57e28e){var _0x40ce30={'agent':{},'channel':_0x5323('0x5b')};if(_0x45fbb6['body']['id']){delete _0x45fbb6[_0x5323('0x57')]['id'];}_0x45fbb6['body']['read']=!![];_0x45fbb6[_0x5323('0x57')]['readAt']=moment()[_0x5323('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x45fbb6[_0x5323('0x57')]['UserId']=_0x45fbb6[_0x5323('0x57')][_0x5323('0x5d')]||_0x45fbb6[_0x5323('0x5e')]['id'];_0x40ce30[_0x5323('0x5f')]['id']=_0x45fbb6[_0x5323('0x57')][_0x5323('0x5d')];return db[_0x5323('0x39')][_0x5323('0x55')]({'where':{'id':_0x45fbb6[_0x5323('0x53')]['id'],'UserId':null}})[_0x5323('0x1e')](handleEntityNotFound(_0x243f40,null))[_0x5323('0x1e')](saveUpdates(_0x45fbb6['body'],null))[_0x5323('0x1e')](function(_0x36af29){if(_0x36af29){_0x40ce30[_0x5323('0x25')]=_0x36af29[_0x5323('0x60')]({'plain':!![]});return db[_0x5323('0x61')][_0x5323('0x55')]({'where':{'id':_0x36af29[_0x5323('0x62')]}});}return null;})[_0x5323('0x1e')](handleEntityNotFound(_0x243f40,null))[_0x5323('0x1e')](function(_0x5cff64){if(_0x5cff64){return _0x5cff64['update']({'UserId':_0x45fbb6[_0x5323('0x57')][_0x5323('0x5d')],'read1stAt':_['isNil'](_0x5cff64[_0x5323('0x63')])?moment()[_0x5323('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5323('0x1e')](function(_0x28aca9){if(_0x28aca9){_0x40ce30['interaction']=_0x28aca9[_0x5323('0x60')]({'plain':!![]});interaction_log[_0x5323('0x1f')](_0x5323('0x64'),_0x45fbb6[_0x5323('0x5e')]['id'],_0x45fbb6[_0x5323('0x5e')]['name'],_0x45fbb6['user'][_0x5323('0x65')],_0x40ce30[_0x5323('0x66')]['id'],_0x45fbb6[_0x5323('0x57')]?JSON[_0x5323('0x22')](_0x45fbb6[_0x5323('0x57')]):_0x5323('0x67'));return respondWithRpcPromise(_0x5323('0x68'),'acceptMessage',_0x40ce30);}return null;})[_0x5323('0x1e')](function(_0x33034d){var _0x2b4fdd=_0x5323('0x69')+_0x33034d[_0x5323('0x25')]['ContactId'];return db[_0x5323('0x6a')][_0x5323('0x44')](_0x2b4fdd,{'type':db[_0x5323('0x6b')][_0x5323('0x6c')][_0x5323('0x6d')],'raw':!![]})[_0x5323('0x1e')](function(_0x1397ad){return _0x1397ad;});})[_0x5323('0x1e')](function(_0x4b0cc5){if(_0x4b0cc5){_0x40ce30[_0x5323('0x25')][_0x5323('0x6e')]=_0x4b0cc5[0x0];if(!_0x45fbb6[_0x5323('0x57')]['UserId'])return;return db[_0x5323('0x6f')][_0x5323('0x55')]({'where':{'id':_0x45fbb6[_0x5323('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x5323('0x35'),_0x5323('0x70'),_0x5323('0x71'),_0x5323('0x72')],'raw':!![]});}return null;})['then'](function(_0x5df20d){if(!_0x5df20d)return null;_0x40ce30[_0x5323('0x25')]['agent']=_0x5df20d;return _0x40ce30;})[_0x5323('0x1e')](function(_0x588250){if(_0x588250){if(_0x45fbb6[_0x5323('0x57')]['manual']){_0x40ce30[_0x5323('0x25')]['interface']=util['format'](_0x5323('0x73'),_0x45fbb6[_0x5323('0x5e')][_0x5323('0x35')]);_0x40ce30[_0x5323('0x25')][_0x5323('0x74')]=_0x40ce30[_0x5323('0x74')];_0x40ce30[_0x5323('0x25')][_0x5323('0x75')]=_0x40ce30[_0x5323('0x74')];_0x40ce30[_0x5323('0x25')][_0x5323('0x76')]=_0x5323('0x5a');return respondWithRpcPromise(_0x5323('0x77'),_0x5323('0x77'),{'event':'acceptmessage','message':_0x40ce30[_0x5323('0x25')]},client9002)['then'](function(){return _0x40ce30;});}return _0x40ce30;}return null;})[_0x5323('0x1e')](respondWithResult(_0x243f40,null))[_0x5323('0x27')](handleError(_0x243f40,null));};var interaction_log=require(_0x5323('0x12'))(_0x5323('0x78'));exports[_0x5323('0x31')]=function(_0x52540c,_0x380563,_0x12a2a0){var _0x388740={'agent':{},'channel':_0x5323('0x5b')};if(_0x52540c[_0x5323('0x57')]['id']){delete _0x52540c[_0x5323('0x57')]['id'];}_0x52540c[_0x5323('0x57')][_0x5323('0x5d')]=_0x52540c[_0x5323('0x57')]['UserId']||_0x52540c[_0x5323('0x5e')]['id'];_0x388740[_0x5323('0x5f')]['id']=_0x52540c[_0x5323('0x57')][_0x5323('0x5d')];return db[_0x5323('0x39')][_0x5323('0x55')]({'where':{'id':_0x52540c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x380563,null))[_0x5323('0x1e')](function(_0x336ae3){if(_0x336ae3){_0x388740[_0x5323('0x25')]=_0x336ae3[_0x5323('0x60')]({'plain':!![]});return db[_0x5323('0x61')]['find']({'where':{'id':_0x336ae3[_0x5323('0x62')]}});}return null;})[_0x5323('0x1e')](handleEntityNotFound(_0x380563,null))[_0x5323('0x1e')](function(_0x135b4b){if(_0x135b4b){_0x388740['interaction']=_0x135b4b[_0x5323('0x60')]({'plain':!![]});interaction_log[_0x5323('0x1f')](_0x5323('0x79'),_0x52540c[_0x5323('0x5e')]['id'],_0x52540c[_0x5323('0x5e')][_0x5323('0x35')],_0x52540c[_0x5323('0x5e')][_0x5323('0x65')],_0x388740[_0x5323('0x66')]['id'],_0x52540c[_0x5323('0x57')]?JSON[_0x5323('0x22')](_0x52540c['body']):'null');return respondWithRpcPromise(_0x5323('0x7a'),_0x5323('0x7b'),_0x388740);}return null;})[_0x5323('0x1e')](function(_0x2c70eb){var _0x2586a4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c70eb['message'][_0x5323('0x7c')];return db[_0x5323('0x6a')][_0x5323('0x44')](_0x2586a4,{'type':db[_0x5323('0x6b')][_0x5323('0x6c')][_0x5323('0x6d')],'raw':!![]})[_0x5323('0x1e')](function(_0x44458a){return _0x44458a;});})[_0x5323('0x1e')](function(_0x4520a0){if(_0x4520a0){_0x388740[_0x5323('0x25')][_0x5323('0x6e')]=_0x4520a0[0x0];if(!_0x52540c[_0x5323('0x57')][_0x5323('0x5d')])return;return db[_0x5323('0x6f')]['find']({'where':{'id':_0x52540c[_0x5323('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x5323('0x35'),'fullname',_0x5323('0x71'),'internal'],'raw':!![]});}return null;})[_0x5323('0x1e')](function(_0x1aa8f7){if(!_0x1aa8f7)return null;_0x388740['message']['agent']=_0x1aa8f7;return _0x388740;})[_0x5323('0x1e')](function(_0x351675){if(_0x351675){_0x351675[_0x5323('0x25')][_0x5323('0x7d')]=util['format'](_0x5323('0x73'),_0x52540c[_0x5323('0x5e')]['name']);_0x351675['message'][_0x5323('0x74')]=_0x388740[_0x5323('0x74')];_0x351675[_0x5323('0x25')][_0x5323('0x75')]=_0x388740[_0x5323('0x74')];_0x351675['message'][_0x5323('0x76')]=_0x5323('0x31');respondWithRpcPromise(_0x5323('0x77'),_0x5323('0x77'),{'event':'rejectmessage','message':_0x351675[_0x5323('0x25')]},client9002);return _0x388740;}return null;})[_0x5323('0x1e')](respondWithResult(_0x380563,null))[_0x5323('0x27')](handleError(_0x380563,null));};exports[_0x5323('0x2e')]=function(_0x2ae15e,_0x2ff15f,_0x417e43){if(_0x2ae15e[_0x5323('0x57')]['id']){delete _0x2ae15e[_0x5323('0x57')]['id'];}var _0x3360bd;return db[_0x5323('0x39')]['find']({'where':{'id':_0x2ae15e[_0x5323('0x53')]['id']}})[_0x5323('0x1e')](handleEntityNotFound(_0x2ff15f,null))[_0x5323('0x1e')](function(_0x534751){if(_0x534751){_0x3360bd=_0x534751;return db[_0x5323('0x7e')][_0x5323('0x55')]({'where':{'id':_0x534751[_0x5323('0x7f')]}});}})[_0x5323('0x1e')](handleEntityNotFound(_0x2ff15f,null))[_0x5323('0x1e')](function(_0x5538ef){if(_0x5538ef){logger[_0x5323('0x80')](_0x5323('0x81'),_0x5323('0x2e'),'received\x20delivery\x20report\x20from',_0x5538ef['type'],util[_0x5323('0x82')](_0x2ae15e[_0x5323('0x57')],{'showHidden':![],'depth':null}));switch(_0x5538ef[_0x5323('0x3c')]){case _0x5323('0x83'):if(_0x2ae15e[_0x5323('0x57')][_0x5323('0x84')]&&_0x2ae15e[_0x5323('0x57')][_0x5323('0x84')]===_0x3360bd[_0x5323('0x85')]&&_0x2ae15e['body']['MessageStatus']&&_0x2ae15e[_0x5323('0x57')][_0x5323('0x86')]===_0x5323('0x87')){return _0x3360bd[_0x5323('0x88')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5323('0x2e'),_0x5323('0x83'),util[_0x5323('0x82')](_0x2ae15e[_0x5323('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x3360bd;}})[_0x5323('0x1e')](respondWithResult(_0x2ff15f,null))['catch'](handleError(_0x2ff15f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 29ec3fe..955bc62 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x238b9a,_0x4fcbb8){var _0x59ebf3=function(_0x165123){while(--_0x165123){_0x238b9a['push'](_0x238b9a['shift']());}};_0x59ebf3(++_0x4fcbb8);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xb9a7[_0x1b2ff7];return _0x31656a;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7b9a('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b9a('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1396ec){return function(_0x40ef7d,_0x37b25b,_0x24cae3){WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec+':'+_0x40ef7d['id'],_0x40ef7d);WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec,_0x40ef7d);_0x24cae3(null);};}for(var e in events){if(events[_0x7b9a('0x3')](e)){var event=events[e];WhatsappMessage[_0x7b9a('0x4')](e,emitEvent(event));}}module[_0x7b9a('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0x58a4=['emit','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1be82f,_0x1816dc){var _0x1a742b=function(_0x1aec5b){while(--_0x1aec5b){_0x1be82f['push'](_0x1be82f['shift']());}};_0x1a742b(++_0x1816dc);}(_0x58a4,0xbf));var _0x458a=function(_0xac8055,_0x5ababb){_0xac8055=_0xac8055-0x0;var _0x2d5608=_0x58a4[_0xac8055];return _0x2d5608;};'use strict';var EventEmitter=require(_0x458a('0x0'));var WhatsappMessage=require(_0x458a('0x1'))['db'][_0x458a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x458a('0x3')](0x0);var events={'afterCreate':_0x458a('0x4'),'afterUpdate':_0x458a('0x5'),'afterDestroy':_0x458a('0x6')};function emitEvent(_0xacd5b3){return function(_0x362079,_0x1b4d2e,_0x2fde72){WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3+':'+_0x362079['id'],_0x362079);WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3,_0x362079);_0x2fde72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x458a('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index a12714b..e57854c 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc30b=['then','update','createdAt','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','body','whatsapp:','remote','/status?token=','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0x1f8aa2,_0x5462f2){var _0x48338e=function(_0x3fc30e){while(--_0x3fc30e){_0x1f8aa2['push'](_0x1f8aa2['shift']());}};_0x48338e(++_0x5462f2);}(_0xc30b,0xdf));var _0xbc30=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xc30b[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var util=require(_0xbc30('0x0'));var logger=require(_0xbc30('0x1'))('api');var moment=require(_0xbc30('0x2'));var BPromise=require(_0xbc30('0x3'));var rp=require(_0xbc30('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xbc30('0x5'));var rimraf=require(_0xbc30('0x6'));var config=require(_0xbc30('0x7'));var attributes=require(_0xbc30('0x8'));module[_0xbc30('0x9')]=function(_0x12653b,_0x2066e8){return _0x12653b[_0xbc30('0xa')]('WhatsappMessage',attributes,{'tableName':_0xbc30('0xb'),'paranoid':![],'indexes':[{'name':_0xbc30('0xc'),'fields':[_0xbc30('0xc')]},{'name':_0xbc30('0xd'),'fields':['body'],'type':_0xbc30('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16418f,_0x49376c,_0x1f4013){var _0x19e0ca=_0x12653b[_0xbc30('0xf')];var _0x356388=_0x16418f[_0xbc30('0x10')]({'plain':!![]});if(_0x356388[_0xbc30('0x11')][_0xbc30('0x12')]()==='in'||_0x356388[_0xbc30('0x11')]['toLowerCase']()===_0xbc30('0x13')&&!_0x356388['secret']&&!_[_0xbc30('0x14')](_0x356388[_0xbc30('0x15')])){_0x19e0ca[_0xbc30('0x16')][_0xbc30('0x17')]({'where':{'id':_0x356388[_0xbc30('0x18')]}})[_0xbc30('0x19')](function(_0xeee86e){if(_0xeee86e){_0xeee86e[_0xbc30('0x1a')]({'lastMsgAt':_0x356388[_0xbc30('0x1b')],'lastMsgDirection':_0x356388[_0xbc30('0x11')][_0xbc30('0x12')]()});}})[_0xbc30('0x1c')](function(_0x16c9e6){console['error'](_0x16c9e6);});}if(_0x356388[_0xbc30('0x11')]===_0xbc30('0x13')&&!_0x356388[_0xbc30('0x1d')]){var _0x297ac0;_0x19e0ca[_0xbc30('0x1e')][_0xbc30('0x1f')]({'where':{'id':_0x356388[_0xbc30('0x20')]},'raw':!![]})['then'](function(_0x4aa4a5){_0x297ac0=_0x4aa4a5;if(_0x297ac0&&_0x297ac0[_0xbc30('0x21')]){switch(_0x297ac0['type']){case _0xbc30('0x22'):var _0x50c83b=require(_0xbc30('0x22'));if(_0x297ac0['accountSid']&&_0x297ac0[_0xbc30('0x23')]&&_0x297ac0[_0xbc30('0x24')]){var _0xb89ea0=new _0x50c83b(_0x297ac0[_0xbc30('0x25')],_0x297ac0[_0xbc30('0x23')]);_0xb89ea0[_0xbc30('0x26')][_0xbc30('0x27')]({'body':_0x356388[_0xbc30('0x28')],'to':_0xbc30('0x29')+_0x356388[_0xbc30('0x24')],'from':_0xbc30('0x29')+_0x297ac0[_0xbc30('0x24')],'statusCallback':_0x297ac0[_0xbc30('0x2a')]+'/api/whatsapp/messages/'+_0x356388['id']+_0xbc30('0x2b')+_0x297ac0['token']})[_0xbc30('0x19')](function(_0x33a4fb){if(_0x33a4fb['sid']){return _0x16418f[_0xbc30('0x1a')]({'messageId':_0x33a4fb[_0xbc30('0x2c')]});}})['catch'](function(_0x392ebf){logger[_0xbc30('0x2d')](_0xbc30('0x2e'),'afterCreate','twilio',util['inspect'](_0x392ebf,{'showHidden':![],'depth':null}));});}else{logger[_0xbc30('0x2d')](_0xbc30('0x2e'),_0xbc30('0x2f'),_0xbc30('0x22'),_0xbc30('0x30'));}break;case _0xbc30('0x31'):var _0x4b307f=_0x297ac0[_0xbc30('0x25')];var _0x593ae5=_0x297ac0['authToken'];var _0x5f1232=_0x297ac0[_0xbc30('0x32')]+_0xbc30('0x33')+_0x4b307f+_0xbc30('0x34');var _0x4e3a18={'to':[_0x356388[_0xbc30('0x24')]],'message':{'type':_0xbc30('0x35'),'text':_0x356388['body']}};var _0x1a8ed8={'method':_0xbc30('0x36'),'uri':_0x5f1232,'headers':{'Authorization':_0xbc30('0x37')+_0x593ae5,'Content-Type':_0xbc30('0x38')},'body':_0x4e3a18,'json':!![]};rp(_0x1a8ed8)['then'](function(_0x32aba9){if(_0x32aba9[_0xbc30('0x39')][0x0][_0xbc30('0x3a')]){return _0x16418f['update']({'messageId':_0x32aba9[_0xbc30('0x39')][0x0][_0xbc30('0x3a')]});}})['catch'](function(_0x28c13b){logger['err'](_0xbc30('0x3b'),_0x28c13b);});break;}}})[_0xbc30('0x3c')](function(){_0x1f4013();});}else{_0x1f4013();}}},'charset':_0xbc30('0x3d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3b31=['models','get','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','direction','catch','error','WhatsappAccount','find','then','type','twilio','authToken','phone','accountSid','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId'];(function(_0x5b705e,_0x11bcd8){var _0x20eea7=function(_0xa5d725){while(--_0xa5d725){_0x5b705e['push'](_0x5b705e['shift']());}};_0x20eea7(++_0x11bcd8);}(_0x3b31,0x9c));var _0x13b3=function(_0x36fd38,_0xfe6384){_0x36fd38=_0x36fd38-0x0;var _0xf24b75=_0x3b31[_0x36fd38];return _0xf24b75;};'use strict';var _=require('lodash');var util=require(_0x13b3('0x0'));var logger=require(_0x13b3('0x1'))(_0x13b3('0x2'));var moment=require('moment');var BPromise=require(_0x13b3('0x3'));var rp=require('request-promise');var fetch=require(_0x13b3('0x4'));var fs=require('fs');var path=require(_0x13b3('0x5'));var rimraf=require(_0x13b3('0x6'));var config=require(_0x13b3('0x7'));var attributes=require(_0x13b3('0x8'));module['exports']=function(_0x5bfa43,_0x641da7){return _0x5bfa43[_0x13b3('0x9')]('WhatsappMessage',attributes,{'tableName':_0x13b3('0xa'),'paranoid':![],'indexes':[{'name':_0x13b3('0xb'),'fields':[_0x13b3('0xb')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ef4fd,_0x22e125,_0x257ec0){var _0x4c806b=_0x5bfa43[_0x13b3('0xc')];var _0x4b5688=_0x1ef4fd[_0x13b3('0xd')]({'plain':!![]});if(_0x4b5688['direction'][_0x13b3('0xe')]()==='in'||_0x4b5688['direction'][_0x13b3('0xe')]()===_0x13b3('0xf')&&!_0x4b5688[_0x13b3('0x10')]&&!_[_0x13b3('0x11')](_0x4b5688[_0x13b3('0x12')])){_0x4c806b[_0x13b3('0x13')][_0x13b3('0x14')]({'where':{'id':_0x4b5688[_0x13b3('0x15')]}})['then'](function(_0x16d9a0){if(_0x16d9a0){_0x16d9a0[_0x13b3('0x16')]({'lastMsgAt':_0x4b5688[_0x13b3('0x17')],'lastMsgDirection':_0x4b5688[_0x13b3('0x18')][_0x13b3('0xe')]()});}})[_0x13b3('0x19')](function(_0x168895){console[_0x13b3('0x1a')](_0x168895);});}if(_0x4b5688[_0x13b3('0x18')]===_0x13b3('0xf')&&!_0x4b5688['secret']){var _0x328a16;_0x4c806b[_0x13b3('0x1b')][_0x13b3('0x1c')]({'where':{'id':_0x4b5688['WhatsappAccountId']},'raw':!![]})[_0x13b3('0x1d')](function(_0x3e8f80){_0x328a16=_0x3e8f80;if(_0x328a16&&_0x328a16[_0x13b3('0x1e')]){switch(_0x328a16[_0x13b3('0x1e')]){case _0x13b3('0x1f'):var _0x5173fe=require(_0x13b3('0x1f'));if(_0x328a16['accountSid']&&_0x328a16[_0x13b3('0x20')]&&_0x328a16[_0x13b3('0x21')]){var _0x5578dc=new _0x5173fe(_0x328a16[_0x13b3('0x22')],_0x328a16[_0x13b3('0x20')]);_0x5578dc[_0x13b3('0x23')][_0x13b3('0x24')]({'body':_0x4b5688[_0x13b3('0x25')],'to':'whatsapp:'+_0x4b5688[_0x13b3('0x21')],'from':_0x13b3('0x26')+_0x328a16['phone'],'statusCallback':_0x328a16[_0x13b3('0x27')]+_0x13b3('0x28')+_0x4b5688['id']+_0x13b3('0x29')+_0x328a16[_0x13b3('0x2a')]})['then'](function(_0x591a77){if(_0x591a77[_0x13b3('0x2b')]){return _0x1ef4fd['update']({'messageId':_0x591a77['sid']});}})[_0x13b3('0x19')](function(_0x19e702){logger[_0x13b3('0x1a')](_0x13b3('0x2c'),_0x13b3('0x2d'),_0x13b3('0x1f'),util['inspect'](_0x19e702,{'showHidden':![],'depth':null}));});}else{logger[_0x13b3('0x1a')](_0x13b3('0x2c'),_0x13b3('0x2d'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x4ff17d=_0x328a16[_0x13b3('0x22')];var _0x23d339=_0x328a16[_0x13b3('0x20')];var _0xd38cfa=_0x328a16['baseUrl']+_0x13b3('0x2e')+_0x4ff17d+'/messages/';var _0x7f1838={'to':[_0x4b5688[_0x13b3('0x21')]],'message':{'type':_0x13b3('0x2f'),'text':_0x4b5688[_0x13b3('0x25')]}};var _0x53fb1e={'method':_0x13b3('0x30'),'uri':_0xd38cfa,'headers':{'Authorization':_0x13b3('0x31')+_0x23d339,'Content-Type':_0x13b3('0x32')},'body':_0x7f1838,'json':!![]};rp(_0x53fb1e)[_0x13b3('0x1d')](function(_0x2870a7){if(_0x2870a7[_0x13b3('0x33')][0x0][_0x13b3('0x34')]){return _0x1ef4fd[_0x13b3('0x16')]({'messageId':_0x2870a7[_0x13b3('0x33')][0x0][_0x13b3('0x34')]});}})[_0x13b3('0x19')](function(_0x3f65f6){logger[_0x13b3('0x35')](_0x13b3('0x36'),_0x3f65f6);});break;}}})['finally'](function(){_0x257ec0();});}else{_0x257ec0();}}},'charset':'utf8mb4','collate':_0x13b3('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1e4c6c4..8248ff0 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2968=['../../mysqldb','../../config/utils','jayson/promise','redis','defaults','socket.io-emitter','register','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','CreateWhatsappMessage','create','body','options','raw','util','moment','bluebird','ioredis'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2968,0x134));var _0x8296=function(_0x5e4483,_0x4bd4e2){_0x5e4483=_0x5e4483-0x0;var _0x22823e=_0x2968[_0x5e4483];return _0x22823e;};'use strict';var _=require('lodash');var util=require(_0x8296('0x0'));var moment=require(_0x8296('0x1'));var BPromise=require(_0x8296('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8296('0x3'));var db=require(_0x8296('0x4'))['db'];var utils=require(_0x8296('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8296('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x8296('0x7')]=_[_0x8296('0x8')](config[_0x8296('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8296('0x9'))(new Redis(config[_0x8296('0x7')]));require('./whatsappMessage.socket')[_0x8296('0xa')](socket);function respondWithRpcPromise(_0xa492f,_0x2c68b1,_0x514a07){return new BPromise(function(_0x3b6751,_0x33c09c){return client['request'](_0xa492f,_0x514a07)['then'](function(_0x25309a){logger['info'](_0x8296('0xb'),_0x2c68b1,_0x8296('0xc'));logger[_0x8296('0xd')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2c68b1,_0x8296('0xc'),JSON[_0x8296('0xe')](_0x25309a));if(_0x25309a[_0x8296('0xf')]){if(_0x25309a[_0x8296('0xf')]['code']===0x1f4){logger[_0x8296('0xf')](_0x8296('0xb'),_0x2c68b1,_0x25309a[_0x8296('0xf')]['message']);return _0x33c09c(_0x25309a[_0x8296('0xf')][_0x8296('0x10')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x2c68b1,_0x25309a[_0x8296('0xf')]['message']);return _0x3b6751(_0x25309a['error'][_0x8296('0x10')]);}else{logger[_0x8296('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x2c68b1,'request\x20sent');_0x3b6751(_0x25309a['result'][_0x8296('0x10')]);}})[_0x8296('0x12')](function(_0x2c61e7){logger[_0x8296('0xf')](_0x8296('0xb'),_0x2c68b1,_0x2c61e7);_0x33c09c(_0x2c61e7);});});}exports[_0x8296('0x13')]=function(_0x5aaf88){var _0x1aff5f=this;return new Promise(function(_0x235fc3,_0x4f213f){return db['WhatsappMessage'][_0x8296('0x14')](_0x5aaf88[_0x8296('0x15')],{'raw':_0x5aaf88[_0x8296('0x16')]?_0x5aaf88[_0x8296('0x16')][_0x8296('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x461d11){logger[_0x8296('0x11')]('CreateWhatsappMessage',_0x5aaf88);logger[_0x8296('0xd')](_0x8296('0x13'),_0x5aaf88,JSON[_0x8296('0xe')](_0x461d11));_0x235fc3(_0x461d11);})['catch'](function(_0x5970b5){logger[_0x8296('0xf')](_0x8296('0x13'),_0x5970b5[_0x8296('0x10')],_0x5aaf88);_0x4f213f(_0x1aff5f[_0x8296('0xf')](0x1f4,_0x5970b5[_0x8296('0x10')]));});});}; \ No newline at end of file +var _0x0b66=['client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','create','body','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b66,0x182));var _0x60b6=function(_0x4c3957,_0x51a17c){_0x4c3957=_0x4c3957-0x0;var _0x9671f9=_0x0b66[_0x4c3957];return _0x9671f9;};'use strict';var _=require(_0x60b6('0x0'));var util=require('util');var moment=require(_0x60b6('0x1'));var BPromise=require(_0x60b6('0x2'));var rs=require(_0x60b6('0x3'));var fs=require('fs');var Redis=require(_0x60b6('0x4'));var db=require(_0x60b6('0x5'))['db'];var utils=require(_0x60b6('0x6'));var logger=require(_0x60b6('0x7'))(_0x60b6('0x8'));var config=require(_0x60b6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x60b6('0xa')][_0x60b6('0xb')]({'port':0x232a});config[_0x60b6('0xc')]=_[_0x60b6('0xd')](config[_0x60b6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x60b6('0xe'))(new Redis(config[_0x60b6('0xc')]));require(_0x60b6('0xf'))[_0x60b6('0x10')](socket);function respondWithRpcPromise(_0x13fe44,_0x599b7d,_0x7ef6fe){return new BPromise(function(_0x58c33a,_0x48aebc){return client[_0x60b6('0x11')](_0x13fe44,_0x7ef6fe)[_0x60b6('0x12')](function(_0x4123b2){logger[_0x60b6('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x599b7d,_0x60b6('0x14'));logger['debug'](_0x60b6('0x15'),_0x599b7d,_0x60b6('0x14'),JSON['stringify'](_0x4123b2));if(_0x4123b2[_0x60b6('0x16')]){if(_0x4123b2['error'][_0x60b6('0x17')]===0x1f4){logger[_0x60b6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x599b7d,_0x4123b2[_0x60b6('0x16')][_0x60b6('0x18')]);return _0x48aebc(_0x4123b2['error'][_0x60b6('0x18')]);}logger[_0x60b6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x599b7d,_0x4123b2['error']['message']);return _0x58c33a(_0x4123b2['error'][_0x60b6('0x18')]);}else{logger[_0x60b6('0x13')](_0x60b6('0x19'),_0x599b7d,_0x60b6('0x14'));_0x58c33a(_0x4123b2[_0x60b6('0x1a')]['message']);}})[_0x60b6('0x1b')](function(_0x120d91){logger['error'](_0x60b6('0x19'),_0x599b7d,_0x120d91);_0x48aebc(_0x120d91);});});}exports[_0x60b6('0x1c')]=function(_0x2b8ba2){var _0x34ee53=this;return new Promise(function(_0x4eecb6,_0x354a1d){return db['WhatsappMessage'][_0x60b6('0x1d')](_0x2b8ba2[_0x60b6('0x1e')],{'raw':_0x2b8ba2['options']?_0x2b8ba2[_0x60b6('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x587a5c){logger[_0x60b6('0x13')](_0x60b6('0x1c'),_0x2b8ba2);logger['debug'](_0x60b6('0x1c'),_0x2b8ba2,JSON[_0x60b6('0x20')](_0x587a5c));_0x4eecb6(_0x587a5c);})[_0x60b6('0x1b')](function(_0x9a3968){logger[_0x60b6('0x16')](_0x60b6('0x1c'),_0x9a3968[_0x60b6('0x18')],_0x2b8ba2);_0x354a1d(_0x34ee53[_0x60b6('0x16')](0x1f4,_0x9a3968['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 5aeb47c..28882b1 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd8d=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5eb558,_0x5a1eaf){var _0x30d5c1=function(_0x1a75b8){while(--_0x1a75b8){_0x5eb558['push'](_0x5eb558['shift']());}};_0x30d5c1(++_0x5a1eaf);}(_0xcd8d,0x1d5));var _0xdcd8=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xcd8d[_0x4dbba7];return _0x43ef83;};'use strict';var WhatsappMessageEvents=require(_0xdcd8('0x0'));var events=[_0xdcd8('0x1'),_0xdcd8('0x2'),_0xdcd8('0x3')];function createListener(_0x159db4,_0x53c58e){return function(_0x105660){_0x53c58e[_0xdcd8('0x4')](_0x159db4,_0x105660);};}function removeListener(_0x33c144,_0x28c8cd){return function(){WhatsappMessageEvents[_0xdcd8('0x5')](_0x33c144,_0x28c8cd);};}exports[_0xdcd8('0x6')]=function(_0x2b81f7){for(var _0x40438b=0x0,_0x1ba4d0=events[_0xdcd8('0x7')];_0x40438b<_0x1ba4d0;_0x40438b++){var _0x1784de=events[_0x40438b];var _0x1c1e4a=createListener(_0xdcd8('0x8')+_0x1784de,_0x2b81f7);WhatsappMessageEvents['on'](_0x1784de,_0x1c1e4a);}}; \ No newline at end of file +var _0xb068=['remove','update','removeListener','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb068,0x7c));var _0x8b06=function(_0x38423a,_0x4735b8){_0x38423a=_0x38423a-0x0;var _0x3491d3=_0xb068[_0x38423a];return _0x3491d3;};'use strict';var WhatsappMessageEvents=require(_0x8b06('0x0'));var events=[_0x8b06('0x1'),_0x8b06('0x2'),_0x8b06('0x3')];function createListener(_0x49dbec,_0xe284fb){return function(_0x308a5a){_0xe284fb['emit'](_0x49dbec,_0x308a5a);};}function removeListener(_0x48038e,_0x50ecbd){return function(){WhatsappMessageEvents[_0x8b06('0x4')](_0x48038e,_0x50ecbd);};}exports['register']=function(_0x27f23d){for(var _0x5a52ca=0x0,_0x19e339=events[_0x8b06('0x5')];_0x5a52ca<_0x19e339;_0x5a52ca++){var _0x256fc3=events[_0x5a52ca];var _0x72fb13=createListener(_0x8b06('0x6')+_0x256fc3,_0x27f23d);WhatsappMessageEvents['on'](_0x256fc3,_0x72fb13);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 4efa469..2664033 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf521=['/:id','getMembers','/:id/teams','isAuthenticated','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','/describe'];(function(_0x2349e2,_0x5caafd){var _0x3dc63a=function(_0x18e646){while(--_0x18e646){_0x2349e2['push'](_0x2349e2['shift']());}};_0x3dc63a(++_0x5caafd);}(_0xf521,0x17d));var _0x1f52=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0xf521[_0xfb42e6];return _0x27265b;};'use strict';var multer=require(_0x1f52('0x0'));var util=require('util');var path=require(_0x1f52('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f52('0x2'));var router=express[_0x1f52('0x3')]();var fs_extra=require(_0x1f52('0x4'));var auth=require(_0x1f52('0x5'));var interaction=require(_0x1f52('0x6'));var config=require('../../config/environment');var controller=require(_0x1f52('0x7'));router[_0x1f52('0x8')]('/',auth['isAuthenticated'](),controller[_0x1f52('0x9')]);router['get'](_0x1f52('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x1f52('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x1f52('0xc')]);router[_0x1f52('0x8')](_0x1f52('0xd'),auth[_0x1f52('0xe')](),controller['getTeams']);router[_0x1f52('0x8')](_0x1f52('0xf'),auth[_0x1f52('0xe')](),controller[_0x1f52('0x10')]);router[_0x1f52('0x11')]('/',auth[_0x1f52('0xe')](),controller[_0x1f52('0x12')]);router['post'](_0x1f52('0xd'),auth[_0x1f52('0xe')](),controller[_0x1f52('0x13')]);router[_0x1f52('0x11')](_0x1f52('0xf'),auth[_0x1f52('0xe')](),controller[_0x1f52('0x14')]);router[_0x1f52('0x15')](_0x1f52('0xb'),auth[_0x1f52('0xe')](),controller[_0x1f52('0x16')]);router['delete']('/:id',auth[_0x1f52('0xe')](),controller[_0x1f52('0x17')]);router['delete'](_0x1f52('0xd'),auth[_0x1f52('0xe')](),controller[_0x1f52('0x18')]);router[_0x1f52('0x19')](_0x1f52('0xf'),auth[_0x1f52('0xe')](),controller[_0x1f52('0x1a')]);module[_0x1f52('0x1b')]=router; \ No newline at end of file +var _0xa186=['show','/:id/members','getMembers','get','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3ce555,_0x5b1f36){var _0x5a014c=function(_0x4fc95d){while(--_0x4fc95d){_0x3ce555['push'](_0x3ce555['shift']());}};_0x5a014c(++_0x5b1f36);}(_0xa186,0x8d));var _0x6a18=function(_0x57c9ae,_0x3d66a0){_0x57c9ae=_0x57c9ae-0x0;var _0x35b78b=_0xa186[_0x57c9ae];return _0x35b78b;};'use strict';var multer=require(_0x6a18('0x0'));var util=require(_0x6a18('0x1'));var path=require(_0x6a18('0x2'));var timeout=require(_0x6a18('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a18('0x4'));var auth=require(_0x6a18('0x5'));var interaction=require(_0x6a18('0x6'));var config=require(_0x6a18('0x7'));var controller=require(_0x6a18('0x8'));router['get']('/',auth[_0x6a18('0x9')](),controller[_0x6a18('0xa')]);router['get'](_0x6a18('0xb'),auth[_0x6a18('0x9')](),controller[_0x6a18('0xc')]);router['get'](_0x6a18('0xd'),auth[_0x6a18('0x9')](),controller[_0x6a18('0xe')]);router['get'](_0x6a18('0xf'),auth['isAuthenticated'](),controller[_0x6a18('0x10')]);router[_0x6a18('0x11')](_0x6a18('0x12'),auth['isAuthenticated'](),controller[_0x6a18('0x13')]);router[_0x6a18('0x11')](_0x6a18('0x14'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x15')]);router[_0x6a18('0x16')]('/',auth['isAuthenticated'](),controller[_0x6a18('0x17')]);router[_0x6a18('0x16')](_0x6a18('0x12'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x18')]);router[_0x6a18('0x16')](_0x6a18('0x14'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x19')]);router['put'](_0x6a18('0xd'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x1a')]);router['delete'](_0x6a18('0xd'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x1b')]);router['delete'](_0x6a18('0x12'),auth['isAuthenticated'](),controller[_0x6a18('0x1c')]);router['delete'](_0x6a18('0x14'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x1d')]);module[_0x6a18('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 09e1205..8624bdf 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2333=['roundrobin','STRING','sequelize','exports','INTEGER','ENUM','beepall'];(function(_0x1a18c1,_0x573e55){var _0x444d33=function(_0x5d825c){while(--_0x5d825c){_0x1a18c1['push'](_0x1a18c1['shift']());}};_0x444d33(++_0x573e55);}(_0x2333,0x11a));var _0x3233=function(_0x3f1869,_0x39951f){_0x3f1869=_0x3f1869-0x0;var _0x304210=_0x2333[_0x3f1869];return _0x304210;};'use strict';var Sequelize=require(_0x3233('0x0'));module[_0x3233('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3233('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3233('0x3')]('rrmemory',_0x3233('0x4'),_0x3233('0x5'))},'description':{'type':Sequelize[_0x3233('0x6')]}}; \ No newline at end of file +var _0x1120=['sequelize','exports','STRING','beepall','roundrobin'];(function(_0x2a1826,_0x27f029){var _0x58e5cf=function(_0x25fd51){while(--_0x25fd51){_0x2a1826['push'](_0x2a1826['shift']());}};_0x58e5cf(++_0x27f029);}(_0x1120,0x140));var _0x0112=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x1120[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x0112('0x0'));module[_0x0112('0x1')]={'name':{'type':Sequelize[_0x0112('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0112('0x3'),_0x0112('0x4'))},'description':{'type':Sequelize[_0x0112('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e2b0c2d..4336886 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4cd=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','findAll','User','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeAgents','forEach','emit','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','key'];(function(_0x1dd0cb,_0x55e76b){var _0x1218b0=function(_0x527ee3){while(--_0x527ee3){_0x1dd0cb['push'](_0x1dd0cb['shift']());}};_0x1218b0(++_0x55e76b);}(_0xd4cd,0x174));var _0xdd4c=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xd4cd[_0x368587];return _0x42d33c;};'use strict';var emlformat=require(_0xdd4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd4c('0x1'));var jsonpatch=require(_0xdd4c('0x2'));var rp=require(_0xdd4c('0x3'));var moment=require(_0xdd4c('0x4'));var BPromise=require(_0xdd4c('0x5'));var Mustache=require(_0xdd4c('0x6'));var util=require(_0xdd4c('0x7'));var path=require(_0xdd4c('0x8'));var sox=require(_0xdd4c('0x9'));var csv=require(_0xdd4c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd4c('0xb'));var squel=require(_0xdd4c('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd4c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdd4c('0xa'));var querystring=require('querystring');var Papa=require(_0xdd4c('0xe'));var Redis=require(_0xdd4c('0xf'));var authService=require(_0xdd4c('0x10'));var qs=require(_0xdd4c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd4c('0x12'))(_0xdd4c('0x13'));var utils=require(_0xdd4c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdd4c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdd4c('0x16')],{'host':_0xdd4c('0x17'),'port':0x18eb});var socket=require(_0xdd4c('0x18'))(new Redis(config[_0xdd4c('0x16')]));require('./whatsappQueue.socket')[_0xdd4c('0x19')](socket);function respondWithStatusCode(_0x18d515,_0x5f0c2b){_0x5f0c2b=_0x5f0c2b||0xcc;return function(_0x263852){if(_0x263852){return _0x18d515[_0xdd4c('0x1a')](_0x5f0c2b);}return _0x18d515[_0xdd4c('0x1b')](_0x5f0c2b)[_0xdd4c('0x1c')]();};}function respondWithResult(_0x3fa543,_0x56fbdb){_0x56fbdb=_0x56fbdb||0xc8;return function(_0x40a9e9){if(_0x40a9e9){return _0x3fa543[_0xdd4c('0x1b')](_0x56fbdb)[_0xdd4c('0x1d')](_0x40a9e9);}};}function respondWithFilteredResult(_0x1fef0d,_0xd53787){return function(_0x42b00e){if(_0x42b00e){var _0x2e703d=typeof _0xd53787[_0xdd4c('0x1e')]==='undefined'&&typeof _0xd53787['limit']===_0xdd4c('0x1f');var _0x277dfd=_0x42b00e[_0xdd4c('0x20')];var _0x2a2f4c=_0x2e703d?0x0:_0xd53787[_0xdd4c('0x1e')];var _0x1c55c9=_0x2e703d?_0x42b00e[_0xdd4c('0x20')]:_0xd53787['offset']+_0xd53787[_0xdd4c('0x21')];var _0x59c2df;if(_0x1c55c9>=_0x277dfd){_0x1c55c9=_0x277dfd;_0x59c2df=0xc8;}else{_0x59c2df=0xce;}_0x1fef0d[_0xdd4c('0x1b')](_0x59c2df);return _0x1fef0d[_0xdd4c('0x22')](_0xdd4c('0x23'),_0x2a2f4c+'-'+_0x1c55c9+'/'+_0x277dfd)[_0xdd4c('0x1d')](_0x42b00e);}return null;};}function patchUpdates(_0x318e03){return function(_0x32cb95){try{jsonpatch[_0xdd4c('0x24')](_0x32cb95,_0x318e03,!![]);}catch(_0x2ed251){return BPromise[_0xdd4c('0x25')](_0x2ed251);}return _0x32cb95['save']();};}function saveUpdates(_0x2863bc,_0x12b089){return function(_0x264337){if(_0x264337){return _0x264337[_0xdd4c('0x26')](_0x2863bc)[_0xdd4c('0x27')](function(_0x2b8aa6){return _0x2b8aa6;});}return null;};}function removeEntity(_0x2edc3c,_0x190e08){return function(_0x51d4a1){if(_0x51d4a1){return _0x51d4a1['destroy']()[_0xdd4c('0x27')](function(){var _0x55bf88=_0x51d4a1[_0xdd4c('0x28')]({'plain':!![]});var _0x3e0102=_0xdd4c('0x29');return db[_0xdd4c('0x2a')][_0xdd4c('0x2b')]({'where':{'type':_0x3e0102,'resourceId':_0x55bf88['id']}})['then'](function(){return _0x51d4a1;});})[_0xdd4c('0x27')](function(){_0x2edc3c[_0xdd4c('0x1b')](0xcc)[_0xdd4c('0x1c')]();});}};}function handleEntityNotFound(_0x118436,_0x7e29ae){return function(_0x26f348){if(!_0x26f348){_0x118436[_0xdd4c('0x1a')](0x194);}return _0x26f348;};}function handleError(_0xb3d2e4,_0x3b23ae){_0x3b23ae=_0x3b23ae||0x1f4;return function(_0x561f9d){logger[_0xdd4c('0x2c')](_0x561f9d[_0xdd4c('0x2d')]);if(_0x561f9d[_0xdd4c('0x2e')]){delete _0x561f9d[_0xdd4c('0x2e')];}_0xb3d2e4[_0xdd4c('0x1b')](_0x3b23ae)[_0xdd4c('0x2f')](_0x561f9d);};}exports[_0xdd4c('0x30')]=function(_0x59429d,_0x5383d6){var _0x50854b={},_0x49669d={},_0x2d1a2d={'count':0x0,'rows':[]};var _0x22bdbe=_[_0xdd4c('0x31')](db[_0xdd4c('0x32')]['rawAttributes'],function(_0x54dd37){return{'name':_0x54dd37[_0xdd4c('0x33')],'type':_0x54dd37[_0xdd4c('0x34')][_0xdd4c('0x35')]};});_0x49669d[_0xdd4c('0x36')]=_[_0xdd4c('0x31')](_0x22bdbe,'name');_0x49669d[_0xdd4c('0x37')]=_[_0xdd4c('0x38')](_0x59429d[_0xdd4c('0x37')]);_0x49669d[_0xdd4c('0x39')]=_['intersection'](_0x49669d[_0xdd4c('0x36')],_0x49669d[_0xdd4c('0x37')]);_0x50854b[_0xdd4c('0x3a')]=_[_0xdd4c('0x3b')](_0x49669d[_0xdd4c('0x36')],qs[_0xdd4c('0x3c')](_0x59429d[_0xdd4c('0x37')][_0xdd4c('0x3c')]));_0x50854b[_0xdd4c('0x3a')]=_0x50854b['attributes'][_0xdd4c('0x3d')]?_0x50854b[_0xdd4c('0x3a')]:_0x49669d['model'];if(!_0x59429d['query'][_0xdd4c('0x3e')](_0xdd4c('0x3f'))){_0x50854b[_0xdd4c('0x21')]=qs['limit'](_0x59429d[_0xdd4c('0x37')][_0xdd4c('0x21')]);_0x50854b['offset']=qs[_0xdd4c('0x1e')](_0x59429d[_0xdd4c('0x37')][_0xdd4c('0x1e')]);}_0x50854b['order']=qs[_0xdd4c('0x40')](_0x59429d[_0xdd4c('0x37')][_0xdd4c('0x40')]);_0x50854b['where']=qs[_0xdd4c('0x39')](_[_0xdd4c('0x41')](_0x59429d['query'],_0x49669d[_0xdd4c('0x39')]),_0x22bdbe);if(_0x59429d['query'][_0xdd4c('0x42')]){_0x50854b[_0xdd4c('0x43')]=_[_0xdd4c('0x44')](_0x50854b[_0xdd4c('0x43')],{'$or':_['map'](_0x22bdbe,function(_0x2467a6){if(_0x2467a6[_0xdd4c('0x34')]!==_0xdd4c('0x45')){var _0x425686={};_0x425686[_0x2467a6['name']]={'$like':'%'+_0x59429d[_0xdd4c('0x37')][_0xdd4c('0x42')]+'%'};return _0x425686;}})});}_0x50854b=_[_0xdd4c('0x44')]({},_0x50854b,_0x59429d[_0xdd4c('0x46')]);var _0x191800={'where':_0x50854b[_0xdd4c('0x43')]};return db['WhatsappQueue'][_0xdd4c('0x20')](_0x191800)[_0xdd4c('0x27')](function(_0x263265){_0x2d1a2d[_0xdd4c('0x20')]=_0x263265;if(_0x59429d[_0xdd4c('0x37')][_0xdd4c('0x47')]){_0x50854b[_0xdd4c('0x48')]=[{'all':!![]}];}return db[_0xdd4c('0x32')]['findAll'](_0x50854b);})[_0xdd4c('0x27')](function(_0xeaaa44){_0x2d1a2d[_0xdd4c('0x49')]=_0xeaaa44;return _0x2d1a2d;})[_0xdd4c('0x27')](respondWithFilteredResult(_0x5383d6,_0x50854b))[_0xdd4c('0x4a')](handleError(_0x5383d6,null));};exports[_0xdd4c('0x4b')]=function(_0x1ff2db,_0x135f65){var _0x1bbddf={'raw':!![],'where':{'id':_0x1ff2db[_0xdd4c('0x4c')]['id']}},_0x127c30={};_0x127c30[_0xdd4c('0x36')]=_['keys'](db['WhatsappQueue'][_0xdd4c('0x4d')]);_0x127c30[_0xdd4c('0x37')]=_[_0xdd4c('0x38')](_0x1ff2db[_0xdd4c('0x37')]);_0x127c30[_0xdd4c('0x39')]=_['intersection'](_0x127c30[_0xdd4c('0x36')],_0x127c30[_0xdd4c('0x37')]);_0x1bbddf['attributes']=_[_0xdd4c('0x3b')](_0x127c30[_0xdd4c('0x36')],qs['fields'](_0x1ff2db[_0xdd4c('0x37')][_0xdd4c('0x3c')]));_0x1bbddf[_0xdd4c('0x3a')]=_0x1bbddf['attributes'][_0xdd4c('0x3d')]?_0x1bbddf[_0xdd4c('0x3a')]:_0x127c30[_0xdd4c('0x36')];if(_0x1ff2db[_0xdd4c('0x37')][_0xdd4c('0x47')]){_0x1bbddf['include']=[{'all':!![]}];}_0x1bbddf=_[_0xdd4c('0x44')]({},_0x1bbddf,_0x1ff2db[_0xdd4c('0x46')]);return db[_0xdd4c('0x32')]['find'](_0x1bbddf)[_0xdd4c('0x27')](handleEntityNotFound(_0x135f65,null))[_0xdd4c('0x27')](respondWithResult(_0x135f65,null))['catch'](handleError(_0x135f65,null));};exports[_0xdd4c('0x4e')]=function(_0x1d599f,_0xe73ee1){return db[_0xdd4c('0x32')][_0xdd4c('0x4e')](_0x1d599f['body'],{})[_0xdd4c('0x27')](function(_0x21e687){var _0x1c85ff=_0x1d599f[_0xdd4c('0x4f')][_0xdd4c('0x28')]({'plain':!![]});if(!_0x1c85ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c85ff[_0xdd4c('0x50')]===_0xdd4c('0x4f')){var _0x48af4b=_0x21e687[_0xdd4c('0x28')]({'plain':!![]});var _0x3d8ebf='WhatsappQueues';return db[_0xdd4c('0x51')][_0xdd4c('0x52')]({'where':{'name':_0x3d8ebf,'userProfileId':_0x1c85ff[_0xdd4c('0x53')]},'raw':!![]})[_0xdd4c('0x27')](function(_0x496d2f){if(_0x496d2f&&_0x496d2f[_0xdd4c('0x54')]===0x0){return db[_0xdd4c('0x2a')][_0xdd4c('0x4e')]({'name':_0x48af4b[_0xdd4c('0x2e')],'resourceId':_0x48af4b['id'],'type':_0x496d2f['name'],'sectionId':_0x496d2f['id']},{})['then'](function(){return _0x21e687;});}else{return _0x21e687;}})['catch'](function(_0x1ea3d4){logger[_0xdd4c('0x2c')](_0xdd4c('0x55'),_0x1ea3d4);throw _0x1ea3d4;});}return _0x21e687;})[_0xdd4c('0x27')](respondWithResult(_0xe73ee1,0xc9))[_0xdd4c('0x4a')](handleError(_0xe73ee1,null));};exports['update']=function(_0x3f5151,_0x25dc1d){if(_0x3f5151[_0xdd4c('0x56')]['id']){delete _0x3f5151[_0xdd4c('0x56')]['id'];}return db['WhatsappQueue'][_0xdd4c('0x52')]({'where':{'id':_0x3f5151['params']['id']}})['then'](handleEntityNotFound(_0x25dc1d,null))[_0xdd4c('0x27')](saveUpdates(_0x3f5151['body'],null))['then'](respondWithResult(_0x25dc1d,null))['catch'](handleError(_0x25dc1d,null));};exports[_0xdd4c('0x2b')]=function(_0x5a8837,_0x2f2fc0){return db[_0xdd4c('0x32')]['find']({'where':{'id':_0x5a8837['params']['id']}})['then'](handleEntityNotFound(_0x2f2fc0,null))[_0xdd4c('0x27')](removeEntity(_0x2f2fc0,null))[_0xdd4c('0x4a')](handleError(_0x2f2fc0,null));};exports[_0xdd4c('0x57')]=function(_0xf1584b,_0x1bea73){return db['WhatsappQueue']['describe']()['then'](respondWithResult(_0x1bea73,null))[_0xdd4c('0x4a')](handleError(_0x1bea73,null));};exports[_0xdd4c('0x58')]=function(_0x2f75a8,_0x382b21,_0xdf7e99){var _0x4ed8f8={'raw':!![],'where':{}},_0x5d27da={},_0x8579d7;return db[_0xdd4c('0x32')][_0xdd4c('0x59')]({'where':{'id':_0x2f75a8[_0xdd4c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x382b21,null))[_0xdd4c('0x27')](function(_0x4cc60f){if(_0x4cc60f){_0x8579d7=_0x4cc60f['get']({'plain':!![]});_0x5d27da[_0xdd4c('0x36')]=_['keys'](db[_0xdd4c('0x5a')]['rawAttributes']);_0x5d27da[_0xdd4c('0x37')]=_[_0xdd4c('0x38')](_0x2f75a8[_0xdd4c('0x37')]);_0x5d27da[_0xdd4c('0x39')]=_['intersection'](_0x5d27da[_0xdd4c('0x36')],_0x5d27da['query']);_0x4ed8f8[_0xdd4c('0x3a')]=_[_0xdd4c('0x3b')](_0x5d27da[_0xdd4c('0x36')],qs[_0xdd4c('0x3c')](_0x2f75a8[_0xdd4c('0x37')]['fields']));_0x4ed8f8[_0xdd4c('0x3a')]=_0x4ed8f8['attributes']['length']?_0x4ed8f8[_0xdd4c('0x3a')]:_0x5d27da['model'];if(!_0x2f75a8[_0xdd4c('0x37')]['hasOwnProperty']('nolimit')){_0x4ed8f8['limit']=qs[_0xdd4c('0x21')](_0x2f75a8['query'][_0xdd4c('0x21')]);_0x4ed8f8[_0xdd4c('0x1e')]=qs[_0xdd4c('0x1e')](_0x2f75a8[_0xdd4c('0x37')][_0xdd4c('0x1e')]);}_0x4ed8f8[_0xdd4c('0x5b')]=qs[_0xdd4c('0x40')](_0x2f75a8[_0xdd4c('0x37')][_0xdd4c('0x40')]);_0x4ed8f8[_0xdd4c('0x43')]=qs['filters'](_[_0xdd4c('0x41')](_0x2f75a8[_0xdd4c('0x37')],_0x5d27da['filters']));_0x4ed8f8[_0xdd4c('0x43')][_0xdd4c('0x5c')]=_0x4cc60f['id'];if(_0x2f75a8['query'][_0xdd4c('0x42')]){_0x4ed8f8[_0xdd4c('0x43')]=_[_0xdd4c('0x44')](_0x4ed8f8[_0xdd4c('0x43')],{'$or':_[_0xdd4c('0x31')](_0x4ed8f8['attributes'],function(_0x829800){var _0x53029c={};_0x53029c[_0x829800]={'$like':'%'+_0x2f75a8['query'][_0xdd4c('0x42')]+'%'};return _0x53029c;})});}_0x4ed8f8=_[_0xdd4c('0x44')]({},_0x4ed8f8,_0x2f75a8[_0xdd4c('0x46')]);return db[_0xdd4c('0x5a')][_0xdd4c('0x5d')](_0x4ed8f8);}})[_0xdd4c('0x27')](function(_0x49f436){if(_0x49f436){return db[_0xdd4c('0x5e')][_0xdd4c('0x5f')]({'where':{'id':_[_0xdd4c('0x31')](_0x49f436,'UserId'),'role':_0xdd4c('0x60')},'attributes':['id',_0xdd4c('0x2e'),_0xdd4c('0x61'),'updatedAt',_0xdd4c('0x62')]});}})[_0xdd4c('0x27')](function(_0x5e6780){if(_0x5e6780){return{'count':_0x5e6780[_0xdd4c('0x20')],'rows':_[_0xdd4c('0x31')](_0x5e6780[_0xdd4c('0x49')],function(_0x34a8dc){return{'membername':_0x34a8dc[_0xdd4c('0x2e')],'UserId':_0x34a8dc['id'],'queue_name':_0x8579d7['name'],'WhatsappQueueId':_0x8579d7['id'],'interface':util[_0xdd4c('0x63')](_0xdd4c('0x64'),_0xdd4c('0x65'),_0x34a8dc['name']),'penalty':0x0,'paused':_0x34a8dc[_0xdd4c('0x61')],'createdAt':_0x34a8dc[_0xdd4c('0x62')],'updatedAt':_0x34a8dc['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x382b21,_0x4ed8f8))['catch'](handleError(_0x382b21,null));};exports[_0xdd4c('0x66')]=function(_0x31284e,_0xac0444,_0x18b714){var _0x4666c3={};var _0x36f807={};var _0x426a0c;var _0x3670d9;return db[_0xdd4c('0x32')][_0xdd4c('0x59')]({'where':{'id':_0x31284e[_0xdd4c('0x4c')]['id']}})['then'](handleEntityNotFound(_0xac0444,null))[_0xdd4c('0x27')](function(_0x2d03c5){if(_0x2d03c5){_0x426a0c=_0x2d03c5;_0x36f807['model']=_[_0xdd4c('0x38')](db[_0xdd4c('0x67')][_0xdd4c('0x4d')]);_0x36f807[_0xdd4c('0x37')]=_[_0xdd4c('0x38')](_0x31284e['query']);_0x36f807[_0xdd4c('0x39')]=_[_0xdd4c('0x3b')](_0x36f807[_0xdd4c('0x36')],_0x36f807[_0xdd4c('0x37')]);_0x4666c3[_0xdd4c('0x3a')]=_['intersection'](_0x36f807[_0xdd4c('0x36')],qs[_0xdd4c('0x3c')](_0x31284e[_0xdd4c('0x37')][_0xdd4c('0x3c')]));_0x4666c3[_0xdd4c('0x3a')]=_0x4666c3['attributes'][_0xdd4c('0x3d')]?_0x4666c3[_0xdd4c('0x3a')]:_0x36f807[_0xdd4c('0x36')];_0x4666c3[_0xdd4c('0x5b')]=qs['sort'](_0x31284e[_0xdd4c('0x37')][_0xdd4c('0x40')]);_0x4666c3['where']=qs[_0xdd4c('0x39')](_[_0xdd4c('0x41')](_0x31284e[_0xdd4c('0x37')],_0x36f807[_0xdd4c('0x39')]));if(_0x31284e[_0xdd4c('0x37')][_0xdd4c('0x42')]){_0x4666c3[_0xdd4c('0x43')]=_[_0xdd4c('0x44')](_0x4666c3[_0xdd4c('0x43')],{'$or':_[_0xdd4c('0x31')](_0x4666c3['attributes'],function(_0x316f27){var _0x28df4b={};_0x28df4b[_0x316f27]={'$like':'%'+_0x31284e['query'][_0xdd4c('0x42')]+'%'};return _0x28df4b;})});}_0x4666c3=_['merge']({},_0x4666c3,_0x31284e['options']);return _0x426a0c['getTeams'](_0x4666c3);}})[_0xdd4c('0x27')](function(_0xdf9cbd){if(_0xdf9cbd){_0x3670d9=_0xdf9cbd[_0xdd4c('0x3d')];if(!_0x31284e[_0xdd4c('0x37')][_0xdd4c('0x3e')](_0xdd4c('0x3f'))){_0x4666c3['limit']=qs[_0xdd4c('0x21')](_0x31284e[_0xdd4c('0x37')][_0xdd4c('0x21')]);_0x4666c3[_0xdd4c('0x1e')]=qs['offset'](_0x31284e[_0xdd4c('0x37')]['offset']);}return _0x426a0c['getTeams'](_0x4666c3);}})[_0xdd4c('0x27')](function(_0x4c4bc7){if(_0x4c4bc7){return _0x4c4bc7?{'count':_0x3670d9,'rows':_0x4c4bc7}:null;}})['then'](respondWithResult(_0xac0444,null))[_0xdd4c('0x4a')](handleError(_0xac0444,null));};exports['addTeams']=function(_0x2c7ee0,_0x37f7c8,_0x10b603){var _0x10289e=_0x2c7ee0[_0xdd4c('0x56')][_0xdd4c('0x68')];return db[_0xdd4c('0x67')][_0xdd4c('0x5d')]({'where':{'id':_0x10289e},'attributes':['id'],'include':[{'model':db[_0xdd4c('0x5e')],'as':_0xdd4c('0x69'),'attributes':['id',_0xdd4c('0x2e'),_0xdd4c('0x6a'),_0xdd4c('0x6b'),_0xdd4c('0x6c')],'raw':!![]}]})[_0xdd4c('0x27')](function(_0x3aa577){if(_0x3aa577){var _0x1b3c20=_['flatMap'](_0x3aa577,function(_0x2d3a34){var _0x2f9782=_0x2d3a34['get']({'plain':!![]});return _0x2f9782[_0xdd4c('0x69')];});return db[_0xdd4c('0x32')][_0xdd4c('0x52')]({'where':{'id':_0x2c7ee0[_0xdd4c('0x4c')]['id']}})[_0xdd4c('0x27')](function(_0x109492){return db[_0xdd4c('0x6d')]['transaction'](function(_0x31c18b){return _0x109492['addTeams'](_0x10289e,{'transaction':_0x31c18b})[_0xdd4c('0x27')](function(){return BPromise[_0xdd4c('0x6e')](_0x1b3c20,function(_0x663ff3){return db[_0xdd4c('0x5a')][_0xdd4c('0x6f')]({'where':{'UserId':_0x663ff3['id'],'WhatsappQueueId':_0x2c7ee0[_0xdd4c('0x4c')]['id']},'transaction':_0x31c18b});});})[_0xdd4c('0x27')](function(){_0x1b3c20['forEach'](function(_0x9a2079){socket['emit'](_0xdd4c('0x70'),{'UserId':_0x9a2079['id'],'WhatsappQueueId':_0x109492['id']});});});});});}})[_0xdd4c('0x27')](respondWithStatusCode(_0x37f7c8,null))[_0xdd4c('0x4a')](handleError(_0x37f7c8,null));};exports[_0xdd4c('0x71')]=function(_0x27a65d,_0x46015c,_0x3c0977){return db[_0xdd4c('0x67')][_0xdd4c('0x5d')]({'where':{'id':_0x27a65d[_0xdd4c('0x37')][_0xdd4c('0x68')]},'attributes':['id'],'include':[{'model':db[_0xdd4c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdd4c('0x27')](handleEntityNotFound(_0x46015c,null))[_0xdd4c('0x27')](function(_0x2b80ec){var _0x4fd683=_['map'](_0x2b80ec,'id');var _0x18b4e2=[];var _0x2a8a5a=[];var _0x590cc5=squel[_0xdd4c('0x72')]();_0x590cc5[_0xdd4c('0x73')](_0xdd4c('0x74'))[_0xdd4c('0x75')]('team_has_whatsapp_queues','tq')[_0xdd4c('0x76')](_0xdd4c('0x77'),'ut',_0xdd4c('0x78'))['where'](_0xdd4c('0x79'),_0x27a65d['params']['id']);for(var _0x42f74a=0x0;_0x42f74a<_0x2b80ec[_0xdd4c('0x3d')];_0x42f74a+=0x1){let _0x271f78=_0x2b80ec[_0x42f74a];for(var _0x47e983=0x0;_0x47e983<_0x271f78[_0xdd4c('0x69')][_0xdd4c('0x3d')];_0x47e983+=0x1){let _0x56db3b=_0x271f78[_0xdd4c('0x69')][_0x47e983];var _0x4e2ea3=_0x590cc5[_0xdd4c('0x7a')]();_0x4e2ea3[_0xdd4c('0x43')]('ut.UserId\x20=\x20?',_0x56db3b['id']);_0x2a8a5a['push'](db[_0xdd4c('0x6d')][_0xdd4c('0x37')](_0x4e2ea3[_0xdd4c('0x7b')](),{'type':db[_0xdd4c('0x6d')][_0xdd4c('0x7c')][_0xdd4c('0x7d')]})['then'](function(_0x2a8925){if(_0x2a8925[_0xdd4c('0x3d')]===0x1){return _0x56db3b['id'];}else{var _0x31a337=_['every'](_[_0xdd4c('0x31')](_0x2a8925,_0xdd4c('0x7e')),function(_0x3a13c5){return _[_0xdd4c('0x7f')](_0x4fd683,_0x3a13c5);});if(_0x31a337){return _0x56db3b['id'];}}}));}}return BPromise[_0xdd4c('0x80')](_0x2a8a5a)[_0xdd4c('0x27')](function(_0x310fab){_0x18b4e2=_(_0x18b4e2)[_0xdd4c('0x81')](_0x310fab)[_0xdd4c('0x82')]()[_0xdd4c('0x83')]();return db[_0xdd4c('0x32')][_0xdd4c('0x52')]({'where':{'id':_0x27a65d['params']['id']}})['then'](function(_0x1aedd0){return db[_0xdd4c('0x6d')][_0xdd4c('0x84')](function(_0x44eac1){return _0x1aedd0[_0xdd4c('0x71')](_0x27a65d[_0xdd4c('0x37')]['ids'],{'transaction':_0x44eac1})['then'](function(){if(!_['isEmpty'](_0x18b4e2)){return _0x1aedd0[_0xdd4c('0x85')](_0x18b4e2,{'transaction':_0x44eac1});}})['then'](function(){_0x18b4e2[_0xdd4c('0x86')](function(_0x5a61e2){socket[_0xdd4c('0x87')]('userWhatsappQueue:remove',{'UserId':_0x5a61e2,'WhatsappQueueId':_0x1aedd0['id']});});});});});});})[_0xdd4c('0x27')](respondWithStatusCode(_0x46015c,null))['catch'](handleError(_0x46015c,null));};exports[_0xdd4c('0x88')]=function(_0x4aac89,_0x13ba11,_0x1fc1c0){return db[_0xdd4c('0x32')][_0xdd4c('0x52')]({'where':{'id':_0x4aac89[_0xdd4c('0x4c')]['id']}})[_0xdd4c('0x27')](handleEntityNotFound(_0x13ba11,null))[_0xdd4c('0x27')](function(_0x514208){if(_0x514208){return _0x514208[_0xdd4c('0x88')](_0x4aac89[_0xdd4c('0x56')][_0xdd4c('0x68')],_[_0xdd4c('0x89')](_0x4aac89[_0xdd4c('0x56')],['ids','id'])||{})[_0xdd4c('0x8a')](function(_0x27de53){for(var _0x3c9c8f=0x0;_0x3c9c8f<_0x4aac89[_0xdd4c('0x56')][_0xdd4c('0x68')][_0xdd4c('0x3d')];_0x3c9c8f+=0x1){socket['emit'](_0xdd4c('0x70'),{'UserId':Number(_0x4aac89['body'][_0xdd4c('0x68')][_0x3c9c8f]),'WhatsappQueueId':Number(_0x4aac89[_0xdd4c('0x4c')]['id'])});}return _0x27de53;});}})[_0xdd4c('0x27')](respondWithResult(_0x13ba11,null))[_0xdd4c('0x4a')](handleError(_0x13ba11,null));};exports[_0xdd4c('0x85')]=function(_0x3141eb,_0x57811c,_0x82779b){return db['WhatsappQueue']['find']({'where':{'id':_0x3141eb[_0xdd4c('0x4c')]['id']}})[_0xdd4c('0x27')](handleEntityNotFound(_0x57811c,null))[_0xdd4c('0x27')](function(_0x2c1b31){if(_0x2c1b31){return _0x2c1b31['removeAgents'](_0x3141eb[_0xdd4c('0x37')][_0xdd4c('0x68')])[_0xdd4c('0x27')](function(){if(_[_0xdd4c('0x8b')](_0x3141eb[_0xdd4c('0x37')][_0xdd4c('0x68')])){for(var _0x6ef547=0x0;_0x6ef547<_0x3141eb[_0xdd4c('0x37')]['ids']['length'];_0x6ef547+=0x1){socket['emit'](_0xdd4c('0x8c'),{'UserId':Number(_0x3141eb[_0xdd4c('0x37')][_0xdd4c('0x68')][_0x6ef547]),'WhatsappQueueId':Number(_0x3141eb[_0xdd4c('0x4c')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x3141eb['query'][_0xdd4c('0x68')]),'WhatsappQueueId':Number(_0x3141eb[_0xdd4c('0x4c')]['id'])});}});}})[_0xdd4c('0x27')](respondWithStatusCode(_0x57811c,null))[_0xdd4c('0x4a')](handleError(_0x57811c,null));};exports[_0xdd4c('0x8d')]=function(_0x28e7dd,_0x496693,_0x19ad5e){var _0x322d05={};var _0xde5f6a={};var _0x4144f2;var _0x57a6dd;return db[_0xdd4c('0x32')][_0xdd4c('0x59')]({'where':{'id':_0x28e7dd[_0xdd4c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x496693,null))[_0xdd4c('0x27')](function(_0x4b3c62){if(_0x4b3c62){_0x4144f2=_0x4b3c62;_0xde5f6a[_0xdd4c('0x36')]=_[_0xdd4c('0x38')](db[_0xdd4c('0x5e')][_0xdd4c('0x4d')]);_0xde5f6a[_0xdd4c('0x37')]=_['keys'](_0x28e7dd[_0xdd4c('0x37')]);_0xde5f6a[_0xdd4c('0x39')]=_['intersection'](_0xde5f6a[_0xdd4c('0x36')],_0xde5f6a[_0xdd4c('0x37')]);_0x322d05[_0xdd4c('0x3a')]=_[_0xdd4c('0x3b')](_0xde5f6a[_0xdd4c('0x36')],qs['fields'](_0x28e7dd[_0xdd4c('0x37')][_0xdd4c('0x3c')]));_0x322d05[_0xdd4c('0x3a')]=_0x322d05[_0xdd4c('0x3a')][_0xdd4c('0x3d')]?_0x322d05[_0xdd4c('0x3a')]:_0xde5f6a[_0xdd4c('0x36')];_0x322d05[_0xdd4c('0x5b')]=qs[_0xdd4c('0x40')](_0x28e7dd[_0xdd4c('0x37')][_0xdd4c('0x40')]);_0x322d05[_0xdd4c('0x43')]=qs['filters'](_[_0xdd4c('0x41')](_0x28e7dd[_0xdd4c('0x37')],_0xde5f6a[_0xdd4c('0x39')]));if(_0x28e7dd['query'][_0xdd4c('0x42')]){_0x322d05['where']=_[_0xdd4c('0x44')](_0x322d05[_0xdd4c('0x43')],{'$or':_['map'](_0x322d05[_0xdd4c('0x3a')],function(_0x5c11f){var _0x2f458f={};_0x2f458f[_0x5c11f]={'$like':'%'+_0x28e7dd[_0xdd4c('0x37')][_0xdd4c('0x42')]+'%'};return _0x2f458f;})});}_0x322d05=_[_0xdd4c('0x44')]({},_0x322d05,_0x28e7dd['options']);return _0x4144f2[_0xdd4c('0x8d')](_0x322d05);}})['then'](function(_0xa90f11){if(_0xa90f11){_0x57a6dd=_0xa90f11[_0xdd4c('0x3d')];if(!_0x28e7dd[_0xdd4c('0x37')][_0xdd4c('0x3e')]('nolimit')){_0x322d05[_0xdd4c('0x21')]=qs[_0xdd4c('0x21')](_0x28e7dd[_0xdd4c('0x37')][_0xdd4c('0x21')]);_0x322d05[_0xdd4c('0x1e')]=qs[_0xdd4c('0x1e')](_0x28e7dd[_0xdd4c('0x37')][_0xdd4c('0x1e')]);}return _0x4144f2['getAgents'](_0x322d05);}})['then'](function(_0x7720e2){if(_0x7720e2){return _0x7720e2?{'count':_0x57a6dd,'rows':_0x7720e2}:null;}})[_0xdd4c('0x27')](respondWithResult(_0x496693,null))[_0xdd4c('0x4a')](handleError(_0x496693,null));}; \ No newline at end of file +var _0x60b3=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','WhatsappQueues','end','error','stack','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','name','filter','options','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','each','findOrCreate','emit','ids','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','omit','spread','userWhatsappQueue:save','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x48d182,_0x21dfe8){var _0x8f0606=function(_0xaa0261){while(--_0xaa0261){_0x48d182['push'](_0x48d182['shift']());}};_0x8f0606(++_0x21dfe8);}(_0x60b3,0x83));var _0x360b=function(_0x5ae350,_0x24edc7){_0x5ae350=_0x5ae350-0x0;var _0x4e3073=_0x60b3[_0x5ae350];return _0x4e3073;};'use strict';var emlformat=require(_0x360b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x360b('0x1'));var jsonpatch=require(_0x360b('0x2'));var rp=require(_0x360b('0x3'));var moment=require('moment');var BPromise=require(_0x360b('0x4'));var Mustache=require(_0x360b('0x5'));var util=require('util');var path=require(_0x360b('0x6'));var sox=require(_0x360b('0x7'));var csv=require(_0x360b('0x8'));var ejs=require(_0x360b('0x9'));var fs=require('fs');var fs_extra=require(_0x360b('0xa'));var _=require(_0x360b('0xb'));var squel=require(_0x360b('0xc'));var crypto=require(_0x360b('0xd'));var jsforce=require(_0x360b('0xe'));var deskjs=require(_0x360b('0xf'));var toCsv=require(_0x360b('0x8'));var querystring=require('querystring');var Papa=require(_0x360b('0x10'));var Redis=require('ioredis');var authService=require(_0x360b('0x11'));var qs=require(_0x360b('0x12'));var as=require(_0x360b('0x13'));var hardwareService=require(_0x360b('0x14'));var logger=require(_0x360b('0x15'))(_0x360b('0x16'));var utils=require(_0x360b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x360b('0x18'));var db=require(_0x360b('0x19'))['db'];config['redis']=_[_0x360b('0x1a')](config['redis'],{'host':_0x360b('0x1b'),'port':0x18eb});var socket=require(_0x360b('0x1c'))(new Redis(config[_0x360b('0x1d')]));require(_0x360b('0x1e'))[_0x360b('0x1f')](socket);function respondWithStatusCode(_0xda42e4,_0x1a524a){_0x1a524a=_0x1a524a||0xcc;return function(_0x481375){if(_0x481375){return _0xda42e4[_0x360b('0x20')](_0x1a524a);}return _0xda42e4[_0x360b('0x21')](_0x1a524a)['end']();};}function respondWithResult(_0x41f63b,_0x551173){_0x551173=_0x551173||0xc8;return function(_0x29fd40){if(_0x29fd40){return _0x41f63b[_0x360b('0x21')](_0x551173)[_0x360b('0x22')](_0x29fd40);}};}function respondWithFilteredResult(_0x1b632d,_0x5022c0){return function(_0xea67b7){if(_0xea67b7){var _0x157a47=typeof _0x5022c0[_0x360b('0x23')]===_0x360b('0x24')&&typeof _0x5022c0['limit']===_0x360b('0x24');var _0x15bbee=_0xea67b7[_0x360b('0x25')];var _0x1e7714=_0x157a47?0x0:_0x5022c0[_0x360b('0x23')];var _0x416d3b=_0x157a47?_0xea67b7[_0x360b('0x25')]:_0x5022c0[_0x360b('0x23')]+_0x5022c0[_0x360b('0x26')];var _0x11ce1d;if(_0x416d3b>=_0x15bbee){_0x416d3b=_0x15bbee;_0x11ce1d=0xc8;}else{_0x11ce1d=0xce;}_0x1b632d[_0x360b('0x21')](_0x11ce1d);return _0x1b632d[_0x360b('0x27')](_0x360b('0x28'),_0x1e7714+'-'+_0x416d3b+'/'+_0x15bbee)['json'](_0xea67b7);}return null;};}function patchUpdates(_0x5035c1){return function(_0x41be5f){try{jsonpatch[_0x360b('0x29')](_0x41be5f,_0x5035c1,!![]);}catch(_0x501c26){return BPromise['reject'](_0x501c26);}return _0x41be5f[_0x360b('0x2a')]();};}function saveUpdates(_0x41c449,_0x4f9d10){return function(_0x23ff4b){if(_0x23ff4b){return _0x23ff4b[_0x360b('0x2b')](_0x41c449)[_0x360b('0x2c')](function(_0x3ef698){return _0x3ef698;});}return null;};}function removeEntity(_0x5a517b,_0x39e7a1){return function(_0x57d4f4){if(_0x57d4f4){return _0x57d4f4[_0x360b('0x2d')]()[_0x360b('0x2c')](function(){var _0x350a94=_0x57d4f4['get']({'plain':!![]});var _0x297336=_0x360b('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x297336,'resourceId':_0x350a94['id']}})['then'](function(){return _0x57d4f4;});})[_0x360b('0x2c')](function(){_0x5a517b[_0x360b('0x21')](0xcc)[_0x360b('0x2f')]();});}};}function handleEntityNotFound(_0x32dd9e,_0x325e88){return function(_0x7e96f1){if(!_0x7e96f1){_0x32dd9e[_0x360b('0x20')](0x194);}return _0x7e96f1;};}function handleError(_0x2408ea,_0x3ba5cf){_0x3ba5cf=_0x3ba5cf||0x1f4;return function(_0x3dbef0){logger[_0x360b('0x30')](_0x3dbef0[_0x360b('0x31')]);if(_0x3dbef0['name']){delete _0x3dbef0['name'];}_0x2408ea[_0x360b('0x21')](_0x3ba5cf)[_0x360b('0x32')](_0x3dbef0);};}exports[_0x360b('0x33')]=function(_0x39c364,_0x4edd1d){var _0x2c96f5={},_0x87fd4d={},_0x305530={'count':0x0,'rows':[]};var _0x2e17c6=_['map'](db[_0x360b('0x34')][_0x360b('0x35')],function(_0x313fe6){return{'name':_0x313fe6[_0x360b('0x36')],'type':_0x313fe6[_0x360b('0x37')][_0x360b('0x38')]};});_0x87fd4d[_0x360b('0x39')]=_[_0x360b('0x3a')](_0x2e17c6,'name');_0x87fd4d[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0x39c364[_0x360b('0x3b')]);_0x87fd4d[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x87fd4d['model'],_0x87fd4d[_0x360b('0x3b')]);_0x2c96f5['attributes']=_[_0x360b('0x3e')](_0x87fd4d[_0x360b('0x39')],qs[_0x360b('0x3f')](_0x39c364[_0x360b('0x3b')][_0x360b('0x3f')]));_0x2c96f5['attributes']=_0x2c96f5[_0x360b('0x40')][_0x360b('0x41')]?_0x2c96f5[_0x360b('0x40')]:_0x87fd4d[_0x360b('0x39')];if(!_0x39c364[_0x360b('0x3b')][_0x360b('0x42')]('nolimit')){_0x2c96f5['limit']=qs[_0x360b('0x26')](_0x39c364[_0x360b('0x3b')][_0x360b('0x26')]);_0x2c96f5[_0x360b('0x23')]=qs[_0x360b('0x23')](_0x39c364['query'][_0x360b('0x23')]);}_0x2c96f5[_0x360b('0x43')]=qs['sort'](_0x39c364[_0x360b('0x3b')][_0x360b('0x44')]);_0x2c96f5[_0x360b('0x45')]=qs[_0x360b('0x3d')](_[_0x360b('0x46')](_0x39c364['query'],_0x87fd4d[_0x360b('0x3d')]),_0x2e17c6);if(_0x39c364[_0x360b('0x3b')]['filter']){_0x2c96f5[_0x360b('0x45')]=_[_0x360b('0x47')](_0x2c96f5[_0x360b('0x45')],{'$or':_[_0x360b('0x3a')](_0x2e17c6,function(_0x3b7dfe){if(_0x3b7dfe[_0x360b('0x37')]!==_0x360b('0x48')){var _0x19e8ce={};_0x19e8ce[_0x3b7dfe[_0x360b('0x49')]]={'$like':'%'+_0x39c364[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x19e8ce;}})});}_0x2c96f5=_[_0x360b('0x47')]({},_0x2c96f5,_0x39c364[_0x360b('0x4b')]);var _0x1bad18={'where':_0x2c96f5[_0x360b('0x45')]};return db[_0x360b('0x34')]['count'](_0x1bad18)[_0x360b('0x2c')](function(_0x46b80e){_0x305530[_0x360b('0x25')]=_0x46b80e;if(_0x39c364[_0x360b('0x3b')]['includeAll']){_0x2c96f5['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x360b('0x4c')](_0x2c96f5);})[_0x360b('0x2c')](function(_0x2d5f88){_0x305530[_0x360b('0x4d')]=_0x2d5f88;return _0x305530;})[_0x360b('0x2c')](respondWithFilteredResult(_0x4edd1d,_0x2c96f5))[_0x360b('0x4e')](handleError(_0x4edd1d,null));};exports[_0x360b('0x4f')]=function(_0x16fff1,_0x1e0697){var _0x5d4fd4={'raw':!![],'where':{'id':_0x16fff1['params']['id']}},_0x2f712f={};_0x2f712f[_0x360b('0x39')]=_[_0x360b('0x3c')](db[_0x360b('0x34')][_0x360b('0x35')]);_0x2f712f[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0x16fff1[_0x360b('0x3b')]);_0x2f712f[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x2f712f[_0x360b('0x39')],_0x2f712f[_0x360b('0x3b')]);_0x5d4fd4['attributes']=_[_0x360b('0x3e')](_0x2f712f['model'],qs[_0x360b('0x3f')](_0x16fff1['query'][_0x360b('0x3f')]));_0x5d4fd4[_0x360b('0x40')]=_0x5d4fd4[_0x360b('0x40')][_0x360b('0x41')]?_0x5d4fd4[_0x360b('0x40')]:_0x2f712f[_0x360b('0x39')];if(_0x16fff1[_0x360b('0x3b')][_0x360b('0x50')]){_0x5d4fd4['include']=[{'all':!![]}];}_0x5d4fd4=_[_0x360b('0x47')]({},_0x5d4fd4,_0x16fff1[_0x360b('0x4b')]);return db[_0x360b('0x34')][_0x360b('0x51')](_0x5d4fd4)['then'](handleEntityNotFound(_0x1e0697,null))[_0x360b('0x2c')](respondWithResult(_0x1e0697,null))['catch'](handleError(_0x1e0697,null));};exports[_0x360b('0x52')]=function(_0x534c7b,_0x53a933){return db['WhatsappQueue'][_0x360b('0x52')](_0x534c7b[_0x360b('0x53')],{})[_0x360b('0x2c')](function(_0x4ca0d5){var _0x9f259b=_0x534c7b[_0x360b('0x54')]['get']({'plain':!![]});if(!_0x9f259b)throw new Error(_0x360b('0x55'));if(_0x9f259b[_0x360b('0x56')]===_0x360b('0x54')){var _0x9effb=_0x4ca0d5[_0x360b('0x57')]({'plain':!![]});var _0x14a0e6=_0x360b('0x2e');return db[_0x360b('0x58')][_0x360b('0x51')]({'where':{'name':_0x14a0e6,'userProfileId':_0x9f259b[_0x360b('0x59')]},'raw':!![]})[_0x360b('0x2c')](function(_0x37d3da){if(_0x37d3da&&_0x37d3da[_0x360b('0x5a')]===0x0){return db['UserProfileResource'][_0x360b('0x52')]({'name':_0x9effb[_0x360b('0x49')],'resourceId':_0x9effb['id'],'type':_0x37d3da[_0x360b('0x49')],'sectionId':_0x37d3da['id']},{})[_0x360b('0x2c')](function(){return _0x4ca0d5;});}else{return _0x4ca0d5;}})[_0x360b('0x4e')](function(_0x4eb15b){logger['error'](_0x360b('0x5b'),_0x4eb15b);throw _0x4eb15b;});}return _0x4ca0d5;})['then'](respondWithResult(_0x53a933,0xc9))['catch'](handleError(_0x53a933,null));};exports[_0x360b('0x2b')]=function(_0x45acab,_0x5f336a){if(_0x45acab['body']['id']){delete _0x45acab[_0x360b('0x53')]['id'];}return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x45acab[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x5f336a,null))[_0x360b('0x2c')](saveUpdates(_0x45acab[_0x360b('0x53')],null))['then'](respondWithResult(_0x5f336a,null))[_0x360b('0x4e')](handleError(_0x5f336a,null));};exports[_0x360b('0x2d')]=function(_0x29dc58,_0x502f9e){return db['WhatsappQueue'][_0x360b('0x51')]({'where':{'id':_0x29dc58[_0x360b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x502f9e,null))[_0x360b('0x2c')](removeEntity(_0x502f9e,null))[_0x360b('0x4e')](handleError(_0x502f9e,null));};exports[_0x360b('0x5d')]=function(_0x5dc908,_0x56f2e7){return db[_0x360b('0x34')][_0x360b('0x5d')]()[_0x360b('0x2c')](respondWithResult(_0x56f2e7,null))['catch'](handleError(_0x56f2e7,null));};exports[_0x360b('0x5e')]=function(_0x5650ef,_0x24394a,_0x514a89){var _0x29f624={'raw':!![],'where':{}},_0x5b8378={},_0xa85f4e;return db[_0x360b('0x34')][_0x360b('0x5f')]({'where':{'id':_0x5650ef[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x24394a,null))['then'](function(_0x5791bf){if(_0x5791bf){_0xa85f4e=_0x5791bf[_0x360b('0x57')]({'plain':!![]});_0x5b8378[_0x360b('0x39')]=_[_0x360b('0x3c')](db[_0x360b('0x60')][_0x360b('0x35')]);_0x5b8378[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0x5650ef['query']);_0x5b8378[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x5b8378[_0x360b('0x39')],_0x5b8378['query']);_0x29f624[_0x360b('0x40')]=_['intersection'](_0x5b8378[_0x360b('0x39')],qs[_0x360b('0x3f')](_0x5650ef[_0x360b('0x3b')][_0x360b('0x3f')]));_0x29f624[_0x360b('0x40')]=_0x29f624['attributes'][_0x360b('0x41')]?_0x29f624[_0x360b('0x40')]:_0x5b8378[_0x360b('0x39')];if(!_0x5650ef[_0x360b('0x3b')]['hasOwnProperty'](_0x360b('0x61'))){_0x29f624['limit']=qs[_0x360b('0x26')](_0x5650ef[_0x360b('0x3b')]['limit']);_0x29f624['offset']=qs[_0x360b('0x23')](_0x5650ef[_0x360b('0x3b')][_0x360b('0x23')]);}_0x29f624[_0x360b('0x43')]=qs['sort'](_0x5650ef[_0x360b('0x3b')][_0x360b('0x44')]);_0x29f624['where']=qs[_0x360b('0x3d')](_['pick'](_0x5650ef[_0x360b('0x3b')],_0x5b8378['filters']));_0x29f624[_0x360b('0x45')][_0x360b('0x62')]=_0x5791bf['id'];if(_0x5650ef[_0x360b('0x3b')]['filter']){_0x29f624['where']=_['merge'](_0x29f624['where'],{'$or':_[_0x360b('0x3a')](_0x29f624[_0x360b('0x40')],function(_0x42e269){var _0x433afa={};_0x433afa[_0x42e269]={'$like':'%'+_0x5650ef[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x433afa;})});}_0x29f624=_[_0x360b('0x47')]({},_0x29f624,_0x5650ef[_0x360b('0x4b')]);return db[_0x360b('0x60')][_0x360b('0x4c')](_0x29f624);}})[_0x360b('0x2c')](function(_0x851ad5){if(_0x851ad5){return db['User'][_0x360b('0x63')]({'where':{'id':_[_0x360b('0x3a')](_0x851ad5,_0x360b('0x64')),'role':_0x360b('0x65')},'attributes':['id',_0x360b('0x49'),_0x360b('0x66'),_0x360b('0x67'),_0x360b('0x68')]});}})[_0x360b('0x2c')](function(_0x522226){if(_0x522226){return{'count':_0x522226[_0x360b('0x25')],'rows':_[_0x360b('0x3a')](_0x522226[_0x360b('0x4d')],function(_0x2959f8){return{'membername':_0x2959f8[_0x360b('0x49')],'UserId':_0x2959f8['id'],'queue_name':_0xa85f4e[_0x360b('0x49')],'WhatsappQueueId':_0xa85f4e['id'],'interface':util[_0x360b('0x69')](_0x360b('0x6a'),_0x360b('0x6b'),_0x2959f8[_0x360b('0x49')]),'penalty':0x0,'paused':_0x2959f8['whatsappPause'],'createdAt':_0x2959f8[_0x360b('0x68')],'updatedAt':_0x2959f8[_0x360b('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x360b('0x2c')](respondWithFilteredResult(_0x24394a,_0x29f624))[_0x360b('0x4e')](handleError(_0x24394a,null));};exports[_0x360b('0x6c')]=function(_0xe0a7bd,_0x2d88e5,_0x39e30b){var _0x4df7bf={};var _0x4d0906={};var _0x3e0c12;var _0x39f07b;return db[_0x360b('0x34')][_0x360b('0x5f')]({'where':{'id':_0xe0a7bd[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x2d88e5,null))['then'](function(_0x33132c){if(_0x33132c){_0x3e0c12=_0x33132c;_0x4d0906[_0x360b('0x39')]=_[_0x360b('0x3c')](db[_0x360b('0x6d')][_0x360b('0x35')]);_0x4d0906[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0xe0a7bd['query']);_0x4d0906[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x4d0906[_0x360b('0x39')],_0x4d0906['query']);_0x4df7bf[_0x360b('0x40')]=_['intersection'](_0x4d0906[_0x360b('0x39')],qs[_0x360b('0x3f')](_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x3f')]));_0x4df7bf[_0x360b('0x40')]=_0x4df7bf[_0x360b('0x40')]['length']?_0x4df7bf[_0x360b('0x40')]:_0x4d0906[_0x360b('0x39')];_0x4df7bf[_0x360b('0x43')]=qs[_0x360b('0x44')](_0xe0a7bd['query'][_0x360b('0x44')]);_0x4df7bf[_0x360b('0x45')]=qs[_0x360b('0x3d')](_['pick'](_0xe0a7bd[_0x360b('0x3b')],_0x4d0906[_0x360b('0x3d')]));if(_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x4a')]){_0x4df7bf[_0x360b('0x45')]=_[_0x360b('0x47')](_0x4df7bf['where'],{'$or':_[_0x360b('0x3a')](_0x4df7bf[_0x360b('0x40')],function(_0x48c51d){var _0x9a676f={};_0x9a676f[_0x48c51d]={'$like':'%'+_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x9a676f;})});}_0x4df7bf=_[_0x360b('0x47')]({},_0x4df7bf,_0xe0a7bd[_0x360b('0x4b')]);return _0x3e0c12[_0x360b('0x6c')](_0x4df7bf);}})[_0x360b('0x2c')](function(_0x35efc5){if(_0x35efc5){_0x39f07b=_0x35efc5[_0x360b('0x41')];if(!_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x42')](_0x360b('0x61'))){_0x4df7bf['limit']=qs[_0x360b('0x26')](_0xe0a7bd['query']['limit']);_0x4df7bf['offset']=qs['offset'](_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x23')]);}return _0x3e0c12[_0x360b('0x6c')](_0x4df7bf);}})[_0x360b('0x2c')](function(_0x2a43d2){if(_0x2a43d2){return _0x2a43d2?{'count':_0x39f07b,'rows':_0x2a43d2}:null;}})[_0x360b('0x2c')](respondWithResult(_0x2d88e5,null))[_0x360b('0x4e')](handleError(_0x2d88e5,null));};exports[_0x360b('0x6e')]=function(_0x3e5b04,_0x43af68,_0x51a02b){var _0x35bc1a=_0x3e5b04['body']['ids'];return db[_0x360b('0x6d')][_0x360b('0x4c')]({'where':{'id':_0x35bc1a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x360b('0x6f'),'attributes':['id',_0x360b('0x49'),_0x360b('0x70'),'voicePause','interface'],'raw':!![]}]})[_0x360b('0x2c')](function(_0x547550){if(_0x547550){var _0x24ea2e=_[_0x360b('0x71')](_0x547550,function(_0x671c8c){var _0xa3cdef=_0x671c8c['get']({'plain':!![]});return _0xa3cdef['Agents'];});return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x3e5b04['params']['id']}})[_0x360b('0x2c')](function(_0x3e9516){return db[_0x360b('0x72')]['transaction'](function(_0x1ab3a6){return _0x3e9516['addTeams'](_0x35bc1a,{'transaction':_0x1ab3a6})['then'](function(){return BPromise[_0x360b('0x73')](_0x24ea2e,function(_0x240793){return db[_0x360b('0x60')][_0x360b('0x74')]({'where':{'UserId':_0x240793['id'],'WhatsappQueueId':_0x3e5b04[_0x360b('0x5c')]['id']},'transaction':_0x1ab3a6});});})[_0x360b('0x2c')](function(){_0x24ea2e['forEach'](function(_0x15995d){socket[_0x360b('0x75')]('userWhatsappQueue:save',{'UserId':_0x15995d['id'],'WhatsappQueueId':_0x3e9516['id']});});});});});}})[_0x360b('0x2c')](respondWithStatusCode(_0x43af68,null))[_0x360b('0x4e')](handleError(_0x43af68,null));};exports['removeTeams']=function(_0x373bd2,_0x351726,_0x52bf1c){return db[_0x360b('0x6d')][_0x360b('0x4c')]({'where':{'id':_0x373bd2[_0x360b('0x3b')][_0x360b('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x360b('0x2c')](handleEntityNotFound(_0x351726,null))[_0x360b('0x2c')](function(_0x1bfbf5){var _0x774039=_[_0x360b('0x3a')](_0x1bfbf5,'id');var _0x443edd=[];var _0x10a680=[];var _0x112fab=squel[_0x360b('0x77')]();_0x112fab[_0x360b('0x78')]('tq.TeamId')['from'](_0x360b('0x79'),'tq')[_0x360b('0x7a')](_0x360b('0x7b'),'ut',_0x360b('0x7c'))['where'](_0x360b('0x7d'),_0x373bd2[_0x360b('0x5c')]['id']);for(var _0x19155b=0x0;_0x19155b<_0x1bfbf5['length'];_0x19155b+=0x1){let _0x58b416=_0x1bfbf5[_0x19155b];for(var _0x18f948=0x0;_0x18f948<_0x58b416[_0x360b('0x6f')]['length'];_0x18f948+=0x1){let _0x5e5da8=_0x58b416[_0x360b('0x6f')][_0x18f948];var _0x24c650=_0x112fab['clone']();_0x24c650[_0x360b('0x45')](_0x360b('0x7e'),_0x5e5da8['id']);_0x10a680[_0x360b('0x7f')](db['sequelize'][_0x360b('0x3b')](_0x24c650[_0x360b('0x80')](),{'type':db['sequelize'][_0x360b('0x81')][_0x360b('0x82')]})['then'](function(_0x3dd127){if(_0x3dd127[_0x360b('0x41')]===0x1){return _0x5e5da8['id'];}else{var _0x1bd0bf=_['every'](_[_0x360b('0x3a')](_0x3dd127,_0x360b('0x83')),function(_0x44d723){return _[_0x360b('0x84')](_0x774039,_0x44d723);});if(_0x1bd0bf){return _0x5e5da8['id'];}}}));}}return BPromise[_0x360b('0x85')](_0x10a680)[_0x360b('0x2c')](function(_0x2ae36a){_0x443edd=_(_0x443edd)[_0x360b('0x86')](_0x2ae36a)['compact']()[_0x360b('0x87')]();return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x373bd2[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](function(_0x10aeb4){return db['sequelize'][_0x360b('0x88')](function(_0x1d2b10){return _0x10aeb4[_0x360b('0x89')](_0x373bd2[_0x360b('0x3b')][_0x360b('0x76')],{'transaction':_0x1d2b10})[_0x360b('0x2c')](function(){if(!_[_0x360b('0x8a')](_0x443edd)){return _0x10aeb4[_0x360b('0x8b')](_0x443edd,{'transaction':_0x1d2b10});}})[_0x360b('0x2c')](function(){_0x443edd[_0x360b('0x8c')](function(_0x46fdfa){socket[_0x360b('0x75')](_0x360b('0x8d'),{'UserId':_0x46fdfa,'WhatsappQueueId':_0x10aeb4['id']});});});});});});})[_0x360b('0x2c')](respondWithStatusCode(_0x351726,null))[_0x360b('0x4e')](handleError(_0x351726,null));};exports['addAgents']=function(_0x2f0bfd,_0x1b00bb,_0x34349b){return db['WhatsappQueue'][_0x360b('0x51')]({'where':{'id':_0x2f0bfd['params']['id']}})['then'](handleEntityNotFound(_0x1b00bb,null))[_0x360b('0x2c')](function(_0x412d2a){if(_0x412d2a){return _0x412d2a['addAgents'](_0x2f0bfd['body'][_0x360b('0x76')],_[_0x360b('0x8e')](_0x2f0bfd['body'],['ids','id'])||{})[_0x360b('0x8f')](function(_0x3b0438){for(var _0xca1522=0x0;_0xca1522<_0x2f0bfd[_0x360b('0x53')][_0x360b('0x76')][_0x360b('0x41')];_0xca1522+=0x1){socket[_0x360b('0x75')](_0x360b('0x90'),{'UserId':Number(_0x2f0bfd[_0x360b('0x53')]['ids'][_0xca1522]),'WhatsappQueueId':Number(_0x2f0bfd['params']['id'])});}return _0x3b0438;});}})[_0x360b('0x2c')](respondWithResult(_0x1b00bb,null))[_0x360b('0x4e')](handleError(_0x1b00bb,null));};exports['removeAgents']=function(_0x6a393c,_0x3111d6,_0x573eb3){return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x6a393c[_0x360b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3111d6,null))['then'](function(_0x1724a3){if(_0x1724a3){return _0x1724a3[_0x360b('0x8b')](_0x6a393c['query'][_0x360b('0x76')])[_0x360b('0x2c')](function(){if(_['isArray'](_0x6a393c[_0x360b('0x3b')][_0x360b('0x76')])){for(var _0x22ceac=0x0;_0x22ceac<_0x6a393c[_0x360b('0x3b')][_0x360b('0x76')][_0x360b('0x41')];_0x22ceac+=0x1){socket[_0x360b('0x75')](_0x360b('0x8d'),{'UserId':Number(_0x6a393c[_0x360b('0x3b')]['ids'][_0x22ceac]),'WhatsappQueueId':Number(_0x6a393c['params']['id'])});}}else{socket[_0x360b('0x75')](_0x360b('0x8d'),{'UserId':Number(_0x6a393c['query'][_0x360b('0x76')]),'WhatsappQueueId':Number(_0x6a393c[_0x360b('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x3111d6,null))[_0x360b('0x4e')](handleError(_0x3111d6,null));};exports[_0x360b('0x91')]=function(_0xf99b68,_0x20797b,_0x1438e1){var _0x151e9f={};var _0x4a99bc={};var _0x4cb5b4;var _0x524c7a;return db[_0x360b('0x34')][_0x360b('0x5f')]({'where':{'id':_0xf99b68['params']['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x20797b,null))[_0x360b('0x2c')](function(_0x45021c){if(_0x45021c){_0x4cb5b4=_0x45021c;_0x4a99bc['model']=_[_0x360b('0x3c')](db[_0x360b('0x92')][_0x360b('0x35')]);_0x4a99bc[_0x360b('0x3b')]=_['keys'](_0xf99b68[_0x360b('0x3b')]);_0x4a99bc[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x4a99bc[_0x360b('0x39')],_0x4a99bc['query']);_0x151e9f[_0x360b('0x40')]=_[_0x360b('0x3e')](_0x4a99bc[_0x360b('0x39')],qs[_0x360b('0x3f')](_0xf99b68[_0x360b('0x3b')][_0x360b('0x3f')]));_0x151e9f['attributes']=_0x151e9f[_0x360b('0x40')][_0x360b('0x41')]?_0x151e9f['attributes']:_0x4a99bc[_0x360b('0x39')];_0x151e9f['order']=qs[_0x360b('0x44')](_0xf99b68['query'][_0x360b('0x44')]);_0x151e9f[_0x360b('0x45')]=qs[_0x360b('0x3d')](_[_0x360b('0x46')](_0xf99b68[_0x360b('0x3b')],_0x4a99bc[_0x360b('0x3d')]));if(_0xf99b68['query']['filter']){_0x151e9f[_0x360b('0x45')]=_[_0x360b('0x47')](_0x151e9f[_0x360b('0x45')],{'$or':_['map'](_0x151e9f['attributes'],function(_0x12baf1){var _0x2d449c={};_0x2d449c[_0x12baf1]={'$like':'%'+_0xf99b68[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x2d449c;})});}_0x151e9f=_[_0x360b('0x47')]({},_0x151e9f,_0xf99b68['options']);return _0x4cb5b4[_0x360b('0x91')](_0x151e9f);}})[_0x360b('0x2c')](function(_0x225b75){if(_0x225b75){_0x524c7a=_0x225b75[_0x360b('0x41')];if(!_0xf99b68[_0x360b('0x3b')][_0x360b('0x42')](_0x360b('0x61'))){_0x151e9f[_0x360b('0x26')]=qs[_0x360b('0x26')](_0xf99b68[_0x360b('0x3b')]['limit']);_0x151e9f[_0x360b('0x23')]=qs[_0x360b('0x23')](_0xf99b68[_0x360b('0x3b')]['offset']);}return _0x4cb5b4[_0x360b('0x91')](_0x151e9f);}})['then'](function(_0xf2129){if(_0xf2129){return _0xf2129?{'count':_0x524c7a,'rows':_0xf2129}:null;}})[_0x360b('0x2c')](respondWithResult(_0x20797b,null))[_0x360b('0x4e')](handleError(_0x20797b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 48f4db3..4e4b733 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3f8=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x42f00b,_0x408fbd){var _0x1f46bb=function(_0x4fc4d5){while(--_0x4fc4d5){_0x42f00b['push'](_0x42f00b['shift']());}};_0x1f46bb(++_0x408fbd);}(_0xf3f8,0x98));var _0x8f3f=function(_0x3d3b37,_0xf38e25){_0x3d3b37=_0x3d3b37-0x0;var _0x2dd66a=_0xf3f8[_0x3d3b37];return _0x2dd66a;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x8f3f('0x0'))['db'][_0x8f3f('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8f3f('0x2')](0x0);var events={'afterCreate':_0x8f3f('0x3'),'afterUpdate':_0x8f3f('0x4'),'afterDestroy':_0x8f3f('0x5')};function emitEvent(_0x1da986){return function(_0x1eaee7,_0x34a524,_0x5b3876){WhatsappQueueEvents['emit'](_0x1da986+':'+_0x1eaee7['id'],_0x1eaee7);WhatsappQueueEvents['emit'](_0x1da986,_0x1eaee7);_0x5b3876(null);};}for(var e in events){if(events[_0x8f3f('0x6')](e)){var event=events[e];WhatsappQueue[_0x8f3f('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xf8c0=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3a6880,_0x4946dc){var _0x3ce6c9=function(_0x5e3589){while(--_0x5e3589){_0x3a6880['push'](_0x3a6880['shift']());}};_0x3ce6c9(++_0x4946dc);}(_0xf8c0,0xa4));var _0x0f8c=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xf8c0[_0x1e03a6];return _0x295b64;};'use strict';var EventEmitter=require(_0x0f8c('0x0'));var WhatsappQueue=require(_0x0f8c('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0f8c('0x2')](0x0);var events={'afterCreate':_0x0f8c('0x3'),'afterUpdate':'update','afterDestroy':_0x0f8c('0x4')};function emitEvent(_0x25c480){return function(_0x1b7e0c,_0x36af2a,_0x1b2bfe){WhatsappQueueEvents[_0x0f8c('0x5')](_0x25c480+':'+_0x1b7e0c['id'],_0x1b7e0c);WhatsappQueueEvents[_0x0f8c('0x5')](_0x25c480,_0x1b7e0c);_0x1b2bfe(null);};}for(var e in events){if(events[_0x0f8c('0x6')](e)){var event=events[e];WhatsappQueue[_0x0f8c('0x7')](e,emitEvent(event));}}module[_0x0f8c('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index bfc398b..f5a5bca 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b6a=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x3b6a,0x170));var _0xa3b6=function(_0x4e37bc,_0x8174e7){_0x4e37bc=_0x4e37bc-0x0;var _0x48a8b7=_0x3b6a[_0x4e37bc];return _0x48a8b7;};'use strict';var _=require(_0xa3b6('0x0'));var util=require(_0xa3b6('0x1'));var logger=require(_0xa3b6('0x2'))(_0xa3b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa3b6('0x4'));var fs=require('fs');var path=require(_0xa3b6('0x5'));var rimraf=require(_0xa3b6('0x6'));var config=require(_0xa3b6('0x7'));var attributes=require(_0xa3b6('0x8'));module[_0xa3b6('0x9')]=function(_0x2ad71d,_0xa415a6){return _0x2ad71d[_0xa3b6('0xa')](_0xa3b6('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1562=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x1562,0xc3));var _0x2156=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x1562[_0x32b122];return _0x4ad25a;};'use strict';var _=require(_0x2156('0x0'));var util=require(_0x2156('0x1'));var logger=require('../../config/logger')(_0x2156('0x2'));var moment=require(_0x2156('0x3'));var BPromise=require(_0x2156('0x4'));var rp=require(_0x2156('0x5'));var fs=require('fs');var path=require(_0x2156('0x6'));var rimraf=require(_0x2156('0x7'));var config=require(_0x2156('0x8'));var attributes=require(_0x2156('0x9'));module[_0x2156('0xa')]=function(_0x5cce6e,_0x2d4cf6){return _0x5cce6e[_0x2156('0xb')]('WhatsappQueue',attributes,{'tableName':_0x2156('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 600d5d4..bb5aa3a 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8e=['../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','WhatsappQueue,\x20%s,\x20%s','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','catch','ShowWhatsappQueue','moment','bluebird','ioredis','../../mysqldb'];(function(_0x45e0a1,_0x13f2be){var _0xaa2b1c=function(_0x12c0d2){while(--_0x12c0d2){_0x45e0a1['push'](_0x45e0a1['shift']());}};_0xaa2b1c(++_0x13f2be);}(_0xad8e,0x11c));var _0xead8=function(_0x46d44d,_0x12dff9){_0x46d44d=_0x46d44d-0x0;var _0x34c937=_0xad8e[_0x46d44d];return _0x34c937;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xead8('0x0'));var BPromise=require(_0xead8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xead8('0x2'));var db=require(_0xead8('0x3'))['db'];var utils=require(_0xead8('0x4'));var logger=require('../../config/logger')(_0xead8('0x5'));var config=require(_0xead8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xead8('0x7')]['http']({'port':0x232a});config[_0xead8('0x8')]=_['defaults'](config[_0xead8('0x8')],{'host':_0xead8('0x9'),'port':0x18eb});var socket=require(_0xead8('0xa'))(new Redis(config[_0xead8('0x8')]));require(_0xead8('0xb'))['register'](socket);function respondWithRpcPromise(_0x3a0115,_0x578f72,_0x4d8923){return new BPromise(function(_0xa89bd7,_0x18af98){return client[_0xead8('0xc')](_0x3a0115,_0x4d8923)['then'](function(_0x16be4a){logger[_0xead8('0xd')]('WhatsappQueue,\x20%s,\x20%s',_0x578f72,_0xead8('0xe'));logger[_0xead8('0xf')](_0xead8('0x10'),_0x578f72,'request\x20sent',JSON['stringify'](_0x16be4a));if(_0x16be4a[_0xead8('0x11')]){if(_0x16be4a['error']['code']===0x1f4){logger[_0xead8('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x578f72,_0x16be4a[_0xead8('0x11')][_0xead8('0x12')]);return _0x18af98(_0x16be4a[_0xead8('0x11')][_0xead8('0x12')]);}logger[_0xead8('0x11')](_0xead8('0x13'),_0x578f72,_0x16be4a['error']['message']);return _0xa89bd7(_0x16be4a[_0xead8('0x11')][_0xead8('0x12')]);}else{logger[_0xead8('0xd')](_0xead8('0x13'),_0x578f72,_0xead8('0xe'));_0xa89bd7(_0x16be4a[_0xead8('0x14')][_0xead8('0x12')]);}})['catch'](function(_0x1522bb){logger['error'](_0xead8('0x13'),_0x578f72,_0x1522bb);_0x18af98(_0x1522bb);});});}exports[_0xead8('0x15')]=function(_0xe70b4d){var _0x53ebc3=this;return new Promise(function(_0x255ac5,_0xfd3c6d){return db[_0xead8('0x16')][_0xead8('0x17')]({'raw':_0xe70b4d[_0xead8('0x18')]?_0xe70b4d[_0xead8('0x18')][_0xead8('0x19')]===undefined?!![]:![]:!![],'where':_0xe70b4d[_0xead8('0x18')]?_0xe70b4d['options'][_0xead8('0x1a')]||null:null,'attributes':_0xe70b4d['options']?_0xe70b4d['options']['attributes']||null:null,'limit':_0xe70b4d[_0xead8('0x18')]?_0xe70b4d[_0xead8('0x18')][_0xead8('0x1b')]||null:null,'include':_0xe70b4d['options']?_0xe70b4d[_0xead8('0x18')][_0xead8('0x1c')]?_[_0xead8('0x1d')](_0xe70b4d[_0xead8('0x18')][_0xead8('0x1c')],function(_0x4f6d9c){return{'model':db[_0x4f6d9c[_0xead8('0x1e')]],'as':_0x4f6d9c['as'],'attributes':_0x4f6d9c[_0xead8('0x1f')],'include':_0x4f6d9c[_0xead8('0x1c')]?_[_0xead8('0x1d')](_0x4f6d9c[_0xead8('0x1c')],function(_0xec0126){return{'model':db[_0xec0126[_0xead8('0x1e')]],'as':_0xec0126['as'],'attributes':_0xec0126['attributes'],'include':_0xec0126['include']?_[_0xead8('0x1d')](_0xec0126['include'],function(_0x379962){return{'model':db[_0x379962['model']],'as':_0x379962['as'],'attributes':_0x379962[_0xead8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xead8('0x20')](function(_0x2f3368){logger[_0xead8('0xd')](_0xead8('0x15'),_0xe70b4d);logger[_0xead8('0xf')](_0xead8('0x15'),_0xe70b4d,JSON[_0xead8('0x21')](_0x2f3368));_0x255ac5(_0x2f3368);})[_0xead8('0x22')](function(_0x5523c5){logger[_0xead8('0x11')](_0xead8('0x15'),_0x5523c5[_0xead8('0x12')],_0xe70b4d);_0xfd3c6d(_0x53ebc3[_0xead8('0x11')](0x1f4,_0x5523c5['message']));});});};exports[_0xead8('0x23')]=function(_0x7f34cd){var _0x33ddc6=this;return new Promise(function(_0x4862cf,_0x3771df){return db[_0xead8('0x16')]['find']({'raw':_0x7f34cd[_0xead8('0x18')]?_0x7f34cd['options'][_0xead8('0x19')]===undefined?!![]:![]:!![],'where':_0x7f34cd[_0xead8('0x18')]?_0x7f34cd[_0xead8('0x18')][_0xead8('0x1a')]||null:null,'attributes':_0x7f34cd[_0xead8('0x18')]?_0x7f34cd[_0xead8('0x18')][_0xead8('0x1f')]||null:null,'include':_0x7f34cd['options']?_0x7f34cd[_0xead8('0x18')]['include']?_['map'](_0x7f34cd[_0xead8('0x18')][_0xead8('0x1c')],function(_0x2bfa43){return{'model':db[_0x2bfa43['model']],'as':_0x2bfa43['as'],'attributes':_0x2bfa43[_0xead8('0x1f')],'include':_0x2bfa43['include']?_[_0xead8('0x1d')](_0x2bfa43['include'],function(_0xd65378){return{'model':db[_0xd65378[_0xead8('0x1e')]],'as':_0xd65378['as'],'attributes':_0xd65378[_0xead8('0x1f')],'include':_0xd65378['include']?_[_0xead8('0x1d')](_0xd65378[_0xead8('0x1c')],function(_0x50a569){return{'model':db[_0x50a569[_0xead8('0x1e')]],'as':_0x50a569['as'],'attributes':_0x50a569[_0xead8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xead8('0x20')](function(_0x33e054){logger[_0xead8('0xd')](_0xead8('0x23'),_0x7f34cd);logger[_0xead8('0xf')]('ShowWhatsappQueue',_0x7f34cd,JSON[_0xead8('0x21')](_0x33e054));_0x4862cf(_0x33e054);})[_0xead8('0x22')](function(_0x39ddf3){logger[_0xead8('0x11')](_0xead8('0x23'),_0x39ddf3[_0xead8('0x12')],_0x7f34cd);_0x3771df(_0x33ddc6[_0xead8('0x11')](0x1f4,_0x39ddf3[_0xead8('0x12')]));});});}; \ No newline at end of file +var _0x9416=['ShowWhatsappQueue','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','model','map','catch'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9416,0x173));var _0x6941=function(_0x5d604f,_0x264306){_0x5d604f=_0x5d604f-0x0;var _0x9857d0=_0x9416[_0x5d604f];return _0x9857d0;};'use strict';var _=require(_0x6941('0x0'));var util=require(_0x6941('0x1'));var moment=require('moment');var BPromise=require(_0x6941('0x2'));var rs=require(_0x6941('0x3'));var fs=require('fs');var Redis=require(_0x6941('0x4'));var db=require(_0x6941('0x5'))['db'];var utils=require(_0x6941('0x6'));var logger=require(_0x6941('0x7'))(_0x6941('0x8'));var config=require(_0x6941('0x9'));var jayson=require(_0x6941('0xa'));var client=jayson['client'][_0x6941('0xb')]({'port':0x232a});config[_0x6941('0xc')]=_[_0x6941('0xd')](config[_0x6941('0xc')],{'host':_0x6941('0xe'),'port':0x18eb});var socket=require(_0x6941('0xf'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x6941('0x10')](socket);function respondWithRpcPromise(_0x39a14b,_0x4730e0,_0x465731){return new BPromise(function(_0x5d90ba,_0x45a37a){return client[_0x6941('0x11')](_0x39a14b,_0x465731)[_0x6941('0x12')](function(_0x59501e){logger[_0x6941('0x13')](_0x6941('0x14'),_0x4730e0,_0x6941('0x15'));logger[_0x6941('0x16')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4730e0,_0x6941('0x15'),JSON[_0x6941('0x17')](_0x59501e));if(_0x59501e['error']){if(_0x59501e[_0x6941('0x18')][_0x6941('0x19')]===0x1f4){logger[_0x6941('0x18')](_0x6941('0x14'),_0x4730e0,_0x59501e[_0x6941('0x18')][_0x6941('0x1a')]);return _0x45a37a(_0x59501e[_0x6941('0x18')][_0x6941('0x1a')]);}logger[_0x6941('0x18')](_0x6941('0x14'),_0x4730e0,_0x59501e[_0x6941('0x18')][_0x6941('0x1a')]);return _0x5d90ba(_0x59501e['error'][_0x6941('0x1a')]);}else{logger['info'](_0x6941('0x14'),_0x4730e0,'request\x20sent');_0x5d90ba(_0x59501e[_0x6941('0x1b')][_0x6941('0x1a')]);}})['catch'](function(_0x1ef463){logger[_0x6941('0x18')](_0x6941('0x14'),_0x4730e0,_0x1ef463);_0x45a37a(_0x1ef463);});});}exports[_0x6941('0x1c')]=function(_0x42cf1a){var _0x5ac53a=this;return new Promise(function(_0x14ea6d,_0x66034d){return db[_0x6941('0x1d')][_0x6941('0x1e')]({'raw':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a[_0x6941('0x1f')][_0x6941('0x20')]===undefined?!![]:![]:!![],'where':_0x42cf1a['options']?_0x42cf1a[_0x6941('0x1f')]['where']||null:null,'attributes':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a['options'][_0x6941('0x21')]||null:null,'limit':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a[_0x6941('0x1f')][_0x6941('0x22')]||null:null,'include':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a[_0x6941('0x1f')][_0x6941('0x23')]?_['map'](_0x42cf1a['options'][_0x6941('0x23')],function(_0x5b32d9){return{'model':db[_0x5b32d9[_0x6941('0x24')]],'as':_0x5b32d9['as'],'attributes':_0x5b32d9['attributes'],'include':_0x5b32d9['include']?_[_0x6941('0x25')](_0x5b32d9[_0x6941('0x23')],function(_0x529370){return{'model':db[_0x529370[_0x6941('0x24')]],'as':_0x529370['as'],'attributes':_0x529370[_0x6941('0x21')],'include':_0x529370[_0x6941('0x23')]?_[_0x6941('0x25')](_0x529370[_0x6941('0x23')],function(_0x1b7914){return{'model':db[_0x1b7914[_0x6941('0x24')]],'as':_0x1b7914['as'],'attributes':_0x1b7914[_0x6941('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6941('0x12')](function(_0x356510){logger[_0x6941('0x13')](_0x6941('0x1c'),_0x42cf1a);logger['debug'](_0x6941('0x1c'),_0x42cf1a,JSON[_0x6941('0x17')](_0x356510));_0x14ea6d(_0x356510);})[_0x6941('0x26')](function(_0x59a63f){logger['error'](_0x6941('0x1c'),_0x59a63f[_0x6941('0x1a')],_0x42cf1a);_0x66034d(_0x5ac53a[_0x6941('0x18')](0x1f4,_0x59a63f[_0x6941('0x1a')]));});});};exports[_0x6941('0x27')]=function(_0x28cf01){var _0x24afc6=this;return new Promise(function(_0x58e84b,_0x3b0de5){return db[_0x6941('0x1d')]['find']({'raw':_0x28cf01[_0x6941('0x1f')]?_0x28cf01[_0x6941('0x1f')][_0x6941('0x20')]===undefined?!![]:![]:!![],'where':_0x28cf01[_0x6941('0x1f')]?_0x28cf01[_0x6941('0x1f')][_0x6941('0x28')]||null:null,'attributes':_0x28cf01['options']?_0x28cf01[_0x6941('0x1f')][_0x6941('0x21')]||null:null,'include':_0x28cf01[_0x6941('0x1f')]?_0x28cf01[_0x6941('0x1f')][_0x6941('0x23')]?_['map'](_0x28cf01[_0x6941('0x1f')]['include'],function(_0x2e2b5a){return{'model':db[_0x2e2b5a['model']],'as':_0x2e2b5a['as'],'attributes':_0x2e2b5a[_0x6941('0x21')],'include':_0x2e2b5a[_0x6941('0x23')]?_[_0x6941('0x25')](_0x2e2b5a[_0x6941('0x23')],function(_0x145f83){return{'model':db[_0x145f83['model']],'as':_0x145f83['as'],'attributes':_0x145f83[_0x6941('0x21')],'include':_0x145f83[_0x6941('0x23')]?_[_0x6941('0x25')](_0x145f83[_0x6941('0x23')],function(_0x2b1467){return{'model':db[_0x2b1467[_0x6941('0x24')]],'as':_0x2b1467['as'],'attributes':_0x2b1467[_0x6941('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6941('0x12')](function(_0x4cbb75){logger[_0x6941('0x13')]('ShowWhatsappQueue',_0x28cf01);logger[_0x6941('0x16')](_0x6941('0x27'),_0x28cf01,JSON[_0x6941('0x17')](_0x4cbb75));_0x58e84b(_0x4cbb75);})[_0x6941('0x26')](function(_0x5c28cc){logger[_0x6941('0x18')](_0x6941('0x27'),_0x5c28cc[_0x6941('0x1a')],_0x28cf01);_0x3b0de5(_0x24afc6[_0x6941('0x18')](0x1f4,_0x5c28cc[_0x6941('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9187ec2..c9f38c4 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc528=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x2bb649,_0x48f399){var _0x33652c=function(_0x4b233c){while(--_0x4b233c){_0x2bb649['push'](_0x2bb649['shift']());}};_0x33652c(++_0x48f399);}(_0xc528,0x102));var _0x8c52=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc528[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappQueueEvents=require(_0x8c52('0x0'));var events=[_0x8c52('0x1'),_0x8c52('0x2'),_0x8c52('0x3')];function createListener(_0x3bb875,_0xd9aa95){return function(_0xc050ab){_0xd9aa95[_0x8c52('0x4')](_0x3bb875,_0xc050ab);};}function removeListener(_0x172992,_0xfda74c){return function(){WhatsappQueueEvents[_0x8c52('0x5')](_0x172992,_0xfda74c);};}exports[_0x8c52('0x6')]=function(_0x40bd79){for(var _0x1ccb77=0x0,_0x5637de=events[_0x8c52('0x7')];_0x1ccb77<_0x5637de;_0x1ccb77++){var _0x52bfc9=events[_0x1ccb77];var _0x26f3a7=createListener(_0x8c52('0x8')+_0x52bfc9,_0x40bd79);WhatsappQueueEvents['on'](_0x52bfc9,_0x26f3a7);}}; \ No newline at end of file +var _0x3028=['save','emit','removeListener','register'];(function(_0x384f18,_0x4aab2c){var _0x4ac0a7=function(_0x32ffb9){while(--_0x32ffb9){_0x384f18['push'](_0x384f18['shift']());}};_0x4ac0a7(++_0x4aab2c);}(_0x3028,0x128));var _0x8302=function(_0x275ccf,_0x459d2a){_0x275ccf=_0x275ccf-0x0;var _0x3146c5=_0x3028[_0x275ccf];return _0x3146c5;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x8302('0x0'),'remove','update'];function createListener(_0x1aa0a2,_0x3aa369){return function(_0x3d2732){_0x3aa369[_0x8302('0x1')](_0x1aa0a2,_0x3d2732);};}function removeListener(_0x40de28,_0x548990){return function(){WhatsappQueueEvents[_0x8302('0x2')](_0x40de28,_0x548990);};}exports[_0x8302('0x3')]=function(_0x1c21ab){for(var _0x99b61=0x0,_0x14f2fe=events['length'];_0x99b61<_0x14f2fe;_0x99b61++){var _0x491679=events[_0x99b61];var _0x5608d6=createListener('whatsappQueue:'+_0x491679,_0x1c21ab);WhatsappQueueEvents['on'](_0x491679,_0x5608d6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ca792df..3eb739e 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c70=['delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','update'];(function(_0x400a3b,_0x5a5189){var _0x53426b=function(_0x113d6d){while(--_0x113d6d){_0x400a3b['push'](_0x400a3b['shift']());}};_0x53426b(++_0x5a5189);}(_0x3c70,0x81));var _0x03c7=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x3c70[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require('multer');var util=require(_0x03c7('0x0'));var path=require('path');var timeout=require(_0x03c7('0x1'));var express=require(_0x03c7('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x03c7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x03c7('0x4'));var controller=require(_0x03c7('0x5'));router['get']('/',auth[_0x03c7('0x6')](),controller[_0x03c7('0x7')]);router[_0x03c7('0x8')](_0x03c7('0x9'),auth[_0x03c7('0x6')](),controller['describe']);router[_0x03c7('0x8')](_0x03c7('0xa'),auth[_0x03c7('0x6')](),controller[_0x03c7('0xb')]);router[_0x03c7('0xc')]('/',auth['isAuthenticated'](),controller[_0x03c7('0xd')]);router['put']('/:id',auth[_0x03c7('0x6')](),controller[_0x03c7('0xe')]);router[_0x03c7('0xf')](_0x03c7('0xa'),auth[_0x03c7('0x6')](),controller[_0x03c7('0x10')]);module[_0x03c7('0x11')]=router; \ No newline at end of file +var _0x758a=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','describe','get','/:id','create','put','update','destroy'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x758a,0x121));var _0xa758=function(_0x5f1cd0,_0x1c32d4){_0x5f1cd0=_0x5f1cd0-0x0;var _0x577cb2=_0x758a[_0x5f1cd0];return _0x577cb2;};'use strict';var multer=require(_0xa758('0x0'));var util=require(_0xa758('0x1'));var path=require(_0xa758('0x2'));var timeout=require(_0xa758('0x3'));var express=require(_0xa758('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa758('0x5'));var config=require(_0xa758('0x6'));var controller=require(_0xa758('0x7'));router['get']('/',auth[_0xa758('0x8')](),controller[_0xa758('0x9')]);router['get']('/describe',auth[_0xa758('0x8')](),controller[_0xa758('0xa')]);router[_0xa758('0xb')](_0xa758('0xc'),auth[_0xa758('0x8')](),controller['show']);router['post']('/',auth[_0xa758('0x8')](),controller[_0xa758('0xd')]);router[_0xa758('0xe')](_0xa758('0xc'),auth[_0xa758('0x8')](),controller[_0xa758('0xf')]);router['delete'](_0xa758('0xc'),auth[_0xa758('0x8')](),controller[_0xa758('0x10')]);module[_0xa758('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 71e02f1..84b1fd7 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5528b4,_0x287637){var _0x44a8df=function(_0xefeb49){while(--_0xefeb49){_0x5528b4['push'](_0x5528b4['shift']());}};_0x44a8df(++_0x287637);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x27f967,_0x44dfdd){var _0x251f7c=function(_0x420e59){while(--_0x420e59){_0x27f967['push'](_0x27f967['shift']());}};_0x251f7c(++_0x44dfdd);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 6c78f94..87f8e1e 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0565=['length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x16fdeb,_0x46d28e){var _0x1ea06f=function(_0x5b86d8){while(--_0x5b86d8){_0x16fdeb['push'](_0x16fdeb['shift']());}};_0x1ea06f(++_0x46d28e);}(_0x0565,0xf2));var _0x5056=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x0565[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267048,_0x25409f){return function(_0x5d1656){if(!_0x5d1656){_0x267048[_0x5056('0x25')](0x194);}return _0x5d1656;};}function handleError(_0x505ccf,_0x15f03f){_0x15f03f=_0x15f03f||0x1f4;return function(_0x39d539){logger[_0x5056('0x26')](_0x39d539[_0x5056('0x27')]);if(_0x39d539[_0x5056('0x28')]){delete _0x39d539['name'];}_0x505ccf[_0x5056('0x19')](_0x15f03f)[_0x5056('0x29')](_0x39d539);};}exports[_0x5056('0x2a')]=function(_0x2ac79a,_0x53e6db){var _0x24d33e={},_0x5b0270={},_0x70246c={'count':0x0,'rows':[]};var _0x49fe67=_['map'](db['WhatsappQueueReport'][_0x5056('0x2b')],function(_0x252f75){return{'name':_0x252f75['fieldName'],'type':_0x252f75[_0x5056('0x2c')][_0x5056('0x2d')]};});_0x5b0270[_0x5056('0x2e')]=_[_0x5056('0x2f')](_0x49fe67,_0x5056('0x28'));_0x5b0270[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2ac79a[_0x5056('0x30')]);_0x5b0270[_0x5056('0x32')]=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],_0x5b0270['query']);_0x24d33e['attributes']=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],qs['fields'](_0x2ac79a[_0x5056('0x30')][_0x5056('0x34')]));_0x24d33e['attributes']=_0x24d33e[_0x5056('0x35')][_0x5056('0x36')]?_0x24d33e[_0x5056('0x35')]:_0x5b0270[_0x5056('0x2e')];if(!_0x2ac79a[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x24d33e[_0x5056('0x1d')]=qs[_0x5056('0x1d')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1d')]);_0x24d33e[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1c')]);}_0x24d33e['order']=qs[_0x5056('0x39')](_0x2ac79a['query'][_0x5056('0x39')]);_0x24d33e[_0x5056('0x3a')]=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x2ac79a['query'],_0x5b0270[_0x5056('0x32')]),_0x49fe67);if(_0x2ac79a[_0x5056('0x30')]['filter']){_0x24d33e[_0x5056('0x3a')]=_['merge'](_0x24d33e[_0x5056('0x3a')],{'$or':_[_0x5056('0x2f')](_0x49fe67,function(_0x3d56cf){if(_0x3d56cf['type']!==_0x5056('0x3c')){var _0x16a940={};_0x16a940[_0x3d56cf[_0x5056('0x28')]]={'$like':'%'+_0x2ac79a[_0x5056('0x30')][_0x5056('0x3d')]+'%'};return _0x16a940;}})});}_0x24d33e=_[_0x5056('0x3e')]({},_0x24d33e,_0x2ac79a[_0x5056('0x3f')]);var _0x21aa75={'where':_0x24d33e[_0x5056('0x3a')]};return db[_0x5056('0x40')][_0x5056('0x1f')](_0x21aa75)[_0x5056('0x23')](function(_0xc1024a){_0x70246c[_0x5056('0x1f')]=_0xc1024a;if(_0x2ac79a[_0x5056('0x30')][_0x5056('0x41')]){_0x24d33e['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x5056('0x42')](_0x24d33e);})[_0x5056('0x23')](function(_0x6946b4){_0x70246c[_0x5056('0x43')]=_0x6946b4;return _0x70246c;})[_0x5056('0x23')](respondWithFilteredResult(_0x53e6db,_0x24d33e))[_0x5056('0x44')](handleError(_0x53e6db,null));};exports[_0x5056('0x45')]=function(_0x2bf472,_0x48ab5e){var _0x58f12f={'raw':!![],'where':{'id':_0x2bf472[_0x5056('0x46')]['id']}},_0x68a385={};_0x68a385[_0x5056('0x2e')]=_['keys'](db[_0x5056('0x40')]['rawAttributes']);_0x68a385[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2bf472[_0x5056('0x30')]);_0x68a385[_0x5056('0x32')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],_0x68a385['query']);_0x58f12f[_0x5056('0x35')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],qs['fields'](_0x2bf472['query']['fields']));_0x58f12f['attributes']=_0x58f12f[_0x5056('0x35')][_0x5056('0x36')]?_0x58f12f[_0x5056('0x35')]:_0x68a385[_0x5056('0x2e')];if(_0x2bf472[_0x5056('0x30')]['includeAll']){_0x58f12f['include']=[{'all':!![]}];}_0x58f12f=_[_0x5056('0x3e')]({},_0x58f12f,_0x2bf472[_0x5056('0x3f')]);return db[_0x5056('0x40')][_0x5056('0x47')](_0x58f12f)[_0x5056('0x23')](handleEntityNotFound(_0x48ab5e,null))[_0x5056('0x23')](respondWithResult(_0x48ab5e,null))[_0x5056('0x44')](handleError(_0x48ab5e,null));};exports['create']=function(_0x52d6ea,_0x14e3f5){return db[_0x5056('0x40')]['create'](_0x52d6ea[_0x5056('0x48')],{})[_0x5056('0x23')](respondWithResult(_0x14e3f5,0xc9))['catch'](handleError(_0x14e3f5,null));};exports['update']=function(_0x83d8e4,_0x1ab1a9){if(_0x83d8e4['body']['id']){delete _0x83d8e4['body']['id'];}return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0x83d8e4['params']['id']}})['then'](handleEntityNotFound(_0x1ab1a9,null))[_0x5056('0x23')](saveUpdates(_0x83d8e4[_0x5056('0x48')],null))[_0x5056('0x23')](respondWithResult(_0x1ab1a9,null))[_0x5056('0x44')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x24')]=function(_0xdf427c,_0x97f7d8){return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0xdf427c[_0x5056('0x46')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x97f7d8,null))[_0x5056('0x23')](removeEntity(_0x97f7d8,null))[_0x5056('0x44')](handleError(_0x97f7d8,null));};exports[_0x5056('0x49')]=function(_0x34e86e,_0x4bf758){return db['WhatsappQueueReport'][_0x5056('0x49')]()[_0x5056('0x23')](respondWithResult(_0x4bf758,null))[_0x5056('0x44')](handleError(_0x4bf758,null));}; \ No newline at end of file +var _0x373d=['order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','show','rawAttributes','includeAll','options','catch','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x588fa4,_0x58fbd7){var _0x3f8bf3=function(_0x287fc9){while(--_0x287fc9){_0x588fa4['push'](_0x588fa4['shift']());}};_0x3f8bf3(++_0x58fbd7);}(_0x373d,0x1e2));var _0xd373=function(_0x57aad4,_0x108f28){_0x57aad4=_0x57aad4-0x0;var _0x26b886=_0x373d[_0x57aad4];return _0x26b886;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7f91,_0x5ab89c){_0x5ab89c=_0x5ab89c||0xcc;return function(_0xcd9b8c){if(_0xcd9b8c){return _0x4c7f91[_0xd373('0x15')](_0x5ab89c);}return _0x4c7f91['status'](_0x5ab89c)[_0xd373('0x16')]();};}function respondWithResult(_0x129475,_0x27c161){_0x27c161=_0x27c161||0xc8;return function(_0x23ed86){if(_0x23ed86){return _0x129475[_0xd373('0x17')](_0x27c161)[_0xd373('0x18')](_0x23ed86);}};}function respondWithFilteredResult(_0x20aca5,_0x2eacb1){return function(_0x5a286a){if(_0x5a286a){var _0x2c5854=typeof _0x2eacb1[_0xd373('0x19')]===_0xd373('0x1a')&&typeof _0x2eacb1[_0xd373('0x1b')]==='undefined';var _0x1e26cf=_0x5a286a['count'];var _0x460259=_0x2c5854?0x0:_0x2eacb1[_0xd373('0x19')];var _0x55c5c7=_0x2c5854?_0x5a286a[_0xd373('0x1c')]:_0x2eacb1['offset']+_0x2eacb1['limit'];var _0x23fada;if(_0x55c5c7>=_0x1e26cf){_0x55c5c7=_0x1e26cf;_0x23fada=0xc8;}else{_0x23fada=0xce;}_0x20aca5[_0xd373('0x17')](_0x23fada);return _0x20aca5[_0xd373('0x1d')](_0xd373('0x1e'),_0x460259+'-'+_0x55c5c7+'/'+_0x1e26cf)[_0xd373('0x18')](_0x5a286a);}return null;};}function patchUpdates(_0x181eb2){return function(_0x4ba510){try{jsonpatch[_0xd373('0x1f')](_0x4ba510,_0x181eb2,!![]);}catch(_0xd808f8){return BPromise[_0xd373('0x20')](_0xd808f8);}return _0x4ba510[_0xd373('0x21')]();};}function saveUpdates(_0x165e21,_0x3aa1c5){return function(_0x4f64bd){if(_0x4f64bd){return _0x4f64bd[_0xd373('0x22')](_0x165e21)[_0xd373('0x23')](function(_0x157f81){return _0x157f81;});}return null;};}function removeEntity(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(_0x238ffd){return _0x238ffd[_0xd373('0x24')]()[_0xd373('0x23')](function(){_0x209ca7[_0xd373('0x17')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x437110,_0x34f05a){return function(_0x388182){if(!_0x388182){_0x437110[_0xd373('0x15')](0x194);}return _0x388182;};}function handleError(_0x18d7ab,_0x38ba50){_0x38ba50=_0x38ba50||0x1f4;return function(_0x50b987){logger[_0xd373('0x25')](_0x50b987[_0xd373('0x26')]);if(_0x50b987[_0xd373('0x27')]){delete _0x50b987[_0xd373('0x27')];}_0x18d7ab[_0xd373('0x17')](_0x38ba50)[_0xd373('0x28')](_0x50b987);};}exports[_0xd373('0x29')]=function(_0xf85ca8,_0x2869e5){var _0x158825={},_0xbc420b={},_0x2ee37c={'count':0x0,'rows':[]};var _0x7dad3e=_['map'](db[_0xd373('0x2a')]['rawAttributes'],function(_0x498aaa){return{'name':_0x498aaa[_0xd373('0x2b')],'type':_0x498aaa[_0xd373('0x2c')][_0xd373('0x2d')]};});_0xbc420b[_0xd373('0x2e')]=_[_0xd373('0x2f')](_0x7dad3e,'name');_0xbc420b[_0xd373('0x30')]=_[_0xd373('0x31')](_0xf85ca8['query']);_0xbc420b[_0xd373('0x32')]=_[_0xd373('0x33')](_0xbc420b[_0xd373('0x2e')],_0xbc420b[_0xd373('0x30')]);_0x158825[_0xd373('0x34')]=_[_0xd373('0x33')](_0xbc420b[_0xd373('0x2e')],qs[_0xd373('0x35')](_0xf85ca8[_0xd373('0x30')]['fields']));_0x158825[_0xd373('0x34')]=_0x158825[_0xd373('0x34')][_0xd373('0x36')]?_0x158825[_0xd373('0x34')]:_0xbc420b[_0xd373('0x2e')];if(!_0xf85ca8[_0xd373('0x30')][_0xd373('0x37')](_0xd373('0x38'))){_0x158825[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0xf85ca8[_0xd373('0x30')][_0xd373('0x1b')]);_0x158825[_0xd373('0x19')]=qs[_0xd373('0x19')](_0xf85ca8[_0xd373('0x30')]['offset']);}_0x158825[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0xf85ca8[_0xd373('0x30')][_0xd373('0x3a')]);_0x158825['where']=qs[_0xd373('0x32')](_[_0xd373('0x3b')](_0xf85ca8[_0xd373('0x30')],_0xbc420b[_0xd373('0x32')]),_0x7dad3e);if(_0xf85ca8[_0xd373('0x30')][_0xd373('0x3c')]){_0x158825['where']=_['merge'](_0x158825[_0xd373('0x3d')],{'$or':_['map'](_0x7dad3e,function(_0x37c97e){if(_0x37c97e[_0xd373('0x2c')]!==_0xd373('0x3e')){var _0x51ba69={};_0x51ba69[_0x37c97e[_0xd373('0x27')]]={'$like':'%'+_0xf85ca8[_0xd373('0x30')][_0xd373('0x3c')]+'%'};return _0x51ba69;}})});}_0x158825=_[_0xd373('0x3f')]({},_0x158825,_0xf85ca8['options']);var _0x513038={'where':_0x158825['where']};return db[_0xd373('0x2a')]['count'](_0x513038)[_0xd373('0x23')](function(_0x2fa6c4){_0x2ee37c['count']=_0x2fa6c4;if(_0xf85ca8['query']['includeAll']){_0x158825[_0xd373('0x40')]=[{'all':!![]}];}return db[_0xd373('0x2a')][_0xd373('0x41')](_0x158825);})['then'](function(_0x5c3b22){_0x2ee37c[_0xd373('0x42')]=_0x5c3b22;return _0x2ee37c;})[_0xd373('0x23')](respondWithFilteredResult(_0x2869e5,_0x158825))['catch'](handleError(_0x2869e5,null));};exports[_0xd373('0x43')]=function(_0x2ee75f,_0x1e3de1){var _0x9989e4={'raw':!![],'where':{'id':_0x2ee75f['params']['id']}},_0x2d8c7d={};_0x2d8c7d['model']=_[_0xd373('0x31')](db[_0xd373('0x2a')][_0xd373('0x44')]);_0x2d8c7d[_0xd373('0x30')]=_['keys'](_0x2ee75f[_0xd373('0x30')]);_0x2d8c7d['filters']=_[_0xd373('0x33')](_0x2d8c7d[_0xd373('0x2e')],_0x2d8c7d[_0xd373('0x30')]);_0x9989e4[_0xd373('0x34')]=_[_0xd373('0x33')](_0x2d8c7d['model'],qs[_0xd373('0x35')](_0x2ee75f[_0xd373('0x30')]['fields']));_0x9989e4[_0xd373('0x34')]=_0x9989e4[_0xd373('0x34')][_0xd373('0x36')]?_0x9989e4[_0xd373('0x34')]:_0x2d8c7d[_0xd373('0x2e')];if(_0x2ee75f[_0xd373('0x30')][_0xd373('0x45')]){_0x9989e4[_0xd373('0x40')]=[{'all':!![]}];}_0x9989e4=_[_0xd373('0x3f')]({},_0x9989e4,_0x2ee75f[_0xd373('0x46')]);return db['WhatsappQueueReport']['find'](_0x9989e4)[_0xd373('0x23')](handleEntityNotFound(_0x1e3de1,null))['then'](respondWithResult(_0x1e3de1,null))[_0xd373('0x47')](handleError(_0x1e3de1,null));};exports['create']=function(_0x5e5279,_0x5cbc16){return db[_0xd373('0x2a')][_0xd373('0x48')](_0x5e5279[_0xd373('0x49')],{})[_0xd373('0x23')](respondWithResult(_0x5cbc16,0xc9))[_0xd373('0x47')](handleError(_0x5cbc16,null));};exports[_0xd373('0x22')]=function(_0x1855aa,_0x4d1088){if(_0x1855aa[_0xd373('0x49')]['id']){delete _0x1855aa['body']['id'];}return db[_0xd373('0x2a')][_0xd373('0x4a')]({'where':{'id':_0x1855aa['params']['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x4d1088,null))['then'](saveUpdates(_0x1855aa[_0xd373('0x49')],null))[_0xd373('0x23')](respondWithResult(_0x4d1088,null))[_0xd373('0x47')](handleError(_0x4d1088,null));};exports[_0xd373('0x24')]=function(_0xe22cbd,_0x4bc631){return db['WhatsappQueueReport']['find']({'where':{'id':_0xe22cbd[_0xd373('0x4b')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x4bc631,null))['then'](removeEntity(_0x4bc631,null))[_0xd373('0x47')](handleError(_0x4bc631,null));};exports[_0xd373('0x4c')]=function(_0x4d7020,_0xae7067){return db[_0xd373('0x2a')][_0xd373('0x4c')]()[_0xd373('0x23')](respondWithResult(_0xae7067,null))[_0xd373('0x47')](handleError(_0xae7067,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 08e3528..e88ce0c 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb00=['lodash','util','../../config/logger','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0xb5319f,_0x5352ff){var _0x186f43=function(_0x26170b){while(--_0x26170b){_0xb5319f['push'](_0xb5319f['shift']());}};_0x186f43(++_0x5352ff);}(_0xcb00,0x186));var _0x0cb0=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xcb00[_0x1e6db3];return _0x1de886;};'use strict';var _=require(_0x0cb0('0x0'));var util=require(_0x0cb0('0x1'));var logger=require(_0x0cb0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cb0('0x3'));var rimraf=require('rimraf');var config=require(_0x0cb0('0x4'));var attributes=require(_0x0cb0('0x5'));module[_0x0cb0('0x6')]=function(_0x515bc1,_0x4ed5ee){return _0x515bc1[_0x0cb0('0x7')](_0x0cb0('0x8'),attributes,{'tableName':_0x0cb0('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x845a=['../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','api','bluebird','request-promise','path'];(function(_0x4fac7b,_0x78b07c){var _0xdfd85=function(_0x126e47){while(--_0x126e47){_0x4fac7b['push'](_0x4fac7b['shift']());}};_0xdfd85(++_0x78b07c);}(_0x845a,0x1ea));var _0xa845=function(_0x8df750,_0x22c0f5){_0x8df750=_0x8df750-0x0;var _0x290bc8=_0x845a[_0x8df750];return _0x290bc8;};'use strict';var _=require('lodash');var util=require(_0xa845('0x0'));var logger=require('../../config/logger')(_0xa845('0x1'));var moment=require('moment');var BPromise=require(_0xa845('0x2'));var rp=require(_0xa845('0x3'));var fs=require('fs');var path=require(_0xa845('0x4'));var rimraf=require('rimraf');var config=require(_0xa845('0x5'));var attributes=require('./whatsappQueueReport.attributes');module[_0xa845('0x6')]=function(_0x4be636,_0x545926){return _0x4be636[_0xa845('0x7')](_0xa845('0x8'),attributes,{'tableName':_0xa845('0x9'),'paranoid':![],'indexes':[{'name':_0xa845('0xa'),'fields':[_0xa845('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 905ecf2..5880d01 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52da=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','create','options','raw','WhatsappQueueReport','update','body','where','attributes','UpdateWhatsappQueueReport'];(function(_0x542085,_0x7d4c53){var _0xb4c5db=function(_0x34d806){while(--_0x34d806){_0x542085['push'](_0x542085['shift']());}};_0xb4c5db(++_0x7d4c53);}(_0x52da,0x129));var _0xa52d=function(_0x304f80,_0x2f7b5b){_0x304f80=_0x304f80-0x0;var _0x4c0f2d=_0x52da[_0x304f80];return _0x4c0f2d;};'use strict';var _=require(_0xa52d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa52d('0x1'));var rs=require(_0xa52d('0x2'));var fs=require('fs');var Redis=require(_0xa52d('0x3'));var db=require(_0xa52d('0x4'))['db'];var utils=require(_0xa52d('0x5'));var logger=require(_0xa52d('0x6'))(_0xa52d('0x7'));var config=require(_0xa52d('0x8'));var jayson=require(_0xa52d('0x9'));var client=jayson[_0xa52d('0xa')][_0xa52d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd9df1f,_0x25ce9f,_0x47f615){return new BPromise(function(_0x22a54f,_0x2a8318){return client[_0xa52d('0xc')](_0xd9df1f,_0x47f615)[_0xa52d('0xd')](function(_0x441682){logger[_0xa52d('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x25ce9f,_0xa52d('0xf'));logger[_0xa52d('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x25ce9f,_0xa52d('0xf'),JSON[_0xa52d('0x11')](_0x441682));if(_0x441682[_0xa52d('0x12')]){if(_0x441682[_0xa52d('0x12')][_0xa52d('0x13')]===0x1f4){logger[_0xa52d('0x12')](_0xa52d('0x14'),_0x25ce9f,_0x441682[_0xa52d('0x12')][_0xa52d('0x15')]);return _0x2a8318(_0x441682[_0xa52d('0x12')][_0xa52d('0x15')]);}logger[_0xa52d('0x12')](_0xa52d('0x14'),_0x25ce9f,_0x441682['error'][_0xa52d('0x15')]);return _0x22a54f(_0x441682['error'][_0xa52d('0x15')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x25ce9f,_0xa52d('0xf'));_0x22a54f(_0x441682['result']['message']);}})[_0xa52d('0x16')](function(_0x45c94f){logger[_0xa52d('0x12')](_0xa52d('0x14'),_0x25ce9f,_0x45c94f);_0x2a8318(_0x45c94f);});});}exports[_0xa52d('0x17')]=function(_0x300af1){var _0x478854=this;return new Promise(function(_0x6e15ee,_0x31b39e){return db['WhatsappQueueReport'][_0xa52d('0x18')](_0x300af1['body'],{'raw':_0x300af1[_0xa52d('0x19')]?_0x300af1[_0xa52d('0x19')][_0xa52d('0x1a')]===undefined?!![]:![]:!![]})[_0xa52d('0xd')](function(_0x3b40ab){logger[_0xa52d('0xe')](_0xa52d('0x17'),_0x300af1);logger['debug']('CreateWhatsappQueueReport',_0x300af1,JSON[_0xa52d('0x11')](_0x3b40ab));_0x6e15ee(_0x3b40ab);})[_0xa52d('0x16')](function(_0x5bf274){logger[_0xa52d('0x12')](_0xa52d('0x17'),_0x5bf274[_0xa52d('0x15')],_0x300af1);_0x31b39e(_0x478854['error'](0x1f4,_0x5bf274[_0xa52d('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x47203c){var _0x303064=this;return new Promise(function(_0x3aa080,_0x6db877){return db[_0xa52d('0x1b')][_0xa52d('0x1c')](_0x47203c[_0xa52d('0x1d')],{'raw':_0x47203c['options']?_0x47203c[_0xa52d('0x19')][_0xa52d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47203c[_0xa52d('0x19')]?_0x47203c['options'][_0xa52d('0x1e')]||null:null,'attributes':_0x47203c[_0xa52d('0x19')]?_0x47203c['options'][_0xa52d('0x1f')]||null:null,'limit':_0x47203c[_0xa52d('0x19')]?_0x47203c[_0xa52d('0x19')]['limit']||null:null})['then'](function(_0x26d4fd){logger[_0xa52d('0xe')](_0xa52d('0x20'),_0x47203c);logger[_0xa52d('0x10')](_0xa52d('0x20'),_0x47203c,JSON[_0xa52d('0x11')](_0x26d4fd));_0x3aa080(_0x26d4fd);})['catch'](function(_0x300d18){logger[_0xa52d('0x12')](_0xa52d('0x20'),_0x300d18[_0xa52d('0x15')],_0x47203c);_0x6db877(_0x303064['error'](0x1f4,_0x300d18[_0xa52d('0x15')]));});});}; \ No newline at end of file +var _0x7b4f=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','UpdateWhatsappQueueReport','update','where','attributes','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7b4f,0x134));var _0xf7b4=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x7b4f[_0x5af59e];return _0x4240df;};'use strict';var _=require('lodash');var util=require(_0xf7b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7b4('0x1'));var fs=require('fs');var Redis=require(_0xf7b4('0x2'));var db=require(_0xf7b4('0x3'))['db'];var utils=require(_0xf7b4('0x4'));var logger=require(_0xf7b4('0x5'))(_0xf7b4('0x6'));var config=require('../../config/environment');var jayson=require(_0xf7b4('0x7'));var client=jayson[_0xf7b4('0x8')][_0xf7b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20c8c9,_0x4f577a,_0x242851){return new BPromise(function(_0x320669,_0x14838d){return client[_0xf7b4('0xa')](_0x20c8c9,_0x242851)['then'](function(_0x4569a1){logger[_0xf7b4('0xb')](_0xf7b4('0xc'),_0x4f577a,_0xf7b4('0xd'));logger['debug'](_0xf7b4('0xe'),_0x4f577a,_0xf7b4('0xd'),JSON[_0xf7b4('0xf')](_0x4569a1));if(_0x4569a1[_0xf7b4('0x10')]){if(_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x11')]===0x1f4){logger[_0xf7b4('0x10')](_0xf7b4('0xc'),_0x4f577a,_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x12')]);return _0x14838d(_0x4569a1[_0xf7b4('0x10')]['message']);}logger[_0xf7b4('0x10')](_0xf7b4('0xc'),_0x4f577a,_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x12')]);return _0x320669(_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x12')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x4f577a,_0xf7b4('0xd'));_0x320669(_0x4569a1['result'][_0xf7b4('0x12')]);}})[_0xf7b4('0x13')](function(_0x73d55e){logger['error'](_0xf7b4('0xc'),_0x4f577a,_0x73d55e);_0x14838d(_0x73d55e);});});}exports[_0xf7b4('0x14')]=function(_0xb665d7){var _0x1fab13=this;return new Promise(function(_0x33a0e4,_0x479b06){return db[_0xf7b4('0x15')][_0xf7b4('0x16')](_0xb665d7[_0xf7b4('0x17')],{'raw':_0xb665d7['options']?_0xb665d7[_0xf7b4('0x18')][_0xf7b4('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x58f32d){logger['info'](_0xf7b4('0x14'),_0xb665d7);logger[_0xf7b4('0x1a')](_0xf7b4('0x14'),_0xb665d7,JSON['stringify'](_0x58f32d));_0x33a0e4(_0x58f32d);})[_0xf7b4('0x13')](function(_0x4f8c38){logger[_0xf7b4('0x10')](_0xf7b4('0x14'),_0x4f8c38[_0xf7b4('0x12')],_0xb665d7);_0x479b06(_0x1fab13['error'](0x1f4,_0x4f8c38[_0xf7b4('0x12')]));});});};exports[_0xf7b4('0x1b')]=function(_0x25373){var _0x41ba5f=this;return new Promise(function(_0xb1d9c8,_0x1a1448){return db[_0xf7b4('0x15')][_0xf7b4('0x1c')](_0x25373[_0xf7b4('0x17')],{'raw':_0x25373['options']?_0x25373[_0xf7b4('0x18')][_0xf7b4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25373['options']?_0x25373[_0xf7b4('0x18')][_0xf7b4('0x1d')]||null:null,'attributes':_0x25373[_0xf7b4('0x18')]?_0x25373[_0xf7b4('0x18')][_0xf7b4('0x1e')]||null:null,'limit':_0x25373[_0xf7b4('0x18')]?_0x25373[_0xf7b4('0x18')]['limit']||null:null})[_0xf7b4('0x1f')](function(_0x458cfe){logger[_0xf7b4('0xb')]('UpdateWhatsappQueueReport',_0x25373);logger[_0xf7b4('0x1a')]('UpdateWhatsappQueueReport',_0x25373,JSON[_0xf7b4('0xf')](_0x458cfe));_0xb1d9c8(_0x458cfe);})[_0xf7b4('0x13')](function(_0x1ccb8e){logger[_0xf7b4('0x10')](_0xf7b4('0x1b'),_0x1ccb8e[_0xf7b4('0x12')],_0x25373);_0x1a1448(_0x41ba5f[_0xf7b4('0x10')](0x1f4,_0x1ccb8e[_0xf7b4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4bf5fc9..f4d2b6d 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bb7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xbd8fcf,_0x5a33c7){var _0x3ae50e=function(_0x45c32e){while(--_0x45c32e){_0xbd8fcf['push'](_0xbd8fcf['shift']());}};_0x3ae50e(++_0x5a33c7);}(_0x1bb7,0xf9));var _0x71bb=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1bb7[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x71bb('0x0'));var util=require(_0x71bb('0x1'));var path=require(_0x71bb('0x2'));var timeout=require(_0x71bb('0x3'));var express=require(_0x71bb('0x4'));var router=express[_0x71bb('0x5')]();var fs_extra=require(_0x71bb('0x6'));var auth=require(_0x71bb('0x7'));var interaction=require(_0x71bb('0x8'));var config=require(_0x71bb('0x9'));var controller=require(_0x71bb('0xa'));router[_0x71bb('0xb')]('/',auth[_0x71bb('0xc')](),controller[_0x71bb('0xd')]);router['get'](_0x71bb('0xe'),auth[_0x71bb('0xc')](),controller[_0x71bb('0xf')]);router[_0x71bb('0xb')](_0x71bb('0x10'),auth[_0x71bb('0xc')](),controller['show']);router[_0x71bb('0x11')]('/',auth[_0x71bb('0xc')](),controller[_0x71bb('0x12')]);router[_0x71bb('0x13')]('/:id',auth[_0x71bb('0xc')](),controller['update']);router[_0x71bb('0x14')](_0x71bb('0x10'),auth[_0x71bb('0xc')](),controller[_0x71bb('0x15')]);module[_0x71bb('0x16')]=router; \ No newline at end of file +var _0xbdc3=['../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','show','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xbdc3,0x129));var _0x3bdc=function(_0x1ea952,_0x369e26){_0x1ea952=_0x1ea952-0x0;var _0x4d6d83=_0xbdc3[_0x1ea952];return _0x4d6d83;};'use strict';var multer=require('multer');var util=require(_0x3bdc('0x0'));var path=require(_0x3bdc('0x1'));var timeout=require(_0x3bdc('0x2'));var express=require(_0x3bdc('0x3'));var router=express[_0x3bdc('0x4')]();var fs_extra=require(_0x3bdc('0x5'));var auth=require(_0x3bdc('0x6'));var interaction=require(_0x3bdc('0x7'));var config=require(_0x3bdc('0x8'));var controller=require(_0x3bdc('0x9'));router[_0x3bdc('0xa')]('/',auth[_0x3bdc('0xb')](),controller['index']);router['get'](_0x3bdc('0xc'),auth[_0x3bdc('0xb')](),controller[_0x3bdc('0xd')]);router[_0x3bdc('0xa')]('/:id',auth[_0x3bdc('0xb')](),controller[_0x3bdc('0xe')]);router['post']('/',auth[_0x3bdc('0xb')](),controller['create']);router[_0x3bdc('0xf')](_0x3bdc('0x10'),auth[_0x3bdc('0xb')](),controller['update']);router[_0x3bdc('0x11')](_0x3bdc('0x10'),auth[_0x3bdc('0xb')](),controller[_0x3bdc('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 6383999..178886a 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd142=['sequelize','exports','STRING','ENUM','queue','DATE'];(function(_0x4fb9ed,_0x187ea0){var _0x263645=function(_0x11c604){while(--_0x11c604){_0x4fb9ed['push'](_0x4fb9ed['shift']());}};_0x263645(++_0x187ea0);}(_0xd142,0x11a));var _0x2d14=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xd142[_0x119629];return _0x49a771;};'use strict';var Sequelize=require(_0x2d14('0x0'));module[_0x2d14('0x1')]={'uniqueid':{'type':Sequelize[_0x2d14('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2d14('0x3')]('account','agent',_0x2d14('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2d14('0x5')]}}; \ No newline at end of file +var _0xdc91=['exports','queue','DATE','sequelize'];(function(_0xc981b,_0x3d2524){var _0xf1edc0=function(_0x3e6c2a){while(--_0x3e6c2a){_0xc981b['push'](_0xc981b['shift']());}};_0xf1edc0(++_0x3d2524);}(_0xdc91,0x8b));var _0x1dc9=function(_0x272a78,_0x219004){_0x272a78=_0x272a78-0x0;var _0x3e59d5=_0xdc91[_0x272a78];return _0x3e59d5;};'use strict';var Sequelize=require(_0x1dc9('0x0'));module[_0x1dc9('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0x1dc9('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1dc9('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c56427d..c4434ae 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fbe=['zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','save','then','destroy','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','update','describe','eml-format','rimraf'];(function(_0x57f114,_0x5378a1){var _0x3cbc26=function(_0x3bfd40){while(--_0x3bfd40){_0x57f114['push'](_0x57f114['shift']());}};_0x3cbc26(++_0x5378a1);}(_0x8fbe,0x1c6));var _0xe8fb=function(_0x11fb02,_0x3cd369){_0x11fb02=_0x11fb02-0x0;var _0x47db94=_0x8fbe[_0x11fb02];return _0x47db94;};'use strict';var emlformat=require(_0xe8fb('0x0'));var rimraf=require(_0xe8fb('0x1'));var zipdir=require(_0xe8fb('0x2'));var jsonpatch=require(_0xe8fb('0x3'));var rp=require(_0xe8fb('0x4'));var moment=require(_0xe8fb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8fb('0x6'));var path=require(_0xe8fb('0x7'));var sox=require(_0xe8fb('0x8'));var csv=require(_0xe8fb('0x9'));var ejs=require(_0xe8fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe8fb('0xb'));var _=require(_0xe8fb('0xc'));var squel=require(_0xe8fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe8fb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe8fb('0x9'));var querystring=require(_0xe8fb('0xf'));var Papa=require(_0xe8fb('0x10'));var Redis=require(_0xe8fb('0x11'));var authService=require(_0xe8fb('0x12'));var qs=require(_0xe8fb('0x13'));var as=require(_0xe8fb('0x14'));var hardwareService=require(_0xe8fb('0x15'));var logger=require(_0xe8fb('0x16'))(_0xe8fb('0x17'));var utils=require(_0xe8fb('0x18'));var config=require(_0xe8fb('0x19'));var licenseUtil=require(_0xe8fb('0x1a'));var db=require(_0xe8fb('0x1b'))['db'];function respondWithStatusCode(_0x33901d,_0x1dccc0){_0x1dccc0=_0x1dccc0||0xcc;return function(_0x38eaf7){if(_0x38eaf7){return _0x33901d[_0xe8fb('0x1c')](_0x1dccc0);}return _0x33901d[_0xe8fb('0x1d')](_0x1dccc0)['end']();};}function respondWithResult(_0x3f06b0,_0x101845){_0x101845=_0x101845||0xc8;return function(_0x4a14c0){if(_0x4a14c0){return _0x3f06b0[_0xe8fb('0x1d')](_0x101845)['json'](_0x4a14c0);}};}function respondWithFilteredResult(_0x101b95,_0x4628ce){return function(_0x47007d){if(_0x47007d){var _0xe14866=typeof _0x4628ce[_0xe8fb('0x1e')]===_0xe8fb('0x1f')&&typeof _0x4628ce[_0xe8fb('0x20')]==='undefined';var _0xec1e0=_0x47007d[_0xe8fb('0x21')];var _0x1632fd=_0xe14866?0x0:_0x4628ce[_0xe8fb('0x1e')];var _0x3cf418=_0xe14866?_0x47007d[_0xe8fb('0x21')]:_0x4628ce[_0xe8fb('0x1e')]+_0x4628ce[_0xe8fb('0x20')];var _0x50e353;if(_0x3cf418>=_0xec1e0){_0x3cf418=_0xec1e0;_0x50e353=0xc8;}else{_0x50e353=0xce;}_0x101b95[_0xe8fb('0x1d')](_0x50e353);return _0x101b95['set']('Content-Range',_0x1632fd+'-'+_0x3cf418+'/'+_0xec1e0)[_0xe8fb('0x22')](_0x47007d);}return null;};}function patchUpdates(_0x429ea0){return function(_0x766a01){try{jsonpatch[_0xe8fb('0x23')](_0x766a01,_0x429ea0,!![]);}catch(_0x32c463){return BPromise['reject'](_0x32c463);}return _0x766a01[_0xe8fb('0x24')]();};}function saveUpdates(_0x51d09d,_0x47e55e){return function(_0x1bc625){if(_0x1bc625){return _0x1bc625['update'](_0x51d09d)[_0xe8fb('0x25')](function(_0x388ef5){return _0x388ef5;});}return null;};}function removeEntity(_0x193bd9,_0x4d92ed){return function(_0x108221){if(_0x108221){return _0x108221[_0xe8fb('0x26')]()[_0xe8fb('0x25')](function(){_0x193bd9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x447d9a,_0x4e8461){return function(_0x4bbf86){if(!_0x4bbf86){_0x447d9a['sendStatus'](0x194);}return _0x4bbf86;};}function handleError(_0x24a5e7,_0x58a9c2){_0x58a9c2=_0x58a9c2||0x1f4;return function(_0x232358){logger['error'](_0x232358['stack']);if(_0x232358[_0xe8fb('0x27')]){delete _0x232358['name'];}_0x24a5e7[_0xe8fb('0x1d')](_0x58a9c2)[_0xe8fb('0x28')](_0x232358);};}exports[_0xe8fb('0x29')]=function(_0x1827bb,_0x5c4cf4){var _0x4ad63d={},_0x15e500={},_0x5141c6={'count':0x0,'rows':[]};var _0x2a6108=_[_0xe8fb('0x2a')](db[_0xe8fb('0x2b')][_0xe8fb('0x2c')],function(_0x4dd747){return{'name':_0x4dd747[_0xe8fb('0x2d')],'type':_0x4dd747['type'][_0xe8fb('0x2e')]};});_0x15e500[_0xe8fb('0x2f')]=_[_0xe8fb('0x2a')](_0x2a6108,_0xe8fb('0x27'));_0x15e500[_0xe8fb('0x30')]=_[_0xe8fb('0x31')](_0x1827bb[_0xe8fb('0x30')]);_0x15e500[_0xe8fb('0x32')]=_[_0xe8fb('0x33')](_0x15e500[_0xe8fb('0x2f')],_0x15e500['query']);_0x4ad63d[_0xe8fb('0x34')]=_[_0xe8fb('0x33')](_0x15e500[_0xe8fb('0x2f')],qs[_0xe8fb('0x35')](_0x1827bb[_0xe8fb('0x30')]['fields']));_0x4ad63d[_0xe8fb('0x34')]=_0x4ad63d[_0xe8fb('0x34')][_0xe8fb('0x36')]?_0x4ad63d[_0xe8fb('0x34')]:_0x15e500[_0xe8fb('0x2f')];if(!_0x1827bb['query']['hasOwnProperty'](_0xe8fb('0x37'))){_0x4ad63d[_0xe8fb('0x20')]=qs['limit'](_0x1827bb[_0xe8fb('0x30')][_0xe8fb('0x20')]);_0x4ad63d[_0xe8fb('0x1e')]=qs[_0xe8fb('0x1e')](_0x1827bb[_0xe8fb('0x30')]['offset']);}_0x4ad63d[_0xe8fb('0x38')]=qs['sort'](_0x1827bb[_0xe8fb('0x30')][_0xe8fb('0x39')]);_0x4ad63d[_0xe8fb('0x3a')]=qs[_0xe8fb('0x32')](_[_0xe8fb('0x3b')](_0x1827bb[_0xe8fb('0x30')],_0x15e500[_0xe8fb('0x32')]),_0x2a6108);if(_0x1827bb[_0xe8fb('0x30')][_0xe8fb('0x3c')]){_0x4ad63d[_0xe8fb('0x3a')]=_[_0xe8fb('0x3d')](_0x4ad63d[_0xe8fb('0x3a')],{'$or':_[_0xe8fb('0x2a')](_0x2a6108,function(_0x3dec00){if(_0x3dec00[_0xe8fb('0x3e')]!==_0xe8fb('0x3f')){var _0x155a8a={};_0x155a8a[_0x3dec00[_0xe8fb('0x27')]]={'$like':'%'+_0x1827bb[_0xe8fb('0x30')][_0xe8fb('0x3c')]+'%'};return _0x155a8a;}})});}_0x4ad63d=_[_0xe8fb('0x3d')]({},_0x4ad63d,_0x1827bb[_0xe8fb('0x40')]);var _0x5129ea={'where':_0x4ad63d[_0xe8fb('0x3a')]};return db[_0xe8fb('0x2b')][_0xe8fb('0x21')](_0x5129ea)['then'](function(_0x1e281c){_0x5141c6[_0xe8fb('0x21')]=_0x1e281c;if(_0x1827bb[_0xe8fb('0x30')][_0xe8fb('0x41')]){_0x4ad63d[_0xe8fb('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xe8fb('0x43')](_0x4ad63d);})['then'](function(_0x20e8b7){_0x5141c6['rows']=_0x20e8b7;return _0x5141c6;})[_0xe8fb('0x25')](respondWithFilteredResult(_0x5c4cf4,_0x4ad63d))['catch'](handleError(_0x5c4cf4,null));};exports[_0xe8fb('0x44')]=function(_0x5f8e0e,_0x37c1f1){var _0x10f5b7={'raw':!![],'where':{'id':_0x5f8e0e[_0xe8fb('0x45')]['id']}},_0x218097={};_0x218097[_0xe8fb('0x2f')]=_[_0xe8fb('0x31')](db[_0xe8fb('0x2b')][_0xe8fb('0x2c')]);_0x218097[_0xe8fb('0x30')]=_[_0xe8fb('0x31')](_0x5f8e0e[_0xe8fb('0x30')]);_0x218097[_0xe8fb('0x32')]=_[_0xe8fb('0x33')](_0x218097['model'],_0x218097['query']);_0x10f5b7['attributes']=_[_0xe8fb('0x33')](_0x218097[_0xe8fb('0x2f')],qs['fields'](_0x5f8e0e['query'][_0xe8fb('0x35')]));_0x10f5b7['attributes']=_0x10f5b7[_0xe8fb('0x34')][_0xe8fb('0x36')]?_0x10f5b7[_0xe8fb('0x34')]:_0x218097[_0xe8fb('0x2f')];if(_0x5f8e0e['query'][_0xe8fb('0x41')]){_0x10f5b7[_0xe8fb('0x42')]=[{'all':!![]}];}_0x10f5b7=_[_0xe8fb('0x3d')]({},_0x10f5b7,_0x5f8e0e['options']);return db[_0xe8fb('0x2b')][_0xe8fb('0x46')](_0x10f5b7)[_0xe8fb('0x25')](handleEntityNotFound(_0x37c1f1,null))[_0xe8fb('0x25')](respondWithResult(_0x37c1f1,null))['catch'](handleError(_0x37c1f1,null));};exports[_0xe8fb('0x47')]=function(_0x19282f,_0x7a17f2){return db[_0xe8fb('0x2b')][_0xe8fb('0x47')](_0x19282f[_0xe8fb('0x48')],{})[_0xe8fb('0x25')](respondWithResult(_0x7a17f2,0xc9))[_0xe8fb('0x49')](handleError(_0x7a17f2,null));};exports[_0xe8fb('0x4a')]=function(_0x525b24,_0x2f6419){if(_0x525b24[_0xe8fb('0x48')]['id']){delete _0x525b24[_0xe8fb('0x48')]['id'];}return db[_0xe8fb('0x2b')][_0xe8fb('0x46')]({'where':{'id':_0x525b24[_0xe8fb('0x45')]['id']}})[_0xe8fb('0x25')](handleEntityNotFound(_0x2f6419,null))['then'](saveUpdates(_0x525b24[_0xe8fb('0x48')],null))[_0xe8fb('0x25')](respondWithResult(_0x2f6419,null))[_0xe8fb('0x49')](handleError(_0x2f6419,null));};exports[_0xe8fb('0x26')]=function(_0x1eeb73,_0x25aab2){return db[_0xe8fb('0x2b')][_0xe8fb('0x46')]({'where':{'id':_0x1eeb73[_0xe8fb('0x45')]['id']}})[_0xe8fb('0x25')](handleEntityNotFound(_0x25aab2,null))[_0xe8fb('0x25')](removeEntity(_0x25aab2,null))[_0xe8fb('0x49')](handleError(_0x25aab2,null));};exports[_0xe8fb('0x4b')]=function(_0x42edb5,_0x189f1b){return db[_0xe8fb('0x2b')][_0xe8fb('0x4b')]()['then'](respondWithResult(_0x189f1b,null))[_0xe8fb('0x49')](handleError(_0x189f1b,null));}; \ No newline at end of file +var _0x573c=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','fields','length','find','create','body'];(function(_0x5df3ab,_0x4a0a7e){var _0x42cce5=function(_0x430d0a){while(--_0x430d0a){_0x5df3ab['push'](_0x5df3ab['shift']());}};_0x42cce5(++_0x4a0a7e);}(_0x573c,0x125));var _0xc573=function(_0x3aab2a,_0x18ec2c){_0x3aab2a=_0x3aab2a-0x0;var _0x8a14ff=_0x573c[_0x3aab2a];return _0x8a14ff;};'use strict';var emlformat=require(_0xc573('0x0'));var rimraf=require(_0xc573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc573('0x2'));var rp=require(_0xc573('0x3'));var moment=require(_0xc573('0x4'));var BPromise=require(_0xc573('0x5'));var Mustache=require(_0xc573('0x6'));var util=require(_0xc573('0x7'));var path=require('path');var sox=require(_0xc573('0x8'));var csv=require(_0xc573('0x9'));var ejs=require(_0xc573('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc573('0xb'));var squel=require('squel');var crypto=require(_0xc573('0xc'));var jsforce=require(_0xc573('0xd'));var deskjs=require(_0xc573('0xe'));var toCsv=require(_0xc573('0x9'));var querystring=require('querystring');var Papa=require(_0xc573('0xf'));var Redis=require(_0xc573('0x10'));var authService=require(_0xc573('0x11'));var qs=require(_0xc573('0x12'));var as=require(_0xc573('0x13'));var hardwareService=require(_0xc573('0x14'));var logger=require(_0xc573('0x15'))(_0xc573('0x16'));var utils=require(_0xc573('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc573('0x18'))['db'];function respondWithStatusCode(_0x1a626e,_0x1949d0){_0x1949d0=_0x1949d0||0xcc;return function(_0x2c4239){if(_0x2c4239){return _0x1a626e[_0xc573('0x19')](_0x1949d0);}return _0x1a626e[_0xc573('0x1a')](_0x1949d0)[_0xc573('0x1b')]();};}function respondWithResult(_0x377a5d,_0x2e0c02){_0x2e0c02=_0x2e0c02||0xc8;return function(_0x258231){if(_0x258231){return _0x377a5d[_0xc573('0x1a')](_0x2e0c02)[_0xc573('0x1c')](_0x258231);}};}function respondWithFilteredResult(_0x4199b6,_0x2b25f9){return function(_0x2f8a3e){if(_0x2f8a3e){var _0x5b6e=typeof _0x2b25f9['offset']===_0xc573('0x1d')&&typeof _0x2b25f9[_0xc573('0x1e')]==='undefined';var _0x25a70a=_0x2f8a3e['count'];var _0x54a4b7=_0x5b6e?0x0:_0x2b25f9['offset'];var _0xe671ca=_0x5b6e?_0x2f8a3e[_0xc573('0x1f')]:_0x2b25f9['offset']+_0x2b25f9[_0xc573('0x1e')];var _0x5e01cc;if(_0xe671ca>=_0x25a70a){_0xe671ca=_0x25a70a;_0x5e01cc=0xc8;}else{_0x5e01cc=0xce;}_0x4199b6[_0xc573('0x1a')](_0x5e01cc);return _0x4199b6[_0xc573('0x20')](_0xc573('0x21'),_0x54a4b7+'-'+_0xe671ca+'/'+_0x25a70a)[_0xc573('0x1c')](_0x2f8a3e);}return null;};}function patchUpdates(_0x4b9fed){return function(_0xe40809){try{jsonpatch['apply'](_0xe40809,_0x4b9fed,!![]);}catch(_0x9b2c9a){return BPromise[_0xc573('0x22')](_0x9b2c9a);}return _0xe40809[_0xc573('0x23')]();};}function saveUpdates(_0xaf4def,_0x49a6a6){return function(_0x494954){if(_0x494954){return _0x494954[_0xc573('0x24')](_0xaf4def)[_0xc573('0x25')](function(_0x328e58){return _0x328e58;});}return null;};}function removeEntity(_0x3ba794,_0x296e60){return function(_0x27f5af){if(_0x27f5af){return _0x27f5af[_0xc573('0x26')]()[_0xc573('0x25')](function(){_0x3ba794[_0xc573('0x1a')](0xcc)[_0xc573('0x1b')]();});}};}function handleEntityNotFound(_0x13833a,_0x5c4d76){return function(_0x7bc184){if(!_0x7bc184){_0x13833a[_0xc573('0x19')](0x194);}return _0x7bc184;};}function handleError(_0x1330f9,_0x300a86){_0x300a86=_0x300a86||0x1f4;return function(_0xb6e87b){logger[_0xc573('0x27')](_0xb6e87b[_0xc573('0x28')]);if(_0xb6e87b[_0xc573('0x29')]){delete _0xb6e87b[_0xc573('0x29')];}_0x1330f9[_0xc573('0x1a')](_0x300a86)['send'](_0xb6e87b);};}exports['index']=function(_0x1de2c8,_0x6e2917){var _0x3181c8={},_0x276e39={},_0x139f1d={'count':0x0,'rows':[]};var _0x5d053b=_[_0xc573('0x2a')](db[_0xc573('0x2b')][_0xc573('0x2c')],function(_0x5efc19){return{'name':_0x5efc19['fieldName'],'type':_0x5efc19[_0xc573('0x2d')][_0xc573('0x2e')]};});_0x276e39['model']=_['map'](_0x5d053b,_0xc573('0x29'));_0x276e39[_0xc573('0x2f')]=_[_0xc573('0x30')](_0x1de2c8['query']);_0x276e39[_0xc573('0x31')]=_['intersection'](_0x276e39[_0xc573('0x32')],_0x276e39[_0xc573('0x2f')]);_0x3181c8[_0xc573('0x33')]=_[_0xc573('0x34')](_0x276e39[_0xc573('0x32')],qs['fields'](_0x1de2c8[_0xc573('0x2f')]['fields']));_0x3181c8[_0xc573('0x33')]=_0x3181c8[_0xc573('0x33')]['length']?_0x3181c8[_0xc573('0x33')]:_0x276e39[_0xc573('0x32')];if(!_0x1de2c8[_0xc573('0x2f')]['hasOwnProperty'](_0xc573('0x35'))){_0x3181c8['limit']=qs[_0xc573('0x1e')](_0x1de2c8[_0xc573('0x2f')]['limit']);_0x3181c8['offset']=qs['offset'](_0x1de2c8['query']['offset']);}_0x3181c8[_0xc573('0x36')]=qs[_0xc573('0x37')](_0x1de2c8[_0xc573('0x2f')][_0xc573('0x37')]);_0x3181c8['where']=qs['filters'](_[_0xc573('0x38')](_0x1de2c8[_0xc573('0x2f')],_0x276e39[_0xc573('0x31')]),_0x5d053b);if(_0x1de2c8[_0xc573('0x2f')][_0xc573('0x39')]){_0x3181c8[_0xc573('0x3a')]=_[_0xc573('0x3b')](_0x3181c8[_0xc573('0x3a')],{'$or':_[_0xc573('0x2a')](_0x5d053b,function(_0x2c44f7){if(_0x2c44f7['type']!=='VIRTUAL'){var _0x33ee5d={};_0x33ee5d[_0x2c44f7['name']]={'$like':'%'+_0x1de2c8[_0xc573('0x2f')][_0xc573('0x39')]+'%'};return _0x33ee5d;}})});}_0x3181c8=_[_0xc573('0x3b')]({},_0x3181c8,_0x1de2c8[_0xc573('0x3c')]);var _0x78fb98={'where':_0x3181c8['where']};return db[_0xc573('0x2b')][_0xc573('0x1f')](_0x78fb98)['then'](function(_0x3a31f4){_0x139f1d[_0xc573('0x1f')]=_0x3a31f4;if(_0x1de2c8[_0xc573('0x2f')][_0xc573('0x3d')]){_0x3181c8['include']=[{'all':!![]}];}return db[_0xc573('0x2b')][_0xc573('0x3e')](_0x3181c8);})[_0xc573('0x25')](function(_0x30ea46){_0x139f1d[_0xc573('0x3f')]=_0x30ea46;return _0x139f1d;})[_0xc573('0x25')](respondWithFilteredResult(_0x6e2917,_0x3181c8))[_0xc573('0x40')](handleError(_0x6e2917,null));};exports[_0xc573('0x41')]=function(_0xd0b52c,_0x49e779){var _0x4fa707={'raw':!![],'where':{'id':_0xd0b52c[_0xc573('0x42')]['id']}},_0x3eaa9a={};_0x3eaa9a[_0xc573('0x32')]=_[_0xc573('0x30')](db[_0xc573('0x2b')][_0xc573('0x2c')]);_0x3eaa9a[_0xc573('0x2f')]=_[_0xc573('0x30')](_0xd0b52c['query']);_0x3eaa9a['filters']=_[_0xc573('0x34')](_0x3eaa9a[_0xc573('0x32')],_0x3eaa9a['query']);_0x4fa707[_0xc573('0x33')]=_[_0xc573('0x34')](_0x3eaa9a[_0xc573('0x32')],qs[_0xc573('0x43')](_0xd0b52c[_0xc573('0x2f')][_0xc573('0x43')]));_0x4fa707[_0xc573('0x33')]=_0x4fa707[_0xc573('0x33')][_0xc573('0x44')]?_0x4fa707['attributes']:_0x3eaa9a[_0xc573('0x32')];if(_0xd0b52c['query'][_0xc573('0x3d')]){_0x4fa707['include']=[{'all':!![]}];}_0x4fa707=_['merge']({},_0x4fa707,_0xd0b52c[_0xc573('0x3c')]);return db[_0xc573('0x2b')][_0xc573('0x45')](_0x4fa707)['then'](handleEntityNotFound(_0x49e779,null))[_0xc573('0x25')](respondWithResult(_0x49e779,null))[_0xc573('0x40')](handleError(_0x49e779,null));};exports[_0xc573('0x46')]=function(_0x20b1f5,_0x146f02){return db['WhatsappTransferReport'][_0xc573('0x46')](_0x20b1f5[_0xc573('0x47')],{})[_0xc573('0x25')](respondWithResult(_0x146f02,0xc9))[_0xc573('0x40')](handleError(_0x146f02,null));};exports[_0xc573('0x24')]=function(_0xf21bbf,_0xd56359){if(_0xf21bbf['body']['id']){delete _0xf21bbf[_0xc573('0x47')]['id'];}return db[_0xc573('0x2b')][_0xc573('0x45')]({'where':{'id':_0xf21bbf[_0xc573('0x42')]['id']}})[_0xc573('0x25')](handleEntityNotFound(_0xd56359,null))['then'](saveUpdates(_0xf21bbf['body'],null))[_0xc573('0x25')](respondWithResult(_0xd56359,null))[_0xc573('0x40')](handleError(_0xd56359,null));};exports[_0xc573('0x26')]=function(_0x1dc1aa,_0xae74a6){return db[_0xc573('0x2b')][_0xc573('0x45')]({'where':{'id':_0x1dc1aa['params']['id']}})['then'](handleEntityNotFound(_0xae74a6,null))['then'](removeEntity(_0xae74a6,null))[_0xc573('0x40')](handleError(_0xae74a6,null));};exports[_0xc573('0x48')]=function(_0x2d37f3,_0x3f8e94){return db[_0xc573('0x2b')]['describe']()[_0xc573('0x25')](respondWithResult(_0x3f8e94,null))[_0xc573('0x40')](handleError(_0x3f8e94,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e9c68b4..241c457 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89f1=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x38797b,_0x11eaef){var _0x2c0953=function(_0x50d5c4){while(--_0x50d5c4){_0x38797b['push'](_0x38797b['shift']());}};_0x2c0953(++_0x11eaef);}(_0x89f1,0x1bc));var _0x189f=function(_0x47410f,_0x53d9b2){_0x47410f=_0x47410f-0x0;var _0x272541=_0x89f1[_0x47410f];return _0x272541;};'use strict';var _=require('lodash');var util=require(_0x189f('0x0'));var logger=require(_0x189f('0x1'))(_0x189f('0x2'));var moment=require(_0x189f('0x3'));var BPromise=require(_0x189f('0x4'));var rp=require(_0x189f('0x5'));var fs=require('fs');var path=require(_0x189f('0x6'));var rimraf=require(_0x189f('0x7'));var config=require(_0x189f('0x8'));var attributes=require(_0x189f('0x9'));module[_0x189f('0xa')]=function(_0x1b730a,_0x5c78c8){return _0x1b730a['define'](_0x189f('0xb'),attributes,{'tableName':_0x189f('0xc'),'paranoid':![],'indexes':[{'name':_0x189f('0xd'),'fields':[_0x189f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3824=['path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','api','bluebird'];(function(_0x1cf67b,_0x497ea5){var _0x3ed38f=function(_0x256c2e){while(--_0x256c2e){_0x1cf67b['push'](_0x1cf67b['shift']());}};_0x3ed38f(++_0x497ea5);}(_0x3824,0x147));var _0x4382=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x3824[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0x4382('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4382('0x1'));var moment=require('moment');var BPromise=require(_0x4382('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4382('0x3'));var rimraf=require(_0x4382('0x4'));var config=require('../../config/environment');var attributes=require(_0x4382('0x5'));module[_0x4382('0x6')]=function(_0x3c675b,_0x14edd9){return _0x3c675b[_0x4382('0x7')](_0x4382('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x4382('0x9'),'fields':[_0x4382('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e8ace58..f3242f1 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf75=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4b6e1f,_0x2f71f4){var _0x20a644=function(_0x35da7f){while(--_0x35da7f){_0x4b6e1f['push'](_0x4b6e1f['shift']());}};_0x20a644(++_0x2f71f4);}(_0xaf75,0x197));var _0x5af7=function(_0x1ffcf3,_0x528637){_0x1ffcf3=_0x1ffcf3-0x0;var _0x5c3f92=_0xaf75[_0x1ffcf3];return _0x5c3f92;};'use strict';var _=require(_0x5af7('0x0'));var util=require(_0x5af7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5af7('0x2'));var fs=require('fs');var Redis=require(_0x5af7('0x3'));var db=require(_0x5af7('0x4'))['db'];var utils=require(_0x5af7('0x5'));var logger=require(_0x5af7('0x6'))(_0x5af7('0x7'));var config=require(_0x5af7('0x8'));var jayson=require(_0x5af7('0x9'));var client=jayson[_0x5af7('0xa')][_0x5af7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e4f00,_0x44ea9f,_0x2dd0cf){return new BPromise(function(_0x2f62d8,_0x5951e3){return client[_0x5af7('0xc')](_0x1e4f00,_0x2dd0cf)[_0x5af7('0xd')](function(_0x1dac97){logger[_0x5af7('0xe')](_0x5af7('0xf'),_0x44ea9f,_0x5af7('0x10'));logger[_0x5af7('0x11')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x44ea9f,'request\x20sent',JSON['stringify'](_0x1dac97));if(_0x1dac97[_0x5af7('0x12')]){if(_0x1dac97[_0x5af7('0x12')][_0x5af7('0x13')]===0x1f4){logger[_0x5af7('0x12')](_0x5af7('0xf'),_0x44ea9f,_0x1dac97[_0x5af7('0x12')][_0x5af7('0x14')]);return _0x5951e3(_0x1dac97[_0x5af7('0x12')][_0x5af7('0x14')]);}logger[_0x5af7('0x12')](_0x5af7('0xf'),_0x44ea9f,_0x1dac97['error']['message']);return _0x2f62d8(_0x1dac97[_0x5af7('0x12')][_0x5af7('0x14')]);}else{logger[_0x5af7('0xe')](_0x5af7('0xf'),_0x44ea9f,'request\x20sent');_0x2f62d8(_0x1dac97['result'][_0x5af7('0x14')]);}})['catch'](function(_0xd38e6b){logger['error'](_0x5af7('0xf'),_0x44ea9f,_0xd38e6b);_0x5951e3(_0xd38e6b);});});} \ No newline at end of file +var _0xc84d=['WhatsappTransferReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b4865,_0xb43449){var _0x190dc2=function(_0x2b41f7){while(--_0x2b41f7){_0x4b4865['push'](_0x4b4865['shift']());}};_0x190dc2(++_0xb43449);}(_0xc84d,0x114));var _0xdc84=function(_0x4456f5,_0x1b0bad){_0x4456f5=_0x4456f5-0x0;var _0x46e916=_0xc84d[_0x4456f5];return _0x46e916;};'use strict';var _=require(_0xdc84('0x0'));var util=require(_0xdc84('0x1'));var moment=require('moment');var BPromise=require(_0xdc84('0x2'));var rs=require(_0xdc84('0x3'));var fs=require('fs');var Redis=require(_0xdc84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc84('0x5'));var logger=require('../../config/logger')(_0xdc84('0x6'));var config=require(_0xdc84('0x7'));var jayson=require(_0xdc84('0x8'));var client=jayson[_0xdc84('0x9')][_0xdc84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c45f,_0x145ac9,_0x40ffcd){return new BPromise(function(_0x36c1bd,_0x2e3e36){return client['request'](_0x51c45f,_0x40ffcd)['then'](function(_0x1e40c2){logger[_0xdc84('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x145ac9,_0xdc84('0xc'));logger[_0xdc84('0xd')](_0xdc84('0xe'),_0x145ac9,_0xdc84('0xc'),JSON[_0xdc84('0xf')](_0x1e40c2));if(_0x1e40c2[_0xdc84('0x10')]){if(_0x1e40c2[_0xdc84('0x10')][_0xdc84('0x11')]===0x1f4){logger[_0xdc84('0x10')](_0xdc84('0x12'),_0x145ac9,_0x1e40c2['error'][_0xdc84('0x13')]);return _0x2e3e36(_0x1e40c2['error'][_0xdc84('0x13')]);}logger['error'](_0xdc84('0x12'),_0x145ac9,_0x1e40c2[_0xdc84('0x10')][_0xdc84('0x13')]);return _0x36c1bd(_0x1e40c2['error'][_0xdc84('0x13')]);}else{logger[_0xdc84('0xb')](_0xdc84('0x12'),_0x145ac9,'request\x20sent');_0x36c1bd(_0x1e40c2[_0xdc84('0x14')]['message']);}})['catch'](function(_0x192cb1){logger[_0xdc84('0x10')](_0xdc84('0x12'),_0x145ac9,_0x192cb1);_0x2e3e36(_0x192cb1);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 41d4d4b..98ae006 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08d9=['\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','online','Offline\x20apps:','status','join','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length'];(function(_0x330330,_0x850c46){var _0x17102f=function(_0x406648){while(--_0x406648){_0x330330['push'](_0x330330['shift']());}};_0x17102f(++_0x850c46);}(_0x08d9,0xc2));var _0x908d=function(_0x2b6f64,_0xfdce45){_0x2b6f64=_0x2b6f64-0x0;var _0x5ece01=_0x08d9[_0x2b6f64];return _0x5ece01;};'use strict';var _=require(_0x908d('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x908d('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x908d('0x2'));var config=require(_0x908d('0x3'));var logger=require(_0x908d('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x908d('0x5'));var schedule=require(_0x908d('0x6'));var chat=require(_0x908d('0x7'));var whatsapp=require(_0x908d('0x8'));var transcribe=require(_0x908d('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x908d('0xa')][_0x908d('0xb')]()[_0x908d('0xc')](function(){if(config[_0x908d('0xd')]){return seedDb[_0x908d('0xe')]();}})[_0x908d('0xc')](function(){return checkLicense[_0x908d('0xe')]();})[_0x908d('0xc')](function(){return rpc[_0x908d('0xf')]();})[_0x908d('0xc')](function(_0x570b56){logger[_0x908d('0x10')](_0x570b56);return chat[_0x908d('0x11')]();})[_0x908d('0xc')](function(){return whatsapp[_0x908d('0x11')]();})[_0x908d('0xc')](function(){return schedule['start']();})['then'](function(){return transcribe['start']();})[_0x908d('0xc')](function(){return provider[_0x908d('0x11')]();})[_0x908d('0xc')](function(_0x23d6c8){logger[_0x908d('0x10')](_0x23d6c8);return pm2[_0x908d('0x11')](pm2Config);})[_0x908d('0xc')](function(_0x4dcd6f){var _0x508b2e=_0x4dcd6f[_0x908d('0x12')](function(_0x207ac1){return typeof _0x207ac1[_0x908d('0x13')]===_0x908d('0x14')&&_0x207ac1['exitCode']>=0x0;});if(_0x508b2e['length']>0x0){throw new Error(_0x508b2e[_0x908d('0x15')]+_0x908d('0x16')+_[_0x908d('0x17')](_0x508b2e,function(_0x3f1c00){return'\x22'+_0x3f1c00['pm2_env'][_0x908d('0x18')]+'\x22';}));}logger[_0x908d('0x10')](_0x908d('0x19'),_[_0x908d('0x17')](_[_0x908d('0x12')](_0x4dcd6f,{'status':_0x908d('0x1a')}),_0x908d('0x18'))['join']());logger[_0x908d('0x10')](_0x908d('0x1b'),_[_0x908d('0x17')](_['filter'](_0x4dcd6f,function(_0x37a7b8){return _0x37a7b8[_0x908d('0x1c')]!==_0x908d('0x1a');}),_0x908d('0x18'))[_0x908d('0x1d')]()||'None');console[_0x908d('0x1e')]('App\x20Ready!');})[_0x908d('0x1f')](function(_0x10148){console[_0x908d('0x1e')](_0x908d('0x20'),_0x10148);logger[_0x908d('0x21')](_0x908d('0x22'),_0x10148);process[_0x908d('0x23')](0x1);});}main(); \ No newline at end of file +var _0x2f2e=['info','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','listen','start'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x2f2e,0x146));var _0xe2f2=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x2f2e[_0x147497];return _0x35f45;};'use strict';var _=require('lodash');var db=require(_0xe2f2('0x0'))['db'];var seedDb=require(_0xe2f2('0x1'));var checkLicense=require('./config/license');var rpc=require(_0xe2f2('0x2'));var config=require('./config/environment');var logger=require(_0xe2f2('0x3'))(_0xe2f2('0x4'));var pm2=require(_0xe2f2('0x5'));var pm2Config=require(_0xe2f2('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xe2f2('0x7'));var provider=require(_0xe2f2('0x8'));function main(){return db[_0xe2f2('0x9')][_0xe2f2('0xa')]()['then'](function(){if(config['seedDB']){return seedDb['default']();}})[_0xe2f2('0xb')](function(){return checkLicense['default']();})[_0xe2f2('0xb')](function(){return rpc[_0xe2f2('0xc')]();})[_0xe2f2('0xb')](function(_0x7ab967){logger['info'](_0x7ab967);return chat[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(){return whatsapp['start']();})[_0xe2f2('0xb')](function(){return schedule[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(){return transcribe[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(){return provider[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(_0x47525f){logger[_0xe2f2('0xe')](_0x47525f);return pm2[_0xe2f2('0xd')](pm2Config);})['then'](function(_0x3bfa74){var _0x375fc0=_0x3bfa74[_0xe2f2('0xf')](function(_0x45cd29){return typeof _0x45cd29[_0xe2f2('0x10')]==='number'&&_0x45cd29['exitCode']>=0x0;});if(_0x375fc0[_0xe2f2('0x11')]>0x0){throw new Error(_0x375fc0[_0xe2f2('0x11')]+_0xe2f2('0x12')+_['map'](_0x375fc0,function(_0x86c42b){return'\x22'+_0x86c42b[_0xe2f2('0x13')][_0xe2f2('0x14')]+'\x22';}));}logger['info'](_0xe2f2('0x15'),_[_0xe2f2('0x16')](_[_0xe2f2('0xf')](_0x3bfa74,{'status':_0xe2f2('0x17')}),_0xe2f2('0x14'))[_0xe2f2('0x18')]());logger['info'](_0xe2f2('0x19'),_[_0xe2f2('0x16')](_[_0xe2f2('0xf')](_0x3bfa74,function(_0x596dd9){return _0x596dd9[_0xe2f2('0x1a')]!==_0xe2f2('0x17');}),_0xe2f2('0x14'))[_0xe2f2('0x18')]()||_0xe2f2('0x1b'));console[_0xe2f2('0x1c')](_0xe2f2('0x1d'));})['catch'](function(_0x2d3b5d){console[_0xe2f2('0x1c')](_0xe2f2('0x1e'),_0x2d3b5d);logger[_0xe2f2('0x1f')](_0xe2f2('0x20'),_0x2d3b5d);process[_0xe2f2('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e931a12..e15b2e9 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x396b9d,_0x119344){var _0x54851=function(_0x29bc0a){while(--_0x29bc0a){_0x396b9d['push'](_0x396b9d['shift']());}};_0x54851(++_0x119344);}(_0x54ef,0x112));var _0xf54e=function(_0x5280f3,_0x13ab95){_0x5280f3=_0x5280f3-0x0;var _0xa754fe=_0x54ef[_0x5280f3];return _0xa754fe;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});} \ No newline at end of file +var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x276279,_0x3f12ce){var _0x125071=function(_0x245a60){while(--_0x245a60){_0x276279['push'](_0x276279['shift']());}};_0x125071(++_0x3f12ce);}(_0xa41a,0x6b));var _0xaa41=function(_0x16cf18,_0x248d91){_0x16cf18=_0x16cf18-0x0;var _0xe9f480=_0xa41a[_0x16cf18];return _0xe9f480;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index fbfaa1d..2f9a114 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0xc169e,_0x43573a){var _0x11077b=function(_0x4a2409){while(--_0x4a2409){_0xc169e['push'](_0xc169e['shift']());}};_0x11077b(++_0x43573a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e5608,_0x8b6979){_0x3e5608=_0x3e5608-0x0;var _0x4128d3=_0xb10b[_0x3e5608];return _0x4128d3;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file +var _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x20ae13,_0x2a0c8e){var _0x533fd5=function(_0x3bb746){while(--_0x3bb746){_0x20ae13['push'](_0x20ae13['shift']());}};_0x533fd5(++_0x2a0c8e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index b7ffdff..dd5a59f 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eb7=['keyBy','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','COUNT(*)','isEmpty','Sequelize','query','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','deletedAt','TagIds','includes','push','forEach','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.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','datetime','castTo','DATE','type','default','value','start','end','Tag','map','tags','clause','User','user','and','skip','keys','some','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','agent','getLists','c.ListId\x20IS\x20NULL','group','c.id','limit','offset','subqry.id','having','order','subqry.','DESC','findAll'];(function(_0x51d7b6,_0x3be752){var _0x3c04e4=function(_0x3ba670){while(--_0x3ba670){_0x51d7b6['push'](_0x51d7b6['shift']());}};_0x3c04e4(++_0x3be752);}(_0x1eb7,0x14a));var _0x71eb=function(_0x3d6bb0,_0x344f8b){_0x3d6bb0=_0x3d6bb0-0x0;var _0x1ac8b5=_0x1eb7[_0x3d6bb0];return _0x1ac8b5;};'use strict';var _=require('lodash');var squel=require(_0x71eb('0x0'));var as=require(_0x71eb('0x1'));var qs=require(_0x71eb('0x2'));var utils=require(_0x71eb('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x430ca7,_0x597253){var _0x178405=![];if(_0x430ca7[_0x71eb('0x4')]==='agent'&&!_0x597253[_0x71eb('0x5')]&&!_0x597253[_0x71eb('0x6')]&&_0x597253[_0x71eb('0x7')]!==_0x71eb('0x8')){_0x178405=!![];}return _0x178405;}function getContactsSubquery(){return squel['select']()[_0x71eb('0x9')](_0x71eb('0xa'),'c')[_0x71eb('0xb')](_0x71eb('0xc'));}function applyJoinClauses(_0x4d7199,_0x3181c4){var _0x16482c=_0x3181c4?'c':_0x71eb('0xd');_0x4d7199[_0x71eb('0xe')]('cm_user_has_contacts','uc',_0x71eb('0xf')+_0x16482c+_0x71eb('0x10'))['left_join'](_0x71eb('0x11'),'ct',_0x71eb('0x12')+_0x16482c+_0x71eb('0x10'))[_0x71eb('0xe')](_0x71eb('0x13'),'t',_0x71eb('0x14'));return _0x4d7199;}function addFieldsToQuery(_0x403619,_0x19cdcf,_0x2d8e26,_0x465543,_0x4dc2f){var _0x4cb863=_0x4dc2f?'c':_0x71eb('0xd');if(!_0x19cdcf){_0x19cdcf=['id',_0x71eb('0x15'),_0x71eb('0x16'),_0x71eb('0x17'),_0x71eb('0x18'),_0x71eb('0x19'),_0x71eb('0x1a'),_0x71eb('0x6'),_0x71eb('0x1b'),'createdAt','updatedAt',_0x71eb('0x1c'),_0x71eb('0x1d')];}else if(!_0x19cdcf[_0x71eb('0x1e')]('id')){_0x19cdcf[_0x71eb('0x1f')]('id');}var _0x2d8d86=_0x2d8e26&&_0x4dc2f||!_0x2d8e26&&!_0x4dc2f;if(_0x465543){_0x2d8d86=_0x465543&&_0x4dc2f||!_0x465543&&!_0x4dc2f;}_0x19cdcf[_0x71eb('0x20')](function(_0xe28e50){if(_0xe28e50===_0x71eb('0x1d')){if(_0x2d8d86){_0x403619[_0x71eb('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe28e50);}else if(_0x2d8e26||_0x465543){_0x403619[_0x71eb('0x21')](_0x4cb863+'.'+_0xe28e50);}}else{_0x403619['field'](_0x4cb863+'.'+_0xe28e50);}});return _0x403619;}function getSqlClauses(){var _0x1e3801={'default':squel[_0x71eb('0x22')](),'fields':squel[_0x71eb('0x22')](),'filter':squel[_0x71eb('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x71eb('0x22')](),'skip':![]}};return _0x1e3801;}function parseTagParameter(_0x3dad17){var _0x823cc1=squel[_0x71eb('0x22')]();if(_0x3dad17){var _0x2b5341=utils[_0x71eb('0x23')](_0x3dad17);_0x2b5341[_0x71eb('0x20')](function(_0x2e9ac9){_0x823cc1['or'](_0x71eb('0x24'),'%,'+_0x2e9ac9+',%');});}return _0x823cc1;}function parseSearchFilter(_0x2d2860){var _0x5c05b2=squel[_0x71eb('0x22')]();if(_0x2d2860){var _0x1d4b96=_0x2d2860[_0x71eb('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x1d4b96[_0x71eb('0x26')]('\x20')[_0x71eb('0x27')]>0x1){_0x5c05b2['or'](_0x71eb('0x28'),qs[_0x71eb('0x29')](_0x1d4b96),null);}else{if(qs[_0x71eb('0x2a')](_0x1d4b96)){_0x5c05b2['or'](_0x71eb('0x2b'),_0x1d4b96+'%');_0x5c05b2['or']('c.phone\x20LIKE\x20?',_0x1d4b96+'%');_0x5c05b2['or']('c.mobile\x20LIKE\x20?',_0x1d4b96+'%');_0x5c05b2['or'](_0x71eb('0x2c'),_0x1d4b96+'%');}else if(qs[_0x71eb('0x2d')](_0x1d4b96)){_0x5c05b2['or'](_0x71eb('0x2e'),_0x1d4b96+'%');}else{_0x5c05b2['or'](_0x71eb('0x2f'),'%'+_0x1d4b96+'%');_0x5c05b2['or'](_0x71eb('0x30'),'%'+_0x1d4b96+'%');_0x5c05b2['or']('c.email\x20LIKE\x20?','%'+_0x1d4b96+'%');}}}return _0x5c05b2;}function parseAdvancedSearchFilter(_0x3c4489,_0x51bc37){var _0x1b075b=getSqlClauses();var _0x3d2162=as['parseSearch'](_0x3c4489);var _0x3a50b8=_0x3d2162[_0x71eb('0x31')];for(var _0x101295=0x0;_0x101295<_0x3d2162[_0x71eb('0x32')]['length'];_0x101295++){var _0x5001f8=_0x3d2162[_0x71eb('0x32')][_0x101295];var _0x5458d3='c';var _0x181a94=_[_0x71eb('0x33')](_0x51bc37,[_0x71eb('0x34'),_0x5001f8[_0x71eb('0x21')]]);if(_0x181a94){if(_0x5001f8[_0x71eb('0x21')]==='dateOfBirth'||_0x181a94['fieldType']===_0x71eb('0x35')){_0x5001f8[_0x71eb('0x36')]=_0x71eb('0x37');}var _0x2c8b78=as['buildExpression'](_0x5458d3,_0x181a94[_0x71eb('0x38')],_0x5001f8);_0x1b075b[_0x71eb('0x39')][_0x3a50b8](_0x2c8b78['text'],_0x2c8b78[_0x71eb('0x3a')][_0x71eb('0x3b')],_0x2c8b78[_0x71eb('0x3a')][_0x71eb('0x3c')]);}else{if(_0x5001f8['field']===_0x71eb('0x3d')){var _0x5923f1=_0x5001f8[_0x71eb('0x3a')][_0x71eb('0x26')](',')[_0x71eb('0x3e')](function(_0x5ad858){return Number(_0x5ad858);});var _0xe6e0b9=parseTagParameter(_0x5923f1);_0x1b075b[_0x71eb('0x3f')][_0x71eb('0x40')]['and'](_0xe6e0b9);_0x1b075b[_0x71eb('0x3f')]['ids']=_0x5923f1;}else if(_0x5001f8[_0x71eb('0x21')]===_0x71eb('0x41')){_0x1b075b[_0x71eb('0x42')][_0x71eb('0x40')][_0x71eb('0x43')]('uc.UserId\x20=\x20?',_0x5001f8['value']);_0x1b075b[_0x71eb('0x42')][_0x71eb('0x44')]=!![];}}}return _0x1b075b;}function parseModelFields(_0x3a978d,_0x54b241){var _0x552121=squel[_0x71eb('0x22')]();var _0x156d18=_(_0x3a978d)[_0x71eb('0x45')]()[_0x71eb('0x3e')](function(_0x2d50f0){return _[_0x71eb('0x46')](_0x54b241,['name',_0x2d50f0])?_0x2d50f0:undefined;})[_0x71eb('0x47')]()[_0x71eb('0x3a')]();if(_0x3a978d[_0x71eb('0x48')]){_0x156d18[_0x71eb('0x1f')](_0x71eb('0x48'));}if(_0x156d18[_0x71eb('0x27')]>0x0){_0x156d18[_0x71eb('0x20')](function(_0x2dcef0){if(_0x2dcef0==='ListId'){_0x552121[_0x71eb('0x43')](_0x71eb('0x49'),[][_0x71eb('0x4a')](_0x3a978d[_0x2dcef0]));}else if(_0x2dcef0===_0x71eb('0x48')){var _0x35c9ce='%'+_0x3a978d[_0x2dcef0]+'%';_0x552121['and'](_0x71eb('0x4b'),_0x35c9ce);}else{_0x552121[_0x71eb('0x43')]('c.'+_0x2dcef0+_0x71eb('0x4c'),_0x3a978d[_0x2dcef0]);}});}return _0x552121;}function parseQueryParameters(_0xe5ab75,_0x38accd){var _0x112f0f=getSqlClauses();return Promise[_0x71eb('0x4d')]()[_0x71eb('0x4e')](function(){return parseModelFields(_0xe5ab75,_0x38accd);})[_0x71eb('0x4e')](function(_0xe834c1){_0x112f0f['fields']['and'](_0xe834c1);return parseTagParameter(_0xe5ab75[_0x71eb('0x4f')]);})[_0x71eb('0x4e')](function(_0x37dd71){_0x112f0f['tags']['clause']['and'](_0x37dd71);return parseSearchFilter(_0xe5ab75[_0x71eb('0x50')]);})[_0x71eb('0x4e')](function(_0x5b3b0b){_0x112f0f[_0x71eb('0x50')]=_0x5b3b0b;return _0x112f0f;});}function checkListsRestrictions(_0x57b0e6,_0x176d28,_0x1e7d10){var _0x141948=squel['expr']();return Promise['resolve']()[_0x71eb('0x4e')](function(){if(_0x176d28[_0x71eb('0x5')]&&_0x57b0e6[_0x71eb('0x4')]===_0x71eb('0x51')&&!_0x1e7d10){return _0x57b0e6[_0x71eb('0x52')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x8a4cc6){if(_0x8a4cc6){if(_0x8a4cc6['length']===0x0){_0x141948[_0x71eb('0x43')](_0x71eb('0x53'));}else{_0x141948[_0x71eb('0x43')](_0x71eb('0x49'),_[_0x71eb('0x3e')](_0x8a4cc6,'id'));}}})[_0x71eb('0x4e')](function(){return _0x141948;});}function buildContactsQuery(_0x28d833,_0x37cea4,_0x3bfb9d,_0x7a3c28,_0x39c034,_0x3ba36f){if(_0x37cea4){_0x37cea4=_0x3bfb9d['attributes'];}_0x28d833=addFieldsToQuery(_0x28d833,_0x37cea4,_0x7a3c28,_0x3ba36f,!![]);var _0x58697b=squel['select']();_0x58697b=addFieldsToQuery(_0x58697b,_0x37cea4,_0x7a3c28,_0x3ba36f,![]);if(_0x7a3c28||_0x3ba36f){_0x28d833=applyJoinClauses(_0x28d833,!![]);_0x28d833[_0x71eb('0x54')](_0x71eb('0x55'));if(_0x3bfb9d[_0x71eb('0x56')]){_0x58697b['limit'](_0x3bfb9d[_0x71eb('0x56')]);}if(_0x3bfb9d['offset']){_0x58697b['offset'](_0x3bfb9d[_0x71eb('0x57')]);}}else{_0x58697b=applyJoinClauses(_0x58697b,![]);_0x58697b[_0x71eb('0x54')](_0x71eb('0x58'));if(_0x3bfb9d[_0x71eb('0x56')]){_0x28d833['limit'](_0x3bfb9d[_0x71eb('0x56')]);}if(_0x3bfb9d[_0x71eb('0x57')]){_0x28d833['offset'](_0x3bfb9d[_0x71eb('0x57')]);}}_0x58697b[_0x71eb('0x59')](_0x39c034);if(_0x3bfb9d['order']){_0x3bfb9d[_0x71eb('0x5a')]['forEach'](function(_0x55f83c){_0x28d833[_0x71eb('0x5a')]('c.'+_0x55f83c[0x0],_0x55f83c[0x1]==='DESC'?![]:!![]);_0x58697b['order'](_0x71eb('0x5b')+_0x55f83c[0x0],_0x55f83c[0x1]===_0x71eb('0x5c')?![]:!![]);});}_0x58697b[_0x71eb('0x9')](_0x28d833,'subqry');return _0x58697b;}function getFilteredContacts(_0x24ebf3){var _0x234ae3=[];return db[_0x71eb('0x3d')][_0x71eb('0x5d')]({'attributes':['id',_0x71eb('0x34'),'color'],'raw':!![]})[_0x71eb('0x4e')](function(_0x4f52f6){_0x234ae3=_[_0x71eb('0x5e')](_0x4f52f6,'id');var _0x3a6985={'type':db['Sequelize'][_0x71eb('0x5f')][_0x71eb('0x60')],'model':db[_0x71eb('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x71eb('0x62')]['query'](_0x24ebf3[_0x71eb('0x63')](),_0x3a6985);})[_0x71eb('0x4e')](function(_0x4e1106){_0x4e1106[_0x71eb('0x20')](function(_0x454806){if(_0x454806[_0x71eb('0x1d')]){_0x454806['Tags']=[];_0x454806[_0x71eb('0x1d')][_0x71eb('0x26')](',')['forEach'](function(_0x1c798f){_0x454806[_0x71eb('0x64')][_0x71eb('0x1f')](_0x234ae3[_0x1c798f]);});}delete _0x454806[_0x71eb('0x1d')];});return _0x4e1106;});}function countFilteredContacts(_0x2eb6fd,_0x537184){var _0x200373=_0x2eb6fd['clone']();_0x200373[_0x71eb('0x21')](_0x71eb('0x65'));_0x200373=applyJoinClauses(_0x200373,!![]);_0x2eb6fd[_0x71eb('0x54')]('c.id');var _0x563961=utils[_0x71eb('0x23')](_0x537184);if(!_[_0x71eb('0x66')](_0x563961)){_0x200373[_0x71eb('0xb')]('t.id\x20IN\x20?',_0x563961);}var _0x582a5f={'type':db[_0x71eb('0x67')][_0x71eb('0x5f')][_0x71eb('0x60')],'raw':!![]};return db[_0x71eb('0x62')][_0x71eb('0x68')](_0x200373['toString'](),_0x582a5f)[_0x71eb('0x4e')](function(_0x595e5a){return _0x595e5a[0x0][_0x71eb('0x65')];});}module[_0x71eb('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x6d51=['limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','Sequelize','CmContact','sequelize','query','Tags','clone','COUNT(*)','t.id\x20IN\x20?','QueryTypes','SELECT','exports','lodash','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','cm_contacts','where','left_join','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','email','CompanyId','TagIds','includes','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','fieldType','datetime','castTo','DATE','buildExpression','type','default','start','value','end','map','tags','clause','User','and','user','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','agent','getLists','c.ListId\x20IS\x20NULL','select','group'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x6d51,0xe2));var _0x16d5=function(_0x165524,_0x1e12c5){_0x165524=_0x165524-0x0;var _0x185d38=_0x6d51[_0x165524];return _0x185d38;};'use strict';var _=require(_0x16d5('0x0'));var squel=require('squel');var as=require(_0x16d5('0x1'));var qs=require('../parsers/qs');var utils=require(_0x16d5('0x2'));var db=require(_0x16d5('0x3'))['db'];function skipContactsQuery(_0x540f21,_0x1eb3bb){var _0x17a9e3=![];if(_0x540f21[_0x16d5('0x4')]==='agent'&&!_0x1eb3bb[_0x16d5('0x5')]&&!_0x1eb3bb[_0x16d5('0x6')]&&_0x1eb3bb[_0x16d5('0x7')]!==_0x16d5('0x8')){_0x17a9e3=!![];}return _0x17a9e3;}function getContactsSubquery(){return squel['select']()['from'](_0x16d5('0x9'),'c')[_0x16d5('0xa')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0xd1030e,_0x526a46){var _0x58aa80=_0x526a46?'c':'subqry';_0xd1030e[_0x16d5('0xb')]('cm_user_has_contacts','uc',_0x16d5('0xc')+_0x58aa80+_0x16d5('0xd'))['left_join']('cm_contact_has_tags','ct',_0x16d5('0xe')+_0x58aa80+_0x16d5('0xd'))[_0x16d5('0xb')](_0x16d5('0xf'),'t',_0x16d5('0x10'));return _0xd1030e;}function addFieldsToQuery(_0x4966d6,_0xe4d32d,_0x3c0896,_0x239d05,_0x570782){var _0x2dd41a=_0x570782?'c':_0x16d5('0x11');if(!_0xe4d32d){_0xe4d32d=['id',_0x16d5('0x12'),_0x16d5('0x13'),_0x16d5('0x14'),_0x16d5('0x15'),'fax',_0x16d5('0x16'),_0x16d5('0x6'),_0x16d5('0x17'),'createdAt','updatedAt','deletedAt',_0x16d5('0x18')];}else if(!_0xe4d32d[_0x16d5('0x19')]('id')){_0xe4d32d[_0x16d5('0x1a')]('id');}var _0xca526f=_0x3c0896&&_0x570782||!_0x3c0896&&!_0x570782;if(_0x239d05){_0xca526f=_0x239d05&&_0x570782||!_0x239d05&&!_0x570782;}_0xe4d32d['forEach'](function(_0x5efa79){if(_0x5efa79===_0x16d5('0x18')){if(_0xca526f){_0x4966d6[_0x16d5('0x1b')](_0x16d5('0x1c'),_0x5efa79);}else if(_0x3c0896||_0x239d05){_0x4966d6['field'](_0x2dd41a+'.'+_0x5efa79);}}else{_0x4966d6[_0x16d5('0x1b')](_0x2dd41a+'.'+_0x5efa79);}});return _0x4966d6;}function getSqlClauses(){var _0x580917={'default':squel[_0x16d5('0x1d')](),'fields':squel[_0x16d5('0x1d')](),'filter':squel[_0x16d5('0x1d')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x580917;}function parseTagParameter(_0x2e06f8){var _0x41e7d3=squel['expr']();if(_0x2e06f8){var _0x43192f=utils[_0x16d5('0x1e')](_0x2e06f8);_0x43192f[_0x16d5('0x1f')](function(_0x457457){_0x41e7d3['or'](_0x16d5('0x20'),'%,'+_0x457457+',%');});}return _0x41e7d3;}function parseSearchFilter(_0x42262c){var _0x58b950=squel['expr']();if(_0x42262c){var _0x3eb6ff=_0x42262c[_0x16d5('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3eb6ff[_0x16d5('0x22')]('\x20')['length']>0x1){_0x58b950['or'](_0x16d5('0x23'),qs[_0x16d5('0x24')](_0x3eb6ff),null);}else{if(qs[_0x16d5('0x25')](_0x3eb6ff)){_0x58b950['or'](_0x16d5('0x26'),_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x27'),_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x28'),_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x29'),_0x3eb6ff+'%');}else if(qs['isEmail'](_0x3eb6ff)){_0x58b950['or']('c.email\x20LIKE\x20?',_0x3eb6ff+'%');}else{_0x58b950['or']('c.firstName\x20LIKE\x20?','%'+_0x3eb6ff+'%');_0x58b950['or']('c.lastName\x20LIKE\x20?','%'+_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x2a'),'%'+_0x3eb6ff+'%');}}}return _0x58b950;}function parseAdvancedSearchFilter(_0xd3f29b,_0x4e2c60){var _0x2ef336=getSqlClauses();var _0x18c718=as[_0x16d5('0x2b')](_0xd3f29b);var _0x160017=_0x18c718[_0x16d5('0x2c')];for(var _0x188d43=0x0;_0x188d43<_0x18c718[_0x16d5('0x2d')][_0x16d5('0x2e')];_0x188d43++){var _0x8e029b=_0x18c718['conditions'][_0x188d43];var _0x4624d0='c';var _0xbbe065=_[_0x16d5('0x2f')](_0x4e2c60,[_0x16d5('0x30'),_0x8e029b[_0x16d5('0x1b')]]);if(_0xbbe065){if(_0x8e029b[_0x16d5('0x1b')]==='dateOfBirth'||_0xbbe065[_0x16d5('0x31')]===_0x16d5('0x32')){_0x8e029b[_0x16d5('0x33')]=_0x16d5('0x34');}var _0x41fc2c=as[_0x16d5('0x35')](_0x4624d0,_0xbbe065[_0x16d5('0x36')],_0x8e029b);_0x2ef336[_0x16d5('0x37')][_0x160017](_0x41fc2c['text'],_0x41fc2c['value'][_0x16d5('0x38')],_0x41fc2c[_0x16d5('0x39')][_0x16d5('0x3a')]);}else{if(_0x8e029b[_0x16d5('0x1b')]==='Tag'){var _0x3547d4=_0x8e029b[_0x16d5('0x39')][_0x16d5('0x22')](',')[_0x16d5('0x3b')](function(_0x81ec77){return Number(_0x81ec77);});var _0x53d74d=parseTagParameter(_0x3547d4);_0x2ef336[_0x16d5('0x3c')][_0x16d5('0x3d')]['and'](_0x53d74d);_0x2ef336[_0x16d5('0x3c')]['ids']=_0x3547d4;}else if(_0x8e029b[_0x16d5('0x1b')]===_0x16d5('0x3e')){_0x2ef336['user'][_0x16d5('0x3d')][_0x16d5('0x3f')]('uc.UserId\x20=\x20?',_0x8e029b[_0x16d5('0x39')]);_0x2ef336[_0x16d5('0x40')][_0x16d5('0x41')]=!![];}}}return _0x2ef336;}function parseModelFields(_0xca9e4d,_0x51f276){var _0x31d31c=squel[_0x16d5('0x1d')]();var _0x3c5b0a=_(_0xca9e4d)[_0x16d5('0x42')]()[_0x16d5('0x3b')](function(_0x266c90){return _[_0x16d5('0x43')](_0x51f276,[_0x16d5('0x30'),_0x266c90])?_0x266c90:undefined;})[_0x16d5('0x44')]()[_0x16d5('0x39')]();if(_0xca9e4d['Contact']){_0x3c5b0a['push'](_0x16d5('0x45'));}if(_0x3c5b0a[_0x16d5('0x2e')]>0x0){_0x3c5b0a[_0x16d5('0x1f')](function(_0x18f8dc){if(_0x18f8dc===_0x16d5('0x6')){_0x31d31c[_0x16d5('0x3f')](_0x16d5('0x46'),[][_0x16d5('0x47')](_0xca9e4d[_0x18f8dc]));}else if(_0x18f8dc==='Contact'){var _0x557102='%'+_0xca9e4d[_0x18f8dc]+'%';_0x31d31c[_0x16d5('0x3f')](_0x16d5('0x48'),_0x557102);}else{_0x31d31c[_0x16d5('0x3f')]('c.'+_0x18f8dc+_0x16d5('0x49'),_0xca9e4d[_0x18f8dc]);}});}return _0x31d31c;}function parseQueryParameters(_0x5cb90a,_0x222159){var _0x469e6e=getSqlClauses();return Promise[_0x16d5('0x4a')]()[_0x16d5('0x4b')](function(){return parseModelFields(_0x5cb90a,_0x222159);})[_0x16d5('0x4b')](function(_0x414979){_0x469e6e[_0x16d5('0x4c')][_0x16d5('0x3f')](_0x414979);return parseTagParameter(_0x5cb90a[_0x16d5('0x4d')]);})['then'](function(_0x392a79){_0x469e6e[_0x16d5('0x3c')][_0x16d5('0x3d')][_0x16d5('0x3f')](_0x392a79);return parseSearchFilter(_0x5cb90a['filter']);})[_0x16d5('0x4b')](function(_0x271cb4){_0x469e6e['filter']=_0x271cb4;return _0x469e6e;});}function checkListsRestrictions(_0x5f5c6c,_0xfdce15,_0xeb6c44){var _0x492bd4=squel[_0x16d5('0x1d')]();return Promise[_0x16d5('0x4a')]()['then'](function(){if(_0xfdce15[_0x16d5('0x5')]&&_0x5f5c6c[_0x16d5('0x4')]===_0x16d5('0x4e')&&!_0xeb6c44){return _0x5f5c6c[_0x16d5('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0x16d5('0x4b')](function(_0x66ba49){if(_0x66ba49){if(_0x66ba49[_0x16d5('0x2e')]===0x0){_0x492bd4[_0x16d5('0x3f')](_0x16d5('0x50'));}else{_0x492bd4[_0x16d5('0x3f')]('c.ListId\x20IN\x20?',_['map'](_0x66ba49,'id'));}}})['then'](function(){return _0x492bd4;});}function buildContactsQuery(_0xb3cbad,_0x53edbc,_0x5bc27c,_0x1175e2,_0x51e561,_0x43cef7){if(_0x53edbc){_0x53edbc=_0x5bc27c['attributes'];}_0xb3cbad=addFieldsToQuery(_0xb3cbad,_0x53edbc,_0x1175e2,_0x43cef7,!![]);var _0x2d5d8e=squel[_0x16d5('0x51')]();_0x2d5d8e=addFieldsToQuery(_0x2d5d8e,_0x53edbc,_0x1175e2,_0x43cef7,![]);if(_0x1175e2||_0x43cef7){_0xb3cbad=applyJoinClauses(_0xb3cbad,!![]);_0xb3cbad[_0x16d5('0x52')]('c.id');if(_0x5bc27c[_0x16d5('0x53')]){_0x2d5d8e[_0x16d5('0x53')](_0x5bc27c[_0x16d5('0x53')]);}if(_0x5bc27c[_0x16d5('0x54')]){_0x2d5d8e['offset'](_0x5bc27c[_0x16d5('0x54')]);}}else{_0x2d5d8e=applyJoinClauses(_0x2d5d8e,![]);_0x2d5d8e[_0x16d5('0x52')](_0x16d5('0x55'));if(_0x5bc27c[_0x16d5('0x53')]){_0xb3cbad[_0x16d5('0x53')](_0x5bc27c[_0x16d5('0x53')]);}if(_0x5bc27c[_0x16d5('0x54')]){_0xb3cbad[_0x16d5('0x54')](_0x5bc27c[_0x16d5('0x54')]);}}_0x2d5d8e[_0x16d5('0x56')](_0x51e561);if(_0x5bc27c[_0x16d5('0x57')]){_0x5bc27c[_0x16d5('0x57')][_0x16d5('0x1f')](function(_0x40c4a4){_0xb3cbad[_0x16d5('0x57')]('c.'+_0x40c4a4[0x0],_0x40c4a4[0x1]===_0x16d5('0x58')?![]:!![]);_0x2d5d8e[_0x16d5('0x57')](_0x16d5('0x59')+_0x40c4a4[0x0],_0x40c4a4[0x1]==='DESC'?![]:!![]);});}_0x2d5d8e['from'](_0xb3cbad,_0x16d5('0x11'));return _0x2d5d8e;}function getFilteredContacts(_0x5902cb){var _0x4f66ac=[];return db[_0x16d5('0x5a')][_0x16d5('0x5b')]({'attributes':['id',_0x16d5('0x30'),'color'],'raw':!![]})[_0x16d5('0x4b')](function(_0x5d6c82){_0x4f66ac=_['keyBy'](_0x5d6c82,'id');var _0x405905={'type':db[_0x16d5('0x5c')]['QueryTypes']['SELECT'],'model':db[_0x16d5('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x16d5('0x5e')][_0x16d5('0x5f')](_0x5902cb['toString'](),_0x405905);})[_0x16d5('0x4b')](function(_0x1bee1b){_0x1bee1b[_0x16d5('0x1f')](function(_0x5ab336){if(_0x5ab336[_0x16d5('0x18')]){_0x5ab336['Tags']=[];_0x5ab336[_0x16d5('0x18')][_0x16d5('0x22')](',')[_0x16d5('0x1f')](function(_0x2cbaec){_0x5ab336[_0x16d5('0x60')][_0x16d5('0x1a')](_0x4f66ac[_0x2cbaec]);});}delete _0x5ab336[_0x16d5('0x18')];});return _0x1bee1b;});}function countFilteredContacts(_0x2eb7a0,_0x241919){var _0x5494dc=_0x2eb7a0[_0x16d5('0x61')]();_0x5494dc['field'](_0x16d5('0x62'));_0x5494dc=applyJoinClauses(_0x5494dc,!![]);_0x2eb7a0[_0x16d5('0x52')]('c.id');var _0x162f17=utils['getSelectedTags'](_0x241919);if(!_['isEmpty'](_0x162f17)){_0x5494dc[_0x16d5('0xa')](_0x16d5('0x63'),_0x162f17);}var _0x2f6b62={'type':db['Sequelize'][_0x16d5('0x64')][_0x16d5('0x65')],'raw':!![]};return db[_0x16d5('0x5e')][_0x16d5('0x5f')](_0x5494dc['toString'](),_0x2f6b62)[_0x16d5('0x4b')](function(_0x1208e0){return _0x1208e0[0x0][_0x16d5('0x62')];});}module[_0x16d5('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 975af6e..0e6a0cb 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f98=['createDecipher','data','close','unlink','encryptString','secret','utf8','decryptString','base64','crypto','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','end','final','write','decryptFile'];(function(_0x3b138b,_0x292247){var _0x2e67a9=function(_0x4c5cdb){while(--_0x4c5cdb){_0x3b138b['push'](_0x3b138b['shift']());}};_0x2e67a9(++_0x292247);}(_0x0f98,0xae));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x80f9('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x80f9('0x1'));var config=require(_0x80f9('0x2'));var logger=require('../../config/logger')(_0x80f9('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x80f9('0x4')]['session'],'algorithm':_0x80f9('0x5')};const fileOptions={'algorithm':_0x80f9('0x6')};if(config[_0x80f9('0x7')]&&config[_0x80f9('0x7')][_0x80f9('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x80f9('0x8')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x80f9('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x80f9('0x7')]['algorithm'],_0x80f9('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0xa7a5bc){return AES_SUPPORTED_RX[_0x80f9('0xa')](_0xa7a5bc);}function getSupportedCiphers(){return crypto[_0x80f9('0xb')]()[_0x80f9('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x24d1e7){return getSupportedCiphers()['indexOf'](_0x24d1e7)>-0x1;}function combineOptions(_0x180af5){var _0x38f9a9={};for(var _0x189ed2 in fileOptions){if(fileOptions[_0x80f9('0xd')](_0x189ed2)){_0x38f9a9[_0x189ed2]=fileOptions[_0x189ed2];}}if(_0x180af5){for(var _0x457ada in _0x180af5){if(_0x180af5[_0x80f9('0xd')](_0x457ada)){_0x38f9a9[_0x457ada]=_0x180af5[_0x457ada];}}}return _0x38f9a9;}exports[_0x80f9('0xe')]=function(_0x199494,_0x34b522,_0xf67313,_0x596d89){return new BPromise(function(_0x3921a2,_0x33110f){_0x596d89=combineOptions(_0x596d89);var _0x5acb35=new Buffer(_0xf67313);var _0x33b1ec=fs[_0x80f9('0xf')](_0x199494);var _0x15c43a=fs[_0x80f9('0x10')](_0x34b522);var _0x2886a7=crypto[_0x80f9('0x11')](_0x596d89[_0x80f9('0x8')],_0x5acb35);_0x33b1ec['on']('data',function(_0x592fb3){var _0xaf87c8=new Buffer(_0x2886a7[_0x80f9('0x12')](_0x592fb3),_0x80f9('0x13'));_0x15c43a['write'](_0xaf87c8);});_0x33b1ec['on'](_0x80f9('0x14'),function(){try{var _0x300970=new Buffer(_0x2886a7[_0x80f9('0x15')](_0x80f9('0x13')),'binary');_0x15c43a[_0x80f9('0x16')](_0x300970);_0x15c43a[_0x80f9('0x14')]();_0x15c43a['on']('close',function(){return _0x3921a2(_0x34b522);});}catch(_0x3a8b39){fs['unlink'](_0x34b522);return _0x33110f(_0x3a8b39);}});});};exports[_0x80f9('0x17')]=function(_0x11cdf7,_0x2b57e4,_0x299261,_0x127d02){return new BPromise(function(_0x168950,_0x4f7a4c){_0x127d02=combineOptions(_0x127d02);var _0x26d6dc=new Buffer(_0x299261);var _0x17fe4f=fs['createReadStream'](_0x11cdf7);var _0x4cebda=fs[_0x80f9('0x10')](_0x2b57e4);var _0x33efbf=crypto[_0x80f9('0x18')](_0x127d02[_0x80f9('0x8')],_0x26d6dc);_0x17fe4f['on'](_0x80f9('0x19'),function(_0x136e63){var _0x3fe829=new Buffer(_0x33efbf[_0x80f9('0x12')](_0x136e63),_0x80f9('0x13'));_0x4cebda[_0x80f9('0x16')](_0x3fe829);});_0x17fe4f['on']('end',function(){try{var _0x9fc964=new Buffer(_0x33efbf[_0x80f9('0x15')]('binary'),_0x80f9('0x13'));_0x4cebda[_0x80f9('0x16')](_0x9fc964);_0x4cebda[_0x80f9('0x14')]();_0x4cebda['on'](_0x80f9('0x1a'),function(){return _0x168950(_0x2b57e4);});}catch(_0x478d03){fs[_0x80f9('0x1b')](_0x2b57e4);return _0x4f7a4c(_0x478d03);}});});};exports[_0x80f9('0x1c')]=function(_0x138d85,_0x5880f4,_0x460eb7){var _0x2da8f5=_0x460eb7||stringOptions['algorithm'];var _0x3276af=_0x5880f4||stringOptions[_0x80f9('0x1d')];var _0x518a92=crypto[_0x80f9('0x11')](_0x2da8f5,_0x3276af);var _0xf1d20b=_0x518a92[_0x80f9('0x12')](_0x138d85,_0x80f9('0x1e'),'base64');_0xf1d20b+=_0x518a92[_0x80f9('0x15')]('base64');return _0xf1d20b;};exports[_0x80f9('0x1f')]=function(_0x244ce5,_0x41879b,_0x1acdce){var _0x49bf9a=_0x1acdce||stringOptions[_0x80f9('0x8')];var _0x2e2eaa=_0x41879b||stringOptions[_0x80f9('0x1d')];var _0xf0ee9c=crypto[_0x80f9('0x18')](_0x49bf9a,_0x2e2eaa);var _0x5d26cf=_0xf0ee9c[_0x80f9('0x12')](_0x244ce5,_0x80f9('0x20'),_0x80f9('0x1e'));_0x5d26cf+=_0xf0ee9c['final']('utf8');return _0x5d26cf;}; \ No newline at end of file +var _0x6360=['app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write','end','final','close','decryptFile','createDecipher','unlink','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger'];(function(_0x13db07,_0x590761){var _0x358fba=function(_0x74b668){while(--_0x74b668){_0x13db07['push'](_0x13db07['shift']());}};_0x358fba(++_0x590761);}(_0x6360,0x150));var _0x0636=function(_0xadb6f3,_0x222be7){_0xadb6f3=_0xadb6f3-0x0;var _0x137807=_0x6360[_0xadb6f3];return _0x137807;};'use strict';var crypto=require(_0x0636('0x0'));var fs=require('fs');var BPromise=require(_0x0636('0x1'));var _=require(_0x0636('0x2'));var config=require('../../config/environment');var logger=require(_0x0636('0x3'))(_0x0636('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0636('0x5')]['session'],'algorithm':_0x0636('0x6')};const fileOptions={'algorithm':_0x0636('0x7')};if(config[_0x0636('0x8')]&&config['encrypt'][_0x0636('0x9')]){var isSupported=isAlgorithmSupported(config[_0x0636('0x8')][_0x0636('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x0636('0x8')][_0x0636('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0636('0xa')](',\x20');logger[_0x0636('0xb')](config[_0x0636('0x8')][_0x0636('0x9')],_0x0636('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1f11e6){return AES_SUPPORTED_RX[_0x0636('0xd')](_0x1f11e6);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x0636('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x334c4f){return getSupportedCiphers()[_0x0636('0xf')](_0x334c4f)>-0x1;}function combineOptions(_0xb83c11){var _0x812c58={};for(var _0x4033fc in fileOptions){if(fileOptions['hasOwnProperty'](_0x4033fc)){_0x812c58[_0x4033fc]=fileOptions[_0x4033fc];}}if(_0xb83c11){for(var _0x45a96f in _0xb83c11){if(_0xb83c11[_0x0636('0x10')](_0x45a96f)){_0x812c58[_0x45a96f]=_0xb83c11[_0x45a96f];}}}return _0x812c58;}exports['encryptFile']=function(_0x443009,_0x527d30,_0x306a00,_0x462abc){return new BPromise(function(_0x419c7f,_0x5c525f){_0x462abc=combineOptions(_0x462abc);var _0x578bed=new Buffer(_0x306a00);var _0x2354eb=fs['createReadStream'](_0x443009);var _0x16a4bd=fs[_0x0636('0x11')](_0x527d30);var _0x3b417f=crypto[_0x0636('0x12')](_0x462abc[_0x0636('0x9')],_0x578bed);_0x2354eb['on'](_0x0636('0x13'),function(_0x3181fe){var _0x1858a3=new Buffer(_0x3b417f[_0x0636('0x14')](_0x3181fe),_0x0636('0x15'));_0x16a4bd[_0x0636('0x16')](_0x1858a3);});_0x2354eb['on'](_0x0636('0x17'),function(){try{var _0x418932=new Buffer(_0x3b417f[_0x0636('0x18')](_0x0636('0x15')),'binary');_0x16a4bd[_0x0636('0x16')](_0x418932);_0x16a4bd['end']();_0x16a4bd['on'](_0x0636('0x19'),function(){return _0x419c7f(_0x527d30);});}catch(_0x1229d1){fs['unlink'](_0x527d30);return _0x5c525f(_0x1229d1);}});});};exports[_0x0636('0x1a')]=function(_0x4d5200,_0x117fcf,_0x2ed76c,_0x2518c1){return new BPromise(function(_0x3d0474,_0x2e93e0){_0x2518c1=combineOptions(_0x2518c1);var _0x4872c2=new Buffer(_0x2ed76c);var _0x4ccb91=fs['createReadStream'](_0x4d5200);var _0x2e1a70=fs[_0x0636('0x11')](_0x117fcf);var _0x5d4a58=crypto[_0x0636('0x1b')](_0x2518c1[_0x0636('0x9')],_0x4872c2);_0x4ccb91['on']('data',function(_0x2d2680){var _0x3fd118=new Buffer(_0x5d4a58['update'](_0x2d2680),_0x0636('0x15'));_0x2e1a70[_0x0636('0x16')](_0x3fd118);});_0x4ccb91['on'](_0x0636('0x17'),function(){try{var _0x1442a7=new Buffer(_0x5d4a58[_0x0636('0x18')](_0x0636('0x15')),'binary');_0x2e1a70[_0x0636('0x16')](_0x1442a7);_0x2e1a70['end']();_0x2e1a70['on']('close',function(){return _0x3d0474(_0x117fcf);});}catch(_0x4a18a3){fs[_0x0636('0x1c')](_0x117fcf);return _0x2e93e0(_0x4a18a3);}});});};exports[_0x0636('0x1d')]=function(_0x2299c5,_0xcd4308,_0x1080c4){var _0x227463=_0x1080c4||stringOptions['algorithm'];var _0x512def=_0xcd4308||stringOptions[_0x0636('0x1e')];var _0xd7004f=crypto[_0x0636('0x12')](_0x227463,_0x512def);var _0x594fdd=_0xd7004f['update'](_0x2299c5,_0x0636('0x1f'),_0x0636('0x20'));_0x594fdd+=_0xd7004f[_0x0636('0x18')](_0x0636('0x20'));return _0x594fdd;};exports[_0x0636('0x21')]=function(_0x254ba5,_0x2ae224,_0x53765c){var _0x5c2a17=_0x53765c||stringOptions[_0x0636('0x9')];var _0x1c43f6=_0x2ae224||stringOptions[_0x0636('0x1e')];var _0x5cb5e1=crypto[_0x0636('0x1b')](_0x5c2a17,_0x1c43f6);var _0x193add=_0x5cb5e1[_0x0636('0x14')](_0x254ba5,_0x0636('0x20'),_0x0636('0x1f'));_0x193add+=_0x5cb5e1['final'](_0x0636('0x1f'));return _0x193add;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 09f979b..97d62dd 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd15c=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format'];(function(_0x5dec42,_0x164a15){var _0x794b12=function(_0x1d85c9){while(--_0x1d85c9){_0x5dec42['push'](_0x5dec42['shift']());}};_0x794b12(++_0x164a15);}(_0xd15c,0x14f));var _0xcd15=function(_0x443e83,_0x456f54){_0x443e83=_0x443e83-0x0;var _0x35e701=_0xd15c[_0x443e83];return _0x35e701;};'use strict';var util=require(_0xcd15('0x0'));var path=require(_0xcd15('0x1'));var _=require(_0xcd15('0x2'));var csv=require(_0xcd15('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xcd15('0x4'));var db=require(_0xcd15('0x5'))['db'];var dbH=require('../../mysqldb')[_0xcd15('0x6')];var logger=require(_0xcd15('0x7'))(_0xcd15('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xcd15('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcd15('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb1686c,_0x36405d){var _0x370cd6={'status':_0xb1686c};var _0x58182e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36405d){_0x370cd6[_0xcd15('0xa')]=_0x36405d;}return db[_0xcd15('0xb')][_0xcd15('0xc')](_0x370cd6,_0x58182e);}function main(){var _0x4b2b34=0x1388;var _0x139f4d;logger[_0xcd15('0xd')](util[_0xcd15('0xe')](_0xcd15('0xf'),EXTRACTED_REPORT_ID,_0xcd15('0x10')));return db[_0xcd15('0x11')][_0xcd15('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcd15('0x13'),_0xcd15('0x14')]})['then'](function(_0x32b33e){if(_0x32b33e){_0x139f4d=_0x32b33e;_0x4b2b34=_0x139f4d[_0xcd15('0x14')]||0x1388;}})[_0xcd15('0x15')](function(){return dbH[_0xcd15('0x16')]['query'](util['format'](_0xcd15('0x17'),QUERY),{'type':dbH[_0xcd15('0x16')][_0xcd15('0x18')][_0xcd15('0x19')]});})[_0xcd15('0x15')](function(_0xc929fa){if(!_0xc929fa[0x0][_0xcd15('0x1a')]){return analyticExtractedReport(_0xcd15('0x1b'));}var _0xe683f2=[];var _0x752782=0x0;if(_0x139f4d[_0xcd15('0x13')]){if(_0xc929fa&&_0xc929fa[_0xcd15('0x1c')]){var _0x57b196=_['range'](_0xc929fa[0x0][_0xcd15('0x1a')]/_0x4b2b34);var _0x1b54eb=Number[_0xcd15('0x1d')](_0xc929fa[0x0][_0xcd15('0x1a')]/_0x4b2b34)?_0xc929fa[0x0][_0xcd15('0x1a')]%_0x4b2b34:0x0;_0x57b196[_0xcd15('0x1e')](function(_0x3361b7){if(_0x3361b7>0x0){_0x752782+=_0x4b2b34;}_0xe683f2[_0xcd15('0x1f')](dbH[_0xcd15('0x16')]['query'](util[_0xcd15('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4b2b34,_0x752782),{'type':dbH[_0xcd15('0x16')][_0xcd15('0x18')][_0xcd15('0x19')]}));});if(_0x1b54eb>0x0){_0x752782+=_0x4b2b34;_0xe683f2[_0xcd15('0x1f')](dbH['sequelize'][_0xcd15('0x20')](util[_0xcd15('0xe')](_0xcd15('0x21'),QUERY,_0x1b54eb,_0x752782),{'type':dbH[_0xcd15('0x16')][_0xcd15('0x18')][_0xcd15('0x19')]}));}}}else{_0xe683f2['push'](dbH['sequelize'][_0xcd15('0x20')](QUERY,{'type':dbH[_0xcd15('0x16')]['QueryTypes'][_0xcd15('0x19')]}));}var _0x436e3f=path['dirname'](PATH);var _0x2f48ba=path[_0xcd15('0x22')](PATH,_0xcd15('0x23'));var _0x4ac9fd=_0x139f4d['split']&&_0xe683f2[_0xcd15('0x1c')]>0x1;var _0x299bf2=[];if(!fs[_0xcd15('0x24')](path[_0xcd15('0x25')](_0x436e3f,_0x2f48ba))&&_0x4ac9fd){fs[_0xcd15('0x26')](path[_0xcd15('0x25')](_0x436e3f,_0x2f48ba));}return BPromise['each'](_0xe683f2,function(_0x4ca87e){_0x299bf2[_0xcd15('0x1f')](_0x4ca87e);})['then'](function(){for(var _0x4d800f=0x0;_0x4d800f<_0x299bf2['length'];_0x4d800f+=0x1){var _0x159f43;var _0x17d27c=_0x299bf2[_0x4d800f];if(_0x4ac9fd){_0x159f43=path[_0xcd15('0x25')](_0x436e3f,_0x2f48ba,util[_0xcd15('0xe')](_0xcd15('0x27'),_0x2f48ba,_0x4d800f,_0xcd15('0x28')));}else{_0x159f43=path[_0xcd15('0x25')](_0x436e3f,util[_0xcd15('0xe')](_0xcd15('0x29'),_0x2f48ba,_0xcd15('0x28')));}fs[_0xcd15('0x2a')](_0x159f43,csv(_0x17d27c));}})['then'](function(){if(_0x4ac9fd){return new Promise(function(_0x3bb33e){zipdir(path[_0xcd15('0x25')](_0x436e3f,_0x2f48ba),{'saveTo':path[_0xcd15('0x25')](_0x436e3f,util['format'](_0xcd15('0x29'),_0x2f48ba,_0xcd15('0x2b')))},function(_0x1f801d,_0x361111){rimraf(path[_0xcd15('0x25')](_0x436e3f,_0x2f48ba),function(){});_0x3bb33e('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0xcd15('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcd15('0x10')));return analyticExtractedReport(_0xcd15('0x2c'),_0x4ac9fd?util[_0xcd15('0xe')]('%s.%s',_0x2f48ba,_0x4ac9fd?'zip':'csv'):null);});})['catch'](function(_0x2e0a03){logger[_0xcd15('0xd')](util[_0xcd15('0xe')](_0xcd15('0x2d'),EXTRACTED_REPORT_ID,_0xcd15('0x10')),util[_0xcd15('0x2e')](_0x2e0a03,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcd15('0x2f'));})[_0xcd15('0x30')](function(){process[_0xcd15('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8d4d=['Failed','finally','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV','Setting','find','splitSizeCsv','then','sequelize','format','QueryTypes','SELECT','Empty','length','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','split','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3b9ec3,_0xc931a9){var _0x36f5e3=function(_0x27bacf){while(--_0x27bacf){_0x3b9ec3['push'](_0x3b9ec3['shift']());}};_0x36f5e3(++_0xc931a9);}(_0x8d4d,0xbe));var _0xd8d4=function(_0x23332e,_0x333733){_0x23332e=_0x23332e-0x0;var _0x1742c7=_0x8d4d[_0x23332e];return _0x1742c7;};'use strict';var util=require(_0xd8d4('0x0'));var path=require(_0xd8d4('0x1'));var _=require(_0xd8d4('0x2'));var csv=require(_0xd8d4('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xd8d4('0x4'));var rimraf=require(_0xd8d4('0x5'));var db=require(_0xd8d4('0x6'))['db'];var dbH=require(_0xd8d4('0x6'))['dbH'];var logger=require('../../config/logger')(_0xd8d4('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xd8d4('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd8d4('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8ca02d,_0x332745){var _0x1a9b58={'status':_0x8ca02d};var _0x4199ed={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x332745){_0x1a9b58[_0xd8d4('0x9')]=_0x332745;}return db[_0xd8d4('0xa')][_0xd8d4('0xb')](_0x1a9b58,_0x4199ed);}function main(){var _0xc6f64a=0x1388;var _0x55d0f9;logger[_0xd8d4('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd8d4('0xd')));return db[_0xd8d4('0xe')][_0xd8d4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd8d4('0x10')]})[_0xd8d4('0x11')](function(_0x54ad28){if(_0x54ad28){_0x55d0f9=_0x54ad28;_0xc6f64a=_0x55d0f9[_0xd8d4('0x10')]||0x1388;}})[_0xd8d4('0x11')](function(){return dbH[_0xd8d4('0x12')]['query'](util[_0xd8d4('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd8d4('0x12')][_0xd8d4('0x14')][_0xd8d4('0x15')]});})[_0xd8d4('0x11')](function(_0x1bf434){if(!_0x1bf434[0x0]['num']){return analyticExtractedReport(_0xd8d4('0x16'));}var _0x130b0c=[];var _0xba437c=0x0;if(_0x55d0f9['split']){if(_0x1bf434&&_0x1bf434[_0xd8d4('0x17')]){var _0x3c186e=_['range'](_0x1bf434[0x0][_0xd8d4('0x18')]/_0xc6f64a);var _0x57fe2c=Number[_0xd8d4('0x19')](_0x1bf434[0x0][_0xd8d4('0x18')]/_0xc6f64a)?_0x1bf434[0x0][_0xd8d4('0x18')]%_0xc6f64a:0x0;_0x3c186e[_0xd8d4('0x1a')](function(_0x1b0cbf){if(_0x1b0cbf>0x0){_0xba437c+=_0xc6f64a;}_0x130b0c[_0xd8d4('0x1b')](dbH[_0xd8d4('0x12')][_0xd8d4('0x1c')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xc6f64a,_0xba437c),{'type':dbH[_0xd8d4('0x12')]['QueryTypes']['SELECT']}));});if(_0x57fe2c>0x0){_0xba437c+=_0xc6f64a;_0x130b0c[_0xd8d4('0x1b')](dbH['sequelize']['query'](util[_0xd8d4('0x13')](_0xd8d4('0x1d'),QUERY,_0x57fe2c,_0xba437c),{'type':dbH[_0xd8d4('0x12')][_0xd8d4('0x14')][_0xd8d4('0x15')]}));}}}else{_0x130b0c[_0xd8d4('0x1b')](dbH[_0xd8d4('0x12')][_0xd8d4('0x1c')](QUERY,{'type':dbH[_0xd8d4('0x12')][_0xd8d4('0x14')][_0xd8d4('0x15')]}));}var _0x3f1bf7=path[_0xd8d4('0x1e')](PATH);var _0x2bc397=path['basename'](PATH,_0xd8d4('0x1f'));var _0x589455=_0x55d0f9[_0xd8d4('0x20')]&&_0x130b0c[_0xd8d4('0x17')]>0x1;var _0x2aa1a0=[];if(!fs[_0xd8d4('0x21')](path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397))&&_0x589455){fs[_0xd8d4('0x23')](path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397));}return BPromise[_0xd8d4('0x24')](_0x130b0c,function(_0x2f3501){_0x2aa1a0['push'](_0x2f3501);})['then'](function(){for(var _0x3d9e3a=0x0;_0x3d9e3a<_0x2aa1a0['length'];_0x3d9e3a+=0x1){var _0x322834;var _0x13d939=_0x2aa1a0[_0x3d9e3a];if(_0x589455){_0x322834=path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397,util['format'](_0xd8d4('0x25'),_0x2bc397,_0x3d9e3a,_0xd8d4('0x26')));}else{_0x322834=path[_0xd8d4('0x22')](_0x3f1bf7,util[_0xd8d4('0x13')](_0xd8d4('0x27'),_0x2bc397,_0xd8d4('0x26')));}fs[_0xd8d4('0x28')](_0x322834,csv(_0x13d939));}})[_0xd8d4('0x11')](function(){if(_0x589455){return new Promise(function(_0x2750ef){zipdir(path['join'](_0x3f1bf7,_0x2bc397),{'saveTo':path[_0xd8d4('0x22')](_0x3f1bf7,util['format'](_0xd8d4('0x27'),_0x2bc397,_0xd8d4('0x29')))},function(_0x23a3f6,_0x357f57){rimraf(path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397),function(){});_0x2750ef(_0xd8d4('0x2a'));});});}})[_0xd8d4('0x11')](function(){logger['info'](util[_0xd8d4('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd8d4('0x2b'),_0x589455?util[_0xd8d4('0x13')](_0xd8d4('0x27'),_0x2bc397,_0x589455?_0xd8d4('0x29'):'csv'):null);});})['catch'](function(_0x5d411c){logger[_0xd8d4('0xc')](util[_0xd8d4('0x13')](_0xd8d4('0x2c'),EXTRACTED_REPORT_ID,_0xd8d4('0xd')),util['inspect'](_0x5d411c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd8d4('0x2d'));})[_0xd8d4('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 1ca6be7..70f8f68 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddef=['QueryTypes','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','pick','map','value','fill','auto','body','push','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','toString','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','length','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.pdf','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x557497,_0x4ca1f0){var _0x452046=function(_0x6d8f62){while(--_0x6d8f62){_0x557497['push'](_0x557497['shift']());}};_0x452046(++_0x4ca1f0);}(_0xddef,0x70));var _0xfdde=function(_0x1b5df2,_0x48f81c){_0x1b5df2=_0x1b5df2-0x0;var _0x2b34af=_0xddef[_0x1b5df2];return _0x2b34af;};'use strict';var _=require(_0xfdde('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xfdde('0x1'));var moment=require(_0xfdde('0x2'));var htmlToPdfmake=require(_0xfdde('0x3'));var PdfPrinter=require(_0xfdde('0x4'));var zipdir=require(_0xfdde('0x5'));var rimraf=require(_0xfdde('0x6'));var JSDOM=require(_0xfdde('0x7'))['JSDOM'];var window=new JSDOM('')[_0xfdde('0x8')];var BPromise=require('bluebird');var db=require(_0xfdde('0x9'))['db'];var dbH=require('../../mysqldb')[_0xfdde('0xa')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xfdde('0xb')][0x2]);var QUERY=process[_0xfdde('0xb')][0x3];var PATH=process[_0xfdde('0xb')][0x4];var NAME=process[_0xfdde('0xb')][0x5];var FORMAT=_0xfdde('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x58f2fa,_0x5e0c6e){var _0x553c85={'status':_0x58f2fa};var _0x19a736={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e0c6e){_0x553c85[_0xfdde('0xd')]=_0x5e0c6e;}return db[_0xfdde('0xe')]['update'](_0x553c85,_0x19a736);}function getHeaders(_0x4726d6){return _['map'](_0x4726d6,function(_0x1f6e88){return{'text':_0x1f6e88,'style':_0xfdde('0xf')};});}function getRows(_0x2750fc,_0x29052f){return _['map'](_0x29052f,function(_0x3b4129){return _(_0x3b4129)[_0xfdde('0x10')](_0x2750fc)[_0xfdde('0x11')](function(_0x329207){return _0x329207?_['toString'](_0x329207):'';})[_0xfdde('0x12')]();});}function createTable(_0x4035d2,_0x539ffe){var _0x233bac={'widths':_[_0xfdde('0x13')](Array(_0x4035d2['length']),0x91),'heights':function(_0x3b38e9){return _0x3b38e9===0x0?_0xfdde('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2ffead=getHeaders(_0x4035d2);_0x233bac[_0xfdde('0x15')][_0xfdde('0x16')](_0x2ffead);var _0x201770=getRows(_0x4035d2,_0x539ffe);_0x233bac['body']=_0x233bac[_0xfdde('0x15')]['concat'](_0x201770);return _0x233bac;}function createTables(_0xaeb976){var _0x23e16a=[];var _0x2442f0=_[_0xfdde('0x17')](Object['keys'](_0xaeb976[0x0]),0x5);_0x2442f0[_0xfdde('0x18')](function(_0x900f5f){_0x23e16a[_0xfdde('0x16')](createTable(_0x900f5f,_0xaeb976));});return _0x23e16a;}function getPDFDocDefinition(_0x10c6a2){var _0x525490=util[_0xfdde('0x19')](_0xfdde('0x1a'),NAME,EXTRACTED_REPORT[_0xfdde('0x1b')],moment(EXTRACTED_REPORT[_0xfdde('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xfdde('0x1d')])[_0xfdde('0x19')](FORMAT));var _0x40b04d=[];for(var _0x1198a7=0x0;_0x1198a7<_0x10c6a2['length'];_0x1198a7++){var _0x13b1df=[];if(_0x1198a7===0x0){_0x13b1df['push']({'text':_0x525490,'style':_0xfdde('0x1e')});}var _0x348866={'table':_0x10c6a2[_0x1198a7]};if(_0x1198a7>0x0){_0x348866[_0xfdde('0x1f')]=_0xfdde('0x20');_0x348866[_0xfdde('0x21')]=[0x0,0x46,0x0,0x0];}_0x13b1df[_0xfdde('0x16')](_0x348866);_0x40b04d[_0xfdde('0x16')](_0x13b1df);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x40b04d,'footer':function(_0x372568,_0x20414a){return{'text':_0x372568[_0xfdde('0x22')]()+_0xfdde('0x23')+_0x20414a,'style':_0xfdde('0x24')};},'defaultStyle':{'font':_0xfdde('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xfdde('0x26')},'footer':{'alignment':_0xfdde('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x37a56f){var _0xfdddb5=0x1388;var _0x46e46d;if(!_0x37a56f[0x0][_0xfdde('0x28')]){return analyticExtractedReport(_0xfdde('0x29'));}return db[_0xfdde('0x2a')][_0xfdde('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfdde('0x2c'),_0xfdde('0x2d')]})[_0xfdde('0x2e')](function(_0x210c42){if(_0x210c42){_0x46e46d=_0x210c42;_0xfdddb5=_0x46e46d['splitSizePdf']||0x3e8;}})[_0xfdde('0x2e')](function(){var _0x32a5a1=[];var _0x28113e=0x0;if(_0x46e46d['split']){if(_0x37a56f&&_0x37a56f[_0xfdde('0x2f')]){var _0x582ea7=_['range'](_0x37a56f[0x0]['num']/_0xfdddb5);var _0x1c033c=Number[_0xfdde('0x30')](_0x37a56f[0x0][_0xfdde('0x28')]/_0xfdddb5)?_0x37a56f[0x0][_0xfdde('0x28')]%_0xfdddb5:0x0;_0x582ea7['forEach'](function(_0x4625c7){if(_0x4625c7>0x0){_0x28113e+=_0xfdddb5;}_0x32a5a1[_0xfdde('0x16')](dbH[_0xfdde('0x31')][_0xfdde('0x32')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xfdddb5,_0x28113e),{'type':dbH[_0xfdde('0x31')]['QueryTypes']['SELECT']}));});if(_0x1c033c>0x0){_0x28113e+=_0xfdddb5;_0x32a5a1[_0xfdde('0x16')](dbH[_0xfdde('0x31')][_0xfdde('0x32')](util[_0xfdde('0x19')](_0xfdde('0x33'),QUERY,_0x1c033c,_0x28113e),{'type':dbH[_0xfdde('0x31')]['QueryTypes'][_0xfdde('0x34')]}));}}}else{_0x32a5a1[_0xfdde('0x16')](dbH[_0xfdde('0x31')][_0xfdde('0x32')](QUERY,{'type':dbH[_0xfdde('0x31')]['QueryTypes'][_0xfdde('0x34')]}));}var _0x4dfee8=path[_0xfdde('0x35')](PATH);var _0x333de1=path[_0xfdde('0x36')](PATH,_0xfdde('0x37'));var _0x1ef852=_0x46e46d[_0xfdde('0x2c')]&&_0x32a5a1['length']>0x1;var _0x5a973b=[];if(!fs['existsSync'](path[_0xfdde('0x38')](_0x4dfee8,_0x333de1))&&_0x1ef852){fs[_0xfdde('0x39')](path[_0xfdde('0x38')](_0x4dfee8,_0x333de1));}return BPromise[_0xfdde('0x3a')](_0x32a5a1,function(_0x35c2b3){_0x5a973b['push'](_0x35c2b3);})[_0xfdde('0x2e')](function(){var _0x1d243a=[];for(var _0x19f576=0x0;_0x19f576<_0x5a973b[_0xfdde('0x2f')];_0x19f576+=0x1){var _0x3f9726=_0x5a973b[_0x19f576];var _0x16eaea=createTables(_['flatten'](_0x3f9726));var _0x3b866a;var _0x2d827d=getPDFDocDefinition(_0x16eaea);var _0x1d4b36=getPDFPrinter();var _0x41ffef=_0x1d4b36[_0xfdde('0x3b')](_0x2d827d);if(_0x1ef852){_0x3b866a=path[_0xfdde('0x38')](_0x4dfee8,_0x333de1,util[_0xfdde('0x19')](_0xfdde('0x3c'),_0x333de1,_0x19f576,_0xfdde('0x3d')));}else{_0x3b866a=path[_0xfdde('0x38')](_0x4dfee8,util['format']('%s.%s',_0x333de1,'pdf'));}_0x1d243a[_0xfdde('0x16')](writePDFDocument(_0x41ffef,_0x3b866a));}return Promise[_0xfdde('0x3e')](_0x1d243a);})[_0xfdde('0x2e')](function(){if(_0x1ef852){return new Promise(function(_0x540ecb){zipdir(path['join'](_0x4dfee8,_0x333de1),{'saveTo':path['join'](_0x4dfee8,util[_0xfdde('0x19')](_0xfdde('0x3f'),_0x333de1,_0xfdde('0x40')))},function(){rimraf(path['join'](_0x4dfee8,_0x333de1),function(){});_0x540ecb('zip\x20finished');});});}})[_0xfdde('0x2e')](function(){if(!_0x1ef852)return;rimraf(path['join'](_0x4dfee8,_0x333de1),function(){});})[_0xfdde('0x2e')](function(){logger[_0xfdde('0x41')](util['format'](_0xfdde('0x42'),EXTRACTED_REPORT_ID,_0xfdde('0x43')));return analyticExtractedReport(_0xfdde('0x44'),_0x1ef852?util['format'](_0xfdde('0x3f'),_0x333de1,_0x1ef852?'zip':_0xfdde('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xfdde('0x41')](util[_0xfdde('0x19')](_0xfdde('0x45'),EXTRACTED_REPORT_ID,_0xfdde('0x43')));return db['AnalyticExtractedReport'][_0xfdde('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xfdde('0x2e')](function(_0x43630c){EXTRACTED_REPORT=_0x43630c;return dbH[_0xfdde('0x31')]['query'](util['format'](_0xfdde('0x47'),QUERY),{'type':dbH[_0xfdde('0x31')][_0xfdde('0x48')][_0xfdde('0x34')]});})[_0xfdde('0x2e')](extractReport)[_0xfdde('0x49')](function(_0x4460a3){logger[_0xfdde('0x41')](util[_0xfdde('0x19')](_0xfdde('0x4a'),EXTRACTED_REPORT_ID,_0xfdde('0x43')),util['inspect'](_0x4460a3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfdde('0x4b'));})['finally'](function(){process[_0xfdde('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x593947=new PdfPrinter({'Arial':{'normal':__dirname+_0xfdde('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xfdde('0x4e'),'bolditalics':__dirname+_0xfdde('0x4f')}});return _0x593947;}function getPDFDocDefinitionFromHTML(_0x5ececc,_0x40ba29){var _0x5573f3=util[_0xfdde('0x19')](_0xfdde('0x50'),_0x40ba29[_0xfdde('0x51')],_0x40ba29['interactionId']);var _0x17dfbc=moment()[_0xfdde('0x19')](_0xfdde('0x52'))[_0xfdde('0x22')]();var _0x423468=htmlToPdfmake(_0x5ececc,{'window':window,'tableAutoSize':!![]});return{'content':[_0x423468],'defaultStyle':{'font':_0xfdde('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xfdde('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xfdde('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xfdde('0x53')}},'header':function(){return[{'text':_0xfdde('0x54'),'style':_0xfdde('0x1e')}];},'footer':function(_0x5251aa,_0xe401e4){return[{'text':util[_0xfdde('0x19')](_0xfdde('0x55'),_0x5573f3,_0x5251aa,_0xe401e4,_0x17dfbc),'style':_0xfdde('0x24')}];}};}function writePDFDocument(_0x1b89ff,_0x20d8ea){return new Promise(function(_0x49aae4,_0x2351b7){var _0x1c7b53=_0x1b89ff[_0xfdde('0x56')](fs[_0xfdde('0x57')](_0x20d8ea));_0x1c7b53['on'](_0xfdde('0x58'),function(){_0x49aae4(_0xfdde('0x58'));});_0x1c7b53['on'](_0xfdde('0x59'),function(_0x1d9519){_0x2351b7(_0x1d9519);});_0x1b89ff[_0xfdde('0x5a')]();});}exports[_0xfdde('0x5b')]=function(_0x2cf8e6,_0x558176){var _0x4d2b6d=getPDFPrinter();var _0x2d12d6=getPDFDocDefinitionFromHTML(_0x2cf8e6,_0x558176);var _0x3f689e=_0x4d2b6d[_0xfdde('0x3b')](_0x2d12d6);return writePDFDocument(_0x3f689e,_0x558176[_0xfdde('0x1')])[_0xfdde('0x49')](function(_0x4565b9){throw _0x4565b9;});}; \ No newline at end of file +var _0x59c9=['center','pipe','finish','error','end','createPdfFromHTML','path','util','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','fill','length','auto','body','concat','chunk','keys','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','header','before','margin','landscape','footer','Arial','black','right','Empty','Setting','find','splitSizePdf','split','range','num','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','each','then','createPdfKitDocument','%s%d.%s','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x59c9,0x173));var _0x959c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x59c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x959c('0x0'));var path=require('path');var moment=require(_0x959c('0x1'));var htmlToPdfmake=require(_0x959c('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x959c('0x3'));var rimraf=require(_0x959c('0x4'));var JSDOM=require(_0x959c('0x5'))[_0x959c('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0x959c('0x7'));var db=require(_0x959c('0x8'))['db'];var dbH=require(_0x959c('0x8'))[_0x959c('0x9')];var logger=require('../../config/logger')(_0x959c('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x959c('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x959c('0xb')][0x4];var NAME=process[_0x959c('0xb')][0x5];var FORMAT=_0x959c('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x35b3ba,_0x3bbde5){var _0x454e91={'status':_0x35b3ba};var _0x1a7745={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bbde5){_0x454e91[_0x959c('0xd')]=_0x3bbde5;}return db[_0x959c('0xe')][_0x959c('0xf')](_0x454e91,_0x1a7745);}function getHeaders(_0x1a6f04){return _[_0x959c('0x10')](_0x1a6f04,function(_0xc43ba7){return{'text':_0xc43ba7,'style':'tableHeader'};});}function getRows(_0x3fe418,_0x58f336){return _[_0x959c('0x10')](_0x58f336,function(_0x1e84e9){return _(_0x1e84e9)['pick'](_0x3fe418)[_0x959c('0x10')](function(_0x2ce0c6){return _0x2ce0c6?_[_0x959c('0x11')](_0x2ce0c6):'';})['value']();});}function createTable(_0x3bedd8,_0x1fe082){var _0x5c4d53={'widths':_[_0x959c('0x12')](Array(_0x3bedd8[_0x959c('0x13')]),0x91),'heights':function(_0xb58eb8){return _0xb58eb8===0x0?_0x959c('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3f600f=getHeaders(_0x3bedd8);_0x5c4d53[_0x959c('0x15')]['push'](_0x3f600f);var _0x345315=getRows(_0x3bedd8,_0x1fe082);_0x5c4d53[_0x959c('0x15')]=_0x5c4d53['body'][_0x959c('0x16')](_0x345315);return _0x5c4d53;}function createTables(_0x21aad3){var _0x8c4ea5=[];var _0x43dcc2=_[_0x959c('0x17')](Object[_0x959c('0x18')](_0x21aad3[0x0]),0x5);_0x43dcc2['forEach'](function(_0x1d1893){_0x8c4ea5[_0x959c('0x19')](createTable(_0x1d1893,_0x21aad3));});return _0x8c4ea5;}function getPDFDocDefinition(_0x2ad432){var _0x1a3d2a=util['format'](_0x959c('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x959c('0x1b')])[_0x959c('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x959c('0x1d')])[_0x959c('0x1c')](FORMAT));var _0x18da9e=[];for(var _0x2fb809=0x0;_0x2fb809<_0x2ad432['length'];_0x2fb809++){var _0x4d4d5b=[];if(_0x2fb809===0x0){_0x4d4d5b[_0x959c('0x19')]({'text':_0x1a3d2a,'style':_0x959c('0x1e')});}var _0x1a97eb={'table':_0x2ad432[_0x2fb809]};if(_0x2fb809>0x0){_0x1a97eb['pageBreak']=_0x959c('0x1f');_0x1a97eb[_0x959c('0x20')]=[0x0,0x46,0x0,0x0];}_0x4d4d5b[_0x959c('0x19')](_0x1a97eb);_0x18da9e[_0x959c('0x19')](_0x4d4d5b);}return{'pageSize':'A4','pageOrientation':_0x959c('0x21'),'content':_0x18da9e,'footer':function(_0x5f29a5,_0x3ec78a){return{'text':_0x5f29a5[_0x959c('0x11')]()+'\x20/\x20'+_0x3ec78a,'style':_0x959c('0x22')};},'defaultStyle':{'font':_0x959c('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x959c('0x24')},'footer':{'alignment':_0x959c('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1ab7e5){var _0x23ea3c=0x1388;var _0x4b26eb;if(!_0x1ab7e5[0x0]['num']){return analyticExtractedReport(_0x959c('0x26'));}return db[_0x959c('0x27')][_0x959c('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x3bcce2){if(_0x3bcce2){_0x4b26eb=_0x3bcce2;_0x23ea3c=_0x4b26eb[_0x959c('0x29')]||0x3e8;}})['then'](function(){var _0x21f807=[];var _0x24b185=0x0;if(_0x4b26eb[_0x959c('0x2a')]){if(_0x1ab7e5&&_0x1ab7e5[_0x959c('0x13')]){var _0x4db156=_[_0x959c('0x2b')](_0x1ab7e5[0x0][_0x959c('0x2c')]/_0x23ea3c);var _0x54ace9=Number[_0x959c('0x2d')](_0x1ab7e5[0x0]['num']/_0x23ea3c)?_0x1ab7e5[0x0][_0x959c('0x2c')]%_0x23ea3c:0x0;_0x4db156[_0x959c('0x2e')](function(_0xaf1177){if(_0xaf1177>0x0){_0x24b185+=_0x23ea3c;}_0x21f807[_0x959c('0x19')](dbH[_0x959c('0x2f')][_0x959c('0x30')](util[_0x959c('0x1c')](_0x959c('0x31'),QUERY,_0x23ea3c,_0x24b185),{'type':dbH[_0x959c('0x2f')][_0x959c('0x32')][_0x959c('0x33')]}));});if(_0x54ace9>0x0){_0x24b185+=_0x23ea3c;_0x21f807[_0x959c('0x19')](dbH['sequelize']['query'](util[_0x959c('0x1c')](_0x959c('0x31'),QUERY,_0x54ace9,_0x24b185),{'type':dbH[_0x959c('0x2f')][_0x959c('0x32')][_0x959c('0x33')]}));}}}else{_0x21f807['push'](dbH[_0x959c('0x2f')][_0x959c('0x30')](QUERY,{'type':dbH[_0x959c('0x2f')][_0x959c('0x32')]['SELECT']}));}var _0x853733=path[_0x959c('0x34')](PATH);var _0x459622=path[_0x959c('0x35')](PATH,'.pdf');var _0x14bae1=_0x4b26eb[_0x959c('0x2a')]&&_0x21f807[_0x959c('0x13')]>0x1;var _0x181a9d=[];if(!fs[_0x959c('0x36')](path[_0x959c('0x37')](_0x853733,_0x459622))&&_0x14bae1){fs['mkdirSync'](path[_0x959c('0x37')](_0x853733,_0x459622));}return BPromise[_0x959c('0x38')](_0x21f807,function(_0x1a9caa){_0x181a9d['push'](_0x1a9caa);})[_0x959c('0x39')](function(){var _0x351b56=[];for(var _0x375e26=0x0;_0x375e26<_0x181a9d['length'];_0x375e26+=0x1){var _0x53e4b2=_0x181a9d[_0x375e26];var _0x1f59c4=createTables(_['flatten'](_0x53e4b2));var _0x380bc9;var _0x14c531=getPDFDocDefinition(_0x1f59c4);var _0x44cbf7=getPDFPrinter();var _0x26f5a9=_0x44cbf7[_0x959c('0x3a')](_0x14c531);if(_0x14bae1){_0x380bc9=path[_0x959c('0x37')](_0x853733,_0x459622,util['format'](_0x959c('0x3b'),_0x459622,_0x375e26,'pdf'));}else{_0x380bc9=path['join'](_0x853733,util['format'](_0x959c('0x3c'),_0x459622,'pdf'));}_0x351b56['push'](writePDFDocument(_0x26f5a9,_0x380bc9));}return Promise['all'](_0x351b56);})[_0x959c('0x39')](function(){if(_0x14bae1){return new Promise(function(_0xfbee2a){zipdir(path[_0x959c('0x37')](_0x853733,_0x459622),{'saveTo':path['join'](_0x853733,util['format'](_0x959c('0x3c'),_0x459622,_0x959c('0x3d')))},function(){rimraf(path[_0x959c('0x37')](_0x853733,_0x459622),function(){});_0xfbee2a(_0x959c('0x3e'));});});}})[_0x959c('0x39')](function(){if(!_0x14bae1)return;rimraf(path[_0x959c('0x37')](_0x853733,_0x459622),function(){});})['then'](function(){logger[_0x959c('0x3f')](util[_0x959c('0x1c')](_0x959c('0x40'),EXTRACTED_REPORT_ID,_0x959c('0x41')));return analyticExtractedReport(_0x959c('0x42'),_0x14bae1?util['format']('%s.%s',_0x459622,_0x14bae1?_0x959c('0x3d'):_0x959c('0x43')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x959c('0x1c')](_0x959c('0x44'),EXTRACTED_REPORT_ID,_0x959c('0x41')));return db[_0x959c('0xe')][_0x959c('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x959c('0x39')](function(_0x4e0727){EXTRACTED_REPORT=_0x4e0727;return dbH[_0x959c('0x2f')][_0x959c('0x30')](util[_0x959c('0x1c')](_0x959c('0x46'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x959c('0x39')](extractReport)[_0x959c('0x47')](function(_0x27cff9){logger[_0x959c('0x3f')](util['format'](_0x959c('0x48'),EXTRACTED_REPORT_ID,'PDF'),util[_0x959c('0x49')](_0x27cff9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x959c('0x4a'));})[_0x959c('0x4b')](function(){process[_0x959c('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4bafc1=new PdfPrinter({'Arial':{'normal':__dirname+_0x959c('0x4d'),'bold':__dirname+_0x959c('0x4e'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x959c('0x4f')}});return _0x4bafc1;}function getPDFDocDefinitionFromHTML(_0x291f4a,_0x3940c7){var _0x2de8d8=util[_0x959c('0x1c')](_0x959c('0x50'),_0x3940c7[_0x959c('0x51')],_0x3940c7[_0x959c('0x52')]);var _0x4d1200=moment()[_0x959c('0x1c')](_0x959c('0x53'))[_0x959c('0x11')]();var _0x23e0d2=htmlToPdfmake(_0x291f4a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x23e0d2],'defaultStyle':{'font':_0x959c('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x959c('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x959c('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x959c('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x959c('0x1e')}];},'footer':function(_0x25ba3b,_0x4aa2d0){return[{'text':util[_0x959c('0x1c')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2de8d8,_0x25ba3b,_0x4aa2d0,_0x4d1200),'style':_0x959c('0x22')}];}};}function writePDFDocument(_0x246f9a,_0x4fa5ef){return new Promise(function(_0x5a664f,_0x116a79){var _0x2e30cb=_0x246f9a[_0x959c('0x55')](fs['createWriteStream'](_0x4fa5ef));_0x2e30cb['on'](_0x959c('0x56'),function(){_0x5a664f(_0x959c('0x56'));});_0x2e30cb['on'](_0x959c('0x57'),function(_0x2094e3){_0x116a79(_0x2094e3);});_0x246f9a[_0x959c('0x58')]();});}exports[_0x959c('0x59')]=function(_0x49c0fe,_0x454a63){var _0x3eff35=getPDFPrinter();var _0x1f5e12=getPDFDocDefinitionFromHTML(_0x49c0fe,_0x454a63);var _0x45319c=_0x3eff35[_0x959c('0x3a')](_0x1f5e12);return writePDFDocument(_0x45319c,_0x454a63[_0x959c('0x5a')])[_0x959c('0x47')](function(_0x48c6cf){throw _0x48c6cf;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index f7bd507..1e4a3c1 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x983f=['lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','split','length','range','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','inspect','Failed','finally','exit','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x983f,0xd3));var _0xf983=function(_0x40a114,_0x2b70d4){_0x40a114=_0x40a114-0x0;var _0x4353d9=_0x983f[_0x40a114];return _0x4353d9;};'use strict';var util=require('util');var path=require(_0xf983('0x0'));var _=require(_0xf983('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf983('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0xf983('0x3'));var db=require(_0xf983('0x4'))['db'];var dbH=require(_0xf983('0x4'))[_0xf983('0x5')];var logger=require(_0xf983('0x6'))(_0xf983('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf983('0x8')][0x3];var PATH=process[_0xf983('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b4d92,_0x164d82){var _0x4ab230={'status':_0x1b4d92};var _0x560d0e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x164d82){_0x4ab230[_0xf983('0x9')]=_0x164d82;}return db[_0xf983('0xa')][_0xf983('0xb')](_0x4ab230,_0x560d0e);}function main(){var _0x102a33=0x1388;var _0x3fb60;logger[_0xf983('0xc')](util['format'](_0xf983('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf983('0xe')][_0xf983('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf983('0x10')]})[_0xf983('0x11')](function(_0x4f25c8){if(_0x4f25c8){_0x3fb60=_0x4f25c8;_0x102a33=_0x3fb60['splitSizeXlsx']||0x1388;}})[_0xf983('0x11')](function(){return dbH[_0xf983('0x12')][_0xf983('0x13')](util['format'](_0xf983('0x14'),QUERY),{'type':dbH[_0xf983('0x12')]['QueryTypes'][_0xf983('0x15')]});})[_0xf983('0x11')](function(_0x44ab58){if(!_0x44ab58[0x0][_0xf983('0x16')]){return analyticExtractedReport('Empty');}var _0x44a35a=[];var _0x2ea226=0x0;if(_0x3fb60[_0xf983('0x17')]){if(_0x44ab58&&_0x44ab58[_0xf983('0x18')]){var _0x3ae7fd=_[_0xf983('0x19')](_0x44ab58[0x0]['num']/_0x102a33);var _0x5abe37=Number[_0xf983('0x1a')](_0x44ab58[0x0][_0xf983('0x16')]/_0x102a33)?_0x44ab58[0x0][_0xf983('0x16')]%_0x102a33:0x0;_0x3ae7fd[_0xf983('0x1b')](function(_0x27d933){if(_0x27d933>0x0){_0x2ea226+=_0x102a33;}_0x44a35a[_0xf983('0x1c')](dbH[_0xf983('0x12')][_0xf983('0x13')](util[_0xf983('0x1d')](_0xf983('0x1e'),QUERY,_0x102a33,_0x2ea226),{'type':dbH['sequelize'][_0xf983('0x1f')][_0xf983('0x15')]}));});if(_0x5abe37>0x0){_0x2ea226+=_0x102a33;_0x44a35a['push'](dbH[_0xf983('0x12')][_0xf983('0x13')](util[_0xf983('0x1d')](_0xf983('0x1e'),QUERY,_0x5abe37,_0x2ea226),{'type':dbH[_0xf983('0x12')][_0xf983('0x1f')][_0xf983('0x15')]}));}}}else{_0x44a35a[_0xf983('0x1c')](dbH[_0xf983('0x12')][_0xf983('0x13')](QUERY,{'type':dbH[_0xf983('0x12')]['QueryTypes'][_0xf983('0x15')]}));}var _0x1f8c56=path[_0xf983('0x20')](PATH);var _0x1ec8dd=path[_0xf983('0x21')](PATH,_0xf983('0x22'));var _0x5c46f3=_0x3fb60[_0xf983('0x17')]&&_0x44a35a[_0xf983('0x18')]>0x1;var _0x3b5b57=[];if(!fs[_0xf983('0x23')](path[_0xf983('0x24')](_0x1f8c56,_0x1ec8dd))&&_0x5c46f3){fs[_0xf983('0x25')](path[_0xf983('0x24')](_0x1f8c56,_0x1ec8dd));}return BPromise[_0xf983('0x26')](_0x44a35a,function(_0x8f694){_0x3b5b57[_0xf983('0x1c')](_0x8f694);})['then'](function(){for(var _0x3612aa=0x0;_0x3612aa<_0x3b5b57[_0xf983('0x18')];_0x3612aa+=0x1){var _0x1d552b;var _0xd529d0=_0x3b5b57[_0x3612aa];if(_0x5c46f3){_0x1d552b=path[_0xf983('0x24')](_0x1f8c56,_0x1ec8dd,util[_0xf983('0x1d')]('%s%d.%s',_0x1ec8dd,_0x3612aa,_0xf983('0x27')));}else{_0x1d552b=path[_0xf983('0x24')](_0x1f8c56,util['format'](_0xf983('0x28'),_0x1ec8dd,_0xf983('0x27')));}fs[_0xf983('0x29')](_0x1d552b,json2xls(_0xd529d0),_0xf983('0x2a'));}})[_0xf983('0x11')](function(){if(_0x5c46f3){return new Promise(function(_0x24037e){zipdir(path['join'](_0x1f8c56,_0x1ec8dd),{'saveTo':path[_0xf983('0x24')](_0x1f8c56,util[_0xf983('0x1d')](_0xf983('0x28'),_0x1ec8dd,_0xf983('0x2b')))},function(_0xecf7d,_0x4ba284){rimraf(path['join'](_0x1f8c56,_0x1ec8dd),function(){});_0x24037e(_0xf983('0x2c'));});});}})[_0xf983('0x11')](function(){logger[_0xf983('0xc')](util[_0xf983('0x1d')](_0xf983('0x2d'),EXTRACTED_REPORT_ID,_0xf983('0x2e')));return analyticExtractedReport(_0xf983('0x2f'),_0x5c46f3?util[_0xf983('0x1d')](_0xf983('0x28'),_0x1ec8dd,_0x5c46f3?_0xf983('0x2b'):'xlsx'):null);});})[_0xf983('0x30')](function(_0x1a52d8){logger['info'](util[_0xf983('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf983('0x2e')),util[_0xf983('0x31')](_0x1a52d8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf983('0x32'));})[_0xf983('0x33')](function(){process[_0xf983('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xae6c=['Empty','length','range','forEach','sequelize','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','argv','savename','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num'];(function(_0x3a7cd9,_0x5090af){var _0x13874f=function(_0x3b0fd5){while(--_0x3b0fd5){_0x3a7cd9['push'](_0x3a7cd9['shift']());}};_0x13874f(++_0x5090af);}(_0xae6c,0x7a));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xcae6('0x0'));var path=require('path');var _=require(_0xcae6('0x1'));var fs=require('fs');var json2xls=require(_0xcae6('0x2'));var BPromise=require(_0xcae6('0x3'));var zipdir=require(_0xcae6('0x4'));var rimraf=require('rimraf');var db=require(_0xcae6('0x5'))['db'];var dbH=require('../../mysqldb')[_0xcae6('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcae6('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcae6('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x380302,_0x5dd8b4){var _0x4fb836={'status':_0x380302};var _0x5203d5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5dd8b4){_0x4fb836[_0xcae6('0x8')]=_0x5dd8b4;}return db['AnalyticExtractedReport']['update'](_0x4fb836,_0x5203d5);}function main(){var _0xa28145=0x1388;var _0x57cbb6;logger[_0xcae6('0x9')](util[_0xcae6('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcae6('0xb')));return db[_0xcae6('0xc')][_0xcae6('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcae6('0xe'),_0xcae6('0xf')]})[_0xcae6('0x10')](function(_0x9509f4){if(_0x9509f4){_0x57cbb6=_0x9509f4;_0xa28145=_0x57cbb6['splitSizeXlsx']||0x1388;}})[_0xcae6('0x10')](function(){return dbH['sequelize'][_0xcae6('0x11')](util[_0xcae6('0xa')](_0xcae6('0x12'),QUERY),{'type':dbH['sequelize'][_0xcae6('0x13')][_0xcae6('0x14')]});})['then'](function(_0x53efd9){if(!_0x53efd9[0x0][_0xcae6('0x15')]){return analyticExtractedReport(_0xcae6('0x16'));}var _0x1c3aa9=[];var _0x2ea061=0x0;if(_0x57cbb6[_0xcae6('0xe')]){if(_0x53efd9&&_0x53efd9[_0xcae6('0x17')]){var _0x36a0b5=_[_0xcae6('0x18')](_0x53efd9[0x0]['num']/_0xa28145);var _0x41f444=Number['isInteger'](_0x53efd9[0x0][_0xcae6('0x15')]/_0xa28145)?_0x53efd9[0x0][_0xcae6('0x15')]%_0xa28145:0x0;_0x36a0b5[_0xcae6('0x19')](function(_0x2480a6){if(_0x2480a6>0x0){_0x2ea061+=_0xa28145;}_0x1c3aa9['push'](dbH[_0xcae6('0x1a')][_0xcae6('0x11')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xa28145,_0x2ea061),{'type':dbH['sequelize'][_0xcae6('0x13')]['SELECT']}));});if(_0x41f444>0x0){_0x2ea061+=_0xa28145;_0x1c3aa9[_0xcae6('0x1b')](dbH[_0xcae6('0x1a')][_0xcae6('0x11')](util[_0xcae6('0xa')](_0xcae6('0x1c'),QUERY,_0x41f444,_0x2ea061),{'type':dbH[_0xcae6('0x1a')][_0xcae6('0x13')][_0xcae6('0x14')]}));}}}else{_0x1c3aa9[_0xcae6('0x1b')](dbH[_0xcae6('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xcae6('0x13')]['SELECT']}));}var _0x8edc2c=path[_0xcae6('0x1d')](PATH);var _0x2d8d1f=path[_0xcae6('0x1e')](PATH,_0xcae6('0x1f'));var _0x562dc3=_0x57cbb6['split']&&_0x1c3aa9[_0xcae6('0x17')]>0x1;var _0x3ede10=[];if(!fs[_0xcae6('0x20')](path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f))&&_0x562dc3){fs[_0xcae6('0x22')](path['join'](_0x8edc2c,_0x2d8d1f));}return BPromise[_0xcae6('0x23')](_0x1c3aa9,function(_0x5df061){_0x3ede10[_0xcae6('0x1b')](_0x5df061);})[_0xcae6('0x10')](function(){for(var _0x12dd82=0x0;_0x12dd82<_0x3ede10[_0xcae6('0x17')];_0x12dd82+=0x1){var _0x4c1346;var _0x3391ef=_0x3ede10[_0x12dd82];if(_0x562dc3){_0x4c1346=path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f,util['format'](_0xcae6('0x24'),_0x2d8d1f,_0x12dd82,_0xcae6('0x25')));}else{_0x4c1346=path[_0xcae6('0x21')](_0x8edc2c,util[_0xcae6('0xa')]('%s.%s',_0x2d8d1f,_0xcae6('0x25')));}fs['writeFileSync'](_0x4c1346,json2xls(_0x3391ef),'binary');}})[_0xcae6('0x10')](function(){if(_0x562dc3){return new Promise(function(_0x4c52ba){zipdir(path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f),{'saveTo':path[_0xcae6('0x21')](_0x8edc2c,util[_0xcae6('0xa')](_0xcae6('0x26'),_0x2d8d1f,_0xcae6('0x27')))},function(_0x109e38,_0x2715d2){rimraf(path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f),function(){});_0x4c52ba(_0xcae6('0x28'));});});}})[_0xcae6('0x10')](function(){logger[_0xcae6('0x9')](util['format'](_0xcae6('0x29'),EXTRACTED_REPORT_ID,_0xcae6('0xb')));return analyticExtractedReport(_0xcae6('0x2a'),_0x562dc3?util[_0xcae6('0xa')](_0xcae6('0x26'),_0x2d8d1f,_0x562dc3?_0xcae6('0x27'):_0xcae6('0x25')):null);});})[_0xcae6('0x2b')](function(_0x250a4f){logger['info'](util[_0xcae6('0xa')](_0xcae6('0x2c'),EXTRACTED_REPORT_ID,_0xcae6('0xb')),util[_0xcae6('0x2d')](_0x250a4f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcae6('0x2e'));})['finally'](function(){process[_0xcae6('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b1f55fa..0313606 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe373=['custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','VoiceExtension','destroy','bulkCreate','sortBy','lodash','util','findAll','then','IntervalId','models','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','context','VoiceExtensionId','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','intervals','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','appType'];(function(_0x2be60a,_0x14f736){var _0x2d61a5=function(_0x20c766){while(--_0x20c766){_0x2be60a['push'](_0x2be60a['shift']());}};_0x2d61a5(++_0x14f736);}(_0xe373,0x1a6));var _0x3e37=function(_0x3b17bd,_0x4c3653){_0x3b17bd=_0x3b17bd-0x0;var _0x34c0ec=_0xe373[_0x3b17bd];return _0x34c0ec;};'use strict';var _=require(_0x3e37('0x0'));var util=require(_0x3e37('0x1'));function rewrite(_0x374ce1,_0x534334){var _0x33bef3=this;return _0x374ce1['models']['Interval'][_0x3e37('0x2')]({'raw':!![]})[_0x3e37('0x3')](function(_0x584975){_0x33bef3['intervals']=_0x584975;return _0x374ce1['models']['VoiceExtension'][_0x3e37('0x2')]({'where':{'IntervalId':_0x534334[_0x3e37('0x4')]},'raw':!![]});})['then'](function(_0x3af3c8){return _0x374ce1[_0x3e37('0x5')]['VoiceExtension'][_0x3e37('0x2')]({'where':{'exten':{'$in':_[_0x3e37('0x6')](_['map'](_0x3af3c8,_0x3e37('0x7')))}},'order':[{'raw':_0x3e37('0x8')}],'raw':!![]});})['then'](function(_0x16e5a0){var _0xcb7111=_[_0x3e37('0x9')](_0x16e5a0,{'priority':'1'});var _0x267744=_[_0x3e37('0x9')](_0x16e5a0,{'isApp':0x1});var _0x1427ee=_[_0x3e37('0xa')](_0x267744,_0x3e37('0x7'));var _0x33c6f2=[_0x3e37('0xb'),'playback'];var _0x2cab50=[];var _0x59cf30=[];for(var _0x31a52c in _0x1427ee){if(_0x1427ee[_0x3e37('0xc')](_0x31a52c)){_0x33bef3[_0x3e37('0xd')]=0x2;_0x33bef3[_0x3e37('0xe')]=[];_0x33bef3[_0x3e37('0xf')]=_[_0x3e37('0x10')](_0xcb7111,{'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')]});_0x33bef3[_0x3e37('0xe')][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':'Set','appdata':util[_0x3e37('0x13')](_0x3e37('0x14'),_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')]),'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0]['exten'],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});if(_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')]==='inbound'){_0x33bef3[_0x3e37('0xe')][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x18')+_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')],'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});}else if(_0x1427ee[_0x31a52c][0x0]['type']===_0x3e37('0x19')){if(_0x33bef3[_0x3e37('0xf')]){_0x33bef3['extensions']['push']({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x1a')+(_0x33bef3[_0x3e37('0xf')][_0x3e37('0x1b')]?_0x3e37('0x1c')+_0x33bef3['extension'][_0x3e37('0x1b')]+'}':_0x3e37('0x1d')),'context':_0x1427ee[_0x31a52c][0x0]['context'],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});}_0x33bef3[_0x3e37('0xe')][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x18')+_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')],'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});var _0x2184cd=_0x33bef3['priority']++;_0x33bef3[_0x3e37('0xe')]['push']({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2184cd+0x2)+_0x3e37('0x1f')+(_0x2184cd+0x1)+')','context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x2184cd,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});if(_0x33bef3[_0x3e37('0xf')]){_0x33bef3[_0x3e37('0xe')]['push']({'type':_0x1427ee[_0x31a52c][0x0]['type'],'app':_0x3e37('0x17'),'appdata':_0x33bef3[_0x3e37('0xf')][_0x3e37('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x33bef3['extension'][_0x3e37('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3['priority']++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});}_0x33bef3[_0x3e37('0xe')][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x20')+_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')],'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});if(_0x33bef3[_0x3e37('0xf')]&&_0x33bef3[_0x3e37('0xf')][_0x3e37('0xc')](_0x3e37('0x21'))&&_0x33bef3['extension'][_0x3e37('0x21')]!==_0x3e37('0x22')){_0x33bef3[_0x3e37('0xe')]['push']({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x23'),'context':_0x1427ee[_0x31a52c][0x0]['context'],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3['priority']++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});_0x33bef3[_0x3e37('0xe')]['push']({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':'Set','appdata':_0x3e37('0x24')+_0x33bef3[_0x3e37('0xf')][_0x3e37('0x21')]||_0x3e37('0x25'),'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});}}_0x33bef3['extensions']['push']({'type':_0x1427ee[_0x31a52c][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3['priority']++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});_0x33bef3['extensions'][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x26'),'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0]['exten'],'priority':_0x33bef3['priority']++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});_0x33bef3[_0x3e37('0xe')][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x27'),'context':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x15')],'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'priority':_0x33bef3[_0x3e37('0xd')]++,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']});for(var _0x5b5ae3=0x0,_0x5e2ea3=0x0;_0x5b5ae3<_0x1427ee[_0x31a52c]['length'];_0x5b5ae3+=0x1,_0x5e2ea3=0x0){var _0x57828e=_0x1427ee[_0x31a52c][_0x5b5ae3];if(_0x57828e[_0x3e37('0x12')]){_0x57828e[_0x3e37('0x12')]=_0x57828e[_0x3e37('0x12')][_0x3e37('0x28')]();}var _0x2471bb=[];var _0x389592=[];delete _0x57828e['id'];delete _0x57828e[_0x3e37('0x29')];delete _0x57828e[_0x3e37('0x2a')];var _0x1eb5d2=_0x57828e[_0x3e37('0x2b')]!==_0x3e37('0x2c')?[_0x57828e['interval']]:_0x57828e[_0x3e37('0x4')]?_[_0x3e37('0x2d')](_[_0x3e37('0x9')](_0x33bef3[_0x3e37('0x2e')],{'IntervalId':_0x57828e[_0x3e37('0x4')]}),_0x3e37('0x2b')):[];if(_0x57828e[_0x3e37('0xc')]('tag')){if(_0x57828e[_0x3e37('0x2f')]&&_0x57828e[_0x3e37('0x2f')]!=='--'){_0x2471bb['push']({'type':_0x57828e[_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x30')+_0x57828e['tag'],'context':_0x57828e[_0x3e37('0x15')],'exten':_0x57828e['exten'],'priority':_0x1eb5d2[_0x3e37('0x31')]+_0x33bef3['priority']+_0x5e2ea3++,'VoiceExtensionId':_0x57828e['VoiceExtensionId']});}}if(_0x57828e['type']==='outbound'&&_0x57828e[_0x3e37('0xc')](_0x3e37('0x32'))){if(_0x57828e['callerID']){_0x2471bb[_0x3e37('0x11')]({'type':_0x57828e[_0x3e37('0x12')],'app':_0x3e37('0x1e'),'appdata':_0x3e37('0x33')+_0x57828e[_0x3e37('0x32')]+')','context':_0x57828e['context'],'exten':_0x57828e[_0x3e37('0x7')],'priority':_0x1eb5d2[_0x3e37('0x31')]+_0x33bef3['priority']+_0x5e2ea3++,'VoiceExtensionId':_0x57828e[_0x3e37('0x16')]});}else{_0x2471bb[_0x3e37('0x11')]({'type':_0x57828e['type'],'app':'ExecIf','appdata':_0x3e37('0x34'),'context':_0x57828e[_0x3e37('0x15')],'exten':_0x57828e[_0x3e37('0x7')],'priority':_0x1eb5d2[_0x3e37('0x31')]+_0x33bef3[_0x3e37('0xd')]+_0x5e2ea3++,'VoiceExtensionId':_0x57828e[_0x3e37('0x16')]});}}if(_0x57828e[_0x3e37('0xc')]('answer')){if(_0x33c6f2['indexOf'](_0x57828e['app'][_0x3e37('0x28')]())>=0x0&&_0x57828e[_0x3e37('0x35')]!==_0x3e37('0x36')){if(_0x57828e[_0x3e37('0x37')]){_0x2471bb['push']({'type':_0x57828e['type'],'app':_0x3e37('0x1e'),'appdata':_0x3e37('0x38'),'context':_0x57828e['context'],'exten':_0x57828e[_0x3e37('0x7')],'priority':_0x1eb5d2[_0x3e37('0x31')]+_0x33bef3['priority']+_0x5e2ea3++,'VoiceExtensionId':_0x57828e[_0x3e37('0x16')]});_0x2471bb[_0x3e37('0x11')]({'type':_0x57828e[_0x3e37('0x12')],'app':'Set','appdata':_0x3e37('0x39'),'context':_0x57828e[_0x3e37('0x15')],'exten':_0x57828e[_0x3e37('0x7')],'priority':_0x1eb5d2[_0x3e37('0x31')]+_0x33bef3[_0x3e37('0xd')]+_0x5e2ea3++,'VoiceExtensionId':_0x57828e['VoiceExtensionId']});}else{_0x2471bb[_0x3e37('0x11')]({'type':_0x57828e['type'],'app':_0x3e37('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x57828e[_0x3e37('0x15')],'exten':_0x57828e[_0x3e37('0x7')],'priority':_0x1eb5d2['length']+_0x33bef3[_0x3e37('0xd')]+_0x5e2ea3++,'VoiceExtensionId':_0x57828e[_0x3e37('0x16')]});_0x2471bb[_0x3e37('0x11')]({'type':_0x57828e[_0x3e37('0x12')],'app':_0x3e37('0x17'),'appdata':_0x3e37('0x3a'),'context':_0x57828e[_0x3e37('0x15')],'exten':_0x57828e['exten'],'priority':_0x1eb5d2['length']+_0x33bef3[_0x3e37('0xd')]+_0x5e2ea3++,'VoiceExtensionId':_0x57828e['VoiceExtensionId']});}}}for(var _0x25dbc6=0x0;_0x25dbc6<_0x1eb5d2[_0x3e37('0x31')];_0x25dbc6+=0x1){var _0x36ab05=_0x33bef3[_0x3e37('0xd')]+_0x1eb5d2[_0x3e37('0x31')];var _0x27af33=_0x25dbc6===_0x1eb5d2[_0x3e37('0x31')]-0x1?_0x33bef3[_0x3e37('0xd')]+_0x2471bb[_0x3e37('0x31')]+_0x389592['length']+0x2:_0x33bef3[_0x3e37('0xd')]+_0x25dbc6+0x1;_0x2471bb[_0x3e37('0x3b')](_0x25dbc6,0x0,{'type':_0x57828e[_0x3e37('0x12')],'app':_0x3e37('0x3c'),'appdata':_0x1eb5d2[_0x25dbc6]+'?'+_0x57828e['context']+_0x3e37('0x3d')+_0x36ab05+':'+_0x57828e[_0x3e37('0x15')]+_0x3e37('0x3d')+_0x27af33,'exten':_0x57828e['exten'],'context':_0x57828e[_0x3e37('0x15')],'priority':_0x33bef3[_0x3e37('0xd')]+_0x25dbc6,'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});}_0x57828e['priority']=_0x2471bb[_0x3e37('0x31')]?_[_0x3e37('0x3e')](_0x2471bb)[_0x3e37('0xd')]+0x1:_0x33bef3[_0x3e37('0xd')];_0x33bef3[_0x3e37('0xd')]=(_0x389592[_0x3e37('0x31')]?_[_0x3e37('0x3e')](_0x389592)[_0x3e37('0xd')]:_0x57828e[_0x3e37('0xd')])+0x1;_0x33bef3[_0x3e37('0xe')]=_['concat'](_0x33bef3[_0x3e37('0xe')],_0x2471bb,[_0x57828e],_0x389592);}_0x33bef3[_0x3e37('0xe')][_0x3e37('0x11')]({'type':_0x1427ee[_0x31a52c][0x0]['type'],'app':_0x3e37('0x3f'),'exten':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x7')],'context':_0x1427ee[_0x31a52c][0x0]['context'],'priority':_0x33bef3[_0x3e37('0xd')],'VoiceExtensionId':_0x1427ee[_0x31a52c][0x0][_0x3e37('0x16')]});_0x2cab50[_0x3e37('0x11')](_0x1427ee[_0x31a52c][0x0]['VoiceExtensionId']);_0x59cf30=_['concat'](_0x59cf30,_0x33bef3[_0x3e37('0xe')]);}}return _0x374ce1['transaction'](function(_0x47a8a2){return _0x374ce1[_0x3e37('0x5')][_0x3e37('0x40')][_0x3e37('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x2cab50}},'transaction':_0x47a8a2})[_0x3e37('0x3')](function(_0x3f9dfa){return _0x374ce1['models'][_0x3e37('0x40')][_0x3e37('0x42')](_[_0x3e37('0x43')](_0x59cf30,_0x3e37('0xd')),{'transaction':_0x47a8a2});});});})['catch'](function(_0x107a2b){console['error'](_0x107a2b);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xa421=['queue','playback','hasOwnProperty','extension','find','extensions','push','type','Set','CDR(type)=%s','context','priority','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','intervals','findAll','IntervalId','then','VoiceExtension','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','exten'];(function(_0x55f380,_0x3e27f0){var _0x36b38e=function(_0x31bbc6){while(--_0x31bbc6){_0x55f380['push'](_0x55f380['shift']());}};_0x36b38e(++_0x3e27f0);}(_0xa421,0x1c7));var _0x1a42=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa421[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x1a42('0x0'));var util=require(_0x1a42('0x1'));function rewrite(_0x6787a,_0x9483c7){var _0x5c22d3=this;return _0x6787a[_0x1a42('0x2')][_0x1a42('0x3')]['findAll']({'raw':!![]})['then'](function(_0x35d13d){_0x5c22d3[_0x1a42('0x4')]=_0x35d13d;return _0x6787a[_0x1a42('0x2')]['VoiceExtension'][_0x1a42('0x5')]({'where':{'IntervalId':_0x9483c7[_0x1a42('0x6')]},'raw':!![]});})[_0x1a42('0x7')](function(_0x3d8255){return _0x6787a[_0x1a42('0x2')][_0x1a42('0x8')][_0x1a42('0x5')]({'where':{'exten':{'$in':_[_0x1a42('0x9')](_['map'](_0x3d8255,'exten'))}},'order':[{'raw':_0x1a42('0xa')}],'raw':!![]});})[_0x1a42('0x7')](function(_0x19b748){var _0x1adbe2=_[_0x1a42('0xb')](_0x19b748,{'priority':'1'});var _0x296f8f=_[_0x1a42('0xb')](_0x19b748,{'isApp':0x1});var _0x497789=_['groupBy'](_0x296f8f,_0x1a42('0xc'));var _0x359bc6=[_0x1a42('0xd'),_0x1a42('0xe')];var _0x1fa89c=[];var _0x468f6d=[];for(var _0x4133b7 in _0x497789){if(_0x497789[_0x1a42('0xf')](_0x4133b7)){_0x5c22d3['priority']=0x2;_0x5c22d3['extensions']=[];_0x5c22d3[_0x1a42('0x10')]=_[_0x1a42('0x11')](_0x1adbe2,{'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')]});_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':util['format'](_0x1a42('0x16'),_0x497789[_0x4133b7][0x0][_0x1a42('0x14')]),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});if(_0x497789[_0x4133b7][0x0][_0x1a42('0x14')]==='inbound'){_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x19')+_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')],'context':_0x497789[_0x4133b7][0x0]['context'],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}else if(_0x497789[_0x4133b7][0x0][_0x1a42('0x14')]===_0x1a42('0x1b')){if(_0x5c22d3[_0x1a42('0x10')]){_0x5c22d3['extensions']['push']({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x1c')+(_0x5c22d3[_0x1a42('0x10')]['cutdigits']?_0x1a42('0x1d')+_0x5c22d3[_0x1a42('0x10')]['cutdigits']+'}':_0x1a42('0x1e')),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':'Set','appdata':_0x1a42('0x19')+_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')],'context':_0x497789[_0x4133b7][0x0]['context'],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});var _0x217681=_0x5c22d3[_0x1a42('0x18')]++;_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x1f'),'appdata':_0x1a42('0x20')+(_0x217681+0x2)+_0x1a42('0x21')+(_0x217681+0x1)+')','context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x217681,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});if(_0x5c22d3['extension']){_0x5c22d3[_0x1a42('0x12')]['push']({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x22')]?_0x1a42('0x23')+_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x22')]+'}':_0x1a42('0x24'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x25')+_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')],'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});if(_0x5c22d3[_0x1a42('0x10')]&&_0x5c22d3['extension']['hasOwnProperty']('recordingFormat')&&_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x26')]!==_0x1a42('0x27')){_0x5c22d3['extensions']['push']({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x28'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x29')+_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x26')]||_0x1a42('0x2a'),'context':_0x497789[_0x4133b7][0x0]['context'],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x2b'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});_0x5c22d3[_0x1a42('0x12')]['push']({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x2c'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});for(var _0x55098=0x0,_0x4ea060=0x0;_0x55098<_0x497789[_0x4133b7][_0x1a42('0x2d')];_0x55098+=0x1,_0x4ea060=0x0){var _0x4eb69b=_0x497789[_0x4133b7][_0x55098];if(_0x4eb69b['type']){_0x4eb69b['type']=_0x4eb69b[_0x1a42('0x14')]['toLowerCase']();}var _0x207894=[];var _0x1697e7=[];delete _0x4eb69b['id'];delete _0x4eb69b[_0x1a42('0x2e')];delete _0x4eb69b[_0x1a42('0x2f')];var _0x4c4e39=_0x4eb69b[_0x1a42('0x30')]!==_0x1a42('0x31')?[_0x4eb69b[_0x1a42('0x30')]]:_0x4eb69b[_0x1a42('0x6')]?_[_0x1a42('0x32')](_['filter'](_0x5c22d3[_0x1a42('0x4')],{'IntervalId':_0x4eb69b[_0x1a42('0x6')]}),_0x1a42('0x30')):[];if(_0x4eb69b['hasOwnProperty'](_0x1a42('0x33'))){if(_0x4eb69b[_0x1a42('0x33')]&&_0x4eb69b[_0x1a42('0x33')]!=='--'){_0x207894['push']({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x34')+_0x4eb69b[_0x1a42('0x33')],'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b['exten'],'priority':_0x4c4e39['length']+_0x5c22d3['priority']+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}}if(_0x4eb69b[_0x1a42('0x14')]===_0x1a42('0x1b')&&_0x4eb69b[_0x1a42('0xf')](_0x1a42('0x35'))){if(_0x4eb69b[_0x1a42('0x35')]){_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x1f'),'appdata':_0x1a42('0x36')+_0x4eb69b[_0x1a42('0x35')]+')','context':_0x4eb69b['context'],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}else{_0x207894['push']({'type':_0x4eb69b['type'],'app':'ExecIf','appdata':_0x1a42('0x37'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}}if(_0x4eb69b[_0x1a42('0xf')](_0x1a42('0x38'))){if(_0x359bc6[_0x1a42('0x39')](_0x4eb69b[_0x1a42('0x3a')][_0x1a42('0x3b')]())>=0x0&&_0x4eb69b[_0x1a42('0x3c')]!==_0x1a42('0x3d')){if(_0x4eb69b[_0x1a42('0x38')]){_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x1f'),'appdata':_0x1a42('0x3e'),'context':_0x4eb69b['context'],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x3f'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}else{_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':'ExecIf','appdata':_0x1a42('0x40'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':'Set','appdata':_0x1a42('0x41'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}}}for(var _0x32c14d=0x0;_0x32c14d<_0x4c4e39['length'];_0x32c14d+=0x1){var _0x43556d=_0x5c22d3[_0x1a42('0x18')]+_0x4c4e39['length'];var _0x2edad7=_0x32c14d===_0x4c4e39[_0x1a42('0x2d')]-0x1?_0x5c22d3['priority']+_0x207894[_0x1a42('0x2d')]+_0x1697e7['length']+0x2:_0x5c22d3[_0x1a42('0x18')]+_0x32c14d+0x1;_0x207894['splice'](_0x32c14d,0x0,{'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x42'),'appdata':_0x4c4e39[_0x32c14d]+'?'+_0x4eb69b[_0x1a42('0x17')]+_0x1a42('0x43')+_0x43556d+':'+_0x4eb69b[_0x1a42('0x17')]+_0x1a42('0x43')+_0x2edad7,'exten':_0x4eb69b[_0x1a42('0xc')],'context':_0x4eb69b[_0x1a42('0x17')],'priority':_0x5c22d3[_0x1a42('0x18')]+_0x32c14d,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});}_0x4eb69b['priority']=_0x207894[_0x1a42('0x2d')]?_['last'](_0x207894)[_0x1a42('0x18')]+0x1:_0x5c22d3[_0x1a42('0x18')];_0x5c22d3[_0x1a42('0x18')]=(_0x1697e7[_0x1a42('0x2d')]?_[_0x1a42('0x44')](_0x1697e7)['priority']:_0x4eb69b[_0x1a42('0x18')])+0x1;_0x5c22d3[_0x1a42('0x12')]=_[_0x1a42('0x45')](_0x5c22d3[_0x1a42('0x12')],_0x207894,[_0x4eb69b],_0x1697e7);}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x46'),'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'priority':_0x5c22d3[_0x1a42('0x18')],'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});_0x1fa89c[_0x1a42('0x13')](_0x497789[_0x4133b7][0x0]['VoiceExtensionId']);_0x468f6d=_['concat'](_0x468f6d,_0x5c22d3[_0x1a42('0x12')]);}}return _0x6787a[_0x1a42('0x47')](function(_0x2a4db6){return _0x6787a[_0x1a42('0x2')][_0x1a42('0x8')][_0x1a42('0x48')]({'where':{'VoiceExtensionId':{'$in':_0x1fa89c}},'transaction':_0x2a4db6})[_0x1a42('0x7')](function(_0x16345c){return _0x6787a[_0x1a42('0x2')][_0x1a42('0x8')][_0x1a42('0x49')](_[_0x1a42('0x4a')](_0x468f6d,'priority'),{'transaction':_0x2a4db6});});});})[_0x1a42('0x4b')](function(_0x1b677b){console[_0x1a42('0x4c')](_0x1b677b);});}exports[_0x1a42('0x4d')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 34b944d..72a6423 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd59c=['firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','CmContact','create','keys','then','push','pick','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','ListId','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','into','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','\x20=\x20?','VoiceQueue','outbound','CmList','Lists','get','sequelize','query','onlyIfOpen','catch','all','BlackLists','VoiceQueueId','Campaign','findAll','dialCheckDuplicateType','always','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../config/environment','../../../config/logger','api','redis','localhost','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join'];(function(_0x937649,_0x1c91ee){var _0x2acaeb=function(_0x43bfc7){while(--_0x43bfc7){_0x937649['push'](_0x937649['shift']());}};_0x2acaeb(++_0x1c91ee);}(_0xd59c,0x123));var _0xcd59=function(_0x17ef27,_0x229051){_0x17ef27=_0x17ef27-0x0;var _0x182267=_0xd59c[_0x17ef27];return _0x182267;};'use strict';var BPromise=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var _=require(_0xcd59('0x2'));var fs=require('fs');var squel=require(_0xcd59('0x3'));var Papa=require(_0xcd59('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xcd59('0x5'));var logger=require(_0xcd59('0x6'))(_0xcd59('0x7'));config[_0xcd59('0x8')]=_['defaults'](config[_0xcd59('0x8')],{'host':_0xcd59('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd59('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0xcd59('0xa')](socket);try{if(!process[_0xcd59('0xb')][0x2]||process[_0xcd59('0xb')][0x2]==='undefined'||process[_0xcd59('0xb')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xcd59('0xb')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xcd59('0xc')||process['argv'][0x3]===_0xcd59('0xd')||!process[_0xcd59('0xb')][0x4]||process['argv'][0x4]==='undefined'||process[_0xcd59('0xb')][0x4]==='null'){throw new Error(_0xcd59('0xe'));}var FIELDS=_[_0xcd59('0xf')](process['argv'][0x3]['split'](','),process['argv'][0x4][_0xcd59('0x10')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xcd59('0xc')||process['argv'][0x5]===_0xcd59('0xd')){throw new Error(_0xcd59('0x11'));}var LISTID=process[_0xcd59('0xb')][0x5];var COMPANYID=process[_0xcd59('0xb')][0x6]&&process[_0xcd59('0xb')][0x6]!==_0xcd59('0xc')&&process[_0xcd59('0xb')][0x6]!==_0xcd59('0xd')?process[_0xcd59('0xb')][0x6]:null;var DUPLICATES=process[_0xcd59('0xb')][0x7]&&process['argv'][0x7]!==_0xcd59('0xc')&&process['argv'][0x7]!==_0xcd59('0xd')?process['argv'][0x7]:null;if(!process[_0xcd59('0xb')][0x8]||process[_0xcd59('0xb')][0x8]===_0xcd59('0xc')||process[_0xcd59('0xb')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xcd59('0xb')][0x8];}catch(_0x19af37){logger[_0xcd59('0x12')](_0x19af37);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(_0x21adfd,_0x3f558b,_0x27b5b2,_0x4b397f){var _0x212fd6={'message':_0x3f558b};_0x212fd6[_0x21adfd]=!![];if(_0x27b5b2){_0x212fd6[_0xcd59('0x13')]=_0x27b5b2;}if(_0x4b397f){_0x212fd6[_0xcd59('0x14')]=_0x4b397f;}return _0x212fd6;}function isEmail(_0x33f6b3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x33f6b3);}function checkRow(_0x548af1,_0x34ba2d,_0xbc0dde){return new BPromise(function(_0x570680,_0x5beea1){if(_[_0xcd59('0x15')](_0x548af1)){return _0x5beea1(handleCheckRowError(_0xcd59('0x12'),_0xcd59('0x16'),null,_0xbc0dde));}if(_0x548af1[_0xcd59('0x17')]&&_0x548af1[_0xcd59('0x17')][_0xcd59('0x18')]){var _0x1d33f5=_['map'](_0x548af1['errors'],_0xcd59('0x19'))[_0xcd59('0x1a')](';');return _0x5beea1(handleCheckRowError(_0xcd59('0x12'),_0x1d33f5,null,_0xbc0dde));}var _0x4f4f6c={};for(var _0x2152f8 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2152f8)&&FIELDS[_0x2152f8]){_0x4f4f6c[_0x2152f8]=_0x548af1['data'][0x0][FIELDS[_0x2152f8]]||_0x548af1['data'][0x0]['\ufeff'+FIELDS[_0x2152f8]];}}if(!_0x4f4f6c['firstName']){return _0x5beea1(handleCheckRowError(_0xcd59('0x12'),_0xcd59('0x1b'),null,_0xbc0dde));}if(!_0x4f4f6c[_0xcd59('0x1c')]){return _0x5beea1(handleCheckRowError(_0xcd59('0x12'),_0xcd59('0x1d'),null,_0xbc0dde));}if(_0x4f4f6c[_0xcd59('0x1e')]){var _0x2b5806=moment(_0x4f4f6c[_0xcd59('0x1e')],_0xcd59('0x1f'));if(!_0x2b5806['isValid']()){return _0x5beea1(handleCheckRowError(_0xcd59('0x12'),_0xcd59('0x20'),null,_0xbc0dde));}}if(_0x4f4f6c[_0xcd59('0x21')]){if(!isEmail(_0x4f4f6c['email'])){return _0x5beea1(handleCheckRowError(_0xcd59('0x12'),_0xcd59('0x22'),null,_0xbc0dde));}}_0x4f4f6c['ListId']=LISTID;_0x4f4f6c[_0xcd59('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcd59('0x18')]&&_0x34ba2d){var _0xd7dc52={};for(var _0x53215b=0x0,_0x2fadfe=DUPLICATES[_0xcd59('0x18')];_0x53215b<_0x2fadfe;_0x53215b+=0x1){_0xd7dc52[DUPLICATES[_0x53215b]]=_0x4f4f6c[DUPLICATES[_0x53215b]];}var _0x3d4895=_[_0xcd59('0x24')](_0x34ba2d,_0xd7dc52);if(_0x3d4895){return _0x5beea1(handleCheckRowError(_0xcd59('0x25'),'Duplicate\x20Contact',_0x3d4895,_0xbc0dde));}}return db[_0xcd59('0x26')][_0xcd59('0x27')](_0x4f4f6c,{'raw':!![],'hooks':![],'fields':_[_0xcd59('0x28')](_0x4f4f6c)})[_0xcd59('0x29')](function(_0x5764d8){if(DUPLICATES&&DUPLICATES['length']&&_0x34ba2d){_0x34ba2d[_0xcd59('0x2a')](_[_0xcd59('0x2b')](_0x4f4f6c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5764d8['id'];return _0x570680();})['catch'](function(_0x231271){return _0x5beea1(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x231271[_0xcd59('0x19')]||JSON[_0xcd59('0x2c')](_0x231271)),null,_0xbc0dde));});});}function checkHopper(){function _0x2f01d7(){return function(_0x4b8c3d){logger[_0xcd59('0x12')](_0xcd59('0x2d'),_0xcd59('0x2e'),util[_0xcd59('0x2f')](_0x4b8c3d,{'showHidden':![],'depth':null}));};}var _0x328218=function(_0x55339a,_0x127746){var _0x3752cf=squel[_0xcd59('0x30')]()['into'](_0xcd59('0x31'))[_0xcd59('0x32')]([_0xcd59('0x1c'),_0xcd59('0x33'),_0xcd59('0x34'),'ListId',_0x127746,_0xcd59('0x35'),'updatedAt'],squel[_0xcd59('0x36')]()[_0xcd59('0x37')](_0xcd59('0x1c'),_0xcd59('0x1c'))[_0xcd59('0x37')](_0xcd59('0x38'),_0xcd59('0x33'))['field']('id',_0xcd59('0x34'))['field'](LISTID[_0xcd59('0x39')](),_0xcd59('0x3a'))[_0xcd59('0x37')](_0x55339a['id'][_0xcd59('0x39')](),_0x127746)['field'](_0xcd59('0x38'),_0xcd59('0x35'))['field'](_0xcd59('0x38'),_0xcd59('0x3b'))[_0xcd59('0x3c')](_0xcd59('0x3d'))[_0xcd59('0x3e')](_0xcd59('0x3f'))[_0xcd59('0x3e')](_0xcd59('0x40'),LISTID[_0xcd59('0x39')]())[_0xcd59('0x3e')](_0xcd59('0x41'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xcd59('0x36')]()[_0xcd59('0x37')](_0xcd59('0x1c'))['from'](_0xcd59('0x31'))[_0xcd59('0x3e')](_0x127746+'\x20=\x20?',_0x55339a['id'][_0xcd59('0x39')]())))['toString']();return _0x3752cf;};var _0x1a0000=function(_0x4a9130,_0x35953e){var _0x31deb6=squel[_0xcd59('0x30')]()[_0xcd59('0x42')](_0xcd59('0x31'))[_0xcd59('0x32')]([_0xcd59('0x1c'),'scheduledAt',_0xcd59('0x34'),_0xcd59('0x3a'),_0x35953e,_0xcd59('0x35'),_0xcd59('0x3b')],squel['select']()[_0xcd59('0x37')](_0xcd59('0x1c'),_0xcd59('0x1c'))[_0xcd59('0x37')](_0xcd59('0x38'),_0xcd59('0x33'))[_0xcd59('0x37')]('id','ContactId')[_0xcd59('0x37')](LISTID[_0xcd59('0x39')](),_0xcd59('0x3a'))[_0xcd59('0x37')](_0x4a9130['id'][_0xcd59('0x39')](),_0x35953e)['field'](_0xcd59('0x38'),'createdAt')[_0xcd59('0x37')]('NOW()',_0xcd59('0x3b'))['from'](_0xcd59('0x3d'))[_0xcd59('0x3e')](_0xcd59('0x3f'))[_0xcd59('0x3e')](_0xcd59('0x40'),LISTID[_0xcd59('0x39')]())[_0xcd59('0x3e')](_0xcd59('0x43'),squel[_0xcd59('0x44')](hopperContacts))[_0xcd59('0x3e')](_0xcd59('0x41'))['where'](_0xcd59('0x45'),squel['select']()['field']('calleridnum')[_0xcd59('0x3c')](_0xcd59('0x46'))[_0xcd59('0x3e')](_0x35953e+_0xcd59('0x47'),_0x4a9130['id'][_0xcd59('0x39')]()))[_0xcd59('0x3e')](_0xcd59('0x45'),squel[_0xcd59('0x36')]()[_0xcd59('0x37')](_0xcd59('0x1c'))['from'](_0xcd59('0x31'))[_0xcd59('0x3e')](_0x35953e+_0xcd59('0x47'),_0x4a9130['id'][_0xcd59('0x39')]())))[_0xcd59('0x39')]();return _0x31deb6;};function _0x398f34(_0x1174ef,_0x569e54){var _0x26583b=squel['insert']()[_0xcd59('0x42')](_0xcd59('0x31'))[_0xcd59('0x32')]([_0xcd59('0x1c'),_0xcd59('0x33'),_0xcd59('0x34'),_0xcd59('0x3a'),_0x569e54,'createdAt',_0xcd59('0x3b')],squel[_0xcd59('0x36')]()[_0xcd59('0x37')]('phone',_0xcd59('0x1c'))[_0xcd59('0x37')]('NOW()','scheduledAt')['field']('id',_0xcd59('0x34'))['field'](LISTID['toString'](),_0xcd59('0x3a'))['field'](_0x1174ef['id'][_0xcd59('0x39')](),_0x569e54)['field'](_0xcd59('0x38'),_0xcd59('0x35'))[_0xcd59('0x37')](_0xcd59('0x38'),_0xcd59('0x3b'))[_0xcd59('0x3c')](_0xcd59('0x3d'))['where'](_0xcd59('0x3f'))[_0xcd59('0x3e')]('ListId\x20=\x20?',LISTID[_0xcd59('0x39')]())['where'](_0xcd59('0x43'),squel[_0xcd59('0x44')](hopperContacts))[_0xcd59('0x3e')](_0xcd59('0x41')))[_0xcd59('0x39')]();return _0x26583b;}function _0x1b1297(_0x282413,_0x2af96b){var _0x64de22=squel[_0xcd59('0x30')]()[_0xcd59('0x42')]('cm_hopper_black')[_0xcd59('0x32')]([_0xcd59('0x1c'),_0xcd59('0x34'),_0xcd59('0x3a'),_0x2af96b,_0xcd59('0x35'),_0xcd59('0x3b')],squel[_0xcd59('0x36')]()[_0xcd59('0x37')](_0xcd59('0x1c'),'phone')[_0xcd59('0x37')]('id',_0xcd59('0x34'))['field'](LISTID[_0xcd59('0x39')](),_0xcd59('0x3a'))[_0xcd59('0x37')](_0x282413['id'][_0xcd59('0x39')](),_0x2af96b)['field'](_0xcd59('0x38'),_0xcd59('0x35'))[_0xcd59('0x37')](_0xcd59('0x38'),_0xcd59('0x3b'))['from']('cm_contacts')[_0xcd59('0x3e')](_0xcd59('0x3f'))['where']('ListId\x20=\x20?',LISTID[_0xcd59('0x39')]())['where'](_0xcd59('0x43'),squel[_0xcd59('0x44')](hopperContacts))[_0xcd59('0x3e')](_0xcd59('0x41')))[_0xcd59('0x39')]();return _0x64de22;}return db[_0xcd59('0x48')]['findAll']({'where':{'type':_0xcd59('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xcd59('0x4a')],'as':_0xcd59('0x4b'),'where':{'id':LISTID}}]})[_0xcd59('0x29')](function(_0x3f44ac){var _0x104a99=[];if(_0x3f44ac){var _0x2e088b;for(var _0xde9548=0x0,_0x4a07dd;_0xde9548<_0x3f44ac['length'];_0xde9548+=0x1){_0x4a07dd=_0x3f44ac[_0xde9548][_0xcd59('0x4c')]({'plain':!![]});switch(_0x4a07dd['dialCheckDuplicateType']){case'always':_0x104a99[_0xcd59('0x2a')](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x1a0000(_0x4a07dd,'VoiceQueueId'))['then'](function(){})['catch'](_0x2f01d7()));break;case _0xcd59('0x4f'):_0x104a99[_0xcd59('0x2a')](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x328218(_0x4a07dd,'VoiceQueueId'))[_0xcd59('0x29')](function(){})[_0xcd59('0x50')](_0x2f01d7()));break;default:_0x104a99['push'](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x398f34(_0x4a07dd,'VoiceQueueId'))[_0xcd59('0x29')](function(){})[_0xcd59('0x50')](_0x2f01d7()));}}}return _0x104a99;})[_0xcd59('0x51')]()[_0xcd59('0x29')](function(){return db[_0xcd59('0x48')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xcd59('0x4a')],'as':_0xcd59('0x52'),'where':{'id':LISTID}}]})[_0xcd59('0x29')](function(_0x35105d){var _0x2dcae1=[];if(_0x35105d){var _0x3aa4db;for(var _0x348a4d=0x0,_0xe76305;_0x348a4d<_0x35105d[_0xcd59('0x18')];_0x348a4d+=0x1){_0xe76305=_0x35105d[_0x348a4d][_0xcd59('0x4c')]({'plain':!![]});_0x2dcae1[_0xcd59('0x2a')](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x1b1297(_0xe76305,_0xcd59('0x53')))[_0xcd59('0x29')](function(){})[_0xcd59('0x50')](_0x2f01d7()));}}return _0x2dcae1;})[_0xcd59('0x51')]();})[_0xcd59('0x29')](function(){return db[_0xcd59('0x54')][_0xcd59('0x55')]({'attributes':['id',_0xcd59('0x56')],'include':[{'model':db[_0xcd59('0x4a')],'as':_0xcd59('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x448188){var _0x590ab8=[];if(_0x448188){for(var _0x5c2f91=0x0,_0x4e9aeb;_0x5c2f91<_0x448188['length'];_0x5c2f91+=0x1){_0x4e9aeb=_0x448188[_0x5c2f91][_0xcd59('0x4c')]({'plain':!![]});switch(_0x4e9aeb['dialCheckDuplicateType']){case _0xcd59('0x57'):_0x590ab8[_0xcd59('0x2a')](db[_0xcd59('0x4d')]['query'](_0x1a0000(_0x4e9aeb,_0xcd59('0x58')))[_0xcd59('0x29')](function(){})[_0xcd59('0x50')](_0x2f01d7()));break;case _0xcd59('0x4f'):_0x590ab8['push'](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x328218(_0x4e9aeb,'CampaignId'))[_0xcd59('0x29')](function(){})[_0xcd59('0x50')](_0x2f01d7()));break;default:_0x590ab8['push'](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x398f34(_0x4e9aeb,'CampaignId'))['then'](function(){})[_0xcd59('0x50')](_0x2f01d7()));}}}return _0x590ab8;})['all']();})[_0xcd59('0x29')](function(){return db[_0xcd59('0x54')][_0xcd59('0x55')]({'attributes':['id'],'include':[{'model':db[_0xcd59('0x4a')],'as':_0xcd59('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x268093){var _0x5e63ea=[];if(_0x268093){for(var _0x29bb7b=0x0,_0x804737;_0x29bb7b<_0x268093[_0xcd59('0x18')];_0x29bb7b+=0x1){_0x804737=_0x268093[_0x29bb7b][_0xcd59('0x4c')]({'plain':!![]});_0x5e63ea[_0xcd59('0x2a')](db[_0xcd59('0x4d')][_0xcd59('0x4e')](_0x1b1297(_0x804737,_0xcd59('0x58')))[_0xcd59('0x29')](function(){})[_0xcd59('0x50')](_0x2f01d7()));}}return _0x5e63ea;})['all']();})['catch'](function(_0x3738e6){logger[_0xcd59('0x12')]('cmContact,\x20%s,\x20%s',_0xcd59('0x59'),_0x3738e6[_0xcd59('0x19')]);});}var processPromises=function(_0x4e1aed){return BPromise['all'](promises)[_0xcd59('0x29')](function(_0x522536){})['catch'](function(_0x4b116e){logger[_0xcd59('0x12')](_0xcd59('0x5a'),JSON[_0xcd59('0x2c')](_0x4b116e));})[_0xcd59('0x5b')](function(){socket[_0xcd59('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4e1aed){return _0x4e1aed['resume']();}});};var endCsv=function(){return BPromise[_0xcd59('0x5d')]()[_0xcd59('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0xcd59('0x29')](function(){socket[_0xcd59('0x5c')](_0xcd59('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcd59('0x5f')](FILEPATH);}catch(_0x3ad2cd){logger[_0xcd59('0x12')](_0xcd59('0x60'),JSON[_0xcd59('0x2c')](_0x3ad2cd));}finally{process[_0xcd59('0x61')](0x0);}});};process['on'](_0xcd59('0x62'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xcd59('0x5d')]()[_0xcd59('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcd59('0x10')](',');return db[_0xcd59('0x26')][_0xcd59('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcd59('0x29')](function(_0x1b5b2c){var _0x3a6aad=fs[_0xcd59('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcd59('0x64')](_0x3a6aad,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ca04a,_0x533d51){total+=0x1;var _0x5a7e0e=total;promises['push'](checkRow(_0x5ca04a,_0x1b5b2c,_0x5a7e0e)[_0xcd59('0x29')](function(){success+=0x1;})[_0xcd59('0x50')](function(_0x2b01f1){if(_0x2b01f1[_0xcd59('0x12')]){errors+=0x1;delete _0x2b01f1[_0xcd59('0x12')];}else if(_0x2b01f1[_0xcd59('0x25')]){duplicates+=0x1;delete _0x2b01f1[_0xcd59('0x25')];}rows[_0xcd59('0x2a')](_0x2b01f1);}));if(total%0xc8===0x0){_0x533d51[_0xcd59('0x65')]();return processPromises(_0x533d51);}},'complete':function(){return processPromises()['then'](function(){logger[_0xcd59('0x66')](_0xcd59('0x67'));endCsv();});},'error':function(_0x5ab399,_0x3607c4){logger['info'](_0xcd59('0x68'),JSON[_0xcd59('0x2c')](_0x5ab399));endCsv();}});})['catch'](function(_0x1faa59){logger[_0xcd59('0x12')](_0xcd59('0x69'),JSON[_0xcd59('0x2c')](_0x1faa59));});}main(); \ No newline at end of file +var _0x8eab=['info','CSV\x20parsed\x20correctly!','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','register','argv','undefined','Missing\x20filepath\x20parameter!','null','zipObject','split','error','contact','test','isNil','errors','message','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','then','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','inspect','insert','into','cm_hopper','scheduledAt','ContactId','ListId','createdAt','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','fromQuery','updatedAt','cm_contacts','str','calleridnum','cm_hopper_final','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','get','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','createReadStream','pause'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x8eab,0x69));var _0xb8ea=function(_0x8f2d82,_0x5a658a){_0x8f2d82=_0x8f2d82-0x0;var _0x571614=_0x8eab[_0x8f2d82];return _0x571614;};'use strict';var BPromise=require('bluebird');var util=require(_0xb8ea('0x0'));var _=require(_0xb8ea('0x1'));var fs=require('fs');var squel=require(_0xb8ea('0x2'));var Papa=require(_0xb8ea('0x3'));var Redis=require(_0xb8ea('0x4'));var db=require(_0xb8ea('0x5'))['db'];var config=require(_0xb8ea('0x6'));var logger=require(_0xb8ea('0x7'))(_0xb8ea('0x8'));config[_0xb8ea('0x9')]=_['defaults'](config['redis'],{'host':_0xb8ea('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xb8ea('0xb')](socket);try{if(!process[_0xb8ea('0xc')][0x2]||process[_0xb8ea('0xc')][0x2]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x2]==='null'){throw new Error(_0xb8ea('0xe'));}var FILEPATH=process[_0xb8ea('0xc')][0x2];if(!process[_0xb8ea('0xc')][0x3]||process[_0xb8ea('0xc')][0x3]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x3]===_0xb8ea('0xf')||!process[_0xb8ea('0xc')][0x4]||process[_0xb8ea('0xc')][0x4]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x4]===_0xb8ea('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb8ea('0x10')](process[_0xb8ea('0xc')][0x3][_0xb8ea('0x11')](','),process[_0xb8ea('0xc')][0x4][_0xb8ea('0x11')](','));if(!process['argv'][0x5]||process[_0xb8ea('0xc')][0x5]===_0xb8ea('0xd')||process['argv'][0x5]===_0xb8ea('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb8ea('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb8ea('0xc')][0x6]!==_0xb8ea('0xd')&&process[_0xb8ea('0xc')][0x6]!==_0xb8ea('0xf')?process[_0xb8ea('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb8ea('0xc')][0x7]!==_0xb8ea('0xd')&&process[_0xb8ea('0xc')][0x7]!==_0xb8ea('0xf')?process[_0xb8ea('0xc')][0x7]:null;if(!process[_0xb8ea('0xc')][0x8]||process[_0xb8ea('0xc')][0x8]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x43734a){logger[_0xb8ea('0x12')](_0x43734a);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(_0x51cbb5,_0x235ab5,_0x58721c,_0x1f5627){var _0x25d5c8={'message':_0x235ab5};_0x25d5c8[_0x51cbb5]=!![];if(_0x58721c){_0x25d5c8[_0xb8ea('0x13')]=_0x58721c;}if(_0x1f5627){_0x25d5c8['index']=_0x1f5627;}return _0x25d5c8;}function isEmail(_0x542af2){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))*$/[_0xb8ea('0x14')](_0x542af2);}function checkRow(_0x3f2840,_0x5332ae,_0x1be4d8){return new BPromise(function(_0x342537,_0x4b13a5){if(_[_0xb8ea('0x15')](_0x3f2840)){return _0x4b13a5(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1be4d8));}if(_0x3f2840[_0xb8ea('0x16')]&&_0x3f2840['errors']['length']){var _0x497412=_['map'](_0x3f2840[_0xb8ea('0x16')],_0xb8ea('0x17'))['join'](';');return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0x497412,null,_0x1be4d8));}var _0x18fd7f={};for(var _0x30ed8d in FIELDS){if(FIELDS[_0xb8ea('0x18')](_0x30ed8d)&&FIELDS[_0x30ed8d]){_0x18fd7f[_0x30ed8d]=_0x3f2840['data'][0x0][FIELDS[_0x30ed8d]]||_0x3f2840['data'][0x0]['\ufeff'+FIELDS[_0x30ed8d]];}}if(!_0x18fd7f[_0xb8ea('0x19')]){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x1a'),null,_0x1be4d8));}if(!_0x18fd7f[_0xb8ea('0x1b')]){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x1c'),null,_0x1be4d8));}if(_0x18fd7f[_0xb8ea('0x1d')]){var _0x3fb6a0=moment(_0x18fd7f[_0xb8ea('0x1d')],_0xb8ea('0x1e'));if(!_0x3fb6a0['isValid']()){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x1f'),null,_0x1be4d8));}}if(_0x18fd7f[_0xb8ea('0x20')]){if(!isEmail(_0x18fd7f['email'])){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x1be4d8));}}_0x18fd7f['ListId']=LISTID;_0x18fd7f[_0xb8ea('0x21')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb8ea('0x22')]&&_0x5332ae){var _0x1eef9d={};for(var _0x2f3749=0x0,_0x15d791=DUPLICATES[_0xb8ea('0x22')];_0x2f3749<_0x15d791;_0x2f3749+=0x1){_0x1eef9d[DUPLICATES[_0x2f3749]]=_0x18fd7f[DUPLICATES[_0x2f3749]];}var _0x2688a8=_[_0xb8ea('0x23')](_0x5332ae,_0x1eef9d);if(_0x2688a8){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x24'),_0xb8ea('0x25'),_0x2688a8,_0x1be4d8));}}return db[_0xb8ea('0x26')][_0xb8ea('0x27')](_0x18fd7f,{'raw':!![],'hooks':![],'fields':_['keys'](_0x18fd7f)})[_0xb8ea('0x28')](function(_0x16faed){if(DUPLICATES&&DUPLICATES[_0xb8ea('0x22')]&&_0x5332ae){_0x5332ae['push'](_['pick'](_0x18fd7f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x16faed['id'];return _0x342537();})[_0xb8ea('0x29')](function(_0x59951c){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x2a')+(_0x59951c[_0xb8ea('0x17')]||JSON['stringify'](_0x59951c)),null,_0x1be4d8));});});}function checkHopper(){function _0x4f341c(){return function(_0x32db06){logger['error'](_0xb8ea('0x2b'),'checkHopper',util[_0xb8ea('0x2c')](_0x32db06,{'showHidden':![],'depth':null}));};}var _0x5ec4fc=function(_0x2578d2,_0x36ba2b){var _0x46689d=squel[_0xb8ea('0x2d')]()[_0xb8ea('0x2e')](_0xb8ea('0x2f'))['fromQuery']([_0xb8ea('0x1b'),_0xb8ea('0x30'),_0xb8ea('0x31'),_0xb8ea('0x32'),_0x36ba2b,_0xb8ea('0x33'),'updatedAt'],squel['select']()[_0xb8ea('0x34')]('phone','phone')['field'](_0xb8ea('0x35'),_0xb8ea('0x30'))[_0xb8ea('0x34')]('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),_0xb8ea('0x32'))[_0xb8ea('0x34')](_0x2578d2['id'][_0xb8ea('0x36')](),_0x36ba2b)[_0xb8ea('0x34')](_0xb8ea('0x35'),'createdAt')[_0xb8ea('0x34')](_0xb8ea('0x35'),'updatedAt')[_0xb8ea('0x37')]('cm_contacts')[_0xb8ea('0x38')](_0xb8ea('0x39'))[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())[_0xb8ea('0x38')](_0xb8ea('0x3b'))[_0xb8ea('0x38')](_0xb8ea('0x3c'),squel[_0xb8ea('0x3d')]()['field'](_0xb8ea('0x1b'))[_0xb8ea('0x37')](_0xb8ea('0x2f'))['where'](_0x36ba2b+_0xb8ea('0x3e'),_0x2578d2['id'][_0xb8ea('0x36')]())))[_0xb8ea('0x36')]();return _0x46689d;};var _0x1187a0=function(_0x115e90,_0x23458a){var _0x5e985c=squel[_0xb8ea('0x2d')]()['into'](_0xb8ea('0x2f'))[_0xb8ea('0x3f')]([_0xb8ea('0x1b'),_0xb8ea('0x30'),'ContactId',_0xb8ea('0x32'),_0x23458a,_0xb8ea('0x33'),_0xb8ea('0x40')],squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x1b'),'phone')[_0xb8ea('0x34')](_0xb8ea('0x35'),'scheduledAt')['field']('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),_0xb8ea('0x32'))[_0xb8ea('0x34')](_0x115e90['id']['toString'](),_0x23458a)[_0xb8ea('0x34')](_0xb8ea('0x35'),_0xb8ea('0x33'))['field'](_0xb8ea('0x35'),_0xb8ea('0x40'))[_0xb8ea('0x37')](_0xb8ea('0x41'))[_0xb8ea('0x38')]('deletedAt\x20IS\x20NULL')[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())['where']('id\x20IN\x20?',squel[_0xb8ea('0x42')](hopperContacts))[_0xb8ea('0x38')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb8ea('0x3c'),squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x43'))[_0xb8ea('0x37')](_0xb8ea('0x44'))['where'](_0x23458a+_0xb8ea('0x3e'),_0x115e90['id'][_0xb8ea('0x36')]()))['where'](_0xb8ea('0x3c'),squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x1b'))[_0xb8ea('0x37')](_0xb8ea('0x2f'))[_0xb8ea('0x38')](_0x23458a+'\x20=\x20?',_0x115e90['id'][_0xb8ea('0x36')]())))[_0xb8ea('0x36')]();return _0x5e985c;};function _0x16c67b(_0x266b3f,_0x4cad91){var _0x445057=squel[_0xb8ea('0x2d')]()[_0xb8ea('0x2e')]('cm_hopper')[_0xb8ea('0x3f')]([_0xb8ea('0x1b'),'scheduledAt',_0xb8ea('0x31'),_0xb8ea('0x32'),_0x4cad91,_0xb8ea('0x33'),_0xb8ea('0x40')],squel[_0xb8ea('0x3d')]()['field'](_0xb8ea('0x1b'),_0xb8ea('0x1b'))[_0xb8ea('0x34')]('NOW()',_0xb8ea('0x30'))['field']('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),'ListId')[_0xb8ea('0x34')](_0x266b3f['id'][_0xb8ea('0x36')](),_0x4cad91)[_0xb8ea('0x34')]('NOW()','createdAt')[_0xb8ea('0x34')](_0xb8ea('0x35'),_0xb8ea('0x40'))[_0xb8ea('0x37')]('cm_contacts')[_0xb8ea('0x38')](_0xb8ea('0x39'))[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())[_0xb8ea('0x38')]('id\x20IN\x20?',squel[_0xb8ea('0x42')](hopperContacts))['where'](_0xb8ea('0x3b')))[_0xb8ea('0x36')]();return _0x445057;}function _0xde433c(_0x1f54cb,_0xc4af3a){var _0x7c745c=squel['insert']()[_0xb8ea('0x2e')](_0xb8ea('0x45'))['fromQuery'](['phone',_0xb8ea('0x31'),_0xb8ea('0x32'),_0xc4af3a,_0xb8ea('0x33'),'updatedAt'],squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x1b'),_0xb8ea('0x1b'))['field']('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),'ListId')[_0xb8ea('0x34')](_0x1f54cb['id']['toString'](),_0xc4af3a)['field'](_0xb8ea('0x35'),'createdAt')[_0xb8ea('0x34')](_0xb8ea('0x35'),'updatedAt')[_0xb8ea('0x37')](_0xb8ea('0x41'))[_0xb8ea('0x38')](_0xb8ea('0x39'))[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())[_0xb8ea('0x38')](_0xb8ea('0x46'),squel[_0xb8ea('0x42')](hopperContacts))[_0xb8ea('0x38')](_0xb8ea('0x3b')))[_0xb8ea('0x36')]();return _0x7c745c;}return db[_0xb8ea('0x47')][_0xb8ea('0x48')]({'where':{'type':_0xb8ea('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x481acd){var _0x18ec4f=[];if(_0x481acd){var _0x1508b3;for(var _0x1eaf88=0x0,_0x29f670;_0x1eaf88<_0x481acd[_0xb8ea('0x22')];_0x1eaf88+=0x1){_0x29f670=_0x481acd[_0x1eaf88]['get']({'plain':!![]});switch(_0x29f670[_0xb8ea('0x4c')]){case _0xb8ea('0x4d'):_0x18ec4f[_0xb8ea('0x4e')](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0x1187a0(_0x29f670,_0xb8ea('0x51')))[_0xb8ea('0x28')](function(){})[_0xb8ea('0x29')](_0x4f341c()));break;case _0xb8ea('0x52'):_0x18ec4f[_0xb8ea('0x4e')](db['sequelize'][_0xb8ea('0x50')](_0x5ec4fc(_0x29f670,_0xb8ea('0x51')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));break;default:_0x18ec4f[_0xb8ea('0x4e')](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0x16c67b(_0x29f670,_0xb8ea('0x51')))[_0xb8ea('0x28')](function(){})[_0xb8ea('0x29')](_0x4f341c()));}}}return _0x18ec4f;})['all']()['then'](function(){return db[_0xb8ea('0x47')][_0xb8ea('0x48')]({'where':{'type':_0xb8ea('0x49')},'attributes':['id'],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x53'),'where':{'id':LISTID}}]})[_0xb8ea('0x28')](function(_0x375a8c){var _0x280d5c=[];if(_0x375a8c){var _0x29d6a0;for(var _0x3b62fc=0x0,_0x2f44b1;_0x3b62fc<_0x375a8c[_0xb8ea('0x22')];_0x3b62fc+=0x1){_0x2f44b1=_0x375a8c[_0x3b62fc][_0xb8ea('0x54')]({'plain':!![]});_0x280d5c['push'](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0xde433c(_0x2f44b1,_0xb8ea('0x51')))['then'](function(){})['catch'](_0x4f341c()));}}return _0x280d5c;})[_0xb8ea('0x55')]();})[_0xb8ea('0x28')](function(){return db[_0xb8ea('0x56')][_0xb8ea('0x48')]({'attributes':['id',_0xb8ea('0x4c')],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x4b'),'where':{'id':LISTID}}]})[_0xb8ea('0x28')](function(_0x3e25de){var _0x47e32b=[];if(_0x3e25de){for(var _0x2f804d=0x0,_0x300ce5;_0x2f804d<_0x3e25de['length'];_0x2f804d+=0x1){_0x300ce5=_0x3e25de[_0x2f804d][_0xb8ea('0x54')]({'plain':!![]});switch(_0x300ce5['dialCheckDuplicateType']){case _0xb8ea('0x4d'):_0x47e32b[_0xb8ea('0x4e')](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0x1187a0(_0x300ce5,_0xb8ea('0x57')))['then'](function(){})[_0xb8ea('0x29')](_0x4f341c()));break;case _0xb8ea('0x52'):_0x47e32b['push'](db['sequelize'][_0xb8ea('0x50')](_0x5ec4fc(_0x300ce5,_0xb8ea('0x57')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));break;default:_0x47e32b['push'](db['sequelize']['query'](_0x16c67b(_0x300ce5,_0xb8ea('0x57')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));}}}return _0x47e32b;})[_0xb8ea('0x55')]();})[_0xb8ea('0x28')](function(){return db['Campaign'][_0xb8ea('0x48')]({'attributes':['id'],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x53'),'where':{'id':LISTID}}]})[_0xb8ea('0x28')](function(_0x56ee97){var _0x15bb56=[];if(_0x56ee97){for(var _0x348349=0x0,_0x4c3d65;_0x348349<_0x56ee97[_0xb8ea('0x22')];_0x348349+=0x1){_0x4c3d65=_0x56ee97[_0x348349]['get']({'plain':!![]});_0x15bb56[_0xb8ea('0x4e')](db['sequelize'][_0xb8ea('0x50')](_0xde433c(_0x4c3d65,_0xb8ea('0x57')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));}}return _0x15bb56;})['all']();})[_0xb8ea('0x29')](function(_0x38d327){logger['error'](_0xb8ea('0x58'),'generalCheckHopper',_0x38d327[_0xb8ea('0x17')]);});}var processPromises=function(_0x3b19ee){return BPromise['all'](promises)[_0xb8ea('0x28')](function(_0x366423){})[_0xb8ea('0x29')](function(_0x5df524){logger[_0xb8ea('0x12')](_0xb8ea('0x59'),JSON[_0xb8ea('0x5a')](_0x5df524));})[_0xb8ea('0x5b')](function(){socket[_0xb8ea('0x5c')](_0xb8ea('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3b19ee){return _0x3b19ee[_0xb8ea('0x5e')]();}});};var endCsv=function(){return BPromise[_0xb8ea('0x5f')]()[_0xb8ea('0x28')](function(){if(hopperContacts){return checkHopper();}})[_0xb8ea('0x28')](function(){socket[_0xb8ea('0x5c')](_0xb8ea('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb8ea('0x60')](FILEPATH);}catch(_0x20cdb5){logger[_0xb8ea('0x12')](_0xb8ea('0x61'),JSON[_0xb8ea('0x5a')](_0x20cdb5));}finally{process['exit'](0x0);}});};process['on'](_0xb8ea('0x62'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb8ea('0x5f')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb8ea('0x11')](',');return db[_0xb8ea('0x26')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb8ea('0x28')](function(_0x4d247c){var _0x136037=fs[_0xb8ea('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x136037,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f6e04,_0x52636d){total+=0x1;var _0x40998e=total;promises['push'](checkRow(_0x2f6e04,_0x4d247c,_0x40998e)[_0xb8ea('0x28')](function(){success+=0x1;})['catch'](function(_0x581a9a){if(_0x581a9a['error']){errors+=0x1;delete _0x581a9a[_0xb8ea('0x12')];}else if(_0x581a9a[_0xb8ea('0x24')]){duplicates+=0x1;delete _0x581a9a[_0xb8ea('0x24')];}rows[_0xb8ea('0x4e')](_0x581a9a);}));if(total%0xc8===0x0){_0x52636d[_0xb8ea('0x64')]();return processPromises(_0x52636d);}},'complete':function(){return processPromises()[_0xb8ea('0x28')](function(){logger[_0xb8ea('0x65')](_0xb8ea('0x66'));endCsv();});},'error':function(_0x477243,_0x1a7c74){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x477243));endCsv();}});})[_0xb8ea('0x29')](function(_0x583e70){logger[_0xb8ea('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xb8ea('0x5a')](_0x583e70));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index aa4968a..301f438 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77a4=['then','length','all','isNil','split','filter','push','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','recallme','fields','cm_contacts','.CmListId\x20=\x20?','where','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.ListId','cm_hopper_black','phone','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','toString','.offset-cm_contacts.utcOffset\x20minute)','priority','UserId','.CmListId','field','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','group','info','Received\x20SIGINT','error','message','exit','code','query','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','send','binding','clone','root','.csv','includes','keys','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','errors','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','select','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones'];(function(_0x21c9d3,_0xc79fa3){var _0x7852bc=function(_0x345ea3){while(--_0x345ea3){_0x21c9d3['push'](_0x21c9d3['shift']());}};_0x7852bc(++_0xc79fa3);}(_0x77a4,0x9f));var _0x477a=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x77a4[_0x14a862];return _0x245eb5;};'use strict';var fs=require('fs');var path=require(_0x477a('0x0'));var _=require(_0x477a('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x477a('0x2'));var moment=require(_0x477a('0x3'));var squel=require(_0x477a('0x4'));var Redis=require('ioredis');var db=require(_0x477a('0x5'))['db'];var config=require(_0x477a('0x6'));var shared=require(_0x477a('0x7'));var logger=require(_0x477a('0x8'))('import');config[_0x477a('0x9')]=_[_0x477a('0xa')](config[_0x477a('0x9')],{'host':_0x477a('0xb'),'port':0x18eb});var socket=require(_0x477a('0xc'))(new Redis(config[_0x477a('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x477a('0xd')]('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()[_0x477a('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x578feb){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x578feb);}function selectNotIn(_0x2b31a9,_0x17772c,_0x35e855,_0x126323,_0x5f2b54){return squel[_0x477a('0xe')]()['field']('phone')[_0x477a('0xf')](_0x126323)[_0x477a('0x10')](_0x17772c,null,_0x17772c+_0x477a('0x11')+_0x126323+'.'+_0x35e855)['where'](_0x126323+'.'+_0x35e855+_0x477a('0x12')+_0x2b31a9+'.'+_0x35e855)['where'](_0x17772c+_0x477a('0x13')+_0x5f2b54[_0x477a('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x233733,_0x981061){promisesAdditionalPhones=[];return db[_0x477a('0x14')][_0x477a('0x15')]({'raw':!![],'attributes':['id',_0x477a('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x477a('0x17')](function(_0x12c29e){if(_0x12c29e!==null){var _0x4b8fcc=[];for(var _0x549a16=0x0;_0x549a16<_0x12c29e[_0x477a('0x18')];_0x549a16++){var _0x2f7cbc=_0x12c29e[_0x549a16];_0x4b8fcc['push'](insertAdditionalPhones(_0x2f7cbc));}}Promise[_0x477a('0x19')](_0x4b8fcc)['then'](function(){_0x233733({'val':0x1});});});});}function insertAdditionalPhones(_0x131d97){return new Promise(function(_0x523a94,_0xe0aced){var _0x128681=_0x131d97[_0x477a('0x16')];var _0x185d22=_0x128681['split'](';');var _0x25ac11=[];orderBy=0x0;for(var _0x13822b=0x0;_0x13822b<_0x185d22['length'];_0x13822b++){_0x25ac11['push'](splitAdditionalPhone(_0x131d97['id'],_0x185d22[_0x13822b]));}Promise['all'](_0x25ac11)[_0x477a('0x17')](function(){_0x523a94({'val':_0x185d22[_0x477a('0x18')]});});});}function splitAdditionalPhone(_0x4086c5,_0x264ad3){return new Promise(function(_0xd42499,_0x4c55b8){var _0x100690=_0x264ad3['split'](':');var _0xbaa7a1=_0x100690[0x0];var _0x1c49c5=_0x100690[0x1];if(!_[_0x477a('0x1a')](_0x1c49c5)){var _0x4ae18c=_0x1c49c5[_0x477a('0x1b')]('|');var _0x386434=[];for(var _0x46b776=0x0;_0x46b776<_0x4ae18c[_0x477a('0x18')];_0x46b776++){if(_0x4ae18c[_0x46b776]!==''){var _0x2d09d8=_[_0x477a('0x1c')](promisesAdditionalPhones,{'contactId':_0x4086c5,'phone':_0x4ae18c[_0x46b776]});if(_0x2d09d8['length']==0x0){orderBy++;promisesAdditionalPhones[_0x477a('0x1d')]({'contactId':_0x4086c5,'contactTypeId':_0xbaa7a1,'phone':_0x4ae18c[_0x46b776],'orderBy':orderBy});}}}_0xd42499({'ok':0x1});}else _0xd42499({'res':0x0});});}function createAdditionalPhone(_0x165bf8,_0x416ffd,_0x2c2ca0,_0x228736){var _0x2ff074='';var _0x50597e='';var _0x8e51cf=_0x2c2ca0[_0x477a('0x1b')]('§');_0x2ff074=_0x8e51cf[0x0];if(_0x8e51cf[_0x477a('0x18')]==0x2)_0x50597e=_0x8e51cf[0x1];return new Promise(function(_0x2996b1,_0x4e1039){return db['CmContactHasItem'][_0x477a('0x1e')]({'where':{'CmContactId':_0x165bf8,'item':_0x2ff074}})[_0x477a('0x17')](function(_0x5b6dc5){if(_0x5b6dc5){return db[_0x477a('0x1f')][_0x477a('0x20')]({'ItemTypeId':_0x416ffd,'description':_0x50597e,'OrderBy':_0x228736},{'where':{'CmContactId':_0x165bf8,'item':_0x2ff074}})['then'](function(_0x82d274){_0x2996b1({'res':_0x477a('0x21')});});}else{return db[_0x477a('0x1f')][_0x477a('0x22')]({'CmContactId':_0x165bf8,'item':_0x2ff074,'description':_0x50597e,'ItemTypeId':_0x416ffd,'OrderBy':_0x228736,'ItemClass':_0x477a('0x23')})['then'](function(_0x4f4db4){_0x2996b1({'res':_0x477a('0x24')});});}});});}function insertCmHopper(_0x2924a6,_0x1e5c83,_0x32dacc,_0x29e57f,_0x5aa36b){var _0x1670f7=['cm_contacts.phone',_0x477a('0x25'),_0x477a('0x26'),'cm_contacts.ListId',_0x1e5c83+'.'+_0x29e57f,_0x477a('0x27'),_0x477a('0x28'),'cm_contacts.priority',_0x477a('0x29'),'\x22'+_0x5aa36b+'\x22'];return squel[_0x477a('0x2a')]()[_0x477a('0x2b')](_0x477a('0x2c'))[_0x477a('0x2d')](['phone',_0x477a('0x2e'),_0x477a('0x2f'),_0x477a('0x30'),_0x29e57f,_0x477a('0x31'),_0x477a('0x32'),'priority','UserId',_0x477a('0x33')],squel['select']()[_0x477a('0x34')](_0x1670f7)[_0x477a('0xf')](_0x1e5c83)[_0x477a('0x10')](_0x477a('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x1e5c83+'.CmListId')[_0x477a('0x10')](_0x32dacc,null,_0x32dacc+_0x477a('0x11')+_0x1e5c83+'.'+_0x29e57f)['where'](_0x1e5c83+_0x477a('0x36'),_0x2924a6)[_0x477a('0x37')](_0x477a('0x38'),NOW)['where'](_0x477a('0x39'),selectNotIn(_0x1e5c83,_0x32dacc,_0x29e57f,_0x477a('0x2c'),[_0x477a('0x3a'),_0x477a('0x3b')]))['where'](_0x477a('0x39'),selectNotIn(_0x1e5c83,_0x32dacc,_0x29e57f,_0x477a('0x2c'),[_0x477a('0x3a')])))['toString']();}function insertCmHopperBlack(_0x21616d,_0x2e696c,_0x3d02f5,_0x202d2d){var _0x69c68f=[_0x477a('0x3c'),_0x477a('0x26'),_0x477a('0x3d'),_0x2e696c+'.'+_0x202d2d,_0x477a('0x27'),'cm_contacts.updatedAt'];return squel[_0x477a('0x2a')]()[_0x477a('0x2b')](_0x477a('0x3e'))[_0x477a('0x2d')]([_0x477a('0x3f'),'ContactId',_0x477a('0x30'),_0x202d2d,'createdAt',_0x477a('0x32')],squel[_0x477a('0xe')]()[_0x477a('0x34')](_0x69c68f)['from'](_0x2e696c)['join'](_0x477a('0x35'),null,_0x477a('0x40')+_0x2e696c+'.CmListId')[_0x477a('0x10')](_0x3d02f5,null,_0x3d02f5+_0x477a('0x11')+_0x2e696c+'.'+_0x202d2d)[_0x477a('0x37')](_0x2e696c+_0x477a('0x36'),_0x21616d)[_0x477a('0x37')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x477a('0xe')]()['field']('phone')[_0x477a('0xf')]('cm_hopper_black')[_0x477a('0x37')](_0x477a('0x41'),_0x21616d)[_0x477a('0x37')](_0x202d2d+_0x477a('0x12')+_0x2e696c+'.'+_0x202d2d)))[_0x477a('0x42')]();}function insertTzCmHopper(_0xacc6fc,_0x1cf18a,_0x5e6327,_0x29d2bd,_0x344e96,_0x221977){var _0x23c3d0=[_0x477a('0x3c'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x221977+_0x477a('0x43'),_0x477a('0x26'),'cm_contacts.ListId',_0x1cf18a+'.'+_0x29d2bd,'cm_contacts.createdAt',_0x477a('0x28'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x344e96+'\x22'];var _0xeb4924=squel[_0x477a('0x2a')]()[_0x477a('0x2b')](_0x477a('0x2c'))['fromQuery'](['phone',_0x477a('0x2e'),_0x477a('0x2f'),_0x477a('0x30'),_0x29d2bd,_0x477a('0x31'),_0x477a('0x32'),_0x477a('0x44'),_0x477a('0x45'),_0x477a('0x33')],squel['select']()[_0x477a('0x34')](_0x23c3d0)[_0x477a('0xf')](_0x1cf18a)['join'](_0x477a('0x35'),null,_0x477a('0x40')+_0x1cf18a+_0x477a('0x46'))[_0x477a('0x10')](_0x5e6327,null,_0x5e6327+_0x477a('0x11')+_0x1cf18a+'.'+_0x29d2bd)[_0x477a('0x10')](_0x221977,null,_0x221977+_0x477a('0x11')+_0x1cf18a+'.'+_0x29d2bd)[_0x477a('0x37')](_0x1cf18a+_0x477a('0x36'),_0xacc6fc)[_0x477a('0x37')](_0x477a('0x38'),NOW)[_0x477a('0x37')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cf18a,_0x5e6327,_0x29d2bd,_0x477a('0x2c'),[_0x477a('0x3a'),_0x477a('0x3b')]))[_0x477a('0x37')](_0x477a('0x39'),selectNotIn(_0x1cf18a,_0x5e6327,_0x29d2bd,_0x477a('0x2c'),[_0x477a('0x3a')])))[_0x477a('0x42')]();return _0xeb4924;}function insertTzCmHopperBlack(_0xd79dd3,_0x47436d,_0x1b19af,_0xa41dc1){var _0x20999c=[_0x477a('0x3c'),_0x477a('0x26'),_0x477a('0x3d'),_0x47436d+'.'+_0xa41dc1,_0x477a('0x27'),_0x477a('0x28')];return squel[_0x477a('0x2a')]()[_0x477a('0x2b')](_0x477a('0x3e'))[_0x477a('0x2d')]([_0x477a('0x3f'),_0x477a('0x2f'),_0x477a('0x30'),_0xa41dc1,_0x477a('0x31'),_0x477a('0x32')],squel[_0x477a('0xe')]()[_0x477a('0x34')](_0x20999c)[_0x477a('0xf')](_0x47436d)[_0x477a('0x10')](_0x477a('0x35'),null,_0x477a('0x40')+_0x47436d+_0x477a('0x46'))[_0x477a('0x10')](_0x1b19af,null,_0x1b19af+'.id\x20=\x20'+_0x47436d+'.'+_0xa41dc1)[_0x477a('0x37')](_0x47436d+'.CmListId\x20=\x20?',_0xd79dd3)[_0x477a('0x37')](_0x477a('0x38'),NOW)[_0x477a('0x37')](_0x477a('0x39'),squel[_0x477a('0xe')]()[_0x477a('0x47')](_0x477a('0x3f'))[_0x477a('0xf')](_0x477a('0x3e'))[_0x477a('0x37')]('ListId\x20=\x20?',_0xd79dd3)[_0x477a('0x37')](_0xa41dc1+_0x477a('0x12')+_0x47436d+'.'+_0xa41dc1)))['toString']();}function insertCmHopperAdditionalPhones(_0x43686c){var _0x5c87e0=[_0x477a('0x48'),'cm_contact_has_items.item',_0x477a('0x49'),_0x477a('0x4a'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x477a('0x2b')](_0x477a('0x4b'))[_0x477a('0x2d')](['CmHopperId',_0x477a('0x3f'),_0x477a('0x4c'),_0x477a('0x31'),'updatedAt'],squel[_0x477a('0xe')]()['fields'](_0x5c87e0)[_0x477a('0xf')](_0x477a('0x2c'))[_0x477a('0x10')](_0x477a('0x35'),null,_0x477a('0x4d'))[_0x477a('0x10')](_0x477a('0x4e'),null,_0x477a('0x4f'))[_0x477a('0x37')](_0x477a('0x50'),_0x43686c)[_0x477a('0x37')](_0x477a('0x38'),NOW))[_0x477a('0x42')]();}function insertCmContact(_0x2d7ca1,_0x336843,_0x46ee80,_0x2f3983){var _0x1302a3=_['concat'](_['keys'](_0x2f3983),[_0x477a('0x30'),_0x477a('0x51'),_0x477a('0x31'),_0x477a('0x32')]);return squel[_0x477a('0x2a')]()[_0x477a('0x2b')](_0x477a('0x35'))[_0x477a('0x2d')](_0x1302a3,squel[_0x477a('0xe')]()['fields'](_0x1302a3)[_0x477a('0xf')](_0x336843)[_0x477a('0x37')]('('+_0x46ee80[_0x477a('0x10')](',')+_0x477a('0x52'),squel[_0x477a('0xe')]()[_0x477a('0x34')](_0x46ee80)[_0x477a('0xf')](_0x477a('0x35'))[_0x477a('0x37')]('ListId\x20=\x20?',_0x2d7ca1)[_0x477a('0x37')]('deletedAt\x20IS\x20NULL'))[_0x477a('0x37')](_0x477a('0x53'),squel[_0x477a('0xe')]()[_0x477a('0x47')]('MIN(id)','min_id')[_0x477a('0xf')](_0x336843)[_0x477a('0x54')](_0x46ee80[_0x477a('0x10')](','))))['toString']();}function handleStop(){logger[_0x477a('0x55')](_0x477a('0x56'));stopped=!![];}function handleUncaughtException(_0x353cb6){logger[_0x477a('0x57')](_0x353cb6[_0x477a('0x58')]);process[_0x477a('0x59')](0x1);}function handleError(_0x5c61fc,_0x586963){stats['errors']['push']({'name':_0x586963[_0x477a('0x5a')],'message':_0x586963['message'],'row':_0x5c61fc});}function handleQuery(_0x1602e5){logger[_0x477a('0x55')](_0x1602e5);return db['sequelize'][_0x477a('0x5b')](_0x1602e5)['spread'](function(_0x27a7a9){results[_0x477a('0x1d')](_0x27a7a9);})[_0x477a('0x5c')](function(_0x5e8682){logger[_0x477a('0x57')](_0x5e8682[_0x477a('0x58')]);});}function updateTzCampaigns(_0x57c59d){return new Promise(function(_0x31a21a,_0x533365){var _0x3e1e25=squel[_0x477a('0xe')]()[_0x477a('0x34')]([_0x477a('0x5d'),_0x477a('0x5e')])[_0x477a('0xf')](_0x477a('0x5f'))[_0x477a('0x10')](_0x477a('0x60'),null,_0x477a('0x61'))[_0x477a('0x37')](_0x477a('0x62')+_0x57c59d);db[_0x477a('0x63')]['query'](_0x3e1e25['toString']())[_0x477a('0x64')](function(_0x7278af){var _0x395a22=[];for(var _0x25d74c=0x0;_0x25d74c<_0x7278af[_0x477a('0x18')];_0x25d74c++){_0x395a22[_0x477a('0x1d')](getTimezoneData(_0x7278af[_0x25d74c],tmp_campaigns));}BPromise[_0x477a('0x19')](_0x395a22)['then'](function(){_0x31a21a({'val':0x1});});})[_0x477a('0x5c')](function(_0x49ef92){logger['error'](_0x49ef92['message']);_0x31a21a({'val':0x0});});});}function updateTzVoiceQueues(_0x36e5af){return new Promise(function(_0x2afc9b,_0x46a248){var _0x3453c0=squel[_0x477a('0xe')]()[_0x477a('0x34')]([_0x477a('0x65'),_0x477a('0x66')])[_0x477a('0xf')](_0x477a('0x67'))[_0x477a('0x10')]('voice_queues_has_cm_lists',null,_0x477a('0x68'))[_0x477a('0x37')](_0x477a('0x69')+_0x36e5af);db['sequelize'][_0x477a('0x5b')](_0x3453c0['toString']())['spread'](function(_0x4c4c6f){var _0x3fe43b=[];for(var _0x3ecc38=0x0;_0x3ecc38<_0x4c4c6f['length'];_0x3ecc38++){_0x3fe43b[_0x477a('0x1d')](getTimezoneData(_0x4c4c6f[_0x3ecc38],tmp_voice_queues));}BPromise[_0x477a('0x19')](_0x3fe43b)[_0x477a('0x17')](function(){_0x2afc9b({'val':0x1});});})[_0x477a('0x5c')](function(_0x5910f9){logger[_0x477a('0x57')](_0x5910f9[_0x477a('0x58')]);_0x2afc9b({'val':0x0});});});}function getTimezoneData(_0x43ef59,_0x58a9ee){return new Promise(function(_0x2a2b86,_0x390808){var _0x5a2261=shared[_0x477a('0x6a')];var _0x536ab8=_0x5a2261[_0x43ef59[_0x477a('0x6b')]];if(_['isNil'](_0x536ab8)){_0x2a2b86({'ret':0x1});}else{var _0x3cd606=_0x536ab8['utcOffset'];var _0x1bf149=squel[_0x477a('0x2a')]()['into'](_0x58a9ee)[_0x477a('0x6c')]('id',_0x43ef59['id'])[_0x477a('0x6c')]('offset',_0x3cd606)[_0x477a('0x6c')](_0x477a('0x6b'),_0x43ef59['dialTimezone'])[_0x477a('0x42')]();return db[_0x477a('0x63')][_0x477a('0x5b')](_0x1bf149)[_0x477a('0x64')](function(_0x56d739){_0x2a2b86({'ret':0x1});})['catch'](function(_0x25c4df){logger['error'](_0x25c4df[_0x477a('0x58')]);_0x390808({'ret':0x1});});}});}function handleTZQuery(_0x336cc7){logger[_0x477a('0x55')](_0x336cc7);return db[_0x477a('0x63')][_0x477a('0x5b')](_0x336cc7)[_0x477a('0x64')](function(_0x116a55){})[_0x477a('0x5c')](function(_0x528ffd){logger[_0x477a('0x57')](_0x528ffd['message']);});}function main(_0x173d1b,_0x2a880a,_0x16bca9,_0x239eb8){logger[_0x477a('0x55')]('main',_0x173d1b,JSON['stringify'](_0x2a880a));process[_0x477a('0x6d')]('start');var _0x2766a8=_0x2a880a[_0x477a('0x6e')];var _0x354483=_[_0x477a('0x6f')](_0x2766a8);var _0x2777ef=_0x2a880a['socket_timestamp'];var _0x9dca72=path[_0x477a('0x10')](config[_0x477a('0x70')],'server/files/tmp',_0x2777ef+_0x477a('0x71'));hasTZ=_['keys'](_0x2766a8)[_0x477a('0x72')]('dialTimezone');var _0x3bd443=_[_0x477a('0x73')](_0x2766a8)[_0x477a('0x10')]();logger[_0x477a('0x55')](_0x477a('0x74'),_0x3bd443);db[_0x477a('0x75')]['findAll']({'raw':!![],'attributes':['id',_0x477a('0x76')]})[_0x477a('0x17')](function(_0x18d6f1){for(var _0x1b1df7=0x0;_0x1b1df7<_0x18d6f1[_0x477a('0x18')];_0x1b1df7++){if(_0x18d6f1[_0x1b1df7][_0x477a('0x76')]in _0x2766a8){contactItemTypes[_0x477a('0x1d')](_0x18d6f1[_0x1b1df7]);delete _0x354483[_0x18d6f1[_0x1b1df7][_0x477a('0x76')]];hasAdditionalPhones=!![];}for(var _0x3ed78f in _0x2766a8){if(_0x18d6f1[_0x1b1df7][_0x477a('0x76')]+_0x477a('0x77')===_0x3ed78f){phoneDescriptions[_0x477a('0x1d')]({'itemTypeId':_0x18d6f1[_0x1b1df7]['id'],'description':_0x3ed78f});delete _0x354483[_0x3ed78f];}}}if(hasAdditionalPhones)_0x354483[_0x477a('0x16')]='';var _0x4c05ea=_[_0x477a('0x73')](_0x354483)[_0x477a('0x10')]();logger[_0x477a('0x55')](_0x477a('0x74'),_0x4c05ea);fs[_0x477a('0x78')](_0x9dca72,_0x4c05ea+'\x0a');Papa[_0x477a('0x79')](fs[_0x477a('0x7a')](_0x173d1b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e3892,_0x54c059){try{for(var _0x23a5c2=0x0,_0x47f58e=[];_0x23a5c2<_0x5e3892[_0x477a('0x7b')]['length'];_0x23a5c2++){stats[_0x477a('0x7c')]+=0x1;if(_0x5e3892[_0x477a('0x7d')][_0x23a5c2]){handleError(_0x5e3892[_0x477a('0x7b')][_0x23a5c2],_0x5e3892[_0x477a('0x7d')][_0x23a5c2]);}else{var _0x375939=[];var _0x4a181e=[];var _0x1a5d1c={};for(var _0x16ebc5 in _0x2766a8){let _0x369564=contactItemTypes[_0x477a('0x7e')](_0x29be43=>_0x29be43['name']===_0x16ebc5);let _0x16062f=contactItemTypes[_0x477a('0x7e')](_0x4c1e44=>_0x4c1e44['name']+_0x477a('0x77')===_0x16ebc5);if(_['isNil'](_0x369564)&&_[_0x477a('0x1a')](_0x16062f)){if(_0x2766a8[_0x477a('0x7f')](_0x16ebc5)){if(_0x5e3892[_0x477a('0x7b')][_0x23a5c2][_0x2766a8[_0x16ebc5]]){var _0x10dc8d=_[_0x477a('0x80')](_0x5e3892[_0x477a('0x7b')][_0x23a5c2][_0x2766a8[_0x16ebc5]][_0x477a('0x81')](/"/g,'\x27'));switch(_0x16ebc5){case _0x477a('0x2e'):var _0xe02cdc=moment(_0x10dc8d,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xe02cdc[_0x477a('0x82')]()){_0x47f58e[_0x477a('0x1d')]('\x22'+_0x10dc8d+'\x22');}else{_0x375939[_0x477a('0x1d')](_0x477a('0x83'));}break;case _0x477a('0x44'):var _0x2483a8=parseInt(_0x10dc8d);_0x10dc8d=_['isNaN'](_0x2483a8)||_0x2483a8<0x0||_0x2483a8>0x4?_0x239eb8?0x3:0x2:_0x2483a8;_0x47f58e[_0x477a('0x1d')]('\x22'+_0x10dc8d+'\x22');break;case _0x477a('0x45'):var _0x4c3d59=parseInt(_0x10dc8d);if(_[_0x477a('0x84')](_0x4c3d59)&&_['includes'](_0x16bca9,_0x4c3d59)){_0x47f58e[_0x477a('0x1d')]('\x22'+_0x4c3d59+'\x22');}else{_0x375939[_0x477a('0x1d')](_0x477a('0x85'));}break;case _0x477a('0x86'):if(isEmail(_0x10dc8d)){_0x47f58e['push']('\x22'+_0x10dc8d+'\x22');}else{_0x375939[_0x477a('0x1d')](_0x477a('0x87'));}break;case _0x477a('0x88'):var _0x3e04e7=moment(_0x10dc8d,_0x477a('0x89'),!![]);if(_0x3e04e7[_0x477a('0x82')]()){_0x47f58e['push']('\x22'+_0x10dc8d+'\x22');}else{_0x375939[_0x477a('0x1d')](_0x477a('0x8a'));}break;case _0x477a('0x6b'):var _0x1397ab=shared['timezones'];var _0x23a21d=_0x1397ab[_0x10dc8d];if(!_[_0x477a('0x1a')](_0x23a21d)){var _0x132aaf=_0x23a21d[_0x477a('0x8b')];_0x47f58e['push']('\x22'+_0x10dc8d+'\x22');_0x47f58e[_0x477a('0x1d')]('\x22'+_0x132aaf+'\x22');}break;default:_0x47f58e[_0x477a('0x1d')]('\x22'+_0x10dc8d+'\x22');}}else{switch(_0x16ebc5){case _0x477a('0x8c'):case _0x477a('0x3f'):_0x375939[_0x477a('0x1d')](_0x16ebc5+'\x20not\x20specified');break;default:_0x47f58e[_0x477a('0x1d')]('\x22\x22');}}}}else{var _0x3f943e='';if(!_[_0x477a('0x1a')](_0x369564)){if(!_0x1a5d1c[_0x477a('0x7f')](_0x369564['id'])){if(!_['isNil'](_0x5e3892[_0x477a('0x7b')][_0x23a5c2][_0x2766a8[_0x16ebc5]])){var _0x10dc8d=_[_0x477a('0x80')](_0x5e3892[_0x477a('0x7b')][_0x23a5c2][_0x2766a8[_0x16ebc5]][_0x477a('0x81')](/"/g,'\x27'));var _0x30742c=phoneDescriptions[_0x477a('0x7e')](_0x434de2=>_0x434de2[_0x477a('0x8d')]===_0x369564['id']);if(!_[_0x477a('0x1a')](_0x30742c)){var _0x4d79a9=_[_0x477a('0x80')](_0x5e3892[_0x477a('0x7b')][_0x23a5c2][_0x2766a8[_0x30742c[_0x477a('0x8e')]]][_0x477a('0x81')](/"/g,'\x27'));if(!_[_0x477a('0x1a')](_0x4d79a9))_0x10dc8d=_0x10dc8d+'§'+_0x4d79a9;}if(_0x3f943e=='')_0x3f943e=_0x10dc8d;else _0x3f943e+='|'+_0x10dc8d;}_0x4a181e['push'](_0x369564['id']+':'+_0x3f943e);_0x1a5d1c[_0x369564['id']]=0x1;}}}}if(hasAdditionalPhones){_0x47f58e['push']('\x22'+_0x4a181e['join'](';')+'\x22');}if(_0x375939[_0x477a('0x18')]){handleError(_0x5e3892[_0x477a('0x7b')][_0x23a5c2],{'code':_0x477a('0x8f'),'message':_0x375939[_0x477a('0x10')]()});}else{fs[_0x477a('0x90')](_0x9dca72,_0x47f58e[_0x477a('0x10')]()+'\x0a');}_0x47f58e=[];}if(!(stats[_0x477a('0x7c')]%0xc8)){socket[_0x477a('0x91')](_0x477a('0x92')+_0x2777ef,stats);stats[_0x477a('0x7d')]=[];}}if(stopped){logger[_0x477a('0x55')]('Abort\x20parser');_0x54c059[_0x477a('0x93')]();}}catch(_0x1fcff5){handleError(_0x5e3892[_0x477a('0x7b')][_0x23a5c2],{'code':_0x477a('0x94'),'message':_0x1fcff5[_0x477a('0x58')]});logger[_0x477a('0x57')](_0x477a('0x95'),_0x1fcff5[_0x477a('0x58')]);}},'complete':function(){try{var _0x5ed301=[];var _0x301169=[];var _0x17e4a9=_0x477a('0x35');if(_0x2a880a['duplicates']&&_0x2a880a[_0x477a('0x96')][_0x477a('0x18')]){_0x17e4a9='cm_contacts_'+_0x2777ef;_0x5ed301[_0x477a('0x1d')](_0x477a('0x97')+_0x17e4a9+_0x477a('0x98'));}tmp_campaigns=_0x477a('0x99')+_0x2777ef;tmp_voice_queues=_0x477a('0x9a')+_0x2777ef;_0x301169[_0x477a('0x1d')](_0x477a('0x97')+tmp_campaigns+_0x477a('0x9b'));_0x301169[_0x477a('0x1d')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x477a('0x9b'));BPromise['each'](_0x301169,handleTZQuery)[_0x477a('0x17')](function(_0x4b6aac){updateTzCampaigns(_0x2a880a['ListId'])['then'](function(_0x6fc30c){updateTzVoiceQueues(_0x2a880a[_0x477a('0x30')])[_0x477a('0x17')](function(_0x8c4fdc){if(hasTZ)_0x4c05ea=_0x4c05ea[_0x477a('0x81')](_0x477a('0x6b'),_0x477a('0x9c'));var _0x311e85=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',_0x9dca72,_0x17e4a9,_0x4c05ea,_0x2a880a[_0x477a('0x30')],_0x2a880a[_0x477a('0x51')]||null,NOW,NOW);if(_[_0x477a('0x1a')](_0x2766a8[_0x477a('0x2e')])){_0x311e85+=_0x477a('0x9d');}_0x5ed301['push'](_0x311e85);if(_0x2a880a['duplicates']&&_0x2a880a[_0x477a('0x96')]['length']){_0x5ed301[_0x477a('0x1d')](insertCmContact(_0x2a880a[_0x477a('0x30')],_0x17e4a9,_0x2a880a[_0x477a('0x96')],_0x2766a8));_0x5ed301[_0x477a('0x1d')](_0x477a('0x9e')+_0x17e4a9+';');}BPromise['each'](_0x5ed301,handleQuery)[_0x477a('0x17')](function(_0x4b49f0){BPromise[_0x477a('0x19')]([handleAdditionalPhones()])[_0x477a('0x17')](function(){_0x5ed301=[];for(var _0x567f12=0x0;_0x567f12\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','length','push','all','then','split','isNil','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_hopper_black','fields','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','ContactId','priority','cm_contacts','\x22always\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error','message','info','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','catch','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','dialTimezone','utcOffset','set','offset','main','stringify','start','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','name','_description','parse','createReadStream','data','errors','trim','replace','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','\x20not\x20specified','hasOwnProperty','find','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','VoiceQueueId'];(function(_0x24472f,_0x469831){var _0x1f7ad1=function(_0x3e4607){while(--_0x3e4607){_0x24472f['push'](_0x24472f['shift']());}};_0x1f7ad1(++_0x469831);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x45ef76,_0x237f80){_0x45ef76=_0x45ef76-0x0;var _0x52e328=_0xe5e3[_0x45ef76];return _0x52e328;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x3e5e('0x0'));var Papa=require(_0x3e5e('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x3e5e('0x2'));var squel=require('squel');var Redis=require(_0x3e5e('0x3'));var db=require(_0x3e5e('0x4'))['db'];var config=require('../../../config/environment');var shared=require(_0x3e5e('0x5'));var logger=require(_0x3e5e('0x6'))('import');config[_0x3e5e('0x7')]=_['defaults'](config[_0x3e5e('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e5e('0x8'))(new Redis(config[_0x3e5e('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x3e5e('0x9')](_0x3e5e('0xa'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x3e5e('0x9')](_0x3e5e('0xa'));function isEmail(_0x16f64b){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))*$/[_0x3e5e('0xb')](_0x16f64b);}function selectNotIn(_0x19b93c,_0x135011,_0x1dd99b,_0x5c9349,_0x83263a){return squel[_0x3e5e('0xc')]()[_0x3e5e('0xd')](_0x3e5e('0xe'))[_0x3e5e('0xf')](_0x5c9349)[_0x3e5e('0x10')](_0x135011,null,_0x135011+_0x3e5e('0x11')+_0x5c9349+'.'+_0x1dd99b)[_0x3e5e('0x12')](_0x5c9349+'.'+_0x1dd99b+_0x3e5e('0x13')+_0x19b93c+'.'+_0x1dd99b)[_0x3e5e('0x12')](_0x135011+_0x3e5e('0x14')+_0x83263a[_0x3e5e('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1949bc,_0x9065c8){promisesAdditionalPhones=[];return db['CmContact'][_0x3e5e('0x15')]({'raw':!![],'attributes':['id',_0x3e5e('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x5dea39){if(_0x5dea39!==null){var _0x15f414=[];for(var _0x106218=0x0;_0x106218<_0x5dea39[_0x3e5e('0x17')];_0x106218++){var _0x445648=_0x5dea39[_0x106218];_0x15f414[_0x3e5e('0x18')](insertAdditionalPhones(_0x445648));}}Promise[_0x3e5e('0x19')](_0x15f414)[_0x3e5e('0x1a')](function(){_0x1949bc({'val':0x1});});});});}function insertAdditionalPhones(_0x5d84b7){return new Promise(function(_0x229977,_0x859854){var _0x295e8c=_0x5d84b7[_0x3e5e('0x16')];var _0xfc5acc=_0x295e8c[_0x3e5e('0x1b')](';');var _0x3d2d90=[];orderBy=0x0;for(var _0x59b25a=0x0;_0x59b25a<_0xfc5acc['length'];_0x59b25a++){_0x3d2d90['push'](splitAdditionalPhone(_0x5d84b7['id'],_0xfc5acc[_0x59b25a]));}Promise[_0x3e5e('0x19')](_0x3d2d90)[_0x3e5e('0x1a')](function(){_0x229977({'val':_0xfc5acc['length']});});});}function splitAdditionalPhone(_0x5c9169,_0x251ae5){return new Promise(function(_0xd24e1d,_0x2e19d6){var _0x1d199a=_0x251ae5[_0x3e5e('0x1b')](':');var _0x212a2d=_0x1d199a[0x0];var _0x3ee768=_0x1d199a[0x1];if(!_[_0x3e5e('0x1c')](_0x3ee768)){var _0x457db9=_0x3ee768['split']('|');var _0x3ea062=[];for(var _0x409a5c=0x0;_0x409a5c<_0x457db9[_0x3e5e('0x17')];_0x409a5c++){if(_0x457db9[_0x409a5c]!==''){var _0x3c61ba=_['filter'](promisesAdditionalPhones,{'contactId':_0x5c9169,'phone':_0x457db9[_0x409a5c]});if(_0x3c61ba[_0x3e5e('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x3e5e('0x18')]({'contactId':_0x5c9169,'contactTypeId':_0x212a2d,'phone':_0x457db9[_0x409a5c],'orderBy':orderBy});}}}_0xd24e1d({'ok':0x1});}else _0xd24e1d({'res':0x0});});}function createAdditionalPhone(_0xdcc088,_0x31b570,_0x28af5e,_0x37a02c){var _0x13d25c='';var _0x2d4c60='';var _0x5dabb1=_0x28af5e['split']('§');_0x13d25c=_0x5dabb1[0x0];if(_0x5dabb1[_0x3e5e('0x17')]==0x2)_0x2d4c60=_0x5dabb1[0x1];return new Promise(function(_0x2c4e88,_0x189ea1){return db['CmContactHasItem'][_0x3e5e('0x1d')]({'where':{'CmContactId':_0xdcc088,'item':_0x13d25c}})['then'](function(_0x412b2c){if(_0x412b2c){return db[_0x3e5e('0x1e')][_0x3e5e('0x1f')]({'ItemTypeId':_0x31b570,'description':_0x2d4c60,'OrderBy':_0x37a02c},{'where':{'CmContactId':_0xdcc088,'item':_0x13d25c}})[_0x3e5e('0x1a')](function(_0x377ca2){_0x2c4e88({'res':_0x3e5e('0x20')});});}else{return db[_0x3e5e('0x1e')][_0x3e5e('0x21')]({'CmContactId':_0xdcc088,'item':_0x13d25c,'description':_0x2d4c60,'ItemTypeId':_0x31b570,'OrderBy':_0x37a02c,'ItemClass':_0x3e5e('0x22')})[_0x3e5e('0x1a')](function(_0x32bb84){_0x2c4e88({'res':_0x3e5e('0x23')});});}});});}function insertCmHopper(_0x4be358,_0x29aae1,_0x16cece,_0x20001c,_0x7be4ff){var _0x5079d4=[_0x3e5e('0x24'),_0x3e5e('0x25'),'cm_contacts.id',_0x3e5e('0x26'),_0x29aae1+'.'+_0x20001c,_0x3e5e('0x27'),_0x3e5e('0x28'),_0x3e5e('0x29'),'cm_contacts.UserId','\x22'+_0x7be4ff+'\x22'];return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3e5e('0x2c'))[_0x3e5e('0x2d')]([_0x3e5e('0xe'),'scheduledat','ContactId',_0x3e5e('0x2e'),_0x20001c,_0x3e5e('0x2f'),_0x3e5e('0x30'),'priority',_0x3e5e('0x31'),_0x3e5e('0x32')],squel[_0x3e5e('0xc')]()['fields'](_0x5079d4)[_0x3e5e('0xf')](_0x29aae1)[_0x3e5e('0x10')]('cm_contacts',null,_0x3e5e('0x33')+_0x29aae1+_0x3e5e('0x34'))[_0x3e5e('0x10')](_0x16cece,null,_0x16cece+_0x3e5e('0x11')+_0x29aae1+'.'+_0x20001c)[_0x3e5e('0x12')](_0x29aae1+_0x3e5e('0x35'),_0x4be358)[_0x3e5e('0x12')](_0x3e5e('0x36'),NOW)[_0x3e5e('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x29aae1,_0x16cece,_0x20001c,_0x3e5e('0x2c'),['\x22always\x22',_0x3e5e('0x37')]))[_0x3e5e('0x12')](_0x3e5e('0x38'),selectNotIn(_0x29aae1,_0x16cece,_0x20001c,'cm_hopper',['\x22always\x22'])))[_0x3e5e('0x39')]();}function insertCmHopperBlack(_0x51b11c,_0x2d43e5,_0x16eaae,_0x3af6d8){var _0x19f2fe=['cm_contacts.phone',_0x3e5e('0x3a'),_0x3e5e('0x26'),_0x2d43e5+'.'+_0x3af6d8,_0x3e5e('0x27'),'cm_contacts.updatedAt'];return squel['insert']()[_0x3e5e('0x2b')](_0x3e5e('0x3b'))[_0x3e5e('0x2d')]([_0x3e5e('0xe'),'ContactId',_0x3e5e('0x2e'),_0x3af6d8,'createdAt','updatedAt'],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x19f2fe)[_0x3e5e('0xf')](_0x2d43e5)[_0x3e5e('0x10')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2d43e5+_0x3e5e('0x34'))[_0x3e5e('0x10')](_0x16eaae,null,_0x16eaae+_0x3e5e('0x11')+_0x2d43e5+'.'+_0x3af6d8)[_0x3e5e('0x12')](_0x2d43e5+'.CmListId\x20=\x20?',_0x51b11c)[_0x3e5e('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3e5e('0x38'),squel[_0x3e5e('0xc')]()[_0x3e5e('0xd')]('phone')[_0x3e5e('0xf')](_0x3e5e('0x3b'))['where'](_0x3e5e('0x3d'),_0x51b11c)['where'](_0x3af6d8+_0x3e5e('0x13')+_0x2d43e5+'.'+_0x3af6d8)))[_0x3e5e('0x39')]();}function insertTzCmHopper(_0x4635c0,_0x373ddf,_0x56610a,_0x2a4ee5,_0x206c0d,_0x3561ca){var _0x40ed7f=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x3561ca+_0x3e5e('0x3e'),_0x3e5e('0x3a'),_0x3e5e('0x26'),_0x373ddf+'.'+_0x2a4ee5,'cm_contacts.createdAt',_0x3e5e('0x28'),_0x3e5e('0x29'),'cm_contacts.UserId','\x22'+_0x206c0d+'\x22'];var _0x309634=squel['insert']()[_0x3e5e('0x2b')](_0x3e5e('0x2c'))[_0x3e5e('0x2d')]([_0x3e5e('0xe'),_0x3e5e('0x3f'),_0x3e5e('0x40'),_0x3e5e('0x2e'),_0x2a4ee5,_0x3e5e('0x2f'),_0x3e5e('0x30'),_0x3e5e('0x41'),_0x3e5e('0x31'),'recallme'],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x40ed7f)['from'](_0x373ddf)[_0x3e5e('0x10')](_0x3e5e('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x373ddf+'.CmListId')[_0x3e5e('0x10')](_0x56610a,null,_0x56610a+_0x3e5e('0x11')+_0x373ddf+'.'+_0x2a4ee5)[_0x3e5e('0x10')](_0x3561ca,null,_0x3561ca+_0x3e5e('0x11')+_0x373ddf+'.'+_0x2a4ee5)[_0x3e5e('0x12')](_0x373ddf+'.CmListId\x20=\x20?',_0x4635c0)[_0x3e5e('0x12')](_0x3e5e('0x36'),NOW)['where'](_0x3e5e('0x38'),selectNotIn(_0x373ddf,_0x56610a,_0x2a4ee5,_0x3e5e('0x2c'),[_0x3e5e('0x43'),_0x3e5e('0x37')]))[_0x3e5e('0x12')](_0x3e5e('0x38'),selectNotIn(_0x373ddf,_0x56610a,_0x2a4ee5,_0x3e5e('0x2c'),[_0x3e5e('0x43')])))['toString']();return _0x309634;}function insertTzCmHopperBlack(_0x4b0da5,_0x175c7d,_0x42a231,_0x1df8ef){var _0xe7f6f0=[_0x3e5e('0x24'),_0x3e5e('0x3a'),_0x3e5e('0x26'),_0x175c7d+'.'+_0x1df8ef,_0x3e5e('0x27'),_0x3e5e('0x28')];return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3e5e('0x3b'))['fromQuery']([_0x3e5e('0xe'),_0x3e5e('0x40'),_0x3e5e('0x2e'),_0x1df8ef,_0x3e5e('0x2f'),_0x3e5e('0x30')],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0xe7f6f0)['from'](_0x175c7d)[_0x3e5e('0x10')](_0x3e5e('0x42'),null,_0x3e5e('0x33')+_0x175c7d+_0x3e5e('0x34'))[_0x3e5e('0x10')](_0x42a231,null,_0x42a231+_0x3e5e('0x11')+_0x175c7d+'.'+_0x1df8ef)['where'](_0x175c7d+_0x3e5e('0x35'),_0x4b0da5)[_0x3e5e('0x12')](_0x3e5e('0x36'),NOW)['where'](_0x3e5e('0x38'),squel['select']()['field'](_0x3e5e('0xe'))['from'](_0x3e5e('0x3b'))[_0x3e5e('0x12')](_0x3e5e('0x3d'),_0x4b0da5)['where'](_0x1df8ef+_0x3e5e('0x13')+_0x175c7d+'.'+_0x1df8ef)))['toString']();}function insertCmHopperAdditionalPhones(_0x395fcf){var _0x15dcb3=[_0x3e5e('0x44'),_0x3e5e('0x45'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x3e5e('0x46')];return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3e5e('0x47'))[_0x3e5e('0x2d')]([_0x3e5e('0x48'),'phone',_0x3e5e('0x49'),_0x3e5e('0x2f'),_0x3e5e('0x30')],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x15dcb3)[_0x3e5e('0xf')]('cm_hopper')[_0x3e5e('0x10')](_0x3e5e('0x42'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x3e5e('0x4a'),null,_0x3e5e('0x4b'))[_0x3e5e('0x12')](_0x3e5e('0x4c'),_0x395fcf)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x3e5e('0x39')]();}function insertCmContact(_0x4c8477,_0x486740,_0x1f083a,_0x4b7c4d){var _0x25c677=_[_0x3e5e('0x4d')](_[_0x3e5e('0x4e')](_0x4b7c4d),[_0x3e5e('0x2e'),_0x3e5e('0x4f'),'createdAt',_0x3e5e('0x30')]);return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')]('cm_contacts')[_0x3e5e('0x2d')](_0x25c677,squel['select']()[_0x3e5e('0x3c')](_0x25c677)[_0x3e5e('0xf')](_0x486740)[_0x3e5e('0x12')]('('+_0x1f083a[_0x3e5e('0x10')](',')+_0x3e5e('0x50'),squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x1f083a)['from'](_0x3e5e('0x42'))['where'](_0x3e5e('0x3d'),_0x4c8477)['where'](_0x3e5e('0x51')))[_0x3e5e('0x12')](_0x3e5e('0x52'),squel[_0x3e5e('0xc')]()[_0x3e5e('0xd')](_0x3e5e('0x53'),_0x3e5e('0x54'))[_0x3e5e('0xf')](_0x486740)[_0x3e5e('0x55')](_0x1f083a[_0x3e5e('0x10')](','))))[_0x3e5e('0x39')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1bb96c){logger[_0x3e5e('0x56')](_0x1bb96c['message']);process['exit'](0x1);}function handleError(_0x4cb433,_0x5f556d){stats['errors'][_0x3e5e('0x18')]({'name':_0x5f556d['code'],'message':_0x5f556d[_0x3e5e('0x57')],'row':_0x4cb433});}function handleQuery(_0x3d06b3){logger[_0x3e5e('0x58')](_0x3d06b3);return db[_0x3e5e('0x59')][_0x3e5e('0x5a')](_0x3d06b3)[_0x3e5e('0x5b')](function(_0x19173b){results[_0x3e5e('0x18')](_0x19173b);})['catch'](function(_0x139b31){logger[_0x3e5e('0x56')](_0x139b31[_0x3e5e('0x57')]);});}function updateTzCampaigns(_0x5933cc){return new Promise(function(_0x36abe7,_0x31d49e){var _0xea4928=squel['select']()['fields']([_0x3e5e('0x5c'),_0x3e5e('0x5d')])[_0x3e5e('0xf')](_0x3e5e('0x5e'))['join'](_0x3e5e('0x5f'),null,_0x3e5e('0x60'))[_0x3e5e('0x12')](_0x3e5e('0x61')+_0x5933cc);db['sequelize'][_0x3e5e('0x5a')](_0xea4928[_0x3e5e('0x39')]())[_0x3e5e('0x5b')](function(_0x4ff001){var _0x117d77=[];for(var _0x122eb0=0x0;_0x122eb0<_0x4ff001[_0x3e5e('0x17')];_0x122eb0++){_0x117d77[_0x3e5e('0x18')](getTimezoneData(_0x4ff001[_0x122eb0],tmp_campaigns));}BPromise[_0x3e5e('0x19')](_0x117d77)[_0x3e5e('0x1a')](function(){_0x36abe7({'val':0x1});});})[_0x3e5e('0x62')](function(_0x1992b0){logger['error'](_0x1992b0[_0x3e5e('0x57')]);_0x36abe7({'val':0x0});});});}function updateTzVoiceQueues(_0x2e169f){return new Promise(function(_0x4a839e,_0x416300){var _0x196ef4=squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](['voice_queues.id',_0x3e5e('0x63')])[_0x3e5e('0xf')](_0x3e5e('0x64'))[_0x3e5e('0x10')](_0x3e5e('0x65'),null,_0x3e5e('0x66'))[_0x3e5e('0x12')]('voice_queues_has_cm_lists.CmListId='+_0x2e169f);db[_0x3e5e('0x59')]['query'](_0x196ef4[_0x3e5e('0x39')]())[_0x3e5e('0x5b')](function(_0x10aed3){var _0x16b1aa=[];for(var _0x3d6711=0x0;_0x3d6711<_0x10aed3[_0x3e5e('0x17')];_0x3d6711++){_0x16b1aa[_0x3e5e('0x18')](getTimezoneData(_0x10aed3[_0x3d6711],tmp_voice_queues));}BPromise[_0x3e5e('0x19')](_0x16b1aa)[_0x3e5e('0x1a')](function(){_0x4a839e({'val':0x1});});})[_0x3e5e('0x62')](function(_0x5a5cca){logger['error'](_0x5a5cca[_0x3e5e('0x57')]);_0x4a839e({'val':0x0});});});}function getTimezoneData(_0x23e159,_0x3a7bd3){return new Promise(function(_0x5c8a5b,_0x52d0ea){var _0x296323=shared['timezones'];var _0x31159d=_0x296323[_0x23e159[_0x3e5e('0x67')]];if(_[_0x3e5e('0x1c')](_0x31159d)){_0x5c8a5b({'ret':0x1});}else{var _0x38ddfe=_0x31159d[_0x3e5e('0x68')];var _0x4e9d1e=squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3a7bd3)[_0x3e5e('0x69')]('id',_0x23e159['id'])['set'](_0x3e5e('0x6a'),_0x38ddfe)['set'](_0x3e5e('0x67'),_0x23e159[_0x3e5e('0x67')])['toString']();return db['sequelize'][_0x3e5e('0x5a')](_0x4e9d1e)[_0x3e5e('0x5b')](function(_0x2ca192){_0x5c8a5b({'ret':0x1});})[_0x3e5e('0x62')](function(_0x2b4df0){logger[_0x3e5e('0x56')](_0x2b4df0[_0x3e5e('0x57')]);_0x52d0ea({'ret':0x1});});}});}function handleTZQuery(_0x1e44f3){logger['info'](_0x1e44f3);return db[_0x3e5e('0x59')]['query'](_0x1e44f3)[_0x3e5e('0x5b')](function(_0x519b31){})[_0x3e5e('0x62')](function(_0x891df3){logger[_0x3e5e('0x56')](_0x891df3[_0x3e5e('0x57')]);});}function main(_0x17276b,_0x42cb11,_0x10d671,_0x4b849e){logger['info'](_0x3e5e('0x6b'),_0x17276b,JSON[_0x3e5e('0x6c')](_0x42cb11));process['send'](_0x3e5e('0x6d'));var _0x1a2dfe=_0x42cb11['binding'];var _0x2a0e93=_[_0x3e5e('0x6e')](_0x1a2dfe);var _0x2117a4=_0x42cb11[_0x3e5e('0x6f')];var _0x1c1545=path[_0x3e5e('0x10')](config[_0x3e5e('0x70')],_0x3e5e('0x71'),_0x2117a4+_0x3e5e('0x72'));hasTZ=_[_0x3e5e('0x4e')](_0x1a2dfe)[_0x3e5e('0x73')](_0x3e5e('0x67'));var _0x25f0ce=_[_0x3e5e('0x4e')](_0x1a2dfe)[_0x3e5e('0x10')]();logger['info'](_0x3e5e('0x74'),_0x25f0ce);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x3e5e('0x75')]})[_0x3e5e('0x1a')](function(_0x5af9d0){for(var _0x406f25=0x0;_0x406f25<_0x5af9d0[_0x3e5e('0x17')];_0x406f25++){if(_0x5af9d0[_0x406f25][_0x3e5e('0x75')]in _0x1a2dfe){contactItemTypes[_0x3e5e('0x18')](_0x5af9d0[_0x406f25]);delete _0x2a0e93[_0x5af9d0[_0x406f25]['name']];hasAdditionalPhones=!![];}for(var _0x19880b in _0x1a2dfe){if(_0x5af9d0[_0x406f25][_0x3e5e('0x75')]+_0x3e5e('0x76')===_0x19880b){phoneDescriptions['push']({'itemTypeId':_0x5af9d0[_0x406f25]['id'],'description':_0x19880b});delete _0x2a0e93[_0x19880b];}}}if(hasAdditionalPhones)_0x2a0e93['AdditionalPhones']='';var _0x4e7a4d=_[_0x3e5e('0x4e')](_0x2a0e93)[_0x3e5e('0x10')]();logger[_0x3e5e('0x58')](_0x3e5e('0x74'),_0x4e7a4d);fs['writeFileSync'](_0x1c1545,_0x4e7a4d+'\x0a');Papa[_0x3e5e('0x77')](fs[_0x3e5e('0x78')](_0x17276b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x66fb9f,_0x3b26ae){try{for(var _0x3c5753=0x0,_0x2bfcac=[];_0x3c5753<_0x66fb9f['data']['length'];_0x3c5753++){stats['rows']+=0x1;if(_0x66fb9f['errors'][_0x3c5753]){handleError(_0x66fb9f[_0x3e5e('0x79')][_0x3c5753],_0x66fb9f[_0x3e5e('0x7a')][_0x3c5753]);}else{var _0x355145=[];var _0x12baae=[];var _0x1d4d36={};for(var _0x50654e in _0x1a2dfe){let _0x2fd0d7=contactItemTypes['find'](_0x3db510=>_0x3db510['name']===_0x50654e);let _0x3ac49b=contactItemTypes['find'](_0x721c73=>_0x721c73[_0x3e5e('0x75')]+_0x3e5e('0x76')===_0x50654e);if(_['isNil'](_0x2fd0d7)&&_[_0x3e5e('0x1c')](_0x3ac49b)){if(_0x1a2dfe['hasOwnProperty'](_0x50654e)){if(_0x66fb9f['data'][_0x3c5753][_0x1a2dfe[_0x50654e]]){var _0x1a80a7=_[_0x3e5e('0x7b')](_0x66fb9f[_0x3e5e('0x79')][_0x3c5753][_0x1a2dfe[_0x50654e]][_0x3e5e('0x7c')](/"/g,'\x27'));switch(_0x50654e){case'scheduledat':var _0x26e703=moment(_0x1a80a7,_0x3e5e('0xa'),!![]);if(_0x26e703['isValid']()){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');}else{_0x355145[_0x3e5e('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3e5e('0x41'):var _0x18099b=parseInt(_0x1a80a7);_0x1a80a7=_['isNaN'](_0x18099b)||_0x18099b<0x0||_0x18099b>0x4?_0x4b849e?0x3:0x2:_0x18099b;_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');break;case _0x3e5e('0x31'):var _0x2d28c7=parseInt(_0x1a80a7);if(_[_0x3e5e('0x7d')](_0x2d28c7)&&_[_0x3e5e('0x73')](_0x10d671,_0x2d28c7)){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x2d28c7+'\x22');}else{_0x355145[_0x3e5e('0x18')](_0x3e5e('0x7e'));}break;case'email':if(isEmail(_0x1a80a7)){_0x2bfcac['push']('\x22'+_0x1a80a7+'\x22');}else{_0x355145[_0x3e5e('0x18')](_0x3e5e('0x7f'));}break;case _0x3e5e('0x80'):var _0x57b8bc=moment(_0x1a80a7,_0x3e5e('0x81'),!![]);if(_0x57b8bc[_0x3e5e('0x82')]()){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');}else{_0x355145[_0x3e5e('0x18')](_0x3e5e('0x83'));}break;case _0x3e5e('0x67'):var _0x27d0f9=shared[_0x3e5e('0x84')];var _0x1f6810=_0x27d0f9[_0x1a80a7];if(!_['isNil'](_0x1f6810)){var _0x46f5f5=_0x1f6810[_0x3e5e('0x68')];_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');_0x2bfcac['push']('\x22'+_0x46f5f5+'\x22');}break;default:_0x2bfcac['push']('\x22'+_0x1a80a7+'\x22');}}else{switch(_0x50654e){case'firstName':case _0x3e5e('0xe'):_0x355145[_0x3e5e('0x18')](_0x50654e+_0x3e5e('0x85'));break;default:_0x2bfcac[_0x3e5e('0x18')]('\x22\x22');}}}}else{var _0x862e67='';if(!_[_0x3e5e('0x1c')](_0x2fd0d7)){if(!_0x1d4d36[_0x3e5e('0x86')](_0x2fd0d7['id'])){if(!_[_0x3e5e('0x1c')](_0x66fb9f['data'][_0x3c5753][_0x1a2dfe[_0x50654e]])){var _0x1a80a7=_['trim'](_0x66fb9f[_0x3e5e('0x79')][_0x3c5753][_0x1a2dfe[_0x50654e]]['replace'](/"/g,'\x27'));var _0x1652d5=phoneDescriptions[_0x3e5e('0x87')](_0x321eb8=>_0x321eb8[_0x3e5e('0x88')]===_0x2fd0d7['id']);if(!_[_0x3e5e('0x1c')](_0x1652d5)){var _0x335a3f=_[_0x3e5e('0x7b')](_0x66fb9f[_0x3e5e('0x79')][_0x3c5753][_0x1a2dfe[_0x1652d5[_0x3e5e('0x89')]]]['replace'](/"/g,'\x27'));if(!_[_0x3e5e('0x1c')](_0x335a3f))_0x1a80a7=_0x1a80a7+'§'+_0x335a3f;}if(_0x862e67=='')_0x862e67=_0x1a80a7;else _0x862e67+='|'+_0x1a80a7;}_0x12baae['push'](_0x2fd0d7['id']+':'+_0x862e67);_0x1d4d36[_0x2fd0d7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x12baae[_0x3e5e('0x10')](';')+'\x22');}if(_0x355145[_0x3e5e('0x17')]){handleError(_0x66fb9f[_0x3e5e('0x79')][_0x3c5753],{'code':_0x3e5e('0x8a'),'message':_0x355145[_0x3e5e('0x10')]()});}else{fs[_0x3e5e('0x8b')](_0x1c1545,_0x2bfcac[_0x3e5e('0x10')]()+'\x0a');}_0x2bfcac=[];}if(!(stats[_0x3e5e('0x8c')]%0xc8)){socket[_0x3e5e('0x8d')](_0x3e5e('0x8e')+_0x2117a4,stats);stats[_0x3e5e('0x7a')]=[];}}if(stopped){logger[_0x3e5e('0x58')](_0x3e5e('0x8f'));_0x3b26ae[_0x3e5e('0x90')]();}}catch(_0x383004){handleError(_0x66fb9f[_0x3e5e('0x79')][_0x3c5753],{'code':'SystemError','message':_0x383004['message']});logger[_0x3e5e('0x56')](_0x3e5e('0x91'),_0x383004[_0x3e5e('0x57')]);}},'complete':function(){try{var _0xb2c4da=[];var _0x3cccfb=[];var _0x43fd64=_0x3e5e('0x42');if(_0x42cb11[_0x3e5e('0x92')]&&_0x42cb11['duplicates'][_0x3e5e('0x17')]){_0x43fd64='cm_contacts_'+_0x2117a4;_0xb2c4da['push'](_0x3e5e('0x93')+_0x43fd64+_0x3e5e('0x94'));}tmp_campaigns='campaigns_'+_0x2117a4;tmp_voice_queues=_0x3e5e('0x95')+_0x2117a4;_0x3cccfb[_0x3e5e('0x18')](_0x3e5e('0x93')+tmp_campaigns+_0x3e5e('0x96'));_0x3cccfb[_0x3e5e('0x18')](_0x3e5e('0x93')+tmp_voice_queues+_0x3e5e('0x96'));BPromise['each'](_0x3cccfb,handleTZQuery)['then'](function(_0x263e13){updateTzCampaigns(_0x42cb11[_0x3e5e('0x2e')])['then'](function(_0x5aa957){updateTzVoiceQueues(_0x42cb11[_0x3e5e('0x2e')])[_0x3e5e('0x1a')](function(_0x5bbab4){if(hasTZ)_0x4e7a4d=_0x4e7a4d[_0x3e5e('0x7c')](_0x3e5e('0x67'),_0x3e5e('0x97'));var _0x280f1a=util[_0x3e5e('0x9')]('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',_0x1c1545,_0x43fd64,_0x4e7a4d,_0x42cb11[_0x3e5e('0x2e')],_0x42cb11[_0x3e5e('0x4f')]||null,NOW,NOW);if(_[_0x3e5e('0x1c')](_0x1a2dfe[_0x3e5e('0x3f')])){_0x280f1a+=_0x3e5e('0x98');}_0xb2c4da[_0x3e5e('0x18')](_0x280f1a);if(_0x42cb11[_0x3e5e('0x92')]&&_0x42cb11['duplicates']['length']){_0xb2c4da['push'](insertCmContact(_0x42cb11['ListId'],_0x43fd64,_0x42cb11[_0x3e5e('0x92')],_0x1a2dfe));_0xb2c4da[_0x3e5e('0x18')](_0x3e5e('0x99')+_0x43fd64+';');}BPromise[_0x3e5e('0x9a')](_0xb2c4da,handleQuery)['then'](function(_0x39c713){BPromise[_0x3e5e('0x19')]([handleAdditionalPhones()])['then'](function(){_0xb2c4da=[];for(var _0x5a111f=0x0;_0x5a111f\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','map','parse','No\x20agent\x20available','path','lodash','util','bluebird','moment','squel','ioredis','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message'];(function(_0x2eec9e,_0x59e015){var _0x4e8b48=function(_0x5750db){while(--_0x5750db){_0x2eec9e['push'](_0x2eec9e['shift']());}};_0x4e8b48(++_0x59e015);}(_0xc3ed,0x111));var _0xdc3e=function(_0xea896c,_0x47a284){_0xea896c=_0xea896c-0x0;var _0x1e7e53=_0xc3ed[_0xea896c];return _0x1e7e53;};'use strict';var fs=require('fs');var path=require(_0xdc3e('0x0'));var _=require(_0xdc3e('0x1'));var Papa=require('papaparse');var util=require(_0xdc3e('0x2'));var BPromise=require(_0xdc3e('0x3'));var moment=require(_0xdc3e('0x4'));var squel=require(_0xdc3e('0x5'));var Redis=require(_0xdc3e('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0xdc3e('0x7'));var logger=require('../../../config/logger')(_0xdc3e('0x8'));config[_0xdc3e('0x9')]=_[_0xdc3e('0xa')](config[_0xdc3e('0x9')],{'host':_0xdc3e('0xb'),'port':0x18eb});var socket=require(_0xdc3e('0xc'))(new Redis(config[_0xdc3e('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()[_0xdc3e('0xd')](_0xdc3e('0xe'));var tempTableName=_0xdc3e('0xf')+moment()[_0xdc3e('0xd')](_0xdc3e('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x462f28){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))*$/[_0xdc3e('0x11')](_0x462f28);}function selectNotIn(_0x10dce7,_0xfc1a1e,_0x18a4c6,_0x4af4b6,_0x3b05bc){return squel[_0xdc3e('0x12')]()[_0xdc3e('0x13')]('phone')[_0xdc3e('0x14')](_0x4af4b6)['join'](_0xfc1a1e,null,_0xfc1a1e+_0xdc3e('0x15')+_0x4af4b6+'.'+_0x18a4c6)[_0xdc3e('0x16')](_0x4af4b6+'.'+_0x18a4c6+'\x20=\x20'+_0x10dce7+'.'+_0x18a4c6)['where'](_0xfc1a1e+_0xdc3e('0x17')+_0x3b05bc['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x15133e,_0x14b0ab){promisesAdditionalPhones=[];promisesContact=[];return db[_0xdc3e('0x18')]['query'](_0xdc3e('0x19')+tempTableName)[_0xdc3e('0x1a')](function(_0x384c96){if(_0x384c96!==null){var _0x20ff82=[];for(var _0x56ece5=0x0;_0x56ece5<_0x384c96[_0xdc3e('0x1b')];_0x56ece5++){var _0x2e6f59=_0x384c96[_0x56ece5];if(!_[_0xdc3e('0x1c')](_0x2e6f59[_0xdc3e('0x1d')])){if(!_['isNil'](_0x2e6f59[_0xdc3e('0x1e')]))_0x20ff82[_0xdc3e('0x1f')](insertAdditionalPhones(_0x2e6f59));promisesContact[_0xdc3e('0x1f')]({'contact':_0x2e6f59});}}}Promise[_0xdc3e('0x20')](_0x20ff82)[_0xdc3e('0x21')](function(){_0x15133e({'val':0x1});});})[_0xdc3e('0x22')](function(_0x13bc8c){logger[_0xdc3e('0x23')](_0x13bc8c[_0xdc3e('0x24')]);});});}function insertAdditionalPhones(_0x1da9c0){return new Promise(function(_0x7b4ee,_0x37f6be){var _0x470d31=_0x1da9c0[_0xdc3e('0x1e')];if(_['isNil'](_0x470d31))_0x37f6be({'val':0x0});else{var _0x19e2fc=_0x470d31['split'](';');var _0x2ae1e3=[];orderBy=0x0;for(var _0x4f0a23=0x0;_0x4f0a23<_0x19e2fc['length'];_0x4f0a23++){_0x2ae1e3[_0xdc3e('0x1f')](splitAdditionalPhone(_0x1da9c0['id'],_0x19e2fc[_0x4f0a23]));}Promise[_0xdc3e('0x20')](_0x2ae1e3)['then'](function(){_0x7b4ee({'val':_0x19e2fc[_0xdc3e('0x1b')]});});}});}function splitAdditionalPhone(_0x2116b4,_0x16be9f){return new Promise(function(_0x276786,_0xcf3f50){var _0x246305=_0x16be9f['split'](':');var _0xd5e163=_0x246305[0x0];var _0x4e2e98=_0x246305[0x1];if(_0x4e2e98!==''){var _0x1aef09=_0x4e2e98[_0xdc3e('0x25')]('|');var _0x44cc9c=[];for(var _0x519a09=0x0;_0x519a09<_0x1aef09[_0xdc3e('0x1b')];_0x519a09++){if(_0x1aef09[_0x519a09]!==''){var _0x45bb49=_[_0xdc3e('0x26')](promisesAdditionalPhones,{'contactId':_0x2116b4,'phone':_0x1aef09[_0x519a09]});if(_0x45bb49[_0xdc3e('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2116b4,'contactTypeId':_0xd5e163,'phone':_0x1aef09[_0x519a09],'orderBy':orderBy});}}}_0x276786({'ok':0x1});}else _0x276786({'res':0x0});});}function createAdditionalPhone(_0x14da02,_0x595454,_0x489b18,_0x2ff2c0){var _0x3d1e1f='';var _0x1168bb='';var _0x232e54=_0x489b18[_0xdc3e('0x25')]('§');_0x3d1e1f=_0x232e54[0x0];if(_0x232e54['length']==0x2)_0x1168bb=_0x232e54[0x1];return new Promise(function(_0x4e4202,_0x2e3e39){return db[_0xdc3e('0x27')][_0xdc3e('0x28')]({'where':{'CmContactId':_0x14da02,'item':_0x3d1e1f}})[_0xdc3e('0x21')](function(_0x4f69e7){if(_0x4f69e7){return db['CmContactHasItem'][_0xdc3e('0x29')]({'ItemTypeId':_0x595454,'description':_0x1168bb,'OrderBy':_0x2ff2c0},{'where':{'CmContactId':_0x14da02,'item':_0x3d1e1f}})[_0xdc3e('0x21')](function(_0x470e1f){_0x4e4202({'res':_0xdc3e('0x2a')});});}else{return db[_0xdc3e('0x27')][_0xdc3e('0x2b')]({'CmContactId':_0x14da02,'item':_0x3d1e1f,'ItemTypeId':_0x595454,'description':_0x1168bb,'OrderBy':_0x2ff2c0,'ItemClass':_0xdc3e('0x2c')})[_0xdc3e('0x21')](function(_0x42904e){_0x4e4202({'res':_0xdc3e('0x2d')});});}});});}function updateContact(_0x1fd7fd){return new Promise(function(_0x4fb69a,_0x3b34a5){var _0x5335e6=_0x1fd7fd['id'];delete _0x1fd7fd['id'];return db[_0xdc3e('0x2e')][_0xdc3e('0x29')](_0x1fd7fd,{'where':{'id':_0x5335e6}})[_0xdc3e('0x21')](function(_0x76366d){updatedRows+=0x1;return db[_0xdc3e('0x2f')][_0xdc3e('0x29')]({'phone':_0x1fd7fd[_0xdc3e('0x1d')]},{'where':{'ContactId':_0x5335e6}})['then'](function(_0x3881b9){_0x4fb69a({'ret':'OK'});});});});}function insertCmHopper(_0x1dee65,_0x353e7c,_0x244e5d,_0x3e589b,_0x388f5c){var _0x21ccc5=[_0xdc3e('0x30'),_0xdc3e('0x31'),_0xdc3e('0x32'),_0xdc3e('0x33'),_0x353e7c+'.'+_0x3e589b,_0xdc3e('0x34'),_0xdc3e('0x35'),'cm_contacts.priority',_0xdc3e('0x36'),'\x22'+_0x388f5c+'\x22'];return squel[_0xdc3e('0x37')]()[_0xdc3e('0x38')](_0xdc3e('0x39'))[_0xdc3e('0x3a')]([_0xdc3e('0x1d'),_0xdc3e('0x3b'),_0xdc3e('0x3c'),_0xdc3e('0x3d'),_0x3e589b,'createdAt',_0xdc3e('0x3e'),_0xdc3e('0x3f'),_0xdc3e('0x40'),_0xdc3e('0x41')],squel['select']()[_0xdc3e('0x42')](_0x21ccc5)[_0xdc3e('0x14')](_0x353e7c)[_0xdc3e('0x43')](_0xdc3e('0x44'),null,_0xdc3e('0x45')+_0x353e7c+_0xdc3e('0x46'))[_0xdc3e('0x43')](_0x244e5d,null,_0x244e5d+_0xdc3e('0x15')+_0x353e7c+'.'+_0x3e589b)['where'](_0x353e7c+_0xdc3e('0x47'),_0x1dee65)[_0xdc3e('0x16')](_0xdc3e('0x48'),NOW)[_0xdc3e('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x353e7c,_0x244e5d,_0x3e589b,'cm_hopper',[_0xdc3e('0x49'),'\x22onlyIfOpen\x22']))['where'](_0xdc3e('0x4a'),selectNotIn(_0x353e7c,_0x244e5d,_0x3e589b,_0xdc3e('0x39'),[_0xdc3e('0x49')])))[_0xdc3e('0x4b')]();}function insertCmHopperBlack(_0x248b78,_0x3ee3e1,_0x6b669f,_0x3145d1){var _0x563784=[_0xdc3e('0x30'),_0xdc3e('0x32'),'cm_contacts.ListId',_0x3ee3e1+'.'+_0x3145d1,'cm_contacts.createdAt',_0xdc3e('0x35')];return squel['insert']()[_0xdc3e('0x38')](_0xdc3e('0x4c'))[_0xdc3e('0x3a')](['phone','ContactId',_0xdc3e('0x3d'),_0x3145d1,_0xdc3e('0x4d'),_0xdc3e('0x3e')],squel['select']()['fields'](_0x563784)['from'](_0x3ee3e1)[_0xdc3e('0x43')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x3ee3e1+_0xdc3e('0x46'))[_0xdc3e('0x43')](_0x6b669f,null,_0x6b669f+_0xdc3e('0x15')+_0x3ee3e1+'.'+_0x3145d1)['where'](_0x3ee3e1+_0xdc3e('0x47'),_0x248b78)['where'](_0xdc3e('0x48'),NOW)[_0xdc3e('0x16')](_0xdc3e('0x4a'),squel[_0xdc3e('0x12')]()[_0xdc3e('0x13')](_0xdc3e('0x1d'))[_0xdc3e('0x14')](_0xdc3e('0x4c'))['where'](_0xdc3e('0x4e'),_0x248b78)[_0xdc3e('0x16')](_0x3145d1+_0xdc3e('0x4f'),_0x3ee3e1+'.'+_0x3145d1)))[_0xdc3e('0x4b')]();}function insertCmHopperAdditionalPhones(_0x241b2d){var _0x5cff6e=[_0xdc3e('0x50'),_0xdc3e('0x51'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0xdc3e('0x52')];return squel[_0xdc3e('0x37')]()[_0xdc3e('0x38')](_0xdc3e('0x53'))[_0xdc3e('0x3a')]([_0xdc3e('0x54'),_0xdc3e('0x1d'),'OrderBy',_0xdc3e('0x4d'),'updatedAt'],squel[_0xdc3e('0x12')]()[_0xdc3e('0x42')](_0x5cff6e)[_0xdc3e('0x14')](_0xdc3e('0x39'))[_0xdc3e('0x43')](_0xdc3e('0x44'),null,_0xdc3e('0x55'))[_0xdc3e('0x43')]('cm_contact_has_items',null,_0xdc3e('0x56'))[_0xdc3e('0x16')](_0xdc3e('0x57'),_0x241b2d)['where'](_0xdc3e('0x48'),NOW))[_0xdc3e('0x4b')]();}function insertCmContact(_0x409792,_0x347693,_0xd81377,_0x4b1b74){var _0x74118e=_[_0xdc3e('0x58')](_[_0xdc3e('0x59')](_0x4b1b74),[_0xdc3e('0x3d'),_0xdc3e('0x5a'),_0xdc3e('0x4d'),_0xdc3e('0x3e')]);return squel[_0xdc3e('0x37')]()[_0xdc3e('0x38')](_0xdc3e('0x44'))[_0xdc3e('0x3a')](_0x74118e,squel[_0xdc3e('0x12')]()[_0xdc3e('0x42')](_0x74118e)[_0xdc3e('0x14')](_0x347693)[_0xdc3e('0x16')]('('+_0xd81377['join'](',')+_0xdc3e('0x5b'),squel[_0xdc3e('0x12')]()['fields'](_0xd81377)[_0xdc3e('0x14')]('cm_contacts')[_0xdc3e('0x16')]('ListId\x20=\x20?',_0x409792))[_0xdc3e('0x16')](_0xdc3e('0x5c'),squel[_0xdc3e('0x12')]()['field'](_0xdc3e('0x5d'),'min_id')[_0xdc3e('0x14')](_0x347693)[_0xdc3e('0x5e')](_0xd81377[_0xdc3e('0x43')](','))))[_0xdc3e('0x4b')]();}function handleStop(){logger[_0xdc3e('0x5f')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x431ba8){logger[_0xdc3e('0x23')](_0x431ba8[_0xdc3e('0x24')]);process[_0xdc3e('0x60')](0x1);}function handleError(_0x56ea7e,_0x5147f1){stats[_0xdc3e('0x61')]['push']({'name':_0x5147f1[_0xdc3e('0x62')],'message':_0x5147f1[_0xdc3e('0x24')],'row':_0x56ea7e});}function handleQuery(_0x6f48ac){logger[_0xdc3e('0x5f')](_0x6f48ac);return db[_0xdc3e('0x18')][_0xdc3e('0x63')](_0x6f48ac)[_0xdc3e('0x1a')](function(_0x4e8f8a){results['push'](_0x4e8f8a);})[_0xdc3e('0x22')](function(_0x28a07a){logger[_0xdc3e('0x23')](_0x28a07a[_0xdc3e('0x24')]);});}function main(_0x2d81a6,_0x3b28da,_0xc56b09,_0x5d2938){logger[_0xdc3e('0x5f')]('main',_0x2d81a6,JSON[_0xdc3e('0x64')](_0x3b28da));process['send'](_0xdc3e('0x65'));var _0x54f545=_0x3b28da[_0xdc3e('0x66')];var _0x4b5128=_[_0xdc3e('0x67')](_0x54f545);var _0x32003f=_0x3b28da[_0xdc3e('0x68')];var _0x61fa74=path[_0xdc3e('0x43')](config[_0xdc3e('0x69')],_0xdc3e('0x6a'),_0x32003f+_0xdc3e('0x6b'));logger[_0xdc3e('0x5f')](_0xdc3e('0x6c'),_0x3b28da);db[_0xdc3e('0x6d')][_0xdc3e('0x6e')]({'raw':!![],'attributes':['id',_0xdc3e('0x6f')]})['then'](function(_0x1d384d){for(var _0x445011=0x0;_0x445011<_0x1d384d[_0xdc3e('0x1b')];_0x445011++){if(_0x1d384d[_0x445011][_0xdc3e('0x6f')]in _0x54f545){contactItemTypes[_0xdc3e('0x1f')](_0x1d384d[_0x445011]);delete _0x4b5128[_0x1d384d[_0x445011][_0xdc3e('0x6f')]];hasAdditionalPhones=!![];}for(var _0x514dd6 in _0x54f545){if(_0x1d384d[_0x445011][_0xdc3e('0x6f')]+'_description'===_0x514dd6){phoneDescriptions[_0xdc3e('0x1f')]({'itemTypeId':_0x1d384d[_0x445011]['id'],'description':_0x514dd6});delete _0x4b5128[_0x514dd6];}}}if(hasAdditionalPhones)_0x4b5128[_0xdc3e('0x1e')]='';var _0x39be30=_[_0xdc3e('0x59')](_0x4b5128)[_0xdc3e('0x43')]();logger[_0xdc3e('0x5f')](_0xdc3e('0x70'),_0x39be30);fs[_0xdc3e('0x71')](_0x61fa74,_0x39be30+'\x0a');Papa['parse'](fs[_0xdc3e('0x72')](_0x2d81a6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x32abac,_0x330182){try{for(var _0x584b67=0x0,_0xcafc5f=[];_0x584b67<_0x32abac['data'][_0xdc3e('0x1b')];_0x584b67++){stats[_0xdc3e('0x73')]+=0x1;if(_0x32abac['errors'][_0x584b67]){handleError(_0x32abac[_0xdc3e('0x74')][_0x584b67],_0x32abac[_0xdc3e('0x61')][_0x584b67]);}else{var _0x8a6666=[];var _0x4082e5=[];var _0x1ee0c3={};for(var _0x56b426 in _0x54f545){let _0x1907c3=contactItemTypes['find'](_0x4b0623=>_0x4b0623[_0xdc3e('0x6f')]===_0x56b426);let _0x5c4f0f=contactItemTypes['find'](_0x5e3c9c=>_0x5e3c9c[_0xdc3e('0x6f')]+_0xdc3e('0x75')===_0x56b426);if(_[_0xdc3e('0x1c')](_0x1907c3)&&_[_0xdc3e('0x1c')](_0x5c4f0f)){if(_0x54f545[_0xdc3e('0x76')](_0x56b426)){if(_0x32abac[_0xdc3e('0x74')][_0x584b67][_0x54f545[_0x56b426]]){var _0x405788=_[_0xdc3e('0x77')](_0x32abac['data'][_0x584b67][_0x54f545[_0x56b426]]['replace'](/"/g,'\x27'));switch(_0x56b426){case'scheduledat':var _0xf58294=moment(_0x405788,_0xdc3e('0xe'),!![]);if(_0xf58294['isValid']()){_0xcafc5f['push']('\x22'+_0x405788+'\x22');}else{_0x8a6666[_0xdc3e('0x1f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x4c9846=parseInt(_0x405788);_0x405788=_[_0xdc3e('0x78')](_0x4c9846)||_0x4c9846<0x0||_0x4c9846>0x4?_0x5d2938?0x3:0x2:_0x4c9846;_0xcafc5f[_0xdc3e('0x1f')]('\x22'+_0x405788+'\x22');break;case _0xdc3e('0x40'):var _0xf8c89e=parseInt(_0x405788);if(_[_0xdc3e('0x79')](_0xf8c89e)&&_[_0xdc3e('0x7a')](_0xc56b09,_0xf8c89e)){_0xcafc5f[_0xdc3e('0x1f')]('\x22'+_0xf8c89e+'\x22');}else{_0x8a6666[_0xdc3e('0x1f')](_0xdc3e('0x7b'));}break;case _0xdc3e('0x7c'):if(isEmail(_0x405788)){_0xcafc5f[_0xdc3e('0x1f')]('\x22'+_0x405788+'\x22');}else{_0x8a6666[_0xdc3e('0x1f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0xd8af9=moment(_0x405788,'YYYY-MM-DD',!![]);if(_0xd8af9[_0xdc3e('0x7d')]()){_0xcafc5f[_0xdc3e('0x1f')]('\x22'+_0x405788+'\x22');}else{_0x8a6666[_0xdc3e('0x1f')](_0xdc3e('0x7e'));}break;default:_0xcafc5f[_0xdc3e('0x1f')]('\x22'+_0x405788+'\x22');}}else{switch(_0x56b426){case _0xdc3e('0x7f'):case _0xdc3e('0x1d'):_0x8a6666[_0xdc3e('0x1f')](_0x56b426+_0xdc3e('0x80'));break;default:_0xcafc5f[_0xdc3e('0x1f')]('\x22\x22');}}}}else{var _0x3ee39c='';if(!_[_0xdc3e('0x1c')](_0x1907c3)){if(!_0x1ee0c3['hasOwnProperty'](_0x1907c3['id'])){for(var _0xb36f8e=0x0;_0xb36f8e<_0x54f545[_0x56b426]['length'];_0xb36f8e++){var _0x405788=_[_0xdc3e('0x77')](_0x32abac[_0xdc3e('0x74')][_0x584b67][_0x54f545[_0x56b426][_0xb36f8e]][_0xdc3e('0x81')](/"/g,'\x27'));var _0x11cfc2=phoneDescriptions[_0xdc3e('0x82')](_0x50aaf3=>_0x50aaf3['itemTypeId']===_0x1907c3['id']);if(!_[_0xdc3e('0x1c')](_0x11cfc2)){var _0x415c59=_['trim'](_0x32abac['data'][_0x584b67][_0x54f545[_0x11cfc2['description']][0x0]][_0xdc3e('0x81')](/"/g,'\x27'));if(!_[_0xdc3e('0x1c')](_0x415c59))_0x405788=_0x405788+'§'+_0x415c59;}if(_0x3ee39c=='')_0x3ee39c=_0x405788;else _0x3ee39c+='|'+_0x405788;}_0x4082e5[_0xdc3e('0x1f')](_0x1907c3['id']+':'+_0x3ee39c);_0x1ee0c3[_0x1907c3['id']]=0x1;}}}}if(hasAdditionalPhones){_0xcafc5f[_0xdc3e('0x1f')]('\x22'+_0x4082e5[_0xdc3e('0x43')](';')+'\x22');}if(_0x8a6666[_0xdc3e('0x1b')]){handleError(_0x32abac[_0xdc3e('0x74')][_0x584b67],{'code':_0xdc3e('0x83'),'message':_0x8a6666[_0xdc3e('0x43')]()});}else{fs[_0xdc3e('0x84')](_0x61fa74,_0xcafc5f[_0xdc3e('0x43')]()+'\x0a');}_0xcafc5f=[];}if(!(stats[_0xdc3e('0x73')]%0xc8)){socket[_0xdc3e('0x85')](_0xdc3e('0x86')+_0x32003f,stats);stats[_0xdc3e('0x61')]=[];}}if(stopped){logger['info'](_0xdc3e('0x87'));_0x330182[_0xdc3e('0x88')]();}}catch(_0x3e0bed){handleError(_0x32abac['data'][_0x584b67],{'code':_0xdc3e('0x89'),'message':_0x3e0bed[_0xdc3e('0x24')]});logger[_0xdc3e('0x23')]('step',_0x3e0bed[_0xdc3e('0x24')]);}},'complete':function(){try{var _0x31bc05=[];var _0x821a36=tempTableName;_0x31bc05[_0xdc3e('0x1f')](_0xdc3e('0x8a')+_0x821a36+_0xdc3e('0x8b'));logger['info']('CIS\x20len',contactItemTypes[_0xdc3e('0x1b')]);var _0x3c0b87=util[_0xdc3e('0xd')](_0xdc3e('0x8c'),_0x61fa74,_0x821a36,_0x39be30,_0x3b28da[_0xdc3e('0x3d')],_0x3b28da['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x54f545['scheduledat'])){_0x3c0b87+=_0xdc3e('0x8d');}_0x31bc05[_0xdc3e('0x1f')](_0x3c0b87);BPromise['each'](_0x31bc05,handleQuery)[_0xdc3e('0x21')](function(_0x13d813){BPromise[_0xdc3e('0x20')]([handleAdditionalPhones()])[_0xdc3e('0x21')](function(){_0x31bc05=[];for(var _0x2f8cbe=0x0;_0x2f8cbe\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','then','catch','split','all','findOne','CmContactHasItem','update','updated','create','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','exit','errors','code','info','spread','error','message','start','clone','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','writeFileSync','createReadStream','rows','data','find','_description','hasOwnProperty','trim'];(function(_0x119a47,_0x54a124){var _0x4bdd48=function(_0xf222e4){while(--_0xf222e4){_0x119a47['push'](_0x119a47['shift']());}};_0x4bdd48(++_0x54a124);}(_0xede3,0xc0));var _0x3ede=function(_0x24ad61,_0x53e969){_0x24ad61=_0x24ad61-0x0;var _0x4e7962=_0xede3[_0x24ad61];return _0x4e7962;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x3ede('0x0'));var Papa=require('papaparse');var util=require(_0x3ede('0x1'));var BPromise=require(_0x3ede('0x2'));var moment=require(_0x3ede('0x3'));var squel=require(_0x3ede('0x4'));var Redis=require(_0x3ede('0x5'));var db=require(_0x3ede('0x6'))['db'];var config=require(_0x3ede('0x7'));var logger=require(_0x3ede('0x8'))(_0x3ede('0x9'));config[_0x3ede('0xa')]=_[_0x3ede('0xb')](config[_0x3ede('0xa')],{'host':_0x3ede('0xc'),'port':0x18eb});var socket=require(_0x3ede('0xd'))(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()[_0x3ede('0xe')](_0x3ede('0xf'));var tempTableName=_0x3ede('0x10')+moment()['format'](_0x3ede('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x555bd){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))*$/[_0x3ede('0x12')](_0x555bd);}function selectNotIn(_0x377182,_0x1e5240,_0x4ed90c,_0x3d2c6c,_0x16077b){return squel[_0x3ede('0x13')]()[_0x3ede('0x14')](_0x3ede('0x15'))[_0x3ede('0x16')](_0x3d2c6c)[_0x3ede('0x17')](_0x1e5240,null,_0x1e5240+_0x3ede('0x18')+_0x3d2c6c+'.'+_0x4ed90c)[_0x3ede('0x19')](_0x3d2c6c+'.'+_0x4ed90c+_0x3ede('0x1a')+_0x377182+'.'+_0x4ed90c)[_0x3ede('0x19')](_0x1e5240+_0x3ede('0x1b')+_0x16077b[_0x3ede('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5d2d69,_0x4e03a5){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3ede('0x1c')]['query'](_0x3ede('0x1d')+tempTableName)['spread'](function(_0x54ae57){if(_0x54ae57!==null){var _0x18e11c=[];for(var _0x3563f7=0x0;_0x3563f7<_0x54ae57[_0x3ede('0x1e')];_0x3563f7++){var _0x57ac4f=_0x54ae57[_0x3563f7];if(!_[_0x3ede('0x1f')](_0x57ac4f['phone'])){if(!_['isNil'](_0x57ac4f[_0x3ede('0x20')]))_0x18e11c[_0x3ede('0x21')](insertAdditionalPhones(_0x57ac4f));promisesContact[_0x3ede('0x21')]({'contact':_0x57ac4f});}}}Promise['all'](_0x18e11c)[_0x3ede('0x22')](function(){_0x5d2d69({'val':0x1});});})[_0x3ede('0x23')](function(_0x4fdcc6){logger['error'](_0x4fdcc6['message']);});});}function insertAdditionalPhones(_0x2f5c95){return new Promise(function(_0x47ed7f,_0x38ebd6){var _0x5a45ff=_0x2f5c95[_0x3ede('0x20')];if(_[_0x3ede('0x1f')](_0x5a45ff))_0x38ebd6({'val':0x0});else{var _0x26e082=_0x5a45ff[_0x3ede('0x24')](';');var _0x33b2d6=[];orderBy=0x0;for(var _0x472924=0x0;_0x472924<_0x26e082['length'];_0x472924++){_0x33b2d6[_0x3ede('0x21')](splitAdditionalPhone(_0x2f5c95['id'],_0x26e082[_0x472924]));}Promise[_0x3ede('0x25')](_0x33b2d6)[_0x3ede('0x22')](function(){_0x47ed7f({'val':_0x26e082[_0x3ede('0x1e')]});});}});}function splitAdditionalPhone(_0x313699,_0x10636f){return new Promise(function(_0xc9192d,_0x44713b){var _0x252e4e=_0x10636f[_0x3ede('0x24')](':');var _0x553584=_0x252e4e[0x0];var _0x5e3304=_0x252e4e[0x1];if(_0x5e3304!==''){var _0x3765fe=_0x5e3304[_0x3ede('0x24')]('|');var _0x248e17=[];for(var _0x8e750c=0x0;_0x8e750c<_0x3765fe[_0x3ede('0x1e')];_0x8e750c++){if(_0x3765fe[_0x8e750c]!==''){var _0x43363a=_['filter'](promisesAdditionalPhones,{'contactId':_0x313699,'phone':_0x3765fe[_0x8e750c]});if(_0x43363a[_0x3ede('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x3ede('0x21')]({'contactId':_0x313699,'contactTypeId':_0x553584,'phone':_0x3765fe[_0x8e750c],'orderBy':orderBy});}}}_0xc9192d({'ok':0x1});}else _0xc9192d({'res':0x0});});}function createAdditionalPhone(_0xa600fa,_0x4b4429,_0x26f04e,_0x8daee8){var _0x449e94='';var _0x57cf8a='';var _0x3d064a=_0x26f04e['split']('§');_0x449e94=_0x3d064a[0x0];if(_0x3d064a[_0x3ede('0x1e')]==0x2)_0x57cf8a=_0x3d064a[0x1];return new Promise(function(_0x436b86,_0x5930f4){return db['CmContactHasItem'][_0x3ede('0x26')]({'where':{'CmContactId':_0xa600fa,'item':_0x449e94}})[_0x3ede('0x22')](function(_0x3f8f6c){if(_0x3f8f6c){return db[_0x3ede('0x27')][_0x3ede('0x28')]({'ItemTypeId':_0x4b4429,'description':_0x57cf8a,'OrderBy':_0x8daee8},{'where':{'CmContactId':_0xa600fa,'item':_0x449e94}})[_0x3ede('0x22')](function(_0x41c790){_0x436b86({'res':_0x3ede('0x29')});});}else{return db[_0x3ede('0x27')][_0x3ede('0x2a')]({'CmContactId':_0xa600fa,'item':_0x449e94,'ItemTypeId':_0x4b4429,'description':_0x57cf8a,'OrderBy':_0x8daee8,'ItemClass':'PHONE'})[_0x3ede('0x22')](function(_0x8a0ebc){_0x436b86({'res':'inserted'});});}});});}function updateContact(_0x232b90){return new Promise(function(_0x131074,_0x3a03b6){var _0x4da83d=_0x232b90['id'];delete _0x232b90['id'];return db[_0x3ede('0x2b')]['update'](_0x232b90,{'where':{'id':_0x4da83d}})[_0x3ede('0x22')](function(_0x2e61b5){updatedRows+=0x1;return db[_0x3ede('0x2c')]['update']({'phone':_0x232b90['phone']},{'where':{'ContactId':_0x4da83d}})[_0x3ede('0x22')](function(_0x2600b6){_0x131074({'ret':'OK'});});});});}function insertCmHopper(_0x19b105,_0x36a636,_0x1a3130,_0x5d8a03,_0x8a94f){var _0x1caffb=[_0x3ede('0x2d'),_0x3ede('0x2e'),'cm_contacts.id',_0x3ede('0x2f'),_0x36a636+'.'+_0x5d8a03,_0x3ede('0x30'),_0x3ede('0x31'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x8a94f+'\x22'];return squel[_0x3ede('0x32')]()[_0x3ede('0x33')](_0x3ede('0x34'))[_0x3ede('0x35')]([_0x3ede('0x15'),_0x3ede('0x36'),_0x3ede('0x37'),'ListId',_0x5d8a03,_0x3ede('0x38'),_0x3ede('0x39'),_0x3ede('0x3a'),'UserId','recallme'],squel['select']()[_0x3ede('0x3b')](_0x1caffb)[_0x3ede('0x16')](_0x36a636)[_0x3ede('0x17')](_0x3ede('0x3c'),null,_0x3ede('0x3d')+_0x36a636+_0x3ede('0x3e'))[_0x3ede('0x17')](_0x1a3130,null,_0x1a3130+_0x3ede('0x18')+_0x36a636+'.'+_0x5d8a03)[_0x3ede('0x19')](_0x36a636+'.CmListId\x20=\x20?',_0x19b105)[_0x3ede('0x19')](_0x3ede('0x3f'),NOW)[_0x3ede('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36a636,_0x1a3130,_0x5d8a03,_0x3ede('0x34'),[_0x3ede('0x40'),_0x3ede('0x41')]))[_0x3ede('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36a636,_0x1a3130,_0x5d8a03,'cm_hopper',[_0x3ede('0x40')])))[_0x3ede('0x42')]();}function insertCmHopperBlack(_0x441864,_0x15bfbb,_0x507054,_0x133c73){var _0x342bf7=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x15bfbb+'.'+_0x133c73,_0x3ede('0x30'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x3ede('0x43'))[_0x3ede('0x35')]([_0x3ede('0x15'),_0x3ede('0x37'),_0x3ede('0x44'),_0x133c73,_0x3ede('0x38'),'updatedAt'],squel[_0x3ede('0x13')]()['fields'](_0x342bf7)['from'](_0x15bfbb)[_0x3ede('0x17')](_0x3ede('0x3c'),null,_0x3ede('0x3d')+_0x15bfbb+'.CmListId')['join'](_0x507054,null,_0x507054+_0x3ede('0x18')+_0x15bfbb+'.'+_0x133c73)[_0x3ede('0x19')](_0x15bfbb+_0x3ede('0x45'),_0x441864)['where'](_0x3ede('0x3f'),NOW)[_0x3ede('0x19')](_0x3ede('0x46'),squel[_0x3ede('0x13')]()[_0x3ede('0x14')](_0x3ede('0x15'))[_0x3ede('0x16')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x441864)['where'](_0x133c73+'\x20=\x20?',_0x15bfbb+'.'+_0x133c73)))[_0x3ede('0x42')]();}function insertCmHopperAdditionalPhones(_0x44ba2a){var _0x13b7a0=[_0x3ede('0x47'),_0x3ede('0x48'),_0x3ede('0x49'),_0x3ede('0x4a'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x3ede('0x33')](_0x3ede('0x4b'))[_0x3ede('0x35')]([_0x3ede('0x4c'),_0x3ede('0x15'),_0x3ede('0x4d'),'createdAt',_0x3ede('0x39')],squel[_0x3ede('0x13')]()[_0x3ede('0x3b')](_0x13b7a0)[_0x3ede('0x16')](_0x3ede('0x34'))[_0x3ede('0x17')](_0x3ede('0x3c'),null,_0x3ede('0x4e'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x3ede('0x19')](_0x3ede('0x4f'),_0x44ba2a)[_0x3ede('0x19')](_0x3ede('0x3f'),NOW))['toString']();}function insertCmContact(_0x253773,_0x2ca7fe,_0x5d0ddb,_0x5e021f){var _0x1393d9=_['concat'](_['keys'](_0x5e021f),[_0x3ede('0x44'),_0x3ede('0x50'),_0x3ede('0x38'),'updatedAt']);return squel[_0x3ede('0x32')]()['into']('cm_contacts')[_0x3ede('0x35')](_0x1393d9,squel[_0x3ede('0x13')]()[_0x3ede('0x3b')](_0x1393d9)['from'](_0x2ca7fe)['where']('('+_0x5d0ddb['join'](',')+_0x3ede('0x51'),squel[_0x3ede('0x13')]()[_0x3ede('0x3b')](_0x5d0ddb)['from']('cm_contacts')['where'](_0x3ede('0x52'),_0x253773))[_0x3ede('0x19')](_0x3ede('0x53'),squel[_0x3ede('0x13')]()['field'](_0x3ede('0x54'),_0x3ede('0x55'))[_0x3ede('0x16')](_0x2ca7fe)[_0x3ede('0x56')](_0x5d0ddb[_0x3ede('0x17')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x13f96d){logger['error'](_0x13f96d['message']);process[_0x3ede('0x57')](0x1);}function handleError(_0x83c40c,_0x2c138b){stats[_0x3ede('0x58')][_0x3ede('0x21')]({'name':_0x2c138b[_0x3ede('0x59')],'message':_0x2c138b['message'],'row':_0x83c40c});}function handleQuery(_0x35f41a){logger[_0x3ede('0x5a')](_0x35f41a);return db[_0x3ede('0x1c')]['query'](_0x35f41a)[_0x3ede('0x5b')](function(_0x4b6e51){results['push'](_0x4b6e51);})[_0x3ede('0x23')](function(_0x2cacb6){logger[_0x3ede('0x5c')](_0x2cacb6[_0x3ede('0x5d')]);});}function main(_0x6137a,_0x57e9fc,_0xc09107,_0x165410){logger[_0x3ede('0x5a')]('main',_0x6137a,JSON['stringify'](_0x57e9fc));process['send'](_0x3ede('0x5e'));var _0x3ed3a9=_0x57e9fc['binding'];var _0x108da3=_[_0x3ede('0x5f')](_0x3ed3a9);var _0x28ba81=_0x57e9fc['socket_timestamp'];var _0x54eed5=path[_0x3ede('0x17')](config[_0x3ede('0x60')],_0x3ede('0x61'),_0x28ba81+_0x3ede('0x62'));logger[_0x3ede('0x5a')](_0x3ede('0x63'),_0x57e9fc);db[_0x3ede('0x64')][_0x3ede('0x65')]({'raw':!![],'attributes':['id',_0x3ede('0x66')]})[_0x3ede('0x22')](function(_0x56ffe9){for(var _0x4c19d7=0x0;_0x4c19d7<_0x56ffe9[_0x3ede('0x1e')];_0x4c19d7++){if(_0x56ffe9[_0x4c19d7]['name']in _0x3ed3a9){contactItemTypes[_0x3ede('0x21')](_0x56ffe9[_0x4c19d7]);delete _0x108da3[_0x56ffe9[_0x4c19d7][_0x3ede('0x66')]];hasAdditionalPhones=!![];}for(var _0x9981cb in _0x3ed3a9){if(_0x56ffe9[_0x4c19d7][_0x3ede('0x66')]+'_description'===_0x9981cb){phoneDescriptions['push']({'itemTypeId':_0x56ffe9[_0x4c19d7]['id'],'description':_0x9981cb});delete _0x108da3[_0x9981cb];}}}if(hasAdditionalPhones)_0x108da3[_0x3ede('0x20')]='';var _0x7e1b8e=_['keys'](_0x108da3)[_0x3ede('0x17')]();logger[_0x3ede('0x5a')](_0x3ede('0x67'),_0x7e1b8e);fs[_0x3ede('0x68')](_0x54eed5,_0x7e1b8e+'\x0a');Papa['parse'](fs[_0x3ede('0x69')](_0x6137a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x483860,_0x12731d){try{for(var _0x322bf6=0x0,_0x4d7540=[];_0x322bf6<_0x483860['data'][_0x3ede('0x1e')];_0x322bf6++){stats[_0x3ede('0x6a')]+=0x1;if(_0x483860[_0x3ede('0x58')][_0x322bf6]){handleError(_0x483860[_0x3ede('0x6b')][_0x322bf6],_0x483860['errors'][_0x322bf6]);}else{var _0xbee737=[];var _0x4b8e3a=[];var _0x4c05bf={};for(var _0x511190 in _0x3ed3a9){let _0x53c8cb=contactItemTypes[_0x3ede('0x6c')](_0xb53fbc=>_0xb53fbc[_0x3ede('0x66')]===_0x511190);let _0x120b0b=contactItemTypes['find'](_0x3fde8d=>_0x3fde8d[_0x3ede('0x66')]+_0x3ede('0x6d')===_0x511190);if(_[_0x3ede('0x1f')](_0x53c8cb)&&_[_0x3ede('0x1f')](_0x120b0b)){if(_0x3ed3a9[_0x3ede('0x6e')](_0x511190)){if(_0x483860[_0x3ede('0x6b')][_0x322bf6][_0x3ed3a9[_0x511190]]){var _0x223ba2=_[_0x3ede('0x6f')](_0x483860[_0x3ede('0x6b')][_0x322bf6][_0x3ed3a9[_0x511190]][_0x3ede('0x70')](/"/g,'\x27'));switch(_0x511190){case _0x3ede('0x36'):var _0x4215bf=moment(_0x223ba2,_0x3ede('0xf'),!![]);if(_0x4215bf['isValid']()){_0x4d7540['push']('\x22'+_0x223ba2+'\x22');}else{_0xbee737['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3ede('0x3a'):var _0x5904b4=parseInt(_0x223ba2);_0x223ba2=_['isNaN'](_0x5904b4)||_0x5904b4<0x0||_0x5904b4>0x4?_0x165410?0x3:0x2:_0x5904b4;_0x4d7540[_0x3ede('0x21')]('\x22'+_0x223ba2+'\x22');break;case _0x3ede('0x71'):var _0x17e55c=parseInt(_0x223ba2);if(_['isNumber'](_0x17e55c)&&_[_0x3ede('0x72')](_0xc09107,_0x17e55c)){_0x4d7540[_0x3ede('0x21')]('\x22'+_0x17e55c+'\x22');}else{_0xbee737[_0x3ede('0x21')](_0x3ede('0x73'));}break;case _0x3ede('0x74'):if(isEmail(_0x223ba2)){_0x4d7540[_0x3ede('0x21')]('\x22'+_0x223ba2+'\x22');}else{_0xbee737[_0x3ede('0x21')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x50953a=moment(_0x223ba2,_0x3ede('0x75'),!![]);if(_0x50953a[_0x3ede('0x76')]()){_0x4d7540['push']('\x22'+_0x223ba2+'\x22');}else{_0xbee737[_0x3ede('0x21')](_0x3ede('0x77'));}break;default:_0x4d7540[_0x3ede('0x21')]('\x22'+_0x223ba2+'\x22');}}else{switch(_0x511190){case _0x3ede('0x78'):case'phone':_0xbee737[_0x3ede('0x21')](_0x511190+'\x20not\x20specified');break;default:_0x4d7540['push']('\x22\x22');}}}}else{var _0x171ba3='';if(!_['isNil'](_0x53c8cb)){if(!_0x4c05bf[_0x3ede('0x6e')](_0x53c8cb['id'])){for(var _0x130f11=0x0;_0x130f11<_0x3ed3a9[_0x511190]['length'];_0x130f11++){var _0x223ba2=_[_0x3ede('0x6f')](_0x483860['data'][_0x322bf6][_0x3ed3a9[_0x511190][_0x130f11]][_0x3ede('0x70')](/"/g,'\x27'));var _0x2c586b=phoneDescriptions['find'](_0x49862a=>_0x49862a['itemTypeId']===_0x53c8cb['id']);if(!_['isNil'](_0x2c586b)){var _0x240685=_[_0x3ede('0x6f')](_0x483860[_0x3ede('0x6b')][_0x322bf6][_0x3ed3a9[_0x2c586b[_0x3ede('0x79')]][0x0]][_0x3ede('0x70')](/"/g,'\x27'));if(!_[_0x3ede('0x1f')](_0x240685))_0x223ba2=_0x223ba2+'§'+_0x240685;}if(_0x171ba3=='')_0x171ba3=_0x223ba2;else _0x171ba3+='|'+_0x223ba2;}_0x4b8e3a[_0x3ede('0x21')](_0x53c8cb['id']+':'+_0x171ba3);_0x4c05bf[_0x53c8cb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4d7540['push']('\x22'+_0x4b8e3a['join'](';')+'\x22');}if(_0xbee737[_0x3ede('0x1e')]){handleError(_0x483860['data'][_0x322bf6],{'code':_0x3ede('0x7a'),'message':_0xbee737[_0x3ede('0x17')]()});}else{fs['appendFileSync'](_0x54eed5,_0x4d7540['join']()+'\x0a');}_0x4d7540=[];}if(!(stats['rows']%0xc8)){socket[_0x3ede('0x7b')](_0x3ede('0x7c')+_0x28ba81,stats);stats[_0x3ede('0x58')]=[];}}if(stopped){logger[_0x3ede('0x5a')](_0x3ede('0x7d'));_0x12731d['abort']();}}catch(_0x47d485){handleError(_0x483860[_0x3ede('0x6b')][_0x322bf6],{'code':_0x3ede('0x7e'),'message':_0x47d485[_0x3ede('0x5d')]});logger['error'](_0x3ede('0x7f'),_0x47d485[_0x3ede('0x5d')]);}},'complete':function(){try{var _0x5d73bf=[];var _0x252b87=tempTableName;_0x5d73bf[_0x3ede('0x21')](_0x3ede('0x80')+_0x252b87+'\x20LIKE\x20cm_contacts;');logger[_0x3ede('0x5a')](_0x3ede('0x81'),contactItemTypes[_0x3ede('0x1e')]);var _0x4b831b=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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x54eed5,_0x252b87,_0x7e1b8e,_0x57e9fc[_0x3ede('0x44')],_0x57e9fc[_0x3ede('0x50')]||null,NOW,NOW);if(_[_0x3ede('0x1f')](_0x3ed3a9[_0x3ede('0x36')])){_0x4b831b+=_0x3ede('0x82');}_0x5d73bf[_0x3ede('0x21')](_0x4b831b);BPromise[_0x3ede('0x83')](_0x5d73bf,handleQuery)['then'](function(_0x38b9d3){BPromise[_0x3ede('0x25')]([handleAdditionalPhones()])[_0x3ede('0x22')](function(){_0x5d73bf=[];for(var _0x4b87bd=0x0;_0x4b87bd\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','where','exports','lodash','squel','../parsers/advancedSearch','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','color','tools_tags','user_has_','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','getInteractionsTables','cm_contacts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','whatsapp','includes','fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','buildExpression','type','default','value','end','read','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','text','start','Tag','map','tags','clause','ids','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','user','body','plainBody','keys','some','compact','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','capitalize','chat','Websites','Accounts','search','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.ContactId','i.MailAccountId'];(function(_0x332998,_0x2d99c7){var _0x460be7=function(_0x1a4d24){while(--_0x1a4d24){_0x332998['push'](_0x332998['shift']());}};_0x460be7(++_0x2d99c7);}(_0xc788,0xc4));var _0x8c78=function(_0x3d80ae,_0x115102){_0x3d80ae=_0x3d80ae-0x0;var _0x5be6cc=_0xc788[_0x3d80ae];return _0x5be6cc;};'use strict';var _=require(_0x8c78('0x0'));var squel=require(_0x8c78('0x1'));var as=require(_0x8c78('0x2'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0x8c78('0x3')];var utils=require(_0x8c78('0x4'));var db=require(_0x8c78('0x5'))['db'];function skipInteractionsQuery(_0x1d0670,_0x386f0a,_0x5498f9){var _0x70960c=![];var _0x4555da=utils[_0x8c78('0x6')](_0x1d0670);if(_0x386f0a[_0x8c78('0x7')]===_0x8c78('0x8')&&!_0x5498f9['search']&&!_0x5498f9[_0x4555da]){_0x70960c=!![];}return _0x70960c;}function getTagsQuery(){return squel[_0x8c78('0x9')]()[_0x8c78('0xa')]('id')[_0x8c78('0xa')](_0x8c78('0xb'))[_0x8c78('0xa')](_0x8c78('0xc'))['from'](_0x8c78('0xd'));}function getUsersQuery(_0x47a54b,_0x3d55f0){var _0x45935a=utils['getInteractionFK'](_0x47a54b);var _0x1a05a7=_0x8c78('0xe')+_0x47a54b+'_interactions';var _0x3a673c=squel['select']()['field'](_0x8c78('0xf'))[_0x8c78('0xa')](_0x8c78('0x10'))[_0x8c78('0xa')](_0x8c78('0x11')+_0x45935a)[_0x8c78('0x12')](_0x1a05a7,'ui')[_0x8c78('0x13')](_0x8c78('0x14'),'u',_0x8c78('0x15'));if(_0x3d55f0[_0x8c78('0x16')]>0x0){_0x3a673c['where'](_0x8c78('0x11')+_0x45935a+_0x8c78('0x17'),_['map'](_0x3d55f0,'id'));}return _0x3a673c;}function getInteractionsQuery(_0x45b85f){var _0x554464=utils[_0x8c78('0x18')](_0x45b85f);var _0x23824e=utils[_0x8c78('0x6')](_0x45b85f);var _0x461eff=utils['getInteractionFK'](_0x45b85f);return squel['select']()[_0x8c78('0x12')](_0x554464['interactions'],'i')['left_join'](_0x8c78('0x19'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8c78('0x13')](_0x8c78('0x14'),'o','o.id\x20=\x20i.UserId')[_0x8c78('0x13')](_0x554464['accounts'],'a',_0x8c78('0x1a')+_0x23824e)[_0x8c78('0x13')](_0x554464['messages'],'me',_0x8c78('0x1b')+_0x461eff+_0x8c78('0x1c'))['left_join'](_0x554464[_0x8c78('0x1d')],'it',_0x8c78('0x1e')+_0x461eff+_0x8c78('0x1c'))[_0x8c78('0x13')](_0x8c78('0xd'),'t',_0x8c78('0x1f'));}function getSqlClauses(){var _0xbfdf6f={'body':squel[_0x8c78('0x20')](),'contact':squel[_0x8c78('0x20')](),'default':squel['expr'](),'fields':squel[_0x8c78('0x20')](),'filter':squel[_0x8c78('0x20')](),'read':squel[_0x8c78('0x20')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x8c78('0x20')]()};return _0xbfdf6f;}function parseTagParameter(_0x5d7445){var _0xe85d05=squel[_0x8c78('0x20')]();if(_0x5d7445){var _0x8d9ff9=utils['getSelectedTags'](_0x5d7445);_0x8d9ff9[_0x8c78('0x21')](function(_0x2568d5){_0xe85d05['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2568d5+',%');});}return _0xe85d05;}function parseReadParameter(_0x20b128){var _0x4376da='';if(_0x20b128){_0x4376da=_0x8c78('0x22');if(_0x20b128==='1'){_0x4376da=_0x4376da[_0x8c78('0x23')](_0x8c78('0x24'),'=');}else{_0x4376da=_0x4376da[_0x8c78('0x23')]('{OPERATOR}','>');}}return _0x4376da;}function parseSearchFilter(_0x1c3039,_0x51add6){var _0xfa5e7b=squel[_0x8c78('0x20')]();if(_0x51add6){var _0xb69c52=_0x51add6['replace']('\x5c','\x5c\x5c')[_0x8c78('0x23')](/'/g,'\x27\x27');if(qs[_0x8c78('0x25')](_0xb69c52)){_0xfa5e7b['or']('i.id\x20LIKE\x20?',_0xb69c52+'%');if([_0x8c78('0x26'),_0x8c78('0x27')][_0x8c78('0x28')](_0x1c3039)){_0xfa5e7b['or']('i.phone\x20LIKE\x20?',_0xb69c52+'%');}else if(_0x1c3039===_0x8c78('0x29')){_0xfa5e7b['or'](_0x8c78('0x2a'),_0xb69c52+'%');}else if(_0x1c3039===_0x8c78('0x2b')){_0xfa5e7b['or']('i.from\x20LIKE\x20?',_0xb69c52+'%');}}else if(_0x1c3039===_0x8c78('0x2c')&&qs[_0x8c78('0x2d')](_0xb69c52)){_0xfa5e7b['or']('c.email\x20LIKE\x20?',_0xb69c52+'%');}else{if(_0x1c3039===_0x8c78('0x2c')){_0xfa5e7b['or'](_0x8c78('0x2e'),qs[_0x8c78('0x2f')](_0xb69c52))['or'](_0x8c78('0x30'),qs[_0x8c78('0x2f')](_0xb69c52));}else{if(_0x1c3039!==_0x8c78('0x29')){_0xfa5e7b['or'](_0x8c78('0x31'),qs[_0x8c78('0x2f')](_0xb69c52));}_0xfa5e7b['or'](_0x8c78('0x32'),_0xb69c52+'%');}}}return _0xfa5e7b;}function parseAdvancedSearchFilter(_0x15a868,_0x5c1f63){var _0x3e9bf1=getSqlClauses();var _0x45e673=as[_0x8c78('0x33')](_0x15a868);var _0xc503ab=_0x45e673[_0x8c78('0x34')];for(var _0x51e188=0x0;_0x51e188<_0x45e673[_0x8c78('0x35')][_0x8c78('0x16')];_0x51e188++){var _0x1312ca=_0x45e673['conditions'][_0x51e188];var _0x814ba9='i';var _0x25ea2f=_['find'](_0x5c1f63,[_0x8c78('0xb'),_0x1312ca['field']]);if(_0x25ea2f){var _0xee735e=as[_0x8c78('0x36')](_0x814ba9,_0x25ea2f[_0x8c78('0x37')],_0x1312ca);_0x3e9bf1[_0x8c78('0x38')][_0xc503ab](_0xee735e['text'],_0xee735e[_0x8c78('0x39')]['start'],_0xee735e[_0x8c78('0x39')][_0x8c78('0x3a')]);}else{switch(_0x1312ca[_0x8c78('0xa')]){case'unreadMessages':var _0x5a04fa=parseReadParameter(_0x1312ca[_0x8c78('0x39')]);_0x3e9bf1[_0x8c78('0x3b')][_0x8c78('0x3c')](_0x5a04fa);break;case _0x8c78('0x3d'):if(_0x1312ca[_0x8c78('0x3e')]===_0x8c78('0x3f')){if(_0x1312ca[_0x8c78('0x39')][_0x8c78('0x40')]('\x20')[_0x8c78('0x16')]>0x1){_0x3e9bf1[_0x8c78('0x41')][_0xc503ab](_0x8c78('0x42'),qs[_0x8c78('0x2f')](_0x1312ca[_0x8c78('0x39')]),null);}else{var _0x5af5a5='%'+_0x1312ca[_0x8c78('0x39')]+'%';_0x3e9bf1[_0x8c78('0x41')][_0xc503ab]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5af5a5,_0x5af5a5,_0x5af5a5);}}else{_0x25ea2f=_['find'](_0x5c1f63,[_0x8c78('0xb'),_0x8c78('0x43')]);_0x1312ca['field']=_0x8c78('0x43');_0xee735e=as[_0x8c78('0x36')](_0x814ba9,_0x25ea2f['type'],_0x1312ca);_0x3e9bf1[_0x8c78('0x41')][_0xc503ab](_0xee735e[_0x8c78('0x44')],_0xee735e['value'][_0x8c78('0x45')],_0xee735e[_0x8c78('0x39')][_0x8c78('0x3a')]);}break;case _0x8c78('0x46'):var _0x3dfb4b=_0x1312ca['value']['split'](',')[_0x8c78('0x47')](function(_0x2f6a6b){return Number(_0x2f6a6b);});var _0xac60f9=parseTagParameter(_0x3dfb4b);_0x3e9bf1[_0x8c78('0x48')][_0x8c78('0x49')][_0x8c78('0x3c')](_0xac60f9);_0x3e9bf1[_0x8c78('0x48')][_0x8c78('0x4a')]=_0x3dfb4b;break;case _0x8c78('0x4b'):if(_0x1312ca[_0x8c78('0x3e')]===_0x8c78('0x3f')){_0x3e9bf1['user'][_0xc503ab](_0x8c78('0x4c'),'%'+_0x1312ca[_0x8c78('0x39')]+'%',null);}else{_0x25ea2f=_[_0x8c78('0x4d')](_0x5c1f63,[_0x8c78('0xb'),_0x8c78('0x4e')]);_0x1312ca['field']=_0x8c78('0x4e');_0xee735e=as[_0x8c78('0x36')](_0x814ba9,_0x25ea2f[_0x8c78('0x37')],_0x1312ca);_0x3e9bf1[_0x8c78('0x4f')][_0xc503ab](_0xee735e[_0x8c78('0x44')],_0xee735e['value'][_0x8c78('0x45')],_0xee735e['value']['end']);}break;case _0x8c78('0x50'):case _0x8c78('0x51'):_0xee735e=as[_0x8c78('0x36')]('me',null,_0x1312ca);_0x3e9bf1['body'][_0xc503ab](_0xee735e[_0x8c78('0x44')],_0xee735e[_0x8c78('0x39')][_0x8c78('0x45')],_0xee735e[_0x8c78('0x39')][_0x8c78('0x3a')]);break;}}}return _0x3e9bf1;}function parseModelFields(_0x38083e,_0x26103c,_0x1f5cdb){var _0x14b084=utils['getAccountFK'](_0x38083e);var _0x1f8993=squel[_0x8c78('0x20')]();var _0xba0de6=_(_0x26103c)[_0x8c78('0x52')]()['map'](function(_0x2fa61e){return _[_0x8c78('0x53')](_0x1f5cdb,[_0x8c78('0xb'),_0x2fa61e])?_0x2fa61e:undefined;})[_0x8c78('0x54')]()['value']();if(_0xba0de6[_0x8c78('0x16')]>0x0){_0xba0de6[_0x8c78('0x21')](function(_0x1b9380){if(_0x1b9380===_0x14b084){_0x1f8993['and']('i.'+_0x14b084+_0x8c78('0x17'),[]['concat'](_0x26103c[_0x1b9380]));}else if(_0x1b9380===_0x8c78('0x55')){var _0xe6325b=JSON[_0x8c78('0x56')](_0x26103c[_0x1b9380])[_0x8c78('0x57')];var _0x349b87=JSON[_0x8c78('0x56')](_0x26103c[_0x1b9380])[_0x8c78('0x58')];_0x1f8993[_0x8c78('0x3c')](_0x8c78('0x59'),_0xe6325b,_0x349b87);}else{if(_0x26103c[_0x1b9380]===_0x8c78('0x5a')){_0x1f8993[_0x8c78('0x3c')]('i.'+_0x1b9380+_0x8c78('0x5b'));}else{_0x1f8993[_0x8c78('0x3c')]('i.'+_0x1b9380+_0x8c78('0x5c'),_0x26103c[_0x1b9380]);}}});}return _0x1f8993;}function parseQueryParameters(_0x54b40d,_0x22fe6c,_0x3721f4){var _0x11c490=getSqlClauses();return Promise[_0x8c78('0x5d')]()['then'](function(){return parseModelFields(_0x54b40d,_0x22fe6c,_0x3721f4);})[_0x8c78('0x5e')](function(_0x32fa95){_0x11c490[_0x8c78('0x5f')][_0x8c78('0x3c')](_0x32fa95);return parseReadParameter(_0x22fe6c[_0x8c78('0x3b')]);})[_0x8c78('0x5e')](function(_0x5986f0){_0x11c490[_0x8c78('0x3b')][_0x8c78('0x3c')](_0x5986f0);return parseTagParameter(_0x22fe6c['tag']);})[_0x8c78('0x5e')](function(_0x568ad0){_0x11c490[_0x8c78('0x48')][_0x8c78('0x49')][_0x8c78('0x3c')](_0x568ad0);return parseSearchFilter(_0x54b40d,_0x22fe6c[_0x8c78('0x60')]);})[_0x8c78('0x5e')](function(_0x35cf85){_0x11c490[_0x8c78('0x60')]=_0x35cf85;return _0x11c490;});}function checkAccountsRestrictions(_0x49fa4c,_0x1c8d79,_0x3e7e32){var _0x4e77a9=utils[_0x8c78('0x6')](_0x49fa4c);var _0x3529aa='get'+_[_0x8c78('0x61')](_0x49fa4c)+(_0x49fa4c===_0x8c78('0x62')?_0x8c78('0x63'):_0x8c78('0x64'));var _0x405b40=squel[_0x8c78('0x20')]();return Promise[_0x8c78('0x5d')]()[_0x8c78('0x5e')](function(){if(_0x3e7e32[_0x8c78('0x65')]&&_0x1c8d79[_0x8c78('0x7')]===_0x8c78('0x8')){return _0x1c8d79[_0x3529aa]({'attributes':['id'],'raw':!![]});}})[_0x8c78('0x5e')](function(_0x1468f2){if(_0x1468f2){if(_0x1468f2[_0x8c78('0x16')]===0x0){_0x405b40['and']('i.'+_0x4e77a9+_0x8c78('0x5b'));}else{_0x405b40['and']('i.'+_0x4e77a9+_0x8c78('0x17'),_['map'](_0x1468f2,'id'));}}else if(!_0x3e7e32[_0x4e77a9]){_0x405b40['and']('i.'+_0x4e77a9+'\x20IS\x20NOT\x20NULL');}})[_0x8c78('0x5e')](function(){return _0x405b40;});}function getClosedOrderClause(_0x5d4778,_0x4c1dec){var _0x502991='';var _0x4373b4=[_0x8c78('0x66'),_0x8c78('0x67'),_0x8c78('0x68')];if(_0x5d4778==='mail'){_0x4373b4[_0x8c78('0x69')](_0x8c78('0x6a'));}if(_0x4c1dec[_0x8c78('0x6b')]==='0'&&_0x5d4778===_0x8c78('0x2c')){_0x502991=_0x8c78('0x6a');}else{if(_0x4c1dec[_0x8c78('0x6b')]==='1'){_0x4373b4[_0x8c78('0x6c')]();}_0x502991=_0x8c78('0x6d')+_0x4373b4[_0x8c78('0x6e')](',\x20')+')';}return _0x502991;}function getFilteredInteractions(_0x472006,_0x6407b7,_0x437695,_0x3e1ee0){var _0x37da1f=utils['getInteractionFK'](_0x472006);var _0x46f57b=_['capitalize'](_0x472006)+_0x8c78('0x6f');var _0x28d1a7=[];var _0x420ccf=getTagsQuery();var _0x4e8038={'type':db[_0x8c78('0x70')][_0x8c78('0x71')][_0x8c78('0x72')],'raw':!![]};var _0x4fa0b0=[];var _0x1fa8a4=[];return db[_0x8c78('0x73')]['query'](_0x420ccf[_0x8c78('0x74')](),_0x4e8038)[_0x8c78('0x5e')](function(_0x1763a7){_0x28d1a7=_['keyBy'](_0x1763a7,'id');_0x4e8038=_[_0x8c78('0x75')](_0x4e8038,{'model':db[_0x46f57b],'mapToModel':!![],'nest':!![]});if(_0x437695[_0x8c78('0x5f')]){_0x3e1ee0[_0x8c78('0x76')][_0x8c78('0x21')](function(_0x173a78){_0x6407b7[_0x8c78('0xa')]('i.'+_0x173a78);});}else{_0x6407b7[_0x8c78('0xa')](_0x8c78('0x77'),_0x8c78('0x78'));_0x6407b7['field'](_0x8c78('0x79'),_0x8c78('0x7a'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x7b'),_0x8c78('0x7c'));if(_0x472006===_0x8c78('0x2c')){_0x6407b7[_0x8c78('0xa')](_0x8c78('0x7d'),_0x8c78('0x7e'));_0x6407b7['field'](_0x8c78('0x7f'),_0x8c78('0x80'));_0x6407b7['field']('i.id');_0x6407b7[_0x8c78('0xa')]('i.createdAt');_0x6407b7[_0x8c78('0xa')](_0x8c78('0x81'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x82'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x83'));_0x6407b7['field']('i.attach');_0x6407b7[_0x8c78('0xa')](_0x8c78('0x84'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x85'));_0x6407b7[_0x8c78('0xa')]('i.subject');_0x6407b7[_0x8c78('0xa')](_0x8c78('0x68'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x67'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x66'));_0x6407b7['field'](_0x8c78('0x6a'));_0x6407b7[_0x8c78('0xa')]('i.to');_0x6407b7[_0x8c78('0xa')](_0x8c78('0x86'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x87'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x88'));}else if(_0x472006===_0x8c78('0x2b')){_0x6407b7[_0x8c78('0xa')](_0x8c78('0x89'),_0x8c78('0x80'));}else{_0x6407b7[_0x8c78('0xa')](_0x8c78('0x8a'),_0x8c78('0x80'));}if(_0x472006!==_0x8c78('0x2c')){_0x6407b7[_0x8c78('0xa')](_0x8c78('0x8b'));}_0x6407b7[_0x8c78('0xa')]('c.firstName',_0x8c78('0x8c'));_0x6407b7['field']('c.lastName',_0x8c78('0x8d'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x8e'),_0x8c78('0x8f'));_0x6407b7['field'](_0x8c78('0x90'),_0x8c78('0x91'));_0x6407b7[_0x8c78('0xa')]('c.mobile',_0x8c78('0x92'));_0x6407b7[_0x8c78('0xa')](_0x8c78('0x93'),_0x8c78('0x94'));_0x6407b7['field'](_0x8c78('0x95'),_0x8c78('0x96'));_0x6407b7['field']('o.internal','Owner.internal');_0x6407b7[_0x8c78('0xa')](_0x8c78('0x97'),_0x8c78('0x98'));}if(_0x3e1ee0[_0x8c78('0x99')]){_0x6407b7['limit'](_0x3e1ee0[_0x8c78('0x99')]);}if(_0x3e1ee0['offset']){_0x6407b7[_0x8c78('0x9a')](_0x3e1ee0[_0x8c78('0x9a')]);}return db[_0x8c78('0x73')][_0x8c78('0x9b')](_0x6407b7[_0x8c78('0x74')](),_0x4e8038);})[_0x8c78('0x5e')](function(_0x5b1a37){_0x4fa0b0=_0x5b1a37;var _0x5c67c9=getUsersQuery(_0x472006,_0x4fa0b0);return db['sequelize'][_0x8c78('0x9b')](_0x5c67c9[_0x8c78('0x74')](),_0x4e8038);})['then'](function(_0xb40796){_0x1fa8a4=_[_0x8c78('0x9c')](_0xb40796,_0x37da1f);if(_0x472006===_0x8c78('0x2c')){return db['Setting'][_0x8c78('0x9d')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x8c78('0x5e')](function(_0x253e6f){var _0x3f013b=_0x253e6f?_0x253e6f[_0x8c78('0x9e')]:undefined;var _0x475b0f=_0x4fa0b0[_0x8c78('0x47')](function(_0x336a0a){return updateInteraction(_0x336a0a,_0x28d1a7,_0x1fa8a4,_0x3f013b);});return Promise[_0x8c78('0x9f')](_0x475b0f);});}function countFilteredInteractions(_0x396c06,_0x46d5c2){var _0x1c1e49=_0x396c06[_0x8c78('0xa0')]();_0x1c1e49['field'](_0x8c78('0xa1'));_0x1c1e49[_0x8c78('0xa')](_0x8c78('0x77'),'unreadMessages');var _0x2cc6f8=utils[_0x8c78('0xa2')](_0x46d5c2);if(!_[_0x8c78('0xa3')](_0x2cc6f8)){_0x1c1e49[_0x8c78('0xa4')]('t.id\x20IN\x20?',_0x2cc6f8);}var _0x2c719b={'type':db[_0x8c78('0x70')][_0x8c78('0x71')]['SELECT'],'raw':!![]};return db[_0x8c78('0x73')][_0x8c78('0x9b')](_0x1c1e49[_0x8c78('0x74')](),_0x2c719b);}module[_0x8c78('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xa0bc=['type','default','text','value','start','end','unreadMessages','read','and','Contact','operator','$substring','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','tags','clause','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','then','fields','tag','filter','capitalize','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','Account.email','contactName','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','map','getInteractionsTables','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','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.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression'];(function(_0x1d9dcf,_0x284f9d){var _0x114ba1=function(_0x2f559a){while(--_0x2f559a){_0x1d9dcf['push'](_0x1d9dcf['shift']());}};_0x114ba1(++_0x284f9d);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var squel=require(_0xca0b('0x0'));var as=require(_0xca0b('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0xca0b('0x2'))[_0xca0b('0x3')];var utils=require(_0xca0b('0x4'));var db=require(_0xca0b('0x5'))['db'];function skipInteractionsQuery(_0x2f7b56,_0x3a53b4,_0xf39a90){var _0x29ae7e=![];var _0x3cb084=utils[_0xca0b('0x6')](_0x2f7b56);if(_0x3a53b4[_0xca0b('0x7')]===_0xca0b('0x8')&&!_0xf39a90[_0xca0b('0x9')]&&!_0xf39a90[_0x3cb084]){_0x29ae7e=!![];}return _0x29ae7e;}function getTagsQuery(){return squel[_0xca0b('0xa')]()['field']('id')[_0xca0b('0xb')](_0xca0b('0xc'))[_0xca0b('0xb')](_0xca0b('0xd'))[_0xca0b('0xe')](_0xca0b('0xf'));}function getUsersQuery(_0x589187,_0x31a0d1){var _0x45c0cf=utils[_0xca0b('0x10')](_0x589187);var _0x18af13=_0xca0b('0x11')+_0x589187+_0xca0b('0x12');var _0x2ab14f=squel[_0xca0b('0xa')]()[_0xca0b('0xb')](_0xca0b('0x13'))['field'](_0xca0b('0x14'))[_0xca0b('0xb')](_0xca0b('0x15')+_0x45c0cf)['from'](_0x18af13,'ui')[_0xca0b('0x16')](_0xca0b('0x17'),'u',_0xca0b('0x18'));if(_0x31a0d1[_0xca0b('0x19')]>0x0){_0x2ab14f[_0xca0b('0x1a')](_0xca0b('0x15')+_0x45c0cf+'\x20IN\x20?',_[_0xca0b('0x1b')](_0x31a0d1,'id'));}return _0x2ab14f;}function getInteractionsQuery(_0x3bcd2a){var _0x4d9b16=utils[_0xca0b('0x1c')](_0x3bcd2a);var _0x5db810=utils[_0xca0b('0x6')](_0x3bcd2a);var _0x5050b7=utils[_0xca0b('0x10')](_0x3bcd2a);return squel[_0xca0b('0xa')]()[_0xca0b('0xe')](_0x4d9b16['interactions'],'i')[_0xca0b('0x16')](_0xca0b('0x1d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xca0b('0x16')](_0xca0b('0x17'),'o',_0xca0b('0x1e'))['left_join'](_0x4d9b16[_0xca0b('0x1f')],'a',_0xca0b('0x20')+_0x5db810)[_0xca0b('0x16')](_0x4d9b16[_0xca0b('0x21')],'me',_0xca0b('0x22')+_0x5050b7+_0xca0b('0x23'))['left_join'](_0x4d9b16[_0xca0b('0x24')],'it',_0xca0b('0x25')+_0x5050b7+_0xca0b('0x23'))['left_join']('tools_tags','t',_0xca0b('0x26'));}function getSqlClauses(){var _0x428459={'body':squel[_0xca0b('0x27')](),'contact':squel[_0xca0b('0x27')](),'default':squel[_0xca0b('0x27')](),'fields':squel['expr'](),'filter':squel[_0xca0b('0x27')](),'read':squel[_0xca0b('0x27')](),'tags':{'clause':squel[_0xca0b('0x27')](),'ids':null},'user':squel[_0xca0b('0x27')]()};return _0x428459;}function parseTagParameter(_0x15478d){var _0x48e172=squel['expr']();if(_0x15478d){var _0x4e0515=utils[_0xca0b('0x28')](_0x15478d);_0x4e0515[_0xca0b('0x29')](function(_0x3fd832){_0x48e172['or'](_0xca0b('0x2a'),'%,'+_0x3fd832+',%');});}return _0x48e172;}function parseReadParameter(_0xe7673b){var _0x515f83='';if(_0xe7673b){_0x515f83=_0xca0b('0x2b');if(_0xe7673b==='1'){_0x515f83=_0x515f83[_0xca0b('0x2c')](_0xca0b('0x2d'),'=');}else{_0x515f83=_0x515f83[_0xca0b('0x2c')](_0xca0b('0x2d'),'>');}}return _0x515f83;}function parseSearchFilter(_0x449a3a,_0xa59ab0){var _0x4a99cb=squel[_0xca0b('0x27')]();if(_0xa59ab0){var _0x17a365=_0xa59ab0[_0xca0b('0x2c')]('\x5c','\x5c\x5c')[_0xca0b('0x2c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x17a365)){_0x4a99cb['or'](_0xca0b('0x2e'),_0x17a365+'%');if([_0xca0b('0x2f'),_0xca0b('0x30')][_0xca0b('0x31')](_0x449a3a)){_0x4a99cb['or'](_0xca0b('0x32'),_0x17a365+'%');}else if(_0x449a3a===_0xca0b('0x33')){_0x4a99cb['or'](_0xca0b('0x34'),_0x17a365+'%');}else if(_0x449a3a===_0xca0b('0x35')){_0x4a99cb['or'](_0xca0b('0x36'),_0x17a365+'%');}}else if(_0x449a3a===_0xca0b('0x37')&&qs[_0xca0b('0x38')](_0x17a365)){_0x4a99cb['or'](_0xca0b('0x39'),_0x17a365+'%');}else{if(_0x449a3a===_0xca0b('0x37')){_0x4a99cb['or'](_0xca0b('0x3a'),qs[_0xca0b('0x3b')](_0x17a365))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xca0b('0x3b')](_0x17a365));}else{if(_0x449a3a!==_0xca0b('0x33')){_0x4a99cb['or'](_0xca0b('0x3c'),qs[_0xca0b('0x3b')](_0x17a365));}_0x4a99cb['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x17a365+'%');}}}return _0x4a99cb;}function parseAdvancedSearchFilter(_0x3d5fef,_0x4657bd){var _0x50d87d=getSqlClauses();var _0x39846e=as[_0xca0b('0x3d')](_0x3d5fef);var _0xe7f5f5=_0x39846e[_0xca0b('0x3e')];for(var _0xe54fbc=0x0;_0xe54fbc<_0x39846e[_0xca0b('0x3f')][_0xca0b('0x19')];_0xe54fbc++){var _0x14acd3=_0x39846e['conditions'][_0xe54fbc];var _0x50642d='i';var _0x370db4=_[_0xca0b('0x40')](_0x4657bd,[_0xca0b('0xc'),_0x14acd3[_0xca0b('0xb')]]);if(_0x370db4){var _0x351f5a=as[_0xca0b('0x41')](_0x50642d,_0x370db4[_0xca0b('0x42')],_0x14acd3);_0x50d87d[_0xca0b('0x43')][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a[_0xca0b('0x45')][_0xca0b('0x46')],_0x351f5a[_0xca0b('0x45')][_0xca0b('0x47')]);}else{switch(_0x14acd3[_0xca0b('0xb')]){case _0xca0b('0x48'):var _0x21b9a9=parseReadParameter(_0x14acd3[_0xca0b('0x45')]);_0x50d87d[_0xca0b('0x49')][_0xca0b('0x4a')](_0x21b9a9);break;case _0xca0b('0x4b'):if(_0x14acd3[_0xca0b('0x4c')]===_0xca0b('0x4d')){if(_0x14acd3[_0xca0b('0x45')][_0xca0b('0x4e')]('\x20')[_0xca0b('0x19')]>0x1){_0x50d87d['contact'][_0xe7f5f5]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xca0b('0x3b')](_0x14acd3[_0xca0b('0x45')]),null);}else{var _0x5da705='%'+_0x14acd3['value']+'%';_0x50d87d['contact'][_0xe7f5f5](_0xca0b('0x4f'),_0x5da705,_0x5da705,_0x5da705);}}else{_0x370db4=_[_0xca0b('0x40')](_0x4657bd,[_0xca0b('0xc'),_0xca0b('0x50')]);_0x14acd3[_0xca0b('0xb')]='ContactId';_0x351f5a=as['buildExpression'](_0x50642d,_0x370db4[_0xca0b('0x42')],_0x14acd3);_0x50d87d['contact'][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a['value']['start'],_0x351f5a['value'][_0xca0b('0x47')]);}break;case _0xca0b('0x51'):var _0x460819=_0x14acd3[_0xca0b('0x45')][_0xca0b('0x4e')](',')[_0xca0b('0x1b')](function(_0x54bcb7){return Number(_0x54bcb7);});var _0x8ecb03=parseTagParameter(_0x460819);_0x50d87d[_0xca0b('0x52')][_0xca0b('0x53')][_0xca0b('0x4a')](_0x8ecb03);_0x50d87d[_0xca0b('0x52')]['ids']=_0x460819;break;case'User':if(_0x14acd3[_0xca0b('0x4c')]===_0xca0b('0x4d')){_0x50d87d[_0xca0b('0x54')][_0xe7f5f5](_0xca0b('0x55'),'%'+_0x14acd3['value']+'%',null);}else{_0x370db4=_[_0xca0b('0x40')](_0x4657bd,[_0xca0b('0xc'),_0xca0b('0x56')]);_0x14acd3[_0xca0b('0xb')]='UserId';_0x351f5a=as['buildExpression'](_0x50642d,_0x370db4[_0xca0b('0x42')],_0x14acd3);_0x50d87d[_0xca0b('0x54')][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a['value'][_0xca0b('0x46')],_0x351f5a[_0xca0b('0x45')]['end']);}break;case'body':case'plainBody':_0x351f5a=as[_0xca0b('0x41')]('me',null,_0x14acd3);_0x50d87d[_0xca0b('0x57')][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a['value']['start'],_0x351f5a[_0xca0b('0x45')][_0xca0b('0x47')]);break;}}}return _0x50d87d;}function parseModelFields(_0x250288,_0x174e81,_0xeea21f){var _0x32e498=utils['getAccountFK'](_0x250288);var _0x4e81ec=squel['expr']();var _0x456ea1=_(_0x174e81)[_0xca0b('0x58')]()['map'](function(_0xcb9937){return _[_0xca0b('0x59')](_0xeea21f,[_0xca0b('0xc'),_0xcb9937])?_0xcb9937:undefined;})['compact']()[_0xca0b('0x45')]();if(_0x456ea1['length']>0x0){_0x456ea1[_0xca0b('0x29')](function(_0x40f0fe){if(_0x40f0fe===_0x32e498){_0x4e81ec[_0xca0b('0x4a')]('i.'+_0x32e498+_0xca0b('0x5a'),[][_0xca0b('0x5b')](_0x174e81[_0x40f0fe]));}else if(_0x40f0fe===_0xca0b('0x5c')){var _0x1be210=JSON[_0xca0b('0x5d')](_0x174e81[_0x40f0fe])[_0xca0b('0x5e')];var _0x35a678=JSON[_0xca0b('0x5d')](_0x174e81[_0x40f0fe])[_0xca0b('0x5f')];_0x4e81ec[_0xca0b('0x4a')](_0xca0b('0x60'),_0x1be210,_0x35a678);}else{if(_0x174e81[_0x40f0fe]===_0xca0b('0x61')){_0x4e81ec[_0xca0b('0x4a')]('i.'+_0x40f0fe+_0xca0b('0x62'));}else{_0x4e81ec[_0xca0b('0x4a')]('i.'+_0x40f0fe+'\x20=\x20?',_0x174e81[_0x40f0fe]);}}});}return _0x4e81ec;}function parseQueryParameters(_0x27fdbd,_0xbef02e,_0x597cc4){var _0x6b80aa=getSqlClauses();return Promise[_0xca0b('0x63')]()[_0xca0b('0x64')](function(){return parseModelFields(_0x27fdbd,_0xbef02e,_0x597cc4);})[_0xca0b('0x64')](function(_0x36763b){_0x6b80aa[_0xca0b('0x65')][_0xca0b('0x4a')](_0x36763b);return parseReadParameter(_0xbef02e[_0xca0b('0x49')]);})['then'](function(_0x197f17){_0x6b80aa[_0xca0b('0x49')][_0xca0b('0x4a')](_0x197f17);return parseTagParameter(_0xbef02e[_0xca0b('0x66')]);})['then'](function(_0x4e2e13){_0x6b80aa[_0xca0b('0x52')][_0xca0b('0x53')]['and'](_0x4e2e13);return parseSearchFilter(_0x27fdbd,_0xbef02e[_0xca0b('0x67')]);})['then'](function(_0x578bef){_0x6b80aa[_0xca0b('0x67')]=_0x578bef;return _0x6b80aa;});}function checkAccountsRestrictions(_0x3716e8,_0x30e70f,_0x47b3fc){var _0x571d30=utils[_0xca0b('0x6')](_0x3716e8);var _0x5aee92='get'+_[_0xca0b('0x68')](_0x3716e8)+(_0x3716e8==='chat'?_0xca0b('0x69'):_0xca0b('0x6a'));var _0x1426bc=squel['expr']();return Promise[_0xca0b('0x63')]()['then'](function(){if(_0x47b3fc[_0xca0b('0x9')]&&_0x30e70f[_0xca0b('0x7')]===_0xca0b('0x8')){return _0x30e70f[_0x5aee92]({'attributes':['id'],'raw':!![]});}})[_0xca0b('0x64')](function(_0x5cf29b){if(_0x5cf29b){if(_0x5cf29b[_0xca0b('0x19')]===0x0){_0x1426bc[_0xca0b('0x4a')]('i.'+_0x571d30+_0xca0b('0x62'));}else{_0x1426bc[_0xca0b('0x4a')]('i.'+_0x571d30+_0xca0b('0x5a'),_[_0xca0b('0x1b')](_0x5cf29b,'id'));}}else if(!_0x47b3fc[_0x571d30]){_0x1426bc[_0xca0b('0x4a')]('i.'+_0x571d30+_0xca0b('0x6b'));}})[_0xca0b('0x64')](function(){return _0x1426bc;});}function getClosedOrderClause(_0x52ad21,_0x5a7608){var _0x122764='';var _0xdcb0a0=[_0xca0b('0x6c'),_0xca0b('0x6d'),_0xca0b('0x6e')];if(_0x52ad21===_0xca0b('0x37')){_0xdcb0a0['unshift'](_0xca0b('0x6f'));}if(_0x5a7608[_0xca0b('0x70')]==='0'&&_0x52ad21===_0xca0b('0x37')){_0x122764='i.substatus';}else{if(_0x5a7608[_0xca0b('0x70')]==='1'){_0xdcb0a0[_0xca0b('0x71')]();}_0x122764=_0xca0b('0x72')+_0xdcb0a0[_0xca0b('0x73')](',\x20')+')';}return _0x122764;}function getFilteredInteractions(_0x7e1c9f,_0x395c99,_0x39c71e,_0x1f123b){var _0x4bf574=utils['getInteractionFK'](_0x7e1c9f);var _0x5cc68e=_['capitalize'](_0x7e1c9f)+'Interaction';var _0x412d78=[];var _0x294e6c=getTagsQuery();var _0x1d07a2={'type':db[_0xca0b('0x74')][_0xca0b('0x75')][_0xca0b('0x76')],'raw':!![]};var _0x28a14b=[];var _0x67c743=[];return db[_0xca0b('0x77')][_0xca0b('0x78')](_0x294e6c['toString'](),_0x1d07a2)[_0xca0b('0x64')](function(_0x5f31c6){_0x412d78=_[_0xca0b('0x79')](_0x5f31c6,'id');_0x1d07a2=_['merge'](_0x1d07a2,{'model':db[_0x5cc68e],'mapToModel':!![],'nest':!![]});if(_0x39c71e[_0xca0b('0x65')]){_0x1f123b[_0xca0b('0x7a')]['forEach'](function(_0x57bdb3){_0x395c99[_0xca0b('0xb')]('i.'+_0x57bdb3);});}else{_0x395c99[_0xca0b('0xb')](_0xca0b('0x7b'),'unreadMessages');_0x395c99[_0xca0b('0xb')](_0xca0b('0x7c'),_0xca0b('0x7d'));_0x395c99[_0xca0b('0xb')]('a.mandatoryDisposition',_0xca0b('0x7e'));if(_0x7e1c9f==='mail'){_0x395c99[_0xca0b('0xb')]('a.email',_0xca0b('0x7f'));_0x395c99[_0xca0b('0xb')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xca0b('0x80'));_0x395c99[_0xca0b('0xb')]('i.id');_0x395c99[_0xca0b('0xb')](_0xca0b('0x81'));_0x395c99[_0xca0b('0xb')]('i.updatedAt');_0x395c99[_0xca0b('0xb')](_0xca0b('0x82'));_0x395c99[_0xca0b('0xb')]('i.closedAt');_0x395c99[_0xca0b('0xb')](_0xca0b('0x83'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x84'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x85'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x86'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x6e'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x6d'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x6c'));_0x395c99[_0xca0b('0xb')]('i.substatus');_0x395c99[_0xca0b('0xb')](_0xca0b('0x87'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x88'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x89'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x8a'));}else if(_0x7e1c9f==='openchannel'){_0x395c99[_0xca0b('0xb')](_0xca0b('0x8b'),_0xca0b('0x80'));}else{_0x395c99[_0xca0b('0xb')](_0xca0b('0x8c'),_0xca0b('0x80'));}if(_0x7e1c9f!=='mail'){_0x395c99[_0xca0b('0xb')](_0xca0b('0x8d'));}_0x395c99[_0xca0b('0xb')](_0xca0b('0x8e'),_0xca0b('0x8f'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x90'),_0xca0b('0x91'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x92'),_0xca0b('0x93'));_0x395c99[_0xca0b('0xb')]('c.phone',_0xca0b('0x94'));_0x395c99['field'](_0xca0b('0x95'),_0xca0b('0x96'));_0x395c99['field'](_0xca0b('0x97'),_0xca0b('0x98'));_0x395c99['field']('o.fullname',_0xca0b('0x99'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x9a'),'Owner.internal');_0x395c99[_0xca0b('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xca0b('0x9b'));}if(_0x1f123b['limit']){_0x395c99[_0xca0b('0x9c')](_0x1f123b[_0xca0b('0x9c')]);}if(_0x1f123b[_0xca0b('0x9d')]){_0x395c99['offset'](_0x1f123b['offset']);}return db['sequelize'][_0xca0b('0x78')](_0x395c99[_0xca0b('0x9e')](),_0x1d07a2);})[_0xca0b('0x64')](function(_0x3cd7d6){_0x28a14b=_0x3cd7d6;var _0x23d2b1=getUsersQuery(_0x7e1c9f,_0x28a14b);return db[_0xca0b('0x77')][_0xca0b('0x78')](_0x23d2b1['toString'](),_0x1d07a2);})['then'](function(_0x283628){_0x67c743=_[_0xca0b('0x9f')](_0x283628,_0x4bf574);if(_0x7e1c9f===_0xca0b('0x37')){return db[_0xca0b('0xa0')][_0xca0b('0xa1')]({'attributes':[_0xca0b('0xa2')],'raw':!![]});}})[_0xca0b('0x64')](function(_0x2d857f){var _0x9b78b=_0x2d857f?_0x2d857f[_0xca0b('0xa2')]:undefined;var _0x4b9764=_0x28a14b['map'](function(_0x5a453b){return updateInteraction(_0x5a453b,_0x412d78,_0x67c743,_0x9b78b);});return Promise[_0xca0b('0xa3')](_0x4b9764);});}function countFilteredInteractions(_0x2cee7e,_0x144cc1){var _0x50e10a=_0x2cee7e['clone']();_0x50e10a[_0xca0b('0xb')](_0xca0b('0xa4'));_0x50e10a[_0xca0b('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xca0b('0x48'));var _0x3ff232=utils['getSelectedTags'](_0x144cc1);if(!_[_0xca0b('0xa5')](_0x3ff232)){_0x50e10a[_0xca0b('0x1a')](_0xca0b('0xa6'),_0x3ff232);}var _0x26e684={'type':db['Sequelize'][_0xca0b('0x75')][_0xca0b('0x76')],'raw':!![]};return db[_0xca0b('0x77')]['query'](_0x50e10a[_0xca0b('0x9e')](),_0x26e684);}module[_0xca0b('0xa7')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 645a38d..dad408a 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4da1=['map','split','forEach','push','waiting','unmanaged','abandoned','UserId','answered','talking','disposition','total','MailMessage','findOne','out','plainBody','-id','then','catch','updateInteraction','Users','TagIds','lodash'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x4da1,0xce));var _0x14da=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4da1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x14da('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x49e71a,_0x427782){return new Promise(function(_0x146beb,_0x645aa9){try{var _0x219416=[];if(_0x427782[_0x49e71a]){_0x219416=_0x427782[_0x49e71a][_0x14da('0x1')](function(_0x59441b){return{'id':_0x59441b['id'],'fullname':_0x59441b['fullname']};});}return _0x146beb(_0x219416);}catch(_0x5db264){_0x645aa9(_0x5db264);}});}function getInteractionTags(_0x5f1c1d,_0x57e28d){var _0x46d290=[];if(_0x5f1c1d){_0x5f1c1d[_0x14da('0x2')](',')[_0x14da('0x3')](function(_0x40ee15){_0x46d290[_0x14da('0x4')](_0x57e28d[_0x40ee15]);});}return _0x46d290;}function updateWaitingCounter(_0x47a095){if(_0x47a095['waiting']){_0x47a095[_0x14da('0x5')]-=0x1;}}function updateInteractionCounters(_0x31183d){_0x31183d[_0x14da('0x5')]=0x0;_0x31183d['talking']=0x0;_0x31183d['answered']=0x0;_0x31183d[_0x14da('0x6')]=0x0;_0x31183d['abandoned']=0x0;_0x31183d['total']=0x0;if(_0x31183d['closed']){if(_0x31183d['disposition']===_0x14da('0x7')){_0x31183d['abandoned']+=0x1;updateWaitingCounter(_0x31183d);}if(_0x31183d[_0x14da('0x8')]){_0x31183d[_0x14da('0x9')]+=0x1;if(_0x31183d[_0x14da('0xa')]){_0x31183d[_0x14da('0xa')]-=0x1;}}else{if(_0x31183d[_0x14da('0xb')]){_0x31183d['unmanaged']+=0x1;updateWaitingCounter(_0x31183d);}}}else{if(!_0x31183d[_0x14da('0x8')]){_0x31183d['waiting']+=0x1;}if(_0x31183d['UserId']){_0x31183d[_0x14da('0xa')]+=0x1;updateWaitingCounter(_0x31183d);}}_0x31183d[_0x14da('0xc')]+=0x1;return _0x31183d;}function getLastMessageText(_0x120807){return db[_0x14da('0xd')][_0x14da('0xe')]({'where':{'$and':[{'MailInteractionId':_0x120807['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x14da('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x14da('0x10')],'order':_0x14da('0x11'),'raw':!![]})[_0x14da('0x12')](function(_0x25a876){if(_0x25a876&&_0x25a876[_0x14da('0x10')]){_0x120807['lastMsgText']=_['trimStart'](_0x25a876['plainBody']);}return _0x120807;})[_0x14da('0x13')](function(_0x128d77){throw _0x128d77;});}exports[_0x14da('0x14')]=function(_0x52df30,_0xac5f4b,_0x29c6a8,_0x5b9fb6){return new Promise(function(_0x112670,_0x2945b7){return getInteractionUsers(_0x52df30['id'],_0x29c6a8)[_0x14da('0x12')](function(_0x597f1e){_0x52df30[_0x14da('0x15')]=_0x597f1e;return getInteractionTags(_0x52df30[_0x14da('0x16')],_0xac5f4b);})[_0x14da('0x12')](function(_0x275b93){_0x52df30['Tags']=_0x275b93;delete _0x52df30['TagIds'];return updateInteractionCounters(_0x52df30);})[_0x14da('0x12')](function(_0x5dc42e){if(_0x5b9fb6){return getLastMessageText(_0x5dc42e);}else{return _0x5dc42e;}})[_0x14da('0x12')](function(_0xecaea0){_0x112670(_0xecaea0);})['catch'](function(_0x4b1e28){_0x2945b7(_0x4b1e28);});});}; \ No newline at end of file +var _0x095a=['forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Tags','TagIds','lodash','fullname','split'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0x095a,0x75));var _0xa095=function(_0x5cbb5f,_0x302e6a){_0x5cbb5f=_0x5cbb5f-0x0;var _0x47853c=_0x095a[_0x5cbb5f];return _0x47853c;};'use strict';var _=require(_0xa095('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x325f3f,_0x4c51b4){return new Promise(function(_0x4cc678,_0x62e85f){try{var _0xa599ba=[];if(_0x4c51b4[_0x325f3f]){_0xa599ba=_0x4c51b4[_0x325f3f]['map'](function(_0x4fe2e7){return{'id':_0x4fe2e7['id'],'fullname':_0x4fe2e7[_0xa095('0x1')]};});}return _0x4cc678(_0xa599ba);}catch(_0x2cbfae){_0x62e85f(_0x2cbfae);}});}function getInteractionTags(_0x17a8ad,_0xb55638){var _0x168607=[];if(_0x17a8ad){_0x17a8ad[_0xa095('0x2')](',')[_0xa095('0x3')](function(_0x1f7107){_0x168607[_0xa095('0x4')](_0xb55638[_0x1f7107]);});}return _0x168607;}function updateWaitingCounter(_0x1ccb93){if(_0x1ccb93[_0xa095('0x5')]){_0x1ccb93['waiting']-=0x1;}}function updateInteractionCounters(_0x3c9494){_0x3c9494[_0xa095('0x5')]=0x0;_0x3c9494[_0xa095('0x6')]=0x0;_0x3c9494[_0xa095('0x7')]=0x0;_0x3c9494[_0xa095('0x8')]=0x0;_0x3c9494[_0xa095('0x9')]=0x0;_0x3c9494[_0xa095('0xa')]=0x0;if(_0x3c9494[_0xa095('0xb')]){if(_0x3c9494[_0xa095('0xc')]==='abandoned'){_0x3c9494[_0xa095('0x9')]+=0x1;updateWaitingCounter(_0x3c9494);}if(_0x3c9494['UserId']){_0x3c9494[_0xa095('0x7')]+=0x1;if(_0x3c9494[_0xa095('0x6')]){_0x3c9494[_0xa095('0x6')]-=0x1;}}else{if(_0x3c9494['disposition']){_0x3c9494[_0xa095('0x8')]+=0x1;updateWaitingCounter(_0x3c9494);}}}else{if(!_0x3c9494[_0xa095('0xd')]){_0x3c9494[_0xa095('0x5')]+=0x1;}if(_0x3c9494['UserId']){_0x3c9494[_0xa095('0x6')]+=0x1;updateWaitingCounter(_0x3c9494);}}_0x3c9494[_0xa095('0xa')]+=0x1;return _0x3c9494;}function getLastMessageText(_0x3309f1){return db['MailMessage'][_0xa095('0xe')]({'where':{'$and':[{'MailInteractionId':_0x3309f1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xa095('0xf')],'order':_0xa095('0x10'),'raw':!![]})[_0xa095('0x11')](function(_0x57e927){if(_0x57e927&&_0x57e927['plainBody']){_0x3309f1[_0xa095('0x12')]=_[_0xa095('0x13')](_0x57e927[_0xa095('0xf')]);}return _0x3309f1;})[_0xa095('0x14')](function(_0x341614){throw _0x341614;});}exports[_0xa095('0x15')]=function(_0x5d5b64,_0x48eb44,_0x176e8f,_0x1bd28a){return new Promise(function(_0x172899,_0x371db8){return getInteractionUsers(_0x5d5b64['id'],_0x176e8f)[_0xa095('0x11')](function(_0x578586){_0x5d5b64['Users']=_0x578586;return getInteractionTags(_0x5d5b64['TagIds'],_0x48eb44);})[_0xa095('0x11')](function(_0x644153){_0x5d5b64[_0xa095('0x16')]=_0x644153;delete _0x5d5b64[_0xa095('0x17')];return updateInteractionCounters(_0x5d5b64);})['then'](function(_0x447565){if(_0x1bd28a){return getLastMessageText(_0x447565);}else{return _0x447565;}})[_0xa095('0x11')](function(_0x26bf08){_0x172899(_0x26bf08);})[_0xa095('0x14')](function(_0x5c011f){_0x371db8(_0x5c011f);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 75f6300..bdd7bc4 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a8d=['_interaction_has_tags','_messages','user_has_','isArray','toUpperCase','name','stringify','upperFirst','then','update','info','catch','exports','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','unknown','websites','_interactions'];(function(_0x44d809,_0x1f76fb){var _0x5361b9=function(_0x3e2a7f){while(--_0x3e2a7f){_0x44d809['push'](_0x44d809['shift']());}};_0x5361b9(++_0x1f76fb);}(_0x8a8d,0x179));var _0xd8a8=function(_0x214b3d,_0x28978b){_0x214b3d=_0x214b3d-0x0;var _0xcee44a=_0x8a8d[_0x214b3d];return _0xcee44a;};'use strict';var _=require('lodash');var db=require(_0xd8a8('0x0'))['db'];var loggers={'openchannel':require(_0xd8a8('0x1'))('openchannel-interactions'),'mail':require(_0xd8a8('0x1'))(_0xd8a8('0x2')),'fax':require(_0xd8a8('0x1'))(_0xd8a8('0x3')),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')(_0xd8a8('0x4'))};function getAccountFK(_0x5ba945){return _[_0xd8a8('0x5')](_0x5ba945)+(_0x5ba945===_0xd8a8('0x6')?_0xd8a8('0x7'):_0xd8a8('0x8'))+'Id';}function getInteractionFK(_0x22b742){return _[_0xd8a8('0x5')](_0x22b742)+'InteractionId';}function getInteractionId(_0x388004,_0x46bfe5,_0x4cfadd){if(_0x388004&&_0x388004[_['upperFirst'](_0x4cfadd)+_0xd8a8('0x9')]){return _0x388004[_['upperFirst'](_0x4cfadd)+_0xd8a8('0x9')];}else if(_0x388004&&_0x388004['id']){return _0x388004['id'];}else if(_0x46bfe5&&_0x46bfe5['id']){return _0x46bfe5['id'];}else{return _0xd8a8('0xa');}}function getInteractionsTables(_0x5c6c73){return{'accounts':_0x5c6c73+'_'+(_0x5c6c73===_0xd8a8('0x6')?_0xd8a8('0xb'):'accounts'),'interactions':_0x5c6c73+_0xd8a8('0xc'),'interactionsTags':_0x5c6c73+_0xd8a8('0xd'),'messages':_0x5c6c73+_0xd8a8('0xe'),'userInteractions':_0xd8a8('0xf')+_0x5c6c73+_0xd8a8('0xc')};}function getSelectedTags(_0x20e965){var _0x7d436d=[];if(_0x20e965){_0x7d436d=Array[_0xd8a8('0x10')](_0x20e965)?_0x20e965:[_0x20e965];}return _0x7d436d;}function log(_0x218322,_0x4539f3,_0x564f40,_0x52863b,_0x4f9f7e,_0x546e92){loggers[_0x4f9f7e['toLowerCase']()][_0x218322]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x546e92[_0xd8a8('0x11')](),_0x4539f3?_0x4539f3['id']:null,_0x4539f3?_0x4539f3[_0xd8a8('0x12')]:null,_0x4539f3?_0x4539f3['role']:null,getInteractionId(_0x564f40,_0x52863b,_0x4f9f7e),_0x564f40?JSON[_0xd8a8('0x13')](_0x564f40):'null');}function updateUser(_0x13d617,_0x589351,_0x45da24,_0x4b29c4,_0x26ea76){db[_[_0xd8a8('0x14')](_0x4b29c4)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x589351,_0x45da24,_0x4b29c4)}})[_0xd8a8('0x15')](function(_0x40fdbf){if(_0x40fdbf){return _0x40fdbf[_0xd8a8('0x16')]({'UserId':_0x13d617?_0x13d617['id']:null});}})[_0xd8a8('0x15')](function(_0x812574){if(_0x812574){log(_0xd8a8('0x17'),_0x13d617,_0x589351,_0x45da24,_0x4b29c4,_0x26ea76);}})[_0xd8a8('0x18')](function(){log('error',_0x13d617,_0x589351,_0x45da24,_0x4b29c4,_0x26ea76);});}module[_0xd8a8('0x19')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x0b8c=['_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','null','Interaction','findOne','then','info','error','exports','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','InteractionId','upperFirst'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x0b8c,0x1a5));var _0xc0b8=function(_0x5616b0,_0x14ac3b){_0x5616b0=_0x5616b0-0x0;var _0x502d8b=_0x0b8c[_0x5616b0];return _0x502d8b;};'use strict';var _=require('lodash');var db=require(_0xc0b8('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xc0b8('0x1')),'mail':require(_0xc0b8('0x2'))(_0xc0b8('0x3')),'fax':require(_0xc0b8('0x2'))(_0xc0b8('0x4')),'sms':require(_0xc0b8('0x2'))(_0xc0b8('0x5')),'chat':require(_0xc0b8('0x2'))(_0xc0b8('0x6')),'whatsapp':require(_0xc0b8('0x2'))('whatsapp-interactions')};function getAccountFK(_0x2bcfc9){return _[_0xc0b8('0x7')](_0x2bcfc9)+(_0x2bcfc9===_0xc0b8('0x8')?'Website':'Account')+'Id';}function getInteractionFK(_0x37e695){return _['capitalize'](_0x37e695)+_0xc0b8('0x9');}function getInteractionId(_0x51d0f4,_0x1c4b92,_0x35663b){if(_0x51d0f4&&_0x51d0f4[_['upperFirst'](_0x35663b)+_0xc0b8('0x9')]){return _0x51d0f4[_[_0xc0b8('0xa')](_0x35663b)+_0xc0b8('0x9')];}else if(_0x51d0f4&&_0x51d0f4['id']){return _0x51d0f4['id'];}else if(_0x1c4b92&&_0x1c4b92['id']){return _0x1c4b92['id'];}else{return'unknown';}}function getInteractionsTables(_0x443c64){return{'accounts':_0x443c64+'_'+(_0x443c64===_0xc0b8('0x8')?'websites':'accounts'),'interactions':_0x443c64+_0xc0b8('0xb'),'interactionsTags':_0x443c64+_0xc0b8('0xc'),'messages':_0x443c64+_0xc0b8('0xd'),'userInteractions':_0xc0b8('0xe')+_0x443c64+_0xc0b8('0xb')};}function getSelectedTags(_0x39b6a8){var _0x24ff7b=[];if(_0x39b6a8){_0x24ff7b=Array[_0xc0b8('0xf')](_0x39b6a8)?_0x39b6a8:[_0x39b6a8];}return _0x24ff7b;}function log(_0x2413a7,_0x1df2c1,_0x1f4d1b,_0x433aab,_0x8ad420,_0x3c5aef){loggers[_0x8ad420[_0xc0b8('0x10')]()][_0x2413a7](_0xc0b8('0x11'),_0x3c5aef[_0xc0b8('0x12')](),_0x1df2c1?_0x1df2c1['id']:null,_0x1df2c1?_0x1df2c1[_0xc0b8('0x13')]:null,_0x1df2c1?_0x1df2c1['role']:null,getInteractionId(_0x1f4d1b,_0x433aab,_0x8ad420),_0x1f4d1b?JSON['stringify'](_0x1f4d1b):_0xc0b8('0x14'));}function updateUser(_0x5037fe,_0x55b4bb,_0x5c38aa,_0x1bbf60,_0x9b2328){db[_['upperFirst'](_0x1bbf60)+_0xc0b8('0x15')][_0xc0b8('0x16')]({'where':{'id':getInteractionId(_0x55b4bb,_0x5c38aa,_0x1bbf60)}})[_0xc0b8('0x17')](function(_0x178392){if(_0x178392){return _0x178392['update']({'UserId':_0x5037fe?_0x5037fe['id']:null});}})[_0xc0b8('0x17')](function(_0x1721f5){if(_0x1721f5){log(_0xc0b8('0x18'),_0x5037fe,_0x55b4bb,_0x5c38aa,_0x1bbf60,_0x9b2328);}})['catch'](function(){log(_0xc0b8('0x19'),_0x5037fe,_0x55b4bb,_0x5c38aa,_0x1bbf60,_0x9b2328);});}module[_0xc0b8('0x1a')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 5efbfa4..f51c0b1 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa317=['update','final','utf8','parse','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','split','format','%s:%s:%s'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa317,0x13a));var _0x7a31=function(_0x58e95e,_0x4a3e9b){_0x58e95e=_0x58e95e-0x0;var _0x4cdb1a=_0xa317[_0x58e95e];return _0x4cdb1a;};'use strict';var crypto=require(_0x7a31('0x0'));var util=require(_0x7a31('0x1'));var compose=require(_0x7a31('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x7a31('0x3'));function getValueFromLicense(_0x10a48f,_0x2a4dac){if(_0x10a48f&&_0x2a4dac){if(_0x2a4dac[_0x7a31('0x4')]&&_0x2a4dac['license']){var _0x3085f0=_0x2a4dac[_0x7a31('0x4')];var _0x14c45f=_0x2a4dac['license'];var _0x3ed899=_0x3085f0['split']('-')[0x4];var _0xc37685=_0x3085f0[_0x7a31('0x5')]('-')[0x0];var _0x3f6e95=crypto['createDecipher']('aes-256-ctr',util[_0x7a31('0x6')](_0x7a31('0x7'),_0x3ed899,_0x3085f0,_0xc37685));var _0x52708b=_0x3f6e95[_0x7a31('0x8')](_0x14c45f,'base64','utf8');_0x52708b+=_0x3f6e95[_0x7a31('0x9')](_0x7a31('0xa'));var _0x3b6b30=JSON[_0x7a31('0xb')](_0x52708b);return _0x3b6b30['hasOwnProperty'](_0x10a48f)?_0x3b6b30[_0x10a48f]:null;}}return null;}function isLimit(_0x120a02,_0x2a914b,_0x1e6740,_0x564f85){var _0x38f5e4=_0x2a914b;return compose()[_0x7a31('0xc')](function(_0x4767a3,_0x360ec3,_0x1c1e35){return db[_0x7a31('0xd')][_0x7a31('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x498ec4){var _0xb396df=getValueFromLicense(_0x120a02,_0x498ec4);return _0xb396df?_0xb396df:_0x38f5e4;})[_0x7a31('0xf')](function(_0x538b58){_0x38f5e4=_0x538b58;return _0x1e6740[_0x7a31('0x10')](_0x564f85);})[_0x7a31('0xf')](function(_0x34713d){if(_0x34713d>=_0x38f5e4){return _0x360ec3[_0x7a31('0x11')](0x193)['json']({'message':util[_0x7a31('0x6')](_0x7a31('0x12'),_0x120a02)});}_0x1c1e35();})['catch'](function(_0x5cc1eb){_0x1c1e35(_0x5cc1eb);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x7a31('0x13')],{'where':{'$or':[{'role':_0x7a31('0x14')},{'role':_0x7a31('0x15')}]}});}exports[_0x7a31('0x16')]=isUserLimit; \ No newline at end of file +var _0x6dc3=['admin','crypto','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr','format','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x529464,_0xce492c){var _0x2cdef7=function(_0x5e215f){while(--_0x5e215f){_0x529464['push'](_0x529464['shift']());}};_0x2cdef7(++_0xce492c);}(_0x6dc3,0x1a1));var _0x36dc=function(_0x2e828b,_0x57a7a4){_0x2e828b=_0x2e828b-0x0;var _0x3d1167=_0x6dc3[_0x2e828b];return _0x3d1167;};'use strict';var crypto=require(_0x36dc('0x0'));var util=require('util');var compose=require(_0x36dc('0x1'));var db=require(_0x36dc('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x876296,_0x21ecff){if(_0x876296&&_0x21ecff){if(_0x21ecff[_0x36dc('0x3')]&&_0x21ecff[_0x36dc('0x4')]){var _0x197016=_0x21ecff[_0x36dc('0x3')];var _0x416a12=_0x21ecff[_0x36dc('0x4')];var _0x5a1a83=_0x197016[_0x36dc('0x5')]('-')[0x4];var _0xbd794e=_0x197016['split']('-')[0x0];var _0x3b24b3=crypto['createDecipher'](_0x36dc('0x6'),util[_0x36dc('0x7')]('%s:%s:%s',_0x5a1a83,_0x197016,_0xbd794e));var _0x3885d9=_0x3b24b3[_0x36dc('0x8')](_0x416a12,_0x36dc('0x9'),'utf8');_0x3885d9+=_0x3b24b3[_0x36dc('0xa')](_0x36dc('0xb'));var _0x1bf8cb=JSON[_0x36dc('0xc')](_0x3885d9);return _0x1bf8cb[_0x36dc('0xd')](_0x876296)?_0x1bf8cb[_0x876296]:null;}}return null;}function isLimit(_0x5eb534,_0x19c2be,_0x1b27fe,_0x366cf1){var _0x5bfe33=_0x19c2be;return compose()[_0x36dc('0xe')](function(_0x407690,_0x2b0f27,_0x3b4f96){return db[_0x36dc('0xf')][_0x36dc('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x36dc('0x11')](function(_0x265b6b){var _0x567e5d=getValueFromLicense(_0x5eb534,_0x265b6b);return _0x567e5d?_0x567e5d:_0x5bfe33;})[_0x36dc('0x11')](function(_0x46dd47){_0x5bfe33=_0x46dd47;return _0x1b27fe[_0x36dc('0x12')](_0x366cf1);})[_0x36dc('0x11')](function(_0x348eb7){if(_0x348eb7>=_0x5bfe33){return _0x2b0f27[_0x36dc('0x13')](0x193)[_0x36dc('0x14')]({'message':util[_0x36dc('0x7')](_0x36dc('0x15'),_0x5eb534)});}_0x3b4f96();})[_0x36dc('0x16')](function(_0x129c03){_0x3b4f96(_0x129c03);});});}function isUserLimit(){return isLimit(_0x36dc('0x17'),0x1,db[_0x36dc('0x18')],{'where':{'$or':[{'role':_0x36dc('0x19')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1a4ad81..81a2fb3 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52cf=['$in','start','$substring','$endsWith','shift','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','length','split','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x52cf,0x171));var _0xf52c=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x52cf[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xf52c('0x0'));var moment=require('moment');exports[_0xf52c('0x1')]=function(_0x5d3fa7){var _0x47abcc={'conditions':[]};_0x47abcc[_0xf52c('0x2')]=_[_0xf52c('0x3')](_0x5d3fa7,_0xf52c('0x4'))?'or':_0xf52c('0x5');var _0x34bbbc=_0x5d3fa7[_0xf52c('0x6')](_0xf52c('0x7'),'')[_0xf52c('0x6')](_0xf52c('0x4'),'')['split']('||');for(var _0x18aa1e=0x0;_0x18aa1e<_0x34bbbc[_0xf52c('0x8')];_0x18aa1e++){var _0x17e4af=_0x34bbbc[_0x18aa1e][_0xf52c('0x9')](':=');var _0xe6f66d=_0x17e4af[0x0];var _0x50bfeb=_0x17e4af[_0xf52c('0xa')](0x1);_0x50bfeb[_0xf52c('0xb')](function(_0x6cd94e){var _0xa5e850=_0x6cd94e[_0xf52c('0x9')]('[')['shift']();var _0x3feaa6=_0x6cd94e[_0xf52c('0xc')](/\[(.*?)\]/g);_0x3feaa6['forEach'](function(_0x70078c){var _0x3d5152=_0x70078c[_0xf52c('0x9')]('[')[_0xf52c('0xd')](function(_0x23b27e){return _0x23b27e[_0xf52c('0xe')](']')>-0x1;})[_0xf52c('0xf')](function(_0x58db64){return _0x58db64[_0xf52c('0x9')](']')[0x0];})[0x0];_0x47abcc[_0xf52c('0x10')][_0xf52c('0x11')]({'field':_0xe6f66d,'operator':_0xa5e850,'value':_0x3d5152});});});}return _0x47abcc;};exports[_0xf52c('0x12')]=function(_0x152678,_0x1b1a80,_0x42826a){var _0x207718={};if(_0x1b1a80===_0xf52c('0x13')){if(_0x42826a[_0xf52c('0x14')]===_0xf52c('0x15')){_0x42826a[_0xf52c('0x14')]=_0xf52c('0x16');_0x42826a['value']+=','+_0x42826a[_0xf52c('0x17')];}else if(_[_0xf52c('0x18')]([_0xf52c('0x19'),_0xf52c('0x1a')],_0x42826a['operator'])){_0x42826a[_0xf52c('0x17')]=moment(_0x42826a['value'])[_0xf52c('0x1b')](0x1,'days')[_0xf52c('0x1c')](_0xf52c('0x1d'));}}if(_0x42826a[_0xf52c('0x1e')]){_0x1b1a80=_0x42826a[_0xf52c('0x1e')];_0x207718[_0xf52c('0x1f')]=_0xf52c('0x20')+_0x152678+'.'+_0x42826a[_0xf52c('0x21')]+_0xf52c('0x22')+_0x42826a[_0xf52c('0x1e')]+')\x20'+parseOperator(_0x42826a[_0xf52c('0x14')]);}else{_0x207718[_0xf52c('0x1f')]=_0x152678+'.'+_0x42826a[_0xf52c('0x21')]+'\x20'+parseOperator(_0x42826a[_0xf52c('0x14')]);}if(_[_0xf52c('0x18')](['$ne','$notIn'],_0x42826a[_0xf52c('0x14')]))_0x207718[_0xf52c('0x1f')]='('+_0x207718[_0xf52c('0x1f')]+_0xf52c('0x23')+_0x152678+'.'+_0x42826a[_0xf52c('0x21')]+_0xf52c('0x24');_0x207718['value']=parseValue(_0x1b1a80,_0x42826a[_0xf52c('0x14')],_0x42826a[_0xf52c('0x17')]);return _0x207718;};function parseOperator(_0x472a4d){var _0x2e1599;switch(_0x472a4d){case'$in':_0x2e1599=_0xf52c('0x25');break;case _0xf52c('0x26'):_0x2e1599=_0xf52c('0x27');break;case _0xf52c('0x15'):_0x2e1599=_0xf52c('0x28');break;case _0xf52c('0x29'):_0x2e1599=_0xf52c('0x2a');break;case'$substring':case _0xf52c('0x2b'):case'$endsWith':_0x2e1599=_0xf52c('0x2c');break;case _0xf52c('0x2d'):_0x2e1599=_0xf52c('0x2e');break;case _0xf52c('0x19'):_0x2e1599=_0xf52c('0x2f');break;case _0xf52c('0x1a'):_0x2e1599=_0xf52c('0x30');break;case _0xf52c('0x31'):_0x2e1599=_0xf52c('0x32');break;case'$between':_0x2e1599='BETWEEN\x20?\x20AND\x20?';break;}return _0x2e1599;}function parseValue(_0x204d14,_0x527314,_0xfef10c){var _0x2535dd={'start':undefined,'end':undefined};switch(_0x527314){case _0xf52c('0x33'):case'$notIn':_0x2535dd[_0xf52c('0x34')]=_0xfef10c['split'](',');break;case _0xf52c('0x35'):_0x2535dd['start']='%'+_0xfef10c+'%';break;case _0xf52c('0x2b'):_0x2535dd['start']=_0xfef10c+'%';break;case _0xf52c('0x36'):_0x2535dd[_0xf52c('0x34')]='%'+_0xfef10c;break;case'$between':var _0x2cdfca=_0xfef10c[_0xf52c('0x9')](',');var _0xfef10c=_0x2cdfca[_0xf52c('0x37')]();var _0x4299c2=_0x2cdfca['pop']();if(_0x204d14===_0xf52c('0x13')){_0xfef10c=moment(_0xfef10c)[_0xf52c('0x38')](0x0,!![])[_0xf52c('0x1c')]();_0x4299c2=moment(_0x4299c2)[_0xf52c('0x38')](0x0,!![])['add'](0x17,_0xf52c('0x39'))[_0xf52c('0x1b')](0x3b,_0xf52c('0x3a'))[_0xf52c('0x1b')](0x3b,_0xf52c('0x3b'))['format']();}_0x2535dd={'start':_0xfef10c,'end':_0x4299c2};break;default:_0x2535dd['start']=_0xfef10c;break;}return _0x2535dd;} \ No newline at end of file +var _0x1358=['minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','shift','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','$eq','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','pop','DATE','format','utcOffset','hours'];(function(_0x594d31,_0x8ef2e3){var _0x5e54ab=function(_0x20aaba){while(--_0x20aaba){_0x594d31['push'](_0x594d31['shift']());}};_0x5e54ab(++_0x8ef2e3);}(_0x1358,0x6c));var _0x8135=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x1358[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x8135('0x0'));var moment=require(_0x8135('0x1'));exports[_0x8135('0x2')]=function(_0x522785){var _0x220783={'conditions':[]};_0x220783[_0x8135('0x3')]=_[_0x8135('0x4')](_0x522785,_0x8135('0x5'))?'or':_0x8135('0x6');var _0x478b50=_0x522785[_0x8135('0x7')]('[$and]','')['replace'](_0x8135('0x5'),'')[_0x8135('0x8')]('||');for(var _0x5d9198=0x0;_0x5d9198<_0x478b50[_0x8135('0x9')];_0x5d9198++){var _0x268734=_0x478b50[_0x5d9198]['split'](':=');var _0x3d51e9=_0x268734[0x0];var _0x379986=_0x268734[_0x8135('0xa')](0x1);_0x379986['forEach'](function(_0x42efe3){var _0x2e705f=_0x42efe3['split']('[')[_0x8135('0xb')]();var _0x45402d=_0x42efe3['match'](/\[(.*?)\]/g);_0x45402d['forEach'](function(_0x281f26){var _0x5a2276=_0x281f26[_0x8135('0x8')]('[')[_0x8135('0xc')](function(_0x248923){return _0x248923[_0x8135('0xd')](']')>-0x1;})[_0x8135('0xe')](function(_0x3dcd38){return _0x3dcd38[_0x8135('0x8')](']')[0x0];})[0x0];_0x220783[_0x8135('0xf')][_0x8135('0x10')]({'field':_0x3d51e9,'operator':_0x2e705f,'value':_0x5a2276});});});}return _0x220783;};exports[_0x8135('0x11')]=function(_0x3f104c,_0x3464b5,_0x14a3c4){var _0x47eb76={};if(_0x3464b5==='DATE'){if(_0x14a3c4[_0x8135('0x12')]==='$eq'){_0x14a3c4['operator']=_0x8135('0x13');_0x14a3c4[_0x8135('0x14')]+=','+_0x14a3c4['value'];}else if(_[_0x8135('0x15')]([_0x8135('0x16'),'$lte'],_0x14a3c4[_0x8135('0x12')])){_0x14a3c4[_0x8135('0x14')]=moment(_0x14a3c4[_0x8135('0x14')])[_0x8135('0x17')](0x1,_0x8135('0x18'))['format'](_0x8135('0x19'));}}if(_0x14a3c4[_0x8135('0x1a')]){_0x3464b5=_0x14a3c4['castTo'];_0x47eb76[_0x8135('0x1b')]=_0x8135('0x1c')+_0x3f104c+'.'+_0x14a3c4[_0x8135('0x1d')]+'\x20AS\x20'+_0x14a3c4['castTo']+')\x20'+parseOperator(_0x14a3c4['operator']);}else{_0x47eb76[_0x8135('0x1b')]=_0x3f104c+'.'+_0x14a3c4[_0x8135('0x1d')]+'\x20'+parseOperator(_0x14a3c4[_0x8135('0x12')]);}if(_[_0x8135('0x15')](['$ne','$notIn'],_0x14a3c4[_0x8135('0x12')]))_0x47eb76[_0x8135('0x1b')]='('+_0x47eb76[_0x8135('0x1b')]+'\x20OR\x20'+_0x3f104c+'.'+_0x14a3c4[_0x8135('0x1d')]+'\x20IS\x20NULL)';_0x47eb76[_0x8135('0x14')]=parseValue(_0x3464b5,_0x14a3c4[_0x8135('0x12')],_0x14a3c4['value']);return _0x47eb76;};function parseOperator(_0x41a460){var _0x3e2b3b;switch(_0x41a460){case'$in':_0x3e2b3b='IN\x20?';break;case _0x8135('0x1e'):_0x3e2b3b='NOT\x20IN\x20?';break;case _0x8135('0x1f'):_0x3e2b3b='=\x20?';break;case _0x8135('0x20'):_0x3e2b3b=_0x8135('0x21');break;case _0x8135('0x22'):case _0x8135('0x23'):case _0x8135('0x24'):_0x3e2b3b=_0x8135('0x25');break;case _0x8135('0x26'):_0x3e2b3b=_0x8135('0x27');break;case _0x8135('0x16'):_0x3e2b3b=_0x8135('0x28');break;case _0x8135('0x29'):_0x3e2b3b=_0x8135('0x2a');break;case _0x8135('0x2b'):_0x3e2b3b=_0x8135('0x2c');break;case _0x8135('0x13'):_0x3e2b3b='BETWEEN\x20?\x20AND\x20?';break;}return _0x3e2b3b;}function parseValue(_0x5a68c4,_0x142c72,_0x5a479e){var _0x2c8aec={'start':undefined,'end':undefined};switch(_0x142c72){case'$in':case'$notIn':_0x2c8aec[_0x8135('0x2d')]=_0x5a479e[_0x8135('0x8')](',');break;case _0x8135('0x22'):_0x2c8aec[_0x8135('0x2d')]='%'+_0x5a479e+'%';break;case _0x8135('0x23'):_0x2c8aec[_0x8135('0x2d')]=_0x5a479e+'%';break;case _0x8135('0x24'):_0x2c8aec[_0x8135('0x2d')]='%'+_0x5a479e;break;case _0x8135('0x13'):var _0x5573de=_0x5a479e[_0x8135('0x8')](',');var _0x5a479e=_0x5573de[_0x8135('0xb')]();var _0x5bee0b=_0x5573de[_0x8135('0x2e')]();if(_0x5a68c4===_0x8135('0x2f')){_0x5a479e=moment(_0x5a479e)['utcOffset'](0x0,!![])[_0x8135('0x30')]();_0x5bee0b=moment(_0x5bee0b)[_0x8135('0x31')](0x0,!![])[_0x8135('0x17')](0x17,_0x8135('0x32'))['add'](0x3b,_0x8135('0x33'))[_0x8135('0x17')](0x3b,_0x8135('0x34'))['format']();}_0x2c8aec={'start':_0x5a479e,'end':_0x5bee0b};break;default:_0x2c8aec[_0x8135('0x2d')]=_0x5a479e;break;}return _0x2c8aec;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index f7b4d58..9ef0265 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d17=['indexOf','unsigned','substr','priority','cast','col','length','omit','unset','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','query','$id','model','name','keys','intersection','attributes','hasOwnProperty','offset','order','where','pick','filter','object','columns','merge','VIRTUAL','lower','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','sort','map'];(function(_0x551559,_0x37688f){var _0x5590da=function(_0x43fa3c){while(--_0x43fa3c){_0x551559['push'](_0x551559['shift']());}};_0x5590da(++_0x37688f);}(_0x2d17,0x17e));var _0x72d1=function(_0x2a8618,_0x120c60){_0x2a8618=_0x2a8618-0x0;var _0x164340=_0x2d17[_0x2a8618];return _0x164340;};'use strict';var _=require(_0x72d1('0x0'));var sequelize=require(_0x72d1('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x12f23c){var _0x4727f9=['ne'];try{var _0x531f4e=JSON[_0x72d1('0x2')](_0x12f23c);var _0x38fec7=Object['keys'](_0x531f4e)[0x0];return _0x4727f9[_0x72d1('0x3')](_0x38fec7);}catch(_0x4dfee1){return![];}}function getOperatorValue(_0x39150f){var _0x50f551=JSON[_0x72d1('0x2')](_0x39150f);var _0x239d1f=Object['keys'](_0x50f551)[0x0];var _0x477264=_0x50f551[_0x239d1f];return{['$'+_0x239d1f]:_0x477264};}exports[_0x72d1('0x4')]=function(_0x19e248){var _0x4e7f3e=null;if(_0x19e248){_0x4e7f3e=_0x19e248[_0x72d1('0x5')](',');}return _0x4e7f3e;};exports[_0x72d1('0x6')]=function(_0x283775,_0x593c91){var _0x1d7520={};if(!_[_0x72d1('0x7')](_0x283775)){_[_0x72d1('0x8')](_0x283775,function(_0x14a41e,_0x3cb9c2){try{if(_0x593c91){var _0x3916f2=_[_0x72d1('0x9')](_0x593c91,{'name':_0x3cb9c2})||{};if(hasSequelizeOperator(_0x14a41e)){_0x1d7520[_0x3cb9c2]=getOperatorValue(_0x14a41e);}else if(_0x3916f2[_0x72d1('0xa')]===_0x72d1('0xb')&&_[_0x72d1('0xc')](_0x14a41e)){var _0x5ad4df=JSON[_0x72d1('0x2')](_0x14a41e);var _0x37017c={'$gte':moment(moment(_0x5ad4df[_0x72d1('0xd')])[_0x72d1('0xe')](_0x72d1('0xf')))[_0x72d1('0x10')]()[_0x72d1('0xe')](),'$lte':moment(moment(_0x5ad4df[_0x72d1('0x11')])[_0x72d1('0xe')](_0x72d1('0xf')))[_0x72d1('0x10')]()[_0x72d1('0x12')](0x1,'s')[_0x72d1('0xe')]()};_0x1d7520[_0x3cb9c2]=_0x37017c;}else if(_0x3916f2['name']===_0x72d1('0x13')){_0x1d7520[_0x3cb9c2]=_0x14a41e;}else{_0x1d7520[_0x3cb9c2]=_['isArray'](_0x14a41e)?_0x14a41e:JSON[_0x72d1('0x2')](_0x14a41e);}}else{_0x1d7520[_0x3cb9c2]=_[_0x72d1('0x14')](_0x14a41e)?_0x14a41e:JSON['parse'](_0x14a41e);}}catch(_0x1061b7){_0x1d7520[_0x3cb9c2]=_0x14a41e[_0x72d1('0x5')](',');}});}return _0x1d7520;};exports[_0x72d1('0x15')]=function(_0x49caf4){_0x49caf4=parseInt(_0x49caf4,0xa);if(!_0x49caf4||_0x49caf4<0x0){_0x49caf4=LIMIT_VALUE;}return _0x49caf4;};exports['offset']=function(_0x313d7b){_0x313d7b=parseInt(_0x313d7b,0xa);if(!_0x313d7b||_0x313d7b<0x0){_0x313d7b=0x0;}return _0x313d7b;};exports[_0x72d1('0x16')]=function(_0x2233cb){var _0x1865c1,_0x8d6890=null;if(_0x2233cb){_0x1865c1=_0x2233cb[_0x72d1('0x5')](',');_0x8d6890=_[_0x72d1('0x17')](_0x1865c1,function(_0x5c7982){if(_0x5c7982[_0x72d1('0x18')]('-')===0x0){return[_0x5c7982==='priority'?sequelize['cast'](sequelize['col']('priority'),_0x72d1('0x19')):_0x5c7982[_0x72d1('0x1a')](0x1),'DESC'];}else{return[_0x5c7982===_0x72d1('0x1b')?sequelize[_0x72d1('0x1c')](sequelize[_0x72d1('0x1d')](_0x72d1('0x1b')),_0x72d1('0x19')):_0x5c7982,'ASC'];}});}return _0x8d6890;};exports['omit']=function(_0x188eca,_0x36bc65){if(_[_0x72d1('0x7')](_0x188eca)){return _0x188eca;}if(_[_0x72d1('0x14')](_0x188eca)){for(var _0xdf6a69=0x0;_0xdf6a69<_0x188eca[_0x72d1('0x1e')];_0xdf6a69+=0x1){_0x188eca[_0xdf6a69]=this[_0x72d1('0x1f')](_0x188eca[_0xdf6a69],_0x36bc65);}return _0x188eca;}if(!_['isObject'](_0x188eca)){return _0x188eca;}if(_['isString'](_0x36bc65)){_0x36bc65=[_0x36bc65];}if(!_[_0x72d1('0x14')](_0x36bc65)){return _0x188eca;}for(var _0x482cb8=0x0;_0x482cb8<_0x36bc65[_0x72d1('0x1e')];_0x482cb8+=0x1){_[_0x72d1('0x20')](_0x188eca,_0x36bc65[_0x482cb8]);}for(var _0x2c113d in _0x188eca){if(_0x188eca['hasOwnProperty'](_0x2c113d)){_0x188eca[_0x2c113d]=this[_0x72d1('0x1f')](_0x188eca[_0x2c113d],_0x36bc65);}}return _0x188eca;};exports['isNumeric']=function(_0x707cd0){return _0x707cd0[_0x72d1('0x21')](RegExp(_0x72d1('0x22')))?!![]:![];};exports[_0x72d1('0x23')]=function(_0x51242b){return _0x51242b[_0x72d1('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x42c03c){var _0x32dc5e=[];_0x42c03c['split'](/[ ,]+/)[_0x72d1('0x24')](function(_0x358b0c){_0x358b0c=_0x358b0c[_0x72d1('0x25')](/([^:]")"+/g,'$1');_0x358b0c='+'+_0x358b0c+'*';var _0x11ea2f=/[ `!@#$%^&*()_\-?~]/;if(_0x358b0c[_0x72d1('0x21')](_0x11ea2f))_0x358b0c='\x22'+_0x358b0c+'\x22';_0x32dc5e['push'](_0x358b0c);});return _0x32dc5e[_0x72d1('0x26')]('\x20');};exports[_0x72d1('0x27')]=function(_0x9efc2f,_0x482033,_0x244f4a){var _0x14669a={},_0x4a2909={};if(_0x482033[_0x72d1('0x28')][_0x72d1('0x29')]){_0x482033[_0x72d1('0x28')]['id']=_0x482033['query'][_0x72d1('0x29')];delete _0x482033['query'][_0x72d1('0x29')];}_0x14669a[_0x72d1('0x2a')]=_[_0x72d1('0x17')](_0x9efc2f,_0x72d1('0x2b'));_0x14669a[_0x72d1('0x28')]=_[_0x72d1('0x2c')](_0x482033[_0x72d1('0x28')]);_0x14669a[_0x72d1('0x6')]=_[_0x72d1('0x2d')](_0x14669a[_0x72d1('0x2a')],_0x14669a[_0x72d1('0x28')]);_0x4a2909['attributes']=_[_0x72d1('0x2d')](_0x14669a[_0x72d1('0x2a')],this[_0x72d1('0x4')](_0x482033[_0x72d1('0x28')]['fields']));_0x4a2909[_0x72d1('0x2e')]=_0x4a2909[_0x72d1('0x2e')][_0x72d1('0x1e')]?_0x4a2909['attributes']:_0x14669a[_0x72d1('0x2a')];if(!_0x482033[_0x72d1('0x28')][_0x72d1('0x2f')]('nolimit')){_0x4a2909[_0x72d1('0x15')]=this[_0x72d1('0x15')](_0x482033[_0x72d1('0x28')]['limit']);_0x4a2909[_0x72d1('0x30')]=this[_0x72d1('0x30')](_0x482033[_0x72d1('0x28')][_0x72d1('0x30')]);}_0x4a2909[_0x72d1('0x31')]=this[_0x72d1('0x16')](_0x482033[_0x72d1('0x28')]['sort']);_0x4a2909[_0x72d1('0x32')]=this[_0x72d1('0x6')](_[_0x72d1('0x33')](_0x482033[_0x72d1('0x28')],_0x14669a[_0x72d1('0x6')]),_0x9efc2f);if(_0x482033[_0x72d1('0x28')][_0x72d1('0x34')]){var _0x1d4fdf=_0x9efc2f;var _0x55438b=_0x482033[_0x72d1('0x28')][_0x72d1('0x34')];if(typeof _0x55438b===_0x72d1('0x35')){_0x1d4fdf=_[_0x72d1('0x34')](_0x9efc2f,function(_0x45870b){return _[_0x72d1('0x3')](_0x55438b[_0x72d1('0x36')],_0x45870b[_0x72d1('0x2b')]);});_0x55438b=_0x55438b['value'];}_0x4a2909['where']=_[_0x72d1('0x37')](_0x4a2909[_0x72d1('0x32')],{'$or':_[_0x72d1('0x17')](_0x1d4fdf,function(_0x21d361){if(_0x21d361['type']!==_0x72d1('0x38')){if(_0x244f4a){return sequelize[_0x72d1('0x32')](sequelize['fn']('lower',sequelize[_0x72d1('0x1d')](_0x21d361['name'])),{'$like':sequelize['fn'](_0x72d1('0x39'),'%'+_0x482033[_0x72d1('0x28')]['filter']+'%')});}else{var _0x37c69a={};_0x37c69a[_0x21d361['name']]={'$like':'%'+_0x482033['query']['filter']+'%'};return _0x37c69a;}}})});}_0x4a2909=_[_0x72d1('0x37')]({},_0x4a2909,_0x482033['options']);return _0x4a2909;}; \ No newline at end of file +var _0x7dfd=['col','unsigned','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','getFullTextValue','replace','match','push','join','getOptions','query','$id','model','intersection','fields','attributes','offset','order','where','object','filter','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','substr','DESC'];(function(_0x36654f,_0x12cccd){var _0x3f8168=function(_0x5bb101){while(--_0x5bb101){_0x36654f['push'](_0x36654f['shift']());}};_0x3f8168(++_0x12cccd);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var sequelize=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2d48e6){var _0x346f5f=['ne'];try{var _0x28c3c9=JSON[_0xd7df('0x3')](_0x2d48e6);var _0x38eee7=Object[_0xd7df('0x4')](_0x28c3c9)[0x0];return _0x346f5f[_0xd7df('0x5')](_0x38eee7);}catch(_0x65a0b6){return![];}}function getOperatorValue(_0x3304f9){var _0x36cf0f=JSON[_0xd7df('0x3')](_0x3304f9);var _0x354ea7=Object[_0xd7df('0x4')](_0x36cf0f)[0x0];var _0x2c48a4=_0x36cf0f[_0x354ea7];return{['$'+_0x354ea7]:_0x2c48a4};}exports['fields']=function(_0xab6742){var _0xb3557a=null;if(_0xab6742){_0xb3557a=_0xab6742[_0xd7df('0x6')](',');}return _0xb3557a;};exports[_0xd7df('0x7')]=function(_0x5e59c3,_0x32c5b5){var _0x532c14={};if(!_[_0xd7df('0x8')](_0x5e59c3)){_['forOwn'](_0x5e59c3,function(_0x394d32,_0x82f1c0){try{if(_0x32c5b5){var _0x28d358=_[_0xd7df('0x9')](_0x32c5b5,{'name':_0x82f1c0})||{};if(hasSequelizeOperator(_0x394d32)){_0x532c14[_0x82f1c0]=getOperatorValue(_0x394d32);}else if(_0x28d358[_0xd7df('0xa')]===_0xd7df('0xb')&&_[_0xd7df('0xc')](_0x394d32)){var _0x3da618=JSON[_0xd7df('0x3')](_0x394d32);var _0x4d6f17={'$gte':moment(moment(_0x3da618[_0xd7df('0xd')])[_0xd7df('0xe')](_0xd7df('0xf')))[_0xd7df('0x10')]()[_0xd7df('0xe')](),'$lte':moment(moment(_0x3da618[_0xd7df('0x11')])[_0xd7df('0xe')]('YYYY-MM-DD'))[_0xd7df('0x10')]()[_0xd7df('0x12')](0x1,'s')['format']()};_0x532c14[_0x82f1c0]=_0x4d6f17;}else if(_0x28d358[_0xd7df('0x13')]===_0xd7df('0x14')){_0x532c14[_0x82f1c0]=_0x394d32;}else{_0x532c14[_0x82f1c0]=_['isArray'](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}else{_0x532c14[_0x82f1c0]=_[_0xd7df('0x15')](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}catch(_0x5210e5){_0x532c14[_0x82f1c0]=_0x394d32[_0xd7df('0x6')](',');}});}return _0x532c14;};exports[_0xd7df('0x16')]=function(_0x3cea3){_0x3cea3=parseInt(_0x3cea3,0xa);if(!_0x3cea3||_0x3cea3<0x0){_0x3cea3=LIMIT_VALUE;}return _0x3cea3;};exports['offset']=function(_0x96d86e){_0x96d86e=parseInt(_0x96d86e,0xa);if(!_0x96d86e||_0x96d86e<0x0){_0x96d86e=0x0;}return _0x96d86e;};exports[_0xd7df('0x17')]=function(_0x4e1985){var _0x5acb0a,_0x4188af=null;if(_0x4e1985){_0x5acb0a=_0x4e1985['split'](',');_0x4188af=_[_0xd7df('0x18')](_0x5acb0a,function(_0x5ab737){if(_0x5ab737[_0xd7df('0x19')]('-')===0x0){return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize['col'](_0xd7df('0x1a')),'unsigned'):_0x5ab737[_0xd7df('0x1c')](0x1),_0xd7df('0x1d')];}else{return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize[_0xd7df('0x1e')](_0xd7df('0x1a')),_0xd7df('0x1f')):_0x5ab737,'ASC'];}});}return _0x4188af;};exports['omit']=function(_0x36f2bd,_0x38db14){if(_[_0xd7df('0x8')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x15')](_0x36f2bd)){for(var _0x13f190=0x0;_0x13f190<_0x36f2bd[_0xd7df('0x20')];_0x13f190+=0x1){_0x36f2bd[_0x13f190]=this[_0xd7df('0x21')](_0x36f2bd[_0x13f190],_0x38db14);}return _0x36f2bd;}if(!_[_0xd7df('0x22')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x23')](_0x38db14)){_0x38db14=[_0x38db14];}if(!_['isArray'](_0x38db14)){return _0x36f2bd;}for(var _0xe53f53=0x0;_0xe53f53<_0x38db14[_0xd7df('0x20')];_0xe53f53+=0x1){_[_0xd7df('0x24')](_0x36f2bd,_0x38db14[_0xe53f53]);}for(var _0x29f0e8 in _0x36f2bd){if(_0x36f2bd[_0xd7df('0x25')](_0x29f0e8)){_0x36f2bd[_0x29f0e8]=this[_0xd7df('0x21')](_0x36f2bd[_0x29f0e8],_0x38db14);}}return _0x36f2bd;};exports[_0xd7df('0x26')]=function(_0x36de76){return _0x36de76['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x58584d){return _0x58584d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd7df('0x27')]=function(_0x4e87cd){var _0xd366b=[];_0x4e87cd[_0xd7df('0x6')](/[ ,]+/)['forEach'](function(_0x3ef553){_0x3ef553=_0x3ef553[_0xd7df('0x28')](/([^:]")"+/g,'$1');_0x3ef553='+'+_0x3ef553+'*';var _0x4fe918=/[ `!@#$%^&*()_\-?~]/;if(_0x3ef553[_0xd7df('0x29')](_0x4fe918))_0x3ef553='\x22'+_0x3ef553+'\x22';_0xd366b[_0xd7df('0x2a')](_0x3ef553);});return _0xd366b[_0xd7df('0x2b')]('\x20');};exports[_0xd7df('0x2c')]=function(_0x40f965,_0x3304c4,_0x5a658f){var _0x428b4b={},_0x149813={};if(_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')]){_0x3304c4[_0xd7df('0x2d')]['id']=_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];delete _0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];}_0x428b4b[_0xd7df('0x2f')]=_[_0xd7df('0x18')](_0x40f965,'name');_0x428b4b['query']=_[_0xd7df('0x4')](_0x3304c4['query']);_0x428b4b[_0xd7df('0x7')]=_[_0xd7df('0x30')](_0x428b4b[_0xd7df('0x2f')],_0x428b4b[_0xd7df('0x2d')]);_0x149813['attributes']=_['intersection'](_0x428b4b['model'],this[_0xd7df('0x31')](_0x3304c4[_0xd7df('0x2d')]['fields']));_0x149813[_0xd7df('0x32')]=_0x149813[_0xd7df('0x32')][_0xd7df('0x20')]?_0x149813[_0xd7df('0x32')]:_0x428b4b['model'];if(!_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x25')]('nolimit')){_0x149813[_0xd7df('0x16')]=this['limit'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x16')]);_0x149813[_0xd7df('0x33')]=this['offset'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x33')]);}_0x149813[_0xd7df('0x34')]=this[_0xd7df('0x17')](_0x3304c4['query'][_0xd7df('0x17')]);_0x149813[_0xd7df('0x35')]=this[_0xd7df('0x7')](_['pick'](_0x3304c4[_0xd7df('0x2d')],_0x428b4b[_0xd7df('0x7')]),_0x40f965);if(_0x3304c4[_0xd7df('0x2d')]['filter']){var _0x80019d=_0x40f965;var _0x445467=_0x3304c4['query']['filter'];if(typeof _0x445467===_0xd7df('0x36')){_0x80019d=_[_0xd7df('0x37')](_0x40f965,function(_0x6a024a){return _['includes'](_0x445467['columns'],_0x6a024a[_0xd7df('0x13')]);});_0x445467=_0x445467['value'];}_0x149813[_0xd7df('0x35')]=_['merge'](_0x149813['where'],{'$or':_[_0xd7df('0x18')](_0x80019d,function(_0x579d0f){if(_0x579d0f[_0xd7df('0xa')]!==_0xd7df('0x38')){if(_0x5a658f){return sequelize[_0xd7df('0x35')](sequelize['fn'](_0xd7df('0x39'),sequelize[_0xd7df('0x1e')](_0x579d0f[_0xd7df('0x13')])),{'$like':sequelize['fn'](_0xd7df('0x39'),'%'+_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x37')]+'%')});}else{var _0x5b3179={};_0x5b3179[_0x579d0f[_0xd7df('0x13')]]={'$like':'%'+_0x3304c4['query'][_0xd7df('0x37')]+'%'};return _0x5b3179;}}})});}_0x149813=_[_0xd7df('0x3a')]({},_0x149813,_0x3304c4[_0xd7df('0x3b')]);return _0x149813;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 728ebbf..0b8bd93 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x598e=['pick','value','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','busy','getAgentStatus','startCase','Queue','map','findOne','getAgents','all','flatten','includes','resolve','User','findAll','name','fullname','mailPause','openchannelPause','pauseType','find','catch','split','fields','globalStatus','order','DESC','ASC','internal','substring','indexOf','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit'];(function(_0x543a99,_0x4c9cdf){var _0xac8270=function(_0x27fd73){while(--_0x27fd73){_0x543a99['push'](_0x543a99['shift']());}};_0xac8270(++_0x4c9cdf);}(_0x598e,0xc5));var _0xe598=function(_0x58a02d,_0x536812){_0x58a02d=_0x58a02d-0x0;var _0x1e4aa3=_0x598e[_0x58a02d];return _0x1e4aa3;};'use strict';var _=require(_0xe598('0x0'));var jayson=require(_0xe598('0x1'));var db=require(_0xe598('0x2'))['db'];var amiClient=jayson[_0xe598('0x3')][_0xe598('0x4')]({'port':0x232a});var routingClient=jayson[_0xe598('0x3')][_0xe598('0x4')]({'port':0x232c});function isAgentPaused(_0x271631,_0x53e5d7){var _0xfb2af5=[_0x271631[_0xe598('0x5')],_0x271631[_0xe598('0x6')],_0x271631['mailPause'],_0x271631['openchannelPause'],_0x271631[_0xe598('0x7')],_0x271631[_0xe598('0x8')],_0x271631[_0xe598('0x9')]];if(!_0x53e5d7)return _[_0xe598('0xa')](_0xfb2af5);var _0x33f41=_[_0xe598('0xb')](_0xfb2af5);return _0x33f41[_0xe598('0xc')]>0x0&&_0x33f41[_0xe598('0xc')]<_0xfb2af5[_0xe598('0xc')]?!![]:![];}function isIdle(_0x1d4045){return _0x1d4045==='idle'||_0x1d4045===_0xe598('0xd')||_0x1d4045===_0xe598('0xe')||_0x1d4045===_0xe598('0xf')||_[_0xe598('0x10')](_0x1d4045);}function isAgentIdle(_0x21cf80){if(_0x21cf80[_0xe598('0x11')]!==_0xe598('0x12')&&_0x21cf80[_0xe598('0x8')]){_0x21cf80[_0xe598('0x11')]=_0xe598('0x13');return![];}return _[_0xe598('0xa')]([_0x21cf80[_0xe598('0x14')],_0x21cf80['faxStatus'],_0x21cf80[_0xe598('0x15')],_0x21cf80[_0xe598('0x16')],_0x21cf80[_0xe598('0x17')],_0x21cf80[_0xe598('0x11')],_0x21cf80['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xe598('0x18'),{})[_0xe598('0x19')](function(_0x5dfa23){if(_0x5dfa23[_0xe598('0x1a')]){throw new Error(_0xe598('0x1b'));}var _0x1847f7=_0x5dfa23[_0xe598('0x1c')];return routingClient[_0xe598('0x1d')]('Agents',{})['then'](function(_0x18b355){if(_0x18b355[_0xe598('0x1a')]){throw new Error(_0xe598('0x1e'));}var _0x22a9cc=_0x18b355['result'];return _[_0xe598('0x1f')]({},_0x1847f7,_0x22a9cc);});})['catch'](function(_0x51fba6){throw _0x51fba6;});}exports[_0xe598('0x20')]=getRealtimeAgents;function getAgentStatus(_0x1d945f){var _0x33cf6f=_0xe598('0xd');if(isAgentPaused(_0x1d945f))_0x33cf6f=_0xe598('0x13');else if(isAgentPaused(_0x1d945f,!![]))_0x33cf6f=_0xe598('0x21');else if(isAgentIdle(_0x1d945f))_0x33cf6f=_0xe598('0x12');else _0x33cf6f=_0xe598('0x22');return _0x33cf6f;}exports[_0xe598('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x383bbd,_0x2f6dc0){var _0x24d501=_['isArray'](_0x383bbd)?_0x383bbd:[_0x383bbd];var _0x3d98ec=_[_0xe598('0x24')](_0x2f6dc0)+_0xe598('0x25');var _0x5a46ae=_[_0xe598('0x26')](_0x24d501,function(_0x5b7771){return db[_0x3d98ec][_0xe598('0x27')]({'where':{'id':_0x5b7771}})['then'](function(_0x230891){if(!_0x230891)return[];return _0x230891[_0xe598('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xe598('0x29')](_0x5a46ae)[_0xe598('0x19')](function(_0x3c3f0d){var _0x493401=_(_0x3c3f0d)[_0xe598('0x2a')]()[_0xe598('0x26')]('id')['uniq']()['value']();return _0x493401;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4cc1ed,_0x224bc9,_0x4337cd){try{if(_0x224bc9[_0xe598('0xc')]>0x0){_0x4cc1ed=_0x4cc1ed[_0xe598('0xb')](function(_0x1a5c4b){return _0x224bc9[_0xe598('0x2b')](_0x1a5c4b['id']);});}var _0x1b1675=_0x4cc1ed[_0xe598('0xb')](function(_0x16940f){var _0x3d689a=_0xe598('0x22');if(isAgentIdle(_0x16940f)){_0x3d689a=_0xe598('0x12');}return _0x3d689a===_0x4337cd;});return _[_0xe598('0x26')](_0x1b1675,'id');}catch(_0x25f6d5){throw _0x25f6d5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1535af,_0x3e8cfd,_0x5e64c3){return Promise[_0xe598('0x2c')]()[_0xe598('0x19')](function(){if(_0x3e8cfd[_0xe598('0xc')]>0x0){_0x1535af=_0x1535af[_0xe598('0xb')](function(_0x401a82){return _0x3e8cfd['includes'](_0x401a82['id']);});}return _0x1535af;})['then'](function(){return db[_0xe598('0x2d')][_0xe598('0x2e')]({'attributes':['id',_0xe598('0x2f'),_0xe598('0x30'),_0xe598('0x5'),'faxPause',_0xe598('0x31'),_0xe598('0x32'),'smsPause',_0xe598('0x8'),_0xe598('0x9'),_0xe598('0x33')],'where':{'id':{'$in':_[_0xe598('0x26')](_0x1535af,'id')}},'raw':!![]});})['then'](function(_0xaced99){return _0xaced99['map'](function(_0x5147ac){var _0x407d8b=_[_0xe598('0x34')](_0x1535af,['id',_0x5147ac['id']]);var _0x5841a3=filterAgentAttributes(_0x407d8b);_['merge'](_0x5147ac,_0x5841a3);_0x5147ac['globalStatus']=getAgentStatus(_0x5147ac);return _0x5147ac;});})[_0xe598('0x19')](function(_0x1a2141){var _0xfab26e=sortAgentsByStatus(_0x1a2141,_0x5e64c3);return _['map'](_0xfab26e,'id');})[_0xe598('0x35')](function(_0x5ad0bf){throw _0x5ad0bf;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x47b066){var _0x5137c1={'fields':[],'order':null};var _0x3a639e=_0x47b066[_0xe598('0x36')](',');_0x5137c1[_0xe598('0x37')]=_[_0xe598('0xb')](_0x3a639e,function(_0x3c7024){if(!_0x3c7024[_0xe598('0x2b')](_0xe598('0x38'))){return!![];}_0x5137c1[_0xe598('0x39')]=_['startsWith'](_0x3c7024,'-')?_0xe598('0x3a'):_0xe598('0x3b');return![];});return _0x5137c1;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x160f3a){if(_0x160f3a['includes'](_0xe598('0x30'))&&!_0x160f3a['includes'](_0xe598('0x3c'))){var _0x206fc3=_0x160f3a[_0xe598('0x3d')](0x0,_0x160f3a[_0xe598('0x3e')](_0xe598('0x30')));_0x160f3a+=','+_0x206fc3+_0xe598('0x3c');}return _0x160f3a;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x5131b8,_0x57f960){var _0x1fe3ba=_0x5131b8['sort'](function(_0x2f28f9,_0x277739){if(_0x2f28f9[_0xe598('0x38')]===_0x277739[_0xe598('0x38')]){if(_0x2f28f9['globalStatus']===_0xe598('0x13')){if(_0x57f960===_0xe598('0x3a')){return(_0x2f28f9[_0xe598('0x33')]||'')<(_0x277739[_0xe598('0x33')]||'')||_0x2f28f9[_0xe598('0x30')][_0xe598('0x3f')]()>_0x277739[_0xe598('0x30')][_0xe598('0x3f')]()?0x1:-0x1;}else{return(_0x2f28f9[_0xe598('0x33')]||'')<(_0x277739[_0xe598('0x33')]||'')||_0x2f28f9[_0xe598('0x30')][_0xe598('0x3f')]()>_0x277739[_0xe598('0x30')][_0xe598('0x3f')]()?-0x1:0x1;}}else{if(_0x57f960===_0xe598('0x3a')){return _0x2f28f9['fullname'][_0xe598('0x3f')]()<_0x277739[_0xe598('0x30')][_0xe598('0x3f')]()?0x1:-0x1;}else{return _0x2f28f9['fullname'][_0xe598('0x3f')]()<_0x277739[_0xe598('0x30')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x57f960===_0xe598('0x3a')){return _0x2f28f9[_0xe598('0x38')]<_0x277739[_0xe598('0x38')]?0x1:-0x1;}else{return _0x2f28f9[_0xe598('0x38')]<_0x277739[_0xe598('0x38')]?-0x1:0x1;}}});return _0x1fe3ba;}exports[_0xe598('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x377bdc){var _0x2c3e23=['userpic',_0xe598('0x41'),_0xe598('0x42'),_0xe598('0x43'),'pauseType',_0xe598('0x43'),_0xe598('0x3c'),_0xe598('0x44'),_0xe598('0x5'),_0xe598('0x32'),_0xe598('0x31'),_0xe598('0x7'),_0xe598('0x9'),_0xe598('0x6'),_0xe598('0x8'),_0xe598('0x45'),_0xe598('0x46'),_0xe598('0x47'),_0xe598('0x48'),_0xe598('0x49'),_0xe598('0x4a'),'chatCurrentCapacity','openchannelCurrentCapacity',_0xe598('0x4b'),_0xe598('0x4c'),_0xe598('0x4d'),_0xe598('0x4e'),_0xe598('0x14'),_0xe598('0x16'),_0xe598('0x15'),_0xe598('0x17'),'whatsappStatus',_0xe598('0x4f'),_0xe598('0x11'),_0xe598('0x50'),_0xe598('0x51'),_0xe598('0x52'),_0xe598('0x53'),_0xe598('0x54'),_0xe598('0x55'),_0xe598('0x56'),_0xe598('0x57'),_0xe598('0x58'),_0xe598('0x59'),_0xe598('0x5a'),_0xe598('0x5b'),_0xe598('0x5c')];var _0x25015e=[_0xe598('0x5'),'openchannelPause',_0xe598('0x31'),_0xe598('0x7'),'whatsappPause',_0xe598('0x6'),'voicePause',_0xe598('0x41')];var _0x1729e3=_(_0x377bdc)[_0xe598('0x5d')](_0x25015e)[_0xe598('0x5e')](_0x2c3e23)[_0xe598('0x5f')]();return _0x1729e3;}exports[_0xe598('0x60')]=filterAgentAttributes; \ No newline at end of file +var _0x6e64=['chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','voiceStatus','chatStatusTime','mailStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','lodash','jayson/promise','client','http','chatPause','faxPause','voicePause','filter','length','idle','unknown','unavailable','ringing','every','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','pause','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','mailPause','smsPause','whatsappPause','pauseType','merge','globalStatus','getSortedAgentsIdsByStatus','split','order','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','DESC','lastLoginAt','lastPauseAt','address','openchannelPause'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x6e64,0x184));var _0x46e6=function(_0x10901e,_0x50d084){_0x10901e=_0x10901e-0x0;var _0x4eb1f6=_0x6e64[_0x10901e];return _0x4eb1f6;};'use strict';var _=require(_0x46e6('0x0'));var jayson=require(_0x46e6('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x46e6('0x2')][_0x46e6('0x3')]({'port':0x232a});var routingClient=jayson[_0x46e6('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x9a90ea,_0xcb1562){var _0x474f90=[_0x9a90ea[_0x46e6('0x4')],_0x9a90ea[_0x46e6('0x5')],_0x9a90ea['mailPause'],_0x9a90ea['openchannelPause'],_0x9a90ea['smsPause'],_0x9a90ea[_0x46e6('0x6')],_0x9a90ea['whatsappPause']];if(!_0xcb1562)return _['every'](_0x474f90);var _0x5aa091=_[_0x46e6('0x7')](_0x474f90);return _0x5aa091['length']>0x0&&_0x5aa091[_0x46e6('0x8')]<_0x474f90[_0x46e6('0x8')]?!![]:![];}function isIdle(_0x23016f){return _0x23016f===_0x46e6('0x9')||_0x23016f===_0x46e6('0xa')||_0x23016f===_0x46e6('0xb')||_0x23016f===_0x46e6('0xc')||_['isNil'](_0x23016f);}function isAgentIdle(_0x4c82d0){if(_0x4c82d0['voiceStatus']!==_0x46e6('0x9')&&_0x4c82d0['voicePause']){_0x4c82d0['voiceStatus']='pause';return![];}return _[_0x46e6('0xd')]([_0x4c82d0[_0x46e6('0xe')],_0x4c82d0['faxStatus'],_0x4c82d0[_0x46e6('0xf')],_0x4c82d0[_0x46e6('0x10')],_0x4c82d0[_0x46e6('0x11')],_0x4c82d0['voiceStatus'],_0x4c82d0[_0x46e6('0x12')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x46e6('0x13')](_0x46e6('0x14'),{})['then'](function(_0x2b0090){if(_0x2b0090[_0x46e6('0x15')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0xebba0e=_0x2b0090['result'];return routingClient['request'](_0x46e6('0x14'),{})[_0x46e6('0x16')](function(_0x24db4a){if(_0x24db4a[_0x46e6('0x15')]){throw new Error(_0x46e6('0x17'));}var _0x3e0f9c=_0x24db4a[_0x46e6('0x18')];return _['merge']({},_0xebba0e,_0x3e0f9c);});})[_0x46e6('0x19')](function(_0x36f29c){throw _0x36f29c;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x2c0d47){var _0x114858=_0x46e6('0xa');if(isAgentPaused(_0x2c0d47))_0x114858=_0x46e6('0x1a');else if(isAgentPaused(_0x2c0d47,!![]))_0x114858=_0x46e6('0x1b');else if(isAgentIdle(_0x2c0d47))_0x114858=_0x46e6('0x9');else _0x114858=_0x46e6('0x1c');return _0x114858;}exports[_0x46e6('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x527973,_0x16a23b){var _0x5f01af=_[_0x46e6('0x1e')](_0x527973)?_0x527973:[_0x527973];var _0x565780=_['startCase'](_0x16a23b)+_0x46e6('0x1f');var _0x1283dc=_[_0x46e6('0x20')](_0x5f01af,function(_0x1b7155){return db[_0x565780][_0x46e6('0x21')]({'where':{'id':_0x1b7155}})['then'](function(_0x49fdb0){if(!_0x49fdb0)return[];return _0x49fdb0[_0x46e6('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x1283dc)['then'](function(_0x1d7f94){var _0x3c4491=_(_0x1d7f94)['flatten']()[_0x46e6('0x20')]('id')[_0x46e6('0x23')]()[_0x46e6('0x24')]();return _0x3c4491;});}exports[_0x46e6('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x363e8e,_0x573c87,_0x162744){try{if(_0x573c87['length']>0x0){_0x363e8e=_0x363e8e[_0x46e6('0x7')](function(_0x3d1ce8){return _0x573c87[_0x46e6('0x26')](_0x3d1ce8['id']);});}var _0x2e195f=_0x363e8e[_0x46e6('0x7')](function(_0x418409){var _0x3ae317=_0x46e6('0x1c');if(isAgentIdle(_0x418409)){_0x3ae317=_0x46e6('0x9');}return _0x3ae317===_0x162744;});return _[_0x46e6('0x20')](_0x2e195f,'id');}catch(_0x47066e){throw _0x47066e;}}exports[_0x46e6('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x310a69,_0x2ddd23,_0x2b1548){return Promise[_0x46e6('0x28')]()[_0x46e6('0x16')](function(){if(_0x2ddd23[_0x46e6('0x8')]>0x0){_0x310a69=_0x310a69['filter'](function(_0x346c9c){return _0x2ddd23['includes'](_0x346c9c['id']);});}return _0x310a69;})['then'](function(){return db[_0x46e6('0x29')][_0x46e6('0x2a')]({'attributes':['id',_0x46e6('0x2b'),_0x46e6('0x2c'),_0x46e6('0x4'),_0x46e6('0x5'),_0x46e6('0x2d'),'openchannelPause',_0x46e6('0x2e'),_0x46e6('0x6'),_0x46e6('0x2f'),_0x46e6('0x30')],'where':{'id':{'$in':_[_0x46e6('0x20')](_0x310a69,'id')}},'raw':!![]});})[_0x46e6('0x16')](function(_0x3f06d1){return _0x3f06d1[_0x46e6('0x20')](function(_0x30d3d8){var _0x14dfa5=_['find'](_0x310a69,['id',_0x30d3d8['id']]);var _0x312fbb=filterAgentAttributes(_0x14dfa5);_[_0x46e6('0x31')](_0x30d3d8,_0x312fbb);_0x30d3d8[_0x46e6('0x32')]=getAgentStatus(_0x30d3d8);return _0x30d3d8;});})[_0x46e6('0x16')](function(_0x496806){var _0x5e652e=sortAgentsByStatus(_0x496806,_0x2b1548);return _[_0x46e6('0x20')](_0x5e652e,'id');})[_0x46e6('0x19')](function(_0x41c99a){throw _0x41c99a;});}exports[_0x46e6('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x224ced){var _0xf82565={'fields':[],'order':null};var _0x209e46=_0x224ced[_0x46e6('0x34')](',');_0xf82565['fields']=_[_0x46e6('0x7')](_0x209e46,function(_0x3066f4){if(!_0x3066f4['includes'](_0x46e6('0x32'))){return!![];}_0xf82565[_0x46e6('0x35')]=_['startsWith'](_0x3066f4,'-')?'DESC':_0x46e6('0x36');return![];});return _0xf82565;}exports[_0x46e6('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0xe401ec){if(_0xe401ec[_0x46e6('0x26')]('fullname')&&!_0xe401ec['includes'](_0x46e6('0x38'))){var _0xec23e7=_0xe401ec[_0x46e6('0x39')](0x0,_0xe401ec[_0x46e6('0x3a')]('fullname'));_0xe401ec+=','+_0xec23e7+_0x46e6('0x38');}return _0xe401ec;}exports[_0x46e6('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x571331,_0xd558b6){var _0x12d8f3=_0x571331[_0x46e6('0x3c')](function(_0x35815a,_0x19361d){if(_0x35815a[_0x46e6('0x32')]===_0x19361d[_0x46e6('0x32')]){if(_0x35815a[_0x46e6('0x32')]===_0x46e6('0x1a')){if(_0xd558b6==='DESC'){return(_0x35815a[_0x46e6('0x30')]||'')<(_0x19361d['pauseType']||'')||_0x35815a[_0x46e6('0x2c')]['toLowerCase']()>_0x19361d[_0x46e6('0x2c')][_0x46e6('0x3d')]()?0x1:-0x1;}else{return(_0x35815a[_0x46e6('0x30')]||'')<(_0x19361d[_0x46e6('0x30')]||'')||_0x35815a['fullname'][_0x46e6('0x3d')]()>_0x19361d['fullname'][_0x46e6('0x3d')]()?-0x1:0x1;}}else{if(_0xd558b6===_0x46e6('0x3e')){return _0x35815a[_0x46e6('0x2c')]['toLowerCase']()<_0x19361d[_0x46e6('0x2c')][_0x46e6('0x3d')]()?0x1:-0x1;}else{return _0x35815a[_0x46e6('0x2c')][_0x46e6('0x3d')]()<_0x19361d[_0x46e6('0x2c')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0xd558b6===_0x46e6('0x3e')){return _0x35815a[_0x46e6('0x32')]<_0x19361d[_0x46e6('0x32')]?0x1:-0x1;}else{return _0x35815a[_0x46e6('0x32')]<_0x19361d[_0x46e6('0x32')]?-0x1:0x1;}}});return _0x12d8f3;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x2a10c2){var _0x1fdbe9=['userpic','online',_0x46e6('0x3f'),_0x46e6('0x40'),_0x46e6('0x30'),'lastPauseAt',_0x46e6('0x38'),_0x46e6('0x41'),_0x46e6('0x4'),_0x46e6('0x42'),_0x46e6('0x2d'),_0x46e6('0x2e'),'whatsappPause','faxPause',_0x46e6('0x6'),_0x46e6('0x43'),'openchannelCapacity',_0x46e6('0x44'),_0x46e6('0x45'),_0x46e6('0x46'),_0x46e6('0x47'),_0x46e6('0x48'),_0x46e6('0x49'),_0x46e6('0x4a'),_0x46e6('0x4b'),_0x46e6('0x4c'),_0x46e6('0x4d'),_0x46e6('0xe'),_0x46e6('0x10'),_0x46e6('0xf'),_0x46e6('0x11'),_0x46e6('0x12'),_0x46e6('0x4e'),_0x46e6('0x4f'),_0x46e6('0x50'),'openchannelStatusTime',_0x46e6('0x51'),'smsStatusTime','whatsappStatusTime',_0x46e6('0x52'),'voiceStatusTime',_0x46e6('0x53'),_0x46e6('0x54'),'screenrecording',_0x46e6('0x55'),_0x46e6('0x56'),_0x46e6('0x57')];var _0x3859ac=['chatPause',_0x46e6('0x42'),_0x46e6('0x2d'),_0x46e6('0x2e'),_0x46e6('0x2f'),_0x46e6('0x5'),_0x46e6('0x6'),_0x46e6('0x58')];var _0x2ccf11=_(_0x2a10c2)[_0x46e6('0x59')](_0x3859ac)[_0x46e6('0x5a')](_0x1fdbe9)[_0x46e6('0x24')]();return _0x2ccf11;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index e09dd10..cda3b46 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22ad=['talking','unknown','pTalking','originated','message','statusMessage','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','request','startCase','Queues','then','catch','getRealtimeQueues','inbound','map','get','busy','outbound','pick','initializeQueues','lodash','client','http','available','paused','waiting','inUse','invalid','ringing'];(function(_0x47a8ff,_0x3ecdb1){var _0x1d02a7=function(_0x5b205b){while(--_0x5b205b){_0x47a8ff['push'](_0x47a8ff['shift']());}};_0x1d02a7(++_0x3ecdb1);}(_0x22ad,0x7b));var _0xd22a=function(_0x4147,_0x29c1ef){_0x4147=_0x4147-0x0;var _0x188606=_0x22ad[_0x4147];return _0x188606;};'use strict';var _=require(_0xd22a('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0xd22a('0x1')][_0xd22a('0x2')]({'port':0x232a});var routingClient=jayson[_0xd22a('0x1')][_0xd22a('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd22a('0x3'),'loggedIn',_0xd22a('0x4'),_0xd22a('0x5')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xd22a('0x6'),_0xd22a('0x7'),'loggedInDb','notInUse','onHold',_0xd22a('0x8'),'ringInUse',_0xd22a('0x9'),'unavailable',_0xd22a('0xa')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xd22a('0xb'),_0xd22a('0xc'),_0xd22a('0xd'),_0xd22a('0xe'),_0xd22a('0xf'),'dialMethod',_0xd22a('0x10'),_0xd22a('0x11'),_0xd22a('0x12'),_0xd22a('0x13'),_0xd22a('0x14'),_0xd22a('0x15'),_0xd22a('0x16'),'dialPredictiveInterval',_0xd22a('0x17'),_0xd22a('0x18'),_0xd22a('0x19'),'predictiveIntervalTotalCalls',_0xd22a('0x1a'),_0xd22a('0x1b'),_0xd22a('0x1c'),_0xd22a('0x1d'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x568e8b,_0xc36556){var _0x4bb864=_0xc36556===_0xd22a('0x1e')?amiClient:routingClient;return _0x4bb864[_0xd22a('0x1f')](_[_0xd22a('0x20')](_0xc36556)+_0xd22a('0x21'),_0x568e8b)[_0xd22a('0x22')](function(_0x406546){if(_0x406546['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xc36556));return _0x406546['result'];})[_0xd22a('0x23')](function(_0xa6b0e3){throw _0xa6b0e3;});}exports[_0xd22a('0x24')]=getRealtimeQueues;function initializeQueues(_0x4df3fb,_0x24dae4,_0x361724,_0x3ad12d){var _0x2d95d3=DEFAULT_QUEUE_ATTRIBUTES;if(_0x361724===_0xd22a('0x1e')){if(_0x3ad12d===_0xd22a('0x25')){_0x2d95d3=_0x2d95d3['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3ad12d==='outbound'){_0x2d95d3=_0x2d95d3['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4df3fb[_0xd22a('0x26')](function(_0x59b4fa){var _0x5d2f3=_0x59b4fa[_0xd22a('0x27')]({'plain':!![]});_0x5d2f3['paused']=0x0;_0x5d2f3['loggedInDb']=0x0;_0x5d2f3['loggedIn']=0x0;_0x5d2f3['available']=0x0;_0x5d2f3[_0xd22a('0x5')]=0x0;if(_0x361724===_0xd22a('0x1e')){_0x5d2f3[_0xd22a('0x9')]=0x0;_0x5d2f3[_0xd22a('0x28')]=0x0;if(_0x3ad12d===_0xd22a('0x29')){_0x5d2f3['pTalking']=0x0;_0x5d2f3['originated']=0x0;}}var _0x24c132=_['find'](_0x24dae4,['id',_0x5d2f3['id']]);if(_0x24c132){_['merge'](_0x5d2f3,_[_0xd22a('0x2a')](_0x24c132,_0x2d95d3));}return _0x5d2f3;});}exports[_0xd22a('0x2b')]=initializeQueues; \ No newline at end of file +var _0x9d89=['voice','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','paused','outbound','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime'];(function(_0xa1f3d9,_0x2a0fa4){var _0x5dcb0a=function(_0x52c7dd){while(--_0x52c7dd){_0xa1f3d9['push'](_0xa1f3d9['shift']());}};_0x5dcb0a(++_0x2a0fa4);}(_0x9d89,0x10b));var _0x99d8=function(_0x2fc8c0,_0x58163a){_0x2fc8c0=_0x2fc8c0-0x0;var _0x29041b=_0x9d89[_0x2fc8c0];return _0x29041b;};'use strict';var _=require(_0x99d8('0x0'));var jayson=require(_0x99d8('0x1'));var util=require(_0x99d8('0x2'));var amiClient=jayson[_0x99d8('0x3')][_0x99d8('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x99d8('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x99d8('0x5'),_0x99d8('0x6'),'paused',_0x99d8('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x99d8('0x8'),_0x99d8('0x9'),_0x99d8('0xa'),_0x99d8('0xb'),_0x99d8('0xc'),_0x99d8('0xd'),'ringing',_0x99d8('0xe'),_0x99d8('0xf'),_0x99d8('0x10'),_0x99d8('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x99d8('0x12'),_0x99d8('0x13'),'message',_0x99d8('0x14'),'dialActive',_0x99d8('0x15'),_0x99d8('0x16'),_0x99d8('0x17'),'startProgressive',_0x99d8('0x18'),_0x99d8('0x19'),_0x99d8('0x1a'),'erlangBusyFactor',_0x99d8('0x1b'),_0x99d8('0x1c'),_0x99d8('0x1d'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x99d8('0x1e'),'predictiveIntervalDroppedCallsTimeout',_0x99d8('0x1f'),_0x99d8('0x20'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x120e52,_0x52a1de){var _0x5411af=_0x52a1de===_0x99d8('0x21')?amiClient:routingClient;return _0x5411af[_0x99d8('0x22')](_[_0x99d8('0x23')](_0x52a1de)+_0x99d8('0x24'),_0x120e52)['then'](function(_0x163943){if(_0x163943[_0x99d8('0x25')])throw new Error(util[_0x99d8('0x26')](_0x99d8('0x27'),_0x52a1de));return _0x163943[_0x99d8('0x28')];})['catch'](function(_0x3fdfa8){throw _0x3fdfa8;});}exports[_0x99d8('0x29')]=getRealtimeQueues;function initializeQueues(_0x9fee35,_0x3e1259,_0x5b9575,_0x2bf994){var _0x5c8479=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5b9575==='voice'){if(_0x2bf994===_0x99d8('0x2a')){_0x5c8479=_0x5c8479['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2bf994==='outbound'){_0x5c8479=_0x5c8479[_0x99d8('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x9fee35['map'](function(_0x25080c){var _0x4eaaf7=_0x25080c['get']({'plain':!![]});_0x4eaaf7[_0x99d8('0x2c')]=0x0;_0x4eaaf7[_0x99d8('0xb')]=0x0;_0x4eaaf7[_0x99d8('0x6')]=0x0;_0x4eaaf7['available']=0x0;_0x4eaaf7[_0x99d8('0x7')]=0x0;if(_0x5b9575==='voice'){_0x4eaaf7[_0x99d8('0xf')]=0x0;_0x4eaaf7[_0x99d8('0x8')]=0x0;if(_0x2bf994===_0x99d8('0x2d')){_0x4eaaf7['pTalking']=0x0;_0x4eaaf7[_0x99d8('0x13')]=0x0;}}var _0x399c60=_[_0x99d8('0x2e')](_0x3e1259,['id',_0x4eaaf7['id']]);if(_0x399c60){_[_0x99d8('0x2f')](_0x4eaaf7,_[_0x99d8('0x30')](_0x399c60,_0x5c8479));}return _0x4eaaf7;});}exports[_0x99d8('0x31')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a9e8c29..473ffd0 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x585e84,_0x1d8489){var _0x39f3c4=function(_0x1855a3){while(--_0x1855a3){_0x585e84['push'](_0x585e84['shift']());}};_0x39f3c4(++_0x1d8489);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x599aaf,_0x3d3622){var _0xd995f3=function(_0x19825e){while(--_0x19825e){_0x599aaf['push'](_0x599aaf['shift']());}};_0xd995f3(++_0x3d3622);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index d149709..a330ebf 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa784=['dmidecode\x20--string\x20system-uuid','hostname','macAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','keys','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','md5','update','digest','hex','getUuid','platform','licenseToken'];(function(_0x5046f0,_0x143f3c){var _0x423c81=function(_0xb2bc31){while(--_0xb2bc31){_0x5046f0['push'](_0x5046f0['shift']());}};_0x423c81(++_0x143f3c);}(_0xa784,0x115));var _0x4a78=function(_0x4426fa,_0x4affcf){_0x4426fa=_0x4426fa-0x0;var _0x3f6280=_0xa784[_0x4426fa];return _0x3f6280;};'use strict';var _=require(_0x4a78('0x0'));var os=require('os');var crypto=require(_0x4a78('0x1'));var machine=require(_0x4a78('0x2'));var exec=require('child_process')[_0x4a78('0x3')];var config=require(_0x4a78('0x4'));function getInterfaces(){var _0x5aae79=[];var _0x2e8abd=os[_0x4a78('0x5')]();var _0x47fd05=_['orderBy'](_[_0x4a78('0x6')](_0x2e8abd));for(var _0x40405e=0x0;_0x40405e<_0x47fd05['length'];_0x40405e++){var _0x5bc533=_0x2e8abd[_0x47fd05[_0x40405e]][_0x4a78('0x7')](function(_0x63324){return _0x63324[_0x4a78('0x8')]===_0x4a78('0x9')&&_0x63324[_0x4a78('0xa')]===![];});_0x5aae79=_0x5aae79[_0x4a78('0xb')](_0x5bc533);}return _0x5aae79;}function getFirstInterface(){var _0x522cd=_[_0x4a78('0xc')](getInterfaces());return{'macAddress':_0x522cd&&_0x522cd['mac']?_0x522cd[_0x4a78('0xd')]:_0x4a78('0xe'),'ipAddress':_0x522cd&&_0x522cd[_0x4a78('0xf')]?_0x522cd['address']:'127.0.0.1'};}exports[_0x4a78('0x10')]=getFirstInterface;function getCPUhash(){var _0x781bf3=_[_0x4a78('0x11')](os[_0x4a78('0x12')]()[_0x4a78('0x13')](function(_0x5e5c91){return _0x5e5c91[_0x4a78('0x14')];}))[_0x4a78('0x15')](':');return crypto['createHash'](_0x4a78('0x16'))[_0x4a78('0x17')](_0x781bf3)[_0x4a78('0x18')](_0x4a78('0x19'));}exports[_0x4a78('0x1a')]=function(){var _0x1b1180=os[_0x4a78('0x1b')]();var _0xe8e712=/[0-9a-f-]{36}/;if(config[_0x4a78('0x1c')]&&_0xe8e712['test'](config['licenseToken'])){return config['licenseToken'];}else if(_0x1b1180==='win32'){return exec(_0x4a78('0x1d'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x396331=getFirstInterface();var _0x41b774=getCPUhash();var _0x5579a4=_0x41b774+'|'+os[_0x4a78('0x1e')]()+'|'+_0x396331[_0x4a78('0x1f')]+'|'+_0x396331['ipAddress'];var _0x14a6e4=crypto[_0x4a78('0x20')](_0x4a78('0x16'))['update'](_0x5579a4)[_0x4a78('0x18')](_0x4a78('0x19'));return _0x14a6e4['substring'](0x0,0x8)+'-'+_0x14a6e4[_0x4a78('0x21')](0x8,0xc)+'-'+_0x14a6e4['substring'](0xc,0x10)+'-'+_0x14a6e4[_0x4a78('0x21')](0x10,0x14)+'-'+_0x14a6e4['substring'](0x14);}}; \ No newline at end of file +var _0x2468=['macAddress','ipAddress','createHash','md5','update','digest','substring','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','filter','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','hex','getUuid','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','hostname'];(function(_0x1b5f64,_0x13e900){var _0x1a249e=function(_0x4d829b){while(--_0x4d829b){_0x1b5f64['push'](_0x1b5f64['shift']());}};_0x1a249e(++_0x13e900);}(_0x2468,0x1d7));var _0x8246=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x2468[_0x934425];return _0x31d596;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x8246('0x0'));var exec=require(_0x8246('0x1'))['execSync'];var config=require(_0x8246('0x2'));function getInterfaces(){var _0xed3e12=[];var _0x28f3fb=os[_0x8246('0x3')]();var _0x150739=_[_0x8246('0x4')](_['keys'](_0x28f3fb));for(var _0x37fb69=0x0;_0x37fb69<_0x150739['length'];_0x37fb69++){var _0x57db16=_0x28f3fb[_0x150739[_0x37fb69]][_0x8246('0x5')](function(_0x1871d7){return _0x1871d7['family']==='IPv4'&&_0x1871d7['internal']===![];});_0xed3e12=_0xed3e12[_0x8246('0x6')](_0x57db16);}return _0xed3e12;}function getFirstInterface(){var _0x1b61f0=_[_0x8246('0x7')](getInterfaces());return{'macAddress':_0x1b61f0&&_0x1b61f0[_0x8246('0x8')]?_0x1b61f0['mac']:_0x8246('0x9'),'ipAddress':_0x1b61f0&&_0x1b61f0['address']?_0x1b61f0[_0x8246('0xa')]:_0x8246('0xb')};}exports[_0x8246('0xc')]=getFirstInterface;function getCPUhash(){var _0x26c47=_[_0x8246('0x4')](os['cpus']()[_0x8246('0xd')](function(_0x51a7a1){return _0x51a7a1['model'];}))[_0x8246('0xe')](':');return crypto['createHash']('md5')['update'](_0x26c47)['digest'](_0x8246('0xf'));}exports[_0x8246('0x10')]=function(){var _0x4c9b37=os[_0x8246('0x11')]();var _0x54fc6f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x54fc6f[_0x8246('0x12')](config[_0x8246('0x13')])){return config[_0x8246('0x13')];}else if(_0x4c9b37==='win32'){return exec(_0x8246('0x14'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x59cb48=getFirstInterface();var _0x24b496=getCPUhash();var _0x427073=_0x24b496+'|'+os[_0x8246('0x15')]()+'|'+_0x59cb48[_0x8246('0x16')]+'|'+_0x59cb48[_0x8246('0x17')];var _0x347034=crypto[_0x8246('0x18')](_0x8246('0x19'))[_0x8246('0x1a')](_0x427073)[_0x8246('0x1b')](_0x8246('0xf'));return _0x347034[_0x8246('0x1c')](0x0,0x8)+'-'+_0x347034[_0x8246('0x1c')](0x8,0xc)+'-'+_0x347034[_0x8246('0x1c')](0xc,0x10)+'-'+_0x347034[_0x8246('0x1c')](0x10,0x14)+'-'+_0x347034['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index ce612b6..c5d4259 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb06d=['util','bluebird','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default'];(function(_0x4c8a33,_0x1aef86){var _0xc2224c=function(_0x5f049a){while(--_0x5f049a){_0x4c8a33['push'](_0x4c8a33['shift']());}};_0xc2224c(++_0x1aef86);}(_0xb06d,0x1ee));var _0xdb06=function(_0x39ee89,_0x249960){_0x39ee89=_0x39ee89-0x0;var _0x2065ec=_0xb06d[_0x39ee89];return _0x2065ec;};'use strict';var util=require(_0xdb06('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0xdb06('0x1'));var pkginfo=require('pkginfo')(module,_0xdb06('0x2'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xdb06('0x3'));var hardware=require(_0xdb06('0x4'));var logger=require(_0xdb06('0x5'))('license');var HOST=_0xdb06('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xc77c48){return new BPromise(function(_0x25a767,_0x5264cd){var _0xa0bc05=util[_0xdb06('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0xc77c48,module[_0xdb06('0x8')][_0xdb06('0x2')]);if(oldToken){_0xa0bc05=util[_0xdb06('0x7')](_0xdb06('0x9'),HOST,_0xc77c48,module['exports'][_0xdb06('0x2')],oldToken);}var _0xe585dd={'uri':_0xa0bc05,'method':_0xdb06('0xa'),'timeout':0xea60,'json':!![]};return rp(_0xe585dd)['then'](function(_0x8d7c00){_0x25a767(_0x8d7c00);})[_0xdb06('0xb')](function(_0x4b6138){_0x5264cd(_0x4b6138);});});}function manageLicense(_0x4c00ae,_0x45072c){var _0x314b62=_0x45072c[_0xdb06('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x314b62[_0xdb06('0xd')]!==_0x4c00ae&&!_0x314b62[_0xdb06('0xe')]){oldToken=_0x314b62['data1'];}httpRequest(_0x4c00ae)[_0xdb06('0xf')](function(_0x3651f1){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3651f1[_0xdb06('0x10')]){isOldTokenSent=![];if(!_0x314b62[_0xdb06('0x11')]&&_0x314b62['license']!=_0x3651f1[_0xdb06('0x11')]||_0x314b62[_0xdb06('0x11')]&&_0x314b62['data2']){logger[_0xdb06('0x12')](_0xdb06('0x13'));}if(_0x314b62['license']&&!_0x314b62[_0xdb06('0xe')]&&_0x314b62[_0xdb06('0x11')]!=_0x3651f1[_0xdb06('0x11')]){logger[_0xdb06('0x12')](_0xdb06('0x14'));}if(_0x314b62[_0xdb06('0x11')]&&!_0x314b62[_0xdb06('0xe')]&&_0x314b62[_0xdb06('0x11')]==_0x3651f1[_0xdb06('0x11')]){return _0x45072c;}return _0x45072c[_0xdb06('0x15')]({'data1':_0x4c00ae,'data2':null,'license':_0x3651f1['license']});}else{if(_0x3651f1[_0xdb06('0x11')]||_0x314b62[_0xdb06('0x11')]){if(!_0x314b62[_0xdb06('0xe')]){if(_0x314b62[_0xdb06('0xd')]==_0x4c00ae){GRAY_PERIOD_REASON=_0xdb06('0x16');logger[_0xdb06('0x12')](_0xdb06('0x17'));}else{GRAY_PERIOD_REASON=_0xdb06('0x18');logger[_0xdb06('0x12')](_0xdb06('0x19'),_0x314b62[_0xdb06('0xd')],_0x4c00ae);}logger[_0xdb06('0x12')](_0xdb06('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xdb06('0x7')]('YYYY-MM-DD\x20HH:mm'));return _0x45072c[_0xdb06('0x15')]({'data2':encryptor['encryptString'](moment()[_0xdb06('0x7')](_0xdb06('0x1b')))});}else{if(moment()[_0xdb06('0x1c')](encryptor[_0xdb06('0x1d')](_0x314b62[_0xdb06('0xe')]),'days')>DAYS){logger[_0xdb06('0x12')](_0xdb06('0x1e'),moment()[_0xdb06('0x7')](_0xdb06('0x1b')));isOldTokenSent=![];return _0x45072c[_0xdb06('0x15')]({'data1':_0x4c00ae,'data2':null,'license':null});}}}else{if(_0x314b62[_0xdb06('0xd')]!=_0x4c00ae){logger['info'](_0xdb06('0x19'),_0x314b62[_0xdb06('0xd')],_0x4c00ae);return _0x45072c[_0xdb06('0x15')]({'data1':_0x4c00ae,'data2':null,'license':null});}}}return _0x45072c;})[_0xdb06('0xf')](function(_0xddfc14){_0x45072c=_0xddfc14;})[_0xdb06('0xb')](function(_0xad8581){logger[_0xdb06('0x1f')](_0xad8581[_0xdb06('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x45072c);},TIME);});}function defaultLicense(){var _0x3789a0=hardware[_0xdb06('0x21')]();if(_0x3789a0){return db['License'][_0xdb06('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x3789a0}})[_0xdb06('0x23')](function(_0x5ce167,_0x1254ff){logger[_0xdb06('0x12')](_0xdb06('0x24'),_0x3789a0);manageLicense(_0x3789a0,_0x5ce167);})['catch'](function(_0x106e19){logger[_0xdb06('0x1f')](_0x106e19[_0xdb06('0x20')]);});}}exports[_0xdb06('0x25')]=defaultLicense; \ No newline at end of file +var _0xd91b=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','catch','get','data1','then','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','info','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message'];(function(_0x5c22aa,_0x47d389){var _0x4d9a6f=function(_0x41b02d){while(--_0x41b02d){_0x5c22aa['push'](_0x5c22aa['shift']());}};_0x4d9a6f(++_0x47d389);}(_0xd91b,0x125));var _0xbd91=function(_0x4b9530,_0x11a96e){_0x4b9530=_0x4b9530-0x0;var _0x2dc41a=_0xd91b[_0x4b9530];return _0x2dc41a;};'use strict';var util=require(_0xbd91('0x0'));var moment=require(_0xbd91('0x1'));var rp=require(_0xbd91('0x2'));var BPromise=require(_0xbd91('0x3'));var pkginfo=require(_0xbd91('0x4'))(module,_0xbd91('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xbd91('0x6'));var hardware=require(_0xbd91('0x7'));var logger=require(_0xbd91('0x8'))('license');var HOST=_0xbd91('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xf100bf){return new BPromise(function(_0x1aeaf4,_0x19437b){var _0x41338e=util[_0xbd91('0xa')](_0xbd91('0xb'),HOST,_0xf100bf,module[_0xbd91('0xc')][_0xbd91('0x5')]);if(oldToken){_0x41338e=util[_0xbd91('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0xf100bf,module['exports']['version'],oldToken);}var _0x675a04={'uri':_0x41338e,'method':_0xbd91('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x675a04)['then'](function(_0x12171b){_0x1aeaf4(_0x12171b);})[_0xbd91('0xe')](function(_0x1e2651){_0x19437b(_0x1e2651);});});}function manageLicense(_0x3f0771,_0x55be74){var _0x1637ca=_0x55be74[_0xbd91('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1637ca[_0xbd91('0x10')]!==_0x3f0771&&!_0x1637ca['data2']){oldToken=_0x1637ca[_0xbd91('0x10')];}httpRequest(_0x3f0771)[_0xbd91('0x11')](function(_0x399ee8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x399ee8['active']){isOldTokenSent=![];if(!_0x1637ca[_0xbd91('0x12')]&&_0x1637ca[_0xbd91('0x12')]!=_0x399ee8[_0xbd91('0x12')]||_0x1637ca[_0xbd91('0x12')]&&_0x1637ca[_0xbd91('0x13')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x1637ca[_0xbd91('0x12')]&&!_0x1637ca[_0xbd91('0x13')]&&_0x1637ca['license']!=_0x399ee8[_0xbd91('0x12')]){logger['info'](_0xbd91('0x14'));}if(_0x1637ca[_0xbd91('0x12')]&&!_0x1637ca[_0xbd91('0x13')]&&_0x1637ca['license']==_0x399ee8['license']){return _0x55be74;}return _0x55be74[_0xbd91('0x15')]({'data1':_0x3f0771,'data2':null,'license':_0x399ee8[_0xbd91('0x12')]});}else{if(_0x399ee8[_0xbd91('0x12')]||_0x1637ca[_0xbd91('0x12')]){if(!_0x1637ca[_0xbd91('0x13')]){if(_0x1637ca[_0xbd91('0x10')]==_0x3f0771){GRAY_PERIOD_REASON=_0xbd91('0x16');logger['info'](_0xbd91('0x17'));}else{GRAY_PERIOD_REASON=_0xbd91('0x18');logger[_0xbd91('0x19')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1637ca[_0xbd91('0x10')],_0x3f0771);}logger[_0xbd91('0x19')](_0xbd91('0x1a'),GRAY_PERIOD_REASON[_0xbd91('0x1b')](),moment()['format'](_0xbd91('0x1c')));return _0x55be74['update']({'data2':encryptor[_0xbd91('0x1d')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xbd91('0x1e')](encryptor['decryptString'](_0x1637ca[_0xbd91('0x13')]),_0xbd91('0x1f'))>DAYS){logger['info'](_0xbd91('0x20'),moment()['format'](_0xbd91('0x1c')));isOldTokenSent=![];return _0x55be74[_0xbd91('0x15')]({'data1':_0x3f0771,'data2':null,'license':null});}}}else{if(_0x1637ca[_0xbd91('0x10')]!=_0x3f0771){logger[_0xbd91('0x19')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1637ca[_0xbd91('0x10')],_0x3f0771);return _0x55be74[_0xbd91('0x15')]({'data1':_0x3f0771,'data2':null,'license':null});}}}return _0x55be74;})['then'](function(_0x1a053a){_0x55be74=_0x1a053a;})[_0xbd91('0xe')](function(_0x5e8d55){logger[_0xbd91('0x21')](_0x5e8d55[_0xbd91('0x22')]);})[_0xbd91('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xbd91('0x24')](),_0x55be74);},TIME);});}function defaultLicense(){var _0x4216fc=hardware['getUuid']();if(_0x4216fc){return db[_0xbd91('0x25')][_0xbd91('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x4216fc}})[_0xbd91('0x27')](function(_0x2e72c4,_0x24ed7e){logger[_0xbd91('0x19')](_0xbd91('0x28'),_0x4216fc);manageLicense(_0x4216fc,_0x2e72c4);})['catch'](function(_0x5823bd){logger[_0xbd91('0x21')](_0x5823bd[_0xbd91('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 8b1a750..37eed80 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f1b=['telephone','users','telephones','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','machineUuid','gray','add','days','grayReason','changed','disabled','message','User','role','sequelize','col','count','user'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x4f1b,0xe9));var _0xb4f1=function(_0x36e4c3,_0x14142c){_0x36e4c3=_0x36e4c3-0x0;var _0x493260=_0x4f1b[_0x36e4c3];return _0x493260;};'use strict';var util=require(_0xb4f1('0x0'));var _=require('lodash');var moment=require(_0xb4f1('0x1'));var BPromise=require(_0xb4f1('0x2'));var hardware=require('./hardware');var encryptor=require(_0xb4f1('0x3'));var db=require(_0xb4f1('0x4'))['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':_0xb4f1('0x5'),'machineUuid':hardware[_0xb4f1('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb4f1('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb4f1('0x8'),'machineUuid':hardware[_0xb4f1('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x172880){return new BPromise(function(_0x38f444,_0x553c30){return db['License'][_0xb4f1('0x9')](_[_0xb4f1('0xa')](_0x172880,{'raw':!![],'where':{'id':0x1}}))[_0xb4f1('0xb')](function(_0xf386d7){return checkLicense(_0xf386d7,null);})[_0xb4f1('0xb')](function(_0x4b7e3d){_0x38f444(_0x4b7e3d);return;})[_0xb4f1('0xc')](function(_0x598530){_0x553c30(_0x598530);});});}function checkLicense(_0x49469f,_0x429cc1){if(!_0x49469f){demoLicense[_0xb4f1('0xd')]=_0x49469f[_0xb4f1('0xe')];return demoLicense;}try{var _0xa88690=_0x429cc1||_0x49469f[_0xb4f1('0xf')];if(_[_0xb4f1('0x10')](_0xa88690)){throw new Error(_0xb4f1('0x11'));}var _0x151f7f=_0x49469f[_0xb4f1('0xe')];var _0x529ccf=_0x49469f[_0xb4f1('0x12')];var _0x4474a8=_0x151f7f[_0xb4f1('0x13')]('-')[0x4];var _0x3593c5=_0x151f7f[_0xb4f1('0x13')]('-')[0x0];var _0x43a8a0=encryptor[_0xb4f1('0x14')](_0xa88690,util[_0xb4f1('0x15')]('%s:%s:%s',_0x4474a8,_0x151f7f,_0x3593c5));var _0x1ff8d0=JSON[_0xb4f1('0x16')](_0x43a8a0);_0x1ff8d0['demo']=![];_0x1ff8d0[_0xb4f1('0xd')]=_0x151f7f;_0x1ff8d0[_0xb4f1('0x17')]=hardware['getUuid']();if(_0x529ccf){var _0x3d6f08=encryptor[_0xb4f1('0x14')](_0x529ccf);_0x1ff8d0[_0xb4f1('0x18')]=_0x3d6f08;_0x1ff8d0['deadline']=moment(_0x3d6f08)[_0xb4f1('0x19')](0x7,_0xb4f1('0x1a'))['format']();_0x1ff8d0[_0xb4f1('0x1b')]=_0x1ff8d0[_0xb4f1('0xd')]!=_0x1ff8d0[_0xb4f1('0x17')]?_0xb4f1('0x1c'):_0xb4f1('0x1d');}return _0x1ff8d0;}catch(_0xd4bf17){breakingLicense[_0xb4f1('0xd')]=_0x49469f['data1'];breakingLicense[_0xb4f1('0x1e')]=_0xd4bf17[_0xb4f1('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4bd593,_0x52eec6){getLicense()[_0xb4f1('0xb')](function(_0x130038){return db[_0xb4f1('0x1f')]['findAll']({'attributes':[_0xb4f1('0x20'),[db[_0xb4f1('0x21')]['fn']('COUNT',db[_0xb4f1('0x21')][_0xb4f1('0x22')](_0xb4f1('0x20'))),_0xb4f1('0x23')]],'group':_0xb4f1('0x20'),'where':{'role':{'$or':['admin',_0xb4f1('0x24'),_0xb4f1('0x25')]}},'raw':!![]})[_0xb4f1('0xb')](function(_0x5c6f09){var _0xc5ed97={'user':_0x130038[_0xb4f1('0x26')]||0x0,'telephone':_0x130038[_0xb4f1('0x27')]||0x0};_0x5c6f09['forEach'](function(_0x1993b3){var _0x2c5ed5=_0x1993b3[_0xb4f1('0x20')]===_0xb4f1('0x28')?_0xb4f1('0x24'):_0x1993b3[_0xb4f1('0x20')];_0xc5ed97[_0x2c5ed5]-=_0x1993b3[_0xb4f1('0x23')];if(_0xc5ed97[_0x2c5ed5]<0x0)_0xc5ed97[_0x2c5ed5]=0x0;});_0x4bd593(_0xc5ed97);return;});})[_0xb4f1('0xc')](function(_0x41c12b){_0x52eec6(_0x41c12b);});});}function checkUserLimits(_0x7f60cc){return new BPromise(function(_0x532aa7,_0x3d81dc){getLimits()[_0xb4f1('0xb')](function(_0x2c5558){var _0x4d759a=_[_0xb4f1('0x29')](_[_0xb4f1('0x2a')](_0x7f60cc,_0xb4f1('0x20')),[_0xb4f1('0x28'),_0xb4f1('0x24'),_0xb4f1('0x25')]);var _0x38a448=(_0x4d759a[_0xb4f1('0x28')]||0x0)+(_0x4d759a[_0xb4f1('0x24')]||0x0);var _0x355901=_0x4d759a['telephone']||0x0;if(_0x38a448>_0x2c5558[_0xb4f1('0x24')])return _0x3d81dc(_0xb4f1('0x2b'));if(_0x355901>_0x2c5558[_0xb4f1('0x25')])return _0x3d81dc(_0xb4f1('0x2c'));return _0x532aa7();})[_0xb4f1('0xc')](function(_0x541545){_0x3d81dc(_0x541545);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xf447=['add','grayReason','uuid','changed','disabled','User','role','sequelize','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','License','find','defaults','then','catch','license','isEmpty','data1','split','format','parse','demo','machineUuid','decryptString','gray','deadline'];(function(_0x22efd6,_0x1e9599){var _0x442a6a=function(_0x53d328){while(--_0x53d328){_0x22efd6['push'](_0x22efd6['shift']());}};_0x442a6a(++_0x1e9599);}(_0xf447,0x69));var _0x7f44=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xf447[_0xfa634c];return _0x73e478;};'use strict';var util=require('util');var _=require(_0x7f44('0x0'));var moment=require(_0x7f44('0x1'));var BPromise=require('bluebird');var hardware=require(_0x7f44('0x2'));var encryptor=require(_0x7f44('0x3'));var db=require(_0x7f44('0x4'))['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':_0x7f44('0x5'),'machineUuid':hardware[_0x7f44('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7f44('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x7f44('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x20482f){return new BPromise(function(_0x3f6827,_0x55f21e){return db[_0x7f44('0x8')][_0x7f44('0x9')](_[_0x7f44('0xa')](_0x20482f,{'raw':!![],'where':{'id':0x1}}))[_0x7f44('0xb')](function(_0x3eb9aa){return checkLicense(_0x3eb9aa,null);})[_0x7f44('0xb')](function(_0x504f8b){_0x3f6827(_0x504f8b);return;})[_0x7f44('0xc')](function(_0x4fcb9f){_0x55f21e(_0x4fcb9f);});});}function checkLicense(_0x5b9dda,_0x3295ae){if(!_0x5b9dda){demoLicense['uuid']=_0x5b9dda['data1'];return demoLicense;}try{var _0x3a69d6=_0x3295ae||_0x5b9dda[_0x7f44('0xd')];if(_[_0x7f44('0xe')](_0x3a69d6)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x40ca33=_0x5b9dda[_0x7f44('0xf')];var _0x405a68=_0x5b9dda['data2'];var _0x4d15ef=_0x40ca33[_0x7f44('0x10')]('-')[0x4];var _0x23aef4=_0x40ca33[_0x7f44('0x10')]('-')[0x0];var _0x21a001=encryptor['decryptString'](_0x3a69d6,util[_0x7f44('0x11')]('%s:%s:%s',_0x4d15ef,_0x40ca33,_0x23aef4));var _0x749886=JSON[_0x7f44('0x12')](_0x21a001);_0x749886[_0x7f44('0x13')]=![];_0x749886['uuid']=_0x40ca33;_0x749886[_0x7f44('0x14')]=hardware['getUuid']();if(_0x405a68){var _0x1484f3=encryptor[_0x7f44('0x15')](_0x405a68);_0x749886[_0x7f44('0x16')]=_0x1484f3;_0x749886[_0x7f44('0x17')]=moment(_0x1484f3)[_0x7f44('0x18')](0x7,'days')['format']();_0x749886[_0x7f44('0x19')]=_0x749886[_0x7f44('0x1a')]!=_0x749886['machineUuid']?_0x7f44('0x1b'):_0x7f44('0x1c');}return _0x749886;}catch(_0x5f37f3){breakingLicense[_0x7f44('0x1a')]=_0x5b9dda[_0x7f44('0xf')];breakingLicense['message']=_0x5f37f3['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x558bb1,_0x4b2ca8){getLicense()['then'](function(_0x264de6){return db[_0x7f44('0x1d')]['findAll']({'attributes':[_0x7f44('0x1e'),[db[_0x7f44('0x1f')]['fn']('COUNT',db[_0x7f44('0x1f')]['col'](_0x7f44('0x1e'))),_0x7f44('0x20')]],'group':_0x7f44('0x1e'),'where':{'role':{'$or':[_0x7f44('0x21'),'user',_0x7f44('0x22')]}},'raw':!![]})['then'](function(_0x49b534){var _0x31dc59={'user':_0x264de6[_0x7f44('0x23')]||0x0,'telephone':_0x264de6[_0x7f44('0x24')]||0x0};_0x49b534[_0x7f44('0x25')](function(_0x35333e){var _0x550c6e=_0x35333e['role']===_0x7f44('0x21')?_0x7f44('0x26'):_0x35333e[_0x7f44('0x1e')];_0x31dc59[_0x550c6e]-=_0x35333e[_0x7f44('0x20')];if(_0x31dc59[_0x550c6e]<0x0)_0x31dc59[_0x550c6e]=0x0;});_0x558bb1(_0x31dc59);return;});})[_0x7f44('0xc')](function(_0x2db4be){_0x4b2ca8(_0x2db4be);});});}function checkUserLimits(_0x92191a){return new BPromise(function(_0x364b78,_0x198460){getLimits()['then'](function(_0x2d94ae){var _0x31c8d4=_[_0x7f44('0x27')](_[_0x7f44('0x28')](_0x92191a,_0x7f44('0x1e')),[_0x7f44('0x21'),_0x7f44('0x26'),_0x7f44('0x22')]);var _0x1a3432=(_0x31c8d4[_0x7f44('0x21')]||0x0)+(_0x31c8d4[_0x7f44('0x26')]||0x0);var _0x4c7405=_0x31c8d4[_0x7f44('0x22')]||0x0;if(_0x1a3432>_0x2d94ae[_0x7f44('0x26')])return _0x198460('License\x20limit\x20reached\x20for\x20users');if(_0x4c7405>_0x2d94ae[_0x7f44('0x22')])return _0x198460(_0x7f44('0x29'));return _0x364b78();})['catch'](function(_0x3910fe){_0x198460(_0x3910fe);});});}module[_0x7f44('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index b753480..e4ca65e 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ee=['myappanuglar-secret','secret'];(function(_0x5219b0,_0x2519f3){var _0x55b2b9=function(_0x178d27){while(--_0x178d27){_0x5219b0['push'](_0x5219b0['shift']());}};_0x55b2b9(++_0x2519f3);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xe36e('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe36e('0x1'),'DEBUG':''}; \ No newline at end of file +var _0x32b6=['secret','exports','http://localhost:9000','app-id'];(function(_0x1c8d06,_0x544dd3){var _0x5bf0b6=function(_0x120113){while(--_0x120113){_0x1c8d06['push'](_0x1c8d06['shift']());}};_0x5bf0b6(++_0x544dd3);}(_0x32b6,0x1d1));var _0x632b=function(_0x343294,_0x5b384e){_0x343294=_0x343294-0x0;var _0xca5e9a=_0x32b6[_0x343294];return _0xca5e9a;};'use strict';module[_0x632b('0x0')]={'DOMAIN':_0x632b('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x632b('0x2'),'GOOGLE_SECRET':_0x632b('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4a02008..867352a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63b1=['fileLogger','exports'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x63b1,0x170));var _0x163b=function(_0x336bfb,_0x3a0ae0){_0x336bfb=_0x336bfb-0x0;var _0x2552b4=_0x63b1[_0x336bfb];return _0x2552b4;};'use strict';var fileLogger=require('../utils/loggers')[_0x163b('0x0')];module[_0x163b('0x1')]=fileLogger; \ No newline at end of file +var _0xcc20=['../utils/loggers','fileLogger'];(function(_0x2d2226,_0x49f48e){var _0x32aef1=function(_0x105d12){while(--_0x105d12){_0x2d2226['push'](_0x2d2226['shift']());}};_0x32aef1(++_0x49f48e);}(_0xcc20,0x96));var _0x0cc2=function(_0x54735c,_0x11765c){_0x54735c=_0x54735c-0x0;var _0x402cb3=_0xcc20[_0x54735c];return _0x402cb3;};'use strict';var fileLogger=require(_0x0cc2('0x0'))[_0x0cc2('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 228d500..758d1f0 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c5c=['../../services/xdr/index.js','../../config/environment','resolve','root','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9c5c,0xfe));var _0xc9c5=function(_0x30f2ab,_0x22db97){_0x30f2ab=_0x30f2ab-0x0;var _0x3ca3a4=_0x9c5c[_0x30f2ab];return _0x3ca3a4;};'use strict';var path=require('path');var cfg=require(_0xc9c5('0x0'));var env={'NODE_PATH':path[_0xc9c5('0x1')](path['join'](cfg[_0xc9c5('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0xc9c5('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path[_0xc9c5('0x3')](__dirname,'../../services/ami/index.js'),'env':env},{'name':'agi','script':path[_0xc9c5('0x3')](__dirname,_0xc9c5('0x4')),'env':env},{'name':_0xc9c5('0x5'),'script':path['join'](__dirname,_0xc9c5('0x6')),'env':env},{'name':_0xc9c5('0x7'),'script':path[_0xc9c5('0x3')](__dirname,_0xc9c5('0x8')),'env':env},{'name':_0xc9c5('0x9'),'script':path[_0xc9c5('0x3')](__dirname,_0xc9c5('0xa')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0xdd42=['../../services/agi/index.js','email','routing','../../services/xdr/index.js','exports','../../config/environment','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x459958,_0x189bb4){var _0x2bba98=function(_0x21efeb){while(--_0x21efeb){_0x459958['push'](_0x459958['shift']());}};_0x2bba98(++_0x189bb4);}(_0xdd42,0x9f));var _0x2dd4=function(_0x3510f4,_0x3da004){_0x3510f4=_0x3510f4-0x0;var _0x2f03ac=_0xdd42[_0x3510f4];return _0x2f03ac;};'use strict';var path=require('path');var cfg=require(_0x2dd4('0x0'));var env={'NODE_PATH':path['resolve'](path[_0x2dd4('0x1')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x2')),'env':env},{'name':_0x2dd4('0x3'),'script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x4')),'env':env},{'name':_0x2dd4('0x5'),'script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x6')),'env':env},{'name':_0x2dd4('0x7'),'script':path[_0x2dd4('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x2dd4('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x9')),'env':env}]};module[_0x2dd4('0xa')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 863e46e..af0338c 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd071=['then','disconnect','stop','restart','list','describe','dump','saved','pm2','connect','start'];(function(_0x5bc0df,_0x4b6fbe){var _0x6cb2a2=function(_0x2ecefc){while(--_0x2ecefc){_0x5bc0df['push'](_0x5bc0df['shift']());}};_0x6cb2a2(++_0x4b6fbe);}(_0xd071,0x1ec));var _0x1d07=function(_0x71b921,_0x2fa3c2){_0x71b921=_0x71b921-0x0;var _0x120d49=_0xd071[_0x71b921];return _0x120d49;};'use strict';var pm2=require(_0x1d07('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x17c3c8,_0xffb4c9){return pm2[_0x1d07('0x1')](function(_0xd42844){if(_0xd42844){return _0xffb4c9(_0xd42844);}return _0x17c3c8('connected');});});};exports[_0x1d07('0x2')]=function(_0x1d581f){return connect()[_0x1d07('0x3')](function(){return new BPromise(function(_0x34e7ea,_0xfc7384){return pm2[_0x1d07('0x2')](_0x1d581f,function(_0x1b8908,_0x123bff){if(_0x1b8908){return _0xfc7384(_0x1b8908);}pm2[_0x1d07('0x4')]();return _0x34e7ea(_0x123bff);});});});};exports[_0x1d07('0x5')]=function(_0x401406){return connect()[_0x1d07('0x3')](function(){return new BPromise(function(_0x4afef7,_0x5aeafe){return pm2[_0x1d07('0x5')](_0x401406,function(_0x1b835f,_0x49220d){if(_0x1b835f){return _0x5aeafe(_0x1b835f);}pm2[_0x1d07('0x4')]();return _0x4afef7(_0x49220d);});});});};exports[_0x1d07('0x6')]=function(_0x463f8e){return connect()[_0x1d07('0x3')](function(){return new BPromise(function(_0x16ccc1,_0x57a448){return pm2[_0x1d07('0x6')](_0x463f8e,function(_0x3f88cf,_0x44d68c){if(_0x3f88cf){return _0x57a448(_0x3f88cf);}pm2[_0x1d07('0x4')]();return _0x16ccc1(_0x44d68c);});});});};exports[_0x1d07('0x7')]=function(){return connect()[_0x1d07('0x3')](function(){return new BPromise(function(_0x361472,_0x27933a){return pm2[_0x1d07('0x7')](function(_0x25413,_0xf95e8b){if(_0x25413){return _0x27933a(_0x25413);}pm2[_0x1d07('0x4')]();return _0x361472(_0xf95e8b);});});});};exports[_0x1d07('0x8')]=function(_0x50121f){return connect()['then'](function(){return new BPromise(function(_0x2ef0d8,_0x24b8a6){return pm2['describe'](_0x50121f,function(_0x418494,_0x4e03d9){if(_0x418494){return _0x24b8a6(_0x418494);}pm2['disconnect']();return _0x2ef0d8(_0x4e03d9);});});});};exports['delete']=function(_0x2afcc4){return connect()['then'](function(){return new BPromise(function(_0x586c1e,_0x108e60){return pm2['delete'](_0x2afcc4,function(_0x29776e,_0x2e1c60){if(_0x29776e){return _0x108e60(_0x29776e);}pm2[_0x1d07('0x4')]();return _0x586c1e(_0x2e1c60);});});});};exports[_0x1d07('0x9')]=function(){return connect()[_0x1d07('0x3')](function(){return new BPromise(function(_0x5ee268,_0x2b1ef9){return pm2['dump'](function(_0x633e26){if(_0x633e26){return _0x2b1ef9(_0x633e26);}return _0x5ee268(_0x1d07('0xa'));});});});}; \ No newline at end of file +var _0x7fb1=['stop','restart','list','describe','delete','dump','pm2','bluebird','connected','start','then','disconnect'];(function(_0x4af9dc,_0x2a0b9c){var _0x44a273=function(_0x1a5cdd){while(--_0x1a5cdd){_0x4af9dc['push'](_0x4af9dc['shift']());}};_0x44a273(++_0x2a0b9c);}(_0x7fb1,0x1ce));var _0x17fb=function(_0x5c722e,_0x83c9bd){_0x5c722e=_0x5c722e-0x0;var _0x680a07=_0x7fb1[_0x5c722e];return _0x680a07;};'use strict';var pm2=require(_0x17fb('0x0'));var BPromise=require(_0x17fb('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x53a3f1,_0x50b4d6){return pm2['connect'](function(_0xba3d42){if(_0xba3d42){return _0x50b4d6(_0xba3d42);}return _0x53a3f1(_0x17fb('0x2'));});});};exports[_0x17fb('0x3')]=function(_0x2e5058){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x58f395,_0x4b5f66){return pm2['start'](_0x2e5058,function(_0x5becf2,_0x40e1c8){if(_0x5becf2){return _0x4b5f66(_0x5becf2);}pm2[_0x17fb('0x5')]();return _0x58f395(_0x40e1c8);});});});};exports[_0x17fb('0x6')]=function(_0x3b5ebc){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x366aaa,_0x5f1f5b){return pm2[_0x17fb('0x6')](_0x3b5ebc,function(_0x5d29c2,_0x2ed4b5){if(_0x5d29c2){return _0x5f1f5b(_0x5d29c2);}pm2[_0x17fb('0x5')]();return _0x366aaa(_0x2ed4b5);});});});};exports[_0x17fb('0x7')]=function(_0x376944){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x4a33e1,_0x23bb08){return pm2['restart'](_0x376944,function(_0x56d73d,_0xe84bf9){if(_0x56d73d){return _0x23bb08(_0x56d73d);}pm2['disconnect']();return _0x4a33e1(_0xe84bf9);});});});};exports['list']=function(){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x181609,_0x18ba21){return pm2[_0x17fb('0x8')](function(_0x2d5928,_0x135856){if(_0x2d5928){return _0x18ba21(_0x2d5928);}pm2[_0x17fb('0x5')]();return _0x181609(_0x135856);});});});};exports[_0x17fb('0x9')]=function(_0x94b2e){return connect()['then'](function(){return new BPromise(function(_0x385a9f,_0x1e8d1){return pm2['describe'](_0x94b2e,function(_0x3bf3b8,_0x3c0a7c){if(_0x3bf3b8){return _0x1e8d1(_0x3bf3b8);}pm2['disconnect']();return _0x385a9f(_0x3c0a7c);});});});};exports[_0x17fb('0xa')]=function(_0x5ef570){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x518a08,_0x17786e){return pm2['delete'](_0x5ef570,function(_0x16871f,_0x872ca4){if(_0x16871f){return _0x17786e(_0x16871f);}pm2[_0x17fb('0x5')]();return _0x518a08(_0x872ca4);});});});};exports[_0x17fb('0xb')]=function(){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x20bf51,_0x40b48c){return pm2[_0x17fb('0xb')](function(_0x17b265){if(_0x17b265){return _0x40b48c(_0x17b265);}return _0x20bf51('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 02d3c66..061cd10 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e5d=['subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','error','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x7e5d,0xa9));var _0xd7e5=function(_0x490ad0,_0x472ddb){_0x490ad0=_0x490ad0-0x0;var _0x129031=_0x7e5d[_0x490ad0];return _0x129031;};'use strict';var _=require(_0xd7e5('0x0'));var moment=require(_0xd7e5('0x1'));var Redis=require(_0xd7e5('0x2'));var util=require('util');var config=require(_0xd7e5('0x3'));var db=require(_0xd7e5('0x4'))['db'];var logger=require(_0xd7e5('0x5'))(_0xd7e5('0x6'));config['redis']=_[_0xd7e5('0x7')](config[_0xd7e5('0x8')],{'host':_0xd7e5('0x9'),'port':0x18eb});var io=require(_0xd7e5('0xa'))(new Redis(config[_0xd7e5('0x8')]));function closeInteractions(){var _0x2b7321=0x0;var _0x1c3acb=[];return db[_0xd7e5('0xb')][_0xd7e5('0xc')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xd7e5('0xd')](function(_0x10eeb8){_0x2b7321=_0x10eeb8[_0xd7e5('0xe')];if(_0x2b7321){return db[_0xd7e5('0xf')]['findAll']({'raw':!![],'attributes':['id',_0xd7e5('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd7e5('0x11')](_0x10eeb8[_0xd7e5('0xe')],_0xd7e5('0x12'))}}});}else{return[];}})['then'](function(_0x103eda){if(_0x103eda&&_0x103eda[_0xd7e5('0x13')]){_0x1c3acb=_[_0xd7e5('0x14')](_0x103eda||[],'id');logger[_0xd7e5('0x15')](_0xd7e5('0x16'),_0x1c3acb[_0xd7e5('0x17')]());return db[_0xd7e5('0xf')][_0xd7e5('0x18')]({'closeReason':'system','disposition':_0xd7e5('0x19'),'closed':!![],'closedAt':moment()['format'](_0xd7e5('0x1a'))},{'where':{'id':_0x1c3acb}});}})['then'](function(){if(_0x1c3acb&&_0x1c3acb['length']){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1c3acb[_0xd7e5('0x17')]());for(var _0x274143=0x0;_0x274143<_0x1c3acb[_0xd7e5('0x13')];_0x274143++){io[_0xd7e5('0x1b')](_0xd7e5('0x1c'),{'id':_0x1c3acb[_0x274143],'closed':!![]});}}})['catch'](function(_0x3dcd92){logger[_0xd7e5('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3dcd92?util['inspect'](_0x3dcd92,{'showHidden':![],'depth':null}):'');});}exports[_0xd7e5('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd093=['../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis'];(function(_0x46fdf6,_0x3e1d7b){var _0x1eb206=function(_0x310d1f){while(--_0x310d1f){_0x46fdf6['push'](_0x46fdf6['shift']());}};_0x1eb206(++_0x3e1d7b);}(_0xd093,0x183));var _0x3d09=function(_0x4125ef,_0x1855e9){_0x4125ef=_0x4125ef-0x0;var _0x1818b4=_0xd093[_0x4125ef];return _0x1818b4;};'use strict';var _=require(_0x3d09('0x0'));var moment=require(_0x3d09('0x1'));var Redis=require(_0x3d09('0x2'));var util=require('util');var config=require(_0x3d09('0x3'));var db=require(_0x3d09('0x4'))['db'];var logger=require(_0x3d09('0x5'))('schedule');config['redis']=_['defaults'](config[_0x3d09('0x6')],{'host':_0x3d09('0x7'),'port':0x18eb});var io=require(_0x3d09('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x41ac2c=0x0;var _0x5b0d40=[];return db[_0x3d09('0x9')][_0x3d09('0xa')]({'raw':!![],'attributes':['id',_0x3d09('0xb')],'where':{'id':0x1}})[_0x3d09('0xc')](function(_0x5e99d9){_0x41ac2c=_0x5e99d9['chatTimeout'];if(_0x41ac2c){return db[_0x3d09('0xd')][_0x3d09('0xe')]({'raw':!![],'attributes':['id',_0x3d09('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3d09('0x10')](_0x5e99d9[_0x3d09('0xb')],'minutes')}}});}else{return[];}})[_0x3d09('0xc')](function(_0x3b9d06){if(_0x3b9d06&&_0x3b9d06[_0x3d09('0x11')]){_0x5b0d40=_[_0x3d09('0x12')](_0x3b9d06||[],'id');logger[_0x3d09('0x13')](_0x3d09('0x14'),_0x5b0d40['join']());return db[_0x3d09('0xd')][_0x3d09('0x15')]({'closeReason':_0x3d09('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x3d09('0x17'))},{'where':{'id':_0x5b0d40}});}})['then'](function(){if(_0x5b0d40&&_0x5b0d40[_0x3d09('0x11')]){logger['info'](_0x3d09('0x18'),_0x5b0d40[_0x3d09('0x19')]());for(var _0x3ea4e9=0x0;_0x3ea4e9<_0x5b0d40[_0x3d09('0x11')];_0x3ea4e9++){io[_0x3d09('0x1a')]('chatInteraction:update',{'id':_0x5b0d40[_0x3ea4e9],'closed':!![]});}}})['catch'](function(_0x5653be){logger[_0x3d09('0x1b')](_0x3d09('0x1c'),_0x5653be?util['inspect'](_0x5653be,{'showHidden':![],'depth':null}):'');});}exports[_0x3d09('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 432a159..7a427d2 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7a0=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x23086d,_0x308c2e){var _0xf0b81=function(_0x523695){while(--_0x523695){_0x23086d['push'](_0x23086d['shift']());}};_0xf0b81(++_0x308c2e);}(_0xf7a0,0x75));var _0x0f7a=function(_0x5e1288,_0x4bf446){_0x5e1288=_0x5e1288-0x0;var _0x67cfe6=_0xf7a0[_0x5e1288];return _0x67cfe6;};'use strict';function start(){var _0x2b316a=require(_0x0f7a('0x0'));return _0x2b316a[_0x0f7a('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x2f5c=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3eb858,_0x2ad922){var _0x147946=function(_0x399601){while(--_0x399601){_0x3eb858['push'](_0x3eb858['shift']());}};_0x147946(++_0x2ad922);}(_0x2f5c,0x99));var _0xc2f5=function(_0x206d71,_0x13db9c){_0x206d71=_0x206d71-0x0;var _0x1e8590=_0x2f5c[_0x206d71];return _0x1e8590;};'use strict';function start(){var _0x3c416c=require(_0xc2f5('0x0'));return _0x3c416c[_0xc2f5('0x1')]();}module[_0xc2f5('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index dc108f6..9d7217f 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff34=['startAt','update','update\x20cron','run','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','%s.%s','basename','savename','extname','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','error','stringify','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','then','no\x20report\x20id','findAll','MailServerOut','CloudProvider','map','keyBy','difference','intersection','length','toString','stop','deleteJob','delete\x20cron','index','my\x20id','run\x20job','cron','active','endAt','add','start','exists','stop\x20cron'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff34,0x150));var _0x4ff3=function(_0x3572cc,_0x3b1360){_0x3572cc=_0x3572cc-0x0;var _0xa9435a=_0xff34[_0x3572cc];return _0xa9435a;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x4ff3('0x0'));var _=require('lodash');var moment=require(_0x4ff3('0x1'));var CronJobManager=require(_0x4ff3('0x2'));var jayson=require(_0x4ff3('0x3'));var BPromise=require(_0x4ff3('0x4'));var logger=require(_0x4ff3('0x5'))(_0x4ff3('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x4ff3('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x4ff3('0x8')][_0x4ff3('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x467e62,_0x2c83da){return function(){logger['info'](_0x4ff3('0xa'),_0x467e62[_0x4ff3('0xb')]);var _0x49edd7=!![];var _0x29a1b7=_0x467e62[_0x4ff3('0xc')][_0x4ff3('0xd')]();var _0x1a0a28={'account':_0x29a1b7,'message':{'from':util[_0x4ff3('0xe')](_0x4ff3('0xf'),_0x467e62[_0x4ff3('0xc')][_0x4ff3('0x10')],_0x467e62[_0x4ff3('0xc')][_0x4ff3('0xb')]||_0x467e62['MailAccount'][_0x4ff3('0x11')][_0x4ff3('0x12')]),'to':_0x467e62[_0x4ff3('0xb')],'cc':_0x467e62['cc'],'bcc':_0x467e62[_0x4ff3('0x13')],'subject':util[_0x4ff3('0xe')](_0x4ff3('0x14'),_0x2c83da[_0x4ff3('0x10')],_0x467e62[_0x4ff3('0x15')],_0x467e62[_0x4ff3('0x16')])}};var _0xab0670=path['join'](__dirname,'../../files/reports');var _0x1ac5e5=_0x2c83da['savename'];var _0x548861=util[_0x4ff3('0xe')](_0x4ff3('0x17'),path[_0x4ff3('0x18')](_0x2c83da[_0x4ff3('0x19')],path[_0x4ff3('0x1a')](_0x2c83da[_0x4ff3('0x19')])),_0x4ff3('0x1b'));var _0x45391a=path['join'](_0xab0670,_0x1ac5e5);var _0x1dc3b3=path[_0x4ff3('0x1c')](_0xab0670,_0x548861);if(fs[_0x4ff3('0x1d')](_0x45391a)){_0x2c83da[_0x4ff3('0x1e')]=_0x4ff3('0x1f');_0x1a0a28[_0x4ff3('0x20')][_0x4ff3('0x21')]=[{'filename':_0x1ac5e5,'path':_0x45391a}];_0x1a0a28[_0x4ff3('0x20')][_0x4ff3('0x22')]=util[_0x4ff3('0xe')](_0x4ff3('0x23'),JSON['stringify'](_0x2c83da,null,0x2));}else if(fs[_0x4ff3('0x1d')](_0x1dc3b3)){_0x2c83da[_0x4ff3('0x1e')]=_0x4ff3('0x1f');_0x1a0a28[_0x4ff3('0x20')][_0x4ff3('0x21')]=[{'filename':_0x548861,'path':_0x1dc3b3}];}else{_0x1a0a28[_0x4ff3('0x20')][_0x4ff3('0x22')]=_0x4ff3('0x24');if(!_0x467e62[_0x4ff3('0x25')]){_0x49edd7=![];logger[_0x4ff3('0x26')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x49edd7){return client[_0x4ff3('0x27')](_0x4ff3('0x28'),_0x1a0a28)['then'](function(_0x14d913){if(_0x14d913['error']){return logger[_0x4ff3('0x29')]('error\x20mail',JSON[_0x4ff3('0x2a')](_0x14d913));}return logger[_0x4ff3('0x26')]('email\x20sent');})['catch'](function(_0xe2cee8){return logger[_0x4ff3('0x29')]('error\x20mail',JSON[_0x4ff3('0x2a')](_0xe2cee8));});}};}function handleError(){return function(_0x4d86a3){return logger[_0x4ff3('0x29')](JSON[_0x4ff3('0x2a')](_0x4d86a3));};}function handleResult(_0xb92223){return function(_0x3ce192){logger['info']('data',JSON[_0x4ff3('0x2a')](_0x3ce192));if(_0xb92223[_0x4ff3('0xc')]&&_0xb92223[_0x4ff3('0xc')][_0x4ff3('0x11')]&&!_[_0x4ff3('0x2b')](_0xb92223[_0x4ff3('0xb')])){setTimeout(handleSendEmail(_0xb92223,_0x3ce192),0x3c*0x3e8);}};}function handleJob(_0x48855a){return function(){try{if(_[_0x4ff3('0x2b')](_0x48855a[_0x4ff3('0x15')])){return logger[_0x4ff3('0x26')](_0x4ff3('0x2c'));}if(_[_0x4ff3('0x2b')](_0x48855a[_0x4ff3('0x16')])){return logger[_0x4ff3('0x26')](_0x4ff3('0x2d'));}var _0x1eb827={'startDate':moment()[_0x4ff3('0x2e')](_0x48855a[_0x4ff3('0x15')],_0x48855a['subtractUnit'])[_0x4ff3('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x4ff3('0x2f')),'type':'scheduled','output':_0x48855a[_0x4ff3('0x30')],'name':_0x48855a[_0x4ff3('0x10')]};if(!_['isNil'](_0x48855a['DefaultReportId'])){logger[_0x4ff3('0x26')](_0x4ff3('0x31'),_0x48855a[_0x4ff3('0x32')]);return analyticDefaultReportController[_0x4ff3('0x33')]({'id':_0x48855a[_0x4ff3('0x32')]},_0x1eb827)['then'](handleResult(_0x48855a))[_0x4ff3('0x34')](handleError());}if(!_['isNil'](_0x48855a[_0x4ff3('0x35')])){logger[_0x4ff3('0x26')](_0x4ff3('0x36'),_0x48855a[_0x4ff3('0x35')]);return analyticCustomReportController[_0x4ff3('0x33')]({'id':_0x48855a[_0x4ff3('0x35')]},_0x1eb827)[_0x4ff3('0x37')](handleResult(_0x48855a))['catch'](handleError());}}catch(_0x2f9deb){logger[_0x4ff3('0x29')](JSON[_0x4ff3('0x2a')](_0x2f9deb));}return logger[_0x4ff3('0x26')](_0x4ff3('0x38'));};}function getJobs(_0x5eb3d9){var _0x324c38={};if(_0x5eb3d9){_0x324c38['id']=_0x5eb3d9;}return db['Schedule'][_0x4ff3('0x39')]({'where':_0x324c38,'include':[{'model':db[_0x4ff3('0xc')],'attributes':['id',_0x4ff3('0x10'),'email'],'include':[{'model':db[_0x4ff3('0x3a')],'as':_0x4ff3('0x11'),'include':[{'model':db[_0x4ff3('0x3b')],'as':_0x4ff3('0x3b')}]}]}]})[_0x4ff3('0x37')](function(_0x1aa7c0){var _0x477cd3=_['keys'](manager['jobs']);var _0x81a10d=_[_0x4ff3('0x3c')](_0x1aa7c0,function(_0x39e99a){return _0x39e99a['id']['toString']();});var _0x48ed88=_[_0x4ff3('0x3d')](_0x1aa7c0,function(_0x2920a8){return _0x2920a8['id']['toString']();});var _0x3016f6=_0x5eb3d9?_0x81a10d:_[_0x4ff3('0x3e')](_0x81a10d,_0x477cd3);var _0x336749=_[_0x4ff3('0x3f')](_0x81a10d,_0x477cd3);var _0x487824=_[_0x4ff3('0x3e')](_0x477cd3,_0x81a10d);var _0x4b9054;var _0xb70049;for(_0x4b9054=0x0;_0x4b9054<_0x487824[_0x4ff3('0x40')]&&!_0x5eb3d9;_0x4b9054+=0x1){_0xb70049=_0x487824[_0x4b9054][_0x4ff3('0x41')]();if(manager['exists'](_0xb70049)){manager[_0x4ff3('0x42')](_0xb70049);manager[_0x4ff3('0x43')](_0xb70049);logger[_0x4ff3('0x26')](_0x4ff3('0x44'),_0xb70049);}}logger[_0x4ff3('0x26')]('toRun',JSON[_0x4ff3('0x2a')](_0x3016f6));for(_0x4b9054=0x0;_0x4b9054<_0x3016f6[_0x4ff3('0x40')];_0x4b9054+=0x1){_0xb70049=_0x3016f6[_0x4b9054][_0x4ff3('0x41')]();logger[_0x4ff3('0x26')](_0x4ff3('0x45'),_0xb70049);if(_0x5eb3d9){logger['info'](_0x4ff3('0x46'),_0x5eb3d9);logger[_0x4ff3('0x26')](JSON['stringify'](_0x48ed88[_0xb70049]));BPromise['resolve']()['then'](handleJob(_0x48ed88[_0xb70049]));logger['info'](_0x4ff3('0x47'),_0x48ed88[_0xb70049][_0x4ff3('0x10')],_0x48ed88[_0xb70049][_0x4ff3('0x48')]);}else if(_0x48ed88[_0xb70049][_0x4ff3('0x48')]&&_0x48ed88[_0xb70049][_0x4ff3('0x49')]&&moment()['isBetween'](_0x48ed88[_0xb70049]['startAt'],_0x48ed88[_0xb70049][_0x4ff3('0x4a')])){manager[_0x4ff3('0x4b')](_0xb70049,_0x48ed88[_0xb70049][_0x4ff3('0x48')],handleJob(_0x48ed88[_0xb70049]));manager[_0x4ff3('0x4c')](_0xb70049);logger[_0x4ff3('0x26')]('add\x20cron',_0x48ed88[_0xb70049][_0x4ff3('0x10')],_0x48ed88[_0xb70049][_0x4ff3('0x48')]);}else if(manager[_0x4ff3('0x4d')](_0xb70049)){manager[_0x4ff3('0x42')](_0xb70049);manager[_0x4ff3('0x43')](_0xb70049);logger[_0x4ff3('0x26')](_0x4ff3('0x4e'),_0x48ed88[_0xb70049][_0x4ff3('0x10')],_0x48ed88[_0xb70049][_0x4ff3('0x48')]);}}for(_0x4b9054=0x0,_0xb70049;_0x4b9054<_0x336749[_0x4ff3('0x40')]&&!_0x5eb3d9;_0x4b9054+=0x1){_0xb70049=_0x336749[_0x4b9054]['toString']();if(manager[_0x4ff3('0x4d')](_0xb70049)){if(_0x48ed88[_0xb70049][_0x4ff3('0x48')]&&_0x48ed88[_0xb70049][_0x4ff3('0x49')]&&moment()['isBetween'](_0x48ed88[_0xb70049][_0x4ff3('0x4f')],_0x48ed88[_0xb70049]['endAt'])){manager[_0x4ff3('0x50')](_0xb70049,_0x48ed88[_0xb70049]['cron'],handleJob(_0x48ed88[_0xb70049]));logger[_0x4ff3('0x26')](_0x4ff3('0x51'),_0x48ed88[_0xb70049][_0x4ff3('0x10')],_0x48ed88[_0xb70049]['cron']);}else{manager['stop'](_0xb70049);manager[_0x4ff3('0x43')](_0xb70049);logger[_0x4ff3('0x26')](_0x4ff3('0x4e'),_0x48ed88[_0xb70049][_0x4ff3('0x10')],_0x48ed88[_0xb70049][_0x4ff3('0x48')]);}}}})[_0x4ff3('0x34')](function(_0x20ca8d){logger[_0x4ff3('0x29')](JSON['stringify'](_0x20ca8d));});}exports[_0x4ff3('0x52')]=function(_0x5bb0e2){return getJobs(_0x5bb0e2);};exports[_0x4ff3('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x32ab=['add\x20cron','stop\x20cron','update','update\x20cron','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','user','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','Sent','attachments','message','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','Smtp','CloudProvider','keys','jobs','map','toString','difference','intersection','exists','stop','deleteJob','toRun','length','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start'];(function(_0x166282,_0x368cce){var _0x411f14=function(_0x4879a6){while(--_0x4879a6){_0x166282['push'](_0x166282['shift']());}};_0x411f14(++_0x368cce);}(_0x32ab,0xb7));var _0xb32a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x32ab[_0x5d6456];return _0x4d66c1;};'use strict';var fs=require('fs');var util=require(_0xb32a('0x0'));var path=require('path');var _=require(_0xb32a('0x1'));var moment=require(_0xb32a('0x2'));var CronJobManager=require(_0xb32a('0x3'));var jayson=require(_0xb32a('0x4'));var BPromise=require(_0xb32a('0x5'));var logger=require(_0xb32a('0x6'))(_0xb32a('0x7'));var db=require(_0xb32a('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb32a('0x9'));var client=jayson[_0xb32a('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x45a378,_0x268227){return function(){logger[_0xb32a('0xb')](_0xb32a('0xc'),_0x45a378[_0xb32a('0xd')]);var _0x47b9fe=!![];var _0xfd0afc=_0x45a378['MailAccount'][_0xb32a('0xe')]();var _0x547a35={'account':_0xfd0afc,'message':{'from':util[_0xb32a('0xf')](_0xb32a('0x10'),_0x45a378[_0xb32a('0x11')]['name'],_0x45a378[_0xb32a('0x11')][_0xb32a('0xd')]||_0x45a378['MailAccount']['Smtp'][_0xb32a('0x12')]),'to':_0x45a378['email'],'cc':_0x45a378['cc'],'bcc':_0x45a378[_0xb32a('0x13')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x268227[_0xb32a('0x14')],_0x45a378[_0xb32a('0x15')],_0x45a378[_0xb32a('0x16')])}};var _0x63faa7=path[_0xb32a('0x17')](__dirname,_0xb32a('0x18'));var _0x209123=_0x268227[_0xb32a('0x19')];var _0x16edec=util[_0xb32a('0xf')](_0xb32a('0x1a'),path[_0xb32a('0x1b')](_0x268227[_0xb32a('0x19')],path[_0xb32a('0x1c')](_0x268227['savename'])),'zip');var _0x4344c5=path[_0xb32a('0x17')](_0x63faa7,_0x209123);var _0x573079=path[_0xb32a('0x17')](_0x63faa7,_0x16edec);if(fs[_0xb32a('0x1d')](_0x4344c5)){_0x268227[_0xb32a('0x1e')]=_0xb32a('0x1f');_0x547a35['message'][_0xb32a('0x20')]=[{'filename':_0x209123,'path':_0x4344c5}];_0x547a35[_0xb32a('0x21')][_0xb32a('0x22')]=util[_0xb32a('0xf')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xb32a('0x23')](_0x268227,null,0x2));}else if(fs[_0xb32a('0x1d')](_0x573079)){_0x268227[_0xb32a('0x1e')]=_0xb32a('0x1f');_0x547a35[_0xb32a('0x21')][_0xb32a('0x20')]=[{'filename':_0x16edec,'path':_0x573079}];}else{_0x547a35[_0xb32a('0x21')]['text']=_0xb32a('0x24');if(!_0x45a378[_0xb32a('0x25')]){_0x47b9fe=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x47b9fe){return client[_0xb32a('0x26')]('SendMail',_0x547a35)[_0xb32a('0x27')](function(_0x15f95d){if(_0x15f95d[_0xb32a('0x28')]){return logger[_0xb32a('0x28')]('error\x20mail',JSON[_0xb32a('0x23')](_0x15f95d));}return logger[_0xb32a('0xb')](_0xb32a('0x29'));})[_0xb32a('0x2a')](function(_0x5ad02c){return logger[_0xb32a('0x28')](_0xb32a('0x2b'),JSON[_0xb32a('0x23')](_0x5ad02c));});}};}function handleError(){return function(_0x2dcaae){return logger[_0xb32a('0x28')](JSON[_0xb32a('0x23')](_0x2dcaae));};}function handleResult(_0x336b2d){return function(_0x1b69ab){logger[_0xb32a('0xb')](_0xb32a('0x2c'),JSON[_0xb32a('0x23')](_0x1b69ab));if(_0x336b2d[_0xb32a('0x11')]&&_0x336b2d[_0xb32a('0x11')]['Smtp']&&!_[_0xb32a('0x2d')](_0x336b2d['email'])){setTimeout(handleSendEmail(_0x336b2d,_0x1b69ab),0x3c*0x3e8);}};}function handleJob(_0x5a35a8){return function(){try{if(_['isNil'](_0x5a35a8['subtractNumber'])){return logger['info'](_0xb32a('0x2e'));}if(_[_0xb32a('0x2d')](_0x5a35a8['subtractUnit'])){return logger['info'](_0xb32a('0x2f'));}var _0x34d689={'startDate':moment()[_0xb32a('0x30')](_0x5a35a8['subtractNumber'],_0x5a35a8[_0xb32a('0x16')])[_0xb32a('0xf')](_0xb32a('0x31')),'endDate':moment()['format'](_0xb32a('0x31')),'type':_0xb32a('0x32'),'output':_0x5a35a8[_0xb32a('0x33')],'name':_0x5a35a8[_0xb32a('0x14')]};if(!_[_0xb32a('0x2d')](_0x5a35a8[_0xb32a('0x34')])){logger[_0xb32a('0xb')](_0xb32a('0x35'),_0x5a35a8[_0xb32a('0x34')]);return analyticDefaultReportController[_0xb32a('0x36')]({'id':_0x5a35a8[_0xb32a('0x34')]},_0x34d689)[_0xb32a('0x27')](handleResult(_0x5a35a8))[_0xb32a('0x2a')](handleError());}if(!_[_0xb32a('0x2d')](_0x5a35a8[_0xb32a('0x37')])){logger[_0xb32a('0xb')](_0xb32a('0x38'),_0x5a35a8['CustomReportId']);return analyticCustomReportController[_0xb32a('0x36')]({'id':_0x5a35a8[_0xb32a('0x37')]},_0x34d689)[_0xb32a('0x27')](handleResult(_0x5a35a8))[_0xb32a('0x2a')](handleError());}}catch(_0x303cf7){logger[_0xb32a('0x28')](JSON[_0xb32a('0x23')](_0x303cf7));}return logger['info'](_0xb32a('0x39'));};}function getJobs(_0x339ddb){var _0x273ffd={};if(_0x339ddb){_0x273ffd['id']=_0x339ddb;}return db[_0xb32a('0x3a')][_0xb32a('0x3b')]({'where':_0x273ffd,'include':[{'model':db[_0xb32a('0x11')],'attributes':['id',_0xb32a('0x14'),_0xb32a('0xd')],'include':[{'model':db[_0xb32a('0x3c')],'as':_0xb32a('0x3d'),'include':[{'model':db['CloudProvider'],'as':_0xb32a('0x3e')}]}]}]})[_0xb32a('0x27')](function(_0x36820b){var _0x47a77a=_[_0xb32a('0x3f')](manager[_0xb32a('0x40')]);var _0x3aede8=_[_0xb32a('0x41')](_0x36820b,function(_0x5d04c4){return _0x5d04c4['id'][_0xb32a('0x42')]();});var _0xd625b8=_['keyBy'](_0x36820b,function(_0x376b6a){return _0x376b6a['id']['toString']();});var _0x4fa70a=_0x339ddb?_0x3aede8:_[_0xb32a('0x43')](_0x3aede8,_0x47a77a);var _0xef6b07=_[_0xb32a('0x44')](_0x3aede8,_0x47a77a);var _0x829d25=_[_0xb32a('0x43')](_0x47a77a,_0x3aede8);var _0x37855a;var _0x304edc;for(_0x37855a=0x0;_0x37855a<_0x829d25['length']&&!_0x339ddb;_0x37855a+=0x1){_0x304edc=_0x829d25[_0x37855a]['toString']();if(manager[_0xb32a('0x45')](_0x304edc)){manager[_0xb32a('0x46')](_0x304edc);manager[_0xb32a('0x47')](_0x304edc);logger[_0xb32a('0xb')]('delete\x20cron',_0x304edc);}}logger[_0xb32a('0xb')](_0xb32a('0x48'),JSON[_0xb32a('0x23')](_0x4fa70a));for(_0x37855a=0x0;_0x37855a<_0x4fa70a[_0xb32a('0x49')];_0x37855a+=0x1){_0x304edc=_0x4fa70a[_0x37855a][_0xb32a('0x42')]();logger[_0xb32a('0xb')]('index',_0x304edc);if(_0x339ddb){logger[_0xb32a('0xb')](_0xb32a('0x4a'),_0x339ddb);logger['info'](JSON[_0xb32a('0x23')](_0xd625b8[_0x304edc]));BPromise[_0xb32a('0x4b')]()[_0xb32a('0x27')](handleJob(_0xd625b8[_0x304edc]));logger[_0xb32a('0xb')](_0xb32a('0x4c'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc][_0xb32a('0x4d')]);}else if(_0xd625b8[_0x304edc][_0xb32a('0x4d')]&&_0xd625b8[_0x304edc][_0xb32a('0x4e')]&&moment()[_0xb32a('0x4f')](_0xd625b8[_0x304edc][_0xb32a('0x50')],_0xd625b8[_0x304edc][_0xb32a('0x51')])){manager[_0xb32a('0x52')](_0x304edc,_0xd625b8[_0x304edc][_0xb32a('0x4d')],handleJob(_0xd625b8[_0x304edc]));manager[_0xb32a('0x53')](_0x304edc);logger[_0xb32a('0xb')](_0xb32a('0x54'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc][_0xb32a('0x4d')]);}else if(manager['exists'](_0x304edc)){manager[_0xb32a('0x46')](_0x304edc);manager['deleteJob'](_0x304edc);logger[_0xb32a('0xb')](_0xb32a('0x55'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc]['cron']);}}for(_0x37855a=0x0,_0x304edc;_0x37855a<_0xef6b07[_0xb32a('0x49')]&&!_0x339ddb;_0x37855a+=0x1){_0x304edc=_0xef6b07[_0x37855a][_0xb32a('0x42')]();if(manager['exists'](_0x304edc)){if(_0xd625b8[_0x304edc][_0xb32a('0x4d')]&&_0xd625b8[_0x304edc][_0xb32a('0x4e')]&&moment()[_0xb32a('0x4f')](_0xd625b8[_0x304edc]['startAt'],_0xd625b8[_0x304edc]['endAt'])){manager[_0xb32a('0x56')](_0x304edc,_0xd625b8[_0x304edc][_0xb32a('0x4d')],handleJob(_0xd625b8[_0x304edc]));logger['info'](_0xb32a('0x57'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc][_0xb32a('0x4d')]);}else{manager['stop'](_0x304edc);manager[_0xb32a('0x47')](_0x304edc);logger[_0xb32a('0xb')]('stop\x20cron',_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc]['cron']);}}}})[_0xb32a('0x2a')](function(_0x4e6d75){logger[_0xb32a('0x28')](JSON[_0xb32a('0x23')](_0x4e6d75));});}exports[_0xb32a('0x58')]=function(_0x2549f0){return getJobs(_0x2549f0);};exports[_0xb32a('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index c60ecb6..f423552 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7035=['data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','language','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','Negative','Neutral','COMPLETED','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','SequelizeValidationError','start','lodash','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName'];(function(_0x5a343a,_0x1bc0d6){var _0x4ac690=function(_0x22ca27){while(--_0x22ca27){_0x5a343a['push'](_0x5a343a['shift']());}};_0x4ac690(++_0x1bc0d6);}(_0x7035,0x15e));var _0x5703=function(_0x252013,_0x1573c8){_0x252013=_0x252013-0x0;var _0x78560e=_0x7035[_0x252013];return _0x78560e;};var _=require(_0x5703('0x0'));var AWS=require('aws-sdk');var rp=require(_0x5703('0x1'));var util=require(_0x5703('0x2'));var BPromise=require('bluebird');var db=require(_0x5703('0x3'))['db'];var logger=require(_0x5703('0x4'))(_0x5703('0x5'));function getTranscriptionJob(_0x4d08f2,_0x7e0ebb,_0x5939bc,_0x37b0c8){return new Promise(function(_0x3fd6a6,_0x56df6c){var _0x2e2e90=new AWS[(_0x5703('0x6'))]({'accessKeyId':_0x7e0ebb,'secretAccessKey':_0x4d08f2,'region':_0x5939bc});_0x2e2e90[_0x5703('0x7')]({'TranscriptionJobName':_0x37b0c8},function(_0x291988,_0x1afe73){if(_0x291988){return _0x56df6c(_0x291988);}else{return _0x3fd6a6(_0x1afe73);}});});}function sentiment(_0x4690de,_0x58ca67,_0x58a04c,_0x169e83,_0x5775d8){return new Promise(function(_0x4f1db7,_0x5c36a5){var _0x522449=new AWS[(_0x5703('0x8'))]({'accessKeyId':_0x58ca67,'secretAccessKey':_0x4690de,'region':_0x58a04c});_0x522449[_0x5703('0x9')]({'Text':_0x169e83,'LanguageCode':_0x5775d8[_0x5703('0xa')](0x0,0x2)},function(_0x4c7efc,_0x33fba2){if(_0x4c7efc){return _0x5c36a5(_0x4c7efc);}else{return _0x4f1db7(_0x33fba2);}});});}function checkTranscribeJob(_0x4b39aa,_0x36b5b4,_0x360cc8){var _0x4868ad;return new BPromise(function(_0x29cf41,_0x30da0d){logger[_0x5703('0xb')](util[_0x5703('0xc')](_0x5703('0xd'),_0x4b39aa['id'],_0x4b39aa[_0x5703('0xe')]));return getTranscriptionJob(_0x360cc8[_0x5703('0xf')],_0x360cc8[_0x5703('0x10')],_0x36b5b4['transcribeRegion'],_0x4b39aa[_0x5703('0xe')])[_0x5703('0x11')](function(_0x46dbca){logger[_0x5703('0xb')](util[_0x5703('0xc')](_0x5703('0x12'),_0x4b39aa['id'],_0x4b39aa[_0x5703('0xe')],_0x46dbca[_0x5703('0x13')][_0x5703('0x14')]));if(!_0x4b39aa['fileText']){switch(_0x46dbca[_0x5703('0x13')][_0x5703('0x14')]){case'COMPLETED':var _0x579097={'transcribeStatus':_0x46dbca[_0x5703('0x13')][_0x5703('0x14')],'fileUri':_0x46dbca['TranscriptionJob'][_0x5703('0x15')]['TranscriptFileUri']};logger[_0x5703('0xb')](util[_0x5703('0xc')](_0x5703('0x16'),_0x4b39aa['id']));return rp({'uri':_0x46dbca[_0x5703('0x13')][_0x5703('0x15')][_0x5703('0x17')],'json':!![]})[_0x5703('0x11')](function(_0x4f5ebe){logger['info'](util[_0x5703('0xc')](_0x5703('0x18'),_0x4b39aa['id']));if(_0x4f5ebe&&_0x4f5ebe['results']&&_0x4f5ebe[_0x5703('0x19')][_0x5703('0x1a')]&&_0x4f5ebe['results'][_0x5703('0x1a')][_0x5703('0x1b')]){_0x579097[_0x5703('0x1c')]='';for(var _0x5e98e4=0x0;_0x5e98e4<_0x4f5ebe['results']['transcripts'][_0x5703('0x1b')];_0x5e98e4++){_0x579097['fileText']+=_0x4f5ebe[_0x5703('0x19')][_0x5703('0x1a')][_0x5e98e4][_0x5703('0x1d')]+'';}}return _0x4b39aa[_0x5703('0x1e')](_0x579097);})[_0x5703('0x11')](function(){logger['info'](util[_0x5703('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4b39aa['id']));if(!_0x4b39aa[_0x5703('0x1f')]){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x36b5b4[_0x5703('0x22')]||!_0x36b5b4[_0x5703('0x23')]||!_0x36b5b4['sentimentRegion']||!_0x36b5b4[_0x5703('0x24')]||!_0x36b5b4[_0x5703('0x25')]){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x579097['fileText']){throw new Error(_0x5703('0x26'));}if(_0x36b5b4[_0x5703('0x23')]===_0x360cc8['id']){return _0x360cc8;}else{return db[_0x5703('0x27')][_0x5703('0x28')]({'where':{'id':_settings[_0x5703('0x23')]}});}})[_0x5703('0x11')](function(_0x269f15){if(!_0x269f15){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))](_0x5703('0x29'));}if(!_0x269f15[_0x5703('0xf')]||!_0x269f15[_0x5703('0x10')]){throw new db[(_0x5703('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x4868ad=_0x269f15;logger['info'](util[_0x5703('0xc')](_0x5703('0x2a'),_0x4b39aa['id']));return sentiment(_0x4868ad[_0x5703('0xf')],_0x4868ad[_0x5703('0x10')],_0x36b5b4[_0x5703('0x2b')],_0x579097['fileText'],_0x36b5b4[_0x5703('0x24')]);})[_0x5703('0x11')](function(_0x13319d){logger['info'](util[_0x5703('0xc')](_0x5703('0x2c'),_0x4b39aa['id']));return _0x4b39aa[_0x5703('0x1e')]({'sentiment':_0x13319d[_0x5703('0x2d')],'sPositive':_0x13319d['SentimentScore'][_0x5703('0x2e')],'sNegative':_0x13319d[_0x5703('0x2f')]['Negative'],'sMixed':_0x13319d[_0x5703('0x2f')][_0x5703('0x30')],'sNeutral':_0x13319d[_0x5703('0x2f')]['Neutral']});})[_0x5703('0x11')](function(){logger['info'](util[_0x5703('0xc')](_0x5703('0x31'),_0x4b39aa['id']));_0x29cf41();});case _0x5703('0x32'):return _0x4b39aa[_0x5703('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x46dbca['TranscriptionJob'][_0x5703('0x33')]})[_0x5703('0x11')](function(){logger[_0x5703('0xb')](util[_0x5703('0xc')](_0x5703('0x31'),_0x4b39aa['id']));_0x29cf41();});default:logger['info'](util['format'](_0x5703('0x34'),_0x4b39aa['id']));break;}}else{return BPromise[_0x5703('0x35')]()[_0x5703('0x11')](function(){if(!_0x4b39aa[_0x5703('0x1f')]){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x36b5b4[_0x5703('0x22')]||!_0x36b5b4[_0x5703('0x23')]||!_0x36b5b4[_0x5703('0x2b')]||!_0x36b5b4[_0x5703('0x24')]||!_0x36b5b4[_0x5703('0x25')]){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))](_0x5703('0x36'));}if(!_0x4b39aa[_0x5703('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x36b5b4[_0x5703('0x23')]===_0x360cc8['id']){return _0x360cc8;}else{return db[_0x5703('0x27')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x25e948){if(!_0x25e948){throw new db[(_0x5703('0x20'))]['ValidationError'](_0x5703('0x29'));}if(!_0x25e948[_0x5703('0xf')]||!_0x25e948['data2']){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))](_0x5703('0x37'));}_0x4868ad=_0x25e948;logger[_0x5703('0xb')](util['format'](_0x5703('0x2a'),_0x4b39aa['id']));return sentiment(_0x4868ad[_0x5703('0xf')],_0x4868ad[_0x5703('0x10')],_0x36b5b4[_0x5703('0x2b')],_0x4b39aa[_0x5703('0x1c')],_0x36b5b4[_0x5703('0x24')]);})[_0x5703('0x11')](function(_0x49f198){logger[_0x5703('0xb')](util[_0x5703('0xc')](_0x5703('0x2c'),_0x4b39aa['id']));return _0x4b39aa[_0x5703('0x1e')]({'sentiment':_0x49f198[_0x5703('0x2d')],'sPositive':_0x49f198[_0x5703('0x2f')][_0x5703('0x2e')],'sNegative':_0x49f198[_0x5703('0x2f')][_0x5703('0x38')],'sMixed':_0x49f198[_0x5703('0x2f')]['Mixed'],'sNeutral':_0x49f198[_0x5703('0x2f')][_0x5703('0x39')],'transcribeStatus':_0x5703('0x3a')});})[_0x5703('0x11')](function(){logger[_0x5703('0xb')](util[_0x5703('0xc')](_0x5703('0x31'),_0x4b39aa['id']));_0x29cf41();});}})[_0x5703('0x3b')](function(_0xe384c){if(_0xe384c){if(!_0xe384c[_0x5703('0x3c')]||_0xe384c[_0x5703('0x3c')]!=='SequelizeValidationError'){logger[_0x5703('0x3d')](util['format'](_0x5703('0x3e'),_0x4b39aa['id']),util[_0x5703('0x3f')](_0xe384c,{'showHidden':![],'depth':null}));}}_0x29cf41();});});}function checkTranscribe(){var _0x10ba5d;var _0x17255f;var _0x162653;return db[_0x5703('0x40')][_0x5703('0x41')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x5703('0x11')](function(_0x5b1b99){if(!_0x5b1b99||!_0x5b1b99['length']){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))](_0x5703('0x42'));}_0x10ba5d=_0x5b1b99;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x5703('0x11')](function(_0x186c16){if(!_0x186c16){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))](_0x5703('0x43'));}_0x17255f=_0x186c16;if(!_0x17255f[_0x5703('0x5')]||!_0x17255f[_0x5703('0x44')]||!_0x17255f['transcribeRegion']||!_0x17255f['language']||!_0x17255f[_0x5703('0x25')]){throw new db[(_0x5703('0x20'))][(_0x5703('0x21'))](_0x5703('0x45'));}return db['CloudProvider'][_0x5703('0x28')]({'where':{'id':_0x17255f[_0x5703('0x44')]}});})[_0x5703('0x11')](function(_0x3a7d37){if(!_0x3a7d37){throw new db['Sequelize'][(_0x5703('0x21'))](_0x5703('0x29'));}if(!_0x3a7d37[_0x5703('0xf')]||!_0x3a7d37[_0x5703('0x10')]){throw new db[(_0x5703('0x20'))]['ValidationError'](_0x5703('0x37'));}_0x162653=_0x3a7d37;var _0x1323fb=[];_0x10ba5d[_0x5703('0x46')](function(_0x2b0b8b){_0x1323fb['push'](checkTranscribeJob(_0x2b0b8b,_0x17255f,_0x162653));});return BPromise['all'](_0x1323fb);})[_0x5703('0x3b')](function(_0x4dee78){if(_0x4dee78){if(!_0x4dee78['name']||_0x4dee78['name']!==_0x5703('0x47')){logger[_0x5703('0x3d')](util[_0x5703('0x3f')](_0x4dee78,{'showHidden':![],'depth':null}));}}});}exports[_0x5703('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x6c9f=['TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Positive','Negative','Mixed','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','length','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start','lodash','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6c9f,0x16a));var _0xf6c9=function(_0x3d9912,_0x5d4f2d){_0x3d9912=_0x3d9912-0x0;var _0x3ed887=_0x6c9f[_0x3d9912];return _0x3ed887;};var _=require(_0xf6c9('0x0'));var AWS=require('aws-sdk');var rp=require(_0xf6c9('0x1'));var util=require('util');var BPromise=require(_0xf6c9('0x2'));var db=require(_0xf6c9('0x3'))['db'];var logger=require(_0xf6c9('0x4'))(_0xf6c9('0x5'));function getTranscriptionJob(_0x1bb07c,_0x2e5222,_0x519365,_0x1e7f09){return new Promise(function(_0x1b92e6,_0x1de8c2){var _0x2abc04=new AWS[(_0xf6c9('0x6'))]({'accessKeyId':_0x2e5222,'secretAccessKey':_0x1bb07c,'region':_0x519365});_0x2abc04[_0xf6c9('0x7')]({'TranscriptionJobName':_0x1e7f09},function(_0x24901b,_0x105f16){if(_0x24901b){return _0x1de8c2(_0x24901b);}else{return _0x1b92e6(_0x105f16);}});});}function sentiment(_0x1e16cc,_0x521526,_0x3d93f7,_0x2a09aa,_0x311c11){return new Promise(function(_0x125b03,_0x475bff){var _0x3ac4d2=new AWS[(_0xf6c9('0x8'))]({'accessKeyId':_0x521526,'secretAccessKey':_0x1e16cc,'region':_0x3d93f7});_0x3ac4d2[_0xf6c9('0x9')]({'Text':_0x2a09aa,'LanguageCode':_0x311c11[_0xf6c9('0xa')](0x0,0x2)},function(_0x516298,_0x21923f){if(_0x516298){return _0x475bff(_0x516298);}else{return _0x125b03(_0x21923f);}});});}function checkTranscribeJob(_0x163f62,_0x1c5b31,_0x2f99db){var _0x564e64;return new BPromise(function(_0x5d7a24,_0x2eec37){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0xd'),_0x163f62['id'],_0x163f62[_0xf6c9('0xe')]));return getTranscriptionJob(_0x2f99db[_0xf6c9('0xf')],_0x2f99db['data2'],_0x1c5b31['transcribeRegion'],_0x163f62[_0xf6c9('0xe')])[_0xf6c9('0x10')](function(_0x5cb57e){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x11'),_0x163f62['id'],_0x163f62[_0xf6c9('0xe')],_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x13')]));if(!_0x163f62['fileText']){switch(_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x13')]){case _0xf6c9('0x14'):var _0x2ba234={'transcribeStatus':_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x13')],'fileUri':_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x15')][_0xf6c9('0x16')]};logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x17'),_0x163f62['id']));return rp({'uri':_0x5cb57e['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0xf6c9('0x10')](function(_0x4b2340){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x18'),_0x163f62['id']));if(_0x4b2340&&_0x4b2340['results']&&_0x4b2340[_0xf6c9('0x19')][_0xf6c9('0x1a')]&&_0x4b2340[_0xf6c9('0x19')][_0xf6c9('0x1a')]['length']){_0x2ba234[_0xf6c9('0x1b')]='';for(var _0x32870e=0x0;_0x32870e<_0x4b2340[_0xf6c9('0x19')][_0xf6c9('0x1a')]['length'];_0x32870e++){_0x2ba234[_0xf6c9('0x1b')]+=_0x4b2340['results']['transcripts'][_0x32870e][_0xf6c9('0x1c')]+'';}}return _0x163f62[_0xf6c9('0x1d')](_0x2ba234);})[_0xf6c9('0x10')](function(){logger['info'](util['format'](_0xf6c9('0x1e'),_0x163f62['id']));if(!_0x163f62[_0xf6c9('0x1f')]){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x22'));}if(!_0x1c5b31[_0xf6c9('0x23')]||!_0x1c5b31[_0xf6c9('0x24')]||!_0x1c5b31['sentimentRegion']||!_0x1c5b31[_0xf6c9('0x25')]||!_0x1c5b31['bucket']){throw new db['Sequelize'][(_0xf6c9('0x21'))](_0xf6c9('0x26'));}if(!_0x2ba234[_0xf6c9('0x1b')]){throw new Error(_0xf6c9('0x27'));}if(_0x1c5b31[_0xf6c9('0x24')]===_0x2f99db['id']){return _0x2f99db;}else{return db[_0xf6c9('0x28')][_0xf6c9('0x29')]({'where':{'id':_settings[_0xf6c9('0x24')]}});}})['then'](function(_0x450d80){if(!_0x450d80){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2a'));}if(!_0x450d80[_0xf6c9('0xf')]||!_0x450d80[_0xf6c9('0x2b')]){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2c'));}_0x564e64=_0x450d80;logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x2d'),_0x163f62['id']));return sentiment(_0x564e64[_0xf6c9('0xf')],_0x564e64['data2'],_0x1c5b31[_0xf6c9('0x2e')],_0x2ba234[_0xf6c9('0x1b')],_0x1c5b31[_0xf6c9('0x25')]);})[_0xf6c9('0x10')](function(_0x24ce84){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x2f'),_0x163f62['id']));return _0x163f62['update']({'sentiment':_0x24ce84[_0xf6c9('0x30')],'sPositive':_0x24ce84['SentimentScore']['Positive'],'sNegative':_0x24ce84[_0xf6c9('0x31')]['Negative'],'sMixed':_0x24ce84[_0xf6c9('0x31')]['Mixed'],'sNeutral':_0x24ce84[_0xf6c9('0x31')][_0xf6c9('0x32')]});})[_0xf6c9('0x10')](function(){logger['info'](util[_0xf6c9('0xc')](_0xf6c9('0x1e'),_0x163f62['id']));_0x5d7a24();});case _0xf6c9('0x33'):return _0x163f62[_0xf6c9('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x5cb57e[_0xf6c9('0x12')]['FailureReason']})[_0xf6c9('0x10')](function(){logger['info'](util[_0xf6c9('0xc')](_0xf6c9('0x1e'),_0x163f62['id']));_0x5d7a24();});default:logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x34'),_0x163f62['id']));break;}}else{return BPromise[_0xf6c9('0x35')]()['then'](function(){if(!_0x163f62[_0xf6c9('0x1f')]){throw new db[(_0xf6c9('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1c5b31[_0xf6c9('0x23')]||!_0x1c5b31['sentimentAccountId']||!_0x1c5b31[_0xf6c9('0x2e')]||!_0x1c5b31[_0xf6c9('0x25')]||!_0x1c5b31[_0xf6c9('0x36')]){throw new db['Sequelize'][(_0xf6c9('0x21'))](_0xf6c9('0x26'));}if(!_0x163f62['fileText']){throw new Error(_0xf6c9('0x27'));}if(_0x1c5b31['sentimentAccountId']===_0x2f99db['id']){return _0x2f99db;}else{return db[_0xf6c9('0x28')][_0xf6c9('0x29')]({'where':{'id':_settings[_0xf6c9('0x24')]}});}})[_0xf6c9('0x10')](function(_0x23b28b){if(!_0x23b28b){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2a'));}if(!_0x23b28b[_0xf6c9('0xf')]||!_0x23b28b[_0xf6c9('0x2b')]){throw new db[(_0xf6c9('0x20'))]['ValidationError'](_0xf6c9('0x2c'));}_0x564e64=_0x23b28b;logger['info'](util[_0xf6c9('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x163f62['id']));return sentiment(_0x564e64[_0xf6c9('0xf')],_0x564e64['data2'],_0x1c5b31[_0xf6c9('0x2e')],_0x163f62['fileText'],_0x1c5b31[_0xf6c9('0x25')]);})['then'](function(_0x4cd2b9){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x2f'),_0x163f62['id']));return _0x163f62[_0xf6c9('0x1d')]({'sentiment':_0x4cd2b9[_0xf6c9('0x30')],'sPositive':_0x4cd2b9[_0xf6c9('0x31')][_0xf6c9('0x37')],'sNegative':_0x4cd2b9['SentimentScore'][_0xf6c9('0x38')],'sMixed':_0x4cd2b9[_0xf6c9('0x31')][_0xf6c9('0x39')],'sNeutral':_0x4cd2b9[_0xf6c9('0x31')][_0xf6c9('0x32')],'transcribeStatus':_0xf6c9('0x14')});})['then'](function(){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x1e'),_0x163f62['id']));_0x5d7a24();});}})[_0xf6c9('0x3a')](function(_0x384bd2){if(_0x384bd2){if(!_0x384bd2[_0xf6c9('0x3b')]||_0x384bd2['name']!=='SequelizeValidationError'){logger[_0xf6c9('0x3c')](util[_0xf6c9('0xc')](_0xf6c9('0x3d'),_0x163f62['id']),util[_0xf6c9('0x3e')](_0x384bd2,{'showHidden':![],'depth':null}));}}_0x5d7a24();});});}function checkTranscribe(){var _0x13e50a;var _0x5cd665;var _0x5a62c4;return db[_0xf6c9('0x3f')][_0xf6c9('0x40')]({'where':{'transcribeStatus':_0xf6c9('0x41')}})[_0xf6c9('0x10')](function(_0x3006a6){if(!_0x3006a6||!_0x3006a6[_0xf6c9('0x42')]){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x43'));}_0x13e50a=_0x3006a6;return db['Setting'][_0xf6c9('0x29')]({'where':{'id':0x1}});})['then'](function(_0x38b410){if(!_0x38b410){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x44'));}_0x5cd665=_0x38b410;if(!_0x5cd665['transcribe']||!_0x5cd665[_0xf6c9('0x45')]||!_0x5cd665[_0xf6c9('0x46')]||!_0x5cd665['language']||!_0x5cd665[_0xf6c9('0x36')]){throw new db['Sequelize'][(_0xf6c9('0x21'))](_0xf6c9('0x47'));}return db[_0xf6c9('0x28')]['findOne']({'where':{'id':_0x5cd665[_0xf6c9('0x45')]}});})[_0xf6c9('0x10')](function(_0x490beb){if(!_0x490beb){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2a'));}if(!_0x490beb[_0xf6c9('0xf')]||!_0x490beb['data2']){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2c'));}_0x5a62c4=_0x490beb;var _0x1f7c9a=[];_0x13e50a['forEach'](function(_0x1bc77c){_0x1f7c9a[_0xf6c9('0x48')](checkTranscribeJob(_0x1bc77c,_0x5cd665,_0x5a62c4));});return BPromise[_0xf6c9('0x49')](_0x1f7c9a);})[_0xf6c9('0x3a')](function(_0x3abc4d){if(_0x3abc4d){if(!_0x3abc4d['name']||_0x3abc4d[_0xf6c9('0x3b')]!==_0xf6c9('0x4a')){logger[_0xf6c9('0x3c')](util['inspect'](_0x3abc4d,{'showHidden':![],'depth':null}));}}});}exports[_0xf6c9('0x4b')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index fa6ceb4..d10bd75 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ff5=['findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x9967e2,_0x534b75){_0x9967e2=_0x9967e2-0x0;var _0x1e45cc=_0x2ff5[_0x9967e2];return _0x1e45cc;};'use strict';var _=require('lodash');var moment=require(_0x52ff('0x0'));var Redis=require(_0x52ff('0x1'));var util=require('util');var config=require(_0x52ff('0x2'));var db=require(_0x52ff('0x3'))['db'];var logger=require(_0x52ff('0x4'))(_0x52ff('0x5'));config[_0x52ff('0x6')]=_[_0x52ff('0x7')](config['redis'],{'host':_0x52ff('0x8'),'port':0x18eb});var io=require(_0x52ff('0x9'))(new Redis(config[_0x52ff('0x6')]));function closeInteractions(){var _0x47e375=[];return db[_0x52ff('0xa')][_0x52ff('0xb')]({'raw':!![],'attributes':['id',_0x52ff('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x52ff('0xd')](0x18,_0x52ff('0xe'))}}})[_0x52ff('0xf')](function(_0x27c199){if(_0x27c199&&_0x27c199[_0x52ff('0x10')]){_0x47e375=_[_0x52ff('0x11')](_0x27c199||[],'id');logger[_0x52ff('0x12')](_0x52ff('0x13'),_0x47e375[_0x52ff('0x14')]());return db[_0x52ff('0xa')][_0x52ff('0x15')]({'closeReason':_0x52ff('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x47e375}});}})['then'](function(){if(_0x47e375&&_0x47e375[_0x52ff('0x10')]){logger['info'](_0x52ff('0x17'),_0x47e375[_0x52ff('0x14')]());for(var _0x5de1cc=0x0;_0x5de1cc<_0x47e375[_0x52ff('0x10')];_0x5de1cc++){io[_0x52ff('0x18')](_0x52ff('0x19'),{'id':_0x47e375[_0x5de1cc],'closed':!![]});}}})[_0x52ff('0x1a')](function(_0x418202){logger[_0x52ff('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x418202?util[_0x52ff('0x1c')](_0x418202,{'showHidden':![],'depth':null}):'');});}exports[_0x52ff('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdbed=['[WHATSAPP]\x20Interactions\x20to\x20close:','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','localhost','socket.io-emitter','redis','WhatsappInteraction','findAll','subtract','length','map','info'];(function(_0x10a0ab,_0x37b227){var _0x35f4c3=function(_0x22d405){while(--_0x22d405){_0x10a0ab['push'](_0x10a0ab['shift']());}};_0x35f4c3(++_0x37b227);}(_0xdbed,0xca));var _0xddbe=function(_0x5f5aea,_0x521da6){_0x5f5aea=_0x5f5aea-0x0;var _0x5dfb6c=_0xdbed[_0x5f5aea];return _0x5dfb6c;};'use strict';var _=require(_0xddbe('0x0'));var moment=require(_0xddbe('0x1'));var Redis=require(_0xddbe('0x2'));var util=require(_0xddbe('0x3'));var config=require('../../config/environment');var db=require(_0xddbe('0x4'))['db'];var logger=require('../logger')('schedule');config['redis']=_['defaults'](config['redis'],{'host':_0xddbe('0x5'),'port':0x18eb});var io=require(_0xddbe('0x6'))(new Redis(config[_0xddbe('0x7')]));function closeInteractions(){var _0x17addb=[];return db[_0xddbe('0x8')][_0xddbe('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xddbe('0xa')](0x18,'hours')}}})['then'](function(_0x13bb71){if(_0x13bb71&&_0x13bb71[_0xddbe('0xb')]){_0x17addb=_[_0xddbe('0xc')](_0x13bb71||[],'id');logger[_0xddbe('0xd')](_0xddbe('0xe'),_0x17addb['join']());return db['WhatsappInteraction']['update']({'closeReason':_0xddbe('0xf'),'disposition':_0xddbe('0x10'),'closed':!![],'closedAt':moment()[_0xddbe('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x17addb}});}})[_0xddbe('0x12')](function(){if(_0x17addb&&_0x17addb[_0xddbe('0xb')]){logger[_0xddbe('0xd')](_0xddbe('0x13'),_0x17addb[_0xddbe('0x14')]());for(var _0x425146=0x0;_0x425146<_0x17addb[_0xddbe('0xb')];_0x425146++){io[_0xddbe('0x15')](_0xddbe('0x16'),{'id':_0x17addb[_0x425146],'closed':!![]});}}})[_0xddbe('0x17')](function(_0x226522){logger['error'](_0xddbe('0x18'),_0x226522?util[_0xddbe('0x19')](_0x226522,{'showHidden':![],'depth':null}):'');});}exports[_0xddbe('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 47366c0..36d4706 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7b2=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x44bb2a,_0x234455){var _0x152f37=function(_0x598bed){while(--_0x598bed){_0x44bb2a['push'](_0x44bb2a['shift']());}};_0x152f37(++_0x234455);}(_0xb7b2,0x17f));var _0x2b7b=function(_0x164929,_0x5448b8){_0x164929=_0x164929-0x0;var _0x3ffbaf=_0xb7b2[_0x164929];return _0x3ffbaf;};'use strict';var util=require(_0x2b7b('0x0'));var db=require(_0x2b7b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2b7b('0x2')]({'id':i,'firstName':_0x2b7b('0x3')+i,'lastName':_0x2b7b('0x4')+i,'phone':0xf879fb460+i,'email':_0x2b7b('0x5')+i+_0x2b7b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x2b7b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2b7b('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2b7b('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x2b7b('0x4')+i,'phone':0xf879fb460+i,'email':_0x2b7b('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2b7b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x2b7b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2b7b('0x7')](),'updatedAt':Date[_0x2b7b('0x7')]()});}db[_0x2b7b('0x8')][_0x2b7b('0x9')]({'where':{}})[_0x2b7b('0xa')](function(){return db[_0x2b7b('0x8')][_0x2b7b('0xb')](contacts);})[_0x2b7b('0xa')](function(){console[_0x2b7b('0xc')](_0x2b7b('0xd'),_0x2b7b('0xe'));return db[_0x2b7b('0xf')][_0x2b7b('0x9')]({'where':{}});})[_0x2b7b('0xa')](function(){return db['CmHopper'][_0x2b7b('0xb')](hopper);})['then'](function(){console['log'](_0x2b7b('0xd'),_0x2b7b('0x10'));return db[_0x2b7b('0x8')]['bulkCreate'](contacts2);})[_0x2b7b('0xa')](function(){console[_0x2b7b('0xc')](_0x2b7b('0xd'),_0x2b7b('0x11'));return db[_0x2b7b('0xf')][_0x2b7b('0xb')](hopper2);})['then'](function(){console[_0x2b7b('0xc')]('finished\x20populating',_0x2b7b('0x12'));})[_0x2b7b('0x13')](function(_0x2b98d6){console[_0x2b7b('0xc')](_0x2b98d6);}); \ No newline at end of file +var _0xe2b5=['hopper2','catch','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','then','CmContact','log','finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','contacts2'];(function(_0x4c5f3b,_0x272103){var _0x2e2add=function(_0x37f4a8){while(--_0x37f4a8){_0x4c5f3b['push'](_0x4c5f3b['shift']());}};_0x2e2add(++_0x272103);}(_0xe2b5,0x17c));var _0x5e2b=function(_0x397c86,_0x24edb8){_0x397c86=_0x397c86-0x0;var _0x5c40c5=_0xe2b5[_0x397c86];return _0x5c40c5;};'use strict';var util=require('util');var db=require(_0x5e2b('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x5e2b('0x1')+i,'lastName':_0x5e2b('0x2')+i,'phone':0xf879fb460+i,'email':_0x5e2b('0x3')+i+_0x5e2b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5e2b('0x5')](),'updatedAt':Date[_0x5e2b('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5e2b('0x6')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5e2b('0x2')+i,'phone':0xf879fb460+i,'email':_0x5e2b('0x3')+i+_0x5e2b('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5e2b('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x5e2b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5e2b('0x5')](),'updatedAt':Date[_0x5e2b('0x5')]()});}db['CmContact']['destroy']({'where':{}})[_0x5e2b('0x7')](function(){return db[_0x5e2b('0x8')]['bulkCreate'](contacts);})[_0x5e2b('0x7')](function(){console[_0x5e2b('0x9')](_0x5e2b('0xa'),_0x5e2b('0xb'));return db[_0x5e2b('0xc')][_0x5e2b('0xd')]({'where':{}});})[_0x5e2b('0x7')](function(){return db[_0x5e2b('0xc')]['bulkCreate'](hopper);})[_0x5e2b('0x7')](function(){console['log'](_0x5e2b('0xa'),'hopper1');return db[_0x5e2b('0x8')][_0x5e2b('0xe')](contacts2);})[_0x5e2b('0x7')](function(){console[_0x5e2b('0x9')](_0x5e2b('0xa'),_0x5e2b('0xf'));return db['CmHopper']['bulkCreate'](hopper2);})[_0x5e2b('0x7')](function(){console[_0x5e2b('0x9')](_0x5e2b('0xa'),_0x5e2b('0x10'));})[_0x5e2b('0x11')](function(_0x45ee0d){console[_0x5e2b('0x9')](_0x45ee0d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 4c3060d..dd31c22 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd76b=['../mysqldb','push','%s%s','agent','format','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','log','catch','util'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xd76b,0x17b));var _0xbd76=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xd76b[_0x1928c9];return _0x51b5fb;};'use strict';var util=require(_0xbd76('0x0'));var db=require(_0xbd76('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbd76('0x2')]({'name':util['format'](_0xbd76('0x3'),_0xbd76('0x4'),i),'fullname':util[_0xbd76('0x5')](_0xbd76('0x3'),_0xbd76('0x4'),i),'email':util[_0xbd76('0x5')]('%s%s@xcally.com',_0xbd76('0x4'),i),'role':_0xbd76('0x4'),'password':_0xbd76('0x6'),'internal':0xfa0+i,'type':_0xbd76('0x7'),'transport':[_0xbd76('0x8'),'ws',_0xbd76('0x9')],'disallow':['all'],'allow':[_0xbd76('0xa')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0xbd76('0xb'),'avpf':'yes','force_avp':'yes','icesupport':_0xbd76('0xb'),'dtlsenable':_0xbd76('0xb'),'dtlsverify':'no','dtlscertfile':_0xbd76('0xc'),'dtlsprivatekey':_0xbd76('0xd'),'dtlssetup':_0xbd76('0xe'),'callerid':util[_0xbd76('0x5')](_0xbd76('0xf'),util['format'](_0xbd76('0x3'),_0xbd76('0x4'),i),0xfa0+i)});}db[_0xbd76('0x10')]['bulkCreate'](users)['then'](function(){console[_0xbd76('0x11')]('add\x20user');})[_0xbd76('0x12')](function(_0x4d08b0){console[_0xbd76('0x11')](_0x4d08b0);}); \ No newline at end of file +var _0xf2bf=['agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','util','../mysqldb','push','format','%s%s'];(function(_0x10566b,_0x2e11b4){var _0x11d34b=function(_0x2f93d4){while(--_0x2f93d4){_0x10566b['push'](_0x10566b['shift']());}};_0x11d34b(++_0x2e11b4);}(_0xf2bf,0x8e));var _0xff2b=function(_0x443ec0,_0x186140){_0x443ec0=_0x443ec0-0x0;var _0x227249=_0xf2bf[_0x443ec0];return _0x227249;};'use strict';var util=require(_0xff2b('0x0'));var db=require(_0xff2b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xff2b('0x2')]({'name':util[_0xff2b('0x3')](_0xff2b('0x4'),'agent',i),'fullname':util[_0xff2b('0x3')]('%s%s',_0xff2b('0x5'),i),'email':util[_0xff2b('0x3')](_0xff2b('0x6'),_0xff2b('0x5'),i),'role':_0xff2b('0x5'),'password':_0xff2b('0x7'),'internal':0xfa0+i,'type':_0xff2b('0x8'),'transport':[_0xff2b('0x9'),'ws',_0xff2b('0xa')],'disallow':[_0xff2b('0xb')],'allow':['ulaw'],'defaultuser':util[_0xff2b('0x3')](_0xff2b('0x4'),'agent',i),'encryption':_0xff2b('0xc'),'avpf':_0xff2b('0xc'),'force_avp':_0xff2b('0xc'),'icesupport':_0xff2b('0xc'),'dtlsenable':_0xff2b('0xc'),'dtlsverify':'no','dtlscertfile':_0xff2b('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xff2b('0xe'),'callerid':util[_0xff2b('0x3')](_0xff2b('0xf'),util[_0xff2b('0x3')]('%s%s','agent',i),0xfa0+i)});}db[_0xff2b('0x10')][_0xff2b('0x11')](users)[_0xff2b('0x12')](function(){console['log'](_0xff2b('0x13'));})[_0xff2b('0x14')](function(_0x356151){console['log'](_0x356151);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index cdb514a..6afd127 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6302=['find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','MailQueue','OpenchannelQueue','Campaign','voice:inbound','voice:outbound','FaxQueue','SmsQueue','WhatsappQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','util','bluebird','../mysqldb','./environment','User','agent','name','telephone','type','findOne','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','then','format','%s:queue:%s','Agents','user:%s','handshake','query'];(function(_0x4fde9a,_0x5d1eda){var _0x58f321=function(_0x278061){while(--_0x278061){_0x4fde9a['push'](_0x4fde9a['shift']());}};_0x58f321(++_0x5d1eda);}(_0x6302,0x109));var _0x2630=function(_0x3df951,_0x4acf56){_0x3df951=_0x3df951-0x0;var _0x53e2d1=_0x6302[_0x3df951];return _0x53e2d1;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var BPromise=require(_0x2630('0x1'));var db=require(_0x2630('0x2'))['db'];var config=require(_0x2630('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x2630('0x4')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x2630('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2630('0x6')],'where':{'role':_0x2630('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2630('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x2630('0x6')],'where':{'role':_0x2630('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2630('0x6'),_0x2630('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x5cd6c3,_0x1fed40,_0x10ffdf){return db['UserProfileSection'][_0x2630('0x9')]({'where':{'name':_0x5cd6c3,'userProfileId':_0x1fed40},'raw':!![]})['then'](function(_0x1d1b18){if(_0x1d1b18){if(_0x1d1b18['autoAssociation']){switch(_0x5cd6c3){case _0x2630('0xa'):case _0x2630('0xb'):case _0x2630('0xc'):case _0x2630('0xd'):case _0x2630('0xe'):case _0x2630('0xf'):case'WhatsappQueues':return db[_0x10ffdf][_0x2630('0x10')](queryQueues);case _0x2630('0x11'):return db[_0x10ffdf][_0x2630('0x10')](queryTelephones);case _0x2630('0x12'):return db[_0x10ffdf]['findAll'](queryTrunks);case _0x2630('0x13'):return db[_0x10ffdf][_0x2630('0x10')](queryCampaigns);}}else{return db[_0x2630('0x14')]['findAll']({'attributes':[_0x2630('0x15')],'where':{'sectionId':_0x1d1b18['id']},'raw':!![]})['then'](function(_0x1e4731){if(_0x1e4731){var _0x37c8d7={'where':{'id':_[_0x2630('0x16')](_0x1e4731,_0x2630('0x15'))},'raw':!![]};switch(_0x10ffdf){case _0x2630('0x4'):_0x37c8d7[_0x2630('0x17')][_0x2630('0x18')]=_0x2630('0x7');break;case'Campaign':_0x37c8d7[_0x2630('0x17')]['type']='ivr';break;}return db[_0x10ffdf]['findAll'](_0x37c8d7);}else{return[];}});}}else{return[];}})[_0x2630('0x19')](function(_0xa4f917){return _0xa4f917;});}function joinOrLeaveQueues(_0x1fd31c,_0x7c443c,_0x1c292c,_0x7ec957){_0x1fd31c[_0x7c443c](util[_0x2630('0x1a')](_0x2630('0x1b'),_0x1c292c,_0x7ec957[_0x2630('0x6')]));if(_0x7ec957[_0x2630('0x1c')]){for(var _0x713af1=0x0;_0x713af1<_0x7ec957[_0x2630('0x1c')]['length'];_0x713af1+=0x1){_0x1fd31c[_0x7c443c](util['format'](_0x2630('0x1d'),_0x7ec957[_0x2630('0x1c')][_0x713af1]['name']));}}}function joinOrLeave(_0x23049c,_0x5c67b7,_0x452a9c){var _0x3d303a;if(_0x23049c[_0x2630('0x1e')][_0x2630('0x1f')]['id']){db['User'][_0x2630('0x20')]({'attributes':['id',_0x2630('0x6'),_0x2630('0x18'),_0x2630('0x21')],'where':{'id':_0x23049c[_0x2630('0x1e')][_0x2630('0x1f')]['id']},'include':[{'model':db[_0x2630('0x22')],'as':_0x2630('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2630('0x24')],'as':_0x2630('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x2630('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2630('0x27')],'as':_0x2630('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x2630('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x2630('0x19')](function(_0x4ad461){if(_0x4ad461){_0x3d303a=_0x4ad461;_0x23049c[_0x5c67b7](util[_0x2630('0x1a')]('user:%s',_0x4ad461[_0x2630('0x6')]));var _0x176f1b=[];switch(_0x4ad461['role']){case _0x2630('0x2a'):_0x23049c[_0x5c67b7]('voice:inbound');_0x23049c[_0x5c67b7]('voice:outbound');if(queryQueues[_0x2630('0x2b')](_0x2630('0x2c'))){delete queryQueues['include'];}_0x176f1b[_0x2630('0x2d')](db[_0x2630('0x2e')][_0x2630('0x10')](queryQueues));_0x176f1b[_0x2630('0x2d')](db[_0x2630('0x2f')][_0x2630('0x10')](queryQueues));_0x176f1b[_0x2630('0x2d')](db['FaxQueue'][_0x2630('0x10')](queryQueues));_0x176f1b[_0x2630('0x2d')](db['SmsQueue'][_0x2630('0x10')](queryQueues));_0x176f1b['push'](db[_0x2630('0x30')]['findAll'](queryQueues));_0x176f1b['push'](db[_0x2630('0x31')][_0x2630('0x10')](queryQueues));_0x176f1b[_0x2630('0x2d')](db['WhatsappQueue'][_0x2630('0x10')](queryQueues));_0x176f1b[_0x2630('0x2d')](db['User'][_0x2630('0x10')](queryTelephones));_0x176f1b[_0x2630('0x2d')](db['Trunk'][_0x2630('0x10')](queryTrunks));_0x176f1b['push'](db[_0x2630('0x32')][_0x2630('0x10')](queryCampaigns));_0x176f1b['push'](db[_0x2630('0x4')][_0x2630('0x10')](queryAgents));break;case'user':_0x23049c[_0x5c67b7](_0x2630('0x33'));_0x23049c[_0x5c67b7](_0x2630('0x34'));_0x176f1b[_0x2630('0x2d')](getAssociatedResources(_0x2630('0xa'),_0x4ad461[_0x2630('0x21')],_0x2630('0x2e')));_0x176f1b[_0x2630('0x2d')](getAssociatedResources(_0x2630('0xb'),_0x4ad461[_0x2630('0x21')],'ChatQueue'));_0x176f1b[_0x2630('0x2d')](getAssociatedResources('FaxQueues',_0x4ad461[_0x2630('0x21')],_0x2630('0x35')));_0x176f1b[_0x2630('0x2d')](getAssociatedResources(_0x2630('0xd'),_0x4ad461[_0x2630('0x21')],_0x2630('0x36')));_0x176f1b['push'](getAssociatedResources(_0x2630('0xe'),_0x4ad461[_0x2630('0x21')],'MailQueue'));_0x176f1b['push'](getAssociatedResources(_0x2630('0xf'),_0x4ad461['userProfileId'],_0x2630('0x31')));_0x176f1b[_0x2630('0x2d')](getAssociatedResources(_0x2630('0x37'),_0x4ad461['userProfileId'],_0x2630('0x38')));_0x176f1b[_0x2630('0x2d')](getAssociatedResources('Telephones',_0x4ad461['userProfileId'],_0x2630('0x4')));_0x176f1b[_0x2630('0x2d')](getAssociatedResources(_0x2630('0x12'),_0x4ad461[_0x2630('0x21')],'Trunk'));_0x176f1b[_0x2630('0x2d')](getAssociatedResources(_0x2630('0x13'),_0x4ad461[_0x2630('0x21')],_0x2630('0x32')));_0x176f1b[_0x2630('0x2d')](db[_0x2630('0x4')][_0x2630('0x10')](queryAgents));break;case'agent':_0x23049c[_0x5c67b7](_0x2630('0x33'));_0x23049c[_0x5c67b7](_0x2630('0x34'));_0x176f1b[_0x2630('0x2d')](_0x4ad461[_0x2630('0x39')]({'attributes':['id',_0x2630('0x6')]}));_0x176f1b[_0x2630('0x2d')](_0x4ad461[_0x2630('0x3a')]({'attributes':['id',_0x2630('0x6')]}));_0x176f1b['push'](_0x4ad461['getFaxQueues']({'attributes':['id',_0x2630('0x6')]}));_0x176f1b[_0x2630('0x2d')](_0x4ad461[_0x2630('0x3b')]({'attributes':['id',_0x2630('0x6')]}));_0x176f1b[_0x2630('0x2d')](_0x4ad461['getMailQueues']({'attributes':['id',_0x2630('0x6')]}));_0x176f1b['push'](_0x4ad461[_0x2630('0x3c')]({'attributes':['id','name']}));_0x176f1b[_0x2630('0x2d')](_0x4ad461[_0x2630('0x3d')]({'attributes':['id',_0x2630('0x6')]}));break;}return BPromise[_0x2630('0x3e')](_0x176f1b);}})[_0x2630('0x19')](function(_0xbdf0bc){if(_0xbdf0bc&&_0xbdf0bc[_0x2630('0x3f')]){for(var _0x89f794=0x0;_0x89f794<_0xbdf0bc['length'];_0x89f794+=0x1){for(var _0x395e2e=0x0;_0x395e2e<_0xbdf0bc[_0x89f794][_0x2630('0x3f')];_0x395e2e+=0x1){switch(_0x89f794){case 0x0:joinOrLeaveQueues(_0x23049c,_0x5c67b7,_0x2630('0x40'),_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x1:joinOrLeaveQueues(_0x23049c,_0x5c67b7,_0x2630('0x41'),_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x2:joinOrLeaveQueues(_0x23049c,_0x5c67b7,'fax',_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x3:joinOrLeaveQueues(_0x23049c,_0x5c67b7,_0x2630('0x42'),_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x4:joinOrLeaveQueues(_0x23049c,_0x5c67b7,_0x2630('0x43'),_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x5:joinOrLeaveQueues(_0x23049c,_0x5c67b7,'openchannel',_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x6:joinOrLeaveQueues(_0x23049c,_0x5c67b7,'whatsapp',_0xbdf0bc[_0x89f794][_0x395e2e]);break;case 0x7:if(_0x3d303a[_0x2630('0x18')]!==_0x2630('0x5'))_0x23049c[_0x5c67b7](util['format'](_0x2630('0x44'),_0xbdf0bc[_0x89f794][_0x395e2e][_0x2630('0x6')]));break;case 0x8:if(_0x3d303a[_0x2630('0x18')]!=='agent')_0x23049c[_0x5c67b7](util[_0x2630('0x1a')](_0x2630('0x45'),_0xbdf0bc[_0x89f794][_0x395e2e]['name']));break;case 0x9:if(_0x3d303a['role']!=='agent')_0x23049c[_0x5c67b7](util[_0x2630('0x1a')](_0x2630('0x46'),_0xbdf0bc[_0x89f794][_0x395e2e]['type'],_0xbdf0bc[_0x89f794][_0x395e2e][_0x2630('0x6')]));break;case 0xa:_0x23049c[_0x5c67b7](util[_0x2630('0x1a')]('user:%s',_0xbdf0bc[_0x89f794][_0x395e2e][_0x2630('0x6')]));break;}}}}})[_0x2630('0x19')](function(){if(_0x5c67b7===_0x2630('0x47')){var _0x13ebb7=_[_0x2630('0x16')](_0x3d303a[_0x2630('0x23')],'id');return _0x3d303a[_0x2630('0x48')](_0x13ebb7)[_0x2630('0x19')](function(){for(var _0x31c70e=0x0;_0x31c70e<_0x13ebb7[_0x2630('0x3f')];_0x31c70e+=0x1){_0x452a9c[_0x2630('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x13ebb7[_0x31c70e]),'UserId':Number(_0x3d303a['id'])});}});}})['then'](function(){if(_0x5c67b7===_0x2630('0x47')){var _0x38822e=_['map'](_0x3d303a[_0x2630('0x4a')],'id');return _0x3d303a[_0x2630('0x4b')](_0x38822e)[_0x2630('0x19')](function(){for(var _0xbfc6ee=0x0;_0xbfc6ee<_0x38822e[_0x2630('0x3f')];_0xbfc6ee+=0x1){_0x452a9c[_0x2630('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x38822e[_0xbfc6ee]),'UserId':Number(_0x3d303a['id'])});}});}})[_0x2630('0x19')](function(){if(_0x5c67b7==='leave'){var _0x5cb234=_[_0x2630('0x16')](_0x3d303a['FaxInteractions'],'id');return _0x3d303a[_0x2630('0x4c')](_0x5cb234)[_0x2630('0x19')](function(){for(var _0x4b4509=0x0;_0x4b4509<_0x5cb234[_0x2630('0x3f')];_0x4b4509+=0x1){_0x452a9c[_0x2630('0x49')](_0x2630('0x4d'),{'FaxInteractionId':Number(_0x5cb234[_0x4b4509]),'UserId':Number(_0x3d303a['id'])});}});}})[_0x2630('0x19')](function(){if(_0x5c67b7===_0x2630('0x47')){var _0x394ab7=_[_0x2630('0x16')](_0x3d303a[_0x2630('0x4e')],'id');return _0x3d303a[_0x2630('0x4f')](_0x394ab7)[_0x2630('0x19')](function(){for(var _0x295c96=0x0;_0x295c96<_0x394ab7['length'];_0x295c96+=0x1){_0x452a9c[_0x2630('0x49')](_0x2630('0x50'),{'SmsInteractionId':Number(_0x394ab7[_0x295c96]),'UserId':Number(_0x3d303a['id'])});}});}})[_0x2630('0x19')](function(){if(_0x5c67b7===_0x2630('0x47')){var _0x39271d=_[_0x2630('0x16')](_0x3d303a[_0x2630('0x28')],'id');return _0x3d303a['removeOpenchannelInteractions'](_0x39271d)[_0x2630('0x19')](function(){for(var _0x2479d0=0x0;_0x2479d0<_0x39271d[_0x2630('0x3f')];_0x2479d0+=0x1){_0x452a9c['emit'](_0x2630('0x51'),{'OpenchannelInteractionId':Number(_0x39271d[_0x2479d0]),'UserId':Number(_0x3d303a['id'])});}});}})[_0x2630('0x19')](function(){if(_0x5c67b7===_0x2630('0x47')){var _0x44b364=_[_0x2630('0x16')](_0x3d303a[_0x2630('0x52')],'id');return _0x3d303a[_0x2630('0x53')](_0x44b364)['then'](function(){for(var _0x61fcca=0x0;_0x61fcca<_0x44b364[_0x2630('0x3f')];_0x61fcca+=0x1){_0x452a9c[_0x2630('0x49')](_0x2630('0x54'),{'WhatsappInteractionId':Number(_0x44b364[_0x61fcca]),'UserId':Number(_0x3d303a['id'])});}});}})[_0x2630('0x55')](function(_0x4dde00){_0x23049c[_0x2630('0x56')](_0x4dde00);});}}function onDisconnect(_0x466e4b,_0x398aed){joinOrLeave(_0x466e4b,_0x2630('0x47'),_0x398aed);}function onConnect(_0xf84e83){joinOrLeave(_0xf84e83,_0x2630('0x57'));}exports['default']=function(_0x28d7ca){_0x28d7ca['on'](_0x2630('0x58'),function(_0x508470){_0x508470[_0x2630('0x59')](0x0);_0x508470[_0x2630('0x5a')]=_0x508470[_0x2630('0x5b')][_0x2630('0x58')][_0x2630('0x5c')]+':'+_0x508470[_0x2630('0x5b')][_0x2630('0x58')][_0x2630('0x5d')];_0x508470[_0x2630('0x5e')]=new Date();_0x508470['log']=function(_0x42e88c){console[_0x2630('0x56')](_0x2630('0x5f')+_0x508470[_0x2630('0x60')]['name']+'['+_0x508470[_0x2630('0x5a')]+']',_0x42e88c);};_0x508470['on'](_0x2630('0x61'),function(){onDisconnect(_0x508470,_0x28d7ca);_0x508470[_0x2630('0x56')]('DISCONNECTED');});onConnect(_0x508470);_0x508470[_0x2630('0x56')](_0x2630('0x62'));});}; \ No newline at end of file +var _0xf9b7=['WhatsappQueue','user','VoiceQueues','FaxQueues','SmsQueue','Telephones','Trunks','Trunk','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','catch','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','nsp','address','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','UserProfileSection','findOne','autoAssociation','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','then','map','where','role','Campaign','length','format','user:%s','find','userProfileId','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0xf9b7,0x91));var _0x7f9b=function(_0x11683e,_0x460a93){_0x11683e=_0x11683e-0x0;var _0x1c32ff=_0xf9b7[_0x11683e];return _0x1c32ff;};'use strict';var _=require(_0x7f9b('0x0'));var util=require(_0x7f9b('0x1'));var BPromise=require(_0x7f9b('0x2'));var db=require(_0x7f9b('0x3'))['db'];var config=require(_0x7f9b('0x4'));var queryQueues={'attributes':['id',_0x7f9b('0x5')],'include':[{'as':_0x7f9b('0x6'),'model':db[_0x7f9b('0x7')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x7f9b('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7f9b('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7f9b('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7f9b('0x5'),_0x7f9b('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x52bbf1,_0x5251d0,_0x19c186){return db[_0x7f9b('0xb')][_0x7f9b('0xc')]({'where':{'name':_0x52bbf1,'userProfileId':_0x5251d0},'raw':!![]})['then'](function(_0x1c8e07){if(_0x1c8e07){if(_0x1c8e07[_0x7f9b('0xd')]){switch(_0x52bbf1){case'VoiceQueues':case _0x7f9b('0xe'):case'FaxQueues':case _0x7f9b('0xf'):case _0x7f9b('0x10'):case _0x7f9b('0x11'):case _0x7f9b('0x12'):return db[_0x19c186][_0x7f9b('0x13')](queryQueues);case'Telephones':return db[_0x19c186][_0x7f9b('0x13')](queryTelephones);case'Trunks':return db[_0x19c186][_0x7f9b('0x13')](queryTrunks);case _0x7f9b('0x14'):return db[_0x19c186][_0x7f9b('0x13')](queryCampaigns);}}else{return db[_0x7f9b('0x15')][_0x7f9b('0x13')]({'attributes':[_0x7f9b('0x16')],'where':{'sectionId':_0x1c8e07['id']},'raw':!![]})[_0x7f9b('0x17')](function(_0x2ba158){if(_0x2ba158){var _0x447255={'where':{'id':_[_0x7f9b('0x18')](_0x2ba158,_0x7f9b('0x16'))},'raw':!![]};switch(_0x19c186){case _0x7f9b('0x7'):_0x447255[_0x7f9b('0x19')][_0x7f9b('0x1a')]='telephone';break;case _0x7f9b('0x1b'):_0x447255['where'][_0x7f9b('0xa')]='ivr';break;}return db[_0x19c186][_0x7f9b('0x13')](_0x447255);}else{return[];}});}}else{return[];}})['then'](function(_0x5c2e23){return _0x5c2e23;});}function joinOrLeaveQueues(_0x5cec50,_0x269763,_0x5f3d29,_0x200b31){_0x5cec50[_0x269763](util['format']('%s:queue:%s',_0x5f3d29,_0x200b31[_0x7f9b('0x5')]));if(_0x200b31[_0x7f9b('0x6')]){for(var _0x318203=0x0;_0x318203<_0x200b31['Agents'][_0x7f9b('0x1c')];_0x318203+=0x1){_0x5cec50[_0x269763](util[_0x7f9b('0x1d')](_0x7f9b('0x1e'),_0x200b31['Agents'][_0x318203][_0x7f9b('0x5')]));}}}function joinOrLeave(_0x46eb86,_0x25b6ac,_0x28d6de){var _0x38e7d6;if(_0x46eb86['handshake']['query']['id']){db[_0x7f9b('0x7')][_0x7f9b('0x1f')]({'attributes':['id','name',_0x7f9b('0x1a'),_0x7f9b('0x20')],'where':{'id':_0x46eb86[_0x7f9b('0x21')][_0x7f9b('0x22')]['id']},'include':[{'model':db[_0x7f9b('0x23')],'as':_0x7f9b('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x26')],'as':_0x7f9b('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x28')],'as':_0x7f9b('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x2a')],'as':_0x7f9b('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0xe72154){if(_0xe72154){_0x38e7d6=_0xe72154;_0x46eb86[_0x25b6ac](util[_0x7f9b('0x1d')]('user:%s',_0xe72154[_0x7f9b('0x5')]));var _0x5d5e47=[];switch(_0xe72154['role']){case'admin':_0x46eb86[_0x25b6ac](_0x7f9b('0x2c'));_0x46eb86[_0x25b6ac](_0x7f9b('0x2d'));if(queryQueues[_0x7f9b('0x2e')](_0x7f9b('0x2f'))){delete queryQueues[_0x7f9b('0x2f')];}_0x5d5e47[_0x7f9b('0x30')](db['VoiceQueue'][_0x7f9b('0x13')](queryQueues));_0x5d5e47['push'](db[_0x7f9b('0x31')][_0x7f9b('0x13')](queryQueues));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x32')][_0x7f9b('0x13')](queryQueues));_0x5d5e47['push'](db['SmsQueue']['findAll'](queryQueues));_0x5d5e47['push'](db[_0x7f9b('0x33')][_0x7f9b('0x13')](queryQueues));_0x5d5e47['push'](db[_0x7f9b('0x34')][_0x7f9b('0x13')](queryQueues));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x35')][_0x7f9b('0x13')](queryQueues));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x7')]['findAll'](queryTelephones));_0x5d5e47['push'](db['Trunk'][_0x7f9b('0x13')](queryTrunks));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x1b')][_0x7f9b('0x13')](queryCampaigns));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x7')][_0x7f9b('0x13')](queryAgents));break;case _0x7f9b('0x36'):_0x46eb86[_0x25b6ac]('voice:inbound');_0x46eb86[_0x25b6ac](_0x7f9b('0x2d'));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x37'),_0xe72154[_0x7f9b('0x20')],'VoiceQueue'));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0xe'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x31')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x38'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x32')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0xf'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x39')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources('MailQueues',_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x33')));_0x5d5e47['push'](getAssociatedResources(_0x7f9b('0x11'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x34')));_0x5d5e47['push'](getAssociatedResources('WhatsappQueues',_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x35')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x3a'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x7')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x3b'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x3c')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x14'),_0xe72154['userProfileId'],_0x7f9b('0x1b')));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x7')][_0x7f9b('0x13')](queryAgents));break;case'agent':_0x46eb86[_0x25b6ac](_0x7f9b('0x2c'));_0x46eb86[_0x25b6ac](_0x7f9b('0x2d'));_0x5d5e47['push'](_0xe72154[_0x7f9b('0x3d')]({'attributes':['id','name']}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x3e')]({'attributes':['id','name']}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154['getFaxQueues']({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47['push'](_0xe72154['getSmsQueues']({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x3f')]({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x40')]({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x41')]({'attributes':['id',_0x7f9b('0x5')]}));break;}return BPromise['all'](_0x5d5e47);}})[_0x7f9b('0x17')](function(_0x59d6de){if(_0x59d6de&&_0x59d6de[_0x7f9b('0x1c')]){for(var _0x19329c=0x0;_0x19329c<_0x59d6de['length'];_0x19329c+=0x1){for(var _0x4e76f8=0x0;_0x4e76f8<_0x59d6de[_0x19329c][_0x7f9b('0x1c')];_0x4e76f8+=0x1){switch(_0x19329c){case 0x0:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x42'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x1:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x43'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x2:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,'fax',_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x3:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,'sms',_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x4:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x44'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x5:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x45'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x6:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,'whatsapp',_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x7:if(_0x38e7d6[_0x7f9b('0x1a')]!==_0x7f9b('0x8'))_0x46eb86[_0x25b6ac](util[_0x7f9b('0x1d')](_0x7f9b('0x46'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0x5')]));break;case 0x8:if(_0x38e7d6[_0x7f9b('0x1a')]!==_0x7f9b('0x8'))_0x46eb86[_0x25b6ac](util[_0x7f9b('0x1d')](_0x7f9b('0x47'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0x5')]));break;case 0x9:if(_0x38e7d6[_0x7f9b('0x1a')]!==_0x7f9b('0x8'))_0x46eb86[_0x25b6ac](util['format'](_0x7f9b('0x48'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0xa')],_0x59d6de[_0x19329c][_0x4e76f8]['name']));break;case 0xa:_0x46eb86[_0x25b6ac](util['format'](_0x7f9b('0x1e'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0x5')]));break;}}}}})[_0x7f9b('0x17')](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x298c40=_['map'](_0x38e7d6['ChatInteractions'],'id');return _0x38e7d6[_0x7f9b('0x4a')](_0x298c40)['then'](function(){for(var _0x175388=0x0;_0x175388<_0x298c40[_0x7f9b('0x1c')];_0x175388+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x4c'),{'ChatInteractionId':Number(_0x298c40[_0x175388]),'UserId':Number(_0x38e7d6['id'])});}});}})['then'](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x1d7551=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x4d')],'id');return _0x38e7d6['removeMailInteractions'](_0x1d7551)[_0x7f9b('0x17')](function(){for(var _0x3f7837=0x0;_0x3f7837<_0x1d7551[_0x7f9b('0x1c')];_0x3f7837+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x4e'),{'MailInteractionId':Number(_0x1d7551[_0x3f7837]),'UserId':Number(_0x38e7d6['id'])});}});}})['then'](function(){if(_0x25b6ac==='leave'){var _0x5a818c=_[_0x7f9b('0x18')](_0x38e7d6['FaxInteractions'],'id');return _0x38e7d6[_0x7f9b('0x4f')](_0x5a818c)[_0x7f9b('0x17')](function(){for(var _0x4ba113=0x0;_0x4ba113<_0x5a818c['length'];_0x4ba113+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x50'),{'FaxInteractionId':Number(_0x5a818c[_0x4ba113]),'UserId':Number(_0x38e7d6['id'])});}});}})[_0x7f9b('0x17')](function(){if(_0x25b6ac==='leave'){var _0x6496f0=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x29')],'id');return _0x38e7d6[_0x7f9b('0x51')](_0x6496f0)[_0x7f9b('0x17')](function(){for(var _0xb0d9b2=0x0;_0xb0d9b2<_0x6496f0[_0x7f9b('0x1c')];_0xb0d9b2+=0x1){_0x28d6de['emit'](_0x7f9b('0x52'),{'SmsInteractionId':Number(_0x6496f0[_0xb0d9b2]),'UserId':Number(_0x38e7d6['id'])});}});}})[_0x7f9b('0x17')](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x51d3d=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x2b')],'id');return _0x38e7d6[_0x7f9b('0x53')](_0x51d3d)['then'](function(){for(var _0x1cdc78=0x0;_0x1cdc78<_0x51d3d[_0x7f9b('0x1c')];_0x1cdc78+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x54'),{'OpenchannelInteractionId':Number(_0x51d3d[_0x1cdc78]),'UserId':Number(_0x38e7d6['id'])});}});}})['then'](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x2956e2=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x55')],'id');return _0x38e7d6['removeWhatsappInteractions'](_0x2956e2)[_0x7f9b('0x17')](function(){for(var _0x588b22=0x0;_0x588b22<_0x2956e2[_0x7f9b('0x1c')];_0x588b22+=0x1){_0x28d6de['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2956e2[_0x588b22]),'UserId':Number(_0x38e7d6['id'])});}});}})[_0x7f9b('0x56')](function(_0x1a9268){_0x46eb86[_0x7f9b('0x57')](_0x1a9268);});}}function onDisconnect(_0xdf7724,_0x3556ab){joinOrLeave(_0xdf7724,_0x7f9b('0x49'),_0x3556ab);}function onConnect(_0x172525){joinOrLeave(_0x172525,_0x7f9b('0x58'));}exports['default']=function(_0x29b125){_0x29b125['on'](_0x7f9b('0x59'),function(_0x321b58){_0x321b58[_0x7f9b('0x5a')](0x0);_0x321b58['address']=_0x321b58[_0x7f9b('0x5b')][_0x7f9b('0x59')][_0x7f9b('0x5c')]+':'+_0x321b58[_0x7f9b('0x5b')][_0x7f9b('0x59')][_0x7f9b('0x5d')];_0x321b58['connectedAt']=new Date();_0x321b58['log']=function(_0x2a0376){console[_0x7f9b('0x57')](_0x7f9b('0x5e')+_0x321b58[_0x7f9b('0x5f')][_0x7f9b('0x5')]+'['+_0x321b58[_0x7f9b('0x60')]+']',_0x2a0376);};_0x321b58['on']('disconnect',function(){onDisconnect(_0x321b58,_0x29b125);_0x321b58['log'](_0x7f9b('0x61'));});onConnect(_0x321b58);_0x321b58['log'](_0x7f9b('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e6cf585..ac3c325 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x023c=['Sequelize','QueryTypes','SELECT','then','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','event','AfterCreate','changed','closed','substatus','AfterUpdate','User','fullname','email','internal','default','length','hasOwnProperty','model','hook','toLowerCase','util','jayson/promise','../logger','client','http','ChatInteraction','newinteraction','afterUpdate','ChatMessage','afterCreate','newmessage','Chat','Sms','closedinteraction','SmsMessage','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','info','Trigger,\x20%s','error','catch','get','channel','motionChannel','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query'];(function(_0x350650,_0x3ea848){var _0x53ff02=function(_0x872dbf){while(--_0x872dbf){_0x350650['push'](_0x350650['shift']());}};_0x53ff02(++_0x3ea848);}(_0x023c,0x65));var _0xc023=function(_0x180e57,_0x393367){_0x180e57=_0x180e57-0x0;var _0x3392a8=_0x023c[_0x180e57];return _0x3392a8;};'use strict';var util=require(_0xc023('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc023('0x1'));var logger=require(_0xc023('0x2'))('triggers');var client=jayson[_0xc023('0x3')][_0xc023('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xc023('0x5'),'event':'afterCreate','condition':_0xc023('0x6'),'callback':afterCreate},{'channel':'Chat','model':_0xc023('0x5'),'event':_0xc023('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0xc023('0x8'),'event':_0xc023('0x9'),'condition':_0xc023('0xa'),'callback':afterCreateMessage},{'channel':_0xc023('0xb'),'model':'ChatOfflineMessage','event':_0xc023('0x9'),'condition':_0xc023('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xc023('0xc'),'model':'SmsInteraction','event':'afterCreate','condition':_0xc023('0x6'),'callback':afterCreate},{'channel':_0xc023('0xc'),'model':'SmsInteraction','event':_0xc023('0x7'),'condition':_0xc023('0xd'),'callback':afterUpdate},{'channel':_0xc023('0xc'),'model':_0xc023('0xe'),'event':_0xc023('0x9'),'condition':_0xc023('0xa'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xc023('0xf'),'event':_0xc023('0x9'),'condition':_0xc023('0x6'),'callback':afterCreate},{'channel':_0xc023('0x10'),'model':_0xc023('0xf'),'event':_0xc023('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc023('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':_0xc023('0xa'),'callback':afterCreateMessage},{'channel':_0xc023('0x11'),'model':_0xc023('0x12'),'event':_0xc023('0x9'),'condition':_0xc023('0x6'),'callback':afterCreate},{'channel':_0xc023('0x11'),'model':'FaxInteraction','event':_0xc023('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc023('0x11'),'model':_0xc023('0x13'),'event':_0xc023('0x9'),'condition':_0xc023('0xa'),'callback':afterCreateMessage},{'channel':_0xc023('0x14'),'model':_0xc023('0x15'),'event':_0xc023('0x9'),'condition':_0xc023('0x6'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':'afterUpdate','condition':_0xc023('0xd'),'callback':afterUpdate},{'channel':_0xc023('0x14'),'model':_0xc023('0x16'),'event':_0xc023('0x9'),'condition':_0xc023('0xa'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xc023('0x9'),'condition':_0xc023('0x6'),'callback':afterCreate},{'channel':_0xc023('0x17'),'model':_0xc023('0x18'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc023('0x17'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xc023('0xa'),'callback':afterCreateMessage}];function request(_0x564556){return client[_0xc023('0x19')](_0xc023('0x1a'),_0x564556)['then'](function(_0x52d69c){logger[_0xc023('0x1b')](_0xc023('0x1c'),_0xc023('0x1a'),_0x52d69c);if(_0x52d69c[_0xc023('0x1d')]){if(_0x52d69c[_0xc023('0x1d')]['code']===0x1f4){logger[_0xc023('0x1d')]('Trigger,\x20%s',_0xc023('0x1a'),_0x52d69c[_0xc023('0x1d')]);}}})[_0xc023('0x1e')](function(_0x49f36b){logger['error'](_0xc023('0x1c'),_0xc023('0x1a'),_0x49f36b);});}function afterCreateMessage(_0x1e48ea){return function(_0x4663be){_0x4663be=_0x4663be[_0xc023('0x1f')]({'plain':!![]});_0x4663be[_0xc023('0x20')]=_0x1e48ea;_0x4663be[_0xc023('0x21')]=_0x1e48ea;_0x4663be['event']=_0x4663be[_0xc023('0x22')];Promise[_0xc023('0x23')]()['then'](function(){if(typeof _0x4663be[_0xc023('0x24')]===_0xc023('0x25'))return null;var _0xf5f30e=_0xc023('0x26')+_0x4663be['ContactId'];return db[_0xc023('0x27')][_0xc023('0x28')](_0xf5f30e,{'type':db[_0xc023('0x29')][_0xc023('0x2a')][_0xc023('0x2b')],'raw':!![]});})[_0xc023('0x2c')](function(_0x661081){if(_0x661081){_0x4663be[_0xc023('0x2d')]=_0x661081[0x0];}if(typeof _0x4663be['UserId']==='undefined')return;return getAgent(_0x4663be[_0xc023('0x2e')]);})[_0xc023('0x2c')](function(_0x48ba05){if(_0x48ba05){_0x4663be[_0xc023('0x2f')]=util[_0xc023('0x30')](_0xc023('0x31'),_0x48ba05[_0xc023('0x32')]);_0x4663be[_0xc023('0x33')]=_0x48ba05;_0x4663be[_0xc023('0x20')]=_0x1e48ea;return request({'event':_0xc023('0x34'),'message':_0x4663be});}else{return request({'event':_0xc023('0x35'),'message':_0x4663be});}})['catch'](function(_0x3db5f5){logger[_0xc023('0x1d')](_0xc023('0x1c'),_0xc023('0x36'),_0x3db5f5);});};}function afterCreateOfflineMessage(_0x5cd8f6){return function(_0x518a6e){_0x518a6e=_0x518a6e['get']({'plain':!![]});_0x518a6e[_0xc023('0x20')]=_0x5cd8f6;_0x518a6e[_0xc023('0x21')]=_0x5cd8f6;_0x518a6e['event']='offlineMessage';return request({'event':_0x518a6e[_0xc023('0x37')],'message':_0x518a6e});};}function afterCreate(_0x305954,_0x3f0655){return function(_0x598aa6){_0x598aa6=_0x598aa6[_0xc023('0x1f')]({'plain':!![]});_0x598aa6['channel']=_0x305954;_0x598aa6[_0xc023('0x21')]=_0x305954;_0x598aa6[_0xc023('0x37')]='opened';Promise[_0xc023('0x23')]()[_0xc023('0x2c')](function(){var _0x184271='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x598aa6[_0xc023('0x24')];return db[_0xc023('0x27')]['query'](_0x184271,{'type':db[_0xc023('0x29')]['QueryTypes'][_0xc023('0x2b')],'raw':!![]});})[_0xc023('0x2c')](function(_0x427288){if(_0x427288){_0x598aa6['contact']=_0x427288[0x0];}if(typeof _0x598aa6[_0xc023('0x2e')]==='undefined')return;return getAgent(_0x598aa6['UserId']);})[_0xc023('0x2c')](function(_0x1a046d){if(_0x1a046d){_0x598aa6[_0xc023('0x2f')]=util[_0xc023('0x30')](_0xc023('0x31'),_0x1a046d[_0xc023('0x32')]);_0x598aa6[_0xc023('0x33')]=_0x1a046d;}return request({'event':_0x3f0655,'message':_0x598aa6});})[_0xc023('0x1e')](function(_0x5d9371){logger[_0xc023('0x1d')](_0xc023('0x1c'),_0xc023('0x38'),_0x5d9371);});};}function afterUpdate(_0x5b9f46){return function(_0x50dfeb){var _0x9a5b7a=_0x50dfeb[_0xc023('0x39')](_0xc023('0x3a'))&&_0x50dfeb[_0xc023('0x3a')];var _0x3f9467=_0x50dfeb[_0xc023('0x39')](_0xc023('0x3b'));if(_0x9a5b7a||_0x3f9467){var _0x1966eb=_0x9a5b7a?_0xc023('0xd'):_0xc023('0x3b');var _0x4122bb=_0x50dfeb[_0xc023('0x1f')]({'plain':!![]});_0x4122bb['channel']=_0x5b9f46;_0x4122bb[_0xc023('0x21')]=_0x5b9f46;_0x4122bb[_0xc023('0x37')]=_0x9a5b7a?_0xc023('0x3a'):_0xc023('0x3b');var _0x29cd08=_0xc023('0x26')+_0x4122bb['ContactId'];return db[_0xc023('0x27')][_0xc023('0x28')](_0x29cd08,{'type':db[_0xc023('0x29')][_0xc023('0x2a')][_0xc023('0x2b')],'raw':!![]})[_0xc023('0x2c')](function(_0x2b78e3){if(_0x2b78e3){_0x4122bb[_0xc023('0x2d')]=_0x2b78e3[0x0];}if(typeof _0x4122bb[_0xc023('0x2e')]===_0xc023('0x25'))return;return getAgent(_0x4122bb[_0xc023('0x2e')]);})[_0xc023('0x2c')](function(_0x48fa74){if(_0x48fa74){_0x4122bb[_0xc023('0x2f')]=util[_0xc023('0x30')](_0xc023('0x31'),_0x48fa74['name']);_0x4122bb[_0xc023('0x33')]=_0x48fa74;}return request({'event':_0x1966eb,'message':_0x4122bb});})['catch'](function(_0x15ce05){logger[_0xc023('0x1d')]('Trigger,\x20%s',_0xc023('0x3c'),_0x15ce05);});}};}function getAgent(_0x456a81){return db[_0xc023('0x3d')]['find']({'where':{'id':_0x456a81},'attributes':['id',_0xc023('0x32'),_0xc023('0x3e'),_0xc023('0x3f'),_0xc023('0x40')],'raw':!![]})[_0xc023('0x2c')](function(_0xab5c3c){return _0xab5c3c;});}exports[_0xc023('0x41')]=function(){for(var _0x55c901=0x0;_0x55c901=_0x3d80e6[_0x53fd('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1f9abf(_0x1c1f64);})[_0x53fd('0x12')](function(_0x49a64d){_0x1f781d(_0x49a64d);});});}; \ No newline at end of file +var _0xf818=['chat','fax','sms','whatsapp','openchannel','clearBlockUser','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','voice','mail'];(function(_0x2f2436,_0x2406fa){var _0x4c6e18=function(_0x5f1c0f){while(--_0x5f1c0f){_0x2f2436['push'](_0x2f2436['shift']());}};_0x4c6e18(++_0x2406fa);}(_0xf818,0x1f0));var _0x8f81=function(_0x290802,_0x47a918){_0x290802=_0x290802-0x0;var _0x422a61=_0xf818[_0x290802];return _0x422a61;};'use strict';var _=require(_0x8f81('0x0'));var BPromise=require('bluebird');var db=require(_0x8f81('0x1'))['db'];var util=require('./license/util');var channels=[_0x8f81('0x2'),_0x8f81('0x3'),_0x8f81('0x4'),_0x8f81('0x5'),_0x8f81('0x6'),_0x8f81('0x7'),_0x8f81('0x8')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0xc1ed64){_0xc1ed64=_0xc1ed64['toLowerCase']();return _['includes'](channels,_0xc1ed64);};exports[_0x8f81('0x9')]=function(_0x159acb,_0x314ed3,_0x572507,_0xf436fe){var _0x24384f={'loginAttempts':_0x314ed3,'blocked':_0x572507};if(!_['isUndefined'](_0xf436fe)){_0x24384f['blockedAt']=_0xf436fe;}return _0x159acb[_0x8f81('0xa')](_0x24384f);};exports[_0x8f81('0xb')]=function(_0x24ef6c){return new BPromise(function(_0x304c43,_0x15b5b6){var _0x3d3665=0x0;if(_0x24ef6c[_0x8f81('0xc')]!==_0x8f81('0xd')){_0x304c43(_0x24ef6c);}db[_0x8f81('0xe')][_0x8f81('0xf')]({'where':{'role':_0x8f81('0xd'),'online':!![],'id':{'$ne':_0x24ef6c['id']}}})[_0x8f81('0x10')](function(_0xc6cc50){_0x3d3665=_0xc6cc50;return util['getLicense']();})[_0x8f81('0x10')](function(_0x301d0b){if(_0x301d0b&&_0x301d0b[_0x8f81('0x11')]&&_0x3d3665>=_0x301d0b[_0x8f81('0x11')]){throw Error(_0x8f81('0x12'));}_0x304c43(_0x24ef6c);})[_0x8f81('0x13')](function(_0x5aa321){_0x15b5b6(_0x5aa321);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index cbf970c..562d0ab 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Forbidden','OutOfInterval','status','exports','api','message','Internal\x20Server\x20Error','name','Bad\x20Request','inherits','Entity\x20not\x20found','Not\x20Found'];(function(_0x5e30eb,_0x9bf284){var _0x17c5d5=function(_0x42194c){while(--_0x42194c){_0x5e30eb['push'](_0x5e30eb['shift']());}};_0x17c5d5(++_0x9bf284);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x49c4('0x0'));var APIError=function(_0x18bf2d,_0x26844b){this[_0x49c4('0x1')]=_0x18bf2d||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x26844b||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x41a183){this['message']=_0x41a183||_0x49c4('0x4');this[_0x49c4('0x3')]=_0x49c4('0x4');util[_0x49c4('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x436234){this['message']=_0x436234||_0x49c4('0x6');this[_0x49c4('0x3')]=_0x49c4('0x7');util[_0x49c4('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4c7d3a){switch(_0x4c7d3a){case'Bad\x20Request':return 0x190;case _0x49c4('0x8'),_0x49c4('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0xb611a1){return function(_0x459d09){logger['error'](_0x459d09['stack']);var _0x1d19bf=getStatusCode(_0x459d09[_0x49c4('0x3')]);if(_0x459d09['name'])delete _0x459d09[_0x49c4('0x3')];return _0xb611a1[_0x49c4('0xa')](_0x1d19bf)['send'](_0x459d09);};}module[_0x49c4('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xdace=['send','exports','util','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','status'];(function(_0x22c7c4,_0x3cb514){var _0x5119a4=function(_0x3e2e76){while(--_0x3e2e76){_0x22c7c4['push'](_0x22c7c4['shift']());}};_0x5119a4(++_0x3cb514);}(_0xdace,0xc5));var _0xedac=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xdace[_0x1abb09];return _0xea1c07;};'use strict';var util=require(_0xedac('0x0'));var logger=require('../config/logger')(_0xedac('0x1'));var APIError=function(_0x13adb5,_0x46eba0){this['message']=_0x13adb5||_0xedac('0x2');this[_0xedac('0x3')]=_0x46eba0||_0xedac('0x4');util[_0xedac('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5a97c0){this[_0xedac('0x6')]=_0x5a97c0||_0xedac('0x7');this[_0xedac('0x3')]='Bad\x20Request';util[_0xedac('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x21440e){this[_0xedac('0x6')]=_0x21440e||'Entity\x20not\x20found';this[_0xedac('0x3')]=_0xedac('0x8');util[_0xedac('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4af030){switch(_0x4af030){case'Bad\x20Request':return 0x190;case _0xedac('0x9'),_0xedac('0xa'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d6a29){return function(_0x4db2ad){logger[_0xedac('0xb')](_0x4db2ad['stack']);var _0x261401=getStatusCode(_0x4db2ad['name']);if(_0x4db2ad[_0xedac('0x3')])delete _0x4db2ad[_0xedac('0x3')];return _0x4d6a29[_0xedac('0xc')](_0x261401)[_0xedac('0xd')](_0x4db2ad);};}module[_0xedac('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index ffdb253..3c4b9c3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36b1=['send','exports','status','render','json'];(function(_0x29096d,_0x2c8cad){var _0xd63e88=function(_0x2a9fd9){while(--_0x2a9fd9){_0x29096d['push'](_0x29096d['shift']());}};_0xd63e88(++_0x2c8cad);}(_0x36b1,0x1aa));var _0x136b=function(_0x18dea0,_0x504b11){_0x18dea0=_0x18dea0-0x0;var _0x5865eb=_0x36b1[_0x18dea0];return _0x5865eb;};'use strict';module[_0x136b('0x0')][0x194]=function pageNotFound(_0x3abb84,_0x46dfb2){var _0x5ddf6d='404';var _0x4f42e8=0x194;var _0x4d0907={'status':_0x4f42e8};_0x46dfb2[_0x136b('0x1')](_0x4d0907['status']);_0x46dfb2[_0x136b('0x2')](_0x5ddf6d,{},function(_0xe701e,_0x4433af){if(_0xe701e){return _0x46dfb2[_0x136b('0x1')](_0x4d0907['status'])[_0x136b('0x3')](_0x4d0907);}_0x46dfb2[_0x136b('0x4')](_0x4433af);});}; \ No newline at end of file +var _0x9f85=['exports','404','status','render','json'];(function(_0x19e642,_0x4a902a){var _0x1795ae=function(_0x1110bb){while(--_0x1110bb){_0x19e642['push'](_0x19e642['shift']());}};_0x1795ae(++_0x4a902a);}(_0x9f85,0xf5));var _0x59f8=function(_0x1abe2f,_0x32e47c){_0x1abe2f=_0x1abe2f-0x0;var _0x4bbe3f=_0x9f85[_0x1abe2f];return _0x4bbe3f;};'use strict';module[_0x59f8('0x0')][0x194]=function pageNotFound(_0x5a7d8e,_0x22abd8){var _0x42ab47=_0x59f8('0x1');var _0x225e68=0x194;var _0x3fa33b={'status':_0x225e68};_0x22abd8[_0x59f8('0x2')](_0x3fa33b[_0x59f8('0x2')]);_0x22abd8[_0x59f8('0x3')](_0x42ab47,{},function(_0x1d89ca,_0x39240e){if(_0x1d89ca){return _0x22abd8[_0x59f8('0x2')](_0x3fa33b[_0x59f8('0x2')])[_0x59f8('0x4')](_0x3fa33b);}_0x22abd8['send'](_0x39240e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 84228e3..86f583d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1de=['MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../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','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../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','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','VoiceQueuesRt','Extensions','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','belongsTo','UserProfile','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_lists','MailInteractions','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','UserWhatsappQueue','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','VoiceChanSpy','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','restrict','MailAccountId','CloudProviderId','Imap','Disposition','CannedAnswer','Answers','List','ListId','Template','TemplateId','MailInteractionId','Owner','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','Account','ChatWebsiteId','ChatOfflineMessageId','TagId','Interactions','user_has_fax_accounts','FaxInteractionId','FaxAccountId','fax_interaction_has_tags','FaxMessage','team_has_fax_queues','Dispositions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','ThroughTags','Interaction','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Website','CmContactId','CmHopper','Hoppers','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CampaignId','OwnerId','All','AutomationAllId','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','TriggerAnyId','Fields','CustomReportId','MetricId','AnalyticMetric','AccountId','Subjects','SubjectId','Descriptions','Subject','Description','DescriptionId','Variable','VariableId','Configurations','FieldId','DeskField','Field','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Configuration','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','user_has_teams','VoiceQueues','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','WhatsappQueues','Lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Smtp','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','name','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0xc1de,0x1ba));var _0xec1d=function(_0x4ebfa2,_0x1b15a8){_0x4ebfa2=_0x4ebfa2-0x0;var _0x4d1d65=_0xc1de[_0x4ebfa2];return _0x4d1d65;};'use strict';var config=require(_0xec1d('0x0'));var Sequelize=require(_0xec1d('0x1'));var _=require(_0xec1d('0x2'));var jstz=require(_0xec1d('0x3'));var timezone=jstz[_0xec1d('0x4')]();config[_0xec1d('0x1')]=_[_0xec1d('0x5')](config[_0xec1d('0x1')],{'database':_0xec1d('0x6'),'username':_0xec1d('0x7'),'password':_0xec1d('0x8'),'options':{'host':_0xec1d('0x9'),'port':0xcea,'dialect':_0xec1d('0xa'),'dialectOptions':{'charset':_0xec1d('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xec1d('0xc')}}});config[_0xec1d('0xd')]=_[_0xec1d('0x5')](config[_0xec1d('0xd')],{'database':_0xec1d('0x6'),'username':'xcall','password':_0xec1d('0x8'),'options':{'host':_0xec1d('0x9'),'port':0xcea,'dialect':_0xec1d('0xa'),'dialectOptions':{'charset':_0xec1d('0xb')},'logging':![],'timezone':timezone[_0xec1d('0xe')](),'define':{'charset':'utf8','collate':_0xec1d('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xec1d('0x1')][_0xec1d('0xf')],config[_0xec1d('0x1')][_0xec1d('0x10')],config[_0xec1d('0x1')][_0xec1d('0x11')],config[_0xec1d('0x1')][_0xec1d('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xec1d('0xf')],config[_0xec1d('0xd')][_0xec1d('0x10')],config[_0xec1d('0xd')][_0xec1d('0x11')],config[_0xec1d('0xd')]['options'])};db[_0xec1d('0x13')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x15'));db['VoiceChanSpy']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x16'));db['VoiceContext']=db[_0xec1d('0x1')]['import'](_0xec1d('0x17'));db[_0xec1d('0x18')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x19'));db[_0xec1d('0x1a')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x1b'));db[_0xec1d('0x1c')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0xec1d('0x1d')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x1e'));db[_0xec1d('0x1f')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x20'));db[_0xec1d('0x21')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x22'));db['VoiceMailMessage']=db['sequelize']['import'](_0xec1d('0x23'));db[_0xec1d('0x24')]=db['sequelize']['import'](_0xec1d('0x25'));db[_0xec1d('0x26')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xec1d('0x27')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xec1d('0x28')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x29'));db[_0xec1d('0x2a')]=db['sequelize'][_0xec1d('0x14')]('../api/memberReport/memberReport.model');db[_0xec1d('0x2b')]=db['sequelize'][_0xec1d('0x14')]('../api/trunk/trunk.model');db[_0xec1d('0x2c')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x2d'));db[_0xec1d('0x2e')]=db[_0xec1d('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x2f'));db[_0xec1d('0x30')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x31'));db[_0xec1d('0x32')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x33'));db[_0xec1d('0x34')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x35'));db[_0xec1d('0x36')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x37'));db['UserWhatsappQueue']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x38'));db[_0xec1d('0x39')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0xec1d('0x3a')]=db[_0xec1d('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0xec1d('0x3b')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x3c'));db[_0xec1d('0x3d')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x3e'));db[_0xec1d('0x3f')]=db[_0xec1d('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x40'));db[_0xec1d('0x41')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x42'));db[_0xec1d('0x43')]=db['sequelize'][_0xec1d('0x14')]('../api/mailApplication/mailApplication.model');db[_0xec1d('0x44')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x45'));db[_0xec1d('0x46')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x47'));db['DashboardItem']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x48'));db[_0xec1d('0x49')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/faxAccount/faxAccount.model');db[_0xec1d('0x4a')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x4b'));db[_0xec1d('0x4c')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x4d'));db['FaxMessage']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x4e'));db[_0xec1d('0x4f')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x50'));db[_0xec1d('0x51')]=db['sequelize'][_0xec1d('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xec1d('0x52')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x53'));db[_0xec1d('0x54')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x55'));db['SmsInteraction']=db[_0xec1d('0x1')]['import'](_0xec1d('0x56'));db[_0xec1d('0x57')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x58'));db[_0xec1d('0x59')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x5a'));db[_0xec1d('0x5b')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x5c'));db[_0xec1d('0x5d')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x5e'));db[_0xec1d('0x5f')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x60'));db[_0xec1d('0x61')]=db[_0xec1d('0x1')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0xec1d('0x62')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x63'));db[_0xec1d('0x64')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x65'));db[_0xec1d('0x66')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x67'));db['ChatInteraction']=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x68'));db[_0xec1d('0x69')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x6a'));db[_0xec1d('0x6b')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x6c'));db[_0xec1d('0x6d')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x6e'));db[_0xec1d('0x6f')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x70'));db[_0xec1d('0x71')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x72'));db[_0xec1d('0x73')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/cmCompany/cmCompany.model');db[_0xec1d('0x74')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x75'));db['CmHopper']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x76'));db[_0xec1d('0x77')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x78'));db[_0xec1d('0x79')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x7a'));db[_0xec1d('0x7b')]=db['sequelize'][_0xec1d('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x7c'));db[_0xec1d('0x7d')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x7e'));db[_0xec1d('0x7f')]=db['sequelize'][_0xec1d('0x14')]('../api/action/action.model');db[_0xec1d('0x80')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x81'));db['CannedAnswer']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x82'));db['Disposition']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x83'));db[_0xec1d('0x84')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x85'));db[_0xec1d('0x86')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x87'));db[_0xec1d('0x88')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x89'));db[_0xec1d('0x8a')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x8b'));db[_0xec1d('0x8c')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x8d'));db[_0xec1d('0x8e')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x8f'));db[_0xec1d('0x90')]=db['sequelize'][_0xec1d('0x14')]('../api/tag/tag.model');db[_0xec1d('0x91')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/contactItemType/contactItemType.model');db[_0xec1d('0x92')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0xec1d('0x1')]['import'](_0xec1d('0x93'));db['Template']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/template/template.model');db[_0xec1d('0x94')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x95'));db['Variable']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x96'));db['Integration']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x97'));db['IntegrationReport']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/integrationReport/integrationReport.model');db[_0xec1d('0x98')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x99'));db['AnalyticDefaultReport']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xec1d('0x9a')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x9b'));db['AnalyticMetric']=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x9c'));db[_0xec1d('0x9d')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x9e'));db[_0xec1d('0x9f')]=db[_0xec1d('0x1')]['import'](_0xec1d('0xa0'));db[_0xec1d('0xa1')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xa2'));db[_0xec1d('0xa3')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xa4'));db[_0xec1d('0xa5')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xa6'));db[_0xec1d('0xa7')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xa8'));db[_0xec1d('0xa9')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xaa'));db[_0xec1d('0xab')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xec1d('0xac')]=db[_0xec1d('0x1')]['import'](_0xec1d('0xad'));db[_0xec1d('0xae')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xaf'));db['DeskField']=db['sequelize'][_0xec1d('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xb0'));db[_0xec1d('0xb1')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xb2'));db[_0xec1d('0xb3')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intZohoField/intZohoField.model');db[_0xec1d('0xb4')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xb5'));db[_0xec1d('0xb6')]=db[_0xec1d('0x1')]['import'](_0xec1d('0xb7'));db[_0xec1d('0xb8')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0xec1d('0xb9')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xba'));db[_0xec1d('0xbb')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xbc'));db['FreshdeskField']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xec1d('0xbd')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xec1d('0xbe')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xbf'));db['VtigerField']=db[_0xec1d('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xec1d('0xc0')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xc1'));db[_0xec1d('0xc2')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xc3'));db[_0xec1d('0xc4')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xc5'));db[_0xec1d('0xc6')]=db['sequelize']['import'](_0xec1d('0xc7'));db['Dynamics365Configuration']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xc8'));db[_0xec1d('0xc9')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xec1d('0xca')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xcb'));db[_0xec1d('0xcc')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xcd'));db[_0xec1d('0xce')]=db[_0xec1d('0x1')]['import']('../api/integration/integration.model');db['Network']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xcf'));db[_0xec1d('0xd0')]=db[_0xec1d('0x1')]['import'](_0xec1d('0xd1'));db[_0xec1d('0xd2')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xec1d('0xd3')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xd4'));db['JscriptyQuestionReport']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xd5'));db[_0xec1d('0xd6')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xd7'));db[_0xec1d('0xd8')]=db['sequelize']['import'](_0xec1d('0xd9'));db['SquareReport']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xda'));db[_0xec1d('0xdb')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xdc'));db[_0xec1d('0xdd')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xec1d('0xde')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/setting/setting.model');db[_0xec1d('0xdf')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xe0'));db[_0xec1d('0xe1')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xe2'));db[_0xec1d('0xe3')]=db[_0xec1d('0x1')]['import'](_0xec1d('0xe4'));db[_0xec1d('0xe5')]=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db[_0xec1d('0xe6')]=db[_0xec1d('0x1')]['import'](_0xec1d('0xe7'));db['License']=db['sequelize']['import'](_0xec1d('0xe8'));db[_0xec1d('0xe9')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xea'));db['Migration']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/migration/migration.model');db['Attachment']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/attachment/attachment.model');db[_0xec1d('0xeb')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xec'));db[_0xec1d('0xed')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xec1d('0xee')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xef'));db['FaxTransferReport']=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xf0'));db['OpenchannelTransferReport']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xf1'));db[_0xec1d('0xf2')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xf3'));db[_0xec1d('0xf4')]=db['sequelize']['import'](_0xec1d('0xf5'));db[_0xec1d('0xf6')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xf7'));db['UserProfile']=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/userProfile/userProfile.model');db[_0xec1d('0xf8')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xf9'));db[_0xec1d('0xfa')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0xfb'));db[_0xec1d('0xfc')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xfd'));db['WhatsappAccount']=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0xfe'));db[_0xec1d('0xff')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x100'));db[_0xec1d('0x101')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x102'));db[_0xec1d('0x103')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0xec1d('0x104')]=db[_0xec1d('0x1')]['import'](_0xec1d('0x105'));db[_0xec1d('0x106')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x107'));db[_0xec1d('0x108')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0xec1d('0x109')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x10a'));db[_0xec1d('0x10b')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x10c'));db[_0xec1d('0x10d')]=db['sequelize'][_0xec1d('0x14')](_0xec1d('0x10e'));db[_0xec1d('0x10f')]=db[_0xec1d('0x1')][_0xec1d('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xec1d('0x110')]=db[_0xec1d('0x1')][_0xec1d('0x14')](_0xec1d('0x111'));db['User'][_0xec1d('0x112')](db[_0xec1d('0x21')],{'as':'VoiceMail','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x114')});db[_0xec1d('0x13')]['hasOne'](db[_0xec1d('0x110')],{'as':_0xec1d('0x115'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x114')});db['User'][_0xec1d('0x116')](db[_0xec1d('0x1d')],{'as':'Recordings','foreignKey':_0xec1d('0x114')});db['User'][_0xec1d('0x116')](db[_0xec1d('0x2e')],{'as':_0xec1d('0x117'),'foreignKey':'UserId'});db[_0xec1d('0x13')][_0xec1d('0x116')](db['VoiceExtension'],{'as':_0xec1d('0x118'),'onDelete':_0xec1d('0x113'),'hooks':!![]});db[_0xec1d('0x13')][_0xec1d('0x116')](db[_0xec1d('0x79')],{'as':'HopperFinals','foreignKey':_0xec1d('0x114')});db[_0xec1d('0x13')][_0xec1d('0x116')](db[_0xec1d('0x7b')],{'as':_0xec1d('0x119'),'foreignKey':'UserId'});db[_0xec1d('0x13')]['hasMany'](db[_0xec1d('0x11a')],{'as':_0xec1d('0x11a'),'foreignKey':_0xec1d('0x114')});db['User']['hasMany'](db[_0xec1d('0x5f')],{'as':_0xec1d('0x11b'),'foreignKey':_0xec1d('0x114')});db[_0xec1d('0x13')][_0xec1d('0x116')](db[_0xec1d('0x11c')],{'as':_0xec1d('0x11d'),'foreignKey':_0xec1d('0x114')});db['User']['hasMany'](db[_0xec1d('0x11e')],{'as':_0xec1d('0x11f'),'foreignKey':_0xec1d('0x114')});db['User'][_0xec1d('0x116')](db['FaxInteraction'],{'as':_0xec1d('0x120'),'foreignKey':'UserId'});db[_0xec1d('0x13')][_0xec1d('0x116')](db[_0xec1d('0x121')],{'as':'MailInteractions','foreignKey':_0xec1d('0x114')});db[_0xec1d('0x13')]['hasMany'](db[_0xec1d('0x101')],{'as':_0xec1d('0x122'),'foreignKey':'UserId'});db[_0xec1d('0x13')]['hasMany'](db[_0xec1d('0xfc')],{'as':_0xec1d('0x123'),'foreignKey':'SenderId'});db[_0xec1d('0x13')][_0xec1d('0x124')](db['UserProfile'],{'as':_0xec1d('0x125'),'foreignKey':'userProfileId'});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x6f')],{'as':_0xec1d('0x127'),'through':_0xec1d('0x128')});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x74')],{'as':_0xec1d('0x129'),'through':'cm_user_has_contacts'});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0xf4')],{'as':'Lists','through':_0xec1d('0x12a')});db[_0xec1d('0x13')]['belongsToMany'](db[_0xec1d('0xe6')],{'through':'user_has_teams'});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x121')],{'as':_0xec1d('0x12b'),'through':_0xec1d('0x12c')});db['User'][_0xec1d('0x126')](db[_0xec1d('0x11c')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x4c')],{'as':_0xec1d('0x120'),'through':_0xec1d('0x12d')});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x11e')],{'as':'SmsInteractions','through':_0xec1d('0x12e')});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x5f')],{'as':_0xec1d('0x11b'),'through':_0xec1d('0x12f')});db['User'][_0xec1d('0x126')](db[_0xec1d('0x101')],{'as':'WhatsappInteractions','through':_0xec1d('0x130')});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x1c')],{'as':'VoiceQueues','through':_0xec1d('0x131'),'required':![]});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0xf6')],{'as':_0xec1d('0x132'),'through':_0xec1d('0x10f'),'required':![]});db[_0xec1d('0x13')]['belongsToMany'](db[_0xec1d('0x3d')],{'as':_0xec1d('0x133'),'through':'UserMailQueue','required':![]});db[_0xec1d('0x13')]['belongsToMany'](db[_0xec1d('0x6d')],{'as':_0xec1d('0x134'),'through':_0xec1d('0x30'),'required':![],'hooks':!![]});db['User'][_0xec1d('0x126')](db[_0xec1d('0x4f')],{'as':_0xec1d('0x135'),'through':_0xec1d('0x136'),'required':![]});db[_0xec1d('0x13')][_0xec1d('0x126')](db['SmsQueue'],{'as':_0xec1d('0x137'),'through':'UserSmsQueue','required':![]});db[_0xec1d('0x13')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0xec1d('0x138'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xec1d('0x126')](db[_0xec1d('0x108')],{'as':'WhatsappQueues','through':_0xec1d('0x139'),'required':![]});db['User'][_0xec1d('0x126')](db['CmList'],{'through':_0xec1d('0x12a')});db[_0xec1d('0x13')]['belongsToMany'](db[_0xec1d('0x62')],{'as':'ChatWebsites','through':_0xec1d('0x13a')});db['User'][_0xec1d('0x126')](db[_0xec1d('0x49')],{'as':_0xec1d('0x13b'),'through':'user_has_fax_accounts'});db[_0xec1d('0x13')]['belongsToMany'](db[_0xec1d('0x3b')],{'as':_0xec1d('0x13c'),'through':_0xec1d('0x13d')});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x5b')],{'as':_0xec1d('0x13e'),'through':_0xec1d('0x13f')});db['User'][_0xec1d('0x126')](db[_0xec1d('0x52')],{'as':_0xec1d('0x140'),'through':_0xec1d('0x141')});db[_0xec1d('0x13')][_0xec1d('0x126')](db[_0xec1d('0x142')],{'as':_0xec1d('0x143'),'through':_0xec1d('0x144')});db[_0xec1d('0x145')][_0xec1d('0x116')](db[_0xec1d('0x18')],{'as':'SpiedAgents','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x146')});db[_0xec1d('0x147')][_0xec1d('0x116')](db['VoiceExtension'],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db[_0xec1d('0x18')],{'as':_0xec1d('0x148'),'onDelete':'cascade'});db[_0xec1d('0x1a')][_0xec1d('0x126')](db[_0xec1d('0x8e')],{'as':_0xec1d('0x149'),'through':_0xec1d('0x14a')});db[_0xec1d('0x1c')]['hasMany'](db[_0xec1d('0x2e')],{'as':_0xec1d('0x14b'),'foreignKey':_0xec1d('0x14c')});db[_0xec1d('0x1c')][_0xec1d('0x116')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xec1d('0x14c')});db[_0xec1d('0x1c')][_0xec1d('0x116')](db[_0xec1d('0x79')],{'as':_0xec1d('0x14d'),'foreignKey':'VoiceQueueId'});db[_0xec1d('0x1c')]['hasMany'](db['CmHopperHistory'],{'as':_0xec1d('0x14e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xec1d('0x11a')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xec1d('0x1c')][_0xec1d('0x116')](db[_0xec1d('0x77')],{'as':_0xec1d('0x14f'),'foreignKey':_0xec1d('0x14c')});db['VoiceQueue'][_0xec1d('0x116')](db['JscriptySessionReport'],{'as':_0xec1d('0x150'),'foreignKey':_0xec1d('0x14c')});db[_0xec1d('0x1c')][_0xec1d('0x124')](db[_0xec1d('0x2b')],{'as':'Trunk','foreignKey':_0xec1d('0x151')});db[_0xec1d('0x1c')][_0xec1d('0x124')](db[_0xec1d('0x2b')],{'as':'TrunkBackup','foreignKey':_0xec1d('0x152')});db[_0xec1d('0x1c')][_0xec1d('0x124')](db[_0xec1d('0x86')],{'as':_0xec1d('0x86'),'foreignKey':_0xec1d('0x153')});db[_0xec1d('0x1c')][_0xec1d('0x124')](db[_0xec1d('0x88')],{'as':_0xec1d('0x154'),'foreignKey':_0xec1d('0x155')});db[_0xec1d('0x1c')][_0xec1d('0x126')](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xec1d('0x1c')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x131')});db[_0xec1d('0x1c')][_0xec1d('0x126')](db[_0xec1d('0xe6')],{'as':_0xec1d('0x157'),'through':'TeamVoiceQueue'});db[_0xec1d('0x1c')][_0xec1d('0x126')](db['CmList'],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0xec1d('0x1d')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x13'),'foreignKey':_0xec1d('0x114')});db[_0xec1d('0x1f')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x13'),'foreignKey':_0xec1d('0x114')});db[_0xec1d('0x21')]['hasMany'](db[_0xec1d('0x158')],{'as':_0xec1d('0x159'),'onDelete':'cascade','foreignKey':_0xec1d('0x15a'),'sourceKey':'mailbox'});db[_0xec1d('0x158')][_0xec1d('0x124')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xec1d('0x15b')});db[_0xec1d('0x24')][_0xec1d('0x116')](db[_0xec1d('0x28')],{'as':_0xec1d('0x15c'),'foreignKey':_0xec1d('0x15d'),'constraints':![]});db[_0xec1d('0x24')]['hasMany'](db[_0xec1d('0x27')],{'as':_0xec1d('0x15e'),'foreignKey':'uniqueid','constraints':![]});db[_0xec1d('0x24')]['belongsTo'](db['User'],{'as':_0xec1d('0x13'),'foreignKey':_0xec1d('0x114')});db['VoiceCallReport'][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db['MailServerIn'][_0xec1d('0x124')](db[_0xec1d('0x3b')],{'as':_0xec1d('0x3b'),'foreignKey':'MailAccountId'});db[_0xec1d('0x39')][_0xec1d('0x124')](db['CloudProvider'],{'as':_0xec1d('0x109'),'foreignKey':'CloudProviderId','onDelete':_0xec1d('0x161')});db[_0xec1d('0x3a')]['belongsTo'](db[_0xec1d('0x3b')],{'as':_0xec1d('0x3b'),'foreignKey':_0xec1d('0x162')});db[_0xec1d('0x3a')][_0xec1d('0x124')](db['CloudProvider'],{'as':_0xec1d('0x109'),'foreignKey':_0xec1d('0x163'),'onDelete':_0xec1d('0x161')});db[_0xec1d('0x3b')][_0xec1d('0x112')](db['MailServerIn'],{'as':_0xec1d('0x164'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x3b')][_0xec1d('0x112')](db[_0xec1d('0x3a')],{'as':'Smtp','onDelete':_0xec1d('0x113')});db[_0xec1d('0x3b')][_0xec1d('0x116')](db[_0xec1d('0x165')],{'as':'Dispositions','foreignKey':_0xec1d('0x162'),'onDelete':_0xec1d('0x113')});db['MailAccount']['hasMany'](db[_0xec1d('0x166')],{'as':_0xec1d('0x167'),'foreignKey':'MailAccountId'});db[_0xec1d('0x3b')][_0xec1d('0x116')](db['MailMessage'],{'as':'Messages','foreignKey':_0xec1d('0x162')});db[_0xec1d('0x3b')][_0xec1d('0x116')](db[_0xec1d('0x121')],{'as':'Interactions'});db[_0xec1d('0x3b')][_0xec1d('0x116')](db[_0xec1d('0x43')],{'as':_0xec1d('0x148')});db[_0xec1d('0x3b')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db['MailAccount'][_0xec1d('0x124')](db[_0xec1d('0x16a')],{'as':'Template','foreignKey':_0xec1d('0x16b')});db[_0xec1d('0x3b')][_0xec1d('0x124')](db[_0xec1d('0x88')],{'as':_0xec1d('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xec1d('0x3b')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x13d')});db[_0xec1d('0x3d')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x32')});db[_0xec1d('0x3d')][_0xec1d('0x126')](db['Team'],{'through':'team_has_mail_queues','as':'Teams'});db[_0xec1d('0x121')][_0xec1d('0x116')](db['MailMessage'],{'as':_0xec1d('0x159'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x16c')});db['MailInteraction']['belongsTo'](db[_0xec1d('0x3b')],{'as':'Account','foreignKey':_0xec1d('0x162')});db[_0xec1d('0x121')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x121')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x16d'),'foreignKey':'UserId'});db[_0xec1d('0x121')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x16e'),'as':_0xec1d('0x16f')});db[_0xec1d('0x121')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x16e'),'as':'ThroughTags'});db[_0xec1d('0x121')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x170'),'through':'user_has_mail_interactions','foreignKey':_0xec1d('0x16c')});db[_0xec1d('0x41')]['hasMany'](db[_0xec1d('0x171')],{'as':_0xec1d('0x172'),'onDelete':_0xec1d('0x113')});db['MailMessage'][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x13')});db[_0xec1d('0x41')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'onDelete':_0xec1d('0x113'),'as':'Contact'});db[_0xec1d('0x41')]['belongsTo'](db[_0xec1d('0x121')],{'as':'Interaction','foreignKey':_0xec1d('0x16c')});db[_0xec1d('0x41')][_0xec1d('0x124')](db[_0xec1d('0x3b')],{'as':_0xec1d('0x173'),'foreignKey':'MailAccountId'});db['MailMessage'][_0xec1d('0x124')](db[_0xec1d('0x62')],{'as':_0xec1d('0x62'),'foreignKey':_0xec1d('0x174')});db[_0xec1d('0x41')][_0xec1d('0x124')](db[_0xec1d('0x6b')],{'as':_0xec1d('0x6b'),'foreignKey':_0xec1d('0x175')});db[_0xec1d('0x43')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'onDelete':'restrict'});db[_0xec1d('0x43')][_0xec1d('0x124')](db['MailQueue'],{'onDelete':_0xec1d('0x161')});db['MailApplication'][_0xec1d('0x124')](db[_0xec1d('0x3b')],{'onDelete':'restrict'});db[_0xec1d('0x43')][_0xec1d('0x124')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xec1d('0x153')});db[_0xec1d('0x43')]['belongsTo'](db['Tag'],{'onDelete':_0xec1d('0x161'),'foreignKey':_0xec1d('0x176')});db['MailQueueReport'][_0xec1d('0x124')](db[_0xec1d('0x3b')],{});db[_0xec1d('0x44')][_0xec1d('0x124')](db['CmList'],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db['MailQueueReport'][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db['MailQueueReport'][_0xec1d('0x124')](db[_0xec1d('0x121')],{});db[_0xec1d('0x44')][_0xec1d('0x124')](db[_0xec1d('0x41')],{});db[_0xec1d('0x44')][_0xec1d('0x124')](db['User'],{});db[_0xec1d('0x44')][_0xec1d('0x124')](db[_0xec1d('0x3d')],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0xec1d('0x113')});db[_0xec1d('0x49')][_0xec1d('0x116')](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xec1d('0x113')});db[_0xec1d('0x49')][_0xec1d('0x116')](db['CannedAnswer'],{'as':'Answers','foreignKey':'FaxAccountId'});db['FaxAccount'][_0xec1d('0x116')](db[_0xec1d('0x4c')],{'as':_0xec1d('0x177')});db[_0xec1d('0x49')][_0xec1d('0x116')](db[_0xec1d('0x4a')],{'as':_0xec1d('0x148')});db[_0xec1d('0x49')]['hasMany'](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xec1d('0x113')});db[_0xec1d('0x49')][_0xec1d('0x116')](db['FaxMessage'],{'as':'Messages'});db[_0xec1d('0x49')][_0xec1d('0x124')](db[_0xec1d('0x2b')],{'as':_0xec1d('0x2b')});db[_0xec1d('0x49')]['belongsTo'](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db['FaxAccount'][_0xec1d('0x124')](db[_0xec1d('0x88')],{'as':_0xec1d('0x154'),'foreignKey':_0xec1d('0x155')});db[_0xec1d('0x49')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x178')});db[_0xec1d('0x4a')]['belongsTo'](db['User'],{'onDelete':_0xec1d('0x161')});db[_0xec1d('0x4a')][_0xec1d('0x124')](db['FaxQueue'],{'onDelete':_0xec1d('0x161')});db[_0xec1d('0x4a')][_0xec1d('0x124')](db[_0xec1d('0x49')],{'onDelete':_0xec1d('0x161')});db['FaxApplication'][_0xec1d('0x124')](db['Tag'],{'onDelete':_0xec1d('0x161'),'foreignKey':_0xec1d('0x176')});db[_0xec1d('0x4c')][_0xec1d('0x116')](db['FaxMessage'],{'as':_0xec1d('0x159'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x179')});db[_0xec1d('0x4c')]['belongsTo'](db[_0xec1d('0x49')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x17a')});db[_0xec1d('0x4c')]['belongsTo'](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x4c')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':'Owner','foreignKey':'UserId'});db[_0xec1d('0x4c')]['belongsToMany'](db[_0xec1d('0x90')],{'through':_0xec1d('0x17b'),'as':_0xec1d('0x16f')});db[_0xec1d('0x4c')]['belongsToMany'](db[_0xec1d('0x90')],{'through':_0xec1d('0x17b'),'as':'ThroughTags'});db[_0xec1d('0x4c')]['belongsToMany'](db[_0xec1d('0x13')],{'as':_0xec1d('0x170'),'through':'user_has_fax_interactions','foreignKey':_0xec1d('0x179')});db[_0xec1d('0x17c')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'onDelete':_0xec1d('0x113'),'as':'User'});db[_0xec1d('0x17c')][_0xec1d('0x124')](db[_0xec1d('0x4c')],{'as':'Interaction','foreignKey':_0xec1d('0x179')});db[_0xec1d('0x17c')]['belongsTo'](db[_0xec1d('0x74')],{'onDelete':_0xec1d('0x113'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xec1d('0x171')],{'as':_0xec1d('0x171'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0xec1d('0x124')](db['FaxAccount'],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x17a')});db[_0xec1d('0x4f')][_0xec1d('0x126')](db['User'],{'as':_0xec1d('0x156'),'through':_0xec1d('0x136')});db[_0xec1d('0x4f')][_0xec1d('0x126')](db[_0xec1d('0xe6')],{'through':_0xec1d('0x17d'),'as':_0xec1d('0x157')});db[_0xec1d('0x51')][_0xec1d('0x124')](db[_0xec1d('0x49')],{});db[_0xec1d('0x51')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db['FaxQueueReport'][_0xec1d('0x124')](db['CmContact'],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db['FaxQueueReport'][_0xec1d('0x124')](db[_0xec1d('0x4c')],{});db[_0xec1d('0x51')][_0xec1d('0x124')](db['FaxMessage'],{});db[_0xec1d('0x51')][_0xec1d('0x124')](db[_0xec1d('0x13')],{});db['FaxQueueReport'][_0xec1d('0x124')](db[_0xec1d('0x4f')],{});db[_0xec1d('0x52')][_0xec1d('0x116')](db[_0xec1d('0x165')],{'as':_0xec1d('0x17e'),'foreignKey':_0xec1d('0x17f'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x52')][_0xec1d('0x116')](db[_0xec1d('0x166')],{'as':_0xec1d('0x167'),'foreignKey':_0xec1d('0x17f')});db[_0xec1d('0x52')][_0xec1d('0x116')](db['SmsMessage'],{'as':_0xec1d('0x159'),'foreignKey':_0xec1d('0x17f')});db['SmsAccount'][_0xec1d('0x116')](db[_0xec1d('0x11e')],{'as':_0xec1d('0x177')});db[_0xec1d('0x52')][_0xec1d('0x116')](db[_0xec1d('0x54')],{'as':_0xec1d('0x148')});db[_0xec1d('0x52')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':'ListId'});db[_0xec1d('0x52')][_0xec1d('0x124')](db[_0xec1d('0x88')],{'as':_0xec1d('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xec1d('0x52')][_0xec1d('0x126')](db['User'],{'as':'Agents','through':_0xec1d('0x141')});db[_0xec1d('0x54')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'onDelete':_0xec1d('0x161')});db[_0xec1d('0x54')][_0xec1d('0x124')](db[_0xec1d('0x59')],{'onDelete':_0xec1d('0x161')});db['SmsApplication'][_0xec1d('0x124')](db[_0xec1d('0x52')],{'onDelete':_0xec1d('0x161')});db[_0xec1d('0x54')][_0xec1d('0x124')](db[_0xec1d('0x86')],{'onDelete':_0xec1d('0x161'),'foreignKey':_0xec1d('0x153')});db[_0xec1d('0x54')][_0xec1d('0x124')](db['Tag'],{'onDelete':_0xec1d('0x161'),'foreignKey':'TagId'});db['SmsInteraction'][_0xec1d('0x116')](db['SmsMessage'],{'as':_0xec1d('0x159'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x180')});db[_0xec1d('0x11e')][_0xec1d('0x124')](db[_0xec1d('0x52')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x17f')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xec1d('0x160')});db[_0xec1d('0x11e')]['belongsTo'](db[_0xec1d('0x13')],{'as':'Owner','foreignKey':_0xec1d('0x114')});db[_0xec1d('0x11e')][_0xec1d('0x126')](db['Tag'],{'through':_0xec1d('0x181'),'as':'Tags'});db[_0xec1d('0x11e')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':'sms_interaction_has_tags','as':_0xec1d('0x182')});db[_0xec1d('0x11e')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x170'),'through':_0xec1d('0x12e'),'foreignKey':_0xec1d('0x180')});db[_0xec1d('0x57')]['belongsTo'](db[_0xec1d('0x13')],{'as':_0xec1d('0x13')});db[_0xec1d('0x57')][_0xec1d('0x124')](db['CmContact'],{'onDelete':_0xec1d('0x113'),'as':'Contact'});db[_0xec1d('0x57')][_0xec1d('0x124')](db[_0xec1d('0x11e')],{'onDelete':_0xec1d('0x113'),'as':_0xec1d('0x183'),'foreignKey':'SmsInteractionId'});db[_0xec1d('0x57')]['belongsTo'](db['SmsAccount'],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x17f')});db['SmsQueue'][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x34'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0xec1d('0x126')](db[_0xec1d('0xe6')],{'through':'team_has_sms_queues','as':_0xec1d('0x157')});db['OpenchannelAccount'][_0xec1d('0x116')](db[_0xec1d('0x165')],{'as':_0xec1d('0x17e'),'foreignKey':_0xec1d('0x184'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x5b')]['hasMany'](db['CannedAnswer'],{'as':_0xec1d('0x167'),'foreignKey':_0xec1d('0x184')});db[_0xec1d('0x5b')][_0xec1d('0x116')](db[_0xec1d('0x5f')],{'as':_0xec1d('0x177'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xec1d('0x185')],{'as':_0xec1d('0x159'),'foreignKey':_0xec1d('0x184')});db[_0xec1d('0x5b')][_0xec1d('0x116')](db[_0xec1d('0x5d')],{'as':_0xec1d('0x148'),'foreignKey':'OpenchannelAccountId'});db[_0xec1d('0x5b')]['belongsTo'](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db['OpenchannelAccount'][_0xec1d('0x124')](db['Pause'],{'as':_0xec1d('0x154'),'foreignKey':_0xec1d('0x155')});db[_0xec1d('0x5b')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x13f')});db[_0xec1d('0x5d')][_0xec1d('0x124')](db['User'],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xec1d('0x124')](db[_0xec1d('0x61')],{'onDelete':_0xec1d('0x161'),'foreignKey':_0xec1d('0x186')});db[_0xec1d('0x5d')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0xec1d('0x184')});db[_0xec1d('0x5d')][_0xec1d('0x124')](db[_0xec1d('0x86')],{'onDelete':'restrict','foreignKey':_0xec1d('0x153')});db[_0xec1d('0x5d')][_0xec1d('0x124')](db[_0xec1d('0x90')],{'onDelete':_0xec1d('0x161'),'foreignKey':'TagId'});db[_0xec1d('0x5f')][_0xec1d('0x116')](db['OpenchannelMessage'],{'as':_0xec1d('0x159'),'onDelete':'cascade','foreignKey':_0xec1d('0x187')});db[_0xec1d('0x5f')][_0xec1d('0x124')](db[_0xec1d('0x5b')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x184')});db[_0xec1d('0x5f')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x5f')][_0xec1d('0x124')](db['User'],{'as':'Owner','foreignKey':_0xec1d('0x114')});db[_0xec1d('0x5f')]['belongsToMany'](db[_0xec1d('0x90')],{'through':_0xec1d('0x188'),'as':_0xec1d('0x16f')});db[_0xec1d('0x5f')]['belongsToMany'](db['Tag'],{'through':_0xec1d('0x188'),'as':_0xec1d('0x182')});db['OpenchannelInteraction'][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x170'),'through':'user_has_openchannel_interactions','foreignKey':_0xec1d('0x187')});db[_0xec1d('0x185')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'onDelete':'cascade','as':_0xec1d('0x13')});db[_0xec1d('0x185')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'onDelete':'cascade','as':_0xec1d('0x15f')});db[_0xec1d('0x185')][_0xec1d('0x124')](db[_0xec1d('0x5f')],{'onDelete':'cascade','as':_0xec1d('0x183'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xec1d('0x124')](db['Attachment'],{'as':'Attachment','foreignKey':_0xec1d('0x189')});db[_0xec1d('0x185')][_0xec1d('0x124')](db['OpenchannelAccount'],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x184')});db[_0xec1d('0x61')][_0xec1d('0x126')](db['User'],{'as':'Agents','through':_0xec1d('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0xec1d('0x61')]['belongsToMany'](db[_0xec1d('0xe6')],{'through':_0xec1d('0x18a'),'as':_0xec1d('0x157')});db['ChatWebsite']['hasMany'](db[_0xec1d('0x165')],{'as':_0xec1d('0x17e'),'foreignKey':_0xec1d('0x174'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x62')][_0xec1d('0x116')](db[_0xec1d('0x166')],{'as':_0xec1d('0x167'),'foreignKey':'ChatWebsiteId'});db[_0xec1d('0x62')][_0xec1d('0x116')](db[_0xec1d('0x71')],{'as':_0xec1d('0x18b')});db[_0xec1d('0x62')][_0xec1d('0x116')](db[_0xec1d('0x11c')],{'as':_0xec1d('0x177')});db[_0xec1d('0x62')][_0xec1d('0x116')](db['ChatApplication'],{'as':_0xec1d('0x148')});db[_0xec1d('0x62')][_0xec1d('0x116')](db[_0xec1d('0x69')],{'as':_0xec1d('0x159')});db['ChatWebsite'][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':'ListId'});db[_0xec1d('0x62')]['belongsTo'](db[_0xec1d('0x86')],{'as':'Interval','foreignKey':_0xec1d('0x153')});db['ChatWebsite'][_0xec1d('0x124')](db[_0xec1d('0x3b')],{'as':_0xec1d('0x3b'),'foreignKey':_0xec1d('0x162')});db['ChatWebsite'][_0xec1d('0x124')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xec1d('0x155')});db[_0xec1d('0x62')]['belongsToMany'](db[_0xec1d('0x13')],{'as':'Agents','through':_0xec1d('0x13a')});db[_0xec1d('0x64')][_0xec1d('0x124')](db[_0xec1d('0x5b')],{});db[_0xec1d('0x64')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db[_0xec1d('0x64')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db['OpenchannelQueueReport'][_0xec1d('0x124')](db[_0xec1d('0x5f')],{});db[_0xec1d('0x64')]['belongsTo'](db[_0xec1d('0x185')],{});db['OpenchannelQueueReport'][_0xec1d('0x124')](db['User'],{});db[_0xec1d('0x64')][_0xec1d('0x124')](db['OpenchannelQueue'],{});db[_0xec1d('0x66')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x18c'),'foreignKey':'UserId','onDelete':_0xec1d('0x161')});db[_0xec1d('0x66')][_0xec1d('0x124')](db[_0xec1d('0x6d')],{'as':_0xec1d('0x18d'),'foreignKey':_0xec1d('0x18e'),'onDelete':'restrict'});db['ChatApplication'][_0xec1d('0x124')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xec1d('0x174'),'onDelete':'restrict'});db[_0xec1d('0x66')][_0xec1d('0x124')](db[_0xec1d('0x90')],{'onDelete':_0xec1d('0x161'),'foreignKey':'TagId'});db['ChatInteraction'][_0xec1d('0x116')](db[_0xec1d('0x69')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xec1d('0x18f')});db[_0xec1d('0x11c')][_0xec1d('0x124')](db[_0xec1d('0x62')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x174')});db[_0xec1d('0x11c')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':'ContactId'});db['ChatInteraction'][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x16d'),'foreignKey':_0xec1d('0x114')});db[_0xec1d('0x11c')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x190'),'as':_0xec1d('0x16f')});db['ChatInteraction'][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x190'),'as':_0xec1d('0x182')});db[_0xec1d('0x11c')]['belongsToMany'](db[_0xec1d('0x13')],{'as':_0xec1d('0x170'),'through':_0xec1d('0x191'),'foreignKey':_0xec1d('0x18f')});db[_0xec1d('0x69')][_0xec1d('0x124')](db['User'],{'onDelete':_0xec1d('0x113'),'as':_0xec1d('0x13')});db[_0xec1d('0x69')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'onDelete':'cascade','as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x69')][_0xec1d('0x124')](db[_0xec1d('0x11c')],{'onDelete':_0xec1d('0x113'),'as':'Interaction','foreignKey':_0xec1d('0x18f')});db[_0xec1d('0x69')][_0xec1d('0x124')](db[_0xec1d('0x171')],{'as':_0xec1d('0x171'),'foreignKey':_0xec1d('0x189')});db['ChatMessage'][_0xec1d('0x124')](db['ChatWebsite'],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x174')});db['ChatOfflineMessage'][_0xec1d('0x116')](db[_0xec1d('0x171')],{'as':_0xec1d('0x172'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xec1d('0x113'),'hooks':!![]});db[_0xec1d('0x6b')]['belongsTo'](db[_0xec1d('0x74')],{'onDelete':'cascade','as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x6b')][_0xec1d('0x124')](db[_0xec1d('0x62')],{'as':'Account','foreignKey':_0xec1d('0x174')});db[_0xec1d('0x6d')][_0xec1d('0x126')](db['User'],{'as':_0xec1d('0x156'),'through':_0xec1d('0x30'),'hooks':!![]});db[_0xec1d('0x6d')][_0xec1d('0x126')](db[_0xec1d('0xe6')],{'through':_0xec1d('0x192'),'as':_0xec1d('0x157')});db['ChatGroup'][_0xec1d('0x116')](db[_0xec1d('0xd2')],{'as':_0xec1d('0x159'),'foreignKey':_0xec1d('0x193'),'onDelete':_0xec1d('0x113')});db['ChatGroup']['belongsToMany'](db[_0xec1d('0x13')],{'as':'Members','through':_0xec1d('0x128')});db[_0xec1d('0x71')][_0xec1d('0x124')](db['ChatWebsite'],{'as':_0xec1d('0x194'),'foreignKey':_0xec1d('0x174')});db[_0xec1d('0x73')][_0xec1d('0x116')](db[_0xec1d('0x74')],{'as':_0xec1d('0x129'),'foreignKey':'CompanyId'});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0x92')],{'as':'Phones','foreignKey':_0xec1d('0x195')});db[_0xec1d('0x74')]['hasMany'](db[_0xec1d('0x196')],{'as':_0xec1d('0x197'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x74')]['hasMany'](db['CmHopperFinal'],{'as':_0xec1d('0x14d'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0x7b')],{'as':_0xec1d('0x14e'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0x11a')],{'as':_0xec1d('0x11a'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0xd6')],{'as':_0xec1d('0x150'),'foreignKey':'ContactId'});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0x5f')],{'as':_0xec1d('0x11b'),'foreignKey':_0xec1d('0x160'),'onDelete':'restrict'});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0x11c')],{'as':_0xec1d('0x11d'),'foreignKey':_0xec1d('0x160'),'onDelete':_0xec1d('0x161')});db[_0xec1d('0x74')][_0xec1d('0x116')](db['SmsInteraction'],{'as':_0xec1d('0x11f'),'foreignKey':_0xec1d('0x160'),'onDelete':'restrict'});db[_0xec1d('0x74')][_0xec1d('0x116')](db[_0xec1d('0x4c')],{'as':_0xec1d('0x120'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xec1d('0x74')]['hasMany'](db[_0xec1d('0x121')],{'as':_0xec1d('0x12b'),'foreignKey':_0xec1d('0x160'),'onDelete':_0xec1d('0x161')});db[_0xec1d('0x74')][_0xec1d('0x124')](db['CmCompany'],{'as':_0xec1d('0x198'),'foreignKey':_0xec1d('0x199')});db[_0xec1d('0x74')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':'List','foreignKey':_0xec1d('0x169'),'onDelete':'cascade'});db[_0xec1d('0x74')][_0xec1d('0x126')](db['User'],{'as':'Users','through':_0xec1d('0x19a')});db[_0xec1d('0x74')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'as':_0xec1d('0x16f'),'through':'cm_contact_has_tags'});db[_0xec1d('0x74')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x19b'),'as':'ThroughTags'});db['CmHopper'][_0xec1d('0x116')](db[_0xec1d('0x19c')],{'as':_0xec1d('0x19d'),'foreignKey':'CmHopperId'});db['CmHopper'][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':'ContactId','onDelete':_0xec1d('0x113')});db[_0xec1d('0x196')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x196')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x18c'),'foreignKey':'UserId'});db[_0xec1d('0x196')]['belongsTo'](db[_0xec1d('0x1c')],{'as':'Queue','foreignKey':_0xec1d('0x14c'),'onDelete':_0xec1d('0x113')});db['CmHopper'][_0xec1d('0x124')](db['Campaign'],{'as':_0xec1d('0xe9'),'foreignKey':_0xec1d('0x19e'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x196')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x16d'),'foreignKey':_0xec1d('0x19f')});db[_0xec1d('0x77')]['belongsTo'](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':'ContactId','onDelete':_0xec1d('0x113')});db[_0xec1d('0x77')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':'List','foreignKey':'ListId','onDelete':_0xec1d('0x113')});db[_0xec1d('0x77')][_0xec1d('0x124')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xec1d('0x14c'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x77')][_0xec1d('0x124')](db[_0xec1d('0xe9')],{'as':'Campaign','foreignKey':_0xec1d('0x19e'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x80')][_0xec1d('0x116')](db['Condition'],{'as':{'plural':_0xec1d('0x1a0'),'singular':'OneAll'},'foreignKey':_0xec1d('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0xec1d('0x80')][_0xec1d('0x116')](db[_0xec1d('0x84')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0xec1d('0x1a2'),'onDelete':_0xec1d('0x113'),'hooks':!![]});db[_0xec1d('0x80')][_0xec1d('0x116')](db[_0xec1d('0x7f')],{'as':_0xec1d('0x1a3'),'foreignKey':_0xec1d('0x1a4'),'onDelete':_0xec1d('0x113'),'hooks':!![]});db[_0xec1d('0x165')][_0xec1d('0x116')](db[_0xec1d('0x165')],{'as':_0xec1d('0x17e'),'foreignKey':_0xec1d('0x1a5'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0x86')][_0xec1d('0x116')](db['Interval'],{'as':_0xec1d('0x1a6'),'foreignKey':'IntervalId','onDelete':_0xec1d('0x113'),'hooks':!![],'required':![]});db[_0xec1d('0x86')]['hasMany'](db[_0xec1d('0x18')],{'as':_0xec1d('0x118'),'foreignKey':_0xec1d('0x153'),'onDelete':_0xec1d('0x161')});db['Interval']['hasMany'](db[_0xec1d('0x43')],{'as':_0xec1d('0x1a7'),'foreignKey':_0xec1d('0x153')});db['Interval']['hasMany'](db[_0xec1d('0x66')],{'as':_0xec1d('0x1a8'),'foreignKey':_0xec1d('0x153')});db[_0xec1d('0x86')][_0xec1d('0x116')](db[_0xec1d('0x4a')],{'as':_0xec1d('0x1a9'),'foreignKey':_0xec1d('0x153')});db[_0xec1d('0x86')]['hasMany'](db[_0xec1d('0x54')],{'as':'SmsApplications','foreignKey':_0xec1d('0x153')});db['Schedule'][_0xec1d('0x124')](db[_0xec1d('0x3b')],{});db[_0xec1d('0x8c')][_0xec1d('0x124')](db[_0xec1d('0x1aa')],{'foreignKey':_0xec1d('0x1ab')});db[_0xec1d('0x8c')][_0xec1d('0x124')](db[_0xec1d('0x98')],{'foreignKey':'CustomReportId'});db[_0xec1d('0x8e')][_0xec1d('0x126')](db[_0xec1d('0x1a')],{'as':_0xec1d('0x1ac'),'through':_0xec1d('0x14a'),'onDelete':'restrict'});db[_0xec1d('0x90')][_0xec1d('0x126')](db[_0xec1d('0x74')],{'through':_0xec1d('0x19b')});db['Tag'][_0xec1d('0x126')](db[_0xec1d('0x11c')],{'through':_0xec1d('0x190')});db[_0xec1d('0x90')][_0xec1d('0x126')](db[_0xec1d('0x121')],{'through':'mail_interaction_has_tags'});db['Tag'][_0xec1d('0x126')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xec1d('0x90')]['belongsToMany'](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xec1d('0x90')][_0xec1d('0x126')](db[_0xec1d('0x5f')],{'through':_0xec1d('0x188')});db[_0xec1d('0x90')][_0xec1d('0x126')](db[_0xec1d('0x101')],{'through':_0xec1d('0x1ad')});db[_0xec1d('0x92')]['belongsTo'](db[_0xec1d('0x91')],{'as':_0xec1d('0x1ae'),'foreignKey':_0xec1d('0x1af')});db[_0xec1d('0x19c')]['belongsTo'](db[_0xec1d('0x196')],{'as':_0xec1d('0x1b0'),'foreignKey':_0xec1d('0x1b1')});db['CmContactHasItem'][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x195')});db[_0xec1d('0x94')][_0xec1d('0x116')](db[_0xec1d('0x84')],{'as':{'plural':_0xec1d('0x1b2'),'singular':_0xec1d('0x1b3')},'foreignKey':_0xec1d('0x1b4'),'onDelete':_0xec1d('0x113'),'hooks':!![]});db[_0xec1d('0x94')]['hasMany'](db[_0xec1d('0x84')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xec1d('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0xec1d('0x94')][_0xec1d('0x116')](db[_0xec1d('0x7f')],{'as':_0xec1d('0x1a3'),'foreignKey':'TriggerId','onDelete':_0xec1d('0x113'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0xec1d('0x9d')],{'as':_0xec1d('0x1b6'),'onDelete':'cascade','foreignKey':_0xec1d('0x1b7'),'hooks':!![]});db[_0xec1d('0x1aa')][_0xec1d('0x116')](db[_0xec1d('0x9d')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0xec1d('0x116')](db[_0xec1d('0x9d')],{'as':_0xec1d('0x1b6'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1b8')});db[_0xec1d('0x9d')]['belongsTo'](db[_0xec1d('0x1b9')],{'foreignKey':_0xec1d('0x1b8')});db[_0xec1d('0xa1')][_0xec1d('0x116')](db[_0xec1d('0xa3')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xa3')][_0xec1d('0x116')](db['SalesforceField'],{'as':_0xec1d('0x1bb'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1bc')});db['SalesforceConfiguration'][_0xec1d('0x116')](db[_0xec1d('0xa5')],{'as':_0xec1d('0x1bd'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xec1d('0xa3')][_0xec1d('0x116')](db[_0xec1d('0xa5')],{'as':_0xec1d('0x1b6'),'onDelete':_0xec1d('0x113'),'foreignKey':'FieldId'});db[_0xec1d('0xa3')][_0xec1d('0x124')](db['SalesforceAccount'],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xa5')][_0xec1d('0x116')](db[_0xec1d('0xa5')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xa5')]['hasMany'](db[_0xec1d('0xa5')],{'as':_0xec1d('0x1bf'),'foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xa5')][_0xec1d('0x116')](db[_0xec1d('0xa5')],{'as':'Field','foreignKey':'FieldId'});db[_0xec1d('0xa5')]['belongsTo'](db['Variable'],{'as':_0xec1d('0x1c1'),'foreignKey':_0xec1d('0x1c2')});db['SugarcrmAccount'][_0xec1d('0x116')](db[_0xec1d('0xa9')],{'as':_0xec1d('0x1c3'),'onDelete':'cascade','foreignKey':_0xec1d('0x1ba')});db['SugarcrmConfiguration'][_0xec1d('0x116')](db[_0xec1d('0xab')],{'as':_0xec1d('0x1bb'),'onDelete':_0xec1d('0x113'),'foreignKey':'SubjectId'});db[_0xec1d('0xa9')][_0xec1d('0x116')](db[_0xec1d('0xab')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xa9')][_0xec1d('0x116')](db['SugarcrmField'],{'as':_0xec1d('0x1b6'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1c4')});db['SugarcrmConfiguration'][_0xec1d('0x124')](db[_0xec1d('0xa7')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xab')][_0xec1d('0x116')](db[_0xec1d('0xab')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xab')][_0xec1d('0x116')](db[_0xec1d('0xab')],{'as':_0xec1d('0x1bf'),'foreignKey':'DescriptionId'});db[_0xec1d('0xab')][_0xec1d('0x116')](db['SugarcrmField'],{'as':'Field','foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xab')][_0xec1d('0x124')](db[_0xec1d('0x1c1')],{'as':_0xec1d('0x1c1'),'foreignKey':'VariableId'});db[_0xec1d('0xac')]['hasMany'](db[_0xec1d('0xae')],{'as':_0xec1d('0x1c3'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xae')][_0xec1d('0x116')](db[_0xec1d('0x1c5')],{'as':'Subjects','onDelete':_0xec1d('0x113'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0xec1d('0x116')](db[_0xec1d('0x1c5')],{'as':_0xec1d('0x1bd'),'onDelete':'cascade','foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xae')]['hasMany'](db[_0xec1d('0x1c5')],{'as':_0xec1d('0x1b6'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1c4')});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':_0xec1d('0x173'),'foreignKey':'AccountId'});db[_0xec1d('0xae')]['belongsToMany'](db['Tag'],{'through':'int_desk_configuration_has_tags'});db['DeskField']['hasMany'](db[_0xec1d('0x1c5')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0x1c5')][_0xec1d('0x116')](db[_0xec1d('0x1c5')],{'as':_0xec1d('0x1bf'),'foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0x1c5')][_0xec1d('0x116')](db['DeskField'],{'as':_0xec1d('0x1c6'),'foreignKey':_0xec1d('0x1c4')});db['DeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xec1d('0x1c2')});db[_0xec1d('0x1c7')][_0xec1d('0x116')](db[_0xec1d('0xb1')],{'as':_0xec1d('0x1c3'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xb1')][_0xec1d('0x116')](db[_0xec1d('0xb3')],{'as':_0xec1d('0x1bb'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xb1')][_0xec1d('0x116')](db['ZohoField'],{'as':'Descriptions','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xb1')]['hasMany'](db[_0xec1d('0xb3')],{'as':_0xec1d('0x1b6'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xb1')][_0xec1d('0x124')](db[_0xec1d('0x1c7')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xb3')][_0xec1d('0x116')](db[_0xec1d('0xb3')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xb3')][_0xec1d('0x116')](db[_0xec1d('0xb3')],{'as':'Description','foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xb3')][_0xec1d('0x116')](db[_0xec1d('0xb3')],{'as':'Field','foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xb3')][_0xec1d('0x124')](db['Variable'],{'as':_0xec1d('0x1c1'),'foreignKey':_0xec1d('0x1c2')});db[_0xec1d('0xb4')][_0xec1d('0x116')](db[_0xec1d('0xb6')],{'as':_0xec1d('0x1c3'),'onDelete':_0xec1d('0x113'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xec1d('0x116')](db[_0xec1d('0xb8')],{'as':_0xec1d('0x1bb'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xb6')][_0xec1d('0x116')](db[_0xec1d('0xb8')],{'as':_0xec1d('0x1bd'),'foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xb6')]['hasMany'](db['ZendeskField'],{'as':_0xec1d('0x1b6'),'foreignKey':_0xec1d('0x1c4')});db['ZendeskConfiguration'][_0xec1d('0x124')](db[_0xec1d('0xb4')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xb6')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x1c8')});db[_0xec1d('0xb8')][_0xec1d('0x116')](db[_0xec1d('0xb8')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xec1d('0xb8')]['hasMany'](db['ZendeskField'],{'as':_0xec1d('0x1bf'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0xec1d('0x116')](db['ZendeskField'],{'as':_0xec1d('0x1c6'),'foreignKey':_0xec1d('0x1c4')});db['ZendeskField'][_0xec1d('0x124')](db['Variable'],{'as':_0xec1d('0x1c1'),'foreignKey':'VariableId'});db[_0xec1d('0xb9')][_0xec1d('0x116')](db[_0xec1d('0xbb')],{'as':'Configurations','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xbb')]['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0xec1d('0x113'),'foreignKey':'SubjectId'});db[_0xec1d('0xbb')][_0xec1d('0x116')](db[_0xec1d('0x1c9')],{'as':'Descriptions','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1c0')});db['FreshdeskConfiguration'][_0xec1d('0x116')](db[_0xec1d('0x1c9')],{'as':_0xec1d('0x1b6'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xbb')][_0xec1d('0x124')](db['FreshdeskAccount'],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xbb')][_0xec1d('0x126')](db['Tag'],{'through':_0xec1d('0x1ca')});db[_0xec1d('0x1c9')][_0xec1d('0x116')](db[_0xec1d('0x1c9')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db['FreshdeskField']['hasMany'](db[_0xec1d('0x1c9')],{'as':'Description','foreignKey':_0xec1d('0x1c0')});db['FreshdeskField'][_0xec1d('0x116')](db[_0xec1d('0x1c9')],{'as':_0xec1d('0x1c6'),'foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0x1c9')]['belongsTo'](db[_0xec1d('0x1c1')],{'as':_0xec1d('0x1c1'),'foreignKey':'VariableId'});db[_0xec1d('0xbd')][_0xec1d('0x116')](db[_0xec1d('0xbe')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xec1d('0x1ba')});db['VtigerConfiguration'][_0xec1d('0x116')](db['VtigerField'],{'as':_0xec1d('0x1bb'),'foreignKey':'SubjectId'});db[_0xec1d('0xbe')][_0xec1d('0x116')](db[_0xec1d('0x1cb')],{'as':_0xec1d('0x1bd'),'foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xbe')][_0xec1d('0x116')](db['VtigerField'],{'as':_0xec1d('0x1b6'),'foreignKey':'FieldId'});db[_0xec1d('0xbe')]['belongsTo'](db[_0xec1d('0xbd')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1ba')});db['VtigerField'][_0xec1d('0x116')](db[_0xec1d('0x1cb')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db['VtigerField'][_0xec1d('0x116')](db['VtigerField'],{'as':_0xec1d('0x1bf'),'foreignKey':'DescriptionId'});db[_0xec1d('0x1cb')][_0xec1d('0x116')](db[_0xec1d('0x1cb')],{'as':'Field','foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0x1cb')][_0xec1d('0x124')](db[_0xec1d('0x1c1')],{'as':_0xec1d('0x1c1'),'foreignKey':_0xec1d('0x1c2')});db[_0xec1d('0xc0')][_0xec1d('0x116')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1ba')});db[_0xec1d('0xc2')]['hasMany'](db[_0xec1d('0xc4')],{'as':_0xec1d('0x1bb'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xc2')][_0xec1d('0x116')](db[_0xec1d('0xc4')],{'as':_0xec1d('0x1bd'),'foreignKey':_0xec1d('0x1c0')});db['ServicenowConfiguration'][_0xec1d('0x116')](db['ServicenowField'],{'as':_0xec1d('0x1b6'),'foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xc2')][_0xec1d('0x124')](db[_0xec1d('0xc0')],{'as':'Account','foreignKey':'AccountId'});db[_0xec1d('0xc4')][_0xec1d('0x116')](db[_0xec1d('0xc4')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db['ServicenowField'][_0xec1d('0x116')](db[_0xec1d('0xc4')],{'as':_0xec1d('0x1bf'),'foreignKey':'DescriptionId'});db[_0xec1d('0xc4')][_0xec1d('0x116')](db[_0xec1d('0xc4')],{'as':_0xec1d('0x1c6'),'foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xc4')][_0xec1d('0x124')](db['Variable'],{'as':_0xec1d('0x1c1'),'foreignKey':_0xec1d('0x1c2')});db[_0xec1d('0xc6')]['hasMany'](db['Dynamics365Configuration'],{'as':_0xec1d('0x1c3'),'onDelete':_0xec1d('0x113'),'foreignKey':'AccountId'});db['Dynamics365Account'][_0xec1d('0x124')](db[_0xec1d('0x109')],{'as':_0xec1d('0x109'),'foreignKey':_0xec1d('0x163')});db[_0xec1d('0x1cc')]['hasMany'](db['Dynamics365Field'],{'as':_0xec1d('0x1bb'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1bc')});db['Dynamics365Configuration'][_0xec1d('0x116')](db[_0xec1d('0xc9')],{'as':_0xec1d('0x1bd'),'onDelete':'cascade','foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0x1cc')][_0xec1d('0x116')](db['Dynamics365Field'],{'as':_0xec1d('0x1b6'),'onDelete':'cascade','foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0x1cc')][_0xec1d('0x124')](db[_0xec1d('0xc6')],{'as':_0xec1d('0x173'),'foreignKey':'AccountId'});db[_0xec1d('0xc9')][_0xec1d('0x116')](db[_0xec1d('0xc9')],{'as':_0xec1d('0x1be'),'foreignKey':_0xec1d('0x1bc')});db['Dynamics365Field'][_0xec1d('0x116')](db[_0xec1d('0xc9')],{'as':_0xec1d('0x1bf'),'foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xc9')][_0xec1d('0x116')](db[_0xec1d('0xc9')],{'as':_0xec1d('0x1c6'),'foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xc9')][_0xec1d('0x124')](db[_0xec1d('0x1c1')],{'as':_0xec1d('0x1c1'),'foreignKey':_0xec1d('0x1c2')});db[_0xec1d('0x1cd')][_0xec1d('0x116')](db[_0xec1d('0xca')],{'as':'Configurations','onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1ba')});db['FreshsalesConfiguration'][_0xec1d('0x116')](db[_0xec1d('0xcc')],{'as':_0xec1d('0x1bb'),'foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xca')][_0xec1d('0x116')](db[_0xec1d('0xcc')],{'as':'Descriptions','foreignKey':_0xec1d('0x1c0')});db[_0xec1d('0xca')][_0xec1d('0x116')](db['FreshsalesField'],{'as':_0xec1d('0x1b6'),'foreignKey':_0xec1d('0x1c4')});db['FreshsalesConfiguration'][_0xec1d('0x124')](db[_0xec1d('0x1cd')],{'as':'Account','foreignKey':_0xec1d('0x1ba')});db['FreshsalesField'][_0xec1d('0x116')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xec1d('0x1bc')});db[_0xec1d('0xcc')][_0xec1d('0x116')](db['FreshsalesField'],{'as':_0xec1d('0x1bf'),'foreignKey':'DescriptionId'});db[_0xec1d('0xcc')][_0xec1d('0x116')](db[_0xec1d('0xcc')],{'as':'Field','foreignKey':_0xec1d('0x1c4')});db[_0xec1d('0xcc')][_0xec1d('0x124')](db[_0xec1d('0x1c1')],{'as':_0xec1d('0x1c1'),'foreignKey':_0xec1d('0x1c2')});db[_0xec1d('0xd0')][_0xec1d('0x124')](db[_0xec1d('0x62')],{});db['ChatQueueReport'][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':'List','foreignKey':_0xec1d('0x169')});db[_0xec1d('0xd0')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xec1d('0xd0')]['belongsTo'](db[_0xec1d('0x11c')],{});db[_0xec1d('0xd0')]['belongsTo'](db[_0xec1d('0x69')],{});db[_0xec1d('0xd0')][_0xec1d('0x124')](db['User'],{});db[_0xec1d('0xd0')][_0xec1d('0x124')](db[_0xec1d('0x6d')],{});db['ChatInternalMessage'][_0xec1d('0x124')](db['User'],{'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1ce')});db[_0xec1d('0xd2')]['belongsTo'](db[_0xec1d('0x13')],{'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x1cf')});db[_0xec1d('0xd6')][_0xec1d('0x116')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xec1d('0x113')});db['JscriptySessionReport'][_0xec1d('0x116')](db[_0xec1d('0xd3')],{'foreignKey':_0xec1d('0x1d0'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0xd8')]['belongsTo'](db[_0xec1d('0x52')],{});db[_0xec1d('0xd8')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db[_0xec1d('0xd8')]['belongsTo'](db[_0xec1d('0x74')],{'as':'Contact','foreignKey':_0xec1d('0x160')});db[_0xec1d('0xd8')]['belongsTo'](db[_0xec1d('0x11e')],{});db[_0xec1d('0xd8')]['belongsTo'](db[_0xec1d('0x57')],{});db[_0xec1d('0xd8')]['belongsTo'](db[_0xec1d('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xec1d('0x59')],{});db[_0xec1d('0xdd')][_0xec1d('0x116')](db[_0xec1d('0xd6')],{'foreignKey':_0xec1d('0x1d1')});db[_0xec1d('0xdd')][_0xec1d('0x116')](db[_0xec1d('0x1d2')],{'foreignKey':_0xec1d('0x1d1')});db[_0xec1d('0xdd')]['hasMany'](db[_0xec1d('0xd3')],{'foreignKey':_0xec1d('0x1d1')});db[_0xec1d('0xe6')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x1d3')});db[_0xec1d('0xe6')][_0xec1d('0x126')](db[_0xec1d('0x1c')],{'through':_0xec1d('0x10b'),'as':_0xec1d('0x1d4')});db[_0xec1d('0xe6')][_0xec1d('0x126')](db[_0xec1d('0x3d')],{'through':_0xec1d('0x1d5'),'as':_0xec1d('0x133')});db[_0xec1d('0xe6')][_0xec1d('0x126')](db[_0xec1d('0x6d')],{'through':'team_has_chat_queues','as':_0xec1d('0x134')});db[_0xec1d('0xe6')][_0xec1d('0x126')](db[_0xec1d('0x4f')],{'through':_0xec1d('0x17d'),'as':_0xec1d('0x135')});db[_0xec1d('0xe6')]['belongsToMany'](db[_0xec1d('0x59')],{'through':_0xec1d('0x1d6'),'as':_0xec1d('0x137')});db[_0xec1d('0xe6')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0xec1d('0x18a'),'as':_0xec1d('0x138')});db[_0xec1d('0xe6')]['belongsToMany'](db[_0xec1d('0x108')],{'through':_0xec1d('0x1d7'),'as':_0xec1d('0x1d8')});db[_0xec1d('0xe6')]['belongsToMany'](db[_0xec1d('0xf6')],{'through':'TeamVoicePrefix','as':_0xec1d('0x132')});db[_0xec1d('0xe9')][_0xec1d('0x116')](db[_0xec1d('0x196')],{'as':_0xec1d('0x197'),'foreignKey':_0xec1d('0x19e')});db[_0xec1d('0xe9')][_0xec1d('0x116')](db[_0xec1d('0x79')],{'as':_0xec1d('0x14d'),'foreignKey':_0xec1d('0x19e')});db[_0xec1d('0xe9')][_0xec1d('0x116')](db[_0xec1d('0x7b')],{'as':_0xec1d('0x14e'),'foreignKey':_0xec1d('0x19e')});db['Campaign'][_0xec1d('0x116')](db[_0xec1d('0x77')],{'as':'HopperBlacks','foreignKey':_0xec1d('0x19e')});db[_0xec1d('0xe9')][_0xec1d('0x124')](db[_0xec1d('0x2b')],{'as':_0xec1d('0x2b'),'foreignKey':'TrunkId'});db[_0xec1d('0xe9')][_0xec1d('0x124')](db[_0xec1d('0x2b')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xec1d('0xe9')][_0xec1d('0x124')](db['Interval'],{'as':'Interval','foreignKey':_0xec1d('0x153')});db[_0xec1d('0xe9')]['belongsTo'](db[_0xec1d('0xe1')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xec1d('0xe9')]['belongsToMany'](db[_0xec1d('0xf4')],{'as':_0xec1d('0x1d9'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0xec1d('0x126')](db[_0xec1d('0xf4')],{'as':'BlackLists','through':_0xec1d('0x1da')});db['Attachment'][_0xec1d('0x124')](db[_0xec1d('0x6b')],{'as':_0xec1d('0x6b'),'foreignKey':_0xec1d('0x175')});db[_0xec1d('0xed')][_0xec1d('0x124')](db[_0xec1d('0x41')],{});db['MailTransferReport'][_0xec1d('0x124')](db['MailInteraction'],{});db[_0xec1d('0xed')][_0xec1d('0x124')](db['MailAccount'],{'foreignKey':_0xec1d('0x1db'),'as':_0xec1d('0x1dc')});db[_0xec1d('0xed')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1dd'),'as':_0xec1d('0x1de')});db[_0xec1d('0xed')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1df'),'as':_0xec1d('0x1e0')});db[_0xec1d('0xed')][_0xec1d('0x124')](db['MailQueue'],{'foreignKey':_0xec1d('0x1e1'),'as':_0xec1d('0x1e2')});db['MailTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x3b')],{'foreignKey':_0xec1d('0x1e3'),'as':_0xec1d('0x1e4')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db['ChatTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x11c')],{});db[_0xec1d('0xee')][_0xec1d('0x124')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0xec1d('0x1dc')});db[_0xec1d('0xee')]['belongsTo'](db['User'],{'foreignKey':_0xec1d('0x1dd'),'as':_0xec1d('0x1de')});db[_0xec1d('0xee')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1df'),'as':_0xec1d('0x1e0')});db['ChatTransferReport'][_0xec1d('0x124')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0xec1d('0x1e2')});db['ChatTransferReport']['belongsTo'](db[_0xec1d('0x62')],{'foreignKey':_0xec1d('0x1e5'),'as':_0xec1d('0x1e4')});db[_0xec1d('0x1e6')][_0xec1d('0x124')](db[_0xec1d('0x17c')],{});db[_0xec1d('0x1e6')]['belongsTo'](db[_0xec1d('0x4c')],{});db['FaxTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x49')],{'foreignKey':_0xec1d('0x1e7'),'as':'FromAccount'});db[_0xec1d('0x1e6')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xec1d('0x1e6')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1df'),'as':'ToAgent'});db[_0xec1d('0x1e6')][_0xec1d('0x124')](db[_0xec1d('0x4f')],{'foreignKey':_0xec1d('0x1e8'),'as':_0xec1d('0x1e2')});db['FaxTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x49')],{'foreignKey':_0xec1d('0x1e9'),'as':_0xec1d('0x1e4')});db[_0xec1d('0x1ea')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xec1d('0x1ea')]['belongsTo'](db[_0xec1d('0x5f')],{});db[_0xec1d('0x1ea')][_0xec1d('0x124')](db[_0xec1d('0x5b')],{'foreignKey':_0xec1d('0x1eb'),'as':_0xec1d('0x1dc')});db['OpenchannelTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1dd'),'as':_0xec1d('0x1de')});db[_0xec1d('0x1ea')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1df'),'as':_0xec1d('0x1e0')});db['OpenchannelTransferReport']['belongsTo'](db[_0xec1d('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db['OpenchannelTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x5b')],{'foreignKey':_0xec1d('0x1ec'),'as':_0xec1d('0x1e4')});db[_0xec1d('0xf2')][_0xec1d('0x124')](db['SmsMessage'],{});db[_0xec1d('0xf2')][_0xec1d('0x124')](db[_0xec1d('0x11e')],{});db[_0xec1d('0xf2')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xec1d('0x1ed'),'as':'FromAccount'});db[_0xec1d('0xf2')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':'FromUserId','as':_0xec1d('0x1de')});db[_0xec1d('0xf2')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':_0xec1d('0x1df'),'as':_0xec1d('0x1e0')});db[_0xec1d('0xf2')][_0xec1d('0x124')](db[_0xec1d('0x59')],{'foreignKey':'ToSmsQueueId','as':_0xec1d('0x1e2')});db[_0xec1d('0xf2')][_0xec1d('0x124')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xec1d('0xf4')][_0xec1d('0x116')](db[_0xec1d('0x165')],{'as':'Dispositions','foreignKey':_0xec1d('0x169'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0xf4')]['hasMany'](db['CmCustomField'],{'as':_0xec1d('0x1ee'),'foreignKey':_0xec1d('0x169')});db[_0xec1d('0xf4')]['hasMany'](db['CmContact'],{'as':_0xec1d('0x129'),'onDelete':_0xec1d('0x113'),'foreignKey':_0xec1d('0x169')});db['CmList']['hasMany'](db[_0xec1d('0x79')],{'as':_0xec1d('0x14d'),'foreignKey':'ListId'});db[_0xec1d('0xf4')]['hasMany'](db[_0xec1d('0x7b')],{'as':_0xec1d('0x119'),'foreignKey':_0xec1d('0x169')});db[_0xec1d('0xf4')][_0xec1d('0x116')](db[_0xec1d('0x11a')],{'as':_0xec1d('0x11a'),'foreignKey':'ListId'});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0xec1d('0x1ef'),'through':_0xec1d('0x1f0')});db['CmList'][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x12a')});db[_0xec1d('0xf6')][_0xec1d('0x116')](db['VoiceExtension'],{'as':_0xec1d('0x118'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0xf6')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x10f')});db['VoicePrefix'][_0xec1d('0x126')](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db[_0xec1d('0x125')]['hasMany'](db['User'],{'as':'Users','foreignKey':_0xec1d('0x1f1')});db[_0xec1d('0x125')][_0xec1d('0x116')](db[_0xec1d('0xf8')],{'as':_0xec1d('0x1f2'),'foreignKey':_0xec1d('0x1f1'),'onDelete':_0xec1d('0x113')});db[_0xec1d('0xf8')]['hasMany'](db[_0xec1d('0xfa')],{'as':_0xec1d('0x1f3'),'foreignKey':_0xec1d('0x1f4'),'onDelete':_0xec1d('0x113')});db['WhatsappAccount'][_0xec1d('0x116')](db['Disposition'],{'as':_0xec1d('0x17e'),'foreignKey':'WhatsappAccountId','onDelete':_0xec1d('0x113')});db[_0xec1d('0x142')][_0xec1d('0x116')](db['CannedAnswer'],{'as':_0xec1d('0x167'),'foreignKey':_0xec1d('0x1f5')});db[_0xec1d('0x142')][_0xec1d('0x116')](db[_0xec1d('0x103')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0xec1d('0x142')][_0xec1d('0x116')](db['WhatsappInteraction'],{'as':_0xec1d('0x177')});db[_0xec1d('0x142')][_0xec1d('0x116')](db['WhatsappApplication'],{'as':_0xec1d('0x148')});db[_0xec1d('0x142')][_0xec1d('0x124')](db[_0xec1d('0xf4')],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db[_0xec1d('0x142')][_0xec1d('0x124')](db[_0xec1d('0x88')],{'as':_0xec1d('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':'user_has_whatsapp_accounts'});db[_0xec1d('0xff')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'onDelete':_0xec1d('0x161')});db['WhatsappApplication']['belongsTo'](db[_0xec1d('0x108')],{'onDelete':_0xec1d('0x161')});db[_0xec1d('0xff')][_0xec1d('0x124')](db[_0xec1d('0x142')],{'onDelete':_0xec1d('0x161')});db[_0xec1d('0xff')][_0xec1d('0x124')](db[_0xec1d('0x86')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['WhatsappApplication'][_0xec1d('0x124')](db[_0xec1d('0x90')],{'onDelete':_0xec1d('0x161'),'foreignKey':_0xec1d('0x176')});db['WhatsappInteraction'][_0xec1d('0x116')](db[_0xec1d('0x103')],{'as':'Messages','onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0xec1d('0x124')](db[_0xec1d('0x142')],{'as':_0xec1d('0x173'),'foreignKey':'WhatsappAccountId'});db[_0xec1d('0x101')]['belongsTo'](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x101')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':'Owner','foreignKey':_0xec1d('0x114')});db[_0xec1d('0x101')]['belongsToMany'](db[_0xec1d('0x90')],{'through':_0xec1d('0x1ad'),'as':_0xec1d('0x16f')});db[_0xec1d('0x101')][_0xec1d('0x126')](db[_0xec1d('0x90')],{'through':_0xec1d('0x1ad'),'as':_0xec1d('0x182')});db[_0xec1d('0x101')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x170'),'through':'user_has_whatsapp_interactions','foreignKey':_0xec1d('0x1f6')});db['WhatsappMessage'][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':_0xec1d('0x13')});db['WhatsappMessage'][_0xec1d('0x124')](db[_0xec1d('0x74')],{'onDelete':_0xec1d('0x113'),'as':'Contact'});db[_0xec1d('0x103')][_0xec1d('0x124')](db[_0xec1d('0x101')],{'onDelete':_0xec1d('0x113'),'as':_0xec1d('0x183'),'foreignKey':_0xec1d('0x1f6')});db[_0xec1d('0x103')][_0xec1d('0x124')](db[_0xec1d('0x142')],{'as':_0xec1d('0x173'),'foreignKey':_0xec1d('0x1f5')});db[_0xec1d('0x104')][_0xec1d('0x124')](db[_0xec1d('0x142')],{});db[_0xec1d('0x104')][_0xec1d('0x124')](db['CmList'],{'as':_0xec1d('0x168'),'foreignKey':_0xec1d('0x169')});db[_0xec1d('0x104')][_0xec1d('0x124')](db[_0xec1d('0x74')],{'as':_0xec1d('0x15f'),'foreignKey':_0xec1d('0x160')});db[_0xec1d('0x104')][_0xec1d('0x124')](db[_0xec1d('0x101')],{});db[_0xec1d('0x104')][_0xec1d('0x124')](db[_0xec1d('0x108')],{});db[_0xec1d('0x104')][_0xec1d('0x124')](db['WhatsappMessage'],{});db[_0xec1d('0x104')][_0xec1d('0x124')](db['User'],{});db[_0xec1d('0x106')][_0xec1d('0x124')](db[_0xec1d('0x103')],{});db[_0xec1d('0x106')]['belongsTo'](db[_0xec1d('0x101')],{});db[_0xec1d('0x106')][_0xec1d('0x124')](db['WhatsappAccount'],{'foreignKey':_0xec1d('0x1f7'),'as':_0xec1d('0x1dc')});db['WhatsappTransferReport'][_0xec1d('0x124')](db[_0xec1d('0x142')],{'foreignKey':_0xec1d('0x1f8'),'as':'ToAccount'});db[_0xec1d('0x106')][_0xec1d('0x124')](db[_0xec1d('0x108')],{'foreignKey':_0xec1d('0x1f9'),'as':_0xec1d('0x1e2')});db[_0xec1d('0x106')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'foreignKey':'FromUserId','as':_0xec1d('0x1de')});db[_0xec1d('0x106')]['belongsTo'](db[_0xec1d('0x13')],{'foreignKey':'ToUserId','as':_0xec1d('0x1e0')});db[_0xec1d('0x108')][_0xec1d('0x126')](db[_0xec1d('0x13')],{'as':_0xec1d('0x156'),'through':_0xec1d('0x139'),'foreignKey':_0xec1d('0x1fa')});db[_0xec1d('0x108')][_0xec1d('0x126')](db[_0xec1d('0xe6')],{'through':_0xec1d('0x1d7'),'as':_0xec1d('0x157')});db[_0xec1d('0x110')][_0xec1d('0x124')](db[_0xec1d('0x13')],{'as':'user','foreignKey':_0xec1d('0x114'),'onDelete':_0xec1d('0x113'),'hooks':!![]});db[_0xec1d('0x109')][_0xec1d('0x112')](db[_0xec1d('0xc6')],{'as':_0xec1d('0xc6'),'onDelete':_0xec1d('0x161')});db[_0xec1d('0x109')][_0xec1d('0x112')](db['MailServerIn'],{'as':_0xec1d('0x164'),'onDelete':'restrict'});db[_0xec1d('0x109')][_0xec1d('0x112')](db['MailServerOut'],{'as':_0xec1d('0x1fb'),'onDelete':_0xec1d('0x161')});module[_0xec1d('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x4a7d=['Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','userSetting','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','belongsTo','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','AgentReports','Contact','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','Applications','ListId','Agents','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','Users','Attachments','ChatWebsiteId','ChatOfflineMessageId','TagId','List','Items','FaxAccountId','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','ThroughTags','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','user_has_chat_websites','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','Website','CompanyId','Phones','CmContactId','CmHopper','cm_contact_has_tags','Agent','Campaign','CampaignId','OwnerId','Condition','All','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','DefaultReportId','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmConfiguration','Configurations','int_desk_configuration_has_tags','ZohoConfiguration','int_freshdesk_configuration_has_tags','Dynamics365Account','FreshsalesAccount','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','MailQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','FromUserId','ToFaxAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','utf8mb4','name','defaultsDeep','sequelizeHistory','127.0.0.1','mysql','utf8','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model'];(function(_0x45e1ca,_0x1d9d40){var _0x20a9cc=function(_0x13deb9){while(--_0x13deb9){_0x45e1ca['push'](_0x45e1ca['shift']());}};_0x20a9cc(++_0x1d9d40);}(_0x4a7d,0x1b7));var _0xd4a7=function(_0x42dab7,_0x59aa29){_0x42dab7=_0x42dab7-0x0;var _0x271a0f=_0x4a7d[_0x42dab7];return _0x271a0f;};'use strict';var config=require(_0xd4a7('0x0'));var Sequelize=require(_0xd4a7('0x1'));var _=require(_0xd4a7('0x2'));var jstz=require(_0xd4a7('0x3'));var timezone=jstz[_0xd4a7('0x4')]();config[_0xd4a7('0x1')]=_['defaultsDeep'](config[_0xd4a7('0x1')],{'database':_0xd4a7('0x5'),'username':_0xd4a7('0x6'),'password':_0xd4a7('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd4a7('0x8')},'logging':![],'timezone':timezone[_0xd4a7('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xd4a7('0xa')](config[_0xd4a7('0xb')],{'database':'motion2','username':'xcall','password':_0xd4a7('0x7'),'options':{'host':_0xd4a7('0xc'),'port':0xcea,'dialect':_0xd4a7('0xd'),'dialectOptions':{'charset':_0xd4a7('0x8')},'logging':![],'timezone':timezone[_0xd4a7('0x9')](),'define':{'charset':_0xd4a7('0xe'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd4a7('0x1')][_0xd4a7('0xf')],config[_0xd4a7('0x1')][_0xd4a7('0x10')],config[_0xd4a7('0x1')]['password'],config[_0xd4a7('0x1')][_0xd4a7('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd4a7('0xb')][_0xd4a7('0xf')],config[_0xd4a7('0xb')]['username'],config[_0xd4a7('0xb')][_0xd4a7('0x12')],config['sequelizeHistory']['options'])};db[_0xd4a7('0x13')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x15'));db[_0xd4a7('0x16')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x17'));db[_0xd4a7('0x18')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x19'));db[_0xd4a7('0x1a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x1b'));db[_0xd4a7('0x1c')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x1d'));db[_0xd4a7('0x1e')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x1f'));db[_0xd4a7('0x20')]=db['sequelize']['import'](_0xd4a7('0x21'));db[_0xd4a7('0x22')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x23'));db[_0xd4a7('0x24')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voiceMail/voiceMail.model');db[_0xd4a7('0x25')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x26'));db['VoiceCallReport']=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x27'));db[_0xd4a7('0x28')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xd4a7('0x29')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x2a'));db[_0xd4a7('0x2b')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xd4a7('0x2c')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x2d'));db[_0xd4a7('0x2e')]=db['sequelize']['import'](_0xd4a7('0x2f'));db['VoiceTransferReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x30'));db[_0xd4a7('0x31')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x32'));db[_0xd4a7('0x33')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd4a7('0x34')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x35'));db[_0xd4a7('0x36')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x37'));db['UserFaxQueue']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x38'));db[_0xd4a7('0x39')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0xd4a7('0x3a')]=db['sequelize']['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd4a7('0x3b')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x3c'));db[_0xd4a7('0x3d')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x3e'));db[_0xd4a7('0x3f')]=db['sequelize']['import'](_0xd4a7('0x40'));db[_0xd4a7('0x41')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x42'));db[_0xd4a7('0x43')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x44'));db['MailSubstatus']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x45'));db[_0xd4a7('0x46')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x47'));db[_0xd4a7('0x48')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x49'));db[_0xd4a7('0x4a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x4b'));db[_0xd4a7('0x4c')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x4d'));db[_0xd4a7('0x4e')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x4f'));db[_0xd4a7('0x50')]=db['sequelize']['import'](_0xd4a7('0x51'));db[_0xd4a7('0x52')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x53'));db[_0xd4a7('0x54')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x55'));db[_0xd4a7('0x56')]=db[_0xd4a7('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x57'));db[_0xd4a7('0x58')]=db['sequelize']['import'](_0xd4a7('0x59'));db[_0xd4a7('0x5a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x5b'));db[_0xd4a7('0x5c')]=db['sequelize'][_0xd4a7('0x14')]('../api/smsAccount/smsAccount.model');db[_0xd4a7('0x5d')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0xd4a7('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x5e'));db[_0xd4a7('0x5f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x60'));db[_0xd4a7('0x61')]=db['sequelize']['import'](_0xd4a7('0x62'));db[_0xd4a7('0x63')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x64'));db[_0xd4a7('0x65')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x66'));db[_0xd4a7('0x67')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x68'));db[_0xd4a7('0x69')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x6a'));db['ChatWebsite']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0xd4a7('0x6b')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x6c'));db[_0xd4a7('0x6d')]=db['sequelize']['import'](_0xd4a7('0x6e'));db[_0xd4a7('0x6f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x70'));db[_0xd4a7('0x71')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x72'));db[_0xd4a7('0x73')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x74'));db[_0xd4a7('0x75')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatQueue/chatQueue.model');db[_0xd4a7('0x76')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x77'));db['ChatProactiveAction']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xd4a7('0x78')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x79'));db[_0xd4a7('0x7a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x7b'));db['CmHopper']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/cmHopper/cmHopper.model');db[_0xd4a7('0x7c')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x7d'));db['CmHopperFinal']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x7e'));db[_0xd4a7('0x7f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x80'));db[_0xd4a7('0x81')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x82'));db[_0xd4a7('0x83')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x84'));db[_0xd4a7('0x85')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x86'));db[_0xd4a7('0x87')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x88'));db[_0xd4a7('0x89')]=db['sequelize'][_0xd4a7('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0xd4a7('0x8a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x8b'));db['Condition']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/condition/condition.model');db['Interval']=db['sequelize']['import'](_0xd4a7('0x8c'));db[_0xd4a7('0x8d')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x8e'));db[_0xd4a7('0x8f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x90'));db[_0xd4a7('0x91')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x92'));db[_0xd4a7('0x93')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x94'));db[_0xd4a7('0x95')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x96'));db[_0xd4a7('0x97')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x98'));db[_0xd4a7('0x99')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x9a'));db[_0xd4a7('0x9b')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x9c'));db[_0xd4a7('0x9d')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x9e'));db[_0xd4a7('0x9f')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xa0'));db[_0xd4a7('0xa1')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xa2'));db[_0xd4a7('0xa3')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xa4'));db[_0xd4a7('0xa5')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xa6'));db['IntegrationReport']=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xa7'));db[_0xd4a7('0xa8')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xa9'));db[_0xd4a7('0xaa')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xab'));db[_0xd4a7('0xac')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xad'));db[_0xd4a7('0xae')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xaf'));db['AnalyticFieldReport']=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xb0'));db[_0xd4a7('0xb1')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xb2'));db[_0xd4a7('0xb3')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xd4a7('0xb4')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xb5'));db[_0xd4a7('0xb6')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xb7'));db[_0xd4a7('0xb8')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xb9'));db[_0xd4a7('0xba')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xbb'));db[_0xd4a7('0xbc')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xbd'));db[_0xd4a7('0xbe')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xbf'));db[_0xd4a7('0xc0')]=db[_0xd4a7('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xd4a7('0xc1')]=db['sequelize']['import'](_0xd4a7('0xc2'));db['ZohoConfiguration']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xc3'));db[_0xd4a7('0xc4')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xc5'));db[_0xd4a7('0xc6')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xc7'));db[_0xd4a7('0xc8')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xc9'));db[_0xd4a7('0xca')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xcb'));db[_0xd4a7('0xcc')]=db['sequelize'][_0xd4a7('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xd4a7('0xcd')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xce'));db[_0xd4a7('0xcf')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xd0'));db[_0xd4a7('0xd1')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xd2'));db[_0xd4a7('0xd3')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xd4'));db[_0xd4a7('0xd5')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xd6'));db[_0xd4a7('0xd7')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xd8'));db[_0xd4a7('0xd9')]=db[_0xd4a7('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xd4a7('0xda')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xdb'));db['Dynamics365Account']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xd4a7('0xdc')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xdd'));db[_0xd4a7('0xde')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xdf'));db['FreshsalesAccount']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xd4a7('0xe0')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xe1'));db[_0xd4a7('0xa5')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xa6'));db[_0xd4a7('0xe2')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xe3'));db[_0xd4a7('0xe4')]=db['sequelize'][_0xd4a7('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0xd4a7('0xe5')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xe6'));db[_0xd4a7('0xe7')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xe8'));db[_0xd4a7('0xe9')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xea'));db[_0xd4a7('0xeb')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xec'));db[_0xd4a7('0xed')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xee'));db['SquareDetailsReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xef'));db[_0xd4a7('0xf0')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xf1'));db[_0xd4a7('0xf2')]=db[_0xd4a7('0x1')]['import']('../api/setting/setting.model');db[_0xd4a7('0xf3')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0xd4a7('0xf4')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xf5'));db[_0xd4a7('0xf6')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xf7'));db[_0xd4a7('0xf8')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xf9'));db[_0xd4a7('0xfa')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xfb'));db[_0xd4a7('0xfc')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xfd'));db['Campaign']=db[_0xd4a7('0x1')]['import']('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0xd4a7('0x14')]('../api/migration/migration.model');db[_0xd4a7('0xfe')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xff'));db['Plugin']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x100'));db[_0xd4a7('0x101')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x102'));db['ChatTransferReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x103'));db[_0xd4a7('0x104')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x105'));db[_0xd4a7('0x106')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x107'));db['CmList']=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x108'));db[_0xd4a7('0x109')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xd4a7('0x10a')]=db['sequelize'][_0xd4a7('0x14')]('../api/userProfile/userProfile.model');db[_0xd4a7('0x10b')]=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0xd4a7('0x10c')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x10d'));db['UserNotification']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x10e'));db[_0xd4a7('0x10f')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x110'));db[_0xd4a7('0x111')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x112'));db[_0xd4a7('0x113')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xd4a7('0x114')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x115'));db[_0xd4a7('0x116')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x117'));db[_0xd4a7('0x118')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x119'));db[_0xd4a7('0x11a')]=db['sequelize'][_0xd4a7('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0xd4a7('0x11b')]=db['sequelize'][_0xd4a7('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0xd4a7('0x11c')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x11d'));db[_0xd4a7('0x11e')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x11f'));db[_0xd4a7('0x120')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x121'));db[_0xd4a7('0x122')]=db['sequelize'][_0xd4a7('0x14')]('../api/user-setting/user-setting.model');db[_0xd4a7('0x13')][_0xd4a7('0x123')](db['VoiceMail'],{'as':_0xd4a7('0x24'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')][_0xd4a7('0x123')](db['UserSetting'],{'as':_0xd4a7('0x126'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x20')],{'as':'Recordings','foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xd4a7('0x128'),'foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':_0xd4a7('0x129'),'onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':'HopperFinals','foreignKey':'UserId'});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0xd4a7('0x12b'),'foreignKey':_0xd4a7('0x125')});db['User']['hasMany'](db[_0xd4a7('0x81')],{'as':_0xd4a7('0x81'),'foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x65')],{'as':'OpenchannelInteractions','foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')]['hasMany'](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x12c'),'foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db['SmsInteraction'],{'as':_0xd4a7('0x12d'),'foreignKey':'UserId'});db['User'][_0xd4a7('0x127')](db[_0xd4a7('0x56')],{'as':_0xd4a7('0x12e'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x46')],{'as':_0xd4a7('0x12f'),'foreignKey':'UserId'});db[_0xd4a7('0x13')]['hasMany'](db[_0xd4a7('0x113')],{'as':_0xd4a7('0x130'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x131')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0xd4a7('0x132')](db[_0xd4a7('0x10a')],{'as':_0xd4a7('0x10a'),'foreignKey':_0xd4a7('0x133')});db[_0xd4a7('0x13')]['belongsToMany'](db[_0xd4a7('0x76')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xd4a7('0x134')](db['CmContact'],{'as':_0xd4a7('0x135'),'through':_0xd4a7('0x136')});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x138'),'through':_0xd4a7('0x139')});db[_0xd4a7('0x13')]['belongsToMany'](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x13a')});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x46')],{'as':'MailInteractions','through':_0xd4a7('0x13b')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x12c'),'through':_0xd4a7('0x13c')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x56')],{'as':_0xd4a7('0x12e'),'through':_0xd4a7('0x13d')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x13e')],{'as':_0xd4a7('0x12d'),'through':_0xd4a7('0x13f')});db['User'][_0xd4a7('0x134')](db['OpenchannelInteraction'],{'as':_0xd4a7('0x140'),'through':_0xd4a7('0x141')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x113')],{'as':_0xd4a7('0x130'),'through':_0xd4a7('0x142')});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x143'),'through':_0xd4a7('0x33'),'required':![]});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db['VoicePrefix'],{'as':_0xd4a7('0x144'),'through':'UserVoicePrefix','required':![]});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x43')],{'as':'MailQueues','through':_0xd4a7('0x36'),'required':![]});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x75')],{'as':_0xd4a7('0x145'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xd4a7('0x58')],{'as':_0xd4a7('0x146'),'through':_0xd4a7('0x147'),'required':![]});db['User'][_0xd4a7('0x134')](db['SmsQueue'],{'as':_0xd4a7('0x148'),'through':_0xd4a7('0x39'),'required':![]});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x69')],{'as':_0xd4a7('0x149'),'through':_0xd4a7('0x3a'),'required':![]});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db['WhatsappQueue'],{'as':_0xd4a7('0x14a'),'through':_0xd4a7('0x3b'),'required':![]});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x137')],{'through':_0xd4a7('0x139')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x14c'),'through':'user_has_chat_websites'});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x52')],{'as':_0xd4a7('0x14d'),'through':_0xd4a7('0x14e')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x14f'),'through':'user_has_mail_accounts'});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x61')],{'as':_0xd4a7('0x150'),'through':_0xd4a7('0x151')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x5c')],{'as':_0xd4a7('0x152'),'through':_0xd4a7('0x153')});db[_0xd4a7('0x13')]['belongsToMany'](db[_0xd4a7('0x10f')],{'as':_0xd4a7('0x154'),'through':_0xd4a7('0x155')});db[_0xd4a7('0x16')][_0xd4a7('0x127')](db['VoiceExtension'],{'as':_0xd4a7('0x156'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x157')});db[_0xd4a7('0x18')]['hasMany'](db[_0xd4a7('0x1a')],{'onDelete':'cascade'});db[_0xd4a7('0x1a')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':'Applications','onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x1c')][_0xd4a7('0x134')](db['Sound'],{'as':'Sounds','through':_0xd4a7('0x158')});db['VoiceQueue'][_0xd4a7('0x127')](db[_0xd4a7('0x31')],{'as':_0xd4a7('0x159'),'foreignKey':_0xd4a7('0x15a')});db['VoiceQueue'][_0xd4a7('0x127')](db['CmHopper'],{'as':_0xd4a7('0x15b'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db['CmHopperHistory'],{'as':_0xd4a7('0x15d'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db[_0xd4a7('0x81')],{'as':'ReportAgentPreview','foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db['CmHopperBlack'],{'as':_0xd4a7('0x15e'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')]['hasMany'](db[_0xd4a7('0xe9')],{'as':_0xd4a7('0x15f'),'foreignKey':_0xd4a7('0x15a')});db['VoiceQueue'][_0xd4a7('0x132')](db[_0xd4a7('0x2e')],{'as':_0xd4a7('0x2e'),'foreignKey':_0xd4a7('0x160')});db[_0xd4a7('0x1e')][_0xd4a7('0x132')](db[_0xd4a7('0x2e')],{'as':_0xd4a7('0x161'),'foreignKey':_0xd4a7('0x162')});db[_0xd4a7('0x1e')][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x163'),'foreignKey':_0xd4a7('0x164')});db[_0xd4a7('0x1e')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db['VoiceQueue'][_0xd4a7('0x134')](db['CmList'],{'as':_0xd4a7('0x138'),'through':_0xd4a7('0x167')});db[_0xd4a7('0x1e')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x33')});db[_0xd4a7('0x1e')]['belongsToMany'](db[_0xd4a7('0xfa')],{'as':_0xd4a7('0x168'),'through':_0xd4a7('0x11c')});db[_0xd4a7('0x1e')][_0xd4a7('0x134')](db['CmList'],{'as':_0xd4a7('0x169'),'through':'voice_queues_has_cm_blacklists'});db[_0xd4a7('0x20')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x22')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x24')][_0xd4a7('0x127')](db[_0xd4a7('0x25')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x16b'),'sourceKey':_0xd4a7('0x16c')});db[_0xd4a7('0x25')][_0xd4a7('0x132')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xd4a7('0x16c')});db[_0xd4a7('0x16d')]['hasMany'](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xd4a7('0x16e'),'constraints':![]});db[_0xd4a7('0x16d')]['hasMany'](db['VoiceAgentReport'],{'as':_0xd4a7('0x16f'),'foreignKey':_0xd4a7('0x16e'),'constraints':![]});db[_0xd4a7('0x16d')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13'),'foreignKey':_0xd4a7('0x125')});db['VoiceCallReport'][_0xd4a7('0x132')](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db[_0xd4a7('0x3d')][_0xd4a7('0x132')](db['MailAccount'],{'as':_0xd4a7('0x41'),'foreignKey':'MailAccountId'});db['MailServerIn'][_0xd4a7('0x132')](db[_0xd4a7('0x11b')],{'as':_0xd4a7('0x11b'),'foreignKey':_0xd4a7('0x171'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x3f')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x41'),'foreignKey':_0xd4a7('0x173')});db['MailServerOut'][_0xd4a7('0x132')](db[_0xd4a7('0x11b')],{'as':_0xd4a7('0x11b'),'foreignKey':_0xd4a7('0x171'),'onDelete':'restrict'});db[_0xd4a7('0x41')][_0xd4a7('0x123')](db[_0xd4a7('0x3d')],{'as':_0xd4a7('0x174'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x41')][_0xd4a7('0x123')](db[_0xd4a7('0x3f')],{'as':_0xd4a7('0x175'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db['Disposition'],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x173'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x173')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db[_0xd4a7('0x48')],{'as':_0xd4a7('0x16a'),'foreignKey':'MailAccountId'});db[_0xd4a7('0x41')]['hasMany'](db[_0xd4a7('0x46')],{'as':_0xd4a7('0x178')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db[_0xd4a7('0x4a')],{'as':_0xd4a7('0x179')});db['MailAccount'][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':'List','foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x41')][_0xd4a7('0x132')](db['Template'],{'as':_0xd4a7('0x9f'),'foreignKey':'TemplateId'});db[_0xd4a7('0x41')][_0xd4a7('0x132')](db['Pause'],{'as':_0xd4a7('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd4a7('0x41')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':'user_has_mail_accounts'});db[_0xd4a7('0x43')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x17b'),'through':'UserMailQueue'});db[_0xd4a7('0x43')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x17c'),'as':_0xd4a7('0x168')});db[_0xd4a7('0x46')][_0xd4a7('0x127')](db[_0xd4a7('0x48')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x17d')});db[_0xd4a7('0x46')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x17e'),'foreignKey':'MailAccountId'});db[_0xd4a7('0x46')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x46')]['belongsTo'](db['User'],{'as':_0xd4a7('0x180'),'foreignKey':'UserId'});db[_0xd4a7('0x46')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x181'),'as':_0xd4a7('0x182')});db[_0xd4a7('0x46')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x181'),'as':'ThroughTags'});db[_0xd4a7('0x46')]['belongsToMany'](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x13b'),'foreignKey':_0xd4a7('0x17d')});db['MailMessage'][_0xd4a7('0x127')](db['Attachment'],{'as':_0xd4a7('0x184'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x170')});db[_0xd4a7('0x48')]['belongsTo'](db[_0xd4a7('0x46')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x173')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':'ChatWebsite','foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db['ChatOfflineMessage'],{'as':_0xd4a7('0x73'),'foreignKey':_0xd4a7('0x186')});db[_0xd4a7('0x4a')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x4a')][_0xd4a7('0x132')](db[_0xd4a7('0x43')],{'onDelete':'restrict'});db[_0xd4a7('0x4a')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x4a')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xd4a7('0x164')});db['MailApplication']['belongsTo'](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db['MailQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':'ListId'});db[_0xd4a7('0x4c')]['belongsTo'](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db['MailQueueReport'][_0xd4a7('0x132')](db['MailInteraction'],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x48')],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x43')],{});db['Dashboard'][_0xd4a7('0x127')](db[_0xd4a7('0x50')],{'as':_0xd4a7('0x189'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':'Dispositions','foreignKey':_0xd4a7('0x18a'),'onDelete':_0xd4a7('0x124')});db['FaxAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x18a')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db['FaxInteraction'],{'as':_0xd4a7('0x178')});db['FaxAccount']['hasMany'](db['FaxApplication'],{'as':_0xd4a7('0x179')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':'Exntensions','onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db[_0xd4a7('0x18b')],{'as':_0xd4a7('0x16a')});db[_0xd4a7('0x52')]['belongsTo'](db['Trunk'],{'as':_0xd4a7('0x2e')});db[_0xd4a7('0x52')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x52')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db[_0xd4a7('0x52')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x14e')});db[_0xd4a7('0x54')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x54')][_0xd4a7('0x132')](db['FaxQueue'],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x54')]['belongsTo'](db[_0xd4a7('0x52')],{'onDelete':_0xd4a7('0x172')});db['FaxApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db[_0xd4a7('0x56')]['hasMany'](db[_0xd4a7('0x18b')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x18c')});db[_0xd4a7('0x56')][_0xd4a7('0x132')](db[_0xd4a7('0x52')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x18a')});db['FaxInteraction']['belongsTo'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db['FaxInteraction'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'Owner','foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x56')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':'fax_interaction_has_tags','as':_0xd4a7('0x182')});db[_0xd4a7('0x56')][_0xd4a7('0x134')](db['Tag'],{'through':_0xd4a7('0x18d'),'as':'ThroughTags'});db[_0xd4a7('0x56')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':'user_has_fax_interactions','foreignKey':_0xd4a7('0x18c')});db['FaxMessage'][_0xd4a7('0x132')](db['User'],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x13')});db[_0xd4a7('0x18b')][_0xd4a7('0x132')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xd4a7('0x18c')});db[_0xd4a7('0x18b')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':'cascade','as':_0xd4a7('0x170')});db[_0xd4a7('0x18b')][_0xd4a7('0x132')](db[_0xd4a7('0xfe')],{'as':_0xd4a7('0xfe'),'foreignKey':_0xd4a7('0x18e')});db['FaxMessage']['belongsTo'](db[_0xd4a7('0x52')],{'as':'Account','foreignKey':_0xd4a7('0x18a')});db[_0xd4a7('0x58')]['belongsToMany'](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0xd4a7('0x58')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x18f'),'as':_0xd4a7('0x168')});db[_0xd4a7('0x5a')]['belongsTo'](db['FaxAccount'],{});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db[_0xd4a7('0x56')],{});db[_0xd4a7('0x5a')]['belongsTo'](db[_0xd4a7('0x18b')],{});db[_0xd4a7('0x5a')]['belongsTo'](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db[_0xd4a7('0x58')],{});db['SmsAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':'Dispositions','foreignKey':_0xd4a7('0x190'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x5c')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x190')});db[_0xd4a7('0x5c')]['hasMany'](db[_0xd4a7('0x191')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x13e')],{'as':_0xd4a7('0x178')});db[_0xd4a7('0x5c')]['hasMany'](db[_0xd4a7('0x5d')],{'as':_0xd4a7('0x179')});db[_0xd4a7('0x5c')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x5c')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db[_0xd4a7('0x5c')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x153')});db[_0xd4a7('0x5d')]['belongsTo'](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x5d')][_0xd4a7('0x132')](db['SmsQueue'],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x5d')]['belongsTo'](db[_0xd4a7('0x5c')],{'onDelete':_0xd4a7('0x172')});db['SmsApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x164')});db['SmsApplication']['belongsTo'](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0xd4a7('0x127')](db[_0xd4a7('0x191')],{'as':'Messages','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x192')});db[_0xd4a7('0x13e')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x190')});db['SmsInteraction'][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db[_0xd4a7('0x13e')][_0xd4a7('0x132')](db['User'],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x125')});db['SmsInteraction']['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x193'),'as':_0xd4a7('0x182')});db['SmsInteraction'][_0xd4a7('0x134')](db['Tag'],{'through':_0xd4a7('0x193'),'as':_0xd4a7('0x194')});db[_0xd4a7('0x13e')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x13f'),'foreignKey':_0xd4a7('0x192')});db['SmsMessage']['belongsTo'](db[_0xd4a7('0x13')],{'as':'User'});db[_0xd4a7('0x191')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':_0xd4a7('0x124'),'as':'Contact'});db[_0xd4a7('0x191')][_0xd4a7('0x132')](db[_0xd4a7('0x13e')],{'onDelete':'cascade','as':_0xd4a7('0x195'),'foreignKey':'SmsInteractionId'});db[_0xd4a7('0x191')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x190')});db[_0xd4a7('0x5f')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x39'),'foreignKey':_0xd4a7('0x196')});db[_0xd4a7('0x5f')][_0xd4a7('0x134')](db['Team'],{'through':_0xd4a7('0x197'),'as':'Teams'});db[_0xd4a7('0x61')][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x198'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x61')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x61')]['hasMany'](db[_0xd4a7('0x65')],{'as':_0xd4a7('0x178'),'foreignKey':_0xd4a7('0x198')});db['OpenchannelAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x67')],{'as':_0xd4a7('0x16a'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x61')][_0xd4a7('0x127')](db[_0xd4a7('0x63')],{'as':_0xd4a7('0x179'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x61')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db['OpenchannelAccount'][_0xd4a7('0x132')](db['Pause'],{'as':_0xd4a7('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd4a7('0x61')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':'user_has_openchannel_accounts'});db[_0xd4a7('0x63')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x69')],{'onDelete':_0xd4a7('0x172'),'foreignKey':_0xd4a7('0x199')});db['OpenchannelApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'onDelete':_0xd4a7('0x172'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x63')][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'onDelete':_0xd4a7('0x172'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db['OpenchannelInteraction']['hasMany'](db[_0xd4a7('0x67')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':'OpenchannelInteractionId'});db[_0xd4a7('0x65')]['belongsTo'](db[_0xd4a7('0x61')],{'as':'Account','foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x65')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x65')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x65')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x19a'),'as':'Tags'});db[_0xd4a7('0x65')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x19a'),'as':_0xd4a7('0x194')});db[_0xd4a7('0x65')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x141'),'foreignKey':'OpenchannelInteractionId'});db[_0xd4a7('0x67')]['belongsTo'](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x13')});db[_0xd4a7('0x67')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':_0xd4a7('0x124'),'as':'Contact'});db[_0xd4a7('0x67')][_0xd4a7('0x132')](db[_0xd4a7('0x65')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x195'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xd4a7('0x132')](db['Attachment'],{'as':_0xd4a7('0xfe'),'foreignKey':'AttachmentId'});db[_0xd4a7('0x67')][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x69')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x3a'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x19b'),'as':_0xd4a7('0x168')});db['ChatWebsite'][_0xd4a7('0x127')](db['Disposition'],{'as':_0xd4a7('0x176'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xd4a7('0x14b')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':'Answers','foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x14b')][_0xd4a7('0x127')](db[_0xd4a7('0x19c')],{'as':_0xd4a7('0x19d')});db[_0xd4a7('0x14b')][_0xd4a7('0x127')](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x178')});db['ChatWebsite']['hasMany'](db[_0xd4a7('0x6d')],{'as':'Applications'});db[_0xd4a7('0x14b')]['hasMany'](db[_0xd4a7('0x71')],{'as':_0xd4a7('0x16a')});db['ChatWebsite'][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':'List','foreignKey':'ListId'});db[_0xd4a7('0x14b')][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x163'),'foreignKey':'IntervalId'});db[_0xd4a7('0x14b')]['belongsTo'](db[_0xd4a7('0x41')],{'as':'MailAccount','foreignKey':_0xd4a7('0x173')});db[_0xd4a7('0x14b')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db['ChatWebsite']['belongsToMany'](db['User'],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x19e')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x6b')][_0xd4a7('0x132')](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0xd4a7('0x6b')]['belongsTo'](db[_0xd4a7('0x67')],{});db[_0xd4a7('0x6b')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x6b')][_0xd4a7('0x132')](db[_0xd4a7('0x69')],{});db['ChatApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'Agent','foreignKey':_0xd4a7('0x125'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x6d')][_0xd4a7('0x132')](db['ChatQueue'],{'as':_0xd4a7('0x19f'),'foreignKey':_0xd4a7('0x1a0'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x6d')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':'Website','foreignKey':_0xd4a7('0x185'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x6d')]['belongsTo'](db['Tag'],{'onDelete':_0xd4a7('0x172'),'foreignKey':'TagId'});db['ChatInteraction'][_0xd4a7('0x127')](db['ChatMessage'],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1a1')});db[_0xd4a7('0x6f')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':'Account','foreignKey':_0xd4a7('0x185')});db['ChatInteraction'][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':'Contact','foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x6f')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':'UserId'});db[_0xd4a7('0x6f')][_0xd4a7('0x134')](db['Tag'],{'through':_0xd4a7('0x1a2'),'as':_0xd4a7('0x182')});db[_0xd4a7('0x6f')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1a2'),'as':'ThroughTags'});db['ChatInteraction'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':'user_has_chat_interactions','foreignKey':_0xd4a7('0x1a1')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'as':'User'});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db['CmContact'],{'onDelete':'cascade','as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0x6f')],{'onDelete':_0xd4a7('0x124'),'as':'Interaction','foreignKey':_0xd4a7('0x1a1')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0xfe')],{'as':_0xd4a7('0xfe'),'foreignKey':_0xd4a7('0x18e')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x73')][_0xd4a7('0x127')](db['Attachment'],{'as':_0xd4a7('0x184'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xd4a7('0x124'),'hooks':!![]});db[_0xd4a7('0x73')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db['ChatOfflineMessage']['belongsTo'](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x17e'),'foreignKey':'ChatWebsiteId'});db[_0xd4a7('0x75')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':'UserChatQueue','hooks':!![]});db[_0xd4a7('0x75')]['belongsToMany'](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x1a3'),'as':_0xd4a7('0x168')});db['ChatGroup'][_0xd4a7('0x127')](db[_0xd4a7('0xe5')],{'as':_0xd4a7('0x16a'),'foreignKey':_0xd4a7('0x1a4'),'onDelete':'cascade'});db['ChatGroup'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Members','through':_0xd4a7('0x1a5')});db[_0xd4a7('0x19c')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x1a6'),'foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x78')]['hasMany'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x135'),'foreignKey':_0xd4a7('0x1a7')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x9b')],{'as':_0xd4a7('0x1a8'),'foreignKey':_0xd4a7('0x1a9')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x1aa')],{'as':_0xd4a7('0x15b'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x7f')],{'as':_0xd4a7('0x15d'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x81')],{'as':_0xd4a7('0x81'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0xe9')],{'as':_0xd4a7('0x15f'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x65')],{'as':_0xd4a7('0x140'),'foreignKey':'ContactId','onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x12c'),'foreignKey':_0xd4a7('0x17f'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x7a')]['hasMany'](db[_0xd4a7('0x13e')],{'as':_0xd4a7('0x12d'),'foreignKey':_0xd4a7('0x17f'),'onDelete':'restrict'});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x56')],{'as':_0xd4a7('0x12e'),'foreignKey':_0xd4a7('0x17f'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x7a')]['hasMany'](db['MailInteraction'],{'as':_0xd4a7('0x12f'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xd4a7('0x7a')][_0xd4a7('0x132')](db[_0xd4a7('0x78')],{'as':'Company','foreignKey':_0xd4a7('0x1a7')});db[_0xd4a7('0x7a')]['belongsTo'](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x7a')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x136')});db['CmContact']['belongsToMany'](db[_0xd4a7('0x97')],{'as':_0xd4a7('0x182'),'through':'cm_contact_has_tags'});db[_0xd4a7('0x7a')]['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1ab'),'as':_0xd4a7('0x194')});db[_0xd4a7('0x1aa')][_0xd4a7('0x127')](db[_0xd4a7('0x9d')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0xd4a7('0x1aa')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f'),'onDelete':_0xd4a7('0x124')});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':'ListId','onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x1aa')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x1ac'),'foreignKey':'UserId'});db[_0xd4a7('0x1aa')]['belongsTo'](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x19f'),'foreignKey':_0xd4a7('0x15a'),'onDelete':'cascade'});db['CmHopper'][_0xd4a7('0x132')](db[_0xd4a7('0x1ad')],{'as':_0xd4a7('0x1ad'),'foreignKey':_0xd4a7('0x1ae'),'onDelete':'cascade'});db[_0xd4a7('0x1aa')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x1af')});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f'),'onDelete':'cascade'});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a'),'onDelete':'cascade'});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x19f'),'foreignKey':_0xd4a7('0x15a'),'onDelete':'cascade'});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db['Campaign'],{'as':_0xd4a7('0x1ad'),'foreignKey':_0xd4a7('0x1ae'),'onDelete':'cascade'});db['Automation'][_0xd4a7('0x127')](db[_0xd4a7('0x1b0')],{'as':{'plural':_0xd4a7('0x1b1'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x87')]['hasMany'](db[_0xd4a7('0x1b0')],{'as':{'plural':'Any','singular':_0xd4a7('0x1b2')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x87')][_0xd4a7('0x127')](db[_0xd4a7('0x85')],{'as':_0xd4a7('0x1b3'),'foreignKey':_0xd4a7('0x1b4'),'onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x8a')][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x1b5'),'onDelete':_0xd4a7('0x124')});db['Interval'][_0xd4a7('0x127')](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x1b6'),'foreignKey':_0xd4a7('0x164'),'onDelete':_0xd4a7('0x124'),'hooks':!![],'required':![]});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db[_0xd4a7('0x4a')],{'as':'MailApplications','foreignKey':_0xd4a7('0x164')});db['Interval']['hasMany'](db['ChatApplication'],{'as':_0xd4a7('0x1b7'),'foreignKey':'IntervalId'});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db['FaxApplication'],{'as':_0xd4a7('0x1b8'),'foreignKey':'IntervalId'});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db[_0xd4a7('0x5d')],{'as':_0xd4a7('0x1b9'),'foreignKey':_0xd4a7('0x164')});db[_0xd4a7('0x93')]['belongsTo'](db[_0xd4a7('0x41')],{});db['Schedule'][_0xd4a7('0x132')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xd4a7('0x93')][_0xd4a7('0x132')](db[_0xd4a7('0xa8')],{'foreignKey':_0xd4a7('0x1ba')});db[_0xd4a7('0x95')][_0xd4a7('0x134')](db['VoiceMusicOnHold'],{'as':_0xd4a7('0x1bb'),'through':_0xd4a7('0x158'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db['CmContact'],{'through':_0xd4a7('0x1ab')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x6f')],{'through':_0xd4a7('0x1a2')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x46')],{'through':'mail_interaction_has_tags'});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x13e')],{'through':_0xd4a7('0x193')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x56')],{'through':_0xd4a7('0x18d')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x65')],{'through':_0xd4a7('0x19a')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x113')],{'through':_0xd4a7('0x1bc')});db['CmContactHasItem'][_0xd4a7('0x132')](db['ContactItemType'],{'as':_0xd4a7('0x1bd'),'foreignKey':_0xd4a7('0x1be')});db[_0xd4a7('0x9d')][_0xd4a7('0x132')](db[_0xd4a7('0x1aa')],{'as':_0xd4a7('0x1bf'),'foreignKey':_0xd4a7('0x1c0')});db[_0xd4a7('0x9b')][_0xd4a7('0x132')](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x1a9')});db[_0xd4a7('0xa1')]['hasMany'](db[_0xd4a7('0x1b0')],{'as':{'plural':_0xd4a7('0x1c1'),'singular':_0xd4a7('0x1c2')},'foreignKey':_0xd4a7('0x1c3'),'onDelete':_0xd4a7('0x124'),'hooks':!![]});db[_0xd4a7('0xa1')]['hasMany'](db[_0xd4a7('0x1b0')],{'as':{'plural':_0xd4a7('0x1c4'),'singular':_0xd4a7('0x1c5')},'foreignKey':_0xd4a7('0x1c6'),'onDelete':_0xd4a7('0x124'),'hooks':!![]});db['Trigger'][_0xd4a7('0x127')](db['Action'],{'as':_0xd4a7('0x1b3'),'foreignKey':_0xd4a7('0x1c7'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0xd4a7('0x127')](db[_0xd4a7('0x1c8')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ba'),'hooks':!![]});db[_0xd4a7('0xaa')][_0xd4a7('0x127')](db[_0xd4a7('0x1c8')],{'as':_0xd4a7('0x1c9'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1ca')});db[_0xd4a7('0xae')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cb')});db[_0xd4a7('0x1c8')]['belongsTo'](db[_0xd4a7('0xae')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xd4a7('0x127')](db[_0xd4a7('0xb4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xb4')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1cd'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xb4')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xb4')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xb4')]['belongsTo'](db[_0xd4a7('0xb3')],{'as':_0xd4a7('0x17e'),'foreignKey':'AccountId'});db[_0xd4a7('0xb6')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xb6')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db['SalesforceField'][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1d4'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xb6')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xb8')][_0xd4a7('0x127')](db[_0xd4a7('0x1d6')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0x1d6')][_0xd4a7('0x127')](db['SugarcrmField'],{'as':_0xd4a7('0x1cd'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0x1d6')][_0xd4a7('0x127')](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0x1d6')][_0xd4a7('0x127')](db['SugarcrmField'],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db['SugarcrmConfiguration'][_0xd4a7('0x132')](db[_0xd4a7('0xb8')],{'as':'Account','foreignKey':_0xd4a7('0x1cc')});db['SugarcrmField'][_0xd4a7('0x127')](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xba')]['hasMany'](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xba')][_0xd4a7('0x127')](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1d4'),'foreignKey':'FieldId'});db[_0xd4a7('0xba')]['belongsTo'](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':'VariableId'});db[_0xd4a7('0xbc')][_0xd4a7('0x127')](db['DeskConfiguration'],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':'AccountId'});db[_0xd4a7('0xbe')][_0xd4a7('0x127')](db['DeskField'],{'as':'Subjects','onDelete':_0xd4a7('0x124'),'foreignKey':'SubjectId'});db[_0xd4a7('0xbe')][_0xd4a7('0x127')](db[_0xd4a7('0xc0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xbe')][_0xd4a7('0x127')](db[_0xd4a7('0xc0')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xbe')][_0xd4a7('0x132')](db[_0xd4a7('0xbc')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xbe')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1d8')});db[_0xd4a7('0xc0')][_0xd4a7('0x127')](db['DeskField'],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xc0')][_0xd4a7('0x127')](db['DeskField'],{'as':'Description','foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xc0')]['hasMany'](db[_0xd4a7('0xc0')],{'as':'Field','foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xc0')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xc1')][_0xd4a7('0x127')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['ZohoConfiguration'][_0xd4a7('0x127')](db['ZohoField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xd4a7('0x1d9')][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db['ZohoConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xd4a7('0x1d9')][_0xd4a7('0x132')](db[_0xd4a7('0xc1')],{'as':'Account','foreignKey':_0xd4a7('0x1cc')});db['ZohoField'][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xc4')][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xc4')][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':'Field','foreignKey':'FieldId'});db[_0xd4a7('0xc4')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xc6')]['hasMany'](db[_0xd4a7('0xc8')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['ZendeskConfiguration'][_0xd4a7('0x127')](db['ZendeskField'],{'as':_0xd4a7('0x1cd'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xc8')][_0xd4a7('0x127')](db[_0xd4a7('0xca')],{'as':_0xd4a7('0x1cf'),'foreignKey':'DescriptionId'});db[_0xd4a7('0xc8')][_0xd4a7('0x127')](db[_0xd4a7('0xca')],{'as':_0xd4a7('0x1c9'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xc8')][_0xd4a7('0x132')](db[_0xd4a7('0xc6')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xc8')][_0xd4a7('0x134')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0xd4a7('0xca')]['hasMany'](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd4a7('0xca')]['hasMany'](db[_0xd4a7('0xca')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xca')]['hasMany'](db[_0xd4a7('0xca')],{'as':'Field','foreignKey':_0xd4a7('0x1d1')});db['ZendeskField'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xcc')][_0xd4a7('0x127')](db[_0xd4a7('0xcd')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['FreshdeskConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':'Subjects','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xcd')][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xcd')][_0xd4a7('0x127')](db['FreshdeskField'],{'as':_0xd4a7('0x1c9'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xd4a7('0xcd')][_0xd4a7('0x132')](db[_0xd4a7('0xcc')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xcd')]['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1da')});db[_0xd4a7('0xcf')][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xcf')]['hasMany'](db[_0xd4a7('0xcf')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db['FreshdeskField'][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':'Field','foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xcf')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db['VtigerAccount']['hasMany'](db[_0xd4a7('0xd3')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['VtigerConfiguration'][_0xd4a7('0x127')](db['VtigerField'],{'as':_0xd4a7('0x1cd'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xd3')][_0xd4a7('0x127')](db['VtigerField'],{'as':_0xd4a7('0x1cf'),'foreignKey':_0xd4a7('0x1d0')});db['VtigerConfiguration']['hasMany'](db[_0xd4a7('0xd5')],{'as':'Fields','foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xd3')]['belongsTo'](db[_0xd4a7('0xd1')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xd5')][_0xd4a7('0x127')](db[_0xd4a7('0xd5')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xd5')][_0xd4a7('0x127')](db[_0xd4a7('0xd5')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xd5')]['hasMany'](db[_0xd4a7('0xd5')],{'as':'Field','foreignKey':'FieldId'});db['VtigerField'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xd7')][_0xd4a7('0x127')](db[_0xd4a7('0xd9')],{'as':_0xd4a7('0x1d7'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xd9')][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':_0xd4a7('0x1cd'),'foreignKey':_0xd4a7('0x1ce')});db['ServicenowConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xd4a7('0xd9')][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':_0xd4a7('0x1c9'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xd9')][_0xd4a7('0x132')](db[_0xd4a7('0xd7')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db['ServicenowField'][_0xd4a7('0x127')](db['ServicenowField'],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xda')][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xda')][_0xd4a7('0x127')](db['ServicenowField'],{'as':'Field','foreignKey':'FieldId'});db[_0xd4a7('0xda')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db['Dynamics365Account'][_0xd4a7('0x127')](db[_0xd4a7('0xdc')],{'as':_0xd4a7('0x1d7'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0x1db')][_0xd4a7('0x132')](db[_0xd4a7('0x11b')],{'as':_0xd4a7('0x11b'),'foreignKey':_0xd4a7('0x171')});db['Dynamics365Configuration'][_0xd4a7('0x127')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ce')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db['Dynamics365Configuration']['hasMany'](db[_0xd4a7('0xde')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db['Dynamics365Configuration'][_0xd4a7('0x132')](db[_0xd4a7('0x1db')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xde')]['hasMany'](db[_0xd4a7('0xde')],{'as':'Subject','foreignKey':_0xd4a7('0x1ce')});db['Dynamics365Field'][_0xd4a7('0x127')](db[_0xd4a7('0xde')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xde')][_0xd4a7('0x127')](db[_0xd4a7('0xde')],{'as':_0xd4a7('0x1d4'),'foreignKey':_0xd4a7('0x1d1')});db['Dynamics365Field'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0x1dc')][_0xd4a7('0x127')](db[_0xd4a7('0x1dd')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0x1dd')][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1cd'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':'Descriptions','foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0x1dd')]['hasMany'](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1c9'),'foreignKey':'FieldId'});db[_0xd4a7('0x1dd')][_0xd4a7('0x132')](db[_0xd4a7('0x1dc')],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xe0')][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1d3'),'foreignKey':'DescriptionId'});db[_0xd4a7('0xe0')][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1d4'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xe4')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{});db[_0xd4a7('0xe4')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':'ListId'});db[_0xd4a7('0xe4')]['belongsTo'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0xe4')][_0xd4a7('0x132')](db[_0xd4a7('0x6f')],{});db['ChatQueueReport'][_0xd4a7('0x132')](db['ChatMessage'],{});db[_0xd4a7('0xe4')]['belongsTo'](db[_0xd4a7('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0xd4a7('0x75')],{});db[_0xd4a7('0xe5')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1de')});db['ChatInternalMessage'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1df')});db[_0xd4a7('0xe9')][_0xd4a7('0x127')](db[_0xd4a7('0xe7')],{'foreignKey':_0xd4a7('0x1e0'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0xe9')]['hasMany'](db[_0xd4a7('0x1e1')],{'foreignKey':_0xd4a7('0x1e0'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{});db['SmsQueueReport'][_0xd4a7('0x132')](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':'Contact','foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0xeb')]['belongsTo'](db[_0xd4a7('0x13e')],{});db['SmsQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x191')],{});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db['SmsQueue'],{});db[_0xd4a7('0xf0')][_0xd4a7('0x127')](db[_0xd4a7('0xe9')],{'foreignKey':_0xd4a7('0x1e2')});db['JscriptyProject'][_0xd4a7('0x127')](db['JscriptyQuestionReport'],{'foreignKey':_0xd4a7('0x1e2')});db[_0xd4a7('0xf0')][_0xd4a7('0x127')](db['JscriptyAnswerReport'],{'foreignKey':_0xd4a7('0x1e2')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x13a')});db[_0xd4a7('0xfa')][_0xd4a7('0x134')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0xd4a7('0x143')});db[_0xd4a7('0xfa')][_0xd4a7('0x134')](db[_0xd4a7('0x43')],{'through':_0xd4a7('0x17c'),'as':_0xd4a7('0x1e3')});db[_0xd4a7('0xfa')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xd4a7('0x145')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x58')],{'through':_0xd4a7('0x18f'),'as':'FaxQueues'});db['Team'][_0xd4a7('0x134')](db['SmsQueue'],{'through':_0xd4a7('0x197'),'as':_0xd4a7('0x148')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x69')],{'through':'team_has_openchannel_queues','as':_0xd4a7('0x149')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x11a')],{'through':_0xd4a7('0x1e4'),'as':_0xd4a7('0x14a')});db[_0xd4a7('0xfa')][_0xd4a7('0x134')](db[_0xd4a7('0x109')],{'through':_0xd4a7('0x11e'),'as':'VoicePrefixes'});db[_0xd4a7('0x1ad')][_0xd4a7('0x127')](db[_0xd4a7('0x1aa')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':'CampaignId'});db[_0xd4a7('0x1ad')][_0xd4a7('0x127')](db[_0xd4a7('0x7f')],{'as':_0xd4a7('0x15d'),'foreignKey':_0xd4a7('0x1ae')});db['Campaign'][_0xd4a7('0x127')](db[_0xd4a7('0x7c')],{'as':_0xd4a7('0x15e'),'foreignKey':_0xd4a7('0x1ae')});db[_0xd4a7('0x1ad')][_0xd4a7('0x132')](db['Trunk'],{'as':'Trunk','foreignKey':_0xd4a7('0x160')});db[_0xd4a7('0x1ad')][_0xd4a7('0x132')](db[_0xd4a7('0x2e')],{'as':'TrunkBackup','foreignKey':_0xd4a7('0x162')});db[_0xd4a7('0x1ad')]['belongsTo'](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x163'),'foreignKey':'IntervalId'});db['Campaign'][_0xd4a7('0x132')](db[_0xd4a7('0xf4')],{'as':'SquareProject','foreignKey':_0xd4a7('0x1e5')});db[_0xd4a7('0x1ad')][_0xd4a7('0x134')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x138'),'through':_0xd4a7('0x1e6')});db[_0xd4a7('0x1ad')][_0xd4a7('0x134')](db['CmList'],{'as':_0xd4a7('0x169'),'through':_0xd4a7('0x1e7')});db[_0xd4a7('0xfe')][_0xd4a7('0x132')](db[_0xd4a7('0x73')],{'as':'ChatOfflineMessage','foreignKey':_0xd4a7('0x186')});db['MailTransferReport']['belongsTo'](db[_0xd4a7('0x48')],{});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db['MailInteraction'],{});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db['MailTransferReport'][_0xd4a7('0x132')](db['User'],{'foreignKey':'FromUserId','as':_0xd4a7('0x1e8')});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db['User'],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db[_0xd4a7('0x43')],{'foreignKey':_0xd4a7('0x1eb'),'as':_0xd4a7('0x1ec')});db['MailTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'foreignKey':_0xd4a7('0x1ed'),'as':_0xd4a7('0x1ee')});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db[_0xd4a7('0x71')],{});db['ChatTransferReport']['belongsTo'](db['ChatInteraction'],{});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db['ChatWebsite'],{'foreignKey':_0xd4a7('0x1f0'),'as':_0xd4a7('0x1f1')});db['ChatTransferReport'][_0xd4a7('0x132')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xd4a7('0x1ef')]['belongsTo'](db[_0xd4a7('0x13')],{'foreignKey':'ToUserId','as':_0xd4a7('0x1ea')});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db[_0xd4a7('0x75')],{'foreignKey':_0xd4a7('0x1f2'),'as':_0xd4a7('0x1ec')});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'foreignKey':_0xd4a7('0x1f3'),'as':_0xd4a7('0x1ee')});db[_0xd4a7('0x1f4')][_0xd4a7('0x132')](db['FaxMessage'],{});db[_0xd4a7('0x1f4')]['belongsTo'](db[_0xd4a7('0x56')],{});db[_0xd4a7('0x1f4')][_0xd4a7('0x132')](db[_0xd4a7('0x52')],{'foreignKey':_0xd4a7('0x1f5'),'as':_0xd4a7('0x1f1')});db[_0xd4a7('0x1f4')][_0xd4a7('0x132')](db['User'],{'foreignKey':_0xd4a7('0x1f6'),'as':_0xd4a7('0x1e8')});db[_0xd4a7('0x1f4')]['belongsTo'](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db['FaxTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x58')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport']['belongsTo'](db[_0xd4a7('0x52')],{'foreignKey':_0xd4a7('0x1f7'),'as':_0xd4a7('0x1ee')});db[_0xd4a7('0x104')]['belongsTo'](db[_0xd4a7('0x67')],{});db[_0xd4a7('0x104')]['belongsTo'](db[_0xd4a7('0x65')],{});db['OpenchannelTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'foreignKey':'FromOpenchannelAccountId','as':_0xd4a7('0x1f1')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1f6'),'as':_0xd4a7('0x1e8')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x69')],{'foreignKey':'ToOpenchannelQueueId','as':_0xd4a7('0x1ec')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xd4a7('0x106')]['belongsTo'](db[_0xd4a7('0x191')],{});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db['SmsInteraction'],{});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{'foreignKey':_0xd4a7('0x1f8'),'as':_0xd4a7('0x1f1')});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1f6'),'as':_0xd4a7('0x1e8')});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':'ToAgent'});db['SmsTransferReport'][_0xd4a7('0x132')](db['SmsQueue'],{'foreignKey':_0xd4a7('0x1f9'),'as':_0xd4a7('0x1ec')});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db['SmsAccount'],{'foreignKey':_0xd4a7('0x1fa'),'as':_0xd4a7('0x1ee')});db['CmList'][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x17a'),'onDelete':_0xd4a7('0x124')});db['CmList'][_0xd4a7('0x127')](db[_0xd4a7('0x83')],{'as':_0xd4a7('0x1fb'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x137')][_0xd4a7('0x127')](db[_0xd4a7('0x7a')],{'as':'Contacts','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x137')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xd4a7('0x7f')],{'as':_0xd4a7('0x12b'),'foreignKey':'ListId'});db[_0xd4a7('0x137')][_0xd4a7('0x127')](db[_0xd4a7('0x81')],{'as':_0xd4a7('0x81'),'foreignKey':'ListId'});db[_0xd4a7('0x137')][_0xd4a7('0x134')](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x1fc'),'through':_0xd4a7('0x167')});db[_0xd4a7('0x137')]['belongsToMany'](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x139')});db[_0xd4a7('0x109')][_0xd4a7('0x127')](db['VoiceExtension'],{'as':_0xd4a7('0x129'),'onDelete':_0xd4a7('0x124')});db['VoicePrefix'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xd4a7('0x109')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x11e'),'as':_0xd4a7('0x168')});db[_0xd4a7('0x10a')][_0xd4a7('0x127')](db['User'],{'as':_0xd4a7('0x183'),'foreignKey':'userProfileId'});db[_0xd4a7('0x10a')][_0xd4a7('0x127')](db[_0xd4a7('0x10b')],{'as':_0xd4a7('0x1fd'),'foreignKey':_0xd4a7('0x133'),'onDelete':'cascade'});db[_0xd4a7('0x10b')][_0xd4a7('0x127')](db['UserProfileResource'],{'as':_0xd4a7('0x1fe'),'foreignKey':_0xd4a7('0x1ff'),'onDelete':'cascade'});db[_0xd4a7('0x10f')][_0xd4a7('0x127')](db['Disposition'],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x200'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x10f')][_0xd4a7('0x127')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xd4a7('0x200')});db['WhatsappAccount'][_0xd4a7('0x127')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xd4a7('0x200')});db['WhatsappAccount']['hasMany'](db[_0xd4a7('0x113')],{'as':_0xd4a7('0x178')});db[_0xd4a7('0x10f')][_0xd4a7('0x127')](db['WhatsappApplication'],{'as':_0xd4a7('0x179')});db[_0xd4a7('0x10f')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x10f')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db[_0xd4a7('0x10f')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x155')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x11a')],{'onDelete':'restrict'});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x10f')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db['Interval'],{'onDelete':_0xd4a7('0x172'),'foreignKey':_0xd4a7('0x164')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db[_0xd4a7('0x113')][_0xd4a7('0x127')](db[_0xd4a7('0x114')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x201')});db[_0xd4a7('0x113')][_0xd4a7('0x132')](db[_0xd4a7('0x10f')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xd4a7('0x113')]['belongsTo'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db[_0xd4a7('0x113')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x125')});db['WhatsappInteraction']['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1bc'),'as':_0xd4a7('0x182')});db[_0xd4a7('0x113')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':'whatsapp_interaction_has_tags','as':_0xd4a7('0x194')});db[_0xd4a7('0x113')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x142'),'foreignKey':_0xd4a7('0x201')});db[_0xd4a7('0x114')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'User'});db[_0xd4a7('0x114')]['belongsTo'](db['CmContact'],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x170')});db['WhatsappMessage'][_0xd4a7('0x132')](db[_0xd4a7('0x113')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x195'),'foreignKey':_0xd4a7('0x201')});db[_0xd4a7('0x114')]['belongsTo'](db[_0xd4a7('0x10f')],{'as':_0xd4a7('0x17e'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db[_0xd4a7('0x10f')],{});db['WhatsappQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x116')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xd4a7('0x116')][_0xd4a7('0x132')](db[_0xd4a7('0x113')],{});db[_0xd4a7('0x116')][_0xd4a7('0x132')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x114')],{});db['WhatsappQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x114')],{});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db['WhatsappInteraction'],{});db['WhatsappTransferReport']['belongsTo'](db[_0xd4a7('0x10f')],{'foreignKey':'FromWhatsappAccountId','as':_0xd4a7('0x1f1')});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x10f')],{'foreignKey':'ToWhatsappAccountId','as':_0xd4a7('0x1ee')});db['WhatsappTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x11a')],{'foreignKey':_0xd4a7('0x202'),'as':_0xd4a7('0x1ec')});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':'FromUserId','as':_0xd4a7('0x1e8')});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db[_0xd4a7('0x11a')][_0xd4a7('0x134')](db['User'],{'as':'Agents','through':_0xd4a7('0x3b'),'foreignKey':_0xd4a7('0x203')});db[_0xd4a7('0x11a')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':'team_has_whatsapp_queues','as':_0xd4a7('0x168')});db['UserSetting'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'user','foreignKey':'UserId','onDelete':_0xd4a7('0x124'),'hooks':!![]});db[_0xd4a7('0x11b')]['hasOne'](db[_0xd4a7('0x1db')],{'as':_0xd4a7('0x1db'),'onDelete':'restrict'});db[_0xd4a7('0x11b')]['hasOne'](db[_0xd4a7('0x3d')],{'as':_0xd4a7('0x174'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x11b')][_0xd4a7('0x123')](db[_0xd4a7('0x3f')],{'as':_0xd4a7('0x175'),'onDelete':_0xd4a7('0x172')});module[_0xd4a7('0x204')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index b249066..6038254 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31ab=['/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/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/userNotification','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','/demo','root','/snippet','snippet','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','resolve','get','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/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/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','/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/chatMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount'];(function(_0x18f69c,_0x5cde7b){var _0x2b73e1=function(_0xe272e4){while(--_0xe272e4){_0x18f69c['push'](_0x18f69c['shift']());}};_0x2b73e1(++_0x5cde7b);}(_0x31ab,0x18b));var _0xb31a=function(_0x5ddd5c,_0x2958d7){_0x5ddd5c=_0x5ddd5c-0x0;var _0x59b82f=_0x31ab[_0x5ddd5c];return _0x59b82f;};'use strict';var path=require(_0xb31a('0x0'));var express=require(_0xb31a('0x1'));var errors=require(_0xb31a('0x2'));var config=require(_0xb31a('0x3'));var setupLoggers=require(_0xb31a('0x4'))['setupLoggers'];var clientSideLogs=require(_0xb31a('0x5'));exports[_0xb31a('0x6')]=function(_0xfca6b0){return setupLoggers(_0xfca6b0)[_0xb31a('0x7')](function(){_0xfca6b0[_0xb31a('0x8')]('/api/users',require(_0xb31a('0x9')));_0xfca6b0['use'](_0xb31a('0xa'),require(_0xb31a('0xb')));_0xfca6b0[_0xb31a('0x8')]('/api/voice/contexts',require(_0xb31a('0xc')));_0xfca6b0[_0xb31a('0x8')]('/api/voice/extensions',require('./api/voiceExtension'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd'),require('./api/voiceMusicOnHold'));_0xfca6b0['use']('/api/voice/queues',require(_0xb31a('0xe')));_0xfca6b0['use'](_0xb31a('0xf'),require(_0xb31a('0x10')));_0xfca6b0['use'](_0xb31a('0x11'),require('./api/screenRecording'));_0xfca6b0[_0xb31a('0x8')]('/api/voice/mails',require(_0xb31a('0x12')));_0xfca6b0[_0xb31a('0x8')]('/api/voice/mails/messages',require(_0xb31a('0x13')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x14'),require(_0xb31a('0x15')));_0xfca6b0['use'](_0xb31a('0x16'),require(_0xb31a('0x17')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x18'),require(_0xb31a('0x19')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x1a'),require(_0xb31a('0x1b')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x1c'),require('./api/memberReport'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x1d'),require(_0xb31a('0x1e')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x1f'),require(_0xb31a('0x20')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x21'),require(_0xb31a('0x22')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x23'),require(_0xb31a('0x24')));_0xfca6b0['use'](_0xb31a('0x25'),require('./api/mailQueue'));_0xfca6b0[_0xb31a('0x8')]('/api/mail/substatuses',require(_0xb31a('0x26')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x27'),require('./api/mailInteraction'));_0xfca6b0['use']('/api/mail/messages',require('./api/mailMessage'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x28'),require(_0xb31a('0x29')));_0xfca6b0['use'](_0xb31a('0x2a'),require(_0xb31a('0x2b')));_0xfca6b0[_0xb31a('0x8')]('/api/dashboards',require(_0xb31a('0x2c')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x2d'),require(_0xb31a('0x2e')));_0xfca6b0[_0xb31a('0x8')]('/api/fax/accounts',require('./api/faxAccount'));_0xfca6b0['use'](_0xb31a('0x2f'),require(_0xb31a('0x30')));_0xfca6b0[_0xb31a('0x8')]('/api/fax/interactions',require(_0xb31a('0x31')));_0xfca6b0[_0xb31a('0x8')]('/api/fax/messages',require(_0xb31a('0x32')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x33'),require(_0xb31a('0x34')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x35'),require(_0xb31a('0x36')));_0xfca6b0[_0xb31a('0x8')]('/api/sms/accounts',require('./api/smsAccount'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x37'),require(_0xb31a('0x38')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x39'),require(_0xb31a('0x3a')));_0xfca6b0['use'](_0xb31a('0x3b'),require(_0xb31a('0x3c')));_0xfca6b0[_0xb31a('0x8')]('/api/sms/queues',require(_0xb31a('0x3d')));_0xfca6b0['use'](_0xb31a('0x3e'),require('./api/openchannelAccount'));_0xfca6b0[_0xb31a('0x8')]('/api/openchannel/applications',require(_0xb31a('0x3f')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x40'),require('./api/openchannelInteraction'));_0xfca6b0['use'](_0xb31a('0x41'),require(_0xb31a('0x42')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x43'),require(_0xb31a('0x44')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x45'),require(_0xb31a('0x46')));_0xfca6b0['use'](_0xb31a('0x47'),require(_0xb31a('0x48')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x49'),require(_0xb31a('0x4a')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x4b'),require(_0xb31a('0x4c')));_0xfca6b0[_0xb31a('0x8')]('/api/chat/messages',require(_0xb31a('0x4d')));_0xfca6b0['use']('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x4e'),require('./api/chatQueue'));_0xfca6b0['use'](_0xb31a('0x4f'),require(_0xb31a('0x50')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x51'),require('./api/chatProactiveAction'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x52'),require(_0xb31a('0x53')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x54'),require(_0xb31a('0x55')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x56'),require('./api/cmHopper'));_0xfca6b0['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0xfca6b0[_0xb31a('0x8')]('/api/cm/hopper_final',require(_0xb31a('0x57')));_0xfca6b0['use'](_0xb31a('0x58'),require('./api/cmHopperHistory'));_0xfca6b0['use'](_0xb31a('0x59'),require(_0xb31a('0x5a')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x5b'),require('./api/action'));_0xfca6b0['use'](_0xb31a('0x5c'),require(_0xb31a('0x5d')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x5e'),require(_0xb31a('0x5f')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x60'),require(_0xb31a('0x61')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x62'),require(_0xb31a('0x63')));_0xfca6b0['use'](_0xb31a('0x64'),require(_0xb31a('0x65')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x66'),require(_0xb31a('0x67')));_0xfca6b0['use'](_0xb31a('0x68'),require(_0xb31a('0x69')));_0xfca6b0['use'](_0xb31a('0x6a'),require(_0xb31a('0x6b')));_0xfca6b0[_0xb31a('0x8')]('/api/schedules',require(_0xb31a('0x6c')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x6d'),require(_0xb31a('0x6e')));_0xfca6b0[_0xb31a('0x8')]('/api/tags',require(_0xb31a('0x6f')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x70'),require('./api/contactItemType'));_0xfca6b0[_0xb31a('0x8')]('/api/cm_contact_has_items',require(_0xb31a('0x71')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x72'),require(_0xb31a('0x73')));_0xfca6b0['use'](_0xb31a('0x74'),require(_0xb31a('0x75')));_0xfca6b0['use'](_0xb31a('0x76'),require(_0xb31a('0x77')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x78'),require(_0xb31a('0x79')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x7a'),require(_0xb31a('0x7b')));_0xfca6b0['use'](_0xb31a('0x7c'),require(_0xb31a('0x7d')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x7e'),require(_0xb31a('0x7f')));_0xfca6b0['use'](_0xb31a('0x80'),require(_0xb31a('0x81')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x82'),require(_0xb31a('0x83')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x84'),require(_0xb31a('0x85')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x86'),require(_0xb31a('0x87')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x88'),require(_0xb31a('0x89')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x8a'),require('./api/intSalesforceAccount'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x8b'),require('./api/intSalesforceConfiguration'));_0xfca6b0[_0xb31a('0x8')]('/api/integrations/salesforce/fields',require(_0xb31a('0x8c')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x8d'),require(_0xb31a('0x8e')));_0xfca6b0[_0xb31a('0x8')]('/api/integrations/sugarcrm/configurations',require(_0xb31a('0x8f')));_0xfca6b0['use'](_0xb31a('0x90'),require('./api/intSugarcrmField'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x91'),require(_0xb31a('0x92')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x93'),require(_0xb31a('0x94')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x95'),require(_0xb31a('0x96')));_0xfca6b0['use'](_0xb31a('0x97'),require(_0xb31a('0x98')));_0xfca6b0['use'](_0xb31a('0x99'),require('./api/intZohoConfiguration'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x9a'),require(_0xb31a('0x9b')));_0xfca6b0['use'](_0xb31a('0x9c'),require(_0xb31a('0x9d')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x9e'),require('./api/intZendeskConfiguration'));_0xfca6b0['use'](_0xb31a('0x9f'),require('./api/intZendeskField'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xa0'),require('./api/intFreshdeskAccount'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xa1'),require(_0xb31a('0xa2')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xa3'),require(_0xb31a('0xa4')));_0xfca6b0['use'](_0xb31a('0xa5'),require(_0xb31a('0xa6')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xa7'),require(_0xb31a('0xa8')));_0xfca6b0[_0xb31a('0x8')]('/api/integrations/vtiger/fields',require(_0xb31a('0xa9')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xaa'),require(_0xb31a('0xab')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xac'),require('./api/intServicenowConfiguration'));_0xfca6b0[_0xb31a('0x8')]('/api/integrations/servicenow/fields',require(_0xb31a('0xad')));_0xfca6b0['use'](_0xb31a('0xae'),require(_0xb31a('0xaf')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb0'),require('./api/intDynamics365Configuration'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb1'),require('./api/intDynamics365Field'));_0xfca6b0[_0xb31a('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb2'),require('./api/intFreshsalesConfiguration'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb3'),require('./api/intFreshsalesField'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb4'),require(_0xb31a('0xb5')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb6'),require(_0xb31a('0xb7')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xb8'),require(_0xb31a('0xb9')));_0xfca6b0[_0xb31a('0x8')]('/api/jscripty/answers/reports',require(_0xb31a('0xba')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xbb'),require(_0xb31a('0xbc')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xbd'),require('./api/jscriptySessionReport'));_0xfca6b0[_0xb31a('0x8')]('/api/sms/reports/queue',require(_0xb31a('0xbe')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xbf'),require(_0xb31a('0xc0')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xc1'),require(_0xb31a('0xc2')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xc3'),require(_0xb31a('0xc4')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xc5'),require(_0xb31a('0xc6')));_0xfca6b0['use'](_0xb31a('0xc7'),require('./api/squareOdbc'));_0xfca6b0['use'](_0xb31a('0xc8'),require(_0xb31a('0xc9')));_0xfca6b0[_0xb31a('0x8')]('/api/square/recordings',require('./api/squareRecording'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xca'),require(_0xb31a('0xcb')));_0xfca6b0[_0xb31a('0x8')]('/api/teams',require(_0xb31a('0xcc')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xcd'),require('./api/license'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xce'),require(_0xb31a('0xcf')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd0'),require(_0xb31a('0xd1')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd2'),require(_0xb31a('0xd3')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd4'),require('./api/plugin'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd5'),require(_0xb31a('0xd6')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd7'),require(_0xb31a('0xd8')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xd9'),require('./api/faxTransferReport'));_0xfca6b0['use'](_0xb31a('0xda'),require(_0xb31a('0xdb')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xdc'),require(_0xb31a('0xdd')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xde'),require(_0xb31a('0xdf')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xe0'),require(_0xb31a('0xe1')));_0xfca6b0[_0xb31a('0x8')]('/api/userProfiles',require(_0xb31a('0xe2')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xe3'),require(_0xb31a('0xe4')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xe5'),require(_0xb31a('0xe6')));_0xfca6b0['use'](_0xb31a('0xe7'),require(_0xb31a('0xe8')));_0xfca6b0[_0xb31a('0x8')]('/api/whatsapp/accounts',require(_0xb31a('0xe9')));_0xfca6b0[_0xb31a('0x8')]('/api/whatsapp/applications',require(_0xb31a('0xea')));_0xfca6b0['use'](_0xb31a('0xeb'),require('./api/whatsappInteraction'));_0xfca6b0['use'](_0xb31a('0xec'),require(_0xb31a('0xed')));_0xfca6b0[_0xb31a('0x8')]('/api/whatsapp/reports/queue',require(_0xb31a('0xee')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xef'),require('./api/whatsappTransferReport'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xf0'),require(_0xb31a('0xf1')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xf2'),require(_0xb31a('0xf3')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xf4'),require(_0xb31a('0xf5')));_0xfca6b0[_0xb31a('0x8')]('/api/user-settings',require(_0xb31a('0xf6')));_0xfca6b0[_0xb31a('0x8')]('/api/auth/local',require('./api/authLocal'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xf7'),require('./api/authGoogle'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xf8'),require(_0xb31a('0xf9')));_0xfca6b0[_0xb31a('0x8')]('/api/jira',require('./api/jira'));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xfa'),require(_0xb31a('0xfb')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xfc'),require(_0xb31a('0xfd')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0xfe'),require(_0xb31a('0xff')));_0xfca6b0['use']('/api/pm2',require(_0xb31a('0x100')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x101'),require(_0xb31a('0x102')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x103'),clientSideLogs);_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x104'),express[_0xb31a('0x105')](path[_0xb31a('0x106')](config['root'],_0xb31a('0x104'))));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x107'),express['static'](path[_0xb31a('0x106')](config['root'],'/www')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x108'),express[_0xb31a('0x105')](path[_0xb31a('0x106')](config[_0xb31a('0x109')],_0xb31a('0x108'))));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x10a'),express[_0xb31a('0x105')](path[_0xb31a('0x106')](config[_0xb31a('0x109')],_0xb31a('0x10b'),'3.1.0')));_0xfca6b0[_0xb31a('0x8')](_0xb31a('0x10c'),express[_0xb31a('0x105')](path[_0xb31a('0x106')](config['root'],'/server/files/plugins')));_0xfca6b0['route'](_0xb31a('0x10d'))['get'](errors[0x194]);_0xfca6b0['route']('/*')['get'](function(_0x34c54e,_0x2d2720){_0x2d2720['sendFile'](path[_0xb31a('0x10e')](_0xfca6b0[_0xb31a('0x10f')](_0xb31a('0x110'))+_0xb31a('0x111')));});return _0xfca6b0;});}; \ No newline at end of file +var _0xd996=['/api/sms/interactions','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/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/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','static','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','/index.html','express','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','./api/user','use','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication'];(function(_0x24e37c,_0x5aa189){var _0x161dda=function(_0x10857f){while(--_0x10857f){_0x24e37c['push'](_0x24e37c['shift']());}};_0x161dda(++_0x5aa189);}(_0xd996,0xd0));var _0x6d99=function(_0x19258d,_0x5f2768){_0x19258d=_0x19258d-0x0;var _0x2239d7=_0xd996[_0x19258d];return _0x2239d7;};'use strict';var path=require('path');var express=require(_0x6d99('0x0'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require(_0x6d99('0x1'))[_0x6d99('0x2')];var clientSideLogs=require(_0x6d99('0x3'));exports['default']=function(_0x454ee5){return setupLoggers(_0x454ee5)[_0x6d99('0x4')](function(){_0x454ee5['use']('/api/users',require(_0x6d99('0x5')));_0x454ee5['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x7'),require(_0x6d99('0x8')));_0x454ee5['use']('/api/voice/extensions',require(_0x6d99('0x9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa'),require(_0x6d99('0xb')));_0x454ee5['use'](_0x6d99('0xc'),require(_0x6d99('0xd')));_0x454ee5['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x454ee5[_0x6d99('0x6')]('/api/screen/recordings',require('./api/screenRecording'));_0x454ee5['use'](_0x6d99('0xe'),require('./api/voiceMail'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf'),require(_0x6d99('0x10')));_0x454ee5[_0x6d99('0x6')]('/api/voice/calls/reports',require(_0x6d99('0x11')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x12'),require('./api/voiceDialReport'));_0x454ee5[_0x6d99('0x6')]('/api/voice/agents/reports',require(_0x6d99('0x13')));_0x454ee5[_0x6d99('0x6')]('/api/voice/queues/reports',require(_0x6d99('0x14')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x15'),require(_0x6d99('0x16')));_0x454ee5['use'](_0x6d99('0x17'),require(_0x6d99('0x18')));_0x454ee5[_0x6d99('0x6')]('/api/voice/transfers/reports',require(_0x6d99('0x19')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x1a'),require(_0x6d99('0x1b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x1c'),require(_0x6d99('0x1d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x1e'),require(_0x6d99('0x1f')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x20'),require(_0x6d99('0x21')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x22'),require(_0x6d99('0x23')));_0x454ee5[_0x6d99('0x6')]('/api/mail/messages',require(_0x6d99('0x24')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x25'),require(_0x6d99('0x26')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x27'),require('./api/mailQueueReport'));_0x454ee5['use'](_0x6d99('0x28'),require(_0x6d99('0x29')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x2a'),require(_0x6d99('0x2b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x2c'),require('./api/faxAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x2d'),require(_0x6d99('0x2e')));_0x454ee5['use'](_0x6d99('0x2f'),require('./api/faxInteraction'));_0x454ee5[_0x6d99('0x6')]('/api/fax/messages',require(_0x6d99('0x30')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x31'),require(_0x6d99('0x32')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x33'),require(_0x6d99('0x34')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x35'),require('./api/smsAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x36'),require(_0x6d99('0x37')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x38'),require('./api/smsInteraction'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x39'),require('./api/smsMessage'));_0x454ee5[_0x6d99('0x6')]('/api/sms/queues',require(_0x6d99('0x3a')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x3b'),require('./api/openchannelAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x3c'),require(_0x6d99('0x3d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x3e'),require('./api/openchannelInteraction'));_0x454ee5[_0x6d99('0x6')]('/api/openchannel/messages',require(_0x6d99('0x3f')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x40'),require(_0x6d99('0x41')));_0x454ee5['use'](_0x6d99('0x42'),require(_0x6d99('0x43')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x44'),require('./api/openchannelQueueReport'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x45'),require('./api/chatApplication'));_0x454ee5['use'](_0x6d99('0x46'),require(_0x6d99('0x47')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x48'),require('./api/chatMessage'));_0x454ee5['use'](_0x6d99('0x49'),require(_0x6d99('0x4a')));_0x454ee5['use'](_0x6d99('0x4b'),require(_0x6d99('0x4c')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x4d'),require(_0x6d99('0x4e')));_0x454ee5['use'](_0x6d99('0x4f'),require(_0x6d99('0x50')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x51'),require(_0x6d99('0x52')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x53'),require(_0x6d99('0x54')));_0x454ee5['use'](_0x6d99('0x55'),require('./api/cmHopper'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x56'),require('./api/cmHopperBlack'));_0x454ee5[_0x6d99('0x6')]('/api/cm/hopper_final',require(_0x6d99('0x57')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x58'),require('./api/cmHopperHistory'));_0x454ee5['use']('/api/cm/custom_fields',require(_0x6d99('0x59')));_0x454ee5[_0x6d99('0x6')]('/api/actions',require(_0x6d99('0x5a')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x5b'),require(_0x6d99('0x5c')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x5d'),require(_0x6d99('0x5e')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x5f'),require(_0x6d99('0x60')));_0x454ee5['use']('/api/conditions',require(_0x6d99('0x61')));_0x454ee5[_0x6d99('0x6')]('/api/intervals',require(_0x6d99('0x62')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x63'),require(_0x6d99('0x64')));_0x454ee5[_0x6d99('0x6')]('/api/cdr',require('./api/cdr'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x65'),require('./api/voiceQueuesLog'));_0x454ee5[_0x6d99('0x6')]('/api/schedules',require(_0x6d99('0x66')));_0x454ee5['use']('/api/sounds',require(_0x6d99('0x67')));_0x454ee5['use'](_0x6d99('0x68'),require(_0x6d99('0x69')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x6a'),require(_0x6d99('0x6b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x6c'),require('./api/cmContactHasItem'));_0x454ee5['use']('/api/cm_hopper_additional_phones',require(_0x6d99('0x6d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x6e'),require(_0x6d99('0x6f')));_0x454ee5[_0x6d99('0x6')]('/api/triggers',require(_0x6d99('0x70')));_0x454ee5[_0x6d99('0x6')]('/api/variables',require(_0x6d99('0x71')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x72'),require(_0x6d99('0x73')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/reports',require('./api/integrationReport'));_0x454ee5[_0x6d99('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x74'),require('./api/analyticDefaultReport'));_0x454ee5['use'](_0x6d99('0x75'),require(_0x6d99('0x76')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x77'),require(_0x6d99('0x78')));_0x454ee5[_0x6d99('0x6')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x454ee5[_0x6d99('0x6')]('/api/analytics/tree_reports',require(_0x6d99('0x79')));_0x454ee5['use'](_0x6d99('0x7a'),require(_0x6d99('0x7b')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x454ee5['use']('/api/integrations/salesforce/fields',require(_0x6d99('0x7c')));_0x454ee5['use'](_0x6d99('0x7d'),require(_0x6d99('0x7e')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x7f'),require(_0x6d99('0x80')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x81'),require(_0x6d99('0x82')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/desk/accounts',require(_0x6d99('0x83')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/desk/configurations',require(_0x6d99('0x84')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x85'),require('./api/intDeskField'));_0x454ee5['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x86'),require(_0x6d99('0x87')));_0x454ee5['use'](_0x6d99('0x88'),require(_0x6d99('0x89')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x8a'),require(_0x6d99('0x8b')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x454ee5[_0x6d99('0x6')]('/api/integrations/zendesk/fields',require(_0x6d99('0x8c')));_0x454ee5['use']('/api/integrations/freshdesk/accounts',require(_0x6d99('0x8d')));_0x454ee5['use'](_0x6d99('0x8e'),require('./api/intFreshdeskConfiguration'));_0x454ee5['use'](_0x6d99('0x8f'),require(_0x6d99('0x90')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x91'),require(_0x6d99('0x92')));_0x454ee5['use'](_0x6d99('0x93'),require(_0x6d99('0x94')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x95'),require(_0x6d99('0x96')));_0x454ee5['use'](_0x6d99('0x97'),require(_0x6d99('0x98')));_0x454ee5['use'](_0x6d99('0x99'),require('./api/intServicenowConfiguration'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x9a'),require(_0x6d99('0x9b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x9c'),require(_0x6d99('0x9d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x9e'),require(_0x6d99('0x9f')));_0x454ee5['use'](_0x6d99('0xa0'),require(_0x6d99('0xa1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa2'),require('./api/intFreshsalesAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa3'),require(_0x6d99('0xa4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa5'),require(_0x6d99('0xa6')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa7'),require(_0x6d99('0xa8')));_0x454ee5[_0x6d99('0x6')]('/api/chat/reports/queue',require(_0x6d99('0xa9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xaa'),require('./api/chatInternalMessage'));_0x454ee5['use'](_0x6d99('0xab'),require(_0x6d99('0xac')));_0x454ee5['use'](_0x6d99('0xad'),require(_0x6d99('0xae')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xaf'),require('./api/jscriptySessionReport'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xb0'),require(_0x6d99('0xb1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xb2'),require(_0x6d99('0xb3')));_0x454ee5[_0x6d99('0x6')]('/api/square/details/reports',require(_0x6d99('0xb4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xb5'),require(_0x6d99('0xb6')));_0x454ee5[_0x6d99('0x6')]('/api/settings',require(_0x6d99('0xb7')));_0x454ee5['use'](_0x6d99('0xb8'),require(_0x6d99('0xb9')));_0x454ee5['use'](_0x6d99('0xba'),require('./api/squareProject'));_0x454ee5['use'](_0x6d99('0xbb'),require('./api/squareRecording'));_0x454ee5['use'](_0x6d99('0xbc'),require('./api/squareMessage'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xbd'),require(_0x6d99('0xbe')));_0x454ee5['use'](_0x6d99('0xbf'),require(_0x6d99('0xc0')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc1'),require(_0x6d99('0xc2')));_0x454ee5['use'](_0x6d99('0xc3'),require(_0x6d99('0xc4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc5'),require(_0x6d99('0xc6')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc7'),require('./api/plugin'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc8'),require(_0x6d99('0xc9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xca'),require(_0x6d99('0xcb')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xcc'),require(_0x6d99('0xcd')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xce'),require(_0x6d99('0xcf')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xd0'),require(_0x6d99('0xd1')));_0x454ee5[_0x6d99('0x6')]('/api/cm/lists',require(_0x6d99('0xd2')));_0x454ee5['use'](_0x6d99('0xd3'),require(_0x6d99('0xd4')));_0x454ee5['use'](_0x6d99('0xd5'),require(_0x6d99('0xd6')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xd7'),require('./api/userProfileSection'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xd8'),require(_0x6d99('0xd9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xda'),require(_0x6d99('0xdb')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xdc'),require(_0x6d99('0xdd')));_0x454ee5[_0x6d99('0x6')]('/api/whatsapp/applications',require(_0x6d99('0xde')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xdf'),require(_0x6d99('0xe0')));_0x454ee5[_0x6d99('0x6')]('/api/whatsapp/messages',require(_0x6d99('0xe1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe2'),require(_0x6d99('0xe3')));_0x454ee5[_0x6d99('0x6')]('/api/whatsapp/reports/transfer',require(_0x6d99('0xe4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe5'),require('./api/whatsappQueue'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe6'),require(_0x6d99('0xe7')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe8'),require(_0x6d99('0xe9')));_0x454ee5['use'](_0x6d99('0xea'),require(_0x6d99('0xeb')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xec'),require('./api/authLocal'));_0x454ee5['use'](_0x6d99('0xed'),require(_0x6d99('0xee')));_0x454ee5[_0x6d99('0x6')]('/api/auth/activedirectory',require(_0x6d99('0xef')));_0x454ee5['use'](_0x6d99('0xf0'),require(_0x6d99('0xf1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf2'),require(_0x6d99('0xf3')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf4'),require(_0x6d99('0xf5')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf6'),require(_0x6d99('0xf7')));_0x454ee5[_0x6d99('0x6')]('/api/pm2',require(_0x6d99('0xf8')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf9'),require(_0x6d99('0xfa')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xfb'),clientSideLogs);_0x454ee5[_0x6d99('0x6')](_0x6d99('0xfc'),express['static'](path[_0x6d99('0xfd')](config[_0x6d99('0xfe')],_0x6d99('0xfc'))));_0x454ee5[_0x6d99('0x6')]('/www',express[_0x6d99('0xff')](path['join'](config[_0x6d99('0xfe')],'/www')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x100'),express[_0x6d99('0xff')](path[_0x6d99('0xfd')](config[_0x6d99('0xfe')],_0x6d99('0x100'))));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x101'),express[_0x6d99('0xff')](path[_0x6d99('0xfd')](config['root'],_0x6d99('0x102'),'3.1.0')));_0x454ee5[_0x6d99('0x6')]('/plugins',express[_0x6d99('0xff')](path['join'](config[_0x6d99('0xfe')],_0x6d99('0x103'))));_0x454ee5[_0x6d99('0x104')](_0x6d99('0x105'))[_0x6d99('0x106')](errors[0x194]);_0x454ee5[_0x6d99('0x104')]('/*')[_0x6d99('0x106')](function(_0xded49a,_0xc9dc60){_0xc9dc60['sendFile'](path['resolve'](_0x454ee5['get']('appPath')+_0x6d99('0x107')));});return _0x454ee5;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index bfee9d7..251bfa1 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x029a=['../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc'];(function(_0x4ff666,_0x35c126){var _0x5cf1ae=function(_0x5bc33a){while(--_0x5bc33a){_0x4ff666['push'](_0x4ff666['shift']());}};_0x5cf1ae(++_0x35c126);}(_0x029a,0xb5));var _0xa029=function(_0x15c773,_0x325c41){_0x15c773=_0x15c773-0x0;var _0x81312c=_0x029a[_0x15c773];return _0x81312c;};'use strict';var jayson=require('jayson/promise');var _=require(_0xa029('0x0'));var config=require(_0xa029('0x1'));exports['listen']=function(){return new Promise(function(_0x1641f3,_0x5cf600){var _0x31aaba={};_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/user/user.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/voiceExtension/voiceExtension.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/voiceQueue/voiceQueue.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x3')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x4')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x5')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/memberReport/memberReport.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x6')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/mailServerIn/mailServerIn.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/mailAccount/mailAccount.rpc'));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x7')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x8')));_0x31aaba=_['merge'](_0x31aaba,require('../api/mailMessage/mailMessage.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x9')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0xa')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0xb')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/faxInteraction/faxInteraction.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0xc')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0xd')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0xe')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0xf')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x10')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x11')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x12')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x13')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x14')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x31aaba=_['merge'](_0x31aaba,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x15')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x16')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x17')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/cmContact/cmContact.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x18')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x19')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x1a')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x1b')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x1c')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x1d')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x1e')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x1f')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x20')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/trigger/trigger.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x21')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x22')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x23')));_0x31aaba=_['merge'](_0x31aaba,require(_0xa029('0x24')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x25')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x26')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x27')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x28')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x29')));_0x31aaba=_['merge'](_0x31aaba,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x2a')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/squareOdbc/squareOdbc.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/squareProject/squareProject.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/squareRecording/squareRecording.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x2b')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x2c')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/attachment/attachment.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x2d')));_0x31aaba=_['merge'](_0x31aaba,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x2e')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x2f')));_0x31aaba=_[_0xa029('0x2')](_0x31aaba,require(_0xa029('0x30')));var _0x402366=jayson[_0xa029('0x31')](_0x31aaba)['http']();var _0x50fcee=config[_0xa029('0x32')][_0xa029('0x33')]||config[_0xa029('0x33')]+0x1;var _0x4a32ab=config['rpc']['ip']||'localhost';_0x402366['on']('error',function(_0x4e926d){return _0x5cf600(_0x4e926d);});_0x402366[_0xa029('0x34')](_0x50fcee,_0x4a32ab,function(){console['log'](_0xa029('0x35'),_0x4a32ab,_0x50fcee);require('../config/triggers')[_0xa029('0x36')]();return _0x1641f3(_0xa029('0x37')+_0x4a32ab+':'+_0x50fcee);});});}; \ No newline at end of file +var _0x465c=['../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.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/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0x465c,0x1ae));var _0xc465=function(_0x4bf163,_0x5988f7){_0x4bf163=_0x4bf163-0x0;var _0x29a5dd=_0x465c[_0x4bf163];return _0x29a5dd;};'use strict';var jayson=require(_0xc465('0x0'));var _=require(_0xc465('0x1'));var config=require('../config/environment');exports[_0xc465('0x2')]=function(){return new Promise(function(_0x49e320,_0x5bc934){var _0x1a90c4={};_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x4')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x5')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x6')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x7')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x8')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x9')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xa')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xb')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xc')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xd')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xe')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/mailServerIn/mailServerIn.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xf')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x10')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x11')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/mailMessage/mailMessage.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x12')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/faxAccount/faxAccount.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x13')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x14')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x15')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x16')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x17')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x18')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/smsInteraction/smsInteraction.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/smsMessage/smsMessage.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/smsQueue/smsQueue.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x19')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1a90c4=_['merge'](_0x1a90c4,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x1a')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x1b')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x1c')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x1d')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x1e')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x1f')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x20')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x21')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x22')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x23')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x24')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x25')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x26')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x27')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x28')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x29')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2a')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2b')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2c')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2d')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2e')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2f')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x30')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x31')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x32')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x33')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x34')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x35')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x36')));_0x1a90c4=_['merge'](_0x1a90c4,require('../api/setting/setting.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x37')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x38')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x39')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3a')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3b')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/attachment/attachment.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3c')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3d')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3e')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3f')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x40')));var _0x56ca1b=jayson[_0xc465('0x41')](_0x1a90c4)[_0xc465('0x42')]();var _0x426a91=config[_0xc465('0x43')][_0xc465('0x44')]||config[_0xc465('0x44')]+0x1;var _0x551a78=config[_0xc465('0x43')]['ip']||_0xc465('0x45');_0x56ca1b['on']('error',function(_0x264ee9){return _0x5bc934(_0x264ee9);});_0x56ca1b[_0xc465('0x2')](_0x426a91,_0x551a78,function(){console['log'](_0xc465('0x46'),_0x551a78,_0x426a91);require(_0xc465('0x47'))[_0xc465('0x48')]();return _0x49e320(_0xc465('0x49')+_0x551a78+':'+_0x426a91);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 64f21e0..0463bc9 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5078=['sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','setContext','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','line','toLowerCase','hangup','emit','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','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','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s'];(function(_0x1d80f1,_0x810c4c){var _0x9df9b4=function(_0x136fab){while(--_0x136fab){_0x1d80f1['push'](_0x1d80f1['shift']());}};_0x9df9b4(++_0x810c4c);}(_0x5078,0x148));var _0x8507=function(_0x2605e7,_0x236140){_0x2605e7=_0x2605e7-0x0;var _0x1982c3=_0x5078[_0x2605e7];return _0x1982c3;};'use strict';var util=require(_0x8507('0x0'));var _=require(_0x8507('0x1'));var EventEmitter=require(_0x8507('0x2'))[_0x8507('0x3')];var AGIReply=require(_0x8507('0x4'));var AGIError=require(_0x8507('0x5'));function AGIChannel(_0x43500e){var _0x20608d=this,_0x1a4930=new AGIReply(),_0x239a82=![],_0x2aa379={};EventEmitter[_0x8507('0x6')](_0x20608d);_0x43500e[_0x8507('0x7')](_0x8507('0x8'));_0x43500e[_0x8507('0x9')](0x8*0x3c*0x3c*0x3e8);_0x1a4930[_0x8507('0x7')]('utf8');_0x1a4930['on'](_0x8507('0xa'),function(_0x2a4991){for(var _0x2a7f27 in _0x2a4991){_0x20608d[_0x2a7f27]=_0x2a4991[_0x2a7f27];}_0x20608d['emit']('ready');});_0x1a4930['on'](_0x8507('0xb'),function(_0x1c71f5){if(_0x1c71f5[_0x8507('0xc')]()==_0x8507('0xd')){_0x20608d[_0x8507('0xe')](_0x8507('0xd'));return;}if(_0x1c71f5[_0x8507('0xf')](0x0,0xb)=='520-Invalid'){_0x239a82=!![];}if(_0x239a82){_0x2aa379['rx']+=_0x1c71f5+'\x0a';if(_0x1c71f5[_0x8507('0x10')](_0x8507('0x11'))!=-0x1){_0x239a82=![];}}else{_0x2aa379['rx']=_0x1c71f5;}if(_0x239a82){return;}if(typeof _0x2aa379['cb']==_0x8507('0x12')){var _0x31109f=_0x2aa379['rx']['substring'](0x0,0x3),_0x21a236=null,_0x5c41e2=null;_0x31109f=parseInt(_0x31109f);if(isNaN(_0x31109f)){_0x2aa379['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8507('0x13')});return;}if(_0x31109f!=0xc8){_0x2aa379['cb'](null,{'code':_0x31109f,'result':-0x1,'extra':'KO'});return;}_0x21a236=_0x2aa379['rx'][_0x8507('0xf')](0x4)[_0x8507('0x14')](_0x8507('0x15'),'');if(_0x21a236[_0x8507('0x16')]('\x20')!=-0x1){_0x21a236=_0x21a236[_0x8507('0x17')](0x0,_0x21a236['indexOf']('\x20'));}if(_['startsWith'](_0x21a236,'-1')){_0x21a236=parseInt(_0x21a236);}_0x5c41e2=_0x2aa379['rx'][_0x8507('0x18')]('\x20');if(_0x5c41e2[_0x8507('0x19')]==0x3){_0x5c41e2=_0x5c41e2[0x2][_0x8507('0xf')](0x1,_0x5c41e2[0x2]['length']-0x1);}else if(_0x5c41e2[_0x8507('0x19')]>0x3){var _0x375a0d=/\((.+)\)/;var _0x26bfaf=_0x2aa379['rx'][_0x8507('0x1a')](_0x375a0d);if(_0x26bfaf){_0x5c41e2=_0x26bfaf[0x1];}else{_0x5c41e2=null;}}else{_0x5c41e2=null;}_0x2aa379['cb'](null,{'code':_0x31109f,'result':_0x21a236,'extra':_0x5c41e2});}});_0x43500e['on'](_0x8507('0x1b'),function(_0x13b285){_0x20608d[_0x8507('0xe')](_0x8507('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x13b285['code']));});_0x43500e['on'](_0x8507('0x1c'),function(){_0x20608d[_0x8507('0xe')](_0x8507('0x1c'),new AGIError(_0x8507('0x1d')));});_0x43500e['on'](_0x8507('0x1e'),function(){_0x20608d['emit'](_0x8507('0x1e'),new AGIError(_0x8507('0x1f')));_0x43500e[_0x8507('0x20')]();});_0x43500e[_0x8507('0x21')](_0x1a4930);this[_0x8507('0x22')]=function(_0x14eac2,_0x42e5ff){var _0x14eac2=_0x14eac2||'',_0x42e5ff=typeof _0x42e5ff==_0x8507('0x12')?_0x42e5ff:new Function();_0x2aa379={'tx':_0x14eac2,'rx':'','cb':_0x42e5ff};_0x43500e[_0x8507('0x23')](_0x14eac2+'\x0a');},this[_0x8507('0x1c')]=function(){_0x43500e[_0x8507('0x20')]();};}util[_0x8507('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x8507('0x25')][_0x8507('0x26')]=function(_0x358e50){return this['command'][_0x8507('0x27')](this,_0x358e50);};AGIChannel[_0x8507('0x25')][_0x8507('0x28')]=function(){return this['sendRequest'](_0x8507('0x29'));};AGIChannel[_0x8507('0x25')][_0x8507('0x2a')]=function(_0x160402,_0x4fd7c0,_0xc48bf5){_0x160402=_0x160402===undefined?_0x8507('0x2b'):_0x160402;_0x4fd7c0=_0x4fd7c0===undefined?'5':_0x4fd7c0;_0xc48bf5=_0xc48bf5===undefined?'1':_0xc48bf5;return this[_0x8507('0x26')](util[_0x8507('0x2c')](_0x8507('0x2d'),_0x160402,_0x4fd7c0*0x3e8,_0xc48bf5));};AGIChannel['prototype'][_0x8507('0x2e')]=function(_0xb01c06){_0xb01c06=_0xb01c06||_0x8507('0x2f');return this[_0x8507('0x26')](util[_0x8507('0x2c')](_0x8507('0x30'),_0xb01c06));};AGIChannel[_0x8507('0x25')][_0x8507('0x31')]=function(_0xa3642,_0x6e9a38){if(_[_0x8507('0x32')](_0x6e9a38)){return this[_0x8507('0x26')](util[_0x8507('0x2c')]('EXEC\x20%s\x20%s',_0xa3642,_0x6e9a38['join'](',')));}return this[_0x8507('0x26')](util['format'](_0x8507('0x33'),_0xa3642,_0x6e9a38));};AGIChannel[_0x8507('0x25')]['setContext']=function(_0x53595c){return this['sendRequest'](util[_0x8507('0x2c')](_0x8507('0x34'),_0x53595c));};AGIChannel[_0x8507('0x25')][_0x8507('0x35')]=function(_0x181a99){return this[_0x8507('0x26')](util['format']('SET\x20EXTENSION\x20%s',_0x181a99));};AGIChannel[_0x8507('0x25')][_0x8507('0x36')]=function(_0xc9d20f){return this['sendRequest'](util['format'](_0x8507('0x37'),_0xc9d20f));};AGIChannel[_0x8507('0x25')]['hangup']=function(){return this[_0x8507('0x26')](_0x8507('0x38'));};AGIChannel['prototype']['setVariable']=function(_0x51048c,_0x134f88){var _0x14c87b=_[_0x8507('0x39')](_0x134f88)||_[_0x8507('0x3a')](_0x134f88)?_0x134f88['toString']():_0x134f88;return this['sendRequest'](util[_0x8507('0x2c')](_0x8507('0x3b'),_0x51048c,_0x14c87b?_0x14c87b['toString']()[_0x8507('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8507('0x25')][_0x8507('0x3c')]=function(_0x4bc252,_0xfd452e){return this[_0x8507('0x26')](util[_0x8507('0x2c')](_0x8507('0x3d'),_0x4bc252,_0xfd452e));};AGIChannel[_0x8507('0x25')][_0x8507('0x3e')]=function(_0x5b4872,_0x42e640){return this[_0x8507('0x26')](util['format'](_0x8507('0x3f'),_0x5b4872,_0x42e640));};AGIChannel[_0x8507('0x25')]['sayPhonetic']=function(_0x2297a8,_0x500eb6){return this[_0x8507('0x26')](util[_0x8507('0x2c')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2297a8,_0x500eb6));};AGIChannel[_0x8507('0x25')]['continueAt']=function(_0x3051fb,_0xd2d97,_0x44f25d){_0xd2d97=_0xd2d97||this[_0x8507('0x40')];_0x44f25d=_0x44f25d||0x1;this[_0x8507('0x41')](_0x3051fb);this[_0x8507('0x35')](_0xd2d97);this['setPriority'](_0x44f25d);return this[_0x8507('0x2e')](util[_0x8507('0x2c')](_0x8507('0x42'),_0x3051fb,_0xd2d97,_0x44f25d));};AGIChannel[_0x8507('0x25')]['getVariable']=function(_0x260a98){return this[_0x8507('0x26')](util['format'](_0x8507('0x43'),_0x260a98));};AGIChannel[_0x8507('0x25')][_0x8507('0x44')]=function(_0x4f6ef0,_0x3e22d7,_0x4e2621,_0x2865cf,_0xebe038,_0xa09a2c){_0x3e22d7=_0x3e22d7||_0x8507('0x45');_0x4e2621=_0x4e2621||'';_0x2865cf=_0x2865cf===undefined?-0x1:_0x2865cf==='-1'?-0x1:_0x2865cf*0x3e8;_0xebe038=_0xebe038===undefined?'':'s='+_0xebe038;_0xa09a2c=_0xa09a2c?'BEEP':'';return this[_0x8507('0x26')](util[_0x8507('0x2c')](_0x8507('0x46'),_0x4f6ef0,_0x3e22d7,_0x4e2621,_0x2865cf,_0xa09a2c,_0xebe038));};AGIChannel[_0x8507('0x25')]['streamFile']=function(_0x5f4c21,_0x4d4b97){_0x4d4b97=_0x4d4b97||'';return this[_0x8507('0x26')](util[_0x8507('0x2c')](_0x8507('0x47'),_0x5f4c21,_0x4d4b97));};AGIChannel[_0x8507('0x25')][_0x8507('0x48')]=function(_0x171b20){return this['exec'](_0x8507('0x49'),_0x171b20);};AGIChannel[_0x8507('0x25')]['wait']=function(_0x3fa349){return this[_0x8507('0x31')](_0x8507('0x4a'),_0x3fa349);};AGIChannel[_0x8507('0x25')][_0x8507('0x1b')]=function(_0x42fb62,_0x4858b6){this['noop'](util['format'](_0x8507('0x4b'),_0x42fb62['id'],_0x42fb62[_0x8507('0x4c')],_0x4858b6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8507('0x4d')]=AGIChannel; \ No newline at end of file +var _0x4d68=['noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','ready','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','inherits','sendRequest','command','sync','answer','ANSWER','prototype','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x13f09a,_0x13040a){var _0x5116f8=function(_0x18dea4){while(--_0x18dea4){_0x13f09a['push'](_0x13f09a['shift']());}};_0x5116f8(++_0x13040a);}(_0x4d68,0x1c3));var _0x84d6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4d68[_0x465028];return _0xb783d4;};'use strict';var util=require(_0x84d6('0x0'));var _=require(_0x84d6('0x1'));var EventEmitter=require(_0x84d6('0x2'))[_0x84d6('0x3')];var AGIReply=require(_0x84d6('0x4'));var AGIError=require(_0x84d6('0x5'));function AGIChannel(_0x508cb6){var _0x319f1f=this,_0x5ee114=new AGIReply(),_0x3a2f0b=![],_0x589711={};EventEmitter[_0x84d6('0x6')](_0x319f1f);_0x508cb6[_0x84d6('0x7')](_0x84d6('0x8'));_0x508cb6['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5ee114['setEncoding'](_0x84d6('0x8'));_0x5ee114['on'](_0x84d6('0x9'),function(_0x260859){for(var _0x367139 in _0x260859){_0x319f1f[_0x367139]=_0x260859[_0x367139];}_0x319f1f['emit'](_0x84d6('0xa'));});_0x5ee114['on']('line',function(_0x2fb185){if(_0x2fb185[_0x84d6('0xb')]()==_0x84d6('0xc')){_0x319f1f['emit']('hangup');return;}if(_0x2fb185[_0x84d6('0xd')](0x0,0xb)=='520-Invalid'){_0x3a2f0b=!![];}if(_0x3a2f0b){_0x589711['rx']+=_0x2fb185+'\x0a';if(_0x2fb185[_0x84d6('0xe')](_0x84d6('0xf'))!=-0x1){_0x3a2f0b=![];}}else{_0x589711['rx']=_0x2fb185;}if(_0x3a2f0b){return;}if(typeof _0x589711['cb']==_0x84d6('0x10')){var _0x19e7a9=_0x589711['rx'][_0x84d6('0xd')](0x0,0x3),_0x203c54=null,_0x506edc=null;_0x19e7a9=parseInt(_0x19e7a9);if(isNaN(_0x19e7a9)){_0x589711['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x19e7a9!=0xc8){_0x589711['cb'](null,{'code':_0x19e7a9,'result':-0x1,'extra':'KO'});return;}_0x203c54=_0x589711['rx'][_0x84d6('0xd')](0x4)[_0x84d6('0x11')](_0x84d6('0x12'),'');if(_0x203c54[_0x84d6('0x13')]('\x20')!=-0x1){_0x203c54=_0x203c54[_0x84d6('0x14')](0x0,_0x203c54[_0x84d6('0x13')]('\x20'));}if(_[_0x84d6('0x15')](_0x203c54,'-1')){_0x203c54=parseInt(_0x203c54);}_0x506edc=_0x589711['rx']['split']('\x20');if(_0x506edc[_0x84d6('0x16')]==0x3){_0x506edc=_0x506edc[0x2][_0x84d6('0xd')](0x1,_0x506edc[0x2][_0x84d6('0x16')]-0x1);}else if(_0x506edc[_0x84d6('0x16')]>0x3){var _0x385e2b=/\((.+)\)/;var _0x4b1a8b=_0x589711['rx'][_0x84d6('0x17')](_0x385e2b);if(_0x4b1a8b){_0x506edc=_0x4b1a8b[0x1];}else{_0x506edc=null;}}else{_0x506edc=null;}_0x589711['cb'](null,{'code':_0x19e7a9,'result':_0x203c54,'extra':_0x506edc});}});_0x508cb6['on'](_0x84d6('0x18'),function(_0x579aa8){_0x319f1f[_0x84d6('0x19')]('error',new AGIError(_0x84d6('0x1a'),_0x579aa8[_0x84d6('0x1b')]));});_0x508cb6['on'](_0x84d6('0x1c'),function(){_0x319f1f[_0x84d6('0x19')](_0x84d6('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x508cb6['on'](_0x84d6('0x1d'),function(){_0x319f1f[_0x84d6('0x19')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x508cb6[_0x84d6('0x1e')]();});_0x508cb6['pipe'](_0x5ee114);this['command']=function(_0x1aa38c,_0x256787){var _0x1aa38c=_0x1aa38c||'',_0x256787=typeof _0x256787==_0x84d6('0x10')?_0x256787:new Function();_0x589711={'tx':_0x1aa38c,'rx':'','cb':_0x256787};_0x508cb6['write'](_0x1aa38c+'\x0a');},this['close']=function(){_0x508cb6[_0x84d6('0x1e')]();};}util[_0x84d6('0x1f')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x84d6('0x20')]=function(_0x256e42){return this[_0x84d6('0x21')][_0x84d6('0x22')](this,_0x256e42);};AGIChannel['prototype'][_0x84d6('0x23')]=function(){return this['sendRequest'](_0x84d6('0x24'));};AGIChannel[_0x84d6('0x25')]['getData']=function(_0x500a81,_0x1fcb3b,_0x5c9532){_0x500a81=_0x500a81===undefined?'beep':_0x500a81;_0x1fcb3b=_0x1fcb3b===undefined?'5':_0x1fcb3b;_0x5c9532=_0x5c9532===undefined?'1':_0x5c9532;return this[_0x84d6('0x20')](util['format'](_0x84d6('0x26'),_0x500a81,_0x1fcb3b*0x3e8,_0x5c9532));};AGIChannel['prototype'][_0x84d6('0x27')]=function(_0x2c76e2){_0x2c76e2=_0x2c76e2||_0x84d6('0x28');return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x2a'),_0x2c76e2));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x2b')]=function(_0x3866d6,_0x1ebff2){if(_[_0x84d6('0x2c')](_0x1ebff2)){return this[_0x84d6('0x20')](util['format'](_0x84d6('0x2d'),_0x3866d6,_0x1ebff2[_0x84d6('0x2e')](',')));}return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x2d'),_0x3866d6,_0x1ebff2));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x2f')]=function(_0x3275f9){return this['sendRequest'](util[_0x84d6('0x29')]('SET\x20CONTEXT\x20%s',_0x3275f9));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x30')]=function(_0x51f235){return this[_0x84d6('0x20')](util[_0x84d6('0x29')]('SET\x20EXTENSION\x20%s',_0x51f235));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x31')]=function(_0x4450af){return this[_0x84d6('0x20')](util[_0x84d6('0x29')]('SET\x20PRIORITY\x20%s',_0x4450af));};AGIChannel[_0x84d6('0x25')][_0x84d6('0xc')]=function(){return this[_0x84d6('0x20')]('HANGUP');};AGIChannel[_0x84d6('0x25')]['setVariable']=function(_0x373a1e,_0x525b56){var _0x4b93f9=_[_0x84d6('0x32')](_0x525b56)||_[_0x84d6('0x33')](_0x525b56)?_0x525b56[_0x84d6('0x34')]():_0x525b56;return this['sendRequest'](util[_0x84d6('0x29')](_0x84d6('0x35'),_0x373a1e,_0x4b93f9?_0x4b93f9[_0x84d6('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x1c5424,_0x448df0){return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x36'),_0x1c5424,_0x448df0));};AGIChannel[_0x84d6('0x25')]['sayDigits']=function(_0x573025,_0x30836a){return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x37'),_0x573025,_0x30836a));};AGIChannel[_0x84d6('0x25')]['sayPhonetic']=function(_0x59ea9b,_0x5a55ec){return this[_0x84d6('0x20')](util['format'](_0x84d6('0x38'),_0x59ea9b,_0x5a55ec));};AGIChannel[_0x84d6('0x25')]['continueAt']=function(_0xba6f29,_0x29ee56,_0x513552){_0x29ee56=_0x29ee56||this[_0x84d6('0x39')];_0x513552=_0x513552||0x1;this[_0x84d6('0x2f')](_0xba6f29);this[_0x84d6('0x30')](_0x29ee56);this[_0x84d6('0x31')](_0x513552);return this[_0x84d6('0x27')](util['format'](_0x84d6('0x3a'),_0xba6f29,_0x29ee56,_0x513552));};AGIChannel['prototype'][_0x84d6('0x3b')]=function(_0x1930af){return this[_0x84d6('0x20')](util['format'](_0x84d6('0x3c'),_0x1930af));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x3d')]=function(_0x20f0b9,_0x313230,_0x108232,_0x49845c,_0x3f0029,_0x4badef){_0x313230=_0x313230||'wav';_0x108232=_0x108232||'';_0x49845c=_0x49845c===undefined?-0x1:_0x49845c==='-1'?-0x1:_0x49845c*0x3e8;_0x3f0029=_0x3f0029===undefined?'':'s='+_0x3f0029;_0x4badef=_0x4badef?'BEEP':'';return this[_0x84d6('0x20')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x20f0b9,_0x313230,_0x108232,_0x49845c,_0x4badef,_0x3f0029));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x3e')]=function(_0x4e44f2,_0x1c27cf){_0x1c27cf=_0x1c27cf||'';return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x3f'),_0x4e44f2,_0x1c27cf));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x40')]=function(_0x56aa1e){return this['exec'](_0x84d6('0x41'),_0x56aa1e);};AGIChannel[_0x84d6('0x25')][_0x84d6('0x42')]=function(_0x44f33d){return this[_0x84d6('0x2b')](_0x84d6('0x43'),_0x44f33d);};AGIChannel[_0x84d6('0x25')]['error']=function(_0x52e2ee,_0x1adbdc){this['noop'](util[_0x84d6('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x52e2ee['id'],_0x52e2ee[_0x84d6('0x44')],_0x1adbdc));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x84d6('0x45')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index f48a19c..23a91f5 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e33=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x1e48fc,_0x354e58){var _0x5a6098=function(_0x34bf43){while(--_0x34bf43){_0x1e48fc['push'](_0x1e48fc['shift']());}};_0x5a6098(++_0x354e58);}(_0x9e33,0x174));var _0x39e3=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x9e33[_0x152121];return _0x592a85;};'use strict';var util=require(_0x39e3('0x0'));var error={'E_AGI_UNDEFINED':_0x39e3('0x1'),'E_AGI_ARGUMENT_PORT':_0x39e3('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x39e3('0x3'),'E_AGI_SOCKET_ERROR':_0x39e3('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x39e3('0x5'),'E_AGI_COMMAND_EMPTY':_0x39e3('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x39e3('0x7'),'E_AGI_IVR_ENTRY':_0x39e3('0x8')};function AGIError(_0x58198f){var _0x58198f=_0x58198f||null,_0x11b97c=_0x11b97c||[],_0x444984=0x1,_0x541ab7='';if(!error[_0x58198f]){_0x58198f='E_AGI_UNDEFINED';}_0x11b97c['push'](error[_0x58198f]);while(arguments[_0x444984]){_0x11b97c['push'](arguments[_0x444984]);_0x444984++;}_0x541ab7=util['format'][_0x39e3('0x9')](util,_0x11b97c);this[_0x39e3('0xa')]=_0x541ab7;this[_0x39e3('0xb')]=_0x58198f;}module[_0x39e3('0xc')]=AGIError; \ No newline at end of file +var _0x007c=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','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.'];(function(_0x50b027,_0x454c57){var _0xd732e6=function(_0x25bd32){while(--_0x25bd32){_0x50b027['push'](_0x50b027['shift']());}};_0xd732e6(++_0x454c57);}(_0x007c,0x1da));var _0xc007=function(_0x3b7457,_0x7d66d4){_0x3b7457=_0x3b7457-0x0;var _0x53d633=_0x007c[_0x3b7457];return _0x53d633;};'use strict';var util=require(_0xc007('0x0'));var error={'E_AGI_UNDEFINED':_0xc007('0x1'),'E_AGI_ARGUMENT_PORT':_0xc007('0x2'),'E_AGI_SERVER_ERROR':_0xc007('0x3'),'E_AGI_SERVER_CLOSE':_0xc007('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xc007('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xc007('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xc007('0x7'),'E_AGI_COMMAND_EMPTY':_0xc007('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc007('0x9'),'E_AGI_IVR_ENTRY':_0xc007('0xa')};function AGIError(_0x2cd944){var _0x2cd944=_0x2cd944||null,_0x1879a9=_0x1879a9||[],_0x2c99fd=0x1,_0x48a286='';if(!error[_0x2cd944]){_0x2cd944='E_AGI_UNDEFINED';}_0x1879a9[_0xc007('0xb')](error[_0x2cd944]);while(arguments[_0x2c99fd]){_0x1879a9['push'](arguments[_0x2c99fd]);_0x2c99fd++;}_0x48a286=util[_0xc007('0xc')][_0xc007('0xd')](util,_0x1879a9);this['message']=_0x48a286;this[_0xc007('0xe')]=_0x2cd944;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 897be14..d096eb5 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24d4=['ioredis','./error','defaults','localhost','redis','agi','error','parse','emit','projectUpdate','E_AGI_SERVER_ERROR','exports','lodash','events','EventEmitter'];(function(_0x2d573d,_0x148520){var _0x56ec1e=function(_0x434d29){while(--_0x434d29){_0x2d573d['push'](_0x2d573d['shift']());}};_0x56ec1e(++_0x148520);}(_0x24d4,0x10b));var _0x424d=function(_0x179604,_0x48c283){_0x179604=_0x179604-0x0;var _0x29b655=_0x24d4[_0x179604];return _0x29b655;};'use strict';var _=require(_0x424d('0x0'));var EventEmitter=require(_0x424d('0x1'))[_0x424d('0x2')];var Redis=require(_0x424d('0x3'));var AGIError=require(_0x424d('0x4'));var config=require('../../config/environment');config['redis']=_[_0x424d('0x5')](config['redis'],{'host':_0x424d('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x424d('0x7')]);sub['subscribe'](_0x424d('0x8'),function(_0x11159f){if(_0x11159f)return eventEmitter['emit'](_0x424d('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x11159f));});sub['on']('message',function(_0x3e0d9d,_0xb8d560){if(_0x3e0d9d!==_0x424d('0x8'))return;try{var _0x1fd2d0=JSON[_0x424d('0xa')](_0xb8d560);eventEmitter[_0x424d('0xb')](_0x424d('0xc'),_0x1fd2d0);}catch(_0x300700){eventEmitter[_0x424d('0xb')]('error',new AGIError(_0x424d('0xd'),_0x300700));}});module[_0x424d('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x6bc4=['parse','projectUpdate','error','E_AGI_SERVER_ERROR','ioredis','./error','../../config/environment','defaults','redis','subscribe','agi','emit'];(function(_0x5b1970,_0x3a594f){var _0x5ce24a=function(_0x2203e1){while(--_0x2203e1){_0x5b1970['push'](_0x5b1970['shift']());}};_0x5ce24a(++_0x3a594f);}(_0x6bc4,0x130));var _0x46bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc4[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0x46bc('0x0'));var AGIError=require(_0x46bc('0x1'));var config=require(_0x46bc('0x2'));config['redis']=_[_0x46bc('0x3')](config[_0x46bc('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x46bc('0x4')]);sub[_0x46bc('0x5')](_0x46bc('0x6'),function(_0x4d434f){if(_0x4d434f)return eventEmitter[_0x46bc('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x4d434f));});sub['on']('message',function(_0x43d8eb,_0x3eaeed){if(_0x43d8eb!==_0x46bc('0x6'))return;try{var _0x4d0d0f=JSON[_0x46bc('0x8')](_0x3eaeed);eventEmitter[_0x46bc('0x7')](_0x46bc('0x9'),_0x4d0d0f);}catch(_0x253aa9){eventEmitter[_0x46bc('0x7')](_0x46bc('0xa'),new AGIError(_0x46bc('0xb'),_0x253aa9));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 2350f90..0773e3b 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde09=['includes','max\x20retry\x20reach','exports','lodash','agi','menu','getdigits','edges','numberOfEdges','prototype','addVertex','vertices','size','relations','traverseBFS','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde09,0x1c5));var _0x9de0=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xde09[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x9de0('0x0'));var logger=require('../../../config/logger')(_0x9de0('0x1'));var verticesWithRetry=[_0x9de0('0x2'),_0x9de0('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x9de0('0x4')]={};this[_0x9de0('0x5')]=0x0;};Graph[_0x9de0('0x6')][_0x9de0('0x7')]=function(_0x3dbdcc){this[_0x9de0('0x8')][_0x3dbdcc['id']]=_0x3dbdcc;this[_0x9de0('0x4')][_0x3dbdcc['id']]=[];};Graph[_0x9de0('0x6')]['addEdge']=function(_0x33e0ac,_0x27e8c8,_0xc23825){this[_0x9de0('0x4')][_0x33e0ac]['push']({'target':_0x27e8c8,'condition':_0xc23825});this[_0x9de0('0x5')]+=0x1;};Graph[_0x9de0('0x6')][_0x9de0('0x9')]=function(){return _[_0x9de0('0x9')](this['vertices']);};Graph[_0x9de0('0x6')][_0x9de0('0xa')]=function(){return this[_0x9de0('0x5')];};Graph[_0x9de0('0x6')]['getVertex']=function(_0x241a6d){return this[_0x9de0('0x8')][_0x241a6d];};Graph[_0x9de0('0x6')][_0x9de0('0xb')]=function(_0x1909c6,_0x2e908b){if(!this[_0x9de0('0x8')][_0x1909c6]){return logger['info']('no\x20vertex\x20found');}var _0x1ceb8e=_0x2e908b(this[_0x9de0('0x8')][_0x1909c6]);if(!_0x1ceb8e){return logger[_0x9de0('0xc')]('stop\x20traverse');}if(this[_0x9de0('0x4')][_0x1909c6][_0x9de0('0xd')]===0x0){return logger[_0x9de0('0xc')](_0x9de0('0xe'));}for(var _0x5b4f1a=0x0,_0x67a02c=[],_0x109738=![];_0x5b4f1a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','handleNotFound','handleUnpublished','initialize','getLicense','then','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./events','EventEmitter','127.0.0.1','projectUpdate','nextTick','error','findIndex','deleted','splice','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup'];(function(_0x58f745,_0x36bff6){var _0x19f228=function(_0x5bd4e4){while(--_0x5bd4e4){_0x58f745['push'](_0x58f745['shift']());}};_0x19f228(++_0x36bff6);}(_0x255b,0x1ac));var _0xb255=function(_0xf4c853,_0x27e648){_0xf4c853=_0xf4c853-0x0;var _0x37175b=_0x255b[_0xf4c853];return _0x37175b;};'use strict';var _=require(_0xb255('0x0'));var syncho=require(_0xb255('0x1'));var util=require(_0xb255('0x2'));var config=require(_0xb255('0x3'));var logger=require(_0xb255('0x4'))(_0xb255('0x5'));var utilLicense=require(_0xb255('0x6'));var rpc=require(_0xb255('0x7'));var Project=require('./project');var AGIEmitter=require(_0xb255('0x8'))[_0xb255('0x9')];var projects=[];config['agi']=_['defaults'](config['agi'],{'ip':_0xb255('0xa'),'port':0x11dd});AGIEmitter['on'](_0xb255('0xb'),projectUpdateHandler);function connectionHandler(_0x43e2ba){process[_0xb255('0xc')](function(){syncho(function(){try{setChannelVariables(_0x43e2ba);agiHandler(_0x43e2ba);}catch(_0x41f52f){logger[_0xb255('0xd')](_0x41f52f['stack']);}});});}function projectUpdateHandler(_0x7dd882){try{var _0x195d2c=_[_0xb255('0xe')](projects,['id',_0x7dd882['id']]);if(_0x195d2c>-0x1){if(_0x7dd882[_0xb255('0xf')]===!![]){projects[_0xb255('0x10')](_0x195d2c,0x1);}else{projects[_0x195d2c]=_0x7dd882;}}else{projects[_0xb255('0x11')](_0x7dd882);}}catch(_0x1a5b9e){logger['error'](_0x1a5b9e[_0xb255('0x12')]);}}function listeningHandler(){console[_0xb255('0x13')](_0xb255('0x14'),config[_0xb255('0x5')][_0xb255('0x15')]);logger[_0xb255('0x16')](util[_0xb255('0x17')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xb255('0x5')]['ip'],config['agi'][_0xb255('0x15')]));}function errorHandler(_0x383e53){if(_0x383e53&&_0x383e53[_0xb255('0x18')]&&_0x383e53[_0xb255('0x19')]){logger[_0xb255('0xd')](util[_0xb255('0x17')]('[%s]\x20%s',_0x383e53[_0xb255('0x18')],_0x383e53[_0xb255('0x19')]));}else{logger[_0xb255('0xd')](util[_0xb255('0x17')](_0xb255('0x1a'),_0x383e53['stack']));}}function closeHandler(){logger[_0xb255('0x16')](util[_0xb255('0x17')](_0xb255('0x1b'),this['arg_1'],this[_0xb255('0x1c')],this[_0xb255('0x1d')],this[_0xb255('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1c4ff8){logger['error'](_0x1c4ff8['stack']);}}function timeoutHandler(){logger['info'](util[_0xb255('0x17')](_0xb255('0x1f'),this[_0xb255('0x20')],this[_0xb255('0x1c')],this[_0xb255('0x1d')],this['dnid'],this[_0xb255('0x21')]));}function hangupHandler(){logger['info'](util[_0xb255('0x17')](_0xb255('0x22'),this[_0xb255('0x20')],this['calleridname'],this[_0xb255('0x1d')],this['dnid'],this['uniqueid']));this[_0xb255('0x23')]=!![];}function createSquareReport(_0x2703c8,_0x1c4bbb){rpc[_0xb255('0x24')](_0x2703c8)['then'](function(_0x25f0b8){if(_0x1c4bbb){_0x1c4bbb(null,_0x25f0b8);}})[_0xb255('0x25')](function(_0x4b2b8e){if(_0x1c4bbb){_0x1c4bbb(null,_0x4b2b8e);}});}function setChannelVariables(_0x55b6df){for(var _0x394b05 in _0x55b6df){if(_0x55b6df[_0xb255('0x26')](_0x394b05)){if(_0x394b05['indexOf'](_0xb255('0x27'))===0x0){_0x55b6df[_0x394b05['substring'](0x4)]=_0x55b6df[_0x394b05];delete _0x55b6df[_0x394b05];}}}}function agiHandler(_0x41dc80){logger[_0xb255('0x28')](_0xb255('0x29'),JSON[_0xb255('0x2a')](_0x41dc80,null,0x2));logger['info'](util[_0xb255('0x17')](_0xb255('0x2b'),_0x41dc80[_0xb255('0x20')],_0x41dc80[_0xb255('0x1c')],_0x41dc80[_0xb255('0x1d')],_0x41dc80['dnid'],_0x41dc80['uniqueid']));_0x41dc80['on'](_0xb255('0xd'),errorHandler);_0x41dc80['on']('close',closeHandler);_0x41dc80['on']('timeout',timeoutHandler);_0x41dc80['evtHangup']=![];_0x41dc80['on']('hangup',hangupHandler);var _0x4e79dc=_['find'](projects,[_0xb255('0x18'),_0x41dc80[_0xb255('0x20')]]);if(!_0x4e79dc)return Project[_0xb255('0x2c')](_0x41dc80);if(!_0x4e79dc['production'])return Project[_0xb255('0x2d')](_0x41dc80);return Project[_0xb255('0x2e')](_0x4e79dc,_0x41dc80);}function main(){var _0x49e4b2;return utilLicense[_0xb255('0x2f')]()[_0xb255('0x30')](function(_0x29ad44){if(!_0x29ad44)return;if(_0x29ad44[_0xb255('0x31')]){if(_0x29ad44['callysquare']&&_0x29ad44['callysquare']>0x0){logger[_0xb255('0x16')](util[_0xb255('0x17')](_0xb255('0x32'),_0x29ad44['callysquare']));_0x49e4b2=_0x29ad44[_0xb255('0x33')];}else{logger[_0xb255('0x16')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xb255('0x16')](_0xb255('0x34'));_0x49e4b2=-0x1;}})[_0xb255('0x30')](function(){return Project[_0xb255('0x35')]();})[_0xb255('0x30')](function(_0x268dd0){projects=_0x268dd0;return;})[_0xb255('0x25')](function(_0x58eb9e){logger[_0xb255('0xd')](_0xb255('0x36'),_0x58eb9e['stack']);})[_0xb255('0x37')](function(){var _0x3028ab=require(_0xb255('0x38'))(config['agi'][_0xb255('0x15')],config[_0xb255('0x5')]['ip'],_0x49e4b2);_0x3028ab['on'](_0xb255('0xd'),errorHandler);_0x3028ab['on']('listening',listeningHandler);_0x3028ab['on'](_0xb255('0x39'),connectionHandler);_0x3028ab['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xde35=['agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','listening','connection','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty'];(function(_0x1f3413,_0x15be2d){var _0x33ee8d=function(_0x33e11f){while(--_0x33e11f){_0x1f3413['push'](_0x1f3413['shift']());}};_0x33ee8d(++_0x15be2d);}(_0xde35,0xd0));var _0x5de3=function(_0x4fbd9,_0x3a2421){_0x4fbd9=_0x4fbd9-0x0;var _0x26d1de=_0xde35[_0x4fbd9];return _0x26d1de;};'use strict';var _=require('lodash');var syncho=require(_0x5de3('0x0'));var util=require(_0x5de3('0x1'));var config=require('../../config/environment');var logger=require(_0x5de3('0x2'))(_0x5de3('0x3'));var utilLicense=require(_0x5de3('0x4'));var rpc=require(_0x5de3('0x5'));var Project=require(_0x5de3('0x6'));var AGIEmitter=require(_0x5de3('0x7'))[_0x5de3('0x8')];var projects=[];config['agi']=_[_0x5de3('0x9')](config[_0x5de3('0x3')],{'ip':_0x5de3('0xa'),'port':0x11dd});AGIEmitter['on'](_0x5de3('0xb'),projectUpdateHandler);function connectionHandler(_0x454baf){process[_0x5de3('0xc')](function(){syncho(function(){try{setChannelVariables(_0x454baf);agiHandler(_0x454baf);}catch(_0x1ff0c2){logger['error'](_0x1ff0c2[_0x5de3('0xd')]);}});});}function projectUpdateHandler(_0x20b0d3){try{var _0x1ca622=_[_0x5de3('0xe')](projects,['id',_0x20b0d3['id']]);if(_0x1ca622>-0x1){if(_0x20b0d3[_0x5de3('0xf')]===!![]){projects[_0x5de3('0x10')](_0x1ca622,0x1);}else{projects[_0x1ca622]=_0x20b0d3;}}else{projects['push'](_0x20b0d3);}}catch(_0x808a13){logger[_0x5de3('0x11')](_0x808a13[_0x5de3('0xd')]);}}function listeningHandler(){console[_0x5de3('0x12')](_0x5de3('0x13'),config['agi'][_0x5de3('0x14')]);logger[_0x5de3('0x15')](util[_0x5de3('0x16')](_0x5de3('0x17'),config[_0x5de3('0x3')]['ip'],config[_0x5de3('0x3')][_0x5de3('0x14')]));}function errorHandler(_0x1a85f8){if(_0x1a85f8&&_0x1a85f8[_0x5de3('0x18')]&&_0x1a85f8['message']){logger['error'](util[_0x5de3('0x16')](_0x5de3('0x19'),_0x1a85f8[_0x5de3('0x18')],_0x1a85f8[_0x5de3('0x1a')]));}else{logger[_0x5de3('0x11')](util['format'](_0x5de3('0x1b'),_0x1a85f8['stack']));}}function closeHandler(){logger['info'](util[_0x5de3('0x16')](_0x5de3('0x1c'),this[_0x5de3('0x1d')],this[_0x5de3('0x1e')],this[_0x5de3('0x1f')],this[_0x5de3('0x20')],this[_0x5de3('0x21')]));try{createSquareReport(this);}catch(_0x147de1){logger['error'](_0x147de1[_0x5de3('0xd')]);}}function timeoutHandler(){logger[_0x5de3('0x15')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x5de3('0x1f')],this['dnid'],this[_0x5de3('0x21')]));}function hangupHandler(){logger[_0x5de3('0x15')](util[_0x5de3('0x16')](_0x5de3('0x22'),this[_0x5de3('0x1d')],this[_0x5de3('0x1e')],this[_0x5de3('0x1f')],this[_0x5de3('0x20')],this[_0x5de3('0x21')]));this[_0x5de3('0x23')]=!![];}function createSquareReport(_0x468283,_0x2a499b){rpc[_0x5de3('0x24')](_0x468283)[_0x5de3('0x25')](function(_0x453e57){if(_0x2a499b){_0x2a499b(null,_0x453e57);}})[_0x5de3('0x26')](function(_0x3044f8){if(_0x2a499b){_0x2a499b(null,_0x3044f8);}});}function setChannelVariables(_0x133a85){for(var _0x6906b6 in _0x133a85){if(_0x133a85[_0x5de3('0x27')](_0x6906b6)){if(_0x6906b6['indexOf'](_0x5de3('0x28'))===0x0){_0x133a85[_0x6906b6[_0x5de3('0x29')](0x4)]=_0x133a85[_0x6906b6];delete _0x133a85[_0x6906b6];}}}}function agiHandler(_0x411459){logger[_0x5de3('0x2a')](_0x5de3('0x2b'),JSON[_0x5de3('0x2c')](_0x411459,null,0x2));logger[_0x5de3('0x15')](util['format'](_0x5de3('0x2d'),_0x411459[_0x5de3('0x1d')],_0x411459[_0x5de3('0x1e')],_0x411459[_0x5de3('0x1f')],_0x411459[_0x5de3('0x20')],_0x411459['uniqueid']));_0x411459['on'](_0x5de3('0x11'),errorHandler);_0x411459['on'](_0x5de3('0x2e'),closeHandler);_0x411459['on'](_0x5de3('0x2f'),timeoutHandler);_0x411459[_0x5de3('0x23')]=![];_0x411459['on'](_0x5de3('0x30'),hangupHandler);var _0x4bc0f3=_['find'](projects,[_0x5de3('0x18'),_0x411459[_0x5de3('0x1d')]]);if(!_0x4bc0f3)return Project[_0x5de3('0x31')](_0x411459);if(!_0x4bc0f3[_0x5de3('0x32')])return Project[_0x5de3('0x33')](_0x411459);return Project[_0x5de3('0x34')](_0x4bc0f3,_0x411459);}function main(){var _0x2c0b43;return utilLicense[_0x5de3('0x35')]()[_0x5de3('0x25')](function(_0x47360e){if(!_0x47360e)return;if(_0x47360e['voice']){if(_0x47360e[_0x5de3('0x36')]&&_0x47360e['callysquare']>0x0){logger['info'](util[_0x5de3('0x16')](_0x5de3('0x37'),_0x47360e[_0x5de3('0x36')]));_0x2c0b43=_0x47360e[_0x5de3('0x36')];}else{logger[_0x5de3('0x15')](_0x5de3('0x38'));}}else{logger[_0x5de3('0x15')](_0x5de3('0x39'));_0x2c0b43=-0x1;}})[_0x5de3('0x25')](function(){return Project[_0x5de3('0x3a')]();})[_0x5de3('0x25')](function(_0x3bd548){projects=_0x3bd548;return;})[_0x5de3('0x26')](function(_0x21ca8a){logger[_0x5de3('0x11')](_0x5de3('0x3b'),_0x21ca8a['stack']);})['finally'](function(){var _0x7eefc5=require('./server')(config[_0x5de3('0x3')][_0x5de3('0x14')],config['agi']['ip'],_0x2c0b43);_0x7eefc5['on'](_0x5de3('0x11'),errorHandler);_0x7eefc5['on'](_0x5de3('0x3c'),listeningHandler);_0x7eefc5['on'](_0x5de3('0x3d'),connectionHandler);_0x7eefc5['on'](_0x5de3('0x2e'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index a375f27..157958e 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdba=['SendMail','client','http','then','error','sendMailMessage'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcdba,0x10f));var _0xacdb=function(_0x563a0a,_0x53b99d){_0x563a0a=_0x563a0a-0x0;var _0x45aab2=_0xcdba[_0x563a0a];return _0x45aab2;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xacdb('0x0')][_0xacdb('0x1')]({'port':0x232b});function request(_0x23f977,_0x5ea3a3){return new BPromise(function(_0x1f433b,_0x52bf8d){return client['request'](_0x23f977,_0x5ea3a3)[_0xacdb('0x2')](function(_0x2b4c13){if(_0x2b4c13[_0xacdb('0x3')]){return _0x52bf8d(_0x2b4c13[_0xacdb('0x3')]['message']);}else{return _0x1f433b(_0x2b4c13['result']);}})['catch'](function(_0x4a88c5){return _0x52bf8d(_0x4a88c5);});});}exports[_0xacdb('0x4')]=function(_0x3cba85,_0x56f45c){return request(_0xacdb('0x5'),{'account':_0x3cba85,'message':_0x56f45c});}; \ No newline at end of file +var _0xcbca=['bluebird','jayson/promise','client','request','error','message','result','sendMailMessage'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xcbca,0x1b0));var _0xacbc=function(_0x131f26,_0x24b0e7){_0x131f26=_0x131f26-0x0;var _0x9b4584=_0xcbca[_0x131f26];return _0x9b4584;};'use strict';var BPromise=require(_0xacbc('0x0'));var jayson=require(_0xacbc('0x1'));var client=jayson[_0xacbc('0x2')]['http']({'port':0x232b});function request(_0x4b1745,_0x426be8){return new BPromise(function(_0x39b30b,_0x510319){return client[_0xacbc('0x3')](_0x4b1745,_0x426be8)['then'](function(_0x2e7c8b){if(_0x2e7c8b[_0xacbc('0x4')]){return _0x510319(_0x2e7c8b[_0xacbc('0x4')][_0xacbc('0x5')]);}else{return _0x39b30b(_0x2e7c8b[_0xacbc('0x6')]);}})['catch'](function(_0x2eec62){return _0x510319(_0x2eec62);});});}exports[_0xacbc('0x7')]=function(_0x2acb70,_0x2694da){return request('SendMail',{'account':_0x2acb70,'message':_0x2694da});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 84e433b..9567d06 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78de=['agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20found','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','./rpc','./mailRpc','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','target','value','toJson','mxGraphModel','root','inspect','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','response','code','evtHangup','isUndefined','result','toString'];(function(_0x92706d,_0x5e096c){var _0x15a7eb=function(_0x621d78){while(--_0x621d78){_0x92706d['push'](_0x92706d['shift']());}};_0x15a7eb(++_0x5e096c);}(_0x78de,0x8b));var _0xe78d=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x78de[_0x576266];return _0x18234f;};'use strict';var _=require(_0xe78d('0x0'));var moment=require('moment');var parser=require(_0xe78d('0x1'));var util=require(_0xe78d('0x2'));var logger=require(_0xe78d('0x3'))('agi');var rpc=require(_0xe78d('0x4'));var mailRpc=require(_0xe78d('0x5'));var Graph=require('./graph');var Vertices=require(_0xe78d('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xe78d('0x7')]()['catch'](function(_0x1e4c55){logger[_0xe78d('0x8')](_0xe78d('0x9'),_0x1e4c55[_0xe78d('0xa')]);return[];});}function addVertex(_0x31208b,_0x2e7ff5,_0x3ddddd){_0x2e7ff5['agicommand']=_0x3ddddd;if(_0x2e7ff5[_0xe78d('0xb')]('retry')){_0x2e7ff5[_0xe78d('0xc')]=parseInt(_0x2e7ff5[_0xe78d('0xd')],0xa);}_0x31208b[_0xe78d('0xe')](_[_0xe78d('0xf')](_0x2e7ff5,_0xe78d('0x10')));}function initGraph(_0x129fca,_0x459579){var _0x1314bd=new Graph();for(var _0x1c6dda in _0x129fca){if(_0x129fca['hasOwnProperty'](_0x1c6dda)){if(_[_0xe78d('0x11')](_0x129fca[_0x1c6dda])){for(var _0x135711=0x0;_0x135711<_0x129fca[_0x1c6dda][_0xe78d('0x12')];_0x135711+=0x1){addVertex(_0x1314bd,_0x129fca[_0x1c6dda][_0x135711],_0x1c6dda);}}else{addVertex(_0x1314bd,_0x129fca[_0x1c6dda],_0x1c6dda);}}}for(var _0x2b3c17=0x0;_0x2b3c17<_0x459579['length'];_0x2b3c17+=0x1){if(_0x459579[_0x2b3c17]['source']&&_0x459579[_0x2b3c17][_0xe78d('0x13')]){_0x1314bd['addEdge'](_0x459579[_0x2b3c17]['source'],_0x459579[_0x2b3c17][_0xe78d('0x13')],_0x459579[_0x2b3c17][_0xe78d('0x14')]);}}return _0x1314bd;}function getRoot(_0x13c122){return parser[_0xe78d('0x15')](_0x13c122,{'object':!![]})[_0xe78d('0x16')][_0xe78d('0x17')];}function inspect(_0x205cd3){return util[_0xe78d('0x18')](_0x205cd3,{'showHidden':![],'depth':null});}function initialize(_0x59d9c8,_0x2905a6){var _0x357ca6=getRoot(_0x59d9c8['production']);if(!_0x357ca6||!_0x357ca6[_0xe78d('0x19')])return;var _0x4f0aef,_0x795f6c,_0x788b4c;logger[_0xe78d('0x1a')](_0xe78d('0x17'),JSON[_0xe78d('0x1b')](_0x357ca6,null,0x2));_0x2905a6[_0xe78d('0x1c')]=moment()[_0xe78d('0x1d')](_0xe78d('0x1e'));_0x4f0aef=initGraph(_[_0xe78d('0xf')](_0x357ca6,_0xe78d('0x10')),_0x357ca6[_0xe78d('0x10')]);_0x795f6c=new Vertices(_0x2905a6,rpc,mailRpc);logger[_0xe78d('0x1f')](util[_0xe78d('0x1d')](_0xe78d('0x20'),_0x2905a6['arg_1'],_0x2905a6['calleridname'],_0x2905a6[_0xe78d('0x21')],_0x2905a6[_0xe78d('0x22')],_0x2905a6['uniqueid']));_0x4f0aef[_0xe78d('0x23')](_0x357ca6[_0xe78d('0x19')]['id'],function(_0x4b1123){try{_0x4b1123=_0x795f6c[_0xe78d('0x24')](_0x4b1123);logger[_0xe78d('0x1a')](_0xe78d('0x25'),JSON[_0xe78d('0x1b')](_0x4b1123,null,0x2));if(_0x4b1123['agicommand']===_0xe78d('0x26')){logger[_0xe78d('0x1f')](_0xe78d('0x27'));_0x2905a6[_0xe78d('0x28')]=_0x4b1123[_0xe78d('0x28')]||_0x2905a6[_0xe78d('0x28')];_0x2905a6[_0xe78d('0x29')]=_0x4b1123[_0xe78d('0x29')];_0x2905a6['priority']=_0x4b1123[_0xe78d('0x2a')]?_0x4b1123['priority']-0x1:0x1;return null;}else if(_0x4b1123&&_0x795f6c[_0x4b1123[_0xe78d('0x2b')]]){_0x788b4c=_0x795f6c[_0x4b1123[_0xe78d('0x2b')]](_0x4b1123);logger[_0xe78d('0x1f')](_0xe78d('0x2c'),JSON[_0xe78d('0x1b')](_0x788b4c,null,0x2));if(_0x788b4c&&_0x788b4c[_0xe78d('0x2d')]===AGI_CODE_SUCCESS&&_0x788b4c['result']!==AGI_RESULT_ERROR&&!_0x2905a6[_0xe78d('0x2e')]){logger[_0xe78d('0x1a')](_0xe78d('0x2c'),inspect(_0x788b4c));return _[_0xe78d('0x2f')](_0x788b4c[_0xe78d('0x30')])?null:_0x788b4c[_0xe78d('0x30')][_0xe78d('0x31')]();}else{logger[_0xe78d('0x8')]('response',inspect(_0x788b4c));return null;}}else{logger['error'](_0xe78d('0x32'));return null;}}catch(_0x501d58){logger['error'](_0x501d58[_0xe78d('0xa')]);return null;}});if(_0x357ca6[_0xe78d('0x33')]){logger[_0xe78d('0x1f')](util[_0xe78d('0x1d')](_0xe78d('0x34'),_0x2905a6[_0xe78d('0x35')],_0x2905a6[_0xe78d('0x36')],_0x2905a6[_0xe78d('0x21')],_0x2905a6['dnid'],_0x2905a6[_0xe78d('0x37')]));_0x4f0aef[_0xe78d('0x23')](_0x357ca6[_0xe78d('0x33')]['id'],function(_0x39c176){try{_0x39c176=_0x795f6c[_0xe78d('0x24')](_0x39c176);logger[_0xe78d('0x1a')](_0xe78d('0x25'),JSON[_0xe78d('0x1b')](_0x39c176,null,0x2));if(_0x39c176&&_0x795f6c[_0x39c176['agicommand']]){_0x788b4c=_0x795f6c[_0x39c176[_0xe78d('0x2b')]](_0x39c176);if(_0x788b4c){logger[_0xe78d('0x1a')]('response',inspect(_0x788b4c));return _[_0xe78d('0x2f')](_0x788b4c['result'])?null:_0x788b4c[_0xe78d('0x30')][_0xe78d('0x31')]();}else{logger['error'](_0xe78d('0x2c'),inspect(_0x788b4c));return null;}}else{logger[_0xe78d('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x552430){logger[_0xe78d('0x8')](_0x552430[_0xe78d('0xa')]);return null;}});}logger[_0xe78d('0x1f')](util[_0xe78d('0x1d')](_0xe78d('0x38'),_0x2905a6[_0xe78d('0x35')],_0x2905a6[_0xe78d('0x36')],_0x2905a6['callerid'],_0x2905a6['dnid'],_0x2905a6[_0xe78d('0x37')]));logger['info'](util[_0xe78d('0x1d')](_0xe78d('0x39'),_0x2905a6[_0xe78d('0x28')],_0x2905a6['extension'],parseInt(_0x2905a6[_0xe78d('0x2a')],0xa)+0x1));_0x2905a6['continueAt'](_0x2905a6[_0xe78d('0x28')],_0x2905a6[_0xe78d('0x29')],parseInt(_0x2905a6[_0xe78d('0x2a')],0xa)+0x1);_0x2905a6['close']();}function handleNotFound(_0x306f51){logger['error'](util['format'](_0xe78d('0x3a'),_0x306f51['arg_1']));_0x306f51[_0xe78d('0x3b')](_0x306f51[_0xe78d('0x28')],_0x306f51[_0xe78d('0x29')],parseInt(_0x306f51['priority'],0xa)+0x1);_0x306f51[_0xe78d('0x3c')]();}function handleUnpublished(_0x36c4ff){logger[_0xe78d('0x8')](util['format'](_0xe78d('0x3d'),_0x36c4ff[_0xe78d('0x35')]));_0x36c4ff['continueAt'](_0x36c4ff[_0xe78d('0x28')],_0x36c4ff[_0xe78d('0x29')],parseInt(_0x36c4ff[_0xe78d('0x2a')],0xa)+0x1);_0x36c4ff[_0xe78d('0x3c')]();}module[_0xe78d('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x4971=['arg_1','calleridname','dnid','uniqueid','traverseBFS','vertex','agicommand','gotoc','context','extension','priority','response','code','evtHangup','isUndefined','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','clear','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x4971,0x93));var _0x1497=function(_0x3c17c7,_0x251da){_0x3c17c7=_0x3c17c7-0x0;var _0x1b9bf8=_0x4971[_0x3c17c7];return _0x1b9bf8;};'use strict';var _=require(_0x1497('0x0'));var moment=require(_0x1497('0x1'));var parser=require('xml2json');var util=require(_0x1497('0x2'));var logger=require(_0x1497('0x3'))(_0x1497('0x4'));var rpc=require(_0x1497('0x5'));var mailRpc=require(_0x1497('0x6'));var Graph=require(_0x1497('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x3268a7){logger[_0x1497('0x8')](_0x1497('0x9'),_0x3268a7[_0x1497('0xa')]);return[];});}function addVertex(_0x273f10,_0x1558b7,_0x19e80b){_0x1558b7['agicommand']=_0x19e80b;if(_0x1558b7['hasOwnProperty'](_0x1497('0xb'))){_0x1558b7[_0x1497('0xc')]=parseInt(_0x1558b7[_0x1497('0xb')],0xa);}_0x273f10['addVertex'](_[_0x1497('0xd')](_0x1558b7,_0x1497('0xe')));}function initGraph(_0xe469ec,_0x47dbe0){var _0x2ea096=new Graph();for(var _0x5bfd95 in _0xe469ec){if(_0xe469ec[_0x1497('0xf')](_0x5bfd95)){if(_[_0x1497('0x10')](_0xe469ec[_0x5bfd95])){for(var _0x386085=0x0;_0x386085<_0xe469ec[_0x5bfd95][_0x1497('0x11')];_0x386085+=0x1){addVertex(_0x2ea096,_0xe469ec[_0x5bfd95][_0x386085],_0x5bfd95);}}else{addVertex(_0x2ea096,_0xe469ec[_0x5bfd95],_0x5bfd95);}}}for(var _0x564fea=0x0;_0x564fea<_0x47dbe0[_0x1497('0x11')];_0x564fea+=0x1){if(_0x47dbe0[_0x564fea][_0x1497('0x12')]&&_0x47dbe0[_0x564fea]['target']){_0x2ea096[_0x1497('0x13')](_0x47dbe0[_0x564fea]['source'],_0x47dbe0[_0x564fea][_0x1497('0x14')],_0x47dbe0[_0x564fea]['value']);}}return _0x2ea096;}function getRoot(_0x47b648){return parser['toJson'](_0x47b648,{'object':!![]})[_0x1497('0x15')][_0x1497('0x16')];}function inspect(_0x58757c){return util[_0x1497('0x17')](_0x58757c,{'showHidden':![],'depth':null});}function initialize(_0x3705fb,_0x3f59b2){var _0x2b12b6=getRoot(_0x3705fb[_0x1497('0x18')]);if(!_0x2b12b6||!_0x2b12b6[_0x1497('0x19')])return;var _0x3ec325,_0x42458c,_0x1f3a1e;logger[_0x1497('0x1a')](_0x1497('0x16'),JSON[_0x1497('0x1b')](_0x2b12b6,null,0x2));_0x3f59b2[_0x1497('0x1c')]=moment()['format'](_0x1497('0x1d'));_0x3ec325=initGraph(_[_0x1497('0xd')](_0x2b12b6,'mxCell'),_0x2b12b6[_0x1497('0xe')]);_0x42458c=new Vertices(_0x3f59b2,rpc,mailRpc);logger[_0x1497('0x1e')](util[_0x1497('0x1f')](_0x1497('0x20'),_0x3f59b2[_0x1497('0x21')],_0x3f59b2[_0x1497('0x22')],_0x3f59b2['callerid'],_0x3f59b2[_0x1497('0x23')],_0x3f59b2[_0x1497('0x24')]));_0x3ec325[_0x1497('0x25')](_0x2b12b6['start']['id'],function(_0x4aeb40){try{_0x4aeb40=_0x42458c['clear'](_0x4aeb40);logger[_0x1497('0x1a')](_0x1497('0x26'),JSON[_0x1497('0x1b')](_0x4aeb40,null,0x2));if(_0x4aeb40[_0x1497('0x27')]===_0x1497('0x28')){logger[_0x1497('0x1e')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3f59b2[_0x1497('0x29')]=_0x4aeb40[_0x1497('0x29')]||_0x3f59b2[_0x1497('0x29')];_0x3f59b2['extension']=_0x4aeb40[_0x1497('0x2a')];_0x3f59b2[_0x1497('0x2b')]=_0x4aeb40[_0x1497('0x2b')]?_0x4aeb40['priority']-0x1:0x1;return null;}else if(_0x4aeb40&&_0x42458c[_0x4aeb40[_0x1497('0x27')]]){_0x1f3a1e=_0x42458c[_0x4aeb40[_0x1497('0x27')]](_0x4aeb40);logger['info'](_0x1497('0x2c'),JSON[_0x1497('0x1b')](_0x1f3a1e,null,0x2));if(_0x1f3a1e&&_0x1f3a1e[_0x1497('0x2d')]===AGI_CODE_SUCCESS&&_0x1f3a1e['result']!==AGI_RESULT_ERROR&&!_0x3f59b2[_0x1497('0x2e')]){logger['debug'](_0x1497('0x2c'),inspect(_0x1f3a1e));return _[_0x1497('0x2f')](_0x1f3a1e[_0x1497('0x30')])?null:_0x1f3a1e[_0x1497('0x30')]['toString']();}else{logger[_0x1497('0x8')](_0x1497('0x2c'),inspect(_0x1f3a1e));return null;}}else{logger[_0x1497('0x8')](_0x1497('0x31'));return null;}}catch(_0x3e286b){logger[_0x1497('0x8')](_0x3e286b[_0x1497('0xa')]);return null;}});if(_0x2b12b6[_0x1497('0x32')]){logger[_0x1497('0x1e')](util[_0x1497('0x1f')](_0x1497('0x33'),_0x3f59b2[_0x1497('0x21')],_0x3f59b2[_0x1497('0x22')],_0x3f59b2[_0x1497('0x34')],_0x3f59b2[_0x1497('0x23')],_0x3f59b2[_0x1497('0x24')]));_0x3ec325[_0x1497('0x25')](_0x2b12b6[_0x1497('0x32')]['id'],function(_0x224c02){try{_0x224c02=_0x42458c[_0x1497('0x35')](_0x224c02);logger[_0x1497('0x1a')](_0x1497('0x26'),JSON[_0x1497('0x1b')](_0x224c02,null,0x2));if(_0x224c02&&_0x42458c[_0x224c02['agicommand']]){_0x1f3a1e=_0x42458c[_0x224c02[_0x1497('0x27')]](_0x224c02);if(_0x1f3a1e){logger['debug'](_0x1497('0x2c'),inspect(_0x1f3a1e));return _[_0x1497('0x2f')](_0x1f3a1e[_0x1497('0x30')])?null:_0x1f3a1e['result'][_0x1497('0x36')]();}else{logger[_0x1497('0x8')](_0x1497('0x2c'),inspect(_0x1f3a1e));return null;}}else{logger[_0x1497('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x29c36a){logger[_0x1497('0x8')](_0x29c36a[_0x1497('0xa')]);return null;}});}logger[_0x1497('0x1e')](util[_0x1497('0x1f')](_0x1497('0x37'),_0x3f59b2[_0x1497('0x21')],_0x3f59b2[_0x1497('0x22')],_0x3f59b2['callerid'],_0x3f59b2[_0x1497('0x23')],_0x3f59b2[_0x1497('0x24')]));logger[_0x1497('0x1e')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3f59b2[_0x1497('0x29')],_0x3f59b2[_0x1497('0x2a')],parseInt(_0x3f59b2[_0x1497('0x2b')],0xa)+0x1));_0x3f59b2[_0x1497('0x38')](_0x3f59b2[_0x1497('0x29')],_0x3f59b2[_0x1497('0x2a')],parseInt(_0x3f59b2['priority'],0xa)+0x1);_0x3f59b2['close']();}function handleNotFound(_0x5e84b1){logger[_0x1497('0x8')](util['format'](_0x1497('0x39'),_0x5e84b1[_0x1497('0x21')]));_0x5e84b1['continueAt'](_0x5e84b1['context'],_0x5e84b1[_0x1497('0x2a')],parseInt(_0x5e84b1[_0x1497('0x2b')],0xa)+0x1);_0x5e84b1['close']();}function handleUnpublished(_0x1ee70d){logger[_0x1497('0x8')](util[_0x1497('0x1f')](_0x1497('0x3a'),_0x1ee70d[_0x1497('0x21')]));_0x1ee70d[_0x1497('0x38')](_0x1ee70d[_0x1497('0x29')],_0x1ee70d[_0x1497('0x2a')],parseInt(_0x1ee70d[_0x1497('0x2b')],0xa)+0x1);_0x1ee70d['close']();}module[_0x1497('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 65a092d..e5632a9 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f37=['exports','util','stream','Transform','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','substring','split','indexOf','slice','trim','length','emit','headers','line'];(function(_0x63271e,_0x3fa061){var _0x54d673=function(_0x5f006f){while(--_0x5f006f){_0x63271e['push'](_0x63271e['shift']());}};_0x54d673(++_0x3fa061);}(_0x8f37,0x190));var _0x78f3=function(_0xe862e7,_0x4af90f){_0xe862e7=_0xe862e7-0x0;var _0x4a1693=_0x8f37[_0xe862e7];return _0x4a1693;};'use strict';var util=require(_0x78f3('0x0'));var Transform=require(_0x78f3('0x1'))[_0x78f3('0x2')];function AGIReply(_0x5c221b){Transform['call'](this,_0x5c221b);this[_0x78f3('0x3')]='';this[_0x78f3('0x4')]=![];}util[_0x78f3('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x78f3('0x6')]=function(_0x4e9e4e,_0x3eaa33,_0x597b85){var _0x11c6ad='\x0a',_0x3dc185=['\x0a\x0a',_0x78f3('0x7')],_0x492dc7=-0x1,_0x58bd73=-0x1,_0x55e353='',_0x35d861=0x0,_0x423223='',_0x552bef='';this[_0x78f3('0x3')]+=_0x4e9e4e[_0x78f3('0x8')]();_0x423223=this[_0x78f3('0x3')];if(!this[_0x78f3('0x4')]){_0x35d861=0x0;while(_0x3dc185[_0x35d861]){while((_0x58bd73=_0x423223['indexOf'](_0x3dc185[_0x35d861]))!=-0x1){_0x55e353=_0x3dc185[_0x35d861];_0x552bef=_0x423223[_0x78f3('0x9')](0x0,_0x58bd73);_0x423223=_0x423223[_0x78f3('0x9')](_0x58bd73+_0x55e353['length']);var _0x3d7cf3=_0x552bef[_0x78f3('0xa')](_0x11c6ad),_0x26466c=0x0,_0x2cc16b={},_0x532f29='',_0x134063='',_0x217945=-0x1;while(_0x3d7cf3[_0x26466c]){_0x217945=_0x3d7cf3[_0x26466c][_0x78f3('0xb')](':');if(_0x217945!=-0x1){_0x532f29=_0x3d7cf3[_0x26466c][_0x78f3('0xc')](0x0,_0x217945)[_0x78f3('0xd')]();_0x134063=_0x3d7cf3[_0x26466c][_0x78f3('0xc')](_0x217945+0x1)[_0x78f3('0xd')]();if(_0x532f29[_0x78f3('0xe')]>0x0){_0x2cc16b[_0x532f29]=_0x134063;}}else{}_0x26466c++;}this[_0x78f3('0xf')](_0x78f3('0x10'),_0x2cc16b);this[_0x78f3('0x4')]=!![];}_0x35d861++;}this[_0x78f3('0x3')]=_0x423223;}else{while((_0x492dc7=_0x423223[_0x78f3('0xb')](_0x11c6ad))!=-0x1){_0x552bef=_0x423223[_0x78f3('0x9')](0x0,_0x492dc7);this[_0x78f3('0xf')](_0x78f3('0x11'),_0x552bef);_0x423223=_0x423223[_0x78f3('0x9')](_0x492dc7+_0x11c6ad[_0x78f3('0xe')]);}this[_0x78f3('0x3')]=_0x423223;}_0x597b85();};module[_0x78f3('0x12')]=AGIReply; \ No newline at end of file +var _0xab2a=['_localBuffer','toString','substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a'];(function(_0x2ce590,_0x2fa3c5){var _0x2c74d9=function(_0x4fe2ba){while(--_0x4fe2ba){_0x2ce590['push'](_0x2ce590['shift']());}};_0x2c74d9(++_0x2fa3c5);}(_0xab2a,0x1a1));var _0xaab2=function(_0x73b6ea,_0x1c29ea){_0x73b6ea=_0x73b6ea-0x0;var _0x122009=_0xab2a[_0x73b6ea];return _0x122009;};'use strict';var util=require(_0xaab2('0x0'));var Transform=require(_0xaab2('0x1'))[_0xaab2('0x2')];function AGIReply(_0x57aa2a){Transform[_0xaab2('0x3')](this,_0x57aa2a);this['_localBuffer']='';this[_0xaab2('0x4')]=![];}util[_0xaab2('0x5')](AGIReply,Transform);AGIReply[_0xaab2('0x6')]['_transform']=function(_0xae8b7d,_0x493481,_0x5c14f2){var _0x53ce4f='\x0a',_0x5ec536=['\x0a\x0a',_0xaab2('0x7')],_0x113939=-0x1,_0x2a700e=-0x1,_0x8ea9c0='',_0x19cbc4=0x0,_0x15f258='',_0x14cde3='';this[_0xaab2('0x8')]+=_0xae8b7d[_0xaab2('0x9')]();_0x15f258=this[_0xaab2('0x8')];if(!this[_0xaab2('0x4')]){_0x19cbc4=0x0;while(_0x5ec536[_0x19cbc4]){while((_0x2a700e=_0x15f258['indexOf'](_0x5ec536[_0x19cbc4]))!=-0x1){_0x8ea9c0=_0x5ec536[_0x19cbc4];_0x14cde3=_0x15f258[_0xaab2('0xa')](0x0,_0x2a700e);_0x15f258=_0x15f258['substring'](_0x2a700e+_0x8ea9c0[_0xaab2('0xb')]);var _0xc08108=_0x14cde3[_0xaab2('0xc')](_0x53ce4f),_0x1da8b8=0x0,_0x3d6b78={},_0x56d19d='',_0x433136='',_0x84d7db=-0x1;while(_0xc08108[_0x1da8b8]){_0x84d7db=_0xc08108[_0x1da8b8][_0xaab2('0xd')](':');if(_0x84d7db!=-0x1){_0x56d19d=_0xc08108[_0x1da8b8][_0xaab2('0xe')](0x0,_0x84d7db)[_0xaab2('0xf')]();_0x433136=_0xc08108[_0x1da8b8]['slice'](_0x84d7db+0x1)['trim']();if(_0x56d19d[_0xaab2('0xb')]>0x0){_0x3d6b78[_0x56d19d]=_0x433136;}}else{}_0x1da8b8++;}this[_0xaab2('0x10')]('headers',_0x3d6b78);this[_0xaab2('0x4')]=!![];}_0x19cbc4++;}this[_0xaab2('0x8')]=_0x15f258;}else{while((_0x113939=_0x15f258[_0xaab2('0xd')](_0x53ce4f))!=-0x1){_0x14cde3=_0x15f258[_0xaab2('0xa')](0x0,_0x113939);this[_0xaab2('0x10')]('line',_0x14cde3);_0x15f258=_0x15f258['substring'](_0x113939+_0x53ce4f[_0xaab2('0xb')]);}this[_0xaab2('0x8')]=_0x15f258;}_0x5c14f2();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ee6b808..2493c6e 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd51f=['request','then','error','result','catch','getSquareProjects','GetSquareProjects','production','getSquareProject','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','http'];(function(_0x40e4d1,_0x265805){var _0x31811a=function(_0x123311){while(--_0x123311){_0x40e4d1['push'](_0x40e4d1['shift']());}};_0x31811a(++_0x265805);}(_0xd51f,0xf0));var _0xfd51=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd51f[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xfd51('0x0'));var moment=require(_0xfd51('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xfd51('0x2')][_0xfd51('0x3')]({'port':0x2329});function request(_0x583496,_0x1fa890){return new Promise(function(_0x1d01a0,_0x49bb3e){return client[_0xfd51('0x4')](_0x583496,_0x1fa890)[_0xfd51('0x5')](function(_0x5c3129){if(_0x5c3129[_0xfd51('0x6')]){return _0x49bb3e(_0x5c3129[_0xfd51('0x6')]['message']);}else{return _0x1d01a0(_0x5c3129[_0xfd51('0x7')]);}})[_0xfd51('0x8')](function(_0x2c3fb2){return _0x49bb3e(_0x2c3fb2);});});}exports[_0xfd51('0x9')]=function(){return request(_0xfd51('0xa'),{'options':{'raw':![],'attributes':['id','name',_0xfd51('0xb')]}});};exports[_0xfd51('0xc')]=function(_0x2878c6){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2878c6},'attributes':[_0xfd51('0xb')]}});};exports['getMailAccountById']=function(_0x57838c){return request(_0xfd51('0xd'),{'options':{'raw':![],'where':{'id':_0x57838c},'include':[{'model':_0xfd51('0xe'),'as':_0xfd51('0xf'),'include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id','name',_0xfd51('0x10')],'smtp':!![]}});};exports[_0xfd51('0x11')]=function(_0x3519f1){return request(_0xfd51('0x12'),{'options':{'where':{'id':_0x3519f1},'attributes':[_0xfd51('0x13')]}});};exports[_0xfd51('0x14')]=function(_0x2c56f5){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2c56f5},'attributes':[_0xfd51('0x13')]}});};exports[_0xfd51('0x15')]=function(_0x28ee51){return request(_0xfd51('0x16'),{'options':{'where':{'id':_0x28ee51},'attributes':[_0xfd51('0x13')]}});};exports[_0xfd51('0x17')]=function(_0x44f473){return request(_0xfd51('0x18'),{'options':{'where':{'id':_0x44f473},'attributes':['dsn']}});};exports[_0xfd51('0x19')]=function(_0x55e9bf){return request(_0xfd51('0x1a'),{'options':{'where':{'id':_0x55e9bf},'attributes':[_0xfd51('0x13')]}});};exports[_0xfd51('0x1b')]=function(_0x32ad55){return request(_0xfd51('0x1c'),{'options':{'where':{'phone':_0x32ad55[_0xfd51('0x1d')]},'attributes':['id']}});};exports[_0xfd51('0x1e')]=function(_0x440352){return request('ShowTrunk',{'options':{'where':{'id':_0x440352},'attributes':[_0xfd51('0x13')]}});};exports[_0xfd51('0x1f')]=function(_0x2aab50){return request('ShowSound',{'options':{'where':{'id':_0x2aab50},'attributes':[_0xfd51('0x20')]}});};exports['getIntervalById']=function(_0x6f6672){return request(_0xfd51('0x21'),{'options':{'raw':![],'where':{'id':_0x6f6672},'include':[{'model':_0xfd51('0x22'),'as':_0xfd51('0x23')}]}});};exports['getSmsAccountById']=function(_0x34eca6){return request(_0xfd51('0x24'),{'options':{'where':{'id':_0x34eca6},'attributes':['id',_0xfd51('0x13')]}});};exports[_0xfd51('0x25')]=function(_0x3efad3){return request(_0xfd51('0x26'),{'body':_0x3efad3});};exports[_0xfd51('0x27')]=function(_0x2c68c8){return request('CreateSquareDetailsReport',{'body':_0x2c68c8});};exports[_0xfd51('0x28')]=function(_0x1f3146){return request(_0xfd51('0x29'),{'body':_[_0xfd51('0x2a')](_0x1f3146,{'project_name':_0x1f3146['arg_1'],'prev_project_name':_0x1f3146[_0xfd51('0x2b')]||'','is_subproject':_0x1f3146[_0xfd51('0x2b')]?!![]:![],'leaveAt':moment()['format'](_0xfd51('0x2c'))})});};exports[_0xfd51('0x2d')]=function(_0x5d8467){return request(_0xfd51('0x2e'),{'body':_0x5d8467});};exports[_0xfd51('0x2f')]=function(_0x3eb82c){return request(_0xfd51('0x30'),{'body':_0x3eb82c});};exports[_0xfd51('0x31')]=function(_0x1a355b){return request(_0xfd51('0x32'),{'options':{'raw':![],'where':{'phone':_0x1a355b['phone'],'ListId':_0x1a355b[_0xfd51('0x33')]}}})[_0xfd51('0x5')](function(_0x56392b){if(_0x56392b){return _0x56392b;}return request('CreateCmContact',{'body':_0x1a355b});});};exports[_0xfd51('0x34')]=function(_0x58a6d4){return request(_0xfd51('0x35'),{'options':{'where':{'id':_0x58a6d4},'attributes':[_0xfd51('0x13')]}});};exports[_0xfd51('0x36')]=function(_0x37bfb9,_0x36b6fe){return request('LoginUser',{'body':{'interface':_0x36b6fe},'options':{'where':_0x37bfb9}});};exports[_0xfd51('0x37')]=function(_0x24115f,_0x1a4e3d,_0x4341bc){return request(_0xfd51('0x38'),{'body':{'type':_0x1a4e3d,'uniqueid':_0x4341bc},'options':{'where':_0x24115f}});};exports[_0xfd51('0x39')]=function(_0x3c3b32){return request(_0xfd51('0x3a'),{'body':{},'options':{'where':_0x3c3b32}});};exports[_0xfd51('0x3b')]=function(_0x1f81a0){return request(_0xfd51('0x3c'),{'body':{},'options':{'where':_0x1f81a0}});}; \ No newline at end of file +var _0x5089=['PauseUser','UnpauseUser','agentLogout','lodash','moment','client','http','request','error','result','catch','getSquareProjects','GetSquareProjects','production','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','name','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','agentLogin','LoginUser'];(function(_0x5ad4e6,_0x12361f){var _0x511972=function(_0x292354){while(--_0x292354){_0x5ad4e6['push'](_0x5ad4e6['shift']());}};_0x511972(++_0x12361f);}(_0x5089,0x1bb));var _0x9508=function(_0x28678d,_0x54324f){_0x28678d=_0x28678d-0x0;var _0x1643e9=_0x5089[_0x28678d];return _0x1643e9;};'use strict';var _=require(_0x9508('0x0'));var moment=require(_0x9508('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x9508('0x2')][_0x9508('0x3')]({'port':0x2329});function request(_0x7dd13d,_0x100d7e){return new Promise(function(_0x172549,_0x59d3ee){return client[_0x9508('0x4')](_0x7dd13d,_0x100d7e)['then'](function(_0x3d6516){if(_0x3d6516[_0x9508('0x5')]){return _0x59d3ee(_0x3d6516[_0x9508('0x5')]['message']);}else{return _0x172549(_0x3d6516[_0x9508('0x6')]);}})[_0x9508('0x7')](function(_0x55a5de){return _0x59d3ee(_0x55a5de);});});}exports[_0x9508('0x8')]=function(){return request(_0x9508('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x9508('0xa')]}});};exports['getSquareProject']=function(_0x424e6a){return request(_0x9508('0xb'),{'options':{'raw':![],'where':{'name':_0x424e6a},'attributes':[_0x9508('0xa')]}});};exports[_0x9508('0xc')]=function(_0x839509){return request(_0x9508('0xd'),{'options':{'raw':![],'where':{'id':_0x839509},'include':[{'model':'MailServerOut','as':_0x9508('0xe'),'include':[{'model':'CloudProvider','as':_0x9508('0xf')}]}],'attributes':['id',_0x9508('0x10'),'email'],'smtp':!![]}});};exports[_0x9508('0x11')]=function(_0x3b7427){return request(_0x9508('0xb'),{'options':{'where':{'id':_0x3b7427},'attributes':[_0x9508('0x10')]}});};exports['getVoiceQueueById']=function(_0x440709){return request(_0x9508('0x12'),{'options':{'where':{'id':_0x440709},'attributes':['name']}});};exports[_0x9508('0x13')]=function(_0x539746){return request(_0x9508('0x14'),{'options':{'where':{'id':_0x539746},'attributes':[_0x9508('0x10')]}});};exports[_0x9508('0x15')]=function(_0x255a03){return request(_0x9508('0x16'),{'options':{'where':{'id':_0x255a03},'attributes':[_0x9508('0x17')]}});};exports[_0x9508('0x18')]=function(_0x20df7d){return request('ShowUser',{'options':{'where':{'id':_0x20df7d},'attributes':[_0x9508('0x10')]}});};exports[_0x9508('0x19')]=function(_0xfcc29d){return request(_0x9508('0x1a'),{'options':{'where':{'phone':_0xfcc29d[_0x9508('0x1b')]},'attributes':['id']}});};exports[_0x9508('0x1c')]=function(_0x52e3c4){return request('ShowTrunk',{'options':{'where':{'id':_0x52e3c4},'attributes':[_0x9508('0x10')]}});};exports['getSoundById']=function(_0x2272e2){return request('ShowSound',{'options':{'where':{'id':_0x2272e2},'attributes':[_0x9508('0x1d')]}});};exports[_0x9508('0x1e')]=function(_0x226f29){return request(_0x9508('0x1f'),{'options':{'raw':![],'where':{'id':_0x226f29},'include':[{'model':_0x9508('0x20'),'as':_0x9508('0x21')}]}});};exports[_0x9508('0x22')]=function(_0x5f4f0c){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5f4f0c},'attributes':['id',_0x9508('0x10')]}});};exports[_0x9508('0x23')]=function(_0x39e6b0){return request(_0x9508('0x24'),{'body':_0x39e6b0});};exports[_0x9508('0x25')]=function(_0x20d2ce){return request('CreateSquareDetailsReport',{'body':_0x20d2ce});};exports['createSquareReport']=function(_0x46d23f){return request('CreateSquareReport',{'body':_['merge'](_0x46d23f,{'project_name':_0x46d23f[_0x9508('0x26')],'prev_project_name':_0x46d23f['arg_2']||'','is_subproject':_0x46d23f['arg_2']?!![]:![],'leaveAt':moment()[_0x9508('0x27')](_0x9508('0x28'))})});};exports['createSquareRecording']=function(_0x49246b){return request(_0x9508('0x29'),{'body':_0x49246b});};exports[_0x9508('0x2a')]=function(_0x4529a8){return request(_0x9508('0x2b'),{'body':_0x4529a8});};exports[_0x9508('0x2c')]=function(_0x15c32e){return request(_0x9508('0x2d'),{'options':{'raw':![],'where':{'phone':_0x15c32e[_0x9508('0x1b')],'ListId':_0x15c32e[_0x9508('0x2e')]}}})[_0x9508('0x2f')](function(_0x55f36c){if(_0x55f36c){return _0x55f36c;}return request(_0x9508('0x30'),{'body':_0x15c32e});});};exports[_0x9508('0x31')]=function(_0x2b3738){return request('ShowPause',{'options':{'where':{'id':_0x2b3738},'attributes':[_0x9508('0x10')]}});};exports[_0x9508('0x32')]=function(_0x5e1d31,_0x3334d4){return request(_0x9508('0x33'),{'body':{'interface':_0x3334d4},'options':{'where':_0x5e1d31}});};exports['agentPause']=function(_0x1bce4f,_0x2fd00e,_0xb06b10){return request(_0x9508('0x34'),{'body':{'type':_0x2fd00e,'uniqueid':_0xb06b10},'options':{'where':_0x1bce4f}});};exports['agentUnpause']=function(_0x52a715){return request(_0x9508('0x35'),{'body':{},'options':{'where':_0x52a715}});};exports[_0x9508('0x36')]=function(_0x2677d6){return request('LogoutUser',{'body':{},'options':{'where':_0x2677d6}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 87be207..7775bb3 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89b8=['exports','./polly','./lex'];(function(_0x48845d,_0x4338c2){var _0x5bad7d=function(_0x1bf3f4){while(--_0x1bf3f4){_0x48845d['push'](_0x48845d['shift']());}};_0x5bad7d(++_0x4338c2);}(_0x89b8,0x19f));var _0x889b=function(_0x450735,_0x5c15c5){_0x450735=_0x450735-0x0;var _0x460ddc=_0x89b8[_0x450735];return _0x460ddc;};var polly=require(_0x889b('0x0'));var lex=require(_0x889b('0x1'));module[_0x889b('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6eed=['./polly','./lex','exports'];(function(_0x2734e4,_0x3dfc1d){var _0x150623=function(_0x2cb799){while(--_0x2cb799){_0x2734e4['push'](_0x2734e4['shift']());}};_0x150623(++_0x3dfc1d);}(_0x6eed,0xff));var _0xd6ee=function(_0x30a1c4,_0x156223){_0x30a1c4=_0x30a1c4-0x0;var _0x555e13=_0x6eed[_0x30a1c4];return _0x555e13;};var polly=require(_0xd6ee('0x0'));var lex=require(_0xd6ee('0x1'));module[_0xd6ee('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 22515b4..28053ed 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ No newline at end of file +var _0xee5b=['./lib/api'];(function(_0x59dede,_0x30cb83){var _0x1c2d0f=function(_0x2c382d){while(--_0x2c382d){_0x59dede['push'](_0x59dede['shift']());}};_0x1c2d0f(++_0x30cb83);}(_0xee5b,0x1f4));var _0xbee5=function(_0x17c750,_0x2f7244){_0x17c750=_0x17c750-0x0;var _0x344099=_0xee5b[_0x17c750];return _0x344099;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 3461f90..b1d87ca 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x49d9d8,_0x52a3ee){var _0x384510=function(_0x1c1b4c){while(--_0x1c1b4c){_0x49d9d8['push'](_0x49d9d8['shift']());}};_0x384510(++_0x52a3ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x154bc2,_0xb5c59e){var _0x50bbf0=function(_0x1ced51){while(--_0x1ced51){_0x154bc2['push'](_0x154bc2['shift']());}};_0x50bbf0(++_0xb5c59e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 4d26338..760188a 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb828=['./lib/api'];(function(_0x48406e,_0x455a6e){var _0xf82b3b=function(_0x3db76f){while(--_0x3db76f){_0x48406e['push'](_0x48406e['shift']());}};_0xf82b3b(++_0x455a6e);}(_0xb828,0xd8));var _0x8b82=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0xb828[_0x5c1cdc];return _0x2e8317;};'use strict';var polly=require(_0x8b82('0x0'));module['exports']=function(_0xae8faf,_0x30ca62,_0x3d4cd8,_0x215ef9,_0x5d2fbd,_0x286526,_0x5aeaed){return polly(_0xae8faf,_0x30ca62,_0x3d4cd8,_0x215ef9,_0x5d2fbd,_0x286526,_0x5aeaed);}; \ No newline at end of file +var _0xfd53=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd53,0x1ea));var _0x3fd5=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xfd53[_0x3305de];return _0x3b5a84;};'use strict';var polly=require(_0x3fd5('0x0'));module[_0x3fd5('0x1')]=function(_0x4429bb,_0x557280,_0x314f24,_0x1446a9,_0x59ee0f,_0x4a6528,_0x3d83bd){return polly(_0x4429bb,_0x557280,_0x314f24,_0x1446a9,_0x59ee0f,_0x4a6528,_0x3d83bd);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 0d99077..97e8c8c 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4010=['Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x47d24e,_0x172110){var _0x361aed=function(_0x5b6ffa){while(--_0x5b6ffa){_0x47d24e['push'](_0x47d24e['shift']());}};_0x361aed(++_0x172110);}(_0x4010,0x19d));var _0x0401=function(_0x1bf972,_0x10c5ea){_0x1bf972=_0x1bf972-0x0;var _0x2db558=_0x4010[_0x1bf972];return _0x2db558;};'use strict';var fs=require('fs');var path=require(_0x0401('0x0'));var BPromise=require('bluebird');var rs=require(_0x0401('0x1'));var AWS=require(_0x0401('0x2'));function pollyResult(_0x363edd,_0x149ee4,_0x5f5d20){return new BPromise(function(_0x1e7a5c,_0x1b40f4){_0x363edd[_0x0401('0x3')](_0x149ee4,function(_0x384d3f,_0x3c1b47){if(_0x384d3f){_0x1b40f4(_0x384d3f);}else if(_0x3c1b47){if(_0x3c1b47['AudioStream']instanceof Buffer){fs['writeFile'](_0x5f5d20,_0x3c1b47[_0x0401('0x4')],function(_0x508f52){if(_0x508f52){_0x1b40f4(_0x508f52);}else{_0x1e7a5c();}});}else{_0x1b40f4(new Error(_0x0401('0x5')));}}else{_0x1b40f4(new Error(_0x0401('0x6')));}});});}module['exports']=function(_0x1e92c2,_0x34c510,_0x5caadb,_0x4072b3,_0x4e6158,_0x45e335,_0x3d2eb8){var _0x554af6=new AWS[(_0x0401('0x7'))]({'accessKeyId':_0x1e92c2,'secretAccessKey':_0x34c510,'region':_0x5caadb});var _0x279d9c={'Text':_0x4e6158,'TextType':_0x45e335||_0x0401('0x8'),'OutputFormat':_0x0401('0x9'),'VoiceId':_0x4072b3};return pollyResult(_0x554af6,_0x279d9c,_0x3d2eb8);}; \ No newline at end of file +var _0x27b9=['Polly','mp3','randomstring','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x27b9,0xfe));var _0x927b=function(_0xea1bcd,_0x465e08){_0xea1bcd=_0xea1bcd-0x0;var _0xfbe4c6=_0x27b9[_0xea1bcd];return _0xfbe4c6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x927b('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x31fa28,_0x24aefa,_0x590501){return new BPromise(function(_0xfade53,_0x2a5834){_0x31fa28['synthesizeSpeech'](_0x24aefa,function(_0x32668e,_0x4228fd){if(_0x32668e){_0x2a5834(_0x32668e);}else if(_0x4228fd){if(_0x4228fd[_0x927b('0x1')]instanceof Buffer){fs[_0x927b('0x2')](_0x590501,_0x4228fd[_0x927b('0x1')],function(_0xa30b6b){if(_0xa30b6b){_0x2a5834(_0xa30b6b);}else{_0xfade53();}});}else{_0x2a5834(new Error(_0x927b('0x3')));}}else{_0x2a5834(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x927b('0x4')]=function(_0x44180f,_0x56d181,_0x431ae6,_0x3dd7be,_0x265b1d,_0x3be71e,_0x44d272){var _0x596039=new AWS[(_0x927b('0x5'))]({'accessKeyId':_0x44180f,'secretAccessKey':_0x56d181,'region':_0x431ae6});var _0x1bfa0e={'Text':_0x265b1d,'TextType':_0x3be71e||'text','OutputFormat':_0x927b('0x6'),'VoiceId':_0x3dd7be};return pollyResult(_0x596039,_0x1bfa0e,_0x44d272);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 08adcb9..edf365a 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x4eae36,_0x40e350,_0x1040bf,_0x288263){return asr(_0x4eae36,_0x40e350,_0x1040bf);}; \ No newline at end of file +var _0x96a1=['./lib/api','exports'];(function(_0x55f0df,_0x5abf1b){var _0x3a058e=function(_0x302c61){while(--_0x302c61){_0x55f0df['push'](_0x55f0df['shift']());}};_0x3a058e(++_0x5abf1b);}(_0x96a1,0x1cc));var _0x196a=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x96a1[_0x1ebd10];return _0x1004d3;};'use strict';var asr=require(_0x196a('0x0'));module[_0x196a('0x1')]=function(_0x1f7567,_0x16c020,_0x41ce21,_0x2461b9){return asr(_0x1f7567,_0x16c020,_0x41ce21);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index cb9feeb..e159b21 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6658=['/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST'];(function(_0x4fb13c,_0x1f612a){var _0x10e0f3=function(_0x4d0642){while(--_0x4d0642){_0x4fb13c['push'](_0x4fb13c['shift']());}};_0x10e0f3(++_0x1f612a);}(_0x6658,0x198));var _0x8665=function(_0x1bb967,_0x36d747){_0x1bb967=_0x1bb967-0x0;var _0x39580f=_0x6658[_0x1bb967];return _0x39580f;};'use strict';var url=require(_0x8665('0x0'));var BPromise=require(_0x8665('0x1'));var fs=require('fs');var host=_0x8665('0x2');module[_0x8665('0x3')]=function(_0x45eb4a,_0x454e7c,_0x252590){return new BPromise(function(_0x49b4d3,_0x4f1343){var _0xf643d8;if(typeof _0x45eb4a!==_0x8665('0x4')||_0x45eb4a['length']===0x0){return _0x4f1343('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x454e7c!==_0x8665('0x4')||_0x454e7c[_0x8665('0x5')]===0x0){return _0x4f1343(_0x8665('0x6'));}if(typeof _0x252590!==_0x8665('0x7')&&(typeof _0x252590!==_0x8665('0x4')||_0x252590[_0x8665('0x5')]===0x0)){return _0x4f1343(_0x8665('0x8'));}try{_0xf643d8=fs[_0x8665('0x9')](_0x45eb4a)['toString'](_0x8665('0xa'));}catch(_0x20da7d){return _0x4f1343(_0x20da7d);}return _0x49b4d3({'method':_0x8665('0xb'),'uri':host+_0x8665('0xc')+_0x454e7c,'body':{'config':{'encoding':_0x8665('0xd'),'sampleRateHertz':_0x8665('0xe'),'languageCode':_0x252590},'audio':{'content':_0xf643d8}},'json':!![]});});}; \ No newline at end of file +var _0x1bb2=['LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key='];(function(_0x95fa9d,_0x1e3ed6){var _0x3140a2=function(_0x2f8f0f){while(--_0x2f8f0f){_0x95fa9d['push'](_0x95fa9d['shift']());}};_0x3140a2(++_0x1e3ed6);}(_0x1bb2,0x152));var _0x21bb=function(_0x15764c,_0x316512){_0x15764c=_0x15764c-0x0;var _0x4fe0c0=_0x1bb2[_0x15764c];return _0x4fe0c0;};'use strict';var url=require('url');var BPromise=require(_0x21bb('0x0'));var fs=require('fs');var host=_0x21bb('0x1');module[_0x21bb('0x2')]=function(_0x480fcb,_0x4e514f,_0x170632){return new BPromise(function(_0x19c345,_0x1c21c6){var _0x469984;if(typeof _0x480fcb!==_0x21bb('0x3')||_0x480fcb[_0x21bb('0x4')]===0x0){return _0x1c21c6(_0x21bb('0x5'));}if(typeof _0x4e514f!==_0x21bb('0x3')||_0x4e514f[_0x21bb('0x4')]===0x0){return _0x1c21c6(_0x21bb('0x6'));}if(typeof _0x170632!==_0x21bb('0x7')&&(typeof _0x170632!==_0x21bb('0x3')||_0x170632['length']===0x0)){return _0x1c21c6(_0x21bb('0x8'));}try{_0x469984=fs['readFileSync'](_0x480fcb)[_0x21bb('0x9')]('base64');}catch(_0x4ab80c){return _0x1c21c6(_0x4ab80c);}return _0x19c345({'method':_0x21bb('0xa'),'uri':host+_0x21bb('0xb')+_0x4e514f,'body':{'config':{'encoding':_0x21bb('0xc'),'sampleRateHertz':_0x21bb('0xd'),'languageCode':_0x170632},'audio':{'content':_0x469984}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index e70bbc3..b6e43f4 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66a0=['./asr','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x66a0,0x130));var _0x066a=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x66a0[_0x29a29f];return _0x443ea3;};var asr=require(_0x066a('0x0'));module[_0x066a('0x1')]={'asr':asr}; \ No newline at end of file +var _0xb700=['exports'];(function(_0x358be5,_0x15c364){var _0x1150db=function(_0x37e438){while(--_0x37e438){_0x358be5['push'](_0x358be5['shift']());}};_0x1150db(++_0x15c364);}(_0xb700,0x87));var _0x0b70=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0xb700[_0x41d432];return _0x1650f9;};var asr=require('./asr');module[_0x0b70('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 29823d4..e0b5ba5 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f63=['close','unlink','download\x20error','end','request\x20to\x20','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','from','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','utf8','POST','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','length','lang\x20\x22','.mp3','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','googleDialogflowV2','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','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','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','randomstring','google-tts-api','url','util','./aws','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file'];(function(_0x54acf7,_0x131887){var _0x2f2872=function(_0x5d9e19){while(--_0x5d9e19){_0x54acf7['push'](_0x54acf7['shift']());}};_0x2f2872(++_0x131887);}(_0x0f63,0x175));var _0x30f6=function(_0x2d7396,_0x34b744){_0x2d7396=_0x2d7396-0x0;var _0x179b20=_0x0f63[_0x2d7396];return _0x179b20;};'use strict';var apiai=require(_0x30f6('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x30f6('0x1'));var fs=require('fs');var http=require(_0x30f6('0x2'));var https=require(_0x30f6('0x3'));var md5=require(_0x30f6('0x4'));var path=require(_0x30f6('0x5'));var querystring=require(_0x30f6('0x6'));var rp=require('request-promise');var rs=require(_0x30f6('0x7'));var sox=require('sox');var tts=require(_0x30f6('0x8'));var urlParse=require(_0x30f6('0x9'))['parse'];var util=require(_0x30f6('0xa'));var aws=require(_0x30f6('0xb'));var google=require(_0x30f6('0xc'));var sestek=require('./sestek');var tilde=require(_0x30f6('0xd'));var logger=require(_0x30f6('0xe'))('agi');var ISPEECH_API=_0x30f6('0xf');function downloadFile(_0x52d82e,_0x565db0){return new BPromise(function(_0x3c94c5,_0x5c7264){var _0xc4b45f=urlParse(_0x52d82e);var _0x4bbe0e=_0xc4b45f[_0x30f6('0x10')]===_0x30f6('0x11')?https:http;var _0x37ed98={'host':_0xc4b45f[_0x30f6('0x12')],'path':_0xc4b45f[_0x30f6('0x5')],'headers':{'user-agent':_0x30f6('0x13')}};_0x4bbe0e[_0x30f6('0x14')](_0x37ed98,function(_0x26ef9b){if(_0x26ef9b[_0x30f6('0x15')]!==0xc8){logger[_0x30f6('0x16')]('request\x20to\x20'+_0x52d82e+_0x30f6('0x17')+_0x26ef9b[_0x30f6('0x15')]+'\x20('+_0x26ef9b[_0x30f6('0x18')]+')');_0x5c7264(new Error('request\x20to\x20'+_0x52d82e+_0x30f6('0x17')+_0x26ef9b['statusCode']+'\x20('+_0x26ef9b['statusMessage']+')'));return;}var _0x442b5f=fs[_0x30f6('0x19')](_0x565db0);_0x442b5f['on'](_0x30f6('0x1a'),function(){logger[_0x30f6('0x1b')](_0x30f6('0x1c'));_0x442b5f[_0x30f6('0x1d')](_0x3c94c5);});_0x442b5f['on'](_0x30f6('0x16'),function(_0x17e324){fs[_0x30f6('0x1e')](_0x565db0);logger[_0x30f6('0x16')](_0x30f6('0x1f'),_0x17e324);_0x5c7264(_0x17e324);});_0x26ef9b['pipe'](_0x442b5f);})['on'](_0x30f6('0x16'),function(_0x37e859){logger[_0x30f6('0x16')](_0x37e859);_0x5c7264(_0x37e859);})[_0x30f6('0x20')]();});}function uploadFile(_0x4b2f95){return new BPromise(function(_0x99a3ad,_0x159704){var _0x264ab9=urlParse(_0x4b2f95);var _0x1f72af=_0x264ab9[_0x30f6('0x10')]===_0x30f6('0x11')?https:http;var _0x243ede={'host':_0x264ab9['host'],'path':_0x264ab9[_0x30f6('0x5')],'headers':{'user-agent':_0x30f6('0x13')}};_0x1f72af[_0x30f6('0x14')](_0x243ede,function(_0x1bb81c){if(_0x1bb81c[_0x30f6('0x15')]!==0xc8){_0x159704(new Error(_0x30f6('0x21')+_0x4b2f95+'\x20failed,\x20status\x20code\x20=\x20'+_0x1bb81c[_0x30f6('0x15')]+'\x20('+_0x1bb81c[_0x30f6('0x18')]+')'));return;}var _0x2053f7='';_0x1bb81c['on'](_0x30f6('0x22'),function(_0x231d7e){_0x2053f7+=_0x231d7e;});_0x1bb81c['on'](_0x30f6('0x20'),function(){_0x99a3ad(_0x2053f7);});})['on']('error',function(_0xb931b6){_0x159704(_0xb931b6);})[_0x30f6('0x20')]();});}function convertFile(_0x2bf962,_0xba7f4d){return new BPromise(function(_0x352446,_0x28384f){var _0x569df0=sox[_0x30f6('0x23')](_0x2bf962,_0xba7f4d,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x569df0['on'](_0x30f6('0x16'),function(_0x2aa291){logger[_0x30f6('0x16')](_0x30f6('0x24'),_0x2aa291);_0x28384f(_0x2aa291);});_0x569df0['on'](_0x30f6('0x20'),function(){logger['info'](_0x30f6('0x25'));_0x352446();});_0x569df0[_0x30f6('0x26')]();});}function base64Decode(_0x27c255,_0x40af55){var _0x3c0a4f=path[_0x30f6('0x27')](__dirname,_0x30f6('0x28'),rs[_0x30f6('0x29')](0x4)+_0x30f6('0x2a'));fs[_0x30f6('0x2b')](_0x3c0a4f,_0x27c255,_0x30f6('0x2c'));return convertFile(_0x3c0a4f,_0x40af55)['then'](function(){try{fs[_0x30f6('0x1e')](_0x3c0a4f);fs[_0x30f6('0x2d')](_0x40af55,_0x30f6('0x2e'));}catch(_0x203338){logger[_0x30f6('0x16')](_0x203338);}return _0x40af55[_0x30f6('0x2f')]('.')[0x0];});}function base64Encode(_0x5ca14c){var _0x565442=fs[_0x30f6('0x30')](_0x5ca14c);return new Buffer(_0x565442)['toString'](_0x30f6('0x2c'));}exports[_0x30f6('0x31')]=function(_0x13e5b7,_0x37070d,_0x565b87,_0x1e1371,_0x36aa2c,_0x45c206){var _0x5310fd,_0x4add28;var _0x5853a7=_0x30f6('0x32');var _0x5054f0=_0x30f6('0x33')+_0x13e5b7;var _0x320deb={};if(_0x37070d===_0x30f6('0x34')){_0x320deb[_0x30f6('0x35')]={'ssml':_0x565b87};}else{_0x320deb[_0x30f6('0x35')]={'text':_0x565b87};};_0x320deb['voice']={'languageCode':_0x1e1371,'ssmlGender':_0x36aa2c};_0x320deb[_0x30f6('0x36')]={'audioEncoding':_0x30f6('0x37'),'sampleRateHertz':0x1f40};var _0x586c03={'url':_0x5853a7+'text:synthesize'+_0x5054f0,'method':'POST','json':!![],'body':_0x320deb};return rp(_0x586c03)['then'](function(_0x7325d5){return new BPromise(function(_0x599583,_0x465f4c){_0x5310fd=path[_0x30f6('0x27')](__dirname,'tmp',rs[_0x30f6('0x29')](0x4)+'.mp3');var _0x14743a=Buffer[_0x30f6('0x38')](_0x7325d5[_0x30f6('0x39')],_0x30f6('0x2c'));return fs[_0x30f6('0x3a')](_0x5310fd,_0x14743a,function(_0x131047){_0x465f4c(_0x131047);},function(_0x3a0697){fs[_0x30f6('0x2d')](_0x5310fd,_0x30f6('0x2e'));_0x599583(_0x3a0697);});});})[_0x30f6('0x3b')](function(_0x2c4b2e){_0x4add28=path[_0x30f6('0x27')](__dirname,_0x30f6('0x28'),rs[_0x30f6('0x29')](0x4)+_0x30f6('0x2a'));return convertFile(_0x5310fd,_0x4add28);})[_0x30f6('0x3b')](function(){try{fs['unlink'](_0x5310fd);fs[_0x30f6('0x2d')](_0x4add28,'777');}catch(_0x1a2a9e){logger[_0x30f6('0x16')](_0x1a2a9e);}logger[_0x30f6('0x1b')](_0x30f6('0x3c'),_0x4add28[_0x30f6('0x2f')]('.')[0x0]);return _0x4add28['split']('.')[0x0];});};exports[_0x30f6('0x3d')]=function(_0x3b2cf6,_0x7eb7fb){var _0x267a20='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x34f973,_0x5656d1;var _0x53812e;var _0x44dc51={'encoding':_0x30f6('0x3e'),'method':_0x30f6('0x3f'),'timeout':0x2710,'url':_0x267a20,'headers':{'Content-Type':_0x30f6('0x40')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x30f6('0x41'),JSON[_0x30f6('0x42')]([_0x3b2cf6,_0x7eb7fb||'en',![],_0x30f6('0x43')]),null,_0x30f6('0x44')]]]))};return rp(_0x44dc51)[_0x30f6('0x3b')](function(_0x4a8407){try{_0x53812e=eval(_0x4a8407['slice'](0x5))[0x0][0x2];}catch(_0x119328){throw new Error(_0x30f6('0x45')+_0x4a8407[_0x30f6('0x22')]);}if(!_0x53812e){if(_0x3b2cf6[_0x30f6('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x30f6('0x47')+_0x7eb7fb+'\x22\x20might\x20not\x20exist');}}try{_0x53812e=eval(_0x53812e)[0x0];}catch(_0x2854fc){throw new Error(_0x30f6('0x45')+res['data']);}const _0x25bcda=_0x53812e;_0x34f973=path['resolve'](__dirname,_0x30f6('0x28'),rs[_0x30f6('0x29')](0x4)+_0x30f6('0x48'));fs[_0x30f6('0x2b')](_0x34f973,_0x53812e,{'encoding':_0x30f6('0x2c')});_0x5656d1=path['resolve'](__dirname,_0x30f6('0x28'),rs['generate'](0x4)+_0x30f6('0x2a'));return convertFile(_0x34f973,_0x5656d1);})[_0x30f6('0x3b')](function(){try{fs[_0x30f6('0x1e')](_0x34f973);fs[_0x30f6('0x2d')](_0x5656d1,'777');}catch(_0x4aca3e){logger[_0x30f6('0x16')](_0x4aca3e);}logger[_0x30f6('0x1b')](_0x30f6('0x49'),_0x5656d1[_0x30f6('0x2f')]('.')[0x0]);return _0x5656d1[_0x30f6('0x2f')]('.')[0x0];});};exports[_0x30f6('0x4a')]=function(_0x2f1eb0,_0x1b0c3a,_0x52e1f7){return google['asr'](_0x2f1eb0,_0x1b0c3a,_0x52e1f7)['then'](function(_0x360d35){logger[_0x30f6('0x1b')](_0x360d35[_0x30f6('0x4b')]);return rp(_0x360d35);})[_0x30f6('0x3b')](function(_0x50ea63){var _0x20c949='';var _0x339217=0x0;try{fs[_0x30f6('0x1e')](_0x2f1eb0);}catch(_0x3d2b93){logger[_0x30f6('0x16')](_0x3d2b93);}if(_0x50ea63&&_0x50ea63[_0x30f6('0x4c')]){_0x20c949=_0x50ea63[_0x30f6('0x4c')][_0x30f6('0x4d')](function(_0x36f7b1){return _0x36f7b1&&_0x36f7b1[_0x30f6('0x4e')][0x0]&&_0x36f7b1[_0x30f6('0x4e')][0x0]['transcript']?_0x36f7b1[_0x30f6('0x4e')][0x0][_0x30f6('0x4f')]:'';})['join']('\x0a');_0x339217=_0x50ea63[_0x30f6('0x4c')][_0x30f6('0x4d')](function(_0x310120){return _0x310120&&_0x310120['alternatives'][0x0]&&_0x310120[_0x30f6('0x4e')][0x0][_0x30f6('0x50')]?_0x310120['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x30f6('0x1b')](_0x30f6('0x51'),_0x20c949);logger[_0x30f6('0x1b')]('googleASR\x20confidence',_0x339217);return{'transcript':_0x20c949,'confidence':_0x339217};})[_0x30f6('0x52')](function(_0x252301){logger['error'](_0x30f6('0x53'),_0x252301[_0x30f6('0x15')],_0x252301[_0x30f6('0x54')],_0x252301[_0x30f6('0x55')]);});};exports[_0x30f6('0x56')]=function(_0x55c899,_0x514320,_0x5ac930,_0x259e82){var _0x4137a8=apiai(_0x514320,{'language':_0x259e82||'en'});return _0x4137a8[_0x30f6('0x57')](_0x5ac930,{'sessionId':md5(_0x55c899)})[_0x30f6('0x3b')](function(_0xc4e331){logger['info'](JSON[_0x30f6('0x42')](_0xc4e331));return{'source':_0xc4e331['result']['source'],'resolvedQuery':_0xc4e331[_0x30f6('0x58')][_0x30f6('0x59')],'action':_0xc4e331['result'][_0x30f6('0x5a')],'actionIncomplete':_0xc4e331['result'][_0x30f6('0x5b')],'speech':_0xc4e331['result'][_0x30f6('0x5c')][_0x30f6('0x5d')],'score':_0xc4e331[_0x30f6('0x58')][_0x30f6('0x5e')],'statusCode':_0xc4e331[_0x30f6('0x5f')][_0x30f6('0x60')],'endConversation':_0xc4e331[_0x30f6('0x58')]['metadata'][_0x30f6('0x61')]||![],'isFallbackIntent':_0xc4e331[_0x30f6('0x58')]['metadata']['isFallbackIntent']};});};exports[_0x30f6('0x62')]=function(_0x4957b5,_0x5f0a7f,_0x295d33,_0x5d9e51,_0x1cc8f9,_0x2f1fdf){var _0x5e940f=_0x5d9e51['replace'](/\\n/g,'\x0a');var _0x39f82f={'credentials':{'private_key':_0x5e940f,'client_email':_0x295d33}};var _0x4fbc00=new dialogflow[(_0x30f6('0x63'))](_0x39f82f);var _0x3894b2=_0x4fbc00['sessionPath'](_0x5f0a7f,md5(_0x4957b5));var _0x20ee4f={'session':_0x3894b2,'queryInput':{'text':{'text':_0x1cc8f9,'languageCode':_0x2f1fdf}}};return _0x4fbc00[_0x30f6('0x64')](_0x20ee4f)['then'](function(_0x135cc8){if(_0x135cc8&&_0x135cc8[_0x30f6('0x46')]){logger['info'](_0x30f6('0x65'),JSON[_0x30f6('0x42')](_0x135cc8));var _0x2d2606=_0x135cc8[0x0];if(_0x2d2606){var _0x1362e4={'action':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x5a')],'allRequiredParamsPresent':_0x2d2606['queryResult'][_0x30f6('0x67')],'endConversation':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x68')]&&_0x2d2606[_0x30f6('0x66')]['diagnosticInfo'][_0x30f6('0x69')]?_0x2d2606[_0x30f6('0x66')]['diagnosticInfo'][_0x30f6('0x69')][_0x30f6('0x6a')]['boolValue']:![],'fulfillmentText':_0x2d2606[_0x30f6('0x66')]['fulfillmentText'],'intentName':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x6b')][_0x30f6('0x54')],'intentDisplayName':_0x2d2606['queryResult'][_0x30f6('0x6b')]['displayName'],'isFallbackIntent':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x6b')]['isFallback'],'languageCode':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x6c')],'queryText':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x6d')],'responseId':_0x2d2606[_0x30f6('0x6e')],'score':_0x2d2606[_0x30f6('0x66')][_0x30f6('0x6f')],'speech':_0x2d2606['queryResult'][_0x30f6('0x70')],'providerResponse':JSON[_0x30f6('0x42')](_0x135cc8)};return _0x1362e4;}}});};exports[_0x30f6('0x71')]=function(_0x2608a7,_0x46d7fb,_0x4e9cb4,_0x24d3f5){return tilde[_0x30f6('0x72')](_0x2608a7,_0x46d7fb,_0x4e9cb4,_0x24d3f5)['then'](function(_0x3dcd98){try{fs[_0x30f6('0x1e')](_0x2608a7);}catch(_0x3a6fbd){logger['error'](_0x3a6fbd);}logger['info'](_0x30f6('0x73'),_0x3dcd98['transcript']);logger['info'](_0x30f6('0x74'),_0x3dcd98[_0x30f6('0x50')]);return _0x3dcd98;});};exports['awsPolly']=function(_0x461542,_0x30ec39,_0x4c3fcb,_0x56def0,_0x416d1d,_0x5ef53b){var _0x1772b2=path[_0x30f6('0x27')](__dirname,_0x30f6('0x28'),rs['generate'](0x4)+_0x30f6('0x48'));var _0x53894d;return aws[_0x30f6('0x75')](_0x461542,_0x30ec39,_0x4c3fcb,_0x56def0,_0x416d1d,_0x5ef53b,_0x1772b2)[_0x30f6('0x3b')](function(){_0x53894d=path[_0x30f6('0x27')](__dirname,'tmp',rs[_0x30f6('0x29')](0x4)+'.wav');return convertFile(_0x1772b2,_0x53894d);})[_0x30f6('0x3b')](function(){try{fs[_0x30f6('0x1e')](_0x1772b2);fs[_0x30f6('0x2d')](_0x53894d,_0x30f6('0x2e'));}catch(_0x167b5b){logger['error'](_0x167b5b);}return _0x53894d[_0x30f6('0x2f')]('.')[0x0];});};exports['awsLex']=function(_0x56ee1b,_0x136ca4,_0x2630ab,_0x219efc,_0x274615,_0x2b9a24){return aws[_0x30f6('0x76')](_0x56ee1b,_0x136ca4,_0x2630ab,_0x219efc,_0x274615,_0x2b9a24)[_0x30f6('0x3b')](function(_0x5c4a95){logger['info'](JSON[_0x30f6('0x42')](_0x5c4a95));return _0x5c4a95;});};exports['ispeechTTS']=function(_0x1c2fbf,_0x12fb0e,_0x6ba046,_0x44afe2){var _0x42bbe0=util[_0x30f6('0x77')](_0x30f6('0x78'),ISPEECH_API,_0x1c2fbf,encodeURIComponent(_0x12fb0e),_0x6ba046,_0x44afe2);var _0x30f188=path[_0x30f6('0x27')](__dirname,_0x30f6('0x28'),rs[_0x30f6('0x29')](0x4)+_0x30f6('0x48'));var _0x4be589;return downloadFile(_0x42bbe0,_0x30f188)[_0x30f6('0x3b')](function(){_0x4be589=path[_0x30f6('0x27')](__dirname,_0x30f6('0x28'),rs['generate'](0x4)+_0x30f6('0x2a'));return convertFile(_0x30f188,_0x4be589);})[_0x30f6('0x3b')](function(){try{fs[_0x30f6('0x1e')](_0x30f188);fs[_0x30f6('0x2d')](_0x4be589,_0x30f6('0x2e'));}catch(_0xdf5761){logger[_0x30f6('0x16')](_0xdf5761);}return _0x4be589[_0x30f6('0x2f')]('.')[0x0];});};exports[_0x30f6('0x79')]=function(_0x32b0ce,_0x4052cc,_0x52a431,_0x2226cc){var _0xd5740e=util[_0x30f6('0x77')](_0x30f6('0x7a'),ISPEECH_API,_0x4052cc,_0x52a431,base64Encode(_0x32b0ce),_0x2226cc?util[_0x30f6('0x77')](_0x30f6('0x7b'),encodeURIComponent(_0x2226cc)):_0x30f6('0x7c'));return uploadFile(_0xd5740e)[_0x30f6('0x3b')](function(_0x5a6eab){return querystring['parse'](_0x5a6eab);});};exports[_0x30f6('0x7d')]=function(_0x564008,_0x1fb39f){return sestek[_0x30f6('0x7e')](_0x564008,_0x1fb39f)[_0x30f6('0x3b')](function(_0x5d1e7c){logger[_0x30f6('0x1b')](JSON[_0x30f6('0x42')](_0x5d1e7c));var _0x451297={'speech':_0x5d1e7c[_0x30f6('0x7f')],'action':_0x5d1e7c[_0x30f6('0x80')]?_0x5d1e7c['channelData'][_0x30f6('0x81')]:undefined,'actiondata':_0x5d1e7c[_0x30f6('0x80')]?_0x5d1e7c[_0x30f6('0x80')][_0x30f6('0x82')]:undefined};if(_0x5d1e7c[_0x30f6('0x80')]&&_0x5d1e7c[_0x30f6('0x80')][_0x30f6('0x83')]){return base64Decode(_0x5d1e7c[_0x30f6('0x80')][_0x30f6('0x83')][_0x30f6('0x84')],path['resolve'](__dirname,_0x30f6('0x28'),rs[_0x30f6('0x29')](0x4)+_0x30f6('0x2a')))[_0x30f6('0x3b')](function(_0x484a86){_0x451297['audiofile']=_0x484a86;return _0x451297;});}return _0x451297;});};exports[_0x30f6('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0x9ee4=['sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','md5','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','host','path','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','error','unlink','pipe','end','https:','data','transcode','wav','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','.mp3','from','audioContent','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','f.req=','jQ1olc','stringify','null','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x9ee4,0x129));var _0x49ee=function(_0x2516f5,_0x1d1b39){_0x2516f5=_0x2516f5-0x0;var _0x16ccf2=_0x9ee4[_0x2516f5];return _0x16ccf2;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x49ee('0x0'));var fs=require('fs');var http=require(_0x49ee('0x1'));var https=require(_0x49ee('0x2'));var md5=require(_0x49ee('0x3'));var path=require('path');var querystring=require(_0x49ee('0x4'));var rp=require(_0x49ee('0x5'));var rs=require(_0x49ee('0x6'));var sox=require('sox');var tts=require(_0x49ee('0x7'));var urlParse=require(_0x49ee('0x8'))[_0x49ee('0x9')];var util=require(_0x49ee('0xa'));var aws=require(_0x49ee('0xb'));var google=require('./google');var sestek=require(_0x49ee('0xc'));var tilde=require(_0x49ee('0xd'));var logger=require('../../../config/logger')(_0x49ee('0xe'));var ISPEECH_API=_0x49ee('0xf');function downloadFile(_0x11999f,_0x4bcbcf){return new BPromise(function(_0x1f6f94,_0x11870d){var _0x292cc3=urlParse(_0x11999f);var _0x1860a1=_0x292cc3['protocol']==='https:'?https:http;var _0xa166bc={'host':_0x292cc3[_0x49ee('0x10')],'path':_0x292cc3[_0x49ee('0x11')],'headers':{'user-agent':_0x49ee('0x12')}};_0x1860a1[_0x49ee('0x13')](_0xa166bc,function(_0x2c9b35){if(_0x2c9b35[_0x49ee('0x14')]!==0xc8){logger['error']('request\x20to\x20'+_0x11999f+_0x49ee('0x15')+_0x2c9b35[_0x49ee('0x14')]+'\x20('+_0x2c9b35[_0x49ee('0x16')]+')');_0x11870d(new Error(_0x49ee('0x17')+_0x11999f+_0x49ee('0x15')+_0x2c9b35['statusCode']+'\x20('+_0x2c9b35[_0x49ee('0x16')]+')'));return;}var _0x5b7935=fs['createWriteStream'](_0x4bcbcf);_0x5b7935['on'](_0x49ee('0x18'),function(){logger[_0x49ee('0x19')](_0x49ee('0x1a'));_0x5b7935[_0x49ee('0x1b')](_0x1f6f94);});_0x5b7935['on'](_0x49ee('0x1c'),function(_0x4c4785){fs[_0x49ee('0x1d')](_0x4bcbcf);logger[_0x49ee('0x1c')]('download\x20error',_0x4c4785);_0x11870d(_0x4c4785);});_0x2c9b35[_0x49ee('0x1e')](_0x5b7935);})['on'](_0x49ee('0x1c'),function(_0x2e3f49){logger[_0x49ee('0x1c')](_0x2e3f49);_0x11870d(_0x2e3f49);})[_0x49ee('0x1f')]();});}function uploadFile(_0x96a17e){return new BPromise(function(_0x44229a,_0x3efb61){var _0x329901=urlParse(_0x96a17e);var _0x5651ed=_0x329901['protocol']===_0x49ee('0x20')?https:http;var _0x5f5d14={'host':_0x329901[_0x49ee('0x10')],'path':_0x329901[_0x49ee('0x11')],'headers':{'user-agent':'WHAT_EVER'}};_0x5651ed[_0x49ee('0x13')](_0x5f5d14,function(_0x31c1fd){if(_0x31c1fd['statusCode']!==0xc8){_0x3efb61(new Error(_0x49ee('0x17')+_0x96a17e+_0x49ee('0x15')+_0x31c1fd['statusCode']+'\x20('+_0x31c1fd[_0x49ee('0x16')]+')'));return;}var _0x5556a3='';_0x31c1fd['on'](_0x49ee('0x21'),function(_0x236998){_0x5556a3+=_0x236998;});_0x31c1fd['on']('end',function(){_0x44229a(_0x5556a3);});})['on'](_0x49ee('0x1c'),function(_0x6fe5ed){_0x3efb61(_0x6fe5ed);})[_0x49ee('0x1f')]();});}function convertFile(_0x3c937c,_0xd973cd){return new BPromise(function(_0x56b395,_0x59c4ad){var _0x3a3cc0=sox[_0x49ee('0x22')](_0x3c937c,_0xd973cd,{'sampleRate':0x1f40,'format':_0x49ee('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a3cc0['on']('error',function(_0x3681f3){logger[_0x49ee('0x1c')](_0x49ee('0x24'),_0x3681f3);_0x59c4ad(_0x3681f3);});_0x3a3cc0['on']('end',function(){logger['info']('finish\x20to\x20convert');_0x56b395();});_0x3a3cc0[_0x49ee('0x25')]();});}function base64Decode(_0x473721,_0x3b8671){var _0x357aad=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));fs[_0x49ee('0x2a')](_0x357aad,_0x473721,_0x49ee('0x2b'));return convertFile(_0x357aad,_0x3b8671)[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x357aad);fs[_0x49ee('0x2d')](_0x3b8671,_0x49ee('0x2e'));}catch(_0x44e21a){logger[_0x49ee('0x1c')](_0x44e21a);}return _0x3b8671[_0x49ee('0x2f')]('.')[0x0];});}function base64Encode(_0x3d1feb){var _0x47f568=fs['readFileSync'](_0x3d1feb);return new Buffer(_0x47f568)[_0x49ee('0x30')](_0x49ee('0x2b'));}exports[_0x49ee('0x31')]=function(_0x2187b3,_0xf3e31f,_0x2eecbb,_0x34d00d,_0x379dde,_0xc2a73b){var _0x5743b1,_0x1bbe20;var _0x331981='https://texttospeech.googleapis.com/v1/';var _0x292148=_0x49ee('0x32')+_0x2187b3;var _0x1d46c6={};if(_0xf3e31f===_0x49ee('0x33')){_0x1d46c6['input']={'ssml':_0x2eecbb};}else{_0x1d46c6[_0x49ee('0x34')]={'text':_0x2eecbb};};_0x1d46c6[_0x49ee('0x35')]={'languageCode':_0x34d00d,'ssmlGender':_0x379dde};_0x1d46c6[_0x49ee('0x36')]={'audioEncoding':_0x49ee('0x37'),'sampleRateHertz':0x1f40};var _0x2ae2ce={'url':_0x331981+_0x49ee('0x38')+_0x292148,'method':'POST','json':!![],'body':_0x1d46c6};return rp(_0x2ae2ce)[_0x49ee('0x2c')](function(_0x5a7b0c){return new BPromise(function(_0x54a4e5,_0x479f7f){_0x5743b1=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs['generate'](0x4)+_0x49ee('0x39'));var _0x58de2f=Buffer[_0x49ee('0x3a')](_0x5a7b0c[_0x49ee('0x3b')],_0x49ee('0x2b'));return fs['writeFile'](_0x5743b1,_0x58de2f,function(_0x4be7cf){_0x479f7f(_0x4be7cf);},function(_0x2b578a){fs[_0x49ee('0x2d')](_0x5743b1,_0x49ee('0x2e'));_0x54a4e5(_0x2b578a);});});})[_0x49ee('0x2c')](function(_0x4793a3){_0x1bbe20=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x5743b1,_0x1bbe20);})[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x5743b1);fs['chmodSync'](_0x1bbe20,_0x49ee('0x2e'));}catch(_0x5e1df5){logger[_0x49ee('0x1c')](_0x5e1df5);}logger['info']('googleCloudTTS\x20path',_0x1bbe20['split']('.')[0x0]);return _0x1bbe20[_0x49ee('0x2f')]('.')[0x0];});};exports[_0x49ee('0x3c')]=function(_0x818441,_0x2f3362){var _0x357e7d=_0x49ee('0x3d');var _0x3eb21e,_0x2c943a;var _0x372dde;var _0x414d0a={'encoding':'utf8','method':_0x49ee('0x3e'),'timeout':0x2710,'url':_0x357e7d,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x49ee('0x3f')+encodeURIComponent(JSON['stringify']([[[_0x49ee('0x40'),JSON[_0x49ee('0x41')]([_0x818441,_0x2f3362||'en',![],_0x49ee('0x42')]),null,'generic']]]))};return rp(_0x414d0a)['then'](function(_0x3ca065){try{_0x372dde=eval(_0x3ca065['slice'](0x5))[0x0][0x2];}catch(_0x5babee){throw new Error(_0x49ee('0x43')+_0x3ca065['data']);}if(!_0x372dde){if(_0x818441[_0x49ee('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x49ee('0x45')+_0x2f3362+_0x49ee('0x46'));}}try{_0x372dde=eval(_0x372dde)[0x0];}catch(_0x1be992){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x49ee('0x21')]);}const _0x336ac3=_0x372dde;_0x3eb21e=path[_0x49ee('0x26')](__dirname,'tmp',rs[_0x49ee('0x28')](0x4)+_0x49ee('0x39'));fs[_0x49ee('0x2a')](_0x3eb21e,_0x372dde,{'encoding':_0x49ee('0x2b')});_0x2c943a=path[_0x49ee('0x26')](__dirname,'tmp',rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x3eb21e,_0x2c943a);})['then'](function(){try{fs['unlink'](_0x3eb21e);fs[_0x49ee('0x2d')](_0x2c943a,_0x49ee('0x2e'));}catch(_0x62e9f2){logger['error'](_0x62e9f2);}logger[_0x49ee('0x19')]('goggleTTS\x20path',_0x2c943a[_0x49ee('0x2f')]('.')[0x0]);return _0x2c943a[_0x49ee('0x2f')]('.')[0x0];});};exports[_0x49ee('0x47')]=function(_0x24989a,_0x1e85d0,_0x37a5cd){return google[_0x49ee('0x48')](_0x24989a,_0x1e85d0,_0x37a5cd)[_0x49ee('0x2c')](function(_0x2020e3){logger[_0x49ee('0x19')](_0x2020e3[_0x49ee('0x49')]);return rp(_0x2020e3);})[_0x49ee('0x2c')](function(_0x2c5fa6){var _0x4d9111='';var _0x35f45e=0x0;try{fs['unlink'](_0x24989a);}catch(_0x253a7f){logger['error'](_0x253a7f);}if(_0x2c5fa6&&_0x2c5fa6[_0x49ee('0x4a')]){_0x4d9111=_0x2c5fa6[_0x49ee('0x4a')][_0x49ee('0x4b')](function(_0x39d444){return _0x39d444&&_0x39d444[_0x49ee('0x4c')][0x0]&&_0x39d444[_0x49ee('0x4c')][0x0][_0x49ee('0x4d')]?_0x39d444[_0x49ee('0x4c')][0x0][_0x49ee('0x4d')]:'';})['join']('\x0a');_0x35f45e=_0x2c5fa6[_0x49ee('0x4a')]['map'](function(_0x4022b9){return _0x4022b9&&_0x4022b9[_0x49ee('0x4c')][0x0]&&_0x4022b9['alternatives'][0x0][_0x49ee('0x4e')]?_0x4022b9[_0x49ee('0x4c')][0x0]['confidence']:0x0;})['join']('\x0a');}logger['info'](_0x49ee('0x4f'),_0x4d9111);logger[_0x49ee('0x19')]('googleASR\x20confidence',_0x35f45e);return{'transcript':_0x4d9111,'confidence':_0x35f45e};})['catch'](function(_0x598d2a){logger[_0x49ee('0x1c')](_0x49ee('0x50'),_0x598d2a[_0x49ee('0x14')],_0x598d2a[_0x49ee('0x51')],_0x598d2a['message']);});};exports[_0x49ee('0x52')]=function(_0x5cf284,_0x20e56d,_0x29eef4,_0x283f2c){var _0x1c8264=apiai(_0x20e56d,{'language':_0x283f2c||'en'});return _0x1c8264[_0x49ee('0x53')](_0x29eef4,{'sessionId':md5(_0x5cf284)})[_0x49ee('0x2c')](function(_0x250b21){logger[_0x49ee('0x19')](JSON[_0x49ee('0x41')](_0x250b21));return{'source':_0x250b21[_0x49ee('0x54')][_0x49ee('0x55')],'resolvedQuery':_0x250b21[_0x49ee('0x54')][_0x49ee('0x56')],'action':_0x250b21['result']['action'],'actionIncomplete':_0x250b21['result'][_0x49ee('0x57')],'speech':_0x250b21[_0x49ee('0x54')][_0x49ee('0x58')][_0x49ee('0x59')],'score':_0x250b21[_0x49ee('0x54')][_0x49ee('0x5a')],'statusCode':_0x250b21[_0x49ee('0x5b')][_0x49ee('0x5c')],'endConversation':_0x250b21[_0x49ee('0x54')][_0x49ee('0x5d')][_0x49ee('0x5e')]||![],'isFallbackIntent':_0x250b21[_0x49ee('0x54')]['metadata'][_0x49ee('0x5f')]};});};exports[_0x49ee('0x60')]=function(_0x233cf0,_0x5b2aa5,_0x53e07a,_0x5c68ea,_0xd2bfe7,_0x38dcb9){var _0x2857e3=_0x5c68ea[_0x49ee('0x61')](/\\n/g,'\x0a');var _0x115b61={'credentials':{'private_key':_0x2857e3,'client_email':_0x53e07a}};var _0x74eaa1=new dialogflow[(_0x49ee('0x62'))](_0x115b61);var _0x1e67af=_0x74eaa1[_0x49ee('0x63')](_0x5b2aa5,md5(_0x233cf0));var _0x23cb46={'session':_0x1e67af,'queryInput':{'text':{'text':_0xd2bfe7,'languageCode':_0x38dcb9}}};return _0x74eaa1[_0x49ee('0x64')](_0x23cb46)['then'](function(_0x5916c2){if(_0x5916c2&&_0x5916c2[_0x49ee('0x44')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x49ee('0x41')](_0x5916c2));var _0x2e1d8d=_0x5916c2[0x0];if(_0x2e1d8d){var _0x411731={'action':_0x2e1d8d['queryResult']['action'],'allRequiredParamsPresent':_0x2e1d8d[_0x49ee('0x65')]['allRequiredParamsPresent'],'endConversation':_0x2e1d8d[_0x49ee('0x65')]['diagnosticInfo']&&_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x66')]['fields']?_0x2e1d8d[_0x49ee('0x65')]['diagnosticInfo'][_0x49ee('0x67')][_0x49ee('0x68')][_0x49ee('0x69')]:![],'fulfillmentText':_0x2e1d8d['queryResult'][_0x49ee('0x6a')],'intentName':_0x2e1d8d['queryResult'][_0x49ee('0x6b')][_0x49ee('0x51')],'intentDisplayName':_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x6b')][_0x49ee('0x6c')],'isFallbackIntent':_0x2e1d8d[_0x49ee('0x65')]['intent'][_0x49ee('0x6d')],'languageCode':_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x6e')],'queryText':_0x2e1d8d['queryResult'][_0x49ee('0x6f')],'responseId':_0x2e1d8d[_0x49ee('0x70')],'score':_0x2e1d8d['queryResult'][_0x49ee('0x71')],'speech':_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x6a')],'providerResponse':JSON['stringify'](_0x5916c2)};return _0x411731;}}});};exports[_0x49ee('0x72')]=function(_0x4478a3,_0x5d7934,_0xf99319,_0x52eafb){return tilde['asr'](_0x4478a3,_0x5d7934,_0xf99319,_0x52eafb)[_0x49ee('0x2c')](function(_0x18c04a){try{fs['unlink'](_0x4478a3);}catch(_0x573845){logger['error'](_0x573845);}logger['info'](_0x49ee('0x73'),_0x18c04a['transcript']);logger[_0x49ee('0x19')](_0x49ee('0x74'),_0x18c04a[_0x49ee('0x4e')]);return _0x18c04a;});};exports[_0x49ee('0x75')]=function(_0x1b1c37,_0x2e7dc4,_0x42cb20,_0x32685c,_0x184e07,_0x7d5931){var _0x559992=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs['generate'](0x4)+'.mp3');var _0x336f36;return aws[_0x49ee('0x76')](_0x1b1c37,_0x2e7dc4,_0x42cb20,_0x32685c,_0x184e07,_0x7d5931,_0x559992)['then'](function(){_0x336f36=path['resolve'](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x559992,_0x336f36);})[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x559992);fs[_0x49ee('0x2d')](_0x336f36,'777');}catch(_0xa6f52c){logger[_0x49ee('0x1c')](_0xa6f52c);}return _0x336f36[_0x49ee('0x2f')]('.')[0x0];});};exports['awsLex']=function(_0x31f299,_0x58c735,_0x96b54d,_0x2493bb,_0x231a80,_0x1fb987){return aws['lex'](_0x31f299,_0x58c735,_0x96b54d,_0x2493bb,_0x231a80,_0x1fb987)[_0x49ee('0x2c')](function(_0x4e324a){logger[_0x49ee('0x19')](JSON[_0x49ee('0x41')](_0x4e324a));return _0x4e324a;});};exports['ispeechTTS']=function(_0xa2ce83,_0x5bbb9e,_0x1d5478,_0x382ef8){var _0x43f3c8=util[_0x49ee('0x77')](_0x49ee('0x78'),ISPEECH_API,_0xa2ce83,encodeURIComponent(_0x5bbb9e),_0x1d5478,_0x382ef8);var _0x3e8b6a=path[_0x49ee('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x4144f2;return downloadFile(_0x43f3c8,_0x3e8b6a)[_0x49ee('0x2c')](function(){_0x4144f2=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x3e8b6a,_0x4144f2);})[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x3e8b6a);fs[_0x49ee('0x2d')](_0x4144f2,_0x49ee('0x2e'));}catch(_0x4bfd6a){logger[_0x49ee('0x1c')](_0x4bfd6a);}return _0x4144f2[_0x49ee('0x2f')]('.')[0x0];});};exports[_0x49ee('0x79')]=function(_0x393df,_0x1faa50,_0x447bda,_0x481731){var _0x44ceeb=util['format'](_0x49ee('0x7a'),ISPEECH_API,_0x1faa50,_0x447bda,base64Encode(_0x393df),_0x481731?util[_0x49ee('0x77')](_0x49ee('0x7b'),encodeURIComponent(_0x481731)):_0x49ee('0x7c'));return uploadFile(_0x44ceeb)[_0x49ee('0x2c')](function(_0x27d9b1){return querystring[_0x49ee('0x9')](_0x27d9b1);});};exports['sestekNDA']=function(_0x39f957,_0x2b0bfe){return sestek[_0x49ee('0x7d')](_0x39f957,_0x2b0bfe)['then'](function(_0x10cedc){logger[_0x49ee('0x19')](JSON[_0x49ee('0x41')](_0x10cedc));var _0x4ee445={'speech':_0x10cedc['text'],'action':_0x10cedc[_0x49ee('0x7e')]?_0x10cedc['channelData'][_0x49ee('0x7f')]:undefined,'actiondata':_0x10cedc[_0x49ee('0x7e')]?_0x10cedc[_0x49ee('0x7e')]['CustomActionData']:undefined};if(_0x10cedc['channelData']&&_0x10cedc[_0x49ee('0x7e')]['AudioFromTts']){return base64Decode(_0x10cedc[_0x49ee('0x7e')][_0x49ee('0x80')][_0x49ee('0x81')],path[_0x49ee('0x26')](__dirname,'tmp',rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29')))[_0x49ee('0x2c')](function(_0x21295c){_0x4ee445[_0x49ee('0x82')]=_0x21295c;return _0x4ee445;});}return _0x4ee445;});};exports[_0x49ee('0x83')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index e2c237f..65a161c 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee88=['exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xee88,0xbd));var _0x8ee8=function(_0x3229b5,_0xa50ad6){_0x3229b5=_0x3229b5-0x0;var _0xce50a5=_0xee88[_0x3229b5];return _0xce50a5;};var nda=require('./nda');module[_0x8ee8('0x0')]={'nda':nda}; \ No newline at end of file +var _0x0670=['exports'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x0670,0x1da));var _0x0067=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x0670[_0x41e8c4];return _0x54ffbe;};var nda=require('./nda');module[_0x0067('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index e3fad41..59fdf3c 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x402f=['calleridname','project','body','channelData','AudioOutputSettings','audio/wav','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','resolve','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid'];(function(_0x4f6328,_0x3ad203){var _0x15fce0=function(_0x1e9cfb){while(--_0x1e9cfb){_0x4f6328['push'](_0x4f6328['shift']());}};_0x15fce0(++_0x3ad203);}(_0x402f,0x6f));var _0xf402=function(_0x2f0f36,_0x2ce07b){_0x2f0f36=_0x2f0f36-0x0;var _0x1152c5=_0x402f[_0x2f0f36];return _0x1152c5;};'use strict';var rp=require(_0xf402('0x0'));var url=require('url');var logger=require(_0xf402('0x1'))('agi');module['exports']=function(_0x3ccbce,_0xe1847c){var _0x86f726={'method':'POST','uri':url[_0xf402('0x2')](_0xe1847c['ndauth_url'],_0xf402('0x3')),'form':{'grant_type':_0xf402('0x4'),'username':_0xe1847c[_0xf402('0x5')],'password':_0xe1847c[_0xf402('0x4')]},'json':!![]};return rp(_0x86f726)[_0xf402('0x6')](function(_0x55c515){var _0x4d1771={'method':_0xf402('0x7'),'uri':url[_0xf402('0x2')](_0xe1847c[_0xf402('0x8')],_0xf402('0x9')),'body':{'type':_0xe1847c[_0xf402('0xa')]||_0xf402('0xb'),'channelId':_0xf402('0xc'),'conversation':{'id':_0x3ccbce[_0xf402('0xd')]},'from':{'id':_0x3ccbce['callerid'],'name':_0x3ccbce[_0xf402('0xe')]},'recipient':{'id':_0x3ccbce['dnid'],'name':_0x3ccbce['extension']},'text':_0xe1847c['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x55c515['access_token']},'json':!![]};if(_0xe1847c[_0xf402('0xf')]){_0x4d1771['body']['channelData']['ProjectName']=_0xe1847c[_0xf402('0xf')];}if(_0xe1847c['ndagenerate_audio']=='1'){_0x4d1771[_0xf402('0x10')][_0xf402('0x11')][_0xf402('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf402('0x13')};}if(_0xe1847c['custom_action']){_0x4d1771[_0xf402('0x10')]['channelData'][_0xf402('0x14')]=_0xe1847c['custom_action'];if(_0xe1847c['custom_action_data']){_0x4d1771['body'][_0xf402('0x11')][_0xf402('0x15')]=_0xe1847c[_0xf402('0x16')];}}logger[_0xf402('0x17')](JSON[_0xf402('0x18')](_0x4d1771));return rp(_0x4d1771);});}; \ No newline at end of file +var _0x2917=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x4609be,_0x35833b){var _0x550998=function(_0x4b66ee){while(--_0x4b66ee){_0x4609be['push'](_0x4609be['shift']());}};_0x550998(++_0x35833b);}(_0x2917,0x142));var _0x7291=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x2917[_0xffa198];return _0x1e4b50;};'use strict';var rp=require(_0x7291('0x0'));var url=require(_0x7291('0x1'));var logger=require(_0x7291('0x2'))(_0x7291('0x3'));module[_0x7291('0x4')]=function(_0x398f9f,_0x90e67){var _0x535c15={'method':'POST','uri':url[_0x7291('0x5')](_0x90e67[_0x7291('0x6')],_0x7291('0x7')),'form':{'grant_type':_0x7291('0x8'),'username':_0x90e67[_0x7291('0x9')],'password':_0x90e67[_0x7291('0x8')]},'json':!![]};return rp(_0x535c15)[_0x7291('0xa')](function(_0x1f0fd8){var _0x452fc5={'method':_0x7291('0xb'),'uri':url[_0x7291('0x5')](_0x90e67[_0x7291('0xc')],_0x7291('0xd')),'body':{'type':_0x90e67[_0x7291('0xe')]||_0x7291('0xf'),'channelId':'Nda','conversation':{'id':_0x398f9f[_0x7291('0x10')]},'from':{'id':_0x398f9f[_0x7291('0x11')],'name':_0x398f9f[_0x7291('0x12')]},'recipient':{'id':_0x398f9f[_0x7291('0x13')],'name':_0x398f9f[_0x7291('0x14')]},'text':_0x90e67[_0x7291('0x15')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1f0fd8['access_token']},'json':!![]};if(_0x90e67[_0x7291('0x16')]){_0x452fc5[_0x7291('0x17')][_0x7291('0x18')][_0x7291('0x19')]=_0x90e67[_0x7291('0x16')];}if(_0x90e67[_0x7291('0x1a')]=='1'){_0x452fc5[_0x7291('0x17')]['channelData'][_0x7291('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7291('0x1c')};}if(_0x90e67[_0x7291('0x1d')]){_0x452fc5['body']['channelData'][_0x7291('0x1e')]=_0x90e67[_0x7291('0x1d')];if(_0x90e67[_0x7291('0x1f')]){_0x452fc5[_0x7291('0x17')][_0x7291('0x18')][_0x7291('0x20')]=_0x90e67['custom_action_data'];}}logger[_0x7291('0x21')](JSON[_0x7291('0x22')](_0x452fc5));return rp(_0x452fc5);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index e452ee5..62c9423 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe992=['exports','./lib/api'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xe992,0xf1));var _0x2e99=function(_0x5c4375,_0x2766c3){_0x5c4375=_0x5c4375-0x0;var _0x3369d6=_0xe992[_0x5c4375];return _0x3369d6;};'use strict';var asr=require(_0x2e99('0x0'));module[_0x2e99('0x1')]=function(_0x31ecdc,_0xa7744a,_0x4fab32,_0x1e0f91){return asr(_0x31ecdc,_0xa7744a,_0x4fab32,_0x1e0f91);}; \ No newline at end of file +var _0x682a=['exports'];(function(_0x5c5f42,_0x4196a4){var _0x320536=function(_0x52921b){while(--_0x52921b){_0x5c5f42['push'](_0x5c5f42['shift']());}};_0x320536(++_0x4196a4);}(_0x682a,0x148));var _0xa682=function(_0x382b5d,_0x540ca7){_0x382b5d=_0x382b5d-0x0;var _0x4f4102=_0x682a[_0x382b5d];return _0x4f4102;};'use strict';var asr=require('./lib/api');module[_0xa682('0x0')]=function(_0x10072b,_0x66b290,_0x3947f1,_0x340af1){return asr(_0x10072b,_0x66b290,_0x3947f1,_0x340af1);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index fbac6bb..66da821 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cbb=['sha1','update','digest','hex','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash'];(function(_0x4ec91d,_0x42e568){var _0x5aa6f8=function(_0x1c1e70){while(--_0x1c1e70){_0x4ec91d['push'](_0x4ec91d['shift']());}};_0x5aa6f8(++_0x42e568);}(_0x2cbb,0x96));var _0xb2cb=function(_0x100338,_0x5cdbcc){_0x100338=_0x100338-0x0;var _0x330d32=_0x2cbb[_0x100338];return _0x330d32;};'use strict';var BPromise=require('bluebird');var _=require(_0xb2cb('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb2cb('0x1'));var crypto=require(_0xb2cb('0x2'));var logger=require(_0xb2cb('0x3'))(_0xb2cb('0x4'));module[_0xb2cb('0x5')]=function(_0xd1e58c,_0x2e4190,_0x4ee1bd,_0x149f0a){return new BPromise(function(_0x1d9f91,_0x599606){logger[_0xb2cb('0x6')](_0xb2cb('0x7'),_0x149f0a||_0xb2cb('0x8'));var _0x364042=new WebSocket(_0x149f0a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x459b93='';var _0x3a351a='0';var _0xf36744='1';var _0x45f443='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x57a13f(_0x155e5c){var _0x8b3b50=crypto[_0xb2cb('0x9')](_0xb2cb('0xa'));_0x8b3b50[_0xb2cb('0xb')](_0x155e5c);return _0x8b3b50[_0xb2cb('0xc')](_0xb2cb('0xd'));}function _0x162855(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x141484=moment()['unix']();var _0x500fc7=_0x57a13f(_0x141484+_0x2e4190+_0x4ee1bd);_0x364042[_0xb2cb('0xe')](JSON[_0xb2cb('0xf')]({'appID':_0x2e4190,'timestamp':_0x141484,'appKey':_0x500fc7}));var _0x2854d8=fs[_0xb2cb('0x10')](_0xd1e58c);_0x2854d8['on'](_0xb2cb('0x11'),function(_0x3b5ee3){_0x364042['send'](_0x3b5ee3);});_0x2854d8['on'](_0xb2cb('0x12'),function(){_0x364042[_0xb2cb('0xe')](_0xb2cb('0x13'));});}catch(_0x341da4){logger[_0xb2cb('0x14')](_0xb2cb('0x15'),JSON[_0xb2cb('0xf')](_0x341da4));_0x364042[_0xb2cb('0x16')]();}}function _0x1d23b1(_0x277c8e){try{if(_0x277c8e){var _0x188e9d=JSON[_0xb2cb('0x17')](_0x277c8e);switch(_0x188e9d[_0xb2cb('0x18')]){case 0x0:if(_0x188e9d['result']){if(_0x188e9d[_0xb2cb('0x19')]['final']){logger[_0xb2cb('0x6')](_0xb2cb('0x1a'),JSON[_0xb2cb('0xf')](_0x188e9d[_0xb2cb('0x19')][_0xb2cb('0x1b')]));_0x459b93=_0x188e9d['result'][_0xb2cb('0x1b')][0x0][_0xb2cb('0x1c')];_0x3a351a=_0x188e9d['result'][_0xb2cb('0x1b')][0x0][_0xb2cb('0x1d')];_0xf36744='0';_0x45f443=_0xb2cb('0x1e');_0x364042[_0xb2cb('0x16')]();}}break;case 0x1:logger[_0xb2cb('0x6')](_0xb2cb('0x1f'));_0xf36744='1';_0x45f443=_0xb2cb('0x1f');break;case 0x2:logger[_0xb2cb('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0xf36744='2';_0x45f443=_0xb2cb('0x20');break;case 0x9:logger[_0xb2cb('0x6')](_0xb2cb('0x21'));_0xf36744='9';_0x45f443=_0xb2cb('0x21');break;case 0xa:logger[_0xb2cb('0x6')](_0xb2cb('0x22'));_0xf36744='10';_0x45f443=_0xb2cb('0x22');break;case 0xb:logger['info'](_0xb2cb('0x23'));_0xf36744='11';_0x45f443=_0xb2cb('0x23');}}}catch(_0x320458){logger[_0xb2cb('0x14')](_0xb2cb('0x24'),JSON[_0xb2cb('0xf')](_0x320458));_0x364042[_0xb2cb('0x16')]();}}function _0x5aee6a(){logger[_0xb2cb('0x6')](_0xb2cb('0x25'));_0x1d9f91({'transcript':_0x459b93,'confidence':_0x3a351a,'status':_0xf36744,'status_message':_0x45f443});}function _0x97320(_0x28ce3b){logger[_0xb2cb('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xb2cb('0x26')](_0x28ce3b)){logger[_0xb2cb('0x14')](_[_0xb2cb('0x27')](_0x28ce3b)?JSON['stringify'](_0x28ce3b):_0x28ce3b);}}_0x364042['on']('open',_0x162855);_0x364042['on']('message',_0x1d23b1);_0x364042['on'](_0xb2cb('0x12'),_0x5aee6a);_0x364042['on']('error',_0x97320);});}; \ No newline at end of file +var _0xf52b=['moment','crypto','../../../../../../config/logger','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','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','info','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','open','message','bluebird'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0xf52b,0x71));var _0xbf52=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xf52b[_0x2160a9];return _0xa88cf7;};'use strict';var BPromise=require(_0xbf52('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xbf52('0x1'));var crypto=require(_0xbf52('0x2'));var logger=require(_0xbf52('0x3'))('agi');module[_0xbf52('0x4')]=function(_0x58faa5,_0x1f1433,_0xf8dc65,_0x7cf53){return new BPromise(function(_0x5ab372,_0x307c15){logger['info'](_0xbf52('0x5'),_0x7cf53||_0xbf52('0x6'));var _0x4974f=new WebSocket(_0x7cf53||_0xbf52('0x6'),{'perMessageDeflate':![]});var _0x2d5458='';var _0x45247d='0';var _0x41f583='1';var _0x1bba74=_0xbf52('0x7');function _0x3ebe4c(_0x16c2a3){var _0x4d636b=crypto[_0xbf52('0x8')]('sha1');_0x4d636b[_0xbf52('0x9')](_0x16c2a3);return _0x4d636b[_0xbf52('0xa')]('hex');}function _0x203263(){try{logger['info'](_0xbf52('0xb'));var _0xd12888=moment()[_0xbf52('0xc')]();var _0x47dd58=_0x3ebe4c(_0xd12888+_0x1f1433+_0xf8dc65);_0x4974f[_0xbf52('0xd')](JSON[_0xbf52('0xe')]({'appID':_0x1f1433,'timestamp':_0xd12888,'appKey':_0x47dd58}));var _0xa71170=fs[_0xbf52('0xf')](_0x58faa5);_0xa71170['on'](_0xbf52('0x10'),function(_0xcad999){_0x4974f[_0xbf52('0xd')](_0xcad999);});_0xa71170['on'](_0xbf52('0x11'),function(){_0x4974f[_0xbf52('0xd')](_0xbf52('0x12'));});}catch(_0x1a4af6){logger[_0xbf52('0x13')](_0xbf52('0x14'),JSON[_0xbf52('0xe')](_0x1a4af6));_0x4974f[_0xbf52('0x15')]();}}function _0x5a7a36(_0x366275){try{if(_0x366275){var _0x4c9b64=JSON[_0xbf52('0x16')](_0x366275);switch(_0x4c9b64[_0xbf52('0x17')]){case 0x0:if(_0x4c9b64[_0xbf52('0x18')]){if(_0x4c9b64[_0xbf52('0x18')][_0xbf52('0x19')]){logger[_0xbf52('0x1a')]('Tilde\x20ASR\x20hypoteses',JSON[_0xbf52('0xe')](_0x4c9b64[_0xbf52('0x18')][_0xbf52('0x1b')]));_0x2d5458=_0x4c9b64['result']['hypotheses'][0x0][_0xbf52('0x1c')];_0x45247d=_0x4c9b64['result']['hypotheses'][0x0][_0xbf52('0x1d')];_0x41f583='0';_0x1bba74='Success.';_0x4974f[_0xbf52('0x15')]();}}break;case 0x1:logger[_0xbf52('0x1a')](_0xbf52('0x7'));_0x41f583='1';_0x1bba74=_0xbf52('0x7');break;case 0x2:logger['info'](_0xbf52('0x1e'));_0x41f583='2';_0x1bba74=_0xbf52('0x1e');break;case 0x9:logger['info'](_0xbf52('0x1f'));_0x41f583='9';_0x1bba74='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xbf52('0x1a')](_0xbf52('0x20'));_0x41f583='10';_0x1bba74=_0xbf52('0x20');break;case 0xb:logger[_0xbf52('0x1a')](_0xbf52('0x21'));_0x41f583='11';_0x1bba74=_0xbf52('0x21');}}}catch(_0x87fb8d){logger['error'](_0xbf52('0x22'),JSON['stringify'](_0x87fb8d));_0x4974f[_0xbf52('0x15')]();}}function _0x1e27f0(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x5ab372({'transcript':_0x2d5458,'confidence':_0x45247d,'status':_0x41f583,'status_message':_0x1bba74});}function _0x480cf2(_0x6e0a37){logger[_0xbf52('0x13')](_0xbf52('0x23'));if(!_['isNil'](_0x6e0a37)){logger[_0xbf52('0x13')](_['isObject'](_0x6e0a37)?JSON[_0xbf52('0xe')](_0x6e0a37):_0x6e0a37);}}_0x4974f['on'](_0xbf52('0x24'),_0x203263);_0x4974f['on'](_0xbf52('0x25'),_0x5a7a36);_0x4974f['on'](_0xbf52('0x11'),_0x1e27f0);_0x4974f['on'](_0xbf52('0x13'),_0x480cf2);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index bf1e082..4ecf63e 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88c4=['exports'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0x88c4,0x1a3));var _0x488c=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0x88c4[_0x238830];return _0x5917f0;};var asr=require('./asr');module[_0x488c('0x0')]={'asr':asr}; \ No newline at end of file +var _0x6937=['exports','./asr'];(function(_0x4e85cf,_0x18bbbb){var _0x384d11=function(_0x2f3761){while(--_0x2f3761){_0x4e85cf['push'](_0x4e85cf['shift']());}};_0x384d11(++_0x18bbbb);}(_0x6937,0x9b));var _0x7693=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x6937[_0x39e84d];return _0x1991bc;};var asr=require(_0x7693('0x0'));module[_0x7693('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4598f5f..cd9b3f3 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0xe0c564,_0x2ff569){var _0x32e0f6=function(_0x3fd0fc){while(--_0x3fd0fc){_0xe0c564['push'](_0xe0c564['shift']());}};_0x32e0f6(++_0x2ff569);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index b96c430..15432b9 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf14=['Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','agentPause','playback','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','sayDigits','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','bcc','subject','template_id','debug','sendMail\x20message','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','no\x20variable\x20selected','join','exports','util','shelljs','odbc','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','extension','priority','accountcode','file','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','method','timeout','number','includes','POST','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','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','text','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','tildeASR','appid','uri','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','isArray','split','replaceAll','extra','getAndSetVariable','result','setVariable','maxRetry','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','no\x20list\x20selected','add','delay','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','dial','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','Executed\x20command\x20%s','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s'];(function(_0x2c4822,_0x424e11){var _0x520bef=function(_0x3504a9){while(--_0x3504a9){_0x2c4822['push'](_0x2c4822['shift']());}};_0x520bef(++_0x424e11);}(_0xcf14,0xa1));var _0x4cf1=function(_0x2c5f01,_0xdfd2f5){_0x2c5f01=_0x2c5f01-0x0;var _0x481aa7=_0xcf14[_0x2c5f01];return _0x481aa7;};'use strict';var fs=require('fs');var util=require(_0x4cf1('0x0'));var _=require('lodash');var sh=require(_0x4cf1('0x1'));var odbc=require(_0x4cf1('0x2'))();var rs=require('randomstring');var moment=require(_0x4cf1('0x3'));var Mustache=require(_0x4cf1('0x4'));var rp=require(_0x4cf1('0x5'));var logger=require(_0x4cf1('0x6'))('agi');var config=require(_0x4cf1('0x7'));var shared=require(_0x4cf1('0x8'));var scripts=require(_0x4cf1('0x9'));var FILES_PATH=_0x4cf1('0xa');var recursiveMapAttributes=[_0x4cf1('0xb'),_0x4cf1('0xc')];var verticesWithRetry=[_0x4cf1('0xd'),'getdigits',_0x4cf1('0xe')];var AGIVertices=function(_0x208cdd,_0x46c2de,_0x37db9f){this[_0x4cf1('0xf')]=_0x208cdd;this[_0x4cf1('0x10')]=_0x46c2de;this[_0x4cf1('0x11')]=_0x37db9f;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x13')]=function(_0x28af26,_0x26d254){this[_0x4cf1('0x10')][_0x4cf1('0x14')](_0x28af26)[_0x4cf1('0x15')](function(_0x592557){_0x26d254(null,_0x592557?_0x592557[_0x4cf1('0x16')]:![]);})[_0x4cf1('0x17')](function(_0x1ae8fb){_0x26d254(_0x1ae8fb);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x18')]=function(_0x16bae8,_0x10abde){this[_0x4cf1('0x10')][_0x4cf1('0x19')](_0x16bae8)[_0x4cf1('0x15')](function(_0x3e320f){_0x10abde(null,_0x3e320f?_0x3e320f[_0x4cf1('0x16')]:![]);})[_0x4cf1('0x17')](function(_0x2a8cf7){_0x10abde(_0x2a8cf7);});};AGIVertices[_0x4cf1('0x12')]['getSquareProject']=function(_0x3e3cd8,_0x527dca){this[_0x4cf1('0x10')][_0x4cf1('0x1a')](_0x3e3cd8)[_0x4cf1('0x15')](function(_0x1f20c0){_0x527dca(null,_0x1f20c0?_0x1f20c0[_0x4cf1('0x16')]:![]);})['catch'](function(_0x4499f7){_0x527dca(_0x4499f7);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1b')]=function(_0x4557e0,_0x52b5a2){this['rpc'][_0x4cf1('0x1c')](_0x4557e0)[_0x4cf1('0x15')](function(_0x5603ae){_0x52b5a2(null,_0x5603ae?_0x5603ae[_0x4cf1('0x1d')]:![]);})[_0x4cf1('0x17')](function(_0x3cc036){_0x52b5a2(_0x3cc036);});};AGIVertices[_0x4cf1('0x12')]['getUser']=function(_0x3469ac,_0x158000){this[_0x4cf1('0x10')][_0x4cf1('0x1e')](_0x3469ac)[_0x4cf1('0x15')](function(_0x2945b4){_0x158000(null,_0x2945b4?_0x2945b4['name']:![]);})[_0x4cf1('0x17')](function(_0x5bb535){_0x158000(_0x5bb535);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1f')]=function(_0x1b0ad4,_0x371fac){this[_0x4cf1('0x10')][_0x4cf1('0x20')](_0x1b0ad4)[_0x4cf1('0x15')](function(_0x326ca6){_0x371fac(null,_0x326ca6?_0x326ca6[_0x4cf1('0x16')]:![]);})[_0x4cf1('0x17')](function(_0x395f52){_0x371fac(_0x395f52);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x21')]=function(_0x4bcd78,_0x4498b5){var _0x1ccc90=this;this[_0x4cf1('0x10')][_0x4cf1('0x22')](_0x4bcd78)[_0x4cf1('0x15')](function(_0x27d360){_0x4498b5(null,_0x27d360?_0x1ccc90[_0x4cf1('0x23')](_0x27d360[_0x4cf1('0x24')]):![]);})[_0x4cf1('0x17')](function(_0x1e8dbf){_0x4498b5(_0x1e8dbf);});};AGIVertices[_0x4cf1('0x12')]['getMailAccount']=function(_0x18232e,_0x167da0){this['rpc'][_0x4cf1('0x25')](_0x18232e)[_0x4cf1('0x15')](function(_0x29f111){_0x167da0(null,_0x29f111?_0x29f111:![]);})[_0x4cf1('0x17')](function(_0x1fab26){_0x167da0(_0x1fab26);});};AGIVertices[_0x4cf1('0x12')]['sendMailMessage']=function(_0x3763f5,_0x59d7ae,_0x31758b){this[_0x4cf1('0x11')][_0x4cf1('0x26')](_0x3763f5,_0x59d7ae)[_0x4cf1('0x15')](function(){_0x31758b(null);})[_0x4cf1('0x17')](function(_0x5e298f){_0x31758b(_0x5e298f);});};AGIVertices[_0x4cf1('0x12')]['getIntervals']=function(_0x59ba8f,_0x47dd9b){this[_0x4cf1('0x10')][_0x4cf1('0x27')](_0x59ba8f)[_0x4cf1('0x15')](function(_0x3e938b){if(_0x3e938b){if(_0x3e938b[_0x4cf1('0x28')]){_0x47dd9b(null,[_0x3e938b[_0x4cf1('0x29')]]);}else{_0x47dd9b(null,_[_0x4cf1('0x2a')](_0x3e938b[_0x4cf1('0x2b')],'interval'));}}else{_0x47dd9b(null,![]);}})['catch'](function(_0x48d93a){_0x47dd9b(_0x48d93a);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x23')]=function(_0xb0d56a){return util[_0x4cf1('0x2c')](_0x4cf1('0x2d'),FILES_PATH,_0xb0d56a);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x2e')]=function(_0x576ef2,_0x102e1a,_0x6a0a06){odbc[_0x4cf1('0x2f')](_0x576ef2,function(_0x38637f){if(_0x38637f){logger[_0x4cf1('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x38637f);_0x6a0a06(_0x38637f);}else{logger['info'](_0x4cf1('0x31'));odbc[_0x4cf1('0x32')](_0x102e1a,function(_0x835dd6,_0x2ec283){if(_0x835dd6){logger[_0x4cf1('0x33')](_0x4cf1('0x34'),_0x102e1a);_0x6a0a06(_0x835dd6);}else{logger[_0x4cf1('0x33')]('Query\x20executed\x20correctly\x20%s',_0x102e1a);odbc[_0x4cf1('0x35')](function(_0x7c23a0){if(_0x7c23a0){logger[_0x4cf1('0x30')](_0x4cf1('0x36'),_0x7c23a0);}_0x6a0a06(null,_0x2ec283);});}});}});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x37')]=function(_0x483961,_0x5348f5){this[_0x4cf1('0x10')][_0x4cf1('0x38')](_0x483961)[_0x4cf1('0x15')](function(_0x45f90f){_0x5348f5(null,_0x45f90f?_0x45f90f:![]);})[_0x4cf1('0x17')](function(_0x43d336){_0x5348f5(_0x43d336);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x39')]=function(_0x29f7a5,_0x3cd153){this[_0x4cf1('0x10')]['createSmsMessage'](_0x29f7a5)[_0x4cf1('0x15')](function(_0x2f3f00){_0x3cd153(null,_0x2f3f00);})['catch'](function(_0x25f111){_0x3cd153(_0x25f111);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x3a')]=function(_0xc2b163,_0x2b2ee4,_0x5a4078){this[_0x4cf1('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x4cf1('0x3b')],'node':_0xc2b163[_0x4cf1('0x3c')],'application':_0xc2b163[_0x4cf1('0x3d')],'data':_0x2b2ee4||null,'project_name':this[_0x4cf1('0xf')][_0x4cf1('0x3e')],'callerid':this[_0x4cf1('0xf')][_0x4cf1('0x3f')]})[_0x4cf1('0x15')](function(_0x1567cb){if(_0x5a4078){_0x5a4078(null,_0x1567cb);}})[_0x4cf1('0x17')](function(_0x1defca){if(_0x5a4078){_0x5a4078(_0x1defca);}});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x40')]=function(_0x2133fe,_0xa90309,_0x20a5a2,_0x4986fc){this[_0x4cf1('0x10')][_0x4cf1('0x40')]({'uniqueid':this[_0x4cf1('0xf')][_0x4cf1('0x3b')],'callerid':this[_0x4cf1('0xf')][_0x4cf1('0x3f')],'calleridname':this[_0x4cf1('0xf')]['calleridname'],'context':this[_0x4cf1('0xf')]['context'],'extension':this[_0x4cf1('0xf')][_0x4cf1('0x41')],'priority':this[_0x4cf1('0xf')][_0x4cf1('0x42')],'accountcode':this[_0x4cf1('0xf')][_0x4cf1('0x43')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0x4cf1('0x3e')],'saveName':_0xa90309,'filename':_0x2133fe[_0x4cf1('0x44')]||_0xa90309,'savePath':_0x20a5a2})[_0x4cf1('0x15')](function(_0x58c3cd){_0x4986fc(null,_0x58c3cd);})[_0x4cf1('0x17')](function(_0x267036){_0x4986fc(_0x267036);});};AGIVertices['prototype'][_0x4cf1('0x45')]=function(_0x3e3e5d,_0x1f228b,_0xcef16d,_0x248fb3,_0x5b6fb5){this[_0x4cf1('0x10')][_0x4cf1('0x45')]({'uniqueid':this[_0x4cf1('0xf')][_0x4cf1('0x3b')],'body':_0x3e3e5d,'direction':_0x1f228b,'providerName':_0xcef16d,'providerResponse':_0x248fb3})[_0x4cf1('0x15')](function(_0x4f7adf){if(_0x5b6fb5){_0x5b6fb5(null,_0x4f7adf);}})[_0x4cf1('0x17')](function(_0x2c1811){if(_0x5b6fb5){_0x5b6fb5(_0x2c1811);}});};AGIVertices['prototype']['createCmContact']=function(_0x5ac7d2,_0x2eda02){this[_0x4cf1('0x10')][_0x4cf1('0x46')]({'firstName':_['isEmpty'](_0x5ac7d2[_0x4cf1('0x16')])||_[_0x4cf1('0x47')](_0x5ac7d2[_0x4cf1('0x16')])?'callback_'+Math[_0x4cf1('0x48')]():_0x5ac7d2[_0x4cf1('0x16')],'lastName':_[_0x4cf1('0x49')](_0x5ac7d2[_0x4cf1('0x4a')])||_['isNil'](_0x5ac7d2[_0x4cf1('0x4a')])?null:_0x5ac7d2[_0x4cf1('0x4a')],'phone':_0x5ac7d2['phone'],'ListId':_0x5ac7d2[_0x4cf1('0x4b')],'scheduledat':_0x5ac7d2[_0x4cf1('0x4c')],'callbackUniqueid':this[_0x4cf1('0xf')]['uniqueid'],'tags':_0x4cf1('0x4d'),'description':_0x4cf1('0x4e')+_0x5ac7d2[_0x4cf1('0x4c')][_0x4cf1('0x4f')](),'priority':_0x5ac7d2[_0x4cf1('0x50')]})[_0x4cf1('0x15')](function(_0x2d161f){_0x2eda02(null,_0x2d161f);})['catch'](function(_0x5bc4c9){_0x2eda02(_0x5bc4c9);});};AGIVertices[_0x4cf1('0x12')]['getPause']=function(_0x3d38c8,_0x39b15a){this[_0x4cf1('0x10')][_0x4cf1('0x51')](_0x3d38c8)[_0x4cf1('0x15')](function(_0x23938e){_0x39b15a(null,_0x23938e?_0x23938e[_0x4cf1('0x16')]:![]);})['catch'](function(_0x25b070){_0x39b15a(_0x25b070);});};AGIVertices[_0x4cf1('0x12')]['agentPause']=function(_0x38aa06,_0xa92bc0,_0xa56dc9){var _0x5a4872={'role':_0x4cf1('0x52')};_0x5a4872[_0x38aa06]=this[_0x4cf1('0xf')][_0x4cf1('0x3f')];this[_0x4cf1('0x10')]['agentPause'](_0x5a4872,_0xa92bc0,this['channel'][_0x4cf1('0x3b')])[_0x4cf1('0x15')](function(_0x514657){_0xa56dc9(null,_[_0x4cf1('0x47')](_0x514657)?![]:!![]);})[_0x4cf1('0x17')](function(_0x3f6973){logger['error'](_0x3f6973);_0xa56dc9(null,![]);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x53')]=function(_0x80fec5,_0x572091){var _0x14a7d6={'role':_0x4cf1('0x52')};_0x14a7d6[_0x80fec5]=this[_0x4cf1('0xf')][_0x4cf1('0x3f')];this['rpc'][_0x4cf1('0x53')](_0x14a7d6)['then'](function(_0x586662){_0x572091(null,_[_0x4cf1('0x47')](_0x586662)?![]:!![]);})[_0x4cf1('0x17')](function(_0x18cc9f){logger[_0x4cf1('0x30')](_0x18cc9f);_0x572091(null,![]);});};AGIVertices['prototype'][_0x4cf1('0x54')]=function(_0x1db02d,_0x35001f){var _0x4ca89f={'role':'agent'};_0x4ca89f[_0x1db02d]=this[_0x4cf1('0xf')][_0x4cf1('0x3f')];this['rpc'][_0x4cf1('0x54')](_0x4ca89f)['then'](function(_0x2f8d03){_0x35001f(null,_[_0x4cf1('0x47')](_0x2f8d03)?![]:!![]);})[_0x4cf1('0x17')](function(_0x163fea){logger[_0x4cf1('0x30')](_0x163fea);_0x35001f(null,![]);});};AGIVertices['prototype'][_0x4cf1('0x55')]=function(_0x40c37e,_0x283424){var _0x3f711e={'role':_0x4cf1('0x52')};_0x3f711e[_0x40c37e]=this['channel'][_0x4cf1('0x3f')];var _0x4d2977=_0x40c37e!='internal'?util[_0x4cf1('0x2c')](_0x4cf1('0x56'),_0x4cf1('0x57'),this['channel'][_0x4cf1('0x3f')]):undefined;this[_0x4cf1('0x10')][_0x4cf1('0x55')](_0x3f711e,_0x4d2977)[_0x4cf1('0x15')](function(_0x2a12c7){_0x283424(null,_[_0x4cf1('0x47')](_0x2a12c7)?![]:!![]);})[_0x4cf1('0x17')](function(_0x516862){logger[_0x4cf1('0x30')](_0x516862);_0x283424(null,![]);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x58')]=function(_0x5b19ec,_0x1e831f){sh[_0x4cf1('0x59')](_[_0x4cf1('0x5a')](_0x5b19ec),function(_0x191ee7,_0x48ec33){var _0x3d3c4f=_0x48ec33[_0x4cf1('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1e831f(null,_0x3d3c4f);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x4beb0d,_0x1b204f){scripts[_0x4cf1('0x5c')](_0x4beb0d[_0x4cf1('0x5d')],_0x4beb0d['google_cloud_tts_text_type']||'text',_0x4beb0d['text'],_0x4beb0d[_0x4cf1('0x5e')]||_0x4cf1('0x5f'),_0x4beb0d[_0x4cf1('0x60')]||_0x4cf1('0x61'),_0x4beb0d[_0x4cf1('0x62')]||_0x4cf1('0x63'))['then'](function(_0x123d5a){_0x1b204f(null,_0x123d5a);})['catch'](function(_0x4987e2){_0x1b204f(_0x4987e2);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x64')]=function(_0x15fc9e,_0x3bafc2){scripts['googleTTS'](_0x15fc9e['text'],_0x15fc9e['google_tts_language']||'en',0x1)['then'](function(_0xcf5d72){_0x3bafc2(null,_0xcf5d72);})[_0x4cf1('0x17')](function(_0x472086){_0x3bafc2(_0x472086);});};AGIVertices[_0x4cf1('0x12')]['restAPI']=function(_0x39c455,_0x21c22d){var _0x4ac9b6={'uri':_0x39c455['url'],'method':_0x39c455[_0x4cf1('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x39c455[_0x4cf1('0x66')])===_0x4cf1('0x67')&&parseInt(_0x39c455[_0x4cf1('0x66')])>=0x1?parseInt(_0x39c455[_0x4cf1('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x4cf1('0x68')]([_0x4cf1('0x69'),'PUT'],_0x4ac9b6['method'][_0x4cf1('0x6a')]())){try{_0x4ac9b6[_0x4cf1('0x6b')]=_0x39c455[_0x4cf1('0xc')]?JSON[_0x4cf1('0x6c')](_0x39c455[_0x4cf1('0xc')]):{};}catch(_0x5e5769){logger[_0x4cf1('0x30')](_0x4cf1('0x6d'),_0x5e5769);}}try{_0x4ac9b6['headers']=_0x39c455[_0x4cf1('0xb')]?JSON[_0x4cf1('0x6c')](_0x39c455[_0x4cf1('0xb')]):{};}catch(_0x1c1eb9){logger['error'](_0x4cf1('0x6e'),_0x1c1eb9);}if(_0x39c455[_0x4cf1('0x6f')]){try{var _0x64e59e=require(_0x39c455[_0x4cf1('0x6f')])[_0x4cf1('0x70')](this,_0x4ac9b6);_0x4ac9b6['uri']=Mustache[_0x4cf1('0x71')](_0x39c455[_0x4cf1('0x72')],_0x64e59e,{},['$$','$$']);if(_0x4ac9b6[_0x4cf1('0x73')]){_0x4ac9b6[_0x4cf1('0x73')]=JSON[_0x4cf1('0x6c')](Mustache[_0x4cf1('0x71')](JSON[_0x4cf1('0x74')](_0x4ac9b6[_0x4cf1('0x73')]),_0x64e59e,{},['$$','$$']));}if(_0x4ac9b6['body']){_0x4ac9b6['body']=JSON[_0x4cf1('0x6c')](Mustache[_0x4cf1('0x71')](JSON[_0x4cf1('0x74')](_0x4ac9b6[_0x4cf1('0x6b')]),_0x64e59e,{},['$$','$$']));}}catch(_0x4d1ce3){logger[_0x4cf1('0x30')](_0x4cf1('0x75'),_0x4d1ce3);}}rp(_0x4ac9b6)[_0x4cf1('0x15')](function(_0x250d1e){var _0x5b6053={'statusCode':_0x250d1e[_0x4cf1('0x76')]||0xc8,'statusMessage':_0x250d1e[_0x4cf1('0x77')]||'OK','headers':_0x250d1e['headers']||{},'body':_0x250d1e[_0x4cf1('0x6b')]||{}};_0x21c22d(null,_0x5b6053);})['catch'](function(_0x24bfbe){var _0x312dc2={'statusCode':_0x24bfbe['statusCode']||0x1f4,'statusMessage':_0x24bfbe[_0x4cf1('0x78')]||_0x4cf1('0x79'),'headers':_0x24bfbe[_0x4cf1('0x7a')]['headers']||{},'body':_0x24bfbe[_0x4cf1('0x7a')][_0x4cf1('0x6b')]||{}};_0x21c22d(null,_0x312dc2);});};AGIVertices[_0x4cf1('0x12')]['googleDialogflow']=function(_0x27338e,_0x2763b7){scripts[_0x4cf1('0x7b')](this[_0x4cf1('0xf')][_0x4cf1('0x3b')],_0x27338e[_0x4cf1('0x7c')],_0x27338e[_0x4cf1('0x7d')],_0x27338e[_0x4cf1('0x7e')]||'en')[_0x4cf1('0x15')](function(_0x3fabec){_0x2763b7(null,_0x3fabec);})[_0x4cf1('0x17')](function(_0x11b4cc){_0x2763b7(_0x11b4cc);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x4d5177,_0x56f963){scripts[_0x4cf1('0x7f')](this[_0x4cf1('0xf')][_0x4cf1('0x3b')],_0x4d5177[_0x4cf1('0x80')],_0x4d5177[_0x4cf1('0x81')],_0x4d5177[_0x4cf1('0x82')],_0x4d5177[_0x4cf1('0x7d')],_0x4d5177['dialogflowV2_language']||'en')[_0x4cf1('0x15')](function(_0x2ebe0a){_0x56f963(null,_0x2ebe0a);})[_0x4cf1('0x17')](function(_0x1023d2){_0x56f963(_0x1023d2);});};AGIVertices['prototype'][_0x4cf1('0x83')]=function(_0x1cde5e,_0x7822d4){scripts[_0x4cf1('0x83')](this[_0x4cf1('0xf')],_0x1cde5e)[_0x4cf1('0x15')](function(_0xd01710){_0x7822d4(null,_0xd01710);})[_0x4cf1('0x17')](function(_0x29ca5f){_0x7822d4(_0x29ca5f);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x84')]=function(_0x341ed9,_0x59bc13){scripts[_0x4cf1('0x84')](_0x341ed9[_0x4cf1('0x7c')],_0x341ed9['text'],_0x341ed9[_0x4cf1('0x85')]||_0x4cf1('0x5f'),_0x341ed9['speed'])[_0x4cf1('0x15')](function(_0x46bfa9){_0x59bc13(null,_0x46bfa9);})[_0x4cf1('0x17')](function(_0x3d9a48){_0x59bc13(_0x3d9a48);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x86')]=function(_0x109217,_0x43f97,_0x31622b){scripts[_0x4cf1('0x86')](_0x43f97,_0x109217[_0x4cf1('0x7c')],_0x109217['ispeech_asr_language']||_0x4cf1('0x5f'),this[_0x4cf1('0x87')](_0x109217[_0x4cf1('0x88')])?_0x109217[_0x4cf1('0x88')]:undefined)['then'](function(_0x3d6c3b){_0x31622b(null,_0x3d6c3b);})[_0x4cf1('0x17')](function(_0x1c6ee7){_0x31622b(_0x1c6ee7);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x89')]=function(_0x4e0bfd,_0xa4b2c1){scripts[_0x4cf1('0x89')](_0x4e0bfd[_0x4cf1('0x8a')],_0x4e0bfd[_0x4cf1('0x8b')],_0x4e0bfd['aws_polly_region'],_0x4e0bfd[_0x4cf1('0x8c')]||_0x4cf1('0x8d'),_0x4e0bfd['text'],_0x4e0bfd[_0x4cf1('0x8e')]||_0x4cf1('0x7d'))['then'](function(_0x24b423){_0xa4b2c1(null,_0x24b423);})[_0x4cf1('0x17')](function(_0x52d857){_0xa4b2c1(_0x52d857);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x8f')]=function(_0x57656f,_0x1248cb){scripts[_0x4cf1('0x8f')](this[_0x4cf1('0xf')][_0x4cf1('0x3b')],_0x57656f[_0x4cf1('0x8a')],_0x57656f[_0x4cf1('0x8b')],_0x57656f['aws_lex_region'],_0x57656f[_0x4cf1('0x7d')],_0x57656f[_0x4cf1('0x90')])[_0x4cf1('0x15')](function(_0x11e17a){_0x1248cb(null,_0x11e17a);})[_0x4cf1('0x17')](function(_0x193cbd){_0x1248cb(_0x193cbd);});};AGIVertices[_0x4cf1('0x12')]['googleASR']=function(_0x3aa868,_0x49138a,_0x144860){scripts['googleASR'](_0x49138a,_0x3aa868[_0x4cf1('0x7c')],_0x3aa868['google_asr_language']||'en-US')['then'](function(_0x78206b){_0x144860(null,_0x78206b);})[_0x4cf1('0x17')](function(_0x4758f5){_0x144860(_0x4758f5);});};AGIVertices[_0x4cf1('0x12')]['tildeASR']=function(_0x179a6d,_0x258337,_0x473185){scripts[_0x4cf1('0x91')](_0x258337,_0x179a6d[_0x4cf1('0x92')],_0x179a6d['appsecret'],_0x179a6d[_0x4cf1('0x93')])[_0x4cf1('0x15')](function(_0xbc50ed){_0x473185(null,_0xbc50ed);})[_0x4cf1('0x17')](function(_0x542b59){_0x473185(_0x542b59);});};AGIVertices[_0x4cf1('0x12')]['clear']=function(_0x1698ca){var _0x4e89af=_[_0x4cf1('0x68')](verticesWithRetry,_0x1698ca[_0x4cf1('0x3d')])?_0x1698ca:_[_0x4cf1('0x94')](_0x1698ca);for(var _0x3a97fb in _0x4e89af){if(_0x4e89af[_0x4cf1('0x95')](_0x3a97fb)){if(_0x4e89af[_0x3a97fb]&&_[_0x4cf1('0x96')](_0x4e89af[_0x3a97fb])){if(_[_0x4cf1('0x68')](recursiveMapAttributes,_0x3a97fb)){_0x4e89af[_0x3a97fb]=this[_0x4cf1('0x97')](_0x4e89af[_0x3a97fb]);}else{_0x4e89af[_0x3a97fb]=this[_0x4cf1('0x98')](_0x4e89af[_0x3a97fb]);}}}}return _0x4e89af;};AGIVertices['prototype'][_0x4cf1('0x99')]=function(_0x3ef1ae){for(var _0x2364b7 in _0x3ef1ae){if(_0x3ef1ae['hasOwnProperty'](_0x2364b7)){if(_[_0x4cf1('0x9a')](_0x3ef1ae[_0x2364b7])){this[_0x4cf1('0x99')](_0x3ef1ae[_0x2364b7]);}else if(_['isArray'](_0x3ef1ae[_0x2364b7])){for(var _0x44642f=0x0;_0x44642f<_0x3ef1ae[_0x2364b7][_0x4cf1('0x9b')];_0x44642f++){this[_0x4cf1('0x99')](_0x3ef1ae[_0x2364b7][_0x44642f]);}}else if(_[_0x4cf1('0x96')](_0x3ef1ae[_0x2364b7])){_0x3ef1ae[_0x2364b7]=this[_0x4cf1('0x98')](_0x3ef1ae[_0x2364b7]);}}}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x9c')]=function(_0x4b3517,_0x67af5){for(var _0xe5be65 in _0x4b3517){if(_0x4b3517['hasOwnProperty'](_0xe5be65)){if(_[_0x4cf1('0x9a')](_0x4b3517[_0xe5be65])){if(!_[_0x4cf1('0x49')](_0x4b3517[_0xe5be65])){this[_0x4cf1('0x9c')](_0x4b3517[_0xe5be65],util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x67af5,_0xe5be65));}}else if(_[_0x4cf1('0x9e')](_0x4b3517[_0xe5be65])){for(var _0xdab395=0x0;_0xdab395<_0x4b3517[_0xe5be65][_0x4cf1('0x9b')];_0xdab395++){this[_0x4cf1('0x9c')](_0x4b3517[_0xe5be65][_0xdab395],util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x67af5,_0xe5be65+'['+_0xdab395+']'));}}else{if(!_[_0x4cf1('0x47')](_0x4b3517[_0xe5be65])){this[_0x4cf1('0xf')]['setVariable'](util[_0x4cf1('0x2c')]('%s.%s',_0x67af5,_0xe5be65),_0x4b3517[_0xe5be65]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x55dcdb){try{var _0x114dbd=JSON[_0x4cf1('0x6c')](_0x55dcdb);this['recursiveNodeIndex'](_0x114dbd);return JSON['stringify'](_0x114dbd);}catch(_0x2ce56a){return this[_0x4cf1('0x98')](_0x55dcdb);}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x98')]=function(_0x5e325f){var _0x21c66f=_0x5e325f[_0x4cf1('0x9f')]('{');for(var _0x54b6fc=0x1;_0x54b6fc<_0x21c66f[_0x4cf1('0x9b')];_0x54b6fc+=0x1){var _0x109974=_0x21c66f[_0x54b6fc][_0x4cf1('0x9f')]('}');if(_0x109974[_0x4cf1('0x9b')]>0x1){_0x5e325f=_0x5e325f[_0x4cf1('0xa0')]('{'+_0x109974[0x0]+'}',this[_0x4cf1('0xf')][_0x4cf1('0x13')](_0x109974[0x0])[_0x4cf1('0xa1')]||_0x109974[0x0]);}}if(_0x21c66f[_0x4cf1('0x9b')]===0x1){return _0x5e325f['toString']();}return this['replaceAllVariables'](_0x5e325f);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xa2')]=function(_0x116912,_0xc4cd70){var _0x3a5f9c=this['channel'][_0x4cf1('0x13')](_0x116912);if(_0x3a5f9c[_0x4cf1('0xa3')]===-0x1){return _0x3a5f9c;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xc4cd70,_0x3a5f9c[_0x4cf1('0xa1')]));return this['channel'][_0x4cf1('0xa4')](_0xc4cd70,_0x3a5f9c[_0x4cf1('0xa1')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x87')]=function(_0x166348){return _0x166348&&_0x166348!=='0'&&_0x166348!=='-1'&&_0x166348!=='';};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xa5')]=function(_0x346744){this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x346744,'-');_0x346744[_0x4cf1('0xa6')]=_0x346744[_0x4cf1('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xa7')]=function(_0x4ef0ca){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x4ef0ca[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x4ef0ca[_0x4cf1('0x7d')])){return this['channel']['noop'](_0x4cf1('0xa8'));}var _0x5d2035='\x22'+_0x4ef0ca[_0x4cf1('0x7d')]+'\x22';if(this['isConfigured'](_0x4ef0ca['options'])){_0x5d2035+=','+_0x4ef0ca[_0x4cf1('0x7a')];}var _0x340bab=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xa9'),_0x5d2035);if(_0x340bab['result']===-0x1){return _0x340bab;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xab'),_0x5d2035));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xac')]=function(_0x553888){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x553888[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x553888['grammar'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20grammar\x20configured');}var _0x33de3d=_0x553888[_0x4cf1('0xad')];if(this[_0x4cf1('0x87')](_0x553888[_0x4cf1('0x7a')])){_0x33de3d+=','+_0x553888['options'];}var _0x527014=this[_0x4cf1('0xf')]['exec'](_0x4cf1('0xae'),_0x33de3d);if(_0x527014[_0x4cf1('0xa3')]===-0x1){return _0x527014;}var _0x54ff20=this[_0x4cf1('0xa2')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x54ff20[_0x4cf1('0xa3')]===-0x1){return _0x54ff20;}var _0x1bad47=this[_0x4cf1('0xa2')](_0x4cf1('0xaf'),_0x4cf1('0xb0'));if(_0x1bad47['result']===-0x1){return _0x1bad47;}var _0x10a502=this[_0x4cf1('0xa2')]('RECOG_INSTANCE()',_0x4cf1('0xb1'));if(_0x10a502[_0x4cf1('0xa3')]===-0x1){return _0x10a502;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xb2'),_0x33de3d));};AGIVertices[_0x4cf1('0x12')]['agi']=function(_0x5adb0d){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0xb3'),_0x5adb0d[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0xb4')]([_0x5adb0d[_0x4cf1('0xb5')],_0x5adb0d[_0x4cf1('0xb6')]]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xb7')]=function(_0x2e31f1){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xb8'),_0x2e31f1[_0x4cf1('0x3c')]));if(this[_0x4cf1('0x87')](_0x2e31f1['timeout'])){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2e31f1['timeout']));var _0x63bfc8=this[_0x4cf1('0xf')][_0x4cf1('0xb9')](_0x2e31f1['timeout']);if(_0x63bfc8['result']===-0x1){return _0x63bfc8;}}return this['channel']['answer']();};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x4d')]=function(_0x48c001){logger[_0x4cf1('0x33')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x48c001[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x48c001[_0x4cf1('0x4b')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x48c001,_0x4cf1('0xba'));}_0x48c001[_0x4cf1('0x4c')]=moment();if(this['isConfigured'](_0x48c001['delay'])){_0x48c001[_0x4cf1('0x4c')]=moment()[_0x4cf1('0xbb')](_0x48c001[_0x4cf1('0xbc')],'minutes');}if(!this['isConfigured'](_0x48c001['callback_priority'])){_0x48c001[_0x4cf1('0x50')]=0x2;}this['createCmContact'][_0x4cf1('0x70')](this,_0x48c001);return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x48c001[_0x4cf1('0xbd')],_0x48c001[_0x4cf1('0x4b')],_0x48c001[_0x4cf1('0x4c')]));};AGIVertices[_0x4cf1('0x12')]['custom_app']=function(_0x445d3e){logger['info'](util['format'](_0x4cf1('0xbe'),_0x445d3e['label']));var _0x21ca4f=this['channel']['exec'](_0x445d3e[_0x4cf1('0xbf')],_0x445d3e[_0x4cf1('0x7a')]);if(_0x21ca4f[_0x4cf1('0xa3')]===-0x1){return _0x21ca4f;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0xc0'),_0x445d3e[_0x4cf1('0xbf')],_0x445d3e['options']));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xc1')]=function(_0x3a3be9){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3a3be9[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x3a3be9[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}var _0x28df1f='\x22'+_0x3a3be9['text']+'\x22';if(this['isConfigured'](_0x3a3be9[_0x4cf1('0x7a')])){_0x28df1f+=','+_0x3a3be9[_0x4cf1('0x7a')];}var _0x371b58=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xa9'),_0x28df1f);if(_0x371b58['result']===-0x1){return _0x371b58;}return this['channel'][_0x4cf1('0xaa')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x28df1f));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xc2')]=function(_0x39c80f){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x39c80f[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x39c80f[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20text\x20configured');}var _0x4b7a38='\x22'+_0x39c80f['text']+'\x22';if(this[_0x4cf1('0x87')](_0x39c80f[_0x4cf1('0x7a')])){_0x4b7a38+=','+_0x39c80f[_0x4cf1('0x7a')];}var _0xd1b0a2=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xa9'),_0x4b7a38);if(_0xd1b0a2[_0x4cf1('0xa3')]===-0x1){return _0xd1b0a2;}return this[_0x4cf1('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4b7a38));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xc3')]=function(_0x83c73e){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xc4'),_0x83c73e[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x83c73e['grammar'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xc5'));}var _0x493078=_0x83c73e[_0x4cf1('0xad')];if(this[_0x4cf1('0x87')](_0x83c73e[_0x4cf1('0x7a')])){_0x493078+=','+_0x83c73e[_0x4cf1('0x7a')];}var _0x14206b=this['channel'][_0x4cf1('0x59')](_0x4cf1('0xae'),_0x493078);if(_0x14206b[_0x4cf1('0xa3')]===-0x1){return _0x14206b;}var _0x2f084a=this[_0x4cf1('0xa2')]('RECOG_CONFIDENCE()',_0x4cf1('0xc6'));if(_0x2f084a[_0x4cf1('0xa3')]===-0x1){return _0x2f084a;}var _0x1561f5=this[_0x4cf1('0xa2')](_0x4cf1('0xaf'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1561f5[_0x4cf1('0xa3')]===-0x1){return _0x1561f5;}var _0x4a00cb=this[_0x4cf1('0xa2')](_0x4cf1('0xc7'),'LUMENVOX_ASR_INSTANCE');if(_0x4a00cb[_0x4cf1('0xa3')]===-0x1){return _0x4a00cb;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xb2'),_0x493078));};AGIVertices['prototype'][_0x4cf1('0xc8')]=function(_0x26db70){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xc9'),_0x26db70[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x26db70['grammar'])){return this[_0x4cf1('0xf')]['noop']('no\x20grammar\x20configured');}var _0x34ba89=_0x26db70['grammar'];if(this['isConfigured'](_0x26db70['options'])){_0x34ba89+=','+_0x26db70['options'];}var _0x59e46c=this[_0x4cf1('0xf')][_0x4cf1('0x59')]('MRCPRecog',_0x34ba89);if(_0x59e46c['result']===-0x1){return _0x59e46c;}var _0x240ca4=this[_0x4cf1('0xa2')](_0x4cf1('0xca'),_0x4cf1('0xcb'));if(_0x240ca4[_0x4cf1('0xa3')]===-0x1){return _0x240ca4;}var _0x1bd248=this[_0x4cf1('0xa2')](_0x4cf1('0xaf'),_0x4cf1('0xcc'));if(_0x1bd248[_0x4cf1('0xa3')]===-0x1){return _0x1bd248;}var _0x3def7f=this['getAndSetVariable'](_0x4cf1('0xc7'),_0x4cf1('0xcd'));if(_0x3def7f[_0x4cf1('0xa3')]===-0x1){return _0x3def7f;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xb2'),_0x34ba89));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xce')]=function(_0x563a03){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0xcf'),_0x563a03['label']));if(!this['isConfigured'](_0x563a03['odbc_id'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,_0x4cf1('0xd0'));}var _0x4b8d38=this[_0x4cf1('0x1b')]['sync'](this,_0x563a03[_0x4cf1('0xd1')]);if(!_0x4b8d38){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,_0x4cf1('0xd2'));}if(!this['isConfigured'](_0x563a03[_0x4cf1('0x32')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,_0x4cf1('0xd3'));}var _0x1f62d9=_0x563a03['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x4cf1('0xaa')](util['format'](_0x4cf1('0xd4'),_0x1f62d9));var _0x2dd478=this[_0x4cf1('0x2e')]['sync'](this,_0x4b8d38,_0x1f62d9);this[_0x4cf1('0x3a')]['sync'](this,_0x563a03,_0x1f62d9);if(!this[_0x4cf1('0x87')](_0x563a03[_0x4cf1('0xd5')])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xd6'));}var _0x2ed787=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x563a03[_0x4cf1('0xd5')]);if(!_0x2ed787){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,'no\x20variable\x20found');}var _0x269b82=this;_0x2dd478[_0x4cf1('0xd7')](function(_0x122204,_0x570d5a){Object['keys'](_0x122204)[_0x4cf1('0xd7')](function(_0x5ccf9c){_0x269b82['channel'][_0x4cf1('0xa4')](util['format'](_0x4cf1('0xd8'),_0x2ed787,_0x570d5a,_0x5ccf9c),_0x122204[_0x5ccf9c]);});});this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('%s_ROWS_COUNT',_0x2ed787),_0x2dd478[_0x4cf1('0x9b')]);return this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')]('variable\x20%s\x20set',_0x2ed787));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xd9')]=function(_0x4c82f3){logger['debug'](util[_0x4cf1('0x2c')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x4c82f3['label']));if(!this[_0x4cf1('0x87')](_0x4c82f3[_0x4cf1('0xda')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4c82f3,_0x4cf1('0xdb'));}var _0x3661f6=this[_0x4cf1('0xdc')]['sync'](this,_0x4c82f3[_0x4cf1('0xda')]);if(!_0x3661f6){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4c82f3,_0x4cf1('0xdd'));}var _0x5c1c23=this['channel']['exec'](_0x4cf1('0xde'),[util[_0x4cf1('0x2c')]('SIP/%s',_0x3661f6),_0x4c82f3[_0x4cf1('0x66')],_0x4c82f3['opts'],_0x4c82f3[_0x4cf1('0x72')]]);if(_0x5c1c23[_0x4cf1('0xa3')]===-0x1){return _0x5c1c23;}return this[_0x4cf1('0xf')]['noop'](util['format'](_0x4cf1('0xdf'),_0x4cf1('0xde')));};AGIVertices[_0x4cf1('0x12')]['dialogflow']=function(_0x5c3966){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5c3966[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x5c3966[_0x4cf1('0x7c')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xe0'));}if(!this[_0x4cf1('0x87')](_0x5c3966[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20text\x20configured');}this[_0x4cf1('0xf')]['bot']=!![];this[_0x4cf1('0x3a')](_0x5c3966);this[_0x4cf1('0x45')](_0x5c3966[_0x4cf1('0x7d')],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Trying\x20Dialogflow:\x20%s',_0x5c3966[_0x4cf1('0x7d')]));var _0x5af9e1=this[_0x4cf1('0x7b')][_0x4cf1('0x70')](this,_0x5c3966);if(_0x5af9e1){for(var _0x5152ee in _0x5af9e1){if(_0x5af9e1[_0x4cf1('0x95')](_0x5152ee)){this['channel']['setVariable'](util[_0x4cf1('0x2c')](_0x4cf1('0xe1'),_0x5152ee[_0x4cf1('0x6a')]()),_0x5af9e1[_0x5152ee]);}}this[_0x4cf1('0x45')](_0x5af9e1[_0x4cf1('0xe2')],_0x4cf1('0xe3'),'dialogflow','');return this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xe4'),_0x5af9e1[_0x4cf1('0xe2')]));}return this[_0x4cf1('0xf')]['error'](_0x5c3966,_0x4cf1('0xe5'));};AGIVertices[_0x4cf1('0x12')]['dialogflowV2']=function(_0x1c11e8){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0xe6'),_0x1c11e8[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x1c11e8[_0x4cf1('0x80')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xe7'));}if(!this[_0x4cf1('0x87')](_0x1c11e8['client_email'])){return this['channel'][_0x4cf1('0xaa')]('no\x20client_email\x20configured');}if(!this[_0x4cf1('0x87')](_0x1c11e8['private_key'])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xe8'));}if(!this[_0x4cf1('0x87')](_0x1c11e8[_0x4cf1('0xe9')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20anguage\x20configured');}if(!this[_0x4cf1('0x87')](_0x1c11e8['text'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')][_0x4cf1('0xea')]=!![];this[_0x4cf1('0x3a')](_0x1c11e8);this['createSquareMessage'](_0x1c11e8[_0x4cf1('0x7d')],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xeb'),_0x1c11e8[_0x4cf1('0x7d')]));var _0x723ce7=this[_0x4cf1('0x7f')]['sync'](this,_0x1c11e8);if(_0x723ce7){for(var _0x250fab in _0x723ce7){if(_0x723ce7['hasOwnProperty'](_0x250fab)){if(_0x250fab!==_0x4cf1('0xec')){this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('DIALOGFLOW_%s',_0x250fab['toUpperCase']()),_0x723ce7[_0x250fab]);}}}this[_0x4cf1('0x45')](_0x723ce7['speech'],_0x4cf1('0xe3'),_0x4cf1('0xed'),_0x723ce7[_0x4cf1('0xec')]);return this['channel'][_0x4cf1('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x723ce7[_0x4cf1('0xe2')]));}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x1c11e8,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x4cf1('0x12')]['sesteknda']=function(_0x5453d0){logger[_0x4cf1('0x33')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5453d0['label']));if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xee')])){return this['channel'][_0x4cf1('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xef')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xf0'));}if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xf1')])){return this[_0x4cf1('0xf')]['noop'](_0x4cf1('0xf2'));}if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xf3')])){return this['channel'][_0x4cf1('0xaa')]('no\x20text\x20configured');}this[_0x4cf1('0xf')][_0x4cf1('0xea')]=!![];this[_0x4cf1('0x3a')](_0x5453d0);this[_0x4cf1('0x45')](_0x5453d0['text'],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0xf4'),_0x5453d0[_0x4cf1('0x7d')]));var _0x57e2a4=this['sestekNDA']['sync'](this,_0x5453d0);if(_0x57e2a4){for(var _0x1783ee in _0x57e2a4){if(_0x57e2a4['hasOwnProperty'](_0x1783ee)){this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('SESTEK_NDA_%s',_0x1783ee[_0x4cf1('0x6a')]()),_0x57e2a4[_0x1783ee]);}}this[_0x4cf1('0x45')](_0x57e2a4[_0x4cf1('0xe2')],_0x4cf1('0xe3'),'sesteknda','');if(_0x57e2a4[_0x4cf1('0xf5')]){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xf6'),_0x57e2a4['audiofile']));var _0x42ef0a=this['channel'][_0x4cf1('0xf7')](_0x57e2a4[_0x4cf1('0xf5')]);try{fs[_0x4cf1('0xf8')](_0x57e2a4[_0x4cf1('0xf5')]+'.wav');}catch(_0x22d4d4){logger[_0x4cf1('0x30')](_0x22d4d4);}return _0x42ef0a;}else{return this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xf9'),_0x57e2a4[_0x4cf1('0xe2')]));}}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x5453d0,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xfa')]=function(_0x4736c2){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xfb'),_0x4736c2['label']));return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xfa'));};AGIVertices[_0x4cf1('0x12')]['ext_dial']=function(_0x555703){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x555703[_0x4cf1('0x3c')]));var _0x3f93da='';if(_0x555703[_0x4cf1('0xfc')]){if(!this['isConfigured'](_0x555703['trunk_id'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x555703,_0x4cf1('0xfd'));}else{var _0x1e8383=parseInt(_0x555703['trunk_id'],0xa);if(isNaN(_0x1e8383)){_0x3f93da=_0x555703[_0x4cf1('0xfc')];}else{_0x3f93da=this[_0x4cf1('0x1f')][_0x4cf1('0x70')](this,_0x555703[_0x4cf1('0xfc')]);if(!_0x3f93da){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x555703,_0x4cf1('0xfe'));}}}}else if(_0x555703[_0x4cf1('0xff')]){_0x3f93da=_0x555703[_0x4cf1('0xff')];}else{return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x555703,_0x4cf1('0xfd'));}var _0x3b09f4=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xde'),[util[_0x4cf1('0x2c')](_0x4cf1('0x100'),_0x3f93da,_0x555703[_0x4cf1('0xbd')]),_0x555703[_0x4cf1('0x66')],_0x555703['opts'],_0x555703[_0x4cf1('0x72')]]);if(_0x3b09f4[_0x4cf1('0xa3')]===-0x1){return _0x3b09f4;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Executed\x20command\x20%s',_0x4cf1('0xde')));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x101')]=function(_0x15df3b){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x102'),_0x15df3b[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')]['noop'](_0x4cf1('0x101'));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x103')]=function(_0x50cec7){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x104'),_0x50cec7[_0x4cf1('0x3c')]));if(_0x50cec7[_0x4cf1('0xa6')]===0x0){return this['maxRetry'](_0x50cec7);}_0x50cec7['retry']-=0x1;if(!this[_0x4cf1('0x87')](_0x50cec7[_0x4cf1('0x105')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x50cec7,'no\x20file\x20audio\x20selected');}var _0x23b64e=this[_0x4cf1('0x21')]['sync'](this,_0x50cec7[_0x4cf1('0x105')]);if(!_0x23b64e){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x50cec7,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x50cec7[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4cf1('0xd6'));}var _0x5119e9=this[_0x4cf1('0xf')]['getData'](_0x23b64e,_0x50cec7['response'],_0x50cec7[_0x4cf1('0x106')]);var _0x2e904a=_0x5119e9['result']?_0x5119e9[_0x4cf1('0xa3')]['toString']():'';logger['info'](_0x4cf1('0x107'),JSON[_0x4cf1('0x74')](_0x5119e9));if(_0x5119e9[_0x4cf1('0xa3')]===-0x1){this[_0x4cf1('0x3a')]['sync'](this,_0x50cec7,_0x2e904a);return _0x5119e9;}else if(_0x5119e9['extra']===_0x4cf1('0x66')){_0x5119e9[_0x4cf1('0xa3')]=_0x2e904a[_0x4cf1('0x9b')]>=parseInt(_0x50cec7['mindigit'])?'x':'i';}else{_0x5119e9[_0x4cf1('0xa3')]=_0x2e904a[_0x4cf1('0x9b')]>=parseInt(_0x50cec7[_0x4cf1('0x108')])&&_0x2e904a[_0x4cf1('0x9b')]<=parseInt(_0x50cec7[_0x4cf1('0x106')])?'x':'i';}var _0x186e45=this['getVariable'][_0x4cf1('0x70')](this,_0x50cec7['variable_id']);if(!_0x186e45){return this['channel'][_0x4cf1('0x30')](_0x50cec7,_0x4cf1('0x109'));}this[_0x4cf1('0xf')]['setVariable'](_0x186e45,_0x2e904a);if(this[_0x4cf1('0x87')](_0x50cec7[_0x4cf1('0x10a')])){var _0x26771e=parseInt(_0x50cec7[_0x4cf1('0x10a')],0xa);var _0x581f1b=rs['generate']({'charset':'*','length':_0x26771e});var _0x270cd1=_0x2e904a[_0x4cf1('0x9b')];if(_0x270cd1>0x0){if(_0x270cd1>_0x26771e){this['createSquareDetailsReport'][_0x4cf1('0x70')](this,_0x50cec7,_0x50cec7['hiddendigitspos']===_0x4cf1('0x10b')?_0x581f1b+_0x2e904a[_0x4cf1('0x10c')](_0x26771e):_0x2e904a[_0x4cf1('0x10c')](0x0,_0x270cd1-_0x26771e)+_0x581f1b);}else{this['createSquareDetailsReport'][_0x4cf1('0x70')](this,_0x50cec7,rs[_0x4cf1('0x10d')]({'charset':'*','length':_0x270cd1}));}}else{this['createSquareDetailsReport']['sync'](this,_0x50cec7,'');}}else{this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x50cec7,_0x2e904a);}return _0x5119e9;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xe')]=function(_0x9632b5){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x10e'),_0x9632b5[_0x4cf1('0x3c')]));return this[_0x4cf1('0x103')](_0x9632b5);};AGIVertices['prototype'][_0x4cf1('0x10f')]=function(_0x514661){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x110'),_0x514661[_0x4cf1('0x3c')]));this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x514661,_0x514661[_0x4cf1('0x111')]);return this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x112'),_0x514661[_0x4cf1('0x111')]));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x113')]=function(_0x2c400a){logger['info'](util[_0x4cf1('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2c400a[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x2c400a[_0x4cf1('0x8a')])||!this[_0x4cf1('0x87')](_0x2c400a[_0x4cf1('0x8b')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x2c400a[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x114'),_0x2c400a[_0x4cf1('0x7d')]));var _0x5e77ad=this[_0x4cf1('0x89')][_0x4cf1('0x70')](this,_0x2c400a);if(_0x5e77ad){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x115'),_0x5e77ad));var _0x42e99e=this[_0x4cf1('0xf')][_0x4cf1('0xf7')](_0x5e77ad);try{fs[_0x4cf1('0xf8')](_0x5e77ad+_0x4cf1('0x116'));}catch(_0x28341d){logger[_0x4cf1('0x30')](_0x28341d);}return _0x42e99e;}return this[_0x4cf1('0xf')]['error'](_0x2c400a,_0x4cf1('0x117'));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x118')]=function(_0xa244bf){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x119'),_0xa244bf[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0xa244bf[_0x4cf1('0x8a')])||!this[_0x4cf1('0x87')](_0xa244bf[_0x4cf1('0x8b')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4cf1('0x87')](_0xa244bf[_0x4cf1('0x90')])){return this['channel']['noop'](_0x4cf1('0x11a'));}if(!this[_0x4cf1('0x87')](_0xa244bf['text'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20text\x20configured');}this[_0x4cf1('0xf')][_0x4cf1('0xea')]=!![];this[_0x4cf1('0x3a')](_0xa244bf);this[_0x4cf1('0x45')](_0xa244bf[_0x4cf1('0x7d')],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Trying\x20Amazon\x20Lex:\x20%s',_0xa244bf[_0x4cf1('0x7d')]));var _0x16a0b8=this[_0x4cf1('0x8f')][_0x4cf1('0x70')](this,_0xa244bf);if(_0x16a0b8){for(var _0x2e9e6a in _0x16a0b8){if(_0x16a0b8[_0x4cf1('0x95')](_0x2e9e6a)&&_[_0x4cf1('0x96')](_0x16a0b8[_0x2e9e6a])){this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')](_0x4cf1('0x11b'),_0x2e9e6a[_0x4cf1('0x6a')]()),_0x16a0b8[_0x2e9e6a]);}}if(_['isNil'](_0x16a0b8[_0x4cf1('0x78')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x11c'));}else{this[_0x4cf1('0x45')](_0x16a0b8[_0x4cf1('0x78')],_0x4cf1('0xe3'),_0x4cf1('0x11d'),'');return this[_0x4cf1('0xf')]['noop'](util['format'](_0x4cf1('0x11e'),_0x16a0b8[_0x4cf1('0x78')]));}}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0xa244bf,_0x4cf1('0x11f'));};AGIVertices['prototype'][_0x4cf1('0x120')]=function(_0x445dfd){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x121'),_0x445dfd['label'],_0x445dfd[_0x4cf1('0x66')]));if(!this['isConfigured'](_0x445dfd['key'])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xe0'));}var _0x39230d='wav';var _0x1964a9=util['format'](_0x4cf1('0x122'),FILES_PATH,rs[_0x4cf1('0x10d')](0x4));var _0x488c0e=util['format'](_0x4cf1('0x9d'),_0x1964a9,_0x39230d);var _0x278fa8=!![];if(_0x445dfd[_0x4cf1('0x123')]===_0x4cf1('0x124')){_0x278fa8=![];}var _0x225429=this[_0x4cf1('0xf')][_0x4cf1('0x125')](_0x1964a9,_0x39230d,_0x445dfd['intKey'],_0x445dfd[_0x4cf1('0x66')],undefined,_0x278fa8);if(_0x225429['result']!==-0x1){this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x126'),_0x488c0e));var _0x1e3800=this[_0x4cf1('0x127')][_0x4cf1('0x70')](this,_0x445dfd,_0x488c0e);if(_0x1e3800){for(var _0xcd7445 in _0x1e3800){if(_0x1e3800[_0x4cf1('0x95')](_0xcd7445)){this[_0x4cf1('0xf')]['setVariable'](util[_0x4cf1('0x2c')](_0x4cf1('0x128'),_0xcd7445[_0x4cf1('0x6a')]()),_0x1e3800[_0xcd7445]);}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x129'),JSON[_0x4cf1('0x74')](_0x1e3800)));}}return _0x225429;};AGIVertices['prototype'][_0x4cf1('0x12a')]=function(_0x235a41){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x12b'),_0x235a41[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x235a41[_0x4cf1('0x92')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x12c'));}if(!this[_0x4cf1('0x87')](_0x235a41[_0x4cf1('0x12d')])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0x12e'));}var _0x1afe1f=_0x4cf1('0x12f');var _0x2d69c1=util['format'](_0x4cf1('0x122'),FILES_PATH,rs[_0x4cf1('0x10d')](0x4));var _0x592612=util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x2d69c1,_0x1afe1f);var _0x274cea=!![];if(_0x235a41[_0x4cf1('0x123')]===_0x4cf1('0x124')){_0x274cea=![];}var _0x14304c=this[_0x4cf1('0xf')][_0x4cf1('0x125')](_0x2d69c1,_0x1afe1f,_0x235a41[_0x4cf1('0x130')],_0x235a41[_0x4cf1('0x66')],undefined,_0x274cea);if(_0x14304c[_0x4cf1('0xa3')]!==-0x1){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x131'),_0x592612));var _0x35c923=this[_0x4cf1('0x91')]['sync'](this,_0x235a41,_0x592612);if(_0x35c923){for(var _0x5092ef in _0x35c923){if(_0x35c923['hasOwnProperty'](_0x5092ef)){this['channel']['setVariable'](util[_0x4cf1('0x2c')]('TILDE_ASR_%s',_0x5092ef[_0x4cf1('0x6a')]()),_0x35c923[_0x5092ef]);}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x132'),JSON[_0x4cf1('0x74')](_0x35c923)));}}return _0x14304c;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x133')]=function(_0x198131){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x134'),_0x198131['label']));return this[_0x4cf1('0xf')]['continueAt'](_0x198131[_0x4cf1('0x135')],_0x198131[_0x4cf1('0x41')],_0x198131[_0x4cf1('0x42')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x136')]=function(_0x4d927a){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x137'),_0x4d927a[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x4d927a[_0x4cf1('0x138')])){return this[_0x4cf1('0xf')]['error'](_0x4d927a,'no\x20condition\x20configured');}try{var _0x68c8ca=eval(_0x4d927a[_0x4cf1('0x138')])?_0x4cf1('0x139'):_0x4cf1('0x13a');this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x13b'),_0x4d927a[_0x4cf1('0x138')],_0x68c8ca));return{'code':0xc8,'result':_0x68c8ca};}catch(_0x157b54){return{'code':0xc8,'result':_0x4cf1('0x13a')};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x13c')]=function(_0x14c9a3){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x13d'),_0x14c9a3[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x14c9a3[_0x4cf1('0x13e')])){return this[_0x4cf1('0xf')]['error'](_0x14c9a3,_0x4cf1('0x13f'));}var _0x13b306=this[_0x4cf1('0x140')]['sync'](this,_0x14c9a3['interval_id']);if(!_0x13b306){return this['channel']['error'](_0x14c9a3,_0x4cf1('0x141'));}for(var _0x1bcb41=0x0;_0x1bcb41<_0x13b306[_0x4cf1('0x9b')];_0x1bcb41+=0x1){var _0x5d9cd3=this[_0x4cf1('0xf')][_0x4cf1('0x13')](util[_0x4cf1('0x2c')]('IFTIME(%s?true:false)',_0x13b306[_0x1bcb41]));if(_0x5d9cd3[_0x4cf1('0xa3')]===-0x1){return _0x5d9cd3;}logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],_0x5d9cd3[_0x4cf1('0xa1')]));if(_0x5d9cd3[_0x4cf1('0xa1')]===_0x4cf1('0x139')){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],'true'));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],_0x4cf1('0x139')));return{'code':0xc8,'result':_0x4cf1('0x139')};}else{logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],_0x4cf1('0x13a')));this['channel']['noop'](util['format']('IFTIME\x20%s\x20%s',_0x13b306[_0x1bcb41],_0x4cf1('0x13a')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x143')]=function(_0x132ccf){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x144'),_0x132ccf[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0x143')]();};AGIVertices[_0x4cf1('0x12')]['ispeechasr']=function(_0x30f93f){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x145'),_0x30f93f['label']));if(!this[_0x4cf1('0x87')](_0x30f93f[_0x4cf1('0x7c')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xe0'));}var _0x4a8c29=_0x4cf1('0x12f');var _0x1f64f7=util['format'](_0x4cf1('0x122'),FILES_PATH,rs['generate'](0x4));var _0x57395c=util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x1f64f7,_0x4a8c29);var _0x57f3bc=!![];if(_0x30f93f[_0x4cf1('0x123')]==='NOBEEP'){_0x57f3bc=![];}var _0xc0bca0=this['channel'][_0x4cf1('0x125')](_0x1f64f7,_0x4a8c29,_0x30f93f[_0x4cf1('0x130')],_0x30f93f[_0x4cf1('0x66')],undefined,_0x57f3bc);if(_0xc0bca0[_0x4cf1('0xa3')]!==-0x1){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x146'),_0x57395c));var _0x39bf85=this[_0x4cf1('0x86')][_0x4cf1('0x70')](this,_0x30f93f,_0x57395c);if(_0x39bf85){for(var _0x46b37f in _0x39bf85){if(_0x39bf85[_0x4cf1('0x95')](_0x46b37f)){this[_0x4cf1('0xf')]['setVariable'](util[_0x4cf1('0x2c')](_0x4cf1('0x147'),_0x46b37f[_0x4cf1('0x6a')]()),_0x39bf85[_0x46b37f]);}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x148'),JSON[_0x4cf1('0x74')](_0x39bf85)));}}return _0xc0bca0;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x149')]=function(_0x269639){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x14a'),_0x269639[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x269639[_0x4cf1('0x7c')])){return this[_0x4cf1('0xf')]['noop']('no\x20key\x20configured');}if(!this[_0x4cf1('0x87')](_0x269639[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x14b'),_0x269639[_0x4cf1('0x7d')]));var _0x2bafe6=this[_0x4cf1('0x84')][_0x4cf1('0x70')](this,_0x269639);if(_0x2bafe6){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('ispeech\x20%s\x20file\x20created',_0x2bafe6));var _0x420af2=this[_0x4cf1('0xf')]['streamFile'](_0x2bafe6,_0x269639['intKey']);try{fs[_0x4cf1('0xf8')](_0x2bafe6+_0x4cf1('0x116'));}catch(_0xc6aa79){logger[_0x4cf1('0x30')](_0xc6aa79);}return _0x420af2;}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x269639,_0x4cf1('0x14c'));};AGIVertices['prototype']['login']=function(_0x57f9dd){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x14d'),_0x57f9dd[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x57f9dd[_0x4cf1('0x14e')])){return this[_0x4cf1('0xf')]['error'](_0x57f9dd,_0x4cf1('0x14f'));}logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x150'),this[_0x4cf1('0xf')]['callerid'],_0x57f9dd['findBy']));var _0x29e6ad=this[_0x4cf1('0x55')][_0x4cf1('0x70')](this,_0x57f9dd['findBy']);if(_0x29e6ad){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd[_0x4cf1('0x14e')]));this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd[_0x4cf1('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd['findBy']));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x153')};}};AGIVertices['prototype']['logout']=function(_0x5d6575){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x154'),_0x5d6575[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x5d6575[_0x4cf1('0x14e')])){return this['channel'][_0x4cf1('0x30')](_0x5d6575,_0x4cf1('0x14f'));}logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x150'),this[_0x4cf1('0xf')]['callerid'],_0x5d6575[_0x4cf1('0x14e')]));var _0x3bec9d=this[_0x4cf1('0x54')][_0x4cf1('0x70')](this,_0x5d6575[_0x4cf1('0x14e')]);if(_0x3bec9d){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x5d6575['findBy']));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this['channel']['callerid'],_0x5d6575[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x155')};}else{logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x152'),this['channel'][_0x4cf1('0x3f')],_0x5d6575[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x5d6575[_0x4cf1('0x14e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x156')]=function(_0x586c71){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x157'),_0x586c71[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x586c71[_0x4cf1('0x158')])){return this[_0x4cf1('0xf')]['error'](_0x586c71,_0x4cf1('0x159'));}this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x15a'),_0x586c71['operation']));var _0x59ba72=eval(_0x586c71[_0x4cf1('0x158')]);if(!this['isConfigured'](_0x586c71[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xd6'));}var _0x610921=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x586c71[_0x4cf1('0xd5')]);if(!_0x610921){return this[_0x4cf1('0xf')]['error'](_0x586c71,'no\x20variable\x20found');}if(_[_0x4cf1('0x9e')](_0x59ba72)){var _0x5c9d5e=this;_0x59ba72[_0x4cf1('0xd7')](function(_0x54c02f,_0x4ab2b1){_0x5c9d5e[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('%s[%s]',_0x610921,_0x4ab2b1),_0x54c02f);});return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x15b'),_0x610921));}else{return this[_0x4cf1('0xf')][_0x4cf1('0xa4')](_0x610921,_0x59ba72);}};AGIVertices[_0x4cf1('0x12')]['menu']=function(_0x1037be){logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x15c'),_0x1037be[_0x4cf1('0x3c')]));if(_0x1037be[_0x4cf1('0xa6')]===0x0){return this[_0x4cf1('0xa5')](_0x1037be);}_0x1037be[_0x4cf1('0xa6')]-=0x1;if(!this[_0x4cf1('0x87')](_0x1037be[_0x4cf1('0x105')])){return this['channel'][_0x4cf1('0x30')](_0x1037be,_0x4cf1('0x15d'));}var _0x4ef0fc=this['getSound'][_0x4cf1('0x70')](this,_0x1037be[_0x4cf1('0x105')]);if(!_0x4ef0fc){return this[_0x4cf1('0xf')]['error'](_0x1037be,_0x4cf1('0x15e'));}var _0x239abf=this[_0x4cf1('0xf')]['getData'](_0x4ef0fc,_0x1037be[_0x4cf1('0x15f')],_0x1037be['digit']);var _0x52d02f=_0x239abf['result'];if(_0x239abf['result']===-0x1){this[_0x4cf1('0x3a')]['sync'](this,_0x1037be,'-1');return _0x239abf;}else if(_0x239abf[_0x4cf1('0xa1')]==='timeout'){_0x239abf['result']=_0x239abf[_0x4cf1('0xa3')]['length']>0x0?_0x239abf['result']:'t';}else if(_[_0x4cf1('0x49')](_0x239abf[_0x4cf1('0xa3')])){_0x239abf[_0x4cf1('0xa3')]='#';_0x52d02f='#';}if(!this[_0x4cf1('0x87')](_0x1037be[_0x4cf1('0xd5')])){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xd6'));}else{var _0x173ad8=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x1037be[_0x4cf1('0xd5')]);if(!_0x173ad8){return this[_0x4cf1('0xf')]['error'](_0x1037be,_0x4cf1('0x109'));}this[_0x4cf1('0xf')][_0x4cf1('0xa4')](_0x173ad8,_0x52d02f);}this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x1037be,_0x52d02f);return _0x239abf;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xaa')]=function(_0xbc33ef){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x160'),_0xbc33ef[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0xbc33ef[_0x4cf1('0x161')]||_0xbc33ef[_0x4cf1('0x3c')]);};AGIVertices['prototype'][_0x4cf1('0x162')]=function(_0x187c16){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x163'),_0x187c16['label']));if(!this[_0x4cf1('0x87')](_0x187c16['findBy'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x187c16,_0x4cf1('0x14f'));}logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x187c16[_0x4cf1('0x14e')]));var _0x57d7d8=this[_0x4cf1('0x164')][_0x4cf1('0x70')](this,_0x187c16[_0x4cf1('0x165')]);var _0x1b90c8=this[_0x4cf1('0x166')]['sync'](this,_0x187c16[_0x4cf1('0x14e')],_0x57d7d8);if(_0x1b90c8){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x187c16[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x187c16['findBy']));return{'code':0xc8,'result':_0x4cf1('0x155')};}else{logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x152'),this[_0x4cf1('0xf')]['callerid'],_0x187c16[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')]['callerid'],_0x187c16['findBy']));return{'code':0xc8,'result':_0x4cf1('0x153')};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x167')]=function(_0x4cde24){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4cde24[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x4cde24['file_id'])){return this[_0x4cf1('0xf')]['error'](_0x4cde24,'no\x20file\x20audio\x20selected');}var _0x479350=this[_0x4cf1('0x21')][_0x4cf1('0x70')](this,_0x4cde24[_0x4cf1('0x105')]);if(!_0x479350){return this['channel'][_0x4cf1('0x30')](_0x4cde24,_0x4cf1('0x15e'));}var _0x2796cb=this[_0x4cf1('0xf')][_0x4cf1('0x59')]('PLAYBACK',[_0x479350,_0x4cde24[_0x4cf1('0x168')]]);if(_0x2796cb[_0x4cf1('0xa3')]===-0x1){return _0x2796cb;}return this['channel']['noop'](util['format'](_0x4cf1('0xc0'),'PLAYBACK',_0x479350));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x169')]=function(_0x52bb1d){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x16a'),_0x52bb1d[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x52bb1d['queue_id'])){return this['channel'][_0x4cf1('0x30')](_0x52bb1d,_0x4cf1('0x16b'));}var _0xd07b15='';var _0xef405c=parseInt(_0x52bb1d['queue_id'],0xa);if(isNaN(_0xef405c)){_0xd07b15=_0x52bb1d[_0x4cf1('0x16c')];}else{_0xd07b15=this[_0x4cf1('0x18')]['sync'](this,_0x52bb1d[_0x4cf1('0x16c')]);if(!_0xd07b15){return this[_0x4cf1('0xf')]['error'](_0x52bb1d,_0x4cf1('0x16d'));}}var _0x542596='';if(this['isConfigured'](_0x52bb1d[_0x4cf1('0x105')])){var _0x1f8646=this[_0x4cf1('0x21')][_0x4cf1('0x70')](this,_0x52bb1d['file_id']);if(_0x1f8646){_0x542596=_0x1f8646;}}this[_0x4cf1('0x3a')]['sync'](this,_0x52bb1d,_0xd07b15);if(_0x52bb1d['opts'][_0x4cf1('0x16e')]('x')<0x0){_0x52bb1d['opts']+='x';}if(_0x52bb1d['opts'][_0x4cf1('0x16e')]('X')<0x0){_0x52bb1d[_0x4cf1('0x168')]+='X';}this[_0x4cf1('0xf')][_0x4cf1('0xa4')]('XMCS-QUEUE',_0xd07b15?_0xd07b15[_0x4cf1('0x16f')]():'');var _0x338730=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0x170'),[_0xd07b15,_0x52bb1d[_0x4cf1('0x168')],_0x52bb1d[_0x4cf1('0x72')],_0x542596,_0x52bb1d[_0x4cf1('0x66')],_0x52bb1d[_0x4cf1('0xb4')],_0x52bb1d[_0x4cf1('0x171')],_0x52bb1d[_0x4cf1('0x172')],'',_0x52bb1d[_0x4cf1('0x173')]]);if(_0x338730[_0x4cf1('0xa3')]===-0x1){return _0x338730;}return this[_0x4cf1('0xf')]['noop'](util['format'](_0x4cf1('0xc0'),_0x4cf1('0x170'),_0xd07b15));};AGIVertices['prototype'][_0x4cf1('0x174')]=function(_0x3ec644){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x175'),_0x3ec644[_0x4cf1('0x3c')]));var _0x1fe4b7=_0x3ec644[_0x4cf1('0x176')]||_0x4cf1('0x12f');var _0x5cdf22=util['format'](_0x4cf1('0x177'),this[_0x4cf1('0xf')]['uniqueid'],rs['generate'](0x5));var _0x481631=util[_0x4cf1('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x5cdf22,_0x1fe4b7);var _0x166d18=util[_0x4cf1('0x2c')](_0x4cf1('0x122'),FILES_PATH,_0x5cdf22);this[_0x4cf1('0x40')][_0x4cf1('0x70')](this,_0x3ec644,_0x5cdf22,_0x481631);this[_0x4cf1('0xf')][_0x4cf1('0xa4')]('RECORDING_SAVENAME',_0x5cdf22);logger[_0x4cf1('0x33')](_0x4cf1('0x178'),_0x166d18,_0x1fe4b7,_0x3ec644['escape_digits'],_0x3ec644[_0x4cf1('0x66')]);return this['channel']['recordFile'](_0x166d18,_0x1fe4b7,_0x3ec644[_0x4cf1('0x179')],_0x3ec644['timeout'],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x50d60c){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x50d60c[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x50d60c[_0x4cf1('0x72')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x17a'));}var _0x25fec4=this['restAPI']['sync'](this,_0x50d60c);logger['info'](util['format'](_0x4cf1('0x17b'),util[_0x4cf1('0x17c')](_0x25fec4,{'showHidden':![],'depth':null})));if(!this[_0x4cf1('0x87')](_0x50d60c[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')]['noop'](_0x4cf1('0x17d'));}var _0x290ed6=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x50d60c[_0x4cf1('0xd5')]);if(!_0x290ed6){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x50d60c,_0x4cf1('0x109'));}this['channel']['setVariable'](util['format'](_0x4cf1('0x17e'),_0x290ed6),_0x25fec4[_0x4cf1('0x76')]?_0x25fec4['statusCode']:_0x4cf1('0x17f'));this['channel'][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')](_0x4cf1('0x180'),_0x290ed6),_0x25fec4[_0x4cf1('0x77')]?_0x25fec4[_0x4cf1('0x77')]:'OK');if(_0x25fec4[_0x4cf1('0x6b')]){try{this[_0x4cf1('0x9c')](_0x25fec4[_0x4cf1('0x6b')],_0x290ed6);}catch(_0x3de40c){logger['error'](util[_0x4cf1('0x2c')](_0x4cf1('0x181'),_0x290ed6));}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x182'),_0x290ed6));};AGIVertices[_0x4cf1('0x12')]['saydigits']=function(_0x1f7fbb){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1f7fbb[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0x183')](_0x1f7fbb['digits'][_0x4cf1('0x5b')](/\s+/g,''),_0x1f7fbb['escape_digits']);};AGIVertices[_0x4cf1('0x12')]['saynumber']=function(_0x5d5ea1){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5d5ea1['label']));return this[_0x4cf1('0xf')][_0x4cf1('0x184')](_0x5d5ea1[_0x4cf1('0x67')][_0x4cf1('0x5b')](/\s+/g,''),_0x5d5ea1[_0x4cf1('0x179')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x185')]=function(_0x4f0830){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x186'),_0x4f0830[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')]['sayPhonetic'](_0x4f0830[_0x4cf1('0x7d')],_0x4f0830['escape_digits']);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x187')]=function(_0x23dd79){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x188'),_0x23dd79['label']));if(!this[_0x4cf1('0x87')](_0x23dd79['account_id'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20mail\x20account\x20configured');}var _0x2bd837=this[_0x4cf1('0x189')]['sync'](this,_0x23dd79[_0x4cf1('0x18a')]);if(!_0x2bd837||!_0x2bd837[_0x4cf1('0x18b')]){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x23dd79,_0x4cf1('0x18c'));}var _0x560530={'from':util[_0x4cf1('0x2c')]('\x22%s\x22\x20<%s>',_0x2bd837['name'],_0x2bd837['email']||_0x2bd837[_0x4cf1('0x18b')]['user']),'to':_0x23dd79['to']||'','cc':_0x23dd79['cc']||'','bcc':_0x23dd79[_0x4cf1('0x18d')]||'','subject':_0x23dd79[_0x4cf1('0x18e')],'html':_0x23dd79['text'],'text':_0x23dd79[_0x4cf1('0x7d')]};if(this['isConfigured'](_0x23dd79[_0x4cf1('0x18f')])){}logger[_0x4cf1('0x190')](_0x4cf1('0x191'),JSON[_0x4cf1('0x74')](_0x560530));this['createSquareDetailsReport']['sync'](this,_0x23dd79,_0x23dd79[_0x4cf1('0x18a')]);this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x2bd837['name']));this[_0x4cf1('0x26')][_0x4cf1('0x70')](this,_0x2bd837[_0x4cf1('0x192')],_0x560530);return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x193')]=function(_0x132be7){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x194'),_0x132be7[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x195'));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x196')]=function(_0x899e6e){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x899e6e['label']));if(!this[_0x4cf1('0x87')](_0x899e6e[_0x4cf1('0x197')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x198'));}var _0x133943=this[_0x4cf1('0x37')]['sync'](this,_0x899e6e[_0x4cf1('0x197')]);if(!_0x133943){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x899e6e,'no\x20sms\x20account\x20found');}var _0x2ad23f={'body':_0x899e6e[_0x4cf1('0x199')],'phone':_0x899e6e['to']||'','SmsAccountId':_0x133943['id']};logger[_0x4cf1('0x190')](_0x4cf1('0x19a'),JSON[_0x4cf1('0x74')](_0x2ad23f));this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x899e6e,_0x899e6e['sms_account_id']);this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x19b'),_0x133943['name']));this['createSmsMessage'][_0x4cf1('0x70')](this,_0x2ad23f);return this[_0x4cf1('0xf')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['set']=function(_0x5e0731){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x19c'),_0x5e0731[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x5e0731[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')]['error'](_0x5e0731,'no\x20variable\x20selected');}var _0x118fdc=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x5e0731[_0x4cf1('0xd5')]);if(!_0x118fdc){return this[_0x4cf1('0xf')]['error'](_0x5e0731,_0x4cf1('0x109'));}return this[_0x4cf1('0xf')][_0x4cf1('0xa4')](_0x118fdc,_0x5e0731[_0x4cf1('0x19d')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x19e')]=function(_0x26fe36){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x19f'),_0x26fe36['label']));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x1a0'));if(_0x26fe36[_0x4cf1('0xb7')]==='yes'){this[_0x4cf1('0xf')]['noop']('Answer');return this[_0x4cf1('0xf')][_0x4cf1('0xb7')]();}return this[_0x4cf1('0xf')]['noop']('Skipped\x20Answer');};AGIVertices['prototype']['subproject']=function(_0x2b12d1){logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x1a1'),_0x2b12d1[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x2b12d1[_0x4cf1('0x1a2')])){return this['channel']['error'](_0x2b12d1,_0x4cf1('0x1a3'));}var _0x17516a=this['getSquareProject'][_0x4cf1('0x70')](this,_0x2b12d1[_0x4cf1('0x1a2')]);if(!this[_0x4cf1('0x87')](_0x17516a)){return this[_0x4cf1('0xf')]['error'](_0x2b12d1,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2b12d1['project_id']));}if(_0x17516a===this[_0x4cf1('0xf')][_0x4cf1('0x3e')]){return this['channel']['error'](_0x2b12d1,_0x4cf1('0x1a4'));}this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x2b12d1,_0x17516a);var _0x38983a=this[_0x4cf1('0xf')]['exec'](_0x4cf1('0x1a5'),util[_0x4cf1('0x2c')](_0x4cf1('0x1a6'),config[_0x4cf1('0xb4')][_0x4cf1('0x1a7')]||_0x4cf1('0x1a8'),_0x17516a,this['channel'][_0x4cf1('0x3e')]));if(_0x38983a[_0x4cf1('0xa3')]===-0x1){return _0x38983a;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xc0'),_0x4cf1('0x1a5'),_0x17516a));};AGIVertices[_0x4cf1('0x12')]['system']=function(_0x19a163){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x1a9'),_0x19a163[_0x4cf1('0x3c')]));var _0xc7c1ca=this[_0x4cf1('0x58')]['sync'](this,_0x19a163[_0x4cf1('0xb5')]);this[_0x4cf1('0x3a')]['sync'](this,_0x19a163,_0x19a163['command']);if(this[_0x4cf1('0x87')](_0x19a163[_0x4cf1('0xd5')])){var _0x5065cb=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x19a163['variable_id']);if(_0x5065cb){this['channel'][_0x4cf1('0xa4')](_0x5065cb,_0xc7c1ca);return this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x1aa'),_0x19a163[_0x4cf1('0xb5')],_0x5065cb));}}return this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x1ab'),_0x19a163[_0x4cf1('0xb5')]));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1ac')]=function(_0x552a57){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x552a57[_0x4cf1('0x3c')]));_0x552a57[_0x4cf1('0x7d')]=_0x552a57[_0x4cf1('0x7d')][_0x4cf1('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x552a57[_0x4cf1('0x5d')])){return this['channel'][_0x4cf1('0xaa')]('no\x20apiKey\x20configured');}if(!this[_0x4cf1('0x87')](_0x552a57[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x1ad'),_0x552a57[_0x4cf1('0x7d')]));var _0x23ab71=this[_0x4cf1('0x5c')][_0x4cf1('0x70')](this,_0x552a57);if(_0x23ab71){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x1ae'),_0x23ab71));var _0x5642a1=this[_0x4cf1('0xf')][_0x4cf1('0xf7')](_0x23ab71);try{fs[_0x4cf1('0xf8')](_0x23ab71+_0x4cf1('0x116'));}catch(_0x42a96d){logger[_0x4cf1('0x30')](_0x42a96d);}return _0x5642a1;}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x552a57,_0x4cf1('0x1af'));};AGIVertices[_0x4cf1('0x12')]['tts']=function(_0x4bfab2){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x1b0'),_0x4bfab2[_0x4cf1('0x3c')]));_0x4bfab2[_0x4cf1('0x7d')]=_0x4bfab2[_0x4cf1('0x7d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4cf1('0x87')](_0x4bfab2[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x1b1'),_0x4bfab2[_0x4cf1('0x7d')]));var _0x3a6522=this['googleTTS']['sync'](this,_0x4bfab2);if(_0x3a6522){this['channel'][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x1b2'),_0x3a6522));var _0x23384c=this['channel']['streamFile'](_0x3a6522);try{fs['unlink'](_0x3a6522+_0x4cf1('0x116'));}catch(_0x172a4e){logger[_0x4cf1('0x30')](_0x172a4e);}return _0x23384c;}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4bfab2,_0x4cf1('0x1b3'));};AGIVertices['prototype'][_0x4cf1('0x1b4')]=function(_0x456f53){logger['info'](util['format'](_0x4cf1('0x1b5'),_0x456f53[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x456f53['findBy'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x456f53,_0x4cf1('0x14f'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53[_0x4cf1('0x14e')]));var _0x42e69b=this['agentUnpause'][_0x4cf1('0x70')](this,_0x456f53['findBy']);if(_0x42e69b){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')]['callerid'],_0x456f53[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x155')};}else{logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53['findBy']));this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x153')};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1b6')]=function(_0x540f77){logger['info'](util['format'](_0x4cf1('0x1b7'),_0x540f77[_0x4cf1('0x3c')]));var _0x4eba1d=this[_0x4cf1('0xf')]['exec']('VOICEMAIL',[_0x540f77[_0x4cf1('0x1b8')],_0x540f77['options']]);if(_0x4eba1d[_0x4cf1('0xa3')]===-0x1){return _0x4eba1d;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xc0'),'VOICEMAIL',_0x540f77[_0x4cf1('0x1b8')]));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1b9')]=function(_0x25cbdb){logger[_0x4cf1('0x33')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x25cbdb[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x25cbdb[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x25cbdb,_0x4cf1('0x1ba'));}var _0x6973a5=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x25cbdb['variable_id']);if(!_0x6973a5){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x25cbdb,'no\x20variable\x20found');}var _0x278067=this[_0x4cf1('0xf')][_0x4cf1('0x13')](_0x6973a5);return{'code':0xc8,'result':_0x278067[_0x4cf1('0xa1')]?_0x278067[_0x4cf1('0xa1')]:'-'};};String['prototype'][_0x4cf1('0xa0')]=function(_0x2eec1b,_0x77823e){return this[_0x4cf1('0x9f')](_0x2eec1b)[_0x4cf1('0x1bb')](_0x77823e);};module[_0x4cf1('0x1bc')]=AGIVertices; \ No newline at end of file +var _0x7d98=['Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','createSquareMessage','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','toUpperCase','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','wav','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_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','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','bcc','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','../../config/environment','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','sendMailMessage','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','open','error','info','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','extension','accountcode','file','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','callerid','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','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','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','includes','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','exec','MRCPSynth','result','noop','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','replace','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial'];(function(_0x47d67e,_0x36f17d){var _0x932c2b=function(_0x4b3338){while(--_0x4b3338){_0x47d67e['push'](_0x47d67e['shift']());}};_0x932c2b(++_0x36f17d);}(_0x7d98,0xe7));var _0x87d9=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x7d98[_0x4d82ea];return _0x257f4a;};'use strict';var fs=require('fs');var util=require(_0x87d9('0x0'));var _=require('lodash');var sh=require(_0x87d9('0x1'));var odbc=require(_0x87d9('0x2'))();var rs=require(_0x87d9('0x3'));var moment=require(_0x87d9('0x4'));var Mustache=require('mustache');var rp=require(_0x87d9('0x5'));var logger=require(_0x87d9('0x6'))('agi');var config=require(_0x87d9('0x7'));var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x87d9('0x8'),_0x87d9('0x9')];var verticesWithRetry=[_0x87d9('0xa'),'getdigits',_0x87d9('0xb')];var AGIVertices=function(_0x7107a0,_0x4168cf,_0x545f4f){this[_0x87d9('0xc')]=_0x7107a0;this[_0x87d9('0xd')]=_0x4168cf;this[_0x87d9('0xe')]=_0x545f4f;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x10')]=function(_0x3c662f,_0x2b8e2c){this[_0x87d9('0xd')][_0x87d9('0x11')](_0x3c662f)[_0x87d9('0x12')](function(_0x1ed5f9){_0x2b8e2c(null,_0x1ed5f9?_0x1ed5f9[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x22758){_0x2b8e2c(_0x22758);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x15')]=function(_0x2c3965,_0x185401){this[_0x87d9('0xd')][_0x87d9('0x16')](_0x2c3965)['then'](function(_0x5a7ba4){_0x185401(null,_0x5a7ba4?_0x5a7ba4[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x3231e7){_0x185401(_0x3231e7);});};AGIVertices['prototype']['getSquareProject']=function(_0x407c62,_0x109d61){this[_0x87d9('0xd')][_0x87d9('0x17')](_0x407c62)[_0x87d9('0x12')](function(_0xebc1eb){_0x109d61(null,_0xebc1eb?_0xebc1eb[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x6cbbca){_0x109d61(_0x6cbbca);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x18')]=function(_0x5d6da1,_0x6f6284){this['rpc'][_0x87d9('0x19')](_0x5d6da1)[_0x87d9('0x12')](function(_0x334d31){_0x6f6284(null,_0x334d31?_0x334d31['dsn']:![]);})['catch'](function(_0x545241){_0x6f6284(_0x545241);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1a')]=function(_0x28aaaa,_0x6ab839){this[_0x87d9('0xd')][_0x87d9('0x1b')](_0x28aaaa)[_0x87d9('0x12')](function(_0x3b24e7){_0x6ab839(null,_0x3b24e7?_0x3b24e7[_0x87d9('0x13')]:![]);})['catch'](function(_0x31e1b2){_0x6ab839(_0x31e1b2);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1c')]=function(_0xb2a651,_0x1b170e){this[_0x87d9('0xd')][_0x87d9('0x1d')](_0xb2a651)[_0x87d9('0x12')](function(_0x4b2914){_0x1b170e(null,_0x4b2914?_0x4b2914[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x2f63fa){_0x1b170e(_0x2f63fa);});};AGIVertices[_0x87d9('0xf')]['getSound']=function(_0x121368,_0x12d733){var _0x438e84=this;this[_0x87d9('0xd')]['getSoundById'](_0x121368)[_0x87d9('0x12')](function(_0x3c0283){_0x12d733(null,_0x3c0283?_0x438e84[_0x87d9('0x1e')](_0x3c0283['save_name']):![]);})[_0x87d9('0x14')](function(_0x22a401){_0x12d733(_0x22a401);});};AGIVertices['prototype']['getMailAccount']=function(_0x4f13db,_0x31122b){this[_0x87d9('0xd')]['getMailAccountById'](_0x4f13db)[_0x87d9('0x12')](function(_0x4a820e){_0x31122b(null,_0x4a820e?_0x4a820e:![]);})[_0x87d9('0x14')](function(_0x50df68){_0x31122b(_0x50df68);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1f')]=function(_0x5cfb33,_0x1bc8c5,_0x5a06d6){this[_0x87d9('0xe')][_0x87d9('0x1f')](_0x5cfb33,_0x1bc8c5)[_0x87d9('0x12')](function(){_0x5a06d6(null);})[_0x87d9('0x14')](function(_0x16453b){_0x5a06d6(_0x16453b);});};AGIVertices[_0x87d9('0xf')]['getIntervals']=function(_0x2e22c8,_0x1f69f5){this[_0x87d9('0xd')][_0x87d9('0x20')](_0x2e22c8)[_0x87d9('0x12')](function(_0x1c2ea6){if(_0x1c2ea6){if(_0x1c2ea6[_0x87d9('0x21')]){_0x1f69f5(null,[_0x1c2ea6[_0x87d9('0x22')]]);}else{_0x1f69f5(null,_[_0x87d9('0x23')](_0x1c2ea6['Intervals'],_0x87d9('0x22')));}}else{_0x1f69f5(null,![]);}})[_0x87d9('0x14')](function(_0x4361b0){_0x1f69f5(_0x4361b0);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1e')]=function(_0x49fa99){return util[_0x87d9('0x24')](_0x87d9('0x25'),FILES_PATH,_0x49fa99);};AGIVertices[_0x87d9('0xf')]['getQueryOdbc']=function(_0x469306,_0x4c01e1,_0x37431c){odbc[_0x87d9('0x26')](_0x469306,function(_0x157fa1){if(_0x157fa1){logger[_0x87d9('0x27')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x157fa1);_0x37431c(_0x157fa1);}else{logger[_0x87d9('0x28')]('ODBC\x20connection\x20successfully');odbc[_0x87d9('0x29')](_0x4c01e1,function(_0x3dc7a7,_0x2158a7){if(_0x3dc7a7){logger[_0x87d9('0x28')]('Error\x20executing\x20query\x20%s',_0x4c01e1);_0x37431c(_0x3dc7a7);}else{logger['info'](_0x87d9('0x2a'),_0x4c01e1);odbc['close'](function(_0x363337){if(_0x363337){logger['error'](_0x87d9('0x2b'),_0x363337);}_0x37431c(null,_0x2158a7);});}});}});};AGIVertices['prototype'][_0x87d9('0x2c')]=function(_0x341322,_0x5d8a5c){this[_0x87d9('0xd')]['getSmsAccountById'](_0x341322)['then'](function(_0x5c91af){_0x5d8a5c(null,_0x5c91af?_0x5c91af:![]);})[_0x87d9('0x14')](function(_0x5d3963){_0x5d8a5c(_0x5d3963);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x2d')]=function(_0x2af6fd,_0x5e2fe1){this[_0x87d9('0xd')][_0x87d9('0x2d')](_0x2af6fd)[_0x87d9('0x12')](function(_0x5a0d96){_0x5e2fe1(null,_0x5a0d96);})[_0x87d9('0x14')](function(_0x58ec85){_0x5e2fe1(_0x58ec85);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x39e807,_0x585bcc,_0x4a411b){this[_0x87d9('0xd')][_0x87d9('0x2e')]({'uniqueid':this[_0x87d9('0xc')][_0x87d9('0x2f')],'node':_0x39e807[_0x87d9('0x30')],'application':_0x39e807['agicommand'],'data':_0x585bcc||null,'project_name':this[_0x87d9('0xc')][_0x87d9('0x31')],'callerid':this['channel']['callerid']})[_0x87d9('0x12')](function(_0x323a76){if(_0x4a411b){_0x4a411b(null,_0x323a76);}})[_0x87d9('0x14')](function(_0x3f2b93){if(_0x4a411b){_0x4a411b(_0x3f2b93);}});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x32')]=function(_0x9790f7,_0xa675ad,_0x497c44,_0x44b359){this[_0x87d9('0xd')]['createSquareRecording']({'uniqueid':this['channel'][_0x87d9('0x2f')],'callerid':this[_0x87d9('0xc')]['callerid'],'calleridname':this[_0x87d9('0xc')]['calleridname'],'context':this['channel']['context'],'extension':this['channel'][_0x87d9('0x33')],'priority':this[_0x87d9('0xc')]['priority'],'accountcode':this[_0x87d9('0xc')][_0x87d9('0x34')],'dnid':this[_0x87d9('0xc')]['dnid'],'projectName':this[_0x87d9('0xc')][_0x87d9('0x31')],'saveName':_0xa675ad,'filename':_0x9790f7[_0x87d9('0x35')]||_0xa675ad,'savePath':_0x497c44})[_0x87d9('0x12')](function(_0x154995){_0x44b359(null,_0x154995);})[_0x87d9('0x14')](function(_0x556e0d){_0x44b359(_0x556e0d);});};AGIVertices[_0x87d9('0xf')]['createSquareMessage']=function(_0x512d91,_0x23b4c6,_0x39f9b7,_0x329088,_0x2e81bd){this[_0x87d9('0xd')]['createSquareMessage']({'uniqueid':this[_0x87d9('0xc')][_0x87d9('0x2f')],'body':_0x512d91,'direction':_0x23b4c6,'providerName':_0x39f9b7,'providerResponse':_0x329088})[_0x87d9('0x12')](function(_0x18cf6b){if(_0x2e81bd){_0x2e81bd(null,_0x18cf6b);}})['catch'](function(_0x645821){if(_0x2e81bd){_0x2e81bd(_0x645821);}});};AGIVertices[_0x87d9('0xf')]['createCmContact']=function(_0x5eef90,_0x2e493a){this[_0x87d9('0xd')][_0x87d9('0x36')]({'firstName':_[_0x87d9('0x37')](_0x5eef90[_0x87d9('0x13')])||_['isNil'](_0x5eef90[_0x87d9('0x13')])?_0x87d9('0x38')+Math[_0x87d9('0x39')]():_0x5eef90[_0x87d9('0x13')],'lastName':_[_0x87d9('0x37')](_0x5eef90[_0x87d9('0x3a')])||_[_0x87d9('0x3b')](_0x5eef90[_0x87d9('0x3a')])?null:_0x5eef90[_0x87d9('0x3a')],'phone':_0x5eef90[_0x87d9('0x3c')],'ListId':_0x5eef90[_0x87d9('0x3d')],'scheduledat':_0x5eef90['scheduledAt'],'callbackUniqueid':this[_0x87d9('0xc')][_0x87d9('0x2f')],'tags':_0x87d9('0x3e'),'description':_0x87d9('0x3f')+_0x5eef90[_0x87d9('0x40')][_0x87d9('0x41')](),'priority':_0x5eef90['callback_priority']})[_0x87d9('0x12')](function(_0xcde8de){_0x2e493a(null,_0xcde8de);})['catch'](function(_0x237b5b){_0x2e493a(_0x237b5b);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x42')]=function(_0x5854a2,_0x410ae2){this[_0x87d9('0xd')][_0x87d9('0x43')](_0x5854a2)[_0x87d9('0x12')](function(_0xac7f78){_0x410ae2(null,_0xac7f78?_0xac7f78[_0x87d9('0x13')]:![]);})['catch'](function(_0x183661){_0x410ae2(_0x183661);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x44')]=function(_0x4f7e6c,_0x4e4669,_0x52243f){var _0x4fadd9={'role':_0x87d9('0x45')};_0x4fadd9[_0x4f7e6c]=this[_0x87d9('0xc')]['callerid'];this[_0x87d9('0xd')][_0x87d9('0x44')](_0x4fadd9,_0x4e4669,this[_0x87d9('0xc')][_0x87d9('0x2f')])['then'](function(_0x186ed2){_0x52243f(null,_[_0x87d9('0x3b')](_0x186ed2)?![]:!![]);})[_0x87d9('0x14')](function(_0x260944){logger['error'](_0x260944);_0x52243f(null,![]);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x46')]=function(_0x3100b2,_0x6b3e8){var _0x162a3a={'role':_0x87d9('0x45')};_0x162a3a[_0x3100b2]=this[_0x87d9('0xc')][_0x87d9('0x47')];this[_0x87d9('0xd')]['agentUnpause'](_0x162a3a)[_0x87d9('0x12')](function(_0x371563){_0x6b3e8(null,_[_0x87d9('0x3b')](_0x371563)?![]:!![]);})[_0x87d9('0x14')](function(_0x24c9fd){logger[_0x87d9('0x27')](_0x24c9fd);_0x6b3e8(null,![]);});};AGIVertices[_0x87d9('0xf')]['agentLogout']=function(_0x1acebb,_0x329887){var _0xd47e6d={'role':_0x87d9('0x45')};_0xd47e6d[_0x1acebb]=this[_0x87d9('0xc')][_0x87d9('0x47')];this['rpc']['agentLogout'](_0xd47e6d)['then'](function(_0x4d8c23){_0x329887(null,_[_0x87d9('0x3b')](_0x4d8c23)?![]:!![]);})[_0x87d9('0x14')](function(_0x3aae37){logger[_0x87d9('0x27')](_0x3aae37);_0x329887(null,![]);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x48')]=function(_0x595313,_0xdeb8ce){var _0x253d5e={'role':_0x87d9('0x45')};_0x253d5e[_0x595313]=this[_0x87d9('0xc')][_0x87d9('0x47')];var _0x14a3cc=_0x595313!=_0x87d9('0x49')?util[_0x87d9('0x24')](_0x87d9('0x4a'),_0x87d9('0x4b'),this[_0x87d9('0xc')]['callerid']):undefined;this[_0x87d9('0xd')][_0x87d9('0x48')](_0x253d5e,_0x14a3cc)[_0x87d9('0x12')](function(_0xfa4a99){_0xdeb8ce(null,_[_0x87d9('0x3b')](_0xfa4a99)?![]:!![]);})['catch'](function(_0xa4a9d8){logger[_0x87d9('0x27')](_0xa4a9d8);_0xdeb8ce(null,![]);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x4c')]=function(_0x1fb5a2,_0x192c56){sh['exec'](_['trim'](_0x1fb5a2),function(_0x2b591c,_0x4830d3){var _0x353c89=_0x4830d3['replace'](/(\r\n|\n|\r)/gm,'');_0x192c56(null,_0x353c89);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x4d')]=function(_0x11ee83,_0xe7d3af){scripts[_0x87d9('0x4d')](_0x11ee83['apiKey'],_0x11ee83[_0x87d9('0x4e')]||'text',_0x11ee83[_0x87d9('0x4f')],_0x11ee83[_0x87d9('0x50')]||_0x87d9('0x51'),_0x11ee83[_0x87d9('0x52')]||_0x87d9('0x53'),_0x11ee83[_0x87d9('0x54')]||_0x87d9('0x55'))['then'](function(_0x436c47){_0xe7d3af(null,_0x436c47);})[_0x87d9('0x14')](function(_0x2cf918){_0xe7d3af(_0x2cf918);});};AGIVertices['prototype']['googleTTS']=function(_0x507582,_0x4cfdaa){scripts[_0x87d9('0x56')](_0x507582[_0x87d9('0x4f')],_0x507582[_0x87d9('0x57')]||'en',0x1)[_0x87d9('0x12')](function(_0x27a46f){_0x4cfdaa(null,_0x27a46f);})[_0x87d9('0x14')](function(_0x14ac7c){_0x4cfdaa(_0x14ac7c);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x58')]=function(_0x549f13,_0x3e29dd){var _0x21b068={'uri':_0x549f13[_0x87d9('0x59')],'method':_0x549f13[_0x87d9('0x5a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x549f13[_0x87d9('0x5b')])===_0x87d9('0x5c')&&parseInt(_0x549f13[_0x87d9('0x5b')])>=0x1?parseInt(_0x549f13['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x87d9('0x5d'),_0x87d9('0x5e')],_0x21b068[_0x87d9('0x5a')]['toUpperCase']())){try{_0x21b068[_0x87d9('0x5f')]=_0x549f13['rawBody']?JSON[_0x87d9('0x60')](_0x549f13[_0x87d9('0x9')]):{};}catch(_0xdd72e5){logger[_0x87d9('0x27')](_0x87d9('0x61'),_0xdd72e5);}}try{_0x21b068[_0x87d9('0x62')]=_0x549f13[_0x87d9('0x8')]?JSON[_0x87d9('0x60')](_0x549f13[_0x87d9('0x8')]):{};}catch(_0x2f630c){logger[_0x87d9('0x27')](_0x87d9('0x63'),_0x2f630c);}if(_0x549f13[_0x87d9('0x64')]){try{var _0xdffdbd=require(_0x549f13[_0x87d9('0x64')])[_0x87d9('0x65')](this,_0x21b068);_0x21b068[_0x87d9('0x66')]=Mustache[_0x87d9('0x67')](_0x549f13[_0x87d9('0x59')],_0xdffdbd,{},['$$','$$']);if(_0x21b068[_0x87d9('0x62')]){_0x21b068['headers']=JSON['parse'](Mustache[_0x87d9('0x67')](JSON[_0x87d9('0x68')](_0x21b068[_0x87d9('0x62')]),_0xdffdbd,{},['$$','$$']));}if(_0x21b068[_0x87d9('0x5f')]){_0x21b068['body']=JSON[_0x87d9('0x60')](Mustache[_0x87d9('0x67')](JSON[_0x87d9('0x68')](_0x21b068[_0x87d9('0x5f')]),_0xdffdbd,{},['$$','$$']));}}catch(_0x1b8ef3){logger[_0x87d9('0x27')](_0x87d9('0x69'),_0x1b8ef3);}}rp(_0x21b068)[_0x87d9('0x12')](function(_0x5b2b17){var _0x3ac340={'statusCode':_0x5b2b17[_0x87d9('0x6a')]||0xc8,'statusMessage':_0x5b2b17[_0x87d9('0x6b')]||'OK','headers':_0x5b2b17[_0x87d9('0x62')]||{},'body':_0x5b2b17['body']||{}};_0x3e29dd(null,_0x3ac340);})['catch'](function(_0x3b93a8){var _0x22f074={'statusCode':_0x3b93a8['statusCode']||0x1f4,'statusMessage':_0x3b93a8[_0x87d9('0x6c')]||_0x87d9('0x6d'),'headers':_0x3b93a8[_0x87d9('0x6e')][_0x87d9('0x62')]||{},'body':_0x3b93a8[_0x87d9('0x6e')][_0x87d9('0x5f')]||{}};_0x3e29dd(null,_0x22f074);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x6f')]=function(_0x7c3c51,_0x4d4e46){scripts['googleDialogflow'](this[_0x87d9('0xc')][_0x87d9('0x2f')],_0x7c3c51['key'],_0x7c3c51[_0x87d9('0x4f')],_0x7c3c51[_0x87d9('0x70')]||'en')[_0x87d9('0x12')](function(_0x46ad4c){_0x4d4e46(null,_0x46ad4c);})[_0x87d9('0x14')](function(_0x4a6f0c){_0x4d4e46(_0x4a6f0c);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x71')]=function(_0x2a3b65,_0x5e3056){scripts[_0x87d9('0x71')](this[_0x87d9('0xc')][_0x87d9('0x2f')],_0x2a3b65[_0x87d9('0x72')],_0x2a3b65[_0x87d9('0x73')],_0x2a3b65[_0x87d9('0x74')],_0x2a3b65[_0x87d9('0x4f')],_0x2a3b65[_0x87d9('0x75')]||'en')['then'](function(_0x3aebf5){_0x5e3056(null,_0x3aebf5);})[_0x87d9('0x14')](function(_0x436e5a){_0x5e3056(_0x436e5a);});};AGIVertices['prototype'][_0x87d9('0x76')]=function(_0x39580f,_0x11f4b5){scripts[_0x87d9('0x76')](this[_0x87d9('0xc')],_0x39580f)[_0x87d9('0x12')](function(_0x1992f3){_0x11f4b5(null,_0x1992f3);})[_0x87d9('0x14')](function(_0x509340){_0x11f4b5(_0x509340);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x77')]=function(_0x4aaf86,_0x3313b9){scripts[_0x87d9('0x77')](_0x4aaf86[_0x87d9('0x78')],_0x4aaf86['text'],_0x4aaf86[_0x87d9('0x79')]||_0x87d9('0x51'),_0x4aaf86[_0x87d9('0x7a')])[_0x87d9('0x12')](function(_0x4e9fdb){_0x3313b9(null,_0x4e9fdb);})['catch'](function(_0x223367){_0x3313b9(_0x223367);});};AGIVertices[_0x87d9('0xf')]['ispeechASR']=function(_0x125ed6,_0x47f9d1,_0x1a6159){scripts[_0x87d9('0x7b')](_0x47f9d1,_0x125ed6[_0x87d9('0x78')],_0x125ed6[_0x87d9('0x7c')]||_0x87d9('0x51'),this['isConfigured'](_0x125ed6[_0x87d9('0x7d')])?_0x125ed6['model']:undefined)[_0x87d9('0x12')](function(_0x18568a){_0x1a6159(null,_0x18568a);})[_0x87d9('0x14')](function(_0x26c49e){_0x1a6159(_0x26c49e);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x7e')]=function(_0x5c4a7b,_0x4b5898){scripts['awsPolly'](_0x5c4a7b[_0x87d9('0x7f')],_0x5c4a7b[_0x87d9('0x80')],_0x5c4a7b[_0x87d9('0x81')],_0x5c4a7b[_0x87d9('0x82')]||_0x87d9('0x83'),_0x5c4a7b['text'],_0x5c4a7b[_0x87d9('0x84')]||'text')[_0x87d9('0x12')](function(_0x1304d8){_0x4b5898(null,_0x1304d8);})[_0x87d9('0x14')](function(_0xc03c57){_0x4b5898(_0xc03c57);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x85')]=function(_0x46d472,_0x53c009){scripts[_0x87d9('0x85')](this[_0x87d9('0xc')][_0x87d9('0x2f')],_0x46d472[_0x87d9('0x7f')],_0x46d472[_0x87d9('0x80')],_0x46d472['aws_lex_region'],_0x46d472[_0x87d9('0x4f')],_0x46d472['aws_bot_name'])[_0x87d9('0x12')](function(_0x255cdf){_0x53c009(null,_0x255cdf);})[_0x87d9('0x14')](function(_0x64b146){_0x53c009(_0x64b146);});};AGIVertices[_0x87d9('0xf')]['googleASR']=function(_0x15f887,_0x3fd310,_0xb490b7){scripts[_0x87d9('0x86')](_0x3fd310,_0x15f887[_0x87d9('0x78')],_0x15f887['google_asr_language']||_0x87d9('0x51'))['then'](function(_0x5427e9){_0xb490b7(null,_0x5427e9);})[_0x87d9('0x14')](function(_0x22289b){_0xb490b7(_0x22289b);});};AGIVertices[_0x87d9('0xf')]['tildeASR']=function(_0x2eb866,_0x4c15a2,_0x30d07d){scripts[_0x87d9('0x87')](_0x4c15a2,_0x2eb866[_0x87d9('0x88')],_0x2eb866[_0x87d9('0x89')],_0x2eb866[_0x87d9('0x66')])[_0x87d9('0x12')](function(_0x13d66c){_0x30d07d(null,_0x13d66c);})[_0x87d9('0x14')](function(_0x2fbeb9){_0x30d07d(_0x2fbeb9);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x8a')]=function(_0x1ea2a6){var _0x18eedc=_['includes'](verticesWithRetry,_0x1ea2a6['agicommand'])?_0x1ea2a6:_['clone'](_0x1ea2a6);for(var _0x25cb7f in _0x18eedc){if(_0x18eedc[_0x87d9('0x8b')](_0x25cb7f)){if(_0x18eedc[_0x25cb7f]&&_[_0x87d9('0x8c')](_0x18eedc[_0x25cb7f])){if(_[_0x87d9('0x8d')](recursiveMapAttributes,_0x25cb7f)){_0x18eedc[_0x25cb7f]=this[_0x87d9('0x8e')](_0x18eedc[_0x25cb7f]);}else{_0x18eedc[_0x25cb7f]=this[_0x87d9('0x8f')](_0x18eedc[_0x25cb7f]);}}}}return _0x18eedc;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x90')]=function(_0x86130f){for(var _0x3c5cb9 in _0x86130f){if(_0x86130f[_0x87d9('0x8b')](_0x3c5cb9)){if(_[_0x87d9('0x91')](_0x86130f[_0x3c5cb9])){this[_0x87d9('0x90')](_0x86130f[_0x3c5cb9]);}else if(_[_0x87d9('0x92')](_0x86130f[_0x3c5cb9])){for(var _0x2e4a48=0x0;_0x2e4a48<_0x86130f[_0x3c5cb9][_0x87d9('0x93')];_0x2e4a48++){this[_0x87d9('0x90')](_0x86130f[_0x3c5cb9][_0x2e4a48]);}}else if(_[_0x87d9('0x8c')](_0x86130f[_0x3c5cb9])){_0x86130f[_0x3c5cb9]=this[_0x87d9('0x8f')](_0x86130f[_0x3c5cb9]);}}}};AGIVertices[_0x87d9('0xf')]['saveRestApiResult']=function(_0x3d8657,_0x585f94){for(var _0x5e6fad in _0x3d8657){if(_0x3d8657[_0x87d9('0x8b')](_0x5e6fad)){if(_[_0x87d9('0x91')](_0x3d8657[_0x5e6fad])){if(!_['isEmpty'](_0x3d8657[_0x5e6fad])){this[_0x87d9('0x94')](_0x3d8657[_0x5e6fad],util['format'](_0x87d9('0x95'),_0x585f94,_0x5e6fad));}}else if(_[_0x87d9('0x92')](_0x3d8657[_0x5e6fad])){for(var _0x55aa60=0x0;_0x55aa60<_0x3d8657[_0x5e6fad]['length'];_0x55aa60++){this[_0x87d9('0x94')](_0x3d8657[_0x5e6fad][_0x55aa60],util[_0x87d9('0x24')](_0x87d9('0x95'),_0x585f94,_0x5e6fad+'['+_0x55aa60+']'));}}else{if(!_[_0x87d9('0x3b')](_0x3d8657[_0x5e6fad])){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x95'),_0x585f94,_0x5e6fad),_0x3d8657[_0x5e6fad]);}}}}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x8e')]=function(_0x5180fe){try{var _0x187194=JSON[_0x87d9('0x60')](_0x5180fe);this[_0x87d9('0x90')](_0x187194);return JSON[_0x87d9('0x68')](_0x187194);}catch(_0x46494b){return this[_0x87d9('0x8f')](_0x5180fe);}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x8f')]=function(_0x2ab3bf){var _0x3badaa=_0x2ab3bf[_0x87d9('0x97')]('{');for(var _0xd80066=0x1;_0xd80066<_0x3badaa[_0x87d9('0x93')];_0xd80066+=0x1){var _0x239dde=_0x3badaa[_0xd80066][_0x87d9('0x97')]('}');if(_0x239dde['length']>0x1){_0x2ab3bf=_0x2ab3bf[_0x87d9('0x98')]('{'+_0x239dde[0x0]+'}',this[_0x87d9('0xc')]['getVariable'](_0x239dde[0x0])[_0x87d9('0x99')]||_0x239dde[0x0]);}}if(_0x3badaa[_0x87d9('0x93')]===0x1){return _0x2ab3bf[_0x87d9('0x41')]();}return this['replaceAllVariables'](_0x2ab3bf);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x9a')]=function(_0x358cd6,_0x17b3f1){var _0x452147=this[_0x87d9('0xc')][_0x87d9('0x10')](_0x358cd6);if(_0x452147['result']===-0x1){return _0x452147;}logger['info'](util['format'](_0x87d9('0x9b'),_0x17b3f1,_0x452147[_0x87d9('0x99')]));return this[_0x87d9('0xc')][_0x87d9('0x96')](_0x17b3f1,_0x452147['extra']);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x9c')]=function(_0x125c9f){return _0x125c9f&&_0x125c9f!=='0'&&_0x125c9f!=='-1'&&_0x125c9f!=='';};AGIVertices[_0x87d9('0xf')]['maxRetry']=function(_0x1381bc){this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x1381bc,'-');_0x1381bc[_0x87d9('0x9d')]=_0x1381bc['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x87d9('0xf')][_0x87d9('0x9e')]=function(_0x4372dd){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x9f'),_0x4372dd[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x4372dd[_0x87d9('0x4f')])){return this[_0x87d9('0xc')]['noop']('no\x20text\x20configured');}var _0x4e32cc='\x22'+_0x4372dd[_0x87d9('0x4f')]+'\x22';if(this[_0x87d9('0x9c')](_0x4372dd['options'])){_0x4e32cc+=','+_0x4372dd['options'];}var _0x19dd61=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0xa1'),_0x4e32cc);if(_0x19dd61[_0x87d9('0xa2')]===-0x1){return _0x19dd61;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4e32cc));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xa4')]=function(_0x132edf){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x132edf[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x132edf[_0x87d9('0xa5')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xa6'));}var _0x3e5711=_0x132edf[_0x87d9('0xa5')];if(this[_0x87d9('0x9c')](_0x132edf['options'])){_0x3e5711+=','+_0x132edf['options'];}var _0x578bc8=this[_0x87d9('0xc')]['exec'](_0x87d9('0xa7'),_0x3e5711);if(_0x578bc8[_0x87d9('0xa2')]===-0x1){return _0x578bc8;}var _0x257fa0=this[_0x87d9('0x9a')]('RECOG_CONFIDENCE()',_0x87d9('0xa8'));if(_0x257fa0[_0x87d9('0xa2')]===-0x1){return _0x257fa0;}var _0x26ae85=this[_0x87d9('0x9a')]('RECOG_INPUT()',_0x87d9('0xa9'));if(_0x26ae85[_0x87d9('0xa2')]===-0x1){return _0x26ae85;}var _0x3e0756=this[_0x87d9('0x9a')]('RECOG_INSTANCE()',_0x87d9('0xaa'));if(_0x3e0756[_0x87d9('0xa2')]===-0x1){return _0x3e0756;}return this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0xab'),_0x3e5711));};AGIVertices['prototype'][_0x87d9('0xac')]=function(_0xdf42b3){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xad'),_0xdf42b3['label']));return this[_0x87d9('0xc')][_0x87d9('0xac')]([_0xdf42b3[_0x87d9('0xae')],_0xdf42b3[_0x87d9('0xaf')]]);};AGIVertices[_0x87d9('0xf')]['answer']=function(_0x4f298e){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4f298e[_0x87d9('0x30')]));if(this['isConfigured'](_0x4f298e[_0x87d9('0x5b')])){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xb0'),_0x4f298e[_0x87d9('0x5b')]));var _0x166abf=this[_0x87d9('0xc')][_0x87d9('0xb1')](_0x4f298e[_0x87d9('0x5b')]);if(_0x166abf[_0x87d9('0xa2')]===-0x1){return _0x166abf;}}return this['channel'][_0x87d9('0xb2')]();};AGIVertices[_0x87d9('0xf')]['callback']=function(_0x12988f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xb3'),_0x12988f[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x12988f[_0x87d9('0x3d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x12988f,_0x87d9('0xb4'));}_0x12988f[_0x87d9('0x40')]=moment();if(this[_0x87d9('0x9c')](_0x12988f['delay'])){_0x12988f[_0x87d9('0x40')]=moment()[_0x87d9('0xb5')](_0x12988f[_0x87d9('0xb6')],'minutes');}if(!this['isConfigured'](_0x12988f[_0x87d9('0xb7')])){_0x12988f['callback_priority']=0x2;}this[_0x87d9('0x36')]['sync'](this,_0x12988f);return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xb8'),_0x12988f[_0x87d9('0x3c')],_0x12988f[_0x87d9('0x3d')],_0x12988f['scheduledAt']));};AGIVertices['prototype'][_0x87d9('0xb9')]=function(_0x272153){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x272153['label']));var _0x43dadc=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x272153[_0x87d9('0xba')],_0x272153[_0x87d9('0x6e')]);if(_0x43dadc['result']===-0x1){return _0x43dadc;}return this['channel'][_0x87d9('0xa3')](util['format']('Executed\x20command\x20%s\x20%s',_0x272153['application'],_0x272153[_0x87d9('0x6e')]));};AGIVertices['prototype'][_0x87d9('0xbb')]=function(_0x36e73f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xbc'),_0x36e73f[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x36e73f['text'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}var _0x2eda8f='\x22'+_0x36e73f[_0x87d9('0x4f')]+'\x22';if(this['isConfigured'](_0x36e73f[_0x87d9('0x6e')])){_0x2eda8f+=','+_0x36e73f[_0x87d9('0x6e')];}var _0x40be7f=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0xa1'),_0x2eda8f);if(_0x40be7f[_0x87d9('0xa2')]===-0x1){return _0x40be7f;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xbe'),_0x2eda8f));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xbf')]=function(_0x5808d9){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5808d9[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x5808d9['text'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20text\x20configured');}var _0x2abf7c='\x22'+_0x5808d9['text']+'\x22';if(this[_0x87d9('0x9c')](_0x5808d9[_0x87d9('0x6e')])){_0x2abf7c+=','+_0x5808d9['options'];}var _0x357767=this[_0x87d9('0xc')][_0x87d9('0xa0')]('MRCPSynth',_0x2abf7c);if(_0x357767['result']===-0x1){return _0x357767;}return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xbe'),_0x2abf7c));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xc0')]=function(_0x42937d){logger['info'](util[_0x87d9('0x24')](_0x87d9('0xc1'),_0x42937d['label']));if(!this[_0x87d9('0x9c')](_0x42937d[_0x87d9('0xa5')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xa6'));}var _0x19f24b=_0x42937d[_0x87d9('0xa5')];if(this[_0x87d9('0x9c')](_0x42937d['options'])){_0x19f24b+=','+_0x42937d[_0x87d9('0x6e')];}var _0x170566=this['channel'][_0x87d9('0xa0')](_0x87d9('0xa7'),_0x19f24b);if(_0x170566['result']===-0x1){return _0x170566;}var _0x545536=this['getAndSetVariable'](_0x87d9('0xc2'),_0x87d9('0xc3'));if(_0x545536[_0x87d9('0xa2')]===-0x1){return _0x545536;}var _0x1294fa=this[_0x87d9('0x9a')](_0x87d9('0xc4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1294fa['result']===-0x1){return _0x1294fa;}var _0xd94569=this[_0x87d9('0x9a')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0xd94569[_0x87d9('0xa2')]===-0x1){return _0xd94569;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xab'),_0x19f24b));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xc5')]=function(_0x111ad1){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xc6'),_0x111ad1[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x111ad1['grammar'])){return this['channel'][_0x87d9('0xa3')]('no\x20grammar\x20configured');}var _0x4163d3=_0x111ad1[_0x87d9('0xa5')];if(this[_0x87d9('0x9c')](_0x111ad1[_0x87d9('0x6e')])){_0x4163d3+=','+_0x111ad1['options'];}var _0x36d2f6=this[_0x87d9('0xc')]['exec']('MRCPRecog',_0x4163d3);if(_0x36d2f6['result']===-0x1){return _0x36d2f6;}var _0x336465=this[_0x87d9('0x9a')]('RECOG_CONFIDENCE()',_0x87d9('0xc7'));if(_0x336465[_0x87d9('0xa2')]===-0x1){return _0x336465;}var _0x2bf2db=this['getAndSetVariable']('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x2bf2db[_0x87d9('0xa2')]===-0x1){return _0x2bf2db;}var _0x440cb3=this['getAndSetVariable'](_0x87d9('0xc8'),_0x87d9('0xc9'));if(_0x440cb3[_0x87d9('0xa2')]===-0x1){return _0x440cb3;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0xab'),_0x4163d3));};AGIVertices[_0x87d9('0xf')]['database']=function(_0x4c4fe1){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xca'),_0x4c4fe1[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x4c4fe1[_0x87d9('0xcb')])){return this[_0x87d9('0xc')]['error'](_0x4c4fe1,_0x87d9('0xcc'));}var _0x2e3d36=this['getSquareOdbc'][_0x87d9('0x65')](this,_0x4c4fe1[_0x87d9('0xcb')]);if(!_0x2e3d36){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x4c4fe1,_0x87d9('0xcd'));}if(!this['isConfigured'](_0x4c4fe1[_0x87d9('0x29')])){return this['channel'][_0x87d9('0x27')](_0x4c4fe1,'no\x20query\x20configured');}var _0x3940d2=_0x4c4fe1[_0x87d9('0x29')][_0x87d9('0xce')](/(\r\n|\n|\r)/gm,'\x20');this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0xcf'),_0x3940d2));var _0xb1251b=this[_0x87d9('0xd0')]['sync'](this,_0x2e3d36,_0x3940d2);this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x4c4fe1,_0x3940d2);if(!this[_0x87d9('0x9c')](_0x4c4fe1[_0x87d9('0xd1')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xd2'));}var _0x39ce04=this[_0x87d9('0x10')]['sync'](this,_0x4c4fe1[_0x87d9('0xd1')]);if(!_0x39ce04){return this['channel'][_0x87d9('0x27')](_0x4c4fe1,_0x87d9('0xd3'));}var _0x59575b=this;_0xb1251b[_0x87d9('0xd4')](function(_0x2cd6b9,_0x283c6a){Object[_0x87d9('0xd5')](_0x2cd6b9)[_0x87d9('0xd4')](function(_0x5ca0d5){_0x59575b['channel']['setVariable'](util[_0x87d9('0x24')](_0x87d9('0xd6'),_0x39ce04,_0x283c6a,_0x5ca0d5),_0x2cd6b9[_0x5ca0d5]);});});this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0xd7'),_0x39ce04),_0xb1251b[_0x87d9('0x93')]);return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0xd8'),_0x39ce04));};AGIVertices['prototype'][_0x87d9('0xd9')]=function(_0x3b3deb){logger['debug'](util['format'](_0x87d9('0xda'),_0x3b3deb[_0x87d9('0x30')]));if(!this['isConfigured'](_0x3b3deb[_0x87d9('0xdb')])){return this['channel'][_0x87d9('0x27')](_0x3b3deb,_0x87d9('0xdc'));}var _0x26c1bd=this['getUser'][_0x87d9('0x65')](this,_0x3b3deb[_0x87d9('0xdb')]);if(!_0x26c1bd){return this['channel'][_0x87d9('0x27')](_0x3b3deb,'no\x20user\x20found');}var _0x305e67=this[_0x87d9('0xc')]['exec'](_0x87d9('0xdd'),[util[_0x87d9('0x24')](_0x87d9('0xde'),_0x26c1bd),_0x3b3deb['timeout'],_0x3b3deb['opts'],_0x3b3deb[_0x87d9('0x59')]]);if(_0x305e67['result']===-0x1){return _0x305e67;}return this['channel']['noop'](util[_0x87d9('0x24')](_0x87d9('0xdf'),_0x87d9('0xdd')));};AGIVertices['prototype']['dialogflow']=function(_0x33db9b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xe0'),_0x33db9b[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x33db9b[_0x87d9('0x78')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xe1'));}if(!this[_0x87d9('0x9c')](_0x33db9b[_0x87d9('0x4f')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this['channel']['bot']=!![];this[_0x87d9('0x2e')](_0x33db9b);this[_0x87d9('0xe2')](_0x33db9b[_0x87d9('0x4f')],'in','','');this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xe3'),_0x33db9b['text']));var _0x53d061=this['googleDialogflow'][_0x87d9('0x65')](this,_0x33db9b);if(_0x53d061){for(var _0x31b2fe in _0x53d061){if(_0x53d061['hasOwnProperty'](_0x31b2fe)){this['channel'][_0x87d9('0x96')](util[_0x87d9('0x24')]('DIALOGFLOW_%s',_0x31b2fe['toUpperCase']()),_0x53d061[_0x31b2fe]);}}this['createSquareMessage'](_0x53d061[_0x87d9('0xe4')],_0x87d9('0xe5'),_0x87d9('0xe6'),'');return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xe7'),_0x53d061['speech']));}return this['channel'][_0x87d9('0x27')](_0x33db9b,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x87d9('0xf')][_0x87d9('0xe8')]=function(_0x2bd9cc){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2bd9cc[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x2bd9cc[_0x87d9('0x72')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xe9'));}if(!this['isConfigured'](_0x2bd9cc['client_email'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xea'));}if(!this[_0x87d9('0x9c')](_0x2bd9cc[_0x87d9('0x74')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xeb'));}if(!this[_0x87d9('0x9c')](_0x2bd9cc[_0x87d9('0x75')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xec'));}if(!this['isConfigured'](_0x2bd9cc[_0x87d9('0x4f')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xed')]=!![];this[_0x87d9('0x2e')](_0x2bd9cc);this[_0x87d9('0xe2')](_0x2bd9cc[_0x87d9('0x4f')],'in','','');this['channel'][_0x87d9('0xa3')](util['format'](_0x87d9('0xee'),_0x2bd9cc['text']));var _0x5c7b2e=this[_0x87d9('0x71')][_0x87d9('0x65')](this,_0x2bd9cc);if(_0x5c7b2e){for(var _0xe0c7b0 in _0x5c7b2e){if(_0x5c7b2e[_0x87d9('0x8b')](_0xe0c7b0)){if(_0xe0c7b0!==_0x87d9('0xef')){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0xf0'),_0xe0c7b0[_0x87d9('0xf1')]()),_0x5c7b2e[_0xe0c7b0]);}}}this[_0x87d9('0xe2')](_0x5c7b2e[_0x87d9('0xe4')],_0x87d9('0xe5'),'dialogflowV2',_0x5c7b2e[_0x87d9('0xef')]);return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0xf2'),_0x5c7b2e[_0x87d9('0xe4')]));}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x2bd9cc,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x87d9('0xf')][_0x87d9('0xf3')]=function(_0x589334){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x589334['label']));if(!this[_0x87d9('0x9c')](_0x589334[_0x87d9('0xf4')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xf5'));}if(!this['isConfigured'](_0x589334[_0x87d9('0xf6')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xf7'));}if(!this[_0x87d9('0x9c')](_0x589334[_0x87d9('0xf8')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20password\x20configured');}if(!this[_0x87d9('0x9c')](_0x589334[_0x87d9('0xf9')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x589334);this[_0x87d9('0xe2')](_0x589334[_0x87d9('0x4f')],'in','','');this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xfa'),_0x589334[_0x87d9('0x4f')]));var _0x1fbab1=this[_0x87d9('0x76')][_0x87d9('0x65')](this,_0x589334);if(_0x1fbab1){for(var _0x28c112 in _0x1fbab1){if(_0x1fbab1[_0x87d9('0x8b')](_0x28c112)){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0xfb'),_0x28c112['toUpperCase']()),_0x1fbab1[_0x28c112]);}}this[_0x87d9('0xe2')](_0x1fbab1['speech'],'out','sesteknda','');if(_0x1fbab1[_0x87d9('0xfc')]){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xfd'),_0x1fbab1[_0x87d9('0xfc')]));var _0x4b8ccc=this['channel'][_0x87d9('0xfe')](_0x1fbab1[_0x87d9('0xfc')]);try{fs[_0x87d9('0xff')](_0x1fbab1[_0x87d9('0xfc')]+'.wav');}catch(_0x14ba94){logger[_0x87d9('0x27')](_0x14ba94);}return _0x4b8ccc;}else{return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x100'),_0x1fbab1[_0x87d9('0xe4')]));}}return this[_0x87d9('0xc')]['error'](_0x589334,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x87d9('0x101')]=function(_0x54577f){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x102'),_0x54577f['label']));return this[_0x87d9('0xc')]['noop'](_0x87d9('0x101'));};AGIVertices[_0x87d9('0xf')]['ext_dial']=function(_0x35ffa5){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x103'),_0x35ffa5['label']));var _0xbb3b3b='';if(_0x35ffa5[_0x87d9('0x104')]){if(!this[_0x87d9('0x9c')](_0x35ffa5[_0x87d9('0x104')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x35ffa5,_0x87d9('0x105'));}else{var _0x5e1e67=parseInt(_0x35ffa5[_0x87d9('0x104')],0xa);if(isNaN(_0x5e1e67)){_0xbb3b3b=_0x35ffa5[_0x87d9('0x104')];}else{_0xbb3b3b=this[_0x87d9('0x1c')]['sync'](this,_0x35ffa5[_0x87d9('0x104')]);if(!_0xbb3b3b){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x35ffa5,_0x87d9('0x106'));}}}}else if(_0x35ffa5[_0x87d9('0x107')]){_0xbb3b3b=_0x35ffa5['trunk_name'];}else{return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x35ffa5,'no\x20trunk\x20selected');}var _0x389a5e=this[_0x87d9('0xc')]['exec'](_0x87d9('0xdd'),[util['format'](_0x87d9('0x108'),_0xbb3b3b,_0x35ffa5[_0x87d9('0x3c')]),_0x35ffa5[_0x87d9('0x5b')],_0x35ffa5['opts'],_0x35ffa5[_0x87d9('0x59')]]);if(_0x389a5e[_0x87d9('0xa2')]===-0x1){return _0x389a5e;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xdf'),_0x87d9('0xdd')));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x109')]=function(_0x5e1d27){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5e1d27[_0x87d9('0x30')]));return this[_0x87d9('0xc')][_0x87d9('0xa3')]('finally');};AGIVertices[_0x87d9('0xf')][_0x87d9('0x10a')]=function(_0x528ca7){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x10b'),_0x528ca7['label']));if(_0x528ca7['retry']===0x0){return this[_0x87d9('0x10c')](_0x528ca7);}_0x528ca7[_0x87d9('0x9d')]-=0x1;if(!this[_0x87d9('0x9c')](_0x528ca7[_0x87d9('0x10d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x528ca7,_0x87d9('0x10e'));}var _0x2567a7=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x528ca7[_0x87d9('0x10d')]);if(!_0x2567a7){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x528ca7,_0x87d9('0x110'));}if(!this[_0x87d9('0x9c')](_0x528ca7[_0x87d9('0xd1')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x87d9('0xd2'));}var _0xf33548=this[_0x87d9('0xc')][_0x87d9('0x111')](_0x2567a7,_0x528ca7[_0x87d9('0x112')],_0x528ca7[_0x87d9('0x113')]);var _0x186a7a=_0xf33548[_0x87d9('0xa2')]?_0xf33548[_0x87d9('0xa2')][_0x87d9('0x41')]():'';logger[_0x87d9('0x28')]('test',JSON[_0x87d9('0x68')](_0xf33548));if(_0xf33548[_0x87d9('0xa2')]===-0x1){this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,_0x186a7a);return _0xf33548;}else if(_0xf33548[_0x87d9('0x99')]===_0x87d9('0x5b')){_0xf33548[_0x87d9('0xa2')]=_0x186a7a[_0x87d9('0x93')]>=parseInt(_0x528ca7[_0x87d9('0x114')])?'x':'i';}else{_0xf33548[_0x87d9('0xa2')]=_0x186a7a[_0x87d9('0x93')]>=parseInt(_0x528ca7['mindigit'])&&_0x186a7a[_0x87d9('0x93')]<=parseInt(_0x528ca7['maxdigit'])?'x':'i';}var _0x31a259=this[_0x87d9('0x10')]['sync'](this,_0x528ca7[_0x87d9('0xd1')]);if(!_0x31a259){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x528ca7,_0x87d9('0xd3'));}this[_0x87d9('0xc')][_0x87d9('0x96')](_0x31a259,_0x186a7a);if(this[_0x87d9('0x9c')](_0x528ca7[_0x87d9('0x115')])){var _0x122ca4=parseInt(_0x528ca7['hiddendigitsnum'],0xa);var _0x532ab3=rs[_0x87d9('0x116')]({'charset':'*','length':_0x122ca4});var _0x1611c2=_0x186a7a[_0x87d9('0x93')];if(_0x1611c2>0x0){if(_0x1611c2>_0x122ca4){this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,_0x528ca7[_0x87d9('0x117')]===_0x87d9('0x118')?_0x532ab3+_0x186a7a[_0x87d9('0x119')](_0x122ca4):_0x186a7a['substr'](0x0,_0x1611c2-_0x122ca4)+_0x532ab3);}else{this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,rs[_0x87d9('0x116')]({'charset':'*','length':_0x1611c2}));}}else{this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,'');}}else{this[_0x87d9('0x2e')]['sync'](this,_0x528ca7,_0x186a7a);}return _0xf33548;};AGIVertices[_0x87d9('0xf')][_0x87d9('0xb')]=function(_0xe22b7d){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x11a'),_0xe22b7d[_0x87d9('0x30')]));return this[_0x87d9('0x10a')](_0xe22b7d);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x11b')]=function(_0x36dbf8){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x36dbf8[_0x87d9('0x30')]));this[_0x87d9('0x2e')]['sync'](this,_0x36dbf8,_0x36dbf8[_0x87d9('0x11c')]);return this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x11d'),_0x36dbf8[_0x87d9('0x11c')]));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x11e')]=function(_0x46c85b){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x11f'),_0x46c85b[_0x87d9('0x30')]));if(!this['isConfigured'](_0x46c85b[_0x87d9('0x7f')])||!this['isConfigured'](_0x46c85b[_0x87d9('0x80')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0x120'));}if(!this[_0x87d9('0x9c')](_0x46c85b[_0x87d9('0x4f')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Trying\x20aws\x20Polly\x20%s',_0x46c85b[_0x87d9('0x4f')]));var _0x12b3c7=this['awsPolly'][_0x87d9('0x65')](this,_0x46c85b);if(_0x12b3c7){this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x12b3c7));var _0x5dfed9=this[_0x87d9('0xc')][_0x87d9('0xfe')](_0x12b3c7);try{fs[_0x87d9('0xff')](_0x12b3c7+_0x87d9('0x121'));}catch(_0x19c529){logger[_0x87d9('0x27')](_0x19c529);}return _0x5dfed9;}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x46c85b,_0x87d9('0x122'));};AGIVertices['prototype'][_0x87d9('0x123')]=function(_0x251d20){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x124'),_0x251d20['label']));if(!this[_0x87d9('0x9c')](_0x251d20['aws_access_key_id'])||!this[_0x87d9('0x9c')](_0x251d20[_0x87d9('0x80')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x251d20[_0x87d9('0x125')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0x126'));}if(!this[_0x87d9('0x9c')](_0x251d20[_0x87d9('0x4f')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')]['bot']=!![];this['createSquareDetailsReport'](_0x251d20);this['createSquareMessage'](_0x251d20[_0x87d9('0x4f')],'in','','');this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x127'),_0x251d20[_0x87d9('0x4f')]));var _0x2e4e9d=this['awsLex'][_0x87d9('0x65')](this,_0x251d20);if(_0x2e4e9d){for(var _0x360ac9 in _0x2e4e9d){if(_0x2e4e9d[_0x87d9('0x8b')](_0x360ac9)&&_[_0x87d9('0x8c')](_0x2e4e9d[_0x360ac9])){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x128'),_0x360ac9[_0x87d9('0xf1')]()),_0x2e4e9d[_0x360ac9]);}}if(_[_0x87d9('0x3b')](_0x2e4e9d[_0x87d9('0x6c')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0x129'));}else{this[_0x87d9('0xe2')](_0x2e4e9d[_0x87d9('0x6c')],_0x87d9('0xe5'),'amazonlex','');return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x12a'),_0x2e4e9d[_0x87d9('0x6c')]));}}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x251d20,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x87d9('0x12b')]=function(_0x1b0873){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x12c'),_0x1b0873[_0x87d9('0x30')],_0x1b0873['timeout']));if(!this[_0x87d9('0x9c')](_0x1b0873[_0x87d9('0x78')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xe1'));}var _0x11f596='wav';var _0x5d10a7=util[_0x87d9('0x24')](_0x87d9('0x12d'),FILES_PATH,rs[_0x87d9('0x116')](0x4));var _0x17cdde=util[_0x87d9('0x24')](_0x87d9('0x95'),_0x5d10a7,_0x11f596);var _0x329850=!![];if(_0x1b0873['beep']===_0x87d9('0x12e')){_0x329850=![];}var _0x31a58a=this[_0x87d9('0xc')][_0x87d9('0x12f')](_0x5d10a7,_0x11f596,_0x1b0873['intKey'],_0x1b0873[_0x87d9('0x5b')],undefined,_0x329850);if(_0x31a58a[_0x87d9('0xa2')]!==-0x1){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('google\x20%s\x20file\x20created',_0x17cdde));var _0x1b6950=this[_0x87d9('0x86')][_0x87d9('0x65')](this,_0x1b0873,_0x17cdde);if(_0x1b6950){for(var _0x14cb8e in _0x1b6950){if(_0x1b6950[_0x87d9('0x8b')](_0x14cb8e)){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x130'),_0x14cb8e[_0x87d9('0xf1')]()),_0x1b6950[_0x14cb8e]);}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x131'),JSON[_0x87d9('0x68')](_0x1b6950)));}}return _0x31a58a;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x132')]=function(_0x4a6e32){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x133'),_0x4a6e32[_0x87d9('0x30')]));if(!this['isConfigured'](_0x4a6e32['appid'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0x134'));}if(!this[_0x87d9('0x9c')](_0x4a6e32[_0x87d9('0x89')])){return this[_0x87d9('0xc')]['noop']('no\x20appsecret\x20configured');}var _0x20fde3=_0x87d9('0x135');var _0x505eee=util[_0x87d9('0x24')](_0x87d9('0x12d'),FILES_PATH,rs[_0x87d9('0x116')](0x4));var _0x15d703=util[_0x87d9('0x24')](_0x87d9('0x95'),_0x505eee,_0x20fde3);var _0x45b718=!![];if(_0x4a6e32[_0x87d9('0x136')]===_0x87d9('0x12e')){_0x45b718=![];}var _0x39bb24=this[_0x87d9('0xc')][_0x87d9('0x12f')](_0x505eee,_0x20fde3,_0x4a6e32[_0x87d9('0x137')],_0x4a6e32[_0x87d9('0x5b')],undefined,_0x45b718);if(_0x39bb24['result']!==-0x1){this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x138'),_0x15d703));var _0x4fd0e7=this[_0x87d9('0x87')][_0x87d9('0x65')](this,_0x4a6e32,_0x15d703);if(_0x4fd0e7){for(var _0x40e52a in _0x4fd0e7){if(_0x4fd0e7[_0x87d9('0x8b')](_0x40e52a)){this['channel'][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x139'),_0x40e52a[_0x87d9('0xf1')]()),_0x4fd0e7[_0x40e52a]);}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x13a'),JSON['stringify'](_0x4fd0e7)));}}return _0x39bb24;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x13b')]=function(_0x2f78be){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x13c'),_0x2f78be['label']));return this[_0x87d9('0xc')][_0x87d9('0x13d')](_0x2f78be[_0x87d9('0x13e')],_0x2f78be['extension'],_0x2f78be['priority']);};AGIVertices['prototype']['gotoif']=function(_0x359e50){logger['info'](util['format'](_0x87d9('0x13f'),_0x359e50[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x359e50['condition'])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x359e50,'no\x20condition\x20configured');}try{var _0x12113f=eval(_0x359e50[_0x87d9('0x140')])?_0x87d9('0x141'):_0x87d9('0x142');this['channel'][_0x87d9('0xa3')](util['format'](_0x87d9('0x143'),_0x359e50[_0x87d9('0x140')],_0x12113f));return{'code':0xc8,'result':_0x12113f};}catch(_0x120b36){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x144')]=function(_0x2a0f66){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2a0f66[_0x87d9('0x30')]));if(!this['isConfigured'](_0x2a0f66[_0x87d9('0x145')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x2a0f66,_0x87d9('0x146'));}var _0x1a986b=this['getIntervals'][_0x87d9('0x65')](this,_0x2a0f66[_0x87d9('0x145')]);if(!_0x1a986b){return this['channel']['error'](_0x2a0f66,_0x87d9('0x147'));}for(var _0x29980a=0x0;_0x29980a<_0x1a986b[_0x87d9('0x93')];_0x29980a+=0x1){var _0x4f298d=this[_0x87d9('0xc')][_0x87d9('0x10')](util['format'](_0x87d9('0x148'),_0x1a986b[_0x29980a]));if(_0x4f298d['result']===-0x1){return _0x4f298d;}logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x4f298d[_0x87d9('0x99')]));if(_0x4f298d[_0x87d9('0x99')]===_0x87d9('0x141')){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x87d9('0x141')));this['channel']['noop'](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x87d9('0x141')));return{'code':0xc8,'result':_0x87d9('0x141')};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],'false'));this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x87d9('0x142')));}}return{'code':0xc8,'result':_0x87d9('0x142')};};AGIVertices[_0x87d9('0xf')][_0x87d9('0x14a')]=function(_0x5652c2){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x14b'),_0x5652c2[_0x87d9('0x30')]));return this[_0x87d9('0xc')][_0x87d9('0x14a')]();};AGIVertices['prototype'][_0x87d9('0x14c')]=function(_0xf62dff){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x14d'),_0xf62dff[_0x87d9('0x30')]));if(!this['isConfigured'](_0xf62dff[_0x87d9('0x78')])){return this['channel'][_0x87d9('0xa3')]('no\x20key\x20configured');}var _0x3b0ebf=_0x87d9('0x135');var _0x106dc5=util[_0x87d9('0x24')]('%s/recordings/%s',FILES_PATH,rs[_0x87d9('0x116')](0x4));var _0x238b31=util[_0x87d9('0x24')](_0x87d9('0x95'),_0x106dc5,_0x3b0ebf);var _0x25e474=!![];if(_0xf62dff['beep']==='NOBEEP'){_0x25e474=![];}var _0x1f82a8=this['channel'][_0x87d9('0x12f')](_0x106dc5,_0x3b0ebf,_0xf62dff['intKey'],_0xf62dff[_0x87d9('0x5b')],undefined,_0x25e474);if(_0x1f82a8[_0x87d9('0xa2')]!==-0x1){this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')]('ispeech\x20%s\x20file\x20created',_0x238b31));var _0x5c3756=this['ispeechASR'][_0x87d9('0x65')](this,_0xf62dff,_0x238b31);if(_0x5c3756){for(var _0x3298b1 in _0x5c3756){if(_0x5c3756[_0x87d9('0x8b')](_0x3298b1)){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x14e'),_0x3298b1['toUpperCase']()),_0x5c3756[_0x3298b1]);}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x5c3756)));}}return _0x1f82a8;};AGIVertices[_0x87d9('0xf')]['ispeechtts']=function(_0x50aaac){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x14f'),_0x50aaac[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x50aaac[_0x87d9('0x78')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xe1'));}if(!this[_0x87d9('0x9c')](_0x50aaac[_0x87d9('0x4f')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x150'),_0x50aaac['text']));var _0x271192=this['ispeechTTS'][_0x87d9('0x65')](this,_0x50aaac);if(_0x271192){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x151'),_0x271192));var _0x7a0cc2=this['channel'][_0x87d9('0xfe')](_0x271192,_0x50aaac[_0x87d9('0x137')]);try{fs[_0x87d9('0xff')](_0x271192+'.wav');}catch(_0x3d0279){logger[_0x87d9('0x27')](_0x3d0279);}return _0x7a0cc2;}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x50aaac,_0x87d9('0x152'));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x153')]=function(_0x5635d2){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x154'),_0x5635d2['label']));if(!this[_0x87d9('0x9c')](_0x5635d2['findBy'])){return this[_0x87d9('0xc')]['error'](_0x5635d2,_0x87d9('0x155'));}logger['info'](util[_0x87d9('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x87d9('0xc')]['callerid'],_0x5635d2['findBy']));var _0x2c28e5=this[_0x87d9('0x48')][_0x87d9('0x65')](this,_0x5635d2[_0x87d9('0x156')]);if(_0x2c28e5){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x157'),this['channel'][_0x87d9('0x47')],_0x5635d2[_0x87d9('0x156')]));this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x87d9('0xc')][_0x87d9('0x47')],_0x5635d2['findBy']));return{'code':0xc8,'result':_0x87d9('0x158')};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x5635d2[_0x87d9('0x156')]));this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x5635d2[_0x87d9('0x156')]));return{'code':0xc8,'result':_0x87d9('0x15a')};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x15b')]=function(_0x1ea608){logger['info'](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1ea608[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x1ea608['findBy'])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x1ea608,_0x87d9('0x155'));}logger['info'](util[_0x87d9('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x87d9('0xc')][_0x87d9('0x47')],_0x1ea608[_0x87d9('0x156')]));var _0xac1ea4=this['agentLogout'][_0x87d9('0x65')](this,_0x1ea608[_0x87d9('0x156')]);if(_0xac1ea4){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x157'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x1ea608['findBy']));this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x157'),this[_0x87d9('0xc')]['callerid'],_0x1ea608['findBy']));return{'code':0xc8,'result':_0x87d9('0x158')};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')]['callerid'],_0x1ea608[_0x87d9('0x156')]));this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x1ea608[_0x87d9('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x15c')]=function(_0x5af92b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5af92b[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x5af92b[_0x87d9('0x15d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5af92b,_0x87d9('0x15e'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x15f'),_0x5af92b[_0x87d9('0x15d')]));var _0x42c81e=eval(_0x5af92b[_0x87d9('0x15d')]);if(!this[_0x87d9('0x9c')](_0x5af92b[_0x87d9('0xd1')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xd2'));}var _0x32dfda=this[_0x87d9('0x10')]['sync'](this,_0x5af92b[_0x87d9('0xd1')]);if(!_0x32dfda){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5af92b,_0x87d9('0xd3'));}if(_['isArray'](_0x42c81e)){var _0x21ac4f=this;_0x42c81e['forEach'](function(_0x2a4eb3,_0x128c92){_0x21ac4f[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x160'),_0x32dfda,_0x128c92),_0x2a4eb3);});return this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x161'),_0x32dfda));}else{return this[_0x87d9('0xc')]['setVariable'](_0x32dfda,_0x42c81e);}};AGIVertices[_0x87d9('0xf')]['menu']=function(_0x5ce18e){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x162'),_0x5ce18e[_0x87d9('0x30')]));if(_0x5ce18e['retry']===0x0){return this['maxRetry'](_0x5ce18e);}_0x5ce18e[_0x87d9('0x9d')]-=0x1;if(!this[_0x87d9('0x9c')](_0x5ce18e[_0x87d9('0x10d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5ce18e,_0x87d9('0x10e'));}var _0x235898=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x5ce18e['file_id']);if(!_0x235898){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5ce18e,_0x87d9('0x110'));}var _0x227cd7=this['channel'][_0x87d9('0x111')](_0x235898,_0x5ce18e[_0x87d9('0x112')],_0x5ce18e[_0x87d9('0x163')]);var _0x1c1564=_0x227cd7['result'];if(_0x227cd7['result']===-0x1){this['createSquareDetailsReport'][_0x87d9('0x65')](this,_0x5ce18e,'-1');return _0x227cd7;}else if(_0x227cd7['extra']===_0x87d9('0x5b')){_0x227cd7[_0x87d9('0xa2')]=_0x227cd7[_0x87d9('0xa2')][_0x87d9('0x93')]>0x0?_0x227cd7['result']:'t';}else if(_[_0x87d9('0x37')](_0x227cd7[_0x87d9('0xa2')])){_0x227cd7['result']='#';_0x1c1564='#';}if(!this['isConfigured'](_0x5ce18e[_0x87d9('0xd1')])){this[_0x87d9('0xc')]['noop'](_0x87d9('0xd2'));}else{var _0x5c5007=this['getVariable'][_0x87d9('0x65')](this,_0x5ce18e[_0x87d9('0xd1')]);if(!_0x5c5007){return this[_0x87d9('0xc')]['error'](_0x5ce18e,'no\x20variable\x20found');}this[_0x87d9('0xc')][_0x87d9('0x96')](_0x5c5007,_0x1c1564);}this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x5ce18e,_0x1c1564);return _0x227cd7;};AGIVertices['prototype'][_0x87d9('0xa3')]=function(_0x3176d1){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x164'),_0x3176d1['label']));return this['channel'][_0x87d9('0xa3')](_0x3176d1[_0x87d9('0x165')]||_0x3176d1[_0x87d9('0x30')]);};AGIVertices['prototype'][_0x87d9('0x166')]=function(_0x354ba8){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x354ba8[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x354ba8[_0x87d9('0x156')])){return this[_0x87d9('0xc')]['error'](_0x354ba8,_0x87d9('0x155'));}logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x354ba8[_0x87d9('0x156')]));var _0x4fc43e=this[_0x87d9('0x42')][_0x87d9('0x65')](this,_0x354ba8[_0x87d9('0x167')]);var _0x38e2b2=this[_0x87d9('0x44')][_0x87d9('0x65')](this,_0x354ba8[_0x87d9('0x156')],_0x4fc43e);if(_0x38e2b2){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x157'),this[_0x87d9('0xc')]['callerid'],_0x354ba8[_0x87d9('0x156')]));this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x87d9('0x47')],_0x354ba8[_0x87d9('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x87d9('0x47')],_0x354ba8['findBy']));this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x87d9('0xc')][_0x87d9('0x47')],_0x354ba8[_0x87d9('0x156')]));return{'code':0xc8,'result':_0x87d9('0x15a')};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x168')]=function(_0x18033e){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x169'),_0x18033e[_0x87d9('0x30')]));if(!this['isConfigured'](_0x18033e[_0x87d9('0x10d')])){return this[_0x87d9('0xc')]['error'](_0x18033e,'no\x20file\x20audio\x20selected');}var _0x35426d=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x18033e[_0x87d9('0x10d')]);if(!_0x35426d){return this['channel'][_0x87d9('0x27')](_0x18033e,_0x87d9('0x110'));}var _0xe539ec=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0x16a'),[_0x35426d,_0x18033e[_0x87d9('0x16b')]]);if(_0xe539ec['result']===-0x1){return _0xe539ec;}return this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x16c'),_0x87d9('0x16a'),_0x35426d));};AGIVertices['prototype'][_0x87d9('0x16d')]=function(_0x14f79c){logger[_0x87d9('0x28')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x14f79c[_0x87d9('0x30')]));if(!this['isConfigured'](_0x14f79c[_0x87d9('0x16e')])){return this['channel']['error'](_0x14f79c,'no\x20queue\x20selected');}var _0x34426c='';var _0x6fda9f=parseInt(_0x14f79c[_0x87d9('0x16e')],0xa);if(isNaN(_0x6fda9f)){_0x34426c=_0x14f79c[_0x87d9('0x16e')];}else{_0x34426c=this[_0x87d9('0x15')][_0x87d9('0x65')](this,_0x14f79c[_0x87d9('0x16e')]);if(!_0x34426c){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x14f79c,_0x87d9('0x16f'));}}var _0x54501e='';if(this['isConfigured'](_0x14f79c[_0x87d9('0x10d')])){var _0x5334c5=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x14f79c[_0x87d9('0x10d')]);if(_0x5334c5){_0x54501e=_0x5334c5;}}this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x14f79c,_0x34426c);if(_0x14f79c[_0x87d9('0x16b')][_0x87d9('0x170')]('x')<0x0){_0x14f79c['opts']+='x';}if(_0x14f79c[_0x87d9('0x16b')]['indexOf']('X')<0x0){_0x14f79c[_0x87d9('0x16b')]+='X';}this[_0x87d9('0xc')][_0x87d9('0x96')](_0x87d9('0x171'),_0x34426c?_0x34426c[_0x87d9('0x172')]():'');var _0x5f2819=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0x173'),[_0x34426c,_0x14f79c['opts'],_0x14f79c[_0x87d9('0x59')],_0x54501e,_0x14f79c[_0x87d9('0x5b')],_0x14f79c[_0x87d9('0xac')],_0x14f79c[_0x87d9('0x174')],_0x14f79c['gosub'],'',_0x14f79c[_0x87d9('0x175')]]);if(_0x5f2819[_0x87d9('0xa2')]===-0x1){return _0x5f2819;}return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Executed\x20command\x20%s\x20%s',_0x87d9('0x173'),_0x34426c));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x176')]=function(_0x21a9c3){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x21a9c3[_0x87d9('0x30')]));var _0x44f9ab=_0x21a9c3['recordingFormat']||'wav';var _0x2baf8b=util[_0x87d9('0x24')]('%s_%s',this['channel'][_0x87d9('0x2f')],rs[_0x87d9('0x116')](0x5));var _0x553081=util[_0x87d9('0x24')]('%s/recordings/%s.%s',FILES_PATH,_0x2baf8b,_0x44f9ab);var _0x196fef=util[_0x87d9('0x24')](_0x87d9('0x12d'),FILES_PATH,_0x2baf8b);this['createSquareRecording'][_0x87d9('0x65')](this,_0x21a9c3,_0x2baf8b,_0x553081);this[_0x87d9('0xc')]['setVariable'](_0x87d9('0x177'),_0x2baf8b);logger[_0x87d9('0x28')](_0x87d9('0x178'),_0x196fef,_0x44f9ab,_0x21a9c3[_0x87d9('0x179')],_0x21a9c3[_0x87d9('0x5b')]);return this[_0x87d9('0xc')]['recordFile'](_0x196fef,_0x44f9ab,_0x21a9c3[_0x87d9('0x179')],_0x21a9c3[_0x87d9('0x5b')],undefined,!![]);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x17a')]=function(_0x2d86f1){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x17b'),_0x2d86f1[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x2d86f1[_0x87d9('0x59')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0x17c'));}var _0x5af1dd=this[_0x87d9('0x58')][_0x87d9('0x65')](this,_0x2d86f1);logger[_0x87d9('0x28')](util['format'](_0x87d9('0x17d'),util['inspect'](_0x5af1dd,{'showHidden':![],'depth':null})));if(!this[_0x87d9('0x9c')](_0x2d86f1[_0x87d9('0xd1')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1a1591=this['getVariable'][_0x87d9('0x65')](this,_0x2d86f1['variable_id']);if(!_0x1a1591){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x2d86f1,'no\x20variable\x20found');}this[_0x87d9('0xc')][_0x87d9('0x96')](util['format']('%s_STATUS_CODE',_0x1a1591),_0x5af1dd[_0x87d9('0x6a')]?_0x5af1dd[_0x87d9('0x6a')]:'200');this[_0x87d9('0xc')]['setVariable'](util[_0x87d9('0x24')](_0x87d9('0x17e'),_0x1a1591),_0x5af1dd[_0x87d9('0x6b')]?_0x5af1dd[_0x87d9('0x6b')]:'OK');if(_0x5af1dd[_0x87d9('0x5f')]){try{this[_0x87d9('0x94')](_0x5af1dd[_0x87d9('0x5f')],_0x1a1591);}catch(_0x36a974){logger[_0x87d9('0x27')](util[_0x87d9('0x24')](_0x87d9('0x17f'),_0x1a1591));}}return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')]('variable\x20%s\x20set',_0x1a1591));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x180')]=function(_0x11040b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x181'),_0x11040b[_0x87d9('0x30')]));return this[_0x87d9('0xc')]['sayDigits'](_0x11040b['digits'][_0x87d9('0xce')](/\s+/g,''),_0x11040b[_0x87d9('0x179')]);};AGIVertices['prototype'][_0x87d9('0x182')]=function(_0x29c377){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x183'),_0x29c377['label']));return this[_0x87d9('0xc')][_0x87d9('0x184')](_0x29c377[_0x87d9('0x5c')]['replace'](/\s+/g,''),_0x29c377[_0x87d9('0x179')]);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x185')]=function(_0x1d3b2f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x186'),_0x1d3b2f[_0x87d9('0x30')]));return this[_0x87d9('0xc')][_0x87d9('0x187')](_0x1d3b2f[_0x87d9('0x4f')],_0x1d3b2f['escape_digits']);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x188')]=function(_0x4ecb84){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x189'),_0x4ecb84[_0x87d9('0x30')]));if(!this['isConfigured'](_0x4ecb84[_0x87d9('0x18a')])){return this['channel']['noop'](_0x87d9('0x18b'));}var _0x3ae76f=this[_0x87d9('0x18c')][_0x87d9('0x65')](this,_0x4ecb84[_0x87d9('0x18a')]);if(!_0x3ae76f||!_0x3ae76f[_0x87d9('0x18d')]){return this['channel']['error'](_0x4ecb84,'no\x20mail\x20account\x20found');}var _0x30af9b={'from':util[_0x87d9('0x24')]('\x22%s\x22\x20<%s>',_0x3ae76f[_0x87d9('0x13')],_0x3ae76f['email']||_0x3ae76f[_0x87d9('0x18d')]['user']),'to':_0x4ecb84['to']||'','cc':_0x4ecb84['cc']||'','bcc':_0x4ecb84[_0x87d9('0x18e')]||'','subject':_0x4ecb84[_0x87d9('0x18f')],'html':_0x4ecb84['text'],'text':_0x4ecb84['text']};if(this['isConfigured'](_0x4ecb84[_0x87d9('0x190')])){}logger[_0x87d9('0x191')](_0x87d9('0x192'),JSON[_0x87d9('0x68')](_0x30af9b));this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x4ecb84,_0x4ecb84[_0x87d9('0x18a')]);this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x193'),_0x3ae76f[_0x87d9('0x13')]));this['sendMailMessage']['sync'](this,_0x3ae76f[_0x87d9('0x194')],_0x30af9b);return this['channel'][_0x87d9('0xa3')](_0x87d9('0x195'));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x196')]=function(_0xd18f67){logger['info'](util['format'](_0x87d9('0x197'),_0xd18f67[_0x87d9('0x30')]));return this['channel'][_0x87d9('0xa3')](_0x87d9('0x198'));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x199')]=function(_0x2ebc28){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2ebc28['label']));if(!this[_0x87d9('0x9c')](_0x2ebc28['sms_account_id'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20sms\x20account\x20configured');}var _0x20691b=this[_0x87d9('0x2c')][_0x87d9('0x65')](this,_0x2ebc28[_0x87d9('0x19a')]);if(!_0x20691b){return this['channel'][_0x87d9('0x27')](_0x2ebc28,'no\x20sms\x20account\x20found');}var _0x5112b7={'body':_0x2ebc28[_0x87d9('0x19b')],'phone':_0x2ebc28['to']||'','SmsAccountId':_0x20691b['id']};logger[_0x87d9('0x191')](_0x87d9('0x19c'),JSON[_0x87d9('0x68')](_0x5112b7));this['createSquareDetailsReport'][_0x87d9('0x65')](this,_0x2ebc28,_0x2ebc28[_0x87d9('0x19a')]);this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x19d'),_0x20691b[_0x87d9('0x13')]));this[_0x87d9('0x2d')][_0x87d9('0x65')](this,_0x5112b7);return this['channel'][_0x87d9('0xa3')](_0x87d9('0x19e'));};AGIVertices['prototype'][_0x87d9('0x19f')]=function(_0x553dc6){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1a0'),_0x553dc6['label']));if(!this[_0x87d9('0x9c')](_0x553dc6['variable_id'])){return this['channel'][_0x87d9('0x27')](_0x553dc6,'no\x20variable\x20selected');}var _0x4623d1=this[_0x87d9('0x10')][_0x87d9('0x65')](this,_0x553dc6[_0x87d9('0xd1')]);if(!_0x4623d1){return this[_0x87d9('0xc')]['error'](_0x553dc6,_0x87d9('0xd3'));}return this['channel'][_0x87d9('0x96')](_0x4623d1,_0x553dc6['variable_value']);};AGIVertices['prototype']['start']=function(_0x59e68b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1a1'),_0x59e68b[_0x87d9('0x30')]));this['channel'][_0x87d9('0xa3')](_0x87d9('0x1a2'));if(_0x59e68b[_0x87d9('0xb2')]===_0x87d9('0x1a3')){this[_0x87d9('0xc')]['noop']('Answer');return this['channel'][_0x87d9('0xb2')]();}return this[_0x87d9('0xc')][_0x87d9('0xa3')]('Skipped\x20Answer');};AGIVertices[_0x87d9('0xf')]['subproject']=function(_0xfc8890){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x1a4'),_0xfc8890[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0xfc8890['project_id'])){return this[_0x87d9('0xc')]['error'](_0xfc8890,'no\x20subproject\x20selected');}var _0x2ac98a=this[_0x87d9('0x1a5')][_0x87d9('0x65')](this,_0xfc8890['project_id']);if(!this[_0x87d9('0x9c')](_0x2ac98a)){return this['channel']['error'](_0xfc8890,util['format'](_0x87d9('0x1a6'),_0xfc8890[_0x87d9('0x1a7')]));}if(_0x2ac98a===this[_0x87d9('0xc')][_0x87d9('0x31')]){return this[_0x87d9('0xc')]['error'](_0xfc8890,_0x87d9('0x1a8'));}this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0xfc8890,_0x2ac98a);var _0x18ee9f=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0x1a9'),util[_0x87d9('0x24')](_0x87d9('0x1aa'),config[_0x87d9('0xac')][_0x87d9('0x1ab')]||_0x87d9('0x1ac'),_0x2ac98a,this[_0x87d9('0xc')][_0x87d9('0x31')]));if(_0x18ee9f[_0x87d9('0xa2')]===-0x1){return _0x18ee9f;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x16c'),'AGI',_0x2ac98a));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1ad')]=function(_0x1d833f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1ae'),_0x1d833f[_0x87d9('0x30')]));var _0x455243=this['shellCommand'][_0x87d9('0x65')](this,_0x1d833f[_0x87d9('0xae')]);this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x1d833f,_0x1d833f[_0x87d9('0xae')]);if(this[_0x87d9('0x9c')](_0x1d833f[_0x87d9('0xd1')])){var _0x43f912=this[_0x87d9('0x10')]['sync'](this,_0x1d833f[_0x87d9('0xd1')]);if(_0x43f912){this['channel'][_0x87d9('0x96')](_0x43f912,_0x455243);return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1d833f[_0x87d9('0xae')],_0x43f912));}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x1af'),_0x1d833f[_0x87d9('0xae')]));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1b0')]=function(_0x515c46){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1b1'),_0x515c46['label']));_0x515c46[_0x87d9('0x4f')]=_0x515c46[_0x87d9('0x4f')][_0x87d9('0xce')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x87d9('0x9c')](_0x515c46[_0x87d9('0x1b2')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0x1b3'));}if(!this[_0x87d9('0x9c')](_0x515c46[_0x87d9('0x4f')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x515c46[_0x87d9('0x4f')]));var _0x197572=this[_0x87d9('0x4d')][_0x87d9('0x65')](this,_0x515c46);if(_0x197572){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x1b4'),_0x197572));var _0x1f1314=this[_0x87d9('0xc')]['streamFile'](_0x197572);try{fs[_0x87d9('0xff')](_0x197572+'.wav');}catch(_0x3ef56c){logger['error'](_0x3ef56c);}return _0x1f1314;}return this[_0x87d9('0xc')]['error'](_0x515c46,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1b5')]=function(_0x3413dc){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1b6'),_0x3413dc[_0x87d9('0x30')]));_0x3413dc[_0x87d9('0x4f')]=_0x3413dc[_0x87d9('0x4f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3413dc[_0x87d9('0x4f')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xbd'));}this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x1b7'),_0x3413dc[_0x87d9('0x4f')]));var _0x2edf42=this['googleTTS'][_0x87d9('0x65')](this,_0x3413dc);if(_0x2edf42){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Google\x20TTS\x20%s\x20file\x20created',_0x2edf42));var _0x5dc003=this[_0x87d9('0xc')]['streamFile'](_0x2edf42);try{fs[_0x87d9('0xff')](_0x2edf42+_0x87d9('0x121'));}catch(_0xde7454){logger[_0x87d9('0x27')](_0xde7454);}return _0x5dc003;}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x3413dc,_0x87d9('0x1b8'));};AGIVertices['prototype'][_0x87d9('0x1b9')]=function(_0x4a79b8){logger[_0x87d9('0x28')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4a79b8[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x4a79b8[_0x87d9('0x156')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x4a79b8,'no\x20find\x20by\x20configured');}logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1ba'),this[_0x87d9('0xc')]['callerid'],_0x4a79b8[_0x87d9('0x156')]));var _0xa83263=this[_0x87d9('0x46')][_0x87d9('0x65')](this,_0x4a79b8[_0x87d9('0x156')]);if(_0xa83263){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x157'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x157'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));return{'code':0xc8,'result':_0x87d9('0x158')};}else{logger[_0x87d9('0x28')](util['format'](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x87d9('0xf')]['voicemail']=function(_0x526867){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x1bb'),_0x526867[_0x87d9('0x30')]));var _0x27f99e=this[_0x87d9('0xc')][_0x87d9('0xa0')]('VOICEMAIL',[_0x526867[_0x87d9('0x1bc')],_0x526867[_0x87d9('0x6e')]]);if(_0x27f99e[_0x87d9('0xa2')]===-0x1){return _0x27f99e;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x16c'),'VOICEMAIL',_0x526867[_0x87d9('0x1bc')]));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1bd')]=function(_0x3c58d8){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1be'),_0x3c58d8[_0x87d9('0x30')]));if(!this['isConfigured'](_0x3c58d8[_0x87d9('0xd1')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x3c58d8,_0x87d9('0x1bf'));}var _0x81aa=this[_0x87d9('0x10')][_0x87d9('0x65')](this,_0x3c58d8[_0x87d9('0xd1')]);if(!_0x81aa){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x3c58d8,'no\x20variable\x20found');}var _0x5cb214=this['channel']['getVariable'](_0x81aa);return{'code':0xc8,'result':_0x5cb214['extra']?_0x5cb214[_0x87d9('0x99')]:'-'};};String['prototype'][_0x87d9('0x98')]=function(_0x31b7db,_0x135911){return this[_0x87d9('0x97')](_0x31b7db)[_0x87d9('0x1c0')](_0x135911);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f1e6b1c..6c8420f 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cd2=['stopAcw','uniqueid','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','destlinkedid','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','acwTimeout','timer','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0cd2,0x75));var _0x20cd=function(_0x2d766c,_0x2a4ec4){_0x2d766c=_0x2d766c-0x0;var _0x579a64=_0x0cd2[_0x2d766c];return _0x579a64;};'use strict';var _=require(_0x20cd('0x0'));var moment=require(_0x20cd('0x1'));var ami=require(_0x20cd('0x2'));var logger=require('../../../config/logger')(_0x20cd('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x20cd('0x4'));function Acw(_0x59eb9d){this[_0x20cd('0x5')]=_0x59eb9d[_0x20cd('0x5')];this[_0x20cd('0x6')]=_0x59eb9d[_0x20cd('0x6')];this[_0x20cd('0x7')]=_0x59eb9d[_0x20cd('0x7')];this[_0x20cd('0x8')]={};ami['on'](_0x20cd('0x9'),this[_0x20cd('0xa')][_0x20cd('0xb')](this));ami['on'](_0x20cd('0xc'),this[_0x20cd('0xd')][_0x20cd('0xb')](this));ami['on'](_0x20cd('0xe'),this['syncHangup'][_0x20cd('0xb')](this));ami['on'](_0x20cd('0xf'),this[_0x20cd('0x10')]['bind'](this));ami['on'](_0x20cd('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x20cd('0x12'),this[_0x20cd('0x13')][_0x20cd('0xb')](this));ami['on'](_0x20cd('0x14'),this[_0x20cd('0x15')][_0x20cd('0xb')](this));}function getDiff(_0x4d6e7a){var _0x59f8d7=moment()['milliseconds'](0x0);var _0x337cb8=moment(_0x4d6e7a)['milliseconds'](0x0);return _0x59f8d7[_0x20cd('0x16')](_0x337cb8,_0x20cd('0x17'));}Acw[_0x20cd('0x18')][_0x20cd('0x19')]=function(_0xc96b43){try{var _0x5db04a=this;var _0x54598d=this[_0x20cd('0x8')][_0xc96b43][_0x20cd('0x1a')];var _0x3f0bc4=this[_0x20cd('0x8')][_0xc96b43][_0x20cd('0x1b')];var _0x36fc3e=this[_0x20cd('0x5')][_0x3f0bc4];var _0x8e7835=![];var _0x1bc3aa=_0x20cd('0x1c');if(_0x36fc3e[_0x20cd('0x1d')]){if(_0x36fc3e['mandatoryDispositionPause'][_0x20cd('0x1e')]){_0x8e7835=!![];_0x1bc3aa=_0x36fc3e[_0x20cd('0x1f')][_0x20cd('0x1e')];}}return ami[_0x20cd('0x20')]({'action':_0x20cd('0x21'),'interface':_0x54598d,'paused':!![],'reason':_0x1bc3aa})[_0x20cd('0x22')](function(){if(_0x5db04a['agents'][_0x54598d]){return RpcUser[_0x20cd('0x23')](_0x5db04a['agents'][_0x54598d]['id'])['then'](function(_0x3fb1af){if(_0x3fb1af&&!_0x3fb1af[_0x20cd('0x24')]){logger[_0x20cd('0x25')](_0x20cd('0x26'),_0xc96b43,_0x54598d,_0x3f0bc4);var _0x5801a3=_0x5db04a[_0x20cd('0x8')][_0xc96b43][_0x20cd('0x27')]&&_0x5db04a[_0x20cd('0x8')][_0xc96b43]['destlinkedid']?_0x5db04a[_0x20cd('0x8')][_0xc96b43]['destlinkedid']:_0xc96b43;return RpcUser[_0x20cd('0x28')](_0x5db04a[_0x20cd('0x6')][_0x54598d],_0x1bc3aa,_0x5801a3)[_0x20cd('0x22')](function(){if(!_0x8e7835){_0x5db04a[_0x20cd('0x7')][_0x54598d]={};logger[_0x20cd('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0xc96b43,_0x5db04a[_0x20cd('0x5')][_0x3f0bc4][_0x20cd('0x29')],_0x54598d,_0x3f0bc4);_0x5db04a[_0x20cd('0x7')][_0x54598d][_0x20cd('0x2a')]=setTimeout(_0x5db04a['stopAcw'][_0x20cd('0xb')](_0x5db04a,_0x54598d),_0x5db04a[_0x20cd('0x5')][_0x3f0bc4][_0x20cd('0x29')]*0x3e8);_0x5db04a['timers'][_0x54598d]['lastPauseAt']=moment()[_0x20cd('0x2b')](_0x20cd('0x2c'));_0x5db04a[_0x20cd('0x7')][_0x54598d]['uniqueid']=_0xc96b43;_0x5db04a[_0x20cd('0x7')][_0x54598d][_0x20cd('0x1b')]=_0x3f0bc4;_0x5db04a[_0x20cd('0x7')][_0x54598d][_0x20cd('0x2d')]=function(){var _0x36b435=getDiff(_0x5db04a[_0x20cd('0x7')][_0x54598d]['lastPauseAt']);clearTimeout(_0x5db04a[_0x20cd('0x7')][_0x54598d][_0x20cd('0x2a')]);_0x5db04a['timers'][_0x54598d][_0x20cd('0x2a')]=![];RpcVoiceAgentReport[_0x20cd('0x2e')]({'acwtime':_0x36b435},_0x5db04a[_0x20cd('0x7')][_0x54598d]['uniqueid'],_0x54598d)[_0x20cd('0x22')](function(_0x4f03f3){logger['info'](_0x20cd('0x2f'),_0xc96b43,_0x36b435,_0x4f03f3);})[_0x20cd('0x30')](function(_0x3a208c){logger[_0x20cd('0x31')](_0x20cd('0x32'),_0xc96b43,_0x3a208c);});delete _0x5db04a[_0x20cd('0x7')][_0x54598d];};}});}else{logger[_0x20cd('0x25')](_0x20cd('0x33'),_0xc96b43,_0x54598d,_0x3f0bc4);}});}})[_0x20cd('0x30')](function(){logger['error'](_0x20cd('0x34'),_0xc96b43,_0x5db04a[_0x20cd('0x5')][_0x3f0bc4][_0x20cd('0x29')],_0x54598d,_0x3f0bc4);})[_0x20cd('0x35')](function(){delete _0x5db04a[_0x20cd('0x8')][_0xc96b43];});}catch(_0x5674ca){logger[_0x20cd('0x31')]('[ACW][START]\x20%s',_0x5674ca[_0x20cd('0x36')]);}};Acw['prototype'][_0x20cd('0x37')]=function(_0x2abfdb){try{var _0x22a1d4=this;if(_0x22a1d4[_0x20cd('0x7')][_0x2abfdb]){_0x22a1d4['timers'][_0x2abfdb][_0x20cd('0x2a')]=![];var _0x15031e=_0x22a1d4[_0x20cd('0x7')][_0x2abfdb][_0x20cd('0x38')];var _0x3f4b28=_0x22a1d4[_0x20cd('0x7')][_0x2abfdb][_0x20cd('0x1b')];var _0x3c51e8=_0x22a1d4[_0x20cd('0x5')][_0x3f4b28][_0x20cd('0x29')];logger[_0x20cd('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x15031e,_0x2abfdb);RpcUser['saveUnpause'](this[_0x20cd('0x6')][_0x2abfdb]);RpcVoiceAgentReport[_0x20cd('0x2e')]({'acwtime':_0x3c51e8,'agentacw':!![]},_0x15031e,_0x2abfdb)[_0x20cd('0x22')](function(_0x1bdba6){logger['info'](_0x20cd('0x2f'),_0x15031e,_0x3c51e8,_0x1bdba6);})[_0x20cd('0x30')](function(_0x1a762c){logger[_0x20cd('0x31')](_0x20cd('0x32'),_0x15031e,_0x1a762c);});}else{logger[_0x20cd('0x31')](_0x20cd('0x39'),_0x2abfdb);if(_0x22a1d4[_0x20cd('0x7')]){logger['info'](_0x20cd('0x3a'),JSON['stringify'](_0x22a1d4['timers']));}}}catch(_0x1fd60c){logger[_0x20cd('0x31')](_0x20cd('0x3b'),_0x1fd60c['message']);}};Acw['prototype'][_0x20cd('0xa')]=function(_0x4d3d92){try{if(this['voiceQueues'][_0x4d3d92['queue']]&&(this['voiceQueues'][_0x4d3d92['queue']]['acw']||this[_0x20cd('0x5')][_0x4d3d92[_0x20cd('0x1b')]]['mandatoryDisposition'])){if(this[_0x20cd('0x6')][_0x4d3d92[_0x20cd('0x1a')]]){this[_0x20cd('0x8')][_0x4d3d92['uniqueid']]={'queue':_0x4d3d92[_0x20cd('0x1b')],'interface':_0x4d3d92[_0x20cd('0x1a')],'destlinkedid':_0x4d3d92[_0x20cd('0x3c')]};}}}catch(_0x251572){logger[_0x20cd('0x31')](_0x20cd('0x3d'),_0x251572[_0x20cd('0x36')]);}};Acw[_0x20cd('0x18')][_0x20cd('0x15')]=function(_0x46a5e6){try{if(this['voiceQueues'][_0x46a5e6['queue']]&&(this[_0x20cd('0x5')][_0x46a5e6[_0x20cd('0x1b')]][_0x20cd('0x3')]||this[_0x20cd('0x5')][_0x46a5e6[_0x20cd('0x1b')]][_0x20cd('0x1d')])){if(this['agents'][_0x46a5e6[_0x20cd('0x1a')]]){this[_0x20cd('0x8')][_0x46a5e6[_0x20cd('0x38')]]={'queue':_0x46a5e6[_0x20cd('0x1b')],'interface':_0x46a5e6[_0x20cd('0x1a')]};}}}catch(_0x4ae633){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x4ae633[_0x20cd('0x36')]);}};Acw[_0x20cd('0x18')][_0x20cd('0xd')]=function(_0x58f3f0){try{if(this[_0x20cd('0x8')][_0x58f3f0[_0x20cd('0x38')]]&&_[_0x20cd('0x3e')](this[_0x20cd('0x8')][_0x58f3f0[_0x20cd('0x38')]][_0x20cd('0x27')])){logger['info'](_0x20cd('0x3f'),_0x58f3f0[_0x20cd('0x38')]);this['startAcw'](_0x58f3f0[_0x20cd('0x38')]);}else if(this[_0x20cd('0x8')][_0x58f3f0[_0x20cd('0x40')]]&&_[_0x20cd('0x3e')](this[_0x20cd('0x8')][_0x58f3f0[_0x20cd('0x40')]][_0x20cd('0x27')])){logger[_0x20cd('0x25')](_0x20cd('0x41'),_0x58f3f0[_0x20cd('0x40')]);this[_0x20cd('0x19')](_0x58f3f0['linkedid']);}}catch(_0x5eb9cf){logger['error'](_0x20cd('0x42'),_0x5eb9cf[_0x20cd('0x36')]);}};Acw[_0x20cd('0x18')][_0x20cd('0x43')]=function(_0x11f92b){try{if(this[_0x20cd('0x8')][_0x11f92b[_0x20cd('0x38')]]&&this[_0x20cd('0x8')][_0x11f92b['uniqueid']][_0x20cd('0x27')]){logger[_0x20cd('0x25')](_0x20cd('0x44'),_0x11f92b['uniqueid']);this[_0x20cd('0x19')](_0x11f92b[_0x20cd('0x38')]);}else if(this[_0x20cd('0x8')][_0x11f92b[_0x20cd('0x40')]]&&this[_0x20cd('0x8')][_0x11f92b['linkedid']][_0x20cd('0x27')]){logger[_0x20cd('0x25')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x11f92b[_0x20cd('0x40')]);this['startAcw'](_0x11f92b[_0x20cd('0x40')]);}}catch(_0x3f38bd){logger[_0x20cd('0x31')]('[ACW][syncHangup]\x20%s',_0x3f38bd['message']);}};Acw['prototype'][_0x20cd('0x45')]=function(_0x4b7f21){try{if(!_[_0x20cd('0x46')](this['channels'][_0x4b7f21['transfereeuniqueid']])){this['startAcw'](_0x4b7f21[_0x20cd('0x47')]);if(this[_0x20cd('0x8')][_0x4b7f21[_0x20cd('0x48')]]){this[_0x20cd('0x8')][_0x4b7f21['secondtransfereruniqueid']]['attended']=!![];this[_0x20cd('0x8')][_0x4b7f21['transfertargetuniqueid']]=this[_0x20cd('0x8')][_0x4b7f21[_0x20cd('0x48')]];delete this[_0x20cd('0x8')][_0x4b7f21['secondtransfereruniqueid']];}}else if(!_[_0x20cd('0x46')](this[_0x20cd('0x8')][_0x4b7f21[_0x20cd('0x49')]])){this[_0x20cd('0x19')](_0x4b7f21['transfertargetuniqueid']);if(this[_0x20cd('0x8')][_0x4b7f21[_0x20cd('0x4a')]]){this[_0x20cd('0x8')][_0x4b7f21['origtransfereruniqueid']][_0x20cd('0x27')]=!![];this[_0x20cd('0x8')][_0x4b7f21['transfereeuniqueid']]=this['channels'][_0x4b7f21['origtransfereruniqueid']];delete this[_0x20cd('0x8')][_0x4b7f21['origtransfereruniqueid']];}}}catch(_0x255fb1){logger[_0x20cd('0x31')](_0x20cd('0x4b'),_0x255fb1['message']);}};Acw[_0x20cd('0x18')][_0x20cd('0x13')]=function(_0x4e42f8){try{if(this['channels'][_0x4e42f8[_0x20cd('0x4c')]]){logger[_0x20cd('0x25')](_0x20cd('0x4d'),JSON[_0x20cd('0x4e')](_0x4e42f8['transfereruniqueid']));this[_0x20cd('0x19')](_0x4e42f8[_0x20cd('0x4c')]);}else if(this[_0x20cd('0x8')][_0x4e42f8[_0x20cd('0x4f')]]){logger['info'](_0x20cd('0x50'),JSON[_0x20cd('0x4e')](_0x4e42f8['transfererlinkedid']));this[_0x20cd('0x19')](_0x4e42f8[_0x20cd('0x4f')]);}}catch(_0x2a4a71){logger['error'](_0x20cd('0x51'),_0x2a4a71['message']);}};Acw[_0x20cd('0x18')][_0x20cd('0x10')]=function(_0x525491){try{if(this['voiceQueues'][_0x525491[_0x20cd('0x1b')]]&&this[_0x20cd('0x5')][_0x525491[_0x20cd('0x1b')]][_0x20cd('0x52')]==='all'){if(this['agents'][_0x525491[_0x20cd('0x1a')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x525491[_0x20cd('0x38')],_0x525491[_0x20cd('0x1a')],_0x525491[_0x20cd('0x1b')]);return RpcUser[_0x20cd('0x28')](this[_0x20cd('0x6')][_0x525491['interface']],_0x20cd('0x53'),_0x525491[_0x20cd('0x38')]);}}}catch(_0x3be6a6){logger['error'](_0x20cd('0x54'),_0x3be6a6['message']);}};module[_0x20cd('0x55')]=Acw; \ No newline at end of file +var _0x5da0=['mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','stringify','[ACW][STOP]\x20%s','uniqueid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','prototype','channels','interface','queue'];(function(_0x41cf46,_0x361040){var _0x222014=function(_0x167d32){while(--_0x167d32){_0x41cf46['push'](_0x41cf46['shift']());}};_0x222014(++_0x361040);}(_0x5da0,0xf0));var _0x05da=function(_0x526c83,_0x5800f6){_0x526c83=_0x526c83-0x0;var _0x151966=_0x5da0[_0x526c83];return _0x151966;};'use strict';var _=require('lodash');var moment=require(_0x05da('0x0'));var ami=require(_0x05da('0x1'));var logger=require('../../../config/logger')(_0x05da('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x05da('0x3'));function Acw(_0x43e943){this[_0x05da('0x4')]=_0x43e943[_0x05da('0x4')];this['agents']=_0x43e943[_0x05da('0x5')];this[_0x05da('0x6')]=_0x43e943['timers'];this['channels']={};ami['on'](_0x05da('0x7'),this[_0x05da('0x8')][_0x05da('0x9')](this));ami['on'](_0x05da('0xa'),this['syncHangupRequest']['bind'](this));ami['on'](_0x05da('0xb'),this['syncHangup']['bind'](this));ami['on'](_0x05da('0xc'),this[_0x05da('0xd')]['bind'](this));ami['on'](_0x05da('0xe'),this[_0x05da('0xf')][_0x05da('0x9')](this));ami['on'](_0x05da('0x10'),this['syncBlindTransfer'][_0x05da('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x05da('0x11')][_0x05da('0x9')](this));}function getDiff(_0x478ff3){var _0x2ad0c0=moment()[_0x05da('0x12')](0x0);var _0x4c226a=moment(_0x478ff3)['milliseconds'](0x0);return _0x2ad0c0[_0x05da('0x13')](_0x4c226a,'seconds');}Acw[_0x05da('0x14')]['startAcw']=function(_0x4fb65a){try{var _0x51be1a=this;var _0x38d95b=this[_0x05da('0x15')][_0x4fb65a][_0x05da('0x16')];var _0x358b53=this[_0x05da('0x15')][_0x4fb65a][_0x05da('0x17')];var _0x3f8682=this[_0x05da('0x4')][_0x358b53];var _0xe992e8=![];var _0x2aefd8='ACW';if(_0x3f8682[_0x05da('0x18')]){if(_0x3f8682[_0x05da('0x19')][_0x05da('0x1a')]){_0xe992e8=!![];_0x2aefd8=_0x3f8682[_0x05da('0x19')]['name'];}}return ami[_0x05da('0x1b')]({'action':_0x05da('0x1c'),'interface':_0x38d95b,'paused':!![],'reason':_0x2aefd8})['then'](function(){if(_0x51be1a[_0x05da('0x5')][_0x38d95b]){return RpcUser[_0x05da('0x1d')](_0x51be1a[_0x05da('0x5')][_0x38d95b]['id'])[_0x05da('0x1e')](function(_0x18806d){if(_0x18806d&&!_0x18806d[_0x05da('0x1f')]){logger['info'](_0x05da('0x20'),_0x4fb65a,_0x38d95b,_0x358b53);var _0x5c73bd=_0x51be1a['channels'][_0x4fb65a][_0x05da('0x21')]&&_0x51be1a[_0x05da('0x15')][_0x4fb65a][_0x05da('0x22')]?_0x51be1a[_0x05da('0x15')][_0x4fb65a][_0x05da('0x22')]:_0x4fb65a;return RpcUser['savePause'](_0x51be1a[_0x05da('0x5')][_0x38d95b],_0x2aefd8,_0x5c73bd)[_0x05da('0x1e')](function(){if(!_0xe992e8){_0x51be1a[_0x05da('0x6')][_0x38d95b]={};logger[_0x05da('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4fb65a,_0x51be1a[_0x05da('0x4')][_0x358b53][_0x05da('0x24')],_0x38d95b,_0x358b53);_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x25')]=setTimeout(_0x51be1a['stopAcw']['bind'](_0x51be1a,_0x38d95b),_0x51be1a['voiceQueues'][_0x358b53][_0x05da('0x24')]*0x3e8);_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x26')]=moment()[_0x05da('0x27')](_0x05da('0x28'));_0x51be1a[_0x05da('0x6')][_0x38d95b]['uniqueid']=_0x4fb65a;_0x51be1a['timers'][_0x38d95b][_0x05da('0x17')]=_0x358b53;_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x29')]=function(){var _0x9d4f32=getDiff(_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x26')]);clearTimeout(_0x51be1a['timers'][_0x38d95b][_0x05da('0x25')]);_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x25')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x9d4f32},_0x51be1a[_0x05da('0x6')][_0x38d95b]['uniqueid'],_0x38d95b)[_0x05da('0x1e')](function(_0x567e84){logger[_0x05da('0x23')](_0x05da('0x2a'),_0x4fb65a,_0x9d4f32,_0x567e84);})[_0x05da('0x2b')](function(_0x2966bd){logger[_0x05da('0x2c')](_0x05da('0x2d'),_0x4fb65a,_0x2966bd);});delete _0x51be1a[_0x05da('0x6')][_0x38d95b];};}});}else{logger[_0x05da('0x23')](_0x05da('0x2e'),_0x4fb65a,_0x38d95b,_0x358b53);}});}})[_0x05da('0x2b')](function(){logger[_0x05da('0x2c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4fb65a,_0x51be1a['voiceQueues'][_0x358b53][_0x05da('0x24')],_0x38d95b,_0x358b53);})[_0x05da('0x2f')](function(){delete _0x51be1a[_0x05da('0x15')][_0x4fb65a];});}catch(_0x56dec4){logger[_0x05da('0x2c')](_0x05da('0x30'),_0x56dec4[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x32')]=function(_0x42b21b){try{var _0x1bf03a=this;if(_0x1bf03a[_0x05da('0x6')][_0x42b21b]){_0x1bf03a[_0x05da('0x6')][_0x42b21b]['timer']=![];var _0x45b896=_0x1bf03a[_0x05da('0x6')][_0x42b21b]['uniqueid'];var _0x1f1e0c=_0x1bf03a['timers'][_0x42b21b][_0x05da('0x17')];var _0xaac08e=_0x1bf03a[_0x05da('0x4')][_0x1f1e0c]['acwTimeout'];logger[_0x05da('0x23')](_0x05da('0x33'),_0x45b896,_0x42b21b);RpcUser[_0x05da('0x34')](this[_0x05da('0x5')][_0x42b21b]);RpcVoiceAgentReport[_0x05da('0x35')]({'acwtime':_0xaac08e,'agentacw':!![]},_0x45b896,_0x42b21b)[_0x05da('0x1e')](function(_0x579e85){logger[_0x05da('0x23')](_0x05da('0x2a'),_0x45b896,_0xaac08e,_0x579e85);})['catch'](function(_0x12c0a8){logger[_0x05da('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x45b896,_0x12c0a8);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x42b21b);if(_0x1bf03a['timers']){logger[_0x05da('0x23')]('[ACW][TIMERS]',JSON[_0x05da('0x36')](_0x1bf03a[_0x05da('0x6')]));}}}catch(_0xfa5f10){logger['error'](_0x05da('0x37'),_0xfa5f10[_0x05da('0x31')]);}};Acw['prototype'][_0x05da('0x8')]=function(_0x50928f){try{if(this[_0x05da('0x4')][_0x50928f[_0x05da('0x17')]]&&(this[_0x05da('0x4')][_0x50928f[_0x05da('0x17')]][_0x05da('0x2')]||this[_0x05da('0x4')][_0x50928f[_0x05da('0x17')]]['mandatoryDisposition'])){if(this[_0x05da('0x5')][_0x50928f[_0x05da('0x16')]]){this[_0x05da('0x15')][_0x50928f[_0x05da('0x38')]]={'queue':_0x50928f[_0x05da('0x17')],'interface':_0x50928f[_0x05da('0x16')],'destlinkedid':_0x50928f[_0x05da('0x22')]};}}}catch(_0xea0858){logger[_0x05da('0x2c')](_0x05da('0x39'),_0xea0858[_0x05da('0x31')]);}};Acw['prototype'][_0x05da('0x11')]=function(_0x3b125d){try{if(this[_0x05da('0x4')][_0x3b125d[_0x05da('0x17')]]&&(this[_0x05da('0x4')][_0x3b125d[_0x05da('0x17')]][_0x05da('0x2')]||this[_0x05da('0x4')][_0x3b125d[_0x05da('0x17')]][_0x05da('0x18')])){if(this['agents'][_0x3b125d[_0x05da('0x16')]]){this[_0x05da('0x15')][_0x3b125d['uniqueid']]={'queue':_0x3b125d[_0x05da('0x17')],'interface':_0x3b125d[_0x05da('0x16')]};}}}catch(_0x49e85d){logger['error'](_0x05da('0x3a'),_0x49e85d[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x3b')]=function(_0x2bd821){try{if(this[_0x05da('0x15')][_0x2bd821[_0x05da('0x38')]]&&_[_0x05da('0x3c')](this['channels'][_0x2bd821[_0x05da('0x38')]][_0x05da('0x21')])){logger[_0x05da('0x23')](_0x05da('0x3d'),_0x2bd821['uniqueid']);this['startAcw'](_0x2bd821[_0x05da('0x38')]);}else if(this['channels'][_0x2bd821[_0x05da('0x3e')]]&&_[_0x05da('0x3c')](this[_0x05da('0x15')][_0x2bd821[_0x05da('0x3e')]][_0x05da('0x21')])){logger[_0x05da('0x23')](_0x05da('0x3f'),_0x2bd821[_0x05da('0x3e')]);this[_0x05da('0x40')](_0x2bd821['linkedid']);}}catch(_0x57a674){logger[_0x05da('0x2c')](_0x05da('0x41'),_0x57a674[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x42')]=function(_0x57fef9){try{if(this[_0x05da('0x15')][_0x57fef9['uniqueid']]&&this['channels'][_0x57fef9[_0x05da('0x38')]][_0x05da('0x21')]){logger['info'](_0x05da('0x43'),_0x57fef9['uniqueid']);this['startAcw'](_0x57fef9['uniqueid']);}else if(this['channels'][_0x57fef9[_0x05da('0x3e')]]&&this[_0x05da('0x15')][_0x57fef9[_0x05da('0x3e')]][_0x05da('0x21')]){logger['info'](_0x05da('0x44'),_0x57fef9['linkedid']);this[_0x05da('0x40')](_0x57fef9['linkedid']);}}catch(_0x181431){logger[_0x05da('0x2c')](_0x05da('0x45'),_0x181431[_0x05da('0x31')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x272d6a){try{if(!_[_0x05da('0x46')](this[_0x05da('0x15')][_0x272d6a['transfereeuniqueid']])){this[_0x05da('0x40')](_0x272d6a[_0x05da('0x47')]);if(this['channels'][_0x272d6a['secondtransfereruniqueid']]){this[_0x05da('0x15')][_0x272d6a[_0x05da('0x48')]]['attended']=!![];this[_0x05da('0x15')][_0x272d6a['transfertargetuniqueid']]=this[_0x05da('0x15')][_0x272d6a['secondtransfereruniqueid']];delete this[_0x05da('0x15')][_0x272d6a['secondtransfereruniqueid']];}}else if(!_[_0x05da('0x46')](this['channels'][_0x272d6a[_0x05da('0x49')]])){this[_0x05da('0x40')](_0x272d6a[_0x05da('0x49')]);if(this['channels'][_0x272d6a['origtransfereruniqueid']]){this[_0x05da('0x15')][_0x272d6a[_0x05da('0x4a')]][_0x05da('0x21')]=!![];this[_0x05da('0x15')][_0x272d6a[_0x05da('0x47')]]=this[_0x05da('0x15')][_0x272d6a[_0x05da('0x4a')]];delete this[_0x05da('0x15')][_0x272d6a[_0x05da('0x4a')]];}}}catch(_0x208945){logger[_0x05da('0x2c')](_0x05da('0x4b'),_0x208945[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x4c')]=function(_0x1c03e5){try{if(this[_0x05da('0x15')][_0x1c03e5[_0x05da('0x4d')]]){logger[_0x05da('0x23')](_0x05da('0x4e'),JSON['stringify'](_0x1c03e5['transfereruniqueid']));this[_0x05da('0x40')](_0x1c03e5[_0x05da('0x4d')]);}else if(this[_0x05da('0x15')][_0x1c03e5[_0x05da('0x4f')]]){logger[_0x05da('0x23')](_0x05da('0x50'),JSON[_0x05da('0x36')](_0x1c03e5[_0x05da('0x4f')]));this[_0x05da('0x40')](_0x1c03e5[_0x05da('0x4f')]);}}catch(_0x464e37){logger['error'](_0x05da('0x51'),_0x464e37[_0x05da('0x31')]);}};Acw['prototype'][_0x05da('0xd')]=function(_0x2d21c0){try{if(this[_0x05da('0x4')][_0x2d21c0[_0x05da('0x17')]]&&this[_0x05da('0x4')][_0x2d21c0[_0x05da('0x17')]]['autopause']===_0x05da('0x52')){if(this[_0x05da('0x5')][_0x2d21c0[_0x05da('0x16')]]){logger[_0x05da('0x23')](_0x05da('0x53'),_0x2d21c0['uniqueid'],_0x2d21c0[_0x05da('0x16')],_0x2d21c0['queue']);return RpcUser[_0x05da('0x54')](this[_0x05da('0x5')][_0x2d21c0[_0x05da('0x16')]],_0x05da('0x55'),_0x2d21c0[_0x05da('0x38')]);}}}catch(_0x34455b){logger[_0x05da('0x2c')](_0x05da('0x56'),_0x34455b['message']);}};module[_0x05da('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 24a6cfc..440a607 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5681=['port','password','keepConnected','Action','promisify','action','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','username','resolve','then','actionDeviceStateList','catch','exports','asterisk-manager','../../config/logger','ami','asterisk'];(function(_0x2cea74,_0x176b02){var _0x41af9d=function(_0x490453){while(--_0x490453){_0x2cea74['push'](_0x2cea74['shift']());}};_0x41af9d(++_0x176b02);}(_0x5681,0x1e6));var _0x1568=function(_0x26f192,_0x1659d5){_0x26f192=_0x26f192-0x0;var _0x222f38=_0x5681[_0x26f192];return _0x222f38;};'use strict';var Manager=require(_0x1568('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x1568('0x1'))(_0x1568('0x2'));var config=require('../../config/environment');var ami=new Manager(config[_0x1568('0x3')][_0x1568('0x4')],config[_0x1568('0x3')]['ip'],config[_0x1568('0x3')]['username'],config[_0x1568('0x3')][_0x1568('0x5')],!![]);ami[_0x1568('0x6')]();ami[_0x1568('0x7')]=BPromise[_0x1568('0x8')](ami[_0x1568('0x9')]);function error(_0x4359b6){logger[_0x1568('0xa')](util[_0x1568('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1568('0x3')]['username'],config['asterisk']['ip'],config[_0x1568('0x3')][_0x1568('0x4')],util[_0x1568('0xc')](_0x4359b6,![],null)));}function close(){logger[_0x1568('0xa')](util[_0x1568('0xb')](_0x1568('0xd'),config[_0x1568('0x3')]['username'],config['asterisk']['ip'],config[_0x1568('0x3')][_0x1568('0x4')]));}ami[_0x1568('0xe')]=function(){return function(){return ami[_0x1568('0x7')]({'action':_0x1568('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x1568('0x7')]({'action':_0x1568('0x10')});};};ami[_0x1568('0x11')]=function(){return function(){return ami[_0x1568('0x7')]({'action':_0x1568('0x12')});};};ami[_0x1568('0x13')]=function(){return function(){return ami[_0x1568('0x7')]({'action':_0x1568('0x14')});};};ami[_0x1568('0x15')]=function(){return function(){return ami[_0x1568('0x7')]({'action':_0x1568('0x16')});};};function connect(){logger[_0x1568('0x17')](util[_0x1568('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x1568('0x3')]['username'],config[_0x1568('0x3')]['ip'],config[_0x1568('0x3')][_0x1568('0x4')]));ami['once'](_0x1568('0xa'),error);ami['once'](_0x1568('0x18'),close);}ami['on'](_0x1568('0x19'),connect);ami['on'](_0x1568('0x1a'),function(_0x210071){logger[_0x1568('0x17')](util[_0x1568('0xb')](_0x1568('0x1b'),config[_0x1568('0x3')]['username'],config[_0x1568('0x3')]['ip'],config[_0x1568('0x3')][_0x1568('0x4')],util[_0x1568('0xc')](_0x210071,![],null)));});ami['on']('fullybooted',function(){logger[_0x1568('0x17')](util[_0x1568('0xb')](_0x1568('0x1c'),config['asterisk'][_0x1568('0x1d')],config[_0x1568('0x3')]['ip'],config[_0x1568('0x3')][_0x1568('0x4')]));return Promise[_0x1568('0x1e')]()[_0x1568('0x1f')](ami[_0x1568('0xe')]())[_0x1568('0x1f')](ami[_0x1568('0x20')]())[_0x1568('0x1f')](ami[_0x1568('0x11')]())[_0x1568('0x1f')](ami[_0x1568('0x13')]())['then'](ami[_0x1568('0x15')]())[_0x1568('0x21')](function(_0x2dd4b3){logger[_0x1568('0xa')]('[ami.js][fullybooted]',util[_0x1568('0xc')](_0x2dd4b3,{'showHidden':![],'depth':null}));});});ami['once'](_0x1568('0xa'),error);ami['once'](_0x1568('0x18'),close);module[_0x1568('0x22')]=ami; \ No newline at end of file +var _0x3975=['info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels'];(function(_0x377670,_0x10d1e1){var _0x15077d=function(_0x267f51){while(--_0x267f51){_0x377670['push'](_0x377670['shift']());}};_0x15077d(++_0x10d1e1);}(_0x3975,0xc6));var _0x5397=function(_0x20805b,_0x25a144){_0x20805b=_0x20805b-0x0;var _0x362154=_0x3975[_0x20805b];return _0x362154;};'use strict';var Manager=require(_0x5397('0x0'));var BPromise=require(_0x5397('0x1'));var util=require('util');var logger=require(_0x5397('0x2'))(_0x5397('0x3'));var config=require(_0x5397('0x4'));var ami=new Manager(config[_0x5397('0x5')]['port'],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')]['username'],config[_0x5397('0x5')][_0x5397('0x6')],!![]);ami['keepConnected']();ami[_0x5397('0x7')]=BPromise[_0x5397('0x8')](ami['action']);function error(_0x24b7f1){logger[_0x5397('0x9')](util[_0x5397('0xa')](_0x5397('0xb'),config['asterisk'][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')]['port'],util['inspect'](_0x24b7f1,![],null)));}function close(){logger[_0x5397('0x9')](util[_0x5397('0xa')](_0x5397('0xd'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')][_0x5397('0xe')]));}ami[_0x5397('0xf')]=function(){return function(){return ami[_0x5397('0x7')]({'action':_0x5397('0x10')});};};ami[_0x5397('0x11')]=function(){return function(){return ami[_0x5397('0x7')]({'action':_0x5397('0x12')});};};ami[_0x5397('0x13')]=function(){return function(){return ami[_0x5397('0x7')]({'action':_0x5397('0x14')});};};ami[_0x5397('0x15')]=function(){return function(){return ami[_0x5397('0x7')]({'action':'queuesummary'});};};ami[_0x5397('0x16')]=function(){return function(){return ami['Action']({'action':_0x5397('0x17')});};};function connect(){logger[_0x5397('0x18')](util[_0x5397('0xa')](_0x5397('0x19'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')]['port']));ami[_0x5397('0x1a')]('error',error);ami[_0x5397('0x1a')](_0x5397('0x1b'),close);}ami['on'](_0x5397('0x1c'),connect);ami['on']('shutdown',function(_0x584771){logger[_0x5397('0x18')](util['format'](_0x5397('0x1d'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')][_0x5397('0xe')],util[_0x5397('0x1e')](_0x584771,![],null)));});ami['on'](_0x5397('0x1f'),function(){logger[_0x5397('0x18')](util[_0x5397('0xa')](_0x5397('0x20'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')][_0x5397('0xe')]));return Promise[_0x5397('0x21')]()['then'](ami[_0x5397('0xf')]())[_0x5397('0x22')](ami['actionDeviceStateList']())['then'](ami[_0x5397('0x13')]())[_0x5397('0x22')](ami['actionQueueSummary']())[_0x5397('0x22')](ami[_0x5397('0x16')]())[_0x5397('0x23')](function(_0x4b7b58){logger[_0x5397('0x9')](_0x5397('0x24'),util[_0x5397('0x1e')](_0x4b7b58,{'showHidden':![],'depth':null}));});});ami[_0x5397('0x1a')](_0x5397('0x9'),error);ami[_0x5397('0x1a')](_0x5397('0x1b'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index df1bf88..5fe64be 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0xcb91[_0x5e4b85];return _0x5cd3cb;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0xac4a,0x13f));var _0xaac4=function(_0x5313b4,_0x52b1a1){_0x5313b4=_0x5313b4-0x0;var _0x5955ef=_0xac4a[_0x5313b4];return _0x5955ef;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index ef36eb4..0e219c6 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2735=['dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','loggedIn','predictiveIntervalPauses','startMethodPredictive','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','run','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','ioredis','./utils/hopper','../preview/util/util','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','startPredictive\x20value\x20cleared','handlePredictive','error','stack','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','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','is\x20disactive','[ifTime][Action]','Error','stringify','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','command','interval','timezones','content','indexOf','iftime\x20%s,%s','true','catch','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','isIVRCampaignActive','resolve','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','dialGlobalInterval','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueId','uniqueid','type','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','starttime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','countabandonedretry','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','VoiceQueueId','[rescheduleContact][Abandoned]','Abandoned','channel','actionid','rrmemory','isNil','locked','paused','stateinterface','idHopper','syncQueueStatusComplete','roundrobin','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','moveContactManagedDialer','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','Agent','launchHandleIvr','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','undefined','tags','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','Trunk','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s'];(function(_0x2a516a,_0x522514){var _0x4c1c06=function(_0x558943){while(--_0x558943){_0x2a516a['push'](_0x2a516a['shift']());}};_0x4c1c06(++_0x522514);}(_0x2735,0x9c));var _0x5273=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2735[_0x513aa5];return _0x1a1a7c;};'use strict';var util=require(_0x5273('0x0'));var _=require(_0x5273('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x5273('0x2'));var utils=require('./utils');var hopperUtils=require(_0x5273('0x3'));var ut=require(_0x5273('0x4'));var config=require('../../../config/environment/');var logger=require(_0x5273('0x5'))(_0x5273('0x6'));var loggerBooked=require(_0x5273('0x5'))('booked');var loggerPredictive=require(_0x5273('0x5'))(_0x5273('0x7'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x5273('0x5'))(_0x5273('0x8'));var ami=require(_0x5273('0x9'));config[_0x5273('0xa')]=_[_0x5273('0xb')](config[_0x5273('0xa')],{'host':_0x5273('0xc'),'port':0x18eb});var io=require(_0x5273('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x5273('0xe'));var voiceQueueRt=require(_0x5273('0xf'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x5273('0x10'));var Action=require('./models/action');var History=require(_0x5273('0x11'));var Final=require(_0x5273('0x12'));var AgentComplete=require(_0x5273('0x13'));var QueueCallerAbandon=require(_0x5273('0x14'));var Hangup=require(_0x5273('0x15'));var ipAgi=process[_0x5273('0x16')][_0x5273('0x17')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5273('0x18')][_0x5273('0x19')]=function(_0x38fd7b){this['tail']=this[_0x5273('0x1a')]?this[_0x5273('0x1a')][_0x5273('0x1b')](_0x38fd7b):_0x38fd7b();};function Dialer(_0xa9b0d6,_0x42bfdf){this[_0x5273('0x1c')]=new Sequence();this[_0x5273('0x1d')]=_0x42bfdf;this[_0x5273('0x1e')]=_0xa9b0d6['voiceQueues'];this[_0x5273('0x1f')]=_0xa9b0d6[_0x5273('0x1f')];this[_0x5273('0x20')]=_0xa9b0d6['agents'];this['trunks']=_0xa9b0d6[_0x5273('0x21')];this[_0x5273('0x22')]=config[_0x5273('0x22')]||0x2;this[_0x5273('0x23')]={};this[_0x5273('0x24')]={};this[_0x5273('0x25')]={};this['uniqueId']={};this[_0x5273('0x26')]={};this[_0x5273('0x27')]={};this[_0x5273('0x28')]={};this[_0x5273('0x29')]={};this[_0x5273('0x2a')]={};this[_0x5273('0x2b')]={};this['queuesSummary']={};ami['on'](_0x5273('0x2c'),this[_0x5273('0x2d')][_0x5273('0x2e')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x5273('0x2e')](this));ami['on'](_0x5273('0x2f'),this[_0x5273('0x30')]['bind'](this));ami['on'](_0x5273('0x31'),this[_0x5273('0x32')][_0x5273('0x2e')](this));ami['on'](_0x5273('0x33'),this[_0x5273('0x8')][_0x5273('0x2e')](this));ami['on']('custom:queuesummarycomplete',this[_0x5273('0x34')][_0x5273('0x2e')](this));ami['on']('hangup',this[_0x5273('0x35')]['bind'](this));ami['on'](_0x5273('0x36'),this[_0x5273('0x37')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x5273('0x38'),this['syncQueueMember'][_0x5273('0x2e')](this));ami['on'](_0x5273('0x39'),this['syncQueueStatusComplete'][_0x5273('0x2e')](this));this[_0x5273('0x3a')]();this[_0x5273('0x3b')]();RpcSetting[_0x5273('0x3c')]()[_0x5273('0x3d')](function(_0x3167b8){previewRecallmeReminderInterval=_0x3167b8['previewRecallmeReminderInterval'];});}function isNotNull(_0x384761){return _0x384761!==null&&!_[_0x5273('0x3e')](_0x384761);}function msgResponse(_0x39a826,_0x3cfe6e,_0x4c24b8){return{'action':_0x39a826,'response':_0x3cfe6e,'message':_0x4c24b8,'stack':_0x4c24b8};}function emit(_0x47ed32,_0x2a2589,_0x50eced){io['to'](_0x47ed32)['emit'](_0x2a2589,_0x50eced);}function emitOutboundVoiceQueueSummary(_0x381492){if(_0x381492['type']===_0x5273('0x3f')){logger[_0x5273('0x40')](_0x5273('0x41'),util[_0x5273('0x42')](_0x381492,{'showHidden':![],'depth':null}));emit(util[_0x5273('0x43')](_0x5273('0x44'),_0x381492[_0x5273('0x45')]),_0x5273('0x46'),_0x381492);}}function checkGetDataPredictive(_0x4e4397){if(isNotNull(_0x4e4397)&&!_[_0x5273('0x47')](_0x4e4397)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0x5273('0x48'),_0x4e4397['predictiveIntervalTotalCalls']);loggerPredictive[_0x5273('0x49')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e4397[_0x5273('0x4a')]);loggerPredictive[_0x5273('0x49')](_0x5273('0x4b'),_0x4e4397[_0x5273('0x4c')]);loggerPredictive[_0x5273('0x49')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e4397['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x5273('0x49')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e4397[_0x5273('0x4d')]);loggerPredictive[_0x5273('0x49')](_0x5273('0x4e'),_0x4e4397[_0x5273('0x4f')]);loggerPredictive[_0x5273('0x49')](_0x5273('0x50'));if(_0x4e4397[_0x5273('0x51')]>0x0){if(!_['isUndefined'](_0x4e4397[_0x5273('0x4f')])&&_0x4e4397[_0x5273('0x4f')]>0x0){return!![];}loggerPredictive[_0x5273('0x49')](_0x5273('0x52'));if(!_[_0x5273('0x3e')](_0x4e4397[_0x5273('0x4d')])&&_0x4e4397[_0x5273('0x4d')]>0x0){return!![];}loggerPredictive[_0x5273('0x49')](_0x5273('0x53'));}else{loggerPredictive[_0x5273('0x49')](_0x5273('0x54'));}}else{loggerPredictive[_0x5273('0x49')](_0x5273('0x55'));}return![];}function mergeDataErlangB(_0x2ec8af){return function(_0x34ecd2){loggerPredictive[_0x5273('0x49')](_0x5273('0x56'));loggerPredictive[_0x5273('0x49')](_0x5273('0x57'),_0x34ecd2['erlangCalls']);loggerPredictive[_0x5273('0x49')](_0x5273('0x58'),_0x34ecd2[_0x5273('0x59')]);loggerPredictive[_0x5273('0x49')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34ecd2[_0x5273('0x5a')]);loggerPredictive[_0x5273('0x49')](_0x5273('0x5b'),_0x34ecd2[_0x5273('0x5c')]);loggerPredictive[_0x5273('0x49')](_0x5273('0x5d'),_0x34ecd2[_0x5273('0x5a')]);loggerPredictive['info'](_0x5273('0x50'));_[_0x5273('0x5e')](_0x2ec8af,_0x34ecd2);};}function ifInterval(_0x59b561,_0x462711){if(_[_0x5273('0x3e')](_0x462711)){return![];}return utils[_0x5273('0x5f')](undefined,_0x462711)<_0x59b561*0x3c;}function clearPredictiveAttributes(_0x2e4b94){if(_0x2e4b94[_0x5273('0x28')]){_0x2e4b94[_0x5273('0x28')]=undefined;loggerPredictive[_0x5273('0x40')](_0x2e4b94[_0x5273('0x45')],'startProgressive\x20value\x20cleared');}if(_0x2e4b94[_0x5273('0x27')]){_0x2e4b94[_0x5273('0x27')]=undefined;loggerPredictive['debug'](_0x2e4b94[_0x5273('0x45')],_0x5273('0x60'));}if(_0x2e4b94['handlePredictive']){clearInterval(_0x2e4b94[_0x5273('0x61')]);_0x2e4b94[_0x5273('0x61')]=undefined;loggerPredictive['debug'](_0x2e4b94[_0x5273('0x45')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0xc852b6,_0x42c93d){return function(_0x755e7f){loggerPredictive['error'](_0x42c93d['name'],_0xc852b6);loggerPredictive[_0x5273('0x62')](_0x755e7f[_0x5273('0x63')]);clearPredictiveAttributes(_0x42c93d);};}function loggerCatch(_0x3dd8f5){return function(_0x590f86){logger[_0x5273('0x62')](_0x3dd8f5,util[_0x5273('0x42')](_0x590f86,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xa0c2cb,_0x3d66a1,_0xd6126b){return function(_0x51f2a3){utils['checkContactLowerLimitOriginate'](_0x3d66a1,_0xd6126b,0x0);logger['error'](_0xa0c2cb,util[_0x5273('0x42')](_0x51f2a3,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xbed90a){return function(_0x2d9470){if(isNotNull(_0x2d9470)&&isNotNull(_0x2d9470[0x0])){if(_0x2d9470[0x0][_0x5273('0x64')]>0x0){_0xbed90a['message']=utils[_0x5273('0x65')][_0x5273('0x66')];logger[_0x5273('0x49')]('[getContactDialer2][ReScheduled]'+_0xbed90a[_0x5273('0x45')],_0x2d9470[0x0][_0x5273('0x64')],_0x5273('0x67'));}else{_0xbed90a[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x69')];logger[_0x5273('0x49')](_0x5273('0x6a')+_0xbed90a[_0x5273('0x45')]);}}};}function createObjHistory(_0x441f5f,_0x34a9a7,_0x2af889,_0x1d70fe,_0x29a3d1){_0x441f5f[_0x5273('0x68')]=_0x2af889;var _0x396b87=new Action(_0x441f5f,_0x34a9a7);var _0x4b0023=new History(_0x396b87);_0x4b0023[_0x5273('0x6b')]=_0x1d70fe;_0x4b0023[_0x5273('0x6c')]=_0x29a3d1;_0x4b0023[_0x5273('0x6d')]=_0x396b87['starttime'];return _0x4b0023;}function unlockQueueStatus(_0x486de2,_0x3448d7){setTimeout(function(){if(_[_0x5273('0x3e')](_0x486de2[_0x5273('0x6e')])){loggerBooked[_0x5273('0x62')](_0x5273('0x6f'),_0x3448d7);}_0x486de2[_0x5273('0x6e')]=!![];loggerBooked[_0x5273('0x49')]('[booked][unlockQueueStatus]',_0x3448d7,JSON['stringify'](_[_0x5273('0x70')](_0x486de2,['name','queueStatusComplete'])));},0x1f3);}function checkInterval(_0x1746c9){return function(){if(!isNotNull(_0x1746c9[_0x5273('0x71')])){_0x1746c9[_0x5273('0x68')]=utils['CAMPAIGN_STATUS'][_0x5273('0x72')];throw _0x1746c9['name']+_0x5273('0x73');}if(!isNotNull(_0x1746c9[_0x5273('0x71')][_0x5273('0x74')])){_0x1746c9[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x72')];throw _0x1746c9[_0x5273('0x45')]+_0x5273('0x73');}if(!isNotNull(_[_0x5273('0x47')](_0x1746c9[_0x5273('0x71')]['Intervals']))){_0x1746c9[_0x5273('0x68')]=utils[_0x5273('0x65')]['NULL_INTERVAL'];throw _0x1746c9[_0x5273('0x45')]+_0x5273('0x73');}};}function checkIsIVRCampaignActive(_0x9ff1c5){return function(){if(!utils['isIVRCampaignActive'](_0x9ff1c5)){_0x9ff1c5[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x75')];throw _0x9ff1c5[_0x5273('0x45')]+_0x5273('0x76');}};}function emitCampaignSummary(_0x40df33){if(utils[_0x5273('0x77')](_0x40df33)){emit(util[_0x5273('0x43')](_0x5273('0x78'),_0x40df33[_0x5273('0x45')]),_0x5273('0x79'),_0x40df33);}}function loggerCatchQueueSummary(_0x2d8187,_0xf5321e){return function(_0x4f505f){clearPredictiveAttributes(_0xf5321e);emitCampaignSummary(_0xf5321e);loggerSyncQueueSummary['debug'](_0x2d8187,util[_0x5273('0x42')](_0x4f505f,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x555096){if(_0x555096[_0x5273('0x7a')]){if(_0x555096['originated']===0x0){_0x555096[_0x5273('0x7a')]=![];_0x555096[_0x5273('0x68')]=utils[_0x5273('0x65')]['INACTIVE'];loggerSyncQueueSummary[_0x5273('0x40')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x555096[_0x5273('0x45')],_0x5273('0x7b'));}else{_0x555096[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x7c')];loggerSyncQueueSummary['debug'](_0x5273('0x7d'),_0x555096['name'],_0x5273('0x7e'));}emitCampaignSummary(_0x555096);}}function myreject(_0x555e79){return function(_0x3d6a6c){return _0x555e79(msgResponse(_0x5273('0x7f'),_0x5273('0x80'),JSON[_0x5273('0x81')](_0x3d6a6c)));};}Dialer[_0x5273('0x18')][_0x5273('0x82')]=function(_0x262c65){return!_[_0x5273('0x3e')](_0x262c65)&&_0x262c65&&!_[_0x5273('0x3e')](_0x262c65[_0x5273('0x45')])&&!_[_0x5273('0x3e')](_0x262c65[_0x5273('0x83')])&&_0x262c65[_0x5273('0x83')]&&(this[_0x5273('0x21')][util['format'](_0x5273('0x84'),_0x262c65[_0x5273('0x45')])][_0x5273('0x85')]===_0x5273('0x86')||this[_0x5273('0x21')][util['format'](_0x5273('0x84'),_0x262c65['name'])][_0x5273('0x85')]===_0x5273('0x87'));};Dialer[_0x5273('0x18')][_0x5273('0x88')]=function(_0x1e6cf9){var _0x2ccb35=this;return function(){if(!_0x2ccb35[_0x5273('0x82')](_0x1e6cf9['Trunk'])){if(!_0x2ccb35[_0x5273('0x82')](_0x1e6cf9[_0x5273('0x89')])){_0x1e6cf9[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x8a')];throw _0x1e6cf9[_0x5273('0x45')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x5273('0x18')][_0x5273('0x8b')]=function(_0x4e5ec7,_0x44e32b,_0x1612ce,_0x45a56f){var _0x29c355=this;return function(){var _0x520d65=!![];return _0x29c355['ifTimeIvr'](_0x4e5ec7,_0x44e32b,_0x1612ce,_0x45a56f,_0x520d65);};};Dialer['prototype'][_0x5273('0x8c')]=function(_0x5dc159,_0x55ac01,_0x3668d5,_0xff0492){var _0x15324b=this;return function(){var _0x30288c=![];return _0x15324b[_0x5273('0x8d')](_0x5dc159[_0x5273('0x74')],_0x55ac01,_0x3668d5,_0xff0492,_0x30288c);};};Dialer[_0x5273('0x18')][_0x5273('0x8d')]=function(_0x3a6373,_0x1645aa,_0x2cdc1a,_0x50e280,_0x485b27){var _0x1bf3a3=[];return new Promise(function(_0x4ae03d,_0x93cfab){if(!isNotNull(_0x3a6373)){_0x50e280[_0x5273('0x68')]=utils['CAMPAIGN_STATUS'][_0x5273('0x72')];return _0x93cfab(msgResponse(_0x5273('0x8e'),_0x5273('0x8f'),_0x2cdc1a+_0x5273('0x90')));}if(_[_0x5273('0x47')](_0x3a6373)){_0x50e280[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x91')];return _0x93cfab(msgResponse(_0x5273('0x8e'),_0x5273('0x8f'),_0x2cdc1a+_0x5273('0x92')));}if(_0x1645aa&&_['isUndefined'](config['timezones'][_0x1645aa])){_0x50e280[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x93')];return _0x93cfab(msgResponse(_0x5273('0x8e'),_0x5273('0x8f'),_0x2cdc1a+_0x5273('0x94')+_0x1645aa));}if(_['isArray'](_0x3a6373)){for(var _0x2f0a40=0x0;_0x2f0a40<_0x3a6373[_0x5273('0x95')];_0x2f0a40+=0x1){_0x1bf3a3[_0x5273('0x96')](ami[_0x5273('0x97')]({'action':_0x5273('0x98'),'command':util[_0x5273('0x43')]('iftime\x20%s,%s',_0x3a6373[_0x2f0a40][_0x5273('0x99')],!_[_0x5273('0x3e')](config[_0x5273('0x9a')][_0x1645aa])?_0x1645aa:'')})[_0x5273('0x3d')](function(_0x29dd0e){return _0x29dd0e[_0x5273('0x9b')][_0x5273('0x9c')]('true')>=0x0;})['catch'](myreject(_0x93cfab)));}}else{_0x1bf3a3['push'](ami[_0x5273('0x97')]({'action':_0x5273('0x98'),'command':util[_0x5273('0x43')](_0x5273('0x9d'),_0x3a6373,!_['isUndefined'](config['timezones'][_0x1645aa])?_0x1645aa:'')})[_0x5273('0x3d')](function(_0x3e6d36){return _0x3e6d36[_0x5273('0x9b')]['indexOf'](_0x5273('0x9e'))>=0x0;})[_0x5273('0x9f')](myreject(_0x93cfab)));}Promise[_0x5273('0xa0')](_0x1bf3a3)[_0x5273('0x3d')](function(_0xdbfd73){var _0x2889d8=_['some'](_0xdbfd73);if(_0x2889d8){return _0x4ae03d(_0x2889d8);}else{_0x50e280[_0x5273('0x68')]=_0x485b27?utils[_0x5273('0x65')][_0x5273('0xa1')]:utils[_0x5273('0x65')][_0x5273('0xa2')];return _0x93cfab(msgResponse('[ifTime][promiseAll]',_0x5273('0x8f'),_0x5273('0xa3')+_0x485b27+'\x20'+_0x2cdc1a+_0x5273('0xa4')+util[_0x5273('0x42')](_0x3a6373,{'showHidden':![],'depth':null})+_0x5273('0xa5')+_0x1645aa));}})[_0x5273('0x9f')](function(_0x1b4b32){return _0x93cfab(msgResponse(_0x5273('0x8e'),_0x5273('0x8f'),JSON[_0x5273('0x81')](_0x1b4b32)));});});};Dialer[_0x5273('0x18')][_0x5273('0x3a')]=function(){var _0x3f0a93=this;return cmHopper[_0x5273('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0x5273('0x3d')](function(){setInterval(function(){_0x3f0a93['syncCampaigns']();},0x3e8);});};Dialer[_0x5273('0x18')][_0x5273('0xa7')]=function(){var _0x3e2be7=this;var _0x1f38db;for(var _0x502be8 in this['campaigns']){if(typeof this['campaigns'][_0x502be8]!=='undefined'){_0x1f38db=this['campaigns'][_0x502be8];if(utils[_0x5273('0x77')](_0x1f38db)&&utils[_0x5273('0xa8')](_0x1f38db)){_0x1f38db[_0x5273('0x7a')]=!![];Promise[_0x5273('0xa9')]()[_0x5273('0x3d')](checkIsIVRCampaignActive(_0x1f38db))[_0x5273('0x3d')](checkInterval(_0x1f38db))[_0x5273('0x3d')](_0x3e2be7[_0x5273('0x88')](_0x1f38db))[_0x5273('0x3d')](_0x3e2be7[_0x5273('0x8b')](_0x1f38db['dialGlobalInterval'],_0x1f38db[_0x5273('0xaa')],_0x1f38db[_0x5273('0x45')],_0x1f38db))[_0x5273('0x3d')](_0x3e2be7[_0x5273('0x8c')](_0x1f38db[_0x5273('0x71')],_0x1f38db[_0x5273('0xaa')],_0x1f38db[_0x5273('0x45')],_0x1f38db))[_0x5273('0x3d')](_0x3e2be7['launchHandleIvr'](_0x1f38db))[_0x5273('0x9f')](loggerCatchQueueSummary(_0x5273('0xab'),_0x1f38db));}else{notSendMessagesCampaign(_0x1f38db);}}}};Dialer[_0x5273('0x18')][_0x5273('0xac')]=function(_0x39b5d8){if(_0x39b5d8[_0x5273('0xad')]!==_0x5273('0x7')){clearPredictiveAttributes(_0x39b5d8);}switch(_0x39b5d8[_0x5273('0xad')]){case _0x5273('0xae'):this[_0x5273('0xaf')](_0x39b5d8,0x1);break;case _0x5273('0xb0'):this[_0x5273('0xaf')](_0x39b5d8,_0x39b5d8[_0x5273('0xb1')]);break;case _0x5273('0x7'):this['predictive'](_0x39b5d8);break;case _0x5273('0xb2'):this[_0x5273('0xaf')](_0x39b5d8,0x1);break;default:logger[_0x5273('0x62')](_0x5273('0xb3'),_0x39b5d8[_0x5273('0x45')],'method\x20not\x20recognized');}};Dialer[_0x5273('0x18')][_0x5273('0x8e')]=function(_0x5d4536,_0x46a083){var _0x1e57f2=_0x5d4536[_0x5273('0xaa')];var _0x2923f7=_0x46a083?_0x5d4536[_0x5273('0xb4')]:_0x5d4536[_0x5273('0x71')][_0x5273('0x74')];logger['silly'](_0x5273('0xb5'),_0x2923f7,_0x1e57f2,_0x5d4536['name'],util['format'](_0x5273('0xb6'),_0x5d4536[_0x5273('0x45')],_0x5d4536['id']));var _0xcfe040=null;return Interval[_0x5273('0xb7')](_0x2923f7,_0x1e57f2)[_0x5273('0x3d')](function(_0x54b7c4){if(_0x54b7c4===!![]){return _0x54b7c4;}else{_0x5d4536['message']=_0x46a083?utils[_0x5273('0x65')][_0x5273('0xa1')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0xcfe040=msgResponse(_0x5273('0xb8'),'Failure',_0x5273('0xa3')+_0x46a083+'\x20'+_0x5d4536['name']+_0x5273('0xa4')+util[_0x5273('0x42')](_0x2923f7,{'showHidden':![],'depth':null})+_0x5273('0xa5')+_0x1e57f2);}if(_0xcfe040!==null){logger[_0x5273('0xb9')](_0x5273('0xba'),_0xcfe040);_0xcfe040[_0x5273('0xbb')]=_0x46a083;throw _0xcfe040;}})[_0x5273('0x9f')](function(_0x69933a){logger['error']('AMI\x20IfTime',_0x69933a);throw msgResponse(_0x5273('0x7f'),'Error',util[_0x5273('0x42')](_0x69933a,{'showHidden':![],'depth':null}));});};Dialer[_0x5273('0x18')]['syncAgentConnect']=function(_0x345bed){if(this[_0x5273('0x1e')][_0x345bed[_0x5273('0xbc')]]){if(this[_0x5273('0xbd')][_0x345bed[_0x5273('0xbe')]]&&this[_0x5273('0xbd')][_0x345bed['uniqueid']][_0x5273('0xbf')]!==_0x5273('0xc0')){this[_0x5273('0xc1')](this[_0x5273('0x1e')][_0x345bed[_0x5273('0xbc')]]);this['uniqueId'][_0x345bed['uniqueid']][_0x5273('0xc2')]=moment()[_0x5273('0x43')](_0x5273('0xc3'));}}};Dialer['prototype'][_0x5273('0x32')]=function(_0x42b115){var _0x48c1a0=this['uniqueId'][_0x42b115[_0x5273('0xbe')]];if(this[_0x5273('0x1e')][_0x42b115['queue']]){if(_0x48c1a0&&_0x48c1a0[_0x5273('0xbf')]!==_0x5273('0xc0')){delete this[_0x5273('0xbd')][_0x42b115[_0x5273('0xbe')]];this[_0x5273('0x1e')][_0x42b115[_0x5273('0xbc')]][_0x5273('0xc4')]+=0x1;var _0x27fbdd=new AgentComplete(_0x48c1a0,_0x42b115);if(_0x42b115[_0x5273('0xc5')]===_0x5273('0xc6')){_0x27fbdd[_0x5273('0xc7')]=this[_0x5273('0x1e')][_0x42b115[_0x5273('0xbc')]]['dialQueueProject2']&&this[_0x5273('0x1e')][_0x42b115[_0x5273('0xbc')]][_0x5273('0xc8')]?moment()['format'](_0x5273('0xc3')):undefined;}hopperUtils['createHistory'](_0x27fbdd)['catch'](loggerCatch(_0x5273('0xc9')));hopperUtils['moveContactManagedDialer'](_0x27fbdd)['catch'](loggerCatch(_0x5273('0xca')));}}};Dialer[_0x5273('0x18')][_0x5273('0xcb')]=function(_0x2d858d){var _0x270194=this['uniqueId'][_0x2d858d[_0x5273('0xbe')]];var _0x52868d=this;var _0x2b9c14=![];var _0x2845cd;var _0x1f6f61;if(this['voiceQueues'][_0x2d858d[_0x5273('0xbc')]]){if(_0x270194&&_0x270194['type']!==_0x5273('0xc0')){delete this['uniqueId'][_0x2d858d[_0x5273('0xbe')]];this['updateOriginated'](this[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]]);_0x270194[_0x5273('0xcc')]=moment()[_0x5273('0x43')](_0x5273('0xc3'));var _0x4731f4=new QueueCallerAbandon(_0x270194,_0x2d858d);if(utils[_0x5273('0x5f')](_0x270194[_0x5273('0xcc')],_0x270194[_0x5273('0xcd')])>=_0x270194[_0x5273('0xce')]){this[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xcf')]+=0x1;this[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xd0')]+=0x1;_0x4731f4[_0x5273('0x6b')]=0xa;_0x4731f4['statedesc']=_0x5273('0xd1');_0x4731f4[_0x5273('0xd2')]=_0x5273('0xd3');_0x4731f4[_0x5273('0xc7')]=this[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xd4')]?moment()[_0x5273('0x43')](_0x5273('0xc3')):undefined;_0x4731f4[_0x5273('0xd5')]+=0x1;_0x4731f4['countglobal']+=0x1;_0x2845cd=this[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xd6')];_0x1f6f61=this['voiceQueues'][_0x2d858d['queue']][_0x5273('0xd7')];hopperUtils[_0x5273('0xd8')](_0x4731f4,_0x4731f4['state'],_0x270194['voiceQueue'])['then'](function(_0x17bf1b){_0x2b9c14=_0x17bf1b[_0x5273('0xd9')]==0x1;if(_0x4731f4['countdropretry']>=_0x52868d[_0x5273('0x1e')][_0x2d858d['queue']]['dialDropMaxRetry']){_0x52868d[_0x5273('0xda')](_0x4731f4,_0x17bf1b[_0x5273('0xd9')]);}else{hopperUtils[_0x5273('0xdb')]({'active':![],'countdropretry':_0x4731f4[_0x5273('0xd5')],'scheduledat':moment()[_0x5273('0xdc')](_0x52868d[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xd6')],_0x5273('0xdd'))['format'](_0x5273('0xc3')),'ContactId':_0x270194[_0x5273('0xde')],'ListId':_0x270194[_0x5273('0xdf')],'VoiceQueueId':_0x270194['VoiceQueueId']||undefined,'CampaignId':_0x270194[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch('[rescheduleContact][Drop]'));var _0x22e3ce=new History(_0x4731f4);_0x22e3ce[_0x5273('0x6b')]=0xa;_0x22e3ce['statedesc']='Drop';_0x22e3ce['starttime']=moment()[_0x5273('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x22e3ce[_0x5273('0x6d')]=_0x22e3ce[_0x5273('0xe1')];_0x22e3ce[_0x5273('0xe2')]=_0x4731f4[_0x5273('0xe2')];_0x22e3ce[_0x5273('0xe3')]=_0x4731f4[_0x5273('0xe3')];hopperUtils[_0x5273('0xe4')](_0x22e3ce)[_0x5273('0x9f')](loggerCatch(_0x5273('0xe5')));}})[_0x5273('0x3d')](function(){if(_0x2b9c14)hopperUtils[_0x5273('0xe6')](_0x4731f4,_0x2845cd,_0x1f6f61)[_0x5273('0x3d')](function(){return 0x1;});});}else{this['voiceQueues'][_0x2d858d['queue']][_0x5273('0xe7')]+=0x1;this[_0x5273('0x1e')][_0x2d858d['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x4731f4[_0x5273('0x6b')]=0xb;_0x4731f4[_0x5273('0x6c')]='Abandoned';_0x4731f4['dropreason']='CALLEREXIT';_0x4731f4[_0x5273('0xe8')]+=0x1;_0x4731f4[_0x5273('0xe9')]+=0x1;_0x2845cd=this['voiceQueues'][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xea')];_0x1f6f61=this[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x4731f4,_0x4731f4[_0x5273('0x6b')],_0x270194['voiceQueue'])[_0x5273('0x3d')](function(_0x12cf55){if(_0x4731f4[_0x5273('0xe8')]>=_0x52868d[_0x5273('0x1e')][_0x2d858d[_0x5273('0xbc')]][_0x5273('0xeb')]){_0x52868d[_0x5273('0xda')](_0x4731f4,_0x12cf55[_0x5273('0xd9')]);}else{hopperUtils[_0x5273('0xdb')]({'active':![],'countabandonedretry':_0x4731f4[_0x5273('0xe8')],'scheduledat':moment()[_0x5273('0xdc')](_0x52868d[_0x5273('0x1e')][_0x2d858d['queue']][_0x5273('0xea')],_0x5273('0xdd'))[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x270194[_0x5273('0xde')],'ListId':_0x270194[_0x5273('0xdf')],'VoiceQueueId':_0x270194[_0x5273('0xec')]||undefined,'CampaignId':_0x270194[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch(_0x5273('0xed')));var _0x2f5ecd=new History(_0x4731f4);_0x2f5ecd[_0x5273('0x6b')]=0xb;_0x2f5ecd[_0x5273('0x6c')]=_0x5273('0xee');_0x2f5ecd[_0x5273('0xe1')]=moment()[_0x5273('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f5ecd[_0x5273('0x6d')]=_0x2f5ecd[_0x5273('0xe1')];_0x2f5ecd[_0x5273('0xe2')]=_0x4731f4['calleridname'];_0x2f5ecd[_0x5273('0xe3')]=_0x4731f4['calleridnum'];hopperUtils['createHistory'](_0x2f5ecd)[_0x5273('0x9f')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x5273('0x3d')](function(){if(_0x2b9c14)hopperUtils[_0x5273('0xe6')](_0x4731f4,_0x2845cd,_0x1f6f61)['then'](function(){return 0x1;});});}}}};Dialer[_0x5273('0x18')][_0x5273('0x37')]=function(_0x2a70b5){if(this['actions'][_0x2a70b5[_0x5273('0xbe')]]){this['actions'][_0x2a70b5[_0x5273('0xbe')]][_0x5273('0xef')]=_0x2a70b5[_0x5273('0xef')];}if(this[_0x5273('0xbd')][_0x2a70b5[_0x5273('0xbe')]]){this['uniqueId'][_0x2a70b5[_0x5273('0xbe')]]['channel']=_0x2a70b5[_0x5273('0xef')];}};Dialer[_0x5273('0x18')]['syncQueueMember']=function(_0x10988c){if(!this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]]){return;}var _0x3789fa=this[_0x5273('0x1e')][this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]][_0x5273('0xbc')]]['strategy']||_0x5273('0xf1');if(_0x3789fa==='roundrobin'){if(this['actions'][_0x10988c[_0x5273('0xf0')]]&&_[_0x5273('0xf2')](this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]][_0x5273('0xf3')])&&_0x10988c[_0x5273('0x85')]==='1'&&_0x10988c[_0x5273('0xf4')]==='0'){if(this['agents'][_0x10988c[_0x5273('0xf5')]]){if(!this[_0x5273('0x20')][_0x10988c[_0x5273('0xf5')]][_0x5273('0xf3')]){this['agents'][_0x10988c[_0x5273('0xf5')]][_0x5273('0xf3')]=!![];this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]][_0x5273('0xf3')]=!![];this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]][_0x5273('0xf5')]=_0x10988c['stateinterface'];}}}}else if(_0x3789fa===_0x5273('0xf1')){if(this[_0x5273('0x24')][_0x10988c['actionid']]){if(this[_0x5273('0x20')][_0x10988c['stateinterface']]){this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]]['stateinterface']=_0x10988c[_0x5273('0xf5')];if(_['isNil'](this[_0x5273('0x2a')][this[_0x5273('0x24')][_0x10988c['actionid']][_0x5273('0xbc')]])){this[_0x5273('0x2a')][this[_0x5273('0x24')][_0x10988c['actionid']][_0x5273('0xbc')]]=[];}this[_0x5273('0x2a')][this[_0x5273('0x24')][_0x10988c[_0x5273('0xf0')]]['queue']][_0x5273('0x96')](_[_0x5273('0x5e')](_['pick'](this[_0x5273('0x24')][_0x10988c['actionid']],[_0x5273('0xf6'),_0x5273('0xf5')]),{'status':_0x10988c['status'],'paused':_0x10988c['paused']}));}}}};Dialer['prototype'][_0x5273('0xf7')]=function(_0x321667){if(!this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]]){return;}var _0x127dc6=this;var _0x28cd88=this[_0x5273('0x1e')][this[_0x5273('0x24')][_0x321667['actionid']][_0x5273('0xbc')]];var _0x20ebcf=_0x28cd88['strategy']||_0x5273('0xf1');if(_0x20ebcf===_0x5273('0xf8')){if(this['actions'][_0x321667[_0x5273('0xf0')]]&&this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xf5')]){this[_0x5273('0x1d')]['run'](this[_0x5273('0x24')][_0x321667['actionid']]['idHopper'],this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xf5')])[_0x5273('0x9f')](function(_0x49140a){logger[_0x5273('0x62')](_0x5273('0xf9'),util[_0x5273('0x42')](_0x49140a,{'showHidden':![],'depth':null}));})[_0x5273('0x1b')](function(){_0x127dc6['updateOriginated'](_0x127dc6[_0x5273('0x1e')][_0x127dc6[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]]['queue']]);_0x127dc6[_0x5273('0x20')][_0x127dc6['actions'][_0x321667['actionid']][_0x5273('0xf5')]]['locked']=![];delete _0x127dc6[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]];unlockQueueStatus(_0x28cd88);});}else{this['updateOriginated'](this[_0x5273('0x1e')][this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]]);hopperUtils[_0x5273('0xdb')]({'active':![],'ContactId':this['actions'][_0x321667[_0x5273('0xf0')]][_0x5273('0xde')],'ListId':this[_0x5273('0x24')][_0x321667['actionid']][_0x5273('0xdf')],'VoiceQueueId':this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xec')]||undefined,'CampaignId':this['actions'][_0x321667[_0x5273('0xf0')]][_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch(_0x5273('0xfa')));delete this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]];unlockQueueStatus(_0x28cd88);}}else if(_0x20ebcf===_0x5273('0xf1')){var _0x2cb88b;if(this['actions'][_0x321667[_0x5273('0xf0')]]&&!_[_0x5273('0x47')](this[_0x5273('0x2a')][this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]])){if(this['queueBookedRR'][_0x127dc6[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]]){this[_0x5273('0x2b')][_0x127dc6['actions'][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]]=this['queueBookedRR'][this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]]?this[_0x5273('0x2b')][this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]]:this[_0x5273('0x2a')][this['actions'][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]]?this[_0x5273('0x2a')][this[_0x5273('0x24')][_0x321667['actionid']][_0x5273('0xbc')]][_0x5273('0xfb')]||0x0:0x0;}this[_0x5273('0x2a')][this[_0x5273('0x24')][_0x321667[_0x5273('0xf0')]][_0x5273('0xbc')]][_0x5273('0xfb')]=this[_0x5273('0x2b')][this['actions'][_0x321667['actionid']][_0x5273('0xbc')]];for(var _0x1317a0=0x0;_0x1317a0=_0x59ca95[_0x5273('0x120')]){_0x10b545[_0x5273('0x121')](_0x431bb1,_0x5c84f6,_0x3bf121,_0x5273('0x122'));}else{if(_0x431bb1['countmachineretry']>=_0x59ca95[_0x5273('0x123')]){_0x10b545[_0x5273('0x124')](_0x431bb1,_0x5c84f6,_0x3bf121,_0x5273('0x125'));}else{hopperUtils[_0x5273('0xdb')]({'active':![],'countmachineretry':_0x431bb1['countmachineretry'],'scheduledat':moment()[_0x5273('0xdc')](_0x59ca95[_0x5273('0x126')],'minutes')[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x431bb1[_0x5273('0xde')],'ListId':_0x431bb1[_0x5273('0xdf')],'VoiceQueueId':_0x431bb1[_0x5273('0xec')]||undefined,'CampaignId':_0x431bb1[_0x5273('0xe0')]||undefined})['catch'](loggerCatch(_0x5273('0x127')));_0x5c84f6({'reschedule':0x1});}}});}if(_0x5b5ee1[_0x5273('0xbf')]===_0x5273('0xc0')&&this['campaigns'][_0x5b5ee1[_0x5273('0xbc')]][_0x5273('0x10a')]&&_0x12b5c7[_0x5273('0x10b')]==='HANGUP'){delete this[_0x5273('0xbd')][_0x12b5c7['uniqueid']];this[_0x5273('0xc1')](this['campaigns'][_0x5b5ee1['queue']]);_0x26e593=new Hangup(_0x5b5ee1,_0x12b5c7);_0x26e593['state']=0x12;_0x26e593[_0x5273('0x6c')]=_0x5273('0x10e');_0x26e593[_0x5273('0x118')]=_0x5273('0x10f');ami[_0x5273('0x119')](_0x5273('0x110'),ut['buildObj'](_0x26e593,_0x5273('0x112')));this['saveInDb'](_0x26e593,_0x5273('0x128'),_0x5273('0x129'));}if(_0x5b5ee1['type']==='ivr'&&this['campaigns'][_0x5b5ee1[_0x5273('0xbc')]][_0x5273('0x10a')]&&_0x12b5c7['value']===_0x5273('0x116')){return new Promise(function(_0x222914,_0x5588e3){delete _0x10b545[_0x5273('0xbd')][_0x12b5c7['uniqueid']];_0x10b545[_0x5273('0xc1')](_0x10b545['campaigns'][_0x5b5ee1['queue']]);_0x10b545[_0x5273('0x1f')][_0x5b5ee1['queue']]['outboundAnswerCallsDay']+=0x1;_0x10b545[_0x5273('0x1f')][_0x5b5ee1[_0x5273('0xbc')]][_0x5273('0x10d')]+=0x1;var _0x164ae3=_0x10b545[_0x5273('0x1f')][_0x5b5ee1[_0x5273('0xbc')]];var _0x14ea3e=new Hangup(_0x5b5ee1,_0x12b5c7);_0x14ea3e[_0x5273('0x6b')]=0x13;_0x14ea3e[_0x5273('0x6c')]=_0x5273('0x117');_0x14ea3e['membername']='AMD';_0x14ea3e[_0x5273('0x11e')]+=0x1;_0x14ea3e[_0x5273('0xe9')]+=0x1;_0x14ea3e['amd']=!![];ami[_0x5273('0x119')](_0x5273('0x110'),ut[_0x5273('0x111')](_0x14ea3e,_0x5273('0x112')));hopperUtils['createHistory'](_0x14ea3e)[_0x5273('0x9f')](loggerCatch(_0x5273('0x11a')));if(_0x14ea3e[_0x5273('0x11b')]+_0x14ea3e[_0x5273('0x11c')]+_0x14ea3e['countnoanswerretry']+_0x14ea3e[_0x5273('0x12a')]+_0x14ea3e[_0x5273('0xd5')]+_0x14ea3e[_0x5273('0xe8')]+_0x14ea3e[_0x5273('0x11e')]+_0x14ea3e[_0x5273('0x11f')]>=_0x164ae3[_0x5273('0x120')]){_0x10b545['stateGlobal'](_0x14ea3e,_0x222914,_0x5588e3,'reason19\x20machine....');}else{if(_0x14ea3e[_0x5273('0x11e')]>=_0x164ae3[_0x5273('0x123')]){_0x10b545['createStateFinal'](_0x14ea3e,_0x222914,_0x5588e3,_0x5273('0x125'));}else{hopperUtils[_0x5273('0xdb')]({'active':![],'countmachineretry':_0x14ea3e[_0x5273('0x11e')],'scheduledat':moment()[_0x5273('0xdc')](_0x164ae3[_0x5273('0x126')],_0x5273('0xdd'))[_0x5273('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14ea3e['ContactId'],'ListId':_0x14ea3e[_0x5273('0xdf')],'VoiceQueueId':_0x14ea3e[_0x5273('0xec')]||undefined,'CampaignId':_0x14ea3e[_0x5273('0xe0')]||undefined})['catch'](loggerCatch(_0x5273('0x127')));_0x222914({'reschedule':0x1});}}});}}};Dialer[_0x5273('0x18')]['syncHangup']=function(_0x25bad3){var _0x26d228=this[_0x5273('0xbd')][_0x25bad3['uniqueid']];var _0x264bb0;if(_0x26d228&&_0x26d228[_0x5273('0xbf')]===_0x5273('0xc0')){delete this[_0x5273('0xbd')][_0x25bad3[_0x5273('0xbe')]];this[_0x5273('0xc1')](this[_0x5273('0x1f')][_0x26d228[_0x5273('0xbc')]]);this[_0x5273('0x1f')][_0x26d228[_0x5273('0xbc')]]['ivrAnswerCallsDay']+=0x1;_0x264bb0=new Hangup(_0x26d228,_0x25bad3);hopperUtils[_0x5273('0xe4')](_0x264bb0)[_0x5273('0x9f')](loggerCatch(_0x5273('0x12b')));hopperUtils['moveContactManagedDialer'](_0x264bb0)[_0x5273('0x9f')](loggerCatch(_0x5273('0x12c')));}if(_0x26d228&&_0x26d228[_0x5273('0xbf')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x26d228[_0x5273('0xbc')]][_0x5273('0x12d')])){delete this[_0x5273('0xbd')][_0x25bad3['uniqueid']];this[_0x5273('0xc1')](this['voiceQueues'][_0x26d228[_0x5273('0xbc')]]);this[_0x5273('0x1e')][_0x26d228[_0x5273('0xbc')]][_0x5273('0xc4')]+=0x1;this[_0x5273('0x1e')][_0x26d228[_0x5273('0xbc')]][_0x5273('0x10d')]+=0x1;_0x264bb0=new Hangup(_0x26d228,_0x25bad3);_0x264bb0[_0x5273('0x6b')]=0x10;_0x264bb0[_0x5273('0x6c')]='AnswerAGI';_0x264bb0['membername']=_0x5273('0x12e');hopperUtils[_0x5273('0xe4')](_0x264bb0)['catch'](loggerCatch(_0x5273('0x12b')));hopperUtils[_0x5273('0x12f')](_0x264bb0)[_0x5273('0x9f')](loggerCatch('[syncHangupIvr]'));}if(_0x26d228&&_0x26d228[_0x5273('0xbf')]!==_0x5273('0xc0')&&!isNotNull(this[_0x5273('0x1e')][_0x26d228[_0x5273('0xbc')]][_0x5273('0x12d')])){delete this['uniqueId'][_0x25bad3[_0x5273('0xbe')]];this['updateOriginated'](this['voiceQueues'][_0x26d228[_0x5273('0xbc')]]);this[_0x5273('0x1e')][_0x26d228[_0x5273('0xbc')]][_0x5273('0x130')]+=0x1;_0x264bb0=new Hangup(_0x26d228,_0x25bad3);_0x264bb0[_0x5273('0x6b')]=0xc;_0x264bb0[_0x5273('0x6c')]=_0x25bad3[_0x5273('0x131')];_0x264bb0[_0x5273('0x118')]=_0x5273('0x132');hopperUtils[_0x5273('0xe4')](_0x264bb0)['catch'](loggerCatch(_0x5273('0x12b')));hopperUtils[_0x5273('0x12f')](_0x264bb0)['catch'](loggerCatch(_0x5273('0x12c')));}};Dialer[_0x5273('0x18')][_0x5273('0x8')]=function(_0x32e770){var _0x34f7a8=this;if(!_0x34f7a8[_0x5273('0x133')][_0x32e770[_0x5273('0x45')]]){_0x34f7a8['queuesSummary'][_0x32e770[_0x5273('0x45')]]={'running':![]};}else if(_0x34f7a8['queuesSummary'][_0x32e770['name']][_0x5273('0x134')]===!![]){return;}else if(_0x34f7a8[_0x5273('0x133')][_0x32e770[_0x5273('0x45')]]['running']===![]){_0x34f7a8['queuesSummary'][_0x32e770[_0x5273('0x45')]][_0x5273('0x134')]=!![];}var _0x1905fe=_0x34f7a8[_0x5273('0x1e')][_0x32e770[_0x5273('0x45')]];var _0x35d98e=_0x1905fe[_0x5273('0x68')]!==utils[_0x5273('0x65')][_0x5273('0x75')];var _0x2e7c03=utils[_0x5273('0x135')](_0x1905fe);_0x1905fe[_0x5273('0x136')]=utils[_0x5273('0x137')](_0x1905fe,_0x34f7a8[_0x5273('0x21')]);Promise[_0x5273('0xa9')]()[_0x5273('0x3d')](function(){if(_0x1905fe[_0x5273('0x136')]===utils[_0x5273('0x65')]['INACTIVE']){if(_0x35d98e){clearPredictiveAttributes(_0x1905fe);_0x32e770[_0x5273('0x27')]=undefined;_0x32e770[_0x5273('0x28')]=undefined;}if(_0x1905fe[_0x5273('0x136')]===utils[_0x5273('0x65')][_0x5273('0x75')]){_0x32e770[_0x5273('0x138')]=0x0;_0x32e770[_0x5273('0xf4')]=0x0;_0x32e770[_0x5273('0x139')]=0x0;_0x32e770[_0x5273('0x13a')]=0x0;_0x32e770[_0x5273('0x13b')]=0x0;}}else if(_0x1905fe[_0x5273('0x136')]===utils[_0x5273('0x65')][_0x5273('0x13c')]&&!_0x2e7c03){return _0x34f7a8[_0x5273('0x8e')](_0x1905fe,!![])['then'](function(){return _0x34f7a8[_0x5273('0x8e')](_0x1905fe,![]);})[_0x5273('0x3d')](function(){return _0x34f7a8[_0x5273('0xac')](_0x1905fe);})[_0x5273('0x9f')](function(_0x2df7da){loggerSyncQueueSummary[_0x5273('0x40')](_0x5273('0x13d'),util[_0x5273('0x42')](_0x2df7da,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1905fe);});}else{clearPredictiveAttributes(_0x1905fe);}})[_0x5273('0x3d')](function(){var _0x371eb6=_0x32e770[_0x5273('0x13e')](_0x1905fe);if(_0x371eb6||_0x1905fe['queueSummaryCountersUpdated']){_0x1905fe[_0x5273('0x13f')]=![];_0x32e770['updateReportFromOutboundQueue'](_0x1905fe);Object[_0x5273('0x140')](_0x1905fe,_0x32e770);emitOutboundVoiceQueueSummary(_0x32e770);}_0x34f7a8['queuesSummary'][_0x1905fe[_0x5273('0x45')]][_0x5273('0x134')]=![];})[_0x5273('0x9f')](function(_0x2feedf){logger['error'](_0x5273('0x13d'),util['inspect'](_0x2feedf,{'showHidden':![],'depth':null}));_0x34f7a8[_0x5273('0x133')][_0x1905fe[_0x5273('0x45')]][_0x5273('0x134')]=![];});};Dialer[_0x5273('0x18')][_0x5273('0x34')]=_[_0x5273('0x141')](function(){var _0x2e1006=_[_0x5273('0x142')](this[_0x5273('0x1e')],function(_0x59cb1b){return _0x59cb1b[_0x5273('0x143')];});var _0x561eef=_[_0x5273('0x142')](this[_0x5273('0x20')],function(_0x3c7fa2){return _0x3c7fa2[_0x5273('0x144')]&&_0x3c7fa2[_0x5273('0x85')]===_0x5273('0x86');});if(_0x2e1006[_0x5273('0x95')]>0x0&&_0x561eef[_0x5273('0x95')]>0x0){return Promise[_0x5273('0xa9')]()[_0x5273('0x3d')](cmHopper[_0x5273('0x145')](_[_0x5273('0x146')](_0x2e1006,'id'),previewRecallmeReminderInterval,_[_0x5273('0x146')](_0x561eef,'id')))[_0x5273('0x3d')](function(_0x5a1f6a){for(var _0x573114=0x0;_0x573114<_0x5a1f6a[_0x5273('0x95')];_0x573114++){var _0x11f0a9=_0x5a1f6a[_0x573114]['Agent'][_0x5273('0x45')];if(_0x11f0a9)io['to'](util[_0x5273('0x43')](_0x5273('0x147'),_0x11f0a9))[_0x5273('0x119')](_0x5273('0x148'),{'hopper':_0x5a1f6a[_0x573114]});}})[_0x5273('0x9f')](function(_0x407e17){logger['error'](_0x5273('0x149'),_0x407e17);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5273('0x18')][_0x5273('0x3b')]=function(){var _0x33e98a=this;setInterval(function(){_0x33e98a[_0x5273('0x14a')](_0x33e98a['uniqueId'],_0x5273('0x14b'));_0x33e98a[_0x5273('0x14a')](_0x33e98a[_0x5273('0x24')],_0x5273('0x14c'));},0x32c8);};Dialer[_0x5273('0x18')][_0x5273('0x14a')]=function(_0x5b5879,_0x2d8157){var _0x24eeda=this;for(var _0x1d336b in _0x5b5879){if(typeof _0x5b5879[_0x1d336b]!=='undefined'){this[_0x5273('0x1c')]['enqueue'](function(){if(!_[_0x5273('0xf2')](_0x5b5879[_0x1d336b])){return ami['Action']({'action':'status','channel':_0x5b5879[_0x1d336b][_0x5273('0xef')]})[_0x5273('0x9f')](function(_0x47af03){if(_0x47af03['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5b5879[_0x1d336b]&&_0x5b5879[_0x1d336b]['type']!==_0x5273('0xc0')){_0x24eeda[_0x5273('0xc1')](_0x24eeda['voiceQueues'][_0x5b5879[_0x1d336b][_0x5273('0xbc')]]);logger[_0x5273('0x62')]('[Dialer][checkChannel]',_0x2d8157,_0x1d336b,_0x5b5879[_0x1d336b][_0x5273('0xbc')]);delete _0x5b5879[_0x1d336b];}if(_0x5b5879[_0x1d336b]&&_0x5b5879[_0x1d336b][_0x5273('0xbf')]===_0x5273('0xc0')){_0x24eeda['updateOriginated'](_0x24eeda[_0x5273('0x1f')][_0x5b5879[_0x1d336b]['queue']]);logger[_0x5273('0x62')]('[Dialer][checkChannel][ivr]',_0x2d8157,_0x1d336b,_0x5b5879[_0x1d336b][_0x5273('0xbc')]);delete _0x5b5879[_0x1d336b];}},0x2328);}});}});}}};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x134ae8){return Promise['resolve']()[_0x5273('0x3d')](voiceQueueRt[_0x5273('0x14d')](_0x134ae8))[_0x5273('0x9f')](loggerCatch(_0x5273('0x14e')));};Dialer[_0x5273('0x18')][_0x5273('0xc1')]=function(_0x52df42){if(!_[_0x5273('0x3e')](_0x52df42)&&_0x52df42!==null){if(typeof _0x52df42['originated']!=='undefined'){if(_0x52df42[_0x5273('0x14f')]>0x0){_0x52df42['originated']-=0x1;}else{logger[_0x5273('0x62')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x5273('0x62')](_0x5273('0x150'));}};Dialer[_0x5273('0x18')][_0x5273('0x151')]=function(_0x131e35,_0x1dee51){var _0x45c789=this;return function(_0xe6dfb){_0x45c789[_0x5273('0xc1')](_0x1dee51);logger[_0x5273('0x62')](_0x131e35,util[_0x5273('0x42')](_0xe6dfb,{'showHidden':![],'depth':null}));};};Dialer[_0x5273('0x18')]['emptyContact']=function(_0x5de914,_0x95dcb0,_0x1e51c0){var _0x523cac={'state':0x19,'statedesc':_0x5273('0x152')};this[_0x5273('0xc1')](_0x95dcb0);this['saveInDb'](_[_0x5273('0x5e')](_0x523cac,_['pick'](_0x1e51c0,[_0x5273('0xde'),_0x5273('0xdf'),'UserId','VoiceQueueId',_0x5273('0xe0')])),_0x5273('0x153'),_0x5273('0x154'));logger[_0x5273('0x62')](_0x5de914);};Dialer[_0x5273('0x18')][_0x5273('0x113')]=function(_0x324b99,_0xa9a016,_0x57acf4){hopperUtils[_0x5273('0xe4')](_0x324b99)['catch'](loggerCatch(_0xa9a016));hopperUtils[_0x5273('0x12f')](_0x324b99)['catch'](loggerCatch(_0x57acf4));};Dialer[_0x5273('0x18')][_0x5273('0xda')]=function(_0x56d2c4,_0x2d73d4){hopperUtils[_0x5273('0xe4')](_0x56d2c4)[_0x5273('0x9f')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x2d73d4==0x0){hopperUtils['moveContactManagedDialer'](_0x56d2c4)['catch'](loggerCatch(_0x5273('0x155')));}};Dialer[_0x5273('0x18')][_0x5273('0x149')]=function(_0x1c705a){return Promise[_0x5273('0xa9')]()[_0x5273('0x3d')](cmHopper[_0x5273('0x145')](_0x1c705a['id'],previewRecallmeReminderInterval))[_0x5273('0x3d')](function(_0x4befe4){for(var _0x3d0813=0x0;_0x3d0813<_0x4befe4[_0x5273('0x95')];_0x3d0813++){var _0x4b6172=_0x4befe4[_0x3d0813][_0x5273('0x156')][_0x5273('0x45')];if(_0x4b6172)io['to'](util[_0x5273('0x43')](_0x5273('0x147'),_0x4b6172))[_0x5273('0x119')](_0x5273('0x148'),{'hopper':_0x4befe4[_0x3d0813]});}})[_0x5273('0x9f')](function(){});};Dialer[_0x5273('0x18')][_0x5273('0x157')]=function(_0x51a7aa){var _0x3a9da2=this;return function(){_0x3a9da2[_0x5273('0x158')](_0x51a7aa);};};Dialer[_0x5273('0x18')][_0x5273('0x159')]=function(_0x2c0780,_0x30f5d4){var _0x3232ba=this;var _0x4506b2=uuid['v4']();this[_0x5273('0x24')][_0x4506b2]=new Action(_0x2c0780,_0x30f5d4,_0x4506b2);return new Promise(function(_0x33637e,_0x1ce68c){if(_[_0x5273('0x3e')](_0x2c0780)&&typeof _0x2c0780!==_0x5273('0x15a')){return _0x1ce68c(msgResponse('originate',_0x5273('0x8f'),_0x5273('0x15b')));}if(_['isUndefined'](_0x30f5d4[_0x5273('0x15c')])||_0x30f5d4[_0x5273('0x15c')]===null){return _0x1ce68c(msgResponse(_0x5273('0x15d'),'Failure',_0x5273('0x15e')));}var _0x46d8f1={'XMD-CALLERID':_0x3232ba[_0x5273('0x24')][_0x4506b2]['getCaller'](),'XMD-AGI':_0x2c0780[_0x5273('0x12d')]?util['format'](_0x5273('0x15f'),ipAgi,_0x2c0780[_0x5273('0x12d')]):_0x5273('0x160'),'XMD-AGIAFTER':_0x2c0780[_0x5273('0xd4')]?util[_0x5273('0x43')](_0x5273('0x15f'),ipAgi,_0x2c0780[_0x5273('0xd4')]):'NONE','XMD-QUEUE':utils[_0x5273('0x161')](_0x2c0780)?util[_0x5273('0x43')](_0x5273('0x162'),_0x2c0780[_0x5273('0x45')],_0x2c0780['dialQueueOptions']||'',_0x2c0780[_0x5273('0xc8')]?'c':'',_0x2c0780[_0x5273('0xce')]||0x3):_0x5273('0x160'),'XMD-CONTACTID':_0x30f5d4[_0x5273('0xde')],'XMD-CDRTYPE':_0x5273('0x6'),'CALLERID(all)':_0x3232ba[_0x5273('0x24')][_0x4506b2][_0x5273('0x163')](),'XMD-AMD':_0x2c0780[_0x5273('0x10a')]?_0x5273('0x13c'):_0x5273('0x160'),'XMD-DESTINATION':_0x5273('0x164')};if(_0x2c0780[_0x5273('0x10a')]){_0x46d8f1[_0x5273('0x165')]=_0x2c0780[_0x5273('0x166')]||0x9c4;_0x46d8f1[_0x5273('0x167')]=_0x2c0780[_0x5273('0x168')]||0x5dc;_0x46d8f1[_0x5273('0x169')]=_0x2c0780[_0x5273('0x16a')]||0x320;_0x46d8f1[_0x5273('0x16b')]=_0x2c0780[_0x5273('0x16c')]||0x1388;_0x46d8f1[_0x5273('0x16d')]=_0x2c0780[_0x5273('0x16e')]||0x64;_0x46d8f1[_0x5273('0x16f')]=_0x2c0780[_0x5273('0x170')]||0x32;_0x46d8f1[_0x5273('0x171')]=_0x2c0780[_0x5273('0x172')]||0x3;_0x46d8f1[_0x5273('0x173')]=_0x2c0780[_0x5273('0x174')]||0x100;_0x46d8f1[_0x5273('0x175')]=_0x2c0780[_0x5273('0x176')]||0x1388;}if(utils[_0x5273('0x161')](_0x2c0780)){_0x46d8f1[_0x5273('0x177')]=_0x30f5d4[_0x5273('0xec')];}else{_0x46d8f1[_0x5273('0x178')]=_0x30f5d4['CampaignId'];}for(var _0x150b59 in _0x30f5d4[_0x5273('0x179')]){if(typeof _0x30f5d4['Contact'][_0x150b59]!==_0x5273('0x17a')){if(isNotNull(_0x30f5d4[_0x5273('0x179')][_0x150b59])&&_0x150b59!=='id'&&_0x150b59!==_0x5273('0x17b')&&_0x150b59!=='createdAt'&&_0x150b59!==_0x5273('0x17c')){_0x46d8f1[util[_0x5273('0x43')](_0x5273('0x17d'),_0x5273('0x17e'),_[_0x5273('0x17f')](_0x150b59))]=_0x30f5d4[_0x5273('0x179')][_0x150b59];}}}var _0x3b55c5=_0x3232ba[_0x5273('0x82')](_0x2c0780['Trunk'])?utils['getCallerId'](_0x2c0780['Trunk'][_0x5273('0x180')],_0x2c0780['dialOriginateCallerIdName'],_0x2c0780[_0x5273('0x181')]>0x0?utils[_0x5273('0x182')](_0x2c0780[_0x5273('0x183')],_0x2c0780[_0x5273('0x181')]):_0x2c0780[_0x5273('0x183')]):utils[_0x5273('0x184')](_['isNil'](_0x2c0780[_0x5273('0x89')])?_0x2c0780[_0x5273('0x185')][_0x5273('0x180')]:_0x2c0780[_0x5273('0x89')][_0x5273('0x180')],_0x2c0780[_0x5273('0x186')],_0x2c0780[_0x5273('0x181')]>0x0?utils[_0x5273('0x182')](_0x2c0780[_0x5273('0x183')],_0x2c0780[_0x5273('0x181')]):_0x2c0780[_0x5273('0x183')]);if(_0x3b55c5){_0x46d8f1[_0x5273('0x187')]=_0x3232ba[_0x5273('0x24')][_0x4506b2][_0x5273('0x188')]=utils[_0x5273('0x189')](_0x3b55c5);_0x46d8f1[_0x5273('0x18a')]=_0x30f5d4[_0x5273('0x15c')];}_0x2c0780[_0x5273('0x18b')]=_0x46d8f1;return ami['Action']({'actionid':_0x4506b2,'action':_0x5273('0x15d'),'channel':_0x3232ba[_0x5273('0x82')](_0x2c0780[_0x5273('0x185')])?util[_0x5273('0x43')](_0x5273('0x18c'),_0x2c0780[_0x5273('0x185')][_0x5273('0x45')],isNotNull(_0x2c0780[_0x5273('0x18d')])?_0x2c0780[_0x5273('0x18d')][_0x5273('0x18e')]()||'':'',_0x2c0780[_0x5273('0x18f')]>0x0?_0x30f5d4[_0x5273('0x15c')][_0x5273('0x190')](_0x2c0780['dialCutDigit']):_0x30f5d4[_0x5273('0x15c')]):util[_0x5273('0x43')](_0x5273('0x18c'),_['isNil'](_0x2c0780[_0x5273('0x89')])?_0x2c0780[_0x5273('0x185')][_0x5273('0x45')]:_0x2c0780[_0x5273('0x89')]['name'],isNotNull(_0x2c0780[_0x5273('0x18d')])?_0x2c0780[_0x5273('0x18d')]['trim']()||'':'',_0x2c0780[_0x5273('0x18f')]>0x0?_0x30f5d4[_0x5273('0x15c')][_0x5273('0x190')](_0x2c0780[_0x5273('0x18f')]):_0x30f5d4[_0x5273('0x15c')]),'callerid':_0x3b55c5,'Exten':_0x5273('0x164'),'Context':_0x5273('0x191'),'Priority':'1','variable':_0x46d8f1,'timeout':(_0x2c0780['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4506b2})[_0x5273('0x3d')](function(_0x59ef1b){return _0x33637e(_0x59ef1b);})['catch'](function(_0x16a448){_0x2c0780[_0x5273('0x192')]+=0x1;var _0x2a0c0b=new History(_0x3232ba['actions'][_0x4506b2]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x5273('0x81')](_0x16a448)));_0x2a0c0b['state']=0xe;_0x2a0c0b[_0x5273('0x6c')]=_0x5273('0x193');_0x2a0c0b[_0x5273('0xe1')]=moment()[_0x5273('0x43')](_0x5273('0xc3'));_0x2a0c0b['endtime']=_0x2a0c0b[_0x5273('0xe1')];hopperUtils[_0x5273('0xe4')](_0x2a0c0b)[_0x5273('0x9f')](loggerCatch(_0x5273('0x194')));_0x3232ba[_0x5273('0x12f')](_0x2a0c0b)['catch'](loggerCatch(_0x5273('0x194')))[_0x5273('0x1b')](function(){delete _0x3232ba[_0x5273('0x24')][_0x4506b2];return _0x1ce68c(msgResponse(_0x5273('0x15d'),_0x5273('0x80'),_0x5273('0x195')));});});});};Dialer[_0x5273('0x18')][_0x5273('0x196')]=function(_0x1af21e,_0x5c5987,_0x5d90e3){var _0x3009de=new History(_0x5c5987);if(_0x3009de[_0x5273('0x11b')]+_0x3009de[_0x5273('0x11c')]+_0x3009de['countnoanswerretry']+_0x3009de[_0x5273('0x12a')]+_0x3009de[_0x5273('0xd5')]+_0x3009de[_0x5273('0xe8')]+_0x3009de[_0x5273('0x11e')]+_0x3009de[_0x5273('0x11f')]>=_0x5d90e3[_0x5273('0x120')]-0x1){return!![];}switch(_0x1af21e){case 0x3:if(_0x3009de[_0x5273('0x11d')]>=_0x5d90e3[_0x5273('0x197')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x3009de[_0x5273('0x11d')]+=0x1,'scheduledat':moment()['add'](_0x5d90e3['dialNoAnswerRetryFrequency'],_0x5273('0xdd'))['format'](_0x5273('0xc3')),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de['VoiceQueueId']||undefined,'CampaignId':_0x3009de[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch(_0x5273('0x198')));break;case 0x5:if(_0x3009de[_0x5273('0x11b')]>=_0x5d90e3[_0x5273('0x199')]-0x1){return!![];}hopperUtils[_0x5273('0xdb')]({'active':![],'countbusyretry':_0x3009de['countbusyretry']+=0x1,'scheduledat':moment()[_0x5273('0xdc')](_0x5d90e3[_0x5273('0x19a')],_0x5273('0xdd'))[_0x5273('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de['ListId'],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x3009de[_0x5273('0x11c')]>=_0x5d90e3[_0x5273('0x19b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x3009de[_0x5273('0x11c')]+=0x1,'scheduledat':moment()[_0x5273('0xdc')](_0x5d90e3[_0x5273('0x19c')],_0x5273('0xdd'))[_0x5273('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3009de[_0x5273('0x12a')]>=_0x5d90e3[_0x5273('0x19d')]-0x1){return!![];}else{hopperUtils[_0x5273('0xdb')]({'active':![],'countnosuchnumberretry':_0x3009de[_0x5273('0x12a')]+=0x1,'scheduledat':moment()[_0x5273('0xdc')](_0x5d90e3[_0x5273('0x19e')],_0x5273('0xdd'))[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de['CampaignId']||undefined})['catch'](loggerCatch(_0x5273('0x19f')));}break;case 0xa:if(_0x3009de['countdropretry']>=_0x5d90e3[_0x5273('0x1a0')]-0x1){return!![];}hopperUtils[_0x5273('0xdb')]({'active':![],'countdropretry':_0x3009de[_0x5273('0xd5')]+=0x1,'scheduledat':moment()['add'](_0x5d90e3[_0x5273('0xd6')],_0x5273('0xdd'))[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de['CampaignId']||undefined})[_0x5273('0x9f')](loggerCatch(_0x5273('0x1a1')));break;case 0xb:if(_0x3009de[_0x5273('0xe8')]>=_0x5d90e3[_0x5273('0xeb')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x3009de[_0x5273('0xe8')]+=0x1,'scheduledat':moment()['add'](_0x5d90e3[_0x5273('0xea')],_0x5273('0xdd'))[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch(_0x5273('0xed')));break;case 0x13:if(_0x3009de[_0x5273('0x11e')]>=_0x5d90e3[_0x5273('0x123')]-0x1){return!![];}hopperUtils[_0x5273('0xdb')]({'active':![],'countmachineretry':_0x3009de[_0x5273('0x11e')]+=0x1,'scheduledat':moment()[_0x5273('0xdc')](_0x5d90e3[_0x5273('0x126')],_0x5273('0xdd'))[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x3009de['countagentrejectretry']>=_0x5d90e3[_0x5273('0x1a2')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x3009de[_0x5273('0x11f')]+=0x1,'scheduledat':moment()[_0x5273('0xdc')](_0x5d90e3[_0x5273('0x1a3')],_0x5273('0xdd'))[_0x5273('0x43')](_0x5273('0xc3')),'ContactId':_0x3009de[_0x5273('0xde')],'ListId':_0x3009de[_0x5273('0xdf')],'VoiceQueueId':_0x3009de[_0x5273('0xec')]||undefined,'CampaignId':_0x3009de[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x5273('0x18')][_0x5273('0x105')]=function(_0x10b9a7,_0x10f8cc,_0x117c79){var _0x3c289f=this;var _0x30fb0c=new History(_0x10b9a7);var _0x1f4fec=![];var _0x2fc771;var _0x3a1187;return new Promise(function(_0x1793fe,_0x1ac4f5){if(_['isUndefined'](_0x10f8cc)&&typeof _0x10f8cc!==_0x5273('0x15a')){return _0x1ac4f5(msgResponse(_0x5273('0x1a4'),_0x5273('0x8f'),_0x5273('0x1a5')));}if(_['isUndefined'](_0x117c79)&&typeof _0x117c79!==_0x5273('0x15a')){return _0x1ac4f5(msgResponse('[callProgressDetecting]',_0x5273('0x8f'),_0x5273('0x1a6')));}hopperUtils[_0x5273('0xd8')](_0x30fb0c,_0x117c79[_0x5273('0xc5')],_0x10f8cc)['then'](function(_0x17e4aa){if(_0x17e4aa[_0x5273('0xd9')]==0x1)_0x1f4fec=!![];switch(_0x117c79[_0x5273('0xc5')]){case'0':_0x10f8cc['outboundNoSuchCallsDay']+=0x1;_0x30fb0c['state']=0x0;_0x30fb0c['statedesc']=_0x5273('0x1a7');_0x30fb0c[_0x5273('0x12a')]+=0x1;_0x30fb0c['countglobal']+=0x1;ami[_0x5273('0x119')](_0x5273('0x1a8'),ut['buildObj'](_0x10b9a7,_0x5273('0x1a9')));_0x2fc771=_0x10f8cc[_0x5273('0x19e')];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];hopperUtils[_0x5273('0xe4')](_0x30fb0c)[_0x5273('0x9f')](loggerCatch(_0x5273('0x11a')));if(_0x3c289f[_0x5273('0x196')](0x0,_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0x12a')]>=_0x10f8cc[_0x5273('0x19d')]){_0x3c289f[_0x5273('0x124')](_0x30fb0c,_0x1793fe,_0x1ac4f5,'reason\x200\x20no\x20such\x20number....');}else{_0x3c289f[_0x5273('0x121')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1aa'));}}break;case'3':_0x10f8cc[_0x5273('0x1ab')]+=0x1;_0x30fb0c[_0x5273('0x6b')]=0x3;_0x30fb0c[_0x5273('0x6c')]='NoAnswer';_0x30fb0c[_0x5273('0x11d')]+=0x1;_0x30fb0c['countglobal']+=0x1;var _0x16c504=ut[_0x5273('0x1ac')](_0x10b9a7,_0x10f8cc);ami[_0x5273('0x119')](_0x5273('0x1ad'),_0x16c504);_0x2fc771=_0x10f8cc['dialNoAnswerRetryFrequency'];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];hopperUtils[_0x5273('0xe4')](_0x30fb0c)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3c289f[_0x5273('0x196')](0x3,_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0x11d')]>=_0x10f8cc[_0x5273('0x197')]){_0x3c289f[_0x5273('0x124')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1ae'));}else{_0x3c289f[_0x5273('0x121')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1ae'));}}break;case'5':_0x10f8cc[_0x5273('0x1af')]+=0x1;_0x30fb0c[_0x5273('0x6b')]=0x5;_0x30fb0c[_0x5273('0x6c')]=_0x5273('0x1b0');_0x30fb0c['countbusyretry']+=0x1;_0x30fb0c[_0x5273('0xe9')]+=0x1;ami[_0x5273('0x119')]('custom:agentbusy',ut['buildObj'](_0x10b9a7,_0x5273('0x1b1')));_0x2fc771=_0x10f8cc[_0x5273('0x19a')];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];hopperUtils['createHistory'](_0x30fb0c)[_0x5273('0x9f')](loggerCatch(_0x5273('0x1b2')));if(_0x3c289f['checkRetriveMax'](0x5,_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0x11b')]>=_0x10f8cc['dialBusyMaxRetry']){_0x3c289f[_0x5273('0x124')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1b3'));}else{_0x3c289f[_0x5273('0x121')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1b3'));}}break;case'8':_0x10f8cc[_0x5273('0x1b4')]+=0x1;_0x30fb0c['state']=0x8;_0x30fb0c['statedesc']=_0x5273('0x1b5');_0x30fb0c['countcongestionretry']+=0x1;_0x30fb0c[_0x5273('0xe9')]+=0x1;_0x2fc771=_0x10f8cc[_0x5273('0x19c')];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];ami[_0x5273('0x119')](_0x5273('0x1b6'),ut[_0x5273('0x111')](_0x10b9a7,_0x5273('0x1b7')));hopperUtils['createHistory'](_0x30fb0c)[_0x5273('0x9f')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x3c289f[_0x5273('0x196')](0x8,_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0x11c')]>=_0x10f8cc[_0x5273('0x19b')]){_0x3c289f['createStateFinal'](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1b8'));}else{_0x3c289f[_0x5273('0x121')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1b8'));}}break;case'11':_0x10f8cc['outboundAbandonedCallsDay']+=0x1;_0x30fb0c[_0x5273('0x6b')]=0xb;_0x30fb0c[_0x5273('0x6c')]=_0x5273('0xee');_0x30fb0c['countabandonedretry']+=0x1;_0x30fb0c['countglobal']+=0x1;_0x2fc771=_0x10f8cc[_0x5273('0xea')];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];hopperUtils['createHistory'](_0x30fb0c)['catch'](loggerCatch(_0x5273('0x1b9')));if(_0x3c289f[_0x5273('0x196')](0xb,_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0xe8')]>=_0x10f8cc[_0x5273('0xeb')]){_0x3c289f['createStateFinal'](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1ba'));}else{_0x3c289f['stateGlobal'](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1ba'));}}break;case'20':_0x10f8cc[_0x5273('0x1bb')]+=0x1;_0x30fb0c[_0x5273('0x6b')]=0x14;_0x30fb0c['statedesc']='AgentReject';_0x30fb0c[_0x5273('0x11f')]+=0x1;_0x30fb0c[_0x5273('0xe9')]+=0x1;_0x2fc771=_0x10f8cc[_0x5273('0x1a3')];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];ami['emit'](_0x5273('0x1bc'),ut[_0x5273('0x111')](_0x10b9a7,_0x5273('0x1bd')));hopperUtils['createHistory'](_0x30fb0c)[_0x5273('0x9f')](loggerCatch(_0x5273('0x1be')));if(_0x3c289f[_0x5273('0x196')](0x14,_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0x11f')]>=_0x10f8cc[_0x5273('0x1a2')]){_0x3c289f['createStateFinal'](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1bf'));}else{_0x3c289f[_0x5273('0x121')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x5273('0x1bf'));}}break;default:_0x10f8cc['outboundUnknownCallsDay']+=0x1;_0x30fb0c[_0x5273('0x6b')]=0xc;_0x30fb0c[_0x5273('0x6c')]=_0x117c79['reason'];_0x2fc771=_0x10f8cc[_0x5273('0x1a3')];_0x3a1187=_0x10f8cc[_0x5273('0xd7')];hopperUtils['createHistory'](_0x30fb0c)[_0x5273('0x9f')](loggerCatch(_0x5273('0x1c0')));if(_0x3c289f[_0x5273('0x196')](_0x117c79[_0x5273('0xc5')],_0x10b9a7,_0x10f8cc)&&!_0x1f4fec){if(_0x30fb0c[_0x5273('0x11b')]+_0x30fb0c[_0x5273('0x11c')]+_0x30fb0c['countnoanswerretry']+_0x30fb0c[_0x5273('0x12a')]+_0x30fb0c[_0x5273('0xd5')]+_0x30fb0c['countabandonedretry']+_0x30fb0c[_0x5273('0x11e')]+_0x30fb0c[_0x5273('0x11f')]>=_0x10f8cc[_0x5273('0x120')]){_0x3c289f[_0x5273('0x121')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x117c79[_0x5273('0xc5')]);}else{_0x3c289f[_0x5273('0x124')](_0x30fb0c,_0x1793fe,_0x1ac4f5,_0x117c79[_0x5273('0xc5')]);}}}})['then'](function(){if(_0x1f4fec){hopperUtils[_0x5273('0xe6')](_0x30fb0c,_0x2fc771,_0x3a1187)[_0x5273('0x3d')](function(){return _0x1793fe(0x1);});}});});};Dialer[_0x5273('0x18')]['stateGlobal']=function(_0x536488,_0x1e7f8c,_0x509002,_0x691899){var _0x49d88e=new Final(_0x536488);_0x49d88e['state']=0xf;_0x49d88e[_0x5273('0x6c')]='Global';this['createStateFinal'](_0x49d88e,_0x1e7f8c,_0x509002,_0x691899);};Dialer[_0x5273('0x18')][_0x5273('0x124')]=function(_0x11ad89,_0xea9cc2,_0x33f234,_0x5db629){hopperUtils[_0x5273('0x12f')](_0x11ad89)['then'](function(){return _0xea9cc2(msgResponse(_0x5273('0x1a4'),_0x5273('0x104'),_0x5db629));})[_0x5273('0x9f')](function(){return _0x33f234(msgResponse('[moveContactManagedDialer][0]',_0x5273('0x8f'),'contact\x20not\x20moved'));});};Dialer[_0x5273('0x18')][_0x5273('0x7')]=function(_0x2331a8){var _0x272e46=_0x2331a8[_0x5273('0x1c1')]/0x64;var _0x23e0b5=_0x2331a8[_0x5273('0xcf')]/(_0x2331a8[_0x5273('0xcf')]+_0x2331a8['outboundAnswerCallsDay']);var _0x5486ae=Math[_0x5273('0x1c2')](_0x2331a8[_0x5273('0x1c3')]*(_0x2331a8[_0x5273('0x1c4')]/0x64));var _0x5c019e=Math[_0x5273('0x1c2')](_0x2331a8[_0x5273('0x1c3')]*(_0x2331a8[_0x5273('0x1c5')]/0x64));var _0x405981=_0x2331a8['available']+_0x2331a8['talking'];var _0x36a6a7=Math['floor'](_0x2331a8['erlangCalls']*_0x2331a8[_0x5273('0x5a')]*_0x2331a8[_0x5273('0x1c6')]*_0x2331a8[_0x5273('0x1c7')]);if(_[_0x5273('0x3e')](_0x2331a8[_0x5273('0x28')])){if(!_[_0x5273('0x3e')](_0x2331a8[_0x5273('0x27')])){_0x2331a8[_0x5273('0x27')]=undefined;loggerPredictive[_0x5273('0x62')](_0x5273('0x1c8'),_0x5273('0x1c9'));}if(!_[_0x5273('0x3e')](_0x2331a8[_0x5273('0x61')])){loggerPredictive[_0x5273('0x62')](_0x5273('0x1c8'),_0x5273('0x1ca'));clearInterval(_0x2331a8[_0x5273('0x61')]);_0x2331a8[_0x5273('0x61')]=undefined;}_0x2331a8[_0x5273('0x28')]=moment()[_0x5273('0x43')](_0x5273('0xc3'));loggerPredictive[_0x5273('0x49')](_0x2331a8[_0x5273('0x45')],_0x5273('0x1cb'),_0x2331a8[_0x5273('0x28')]);this[_0x5273('0xaf')](_0x2331a8,0x1);}else if(ifInterval(_0x2331a8[_0x5273('0x1cc')],_0x2331a8[_0x5273('0x28')])){this[_0x5273('0xaf')](_0x2331a8,0x1);loggerPredictiveCalls['info'](_0x5273('0x1cd'),_0x2331a8[_0x5273('0x28')],_0x2331a8['name']);_0x2331a8['erlangCalls']=0x0;_0x2331a8['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x272e46<_0x23e0b5&&_0x2331a8['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x2331a8);loggerPredictive[_0x5273('0x49')](_0x5273('0x1ce'),_0x5273('0x1cf'),_0x23e0b5,'startProgressive',_0x2331a8['name']);}else if(_0x36a6a7<_0x2331a8[_0x5273('0xd0')]&&_0x2331a8[_0x5273('0x1d0')]===_0x5273('0x1d1')){clearPredictiveAttributes(_0x2331a8);loggerPredictive[_0x5273('0x49')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5273('0x1d2'),_0x36a6a7,_0x5273('0x1d3'),_0x2331a8[_0x5273('0xd0')],'startProgressive',_0x2331a8[_0x5273('0x45')]);}else if(!ifInterval(_0x2331a8[_0x5273('0x1cc')],_0x2331a8[_0x5273('0x28')])&&_[_0x5273('0x3e')](_0x2331a8[_0x5273('0x27')])&&!_[_0x5273('0x3e')](_0x2331a8['startProgressive'])){_0x2331a8['startPredictive']=moment()[_0x5273('0x43')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2331a8[_0x5273('0x45')],'started\x20in\x20predictive\x20at',_0x2331a8[_0x5273('0x27')]);hopperUtils[_0x5273('0x1d4')](_0x2331a8['dialPredictiveInterval'])[_0x5273('0x3d')](this[_0x5273('0x1d5')](_0x2331a8))['then'](mergeDataErlangB(_0x2331a8))[_0x5273('0x3d')](this['startMethodPredictive'](_0x2331a8))[_0x5273('0x9f')](loggerCatchPredictive(_0x5273('0x1d6'),_0x2331a8));}else if(!ifInterval(_0x2331a8[_0x5273('0x1cc')],_0x2331a8[_0x5273('0x27')])){_0x2331a8[_0x5273('0xd0')]=0x0;_0x2331a8['startPredictive']=moment()['format'](_0x5273('0xc3'));loggerPredictive['info'](_0x2331a8[_0x5273('0x45')],_0x5273('0x1d7'),_0x2331a8['startPredictive']);clearInterval(_0x2331a8['handlePredictive']);_0x2331a8['handlePredictive']=undefined;hopperUtils[_0x5273('0x1d4')](_0x2331a8[_0x5273('0x1cc')])[_0x5273('0x3d')](this['getDataPredictive'](_0x2331a8))['then'](mergeDataErlangB(_0x2331a8))[_0x5273('0x3d')](this['startMethodPredictive'](_0x2331a8))[_0x5273('0x9f')](loggerCatchPredictive(_0x5273('0x1d8'),_0x2331a8));}else if(_0x2331a8['predictiveIntervalAvailable']&&_0x405981<_0x2331a8['predictiveIntervalAvailable']-_0x5c019e){clearPredictiveAttributes(_0x2331a8);loggerPredictive[_0x5273('0x49')](_0x2331a8['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x405981,_0x5273('0x1d9'),_0x2331a8[_0x5273('0x1c3')],'-',_0x5c019e,'=',_0x2331a8[_0x5273('0x1c3')]-_0x5c019e,')');}else if(_0x2331a8[_0x5273('0x1c3')]&&_0x405981>_0x2331a8[_0x5273('0x1c3')]+_0x5486ae){clearPredictiveAttributes(_0x2331a8);loggerPredictive[_0x5273('0x49')](_0x2331a8['name'],_0x5273('0x1da'),_0x405981,')\x20are\x20more\x20than\x20threshold\x20(',_0x2331a8['predictiveIntervalAvailable'],'+',_0x5486ae,'=',_0x2331a8[_0x5273('0x1c3')]+_0x5486ae,')');}};Dialer[_0x5273('0x18')][_0x5273('0x1d5')]=function(_0xcbca91){var _0x39cd47=this;return function(_0x75a3a7){return new Promise(function(_0x33bafe,_0x3d1161){_['merge'](_0xcbca91,_0x75a3a7[0x0]);if(checkGetDataPredictive(_0x75a3a7[0x0])){var _0x2bd015=_0xcbca91[_0x5273('0x1c3')]=_0xcbca91[_0x5273('0x13a')]+_0xcbca91[_0x5273('0x138')];var _0x2e412b=_0xcbca91[_0x5273('0x1cc')]*0x3c;var _0x92a9e7=_0x75a3a7[0x0]['predictiveIntervalAvgTalktime']+_0x75a3a7[0x0][_0x5273('0x4d')];var _0x432e85=(_0x75a3a7[0x0][_0x5273('0x4a')]+_0x75a3a7[0x0][_0x5273('0x4c')]+_0x75a3a7[0x0][_0x5273('0xe7')])/_0x75a3a7[0x0][_0x5273('0x51')];_0xcbca91[_0x5273('0x1c6')]=_0x432e85>0x0?_0x432e85:0x1;switch(_0xcbca91[_0x5273('0x1d0')]){case _0x5273('0x1d1'):var _0x332b35=_0xcbca91[_0x5273('0x1c1')]/0x64;return _0x39cd47[_0x5273('0x1db')](_0x2bd015,_0x2e412b,_0x92a9e7,_0x432e85,_0x332b35)[_0x5273('0x3d')](function(_0x31cd71){return _0x33bafe(_0x31cd71);});case'agentBusyFactor':var _0x4b577f=_0xcbca91[_0x5273('0x1c1')]/0x64;return _0x39cd47[_0x5273('0x1dc')](_0x2bd015,_0x2e412b,_0x92a9e7,_0x432e85,_0x4b577f)[_0x5273('0x3d')](function(_0x5d464f){return _0x33bafe(_0x5d464f);});default:return _0x3d1161(msgResponse('[getDataPredictive]',_0x5273('0x8f'),_0x5273('0x1dd')));}}else{return _0x3d1161(msgResponse(_0x5273('0x1de'),_0x5273('0x8f'),_0x5273('0x1df')));}});};};Dialer[_0x5273('0x18')]['getDataPredictiveOld']=function(_0x3dfb56){var _0x334040=this;return function(_0x54d5b2){return new Promise(function(_0x246879,_0x5d2fa1){_[_0x5273('0x5e')](_0x3dfb56,_0x54d5b2[0x0]);if(checkGetDataPredictive(_0x54d5b2[0x0])){loggerPredictive[_0x5273('0x49')](JSON[_0x5273('0x81')](_0x54d5b2[0x0]));if(_0x3dfb56['dialPredictiveOptimization']===_0x5273('0x1d1')){return _0x334040[_0x5273('0x14d')](_0x3dfb56['id'])[_0x5273('0x3d')](function(_0x2fcec7){var _0x5e4441=_0x3dfb56['loggedIn']-_0x2fcec7[0x0]['outboundQueuePauses'];var _0x3c625b=_0x3dfb56[_0x5273('0x1cc')]*0x3c;var _0x12e847=_0x54d5b2[0x0][_0x5273('0x4f')]+_0x54d5b2[0x0][_0x5273('0x4d')];var _0x47bd21=(_0x54d5b2[0x0]['predictiveIntervalAnsweredCalls']+_0x54d5b2[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x54d5b2[0x0][_0x5273('0xe7')])/_0x54d5b2[0x0]['predictiveIntervalTotalCalls'];var _0x4c29ba=_0x3dfb56[_0x5273('0x1c1')]/0x64;_0x3dfb56['predictiveIntervalPauses']=_0x2fcec7[0x0][_0x5273('0x1e0')]||0x0;_0x3dfb56[_0x5273('0x1c6')]=_0x47bd21>0x0?_0x47bd21:0x1;return _0x334040['abandonmentRate'](_0x5e4441,_0x3c625b,_0x12e847,_0x47bd21,_0x4c29ba);})[_0x5273('0x3d')](function(_0x37cbba){return _0x246879(_0x37cbba);})[_0x5273('0x9f')](function(_0x36b29c){return _0x5d2fa1(msgResponse(_0x5273('0x1e1'),_0x5273('0x8f'),JSON['stringify'](_0x36b29c)));});}if(_0x3dfb56[_0x5273('0x1d0')]==='agentBusyFactor'){return _0x334040[_0x5273('0x14d')](_0x3dfb56['id'])[_0x5273('0x3d')](function(_0x2948bb){var _0x1504ea=_0x3dfb56[_0x5273('0x1e2')]-_0x2948bb[0x0][_0x5273('0x1e0')];var _0x43fd16=_0x3dfb56[_0x5273('0x1cc')]*0x3c;var _0x51fd9a=_0x54d5b2[0x0][_0x5273('0x4f')]+_0x54d5b2[0x0]['predictiveIntervalAvgHoldtime'];var _0x5bc205=(_0x54d5b2[0x0]['predictiveIntervalAnsweredCalls']+_0x54d5b2[0x0][_0x5273('0x4c')]+_0x54d5b2[0x0][_0x5273('0xe7')])/_0x54d5b2[0x0][_0x5273('0x51')];var _0x4cb995=_0x3dfb56[_0x5273('0x1c1')]/0x64;_0x3dfb56[_0x5273('0x1e3')]=_0x2948bb[0x0]['outboundQueuePauses']||0x0;_0x3dfb56[_0x5273('0x1c6')]=_0x5bc205>0x0?_0x5bc205:0x1;return _0x334040[_0x5273('0x1dc')](_0x1504ea,_0x43fd16,_0x51fd9a,_0x5bc205,_0x4cb995);})['then'](function(_0x4f8994){return _0x246879(_0x4f8994);})['catch'](function(_0xc21595){return _0x5d2fa1(msgResponse(_0x5273('0x1e1'),_0x5273('0x8f'),JSON[_0x5273('0x81')](_0xc21595)));});}}else{return _0x5d2fa1(msgResponse(_0x5273('0x1de'),_0x5273('0x8f'),_0x5273('0x1df')));}});};};Dialer['prototype'][_0x5273('0x1e4')]=function(_0x353694){var _0xe14e53=this;return function(){var _0x241629=0x0;var _0x5de902=Math[_0x5273('0x1e5')](_0x353694[_0x5273('0x59')]*0x3e8);if(_0x5de902>0x0){_0x5de902=_0x5de902<0x64?0x64:_0x5de902;loggerPredictive[_0x5273('0x49')](_0x353694['name'],_0x5273('0x1e6'),_0x5de902,_0x5273('0x1e7'));_0x353694['handlePredictive']=setInterval(function(){_0xe14e53[_0x5273('0x61')](_0x353694);loggerPredictiveCalls[_0x5273('0x49')](_0x5273('0x1e8'),_0x241629+=0x1);},_0x5de902);}else{loggerPredictive[_0x5273('0x49')](_0x353694[_0x5273('0x45')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x5273('0x18')][_0x5273('0x1e9')]=function(_0x93ebc6,_0x49e307){var _0x292e6d=this;return function(_0x2244b0){if(_[_0x5273('0x47')](_0x2244b0)){if(_['isNil'](_0x49e307[_0x5273('0x1ea')])||!_0x49e307[_0x5273('0x1eb')]){if(_0x93ebc6['dialMethod']===_0x5273('0xb2')){_0x93ebc6[_0x5273('0x6e')]=_[_0x5273('0x3e')](_0x93ebc6[_0x5273('0x6e')])?!![]:_0x93ebc6[_0x5273('0x6e')];var _0x8f2a76=uuid['v4']();_0x292e6d[_0x5273('0x24')][_0x8f2a76]=new Action(_0x93ebc6,_0x49e307,_0x8f2a76);loggerBooked[_0x5273('0x49')](_0x5273('0x1ec'),_0x8f2a76,_0x5273('0x1ed'),JSON[_0x5273('0x81')](_0x93ebc6[_0x5273('0x6e')]),_0x5273('0x1ee'),_0x93ebc6[_0x5273('0x45')]);if(_0x93ebc6[_0x5273('0x6e')]){_0x93ebc6[_0x5273('0x6e')]=![];_0x292e6d['queueBooked'][_0x292e6d[_0x5273('0x24')][_0x8f2a76]['queue']]=[];ami['Action']({'actionid':_0x8f2a76,'action':_0x5273('0x1ef'),'queue':_0x93ebc6['name']})[_0x5273('0x9f')](function(){_0x292e6d['updateOriginated'](_0x93ebc6);hopperUtils[_0x5273('0xdb')]({'active':![],'ContactId':_0x292e6d[_0x5273('0x24')][_0x8f2a76]['ContactId'],'ListId':_0x292e6d[_0x5273('0x24')][_0x8f2a76][_0x5273('0xdf')],'VoiceQueueId':_0x292e6d['actions'][_0x8f2a76][_0x5273('0xec')]||undefined,'CampaignId':_0x292e6d['actions'][_0x8f2a76][_0x5273('0xe0')]||undefined})['catch'](loggerCatch(_0x5273('0x1f0')));delete _0x292e6d[_0x5273('0x24')][_0x8f2a76];});}else{loggerBooked['info'](_0x5273('0x1f1'),JSON[_0x5273('0x81')](_0x93ebc6['queueStatusComplete']),_0x5273('0x1ee'),_0x93ebc6[_0x5273('0x45')]);_0x292e6d[_0x5273('0xc1')](_0x93ebc6);hopperUtils[_0x5273('0xdb')]({'active':![],'ContactId':_0x292e6d[_0x5273('0x24')][_0x8f2a76][_0x5273('0xde')],'ListId':_0x292e6d['actions'][_0x8f2a76][_0x5273('0xdf')],'VoiceQueueId':_0x292e6d[_0x5273('0x24')][_0x8f2a76][_0x5273('0xec')]||undefined,'CampaignId':_0x292e6d[_0x5273('0x24')][_0x8f2a76][_0x5273('0xe0')]||undefined})['catch'](loggerCatch(_0x5273('0x1f0')));delete _0x292e6d[_0x5273('0x24')][_0x8f2a76];}}else{return _0x292e6d[_0x5273('0x159')](_0x93ebc6,_0x49e307);}}else{if(utils[_0x5273('0x5f')](undefined,_0x49e307[_0x5273('0x1f2')])<_0x93ebc6[_0x5273('0x1f3')]*0x3c){if(_0x49e307[_0x5273('0x156')]&&!_0x49e307['Agent'][_0x5273('0x1f4')]){_0x292e6d['preview'][_0x5273('0x1f5')](_0x49e307['id'])['finally'](function(){_0x292e6d['updateOriginated'](_0x93ebc6);});}else{hopperUtils[_0x5273('0x1f6')]({'active':![]},_0x49e307['id'],0x1)[_0x5273('0x1b')](function(){_0x292e6d[_0x5273('0xc1')](_0x93ebc6);});}}else{_0x93ebc6[_0x5273('0x1f7')]+=0x1;_0x292e6d['updateOriginated'](_0x93ebc6);if(_0x93ebc6['dialRecallInQueue']){hopperUtils[_0x5273('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x49e307['ContactId'],'ListId':_0x49e307[_0x5273('0xdf')],'VoiceQueueId':_0x49e307[_0x5273('0xec')]||undefined,'CampaignId':_0x49e307[_0x5273('0xe0')]||undefined})[_0x5273('0x9f')](loggerCatch(_0x5273('0x1f8')));hopperUtils[_0x5273('0xe4')](createObjHistory(_0x93ebc6,_0x49e307,utils[_0x5273('0x65')][_0x5273('0x1f9')],0x17,_0x5273('0x1fa')))[_0x5273('0x9f')](loggerCatch(_0x5273('0x1fb')));}else{_0x292e6d['saveInDb'](createObjHistory(_0x93ebc6,_0x49e307,utils[_0x5273('0x65')][_0x5273('0x1fc')],0x16,_0x5273('0x1fd')),_0x5273('0x1fe'),_0x5273('0x1ff'));}}}}else{_0x93ebc6[_0x5273('0x200')]+=0x1;_0x292e6d[_0x5273('0x113')](createObjHistory(_0x93ebc6,_0x49e307,utils[_0x5273('0x65')][_0x5273('0x201')],0xd,_0x5273('0x202')),_0x5273('0x203'),_0x5273('0x204'));throw'inBlackList';}};};Dialer[_0x5273('0x18')][_0x5273('0x158')]=function(_0xc1473a){var _0x557915=this;var _0x1549c6=_0xc1473a[_0x5273('0x205')]-_0xc1473a[_0x5273('0x14f')]-_0xc1473a[_0x5273('0x206')];emitCampaignSummary(_0xc1473a);if(_0x1549c6>0x0){if(_0x1549c6>this['maxNumberOriginate']){_0x1549c6=this[_0x5273('0x22')];}_0xc1473a[_0x5273('0x206')]+=_0x1549c6;hopperUtils['getContactDialerIvr'](_0xc1473a['id'],_0x1549c6,_0xc1473a[_0x5273('0x207')],_0xc1473a)[_0x5273('0x3d')](function(_0x2ae01d){_0xc1473a[_0x5273('0x206')]-=_0x1549c6;_0xc1473a[_0x5273('0x206')]=_0xc1473a[_0x5273('0x206')]>0x0?_0xc1473a[_0x5273('0x206')]:0x0;if(!utils['checkContactEmpty'](_0x2ae01d)){_0xc1473a[_0x5273('0x68')]=utils[_0x5273('0x65')]['NO_AVAILABLE_CONTACTS'];logger[_0x5273('0x49')](_0x5273('0x208')+_0xc1473a[_0x5273('0x45')]);}else{_0xc1473a[_0x5273('0x14f')]+=_0x2ae01d['length'];_0xc1473a[_0x5273('0x68')]=utils[_0x5273('0x65')]['RUNNING'];for(var _0x3603a3=0x0;_0x3603a3<_0x2ae01d['length'];_0x3603a3+=0x1){_0xc1473a[_0x5273('0x209')]+=0x1;if(_[_0x5273('0xf2')](_0x2ae01d[_0x3603a3])||_['isNil'](_0x2ae01d[_0x3603a3][_0x5273('0x179')])||_[_0x5273('0xf2')](_0x2ae01d[_0x3603a3][_0x5273('0x15c')])){_0x557915[_0x5273('0x20a')]('[actionOriginate]\x20',_0xc1473a,_0x2ae01d[_0x3603a3]);}else{hopperUtils[_0x5273('0x20b')](_['pick'](_0x2ae01d[_0x3603a3],[_0x5273('0xe0'),_0x5273('0x15c')]))[_0x5273('0x3d')](_0x557915[_0x5273('0x1e9')](_0xc1473a,_0x2ae01d[_0x3603a3]))[_0x5273('0x9f')](_0x557915[_0x5273('0x151')](_0x5273('0x20c'),_0xc1473a));}}}})[_0x5273('0x9f')](loggerGetContactDialer('[getContactCampaign2]',_0xc1473a,_0x1549c6));}};Dialer[_0x5273('0x18')][_0x5273('0xaf')]=function(_0x4d95c5,_0x34f1f2){var _0x4f9827=this;var _0x5190eb=[];if(_0x34f1f2<0x1||_0x4d95c5[_0x5273('0xad')]===_0x5273('0xb2')){_0x34f1f2=0x1;}var _0xea269f=Math[_0x5273('0x1e5')](_0x4d95c5['available']*_0x34f1f2)-_0x4d95c5[_0x5273('0x14f')]-_0x4d95c5[_0x5273('0x206')];if(_0x4d95c5['dialLimitQueue']>0x0){var _0x1b0d4b=_0x4d95c5[_0x5273('0x20d')]-_0x4d95c5['originated']-_0x4d95c5[_0x5273('0x13a')]-_0x4d95c5['temp']-_0x4d95c5[_0x5273('0x13b')];if(_0xea269f>_0x1b0d4b){_0xea269f=_0x1b0d4b;}}if(_0xea269f>0x0){if(_0x4d95c5[_0x5273('0xad')]==='booked'){_0xea269f=0x1;}if(_0xea269f>this[_0x5273('0x22')]){_0xea269f=this[_0x5273('0x22')];}_0x4d95c5['temp']+=_0xea269f;for(var _0x5b939f in this[_0x5273('0x20')]){if(typeof this['agents'][_0x5b939f]!==_0x5273('0x17a')){if(this['agents'][_0x5b939f][_0x5273('0x6b')]===_0x5273('0x20e')&&this['agents'][_0x5b939f][_0x5273('0x85')]===_0x5273('0x86')){_0x5190eb[_0x5273('0x96')](this[_0x5273('0x20')][_0x5b939f]['id']);}}}hopperUtils[_0x5273('0x20f')](_0x4d95c5,_0x5190eb,_0xea269f)['then'](function(_0x24048f){_0x4d95c5['temp']-=_0xea269f;_0x4d95c5[_0x5273('0x206')]=_0x4d95c5['temp']>0x0?_0x4d95c5[_0x5273('0x206')]:0x0;if(!utils[_0x5273('0x210')](_0x24048f)){hopperUtils[_0x5273('0x211')](_0x4d95c5)[_0x5273('0x3d')](sendMessageReschedule(_0x4d95c5))[_0x5273('0x9f')](loggerCatch(_0x5273('0x212')));}else{_0x4d95c5[_0x5273('0x14f')]+=_0x24048f[_0x5273('0x95')];_0x4d95c5[_0x5273('0x68')]=_0x4d95c5[_0x5273('0xad')]==='booked'?utils[_0x5273('0x65')]['ACTIVE']:utils[_0x5273('0x65')][_0x5273('0x213')];for(var _0x3ac17c=0x0;_0x3ac17c<_0x24048f['length'];_0x3ac17c+=0x1){if(_['isNil'](_0x24048f[_0x3ac17c])||_['isNil'](_0x24048f[_0x3ac17c][_0x5273('0x179')])||_[_0x5273('0xf2')](_0x24048f[_0x3ac17c][_0x5273('0x15c')])){_0x4f9827[_0x5273('0x20a')]('[actionOriginate]\x20',_0x4d95c5,_0x24048f[_0x3ac17c]);}else{hopperUtils[_0x5273('0x214')](_[_0x5273('0x70')](_0x24048f[_0x3ac17c],['VoiceQueueId',_0x5273('0x15c')]))[_0x5273('0x3d')](_0x4f9827[_0x5273('0x1e9')](_0x4d95c5,_0x24048f[_0x3ac17c]))[_0x5273('0x9f')](_0x4f9827[_0x5273('0x151')](_0x5273('0x215'),_0x4d95c5));}}}})[_0x5273('0x9f')](loggerGetContactDialer(_0x5273('0x216'),_0x4d95c5,_0xea269f));}};Dialer[_0x5273('0x18')][_0x5273('0x61')]=function(_0xa4c722){if(_0xa4c722[_0x5273('0x20d')]>0x0){var _0x38cb02=_0xa4c722[_0x5273('0x20d')]-_0xa4c722[_0x5273('0x14f')]-_0xa4c722['talking'];if(_0x38cb02>0x0){this[_0x5273('0x217')](_0xa4c722);}else{loggerPredictiveCalls[_0x5273('0x49')](_0x5273('0x218'));}}else{this[_0x5273('0x217')](_0xa4c722);}};Dialer[_0x5273('0x18')][_0x5273('0x217')]=function(_0x4f6704){var _0x26dc7a=this;var _0x3dfb0d=[];_0x4f6704['originated']+=0x1;for(var _0x157ec1 in this[_0x5273('0x20')]){if(typeof this['agents'][_0x157ec1]!==_0x5273('0x17a')){if(this[_0x5273('0x20')][_0x157ec1]['state']===_0x5273('0x20e')&&this[_0x5273('0x20')][_0x157ec1][_0x5273('0x85')]===_0x5273('0x86')){_0x3dfb0d['push'](this[_0x5273('0x20')][_0x157ec1]['id']);}}}return this['getContactDialer'](_0x4f6704['id'],_0x3dfb0d,0x1,_0x4f6704[_0x5273('0x207')],_0x4f6704)[_0x5273('0x3d')](function(_0x18bfde){if(!utils[_0x5273('0x210')](_0x18bfde)){utils[_0x5273('0x219')](_0x4f6704,0x1,0x0);return hopperUtils[_0x5273('0x211')](_0x4f6704)['then'](sendMessageReschedule(_0x4f6704))[_0x5273('0x9f')](loggerCatch('[countReScheduled]\x20'));}else{_0x4f6704[_0x5273('0x68')]=utils[_0x5273('0x65')][_0x5273('0x213')];if(_['isNil'](_0x18bfde[0x0])||_[_0x5273('0xf2')](_0x18bfde[0x0][_0x5273('0x179')])||_['isNil'](_0x18bfde[0x0][_0x5273('0x15c')])){_0x26dc7a['emptyContact'](_0x5273('0x215'),_0x4f6704,_0x18bfde[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x5273('0x70')](_0x18bfde[0x0],[_0x5273('0xec'),_0x5273('0x15c')]))[_0x5273('0x3d')](_0x26dc7a[_0x5273('0x1e9')](_0x4f6704,_0x18bfde[0x0]))[_0x5273('0x9f')](_0x26dc7a['loggerHandler'](_0x5273('0x21a'),_0x4f6704));}}})[_0x5273('0x9f')](loggerGetContactDialer(_0x5273('0x21b'),_0x4f6704,0x1));};Dialer[_0x5273('0x18')][_0x5273('0x1db')]=function(_0x162d7b,_0x28acc5,_0x36316c,_0x3caa67,_0x4d87b0,_0x194140){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x5273('0x49')]('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',_0x162d7b);loggerPredictive[_0x5273('0x49')](_0x5273('0x21c'),_0x28acc5);loggerPredictive[_0x5273('0x49')]('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',_0x36316c);loggerPredictive[_0x5273('0x49')](_0x5273('0x21d'),_0x3caa67);loggerPredictive[_0x5273('0x49')](_0x5273('0x21e'),_0x4d87b0);loggerPredictive[_0x5273('0x49')](_0x5273('0x50'));return new Promise(function(_0x26bc1d,_0x5a2486){if(_0x162d7b<=0x0||isNaN(_0x162d7b)){return _0x5a2486(msgResponse('[abandonmentRate]',_0x5273('0x80'),_0x5273('0x21f')+_0x162d7b));}if(_0x36316c<=0x0||isNaN(_0x36316c)){return _0x5a2486(msgResponse(_0x5273('0x220'),_0x5273('0x80'),'Ts\x20=\x20'+_0x36316c));}if(_0x3caa67<=0x0||isNaN(_0x3caa67)){return _0x5a2486(msgResponse(_0x5273('0x220'),_0x5273('0x80'),'p\x20=\x20'+_0x3caa67));}if(_0x28acc5<=0x0||isNaN(_0x28acc5)){return _0x5a2486(msgResponse(_0x5273('0x220'),_0x5273('0x80'),_0x5273('0x221')+_0x28acc5));}if(_0x4d87b0<=0x0||isNaN(_0x4d87b0)){return _0x5a2486(msgResponse('[abandonmentRate]',_0x5273('0x80'),'Amax\x20=\x20'+_0x4d87b0));}_0x194140=_0x194140||0x0;var _0x935a6c=0x1/_0x36316c;var _0xdbda4e=0x0;var _0x310fa6=0x0;var _0x1e8b14=0x0;var _0x48de93=0x0;for(var _0x253717=0x0;_0x1e8b14<_0x4d87b0;_0x253717+=0x1){_0x310fa6=_0x253717/_0x28acc5;_0xdbda4e=(_0x3caa67*_0x310fa6+_0x194140)/_0x935a6c;_0x1e8b14=utils['erlangb'](_0xdbda4e,_0x162d7b);_0x48de93=_0xdbda4e/_0x162d7b*(0x1-utils[_0x5273('0x222')](_0xdbda4e,_0x162d7b));}return _0x26bc1d({'erlangCalls':_0x253717,'erlangCallToSecond':_0x28acc5/_0x253717,'erlangAbandonmentRate':_0x1e8b14,'erlangBusyFactor':_0x48de93});});};Dialer[_0x5273('0x18')][_0x5273('0x1dc')]=function(_0x4379ee,_0x1ee1b8,_0x30a89a,_0x4d11de,_0x5a1f1f,_0x727e18){loggerPredictive['info'](_0x5273('0x223'));loggerPredictive[_0x5273('0x49')]('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',_0x4379ee);loggerPredictive['info'](_0x5273('0x21c'),_0x1ee1b8);loggerPredictive[_0x5273('0x49')]('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',_0x30a89a);loggerPredictive[_0x5273('0x49')](_0x5273('0x21d'),_0x4d11de);loggerPredictive[_0x5273('0x49')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a1f1f);loggerPredictive[_0x5273('0x49')](_0x5273('0x50'));return new Promise(function(_0x22a644,_0x146d7a){if(_0x4379ee<=0x0||isNaN(_0x4379ee)){return _0x146d7a(msgResponse(_0x5273('0x224'),_0x5273('0x80'),_0x5273('0x21f')+_0x4379ee));}if(_0x30a89a<=0x0||isNaN(_0x30a89a)){return _0x146d7a(msgResponse(_0x5273('0x224'),_0x5273('0x80'),_0x5273('0x225')+_0x30a89a));}if(_0x4d11de<=0x0||isNaN(_0x4d11de)){return _0x146d7a(msgResponse('[busyFactor]',_0x5273('0x80'),_0x5273('0x226')+_0x4d11de));}if(_0x1ee1b8<=0x0||isNaN(_0x1ee1b8)){return _0x146d7a(msgResponse(_0x5273('0x224'),_0x5273('0x80'),'interval\x20=\x20'+_0x1ee1b8));}if(_0x5a1f1f<=0x0||isNaN(_0x5a1f1f)){return _0x146d7a(msgResponse(_0x5273('0x224'),_0x5273('0x80'),_0x5273('0x227')+_0x5a1f1f));}_0x727e18=_0x727e18||0x0;var _0x1237c8=0x1/_0x30a89a;var _0x1677f7=0x0;var _0x22de26=0x0;var _0x5ec4ec=0x0;var _0x7d5539=0x0;for(var _0x34e97d=0x0;_0x7d5539<_0x5a1f1f;_0x34e97d+=0x1){_0x22de26=_0x34e97d/_0x1ee1b8;_0x1677f7=(_0x4d11de*_0x22de26+_0x727e18)/_0x1237c8;_0x5ec4ec=utils[_0x5273('0x222')](_0x1677f7,_0x4379ee);_0x7d5539=_0x1677f7/_0x4379ee*(0x1-utils[_0x5273('0x222')](_0x1677f7,_0x4379ee));}return _0x22a644({'erlangCalls':_0x34e97d,'erlangCallToSecond':_0x1ee1b8/_0x34e97d,'erlangAbandonmentRate':_0x5ec4ec,'erlangBusyFactor':_0x7d5539});});};module[_0x5273('0x228')]=Dialer; \ No newline at end of file +var _0xf03a=['unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','command','interval','content','indexOf','true','catch','iftime\x20%s,%s','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','dialTimezone','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','syncAgentComplete','outboundAnswerCallsDay','reason','agent','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','starttime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','rrmemory','actionid','isNil','locked','paused','stateinterface','pick','idHopper','syncQueueStatusComplete','strategy','roundrobin','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','exten','xcally-motion-dialer','value','HangupInAMD','membername','AMD','buildObj','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','amd','emit','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','custom:amd','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countnoanswerretry','reason19\x20machine....','[rescheduleContact][Machine]','ivrAnswerCallsDay','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','inUse','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','enqueue','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','actionOriginate','object','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','phone','variables','Action','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','predictiveIntervalHitRate','abandonmentRate','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','checkIsBlackList','loggerHandler','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','queuemember','queuestatuscomplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','type','outbound','debug','inspect','voice:queue:%s','name','voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','merge','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','[booked][unlockQueueStatus]','stringify','queueStatusComplete','NULL_INTERVAL','Interval','Intervals','isEmpty','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','format','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable'];(function(_0x2f1a6e,_0x3082cb){var _0x5865e5=function(_0x459f1a){while(--_0x459f1a){_0x2f1a6e['push'](_0x2f1a6e['shift']());}};_0x5865e5(++_0x3082cb);}(_0xf03a,0x198));var _0xaf03=function(_0x8762a0,_0x3b4a18){_0x8762a0=_0x8762a0-0x0;var _0xc68f49=_0xf03a[_0x8762a0];return _0xc68f49;};'use strict';var util=require('util');var _=require(_0xaf03('0x0'));var uuid=require('uuid');var moment=require(_0xaf03('0x1'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xaf03('0x2'));var hopperUtils=require(_0xaf03('0x3'));var ut=require(_0xaf03('0x4'));var config=require(_0xaf03('0x5'));var logger=require(_0xaf03('0x6'))(_0xaf03('0x7'));var loggerBooked=require('../../../config/logger')(_0xaf03('0x8'));var loggerPredictive=require('../../../config/logger')(_0xaf03('0x9'));var loggerPredictiveCalls=require(_0xaf03('0x6'))(_0xaf03('0xa'));var loggerSyncQueueSummary=require(_0xaf03('0x6'))(_0xaf03('0xb'));var ami=require(_0xaf03('0xc'));config[_0xaf03('0xd')]=_['defaults'](config[_0xaf03('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xaf03('0xe'))(new Redis(config[_0xaf03('0xd')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xaf03('0xf'));var RpcSetting=require(_0xaf03('0x10'));var Interval=require('../rpc/interval');var Action=require(_0xaf03('0x11'));var History=require(_0xaf03('0x12'));var Final=require(_0xaf03('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xaf03('0x14'));var Hangup=require('./models/hangup');var ipAgi=process[_0xaf03('0x15')][_0xaf03('0x16')]||_0xaf03('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xaf03('0x18')]['enqueue']=function(_0x19ca75){this[_0xaf03('0x19')]=this[_0xaf03('0x19')]?this[_0xaf03('0x19')][_0xaf03('0x1a')](_0x19ca75):_0x19ca75();};function Dialer(_0x438e2b,_0x28eed0){this[_0xaf03('0x1b')]=new Sequence();this['preview']=_0x28eed0;this[_0xaf03('0x1c')]=_0x438e2b['voiceQueues'];this[_0xaf03('0x1d')]=_0x438e2b[_0xaf03('0x1d')];this[_0xaf03('0x1e')]=_0x438e2b[_0xaf03('0x1e')];this[_0xaf03('0x1f')]=_0x438e2b[_0xaf03('0x1f')];this[_0xaf03('0x20')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0xaf03('0x21')]={};this[_0xaf03('0x22')]={};this[_0xaf03('0x23')]={};this['optionPredictive']={};this[_0xaf03('0x24')]={};this[_0xaf03('0x25')]={};this[_0xaf03('0x26')]={};this[_0xaf03('0x27')]={};this[_0xaf03('0x28')]={};this[_0xaf03('0x29')]={};ami['on'](_0xaf03('0x2a'),this['syncAgentConnect'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x2c'),this[_0xaf03('0x2d')][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x2e'),this[_0xaf03('0x2f')]['bind'](this));ami['on'](_0xaf03('0x30'),this['syncAgentComplete'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x31'),this[_0xaf03('0xb')][_0xaf03('0x2b')](this));ami['on']('custom:queuesummarycomplete',this[_0xaf03('0x32')][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x33'),this[_0xaf03('0x34')]['bind'](this));ami['on'](_0xaf03('0x35'),this['syncNewExten'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x36'),this['syncVarSet'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x37'),this['syncQueueMember'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x38'),this['syncQueueStatusComplete'][_0xaf03('0x2b')](this));this['loopCampaigns']();this[_0xaf03('0x39')]();RpcSetting[_0xaf03('0x3a')]()[_0xaf03('0x3b')](function(_0x28d80e){previewRecallmeReminderInterval=_0x28d80e[_0xaf03('0x3c')];});}function isNotNull(_0x1431f4){return _0x1431f4!==null&&!_['isUndefined'](_0x1431f4);}function msgResponse(_0x194aae,_0x2431df,_0x212f8e){return{'action':_0x194aae,'response':_0x2431df,'message':_0x212f8e,'stack':_0x212f8e};}function emit(_0x3e03bc,_0x3cf27b,_0x314108){io['to'](_0x3e03bc)['emit'](_0x3cf27b,_0x314108);}function emitOutboundVoiceQueueSummary(_0x3c8c90){if(_0x3c8c90[_0xaf03('0x3d')]===_0xaf03('0x3e')){logger[_0xaf03('0x3f')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xaf03('0x40')](_0x3c8c90,{'showHidden':![],'depth':null}));emit(util['format'](_0xaf03('0x41'),_0x3c8c90[_0xaf03('0x42')]),_0xaf03('0x43'),_0x3c8c90);}}function checkGetDataPredictive(_0x41b7f2){if(isNotNull(_0x41b7f2)&&!_['isEmpty'](_0x41b7f2)){loggerPredictive['info'](_0xaf03('0x44'));loggerPredictive[_0xaf03('0x45')](_0xaf03('0x46'),_0x41b7f2[_0xaf03('0x47')]);loggerPredictive[_0xaf03('0x45')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41b7f2[_0xaf03('0x48')]);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x49'),_0x41b7f2[_0xaf03('0x4a')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41b7f2[_0xaf03('0x4b')]);loggerPredictive['info'](_0xaf03('0x4c'),_0x41b7f2[_0xaf03('0x4d')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41b7f2['predictiveIntervalAvgTalktime']);loggerPredictive[_0xaf03('0x45')]('---------------------------');if(_0x41b7f2['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x41b7f2[_0xaf03('0x4e')])&&_0x41b7f2['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xaf03('0x45')](_0xaf03('0x4f'));if(!_[_0xaf03('0x50')](_0x41b7f2[_0xaf03('0x4d')])&&_0x41b7f2[_0xaf03('0x4d')]>0x0){return!![];}loggerPredictive[_0xaf03('0x45')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xaf03('0x45')](_0xaf03('0x51'));}}else{loggerPredictive[_0xaf03('0x45')](_0xaf03('0x52'));}return![];}function mergeDataErlangB(_0x5e3f30){return function(_0x46b5ef){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xaf03('0x45')](_0xaf03('0x53'),_0x46b5ef['erlangCalls']);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x54'),_0x46b5ef[_0xaf03('0x55')]);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x56'),_0x46b5ef[_0xaf03('0x57')]);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x58'),_0x46b5ef['erlangBusyFactor']);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x56'),_0x46b5ef['erlangAbandonmentRate']);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x59'));_[_0xaf03('0x5a')](_0x5e3f30,_0x46b5ef);};}function ifInterval(_0x4541d0,_0x165e33){if(_['isUndefined'](_0x165e33)){return![];}return utils['getSeconds'](undefined,_0x165e33)<_0x4541d0*0x3c;}function clearPredictiveAttributes(_0x47b4b5){if(_0x47b4b5[_0xaf03('0x25')]){_0x47b4b5['startProgressive']=undefined;loggerPredictive['debug'](_0x47b4b5[_0xaf03('0x42')],_0xaf03('0x5b'));}if(_0x47b4b5[_0xaf03('0x24')]){_0x47b4b5[_0xaf03('0x24')]=undefined;loggerPredictive[_0xaf03('0x3f')](_0x47b4b5['name'],_0xaf03('0x5c'));}if(_0x47b4b5[_0xaf03('0x5d')]){clearInterval(_0x47b4b5[_0xaf03('0x5d')]);_0x47b4b5[_0xaf03('0x5d')]=undefined;loggerPredictive[_0xaf03('0x3f')](_0x47b4b5[_0xaf03('0x42')],_0xaf03('0x5e'));}}function loggerCatchPredictive(_0xe59c80,_0x2c4636){return function(_0x2d3ad3){loggerPredictive['error'](_0x2c4636[_0xaf03('0x42')],_0xe59c80);loggerPredictive[_0xaf03('0x5f')](_0x2d3ad3[_0xaf03('0x60')]);clearPredictiveAttributes(_0x2c4636);};}function loggerCatch(_0x402c5e){return function(_0x2bf779){logger[_0xaf03('0x5f')](_0x402c5e,util['inspect'](_0x2bf779,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1123cb,_0xf08114,_0x46e74e){return function(_0x5eb4d0){utils[_0xaf03('0x61')](_0xf08114,_0x46e74e,0x0);logger['error'](_0x1123cb,util['inspect'](_0x5eb4d0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x14b570){return function(_0x50ed71){if(isNotNull(_0x50ed71)&&isNotNull(_0x50ed71[0x0])){if(_0x50ed71[0x0][_0xaf03('0x62')]>0x0){_0x14b570[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x65')];logger['info'](_0xaf03('0x66')+_0x14b570[_0xaf03('0x42')],_0x50ed71[0x0][_0xaf03('0x62')],_0xaf03('0x67'));}else{_0x14b570[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x68')];logger[_0xaf03('0x45')](_0xaf03('0x69')+_0x14b570[_0xaf03('0x42')]);}}};}function createObjHistory(_0x5363c8,_0x3720f6,_0x187e91,_0xc9d5ab,_0x477211){_0x5363c8['message']=_0x187e91;var _0x456902=new Action(_0x5363c8,_0x3720f6);var _0x3832b4=new History(_0x456902);_0x3832b4[_0xaf03('0x6a')]=_0xc9d5ab;_0x3832b4[_0xaf03('0x6b')]=_0x477211;_0x3832b4[_0xaf03('0x6c')]=_0x456902['starttime'];return _0x3832b4;}function unlockQueueStatus(_0x2d3ad0,_0x483bf0){setTimeout(function(){if(_[_0xaf03('0x50')](_0x2d3ad0['queueStatusComplete'])){loggerBooked[_0xaf03('0x5f')]('[unlockQueueStatus][undefined]',_0x483bf0);}_0x2d3ad0['queueStatusComplete']=!![];loggerBooked[_0xaf03('0x45')](_0xaf03('0x6d'),_0x483bf0,JSON[_0xaf03('0x6e')](_['pick'](_0x2d3ad0,[_0xaf03('0x42'),_0xaf03('0x6f')])));},0x1f3);}function checkInterval(_0x29eeda){return function(){if(!isNotNull(_0x29eeda['Interval'])){_0x29eeda['message']=utils[_0xaf03('0x64')][_0xaf03('0x70')];throw _0x29eeda[_0xaf03('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x29eeda[_0xaf03('0x71')][_0xaf03('0x72')])){_0x29eeda['message']=utils[_0xaf03('0x64')][_0xaf03('0x70')];throw _0x29eeda[_0xaf03('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xaf03('0x73')](_0x29eeda[_0xaf03('0x71')][_0xaf03('0x72')]))){_0x29eeda[_0xaf03('0x63')]=utils['CAMPAIGN_STATUS'][_0xaf03('0x70')];throw _0x29eeda['name']+_0xaf03('0x74');}};}function checkIsIVRCampaignActive(_0x332312){return function(){if(!utils[_0xaf03('0x75')](_0x332312)){_0x332312[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x76')];throw _0x332312[_0xaf03('0x42')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x20ef02){if(utils['isIVRCampaign'](_0x20ef02)){emit(util[_0xaf03('0x77')](_0xaf03('0x78'),_0x20ef02[_0xaf03('0x42')]),'campaign:save',_0x20ef02);}}function loggerCatchQueueSummary(_0x2856fa,_0xfea2b1){return function(_0x31e539){clearPredictiveAttributes(_0xfea2b1);emitCampaignSummary(_0xfea2b1);loggerSyncQueueSummary[_0xaf03('0x3f')](_0x2856fa,util[_0xaf03('0x40')](_0x31e539,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x11493f){if(_0x11493f[_0xaf03('0x79')]){if(_0x11493f[_0xaf03('0x7a')]===0x0){_0x11493f[_0xaf03('0x79')]=![];_0x11493f[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x76')];loggerSyncQueueSummary[_0xaf03('0x3f')](_0xaf03('0x7b'),_0x11493f[_0xaf03('0x42')],_0xaf03('0x7c'));}else{_0x11493f[_0xaf03('0x63')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary['debug'](_0xaf03('0x7b'),_0x11493f[_0xaf03('0x42')],_0xaf03('0x7d'));}emitCampaignSummary(_0x11493f);}}function myreject(_0x75c3af){return function(_0x2abae6){return _0x75c3af(msgResponse(_0xaf03('0x7e'),_0xaf03('0x7f'),JSON[_0xaf03('0x6e')](_0x2abae6)));};}Dialer['prototype'][_0xaf03('0x80')]=function(_0x53c29b){return!_[_0xaf03('0x50')](_0x53c29b)&&_0x53c29b&&!_['isUndefined'](_0x53c29b['name'])&&!_['isUndefined'](_0x53c29b[_0xaf03('0x81')])&&_0x53c29b['active']&&(this[_0xaf03('0x1f')][util['format'](_0xaf03('0x82'),_0x53c29b[_0xaf03('0x42')])][_0xaf03('0x83')]===_0xaf03('0x84')||this[_0xaf03('0x1f')][util['format'](_0xaf03('0x82'),_0x53c29b[_0xaf03('0x42')])][_0xaf03('0x83')]===_0xaf03('0x85'));};Dialer[_0xaf03('0x18')][_0xaf03('0x86')]=function(_0x389280){var _0x54d171=this;return function(){if(!_0x54d171[_0xaf03('0x80')](_0x389280[_0xaf03('0x87')])){if(!_0x54d171[_0xaf03('0x80')](_0x389280['TrunkBackup'])){_0x389280[_0xaf03('0x63')]=utils['CAMPAIGN_STATUS'][_0xaf03('0x88')];throw _0x389280['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xaf03('0x89')]=function(_0x39ad61,_0x2a945b,_0x43d905,_0x3a165a){var _0x34052a=this;return function(){var _0x13d604=!![];return _0x34052a[_0xaf03('0x8a')](_0x39ad61,_0x2a945b,_0x43d905,_0x3a165a,_0x13d604);};};Dialer[_0xaf03('0x18')]['checkIfTimeIntervals']=function(_0x32f216,_0x15f99a,_0x4fca60,_0xf59e1){var _0x3d214d=this;return function(){var _0xc97777=![];return _0x3d214d[_0xaf03('0x8a')](_0x32f216[_0xaf03('0x72')],_0x15f99a,_0x4fca60,_0xf59e1,_0xc97777);};};Dialer['prototype'][_0xaf03('0x8a')]=function(_0x54658d,_0x249038,_0x11c023,_0x1b1781,_0x47d7ce){var _0x3dfa29=[];return new Promise(function(_0x5838af,_0x3cadaf){if(!isNotNull(_0x54658d)){_0x1b1781[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x70')];return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),_0x11c023+_0xaf03('0x8d')));}if(_[_0xaf03('0x73')](_0x54658d)){_0x1b1781['message']=utils['CAMPAIGN_STATUS'][_0xaf03('0x8e')];return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),_0x11c023+_0xaf03('0x8f')));}if(_0x249038&&_[_0xaf03('0x50')](config[_0xaf03('0x90')][_0x249038])){_0x1b1781['message']=utils[_0xaf03('0x64')][_0xaf03('0x91')];return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),_0x11c023+_0xaf03('0x92')+_0x249038));}if(_[_0xaf03('0x93')](_0x54658d)){for(var _0xaa55ef=0x0;_0xaa55ef<_0x54658d[_0xaf03('0x94')];_0xaa55ef+=0x1){_0x3dfa29[_0xaf03('0x95')](ami['Action']({'action':_0xaf03('0x96'),'command':util[_0xaf03('0x77')]('iftime\x20%s,%s',_0x54658d[_0xaa55ef][_0xaf03('0x97')],!_[_0xaf03('0x50')](config['timezones'][_0x249038])?_0x249038:'')})[_0xaf03('0x3b')](function(_0x366221){return _0x366221[_0xaf03('0x98')][_0xaf03('0x99')](_0xaf03('0x9a'))>=0x0;})[_0xaf03('0x9b')](myreject(_0x3cadaf)));}}else{_0x3dfa29[_0xaf03('0x95')](ami['Action']({'action':_0xaf03('0x96'),'command':util['format'](_0xaf03('0x9c'),_0x54658d,!_['isUndefined'](config[_0xaf03('0x90')][_0x249038])?_0x249038:'')})[_0xaf03('0x3b')](function(_0x3a130d){return _0x3a130d['content'][_0xaf03('0x99')](_0xaf03('0x9a'))>=0x0;})['catch'](myreject(_0x3cadaf)));}Promise['all'](_0x3dfa29)['then'](function(_0x2a5fa1){var _0x10867c=_[_0xaf03('0x9d')](_0x2a5fa1);if(_0x10867c){return _0x5838af(_0x10867c);}else{_0x1b1781[_0xaf03('0x63')]=_0x47d7ce?utils[_0xaf03('0x64')][_0xaf03('0x9e')]:utils[_0xaf03('0x64')]['OVERTIME_INTERVAL'];return _0x3cadaf(msgResponse(_0xaf03('0x9f'),_0xaf03('0x8c'),'Global:\x20'+_0x47d7ce+'\x20'+_0x11c023+_0xaf03('0xa0')+util[_0xaf03('0x40')](_0x54658d,{'showHidden':![],'depth':null})+_0xaf03('0xa1')+_0x249038));}})[_0xaf03('0x9b')](function(_0x504457){return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),JSON[_0xaf03('0x6e')](_0x504457)));});});};Dialer[_0xaf03('0x18')][_0xaf03('0xa2')]=function(){var _0x22c0e6=this;return cmHopper[_0xaf03('0xa3')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x22c0e6[_0xaf03('0xa4')]();},0x3e8);});};Dialer[_0xaf03('0x18')]['syncCampaigns']=function(){var _0x3c7c3e=this;var _0x202c2c;for(var _0x1a0683 in this['campaigns']){if(typeof this[_0xaf03('0x1d')][_0x1a0683]!==_0xaf03('0xa5')){_0x202c2c=this['campaigns'][_0x1a0683];if(utils['isIVRCampaign'](_0x202c2c)&&utils[_0xaf03('0x75')](_0x202c2c)){_0x202c2c[_0xaf03('0x79')]=!![];Promise[_0xaf03('0xa6')]()['then'](checkIsIVRCampaignActive(_0x202c2c))[_0xaf03('0x3b')](checkInterval(_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e['checkIsTrunkReachable'](_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e['checkIfTime'](_0x202c2c[_0xaf03('0xa7')],_0x202c2c['dialTimezone'],_0x202c2c[_0xaf03('0x42')],_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e[_0xaf03('0xa8')](_0x202c2c['Interval'],_0x202c2c['dialTimezone'],_0x202c2c['name'],_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e[_0xaf03('0xa9')](_0x202c2c))['catch'](loggerCatchQueueSummary(_0xaf03('0xaa'),_0x202c2c));}else{notSendMessagesCampaign(_0x202c2c);}}}};Dialer['prototype'][_0xaf03('0xab')]=function(_0x5b0881){if(_0x5b0881[_0xaf03('0xac')]!==_0xaf03('0x9')){clearPredictiveAttributes(_0x5b0881);}switch(_0x5b0881[_0xaf03('0xac')]){case _0xaf03('0xad'):this['handlePower'](_0x5b0881,0x1);break;case _0xaf03('0xae'):this[_0xaf03('0xaf')](_0x5b0881,_0x5b0881[_0xaf03('0xb0')]);break;case _0xaf03('0x9'):this[_0xaf03('0x9')](_0x5b0881);break;case _0xaf03('0x8'):this[_0xaf03('0xaf')](_0x5b0881,0x1);break;default:logger[_0xaf03('0x5f')](_0xaf03('0xb1'),_0x5b0881[_0xaf03('0x42')],'method\x20not\x20recognized');}};Dialer[_0xaf03('0x18')][_0xaf03('0x8b')]=function(_0x34096f,_0x5418ad){var _0x2486c7=_0x34096f[_0xaf03('0xb2')];var _0x390446=_0x5418ad?_0x34096f['dialGlobalInterval']:_0x34096f[_0xaf03('0x71')][_0xaf03('0x72')];logger[_0xaf03('0xb3')]('Dialer::ifTime()',_0x390446,_0x2486c7,_0x34096f[_0xaf03('0x42')],util['format'](_0xaf03('0xb4'),_0x34096f[_0xaf03('0x42')],_0x34096f['id']));var _0x4d5f60=null;return Interval[_0xaf03('0xb5')](_0x390446,_0x2486c7)['then'](function(_0x1a5c7c){if(_0x1a5c7c===!![]){return _0x1a5c7c;}else{_0x34096f[_0xaf03('0x63')]=_0x5418ad?utils[_0xaf03('0x64')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xaf03('0x64')]['OVERTIME_INTERVAL'];_0x4d5f60=msgResponse(_0xaf03('0x9f'),_0xaf03('0x8c'),'Global:\x20'+_0x5418ad+'\x20'+_0x34096f[_0xaf03('0x42')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x390446,{'showHidden':![],'depth':null})+_0xaf03('0xa1')+_0x2486c7);}if(_0x4d5f60!==null){logger[_0xaf03('0xb3')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4d5f60);_0x4d5f60[_0xaf03('0xb6')]=_0x5418ad;throw _0x4d5f60;}})[_0xaf03('0x9b')](function(_0x49f4fe){logger[_0xaf03('0x5f')](_0xaf03('0xb7'),_0x49f4fe);throw msgResponse(_0xaf03('0x7e'),_0xaf03('0x7f'),util[_0xaf03('0x40')](_0x49f4fe,{'showHidden':![],'depth':null}));});};Dialer[_0xaf03('0x18')]['syncAgentConnect']=function(_0x29e17b){if(this[_0xaf03('0x1c')][_0x29e17b[_0xaf03('0xb8')]]){if(this[_0xaf03('0x23')][_0x29e17b[_0xaf03('0xb9')]]&&this[_0xaf03('0x23')][_0x29e17b[_0xaf03('0xb9')]][_0xaf03('0x3d')]!==_0xaf03('0xba')){this[_0xaf03('0xbb')](this['voiceQueues'][_0x29e17b[_0xaf03('0xb8')]]);this[_0xaf03('0x23')][_0x29e17b['uniqueid']][_0xaf03('0xbc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xaf03('0x18')][_0xaf03('0xbd')]=function(_0x4a0bbd){var _0x1b74eb=this[_0xaf03('0x23')][_0x4a0bbd[_0xaf03('0xb9')]];if(this[_0xaf03('0x1c')][_0x4a0bbd['queue']]){if(_0x1b74eb&&_0x1b74eb[_0xaf03('0x3d')]!=='ivr'){delete this[_0xaf03('0x23')][_0x4a0bbd[_0xaf03('0xb9')]];this['voiceQueues'][_0x4a0bbd['queue']][_0xaf03('0xbe')]+=0x1;var _0x543e5b=new AgentComplete(_0x1b74eb,_0x4a0bbd);if(_0x4a0bbd[_0xaf03('0xbf')]===_0xaf03('0xc0')){_0x543e5b['agiafterat']=this[_0xaf03('0x1c')][_0x4a0bbd['queue']]['dialQueueProject2']&&this[_0xaf03('0x1c')][_0x4a0bbd[_0xaf03('0xb8')]][_0xaf03('0xc1')]?moment()[_0xaf03('0x77')](_0xaf03('0xc2')):undefined;}hopperUtils['createHistory'](_0x543e5b)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xc3')));hopperUtils['moveContactManagedDialer'](_0x543e5b)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xc4')));}}};Dialer[_0xaf03('0x18')][_0xaf03('0x2d')]=function(_0x51bcc2){var _0x14ffa5=this['uniqueId'][_0x51bcc2[_0xaf03('0xb9')]];var _0x33c252=this;var _0xc65fe6=![];var _0x5b314e;var _0xacb8e9;if(this[_0xaf03('0x1c')][_0x51bcc2['queue']]){if(_0x14ffa5&&_0x14ffa5['type']!==_0xaf03('0xba')){delete this[_0xaf03('0x23')][_0x51bcc2[_0xaf03('0xb9')]];this['updateOriginated'](this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]]);_0x14ffa5[_0xaf03('0xc5')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5774dd=new QueueCallerAbandon(_0x14ffa5,_0x51bcc2);if(utils[_0xaf03('0xc6')](_0x14ffa5['droptime'],_0x14ffa5[_0xaf03('0xc7')])>=_0x14ffa5['dialQueueTimeout']){this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xaf03('0x1c')][_0x51bcc2['queue']][_0xaf03('0xc8')]+=0x1;this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xc9')]+=0x1;_0x5774dd[_0xaf03('0x6a')]=0xa;_0x5774dd[_0xaf03('0x6b')]=_0xaf03('0xca');_0x5774dd['dropreason']=_0xaf03('0xcb');_0x5774dd['agiafterat']=this['voiceQueues'][_0x51bcc2['queue']][_0xaf03('0xcc')]?moment()[_0xaf03('0x77')](_0xaf03('0xc2')):undefined;_0x5774dd['countdropretry']+=0x1;_0x5774dd['countglobal']+=0x1;_0x5b314e=this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xcd')];_0xacb8e9=this[_0xaf03('0x1c')][_0x51bcc2['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0xaf03('0xce')](_0x5774dd,_0x5774dd[_0xaf03('0x6a')],_0x14ffa5[_0xaf03('0xcf')])[_0xaf03('0x3b')](function(_0x5d5323){_0xc65fe6=_0x5d5323[_0xaf03('0xd0')]==0x1;if(_0x5774dd[_0xaf03('0xd1')]>=_0x33c252['voiceQueues'][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xd2')]){_0x33c252[_0xaf03('0xd3')](_0x5774dd,_0x5d5323[_0xaf03('0xd0')]);}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countdropretry':_0x5774dd[_0xaf03('0xd1')],'scheduledat':moment()[_0xaf03('0xd5')](_0x33c252[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xcd')],_0xaf03('0xd6'))[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14ffa5[_0xaf03('0xd7')],'ListId':_0x14ffa5[_0xaf03('0xd8')],'VoiceQueueId':_0x14ffa5[_0xaf03('0xd9')]||undefined,'CampaignId':_0x14ffa5[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch('[rescheduleContact][Drop]'));var _0x44d3a1=new History(_0x5774dd);_0x44d3a1['state']=0xa;_0x44d3a1['statedesc']='Drop';_0x44d3a1[_0xaf03('0xdb')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x44d3a1['endtime']=_0x44d3a1[_0xaf03('0xdb')];_0x44d3a1[_0xaf03('0xdc')]=_0x5774dd[_0xaf03('0xdc')];_0x44d3a1[_0xaf03('0xdd')]=_0x5774dd[_0xaf03('0xdd')];hopperUtils[_0xaf03('0xde')](_0x44d3a1)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xdf')));}})[_0xaf03('0x3b')](function(){if(_0xc65fe6)hopperUtils[_0xaf03('0xe0')](_0x5774dd,_0x5b314e,_0xacb8e9)[_0xaf03('0x3b')](function(){return 0x1;});});}else{this['voiceQueues'][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0x4b')]+=0x1;this['voiceQueues'][_0x51bcc2['queue']][_0xaf03('0xe1')]+=0x1;_0x5774dd[_0xaf03('0x6a')]=0xb;_0x5774dd[_0xaf03('0x6b')]=_0xaf03('0xe2');_0x5774dd['dropreason']=_0xaf03('0xe3');_0x5774dd[_0xaf03('0xe4')]+=0x1;_0x5774dd['countglobal']+=0x1;_0x5b314e=this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]]['dialAbandonedRetryFrequency'];_0xacb8e9=this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xe5')];hopperUtils[_0xaf03('0xce')](_0x5774dd,_0x5774dd[_0xaf03('0x6a')],_0x14ffa5[_0xaf03('0xcf')])['then'](function(_0x53563d){if(_0x5774dd['countabandonedretry']>=_0x33c252[_0xaf03('0x1c')][_0x51bcc2['queue']][_0xaf03('0xe6')]){_0x33c252['queueCallerAbandonCreateState'](_0x5774dd,_0x53563d['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5774dd['countabandonedretry'],'scheduledat':moment()['add'](_0x33c252['voiceQueues'][_0x51bcc2['queue']][_0xaf03('0xe7')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x14ffa5[_0xaf03('0xd7')],'ListId':_0x14ffa5[_0xaf03('0xd8')],'VoiceQueueId':_0x14ffa5[_0xaf03('0xd9')]||undefined,'CampaignId':_0x14ffa5[_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0xe8')));var _0x3c6d97=new History(_0x5774dd);_0x3c6d97[_0xaf03('0x6a')]=0xb;_0x3c6d97[_0xaf03('0x6b')]='Abandoned';_0x3c6d97[_0xaf03('0xdb')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c6d97[_0xaf03('0x6c')]=_0x3c6d97[_0xaf03('0xdb')];_0x3c6d97[_0xaf03('0xdc')]=_0x5774dd[_0xaf03('0xdc')];_0x3c6d97[_0xaf03('0xdd')]=_0x5774dd['calleridnum'];hopperUtils[_0xaf03('0xde')](_0x3c6d97)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xe9')));}})[_0xaf03('0x3b')](function(){if(_0xc65fe6)hopperUtils[_0xaf03('0xe0')](_0x5774dd,_0x5b314e,_0xacb8e9)['then'](function(){return 0x1;});});}}}};Dialer[_0xaf03('0x18')]['syncNewExten']=function(_0x2852d8){if(this[_0xaf03('0x21')][_0x2852d8[_0xaf03('0xb9')]]){this[_0xaf03('0x21')][_0x2852d8['uniqueid']][_0xaf03('0xea')]=_0x2852d8[_0xaf03('0xea')];}if(this['uniqueId'][_0x2852d8[_0xaf03('0xb9')]]){this[_0xaf03('0x23')][_0x2852d8[_0xaf03('0xb9')]][_0xaf03('0xea')]=_0x2852d8[_0xaf03('0xea')];}};Dialer['prototype'][_0xaf03('0xeb')]=function(_0x389eb0){if(!this['actions'][_0x389eb0['actionid']]){return;}var _0x56faeb=this[_0xaf03('0x1c')][this[_0xaf03('0x21')][_0x389eb0['actionid']][_0xaf03('0xb8')]]['strategy']||_0xaf03('0xec');if(_0x56faeb==='roundrobin'){if(this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]]&&_[_0xaf03('0xee')](this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xef')])&&_0x389eb0['status']==='1'&&_0x389eb0[_0xaf03('0xf0')]==='0'){if(this[_0xaf03('0x1e')][_0x389eb0[_0xaf03('0xf1')]]){if(!this[_0xaf03('0x1e')][_0x389eb0[_0xaf03('0xf1')]][_0xaf03('0xef')]){this[_0xaf03('0x1e')][_0x389eb0['stateinterface']][_0xaf03('0xef')]=!![];this[_0xaf03('0x21')][_0x389eb0['actionid']]['locked']=!![];this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xf1')]=_0x389eb0[_0xaf03('0xf1')];}}}}else if(_0x56faeb===_0xaf03('0xec')){if(this[_0xaf03('0x21')][_0x389eb0['actionid']]){if(this['agents'][_0x389eb0[_0xaf03('0xf1')]]){this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xf1')]=_0x389eb0[_0xaf03('0xf1')];if(_[_0xaf03('0xee')](this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x389eb0['actionid']]['queue']])){this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xb8')]]=[];}this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xb8')]]['push'](_[_0xaf03('0x5a')](_[_0xaf03('0xf2')](this['actions'][_0x389eb0[_0xaf03('0xed')]],[_0xaf03('0xf3'),_0xaf03('0xf1')]),{'status':_0x389eb0[_0xaf03('0x83')],'paused':_0x389eb0[_0xaf03('0xf0')]}));}}}};Dialer[_0xaf03('0x18')][_0xaf03('0xf4')]=function(_0x1b12d7){if(!this[_0xaf03('0x21')][_0x1b12d7['actionid']]){return;}var _0x14b871=this;var _0x423889=this[_0xaf03('0x1c')][this['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]];var _0x483770=_0x423889[_0xaf03('0xf5')]||_0xaf03('0xec');if(_0x483770===_0xaf03('0xf6')){if(this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]&&this['actions'][_0x1b12d7['actionid']]['stateinterface']){this[_0xaf03('0xf7')][_0xaf03('0xf8')](this['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xf3')],this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xf1')])[_0xaf03('0x9b')](function(_0x39ea65){logger[_0xaf03('0x5f')](_0xaf03('0xf9'),util[_0xaf03('0x40')](_0x39ea65,{'showHidden':![],'depth':null}));})[_0xaf03('0x1a')](function(){_0x14b871['updateOriginated'](_0x14b871[_0xaf03('0x1c')][_0x14b871[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]['queue']]);_0x14b871[_0xaf03('0x1e')][_0x14b871['actions'][_0x1b12d7['actionid']][_0xaf03('0xf1')]][_0xaf03('0xef')]=![];delete _0x14b871[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]];unlockQueueStatus(_0x423889);});}else{this[_0xaf03('0xbb')](this[_0xaf03('0x1c')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xd7')],'ListId':this[_0xaf03('0x21')][_0x1b12d7['actionid']][_0xaf03('0xd8')],'VoiceQueueId':this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xd9')]||undefined,'CampaignId':this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xfa')));delete this[_0xaf03('0x21')][_0x1b12d7['actionid']];unlockQueueStatus(_0x423889);}}else if(_0x483770===_0xaf03('0xec')){var _0xdeb142;if(this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]&&!_[_0xaf03('0x73')](this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]['queue']])){if(this[_0xaf03('0x28')][_0x14b871['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]]){this['queueBookedRR'][_0x14b871[_0xaf03('0x21')][_0x1b12d7['actionid']][_0xaf03('0xb8')]]=this[_0xaf03('0x28')][this['actions'][_0x1b12d7['actionid']]['queue']]?this[_0xaf03('0x28')][this['actions'][_0x1b12d7[_0xaf03('0xed')]]['queue']]:this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]['queue']]?this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]][_0xaf03('0xfb')]||0x0:0x0;}this['queueBooked'][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]]['_rr']=this['queueBookedRR'][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]];for(var _0x138c4d=0x0;_0x138c4d=_0xe2a78d[_0xaf03('0x11e')]){_0x244dae[_0xaf03('0x11f')](_0x1c04e4,_0x4bade6,_0x147212,'reason19\x20machine....');}else{if(_0x1c04e4[_0xaf03('0x116')]>=_0xe2a78d[_0xaf03('0x120')]){_0x244dae[_0xaf03('0x121')](_0x1c04e4,_0x4bade6,_0x147212,_0xaf03('0x122'));}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countmachineretry':_0x1c04e4[_0xaf03('0x116')],'scheduledat':moment()['add'](_0xe2a78d[_0xaf03('0x123')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x1c04e4['ContactId'],'ListId':_0x1c04e4['ListId'],'VoiceQueueId':_0x1c04e4[_0xaf03('0xd9')]||undefined,'CampaignId':_0x1c04e4[_0xaf03('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x4bade6({'reschedule':0x1});}}});}if(_0x57eb20['type']===_0xaf03('0xba')&&this[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]][_0xaf03('0x112')]&&_0x1800c1[_0xaf03('0x10c')]===_0xaf03('0x124')){delete this[_0xaf03('0x23')][_0x1800c1[_0xaf03('0xb9')]];this[_0xaf03('0xbb')](this[_0xaf03('0x1d')][_0x57eb20['queue']]);_0x375292=new Hangup(_0x57eb20,_0x1800c1);_0x375292[_0xaf03('0x6a')]=0x12;_0x375292[_0xaf03('0x6b')]=_0xaf03('0x10d');_0x375292[_0xaf03('0x10e')]=_0xaf03('0x10f');ami[_0xaf03('0x119')](_0xaf03('0x125'),ut[_0xaf03('0x110')](_0x375292,_0xaf03('0x118')));this[_0xaf03('0x126')](_0x375292,_0xaf03('0x127'),'[syncHangupInAMDIvr]');}if(_0x57eb20[_0xaf03('0x3d')]===_0xaf03('0xba')&&this[_0xaf03('0x1d')][_0x57eb20['queue']]['dialAMDActive']&&_0x1800c1['value']==='MACHINE'){return new Promise(function(_0x13aa52,_0x499ee7){delete _0x244dae['uniqueId'][_0x1800c1['uniqueid']];_0x244dae['updateOriginated'](_0x244dae['campaigns'][_0x57eb20[_0xaf03('0xb8')]]);_0x244dae[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]][_0xaf03('0xbe')]+=0x1;_0x244dae[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]][_0xaf03('0x114')]+=0x1;var _0x173a24=_0x244dae[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]];var _0xb32e9e=new Hangup(_0x57eb20,_0x1800c1);_0xb32e9e[_0xaf03('0x6a')]=0x13;_0xb32e9e[_0xaf03('0x6b')]=_0xaf03('0x115');_0xb32e9e[_0xaf03('0x10e')]=_0xaf03('0x10f');_0xb32e9e[_0xaf03('0x116')]+=0x1;_0xb32e9e[_0xaf03('0x117')]+=0x1;_0xb32e9e[_0xaf03('0x118')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0xb32e9e,'amd'));hopperUtils[_0xaf03('0xde')](_0xb32e9e)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x128')));if(_0xb32e9e['countbusyretry']+_0xb32e9e[_0xaf03('0x11b')]+_0xb32e9e[_0xaf03('0x129')]+_0xb32e9e['countnosuchnumberretry']+_0xb32e9e[_0xaf03('0xd1')]+_0xb32e9e[_0xaf03('0xe4')]+_0xb32e9e[_0xaf03('0x116')]+_0xb32e9e[_0xaf03('0x11d')]>=_0x173a24[_0xaf03('0x11e')]){_0x244dae[_0xaf03('0x11f')](_0xb32e9e,_0x13aa52,_0x499ee7,_0xaf03('0x12a'));}else{if(_0xb32e9e[_0xaf03('0x116')]>=_0x173a24[_0xaf03('0x120')]){_0x244dae[_0xaf03('0x121')](_0xb32e9e,_0x13aa52,_0x499ee7,'reason\x2019\x20machine....');}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countmachineretry':_0xb32e9e[_0xaf03('0x116')],'scheduledat':moment()[_0xaf03('0xd5')](_0x173a24[_0xaf03('0x123')],_0xaf03('0xd6'))[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb32e9e[_0xaf03('0xd7')],'ListId':_0xb32e9e[_0xaf03('0xd8')],'VoiceQueueId':_0xb32e9e[_0xaf03('0xd9')]||undefined,'CampaignId':_0xb32e9e[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x12b')));_0x13aa52({'reschedule':0x1});}}});}}};Dialer[_0xaf03('0x18')][_0xaf03('0x34')]=function(_0x97f0b){var _0x3b0145=this['uniqueId'][_0x97f0b['uniqueid']];var _0x3c80b4;if(_0x3b0145&&_0x3b0145[_0xaf03('0x3d')]===_0xaf03('0xba')){delete this[_0xaf03('0x23')][_0x97f0b[_0xaf03('0xb9')]];this[_0xaf03('0xbb')](this[_0xaf03('0x1d')][_0x3b0145[_0xaf03('0xb8')]]);this[_0xaf03('0x1d')][_0x3b0145[_0xaf03('0xb8')]][_0xaf03('0x12c')]+=0x1;_0x3c80b4=new Hangup(_0x3b0145,_0x97f0b);hopperUtils[_0xaf03('0xde')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xaf03('0x12d')](_0x3c80b4)['catch'](loggerCatch(_0xaf03('0x12e')));}if(_0x3b0145&&_0x3b0145[_0xaf03('0x3d')]!==_0xaf03('0xba')&&isNotNull(this[_0xaf03('0x1c')][_0x3b0145['queue']][_0xaf03('0x12f')])){delete this[_0xaf03('0x23')][_0x97f0b[_0xaf03('0xb9')]];this['updateOriginated'](this[_0xaf03('0x1c')][_0x3b0145['queue']]);this[_0xaf03('0x1c')][_0x3b0145[_0xaf03('0xb8')]][_0xaf03('0xbe')]+=0x1;this['voiceQueues'][_0x3b0145[_0xaf03('0xb8')]][_0xaf03('0x114')]+=0x1;_0x3c80b4=new Hangup(_0x3b0145,_0x97f0b);_0x3c80b4[_0xaf03('0x6a')]=0x10;_0x3c80b4['statedesc']=_0xaf03('0x130');_0x3c80b4['membername']='AGI';hopperUtils[_0xaf03('0xde')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x131')));hopperUtils[_0xaf03('0x12d')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x3b0145&&_0x3b0145[_0xaf03('0x3d')]!==_0xaf03('0xba')&&!isNotNull(this[_0xaf03('0x1c')][_0x3b0145['queue']][_0xaf03('0x12f')])){delete this['uniqueId'][_0x97f0b[_0xaf03('0xb9')]];this[_0xaf03('0xbb')](this['voiceQueues'][_0x3b0145[_0xaf03('0xb8')]]);this['voiceQueues'][_0x3b0145['queue']][_0xaf03('0x132')]+=0x1;_0x3c80b4=new Hangup(_0x3b0145,_0x97f0b);_0x3c80b4[_0xaf03('0x6a')]=0xc;_0x3c80b4['statedesc']=_0x97f0b[_0xaf03('0x133')];_0x3c80b4[_0xaf03('0x10e')]=_0xaf03('0x134');hopperUtils[_0xaf03('0xde')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xaf03('0x12d')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x12e')));}};Dialer[_0xaf03('0x18')][_0xaf03('0xb')]=function(_0x1344e6){var _0x2a1aac=this;if(!_0x2a1aac[_0xaf03('0x29')][_0x1344e6[_0xaf03('0x42')]]){_0x2a1aac[_0xaf03('0x29')][_0x1344e6['name']]={'running':![]};}else if(_0x2a1aac[_0xaf03('0x29')][_0x1344e6[_0xaf03('0x42')]][_0xaf03('0x135')]===!![]){return;}else if(_0x2a1aac[_0xaf03('0x29')][_0x1344e6['name']]['running']===![]){_0x2a1aac[_0xaf03('0x29')][_0x1344e6[_0xaf03('0x42')]][_0xaf03('0x135')]=!![];}var _0x775de=_0x2a1aac[_0xaf03('0x1c')][_0x1344e6[_0xaf03('0x42')]];var _0x370ea5=_0x775de[_0xaf03('0x63')]!==utils[_0xaf03('0x64')]['INACTIVE'];var _0x374632=utils[_0xaf03('0x136')](_0x775de);_0x775de[_0xaf03('0x137')]=utils['getQueueCampaignStatusMessage'](_0x775de,_0x2a1aac[_0xaf03('0x1f')]);Promise[_0xaf03('0xa6')]()['then'](function(){if(_0x775de[_0xaf03('0x137')]===utils['CAMPAIGN_STATUS'][_0xaf03('0x76')]){if(_0x370ea5){clearPredictiveAttributes(_0x775de);_0x1344e6[_0xaf03('0x24')]=undefined;_0x1344e6[_0xaf03('0x25')]=undefined;}if(_0x775de[_0xaf03('0x137')]===utils[_0xaf03('0x64')][_0xaf03('0x76')]){_0x1344e6[_0xaf03('0x138')]=0x0;_0x1344e6[_0xaf03('0xf0')]=0x0;_0x1344e6[_0xaf03('0x139')]=0x0;_0x1344e6[_0xaf03('0x13a')]=0x0;_0x1344e6[_0xaf03('0x13b')]=0x0;}}else if(_0x775de['statusMessage']===utils[_0xaf03('0x64')][_0xaf03('0x13c')]&&!_0x374632){return _0x2a1aac[_0xaf03('0x8b')](_0x775de,!![])['then'](function(){return _0x2a1aac[_0xaf03('0x8b')](_0x775de,![]);})[_0xaf03('0x3b')](function(){return _0x2a1aac[_0xaf03('0xab')](_0x775de);})['catch'](function(_0x5346bf){loggerSyncQueueSummary[_0xaf03('0x3f')]('[syncQueueSummary]',util[_0xaf03('0x40')](_0x5346bf,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x775de);});}else{clearPredictiveAttributes(_0x775de);}})['then'](function(){var _0x5e8229=_0x1344e6[_0xaf03('0x13d')](_0x775de);if(_0x5e8229||_0x775de[_0xaf03('0x13e')]){_0x775de['queueSummaryCountersUpdated']=![];_0x1344e6[_0xaf03('0x13f')](_0x775de);Object[_0xaf03('0x140')](_0x775de,_0x1344e6);emitOutboundVoiceQueueSummary(_0x1344e6);}_0x2a1aac[_0xaf03('0x29')][_0x775de['name']]['running']=![];})[_0xaf03('0x9b')](function(_0x5858d2){logger[_0xaf03('0x5f')](_0xaf03('0x141'),util[_0xaf03('0x40')](_0x5858d2,{'showHidden':![],'depth':null}));_0x2a1aac['queuesSummary'][_0x775de['name']]['running']=![];});};Dialer['prototype'][_0xaf03('0x32')]=_[_0xaf03('0x142')](function(){var _0x508c71=_[_0xaf03('0x143')](this[_0xaf03('0x1c')],function(_0x30c129){return _0x30c129[_0xaf03('0x144')];});var _0x35b34f=_['filter'](this[_0xaf03('0x1e')],function(_0x5c7ed3){return _0x5c7ed3['online']&&_0x5c7ed3[_0xaf03('0x83')]===_0xaf03('0x84');});if(_0x508c71[_0xaf03('0x94')]>0x0&&_0x35b34f['length']>0x0){return Promise['resolve']()[_0xaf03('0x3b')](cmHopper['handlePreviewRecallNotifications'](_[_0xaf03('0x145')](_0x508c71,'id'),previewRecallmeReminderInterval,_['map'](_0x35b34f,'id')))[_0xaf03('0x3b')](function(_0x271520){for(var _0xda5cc6=0x0;_0xda5cc6<_0x271520[_0xaf03('0x94')];_0xda5cc6++){var _0x4cf05b=_0x271520[_0xda5cc6][_0xaf03('0x146')][_0xaf03('0x42')];if(_0x4cf05b)io['to'](util['format'](_0xaf03('0x147'),_0x4cf05b))['emit'](_0xaf03('0x148'),{'hopper':_0x271520[_0xda5cc6]});}})[_0xaf03('0x9b')](function(_0x4338f0){logger['error'](_0xaf03('0x149'),_0x4338f0);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x2d1bf0=this;setInterval(function(){_0x2d1bf0[_0xaf03('0x14a')](_0x2d1bf0[_0xaf03('0x23')],_0xaf03('0x14b'));_0x2d1bf0[_0xaf03('0x14a')](_0x2d1bf0[_0xaf03('0x21')],'[actions]');},0x32c8);};Dialer['prototype'][_0xaf03('0x14a')]=function(_0x5b5929,_0x2dad84){var _0x5779ee=this;for(var _0x2a9b59 in _0x5b5929){if(typeof _0x5b5929[_0x2a9b59]!=='undefined'){this['sequence'][_0xaf03('0x14c')](function(){if(!_['isNil'](_0x5b5929[_0x2a9b59])){return ami['Action']({'action':'status','channel':_0x5b5929[_0x2a9b59][_0xaf03('0xea')]})[_0xaf03('0x9b')](function(_0x4158ae){if(_0x4158ae[_0xaf03('0x63')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5b5929[_0x2a9b59]&&_0x5b5929[_0x2a9b59][_0xaf03('0x3d')]!==_0xaf03('0xba')){_0x5779ee[_0xaf03('0xbb')](_0x5779ee[_0xaf03('0x1c')][_0x5b5929[_0x2a9b59][_0xaf03('0xb8')]]);logger['error']('[Dialer][checkChannel]',_0x2dad84,_0x2a9b59,_0x5b5929[_0x2a9b59][_0xaf03('0xb8')]);delete _0x5b5929[_0x2a9b59];}if(_0x5b5929[_0x2a9b59]&&_0x5b5929[_0x2a9b59]['type']===_0xaf03('0xba')){_0x5779ee[_0xaf03('0xbb')](_0x5779ee[_0xaf03('0x1d')][_0x5b5929[_0x2a9b59][_0xaf03('0xb8')]]);logger[_0xaf03('0x5f')](_0xaf03('0x14d'),_0x2dad84,_0x2a9b59,_0x5b5929[_0x2a9b59]['queue']);delete _0x5b5929[_0x2a9b59];}},0x2328);}});}});}}};Dialer['prototype'][_0xaf03('0x14e')]=function(_0x56ba65){return Promise[_0xaf03('0xa6')]()[_0xaf03('0x3b')](voiceQueueRt[_0xaf03('0x14e')](_0x56ba65))['catch'](loggerCatch(_0xaf03('0x14f')));};Dialer[_0xaf03('0x18')]['updateOriginated']=function(_0x5cad1e){if(!_[_0xaf03('0x50')](_0x5cad1e)&&_0x5cad1e!==null){if(typeof _0x5cad1e[_0xaf03('0x7a')]!==_0xaf03('0xa5')){if(_0x5cad1e[_0xaf03('0x7a')]>0x0){_0x5cad1e[_0xaf03('0x7a')]-=0x1;}else{logger[_0xaf03('0x5f')](_0xaf03('0x150'));}}}else{logger['error'](_0xaf03('0x151'));}};Dialer[_0xaf03('0x18')]['loggerHandler']=function(_0x5bf75a,_0x19c51d){var _0x2b7a03=this;return function(_0x261475){_0x2b7a03[_0xaf03('0xbb')](_0x19c51d);logger['error'](_0x5bf75a,util[_0xaf03('0x40')](_0x261475,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xaf03('0x152')]=function(_0x5e95e5,_0x409255,_0x200432){var _0x28fd8e={'state':0x19,'statedesc':_0xaf03('0x153')};this[_0xaf03('0xbb')](_0x409255);this[_0xaf03('0x126')](_[_0xaf03('0x5a')](_0x28fd8e,_['pick'](_0x200432,[_0xaf03('0xd7'),_0xaf03('0xd8'),_0xaf03('0x154'),_0xaf03('0xd9'),_0xaf03('0xda')])),_0xaf03('0x155'),_0xaf03('0x156'));logger[_0xaf03('0x5f')](_0x5e95e5);};Dialer['prototype'][_0xaf03('0x126')]=function(_0x5a4460,_0xf197cb,_0x4d16a3){hopperUtils[_0xaf03('0xde')](_0x5a4460)[_0xaf03('0x9b')](loggerCatch(_0xf197cb));hopperUtils[_0xaf03('0x12d')](_0x5a4460)[_0xaf03('0x9b')](loggerCatch(_0x4d16a3));};Dialer['prototype'][_0xaf03('0xd3')]=function(_0x469c66,_0x1a250c){hopperUtils[_0xaf03('0xde')](_0x469c66)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xc3')));if(_0x1a250c==0x0){hopperUtils[_0xaf03('0x12d')](_0x469c66)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x157')));}};Dialer[_0xaf03('0x18')][_0xaf03('0x149')]=function(_0x3245e1){return Promise[_0xaf03('0xa6')]()[_0xaf03('0x3b')](cmHopper[_0xaf03('0x158')](_0x3245e1['id'],previewRecallmeReminderInterval))[_0xaf03('0x3b')](function(_0x475b0c){for(var _0x55ee71=0x0;_0x55ee71<_0x475b0c[_0xaf03('0x94')];_0x55ee71++){var _0x4ed780=_0x475b0c[_0x55ee71][_0xaf03('0x146')][_0xaf03('0x42')];if(_0x4ed780)io['to'](util[_0xaf03('0x77')](_0xaf03('0x147'),_0x4ed780))[_0xaf03('0x119')](_0xaf03('0x148'),{'hopper':_0x475b0c[_0x55ee71]});}})[_0xaf03('0x9b')](function(){});};Dialer[_0xaf03('0x18')][_0xaf03('0xa9')]=function(_0x3e586c){var _0x17a7cb=this;return function(){_0x17a7cb[_0xaf03('0x159')](_0x3e586c);};};Dialer[_0xaf03('0x18')][_0xaf03('0x15a')]=function(_0x20b2ba,_0x2f7624){var _0xceb9=this;var _0x1c7930=uuid['v4']();this[_0xaf03('0x21')][_0x1c7930]=new Action(_0x20b2ba,_0x2f7624,_0x1c7930);return new Promise(function(_0x39f441,_0x11598d){if(_[_0xaf03('0x50')](_0x20b2ba)&&typeof _0x20b2ba!==_0xaf03('0x15b')){return _0x11598d(msgResponse(_0xaf03('0x15c'),_0xaf03('0x8c'),'voiceQueue\x20is\x20undefine'));}if(_[_0xaf03('0x50')](_0x2f7624['phone'])||_0x2f7624['phone']===null){return _0x11598d(msgResponse(_0xaf03('0x15c'),'Failure',_0xaf03('0x15d')));}var _0x35158a={'XMD-CALLERID':_0xceb9[_0xaf03('0x21')][_0x1c7930][_0xaf03('0x15e')](),'XMD-AGI':_0x20b2ba[_0xaf03('0x12f')]?util[_0xaf03('0x77')](_0xaf03('0x15f'),ipAgi,_0x20b2ba[_0xaf03('0x12f')]):_0xaf03('0x160'),'XMD-AGIAFTER':_0x20b2ba[_0xaf03('0xcc')]?util[_0xaf03('0x77')](_0xaf03('0x15f'),ipAgi,_0x20b2ba['dialQueueProject2']):_0xaf03('0x160'),'XMD-QUEUE':utils['isOutboundQueue'](_0x20b2ba)?util[_0xaf03('0x77')](_0xaf03('0x161'),_0x20b2ba['name'],_0x20b2ba[_0xaf03('0x162')]||'',_0x20b2ba[_0xaf03('0xc1')]?'c':'',_0x20b2ba[_0xaf03('0x163')]||0x3):_0xaf03('0x160'),'XMD-CONTACTID':_0x2f7624[_0xaf03('0xd7')],'XMD-CDRTYPE':_0xaf03('0x7'),'CALLERID(all)':_0xceb9[_0xaf03('0x21')][_0x1c7930][_0xaf03('0x15e')](),'XMD-AMD':_0x20b2ba['dialAMDActive']?'ACTIVE':_0xaf03('0x160'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x20b2ba[_0xaf03('0x112')]){_0x35158a['XMD-AMDINITIALSILENCE']=_0x20b2ba[_0xaf03('0x164')]||0x9c4;_0x35158a[_0xaf03('0x165')]=_0x20b2ba[_0xaf03('0x166')]||0x5dc;_0x35158a[_0xaf03('0x167')]=_0x20b2ba[_0xaf03('0x168')]||0x320;_0x35158a['XMD-AMDTOTALANALYSISTIME']=_0x20b2ba['dialAMDTotalAnalysisTime']||0x1388;_0x35158a[_0xaf03('0x169')]=_0x20b2ba[_0xaf03('0x16a')]||0x64;_0x35158a[_0xaf03('0x16b')]=_0x20b2ba[_0xaf03('0x16c')]||0x32;_0x35158a[_0xaf03('0x16d')]=_0x20b2ba['dialAMDMaximumNumberOfWords']||0x3;_0x35158a[_0xaf03('0x16e')]=_0x20b2ba['dialAMDSilenceThreshold']||0x100;_0x35158a['XMD-AMDMAXIMUMWORDLENGTH']=_0x20b2ba[_0xaf03('0x16f')]||0x1388;}if(utils[_0xaf03('0x170')](_0x20b2ba)){_0x35158a[_0xaf03('0x171')]=_0x2f7624[_0xaf03('0xd9')];}else{_0x35158a[_0xaf03('0x172')]=_0x2f7624['CampaignId'];}for(var _0x2fc646 in _0x2f7624['Contact']){if(typeof _0x2f7624['Contact'][_0x2fc646]!=='undefined'){if(isNotNull(_0x2f7624[_0xaf03('0x173')][_0x2fc646])&&_0x2fc646!=='id'&&_0x2fc646!==_0xaf03('0x174')&&_0x2fc646!==_0xaf03('0x175')&&_0x2fc646!==_0xaf03('0x176')){_0x35158a[util[_0xaf03('0x77')](_0xaf03('0x177'),_0xaf03('0x178'),_[_0xaf03('0x179')](_0x2fc646))]=_0x2f7624[_0xaf03('0x173')][_0x2fc646];}}}var _0x47ef0f=_0xceb9[_0xaf03('0x80')](_0x20b2ba[_0xaf03('0x87')])?utils['getCallerId'](_0x20b2ba[_0xaf03('0x87')][_0xaf03('0x17a')],_0x20b2ba['dialOriginateCallerIdName'],_0x20b2ba[_0xaf03('0x17b')]>0x0?utils[_0xaf03('0x17c')](_0x20b2ba[_0xaf03('0x17d')],_0x20b2ba[_0xaf03('0x17b')]):_0x20b2ba['dialOriginateCallerIdNumber']):utils[_0xaf03('0x17e')](_[_0xaf03('0xee')](_0x20b2ba[_0xaf03('0x17f')])?_0x20b2ba[_0xaf03('0x87')][_0xaf03('0x17a')]:_0x20b2ba[_0xaf03('0x17f')][_0xaf03('0x17a')],_0x20b2ba[_0xaf03('0x180')],_0x20b2ba['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xaf03('0x17c')](_0x20b2ba[_0xaf03('0x17d')],_0x20b2ba['dialRandomLastDigitCallerIdNumber']):_0x20b2ba[_0xaf03('0x17d')]);if(_0x47ef0f){_0x35158a[_0xaf03('0x181')]=_0xceb9[_0xaf03('0x21')][_0x1c7930][_0xaf03('0x182')]=utils['extractCalleridName'](_0x47ef0f);_0x35158a[_0xaf03('0x183')]=_0x2f7624[_0xaf03('0x184')];}_0x20b2ba[_0xaf03('0x185')]=_0x35158a;return ami[_0xaf03('0x186')]({'actionid':_0x1c7930,'action':_0xaf03('0x15c'),'channel':_0xceb9[_0xaf03('0x80')](_0x20b2ba[_0xaf03('0x87')])?util[_0xaf03('0x77')](_0xaf03('0x187'),_0x20b2ba[_0xaf03('0x87')][_0xaf03('0x42')],isNotNull(_0x20b2ba[_0xaf03('0x188')])?_0x20b2ba[_0xaf03('0x188')][_0xaf03('0x189')]()||'':'',_0x20b2ba[_0xaf03('0x18a')]>0x0?_0x2f7624[_0xaf03('0x184')][_0xaf03('0x18b')](_0x20b2ba[_0xaf03('0x18a')]):_0x2f7624[_0xaf03('0x184')]):util[_0xaf03('0x77')](_0xaf03('0x187'),_[_0xaf03('0xee')](_0x20b2ba['TrunkBackup'])?_0x20b2ba[_0xaf03('0x87')]['name']:_0x20b2ba[_0xaf03('0x17f')][_0xaf03('0x42')],isNotNull(_0x20b2ba['dialPrefix'])?_0x20b2ba[_0xaf03('0x188')][_0xaf03('0x189')]()||'':'',_0x20b2ba[_0xaf03('0x18a')]>0x0?_0x2f7624[_0xaf03('0x184')][_0xaf03('0x18b')](_0x20b2ba[_0xaf03('0x18a')]):_0x2f7624[_0xaf03('0x184')]),'callerid':_0x47ef0f,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x35158a,'timeout':(_0x20b2ba[_0xaf03('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1c7930})[_0xaf03('0x3b')](function(_0x5a1277){return _0x39f441(_0x5a1277);})[_0xaf03('0x9b')](function(_0x3503a0){_0x20b2ba[_0xaf03('0x18d')]+=0x1;var _0x16d663=new History(_0xceb9[_0xaf03('0x21')][_0x1c7930]);logger[_0xaf03('0x5f')](util['format'](_0xaf03('0x18e'),JSON[_0xaf03('0x6e')](_0x3503a0)));_0x16d663['state']=0xe;_0x16d663[_0xaf03('0x6b')]=_0xaf03('0x18f');_0x16d663[_0xaf03('0xdb')]=moment()['format'](_0xaf03('0xc2'));_0x16d663['endtime']=_0x16d663[_0xaf03('0xdb')];hopperUtils[_0xaf03('0xde')](_0x16d663)['catch'](loggerCatch(_0xaf03('0x190')));_0xceb9[_0xaf03('0x12d')](_0x16d663)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x190')))[_0xaf03('0x1a')](function(){delete _0xceb9[_0xaf03('0x21')][_0x1c7930];return _0x11598d(msgResponse(_0xaf03('0x15c'),_0xaf03('0x7f'),_0xaf03('0x191')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x2de1cc,_0x10feb7,_0xd9e772){var _0x355c13=new History(_0x10feb7);if(_0x355c13['countbusyretry']+_0x355c13[_0xaf03('0x11b')]+_0x355c13[_0xaf03('0x129')]+_0x355c13[_0xaf03('0x11c')]+_0x355c13[_0xaf03('0xd1')]+_0x355c13[_0xaf03('0xe4')]+_0x355c13[_0xaf03('0x116')]+_0x355c13[_0xaf03('0x11d')]>=_0xd9e772[_0xaf03('0x11e')]-0x1){return!![];}switch(_0x2de1cc){case 0x3:if(_0x355c13[_0xaf03('0x129')]>=_0xd9e772[_0xaf03('0x192')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countnoanswerretry':_0x355c13[_0xaf03('0x129')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0x193')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0x194')));break;case 0x5:if(_0x355c13[_0xaf03('0x11a')]>=_0xd9e772[_0xaf03('0x195')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countbusyretry':_0x355c13[_0xaf03('0x11a')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0x196')],'minutes')[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13['ContactId'],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x355c13['countcongestionretry']>=_0xd9e772[_0xaf03('0x197')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countcongestionretry':_0x355c13[_0xaf03('0x11b')]+=0x1,'scheduledat':moment()['add'](_0xd9e772[_0xaf03('0x198')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x199')));break;case 0x0:if(_0x355c13[_0xaf03('0x11c')]>=_0xd9e772['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countnosuchnumberretry':_0x355c13[_0xaf03('0x11c')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0x19a')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13['ListId'],'VoiceQueueId':_0x355c13['VoiceQueueId']||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x19b')));}break;case 0xa:if(_0x355c13[_0xaf03('0xd1')]>=_0xd9e772[_0xaf03('0xd2')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countdropretry':_0x355c13[_0xaf03('0xd1')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0xcd')],_0xaf03('0xd6'))[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13['ListId'],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x19c')));break;case 0xb:if(_0x355c13[_0xaf03('0xe4')]>=_0xd9e772[_0xaf03('0xe6')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countabandonedretry':_0x355c13['countabandonedretry']+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0xe7')],'minutes')[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13['ContactId'],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0xe8')));break;case 0x13:if(_0x355c13[_0xaf03('0x116')]>=_0xd9e772[_0xaf03('0x120')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countmachineretry':_0x355c13[_0xaf03('0x116')]+=0x1,'scheduledat':moment()['add'](_0xd9e772[_0xaf03('0x123')],_0xaf03('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13['ListId'],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x355c13[_0xaf03('0x11d')]>=_0xd9e772[_0xaf03('0x19d')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countagentrejectretry':_0x355c13[_0xaf03('0x11d')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772['dialAgentRejectRetryFrequency'],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13['ContactId'],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xaf03('0x106')]=function(_0x4ad292,_0x42fb16,_0x1754a3){var _0x1e581b=this;var _0x577349=new History(_0x4ad292);var _0x24e124=![];var _0x30fb1b;var _0x523459;return new Promise(function(_0x419a93,_0x5a247d){if(_['isUndefined'](_0x42fb16)&&typeof _0x42fb16!==_0xaf03('0x15b')){return _0x5a247d(msgResponse(_0xaf03('0x19e'),_0xaf03('0x8c'),'entity\x20is\x20undefine'));}if(_[_0xaf03('0x50')](_0x1754a3)&&typeof _0x1754a3!==_0xaf03('0x15b')){return _0x5a247d(msgResponse(_0xaf03('0x19e'),'Failure',_0xaf03('0x19f')));}hopperUtils[_0xaf03('0xce')](_0x577349,_0x1754a3[_0xaf03('0xbf')],_0x42fb16)[_0xaf03('0x3b')](function(_0x82d73c){if(_0x82d73c[_0xaf03('0xd0')]==0x1)_0x24e124=!![];switch(_0x1754a3['reason']){case'0':_0x42fb16[_0xaf03('0x1a0')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x0;_0x577349[_0xaf03('0x6b')]='NoSuchNumber';_0x577349[_0xaf03('0x11c')]+=0x1;_0x577349['countglobal']+=0x1;ami[_0xaf03('0x119')](_0xaf03('0x1a1'),ut[_0xaf03('0x110')](_0x4ad292,'nosuchnumber'));_0x30fb1b=_0x42fb16[_0xaf03('0x19a')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1e581b[_0xaf03('0x1a2')](0x0,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11c')]>=_0x42fb16['dialNoSuchNumberMaxRetry']){_0x1e581b['createStateFinal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a3'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a3'));}}break;case'3':_0x42fb16[_0xaf03('0x1a4')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x3;_0x577349[_0xaf03('0x6b')]='NoAnswer';_0x577349[_0xaf03('0x129')]+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;var _0x560441=ut['buildNoAnswerEventPayload'](_0x4ad292,_0x42fb16);ami[_0xaf03('0x119')](_0xaf03('0x1a5'),_0x560441);_0x30fb1b=_0x42fb16[_0xaf03('0x193')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)['catch'](loggerCatch(_0xaf03('0x1a6')));if(_0x1e581b[_0xaf03('0x1a2')](0x3,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x129')]>=_0x42fb16[_0xaf03('0x192')]){_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a7'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a7'));}}break;case'5':_0x42fb16[_0xaf03('0x1a8')]+=0x1;_0x577349['state']=0x5;_0x577349['statedesc']=_0xaf03('0x1a9');_0x577349[_0xaf03('0x11a')]+=0x1;_0x577349['countglobal']+=0x1;ami['emit'](_0xaf03('0x1aa'),ut[_0xaf03('0x110')](_0x4ad292,_0xaf03('0x1ab')));_0x30fb1b=_0x42fb16['dialBusyRetryFrequency'];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)[_0xaf03('0x9b')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1e581b[_0xaf03('0x1a2')](0x5,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349['countbusyretry']>=_0x42fb16[_0xaf03('0x195')]){_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1ac'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1ac'));}}break;case'8':_0x42fb16[_0xaf03('0x1ad')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x8;_0x577349['statedesc']=_0xaf03('0x1ae');_0x577349['countcongestionretry']+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;_0x30fb1b=_0x42fb16['dialCongestionRetryFrequency'];_0x523459=_0x42fb16[_0xaf03('0xe5')];ami['emit'](_0xaf03('0x1af'),ut['buildObj'](_0x4ad292,_0xaf03('0x1b0')));hopperUtils[_0xaf03('0xde')](_0x577349)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x1b1')));if(_0x1e581b['checkRetriveMax'](0x8,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11b')]>=_0x42fb16[_0xaf03('0x197')]){_0x1e581b['createStateFinal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b2'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b2'));}}break;case'11':_0x42fb16['outboundAbandonedCallsDay']+=0x1;_0x577349[_0xaf03('0x6a')]=0xb;_0x577349['statedesc']=_0xaf03('0xe2');_0x577349[_0xaf03('0xe4')]+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;_0x30fb1b=_0x42fb16[_0xaf03('0xe7')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils['createHistory'](_0x577349)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xe9')));if(_0x1e581b[_0xaf03('0x1a2')](0xb,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349['countabandonedretry']>=_0x42fb16[_0xaf03('0xe6')]){_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,'reason\x2011\x20abandoned');}else{_0x1e581b['stateGlobal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b3'));}}break;case'20':_0x42fb16[_0xaf03('0x1b4')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x14;_0x577349[_0xaf03('0x6b')]=_0xaf03('0x1b5');_0x577349[_0xaf03('0x11d')]+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;_0x30fb1b=_0x42fb16[_0xaf03('0x1b6')];_0x523459=_0x42fb16[_0xaf03('0xe5')];ami[_0xaf03('0x119')](_0xaf03('0x1b7'),ut[_0xaf03('0x110')](_0x4ad292,'agentreject'));hopperUtils['createHistory'](_0x577349)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x1b8')));if(_0x1e581b['checkRetriveMax'](0x14,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11d')]>=_0x42fb16[_0xaf03('0x19d')]){_0x1e581b['createStateFinal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b9'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b9'));}}break;default:_0x42fb16['outboundUnknownCallsDay']+=0x1;_0x577349[_0xaf03('0x6a')]=0xc;_0x577349['statedesc']=_0x1754a3['reason'];_0x30fb1b=_0x42fb16[_0xaf03('0x1b6')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)[_0xaf03('0x9b')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1e581b[_0xaf03('0x1a2')](_0x1754a3[_0xaf03('0xbf')],_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11a')]+_0x577349[_0xaf03('0x11b')]+_0x577349[_0xaf03('0x129')]+_0x577349[_0xaf03('0x11c')]+_0x577349[_0xaf03('0xd1')]+_0x577349[_0xaf03('0xe4')]+_0x577349[_0xaf03('0x116')]+_0x577349[_0xaf03('0x11d')]>=_0x42fb16[_0xaf03('0x11e')]){_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0x1754a3[_0xaf03('0xbf')]);}else{_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,_0x1754a3[_0xaf03('0xbf')]);}}}})[_0xaf03('0x3b')](function(){if(_0x24e124){hopperUtils[_0xaf03('0xe0')](_0x577349,_0x30fb1b,_0x523459)[_0xaf03('0x3b')](function(){return _0x419a93(0x1);});}});});};Dialer['prototype'][_0xaf03('0x11f')]=function(_0x9b8e20,_0x219b96,_0x39e1b2,_0x21cf9d){var _0x3c913f=new Final(_0x9b8e20);_0x3c913f[_0xaf03('0x6a')]=0xf;_0x3c913f[_0xaf03('0x6b')]=_0xaf03('0x1ba');this[_0xaf03('0x121')](_0x3c913f,_0x219b96,_0x39e1b2,_0x21cf9d);};Dialer[_0xaf03('0x18')][_0xaf03('0x121')]=function(_0x848f18,_0x670514,_0x8f612d,_0x3ba713){hopperUtils[_0xaf03('0x12d')](_0x848f18)[_0xaf03('0x3b')](function(){return _0x670514(msgResponse(_0xaf03('0x19e'),_0xaf03('0x1bb'),_0x3ba713));})[_0xaf03('0x9b')](function(){return _0x8f612d(msgResponse(_0xaf03('0x1bc'),'Failure',_0xaf03('0x1bd')));});};Dialer[_0xaf03('0x18')]['predictive']=function(_0x3e35e0){var _0x43994c=_0x3e35e0[_0xaf03('0x1be')]/0x64;var _0x31c04a=_0x3e35e0[_0xaf03('0xc8')]/(_0x3e35e0[_0xaf03('0xc8')]+_0x3e35e0[_0xaf03('0xbe')]);var _0x3bbc45=Math[_0xaf03('0x1bf')](_0x3e35e0[_0xaf03('0x1c0')]*(_0x3e35e0[_0xaf03('0x1c1')]/0x64));var _0x453443=Math['round'](_0x3e35e0[_0xaf03('0x1c0')]*(_0x3e35e0['predictiveIntervalMinThreshold']/0x64));var _0x137ece=_0x3e35e0[_0xaf03('0x138')]+_0x3e35e0[_0xaf03('0x13a')];var _0xc69add=Math[_0xaf03('0x1c2')](_0x3e35e0['erlangCalls']*_0x3e35e0[_0xaf03('0x57')]*_0x3e35e0['predictiveIntervalHitRate']*_0x3e35e0[_0xaf03('0x1c3')]);if(_[_0xaf03('0x50')](_0x3e35e0[_0xaf03('0x25')])){if(!_[_0xaf03('0x50')](_0x3e35e0[_0xaf03('0x24')])){_0x3e35e0[_0xaf03('0x24')]=undefined;loggerPredictive['error'](_0xaf03('0x1c4'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xaf03('0x50')](_0x3e35e0['handlePredictive'])){loggerPredictive[_0xaf03('0x5f')]('[startMethodPredictive][StartProgressive]',_0xaf03('0x1c5'));clearInterval(_0x3e35e0[_0xaf03('0x5d')]);_0x3e35e0[_0xaf03('0x5d')]=undefined;}_0x3e35e0[_0xaf03('0x25')]=moment()[_0xaf03('0x77')](_0xaf03('0xc2'));loggerPredictive[_0xaf03('0x45')](_0x3e35e0['name'],_0xaf03('0x1c6'),_0x3e35e0[_0xaf03('0x25')]);this[_0xaf03('0xaf')](_0x3e35e0,0x1);}else if(ifInterval(_0x3e35e0[_0xaf03('0x1c7')],_0x3e35e0[_0xaf03('0x25')])){this[_0xaf03('0xaf')](_0x3e35e0,0x1);loggerPredictiveCalls[_0xaf03('0x45')](_0xaf03('0x1c8'),_0x3e35e0['startProgressive'],_0x3e35e0['name']);_0x3e35e0['erlangCalls']=0x0;_0x3e35e0[_0xaf03('0xc9')]=0x0;}else if(_0x43994c<_0x31c04a&&_0x3e35e0[_0xaf03('0x1c9')]===_0xaf03('0x1ca')){clearPredictiveAttributes(_0x3e35e0);loggerPredictive[_0xaf03('0x45')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xaf03('0x1cb'),_0x31c04a,_0xaf03('0x25'),_0x3e35e0[_0xaf03('0x42')]);}else if(_0xc69add<_0x3e35e0[_0xaf03('0xc9')]&&_0x3e35e0[_0xaf03('0x1c9')]===_0xaf03('0x1ca')){clearPredictiveAttributes(_0x3e35e0);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x1cc'),_0xaf03('0x1cd'),_0xc69add,_0xaf03('0x1ce'),_0x3e35e0[_0xaf03('0xc9')],_0xaf03('0x25'),_0x3e35e0[_0xaf03('0x42')]);}else if(!ifInterval(_0x3e35e0[_0xaf03('0x1c7')],_0x3e35e0[_0xaf03('0x25')])&&_[_0xaf03('0x50')](_0x3e35e0[_0xaf03('0x24')])&&!_['isUndefined'](_0x3e35e0[_0xaf03('0x25')])){_0x3e35e0[_0xaf03('0x24')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1cf'),_0x3e35e0[_0xaf03('0x24')]);hopperUtils[_0xaf03('0x1d0')](_0x3e35e0['dialPredictiveInterval'])[_0xaf03('0x3b')](this['getDataPredictive'](_0x3e35e0))[_0xaf03('0x3b')](mergeDataErlangB(_0x3e35e0))['then'](this[_0xaf03('0x1d1')](_0x3e35e0))[_0xaf03('0x9b')](loggerCatchPredictive(_0xaf03('0x1d2'),_0x3e35e0));}else if(!ifInterval(_0x3e35e0[_0xaf03('0x1c7')],_0x3e35e0[_0xaf03('0x24')])){_0x3e35e0[_0xaf03('0xc9')]=0x0;_0x3e35e0[_0xaf03('0x24')]=moment()[_0xaf03('0x77')](_0xaf03('0xc2'));loggerPredictive[_0xaf03('0x45')](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1d3'),_0x3e35e0[_0xaf03('0x24')]);clearInterval(_0x3e35e0['handlePredictive']);_0x3e35e0[_0xaf03('0x5d')]=undefined;hopperUtils[_0xaf03('0x1d0')](_0x3e35e0[_0xaf03('0x1c7')])['then'](this[_0xaf03('0x1d4')](_0x3e35e0))['then'](mergeDataErlangB(_0x3e35e0))[_0xaf03('0x3b')](this['startMethodPredictive'](_0x3e35e0))[_0xaf03('0x9b')](loggerCatchPredictive(_0xaf03('0x1d5'),_0x3e35e0));}else if(_0x3e35e0['predictiveIntervalAvailable']&&_0x137ece<_0x3e35e0[_0xaf03('0x1c0')]-_0x453443){clearPredictiveAttributes(_0x3e35e0);loggerPredictive[_0xaf03('0x45')](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1d6'),_0x137ece,_0xaf03('0x1d7'),_0x3e35e0['predictiveIntervalAvailable'],'-',_0x453443,'=',_0x3e35e0[_0xaf03('0x1c0')]-_0x453443,')');}else if(_0x3e35e0[_0xaf03('0x1c0')]&&_0x137ece>_0x3e35e0[_0xaf03('0x1c0')]+_0x3bbc45){clearPredictiveAttributes(_0x3e35e0);loggerPredictive['info'](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1d6'),_0x137ece,_0xaf03('0x1d8'),_0x3e35e0[_0xaf03('0x1c0')],'+',_0x3bbc45,'=',_0x3e35e0[_0xaf03('0x1c0')]+_0x3bbc45,')');}};Dialer['prototype'][_0xaf03('0x1d4')]=function(_0x5cfacb){var _0x5c9d4d=this;return function(_0x15d4fe){return new Promise(function(_0x43afab,_0x2bf291){_[_0xaf03('0x5a')](_0x5cfacb,_0x15d4fe[0x0]);if(checkGetDataPredictive(_0x15d4fe[0x0])){var _0x5591c5=_0x5cfacb['predictiveIntervalAvailable']=_0x5cfacb[_0xaf03('0x13a')]+_0x5cfacb[_0xaf03('0x138')];var _0x2375b=_0x5cfacb['dialPredictiveInterval']*0x3c;var _0x49cd80=_0x15d4fe[0x0][_0xaf03('0x4e')]+_0x15d4fe[0x0][_0xaf03('0x4d')];var _0x200853=(_0x15d4fe[0x0][_0xaf03('0x48')]+_0x15d4fe[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x15d4fe[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x15d4fe[0x0][_0xaf03('0x47')];_0x5cfacb['predictiveIntervalHitRate']=_0x200853>0x0?_0x200853:0x1;switch(_0x5cfacb[_0xaf03('0x1c9')]){case _0xaf03('0x1ca'):var _0x549b5d=_0x5cfacb[_0xaf03('0x1be')]/0x64;return _0x5c9d4d['abandonmentRate'](_0x5591c5,_0x2375b,_0x49cd80,_0x200853,_0x549b5d)[_0xaf03('0x3b')](function(_0x4e9c0c){return _0x43afab(_0x4e9c0c);});case _0xaf03('0x1d9'):var _0x555a08=_0x5cfacb[_0xaf03('0x1be')]/0x64;return _0x5c9d4d[_0xaf03('0x1da')](_0x5591c5,_0x2375b,_0x49cd80,_0x200853,_0x555a08)[_0xaf03('0x3b')](function(_0x4bd559){return _0x43afab(_0x4bd559);});default:return _0x2bf291(msgResponse(_0xaf03('0x1db'),'Failure','Unknown\x20Predictive'));}}else{return _0x2bf291(msgResponse('[getDataPredictive]',_0xaf03('0x8c'),'check\x20failure'));}});};};Dialer[_0xaf03('0x18')][_0xaf03('0x1dc')]=function(_0x3763b7){var _0x53fe81=this;return function(_0x31ba03){return new Promise(function(_0x586138,_0x5abb80){_[_0xaf03('0x5a')](_0x3763b7,_0x31ba03[0x0]);if(checkGetDataPredictive(_0x31ba03[0x0])){loggerPredictive[_0xaf03('0x45')](JSON[_0xaf03('0x6e')](_0x31ba03[0x0]));if(_0x3763b7[_0xaf03('0x1c9')]===_0xaf03('0x1ca')){return _0x53fe81[_0xaf03('0x14e')](_0x3763b7['id'])[_0xaf03('0x3b')](function(_0xfa6e98){var _0x1eaaed=_0x3763b7['loggedIn']-_0xfa6e98[0x0][_0xaf03('0x1dd')];var _0x582aaa=_0x3763b7[_0xaf03('0x1c7')]*0x3c;var _0x48b60a=_0x31ba03[0x0][_0xaf03('0x4e')]+_0x31ba03[0x0][_0xaf03('0x4d')];var _0x4ea745=(_0x31ba03[0x0][_0xaf03('0x48')]+_0x31ba03[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x31ba03[0x0][_0xaf03('0x4b')])/_0x31ba03[0x0][_0xaf03('0x47')];var _0x486fdd=_0x3763b7[_0xaf03('0x1be')]/0x64;_0x3763b7[_0xaf03('0x1de')]=_0xfa6e98[0x0][_0xaf03('0x1dd')]||0x0;_0x3763b7[_0xaf03('0x1df')]=_0x4ea745>0x0?_0x4ea745:0x1;return _0x53fe81[_0xaf03('0x1e0')](_0x1eaaed,_0x582aaa,_0x48b60a,_0x4ea745,_0x486fdd);})[_0xaf03('0x3b')](function(_0x4188f9){return _0x586138(_0x4188f9);})[_0xaf03('0x9b')](function(_0x5843f7){return _0x5abb80(msgResponse('[CatchErlangB]','Failure',JSON[_0xaf03('0x6e')](_0x5843f7)));});}if(_0x3763b7[_0xaf03('0x1c9')]===_0xaf03('0x1d9')){return _0x53fe81[_0xaf03('0x14e')](_0x3763b7['id'])[_0xaf03('0x3b')](function(_0x17e927){var _0x48a7d4=_0x3763b7['loggedIn']-_0x17e927[0x0][_0xaf03('0x1dd')];var _0x4992de=_0x3763b7[_0xaf03('0x1c7')]*0x3c;var _0x37f5a3=_0x31ba03[0x0][_0xaf03('0x4e')]+_0x31ba03[0x0][_0xaf03('0x4d')];var _0x5195d6=(_0x31ba03[0x0][_0xaf03('0x48')]+_0x31ba03[0x0][_0xaf03('0x4a')]+_0x31ba03[0x0][_0xaf03('0x4b')])/_0x31ba03[0x0][_0xaf03('0x47')];var _0x27c859=_0x3763b7[_0xaf03('0x1be')]/0x64;_0x3763b7['predictiveIntervalPauses']=_0x17e927[0x0][_0xaf03('0x1dd')]||0x0;_0x3763b7[_0xaf03('0x1df')]=_0x5195d6>0x0?_0x5195d6:0x1;return _0x53fe81[_0xaf03('0x1da')](_0x48a7d4,_0x4992de,_0x37f5a3,_0x5195d6,_0x27c859);})[_0xaf03('0x3b')](function(_0x284257){return _0x586138(_0x284257);})[_0xaf03('0x9b')](function(_0xb34bfc){return _0x5abb80(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0xb34bfc)));});}}else{return _0x5abb80(msgResponse(_0xaf03('0x1db'),_0xaf03('0x8c'),_0xaf03('0x1e1')));}});};};Dialer[_0xaf03('0x18')][_0xaf03('0x1d1')]=function(_0x5a77b9){var _0x5b6d91=this;return function(){var _0xcfbdeb=0x0;var _0x2818d0=Math[_0xaf03('0x1c2')](_0x5a77b9['erlangCallToSecond']*0x3e8);if(_0x2818d0>0x0){_0x2818d0=_0x2818d0<0x64?0x64:_0x2818d0;loggerPredictive[_0xaf03('0x45')](_0x5a77b9['name'],_0xaf03('0x1e2'),_0x2818d0,_0xaf03('0x1e3'));_0x5a77b9['handlePredictive']=setInterval(function(){_0x5b6d91[_0xaf03('0x5d')](_0x5a77b9);loggerPredictiveCalls[_0xaf03('0x45')](_0xaf03('0x1e4'),_0xcfbdeb+=0x1);},_0x2818d0);}else{loggerPredictive[_0xaf03('0x45')](_0x5a77b9['name'],_0xaf03('0x1e5'));}};};Dialer['prototype'][_0xaf03('0x1e6')]=function(_0x2420f6,_0x28ff88){var _0xbbfad=this;return function(_0x5dea2d){if(_[_0xaf03('0x73')](_0x5dea2d)){if(_[_0xaf03('0xee')](_0x28ff88[_0xaf03('0x154')])||!_0x28ff88['recallme']){if(_0x2420f6[_0xaf03('0xac')]===_0xaf03('0x8')){_0x2420f6[_0xaf03('0x6f')]=_['isUndefined'](_0x2420f6[_0xaf03('0x6f')])?!![]:_0x2420f6[_0xaf03('0x6f')];var _0x221309=uuid['v4']();_0xbbfad[_0xaf03('0x21')][_0x221309]=new Action(_0x2420f6,_0x28ff88,_0x221309);loggerBooked[_0xaf03('0x45')](_0xaf03('0x1e7'),_0x221309,'queueStatusComplete:\x20',JSON[_0xaf03('0x6e')](_0x2420f6[_0xaf03('0x6f')]),_0xaf03('0x1e8'),_0x2420f6[_0xaf03('0x42')]);if(_0x2420f6[_0xaf03('0x6f')]){_0x2420f6[_0xaf03('0x6f')]=![];_0xbbfad['queueBooked'][_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xb8')]]=[];ami['Action']({'actionid':_0x221309,'action':_0xaf03('0x1e9'),'queue':_0x2420f6[_0xaf03('0x42')]})['catch'](function(){_0xbbfad[_0xaf03('0xbb')](_0x2420f6);hopperUtils[_0xaf03('0xd4')]({'active':![],'ContactId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd7')],'ListId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd8')],'VoiceQueueId':_0xbbfad['actions'][_0x221309][_0xaf03('0xd9')]||undefined,'CampaignId':_0xbbfad['actions'][_0x221309][_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xbbfad[_0xaf03('0x21')][_0x221309];});}else{loggerBooked[_0xaf03('0x45')](_0xaf03('0x1ea'),JSON['stringify'](_0x2420f6[_0xaf03('0x6f')]),_0xaf03('0x1e8'),_0x2420f6[_0xaf03('0x42')]);_0xbbfad['updateOriginated'](_0x2420f6);hopperUtils[_0xaf03('0xd4')]({'active':![],'ContactId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd7')],'ListId':_0xbbfad[_0xaf03('0x21')][_0x221309]['ListId'],'VoiceQueueId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd9')]||undefined,'CampaignId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0x1eb')));delete _0xbbfad[_0xaf03('0x21')][_0x221309];}}else{return _0xbbfad['actionOriginate'](_0x2420f6,_0x28ff88);}}else{if(utils['getSeconds'](undefined,_0x28ff88[_0xaf03('0x1ec')])<_0x2420f6[_0xaf03('0x1ed')]*0x3c){if(_0x28ff88[_0xaf03('0x146')]&&!_0x28ff88['Agent'][_0xaf03('0x1ee')]){_0xbbfad[_0xaf03('0xf7')][_0xaf03('0xf8')](_0x28ff88['id'])[_0xaf03('0x1a')](function(){_0xbbfad[_0xaf03('0xbb')](_0x2420f6);});}else{hopperUtils[_0xaf03('0x1ef')]({'active':![]},_0x28ff88['id'],0x1)[_0xaf03('0x1a')](function(){_0xbbfad['updateOriginated'](_0x2420f6);});}}else{_0x2420f6[_0xaf03('0x1f0')]+=0x1;_0xbbfad['updateOriginated'](_0x2420f6);if(_0x2420f6['dialRecallInQueue']){hopperUtils[_0xaf03('0xd4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28ff88['ContactId'],'ListId':_0x28ff88['ListId'],'VoiceQueueId':_0x28ff88[_0xaf03('0xd9')]||undefined,'CampaignId':_0x28ff88['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x1f1')));hopperUtils[_0xaf03('0xde')](createObjHistory(_0x2420f6,_0x28ff88,utils[_0xaf03('0x64')][_0xaf03('0x1f2')],0x17,'RecallInQueue'))[_0xaf03('0x9b')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xbbfad[_0xaf03('0x126')](createObjHistory(_0x2420f6,_0x28ff88,utils[_0xaf03('0x64')][_0xaf03('0x1f3')],0x16,'RecallFailedTimeout'),_0xaf03('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x2420f6[_0xaf03('0x1f5')]+=0x1;_0xbbfad[_0xaf03('0x126')](createObjHistory(_0x2420f6,_0x28ff88,utils[_0xaf03('0x64')][_0xaf03('0x1f6')],0xd,_0xaf03('0x1f7')),_0xaf03('0x1f8'),'[Originate][MoveBlacklist]');throw _0xaf03('0x1f9');}};};Dialer['prototype']['handleIvr']=function(_0x179e39){var _0x5bb534=this;var _0x165764=_0x179e39[_0xaf03('0x1fa')]-_0x179e39[_0xaf03('0x7a')]-_0x179e39[_0xaf03('0x1fb')];emitCampaignSummary(_0x179e39);if(_0x165764>0x0){if(_0x165764>this[_0xaf03('0x20')]){_0x165764=this['maxNumberOriginate'];}_0x179e39['temp']+=_0x165764;hopperUtils[_0xaf03('0x1fc')](_0x179e39['id'],_0x165764,_0x179e39['dialOrderByScheduledAt'],_0x179e39)[_0xaf03('0x3b')](function(_0x50df6c){_0x179e39['temp']-=_0x165764;_0x179e39['temp']=_0x179e39[_0xaf03('0x1fb')]>0x0?_0x179e39[_0xaf03('0x1fb')]:0x0;if(!utils['checkContactEmpty'](_0x50df6c)){_0x179e39['message']=utils['CAMPAIGN_STATUS'][_0xaf03('0x68')];logger[_0xaf03('0x45')]('[getContactCampaign2][Empty]'+_0x179e39['name']);}else{_0x179e39['originated']+=_0x50df6c[_0xaf03('0x94')];_0x179e39['message']=utils[_0xaf03('0x64')][_0xaf03('0x1fd')];for(var _0x4170e2=0x0;_0x4170e2<_0x50df6c[_0xaf03('0x94')];_0x4170e2+=0x1){_0x179e39['ivrTotalCallsDays']+=0x1;if(_[_0xaf03('0xee')](_0x50df6c[_0x4170e2])||_['isNil'](_0x50df6c[_0x4170e2]['Contact'])||_[_0xaf03('0xee')](_0x50df6c[_0x4170e2]['phone'])){_0x5bb534[_0xaf03('0x152')](_0xaf03('0x1fe'),_0x179e39,_0x50df6c[_0x4170e2]);}else{hopperUtils[_0xaf03('0x1ff')](_[_0xaf03('0xf2')](_0x50df6c[_0x4170e2],[_0xaf03('0xda'),_0xaf03('0x184')]))[_0xaf03('0x3b')](_0x5bb534[_0xaf03('0x1e6')](_0x179e39,_0x50df6c[_0x4170e2]))[_0xaf03('0x9b')](_0x5bb534['loggerHandler']('[actionOriginateIvr]\x20',_0x179e39));}}}})['catch'](loggerGetContactDialer(_0xaf03('0x200'),_0x179e39,_0x165764));}};Dialer[_0xaf03('0x18')][_0xaf03('0xaf')]=function(_0x1d0f2d,_0x28dc26){var _0x2d3fe5=this;var _0x4b983b=[];if(_0x28dc26<0x1||_0x1d0f2d[_0xaf03('0xac')]==='booked'){_0x28dc26=0x1;}var _0x2ba861=Math[_0xaf03('0x1c2')](_0x1d0f2d[_0xaf03('0x138')]*_0x28dc26)-_0x1d0f2d[_0xaf03('0x7a')]-_0x1d0f2d['temp'];if(_0x1d0f2d[_0xaf03('0x201')]>0x0){var _0x3630e2=_0x1d0f2d[_0xaf03('0x201')]-_0x1d0f2d[_0xaf03('0x7a')]-_0x1d0f2d[_0xaf03('0x13a')]-_0x1d0f2d['temp']-_0x1d0f2d[_0xaf03('0x13b')];if(_0x2ba861>_0x3630e2){_0x2ba861=_0x3630e2;}}if(_0x2ba861>0x0){if(_0x1d0f2d[_0xaf03('0xac')]===_0xaf03('0x8')){_0x2ba861=0x1;}if(_0x2ba861>this['maxNumberOriginate']){_0x2ba861=this[_0xaf03('0x20')];}_0x1d0f2d['temp']+=_0x2ba861;for(var _0x2a8d96 in this[_0xaf03('0x1e')]){if(typeof this['agents'][_0x2a8d96]!==_0xaf03('0xa5')){if(this[_0xaf03('0x1e')][_0x2a8d96]['state']===_0xaf03('0x202')&&this['agents'][_0x2a8d96][_0xaf03('0x83')]==='reachable'){_0x4b983b[_0xaf03('0x95')](this['agents'][_0x2a8d96]['id']);}}}hopperUtils[_0xaf03('0x203')](_0x1d0f2d,_0x4b983b,_0x2ba861)[_0xaf03('0x3b')](function(_0x22a40c){_0x1d0f2d[_0xaf03('0x1fb')]-=_0x2ba861;_0x1d0f2d[_0xaf03('0x1fb')]=_0x1d0f2d[_0xaf03('0x1fb')]>0x0?_0x1d0f2d['temp']:0x0;if(!utils[_0xaf03('0x204')](_0x22a40c)){hopperUtils[_0xaf03('0x205')](_0x1d0f2d)[_0xaf03('0x3b')](sendMessageReschedule(_0x1d0f2d))[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x206')));}else{_0x1d0f2d[_0xaf03('0x7a')]+=_0x22a40c['length'];_0x1d0f2d[_0xaf03('0x63')]=_0x1d0f2d[_0xaf03('0xac')]===_0xaf03('0x8')?utils[_0xaf03('0x64')][_0xaf03('0x13c')]:utils['CAMPAIGN_STATUS'][_0xaf03('0x1fd')];for(var _0x6d120=0x0;_0x6d120<_0x22a40c['length'];_0x6d120+=0x1){if(_[_0xaf03('0xee')](_0x22a40c[_0x6d120])||_[_0xaf03('0xee')](_0x22a40c[_0x6d120][_0xaf03('0x173')])||_['isNil'](_0x22a40c[_0x6d120][_0xaf03('0x184')])){_0x2d3fe5[_0xaf03('0x152')](_0xaf03('0x1fe'),_0x1d0f2d,_0x22a40c[_0x6d120]);}else{hopperUtils[_0xaf03('0x207')](_[_0xaf03('0xf2')](_0x22a40c[_0x6d120],[_0xaf03('0xd9'),_0xaf03('0x184')]))['then'](_0x2d3fe5[_0xaf03('0x1e6')](_0x1d0f2d,_0x22a40c[_0x6d120]))[_0xaf03('0x9b')](_0x2d3fe5[_0xaf03('0x208')](_0xaf03('0x1fe'),_0x1d0f2d));}}}})['catch'](loggerGetContactDialer(_0xaf03('0x209'),_0x1d0f2d,_0x2ba861));}};Dialer[_0xaf03('0x18')][_0xaf03('0x5d')]=function(_0x185277){if(_0x185277['dialLimitQueue']>0x0){var _0x2c6db6=_0x185277[_0xaf03('0x201')]-_0x185277[_0xaf03('0x7a')]-_0x185277[_0xaf03('0x13a')];if(_0x2c6db6>0x0){this['tryOriginatePredictive'](_0x185277);}else{loggerPredictiveCalls[_0xaf03('0x45')]('[handlePredictive][limitChannel]');}}else{this[_0xaf03('0x20a')](_0x185277);}};Dialer[_0xaf03('0x18')]['tryOriginatePredictive']=function(_0xf245){var _0x36adbd=this;var _0x258c2a=[];_0xf245[_0xaf03('0x7a')]+=0x1;for(var _0x54cb03 in this[_0xaf03('0x1e')]){if(typeof this['agents'][_0x54cb03]!==_0xaf03('0xa5')){if(this[_0xaf03('0x1e')][_0x54cb03][_0xaf03('0x6a')]===_0xaf03('0x202')&&this[_0xaf03('0x1e')][_0x54cb03][_0xaf03('0x83')]===_0xaf03('0x84')){_0x258c2a['push'](this[_0xaf03('0x1e')][_0x54cb03]['id']);}}}return this[_0xaf03('0x203')](_0xf245['id'],_0x258c2a,0x1,_0xf245[_0xaf03('0x20b')],_0xf245)['then'](function(_0x5dbd7){if(!utils[_0xaf03('0x204')](_0x5dbd7)){utils[_0xaf03('0x61')](_0xf245,0x1,0x0);return hopperUtils[_0xaf03('0x205')](_0xf245)[_0xaf03('0x3b')](sendMessageReschedule(_0xf245))['catch'](loggerCatch(_0xaf03('0x206')));}else{_0xf245[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x1fd')];if(_[_0xaf03('0xee')](_0x5dbd7[0x0])||_[_0xaf03('0xee')](_0x5dbd7[0x0][_0xaf03('0x173')])||_[_0xaf03('0xee')](_0x5dbd7[0x0]['phone'])){_0x36adbd['emptyContact'](_0xaf03('0x1fe'),_0xf245,_0x5dbd7[0x0]);}else{return hopperUtils[_0xaf03('0x207')](_[_0xaf03('0xf2')](_0x5dbd7[0x0],[_0xaf03('0xd9'),_0xaf03('0x184')]))[_0xaf03('0x3b')](_0x36adbd['checkContactBlack'](_0xf245,_0x5dbd7[0x0]))[_0xaf03('0x9b')](_0x36adbd[_0xaf03('0x208')](_0xaf03('0x20c'),_0xf245));}}})[_0xaf03('0x9b')](loggerGetContactDialer(_0xaf03('0x20d'),_0xf245,0x1));};Dialer['prototype'][_0xaf03('0x1e0')]=function(_0x35f47e,_0x5e7942,_0x240788,_0x3bb409,_0x583abd,_0x5c89be){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xaf03('0x45')]('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',_0x35f47e);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20e'),_0x5e7942);loggerPredictive[_0xaf03('0x45')]('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',_0x240788);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20f'),_0x3bb409);loggerPredictive[_0xaf03('0x45')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x583abd);loggerPredictive[_0xaf03('0x45')]('---------------------------');return new Promise(function(_0x528b33,_0x5b02a3){if(_0x35f47e<=0x0||isNaN(_0x35f47e)){return _0x5b02a3(msgResponse('[abandonmentRate]',_0xaf03('0x7f'),'m\x20=\x20'+_0x35f47e));}if(_0x240788<=0x0||isNaN(_0x240788)){return _0x5b02a3(msgResponse(_0xaf03('0x210'),_0xaf03('0x7f'),_0xaf03('0x211')+_0x240788));}if(_0x3bb409<=0x0||isNaN(_0x3bb409)){return _0x5b02a3(msgResponse('[abandonmentRate]',_0xaf03('0x7f'),'p\x20=\x20'+_0x3bb409));}if(_0x5e7942<=0x0||isNaN(_0x5e7942)){return _0x5b02a3(msgResponse(_0xaf03('0x210'),_0xaf03('0x7f'),_0xaf03('0x212')+_0x5e7942));}if(_0x583abd<=0x0||isNaN(_0x583abd)){return _0x5b02a3(msgResponse(_0xaf03('0x210'),_0xaf03('0x7f'),'Amax\x20=\x20'+_0x583abd));}_0x5c89be=_0x5c89be||0x0;var _0x2065de=0x1/_0x240788;var _0x323de1=0x0;var _0x754ea0=0x0;var _0x5aa2d3=0x0;var _0x363590=0x0;for(var _0x43f8d3=0x0;_0x5aa2d3<_0x583abd;_0x43f8d3+=0x1){_0x754ea0=_0x43f8d3/_0x5e7942;_0x323de1=(_0x3bb409*_0x754ea0+_0x5c89be)/_0x2065de;_0x5aa2d3=utils[_0xaf03('0x213')](_0x323de1,_0x35f47e);_0x363590=_0x323de1/_0x35f47e*(0x1-utils[_0xaf03('0x213')](_0x323de1,_0x35f47e));}return _0x528b33({'erlangCalls':_0x43f8d3,'erlangCallToSecond':_0x5e7942/_0x43f8d3,'erlangAbandonmentRate':_0x5aa2d3,'erlangBusyFactor':_0x363590});});};Dialer[_0xaf03('0x18')]['busyFactor']=function(_0xcc8c33,_0x36e8f0,_0xabda20,_0x4ddc00,_0x4bf6d2,_0x35c849){loggerPredictive[_0xaf03('0x45')](_0xaf03('0x214'));loggerPredictive[_0xaf03('0x45')](_0xaf03('0x215'),_0xcc8c33);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20e'),_0x36e8f0);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x216'),_0xabda20);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20f'),_0x4ddc00);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x217'),_0x4bf6d2);loggerPredictive['info'](_0xaf03('0x59'));return new Promise(function(_0x45ec93,_0xf8ae1f){if(_0xcc8c33<=0x0||isNaN(_0xcc8c33)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),_0xaf03('0x7f'),_0xaf03('0x219')+_0xcc8c33));}if(_0xabda20<=0x0||isNaN(_0xabda20)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),'Error',_0xaf03('0x211')+_0xabda20));}if(_0x4ddc00<=0x0||isNaN(_0x4ddc00)){return _0xf8ae1f(msgResponse('[busyFactor]','Error',_0xaf03('0x21a')+_0x4ddc00));}if(_0x36e8f0<=0x0||isNaN(_0x36e8f0)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),_0xaf03('0x7f'),_0xaf03('0x212')+_0x36e8f0));}if(_0x4bf6d2<=0x0||isNaN(_0x4bf6d2)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),_0xaf03('0x7f'),_0xaf03('0x21b')+_0x4bf6d2));}_0x35c849=_0x35c849||0x0;var _0x2af976=0x1/_0xabda20;var _0x3bd627=0x0;var _0xf806d7=0x0;var _0xef245a=0x0;var _0x223623=0x0;for(var _0x18ac2b=0x0;_0x223623<_0x4bf6d2;_0x18ac2b+=0x1){_0xf806d7=_0x18ac2b/_0x36e8f0;_0x3bd627=(_0x4ddc00*_0xf806d7+_0x35c849)/_0x2af976;_0xef245a=utils[_0xaf03('0x213')](_0x3bd627,_0xcc8c33);_0x223623=_0x3bd627/_0xcc8c33*(0x1-utils[_0xaf03('0x213')](_0x3bd627,_0xcc8c33));}return _0x45ec93({'erlangCalls':_0x18ac2b,'erlangCallToSecond':_0x36e8f0/_0x18ac2b,'erlangAbandonmentRate':_0xef245a,'erlangBusyFactor':_0x223623});});};module[_0xaf03('0x21c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 745094a..445f82d 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde74=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x253637,_0x477072){var _0x9ba9d8=function(_0x2cf672){while(--_0x2cf672){_0x253637['push'](_0x253637['shift']());}};_0x9ba9d8(++_0x477072);}(_0xde74,0x1e5));var _0x4de7=function(_0x472546,_0x43c4f3){_0x472546=_0x472546-0x0;var _0x1b178a=_0xde74[_0x472546];return _0x1b178a;};'use strict';var util=require(_0x4de7('0x0'));var _=require(_0x4de7('0x1'));var moment=require(_0x4de7('0x2'));function checkNameSurname(_0x3cc03d,_0x5d2c29,_0x863bb8){var _0x4e5ff0='';if(!_[_0x4de7('0x3')](_0x5d2c29)&&_0x4de7('0x4')===typeof _0x5d2c29){_0x4e5ff0+=_0x5d2c29;}if(!_['isNil'](_0x863bb8)&&_0x4de7('0x4')===typeof _0x863bb8){_0x4e5ff0+='\x20'+_0x863bb8;}if(_0x4e5ff0!==''){return _0x4e5ff0;}return _0x3cc03d;}function Action(_0x334131,_0x2b949d,_0x1ab94b){this[_0x4de7('0x5')]=_0x334131;this[_0x4de7('0x6')]=_0x1ab94b||undefined;this[_0x4de7('0x7')]=checkNameSurname(_0x2b949d['Contact'][_0x4de7('0x8')],_0x2b949d['Contact'][_0x4de7('0x9')],_0x2b949d['Contact'][_0x4de7('0xa')]);this[_0x4de7('0xb')]=_0x2b949d[_0x4de7('0x8')];this[_0x4de7('0xc')]=_0x334131[_0x4de7('0x7')];this['active']=_0x2b949d[_0x4de7('0xd')]||![];this[_0x4de7('0xe')]=_0x334131[_0x4de7('0xe')];this['dialQueueTimeout']=_0x334131[_0x4de7('0xf')]||0x3;this[_0x4de7('0x10')]=_0x2b949d[_0x4de7('0x10')];this[_0x4de7('0x11')]=_0x2b949d['countbusyretry'];this[_0x4de7('0x12')]=_0x2b949d['countcongestionretry'];this[_0x4de7('0x13')]=_0x2b949d[_0x4de7('0x13')];this[_0x4de7('0x14')]=_0x2b949d['countnosuchnumberretry'];this['countdropretry']=_0x2b949d['countdropretry'];this[_0x4de7('0x15')]=_0x2b949d[_0x4de7('0x15')];this[_0x4de7('0x16')]=_0x2b949d['countmachineretry'];this[_0x4de7('0x17')]=_0x2b949d[_0x4de7('0x17')];this[_0x4de7('0x18')]=_0x2b949d[_0x4de7('0x18')];this[_0x4de7('0x19')]=_0x2b949d[_0x4de7('0x19')];this[_0x4de7('0x1a')]=_0x2b949d[_0x4de7('0x1a')];this[_0x4de7('0x1b')]=_0x2b949d[_0x4de7('0x1b')];this[_0x4de7('0x1c')]=_0x2b949d[_0x4de7('0x1c')];this['idHopper']=_0x2b949d['id'];this['ContactFirstName']=_0x2b949d['Contact'][_0x4de7('0x9')]||'';this['starttime']=moment()[_0x4de7('0x1d')](_0x4de7('0x1e'));this[_0x4de7('0x1f')]=_0x2b949d[_0x4de7('0x1f')];this[_0x4de7('0x20')]=_0x2b949d[_0x4de7('0x20')];this[_0x4de7('0x21')]=_0x2b949d[_0x4de7('0x21')];this[_0x4de7('0x22')]=_0x2b949d[_0x4de7('0x22')];this[_0x4de7('0x23')]='';this[_0x4de7('0x24')]='';}Action[_0x4de7('0x25')][_0x4de7('0x26')]=function(){return util['format'](_0x4de7('0x27'),this[_0x4de7('0x7')],this['voiceQueue'][_0x4de7('0x28')]>0x0?this[_0x4de7('0xb')][_0x4de7('0x29')](this[_0x4de7('0x5')][_0x4de7('0x28')]):this[_0x4de7('0xb')]);};Action[_0x4de7('0x25')][_0x4de7('0x2a')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x7cad=['format','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime'];(function(_0x4aa83b,_0xa90f1b){var _0xedff0b=function(_0x14bc57){while(--_0x14bc57){_0x4aa83b['push'](_0x4aa83b['shift']());}};_0xedff0b(++_0xa90f1b);}(_0x7cad,0x131));var _0xd7ca=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x7cad[_0x32f7d7];return _0x133d09;};'use strict';var util=require(_0xd7ca('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4feb07,_0x24ae77,_0x124eb8){var _0x2a58cf='';if(!_[_0xd7ca('0x1')](_0x24ae77)&&_0xd7ca('0x2')===typeof _0x24ae77){_0x2a58cf+=_0x24ae77;}if(!_[_0xd7ca('0x1')](_0x124eb8)&&_0xd7ca('0x2')===typeof _0x124eb8){_0x2a58cf+='\x20'+_0x124eb8;}if(_0x2a58cf!==''){return _0x2a58cf;}return _0x4feb07;}function Action(_0x20e073,_0x31bee9,_0x1eb2d3){this[_0xd7ca('0x3')]=_0x20e073;this['uniqueid']=_0x1eb2d3||undefined;this[_0xd7ca('0x4')]=checkNameSurname(_0x31bee9[_0xd7ca('0x5')]['phone'],_0x31bee9[_0xd7ca('0x5')][_0xd7ca('0x6')],_0x31bee9[_0xd7ca('0x5')][_0xd7ca('0x7')]);this[_0xd7ca('0x8')]=_0x31bee9[_0xd7ca('0x9')];this[_0xd7ca('0xa')]=_0x20e073['name'];this[_0xd7ca('0xb')]=_0x31bee9['active']||![];this['type']=_0x20e073[_0xd7ca('0xc')];this[_0xd7ca('0xd')]=_0x20e073[_0xd7ca('0xd')]||0x3;this[_0xd7ca('0xe')]=_0x31bee9[_0xd7ca('0xe')];this[_0xd7ca('0xf')]=_0x31bee9[_0xd7ca('0xf')];this[_0xd7ca('0x10')]=_0x31bee9[_0xd7ca('0x10')];this[_0xd7ca('0x11')]=_0x31bee9[_0xd7ca('0x11')];this[_0xd7ca('0x12')]=_0x31bee9['countnosuchnumberretry'];this[_0xd7ca('0x13')]=_0x31bee9[_0xd7ca('0x13')];this[_0xd7ca('0x14')]=_0x31bee9['countabandonedretry'];this['countmachineretry']=_0x31bee9[_0xd7ca('0x15')];this[_0xd7ca('0x16')]=_0x31bee9[_0xd7ca('0x16')];this[_0xd7ca('0x17')]=_0x31bee9['ContactId'];this[_0xd7ca('0x18')]=_0x31bee9[_0xd7ca('0x18')];this['UserId']=_0x31bee9[_0xd7ca('0x19')];this[_0xd7ca('0x1a')]=_0x31bee9[_0xd7ca('0x1a')];this[_0xd7ca('0x1b')]=_0x31bee9['CampaignId'];this[_0xd7ca('0x1c')]=_0x31bee9['id'];this[_0xd7ca('0x1d')]=_0x31bee9[_0xd7ca('0x5')][_0xd7ca('0x6')]||'';this[_0xd7ca('0x1e')]=moment()[_0xd7ca('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x31bee9[_0xd7ca('0x20')];this[_0xd7ca('0x21')]=_0x31bee9[_0xd7ca('0x21')];this[_0xd7ca('0x22')]=_0x31bee9['callbackat'];this['recallme']=_0x31bee9[_0xd7ca('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xd7ca('0x24')]['getCaller']=function(){return util[_0xd7ca('0x1f')](_0xd7ca('0x25'),this['name'],this['voiceQueue'][_0xd7ca('0x26')]>0x0?this[_0xd7ca('0x8')][_0xd7ca('0x27')](this[_0xd7ca('0x3')][_0xd7ca('0x26')]):this[_0xd7ca('0x8')]);};Action['prototype'][_0xd7ca('0x28')]=function(){return this['queue'];};module[_0xd7ca('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index bea1c3c..4e8d8fc 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b72=['reason','callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','ringtime','getSeconds','holdtime','membername'];(function(_0x24bcad,_0x32e3a0){var _0x3d1f9d=function(_0x19724f){while(--_0x19724f){_0x24bcad['push'](_0x24bcad['shift']());}};_0x3d1f9d(++_0x32e3a0);}(_0x9b72,0x1b0));var _0x29b7=function(_0x275f92,_0xf6eb4c){_0x275f92=_0x275f92-0x0;var _0x51556=_0x9b72[_0x275f92];return _0x51556;};'use strict';var moment=require(_0x29b7('0x0'));var utils=require(_0x29b7('0x1'));function AgentComplete(_0x126257,_0x39b523){this[_0x29b7('0x2')]=0x4;this[_0x29b7('0x3')]=_0x29b7('0x4');this[_0x29b7('0x5')]=_0x126257[_0x29b7('0x5')];this[_0x29b7('0x6')]=_0x126257[_0x29b7('0x6')];this[_0x29b7('0x7')]=_0x126257['type']==='outbound'?_0x29b7('0x8'):_0x126257[_0x29b7('0x6')];this[_0x29b7('0x9')]=_0x126257[_0x29b7('0x9')];this['countcongestionretry']=_0x126257[_0x29b7('0xa')];this[_0x29b7('0xb')]=_0x126257[_0x29b7('0xb')];this[_0x29b7('0xc')]=_0x126257[_0x29b7('0x9')]+_0x126257[_0x29b7('0xa')]+_0x126257['countnoanswerretry']+_0x126257[_0x29b7('0xd')]+_0x126257['countdropretry']+_0x126257['countabandonedretry']+_0x126257['countmachineretry']+_0x126257['countagentrejectretry'];this[_0x29b7('0xd')]=_0x126257['countnosuchnumberretry'];this[_0x29b7('0xe')]=_0x126257['countdropretry'];this[_0x29b7('0xf')]=_0x126257[_0x29b7('0xf')];this[_0x29b7('0x10')]=_0x126257[_0x29b7('0x10')];this[_0x29b7('0x11')]=_0x126257[_0x29b7('0x11')];this[_0x29b7('0x12')]=_0x39b523[_0x29b7('0x12')];this[_0x29b7('0x13')]=_0x126257[_0x29b7('0x14')];this['calleridnum']=_0x126257[_0x29b7('0x15')];this[_0x29b7('0x16')]=_0x126257[_0x29b7('0x16')];this[_0x29b7('0x17')]=_0x126257[_0x29b7('0x17')];this[_0x29b7('0x18')]=_0x126257[_0x29b7('0x18')];this[_0x29b7('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x29b7('0x1a')]=utils[_0x29b7('0x1b')](_0x126257[_0x29b7('0x17')],_0x126257[_0x29b7('0x16')]);this[_0x29b7('0x1c')]=utils[_0x29b7('0x1b')](_0x126257[_0x29b7('0x18')],_0x126257[_0x29b7('0x17')]);this['talktime']=utils[_0x29b7('0x1b')](this[_0x29b7('0x19')],_0x126257[_0x29b7('0x18')]);this[_0x29b7('0x8')]=_0x39b523[_0x29b7('0x8')];this[_0x29b7('0x1d')]=_0x39b523[_0x29b7('0x1d')];this[_0x29b7('0x1e')]=_0x39b523['reason'];this[_0x29b7('0x1f')]=_0x126257['callback'];this[_0x29b7('0x20')]=_0x126257[_0x29b7('0x20')];this[_0x29b7('0x21')]=_0x126257[_0x29b7('0x21')];this['recallme']=_0x126257['recallme'];this['ContactId']=_0x126257[_0x29b7('0x22')];this['ListId']=_0x126257['ListId'];this[_0x29b7('0x23')]=_0x126257[_0x29b7('0x23')];this[_0x29b7('0x24')]=_0x126257[_0x29b7('0x24')];this['CampaignId']=_0x126257[_0x29b7('0x25')];this[_0x29b7('0x26')]=_0x126257['originatecalleridnum']||'';this[_0x29b7('0x27')]=_0x126257[_0x29b7('0x27')]||'';this[_0x29b7('0x28')]=_0x126257[_0x29b7('0x28')];}module[_0x29b7('0x29')]=AgentComplete; \ No newline at end of file +var _0x13dc=['state','statedesc','Answer','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','agiafterat','moment','../utils'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x13dc,0x100));var _0xc13d=function(_0x4962fc,_0x13dd8e){_0x4962fc=_0x4962fc-0x0;var _0x45cd28=_0x13dc[_0x4962fc];return _0x45cd28;};'use strict';var moment=require(_0xc13d('0x0'));var utils=require(_0xc13d('0x1'));function AgentComplete(_0x18eece,_0x4811bf){this[_0xc13d('0x2')]=0x4;this[_0xc13d('0x3')]=_0xc13d('0x4');this['scheduledat']=_0x18eece['scheduledat'];this['type']=_0x18eece[_0xc13d('0x5')];this[_0xc13d('0x6')]=_0x18eece[_0xc13d('0x5')]===_0xc13d('0x7')?_0xc13d('0x8'):_0x18eece[_0xc13d('0x5')];this['countbusyretry']=_0x18eece['countbusyretry'];this[_0xc13d('0x9')]=_0x18eece[_0xc13d('0x9')];this['countnoanswerretry']=_0x18eece[_0xc13d('0xa')];this[_0xc13d('0xb')]=_0x18eece['countbusyretry']+_0x18eece['countcongestionretry']+_0x18eece[_0xc13d('0xa')]+_0x18eece[_0xc13d('0xc')]+_0x18eece[_0xc13d('0xd')]+_0x18eece[_0xc13d('0xe')]+_0x18eece[_0xc13d('0xf')]+_0x18eece[_0xc13d('0x10')];this['countnosuchnumberretry']=_0x18eece['countnosuchnumberretry'];this[_0xc13d('0xd')]=_0x18eece[_0xc13d('0xd')];this['countabandonedretry']=_0x18eece[_0xc13d('0xe')];this[_0xc13d('0xf')]=_0x18eece[_0xc13d('0xf')];this[_0xc13d('0x10')]=_0x18eece['countagentrejectretry'];this[_0xc13d('0x11')]=_0x4811bf[_0xc13d('0x11')];this[_0xc13d('0x12')]=_0x18eece[_0xc13d('0x13')];this[_0xc13d('0x14')]=_0x18eece[_0xc13d('0x15')];this[_0xc13d('0x16')]=_0x18eece['starttime'];this[_0xc13d('0x17')]=_0x18eece[_0xc13d('0x17')];this[_0xc13d('0x18')]=_0x18eece[_0xc13d('0x18')];this[_0xc13d('0x19')]=moment()[_0xc13d('0x1a')](_0xc13d('0x1b'));this[_0xc13d('0x1c')]=utils[_0xc13d('0x1d')](_0x18eece[_0xc13d('0x17')],_0x18eece['starttime']);this[_0xc13d('0x1e')]=utils[_0xc13d('0x1d')](_0x18eece[_0xc13d('0x18')],_0x18eece[_0xc13d('0x17')]);this[_0xc13d('0x1f')]=utils['getSeconds'](this[_0xc13d('0x19')],_0x18eece[_0xc13d('0x18')]);this[_0xc13d('0x8')]=_0x4811bf['queue'];this[_0xc13d('0x20')]=_0x4811bf[_0xc13d('0x20')];this[_0xc13d('0x21')]=_0x4811bf[_0xc13d('0x21')];this[_0xc13d('0x22')]=_0x18eece[_0xc13d('0x22')];this['callbackuniqueid']=_0x18eece['callbackuniqueid'];this[_0xc13d('0x23')]=_0x18eece[_0xc13d('0x23')];this[_0xc13d('0x24')]=_0x18eece[_0xc13d('0x24')];this[_0xc13d('0x25')]=_0x18eece[_0xc13d('0x25')];this[_0xc13d('0x26')]=_0x18eece['ListId'];this[_0xc13d('0x27')]=_0x18eece[_0xc13d('0x27')];this[_0xc13d('0x28')]=_0x18eece[_0xc13d('0x28')];this['CampaignId']=_0x18eece['CampaignId'];this['originatecalleridnum']=_0x18eece['originatecalleridnum']||'';this[_0xc13d('0x29')]=_0x18eece[_0xc13d('0x29')]||'';this[_0xc13d('0x2a')]=_0x18eece[_0xc13d('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index f4cf2d8..d1d3524 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba14=['exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','state','statedesc'];(function(_0x1e6d65,_0x4e0538){var _0x2a3119=function(_0x2babc5){while(--_0x2babc5){_0x1e6d65['push'](_0x1e6d65['shift']());}};_0x2a3119(++_0x4e0538);}(_0xba14,0x15f));var _0x4ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba14[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x34016a){this[_0x4ba1('0x0')]=_0x34016a[_0x4ba1('0x0')];this[_0x4ba1('0x1')]=_0x34016a['scheduledat'];this[_0x4ba1('0x2')]=_0x34016a[_0x4ba1('0x2')];this[_0x4ba1('0x3')]=_0x34016a[_0x4ba1('0x2')]===_0x4ba1('0x4')?_0x4ba1('0x5'):_0x34016a['type'];this[_0x4ba1('0x6')]=_0x34016a[_0x4ba1('0x6')];this[_0x4ba1('0x7')]=_0x34016a['countcongestionretry'];this[_0x4ba1('0x8')]=_0x34016a[_0x4ba1('0x8')];this[_0x4ba1('0x9')]=_0x34016a[_0x4ba1('0x6')]+_0x34016a[_0x4ba1('0x7')]+_0x34016a['countnoanswerretry']+_0x34016a['countnosuchnumberretry']+_0x34016a[_0x4ba1('0xa')]+_0x34016a[_0x4ba1('0xb')]+_0x34016a[_0x4ba1('0xc')]+_0x34016a[_0x4ba1('0xd')];this[_0x4ba1('0xe')]=_0x34016a['countnosuchnumberretry'];this['countdropretry']=_0x34016a[_0x4ba1('0xa')];this['countabandonedretry']=_0x34016a[_0x4ba1('0xb')];this[_0x4ba1('0xc')]=_0x34016a[_0x4ba1('0xc')];this['countagentrejectretry']=_0x34016a[_0x4ba1('0xd')];this[_0x4ba1('0x5')]=_0x34016a[_0x4ba1('0x5')];this['calleridname']=_0x34016a[_0x4ba1('0xf')];this['calleridnum']=_0x34016a[_0x4ba1('0x10')];this[_0x4ba1('0x11')]=_0x34016a[_0x4ba1('0x11')];this[_0x4ba1('0x12')]=_0x34016a[_0x4ba1('0x12')];this[_0x4ba1('0x13')]=_0x34016a[_0x4ba1('0x12')];this[_0x4ba1('0x14')]=_0x34016a[_0x4ba1('0x14')]||0x0;this['holdtime']=_0x34016a[_0x4ba1('0x15')]||0x0;this[_0x4ba1('0x16')]=_0x34016a[_0x4ba1('0x16')]||0x0;this[_0x4ba1('0x17')]=_0x34016a['callback'];this[_0x4ba1('0x18')]=_0x34016a[_0x4ba1('0x18')];this[_0x4ba1('0x19')]=_0x34016a[_0x4ba1('0x19')];this['recallme']=_0x34016a[_0x4ba1('0x1a')];this[_0x4ba1('0x1b')]=_0x34016a[_0x4ba1('0x1b')];this['ListId']=_0x34016a[_0x4ba1('0x1c')];this[_0x4ba1('0x1d')]=_0x34016a[_0x4ba1('0x1d')];this[_0x4ba1('0x1e')]=_0x34016a[_0x4ba1('0x1e')];this['CampaignId']=_0x34016a['CampaignId'];this['originatecalleridnum']=_0x34016a['originatecalleridnum']||'';this[_0x4ba1('0x1f')]=_0x34016a['originatecalleridname']||'';this['state']=_0x34016a[_0x4ba1('0x20')];this[_0x4ba1('0x21')]=_0x34016a[_0x4ba1('0x21')];}module[_0x4ba1('0x22')]=Final; \ No newline at end of file +var _0x820d=['countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x820d,0x1c8));var _0xd820=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x820d[_0x5783f4];return _0x28e380;};'use strict';function Final(_0x182785){this[_0xd820('0x0')]=_0x182785[_0xd820('0x0')];this['scheduledat']=_0x182785[_0xd820('0x1')];this[_0xd820('0x2')]=_0x182785[_0xd820('0x2')];this[_0xd820('0x3')]=_0x182785[_0xd820('0x2')]===_0xd820('0x4')?'queue':_0x182785['type'];this[_0xd820('0x5')]=_0x182785[_0xd820('0x5')];this['countcongestionretry']=_0x182785[_0xd820('0x6')];this[_0xd820('0x7')]=_0x182785[_0xd820('0x7')];this[_0xd820('0x8')]=_0x182785[_0xd820('0x5')]+_0x182785[_0xd820('0x6')]+_0x182785['countnoanswerretry']+_0x182785[_0xd820('0x9')]+_0x182785[_0xd820('0xa')]+_0x182785[_0xd820('0xb')]+_0x182785[_0xd820('0xc')]+_0x182785[_0xd820('0xd')];this[_0xd820('0x9')]=_0x182785['countnosuchnumberretry'];this[_0xd820('0xa')]=_0x182785['countdropretry'];this[_0xd820('0xb')]=_0x182785['countabandonedretry'];this[_0xd820('0xc')]=_0x182785[_0xd820('0xc')];this['countagentrejectretry']=_0x182785['countagentrejectretry'];this[_0xd820('0xe')]=_0x182785[_0xd820('0xe')];this[_0xd820('0xf')]=_0x182785[_0xd820('0xf')];this['calleridnum']=_0x182785[_0xd820('0x10')];this[_0xd820('0x11')]=_0x182785[_0xd820('0x11')];this[_0xd820('0x12')]=_0x182785[_0xd820('0x12')];this[_0xd820('0x13')]=_0x182785[_0xd820('0x12')];this[_0xd820('0x14')]=_0x182785[_0xd820('0x14')]||0x0;this[_0xd820('0x15')]=_0x182785[_0xd820('0x15')]||0x0;this['talktime']=_0x182785[_0xd820('0x16')]||0x0;this[_0xd820('0x17')]=_0x182785['callback'];this['callbackuniqueid']=_0x182785[_0xd820('0x18')];this[_0xd820('0x19')]=_0x182785[_0xd820('0x19')];this['recallme']=_0x182785[_0xd820('0x1a')];this[_0xd820('0x1b')]=_0x182785[_0xd820('0x1b')];this[_0xd820('0x1c')]=_0x182785[_0xd820('0x1c')];this[_0xd820('0x1d')]=_0x182785[_0xd820('0x1d')];this[_0xd820('0x1e')]=_0x182785['VoiceQueueId'];this['CampaignId']=_0x182785[_0xd820('0x1f')];this['originatecalleridnum']=_0x182785['originatecalleridnum']||'';this[_0xd820('0x20')]=_0x182785[_0xd820('0x20')]||'';this['state']=_0x182785[_0xd820('0x21')];this[_0xd820('0x22')]=_0x182785[_0xd820('0x22')];}module[_0xd820('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index f3edf55..02de7a1 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7444=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','statedesc','Answer','scheduledat','type','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','queue','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7444,0x178));var _0x4744=function(_0x347a5b,_0x661844){_0x347a5b=_0x347a5b-0x0;var _0x3498a3=_0x7444[_0x347a5b];return _0x3498a3;};'use strict';var moment=require('moment');var utils=require(_0x4744('0x0'));function Hangup(_0x14f595,_0x11af27){this[_0x4744('0x1')]=0x4;this[_0x4744('0x2')]=_0x4744('0x3');this['scheduledat']=_0x14f595[_0x4744('0x4')];this[_0x4744('0x5')]=_0x14f595[_0x4744('0x5')];this['campaigntype']=_0x14f595[_0x4744('0x5')]===_0x4744('0x6')?'queue':_0x14f595[_0x4744('0x5')];this[_0x4744('0x7')]=_0x14f595[_0x4744('0x7')]||![];this[_0x4744('0x8')]=_0x14f595['countbusyretry'];this[_0x4744('0x9')]=_0x14f595[_0x4744('0x9')];this[_0x4744('0xa')]=_0x14f595[_0x4744('0xa')];this['countglobal']=_0x14f595[_0x4744('0x8')]+_0x14f595[_0x4744('0x9')]+_0x14f595[_0x4744('0xa')]+_0x14f595[_0x4744('0xb')]+_0x14f595[_0x4744('0xc')]+_0x14f595[_0x4744('0xd')]+_0x14f595[_0x4744('0xe')]+_0x14f595[_0x4744('0xf')];this[_0x4744('0xb')]=_0x14f595[_0x4744('0xb')];this[_0x4744('0xc')]=_0x14f595[_0x4744('0xc')];this[_0x4744('0xd')]=_0x14f595['countabandonedretry'];this[_0x4744('0xe')]=_0x14f595['countmachineretry'];this[_0x4744('0xf')]=_0x14f595[_0x4744('0xf')];this['uniqueid']=_0x11af27[_0x4744('0x10')];this[_0x4744('0x11')]=_0x14f595[_0x4744('0x12')];this[_0x4744('0x13')]=_0x14f595[_0x4744('0x14')];this[_0x4744('0x15')]=_0x14f595[_0x4744('0x15')];this[_0x4744('0x16')]=_0x14f595[_0x4744('0x16')];this[_0x4744('0x17')]=moment()['format'](_0x4744('0x18'));this[_0x4744('0x19')]=utils[_0x4744('0x1a')](_0x14f595['responsetime'],_0x14f595[_0x4744('0x15')]);this['holdtime']=0x0;this['talktime']=utils[_0x4744('0x1a')](this[_0x4744('0x17')],_0x14f595[_0x4744('0x16')]);this['queue']=_0x14f595[_0x4744('0x1b')];this['membername']=_0x4744('0x1c');this[_0x4744('0x1d')]=_0x11af27[_0x4744('0x1e')];this[_0x4744('0x1f')]=_0x14f595[_0x4744('0x1f')];this[_0x4744('0x20')]=_0x14f595['callbackuniqueid'];this['callbackat']=_0x14f595[_0x4744('0x21')];this['recallme']=_0x14f595[_0x4744('0x22')];this[_0x4744('0x23')]=_0x14f595['ContactId'];this[_0x4744('0x24')]=_0x14f595['ListId'];this['UserId']=_0x14f595[_0x4744('0x25')];this[_0x4744('0x26')]=_0x14f595[_0x4744('0x26')];this['CampaignId']=_0x14f595[_0x4744('0x27')];}module[_0x4744('0x28')]=Hangup; \ No newline at end of file +var _0xad91=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xad91,0x1ba));var _0x1ad9=function(_0x1e2c73,_0x12cd55){_0x1e2c73=_0x1e2c73-0x0;var _0x46f8d5=_0xad91[_0x1e2c73];return _0x46f8d5;};'use strict';var moment=require('moment');var utils=require(_0x1ad9('0x0'));function Hangup(_0x348e56,_0xe874db){this[_0x1ad9('0x1')]=0x4;this[_0x1ad9('0x2')]='Answer';this[_0x1ad9('0x3')]=_0x348e56['scheduledat'];this[_0x1ad9('0x4')]=_0x348e56['type'];this[_0x1ad9('0x5')]=_0x348e56[_0x1ad9('0x4')]===_0x1ad9('0x6')?_0x1ad9('0x7'):_0x348e56[_0x1ad9('0x4')];this[_0x1ad9('0x8')]=_0x348e56['amd']||![];this[_0x1ad9('0x9')]=_0x348e56['countbusyretry'];this[_0x1ad9('0xa')]=_0x348e56[_0x1ad9('0xa')];this[_0x1ad9('0xb')]=_0x348e56[_0x1ad9('0xb')];this['countglobal']=_0x348e56[_0x1ad9('0x9')]+_0x348e56[_0x1ad9('0xa')]+_0x348e56['countnoanswerretry']+_0x348e56[_0x1ad9('0xc')]+_0x348e56[_0x1ad9('0xd')]+_0x348e56['countabandonedretry']+_0x348e56[_0x1ad9('0xe')]+_0x348e56[_0x1ad9('0xf')];this['countnosuchnumberretry']=_0x348e56[_0x1ad9('0xc')];this[_0x1ad9('0xd')]=_0x348e56[_0x1ad9('0xd')];this[_0x1ad9('0x10')]=_0x348e56[_0x1ad9('0x10')];this[_0x1ad9('0xe')]=_0x348e56[_0x1ad9('0xe')];this[_0x1ad9('0xf')]=_0x348e56[_0x1ad9('0xf')];this[_0x1ad9('0x11')]=_0xe874db[_0x1ad9('0x11')];this['calleridname']=_0x348e56[_0x1ad9('0x12')];this[_0x1ad9('0x13')]=_0x348e56['number'];this[_0x1ad9('0x14')]=_0x348e56[_0x1ad9('0x14')];this['responsetime']=_0x348e56[_0x1ad9('0x15')];this['endtime']=moment()[_0x1ad9('0x16')](_0x1ad9('0x17'));this[_0x1ad9('0x18')]=utils[_0x1ad9('0x19')](_0x348e56['responsetime'],_0x348e56[_0x1ad9('0x14')]);this[_0x1ad9('0x1a')]=0x0;this[_0x1ad9('0x1b')]=utils['getSeconds'](this[_0x1ad9('0x1c')],_0x348e56[_0x1ad9('0x15')]);this[_0x1ad9('0x7')]=_0x348e56[_0x1ad9('0x7')];this[_0x1ad9('0x1d')]=_0x1ad9('0x1e');this[_0x1ad9('0x1f')]=_0xe874db[_0x1ad9('0x20')];this[_0x1ad9('0x21')]=_0x348e56['callback'];this[_0x1ad9('0x22')]=_0x348e56['callbackuniqueid'];this[_0x1ad9('0x23')]=_0x348e56[_0x1ad9('0x23')];this[_0x1ad9('0x24')]=_0x348e56[_0x1ad9('0x24')];this['ContactId']=_0x348e56[_0x1ad9('0x25')];this[_0x1ad9('0x26')]=_0x348e56[_0x1ad9('0x26')];this[_0x1ad9('0x27')]=_0x348e56[_0x1ad9('0x27')];this['VoiceQueueId']=_0x348e56['VoiceQueueId'];this['CampaignId']=_0x348e56[_0x1ad9('0x28')];}module[_0x1ad9('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 2bf975e..e4bbb0f 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8383=['number','starttime','responsetime','endtime','ringtime','getSeconds','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','name','calleridnum'];(function(_0x532875,_0x1ca8c3){var _0x5a47f7=function(_0x208d84){while(--_0x208d84){_0x532875['push'](_0x532875['shift']());}};_0x5a47f7(++_0x1ca8c3);}(_0x8383,0x1a9));var _0x3838=function(_0x297e76,_0x60d1a4){_0x297e76=_0x297e76-0x0;var _0x2d6b71=_0x8383[_0x297e76];return _0x2d6b71;};'use strict';var utils=require(_0x3838('0x0'));function History(_0xc17e33){this[_0x3838('0x1')]=_0xc17e33[_0x3838('0x1')];this[_0x3838('0x2')]=_0xc17e33[_0x3838('0x2')]||undefined;this[_0x3838('0x3')]=_0xc17e33[_0x3838('0x3')];this[_0x3838('0x4')]=_0xc17e33[_0x3838('0x3')]===_0x3838('0x5')?_0x3838('0x6'):_0xc17e33['type'];this[_0x3838('0x7')]=_0xc17e33[_0x3838('0x7')];this[_0x3838('0x8')]=_0xc17e33[_0x3838('0x8')];this[_0x3838('0x9')]=_0xc17e33[_0x3838('0x9')];this[_0x3838('0xa')]=_0xc17e33[_0x3838('0x7')]+_0xc17e33[_0x3838('0x8')]+_0xc17e33[_0x3838('0x9')]+_0xc17e33['countnosuchnumberretry']+_0xc17e33[_0x3838('0xb')]+_0xc17e33[_0x3838('0xc')]+_0xc17e33['countmachineretry']+_0xc17e33[_0x3838('0xd')];this[_0x3838('0xe')]=_0xc17e33['countnosuchnumberretry'];this['countdropretry']=_0xc17e33['countdropretry'];this['countabandonedretry']=_0xc17e33[_0x3838('0xc')];this[_0x3838('0xf')]=_0xc17e33[_0x3838('0xf')];this[_0x3838('0xd')]=_0xc17e33['countagentrejectretry'];this[_0x3838('0x6')]=_0xc17e33['queue'];this[_0x3838('0x10')]=_0xc17e33[_0x3838('0x11')];this[_0x3838('0x12')]=_0xc17e33[_0x3838('0x13')];this['starttime']=_0xc17e33[_0x3838('0x14')];this[_0x3838('0x15')]=_0xc17e33[_0x3838('0x15')];this[_0x3838('0x16')]=_0xc17e33[_0x3838('0x15')];this[_0x3838('0x17')]=utils[_0x3838('0x18')](_0xc17e33['responsetime'],_0xc17e33[_0x3838('0x14')]);this['holdtime']=0x0;this['talktime']=0x0;this['callback']=_0xc17e33['callback'];this[_0x3838('0x19')]=_0xc17e33[_0x3838('0x19')];this[_0x3838('0x1a')]=_0xc17e33['callbackat'];this[_0x3838('0x1b')]=_0xc17e33['recallme'];this[_0x3838('0x1c')]=_0xc17e33[_0x3838('0x1c')];this['ListId']=_0xc17e33[_0x3838('0x1d')];this[_0x3838('0x1e')]=_0xc17e33['UserId'];this['VoiceQueueId']=_0xc17e33[_0x3838('0x1f')];this['CampaignId']=_0xc17e33[_0x3838('0x20')];this[_0x3838('0x21')]=_0xc17e33[_0x3838('0x21')]||'';this[_0x3838('0x22')]=_0xc17e33[_0x3838('0x22')]||'';this['state']=_0xc17e33[_0x3838('0x23')];this[_0x3838('0x24')]=_0xc17e33['statedesc'];}module['exports']=History; \ No newline at end of file +var _0x5cbb=['callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','starttime','responsetime','ringtime','getSeconds','holdtime','callback','callbackuniqueid'];(function(_0xd5d426,_0x3709f0){var _0x91e6a9=function(_0x1be67b){while(--_0x1be67b){_0xd5d426['push'](_0xd5d426['shift']());}};_0x91e6a9(++_0x3709f0);}(_0x5cbb,0xe3));var _0xb5cb=function(_0x3e5fb5,_0x3b5ca2){_0x3e5fb5=_0x3e5fb5-0x0;var _0xc95d0=_0x5cbb[_0x3e5fb5];return _0xc95d0;};'use strict';var utils=require(_0xb5cb('0x0'));function History(_0x31d280){this[_0xb5cb('0x1')]=_0x31d280[_0xb5cb('0x1')];this[_0xb5cb('0x2')]=_0x31d280[_0xb5cb('0x2')]||undefined;this['type']=_0x31d280[_0xb5cb('0x3')];this[_0xb5cb('0x4')]=_0x31d280[_0xb5cb('0x3')]===_0xb5cb('0x5')?_0xb5cb('0x6'):_0x31d280['type'];this[_0xb5cb('0x7')]=_0x31d280[_0xb5cb('0x7')];this[_0xb5cb('0x8')]=_0x31d280['countcongestionretry'];this[_0xb5cb('0x9')]=_0x31d280[_0xb5cb('0x9')];this[_0xb5cb('0xa')]=_0x31d280[_0xb5cb('0x7')]+_0x31d280[_0xb5cb('0x8')]+_0x31d280[_0xb5cb('0x9')]+_0x31d280[_0xb5cb('0xb')]+_0x31d280[_0xb5cb('0xc')]+_0x31d280[_0xb5cb('0xd')]+_0x31d280[_0xb5cb('0xe')]+_0x31d280[_0xb5cb('0xf')];this[_0xb5cb('0xb')]=_0x31d280[_0xb5cb('0xb')];this[_0xb5cb('0xc')]=_0x31d280[_0xb5cb('0xc')];this['countabandonedretry']=_0x31d280['countabandonedretry'];this[_0xb5cb('0xe')]=_0x31d280[_0xb5cb('0xe')];this[_0xb5cb('0xf')]=_0x31d280['countagentrejectretry'];this[_0xb5cb('0x6')]=_0x31d280['queue'];this['calleridname']=_0x31d280[_0xb5cb('0x10')];this[_0xb5cb('0x11')]=_0x31d280['number'];this[_0xb5cb('0x12')]=_0x31d280[_0xb5cb('0x12')];this['responsetime']=_0x31d280[_0xb5cb('0x13')];this['endtime']=_0x31d280[_0xb5cb('0x13')];this[_0xb5cb('0x14')]=utils[_0xb5cb('0x15')](_0x31d280[_0xb5cb('0x13')],_0x31d280[_0xb5cb('0x12')]);this[_0xb5cb('0x16')]=0x0;this['talktime']=0x0;this[_0xb5cb('0x17')]=_0x31d280[_0xb5cb('0x17')];this[_0xb5cb('0x18')]=_0x31d280[_0xb5cb('0x18')];this[_0xb5cb('0x19')]=_0x31d280[_0xb5cb('0x19')];this[_0xb5cb('0x1a')]=_0x31d280[_0xb5cb('0x1a')];this[_0xb5cb('0x1b')]=_0x31d280[_0xb5cb('0x1b')];this[_0xb5cb('0x1c')]=_0x31d280[_0xb5cb('0x1c')];this[_0xb5cb('0x1d')]=_0x31d280[_0xb5cb('0x1d')];this['VoiceQueueId']=_0x31d280['VoiceQueueId'];this[_0xb5cb('0x1e')]=_0x31d280['CampaignId'];this[_0xb5cb('0x1f')]=_0x31d280['originatecalleridnum']||'';this[_0xb5cb('0x20')]=_0x31d280[_0xb5cb('0x20')]||'';this[_0xb5cb('0x21')]=_0x31d280[_0xb5cb('0x21')];this[_0xb5cb('0x22')]=_0x31d280['statedesc'];}module[_0xb5cb('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 2b53557..c1ad44a 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd045=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xd045,0x197));var _0x5d04=function(_0xbb44ba,_0x35634f){_0xbb44ba=_0xbb44ba-0x0;var _0x330a08=_0xd045[_0xbb44ba];return _0x330a08;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x3bebb4,_0x4a5948){this[_0x5d04('0x0')]=_0x3bebb4[_0x5d04('0x0')];this[_0x5d04('0x1')]=_0x3bebb4[_0x5d04('0x1')];this[_0x5d04('0x2')]=_0x3bebb4[_0x5d04('0x1')]===_0x5d04('0x3')?_0x5d04('0x4'):_0x3bebb4[_0x5d04('0x1')];this[_0x5d04('0x5')]=_0x3bebb4[_0x5d04('0x5')];this[_0x5d04('0x6')]=_0x3bebb4[_0x5d04('0x6')];this[_0x5d04('0x7')]=_0x3bebb4['countnoanswerretry'];this[_0x5d04('0x8')]=_0x3bebb4[_0x5d04('0x5')]+_0x3bebb4[_0x5d04('0x6')]+_0x3bebb4[_0x5d04('0x7')]+_0x3bebb4[_0x5d04('0x9')]+_0x3bebb4[_0x5d04('0xa')]+_0x3bebb4[_0x5d04('0xb')]+_0x3bebb4[_0x5d04('0xc')]+_0x3bebb4[_0x5d04('0xd')];this[_0x5d04('0x9')]=_0x3bebb4[_0x5d04('0x9')];this[_0x5d04('0xa')]=_0x3bebb4[_0x5d04('0xa')];this[_0x5d04('0xb')]=_0x3bebb4['countabandonedretry'];this['countmachineretry']=_0x3bebb4[_0x5d04('0xc')];this[_0x5d04('0xd')]=_0x3bebb4[_0x5d04('0xd')];this[_0x5d04('0xe')]=_0x4a5948[_0x5d04('0xe')];this[_0x5d04('0xf')]=_0x3bebb4[_0x5d04('0x10')];this[_0x5d04('0x11')]=_0x3bebb4[_0x5d04('0x12')];this[_0x5d04('0x13')]=_0x3bebb4[_0x5d04('0x13')];this['responsetime']=_0x3bebb4[_0x5d04('0x14')];this[_0x5d04('0x15')]=_0x3bebb4[_0x5d04('0x15')];this[_0x5d04('0x16')]=_0x3bebb4['dropreason'];this[_0x5d04('0x17')]=this[_0x5d04('0x15')];this['ringtime']=utils[_0x5d04('0x18')](_0x3bebb4[_0x5d04('0x14')],_0x3bebb4['starttime']);this['holdtime']=utils[_0x5d04('0x18')](this[_0x5d04('0x15')],_0x3bebb4['responsetime']);this[_0x5d04('0x19')]=0x0;this[_0x5d04('0x4')]=_0x4a5948[_0x5d04('0x4')];this['membername']=_0x4a5948['connectedlinename'];this[_0x5d04('0x1a')]=_0x4a5948[_0x5d04('0x1a')];this['callback']=_0x3bebb4[_0x5d04('0x1b')];this[_0x5d04('0x1c')]=_0x3bebb4[_0x5d04('0x1c')];this[_0x5d04('0x1d')]=_0x3bebb4[_0x5d04('0x1d')];this[_0x5d04('0x1e')]=_0x3bebb4[_0x5d04('0x1e')];this[_0x5d04('0x1f')]=_0x3bebb4['ContactId'];this[_0x5d04('0x20')]=_0x3bebb4[_0x5d04('0x20')];this[_0x5d04('0x21')]=_0x3bebb4['UserId'];this[_0x5d04('0x22')]=_0x3bebb4[_0x5d04('0x22')];this['CampaignId']=_0x3bebb4['CampaignId'];this[_0x5d04('0x23')]=_0x3bebb4['originatecalleridnum']||'';this[_0x5d04('0x24')]=_0x3bebb4['originatecalleridname']||'';this[_0x5d04('0x25')]=_0x3bebb4['agiafterat'];this[_0x5d04('0x26')]=_0x3bebb4[_0x5d04('0x26')];this[_0x5d04('0x27')]=_0x3bebb4['statedesc'];}module[_0x5d04('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xad5a=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','talktime','queue','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x28fec6,_0x175db0){var _0x1c1af6=function(_0x52dab3){while(--_0x52dab3){_0x28fec6['push'](_0x28fec6['shift']());}};_0x1c1af6(++_0x175db0);}(_0xad5a,0x18a));var _0xaad5=function(_0x3f91e6,_0x490ef3){_0x3f91e6=_0x3f91e6-0x0;var _0x21b5ca=_0xad5a[_0x3f91e6];return _0x21b5ca;};'use strict';var utils=require(_0xaad5('0x0'));function QueueCallerAbandon(_0x34532c,_0x3280c1){this[_0xaad5('0x1')]=_0x34532c[_0xaad5('0x1')];this['type']=_0x34532c[_0xaad5('0x2')];this[_0xaad5('0x3')]=_0x34532c['type']===_0xaad5('0x4')?'queue':_0x34532c['type'];this[_0xaad5('0x5')]=_0x34532c[_0xaad5('0x5')];this[_0xaad5('0x6')]=_0x34532c[_0xaad5('0x6')];this['countnoanswerretry']=_0x34532c[_0xaad5('0x7')];this[_0xaad5('0x8')]=_0x34532c['countbusyretry']+_0x34532c['countcongestionretry']+_0x34532c[_0xaad5('0x7')]+_0x34532c['countnosuchnumberretry']+_0x34532c[_0xaad5('0x9')]+_0x34532c[_0xaad5('0xa')]+_0x34532c[_0xaad5('0xb')]+_0x34532c[_0xaad5('0xc')];this[_0xaad5('0xd')]=_0x34532c[_0xaad5('0xd')];this[_0xaad5('0x9')]=_0x34532c[_0xaad5('0x9')];this['countabandonedretry']=_0x34532c[_0xaad5('0xa')];this[_0xaad5('0xb')]=_0x34532c[_0xaad5('0xb')];this['countagentrejectretry']=_0x34532c[_0xaad5('0xc')];this[_0xaad5('0xe')]=_0x3280c1[_0xaad5('0xe')];this[_0xaad5('0xf')]=_0x34532c[_0xaad5('0x10')];this[_0xaad5('0x11')]=_0x34532c[_0xaad5('0x12')];this[_0xaad5('0x13')]=_0x34532c[_0xaad5('0x13')];this[_0xaad5('0x14')]=_0x34532c[_0xaad5('0x14')];this[_0xaad5('0x15')]=_0x34532c[_0xaad5('0x15')];this[_0xaad5('0x16')]=_0x34532c[_0xaad5('0x16')];this['endtime']=this[_0xaad5('0x15')];this[_0xaad5('0x17')]=utils[_0xaad5('0x18')](_0x34532c[_0xaad5('0x14')],_0x34532c[_0xaad5('0x13')]);this[_0xaad5('0x19')]=utils[_0xaad5('0x18')](this[_0xaad5('0x15')],_0x34532c[_0xaad5('0x14')]);this[_0xaad5('0x1a')]=0x0;this[_0xaad5('0x1b')]=_0x3280c1[_0xaad5('0x1b')];this['membername']=_0x3280c1['connectedlinename'];this['reason']=_0x3280c1[_0xaad5('0x1c')];this[_0xaad5('0x1d')]=_0x34532c[_0xaad5('0x1d')];this['callbackuniqueid']=_0x34532c['callbackuniqueid'];this['callbackat']=_0x34532c[_0xaad5('0x1e')];this[_0xaad5('0x1f')]=_0x34532c[_0xaad5('0x1f')];this['ContactId']=_0x34532c[_0xaad5('0x20')];this[_0xaad5('0x21')]=_0x34532c[_0xaad5('0x21')];this['UserId']=_0x34532c[_0xaad5('0x22')];this[_0xaad5('0x23')]=_0x34532c[_0xaad5('0x23')];this[_0xaad5('0x24')]=_0x34532c[_0xaad5('0x24')];this[_0xaad5('0x25')]=_0x34532c[_0xaad5('0x25')]||'';this[_0xaad5('0x26')]=_0x34532c[_0xaad5('0x26')]||'';this[_0xaad5('0x27')]=_0x34532c[_0xaad5('0x27')];this[_0xaad5('0x28')]=_0x34532c[_0xaad5('0x28')];this[_0xaad5('0x29')]=_0x34532c[_0xaad5('0x29')];}module[_0xaad5('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 6047f82..53d87eb 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0xacf940,_0x26e3ca){var _0x2af1bd=function(_0x9308e0){while(--_0x9308e0){_0xacf940['push'](_0xacf940['shift']());}};_0x2af1bd(++_0x26e3ca);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3ba5ce,_0x3b266a){var _0x2f1690=function(_0x423c12){while(--_0x423c12){_0x3ba5ce['push'](_0x3ba5ce['shift']());}};_0x2f1690(++_0x3b266a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 903369b..09f1f94 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaca8=['AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','decrementOriginate','length','checkContactLowerLimitOriginate','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','AGENTS_NOT_LOGGED'];(function(_0x102ae8,_0x4a19c3){var _0x5a5486=function(_0x9c8f30){while(--_0x9c8f30){_0x102ae8['push'](_0x102ae8['shift']());}};_0x5a5486(++_0x4a19c3);}(_0xaca8,0x17d));var _0x8aca=function(_0x149fda,_0x489a55){_0x149fda=_0x149fda-0x0;var _0x3790d9=_0xaca8[_0x149fda];return _0x3790d9;};'use strict';var _=require('lodash');var moment=require(_0x8aca('0x0'));var util=require(_0x8aca('0x1'));var logger=require(_0x8aca('0x2'))(_0x8aca('0x3'));var timezones=require(_0x8aca('0x4'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x8aca('0x5'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x8aca('0x6'),'DEACTIVATED':_0x8aca('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x8aca('0x8'),'NO_AVAILABLE_CONTACTS':_0x8aca('0x9'),'NULL_INTERVAL':_0x8aca('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x8aca('0xb'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x8aca('0xc'),'UNKNOWN_TIMEZONE':_0x8aca('0xd'),'UNREACHABLE_TRUNK':_0x8aca('0xe')};exports[_0x8aca('0xf')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3b97fd){return _0x3b97fd[_0x8aca('0x10')]===_0x8aca('0x11');}exports[_0x8aca('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x558b50){return _0x558b50[_0x8aca('0x13')]===_0x8aca('0x14');}exports[_0x8aca('0x15')]=isIVRCampaign;function isOutboundQueue(_0x3b9c4d){return _0x3b9c4d[_0x8aca('0x13')]===_0x8aca('0x16');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x3772bf){return _0x3772bf[_0x8aca('0x17')];}exports[_0x8aca('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x257c9b){return _0x257c9b[_0x8aca('0x19')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x33ef5c,_0x3d68eb){var _0x42b698=moment(_0x33ef5c)[_0x8aca('0x1a')](0x0);var _0x560f47=moment(_0x3d68eb)['milliseconds'](0x0);return _0x42b698[_0x8aca('0x1b')](_0x560f47,_0x8aca('0x1c'));}exports[_0x8aca('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x41cfc7,_0x4f0255){var _0x3ca5ff=![];var _0x2601c0=_0x41cfc7[_0x8aca('0x10')]!==_0x4f0255[_0x8aca('0x10')]||_0x41cfc7[_0x8aca('0x17')]!==_0x4f0255[_0x8aca('0x17')]||_0x41cfc7[_0x8aca('0x1e')]!==_0x4f0255[_0x8aca('0x1e')];var _0x120a4d=_0x41cfc7[_0x8aca('0x1f')]!==_0x4f0255[_0x8aca('0x1f')]||_0x41cfc7[_0x8aca('0x20')]!==_0x4f0255[_0x8aca('0x20')]||_0x41cfc7[_0x8aca('0x21')]!==_0x4f0255['loggedInDb']||_0x41cfc7['paused']!==_0x4f0255[_0x8aca('0x22')]||_0x41cfc7[_0x8aca('0x23')]!==_0x4f0255[_0x8aca('0x23')]||_0x41cfc7[_0x8aca('0x24')]!==_0x4f0255[_0x8aca('0x24')]||_0x41cfc7[_0x8aca('0x25')]!==_0x4f0255[_0x8aca('0x25')]||_0x41cfc7[_0x8aca('0x26')]!==_0x4f0255[_0x8aca('0x26')]||_0x41cfc7[_0x8aca('0x27')]!==_0x4f0255[_0x8aca('0x27')];if(_0x41cfc7[_0x8aca('0x28')]&&_0x4f0255['Trunk']){_0x3ca5ff=_0x41cfc7[_0x8aca('0x28')][_0x8aca('0x29')]!==_0x4f0255['Trunk'][_0x8aca('0x29')]||_0x41cfc7[_0x8aca('0x28')][_0x8aca('0x19')]!==_0x4f0255[_0x8aca('0x28')][_0x8aca('0x19')];}return _0x2601c0||_0x120a4d||_0x3ca5ff;}exports[_0x8aca('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x25c4c5){var _0x47475d=null;var _0x1812f1=_0x25c4c5[_0x8aca('0x2b')];if(_[_0x8aca('0x2c')](_0x25c4c5[_0x8aca('0x2d')])||_[_0x8aca('0x2c')](_0x25c4c5[_0x8aca('0x2e')])||_[_0x8aca('0x2c')](_0x25c4c5[_0x8aca('0x2e')][_0x8aca('0x2f')])){_0x47475d=CAMPAIGN_STATUS[_0x8aca('0x30')];}else if(_['isEmpty'](_0x25c4c5[_0x8aca('0x2d')])||_[_0x8aca('0x31')](_0x25c4c5[_0x8aca('0x2e')][_0x8aca('0x2f')])){_0x47475d=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x1812f1&&!timezones[_0x1812f1]){_0x47475d=CAMPAIGN_STATUS[_0x8aca('0x32')];}return _0x47475d;}function checkAnyValidTrunk(_0x57cfab,_0x36e0c7){var _0x471e5b=null;var _0xf5a4a0=_0x8aca('0x33');var _0x2d3817=[_0x8aca('0x34'),_0x8aca('0x35')];var _0x217c15=!![];if(_0x57cfab['Trunk']&&_0x57cfab[_0x8aca('0x28')][_0x8aca('0x19')]){_0xf5a4a0+=_0x57cfab['Trunk'][_0x8aca('0x29')];_0x471e5b=_0x36e0c7[_0xf5a4a0];_0x217c15=_0x2d3817[_0x8aca('0x36')](_0x471e5b[_0x8aca('0x37')]);}else if(_0x57cfab['TrunkBackup']&&_0x57cfab[_0x8aca('0x38')][_0x8aca('0x19')]){_0xf5a4a0+=_0x57cfab['TrunkBackup'][_0x8aca('0x29')];_0x471e5b=_0x36e0c7[_0xf5a4a0];_0x217c15=_0x2d3817['includes'](_0x471e5b[_0x8aca('0x37')]);}return _0x217c15;}function getQueueCampaignStatusMessage(_0x112931,_0xdd1db3){var _0x6c5047=CAMPAIGN_STATUS['ACTIVE'];var _0x1e6e69=isPreviewCampaign(_0x112931);if(!isQueueCampaignActive(_0x112931)){if(_0x1e6e69){_0x6c5047=CAMPAIGN_STATUS[_0x8aca('0x39')];}else{if(_0x112931[_0x8aca('0x27')]===0x0&&_0x112931[_0x8aca('0x23')]===0x0&&_0x112931[_0x8aca('0x25')]===0x0&&(_0x112931[_0x8aca('0x24')]||0x0)===0x0){_0x6c5047=CAMPAIGN_STATUS['INACTIVE'];}else{_0x6c5047=CAMPAIGN_STATUS[_0x8aca('0x3a')];}}}else if(_0x112931[_0x8aca('0x20')]===0x0){_0x6c5047=CAMPAIGN_STATUS[_0x8aca('0x3b')];}else if(!checkAnyValidTrunk(_0x112931,_0xdd1db3)){_0x6c5047=CAMPAIGN_STATUS[_0x8aca('0x3c')];}else if(!isPreviewCampaign(_0x112931)){var _0x566bc3=checkAnyValidQueueCampaignInterval(_0x112931);if(_0x566bc3){_0x6c5047=_0x566bc3;}}return _0x6c5047;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3337d3){var _0x431457=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3337d3[_0x8aca('0x27')]===0x0&&_0x3337d3['talking']===0x0&&_0x3337d3['waiting']===0x0&&(_0x3337d3[_0x8aca('0x24')]||0x0)===0x0){_0x431457=CAMPAIGN_STATUS[_0x8aca('0x39')];}return _0x431457;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x48431d){var _0x5bbac4=_0x48431d[_0x8aca('0x3d')](/"(.*?)"/);return _0x5bbac4?_0x5bbac4[0x1]:_0x48431d;}exports[_0x8aca('0x3e')]=extractCalleridName;function getCallerId(_0x409cea,_0x4f148c,_0x281f83){if(!_[_0x8aca('0x3f')](_0x281f83)&&typeof _0x281f83==='string'&&!_[_0x8aca('0x31')](_0x281f83)){if(!_[_0x8aca('0x3f')](_0x4f148c)&&typeof _0x4f148c===_0x8aca('0x40')&&!_['isEmpty'](_0x4f148c)){return util['format'](_0x8aca('0x41'),_0x4f148c,_0x281f83);}return util[_0x8aca('0x42')](_0x8aca('0x41'),_0x281f83,_0x281f83);}if(!_[_0x8aca('0x3f')](_0x409cea)&&typeof _0x409cea===_0x8aca('0x40')&&!_[_0x8aca('0x31')](_0x409cea)){return _0x409cea;}return _0x8aca('0x43');}exports[_0x8aca('0x44')]=getCallerId;function getCallerIdRandom(_0x400c3d,_0x597e6c){var _0x2ce4d1;var _0x491e2e;var _0x4c439e;if(_0x597e6c<=0x0){_0x597e6c=0x1;}_0x2ce4d1=new RegExp(_0x8aca('0x45')+_0x597e6c+'}$');_0x491e2e=Math[_0x8aca('0x46')](0xa,_0x597e6c-0x1);_0x4c439e=Math[_0x8aca('0x46')](0xa,_0x597e6c)-0x1;return util[_0x8aca('0x42')]('%s',_[_0x8aca('0x47')](_0x400c3d,_0x2ce4d1,_[_0x8aca('0x48')](_0x491e2e,_0x4c439e)[_0x8aca('0x49')]()));}exports[_0x8aca('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x4348fd){if(_0x4348fd[_0x8aca('0x27')]&&_0x4348fd[_0x8aca('0x27')]>0x0){_0x4348fd['originated']-=0x1;}else{logger['error']('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x8aca('0x4b')]=decrementOriginate;function checkContactEmpty(_0x3697f0){return _0x3697f0&&_0x3697f0[_0x8aca('0x4c')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x3b02d4,_0x33e09f){if(_0x33e09f===0x0){return 0x0;}var _0x56df67=0x1;for(var _0x10d95c=0x1;_0x10d95c<=_0x33e09f;_0x10d95c+=0x1){_0x56df67=0x1+_0x56df67*_0x10d95c/_0x3b02d4;}return 0x1/_0x56df67;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x1eee1d,_0xd0e5f,_0x189243){if(_0xd0e5f>_0x189243){for(var _0x170fdb=0x0;_0x170fdb<_0xd0e5f-_0x189243;_0x170fdb+=0x1){decrementOriginate(_0x1eee1d);}}}exports[_0x8aca('0x4d')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xf28d=['string','isUndefined','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','replace','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','lodash','moment','util','../../../../config/logger','dialer','timezones','ACTIVE','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','milliseconds','diff','seconds','getSeconds','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName'];(function(_0x468623,_0x4a2bd1){var _0xb2c1d0=function(_0x98f9ff){while(--_0x98f9ff){_0x468623['push'](_0x468623['shift']());}};_0xb2c1d0(++_0x4a2bd1);}(_0xf28d,0x193));var _0xdf28=function(_0x25ab51,_0x4f84f5){_0x25ab51=_0x25ab51-0x0;var _0x3b4aa0=_0xf28d[_0x25ab51];return _0x3b4aa0;};'use strict';var _=require(_0xdf28('0x0'));var moment=require(_0xdf28('0x1'));var util=require(_0xdf28('0x2'));var logger=require(_0xdf28('0x3'))(_0xdf28('0x4'));var timezones=require('../../../../config/environment/shared')[_0xdf28('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xdf28('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xdf28('0x7'),'DISACTIVED':_0xdf28('0x8'),'EMPTY_INTERVAL':_0xdf28('0x9'),'INACTIVE':_0xdf28('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xdf28('0xb'),'NULL_INTERVAL':_0xdf28('0xc'),'OVERTIME_INTERVAL':_0xdf28('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xdf28('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xdf28('0xf'),'RUNNING':_0xdf28('0x10'),'UNKNOWN_TIMEZONE':_0xdf28('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xdf28('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2e4a34){return _0x2e4a34[_0xdf28('0x13')]===_0xdf28('0x14');}exports[_0xdf28('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x3be223){return _0x3be223[_0xdf28('0x16')]===_0xdf28('0x17');}exports[_0xdf28('0x18')]=isIVRCampaign;function isOutboundQueue(_0x179cb1){return _0x179cb1[_0xdf28('0x16')]===_0xdf28('0x19');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x588784){return _0x588784[_0xdf28('0x1a')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x1f61cc){return _0x1f61cc['active'];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x1e4e5f,_0x3c878a){var _0x3fc4eb=moment(_0x1e4e5f)[_0xdf28('0x1b')](0x0);var _0x5b5d95=moment(_0x3c878a)[_0xdf28('0x1b')](0x0);return _0x3fc4eb[_0xdf28('0x1c')](_0x5b5d95,_0xdf28('0x1d'));}exports[_0xdf28('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x4b81b5,_0x1e8041){var _0x3acbad=![];var _0x481924=_0x4b81b5[_0xdf28('0x13')]!==_0x1e8041['dialMethod']||_0x4b81b5[_0xdf28('0x1a')]!==_0x1e8041[_0xdf28('0x1a')]||_0x4b81b5['message']!==_0x1e8041['message'];var _0x49299d=_0x4b81b5[_0xdf28('0x1f')]!==_0x1e8041['available']||_0x4b81b5[_0xdf28('0x20')]!==_0x1e8041['loggedIn']||_0x4b81b5[_0xdf28('0x21')]!==_0x1e8041[_0xdf28('0x21')]||_0x4b81b5['paused']!==_0x1e8041[_0xdf28('0x22')]||_0x4b81b5[_0xdf28('0x23')]!==_0x1e8041[_0xdf28('0x23')]||_0x4b81b5[_0xdf28('0x24')]!==_0x1e8041[_0xdf28('0x24')]||_0x4b81b5['waiting']!==_0x1e8041[_0xdf28('0x25')]||_0x4b81b5['inUse']!==_0x1e8041[_0xdf28('0x26')]||_0x4b81b5[_0xdf28('0x27')]!==_0x1e8041[_0xdf28('0x27')];if(_0x4b81b5[_0xdf28('0x28')]&&_0x1e8041['Trunk']){_0x3acbad=_0x4b81b5[_0xdf28('0x28')][_0xdf28('0x29')]!==_0x1e8041['Trunk']['name']||_0x4b81b5[_0xdf28('0x28')][_0xdf28('0x2a')]!==_0x1e8041[_0xdf28('0x28')][_0xdf28('0x2a')];}return _0x481924||_0x49299d||_0x3acbad;}exports[_0xdf28('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x32f073){var _0x4c8d8b=null;var _0x33fdd9=_0x32f073[_0xdf28('0x2c')];if(_[_0xdf28('0x2d')](_0x32f073[_0xdf28('0x2e')])||_['isNil'](_0x32f073[_0xdf28('0x2f')])||_[_0xdf28('0x2d')](_0x32f073['Interval'][_0xdf28('0x30')])){_0x4c8d8b=CAMPAIGN_STATUS[_0xdf28('0x31')];}else if(_[_0xdf28('0x32')](_0x32f073[_0xdf28('0x2e')])||_['isEmpty'](_0x32f073[_0xdf28('0x2f')]['Intervals'])){_0x4c8d8b=CAMPAIGN_STATUS[_0xdf28('0x33')];}else if(_0x33fdd9&&!timezones[_0x33fdd9]){_0x4c8d8b=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x4c8d8b;}function checkAnyValidTrunk(_0x2b7acb,_0xc6f81f){var _0x2648a6=null;var _0x341a75=_0xdf28('0x34');var _0x428fb=[_0xdf28('0x35'),_0xdf28('0x36')];var _0x147982=!![];if(_0x2b7acb['Trunk']&&_0x2b7acb[_0xdf28('0x28')][_0xdf28('0x2a')]){_0x341a75+=_0x2b7acb[_0xdf28('0x28')][_0xdf28('0x29')];_0x2648a6=_0xc6f81f[_0x341a75];_0x147982=_0x428fb[_0xdf28('0x37')](_0x2648a6[_0xdf28('0x38')]);}else if(_0x2b7acb[_0xdf28('0x39')]&&_0x2b7acb[_0xdf28('0x39')]['active']){_0x341a75+=_0x2b7acb[_0xdf28('0x39')][_0xdf28('0x29')];_0x2648a6=_0xc6f81f[_0x341a75];_0x147982=_0x428fb['includes'](_0x2648a6[_0xdf28('0x38')]);}return _0x147982;}function getQueueCampaignStatusMessage(_0x219b2a,_0x1b5ea8){var _0x20f390=CAMPAIGN_STATUS[_0xdf28('0x6')];var _0x20e757=isPreviewCampaign(_0x219b2a);if(!isQueueCampaignActive(_0x219b2a)){if(_0x20e757){_0x20f390=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x219b2a[_0xdf28('0x27')]===0x0&&_0x219b2a[_0xdf28('0x23')]===0x0&&_0x219b2a[_0xdf28('0x25')]===0x0&&(_0x219b2a[_0xdf28('0x24')]||0x0)===0x0){_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3a')];}else{_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3b')];}}}else if(_0x219b2a['loggedIn']===0x0){_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3c')];}else if(!checkAnyValidTrunk(_0x219b2a,_0x1b5ea8)){_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3d')];}else if(!isPreviewCampaign(_0x219b2a)){var _0x43352f=checkAnyValidQueueCampaignInterval(_0x219b2a);if(_0x43352f){_0x20f390=_0x43352f;}}return _0x20f390;}exports[_0xdf28('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x44df04){var _0xfb4a6a=CAMPAIGN_STATUS[_0xdf28('0x3b')];if(_0x44df04['originated']===0x0&&_0x44df04['talking']===0x0&&_0x44df04['waiting']===0x0&&(_0x44df04[_0xdf28('0x24')]||0x0)===0x0){_0xfb4a6a=CAMPAIGN_STATUS['INACTIVE'];}return _0xfb4a6a;}exports[_0xdf28('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xbccb5a){var _0x2a249f=_0xbccb5a['match'](/"(.*?)"/);return _0x2a249f?_0x2a249f[0x1]:_0xbccb5a;}exports[_0xdf28('0x40')]=extractCalleridName;function getCallerId(_0x532280,_0x382228,_0x47fedc){if(!_['isUndefined'](_0x47fedc)&&typeof _0x47fedc===_0xdf28('0x41')&&!_[_0xdf28('0x32')](_0x47fedc)){if(!_[_0xdf28('0x42')](_0x382228)&&typeof _0x382228==='string'&&!_[_0xdf28('0x32')](_0x382228)){return util[_0xdf28('0x43')]('\x22%s\x22\x20<%s>',_0x382228,_0x47fedc);}return util[_0xdf28('0x43')](_0xdf28('0x44'),_0x47fedc,_0x47fedc);}if(!_[_0xdf28('0x42')](_0x532280)&&typeof _0x532280===_0xdf28('0x41')&&!_[_0xdf28('0x32')](_0x532280)){return _0x532280;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x384334,_0x2aa422){var _0x596601;var _0x10f369;var _0x4290f9;if(_0x2aa422<=0x0){_0x2aa422=0x1;}_0x596601=new RegExp(_0xdf28('0x45')+_0x2aa422+'}$');_0x10f369=Math['pow'](0xa,_0x2aa422-0x1);_0x4290f9=Math[_0xdf28('0x46')](0xa,_0x2aa422)-0x1;return util['format']('%s',_[_0xdf28('0x47')](_0x384334,_0x596601,_['random'](_0x10f369,_0x4290f9)['toString']()));}exports[_0xdf28('0x48')]=getCallerIdRandom;function decrementOriginate(_0x3b6411){if(_0x3b6411[_0xdf28('0x27')]&&_0x3b6411[_0xdf28('0x27')]>0x0){_0x3b6411[_0xdf28('0x27')]-=0x1;}else{logger['error'](_0xdf28('0x49'));}}exports[_0xdf28('0x4a')]=decrementOriginate;function checkContactEmpty(_0x59acf0){return _0x59acf0&&_0x59acf0[_0xdf28('0x4b')]>0x0;}exports[_0xdf28('0x4c')]=checkContactEmpty;function erlangb(_0x3d1fb4,_0x5e0509){if(_0x5e0509===0x0){return 0x0;}var _0x157bf3=0x1;for(var _0x19422d=0x1;_0x19422d<=_0x5e0509;_0x19422d+=0x1){_0x157bf3=0x1+_0x157bf3*_0x19422d/_0x3d1fb4;}return 0x1/_0x157bf3;}exports[_0xdf28('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x3d7323,_0x24e749,_0x2c347c){if(_0x24e749>_0x2c347c){for(var _0x4b0118=0x0;_0x4b0118<_0x24e749-_0x2c347c;_0x4b0118+=0x1){decrementOriginate(_0x3d7323);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 30da419..f7575e0 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x4a1701,_0x313a9f){var _0x90a62f=function(_0x423592){while(--_0x423592){_0x4a1701['push'](_0x4a1701['shift']());}};_0x90a62f(++_0x313a9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x572a77,_0x40fc36){var _0x4abb12=function(_0x56ba94){while(--_0x56ba94){_0x572a77['push'](_0x572a77['shift']());}};_0x4abb12(++_0x40fc36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index d8a46e2..3132b80 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x463e=['Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','syncNewExten','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','format','execute','%s/%s.tif','dir'];(function(_0x5e388f,_0x5c76ed){var _0x2c1112=function(_0x4b20d2){while(--_0x4b20d2){_0x5e388f['push'](_0x5e388f['shift']());}};_0x2c1112(++_0x5c76ed);}(_0x463e,0x87));var _0xe463=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x463e[_0x297fd3];return _0x2af381;};'use strict';var util=require(_0xe463('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xe463('0x1'));var moment=require(_0xe463('0x2'));var path=require(_0xe463('0x3'));var tiff2pdf=require(_0xe463('0x4'));var gs=require(_0xe463('0x5'));var logger=require(_0xe463('0x6'))(_0xe463('0x7'));var ami=require(_0xe463('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0xe463('0x9'));var ut=require(_0xe463('0xa'));var Action=require(_0xe463('0xb'));var faxAccount=require(_0xe463('0xc'));var attachment=require(_0xe463('0xd'));var faxMessage=require(_0xe463('0xe'));function Fax(_0x38a66d){this[_0xe463('0xf')]={};this[_0xe463('0x10')]=_0x38a66d['faxAccounts'];this[_0xe463('0x11')]=_0x38a66d[_0xe463('0x11')];this[_0xe463('0x12')]={};ami['on'](_0xe463('0x13'),this[_0xe463('0x14')][_0xe463('0x15')](this));ami['on'](_0xe463('0x16'),this['syncVarSet'][_0xe463('0x15')](this));ami['on'](_0xe463('0x17'),this[_0xe463('0x18')]['bind'](this));ami['on'](_0xe463('0x19'),this['syncNewExten'][_0xe463('0x15')](this));ami['on']('faxstatus',this[_0xe463('0x1a')][_0xe463('0x15')](this));ami['on'](_0xe463('0x1b'),this[_0xe463('0x1c')][_0xe463('0x15')](this));ami['on'](_0xe463('0x1d'),this[_0xe463('0x1e')]['bind'](this));ami['on'](_0xe463('0x1f'),this[_0xe463('0x20')]['bind'](this));}Fax[_0xe463('0x21')][_0xe463('0x14')]=function(_0x4190d6){if(_0x4190d6[_0xe463('0x22')]===_0xe463('0x23')){for(var _0x117788 in this['faxAccounts']){if(this[_0xe463('0x10')][_0xe463('0x24')](_0x117788)){if(_0x4190d6[_0xe463('0x25')]===this[_0xe463('0x10')][_0x117788]['localstationid']){this[_0xe463('0xf')][_0x4190d6[_0xe463('0x26')]]={};this[_0xe463('0xf')][_0x4190d6['uniqueid']][_0xe463('0x27')]=_0x4190d6[_0xe463('0x27')];this['channels'][_0x4190d6['uniqueid']]['id']=this[_0xe463('0x10')][_0x117788]['id'];this[_0xe463('0xf')][_0x4190d6['uniqueid']][_0xe463('0x28')]=this['faxAccounts'][_0x117788][_0xe463('0x28')];logger[_0xe463('0x29')](_0x4190d6['uniqueid'],_0xe463('0x2a'));}}}}if(this[_0xe463('0x12')][_0x4190d6[_0xe463('0x26')]]){this[_0xe463('0xf')][_0x4190d6[_0xe463('0x26')]]={};this[_0xe463('0xf')][_0x4190d6[_0xe463('0x26')]]['channel']=_0x4190d6[_0xe463('0x27')];logger['info'](_0x4190d6['uniqueid'],_0xe463('0x2a'));}};Fax[_0xe463('0x21')]['syncVarSet']=function(_0x5e18bf){if(this[_0xe463('0xf')][_0x5e18bf[_0xe463('0x26')]]){for(var _0x5ac678 in _0x5e18bf[_0xe463('0x2b')]){if(_0x5e18bf[_0xe463('0x2b')]['hasOwnProperty'](_0x5ac678)){this['channels'][_0x5e18bf[_0xe463('0x26')]][_0x5ac678]=_0x5e18bf[_0xe463('0x2c')];}}}};Fax['prototype']['syncNewState']=function(_0x13aa2f){if(this[_0xe463('0xf')][_0x13aa2f[_0xe463('0x26')]]){this[_0xe463('0xf')][_0x13aa2f['uniqueid']][_0xe463('0x2d')]=_0x13aa2f['channelstate'];this[_0xe463('0xf')][_0x13aa2f[_0xe463('0x26')]]['channelstatedesc']=_0x13aa2f['channelstatedesc'];}};Fax[_0xe463('0x21')][_0xe463('0x2e')]=function(_0xa9fb80){if(this['channels'][_0xa9fb80[_0xe463('0x26')]]){for(var _0x354bd6 in _0xa9fb80[_0xe463('0x2b')]){if(_0xa9fb80['variable'][_0xe463('0x24')](_0x354bd6)){this[_0xe463('0xf')][_0xa9fb80['uniqueid']][_0x354bd6]=_0xa9fb80[_0xe463('0x2c')];}}}};Fax['prototype'][_0xe463('0x1a')]=function(_0x5f29be){if(this[_0xe463('0xf')][_0x5f29be[_0xe463('0x26')]]){this[_0xe463('0xf')][_0x5f29be[_0xe463('0x26')]][_0xe463('0x2f')]=_0x5f29be['operation'];this[_0xe463('0xf')][_0x5f29be[_0xe463('0x26')]][_0xe463('0x30')]=_0x5f29be['status'];this[_0xe463('0xf')][_0x5f29be['uniqueid']][_0xe463('0x31')]=_0x5f29be[_0xe463('0x31')];this['channels'][_0x5f29be[_0xe463('0x26')]][_0xe463('0x32')]=_0x5f29be[_0xe463('0x32')];logger[_0xe463('0x29')](_0x5f29be[_0xe463('0x26')],_0xe463('0x33'));}};Fax['prototype'][_0xe463('0x1c')]=function(_0x255d76){var _0x377fb0=this;if(this['channels'][_0x255d76[_0xe463('0x26')]]){var _0xfb72da=this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]]['id'];this['channels'][_0x255d76[_0xe463('0x26')]]['remotestationid']=_0x255d76[_0xe463('0x34')];this['channels'][_0x255d76[_0xe463('0x26')]][_0xe463('0x35')]=_0x255d76[_0xe463('0x35')];this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]][_0xe463('0x31')]=_0x255d76[_0xe463('0x31')];this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]][_0xe463('0x36')]=_0x255d76[_0xe463('0x36')];this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]][_0xe463('0x37')]=_0x255d76[_0xe463('0x37')];this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]][_0xe463('0x32')]=_0x255d76[_0xe463('0x32')];this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]][_0xe463('0x38')]=_0x255d76[_0xe463('0x38')];if(this[_0xe463('0xf')][_0x255d76[_0xe463('0x26')]][_0xe463('0x35')]>0x0){tiff2pdf(_0x255d76[_0xe463('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x4a1c1d){logger[_0xe463('0x29')](_0x255d76[_0xe463('0x26')],_0xe463('0x39'),_0x4a1c1d['message']);attachment[_0xe463('0x3a')]({'name':path['parse'](_0x255d76[_0xe463('0x32')])[_0xe463('0x28')],'basename':path[_0xe463('0x3b')](_0x255d76[_0xe463('0x32')])['name']+_0xe463('0x3c'),'type':_0xe463('0x3d')})[_0xe463('0x3e')](function(_0x3465a8){faxAccount[_0xe463('0x3f')](_0xfb72da,{'from':_0x255d76[_0xe463('0x38')],'mapKey':_0xe463('0x7'),'body':path[_0xe463('0x3b')](_0x255d76['filename'])[_0xe463('0x28')]+'.pdf','AttachmentId':_0x3465a8['id']})[_0xe463('0x40')](function(_0x4b6ce4){logger[_0xe463('0x41')](_0x255d76[_0xe463('0x26')],_0xe463('0x42'),JSON['stringify'](_0x4b6ce4));});})['catch'](function(_0x19f03){logger[_0xe463('0x41')](_0x255d76[_0xe463('0x26')],'\x20receiveFax\x20',JSON['stringify'](_0x19f03));});});}logger[_0xe463('0x29')](_0x255d76[_0xe463('0x26')],'\x20receiveFax\x20');}};Fax[_0xe463('0x21')][_0xe463('0x20')]=function(_0x2b3556){if(this[_0xe463('0x12')][_0x2b3556[_0xe463('0x26')]]){_[_0xe463('0x43')](this[_0xe463('0xf')][_0x2b3556[_0xe463('0x26')]],_[_0xe463('0x44')](_0x2b3556,[_0xe463('0x45'),_0xe463('0x46')]));}};function updateStatus(_0x57eb34){if(_0x57eb34[_0xe463('0x47')]){faxMessage[_0xe463('0x48')](_0x57eb34['AttachmentId'],{'failMessage':_0xe463('0x49')})[_0xe463('0x3e')](function(_0x581ee6){ut[_0xe463('0x4a')](_0xe463('0x4b'),_0x581ee6);})['catch'](function(_0x463220){ut[_0xe463('0x4a')](_0xe463('0x4c'),_0x463220);});}else{ut[_0xe463('0x4a')](_0xe463('0x4d'));}}Fax[_0xe463('0x21')][_0xe463('0x4e')]=function(_0x3cd90c,_0x22fcf5,_0x54cc15){var _0x5eb8aa=this;var _0x3f11d4={};if(_0x22fcf5){_0x3f11d4={'read':_0x22fcf5};}else{_0x3f11d4={'failMessage':_0x54cc15};}if(this['actions'][_0x3cd90c][_0xe463('0x47')]){faxMessage[_0xe463('0x48')](this[_0xe463('0x12')][_0x3cd90c][_0xe463('0x47')],_0x3f11d4)[_0xe463('0x3e')](function(_0x25cd43){ut[_0xe463('0x4a')](_0xe463('0x4f'),_0x25cd43);})[_0xe463('0x40')](function(_0x3d50ab){ut[_0xe463('0x4a')](_0xe463('0x50'),_0x3d50ab);})['finally'](function(){delete _0x5eb8aa['channels'][_0x3cd90c];delete _0x5eb8aa['actions'][_0x3cd90c];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xe463('0xf')][_0x3cd90c];delete this[_0xe463('0x12')][_0x3cd90c];}};Fax['prototype'][_0xe463('0x1e')]=function(_0x295898){var _0x416d51=this;if(this['channels'][_0x295898['uniqueid']]){if(this[_0xe463('0x12')][_0x295898[_0xe463('0x26')]]){this['channels'][_0x295898[_0xe463('0x26')]]['id']=this[_0xe463('0x12')][_0x295898[_0xe463('0x26')]]['id'];this[_0xe463('0xf')][_0x295898['uniqueid']][_0xe463('0x28')]=this['actions'][_0x295898[_0xe463('0x26')]][_0xe463('0x28')];}logger['info'](_0x295898[_0xe463('0x26')],this[_0xe463('0x12')][_0x295898[_0xe463('0x26')]]?_0xe463('0x51'):_0xe463('0x52'),JSON[_0xe463('0x53')](this['channels'][_0x295898[_0xe463('0x26')]]));if(this[_0xe463('0x12')][_0x295898[_0xe463('0x26')]]){if(this[_0xe463('0xf')][_0x295898['uniqueid']][_0xe463('0x54')]>0x0&&this[_0xe463('0xf')][_0x295898[_0xe463('0x26')]][_0xe463('0x55')]===_0xe463('0x56')){this[_0xe463('0x4e')](_0x295898['uniqueid'],!![]);}else{this[_0xe463('0x4e')](_0x295898[_0xe463('0x26')],![],this[_0xe463('0xf')][_0x295898['uniqueid']][_0xe463('0x57')]?'SENDING\x20FAILED:\x20'+this[_0xe463('0xf')][_0x295898[_0xe463('0x26')]][_0xe463('0x57')]:_0xe463('0x58'));}}}};Fax['prototype'][_0xe463('0x59')]=function(_0x383730){var _0x336604=this;return new BPromise(function(_0x7678a7,_0x5ad929){_0x336604['execOriginate'](_0x383730,_0x336604[_0xe463('0x10')][_0x383730[_0xe463('0x5a')]])[_0xe463('0x3e')](function(_0x566d53){ut[_0xe463('0x4a')]('[Fax][execOriginate][success]',_0x566d53);_0x7678a7(ut[_0xe463('0x5b')]('Fax\x20received'));})[_0xe463('0x40')](function(_0x227cf6){ut[_0xe463('0x4a')](_0xe463('0x5c'),_0x227cf6);updateStatus(_0x383730);_0x5ad929(ut[_0xe463('0x5b')](_0xe463('0x5d')));});});};Fax[_0xe463('0x21')][_0xe463('0x5e')]=function(_0x34d6b8){var _0x152fae=this;return new BPromise(function(_0x501780,_0x462ec3){var _0x1ebcab=_0x152fae['checkTrunk'](_0x152fae[_0xe463('0x10')][_0x34d6b8[_0xe463('0x5a')]][_0xe463('0x5f')],_0x34d6b8);if(_0x1ebcab[_0xe463('0x60')]){_0x501780(ut[_0xe463('0x5b')]('Trunk\x20Reachable'));}else{_0x462ec3(ut[_0xe463('0x5b')](_0x1ebcab[_0xe463('0x5b')]));}});};function originate(_0x5e8fc2,_0x30a4ca,_0xedeac8){return new BPromise(function(_0x351f73,_0x281ed8){if(_0xedeac8){var _0xe62d01=util[_0xe463('0x61')]('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[_0xe463('0x3b')](_0x5e8fc2['path'])[_0xe463('0x28')],_0x5e8fc2[_0xe463('0x3')]);gs[_0xe463('0x62')](_0xe62d01)[_0xe463('0x3e')](function(){_0x5e8fc2[_0xe463('0x3')]=util['format'](_0xe463('0x63'),path[_0xe463('0x3b')](_0x5e8fc2[_0xe463('0x3')])[_0xe463('0x64')],path['parse'](_0x5e8fc2[_0xe463('0x3')])[_0xe463('0x28')]);_0x30a4ca['XMF-PATH']=_0x5e8fc2[_0xe463('0x3')];ut[_0xe463('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0xe463('0x65')](ut[_0xe463('0x66')](_0x5e8fc2,_0x30a4ca))[_0xe463('0x3e')](function(_0x1133b8){_0x351f73(_0x1133b8);})[_0xe463('0x40')](function(_0x3b7539){_0x281ed8(_0x3b7539);});})['catch'](function(_0x529c82){_0x281ed8(_0x529c82);});}else{ami[_0xe463('0x65')](ut[_0xe463('0x66')](_0x5e8fc2,_0x30a4ca))[_0xe463('0x3e')](function(_0x25c459){_0x351f73(_0x25c459);})['catch'](function(_0xdd4ab6){_0x281ed8(_0xdd4ab6);});}});}Fax[_0xe463('0x21')][_0xe463('0x67')]=function(_0x430577,_0x3b3448){var _0x20a77=this;return new BPromise(function(_0x47e8a1,_0x5b0308){var _0x27c312=uuid['v4']();var _0xf5fc08=ut[_0xe463('0x68')](_0x430577,_0x3b3448);_0x20a77[_0xe463('0x12')][_0x27c312]=new Action(_0x27c312,_0x3b3448,_0x430577);var _0x4dc3a3=_0x20a77[_0xe463('0x12')][_0x27c312];if(path[_0xe463('0x3b')](_0x430577[_0xe463('0x3')])[_0xe463('0x69')]==='.pdf'){originate(_0x4dc3a3,_0xf5fc08,!![])[_0xe463('0x3e')](function(_0x4f5101){_0x47e8a1(_0x4f5101);})['catch'](function(_0x39d6d3){_0x5b0308(_0x39d6d3);});}else{originate(_0x4dc3a3,_0xf5fc08,![])['then'](function(_0x518075){_0x47e8a1(_0x518075);})[_0xe463('0x40')](function(_0x476d85){_0x5b0308(_0x476d85);});}});};Fax[_0xe463('0x21')][_0xe463('0x6a')]=function(_0x9dc308){return!_[_0xe463('0x6b')](_0x9dc308)&&!_[_0xe463('0x6b')](_0x9dc308['name'])&&!_[_0xe463('0x6b')](_0x9dc308[_0xe463('0x6c')])&&_0x9dc308[_0xe463('0x6c')]&&!_[_0xe463('0x6b')](this['trunks'][util[_0xe463('0x61')](_0xe463('0x6d'),_0x9dc308[_0xe463('0x28')])])&&!_[_0xe463('0x6b')](this[_0xe463('0x11')][util[_0xe463('0x61')]('SIP/%s',_0x9dc308[_0xe463('0x28')])][_0xe463('0x30')])&&(this[_0xe463('0x11')][util[_0xe463('0x61')](_0xe463('0x6d'),_0x9dc308['name'])][_0xe463('0x30')]===_0xe463('0x6e')||this[_0xe463('0x11')][util[_0xe463('0x61')](_0xe463('0x6d'),_0x9dc308['name'])][_0xe463('0x30')]===_0xe463('0x6f'));};Fax['prototype'][_0xe463('0x70')]=function(_0x2326eb,_0xb0be11){if(!this[_0xe463('0x6a')](_0x2326eb)){ut[_0xe463('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xe463('0x6b')](_0x2326eb)?'':_0x2326eb[_0xe463('0x28')]+_0xe463('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xe463('0x6b')](_0xb0be11[_0xe463('0x7')])){ut[_0xe463('0x4a')](_0xe463('0x72'),JSON['stringify'](_0xb0be11));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0xb0be11['path'])){ut['logger'](_0xe463('0x73'),JSON[_0xe463('0x53')](_0xb0be11));return{'isValid':![],'message':_0xe463('0x74')};}return{'isValid':!![],'message':_0xe463('0x75')};};module['exports']=Fax; \ No newline at end of file +var _0x912b=['path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','syncNewchannel','varset','bind','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','from-voip-provider','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','channelstate','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','catch','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','message','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','bluebird'];(function(_0x25d97b,_0x235f20){var _0x30631e=function(_0x1b2f3f){while(--_0x1b2f3f){_0x25d97b['push'](_0x25d97b['shift']());}};_0x30631e(++_0x235f20);}(_0x912b,0xe3));var _0xb912=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0x912b[_0x133296];return _0x193517;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xb912('0x0'));var uuid=require('uuid');var moment=require('moment');var path=require(_0xb912('0x1'));var tiff2pdf=require(_0xb912('0x2'));var gs=require(_0xb912('0x3'));var logger=require(_0xb912('0x4'))(_0xb912('0x5'));var ami=require(_0xb912('0x6'));var rpcDb=require(_0xb912('0x7'));var Channel=require(_0xb912('0x8'));var ut=require(_0xb912('0x9'));var Action=require(_0xb912('0xa'));var faxAccount=require(_0xb912('0xb'));var attachment=require(_0xb912('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x13ad02){this[_0xb912('0xd')]={};this[_0xb912('0xe')]=_0x13ad02[_0xb912('0xe')];this[_0xb912('0xf')]=_0x13ad02[_0xb912('0xf')];this[_0xb912('0x10')]={};ami['on']('newchannel',this[_0xb912('0x11')]['bind'](this));ami['on'](_0xb912('0x12'),this['syncVarSet'][_0xb912('0x13')](this));ami['on']('newstate',this[_0xb912('0x14')][_0xb912('0x13')](this));ami['on']('newexten',this[_0xb912('0x15')][_0xb912('0x13')](this));ami['on'](_0xb912('0x16'),this[_0xb912('0x17')]['bind'](this));ami['on'](_0xb912('0x18'),this[_0xb912('0x19')][_0xb912('0x13')](this));ami['on']('hangup',this['syncHangup'][_0xb912('0x13')](this));ami['on'](_0xb912('0x1a'),this[_0xb912('0x1b')][_0xb912('0x13')](this));}Fax['prototype'][_0xb912('0x11')]=function(_0x49ace2){if(_0x49ace2['context']===_0xb912('0x1c')){for(var _0x5b1268 in this['faxAccounts']){if(this[_0xb912('0xe')]['hasOwnProperty'](_0x5b1268)){if(_0x49ace2['exten']===this[_0xb912('0xe')][_0x5b1268]['localstationid']){this[_0xb912('0xd')][_0x49ace2[_0xb912('0x1d')]]={};this['channels'][_0x49ace2['uniqueid']]['channel']=_0x49ace2[_0xb912('0x1e')];this[_0xb912('0xd')][_0x49ace2['uniqueid']]['id']=this[_0xb912('0xe')][_0x5b1268]['id'];this[_0xb912('0xd')][_0x49ace2[_0xb912('0x1d')]][_0xb912('0x1f')]=this[_0xb912('0xe')][_0x5b1268][_0xb912('0x1f')];logger['info'](_0x49ace2['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xb912('0x10')][_0x49ace2['uniqueid']]){this['channels'][_0x49ace2[_0xb912('0x1d')]]={};this['channels'][_0x49ace2['uniqueid']]['channel']=_0x49ace2[_0xb912('0x1e')];logger[_0xb912('0x20')](_0x49ace2[_0xb912('0x1d')],_0xb912('0x21'));}};Fax[_0xb912('0x22')]['syncVarSet']=function(_0x28c768){if(this[_0xb912('0xd')][_0x28c768[_0xb912('0x1d')]]){for(var _0x7f0195 in _0x28c768[_0xb912('0x23')]){if(_0x28c768[_0xb912('0x23')][_0xb912('0x24')](_0x7f0195)){this[_0xb912('0xd')][_0x28c768[_0xb912('0x1d')]][_0x7f0195]=_0x28c768[_0xb912('0x25')];}}}};Fax['prototype'][_0xb912('0x14')]=function(_0x5cbb31){if(this[_0xb912('0xd')][_0x5cbb31[_0xb912('0x1d')]]){this['channels'][_0x5cbb31[_0xb912('0x1d')]][_0xb912('0x26')]=_0x5cbb31['channelstate'];this[_0xb912('0xd')][_0x5cbb31[_0xb912('0x1d')]]['channelstatedesc']=_0x5cbb31['channelstatedesc'];}};Fax['prototype'][_0xb912('0x15')]=function(_0x14f646){if(this[_0xb912('0xd')][_0x14f646[_0xb912('0x1d')]]){for(var _0x4bee05 in _0x14f646['variable']){if(_0x14f646[_0xb912('0x23')][_0xb912('0x24')](_0x4bee05)){this[_0xb912('0xd')][_0x14f646[_0xb912('0x1d')]][_0x4bee05]=_0x14f646[_0xb912('0x25')];}}}};Fax['prototype'][_0xb912('0x17')]=function(_0x1f024e){if(this[_0xb912('0xd')][_0x1f024e[_0xb912('0x1d')]]){this[_0xb912('0xd')][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x27')]=_0x1f024e[_0xb912('0x27')];this['channels'][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x28')]=_0x1f024e[_0xb912('0x28')];this[_0xb912('0xd')][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x29')]=_0x1f024e['localstationid'];this['channels'][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x2a')]=_0x1f024e['filename'];logger['info'](_0x1f024e[_0xb912('0x1d')],'\x20syncFaxStatus\x20');}};Fax[_0xb912('0x22')]['syncReceiveFax']=function(_0xe687ce){var _0x51d4aa=this;if(this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]]){var _0x150d80=this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]]['id'];this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x2b')]=_0xe687ce[_0xb912('0x2b')];this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]]['pagestransferred']=_0xe687ce[_0xb912('0x2c')];this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x29')]=_0xe687ce[_0xb912('0x29')];this['channels'][_0xe687ce['uniqueid']][_0xb912('0x2d')]=_0xe687ce['resolution'];this['channels'][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x2e')]=_0xe687ce['transferrate'];this[_0xb912('0xd')][_0xe687ce['uniqueid']][_0xb912('0x2a')]=_0xe687ce[_0xb912('0x2a')];this['channels'][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x2f')]=_0xe687ce[_0xb912('0x2f')];if(this['channels'][_0xe687ce['uniqueid']][_0xb912('0x2c')]>0x0){tiff2pdf(_0xe687ce['filename'],_0xb912('0x30'),function(_0x18d600){logger[_0xb912('0x20')](_0xe687ce[_0xb912('0x1d')],_0xb912('0x31'),_0x18d600['message']);attachment[_0xb912('0x32')]({'name':path[_0xb912('0x33')](_0xe687ce[_0xb912('0x2a')])['name'],'basename':path['parse'](_0xe687ce[_0xb912('0x2a')])[_0xb912('0x1f')]+_0xb912('0x34'),'type':_0xb912('0x35')})[_0xb912('0x36')](function(_0x15b3fe){faxAccount[_0xb912('0x37')](_0x150d80,{'from':_0xe687ce['calleridnum'],'mapKey':'fax','body':path['parse'](_0xe687ce[_0xb912('0x2a')])[_0xb912('0x1f')]+_0xb912('0x34'),'AttachmentId':_0x15b3fe['id']})[_0xb912('0x38')](function(_0x3550cd){logger['error'](_0xe687ce[_0xb912('0x1d')],'\x20notify\x20',JSON[_0xb912('0x39')](_0x3550cd));});})[_0xb912('0x38')](function(_0x2fbbfa){logger[_0xb912('0x3a')](_0xe687ce[_0xb912('0x1d')],_0xb912('0x3b'),JSON[_0xb912('0x39')](_0x2fbbfa));});});}logger[_0xb912('0x20')](_0xe687ce['uniqueid'],'\x20receiveFax\x20');}};Fax[_0xb912('0x22')][_0xb912('0x1b')]=function(_0x5198f4){if(this[_0xb912('0x10')][_0x5198f4[_0xb912('0x1d')]]){_[_0xb912('0x3c')](this[_0xb912('0xd')][_0x5198f4[_0xb912('0x1d')]],_[_0xb912('0x3d')](_0x5198f4,[_0xb912('0x3e'),_0xb912('0x3f')]));}};function updateStatus(_0x2886fc){if(_0x2886fc[_0xb912('0x40')]){faxMessage[_0xb912('0x41')](_0x2886fc[_0xb912('0x40')],{'failMessage':_0xb912('0x42')})[_0xb912('0x36')](function(_0x38189d){ut[_0xb912('0x43')](_0xb912('0x44'),_0x38189d);})[_0xb912('0x38')](function(_0x9794b5){ut[_0xb912('0x43')]('[Fax][Message][Error][NoUpdate1]',_0x9794b5);});}else{ut[_0xb912('0x43')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0xb912('0x45')]=function(_0x59eb06,_0x5bc9ae,_0xb79132){var _0x1b47b9=this;var _0x559054={};if(_0x5bc9ae){_0x559054={'read':_0x5bc9ae};}else{_0x559054={'failMessage':_0xb79132};}if(this['actions'][_0x59eb06][_0xb912('0x40')]){faxMessage[_0xb912('0x41')](this['actions'][_0x59eb06][_0xb912('0x40')],_0x559054)[_0xb912('0x36')](function(_0x53f17a){ut[_0xb912('0x43')](_0xb912('0x46'),_0x53f17a);})[_0xb912('0x38')](function(_0x43cd46){ut[_0xb912('0x43')](_0xb912('0x47'),_0x43cd46);})[_0xb912('0x48')](function(){delete _0x1b47b9[_0xb912('0xd')][_0x59eb06];delete _0x1b47b9[_0xb912('0x10')][_0x59eb06];});}else{ut[_0xb912('0x43')](_0xb912('0x49'));delete this[_0xb912('0xd')][_0x59eb06];delete this[_0xb912('0x10')][_0x59eb06];}};Fax['prototype'][_0xb912('0x4a')]=function(_0x3f0a08){var _0x5e0306=this;if(this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]]){if(this[_0xb912('0x10')][_0x3f0a08['uniqueid']]){this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]]['id']=this[_0xb912('0x10')][_0x3f0a08['uniqueid']]['id'];this[_0xb912('0xd')][_0x3f0a08['uniqueid']][_0xb912('0x1f')]=this[_0xb912('0x10')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x1f')];}logger[_0xb912('0x20')](_0x3f0a08[_0xb912('0x1d')],this[_0xb912('0x10')][_0x3f0a08[_0xb912('0x1d')]]?_0xb912('0x4b'):'\x20hangup\x20faxRiceive\x20',JSON[_0xb912('0x39')](this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]]));if(this['actions'][_0x3f0a08['uniqueid']]){if(this[_0xb912('0xd')][_0x3f0a08['uniqueid']][_0xb912('0x4c')]>0x0&&this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x16')]===_0xb912('0x4d')){this[_0xb912('0x45')](_0x3f0a08['uniqueid'],!![]);}else{this[_0xb912('0x45')](_0x3f0a08[_0xb912('0x1d')],![],this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x4e')]?_0xb912('0x4f')+this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x4e')]:_0xb912('0x50'));}}}};Fax[_0xb912('0x22')][_0xb912('0x51')]=function(_0x391fcd){var _0x534edd=this;return new BPromise(function(_0x323a79,_0x5399e5){_0x534edd['execOriginate'](_0x391fcd,_0x534edd[_0xb912('0xe')][_0x391fcd['FaxAccountId']])[_0xb912('0x36')](function(_0x16bc53){ut[_0xb912('0x43')](_0xb912('0x52'),_0x16bc53);_0x323a79(ut['message'](_0xb912('0x53')));})[_0xb912('0x38')](function(_0x1c5788){ut['logger'](_0xb912('0x54'),_0x1c5788);updateStatus(_0x391fcd);_0x5399e5(ut['message'](_0xb912('0x55')));});});};Fax[_0xb912('0x22')][_0xb912('0x56')]=function(_0x4e16d9){var _0x372661=this;return new BPromise(function(_0x319a21,_0x2f31f1){var _0x277318=_0x372661[_0xb912('0x57')](_0x372661[_0xb912('0xe')][_0x4e16d9[_0xb912('0x58')]][_0xb912('0x59')],_0x4e16d9);if(_0x277318[_0xb912('0x5a')]){_0x319a21(ut[_0xb912('0x5b')](_0xb912('0x5c')));}else{_0x2f31f1(ut[_0xb912('0x5b')](_0x277318[_0xb912('0x5b')]));}});};function originate(_0x6a7449,_0x24678e,_0x2a098e){return new BPromise(function(_0x56d81e,_0x51478a){if(_0x2a098e){var _0x1cf323=util['format'](_0xb912('0x5d'),path[_0xb912('0x33')](_0x6a7449[_0xb912('0x1')])['name'],_0x6a7449['path']);gs[_0xb912('0x5e')](_0x1cf323)[_0xb912('0x36')](function(){_0x6a7449[_0xb912('0x1')]=util[_0xb912('0x5f')](_0xb912('0x60'),path[_0xb912('0x33')](_0x6a7449[_0xb912('0x1')])['dir'],path[_0xb912('0x33')](_0x6a7449[_0xb912('0x1')])[_0xb912('0x1f')]);_0x24678e[_0xb912('0x61')]=_0x6a7449[_0xb912('0x1')];ut[_0xb912('0x43')](_0xb912('0x62'),'');ami[_0xb912('0x63')](ut['variablesAction'](_0x6a7449,_0x24678e))[_0xb912('0x36')](function(_0x59325f){_0x56d81e(_0x59325f);})[_0xb912('0x38')](function(_0x51819b){_0x51478a(_0x51819b);});})[_0xb912('0x38')](function(_0x3cf77d){_0x51478a(_0x3cf77d);});}else{ami[_0xb912('0x63')](ut[_0xb912('0x64')](_0x6a7449,_0x24678e))['then'](function(_0xa819b1){_0x56d81e(_0xa819b1);})[_0xb912('0x38')](function(_0x159ca9){_0x51478a(_0x159ca9);});}});}Fax['prototype'][_0xb912('0x65')]=function(_0xb54e0c,_0x3db571){var _0x2fa69e=this;return new BPromise(function(_0x5d14c2,_0x35168a){var _0x4d8b0b=uuid['v4']();var _0x18f918=ut[_0xb912('0x66')](_0xb54e0c,_0x3db571);_0x2fa69e[_0xb912('0x10')][_0x4d8b0b]=new Action(_0x4d8b0b,_0x3db571,_0xb54e0c);var _0x4e8de0=_0x2fa69e['actions'][_0x4d8b0b];if(path['parse'](_0xb54e0c['path'])['ext']===_0xb912('0x34')){originate(_0x4e8de0,_0x18f918,!![])[_0xb912('0x36')](function(_0x3a4eaf){_0x5d14c2(_0x3a4eaf);})['catch'](function(_0x4df70b){_0x35168a(_0x4df70b);});}else{originate(_0x4e8de0,_0x18f918,![])[_0xb912('0x36')](function(_0x20b02b){_0x5d14c2(_0x20b02b);})[_0xb912('0x38')](function(_0x56d0e0){_0x35168a(_0x56d0e0);});}});};Fax[_0xb912('0x22')][_0xb912('0x67')]=function(_0x401618){return!_[_0xb912('0x68')](_0x401618)&&!_[_0xb912('0x68')](_0x401618[_0xb912('0x1f')])&&!_[_0xb912('0x68')](_0x401618[_0xb912('0x69')])&&_0x401618[_0xb912('0x69')]&&!_[_0xb912('0x68')](this['trunks'][util[_0xb912('0x5f')](_0xb912('0x6a'),_0x401618[_0xb912('0x1f')])])&&!_[_0xb912('0x68')](this[_0xb912('0xf')][util[_0xb912('0x5f')]('SIP/%s',_0x401618['name'])][_0xb912('0x28')])&&(this[_0xb912('0xf')][util[_0xb912('0x5f')]('SIP/%s',_0x401618[_0xb912('0x1f')])][_0xb912('0x28')]==='reachable'||this[_0xb912('0xf')][util[_0xb912('0x5f')](_0xb912('0x6a'),_0x401618[_0xb912('0x1f')])]['status']===_0xb912('0x6b'));};Fax[_0xb912('0x22')][_0xb912('0x57')]=function(_0x30e51b,_0x38392b){if(!this[_0xb912('0x67')](_0x30e51b)){ut[_0xb912('0x43')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xb912('0x68')](_0x30e51b)?'':_0x30e51b[_0xb912('0x1f')]+_0xb912('0x6c'));return{'isValid':![],'message':_0xb912('0x6d')};}if(_[_0xb912('0x68')](_0x38392b[_0xb912('0x5')])){ut[_0xb912('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xb912('0x39')](_0x38392b));return{'isValid':![],'message':_0xb912('0x6e')};}if(_[_0xb912('0x68')](_0x38392b['path'])){ut[_0xb912('0x43')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xb912('0x39')](_0x38392b));return{'isValid':![],'message':_0xb912('0x6f')};}return{'isValid':!![],'message':_0xb912('0x70')};};module[_0xb912('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 1089590..64abd98 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17a3=['catch','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','resolve','then','notify'];(function(_0x30d5d8,_0x33ad41){var _0x4abd4d=function(_0x308324){while(--_0x308324){_0x30d5d8['push'](_0x30d5d8['shift']());}};_0x4abd4d(++_0x33ad41);}(_0x17a3,0xfe));var _0x317a=function(_0x23347e,_0x350e6c){_0x23347e=_0x23347e-0x0;var _0x24efed=_0x17a3[_0x23347e];return _0x24efed;};'use strict';var util=require(_0x317a('0x0'));var BPromise=require('bluebird');var logger=require(_0x317a('0x1'))(_0x317a('0x2'));var _=require(_0x317a('0x3'));var faxAccount=require(_0x317a('0x4'));function loggerCatch(_0x165049){return function(_0x20d1e4){logger[_0x317a('0x5')](_0x165049,util[_0x317a('0x6')](_0x20d1e4,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4613dc,_0x15e147){return BPromise[_0x317a('0x7')]()[_0x317a('0x8')](faxAccount[_0x317a('0x9')](_0x4613dc,_0x15e147))[_0x317a('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x262f=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20'];(function(_0x1e4050,_0x3fdee2){var _0x16b997=function(_0x1034ab){while(--_0x1034ab){_0x1e4050['push'](_0x1e4050['shift']());}};_0x16b997(++_0x3fdee2);}(_0x262f,0x1ef));var _0xf262=function(_0x454f36,_0x579666){_0x454f36=_0x454f36-0x0;var _0x387b6e=_0x262f[_0x454f36];return _0x387b6e;};'use strict';var util=require('util');var BPromise=require(_0xf262('0x0'));var logger=require(_0xf262('0x1'))(_0xf262('0x2'));var _=require(_0xf262('0x3'));var faxAccount=require(_0xf262('0x4'));function loggerCatch(_0x4e527b){return function(_0x1aa223){logger[_0xf262('0x5')](_0x4e527b,util[_0xf262('0x6')](_0x1aa223,{'showHidden':![],'depth':null}));};}exports[_0xf262('0x7')]=function(_0x9e410e,_0x1b24c0){return BPromise[_0xf262('0x8')]()[_0xf262('0x9')](faxAccount[_0xf262('0x7')](_0x9e410e,_0x1b24c0))['catch'](loggerCatch(_0xf262('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index ba9cf98..a55e041 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4ef=['Exec\x20gs','util','../../../../config/logger','fax','bluebird','child_process','exec','info'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xc4ef,0xe9));var _0xfc4e=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0xc4ef[_0x9e0cb3];return _0x5926b7;};'use strict';var util=require(_0xfc4e('0x0'));var logger=require(_0xfc4e('0x1'))(_0xfc4e('0x2'));var BPromise=require(_0xfc4e('0x3'));var exec=require(_0xfc4e('0x4'))[_0xfc4e('0x5')];exports['execute']=function(_0x281a32){return new BPromise(function(_0x242729,_0x2163fe){exec(_0x281a32,function(_0x12e4ae,_0x3bf2ca,_0x39bc82){logger[_0xfc4e('0x6')](_0xfc4e('0x7'),_0x3bf2ca);if(_0x12e4ae){logger[_0xfc4e('0x6')]('Exec\x20gs','\x20Error\x20:',util['inspect'](_0x12e4ae,{'showHidden':![],'depth':null}),_0x3bf2ca,_0x39bc82);_0x2163fe(_0x12e4ae);}_0x242729(_0x3bf2ca);});});}; \ No newline at end of file +var _0x8222=['inspect','../../../../config/logger','fax','child_process','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x8222,0x191));var _0x2822=function(_0x514d12,_0x4b4234){_0x514d12=_0x514d12-0x0;var _0x519434=_0x8222[_0x514d12];return _0x519434;};'use strict';var util=require('util');var logger=require(_0x2822('0x0'))(_0x2822('0x1'));var BPromise=require('bluebird');var exec=require(_0x2822('0x2'))[_0x2822('0x3')];exports['execute']=function(_0x142edf){return new BPromise(function(_0x499f5c,_0x839c2d){exec(_0x142edf,function(_0x4057df,_0x3b3007,_0x367658){logger[_0x2822('0x4')](_0x2822('0x5'),_0x3b3007);if(_0x4057df){logger[_0x2822('0x4')](_0x2822('0x5'),_0x2822('0x6'),util[_0x2822('0x7')](_0x4057df,{'showHidden':![],'depth':null}),_0x3b3007,_0x367658);_0x839c2d(_0x4057df);}_0x499f5c(_0x3b3007);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index ee6992c..fe5c77d 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ffd=['fax','logger','info','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','channel','xcally-motion-fax','from-sip','lodash','moment','../../../../config/logger'];(function(_0x401b1a,_0x24bddf){var _0x51e72f=function(_0x3cd0e9){while(--_0x3cd0e9){_0x401b1a['push'](_0x401b1a['shift']());}};_0x51e72f(++_0x24bddf);}(_0x2ffd,0xc3));var _0xd2ff=function(_0x153bc0,_0x16e027){_0x153bc0=_0x153bc0-0x0;var _0x470629=_0x2ffd[_0x153bc0];return _0x470629;};'use strict';var util=require('util');var _=require(_0xd2ff('0x0'));var moment=require(_0xd2ff('0x1'));var logger=require(_0xd2ff('0x2'))(_0xd2ff('0x3'));exports['message']=function(_0x4ef177){return{'message':_0x4ef177};};exports[_0xd2ff('0x4')]=function(_0x57bd00,_0x4c04c3){logger[_0xd2ff('0x5')](_0x57bd00,util['inspect'](_0x4c04c3,{'showHidden':![],'depth':null}));};exports[_0xd2ff('0x6')]=function(_0x42a5e5,_0x3c5f84){var _0x4d4459={'XMF-ECM':_0x3c5f84[_0xd2ff('0x7')],'XMF-HEADERINFO':_0x3c5f84[_0xd2ff('0x8')],'XMF-MINRATE':_0x3c5f84[_0xd2ff('0x9')],'XMF-MAXRATE':_0x3c5f84[_0xd2ff('0xa')],'XMF-MODEM':util[_0xd2ff('0xb')]('\x22%s\x22',_0x3c5f84[_0xd2ff('0xc')]),'XMF-GATEWAY':_0x3c5f84[_0xd2ff('0xd')],'XMF-FAXDETECT':_0x3c5f84[_0xd2ff('0xe')],'XMF-T38TIMEOUT':_0x3c5f84[_0xd2ff('0xf')],'XMF-LOCALSTATIONID':_0x3c5f84[_0xd2ff('0x10')],'XMF-PATH':_0x42a5e5[_0xd2ff('0x11')]};return _0x4d4459;};exports['variablesAction']=function(_0x16edde,_0x261fcd){return{'actionid':_0x16edde[_0xd2ff('0x12')],'action':'originate','channel':_0x16edde[_0xd2ff('0x13')],'Exten':_0xd2ff('0x14'),'Context':_0xd2ff('0x15'),'Priority':'1','callerid':util[_0xd2ff('0xb')]('\x22%s\x22\x20<%s>',_0x16edde[_0xd2ff('0x8')]?_0x16edde[_0xd2ff('0x8')]:'',_0x16edde[_0xd2ff('0x10')]),'variable':_0x261fcd,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x16edde['uniqueid']};}; \ No newline at end of file +var _0x7cb2=['\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','message','info','addVariables','headerinfo','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x7cb2,0x178));var _0x27cb=function(_0x555497,_0x6a6ce7){_0x555497=_0x555497-0x0;var _0x1c5541=_0x7cb2[_0x555497];return _0x1c5541;};'use strict';var util=require('util');var _=require(_0x27cb('0x0'));var moment=require(_0x27cb('0x1'));var logger=require(_0x27cb('0x2'))(_0x27cb('0x3'));exports[_0x27cb('0x4')]=function(_0x2b7c7c){return{'message':_0x2b7c7c};};exports['logger']=function(_0x2c62b4,_0x37045a){logger[_0x27cb('0x5')](_0x2c62b4,util['inspect'](_0x37045a,{'showHidden':![],'depth':null}));};exports[_0x27cb('0x6')]=function(_0x3ca9ec,_0xeddcf3){var _0x1fade4={'XMF-ECM':_0xeddcf3['ecm'],'XMF-HEADERINFO':_0xeddcf3[_0x27cb('0x7')],'XMF-MINRATE':_0xeddcf3['minrate'],'XMF-MAXRATE':_0xeddcf3[_0x27cb('0x8')],'XMF-MODEM':util[_0x27cb('0x9')]('\x22%s\x22',_0xeddcf3[_0x27cb('0xa')]),'XMF-GATEWAY':_0xeddcf3[_0x27cb('0xb')],'XMF-FAXDETECT':_0xeddcf3[_0x27cb('0xc')],'XMF-T38TIMEOUT':_0xeddcf3[_0x27cb('0xd')],'XMF-LOCALSTATIONID':_0xeddcf3[_0x27cb('0xe')],'XMF-PATH':_0x3ca9ec[_0x27cb('0xf')]};return _0x1fade4;};exports[_0x27cb('0x10')]=function(_0x3fc305,_0x3e9a64){return{'actionid':_0x3fc305['uniqueid'],'action':'originate','channel':_0x3fc305[_0x27cb('0x11')],'Exten':_0x27cb('0x12'),'Context':_0x27cb('0x13'),'Priority':'1','callerid':util[_0x27cb('0x9')](_0x27cb('0x14'),_0x3fc305[_0x27cb('0x7')]?_0x3fc305['headerinfo']:'',_0x3fc305[_0x27cb('0xe')]),'variable':_0x3e9a64,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3fc305[_0x27cb('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9ca67fa..a141e7d 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c72=['initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','moment','./server','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports'];(function(_0x513a3d,_0x5441fd){var _0x18e146=function(_0x37ae94){while(--_0x37ae94){_0x513a3d['push'](_0x513a3d['shift']());}};_0x18e146(++_0x5441fd);}(_0x4c72,0x1b4));var _0x24c7=function(_0x5b7d8e,_0xd36032){_0x5b7d8e=_0x5b7d8e-0x0;var _0x2cec85=_0x4c72[_0x5b7d8e];return _0x2cec85;};'use strict';var util=require('util');var moment=require(_0x24c7('0x0'));var server=require(_0x24c7('0x1'));var Realtime=require('./realtime');var Report=require(_0x24c7('0x2'));var Acw=require(_0x24c7('0x3'));var Trigger=require(_0x24c7('0x4'));var Dialer=require(_0x24c7('0x5'));var Preview=require(_0x24c7('0x6'));var Fax=require('./fax');var user=require(_0x24c7('0x7'));var voiceQueue=require(_0x24c7('0x8'));var voiceQueueReport=require(_0x24c7('0x9'));var voiceCallReport=require(_0x24c7('0xa'));var trunk=require(_0x24c7('0xb'));var trigger=require(_0x24c7('0xc'));var template=require(_0x24c7('0xd'));var cmHopperHistory=require(_0x24c7('0xe'));var campaign=require(_0x24c7('0xf'));var voiceExtension=require(_0x24c7('0x10'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x24c7('0x11'));var salesforce=require(_0x24c7('0x12'));var sugarcrm=require(_0x24c7('0x13'));var freshdesk=require(_0x24c7('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x24c7('0x15'));var freshsales=require(_0x24c7('0x16'));var servicenow=require(_0x24c7('0x17'));var dynamics365=require(_0x24c7('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x24c7('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x24c7('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x24c7('0x1a')](_0x24c7('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x24c7('0x1c')]()[_0x24c7('0x1d')](user[_0x24c7('0x1e')]())[_0x24c7('0x1d')](realtime['initAgents']())[_0x24c7('0x1d')](user[_0x24c7('0x1f')]())[_0x24c7('0x1d')](realtime['initTelephones']())[_0x24c7('0x1d')](trunk[_0x24c7('0x20')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x21')]())[_0x24c7('0x1d')](voiceQueue['getVoiceQueues']())[_0x24c7('0x1d')](realtime[_0x24c7('0x22')]())[_0x24c7('0x1d')](trigger[_0x24c7('0x23')]())['then'](realtime[_0x24c7('0x24')]())[_0x24c7('0x1d')](template['getTemplates']())[_0x24c7('0x1d')](realtime['initTemplates']())[_0x24c7('0x1d')](zendesk[_0x24c7('0x25')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x26')]())[_0x24c7('0x1d')](salesforce[_0x24c7('0x27')]())[_0x24c7('0x1d')](realtime['initSalesforceAccounts']())[_0x24c7('0x1d')](sugarcrm[_0x24c7('0x28')]())['then'](realtime[_0x24c7('0x29')]())['then'](freshdesk[_0x24c7('0x2a')]())['then'](realtime[_0x24c7('0x2b')]())[_0x24c7('0x1d')](desk[_0x24c7('0x2c')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x2d')]())[_0x24c7('0x1d')](zoho[_0x24c7('0x2e')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x2f')]())[_0x24c7('0x1d')](vtiger[_0x24c7('0x30')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x31')]())[_0x24c7('0x1d')](freshsales[_0x24c7('0x32')]())['then'](realtime[_0x24c7('0x33')]())['then'](servicenow[_0x24c7('0x34')]())['then'](realtime[_0x24c7('0x35')]())[_0x24c7('0x1d')](dynamics365[_0x24c7('0x36')]())[_0x24c7('0x1d')](realtime['initDynamics365Accounts']())[_0x24c7('0x1d')](campaign['getCampaigns']())[_0x24c7('0x1d')](realtime[_0x24c7('0x37')]())[_0x24c7('0x1d')](voiceExtension[_0x24c7('0x38')]())[_0x24c7('0x1d')](realtime['initVoiceExtensions']())[_0x24c7('0x1d')](faxAccount[_0x24c7('0x39')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x3a')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x24c7('0x1c')]()[_0x24c7('0x1d')](voiceQueueReport[_0x24c7('0x3b')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x3c')]())[_0x24c7('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x24c7('0x1d')](realtime[_0x24c7('0x3d')]())[_0x24c7('0x1d')](cmHopperHistory['getCampaignHopperHistory']())[_0x24c7('0x1d')](realtime[_0x24c7('0x3e')]())[_0x24c7('0x1d')](voiceCallReport[_0x24c7('0x3f')]())[_0x24c7('0x1d')](realtime[_0x24c7('0x40')]())[_0x24c7('0x41')](function(_0x7f64f1){logger[_0x24c7('0x42')](_0x24c7('0x43'),util[_0x24c7('0x44')](_0x7f64f1,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x24c7('0x1d')](function(){return initRealtime();})[_0x24c7('0x1d')](function(){return initParams();})[_0x24c7('0x1d')](function(){report[_0x24c7('0x45')]();setInterval(initRealtime,0x1388);})[_0x24c7('0x41')](function(_0x3aa15){logger['error'](_0x24c7('0x46'),util['inspect'](_0x3aa15,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x5eed=['moment','./realtime','./report','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','util'];(function(_0x525976,_0x31512c){var _0xc59856=function(_0x53d9a3){while(--_0x53d9a3){_0x525976['push'](_0x525976['shift']());}};_0xc59856(++_0x31512c);}(_0x5eed,0x8d));var _0xd5ee=function(_0x592cbf,_0x366c2a){_0x592cbf=_0x592cbf-0x0;var _0x1b573b=_0x5eed[_0x592cbf];return _0x1b573b;};'use strict';var util=require(_0xd5ee('0x0'));var moment=require(_0xd5ee('0x1'));var server=require('./server');var Realtime=require(_0xd5ee('0x2'));var Report=require(_0xd5ee('0x3'));var Acw=require(_0xd5ee('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0xd5ee('0x5'));var Fax=require(_0xd5ee('0x6'));var user=require(_0xd5ee('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xd5ee('0x8'));var voiceCallReport=require(_0xd5ee('0x9'));var trunk=require(_0xd5ee('0xa'));var trigger=require(_0xd5ee('0xb'));var template=require(_0xd5ee('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xd5ee('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xd5ee('0xe'));var zendesk=require(_0xd5ee('0xf'));var salesforce=require(_0xd5ee('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xd5ee('0x11'));var zoho=require(_0xd5ee('0x12'));var vtiger=require(_0xd5ee('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xd5ee('0x14'));var dynamics365=require(_0xd5ee('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xd5ee('0x16'))(_0xd5ee('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd5ee('0x18')](_0xd5ee('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd5ee('0x18')](_0xd5ee('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xd5ee('0x1a')]()[_0xd5ee('0x1b')](user[_0xd5ee('0x1c')]())['then'](realtime[_0xd5ee('0x1d')]())[_0xd5ee('0x1b')](user[_0xd5ee('0x1e')]())['then'](realtime[_0xd5ee('0x1f')]())['then'](trunk[_0xd5ee('0x20')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x21')]())[_0xd5ee('0x1b')](voiceQueue['getVoiceQueues']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x22')]())[_0xd5ee('0x1b')](trigger['getTriggers']())['then'](realtime[_0xd5ee('0x23')]())['then'](template[_0xd5ee('0x24')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x25')]())[_0xd5ee('0x1b')](zendesk['getZendeskAccounts']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x26')]())[_0xd5ee('0x1b')](salesforce[_0xd5ee('0x27')]())[_0xd5ee('0x1b')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0xd5ee('0x28')]())['then'](realtime[_0xd5ee('0x29')]())[_0xd5ee('0x1b')](freshdesk[_0xd5ee('0x2a')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x2b')]())[_0xd5ee('0x1b')](desk[_0xd5ee('0x2c')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x2d')]())[_0xd5ee('0x1b')](zoho['getZohoAccounts']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x2e')]())[_0xd5ee('0x1b')](vtiger[_0xd5ee('0x2f')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x30')]())[_0xd5ee('0x1b')](freshsales[_0xd5ee('0x31')]())[_0xd5ee('0x1b')](realtime['initFreshsalesAccounts']())[_0xd5ee('0x1b')](servicenow[_0xd5ee('0x32')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x33')]())[_0xd5ee('0x1b')](dynamics365[_0xd5ee('0x34')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x35')]())[_0xd5ee('0x1b')](campaign['getCampaigns']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x36')]())[_0xd5ee('0x1b')](voiceExtension[_0xd5ee('0x37')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x38')]())['then'](faxAccount[_0xd5ee('0x39')]())['then'](realtime[_0xd5ee('0x3a')]())[_0xd5ee('0x1b')](function(){return realtime;});}function initParams(){return Promise[_0xd5ee('0x1a')]()[_0xd5ee('0x1b')](voiceQueueReport[_0xd5ee('0x3b')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x3c')]())[_0xd5ee('0x1b')](cmHopperHistory[_0xd5ee('0x3d')]())[_0xd5ee('0x1b')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x3e')]())[_0xd5ee('0x1b')](voiceCallReport[_0xd5ee('0x3f')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x40')]())[_0xd5ee('0x41')](function(_0x1e1dc6){logger[_0xd5ee('0x42')](_0xd5ee('0x43'),util['inspect'](_0x1e1dc6,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd5ee('0x44')](realtime,preview,fax)[_0xd5ee('0x1b')](function(){return initRealtime();})[_0xd5ee('0x1b')](function(){return initParams();})[_0xd5ee('0x1b')](function(){report[_0xd5ee('0x45')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x17d69a){logger['error'](_0xd5ee('0x46'),util['inspect'](_0x17d69a,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 6a2b7a6..883ac15 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb29d=['voiceStatus','statePause','toNumber','format','stateTime','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','md5','ioredis','localhost','name','email','accountcode','fullname','state','unknown','status','address','phone','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','toLowerCase','not_inuse','inuse'];(function(_0x22730b,_0x3aafcd){var _0x20af64=function(_0x27b43e){while(--_0x27b43e){_0x22730b['push'](_0x22730b['shift']());}};_0x20af64(++_0x3aafcd);}(_0xb29d,0x107));var _0xdb29=function(_0x4b3c41,_0x309c20){_0x4b3c41=_0x4b3c41-0x0;var _0x24e289=_0xb29d[_0x4b3c41];return _0x24e289;};'use strict';var _=require(_0xdb29('0x0'));var util=require(_0xdb29('0x1'));var moment=require(_0xdb29('0x2'));var md5=require(_0xdb29('0x3'));var Redis=require(_0xdb29('0x4'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xdb29('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x36b159){this['id']=_0x36b159['id']||0x0;this['name']=_0x36b159[_0xdb29('0x6')]||'';this[_0xdb29('0x7')]=_0x36b159[_0xdb29('0x7')]||'';this[_0xdb29('0x8')]=_0x36b159[_0xdb29('0x8')]||'';this[_0xdb29('0x9')]=_0x36b159[_0xdb29('0x9')]||'';this[_0xdb29('0xa')]=_0xdb29('0xb');this['stateTime']=0x0;this[_0xdb29('0xc')]='unknown';this[_0xdb29('0xd')]='';this[_0xdb29('0xe')]='';this['mobile']='';this['interface']='';this[_0xdb29('0xf')]=_0x36b159['online']||![];this['voiceStatus']=_0xdb29('0xb');this[_0xdb29('0x10')]=0x0;this[_0xdb29('0x11')]='';this[_0xdb29('0x12')]='';this[_0xdb29('0x13')]=![];this[_0xdb29('0x14')]=![];this['md5']='';}Agent[_0xdb29('0x15')]['updateStatusRealtime']=function(_0x5f4419){var _0x37f5fe;if(_0x5f4419&&_0x5f4419['state']){_0x37f5fe=_0x5f4419[_0xdb29('0xa')][_0xdb29('0x16')]();switch(_0x37f5fe){case _0xdb29('0x17'):_0x37f5fe='idle';break;case _0xdb29('0x18'):_0x37f5fe='talking';break;}}if(_0x37f5fe&&this[_0xdb29('0x19')]!==_0x37f5fe||_0x5f4419[_0xdb29('0x1a')]){this[_0xdb29('0x10')]=_[_0xdb29('0x1b')](moment()[_0xdb29('0x1c')]('x'));}if(_0x37f5fe){this[_0xdb29('0x19')]=_0x37f5fe;}var _0x41dc4e={'id':this['id'],'name':this[_0xdb29('0x6')],'email':this[_0xdb29('0x7')],'accountcode':this[_0xdb29('0x8')],'fullname':this['fullname'],'state':this[_0xdb29('0xa')],'stateTime':this[_0xdb29('0x1d')],'status':this[_0xdb29('0xc')],'address':this[_0xdb29('0xd')],'online':this[_0xdb29('0xf')],'voiceStatus':this[_0xdb29('0x19')],'voiceStatusTime':this[_0xdb29('0x10')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0xdb29('0x13')]};var _0x1ea363=md5(JSON[_0xdb29('0x1e')](_0x41dc4e));if(this['md5']!==_0x1ea363){this[_0xdb29('0x3')]=_0x1ea363;io['to'](util[_0xdb29('0x1c')](_0xdb29('0x1f'),_0x41dc4e[_0xdb29('0x6')]))[_0xdb29('0x20')](_0xdb29('0x21'),_0x41dc4e);io[_0xdb29('0x20')](_0xdb29('0x22'),_0x41dc4e);}};module[_0xdb29('0x23')]=Agent; \ No newline at end of file +var _0x880f=['md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','address','voiceStatusCallerIdNumber','stringify','user:%s','user:save','user:presence','exports','lodash','moment','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','phone','mobile','interface','online','voiceStatus','voiceStatusTime','onhold','local'];(function(_0x1e7add,_0x3f9fdc){var _0x56582d=function(_0x200e66){while(--_0x200e66){_0x1e7add['push'](_0x1e7add['shift']());}};_0x56582d(++_0x3f9fdc);}(_0x880f,0x12a));var _0xf880=function(_0x3768b2,_0x2c412f){_0x3768b2=_0x3768b2-0x0;var _0x28dadf=_0x880f[_0x3768b2];return _0x28dadf;};'use strict';var _=require(_0xf880('0x0'));var util=require('util');var moment=require(_0xf880('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xf880('0x2'));config[_0xf880('0x3')]=_['defaults'](config[_0xf880('0x3')],{'host':_0xf880('0x4'),'port':0x18eb});var io=require(_0xf880('0x5'))(new Redis(config[_0xf880('0x3')]));function Agent(_0x365b5a){this['id']=_0x365b5a['id']||0x0;this[_0xf880('0x6')]=_0x365b5a[_0xf880('0x6')]||'';this[_0xf880('0x7')]=_0x365b5a[_0xf880('0x7')]||'';this[_0xf880('0x8')]=_0x365b5a[_0xf880('0x8')]||'';this[_0xf880('0x9')]=_0x365b5a[_0xf880('0x9')]||'';this[_0xf880('0xa')]='unknown';this[_0xf880('0xb')]=0x0;this[_0xf880('0xc')]=_0xf880('0xd');this['address']='';this[_0xf880('0xe')]='';this[_0xf880('0xf')]='';this[_0xf880('0x10')]='';this[_0xf880('0x11')]=_0x365b5a[_0xf880('0x11')]||![];this[_0xf880('0x12')]=_0xf880('0xd');this[_0xf880('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0xf880('0x14')]=![];this[_0xf880('0x15')]=![];this[_0xf880('0x16')]='';}Agent[_0xf880('0x17')][_0xf880('0x18')]=function(_0xf354a1){var _0x5d05b0;if(_0xf354a1&&_0xf354a1['state']){_0x5d05b0=_0xf354a1[_0xf880('0xa')][_0xf880('0x19')]();switch(_0x5d05b0){case _0xf880('0x1a'):_0x5d05b0=_0xf880('0x1b');break;case _0xf880('0x1c'):_0x5d05b0=_0xf880('0x1d');break;}}if(_0x5d05b0&&this[_0xf880('0x12')]!==_0x5d05b0||_0xf354a1[_0xf880('0x1e')]){this[_0xf880('0x13')]=_[_0xf880('0x1f')](moment()[_0xf880('0x20')]('x'));}if(_0x5d05b0){this[_0xf880('0x12')]=_0x5d05b0;}var _0x2dfc83={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0xf880('0x9')],'state':this[_0xf880('0xa')],'stateTime':this[_0xf880('0xb')],'status':this[_0xf880('0xc')],'address':this[_0xf880('0x21')],'online':this[_0xf880('0x11')],'voiceStatus':this[_0xf880('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xf880('0x22')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0xf880('0x14')]};var _0x1d32cc=md5(JSON[_0xf880('0x23')](_0x2dfc83));if(this[_0xf880('0x16')]!==_0x1d32cc){this[_0xf880('0x16')]=_0x1d32cc;io['to'](util[_0xf880('0x20')](_0xf880('0x24'),_0x2dfc83[_0xf880('0x6')]))['emit'](_0xf880('0x25'),_0x2dfc83);io['emit'](_0xf880('0x26'),_0x2dfc83);}};module[_0xf880('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 68ef7af..5392f9f 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x606c=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0xce3797,_0x1671a3){var _0x7849f3=function(_0x396abc){while(--_0x396abc){_0xce3797['push'](_0xce3797['shift']());}};_0x7849f3(++_0x1671a3);}(_0x606c,0x12d));var _0xc606=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x606c[_0x562362];return _0x3a18ce;};'use strict';function Campaign(_0x47583f){this['id']=_0x47583f['id']||0x0;this[_0xc606('0x0')]=_0x47583f[_0xc606('0x0')]||'';this['type']=_0x47583f['type']||_0xc606('0x1');this[_0xc606('0x2')]=0x0;this[_0xc606('0x3')]=0x0;this[_0xc606('0x4')]=0x0;this[_0xc606('0x5')]=0x0;this['message']='';this[_0xc606('0x6')]=!![];this[_0xc606('0x7')]=_0x47583f[_0xc606('0x7')];this[_0xc606('0x8')]=_0x47583f[_0xc606('0x8')];this[_0xc606('0x9')]=_0x47583f[_0xc606('0x9')]||null;this[_0xc606('0xa')]=_0x47583f[_0xc606('0xa')]?_0x47583f[_0xc606('0xa')]:null;this[_0xc606('0xb')]=_0x47583f[_0xc606('0xb')];this[_0xc606('0xc')]=_0x47583f[_0xc606('0xc')];this[_0xc606('0xd')]=_0x47583f[_0xc606('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x47583f[_0xc606('0xe')];this['dialCongestionRetryFrequency']=_0x47583f[_0xc606('0xf')];this[_0xc606('0x10')]=_0x47583f[_0xc606('0x10')];this[_0xc606('0x11')]=_0x47583f[_0xc606('0x11')];this[_0xc606('0x12')]=_0x47583f[_0xc606('0x12')];this[_0xc606('0x13')]=_0x47583f[_0xc606('0x13')];this[_0xc606('0x14')]=_0x47583f['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x47583f['dialNoSuchNumberMaxRetry']||0x3;this[_0xc606('0x15')]=_0x47583f[_0xc606('0x15')]||0x96;this[_0xc606('0x16')]=_0x47583f[_0xc606('0x16')]||0x3;this[_0xc606('0x17')]=_0x47583f['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x47583f['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x47583f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x47583f[_0xc606('0x18')]||0x3;this[_0xc606('0x19')]=_0x47583f[_0xc606('0x19')]||0x96;this[_0xc606('0x1a')]=_0x47583f[_0xc606('0x1a')]||0x3;this[_0xc606('0x1b')]=_0x47583f[_0xc606('0x1b')]||0x96;this[_0xc606('0x1c')]=_0x47583f[_0xc606('0x1c')]||'DESC';this['dialPrefix']=_0x47583f['dialPrefix']||undefined;this[_0xc606('0x1d')]=_0x47583f[_0xc606('0x1d')]||undefined;this[_0xc606('0x1e')]=_0x47583f[_0xc606('0x1e')]||undefined;this['TrunkBackup']=_0x47583f[_0xc606('0x1f')]?_0x47583f['TrunkBackup']:undefined;this[_0xc606('0x20')]=_0x47583f[_0xc606('0x20')]?_0x47583f[_0xc606('0x20')]:undefined;this[_0xc606('0x21')]=_0x47583f[_0xc606('0x21')]?_0x47583f[_0xc606('0x21')]:undefined;this[_0xc606('0x22')]=_0x47583f['SquareProject']?_0x47583f[_0xc606('0x22')]:undefined;this[_0xc606('0x23')]=_0x47583f['SquareProject']?_0x47583f[_0xc606('0x22')][_0xc606('0x0')]:undefined;this[_0xc606('0x24')]=_0x47583f['dialAMDActive']||![];this[_0xc606('0x25')]=_0x47583f[_0xc606('0x25')];this[_0xc606('0x26')]=_0x47583f['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x47583f['dialAMDAfterGreetingSilence'];this[_0xc606('0x27')]=_0x47583f['dialAMDTotalAnalysisTime'];this[_0xc606('0x28')]=_0x47583f[_0xc606('0x28')];this[_0xc606('0x29')]=_0x47583f[_0xc606('0x29')];this['dialAMDMaximumNumberOfWords']=_0x47583f[_0xc606('0x2a')];this[_0xc606('0x2b')]=_0x47583f[_0xc606('0x2b')];this[_0xc606('0x2c')]=_0x47583f[_0xc606('0x2c')];}module[_0xc606('0x2d')]=Campaign; \ No newline at end of file +var _0x0b52=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x323001,_0x298913){var _0xed6576=function(_0x207ae1){while(--_0x207ae1){_0x323001['push'](_0x323001['shift']());}};_0xed6576(++_0x298913);}(_0x0b52,0x19c));var _0x20b5=function(_0x477abc,_0x8cd85c){_0x477abc=_0x477abc-0x0;var _0x1aa34a=_0x0b52[_0x477abc];return _0x1aa34a;};'use strict';function Campaign(_0x3a1c5f){this['id']=_0x3a1c5f['id']||0x0;this[_0x20b5('0x0')]=_0x3a1c5f[_0x20b5('0x0')]||'';this[_0x20b5('0x1')]=_0x3a1c5f[_0x20b5('0x1')]||_0x20b5('0x2');this[_0x20b5('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x20b5('0x4')]=0x0;this['message']='';this[_0x20b5('0x5')]=!![];this['active']=_0x3a1c5f[_0x20b5('0x6')];this['limitCalls']=_0x3a1c5f[_0x20b5('0x7')];this[_0x20b5('0x8')]=_0x3a1c5f['dialTimezone']||null;this[_0x20b5('0x9')]=_0x3a1c5f['dialGlobalInterval']?_0x3a1c5f[_0x20b5('0x9')]:null;this[_0x20b5('0xa')]=_0x3a1c5f[_0x20b5('0xa')];this[_0x20b5('0xb')]=_0x3a1c5f[_0x20b5('0xb')];this[_0x20b5('0xc')]=_0x3a1c5f[_0x20b5('0xc')]||0x1e;this[_0x20b5('0xd')]=_0x3a1c5f['dialCongestionMaxRetry'];this[_0x20b5('0xe')]=_0x3a1c5f[_0x20b5('0xe')];this['dialBusyMaxRetry']=_0x3a1c5f[_0x20b5('0xf')];this[_0x20b5('0x10')]=_0x3a1c5f[_0x20b5('0x10')];this[_0x20b5('0x11')]=_0x3a1c5f['dialNoAnswerMaxRetry'];this[_0x20b5('0x12')]=_0x3a1c5f[_0x20b5('0x12')];this[_0x20b5('0x13')]=_0x3a1c5f[_0x20b5('0x13')];this[_0x20b5('0x14')]=_0x3a1c5f['dialNoSuchNumberMaxRetry']||0x3;this[_0x20b5('0x15')]=_0x3a1c5f[_0x20b5('0x15')]||0x96;this['dialDropMaxRetry']=_0x3a1c5f[_0x20b5('0x16')]||0x3;this[_0x20b5('0x17')]=_0x3a1c5f[_0x20b5('0x17')]||0x96;this[_0x20b5('0x18')]=_0x3a1c5f[_0x20b5('0x18')]||0x3;this[_0x20b5('0x19')]=_0x3a1c5f[_0x20b5('0x19')]||0x96;this[_0x20b5('0x1a')]=_0x3a1c5f[_0x20b5('0x1a')]||0x3;this[_0x20b5('0x1b')]=_0x3a1c5f[_0x20b5('0x1b')]||0x96;this[_0x20b5('0x1c')]=_0x3a1c5f[_0x20b5('0x1c')]||0x3;this[_0x20b5('0x1d')]=_0x3a1c5f[_0x20b5('0x1d')]||0x96;this[_0x20b5('0x1e')]=_0x3a1c5f['dialOrderByScheduledAt']||_0x20b5('0x1f');this['dialPrefix']=_0x3a1c5f[_0x20b5('0x20')]||undefined;this[_0x20b5('0x21')]=_0x3a1c5f[_0x20b5('0x21')]||undefined;this['dialCutDigit']=_0x3a1c5f[_0x20b5('0x22')]||undefined;this['TrunkBackup']=_0x3a1c5f[_0x20b5('0x23')]?_0x3a1c5f[_0x20b5('0x23')]:undefined;this[_0x20b5('0x24')]=_0x3a1c5f[_0x20b5('0x24')]?_0x3a1c5f['Trunk']:undefined;this[_0x20b5('0x25')]=_0x3a1c5f[_0x20b5('0x25')]?_0x3a1c5f[_0x20b5('0x25')]:undefined;this[_0x20b5('0x26')]=_0x3a1c5f[_0x20b5('0x26')]?_0x3a1c5f[_0x20b5('0x26')]:undefined;this[_0x20b5('0x27')]=_0x3a1c5f['SquareProject']?_0x3a1c5f['SquareProject'][_0x20b5('0x0')]:undefined;this[_0x20b5('0x28')]=_0x3a1c5f[_0x20b5('0x28')]||![];this[_0x20b5('0x29')]=_0x3a1c5f['dialAMDInitialSilence'];this[_0x20b5('0x2a')]=_0x3a1c5f[_0x20b5('0x2a')];this[_0x20b5('0x2b')]=_0x3a1c5f[_0x20b5('0x2b')];this[_0x20b5('0x2c')]=_0x3a1c5f[_0x20b5('0x2c')];this[_0x20b5('0x2d')]=_0x3a1c5f[_0x20b5('0x2d')];this[_0x20b5('0x2e')]=_0x3a1c5f[_0x20b5('0x2e')];this[_0x20b5('0x2f')]=_0x3a1c5f['dialAMDMaximumNumberOfWords'];this[_0x20b5('0x30')]=_0x3a1c5f[_0x20b5('0x30')];this['dialAMDMaximumWordLength']=_0x3a1c5f[_0x20b5('0x31')];}module[_0x20b5('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index f5ae091..30abecf 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd92a=['lastdata','duration','billableseconds','type','tag','monitor','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication'];(function(_0x4dd5ef,_0x57e62c){var _0x484b6e=function(_0x24ff57){while(--_0x24ff57){_0x4dd5ef['push'](_0x4dd5ef['shift']());}};_0x484b6e(++_0x57e62c);}(_0xd92a,0x1bc));var _0xad92=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd92a[_0x2c91e9];return _0x13f0ff;};'use strict';function Channel(){this['starttime']=null;this[_0xad92('0x0')]='';this[_0xad92('0x1')]='';this[_0xad92('0x2')]=0x0;this['calleridname']='';this[_0xad92('0x3')]=undefined;this[_0xad92('0x4')]=undefined;this['accountcode']=0x0;this['context']='';this['uniqueid']=0x0;this[_0xad92('0x5')]=0x0;this[_0xad92('0x6')]=0x0;this['answered']=![];this[_0xad92('0x7')]=null;this[_0xad92('0x8')]=null;this[_0xad92('0x9')]=![];this[_0xad92('0xa')]=![];this[_0xad92('0xb')]='';this[_0xad92('0xc')]='';this[_0xad92('0xd')]=0x0;this[_0xad92('0xe')]=0x0;this['holdtime']=0x0;this[_0xad92('0xf')]=null;this[_0xad92('0x10')]=null;this['disposition']=null;this[_0xad92('0x11')]=![];this[_0xad92('0x12')]=null;this[_0xad92('0x13')]=null;this['monitors']=[];this[_0xad92('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xad92('0x15')]=undefined;this[_0xad92('0x16')]=0x0;}module[_0xad92('0x17')]=Channel; \ No newline at end of file +var _0xa3e8=['destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xa3e8,0x127));var _0x8a3e=function(_0xcef260,_0x577f88){_0xcef260=_0xcef260-0x0;var _0xdc1d67=_0xa3e8[_0xcef260];return _0xdc1d67;};'use strict';function Channel(){this[_0x8a3e('0x0')]=null;this[_0x8a3e('0x1')]='';this[_0x8a3e('0x2')]='';this['calleridnum']=0x0;this[_0x8a3e('0x3')]='';this[_0x8a3e('0x4')]=undefined;this[_0x8a3e('0x5')]=undefined;this[_0x8a3e('0x6')]=0x0;this[_0x8a3e('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x8a3e('0x8')]=![];this[_0x8a3e('0x9')]=null;this[_0x8a3e('0xa')]=null;this['unmanaged']=![];this[_0x8a3e('0xb')]=![];this[_0x8a3e('0xc')]='';this[_0x8a3e('0xd')]='';this[_0x8a3e('0xe')]=0x0;this[_0x8a3e('0xf')]=0x0;this[_0x8a3e('0x10')]=0x0;this[_0x8a3e('0x11')]=null;this[_0x8a3e('0x12')]=null;this[_0x8a3e('0x13')]=null;this['monitor']=![];this[_0x8a3e('0x14')]=null;this[_0x8a3e('0x15')]=null;this[_0x8a3e('0x16')]=[];this['transfercalleridnum']=undefined;this[_0x8a3e('0x17')]=undefined;this[_0x8a3e('0x18')]=undefined;this[_0x8a3e('0x19')]=0x0;}module[_0x8a3e('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index be37b26..63bba51 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e69=['token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x4b7bad,_0x135acf){var _0x4da111=function(_0x28650c){while(--_0x28650c){_0x4b7bad['push'](_0x4b7bad['shift']());}};_0x4da111(++_0x135acf);}(_0x1e69,0x19d));var _0x91e6=function(_0x58128c,_0x425570){_0x58128c=_0x58128c-0x0;var _0x2f3728=_0x1e69[_0x58128c];return _0x2f3728;};'use strict';function DeskAccount(_0x5d578d){this['id']=_0x5d578d['id']||0x0;this[_0x91e6('0x0')]=_0x5d578d[_0x91e6('0x0')]||'';this['username']=_0x5d578d[_0x91e6('0x1')]||'';this[_0x91e6('0x2')]=_0x5d578d[_0x91e6('0x2')]||'';this[_0x91e6('0x3')]=_0x5d578d[_0x91e6('0x3')]||'';this[_0x91e6('0x4')]=_0x5d578d[_0x91e6('0x4')]||'';this['consumerKey']=_0x5d578d[_0x91e6('0x5')]||'';this[_0x91e6('0x6')]=_0x5d578d[_0x91e6('0x6')]||'';this['token']=_0x5d578d[_0x91e6('0x7')]||'';this['tokenSecret']=_0x5d578d[_0x91e6('0x8')]||'';this['type']=_0x5d578d['type']||'';this[_0x91e6('0x9')]=_0x5d578d['serverUrl']||'';this[_0x91e6('0xa')]=_0x5d578d[_0x91e6('0xa')]||{};}module[_0x91e6('0xb')]=DeskAccount; \ No newline at end of file +var _0xe86d=['serverUrl','Configurations','exports','name','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xe86d,0x71));var _0xde86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe86d[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x1175c2){this['id']=_0x1175c2['id']||0x0;this[_0xde86('0x0')]=_0x1175c2[_0xde86('0x0')]||'';this['username']=_0x1175c2['username']||'';this['remoteUri']=_0x1175c2['remoteUri']||'';this[_0xde86('0x1')]=_0x1175c2[_0xde86('0x1')]||'';this['password']=_0x1175c2[_0xde86('0x2')]||'';this[_0xde86('0x3')]=_0x1175c2[_0xde86('0x3')]||'';this['consumerSecret']=_0x1175c2[_0xde86('0x4')]||'';this['token']=_0x1175c2[_0xde86('0x5')]||'';this[_0xde86('0x6')]=_0x1175c2[_0xde86('0x6')]||'';this[_0xde86('0x7')]=_0x1175c2['type']||'';this[_0xde86('0x8')]=_0x1175c2['serverUrl']||'';this['Configurations']=_0x1175c2[_0xde86('0x9')]||{};}module[_0xde86('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index b865904..5f51306 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc579=['serverUrl','modernAuthentication','CloudProvider','exports','name','username','tenantId','clientId','clientSecret'];(function(_0x528511,_0x815fd3){var _0xd1b2b7=function(_0x3bf131){while(--_0x3bf131){_0x528511['push'](_0x528511['shift']());}};_0xd1b2b7(++_0x815fd3);}(_0xc579,0x1bd));var _0x9c57=function(_0x9db8cc,_0x288003){_0x9db8cc=_0x9db8cc-0x0;var _0x4b3107=_0xc579[_0x9db8cc];return _0x4b3107;};'use strict';function Dynamics365Account(_0x544fb7){this['id']=_0x544fb7['id']||0x0;this['name']=_0x544fb7[_0x9c57('0x0')]||'';this[_0x9c57('0x1')]=_0x544fb7[_0x9c57('0x1')]||'';this['password']=_0x544fb7['password']||'';this['remoteUri']=_0x544fb7['remoteUri']||'';this[_0x9c57('0x2')]=_0x544fb7[_0x9c57('0x2')]||'';this[_0x9c57('0x3')]=_0x544fb7['clientId']||'';this[_0x9c57('0x4')]=_0x544fb7[_0x9c57('0x4')]||{};this[_0x9c57('0x5')]=_0x544fb7[_0x9c57('0x5')]||'';this[_0x9c57('0x6')]=_0x544fb7[_0x9c57('0x6')]||![];this['Configurations']=_0x544fb7['Configurations']||{};this['CloudProvider']=_0x544fb7[_0x9c57('0x7')]||{};}module[_0x9c57('0x8')]=Dynamics365Account; \ No newline at end of file +var _0xcfd2=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0xcfd2,0x150));var _0x2cfd=function(_0x41ed4b,_0x5f0ce0){_0x41ed4b=_0x41ed4b-0x0;var _0x5077ff=_0xcfd2[_0x41ed4b];return _0x5077ff;};'use strict';function Dynamics365Account(_0x528ef3){this['id']=_0x528ef3['id']||0x0;this[_0x2cfd('0x0')]=_0x528ef3[_0x2cfd('0x0')]||'';this[_0x2cfd('0x1')]=_0x528ef3['username']||'';this[_0x2cfd('0x2')]=_0x528ef3[_0x2cfd('0x2')]||'';this['remoteUri']=_0x528ef3[_0x2cfd('0x3')]||'';this[_0x2cfd('0x4')]=_0x528ef3['tenantId']||'';this[_0x2cfd('0x5')]=_0x528ef3[_0x2cfd('0x5')]||'';this[_0x2cfd('0x6')]=_0x528ef3[_0x2cfd('0x6')]||{};this[_0x2cfd('0x7')]=_0x528ef3[_0x2cfd('0x7')]||'';this[_0x2cfd('0x8')]=_0x528ef3[_0x2cfd('0x8')]||![];this[_0x2cfd('0x9')]=_0x528ef3[_0x2cfd('0x9')]||{};this['CloudProvider']=_0x528ef3[_0x2cfd('0xa')]||{};}module[_0x2cfd('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index f052cb1..2e1b5c3 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a4d=['ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a4d,0x1c2));var _0xd5a4=function(_0x36996c,_0x1d3498){_0x36996c=_0x36996c-0x0;var _0x521799=_0x5a4d[_0x36996c];return _0x521799;};'use strict';function FaxAccount(_0x295452){this['id']=_0x295452['id']||0x0;this[_0xd5a4('0x0')]=_0x295452['name']||'';this[_0xd5a4('0x1')]=_0x295452[_0xd5a4('0x1')];this[_0xd5a4('0x2')]=_0x295452[_0xd5a4('0x2')];this[_0xd5a4('0x3')]=_0x295452['headerinfo'];this['localstationid']=_0x295452[_0xd5a4('0x4')];this['minrate']=_0x295452[_0xd5a4('0x5')]||0x960;this['maxrate']=_0x295452[_0xd5a4('0x6')]||0x3840;this['modem']=_0x295452['modem']||_0xd5a4('0x7');this[_0xd5a4('0x8')]=_0x295452[_0xd5a4('0x8')]||'no';this[_0xd5a4('0x9')]=_0x295452[_0xd5a4('0x9')]||'no';this[_0xd5a4('0xa')]=_0x295452[_0xd5a4('0xa')]||0x1388;this[_0xd5a4('0xb')]=_0x295452[_0xd5a4('0xb')]||_0xd5a4('0xc');this[_0xd5a4('0xd')]=_0x295452[_0xd5a4('0xd')]?_0x295452['Trunk']:undefined;this['ListId']=_0x295452[_0xd5a4('0xe')];this[_0xd5a4('0xf')]=_0x295452[_0xd5a4('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x946c=['ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x36047b,_0x57a393){var _0x47bfeb=function(_0xe3e68d){while(--_0xe3e68d){_0x36047b['push'](_0x36047b['shift']());}};_0x47bfeb(++_0x57a393);}(_0x946c,0x19b));var _0xc946=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x946c[_0x167cc1];return _0x10bc4b;};'use strict';function FaxAccount(_0x1f34c6){this['id']=_0x1f34c6['id']||0x0;this[_0xc946('0x0')]=_0x1f34c6['name']||'';this['description']=_0x1f34c6['description'];this[_0xc946('0x1')]=_0x1f34c6[_0xc946('0x1')];this['headerinfo']=_0x1f34c6[_0xc946('0x2')];this[_0xc946('0x3')]=_0x1f34c6[_0xc946('0x3')];this[_0xc946('0x4')]=_0x1f34c6['minrate']||0x960;this[_0xc946('0x5')]=_0x1f34c6[_0xc946('0x5')]||0x3840;this[_0xc946('0x6')]=_0x1f34c6[_0xc946('0x6')]||_0xc946('0x7');this[_0xc946('0x8')]=_0x1f34c6[_0xc946('0x8')]||'no';this[_0xc946('0x9')]=_0x1f34c6['faxdetect']||'no';this[_0xc946('0xa')]=_0x1f34c6[_0xc946('0xa')]||0x1388;this[_0xc946('0xb')]=_0x1f34c6['tech']||_0xc946('0xc');this['Trunk']=_0x1f34c6['Trunk']?_0x1f34c6[_0xc946('0xd')]:undefined;this['ListId']=_0x1f34c6[_0xc946('0xe')];this[_0xc946('0xf')]=_0x1f34c6[_0xc946('0xf')];}module[_0xc946('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index dcef22c..ba753ed 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d82=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d82,0x1de));var _0x26d8=function(_0x27f71d,_0x2b6db4){_0x27f71d=_0x27f71d-0x0;var _0x1de1d2=_0x6d82[_0x27f71d];return _0x1de1d2;};'use strict';function FreshdeskAccount(_0x45dced){this['id']=_0x45dced['id']||0x0;this[_0x26d8('0x0')]=_0x45dced[_0x26d8('0x0')]||'';this[_0x26d8('0x1')]=_0x45dced[_0x26d8('0x1')]||'';this[_0x26d8('0x2')]=_0x45dced[_0x26d8('0x3')]||'';this[_0x26d8('0x4')]=_0x45dced['remoteUri']||'';this['serverUrl']=_0x45dced[_0x26d8('0x5')]||'';this[_0x26d8('0x6')]=_0x45dced[_0x26d8('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x61ca=['exports','name','apiKey','token','serverUrl','Configurations'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x61ca,0xc7));var _0xa61c=function(_0x22bff1,_0x1d964a){_0x22bff1=_0x22bff1-0x0;var _0x279396=_0x61ca[_0x22bff1];return _0x279396;};'use strict';function FreshdeskAccount(_0x58c95e){this['id']=_0x58c95e['id']||0x0;this[_0xa61c('0x0')]=_0x58c95e['name']||'';this['username']=_0x58c95e['username']||'';this[_0xa61c('0x1')]=_0x58c95e[_0xa61c('0x2')]||'';this['remoteUri']=_0x58c95e['remoteUri']||'';this[_0xa61c('0x3')]=_0x58c95e[_0xa61c('0x3')]||'';this[_0xa61c('0x4')]=_0x58c95e[_0xa61c('0x4')]||{};}module[_0xa61c('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index a55a8a7..c586485 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a8=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x42d8c5,_0x3731ea){var _0x2dee72=function(_0x4a5d14){while(--_0x4a5d14){_0x42d8c5['push'](_0x42d8c5['shift']());}};_0x2dee72(++_0x3731ea);}(_0x98a8,0x12c));var _0x898a=function(_0x53ef93,_0x297642){_0x53ef93=_0x53ef93-0x0;var _0x4590e2=_0x98a8[_0x53ef93];return _0x4590e2;};'use strict';function FreshsalesAccount(_0x53f67d){this['id']=_0x53f67d['id']||0x0;this[_0x898a('0x0')]=_0x53f67d[_0x898a('0x0')]||'';this[_0x898a('0x1')]=_0x53f67d[_0x898a('0x1')]||'';this[_0x898a('0x2')]=_0x53f67d[_0x898a('0x3')]||'';this['remoteUri']=_0x53f67d[_0x898a('0x4')]||'';this[_0x898a('0x5')]=_0x53f67d[_0x898a('0x5')]||'';this[_0x898a('0x6')]=_0x53f67d[_0x898a('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x7dee=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x64b31d,_0x393b36){var _0x42c45b=function(_0x2d2323){while(--_0x2d2323){_0x64b31d['push'](_0x64b31d['shift']());}};_0x42c45b(++_0x393b36);}(_0x7dee,0xb0));var _0xe7de=function(_0x4b18e7,_0x4dd0f5){_0x4b18e7=_0x4b18e7-0x0;var _0x3ae05f=_0x7dee[_0x4b18e7];return _0x3ae05f;};'use strict';function FreshsalesAccount(_0x554760){this['id']=_0x554760['id']||0x0;this['name']=_0x554760[_0xe7de('0x0')]||'';this['username']=_0x554760[_0xe7de('0x1')]||'';this[_0xe7de('0x2')]=_0x554760[_0xe7de('0x3')]||'';this[_0xe7de('0x4')]=_0x554760['remoteUri']||'';this[_0xe7de('0x5')]=_0x554760['serverUrl']||'';this[_0xe7de('0x6')]=_0x554760[_0xe7de('0x6')]||{};}module[_0xe7de('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 06c0e96..c2ceb76 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc52=['variables','type','inbound','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','connectedlinename','context','exten','priority','lastAssignedTo','motionChannel','voice','routealias','mohtime'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_0xbc52,0x151));var _0x2bc5=function(_0x52c255,_0x2da90f){_0x52c255=_0x52c255-0x0;var _0xb88477=_0xbc52[_0x52c255];return _0xb88477;};'use strict';function QueueReport(){this[_0x2bc5('0x0')]=_0x2bc5('0x1');this['uniqueid']='';this[_0x2bc5('0x2')]='';this['calleridname']='';this[_0x2bc5('0x3')]='';this[_0x2bc5('0x4')]=null;this[_0x2bc5('0x5')]=null;this[_0x2bc5('0x6')]=0x1;this[_0x2bc5('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x2bc5('0x8')]=null;this[_0x2bc5('0x9')]=![];this[_0x2bc5('0xa')]=null;this[_0x2bc5('0xb')]=![];this['queuecallerexitAt']=null;this[_0x2bc5('0xc')]=0x1;this['channel']='';this[_0x2bc5('0xd')]='';this[_0x2bc5('0xe')]='';this['accountcode']='';this[_0x2bc5('0xf')]='';this[_0x2bc5('0x10')]='';this[_0x2bc5('0x11')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x2bc5('0x12')]='';this[_0x2bc5('0x13')]=_0x2bc5('0x14');this[_0x2bc5('0x15')]=null;this[_0x2bc5('0x16')]=0x0;this[_0x2bc5('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xdc2c=['holdtime','assigned','voice','variables','exports','type','calleridnum','calleridname','queue','position','queuecallerabandon','queuecallerabandonAt','queuecallerexit','originalposition','connectedlinenum','accountcode','exten','priority'];(function(_0x5dbaa7,_0x1f6d4a){var _0x481319=function(_0x116e27){while(--_0x116e27){_0x5dbaa7['push'](_0x5dbaa7['shift']());}};_0x481319(++_0x1f6d4a);}(_0xdc2c,0x1c7));var _0xcdc2=function(_0x4bbfb2,_0x4b1518){_0x4bbfb2=_0x4bbfb2-0x0;var _0x9fa82c=_0xdc2c[_0x4bbfb2];return _0x9fa82c;};'use strict';function QueueReport(){this[_0xcdc2('0x0')]='inbound';this['uniqueid']='';this[_0xcdc2('0x1')]='';this[_0xcdc2('0x2')]='';this[_0xcdc2('0x3')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xcdc2('0x4')]=0x1;this['count']=0x1;this[_0xcdc2('0x5')]=![];this[_0xcdc2('0x6')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xcdc2('0x7')]=![];this['queuecallerexitAt']=null;this[_0xcdc2('0x8')]=0x1;this['channel']='';this[_0xcdc2('0x9')]='';this['connectedlinename']='';this[_0xcdc2('0xa')]='';this['context']='';this[_0xcdc2('0xb')]='';this[_0xcdc2('0xc')]='';this[_0xcdc2('0xd')]=0x0;this[_0xcdc2('0xe')]=![];this['lastAssignedTo']='';this['motionChannel']=_0xcdc2('0xf');this['routealias']=null;this['mohtime']=0x0;this[_0xcdc2('0x10')]={};}module[_0xcdc2('0x11')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 7927c84..9757502 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ef=['password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc6ef,0x81));var _0xfc6e=function(_0x469d1c,_0x23f79f){_0x469d1c=_0x469d1c-0x0;var _0x435076=_0xc6ef[_0x469d1c];return _0x435076;};'use strict';function SalesforceAccount(_0x439e73){this['id']=_0x439e73['id']||0x0;this[_0xfc6e('0x0')]=_0x439e73[_0xfc6e('0x0')]||'';this[_0xfc6e('0x1')]=_0x439e73['username']||'';this[_0xfc6e('0x2')]=_0x439e73[_0xfc6e('0x2')]||'';this[_0xfc6e('0x3')]=_0x439e73[_0xfc6e('0x3')]||'';this['clientId']=_0x439e73['clientId']||'';this[_0xfc6e('0x4')]=_0x439e73[_0xfc6e('0x4')]||'';this['securityToken']=_0x439e73[_0xfc6e('0x5')]||'';this['type']=_0x439e73[_0xfc6e('0x6')]||_0xfc6e('0x7');this[_0xfc6e('0x8')]=_0x439e73[_0xfc6e('0x8')]||'';this[_0xfc6e('0x9')]=_0x439e73['Configurations']||{};}module[_0xfc6e('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x564d=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x4e8583,_0x13f294){var _0x5555c6=function(_0x2d864e){while(--_0x2d864e){_0x4e8583['push'](_0x4e8583['shift']());}};_0x5555c6(++_0x13f294);}(_0x564d,0x66));var _0xd564=function(_0x2fc9a5,_0x235b92){_0x2fc9a5=_0x2fc9a5-0x0;var _0x3fd730=_0x564d[_0x2fc9a5];return _0x3fd730;};'use strict';function SalesforceAccount(_0xf29421){this['id']=_0xf29421['id']||0x0;this[_0xd564('0x0')]=_0xf29421[_0xd564('0x0')]||'';this['username']=_0xf29421[_0xd564('0x1')]||'';this[_0xd564('0x2')]=_0xf29421['remoteUri']||'';this[_0xd564('0x3')]=_0xf29421['password']||'';this[_0xd564('0x4')]=_0xf29421[_0xd564('0x4')]||'';this[_0xd564('0x5')]=_0xf29421[_0xd564('0x5')]||'';this[_0xd564('0x6')]=_0xf29421[_0xd564('0x6')]||'';this[_0xd564('0x7')]=_0xf29421['type']||_0xd564('0x8');this[_0xd564('0x9')]=_0xf29421[_0xd564('0x9')]||'';this[_0xd564('0xa')]=_0xf29421[_0xd564('0xa')]||{};}module[_0xd564('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 6deb343..b5f903f 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac87=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0xca6b7,_0x465b20){var _0x57c8db=function(_0x37c023){while(--_0x37c023){_0xca6b7['push'](_0xca6b7['shift']());}};_0x57c8db(++_0x465b20);}(_0xac87,0x14f));var _0x7ac8=function(_0x4fe643,_0x1cf95c){_0x4fe643=_0x4fe643-0x0;var _0x27f5aa=_0xac87[_0x4fe643];return _0x27f5aa;};'use strict';function ServicenowAccount(_0x3727f9){this['id']=_0x3727f9['id']||0x0;this['name']=_0x3727f9['name']||'';this[_0x7ac8('0x0')]=_0x3727f9[_0x7ac8('0x0')]||'';this[_0x7ac8('0x1')]=_0x3727f9[_0x7ac8('0x1')]||'';this['remoteUri']=_0x3727f9[_0x7ac8('0x2')]||'';this[_0x7ac8('0x3')]=_0x3727f9[_0x7ac8('0x3')]||'';this[_0x7ac8('0x4')]=_0x3727f9[_0x7ac8('0x4')]||{};}module[_0x7ac8('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xdd84=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1788e0,_0x5cbba7){var _0x4cb790=function(_0x51dc8b){while(--_0x51dc8b){_0x1788e0['push'](_0x1788e0['shift']());}};_0x4cb790(++_0x5cbba7);}(_0xdd84,0x1d0));var _0x4dd8=function(_0x5301a8,_0xf1a8ba){_0x5301a8=_0x5301a8-0x0;var _0x482a56=_0xdd84[_0x5301a8];return _0x482a56;};'use strict';function ServicenowAccount(_0x4fcfe0){this['id']=_0x4fcfe0['id']||0x0;this[_0x4dd8('0x0')]=_0x4fcfe0[_0x4dd8('0x0')]||'';this[_0x4dd8('0x1')]=_0x4fcfe0[_0x4dd8('0x1')]||'';this[_0x4dd8('0x2')]=_0x4fcfe0[_0x4dd8('0x2')]||'';this[_0x4dd8('0x3')]=_0x4fcfe0[_0x4dd8('0x3')]||'';this[_0x4dd8('0x4')]=_0x4fcfe0[_0x4dd8('0x4')]||'';this['Configurations']=_0x4fcfe0[_0x4dd8('0x5')]||{};}module[_0x4dd8('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 34d6387..2a74ae0 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4bf=['name','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x430e9d,_0x890d5a){var _0x35f70f=function(_0x5b231c){while(--_0x5b231c){_0x430e9d['push'](_0x430e9d['shift']());}};_0x35f70f(++_0x890d5a);}(_0xf4bf,0xe4));var _0xff4b=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0xf4bf[_0x2eec1f];return _0x543075;};'use strict';function SugarcrmAccount(_0x22f451){this['id']=_0x22f451['id']||0x0;this[_0xff4b('0x0')]=_0x22f451[_0xff4b('0x0')]||'';this['username']=_0x22f451['username']||'';this[_0xff4b('0x1')]=_0x22f451['password']||'';this[_0xff4b('0x2')]=_0x22f451[_0xff4b('0x2')]||'';this[_0xff4b('0x3')]=_0x22f451[_0xff4b('0x3')]||'';this['Configurations']=_0x22f451[_0xff4b('0x4')]||{};}module[_0xff4b('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xc502=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x20f39f,_0x1b6b7a){var _0x1f65cd=function(_0x4fbc1b){while(--_0x4fbc1b){_0x20f39f['push'](_0x20f39f['shift']());}};_0x1f65cd(++_0x1b6b7a);}(_0xc502,0x1cc));var _0x2c50=function(_0x358881,_0x1b748c){_0x358881=_0x358881-0x0;var _0x76792d=_0xc502[_0x358881];return _0x76792d;};'use strict';function SugarcrmAccount(_0x4e2fe9){this['id']=_0x4e2fe9['id']||0x0;this[_0x2c50('0x0')]=_0x4e2fe9[_0x2c50('0x0')]||'';this[_0x2c50('0x1')]=_0x4e2fe9[_0x2c50('0x1')]||'';this[_0x2c50('0x2')]=_0x4e2fe9[_0x2c50('0x2')]||'';this['remoteUri']=_0x4e2fe9[_0x2c50('0x3')]||'';this[_0x2c50('0x4')]=_0x4e2fe9[_0x2c50('0x4')]||'';this[_0x2c50('0x5')]=_0x4e2fe9[_0x2c50('0x5')]||{};}module[_0x2c50('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 6bf7a5b..42acb82 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd38f=['address','exports','name','state','unknown','stateTime','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd38f,0xa3));var _0xfd38=function(_0x5d2787,_0x1ca453){_0x5d2787=_0x5d2787-0x0;var _0x310e86=_0xd38f[_0x5d2787];return _0x310e86;};'use strict';function Telephone(_0x53eeae){this['id']=_0x53eeae['id']||0x0;this[_0xfd38('0x0')]=_0x53eeae['name']||'';this['accountcode']=_0x53eeae['accountcode']||'';this[_0xfd38('0x1')]=_0xfd38('0x2');this[_0xfd38('0x3')]=0x0;this[_0xfd38('0x4')]=_0xfd38('0x2');this[_0xfd38('0x5')]='';}module[_0xfd38('0x6')]=Telephone; \ No newline at end of file +var _0x8d08=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0xf250ac,_0x1aeb3b){var _0x5a2ba4=function(_0x1bf327){while(--_0x1bf327){_0xf250ac['push'](_0xf250ac['shift']());}};_0x5a2ba4(++_0x1aeb3b);}(_0x8d08,0x118));var _0x88d0=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0x8d08[_0x458363];return _0x4d0290;};'use strict';function Telephone(_0x177606){this['id']=_0x177606['id']||0x0;this[_0x88d0('0x0')]=_0x177606[_0x88d0('0x0')]||'';this[_0x88d0('0x1')]=_0x177606[_0x88d0('0x1')]||'';this[_0x88d0('0x2')]=_0x88d0('0x3');this[_0x88d0('0x4')]=0x0;this[_0x88d0('0x5')]=_0x88d0('0x3');this[_0x88d0('0x6')]='';}module[_0x88d0('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 838fb90..d93595c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x1d8426,_0x5d05a3){var _0x1e63ce=function(_0x22a5c6){while(--_0x22a5c6){_0x1d8426['push'](_0x1d8426['shift']());}};_0x1e63ce(++_0x5d05a3);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xb10b[_0x4f5108];return _0x2d56ca;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x4ab2d0,_0x2a6727){var _0x98a719=function(_0x948e96){while(--_0x948e96){_0x4ab2d0['push'](_0x4ab2d0['shift']());}};_0x98a719(++_0x2a6727);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 9d8814d..fdac088 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x5eb8[_0x5756c6];return _0x4b5806;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x2d3d11,_0x43ec26){var _0x4a7809=function(_0x42d561){while(--_0x42d561){_0x2d3d11['push'](_0x2d3d11['shift']());}};_0x4a7809(++_0x43ec26);}(_0xda3f,0xec));var _0xfda3=function(_0x3ae3e8,_0x1e83ff){_0x3ae3e8=_0x3ae3e8-0x0;var _0x13480d=_0xda3f[_0x3ae3e8];return _0x13480d;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 4f4c3f6..feb003f 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e03=['active','name','unknown','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports'];(function(_0x437702,_0xdd70ae){var _0x274a32=function(_0x1d57ea){while(--_0x1d57ea){_0x437702['push'](_0x437702['shift']());}};_0x274a32(++_0xdd70ae);}(_0x4e03,0xf0));var _0x34e0=function(_0x294095,_0x2318c9){_0x294095=_0x294095-0x0;var _0x5310e3=_0x4e03[_0x294095];return _0x5310e3;};'use strict';function Trunk(_0x5866ac){this['id']=_0x5866ac['id']||0x0;this[_0x34e0('0x0')]=_0x5866ac[_0x34e0('0x0')]||![];this[_0x34e0('0x1')]=_0x5866ac[_0x34e0('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x34e0('0x2');this[_0x34e0('0x3')]=_0x5866ac['registry']&&_0x5866ac['registry'][_0x34e0('0x4')](':')?_0x5866ac[_0x34e0('0x3')][_0x34e0('0x5')](':')[0x0]:'';this[_0x34e0('0x6')]='';this[_0x34e0('0x7')]='';this[_0x34e0('0x8')]='';this[_0x34e0('0x9')]='';this[_0x34e0('0xa')]='';this[_0x34e0('0xb')]='unknown';this['registrationtime']='';this[_0x34e0('0xc')]='';this['defaultuser']=_0x5866ac[_0x34e0('0xd')]||'';}module[_0x34e0('0xe')]=Trunk; \ No newline at end of file +var _0x10e9=['active','name','stateTime','unknown','registry','split','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports'];(function(_0x193570,_0x35516d){var _0x1a7da7=function(_0x492ffe){while(--_0x492ffe){_0x193570['push'](_0x193570['shift']());}};_0x1a7da7(++_0x35516d);}(_0x10e9,0xc3));var _0x910e=function(_0x495ebf,_0x27df21){_0x495ebf=_0x495ebf-0x0;var _0x5841ef=_0x10e9[_0x495ebf];return _0x5841ef;};'use strict';function Trunk(_0x4f01d1){this['id']=_0x4f01d1['id']||0x0;this[_0x910e('0x0')]=_0x4f01d1['active']||![];this[_0x910e('0x1')]=_0x4f01d1[_0x910e('0x1')]||'';this['state']='unknown';this[_0x910e('0x2')]=0x0;this['status']=_0x910e('0x3');this['registry']=_0x4f01d1[_0x910e('0x4')]&&_0x4f01d1[_0x910e('0x4')]['indexOf'](':')?_0x4f01d1[_0x910e('0x4')][_0x910e('0x5')](':')[0x0]:'';this[_0x910e('0x6')]='';this['port']='';this[_0x910e('0x7')]='';this[_0x910e('0x8')]='';this[_0x910e('0x9')]='';this[_0x910e('0xa')]='unknown';this[_0x910e('0xb')]='';this[_0x910e('0xc')]='';this[_0x910e('0xd')]=_0x4f01d1['defaultuser']||'';}module[_0x910e('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 30f7c1d..4bb7149 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12f0=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x9d855d,_0x2e537d){var _0x503982=function(_0x531104){while(--_0x531104){_0x9d855d['push'](_0x9d855d['shift']());}};_0x503982(++_0x2e537d);}(_0x12f0,0xe1));var _0x012f=function(_0x2213b8,_0x2e2858){_0x2213b8=_0x2213b8-0x0;var _0x1dae5d=_0x12f0[_0x2213b8];return _0x1dae5d;};'use strict';function voiceExtension(_0x1e7436){this['id']=_0x1e7436['id']||0x0;this[_0x012f('0x0')]=_0x1e7436['exten']||'';this[_0x012f('0x1')]=_0x1e7436[_0x012f('0x1')]||_0x012f('0x2');this[_0x012f('0x3')]=_0x1e7436[_0x012f('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x4de8=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x4de8,0x1b6));var _0x84de=function(_0x4417c5,_0x597821){_0x4417c5=_0x4417c5-0x0;var _0x5376a4=_0x4de8[_0x4417c5];return _0x5376a4;};'use strict';function voiceExtension(_0x2cd926){this['id']=_0x2cd926['id']||0x0;this[_0x84de('0x0')]=_0x2cd926[_0x84de('0x0')]||'';this[_0x84de('0x1')]=_0x2cd926['recordingFormat']||_0x84de('0x2');this[_0x84de('0x3')]=_0x2cd926[_0x84de('0x3')]||![];}module[_0x84de('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 3fa4b82..7ef26ea 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ce9=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','available','busy','invalid','loggedIn','onHold','paused','ringing','ringInUse','talking','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','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x5f077e,_0x127cfd){var _0x237d0d=function(_0x1d8cfe){while(--_0x1d8cfe){_0x5f077e['push'](_0x5f077e['shift']());}};_0x237d0d(++_0x127cfd);}(_0x9ce9,0xb4));var _0x99ce=function(_0x5af799,_0x11d6e3){_0x5af799=_0x5af799-0x0;var _0x2683a6=_0x9ce9[_0x5af799];return _0x2683a6;};'use strict';var monitorFormat={'wav':_0x99ce('0x0'),'wav49':_0x99ce('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x99ce('0x2'),'leastrecent':_0x99ce('0x3'),'linear':_0x99ce('0x4'),'random':_0x99ce('0x5'),'ringall':_0x99ce('0x6'),'rr':_0x99ce('0x7'),'rrmemory':'rrmemory','rrordered':_0x99ce('0x8'),'wrandom':_0x99ce('0x9')};function VoiceQueue(_0x24b31c){this['id']=_0x24b31c['id']||0x0;this[_0x99ce('0xa')]=_0x24b31c['name']||'';this[_0x99ce('0xb')]=_0x24b31c[_0x99ce('0xb')]||'';this[_0x99ce('0xc')]=_0x24b31c[_0x99ce('0xc')]||_0x99ce('0xd');this[_0x99ce('0xe')]=0x0;this[_0x99ce('0xf')]=0x0;this[_0x99ce('0x10')]=0x0;this[_0x99ce('0x11')]=0x0;this[_0x99ce('0x12')]=0x0;this['sumBillable']=0x0;this[_0x99ce('0x13')]=0x0;this[_0x99ce('0x14')]=0x0;this[_0x99ce('0x15')]=0x0;this[_0x99ce('0x16')]=0x0;this['inUse']=0x0;this[_0x99ce('0x17')]=0x0;this[_0x99ce('0x18')]=0x0;this['notInUse']=0x0;this[_0x99ce('0x19')]=0x0;this[_0x99ce('0x1a')]=0x0;this[_0x99ce('0x1b')]=0x0;this[_0x99ce('0x1c')]=0x0;this[_0x99ce('0x1d')]=0x0;this['unavailable']=0x0;this[_0x99ce('0x1e')]=0x0;this[_0x99ce('0x1f')]=_0x24b31c[_0x99ce('0x1f')]||![];this[_0x99ce('0x20')]=_0x24b31c[_0x99ce('0x20')]||0xa;this[_0x99ce('0x21')]=_0x24b31c['autopause']||'no';this[_0x99ce('0x22')]=!![];this['message']='';this[_0x99ce('0x23')]='';this['originated']=0x0;this[_0x99ce('0x24')]=0x0;this[_0x99ce('0x25')]=_0x24b31c['dialTimezone']||null;this[_0x99ce('0x26')]=_0x24b31c[_0x99ce('0x26')]?_0x24b31c['dialGlobalInterval']:null;this[_0x99ce('0x27')]=_0x24b31c[_0x99ce('0x27')];this['dialMethod']=_0x24b31c[_0x99ce('0x28')]||_0x99ce('0x29');this[_0x99ce('0x2a')]=_0x24b31c[_0x99ce('0x2a')]||0x0;this[_0x99ce('0x2b')]=_0x24b31c['dialLimitQueue']||0x0;this[_0x99ce('0x2c')]=_0x24b31c['dialPowerLevel']||0x1;this[_0x99ce('0x2d')]=_0x24b31c[_0x99ce('0x2d')]||_0x99ce('0x2e');this[_0x99ce('0x2f')]=_0x24b31c[_0x99ce('0x2f')]||0.03;this[_0x99ce('0x30')]=_0x24b31c['dialPredictiveInterval']||0x258;this[_0x99ce('0x31')]=_0x24b31c[_0x99ce('0x31')]||_0x99ce('0x32');this[_0x99ce('0x33')]=_0x24b31c[_0x99ce('0x33')]||_0x99ce('0x32');this[_0x99ce('0x34')]=_0x24b31c[_0x99ce('0x34')]||0x1e;this['dialQueueOptions']=_0x24b31c[_0x99ce('0x35')]||_0x99ce('0x36');this[_0x99ce('0x37')]=_0x24b31c['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x24b31c[_0x99ce('0x38')]||undefined;this['dialCongestionMaxRetry']=_0x24b31c[_0x99ce('0x39')]||0x3;this[_0x99ce('0x3a')]=_0x24b31c[_0x99ce('0x3a')]||0x96;this[_0x99ce('0x3b')]=_0x24b31c['dialBusyMaxRetry']||0x3;this[_0x99ce('0x3c')]=_0x24b31c[_0x99ce('0x3c')]||0x96;this[_0x99ce('0x3d')]=_0x24b31c[_0x99ce('0x3d')]||0x3;this[_0x99ce('0x3e')]=_0x24b31c[_0x99ce('0x3e')]||0x96;this[_0x99ce('0x3f')]=_0x24b31c[_0x99ce('0x3f')]||0x3;this[_0x99ce('0x40')]=_0x24b31c[_0x99ce('0x40')]||0x96;this[_0x99ce('0x41')]=_0x24b31c[_0x99ce('0x41')]||0x3;this[_0x99ce('0x42')]=_0x24b31c[_0x99ce('0x42')]||0x96;this[_0x99ce('0x43')]=_0x24b31c[_0x99ce('0x43')]||0x3;this[_0x99ce('0x44')]=_0x24b31c['dialAbandonedRetryFrequency']||0x96;this[_0x99ce('0x45')]=_0x24b31c[_0x99ce('0x45')]||0x3;this[_0x99ce('0x46')]=_0x24b31c[_0x99ce('0x46')]||0x96;this['dialAgentRejectMaxRetry']=_0x24b31c[_0x99ce('0x47')]||0x3;this[_0x99ce('0x48')]=_0x24b31c[_0x99ce('0x48')]||0x96;this[_0x99ce('0x49')]=_0x24b31c[_0x99ce('0x49')]||0x3;this[_0x99ce('0x4a')]=_0x24b31c[_0x99ce('0x4a')]||0x4;this[_0x99ce('0x4b')]=_0x24b31c[_0x99ce('0x4b')]?_0x24b31c['Trunk']:undefined;this[_0x99ce('0x4c')]=_0x24b31c['TrunkBackup']?_0x24b31c[_0x99ce('0x4c')]:undefined;this['dialPrefix']=_0x24b31c[_0x99ce('0x4d')]||undefined;this['Interval']=_0x24b31c[_0x99ce('0x4e')]?_0x24b31c[_0x99ce('0x4e')]:undefined;this['dialOrderByScheduledAt']=_0x24b31c[_0x99ce('0x4f')]||_0x99ce('0x50');this[_0x99ce('0x51')]=_0x24b31c[_0x99ce('0x51')]||undefined;this[_0x99ce('0x52')]=_0x24b31c[_0x99ce('0x52')]||undefined;this['strategy']=strategy[_0x24b31c['strategy']];this[_0x99ce('0x53')]=!![];this[_0x99ce('0x54')]=_0x24b31c['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x24b31c[_0x99ce('0x55')];this[_0x99ce('0x56')]=_0x24b31c['dialAMDGreeting'];this[_0x99ce('0x57')]=_0x24b31c[_0x99ce('0x57')];this['dialAMDTotalAnalysisTime']=_0x24b31c[_0x99ce('0x58')];this['dialAMDMinWordLength']=_0x24b31c[_0x99ce('0x59')];this[_0x99ce('0x5a')]=_0x24b31c['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x24b31c[_0x99ce('0x5b')];this[_0x99ce('0x5c')]=_0x24b31c[_0x99ce('0x5c')];this[_0x99ce('0x5d')]=_0x24b31c[_0x99ce('0x5d')];this[_0x99ce('0x5e')]=0x0;this['pTalking']=0x0;this['timeout']=_0x24b31c[_0x99ce('0x5f')];this[_0x99ce('0x60')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x99ce('0x61')]=0x0;this[_0x99ce('0x62')]=0x0;this[_0x99ce('0x63')]=0x0;this[_0x99ce('0x64')]=0x0;this[_0x99ce('0x65')]=0x0;this[_0x99ce('0x66')]=0x0;this[_0x99ce('0x67')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x99ce('0x68')]=0x0;this[_0x99ce('0x69')]=0x0;this[_0x99ce('0x6a')]=0x0;this[_0x99ce('0x6b')]=0x0;this[_0x99ce('0x6c')]=undefined;this['startPredictive']=undefined;this[_0x99ce('0x6d')]=undefined;this[_0x99ce('0x6e')]=1.05;this[_0x99ce('0x6f')]=0x0;this[_0x99ce('0x70')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x99ce('0x71')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x99ce('0x72')]=0x0;this[_0x99ce('0x73')]=0x0;this[_0x99ce('0x74')]=0x0;this['predictiveIntervalMaxThreshold']=_0x24b31c[_0x99ce('0x75')]||0x14;this[_0x99ce('0x76')]=_0x24b31c['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x99ce('0x77')]=0x0;this[_0x99ce('0x78')]=0x0;this[_0x99ce('0x79')]=0x1;this[_0x99ce('0x7a')]=0x0;this[_0x99ce('0x7b')]=0x0;this[_0x99ce('0x7c')]=0x0;this[_0x99ce('0x7d')]=0x0;this[_0x99ce('0x7e')]=_0x24b31c[_0x99ce('0x7e')]||0x1e;this['dialRecallInQueue']=_0x24b31c[_0x99ce('0x7f')]||![];this[_0x99ce('0x80')]=!!_0x24b31c[_0x99ce('0x80')]||![];this[_0x99ce('0x81')]=!!_0x24b31c['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x24b31c[_0x99ce('0x82')]||undefined;this[_0x99ce('0x83')]=_0x24b31c[_0x99ce('0x83')]||![];this[_0x99ce('0x84')]=_0x24b31c[_0x99ce('0x84')]||![];this[_0x99ce('0xb')]=monitorFormat[_0x24b31c[_0x99ce('0xb')]]?monitorFormat[_0x24b31c[_0x99ce('0xb')]]:undefined;this[_0x99ce('0x85')]=_0x24b31c[_0x99ce('0x85')]||![];this['mandatoryDispositionPause']=_0x24b31c[_0x99ce('0x86')]?_0x24b31c['mandatoryDispositionPause']:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x99ce('0x87')]=VoiceQueue; \ No newline at end of file +var _0xb577=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','gsm','fewestcalls','linear','random','ringall','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','available','busy','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel'];(function(_0xd882b9,_0x2d06ef){var _0x1645e1=function(_0x496699){while(--_0x496699){_0xd882b9['push'](_0xd882b9['shift']());}};_0x1645e1(++_0x2d06ef);}(_0xb577,0x151));var _0x7b57=function(_0xbced40,_0x2fa5f0){_0xbced40=_0xbced40-0x0;var _0x230f2e=_0xb577[_0xbced40];return _0x230f2e;};'use strict';var monitorFormat={'wav':_0x7b57('0x0'),'wav49':'wav49','gsm':_0x7b57('0x1')};var strategy={'fewestcalls':_0x7b57('0x2'),'leastrecent':'leastrecent','linear':_0x7b57('0x3'),'random':_0x7b57('0x4'),'ringall':_0x7b57('0x5'),'rr':'roundrobin','rrmemory':_0x7b57('0x6'),'rrordered':_0x7b57('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x2e44c8){this['id']=_0x2e44c8['id']||0x0;this['name']=_0x2e44c8[_0x7b57('0x8')]||'';this[_0x7b57('0x9')]=_0x2e44c8[_0x7b57('0x9')]||'';this[_0x7b57('0xa')]=_0x2e44c8['type']||_0x7b57('0xb');this[_0x7b57('0xc')]=0x0;this[_0x7b57('0xd')]=0x0;this[_0x7b57('0xe')]=0x0;this[_0x7b57('0xf')]=0x0;this[_0x7b57('0x10')]=0x0;this['sumBillable']=0x0;this[_0x7b57('0x11')]=0x0;this['abandoned']=0x0;this[_0x7b57('0x12')]=0x0;this[_0x7b57('0x13')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0x7b57('0x14')]=0x0;this[_0x7b57('0x15')]=0x0;this[_0x7b57('0x16')]=0x0;this[_0x7b57('0x17')]=0x0;this[_0x7b57('0x18')]=0x0;this[_0x7b57('0x19')]=0x0;this[_0x7b57('0x1a')]=0x0;this[_0x7b57('0x1b')]=0x0;this['unknown']=0x0;this[_0x7b57('0x1c')]=_0x2e44c8[_0x7b57('0x1c')]||![];this[_0x7b57('0x1d')]=_0x2e44c8[_0x7b57('0x1d')]||0xa;this['autopause']=_0x2e44c8[_0x7b57('0x1e')]||'no';this['sendMessageOneNotActive']=!![];this[_0x7b57('0x1f')]='';this[_0x7b57('0x20')]='';this[_0x7b57('0x21')]=0x0;this[_0x7b57('0x22')]=0x0;this[_0x7b57('0x23')]=_0x2e44c8[_0x7b57('0x23')]||null;this[_0x7b57('0x24')]=_0x2e44c8[_0x7b57('0x24')]?_0x2e44c8[_0x7b57('0x24')]:null;this[_0x7b57('0x25')]=_0x2e44c8[_0x7b57('0x25')];this[_0x7b57('0x26')]=_0x2e44c8['dialMethod']||_0x7b57('0x27');this['dialLimitChannel']=_0x2e44c8[_0x7b57('0x28')]||0x0;this['dialLimitQueue']=_0x2e44c8[_0x7b57('0x29')]||0x0;this['dialPowerLevel']=_0x2e44c8[_0x7b57('0x2a')]||0x1;this[_0x7b57('0x2b')]=_0x2e44c8[_0x7b57('0x2b')]||_0x7b57('0x2c');this[_0x7b57('0x2d')]=_0x2e44c8[_0x7b57('0x2d')]||0.03;this[_0x7b57('0x2e')]=_0x2e44c8[_0x7b57('0x2e')]||0x258;this['dialOriginateCallerIdName']=_0x2e44c8[_0x7b57('0x2f')]||_0x7b57('0x30');this['dialOriginateCallerIdNumber']=_0x2e44c8[_0x7b57('0x31')]||'anonymous';this[_0x7b57('0x32')]=_0x2e44c8[_0x7b57('0x32')]||0x1e;this[_0x7b57('0x33')]=_0x2e44c8[_0x7b57('0x33')]||_0x7b57('0x34');this[_0x7b57('0x35')]=_0x2e44c8[_0x7b57('0x35')]||0x3;this[_0x7b57('0x36')]=_0x2e44c8['dialQueueProject']||undefined;this[_0x7b57('0x37')]=_0x2e44c8['dialCongestionMaxRetry']||0x3;this[_0x7b57('0x38')]=_0x2e44c8[_0x7b57('0x38')]||0x96;this[_0x7b57('0x39')]=_0x2e44c8[_0x7b57('0x39')]||0x3;this['dialBusyRetryFrequency']=_0x2e44c8[_0x7b57('0x3a')]||0x96;this[_0x7b57('0x3b')]=_0x2e44c8['dialNoAnswerMaxRetry']||0x3;this[_0x7b57('0x3c')]=_0x2e44c8[_0x7b57('0x3c')]||0x96;this[_0x7b57('0x3d')]=_0x2e44c8[_0x7b57('0x3d')]||0x3;this[_0x7b57('0x3e')]=_0x2e44c8[_0x7b57('0x3e')]||0x96;this['dialDropMaxRetry']=_0x2e44c8['dialDropMaxRetry']||0x3;this[_0x7b57('0x3f')]=_0x2e44c8[_0x7b57('0x3f')]||0x96;this[_0x7b57('0x40')]=_0x2e44c8[_0x7b57('0x40')]||0x3;this[_0x7b57('0x41')]=_0x2e44c8[_0x7b57('0x41')]||0x96;this[_0x7b57('0x42')]=_0x2e44c8[_0x7b57('0x42')]||0x3;this[_0x7b57('0x43')]=_0x2e44c8[_0x7b57('0x43')]||0x96;this['dialAgentRejectMaxRetry']=_0x2e44c8[_0x7b57('0x44')]||0x3;this[_0x7b57('0x45')]=_0x2e44c8[_0x7b57('0x45')]||0x96;this[_0x7b57('0x46')]=_0x2e44c8['callAdditionalPhoneAfterMin']||0x3;this[_0x7b57('0x47')]=_0x2e44c8['dialGlobalMaxRetry']||0x4;this[_0x7b57('0x48')]=_0x2e44c8[_0x7b57('0x48')]?_0x2e44c8[_0x7b57('0x48')]:undefined;this[_0x7b57('0x49')]=_0x2e44c8['TrunkBackup']?_0x2e44c8['TrunkBackup']:undefined;this[_0x7b57('0x4a')]=_0x2e44c8['dialPrefix']||undefined;this['Interval']=_0x2e44c8[_0x7b57('0x4b')]?_0x2e44c8[_0x7b57('0x4b')]:undefined;this[_0x7b57('0x4c')]=_0x2e44c8[_0x7b57('0x4c')]||'DESC';this[_0x7b57('0x4d')]=_0x2e44c8[_0x7b57('0x4d')]||undefined;this[_0x7b57('0x4e')]=_0x2e44c8['dialCutDigit']||undefined;this[_0x7b57('0x4f')]=strategy[_0x2e44c8['strategy']];this[_0x7b57('0x50')]=!![];this[_0x7b57('0x51')]=_0x2e44c8['dialAMDActive']||![];this[_0x7b57('0x52')]=_0x2e44c8[_0x7b57('0x52')];this[_0x7b57('0x53')]=_0x2e44c8[_0x7b57('0x53')];this[_0x7b57('0x54')]=_0x2e44c8['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x2e44c8['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2e44c8[_0x7b57('0x55')];this[_0x7b57('0x56')]=_0x2e44c8['dialAMDBetweenWordsSilence'];this[_0x7b57('0x57')]=_0x2e44c8[_0x7b57('0x57')];this['dialAMDSilenceThreshold']=_0x2e44c8[_0x7b57('0x58')];this[_0x7b57('0x59')]=_0x2e44c8[_0x7b57('0x59')];this[_0x7b57('0x5a')]=0x0;this[_0x7b57('0x5b')]=0x0;this[_0x7b57('0x5c')]=_0x2e44c8[_0x7b57('0x5c')];this['outboundAnswerCallsDay']=0x0;this[_0x7b57('0x5d')]=0x0;this[_0x7b57('0x5e')]=0x0;this[_0x7b57('0x5f')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x7b57('0x60')]=0x0;this[_0x7b57('0x61')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x7b57('0x62')]=0x0;this[_0x7b57('0x63')]=0x0;this[_0x7b57('0x64')]=0x0;this[_0x7b57('0x65')]=0x0;this[_0x7b57('0x66')]=0x0;this[_0x7b57('0x67')]=0x0;this[_0x7b57('0x68')]=undefined;this['startPredictive']=undefined;this[_0x7b57('0x69')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7b57('0x6a')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x7b57('0x6b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x7b57('0x6c')]=0x0;this[_0x7b57('0x6d')]=0x0;this[_0x7b57('0x6e')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2e44c8[_0x7b57('0x6f')]||0x14;this[_0x7b57('0x70')]=_0x2e44c8[_0x7b57('0x6f')]||0xa;this[_0x7b57('0x71')]=0x0;this[_0x7b57('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x7b57('0x73')]=0x0;this['erlangBusyFactor']=0x0;this[_0x7b57('0x74')]=_0x2e44c8['dialRecallMeTimeout']||0x1e;this[_0x7b57('0x75')]=_0x2e44c8[_0x7b57('0x75')]||![];this[_0x7b57('0x76')]=!!_0x2e44c8[_0x7b57('0x76')]||![];this[_0x7b57('0x77')]=!!_0x2e44c8[_0x7b57('0x77')]||![];this[_0x7b57('0x78')]=_0x2e44c8[_0x7b57('0x78')]||undefined;this[_0x7b57('0x79')]=_0x2e44c8[_0x7b57('0x79')]||![];this[_0x7b57('0x7a')]=_0x2e44c8[_0x7b57('0x7a')]||![];this['monitor_format']=monitorFormat[_0x2e44c8['monitor_format']]?monitorFormat[_0x2e44c8['monitor_format']]:undefined;this[_0x7b57('0x7b')]=_0x2e44c8['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x2e44c8[_0x7b57('0x7c')]?_0x2e44c8['mandatoryDispositionPause']:undefined;this[_0x7b57('0x7d')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 0ffbad8..0bf2909 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x455d=['outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','statusMessage','Trunk','active','callerid','createReport','loggedin','callers','length','online','incall','includes','status','booked','keys','queue','dialer','exten','prototype','some','compareToOutboundQueue','updateReportFromOutboundQueue','message','preview','loggedInDb','paused','ringing','waiting','available','answered','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','talking','sumDuration','total','name','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0x455d,0x190));var _0xd455=function(_0x1a0e33,_0x15d13c){_0x1a0e33=_0x1a0e33-0x0;var _0x26c7a6=_0x455d[_0x1a0e33];return _0x26c7a6;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0xd455('0x0'),_0xd455('0x1'),_0xd455('0x2'),'talking',_0xd455('0x3')];var OUTBOUND_COUNTERS=[_0xd455('0x4'),_0xd455('0x5'),_0xd455('0x6'),_0xd455('0x7'),_0xd455('0x0'),_0xd455('0x8'),_0xd455('0x9'),_0xd455('0xa'),'outboundBlacklistCallsDay',_0xd455('0xb'),_0xd455('0xc'),'outboundNoAnswerCallsDay',_0xd455('0xd'),_0xd455('0xe'),_0xd455('0xf'),_0xd455('0x10'),'paused',_0xd455('0x11'),_0xd455('0x12'),'sumBillable',_0xd455('0x13'),_0xd455('0x14'),_0xd455('0x3')];function VoiceQueueSummary(_0x11dd0e){this['id']=_0x11dd0e['id'];this[_0xd455('0x15')]=_0x11dd0e[_0xd455('0x15')];this['strategy']=_0x11dd0e['strategy'];this[_0xd455('0x16')]=_0x11dd0e[_0xd455('0x16')]||0x0;this[_0xd455('0x5')]=_0x11dd0e['answered']||0x0;this[_0xd455('0x4')]=_0x11dd0e[_0xd455('0x4')]||0x0;this[_0xd455('0x17')]=_0x11dd0e[_0xd455('0x17')]||0x0;this[_0xd455('0x6')]=_0x11dd0e[_0xd455('0x6')]||0x0;this[_0xd455('0x18')]=_0x11dd0e[_0xd455('0x18')]||0x0;this[_0xd455('0x7')]=_0x11dd0e['loggedIn']||0x0;this[_0xd455('0x0')]=_0x11dd0e[_0xd455('0x0')]||0x0;this[_0xd455('0x19')]=_0x11dd0e[_0xd455('0x19')]||0x0;this[_0xd455('0x1a')]=_0x11dd0e[_0xd455('0x1a')]||0x0;this[_0xd455('0x1')]=_0x11dd0e['paused']||0x0;this[_0xd455('0x2')]=_0x11dd0e['ringing']||0x0;this[_0xd455('0x1b')]=_0x11dd0e[_0xd455('0x1b')];this[_0xd455('0x1c')]=_0x11dd0e[_0xd455('0x1c')];this['sumDuration']=_0x11dd0e['sumDuration'];this[_0xd455('0x1d')]=_0x11dd0e[_0xd455('0x1d')]||0x0;this[_0xd455('0x12')]=_0x11dd0e[_0xd455('0x12')]||0x0;this['total']=_0x11dd0e[_0xd455('0x14')]||0x0;this[_0xd455('0x1e')]=_0x11dd0e[_0xd455('0x1e')];this[_0xd455('0x1f')]=_0x11dd0e[_0xd455('0x1f')]||0x0;this[_0xd455('0x20')]=_0x11dd0e[_0xd455('0x20')]||0x0;this['unmanaged']=_0x11dd0e[_0xd455('0x21')]||0x0;this['waiting']=_0x11dd0e['waiting']||0x0;if(_0x11dd0e['type']===_0xd455('0x22')){this[_0xd455('0x11')]=_0x11dd0e['pTalking']||0x0;this[_0xd455('0x23')]=_0x11dd0e[_0xd455('0x23')];this[_0xd455('0x24')]=_0x11dd0e[_0xd455('0x24')];this[_0xd455('0x25')]=_0x11dd0e[_0xd455('0x25')];this['dialOriginateCallerIdNumber']=_0x11dd0e[_0xd455('0x26')];this[_0xd455('0x27')]=_0x11dd0e[_0xd455('0x27')];this[_0xd455('0x28')]=_0x11dd0e[_0xd455('0x28')];this[_0xd455('0x29')]=_0x11dd0e[_0xd455('0x29')];this[_0xd455('0x2a')]=_0x11dd0e[_0xd455('0x2a')];this['outboundAnswerCallsDay']=_0x11dd0e[_0xd455('0xa')];this['outboundBlacklistCallsDay']=_0x11dd0e[_0xd455('0x2b')];this['outboundBusyCallsDay']=_0x11dd0e[_0xd455('0xb')];this[_0xd455('0xc')]=_0x11dd0e[_0xd455('0xc')];this['outboundDropCallsDayACS']=_0x11dd0e[_0xd455('0x2c')];this[_0xd455('0x2d')]=_0x11dd0e[_0xd455('0x2d')];this['outboundDropCallsDayTimeout']=_0x11dd0e['outboundDropCallsDayTimeout'];this[_0xd455('0x2e')]=_0x11dd0e['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x11dd0e[_0xd455('0xd')];this[_0xd455('0x2f')]=_0x11dd0e[_0xd455('0x2f')];this[_0xd455('0xe')]=_0x11dd0e[_0xd455('0xe')];this[_0xd455('0xf')]=_0x11dd0e[_0xd455('0xf')];this[_0xd455('0x10')]=_0x11dd0e[_0xd455('0x10')];this[_0xd455('0x30')]=_0x11dd0e[_0xd455('0x30')];this[_0xd455('0x31')]=_0x11dd0e['predictiveIntervalAvgHoldtime'];this[_0xd455('0x32')]=_0x11dd0e[_0xd455('0x32')];this[_0xd455('0x33')]=_0x11dd0e[_0xd455('0x33')];this[_0xd455('0x34')]=_0x11dd0e[_0xd455('0x34')];this[_0xd455('0x35')]=_0x11dd0e[_0xd455('0x35')];this[_0xd455('0x36')]=_0x11dd0e[_0xd455('0x36')];this[_0xd455('0x37')]=_0x11dd0e[_0xd455('0x37')];this[_0xd455('0x38')]=_0x11dd0e[_0xd455('0x38')];this[_0xd455('0x39')]=_0x11dd0e[_0xd455('0x39')];this[_0xd455('0x3a')]=_0x11dd0e[_0xd455('0x3a')];this[_0xd455('0x3b')]=_0x11dd0e[_0xd455('0x3b')];this[_0xd455('0x8')]=_0x11dd0e[_0xd455('0x8')];this[_0xd455('0x3c')]=_0x11dd0e[_0xd455('0x3c')];this[_0xd455('0x3d')]=_0x11dd0e[_0xd455('0x3d')];this[_0xd455('0x3e')]=_0x11dd0e[_0xd455('0x3e')];this[_0xd455('0x3f')]=_0x11dd0e[_0xd455('0x3f')];this[_0xd455('0x40')]=_0x11dd0e[_0xd455('0x40')];this[_0xd455('0x41')]=_0x11dd0e['startProgressive'];this['message']=_0x11dd0e['message'];this[_0xd455('0x42')]=_0x11dd0e[_0xd455('0x42')];}if(_0x11dd0e['Trunk']){this[_0xd455('0x43')]={'id':_0x11dd0e[_0xd455('0x43')]['id'],'name':_0x11dd0e[_0xd455('0x43')][_0xd455('0x15')],'active':_0x11dd0e[_0xd455('0x43')][_0xd455('0x44')],'callerid':_0x11dd0e['Trunk'][_0xd455('0x45')]};}}VoiceQueueSummary['prototype'][_0xd455('0x46')]=function(_0xc055ab,_0x591753,_0x277109,_0x144718){this['loggedInDb']=0x0;this[_0xd455('0x12')]=0x0;this[_0xd455('0x1')]=0x0;this[_0xd455('0x20')]=0x0;this[_0xd455('0x1a')]=0x0;this[_0xd455('0x6')]=0x0;this[_0xd455('0x17')]=0x0;this[_0xd455('0x18')]=0x0;this[_0xd455('0x1f')]=0x0;this[_0xd455('0x2')]=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x277109){if(_0x277109['available']){this['available']=Number(_0x277109[_0xd455('0x4')]);}if(_0x277109[_0xd455('0x47')]){this[_0xd455('0x7')]=Number(_0x277109['loggedin']);}if(_0x277109[_0xd455('0x48')]){this['waiting']=Number(_0x277109[_0xd455('0x48')]);}}for(var _0x2aa8ae=0x0;_0x2aa8ae<_0xc055ab[_0xd455('0x49')];_0x2aa8ae++){var _0x3c34df=_0x591753['SIP/'+_0xc055ab[_0x2aa8ae]['name']];if(_0x3c34df&&_0x3c34df[_0xd455('0x4a')]){this[_0xd455('0x0')]+=0x1;}if(_0xc055ab[_0x2aa8ae][_0xd455('0x4b')]==='1'){this[_0xd455('0x12')]+=0x1;}if(_0xc055ab[_0x2aa8ae][_0xd455('0x1')]==='1'&&!['2','7','8'][_0xd455('0x4c')](_0xc055ab[_0x2aa8ae][_0xd455('0x4d')])){this[_0xd455('0x1')]+=0x1;}switch(_0xc055ab[_0x2aa8ae][_0xd455('0x4d')]){case'0':this['unknown']+=0x1;break;case'1':this[_0xd455('0x1a')]+=0x1;break;case'2':this[_0xd455('0x6')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xd455('0x18')]+=0x1;break;case'5':this[_0xd455('0x1f')]+=0x1;break;case'6':this[_0xd455('0x2')]+=0x1;break;case'7':this[_0xd455('0x1b')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0xd455('0x4e')){var _0x1dd769=Object[_0xd455('0x4f')](_0x144718);for(var _0x3844db=0x0;_0x3844db<_0x1dd769['length'];_0x3844db++){var _0x552299=_0x1dd769[_0x3844db];var _0x254a9e=_0x144718[_0x552299];if(_0x254a9e[_0xd455('0x50')]===this[_0xd455('0x15')]&&_0x254a9e['type']===_0xd455('0x51')&&_0x254a9e[_0xd455('0x52')]==='xcally-motion-preview'){this[_0xd455('0x12')]+=0x1;}}if(this['talking']>this[_0xd455('0x6')]){this[_0xd455('0x12')]=this[_0xd455('0x6')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xd455('0x53')]['compareToInboundQueue']=function(_0x3cce24){var _0xfa0a5=![];if(_0x3cce24){_0xfa0a5=INBOUND_COUNTERS[_0xd455('0x54')](function(_0x2f3ab2){return this[_0x2f3ab2]!==_0x3cce24[_0x2f3ab2];},this);}return _0xfa0a5;};VoiceQueueSummary['prototype'][_0xd455('0x55')]=function(_0x32406d){var _0x2882e9=![];var _0xd805e2=![];var _0x30579e=![];if(_0x32406d){_0x2882e9=this[_0xd455('0x24')]!==_0x32406d[_0xd455('0x24')]||this[_0xd455('0x23')]!==_0x32406d[_0xd455('0x23')]||this['message']!==_0x32406d['message']||this[_0xd455('0x42')]!==_0x32406d[_0xd455('0x42')];_0xd805e2=OUTBOUND_COUNTERS[_0xd455('0x54')](function(_0x31b135){return this[_0x31b135]!==_0x32406d[_0x31b135];},this);if(this[_0xd455('0x43')]&&_0x32406d[_0xd455('0x43')]){_0x30579e=this[_0xd455('0x43')]['name']!==_0x32406d[_0xd455('0x43')]['name']||this['Trunk'][_0xd455('0x44')]!==_0x32406d[_0xd455('0x43')]['active'];}}return _0x2882e9||_0xd805e2||_0x30579e;};VoiceQueueSummary['prototype'][_0xd455('0x56')]=function(_0x183008){this[_0xd455('0x5')]=_0x183008[_0xd455('0x5')];this[_0xd455('0x57')]=_0x183008[_0xd455('0x57')];this[_0xd455('0x42')]=_0x183008[_0xd455('0x42')];this[_0xd455('0x8')]=_0x183008[_0xd455('0x8')];this[_0xd455('0x9')]=_0x183008[_0xd455('0x9')];this['outboundAnswerCallsDay']=_0x183008['outboundAnswerCallsDay'];this[_0xd455('0x2b')]=_0x183008[_0xd455('0x2b')];this['outboundBusyCallsDay']=_0x183008[_0xd455('0xb')];this['outboundCongestionCallsDay']=_0x183008[_0xd455('0xc')];this[_0xd455('0x2e')]=_0x183008[_0xd455('0x2e')];this[_0xd455('0xd')]=_0x183008[_0xd455('0xd')];this[_0xd455('0xe')]=_0x183008['outboundReCallsDay'];this[_0xd455('0xf')]=_0x183008[_0xd455('0xf')];this[_0xd455('0x10')]=_0x183008[_0xd455('0x10')];this[_0xd455('0x1c')]=_0x183008[_0xd455('0x1c')];this[_0xd455('0x13')]=_0x183008['sumDuration'];this[_0xd455('0x14')]=_0x183008[_0xd455('0x14')];if(this['dialMethod']===_0xd455('0x58')){this[_0xd455('0x11')]=_0x183008['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0xd7ce=['includes','status','booked','keys','dialer','exten','compareToInboundQueue','compareToOutboundQueue','statusMessage','some','name','prototype','updateReportFromOutboundQueue','answered','exports','available','loggedIn','loggedInDb','paused','waiting','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','talking','sumBillable','sumDuration','total','strategy','abandoned','busy','inUse','invalid','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','message','Trunk','active','callerid','createReport','onHold','loggedin','callers','length','incall'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xd7ce,0x16b));var _0xed7c=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0xd7ce[_0x17bb31];return _0x505c71;};'use strict';var INBOUND_COUNTERS=[_0xed7c('0x0'),_0xed7c('0x1'),_0xed7c('0x2'),_0xed7c('0x3'),'ringing','talking',_0xed7c('0x4')];var OUTBOUND_COUNTERS=['available','answered','inUse',_0xed7c('0x1'),_0xed7c('0x2'),_0xed7c('0x5'),_0xed7c('0x6'),_0xed7c('0x7'),_0xed7c('0x8'),_0xed7c('0x9'),_0xed7c('0xa'),_0xed7c('0xb'),_0xed7c('0xc'),_0xed7c('0xd'),_0xed7c('0xe'),'outboundUnknownCallsDay',_0xed7c('0x3'),_0xed7c('0xf'),_0xed7c('0x10'),_0xed7c('0x11'),_0xed7c('0x12'),_0xed7c('0x13'),'waiting'];function VoiceQueueSummary(_0x3bcf7a){this['id']=_0x3bcf7a['id'];this['name']=_0x3bcf7a['name'];this['strategy']=_0x3bcf7a[_0xed7c('0x14')];this[_0xed7c('0x15')]=_0x3bcf7a[_0xed7c('0x15')]||0x0;this['answered']=_0x3bcf7a['answered']||0x0;this[_0xed7c('0x0')]=_0x3bcf7a['available']||0x0;this[_0xed7c('0x16')]=_0x3bcf7a[_0xed7c('0x16')]||0x0;this['inUse']=_0x3bcf7a[_0xed7c('0x17')]||0x0;this[_0xed7c('0x18')]=_0x3bcf7a['invalid']||0x0;this['loggedIn']=_0x3bcf7a[_0xed7c('0x1')]||0x0;this[_0xed7c('0x2')]=_0x3bcf7a[_0xed7c('0x2')]||0x0;this['onHold']=_0x3bcf7a['onHold']||0x0;this[_0xed7c('0x19')]=_0x3bcf7a[_0xed7c('0x19')]||0x0;this[_0xed7c('0x3')]=_0x3bcf7a[_0xed7c('0x3')]||0x0;this[_0xed7c('0x1a')]=_0x3bcf7a[_0xed7c('0x1a')]||0x0;this[_0xed7c('0x1b')]=_0x3bcf7a[_0xed7c('0x1b')];this[_0xed7c('0x11')]=_0x3bcf7a['sumBillable'];this['sumDuration']=_0x3bcf7a[_0xed7c('0x12')];this['sumHoldTime']=_0x3bcf7a[_0xed7c('0x1c')]||0x0;this[_0xed7c('0x10')]=_0x3bcf7a[_0xed7c('0x10')]||0x0;this['total']=_0x3bcf7a[_0xed7c('0x13')]||0x0;this[_0xed7c('0x1d')]=_0x3bcf7a[_0xed7c('0x1d')];this[_0xed7c('0x1e')]=_0x3bcf7a[_0xed7c('0x1e')]||0x0;this[_0xed7c('0x1f')]=_0x3bcf7a[_0xed7c('0x1f')]||0x0;this[_0xed7c('0x20')]=_0x3bcf7a[_0xed7c('0x20')]||0x0;this[_0xed7c('0x4')]=_0x3bcf7a[_0xed7c('0x4')]||0x0;if(_0x3bcf7a[_0xed7c('0x1d')]==='outbound'){this['pTalking']=_0x3bcf7a['pTalking']||0x0;this[_0xed7c('0x21')]=_0x3bcf7a[_0xed7c('0x21')];this[_0xed7c('0x22')]=_0x3bcf7a[_0xed7c('0x22')];this[_0xed7c('0x23')]=_0x3bcf7a[_0xed7c('0x23')];this[_0xed7c('0x24')]=_0x3bcf7a[_0xed7c('0x24')];this[_0xed7c('0x25')]=_0x3bcf7a[_0xed7c('0x25')];this[_0xed7c('0x26')]=_0x3bcf7a['dialPrefix'];this[_0xed7c('0x27')]=_0x3bcf7a[_0xed7c('0x27')];this[_0xed7c('0x28')]=_0x3bcf7a[_0xed7c('0x28')];this[_0xed7c('0x7')]=_0x3bcf7a['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x3bcf7a[_0xed7c('0x8')];this[_0xed7c('0x9')]=_0x3bcf7a['outboundBusyCallsDay'];this[_0xed7c('0xa')]=_0x3bcf7a[_0xed7c('0xa')];this['outboundDropCallsDayACS']=_0x3bcf7a['outboundDropCallsDayACS'];this[_0xed7c('0x29')]=_0x3bcf7a[_0xed7c('0x29')];this[_0xed7c('0x2a')]=_0x3bcf7a['outboundDropCallsDayTimeout'];this[_0xed7c('0xb')]=_0x3bcf7a['outboundNoAnswerCallsDay'];this[_0xed7c('0xc')]=_0x3bcf7a[_0xed7c('0xc')];this['outboundOriginateFailureCallsDay']=_0x3bcf7a[_0xed7c('0x2b')];this['outboundReCallsDay']=_0x3bcf7a[_0xed7c('0xd')];this[_0xed7c('0xe')]=_0x3bcf7a[_0xed7c('0xe')];this[_0xed7c('0x2c')]=_0x3bcf7a[_0xed7c('0x2c')];this[_0xed7c('0x2d')]=_0x3bcf7a['predictiveIntervalAnsweredCalls'];this[_0xed7c('0x2e')]=_0x3bcf7a['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x3bcf7a[_0xed7c('0x2f')];this['predictiveIntervalDroppedCallsCallersExit']=_0x3bcf7a[_0xed7c('0x30')];this[_0xed7c('0x31')]=_0x3bcf7a[_0xed7c('0x31')];this['predictiveIntervalErlangCalls']=_0x3bcf7a[_0xed7c('0x32')];this[_0xed7c('0x33')]=_0x3bcf7a[_0xed7c('0x33')];this[_0xed7c('0x34')]=_0x3bcf7a['predictiveIntervalHitRate'];this[_0xed7c('0x35')]=_0x3bcf7a[_0xed7c('0x35')];this[_0xed7c('0x36')]=_0x3bcf7a[_0xed7c('0x36')];this['predictiveIntervalAvailable']=_0x3bcf7a[_0xed7c('0x37')];this['predictiveIntervalTotalCalls']=_0x3bcf7a[_0xed7c('0x38')];this[_0xed7c('0x5')]=_0x3bcf7a[_0xed7c('0x5')];this[_0xed7c('0x39')]=_0x3bcf7a[_0xed7c('0x39')];this[_0xed7c('0x3a')]=_0x3bcf7a[_0xed7c('0x3a')];this['erlangAbandonmentRate']=_0x3bcf7a['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x3bcf7a[_0xed7c('0x3b')];this[_0xed7c('0x3c')]=_0x3bcf7a[_0xed7c('0x3c')];this[_0xed7c('0x3d')]=_0x3bcf7a[_0xed7c('0x3d')];this[_0xed7c('0x3e')]=_0x3bcf7a[_0xed7c('0x3e')];this['statusMessage']=_0x3bcf7a['statusMessage'];}if(_0x3bcf7a[_0xed7c('0x3f')]){this[_0xed7c('0x3f')]={'id':_0x3bcf7a[_0xed7c('0x3f')]['id'],'name':_0x3bcf7a['Trunk']['name'],'active':_0x3bcf7a[_0xed7c('0x3f')][_0xed7c('0x40')],'callerid':_0x3bcf7a['Trunk'][_0xed7c('0x41')]};}}VoiceQueueSummary['prototype'][_0xed7c('0x42')]=function(_0x9e441c,_0x4fa3fe,_0x269534,_0x5aba95){this[_0xed7c('0x2')]=0x0;this[_0xed7c('0x10')]=0x0;this[_0xed7c('0x3')]=0x0;this['unknown']=0x0;this[_0xed7c('0x19')]=0x0;this[_0xed7c('0x17')]=0x0;this[_0xed7c('0x16')]=0x0;this[_0xed7c('0x18')]=0x0;this[_0xed7c('0x1e')]=0x0;this[_0xed7c('0x1a')]=0x0;this[_0xed7c('0x1b')]=0x0;this[_0xed7c('0x43')]=0x0;if(_0x269534){if(_0x269534[_0xed7c('0x0')]){this[_0xed7c('0x0')]=Number(_0x269534[_0xed7c('0x0')]);}if(_0x269534[_0xed7c('0x44')]){this['loggedIn']=Number(_0x269534[_0xed7c('0x44')]);}if(_0x269534[_0xed7c('0x45')]){this['waiting']=Number(_0x269534['callers']);}}for(var _0x4f98a2=0x0;_0x4f98a2<_0x9e441c[_0xed7c('0x46')];_0x4f98a2++){var _0x64980a=_0x4fa3fe['SIP/'+_0x9e441c[_0x4f98a2]['name']];if(_0x64980a&&_0x64980a['online']){this[_0xed7c('0x2')]+=0x1;}if(_0x9e441c[_0x4f98a2][_0xed7c('0x47')]==='1'){this[_0xed7c('0x10')]+=0x1;}if(_0x9e441c[_0x4f98a2][_0xed7c('0x3')]==='1'&&!['2','7','8'][_0xed7c('0x48')](_0x9e441c[_0x4f98a2][_0xed7c('0x49')])){this[_0xed7c('0x3')]+=0x1;}switch(_0x9e441c[_0x4f98a2][_0xed7c('0x49')]){case'0':this['unknown']+=0x1;break;case'1':this[_0xed7c('0x19')]+=0x1;break;case'2':this[_0xed7c('0x17')]+=0x1;break;case'3':this[_0xed7c('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xed7c('0x1b')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0xed7c('0x4a')){var _0x3572fa=Object[_0xed7c('0x4b')](_0x5aba95);for(var _0x1f36fc=0x0;_0x1f36fc<_0x3572fa[_0xed7c('0x46')];_0x1f36fc++){var _0x5aa12=_0x3572fa[_0x1f36fc];var _0x5a76c9=_0x5aba95[_0x5aa12];if(_0x5a76c9['queue']===this['name']&&_0x5a76c9[_0xed7c('0x1d')]===_0xed7c('0x4c')&&_0x5a76c9[_0xed7c('0x4d')]==='xcally-motion-preview'){this[_0xed7c('0x10')]+=0x1;}}if(this['talking']>this[_0xed7c('0x17')]){this[_0xed7c('0x10')]=this[_0xed7c('0x17')];}this[_0xed7c('0xf')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0xed7c('0x4e')]=function(_0x28e3b6){var _0x577281=![];if(_0x28e3b6){_0x577281=INBOUND_COUNTERS['some'](function(_0x622aa0){return this[_0x622aa0]!==_0x28e3b6[_0x622aa0];},this);}return _0x577281;};VoiceQueueSummary['prototype'][_0xed7c('0x4f')]=function(_0x5eb8f8){var _0xa0c8d=![];var _0x53ab69=![];var _0x277962=![];if(_0x5eb8f8){_0xa0c8d=this[_0xed7c('0x22')]!==_0x5eb8f8[_0xed7c('0x22')]||this[_0xed7c('0x21')]!==_0x5eb8f8['dialActive']||this[_0xed7c('0x3e')]!==_0x5eb8f8[_0xed7c('0x3e')]||this[_0xed7c('0x50')]!==_0x5eb8f8[_0xed7c('0x50')];_0x53ab69=OUTBOUND_COUNTERS[_0xed7c('0x51')](function(_0x4348c3){return this[_0x4348c3]!==_0x5eb8f8[_0x4348c3];},this);if(this[_0xed7c('0x3f')]&&_0x5eb8f8[_0xed7c('0x3f')]){_0x277962=this[_0xed7c('0x3f')][_0xed7c('0x52')]!==_0x5eb8f8[_0xed7c('0x3f')][_0xed7c('0x52')]||this[_0xed7c('0x3f')][_0xed7c('0x40')]!==_0x5eb8f8['Trunk'][_0xed7c('0x40')];}}return _0xa0c8d||_0x53ab69||_0x277962;};VoiceQueueSummary[_0xed7c('0x53')][_0xed7c('0x54')]=function(_0x2ae792){this[_0xed7c('0x55')]=_0x2ae792[_0xed7c('0x55')];this[_0xed7c('0x3e')]=_0x2ae792[_0xed7c('0x3e')];this[_0xed7c('0x50')]=_0x2ae792['statusMessage'];this['originated']=_0x2ae792[_0xed7c('0x5')];this[_0xed7c('0x6')]=_0x2ae792[_0xed7c('0x6')];this[_0xed7c('0x7')]=_0x2ae792[_0xed7c('0x7')];this[_0xed7c('0x8')]=_0x2ae792[_0xed7c('0x8')];this[_0xed7c('0x9')]=_0x2ae792[_0xed7c('0x9')];this[_0xed7c('0xa')]=_0x2ae792[_0xed7c('0xa')];this[_0xed7c('0xb')]=_0x2ae792[_0xed7c('0xb')];this[_0xed7c('0xc')]=_0x2ae792[_0xed7c('0xc')];this[_0xed7c('0xd')]=_0x2ae792[_0xed7c('0xd')];this[_0xed7c('0xe')]=_0x2ae792['outboundRejectCallsDay'];this[_0xed7c('0x2c')]=_0x2ae792[_0xed7c('0x2c')];this[_0xed7c('0x11')]=_0x2ae792[_0xed7c('0x11')];this['sumDuration']=_0x2ae792[_0xed7c('0x12')];this[_0xed7c('0x13')]=_0x2ae792['total'];if(this[_0xed7c('0x22')]==='preview'){this[_0xed7c('0xf')]=_0x2ae792[_0xed7c('0xf')];}};module[_0xed7c('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 1012060..daa8b4d 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cfa=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x4898b9,_0x3945d2){var _0x56a3f=function(_0x261c11){while(--_0x261c11){_0x4898b9['push'](_0x4898b9['shift']());}};_0x56a3f(++_0x3945d2);}(_0x9cfa,0xce));var _0xa9cf=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9cfa[_0x397e5f];return _0x5302b8;};'use strict';function VtigerAccount(_0x104a90){this['id']=_0x104a90['id']||0x0;this[_0xa9cf('0x0')]=_0x104a90[_0xa9cf('0x0')]||'';this[_0xa9cf('0x1')]=_0x104a90[_0xa9cf('0x1')]||'';this[_0xa9cf('0x2')]=_0x104a90[_0xa9cf('0x2')]||'';this[_0xa9cf('0x3')]=_0x104a90[_0xa9cf('0x3')]||'';this['serverUrl']=_0x104a90[_0xa9cf('0x4')]||'';this[_0xa9cf('0x5')]=_0x104a90[_0xa9cf('0x5')]||{};}module[_0xa9cf('0x6')]=VtigerAccount; \ No newline at end of file +var _0xdcf7=['username','accessKey','remoteUri','serverUrl','exports','name'];(function(_0x5682e0,_0x1488fa){var _0x539e82=function(_0x4ecd4c){while(--_0x4ecd4c){_0x5682e0['push'](_0x5682e0['shift']());}};_0x539e82(++_0x1488fa);}(_0xdcf7,0x7d));var _0x7dcf=function(_0x317e92,_0x12ff60){_0x317e92=_0x317e92-0x0;var _0x12a430=_0xdcf7[_0x317e92];return _0x12a430;};'use strict';function VtigerAccount(_0x5b0b40){this['id']=_0x5b0b40['id']||0x0;this[_0x7dcf('0x0')]=_0x5b0b40[_0x7dcf('0x0')]||'';this[_0x7dcf('0x1')]=_0x5b0b40[_0x7dcf('0x1')]||'';this[_0x7dcf('0x2')]=_0x5b0b40[_0x7dcf('0x2')]||'';this[_0x7dcf('0x3')]=_0x5b0b40[_0x7dcf('0x3')]||'';this[_0x7dcf('0x4')]=_0x5b0b40[_0x7dcf('0x4')]||'';this['Configurations']=_0x5b0b40['Configurations']||{};}module[_0x7dcf('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index a649b4d..70de75a 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73ca=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x73ca,0x112));var _0xa73c=function(_0x1aaaf1,_0x4941ab){_0x1aaaf1=_0x1aaaf1-0x0;var _0x185875=_0x73ca[_0x1aaaf1];return _0x185875;};'use strict';function ZendeskAccount(_0x1fdaea){this['id']=_0x1fdaea['id']||0x0;this['name']=_0x1fdaea[_0xa73c('0x0')]||'';this[_0xa73c('0x1')]=_0x1fdaea[_0xa73c('0x1')]||'';this['password']=_0x1fdaea[_0xa73c('0x2')]||'';this['token']=_0x1fdaea[_0xa73c('0x3')]||'';this[_0xa73c('0x4')]=_0x1fdaea[_0xa73c('0x4')]||'';this[_0xa73c('0x5')]=_0x1fdaea['authType']||'';this['type']=_0x1fdaea[_0xa73c('0x6')]||_0xa73c('0x7');this['serverUrl']=_0x1fdaea[_0xa73c('0x8')]||'';this[_0xa73c('0x9')]=_0x1fdaea[_0xa73c('0x9')]||{};}module[_0xa73c('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x1e3c=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x411270,_0x3d85c8){var _0x1b148d=function(_0x4c1144){while(--_0x4c1144){_0x411270['push'](_0x411270['shift']());}};_0x1b148d(++_0x3d85c8);}(_0x1e3c,0xa2));var _0xc1e3=function(_0x457394,_0x5859fc){_0x457394=_0x457394-0x0;var _0x38951d=_0x1e3c[_0x457394];return _0x38951d;};'use strict';function ZendeskAccount(_0x421413){this['id']=_0x421413['id']||0x0;this[_0xc1e3('0x0')]=_0x421413[_0xc1e3('0x0')]||'';this['username']=_0x421413[_0xc1e3('0x1')]||'';this['password']=_0x421413[_0xc1e3('0x2')]||'';this[_0xc1e3('0x3')]=_0x421413[_0xc1e3('0x3')]||'';this[_0xc1e3('0x4')]=_0x421413['remoteUri']||'';this[_0xc1e3('0x5')]=_0x421413[_0xc1e3('0x5')]||'';this[_0xc1e3('0x6')]=_0x421413[_0xc1e3('0x6')]||_0xc1e3('0x7');this[_0xc1e3('0x8')]=_0x421413['serverUrl']||'';this[_0xc1e3('0x9')]=_0x421413['Configurations']||{};}module[_0xc1e3('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index c7382dd..60088b2 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09c1=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x09c1,0x15c));var _0x109c=function(_0x3e8d78,_0xef4524){_0x3e8d78=_0x3e8d78-0x0;var _0x50532d=_0x09c1[_0x3e8d78];return _0x50532d;};'use strict';function ZohoAccount(_0x1bcc3f){this['id']=_0x1bcc3f['id']||0x0;this[_0x109c('0x0')]=_0x1bcc3f[_0x109c('0x0')]||'';this[_0x109c('0x1')]=_0x1bcc3f['description']||'';this['host']=_0x1bcc3f[_0x109c('0x2')]||'';this[_0x109c('0x3')]=_0x1bcc3f[_0x109c('0x3')]||'';this[_0x109c('0x4')]=_0x1bcc3f[_0x109c('0x4')]||'';this[_0x109c('0x5')]=_0x1bcc3f[_0x109c('0x5')]||'';this[_0x109c('0x6')]=_0x1bcc3f[_0x109c('0x6')]||'';this[_0x109c('0x7')]=_0x1bcc3f[_0x109c('0x7')]||'';this[_0x109c('0x8')]=_0x1bcc3f[_0x109c('0x8')]||'';this[_0x109c('0x9')]=_0x1bcc3f[_0x109c('0x9')]||{};}module[_0x109c('0xa')]=ZohoAccount; \ No newline at end of file +var _0xcad4=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x21ead4,_0x3948b3){var _0x46055a=function(_0x1635d9){while(--_0x1635d9){_0x21ead4['push'](_0x21ead4['shift']());}};_0x46055a(++_0x3948b3);}(_0xcad4,0x159));var _0x4cad=function(_0x39326c,_0x26e7c8){_0x39326c=_0x39326c-0x0;var _0x332996=_0xcad4[_0x39326c];return _0x332996;};'use strict';function ZohoAccount(_0x570f97){this['id']=_0x570f97['id']||0x0;this[_0x4cad('0x0')]=_0x570f97[_0x4cad('0x0')]||'';this[_0x4cad('0x1')]=_0x570f97['description']||'';this[_0x4cad('0x2')]=_0x570f97[_0x4cad('0x2')]||'';this[_0x4cad('0x3')]=_0x570f97['zone']||'';this[_0x4cad('0x4')]=_0x570f97['clientId']||'';this[_0x4cad('0x5')]=_0x570f97['clientSecret']||'';this['serverUrl']=_0x570f97[_0x4cad('0x6')]||'';this[_0x4cad('0x7')]=_0x570f97[_0x4cad('0x7')]||'';this[_0x4cad('0x8')]=_0x570f97['refreshToken']||'';this[_0x4cad('0x9')]=_0x570f97['Configurations']||{};}module[_0x4cad('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 9dab92b..cbb46ba 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5204=['isNil','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','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','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','lodash'];(function(_0x5e3c4c,_0x570558){var _0x33064e=function(_0x2af5b6){while(--_0x2af5b6){_0x5e3c4c['push'](_0x5e3c4c['shift']());}};_0x33064e(++_0x570558);}(_0x5204,0xdf));var _0x4520=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x5204[_0x3457b4];return _0xaa8fa9;};'use strict';var util=require(_0x4520('0x0'));var _=require(_0x4520('0x1'));var moment=require('moment');function checkNameSurname(_0x12a3a1,_0x3bf0b1,_0x10cbc2){var _0x36caca='';if(!_[_0x4520('0x2')](_0x3bf0b1)&&'string'===typeof _0x3bf0b1){_0x36caca+=_0x3bf0b1;}if(!_[_0x4520('0x2')](_0x10cbc2)&&'string'===typeof _0x10cbc2){_0x36caca+='\x20'+_0x10cbc2;}if(_0x36caca!==''){return _0x36caca;}return _0x12a3a1;}function Action(_0x180174,_0x209381,_0xe0a256,_0xe741c2,_0x396d29){this[_0x4520('0x3')]=_0xe0a256||undefined;this[_0x4520('0x4')]=_0x180174['id'];this['queue']=_0x209381[_0x4520('0x5')];this['type']=_0x209381[_0x4520('0x6')];this[_0x4520('0x7')]=_0x4520('0x8');this[_0x4520('0x9')]=![];this[_0x4520('0xa')]=_[_0x4520('0x2')](_0x180174[_0x4520('0xb')])?undefined:_0x180174[_0x4520('0xb')][_0x4520('0x5')];this[_0x4520('0xc')]=this[_0x4520('0xa')]?util[_0x4520('0xd')](_0x4520('0xe'),this[_0x4520('0xa')]):_0xe741c2||undefined;this[_0x4520('0xf')]=checkNameSurname(_0x180174[_0x4520('0x10')][_0x4520('0x11')],_0x180174[_0x4520('0x10')][_0x4520('0x12')],_0x180174[_0x4520('0x10')][_0x4520('0x13')]);this['active']=_0x180174[_0x4520('0x14')]||![];this[_0x4520('0x15')]=_0x180174[_0x4520('0x11')];this[_0x4520('0x16')]=_0x180174[_0x4520('0x16')];this['countbusyretry']=_0x180174[_0x4520('0x17')]||0x0;this[_0x4520('0x18')]=_0x180174[_0x4520('0x18')]||0x0;this[_0x4520('0x19')]=_0x180174[_0x4520('0x19')]||0x0;this[_0x4520('0x1a')]=(_0x180174[_0x4520('0x17')]||0x0)+(_0x180174[_0x4520('0x18')]||0x0)+(_0x180174[_0x4520('0x19')]||0x0)+(_0x180174[_0x4520('0x1b')]||0x0)+(_0x180174[_0x4520('0x1c')]||0x0)+(_0x180174[_0x4520('0x1d')]||0x0)+(_0x180174['countmachineretry']||0x0)+(_0x180174[_0x4520('0x1e')]||0x0);this['countnosuchnumberretry']=_0x180174['countnosuchnumberretry']||0x0;this['countdropretry']=_0x180174[_0x4520('0x1c')]||0x0;this['countabandonedretry']=_0x180174[_0x4520('0x1d')]||0x0;this[_0x4520('0x1f')]=_0x180174[_0x4520('0x1f')]||0x0;this['countagentrejectretry']=_0x180174[_0x4520('0x1e')]||0x0;this[_0x4520('0x20')]=_0x180174[_0x4520('0x20')];this['callbackuniqueid']=_0x180174[_0x4520('0x21')];this[_0x4520('0x22')]=_0x180174[_0x4520('0x22')];this[_0x4520('0x23')]=_0x180174[_0x4520('0x23')];this['ContactId']=_0x180174[_0x4520('0x24')];this[_0x4520('0x25')]=_0x180174[_0x4520('0x25')];this[_0x4520('0x26')]=_['isNil'](_0x180174[_0x4520('0xb')])?_0x180174[_0x4520('0x26')]:_0x180174[_0x4520('0xb')]['id'];this[_0x4520('0x27')]=_0x180174[_0x4520('0x27')];this[_0x4520('0x28')]='';this[_0x4520('0x29')]='';}Action[_0x4520('0x2a')][_0x4520('0x2b')]=function(){return util[_0x4520('0xd')]('\x22%s\x22\x20<%s>',this[_0x4520('0xf')],this['number']);};module[_0x4520('0x2c')]=Action; \ No newline at end of file +var _0x5eb8=['callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x4c2d63,_0x18ac47){var _0x1ecdcf=function(_0x50103a){while(--_0x50103a){_0x4c2d63['push'](_0x4c2d63['shift']());}};_0x1ecdcf(++_0x18ac47);}(_0x5eb8,0xb0));var _0x85eb=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x5eb8[_0x11a220];return _0x20d8fe;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x85eb('0x0'));function checkNameSurname(_0x2598be,_0x393a8a,_0xd2f5dc){var _0x7e3c0='';if(!_[_0x85eb('0x1')](_0x393a8a)&&_0x85eb('0x2')===typeof _0x393a8a){_0x7e3c0+=_0x393a8a;}if(!_[_0x85eb('0x1')](_0xd2f5dc)&&_0x85eb('0x2')===typeof _0xd2f5dc){_0x7e3c0+='\x20'+_0xd2f5dc;}if(_0x7e3c0!==''){return _0x7e3c0;}return _0x2598be;}function Action(_0x1fde1a,_0x2bf83c,_0x1ba1d8,_0x4a8814,_0x16d7b9){this[_0x85eb('0x3')]=_0x1ba1d8||undefined;this[_0x85eb('0x4')]=_0x1fde1a['id'];this['queue']=_0x2bf83c[_0x85eb('0x5')];this['type']=_0x2bf83c[_0x85eb('0x6')];this[_0x85eb('0x7')]=_0x85eb('0x8');this[_0x85eb('0x9')]=![];this[_0x85eb('0xa')]=_[_0x85eb('0x1')](_0x1fde1a[_0x85eb('0xb')])?undefined:_0x1fde1a['Agent'][_0x85eb('0x5')];this[_0x85eb('0xc')]=this['membername']?util[_0x85eb('0xd')](_0x85eb('0xe'),this[_0x85eb('0xa')]):_0x4a8814||undefined;this[_0x85eb('0xf')]=checkNameSurname(_0x1fde1a['Contact']['phone'],_0x1fde1a[_0x85eb('0x10')]['firstName'],_0x1fde1a[_0x85eb('0x10')][_0x85eb('0x11')]);this[_0x85eb('0x12')]=_0x1fde1a[_0x85eb('0x12')]||![];this[_0x85eb('0x13')]=_0x1fde1a['phone'];this[_0x85eb('0x14')]=_0x1fde1a['scheduledat'];this[_0x85eb('0x15')]=_0x1fde1a[_0x85eb('0x15')]||0x0;this[_0x85eb('0x16')]=_0x1fde1a[_0x85eb('0x16')]||0x0;this['countnoanswerretry']=_0x1fde1a['countnoanswerretry']||0x0;this['countglobal']=(_0x1fde1a[_0x85eb('0x15')]||0x0)+(_0x1fde1a[_0x85eb('0x16')]||0x0)+(_0x1fde1a[_0x85eb('0x17')]||0x0)+(_0x1fde1a[_0x85eb('0x18')]||0x0)+(_0x1fde1a[_0x85eb('0x19')]||0x0)+(_0x1fde1a[_0x85eb('0x1a')]||0x0)+(_0x1fde1a['countmachineretry']||0x0)+(_0x1fde1a[_0x85eb('0x1b')]||0x0);this[_0x85eb('0x18')]=_0x1fde1a[_0x85eb('0x18')]||0x0;this['countdropretry']=_0x1fde1a['countdropretry']||0x0;this['countabandonedretry']=_0x1fde1a['countabandonedretry']||0x0;this[_0x85eb('0x1c')]=_0x1fde1a[_0x85eb('0x1c')]||0x0;this[_0x85eb('0x1b')]=_0x1fde1a[_0x85eb('0x1b')]||0x0;this[_0x85eb('0x1d')]=_0x1fde1a[_0x85eb('0x1d')];this['callbackuniqueid']=_0x1fde1a['callbackuniqueid'];this['callbackat']=_0x1fde1a[_0x85eb('0x1e')];this[_0x85eb('0x1f')]=_0x1fde1a[_0x85eb('0x1f')];this[_0x85eb('0x20')]=_0x1fde1a[_0x85eb('0x20')];this[_0x85eb('0x21')]=_0x1fde1a['ListId'];this[_0x85eb('0x22')]=_[_0x85eb('0x1')](_0x1fde1a[_0x85eb('0xb')])?_0x1fde1a[_0x85eb('0x22')]:_0x1fde1a[_0x85eb('0xb')]['id'];this['VoiceQueueId']=_0x1fde1a[_0x85eb('0x23')];this[_0x85eb('0x24')]='';this[_0x85eb('0x25')]='';}Action[_0x85eb('0x26')][_0x85eb('0x27')]=function(){return util[_0x85eb('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x85eb('0x28')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 331b332..c924a23 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','active','SIP/%s','status','reachable','unmonitored','run','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','syncVarSet','filterKey','keys','variable','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./util/util','../dialer/utils','redis','defaults','localhost','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','syncHangupRequest','syncDialEnd','bind','newexten','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','paused','INACTIVE','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','Queue','queue','originated:\x20','stringify','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','catch','loggedIn','NO_AGENTS_LOGGED','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','custom:agentconnect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','\x20Queue','pTalking:\x20','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x00bb,0x1d8));var _0xb00b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x00bb[_0x24237f];return _0x48298e;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var uuid=require(_0xb00b('0x2'));var moment=require('moment');var Redis=require(_0xb00b('0x3'));var config=require('../../../config/environment');var logger=require(_0xb00b('0x4'))(_0xb00b('0x5'));var loggerAction=require('../../../config/logger')(_0xb00b('0x6'));var ami=require(_0xb00b('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require(_0xb00b('0x8'));var utils=require(_0xb00b('0x9'));config[_0xb00b('0xa')]=_[_0xb00b('0xb')](config[_0xb00b('0xa')],{'host':_0xb00b('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb00b('0xd')][_0xb00b('0xe')]=function(_0x5851d4){this[_0xb00b('0xf')]=this[_0xb00b('0xf')]?this['tail'][_0xb00b('0x10')](_0x5851d4):_0x5851d4();};function Preview(_0x5a63ed){this['sequence']=new Sequence();this['campaignsPreview']=_0x5a63ed[_0xb00b('0x11')];this[_0xb00b('0x12')]=_0x5a63ed[_0xb00b('0x12')];this[_0xb00b('0x13')]={};this[_0xb00b('0x14')]=_0x5a63ed[_0xb00b('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0xb00b('0x15'),this[_0xb00b('0x16')]['bind'](this));ami['on'](_0xb00b('0x17'),this[_0xb00b('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xb00b('0x19')]['bind'](this));ami['on']('dialend',this[_0xb00b('0x1a')][_0xb00b('0x1b')](this));ami['on'](_0xb00b('0x1c'),this[_0xb00b('0x1d')]['bind'](this));ami['on'](_0xb00b('0x1e'),this['syncVarSet'][_0xb00b('0x1b')](this));ami['on']('attendedtransfer',this[_0xb00b('0x1f')]['bind'](this));ami['on'](_0xb00b('0x20'),this[_0xb00b('0x21')]['bind'](this));this['loopCampaigns'](this[_0xb00b('0x22')]);}function emit(_0x4a334b,_0x1344c4,_0x43da66){io['to'](_0x4a334b)[_0xb00b('0x23')](_0x1344c4,_0x43da66);}function emitVoiceQueueChannelRemove(_0x3501af){logger['info'](_0xb00b('0x24'),JSON['stringify'](_0x3501af));emit(util[_0xb00b('0x25')](_0xb00b('0x26'),_0x3501af['name']),_0xb00b('0x27'),_0x3501af);io[_0xb00b('0x23')]('voice_queue_presence:remove',_0x3501af);}function notSendMessagesQueue(_0x3ab3cc){if(_0x3ab3cc[_0xb00b('0x28')]){if(_0x3ab3cc['originated']===0x0&&_0x3ab3cc[_0xb00b('0x29')]===0x0){_0x3ab3cc[_0xb00b('0x28')]=![];_0x3ab3cc[_0xb00b('0x2a')]=0x0;_0x3ab3cc[_0xb00b('0x2b')]=0x0;_0x3ab3cc['message']=utils['CAMPAIGN_STATUS'][_0xb00b('0x2c')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3ab3cc['name']+_0xb00b('0x2d'));}else{_0x3ab3cc[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x30')];ut[_0xb00b('0x31')](_0xb00b('0x32'),_0x3ab3cc[_0xb00b('0x33')]+'\x20is\x20deactivated');}}}Preview[_0xb00b('0xd')]['loopCampaigns']=function(){var _0x450129=this;setInterval(function(){_0x450129[_0xb00b('0x34')]();},0x7cf);};Preview[_0xb00b('0xd')]['syncCampaigns']=function(){var _0x2fc11a=this[_0xb00b('0x22')];this[_0xb00b('0x35')]+=0x1;for(var _0x183233 in _0x2fc11a){if(_0x2fc11a[_0xb00b('0x36')](_0x183233)&&(_0x2fc11a[_0x183233][_0xb00b('0x37')]===_0xb00b('0x5')||_0x2fc11a[_0x183233][_0xb00b('0x37')]===_0xb00b('0x38'))&&_0x2fc11a[_0x183233]['type']===_0xb00b('0x39')){if(this[_0xb00b('0x35')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xb00b('0x3a')]();}}if(_0x2fc11a[_0xb00b('0x36')](_0x183233)&&_0x2fc11a[_0x183233]['dialMethod']===_0xb00b('0x5')&&_0x2fc11a[_0x183233]['type']===_0xb00b('0x39')){if(_0x2fc11a[_0x183233][_0xb00b('0x3b')]){this[_0xb00b('0x3c')](_0x2fc11a[_0x183233]);if(_0x2fc11a[_0x183233][_0xb00b('0x3d')])this[_0xb00b('0x3e')](_0x2fc11a[_0x183233]);}else{notSendMessagesQueue(_0x2fc11a[_0x183233]);}}}};Preview[_0xb00b('0xd')][_0xb00b('0x3f')]=function(_0x594840){var _0x57e8f9=this;this['sequence'][_0xb00b('0xe')](function(){if(!_[_0xb00b('0x40')](_0x57e8f9[_0xb00b('0x13')][_0x594840])){loggerAction[_0xb00b('0x41')]('[clearZombieChannels][talking]',_0x594840,_0xb00b('0x42'),_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')],_0xb00b('0x44'),JSON[_0xb00b('0x45')](_0x57e8f9[_0xb00b('0x22')][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]]['originated']),'pTalking:\x20',JSON[_0xb00b('0x45')](_0x57e8f9['campaignsPreview'][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]][_0xb00b('0x29')]),JSON[_0xb00b('0x45')](_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x46')]),JSON[_0xb00b('0x45')](_['pick'](_0x57e8f9[_0xb00b('0x13')][_0x594840],[_0xb00b('0x47'),_0xb00b('0x48'),_0xb00b('0x49'),_0xb00b('0x4a')])));return ami[_0xb00b('0x4b')]({'action':'status','channel':_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x4c')]})['catch'](function(_0x17ff34){if(_0x17ff34[_0xb00b('0x2e')]===_0xb00b('0x4d')){setTimeout(function(){if(_0x57e8f9[_0xb00b('0x13')][_0x594840]){ut[_0xb00b('0x4e')](_0x57e8f9['campaignsPreview'][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]],_0xb00b('0x4f'));if(_0x57e8f9[_0xb00b('0x13')][_0x594840]['dialAnswer']===!![]){ut['decrementTalkink'](_0x57e8f9[_0xb00b('0x22')][_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]],_0xb00b('0x4f'));ut[_0xb00b('0x50')](_0xb00b('0x51')+_0x594840,_0x57e8f9[_0xb00b('0x13')][_0x594840]['queue']);}ut[_0xb00b('0x50')](_0xb00b('0x52')+_0x594840,_0x57e8f9[_0xb00b('0x13')][_0x594840][_0xb00b('0x43')]);delete _0x57e8f9[_0xb00b('0x13')][_0x594840];}},0x2328);}});}});};Preview[_0xb00b('0xd')][_0xb00b('0x3a')]=function(){var _0x974a29=this;loggerAction[_0xb00b('0x41')](_0xb00b('0x53'),_[_0xb00b('0x54')](this[_0xb00b('0x13')]));for(var _0x577bad in this[_0xb00b('0x13')]){if(_0x974a29[_0xb00b('0x13')][_0xb00b('0x36')](_0x577bad)){_0x974a29[_0xb00b('0x3f')](_0x577bad);}}};Preview[_0xb00b('0xd')][_0xb00b('0x3e')]=function(_0xd97f49){var _0x1b4f09=this;rpcDb[_0xb00b('0x55')](_0xd97f49['id'],ut[_0xb00b('0x56')](this[_0xb00b('0x14')]))[_0xb00b('0x57')](function(_0x5dbe00){if(!_['isNil'](_0x5dbe00)){for(var _0x47c6c0=0x0;_0x47c6c0<_0x5dbe00[_0xb00b('0x58')];_0x47c6c0+=0x1){if(ut[_0xb00b('0x59')](_0x5dbe00[_0x47c6c0]['scheduledat'])<_0xd97f49[_0xb00b('0x5a')]*0x3c){if(_0x5dbe00[_0x47c6c0][_0xb00b('0x5b')]&&!_0x5dbe00[_0x47c6c0][_0xb00b('0x5b')][_0xb00b('0x5c')]){_0x1b4f09['run'](_0x5dbe00[_0x47c6c0]['id'])['then'](ut[_0xb00b('0x5d')](_0xb00b('0x5e')))['catch'](ut['logger2'](_0xb00b('0x5e')));}else{rpcDb[_0xb00b('0x5f')](_0x5dbe00[_0x47c6c0]['id']);}}else{var _0x4e0be4=new Action(_0x5dbe00[_0x47c6c0],_0xd97f49);_0x4e0be4[_0xb00b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd97f49['outboundReCallsDay']+=0x1;ut[_0xb00b('0x61')](_0x4e0be4,0x17,'RecallInQueue');if(_0xd97f49[_0xb00b('0x62')]){rpcDb[_0xb00b('0x63')](ut[_0xb00b('0x64')](_0x5dbe00[_0x47c6c0]));rpcDb[_0xb00b('0x65')](_0x4e0be4,_0xb00b('0x66'));}else{ut[_0xb00b('0x61')](_0x4e0be4,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x4e0be4,_0xb00b('0x67'));rpcDb[_0xb00b('0x68')](_0x4e0be4,'[HistoryRecallClose]');}}}}})[_0xb00b('0x69')](ut[_0xb00b('0x5d')]('[getContactRecallMe]'));};Preview[_0xb00b('0xd')][_0xb00b('0x3c')]=function(_0x3b5d82){_0x3b5d82['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x3b5d82[_0xb00b('0x6a')])){_0x3b5d82[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x6b')];}else if(!ut['isActive'](_0x3b5d82[_0xb00b('0x3b')])){_0x3b5d82[_0xb00b('0x2e')]=utils['CAMPAIGN_STATUS']['INACTIVE'];}else if(!this[_0xb00b('0x6c')](_0x3b5d82['Trunk'])){if(!this[_0xb00b('0x6c')](_0x3b5d82[_0xb00b('0x6d')])){_0x3b5d82[_0xb00b('0x2e')]=utils[_0xb00b('0x2f')][_0xb00b('0x6e')];}else{_0x3b5d82[_0xb00b('0x2e')]=utils['CAMPAIGN_STATUS'][_0xb00b('0x6f')];}}else{_0x3b5d82['message']=utils[_0xb00b('0x2f')][_0xb00b('0x6f')];}};Preview[_0xb00b('0xd')]['callProgressDetectingCustomer']=function(_0x248335,_0x25f1f6,_0x4ba53a){var _0x598a55=this;var _0x24e826=this[_0xb00b('0x13')][_0x25f1f6];var _0x219b74=this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]];var _0x279467;var _0x347949=![];var _0x3a0b90=0x2;var _0x4c3067=0x3;if(_0x219b74){switch(_0x4ba53a){case'1':_0x219b74[_0xb00b('0x70')]+=0x1;_0x24e826[_0xb00b('0x71')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x0,_0xb00b('0x73'));ami[_0xb00b('0x23')](_0xb00b('0x74'),ut[_0xb00b('0x75')](_0x24e826,'nosuchnumber'));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0x76'));_0x598a55[_0xb00b('0x77')](_0x24e826,'0',_0x219b74)[_0xb00b('0x57')](function(_0x4b1e5f){_0x347949=_0x4b1e5f[_0xb00b('0x78')]==0x1;_0x3a0b90=_0x219b74[_0xb00b('0x79')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb['createCustomerFinal'](_0x279467,_0xb00b('0x7f'));}else{if(_0x24e826['countnosuchnumberretry']>=_0x219b74[_0xb00b('0x80')]){rpcDb['createCustomerFinal'](_0x24e826,_0xb00b('0x7f'));}else{rpcDb['rescheduleContact'](ut[_0xb00b('0x81')](_0x24e826,'countnosuchnumberretry',_0x219b74[_0xb00b('0x79')]),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}delete this['actions'][_0x248335['linkedid']];}else{_0x24e826['countnosuchnumberretry']++;logger[_0xb00b('0x41')](_0xb00b('0x84'),_0x24e826[_0xb00b('0x71')]);logger['info']('id',_0x24e826[_0xb00b('0x85')]);_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnosuchnumberretry':_0x24e826[_0xb00b('0x71')]}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0x87'):var _0x5622a4=moment()[_0xb00b('0x25')](_0xb00b('0x88'));_0x24e826[_0xb00b('0x89')]=_0x5622a4;_0x24e826['answertime']=_0x5622a4;_0x24e826['dialAnswer']=!![];_0x219b74[_0xb00b('0x29')]+=0x1;logger[_0xb00b('0x41')](_0xb00b('0x8a'),_0x24e826['uniqueid'],'\x20Queue',_0x219b74['name'],'pTalking:\x20',_0x219b74[_0xb00b('0x29')]);ami['emit'](_0xb00b('0x8b'),ut[_0xb00b('0x75')](_0x24e826,'connect',this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]]));if(_0x219b74[_0xb00b('0x8c')]){ami[_0xb00b('0x23')](_0xb00b('0x8d'),ut['buildAcw'](_0x24e826));}break;case'16':ami[_0xb00b('0x23')](_0xb00b('0x8e'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0x8f'),this[_0xb00b('0x22')][_0x24e826[_0xb00b('0x43')]]));emitVoiceQueueChannelRemove(ut[_0xb00b('0x75')](_0x24e826,'complete'));_0x219b74[_0xb00b('0x90')]+=0x1;_0x219b74[_0xb00b('0x91')]+=0x1;_0x219b74[_0xb00b('0x92')]+=0x1;ut[_0xb00b('0x93')](_0x219b74,_0xb00b('0x94'));_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x4,'Answer');rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0x95'));rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0x96'));rpcDb[_0xb00b('0x97')](_0x24e826);_0x219b74[_0xb00b('0x98')]+=_0x24e826[_0xb00b('0x99')];_0x219b74[_0xb00b('0x9a')]+=_0x24e826['talktime'];logger[_0xb00b('0x41')](_0xb00b('0x9b'),_0x24e826[_0xb00b('0x9c')],_0xb00b('0x9d'),_0x219b74[_0xb00b('0x33')],_0xb00b('0x9e'),_0x219b74[_0xb00b('0x29')]);delete this['actions'][_0x248335[_0xb00b('0x9f')]];break;case _0xb00b('0xa0'):_0x219b74[_0xb00b('0xa1')]+=0x1;_0x24e826[_0xb00b('0xa2')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut['logCustomer'](_0x24e826,0x5,_0xb00b('0xa3'));_0x3a0b90=_0x219b74['dialBusyRetryFrequency'];_0x4c3067=_0x219b74[_0xb00b('0x7a')];ami['emit'](_0xb00b('0xa4'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xa5')));rpcDb['createCustomerHistory'](_0x24e826,'[callProgressDetectingCustomer][logBusy]');_0x598a55[_0xb00b('0x77')](_0x24e826,'5',_0x219b74)[_0xb00b('0x57')](function(_0x33a483){_0x347949=_0x33a483[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xa6'));}else{if(_0x24e826[_0xb00b('0xa2')]>=_0x219b74[_0xb00b('0xa7')]){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xa8'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x24e826,_0xb00b('0xa2'),_0x219b74[_0xb00b('0xa9')]),_0x24e826['unlockAgent'],_0x24e826['activeContact']);}}}else{_0x24e826[_0xb00b('0xa2')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countbusyretry':_0x24e826['countbusyretry']}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xab'):_0x219b74[_0xb00b('0xac')]+=0x1;_0x24e826[_0xb00b('0xad')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x3,'NoAnswer');_0x3a0b90=_0x219b74[_0xb00b('0xae')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];var _0x545dfd=ut[_0xb00b('0xaf')](_0x24e826,_0x219b74);ami[_0xb00b('0x23')](_0xb00b('0xb0'),_0x545dfd);rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xb1'));_0x598a55[_0xb00b('0x77')](_0x24e826,'3',_0x219b74)[_0xb00b('0x57')](function(_0x2423b2){_0x347949=_0x2423b2[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,'Global');rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xb2'));}else{if(_0x24e826[_0xb00b('0xad')]>=_0x219b74[_0xb00b('0xb3')]){rpcDb['createCustomerFinal'](_0x24e826,_0xb00b('0xb1'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xad'),_0x219b74[_0xb00b('0xae')]),_0x24e826['unlockAgent'],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826['countnoanswerretry']}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xb5'):_0x219b74[_0xb00b('0xb6')]+=0x1;_0x24e826[_0xb00b('0xb7')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x8,_0xb00b('0xb8'));_0x3a0b90=_0x219b74[_0xb00b('0xb9')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];ami[_0xb00b('0x23')]('custom:agentcongestion',ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xba')));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xbb'));_0x598a55['verifyAdditionalPhones'](_0x24e826,'8',_0x219b74)[_0xb00b('0x57')](function(_0xb27b8b){_0x347949=_0xb27b8b['additional']==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74['dialGlobalMaxRetry']){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x24e826[_0xb00b('0xb7')]>=_0x219b74[_0xb00b('0xbc')]){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xbb'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xb7'),_0x219b74[_0xb00b('0xa9')]),_0x24e826[_0xb00b('0x82')],_0x24e826['activeContact']);}}}else{_0x24e826['countcongestionretry']++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countcongestionretry':_0x24e826[_0xb00b('0xb7')]}})[_0xb00b('0x57')](function(){_0x598a55['swapAdditionalPhones'](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case _0xb00b('0xbd'):_0x219b74['outboundRejectCallsDay']+=0x1;_0x24e826[_0xb00b('0xbe')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut['logCustomer'](_0x24e826,0x14,_0xb00b('0xbf'));_0x3a0b90=_0x219b74[_0xb00b('0xc0')];_0x4c3067=_0x219b74['callAdditionalPhoneAfterMin'];ami[_0xb00b('0x23')](_0xb00b('0xc1'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xc2')));rpcDb[_0xb00b('0x65')](_0x24e826,_0xb00b('0xc3'));_0x598a55[_0xb00b('0x77')](_0x24e826,'20',_0x219b74)[_0xb00b('0x57')](function(_0x55ea09){_0x347949=_0x55ea09[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0x14,'AgentReject');rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x24e826[_0xb00b('0xbe')]>=_0x219b74['dialAgentRejectMaxRetry']){rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xc4'));}else{rpcDb[_0xb00b('0xb4')](ut[_0xb00b('0x81')](_0x24e826,_0xb00b('0xbe'),_0x219b74['dialAgentRejectRetryFrequency']),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826['countnoanswerretry']++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826['idContact'],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case'ABANDONED':_0x219b74[_0xb00b('0xc5')]+=0x1;_0x24e826[_0xb00b('0xc6')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x24e826,_0xb00b('0xc7'));_0x598a55[_0xb00b('0x77')](_0x24e826,'11',_0x219b74)[_0xb00b('0x57')](function(_0x2d5652){_0x347949=_0x2d5652[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut['totalGlobal'](_0x24e826)>=_0x219b74['dialGlobalMaxRetry']){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xc7'));}else{if(_0x24e826[_0xb00b('0xc8')]>=_0x219b74[_0xb00b('0xc9')]){rpcDb[_0xb00b('0x68')](_0x24e826,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb00b('0xb4')](ut['scheduledAt'](_0x24e826,_0xb00b('0xc6'),_0x219b74['dialAbandonedRetryFrequency']),_0x24e826[_0xb00b('0x82')],_0x24e826[_0xb00b('0x83')]);}}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});break;case'18':_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0xcb')]+=0x1;_0x24e826['countglobal']=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x12,_0x248335[_0xb00b('0xcc')]||_0x248335[_0xb00b('0xcd')]);ami['emit'](_0xb00b('0xce'),ut[_0xb00b('0x75')](_0x24e826,'amd'));rpcDb[_0xb00b('0x65')](_0x24e826,'[callProgressDetectingCustomer][hangupInAMD]');_0x598a55[_0xb00b('0x77')](_0x24e826,'18',_0x219b74)[_0xb00b('0x57')](function(_0x49fe3f){_0x347949=_0x49fe3f[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0x12,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xb00b('0x68')](_0x24e826,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55[_0xb00b('0x86')]({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})['then'](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});delete this[_0xb00b('0x13')][_0x248335['linkedid']];break;case'19':_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut[_0xb00b('0x7b')](_0x24e826);ut[_0xb00b('0x61')](_0x24e826,0x13,_0x248335['cause-txt']||_0x248335[_0xb00b('0xcd')]);ami[_0xb00b('0x23')](_0xb00b('0xce'),ut[_0xb00b('0x75')](_0x24e826,_0xb00b('0xcf')));rpcDb[_0xb00b('0x65')](_0x24e826,'[callProgressDetectingCustomer][machine]');_0x598a55['verifyAdditionalPhones'](_0x24e826,'18',_0x219b74)[_0xb00b('0x57')](function(_0x23d306){_0x347949=_0x23d306[_0xb00b('0x78')]==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut['cloneAction'](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xd0'));}else{rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xd0'));}}else{_0x24e826[_0xb00b('0xad')]++;_0x598a55['incrementPreviewCounters']({'id':_0x24e826[_0xb00b('0x85')],'field':{'countnoanswerretry':_0x24e826[_0xb00b('0xad')]}})[_0xb00b('0x57')](function(){_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});});}});delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0x9f')]];break;default:if(_0x24e826[_0xb00b('0x46')]){ut[_0xb00b('0x93')](_0x219b74,_0xb00b('0xd1'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x219b74[_0xb00b('0x33')],_0x248335);}_0x219b74[_0xb00b('0xca')]+=0x1;_0x24e826[_0xb00b('0x72')]=ut['totalGlobal'](_0x24e826);ut['logCustomer'](_0x24e826,0xc,_0x248335['cause-txt']||_0x248335[_0xb00b('0xcd')]);_0x3a0b90=_0x219b74[_0xb00b('0xc0')];_0x4c3067=_0x219b74[_0xb00b('0x7a')];rpcDb['createCustomerHistory'](_0x24e826,_0xb00b('0xd2'));_0x598a55[_0xb00b('0x77')](_0x24e826,'20',_0x219b74)[_0xb00b('0x57')](function(_0x142674){_0x347949=_0x142674['additional']==0x1;if(!_0x347949){if(ut[_0xb00b('0x7b')](_0x24e826)>=_0x219b74[_0xb00b('0x7c')]){_0x279467=ut[_0xb00b('0x7d')](_0x24e826,0xf,_0xb00b('0x7e'));rpcDb[_0xb00b('0x68')](_0x279467,_0xb00b('0xd3'));}else{rpcDb[_0xb00b('0x68')](_0x24e826,_0xb00b('0xd3'));}delete this['actions'][_0x248335[_0xb00b('0x9f')]];}else{_0x598a55[_0xb00b('0xaa')](_0x24e826,_0x3a0b90,_0x4c3067)[_0xb00b('0x57')](function(){});}});}if(!(_0x24e826[_0xb00b('0x46')]&&_0x4ba53a==='16')){ut[_0xb00b('0x4e')](_0x219b74,_0xb00b('0xd4'));logger[_0xb00b('0x41')](_0xb00b('0xd5'),_0x24e826['uniqueid'],_0xb00b('0x9d'),_0x219b74[_0xb00b('0x33')],_0xb00b('0x44'),_0x219b74[_0xb00b('0xd6')]);}if(_0x4ba53a!=='ANSWER'){delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0x9f')]];delete this[_0xb00b('0x13')][_0x248335[_0xb00b('0xd7')]];}_0x219b74[_0xb00b('0xd8')]=!![];}};Preview[_0xb00b('0xd')][_0xb00b('0xd9')]=function(_0x3184de,_0x48ac4b,_0x5f0fab){if(_[_0xb00b('0xda')](_0x48ac4b)&&_0xb00b('0xdb')!==typeof _0x48ac4b){return;}if(_[_0xb00b('0xda')](_0x5f0fab)&&'object'!==typeof _0x5f0fab){return;}switch(_0x5f0fab[_0xb00b('0xdc')]){case'0':ut[_0xb00b('0xdd')](_0x3184de,0x0,_0xb00b('0x73'));rpcDb['createAgentHistory'](_0x3184de,_0xb00b('0xde'));break;case'3':ut[_0xb00b('0xdd')](_0x3184de,0x3,_0xb00b('0xdf'));rpcDb['createAgentHistory'](_0x3184de,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb00b('0xdd')](_0x3184de,0x5,'Busy');rpcDb[_0xb00b('0xe0')](_0x3184de,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x3184de,0x8,_0xb00b('0xb8'));rpcDb[_0xb00b('0xe0')](_0x3184de,_0xb00b('0xe1'));break;case'22':ut[_0xb00b('0xdd')](_0x3184de,0x16,_0xb00b('0xe2'));rpcDb['createAgentHistory'](_0x3184de,_0xb00b('0xe3'));break;default:ut['logAgent'](_0x3184de,0xc,_0x5f0fab['reason']);rpcDb[_0xb00b('0xe0')](_0x3184de,_0xb00b('0xe1'));}ut[_0xb00b('0x4e')](_0x48ac4b,_0xb00b('0xe4'));logger[_0xb00b('0x41')](_0xb00b('0xe5'),_0x3184de['uniqueid'],_0xb00b('0x9d'),_0x48ac4b['name'],_0xb00b('0x44'),_0x48ac4b[_0xb00b('0xd6')]);delete this[_0xb00b('0x13')][_0x3184de['uniqueid']];};Preview[_0xb00b('0xd')][_0xb00b('0x77')]=function(_0x20790f,_0x3dc8d2,_0x5d224c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x20790f,_0x3dc8d2,_0x5d224c)[_0xb00b('0x69')](logger['info']('[verifyAdditionalPhone]\x20'));};Preview[_0xb00b('0xd')]['swapAdditionalPhones']=function(_0x505ae2,_0x2fecca,_0x330bc7){return cmHopperAdditionalPhone[_0xb00b('0xaa')](_0x505ae2,_0x2fecca,_0x330bc7)[_0xb00b('0x69')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0xb00b('0xd')][_0xb00b('0x86')]=function(_0x9facaf){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xb00b('0x86')](_0x9facaf))['catch'](logger['info'](_0xb00b('0xe6')));};Preview['prototype'][_0xb00b('0xe7')]=function(_0x481671,_0x1b751e,_0x5712fd,_0x3de808,_0x3289aa){var _0x1ec560=this;return new Promise(function(_0x54498c,_0x442b28){if(_['isNil'](_0x1b751e)||_[_0xb00b('0x40')](_0x1b751e[_0xb00b('0xe8')])||_['isNil'](_0x1b751e['phone'])||_['isNil'](_0x1b751e['VoiceQueueId'])){_0x442b28(ut[_0xb00b('0x2e')]('Contact\x20is\x20undefined',_0x3de808,_0x3289aa));return;}var _0x134d17=uuid['v4']();var _0x5ad4d4=_0x1ec560[_0xb00b('0x22')][_0x1b751e[_0xb00b('0x42')][_0xb00b('0x33')]];var _0x44b2f1=_0x5712fd?_0x1ec560[_0xb00b('0x14')][_0x5712fd]['id']:undefined;_0x1ec560['actions'][_0x134d17]=new Action(_0x1b751e,_0x5ad4d4,_0x134d17,_0x5712fd,_0x44b2f1);var _0x8292fe=_0x1ec560[_0xb00b('0x13')][_0x134d17];_0x8292fe[_0xb00b('0x82')]=_0x3de808;_0x8292fe[_0xb00b('0x83')]=_0x3289aa;_0x8292fe['lookAgent']=_0x5712fd;if(_['isEmpty'](_0x481671)){_0x1ec560[_0xb00b('0xe9')](_0x8292fe,_0x5ad4d4,_0x1b751e,_0x5712fd)[_0xb00b('0x57')](function(_0x181393){logger[_0xb00b('0x41')](_0xb00b('0xea'),_0xb00b('0xeb')+_0x8292fe[_0xb00b('0x43')]+_0xb00b('0xec')+_0x8292fe[_0xb00b('0x85')],JSON['stringify'](_0x181393));ami[_0xb00b('0x23')](_0xb00b('0xed'),ut['buildObj'](_0x8292fe,_0xb00b('0xee'),_0x1ec560['campaignsPreview'][_0x8292fe[_0xb00b('0x43')]]));_0x54498c(ut[_0xb00b('0x2e')]('Calling'));})['catch'](function(_0x32264a){ut[_0xb00b('0x31')](_0xb00b('0xef'),_0x32264a);_0x442b28(ut['message'](_0xb00b('0xf0'),_0x3de808,_0x3289aa));});}else{_0x5ad4d4[_0xb00b('0xf1')]+=0x1;ut[_0xb00b('0xf2')](_0x8292fe);rpcDb['createHistory'](_0x8292fe,_0xb00b('0xf3'));delete _0x1ec560['actions'][_0x134d17];_0x442b28(ut['message']('Contact\x20in\x20black\x20List',_0x3de808,_0x3289aa));}});};Preview[_0xb00b('0xd')]['isTrunkReachable']=function(_0x1b8d45){return!_[_0xb00b('0x40')](_0x1b8d45)&&!_['isNil'](_0x1b8d45['name'])&&!_[_0xb00b('0x40')](_0x1b8d45[_0xb00b('0xf4')])&&_0x1b8d45['active']&&!_[_0xb00b('0x40')](this[_0xb00b('0x12')][util[_0xb00b('0x25')](_0xb00b('0xf5'),_0x1b8d45[_0xb00b('0x33')])])&&!_[_0xb00b('0x40')](this['trunks'][util[_0xb00b('0x25')](_0xb00b('0xf5'),_0x1b8d45['name'])][_0xb00b('0xf6')])&&(this['trunks'][util['format'](_0xb00b('0xf5'),_0x1b8d45['name'])][_0xb00b('0xf6')]===_0xb00b('0xf7')||this[_0xb00b('0x12')][util['format']('SIP/%s',_0x1b8d45['name'])][_0xb00b('0xf6')]===_0xb00b('0xf8'));};Preview['prototype'][_0xb00b('0xf9')]=function(_0x18e86f,_0x3aa8c0){return this[_0xb00b('0xfa')](_0x18e86f,_0x3aa8c0)[_0xb00b('0x57')](function(_0x166ff5){return _[_0xb00b('0xfb')](_0x166ff5,[_0xb00b('0x2e')]);})['catch'](function(_0x1b097a){if(_0x1b097a[_0xb00b('0xfc')]){rpcDb[_0xb00b('0xfd')](_0x18e86f);}if(_0x1b097a['active']){rpcDb['disableContact'](_0x18e86f);}throw _['pick'](_0x1b097a,[_0xb00b('0x2e')]);});};Preview[_0xb00b('0xd')][_0xb00b('0xfa')]=function(_0x4bc6df,_0x399902){var _0x34985d=this;var _0x2057d1,_0xdee547;return rpcDb[_0xb00b('0xfe')](_0x4bc6df)['then'](function(_0x1674ab){if(!_['isNil'](_0x1674ab[0x0])){_0xdee547=_0x1674ab[0x0][_0xb00b('0xff')]?![]:!![];_0x2057d1=_0x1674ab[0x0][_0xb00b('0xff')]?!![]:![];_0x2057d1=_0x399902?!![]:_0x2057d1;}var _0xde6b5=_0x34985d[_0xb00b('0x100')](_0x1674ab);if(_0xde6b5[_0xb00b('0x101')]){rpcDb[_0xb00b('0x102')](_['pick'](_0x1674ab[0x0],[_0xb00b('0x49'),_0xb00b('0x103')]))[_0xb00b('0x57')](function(_0x278d9e){_0x34985d[_0xb00b('0xe7')](_0x278d9e,_0x1674ab[0x0],_0x399902,_0xdee547,_0x2057d1)[_0xb00b('0x57')](function(_0x26cd15){return _0x26cd15;})[_0xb00b('0x69')](function(_0xd2f1ba){throw _0xd2f1ba;});})[_0xb00b('0x69')](function(_0x5f1258){ut[_0xb00b('0x31')](_0xb00b('0x104'),_0x5f1258);throw ut['message'](_0xb00b('0x105'),_0xdee547,_0x2057d1);});}else{throw ut['message'](_0xde6b5['message'],_0xdee547,_0x2057d1);}})['catch'](function(_0x384a16){ut['logger'](_0xb00b('0x106'),_0x384a16);throw ut[_0xb00b('0x2e')](_0xb00b('0x105'),![],!![]);});};Preview[_0xb00b('0xd')][_0xb00b('0x100')]=function(_0x116ced){if(_[_0xb00b('0x40')](_0x116ced)||_[_0xb00b('0x107')](_0x116ced)||!_[_0xb00b('0x40')](_0x116ced[0x0][_0xb00b('0x5b')])&&_[_0xb00b('0x40')](_0x116ced[0x0][_0xb00b('0x5b')][_0xb00b('0x33')])){ut[_0xb00b('0x31')]('[Preview][validateContact][Empty\x20Contact]',_0x116ced);return{'isValid':![],'message':_0xb00b('0x108')};}var _0x15f9cd=this[_0xb00b('0x22')][_0x116ced[0x0][_0xb00b('0x42')][_0xb00b('0x33')]];_0x15f9cd['message']=utils[_0xb00b('0x2f')][_0xb00b('0x6f')];if(_['isNil'](_0x15f9cd)){ut['logger'](_0xb00b('0x109'),_0x15f9cd);return{'isValid':![],'message':_0xb00b('0x10a')};}if(!this[_0xb00b('0x6c')](_0x15f9cd[_0xb00b('0x10b')])){ut[_0xb00b('0x31')](_0xb00b('0x10c'),_0xb00b('0x10d')+_0x15f9cd[_0xb00b('0x33')]+_0xb00b('0x10e'));if(!this[_0xb00b('0x6c')](_0x15f9cd[_0xb00b('0x6d')])){ut['logger'](_0xb00b('0x10c'),_0x15f9cd['name']+_0xb00b('0x10f'));return{'isValid':![],'message':_0xb00b('0x110')};}}if(!ut[_0xb00b('0x111')](_0x15f9cd[_0xb00b('0x3b')])){ut[_0xb00b('0x31')](_0xb00b('0x112'),_0x15f9cd['name']+_0xb00b('0x113'));return{'isValid':![],'message':_0xb00b('0x10d')+_0x15f9cd[_0xb00b('0x33')]+_0xb00b('0x113')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xb00b('0xd')][_0xb00b('0xe9')]=function(_0x58dbf6,_0x199ba1,_0x16cca9,_0x3c57b2){var _0xca4a87=this;return new Promise(function(_0x456515,_0x26145a){var _0x31fa5b=_0x58dbf6[_0xb00b('0x9c')];var _0x1ba141=_0xca4a87['isTrunkReachable'](_0x199ba1[_0xb00b('0x10b')])?util[_0xb00b('0x25')]('SIP/%s/%s%s',_0x199ba1[_0xb00b('0x10b')][_0xb00b('0x33')],_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x114')])?'':_0x199ba1[_0xb00b('0x114')][_0xb00b('0x115')]()||'',_0x199ba1[_0xb00b('0x116')]>0x0?_0x16cca9[_0xb00b('0x103')][_0xb00b('0x117')](_0x199ba1[_0xb00b('0x116')]):_0x16cca9[_0xb00b('0x103')]):util['format'](_0xb00b('0x118'),_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x6d')])?_0x199ba1['Trunk'][_0xb00b('0x33')]:_0x199ba1[_0xb00b('0x6d')][_0xb00b('0x33')],_[_0xb00b('0x40')](_0x199ba1['dialPrefix'])?'':_0x199ba1[_0xb00b('0x114')][_0xb00b('0x115')]()||'',_0x199ba1['dialCutDigit']>0x0?_0x16cca9['phone'][_0xb00b('0x117')](_0x199ba1[_0xb00b('0x116')]):_0x16cca9['phone']);var _0x1256a8=_0xca4a87['isTrunkReachable'](_0x199ba1['Trunk'])?ut[_0xb00b('0x119')](_0x199ba1['Trunk']['callerid'],_0x199ba1[_0xb00b('0x11a')],_0x199ba1[_0xb00b('0x11b')]>0x0?ut[_0xb00b('0x11c')](_0x199ba1[_0xb00b('0x11d')],_0x199ba1[_0xb00b('0x11b')]):_0x199ba1[_0xb00b('0x11d')]):ut[_0xb00b('0x119')](_[_0xb00b('0x40')](_0x199ba1[_0xb00b('0x6d')])?_0x199ba1[_0xb00b('0x10b')][_0xb00b('0x11e')]:_0x199ba1[_0xb00b('0x6d')][_0xb00b('0x11e')],_0x199ba1[_0xb00b('0x11a')],_0x199ba1['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb00b('0x11c')](_0x199ba1[_0xb00b('0x11d')],_0x199ba1['dialRandomLastDigitCallerIdNumber']):_0x199ba1[_0xb00b('0x11d')]);if(_0x1256a8){_0x58dbf6['originatecalleridname']=ut[_0xb00b('0x11f')](_0x1256a8);_0x58dbf6[_0xb00b('0x120')]=ut[_0xb00b('0x121')](_0x1256a8);}var _0x5657ee=ut[_0xb00b('0x122')](_0x199ba1,_0x16cca9,_0x1ba141,_0x1256a8,_0x31fa5b,_0x58dbf6);_[_0xb00b('0x123')](_0x58dbf6,ut['toLowerVariables'](_0x5657ee));_0x58dbf6[_0xb00b('0x60')]=moment()[_0xb00b('0x25')](_0xb00b('0x88'));_0x199ba1[_0xb00b('0x124')]=_0x5657ee;var _0x57bfab=ut[_0xb00b('0x125')](_0x58dbf6,_0x199ba1,_0x5657ee,_0x58dbf6[_0xb00b('0x83')],_0x3c57b2);return ami[_0xb00b('0x4b')](_0x57bfab)['then'](function(_0x571811){_0x199ba1['originated']+=0x1;logger[_0xb00b('0x41')](_0xb00b('0x126'),_0x31fa5b,_0xb00b('0x9d'),_0x199ba1[_0xb00b('0x33')],_0xb00b('0x44'),_0x199ba1[_0xb00b('0xd6')]);_0x456515(_0x571811);})[_0xb00b('0x69')](function(_0x39b4c6){ut[_0xb00b('0xdd')](_0x58dbf6,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x58dbf6,_0xb00b('0x127'));_0x26145a(_0x39b4c6);});});};Preview[_0xb00b('0xd')]['syncNewExten']=function(_0x42fdce){if(this['actions'][_0x42fdce[_0xb00b('0x9f')]]){this['actions'][_0x42fdce[_0xb00b('0x9f')]][_0xb00b('0x4c')]=_0x42fdce['channel'];}};Preview[_0xb00b('0xd')][_0xb00b('0x16')]=function(_0x5573c9){var _0x44767a=this;var _0x4d4dbe=this[_0xb00b('0x13')][_0x5573c9[_0xb00b('0x128')]];if(_0x4d4dbe){if(_0x4d4dbe[_0xb00b('0x129')]&&this[_0xb00b('0x14')][_0x4d4dbe[_0xb00b('0x129')]]){ut[_0xb00b('0x12a')](_0x4d4dbe,this[_0xb00b('0x14')][_0x4d4dbe[_0xb00b('0x129')]][_0xb00b('0x33')],this[_0xb00b('0x14')][_0x4d4dbe['lookAgent']]['id']);}var _0x4cff99=_[_0xb00b('0x12b')](_0x4d4dbe);_0x4cff99['responsetime']=moment()[_0xb00b('0x25')]('YYYY-MM-DD\x20HH:mm:ss');var _0x198536=_0x44767a[_0xb00b('0x22')][_0x4d4dbe['queue']];if(ut[_0xb00b('0x12c')](_0x5573c9['response'])){if(_0x4d4dbe[_0xb00b('0x82')]){rpcDb[_0xb00b('0xfd')](_0x4d4dbe['idContact']);}if(_0x4d4dbe[_0xb00b('0x83')]){rpcDb[_0xb00b('0x5f')](_0x4d4dbe[_0xb00b('0x85')]);}ami[_0xb00b('0x23')](_0xb00b('0x12d'),ut['buildObj'](_0x4d4dbe,_0xb00b('0x12e'),this[_0xb00b('0x22')][_0x4d4dbe['queue']]));this['callProgressDetectingAgent'](_0x4cff99,_0x198536,_0x5573c9);}else{_0x4d4dbe[_0xb00b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x4cff99,0x4,_0xb00b('0x12f'));rpcDb[_0xb00b('0xe0')](_0x4cff99,_0xb00b('0x130'));}}};Preview[_0xb00b('0xd')]['syncHangup']=function(_0xcaefbd){var _0x482fc4=this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]];var _0x22f2f6;if(_0x482fc4){_0x22f2f6=this[_0xb00b('0x22')][_0x482fc4['queue']];logger[_0xb00b('0x41')](_0xb00b('0x131'),_0xcaefbd['linkedid'],_0xb00b('0x9d'),_0x22f2f6[_0xb00b('0x33')],_0xb00b('0x9e'),_0x22f2f6['pTalking']);}if(this['actions'][_0xcaefbd[_0xb00b('0x9f')]]&&_0xcaefbd[_0xb00b('0x9f')]!==_0xcaefbd[_0xb00b('0x9c')]){if(_0xcaefbd[_0xb00b('0x132')]==='16'&&this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]][_0xb00b('0x46')]){this['callProgressDetectingCustomer'](_0xcaefbd,_0xcaefbd['linkedid'],_0xcaefbd[_0xb00b('0x132')]);}else if(this['actions'][_0xcaefbd['linkedid']][_0xb00b('0x46')]){logger[_0xb00b('0x41')]('[syncHangup][talking][cause]',_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')],_0xb00b('0x9d'),_0x22f2f6['name'],_0xb00b('0x9e'),_0x22f2f6[_0xb00b('0x29')]);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')]);}}else if(_0x482fc4&&_[_0xb00b('0x40')](_0x482fc4[_0xb00b('0x134')])&&_0x22f2f6['dialQueueProject']&&_0xcaefbd[_0xb00b('0x9f')]===_0xcaefbd[_0xb00b('0x9c')]&&_['isNil'](_0xcaefbd['reason'])&&_0xcaefbd['cause']==='16'&&_0xcaefbd[_0xb00b('0x135')]==='6'&&_[_0xb00b('0xda')](_0x482fc4[_0xb00b('0x136')])){if(_0x482fc4[_0xb00b('0x82')]){rpcDb[_0xb00b('0xfd')](_0x482fc4[_0xb00b('0x85')]);}if(_0x482fc4[_0xb00b('0x83')]){rpcDb['disableContact'](_0x482fc4['idContact']);}_0xcaefbd[_0xb00b('0xdc')]='22';this[_0xb00b('0xd9')](_0x482fc4,_0x22f2f6,_0xcaefbd);}else if(_0x482fc4&&_0x482fc4['transfer']){if(_0xcaefbd[_0xb00b('0x132')]==='16'&&this[_0xb00b('0x13')][_0xcaefbd['linkedid']][_0xb00b('0x46')]){logger['info'](_0xb00b('0x137'),_0xcaefbd['linkedid'],_0xcaefbd['cause'],'\x20Queue',_0x22f2f6[_0xb00b('0x33')],_0xb00b('0x9e'),_0x22f2f6[_0xb00b('0x29')]);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd['linkedid'],_0xcaefbd[_0xb00b('0x132')]);}else if(this[_0xb00b('0x13')][_0xcaefbd[_0xb00b('0x9f')]][_0xb00b('0x46')]){logger[_0xb00b('0x41')](_0xb00b('0x138'),_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')],_0xb00b('0x9d'),_0x22f2f6[_0xb00b('0x33')],'pTalking:\x20',_0x22f2f6['pTalking']);this[_0xb00b('0x133')](_0xcaefbd,_0xcaefbd[_0xb00b('0x9f')],_0xcaefbd[_0xb00b('0x132')]);}}};Preview[_0xb00b('0xd')][_0xb00b('0x1a')]=function(_0x1e0206){if(this[_0xb00b('0x13')][_0x1e0206[_0xb00b('0xd7')]]&&_0x1e0206[_0xb00b('0xd7')]!==_0x1e0206['destuniqueid']){this[_0xb00b('0x133')](_0x1e0206,_0x1e0206[_0xb00b('0xd7')],_0x1e0206[_0xb00b('0xcd')]);}};Preview[_0xb00b('0xd')]['syncHangupRequest']=function(_0x45ad1f){if(this[_0xb00b('0x13')][_0x45ad1f[_0xb00b('0x9f')]]&&_0x45ad1f[_0xb00b('0x9f')]!==_0x45ad1f[_0xb00b('0x9c')]&&!this[_0xb00b('0x13')][_0x45ad1f[_0xb00b('0x9f')]][_0xb00b('0x46')]){if(_0x45ad1f[_0xb00b('0x132')]==='1'){this['callProgressDetectingCustomer'](_0x45ad1f,_0x45ad1f['linkedid'],_0x45ad1f[_0xb00b('0x132')]);}}};Preview[_0xb00b('0xd')][_0xb00b('0x139')]=function(_0x121451,_0x2e9604,_0x19fce8){if(this[_0xb00b('0x13')][_0x121451]){if(_['isNil'](this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')])){this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')]={};}this[_0xb00b('0x13')][_0x121451][_0xb00b('0x124')][_0x2e9604]=_0x19fce8;}};Preview['prototype'][_0xb00b('0x13a')]=function(_0x1ec1c7){try{if(!_['isNil'](_0x1ec1c7)){if(ut[_0xb00b('0x13b')](_[_0xb00b('0x13c')](_0x1ec1c7[_0xb00b('0x13d')])[0x0])){this[_0xb00b('0x139')](_0x1ec1c7[_0xb00b('0x9c')],_[_0xb00b('0x13c')](_0x1ec1c7['variable'])[0x0],_0x1ec1c7['value']);}}}catch(_0x465238){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x465238,{'showHidden':![],'depth':null}));}};Preview[_0xb00b('0xd')][_0xb00b('0x1f')]=function(_0x5a400c){if(_0x5a400c){if(this['actions'][_0x5a400c[_0xb00b('0x13e')]]){this[_0xb00b('0x13')][_0x5a400c[_0xb00b('0x13e')]][_0xb00b('0x136')]=!![];}}};Preview[_0xb00b('0xd')][_0xb00b('0x21')]=function(_0x3fd141){if(_0x3fd141){if(this[_0xb00b('0x13')][_0x3fd141[_0xb00b('0x13f')]]){this[_0xb00b('0x13')][_0x3fd141[_0xb00b('0x13f')]]['transfer']=!![];}}};module[_0xb00b('0x140')]=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(_0x409ab9,_0x31a510){var _0x509fd2=function(_0x57384a){while(--_0x57384a){_0x409ab9['push'](_0x409ab9['shift']());}};_0x509fd2(++_0x31a510);}(_0xa41a,0x6b));var _0xaa41=function(_0x405944,_0x2271a7){_0x405944=_0x405944-0x0;var _0x3606b0=_0xa41a[_0x405944];return _0x3606b0;};'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 diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 30de470..7f7d061 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f6b=['calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5f6b,0xde));var _0xb5f6=function(_0x171b89,_0xde7fb6){_0x171b89=_0x171b89-0x0;var _0x284ee1=_0x5f6b[_0x171b89];return _0x284ee1;};'use strict';var util=require(_0xb5f6('0x0'));var BPromise=require(_0xb5f6('0x1'));var logger=require(_0xb5f6('0x2'))(_0xb5f6('0x3'));var cmHopper=require(_0xb5f6('0x4'));var cmHopperHistory=require(_0xb5f6('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xb5f6('0x6'));var voiceQueueReport=require(_0xb5f6('0x7'));function loggerCatch(_0x120db9){return function(_0x3f4df4){logger[_0xb5f6('0x8')](_0x120db9,util[_0xb5f6('0x9')](_0x3f4df4,{'showHidden':![],'depth':null}));};}function create(_0x4ea3d5){return cmHopperHistory[_0xb5f6('0xa')](_0x4ea3d5)[_0xb5f6('0xb')](loggerCatch(_0xb5f6('0xc')));}function createAgent(_0x43cac8){return BPromise[_0xb5f6('0xd')]()[_0xb5f6('0xe')](agentReportPreview['createHistory'](_0x43cac8))['catch'](loggerCatch(_0xb5f6('0xc')));}function moveContact(_0x221b54){return cmHopper[_0xb5f6('0xf')](_0x221b54,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x12645f){return cmHopperBlack[_0xb5f6('0x10')](_0x12645f)[_0xb5f6('0xb')](loggerCatch(_0xb5f6('0x11')));};exports[_0xb5f6('0x12')]=function(_0x17fffe){return BPromise['resolve']()[_0xb5f6('0xe')](cmHopper[_0xb5f6('0x12')](_0x17fffe))[_0xb5f6('0xb')](loggerCatch(_0xb5f6('0x13')));};exports[_0xb5f6('0xa')]=function(_0x3112a7,_0x3c5792){create(_0x3112a7)[_0xb5f6('0xb')](loggerCatch(_0x3c5792));moveContact(_0x3112a7)[_0xb5f6('0xb')](loggerCatch(_0x3c5792));};exports['createAgentHistory']=function(_0x156bf3,_0x1055b6){createAgent(_0x156bf3)[_0xb5f6('0xb')](loggerCatch(_0x1055b6));};exports['createCustomerHistory']=function(_0x2cfd23,_0x2557bd){create(_0x2cfd23)[_0xb5f6('0xb')](loggerCatch(_0x2557bd));};exports[_0xb5f6('0x14')]=function(_0x41a837,_0x5271cd){moveContact(_0x41a837)['catch'](loggerCatch(_0x5271cd));};exports[_0xb5f6('0x15')]=function(_0x4dc280,_0xa26454,_0x60f8c4){if(_0xa26454){_0x4dc280['UserId']=null;}if(_0x60f8c4){_0x4dc280[_0xb5f6('0x16')]=![];}return cmHopper[_0xb5f6('0x15')](_0x4dc280)['catch'](loggerCatch(_0xb5f6('0x17')));};exports[_0xb5f6('0x18')]=function(_0x28531f){return cmHopper[_0xb5f6('0x18')](_0x28531f)[_0xb5f6('0xb')](loggerCatch(_0xb5f6('0x19')));};exports[_0xb5f6('0x1a')]=function(_0x19670f){return cmHopper[_0xb5f6('0x1a')]({'UserId':null},_0x19670f,0x1)[_0xb5f6('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0xb5f6('0x1b')]=function(_0x139712){return cmHopper[_0xb5f6('0x1a')]({'active':![]},_0x139712,0x1)[_0xb5f6('0xb')](loggerCatch(_0xb5f6('0x1c')));};exports[_0xb5f6('0x1d')]=function(_0x4f5edd){var _0x1c4a2c={};_0x1c4a2c[_0xb5f6('0x1e')]=_0x4f5edd[_0xb5f6('0x1e')];_0x1c4a2c[_0xb5f6('0x1f')]=_0x4f5edd[_0xb5f6('0x1f')];_0x1c4a2c['calleridnum']=_0x4f5edd[_0xb5f6('0x20')];_0x1c4a2c[_0xb5f6('0x21')]=_0x4f5edd[_0xb5f6('0x21')];_0x1c4a2c[_0xb5f6('0x22')]=_0x4f5edd[_0xb5f6('0x22')];_0x1c4a2c[_0xb5f6('0x23')]=_0x4f5edd[_0xb5f6('0x24')];_0x1c4a2c['queuecallerleaveAt']=_0x4f5edd[_0xb5f6('0x24')];_0x1c4a2c[_0xb5f6('0x25')]=0x1;_0x1c4a2c[_0xb5f6('0x26')]=_0x4f5edd[_0xb5f6('0x27')];_0x1c4a2c[_0xb5f6('0x28')]=_0x4f5edd[_0xb5f6('0x29')];_0x1c4a2c[_0xb5f6('0x2a')]=_0xb5f6('0x2b');_0x1c4a2c[_0xb5f6('0x2c')]='xcally-motion-preview';_0x1c4a2c[_0xb5f6('0x2d')]=0x0;_0x1c4a2c[_0xb5f6('0x2e')]=0x1;_0x1c4a2c['lastAssignedTo']=_0x4f5edd[_0xb5f6('0x29')];_0x1c4a2c[_0xb5f6('0x2f')]=_0xb5f6('0x30');return BPromise[_0xb5f6('0xd')]()[_0xb5f6('0xe')](voiceQueueReport['create'](_0x1c4a2c))['catch'](loggerCatch(_0xb5f6('0x31')));};exports['getContactRecallMe']=function(_0x9188fd,_0x5329f2){return BPromise[_0xb5f6('0xd')]()['then'](cmHopper['getContactRecallMe'](_0x9188fd,_0x5329f2))[_0xb5f6('0xb')](loggerCatch(_0xb5f6('0x32')));};exports['rescheduleContactInQueue']=function(_0xf2cfa1){return cmHopper['rescheduleContact'](_0xf2cfa1,!![],!![])[_0xb5f6('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xbc5a=['inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','holdtime','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error'];(function(_0x18d42c,_0x3121cb){var _0x37fc88=function(_0x5c75d0){while(--_0x5c75d0){_0x18d42c['push'](_0x18d42c['shift']());}};_0x37fc88(++_0x3121cb);}(_0xbc5a,0xf3));var _0xabc5=function(_0x299a98,_0x578011){_0x299a98=_0x299a98-0x0;var _0x6fd85a=_0xbc5a[_0x299a98];return _0x6fd85a;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xabc5('0x0'))(_0xabc5('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xabc5('0x2'));var cmHopperBlack=require(_0xabc5('0x3'));var agentReportPreview=require(_0xabc5('0x4'));var voiceQueueReport=require(_0xabc5('0x5'));function loggerCatch(_0x363e64){return function(_0x18b31b){logger[_0xabc5('0x6')](_0x363e64,util[_0xabc5('0x7')](_0x18b31b,{'showHidden':![],'depth':null}));};}function create(_0x4b715d){return cmHopperHistory[_0xabc5('0x8')](_0x4b715d)[_0xabc5('0x9')](loggerCatch(_0xabc5('0xa')));}function createAgent(_0x2239ae){return BPromise[_0xabc5('0xb')]()[_0xabc5('0xc')](agentReportPreview['createHistory'](_0x2239ae))[_0xabc5('0x9')](loggerCatch(_0xabc5('0xa')));}function moveContact(_0xddb240){return cmHopper[_0xabc5('0xd')](_0xddb240,!![])[_0xabc5('0x9')](loggerCatch(_0xabc5('0xe')));}exports['checkIsBlackList']=function(_0xe18b4b){return cmHopperBlack[_0xabc5('0xf')](_0xe18b4b)['catch'](loggerCatch(_0xabc5('0x10')));};exports['getContactPreview']=function(_0x4b0fe7){return BPromise[_0xabc5('0xb')]()[_0xabc5('0xc')](cmHopper[_0xabc5('0x11')](_0x4b0fe7))[_0xabc5('0x9')](loggerCatch(_0xabc5('0x12')));};exports[_0xabc5('0x8')]=function(_0x4b7321,_0x42f74b){create(_0x4b7321)[_0xabc5('0x9')](loggerCatch(_0x42f74b));moveContact(_0x4b7321)[_0xabc5('0x9')](loggerCatch(_0x42f74b));};exports[_0xabc5('0x13')]=function(_0x4b56f6,_0x23f623){createAgent(_0x4b56f6)['catch'](loggerCatch(_0x23f623));};exports[_0xabc5('0x14')]=function(_0x3a97df,_0x2130ac){create(_0x3a97df)[_0xabc5('0x9')](loggerCatch(_0x2130ac));};exports['createCustomerFinal']=function(_0x17a63f,_0x4987fd){moveContact(_0x17a63f)[_0xabc5('0x9')](loggerCatch(_0x4987fd));};exports['rescheduleContact']=function(_0x59d30a,_0x2b07a9,_0xbc814e){if(_0x2b07a9){_0x59d30a['UserId']=null;}if(_0xbc814e){_0x59d30a[_0xabc5('0x15')]=![];}return cmHopper[_0xabc5('0x16')](_0x59d30a)[_0xabc5('0x9')](loggerCatch(_0xabc5('0x17')));};exports[_0xabc5('0x18')]=function(_0x34f7cb){return cmHopper[_0xabc5('0x18')](_0x34f7cb)[_0xabc5('0x9')](loggerCatch(_0xabc5('0x19')));};exports[_0xabc5('0x1a')]=function(_0x320ad){return cmHopper['unlockContact']({'UserId':null},_0x320ad,0x1)[_0xabc5('0x9')](loggerCatch('[unlockContact]\x20'));};exports[_0xabc5('0x1b')]=function(_0x1a05fb){return cmHopper[_0xabc5('0x1a')]({'active':![]},_0x1a05fb,0x1)['catch'](loggerCatch(_0xabc5('0x1c')));};exports[_0xabc5('0x1d')]=function(_0x333d24){var _0x74a7ff={};_0x74a7ff[_0xabc5('0x1e')]=_0x333d24[_0xabc5('0x1e')];_0x74a7ff[_0xabc5('0x1f')]=_0x333d24['uniqueid'];_0x74a7ff['calleridnum']=_0x333d24[_0xabc5('0x20')];_0x74a7ff[_0xabc5('0x21')]=_0x333d24[_0xabc5('0x21')];_0x74a7ff['queue']=_0x333d24[_0xabc5('0x22')];_0x74a7ff[_0xabc5('0x23')]=_0x333d24['answertime'];_0x74a7ff['queuecallerleaveAt']=_0x333d24['answertime'];_0x74a7ff[_0xabc5('0x24')]=0x1;_0x74a7ff[_0xabc5('0x25')]=_0x333d24[_0xabc5('0x26')];_0x74a7ff[_0xabc5('0x27')]=_0x333d24[_0xabc5('0x28')];_0x74a7ff[_0xabc5('0x29')]=_0xabc5('0x2a');_0x74a7ff['exten']='xcally-motion-preview';_0x74a7ff[_0xabc5('0x2b')]=0x0;_0x74a7ff['assigned']=0x1;_0x74a7ff['lastAssignedTo']=_0x333d24[_0xabc5('0x28')];_0x74a7ff[_0xabc5('0x2c')]=_0xabc5('0x2d');return BPromise['resolve']()['then'](voiceQueueReport[_0xabc5('0x2e')](_0x74a7ff))[_0xabc5('0x9')](loggerCatch(_0xabc5('0x2f')));};exports['getContactRecallMe']=function(_0x232ce7,_0x405967){return BPromise[_0xabc5('0xb')]()[_0xabc5('0xc')](cmHopper[_0xabc5('0x30')](_0x232ce7,_0x405967))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xabc5('0x31')]=function(_0x3d96da){return cmHopper['rescheduleContact'](_0x3d96da,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index e9f4e2e..4c42e2c 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bad=['extractCalleridName','match','variables','keys','forEach','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countagentrejectretry','Global','scheduledAt','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','not_inuse','reachable','push','getDiff','milliseconds','CampaignId','filterKey','idContact','type','dialAnswer','countglobal','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace'];(function(_0x4e4cb2,_0x5f30a1){var _0x6e493f=function(_0x330ad0){while(--_0x330ad0){_0x4e4cb2['push'](_0x4e4cb2['shift']());}};_0x6e493f(++_0x5f30a1);}(_0x1bad,0x96));var _0xd1ba=function(_0x5a314b,_0x1c8988){_0x5a314b=_0x5a314b-0x0;var _0x4e2307=_0x1bad[_0x5a314b];return _0x4e2307;};'use strict';var util=require(_0xd1ba('0x0'));var _=require('lodash');var moment=require(_0xd1ba('0x1'));var logger=require(_0xd1ba('0x2'))(_0xd1ba('0x3'));var ipAgi=process[_0xd1ba('0x4')][_0xd1ba('0x5')]||_0xd1ba('0x6');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x14a871){return function(_0xbabf79){logger[_0xd1ba('0x7')](_0x14a871,util[_0xd1ba('0x8')](_0xbabf79,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x54ef23,_0xccec91){logger[_0xd1ba('0x9')](_0x54ef23,util['inspect'](_0xccec91,{'showHidden':![],'depth':null}));};exports[_0xd1ba('0xa')]=function(_0x14fdc5,_0x3f24dc){logger[_0xd1ba('0x7')](_0x14fdc5,util[_0xd1ba('0x8')](_0x3f24dc,{'showHidden':![],'depth':null}));};exports[_0xd1ba('0xb')]=function(_0x3ceba5){return function(_0x15c973){logger[_0xd1ba('0x9')](_0x3ceba5,util[_0xd1ba('0x8')](_0x15c973,{'showHidden':![],'depth':null}));};};exports[_0xd1ba('0xc')]=function(_0x440684,_0x582d74,_0x1f2ab9){return{'message':_0x440684,'unlock':_0x582d74,'active':_0x1f2ab9};};exports[_0xd1ba('0xd')]=function(_0x18999c,_0x254246,_0x1edcb5){if(!_[_0xd1ba('0xe')](_0x1edcb5)&&_0xd1ba('0xf')===typeof _0x1edcb5&&!_[_0xd1ba('0x10')](_0x1edcb5)){if(!_[_0xd1ba('0xe')](_0x254246)&&'string'===typeof _0x254246&&!_[_0xd1ba('0x10')](_0x254246)){return util[_0xd1ba('0x11')](_0xd1ba('0x12'),_0x254246,_0x1edcb5);}return util[_0xd1ba('0x11')](_0xd1ba('0x12'),_0x1edcb5,_0x1edcb5);}if(!_[_0xd1ba('0xe')](_0x18999c)&&_0xd1ba('0xf')===typeof _0x18999c&&!_[_0xd1ba('0x10')](_0x18999c)){return _0x18999c;}return'\x22\x22\x20<>';};exports[_0xd1ba('0x13')]=function(_0x290c0d){if(_[_0xd1ba('0x14')](_0x290c0d)){return![];}return _0x290c0d;};exports[_0xd1ba('0x15')]=function(_0x4d6ee5,_0x5cc8bc,_0x3be06c,_0x2f1aec,_0xdfcecf,_0xab34b4){var _0xd2b10f={'XMD-QUEUE':_0x5cc8bc[_0xd1ba('0x16')]?_0x5cc8bc[_0xd1ba('0x16')][_0xd1ba('0x17')]:'','XMD-CALLERID':_0x2f1aec,'XMD-CALLERID-PREVIEW':_0xab34b4?util[_0xd1ba('0x11')]('\x22%s\x22\x20<%s>',_0xab34b4[_0xd1ba('0x18')],_0xab34b4[_0xd1ba('0x19')]):_0x2f1aec,'XMD-DIALID':_0xdfcecf,'XMD-CONTACTID':_0x5cc8bc[_0xd1ba('0x1a')],'XMD-CDRTYPE':_0xd1ba('0x1b'),'CALLERID(all)':_0x2f1aec,'XMD-VOICEQUEUEID':_0x5cc8bc[_0xd1ba('0x1c')],'XMD-DIALCHANNEL':_0x3be06c,'XMD-DIALTIMEOUT':_0x4d6ee5[_0xd1ba('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xd1ba('0x11')](_0xd1ba('0x1e'),_0x4d6ee5[_0xd1ba('0x1f')]?'g':'',_[_0xd1ba('0x10')](_0x4d6ee5[_0xd1ba('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x4d6ee5['dialPreviewUrl']||'','XMD-AGI':_0x4d6ee5[_0xd1ba('0x21')]?util[_0xd1ba('0x11')](_0xd1ba('0x22'),ipAgi,_0x4d6ee5[_0xd1ba('0x21')]):_0xd1ba('0x23'),'XMD-AGIAFTER':_0x4d6ee5[_0xd1ba('0x1f')]?util['format'](_0xd1ba('0x22'),ipAgi,_0x4d6ee5[_0xd1ba('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xab34b4?_0xab34b4['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0xab34b4?_0xab34b4[_0xd1ba('0x24')]:'','XMD-DESTINATION':_0xd1ba('0x25'),'SIPADDHEADER':_0xd1ba('0x26')};if(!_[_0xd1ba('0x10')](_0x4d6ee5[_0xd1ba('0x20')])){_0xd2b10f[util['format']('%s',_0xd1ba('0x27'))]=_0x4d6ee5[_0xd1ba('0x20')];_0xd2b10f[util[_0xd1ba('0x11')]('%s',_0xd1ba('0x28'))]=_0xdfcecf;}if(_0x5cc8bc&&_0x5cc8bc['Contact']){for(var _0x25fb1a in _0x5cc8bc[_0xd1ba('0x29')]){if(_0x5cc8bc[_0xd1ba('0x29')][_0xd1ba('0x2a')](_0x25fb1a)){if(!_['isNil'](_0x5cc8bc[_0xd1ba('0x29')][_0x25fb1a])&&_0x25fb1a!=='id'&&_0x25fb1a!==_0xd1ba('0x2b')&&_0x25fb1a!==_0xd1ba('0x2c')&&_0x25fb1a!==_0xd1ba('0x2d')){_0xd2b10f[util[_0xd1ba('0x11')](_0xd1ba('0x2e'),'XMD-',_[_0xd1ba('0x2f')](_0x25fb1a))]=_0x5cc8bc[_0xd1ba('0x29')][_0x25fb1a];}}}}return _0xd2b10f;};exports[_0xd1ba('0x30')]=function(_0x127404){var _0x22c25f={};for(var _0x4ba320 in _0x127404){if(_0x127404[_0xd1ba('0x2a')](_0x4ba320)){_0x22c25f[util[_0xd1ba('0x11')]('%s',_[_0xd1ba('0x31')](_0x4ba320))]=_0x127404[_0x4ba320];}}return{'variables':_0x22c25f};};exports[_0xd1ba('0x32')]=function(_0x4924b5,_0x29c5de){if(!_[_0xd1ba('0x14')](_0x4924b5)){if(_0x4924b5['hasOwnProperty'](_0xd1ba('0x33'))){if(_0x4924b5['originated']>0x0){_0x4924b5[_0xd1ba('0x33')]-=0x1;}else{logger[_0xd1ba('0x7')](_0xd1ba('0x34'),_0x29c5de);}}}else{logger[_0xd1ba('0x7')](_0xd1ba('0x35'),_0x29c5de);}};exports[_0xd1ba('0x36')]=function(_0x200c62){var _0x4348f5=moment()[_0xd1ba('0x11')](_0xd1ba('0x37'));_0x200c62[_0xd1ba('0x38')]=0xd;_0x200c62[_0xd1ba('0x39')]=_0xd1ba('0x3a');_0x200c62[_0xd1ba('0x3b')]=_0x4348f5;_0x200c62[_0xd1ba('0x3c')]=_0x4348f5;_0x200c62[_0xd1ba('0x3d')]=_0x4348f5;};exports['logAgent']=function(_0x1cc97d,_0x41d29d,_0x3a9c1c){var _0x18a49f=moment()['format'](_0xd1ba('0x37'));_0x1cc97d[_0xd1ba('0x38')]=_0x41d29d;_0x1cc97d[_0xd1ba('0x39')]=_0x3a9c1c;_0x1cc97d[_0xd1ba('0x3c')]=_0x18a49f;_0x1cc97d[_0xd1ba('0x3e')]=utils[_0xd1ba('0x3f')](_0x1cc97d[_0xd1ba('0x3c')],_0x1cc97d[_0xd1ba('0x3b')]);};exports[_0xd1ba('0x40')]=function(_0x370bc1,_0x4fbeb1,_0xcc7340){_0x370bc1[_0xd1ba('0x41')]=_0x4fbeb1;_0x370bc1[_0xd1ba('0x42')]=_0xcc7340;};exports[_0xd1ba('0x43')]=function(_0x229d9c,_0x37a946,_0x1c946d){var _0x1e993d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x229d9c[_0xd1ba('0x38')]=_0x37a946;_0x229d9c[_0xd1ba('0x39')]=_0x1c946d;_0x229d9c[_0xd1ba('0x3c')]=_0x229d9c[_0xd1ba('0x3c')]?_0x229d9c['responsetime']:_0x1e993d;_0x229d9c[_0xd1ba('0x3d')]=_0x229d9c[_0xd1ba('0x3d')]?_0x229d9c[_0xd1ba('0x3d')]:_0x1e993d;_0x229d9c[_0xd1ba('0x3e')]=utils[_0xd1ba('0x3f')](_0x229d9c[_0xd1ba('0x3c')]||0x0,_0x229d9c[_0xd1ba('0x3b')]||0x0);_0x229d9c[_0xd1ba('0x44')]=_0x229d9c[_0xd1ba('0x45')]?utils[_0xd1ba('0x3f')](_0x229d9c['endtime'],_0x229d9c['answertime']):0x0;};exports['isFailure']=function(_0x19920f){return _0x19920f===_0xd1ba('0x46');};exports[_0xd1ba('0x47')]=function(_0x14cb68,_0x38633b,_0x1b9730,_0x4d15e1,_0x1278c9){var _0x4dfc0d=_0x4d15e1?_0xd1ba('0x48'):_0x14cb68[_0xd1ba('0x18')];_0x4dfc0d=_0x1278c9?_0xd1ba('0x49'):_0x4dfc0d;return{'actionid':_0x14cb68[_0xd1ba('0x4a')],'action':_0xd1ba('0x4b'),'channel':_0x14cb68[_0xd1ba('0x4c')],'callerid':util[_0xd1ba('0x11')](_0xd1ba('0x12'),_0x4dfc0d,_0x14cb68[_0xd1ba('0x19')]),'Exten':_0xd1ba('0x25'),'Context':_0xd1ba('0x4d'),'Priority':'1','variable':_0x1b9730,'timeout':(_0x38633b[_0xd1ba('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14cb68[_0xd1ba('0x4a')]};};exports['totalGlobal']=function(_0x32964f){return _0x32964f[_0xd1ba('0x4f')]+_0x32964f[_0xd1ba('0x50')]+_0x32964f['countnoanswerretry']+_0x32964f[_0xd1ba('0x51')]+_0x32964f['countnosuchnumberretry'];};exports['cloneAction']=function(_0x376fad){var _0x26137c=_['clone'](_0x376fad);_0x26137c[_0xd1ba('0x38')]=0xf;_0x26137c[_0xd1ba('0x39')]=_0xd1ba('0x52');return _0x26137c;};exports[_0xd1ba('0x53')]=function(_0x259bc9,_0x3f5857,_0x523711){var _0x3fdd1b={};_0x3fdd1b[_0x3f5857]=_0x259bc9[_0x3f5857];_0x3fdd1b['active']=![];_0x3fdd1b[_0xd1ba('0x54')]=moment()[_0xd1ba('0x55')](_0x523711,_0xd1ba('0x56'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3fdd1b[_0xd1ba('0x1a')]=_0x259bc9[_0xd1ba('0x1a')];_0x3fdd1b[_0xd1ba('0x57')]=_0x259bc9[_0xd1ba('0x57')];_0x3fdd1b[_0xd1ba('0x1c')]=_0x259bc9['VoiceQueueId']||undefined;return _0x3fdd1b;};exports['decrementTalkink']=function(_0x52a422,_0x333525){if(!_[_0xd1ba('0x14')](_0x52a422)){if(_0x52a422['pTalking']>0x0){_0x52a422[_0xd1ba('0x58')]-=0x1;}else{logger[_0xd1ba('0x7')](_0x333525,_0xd1ba('0x59'));}}else{logger[_0xd1ba('0x7')](_0x333525,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xd1ba('0x5a')]=function(_0xa92e78){if(_0xa92e78<=0x0){return!![];}return![];};function buildObj(_0x5df68f,_0x292aa0,_0x116d8a){_0x5df68f[_0xd1ba('0x5b')]=_0x292aa0;_0x5df68f[_0xd1ba('0x17')]=_0x5df68f[_0xd1ba('0x5c')];_0x5df68f[_0xd1ba('0x5d')]=_0x5df68f[_0xd1ba('0x4c')];_0x5df68f[_0xd1ba('0x5e')]='voice';if(_0x116d8a){_0x5df68f[_0xd1ba('0x5f')]=_0x116d8a['mandatoryDisposition'];}return _0x5df68f;}exports[_0xd1ba('0x60')]=buildObj;exports[_0xd1ba('0x61')]=function(_0x3ad97d){var _0x30f717={};_0x30f717['queue']=_0x3ad97d[_0xd1ba('0x5c')];_0x30f717['interface']=_0x3ad97d[_0xd1ba('0x4c')];_0x30f717[_0xd1ba('0x4a')]=_0x3ad97d[_0xd1ba('0x4a')];return _0x30f717;};exports['agentReadyId']=function(_0x8074fd){var _0x5675ac=[];for(var _0x4da517 in _0x8074fd){if(_0x8074fd[_0xd1ba('0x2a')](_0x4da517)){if(!_[_0xd1ba('0x14')](_0x8074fd[_0x4da517])&&_0x8074fd[_0x4da517]['state']===_0xd1ba('0x62')&&_0x8074fd[_0x4da517]['status']===_0xd1ba('0x63')){_0x5675ac[_0xd1ba('0x64')](_0x8074fd[_0x4da517]['id']);}}}return _0x5675ac;};exports[_0xd1ba('0x65')]=function(_0x539045){var _0x22ad0d=moment()[_0xd1ba('0x66')](0x0);var _0x3ba15f=moment(_0x539045)[_0xd1ba('0x66')](0x0);return _0x22ad0d['diff'](_0x3ba15f,'seconds');};exports['createBody']=function(_0x2b78b6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b78b6[_0xd1ba('0x1a')],'ListId':_0x2b78b6[_0xd1ba('0x57')],'VoiceQueueId':_0x2b78b6[_0xd1ba('0x1c')]||undefined,'CampaignId':_0x2b78b6[_0xd1ba('0x67')]||undefined};};exports[_0xd1ba('0x68')]=function(_0x553c8e){if(_0x553c8e===_0xd1ba('0x4a')||_0x553c8e===_0xd1ba('0x69')||_0x553c8e==='queue'||_0x553c8e===_0xd1ba('0x6a')||_0x553c8e==='campaigntype'||_0x553c8e===_0xd1ba('0x6b')||_0x553c8e==='membername'||_0x553c8e===_0xd1ba('0x4c')||_0x553c8e==='calleridname'||_0x553c8e==='active'||_0x553c8e===_0xd1ba('0x19')||_0x553c8e===_0xd1ba('0x54')||_0x553c8e===_0xd1ba('0x4f')||_0x553c8e===_0xd1ba('0x50')||_0x553c8e==='countnoanswerretry'||_0x553c8e===_0xd1ba('0x6c')||_0x553c8e==='callback'||_0x553c8e==='callbackuniqueid'||_0x553c8e===_0xd1ba('0x6d')||_0x553c8e===_0xd1ba('0x6e')||_0x553c8e===_0xd1ba('0x1a')||_0x553c8e===_0xd1ba('0x57')||_0x553c8e==='UserId'||_0x553c8e===_0xd1ba('0x1c')||_0x553c8e===_0xd1ba('0x6f')||_0x553c8e===_0xd1ba('0x70')||_0x553c8e===_0xd1ba('0x71')||_0x553c8e==='xmd-phone'||_0x553c8e===_0xd1ba('0x72')||_0x553c8e===_0xd1ba('0x73')||_0x553c8e===_0xd1ba('0x74')||_0x553c8e===_0xd1ba('0x75')||_0x553c8e===_0xd1ba('0x76')||_0x553c8e==='xmd-dialchannel'||_0x553c8e===_0xd1ba('0x77')||_0x553c8e===_0xd1ba('0x78')||_0x553c8e===_0xd1ba('0x79')||_0x553c8e===_0xd1ba('0x7a')||_0x553c8e===_0xd1ba('0x7b')||_0x553c8e===_0xd1ba('0x7c')||_0x553c8e===_0xd1ba('0x7d')||_0x553c8e===_0xd1ba('0x7e')||_0x553c8e===_0xd1ba('0x7f')||_0x553c8e===_0xd1ba('0x80')||_0x553c8e==='rtpaudioqoslossbridged'||_0x553c8e===_0xd1ba('0x81')||_0x553c8e===_0xd1ba('0x82')||_0x553c8e==='rtpaudioqos'||_0x553c8e==='rtpaudioqosbridged'||_0x553c8e===_0xd1ba('0x7e')||_0x553c8e===_0xd1ba('0x7f')||_0x553c8e===_0xd1ba('0x80')||_0x553c8e===_0xd1ba('0x83')||_0x553c8e===_0xd1ba('0x81')||_0x553c8e===_0xd1ba('0x82')||_0x553c8e===_0xd1ba('0x84')||_0x553c8e===_0xd1ba('0x85')||_0x553c8e===_0xd1ba('0x38')||_0x553c8e==='statedesc'){return![];}return!![];};exports[_0xd1ba('0x86')]=function(_0x181f55,_0x5ce784){var _0x248a0e,_0x3fe779,_0x158ff7;if(_0x5ce784<=0x0){_0x5ce784=0x1;}_0x248a0e=new RegExp(_0xd1ba('0x87')+_0x5ce784+'}$');_0x3fe779=Math[_0xd1ba('0x88')](0xa,_0x5ce784-0x1);_0x158ff7=Math[_0xd1ba('0x88')](0xa,_0x5ce784)-0x1;return util[_0xd1ba('0x11')]('%s',_[_0xd1ba('0x89')](_0x181f55,_0x248a0e,_['random'](_0x3fe779,_0x158ff7)));};exports[_0xd1ba('0x8a')]=function(_0x430498){var _0x1b8ab1=_0x430498[_0xd1ba('0x8b')](/"(.*?)"/);return _0x1b8ab1?_0x1b8ab1[0x1]:_0x430498;};exports['extractCalleridNumber']=function(_0x5da98d){var _0x346d0e=_0x5da98d['match'](/<(.*?)>/);return _0x346d0e?_0x346d0e[0x1]:_0x5da98d;};function buildNoAnswerEventPayload(_0x1948ac,_0x458ae4){var _0xa4af78=buildObj(_0x1948ac,'noanswer');if(!_[_0xd1ba('0x10')](_0x458ae4[_0xd1ba('0x8c')])){Object[_0xd1ba('0x8d')](_0x458ae4[_0xd1ba('0x8c')])[_0xd1ba('0x8e')](function(_0x5bdb55){_0xa4af78[_0x5bdb55['toLowerCase']()]=_0x458ae4['variables'][_0x5bdb55];});}return _0xa4af78;}exports[_0xd1ba('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x590f=['rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','add','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','filterKey','idContact','campaigntype','active','scheduledat','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged'];(function(_0x139580,_0x330ed4){var _0x2c5820=function(_0x50eb44){while(--_0x50eb44){_0x139580['push'](_0x139580['shift']());}};_0x2c5820(++_0x330ed4);}(_0x590f,0x145));var _0xf590=function(_0x592b62,_0x5111cb){_0x592b62=_0x592b62-0x0;var _0x1912aa=_0x590f[_0x592b62];return _0x1912aa;};'use strict';var util=require(_0xf590('0x0'));var _=require(_0xf590('0x1'));var moment=require(_0xf590('0x2'));var logger=require(_0xf590('0x3'))('preview');var ipAgi=process[_0xf590('0x4')][_0xf590('0x5')]||_0xf590('0x6');var utils=require(_0xf590('0x7'));exports[_0xf590('0x8')]=function(_0x1d25a4){return function(_0x3d9b3b){logger[_0xf590('0x9')](_0x1d25a4,util[_0xf590('0xa')](_0x3d9b3b,{'showHidden':![],'depth':null}));};};exports[_0xf590('0xb')]=function(_0x14edd2,_0x528aea){logger[_0xf590('0xc')](_0x14edd2,util['inspect'](_0x528aea,{'showHidden':![],'depth':null}));};exports[_0xf590('0xd')]=function(_0x29dba0,_0x488af9){logger[_0xf590('0x9')](_0x29dba0,util[_0xf590('0xa')](_0x488af9,{'showHidden':![],'depth':null}));};exports[_0xf590('0xe')]=function(_0x55244c){return function(_0x1fc1e4){logger[_0xf590('0xc')](_0x55244c,util[_0xf590('0xa')](_0x1fc1e4,{'showHidden':![],'depth':null}));};};exports[_0xf590('0xf')]=function(_0x11508c,_0x1f2b44,_0x349cae){return{'message':_0x11508c,'unlock':_0x1f2b44,'active':_0x349cae};};exports[_0xf590('0x10')]=function(_0x478138,_0x23a2c5,_0x141164){if(!_[_0xf590('0x11')](_0x141164)&&'string'===typeof _0x141164&&!_[_0xf590('0x12')](_0x141164)){if(!_['isUndefined'](_0x23a2c5)&&_0xf590('0x13')===typeof _0x23a2c5&&!_[_0xf590('0x12')](_0x23a2c5)){return util[_0xf590('0x14')](_0xf590('0x15'),_0x23a2c5,_0x141164);}return util[_0xf590('0x14')]('\x22%s\x22\x20<%s>',_0x141164,_0x141164);}if(!_['isUndefined'](_0x478138)&&'string'===typeof _0x478138&&!_[_0xf590('0x12')](_0x478138)){return _0x478138;}return _0xf590('0x16');};exports[_0xf590('0x17')]=function(_0x25bd20){if(_[_0xf590('0x18')](_0x25bd20)){return![];}return _0x25bd20;};exports[_0xf590('0x19')]=function(_0x29793f,_0x425976,_0x3a435e,_0x4a3b0e,_0x533251,_0x58f9e1){var _0x35c82e={'XMD-QUEUE':_0x425976['Queue']?_0x425976[_0xf590('0x1a')]['name']:'','XMD-CALLERID':_0x4a3b0e,'XMD-CALLERID-PREVIEW':_0x58f9e1?util[_0xf590('0x14')]('\x22%s\x22\x20<%s>',_0x58f9e1[_0xf590('0x1b')],_0x58f9e1[_0xf590('0x1c')]):_0x4a3b0e,'XMD-DIALID':_0x533251,'XMD-CONTACTID':_0x425976['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4a3b0e,'XMD-VOICEQUEUEID':_0x425976[_0xf590('0x1d')],'XMD-DIALCHANNEL':_0x3a435e,'XMD-DIALTIMEOUT':_0x29793f[_0xf590('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x29793f[_0xf590('0x1f')]?'g':'',_[_0xf590('0x12')](_0x29793f['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x29793f[_0xf590('0x20')]||'','XMD-AGI':_0x29793f['dialQueueProject']?util['format'](_0xf590('0x21'),ipAgi,_0x29793f[_0xf590('0x22')]):'NONE','XMD-AGIAFTER':_0x29793f['dialQueueProject2']?util[_0xf590('0x14')](_0xf590('0x21'),ipAgi,_0x29793f[_0xf590('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x58f9e1?_0x58f9e1[_0xf590('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x58f9e1?_0x58f9e1[_0xf590('0x24')]:'','XMD-DESTINATION':_0xf590('0x25'),'SIPADDHEADER':_0xf590('0x26')};if(!_[_0xf590('0x12')](_0x29793f[_0xf590('0x27')])){_0x35c82e[util['format']('%s',_0xf590('0x28'))]=_0x29793f[_0xf590('0x27')];_0x35c82e[util[_0xf590('0x14')]('%s',_0xf590('0x29'))]=_0x533251;}if(_0x425976&&_0x425976[_0xf590('0x2a')]){for(var _0x200f08 in _0x425976[_0xf590('0x2a')]){if(_0x425976[_0xf590('0x2a')][_0xf590('0x2b')](_0x200f08)){if(!_[_0xf590('0x18')](_0x425976[_0xf590('0x2a')][_0x200f08])&&_0x200f08!=='id'&&_0x200f08!==_0xf590('0x2c')&&_0x200f08!=='createdAt'&&_0x200f08!==_0xf590('0x2d')){_0x35c82e[util[_0xf590('0x14')](_0xf590('0x2e'),_0xf590('0x2f'),_[_0xf590('0x30')](_0x200f08))]=_0x425976[_0xf590('0x2a')][_0x200f08];}}}}return _0x35c82e;};exports[_0xf590('0x31')]=function(_0x14b20a){var _0x5b4698={};for(var _0x1ce51f in _0x14b20a){if(_0x14b20a['hasOwnProperty'](_0x1ce51f)){_0x5b4698[util['format']('%s',_[_0xf590('0x32')](_0x1ce51f))]=_0x14b20a[_0x1ce51f];}}return{'variables':_0x5b4698};};exports[_0xf590('0x33')]=function(_0x355107,_0xfa4c6d){if(!_[_0xf590('0x18')](_0x355107)){if(_0x355107['hasOwnProperty'](_0xf590('0x34'))){if(_0x355107[_0xf590('0x34')]>0x0){_0x355107['originated']-=0x1;}else{logger[_0xf590('0x9')](_0xf590('0x35'),_0xfa4c6d);}}}else{logger[_0xf590('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0xfa4c6d);}};exports[_0xf590('0x36')]=function(_0x2bac07){var _0x4a5a41=moment()[_0xf590('0x14')](_0xf590('0x37'));_0x2bac07[_0xf590('0x38')]=0xd;_0x2bac07[_0xf590('0x39')]=_0xf590('0x3a');_0x2bac07[_0xf590('0x3b')]=_0x4a5a41;_0x2bac07[_0xf590('0x3c')]=_0x4a5a41;_0x2bac07[_0xf590('0x3d')]=_0x4a5a41;};exports[_0xf590('0x3e')]=function(_0xe7ad21,_0x2363fe,_0x544b80){var _0x2f3dff=moment()[_0xf590('0x14')](_0xf590('0x37'));_0xe7ad21[_0xf590('0x38')]=_0x2363fe;_0xe7ad21[_0xf590('0x39')]=_0x544b80;_0xe7ad21[_0xf590('0x3c')]=_0x2f3dff;_0xe7ad21[_0xf590('0x3f')]=utils[_0xf590('0x40')](_0xe7ad21[_0xf590('0x3c')],_0xe7ad21[_0xf590('0x3b')]);};exports[_0xf590('0x41')]=function(_0x3edc77,_0x4218a5,_0x21cf1c){_0x3edc77[_0xf590('0x42')]=_0x4218a5;_0x3edc77[_0xf590('0x43')]=_0x21cf1c;};exports['logCustomer']=function(_0x10a231,_0x969f7b,_0x78067d){var _0x50db5b=moment()[_0xf590('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x10a231[_0xf590('0x38')]=_0x969f7b;_0x10a231['statedesc']=_0x78067d;_0x10a231[_0xf590('0x3c')]=_0x10a231['responsetime']?_0x10a231[_0xf590('0x3c')]:_0x50db5b;_0x10a231['endtime']=_0x10a231[_0xf590('0x3d')]?_0x10a231[_0xf590('0x3d')]:_0x50db5b;_0x10a231['ringtime']=utils['getSeconds'](_0x10a231['responsetime']||0x0,_0x10a231['starttime']||0x0);_0x10a231[_0xf590('0x44')]=_0x10a231[_0xf590('0x45')]?utils[_0xf590('0x40')](_0x10a231[_0xf590('0x3d')],_0x10a231['answertime']):0x0;};exports[_0xf590('0x46')]=function(_0x254f27){return _0x254f27===_0xf590('0x47');};exports[_0xf590('0x48')]=function(_0x197c29,_0x243ef0,_0x3bd2eb,_0x3786a4,_0x323d41){var _0x8bc3ac=_0x3786a4?'RECALL':_0x197c29[_0xf590('0x1b')];_0x8bc3ac=_0x323d41?_0xf590('0x49'):_0x8bc3ac;return{'actionid':_0x197c29[_0xf590('0x4a')],'action':_0xf590('0x4b'),'channel':_0x197c29[_0xf590('0x4c')],'callerid':util[_0xf590('0x14')](_0xf590('0x15'),_0x8bc3ac,_0x197c29[_0xf590('0x1c')]),'Exten':_0xf590('0x25'),'Context':'from-sip','Priority':'1','variable':_0x3bd2eb,'timeout':(_0x243ef0[_0xf590('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x197c29[_0xf590('0x4a')]};};exports[_0xf590('0x4e')]=function(_0x2aac7e){return _0x2aac7e[_0xf590('0x4f')]+_0x2aac7e['countcongestionretry']+_0x2aac7e[_0xf590('0x50')]+_0x2aac7e[_0xf590('0x51')]+_0x2aac7e['countnosuchnumberretry'];};exports[_0xf590('0x52')]=function(_0x3e3e41){var _0x2713d1=_[_0xf590('0x53')](_0x3e3e41);_0x2713d1['state']=0xf;_0x2713d1[_0xf590('0x39')]=_0xf590('0x54');return _0x2713d1;};exports[_0xf590('0x55')]=function(_0x4363e2,_0x30de97,_0x44417a){var _0xba837e={};_0xba837e[_0x30de97]=_0x4363e2[_0x30de97];_0xba837e['active']=![];_0xba837e['scheduledat']=moment()[_0xf590('0x56')](_0x44417a,'minutes')[_0xf590('0x14')](_0xf590('0x37'));_0xba837e[_0xf590('0x57')]=_0x4363e2[_0xf590('0x57')];_0xba837e[_0xf590('0x58')]=_0x4363e2[_0xf590('0x58')];_0xba837e[_0xf590('0x1d')]=_0x4363e2[_0xf590('0x1d')]||undefined;return _0xba837e;};exports['decrementTalkink']=function(_0x467e76,_0x5e5bd7){if(!_['isNil'](_0x467e76)){if(_0x467e76['pTalking']>0x0){_0x467e76[_0xf590('0x59')]-=0x1;}else{logger['error'](_0x5e5bd7,_0xf590('0x5a'));}}else{logger[_0xf590('0x9')](_0x5e5bd7,_0xf590('0x5b'));}};exports[_0xf590('0x5c')]=function(_0x478d95){if(_0x478d95<=0x0){return!![];}return![];};function buildObj(_0x53b45c,_0x37fda8,_0x1b1294){_0x53b45c['lastevent']=_0x37fda8;_0x53b45c[_0xf590('0x5d')]=_0x53b45c[_0xf590('0x5e')];_0x53b45c[_0xf590('0x5f')]=_0x53b45c[_0xf590('0x4c')];_0x53b45c[_0xf590('0x60')]=_0xf590('0x61');if(_0x1b1294){_0x53b45c[_0xf590('0x62')]=_0x1b1294[_0xf590('0x62')];}return _0x53b45c;}exports[_0xf590('0x63')]=buildObj;exports[_0xf590('0x64')]=function(_0x462b55){var _0x5ca985={};_0x5ca985[_0xf590('0x5e')]=_0x462b55[_0xf590('0x5e')];_0x5ca985['interface']=_0x462b55['channelAgent'];_0x5ca985[_0xf590('0x4a')]=_0x462b55['uniqueid'];return _0x5ca985;};exports[_0xf590('0x65')]=function(_0x22a02d){var _0x4846a5=[];for(var _0xa35f37 in _0x22a02d){if(_0x22a02d['hasOwnProperty'](_0xa35f37)){if(!_[_0xf590('0x18')](_0x22a02d[_0xa35f37])&&_0x22a02d[_0xa35f37][_0xf590('0x38')]===_0xf590('0x66')&&_0x22a02d[_0xa35f37][_0xf590('0x67')]===_0xf590('0x68')){_0x4846a5[_0xf590('0x69')](_0x22a02d[_0xa35f37]['id']);}}}return _0x4846a5;};exports[_0xf590('0x6a')]=function(_0x49ad62){var _0x5c6761=moment()[_0xf590('0x6b')](0x0);var _0x4a80bb=moment(_0x49ad62)[_0xf590('0x6b')](0x0);return _0x5c6761[_0xf590('0x6c')](_0x4a80bb,_0xf590('0x6d'));};exports[_0xf590('0x6e')]=function(_0x3fcee7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fcee7[_0xf590('0x57')],'ListId':_0x3fcee7[_0xf590('0x58')],'VoiceQueueId':_0x3fcee7[_0xf590('0x1d')]||undefined,'CampaignId':_0x3fcee7['CampaignId']||undefined};};exports[_0xf590('0x6f')]=function(_0x5de683){if(_0x5de683===_0xf590('0x4a')||_0x5de683===_0xf590('0x70')||_0x5de683===_0xf590('0x5e')||_0x5de683==='type'||_0x5de683===_0xf590('0x71')||_0x5de683==='dialAnswer'||_0x5de683===_0xf590('0x42')||_0x5de683==='channelAgent'||_0x5de683===_0xf590('0x1b')||_0x5de683===_0xf590('0x72')||_0x5de683==='calleridnum'||_0x5de683===_0xf590('0x73')||_0x5de683===_0xf590('0x4f')||_0x5de683===_0xf590('0x74')||_0x5de683===_0xf590('0x50')||_0x5de683===_0xf590('0x75')||_0x5de683===_0xf590('0x76')||_0x5de683===_0xf590('0x77')||_0x5de683===_0xf590('0x78')||_0x5de683===_0xf590('0x79')||_0x5de683===_0xf590('0x57')||_0x5de683===_0xf590('0x58')||_0x5de683===_0xf590('0x43')||_0x5de683===_0xf590('0x1d')||_0x5de683===_0xf590('0x7a')||_0x5de683===_0xf590('0x7b')||_0x5de683===_0xf590('0x7c')||_0x5de683===_0xf590('0x7d')||_0x5de683===_0xf590('0x7e')||_0x5de683===_0xf590('0x7f')||_0x5de683===_0xf590('0x80')||_0x5de683==='xmd-dialoptions'||_0x5de683==='xmd-dialid'||_0x5de683==='xmd-dialchannel'||_0x5de683===_0xf590('0x81')||_0x5de683===_0xf590('0x82')||_0x5de683===_0xf590('0x83')||_0x5de683===_0xf590('0x84')||_0x5de683===_0xf590('0x85')||_0x5de683===_0xf590('0x86')||_0x5de683===_0xf590('0x87')||_0x5de683===_0xf590('0x88')||_0x5de683===_0xf590('0x89')||_0x5de683===_0xf590('0x8a')||_0x5de683===_0xf590('0x8b')||_0x5de683==='rtpaudioqosrtt'||_0x5de683==='rtpaudioqosrttbridged'||_0x5de683===_0xf590('0x86')||_0x5de683===_0xf590('0x87')||_0x5de683===_0xf590('0x88')||_0x5de683===_0xf590('0x89')||_0x5de683===_0xf590('0x8a')||_0x5de683===_0xf590('0x8b')||_0x5de683===_0xf590('0x8c')||_0x5de683==='rtpaudioqosrttbridged'||_0x5de683===_0xf590('0x8d')||_0x5de683===_0xf590('0x8e')||_0x5de683===_0xf590('0x38')||_0x5de683===_0xf590('0x39')){return![];}return!![];};exports[_0xf590('0x8f')]=function(_0x5c36d8,_0x34bc96){var _0x5efc49,_0x55e9c0,_0x3f03f4;if(_0x34bc96<=0x0){_0x34bc96=0x1;}_0x5efc49=new RegExp(_0xf590('0x90')+_0x34bc96+'}$');_0x55e9c0=Math[_0xf590('0x91')](0xa,_0x34bc96-0x1);_0x3f03f4=Math['pow'](0xa,_0x34bc96)-0x1;return util[_0xf590('0x14')]('%s',_[_0xf590('0x92')](_0x5c36d8,_0x5efc49,_[_0xf590('0x93')](_0x55e9c0,_0x3f03f4)));};exports[_0xf590('0x94')]=function(_0x58cfd1){var _0xde9342=_0x58cfd1[_0xf590('0x95')](/"(.*?)"/);return _0xde9342?_0xde9342[0x1]:_0x58cfd1;};exports[_0xf590('0x96')]=function(_0x257bc0){var _0x50b6d0=_0x257bc0['match'](/<(.*?)>/);return _0x50b6d0?_0x50b6d0[0x1]:_0x257bc0;};function buildNoAnswerEventPayload(_0x329f9f,_0x578bc3){var _0x2996dc=buildObj(_0x329f9f,'noanswer');if(!_[_0xf590('0x12')](_0x578bc3[_0xf590('0x97')])){Object['keys'](_0x578bc3[_0xf590('0x97')])[_0xf590('0x98')](function(_0x3401ab){_0x2996dc[_0x3401ab[_0xf590('0x99')]()]=_0x578bc3[_0xf590('0x97')][_0x3401ab];});}return _0x2996dc;}exports[_0xf590('0x9a')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6f3102b..f0b7419 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54c4=['boolean','queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x13ad55,_0x35f957){var _0xce1e6b=function(_0x21864e){while(--_0x21864e){_0x13ad55['push'](_0x13ad55['shift']());}};_0xce1e6b(++_0x35f957);}(_0x54c4,0xde));var _0x454c=function(_0x35cc28,_0xc628d9){_0x35cc28=_0x35cc28-0x0;var _0x2330e0=_0x54c4[_0x35cc28];return _0x2330e0;};'use strict';exports[_0x454c('0x0')]={'queue':{'type':_0x454c('0x1'),'required':!![]},'interface':{'type':_0x454c('0x1'),'required':!![]},'membername':{'type':_0x454c('0x1'),'required':!![]},'penalty':{'type':_0x454c('0x2'),'required':![]},'paused':{'type':_0x454c('0x3'),'required':![]}};exports[_0x454c('0x4')]={'queue':{'type':_0x454c('0x1'),'required':!![]},'interface':{'type':_0x454c('0x1'),'required':!![]}};exports[_0x454c('0x5')]={'interface':{'type':_0x454c('0x1'),'required':!![]},'paused':{'type':_0x454c('0x3')},'reason':{'type':_0x454c('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x454c('0x1'),'required':![]}};exports[_0x454c('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x454c('0x1'),'required':!![]},'filename':{'type':_0x454c('0x1')},'format':{'type':_0x454c('0x1')},'mixmonitorid':{'type':_0x454c('0x1')}};exports[_0x454c('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x454c('0x8')]={'uniqueid':{'type':_0x454c('0x1'),'required':!![]},'exten':{'type':_0x454c('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x6302=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x33b360,_0x90a737){var _0x5eed2a=function(_0x17587a){while(--_0x17587a){_0x33b360['push'](_0x33b360['shift']());}};_0x5eed2a(++_0x90a737);}(_0x6302,0xb2));var _0x2630=function(_0x5d6aef,_0x990afa){_0x5d6aef=_0x5d6aef-0x0;var _0x511122=_0x6302[_0x5d6aef];return _0x511122;};'use strict';exports[_0x2630('0x0')]={'queue':{'type':_0x2630('0x1'),'required':!![]},'interface':{'type':_0x2630('0x1'),'required':!![]},'membername':{'type':_0x2630('0x1'),'required':!![]},'penalty':{'type':_0x2630('0x2'),'required':![]},'paused':{'type':_0x2630('0x3'),'required':![]}};exports[_0x2630('0x4')]={'queue':{'type':_0x2630('0x1'),'required':!![]},'interface':{'type':_0x2630('0x1'),'required':!![]}};exports[_0x2630('0x5')]={'interface':{'type':_0x2630('0x1'),'required':!![]},'paused':{'type':_0x2630('0x3')},'reason':{'type':_0x2630('0x1'),'required':![]}};exports[_0x2630('0x6')]={'module':{'type':_0x2630('0x1'),'required':![]}};exports[_0x2630('0x7')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]}};exports[_0x2630('0x8')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]},'filename':{'type':_0x2630('0x1')},'format':{'type':_0x2630('0x1')},'mixmonitorid':{'type':_0x2630('0x1')}};exports[_0x2630('0x9')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]}};exports[_0x2630('0xa')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 060fac4..f5dabf1 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x3fd27c,_0x2697a2){var _0x954d17=function(_0x28da03){while(--_0x28da03){_0x3fd27c['push'](_0x3fd27c['shift']());}};_0x954d17(++_0x2697a2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28edf6,_0x5c661e){_0x28edf6=_0x28edf6-0x0;var _0x112906=_0x5f2f[_0x28edf6];return _0x112906;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x5ab970,_0x3753e6){var _0x523c3c=function(_0x19f73b){while(--_0x19f73b){_0x5ab970['push'](_0x5ab970['shift']());}};_0x523c3c(++_0x3753e6);}(_0xb10b,0x12a));var _0xbb10=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0xb10b[_0x32a81f];return _0x5b67a2;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index ae6d923..477ad2d 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';function mergeDBDataToRealtime(_0x2f04dd,_0x49436b){var _0x5a3541=Object['assign']({},_0x2f04dd);for(var _0x453b7f in _0x49436b){if(_0x5a3541['hasOwnProperty'](_0x453b7f)){_0x5a3541[_0x453b7f]=_0x49436b[_0x453b7f];}}return _0x5a3541;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x1e88=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x154a0a,_0x96977b){var _0x550392=function(_0xf5f946){while(--_0xf5f946){_0x154a0a['push'](_0x154a0a['shift']());}};_0x550392(++_0x96977b);}(_0x1e88,0x1c8));var _0x81e8=function(_0x3b1e7f,_0x2b62a1){_0x3b1e7f=_0x3b1e7f-0x0;var _0xd828ab=_0x1e88[_0x3b1e7f];return _0xd828ab;};'use strict';function mergeDBDataToRealtime(_0x121231,_0x11647e){var _0x55db52=Object[_0x81e8('0x0')]({},_0x121231);for(var _0x5375f1 in _0x11647e){if(_0x55db52[_0x81e8('0x1')](_0x5375f1)){_0x55db52[_0x5375f1]=_0x11647e[_0x5375f1];}}return _0x55db52;}exports[_0x81e8('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 12fc285..7c0ea43 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8c1=['SIP/%s','voiceQueueReport','connectedlinenum','assigned','lastAssignedTo','interface','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','length','getCallType','channel','split','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','ANSWERED','linkedid','transfereelinkedid','uniqueid','blindTransfer','transfers','UserId','membername','monitor','monitors','filename','createdAt','calleridname','connectedlinename','exten','originatecalleridnum','isArray','startsWith','Local','substring','indexOf','phone','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','accountcode','find','name','format'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xb8c1,0x195));var _0x1b8c=function(_0x5983d9,_0x207b66){_0x5983d9=_0x5983d9-0x0;var _0x2d7710=_0xb8c1[_0x5983d9];return _0x2d7710;};'use strict';var _=require(_0x1b8c('0x0'));var moment=require(_0x1b8c('0x1'));var util=require('util');var config=require(_0x1b8c('0x2'));var ami=require(_0x1b8c('0x3'));var RpcVoiceAgentReport=require(_0x1b8c('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x1b8c('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x1b8c('0x6'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x1b8c('0x7'));var VoiceDialReport=require(_0x1b8c('0x8'));var UserReport=require(_0x1b8c('0x9'));function Report(_0x5ceaae){this[_0x1b8c('0xa')]=_0x5ceaae;this[_0x1b8c('0xb')]=_0x5ceaae[_0x1b8c('0xb')];this[_0x1b8c('0xc')]=_0x5ceaae['telephones'];}Report[_0x1b8c('0xd')][_0x1b8c('0xe')]=function(_0xe3db02){var _0x890572=new VoiceQueueReport(this[_0x1b8c('0xa')]);var _0x3c6c34=new VoiceAgentReport(this['realtime']);var _0x29197a=new VoiceDialReport(this[_0x1b8c('0xa')]);var _0x33f4c3=new VoiceCallReport(this[_0x1b8c('0xa')]);var _0x18f268=new UserReport(this[_0x1b8c('0xa')]);if(config[_0x1b8c('0xf')]&&config[_0x1b8c('0xf')]['disabled']){ami['on'](_0x1b8c('0x10'),this['voiceQueueReport'][_0x1b8c('0x11')](this));ami['on'](_0x1b8c('0x12'),this[_0x1b8c('0x13')][_0x1b8c('0x11')](this));ami['on'](_0x1b8c('0x14'),this['voiceAgentReport'][_0x1b8c('0x11')](this));ami['on'](_0x1b8c('0x15'),this[_0x1b8c('0x16')]['bind'](this));ami['on']('blindtransfer',this['blindTransfer'][_0x1b8c('0x11')](this));ami['on'](_0x1b8c('0x17'),this[_0x1b8c('0x18')][_0x1b8c('0x11')](this));}};Report[_0x1b8c('0xd')][_0x1b8c('0x19')]=function(_0x5d729b){var _0x1fce42;_0x1fce42=_['find'](this[_0x1b8c('0xb')],function(_0x21eeec){return _0x21eeec[_0x1b8c('0x1a')]==_0x5d729b||_0x21eeec['name']==_0x5d729b;});if(_['isNil'](_0x1fce42)){var _0x1682c7=_[_0x1b8c('0x1b')](this[_0x1b8c('0xc')],function(_0x300d01){return _0x300d01['accountcode']==_0x5d729b||_0x300d01[_0x1b8c('0x1c')]==_0x5d729b;});if(_0x1682c7){_0x1fce42=_['find'](this[_0x1b8c('0xb')],function(_0x3d3969){return _0x3d3969['interface']==util[_0x1b8c('0x1d')](_0x1b8c('0x1e'),_0x1682c7['name']);});}}return _0x1fce42;};Report['prototype'][_0x1b8c('0x1f')]=function(_0x1828ac){for(var _0x4829e1=0x0;_0x4829e1<_0x1828ac['length'];_0x4829e1+=0x1){var _0x594a86=this['findAgent'](_0x1828ac[_0x4829e1][_0x1b8c('0x20')]);if(_0x594a86){_0x1828ac[_0x4829e1]['accountcode']=_0x594a86[_0x1b8c('0x1a')];_0x1828ac[_0x4829e1][_0x1b8c('0x21')]=!![];_0x1828ac[_0x4829e1][_0x1b8c('0x22')]=_0x594a86[_0x1b8c('0x1c')];_0x1828ac[_0x4829e1][_0x1b8c('0x23')]=_[_0x1b8c('0x24')](_0x594a86['interface'])?util[_0x1b8c('0x1d')](_0x1b8c('0x1e'),_0x594a86[_0x1b8c('0x1c')]):_0x594a86[_0x1b8c('0x23')];if(_0x1828ac[_0x4829e1][_0x1b8c('0x25')]){_0x1828ac[_0x4829e1]['queuecallercompleteAt']=moment()['format'](_0x1b8c('0x26'));}if(_0x1828ac[_0x4829e1][_0x1b8c('0x27')]){_0x1828ac[_0x4829e1][_0x1b8c('0x28')]=moment()[_0x1b8c('0x1d')](_0x1b8c('0x26'));}RpcMemberReport['voiceQueueReport'](_0x1828ac[_0x4829e1]);}RpcVoiceQueueReport[_0x1b8c('0x29')](_0x1828ac[_0x4829e1]);}};function extractCalleridNumber(_0xda7c97){var _0x2f162d=_0xda7c97[_0x1b8c('0x2a')](/<(.*?)>/);return _0x2f162d?_0x2f162d[0x1]:_0xda7c97;}Report[_0x1b8c('0xd')][_0x1b8c('0x2b')]=function(_0x911cdf){for(var _0x2c2678=0x0;_0x2c2678',_0x3c393c['calleridname'],_0x3c393c[_0x1b8c('0x3d')]);}if(RpcVoiceTransferReport['transfers'][_0x3c393c[_0x1b8c('0x40')]]){var _0x36cc46=RpcVoiceTransferReport['transfers'][_0x3c393c[_0x1b8c('0x40')]];_0x36cc46[_0x1b8c('0x41')]=_0x3c393c[_0x1b8c('0x42')];RpcVoiceTransferReport[_0x1b8c('0x43')](_0x36cc46);delete RpcVoiceTransferReport[_0x1b8c('0x44')][_0x3c393c[_0x1b8c('0x40')]];}if(_[_0x1b8c('0x24')](_0x3c393c['type'])){_0x3c393c[_0x1b8c('0x32')]=this[_0x1b8c('0x2e')](_0x3c393c);}if(_[_0x1b8c('0x24')](_0x3c393c[_0x1b8c('0x45')])){var _0x4c19cf=_0x3c393c['channel'][_0x1b8c('0x30')]('-')[0x0];var _0x167267=this['agents'][_0x4c19cf];if(!_0x167267)_0x167267=this[_0x1b8c('0x2b')](_0x3c393c[_0x1b8c('0x1a')]);if(_0x167267){_0x3c393c[_0x1b8c('0x45')]=_0x167267['id'];_0x3c393c[_0x1b8c('0x46')]=_0x167267['name'];}}RpcVoiceCallReport[_0x1b8c('0x29')](_0x3c393c);if(_0x3c393c[_0x1b8c('0x47')]){for(var _0x39eded=0x0;_0x39eded<_0x3c393c[_0x1b8c('0x48')][_0x1b8c('0x2d')];_0x39eded+=0x1){_0x3c393c['monitorFilename']=_0x3c393c[_0x1b8c('0x48')][_0x39eded][_0x1b8c('0x49')];_0x3c393c[_0x1b8c('0x4a')]=_0x3c393c['monitors'][_0x39eded][_0x1b8c('0x4a')];if(_0x3c393c['exten']=='xcally-motion-preview'){_0x3c393c[_0x1b8c('0x3d')]=_0x3c393c[_0x1b8c('0x20')];_0x3c393c[_0x1b8c('0x4b')]=_0x3c393c[_0x1b8c('0x4c')];_0x3c393c[_0x1b8c('0x20')]=_0x3c393c['accountcode'];_0x3c393c[_0x1b8c('0x4c')]=_0x3c393c[_0x1b8c('0x46')];_0x3c393c[_0x1b8c('0x4d')]=_0x3c393c[_0x1b8c('0x4e')];}else if(_0x3c393c[_0x1b8c('0x4d')]=='xcally-motion-dialer'){_0x3c393c[_0x1b8c('0x3d')]=_0x3c393c[_0x1b8c('0x31')];_0x3c393c[_0x1b8c('0x4d')]=_0x3c393c['originatecalleridnum'];}RpcVoiceRecording[_0x1b8c('0x29')](_0x3c393c);}}};Report[_0x1b8c('0xd')]['voiceAgentReport']=function(_0x3dfdd0){if(_[_0x1b8c('0x4f')](_0x3dfdd0)){_0x3dfdd0['forEach'](function(_0x1aecab){RpcVoiceAgentReport[_0x1b8c('0x29')](_0x1aecab);});}else{RpcVoiceAgentReport[_0x1b8c('0x29')](_0x3dfdd0);}};Report[_0x1b8c('0xd')][_0x1b8c('0x16')]=function(_0x629794){RpcVoiceDialReport['create'](_0x629794);var _0x396e76;var _0x33c8f2;var _0x32d4e1=_0x629794[_0x1b8c('0x2f')];if(_[_0x1b8c('0x50')](_0x32d4e1,_0x1b8c('0x51'))){_0x33c8f2=_0x32d4e1[_0x1b8c('0x52')](_0x32d4e1[_0x1b8c('0x53')]('/')+0x1,_0x32d4e1[_0x1b8c('0x53')]('@'));_0x396e76=_[_0x1b8c('0x1b')](this[_0x1b8c('0xb')],function(_0x4fb5ce){return _0x4fb5ce['mobile']==_0x33c8f2||_0x4fb5ce[_0x1b8c('0x54')]==_0x33c8f2||_0x4fb5ce['accountcode']==_0x33c8f2;});}else{_0x33c8f2=_0x32d4e1[_0x1b8c('0x52')](_0x32d4e1['indexOf']('/')+0x1,_0x32d4e1['lastIndexOf']('-'));_0x396e76=this[_0x1b8c('0x19')](_0x33c8f2);}if(_0x396e76){_0x629794[_0x1b8c('0x23')]=_[_0x1b8c('0x24')](_0x396e76[_0x1b8c('0x23')])?util['format']('SIP/%s',_0x396e76[_0x1b8c('0x1c')]):_0x396e76[_0x1b8c('0x23')];_0x629794[_0x1b8c('0x46')]=_0x396e76[_0x1b8c('0x1c')];_0x629794['accountcode']=_0x396e76[_0x1b8c('0x1a')];RpcMemberReport['voiceDialReport'](_0x629794);}};Report[_0x1b8c('0xd')]['blindTransfer']=function(_0x5b572){RpcVoiceTransferReport['transfers'][_0x5b572[_0x1b8c('0x55')]]=_0x5b572;};Report['prototype'][_0x1b8c('0x18')]=function(_0x588995){RpcVoiceTransferReport[_0x1b8c('0x18')](_0x588995);};module[_0x1b8c('0x56')]=Report; \ No newline at end of file +var _0xd58d=['type','lastapplication','queue','callerid','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','realtime','telephones','prototype','sync','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','voiceDialReport','attendedtransfer','findAgent','find','accountcode','name','isNil','agents','interface','format','length','connectedlinenum','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','destination','exten'];(function(_0x4214f2,_0x4e0d2c){var _0x5845f5=function(_0x440e74){while(--_0x440e74){_0x4214f2['push'](_0x4214f2['shift']());}};_0x5845f5(++_0x4e0d2c);}(_0xd58d,0x1ce));var _0xdd58=function(_0x5e1863,_0x2c131e){_0x5e1863=_0x5e1863-0x0;var _0x1a4fa5=_0xd58d[_0x5e1863];return _0x1a4fa5;};'use strict';var _=require(_0xdd58('0x0'));var moment=require('moment');var util=require('util');var config=require(_0xdd58('0x1'));var ami=require(_0xdd58('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xdd58('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xdd58('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xdd58('0x5'));var VoiceQueueReport=require(_0xdd58('0x6'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xdd58('0x7'));var VoiceDialReport=require(_0xdd58('0x8'));var UserReport=require('./userReport');function Report(_0x3e52eb){this[_0xdd58('0x9')]=_0x3e52eb;this['agents']=_0x3e52eb['agents'];this['telephones']=_0x3e52eb[_0xdd58('0xa')];}Report[_0xdd58('0xb')][_0xdd58('0xc')]=function(_0x3c3579){var _0x3b202e=new VoiceQueueReport(this['realtime']);var _0x5ab74c=new VoiceAgentReport(this[_0xdd58('0x9')]);var _0x34375e=new VoiceDialReport(this['realtime']);var _0x4f3f58=new VoiceCallReport(this['realtime']);var _0x3ea66d=new UserReport(this[_0xdd58('0x9')]);if(config['xdr']&&config['xdr'][_0xdd58('0xd')]){ami['on'](_0xdd58('0xe'),this['voiceQueueReport'][_0xdd58('0xf')](this));ami['on'](_0xdd58('0x10'),this[_0xdd58('0x11')][_0xdd58('0xf')](this));ami['on']('custom:voiceAgentReport',this[_0xdd58('0x12')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xdd58('0x13')][_0xdd58('0xf')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0xdd58('0x14'),this['attendedTransfer'][_0xdd58('0xf')](this));}};Report[_0xdd58('0xb')][_0xdd58('0x15')]=function(_0x186f53){var _0x1745ff;_0x1745ff=_[_0xdd58('0x16')](this['agents'],function(_0x35edd3){return _0x35edd3[_0xdd58('0x17')]==_0x186f53||_0x35edd3[_0xdd58('0x18')]==_0x186f53;});if(_[_0xdd58('0x19')](_0x1745ff)){var _0x38e6b6=_[_0xdd58('0x16')](this[_0xdd58('0xa')],function(_0x4b87dc){return _0x4b87dc[_0xdd58('0x17')]==_0x186f53||_0x4b87dc[_0xdd58('0x18')]==_0x186f53;});if(_0x38e6b6){_0x1745ff=_[_0xdd58('0x16')](this[_0xdd58('0x1a')],function(_0x2831f1){return _0x2831f1[_0xdd58('0x1b')]==util[_0xdd58('0x1c')]('SIP/%s',_0x38e6b6[_0xdd58('0x18')]);});}}return _0x1745ff;};Report[_0xdd58('0xb')]['voiceQueueReport']=function(_0x40318a){for(var _0x1d8187=0x0;_0x1d8187<_0x40318a[_0xdd58('0x1d')];_0x1d8187+=0x1){var _0x9503f2=this[_0xdd58('0x15')](_0x40318a[_0x1d8187][_0xdd58('0x1e')]);if(_0x9503f2){_0x40318a[_0x1d8187]['accountcode']=_0x9503f2['accountcode'];_0x40318a[_0x1d8187]['assigned']=!![];_0x40318a[_0x1d8187]['lastAssignedTo']=_0x9503f2['name'];_0x40318a[_0x1d8187][_0xdd58('0x1b')]=_[_0xdd58('0x19')](_0x9503f2[_0xdd58('0x1b')])?util['format'](_0xdd58('0x1f'),_0x9503f2['name']):_0x9503f2[_0xdd58('0x1b')];if(_0x40318a[_0x1d8187][_0xdd58('0x20')]){_0x40318a[_0x1d8187][_0xdd58('0x21')]=moment()[_0xdd58('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x40318a[_0x1d8187][_0xdd58('0x22')]){_0x40318a[_0x1d8187][_0xdd58('0x23')]=moment()[_0xdd58('0x1c')](_0xdd58('0x24'));}RpcMemberReport[_0xdd58('0x25')](_0x40318a[_0x1d8187]);}RpcVoiceQueueReport[_0xdd58('0x26')](_0x40318a[_0x1d8187]);}};function extractCalleridNumber(_0x58bca0){var _0x3f9369=_0x58bca0[_0xdd58('0x27')](/<(.*?)>/);return _0x3f9369?_0x3f9369[0x1]:_0x58bca0;}Report[_0xdd58('0xb')][_0xdd58('0x28')]=function(_0x168761){for(var _0x2f436d=0x0;_0x2f436d0x0?!![]:![];if(!_0xe378ee){return this[_0x59ee('0x18')](this[_0x59ee('0x48')]['completeEvent']);}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0x1a')]=function(_0x57d0b7){var _0x2cb937=this['summary']['id'];if(this[_0x59ee('0x48')][_0x59ee('0x67')][_0x2cb937]&&this[_0x59ee('0x48')][_0x59ee('0x67')][_0x2cb937][_0x57d0b7['actionid']]){this['summary']['queuestatus'][_0x2cb937][_0x57d0b7[_0x59ee('0x5e')]][_0x59ee('0x11')][_0x59ee('0x6b')](_0x57d0b7);}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0x17')]=function(_0x17359b){var _0x373dc1=this;try{if(this[_0x59ee('0x6c')](_0x17359b)&&this[_0x59ee('0x6c')](_0x17359b[_0x59ee('0x4f')])){logger[_0x59ee('0x4c')](_0x59ee('0x6d'),util[_0x59ee('0x42')](_0x17359b,{'showHidden':![],'depth':null}));var _0x357c47=this[_0x59ee('0x14')][_0x17359b['queue']];if(_0x357c47){logger[_0x59ee('0x6e')](_0x59ee('0x6f'),_0x357c47[_0x59ee('0x65')]);this[_0x59ee('0x48')][_0x59ee('0x5a')][_0x357c47[_0x59ee('0x65')]]={'summaryEvent':_0x17359b};this[_0x59ee('0x48')][_0x59ee('0x6a')]+=0x1;return ami['Action']({'action':_0x59ee('0x67'),'queue':_0x357c47[_0x59ee('0x65')]})[_0x59ee('0x5d')](function(_0x45c394){if(!_0x373dc1['summary']['queuestatus'][_0x17359b['actionid']]){_0x373dc1['summary']['queuestatus'][_0x17359b['actionid']]={};}_0x373dc1['summary'][_0x59ee('0x67')][_0x17359b['actionid']][_0x45c394['actionid']]={'queue':_0x357c47[_0x59ee('0x65')],'agents':[]};})[_0x59ee('0x3e')](function(_0x36e56f){throw _0x36e56f;});}}}catch(_0x17bc89){logger[_0x59ee('0x40')](_0x59ee('0x70'),util[_0x59ee('0x42')](_0x17bc89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59ee('0xb')]['syncQueueSummaryComplete']=function(_0x511fe1){if(this[_0x59ee('0x48')][_0x59ee('0x6a')]>0x0){this[_0x59ee('0x48')][_0x59ee('0x71')]=_0x511fe1;return;}logger[_0x59ee('0x4c')](_0x59ee('0x72'),util['inspect'](_0x511fe1,{'showHidden':![],'depth':null}));this[_0x59ee('0x48')]=initializeSummary();ami[_0x59ee('0x4a')](_0x59ee('0x73'),{});};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0x1c')]=function(_0x5838d3){try{if(this[_0x59ee('0x6c')](_0x5838d3)){logger['debug'](_0x59ee('0x74'),_0x5838d3[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x5838d3,{'showHidden':![],'depth':null}));if(_[_0x59ee('0x76')](this[_0x59ee('0xf')][_0x5838d3[_0x59ee('0x75')]])){this[_0x59ee('0xf')][_0x5838d3['uniqueid']]=[];}if(_[_0x59ee('0x76')](this[_0x59ee('0x12')][_0x5838d3[_0x59ee('0x75')]])){this['channels'][_0x5838d3['uniqueid']]={};}var _0x4c60ca=new QueueReport();_0x4c60ca[_0x59ee('0x4f')]=_0x5838d3['queue'];_0x4c60ca[_0x59ee('0x68')]=this[_0x59ee('0x14')][_0x4c60ca[_0x59ee('0x4f')]]&&this[_0x59ee('0x14')][_0x4c60ca[_0x59ee('0x4f')]][_0x59ee('0x68')]?this[_0x59ee('0x14')][_0x4c60ca[_0x59ee('0x4f')]]['type']||_0x59ee('0x57'):_0x59ee('0x57');_0x4c60ca['queuecallerjoinAt']=moment()[_0x59ee('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c60ca[_0x59ee('0x77')]=_0x5838d3[_0x59ee('0x77')];_0x4c60ca[_0x59ee('0x78')]=_0x5838d3[_0x59ee('0x78')];_0x4c60ca[_0x59ee('0x75')]=_0x5838d3[_0x59ee('0x75')];_0x4c60ca['routealias']=this[_0x59ee('0x12')][_0x5838d3[_0x59ee('0x75')]]['routealias'];logger[_0x59ee('0x6e')](_0x59ee('0x79'),_0x4c60ca[_0x59ee('0x4f')],_0x4c60ca[_0x59ee('0x68')]);_['merge'](_0x4c60ca,_['pick'](_0x5838d3,_[_0x59ee('0x7a')](_0x4c60ca)));this[_0x59ee('0xf')][_0x5838d3['uniqueid']][_0x59ee('0x6b')](_0x4c60ca);this[_0x59ee('0x12')][_0x5838d3[_0x59ee('0x75')]]=_0x4c60ca;this[_0x59ee('0x4b')](_0x4c60ca,'queuecallerjoin');}}catch(_0x249e5a){logger['error'](_0x59ee('0x74'),_0x5838d3[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x249e5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0x1d')]=function(_0x350540){try{if(this['isNotNull'](_0x350540)){logger['debug'](_0x59ee('0x7b'),_0x350540[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x350540,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x350540['uniqueid']]){var _0x143813=_[_0x59ee('0x7c')](this['queueReports'][_0x350540[_0x59ee('0x75')]]);_0x143813['queuecallercomplete']=![];_0x143813[_0x59ee('0x7d')]=null;_0x143813[_0x59ee('0x7e')]=_0x350540['holdtime'];_0x143813['originalposition']=_0x350540['originalposition'];_0x143813[_0x59ee('0x7f')]=!![];_0x143813[_0x59ee('0x80')]=moment()[_0x59ee('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x143813[_0x59ee('0x81')]=_0x59ee('0x82');_0x143813[_0x59ee('0x83')]=null;logger[_0x59ee('0x6e')](_0x59ee('0x84'),_0x143813['queue'],_0x143813[_0x59ee('0x68')]);this[_0x59ee('0x12')][_0x350540[_0x59ee('0x75')]]=_0x143813;this['emitVoiceQueueChannelRemove'](_0x143813,'queuecallerabandon');}}}catch(_0x210332){logger[_0x59ee('0x40')]('[%s][voiceQueueReport][queuecallerabandon]',_0x350540[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x210332,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0x1f')]=function(_0x267b3e){try{if(this['isNotNull'](_0x267b3e)){logger[_0x59ee('0x4c')](_0x59ee('0x85'),_0x267b3e[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x267b3e,{'showHidden':![],'depth':null}));if(this[_0x59ee('0xf')][_0x267b3e[_0x59ee('0x75')]]){var _0x5b874e=_[_0x59ee('0x7c')](this[_0x59ee('0xf')][_0x267b3e['uniqueid']]);_0x5b874e[_0x59ee('0x86')]=moment()[_0x59ee('0x4e')](_0x59ee('0x87'));_0x5b874e[_0x59ee('0x88')]=_0x267b3e['connectedlinenum'];_0x5b874e[_0x59ee('0x89')]=_0x267b3e[_0x59ee('0x89')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5b874e[_0x59ee('0x4f')],_0x5b874e['type'],_0x267b3e[_0x59ee('0x88')],_0x267b3e[_0x59ee('0x89')]);this[_0x59ee('0x12')][_0x267b3e[_0x59ee('0x75')]]=_0x5b874e;this[_0x59ee('0x4b')](_0x5b874e,_0x59ee('0x1e'));}}}catch(_0x319bdc){logger[_0x59ee('0x40')](_0x59ee('0x85'),_0x267b3e[_0x59ee('0x75')],util['inspect'](_0x319bdc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x34f8a1){try{if(this[_0x59ee('0x6c')](_0x34f8a1)){logger['debug'](_0x59ee('0x8a'),_0x34f8a1[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x34f8a1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x34f8a1['uniqueid']]){var _0x19a9de=_[_0x59ee('0x7c')](this[_0x59ee('0xf')][_0x34f8a1[_0x59ee('0x75')]]);_0x19a9de[_0x59ee('0x8b')]=!![];_0x19a9de[_0x59ee('0x81')]=_0x59ee('0x8c');logger[_0x59ee('0x6e')](_0x59ee('0x8d'),_0x19a9de[_0x59ee('0x4f')],_0x19a9de[_0x59ee('0x68')]);}}}catch(_0x36ae9f){logger[_0x59ee('0x40')](_0x59ee('0x8a'),_0x34f8a1[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x36ae9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x4b22f6){try{if(this[_0x59ee('0x6c')](_0x4b22f6)){logger[_0x59ee('0x4c')](_0x59ee('0x8e'),_0x4b22f6[_0x59ee('0x75')],util['inspect'](_0x4b22f6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b22f6['uniqueid']]){var _0x234b8b=_['last'](this['queueReports'][_0x4b22f6[_0x59ee('0x75')]]);_0x234b8b[_0x59ee('0x7f')]=![];_0x234b8b[_0x59ee('0x80')]=null;_0x234b8b[_0x59ee('0x8f')]=!![];_0x234b8b[_0x59ee('0x83')]=_0x4b22f6[_0x59ee('0x90')];_0x234b8b['holdtime']=_0x4b22f6[_0x59ee('0x7e')];_0x234b8b[_0x59ee('0x8b')]=!![];_0x234b8b[_0x59ee('0x91')]=![];_0x234b8b[_0x59ee('0x92')]=null;if(!_0x234b8b[_0x59ee('0x93')]){if(_0x4b22f6['reason']==_0x59ee('0x93')){_0x234b8b[_0x59ee('0x81')]=_0x59ee('0x94');logger[_0x59ee('0x6e')](_0x59ee('0x95'),_0x234b8b[_0x59ee('0x4f')],_0x234b8b[_0x59ee('0x68')]);}else{if(_['startsWith'](_0x4b22f6[_0x59ee('0x3d')][_0x59ee('0x96')](),_0x59ee('0x97'))){if(this[_0x59ee('0xf')][_0x4b22f6[_0x59ee('0x98')]]){var _0x24fa58=_['last'](this[_0x59ee('0xf')][_0x4b22f6[_0x59ee('0x98')]]);_0x24fa58[_0x59ee('0x8b')]=![];_0x24fa58[_0x59ee('0x91')]=!![];_0x24fa58[_0x59ee('0x92')]=moment(_0x234b8b[_0x59ee('0x99')])[_0x59ee('0x9a')](_0x4b22f6['holdtime'],_0x59ee('0x9b'))['format'](_0x59ee('0x87'));_0x24fa58[_0x59ee('0x81')]=_0x59ee('0x9c');_0x24fa58[_0x59ee('0x93')]=!![];_0x24fa58['transfertype']=_0x59ee('0x9d');_0x24fa58[_0x59ee('0x9e')]=_0x4b22f6['destexten'];_0x24fa58[_0x59ee('0x9f')]=_0x4b22f6[_0x59ee('0x75')];logger['info'](_0x59ee('0xa0'),_0x24fa58[_0x59ee('0x4f')],_0x24fa58['type']);var _0x332995=this[_0x59ee('0xf')][_0x4b22f6[_0x59ee('0x98')]];this[_0x59ee('0xf')][_0x4b22f6[_0x59ee('0x98')]]=this[_0x59ee('0xf')][_0x4b22f6[_0x59ee('0x75')]];this[_0x59ee('0xf')][_0x4b22f6['uniqueid']]=_0x332995;}}else{_0x234b8b[_0x59ee('0x81')]=_0x59ee('0xa1')+_0x4b22f6['reason'][_0x59ee('0xa2')]();logger[_0x59ee('0x6e')](_0x59ee('0xa3'),_0x234b8b[_0x59ee('0x4f')],_0x234b8b[_0x59ee('0x68')],_0x234b8b[_0x59ee('0x81')]);}}}this[_0x59ee('0x12')][_0x4b22f6[_0x59ee('0x75')]]=_0x234b8b;this[_0x59ee('0x52')](_0x234b8b,'agentcomplete');}}}catch(_0x1a610e){logger[_0x59ee('0x40')](_0x59ee('0x8e'),_0x4b22f6['uniqueid'],util[_0x59ee('0x42')](_0x1a610e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0x23')]=function(_0x5969d8){try{if(this[_0x59ee('0x6c')](_0x5969d8)){logger[_0x59ee('0x4c')](_0x59ee('0xa4'),_0x5969d8[_0x59ee('0x75')],util['inspect'](_0x5969d8,{'showHidden':![],'depth':null}));this[_0x59ee('0xa5')](_0x5969d8['uniqueid'],_['keys'](_0x5969d8[_0x59ee('0xa6')])[0x0],_0x5969d8[_0x59ee('0xa7')]);if(this[_0x59ee('0xf')][_0x5969d8[_0x59ee('0x75')]]){var _0x58938d=_['last'](this[_0x59ee('0xf')][_0x5969d8['uniqueid']]);if(_0x58938d){if(this[_0x59ee('0x6c')](_0x5969d8['variable'])&&this['isNotNull'](_0x5969d8[_0x59ee('0xa6')][_0x59ee('0x67')])){switch(_0x5969d8['value']){case _0x59ee('0xa8'):_0x58938d[_0x59ee('0x91')]=![];_0x58938d['queuecallerexitAt']=null;break;case _0x59ee('0xa9'):_0x58938d[_0x59ee('0xaa')]='timeout';_0x58938d[_0x59ee('0x91')]=!![];_0x58938d[_0x59ee('0x92')]=moment()[_0x59ee('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x58938d[_0x59ee('0x86')]=moment()[_0x59ee('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x59ee('0x4c')](_0x59ee('0xab'),_0x5969d8[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x58938d,{'showHidden':![],'depth':null}));ami[_0x59ee('0x4a')]('custom:timeout',_0x58938d);break;default:_0x58938d[_0x59ee('0x91')]=!![];_0x58938d[_0x59ee('0x92')]=moment()[_0x59ee('0x4e')](_0x59ee('0x87'));_0x58938d['queuecallerleaveAt']=moment()[_0x59ee('0x4e')](_0x59ee('0x87'));}_0x58938d['queuecallerabandon']=![];_0x58938d['queuecallerabandonAt']=null;_0x58938d['queuecallerexitreason']=_0x5969d8[_0x59ee('0xa7')];this['channels'][_0x5969d8[_0x59ee('0x75')]]=_0x58938d;this['emitVoiceQueueChannelRemove'](_0x58938d,'varset');}else if(this[_0x59ee('0x6c')](_0x5969d8['variable'])&&this[_0x59ee('0x6c')](_0x5969d8[_0x59ee('0xa6')]['queueposition'])){if(!_0x58938d[_0x59ee('0x7f')]){_0x58938d['queuecallerexit']=!![];_0x58938d['queuecallerexitAt']=moment()['format'](_0x59ee('0x87'));_0x58938d[_0x59ee('0x81')]='EXITWITHKEY';_0x58938d['queuecallerleaveAt']=moment()[_0x59ee('0x4e')](_0x59ee('0x87'));this['channels'][_0x5969d8[_0x59ee('0x75')]]=_0x58938d;}}logger[_0x59ee('0x6e')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x5969d8[_0x59ee('0x75')],_0x58938d[_0x59ee('0x4f')],_0x58938d[_0x59ee('0x68')],_['keys'](_0x5969d8[_0x59ee('0xa6')])[0x0],_0x5969d8[_0x59ee('0xa7')]);_0x58938d[_0x59ee('0x44')]=this['variables'][_0x5969d8[_0x59ee('0x75')]];}}}}catch(_0x4fbb9d){logger[_0x59ee('0x40')](_0x59ee('0xa4'),_0x5969d8[_0x59ee('0x75')],util[_0x59ee('0x42')](_0x4fbb9d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0xa5')]=function(_0x113d13,_0x6f648a,_0x30b390){var _0x36342c=['rtpaudioqos',_0x59ee('0xac'),'rtpaudioqosjitter',_0x59ee('0xad'),_0x59ee('0xae'),'rtpaudioqoslossbridged',_0x59ee('0xaf'),_0x59ee('0xb0'),_0x59ee('0xb1'),_0x59ee('0xb2'),'bridgepeer','bridgepvtcallid','membercalls',_0x59ee('0xb3'),_0x59ee('0xb4'),_0x59ee('0xb5'),_0x59ee('0x90'),_0x59ee('0xb6'),_0x59ee('0xb7')];if(!_[_0x59ee('0x3a')](_0x6f648a)&&!_[_0x59ee('0xb8')](_0x36342c,_0x6f648a)){if(_[_0x59ee('0x76')](this[_0x59ee('0x44')][_0x113d13])){this['variables'][_0x113d13]={};}this[_0x59ee('0x44')][_0x113d13][_0x6f648a]=_0x30b390;}};VoiceQueueReport[_0x59ee('0xb')][_0x59ee('0xb9')]=function(_0x412022,_0x4fa0f0,_0x5acbc1){var _0x528f2f={};for(var _0x215f66=0x0;_0x215f660x0?!![]:![];if(!_0x63e6d8){return this[_0xf5d5('0x18')](this[_0xf5d5('0x44')][_0xf5d5('0x6c')]);}};VoiceQueueReport['prototype'][_0xf5d5('0x1a')]=function(_0x99384){var _0x4f01a0=this[_0xf5d5('0x44')]['id'];if(this['summary'][_0xf5d5('0x62')][_0x4f01a0]&&this[_0xf5d5('0x44')][_0xf5d5('0x62')][_0x4f01a0][_0x99384['actionid']]){this['summary'][_0xf5d5('0x62')][_0x4f01a0][_0x99384[_0xf5d5('0x61')]][_0xf5d5('0x10')]['push'](_0x99384);}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x16')]=function(_0x2e5c08){var _0x55f76c=this;try{if(this[_0xf5d5('0x6d')](_0x2e5c08)&&this[_0xf5d5('0x6d')](_0x2e5c08[_0xf5d5('0x4e')])){logger[_0xf5d5('0x48')](_0xf5d5('0x6e'),util[_0xf5d5('0x3d')](_0x2e5c08,{'showHidden':![],'depth':null}));var _0x135753=this[_0xf5d5('0x12')][_0x2e5c08[_0xf5d5('0x4e')]];if(_0x135753){logger[_0xf5d5('0x6f')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x135753[_0xf5d5('0x58')]);this['summary'][_0xf5d5('0x5d')][_0x135753[_0xf5d5('0x58')]]={'summaryEvent':_0x2e5c08};this[_0xf5d5('0x44')]['statusRequests']+=0x1;return ami['Action']({'action':_0xf5d5('0x62'),'queue':_0x135753[_0xf5d5('0x58')]})[_0xf5d5('0x60')](function(_0x4789aa){if(!_0x55f76c[_0xf5d5('0x44')][_0xf5d5('0x62')][_0x2e5c08[_0xf5d5('0x61')]]){_0x55f76c['summary'][_0xf5d5('0x62')][_0x2e5c08[_0xf5d5('0x61')]]={};}_0x55f76c['summary'][_0xf5d5('0x62')][_0x2e5c08[_0xf5d5('0x61')]][_0x4789aa[_0xf5d5('0x61')]]={'queue':_0x135753['name'],'agents':[]};})[_0xf5d5('0x3a')](function(_0x40befd){throw _0x40befd;});}}}catch(_0x5f5241){logger[_0xf5d5('0x3f')](_0xf5d5('0x70'),util[_0xf5d5('0x3d')](_0x5f5241,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x18')]=function(_0x5ac29f){if(this[_0xf5d5('0x44')][_0xf5d5('0x6b')]>0x0){this[_0xf5d5('0x44')][_0xf5d5('0x6c')]=_0x5ac29f;return;}logger['debug'](_0xf5d5('0x71'),util[_0xf5d5('0x3d')](_0x5ac29f,{'showHidden':![],'depth':null}));this[_0xf5d5('0x44')]=initializeSummary();ami[_0xf5d5('0x47')](_0xf5d5('0x72'),{});};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x1e')]=function(_0x53017c){try{if(this[_0xf5d5('0x6d')](_0x53017c)){logger[_0xf5d5('0x48')](_0xf5d5('0x73'),_0x53017c[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x53017c,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x53017c[_0xf5d5('0x4b')]])){this['queueReports'][_0x53017c['uniqueid']]=[];}if(_[_0xf5d5('0x5a')](this[_0xf5d5('0x11')][_0x53017c[_0xf5d5('0x4b')]])){this[_0xf5d5('0x11')][_0x53017c[_0xf5d5('0x4b')]]={};}var _0x599dee=new QueueReport();_0x599dee['queue']=_0x53017c[_0xf5d5('0x4e')];_0x599dee['type']=this[_0xf5d5('0x12')][_0x599dee[_0xf5d5('0x4e')]]&&this[_0xf5d5('0x12')][_0x599dee[_0xf5d5('0x4e')]][_0xf5d5('0x55')]?this['voiceQueues'][_0x599dee[_0xf5d5('0x4e')]][_0xf5d5('0x55')]||_0xf5d5('0x56'):_0xf5d5('0x56');_0x599dee[_0xf5d5('0x74')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));_0x599dee['position']=_0x53017c[_0xf5d5('0x76')];_0x599dee[_0xf5d5('0x77')]=_0x53017c[_0xf5d5('0x77')];_0x599dee['uniqueid']=_0x53017c['uniqueid'];_0x599dee[_0xf5d5('0x78')]=this['channels'][_0x53017c[_0xf5d5('0x4b')]]['routealias'];logger['info'](_0xf5d5('0x79'),_0x599dee[_0xf5d5('0x4e')],_0x599dee[_0xf5d5('0x55')]);_[_0xf5d5('0x7a')](_0x599dee,_['pick'](_0x53017c,_[_0xf5d5('0x7b')](_0x599dee)));this[_0xf5d5('0x3e')][_0x53017c[_0xf5d5('0x4b')]][_0xf5d5('0x7c')](_0x599dee);this[_0xf5d5('0x11')][_0x53017c[_0xf5d5('0x4b')]]=_0x599dee;this[_0xf5d5('0x7d')](_0x599dee,'queuecallerjoin');}}catch(_0x540b78){logger[_0xf5d5('0x3f')](_0xf5d5('0x73'),_0x53017c[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x540b78,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncQueueCallerAbandon']=function(_0x406888){try{if(this['isNotNull'](_0x406888)){logger['debug'](_0xf5d5('0x7e'),_0x406888[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x406888,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x406888[_0xf5d5('0x4b')]]){var _0x1f2bdd=_['last'](this[_0xf5d5('0x3e')][_0x406888[_0xf5d5('0x4b')]]);_0x1f2bdd[_0xf5d5('0x7f')]=![];_0x1f2bdd[_0xf5d5('0x80')]=null;_0x1f2bdd[_0xf5d5('0x81')]=_0x406888[_0xf5d5('0x81')];_0x1f2bdd[_0xf5d5('0x82')]=_0x406888[_0xf5d5('0x82')];_0x1f2bdd[_0xf5d5('0x83')]=!![];_0x1f2bdd[_0xf5d5('0x84')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));_0x1f2bdd[_0xf5d5('0x85')]='ABANDONED';_0x1f2bdd[_0xf5d5('0x86')]=null;logger[_0xf5d5('0x6f')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1f2bdd[_0xf5d5('0x4e')],_0x1f2bdd[_0xf5d5('0x55')]);this[_0xf5d5('0x11')][_0x406888['uniqueid']]=_0x1f2bdd;this[_0xf5d5('0x46')](_0x1f2bdd,_0xf5d5('0x83'));}}}catch(_0x303a81){logger['error'](_0xf5d5('0x7e'),_0x406888['uniqueid'],util['inspect'](_0x303a81,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x21')]=function(_0x18250f){try{if(this['isNotNull'](_0x18250f)){logger[_0xf5d5('0x48')](_0xf5d5('0x87'),_0x18250f['uniqueid'],util[_0xf5d5('0x3d')](_0x18250f,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x18250f['uniqueid']]){var _0x1e7d64=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x18250f[_0xf5d5('0x4b')]]);_0x1e7d64[_0xf5d5('0x89')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));_0x1e7d64[_0xf5d5('0x8a')]=_0x18250f[_0xf5d5('0x8a')];_0x1e7d64[_0xf5d5('0x8b')]=_0x18250f['connectedlinename'];logger[_0xf5d5('0x6f')](_0xf5d5('0x8c'),_0x1e7d64[_0xf5d5('0x4e')],_0x1e7d64[_0xf5d5('0x55')],_0x18250f[_0xf5d5('0x8a')],_0x18250f['connectedlinename']);this[_0xf5d5('0x11')][_0x18250f[_0xf5d5('0x4b')]]=_0x1e7d64;this[_0xf5d5('0x7d')](_0x1e7d64,_0xf5d5('0x20'));}}}catch(_0x4ceec9){logger[_0xf5d5('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x18250f[_0xf5d5('0x4b')],util['inspect'](_0x4ceec9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncAgentConnect']=function(_0x22947d){try{if(this[_0xf5d5('0x6d')](_0x22947d)){logger[_0xf5d5('0x48')](_0xf5d5('0x8d'),_0x22947d[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x22947d,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x22947d[_0xf5d5('0x4b')]]){var _0x38bc2e=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x22947d[_0xf5d5('0x4b')]]);_0x38bc2e[_0xf5d5('0x7f')]=!![];_0x38bc2e[_0xf5d5('0x85')]=_0xf5d5('0x8e');logger[_0xf5d5('0x6f')](_0xf5d5('0x8f'),_0x38bc2e['queue'],_0x38bc2e[_0xf5d5('0x55')]);}}}catch(_0x179a69){logger['error'](_0xf5d5('0x8d'),_0x22947d['uniqueid'],util['inspect'](_0x179a69,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncAgentComplete']=function(_0x59c1e9){try{if(this[_0xf5d5('0x6d')](_0x59c1e9)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x59c1e9[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x59c1e9,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]]){var _0x2bf6c8=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]]);_0x2bf6c8['queuecallerabandon']=![];_0x2bf6c8[_0xf5d5('0x84')]=null;_0x2bf6c8['assigned']=!![];_0x2bf6c8[_0xf5d5('0x86')]=_0x59c1e9['membername'];_0x2bf6c8[_0xf5d5('0x81')]=_0x59c1e9[_0xf5d5('0x81')];_0x2bf6c8[_0xf5d5('0x7f')]=!![];_0x2bf6c8['queuecallerexit']=![];_0x2bf6c8['queuecallerexitAt']=null;if(!_0x2bf6c8[_0xf5d5('0x90')]){if(_0x59c1e9['reason']=='transfer'){_0x2bf6c8[_0xf5d5('0x85')]=_0xf5d5('0x91');logger[_0xf5d5('0x6f')](_0xf5d5('0x92'),_0x2bf6c8[_0xf5d5('0x4e')],_0x2bf6c8[_0xf5d5('0x55')]);}else{if(_[_0xf5d5('0x93')](_0x59c1e9['channel']['toLowerCase'](),_0xf5d5('0x94'))){if(this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x95')]]){var _0x46aea8=_['last'](this['queueReports'][_0x59c1e9[_0xf5d5('0x95')]]);_0x46aea8['queuecallercomplete']=![];_0x46aea8[_0xf5d5('0x96')]=!![];_0x46aea8[_0xf5d5('0x97')]=moment(_0x2bf6c8[_0xf5d5('0x74')])[_0xf5d5('0x98')](_0x59c1e9[_0xf5d5('0x81')],_0xf5d5('0x99'))['format'](_0xf5d5('0x75'));_0x46aea8[_0xf5d5('0x85')]=_0xf5d5('0x9a');_0x46aea8[_0xf5d5('0x90')]=!![];_0x46aea8[_0xf5d5('0x9b')]='FORWARD';_0x46aea8['transferexten']=_0x59c1e9[_0xf5d5('0x9c')];_0x46aea8[_0xf5d5('0x9d')]=_0x59c1e9[_0xf5d5('0x4b')];logger[_0xf5d5('0x6f')](_0xf5d5('0x9e'),_0x46aea8[_0xf5d5('0x4e')],_0x46aea8[_0xf5d5('0x55')]);var _0x5a7eba=this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x95')]];this[_0xf5d5('0x3e')][_0x59c1e9['linkedid']]=this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]];this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]]=_0x5a7eba;}}else{_0x2bf6c8['queuecallerexitreason']=_0xf5d5('0x9f')+_0x59c1e9[_0xf5d5('0xa0')][_0xf5d5('0xa1')]();logger['info'](_0xf5d5('0xa2'),_0x2bf6c8[_0xf5d5('0x4e')],_0x2bf6c8[_0xf5d5('0x55')],_0x2bf6c8[_0xf5d5('0x85')]);}}}this['channels'][_0x59c1e9[_0xf5d5('0x4b')]]=_0x2bf6c8;this[_0xf5d5('0x46')](_0x2bf6c8,_0xf5d5('0x22'));}}}catch(_0x745ce5){logger[_0xf5d5('0x3f')](_0xf5d5('0xa3'),_0x59c1e9[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x745ce5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncVarSet']=function(_0x30f70e){try{if(this['isNotNull'](_0x30f70e)){logger[_0xf5d5('0x48')](_0xf5d5('0xa4'),_0x30f70e['uniqueid'],util['inspect'](_0x30f70e,{'showHidden':![],'depth':null}));this[_0xf5d5('0xa5')](_0x30f70e[_0xf5d5('0x4b')],_[_0xf5d5('0x7b')](_0x30f70e[_0xf5d5('0xa6')])[0x0],_0x30f70e[_0xf5d5('0xa7')]);if(this[_0xf5d5('0x3e')][_0x30f70e[_0xf5d5('0x4b')]]){var _0x273dd0=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x30f70e['uniqueid']]);if(_0x273dd0){if(this[_0xf5d5('0x6d')](_0x30f70e[_0xf5d5('0xa6')])&&this['isNotNull'](_0x30f70e[_0xf5d5('0xa6')][_0xf5d5('0x62')])){switch(_0x30f70e[_0xf5d5('0xa7')]){case _0xf5d5('0xa8'):_0x273dd0[_0xf5d5('0x96')]=![];_0x273dd0[_0xf5d5('0x97')]=null;break;case _0xf5d5('0xa9'):_0x273dd0['lastevent']=_0xf5d5('0xaa');_0x273dd0[_0xf5d5('0x96')]=!![];_0x273dd0[_0xf5d5('0x97')]=moment()[_0xf5d5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x273dd0['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xf5d5('0x48')](_0xf5d5('0xab'),_0x30f70e[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x273dd0,{'showHidden':![],'depth':null}));ami[_0xf5d5('0x47')](_0xf5d5('0xac'),_0x273dd0);break;default:_0x273dd0[_0xf5d5('0x96')]=!![];_0x273dd0['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x273dd0[_0xf5d5('0x89')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));}_0x273dd0[_0xf5d5('0x83')]=![];_0x273dd0[_0xf5d5('0x84')]=null;_0x273dd0['queuecallerexitreason']=_0x30f70e['value'];this['channels'][_0x30f70e[_0xf5d5('0x4b')]]=_0x273dd0;this[_0xf5d5('0x46')](_0x273dd0,_0xf5d5('0xad'));}else if(this[_0xf5d5('0x6d')](_0x30f70e[_0xf5d5('0xa6')])&&this[_0xf5d5('0x6d')](_0x30f70e['variable'][_0xf5d5('0xae')])){if(!_0x273dd0[_0xf5d5('0x83')]){_0x273dd0['queuecallerexit']=!![];_0x273dd0[_0xf5d5('0x97')]=moment()['format'](_0xf5d5('0x75'));_0x273dd0[_0xf5d5('0x85')]=_0xf5d5('0xaf');_0x273dd0[_0xf5d5('0x89')]=moment()[_0xf5d5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x30f70e[_0xf5d5('0x4b')]]=_0x273dd0;}}logger[_0xf5d5('0x6f')](_0xf5d5('0xb0'),_0x30f70e['uniqueid'],_0x273dd0[_0xf5d5('0x4e')],_0x273dd0[_0xf5d5('0x55')],_[_0xf5d5('0x7b')](_0x30f70e[_0xf5d5('0xa6')])[0x0],_0x30f70e[_0xf5d5('0xa7')]);_0x273dd0['variables']=this[_0xf5d5('0x14')][_0x30f70e[_0xf5d5('0x4b')]];}}}}catch(_0x393d4d){logger[_0xf5d5('0x3f')](_0xf5d5('0xa4'),_0x30f70e[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x393d4d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0xa5')]=function(_0x54f174,_0x4192de,_0x27f2df){var _0x32dc0a=[_0xf5d5('0xb1'),_0xf5d5('0xb2'),_0xf5d5('0xb3'),_0xf5d5('0xb4'),_0xf5d5('0xb5'),'rtpaudioqoslossbridged',_0xf5d5('0xb6'),'rtpaudioqosrttbridged','sipcallid',_0xf5d5('0xb7'),_0xf5d5('0xb8'),_0xf5d5('0xb9'),_0xf5d5('0xba'),_0xf5d5('0xbb'),_0xf5d5('0xbc'),_0xf5d5('0xbd'),_0xf5d5('0xbe'),'memberpenalty',_0xf5d5('0xbf')];if(!_[_0xf5d5('0xc0')](_0x4192de)&&!_[_0xf5d5('0xc1')](_0x32dc0a,_0x4192de)){if(_[_0xf5d5('0x5a')](this[_0xf5d5('0x14')][_0x54f174])){this[_0xf5d5('0x14')][_0x54f174]={};}this['variables'][_0x54f174][_0x4192de]=_0x27f2df;}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0xc2')]=function(_0x39bae0,_0x302aed,_0x2796c7){var _0x4a0341={};for(var _0x2d7d77=0x0;_0x2d7d77=0x0?moment(_0x4f9dee[_0x3ca5('0x18')])[_0x3ca5('0x19')](_0x4f9dee[_0x3ca5('0x17')],_0x3ca5('0xf')):null,'data1':_0x3ca5('0x1a'),'data2':_0x4f9dee[_0x3ca5('0x14')],'data3':_0x4f9dee['exten'],'data4':_0x4f9dee[_0x3ca5('0x1b')]||null,'role':_0x3ca5('0x12'),'internal':_0x4f9dee[_0x3ca5('0x14')]?_[_0x3ca5('0x13')](_0x4f9dee['accountcode']):undefined,'uniqueid':_0x4f9dee[_0x3ca5('0x1c')]},'log':_0x3ca5('0x7')});}; \ No newline at end of file +var _0xe460=['starttime','endtime','seconds','dialstring','moment','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','membername'];(function(_0x2a70d4,_0x291473){var _0x4dcdf9=function(_0x274cf5){while(--_0x274cf5){_0x2a70d4['push'](_0x2a70d4['shift']());}};_0x4dcdf9(++_0x291473);}(_0xe460,0xac));var _0x0e46=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xe460[_0x2650e9];return _0x3511c8;};'use strict';var moment=require(_0x0e46('0x0'));var _=require('lodash');var util=require('util');var client=require(_0x0e46('0x1'));exports[_0x0e46('0x2')]=function(_0x32f7e9){var _0x476dd5=_0x32f7e9[_0x0e46('0x3')]||_0x32f7e9[_0x0e46('0x4')];return client[_0x0e46('0x5')](_0x0e46('0x6'),{'body':{'channel':_0x0e46('0x7'),'membername':_0x32f7e9[_0x0e46('0x8')],'interface':_[_0x0e46('0x9')](_0x32f7e9[_0x0e46('0xa')])?util[_0x0e46('0xb')]('SIP/%s',_0x32f7e9['lastAssignedTo']):_0x32f7e9[_0x0e46('0xa')],'type':_0x0e46('0xc'),'enterAt':_0x32f7e9[_0x0e46('0xd')],'exitAt':_0x476dd5,'duration':moment(_0x476dd5)[_0x0e46('0xe')](_0x32f7e9['queuecallerleaveAt'],'seconds'),'data1':_0x0e46('0xf'),'data2':_0x32f7e9[_0x0e46('0x10')],'data3':_0x32f7e9[_0x0e46('0x11')],'data4':null,'data5':_0x32f7e9[_0x0e46('0x12')],'role':_0x0e46('0x13'),'internal':_0x32f7e9[_0x0e46('0x14')]?_[_0x0e46('0x15')](_0x32f7e9[_0x0e46('0x14')]):undefined,'uniqueid':_0x32f7e9[_0x0e46('0x16')]},'log':_0x0e46('0x6')});};exports['voiceDialReport']=function(_0x46c379){return client['Request'](_0x0e46('0x6'),{'body':{'channel':_0x0e46('0x7'),'membername':_0x46c379[_0x0e46('0x17')],'interface':_0x46c379['interface'],'type':'TALKING','enterAt':_0x46c379[_0x0e46('0x18')],'exitAt':_0x46c379[_0x0e46('0x19')],'duration':moment(_0x46c379['endtime'])[_0x0e46('0xe')](_0x46c379[_0x0e46('0x18')],_0x0e46('0x1a'))>=0x0?moment(_0x46c379['endtime'])[_0x0e46('0xe')](_0x46c379[_0x0e46('0x18')],_0x0e46('0x1a')):null,'data1':'outbound','data2':_0x46c379[_0x0e46('0x14')],'data3':_0x46c379[_0x0e46('0x11')],'data4':_0x46c379[_0x0e46('0x1b')]||null,'role':_0x0e46('0x13'),'internal':_0x46c379[_0x0e46('0x14')]?_[_0x0e46('0x15')](_0x46c379['accountcode']):undefined,'uniqueid':_0x46c379[_0x0e46('0x16')]},'log':_0x0e46('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c46e9be..4794fec 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbee0=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings','Request','ShowSetting'];(function(_0x5890b3,_0x2addca){var _0x518084=function(_0x4923aa){while(--_0x4923aa){_0x5890b3['push'](_0x5890b3['shift']());}};_0x518084(++_0x2addca);}(_0xbee0,0x147));var _0x0bee=function(_0x2094a2,_0x372841){_0x2094a2=_0x2094a2-0x0;var _0x1afad8=_0xbee0[_0x2094a2];return _0x1afad8;};'use strict';var client=require('../client');exports[_0x0bee('0x0')]=function(){return client[_0x0bee('0x1')](_0x0bee('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0bee('0x3'),_0x0bee('0x4')]},'log':_0x0bee('0x5')});}; \ No newline at end of file +var _0x65c9=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65c9,0x182));var _0x965c=function(_0x499684,_0x7efd4){_0x499684=_0x499684-0x0;var _0xa0d0a9=_0x65c9[_0x499684];return _0xa0d0a9;};'use strict';var client=require(_0x965c('0x0'));exports[_0x965c('0x1')]=function(){return client['Request'](_0x965c('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x965c('0x3'),_0x965c('0x4')]},'log':_0x965c('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6e90a46..babd766 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd958=['Request','name','html','GetTemplate','../client','getTemplates'];(function(_0x383426,_0x31891a){var _0x56661b=function(_0x17e8e2){while(--_0x17e8e2){_0x383426['push'](_0x383426['shift']());}};_0x56661b(++_0x31891a);}(_0xd958,0xb8));var _0x8d95=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd958[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x8d95('0x0'));exports[_0x8d95('0x1')]=function(_0x5c134f){return function(_0x549758){return client[_0x8d95('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x8d95('0x3'),_0x8d95('0x4')]},'log':_0x8d95('0x5')});};}; \ No newline at end of file +var _0x8bf1=['html','../client','Request','GetTemplate','name'];(function(_0x197043,_0x3ebf47){var _0x233e33=function(_0x17bd0f){while(--_0x17bd0f){_0x197043['push'](_0x197043['shift']());}};_0x233e33(++_0x3ebf47);}(_0x8bf1,0x65));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x18bf('0x0'));exports['getTemplates']=function(_0x3d7fa8){return function(_0x1d04b3){return client[_0x18bf('0x1')](_0x18bf('0x2'),{'options':{'raw':!![],'attributes':['id',_0x18bf('0x3'),_0x18bf('0x4')]},'log':_0x18bf('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index eea87cc..3b531a4 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8ab=['Condition','operator','Actions','data1','data2','data3','data5','data7','../client','getTriggers','Request','GetTrigger','name','status','AllConditions','value'];(function(_0x1a7a1b,_0x518846){var _0x350750=function(_0x4ab680){while(--_0x4ab680){_0x1a7a1b['push'](_0x1a7a1b['shift']());}};_0x350750(++_0x518846);}(_0xf8ab,0xd8));var _0xbf8a=function(_0x56f4e6,_0x1de088){_0x56f4e6=_0x56f4e6-0x0;var _0x1594af=_0xf8ab[_0x56f4e6];return _0x1594af;};'use strict';var client=require(_0xbf8a('0x0'));exports[_0xbf8a('0x1')]=function(_0x28a103){return function(_0x41698f){return client[_0xbf8a('0x2')](_0xbf8a('0x3'),{'options':{'raw':![],'attributes':['id',_0xbf8a('0x4'),'channel',_0xbf8a('0x5')],'include':[{'model':'Condition','as':_0xbf8a('0x6'),'attributes':['id','field','operator',_0xbf8a('0x7')]},{'model':_0xbf8a('0x8'),'as':'AnyConditions','attributes':['id','field',_0xbf8a('0x9'),_0xbf8a('0x7')]},{'model':'Action','as':_0xbf8a('0xa'),'attributes':['id','action',_0xbf8a('0xb'),_0xbf8a('0xc'),_0xbf8a('0xd'),'data4',_0xbf8a('0xe'),'data6',_0xbf8a('0xf')]}]},'log':_0xbf8a('0x3')});};}; \ No newline at end of file +var _0x7d61=['field','value','AnyConditions','operator','Action','Actions','action','data1','data4','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions'];(function(_0x199d94,_0x2a8775){var _0x15bc77=function(_0x325a6f){while(--_0x325a6f){_0x199d94['push'](_0x199d94['shift']());}};_0x15bc77(++_0x2a8775);}(_0x7d61,0x102));var _0x17d6=function(_0x19962e,_0x38c0d3){_0x19962e=_0x19962e-0x0;var _0x1ced88=_0x7d61[_0x19962e];return _0x1ced88;};'use strict';var client=require(_0x17d6('0x0'));exports[_0x17d6('0x1')]=function(_0x183122){return function(_0x1f3794){return client['Request'](_0x17d6('0x2'),{'options':{'raw':![],'attributes':['id',_0x17d6('0x3'),_0x17d6('0x4'),_0x17d6('0x5')],'include':[{'model':_0x17d6('0x6'),'as':_0x17d6('0x7'),'attributes':['id',_0x17d6('0x8'),'operator',_0x17d6('0x9')]},{'model':_0x17d6('0x6'),'as':_0x17d6('0xa'),'attributes':['id','field',_0x17d6('0xb'),_0x17d6('0x9')]},{'model':_0x17d6('0xc'),'as':_0x17d6('0xd'),'attributes':['id',_0x17d6('0xe'),_0x17d6('0xf'),'data2','data3',_0x17d6('0x10'),'data5',_0x17d6('0x11'),_0x17d6('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 84d8e99..7a35cc8 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf301=['getTrunks','Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x59a413,_0x47507b){var _0x2120ef=function(_0x109a4d){while(--_0x109a4d){_0x59a413['push'](_0x59a413['shift']());}};_0x2120ef(++_0x47507b);}(_0xf301,0xe6));var _0x1f30=function(_0x5b7a85,_0x483fb0){_0x5b7a85=_0x5b7a85-0x0;var _0x453546=_0xf301[_0x5b7a85];return _0x453546;};'use strict';var client=require(_0x1f30('0x0'));exports[_0x1f30('0x1')]=function(_0x27de90){return function(_0x2f177d){return client[_0x1f30('0x2')](_0x1f30('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1f30('0x4'),_0x1f30('0x5'),_0x1f30('0x6')]},'log':_0x1f30('0x3')});};}; \ No newline at end of file +var _0x8bd2=['getTrunks','GetTrunk','name','registry','defaultuser','../client'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x8bd2,0x17f));var _0x28bd=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x8bd2[_0x4defd6];return _0x4c9276;};'use strict';var client=require(_0x28bd('0x0'));exports[_0x28bd('0x1')]=function(_0x50df01){return function(_0x5760de){return client['Request'](_0x28bd('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x28bd('0x3'),_0x28bd('0x4'),_0x28bd('0x5')]},'log':_0x28bd('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 4e34863..9ecc9f3 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x5f0547,_0x5f4ab8){var _0x2ba8d8=function(_0x46a243){while(--_0x46a243){_0x5f0547['push'](_0x5f0547['shift']());}};_0x2ba8d8(++_0x5f4ab8);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x4391bc,_0x413330){var _0x255243=function(_0x272b27){while(--_0x272b27){_0x4391bc['push'](_0x4391bc['shift']());}};_0x255243(++_0x413330);}(_0xedd9,0xfc));var _0x9edd=function(_0x132523,_0x4a484c){_0x132523=_0x132523-0x0;var _0x710292=_0xedd9[_0x132523];return _0x710292;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5a3d6a9..b3c9f14 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cf7=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','Request'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x0cf7,0x67));var _0x70cf=function(_0x438747,_0x1e8e6a){_0x438747=_0x438747-0x0;var _0x23cf79=_0x0cf7[_0x438747];return _0x23cf79;};'use strict';var client=require(_0x70cf('0x0'));exports['create']=function(_0x3c147f){return client[_0x70cf('0x1')]('CreateVoiceAgentReport',{'body':_0x3c147f,'log':_0x70cf('0x2')});};exports[_0x70cf('0x3')]=function(_0x42a848,_0x463ea0,_0x1dd5f9){return client[_0x70cf('0x1')](_0x70cf('0x4'),{'body':_0x42a848,'options':{'where':{'uniqueid':_0x463ea0,'interface':_0x1dd5f9,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x1f1f=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1f1f,0x111));var _0xf1f1=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x1f1f[_0x2dbce7];return _0x3a3ed0;};'use strict';var client=require(_0xf1f1('0x0'));exports['create']=function(_0x459979){return client[_0xf1f1('0x1')](_0xf1f1('0x2'),{'body':_0x459979,'log':_0xf1f1('0x2')});};exports['update']=function(_0x183762,_0x172a32,_0x4d5353){return client[_0xf1f1('0x1')](_0xf1f1('0x3'),{'body':_0x183762,'options':{'where':{'uniqueid':_0x172a32,'interface':_0x4d5353,'agentcomplete':!![]}},'log':_0xf1f1('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d3d5c16..5c6e112 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85d4=['DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid'];(function(_0x351c8f,_0x1a92ae){var _0x8deaa4=function(_0x582df0){while(--_0x582df0){_0x351c8f['push'](_0x351c8f['shift']());}};_0x8deaa4(++_0x1a92ae);}(_0x85d4,0x157));var _0x485d=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x85d4[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require('moment');var util=require(_0x485d('0x0'));var _=require(_0x485d('0x1'));var client=require(_0x485d('0x2'));exports['create']=function(_0x575482){return client[_0x485d('0x3')](_0x485d('0x4'),{'body':_[_0x485d('0x5')](_0x575482,{'source':_0x575482[_0x485d('0x6')],'destinationcontext':_0x575482[_0x485d('0x7')],'callerid':_0x575482[_0x485d('0x8')],'amaflags':_0x485d('0x9')}),'log':_0x485d('0x4')});};exports[_0x485d('0xa')]=function(){return function(){return client[_0x485d('0x3')](_0x485d('0xb'),{'options':{'where':{'type':[_0x485d('0xc')],'createdAt':{'$between':[moment()['startOf']('day')[_0x485d('0xd')](_0x485d('0xe')),moment()[_0x485d('0xf')](_0x485d('0x10'))[_0x485d('0xd')](_0x485d('0xe'))]}},'attributes':[_0x485d('0x11'),_0x485d('0x12'),_0x485d('0x13'),_0x485d('0x14')]},'log':_0x485d('0x15')});};}; \ No newline at end of file +var _0x2cd4=['endOf','format','type','disposition','billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x310210,_0x2c97e5){var _0xb001ba=function(_0x5cef31){while(--_0x5cef31){_0x310210['push'](_0x310210['shift']());}};_0xb001ba(++_0x2c97e5);}(_0x2cd4,0x194));var _0x42cd=function(_0x1a0c59,_0x3b4dcc){_0x1a0c59=_0x1a0c59-0x0;var _0xed67c9=_0x2cd4[_0x1a0c59];return _0xed67c9;};'use strict';var moment=require(_0x42cd('0x0'));var util=require('util');var _=require(_0x42cd('0x1'));var client=require(_0x42cd('0x2'));exports[_0x42cd('0x3')]=function(_0x5cd97a){return client[_0x42cd('0x4')](_0x42cd('0x5'),{'body':_[_0x42cd('0x6')](_0x5cd97a,{'source':_0x5cd97a[_0x42cd('0x7')],'destinationcontext':_0x5cd97a[_0x42cd('0x8')],'callerid':_0x5cd97a[_0x42cd('0x9')],'amaflags':_0x42cd('0xa')}),'log':_0x42cd('0x5')});};exports[_0x42cd('0xb')]=function(){return function(){return client[_0x42cd('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x42cd('0xc')],'createdAt':{'$between':[moment()[_0x42cd('0xd')](_0x42cd('0xe'))['format'](_0x42cd('0xf')),moment()[_0x42cd('0x10')](_0x42cd('0xe'))[_0x42cd('0x11')](_0x42cd('0xf'))]}},'attributes':[_0x42cd('0x12'),_0x42cd('0x13'),'duration',_0x42cd('0x14')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2733c41..787cba8 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ece=['CreateVoiceDialReport','create','Request'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0x6ece,0x1d8));var _0xe6ec=function(_0x43f291,_0x571cf5){_0x43f291=_0x43f291-0x0;var _0x5d4abc=_0x6ece[_0x43f291];return _0x5d4abc;};'use strict';var client=require('../client');exports[_0xe6ec('0x0')]=function(_0x12f204){return client[_0xe6ec('0x1')]('CreateVoiceDialReport',{'body':_0x12f204,'log':_0xe6ec('0x2')});}; \ No newline at end of file +var _0x7ff2=['CreateVoiceDialReport','Request'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x7ff2,0x18f));var _0x27ff=function(_0x3bb9a5,_0x552fc6){_0x3bb9a5=_0x3bb9a5-0x0;var _0x3f2d46=_0x7ff2[_0x3bb9a5];return _0x3f2d46;};'use strict';var client=require('../client');exports['create']=function(_0x5cad6c){return client[_0x27ff('0x0')](_0x27ff('0x1'),{'body':_0x5cad6c,'log':_0x27ff('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 7bf61bb..12f5342 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e0d=['exten','getVoiceExtensions','../client','GetVoiceExtension'];(function(_0x4abc8f,_0xef597d){var _0x5d7939=function(_0x145f23){while(--_0x145f23){_0x4abc8f['push'](_0x4abc8f['shift']());}};_0x5d7939(++_0xef597d);}(_0x8e0d,0x82));var _0xd8e0=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x8e0d[_0x48d6a3];return _0x38bfa0;};'use strict';var client=require(_0xd8e0('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xd8e0('0x1'),{'options':{'raw':!![],'attributes':['id',_0xd8e0('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xd8e0('0x3')});};}; \ No newline at end of file +var _0xf403=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x133084,_0x39bb5a){var _0x1104d5=function(_0x3996c2){while(--_0x3996c2){_0x133084['push'](_0x133084['shift']());}};_0x1104d5(++_0x39bb5a);}(_0xf403,0x1d3));var _0x3f40=function(_0x48f892,_0x3b31e6){_0x48f892=_0x48f892-0x0;var _0x52c1cc=_0xf403[_0x48f892];return _0x52c1cc;};'use strict';var client=require(_0x3f40('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x3f40('0x1')](_0x3f40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3f40('0x3'),_0x3f40('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x3f40('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 7346ed8..bc06e85 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21b4=['dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0x21b4,0x15b));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x421b('0x0'));exports[_0x421b('0x1')]=function(){return function(){return client[_0x421b('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x421b('0x3'),_0x421b('0x4'),_0x421b('0x5'),_0x421b('0x6'),_0x421b('0x7'),_0x421b('0x8'),_0x421b('0x9'),_0x421b('0xa'),_0x421b('0xb'),'dialLimitQueue',_0x421b('0xc'),_0x421b('0xd'),_0x421b('0xe'),'dialPredictiveInterval',_0x421b('0xf'),_0x421b('0x10'),'dialOriginateTimeout','dialQueueOptions',_0x421b('0x11'),_0x421b('0x12'),'dialCongestionMaxRetry',_0x421b('0x13'),_0x421b('0x14'),_0x421b('0x15'),_0x421b('0x16'),_0x421b('0x17'),'dialGlobalMaxRetry','dialTimezone',_0x421b('0x18'),_0x421b('0x19'),'dialCheckDuplicateType',_0x421b('0x1a'),_0x421b('0x1b'),_0x421b('0x1c'),_0x421b('0x1d'),_0x421b('0x1e'),_0x421b('0x1f'),_0x421b('0x20'),_0x421b('0x21'),_0x421b('0x22'),_0x421b('0x23'),_0x421b('0x24'),_0x421b('0x25'),_0x421b('0x26'),'dialOrderByScheduledAt',_0x421b('0x27'),_0x421b('0x28'),_0x421b('0x29'),_0x421b('0x7'),_0x421b('0x2a'),_0x421b('0x2b'),'dialCutDigit',_0x421b('0x2c'),_0x421b('0x2d'),_0x421b('0x2e'),_0x421b('0x2f'),_0x421b('0x30'),_0x421b('0x31'),_0x421b('0x32'),'dialMachineRetryFrequency',_0x421b('0x33'),_0x421b('0x34'),_0x421b('0x35'),_0x421b('0x36'),_0x421b('0x37'),'dialPreviewAutoRecallMe',_0x421b('0x38')],'include':[{'model':_0x421b('0x39'),'as':'Trunk','attributes':['id','name',_0x421b('0x3a'),_0x421b('0x3b')]},{'model':_0x421b('0x3c'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x421b('0x39'),'as':_0x421b('0x3d'),'attributes':['id',_0x421b('0x3'),_0x421b('0x3a'),_0x421b('0x3b')]},{'model':_0x421b('0x3e'),'as':_0x421b('0x3e'),'attributes':['id',_0x421b('0x3')],'include':[{'model':_0x421b('0x3e'),'as':_0x421b('0x3f'),'attributes':['id',_0x421b('0x3'),_0x421b('0x40')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x7a79=['dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','autopause','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x7a79,0xfc));var _0x97a7=function(_0xfadc1a,_0xc6a189){_0xfadc1a=_0xfadc1a-0x0;var _0x1be3a4=_0x7a79[_0xfadc1a];return _0x1be3a4;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x97a7('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x97a7('0x1'),_0x97a7('0x2'),_0x97a7('0x3'),'monitor_format',_0x97a7('0x4'),'dialActive',_0x97a7('0x5'),_0x97a7('0x6'),_0x97a7('0x7'),_0x97a7('0x8'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x97a7('0x9'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x97a7('0xa'),'dialQueueOptions',_0x97a7('0xb'),_0x97a7('0xc'),_0x97a7('0xd'),'dialCongestionRetryFrequency',_0x97a7('0xe'),_0x97a7('0xf'),_0x97a7('0x10'),_0x97a7('0x11'),'dialGlobalMaxRetry','dialTimezone',_0x97a7('0x12'),_0x97a7('0x13'),_0x97a7('0x14'),_0x97a7('0x15'),'dialAMDInitialSilence',_0x97a7('0x16'),_0x97a7('0x17'),_0x97a7('0x18'),_0x97a7('0x19'),_0x97a7('0x1a'),_0x97a7('0x1b'),_0x97a7('0x1c'),_0x97a7('0x1d'),_0x97a7('0x1e'),_0x97a7('0x1f'),'dialRecallInQueue',_0x97a7('0x20'),_0x97a7('0x21'),_0x97a7('0x22'),_0x97a7('0x23'),_0x97a7('0x24'),_0x97a7('0x25'),_0x97a7('0x26'),_0x97a7('0x27'),_0x97a7('0x28'),'dialNoSuchNumberRetryFrequency',_0x97a7('0x29'),'dialDropRetryFrequency',_0x97a7('0x2a'),_0x97a7('0x2b'),'dialMachineMaxRetry',_0x97a7('0x2c'),_0x97a7('0x2d'),_0x97a7('0x2e'),_0x97a7('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x97a7('0x30'),_0x97a7('0x31'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x97a7('0x32'),'as':_0x97a7('0x32'),'attributes':['id',_0x97a7('0x33'),_0x97a7('0x34'),_0x97a7('0x35')]},{'model':_0x97a7('0x36'),'as':_0x97a7('0x37'),'attributes':['id',_0x97a7('0x33')]},{'model':_0x97a7('0x32'),'as':'TrunkBackup','attributes':['id','name',_0x97a7('0x34'),_0x97a7('0x35')]},{'model':_0x97a7('0x38'),'as':_0x97a7('0x38'),'attributes':['id','name'],'include':[{'model':_0x97a7('0x38'),'as':_0x97a7('0x39'),'attributes':['id','name',_0x97a7('0x3a')]}]}]},'log':_0x97a7('0x3b')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 349c29a..12cb249 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x245ba4,_0x290091){var _0x5abf52=function(_0x526aa8){while(--_0x526aa8){_0x245ba4['push'](_0x245ba4['shift']());}};_0x5abf52(++_0x290091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x524daf,_0x41ed0a){var _0x938050=function(_0x58ca77){while(--_0x58ca77){_0x524daf['push'](_0x524daf['shift']());}};_0x938050(++_0x41ed0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 0be8db4..f77b970 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f96=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x5f96,0x179));var _0x65f9=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x5f96[_0x1beef3];return _0x5af964;};'use strict';var client=require('../client');exports[_0x65f9('0x0')]=function(_0x229f6f){return function(){return client[_0x65f9('0x1')](_0x65f9('0x2'),{'options':{'where':{'VoiceQueueId':_0x229f6f,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xf12c=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x4b3e72,_0x391646){var _0x2f1fa8=function(_0x29b513){while(--_0x29b513){_0x4b3e72['push'](_0x4b3e72['shift']());}};_0x2f1fa8(++_0x391646);}(_0xf12c,0x1d4));var _0xcf12=function(_0x5c8b01,_0x1102c1){_0x5c8b01=_0x5c8b01-0x0;var _0x180b22=_0xf12c[_0x5c8b01];return _0x180b22;};'use strict';var client=require(_0xcf12('0x0'));exports[_0xcf12('0x1')]=function(_0xc4ef1d){return function(){return client[_0xcf12('0x2')](_0xcf12('0x3'),{'options':{'where':{'VoiceQueueId':_0xc4ef1d,'paused':!![]},'raw':!![]},'log':_0xcf12('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 5d4b4fa..7046eef 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1445ec,_0x139a01){var _0x4be7cd=function(_0x2c3fc2){while(--_0x2c3fc2){_0x1445ec['push'](_0x1445ec['shift']());}};_0x4be7cd(++_0x139a01);}(_0x7a54,0x106));var _0x47a5=function(_0x15167c,_0x5d3377){_0x15167c=_0x15167c-0x0;var _0x2d22ed=_0x7a54[_0x15167c];return _0x2d22ed;};'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(_0x2d52f2,_0x77d294){var _0x5af923=function(_0x3bf3d2){while(--_0x3bf3d2){_0x2d52f2['push'](_0x2d52f2['shift']());}};_0x5af923(++_0x77d294);}(_0x7a54,0x106));var _0x47a5=function(_0x43d122,_0x502dad){_0x43d122=_0x43d122-0x0;var _0xc780d8=_0x7a54[_0x43d122];return _0xc780d8;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 0187b8c..0ec9e81 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd4a=['transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','transfers','blindTransfer','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xcd4a,0x1e1));var _0xacd4=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0xcd4a[_0x267d8d];return _0x11a98f;};'use strict';var client=require('../client');exports[_0xacd4('0x0')]={};exports[_0xacd4('0x1')]=function(_0x251ce6){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x251ce6[_0xacd4('0x2')],'transfererchannel':_0x251ce6[_0xacd4('0x3')],'transferercalleridnum':_0x251ce6['transferercalleridnum'],'transferercalleridname':_0x251ce6[_0xacd4('0x4')],'transfererconnectedlinenum':_0x251ce6[_0xacd4('0x5')],'transfererconnectedlinename':_0x251ce6[_0xacd4('0x6')],'transfereraccountcode':_0x251ce6[_0xacd4('0x7')],'transferercontext':_0x251ce6[_0xacd4('0x8')],'transfererexten':_0x251ce6['transfererexten'],'transfererlinkedid':_0x251ce6[_0xacd4('0x9')],'transfereechannel':_0x251ce6['transfereechannel'],'transfereecalleridnum':_0x251ce6[_0xacd4('0xa')],'transfereecalleridname':_0x251ce6[_0xacd4('0xb')],'transfereeconnectedlinenum':_0x251ce6[_0xacd4('0xc')],'transfereeconnectedlinename':_0x251ce6[_0xacd4('0xd')],'transfereeaccountcode':_0x251ce6[_0xacd4('0xe')],'transfereecontext':_0x251ce6['transfereecontext'],'transfereeexten':_0x251ce6[_0xacd4('0xf')],'transfereelinkedid':_0x251ce6[_0xacd4('0x10')],'isexternal':_0x251ce6[_0xacd4('0x11')],'context':_0x251ce6[_0xacd4('0x12')],'extension':_0x251ce6[_0xacd4('0x13')],'type':_0xacd4('0x14')},'log':_0xacd4('0x15')});};exports[_0xacd4('0x16')]=function(_0x2b9311){return client[_0xacd4('0x17')](_0xacd4('0x15'),{'body':{'result':_0x2b9311[_0xacd4('0x2')],'transfererchannel':_0x2b9311[_0xacd4('0x18')],'transferercalleridnum':_0x2b9311[_0xacd4('0x19')],'transferercalleridname':_0x2b9311[_0xacd4('0x1a')],'transfererconnectedlinenum':_0x2b9311['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2b9311[_0xacd4('0x1b')],'transfereraccountcode':_0x2b9311['origtransfereraccountcode'],'transferercontext':_0x2b9311[_0xacd4('0x1c')],'transfererexten':_0x2b9311['secondtransfererexten'],'transfererlinkedid':_0x2b9311[_0xacd4('0x1d')],'transfereechannel':_0x2b9311[_0xacd4('0x1e')],'transfereecalleridnum':_0x2b9311['transfertargetcalleridnum'],'transfereecalleridname':_0x2b9311[_0xacd4('0x1f')],'transfereeconnectedlinenum':_0x2b9311[_0xacd4('0x20')],'transfereeconnectedlinename':_0x2b9311['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2b9311['transfertargetaccountcode'],'transfereecontext':_0x2b9311[_0xacd4('0x21')],'transfereeexten':_0x2b9311[_0xacd4('0x22')],'transfereelinkedid':_0x2b9311[_0xacd4('0x23')],'isexternal':_0x2b9311[_0xacd4('0x11')],'context':_0x2b9311[_0xacd4('0x24')],'extension':_0x2b9311[_0xacd4('0x25')],'type':'attended'},'log':_0xacd4('0x15')});}; \ No newline at end of file +var _0xc96e=['transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum'];(function(_0x33574c,_0x435727){var _0x13c1e7=function(_0x298ed1){while(--_0x298ed1){_0x33574c['push'](_0x33574c['shift']());}};_0x13c1e7(++_0x435727);}(_0xc96e,0x87));var _0xec96=function(_0xa75c12,_0x734a3a){_0xa75c12=_0xa75c12-0x0;var _0x4aa6d2=_0xc96e[_0xa75c12];return _0x4aa6d2;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xec96('0x0')]=function(_0x436b24){return client[_0xec96('0x1')](_0xec96('0x2'),{'body':{'result':_0x436b24[_0xec96('0x3')],'transfererchannel':_0x436b24[_0xec96('0x4')],'transferercalleridnum':_0x436b24[_0xec96('0x5')],'transferercalleridname':_0x436b24[_0xec96('0x6')],'transfererconnectedlinenum':_0x436b24[_0xec96('0x7')],'transfererconnectedlinename':_0x436b24[_0xec96('0x8')],'transfereraccountcode':_0x436b24['transfereraccountcode'],'transferercontext':_0x436b24[_0xec96('0x9')],'transfererexten':_0x436b24[_0xec96('0xa')],'transfererlinkedid':_0x436b24[_0xec96('0xb')],'transfereechannel':_0x436b24[_0xec96('0xc')],'transfereecalleridnum':_0x436b24[_0xec96('0xd')],'transfereecalleridname':_0x436b24['transfereecalleridname'],'transfereeconnectedlinenum':_0x436b24[_0xec96('0xe')],'transfereeconnectedlinename':_0x436b24[_0xec96('0xf')],'transfereeaccountcode':_0x436b24['transfereeaccountcode'],'transfereecontext':_0x436b24['transfereecontext'],'transfereeexten':_0x436b24[_0xec96('0x10')],'transfereelinkedid':_0x436b24[_0xec96('0x11')],'isexternal':_0x436b24[_0xec96('0x12')],'context':_0x436b24[_0xec96('0x13')],'extension':_0x436b24[_0xec96('0x14')],'type':_0xec96('0x15')},'log':_0xec96('0x2')});};exports[_0xec96('0x16')]=function(_0x3c1d3c){return client[_0xec96('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x3c1d3c[_0xec96('0x3')],'transfererchannel':_0x3c1d3c[_0xec96('0x17')],'transferercalleridnum':_0x3c1d3c[_0xec96('0x18')],'transferercalleridname':_0x3c1d3c[_0xec96('0x19')],'transfererconnectedlinenum':_0x3c1d3c[_0xec96('0x1a')],'transfererconnectedlinename':_0x3c1d3c[_0xec96('0x1b')],'transfereraccountcode':_0x3c1d3c[_0xec96('0x1c')],'transferercontext':_0x3c1d3c['secondtransferercontext'],'transfererexten':_0x3c1d3c[_0xec96('0x1d')],'transfererlinkedid':_0x3c1d3c[_0xec96('0x1e')],'transfereechannel':_0x3c1d3c[_0xec96('0x1f')],'transfereecalleridnum':_0x3c1d3c[_0xec96('0x20')],'transfereecalleridname':_0x3c1d3c[_0xec96('0x21')],'transfereeconnectedlinenum':_0x3c1d3c[_0xec96('0x22')],'transfereeconnectedlinename':_0x3c1d3c[_0xec96('0x23')],'transfereeaccountcode':_0x3c1d3c[_0xec96('0x24')],'transfereecontext':_0x3c1d3c['transfertargetcontext'],'transfereeexten':_0x3c1d3c[_0xec96('0x25')],'transfereelinkedid':_0x3c1d3c[_0xec96('0x26')],'isexternal':_0x3c1d3c[_0xec96('0x12')],'context':_0x3c1d3c[_0xec96('0x27')],'extension':_0x3c1d3c[_0xec96('0x28')],'type':_0xec96('0x29')},'log':_0xec96('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a99bbc1..a5bb242 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b8f=['validate','../properties','../ami','listen','format','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','ami\x20disconnected','pick','keys','reload','module','action','then','message','catch','username','join','command','Action','content','voiceQueues','hasOwnProperty','find','omit','undefined','values','length','isConnected','voicechannel','channels','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','resolve','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','rows','voicequeuechannel','map','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util'];(function(_0x1936d5,_0xa17065){var _0x5a3a6c=function(_0x5b30b0){while(--_0x5b30b0){_0x1936d5['push'](_0x1936d5['shift']());}};_0x5a3a6c(++_0xa17065);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x515386,_0x56f44e){_0x515386=_0x515386-0x0;var _0x3f7765=_0x6b8f[_0x515386];return _0x3f7765;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var jayson=require('jayson/promise');var schema=require(_0xf6b8('0x1'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xf6b8('0x2'));var ami=require(_0xf6b8('0x3'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0xf6b8('0x4')]=function(_0xf25536,_0x347a0b,_0x549eac){return new Promise(function(_0x2d035e,_0x79c66d){var _0x446336={'QueuePause':function(_0x3c3430){return new Promise(function(_0x557910){var _0x5f07f4=util[_0xf6b8('0x5')]('%s/%s',_0xf6b8('0x6'),_0x3c3430[_0xf6b8('0x7')]);if(_0xf25536[_0xf6b8('0x8')]&&_0xf25536[_0xf6b8('0x8')][_0x5f07f4]&&_0xf25536[_0xf6b8('0x8')][_0x5f07f4][_0xf6b8('0x9')]){_0xf25536['timers'][_0x5f07f4]['updateAcw']();}if(_0xf25536['agents'][_0x5f07f4]){_0xf25536[_0xf6b8('0xa')][_0x5f07f4][_0xf6b8('0xb')]({'statePause':_0x3c3430[_0xf6b8('0xc')]?!![]:![]});}_0x557910({'code':0xc8,'message':_0xf6b8('0xd')});});},'Reload':function(_0x5a6118){var _0x4e5235=this;return new Promise(function(_0x748e77,_0x3899a9){if(ami['isConnected']()==![]){return _0x3899a9(_0x4e5235[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')]['username'],_0xf6b8('0x10')]['join']('\x20')));}_0x5a6118=_[_0xf6b8('0x11')](_0x5a6118,_[_0xf6b8('0x12')](properties[_0xf6b8('0x13')][_0xf6b8('0x14')]));_0x5a6118[_0xf6b8('0x15')]='Reload';return ami['Action'](_0x5a6118)[_0xf6b8('0x16')](function(_0x56508b){_0x748e77({'code':0xc8,'message':_0x56508b[_0xf6b8('0x17')]});})[_0xf6b8('0x18')](function(_0x4a93a8){_0x3899a9(_0x4e5235['error'](0x1f5,_0x4a93a8[_0xf6b8('0x17')]));});});},'Command':function(_0x2e2b29){var _0x3081db=this;return new Promise(function(_0x2cac60,_0x4df5f4){if(ami['isConnected']()==![]){return _0x4df5f4(_0x3081db['error'](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],'ami\x20disconnected'][_0xf6b8('0x1a')]('\x20')));}_0x2e2b29=_[_0xf6b8('0x11')](_0x2e2b29,_0xf6b8('0x1b'));_0x2e2b29[_0xf6b8('0x15')]='Command';return ami[_0xf6b8('0x1c')](_0x2e2b29)['then'](function(_0x22c52d){_0x2cac60({'code':0xc8,'message':_0x22c52d[_0xf6b8('0x1d')]});})[_0xf6b8('0x18')](function(_0x4127c9){_0x4df5f4(_0x3081db[_0xf6b8('0xe')](0x1f5,_0x4127c9[_0xf6b8('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4edd29){var _0x1aca8a=[];for(var _0x1ebfea in _0xf25536['voiceQueues']){if(_0xf25536[_0xf6b8('0x1e')][_0xf6b8('0x1f')](_0x1ebfea)){var _0x324057=_0xf25536[_0xf6b8('0x1e')][_0x1ebfea];var _0x3365b8=new VoiceQueueSummary(_0x324057);_0x1aca8a['push'](_0x3365b8);}}_0x4edd29({'count':_0x1aca8a['length'],'rows':_0x1aca8a});});},'UpdateVoiceQueue':function(_0xfa77d3){return new Promise(function(_0x9050c6,_0x5a9514){var _0x459ed0=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x1e')],{'id':parseInt(_0xfa77d3['id'])});var _0x5a7f55=_[_0xf6b8('0x21')](_0xfa77d3,['id']);if(_0x459ed0){for(var _0xc958f4 in _0x5a7f55){if(typeof _0x5a7f55[_0xc958f4]!=='undefined'&&typeof _0x459ed0[_0xc958f4]!==_0xf6b8('0x22')){_0x459ed0[_0xc958f4]=_0x5a7f55[_0xc958f4];}}_0x9050c6(_0x459ed0);}else{_0x5a9514();}});},'VoiceChannels':function(){return new Promise(function(_0xfdf601){var _0x324eeb=_[_0xf6b8('0x23')](_0xf25536['channels']);_0xfdf601({'count':_0x324eeb[_0xf6b8('0x24')],'rows':_0x324eeb});});},'VoiceChannelMixMonitor':function(_0xd984c0){var _0x4006a6=this;return new Promise(function(_0x48b07f,_0x7c7546){if(ami[_0xf6b8('0x25')]()==![]){return _0x7c7546(_0x4006a6[_0xf6b8('0xe')](0x1f4,[config['asterisk']['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],_0xf6b8('0x10')][_0xf6b8('0x1a')]('\x20')));}var _0x4be3cb=schema(properties[_0xf6b8('0x26')])[_0xf6b8('0x1')](_0xd984c0);if(_0x4be3cb[_0xf6b8('0x24')]>0x0){return _0x7c7546(_0x4006a6['error'](0x1f4,_['map'](_0x4be3cb,_0xf6b8('0x17'))[_0xf6b8('0x1a')](',\x20')));}var _0x258e69=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x27')],{'uniqueid':_0xd984c0[_0xf6b8('0x28')]});if(_0x258e69&&_0x258e69[_0xf6b8('0x29')]){var _0x7aaa3c=util[_0xf6b8('0x5')](_0xf6b8('0x2a'),_0xd984c0[_0xf6b8('0x2b')]||_0xd984c0[_0xf6b8('0x28')],_0xd984c0[_0xf6b8('0x5')]||_0xf6b8('0x2c'));return ami[_0xf6b8('0x1c')]({'action':_0xf6b8('0x2d'),'channel':_0x258e69[_0xf6b8('0x29')],'file':_0x7aaa3c,'options':_0xf6b8('0x2e')})['then'](function(_0x54a675){var _0x2b1e36=_[_0xf6b8('0x20')](_0x258e69[_0xf6b8('0x2f')],{'filename':_0xf6b8('0x30')+_0x7aaa3c[_0xf6b8('0x31')]()});if(_[_0xf6b8('0x32')](_0x2b1e36)){_0x258e69[_0xf6b8('0x2f')][_0xf6b8('0x33')]({'filename':_0xf6b8('0x30')+_0x7aaa3c[_0xf6b8('0x31')](),'createdAt':moment()[_0xf6b8('0x5')](_0xf6b8('0x34')),'mixmonitorid':_0x54a675['mixmonitorid'],'status':_0xf6b8('0x35')});}else{_0x2b1e36[_0xf6b8('0x36')]=_0x54a675['mixmonitorid'];_0x2b1e36[_0xf6b8('0x37')]=_0xf6b8('0x35');}_0x48b07f({'code':0xc8,'message':[_0xd984c0[_0xf6b8('0x28')],_0xf6b8('0x38'),_0x54a675[_0xf6b8('0x36')]][_0xf6b8('0x1a')]('\x20'),'mixmonitorid':_0x54a675[_0xf6b8('0x36')]});})[_0xf6b8('0x18')](function(_0x1c42fe){_0x7c7546(_0x4006a6[_0xf6b8('0xe')](0x1f5,[_0xd984c0[_0xf6b8('0x28')],_0x1c42fe[_0xf6b8('0x17')][_0xf6b8('0x31')]()][_0xf6b8('0x1a')]('\x20')));});}else{return _0x7c7546(_0x4006a6['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5f42c2){var _0x3bb212=this;return new Promise(function(_0x2c68f5,_0x45daea){if(ami[_0xf6b8('0x25')]()==![]){return _0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')]['username'],_0xf6b8('0x10')]['join']('\x20')));}var _0x2040fb=schema(properties[_0xf6b8('0x26')])[_0xf6b8('0x1')](_0x5f42c2);if(_0x2040fb[_0xf6b8('0x24')]>0x0){return _0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f4,_['map'](_0x2040fb,_0xf6b8('0x17'))[_0xf6b8('0x1a')](',\x20')));}var _0x126850=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x27')],{'uniqueid':_0x5f42c2['uniqueid']});if(_0x126850){return Promise[_0xf6b8('0x39')]()[_0xf6b8('0x16')](function(){if(_0x126850[_0xf6b8('0x29')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x126850[_0xf6b8('0x29')],'mixmonitorid':_0x5f42c2[_0xf6b8('0x36')]})[_0xf6b8('0x18')](function(){});}})[_0xf6b8('0x16')](function(){if(_0x126850['destinationchannel']){return ami['Action']({'action':'StopMixMonitor','channel':_0x126850[_0xf6b8('0x3a')],'mixmonitorid':_0x5f42c2['mixmonitorid']})[_0xf6b8('0x18')](function(){});}})[_0xf6b8('0x16')](function(){var _0x12f582=_[_0xf6b8('0x20')](_0x126850[_0xf6b8('0x2f')],{'mixmonitorid':_0x5f42c2[_0xf6b8('0x36')]});if(_0x12f582){_0x12f582[_0xf6b8('0x37')]=_0xf6b8('0x3b');}})[_0xf6b8('0x16')](function(){var _0x597511=util[_0xf6b8('0x5')]('%s.%s',_0x5f42c2[_0xf6b8('0x2b')]||_0x5f42c2[_0xf6b8('0x28')],_0x5f42c2[_0xf6b8('0x5')]||_0xf6b8('0x2c'));var _0x1abf17=_[_0xf6b8('0x20')](_0x126850[_0xf6b8('0x2f')],{'filename':'/var/spool/asterisk/monitor/'+_0x597511[_0xf6b8('0x31')]()});if(_0x1abf17){_0x1abf17[_0xf6b8('0x37')]=_0xf6b8('0x3b');}})[_0xf6b8('0x16')](function(){_0x2c68f5({'code':0xc8,'message':[_0x5f42c2['uniqueid'],_0xf6b8('0x3c')][_0xf6b8('0x1a')]('\x20')});})['catch'](function(_0x3a38eb){_0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f5,[_0x5f42c2[_0xf6b8('0x28')],_0x3a38eb[_0xf6b8('0x17')][_0xf6b8('0x31')]()]['join']('\x20')));});}else{return _0x45daea(_0x3bb212[_0xf6b8('0xe')](0x1f5,_0xf6b8('0x3d')));}});},'VoiceQueuesChannels':function(_0x5754eb){var _0x497b26=this;return new Promise(function(_0x55c392){var _0x22c1eb=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x3e')]);var _0xc20eee={'count':_0x22c1eb['length'],'rows':_0x22c1eb};if(_0x5754eb&&_0x5754eb[_0xf6b8('0x3f')]){if(![_0xf6b8('0x40'),_0xf6b8('0x41')][_0xf6b8('0x42')](_0x5754eb[_0xf6b8('0x3f')])){return _0x79c66d(_0x497b26[_0xf6b8('0xe')](0x190,_0xf6b8('0x43')));}var _0x4e4c90=_['filter'](_0x22c1eb,function(_0x4b81a0){return _0x4b81a0[_0xf6b8('0x3f')]===_0x5754eb['type'];});_0xc20eee['count']=_0x4e4c90[_0xf6b8('0x24')];_0xc20eee[_0xf6b8('0x44')]=_0x4e4c90;}_0x55c392(_0xc20eee);});},'VoiceQueuesChannel':function(_0x15965a){var _0x25cf3d=this;return new Promise(function(_0x34ca51,_0x1190f3){var _0x4f78e0=schema(properties[_0xf6b8('0x45')])[_0xf6b8('0x1')](_0x15965a);if(_0x4f78e0[_0xf6b8('0x24')]>0x0){return _0x1190f3(_0x25cf3d[_0xf6b8('0xe')](0x1f4,_['map'](_0x4f78e0,_0xf6b8('0x17'))[_0xf6b8('0x1a')](',\x20')));}var _0x5c27b1=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x3e')],{'uniqueid':_0x15965a[_0xf6b8('0x28')]});if(_0x5c27b1){_0x34ca51(_0x5c27b1);}else{return _0x1190f3(_0x25cf3d['error'](0x1f5,_0xf6b8('0x3d')));}});},'VoiceQueuesChannelHangup':function(_0x38720f){var _0x3e8213=this;return new Promise(function(_0x8c5d73,_0x37db90){if(ami[_0xf6b8('0x25')]()==![]){return _0x37db90(_0x3e8213[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],_0xf6b8('0x10')][_0xf6b8('0x1a')]('\x20')));}var _0x5d124b=schema(properties['voicequeuechannelhangup'])['validate'](_0x38720f);if(_0x5d124b[_0xf6b8('0x24')]>0x0){return _0x37db90(_0x3e8213[_0xf6b8('0xe')](0x1f4,_[_0xf6b8('0x46')](_0x5d124b,_0xf6b8('0x17'))['join'](',\x20')));}var _0x1b7c82=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x3e')],{'uniqueid':_0x38720f['uniqueid']});if(_0x1b7c82&&_0x1b7c82[_0xf6b8('0x29')]){return ami[_0xf6b8('0x1c')]({'action':_0xf6b8('0x47'),'channel':_0x1b7c82['channel']})['then'](function(_0x9105bb){_0x8c5d73({'code':0xc8,'message':[_0x38720f[_0xf6b8('0x28')],_0x9105bb[_0xf6b8('0x17')][_0xf6b8('0x31')]()]['join']('\x20')});})[_0xf6b8('0x18')](function(_0x5ebf65){_0x37db90(_0x3e8213[_0xf6b8('0xe')](0x1f5,[_0x38720f[_0xf6b8('0x28')],_0x5ebf65[_0xf6b8('0x17')][_0xf6b8('0x31')]()][_0xf6b8('0x1a')]('\x20')));});}else{return _0x37db90(_0x3e8213['error'](0x1f5,_0xf6b8('0x3d')));}});},'VoiceQueuesChannelRedirect':function(_0x1f869b){var _0x227f5e=this;return new Promise(function(_0x28e1d7,_0x1980de){if(ami[_0xf6b8('0x25')]()==![]){return _0x1980de(_0x227f5e[_0xf6b8('0xe')](0x1f4,[config[_0xf6b8('0xf')]['ip'],config[_0xf6b8('0xf')][_0xf6b8('0x19')],'ami\x20disconnected'][_0xf6b8('0x1a')]('\x20')));}var _0x135ce3=schema(properties[_0xf6b8('0x48')])['validate'](_0x1f869b);if(_0x135ce3[_0xf6b8('0x24')]>0x0){return _0x1980de(_0x227f5e['error'](0x1f4,_[_0xf6b8('0x46')](_0x135ce3,'message')['join'](',\x20')));}var _0x3c4e8a=_[_0xf6b8('0x20')](_0xf25536[_0xf6b8('0x3e')],{'uniqueid':_0x1f869b[_0xf6b8('0x28')]});if(_0x3c4e8a&&_0x3c4e8a[_0xf6b8('0x29')]){return ami['Action']({'action':_0xf6b8('0x49'),'channel':_0x3c4e8a[_0xf6b8('0x29')],'exten':_0x1f869b['exten'],'context':_0x1f869b['context']||_0x3c4e8a[_0xf6b8('0x4a')],'priority':0x1})[_0xf6b8('0x16')](function(_0xdb1c77){_0x28e1d7({'code':0xc8,'message':[_0x1f869b[_0xf6b8('0x28')],_0xdb1c77[_0xf6b8('0x17')]['toLowerCase']()]['join']('\x20')});})[_0xf6b8('0x18')](function(_0x2d86fc){_0x1980de(_0x227f5e[_0xf6b8('0xe')](0x1f5,[_0x1f869b[_0xf6b8('0x28')],_0x2d86fc['message'][_0xf6b8('0x31')]()][_0xf6b8('0x1a')]('\x20')));});}else{return _0x1980de(_0x227f5e[_0xf6b8('0xe')](0x1f5,_0xf6b8('0x3d')));}});},'Agents':function(_0x3b06c8){return new Promise(function(_0x2e43a1){var _0x7a8ae6=_['values'](_0xf25536['agents']);if(_0x3b06c8&&_0x3b06c8['id']){var _0x2d32bb=_[_0xf6b8('0x20')](_0x7a8ae6,function(_0x3f3969){return _0x3f3969['id']===_0x3b06c8['id'];});_0x2e43a1(_0x2d32bb);}else{_0x2e43a1({'count':_0x7a8ae6[_0xf6b8('0x24')],'rows':_0x7a8ae6});}});},'Telephones':function(){return new Promise(function(_0x4707ff){var _0x19c149=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x4b')]);_0x4707ff({'count':_0x19c149['length'],'rows':_0x19c149});});},'Trunks':function(){return new Promise(function(_0x2d3bae){var _0x213a14=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x4c')]);_0x2d3bae({'count':_0x213a14[_0xf6b8('0x24')],'rows':_0x213a14});});},'OutboundChannels':function(){return new Promise(function(_0x55f2ae){var _0x3af46c=_['values'](_0xf25536[_0xf6b8('0x4d')]);_0x55f2ae({'count':_0x3af46c[_0xf6b8('0x24')],'rows':_0x3af46c});});},'Outbound':function(){return new Promise(function(_0x2d6261){_0x2d6261(_0xf25536[_0xf6b8('0x41')]);});},'Campaigns':function(){return new Promise(function(_0x141d6a){var _0x4492f6=_['values'](_0xf25536[_0xf6b8('0x4e')]);_0x141d6a({'count':_0x4492f6[_0xf6b8('0x24')],'rows':_0x4492f6});});},'VoiceQueuesPreview':function(_0x1c6692){var _0x3d76ee=this;return new Promise(function(_0x396a7c,_0x3d6e09){_0x347a0b[_0xf6b8('0x4f')](_0x1c6692['id'])['then'](function(_0x288449){_0x396a7c({'code':0xc8,'message':_0x288449[_0xf6b8('0x17')]});})['catch'](function(_0x286e8d){_0x3d6e09(_0x3d76ee[_0xf6b8('0xe')](0x1f4,_0x286e8d[_0xf6b8('0x17')]));});});},'EventManager':function(_0x288b94){var _0x57fcdb=this;return new Promise(function(_0x23ef5e,_0x452de0){if(!_0x288b94[_0xf6b8('0x50')]){return _0x452de0(_0x57fcdb['error'](0x1f4,_0xf6b8('0x51')));}ami['emit']('custom:'+_0x288b94[_0xf6b8('0x50')],_0x288b94[_0xf6b8('0x17')]);_0x23ef5e({'code':0xc8,'message':_0x288b94});});},'FaxAccounts':function(){return new Promise(function(_0x36a84c){var _0x2b1c7d=_[_0xf6b8('0x23')](_0xf25536[_0xf6b8('0x52')]);_0x36a84c({'count':_0x2b1c7d[_0xf6b8('0x24')],'rows':_0x2b1c7d});});},'SendFax':function(_0x2e66bf){var _0x3292d3=this;return new Promise(function(_0x18949a,_0xa03ad3){_0x549eac[_0xf6b8('0x53')](_0x2e66bf)[_0xf6b8('0x16')](function(_0x4684b2){_0x18949a({'code':0xc8,'message':_0x4684b2[_0xf6b8('0x17')]});})['catch'](function(_0x4d9845){_0xa03ad3(_0x3292d3[_0xf6b8('0xe')](0x1f4,_0x4d9845[_0xf6b8('0x17')]));});});},'CheckAfterSend':function(_0x5b113b){var _0x171db9=this;return new Promise(function(_0x1b4dee,_0x3b4df4){_0x549eac[_0xf6b8('0x54')](_0x5b113b)['then'](function(_0x3cd8fc){_0x1b4dee({'code':0xc8,'message':_0x3cd8fc[_0xf6b8('0x17')]});})[_0xf6b8('0x18')](function(_0x48829d){_0x3b4df4(_0x171db9['error'](0x1f4,_0x48829d['message']));});});}};var _0x3e174b=jayson[_0xf6b8('0x55')](_0x446336)['http']();_0x3e174b['on'](_0xf6b8('0xe'),function(_0x51800b){return _0x79c66d(_0x51800b);});_0x3e174b[_0xf6b8('0x4')](0x232a,_0xf6b8('0x56'),function(){console['log'](_0xf6b8('0x57'),0x232a);return _0x2d035e(_0xf6b8('0x58')+0x232a);});});}; \ No newline at end of file +var _0x207c=['ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','toLowerCase','StopMixMonitor\x20Success','outbound','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','type','count','rows','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','timer','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','message','catch','pick','command','Command','then','content','voiceQueues','hasOwnProperty','push','find','omit','undefined','values','channels','length','voicechannel','uniqueid','channel','wav'];(function(_0x2dffd7,_0x50e766){var _0x55e83f=function(_0x1cf727){while(--_0x1cf727){_0x2dffd7['push'](_0x2dffd7['shift']());}};_0x55e83f(++_0x50e766);}(_0x207c,0x1e8));var _0xc207=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0x207c[_0x21e97b];return _0x10ba44;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var jayson=require(_0xc207('0x1'));var schema=require(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var config=require(_0xc207('0x4'));var properties=require(_0xc207('0x5'));var ami=require(_0xc207('0x6'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0xc207('0x7')]=function(_0x59bc89,_0x5a727b,_0x55023e){return new Promise(function(_0xc88789,_0x314561){var _0x3395e4={'QueuePause':function(_0x59ff6f){return new Promise(function(_0x25cb97){var _0xad159b=util[_0xc207('0x8')]('%s/%s',_0xc207('0x9'),_0x59ff6f[_0xc207('0xa')]);if(_0x59bc89[_0xc207('0xb')]&&_0x59bc89[_0xc207('0xb')][_0xad159b]&&_0x59bc89[_0xc207('0xb')][_0xad159b][_0xc207('0xc')]){_0x59bc89['timers'][_0xad159b]['updateAcw']();}if(_0x59bc89['agents'][_0xad159b]){_0x59bc89[_0xc207('0xd')][_0xad159b]['updateStatusRealtime']({'statePause':_0x59ff6f[_0xc207('0xe')]?!![]:![]});}_0x25cb97({'code':0xc8,'message':_0xc207('0xf')});});},'Reload':function(_0x59d401){var _0x3e1108=this;return new Promise(function(_0xb86b06,_0x3062f5){if(ami[_0xc207('0x10')]()==![]){return _0x3062f5(_0x3e1108[_0xc207('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xc207('0x12')][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}_0x59d401=_['pick'](_0x59d401,_['keys'](properties['reload'][_0xc207('0x16')]));_0x59d401[_0xc207('0x17')]=_0xc207('0x18');return ami[_0xc207('0x19')](_0x59d401)['then'](function(_0x1bc70c){_0xb86b06({'code':0xc8,'message':_0x1bc70c[_0xc207('0x1a')]});})[_0xc207('0x1b')](function(_0x5f288e){_0x3062f5(_0x3e1108[_0xc207('0x11')](0x1f5,_0x5f288e['message']));});});},'Command':function(_0x42c8ba){var _0x33ddb1=this;return new Promise(function(_0x131dc8,_0x461f6a){if(ami[_0xc207('0x10')]()==![]){return _0x461f6a(_0x33ddb1[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config[_0xc207('0x12')][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}_0x42c8ba=_[_0xc207('0x1c')](_0x42c8ba,_0xc207('0x1d'));_0x42c8ba['action']=_0xc207('0x1e');return ami['Action'](_0x42c8ba)[_0xc207('0x1f')](function(_0x3ac142){_0x131dc8({'code':0xc8,'message':_0x3ac142[_0xc207('0x20')]});})[_0xc207('0x1b')](function(_0x3539f4){_0x461f6a(_0x33ddb1[_0xc207('0x11')](0x1f5,_0x3539f4[_0xc207('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x1493fb){var _0xa52138=[];for(var _0x2385f7 in _0x59bc89[_0xc207('0x21')]){if(_0x59bc89[_0xc207('0x21')][_0xc207('0x22')](_0x2385f7)){var _0x138970=_0x59bc89[_0xc207('0x21')][_0x2385f7];var _0x56a066=new VoiceQueueSummary(_0x138970);_0xa52138[_0xc207('0x23')](_0x56a066);}}_0x1493fb({'count':_0xa52138['length'],'rows':_0xa52138});});},'UpdateVoiceQueue':function(_0x4cb3af){return new Promise(function(_0x18ef72,_0x3a05f3){var _0x2e41b1=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x21')],{'id':parseInt(_0x4cb3af['id'])});var _0x478af7=_[_0xc207('0x25')](_0x4cb3af,['id']);if(_0x2e41b1){for(var _0x463ac8 in _0x478af7){if(typeof _0x478af7[_0x463ac8]!==_0xc207('0x26')&&typeof _0x2e41b1[_0x463ac8]!==_0xc207('0x26')){_0x2e41b1[_0x463ac8]=_0x478af7[_0x463ac8];}}_0x18ef72(_0x2e41b1);}else{_0x3a05f3();}});},'VoiceChannels':function(){return new Promise(function(_0x11a647){var _0x2ce847=_[_0xc207('0x27')](_0x59bc89[_0xc207('0x28')]);_0x11a647({'count':_0x2ce847[_0xc207('0x29')],'rows':_0x2ce847});});},'VoiceChannelMixMonitor':function(_0x3f79e8){var _0x2043cf=this;return new Promise(function(_0xaa1b54,_0x3cd4b4){if(ami['isConnected']()==![]){return _0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config[_0xc207('0x12')][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x47d4c9=schema(properties[_0xc207('0x2a')])[_0xc207('0x2')](_0x3f79e8);if(_0x47d4c9[_0xc207('0x29')]>0x0){return _0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f4,_['map'](_0x47d4c9,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0x3b05fd=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x28')],{'uniqueid':_0x3f79e8[_0xc207('0x2b')]});if(_0x3b05fd&&_0x3b05fd[_0xc207('0x2c')]){var _0x458de9=util[_0xc207('0x8')]('%s.%s',_0x3f79e8['filename']||_0x3f79e8[_0xc207('0x2b')],_0x3f79e8[_0xc207('0x8')]||_0xc207('0x2d'));return ami[_0xc207('0x19')]({'action':'MixMonitor','channel':_0x3b05fd[_0xc207('0x2c')],'file':_0x458de9,'options':_0xc207('0x2e')})[_0xc207('0x1f')](function(_0x2a1c60){var _0x1fa850=_['find'](_0x3b05fd[_0xc207('0x2f')],{'filename':_0xc207('0x30')+_0x458de9['toLowerCase']()});if(_[_0xc207('0x31')](_0x1fa850)){_0x3b05fd['monitors'][_0xc207('0x23')]({'filename':_0xc207('0x30')+_0x458de9['toLowerCase'](),'createdAt':moment()[_0xc207('0x8')](_0xc207('0x32')),'mixmonitorid':_0x2a1c60[_0xc207('0x33')],'status':'rec'});}else{_0x1fa850['mixmonitorid']=_0x2a1c60[_0xc207('0x33')];_0x1fa850[_0xc207('0x34')]=_0xc207('0x35');}_0xaa1b54({'code':0xc8,'message':[_0x3f79e8[_0xc207('0x2b')],'MixMonitor\x20Success',_0x2a1c60[_0xc207('0x33')]]['join']('\x20'),'mixmonitorid':_0x2a1c60['mixmonitorid']});})['catch'](function(_0x5c05fb){_0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f5,[_0x3f79e8[_0xc207('0x2b')],_0x5c05fb[_0xc207('0x1a')]['toLowerCase']()][_0xc207('0x15')]('\x20')));});}else{return _0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f5,_0xc207('0x36')));}});},'VoiceChannelStopMixMonitor':function(_0x5ae1ab){var _0x48efac=this;return new Promise(function(_0x47d43a,_0x223349){if(ami[_0xc207('0x10')]()==![]){return _0x223349(_0x48efac[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config['asterisk'][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x471a85=schema(properties[_0xc207('0x2a')])[_0xc207('0x2')](_0x5ae1ab);if(_0x471a85[_0xc207('0x29')]>0x0){return _0x223349(_0x48efac[_0xc207('0x11')](0x1f4,_[_0xc207('0x37')](_0x471a85,'message')[_0xc207('0x15')](',\x20')));}var _0x16ed4f=_['find'](_0x59bc89[_0xc207('0x28')],{'uniqueid':_0x5ae1ab[_0xc207('0x2b')]});if(_0x16ed4f){return Promise[_0xc207('0x38')]()[_0xc207('0x1f')](function(){if(_0x16ed4f[_0xc207('0x2c')]){return ami['Action']({'action':_0xc207('0x39'),'channel':_0x16ed4f[_0xc207('0x2c')],'mixmonitorid':_0x5ae1ab[_0xc207('0x33')]})['catch'](function(){});}})[_0xc207('0x1f')](function(){if(_0x16ed4f[_0xc207('0x3a')]){return ami[_0xc207('0x19')]({'action':_0xc207('0x39'),'channel':_0x16ed4f['destinationchannel'],'mixmonitorid':_0x5ae1ab['mixmonitorid']})[_0xc207('0x1b')](function(){});}})[_0xc207('0x1f')](function(){var _0x45fa1d=_[_0xc207('0x24')](_0x16ed4f[_0xc207('0x2f')],{'mixmonitorid':_0x5ae1ab[_0xc207('0x33')]});if(_0x45fa1d){_0x45fa1d[_0xc207('0x34')]=_0xc207('0x3b');}})[_0xc207('0x1f')](function(){var _0x212552=util[_0xc207('0x8')](_0xc207('0x3c'),_0x5ae1ab['filename']||_0x5ae1ab['uniqueid'],_0x5ae1ab[_0xc207('0x8')]||_0xc207('0x2d'));var _0x2468d0=_['find'](_0x16ed4f[_0xc207('0x2f')],{'filename':_0xc207('0x30')+_0x212552[_0xc207('0x3d')]()});if(_0x2468d0){_0x2468d0[_0xc207('0x34')]='stop';}})[_0xc207('0x1f')](function(){_0x47d43a({'code':0xc8,'message':[_0x5ae1ab['uniqueid'],_0xc207('0x3e')]['join']('\x20')});})['catch'](function(_0x21d9b5){_0x223349(_0x48efac[_0xc207('0x11')](0x1f5,[_0x5ae1ab['uniqueid'],_0x21d9b5['message']['toLowerCase']()][_0xc207('0x15')]('\x20')));});}else{return _0x223349(_0x48efac[_0xc207('0x11')](0x1f5,_0xc207('0x36')));}});},'VoiceQueuesChannels':function(_0x1acc33){var _0x173acf=this;return new Promise(function(_0x35e967){var _0x3dc457=_[_0xc207('0x27')](_0x59bc89['queueChannels']);var _0x26bcfe={'count':_0x3dc457[_0xc207('0x29')],'rows':_0x3dc457};if(_0x1acc33&&_0x1acc33['type']){if(!['inbound',_0xc207('0x3f')]['includes'](_0x1acc33['type'])){return _0x314561(_0x173acf[_0xc207('0x11')](0x190,_0xc207('0x40')));}var _0x356c8c=_[_0xc207('0x41')](_0x3dc457,function(_0x3583b8){return _0x3583b8[_0xc207('0x42')]===_0x1acc33[_0xc207('0x42')];});_0x26bcfe[_0xc207('0x43')]=_0x356c8c[_0xc207('0x29')];_0x26bcfe[_0xc207('0x44')]=_0x356c8c;}_0x35e967(_0x26bcfe);});},'VoiceQueuesChannel':function(_0x2fcfee){var _0x5cd180=this;return new Promise(function(_0x529a21,_0x42d9a0){var _0x246f5b=schema(properties[_0xc207('0x45')])[_0xc207('0x2')](_0x2fcfee);if(_0x246f5b[_0xc207('0x29')]>0x0){return _0x42d9a0(_0x5cd180[_0xc207('0x11')](0x1f4,_[_0xc207('0x37')](_0x246f5b,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0x49e724=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x46')],{'uniqueid':_0x2fcfee[_0xc207('0x2b')]});if(_0x49e724){_0x529a21(_0x49e724);}else{return _0x42d9a0(_0x5cd180[_0xc207('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x448f14){var _0x22cdf9=this;return new Promise(function(_0x22625d,_0x409b2d){if(ami[_0xc207('0x10')]()==![]){return _0x409b2d(_0x22cdf9[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config['asterisk'][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x298342=schema(properties['voicequeuechannelhangup'])[_0xc207('0x2')](_0x448f14);if(_0x298342['length']>0x0){return _0x409b2d(_0x22cdf9['error'](0x1f4,_[_0xc207('0x37')](_0x298342,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0x2ebda4=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x46')],{'uniqueid':_0x448f14[_0xc207('0x2b')]});if(_0x2ebda4&&_0x2ebda4[_0xc207('0x2c')]){return ami[_0xc207('0x19')]({'action':_0xc207('0x47'),'channel':_0x2ebda4[_0xc207('0x2c')]})[_0xc207('0x1f')](function(_0x416e85){_0x22625d({'code':0xc8,'message':[_0x448f14[_0xc207('0x2b')],_0x416e85[_0xc207('0x1a')]['toLowerCase']()][_0xc207('0x15')]('\x20')});})['catch'](function(_0x29b49a){_0x409b2d(_0x22cdf9[_0xc207('0x11')](0x1f5,[_0x448f14[_0xc207('0x2b')],_0x29b49a['message']['toLowerCase']()][_0xc207('0x15')]('\x20')));});}else{return _0x409b2d(_0x22cdf9[_0xc207('0x11')](0x1f5,_0xc207('0x36')));}});},'VoiceQueuesChannelRedirect':function(_0x51a3c1){var _0x31182c=this;return new Promise(function(_0x1cefa3,_0x3509d8){if(ami['isConnected']()==![]){return _0x3509d8(_0x31182c['error'](0x1f4,[config[_0xc207('0x12')]['ip'],config['asterisk'][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x4b197=schema(properties[_0xc207('0x48')])[_0xc207('0x2')](_0x51a3c1);if(_0x4b197[_0xc207('0x29')]>0x0){return _0x3509d8(_0x31182c[_0xc207('0x11')](0x1f4,_['map'](_0x4b197,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0xa34ab5=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x46')],{'uniqueid':_0x51a3c1[_0xc207('0x2b')]});if(_0xa34ab5&&_0xa34ab5[_0xc207('0x2c')]){return ami[_0xc207('0x19')]({'action':_0xc207('0x49'),'channel':_0xa34ab5[_0xc207('0x2c')],'exten':_0x51a3c1[_0xc207('0x4a')],'context':_0x51a3c1['context']||_0xa34ab5[_0xc207('0x4b')],'priority':0x1})[_0xc207('0x1f')](function(_0x45b4fb){_0x1cefa3({'code':0xc8,'message':[_0x51a3c1[_0xc207('0x2b')],_0x45b4fb['message']['toLowerCase']()][_0xc207('0x15')]('\x20')});})[_0xc207('0x1b')](function(_0x34f784){_0x3509d8(_0x31182c[_0xc207('0x11')](0x1f5,[_0x51a3c1['uniqueid'],_0x34f784[_0xc207('0x1a')][_0xc207('0x3d')]()][_0xc207('0x15')]('\x20')));});}else{return _0x3509d8(_0x31182c['error'](0x1f5,_0xc207('0x36')));}});},'Agents':function(_0x369b2d){return new Promise(function(_0x322b68){var _0x5a8241=_[_0xc207('0x27')](_0x59bc89['agents']);if(_0x369b2d&&_0x369b2d['id']){var _0x1290e4=_['find'](_0x5a8241,function(_0xf68aae){return _0xf68aae['id']===_0x369b2d['id'];});_0x322b68(_0x1290e4);}else{_0x322b68({'count':_0x5a8241[_0xc207('0x29')],'rows':_0x5a8241});}});},'Telephones':function(){return new Promise(function(_0x598fdb){var _0x2e0ead=_['values'](_0x59bc89[_0xc207('0x4c')]);_0x598fdb({'count':_0x2e0ead[_0xc207('0x29')],'rows':_0x2e0ead});});},'Trunks':function(){return new Promise(function(_0x3fad98){var _0x177e74=_[_0xc207('0x27')](_0x59bc89['trunks']);_0x3fad98({'count':_0x177e74['length'],'rows':_0x177e74});});},'OutboundChannels':function(){return new Promise(function(_0x3d1659){var _0x28b166=_['values'](_0x59bc89[_0xc207('0x4d')]);_0x3d1659({'count':_0x28b166[_0xc207('0x29')],'rows':_0x28b166});});},'Outbound':function(){return new Promise(function(_0x52d7f1){_0x52d7f1(_0x59bc89[_0xc207('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0x13954e){var _0x4fca05=_[_0xc207('0x27')](_0x59bc89[_0xc207('0x4e')]);_0x13954e({'count':_0x4fca05[_0xc207('0x29')],'rows':_0x4fca05});});},'VoiceQueuesPreview':function(_0x1d550d){var _0x13c415=this;return new Promise(function(_0xef037c,_0x5be1e7){_0x5a727b['run'](_0x1d550d['id'])[_0xc207('0x1f')](function(_0x237df5){_0xef037c({'code':0xc8,'message':_0x237df5[_0xc207('0x1a')]});})[_0xc207('0x1b')](function(_0x7fd1a3){_0x5be1e7(_0x13c415['error'](0x1f4,_0x7fd1a3[_0xc207('0x1a')]));});});},'EventManager':function(_0x4f79b3){var _0x6b1089=this;return new Promise(function(_0x97f43,_0x47145a){if(!_0x4f79b3[_0xc207('0x4f')]){return _0x47145a(_0x6b1089[_0xc207('0x11')](0x1f4,_0xc207('0x50')));}ami['emit'](_0xc207('0x51')+_0x4f79b3[_0xc207('0x4f')],_0x4f79b3['message']);_0x97f43({'code':0xc8,'message':_0x4f79b3});});},'FaxAccounts':function(){return new Promise(function(_0x1e5aaf){var _0xf2f689=_[_0xc207('0x27')](_0x59bc89[_0xc207('0x52')]);_0x1e5aaf({'count':_0xf2f689[_0xc207('0x29')],'rows':_0xf2f689});});},'SendFax':function(_0x42d79e){var _0x9be0d2=this;return new Promise(function(_0x3a552c,_0x3bd56c){_0x55023e[_0xc207('0x53')](_0x42d79e)[_0xc207('0x1f')](function(_0x28d245){_0x3a552c({'code':0xc8,'message':_0x28d245[_0xc207('0x1a')]});})['catch'](function(_0x32a7ad){_0x3bd56c(_0x9be0d2[_0xc207('0x11')](0x1f4,_0x32a7ad[_0xc207('0x1a')]));});});},'CheckAfterSend':function(_0x266e65){var _0x48bed7=this;return new Promise(function(_0x327b9f,_0x49f0db){_0x55023e[_0xc207('0x54')](_0x266e65)['then'](function(_0x53cb21){_0x327b9f({'code':0xc8,'message':_0x53cb21[_0xc207('0x1a')]});})[_0xc207('0x1b')](function(_0x383f83){_0x49f0db(_0x48bed7[_0xc207('0x11')](0x1f4,_0x383f83[_0xc207('0x1a')]));});});}};var _0x1bdd51=jayson['server'](_0x3395e4)[_0xc207('0x55')]();_0x1bdd51['on']('error',function(_0x3bb53a){return _0x314561(_0x3bb53a);});_0x1bdd51[_0xc207('0x7')](0x232a,_0xc207('0x56'),function(){console[_0xc207('0x57')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xc88789(_0xc207('0x58')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 1eda97c..29c35fb 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c8b=['redis','defaults','localhost','socket.io-emitter','info','exec','data2','data5','xmd-contactid','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','ListId','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','bluebird','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x169e1f,_0x101e5d){_0x169e1f=_0x169e1f-0x0;var _0x187d4f=_0x3c8b[_0x169e1f];return _0x187d4f;};'use strict';var _=require('lodash');var BPromise=require(_0xb3c8('0x0'));var Redis=require('ioredis');var util=require(_0xb3c8('0x1'));var config=require(_0xb3c8('0x2'));var logger=require(_0xb3c8('0x3'))('trigger');var cmContactRpc=require(_0xb3c8('0x4'));config[_0xb3c8('0x5')]=_[_0xb3c8('0x6')](config[_0xb3c8('0x5')],{'host':_0xb3c8('0x7'),'port':0x18eb});var io=require(_0xb3c8('0x8'))(new Redis(config[_0xb3c8('0x5')]));function emit(_0x375af0,_0x47aa5b,_0x13c8f3,_0x5ec6a7,_0x460956){logger[_0xb3c8('0x9')]('[CM][%s][%s]',_0x375af0,_0x47aa5b['id'],_0x13c8f3,_0x5ec6a7,JSON['stringify'](_0x460956));io['to'](_0x13c8f3)['emit'](_0x5ec6a7,_0x460956);}exports[_0xb3c8('0xa')]=function(_0x363230,_0xdf4041,_0x508b1f,_0x3f88f6){var _0x12963c,_0x21eac8;var _0x135ee8={};var _0x5427a9;var _0x1048ae=Number(_0x508b1f['data1']);var _0x4c2d04=_0x508b1f['data2']?Boolean(Number(_0x508b1f[_0xb3c8('0xb')])):![];var _0x36a816;var _0x34d866=![];if(!_['isNil'](_0x508b1f['data5'])){if(_0x508b1f[_0xb3c8('0xc')]=='1')_0x34d866=!![];}if(!_0x34d866){if(_0x3f88f6[_0xb3c8('0xd')]){_0x135ee8['id']=_0x3f88f6[_0xb3c8('0xd')];}}if(!_0x135ee8['id']){_0x135ee8['ListId']=_0x1048ae;_0x36a816=_0x508b1f['data3']&&_0x508b1f[_0xb3c8('0xe')]!=='0'?_0x508b1f[_0xb3c8('0xe')][_0xb3c8('0xf')](','):['phone'];_0x135ee8[_0xb3c8('0x10')]=_[_0xb3c8('0x11')](_0x36a816,function(_0x385f8b){var _0x401b55={};_0x401b55[_0x385f8b]=_0x3f88f6[_0xb3c8('0x12')]?_0x3f88f6[_0xb3c8('0x13')]:_0x3f88f6[_0xb3c8('0x14')];return _0x401b55;});_0x5427a9=_0x3f88f6[_0xb3c8('0x12')]?_0x3f88f6[_0xb3c8('0x13')]:_0x3f88f6['calleridnum'];}var _0x58db91=['id',_0xb3c8('0x15'),'lastName','phone',_0xb3c8('0x16'),'fax',_0xb3c8('0x17'),'createdAt','scheduledAt',_0xb3c8('0x18')];var _0x50fa67=_[_0xb3c8('0x19')](_0x58db91,_0x36a816);BPromise[_0xb3c8('0x1a')]()[_0xb3c8('0x1b')](cmContactRpc['getContacts']({'attributes':_0x50fa67,'where':_0x135ee8,'phone':_0x5427a9}))[_0xb3c8('0x1b')](function(_0x541df4){_0x21eac8=_0x541df4;if(!_[_0xb3c8('0x1c')](_0x21eac8)){if(_0x21eac8[_0xb3c8('0x1d')]===0x1){_0x12963c=_0x21eac8[0x0];logger[_0xb3c8('0x9')](_0xb3c8('0x1e'),_0x3f88f6[_0xb3c8('0x1f')],_0xdf4041['id'],_0x12963c['id']);}else{logger[_0xb3c8('0x9')](_0xb3c8('0x20'),_0x3f88f6[_0xb3c8('0x1f')],_0xdf4041['id'],_[_0xb3c8('0x11')](_0x21eac8,'id')['join'](','));}return;}else{logger[_0xb3c8('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x3f88f6[_0xb3c8('0x1f')],_0xdf4041['id']);var _0x1c5bca={'ListId':_0x1048ae};var _0x2ef1ad=_0x508b1f[_0xb3c8('0x21')]&&_0x508b1f['data4']!=='0'?_0x508b1f[_0xb3c8('0x21')]:_0xb3c8('0x22');if(_0x4c2d04){logger[_0xb3c8('0x9')](_0xb3c8('0x23'),_0x3f88f6[_0xb3c8('0x1f')],_0xdf4041['id']);_0x1c5bca[_0x2ef1ad]=_[_0xb3c8('0x24')](_0x3f88f6[_0xb3c8('0x12')])?_0x3f88f6['calleridnum']:_0x3f88f6[_0xb3c8('0x13')];if(_[_0xb3c8('0x24')](_0x3f88f6['routeId'])){_0x1c5bca[_0xb3c8('0x15')]=_0x3f88f6[_0xb3c8('0x25')]&&_0x3f88f6[_0xb3c8('0x25')]!==_0xb3c8('0x26')?_0x3f88f6[_0xb3c8('0x25')]:_0xb3c8('0x27');}else{_0x1c5bca[_0xb3c8('0x15')]=_0x3f88f6['destcalleridname']&&_0x3f88f6[_0xb3c8('0x28')]!==_0xb3c8('0x26')?_0x3f88f6[_0xb3c8('0x28')]:_0xb3c8('0x27');}return BPromise[_0xb3c8('0x1a')]()['then'](cmContactRpc[_0xb3c8('0x29')](_0x1c5bca))[_0xb3c8('0x1b')](function(_0x44a840){_0x12963c=_0x44a840;_0x21eac8[_0xb3c8('0x2a')](_0x44a840);if(_0x12963c){logger[_0xb3c8('0x9')](_0xb3c8('0x2b'),_0x3f88f6[_0xb3c8('0x1f')],_0xdf4041['id'],_0x12963c['id']);}return;});}else{logger[_0xb3c8('0x9')](_0xb3c8('0x2c'),_0x3f88f6['uniqueid'],_0xdf4041['id']);_0x1c5bca[_0x2ef1ad]=_[_0xb3c8('0x24')](_0x3f88f6['routeId'])?_0x3f88f6[_0xb3c8('0x14')]:_0x3f88f6[_0xb3c8('0x13')];if(_[_0xb3c8('0x24')](_0x3f88f6[_0xb3c8('0x12')])){_0x1c5bca[_0xb3c8('0x15')]=_0x3f88f6[_0xb3c8('0x25')]&&_0x3f88f6['calleridname']!==_0xb3c8('0x26')?_0x3f88f6['calleridname']:_0xb3c8('0x27');}else{_0x1c5bca[_0xb3c8('0x15')]=_0x3f88f6[_0xb3c8('0x28')]&&_0x3f88f6[_0xb3c8('0x28')]!==''?_0x3f88f6[_0xb3c8('0x28')]:_0xb3c8('0x27');}_0x12963c=_0x1c5bca;_0x21eac8[_0xb3c8('0x2a')](_0x1c5bca);return;}}})[_0xb3c8('0x1b')](function(){if(_0x363230){emit(_0x3f88f6[_0xb3c8('0x1f')],_0xdf4041,util[_0xb3c8('0x2d')]('user:%s',_0x363230[_0xb3c8('0x2e')]),util[_0xb3c8('0x2d')](_0xb3c8('0x2f'),_0x508b1f[_0xb3c8('0x30')][_0xb3c8('0x31')]()),{'evt':_['merge'](_0x3f88f6,{'autoCreate':_0x4c2d04}),'contact':_0x12963c===undefined?{}:_0x12963c,'contacts':_0x21eac8['length']===0x0?undefined:_0x21eac8});}});}; \ No newline at end of file +var _0xcc04=['','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','calleridnum','destcalleridnum','firstName','mobile','fax','createdAt','scheduledAt','union','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname'];(function(_0x1a7991,_0x1e5ec4){var _0xf98856=function(_0x536d71){while(--_0x536d71){_0x1a7991['push'](_0x1a7991['shift']());}};_0xf98856(++_0x1e5ec4);}(_0xcc04,0x1c8));var _0x4cc0=function(_0x4286ee,_0x2f1d8e){_0x4286ee=_0x4286ee-0x0;var _0x2da14a=_0xcc04[_0x4286ee];return _0x2da14a;};'use strict';var _=require(_0x4cc0('0x0'));var BPromise=require(_0x4cc0('0x1'));var Redis=require(_0x4cc0('0x2'));var util=require(_0x4cc0('0x3'));var config=require(_0x4cc0('0x4'));var logger=require(_0x4cc0('0x5'))(_0x4cc0('0x6'));var cmContactRpc=require(_0x4cc0('0x7'));config[_0x4cc0('0x8')]=_[_0x4cc0('0x9')](config['redis'],{'host':_0x4cc0('0xa'),'port':0x18eb});var io=require(_0x4cc0('0xb'))(new Redis(config['redis']));function emit(_0x34f8a9,_0x23dbc9,_0x17f22f,_0x434b93,_0x510e5d){logger[_0x4cc0('0xc')](_0x4cc0('0xd'),_0x34f8a9,_0x23dbc9['id'],_0x17f22f,_0x434b93,JSON[_0x4cc0('0xe')](_0x510e5d));io['to'](_0x17f22f)['emit'](_0x434b93,_0x510e5d);}exports[_0x4cc0('0xf')]=function(_0x4c2b09,_0x3c7d2e,_0x4ce269,_0x2c7149){var _0x86216c,_0x572720;var _0x304caf={};var _0x908ae3;var _0x2758c7=Number(_0x4ce269[_0x4cc0('0x10')]);var _0x2da707=_0x4ce269[_0x4cc0('0x11')]?Boolean(Number(_0x4ce269[_0x4cc0('0x11')])):![];var _0x3d09ce;var _0x279a13=![];if(!_[_0x4cc0('0x12')](_0x4ce269['data5'])){if(_0x4ce269[_0x4cc0('0x13')]=='1')_0x279a13=!![];}if(!_0x279a13){if(_0x2c7149[_0x4cc0('0x14')]){_0x304caf['id']=_0x2c7149[_0x4cc0('0x14')];}}if(!_0x304caf['id']){_0x304caf[_0x4cc0('0x15')]=_0x2758c7;_0x3d09ce=_0x4ce269[_0x4cc0('0x16')]&&_0x4ce269[_0x4cc0('0x16')]!=='0'?_0x4ce269['data3'][_0x4cc0('0x17')](','):[_0x4cc0('0x18')];_0x304caf[_0x4cc0('0x19')]=_['map'](_0x3d09ce,function(_0x847c58){var _0x4e3f17={};_0x4e3f17[_0x847c58]=_0x2c7149[_0x4cc0('0x1a')]?_0x2c7149['destcalleridnum']:_0x2c7149[_0x4cc0('0x1b')];return _0x4e3f17;});_0x908ae3=_0x2c7149[_0x4cc0('0x1a')]?_0x2c7149[_0x4cc0('0x1c')]:_0x2c7149[_0x4cc0('0x1b')];}var _0x131ad9=['id',_0x4cc0('0x1d'),'lastName',_0x4cc0('0x18'),_0x4cc0('0x1e'),_0x4cc0('0x1f'),_0x4cc0('0x15'),_0x4cc0('0x20'),_0x4cc0('0x21'),'updatedAt'];var _0x2ebb56=_[_0x4cc0('0x22')](_0x131ad9,_0x3d09ce);BPromise['resolve']()[_0x4cc0('0x23')](cmContactRpc['getContacts']({'attributes':_0x2ebb56,'where':_0x304caf,'phone':_0x908ae3}))['then'](function(_0x302eb8){_0x572720=_0x302eb8;if(!_[_0x4cc0('0x24')](_0x572720)){if(_0x572720[_0x4cc0('0x25')]===0x1){_0x86216c=_0x572720[0x0];logger[_0x4cc0('0xc')](_0x4cc0('0x26'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id'],_0x86216c['id']);}else{logger[_0x4cc0('0xc')](_0x4cc0('0x28'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id'],_[_0x4cc0('0x29')](_0x572720,'id')[_0x4cc0('0x2a')](','));}return;}else{logger[_0x4cc0('0xc')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id']);var _0x946f23={'ListId':_0x2758c7};var _0x1a60bb=_0x4ce269[_0x4cc0('0x2b')]&&_0x4ce269['data4']!=='0'?_0x4ce269[_0x4cc0('0x2b')]:_0x4cc0('0x18');if(_0x2da707){logger[_0x4cc0('0xc')](_0x4cc0('0x2c'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id']);_0x946f23[_0x1a60bb]=_[_0x4cc0('0x12')](_0x2c7149[_0x4cc0('0x1a')])?_0x2c7149[_0x4cc0('0x1b')]:_0x2c7149[_0x4cc0('0x1c')];if(_['isNil'](_0x2c7149[_0x4cc0('0x1a')])){_0x946f23['firstName']=_0x2c7149['calleridname']&&_0x2c7149[_0x4cc0('0x2d')]!==''?_0x2c7149[_0x4cc0('0x2d')]:_0x4cc0('0x2e');}else{_0x946f23[_0x4cc0('0x1d')]=_0x2c7149[_0x4cc0('0x2f')]&&_0x2c7149[_0x4cc0('0x2f')]!==_0x4cc0('0x30')?_0x2c7149[_0x4cc0('0x2f')]:'Unknown';}return BPromise[_0x4cc0('0x31')]()[_0x4cc0('0x23')](cmContactRpc[_0x4cc0('0x32')](_0x946f23))[_0x4cc0('0x23')](function(_0xd45fb7){_0x86216c=_0xd45fb7;_0x572720['push'](_0xd45fb7);if(_0x86216c){logger[_0x4cc0('0xc')](_0x4cc0('0x33'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id'],_0x86216c['id']);}return;});}else{logger[_0x4cc0('0xc')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id']);_0x946f23[_0x1a60bb]=_[_0x4cc0('0x12')](_0x2c7149[_0x4cc0('0x1a')])?_0x2c7149[_0x4cc0('0x1b')]:_0x2c7149['destcalleridnum'];if(_[_0x4cc0('0x12')](_0x2c7149[_0x4cc0('0x1a')])){_0x946f23[_0x4cc0('0x1d')]=_0x2c7149[_0x4cc0('0x2d')]&&_0x2c7149[_0x4cc0('0x2d')]!==_0x4cc0('0x30')?_0x2c7149[_0x4cc0('0x2d')]:'Unknown';}else{_0x946f23[_0x4cc0('0x1d')]=_0x2c7149[_0x4cc0('0x2f')]&&_0x2c7149[_0x4cc0('0x2f')]!==_0x4cc0('0x30')?_0x2c7149[_0x4cc0('0x2f')]:_0x4cc0('0x2e');}_0x86216c=_0x946f23;_0x572720['push'](_0x946f23);return;}}})[_0x4cc0('0x23')](function(){if(_0x4c2b09){emit(_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e,util[_0x4cc0('0x34')]('user:%s',_0x4c2b09['name']),util[_0x4cc0('0x34')]('trigger:%s',_0x4ce269[_0x4cc0('0x35')][_0x4cc0('0x36')]()),{'evt':_[_0x4cc0('0x37')](_0x2c7149,{'autoCreate':_0x2da707}),'contact':_0x86216c===undefined?{}:_0x86216c,'contacts':_0x572720['length']===0x0?undefined:_0x572720});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index cd5c98c..c453f51 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7046=['custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','stringify','prototype','clone','motionChannel','undefined','interface','checkTriggers','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','windowHeight','data6','600','winApplication','user:%s','name','format','trigger:%s:%s','data1','jscripty','emit','trigger:%s','exec','queue','urlforward','script','parse','query','search','replace','channel','every','AllConditions','checkConditions','some','AnyConditions','field','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','membername','routeId','null','substatus','created','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer'];(function(_0x11868f,_0x5e8f6f){var _0xf28338=function(_0x5084ff){while(--_0x5084ff){_0x11868f['push'](_0x11868f['shift']());}};_0xf28338(++_0x5e8f6f);}(_0x7046,0x144));var _0x6704=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7046[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x6704('0x0'));var _=require(_0x6704('0x1'));var url=require(_0x6704('0x2'));var Mustache=require(_0x6704('0x3'));var Redis=require('ioredis');var urlforward=require(_0x6704('0x4'));var integration=require(_0x6704('0x5'));var cmContact=require(_0x6704('0x6'));var script=require('./script');var config=require(_0x6704('0x7'));var logger=require(_0x6704('0x8'))(_0x6704('0x9'));var ami=require(_0x6704('0xa'));config[_0x6704('0xb')]=_['defaults'](config[_0x6704('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6704('0xb')]));var operators={'equals':function(_0x510221,_0x578822){return _0x510221==_0x578822;},'not_equals':function(_0x3ca599,_0x394ef4){return _0x3ca599!=_0x394ef4;}};var barAndWebActions=[_0x6704('0xc'),_0x6704('0x2'),_0x6704('0xd')];function Trigger(_0x40d57d){this[_0x6704('0xe')]=_0x40d57d[_0x6704('0xe')];this['agents']=_0x40d57d[_0x6704('0xf')];this[_0x6704('0x10')]=_0x40d57d['voiceQueues'];this[_0x6704('0x11')]=_0x40d57d[_0x6704('0x11')];this[_0x6704('0x12')]=_0x40d57d[_0x6704('0x12')];this[_0x6704('0x13')]=_0x40d57d[_0x6704('0x13')];this[_0x6704('0x14')]=_0x40d57d[_0x6704('0x14')];this[_0x6704('0x15')]=_0x40d57d['salesforceAccounts'];this[_0x6704('0x16')]=_0x40d57d[_0x6704('0x16')];this[_0x6704('0x17')]=_0x40d57d['zohoAccounts'];this[_0x6704('0x18')]=_0x40d57d[_0x6704('0x18')];this[_0x6704('0x19')]=_0x40d57d[_0x6704('0x19')];this[_0x6704('0x1a')]=_0x40d57d['servicenowAccounts'];this[_0x6704('0x1b')]=_0x40d57d[_0x6704('0x1b')];this[_0x6704('0x1c')]=_0x40d57d[_0x6704('0x1c')];this[_0x6704('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x6704('0x15')],'freshdesk':this[_0x6704('0x14')],'sugarcrm':this[_0x6704('0x16')],'zoho':this[_0x6704('0x17')],'desk':this[_0x6704('0x18')],'vtiger':this[_0x6704('0x19')],'dynamics365':this[_0x6704('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x6704('0x1a')]};ami['on'](_0x6704('0x1e'),this[_0x6704('0x1f')]['bind'](this));ami['on']('custom:agentconnect',this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x21'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on']('custom:agentcomplete',this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x22'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x23'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x24'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x25'),this[_0x6704('0x1f')]['bind'](this));ami['on']('custom:agentreject',this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x26'),this[_0x6704('0x1f')]['bind'](this));ami['on'](_0x6704('0x27'),this[_0x6704('0x1f')]['bind'](this));ami['on']('custom:timeout',this[_0x6704('0x1f')]['bind'](this));ami['on'](_0x6704('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0x6704('0x29'),this[_0x6704('0x2a')][_0x6704('0x20')](this));ami['on']('custom:dialend',this[_0x6704('0x2a')][_0x6704('0x20')](this));ami['on'](_0x6704('0x2b'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x2c'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x2d'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x2e'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x2f'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x30'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x31'),this[_0x6704('0x1f')][_0x6704('0x20')](this));ami['on'](_0x6704('0x32'),this[_0x6704('0x1f')]['bind'](this));}Trigger['prototype']['emit']=function(_0x2196bd,_0x333742,_0x18222f){logger['info'](_0x2196bd,_0x333742,JSON[_0x6704('0x33')](_0x18222f));io['to'](_0x2196bd)['emit'](_0x333742,_0x18222f);};Trigger[_0x6704('0x34')][_0x6704('0x1f')]=function(_0x59b1bb){var _0x18a118=_[_0x6704('0x35')](_0x59b1bb);if(typeof _0x18a118[_0x6704('0x36')]===_0x6704('0x37')){_0x18a118[_0x6704('0x36')]='voice';}this['checkTriggers'](_0x18a118);};Trigger[_0x6704('0x34')][_0x6704('0x2a')]=function(_0x4a0c18){if(this['agents'][_0x4a0c18[_0x6704('0x38')]]){this['syncCustomEvent'](_0x4a0c18);}};Trigger[_0x6704('0x34')][_0x6704('0x39')]=function(_0x316f16){var _0x41ba43;for(var _0x55dfd6 in this[_0x6704('0xe')]){if(this[_0x6704('0xe')]['hasOwnProperty'](_0x55dfd6)){if(this[_0x6704('0xe')][_0x55dfd6]['status']){_0x41ba43=this[_0x6704('0x3a')](this[_0x6704('0xe')][_0x55dfd6],_0x316f16);if(_0x41ba43){_[_0x6704('0x3b')](_0x316f16,_0x316f16['variables']);for(var _0x32c552=0x0,_0x404604,_0x3e47ee,_0x5c04fe;_0x32c5520x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x4bcefb,_0x1bfd01){var _0x1b8ce4=function(_0x2236f4){while(--_0x2236f4){_0x4bcefb['push'](_0x4bcefb['shift']());}};_0x1b8ce4(++_0x1bfd01);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 8b1624e..c5c89ce 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7c5=['internalemailaddress','isdisabled','systemuserid','info','userId','toLowerCase','outbound','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','enduserId','telephone1','GET','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','indexOf','content','ticketType','incidents','assign','Subjects','getString','Descriptions','phonecall','queue','/contacts(','callDirection','Fields','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','data2','data5','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','length'];(function(_0x956671,_0x10d4b5){var _0x460fcd=function(_0x1ca84e){while(--_0x1ca84e){_0x956671['push'](_0x956671['shift']());}};_0x460fcd(++_0x10d4b5);}(_0xe7c5,0x1f3));var _0x5e7c=function(_0x3da13a,_0x51cafe){_0x3da13a=_0x3da13a-0x0;var _0x54ac0b=_0xe7c5[_0x3da13a];return _0x54ac0b;};'use strict';var _=require(_0x5e7c('0x0'));var rp=require(_0x5e7c('0x1'));var util=require(_0x5e7c('0x2'));var intUtil=require(_0x5e7c('0x3'));var md5=require('md5');var Redis=require(_0x5e7c('0x4'));var logger=require(_0x5e7c('0x5'))(_0x5e7c('0x6'));var config=require(_0x5e7c('0x7'));config[_0x5e7c('0x8')]=_['defaults'](config[_0x5e7c('0x8')],{'host':_0x5e7c('0x9'),'port':0x18eb});var io=require(_0x5e7c('0xa'))(new Redis(config['redis']));function getAuthToken(_0xb1f571,_0x5f2bb7,_0x45cf1f){if(_0xb1f571[_0x5e7c('0xb')]){_0xb1f571['remoteUri']=_0xb1f571[_0x5e7c('0xc')]['data7'];_0xb1f571[_0x5e7c('0xd')]=_0xb1f571[_0x5e7c('0xc')][_0x5e7c('0xe')];return Promise['resolve'](_0xb1f571[_0x5e7c('0xc')][_0x5e7c('0xf')]);}var _0x415c00={'method':_0x5e7c('0x10'),'uri':_0x5f2bb7,'form':{'client_id':_0xb1f571[_0x5e7c('0x11')],'resource':_0xb1f571[_0x5e7c('0x12')],'username':_0xb1f571[_0x5e7c('0x13')],'password':_0xb1f571[_0x5e7c('0x14')],'grant_type':_0x5e7c('0x14'),'client_secret':_0xb1f571[_0x5e7c('0x15')]},'json':!![]};return rp(_0x415c00)[_0x5e7c('0x16')](function(_0x17e1e5){return _0x17e1e5['access_token'];})[_0x5e7c('0x17')](function(_0x3f4fa6){logger[_0x5e7c('0x18')]('['+[_0x45cf1f[_0x5e7c('0x19')]()]+_0x5e7c('0x1a'));return _0x3f4fa6[_0x5e7c('0x1b')];});}function getUser(_0x39c197,_0x1fdd74,_0x4c64a1,_0xfaf4b0,_0x5bbd80,_0x5d986c){return new Promise(function(_0x2ddb34,_0x44c920){return getAuthToken(_0x1fdd74,_0xfaf4b0,_0x5d986c)[_0x5e7c('0x16')](function(_0xbb0e01){var _0x2a21c1={'method':'GET','uri':_0x5bbd80+_0x5e7c('0x1c'),'headers':{'Authorization':_0x5e7c('0x1d')+_0xbb0e01,'OData-Version':_0x5e7c('0x1e')},'json':!![]};return rp(_0x2a21c1);})[_0x5e7c('0x16')](function(_0x572eaf){var _0x2441b6=_0x572eaf[_0x5e7c('0x1f')];var _0x24f9e4=![];var _0x1f18a8=null;if(!_[_0x5e7c('0x20')](_0x4c64a1)){if(intUtil['validateEmail'](_0x4c64a1[_0x5e7c('0x21')])){_0x39c197[_0x5e7c('0x22')]=_0x4c64a1[_0x5e7c('0x21')];for(_0x1f18a8=0x0;_0x1f18a8<_0x2441b6[_0x5e7c('0x23')];_0x1f18a8++){if(_0x2441b6[_0x1f18a8][_0x5e7c('0x24')]===_0x4c64a1[_0x5e7c('0x21')]&&!_0x2441b6[_0x1f18a8][_0x5e7c('0x25')]){_0x24f9e4=!![];logger['info']('['+[_0x5d986c[_0x5e7c('0x19')]()]+']\x20Agent\x20found\x20'+_0x2441b6[_0x1f18a8][_0x5e7c('0x26')]+'!');_0x39c197['userId']=_0x2441b6[_0x1f18a8][_0x5e7c('0x26')];}}}}if(!_0x24f9e4){logger[_0x5e7c('0x27')]('['+[_0x5d986c['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x39c197[_0x5e7c('0x22')]=_0x1fdd74[_0x5e7c('0x13')];for(_0x1f18a8=0x0;_0x1f18a8<_0x2441b6[_0x5e7c('0x23')];_0x1f18a8++){if(_0x2441b6[_0x1f18a8][_0x5e7c('0x24')]===_0x1fdd74[_0x5e7c('0x13')]){_0x39c197[_0x5e7c('0x28')]=_0x2441b6[_0x1f18a8]['systemuserid'];}}}_0x2ddb34(_0x39c197);})[_0x5e7c('0x17')](function(_0x3f7a47){_0x44c920(_0x3f7a47[_0x5e7c('0x1b')]);});});}function createEndUser(_0x28bcba,_0x234ca5,_0x4e985a,_0x2bd101,_0x37fc8f,_0x2e26b3,_0x1c97a5){return new Promise(function(_0xf11a18,_0x177acd){return getAuthToken(_0x234ca5,_0x4e985a,_0x2e26b3)[_0x5e7c('0x16')](function(_0x428a64){var _0x2e96c5=_0x2e26b3[_0x5e7c('0x29')]()===_0x5e7c('0x2a')?_0x37fc8f['destcalleridnum']:_0x37fc8f[_0x5e7c('0x2b')];var _0x19db7c={'method':_0x5e7c('0x10'),'uri':_0x2bd101+_0x5e7c('0x2c'),'body':{'fullname':_0x2e96c5,'firstname':_0x2e96c5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5e7c('0x2d')+_0x28bcba[_0x5e7c('0x28')]+')'},'headers':{'Authorization':_0x5e7c('0x1d')+_0x428a64,'OData-Version':_0x5e7c('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x19db7c[_0x5e7c('0x2e')][_0x1c97a5]=_0x2e96c5;return rp(_0x19db7c);})[_0x5e7c('0x16')](function(_0x58bc91){var _0x60be4e=_0x58bc91[_0x5e7c('0x2f')]['odata-entityid'];var _0x5474aa=_0x60be4e[_0x5e7c('0x30')](_0x60be4e[_0x5e7c('0x31')]('(')+0x1,_0x60be4e['lastIndexOf'](')'));_0x28bcba[_0x5e7c('0x32')]=_0x5474aa;_0xf11a18(_0x28bcba);})[_0x5e7c('0x17')](function(_0x13691c){_0x177acd(_0x13691c[_0x5e7c('0x1b')]);});});}function getEndUser(_0x53c18f,_0xe41a6f,_0x418a49,_0x412b5f,_0x50036d,_0x19ea21,_0x37241a,_0x5696eb){var _0x213f9b=_0x19ea21[_0x5e7c('0x29')]()===_0x5e7c('0x2a')?_0x50036d['destcalleridnum']:_0x50036d[_0x5e7c('0x2b')];return getAuthToken(_0xe41a6f,_0x418a49,_0x19ea21)['then'](function(_0x50ae36){_0x5696eb=_0x5696eb?_0x5696eb:_0x5e7c('0x33');var _0x4a811b={'method':_0x5e7c('0x34'),'uri':_0x412b5f+'contacts?$select='+_0x5696eb+_0x5e7c('0x35')+_0x5696eb+_0x5e7c('0x36')+_0x213f9b[_0x5e7c('0x37')]('+',_0x5e7c('0x38'))+'\x27','headers':{'Authorization':_0x5e7c('0x1d')+_0x50ae36,'If-None-Match':null,'OData-Version':_0x5e7c('0x1e')},'json':!![]};return rp(_0x4a811b);})[_0x5e7c('0x16')](function(_0x7650b5){var _0x569404=![];if(!_0x7650b5)return _0x569404;var _0x1e70dd=_0x7650b5[_0x5e7c('0x1f')];for(var _0x2eda6e=0x0;_0x2eda6e<_0x1e70dd[_0x5e7c('0x23')];_0x2eda6e++){if(_0x1e70dd[_0x2eda6e][_0x5696eb]===_0x213f9b){_0x569404=!![];_0x53c18f[_0x5e7c('0x32')]=_0x1e70dd[_0x2eda6e][_0x5e7c('0x39')];}}return _0x569404;})[_0x5e7c('0x16')](function(_0x2aa489){if(_0x2aa489)return _0x53c18f;if(_0x37241a===_0x5e7c('0x3a')){logger[_0x5e7c('0x27')]('['+[_0x19ea21[_0x5e7c('0x19')]()]+_0x5e7c('0x3b'));return _0x53c18f;}return createEndUser(_0x53c18f,_0xe41a6f,_0x418a49,_0x412b5f,_0x50036d,_0x19ea21,_0x5696eb)[_0x5e7c('0x16')](function(_0x4ec3ce){logger[_0x5e7c('0x27')]('['+[_0x19ea21['toUpperCase']()]+_0x5e7c('0x3c'),_0x4ec3ce[_0x5e7c('0x32')]);return _0x4ec3ce;});});}function getCustomFields(_0x5658e4,_0x22b6ca,_0xa2eb92){var _0x4e8baf={};if(_0x5658e4[_0x5e7c('0x23')]>0x0){_[_0x5e7c('0x3d')](_0x5658e4,function(_0x462c42){if(_[_0x5e7c('0x3e')]([_0x5e7c('0x3f'),_0x5e7c('0x40')],_0x462c42[_0x5e7c('0x41')])&&_0x462c42[_0x5e7c('0x42')]&&!_0x462c42['customField']){var _0x29e544=_0x462c42['idField']['toLowerCase']();var _0x4b5d2d=_0x29e544['substring'](0x0,_0x29e544['indexOf']('_'));var _0x36be9c=_0x29e544[_0x5e7c('0x30')](_0x29e544[_0x5e7c('0x43')]('_')+0x1);if(_0x4b5d2d===_0xa2eb92){_0x4e8baf[_0x36be9c]=_0x462c42[_0x5e7c('0x44')];}}});}return _0x4e8baf;}function getTicket(_0x445f21,_0x5e27ff,_0x4adf30,_0xca6bff,_0x53c3a2,_0x53122b,_0x3efc5c){return new Promise(function(_0x53aaba,_0x580c73){var _0x5f1c3d;return getAuthToken(_0x5e27ff,_0x4adf30,_0x3efc5c)[_0x5e7c('0x16')](function(_0x382dc8){if(_0x53122b[_0x5e7c('0x45')]==='incident'){_0x5f1c3d={'method':_0x5e7c('0x10'),'uri':_0xca6bff+_0x5e7c('0x46'),'body':Object[_0x5e7c('0x47')]({},{'title':intUtil['getString'](_0x53122b[_0x5e7c('0x48')],_0x53c3a2,'\x20'),'description':intUtil[_0x5e7c('0x49')](_0x53122b[_0x5e7c('0x4a')],_0x53c3a2,'\x0a'),'customerid_contact@odata.bind':_0x445f21[_0x5e7c('0x32')]?'/contacts('+_0x445f21[_0x5e7c('0x32')]+')':undefined,'ownerid@odata.bind':_0x5e7c('0x2d')+_0x445f21[_0x5e7c('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x53122b['Fields'],_0x53c3a2,_0x53122b[_0x5e7c('0x45')])),'headers':{'Authorization':_0x5e7c('0x1d')+_0x382dc8,'OData-Version':_0x5e7c('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x53122b[_0x5e7c('0x45')]===_0x5e7c('0x4b')){var _0x8351fe=_0x445f21['enduserId']?[{'partyid_systemuser@odata.bind':_0x5e7c('0x2d')+_0x445f21[_0x5e7c('0x28')]+')','participationtypemask':_0x445f21['callDirection']===_0x5e7c('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x5e7c('0x4d')+_0x445f21['enduserId']+')','participationtypemask':_0x445f21[_0x5e7c('0x4e')]===_0x5e7c('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5e7c('0x2d')+_0x445f21[_0x5e7c('0x28')]+')','participationtypemask':_0x445f21[_0x5e7c('0x4e')]===_0x5e7c('0x4c')?0x2:0x1}];_0x5f1c3d={'method':'POST','uri':_0xca6bff+'phonecalls','body':Object[_0x5e7c('0x47')]({},{'subject':intUtil['getString'](_0x53122b['Subjects'],_0x53c3a2,'\x20'),'phonenumber':String(_0x53c3a2['calleridnum']),'description':intUtil['getString'](_0x53122b[_0x5e7c('0x4a')],_0x53c3a2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x445f21[_0x5e7c('0x32')]?_0x5e7c('0x4d')+_0x445f21[_0x5e7c('0x32')]+')':undefined,'ownerid@odata.bind':_0x5e7c('0x2d')+_0x445f21[_0x5e7c('0x28')]+')','directioncode':_0x445f21[_0x5e7c('0x4e')]==='queue'?![]:!![],'phonecall_activity_parties':_0x8351fe},getCustomFields(_0x53122b[_0x5e7c('0x4f')],_0x53c3a2,_0x53122b['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x382dc8,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5f1c3d);})['then'](function(_0x524900){var _0x9c7a9=_0x524900['headers'][_0x5e7c('0x50')];var _0x158b3c=_0x9c7a9[_0x5e7c('0x30')](_0x9c7a9[_0x5e7c('0x31')]('(')+0x1,_0x9c7a9[_0x5e7c('0x31')](')'));_0x445f21[_0x5e7c('0x51')]=_0x158b3c;_0x53aaba(_0x445f21);})[_0x5e7c('0x17')](function(_0x5656bf){_0x580c73(_0x5656bf[_0x5e7c('0x1b')]);});});}function emit(_0x26dd6e,_0x4fef8b,_0x11bace,_0x57167b){var _0x120760={'uri':util[_0x5e7c('0x52')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x26dd6e,_0x11bace,_0x57167b)};io['to'](util[_0x5e7c('0x52')](_0x5e7c('0x53'),_0x4fef8b))[_0x5e7c('0x54')](_0x5e7c('0x55'),_0x120760);}exports['cs']=function(_0xa3b64f,_0x4b09d5,_0x59f82c,_0x9e50ba,_0x313e8b,_0x28046d,_0x332c72,_0x28eecd){var _0x45c294={};_0x28046d[_0x5e7c('0x12')]=_0x28046d[_0x5e7c('0xb')]?intUtil[_0x5e7c('0x56')](_0x28046d[_0x5e7c('0xc')][_0x5e7c('0x57')]):intUtil['stripTrailingSlash'](_0x28046d[_0x5e7c('0x12')]);_0x28046d[_0x5e7c('0x58')]=intUtil['stripTrailingSlash'](_0x28046d[_0x5e7c('0x58')]);_0x45c294[_0x5e7c('0x4e')]=_0x28eecd==='queue'||_0x28eecd===_0x5e7c('0x59')?_0x5e7c('0x4c'):_0x5e7c('0x2a');var _0x16a322=_0x28046d[_0x5e7c('0xb')]?util[_0x5e7c('0x52')](_0x5e7c('0x5a'),_0x28046d[_0x5e7c('0xc')][_0x5e7c('0x57')]):util[_0x5e7c('0x52')](_0x5e7c('0x5a'),_0x28046d[_0x5e7c('0x12')]);var _0x7b8001=util[_0x5e7c('0x52')]('https://login.microsoftonline.com/%s/oauth2/token',_0x28046d[_0x5e7c('0xd')]);var _0xf1bc29=util[_0x5e7c('0x52')](_0x5e7c('0x5b'),_0x28046d['serverUrl'],_0x4b09d5[_0x5e7c('0x5c')],md5(_0x4b09d5[_0x5e7c('0x5c')]));if(_0x313e8b&&_0x313e8b[_0x5e7c('0x5d')]){logger[_0x5e7c('0x27')]('[QUEUE]',_0x5e7c('0x5e'));_0x4b09d5[_0x5e7c('0x5f')]=_0xf1bc29;}else if(_0x332c72&&_0x332c72[_0x5e7c('0x60')]&&_0x332c72[_0x5e7c('0x60')]!==_0x5e7c('0x61')){logger['info'](_0x5e7c('0x62'),_0x5e7c('0x5e'));_0x4b09d5[_0x5e7c('0x5f')]=_0xf1bc29;}else{_0x4b09d5[_0x5e7c('0x5f')]='';}return getUser(_0x45c294,_0x28046d,_0x9e50ba,_0x7b8001,_0x16a322,_0x28eecd)['then'](function(_0x3f61e1){logger[_0x5e7c('0x27')]('['+_0x28eecd[_0x5e7c('0x19')]()+']\x20The\x20User\x20ID\x20is:',_0x3f61e1[_0x5e7c('0x28')]);logger[_0x5e7c('0x27')]('['+_0x28eecd[_0x5e7c('0x19')]()+_0x5e7c('0x63'),_0x3f61e1[_0x5e7c('0x22')]);return getEndUser(_0x3f61e1,_0x28046d,_0x7b8001,_0x16a322,_0x4b09d5,_0x28eecd,_0x59f82c[_0x5e7c('0x64')],_0x59f82c[_0x5e7c('0x65')]);})[_0x5e7c('0x16')](function(_0x1fef13){logger[_0x5e7c('0x27')]('['+_0x28eecd[_0x5e7c('0x19')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x1fef13[_0x5e7c('0x32')]);logger['info']('['+_0x28eecd[_0x5e7c('0x19')]()+_0x5e7c('0x66'),_0x4b09d5[_0x5e7c('0x2b')]);return getTicket(_0x1fef13,_0x28046d,_0x7b8001,_0x16a322,_0x4b09d5,_0x59f82c,_0x28eecd);})[_0x5e7c('0x16')](function(_0x17e89a){logger[_0x5e7c('0x27')](util[_0x5e7c('0x52')]('['+_0x28eecd[_0x5e7c('0x19')]()+_0x5e7c('0x67'),_0x59f82c[_0x5e7c('0x45')],_0x17e89a[_0x5e7c('0x51')]));logger[_0x5e7c('0x27')](util['format']('['+_0x28eecd[_0x5e7c('0x19')]()+_0x5e7c('0x68'),_0x28eecd));if(_0x28eecd!=='unmanaged'&&_0x59f82c['openNewTab']){logger[_0x5e7c('0x27')]('['+_0x28eecd[_0x5e7c('0x19')]()+']',_0x5e7c('0x69'));emit(_0x28046d[_0x5e7c('0x12')],_0x9e50ba['name'],_0x59f82c[_0x5e7c('0x45')],_0x17e89a[_0x5e7c('0x51')]);}})[_0x5e7c('0x17')](function(_0x1b574a){logger['error']('['+_0x28eecd[_0x5e7c('0x19')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x1b574a[_0x5e7c('0x1b')]);console[_0x5e7c('0x18')](_0x5e7c('0x6a'),_0x1b574a);});}; \ No newline at end of file +var _0x90d2=['phonecall','queue','callDirection','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[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','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','then','access_token','catch','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','info',']\x20Agent\x20found\x20','systemuserid','userId','length','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields'];(function(_0x5446c7,_0x3e3c0a){var _0x2417ff=function(_0x11da90){while(--_0x11da90){_0x5446c7['push'](_0x5446c7['shift']());}};_0x2417ff(++_0x3e3c0a);}(_0x90d2,0x15c));var _0x290d=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x90d2[_0x1bb58c];return _0x277586;};'use strict';var _=require('lodash');var rp=require(_0x290d('0x0'));var util=require(_0x290d('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x290d('0x2'))(_0x290d('0x3'));var config=require(_0x290d('0x4'));config[_0x290d('0x5')]=_[_0x290d('0x6')](config[_0x290d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x290d('0x5')]));function getAuthToken(_0x60ec21,_0x49ed45,_0x20a81f){if(_0x60ec21[_0x290d('0x7')]){_0x60ec21[_0x290d('0x8')]=_0x60ec21[_0x290d('0x9')][_0x290d('0xa')];_0x60ec21[_0x290d('0xb')]=_0x60ec21[_0x290d('0x9')]['data2'];return Promise[_0x290d('0xc')](_0x60ec21[_0x290d('0x9')][_0x290d('0xd')]);}var _0x1c2ac3={'method':_0x290d('0xe'),'uri':_0x49ed45,'form':{'client_id':_0x60ec21[_0x290d('0xf')],'resource':_0x60ec21['remoteUri'],'username':_0x60ec21[_0x290d('0x10')],'password':_0x60ec21[_0x290d('0x11')],'grant_type':_0x290d('0x11'),'client_secret':_0x60ec21['clientSecret']},'json':!![]};return rp(_0x1c2ac3)[_0x290d('0x12')](function(_0x2a0c30){return _0x2a0c30[_0x290d('0x13')];})[_0x290d('0x14')](function(_0x399ad9){logger['error']('['+[_0x20a81f[_0x290d('0x15')]()]+']\x20Wrong\x20credentials!');return _0x399ad9[_0x290d('0x16')];});}function getUser(_0x4c12f3,_0x438d62,_0x22f813,_0x26db11,_0x3bc536,_0x36eba5){return new Promise(function(_0x3062d7,_0x1d5dae){return getAuthToken(_0x438d62,_0x26db11,_0x36eba5)[_0x290d('0x12')](function(_0x385694){var _0x11a144={'method':'GET','uri':_0x3bc536+_0x290d('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x385694,'OData-Version':_0x290d('0x18')},'json':!![]};return rp(_0x11a144);})['then'](function(_0x1c1703){var _0x4aa25c=_0x1c1703[_0x290d('0x19')];var _0x5574c3=![];var _0x341d83=null;if(!_[_0x290d('0x1a')](_0x22f813)){if(intUtil[_0x290d('0x1b')](_0x22f813[_0x290d('0x1c')])){_0x4c12f3[_0x290d('0x1d')]=_0x22f813[_0x290d('0x1c')];for(_0x341d83=0x0;_0x341d83<_0x4aa25c['length'];_0x341d83++){if(_0x4aa25c[_0x341d83]['internalemailaddress']===_0x22f813[_0x290d('0x1c')]&&!_0x4aa25c[_0x341d83]['isdisabled']){_0x5574c3=!![];logger[_0x290d('0x1e')]('['+[_0x36eba5[_0x290d('0x15')]()]+_0x290d('0x1f')+_0x4aa25c[_0x341d83][_0x290d('0x20')]+'!');_0x4c12f3[_0x290d('0x21')]=_0x4aa25c[_0x341d83][_0x290d('0x20')];}}}}if(!_0x5574c3){logger[_0x290d('0x1e')]('['+[_0x36eba5[_0x290d('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4c12f3['userEmail']=_0x438d62[_0x290d('0x10')];for(_0x341d83=0x0;_0x341d83<_0x4aa25c[_0x290d('0x22')];_0x341d83++){if(_0x4aa25c[_0x341d83][_0x290d('0x23')]===_0x438d62['username']){_0x4c12f3[_0x290d('0x21')]=_0x4aa25c[_0x341d83]['systemuserid'];}}}_0x3062d7(_0x4c12f3);})[_0x290d('0x14')](function(_0x345803){_0x1d5dae(_0x345803[_0x290d('0x16')]);});});}function createEndUser(_0x24de74,_0x1d6cbb,_0x4ff020,_0x393ca3,_0x278e6e,_0x4f062f,_0x2dfb05){return new Promise(function(_0x256703,_0x152253){return getAuthToken(_0x1d6cbb,_0x4ff020,_0x4f062f)[_0x290d('0x12')](function(_0x45b985){var _0x2f857d=_0x4f062f[_0x290d('0x24')]()===_0x290d('0x25')?_0x278e6e[_0x290d('0x26')]:_0x278e6e[_0x290d('0x27')];var _0x23c748={'method':_0x290d('0xe'),'uri':_0x393ca3+_0x290d('0x28'),'body':{'fullname':_0x2f857d,'firstname':_0x2f857d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x290d('0x29')+_0x24de74[_0x290d('0x21')]+')'},'headers':{'Authorization':_0x290d('0x2a')+_0x45b985,'OData-Version':_0x290d('0x18')},'json':!![],'resolveWithFullResponse':!![]};_0x23c748[_0x290d('0x2b')][_0x2dfb05]=_0x2f857d;return rp(_0x23c748);})[_0x290d('0x12')](function(_0x32e469){var _0x494290=_0x32e469[_0x290d('0x2c')][_0x290d('0x2d')];var _0x49f09e=_0x494290[_0x290d('0x2e')](_0x494290[_0x290d('0x2f')]('(')+0x1,_0x494290[_0x290d('0x2f')](')'));_0x24de74[_0x290d('0x30')]=_0x49f09e;_0x256703(_0x24de74);})[_0x290d('0x14')](function(_0x5e73ec){_0x152253(_0x5e73ec[_0x290d('0x16')]);});});}function getEndUser(_0x435878,_0x4a1db3,_0x1dccee,_0x1d3372,_0x81233e,_0x40f53c,_0x2cf21a,_0xad09f6){var _0x1d38cc=_0x40f53c[_0x290d('0x24')]()===_0x290d('0x25')?_0x81233e[_0x290d('0x26')]:_0x81233e[_0x290d('0x27')];return getAuthToken(_0x4a1db3,_0x1dccee,_0x40f53c)[_0x290d('0x12')](function(_0x1f8555){_0xad09f6=_0xad09f6?_0xad09f6:_0x290d('0x31');var _0x4bf31f={'method':'GET','uri':_0x1d3372+'contacts?$select='+_0xad09f6+'&$filter='+_0xad09f6+_0x290d('0x32')+_0x1d38cc[_0x290d('0x33')]('+',_0x290d('0x34'))+'\x27','headers':{'Authorization':_0x290d('0x2a')+_0x1f8555,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4bf31f);})[_0x290d('0x12')](function(_0x3a7e24){var _0x42edf0=![];if(!_0x3a7e24)return _0x42edf0;var _0x4b2362=_0x3a7e24['value'];for(var _0xc60aa3=0x0;_0xc60aa3<_0x4b2362[_0x290d('0x22')];_0xc60aa3++){if(_0x4b2362[_0xc60aa3][_0xad09f6]===_0x1d38cc){_0x42edf0=!![];_0x435878[_0x290d('0x30')]=_0x4b2362[_0xc60aa3][_0x290d('0x35')];}}return _0x42edf0;})[_0x290d('0x12')](function(_0x354226){if(_0x354226)return _0x435878;if(_0x2cf21a==='nothing'){logger[_0x290d('0x1e')]('['+[_0x40f53c[_0x290d('0x15')]()]+_0x290d('0x36'));return _0x435878;}return createEndUser(_0x435878,_0x4a1db3,_0x1dccee,_0x1d3372,_0x81233e,_0x40f53c,_0xad09f6)[_0x290d('0x12')](function(_0x2f276e){logger[_0x290d('0x1e')]('['+[_0x40f53c['toUpperCase']()]+']\x20Enduser\x20created!',_0x2f276e['enduserId']);return _0x2f276e;});});}function getCustomFields(_0x4106ef,_0x57a359,_0x5edc6c){var _0x4a68e3={};if(_0x4106ef[_0x290d('0x22')]>0x0){_[_0x290d('0x37')](_0x4106ef,function(_0x3a9849){if(_[_0x290d('0x38')]([_0x290d('0x39'),_0x290d('0x3a')],_0x3a9849[_0x290d('0x3b')])&&_0x3a9849['nameField']&&!_0x3a9849['customField']){var _0x23a4c7=_0x3a9849[_0x290d('0x3c')][_0x290d('0x24')]();var _0x5ceb79=_0x23a4c7['substring'](0x0,_0x23a4c7[_0x290d('0x3d')]('_'));var _0x3df378=_0x23a4c7[_0x290d('0x2e')](_0x23a4c7[_0x290d('0x3d')]('_')+0x1);if(_0x5ceb79===_0x5edc6c){_0x4a68e3[_0x3df378]=_0x3a9849[_0x290d('0x3e')];}}});}return _0x4a68e3;}function getTicket(_0x54dea2,_0x2d509b,_0x467a65,_0xa10762,_0x5922e6,_0x26dbd9,_0x31a5ab){return new Promise(function(_0x2134d0,_0x1d961e){var _0x40f581;return getAuthToken(_0x2d509b,_0x467a65,_0x31a5ab)['then'](function(_0x23607f){if(_0x26dbd9[_0x290d('0x3f')]===_0x290d('0x40')){_0x40f581={'method':_0x290d('0xe'),'uri':_0xa10762+_0x290d('0x41'),'body':Object[_0x290d('0x42')]({},{'title':intUtil['getString'](_0x26dbd9[_0x290d('0x43')],_0x5922e6,'\x20'),'description':intUtil[_0x290d('0x44')](_0x26dbd9[_0x290d('0x45')],_0x5922e6,'\x0a'),'customerid_contact@odata.bind':_0x54dea2[_0x290d('0x30')]?_0x290d('0x46')+_0x54dea2['enduserId']+')':undefined,'ownerid@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x26dbd9[_0x290d('0x47')],_0x5922e6,_0x26dbd9[_0x290d('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x23607f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x26dbd9['ticketType']===_0x290d('0x48')){var _0x3e28e8=_0x54dea2['enduserId']?[{'partyid_systemuser@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','participationtypemask':_0x54dea2['callDirection']===_0x290d('0x49')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x54dea2['enduserId']+')','participationtypemask':_0x54dea2[_0x290d('0x4a')]===_0x290d('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','participationtypemask':_0x54dea2[_0x290d('0x4a')]==='queue'?0x2:0x1}];_0x40f581={'method':_0x290d('0xe'),'uri':_0xa10762+_0x290d('0x4b'),'body':Object['assign']({},{'subject':intUtil[_0x290d('0x44')](_0x26dbd9[_0x290d('0x43')],_0x5922e6,'\x20'),'phonenumber':String(_0x5922e6[_0x290d('0x27')]),'description':intUtil[_0x290d('0x44')](_0x26dbd9[_0x290d('0x45')],_0x5922e6,'\x0a'),'regardingobjectid_contact@odata.bind':_0x54dea2[_0x290d('0x30')]?_0x290d('0x46')+_0x54dea2['enduserId']+')':undefined,'ownerid@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','directioncode':_0x54dea2[_0x290d('0x4a')]==='queue'?![]:!![],'phonecall_activity_parties':_0x3e28e8},getCustomFields(_0x26dbd9[_0x290d('0x47')],_0x5922e6,_0x26dbd9[_0x290d('0x3f')])),'headers':{'Authorization':_0x290d('0x2a')+_0x23607f,'OData-Version':_0x290d('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x40f581);})[_0x290d('0x12')](function(_0x279bd4){var _0x158d5=_0x279bd4[_0x290d('0x2c')][_0x290d('0x2d')];var _0x1f36ed=_0x158d5['substring'](_0x158d5[_0x290d('0x2f')]('(')+0x1,_0x158d5[_0x290d('0x2f')](')'));_0x54dea2[_0x290d('0x4c')]=_0x1f36ed;_0x2134d0(_0x54dea2);})[_0x290d('0x14')](function(_0xf9a034){_0x1d961e(_0xf9a034[_0x290d('0x16')]);});});}function emit(_0x47d9c8,_0x54ca9b,_0x4c2415,_0x414667){var _0x2292d4={'uri':util[_0x290d('0x4d')](_0x290d('0x4e'),_0x47d9c8,_0x4c2415,_0x414667)};io['to'](util['format'](_0x290d('0x4f'),_0x54ca9b))[_0x290d('0x50')](_0x290d('0x51'),_0x2292d4);}exports['cs']=function(_0xbea24b,_0x24ac69,_0x2f1a5b,_0x2c9f00,_0x28cd92,_0x29c599,_0x21eb26,_0x1e6b7d){var _0x2843e3={};_0x29c599[_0x290d('0x8')]=_0x29c599['modernAuthentication']?intUtil[_0x290d('0x52')](_0x29c599[_0x290d('0x9')][_0x290d('0xa')]):intUtil['stripTrailingSlash'](_0x29c599[_0x290d('0x8')]);_0x29c599['serverUrl']=intUtil[_0x290d('0x52')](_0x29c599[_0x290d('0x53')]);_0x2843e3['callDirection']=_0x1e6b7d===_0x290d('0x49')||_0x1e6b7d==='unmanaged'?'queue':_0x290d('0x25');var _0x14b815=_0x29c599[_0x290d('0x7')]?util[_0x290d('0x4d')](_0x290d('0x54'),_0x29c599[_0x290d('0x9')][_0x290d('0xa')]):util[_0x290d('0x4d')]('%s/api/data/v9.0/',_0x29c599['remoteUri']);var _0x5c9411=util['format'](_0x290d('0x55'),_0x29c599[_0x290d('0xb')]);var _0x3a7821=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29c599[_0x290d('0x53')],_0x24ac69[_0x290d('0x56')],md5(_0x24ac69[_0x290d('0x56')]));if(_0x28cd92&&_0x28cd92[_0x290d('0x57')]){logger[_0x290d('0x1e')](_0x290d('0x58'),_0x290d('0x59'));_0x24ac69[_0x290d('0x5a')]=_0x3a7821;}else if(_0x21eb26&&_0x21eb26[_0x290d('0x5b')]&&_0x21eb26['recordingFormat']!=='none'){logger['info'](_0x290d('0x5c'),_0x290d('0x59'));_0x24ac69[_0x290d('0x5a')]=_0x3a7821;}else{_0x24ac69['recordingURL']='';}return getUser(_0x2843e3,_0x29c599,_0x2c9f00,_0x5c9411,_0x14b815,_0x1e6b7d)[_0x290d('0x12')](function(_0xa682f3){logger[_0x290d('0x1e')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x5d'),_0xa682f3['userId']);logger[_0x290d('0x1e')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x5e'),_0xa682f3[_0x290d('0x1d')]);return getEndUser(_0xa682f3,_0x29c599,_0x5c9411,_0x14b815,_0x24ac69,_0x1e6b7d,_0x2f1a5b[_0x290d('0x5f')],_0x2f1a5b[_0x290d('0x60')]);})[_0x290d('0x12')](function(_0x25e61c){logger[_0x290d('0x1e')]('['+_0x1e6b7d['toUpperCase']()+_0x290d('0x61'),_0x25e61c[_0x290d('0x30')]);logger[_0x290d('0x1e')]('['+_0x1e6b7d['toUpperCase']()+_0x290d('0x62'),_0x24ac69['calleridnum']);return getTicket(_0x25e61c,_0x29c599,_0x5c9411,_0x14b815,_0x24ac69,_0x2f1a5b,_0x1e6b7d);})['then'](function(_0x54939d){logger['info'](util[_0x290d('0x4d')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x63'),_0x2f1a5b[_0x290d('0x3f')],_0x54939d[_0x290d('0x4c')]));logger[_0x290d('0x1e')](util['format']('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x64'),_0x1e6b7d));if(_0x1e6b7d!=='unmanaged'&&_0x2f1a5b[_0x290d('0x65')]){logger[_0x290d('0x1e')]('['+_0x1e6b7d[_0x290d('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x29c599[_0x290d('0x8')],_0x2c9f00['name'],_0x2f1a5b[_0x290d('0x3f')],_0x54939d['ticketId']);}})[_0x290d('0x14')](function(_0x10d27e){logger[_0x290d('0x66')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x67'),_0x10d27e[_0x290d('0x16')]);console['error'](_0x290d('0x68'),_0x10d27e);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index aa1a6b7..0c10491 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65ec=['GET','map','forEach','string','type','nameField','toLowerCase','content','includes','idField','customField','variable','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','calleridname','calleridnum','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','remoteUri','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','apiKey','toString','base64','debug','[HTTP]','stringify'];(function(_0x1d39b8,_0x4f449d){var _0x2e5245=function(_0x3f7a7a){while(--_0x3f7a7a){_0x1d39b8['push'](_0x1d39b8['shift']());}};_0x2e5245(++_0x4f449d);}(_0x65ec,0xdb));var _0xc65e=function(_0x5116f1,_0x4813db){_0x5116f1=_0x5116f1-0x0;var _0x1523c9=_0x65ec[_0x5116f1];return _0x1523c9;};'use strict';var _=require('lodash');var rp=require(_0xc65e('0x0'));var md5=require('md5');var util=require(_0xc65e('0x1'));var Redis=require(_0xc65e('0x2'));var intUtil=require(_0xc65e('0x3'));var config=require(_0xc65e('0x4'));var logger=require(_0xc65e('0x5'))(_0xc65e('0x6'));config[_0xc65e('0x7')]=_[_0xc65e('0x8')](config[_0xc65e('0x7')],{'host':_0xc65e('0x9'),'port':0x18eb});var io=require(_0xc65e('0xa'))(new Redis(config[_0xc65e('0x7')]));var headers={'Content-Type':_0xc65e('0xb'),'Accept':_0xc65e('0xb')};function emit(_0x3703c0,_0x2ef298,_0x58d4ca){io['to'](_0x3703c0)['emit'](_0x2ef298,_0x58d4ca);}function getTicket(_0x234e6,_0x52065b,_0x21acfe,_0x263824,_0x14544c){logger[_0xc65e('0xc')](_0xc65e('0xd'));var _0x264ef6=_[_0xc65e('0xe')]({'responder_id':_0x52065b['id'],'requester_id':_0x21acfe['id'],'name':util['format']('Caller\x20-\x20%s',_0x14544c[_0xc65e('0xf')]),'phone':_0x14544c[_0xc65e('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x263824[_0xc65e('0x11')],_0x14544c,'\x20'),'description':intUtil['getString'](_0x263824[_0xc65e('0x12')],_0x14544c,_0xc65e('0x13')),'tags':getTags(_0x263824['Tags'],_0xc65e('0x14'))},getCustomFields(_0x263824[_0xc65e('0x15')],_0x14544c));_0x264ef6[_0xc65e('0x16')]=_[_0xc65e('0x17')](_[_0xc65e('0x18')](_0x264ef6[_0xc65e('0x16')],'id'),_0xc65e('0x19'));return request({'uri':util[_0xc65e('0x1a')]('%s/api/v2/tickets',_0x234e6[_0xc65e('0x1b')]),'method':'POST','body':_0x264ef6})[_0xc65e('0x1c')](function(_0x2fb7c1){logger[_0xc65e('0xc')]('Ticket\x20created!');return _0x2fb7c1;});}function getUser(_0x164f9a,_0x538177){if(intUtil[_0xc65e('0x1d')](_0x538177)){return request({'uri':util[_0xc65e('0x1a')](_0xc65e('0x1e'),_0x164f9a[_0xc65e('0x1b')]),'qs':{'email':_0x538177}})['then'](function(_0x2c97bc){if(_0x2c97bc[_0xc65e('0x1f')]){logger[_0xc65e('0xc')](_0xc65e('0x20'));return _[_0xc65e('0x21')](_0x2c97bc,function(_0x456dc2){return _0x456dc2['contact'][_0xc65e('0x22')]===_0x538177;});}else{logger[_0xc65e('0xc')](_0xc65e('0x23'));return request({'uri':util[_0xc65e('0x1a')](_0xc65e('0x24'),_0x164f9a[_0xc65e('0x1b')])})['then'](function(_0x28bea5){logger[_0xc65e('0xc')]('Admin\x20account\x20selected.');return _0x28bea5;});}});}else{logger[_0xc65e('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc65e('0x1a')](_0xc65e('0x24'),_0x164f9a[_0xc65e('0x1b')])})['then'](function(_0x19ad4c){logger[_0xc65e('0xc')]('Admin\x20account\x20selected.');return _0x19ad4c;});}}function getEndUser(_0x3a7485,_0x5d8675,_0x522dbc){logger[_0xc65e('0xc')](_0xc65e('0x25'),_0x522dbc);return request({'uri':util[_0xc65e('0x1a')](_0xc65e('0x26'),_0x3a7485[_0xc65e('0x1b')]),'qs':{'phone':_0x522dbc}})[_0xc65e('0x1c')](function(_0x431f7f){if(_0x431f7f[_0xc65e('0x1f')]){logger[_0xc65e('0xc')](_0xc65e('0x27'));return _[_0xc65e('0x21')](_0x431f7f,{'phone':_0x522dbc});}else{logger[_0xc65e('0xc')](_0xc65e('0x28'));return request({'uri':util[_0xc65e('0x1a')](_0xc65e('0x26'),_0x3a7485[_0xc65e('0x1b')]),'method':_0xc65e('0x29'),'body':{'name':_0x5d8675,'phone':_0x522dbc}})[_0xc65e('0x1c')](function(_0x67eb0f){logger[_0xc65e('0xc')]('Enduser\x20created.');return _0x67eb0f;});}});}function getAuth(_0x24ab94){return util[_0xc65e('0x1a')]('Basic\x20%s',new Buffer(_0x24ab94[_0xc65e('0x2a')]+':X')[_0xc65e('0x2b')](_0xc65e('0x2c')));}function request(_0x14062f){logger[_0xc65e('0x2d')](_0xc65e('0x2e'),JSON[_0xc65e('0x2f')](_0x14062f));return rp(_['defaults'](_0x14062f,{'method':_0xc65e('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x24581b,_0x891080){var _0x47b2ea=[];if(_0x24581b&&_0x24581b[_0xc65e('0x1f')]>0x0){_0x47b2ea=_[_0xc65e('0x31')](_0x24581b,_0x891080);}return _0x47b2ea;}function getCustomFields(_0x594c65,_0x5626c0){var _0xe4f580=[];var _0x38ee07={'custom_fields':[]};if(_0x594c65[_0xc65e('0x1f')]>0x0){_[_0xc65e('0x32')](_0x594c65,function(_0x1a2a77){if(_['includes']([_0xc65e('0x33'),'picklist'],_0x1a2a77[_0xc65e('0x34')])&&_0x1a2a77[_0xc65e('0x35')]&&!_0x1a2a77['customField']){_0x38ee07[_0x1a2a77[_0xc65e('0x35')][_0xc65e('0x36')]()]=_0x1a2a77[_0xc65e('0x37')]['toString']();}else if(_[_0xc65e('0x38')](['string','picklist'],_0x1a2a77['type'])&&_0x1a2a77[_0xc65e('0x39')]&&_0x1a2a77[_0xc65e('0x3a')]){_0x38ee07['custom_fields']['push']({'id':_0x1a2a77[_0xc65e('0x39')],'value':_0x1a2a77[_0xc65e('0x37')][_0xc65e('0x2b')]()});}else if(_0x1a2a77[_0xc65e('0x34')]===_0xc65e('0x3b')&&_0x1a2a77['variableName']&&_0x1a2a77[_0xc65e('0x39')]&&_0x1a2a77[_0xc65e('0x3a')]){_0x5626c0[_0x1a2a77[_0xc65e('0x3c')]]&&_0x38ee07['custom_fields'][_0xc65e('0x3d')]({'id':_0x1a2a77['idField'],'value':_0x5626c0[_0x1a2a77['variableName']][_0xc65e('0x2b')]()});}else if(_0x1a2a77[_0xc65e('0x34')]==='customVariable'&&_0x1a2a77[_0xc65e('0x3e')]&&_0x1a2a77[_0xc65e('0x3e')][_0xc65e('0x14')]&&_0x1a2a77[_0xc65e('0x39')]&&_0x1a2a77[_0xc65e('0x3a')]){_0x5626c0[_0x1a2a77[_0xc65e('0x3e')][_0xc65e('0x14')]['toLowerCase']()]&&_0x38ee07['custom_fields'][_0xc65e('0x3d')]({'id':_0x1a2a77['idField'],'value':_0x5626c0[_0x1a2a77[_0xc65e('0x3e')]['name']['toLowerCase']()][_0xc65e('0x2b')]()});}});}return _0x38ee07;}exports[_0xc65e('0x3f')]=function(_0x57a89f,_0x3c7fc7,_0x58aba1,_0x175fed,_0xef3669,_0x302909){var _0x3bcb5b,_0x2df762;_0x302909[_0xc65e('0x1b')]=intUtil[_0xc65e('0x40')](_0x302909['remoteUri']);_0x302909['serverUrl']=intUtil[_0xc65e('0x40')](_0x302909[_0xc65e('0x41')]);if(_0xef3669&&_0xef3669['monitor_format']){logger[_0xc65e('0xc')](_0xc65e('0x42'),_0xc65e('0x43'));_0x3c7fc7['recordingURL']=util[_0xc65e('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x302909[_0xc65e('0x41')],_0x3c7fc7[_0xc65e('0x44')],md5(_0x3c7fc7['uniqueid']));}else{_0x3c7fc7['recordingURL']='';}headers[_0xc65e('0x45')]=getAuth(_0x302909);return getUser(_0x302909,_0x175fed[_0xc65e('0x22')])[_0xc65e('0x1c')](function(_0x31bdb2){_0x3bcb5b=_0x31bdb2;logger[_0xc65e('0xc')]('The\x20User\x20ID\x20is:',_0x3bcb5b['id']);return getEndUser(_0x302909,_0x3c7fc7['calleridname'],_0x3c7fc7[_0xc65e('0x10')]);})[_0xc65e('0x1c')](function(_0x4403d6){_0x2df762=_0x4403d6;logger[_0xc65e('0xc')](_0xc65e('0x46'),_0x2df762['id']);return getTicket(_0x302909,_0x3bcb5b,_0x2df762,_0x58aba1,_0x3c7fc7);})[_0xc65e('0x1c')](function(_0x4e7368){if(_0x4e7368&&_0x4e7368['id']){logger[_0xc65e('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x4e7368['id']);logger[_0xc65e('0xc')](_0xc65e('0x42'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc65e('0x1a')](_0xc65e('0x47'),_0x175fed[_0xc65e('0x14')]),_0xc65e('0x48'),{'uri':util[_0xc65e('0x1a')](_0xc65e('0x49'),_0x302909[_0xc65e('0x1b')],_0x4e7368['id'])});}})[_0xc65e('0x4a')](function(_0x4582c8){logger[_0xc65e('0x4b')](_0xc65e('0x42'),JSON['stringify'](_0x4582c8));});};exports[_0xc65e('0x4c')]=function(_0x5b0cd2,_0x4aad5d,_0x4ba9a2,_0x2fbb95,_0x395d6a,_0x353244,_0x1f413c){var _0x3d1a14,_0x1ab159;_0x353244[_0xc65e('0x1b')]=intUtil[_0xc65e('0x40')](_0x353244['remoteUri']);_0x353244[_0xc65e('0x41')]=intUtil[_0xc65e('0x40')](_0x353244[_0xc65e('0x41')]);if(_0x1f413c&&_0x1f413c[_0xc65e('0x4d')]&&_0x1f413c[_0xc65e('0x4d')]!=='none'){logger['info'](_0xc65e('0x4e'),_0xc65e('0x43'));_0x4aad5d[_0xc65e('0x4f')]=util['format'](_0xc65e('0x50'),_0x353244[_0xc65e('0x41')],_0x4aad5d[_0xc65e('0x44')],md5(_0x4aad5d[_0xc65e('0x44')]));}headers[_0xc65e('0x45')]=getAuth(_0x353244);return getUser(_0x353244,_0x2fbb95[_0xc65e('0x22')])[_0xc65e('0x1c')](function(_0x34eb48){_0x3d1a14=_0x34eb48;logger[_0xc65e('0xc')](_0xc65e('0x51'),_0x3d1a14['id']);return getEndUser(_0x353244,_0x4aad5d[_0xc65e('0x52')],_0x4aad5d['destcalleridnum']);})[_0xc65e('0x1c')](function(_0x34315d){_0x1ab159=_0x34315d;logger['info'](_0xc65e('0x46'),_0x1ab159['id']);return getTicket(_0x353244,_0x3d1a14,_0x1ab159,_0x4ba9a2,_0x4aad5d);})[_0xc65e('0x1c')](function(_0x47e8f6){if(_0x47e8f6&&_0x47e8f6['id']){logger[_0xc65e('0xc')](_0xc65e('0x53'));logger[_0xc65e('0xc')](_0xc65e('0x54'),_0x47e8f6['id']);logger[_0xc65e('0xc')](_0xc65e('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc65e('0x1a')](_0xc65e('0x47'),_0x2fbb95['name']),_0xc65e('0x48'),{'uri':util[_0xc65e('0x1a')](_0xc65e('0x49'),_0x353244[_0xc65e('0x1b')],_0x47e8f6['id'])});}})[_0xc65e('0x4a')](function(_0x3ce859){logger['error']('[OUTBOUND]',JSON[_0xc65e('0x2f')](_0x3ce859));});};exports[_0xc65e('0x55')]=function(_0xe837b5,_0x226144,_0x2d225c,_0x4d846b,_0x1e2eb9,_0x111baa){var _0x518bba,_0x1c3a46;_0x111baa[_0xc65e('0x1b')]=intUtil[_0xc65e('0x40')](_0x111baa[_0xc65e('0x1b')]);_0x111baa['serverUrl']=intUtil[_0xc65e('0x40')](_0x111baa[_0xc65e('0x41')]);if(_0x1e2eb9&&_0x1e2eb9[_0xc65e('0x56')]){logger[_0xc65e('0xc')]('['+_0x226144[_0xc65e('0x57')][_0xc65e('0x58')]()+']',_0xc65e('0x43'));_0x226144[_0xc65e('0x4f')]=util[_0xc65e('0x1a')](_0xc65e('0x50'),_0x111baa[_0xc65e('0x41')],_0x226144['uniqueid'],md5(_0x226144[_0xc65e('0x44')]));}else{_0x226144[_0xc65e('0x4f')]='';}headers[_0xc65e('0x45')]=getAuth(_0x111baa);return getUser(_0x111baa,'')[_0xc65e('0x1c')](function(_0x2a3288){_0x518bba=_0x2a3288;logger[_0xc65e('0xc')](_0xc65e('0x51'),_0x518bba['id']);return getEndUser(_0x111baa,_0x226144[_0xc65e('0xf')],_0x226144[_0xc65e('0x10')]);})['then'](function(_0x5b15a8){_0x1c3a46=_0x5b15a8;logger[_0xc65e('0xc')](_0xc65e('0x46'),_0x1c3a46['id']);return getTicket(_0x111baa,_0x518bba,_0x1c3a46,_0x2d225c,_0x226144);})[_0xc65e('0x1c')](function(_0x22fea4){if(_0x22fea4){logger[_0xc65e('0xc')](_0xc65e('0x53'));logger[_0xc65e('0xc')](_0xc65e('0x54'),_0x22fea4['id']);}})[_0xc65e('0x4a')](function(_0x36a338){logger['error']('['+_0x226144[_0xc65e('0x57')]['toUpperCase']()+']',JSON[_0xc65e('0x2f')](_0x36a338));});}; \ No newline at end of file +var _0x573b=['catch','stringify','recordingFormat','none','[OUTBOUND]','email','destcalleridname','The\x20Ticket\x20ID\x20is:','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','
','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','POST','then','%s/api/v2/agents','remoteUri','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','includes','picklist','type','nameField','content','toString','idField','customField','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x573b,0x180));var _0xb573=function(_0x4111fc,_0x2e2f1f){_0x4111fc=_0x4111fc-0x0;var _0x3b1446=_0x573b[_0x4111fc];return _0x3b1446;};'use strict';var _=require(_0xb573('0x0'));var rp=require(_0xb573('0x1'));var md5=require(_0xb573('0x2'));var util=require(_0xb573('0x3'));var Redis=require(_0xb573('0x4'));var intUtil=require(_0xb573('0x5'));var config=require(_0xb573('0x6'));var logger=require(_0xb573('0x7'))('freshdesk');config[_0xb573('0x8')]=_[_0xb573('0x9')](config[_0xb573('0x8')],{'host':_0xb573('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xb573('0xb')};function emit(_0x7e06d9,_0x3836c4,_0x14c29a){io['to'](_0x7e06d9)[_0xb573('0xc')](_0x3836c4,_0x14c29a);}function getTicket(_0x58a1d2,_0x567a42,_0x14077e,_0x183879,_0x21935c){logger[_0xb573('0xd')](_0xb573('0xe'));var _0x48be56=_[_0xb573('0xf')]({'responder_id':_0x567a42['id'],'requester_id':_0x14077e['id'],'name':util[_0xb573('0x10')](_0xb573('0x11'),_0x21935c['calleridname']),'phone':_0x21935c['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb573('0x12')](_0x183879[_0xb573('0x13')],_0x21935c,'\x20'),'description':intUtil[_0xb573('0x12')](_0x183879[_0xb573('0x14')],_0x21935c,_0xb573('0x15')),'tags':getTags(_0x183879[_0xb573('0x16')],_0xb573('0x17'))},getCustomFields(_0x183879['Fields'],_0x21935c));_0x48be56[_0xb573('0x18')]=_['mapValues'](_[_0xb573('0x19')](_0x48be56[_0xb573('0x18')],'id'),_0xb573('0x1a'));return request({'uri':util[_0xb573('0x10')](_0xb573('0x1b'),_0x58a1d2['remoteUri']),'method':_0xb573('0x1c'),'body':_0x48be56})[_0xb573('0x1d')](function(_0x386cc4){logger[_0xb573('0xd')]('Ticket\x20created!');return _0x386cc4;});}function getUser(_0xe2a00d,_0x32ab3f){if(intUtil['validateEmail'](_0x32ab3f)){return request({'uri':util[_0xb573('0x10')](_0xb573('0x1e'),_0xe2a00d[_0xb573('0x1f')]),'qs':{'email':_0x32ab3f}})[_0xb573('0x1d')](function(_0x3c782b){if(_0x3c782b['length']){logger[_0xb573('0xd')](_0xb573('0x20'));return _[_0xb573('0x21')](_0x3c782b,function(_0x29892b){return _0x29892b[_0xb573('0x22')]['email']===_0x32ab3f;});}else{logger[_0xb573('0xd')](_0xb573('0x23'));return request({'uri':util['format'](_0xb573('0x24'),_0xe2a00d[_0xb573('0x1f')])})[_0xb573('0x1d')](function(_0x24cf93){logger['info'](_0xb573('0x25'));return _0x24cf93;});}});}else{logger[_0xb573('0xd')](_0xb573('0x26'));return request({'uri':util[_0xb573('0x10')]('%s/api/v2/agents/me',_0xe2a00d[_0xb573('0x1f')])})['then'](function(_0x2da261){logger[_0xb573('0xd')](_0xb573('0x25'));return _0x2da261;});}}function getEndUser(_0x382f4c,_0x138d6f,_0x45d248){logger[_0xb573('0xd')](_0xb573('0x27'),_0x45d248);return request({'uri':util[_0xb573('0x10')](_0xb573('0x28'),_0x382f4c[_0xb573('0x1f')]),'qs':{'phone':_0x45d248}})[_0xb573('0x1d')](function(_0x3f0e39){if(_0x3f0e39[_0xb573('0x29')]){logger['info']('Enduser\x20found!');return _[_0xb573('0x21')](_0x3f0e39,{'phone':_0x45d248});}else{logger[_0xb573('0xd')](_0xb573('0x2a'));return request({'uri':util['format']('%s/api/v2/contacts',_0x382f4c[_0xb573('0x1f')]),'method':_0xb573('0x1c'),'body':{'name':_0x138d6f,'phone':_0x45d248}})[_0xb573('0x1d')](function(_0x3a5445){logger[_0xb573('0xd')](_0xb573('0x2b'));return _0x3a5445;});}});}function getAuth(_0x44be1e){return util[_0xb573('0x10')](_0xb573('0x2c'),new Buffer(_0x44be1e['apiKey']+':X')['toString'](_0xb573('0x2d')));}function request(_0xf88d23){logger[_0xb573('0x2e')](_0xb573('0x2f'),JSON['stringify'](_0xf88d23));return rp(_[_0xb573('0x9')](_0xf88d23,{'method':_0xb573('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x151ae1,_0x1763e3){var _0x5d91d8=[];if(_0x151ae1&&_0x151ae1[_0xb573('0x29')]>0x0){_0x5d91d8=_[_0xb573('0x31')](_0x151ae1,_0x1763e3);}return _0x5d91d8;}function getCustomFields(_0x14619e,_0x3cf3d8){var _0x1d3bd8=[];var _0x21d82f={'custom_fields':[]};if(_0x14619e[_0xb573('0x29')]>0x0){_[_0xb573('0x32')](_0x14619e,function(_0xe72b50){if(_[_0xb573('0x33')](['string',_0xb573('0x34')],_0xe72b50[_0xb573('0x35')])&&_0xe72b50['nameField']&&!_0xe72b50['customField']){_0x21d82f[_0xe72b50[_0xb573('0x36')]['toLowerCase']()]=_0xe72b50[_0xb573('0x37')][_0xb573('0x38')]();}else if(_['includes'](['string',_0xb573('0x34')],_0xe72b50[_0xb573('0x35')])&&_0xe72b50[_0xb573('0x39')]&&_0xe72b50[_0xb573('0x3a')]){_0x21d82f['custom_fields']['push']({'id':_0xe72b50[_0xb573('0x39')],'value':_0xe72b50[_0xb573('0x37')][_0xb573('0x38')]()});}else if(_0xe72b50[_0xb573('0x35')]==='variable'&&_0xe72b50[_0xb573('0x3b')]&&_0xe72b50['idField']&&_0xe72b50[_0xb573('0x3a')]){_0x3cf3d8[_0xe72b50[_0xb573('0x3b')]]&&_0x21d82f['custom_fields']['push']({'id':_0xe72b50[_0xb573('0x39')],'value':_0x3cf3d8[_0xe72b50['variableName']]['toString']()});}else if(_0xe72b50[_0xb573('0x35')]===_0xb573('0x3c')&&_0xe72b50[_0xb573('0x3d')]&&_0xe72b50[_0xb573('0x3d')][_0xb573('0x17')]&&_0xe72b50[_0xb573('0x39')]&&_0xe72b50[_0xb573('0x3a')]){_0x3cf3d8[_0xe72b50[_0xb573('0x3d')][_0xb573('0x17')]['toLowerCase']()]&&_0x21d82f[_0xb573('0x18')][_0xb573('0x3e')]({'id':_0xe72b50['idField'],'value':_0x3cf3d8[_0xe72b50[_0xb573('0x3d')][_0xb573('0x17')]['toLowerCase']()][_0xb573('0x38')]()});}});}return _0x21d82f;}exports[_0xb573('0x3f')]=function(_0x135520,_0x289b93,_0x46a586,_0x147c4a,_0xdc13ca,_0x22cb1f){var _0x34fd5d,_0x9b974d;_0x22cb1f[_0xb573('0x1f')]=intUtil[_0xb573('0x40')](_0x22cb1f['remoteUri']);_0x22cb1f[_0xb573('0x41')]=intUtil[_0xb573('0x40')](_0x22cb1f['serverUrl']);if(_0xdc13ca&&_0xdc13ca[_0xb573('0x42')]){logger['info']('[QUEUE]',_0xb573('0x43'));_0x289b93['recordingURL']=util[_0xb573('0x10')](_0xb573('0x44'),_0x22cb1f[_0xb573('0x41')],_0x289b93[_0xb573('0x45')],md5(_0x289b93[_0xb573('0x45')]));}else{_0x289b93[_0xb573('0x46')]='';}headers[_0xb573('0x47')]=getAuth(_0x22cb1f);return getUser(_0x22cb1f,_0x147c4a['email'])['then'](function(_0x3fc44a){_0x34fd5d=_0x3fc44a;logger[_0xb573('0xd')](_0xb573('0x48'),_0x34fd5d['id']);return getEndUser(_0x22cb1f,_0x289b93[_0xb573('0x49')],_0x289b93[_0xb573('0x4a')]);})[_0xb573('0x1d')](function(_0xa8b7c){_0x9b974d=_0xa8b7c;logger[_0xb573('0xd')](_0xb573('0x4b'),_0x9b974d['id']);return getTicket(_0x22cb1f,_0x34fd5d,_0x9b974d,_0x46a586,_0x289b93);})[_0xb573('0x1d')](function(_0x202dad){if(_0x202dad&&_0x202dad['id']){logger[_0xb573('0xd')](_0xb573('0x4c'));logger[_0xb573('0xd')]('The\x20Ticket\x20ID\x20is:',_0x202dad['id']);logger['info']('[QUEUE]',_0xb573('0x4d'));emit(util[_0xb573('0x10')](_0xb573('0x4e'),_0x147c4a[_0xb573('0x17')]),_0xb573('0x4f'),{'uri':util[_0xb573('0x10')](_0xb573('0x50'),_0x22cb1f[_0xb573('0x1f')],_0x202dad['id'])});}})[_0xb573('0x51')](function(_0x16d311){logger['error']('[QUEUE]',JSON[_0xb573('0x52')](_0x16d311));});};exports['outbound']=function(_0xd87f1a,_0x14d5ad,_0xa1327b,_0x5d6179,_0x3d7ef1,_0x58f2f9,_0x5c2a98){var _0x3a6ac1,_0x111a55;_0x58f2f9['remoteUri']=intUtil[_0xb573('0x40')](_0x58f2f9[_0xb573('0x1f')]);_0x58f2f9[_0xb573('0x41')]=intUtil[_0xb573('0x40')](_0x58f2f9[_0xb573('0x41')]);if(_0x5c2a98&&_0x5c2a98[_0xb573('0x53')]&&_0x5c2a98['recordingFormat']!==_0xb573('0x54')){logger[_0xb573('0xd')](_0xb573('0x55'),_0xb573('0x43'));_0x14d5ad[_0xb573('0x46')]=util[_0xb573('0x10')](_0xb573('0x44'),_0x58f2f9['serverUrl'],_0x14d5ad[_0xb573('0x45')],md5(_0x14d5ad[_0xb573('0x45')]));}headers[_0xb573('0x47')]=getAuth(_0x58f2f9);return getUser(_0x58f2f9,_0x5d6179[_0xb573('0x56')])[_0xb573('0x1d')](function(_0x19eb17){_0x3a6ac1=_0x19eb17;logger[_0xb573('0xd')](_0xb573('0x48'),_0x3a6ac1['id']);return getEndUser(_0x58f2f9,_0x14d5ad[_0xb573('0x57')],_0x14d5ad['destcalleridnum']);})['then'](function(_0x1d2452){_0x111a55=_0x1d2452;logger[_0xb573('0xd')]('The\x20Enduser\x20ID\x20is:',_0x111a55['id']);return getTicket(_0x58f2f9,_0x3a6ac1,_0x111a55,_0xa1327b,_0x14d5ad);})[_0xb573('0x1d')](function(_0x194b83){if(_0x194b83&&_0x194b83['id']){logger[_0xb573('0xd')]('Ticket\x20created!');logger[_0xb573('0xd')](_0xb573('0x58'),_0x194b83['id']);logger[_0xb573('0xd')]('[OUTBOUND]',_0xb573('0x4d'));emit(util[_0xb573('0x10')](_0xb573('0x4e'),_0x5d6179[_0xb573('0x17')]),_0xb573('0x4f'),{'uri':util[_0xb573('0x10')]('%s/helpdesk/tickets/%d',_0x58f2f9[_0xb573('0x1f')],_0x194b83['id'])});}})[_0xb573('0x51')](function(_0x1ee61d){logger[_0xb573('0x59')](_0xb573('0x55'),JSON[_0xb573('0x52')](_0x1ee61d));});};exports[_0xb573('0x5a')]=function(_0x423c9b,_0x13a6f8,_0x6ecd0d,_0x9fe7d5,_0x4fac69,_0x3bce21){var _0x31334d,_0x57a392;_0x3bce21[_0xb573('0x1f')]=intUtil['stripTrailingSlash'](_0x3bce21[_0xb573('0x1f')]);_0x3bce21[_0xb573('0x41')]=intUtil[_0xb573('0x40')](_0x3bce21[_0xb573('0x41')]);if(_0x4fac69&&_0x4fac69['monitor_format']){logger[_0xb573('0xd')]('['+_0x13a6f8[_0xb573('0x5b')][_0xb573('0x5c')]()+']',_0xb573('0x43'));_0x13a6f8[_0xb573('0x46')]=util[_0xb573('0x10')](_0xb573('0x44'),_0x3bce21[_0xb573('0x41')],_0x13a6f8[_0xb573('0x45')],md5(_0x13a6f8[_0xb573('0x45')]));}else{_0x13a6f8['recordingURL']='';}headers[_0xb573('0x47')]=getAuth(_0x3bce21);return getUser(_0x3bce21,'')[_0xb573('0x1d')](function(_0x15ac0f){_0x31334d=_0x15ac0f;logger[_0xb573('0xd')](_0xb573('0x48'),_0x31334d['id']);return getEndUser(_0x3bce21,_0x13a6f8[_0xb573('0x49')],_0x13a6f8['calleridnum']);})[_0xb573('0x1d')](function(_0x4b2f78){_0x57a392=_0x4b2f78;logger[_0xb573('0xd')](_0xb573('0x4b'),_0x57a392['id']);return getTicket(_0x3bce21,_0x31334d,_0x57a392,_0x6ecd0d,_0x13a6f8);})[_0xb573('0x1d')](function(_0x44ad1b){if(_0x44ad1b){logger[_0xb573('0xd')](_0xb573('0x4c'));logger[_0xb573('0xd')](_0xb573('0x58'),_0x44ad1b['id']);}})[_0xb573('0x51')](function(_0x56e590){logger[_0xb573('0x59')]('['+_0x13a6f8[_0xb573('0x5b')][_0xb573('0x5c')]()+']',JSON[_0xb573('0x52')](_0x56e590));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 5e4c1ab..7e7d603 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4932=['username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','Requested\x20Resource\x20not\x20Found','error','toUpperCase','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','Admin\x20selected','adminId','&f=','&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:','/api/contacts','contact','catch','message','Creating\x20new\x20task','POST','getString','Subjects','add','YYYY-MM-DDTHH:mm:ss','Task\x20created:','ticketId','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x105a8e,_0x12dd9a){var _0x298729=function(_0x3e9079){while(--_0x3e9079){_0x105a8e['push'](_0x105a8e['shift']());}};_0x298729(++_0x12dd9a);}(_0x4932,0x1be));var _0x2493=function(_0x47640d,_0x109c5a){_0x47640d=_0x47640d-0x0;var _0x22246f=_0x4932[_0x47640d];return _0x22246f;};'use strict';var _=require(_0x2493('0x0'));var rp=require(_0x2493('0x1'));var md5=require(_0x2493('0x2'));var util=require('util');var moment=require(_0x2493('0x3'));var Promise=require(_0x2493('0x4'));var Redis=require(_0x2493('0x5'));var intUtil=require('./util');var config=require(_0x2493('0x6'));var logger=require(_0x2493('0x7'))(_0x2493('0x8'));config[_0x2493('0x9')]=_[_0x2493('0xa')](config[_0x2493('0x9')],{'host':_0x2493('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2493('0x9')]));function getAdminId(_0x2e4dbb,_0x44f0fb,_0x55c3d7,_0x58955e){return new Promise(function(_0x59c563,_0x4467bb){var _0x304679=![];var _0x370777={'method':_0x2493('0xc'),'uri':_0x58955e+_0x2493('0xd'),'json':!![]};_0x370777[_0x2493('0xe')]=_0x55c3d7;logger[_0x2493('0xf')](_0x2493('0x10'));return rp(_0x370777)[_0x2493('0x11')](function(_0x22e793){if(_0x22e793){var _0x36760e=_0x22e793[_0x2493('0x12')];var _0x5f5473=null;for(_0x5f5473=0x0;_0x5f5473<_0x36760e[_0x2493('0x13')];_0x5f5473++){if(_0x36760e[_0x5f5473]['email']===_0x2e4dbb[_0x2493('0x14')]){_0x2e4dbb['adminId']=_0x36760e[_0x5f5473]['id'];_0x304679=!![];}}if(_0x304679){logger[_0x2493('0xf')]('Admin\x20found:',_0x2e4dbb['adminId']);_0x59c563(_0x2e4dbb);}else{_0x4467bb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4467bb({'statusCode':0x194,'message':_0x2493('0x15')});}})['catch'](function(_0x4dd514){logger[_0x2493('0x16')]('['+[_0x44f0fb[_0x2493('0x17')]()]+']',_0x4dd514['message']);_0x4467bb(_0x4dd514);});});}function getUser(_0x445990,_0x3574c8,_0x161edf){return function(_0x21704a){return new Promise(function(_0x5cdade,_0xa0f3a8){var _0x3879b4={'method':_0x2493('0xc'),'uri':_0x161edf+_0x2493('0xd'),'json':!![]};_0x3879b4[_0x2493('0xe')]=_0x3574c8;logger[_0x2493('0xf')]('Getting\x20user\x20list');return rp(_0x3879b4)[_0x2493('0x11')](function(_0x349c6c){if(_0x349c6c){var _0x3f85ea=_0x349c6c['users'];var _0x27c9b3=![];var _0x1b1501=null;if(_0x21704a[_0x2493('0x18')]!==null){logger[_0x2493('0xf')](_0x2493('0x19'),_0x21704a[_0x2493('0x18')]);_0x21704a[_0x2493('0x1a')]=_0x21704a['agentEmail'];for(_0x1b1501=0x0;_0x1b1501<_0x3f85ea['length'];_0x1b1501++){if(_0x3f85ea[_0x1b1501][_0x2493('0x1b')]===_0x21704a['agentEmail']){_0x27c9b3=!![];_0x21704a[_0x2493('0x1c')]=_0x3f85ea[_0x1b1501]['id'];logger[_0x2493('0xf')]('User\x20found:',_0x21704a[_0x2493('0x1c')]);}}}if(!_0x27c9b3){logger['info'](_0x2493('0x1d'));_0x21704a['userEmail']=_0x21704a[_0x2493('0x14')];_0x21704a[_0x2493('0x1c')]=_0x21704a[_0x2493('0x1e')];_0x27c9b3=!![];}if(_0x27c9b3){_0x5cdade(_0x21704a);}else{_0xa0f3a8({'statusCode':0x194,'message':_0x2493('0x15')});}}else{_0xa0f3a8({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x5d6aa3){logger[_0x2493('0x16')]('['+[_0x445990[_0x2493('0x17')]()]+']',_0x5d6aa3['message']);_0xa0f3a8(_0x5d6aa3);});});};}function searchContact(_0x5f0f54,_0x4642e3,_0x4ae11c,_0x37940a){return new Promise(function(_0x1c84b9,_0x4a73ba){var _0x2b62b1={'method':_0x2493('0xc'),'headers':_0x4642e3,'uri':_0x5f0f54+'/api/lookup?q='+_0x37940a+_0x2493('0x1f')+_0x4ae11c+_0x2493('0x20'),'json':!![]};rp(_0x2b62b1)['then'](function(_0x5c4a1a){var _0x5a3413=_[_0x2493('0x21')](_0x5c4a1a[_0x2493('0x22')][_0x2493('0x22')],[_0x4ae11c,_0x37940a]);_0x1c84b9(_0x5a3413);})['catch'](function(_0x45c5ba){_0x4a73ba(_0x45c5ba);});});}function getEndUser(_0x151441,_0x451093,_0x8c26ba){return function(_0x59de09){return new Promise(function(_0x21530e,_0x3e0f05){logger[_0x2493('0xf')](util[_0x2493('0x23')](_0x2493('0x24'),_0x59de09[_0x2493('0x25')]));searchContact(_0x8c26ba,_0x451093,_0x2493('0x26'),_0x59de09[_0x2493('0x25')])[_0x2493('0x11')](function(_0x134ce1){if(_0x134ce1){_0x59de09[_0x2493('0x27')]=_0x134ce1['id'];logger[_0x2493('0xf')](_0x2493('0x28'),_0x59de09[_0x2493('0x27')]);return _0x21530e(_0x59de09);}searchContact(_0x8c26ba,_0x451093,_0x2493('0x29'),_0x59de09[_0x2493('0x25')])[_0x2493('0x11')](function(_0x394d14){if(_0x394d14){_0x59de09[_0x2493('0x27')]=_0x394d14['id'];logger[_0x2493('0xf')](_0x2493('0x2a'),_0x59de09[_0x2493('0x27')]);return _0x21530e(_0x59de09);}createEndUser(_0x59de09,_0x151441,_0x451093,_0x8c26ba)['then'](function(_0x3c7c52){logger[_0x2493('0xf')](_0x2493('0x2b'),_0x3c7c52[_0x2493('0x27')]);return _0x21530e(_0x3c7c52);});});})['catch'](function(_0x574200){_0x3e0f05(_0x574200);});});};}function createEndUser(_0x136673,_0x353dcf,_0x3ed3c6,_0x20001d){return new Promise(function(_0x5e03d4,_0x19f54b){var _0x579055=moment();var _0x4a2c5e={'method':'POST','uri':_0x20001d+_0x2493('0x2c'),'body':{'contact':{'last_name':_0x136673[_0x2493('0x25')],'work_number':_0x136673[_0x2493('0x25')],'mobile_number':_0x136673[_0x2493('0x25')],'owner_id':_0x136673[_0x2493('0x1c')],'created_at':_0x579055['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4a2c5e[_0x2493('0xe')]=_0x3ed3c6;logger[_0x2493('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x4a2c5e)[_0x2493('0x11')](function(_0x55f3aa){_0x136673[_0x2493('0x27')]=_0x55f3aa[_0x2493('0x2d')]['id'];_0x5e03d4(_0x136673);})[_0x2493('0x2e')](function(_0x4282e5){logger[_0x2493('0x16')]('['+[_0x353dcf['toUpperCase']()]+']',_0x4282e5[_0x2493('0x2f')]);_0x19f54b(_0x4282e5[_0x2493('0x2f')]);});});}function getTicket(_0x22095f,_0x206ff2,_0x1035d5,_0x1197e2,_0x38f395){return function(_0x655883){logger['info'](_0x2493('0x30'));return new Promise(function(_0x37ce27,_0x4ad376){var _0x517cd9=moment();var _0x57a2a4={'method':_0x2493('0x31'),'uri':_0x1035d5+'/api/tasks','body':{'title':intUtil[_0x2493('0x32')](_0x1197e2[_0x2493('0x33')],_0x38f395,'\x20'),'description':intUtil[_0x2493('0x32')](_0x1197e2['Descriptions'],_0x38f395,'\x0a'),'owner_id':_0x655883['userId'],'creater_id':_0x655883[_0x2493('0x1e')],'targetable_id':_0x655883[_0x2493('0x27')],'targetable_type':'Contact','created_at':_0x517cd9['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x517cd9[_0x2493('0x34')](0x1e,'m')[_0x2493('0x23')](_0x2493('0x35'))},'json':!![]};_0x57a2a4[_0x2493('0xe')]=_0x206ff2;return rp(_0x57a2a4)[_0x2493('0x11')](function(_0x234dc3){_0x655883['ticketId']=_0x234dc3['task']['id'];logger[_0x2493('0xf')](_0x2493('0x36'),_0x655883[_0x2493('0x37')]);_0x37ce27(_0x655883);})[_0x2493('0x2e')](function(_0x53208d){logger[_0x2493('0x16')]('['+[_0x22095f[_0x2493('0x17')]()]+']',_0x53208d['message']);_0x4ad376(_0x53208d[_0x2493('0x2f')]);});});};}function emit(_0x5a1c2d,_0x4832d9,_0x24c2fe){var _0x5b0298={'uri':_0x5a1c2d+'/contacts/'+_0x24c2fe};io['to'](util[_0x2493('0x23')](_0x2493('0x38'),_0x4832d9))[_0x2493('0x39')](_0x2493('0x3a'),_0x5b0298);}exports['cs']=function(_0x356b3e,_0x66ff81,_0x501001,_0x209877,_0x579b34,_0x3cb949,_0x27b360,_0x4210d1){var _0x3300d1={};var _0x214a03={'Authorization':_0x2493('0x3b')+_0x3cb949[_0x2493('0x3c')]};_0x3cb949[_0x2493('0x3d')]=intUtil[_0x2493('0x3e')](_0x3cb949[_0x2493('0x3d')]);_0x3cb949[_0x2493('0x3f')]=intUtil[_0x2493('0x3e')](_0x3cb949[_0x2493('0x3f')]);var _0x231dde=_0x3cb949[_0x2493('0x3d')];_0x3300d1[_0x2493('0x14')]=_0x3cb949[_0x2493('0x40')];_0x3300d1[_0x2493('0x25')]=_0x4210d1[_0x2493('0x41')]()==='outbound'?_0x66ff81[_0x2493('0x42')]:_0x66ff81[_0x2493('0x43')];_0x3300d1[_0x2493('0x44')]=_0x4210d1===_0x2493('0x45')||_0x4210d1===_0x2493('0x46')?_0x2493('0x45'):_0x2493('0x47');if(_0x209877){_0x3300d1[_0x2493('0x18')]=_0x209877[_0x2493('0x1b')];}var _0x290593=util[_0x2493('0x23')](_0x2493('0x48'),_0x3cb949[_0x2493('0x3f')],_0x66ff81['uniqueid'],md5(_0x66ff81[_0x2493('0x49')]));if(_0x579b34&&_0x579b34[_0x2493('0x4a')]){logger[_0x2493('0xf')](_0x2493('0x4b'),_0x2493('0x4c'));_0x66ff81[_0x2493('0x4d')]=_0x290593;}else if(_0x27b360&&_0x27b360['recordingFormat']&&_0x27b360[_0x2493('0x4e')]!=='none'){logger[_0x2493('0xf')](_0x2493('0x4f'),_0x2493('0x4c'));_0x66ff81['recordingURL']=_0x290593;}else{_0x66ff81[_0x2493('0x4d')]='';}return getAdminId(_0x3300d1,_0x4210d1,_0x214a03,_0x231dde)[_0x2493('0x11')](getUser(_0x4210d1,_0x214a03,_0x231dde))[_0x2493('0x11')](getEndUser(_0x4210d1,_0x214a03,_0x231dde))[_0x2493('0x11')](getTicket(_0x4210d1,_0x214a03,_0x231dde,_0x501001,_0x66ff81))[_0x2493('0x11')](function(_0x1b3210){logger['info'](util['format'](_0x2493('0x50'),_0x1b3210[_0x2493('0x37')]));if(_0x4210d1!=='unmanaged'){logger[_0x2493('0xf')]('['+[_0x4210d1[_0x2493('0x17')]()]+']',_0x2493('0x51'));emit(_0x231dde,_0x209877[_0x2493('0x52')],_0x1b3210['endUserId']);}})[_0x2493('0x2e')](function(_0x5ac972){logger['error']('['+[_0x4210d1[_0x2493('0x17')]()]+_0x2493('0x53'),util[_0x2493('0x54')](_0x5ac972,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4993=['Contact','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','ticketId','/contacts/','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','userEmail','catch','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions'];(function(_0x5d6bd7,_0x3d97d2){var _0x29a88b=function(_0x540716){while(--_0x540716){_0x5d6bd7['push'](_0x5d6bd7['shift']());}};_0x29a88b(++_0x3d97d2);}(_0x4993,0x122));var _0x3499=function(_0x3b59aa,_0x7a990b){_0x3b59aa=_0x3b59aa-0x0;var _0x5cad80=_0x4993[_0x3b59aa];return _0x5cad80;};'use strict';var _=require('lodash');var rp=require(_0x3499('0x0'));var md5=require('md5');var util=require('util');var moment=require(_0x3499('0x1'));var Promise=require(_0x3499('0x2'));var Redis=require(_0x3499('0x3'));var intUtil=require(_0x3499('0x4'));var config=require(_0x3499('0x5'));var logger=require(_0x3499('0x6'))('freshsales');config[_0x3499('0x7')]=_[_0x3499('0x8')](config[_0x3499('0x7')],{'host':_0x3499('0x9'),'port':0x18eb});var io=require(_0x3499('0xa'))(new Redis(config[_0x3499('0x7')]));function getAdminId(_0x5945a1,_0x3bddf2,_0x2a8030,_0xfe34aa){return new Promise(function(_0x1e979b,_0x5b65ad){var _0x234ed6=![];var _0x299a0e={'method':_0x3499('0xb'),'uri':_0xfe34aa+_0x3499('0xc'),'json':!![]};_0x299a0e['headers']=_0x2a8030;logger[_0x3499('0xd')]('Getting\x20admin\x20information');return rp(_0x299a0e)[_0x3499('0xe')](function(_0xb3e434){if(_0xb3e434){var _0x7c67c0=_0xb3e434[_0x3499('0xf')];var _0x3252fa=null;for(_0x3252fa=0x0;_0x3252fa<_0x7c67c0['length'];_0x3252fa++){if(_0x7c67c0[_0x3252fa][_0x3499('0x10')]===_0x5945a1[_0x3499('0x11')]){_0x5945a1[_0x3499('0x12')]=_0x7c67c0[_0x3252fa]['id'];_0x234ed6=!![];}}if(_0x234ed6){logger[_0x3499('0xd')]('Admin\x20found:',_0x5945a1[_0x3499('0x12')]);_0x1e979b(_0x5945a1);}else{_0x5b65ad({'statusCode':0x194,'message':_0x3499('0x13')});}}else{_0x5b65ad({'statusCode':0x194,'message':_0x3499('0x13')});}})['catch'](function(_0x5636dc){logger[_0x3499('0x14')]('['+[_0x3bddf2[_0x3499('0x15')]()]+']',_0x5636dc['message']);_0x5b65ad(_0x5636dc);});});}function getUser(_0x4dec61,_0x4700bf,_0x2fad67){return function(_0x10533d){return new Promise(function(_0x4cec83,_0x40b594){var _0x46a35f={'method':_0x3499('0xb'),'uri':_0x2fad67+_0x3499('0xc'),'json':!![]};_0x46a35f[_0x3499('0x16')]=_0x4700bf;logger[_0x3499('0xd')](_0x3499('0x17'));return rp(_0x46a35f)[_0x3499('0xe')](function(_0x409023){if(_0x409023){var _0x2da448=_0x409023['users'];var _0x57ee42=![];var _0x5d6c06=null;if(_0x10533d[_0x3499('0x18')]!==null){logger[_0x3499('0xd')](_0x3499('0x19'),_0x10533d[_0x3499('0x18')]);_0x10533d['userEmail']=_0x10533d[_0x3499('0x18')];for(_0x5d6c06=0x0;_0x5d6c06<_0x2da448[_0x3499('0x1a')];_0x5d6c06++){if(_0x2da448[_0x5d6c06]['email']===_0x10533d[_0x3499('0x18')]){_0x57ee42=!![];_0x10533d[_0x3499('0x1b')]=_0x2da448[_0x5d6c06]['id'];logger[_0x3499('0xd')](_0x3499('0x1c'),_0x10533d[_0x3499('0x1b')]);}}}if(!_0x57ee42){logger[_0x3499('0xd')]('Admin\x20selected');_0x10533d[_0x3499('0x1d')]=_0x10533d[_0x3499('0x11')];_0x10533d['userId']=_0x10533d['adminId'];_0x57ee42=!![];}if(_0x57ee42){_0x4cec83(_0x10533d);}else{_0x40b594({'statusCode':0x194,'message':_0x3499('0x13')});}}else{_0x40b594({'statusCode':0x194,'message':_0x3499('0x13')});}})[_0x3499('0x1e')](function(_0x4a3287){logger[_0x3499('0x14')]('['+[_0x4dec61[_0x3499('0x15')]()]+']',_0x4a3287[_0x3499('0x1f')]);_0x40b594(_0x4a3287);});});};}function searchContact(_0x1d160c,_0x473494,_0x21e8ab,_0xf59929){return new Promise(function(_0xa7bbb3,_0x4416d7){var _0x32c961={'method':_0x3499('0xb'),'headers':_0x473494,'uri':_0x1d160c+_0x3499('0x20')+_0xf59929+_0x3499('0x21')+_0x21e8ab+_0x3499('0x22'),'json':!![]};rp(_0x32c961)['then'](function(_0x126940){var _0x17e51a=_[_0x3499('0x23')](_0x126940[_0x3499('0x24')][_0x3499('0x24')],[_0x21e8ab,_0xf59929]);_0xa7bbb3(_0x17e51a);})[_0x3499('0x1e')](function(_0x33cf51){_0x4416d7(_0x33cf51);});});}function getEndUser(_0x4f5d4c,_0x220931,_0x1ba63f){return function(_0x3d856a){return new Promise(function(_0x5ca0f1,_0x279866){logger[_0x3499('0xd')](util[_0x3499('0x25')](_0x3499('0x26'),_0x3d856a['contactNumber']));searchContact(_0x1ba63f,_0x220931,_0x3499('0x27'),_0x3d856a[_0x3499('0x28')])[_0x3499('0xe')](function(_0x478991){if(_0x478991){_0x3d856a[_0x3499('0x29')]=_0x478991['id'];logger[_0x3499('0xd')](_0x3499('0x2a'),_0x3d856a['endUserId']);return _0x5ca0f1(_0x3d856a);}searchContact(_0x1ba63f,_0x220931,_0x3499('0x2b'),_0x3d856a[_0x3499('0x28')])[_0x3499('0xe')](function(_0x3cfd03){if(_0x3cfd03){_0x3d856a[_0x3499('0x29')]=_0x3cfd03['id'];logger[_0x3499('0xd')](_0x3499('0x2c'),_0x3d856a[_0x3499('0x29')]);return _0x5ca0f1(_0x3d856a);}createEndUser(_0x3d856a,_0x4f5d4c,_0x220931,_0x1ba63f)[_0x3499('0xe')](function(_0x31d57e){logger['info'](_0x3499('0x2d'),_0x31d57e[_0x3499('0x29')]);return _0x5ca0f1(_0x31d57e);});});})[_0x3499('0x1e')](function(_0x5c3b1d){_0x279866(_0x5c3b1d);});});};}function createEndUser(_0x4e3c11,_0x59687a,_0x1d2da2,_0x141559){return new Promise(function(_0x2e7791,_0x4a9a12){var _0x9bcf73=moment();var _0x4606b7={'method':_0x3499('0x2e'),'uri':_0x141559+_0x3499('0x2f'),'body':{'contact':{'last_name':_0x4e3c11[_0x3499('0x28')],'work_number':_0x4e3c11[_0x3499('0x28')],'mobile_number':_0x4e3c11[_0x3499('0x28')],'owner_id':_0x4e3c11[_0x3499('0x1b')],'created_at':_0x9bcf73[_0x3499('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4606b7[_0x3499('0x16')]=_0x1d2da2;logger[_0x3499('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x4606b7)['then'](function(_0x38c527){_0x4e3c11[_0x3499('0x29')]=_0x38c527[_0x3499('0x30')]['id'];_0x2e7791(_0x4e3c11);})['catch'](function(_0x3e9544){logger[_0x3499('0x14')]('['+[_0x59687a[_0x3499('0x15')]()]+']',_0x3e9544['message']);_0x4a9a12(_0x3e9544[_0x3499('0x1f')]);});});}function getTicket(_0x510793,_0x2fb501,_0x1b194e,_0x23d681,_0x2f70d9){return function(_0x3f8cdb){logger[_0x3499('0xd')](_0x3499('0x31'));return new Promise(function(_0x757b6,_0x3bcbf4){var _0x353614=moment();var _0x44336f={'method':_0x3499('0x2e'),'uri':_0x1b194e+_0x3499('0x32'),'body':{'title':intUtil[_0x3499('0x33')](_0x23d681[_0x3499('0x34')],_0x2f70d9,'\x20'),'description':intUtil[_0x3499('0x33')](_0x23d681[_0x3499('0x35')],_0x2f70d9,'\x0a'),'owner_id':_0x3f8cdb['userId'],'creater_id':_0x3f8cdb['adminId'],'targetable_id':_0x3f8cdb[_0x3499('0x29')],'targetable_type':_0x3499('0x36'),'created_at':_0x353614[_0x3499('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x353614['add'](0x1e,'m')[_0x3499('0x25')](_0x3499('0x37'))},'json':!![]};_0x44336f[_0x3499('0x16')]=_0x2fb501;return rp(_0x44336f)[_0x3499('0xe')](function(_0x11bb21){_0x3f8cdb['ticketId']=_0x11bb21[_0x3499('0x38')]['id'];logger['info'](_0x3499('0x39'),_0x3f8cdb[_0x3499('0x3a')]);_0x757b6(_0x3f8cdb);})[_0x3499('0x1e')](function(_0x7e1e63){logger[_0x3499('0x14')]('['+[_0x510793[_0x3499('0x15')]()]+']',_0x7e1e63['message']);_0x3bcbf4(_0x7e1e63[_0x3499('0x1f')]);});});};}function emit(_0x5bee1c,_0x8792d4,_0x43d0de){var _0x56ad62={'uri':_0x5bee1c+_0x3499('0x3b')+_0x43d0de};io['to'](util[_0x3499('0x25')]('user:%s',_0x8792d4))['emit'](_0x3499('0x3c'),_0x56ad62);}exports['cs']=function(_0x1ac42a,_0x3e79a8,_0x575b68,_0x340df1,_0x5c6a07,_0x5f5524,_0x58c12b,_0xd1b21e){var _0x199fe4={};var _0x3f66f5={'Authorization':_0x3499('0x3d')+_0x5f5524[_0x3499('0x3e')]};_0x5f5524[_0x3499('0x3f')]=intUtil[_0x3499('0x40')](_0x5f5524[_0x3499('0x3f')]);_0x5f5524[_0x3499('0x41')]=intUtil[_0x3499('0x40')](_0x5f5524[_0x3499('0x41')]);var _0x2ce726=_0x5f5524['remoteUri'];_0x199fe4['adminEmail']=_0x5f5524[_0x3499('0x42')];_0x199fe4['contactNumber']=_0xd1b21e[_0x3499('0x43')]()===_0x3499('0x44')?_0x3e79a8[_0x3499('0x45')]:_0x3e79a8[_0x3499('0x46')];_0x199fe4[_0x3499('0x47')]=_0xd1b21e===_0x3499('0x48')||_0xd1b21e===_0x3499('0x49')?_0x3499('0x48'):_0x3499('0x44');if(_0x340df1){_0x199fe4[_0x3499('0x18')]=_0x340df1[_0x3499('0x10')];}var _0x3178e6=util['format'](_0x3499('0x4a'),_0x5f5524[_0x3499('0x41')],_0x3e79a8[_0x3499('0x4b')],md5(_0x3e79a8[_0x3499('0x4b')]));if(_0x5c6a07&&_0x5c6a07[_0x3499('0x4c')]){logger[_0x3499('0xd')](_0x3499('0x4d'),'Recording\x20is\x20enabled!');_0x3e79a8[_0x3499('0x4e')]=_0x3178e6;}else if(_0x58c12b&&_0x58c12b['recordingFormat']&&_0x58c12b[_0x3499('0x4f')]!==_0x3499('0x50')){logger['info'](_0x3499('0x51'),_0x3499('0x52'));_0x3e79a8[_0x3499('0x4e')]=_0x3178e6;}else{_0x3e79a8['recordingURL']='';}return getAdminId(_0x199fe4,_0xd1b21e,_0x3f66f5,_0x2ce726)[_0x3499('0xe')](getUser(_0xd1b21e,_0x3f66f5,_0x2ce726))[_0x3499('0xe')](getEndUser(_0xd1b21e,_0x3f66f5,_0x2ce726))[_0x3499('0xe')](getTicket(_0xd1b21e,_0x3f66f5,_0x2ce726,_0x575b68,_0x3e79a8))[_0x3499('0xe')](function(_0x431179){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x431179[_0x3499('0x3a')]));if(_0xd1b21e!==_0x3499('0x49')){logger[_0x3499('0xd')]('['+[_0xd1b21e[_0x3499('0x15')]()]+']',_0x3499('0x53'));emit(_0x2ce726,_0x340df1[_0x3499('0x54')],_0x431179[_0x3499('0x29')]);}})['catch'](function(_0x1bd36c){logger['error']('['+[_0xd1b21e[_0x3499('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x3499('0x55')](_0x1bd36c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index a152e6e..0e4b26e 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17d5=['./freshdesk','./zoho','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','../../../../config/logger','[EXEC]','format','error','util','./zendesk','./salesforce','./sugarcrm'];(function(_0xe86218,_0x563933){var _0x451d87=function(_0x1330dc){while(--_0x1330dc){_0xe86218['push'](_0xe86218['shift']());}};_0x451d87(++_0x563933);}(_0x17d5,0xa6));var _0x517d=function(_0x2dd9d3,_0x3e2780){_0x2dd9d3=_0x2dd9d3-0x0;var _0x534180=_0x17d5[_0x2dd9d3];return _0x534180;};'use strict';var _=require('lodash');var util=require(_0x517d('0x0'));var zendesk=require(_0x517d('0x1'));var salesforce=require(_0x517d('0x2'));var sugarcrm=require(_0x517d('0x3'));var freshdesk=require(_0x517d('0x4'));var zoho=require(_0x517d('0x5'));var desk=require('./desk');var vtiger=require(_0x517d('0x6'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x517d('0x7'));var integrations=[_0x517d('0x8'),_0x517d('0x9'),_0x517d('0xa'),'freshdesk',_0x517d('0xb'),_0x517d('0xc'),'vtiger',_0x517d('0xd'),_0x517d('0xe'),_0x517d('0xf')];exports['exec']=function(_0xb5dc5a,_0x3ab010,_0x4000f2,_0x16e2fe,_0x4a08cd,_0x1e609c){if(_0x4000f2){if(_[_0x517d('0x10')](integrations,_0xb5dc5a[_0x517d('0x11')][_0x517d('0x12')]())){try{var _0x502adc=null;var _0x4daf4d='';var _0x291591=_0x4000f2[_0xb5dc5a[_0x517d('0x11')][_0x517d('0x12')]()];if(_0x291591){var _0x3419c0=_0x291591[_0xb5dc5a[_0x517d('0x13')]];if(_0x3419c0){var _0x4c19f2=_[_0x517d('0x14')](_0x3419c0[_0x517d('0x15')],{'id':parseInt(_0xb5dc5a[_0x517d('0x16')],0xa)});if(_0x4c19f2){if(_0x16e2fe){if(_0x4a08cd&&_0x3ab010['queue']){_0x4daf4d=_0x517d('0x17');}else if(_0x3ab010[_0x517d('0x18')]){_0x4daf4d=_0x517d('0x19');}else{console[_0x517d('0x1a')](_0x517d('0x1b'),_0x3ab010);}}else{_0x4daf4d=_0x517d('0x1c');}switch(_0xb5dc5a[_0x517d('0x11')][_0x517d('0x12')]()){case _0x517d('0x8'):zendesk[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case'salesforce':salesforce[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case'sugarcrm':sugarcrm[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case'freshdesk':freshdesk[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case _0x517d('0xb'):zoho[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case'desk':desk[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case'vtiger':vtiger[_0x4daf4d](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c);break;case _0x517d('0xe'):freshsales['cs'](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c,_0x4daf4d);break;case _0x517d('0xf'):servicenow['cs'](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c,_0x4daf4d);break;case _0x517d('0xd'):dynamics365['cs'](_0xb5dc5a,_0x3ab010,_0x4c19f2,_0x16e2fe,_0x4a08cd,_0x3419c0,_0x1e609c,_0x4daf4d);break;default:console[_0x517d('0x1a')](_0x517d('0x1d'));}}else{_0x502adc=require(_0x517d('0x1e'))(_0xb5dc5a[_0x517d('0x11')][_0x517d('0x12')]());_0x502adc['error'](_0x517d('0x1f'),util[_0x517d('0x20')]('%s\x20configuration\x20#%s\x20not\x20found',_0xb5dc5a['data1'][_0x517d('0x12')](),_0xb5dc5a[_0x517d('0x16')]));}}else{_0x502adc=require(_0x517d('0x1e'))(_0xb5dc5a[_0x517d('0x11')][_0x517d('0x12')]());_0x502adc['error'](_0x517d('0x1f'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0xb5dc5a[_0x517d('0x11')][_0x517d('0x12')](),_0xb5dc5a[_0x517d('0x13')]));}}else{}}catch(_0x3e46aa){console[_0x517d('0x21')](_0x3e46aa);}}}}; \ No newline at end of file +var _0x5bd2=['lodash','util','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','[EXEC]','error','format','%s\x20account\x20#%s\x20not\x20found'];(function(_0x393345,_0x2a5a46){var _0xa9b815=function(_0x2af11b){while(--_0x2af11b){_0x393345['push'](_0x393345['shift']());}};_0xa9b815(++_0x2a5a46);}(_0x5bd2,0x1a2));var _0x25bd=function(_0x1e3b6e,_0x5ced5d){_0x1e3b6e=_0x1e3b6e-0x0;var _0x33a8c5=_0x5bd2[_0x1e3b6e];return _0x33a8c5;};'use strict';var _=require(_0x25bd('0x0'));var util=require(_0x25bd('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x25bd('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x25bd('0x3'));var desk=require(_0x25bd('0x4'));var vtiger=require(_0x25bd('0x5'));var servicenow=require(_0x25bd('0x6'));var dynamics365=require(_0x25bd('0x7'));var freshsales=require(_0x25bd('0x8'));var integrations=[_0x25bd('0x9'),_0x25bd('0xa'),_0x25bd('0xb'),_0x25bd('0xc'),_0x25bd('0xd'),_0x25bd('0xe'),'vtiger','dynamics365','freshsales',_0x25bd('0xf')];exports[_0x25bd('0x10')]=function(_0x319de4,_0x2f4208,_0x21466c,_0x4a8334,_0x6a4ad5,_0x559877){if(_0x21466c){if(_['includes'](integrations,_0x319de4['data1'][_0x25bd('0x11')]())){try{var _0x3b7cd=null;var _0x1d882a='';var _0x124da2=_0x21466c[_0x319de4[_0x25bd('0x12')][_0x25bd('0x11')]()];if(_0x124da2){var _0x54c7d3=_0x124da2[_0x319de4[_0x25bd('0x13')]];if(_0x54c7d3){var _0x3f79a8=_[_0x25bd('0x14')](_0x54c7d3[_0x25bd('0x15')],{'id':parseInt(_0x319de4[_0x25bd('0x16')],0xa)});if(_0x3f79a8){if(_0x4a8334){if(_0x6a4ad5&&_0x2f4208[_0x25bd('0x17')]){_0x1d882a=_0x25bd('0x17');}else if(_0x2f4208[_0x25bd('0x18')]){_0x1d882a=_0x25bd('0x19');}else{console[_0x25bd('0x1a')](_0x25bd('0x1b'),_0x2f4208);}}else{_0x1d882a=_0x25bd('0x1c');}switch(_0x319de4[_0x25bd('0x12')][_0x25bd('0x11')]()){case _0x25bd('0x9'):zendesk[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0xa'):salesforce[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case'sugarcrm':sugarcrm[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case'freshdesk':freshdesk[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0xd'):zoho[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0xe'):desk[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0x1d'):vtiger[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0x1e'):freshsales['cs'](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877,_0x1d882a);break;case _0x25bd('0xf'):servicenow['cs'](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877,_0x1d882a);break;case _0x25bd('0x1f'):dynamics365['cs'](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877,_0x1d882a);break;default:console['log'](_0x25bd('0x20'));}}else{_0x3b7cd=require(_0x25bd('0x21'))(_0x319de4[_0x25bd('0x12')][_0x25bd('0x11')]());_0x3b7cd['error'](_0x25bd('0x22'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x319de4[_0x25bd('0x12')]['toLowerCase'](),_0x319de4[_0x25bd('0x16')]));}}else{_0x3b7cd=require(_0x25bd('0x21'))(_0x319de4[_0x25bd('0x12')]['toLowerCase']());_0x3b7cd[_0x25bd('0x23')](_0x25bd('0x22'),util[_0x25bd('0x24')](_0x25bd('0x25'),_0x319de4[_0x25bd('0x12')]['toLowerCase'](),_0x319de4[_0x25bd('0x13')]));}}else{}}catch(_0x2cd63d){console[_0x25bd('0x23')](_0x2cd63d);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 1ec3d09..e9950b0 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x568c=['[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','unmanaged','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','IsRecurrence','endUserType','contact','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','Contact','lead','first','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.','LastName','','format','No\x20Company','Caller\x20-\x20%s','forEach','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','[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','trigger:browser:url','%s/%s/e','instanceUrl'];(function(_0x3edf2d,_0x312186){var _0x6069b5=function(_0x434e2a){while(--_0x434e2a){_0x3edf2d['push'](_0x3edf2d['shift']());}};_0x6069b5(++_0x312186);}(_0x568c,0x1a2));var _0xc568=function(_0x9b6627,_0x393ac1){_0x9b6627=_0x9b6627-0x0;var _0x4a8979=_0x568c[_0x9b6627];return _0x4a8979;};'use strict';var _=require(_0xc568('0x0'));var rp=require('request-promise');var moment=require(_0xc568('0x1'));var BPromise=require('bluebird');var md5=require(_0xc568('0x2'));var jsforce=require(_0xc568('0x3'));var util=require(_0xc568('0x4'));var Redis=require(_0xc568('0x5'));var intUtil=require('./util');var config=require(_0xc568('0x6'));var logger=require(_0xc568('0x7'))(_0xc568('0x8'));config['redis']=_[_0xc568('0x9')](config[_0xc568('0xa')],{'host':_0xc568('0xb'),'port':0x18eb});var io=require(_0xc568('0xc'))(new Redis(config['redis']));function emit(_0x1a1b96,_0x411b8c,_0x2989cc){io['to'](_0x1a1b96)[_0xc568('0xd')](_0x411b8c,_0x2989cc);}function getTicket(_0x3c4095,_0x20b25b,_0x11b856,_0x181e7c,_0x176f61,_0xba73,_0x108795,_0x3cbd9d){var _0x4a3c1e=Object[_0xc568('0xe')]({},{'OwnerId':_0x20b25b['id'],'Subject':intUtil[_0xc568('0xf')](_0x181e7c[_0xc568('0x10')],_0x176f61,'\x20'),'Description':intUtil['getString'](_0x181e7c[_0xc568('0x11')],_0x176f61,'\x0a')},getCustomFields(_0xba73,_0x176f61));if(_0x11b856){if(_0x181e7c['ticketType']==='Task'){_0x4a3c1e['ActivityDate']=moment['utc']();_0x4a3c1e['IsReminderSet']=![];_0x4a3c1e[_0xc568('0x12')]=![];if(_0x11b856[_0xc568('0x13')]===_0xc568('0x14')||_0x11b856[_0xc568('0x13')]==='lead'){_0x4a3c1e[_0xc568('0x15')]=_0x11b856['id'];}else if(_0x11b856[_0xc568('0x13')]===_0xc568('0x16')){_0x4a3c1e[_0xc568('0x17')]=_0x11b856['id'];}}else if(_0x181e7c[_0xc568('0x18')]===_0xc568('0x19')){if(_0x11b856[_0xc568('0x13')]===_0xc568('0x14')){_0x4a3c1e[_0xc568('0x1a')]=_0x11b856['id'];}else if(_0x11b856[_0xc568('0x13')]===_0xc568('0x16')){_0x4a3c1e[_0xc568('0x1b')]=_0x11b856['id'];}else if(_0x11b856[_0xc568('0x13')]==='lead'&&_0x181e7c[_0xc568('0x1c')]){_0x4a3c1e[_0x181e7c[_0xc568('0x1c')]]=_0x11b856['id'];}else{logger[_0xc568('0x1d')](_0xc568('0x1e'));}}}return _0x108795['sobject'](_0x181e7c[_0xc568('0x18')])[_0xc568('0x1f')](_0x4a3c1e);}function getUser(_0x49d904,_0x461036,_0x4f8aa3){if(!_['isNil'](_0x461036)&&intUtil[_0xc568('0x20')](_0x461036)){var _0x2486e5={'Email':_0x461036};var _0xd45a75={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4f8aa3[_0xc568('0x21')](_0xc568('0x22'))[_0xc568('0x23')](_0x2486e5,_0xd45a75)[_0xc568('0x24')]()[_0xc568('0x25')](function(_0x487e9a){if(_0x487e9a[_0xc568('0x26')]){var _0x31c546=_[_0xc568('0x23')](_0x487e9a,function(_0x162c46){return _0x162c46[_0xc568('0x27')]===_0x461036;});if(_0x31c546){logger[_0xc568('0x1d')](_0xc568('0x28'),_0x461036);return BPromise[_0xc568('0x29')]({'id':_0x31c546['Id'],'name':_0x31c546[_0xc568('0x2a')]});}}else{logger[_0xc568('0x1d')](_0xc568('0x2b'),_0x461036);return _0x4f8aa3[_0xc568('0x2c')]()[_0xc568('0x25')](function(_0x4bda43){return BPromise[_0xc568('0x29')]({'id':_0x4bda43[_0xc568('0x2d')],'name':_0x4bda43[_0xc568('0x2e')]});});}});}else{logger[_0xc568('0x1d')](_0xc568('0x2b'),_0x461036);return _0x4f8aa3[_0xc568('0x2c')]()[_0xc568('0x25')](function(_0xf98b04){return BPromise[_0xc568('0x29')]({'id':_0xf98b04[_0xc568('0x2d')],'name':_0xf98b04['display_name']});});}}function getEndUser(_0x1094f2,_0x91ad07,_0x579ae8,_0x1eb2f6,_0x26d8af){var _0x8f64cd={'$or':{'Phone':_0x1eb2f6}};var _0x32cb1a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc568('0x29')]()['then'](function(){logger[_0xc568('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x1eb2f6,_0x91ad07[_0xc568('0x2f')]);switch(_0x91ad07['moduleSearch']){case _0xc568('0x30'):var _0x35fc52=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x32')]){var _0x6c1068={};_0x6c1068[_0x91ad07['additionalSearchContact']]=_0x1eb2f6;_[_0xc568('0x33')](_0x35fc52[_0xc568('0x34')],_0x6c1068);}return _0x26d8af['sobject']('Contact')[_0xc568('0x23')](_0x35fc52,_0x32cb1a)['execute']()['then'](function(_0x5346ed){if(_0x5346ed&&_0x5346ed[_0xc568('0x26')]){return _0x5346ed;}else{var _0x49f3d7=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x35')]){var _0x29574c={};_0x29574c[_0x91ad07[_0xc568('0x35')]]=_0x1eb2f6;_[_0xc568('0x33')](_0x49f3d7[_0xc568('0x34')],_0x29574c);}return _0x26d8af[_0xc568('0x21')]('Lead')[_0xc568('0x23')](_0x49f3d7,_0x32cb1a);}});case _0xc568('0x36'):var _0x538565=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x37')]){var _0x6c1068={};_0x6c1068[_0x91ad07[_0xc568('0x37')]]=_0x1eb2f6;_['merge'](_0x538565[_0xc568('0x34')],_0x6c1068);}return _0x26d8af[_0xc568('0x21')](_0xc568('0x38'))[_0xc568('0x23')](_0x538565,_0x32cb1a)[_0xc568('0x24')]()[_0xc568('0x25')](function(_0x33639a){if(_0x33639a&&_0x33639a[_0xc568('0x26')]){return _0x33639a;}else{var _0x293319=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x32')]){var _0x2b5285={};_0x2b5285[_0x91ad07['additionalSearchContact']]=_0x1eb2f6;_['merge'](_0x293319['$or'],_0x2b5285);}return _0x26d8af['sobject']('Contact')['find'](_0x293319,_0x32cb1a)['then'](function(_0x22df7b){if(_0x22df7b&&_0x22df7b['length']){return _0x22df7b;}else{var _0x3b11be=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x35')]){var _0x4252c8={};_0x4252c8[_0x91ad07[_0xc568('0x35')]]=_0x1eb2f6;_[_0xc568('0x33')](_0x3b11be[_0xc568('0x34')],_0x4252c8);}return _0x26d8af[_0xc568('0x21')](_0xc568('0x39'))[_0xc568('0x23')](_0x3b11be,_0x32cb1a);}});}});case _0xc568('0x14'):var _0x35fc52=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x32')]){var _0x6c1068={};_0x6c1068[_0x91ad07[_0xc568('0x32')]]=_0x1eb2f6;_[_0xc568('0x33')](_0x35fc52[_0xc568('0x34')],_0x6c1068);}return _0x26d8af['sobject'](_0xc568('0x3a'))[_0xc568('0x23')](_0x35fc52,_0x32cb1a)[_0xc568('0x24')]();case _0xc568('0x3b'):var _0x5e7df8=_['cloneDeep'](_0x8f64cd);if(_0x91ad07[_0xc568('0x35')]){var _0x6c1068={};_0x6c1068[_0x91ad07[_0xc568('0x35')]]=_0x1eb2f6;_[_0xc568('0x33')](_0x5e7df8[_0xc568('0x34')],_0x6c1068);}return _0x26d8af['sobject'](_0xc568('0x39'))[_0xc568('0x23')](_0x5e7df8,_0x32cb1a);case'account':var _0x538565=_[_0xc568('0x31')](_0x8f64cd);if(_0x91ad07[_0xc568('0x37')]){var _0x6c1068={};_0x6c1068[_0x91ad07['additionalSearchAccount']]=_0x1eb2f6;_[_0xc568('0x33')](_0x538565['$or'],_0x6c1068);}return _0x26d8af[_0xc568('0x21')](_0xc568('0x38'))[_0xc568('0x23')](_0x538565,_0x32cb1a);default:return null;}})['then'](function(_0x118385){if(_0x118385&&_0x118385[_0xc568('0x26')]){var _0x4df684=_[_0xc568('0x3c')](_0x118385);if(_0x4df684){return BPromise['resolve']({'id':_0x4df684['Id'],'name':_0x4df684[_0xc568('0x2a')],'phone':_0x4df684[_0xc568('0x3d')],'endUserType':_0x4df684[_0xc568('0x3e')][_0xc568('0x3f')][_0xc568('0x40')]()});}}})['then'](function(_0x1cae92){if(_0x1cae92){logger['info'](_0xc568('0x41'),_0x1cae92['endUserType'],_0x1eb2f6);return BPromise[_0xc568('0x29')](_0x1cae92);}else{logger[_0xc568('0x1d')](_0xc568('0x42'),_0x1eb2f6);var _0x428389={'Phone':_0x1eb2f6};if(_0x91ad07['moduleCreate']){if(_0x91ad07[_0xc568('0x43')]==='contact'){logger[_0xc568('0x1d')](_0xc568('0x44'),_0x1eb2f6,_0x91ad07[_0xc568('0x43')]);_0x428389[_0xc568('0x45')]=_0x579ae8!==_0xc568('0x46')?_0x579ae8:util[_0xc568('0x47')]('Caller\x20-\x20%s',_0x1eb2f6);}else if(_0x91ad07['moduleCreate']===_0xc568('0x3b')){logger[_0xc568('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1eb2f6,_0x91ad07['moduleCreate']);_0x428389[_0xc568('0x45')]=_0x579ae8!==_0xc568('0x46')?_0x579ae8:util[_0xc568('0x47')]('Caller\x20-\x20%s',_0x1eb2f6);_0x428389['Company']=_0xc568('0x48');}else if(_0x91ad07['moduleCreate']===_0xc568('0x16')){logger[_0xc568('0x1d')](_0xc568('0x44'),_0x1eb2f6,_0x91ad07['moduleCreate']);_0x428389[_0xc568('0x2a')]=_0x579ae8!==_0xc568('0x46')?_0x579ae8:util[_0xc568('0x47')](_0xc568('0x49'),_0x1eb2f6);}else{return null;}}return _0x26d8af[_0xc568('0x21')](_['upperFirst'](_0x91ad07['moduleCreate']))['create'](_0x428389)[_0xc568('0x25')](function(_0x22c275){return BPromise[_0xc568('0x29')]({'id':_0x22c275['id'],'endUserType':_0x91ad07[_0xc568('0x43')]});});}});}function getCustomFields(_0x2708b6,_0x28343c){var _0x2675f1={};if(_0x2708b6[_0xc568('0x26')]>0x0){_[_0xc568('0x4a')](_0x2708b6,function(_0x223f77){if(_[_0xc568('0x4b')]([_0xc568('0x4c'),_0xc568('0x4d')],_0x223f77[_0xc568('0x3f')])&&_0x223f77['idField']){_0x2675f1[_0x223f77[_0xc568('0x4e')]]=_0x223f77['content'][_0xc568('0x4f')]();}else if(_0x223f77[_0xc568('0x3f')]===_0xc568('0x50')&&_0x223f77[_0xc568('0x51')]&&_0x223f77[_0xc568('0x4e')]){_0x28343c[_0x223f77[_0xc568('0x51')]]&&(_0x2675f1[_0x223f77[_0xc568('0x4e')]]=_0x28343c[_0x223f77['variableName']][_0xc568('0x4f')]());}else if(_0x223f77['type']===_0xc568('0x52')&&_0x223f77[_0xc568('0x53')]&&_0x223f77[_0xc568('0x53')][_0xc568('0x54')]&&_0x223f77[_0xc568('0x4e')]){_0x28343c[_0x223f77[_0xc568('0x53')]['name']['toLowerCase']()]&&(_0x2675f1[_0x223f77[_0xc568('0x4e')]]=_0x28343c[_0x223f77['Variable'][_0xc568('0x54')][_0xc568('0x40')]()][_0xc568('0x4f')]());}});}return _0x2675f1;}function getConnection(_0x380bb1){var _0x2d8911=_0x380bb1[_0xc568('0x55')][_0xc568('0x56')](_0x380bb1[_0xc568('0x57')]);var _0x4d0900=new jsforce['Connection']({'oauth2':{'loginUrl':_0x380bb1['remoteUri']||_0xc568('0x58'),'clientId':_0x380bb1[_0xc568('0x59')],'clientSecret':_0x380bb1[_0xc568('0x5a')]}});return _0x4d0900[_0xc568('0x5b')](_0x380bb1[_0xc568('0x5c')],_0x2d8911)[_0xc568('0x25')](function(){logger['info'](_0xc568('0x5d'));return _0x4d0900;});}exports[_0xc568('0x5e')]=function(_0x418e99,_0x192281,_0x17458f,_0x5f1c03,_0x9f50f5,_0x3c8fa0){var _0x215883,_0x2bceb1,_0x4ec62c,_0x35db7b;_0x3c8fa0[_0xc568('0x5f')]=intUtil[_0xc568('0x60')](_0x3c8fa0['serverUrl']);_0x3c8fa0[_0xc568('0x61')]=intUtil[_0xc568('0x60')](_0x3c8fa0[_0xc568('0x61')]);if(_0x9f50f5&&_0x9f50f5[_0xc568('0x62')]){logger[_0xc568('0x1d')](_0xc568('0x63'),_0xc568('0x64'));_0x192281[_0xc568('0x65')]=util[_0xc568('0x47')](_0xc568('0x66'),_0x3c8fa0[_0xc568('0x5f')],_0x192281[_0xc568('0x67')],md5(_0x192281[_0xc568('0x67')]));}else{_0x192281[_0xc568('0x65')]='';}return getConnection(_0x3c8fa0)[_0xc568('0x25')](function(_0xedbb4f){_0x35db7b=_0xedbb4f;return getUser(_0x3c8fa0,_0x5f1c03['email'],_0x35db7b);})[_0xc568('0x25')](function(_0x1da032){_0x215883=_0x1da032;return getEndUser(_0x3c8fa0,_0x17458f,_0x192281[_0xc568('0x68')],_0x192281[_0xc568('0x69')],_0x35db7b);})[_0xc568('0x25')](function(_0x4ac2f8){_0x2bceb1=_0x4ac2f8;return getTicket(_0x3c8fa0,_0x215883,_0x2bceb1,_0x17458f,_0x192281,_0x17458f['Fields'],_0x35db7b,'queue');})[_0xc568('0x25')](function(_0x59bd46){_0x4ec62c=_0x59bd46;logger[_0xc568('0x1d')](_0xc568('0x6a'),_0x4ec62c['id']);logger[_0xc568('0x1d')](_0xc568('0x6b'),_0x4ec62c['id'],_0x5f1c03[_0xc568('0x54')],_0x3c8fa0[_0xc568('0x3f')]);switch(_0x3c8fa0[_0xc568('0x3f')]){case'integrationTab':emit(util[_0xc568('0x47')](_0xc568('0x6c'),_0x5f1c03[_0xc568('0x54')]),_0xc568('0x6d'),{'recordId':_0x4ec62c['id']});break;case _0xc568('0x6e'):emit(util[_0xc568('0x47')](_0xc568('0x6c'),_0x5f1c03['name']),_0xc568('0x6f'),{'uri':util['format'](_0xc568('0x70'),_0x35db7b[_0xc568('0x71')],_0x4ec62c['id'])});break;default:logger['error'](_0xc568('0x72'));}})[_0xc568('0x73')](function(_0xaa24b){logger[_0xc568('0x74')](_0xc568('0x63'),_0xaa24b);});};exports['outbound']=function(_0x515b1d,_0x13b9a7,_0x4933d2,_0x207a52,_0x226cb7,_0x1b8181,_0x5616b2){var _0x44c84f,_0x29dd15,_0x2b3955,_0x249306;_0x1b8181[_0xc568('0x5f')]=intUtil['stripTrailingSlash'](_0x1b8181[_0xc568('0x5f')]);_0x1b8181['remoteUri']=intUtil[_0xc568('0x60')](_0x1b8181['remoteUri']);if(_0x5616b2&&_0x5616b2[_0xc568('0x75')]&&_0x5616b2['recordingFormat']!=='none'){logger[_0xc568('0x1d')](_0xc568('0x76'),_0xc568('0x64'));_0x13b9a7['recordingURL']=util[_0xc568('0x47')](_0xc568('0x66'),_0x1b8181[_0xc568('0x5f')],_0x13b9a7['uniqueid'],md5(_0x13b9a7[_0xc568('0x67')]));}return getConnection(_0x1b8181)[_0xc568('0x25')](function(_0xaff066){_0x249306=_0xaff066;return getUser(_0x1b8181,_0x207a52[_0xc568('0x77')],_0x249306);})['then'](function(_0x1c05d3){_0x44c84f=_0x1c05d3;return getEndUser(_0x1b8181,_0x4933d2,_0x13b9a7[_0xc568('0x78')],_0x13b9a7[_0xc568('0x79')],_0x249306);})['then'](function(_0xede3e2){_0x29dd15=_0xede3e2;return getTicket(_0x1b8181,_0x44c84f,_0x29dd15,_0x4933d2,_0x13b9a7,_0x4933d2[_0xc568('0x7a')],_0x249306,_0xc568('0x7b'));})[_0xc568('0x25')](function(_0x5238a1){_0x2b3955=_0x5238a1;logger[_0xc568('0x1d')](_0xc568('0x7c'),_0x2b3955['id']);logger[_0xc568('0x1d')](_0xc568('0x7d'),_0x2b3955['id'],_0x207a52[_0xc568('0x54')],_0x1b8181['type']);switch(_0x1b8181['type']){case _0xc568('0x7e'):emit(util['format'](_0xc568('0x6c'),_0x207a52[_0xc568('0x54')]),_0xc568('0x6d'),{'recordId':_0x2b3955['id']});break;case'newTab':emit(util['format'](_0xc568('0x6c'),_0x207a52[_0xc568('0x54')]),'trigger:browser:url',{'uri':util[_0xc568('0x47')]('%s/%s/e',_0x249306[_0xc568('0x71')],_0x2b3955['id'])});break;default:logger[_0xc568('0x74')](_0xc568('0x76'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xc568('0x73')](function(_0x1615f2){logger['error'](_0xc568('0x76'),_0x1615f2);});};exports[_0xc568('0x7f')]=function(_0x516a0a,_0x3d2a7a,_0x50d15e,_0x2c2220,_0x309349,_0x33dcae){var _0x4c12b1,_0x235f40,_0x255853,_0x6e2da1;_0x33dcae[_0xc568('0x5f')]=intUtil[_0xc568('0x60')](_0x33dcae[_0xc568('0x5f')]);_0x33dcae[_0xc568('0x61')]=intUtil[_0xc568('0x60')](_0x33dcae[_0xc568('0x61')]);if(_0x309349&&_0x309349[_0xc568('0x62')]){logger[_0xc568('0x1d')]('['+_0x3d2a7a['lastevent'][_0xc568('0x80')]()+']',_0xc568('0x64'));_0x3d2a7a[_0xc568('0x65')]=util['format'](_0xc568('0x66'),_0x33dcae[_0xc568('0x5f')],_0x3d2a7a[_0xc568('0x67')],md5(_0x3d2a7a[_0xc568('0x67')]));}else{_0x3d2a7a[_0xc568('0x65')]='';}return getConnection(_0x33dcae)[_0xc568('0x25')](function(_0x15fa40){_0x6e2da1=_0x15fa40;if(!_[_0xc568('0x81')](_0x2c2220)){return getUser(_0x33dcae,_0x2c2220['name'],_0x6e2da1);}else{return getUser(_0x33dcae,null,_0x6e2da1);}})[_0xc568('0x25')](function(_0x105e32){_0x4c12b1=_0x105e32;return getEndUser(_0x33dcae,_0x50d15e,_0x3d2a7a[_0xc568('0x68')],_0x3d2a7a[_0xc568('0x69')],_0x6e2da1);})['then'](function(_0x3c8a3a){_0x235f40=_0x3c8a3a;return getTicket(_0x33dcae,_0x4c12b1,_0x235f40,_0x50d15e,_0x3d2a7a,_0x50d15e[_0xc568('0x7a')],_0x6e2da1);})[_0xc568('0x25')](function(_0x200668){_0x255853=_0x200668;logger[_0xc568('0x1d')]('['+_0x3d2a7a[_0xc568('0x82')][_0xc568('0x80')]()+_0xc568('0x83'),_0x255853['id']);logger[_0xc568('0x1d')]('['+_0x3d2a7a['lastevent'][_0xc568('0x80')]()+_0xc568('0x84'),_0x33dcae[_0xc568('0x3f')]);})[_0xc568('0x73')](function(_0x1e70a8){logger['error']('['+_0x3d2a7a[_0xc568('0x82')]['toUpperCase']()+']',_0x1e70a8);});}; \ No newline at end of file +var _0x1404=['emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','account','WhatId','Case','ContactId','AccountId','lead','leadId','info','sobject','create','isNil','User','find','execute','resolve','identity','then','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','$or','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','picklist','idField','toString','variable','variableName','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1404,0x1eb));var _0x4140=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x1404[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0x4140('0x0'));var rp=require(_0x4140('0x1'));var moment=require(_0x4140('0x2'));var BPromise=require(_0x4140('0x3'));var md5=require(_0x4140('0x4'));var jsforce=require(_0x4140('0x5'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x4140('0x6'));var logger=require(_0x4140('0x7'))(_0x4140('0x8'));config[_0x4140('0x9')]=_[_0x4140('0xa')](config['redis'],{'host':_0x4140('0xb'),'port':0x18eb});var io=require(_0x4140('0xc'))(new Redis(config['redis']));function emit(_0x378f8f,_0xbf1d3e,_0x29c5e6){io['to'](_0x378f8f)[_0x4140('0xd')](_0xbf1d3e,_0x29c5e6);}function getTicket(_0x41fc06,_0xb5f10,_0x41b731,_0x5d1e39,_0x3d3223,_0x266f63,_0x49d7c5,_0x480e4c){var _0x4e7b4b=Object['assign']({},{'OwnerId':_0xb5f10['id'],'Subject':intUtil[_0x4140('0xe')](_0x5d1e39[_0x4140('0xf')],_0x3d3223,'\x20'),'Description':intUtil[_0x4140('0xe')](_0x5d1e39[_0x4140('0x10')],_0x3d3223,'\x0a')},getCustomFields(_0x266f63,_0x3d3223));if(_0x41b731){if(_0x5d1e39[_0x4140('0x11')]===_0x4140('0x12')){_0x4e7b4b[_0x4140('0x13')]=moment[_0x4140('0x14')]();_0x4e7b4b[_0x4140('0x15')]=![];_0x4e7b4b[_0x4140('0x16')]=![];if(_0x41b731[_0x4140('0x17')]===_0x4140('0x18')||_0x41b731[_0x4140('0x17')]==='lead'){_0x4e7b4b['WhoId']=_0x41b731['id'];}else if(_0x41b731['endUserType']===_0x4140('0x19')){_0x4e7b4b[_0x4140('0x1a')]=_0x41b731['id'];}}else if(_0x5d1e39[_0x4140('0x11')]===_0x4140('0x1b')){if(_0x41b731[_0x4140('0x17')]===_0x4140('0x18')){_0x4e7b4b[_0x4140('0x1c')]=_0x41b731['id'];}else if(_0x41b731[_0x4140('0x17')]===_0x4140('0x19')){_0x4e7b4b[_0x4140('0x1d')]=_0x41b731['id'];}else if(_0x41b731['endUserType']===_0x4140('0x1e')&&_0x5d1e39[_0x4140('0x1f')]){_0x4e7b4b[_0x5d1e39['leadId']]=_0x41b731['id'];}else{logger[_0x4140('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x49d7c5[_0x4140('0x21')](_0x5d1e39[_0x4140('0x11')])[_0x4140('0x22')](_0x4e7b4b);}function getUser(_0x5e61f6,_0x95c676,_0x3fd9a5){if(!_[_0x4140('0x23')](_0x95c676)&&intUtil['validateEmail'](_0x95c676)){var _0x40e21d={'Email':_0x95c676};var _0x40f131={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3fd9a5[_0x4140('0x21')](_0x4140('0x24'))[_0x4140('0x25')](_0x40e21d,_0x40f131)[_0x4140('0x26')]()['then'](function(_0x3f94a1){if(_0x3f94a1['length']){var _0x3f65fc=_[_0x4140('0x25')](_0x3f94a1,function(_0x3ec18f){return _0x3ec18f['Email']===_0x95c676;});if(_0x3f65fc){logger[_0x4140('0x20')]('Agent\x20%s\x20found.',_0x95c676);return BPromise[_0x4140('0x27')]({'id':_0x3f65fc['Id'],'name':_0x3f65fc['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x95c676);return _0x3fd9a5[_0x4140('0x28')]()[_0x4140('0x29')](function(_0x51d34f){return BPromise[_0x4140('0x27')]({'id':_0x51d34f[_0x4140('0x2a')],'name':_0x51d34f['display_name']});});}});}else{logger[_0x4140('0x20')](_0x4140('0x2b'),_0x95c676);return _0x3fd9a5['identity']()[_0x4140('0x29')](function(_0x22e93b){return BPromise[_0x4140('0x27')]({'id':_0x22e93b[_0x4140('0x2a')],'name':_0x22e93b[_0x4140('0x2c')]});});}}function getEndUser(_0x29a761,_0x3451c8,_0x4152c5,_0x5cf687,_0x3a7d2b){var _0x398527={'$or':{'Phone':_0x5cf687}};var _0x122e15={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4140('0x27')]()['then'](function(){logger[_0x4140('0x20')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5cf687,_0x3451c8[_0x4140('0x2d')]);switch(_0x3451c8['moduleSearch']){case _0x4140('0x2e'):var _0x221c33=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x30')]){var _0x3d07df={};_0x3d07df[_0x3451c8[_0x4140('0x30')]]=_0x5cf687;_[_0x4140('0x31')](_0x221c33['$or'],_0x3d07df);}return _0x3a7d2b['sobject'](_0x4140('0x32'))[_0x4140('0x25')](_0x221c33,_0x122e15)[_0x4140('0x26')]()[_0x4140('0x29')](function(_0xe7bdd0){if(_0xe7bdd0&&_0xe7bdd0[_0x4140('0x33')]){return _0xe7bdd0;}else{var _0x2a4490=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x34')]){var _0x334963={};_0x334963[_0x3451c8[_0x4140('0x34')]]=_0x5cf687;_[_0x4140('0x31')](_0x2a4490['$or'],_0x334963);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x35'))[_0x4140('0x25')](_0x2a4490,_0x122e15);}});case _0x4140('0x36'):var _0x124ec5=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x37')]){var _0x3d07df={};_0x3d07df[_0x3451c8['additionalSearchAccount']]=_0x5cf687;_[_0x4140('0x31')](_0x124ec5[_0x4140('0x38')],_0x3d07df);}return _0x3a7d2b[_0x4140('0x21')]('Account')[_0x4140('0x25')](_0x124ec5,_0x122e15)[_0x4140('0x26')]()[_0x4140('0x29')](function(_0x1e2489){if(_0x1e2489&&_0x1e2489[_0x4140('0x33')]){return _0x1e2489;}else{var _0x56d142=_['cloneDeep'](_0x398527);if(_0x3451c8[_0x4140('0x30')]){var _0x386a87={};_0x386a87[_0x3451c8['additionalSearchContact']]=_0x5cf687;_[_0x4140('0x31')](_0x56d142[_0x4140('0x38')],_0x386a87);}return _0x3a7d2b['sobject'](_0x4140('0x32'))[_0x4140('0x25')](_0x56d142,_0x122e15)[_0x4140('0x29')](function(_0x2a4072){if(_0x2a4072&&_0x2a4072[_0x4140('0x33')]){return _0x2a4072;}else{var _0x2fbc6e=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x34')]){var _0x87d21={};_0x87d21[_0x3451c8[_0x4140('0x34')]]=_0x5cf687;_[_0x4140('0x31')](_0x2fbc6e['$or'],_0x87d21);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x35'))[_0x4140('0x25')](_0x2fbc6e,_0x122e15);}});}});case'contact':var _0x221c33=_['cloneDeep'](_0x398527);if(_0x3451c8[_0x4140('0x30')]){var _0x3d07df={};_0x3d07df[_0x3451c8['additionalSearchContact']]=_0x5cf687;_[_0x4140('0x31')](_0x221c33['$or'],_0x3d07df);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x32'))[_0x4140('0x25')](_0x221c33,_0x122e15)[_0x4140('0x26')]();case'lead':var _0x3d2e67=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x34')]){var _0x3d07df={};_0x3d07df[_0x3451c8[_0x4140('0x34')]]=_0x5cf687;_[_0x4140('0x31')](_0x3d2e67[_0x4140('0x38')],_0x3d07df);}return _0x3a7d2b['sobject'](_0x4140('0x35'))[_0x4140('0x25')](_0x3d2e67,_0x122e15);case _0x4140('0x19'):var _0x124ec5=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x37')]){var _0x3d07df={};_0x3d07df[_0x3451c8[_0x4140('0x37')]]=_0x5cf687;_[_0x4140('0x31')](_0x124ec5[_0x4140('0x38')],_0x3d07df);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x39'))[_0x4140('0x25')](_0x124ec5,_0x122e15);default:return null;}})[_0x4140('0x29')](function(_0x2c7632){if(_0x2c7632&&_0x2c7632[_0x4140('0x33')]){var _0x42a92c=_[_0x4140('0x3a')](_0x2c7632);if(_0x42a92c){return BPromise['resolve']({'id':_0x42a92c['Id'],'name':_0x42a92c[_0x4140('0x3b')],'phone':_0x42a92c[_0x4140('0x3c')],'endUserType':_0x42a92c[_0x4140('0x3d')][_0x4140('0x3e')][_0x4140('0x3f')]()});}}})[_0x4140('0x29')](function(_0x385bcd){if(_0x385bcd){logger[_0x4140('0x20')](_0x4140('0x40'),_0x385bcd[_0x4140('0x17')],_0x5cf687);return BPromise[_0x4140('0x27')](_0x385bcd);}else{logger[_0x4140('0x20')](_0x4140('0x41'),_0x5cf687);var _0xd5bcfc={'Phone':_0x5cf687};if(_0x3451c8['moduleCreate']){if(_0x3451c8[_0x4140('0x42')]===_0x4140('0x18')){logger[_0x4140('0x20')](_0x4140('0x43'),_0x5cf687,_0x3451c8['moduleCreate']);_0xd5bcfc[_0x4140('0x44')]=_0x4152c5!==_0x4140('0x45')?_0x4152c5:util[_0x4140('0x46')](_0x4140('0x47'),_0x5cf687);}else if(_0x3451c8[_0x4140('0x42')]===_0x4140('0x1e')){logger['info'](_0x4140('0x43'),_0x5cf687,_0x3451c8[_0x4140('0x42')]);_0xd5bcfc[_0x4140('0x44')]=_0x4152c5!==_0x4140('0x45')?_0x4152c5:util[_0x4140('0x46')](_0x4140('0x47'),_0x5cf687);_0xd5bcfc[_0x4140('0x48')]=_0x4140('0x49');}else if(_0x3451c8[_0x4140('0x42')]===_0x4140('0x19')){logger[_0x4140('0x20')](_0x4140('0x43'),_0x5cf687,_0x3451c8['moduleCreate']);_0xd5bcfc[_0x4140('0x3b')]=_0x4152c5!==''?_0x4152c5:util['format']('Caller\x20-\x20%s',_0x5cf687);}else{return null;}}return _0x3a7d2b['sobject'](_[_0x4140('0x4a')](_0x3451c8[_0x4140('0x42')]))[_0x4140('0x22')](_0xd5bcfc)[_0x4140('0x29')](function(_0x119877){return BPromise[_0x4140('0x27')]({'id':_0x119877['id'],'endUserType':_0x3451c8['moduleCreate']});});}});}function getCustomFields(_0x176584,_0x47fc32){var _0x42dee7={};if(_0x176584[_0x4140('0x33')]>0x0){_['forEach'](_0x176584,function(_0x3ea2f3){if(_['includes'](['string',_0x4140('0x4b')],_0x3ea2f3[_0x4140('0x3e')])&&_0x3ea2f3[_0x4140('0x4c')]){_0x42dee7[_0x3ea2f3[_0x4140('0x4c')]]=_0x3ea2f3['content'][_0x4140('0x4d')]();}else if(_0x3ea2f3[_0x4140('0x3e')]===_0x4140('0x4e')&&_0x3ea2f3[_0x4140('0x4f')]&&_0x3ea2f3[_0x4140('0x4c')]){_0x47fc32[_0x3ea2f3[_0x4140('0x4f')]]&&(_0x42dee7[_0x3ea2f3[_0x4140('0x4c')]]=_0x47fc32[_0x3ea2f3['variableName']][_0x4140('0x4d')]());}else if(_0x3ea2f3[_0x4140('0x3e')]==='customVariable'&&_0x3ea2f3[_0x4140('0x50')]&&_0x3ea2f3['Variable'][_0x4140('0x51')]&&_0x3ea2f3[_0x4140('0x4c')]){_0x47fc32[_0x3ea2f3[_0x4140('0x50')]['name'][_0x4140('0x3f')]()]&&(_0x42dee7[_0x3ea2f3[_0x4140('0x4c')]]=_0x47fc32[_0x3ea2f3[_0x4140('0x50')]['name']['toLowerCase']()][_0x4140('0x4d')]());}});}return _0x42dee7;}function getConnection(_0x1b673c){var _0x1a4cdb=_0x1b673c[_0x4140('0x52')][_0x4140('0x53')](_0x1b673c[_0x4140('0x54')]);var _0x25be5d=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1b673c['remoteUri']||_0x4140('0x55'),'clientId':_0x1b673c[_0x4140('0x56')],'clientSecret':_0x1b673c['clientSecret']}});return _0x25be5d[_0x4140('0x57')](_0x1b673c[_0x4140('0x58')],_0x1a4cdb)[_0x4140('0x29')](function(){logger[_0x4140('0x20')](_0x4140('0x59'));return _0x25be5d;});}exports[_0x4140('0x5a')]=function(_0x5c04bb,_0x29a55d,_0x23e50b,_0x190d87,_0x377663,_0x10d980){var _0x1a8602,_0x13122e,_0x249dd9,_0x346fab;_0x10d980[_0x4140('0x5b')]=intUtil[_0x4140('0x5c')](_0x10d980['serverUrl']);_0x10d980[_0x4140('0x5d')]=intUtil[_0x4140('0x5c')](_0x10d980[_0x4140('0x5d')]);if(_0x377663&&_0x377663[_0x4140('0x5e')]){logger[_0x4140('0x20')](_0x4140('0x5f'),_0x4140('0x60'));_0x29a55d[_0x4140('0x61')]=util[_0x4140('0x46')](_0x4140('0x62'),_0x10d980[_0x4140('0x5b')],_0x29a55d[_0x4140('0x63')],md5(_0x29a55d[_0x4140('0x63')]));}else{_0x29a55d['recordingURL']='';}return getConnection(_0x10d980)['then'](function(_0x4139f6){_0x346fab=_0x4139f6;return getUser(_0x10d980,_0x190d87[_0x4140('0x64')],_0x346fab);})[_0x4140('0x29')](function(_0x310c8d){_0x1a8602=_0x310c8d;return getEndUser(_0x10d980,_0x23e50b,_0x29a55d[_0x4140('0x65')],_0x29a55d[_0x4140('0x66')],_0x346fab);})[_0x4140('0x29')](function(_0x2f677e){_0x13122e=_0x2f677e;return getTicket(_0x10d980,_0x1a8602,_0x13122e,_0x23e50b,_0x29a55d,_0x23e50b['Fields'],_0x346fab,'queue');})['then'](function(_0x147e4f){_0x249dd9=_0x147e4f;logger[_0x4140('0x20')](_0x4140('0x67'),_0x249dd9['id']);logger[_0x4140('0x20')](_0x4140('0x68'),_0x249dd9['id'],_0x190d87[_0x4140('0x51')],_0x10d980[_0x4140('0x3e')]);switch(_0x10d980[_0x4140('0x3e')]){case'integrationTab':emit(util['format']('user:%s',_0x190d87[_0x4140('0x51')]),_0x4140('0x69'),{'recordId':_0x249dd9['id']});break;case _0x4140('0x6a'):emit(util['format'](_0x4140('0x6b'),_0x190d87[_0x4140('0x51')]),_0x4140('0x6c'),{'uri':util[_0x4140('0x46')](_0x4140('0x6d'),_0x346fab[_0x4140('0x6e')],_0x249dd9['id'])});break;default:logger[_0x4140('0x6f')](_0x4140('0x70'));}})[_0x4140('0x71')](function(_0x14db78){logger['error'](_0x4140('0x5f'),_0x14db78);});};exports[_0x4140('0x72')]=function(_0x5386a8,_0x4af50b,_0xb4d11b,_0x536b9d,_0xb3349b,_0x4a60a0,_0x41f57c){var _0x3faa21,_0x548285,_0x3b7579,_0x5266fd;_0x4a60a0[_0x4140('0x5b')]=intUtil[_0x4140('0x5c')](_0x4a60a0[_0x4140('0x5b')]);_0x4a60a0[_0x4140('0x5d')]=intUtil[_0x4140('0x5c')](_0x4a60a0[_0x4140('0x5d')]);if(_0x41f57c&&_0x41f57c[_0x4140('0x73')]&&_0x41f57c['recordingFormat']!=='none'){logger[_0x4140('0x20')](_0x4140('0x74'),_0x4140('0x60'));_0x4af50b['recordingURL']=util['format'](_0x4140('0x62'),_0x4a60a0[_0x4140('0x5b')],_0x4af50b[_0x4140('0x63')],md5(_0x4af50b['uniqueid']));}return getConnection(_0x4a60a0)['then'](function(_0x4c6a49){_0x5266fd=_0x4c6a49;return getUser(_0x4a60a0,_0x536b9d[_0x4140('0x64')],_0x5266fd);})['then'](function(_0x6472f4){_0x3faa21=_0x6472f4;return getEndUser(_0x4a60a0,_0xb4d11b,_0x4af50b['destcalleridname'],_0x4af50b['destcalleridnum'],_0x5266fd);})['then'](function(_0x875a2){_0x548285=_0x875a2;return getTicket(_0x4a60a0,_0x3faa21,_0x548285,_0xb4d11b,_0x4af50b,_0xb4d11b[_0x4140('0x75')],_0x5266fd,'outbound');})[_0x4140('0x29')](function(_0x50acc1){_0x3b7579=_0x50acc1;logger['info'](_0x4140('0x76'),_0x3b7579['id']);logger['info'](_0x4140('0x77'),_0x3b7579['id'],_0x536b9d[_0x4140('0x51')],_0x4a60a0[_0x4140('0x3e')]);switch(_0x4a60a0['type']){case _0x4140('0x78'):emit(util[_0x4140('0x46')]('user:%s',_0x536b9d[_0x4140('0x51')]),'trigger:salesforce:display',{'recordId':_0x3b7579['id']});break;case'newTab':emit(util[_0x4140('0x46')](_0x4140('0x6b'),_0x536b9d[_0x4140('0x51')]),_0x4140('0x6c'),{'uri':util[_0x4140('0x46')](_0x4140('0x6d'),_0x5266fd[_0x4140('0x6e')],_0x3b7579['id'])});break;default:logger[_0x4140('0x6f')](_0x4140('0x74'),_0x4140('0x79'));}})['catch'](function(_0x588e22){logger['error'](_0x4140('0x74'),_0x588e22);});};exports['unmanaged']=function(_0x31b771,_0x32c9e7,_0x191e18,_0x39298a,_0x517c60,_0x50cc06){var _0x419953,_0x21bbc0,_0x352d77,_0x4d9850;_0x50cc06[_0x4140('0x5b')]=intUtil[_0x4140('0x5c')](_0x50cc06[_0x4140('0x5b')]);_0x50cc06[_0x4140('0x5d')]=intUtil['stripTrailingSlash'](_0x50cc06['remoteUri']);if(_0x517c60&&_0x517c60[_0x4140('0x5e')]){logger[_0x4140('0x20')]('['+_0x32c9e7['lastevent'][_0x4140('0x7a')]()+']',_0x4140('0x60'));_0x32c9e7[_0x4140('0x61')]=util['format'](_0x4140('0x62'),_0x50cc06[_0x4140('0x5b')],_0x32c9e7[_0x4140('0x63')],md5(_0x32c9e7[_0x4140('0x63')]));}else{_0x32c9e7['recordingURL']='';}return getConnection(_0x50cc06)[_0x4140('0x29')](function(_0xea735e){_0x4d9850=_0xea735e;if(!_['isNil'](_0x39298a)){return getUser(_0x50cc06,_0x39298a['name'],_0x4d9850);}else{return getUser(_0x50cc06,null,_0x4d9850);}})[_0x4140('0x29')](function(_0x4b46df){_0x419953=_0x4b46df;return getEndUser(_0x50cc06,_0x191e18,_0x32c9e7['calleridname'],_0x32c9e7['calleridnum'],_0x4d9850);})[_0x4140('0x29')](function(_0x19d776){_0x21bbc0=_0x19d776;return getTicket(_0x50cc06,_0x419953,_0x21bbc0,_0x191e18,_0x32c9e7,_0x191e18[_0x4140('0x75')],_0x4d9850);})[_0x4140('0x29')](function(_0x451beb){_0x352d77=_0x451beb;logger[_0x4140('0x20')]('['+_0x32c9e7[_0x4140('0x7b')][_0x4140('0x7a')]()+_0x4140('0x7c'),_0x352d77['id']);logger[_0x4140('0x20')]('['+_0x32c9e7[_0x4140('0x7b')][_0x4140('0x7a')]()+_0x4140('0x7d'),_0x50cc06[_0x4140('0x3e')]);})[_0x4140('0x71')](function(_0x26b6da){logger[_0x4140('0x6f')]('['+_0x32c9e7[_0x4140('0x7b')]['toUpperCase']()+']',_0x26b6da);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index d4ae44a..75d6eec 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6e6=['lodash','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','info','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','],\x20getUser\x20crm','adminEmail','POST','sys_user?','user','endUserNumber','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name','outbound','incident','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','inspect'];(function(_0x9e9067,_0x1b57d0){var _0x525877=function(_0x8cf375){while(--_0x8cf375){_0x9e9067['push'](_0x9e9067['shift']());}};_0x525877(++_0x1b57d0);}(_0xb6e6,0x6a));var _0x6b6e=function(_0x5b8535,_0x335c46){_0x5b8535=_0x5b8535-0x0;var _0x4a5481=_0xb6e6[_0x5b8535];return _0x4a5481;};'use strict';var _=require(_0x6b6e('0x0'));var Promise=require(_0x6b6e('0x1'));var rp=require('request-promise');var util=require('util');var md5=require('md5');var Redis=require(_0x6b6e('0x2'));var intUtil=require(_0x6b6e('0x3'));var config=require(_0x6b6e('0x4'));var logger=require(_0x6b6e('0x5'))(_0x6b6e('0x6'));config[_0x6b6e('0x7')]=_['defaults'](config[_0x6b6e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6b6e('0x8'))(new Redis(config[_0x6b6e('0x7')]));function getAdminUser(_0x5be446,_0x4c17a8,_0x692f5,_0x69fb6c,_0x4b64ec,_0x53e84a){return new Promise(function(_0xb26332,_0x25f398){var _0x36d9d0={'method':_0x6b6e('0x9'),'uri':_0x69fb6c+_0x6b6e('0xa')+'&'+_0x4b64ec+'&'+_0x53e84a,'auth':_0x4c17a8,'json':!![]};return rp(_0x36d9d0)[_0x6b6e('0xb')](function(_0x470a41){if(_0x470a41[_0x6b6e('0xc')][_0x6b6e('0xd')]>0x0){_0x692f5[_0x6b6e('0xe')]=_0x470a41[_0x6b6e('0xc')][0x0][_0x6b6e('0xf')];}logger['info']('['+[_0x5be446[_0x6b6e('0x10')]()]+_0x6b6e('0x11'),_0x692f5);_0xb26332(_0x692f5);})[_0x6b6e('0x12')](function(_0xe3dbf4){logger[_0x6b6e('0x13')]('['+[_0x5be446[_0x6b6e('0x10')]()]+']',_0xe3dbf4[_0x6b6e('0x14')]);_0x25f398(_0xe3dbf4[_0x6b6e('0x14')]);});});}function getUser(_0x2a9cde,_0x239498,_0x396dad,_0x409e0d,_0x14c49d){return function(_0x4acc77){logger['info']('['+[_0x2a9cde[_0x6b6e('0x10')]()]+_0x6b6e('0x15'),_0x4acc77);return new Promise(function(_0x3c9cec,_0x4a675f){if(intUtil[_0x6b6e('0x16')](_0x4acc77['userEmail'])){var _0x2e0b2b={'method':'GET','uri':_0x396dad+_0x6b6e('0x17')+_0x4acc77[_0x6b6e('0x18')]+'&'+_0x409e0d+'&'+_0x14c49d,'auth':_0x239498,'json':!![]};logger[_0x6b6e('0x19')]('['+[_0x2a9cde[_0x6b6e('0x10')]()]+_0x6b6e('0x1a'),_0x2e0b2b);return rp(_0x2e0b2b)[_0x6b6e('0xb')](function(_0x3249ee){logger['info']('['+[_0x2a9cde[_0x6b6e('0x10')]()]+_0x6b6e('0x1b'),_0x3249ee);if(_0x3249ee[_0x6b6e('0xc')][_0x6b6e('0xd')]>0x0&&String(_0x3249ee['result'][0x0]['active'])===_0x6b6e('0x1c')){_0x4acc77[_0x6b6e('0x1d')]=_0x3249ee['result'][0x0][_0x6b6e('0xf')];}else{_0x4acc77[_0x6b6e('0x1d')]=_0x4acc77['adminId'];_0x4acc77[_0x6b6e('0x18')]=_0x4acc77['adminEmail'];}logger[_0x6b6e('0x19')]('['+[_0x2a9cde['toUpperCase']()]+_0x6b6e('0x1e'),_0x4acc77);_0x3c9cec(_0x4acc77);})[_0x6b6e('0x12')](function(_0x2caeb9){logger[_0x6b6e('0x13')]('['+[_0x2a9cde[_0x6b6e('0x10')]()]+']',_0x2caeb9[_0x6b6e('0x14')]);_0x4a675f(_0x2caeb9['message']);});}else{logger[_0x6b6e('0x19')]('['+[_0x2a9cde['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x4acc77[_0x6b6e('0x1d')]=_0x4acc77['adminId'];_0x4acc77[_0x6b6e('0x18')]=_0x4acc77[_0x6b6e('0x1f')];_0x3c9cec(_0x4acc77);}});};}function createEndUser(_0x3fd506,_0x1fd069,_0x37b4e0,_0x18da96,_0x2bcb03){logger[_0x6b6e('0x19')]('['+[_0x3fd506[_0x6b6e('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x37b4e0);return new Promise(function(_0x5daff9,_0x9f8380){var _0x5c695a={'method':_0x6b6e('0x20'),'uri':_0x18da96+_0x6b6e('0x21')+_0x2bcb03,'body':{'user_name':_0x37b4e0['endUserNumber'],'roles':_0x6b6e('0x22'),'first_name':_0x37b4e0['endUserNumber'],'active':_0x6b6e('0x1c'),'date_format':'System','phone':_0x37b4e0[_0x6b6e('0x23')]},'auth':_0x1fd069,'json':!![]};return rp(_0x5c695a)['then'](function(_0x5ba477){logger[_0x6b6e('0x19')]('['+[_0x3fd506[_0x6b6e('0x10')]()]+'],\x20EndUser\x20schema',_0x5ba477['result']);_0x37b4e0['endUserId']=_0x5ba477[_0x6b6e('0xc')][_0x6b6e('0xf')];_0x5daff9(_0x37b4e0);})[_0x6b6e('0x12')](function(_0x1c8f92){logger[_0x6b6e('0x13')]('['+[_0x3fd506[_0x6b6e('0x10')]()]+']',_0x1c8f92['message']);_0x9f8380(_0x1c8f92[_0x6b6e('0x14')]);});});}function getEndUser(_0x3e0900,_0x4295ae,_0x469a6a,_0x4fba29,_0x5e624e){return function(_0x3560c1){logger[_0x6b6e('0x19')]('['+[_0x3e0900[_0x6b6e('0x10')]()]+_0x6b6e('0x24'),_0x3560c1);return new Promise(function(_0x3779db,_0x3bfdf0){var _0x462ac9={'method':'GET','uri':_0x469a6a+_0x6b6e('0x25')+_0x3560c1['endUserNumber']+'&'+_0x4fba29+'&'+_0x5e624e,'auth':_0x4295ae,'json':!![]};return rp(_0x462ac9)[_0x6b6e('0xb')](function(_0xf50298){if(_0xf50298['result'][_0x6b6e('0xd')]>0x0){_0x3560c1[_0x6b6e('0x26')]=_0xf50298[_0x6b6e('0xc')][0x0][_0x6b6e('0xf')];logger[_0x6b6e('0x19')]('['+[_0x3e0900['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x3560c1);_0x3779db(_0x3560c1);}else{return createEndUser(_0x3e0900,_0x4295ae,_0x3560c1,_0x469a6a,_0x4fba29)['then'](function(_0x69c38e){logger[_0x6b6e('0x19')]('['+[_0x3e0900[_0x6b6e('0x10')]()]+_0x6b6e('0x27'),_0x69c38e);_0x3779db(_0x69c38e);});}})[_0x6b6e('0x12')](function(_0x1fbdcb){logger[_0x6b6e('0x13')]('['+[_0x3e0900[_0x6b6e('0x10')]()]+']',_0x1fbdcb[_0x6b6e('0x14')]);_0x3bfdf0(_0x1fbdcb[_0x6b6e('0x14')]);});});};}function getCustomFields(_0x50ba64,_0x4f2c2f){var _0x5e8e39={};if(_0x50ba64[_0x6b6e('0xd')]>0x0){_[_0x6b6e('0x28')](_0x50ba64,function(_0x55da7e){if(_[_0x6b6e('0x29')]([_0x6b6e('0x2a'),_0x6b6e('0x2b')],_0x55da7e[_0x6b6e('0x2c')])&&_0x55da7e['nameField']&&!_0x55da7e[_0x6b6e('0x2d')]){_0x5e8e39[_0x55da7e[_0x6b6e('0x2e')][_0x6b6e('0x2f')]()]=_0x55da7e[_0x6b6e('0x30')][_0x6b6e('0x31')]();}else if(_['includes']([_0x6b6e('0x2a'),_0x6b6e('0x2b')],_0x55da7e[_0x6b6e('0x2c')])&&_0x55da7e[_0x6b6e('0x32')]&&_0x55da7e[_0x6b6e('0x2d')]){_0x5e8e39[_0x55da7e[_0x6b6e('0x32')][_0x6b6e('0x2f')]()]=_0x55da7e[_0x6b6e('0x30')][_0x6b6e('0x31')]();}else if(_0x55da7e[_0x6b6e('0x2c')]===_0x6b6e('0x33')&&_0x55da7e[_0x6b6e('0x34')]&&_0x55da7e['idField']&&_0x55da7e['customField']){_0x5e8e39[_0x55da7e[_0x6b6e('0x32')][_0x6b6e('0x2f')]()]=_0x4f2c2f[_0x55da7e[_0x6b6e('0x34')]][_0x6b6e('0x31')]();}else if(_0x55da7e[_0x6b6e('0x2c')]===_0x6b6e('0x35')&&_0x55da7e['Variable']&&_0x55da7e[_0x6b6e('0x36')][_0x6b6e('0x37')]&&_0x55da7e['idField']&&_0x55da7e[_0x6b6e('0x2d')]){_0x5e8e39[_0x55da7e[_0x6b6e('0x32')][_0x6b6e('0x2f')]()]=_0x4f2c2f[_0x55da7e[_0x6b6e('0x36')][_0x6b6e('0x37')]['toLowerCase']()][_0x6b6e('0x31')]();}});}return _0x5e8e39;}function getTicket(_0x34b55a,_0x5a760f,_0x82073c,_0x58fa5d,_0x33c9ec,_0x3929e3){return function(_0x4a9b74){logger['info']('['+[_0x34b55a[_0x6b6e('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x4a9b74);return new Promise(function(_0x2e3e0a,_0x372b98){var _0x54d360=_0x34b55a[_0x6b6e('0x2f')]()===_0x6b6e('0x38')?_0x4a9b74[_0x6b6e('0x1d')]:_0x4a9b74[_0x6b6e('0x26')];var _0x155c3d={'method':_0x6b6e('0x20'),'uri':_0x82073c+_0x6b6e('0x39')+'?'+_0x3929e3,'body':Object['assign']({},{'active':_0x6b6e('0x1c'),'caller_id':_0x54d360,'assigned_to':_0x4a9b74['userId'],'short_description':intUtil['getString'](_0x58fa5d[_0x6b6e('0x3a')],_0x33c9ec,'\x20'),'description':intUtil[_0x6b6e('0x3b')](_0x58fa5d[_0x6b6e('0x3c')],_0x33c9ec,'\x0a')},getCustomFields(_0x58fa5d[_0x6b6e('0x3d')],_0x33c9ec)),'auth':_0x5a760f,'json':!![]};return rp(_0x155c3d)[_0x6b6e('0xb')](function(_0x4a3d91){logger[_0x6b6e('0x19')]('['+[_0x34b55a['toUpperCase']()]+_0x6b6e('0x3e'),_0x4a3d91[_0x6b6e('0xc')]);_0x4a9b74[_0x6b6e('0x3f')]=_0x4a3d91['result'][_0x6b6e('0xf')];_0x4a9b74['ticketNumber']=_0x4a3d91[_0x6b6e('0xc')][_0x6b6e('0x40')];logger[_0x6b6e('0x19')]('['+[_0x34b55a['toUpperCase']()]+_0x6b6e('0x41'),_0x4a9b74);_0x2e3e0a(_0x4a9b74);})['catch'](function(_0x103a55){logger[_0x6b6e('0x13')]('['+[_0x34b55a[_0x6b6e('0x10')]()]+']',_0x103a55[_0x6b6e('0x14')]);_0x372b98(_0x103a55[_0x6b6e('0x14')]);});});};}function createRemoteTag(_0x203e4e,_0x2891d2,_0x5b757c,_0x21c9a0){return new Promise(function(_0x1502f4,_0x13dc91){var _0x44f713={'method':_0x6b6e('0x20'),'uri':_0x5b757c+_0x6b6e('0x42')+'?'+_0x21c9a0,'body':{'short_description':_0x203e4e,'global':!![],'active':!![],'name':_0x203e4e},'auth':_0x2891d2,'json':!![]};return rp(_0x44f713)['then'](function(_0x48849e){var _0x8d103d=_0x48849e['result'][_0x6b6e('0xf')];_0x1502f4(_0x8d103d);});});}function getRemoteTag(_0x51faf0,_0x4b5377,_0x256df9,_0xaa785c,_0x494bba){return new Promise(function(_0x2e9d7a,_0x546455){var _0x44e2b3={'method':_0x6b6e('0x9'),'uri':_0x256df9+_0x6b6e('0x42')+_0x6b6e('0x43')+_0x51faf0+'&'+_0xaa785c,'auth':_0x4b5377,'json':!![]};return rp(_0x44e2b3)['then'](function(_0xeb4068){if(_0xeb4068[_0x6b6e('0xc')][_0x6b6e('0xd')]>0x0){var _0x8ddb60=_0xeb4068[_0x6b6e('0xc')][0x0][_0x6b6e('0xf')];_0x2e9d7a(_0x8ddb60);}else{return createRemoteTag(_0x51faf0,_0x4b5377,_0x256df9,_0xaa785c)[_0x6b6e('0xb')](function(_0x2a98a0){_0x2e9d7a(_0x2a98a0);});}});});}function assignTagToIncident(_0x411390,_0x3454ff,_0x19d39b,_0x588ae6,_0x5ba0b8){return new Promise(function(_0x13dd9f,_0x56332d){var _0x2d4f8c={'method':_0x6b6e('0x20'),'uri':_0x19d39b+_0x6b6e('0x44')+'?'+_0x5ba0b8,'body':{'label':_0x411390,'table':_0x6b6e('0x39'),'id_type':'Incident','table_key':_0x588ae6['ticketId'],'title':'Incident\x20-\x20'+_0x588ae6['ticketNumber'],'id_display':_0x588ae6[_0x6b6e('0x45')]},'auth':_0x3454ff,'json':!![]};return rp(_0x2d4f8c)[_0x6b6e('0xb')](function(_0x2a52a9){_0x13dd9f();})['catch'](function(){_0x13dd9f();});});}function manageTags(_0x1f7a36,_0x13f4da,_0x3d6b66,_0xbf7b4c,_0x12cb49,_0x5e389e,_0x18ff80){return new Promise(function(_0x5b0d69,_0x4ab807){var _0x9ffb8e=[];_0x13f4da[_0x6b6e('0x28')](function(_0x31ef0f){_0x9ffb8e[_0x6b6e('0x46')](getRemoteTag(_0x31ef0f,_0x3d6b66,_0xbf7b4c,_0x5e389e,_0x18ff80));});return Promise[_0x6b6e('0x47')](_0x9ffb8e)[_0x6b6e('0xb')](function(_0x57616f){if(_0x57616f[_0x6b6e('0xd')]){logger[_0x6b6e('0x19')]('['+[_0x1f7a36[_0x6b6e('0x10')]()]+_0x6b6e('0x48'),_0x57616f);var _0x534c5b=[];_0x57616f[_0x6b6e('0x28')](function(_0x5579ee){_0x534c5b[_0x6b6e('0x46')](assignTagToIncident(_0x5579ee,_0x3d6b66,_0xbf7b4c,_0x12cb49,_0x5e389e));});return Promise[_0x6b6e('0x47')](_0x534c5b)[_0x6b6e('0xb')](function(){_0x5b0d69();})[_0x6b6e('0x12')](function(){_0x5b0d69();});}else{_0x5b0d69();}});});}function getTags(_0x44d28e,_0x54c6fc,_0x4c85ec,_0x32a99d,_0x517b64,_0x39433c){return function(_0x5cda71){return new Promise(function(_0x45c904,_0x81c3e2){var _0x2ebc7c=[];var _0x413d5b=_0x32a99d[_0x6b6e('0x49')];if(_0x413d5b&&_0x413d5b['length']>0x0){_0x2ebc7c=_[_0x6b6e('0x4a')](_0x413d5b,_0x6b6e('0x37'));}if(_0x2ebc7c[_0x6b6e('0xd')]>0x0){return manageTags(_0x44d28e,_0x2ebc7c,_0x54c6fc,_0x4c85ec,_0x5cda71,_0x517b64,_0x39433c)[_0x6b6e('0xb')](function(){_0x45c904(_0x5cda71);});}else{_0x45c904(_0x5cda71);}});};}function emit(_0x28dcd6,_0xea688f,_0x52e891){var _0x242ec3=_0x6b6e('0x4b')+_0x6b6e('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x48e35c={'uri':_0x28dcd6+_0x6b6e('0x4d')+_0x52e891+_0x242ec3};io['to'](util[_0x6b6e('0x4e')](_0x6b6e('0x4f'),_0xea688f))[_0x6b6e('0x50')](_0x6b6e('0x51'),_0x48e35c);}exports['cs']=function(_0x2db723,_0x76af55,_0x339223,_0x2a7a76,_0x3a2e46,_0x599bc2,_0x2c77b0,_0x464c77){var _0x260955={};var _0x39e51f={'user':_0x599bc2[_0x6b6e('0x52')],'pass':_0x599bc2[_0x6b6e('0x53')]};var _0x19d036=_0x6b6e('0x54');var _0x3a7c05=_0x6b6e('0x55');_0x599bc2[_0x6b6e('0x56')]=intUtil[_0x6b6e('0x57')](_0x599bc2[_0x6b6e('0x56')]);_0x599bc2[_0x6b6e('0x58')]=intUtil[_0x6b6e('0x57')](_0x599bc2[_0x6b6e('0x58')]);var _0x4972f8=util[_0x6b6e('0x4e')](_0x6b6e('0x59'),_0x599bc2[_0x6b6e('0x56')]);_0x260955['userEmail']=!_[_0x6b6e('0x5a')](_0x2a7a76)?_0x2a7a76['email']:null;_0x260955['adminEmail']=_0x599bc2[_0x6b6e('0x5b')];_0x260955[_0x6b6e('0x23')]=_0x464c77[_0x6b6e('0x2f')]()===_0x6b6e('0x38')?_0x76af55['destcalleridnum']:_0x76af55['calleridnum'];_0x260955[_0x6b6e('0x5c')]=_0x464c77==='queue'||_0x464c77==='unmanaged'?_0x6b6e('0x5d'):_0x6b6e('0x38');var _0x34a311=util[_0x6b6e('0x4e')](_0x6b6e('0x5e'),_0x599bc2[_0x6b6e('0x58')],_0x76af55[_0x6b6e('0x5f')],md5(_0x76af55['uniqueid']));if(_0x3a2e46&&_0x3a2e46[_0x6b6e('0x60')]){logger['info']('[QUEUE]',_0x6b6e('0x61'));_0x76af55['recordingURL']=_0x34a311;}else if(_0x2c77b0&&_0x2c77b0['recordingFormat']&&_0x2c77b0[_0x6b6e('0x62')]!==_0x6b6e('0x63')){logger[_0x6b6e('0x19')]('[OUTBOUND]',_0x6b6e('0x61'));_0x76af55[_0x6b6e('0x64')]=_0x34a311;}else{_0x76af55[_0x6b6e('0x64')]='';}return getAdminUser(_0x464c77,_0x39e51f,_0x260955,_0x4972f8,_0x3a7c05,_0x19d036)[_0x6b6e('0xb')](getUser(_0x464c77,_0x39e51f,_0x4972f8,_0x3a7c05,_0x19d036))['then'](getEndUser(_0x464c77,_0x39e51f,_0x4972f8,_0x3a7c05,_0x19d036))[_0x6b6e('0xb')](getTicket(_0x464c77,_0x39e51f,_0x4972f8,_0x339223,_0x76af55,_0x3a7c05))[_0x6b6e('0xb')](function(_0x56281a){logger[_0x6b6e('0x19')](util[_0x6b6e('0x4e')](_0x6b6e('0x65'),_0x56281a[_0x6b6e('0x3f')]));logger[_0x6b6e('0x19')](util['format'](_0x6b6e('0x66'),_0x464c77));if(_0x464c77!==_0x6b6e('0x67')){logger[_0x6b6e('0x19')]('['+[_0x464c77['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x599bc2[_0x6b6e('0x56')],_0x2a7a76[_0x6b6e('0x37')],_0x56281a[_0x6b6e('0x3f')]);}})[_0x6b6e('0x12')](function(_0x555629){logger['error']('['+[_0x464c77[_0x6b6e('0x10')]()]+_0x6b6e('0x68'),util[_0x6b6e('0x69')](_0x555629,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa5be=['System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','variable','customField','variableName','toString','Variable',']\x20getTicket\x20input\x20crm','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber'];(function(_0x11162d,_0x3c7e4f){var _0x5f4aeb=function(_0x25dc99){while(--_0x25dc99){_0x11162d['push'](_0x11162d['shift']());}};_0x5f4aeb(++_0x3c7e4f);}(_0xa5be,0x121));var _0xea5b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa5be[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xea5b('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require('util');var md5=require(_0xea5b('0x1'));var Redis=require(_0xea5b('0x2'));var intUtil=require(_0xea5b('0x3'));var config=require(_0xea5b('0x4'));var logger=require(_0xea5b('0x5'))('servicenow');config[_0xea5b('0x6')]=_[_0xea5b('0x7')](config[_0xea5b('0x6')],{'host':_0xea5b('0x8'),'port':0x18eb});var io=require(_0xea5b('0x9'))(new Redis(config[_0xea5b('0x6')]));function getAdminUser(_0x519818,_0x406239,_0x49d479,_0x4c98be,_0x2a8074,_0x5be141){return new Promise(function(_0x25ee58,_0x592a83){var _0x5d72bb={'method':'GET','uri':_0x4c98be+_0xea5b('0xa')+'&'+_0x2a8074+'&'+_0x5be141,'auth':_0x406239,'json':!![]};return rp(_0x5d72bb)[_0xea5b('0xb')](function(_0x1b344c){if(_0x1b344c['result'][_0xea5b('0xc')]>0x0){_0x49d479[_0xea5b('0xd')]=_0x1b344c[_0xea5b('0xe')][0x0][_0xea5b('0xf')];}logger[_0xea5b('0x10')]('['+[_0x519818[_0xea5b('0x11')]()]+_0xea5b('0x12'),_0x49d479);_0x25ee58(_0x49d479);})[_0xea5b('0x13')](function(_0x4c8773){logger[_0xea5b('0x14')]('['+[_0x519818['toUpperCase']()]+']',_0x4c8773['message']);_0x592a83(_0x4c8773['message']);});});}function getUser(_0x5435f8,_0x5ca052,_0x2eeb8d,_0x3e34ea,_0x3f96b7){return function(_0x596073){logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x15'),_0x596073);return new Promise(function(_0x3965d0,_0x4d2ea9){if(intUtil[_0xea5b('0x16')](_0x596073[_0xea5b('0x17')])){var _0x3ce1ae={'method':_0xea5b('0x18'),'uri':_0x2eeb8d+_0xea5b('0x19')+_0x596073[_0xea5b('0x17')]+'&'+_0x3e34ea+'&'+_0x3f96b7,'auth':_0x5ca052,'json':!![]};logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x3ce1ae);return rp(_0x3ce1ae)[_0xea5b('0xb')](function(_0x3c8373){logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x1a'),_0x3c8373);if(_0x3c8373['result'][_0xea5b('0xc')]>0x0&&String(_0x3c8373['result'][0x0][_0xea5b('0x1b')])===_0xea5b('0x1c')){_0x596073[_0xea5b('0x1d')]=_0x3c8373[_0xea5b('0xe')][0x0][_0xea5b('0xf')];}else{_0x596073[_0xea5b('0x1d')]=_0x596073[_0xea5b('0xd')];_0x596073[_0xea5b('0x17')]=_0x596073['adminEmail'];}logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x1e'),_0x596073);_0x3965d0(_0x596073);})['catch'](function(_0xb04389){logger[_0xea5b('0x14')]('['+[_0x5435f8['toUpperCase']()]+']',_0xb04389[_0xea5b('0x1f')]);_0x4d2ea9(_0xb04389[_0xea5b('0x1f')]);});}else{logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x20'));_0x596073['userId']=_0x596073['adminId'];_0x596073[_0xea5b('0x17')]=_0x596073[_0xea5b('0x21')];_0x3965d0(_0x596073);}});};}function createEndUser(_0x1518ec,_0x5cd4b2,_0x54fc3e,_0x453948,_0x274f88){logger[_0xea5b('0x10')]('['+[_0x1518ec[_0xea5b('0x11')]()]+_0xea5b('0x22'),_0x54fc3e);return new Promise(function(_0x52b2fa,_0xbf1b0c){var _0x59d348={'method':_0xea5b('0x23'),'uri':_0x453948+_0xea5b('0x24')+_0x274f88,'body':{'user_name':_0x54fc3e[_0xea5b('0x25')],'roles':'user','first_name':_0x54fc3e[_0xea5b('0x25')],'active':'true','date_format':_0xea5b('0x26'),'phone':_0x54fc3e['endUserNumber']},'auth':_0x5cd4b2,'json':!![]};return rp(_0x59d348)['then'](function(_0x56eace){logger[_0xea5b('0x10')]('['+[_0x1518ec[_0xea5b('0x11')]()]+_0xea5b('0x27'),_0x56eace['result']);_0x54fc3e[_0xea5b('0x28')]=_0x56eace[_0xea5b('0xe')][_0xea5b('0xf')];_0x52b2fa(_0x54fc3e);})[_0xea5b('0x13')](function(_0x21c169){logger['error']('['+[_0x1518ec[_0xea5b('0x11')]()]+']',_0x21c169[_0xea5b('0x1f')]);_0xbf1b0c(_0x21c169['message']);});});}function getEndUser(_0x1592c4,_0x441f15,_0x4d0adc,_0x48e722,_0x71880d){return function(_0x40160d){logger[_0xea5b('0x10')]('['+[_0x1592c4[_0xea5b('0x11')]()]+_0xea5b('0x29'),_0x40160d);return new Promise(function(_0x17aa6a,_0x306a55){var _0x5e91f9={'method':_0xea5b('0x18'),'uri':_0x4d0adc+_0xea5b('0x2a')+_0x40160d[_0xea5b('0x25')]+'&'+_0x48e722+'&'+_0x71880d,'auth':_0x441f15,'json':!![]};return rp(_0x5e91f9)[_0xea5b('0xb')](function(_0x4e53b3){if(_0x4e53b3['result']['length']>0x0){_0x40160d[_0xea5b('0x28')]=_0x4e53b3['result'][0x0]['sys_id'];logger[_0xea5b('0x10')]('['+[_0x1592c4[_0xea5b('0x11')]()]+_0xea5b('0x2b'),_0x40160d);_0x17aa6a(_0x40160d);}else{return createEndUser(_0x1592c4,_0x441f15,_0x40160d,_0x4d0adc,_0x48e722)[_0xea5b('0xb')](function(_0xd2686c){logger[_0xea5b('0x10')]('['+[_0x1592c4[_0xea5b('0x11')]()]+'],\x20createEndUser\x20crm',_0xd2686c);_0x17aa6a(_0xd2686c);});}})['catch'](function(_0x45d7d5){logger['error']('['+[_0x1592c4['toUpperCase']()]+']',_0x45d7d5[_0xea5b('0x1f')]);_0x306a55(_0x45d7d5['message']);});});};}function getCustomFields(_0x38d7e1,_0x2d53c8){var _0x396b93={};if(_0x38d7e1[_0xea5b('0xc')]>0x0){_[_0xea5b('0x2c')](_0x38d7e1,function(_0x793e1){if(_[_0xea5b('0x2d')]([_0xea5b('0x2e'),_0xea5b('0x2f')],_0x793e1[_0xea5b('0x30')])&&_0x793e1[_0xea5b('0x31')]&&!_0x793e1['customField']){_0x396b93[_0x793e1['nameField'][_0xea5b('0x32')]()]=_0x793e1[_0xea5b('0x33')]['toString']();}else if(_[_0xea5b('0x2d')]([_0xea5b('0x2e'),_0xea5b('0x2f')],_0x793e1[_0xea5b('0x30')])&&_0x793e1[_0xea5b('0x34')]&&_0x793e1['customField']){_0x396b93[_0x793e1[_0xea5b('0x34')][_0xea5b('0x32')]()]=_0x793e1[_0xea5b('0x33')]['toString']();}else if(_0x793e1[_0xea5b('0x30')]===_0xea5b('0x35')&&_0x793e1['variableName']&&_0x793e1[_0xea5b('0x34')]&&_0x793e1[_0xea5b('0x36')]){_0x396b93[_0x793e1[_0xea5b('0x34')][_0xea5b('0x32')]()]=_0x2d53c8[_0x793e1[_0xea5b('0x37')]][_0xea5b('0x38')]();}else if(_0x793e1['type']==='customVariable'&&_0x793e1[_0xea5b('0x39')]&&_0x793e1[_0xea5b('0x39')]['name']&&_0x793e1[_0xea5b('0x34')]&&_0x793e1[_0xea5b('0x36')]){_0x396b93[_0x793e1['idField']['toLowerCase']()]=_0x2d53c8[_0x793e1[_0xea5b('0x39')]['name'][_0xea5b('0x32')]()][_0xea5b('0x38')]();}});}return _0x396b93;}function getTicket(_0x398dda,_0x1a4bb8,_0x5658f7,_0x472a2a,_0x17d737,_0xfcc031){return function(_0x1987ac){logger[_0xea5b('0x10')]('['+[_0x398dda[_0xea5b('0x11')]()]+_0xea5b('0x3a'),_0x1987ac);return new Promise(function(_0x38ac57,_0x5b0395){var _0x191d82=_0x398dda[_0xea5b('0x32')]()==='outbound'?_0x1987ac['userId']:_0x1987ac['endUserId'];var _0x202a3b={'method':_0xea5b('0x23'),'uri':_0x5658f7+'incident'+'?'+_0xfcc031,'body':Object['assign']({},{'active':_0xea5b('0x1c'),'caller_id':_0x191d82,'assigned_to':_0x1987ac['userId'],'short_description':intUtil[_0xea5b('0x3b')](_0x472a2a[_0xea5b('0x3c')],_0x17d737,'\x20'),'description':intUtil[_0xea5b('0x3b')](_0x472a2a[_0xea5b('0x3d')],_0x17d737,'\x0a')},getCustomFields(_0x472a2a[_0xea5b('0x3e')],_0x17d737)),'auth':_0x1a4bb8,'json':!![]};return rp(_0x202a3b)[_0xea5b('0xb')](function(_0x50d847){logger[_0xea5b('0x10')]('['+[_0x398dda[_0xea5b('0x11')]()]+_0xea5b('0x3f'),_0x50d847[_0xea5b('0xe')]);_0x1987ac[_0xea5b('0x40')]=_0x50d847[_0xea5b('0xe')]['sys_id'];_0x1987ac['ticketNumber']=_0x50d847[_0xea5b('0xe')][_0xea5b('0x41')];logger[_0xea5b('0x10')]('['+[_0x398dda[_0xea5b('0x11')]()]+_0xea5b('0x42'),_0x1987ac);_0x38ac57(_0x1987ac);})[_0xea5b('0x13')](function(_0x21c136){logger[_0xea5b('0x14')]('['+[_0x398dda[_0xea5b('0x11')]()]+']',_0x21c136[_0xea5b('0x1f')]);_0x5b0395(_0x21c136[_0xea5b('0x1f')]);});});};}function createRemoteTag(_0x13efcf,_0x1438ba,_0x1ec795,_0x207102){return new Promise(function(_0x5bb28a,_0x4bb036){var _0x107510={'method':_0xea5b('0x23'),'uri':_0x1ec795+_0xea5b('0x43')+'?'+_0x207102,'body':{'short_description':_0x13efcf,'global':!![],'active':!![],'name':_0x13efcf},'auth':_0x1438ba,'json':!![]};return rp(_0x107510)[_0xea5b('0xb')](function(_0x1f7cc8){var _0x10c6bd=_0x1f7cc8[_0xea5b('0xe')][_0xea5b('0xf')];_0x5bb28a(_0x10c6bd);});});}function getRemoteTag(_0x2eaec4,_0x47ac52,_0x22d79b,_0x383900,_0x200826){return new Promise(function(_0x42226d,_0x3ea314){var _0x22d9d7={'method':_0xea5b('0x18'),'uri':_0x22d79b+_0xea5b('0x43')+_0xea5b('0x44')+_0x2eaec4+'&'+_0x383900,'auth':_0x47ac52,'json':!![]};return rp(_0x22d9d7)['then'](function(_0x16016b){if(_0x16016b[_0xea5b('0xe')]['length']>0x0){var _0x15b874=_0x16016b['result'][0x0][_0xea5b('0xf')];_0x42226d(_0x15b874);}else{return createRemoteTag(_0x2eaec4,_0x47ac52,_0x22d79b,_0x383900)[_0xea5b('0xb')](function(_0x2784f0){_0x42226d(_0x2784f0);});}});});}function assignTagToIncident(_0x16084e,_0x25a399,_0x4dac00,_0x2f78ae,_0x27c70b){return new Promise(function(_0x28a920,_0x243694){var _0x5a7de1={'method':'POST','uri':_0x4dac00+_0xea5b('0x45')+'?'+_0x27c70b,'body':{'label':_0x16084e,'table':_0xea5b('0x46'),'id_type':_0xea5b('0x47'),'table_key':_0x2f78ae['ticketId'],'title':_0xea5b('0x48')+_0x2f78ae[_0xea5b('0x49')],'id_display':_0x2f78ae['ticketNumber']},'auth':_0x25a399,'json':!![]};return rp(_0x5a7de1)[_0xea5b('0xb')](function(_0x23ce49){_0x28a920();})[_0xea5b('0x13')](function(){_0x28a920();});});}function manageTags(_0xbb7a8c,_0x4429c7,_0x1418fd,_0x4f2394,_0x6bd6d5,_0x1928c2,_0x1c0c8f){return new Promise(function(_0x586e02,_0x47d4a0){var _0x1256a5=[];_0x4429c7['forEach'](function(_0x35f8ef){_0x1256a5[_0xea5b('0x4a')](getRemoteTag(_0x35f8ef,_0x1418fd,_0x4f2394,_0x1928c2,_0x1c0c8f));});return Promise[_0xea5b('0x4b')](_0x1256a5)['then'](function(_0x102ca4){if(_0x102ca4[_0xea5b('0xc')]){logger[_0xea5b('0x10')]('['+[_0xbb7a8c[_0xea5b('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x102ca4);var _0x5953c9=[];_0x102ca4[_0xea5b('0x2c')](function(_0x15fd5c){_0x5953c9[_0xea5b('0x4a')](assignTagToIncident(_0x15fd5c,_0x1418fd,_0x4f2394,_0x6bd6d5,_0x1928c2));});return Promise[_0xea5b('0x4b')](_0x5953c9)[_0xea5b('0xb')](function(){_0x586e02();})['catch'](function(){_0x586e02();});}else{_0x586e02();}});});}function getTags(_0x563999,_0x22bf53,_0x408bdc,_0x353b79,_0x233137,_0x8101a0){return function(_0x187c44){return new Promise(function(_0x248db4,_0x462037){var _0x1e56ae=[];var _0xae5c8a=_0x353b79[_0xea5b('0x4c')];if(_0xae5c8a&&_0xae5c8a[_0xea5b('0xc')]>0x0){_0x1e56ae=_[_0xea5b('0x4d')](_0xae5c8a,'name');}if(_0x1e56ae[_0xea5b('0xc')]>0x0){return manageTags(_0x563999,_0x1e56ae,_0x22bf53,_0x408bdc,_0x187c44,_0x233137,_0x8101a0)[_0xea5b('0xb')](function(){_0x248db4(_0x187c44);});}else{_0x248db4(_0x187c44);}});};}function emit(_0x4ce5da,_0x46e1dc,_0x275f1c){var _0xdde96b=_0xea5b('0x4e')+_0xea5b('0x4f')+_0xea5b('0x50')+_0xea5b('0x51');var _0x43fd86={'uri':_0x4ce5da+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x275f1c+_0xdde96b};io['to'](util[_0xea5b('0x52')](_0xea5b('0x53'),_0x46e1dc))[_0xea5b('0x54')](_0xea5b('0x55'),_0x43fd86);}exports['cs']=function(_0x5a9396,_0x1fadd4,_0x5f0e04,_0xa130d8,_0x430b13,_0x5329de,_0x3af72b,_0x3c3145){var _0x3cea60={};var _0x293a22={'user':_0x5329de['username'],'pass':_0x5329de[_0xea5b('0x56')]};var _0x12b1cb=_0xea5b('0x57');var _0x4e922f='sysparm_display_value=true';_0x5329de[_0xea5b('0x58')]=intUtil[_0xea5b('0x59')](_0x5329de[_0xea5b('0x58')]);_0x5329de[_0xea5b('0x5a')]=intUtil[_0xea5b('0x59')](_0x5329de[_0xea5b('0x5a')]);var _0xde66a7=util[_0xea5b('0x52')](_0xea5b('0x5b'),_0x5329de[_0xea5b('0x58')]);_0x3cea60['userEmail']=!_[_0xea5b('0x5c')](_0xa130d8)?_0xa130d8[_0xea5b('0x5d')]:null;_0x3cea60[_0xea5b('0x21')]=_0x5329de['email'];_0x3cea60['endUserNumber']=_0x3c3145['toLowerCase']()===_0xea5b('0x5e')?_0x1fadd4[_0xea5b('0x5f')]:_0x1fadd4[_0xea5b('0x60')];_0x3cea60[_0xea5b('0x61')]=_0x3c3145==='queue'||_0x3c3145===_0xea5b('0x62')?_0xea5b('0x63'):_0xea5b('0x5e');var _0x29b72b=util[_0xea5b('0x52')](_0xea5b('0x64'),_0x5329de['serverUrl'],_0x1fadd4[_0xea5b('0x65')],md5(_0x1fadd4[_0xea5b('0x65')]));if(_0x430b13&&_0x430b13[_0xea5b('0x66')]){logger[_0xea5b('0x10')](_0xea5b('0x67'),_0xea5b('0x68'));_0x1fadd4[_0xea5b('0x69')]=_0x29b72b;}else if(_0x3af72b&&_0x3af72b['recordingFormat']&&_0x3af72b[_0xea5b('0x6a')]!=='none'){logger[_0xea5b('0x10')]('[OUTBOUND]',_0xea5b('0x68'));_0x1fadd4['recordingURL']=_0x29b72b;}else{_0x1fadd4[_0xea5b('0x69')]='';}return getAdminUser(_0x3c3145,_0x293a22,_0x3cea60,_0xde66a7,_0x4e922f,_0x12b1cb)['then'](getUser(_0x3c3145,_0x293a22,_0xde66a7,_0x4e922f,_0x12b1cb))[_0xea5b('0xb')](getEndUser(_0x3c3145,_0x293a22,_0xde66a7,_0x4e922f,_0x12b1cb))[_0xea5b('0xb')](getTicket(_0x3c3145,_0x293a22,_0xde66a7,_0x5f0e04,_0x1fadd4,_0x4e922f))[_0xea5b('0xb')](function(_0x1e9649){logger[_0xea5b('0x10')](util[_0xea5b('0x52')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1e9649[_0xea5b('0x40')]));logger[_0xea5b('0x10')](util[_0xea5b('0x52')]('call\x20direction:\x20%s',_0x3c3145));if(_0x3c3145!==_0xea5b('0x62')){logger['info']('['+[_0x3c3145[_0xea5b('0x11')]()]+']',_0xea5b('0x6b'));emit(_0x5329de['remoteUri'],_0xa130d8['name'],_0x1e9649['ticketId']);}})['catch'](function(_0x4b757a){logger[_0xea5b('0x14')]('['+[_0x3c3145['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xea5b('0x6c')](_0x4b757a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 51baba6..3a7da46 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fa2=['outbound','stripTrailingSlash','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','contacts','version','charAt','unmanaged','uri','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','bluebird','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','direction','forEach','variableName','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','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.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','length','map','string','nameField','type','customField','custom_fields','push','content','variable','Variable','toLowerCase','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error'];(function(_0x51eb91,_0x4799d5){var _0x1c4fc4=function(_0x1fd807){while(--_0x1fd807){_0x51eb91['push'](_0x51eb91['shift']());}};_0x1c4fc4(++_0x4799d5);}(_0x2fa2,0x8a));var _0x22fa=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x2fa2[_0x2dc343];return _0x51eac5;};'use strict';var _=require(_0x22fa('0x0'));var rp=require('request-promise');var BPromise=require(_0x22fa('0x1'));var md5=require(_0x22fa('0x2'));var util=require(_0x22fa('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x22fa('0x4'));var logger=require(_0x22fa('0x5'))(_0x22fa('0x6'));config[_0x22fa('0x7')]=_[_0x22fa('0x8')](config['redis'],{'host':_0x22fa('0x9'),'port':0x18eb});var io=require(_0x22fa('0xa'))(new Redis(config[_0x22fa('0x7')]));var def={'method':_0x22fa('0xb'),'json':!![]};function emit(_0x2158c7,_0x1d8b42,_0x4cb0ce){io['to'](_0x2158c7)['emit'](_0x1d8b42,_0x4cb0ce);}function getTicket(_0x58525a,_0x2fac8e,_0x33bd1f,_0x101f23,_0x3bd55f,_0x4e1ef7,_0x29a000,_0xf455a8){logger[_0x22fa('0xc')](_0x22fa('0xd'));var _0x34c620=new Date();var _0x5ce6fd=[{'name':_0x22fa('0xe'),'value':intUtil[_0x22fa('0xf')](_0x101f23['Subjects'],_0x3bd55f,'\x20')},{'name':_0x22fa('0x10'),'value':_0x2fac8e['id']},{'name':_0x22fa('0x11'),'value':_0x2fac8e['id']},{'name':_0x22fa('0x12'),'value':intUtil['getString'](_0x101f23[_0x22fa('0x13')],_0x3bd55f,'\x0a')},{'name':_0x22fa('0x14'),'value':_0x34c620[_0x22fa('0x15')]()[_0x22fa('0x16')](0x0,0x13)[_0x22fa('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x22fa('0x18'),'value':'15'},{'name':_0x22fa('0x19'),'value':_0x33bd1f['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x33bd1f[_0x22fa('0xe')]},{'name':_0x22fa('0x1a'),'value':_0xf455a8}];if(_0x4e1ef7['length']){_[_0x22fa('0x1b')](_0x4e1ef7,function(_0x18a1c5){if(_0x3bd55f[_0x18a1c5[_0x22fa('0x1c')]]){_0x5ce6fd['push']({'name':_0x18a1c5[_0x22fa('0x1d')],'value':_0x3bd55f[_0x18a1c5[_0x22fa('0x1c')]]});}});}return request({'form':{'method':_0x22fa('0x1e'),'input_type':_0x22fa('0x1f'),'response_type':_0x22fa('0x1f'),'rest_data':JSON[_0x22fa('0x20')]({'session':_0x29a000['id'],'module_name':'Calls','name_value_list':_0x5ce6fd})}});}function getAuth(_0x1ea66e){return util[_0x22fa('0x21')](_0x22fa('0x22'),new Buffer(_0x1ea66e[_0x22fa('0x23')]+':X')[_0x22fa('0x24')](_0x22fa('0x25')));}function getServerInfo(_0x4e2381){return request({'form':{'method':_0x22fa('0x26'),'input_type':'JSON','response_type':_0x22fa('0x1f'),'rest_data':JSON[_0x22fa('0x20')]({'session':_0x4e2381['id']})}});}function getUser(_0x267526,_0x21f604,_0x1cc1a3){if(!_[_0x22fa('0x27')](_0x21f604)){logger[_0x22fa('0xc')](_0x22fa('0x28'),_0x21f604);return request({'form':{'method':_0x22fa('0x29'),'input_type':_0x22fa('0x1f'),'response_type':'JSON','rest_data':JSON[_0x22fa('0x20')]({'session':_0x1cc1a3['id'],'module_name':'Employees','query':util[_0x22fa('0x21')](_0x22fa('0x2a'),_0x21f604),'order_by':'','offset':'0','select_fields':['id',_0x22fa('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x22fa('0x2b')](function(_0x148510){if(_0x148510[_0x22fa('0x2c')]['length']){var _0x5d721d=_[_0x22fa('0x2d')](_0x148510[_0x22fa('0x2c')],function(_0x234c88){return _0x234c88[_0x22fa('0x2e')][_0x22fa('0x2f')][_0x22fa('0x30')]===_0x21f604;});if(_0x5d721d){logger[_0x22fa('0xc')]('Agent\x20found!');return BPromise[_0x22fa('0x31')]({'id':_0x5d721d[_0x22fa('0x2e')]['id'][_0x22fa('0x30')],'name':_0x5d721d[_0x22fa('0x2e')][_0x22fa('0xe')][_0x22fa('0x30')]});}}logger[_0x22fa('0xc')](_0x22fa('0x32'));return BPromise['resolve']({'id':_0x1cc1a3[_0x22fa('0x2e')][_0x22fa('0x33')][_0x22fa('0x30')],'name':_0x1cc1a3[_0x22fa('0x2e')][_0x22fa('0x2f')][_0x22fa('0x30')]});});}else{logger[_0x22fa('0xc')](_0x22fa('0x34'));return BPromise[_0x22fa('0x31')]({'id':_0x1cc1a3[_0x22fa('0x2e')]['user_id'][_0x22fa('0x30')],'name':_0x1cc1a3[_0x22fa('0x2e')][_0x22fa('0x2f')][_0x22fa('0x30')]});}}function getEndUser(_0x2e36a6,_0x185be3,_0x5ad79d,_0x3b11ef){logger[_0x22fa('0xc')](_0x22fa('0x35'),_0x5ad79d);return request({'form':{'method':_0x22fa('0x29'),'input_type':'JSON','response_type':_0x22fa('0x1f'),'rest_data':JSON['stringify']({'session':_0x3b11ef['id'],'module_name':'Contacts','query':util[_0x22fa('0x21')](_0x22fa('0x36'),_0x5ad79d),'order_by':'','offset':'0','select_fields':['id',_0x22fa('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x22fa('0x2b')](function(_0xf0dfc5){if(_0xf0dfc5[_0x22fa('0x2c')]['length']){var _0x136ecd=_[_0x22fa('0x2d')](_0xf0dfc5[_0x22fa('0x2c')],function(_0x2aba4f){return _0x2aba4f[_0x22fa('0x2e')][_0x22fa('0x37')][_0x22fa('0x30')]===_0x5ad79d;});if(_0x136ecd){logger[_0x22fa('0xc')](_0x22fa('0x38'));return BPromise['resolve']({'id':_0x136ecd['name_value_list']['id'][_0x22fa('0x30')],'name':_0x136ecd[_0x22fa('0x2e')][_0x22fa('0xe')][_0x22fa('0x30')],'phone':_0x136ecd[_0x22fa('0x2e')][_0x22fa('0x37')][_0x22fa('0x30')]});}}else{logger[_0x22fa('0xc')](_0x22fa('0x39'));return request({'form':{'method':_0x22fa('0x1e'),'input_type':_0x22fa('0x1f'),'response_type':_0x22fa('0x1f'),'rest_data':JSON['stringify']({'session':_0x3b11ef['id'],'module_name':'Contacts','name_value_list':[{'name':_0x22fa('0x3a'),'value':_0x185be3!==_0x22fa('0x3b')?_0x185be3:util['format'](_0x22fa('0x3c'),_0x5ad79d)},{'name':_0x22fa('0x37'),'value':_0x5ad79d}]})}})['then'](function(_0x368bed){logger[_0x22fa('0xc')](_0x22fa('0x3d'));return BPromise[_0x22fa('0x31')]({'id':_0x368bed['id'],'name':_0x368bed[_0x22fa('0x2c')][_0x22fa('0x3a')]['value'],'phone':_0x368bed[_0x22fa('0x2c')][_0x22fa('0x37')][_0x22fa('0x30')]});});}});}function request(_0x582f93){logger[_0x22fa('0x3e')](_0x22fa('0x3f'),JSON[_0x22fa('0x20')](_0x582f93));return rp(_['merge'](def,_0x582f93));}function getTags(_0x3fc5d9,_0x4bb2cf){var _0xa79763=[];if(_0x3fc5d9&&_0x3fc5d9[_0x22fa('0x40')]>0x0){_0xa79763=_[_0x22fa('0x41')](_0x3fc5d9,_0x4bb2cf);}return _0xa79763;}function getCustomFields(_0x62a6a4,_0x187465){var _0x805026=[];var _0x4e35e2={'custom_fields':[]};if(_0x62a6a4[_0x22fa('0x40')]>0x0){_[_0x22fa('0x1b')](_0x62a6a4,function(_0x29e590){if(_0x29e590['type']===_0x22fa('0x42')&&_0x29e590[_0x22fa('0x43')]&&!_0x29e590['customField']){_0x4e35e2[_0x29e590['nameField']['toLowerCase']()]=_0x29e590['content'][_0x22fa('0x24')]();}else if(_0x29e590[_0x22fa('0x44')]===_0x22fa('0x42')&&_0x29e590[_0x22fa('0x1d')]&&_0x29e590[_0x22fa('0x45')]){_0x4e35e2[_0x22fa('0x46')][_0x22fa('0x47')]({'id':_0x29e590[_0x22fa('0x1d')],'value':_0x29e590[_0x22fa('0x48')]['toString']()});}else if(_0x29e590['type']===_0x22fa('0x49')&&_0x29e590[_0x22fa('0x1c')]&&_0x29e590[_0x22fa('0x1d')]&&_0x29e590['customField']){_0x187465[_0x29e590['variableName']]&&_0x4e35e2['custom_fields'][_0x22fa('0x47')]({'id':_0x29e590[_0x22fa('0x1d')],'value':_0x187465[_0x29e590[_0x22fa('0x1c')]][_0x22fa('0x24')]()});}else if(_0x29e590[_0x22fa('0x44')]==='customVariable'&&_0x29e590['Variable']&&_0x29e590[_0x22fa('0x4a')][_0x22fa('0xe')]&&_0x29e590[_0x22fa('0x1d')]&&_0x29e590['customField']){_0x187465[_0x29e590['Variable'][_0x22fa('0xe')][_0x22fa('0x4b')]()]&&_0x4e35e2[_0x22fa('0x46')][_0x22fa('0x47')]({'id':_0x29e590[_0x22fa('0x1d')],'value':_0x187465[_0x29e590[_0x22fa('0x4a')]['name']['toLowerCase']()][_0x22fa('0x24')]()});}});}return _0x4e35e2;}function getConnection(_0x29c036){return request({'method':_0x22fa('0xb'),'form':{'method':_0x22fa('0x4c'),'input_type':_0x22fa('0x1f'),'response_type':_0x22fa('0x1f'),'rest_data':JSON[_0x22fa('0x20')]({'user_auth':{'user_name':_0x29c036[_0x22fa('0x4d')],'password':_0x29c036[_0x22fa('0x4e')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x22fa('0x2b')](function(_0x378b8b){var _0x523112=_0x378b8b;if(_0x523112['id']){def[_0x22fa('0x4f')]=_0x523112['id'];return BPromise[_0x22fa('0x31')](_0x523112);}else{throw new Error(util[_0x22fa('0x21')](_0x22fa('0x50'),_0x29c036['id']));}});}function setRelationship(_0x1a1463,_0x152554,_0x5ef22b,_0x2de8a3){return request({'form':{'method':_0x22fa('0x51'),'input_type':_0x22fa('0x1f'),'response_type':_0x22fa('0x1f'),'rest_data':JSON[_0x22fa('0x20')]({'session':_0x1a1463['id'],'module_name':'Calls','module_id':_0x5ef22b['id'],'link_field_name':_0x2de8a3,'related_ids':[_0x152554['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x22fa('0x52')]=function(_0x580cfb,_0x5e2d10,_0x301a43,_0x342b6e,_0x1828ae,_0x2e075d){var _0x1b361a,_0x47a056,_0x54236a,_0x2459dd;_0x2e075d[_0x22fa('0x53')]=intUtil['stripTrailingSlash'](_0x2e075d['remoteUri']);_0x2e075d[_0x22fa('0x54')]=intUtil['stripTrailingSlash'](_0x2e075d[_0x22fa('0x54')]);def['uri']=util[_0x22fa('0x21')]('%s/service/v4_1/rest.php',_0x2e075d[_0x22fa('0x53')]);if(_0x1828ae&&_0x1828ae[_0x22fa('0x55')]){logger['info'](_0x22fa('0x56'),_0x22fa('0x57'));_0x5e2d10['recordingURL']=util[_0x22fa('0x21')](_0x22fa('0x58'),_0x2e075d[_0x22fa('0x54')],_0x5e2d10[_0x22fa('0x59')],md5(_0x5e2d10['uniqueid']));}else{_0x5e2d10[_0x22fa('0x5a')]='';}return getConnection(_0x2e075d)[_0x22fa('0x2b')](function(_0x3534e9){_0x2459dd=_0x3534e9;return getUser(_0x2e075d,_0x342b6e['name'],_0x2459dd);})[_0x22fa('0x2b')](function(_0x57eb92){_0x1b361a=_0x57eb92;logger[_0x22fa('0xc')](_0x22fa('0x5b'),_0x1b361a['id']);return getEndUser(_0x2e075d,_0x5e2d10[_0x22fa('0x5c')],_0x5e2d10[_0x22fa('0x5d')],_0x2459dd);})[_0x22fa('0x2b')](function(_0x3d22a0){_0x47a056=_0x3d22a0;logger[_0x22fa('0xc')]('The\x20Enduser\x20ID\x20is:',_0x47a056['id']);return getTicket(_0x2e075d,_0x1b361a,_0x47a056,_0x301a43,_0x5e2d10,_0x301a43['Fields'],_0x2459dd,_0x22fa('0x5e'));})[_0x22fa('0x2b')](function(_0x17101e){_0x54236a=_0x17101e;logger['info'](_0x22fa('0x5f'));logger[_0x22fa('0xc')](_0x22fa('0x60'),_0x54236a['id']);return setRelationship(_0x2459dd,_0x1b361a,_0x54236a,_0x22fa('0x61'));})[_0x22fa('0x2b')](function(){return setRelationship(_0x2459dd,_0x47a056,_0x54236a,'contacts');})[_0x22fa('0x2b')](function(){return getServerInfo(_0x2459dd);})[_0x22fa('0x2b')](function(_0x40ca5f){var _0x2276ad=parseInt(_0x40ca5f['version']['charAt'](0x0));var _0x13dc00=util[_0x22fa('0x21')](_0x22fa('0x62'),_0x2e075d[_0x22fa('0x53')],_0x54236a['id']);if(_0x2276ad>0x6){_0x13dc00=util[_0x22fa('0x21')](_0x22fa('0x63'),_0x2e075d['remoteUri'],_0x54236a['id']);}logger['info'](_0x22fa('0x56'),_0x22fa('0x64'));emit(util[_0x22fa('0x21')](_0x22fa('0x65'),_0x342b6e[_0x22fa('0xe')]),'trigger:browser:url',{'uri':_0x13dc00});})[_0x22fa('0x66')](function(_0x44327a){logger[_0x22fa('0x67')]('[QUEUE]',JSON[_0x22fa('0x20')](_0x44327a));});};exports[_0x22fa('0x68')]=function(_0x234f9a,_0x48ba1f,_0x15fc66,_0x35918c,_0x5a3dd6,_0x45d792,_0x7da20d){var _0x2c6540,_0x1039e2,_0x4402fd,_0x571863;_0x45d792[_0x22fa('0x53')]=intUtil['stripTrailingSlash'](_0x45d792[_0x22fa('0x53')]);_0x45d792[_0x22fa('0x54')]=intUtil[_0x22fa('0x69')](_0x45d792[_0x22fa('0x54')]);def['uri']=util[_0x22fa('0x21')](_0x22fa('0x6a'),_0x45d792[_0x22fa('0x53')]);if(_0x7da20d&&_0x7da20d[_0x22fa('0x6b')]&&_0x7da20d[_0x22fa('0x6b')]!==_0x22fa('0x6c')){logger[_0x22fa('0xc')](_0x22fa('0x6d'),_0x22fa('0x57'));_0x48ba1f[_0x22fa('0x5a')]=util['format'](_0x22fa('0x58'),_0x45d792[_0x22fa('0x54')],_0x48ba1f[_0x22fa('0x59')],md5(_0x48ba1f[_0x22fa('0x59')]));}return getConnection(_0x45d792)[_0x22fa('0x2b')](function(_0x5a23c2){_0x571863=_0x5a23c2;return getUser(_0x45d792,_0x35918c[_0x22fa('0xe')],_0x571863);})['then'](function(_0x38e54e){_0x2c6540=_0x38e54e;logger[_0x22fa('0xc')](_0x22fa('0x5b'),_0x2c6540['id']);return getEndUser(_0x45d792,_0x48ba1f[_0x22fa('0x6e')],_0x48ba1f[_0x22fa('0x6f')],_0x571863);})['then'](function(_0x1a597d){_0x1039e2=_0x1a597d;logger[_0x22fa('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1039e2['id']);return getTicket(_0x45d792,_0x2c6540,_0x1039e2,_0x15fc66,_0x48ba1f,_0x15fc66[_0x22fa('0x70')],_0x571863,'Outbound');})[_0x22fa('0x2b')](function(_0x41183f){_0x4402fd=_0x41183f;logger[_0x22fa('0xc')]('Ticket\x20created!');logger[_0x22fa('0xc')](_0x22fa('0x60'),_0x4402fd['id']);return setRelationship(_0x571863,_0x2c6540,_0x4402fd,_0x22fa('0x61'));})[_0x22fa('0x2b')](function(){return setRelationship(_0x571863,_0x1039e2,_0x4402fd,_0x22fa('0x71'));})[_0x22fa('0x2b')](function(){return getServerInfo(_0x571863);})[_0x22fa('0x2b')](function(_0x5b0160){var _0x414915=parseInt(_0x5b0160[_0x22fa('0x72')][_0x22fa('0x73')](0x0));var _0x582973=util[_0x22fa('0x21')](_0x22fa('0x62'),_0x45d792[_0x22fa('0x53')],_0x4402fd['id']);if(_0x414915>0x6){_0x582973=util[_0x22fa('0x21')](_0x22fa('0x63'),_0x45d792[_0x22fa('0x53')],_0x4402fd['id']);}logger[_0x22fa('0xc')]('[OUTBOUND]',_0x22fa('0x64'));emit(util[_0x22fa('0x21')](_0x22fa('0x65'),_0x35918c['name']),'trigger:browser:url',{'uri':_0x582973});})['catch'](function(_0x1f866a){logger[_0x22fa('0x67')](_0x22fa('0x6d'),JSON[_0x22fa('0x20')](_0x1f866a));});};exports[_0x22fa('0x74')]=function(_0x2e82cc,_0x431eae,_0x2bfcdb,_0x5e111b,_0x2012e4,_0x3fb6ff){var _0x2844fa,_0x1d8f18,_0x4f02d9,_0x27ac01;_0x3fb6ff[_0x22fa('0x53')]=intUtil['stripTrailingSlash'](_0x3fb6ff[_0x22fa('0x53')]);_0x3fb6ff['serverUrl']=intUtil['stripTrailingSlash'](_0x3fb6ff[_0x22fa('0x54')]);def[_0x22fa('0x75')]=util[_0x22fa('0x21')](_0x22fa('0x6a'),_0x3fb6ff['remoteUri']);if(_0x2012e4&&_0x2012e4[_0x22fa('0x55')]){logger[_0x22fa('0xc')]('['+_0x431eae[_0x22fa('0x76')][_0x22fa('0x77')]()+']','Recording\x20is\x20enabled!');_0x431eae[_0x22fa('0x5a')]=util['format'](_0x22fa('0x58'),_0x3fb6ff[_0x22fa('0x54')],_0x431eae['uniqueid'],md5(_0x431eae[_0x22fa('0x59')]));}else{_0x431eae[_0x22fa('0x5a')]='';}return getConnection(_0x3fb6ff)[_0x22fa('0x2b')](function(_0x462d13){_0x27ac01=_0x462d13;if(!_[_0x22fa('0x27')](_0x5e111b)){return getUser(_0x3fb6ff,_0x5e111b['name'],_0x27ac01);}else{return getUser(_0x3fb6ff,null,_0x27ac01);}})[_0x22fa('0x2b')](function(_0x474ffc){_0x2844fa=_0x474ffc;logger[_0x22fa('0xc')](_0x22fa('0x5b'),_0x2844fa['id']);return getEndUser(_0x3fb6ff,_0x431eae[_0x22fa('0x5c')],_0x431eae['calleridnum'],_0x27ac01);})[_0x22fa('0x2b')](function(_0x34a355){_0x1d8f18=_0x34a355;logger[_0x22fa('0xc')](_0x22fa('0x78'),_0x1d8f18['id']);return getTicket(_0x3fb6ff,_0x2844fa,_0x1d8f18,_0x2bfcdb,_0x431eae,_0x2bfcdb[_0x22fa('0x70')],_0x27ac01,'Inbound');})[_0x22fa('0x2b')](function(_0x1a19ba){_0x4f02d9=_0x1a19ba;logger['info'](_0x22fa('0x5f'));logger[_0x22fa('0xc')](_0x22fa('0x60'),_0x4f02d9['id']);return setRelationship(_0x27ac01,_0x2844fa,_0x4f02d9,'users');})[_0x22fa('0x2b')](function(){return setRelationship(_0x27ac01,_0x1d8f18,_0x4f02d9,_0x22fa('0x71'));})[_0x22fa('0x2b')](function(){return getServerInfo(_0x27ac01);})[_0x22fa('0x66')](function(_0x22c889){logger[_0x22fa('0x67')]('['+_0x431eae[_0x22fa('0x76')]['toUpperCase']()+']',JSON[_0x22fa('0x20')](_0x22c889));});}; \ No newline at end of file +var _0x8213=['sessionID','set_relationship','stripTrailingSlash','remoteUri','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','Fields','contacts','[OUTBOUND]','error','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','Descriptions','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','then','entry_list','length','find','name_value_list','user_name','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','debug','[HTTP]','merge','map','type','customField','nameField','toLowerCase','idField','custom_fields','push','content','variable','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x8213,0x1ee));var _0x3821=function(_0x2e8988,_0x49fa99){_0x2e8988=_0x2e8988-0x0;var _0x5d40ec=_0x8213[_0x2e8988];return _0x5d40ec;};'use strict';var _=require(_0x3821('0x0'));var rp=require(_0x3821('0x1'));var BPromise=require('bluebird');var md5=require(_0x3821('0x2'));var util=require(_0x3821('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3821('0x4'));config[_0x3821('0x5')]=_[_0x3821('0x6')](config[_0x3821('0x5')],{'host':_0x3821('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x3821('0x8'),'json':!![]};function emit(_0x19f96,_0x985ec7,_0x251bac){io['to'](_0x19f96)[_0x3821('0x9')](_0x985ec7,_0x251bac);}function getTicket(_0x296bbf,_0x75f11c,_0xf5b9f6,_0x2ffdc7,_0x47d1e4,_0x7d03a4,_0x44447f,_0x2e8f4c){logger[_0x3821('0xa')](_0x3821('0xb'));var _0x56b1b9=new Date();var _0x53f320=[{'name':'name','value':intUtil[_0x3821('0xc')](_0x2ffdc7[_0x3821('0xd')],_0x47d1e4,'\x20')},{'name':'assigned_user_id','value':_0x75f11c['id']},{'name':_0x3821('0xe'),'value':_0x75f11c['id']},{'name':'description','value':intUtil[_0x3821('0xc')](_0x2ffdc7[_0x3821('0xf')],_0x47d1e4,'\x0a')},{'name':'date_start','value':_0x56b1b9[_0x3821('0x10')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x3821('0x11'),'value':'0'},{'name':_0x3821('0x12'),'value':'15'},{'name':_0x3821('0x13'),'value':_0xf5b9f6['id']},{'name':_0x3821('0x14'),'value':_0x3821('0x15')},{'name':_0x3821('0x16'),'value':_0xf5b9f6['name']},{'name':_0x3821('0x17'),'value':_0x2e8f4c}];if(_0x7d03a4['length']){_[_0x3821('0x18')](_0x7d03a4,function(_0x3ef49c){if(_0x47d1e4[_0x3ef49c[_0x3821('0x19')]]){_0x53f320['push']({'name':_0x3ef49c['idField'],'value':_0x47d1e4[_0x3ef49c[_0x3821('0x19')]]});}});}return request({'form':{'method':_0x3821('0x1a'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0x44447f['id'],'module_name':_0x3821('0x1d'),'name_value_list':_0x53f320})}});}function getAuth(_0xd5b647){return util[_0x3821('0x1e')](_0x3821('0x1f'),new Buffer(_0xd5b647[_0x3821('0x20')]+':X')[_0x3821('0x21')](_0x3821('0x22')));}function getServerInfo(_0x4bc852){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0x4bc852['id']})}});}function getUser(_0x2d303b,_0x42aeaa,_0x45e0d4){if(!_[_0x3821('0x23')](_0x42aeaa)){logger[_0x3821('0xa')](_0x3821('0x24'),_0x42aeaa);return request({'form':{'method':_0x3821('0x25'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0x45e0d4['id'],'module_name':_0x3821('0x26'),'query':util[_0x3821('0x1e')](_0x3821('0x27'),_0x42aeaa),'order_by':'','offset':'0','select_fields':['id',_0x3821('0x28'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3821('0x29')](function(_0x4471ad){if(_0x4471ad[_0x3821('0x2a')][_0x3821('0x2b')]){var _0x283171=_[_0x3821('0x2c')](_0x4471ad[_0x3821('0x2a')],function(_0x3336a2){return _0x3336a2[_0x3821('0x2d')][_0x3821('0x2e')][_0x3821('0x2f')]===_0x42aeaa;});if(_0x283171){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x283171['name_value_list']['id'][_0x3821('0x2f')],'name':_0x283171['name_value_list'][_0x3821('0x28')][_0x3821('0x2f')]});}}logger['info'](_0x3821('0x30'));return BPromise[_0x3821('0x31')]({'id':_0x45e0d4[_0x3821('0x2d')]['user_id'][_0x3821('0x2f')],'name':_0x45e0d4[_0x3821('0x2d')]['user_name'][_0x3821('0x2f')]});});}else{logger[_0x3821('0xa')](_0x3821('0x32'));return BPromise['resolve']({'id':_0x45e0d4[_0x3821('0x2d')][_0x3821('0x33')][_0x3821('0x2f')],'name':_0x45e0d4[_0x3821('0x2d')][_0x3821('0x2e')]['value']});}}function getEndUser(_0x6bff7a,_0x5d4a3b,_0xf099ae,_0xaf9fb2){logger[_0x3821('0xa')]('Searching\x20enduser\x20with\x20phone',_0xf099ae);return request({'form':{'method':_0x3821('0x25'),'input_type':'JSON','response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0xaf9fb2['id'],'module_name':_0x3821('0x15'),'query':util[_0x3821('0x1e')](_0x3821('0x34'),_0xf099ae),'order_by':'','offset':'0','select_fields':['id','name',_0x3821('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3821('0x29')](function(_0x408a77){if(_0x408a77[_0x3821('0x2a')][_0x3821('0x2b')]){var _0xa11a88=_[_0x3821('0x2c')](_0x408a77[_0x3821('0x2a')],function(_0x48b48a){return _0x48b48a[_0x3821('0x2d')]['phone_home']['value']===_0xf099ae;});if(_0xa11a88){logger[_0x3821('0xa')](_0x3821('0x36'));return BPromise[_0x3821('0x31')]({'id':_0xa11a88['name_value_list']['id'][_0x3821('0x2f')],'name':_0xa11a88[_0x3821('0x2d')][_0x3821('0x28')]['value'],'phone':_0xa11a88[_0x3821('0x2d')][_0x3821('0x35')][_0x3821('0x2f')]});}}else{logger[_0x3821('0xa')](_0x3821('0x37'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0xaf9fb2['id'],'module_name':_0x3821('0x15'),'name_value_list':[{'name':'first_name','value':_0x5d4a3b!==_0x3821('0x38')?_0x5d4a3b:util[_0x3821('0x1e')]('Caller\x20-\x20%s',_0xf099ae)},{'name':_0x3821('0x35'),'value':_0xf099ae}]})}})[_0x3821('0x29')](function(_0x21dd3a){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x21dd3a['id'],'name':_0x21dd3a[_0x3821('0x2a')]['first_name'][_0x3821('0x2f')],'phone':_0x21dd3a['entry_list'][_0x3821('0x35')]['value']});});}});}function request(_0x26f75c){logger[_0x3821('0x39')](_0x3821('0x3a'),JSON[_0x3821('0x1c')](_0x26f75c));return rp(_[_0x3821('0x3b')](def,_0x26f75c));}function getTags(_0x1fd0a1,_0x14b6ff){var _0x389af3=[];if(_0x1fd0a1&&_0x1fd0a1[_0x3821('0x2b')]>0x0){_0x389af3=_[_0x3821('0x3c')](_0x1fd0a1,_0x14b6ff);}return _0x389af3;}function getCustomFields(_0x2ac634,_0x45abd7){var _0x202c19=[];var _0x58fde0={'custom_fields':[]};if(_0x2ac634[_0x3821('0x2b')]>0x0){_[_0x3821('0x18')](_0x2ac634,function(_0x3d7bbc){if(_0x3d7bbc[_0x3821('0x3d')]==='string'&&_0x3d7bbc['nameField']&&!_0x3d7bbc[_0x3821('0x3e')]){_0x58fde0[_0x3d7bbc[_0x3821('0x3f')][_0x3821('0x40')]()]=_0x3d7bbc['content'][_0x3821('0x21')]();}else if(_0x3d7bbc[_0x3821('0x3d')]==='string'&&_0x3d7bbc[_0x3821('0x41')]&&_0x3d7bbc[_0x3821('0x3e')]){_0x58fde0[_0x3821('0x42')][_0x3821('0x43')]({'id':_0x3d7bbc[_0x3821('0x41')],'value':_0x3d7bbc[_0x3821('0x44')][_0x3821('0x21')]()});}else if(_0x3d7bbc[_0x3821('0x3d')]===_0x3821('0x45')&&_0x3d7bbc[_0x3821('0x19')]&&_0x3d7bbc[_0x3821('0x41')]&&_0x3d7bbc['customField']){_0x45abd7[_0x3d7bbc[_0x3821('0x19')]]&&_0x58fde0['custom_fields'][_0x3821('0x43')]({'id':_0x3d7bbc[_0x3821('0x41')],'value':_0x45abd7[_0x3d7bbc[_0x3821('0x19')]][_0x3821('0x21')]()});}else if(_0x3d7bbc[_0x3821('0x3d')]===_0x3821('0x46')&&_0x3d7bbc[_0x3821('0x47')]&&_0x3d7bbc[_0x3821('0x47')]['name']&&_0x3d7bbc[_0x3821('0x41')]&&_0x3d7bbc[_0x3821('0x3e')]){_0x45abd7[_0x3d7bbc[_0x3821('0x47')][_0x3821('0x28')][_0x3821('0x40')]()]&&_0x58fde0[_0x3821('0x42')]['push']({'id':_0x3d7bbc[_0x3821('0x41')],'value':_0x45abd7[_0x3d7bbc[_0x3821('0x47')][_0x3821('0x28')][_0x3821('0x40')]()]['toString']()});}});}return _0x58fde0;}function getConnection(_0x3c765a){return request({'method':'POST','form':{'method':_0x3821('0x48'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3c765a[_0x3821('0x49')],'password':_0x3c765a[_0x3821('0x4a')],'encryption':'PLAIN'},'application':_0x3821('0x4b')})}})[_0x3821('0x29')](function(_0x328d8d){var _0x400e91=_0x328d8d;if(_0x400e91['id']){def[_0x3821('0x4c')]=_0x400e91['id'];return BPromise['resolve'](_0x400e91);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x3c765a['id']));}});}function setRelationship(_0xcd6bf9,_0x23d8a5,_0x39970d,_0x3ff3bc){return request({'form':{'method':_0x3821('0x4d'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0xcd6bf9['id'],'module_name':_0x3821('0x1d'),'module_id':_0x39970d['id'],'link_field_name':_0x3ff3bc,'related_ids':[_0x23d8a5['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5bea9f,_0xfe83f1,_0x58664b,_0x489715,_0x6a898c,_0x22be2b){var _0x2756b2,_0x351922,_0x417e5f,_0x51fcdf;_0x22be2b['remoteUri']=intUtil[_0x3821('0x4e')](_0x22be2b[_0x3821('0x4f')]);_0x22be2b[_0x3821('0x50')]=intUtil[_0x3821('0x4e')](_0x22be2b[_0x3821('0x50')]);def['uri']=util[_0x3821('0x1e')]('%s/service/v4_1/rest.php',_0x22be2b['remoteUri']);if(_0x6a898c&&_0x6a898c['monitor_format']){logger[_0x3821('0xa')](_0x3821('0x51'),'Recording\x20is\x20enabled!');_0xfe83f1[_0x3821('0x52')]=util['format'](_0x3821('0x53'),_0x22be2b[_0x3821('0x50')],_0xfe83f1[_0x3821('0x54')],md5(_0xfe83f1[_0x3821('0x54')]));}else{_0xfe83f1[_0x3821('0x52')]='';}return getConnection(_0x22be2b)['then'](function(_0x20ccda){_0x51fcdf=_0x20ccda;return getUser(_0x22be2b,_0x489715[_0x3821('0x28')],_0x51fcdf);})['then'](function(_0x762856){_0x2756b2=_0x762856;logger['info'](_0x3821('0x55'),_0x2756b2['id']);return getEndUser(_0x22be2b,_0xfe83f1[_0x3821('0x56')],_0xfe83f1[_0x3821('0x57')],_0x51fcdf);})[_0x3821('0x29')](function(_0x314b32){_0x351922=_0x314b32;logger[_0x3821('0xa')](_0x3821('0x58'),_0x351922['id']);return getTicket(_0x22be2b,_0x2756b2,_0x351922,_0x58664b,_0xfe83f1,_0x58664b['Fields'],_0x51fcdf,_0x3821('0x59'));})['then'](function(_0x3ccb79){_0x417e5f=_0x3ccb79;logger[_0x3821('0xa')](_0x3821('0x5a'));logger[_0x3821('0xa')](_0x3821('0x5b'),_0x417e5f['id']);return setRelationship(_0x51fcdf,_0x2756b2,_0x417e5f,_0x3821('0x5c'));})[_0x3821('0x29')](function(){return setRelationship(_0x51fcdf,_0x351922,_0x417e5f,'contacts');})[_0x3821('0x29')](function(){return getServerInfo(_0x51fcdf);})[_0x3821('0x29')](function(_0x51295a){var _0x38c4b0=parseInt(_0x51295a[_0x3821('0x5d')][_0x3821('0x5e')](0x0));var _0x44e7b8=util['format'](_0x3821('0x5f'),_0x22be2b['remoteUri'],_0x417e5f['id']);if(_0x38c4b0>0x6){_0x44e7b8=util['format'](_0x3821('0x60'),_0x22be2b['remoteUri'],_0x417e5f['id']);}logger['info'](_0x3821('0x51'),_0x3821('0x61'));emit(util['format'](_0x3821('0x62'),_0x489715['name']),_0x3821('0x63'),{'uri':_0x44e7b8});})[_0x3821('0x64')](function(_0x5c4227){logger['error'](_0x3821('0x51'),JSON['stringify'](_0x5c4227));});};exports[_0x3821('0x65')]=function(_0x30b2b8,_0x3025c2,_0x4627fb,_0x1a69e6,_0x22e775,_0xa7a022,_0x544c21){var _0x267657,_0x508fa8,_0x5ca28e,_0x55b099;_0xa7a022[_0x3821('0x4f')]=intUtil[_0x3821('0x4e')](_0xa7a022['remoteUri']);_0xa7a022[_0x3821('0x50')]=intUtil['stripTrailingSlash'](_0xa7a022[_0x3821('0x50')]);def[_0x3821('0x66')]=util[_0x3821('0x1e')](_0x3821('0x67'),_0xa7a022[_0x3821('0x4f')]);if(_0x544c21&&_0x544c21[_0x3821('0x68')]&&_0x544c21[_0x3821('0x68')]!==_0x3821('0x69')){logger['info']('[OUTBOUND]',_0x3821('0x6a'));_0x3025c2[_0x3821('0x52')]=util['format'](_0x3821('0x53'),_0xa7a022[_0x3821('0x50')],_0x3025c2['uniqueid'],md5(_0x3025c2[_0x3821('0x54')]));}return getConnection(_0xa7a022)['then'](function(_0x411ebc){_0x55b099=_0x411ebc;return getUser(_0xa7a022,_0x1a69e6['name'],_0x55b099);})[_0x3821('0x29')](function(_0x2ab434){_0x267657=_0x2ab434;logger[_0x3821('0xa')](_0x3821('0x55'),_0x267657['id']);return getEndUser(_0xa7a022,_0x3025c2['destcalleridname'],_0x3025c2['destcalleridnum'],_0x55b099);})[_0x3821('0x29')](function(_0x24390d){_0x508fa8=_0x24390d;logger[_0x3821('0xa')](_0x3821('0x58'),_0x508fa8['id']);return getTicket(_0xa7a022,_0x267657,_0x508fa8,_0x4627fb,_0x3025c2,_0x4627fb[_0x3821('0x6b')],_0x55b099,'Outbound');})['then'](function(_0x5aaf3d){_0x5ca28e=_0x5aaf3d;logger[_0x3821('0xa')](_0x3821('0x5a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5ca28e['id']);return setRelationship(_0x55b099,_0x267657,_0x5ca28e,_0x3821('0x5c'));})[_0x3821('0x29')](function(){return setRelationship(_0x55b099,_0x508fa8,_0x5ca28e,_0x3821('0x6c'));})['then'](function(){return getServerInfo(_0x55b099);})['then'](function(_0x22aa6c){var _0x62d9f5=parseInt(_0x22aa6c[_0x3821('0x5d')]['charAt'](0x0));var _0x198f27=util[_0x3821('0x1e')](_0x3821('0x5f'),_0xa7a022['remoteUri'],_0x5ca28e['id']);if(_0x62d9f5>0x6){_0x198f27=util[_0x3821('0x1e')](_0x3821('0x60'),_0xa7a022[_0x3821('0x4f')],_0x5ca28e['id']);}logger[_0x3821('0xa')](_0x3821('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3821('0x1e')](_0x3821('0x62'),_0x1a69e6['name']),_0x3821('0x63'),{'uri':_0x198f27});})[_0x3821('0x64')](function(_0x55d4e3){logger[_0x3821('0x6e')](_0x3821('0x6d'),JSON[_0x3821('0x1c')](_0x55d4e3));});};exports[_0x3821('0x6f')]=function(_0x30967e,_0x518493,_0x13579d,_0x425274,_0x14e97a,_0x4b7b56){var _0xbe7ba5,_0x2c095f,_0x3336ba,_0x4a8339;_0x4b7b56[_0x3821('0x4f')]=intUtil[_0x3821('0x4e')](_0x4b7b56['remoteUri']);_0x4b7b56[_0x3821('0x50')]=intUtil['stripTrailingSlash'](_0x4b7b56[_0x3821('0x50')]);def[_0x3821('0x66')]=util[_0x3821('0x1e')]('%s/service/v4_1/rest.php',_0x4b7b56[_0x3821('0x4f')]);if(_0x14e97a&&_0x14e97a[_0x3821('0x70')]){logger['info']('['+_0x518493['lastevent'][_0x3821('0x71')]()+']',_0x3821('0x6a'));_0x518493['recordingURL']=util[_0x3821('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b7b56[_0x3821('0x50')],_0x518493['uniqueid'],md5(_0x518493[_0x3821('0x54')]));}else{_0x518493[_0x3821('0x52')]='';}return getConnection(_0x4b7b56)['then'](function(_0xbe65de){_0x4a8339=_0xbe65de;if(!_[_0x3821('0x23')](_0x425274)){return getUser(_0x4b7b56,_0x425274[_0x3821('0x28')],_0x4a8339);}else{return getUser(_0x4b7b56,null,_0x4a8339);}})['then'](function(_0x234eb5){_0xbe7ba5=_0x234eb5;logger[_0x3821('0xa')](_0x3821('0x55'),_0xbe7ba5['id']);return getEndUser(_0x4b7b56,_0x518493['calleridname'],_0x518493[_0x3821('0x57')],_0x4a8339);})[_0x3821('0x29')](function(_0x4ce937){_0x2c095f=_0x4ce937;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2c095f['id']);return getTicket(_0x4b7b56,_0xbe7ba5,_0x2c095f,_0x13579d,_0x518493,_0x13579d['Fields'],_0x4a8339,_0x3821('0x59'));})[_0x3821('0x29')](function(_0x387666){_0x3336ba=_0x387666;logger['info'](_0x3821('0x5a'));logger[_0x3821('0xa')](_0x3821('0x5b'),_0x3336ba['id']);return setRelationship(_0x4a8339,_0xbe7ba5,_0x3336ba,_0x3821('0x5c'));})['then'](function(){return setRelationship(_0x4a8339,_0x2c095f,_0x3336ba,_0x3821('0x6c'));})[_0x3821('0x29')](function(){return getServerInfo(_0x4a8339);})[_0x3821('0x64')](function(_0x359341){logger[_0x3821('0x6e')]('['+_0x518493['lastevent'][_0x3821('0x71')]()+']',JSON[_0x3821('0x1c')](_0x359341));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index cc06e99..071251e 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa00f=['Variable','name','keyValue','keyType','key','%s:\x20%s','variable','format','toLowerCase','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','type','string','push','variableName','toString','customVariable'];(function(_0x329bcd,_0x398856){var _0x4d8336=function(_0x5c7554){while(--_0x5c7554){_0x329bcd['push'](_0x329bcd['shift']());}};_0x4d8336(++_0x398856);}(_0xa00f,0x1e4));var _0xfa00=function(_0x599f4d,_0x408d7c){_0x599f4d=_0x599f4d-0x0;var _0x4abff8=_0xa00f[_0x599f4d];return _0x4abff8;};'use strict';var _=require(_0xfa00('0x0'));var util=require('util');exports[_0xfa00('0x1')]=function(_0x5a2459,_0x593a3f,_0x35560b){var _0x1e43e9=[];if(_0x5a2459[_0xfa00('0x2')]>0x0){var _0x48270e=_[_0xfa00('0x3')](_0x5a2459,['id']);for(var _0x2335d5=0x0;_0x2335d5<_0x48270e[_0xfa00('0x2')];_0x2335d5++){var _0x5a0f6f=_0x48270e[_0x2335d5];if(_0x5a0f6f[_0xfa00('0x4')]===_0xfa00('0x5')){_0x1e43e9[_0xfa00('0x6')](_0x5a0f6f['content']);}else if(_0x5a0f6f[_0xfa00('0x4')]==='variable'&&_0x5a0f6f[_0xfa00('0x7')]){_0x593a3f[_0x5a0f6f[_0xfa00('0x7')]]&&_0x1e43e9[_0xfa00('0x6')](_0x593a3f[_0x5a0f6f[_0xfa00('0x7')]][_0xfa00('0x8')]());}else if(_0x5a0f6f[_0xfa00('0x4')]===_0xfa00('0x9')&&_0x5a0f6f['Variable']&&_0x5a0f6f[_0xfa00('0xa')]['name']){_0x593a3f[_0x5a0f6f['Variable'][_0xfa00('0xb')]['toLowerCase']()]&&_0x1e43e9[_0xfa00('0x6')](_0x593a3f[_0x5a0f6f[_0xfa00('0xa')][_0xfa00('0xb')]['toLowerCase']()]['toString']());}else if(_0x5a0f6f[_0xfa00('0x4')]===_0xfa00('0xc')){if(_0x5a0f6f[_0xfa00('0xd')]==='string'&&_0x5a0f6f[_0xfa00('0xe')]){_0x1e43e9[_0xfa00('0x6')](util['format'](_0xfa00('0xf'),_0x5a0f6f[_0xfa00('0xe')],_0x5a0f6f['keyContent']));}else if(_0x5a0f6f[_0xfa00('0xd')]===_0xfa00('0x10')&&_0x5a0f6f['variableName']&&_0x5a0f6f[_0xfa00('0xe')]){_0x593a3f[_0x5a0f6f['variableName']]&&_0x1e43e9[_0xfa00('0x6')](util[_0xfa00('0x11')](_0xfa00('0xf'),_0x5a0f6f[_0xfa00('0xe')],_0x593a3f[_0x5a0f6f['variableName']]));}else if(_0x5a0f6f[_0xfa00('0xd')]==='customVariable'&&_0x5a0f6f[_0xfa00('0xa')]&&_0x5a0f6f[_0xfa00('0xa')]['name']&&_0x5a0f6f['key']){_0x593a3f[_0x5a0f6f[_0xfa00('0xa')][_0xfa00('0xb')][_0xfa00('0x12')]()]&&_0x1e43e9[_0xfa00('0x6')](util[_0xfa00('0x11')](_0xfa00('0xf'),_0x5a0f6f[_0xfa00('0xe')],_0x593a3f[_0x5a0f6f[_0xfa00('0xa')]['name'][_0xfa00('0x12')]()]));}}}}return _0x1e43e9[_0xfa00('0x13')](_0x35560b);};exports[_0xfa00('0x14')]=function(_0x4cfe2e){var _0x1b0d63=_0x4cfe2e[_0xfa00('0x15')](-0x1);if(_0x1b0d63==='/'){_0x4cfe2e=_0x4cfe2e['substring'](0x0,_0x4cfe2e[_0xfa00('0x16')](_0x1b0d63));}return _0x4cfe2e;};exports[_0xfa00('0x17')]=function(_0x32526c){if(!_[_0xfa00('0x18')](_0x32526c)&&_0x32526c!==''){var _0x27689f=/^(([^<>()\[\]\\.,;:\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 _0x27689f[_0xfa00('0x19')](String(_0x32526c)[_0xfa00('0x12')]());}else{return![];}}; \ No newline at end of file +var _0xbe5d=['content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','string','format','%s:\x20%s','key','keyContent','keyType','join','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','push'];(function(_0xc508a2,_0x11be80){var _0x40743f=function(_0x3c1aca){while(--_0x3c1aca){_0xc508a2['push'](_0xc508a2['shift']());}};_0x40743f(++_0x11be80);}(_0xbe5d,0x13f));var _0xdbe5=function(_0x535720,_0x228406){_0x535720=_0x535720-0x0;var _0x12129b=_0xbe5d[_0x535720];return _0x12129b;};'use strict';var _=require(_0xdbe5('0x0'));var util=require('util');exports[_0xdbe5('0x1')]=function(_0x4fd338,_0x37bdda,_0xf9dbbb){var _0x365132=[];if(_0x4fd338[_0xdbe5('0x2')]>0x0){var _0x4810cb=_[_0xdbe5('0x3')](_0x4fd338,['id']);for(var _0x4038ba=0x0;_0x4038ba<_0x4810cb[_0xdbe5('0x2')];_0x4038ba++){var _0x4549e1=_0x4810cb[_0x4038ba];if(_0x4549e1['type']==='string'){_0x365132[_0xdbe5('0x4')](_0x4549e1[_0xdbe5('0x5')]);}else if(_0x4549e1[_0xdbe5('0x6')]===_0xdbe5('0x7')&&_0x4549e1['variableName']){_0x37bdda[_0x4549e1[_0xdbe5('0x8')]]&&_0x365132[_0xdbe5('0x4')](_0x37bdda[_0x4549e1[_0xdbe5('0x8')]][_0xdbe5('0x9')]());}else if(_0x4549e1[_0xdbe5('0x6')]===_0xdbe5('0xa')&&_0x4549e1[_0xdbe5('0xb')]&&_0x4549e1['Variable'][_0xdbe5('0xc')]){_0x37bdda[_0x4549e1['Variable'][_0xdbe5('0xc')][_0xdbe5('0xd')]()]&&_0x365132['push'](_0x37bdda[_0x4549e1['Variable'][_0xdbe5('0xc')][_0xdbe5('0xd')]()][_0xdbe5('0x9')]());}else if(_0x4549e1[_0xdbe5('0x6')]===_0xdbe5('0xe')){if(_0x4549e1['keyType']===_0xdbe5('0xf')&&_0x4549e1['key']){_0x365132[_0xdbe5('0x4')](util[_0xdbe5('0x10')](_0xdbe5('0x11'),_0x4549e1[_0xdbe5('0x12')],_0x4549e1[_0xdbe5('0x13')]));}else if(_0x4549e1[_0xdbe5('0x14')]==='variable'&&_0x4549e1[_0xdbe5('0x8')]&&_0x4549e1[_0xdbe5('0x12')]){_0x37bdda[_0x4549e1[_0xdbe5('0x8')]]&&_0x365132[_0xdbe5('0x4')](util['format'](_0xdbe5('0x11'),_0x4549e1['key'],_0x37bdda[_0x4549e1['variableName']]));}else if(_0x4549e1[_0xdbe5('0x14')]==='customVariable'&&_0x4549e1[_0xdbe5('0xb')]&&_0x4549e1[_0xdbe5('0xb')][_0xdbe5('0xc')]&&_0x4549e1[_0xdbe5('0x12')]){_0x37bdda[_0x4549e1[_0xdbe5('0xb')][_0xdbe5('0xc')]['toLowerCase']()]&&_0x365132[_0xdbe5('0x4')](util[_0xdbe5('0x10')](_0xdbe5('0x11'),_0x4549e1[_0xdbe5('0x12')],_0x37bdda[_0x4549e1[_0xdbe5('0xb')]['name']['toLowerCase']()]));}}}}return _0x365132[_0xdbe5('0x15')](_0xf9dbbb);};exports['stripTrailingSlash']=function(_0x5360d0){var _0x2b2484=_0x5360d0['slice'](-0x1);if(_0x2b2484==='/'){_0x5360d0=_0x5360d0[_0xdbe5('0x16')](0x0,_0x5360d0[_0xdbe5('0x17')](_0x2b2484));}return _0x5360d0;};exports[_0xdbe5('0x18')]=function(_0x43932c){if(!_[_0xdbe5('0x19')](_0x43932c)&&_0x43932c!==''){var _0x46ac33=/^(([^<>()\[\]\\.,;:\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 _0x46ac33[_0xdbe5('0x1a')](String(_0x43932c)[_0xdbe5('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 4ae3291..21d4241 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x4e62ca,_0xe85442){var _0x16007a=function(_0x52329b){while(--_0x52329b){_0x4e62ca['push'](_0x4e62ca['shift']());}};_0x16007a(++_0xe85442);}(_0xe706,0xa3));var _0x6e70=function(_0x89ace6,_0x39064b){_0x89ace6=_0x89ace6-0x0;var _0x302694=_0xe706[_0x89ace6];return _0x302694;};'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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5a8b13,_0x5ed93c){var _0x3149f9=function(_0x7271a6){while(--_0x7271a6){_0x5a8b13['push'](_0x5a8b13['shift']());}};_0x3149f9(++_0x5ed93c);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index db90180..ac34257 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcb7=['agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','first','Enduser\x20found!','Caller\x20-\x20%s','password','username','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','application/json','format','%s/tickets.json','POST','merge','name','getString','Subjects','Descriptions','Fields','info','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find'];(function(_0x17060d,_0x3c8ffb){var _0x5e139e=function(_0x5b9fd4){while(--_0x5b9fd4){_0x17060d['push'](_0x17060d['shift']());}};_0x5e139e(++_0x3c8ffb);}(_0xfcb7,0xc0));var _0x7fcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fcb('0x0'));var rp=require(_0x7fcb('0x1'));var md5=require(_0x7fcb('0x2'));var util=require('util');var Redis=require(_0x7fcb('0x3'));var intUtil=require('./util');var config=require(_0x7fcb('0x4'));var logger=require(_0x7fcb('0x5'))(_0x7fcb('0x6'));config[_0x7fcb('0x7')]=_['defaults'](config[_0x7fcb('0x7')],{'host':_0x7fcb('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7fcb('0x7')]));function emit(_0x562184,_0x5c79f8,_0x28e606){io['to'](_0x562184)['emit'](_0x5c79f8,_0x28e606);}var headers={'Content-Type':_0x7fcb('0x9'),'Accept':_0x7fcb('0x9')};function getTicket(_0x5d3292,_0x2d3e05,_0xfdb1b5,_0x465aa7,_0x53ac92){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x7fcb('0xa')](_0x7fcb('0xb'),_0x5d3292['remoteUri']),'method':_0x7fcb('0xc'),'body':{'ticket':_[_0x7fcb('0xd')]({'requester_id':_0xfdb1b5['id'],'submitter_id':_0x2d3e05?_0x2d3e05['id']:undefined,'assignee_id':_0x2d3e05?_0x2d3e05['id']:undefined,'tags':getTags(_0x465aa7['Tags'],_0x7fcb('0xe')),'subject':intUtil[_0x7fcb('0xf')](_0x465aa7[_0x7fcb('0x10')],_0x53ac92,'\x20'),'description':intUtil[_0x7fcb('0xf')](_0x465aa7['Descriptions'],_0x53ac92,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7fcb('0xf')](_0x465aa7[_0x7fcb('0x11')],_0x53ac92,'\x0a')}},getCustomFields(_0x465aa7[_0x7fcb('0x12')],_0x53ac92))}})['then'](function(_0x196493){logger[_0x7fcb('0x13')](_0x7fcb('0x14'));return _0x196493[_0x7fcb('0x15')];});}function getUser(_0x537058,_0x33f9b5){if(intUtil[_0x7fcb('0x16')](_0x33f9b5)){logger[_0x7fcb('0x13')]('Getting\x20agent\x20with\x20email',_0x33f9b5);return request({'uri':util[_0x7fcb('0xa')](_0x7fcb('0x17'),_0x537058[_0x7fcb('0x18')]),'qs':{'query':util[_0x7fcb('0xa')](_0x7fcb('0x19'),_0x33f9b5)}})['then'](function(_0x3b1890){if(_0x3b1890['count']){logger[_0x7fcb('0x13')](_0x7fcb('0x1a'));return _[_0x7fcb('0x1b')](_0x3b1890['results'],{'email':_0x33f9b5,'role':_0x7fcb('0x1c')});}else{logger[_0x7fcb('0x13')](_0x7fcb('0x1d'));return request({'uri':util['format'](_0x7fcb('0x1e'),_0x537058['remoteUri'])})[_0x7fcb('0x1f')](function(_0x170f44){logger[_0x7fcb('0x13')](_0x7fcb('0x20'));return _0x170f44[_0x7fcb('0x21')];});}});}else{logger[_0x7fcb('0x13')](_0x7fcb('0x1d'));return request({'uri':util[_0x7fcb('0xa')](_0x7fcb('0x1e'),_0x537058[_0x7fcb('0x18')])})[_0x7fcb('0x1f')](function(_0x43b9f8){logger[_0x7fcb('0x13')](_0x7fcb('0x20'));return _0x43b9f8[_0x7fcb('0x21')];});}}function getEndUser(_0x338045,_0x376cbb,_0x2e9819){logger['info'](_0x7fcb('0x22'),_0x2e9819);return request({'uri':util[_0x7fcb('0xa')]('%s/search.json',_0x338045[_0x7fcb('0x18')]),'qs':{'query':util[_0x7fcb('0xa')](_0x7fcb('0x23'),_0x2e9819)}})[_0x7fcb('0x1f')](function(_0xa19165){var _0x2d07d6;if(_0xa19165[_0x7fcb('0x24')][_0x7fcb('0x25')]){_0xa19165[_0x7fcb('0x24')]=_['filter'](_0xa19165[_0x7fcb('0x24')],{'suspended':![],'role':_0x7fcb('0x26')});if(_0xa19165[_0x7fcb('0x24')][_0x7fcb('0x25')]){_0x2d07d6=_[_0x7fcb('0x27')](_0xa19165[_0x7fcb('0x24')]);}}if(_0x2d07d6){logger[_0x7fcb('0x13')](_0x7fcb('0x28'));return _0x2d07d6;}else{logger[_0x7fcb('0x13')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7fcb('0xa')]('%s/users.json',_0x338045[_0x7fcb('0x18')]),'method':_0x7fcb('0xc'),'body':{'user':{'role':_0x7fcb('0x26'),'name':util[_0x7fcb('0xa')](_0x7fcb('0x29'),_0x376cbb||_0x2e9819),'phone':_0x2e9819}}})[_0x7fcb('0x1f')](function(_0x1027d1){logger['info']('Enduser\x20created.');return _0x1027d1[_0x7fcb('0x21')];});}});}function getAuth(_0x431ca1){var _0x15558c;if(_0x431ca1['authType']===_0x7fcb('0x2a')){_0x15558c=util[_0x7fcb('0xa')]('%s:%s',_0x431ca1[_0x7fcb('0x2b')],_0x431ca1[_0x7fcb('0x2a')]);}else if(_0x431ca1['authType']===_0x7fcb('0x2c')){_0x15558c=util['format'](_0x7fcb('0x2d'),_0x431ca1[_0x7fcb('0x2b')],_0x431ca1[_0x7fcb('0x2c')]);}return util[_0x7fcb('0xa')]('Basic\x20%s',new Buffer(_0x15558c)[_0x7fcb('0x2e')](_0x7fcb('0x2f')));}function request(_0x4e95c3){logger[_0x7fcb('0x30')](_0x7fcb('0x31'),JSON[_0x7fcb('0x32')](_0x4e95c3));return rp(_[_0x7fcb('0x33')](_0x4e95c3,{'method':_0x7fcb('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x3dd82b,_0x32e8e5){var _0x304449=[];if(_0x3dd82b&&_0x3dd82b['length']>0x0){_0x304449=_[_0x7fcb('0x35')](_0x3dd82b,_0x32e8e5);}return _0x304449;}function getCustomFields(_0x59185b,_0x52ada){var _0x1a2527=[];var _0x3cd254={'custom_fields':[]};if(_0x59185b[_0x7fcb('0x25')]>0x0){_[_0x7fcb('0x36')](_0x59185b,function(_0x330f75){if(_[_0x7fcb('0x37')]([_0x7fcb('0x38'),_0x7fcb('0x39')],_0x330f75[_0x7fcb('0x3a')])&&_0x330f75[_0x7fcb('0x3b')]&&!_0x330f75[_0x7fcb('0x3c')]){_0x3cd254[_0x330f75[_0x7fcb('0x3b')]['toLowerCase']()]=_0x330f75[_0x7fcb('0x3d')][_0x7fcb('0x2e')]();}else if(_[_0x7fcb('0x37')]([_0x7fcb('0x38'),_0x7fcb('0x39')],_0x330f75['type'])&&_0x330f75[_0x7fcb('0x3e')]&&_0x330f75[_0x7fcb('0x3c')]){_0x3cd254[_0x7fcb('0x3f')]['push']({'id':_0x330f75[_0x7fcb('0x3e')],'value':_0x330f75[_0x7fcb('0x3d')][_0x7fcb('0x2e')]()});}else if(_0x330f75[_0x7fcb('0x3a')]===_0x7fcb('0x40')&&_0x330f75[_0x7fcb('0x41')]&&_0x330f75[_0x7fcb('0x3e')]&&_0x330f75['customField']){_0x52ada[_0x330f75[_0x7fcb('0x41')]]&&_0x3cd254[_0x7fcb('0x3f')][_0x7fcb('0x42')]({'id':_0x330f75['idField'],'value':_0x52ada[_0x330f75[_0x7fcb('0x41')]]['toString']()});}else if(_0x330f75[_0x7fcb('0x3a')]===_0x7fcb('0x43')&&_0x330f75[_0x7fcb('0x44')]&&_0x330f75[_0x7fcb('0x44')][_0x7fcb('0xe')]&&_0x330f75[_0x7fcb('0x3e')]&&_0x330f75[_0x7fcb('0x3c')]){_0x52ada[_0x330f75[_0x7fcb('0x44')][_0x7fcb('0xe')][_0x7fcb('0x45')]()]&&_0x3cd254['custom_fields'][_0x7fcb('0x42')]({'id':_0x330f75[_0x7fcb('0x3e')],'value':_0x52ada[_0x330f75[_0x7fcb('0x44')]['name'][_0x7fcb('0x45')]()]['toString']()});}});}return _0x3cd254;}exports[_0x7fcb('0x46')]=function(_0x4ac5b9,_0x59e872,_0x254ea6,_0x459053,_0x392b01,_0x21659e){var _0x378ea4,_0x55894a;_0x21659e[_0x7fcb('0x18')]=intUtil[_0x7fcb('0x47')](_0x21659e[_0x7fcb('0x18')]);_0x21659e[_0x7fcb('0x48')]=intUtil[_0x7fcb('0x47')](_0x21659e[_0x7fcb('0x48')]);if(_0x392b01&&_0x392b01['monitor_format']){logger[_0x7fcb('0x13')]('[QUEUE]',_0x7fcb('0x49'));_0x59e872[_0x7fcb('0x4a')]=util[_0x7fcb('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21659e[_0x7fcb('0x48')],_0x59e872['uniqueid'],md5(_0x59e872[_0x7fcb('0x4b')]));}else{_0x59e872[_0x7fcb('0x4a')]='';}headers[_0x7fcb('0x4c')]=getAuth(_0x21659e);return getUser(_0x21659e,_0x459053[_0x7fcb('0x4d')])[_0x7fcb('0x1f')](function(_0x152c9a){_0x378ea4=_0x152c9a;logger[_0x7fcb('0x13')](_0x7fcb('0x4e'),_0x378ea4['id']);return getEndUser(_0x21659e,_0x59e872[_0x7fcb('0x4f')],_0x59e872[_0x7fcb('0x50')]);})[_0x7fcb('0x1f')](function(_0xabcb24){_0x55894a=_0xabcb24;logger['info'](_0x7fcb('0x51'),_0x55894a['id']);return getTicket(_0x21659e,_0x378ea4,_0x55894a,_0x254ea6,_0x59e872);})[_0x7fcb('0x1f')](function(_0x48344f){if(_0x48344f){logger[_0x7fcb('0x13')](_0x7fcb('0x52'),_0x48344f['id']);switch(_0x21659e[_0x7fcb('0x3a')]){case _0x7fcb('0x53'):logger[_0x7fcb('0x13')](_0x7fcb('0x54'),_0x7fcb('0x55'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x21659e[_0x7fcb('0x18')],_0x378ea4['id'],_0x48344f['id']),'method':'POST'});case _0x7fcb('0x56'):logger[_0x7fcb('0x13')](_0x7fcb('0x54'),_0x7fcb('0x57'));emit(util[_0x7fcb('0xa')](_0x7fcb('0x58'),_0x459053[_0x7fcb('0xe')]),_0x7fcb('0x59'),{'uri':util[_0x7fcb('0xa')](_0x7fcb('0x5a'),_0x21659e['remoteUri'][_0x7fcb('0x5b')]('/api/v2',''),_0x48344f['id'])});break;default:logger['error'](_0x7fcb('0x54'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7fcb('0x5c')](function(_0x177fe6){logger[_0x7fcb('0x5d')](_0x7fcb('0x5e'),util[_0x7fcb('0x5f')](_0x177fe6,{'showHidden':!![],'depth':null}));});};exports[_0x7fcb('0x60')]=function(_0x13ba87,_0x2c8180,_0x45a33a,_0x27f25e,_0x288e35,_0x1831de,_0x4e31c9){var _0x158dc3,_0x5b7146;_0x1831de[_0x7fcb('0x18')]=intUtil['stripTrailingSlash'](_0x1831de[_0x7fcb('0x18')]);_0x1831de[_0x7fcb('0x48')]=intUtil['stripTrailingSlash'](_0x1831de[_0x7fcb('0x48')]);if(_0x4e31c9&&_0x4e31c9[_0x7fcb('0x61')]&&_0x4e31c9[_0x7fcb('0x61')]!==_0x7fcb('0x62')){logger[_0x7fcb('0x13')](_0x7fcb('0x63'),_0x7fcb('0x49'));_0x2c8180[_0x7fcb('0x4a')]=util[_0x7fcb('0xa')](_0x7fcb('0x64'),_0x1831de[_0x7fcb('0x48')],_0x2c8180[_0x7fcb('0x4b')],md5(_0x2c8180[_0x7fcb('0x4b')]));}headers[_0x7fcb('0x4c')]=getAuth(_0x1831de);return getUser(_0x1831de,_0x27f25e[_0x7fcb('0x4d')])['then'](function(_0x1f0188){_0x158dc3=_0x1f0188;logger[_0x7fcb('0x13')](_0x7fcb('0x4e'),_0x158dc3['id']);return getEndUser(_0x1831de,_0x2c8180['destcalleridname'],_0x2c8180[_0x7fcb('0x65')]);})[_0x7fcb('0x1f')](function(_0xb9415f){_0x5b7146=_0xb9415f;logger[_0x7fcb('0x13')](_0x7fcb('0x51'),_0x5b7146['id']);return getTicket(_0x1831de,_0x158dc3,_0x5b7146,_0x45a33a,_0x2c8180);})[_0x7fcb('0x1f')](function(_0x520f92){if(_0x520f92){logger[_0x7fcb('0x13')](_0x7fcb('0x52'),_0x520f92['id']);switch(_0x1831de[_0x7fcb('0x3a')]){case _0x7fcb('0x53'):logger[_0x7fcb('0x13')](_0x7fcb('0x63'),_0x7fcb('0x55'));return request({'uri':util[_0x7fcb('0xa')](_0x7fcb('0x66'),_0x1831de[_0x7fcb('0x18')],_0x158dc3['id'],_0x520f92['id']),'method':_0x7fcb('0xc')});case'newTab':logger[_0x7fcb('0x13')](_0x7fcb('0x63'),_0x7fcb('0x57'));emit(util[_0x7fcb('0xa')](_0x7fcb('0x58'),_0x27f25e[_0x7fcb('0xe')]),_0x7fcb('0x59'),{'uri':util[_0x7fcb('0xa')](_0x7fcb('0x5a'),_0x1831de['remoteUri'][_0x7fcb('0x5b')](_0x7fcb('0x67'),''),_0x520f92['id'])});break;default:logger[_0x7fcb('0x5d')](_0x7fcb('0x63'),_0x7fcb('0x68'));}}})[_0x7fcb('0x5c')](function(_0x10f919){logger[_0x7fcb('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x7fcb('0x5f')](_0x10f919,{'showHidden':!![],'depth':null}));});};exports[_0x7fcb('0x69')]=function(_0x9080cf,_0xeccb05,_0x17c555,_0x4dbd4b,_0x14764b,_0x18ccca){var _0x51db09,_0x4a6f25;_0x18ccca[_0x7fcb('0x18')]=intUtil[_0x7fcb('0x47')](_0x18ccca[_0x7fcb('0x18')]);_0x18ccca[_0x7fcb('0x48')]=intUtil[_0x7fcb('0x47')](_0x18ccca[_0x7fcb('0x48')]);if(_0x14764b&&_0x14764b[_0x7fcb('0x6a')]){logger['info']('['+_0xeccb05[_0x7fcb('0x6b')][_0x7fcb('0x6c')]()+']',_0x7fcb('0x49'));_0xeccb05[_0x7fcb('0x4a')]=util['format'](_0x7fcb('0x64'),_0x18ccca['serverUrl'],_0xeccb05[_0x7fcb('0x4b')],md5(_0xeccb05['uniqueid']));}else{_0xeccb05['recordingURL']='';}headers['Authorization']=getAuth(_0x18ccca);return getUser(_0x18ccca)[_0x7fcb('0x1f')](function(_0x26b18f){_0x51db09=_0x26b18f;logger[_0x7fcb('0x13')](_0x7fcb('0x4e'),_0x51db09['id']);return getEndUser(_0x18ccca,_0xeccb05['calleridname'],_0xeccb05['calleridnum']);})['then'](function(_0x5d34a1){_0x4a6f25=_0x5d34a1;logger[_0x7fcb('0x13')]('The\x20Enduser\x20ID\x20is:',_0x4a6f25['id']);return getTicket(_0x18ccca,_0x51db09,_0x4a6f25,_0x17c555,_0xeccb05);})[_0x7fcb('0x1f')](function(_0x7fdd2a){if(_0x7fdd2a){logger[_0x7fcb('0x13')](_0x7fcb('0x52'),_0x7fdd2a['id']);}})['catch'](function(_0x19cbec){logger[_0x7fcb('0x5d')]('['+_0xeccb05[_0x7fcb('0x6b')][_0x7fcb('0x6c')]()+']'+_0x7fcb('0x6d'),util[_0x7fcb('0x5f')](_0x19cbec,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe4d1=['user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[OUTBOUND]','replace','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','zendesk','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','GET','length','forEach','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','push','variable','variableName','Variable','name','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x4ac08e,_0x41f6d3){var _0x54f169=function(_0x23779a){while(--_0x23779a){_0x4ac08e['push'](_0x4ac08e['shift']());}};_0x54f169(++_0x41f6d3);}(_0xe4d1,0x86));var _0x1e4d=function(_0x5e0496,_0x160308){_0x5e0496=_0x5e0496-0x0;var _0x4fe243=_0xe4d1[_0x5e0496];return _0x4fe243;};'use strict';var _=require(_0x1e4d('0x0'));var rp=require('request-promise');var md5=require(_0x1e4d('0x1'));var util=require(_0x1e4d('0x2'));var Redis=require(_0x1e4d('0x3'));var intUtil=require(_0x1e4d('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1e4d('0x5'));config[_0x1e4d('0x6')]=_[_0x1e4d('0x7')](config[_0x1e4d('0x6')],{'host':_0x1e4d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3701e0,_0x168783,_0x109fc9){io['to'](_0x3701e0)[_0x1e4d('0x9')](_0x168783,_0x109fc9);}var headers={'Content-Type':_0x1e4d('0xa'),'Accept':_0x1e4d('0xa')};function getTicket(_0x318b60,_0x586128,_0x1fa0bf,_0x1d920e,_0x19554a){logger['info'](_0x1e4d('0xb'));return request({'uri':util[_0x1e4d('0xc')]('%s/tickets.json',_0x318b60[_0x1e4d('0xd')]),'method':_0x1e4d('0xe'),'body':{'ticket':_[_0x1e4d('0xf')]({'requester_id':_0x1fa0bf['id'],'submitter_id':_0x586128?_0x586128['id']:undefined,'assignee_id':_0x586128?_0x586128['id']:undefined,'tags':getTags(_0x1d920e[_0x1e4d('0x10')],'name'),'subject':intUtil[_0x1e4d('0x11')](_0x1d920e[_0x1e4d('0x12')],_0x19554a,'\x20'),'description':intUtil[_0x1e4d('0x11')](_0x1d920e['Descriptions'],_0x19554a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1e4d('0x11')](_0x1d920e[_0x1e4d('0x13')],_0x19554a,'\x0a')}},getCustomFields(_0x1d920e['Fields'],_0x19554a))}})[_0x1e4d('0x14')](function(_0xc245c7){logger[_0x1e4d('0x15')](_0x1e4d('0x16'));return _0xc245c7[_0x1e4d('0x17')];});}function getUser(_0x2b21dc,_0x1da568){if(intUtil[_0x1e4d('0x18')](_0x1da568)){logger[_0x1e4d('0x15')](_0x1e4d('0x19'),_0x1da568);return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x1a'),_0x2b21dc[_0x1e4d('0xd')]),'qs':{'query':util[_0x1e4d('0xc')](_0x1e4d('0x1b'),_0x1da568)}})['then'](function(_0x51c79e){if(_0x51c79e['count']){logger[_0x1e4d('0x15')](_0x1e4d('0x1c'));return _[_0x1e4d('0x1d')](_0x51c79e[_0x1e4d('0x1e')],{'email':_0x1da568,'role':_0x1e4d('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x1e4d('0x20'),_0x2b21dc[_0x1e4d('0xd')])})[_0x1e4d('0x14')](function(_0x2a2efe){logger['info'](_0x1e4d('0x21'));return _0x2a2efe[_0x1e4d('0x22')];});}});}else{logger['info'](_0x1e4d('0x23'));return request({'uri':util['format'](_0x1e4d('0x20'),_0x2b21dc[_0x1e4d('0xd')])})[_0x1e4d('0x14')](function(_0x557b54){logger['info'](_0x1e4d('0x21'));return _0x557b54['user'];});}}function getEndUser(_0xa417cb,_0x42e121,_0x4d44c8){logger['info'](_0x1e4d('0x24'),_0x4d44c8);return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x1a'),_0xa417cb[_0x1e4d('0xd')]),'qs':{'query':util['format'](_0x1e4d('0x25'),_0x4d44c8)}})[_0x1e4d('0x14')](function(_0x1e8413){var _0x57c0a5;if(_0x1e8413['results']['length']){_0x1e8413[_0x1e4d('0x1e')]=_[_0x1e4d('0x26')](_0x1e8413[_0x1e4d('0x1e')],{'suspended':![],'role':_0x1e4d('0x27')});if(_0x1e8413[_0x1e4d('0x1e')]['length']){_0x57c0a5=_['first'](_0x1e8413[_0x1e4d('0x1e')]);}}if(_0x57c0a5){logger[_0x1e4d('0x15')](_0x1e4d('0x28'));return _0x57c0a5;}else{logger[_0x1e4d('0x15')](_0x1e4d('0x29'));return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x2a'),_0xa417cb[_0x1e4d('0xd')]),'method':_0x1e4d('0xe'),'body':{'user':{'role':_0x1e4d('0x27'),'name':util[_0x1e4d('0xc')](_0x1e4d('0x2b'),_0x42e121||_0x4d44c8),'phone':_0x4d44c8}}})[_0x1e4d('0x14')](function(_0x1d590c){logger[_0x1e4d('0x15')](_0x1e4d('0x2c'));return _0x1d590c['user'];});}});}function getAuth(_0x2084c3){var _0x244f26;if(_0x2084c3[_0x1e4d('0x2d')]===_0x1e4d('0x2e')){_0x244f26=util[_0x1e4d('0xc')](_0x1e4d('0x2f'),_0x2084c3['username'],_0x2084c3[_0x1e4d('0x2e')]);}else if(_0x2084c3[_0x1e4d('0x2d')]===_0x1e4d('0x30')){_0x244f26=util[_0x1e4d('0xc')](_0x1e4d('0x31'),_0x2084c3[_0x1e4d('0x32')],_0x2084c3['token']);}return util[_0x1e4d('0xc')](_0x1e4d('0x33'),new Buffer(_0x244f26)[_0x1e4d('0x34')](_0x1e4d('0x35')));}function request(_0xbe0c23){logger[_0x1e4d('0x36')](_0x1e4d('0x37'),JSON['stringify'](_0xbe0c23));return rp(_[_0x1e4d('0x7')](_0xbe0c23,{'method':_0x1e4d('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x2c8d33,_0x39a16f){var _0xa666b2=[];if(_0x2c8d33&&_0x2c8d33[_0x1e4d('0x39')]>0x0){_0xa666b2=_['map'](_0x2c8d33,_0x39a16f);}return _0xa666b2;}function getCustomFields(_0x47c241,_0x28f89b){var _0x16c21d=[];var _0x2dd906={'custom_fields':[]};if(_0x47c241[_0x1e4d('0x39')]>0x0){_[_0x1e4d('0x3a')](_0x47c241,function(_0x27f60e){if(_[_0x1e4d('0x3b')]([_0x1e4d('0x3c'),_0x1e4d('0x3d')],_0x27f60e[_0x1e4d('0x3e')])&&_0x27f60e[_0x1e4d('0x3f')]&&!_0x27f60e[_0x1e4d('0x40')]){_0x2dd906[_0x27f60e[_0x1e4d('0x3f')]['toLowerCase']()]=_0x27f60e[_0x1e4d('0x41')]['toString']();}else if(_[_0x1e4d('0x3b')](['string',_0x1e4d('0x3d')],_0x27f60e[_0x1e4d('0x3e')])&&_0x27f60e[_0x1e4d('0x42')]&&_0x27f60e[_0x1e4d('0x40')]){_0x2dd906[_0x1e4d('0x43')][_0x1e4d('0x44')]({'id':_0x27f60e[_0x1e4d('0x42')],'value':_0x27f60e[_0x1e4d('0x41')]['toString']()});}else if(_0x27f60e[_0x1e4d('0x3e')]===_0x1e4d('0x45')&&_0x27f60e['variableName']&&_0x27f60e['idField']&&_0x27f60e[_0x1e4d('0x40')]){_0x28f89b[_0x27f60e[_0x1e4d('0x46')]]&&_0x2dd906['custom_fields']['push']({'id':_0x27f60e['idField'],'value':_0x28f89b[_0x27f60e['variableName']][_0x1e4d('0x34')]()});}else if(_0x27f60e[_0x1e4d('0x3e')]==='customVariable'&&_0x27f60e[_0x1e4d('0x47')]&&_0x27f60e[_0x1e4d('0x47')][_0x1e4d('0x48')]&&_0x27f60e['idField']&&_0x27f60e['customField']){_0x28f89b[_0x27f60e[_0x1e4d('0x47')][_0x1e4d('0x48')][_0x1e4d('0x49')]()]&&_0x2dd906[_0x1e4d('0x43')][_0x1e4d('0x44')]({'id':_0x27f60e[_0x1e4d('0x42')],'value':_0x28f89b[_0x27f60e[_0x1e4d('0x47')][_0x1e4d('0x48')][_0x1e4d('0x49')]()][_0x1e4d('0x34')]()});}});}return _0x2dd906;}exports['queue']=function(_0x4fc719,_0xe90cb8,_0x274149,_0x4d8438,_0x94c65f,_0x4e6e7a){var _0x20a783,_0x2f6d28;_0x4e6e7a[_0x1e4d('0xd')]=intUtil[_0x1e4d('0x4a')](_0x4e6e7a[_0x1e4d('0xd')]);_0x4e6e7a[_0x1e4d('0x4b')]=intUtil['stripTrailingSlash'](_0x4e6e7a[_0x1e4d('0x4b')]);if(_0x94c65f&&_0x94c65f[_0x1e4d('0x4c')]){logger[_0x1e4d('0x15')](_0x1e4d('0x4d'),_0x1e4d('0x4e'));_0xe90cb8[_0x1e4d('0x4f')]=util[_0x1e4d('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e6e7a[_0x1e4d('0x4b')],_0xe90cb8[_0x1e4d('0x50')],md5(_0xe90cb8[_0x1e4d('0x50')]));}else{_0xe90cb8[_0x1e4d('0x4f')]='';}headers[_0x1e4d('0x51')]=getAuth(_0x4e6e7a);return getUser(_0x4e6e7a,_0x4d8438[_0x1e4d('0x52')])[_0x1e4d('0x14')](function(_0x294d24){_0x20a783=_0x294d24;logger[_0x1e4d('0x15')]('The\x20User\x20ID\x20is:',_0x20a783['id']);return getEndUser(_0x4e6e7a,_0xe90cb8[_0x1e4d('0x53')],_0xe90cb8[_0x1e4d('0x54')]);})['then'](function(_0x40e8d9){_0x2f6d28=_0x40e8d9;logger[_0x1e4d('0x15')](_0x1e4d('0x55'),_0x2f6d28['id']);return getTicket(_0x4e6e7a,_0x20a783,_0x2f6d28,_0x274149,_0xe90cb8);})['then'](function(_0xf16f42){if(_0xf16f42){logger['info'](_0x1e4d('0x56'),_0xf16f42['id']);switch(_0x4e6e7a[_0x1e4d('0x3e')]){case _0x1e4d('0x57'):logger[_0x1e4d('0x15')](_0x1e4d('0x4d'),_0x1e4d('0x58'));return request({'uri':util[_0x1e4d('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e6e7a[_0x1e4d('0xd')],_0x20a783['id'],_0xf16f42['id']),'method':_0x1e4d('0xe')});case'newTab':logger[_0x1e4d('0x15')]('[QUEUE]',_0x1e4d('0x59'));emit(util[_0x1e4d('0xc')](_0x1e4d('0x5a'),_0x4d8438['name']),_0x1e4d('0x5b'),{'uri':util[_0x1e4d('0xc')](_0x1e4d('0x5c'),_0x4e6e7a[_0x1e4d('0xd')]['replace'](_0x1e4d('0x5d'),''),_0xf16f42['id'])});break;default:logger[_0x1e4d('0x5e')](_0x1e4d('0x4d'),_0x1e4d('0x5f'));}}})[_0x1e4d('0x60')](function(_0x50d497){logger[_0x1e4d('0x5e')](_0x1e4d('0x61'),util[_0x1e4d('0x62')](_0x50d497,{'showHidden':!![],'depth':null}));});};exports[_0x1e4d('0x63')]=function(_0x12f6c1,_0x3752c5,_0x2b8db6,_0x229b7b,_0x5aafac,_0x33d819,_0x195a9b){var _0x5b1b88,_0x2655c5;_0x33d819[_0x1e4d('0xd')]=intUtil[_0x1e4d('0x4a')](_0x33d819[_0x1e4d('0xd')]);_0x33d819[_0x1e4d('0x4b')]=intUtil[_0x1e4d('0x4a')](_0x33d819[_0x1e4d('0x4b')]);if(_0x195a9b&&_0x195a9b[_0x1e4d('0x64')]&&_0x195a9b['recordingFormat']!==_0x1e4d('0x65')){logger[_0x1e4d('0x15')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3752c5[_0x1e4d('0x4f')]=util[_0x1e4d('0xc')](_0x1e4d('0x66'),_0x33d819['serverUrl'],_0x3752c5[_0x1e4d('0x50')],md5(_0x3752c5[_0x1e4d('0x50')]));}headers['Authorization']=getAuth(_0x33d819);return getUser(_0x33d819,_0x229b7b['email'])[_0x1e4d('0x14')](function(_0x231af4){_0x5b1b88=_0x231af4;logger['info'](_0x1e4d('0x67'),_0x5b1b88['id']);return getEndUser(_0x33d819,_0x3752c5[_0x1e4d('0x68')],_0x3752c5['destcalleridnum']);})[_0x1e4d('0x14')](function(_0x4142f4){_0x2655c5=_0x4142f4;logger[_0x1e4d('0x15')](_0x1e4d('0x55'),_0x2655c5['id']);return getTicket(_0x33d819,_0x5b1b88,_0x2655c5,_0x2b8db6,_0x3752c5);})[_0x1e4d('0x14')](function(_0x539a96){if(_0x539a96){logger[_0x1e4d('0x15')](_0x1e4d('0x56'),_0x539a96['id']);switch(_0x33d819[_0x1e4d('0x3e')]){case _0x1e4d('0x57'):logger[_0x1e4d('0x15')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x69'),_0x33d819[_0x1e4d('0xd')],_0x5b1b88['id'],_0x539a96['id']),'method':_0x1e4d('0xe')});case _0x1e4d('0x6a'):logger['info'](_0x1e4d('0x6b'),_0x1e4d('0x59'));emit(util[_0x1e4d('0xc')](_0x1e4d('0x5a'),_0x229b7b['name']),_0x1e4d('0x5b'),{'uri':util[_0x1e4d('0xc')]('%s/agent/tickets/%s',_0x33d819[_0x1e4d('0xd')][_0x1e4d('0x6c')](_0x1e4d('0x5d'),''),_0x539a96['id'])});break;default:logger[_0x1e4d('0x5e')]('[OUTBOUND]',_0x1e4d('0x5f'));}}})[_0x1e4d('0x60')](function(_0x4ca3cd){logger[_0x1e4d('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x1e4d('0x62')](_0x4ca3cd,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2a5c3b,_0x5470cd,_0x4b8362,_0x58c6c8,_0x4256e1,_0xfed559){var _0x5b272a,_0x2aeeec;_0xfed559[_0x1e4d('0xd')]=intUtil[_0x1e4d('0x4a')](_0xfed559[_0x1e4d('0xd')]);_0xfed559[_0x1e4d('0x4b')]=intUtil[_0x1e4d('0x4a')](_0xfed559[_0x1e4d('0x4b')]);if(_0x4256e1&&_0x4256e1[_0x1e4d('0x4c')]){logger[_0x1e4d('0x15')]('['+_0x5470cd[_0x1e4d('0x6d')][_0x1e4d('0x6e')]()+']',_0x1e4d('0x4e'));_0x5470cd[_0x1e4d('0x4f')]=util['format'](_0x1e4d('0x66'),_0xfed559[_0x1e4d('0x4b')],_0x5470cd['uniqueid'],md5(_0x5470cd[_0x1e4d('0x50')]));}else{_0x5470cd[_0x1e4d('0x4f')]='';}headers['Authorization']=getAuth(_0xfed559);return getUser(_0xfed559)['then'](function(_0x5f14ac){_0x5b272a=_0x5f14ac;logger[_0x1e4d('0x15')](_0x1e4d('0x67'),_0x5b272a['id']);return getEndUser(_0xfed559,_0x5470cd['calleridname'],_0x5470cd[_0x1e4d('0x54')]);})[_0x1e4d('0x14')](function(_0x3a9584){_0x2aeeec=_0x3a9584;logger[_0x1e4d('0x15')](_0x1e4d('0x55'),_0x2aeeec['id']);return getTicket(_0xfed559,_0x5b272a,_0x2aeeec,_0x4b8362,_0x5470cd);})[_0x1e4d('0x14')](function(_0x3ac20f){if(_0x3ac20f){logger[_0x1e4d('0x15')](_0x1e4d('0x56'),_0x3ac20f['id']);}})[_0x1e4d('0x60')](function(_0x40d53a){logger[_0x1e4d('0x5e')]('['+_0x5470cd[_0x1e4d('0x6d')][_0x1e4d('0x6e')]()+']'+_0x1e4d('0x6f'),util[_0x1e4d('0x62')](_0x40d53a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 390e2b1..fd928b4 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9809=['zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','monitor_format','lastevent','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','https://accounts.zoho.com','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','contact','nothing','Creating\x20new\x20call...','Owner','administrator','Subjects','Description','getString','Descriptions','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','rejected','Rejected','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','stripTrailingSlash','host','serverUrl','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token='];(function(_0x1081e1,_0x3682a8){var _0x30d627=function(_0x2c2bd8){while(--_0x2c2bd8){_0x1081e1['push'](_0x1081e1['shift']());}};_0x30d627(++_0x3682a8);}(_0x9809,0x1da));var _0x9980=function(_0x1395be,_0x4f9480){_0x1395be=_0x1395be-0x0;var _0x286520=_0x9809[_0x1395be];return _0x286520;};'use strict';var _=require(_0x9980('0x0'));var rp=require(_0x9980('0x1'));var md5=require(_0x9980('0x2'));var util=require(_0x9980('0x3'));var intUtil=require(_0x9980('0x4'));var moment=require(_0x9980('0x5'));var Redis=require(_0x9980('0x6'));var BPromise=require(_0x9980('0x7'));var config=require(_0x9980('0x8'));var logger=require(_0x9980('0x9'))(_0x9980('0xa'));config['redis']=_[_0x9980('0xb')](config[_0x9980('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x9980('0xd'))(new Redis(config['redis']));function emit(_0x283d1f,_0x333a73,_0x4d545d){io['to'](_0x283d1f)[_0x9980('0xe')](_0x333a73,_0x4d545d);}function request(_0x2553c0){logger[_0x9980('0xf')](_0x9980('0x10'),JSON[_0x9980('0x11')](_0x2553c0));return rp(_0x2553c0);}function getCustomFields(_0x3b118c,_0x119f9c){var _0x17183e={};if(_0x3b118c[_0x9980('0x12')]>0x0){_[_0x9980('0x13')](_0x3b118c,function(_0x163fe3){if(_['includes']([_0x9980('0x14'),_0x9980('0x15')],_0x163fe3[_0x9980('0x16')])&&_0x163fe3['idField']){_0x17183e[_0x163fe3[_0x9980('0x17')]]=_0x163fe3[_0x9980('0x18')][_0x9980('0x19')]();}else if(_0x163fe3[_0x9980('0x16')]===_0x9980('0x1a')&&_0x163fe3[_0x9980('0x1b')]&&_0x163fe3['idField']&&_0x119f9c[_0x163fe3['variableName']]){_0x17183e[_0x163fe3[_0x9980('0x17')]]=_0x119f9c[_0x163fe3[_0x9980('0x1b')]][_0x9980('0x19')]();}else if(_0x163fe3[_0x9980('0x16')]===_0x9980('0x1c')&&_0x163fe3['Variable']&&_0x163fe3[_0x9980('0x1d')]['name']&&_0x163fe3[_0x9980('0x17')]&&_0x119f9c[_0x163fe3[_0x9980('0x1d')][_0x9980('0x1e')][_0x9980('0x1f')]()]){_0x17183e[_0x163fe3[_0x9980('0x17')]]=_0x119f9c[_0x163fe3[_0x9980('0x1d')][_0x9980('0x1e')]['toLowerCase']()]['toString']();}});}return _0x17183e;}function getName(_0x32a7c3){if(_0x32a7c3[_0x9980('0x20')]('\x20')>0x0){var _0x59b7a1=_0x32a7c3[_0x9980('0x21')](/ (.+)/);if(_0x59b7a1[0x1]){return _0x59b7a1;}}return[_0x32a7c3,_0x32a7c3];}var accountsTokens={};function getAccessToken(_0x2ef81b){return new Promise(function(_0x34d68c,_0x2a39cc){if(!_['isNil'](accountsTokens[_0x2ef81b['id']])&&!_[_0x9980('0x22')](accountsTokens[_0x2ef81b['id']][_0x9980('0x23')])){if(moment()['isBefore'](accountsTokens[_0x2ef81b['id']]['expires_in'])){_0x34d68c(accountsTokens[_0x2ef81b['id']]['access_token']);}}var _0x4c499f;switch(_0x2ef81b['zone']){case'US':_0x4c499f=_0x9980('0x24');break;case'AU':_0x4c499f='https://accounts.zoho.com.au';break;case'EU':_0x4c499f='https://accounts.zoho.eu';break;case'IN':_0x4c499f='https://accounts.zoho.in';break;case'CN':_0x4c499f='https://accounts.zoho.com.cn';break;default:_0x4c499f=_0x9980('0x25');break;}var _0xab31f8={'method':_0x9980('0x26'),'uri':_0x4c499f+'/oauth/v2/token','qs':{'refresh_token':_0x2ef81b[_0x9980('0x27')],'client_id':_0x2ef81b[_0x9980('0x28')],'client_secret':_0x2ef81b[_0x9980('0x29')],'grant_type':_0x9980('0x2a')},'json':!![]};return rp(_0xab31f8)[_0x9980('0x2b')](function(_0x432d9d){accountsTokens[_0x2ef81b['id']]={'access_token':_0x432d9d[_0x9980('0x23')],'expires_in':moment()[_0x9980('0x2c')](_0x432d9d[_0x9980('0x2d')],_0x9980('0x2e'))};_0x34d68c(_0x432d9d[_0x9980('0x23')]);})[_0x9980('0x2f')](function(_0x1a4534){logger[_0x9980('0x30')](_0x9980('0x31'),_0x1a4534[_0x9980('0x32')]);_0x2a39cc(_0x1a4534);});});}function getUser(_0x24ef6e,_0x56457a,_0x520e13,_0x1bc53c){logger[_0x9980('0x33')](_0x9980('0x34'));return request({'method':_0x9980('0x35'),'uri':util[_0x9980('0x36')]('https://www.zohoapis.%s/crm/v2/users',_0x56457a),'qs':{'type':_0x9980('0x37')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x24ef6e},'json':!![]})[_0x9980('0x2b')](function(_0x21ed7b){if(_0x21ed7b['users']){var _0x404a46=-0x1;if(_[_0x9980('0x38')](_0x21ed7b[_0x9980('0x39')])){if(!_[_0x9980('0x22')](_0x1bc53c)){_0x404a46=_[_0x9980('0x3a')](_0x21ed7b[_0x9980('0x39')],function(_0x231cb0){return _0x231cb0[_0x9980('0x3b')]===_0x1bc53c;});}if(_0x404a46>=0x0){logger[_0x9980('0x33')](_0x9980('0x3c'));}else{logger[_0x9980('0x33')](_0x9980('0x3d'));_0x404a46=_['findIndex'](_0x21ed7b['users'],function(_0x218f6d){return _0x218f6d[_0x9980('0x3e')][_0x9980('0x1e')]===_0x9980('0x3f');});}return _0x21ed7b[_0x9980('0x39')][_0x404a46];}else{if(_0x21ed7b['user'][_0x9980('0x3e')][_0x9980('0x1e')]===_0x9980('0x3f')){logger[_0x9980('0x33')](_0x9980('0x3d'));user=_0x21ed7b['user'];return user;}else{logger['error'](_0x9980('0x40'),JSON['stringify'](_0x21ed7b));throw new Error(_0x9980('0x41')+JSON[_0x9980('0x11')](_0x21ed7b));}}}else{logger[_0x9980('0x30')](_0x9980('0x40'),JSON[_0x9980('0x11')](_0x21ed7b));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x9980('0x11')](_0x21ed7b));}})[_0x9980('0x2f')](function(_0x6bb4ed){console[_0x9980('0x30')](_0x6bb4ed);});}function getZohoUser(_0x3d39be,_0x1bbb23){return new BPromise(function(_0x301c4c,_0x14fa5d){request(_0x3d39be)[_0x9980('0x2b')](function(_0x327f70){var _0x9f3094=null;if(_0x327f70){_0x9f3094=_0x327f70[_0x9980('0x42')][0x0];_0x9f3094[_0x9980('0x43')]=_0x1bbb23;}_0x301c4c(_0x9f3094);})[_0x9980('0x2f')](function(_0x327d84){_0x14fa5d(_0x327d84);});});}function createEndUser(_0x5ec069,_0x33718c,_0x4c8ce5,_0x381455,_0x1778fc,_0x15e4d4){var _0x4c8ce5=getName(_0x4c8ce5);return request({'method':_0x9980('0x26'),'uri':_0x9980('0x44')+_0x33718c+_0x9980('0x45')+_[_0x9980('0x46')](_0x15e4d4['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4c8ce5[0x1],'First_Name':_0x4c8ce5[0x0],'Phone':_0x381455,'Owner':{'name':!_[_0x9980('0x22')](_0x1778fc[_0x9980('0x47')][_0x9980('0x1e')])?_0x1778fc[_0x9980('0x47')][_0x9980('0x1e')]:!_[_0x9980('0x22')](_0x1778fc[_0x9980('0x48')])?_0x1778fc[_0x9980('0x48')]+'\x20'+_0x1778fc[_0x9980('0x49')]:_0x1778fc[_0x9980('0x49')],'id':_0x1778fc['id']}}]},'headers':{'Authorization':_0x9980('0x4a')+_0x5ec069},'json':!![]})[_0x9980('0x2b')](function(_0xb63a96){if(_0xb63a96&&_0xb63a96[_0x9980('0x42')][0x0][_0x9980('0x4b')]===_0x9980('0x4c')){var _0x3fe0bd=_0xb63a96[_0x9980('0x42')][0x0][_0x9980('0x4d')];_0x3fe0bd[_0x9980('0x43')]=_[_0x9980('0x46')](_0x15e4d4[_0x9980('0x4e')])+'s';return _0x3fe0bd;}logger[_0x9980('0x30')](_0x9980('0x40'),JSON[_0x9980('0x11')](data));throw new Error(_0x9980('0x4f')+JSON['stringify'](data));})[_0x9980('0x2f')](function(_0x2b9e2a){console[_0x9980('0x50')](_0x9980('0x51'),_0x2b9e2a);});}function getEndUser(_0x1435b2,_0x3ac87b,_0x1cd5fc,_0x40ee1a,_0x548ea2,_0x419688,_0x1a137a){var _0x1c16b5={'method':_0x9980('0x35'),'uri':'','headers':{'Authorization':_0x9980('0x4a')+_0x1435b2},'json':!![]};switch(_0x1a137a[_0x9980('0x52')]){case _0x9980('0x53'):_0x1c16b5[_0x9980('0x54')]=_0x9980('0x44')+_0x3ac87b+_0x9980('0x55')+_0x548ea2+'))';return getZohoUser(_0x1c16b5,_0x9980('0x56'))[_0x9980('0x2b')](function(_0xc07394){if(_0xc07394)return _0xc07394;_0x1c16b5[_0x9980('0x54')]=_0x9980('0x44')+_0x3ac87b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x548ea2+'))';return getZohoUser(_0x1c16b5,_0x9980('0x57'))[_0x9980('0x2b')](function(_0x5868e1){if(_0x5868e1)return _0x5868e1;if(_0x1a137a[_0x9980('0x4e')]!='nothing'){return createEndUser(_0x1435b2,_0x3ac87b,_0x40ee1a,_0x548ea2,_0x419688,_0x1a137a);}else{return{};}});});break;case _0x9980('0x58'):_0x1c16b5[_0x9980('0x54')]='https://www.zohoapis.'+_0x3ac87b+_0x9980('0x55')+_0x548ea2+'))';return getZohoUser(_0x1c16b5,_0x9980('0x56'))['then'](function(_0x3de44b){if(_0x3de44b)return _0x3de44b;if(_0x1a137a[_0x9980('0x4e')]!=_0x9980('0x59')){return createEndUser(_0x1435b2,_0x3ac87b,_0x40ee1a,_0x548ea2,_0x419688,_0x1a137a);}else{return{};}});break;case'lead':_0x1c16b5[_0x9980('0x54')]=_0x9980('0x44')+_0x3ac87b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x548ea2+'))';return getZohoUser(_0x1c16b5,_0x9980('0x57'))[_0x9980('0x2b')](function(_0x51d5f3){if(_0x51d5f3)return _0x51d5f3;if(_0x1a137a[_0x9980('0x4e')]!=_0x9980('0x59')){return createEndUser(_0x1435b2,_0x3ac87b,_0x40ee1a,_0x548ea2,_0x419688,_0x1a137a);}else{return{};}});break;}}function getCall(_0x1a4cb0,_0x5a2319,_0x1d9aa5,_0x158390,_0x69cca9,_0x2afc31,_0x44d08d,_0x3eeb5c){logger[_0x9980('0x33')](_0x9980('0x5a'));var _0x8b0c27={};_0x8b0c27[_0x9980('0x5b')]={'name':!_['isNil'](_0x158390['role'][_0x9980('0x1e')])&&!_[_0x9980('0x22')](_0x158390[_0x9980('0x3e')][_0x9980('0x1e')])&&_0x158390[_0x9980('0x3e')]['name']===_0x9980('0x5c')?_0x158390[_0x9980('0x47')]['name']:!_[_0x9980('0x22')](_0x158390['first_name'])?_0x158390[_0x9980('0x48')]+'\x20'+_0x158390[_0x9980('0x49')]:_0x158390[_0x9980('0x49')],'id':_0x158390['id']};_0x8b0c27['Subject']=intUtil['getString'](_0x2afc31[_0x9980('0x5d')],_0x44d08d,'\x20');_0x8b0c27[_0x9980('0x5e')]=intUtil[_0x9980('0x5f')](_0x2afc31[_0x9980('0x60')],_0x44d08d,'\x0a');if(_0x69cca9[_0x9980('0x43')]===_0x9980('0x56')){_0x8b0c27['Who_Id']={'name':!_[_0x9980('0x22')](_0x69cca9[_0x9980('0x61')])?_0x69cca9['Full_Name']:!_[_0x9980('0x22')](_0x69cca9[_0x9980('0x62')])?_0x69cca9['First_Name']+'\x20'+_0x69cca9['Last_Name']:_0x69cca9['Last_Name'],'id':_0x69cca9['id']};}if(_0x69cca9[_0x9980('0x43')]===_0x9980('0x57')){_0x8b0c27[_0x9980('0x63')]={'name':!_[_0x9980('0x22')](_0x69cca9[_0x9980('0x61')])?_0x69cca9[_0x9980('0x61')]:!_[_0x9980('0x22')](_0x69cca9[_0x9980('0x62')])?_0x69cca9[_0x9980('0x62')]+'\x20'+_0x69cca9[_0x9980('0x64')]:_0x69cca9[_0x9980('0x64')],'id':_0x69cca9['id']};_0x8b0c27[_0x9980('0x65')]=_['startCase'](_0x69cca9[_0x9980('0x43')]);}if(_0x44d08d[_0x9980('0x66')]){_0x8b0c27[_0x9980('0x67')]=moment[_0x9980('0x68')](parseInt(_0x44d08d[_0x9980('0x66')])*0x3e8)[_0x9980('0x36')](_0x9980('0x69'));}else if(_0x44d08d[_0x9980('0x6a')]&&_0x44d08d[_0x9980('0x6b')]){_0x8b0c27['Call_Duration']=moment['utc'](moment(_0x44d08d[_0x9980('0x6b')],_0x9980('0x6c'))[_0x9980('0x6d')](moment(_0x44d08d[_0x9980('0x6e')],_0x9980('0x6c'))))[_0x9980('0x36')](_0x9980('0x69'));}switch(_0x44d08d['lastevent']){case _0x9980('0x6f'):_0x8b0c27[_0x9980('0x70')]=_0x9980('0x71');break;case'complete':case'connect':_0x8b0c27['Call_Result']='Answered';break;case _0x9980('0x72'):_0x8b0c27['Call_Result']=_0x9980('0x73');break;case'abandoned':_0x8b0c27[_0x9980('0x70')]='Abandoned';break;case _0x9980('0x74'):_0x8b0c27[_0x9980('0x70')]=_0x9980('0x75');default:}_0x8b0c27[_0x9980('0x76')]=(_0x3eeb5c==='outbound'?moment(_0x44d08d[_0x9980('0x6e')])[_0x9980('0x36')](_0x9980('0x6c')):moment(_0x44d08d[_0x9980('0x77')])['format'](_0x9980('0x6c')))||moment()['format'](_0x9980('0x6c'));_0x8b0c27[_0x9980('0x78')]=_0x3eeb5c||_0x9980('0x79');_0x8b0c27=_[_0x9980('0x7a')](_0x8b0c27,getCustomFields(_0x2afc31['Fields'],_0x44d08d));return request({'method':_0x9980('0x26'),'uri':_0x9980('0x44')+_0x5a2319+_0x9980('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1a4cb0},'body':{'data':[_0x8b0c27]},'json':!![]})['then'](function(_0x200daf){if(_0x200daf&&_0x200daf[_0x9980('0x42')][0x0][_0x9980('0x4b')]===_0x9980('0x4c')){logger[_0x9980('0x33')](_0x9980('0x7c'));return{'id':_0x200daf[_0x9980('0x42')][0x0][_0x9980('0x4d')]['id']};}})[_0x9980('0x2f')](function(_0x28ad45){logger[_0x9980('0x33')](_0x9980('0x7d'),_0x28ad45['stack']);console[_0x9980('0x50')]('err',_0x28ad45);});}exports['queue']=function(_0x796740,_0x408bd5,_0x5e70b2,_0xf29ff5,_0x20ac08,_0x4b0ce5){var _0x1d3249,_0x912fa1,_0x3db467;_0x4b0ce5['host']=intUtil[_0x9980('0x7e')](_0x4b0ce5[_0x9980('0x7f')]);_0x4b0ce5[_0x9980('0x80')]=intUtil[_0x9980('0x7e')](_0x4b0ce5[_0x9980('0x80')]);if(_0x20ac08&&_0x20ac08['monitor_format']){logger[_0x9980('0x33')](_0x9980('0x81'),'Recording\x20is\x20enabled!');_0x408bd5[_0x9980('0x82')]=_0x4b0ce5[_0x9980('0x80')]+_0x9980('0x83')+_0x408bd5[_0x9980('0x84')]+_0x9980('0x85')+md5(_0x408bd5[_0x9980('0x84')]);}else{_0x408bd5['recordingURL']='';}var _0x325c20=_0x4b0ce5[_0x9980('0x7f')]===_0x9980('0x86')?'eu':_0x9980('0x87');return getAccessToken(_0x4b0ce5)[_0x9980('0x2b')](function(_0x5916a9){_0x3db467=_0x5916a9;return getUser(_0x3db467,_0x325c20,_0x4b0ce5,_0xf29ff5[_0x9980('0x3b')]);})[_0x9980('0x2b')](function(_0x350eb0){_0x1d3249=_0x350eb0;logger['info'](_0x9980('0x88'),_0x1d3249['id']);return getEndUser(_0x3db467,_0x325c20,_0x4b0ce5,_0x408bd5[_0x9980('0x89')],_0x408bd5[_0x9980('0x8a')],_0x1d3249,_0x5e70b2);})[_0x9980('0x2b')](function(_0x5b041c){_0x912fa1=_0x5b041c;return getCall(_0x3db467,_0x325c20,_0x4b0ce5,_0x1d3249,_0x912fa1,_0x5e70b2,_0x408bd5,_0x9980('0x79'));})[_0x9980('0x2b')](function(_0x24157e){if(_0x24157e){logger[_0x9980('0x33')](_0x9980('0x8b'),_0x24157e['id']);logger[_0x9980('0x33')](_0x9980('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9980('0x36')]('user:%s',_0xf29ff5[_0x9980('0x1e')]),'trigger:browser:url',{'uri':_0x9980('0x8c')+_0x4b0ce5['host']+_0x9980('0x8d')+_0x24157e['id']});}})[_0x9980('0x2f')](function(_0x4223c1){logger[_0x9980('0x30')](_0x9980('0x81'),JSON[_0x9980('0x11')](_0x4223c1));});};exports[_0x9980('0x8e')]=function(_0xe82816,_0x3b0a4c,_0x34476a,_0x2c104c,_0x281a51,_0x2b9f1c,_0x334e10){var _0x1b2f79,_0x246ae7,_0x563d37;_0x2b9f1c[_0x9980('0x7f')]=intUtil['stripTrailingSlash'](_0x2b9f1c[_0x9980('0x7f')]);_0x2b9f1c[_0x9980('0x80')]=intUtil['stripTrailingSlash'](_0x2b9f1c[_0x9980('0x80')]);if(_0x334e10&&_0x334e10['recordingFormat']&&_0x334e10['recordingFormat']!==_0x9980('0x8f')){logger['info'](_0x9980('0x90'),_0x9980('0x91'));_0x3b0a4c[_0x9980('0x82')]=_0x2b9f1c[_0x9980('0x80')]+'/api/voice/recordings/'+_0x3b0a4c['uniqueid']+_0x9980('0x85')+md5(_0x3b0a4c['uniqueid']);}var _0x37cae5=_0x2b9f1c[_0x9980('0x7f')]===_0x9980('0x86')?'eu':_0x9980('0x87');return getAccessToken(_0x2b9f1c)[_0x9980('0x2b')](function(_0x56b9af){_0x563d37=_0x56b9af;return getUser(_0x563d37,_0x37cae5,_0x2b9f1c,_0x2c104c[_0x9980('0x3b')]);})[_0x9980('0x2b')](function(_0x1d402e){_0x1b2f79=_0x1d402e;logger[_0x9980('0x33')](_0x9980('0x88'),_0x1b2f79['id']);return getEndUser(_0x563d37,_0x37cae5,_0x2b9f1c,_0x3b0a4c[_0x9980('0x92')],_0x3b0a4c[_0x9980('0x93')],_0x1b2f79,_0x34476a);})['then'](function(_0x1b2a19){_0x246ae7=_0x1b2a19;return getCall(_0x563d37,_0x37cae5,_0x2b9f1c,_0x1b2f79,_0x246ae7,_0x34476a,_0x3b0a4c,'Outbound');})['then'](function(_0x599e58){if(_0x599e58){logger[_0x9980('0x33')](_0x9980('0x8b'),_0x599e58['id']);logger[_0x9980('0x33')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9980('0x36')]('user:%s',_0x2c104c[_0x9980('0x1e')]),_0x9980('0x94'),{'uri':_0x9980('0x8c')+_0x2b9f1c[_0x9980('0x7f')]+_0x9980('0x8d')+_0x599e58['id']});}})[_0x9980('0x2f')](function(_0x4703dc){logger['error'](_0x9980('0x90'),JSON[_0x9980('0x11')](_0x4703dc));});};exports[_0x9980('0x95')]=function(_0x5da9b1,_0x330e93,_0x36a663,_0x559a27,_0x3a6e7f,_0x4effc2){var _0x2017e1,_0x5841c2,_0x223ac2;_0x4effc2[_0x9980('0x7f')]=intUtil['stripTrailingSlash'](_0x4effc2[_0x9980('0x7f')]);_0x4effc2[_0x9980('0x80')]=intUtil['stripTrailingSlash'](_0x4effc2[_0x9980('0x80')]);if(_0x3a6e7f&&_0x3a6e7f[_0x9980('0x96')]){logger[_0x9980('0x33')]('['+_0x330e93[_0x9980('0x97')]['toUpperCase']()+']',_0x9980('0x91'));_0x330e93['recordingURL']=_0x4effc2[_0x9980('0x80')]+'/api/voice/recordings/'+_0x330e93[_0x9980('0x84')]+_0x9980('0x85')+md5(_0x330e93[_0x9980('0x84')]);}else{_0x330e93[_0x9980('0x82')]='';}var _0x442cbf=_0x4effc2[_0x9980('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x4effc2)['then'](function(_0x22a8c0){_0x223ac2=_0x22a8c0;return getUser(_0x223ac2,_0x442cbf,_0x4effc2);})[_0x9980('0x2b')](function(_0x1e9a54){_0x2017e1=_0x1e9a54;logger['info'](_0x9980('0x88'),_0x2017e1['id']);return getEndUser(_0x223ac2,_0x442cbf,_0x4effc2,_0x330e93['calleridname'],_0x330e93[_0x9980('0x8a')],_0x2017e1,_0x36a663);})['then'](function(_0x1ae732){_0x5841c2=_0x1ae732;return getCall(_0x223ac2,_0x442cbf,_0x4effc2,_0x2017e1,_0x5841c2,_0x36a663,_0x330e93,_0x9980('0x79'));})[_0x9980('0x2b')](function(_0x489f81){if(_0x489f81){logger['info'](_0x9980('0x8b'),_0x489f81['id']);}})[_0x9980('0x2f')](function(_0x18ae31){logger[_0x9980('0x30')]('['+_0x330e93[_0x9980('0x97')]['toUpperCase']()+']',JSON['stringify'](_0x18ae31));});}; \ No newline at end of file +var _0xc3d8=['refreshToken','clientId','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','moduleSearch','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','Called','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','host','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','lastevent','toUpperCase','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','picklist','type','idField','content','variableName','toString','customVariable','name','Variable','toLowerCase','indexOf','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token'];(function(_0x3bbbb2,_0x27c0ae){var _0x18d54c=function(_0x4a0f15){while(--_0x4a0f15){_0x3bbbb2['push'](_0x3bbbb2['shift']());}};_0x18d54c(++_0x27c0ae);}(_0xc3d8,0x70));var _0x8c3d=function(_0x27bf0e,_0x2b02fb){_0x27bf0e=_0x27bf0e-0x0;var _0x49ecea=_0xc3d8[_0x27bf0e];return _0x49ecea;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x8c3d('0x0'));var util=require(_0x8c3d('0x1'));var intUtil=require('./util');var moment=require(_0x8c3d('0x2'));var Redis=require(_0x8c3d('0x3'));var BPromise=require(_0x8c3d('0x4'));var config=require(_0x8c3d('0x5'));var logger=require(_0x8c3d('0x6'))('zoho');config[_0x8c3d('0x7')]=_[_0x8c3d('0x8')](config[_0x8c3d('0x7')],{'host':_0x8c3d('0x9'),'port':0x18eb});var io=require(_0x8c3d('0xa'))(new Redis(config[_0x8c3d('0x7')]));function emit(_0x5c6758,_0x94b9be,_0x1bac9e){io['to'](_0x5c6758)[_0x8c3d('0xb')](_0x94b9be,_0x1bac9e);}function request(_0x255be6){logger['debug'](_0x8c3d('0xc'),JSON[_0x8c3d('0xd')](_0x255be6));return rp(_0x255be6);}function getCustomFields(_0x1de29a,_0x299f31){var _0x4a2a19={};if(_0x1de29a[_0x8c3d('0xe')]>0x0){_['forEach'](_0x1de29a,function(_0x30cee2){if(_['includes'](['string',_0x8c3d('0xf')],_0x30cee2[_0x8c3d('0x10')])&&_0x30cee2[_0x8c3d('0x11')]){_0x4a2a19[_0x30cee2[_0x8c3d('0x11')]]=_0x30cee2[_0x8c3d('0x12')]['toString']();}else if(_0x30cee2['type']==='variable'&&_0x30cee2[_0x8c3d('0x13')]&&_0x30cee2['idField']&&_0x299f31[_0x30cee2[_0x8c3d('0x13')]]){_0x4a2a19[_0x30cee2[_0x8c3d('0x11')]]=_0x299f31[_0x30cee2[_0x8c3d('0x13')]][_0x8c3d('0x14')]();}else if(_0x30cee2['type']===_0x8c3d('0x15')&&_0x30cee2['Variable']&&_0x30cee2['Variable'][_0x8c3d('0x16')]&&_0x30cee2['idField']&&_0x299f31[_0x30cee2[_0x8c3d('0x17')][_0x8c3d('0x16')][_0x8c3d('0x18')]()]){_0x4a2a19[_0x30cee2[_0x8c3d('0x11')]]=_0x299f31[_0x30cee2[_0x8c3d('0x17')][_0x8c3d('0x16')][_0x8c3d('0x18')]()][_0x8c3d('0x14')]();}});}return _0x4a2a19;}function getName(_0x51e34a){if(_0x51e34a[_0x8c3d('0x19')]('\x20')>0x0){var _0x1d4936=_0x51e34a['split'](/ (.+)/);if(_0x1d4936[0x1]){return _0x1d4936;}}return[_0x51e34a,_0x51e34a];}var accountsTokens={};function getAccessToken(_0x4b9f85){return new Promise(function(_0x52c560,_0x5e455a){if(!_[_0x8c3d('0x1a')](accountsTokens[_0x4b9f85['id']])&&!_[_0x8c3d('0x1a')](accountsTokens[_0x4b9f85['id']]['access_token'])){if(moment()[_0x8c3d('0x1b')](accountsTokens[_0x4b9f85['id']][_0x8c3d('0x1c')])){_0x52c560(accountsTokens[_0x4b9f85['id']][_0x8c3d('0x1d')]);}}var _0x50adf2;switch(_0x4b9f85[_0x8c3d('0x1e')]){case'US':_0x50adf2='https://accounts.zoho.com';break;case'AU':_0x50adf2=_0x8c3d('0x1f');break;case'EU':_0x50adf2=_0x8c3d('0x20');break;case'IN':_0x50adf2=_0x8c3d('0x21');break;case'CN':_0x50adf2=_0x8c3d('0x22');break;default:_0x50adf2='https://accounts.zoho.eu';break;}var _0x47e2c9={'method':_0x8c3d('0x23'),'uri':_0x50adf2+_0x8c3d('0x24'),'qs':{'refresh_token':_0x4b9f85[_0x8c3d('0x25')],'client_id':_0x4b9f85[_0x8c3d('0x26')],'client_secret':_0x4b9f85['clientSecret'],'grant_type':_0x8c3d('0x27')},'json':!![]};return rp(_0x47e2c9)[_0x8c3d('0x28')](function(_0x21df3f){accountsTokens[_0x4b9f85['id']]={'access_token':_0x21df3f[_0x8c3d('0x1d')],'expires_in':moment()[_0x8c3d('0x29')](_0x21df3f[_0x8c3d('0x1c')],_0x8c3d('0x2a'))};_0x52c560(_0x21df3f[_0x8c3d('0x1d')]);})[_0x8c3d('0x2b')](function(_0xa49eb9){logger['error'](_0x8c3d('0x2c'),_0xa49eb9[_0x8c3d('0x2d')]);_0x5e455a(_0xa49eb9);});});}function getUser(_0x3ac65,_0x50397b,_0x3ea359,_0x4162ba){logger[_0x8c3d('0x2e')](_0x8c3d('0x2f'));return request({'method':_0x8c3d('0x30'),'uri':util[_0x8c3d('0x31')](_0x8c3d('0x32'),_0x50397b),'qs':{'type':_0x8c3d('0x33')},'headers':{'Authorization':_0x8c3d('0x34')+_0x3ac65},'json':!![]})['then'](function(_0xea4780){if(_0xea4780['users']){var _0x198945=-0x1;if(_[_0x8c3d('0x35')](_0xea4780[_0x8c3d('0x36')])){if(!_[_0x8c3d('0x1a')](_0x4162ba)){_0x198945=_[_0x8c3d('0x37')](_0xea4780['users'],function(_0x90ae6d){return _0x90ae6d[_0x8c3d('0x38')]===_0x4162ba;});}if(_0x198945>=0x0){logger[_0x8c3d('0x2e')](_0x8c3d('0x39'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x198945=_[_0x8c3d('0x37')](_0xea4780[_0x8c3d('0x36')],function(_0x4b546b){return _0x4b546b[_0x8c3d('0x3a')]['name']===_0x8c3d('0x3b');});}return _0xea4780[_0x8c3d('0x36')][_0x198945];}else{if(_0xea4780[_0x8c3d('0x3c')][_0x8c3d('0x3a')]['name']===_0x8c3d('0x3b')){logger[_0x8c3d('0x2e')](_0x8c3d('0x3d'));user=_0xea4780['user'];return user;}else{logger[_0x8c3d('0x3e')](_0x8c3d('0x3f'),JSON[_0x8c3d('0xd')](_0xea4780));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8c3d('0xd')](_0xea4780));}}}else{logger['error'](_0x8c3d('0x3f'),JSON[_0x8c3d('0xd')](_0xea4780));throw new Error(_0x8c3d('0x40')+JSON[_0x8c3d('0xd')](_0xea4780));}})['catch'](function(_0x5a6f8a){console[_0x8c3d('0x3e')](_0x5a6f8a);});}function getZohoUser(_0x1f49cf,_0xde6693){return new BPromise(function(_0x43e39d,_0x458c12){request(_0x1f49cf)[_0x8c3d('0x28')](function(_0x450f4b){var _0x4d16f4=null;if(_0x450f4b){_0x4d16f4=_0x450f4b[_0x8c3d('0x41')][0x0];_0x4d16f4[_0x8c3d('0x42')]=_0xde6693;}_0x43e39d(_0x4d16f4);})[_0x8c3d('0x2b')](function(_0x22bf60){_0x458c12(_0x22bf60);});});}function createEndUser(_0x9f15f,_0x2412dd,_0x3b4bde,_0x4e7ecb,_0xb719bd,_0x325071){var _0x3b4bde=getName(_0x3b4bde);return request({'method':_0x8c3d('0x23'),'uri':_0x8c3d('0x43')+_0x2412dd+_0x8c3d('0x44')+_[_0x8c3d('0x45')](_0x325071[_0x8c3d('0x46')])+'s','body':{'data':[{'Last_Name':_0x3b4bde[0x1],'First_Name':_0x3b4bde[0x0],'Phone':_0x4e7ecb,'Owner':{'name':!_[_0x8c3d('0x1a')](_0xb719bd[_0x8c3d('0x47')][_0x8c3d('0x16')])?_0xb719bd[_0x8c3d('0x47')][_0x8c3d('0x16')]:!_[_0x8c3d('0x1a')](_0xb719bd[_0x8c3d('0x48')])?_0xb719bd[_0x8c3d('0x48')]+'\x20'+_0xb719bd[_0x8c3d('0x49')]:_0xb719bd[_0x8c3d('0x49')],'id':_0xb719bd['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x9f15f},'json':!![]})['then'](function(_0x39cb71){if(_0x39cb71&&_0x39cb71['data'][0x0][_0x8c3d('0x4a')]==='SUCCESS'){var _0x17f6e1=_0x39cb71[_0x8c3d('0x41')][0x0][_0x8c3d('0x4b')];_0x17f6e1[_0x8c3d('0x42')]=_[_0x8c3d('0x45')](_0x325071['moduleCreate'])+'s';return _0x17f6e1;}logger['error'](_0x8c3d('0x3f'),JSON[_0x8c3d('0xd')](data));throw new Error(_0x8c3d('0x4c')+JSON[_0x8c3d('0xd')](data));})[_0x8c3d('0x2b')](function(_0x5e3324){console[_0x8c3d('0x4d')]('CREATE\x20ERROR',_0x5e3324);});}function getEndUser(_0x10c1f4,_0x562a36,_0x4f3a28,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054){var _0x1df574={'method':'GET','uri':'','headers':{'Authorization':_0x8c3d('0x34')+_0x10c1f4},'json':!![]};switch(_0x8f3054[_0x8c3d('0x4e')]){case'contact_lead':_0x1df574[_0x8c3d('0x4f')]='https://www.zohoapis.'+_0x562a36+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3ee20d+'))';return getZohoUser(_0x1df574,'Contacts')[_0x8c3d('0x28')](function(_0x58b265){if(_0x58b265)return _0x58b265;_0x1df574['uri']=_0x8c3d('0x43')+_0x562a36+_0x8c3d('0x50')+_0x3ee20d+'))';return getZohoUser(_0x1df574,_0x8c3d('0x51'))['then'](function(_0x276d4f){if(_0x276d4f)return _0x276d4f;if(_0x8f3054['moduleCreate']!='nothing'){return createEndUser(_0x10c1f4,_0x562a36,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054);}else{return{};}});});break;case _0x8c3d('0x52'):_0x1df574['uri']=_0x8c3d('0x43')+_0x562a36+_0x8c3d('0x53')+_0x3ee20d+'))';return getZohoUser(_0x1df574,'Contacts')[_0x8c3d('0x28')](function(_0x114d32){if(_0x114d32)return _0x114d32;if(_0x8f3054[_0x8c3d('0x46')]!=_0x8c3d('0x54')){return createEndUser(_0x10c1f4,_0x562a36,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054);}else{return{};}});break;case _0x8c3d('0x55'):_0x1df574[_0x8c3d('0x4f')]=_0x8c3d('0x43')+_0x562a36+_0x8c3d('0x50')+_0x3ee20d+'))';return getZohoUser(_0x1df574,_0x8c3d('0x51'))['then'](function(_0x17c32c){if(_0x17c32c)return _0x17c32c;if(_0x8f3054['moduleCreate']!='nothing'){return createEndUser(_0x10c1f4,_0x562a36,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054);}else{return{};}});break;}}function getCall(_0x274767,_0x1bb9d3,_0x2059eb,_0x49e050,_0x1baee9,_0x58a97b,_0x1f4ca6,_0x4da296){logger[_0x8c3d('0x2e')](_0x8c3d('0x56'));var _0x4045ad={};_0x4045ad['Owner']={'name':!_[_0x8c3d('0x1a')](_0x49e050[_0x8c3d('0x47')][_0x8c3d('0x16')])&&!_[_0x8c3d('0x1a')](_0x49e050[_0x8c3d('0x3a')][_0x8c3d('0x16')])&&_0x49e050[_0x8c3d('0x3a')][_0x8c3d('0x16')]===_0x8c3d('0x57')?_0x49e050[_0x8c3d('0x47')][_0x8c3d('0x16')]:!_['isNil'](_0x49e050[_0x8c3d('0x48')])?_0x49e050[_0x8c3d('0x48')]+'\x20'+_0x49e050[_0x8c3d('0x49')]:_0x49e050[_0x8c3d('0x49')],'id':_0x49e050['id']};_0x4045ad['Subject']=intUtil[_0x8c3d('0x58')](_0x58a97b[_0x8c3d('0x59')],_0x1f4ca6,'\x20');_0x4045ad[_0x8c3d('0x5a')]=intUtil[_0x8c3d('0x58')](_0x58a97b[_0x8c3d('0x5b')],_0x1f4ca6,'\x0a');if(_0x1baee9[_0x8c3d('0x42')]==='Contacts'){_0x4045ad['Who_Id']={'name':!_[_0x8c3d('0x1a')](_0x1baee9[_0x8c3d('0x5c')])?_0x1baee9[_0x8c3d('0x5c')]:!_['isNil'](_0x1baee9[_0x8c3d('0x5d')])?_0x1baee9[_0x8c3d('0x5d')]+'\x20'+_0x1baee9[_0x8c3d('0x5e')]:_0x1baee9[_0x8c3d('0x5e')],'id':_0x1baee9['id']};}if(_0x1baee9[_0x8c3d('0x42')]===_0x8c3d('0x51')){_0x4045ad[_0x8c3d('0x5f')]={'name':!_[_0x8c3d('0x1a')](_0x1baee9[_0x8c3d('0x5c')])?_0x1baee9[_0x8c3d('0x5c')]:!_[_0x8c3d('0x1a')](_0x1baee9[_0x8c3d('0x5d')])?_0x1baee9[_0x8c3d('0x5d')]+'\x20'+_0x1baee9[_0x8c3d('0x5e')]:_0x1baee9['Last_Name'],'id':_0x1baee9['id']};_0x4045ad['$se_module']=_[_0x8c3d('0x45')](_0x1baee9[_0x8c3d('0x42')]);}if(_0x1f4ca6[_0x8c3d('0x60')]){_0x4045ad[_0x8c3d('0x61')]=moment['utc'](parseInt(_0x1f4ca6[_0x8c3d('0x60')])*0x3e8)[_0x8c3d('0x31')]('mm:ss');}else if(_0x1f4ca6[_0x8c3d('0x62')]&&_0x1f4ca6[_0x8c3d('0x63')]){_0x4045ad['Call_Duration']=moment[_0x8c3d('0x64')](moment(_0x1f4ca6['endtime'],_0x8c3d('0x65'))[_0x8c3d('0x66')](moment(_0x1f4ca6[_0x8c3d('0x67')],_0x8c3d('0x65'))))[_0x8c3d('0x31')](_0x8c3d('0x68'));}switch(_0x1f4ca6['lastevent']){case'called':_0x4045ad['Call_Result']=_0x8c3d('0x69');break;case'complete':case _0x8c3d('0x6a'):_0x4045ad[_0x8c3d('0x6b')]=_0x8c3d('0x6c');break;case _0x8c3d('0x6d'):_0x4045ad[_0x8c3d('0x6b')]='Rejected';break;case _0x8c3d('0x6e'):_0x4045ad[_0x8c3d('0x6b')]=_0x8c3d('0x6f');break;case _0x8c3d('0x70'):_0x4045ad['Call_Result']=_0x8c3d('0x71');default:}_0x4045ad['Call_Start_Time']=(_0x4da296===_0x8c3d('0x72')?moment(_0x1f4ca6[_0x8c3d('0x67')])[_0x8c3d('0x31')](_0x8c3d('0x65')):moment(_0x1f4ca6['agentcalledAt'])[_0x8c3d('0x31')](_0x8c3d('0x65')))||moment()[_0x8c3d('0x31')]('YYYY-MM-DDTHH:mm:ss');_0x4045ad[_0x8c3d('0x73')]=_0x4da296||_0x8c3d('0x74');_0x4045ad=_['merge'](_0x4045ad,getCustomFields(_0x58a97b[_0x8c3d('0x75')],_0x1f4ca6));return request({'method':_0x8c3d('0x23'),'uri':_0x8c3d('0x43')+_0x1bb9d3+_0x8c3d('0x76'),'headers':{'Authorization':_0x8c3d('0x34')+_0x274767},'body':{'data':[_0x4045ad]},'json':!![]})['then'](function(_0x168b2b){if(_0x168b2b&&_0x168b2b[_0x8c3d('0x41')][0x0][_0x8c3d('0x4a')]===_0x8c3d('0x77')){logger[_0x8c3d('0x2e')](_0x8c3d('0x78'));return{'id':_0x168b2b[_0x8c3d('0x41')][0x0][_0x8c3d('0x4b')]['id']};}})[_0x8c3d('0x2b')](function(_0x6dc105){logger[_0x8c3d('0x2e')](_0x8c3d('0x79'),_0x6dc105[_0x8c3d('0x2d')]);console['log']('err',_0x6dc105);});}exports['queue']=function(_0x177185,_0x23c8f1,_0x183ced,_0x3b8ad8,_0x50a0e1,_0x6bac2){var _0x7bd2b8,_0x1980bc,_0x5f14c9;_0x6bac2[_0x8c3d('0x7a')]=intUtil[_0x8c3d('0x7b')](_0x6bac2[_0x8c3d('0x7a')]);_0x6bac2['serverUrl']=intUtil['stripTrailingSlash'](_0x6bac2['serverUrl']);if(_0x50a0e1&&_0x50a0e1[_0x8c3d('0x7c')]){logger[_0x8c3d('0x2e')](_0x8c3d('0x7d'),'Recording\x20is\x20enabled!');_0x23c8f1[_0x8c3d('0x7e')]=_0x6bac2[_0x8c3d('0x7f')]+_0x8c3d('0x80')+_0x23c8f1[_0x8c3d('0x81')]+_0x8c3d('0x82')+md5(_0x23c8f1[_0x8c3d('0x81')]);}else{_0x23c8f1['recordingURL']='';}var _0x1cfa47=_0x6bac2['host']===_0x8c3d('0x83')?'eu':_0x8c3d('0x84');return getAccessToken(_0x6bac2)[_0x8c3d('0x28')](function(_0x914c44){_0x5f14c9=_0x914c44;return getUser(_0x5f14c9,_0x1cfa47,_0x6bac2,_0x3b8ad8[_0x8c3d('0x38')]);})[_0x8c3d('0x28')](function(_0x1752ee){_0x7bd2b8=_0x1752ee;logger[_0x8c3d('0x2e')](_0x8c3d('0x85'),_0x7bd2b8['id']);return getEndUser(_0x5f14c9,_0x1cfa47,_0x6bac2,_0x23c8f1['calleridname'],_0x23c8f1[_0x8c3d('0x86')],_0x7bd2b8,_0x183ced);})[_0x8c3d('0x28')](function(_0x11c265){_0x1980bc=_0x11c265;return getCall(_0x5f14c9,_0x1cfa47,_0x6bac2,_0x7bd2b8,_0x1980bc,_0x183ced,_0x23c8f1,'Inbound');})['then'](function(_0x51aff2){if(_0x51aff2){logger[_0x8c3d('0x2e')](_0x8c3d('0x87'),_0x51aff2['id']);logger[_0x8c3d('0x2e')]('[QUEUE]',_0x8c3d('0x88'));emit(util[_0x8c3d('0x31')]('user:%s',_0x3b8ad8[_0x8c3d('0x16')]),'trigger:browser:url',{'uri':'https://crm.'+_0x6bac2[_0x8c3d('0x7a')]+_0x8c3d('0x89')+_0x51aff2['id']});}})[_0x8c3d('0x2b')](function(_0x3f141e){logger[_0x8c3d('0x3e')]('[QUEUE]',JSON[_0x8c3d('0xd')](_0x3f141e));});};exports['outbound']=function(_0x140b9d,_0x2a0cfb,_0x5a6b3f,_0xa903a,_0xa74e5,_0x1addb6,_0x2ccf5e){var _0x398095,_0xd1998a,_0x3fd719;_0x1addb6[_0x8c3d('0x7a')]=intUtil[_0x8c3d('0x7b')](_0x1addb6[_0x8c3d('0x7a')]);_0x1addb6['serverUrl']=intUtil[_0x8c3d('0x7b')](_0x1addb6[_0x8c3d('0x7f')]);if(_0x2ccf5e&&_0x2ccf5e[_0x8c3d('0x8a')]&&_0x2ccf5e[_0x8c3d('0x8a')]!==_0x8c3d('0x8b')){logger['info'](_0x8c3d('0x8c'),_0x8c3d('0x8d'));_0x2a0cfb['recordingURL']=_0x1addb6['serverUrl']+_0x8c3d('0x80')+_0x2a0cfb[_0x8c3d('0x81')]+_0x8c3d('0x82')+md5(_0x2a0cfb[_0x8c3d('0x81')]);}var _0x6275c5=_0x1addb6[_0x8c3d('0x7a')]===_0x8c3d('0x83')?'eu':_0x8c3d('0x84');return getAccessToken(_0x1addb6)[_0x8c3d('0x28')](function(_0x4f91d0){_0x3fd719=_0x4f91d0;return getUser(_0x3fd719,_0x6275c5,_0x1addb6,_0xa903a[_0x8c3d('0x38')]);})['then'](function(_0x500409){_0x398095=_0x500409;logger[_0x8c3d('0x2e')](_0x8c3d('0x85'),_0x398095['id']);return getEndUser(_0x3fd719,_0x6275c5,_0x1addb6,_0x2a0cfb[_0x8c3d('0x8e')],_0x2a0cfb[_0x8c3d('0x8f')],_0x398095,_0x5a6b3f);})[_0x8c3d('0x28')](function(_0x44fd23){_0xd1998a=_0x44fd23;return getCall(_0x3fd719,_0x6275c5,_0x1addb6,_0x398095,_0xd1998a,_0x5a6b3f,_0x2a0cfb,_0x8c3d('0x90'));})[_0x8c3d('0x28')](function(_0x2fb56e){if(_0x2fb56e){logger[_0x8c3d('0x2e')](_0x8c3d('0x87'),_0x2fb56e['id']);logger['info'](_0x8c3d('0x8c'),_0x8c3d('0x88'));emit(util['format']('user:%s',_0xa903a[_0x8c3d('0x16')]),_0x8c3d('0x91'),{'uri':'https://crm.'+_0x1addb6[_0x8c3d('0x7a')]+_0x8c3d('0x89')+_0x2fb56e['id']});}})['catch'](function(_0xf998ba){logger[_0x8c3d('0x3e')](_0x8c3d('0x8c'),JSON[_0x8c3d('0xd')](_0xf998ba));});};exports[_0x8c3d('0x92')]=function(_0x312a67,_0x5b3089,_0x4720b4,_0x1fadd7,_0x11ba6a,_0x27f9a6){var _0x538606,_0x44514e,_0x42d19a;_0x27f9a6[_0x8c3d('0x7a')]=intUtil[_0x8c3d('0x7b')](_0x27f9a6[_0x8c3d('0x7a')]);_0x27f9a6[_0x8c3d('0x7f')]=intUtil['stripTrailingSlash'](_0x27f9a6['serverUrl']);if(_0x11ba6a&&_0x11ba6a[_0x8c3d('0x7c')]){logger[_0x8c3d('0x2e')]('['+_0x5b3089[_0x8c3d('0x93')][_0x8c3d('0x94')]()+']',_0x8c3d('0x8d'));_0x5b3089[_0x8c3d('0x7e')]=_0x27f9a6['serverUrl']+_0x8c3d('0x80')+_0x5b3089[_0x8c3d('0x81')]+_0x8c3d('0x82')+md5(_0x5b3089[_0x8c3d('0x81')]);}else{_0x5b3089['recordingURL']='';}var _0x17f3a2=_0x27f9a6[_0x8c3d('0x7a')]===_0x8c3d('0x83')?'eu':_0x8c3d('0x84');return getAccessToken(_0x27f9a6)[_0x8c3d('0x28')](function(_0xadc1ea){_0x42d19a=_0xadc1ea;return getUser(_0x42d19a,_0x17f3a2,_0x27f9a6);})['then'](function(_0x537f8c){_0x538606=_0x537f8c;logger[_0x8c3d('0x2e')](_0x8c3d('0x85'),_0x538606['id']);return getEndUser(_0x42d19a,_0x17f3a2,_0x27f9a6,_0x5b3089['calleridname'],_0x5b3089[_0x8c3d('0x86')],_0x538606,_0x4720b4);})[_0x8c3d('0x28')](function(_0x4168be){_0x44514e=_0x4168be;return getCall(_0x42d19a,_0x17f3a2,_0x27f9a6,_0x538606,_0x44514e,_0x4720b4,_0x5b3089,_0x8c3d('0x74'));})[_0x8c3d('0x28')](function(_0x3fb41b){if(_0x3fb41b){logger[_0x8c3d('0x2e')](_0x8c3d('0x87'),_0x3fb41b['id']);}})[_0x8c3d('0x2b')](function(_0x15bac5){logger[_0x8c3d('0x3e')]('['+_0x5b3089[_0x8c3d('0x93')]['toUpperCase']()+']',JSON[_0x8c3d('0xd')](_0x15bac5));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index ddc4d48..754a15b 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3e0=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec','data2','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x470727,_0x545f62){var _0x17fef8=function(_0x3ea777){while(--_0x3ea777){_0x470727['push'](_0x470727['shift']());}};_0x17fef8(++_0x545f62);}(_0xc3e0,0x160));var _0x0c3e=function(_0x272f49,_0x3cdd11){_0x272f49=_0x272f49-0x0;var _0x4c6564=_0xc3e0[_0x272f49];return _0x4c6564;};'use strict';var util=require(_0x0c3e('0x0'));var sh=require(_0x0c3e('0x1'));var Mustache=require(_0x0c3e('0x2'));var logger=require('../../../../config/logger')(_0x0c3e('0x3'));exports[_0x0c3e('0x4')]=function(_0xc0522b,_0x37e433){var _0x1eb77f=_0xc0522b[_0x0c3e('0x5')]?_0xc0522b[_0x0c3e('0x5')]:'Script';var _0x60b323=_0xc0522b[_0x0c3e('0x6')]?Mustache[_0x0c3e('0x7')](_0xc0522b[_0x0c3e('0x6')],_0x37e433):_0x37e433;sh[_0x0c3e('0x4')](_0x60b323,function(_0xa841ae,_0x1c300b,_0x2b5887){if(_0xa841ae!==0x0){logger[_0x0c3e('0x8')](util[_0x0c3e('0x9')](_0x0c3e('0xa'),_0x1eb77f,_0x60b323,_0xa841ae,_0x2b5887));}else{logger[_0x0c3e('0xb')](util['format'](_0x0c3e('0xc'),_0x1eb77f,_0x60b323,_0x1c300b));}});}; \ No newline at end of file +var _0x3a90=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x45462c,_0x3f20e9){var _0x28629b=function(_0x1f672b){while(--_0x1f672b){_0x45462c['push'](_0x45462c['shift']());}};_0x28629b(++_0x3f20e9);}(_0x3a90,0x77));var _0x03a9=function(_0x34cda0,_0x123123){_0x34cda0=_0x34cda0-0x0;var _0x5e1401=_0x3a90[_0x34cda0];return _0x5e1401;};'use strict';var util=require(_0x03a9('0x0'));var sh=require(_0x03a9('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x03a9('0x2'));exports[_0x03a9('0x3')]=function(_0x1b1ca4,_0x105eda){var _0x1cde45=_0x1b1ca4[_0x03a9('0x4')]?_0x1b1ca4['data2']:_0x03a9('0x5');var _0x5637bc=_0x1b1ca4[_0x03a9('0x6')]?Mustache[_0x03a9('0x7')](_0x1b1ca4[_0x03a9('0x6')],_0x105eda):_0x105eda;sh[_0x03a9('0x3')](_0x5637bc,function(_0x5144af,_0x5661f1,_0x4d5720){if(_0x5144af!==0x0){logger[_0x03a9('0x8')](util[_0x03a9('0x9')](_0x03a9('0xa'),_0x1cde45,_0x5637bc,_0x5144af,_0x4d5720));}else{logger[_0x03a9('0xb')](util[_0x03a9('0x9')](_0x03a9('0xc'),_0x1cde45,_0x5637bc,_0x5661f1));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index ccc28f2..e06f8b3 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e80=['format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','mustache','trigger','exec','render','data2','data5','number','headers','data6','parse','error','stack','data1','toUpperCase','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil'];(function(_0x5753c3,_0x5878be){var _0x47e08c=function(_0x589f4c){while(--_0x589f4c){_0x5753c3['push'](_0x5753c3['shift']());}};_0x47e08c(++_0x5878be);}(_0x3e80,0x1c7));var _0x03e8=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x3e80[_0x57486e];return _0x5f110b;};'use strict';var rp=require('request-promise');var util=require(_0x03e8('0x0'));var _=require('lodash');var Mustache=require(_0x03e8('0x1'));var logger=require('../../../../config/logger')(_0x03e8('0x2'));exports[_0x03e8('0x3')]=function(_0x1582f0,_0x5f49a6){var _0xa21940,_0x5b242f;var _0x128903={'method':_0x1582f0['data1']['toUpperCase'](),'uri':Mustache[_0x03e8('0x4')](_0x1582f0[_0x03e8('0x5')],_0x5f49a6),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1582f0[_0x03e8('0x6')])===_0x03e8('0x7')&&parseInt(_0x1582f0[_0x03e8('0x6')])>=0x1&&parseInt(_0x1582f0[_0x03e8('0x6')])<=0xa?parseInt(_0x1582f0[_0x03e8('0x6')])*0x3e8:0x5*0x3e8};try{_0x128903[_0x03e8('0x8')]=_0x1582f0[_0x03e8('0x9')]?JSON[_0x03e8('0xa')](Mustache[_0x03e8('0x4')](_0x1582f0[_0x03e8('0x9')],_0x5f49a6)):{};}catch(_0x3f1593){logger[_0x03e8('0xb')](_0x3f1593[_0x03e8('0xc')]);}switch(_0x1582f0[_0x03e8('0xd')][_0x03e8('0xe')]()){case _0x03e8('0xf'):case _0x03e8('0x10'):_0xa21940=null;_0x128903['qs']=_0x5f49a6;break;case _0x03e8('0x11'):case'PUT':if(_0x1582f0[_0x03e8('0x12')]){try{_0xa21940=JSON[_0x03e8('0xa')](Mustache[_0x03e8('0x4')](_0x1582f0[_0x03e8('0x12')],_0x5f49a6));_0x128903[_0x03e8('0x13')]=_0xa21940;}catch(_0x5372fc){logger[_0x03e8('0xb')](_0x5372fc['stack']);logger[_0x03e8('0xb')](_0x03e8('0x14'));}}else{_0xa21940=_0x5f49a6;_0x128903[_0x03e8('0x13')]=_0xa21940;}break;}logger['info'](util['format'](_0x03e8('0x15'),_0x1582f0['data1'],_0x1582f0[_0x03e8('0x5')],JSON[_0x03e8('0x16')](_0x128903)));rp(_0x128903)[_0x03e8('0x17')](function(_0x6bab0d){_0xa21940=!_[_0x03e8('0x18')](_0xa21940)?',\x20request\x20body:\x20'+_0xa21940:'';_0x5b242f=typeof _0x6bab0d[_0x03e8('0x13')]==='object'?JSON['stringify'](_0x6bab0d[_0x03e8('0x13')]):_0x6bab0d[_0x03e8('0x13')];logger['info'](util[_0x03e8('0x19')](_0x03e8('0x1a'),_0x1582f0[_0x03e8('0xd')],_0x1582f0['data2'],_0x6bab0d[_0x03e8('0x1b')],_0x5b242f));})['catch'](function(_0x5d9f0f){logger[_0x03e8('0xb')](util[_0x03e8('0x19')](_0x03e8('0x1c'),_0x1582f0[_0x03e8('0xd')],_0x1582f0[_0x03e8('0x5')],_0x5d9f0f['statusCode'],_0x5d9f0f['name'],_0x5d9f0f[_0x03e8('0x1d')]));});}; \ No newline at end of file +var _0xfe2e=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','body','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','error','stack','GET','POST','PUT','data7'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfe2e,0xa8));var _0xefe2=function(_0x52e126,_0x440070){_0x52e126=_0x52e126-0x0;var _0x1337a7=_0xfe2e[_0x52e126];return _0x1337a7;};'use strict';var rp=require(_0xefe2('0x0'));var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require(_0xefe2('0x1'))(_0xefe2('0x2'));exports['exec']=function(_0x5ae51d,_0x393eb5){var _0x38bd65,_0x22192c;var _0x366494={'method':_0x5ae51d[_0xefe2('0x3')][_0xefe2('0x4')](),'uri':Mustache[_0xefe2('0x5')](_0x5ae51d[_0xefe2('0x6')],_0x393eb5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5ae51d[_0xefe2('0x7')])===_0xefe2('0x8')&&parseInt(_0x5ae51d['data5'])>=0x1&&parseInt(_0x5ae51d[_0xefe2('0x7')])<=0xa?parseInt(_0x5ae51d['data5'])*0x3e8:0x5*0x3e8};try{_0x366494[_0xefe2('0x9')]=_0x5ae51d['data6']?JSON[_0xefe2('0xa')](Mustache[_0xefe2('0x5')](_0x5ae51d[_0xefe2('0xb')],_0x393eb5)):{};}catch(_0x4be58f){logger[_0xefe2('0xc')](_0x4be58f[_0xefe2('0xd')]);}switch(_0x5ae51d[_0xefe2('0x3')][_0xefe2('0x4')]()){case _0xefe2('0xe'):case'DELETE':_0x38bd65=null;_0x366494['qs']=_0x393eb5;break;case _0xefe2('0xf'):case _0xefe2('0x10'):if(_0x5ae51d[_0xefe2('0x11')]){try{_0x38bd65=JSON[_0xefe2('0xa')](Mustache['render'](_0x5ae51d['data7'],_0x393eb5));_0x366494['body']=_0x38bd65;}catch(_0x3fae9b){logger[_0xefe2('0xc')](_0x3fae9b[_0xefe2('0xd')]);logger[_0xefe2('0xc')](_0xefe2('0x12'));}}else{_0x38bd65=_0x393eb5;_0x366494['body']=_0x38bd65;}break;}logger['info'](util[_0xefe2('0x13')](_0xefe2('0x14'),_0x5ae51d[_0xefe2('0x3')],_0x5ae51d[_0xefe2('0x6')],JSON[_0xefe2('0x15')](_0x366494)));rp(_0x366494)[_0xefe2('0x16')](function(_0x299722){_0x38bd65=!_[_0xefe2('0x17')](_0x38bd65)?',\x20request\x20body:\x20'+_0x38bd65:'';_0x22192c=typeof _0x299722[_0xefe2('0x18')]===_0xefe2('0x19')?JSON[_0xefe2('0x15')](_0x299722[_0xefe2('0x18')]):_0x299722[_0xefe2('0x18')];logger[_0xefe2('0x1a')](util[_0xefe2('0x13')](_0xefe2('0x1b'),_0x5ae51d[_0xefe2('0x3')],_0x5ae51d[_0xefe2('0x6')],_0x299722[_0xefe2('0x1c')],_0x22192c));})['catch'](function(_0x1e1370){logger['error'](util[_0xefe2('0x13')](_0xefe2('0x1d'),_0x5ae51d[_0xefe2('0x3')],_0x5ae51d[_0xefe2('0x6')],_0x1e1370[_0xefe2('0x1c')],_0x1e1370['name'],_0x1e1370[_0xefe2('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f2adeb2..3be3bc6 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfe9=['Request','then','debug','error','rpc','message','jayson/promise','bluebird','../../config/logger','routing','http'];(function(_0x2c3e9e,_0xa87662){var _0x13058a=function(_0x43ead7){while(--_0x43ead7){_0x2c3e9e['push'](_0x2c3e9e['shift']());}};_0x13058a(++_0xa87662);}(_0xbfe9,0x1df));var _0x9bfe=function(_0x444781,_0x4c1340){_0x444781=_0x444781-0x0;var _0x3d87af=_0xbfe9[_0x444781];return _0x3d87af;};'use strict';var jayson=require(_0x9bfe('0x0'));var BPromise=require(_0x9bfe('0x1'));var logger=require(_0x9bfe('0x2'))(_0x9bfe('0x3'));var client=jayson['client'][_0x9bfe('0x4')]({'port':0x2329});client[_0x9bfe('0x5')]=function(_0x586353,_0x5f0c0c){return new BPromise(function(_0x40ed08,_0x529a6d){return client['request'](_0x586353,_0x5f0c0c)[_0x9bfe('0x6')](function(_0x449806){logger[_0x9bfe('0x7')]('rpc',_0x9bfe('0x3'),_0x586353,_0x5f0c0c,_0x449806);if(_0x449806[_0x9bfe('0x8')]){logger[_0x9bfe('0x8')](_0x9bfe('0x9'),_0x9bfe('0x3'),_0x586353,_0x449806[_0x9bfe('0x8')][_0x9bfe('0xa')],_0x5f0c0c);return _0x529a6d(_0x449806[_0x9bfe('0x8')]['message']);}else{return _0x40ed08(_0x449806['result']);}})['catch'](function(_0x2abc43){logger[_0x9bfe('0x8')](_0x9bfe('0x9'),_0x9bfe('0x3'),_0x586353,_0x2abc43,_0x5f0c0c);return _0x529a6d(_0x2abc43);});});};module['exports']=client; \ No newline at end of file +var _0xe161=['jayson/promise','bluebird','../../config/logger','routing','client','http','rpc','error','message','result','catch'];(function(_0x2e9f22,_0x42fdd4){var _0x328f25=function(_0x4f3046){while(--_0x4f3046){_0x2e9f22['push'](_0x2e9f22['shift']());}};_0x328f25(++_0x42fdd4);}(_0xe161,0x134));var _0x1e16=function(_0x4f2b52,_0xb09854){_0x4f2b52=_0x4f2b52-0x0;var _0x816753=_0xe161[_0x4f2b52];return _0x816753;};'use strict';var jayson=require(_0x1e16('0x0'));var BPromise=require(_0x1e16('0x1'));var logger=require(_0x1e16('0x2'))(_0x1e16('0x3'));var client=jayson[_0x1e16('0x4')][_0x1e16('0x5')]({'port':0x2329});client['Request']=function(_0x121128,_0x3169e3){return new BPromise(function(_0x506bb1,_0x45f020){return client['request'](_0x121128,_0x3169e3)['then'](function(_0x13fa6a){logger['debug'](_0x1e16('0x6'),'routing',_0x121128,_0x3169e3,_0x13fa6a);if(_0x13fa6a[_0x1e16('0x7')]){logger[_0x1e16('0x7')](_0x1e16('0x6'),_0x1e16('0x3'),_0x121128,_0x13fa6a[_0x1e16('0x7')][_0x1e16('0x8')],_0x3169e3);return _0x45f020(_0x13fa6a[_0x1e16('0x7')][_0x1e16('0x8')]);}else{return _0x506bb1(_0x13fa6a[_0x1e16('0x9')]);}})[_0x1e16('0xa')](function(_0x217dad){logger[_0x1e16('0x7')](_0x1e16('0x6'),_0x1e16('0x3'),_0x121128,_0x217dad,_0x3169e3);return _0x45f020(_0x217dad);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b594e0b..658c34c 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x296a=['then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','resolve'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x296a,0x190));var _0xa296=function(_0x3c33a9,_0x50d20e){_0x3c33a9=_0x3c33a9-0x0;var _0x248ce9=_0x296a[_0x3c33a9];return _0x248ce9;};'use strict';var server=require(_0xa296('0x0'));var Realtime=require(_0xa296('0x1'));var EmailChannel=require(_0xa296('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xa296('0x3'));var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa296('0x4')]()[_0xa296('0x5')](mailAccount[_0xa296('0x6')]())[_0xa296('0x5')](realtime[_0xa296('0x7')]())['then'](function(){email[_0xa296('0x8')](realtime[_0xa296('0x9')]);return realtime;});}function main(){return server[_0xa296('0xa')](realtime,email)[_0xa296('0x5')](function(){return initRealtime();})[_0xa296('0x5')](function(){return setting[_0xa296('0xb')]();})[_0xa296('0x5')](function(_0x863991){return setInterval(initRealtime,_0x863991['loginMailFrequency']*0x3e8);})[_0xa296('0xc')](function(_0xe0ea67){logger[_0xa296('0xd')](_0xa296('0xe'),_0xe0ea67);});}main(); \ No newline at end of file +var _0x30ad=['../../config/logger','email','then','getMailAccounts','mailAccounts','listen','getSettings','error','./server','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x30ad,0x68));var _0xd30a=function(_0x70ba6e,_0x365d5a){_0x70ba6e=_0x70ba6e-0x0;var _0x31f02c=_0x30ad[_0x70ba6e];return _0x31f02c;};'use strict';var server=require(_0xd30a('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xd30a('0x1'));var mailAccount=require(_0xd30a('0x2'));var setting=require(_0xd30a('0x3'));var logger=require(_0xd30a('0x4'))(_0xd30a('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xd30a('0x6')](mailAccount[_0xd30a('0x7')]())[_0xd30a('0x6')](realtime['initMailAccounts']())[_0xd30a('0x6')](function(){email['refresh'](realtime[_0xd30a('0x8')]);return realtime;});}function main(){return server[_0xd30a('0x9')](realtime,email)[_0xd30a('0x6')](function(){return initRealtime();})[_0xd30a('0x6')](function(){return setting[_0xd30a('0xa')]();})['then'](function(_0xfaf46){return setInterval(initRealtime,_0xfaf46['loginMailFrequency']*0x3e8);})['catch'](function(_0x4ba9a3){logger[_0xd30a('0xb')]('Email\x20service\x20initialization',_0x4ba9a3);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index cce40d3..90817a8 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9161=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','send','Smtp','lastSync','verify','then','verified','exports','lodash','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','messageStatus','Imap','total','isNil','md5','mailAccount:update','hasOwnProperty','service','custom','provider','box','bind','end','handleImapEnd','error','handleImapError','status','disabled','handleImapBox','connected','handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch'];(function(_0x4ac9ef,_0x10112e){var _0xa2c42e=function(_0x991829){while(--_0x991829){_0x4ac9ef['push'](_0x4ac9ef['shift']());}};_0xa2c42e(++_0x10112e);}(_0x9161,0x199));var _0x1916=function(_0x55af9c,_0x33bb0e){_0x55af9c=_0x55af9c-0x0;var _0x59d222=_0x9161[_0x55af9c];return _0x59d222;};'use strict';var _=require(_0x1916('0x0'));var moment=require('moment');var BPromise=require(_0x1916('0x1'));var md5=require('md5');var Redis=require(_0x1916('0x2'));var config=require(_0x1916('0x3'));var logger=require(_0x1916('0x4'))(_0x1916('0x5'));config[_0x1916('0x6')]=_[_0x1916('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1916('0x8'))(new Redis(config[_0x1916('0x6')]));var EmailImap=require(_0x1916('0x9'));var EmailSmtp=require(_0x1916('0xa'));var mailAccount=require(_0x1916('0xb'));var md5Accounts={};function EmailChannel(_0x12df74){logger['info']('start\x20email\x20channel');this[_0x1916('0xc')]=_0x12df74['mailAccounts'];this[_0x1916('0xd')]={};this[_0x1916('0xe')]=new EmailSmtp();}EmailChannel[_0x1916('0xf')][_0x1916('0x10')]=function(_0x33d4a0){var _0x38305d=this['mailAccounts'][_0x33d4a0];var _0x5a164b={'id':_0x38305d['id'],'name':_0x38305d[_0x1916('0x11')],'key':_0x38305d['key'],'active':_0x38305d[_0x1916('0x12')],'Imap':{'status':_0x38305d['Imap']['status'],'messageStatus':_0x38305d['Imap'][_0x1916('0x13')],'total':_0x38305d[_0x1916('0x14')][_0x1916('0x15')]}};if(_[_0x1916('0x16')](md5Accounts[_0x33d4a0])){md5Accounts[_0x33d4a0]={};}var _0x2b5596=md5(JSON['stringify'](_0x5a164b));if(md5Accounts[_0x33d4a0][_0x1916('0x17')]!==_0x2b5596){md5Accounts[_0x33d4a0]['md5']=_0x2b5596;io[_0x1916('0x10')](_0x1916('0x18'),_0x5a164b);}};EmailChannel[_0x1916('0xf')]['refresh']=function(_0x32aed2){for(var _0x2362b4 in _0x32aed2){if(_0x32aed2[_0x1916('0x19')](_0x2362b4)){if(_0x32aed2[_0x2362b4][_0x1916('0x14')]&&_0x32aed2[_0x2362b4][_0x1916('0x12')]){var _0x2351ca=_0x32aed2[_0x2362b4][_0x1916('0x14')];if(!_0x2351ca[_0x1916('0x1a')]&&_0x32aed2[_0x2362b4]['provider']!==_0x1916('0x1b'))_0x2351ca[_0x1916('0x1a')]=_0x32aed2[_0x2362b4][_0x1916('0x1c')];if(!this[_0x1916('0xd')]['hasOwnProperty'](_0x2351ca['id'])){this[_0x1916('0xd')][_0x2351ca['id']]=new EmailImap(_0x2351ca,_0x32aed2[_0x2362b4][_0x1916('0x5')]);this[_0x1916('0xd')][_0x2351ca['id']]['on'](_0x1916('0x1d'),this['handleImapBox'][_0x1916('0x1e')](this,_0x2362b4));this[_0x1916('0xd')][_0x2351ca['id']]['on'](_0x1916('0x5'),this['handleImapEmail'][_0x1916('0x1e')](this,_0x2362b4));this[_0x1916('0xd')][_0x2351ca['id']]['on'](_0x1916('0x1f'),this[_0x1916('0x20')][_0x1916('0x1e')](this,_0x2362b4));this['imapAccounts'][_0x2351ca['id']]['on'](_0x1916('0x21'),this[_0x1916('0x22')][_0x1916('0x1e')](this,_0x2362b4));}}else{if(_[_0x1916('0x16')](this[_0x1916('0xc')][_0x2362b4]['Imap'])){this[_0x1916('0xc')][_0x2362b4]['Imap']={};}this[_0x1916('0xc')][_0x2362b4][_0x1916('0x14')][_0x1916('0x23')]=_0x1916('0x24');this[_0x1916('0xc')][_0x2362b4][_0x1916('0x14')][_0x1916('0x13')]='';this[_0x1916('0x10')](_0x2362b4);}}}};EmailChannel[_0x1916('0xf')][_0x1916('0x25')]=function(_0x14470f,_0x571996){if(this[_0x1916('0xc')][_0x14470f]){this[_0x1916('0xc')][_0x14470f]['Imap']['status']=_0x1916('0x26');this[_0x1916('0xc')][_0x14470f][_0x1916('0x14')]['messageStatus']=_0x571996['name'];if(_0x571996['messages']){this[_0x1916('0xc')][_0x14470f][_0x1916('0x14')][_0x1916('0x15')]=_0x571996['messages'][_0x1916('0x15')];}return this['emit'](_0x14470f);}};EmailChannel[_0x1916('0xf')][_0x1916('0x27')]=function(_0xab76c6,_0xa8963b){logger[_0x1916('0x28')](_0x1916('0x29'),_0xa8963b[_0x1916('0x2a')],_0xa8963b[_0x1916('0x2b')],_0xa8963b[_0x1916('0x2c')],_0xab76c6);if(this[_0x1916('0xc')][_0xab76c6]){return mailAccount[_0x1916('0x2d')](_0xab76c6,_0xa8963b)['then'](function(_0x491cbb){if(_0x491cbb){logger[_0x1916('0x28')]('Mail\x20accepted\x20from\x20routing');}})[_0x1916('0x2e')](function(_0x5aaf19){logger[_0x1916('0x21')](_0x1916('0x2f'),JSON[_0x1916('0x30')](_0x5aaf19));});}};EmailChannel['prototype'][_0x1916('0x20')]=function(_0x1356c2){if(this['mailAccounts'][_0x1356c2]&&this['mailAccounts'][_0x1356c2]['Imap']){if(this[_0x1916('0xd')][this[_0x1916('0xc')][_0x1356c2]['Imap']['id']]){delete this[_0x1916('0xd')][this[_0x1916('0xc')][_0x1356c2][_0x1916('0x14')]['id']];}this[_0x1916('0xc')][_0x1356c2][_0x1916('0x14')]['lastSync']=moment();this['emit'](_0x1356c2);}};EmailChannel[_0x1916('0xf')][_0x1916('0x22')]=function(_0x28f6b8,_0x204aa2){if(this['mailAccounts'][_0x28f6b8]){this[_0x1916('0xc')][_0x28f6b8]['Imap'][_0x1916('0x23')]=_0x1916('0x21');this['mailAccounts'][_0x28f6b8]['Imap']['messageStatus']=_0x204aa2;return this['emit'](_0x28f6b8);}};EmailChannel['prototype'][_0x1916('0x31')]=function(_0x554e86,_0x24a090){return this[_0x1916('0xe')][_0x1916('0x32')](_0x554e86,_0x24a090);};EmailChannel[_0x1916('0xf')]['verifySmtp']=function(_0xee8c6c){var _0x191652=this;if(this['mailAccounts'][_0xee8c6c['id']]){if(_[_0x1916('0x16')](this[_0x1916('0xc')][_0xee8c6c['id']][_0x1916('0x33')])){this[_0x1916('0xc')][_0xee8c6c['id']]['Smtp']={};}this['mailAccounts'][_0xee8c6c['id']][_0x1916('0x33')][_0x1916('0x34')]=moment();return new BPromise(function(_0x4aa715,_0x45b3d8){return _0x191652['smtp'][_0x1916('0x35')](_0xee8c6c)[_0x1916('0x36')](function(_0x5a755d){_0x191652['mailAccounts'][_0xee8c6c['id']]['Smtp'][_0x1916('0x23')]=_0x1916('0x37');_0x191652[_0x1916('0xc')][_0xee8c6c['id']][_0x1916('0x33')][_0x1916('0x13')]='';_0x191652[_0x1916('0x10')](_0xee8c6c['id']);_0x4aa715(_0x5a755d);})[_0x1916('0x2e')](function(_0x58d6bc){_0x191652['mailAccounts'][_0xee8c6c['id']][_0x1916('0x33')][_0x1916('0x23')]=_0x1916('0x21');_0x191652[_0x1916('0xc')][_0xee8c6c['id']][_0x1916('0x33')][_0x1916('0x13')]=_0x58d6bc;_0x191652[_0x1916('0x10')](_0xee8c6c['id']);_0x45b3d8(_0x58d6bc);});});}return this[_0x1916('0xe')][_0x1916('0x35')](_0xee8c6c);};module[_0x1916('0x38')]=EmailChannel; \ No newline at end of file +var _0xe255=['mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','service','provider','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','handleImapError','isNil','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','../rpc/mailAccount','info','start\x20email\x20channel'];(function(_0x1d63d8,_0x3ec6ec){var _0x534135=function(_0x1e9f64){while(--_0x1e9f64){_0x1d63d8['push'](_0x1d63d8['shift']());}};_0x534135(++_0x3ec6ec);}(_0xe255,0xa3));var _0x5e25=function(_0x34b071,_0x415c5b){_0x34b071=_0x34b071-0x0;var _0x1b391d=_0xe255[_0x34b071];return _0x1b391d;};'use strict';var _=require(_0x5e25('0x0'));var moment=require('moment');var BPromise=require(_0x5e25('0x1'));var md5=require(_0x5e25('0x2'));var Redis=require(_0x5e25('0x3'));var config=require(_0x5e25('0x4'));var logger=require(_0x5e25('0x5'))(_0x5e25('0x6'));config[_0x5e25('0x7')]=_[_0x5e25('0x8')](config[_0x5e25('0x7')],{'host':_0x5e25('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e25('0x7')]));var EmailImap=require(_0x5e25('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5e25('0xb'));var md5Accounts={};function EmailChannel(_0x6528f2){logger[_0x5e25('0xc')](_0x5e25('0xd'));this[_0x5e25('0xe')]=_0x6528f2[_0x5e25('0xe')];this[_0x5e25('0xf')]={};this[_0x5e25('0x10')]=new EmailSmtp();}EmailChannel[_0x5e25('0x11')][_0x5e25('0x12')]=function(_0x220c46){var _0x42375b=this['mailAccounts'][_0x220c46];var _0x462696={'id':_0x42375b['id'],'name':_0x42375b[_0x5e25('0x13')],'key':_0x42375b[_0x5e25('0x14')],'active':_0x42375b[_0x5e25('0x15')],'Imap':{'status':_0x42375b[_0x5e25('0x16')][_0x5e25('0x17')],'messageStatus':_0x42375b[_0x5e25('0x16')][_0x5e25('0x18')],'total':_0x42375b[_0x5e25('0x16')][_0x5e25('0x19')]}};if(_['isNil'](md5Accounts[_0x220c46])){md5Accounts[_0x220c46]={};}var _0x529c27=md5(JSON['stringify'](_0x462696));if(md5Accounts[_0x220c46][_0x5e25('0x2')]!==_0x529c27){md5Accounts[_0x220c46][_0x5e25('0x2')]=_0x529c27;io[_0x5e25('0x12')](_0x5e25('0x1a'),_0x462696);}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x1b')]=function(_0x2a7d7e){for(var _0x19c953 in _0x2a7d7e){if(_0x2a7d7e['hasOwnProperty'](_0x19c953)){if(_0x2a7d7e[_0x19c953][_0x5e25('0x16')]&&_0x2a7d7e[_0x19c953][_0x5e25('0x15')]){var _0x5d346d=_0x2a7d7e[_0x19c953]['Imap'];if(!_0x5d346d[_0x5e25('0x1c')]&&_0x2a7d7e[_0x19c953][_0x5e25('0x1d')]!=='custom')_0x5d346d['service']=_0x2a7d7e[_0x19c953][_0x5e25('0x1d')];if(!this[_0x5e25('0xf')][_0x5e25('0x1e')](_0x5d346d['id'])){this[_0x5e25('0xf')][_0x5d346d['id']]=new EmailImap(_0x5d346d,_0x2a7d7e[_0x19c953][_0x5e25('0x6')]);this[_0x5e25('0xf')][_0x5d346d['id']]['on'](_0x5e25('0x1f'),this[_0x5e25('0x20')]['bind'](this,_0x19c953));this[_0x5e25('0xf')][_0x5d346d['id']]['on'](_0x5e25('0x6'),this[_0x5e25('0x21')][_0x5e25('0x22')](this,_0x19c953));this['imapAccounts'][_0x5d346d['id']]['on'](_0x5e25('0x23'),this[_0x5e25('0x24')][_0x5e25('0x22')](this,_0x19c953));this[_0x5e25('0xf')][_0x5d346d['id']]['on']('error',this[_0x5e25('0x25')]['bind'](this,_0x19c953));}}else{if(_[_0x5e25('0x26')](this[_0x5e25('0xe')][_0x19c953]['Imap'])){this['mailAccounts'][_0x19c953][_0x5e25('0x16')]={};}this[_0x5e25('0xe')][_0x19c953][_0x5e25('0x16')][_0x5e25('0x17')]='disabled';this[_0x5e25('0xe')][_0x19c953][_0x5e25('0x16')][_0x5e25('0x18')]='';this[_0x5e25('0x12')](_0x19c953);}}}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x20')]=function(_0x4c0599,_0x18a692){if(this[_0x5e25('0xe')][_0x4c0599]){this[_0x5e25('0xe')][_0x4c0599][_0x5e25('0x16')][_0x5e25('0x17')]=_0x5e25('0x27');this[_0x5e25('0xe')][_0x4c0599][_0x5e25('0x16')][_0x5e25('0x18')]=_0x18a692[_0x5e25('0x13')];if(_0x18a692[_0x5e25('0x28')]){this[_0x5e25('0xe')][_0x4c0599]['Imap'][_0x5e25('0x19')]=_0x18a692[_0x5e25('0x28')][_0x5e25('0x19')];}return this['emit'](_0x4c0599);}};EmailChannel['prototype'][_0x5e25('0x21')]=function(_0x32484e,_0x48b05f){logger[_0x5e25('0xc')](_0x5e25('0x29'),_0x48b05f[_0x5e25('0x2a')],_0x48b05f[_0x5e25('0x2b')],_0x48b05f['from'],_0x32484e);if(this['mailAccounts'][_0x32484e]){return mailAccount[_0x5e25('0x2c')](_0x32484e,_0x48b05f)[_0x5e25('0x2d')](function(_0x3191c5){if(_0x3191c5){logger[_0x5e25('0xc')](_0x5e25('0x2e'));}})[_0x5e25('0x2f')](function(_0x39c21c){logger[_0x5e25('0x30')](_0x5e25('0x31'),JSON[_0x5e25('0x32')](_0x39c21c));});}};EmailChannel[_0x5e25('0x11')]['handleImapEnd']=function(_0x308e0a){if(this[_0x5e25('0xe')][_0x308e0a]&&this['mailAccounts'][_0x308e0a]['Imap']){if(this[_0x5e25('0xf')][this['mailAccounts'][_0x308e0a][_0x5e25('0x16')]['id']]){delete this[_0x5e25('0xf')][this[_0x5e25('0xe')][_0x308e0a][_0x5e25('0x16')]['id']];}this[_0x5e25('0xe')][_0x308e0a][_0x5e25('0x16')][_0x5e25('0x33')]=moment();this[_0x5e25('0x12')](_0x308e0a);}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x25')]=function(_0x298071,_0x109083){if(this['mailAccounts'][_0x298071]){this[_0x5e25('0xe')][_0x298071][_0x5e25('0x16')]['status']='error';this[_0x5e25('0xe')][_0x298071][_0x5e25('0x16')][_0x5e25('0x18')]=_0x109083;return this[_0x5e25('0x12')](_0x298071);}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x34')]=function(_0x48b871,_0xa9fb51){return this[_0x5e25('0x10')][_0x5e25('0x35')](_0x48b871,_0xa9fb51);};EmailChannel[_0x5e25('0x11')][_0x5e25('0x36')]=function(_0x525699){var _0x564638=this;if(this[_0x5e25('0xe')][_0x525699['id']]){if(_[_0x5e25('0x26')](this[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')])){this[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')]={};}this[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')][_0x5e25('0x33')]=moment();return new BPromise(function(_0x290106,_0x4ecbbe){return _0x564638[_0x5e25('0x10')][_0x5e25('0x38')](_0x525699)[_0x5e25('0x2d')](function(_0x58cf90){_0x564638[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')]['status']=_0x5e25('0x39');_0x564638[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')][_0x5e25('0x18')]='';_0x564638[_0x5e25('0x12')](_0x525699['id']);_0x290106(_0x58cf90);})['catch'](function(_0x16a377){_0x564638['mailAccounts'][_0x525699['id']][_0x5e25('0x37')][_0x5e25('0x17')]='error';_0x564638['mailAccounts'][_0x525699['id']]['Smtp'][_0x5e25('0x18')]=_0x16a377;_0x564638['emit'](_0x525699['id']);_0x4ecbbe(_0x16a377);});});}return this[_0x5e25('0x10')]['verify'](_0x525699);};module[_0x5e25('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index a19d598..370f545 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffd6=['autotls','required','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','closeBox','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls'];(function(_0x20c47c,_0x443272){var _0x1cfcd7=function(_0x144ced){while(--_0x144ced){_0x20c47c['push'](_0x20c47c['shift']());}};_0x1cfcd7(++_0x443272);}(_0xffd6,0x1d4));var _0x6ffd=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xffd6[_0x220afa];return _0x1b79d1;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var Imap=require(_0x6ffd('0x2'));var simpleParser=require(_0x6ffd('0x3'))[_0x6ffd('0x4')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x6ffd('0x5'))[_0x6ffd('0x6')];var utils=require(_0x6ffd('0x7'));var logger=require('../../../config/logger')(_0x6ffd('0x8'));function EmailImap(_0x4d20df,_0x86546d){this[_0x6ffd('0x9')]=_0x4d20df[_0x6ffd('0x9')];this[_0x6ffd('0xa')]=this[_0x6ffd('0xb')](_0x4d20df,_0x86546d);this[_0x6ffd('0x2')]=new Imap(this[_0x6ffd('0xa')]);this['imap'][_0x6ffd('0xc')]('ready',this[_0x6ffd('0xd')]['bind'](this));this[_0x6ffd('0x2')][_0x6ffd('0xc')](_0x6ffd('0xe'),this[_0x6ffd('0xf')][_0x6ffd('0x10')](this));this['imap']['on'](_0x6ffd('0x11'),this[_0x6ffd('0x12')][_0x6ffd('0x10')](this));this[_0x6ffd('0x2')][_0x6ffd('0x13')]();}util[_0x6ffd('0x14')](EmailImap,EventEmitter);EmailImap[_0x6ffd('0x15')][_0x6ffd('0xb')]=function(_0x5e0098,_0x23a0e3){var _0x150b03={'connTimeout':_0x5e0098[_0x6ffd('0x16')]?_0x5e0098[_0x6ffd('0x16')]*0x3e8:0x2710,'authTimeout':_0x5e0098[_0x6ffd('0x17')]?_0x5e0098[_0x6ffd('0x17')]*0x3e8:0x1388};if(_0x5e0098[_0x6ffd('0x18')]){_0x150b03[_0x6ffd('0x19')]=_0x5e0098['user'];if(_0x5e0098[_0x6ffd('0x1a')]){_0x150b03['xoauth2']=utils[_0x6ffd('0x1b')](_0x5e0098[_0x6ffd('0x1c')][_0x6ffd('0x1d')],_0x5e0098[_0x6ffd('0x19')]);}else{_0x150b03[_0x6ffd('0x1e')]=_0x5e0098[_0x6ffd('0x1e')];}}else{if(_0x5e0098[_0x6ffd('0x1f')]){_0x150b03[_0x6ffd('0x19')]=_0x5e0098['user'];_0x150b03[_0x6ffd('0x1e')]=_0x5e0098[_0x6ffd('0x1e')];}}_0x150b03[_0x6ffd('0x8')]=_0x23a0e3||_0x5e0098[_0x6ffd('0x19')]||_0x6ffd('0x20');_0x150b03[_0x6ffd('0x21')]=_0x5e0098[_0x6ffd('0x21')];_0x150b03[_0x6ffd('0x22')]=_0x5e0098['port']||0x3e1;if(_0x5e0098[_0x6ffd('0x23')]){_0x150b03[_0x6ffd('0x23')]=!![];}else{_0x150b03[_0x6ffd('0x23')]=![];_0x150b03[_0x6ffd('0x24')]=_0x6ffd('0x25');}return _0x150b03;};EmailImap[_0x6ffd('0x15')]['handleReady']=function(){this[_0x6ffd('0x2')][_0x6ffd('0x26')](this[_0x6ffd('0x9')],![],this[_0x6ffd('0x27')][_0x6ffd('0x10')](this));};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x27')]=function(_0x5ebb3b,_0x58fbd3){if(_0x5ebb3b){this[_0x6ffd('0x12')](_0x5ebb3b,!![]);}else{this[_0x6ffd('0x28')]('box',_0x58fbd3);this[_0x6ffd('0x29')]();}};EmailImap['prototype'][_0x6ffd('0x2a')]=function(_0x39581f){if(_0x39581f){this[_0x6ffd('0x12')](_0x39581f,!![]);}else{this[_0x6ffd('0x2')]['end']();}};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x29')]=function(){this[_0x6ffd('0x2')]['search']([_0x6ffd('0x2b')],this[_0x6ffd('0x2c')][_0x6ffd('0x10')](this));};EmailImap[_0x6ffd('0x15')]['handleReadUnseen']=function(_0x1ccd82,_0x24e978){if(_0x1ccd82){this[_0x6ffd('0x12')](_0x1ccd82,!![]);}else{if(_0x24e978[_0x6ffd('0x2d')]){try{var _0x25e105=this['imap'][_0x6ffd('0x2e')](_0x24e978,{'bodies':'','markSeen':!![]});_0x25e105['on'](_0x6ffd('0x2f'),this[_0x6ffd('0x30')]['bind'](this));_0x25e105['once'](_0x6ffd('0x11'),this['handleFetchError']['bind'](this));_0x25e105[_0x6ffd('0xc')](_0x6ffd('0xe'),this[_0x6ffd('0x31')][_0x6ffd('0x10')](this));}catch(_0x224b71){logger[_0x6ffd('0x11')](_0x224b71);}}else{this[_0x6ffd('0x2')]['closeBox'](!![],this[_0x6ffd('0x2a')][_0x6ffd('0x10')](this));}}};EmailImap['prototype'][_0x6ffd('0x30')]=function(_0x1629bb){_0x1629bb['on'](_0x6ffd('0x32'),this[_0x6ffd('0x33')][_0x6ffd('0x10')](this));_0x1629bb[_0x6ffd('0xc')](_0x6ffd('0x34'),this['handleMessageAttributes'][_0x6ffd('0x10')](this));_0x1629bb[_0x6ffd('0xc')](_0x6ffd('0xe'),this[_0x6ffd('0x35')]['bind'](this));};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x33')]=function(_0xd355f4){simpleParser(_0xd355f4,{'Iconv':Iconv},this[_0x6ffd('0x36')]['bind'](this));};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x37')]=function(){};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x35')]=function(){};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x36')]=function(_0x1790e9,_0x2dbcf1){if(_0x1790e9){logger[_0x6ffd('0x11')](_0x1790e9);}else{var _0x301e19=this;utils['parser'](this['account'],_0x2dbcf1,function(_0x29d2b7){_0x301e19[_0x6ffd('0x28')](_0x6ffd('0x8'),_0x29d2b7);});}};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x31')]=function(){this[_0x6ffd('0x2')][_0x6ffd('0x38')](!![],this[_0x6ffd('0x2a')][_0x6ffd('0x10')](this));};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x39')]=function(_0x54dd97){this['handleError'](_0x54dd97);this[_0x6ffd('0x2')][_0x6ffd('0x38')](!![],this[_0x6ffd('0x2a')]['bind'](this));};EmailImap[_0x6ffd('0x15')][_0x6ffd('0xf')]=function(){this[_0x6ffd('0x28')](_0x6ffd('0xe'));};EmailImap[_0x6ffd('0x15')][_0x6ffd('0x12')]=function(_0x3e55bc,_0x4b02ae){logger[_0x6ffd('0x11')](_0x6ffd('0x12'),this[_0x6ffd('0xa')][_0x6ffd('0x8')],JSON[_0x6ffd('0x3a')](_0x3e55bc));var _0x1c1053='';if(_0x3e55bc){if(_0x3e55bc[_0x6ffd('0x3b')]){_0x1c1053=_0x3e55bc[_0x6ffd('0x3b')];}else{for(var _0x3a926c in _0x3e55bc){if(_0x3e55bc[_0x6ffd('0x3c')](_0x3a926c)){_0x1c1053+=_[_0x6ffd('0x3d')](_0x3a926c)+':\x20'+_0x3e55bc[_0x3a926c]+'\x0a';}}}}if(_0x4b02ae){this[_0x6ffd('0x2')][_0x6ffd('0xe')]();}else{this['emit'](_0x6ffd('0x11'),_0x1c1053);this[_0x6ffd('0x28')](_0x6ffd('0xe'));}};module[_0x6ffd('0x3e')]=EmailImap; \ No newline at end of file +var _0xddfc=['authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','port','tls','autotls','required','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','handleReadUnseen','length','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','error','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','util','imap','mailparser','iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','end','handleError','bind','connect','inherits','prototype','connTimeout'];(function(_0x54c10d,_0x2f2251){var _0x1fa703=function(_0x508eb4){while(--_0x508eb4){_0x54c10d['push'](_0x54c10d['shift']());}};_0x1fa703(++_0x2f2251);}(_0xddfc,0x1bb));var _0xcddf=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xddfc[_0xbd08b4];return _0x314f1e;};'use strict';var _=require('lodash');var util=require(_0xcddf('0x0'));var Imap=require(_0xcddf('0x1'));var simpleParser=require(_0xcddf('0x2'))['simpleParser'];var Iconv=require(_0xcddf('0x3'))['Iconv'];var EventEmitter=require(_0xcddf('0x4'))[_0xcddf('0x5')];var utils=require(_0xcddf('0x6'));var logger=require('../../../config/logger')(_0xcddf('0x7'));function EmailImap(_0x5bef1f,_0x6adc39){this['mailbox']=_0x5bef1f[_0xcddf('0x8')];this[_0xcddf('0x9')]=this[_0xcddf('0xa')](_0x5bef1f,_0x6adc39);this[_0xcddf('0x1')]=new Imap(this['account']);this[_0xcddf('0x1')][_0xcddf('0xb')](_0xcddf('0xc'),this[_0xcddf('0xd')]['bind'](this));this[_0xcddf('0x1')]['once'](_0xcddf('0xe'),this['handleEnd']['bind'](this));this[_0xcddf('0x1')]['on']('error',this[_0xcddf('0xf')][_0xcddf('0x10')](this));this[_0xcddf('0x1')][_0xcddf('0x11')]();}util[_0xcddf('0x12')](EmailImap,EventEmitter);EmailImap[_0xcddf('0x13')][_0xcddf('0xa')]=function(_0x5eb584,_0x2ce24b){var _0x4a7a3c={'connTimeout':_0x5eb584[_0xcddf('0x14')]?_0x5eb584[_0xcddf('0x14')]*0x3e8:0x2710,'authTimeout':_0x5eb584[_0xcddf('0x15')]?_0x5eb584['authTimeout']*0x3e8:0x1388};if(_0x5eb584[_0xcddf('0x16')]){_0x4a7a3c[_0xcddf('0x17')]=_0x5eb584['user'];if(_0x5eb584[_0xcddf('0x18')]){_0x4a7a3c[_0xcddf('0x19')]=utils[_0xcddf('0x1a')](_0x5eb584['CloudProvider'][_0xcddf('0x1b')],_0x5eb584[_0xcddf('0x17')]);}else{_0x4a7a3c[_0xcddf('0x1c')]=_0x5eb584[_0xcddf('0x1c')];}}else{if(_0x5eb584['authentication']){_0x4a7a3c['user']=_0x5eb584['user'];_0x4a7a3c['password']=_0x5eb584[_0xcddf('0x1c')];}}_0x4a7a3c[_0xcddf('0x7')]=_0x2ce24b||_0x5eb584['user']||'anonymous@xcally.com';_0x4a7a3c['host']=_0x5eb584['host'];_0x4a7a3c[_0xcddf('0x1d')]=_0x5eb584[_0xcddf('0x1d')]||0x3e1;if(_0x5eb584[_0xcddf('0x1e')]){_0x4a7a3c[_0xcddf('0x1e')]=!![];}else{_0x4a7a3c[_0xcddf('0x1e')]=![];_0x4a7a3c[_0xcddf('0x1f')]=_0xcddf('0x20');}return _0x4a7a3c;};EmailImap[_0xcddf('0x13')]['handleReady']=function(){this['imap'][_0xcddf('0x21')](this['mailbox'],![],this[_0xcddf('0x22')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')][_0xcddf('0x22')]=function(_0x143613,_0x2270ea){if(_0x143613){this['handleError'](_0x143613,!![]);}else{this[_0xcddf('0x23')](_0xcddf('0x24'),_0x2270ea);this['readUnseen']();}};EmailImap[_0xcddf('0x13')][_0xcddf('0x25')]=function(_0x1fb546){if(_0x1fb546){this['handleError'](_0x1fb546,!![]);}else{this['imap'][_0xcddf('0xe')]();}};EmailImap['prototype'][_0xcddf('0x26')]=function(){this[_0xcddf('0x1')]['search'](['UNSEEN'],this[_0xcddf('0x27')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')]['handleReadUnseen']=function(_0x184b4e,_0xfb50f5){if(_0x184b4e){this[_0xcddf('0xf')](_0x184b4e,!![]);}else{if(_0xfb50f5[_0xcddf('0x28')]){try{var _0x5724e1=this[_0xcddf('0x1')]['fetch'](_0xfb50f5,{'bodies':'','markSeen':!![]});_0x5724e1['on'](_0xcddf('0x29'),this[_0xcddf('0x2a')][_0xcddf('0x10')](this));_0x5724e1['once']('error',this['handleFetchError'][_0xcddf('0x10')](this));_0x5724e1[_0xcddf('0xb')](_0xcddf('0xe'),this[_0xcddf('0x2b')][_0xcddf('0x10')](this));}catch(_0x50b2cf){logger['error'](_0x50b2cf);}}else{this['imap'][_0xcddf('0x2c')](!![],this[_0xcddf('0x25')]['bind'](this));}}};EmailImap[_0xcddf('0x13')][_0xcddf('0x2a')]=function(_0x4658b6){_0x4658b6['on'](_0xcddf('0x2d'),this[_0xcddf('0x2e')]['bind'](this));_0x4658b6['once'](_0xcddf('0x2f'),this[_0xcddf('0x30')][_0xcddf('0x10')](this));_0x4658b6[_0xcddf('0xb')](_0xcddf('0xe'),this[_0xcddf('0x31')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')]['handleMessageBody']=function(_0x3fa8c4){simpleParser(_0x3fa8c4,{'Iconv':Iconv},this[_0xcddf('0x32')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')][_0xcddf('0x30')]=function(){};EmailImap['prototype'][_0xcddf('0x31')]=function(){};EmailImap[_0xcddf('0x13')][_0xcddf('0x32')]=function(_0x2dc03d,_0x1c52ac){if(_0x2dc03d){logger[_0xcddf('0x33')](_0x2dc03d);}else{var _0x1aad06=this;utils[_0xcddf('0x34')](this[_0xcddf('0x9')],_0x1c52ac,function(_0x3a9600){_0x1aad06[_0xcddf('0x23')]('email',_0x3a9600);});}};EmailImap[_0xcddf('0x13')]['handleFetchEnd']=function(){this[_0xcddf('0x1')][_0xcddf('0x2c')](!![],this[_0xcddf('0x25')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')]['handleFetchError']=function(_0x44b46f){this[_0xcddf('0xf')](_0x44b46f);this[_0xcddf('0x1')][_0xcddf('0x2c')](!![],this['handleCloseBox'][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')][_0xcddf('0x35')]=function(){this[_0xcddf('0x23')](_0xcddf('0xe'));};EmailImap[_0xcddf('0x13')][_0xcddf('0xf')]=function(_0x2125fe,_0x556df4){logger['error']('handleError',this[_0xcddf('0x9')]['email'],JSON[_0xcddf('0x36')](_0x2125fe));var _0x44be13='';if(_0x2125fe){if(_0x2125fe[_0xcddf('0x37')]){_0x44be13=_0x2125fe[_0xcddf('0x37')];}else{for(var _0x4a49f9 in _0x2125fe){if(_0x2125fe[_0xcddf('0x38')](_0x4a49f9)){_0x44be13+=_[_0xcddf('0x39')](_0x4a49f9)+':\x20'+_0x2125fe[_0x4a49f9]+'\x0a';}}}}if(_0x556df4){this[_0xcddf('0x1')][_0xcddf('0xe')]();}else{this['emit'](_0xcddf('0x33'),_0x44be13);this[_0xcddf('0x23')](_0xcddf('0xe'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 3d80e8f..f5f02bd 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccd5=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString'];(function(_0x29b188,_0x3d9882){var _0x52262b=function(_0x1663b1){while(--_0x1663b1){_0x29b188['push'](_0x29b188['shift']());}};_0x52262b(++_0x3d9882);}(_0xccd5,0x1f2));var _0x5ccd=function(_0x2b9c5a,_0x52f3e7){_0x2b9c5a=_0x2b9c5a-0x0;var _0x2e0b2b=_0xccd5[_0x2b9c5a];return _0x2e0b2b;};'use strict';var nodemailer=require(_0x5ccd('0x0'));var inlineBase64=require(_0x5ccd('0x1'));function EmailSmtp(){}EmailSmtp[_0x5ccd('0x2')][_0x5ccd('0x3')]=function(_0x14ae95,_0x24ff0d){return new Promise(function(_0x277fb9,_0x5ab22c){var _0x53ed50=nodemailer[_0x5ccd('0x4')](_0x14ae95);_0x53ed50['use'](_0x5ccd('0x5'),inlineBase64());_0x53ed50[_0x5ccd('0x6')](_0x24ff0d,function(_0x2b79bf,_0x204576){if(_0x2b79bf){_0x5ab22c(_0x2b79bf[_0x5ccd('0x7')]());}else{_0x277fb9(_0x204576);}});});};EmailSmtp['prototype'][_0x5ccd('0x8')]=function(_0xabfccd){return new Promise(function(_0x16d0e1,_0x82decd){var _0x3c674f=nodemailer[_0x5ccd('0x4')](_0xabfccd);_0x3c674f[_0x5ccd('0x8')](function(_0x14ae5f,_0x17d448){if(_0x14ae5f){_0x82decd(_0x14ae5f[_0x5ccd('0x7')]());}else{if(_0x17d448){_0x16d0e1(_0x17d448);}else{_0x82decd(_0x5ccd('0x9'));}}});});};module[_0x5ccd('0xa')]=EmailSmtp; \ No newline at end of file +var _0xc88c=['createTransport','use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x45ec0b,_0x260c5d){var _0x99a3d8=function(_0x524391){while(--_0x524391){_0x45ec0b['push'](_0x45ec0b['shift']());}};_0x99a3d8(++_0x260c5d);}(_0xc88c,0x1e7));var _0xcc88=function(_0x252a7b,_0x33bf97){_0x252a7b=_0x252a7b-0x0;var _0x1d1c3d=_0xc88c[_0x252a7b];return _0x1d1c3d;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xcc88('0x0'));function EmailSmtp(){}EmailSmtp[_0xcc88('0x1')][_0xcc88('0x2')]=function(_0x651a26,_0x5dea5b){return new Promise(function(_0x3ea05e,_0x30cb20){var _0x36177f=nodemailer[_0xcc88('0x3')](_0x651a26);_0x36177f[_0xcc88('0x4')]('compile',inlineBase64());_0x36177f[_0xcc88('0x5')](_0x5dea5b,function(_0x5a4c73,_0x33a2c7){if(_0x5a4c73){_0x30cb20(_0x5a4c73[_0xcc88('0x6')]());}else{_0x3ea05e(_0x33a2c7);}});});};EmailSmtp[_0xcc88('0x1')][_0xcc88('0x7')]=function(_0x362d93){return new Promise(function(_0x1f2dab,_0x4ecbf0){var _0x237837=nodemailer['createTransport'](_0x362d93);_0x237837[_0xcc88('0x7')](function(_0x5571f2,_0x42d4e2){if(_0x5571f2){_0x4ecbf0(_0x5571f2[_0xcc88('0x6')]());}else{if(_0x42d4e2){_0x1f2dab(_0x42d4e2);}else{_0x4ecbf0(_0xcc88('0x8'));}}});});};module[_0xcc88('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c2625c8..cd0215c 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe77=['format','filter','application/ms-tnef','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','node-tnef','../../../config/environment','head','address','generate','@xcally.com','value','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','includes','attachments','forEach','filename','replace','_IMG','\x20]','body','textAsHtml','message','originTo','email','originCc','bcc','type','attachment','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date'];(function(_0x37dd9d,_0x317c54){var _0x33ec83=function(_0x243af0){while(--_0x243af0){_0x37dd9d['push'](_0x37dd9d['shift']());}};_0x33ec83(++_0x317c54);}(_0xfe77,0x133));var _0x7fe7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe77[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fe7('0x0'));var moment=require(_0x7fe7('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x7fe7('0x2'));var util=require(_0x7fe7('0x3'));var tnef=require(_0x7fe7('0x4'));var logger=require('../../../config/logger')('email');var config=require(_0x7fe7('0x5'));function getAddress(_0x30adc1){var _0x395f41=_[_0x7fe7('0x6')](_0x30adc1['value']);return _0x395f41&&_0x395f41[_0x7fe7('0x7')]?_0x395f41['address']:'anonymous'+random[_0x7fe7('0x8')](0x6)+_0x7fe7('0x9');}function getFirstName(_0x4b3d64){var _0x41992f=_[_0x7fe7('0x6')](_0x4b3d64[_0x7fe7('0xa')]);if(_0x41992f&&_0x41992f[_0x7fe7('0xb')]){if(_0x41992f[_0x7fe7('0xb')]==_0x41992f[_0x7fe7('0x7')]){return _0x41992f[_0x7fe7('0xb')]['substring'](0x0,_0x41992f[_0x7fe7('0xb')][_0x7fe7('0xc')]('@'));}var _0x5e3892=_0x41992f[_0x7fe7('0xb')][_0x7fe7('0xd')](/\s+/);return _0x5e3892[_0x7fe7('0xe')]>0x1?_0x5e3892[_0x7fe7('0xf')](0x0,-0x1)[_0x7fe7('0x10')]('\x20'):_0x41992f['name'];}return _0x7fe7('0x11');}function getLastName(_0x429b45){var _0x7952bf=_[_0x7fe7('0x6')](_0x429b45[_0x7fe7('0xa')]);if(_0x7952bf&&_0x7952bf[_0x7fe7('0xb')]){var _0x54530f=_0x7952bf['name'][_0x7fe7('0xd')](/\s+/);return _0x54530f[_0x7fe7('0xe')]>0x1?_0x54530f[_0x7fe7('0x12')]():'';}return'';}function getMails(_0x479b80,_0x38e712){var _0x2e7c64='';for(var _0xa410e0=0x0;_0xa410e0<_0x38e712[_0x7fe7('0xa')]['length'];_0xa410e0+=0x1){if(_0x38e712[_0x7fe7('0xa')][_0xa410e0][_0x7fe7('0x7')]!==_0x479b80){if(!_[_0x7fe7('0x13')](_0x2e7c64)){_0x2e7c64+=',';}_0x2e7c64+=_0x38e712[_0x7fe7('0xa')][_0xa410e0][_0x7fe7('0xb')]||_0x38e712['value'][_0xa410e0]['address']||'';_0x2e7c64+='\x20<';_0x2e7c64+=_0x38e712[_0x7fe7('0xa')][_0xa410e0][_0x7fe7('0x7')]?_0x38e712['value'][_0xa410e0][_0x7fe7('0x7')]:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x2e7c64+='>';}}return _0x2e7c64;}function parseEmail(_0x50d1d4,_0x335cdb,_0xf6f15){if(_0x335cdb[_0x7fe7('0x14')]){var _0x23e99b=/)<[^<]*)*<\/script>/gi;while(_0x23e99b[_0x7fe7('0x15')](_0x335cdb[_0x7fe7('0x14')])){_0x335cdb[_0x7fe7('0x14')]=_0x335cdb[_0x7fe7('0x14')]['replace'](_0x23e99b,'');}if(_0x335cdb[_0x7fe7('0x14')][_0x7fe7('0x16')]('{_0x5a792f['push'](_0x255616[_0x7fe7('0x19')]);});var _0x39dc11=/]+>/g;var _0x458a75=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xbf5c16=_0x335cdb[_0x7fe7('0x14')]['replace'](_0x458a75,'_SRC');var _0x5e5a16=_0xbf5c16[_0x7fe7('0x1a')](_0x39dc11,'_IMG');for(let _0x2bb055=0x0;_0x2bb055<_0x5a792f['length'];_0x2bb055++){var _0x33bf9b=_0x5e5a16['replace'](_0x7fe7('0x1b'),'\x20[Attachment:\x20'+_0x5a792f[_0x2bb055]+_0x7fe7('0x1c'));_0x5e5a16=_0x33bf9b;}_0x335cdb['html']=_0x5e5a16;}_0xf6f15[_0x7fe7('0x1d')]=_0x335cdb[_0x7fe7('0x14')];}else{_0xf6f15[_0x7fe7('0x1d')]=_0x335cdb[_0x7fe7('0x1e')];}if(_0xf6f15['body']){_0xf6f15['body']=_0xf6f15[_0x7fe7('0x1d')][_0x7fe7('0x1a')](/0x0){var _0x53f102=[_0x7fe7('0x2f'),_0x7fe7('0x30'),_0x7fe7('0x31')];for(var _0x22ab2e=0x0;_0x22ab2e<_0x335cdb[_0x7fe7('0x2e')][_0x7fe7('0xe')];_0x22ab2e++){var _0x3bef8e=_[_0x7fe7('0xc')](_0x53f102,_0x335cdb[_0x7fe7('0x2e')][_0x22ab2e][_0x7fe7('0x32')]);if(_0x3bef8e>=0x0){_0xf6f15[_0x7fe7('0x33')]=!![];}}}return _0xf6f15;}exports[_0x7fe7('0x34')]=function(_0x57a8a6,_0x37565f,_0x1f2d66){var _0x21af6c={'from':getAddress(_0x37565f[_0x7fe7('0x35')]),'firstName':getFirstName(_0x37565f[_0x7fe7('0x35')]),'lastName':getLastName(_0x37565f[_0x7fe7('0x35')]),'mapKey':_0x7fe7('0x21'),'message':{'from':getMails(_0x57a8a6[_0x7fe7('0x21')],_0x37565f[_0x7fe7('0x35')]),'to':_0x57a8a6['email'],'cc':'','subject':_0x37565f[_0x7fe7('0x36')]||'','messageId':_0x37565f[_0x7fe7('0x37')],'inReplyTo':_0x37565f[_0x7fe7('0x38')],'sentAt':moment(_0x37565f[_0x7fe7('0x39')])[_0x7fe7('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x37565f[_0x7fe7('0x14')]&&!_0x37565f[_0x7fe7('0x1e')]){var _0x5e088a=_[_0x7fe7('0x3b')](_0x37565f[_0x7fe7('0x17')],{'contentType':_0x7fe7('0x3c')});if(_0x5e088a[_0x7fe7('0xe')]){logger['info'](util[_0x7fe7('0x3a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x37565f[_0x7fe7('0x37')]));tnef[_0x7fe7('0x3d')](_[_0x7fe7('0x3e')](_0x5e088a)[_0x7fe7('0x2b')],function(_0x2b0247,_0x365aaa){if(_0x365aaa){_0x37565f[_0x7fe7('0x14')]=_0x365aaa[_0x7fe7('0x3f')]||_0x7fe7('0x40');if(_0x365aaa[_0x7fe7('0x41')]){for(var _0x3863dd=0x0;_0x3863dd<_0x365aaa['Attachments'][_0x7fe7('0xe')];_0x3863dd++){var _0x3f751d=_0x365aaa['Attachments'][_0x3863dd];_0x21af6c['message'][_0x7fe7('0x17')]['push']({'filename':_0x3f751d[_0x7fe7('0x42')],'content':Buffer[_0x7fe7('0x35')](_0x3f751d[_0x7fe7('0x43')])});}}}_0x1f2d66(parseEmail(_0x57a8a6,_0x37565f,_0x21af6c));});}else{_0x37565f[_0x7fe7('0x14')]='

Empty\x20message

';_0x1f2d66(parseEmail(_0x57a8a6,_0x37565f,_0x21af6c));}}else{_0x1f2d66(parseEmail(_0x57a8a6,_0x37565f,_0x21af6c));}};exports['generateXOAuth2Token']=function(_0x21c89a,_0x151465){var _0x27b4ba=[_0x7fe7('0x44')+(_0x151465||''),_0x7fe7('0x45')+_0x21c89a,'',''];return Buffer[_0x7fe7('0x35')](_0x27b4ba['join'](''),_0x7fe7('0x46'))[_0x7fe7('0x47')](_0x7fe7('0x48'));}; \ No newline at end of file +var _0xf0dc=['name','indexOf','split','length','slice','join','anonymous','generate','html','test','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','from','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','@xcally.com'];(function(_0x523cd6,_0x242aa1){var _0x3e3484=function(_0x360c02){while(--_0x360c02){_0x523cd6['push'](_0x523cd6['shift']());}};_0x3e3484(++_0x242aa1);}(_0xf0dc,0x117));var _0xcf0d=function(_0x80e9f,_0x1e84eb){_0x80e9f=_0x80e9f-0x0;var _0x49befa=_0xf0dc[_0x80e9f];return _0x49befa;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xcf0d('0x0'));var util=require('util');var tnef=require(_0xcf0d('0x1'));var logger=require(_0xcf0d('0x2'))(_0xcf0d('0x3'));var config=require(_0xcf0d('0x4'));function getAddress(_0x45f23f){var _0x3373f5=_[_0xcf0d('0x5')](_0x45f23f[_0xcf0d('0x6')]);return _0x3373f5&&_0x3373f5[_0xcf0d('0x7')]?_0x3373f5[_0xcf0d('0x7')]:'anonymous'+random['generate'](0x6)+_0xcf0d('0x8');}function getFirstName(_0xe07844){var _0x598e7f=_[_0xcf0d('0x5')](_0xe07844['value']);if(_0x598e7f&&_0x598e7f['name']){if(_0x598e7f[_0xcf0d('0x9')]==_0x598e7f[_0xcf0d('0x7')]){return _0x598e7f[_0xcf0d('0x9')]['substring'](0x0,_0x598e7f['name'][_0xcf0d('0xa')]('@'));}var _0x2f79dc=_0x598e7f[_0xcf0d('0x9')][_0xcf0d('0xb')](/\s+/);return _0x2f79dc[_0xcf0d('0xc')]>0x1?_0x2f79dc[_0xcf0d('0xd')](0x0,-0x1)[_0xcf0d('0xe')]('\x20'):_0x598e7f[_0xcf0d('0x9')];}return'Anonymous';}function getLastName(_0x45342a){var _0x51d306=_[_0xcf0d('0x5')](_0x45342a[_0xcf0d('0x6')]);if(_0x51d306&&_0x51d306['name']){var _0x531990=_0x51d306[_0xcf0d('0x9')][_0xcf0d('0xb')](/\s+/);return _0x531990[_0xcf0d('0xc')]>0x1?_0x531990['pop']():'';}return'';}function getMails(_0x3a383c,_0x3bfc74){var _0x36405b='';for(var _0x21b7ec=0x0;_0x21b7ec<_0x3bfc74['value'][_0xcf0d('0xc')];_0x21b7ec+=0x1){if(_0x3bfc74['value'][_0x21b7ec][_0xcf0d('0x7')]!==_0x3a383c){if(!_['isEmpty'](_0x36405b)){_0x36405b+=',';}_0x36405b+=_0x3bfc74['value'][_0x21b7ec][_0xcf0d('0x9')]||_0x3bfc74['value'][_0x21b7ec]['address']||'';_0x36405b+='\x20<';_0x36405b+=_0x3bfc74[_0xcf0d('0x6')][_0x21b7ec]['address']?_0x3bfc74[_0xcf0d('0x6')][_0x21b7ec]['address']:_0xcf0d('0xf')+random[_0xcf0d('0x10')](0x6)+_0xcf0d('0x8');_0x36405b+='>';}}return _0x36405b;}function parseEmail(_0x1be55b,_0x36b964,_0x3f7fe4){if(_0x36b964[_0xcf0d('0x11')]){var _0x32400e=/)<[^<]*)*<\/script>/gi;while(_0x32400e[_0xcf0d('0x12')](_0x36b964['html'])){_0x36b964[_0xcf0d('0x11')]=_0x36b964[_0xcf0d('0x11')]['replace'](_0x32400e,'');}if(_0x36b964[_0xcf0d('0x11')][_0xcf0d('0x13')](_0xcf0d('0x14'))){var _0x225940=[];_0x36b964[_0xcf0d('0x15')][_0xcf0d('0x16')](_0x576cd9=>{_0x225940[_0xcf0d('0x17')](_0x576cd9[_0xcf0d('0x18')]);});var _0x5eef7e=/]+>/g;var _0x521850=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x26227d=_0x36b964[_0xcf0d('0x11')][_0xcf0d('0x19')](_0x521850,_0xcf0d('0x1a'));var _0x9abafd=_0x26227d['replace'](_0x5eef7e,_0xcf0d('0x1b'));for(let _0x41a20b=0x0;_0x41a20b<_0x225940['length'];_0x41a20b++){var _0x13501a=_0x9abafd[_0xcf0d('0x19')]('_IMG',_0xcf0d('0x1c')+_0x225940[_0x41a20b]+_0xcf0d('0x1d'));_0x9abafd=_0x13501a;}_0x36b964[_0xcf0d('0x11')]=_0x9abafd;}_0x3f7fe4['body']=_0x36b964[_0xcf0d('0x11')];}else{_0x3f7fe4[_0xcf0d('0x1e')]=_0x36b964['textAsHtml'];}if(_0x3f7fe4[_0xcf0d('0x1e')]){_0x3f7fe4[_0xcf0d('0x1e')]=_0x3f7fe4['body'][_0xcf0d('0x19')](/0x0){var _0x2852b2=[_0xcf0d('0x31'),_0xcf0d('0x32'),'Precedence:\x20auto_reply'];for(var _0x2a42db=0x0;_0x2a42db<_0x36b964[_0xcf0d('0x30')]['length'];_0x2a42db++){var _0x3c3f22=_[_0xcf0d('0xa')](_0x2852b2,_0x36b964['headerLines'][_0x2a42db][_0xcf0d('0x33')]);if(_0x3c3f22>=0x0){_0x3f7fe4[_0xcf0d('0x34')]=!![];}}}return _0x3f7fe4;}exports['parser']=function(_0x50b847,_0x5907a3,_0x5e7133){var _0x112b7a={'from':getAddress(_0x5907a3['from']),'firstName':getFirstName(_0x5907a3['from']),'lastName':getLastName(_0x5907a3['from']),'mapKey':_0xcf0d('0x3'),'message':{'from':getMails(_0x50b847['email'],_0x5907a3['from']),'to':_0x50b847[_0xcf0d('0x3')],'cc':'','subject':_0x5907a3['subject']||'','messageId':_0x5907a3[_0xcf0d('0x35')],'inReplyTo':_0x5907a3[_0xcf0d('0x36')],'sentAt':moment(_0x5907a3[_0xcf0d('0x37')])[_0xcf0d('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x5907a3[_0xcf0d('0x11')]&&!_0x5907a3['textAsHtml']){var _0x1e4420=_['filter'](_0x5907a3['attachments'],{'contentType':'application/ms-tnef'});if(_0x1e4420[_0xcf0d('0xc')]){logger[_0xcf0d('0x38')](util[_0xcf0d('0x29')](_0xcf0d('0x39'),_0x5907a3['messageId']));tnef[_0xcf0d('0x3a')](_[_0xcf0d('0x3b')](_0x1e4420)[_0xcf0d('0x3c')],function(_0x332c05,_0x88a168){if(_0x88a168){_0x5907a3[_0xcf0d('0x11')]=_0x88a168[_0xcf0d('0x3d')]||_0xcf0d('0x3e');if(_0x88a168[_0xcf0d('0x3f')]){for(var _0x3bc187=0x0;_0x3bc187<_0x88a168[_0xcf0d('0x3f')][_0xcf0d('0xc')];_0x3bc187++){var _0x256ef1=_0x88a168[_0xcf0d('0x3f')][_0x3bc187];_0x112b7a['message'][_0xcf0d('0x15')]['push']({'filename':_0x256ef1['Title'],'content':Buffer[_0xcf0d('0x40')](_0x256ef1[_0xcf0d('0x41')])});}}}_0x5e7133(parseEmail(_0x50b847,_0x5907a3,_0x112b7a));});}else{_0x5907a3[_0xcf0d('0x11')]=_0xcf0d('0x3e');_0x5e7133(parseEmail(_0x50b847,_0x5907a3,_0x112b7a));}}else{_0x5e7133(parseEmail(_0x50b847,_0x5907a3,_0x112b7a));}};exports[_0xcf0d('0x42')]=function(_0xdcafc0,_0xbf625){var _0xaa1f36=[_0xcf0d('0x43')+(_0xbf625||''),_0xcf0d('0x44')+_0xdcafc0,'',''];return Buffer['from'](_0xaa1f36[_0xcf0d('0xe')](''),_0xcf0d('0x45'))[_0xcf0d('0x46')](_0xcf0d('0x47'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index edaaf42..eb96eab 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29f7=['Imap','Smtp','exports','lodash','name','key','SERV','active'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x29f7,0x1f3));var _0x729f=function(_0x594a50,_0x3d18a9){_0x594a50=_0x594a50-0x0;var _0x3953e1=_0x29f7[_0x594a50];return _0x3953e1;};'use strict';var _=require(_0x729f('0x0'));function MailAccount(_0x31cd24){this['id']=_0x31cd24['id']||0x0;this['name']=_0x31cd24[_0x729f('0x1')]||'Service';this[_0x729f('0x2')]=_0x31cd24[_0x729f('0x2')]||_0x729f('0x3');this[_0x729f('0x4')]=_0x31cd24['active']||![];this[_0x729f('0x5')]=_0x31cd24[_0x729f('0x5')]||[];this[_0x729f('0x6')]=_0x31cd24[_0x729f('0x6')]||[];}module[_0x729f('0x7')]=MailAccount; \ No newline at end of file +var _0xf7a8=['key','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x1d240a,_0x21c141){var _0x47c313=function(_0x4a4b00){while(--_0x4a4b00){_0x1d240a['push'](_0x1d240a['shift']());}};_0x47c313(++_0x21c141);}(_0xf7a8,0xa5));var _0x8f7a=function(_0x10dce4,_0x485f0f){_0x10dce4=_0x10dce4-0x0;var _0x2fb99c=_0xf7a8[_0x10dce4];return _0x2fb99c;};'use strict';var _=require(_0x8f7a('0x0'));function MailAccount(_0x3e2e27){this['id']=_0x3e2e27['id']||0x0;this[_0x8f7a('0x1')]=_0x3e2e27[_0x8f7a('0x1')]||_0x8f7a('0x2');this[_0x8f7a('0x3')]=_0x3e2e27[_0x8f7a('0x3')]||'SERV';this['active']=_0x3e2e27[_0x8f7a('0x4')]||![];this[_0x8f7a('0x5')]=_0x3e2e27[_0x8f7a('0x5')]||[];this[_0x8f7a('0x6')]=_0x3e2e27[_0x8f7a('0x6')]||[];}module[_0x8f7a('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 27450c4..4eb4c96 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cf7=['lodash','../model/mailAccount','mailAccounts','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports'];(function(_0xa4aa5e,_0x1540fc){var _0x4a05ca=function(_0x47ee80){while(--_0x47ee80){_0xa4aa5e['push'](_0xa4aa5e['shift']());}};_0x4a05ca(++_0x1540fc);}(_0x6cf7,0x1d6));var _0x76cf=function(_0x3dc55d,_0xd07e93){_0x3dc55d=_0x3dc55d-0x0;var _0x3aa7f3=_0x6cf7[_0x3dc55d];return _0x3aa7f3;};'use strict';var _=require(_0x76cf('0x0'));var MailAccount=require(_0x76cf('0x1'));var Realtime=function(){this[_0x76cf('0x2')]={};};function freeIsNotKey(_0x26a005,_0xd0270f,_0x2ce4fe){var _0x34332f=_['mapKeys'](_0x26a005,function(_0x12d93d,_0x3b1913){return _0x12d93d[_0x2ce4fe];});for(var _0x5e56ed in _0xd0270f){if(_0xd0270f['hasOwnProperty'](_0x5e56ed)){if(!_0x34332f[_0x5e56ed]){delete _0xd0270f[_0x5e56ed];}}}}Realtime[_0x76cf('0x3')][_0x76cf('0x4')]=function(_0x4bcdf4,_0x1e4595){for(var _0x1c4464 in _0x1e4595){if(_0x4bcdf4['hasOwnProperty'](_0x1c4464)){_0x4bcdf4[_0x1c4464]=_0x1e4595[_0x1c4464];}}};Realtime[_0x76cf('0x3')][_0x76cf('0x5')]=function(){var _0x38a2d8=this;return function(_0x27ab66){if(_0x27ab66){freeIsNotKey(_0x27ab66,_0x38a2d8['mailAccounts'],'id');for(var _0x5d81f2=0x0,_0x1d4b43={},_0x6d462f={};_0x5d81f2<_0x27ab66[_0x76cf('0x6')];_0x5d81f2+=0x1){_0x1d4b43=_0x27ab66[_0x5d81f2];if(_[_0x76cf('0x7')](_0x38a2d8[_0x76cf('0x2')][_0x1d4b43['id']])){_0x38a2d8[_0x76cf('0x2')][_0x1d4b43['id']]=new MailAccount(_0x1d4b43);}else{_[_0x76cf('0x8')](_0x38a2d8[_0x76cf('0x2')][_0x1d4b43['id']],_0x1d4b43);}}}return _0x38a2d8[_0x76cf('0x2')];};};module[_0x76cf('0x9')]=Realtime; \ No newline at end of file +var _0x128e=['merge','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined'];(function(_0x402030,_0x3501b9){var _0x453311=function(_0x2012a1){while(--_0x2012a1){_0x402030['push'](_0x402030['shift']());}};_0x453311(++_0x3501b9);}(_0x128e,0x123));var _0xe128=function(_0x1c382c,_0x3dbb3a){_0x1c382c=_0x1c382c-0x0;var _0x150eac=_0x128e[_0x1c382c];return _0x150eac;};'use strict';var _=require(_0xe128('0x0'));var MailAccount=require(_0xe128('0x1'));var Realtime=function(){this[_0xe128('0x2')]={};};function freeIsNotKey(_0x1a92cc,_0x37985d,_0x5abe9e){var _0x4be38d=_['mapKeys'](_0x1a92cc,function(_0x255669,_0x18a413){return _0x255669[_0x5abe9e];});for(var _0x4c2c3e in _0x37985d){if(_0x37985d[_0xe128('0x3')](_0x4c2c3e)){if(!_0x4be38d[_0x4c2c3e]){delete _0x37985d[_0x4c2c3e];}}}}Realtime['prototype'][_0xe128('0x4')]=function(_0x4c3216,_0x1b2941){for(var _0x34e941 in _0x1b2941){if(_0x4c3216[_0xe128('0x3')](_0x34e941)){_0x4c3216[_0x34e941]=_0x1b2941[_0x34e941];}}};Realtime[_0xe128('0x5')][_0xe128('0x6')]=function(){var _0x45c4ee=this;return function(_0x21f3df){if(_0x21f3df){freeIsNotKey(_0x21f3df,_0x45c4ee[_0xe128('0x2')],'id');for(var _0x32260f=0x0,_0x309324={},_0x3453a8={};_0x32260f<_0x21f3df[_0xe128('0x7')];_0x32260f+=0x1){_0x309324=_0x21f3df[_0x32260f];if(_[_0xe128('0x8')](_0x45c4ee['mailAccounts'][_0x309324['id']])){_0x45c4ee['mailAccounts'][_0x309324['id']]=new MailAccount(_0x309324);}else{_[_0xe128('0x9')](_0x45c4ee[_0xe128('0x2')][_0x309324['id']],_0x309324);}}}return _0x45c4ee[_0xe128('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index e4d4c3b..9dccde4 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5078=['CloudProvider','type','data5','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5078,0x148));var _0x8507=function(_0x3ee4d1,_0x35cbfd){_0x3ee4d1=_0x3ee4d1-0x0;var _0x24b28a=_0x5078[_0x3ee4d1];return _0x24b28a;};'use strict';var client=require(_0x8507('0x0'));exports[_0x8507('0x1')]=function(){return function(){return client[_0x8507('0x2')](_0x8507('0x3'),{'options':{'attributes':['id',_0x8507('0x4'),_0x8507('0x5'),_0x8507('0x6'),_0x8507('0x7'),_0x8507('0x8'),_0x8507('0x9'),_0x8507('0xa'),_0x8507('0xb')],'raw':![],'include':[{'model':_0x8507('0xc'),'as':_0x8507('0xd'),'include':[{'model':_0x8507('0xe'),'attributes':['id',_0x8507('0x4'),'service',_0x8507('0xf'),_0x8507('0x10')],'as':_0x8507('0xe')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x8507('0xe'),'attributes':['id',_0x8507('0x4'),_0x8507('0x6'),_0x8507('0xf'),_0x8507('0x10')],'as':_0x8507('0xe')}]}]},'log':_0x8507('0x11')});};};exports['notify']=function(_0x344a8e,_0x2c2bd5){return client[_0x8507('0x2')](_0x8507('0x12'),{'account':{'id':_0x344a8e},'body':_0x2c2bd5,'log':_0x8507('0x12')});}; \ No newline at end of file +var _0x7d8d=['notify','NotifyMailAccount','../client','getMailAccounts','Request','name','service','email','active','key','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','getMailAccount'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x7d8d,0x134));var _0xd7d8=function(_0x412fa4,_0x30f02a){_0x412fa4=_0x412fa4-0x0;var _0x3e1038=_0x7d8d[_0x412fa4];return _0x3e1038;};'use strict';var client=require(_0xd7d8('0x0'));exports[_0xd7d8('0x1')]=function(){return function(){return client[_0xd7d8('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xd7d8('0x3'),'provider',_0xd7d8('0x4'),_0xd7d8('0x5'),_0xd7d8('0x6'),_0xd7d8('0x7'),'ListId',_0xd7d8('0x8')],'raw':![],'include':[{'model':_0xd7d8('0x9'),'as':_0xd7d8('0xa'),'include':[{'model':_0xd7d8('0xb'),'attributes':['id',_0xd7d8('0x3'),_0xd7d8('0x4'),_0xd7d8('0xc'),_0xd7d8('0xd')],'as':_0xd7d8('0xb')}]},{'model':_0xd7d8('0xe'),'as':'Smtp','include':[{'model':_0xd7d8('0xb'),'attributes':['id','name',_0xd7d8('0x4'),_0xd7d8('0xc'),_0xd7d8('0xd')],'as':_0xd7d8('0xb')}]}]},'log':_0xd7d8('0xf')});};};exports[_0xd7d8('0x10')]=function(_0x49e210,_0x5ed3b6){return client[_0xd7d8('0x2')](_0xd7d8('0x11'),{'account':{'id':_0x49e210},'body':_0x5ed3b6,'log':_0xd7d8('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 28da8dc..d9f219c 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1180=['Request','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x39be4d,_0x44ae6d){var _0xc72d4c=function(_0x370a2a){while(--_0x370a2a){_0x39be4d['push'](_0x39be4d['shift']());}};_0xc72d4c(++_0x44ae6d);}(_0x1180,0x193));var _0x0118=function(_0x5609ac,_0x1371bb){_0x5609ac=_0x5609ac-0x0;var _0x223aa1=_0x1180[_0x5609ac];return _0x223aa1;};'use strict';var client=require(_0x0118('0x0'));exports[_0x0118('0x1')]=function(){return client[_0x0118('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0118('0x3')]},'log':_0x0118('0x4')});}; \ No newline at end of file +var _0x0c4a=['getSettings','Request','ShowSetting','GetSettings'];(function(_0x259c7e,_0x96223a){var _0x15d791=function(_0x5f4198){while(--_0x5f4198){_0x259c7e['push'](_0x259c7e['shift']());}};_0x15d791(++_0x96223a);}(_0x0c4a,0x1cc));var _0xa0c4=function(_0x234c01,_0x25e549){_0x234c01=_0x234c01-0x0;var _0x494f70=_0x0c4a[_0x234c01];return _0x494f70;};'use strict';var client=require('../client');exports[_0xa0c4('0x0')]=function(){return client[_0xa0c4('0x1')](_0xa0c4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xa0c4('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 36c5d99..6797de3 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 63e7d0d..fe07048 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d92=['socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/socketio','default','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','listen','port'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x5d92,0x11a));var _0x25d9=function(_0x1811ca,_0x41bfc3){_0x1811ca=_0x1811ca-0x0;var _0x20ec80=_0x5d92[_0x1811ca];return _0x20ec80;};'use strict';var _=require(_0x25d9('0x0'));var http=require(_0x25d9('0x1'));var express=require(_0x25d9('0x2'));var sticky=require(_0x25d9('0x3'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0x25d9('0x4')](server,config[_0x25d9('0x5')])){var socketio=require(_0x25d9('0x6'))(server,{'transports':[_0x25d9('0x7'),_0x25d9('0x8')]});config[_0x25d9('0x9')]=_[_0x25d9('0xa')](config[_0x25d9('0x9')],{'host':_0x25d9('0xb'),'port':0x18eb});socketio['adapter'](require(_0x25d9('0xc'))({'pubClient':new Redis(config[_0x25d9('0x9')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')['default']();require(_0x25d9('0xd'))[_0x25d9('0xe')](socketio);require('../../config/express')[_0x25d9('0xe')](app);require('../../routes')[_0x25d9('0xe')](app);}else{server['once'](_0x25d9('0xf'),function(){console[_0x25d9('0x10')](_0x25d9('0x11'),config[_0x25d9('0x5')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xe51f=['../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express','sticky-session','ioredis','timeout','listen','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0xba9f0e,_0x5bbe9e){var _0x4bd05c=function(_0x10ddfa){while(--_0x10ddfa){_0xba9f0e['push'](_0xba9f0e['shift']());}};_0x4bd05c(++_0x5bbe9e);}(_0xe51f,0x13a));var _0xfe51=function(_0x110063,_0x265e26){_0x110063=_0x110063-0x0;var _0x47ecc5=_0xe51f[_0x110063];return _0x47ecc5;};'use strict';var _=require('lodash');var http=require(_0xfe51('0x0'));var express=require(_0xfe51('0x1'));var sticky=require(_0xfe51('0x2'));var Redis=require(_0xfe51('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xfe51('0x4')]=0xdbba0;if(sticky[_0xfe51('0x5')](server,config['port'])){var socketio=require(_0xfe51('0x6'))(server,{'transports':[_0xfe51('0x7'),_0xfe51('0x8')]});config[_0xfe51('0x9')]=_[_0xfe51('0xa')](config[_0xfe51('0x9')],{'host':_0xfe51('0xb'),'port':0x18eb});socketio[_0xfe51('0xc')](require(_0xfe51('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xfe51('0xe'))[_0xfe51('0xf')]();require(_0xfe51('0x10'))[_0xfe51('0xf')](socketio);require('../../config/express')['default'](app);require(_0xfe51('0x11'))[_0xfe51('0xf')](app);}else{server[_0xfe51('0x12')](_0xfe51('0x13'),function(){console[_0xfe51('0x14')](_0xfe51('0x15'),config['port']);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 8597b45..69b1781 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b90=['exports','jayson/promise','bluebird','routing','client','Request','request','then','debug','rpc','error','message','result','catch'];(function(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0x5b90,0x7f));var _0x05b9=function(_0x131916,_0x8eb089){_0x131916=_0x131916-0x0;var _0x283e61=_0x5b90[_0x131916];return _0x283e61;};'use strict';var jayson=require(_0x05b9('0x0'));var BPromise=require(_0x05b9('0x1'));var logger=require('../../config/logger')(_0x05b9('0x2'));var client=jayson[_0x05b9('0x3')]['http']({'port':0x2329});client[_0x05b9('0x4')]=function(_0x2e83eb,_0x75d492){return new BPromise(function(_0x5c3958,_0x43b83b){return client[_0x05b9('0x5')](_0x2e83eb,_0x75d492)[_0x05b9('0x6')](function(_0x2a6927){logger[_0x05b9('0x7')](_0x05b9('0x8'),_0x05b9('0x2'),_0x2e83eb,_0x75d492,_0x2a6927);if(_0x2a6927[_0x05b9('0x9')]){logger['error']('rpc','routing',_0x2e83eb,_0x2a6927[_0x05b9('0x9')]['message'],_0x75d492);return _0x43b83b(_0x2a6927[_0x05b9('0x9')][_0x05b9('0xa')]);}else{return _0x5c3958(_0x2a6927[_0x05b9('0xb')]);}})[_0x05b9('0xc')](function(_0x443f6d){logger[_0x05b9('0x9')](_0x05b9('0x8'),_0x05b9('0x2'),_0x2e83eb,_0x443f6d,_0x75d492);return _0x43b83b(_0x443f6d);});});};module[_0x05b9('0xd')]=client; \ No newline at end of file +var _0x6dfe=['exports','jayson/promise','bluebird','../../config/logger','http','Request','then','debug','rpc','routing','error','result','catch'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0x6dfe,0x160));var _0xe6df=function(_0x393dc9,_0x3b18b0){_0x393dc9=_0x393dc9-0x0;var _0x287fd3=_0x6dfe[_0x393dc9];return _0x287fd3;};'use strict';var jayson=require(_0xe6df('0x0'));var BPromise=require(_0xe6df('0x1'));var logger=require(_0xe6df('0x2'))('routing');var client=jayson['client'][_0xe6df('0x3')]({'port':0x2329});client[_0xe6df('0x4')]=function(_0x510c7d,_0x4bb342){return new BPromise(function(_0x250cdd,_0x407552){return client['request'](_0x510c7d,_0x4bb342)[_0xe6df('0x5')](function(_0x37276e){logger[_0xe6df('0x6')](_0xe6df('0x7'),_0xe6df('0x8'),_0x510c7d,_0x4bb342,_0x37276e);if(_0x37276e[_0xe6df('0x9')]){logger[_0xe6df('0x9')](_0xe6df('0x7'),_0xe6df('0x8'),_0x510c7d,_0x37276e[_0xe6df('0x9')]['message'],_0x4bb342);return _0x407552(_0x37276e[_0xe6df('0x9')]['message']);}else{return _0x250cdd(_0x37276e[_0xe6df('0xa')]);}})[_0xe6df('0xb')](function(_0x3a7dce){logger[_0xe6df('0x9')]('rpc',_0xe6df('0x8'),_0x510c7d,_0x3a7dce,_0x4bb342);return _0x407552(_0x3a7dce);});});};module[_0xe6df('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 5ec58bc..90bd611 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd659=['resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue'];(function(_0x21f56d,_0x17d68e){var _0x1f0e11=function(_0x4635b2){while(--_0x4635b2){_0x21f56d['push'](_0x21f56d['shift']());}};_0x1f0e11(++_0x17d68e);}(_0xd659,0x147));var _0x9d65=function(_0xc3ac55,_0x52d626){_0xc3ac55=_0xc3ac55-0x0;var _0x34c0e7=_0xd659[_0xc3ac55];return _0x34c0e7;};'use strict';var BPromise=require(_0x9d65('0x0'));var server=require('./server');var Realtime=require(_0x9d65('0x1'));var user=require(_0x9d65('0x2'));var interval=require(_0x9d65('0x3'));var openchannelQueue=require(_0x9d65('0x4'));var chatQueue=require(_0x9d65('0x5'));var smsQueue=require(_0x9d65('0x6'));var mailQueue=require(_0x9d65('0x7'));var faxQueue=require(_0x9d65('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x9d65('0x9')]()[_0x9d65('0xa')](user[_0x9d65('0xb')]())[_0x9d65('0xa')](realtime[_0x9d65('0xc')]())[_0x9d65('0xa')](interval[_0x9d65('0xd')]())[_0x9d65('0xa')](realtime[_0x9d65('0xe')]())[_0x9d65('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x9d65('0xa')](realtime[_0x9d65('0xf')]())[_0x9d65('0xa')](chatQueue['getChatQueues']())[_0x9d65('0xa')](realtime['initChatQueues']())['then'](smsQueue[_0x9d65('0x10')]())[_0x9d65('0xa')](realtime['initSmsQueues']())[_0x9d65('0xa')](mailQueue[_0x9d65('0x11')]())['then'](realtime[_0x9d65('0x12')]())[_0x9d65('0xa')](faxQueue[_0x9d65('0x13')]())[_0x9d65('0xa')](realtime['initFaxQueues']())[_0x9d65('0xa')](whatsappQueue[_0x9d65('0x14')]())[_0x9d65('0xa')](realtime[_0x9d65('0x15')]())[_0x9d65('0xa')](function(){return realtime;});}function main(){return server[_0x9d65('0x16')](realtime)['then'](function(_0x3e7849){return initRealtime();})['then'](function(_0x1a731d){return setInterval(initRealtime,0x1388);})['catch'](function(_0x4b9729){console[_0x9d65('0x17')](_0x4b9729);});}main(); \ No newline at end of file +var _0xd8ac=['getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0xd8ac,0x1e3));var _0xcd8a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd8ac[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require(_0xcd8a('0x0'));var server=require(_0xcd8a('0x1'));var Realtime=require(_0xcd8a('0x2'));var user=require(_0xcd8a('0x3'));var interval=require(_0xcd8a('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xcd8a('0x5'));var smsQueue=require(_0xcd8a('0x6'));var mailQueue=require(_0xcd8a('0x7'));var faxQueue=require(_0xcd8a('0x8'));var whatsappQueue=require(_0xcd8a('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xcd8a('0xa')]()[_0xcd8a('0xb')](user['getAgents']())[_0xcd8a('0xb')](realtime[_0xcd8a('0xc')]())[_0xcd8a('0xb')](interval[_0xcd8a('0xd')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0xe')]())[_0xcd8a('0xb')](openchannelQueue[_0xcd8a('0xf')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x10')]())['then'](chatQueue[_0xcd8a('0x11')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x12')]())['then'](smsQueue['getSmsQueues']())[_0xcd8a('0xb')](realtime['initSmsQueues']())[_0xcd8a('0xb')](mailQueue[_0xcd8a('0x13')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x14')]())[_0xcd8a('0xb')](faxQueue[_0xcd8a('0x15')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x16')]())[_0xcd8a('0xb')](whatsappQueue[_0xcd8a('0x17')]())['then'](realtime[_0xcd8a('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0xcd8a('0x19')](realtime)[_0xcd8a('0xb')](function(_0x4af694){return initRealtime();})['then'](function(_0x4b09c4){return setInterval(initRealtime,0x1388);})[_0xcd8a('0x1a')](function(_0x4d1f08){console[_0xcd8a('0x1b')](_0x4d1f08);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 55b4853..df9b6e1 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x30e6cc,_0x38cd70){var _0x203473=function(_0x364731){while(--_0x364731){_0x30e6cc['push'](_0x30e6cc['shift']());}};_0x203473(++_0x38cd70);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x5fc3[_0x4d1ee9];return _0x9a5456;};'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 _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x11e1a5,_0xd108d9){var _0x2938de=function(_0x182097){while(--_0x182097){_0x11e1a5['push'](_0x11e1a5['shift']());}};_0x2938de(++_0xd108d9);}(_0x2ef3,0xba));var _0x32ef=function(_0x45597f,_0x2769c2){_0x45597f=_0x45597f-0x0;var _0x5e6472=_0x2ef3[_0x45597f];return _0x5e6472;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index ac455c5..d18fc2d 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb344=['message','result','catch','sendMailMessage','jayson/promise','http','request','error'];(function(_0x36b045,_0x9127d4){var _0x319575=function(_0x19a102){while(--_0x19a102){_0x36b045['push'](_0x36b045['shift']());}};_0x319575(++_0x9127d4);}(_0xb344,0x7c));var _0x4b34=function(_0x3a223a,_0x303433){_0x3a223a=_0x3a223a-0x0;var _0xb6ac7d=_0xb344[_0x3a223a];return _0xb6ac7d;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x4b34('0x0'));var client=jayson['client'][_0x4b34('0x1')]({'port':0x232b});function request(_0x563364,_0x73d97a){return new BPromise(function(_0x49fa62,_0xac15e3){return client[_0x4b34('0x2')](_0x563364,_0x73d97a)['then'](function(_0x2aac20){if(_0x2aac20[_0x4b34('0x3')]){return _0xac15e3(_0x2aac20[_0x4b34('0x3')][_0x4b34('0x4')]);}else{return _0x49fa62(_0x2aac20[_0x4b34('0x5')]);}})[_0x4b34('0x6')](function(_0x229f39){return _0xac15e3(_0x229f39);});});}exports[_0x4b34('0x7')]=function(_0x360005,_0x118ed5){return request('SendMail',{'account':_0x360005,'message':_0x118ed5});}; \ No newline at end of file +var _0xcd7d=['bluebird','jayson/promise','client','http','request','then','error','message','catch','sendMailMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcd7d,0x1c2));var _0xdcd7=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0xcd7d[_0x2d3a4d];return _0x3a94a3;};'use strict';var BPromise=require(_0xdcd7('0x0'));var jayson=require(_0xdcd7('0x1'));var client=jayson[_0xdcd7('0x2')][_0xdcd7('0x3')]({'port':0x232b});function request(_0x116de2,_0x32fce7){return new BPromise(function(_0x4bcced,_0x3b8203){return client[_0xdcd7('0x4')](_0x116de2,_0x32fce7)[_0xdcd7('0x5')](function(_0x5152c4){if(_0x5152c4[_0xdcd7('0x6')]){return _0x3b8203(_0x5152c4[_0xdcd7('0x6')][_0xdcd7('0x7')]);}else{return _0x4bcced(_0x5152c4['result']);}})[_0xdcd7('0x8')](function(_0x12206b){return _0x3b8203(_0x12206b);});});}exports[_0xdcd7('0x9')]=function(_0x1fcfaa,_0x3cd6ea){return request('SendMail',{'account':_0x1fcfaa,'message':_0x3cd6ea});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2e28f5c..1ec5423 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x521c=['faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','md5','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatPause','mailCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','openchannelCurrentCapacity','busy','faxWaitingInteractions','whatsappWaitingInteractions','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','defaults','redis','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCurrentCapacity','faxStatus','faxStatusTime'];(function(_0x21f9c2,_0x2b3d2a){var _0x3da17f=function(_0x57e2b9){while(--_0x57e2b9){_0x21f9c2['push'](_0x21f9c2['shift']());}};_0x3da17f(++_0x2b3d2a);}(_0x521c,0x17c));var _0xc521=function(_0x3d386b,_0xb6dba8){_0x3d386b=_0x3d386b-0x0;var _0x4abf3a=_0x521c[_0x3d386b];return _0x4abf3a;};'use strict';var _=require(_0xc521('0x0'));var moment=require(_0xc521('0x1'));var md5=require('md5');var Redis=require(_0xc521('0x2'));var config=require(_0xc521('0x3'));config['redis']=_[_0xc521('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc521('0x5')]));function Agent(_0x25e727){this['id']=_0x25e727['id']||0x0;this['name']=_0x25e727[_0xc521('0x6')]||'';this['online']=_0x25e727[_0xc521('0x7')]||!![];this[_0xc521('0x8')]=_0x25e727[_0xc521('0x8')]||![];this['chatPause']=_0x25e727['chatPause']||![];this['mailPause']=_0x25e727[_0xc521('0x9')]||![];this[_0xc521('0xa')]=_0x25e727[_0xc521('0xa')]||![];this[_0xc521('0xb')]=_0x25e727[_0xc521('0xb')]||![];this[_0xc521('0xc')]=_0x25e727[_0xc521('0xc')]||![];this[_0xc521('0xd')]=_0xc521('0xe');this[_0xc521('0xf')]=0x0;this['chatCapacity']=_0x25e727[_0xc521('0x10')]||0x0;this[_0xc521('0x11')]=0x0;this[_0xc521('0x12')]='unknown';this['mailStatusTime']=0x0;this['mailCapacity']=_0x25e727['mailCapacity']||0x0;this[_0xc521('0x13')]=0x0;this[_0xc521('0x14')]='unknown';this[_0xc521('0x15')]=0x0;this[_0xc521('0x16')]=_0x25e727['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0xc521('0xe');this[_0xc521('0x17')]=0x0;this[_0xc521('0x18')]=_0x25e727[_0xc521('0x18')]||0x0;this[_0xc521('0x19')]=0x0;this['whatsappStatus']=_0xc521('0xe');this[_0xc521('0x1a')]=0x0;this[_0xc521('0x1b')]=_0x25e727[_0xc521('0x1b')]||0x0;this[_0xc521('0x1c')]=0x0;this[_0xc521('0x1d')]='unknown';this[_0xc521('0x1e')]=0x0;this[_0xc521('0x1f')]=_0x25e727[_0xc521('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0xc521('0x20')]=undefined;this[_0xc521('0x21')]='';this[_0xc521('0x22')]={};this['faxWaitingInteractions']={};this[_0xc521('0x23')]={};this[_0xc521('0x24')]={};this[_0xc521('0x25')]={};this['whatsappWaitingInteractions']={};this[_0xc521('0x26')]();}Agent[_0xc521('0x27')][_0xc521('0x28')]=function(_0x456bd0){if(this[_0x456bd0+_0xc521('0x29')]>0x0){if(this[_0x456bd0+'Capacity']>0x0&&this[_0x456bd0+_0xc521('0x29')]>=this[_0x456bd0+'Capacity']){return _0xc521('0x2a');}else{return _0xc521('0x2b');}}else{return _0xc521('0x2c');}};Agent['prototype'][_0xc521('0x26')]=function(){var _0x5f5414=['mail',_0xc521('0x2d'),_0xc521('0x2e'),_0xc521('0x2f'),_0xc521('0x30'),_0xc521('0x31')];for(var _0x4a6768=0x0;_0x4a6768<_0x5f5414[_0xc521('0x32')];_0x4a6768+=0x1){var _0x18fdc1=this[_0xc521('0x28')](_0x5f5414[_0x4a6768]);if(this[_0x5f5414[_0x4a6768]+_0xc521('0x33')]!==_0x18fdc1){this[_0x5f5414[_0x4a6768]+_0xc521('0x34')]=_[_0xc521('0x35')](moment()[_0xc521('0x36')]('x'));}this[_0x5f5414[_0x4a6768]+_0xc521('0x33')]=_0x18fdc1;}var _0x2a4dda={'id':this['id'],'name':this[_0xc521('0x6')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xc521('0x37')],'mailPause':this[_0xc521('0x9')],'smsPause':this[_0xc521('0xb')],'faxPause':this[_0xc521('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xc521('0x10')],'chatCurrentCapacity':this[_0xc521('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xc521('0x38')],'mailCurrentCapacity':this[_0xc521('0x13')],'faxStatus':this[_0xc521('0x14')],'faxStatusTime':this[_0xc521('0x15')],'faxCapacity':this[_0xc521('0x16')],'faxCurrentCapacity':this[_0xc521('0x39')],'smsStatus':this[_0xc521('0x3a')],'smsStatusTime':this[_0xc521('0x17')],'smsCapacity':this[_0xc521('0x18')],'smsCurrentCapacity':this[_0xc521('0x19')],'whatsappStatus':this[_0xc521('0x3b')],'whatsappStatusTime':this[_0xc521('0x1a')],'whatsappCapacity':this[_0xc521('0x1b')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xc521('0x1d')],'openchannelStatusTime':this[_0xc521('0x1e')],'openchannelCapacity':this[_0xc521('0x1f')],'openchannelCurrentCapacity':this[_0xc521('0x3c')],'busy':this[_0xc521('0x3d')],'busyQueue':this[_0xc521('0x20')],'chatWaitingInteractions':this[_0xc521('0x22')],'faxWaitingInteractions':this[_0xc521('0x3e')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xc521('0x25')],'whatsappWaitingInteractions':this[_0xc521('0x3f')]};var _0x3f9bc0=md5(JSON['stringify'](_0x2a4dda));if(this[_0xc521('0x21')]!==_0x3f9bc0){this[_0xc521('0x21')]=_0x3f9bc0;io[_0xc521('0x40')](_0xc521('0x41'),_0x2a4dda);}};module[_0xc521('0x42')]=Agent; \ No newline at end of file +var _0x3f62=['StatusTime','toNumber','chatCurrentCapacity','faxStatusTime','faxCurrentCapacity','whatsappStatusTime','chatWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','sms','whatsapp','length','Status'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3f62,0x127));var _0x23f6=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3f62[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x23f6('0x0'));var moment=require(_0x23f6('0x1'));var md5=require(_0x23f6('0x2'));var Redis=require(_0x23f6('0x3'));var config=require(_0x23f6('0x4'));config[_0x23f6('0x5')]=_[_0x23f6('0x6')](config['redis'],{'host':_0x23f6('0x7'),'port':0x18eb});var io=require(_0x23f6('0x8'))(new Redis(config[_0x23f6('0x5')]));function Agent(_0x210a38){this['id']=_0x210a38['id']||0x0;this['name']=_0x210a38[_0x23f6('0x9')]||'';this[_0x23f6('0xa')]=_0x210a38['online']||!![];this[_0x23f6('0xb')]=_0x210a38[_0x23f6('0xb')]||![];this['chatPause']=_0x210a38[_0x23f6('0xc')]||![];this[_0x23f6('0xd')]=_0x210a38[_0x23f6('0xd')]||![];this[_0x23f6('0xe')]=_0x210a38['faxPause']||![];this[_0x23f6('0xf')]=_0x210a38[_0x23f6('0xf')]||![];this[_0x23f6('0x10')]=_0x210a38['openchannelPause']||![];this[_0x23f6('0x11')]=_0x23f6('0x12');this[_0x23f6('0x13')]=0x0;this[_0x23f6('0x14')]=_0x210a38['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x23f6('0x15')]=_0x23f6('0x12');this[_0x23f6('0x16')]=0x0;this['mailCapacity']=_0x210a38[_0x23f6('0x17')]||0x0;this[_0x23f6('0x18')]=0x0;this[_0x23f6('0x19')]=_0x23f6('0x12');this['faxStatusTime']=0x0;this['faxCapacity']=_0x210a38[_0x23f6('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x23f6('0x1b')]=_0x23f6('0x12');this[_0x23f6('0x1c')]=0x0;this[_0x23f6('0x1d')]=_0x210a38['smsCapacity']||0x0;this[_0x23f6('0x1e')]=0x0;this[_0x23f6('0x1f')]=_0x23f6('0x12');this['whatsappStatusTime']=0x0;this[_0x23f6('0x20')]=_0x210a38[_0x23f6('0x20')]||0x0;this[_0x23f6('0x21')]=0x0;this[_0x23f6('0x22')]=_0x23f6('0x12');this[_0x23f6('0x23')]=0x0;this[_0x23f6('0x24')]=_0x210a38[_0x23f6('0x24')]||0x0;this[_0x23f6('0x25')]=0x0;this[_0x23f6('0x26')]=![];this[_0x23f6('0x27')]=undefined;this[_0x23f6('0x2')]='';this['chatWaitingInteractions']={};this[_0x23f6('0x28')]={};this[_0x23f6('0x29')]={};this[_0x23f6('0x2a')]={};this[_0x23f6('0x2b')]={};this[_0x23f6('0x2c')]={};this[_0x23f6('0x2d')]();}Agent['prototype'][_0x23f6('0x2e')]=function(_0x262d69){if(this[_0x262d69+'CurrentCapacity']>0x0){if(this[_0x262d69+_0x23f6('0x2f')]>0x0&&this[_0x262d69+_0x23f6('0x30')]>=this[_0x262d69+_0x23f6('0x2f')]){return _0x23f6('0x31');}else{return _0x23f6('0x32');}}else{return _0x23f6('0x33');}};Agent[_0x23f6('0x34')]['updateRealtime']=function(){var _0x9cacaf=[_0x23f6('0x35'),_0x23f6('0x36'),_0x23f6('0x37'),'fax',_0x23f6('0x38'),_0x23f6('0x39')];for(var _0x43da8a=0x0;_0x43da8a<_0x9cacaf[_0x23f6('0x3a')];_0x43da8a+=0x1){var _0x174857=this[_0x23f6('0x2e')](_0x9cacaf[_0x43da8a]);if(this[_0x9cacaf[_0x43da8a]+_0x23f6('0x3b')]!==_0x174857){this[_0x9cacaf[_0x43da8a]+_0x23f6('0x3c')]=_[_0x23f6('0x3d')](moment()['format']('x'));}this[_0x9cacaf[_0x43da8a]+_0x23f6('0x3b')]=_0x174857;}var _0x230d76={'id':this['id'],'name':this['name'],'online':this[_0x23f6('0xa')],'voicePause':this['voicePause'],'chatPause':this[_0x23f6('0xc')],'mailPause':this[_0x23f6('0xd')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x23f6('0x10')],'chatStatus':this[_0x23f6('0x11')],'chatStatusTime':this[_0x23f6('0x13')],'chatCapacity':this[_0x23f6('0x14')],'chatCurrentCapacity':this[_0x23f6('0x3e')],'mailStatus':this[_0x23f6('0x15')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x23f6('0x18')],'faxStatus':this[_0x23f6('0x19')],'faxStatusTime':this[_0x23f6('0x3f')],'faxCapacity':this[_0x23f6('0x1a')],'faxCurrentCapacity':this[_0x23f6('0x40')],'smsStatus':this[_0x23f6('0x1b')],'smsStatusTime':this[_0x23f6('0x1c')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x23f6('0x1e')],'whatsappStatus':this[_0x23f6('0x1f')],'whatsappStatusTime':this[_0x23f6('0x41')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x23f6('0x21')],'openchannelStatus':this[_0x23f6('0x22')],'openchannelStatusTime':this[_0x23f6('0x23')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x23f6('0x25')],'busy':this[_0x23f6('0x26')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x23f6('0x42')],'faxWaitingInteractions':this[_0x23f6('0x28')],'mailWaitingInteractions':this[_0x23f6('0x29')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x23f6('0x2b')],'whatsappWaitingInteractions':this[_0x23f6('0x2c')]};var _0x30b32b=md5(JSON[_0x23f6('0x43')](_0x230d76));if(this[_0x23f6('0x2')]!==_0x30b32b){this[_0x23f6('0x2')]=_0x30b32b;io[_0x23f6('0x44')](_0x23f6('0x45'),_0x230d76);}};module[_0x23f6('0x46')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index c852712..e8510ad 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf74a=['format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available'];(function(_0x485c9f,_0x399a20){var _0x2ba76e=function(_0x3598d4){while(--_0x3598d4){_0x485c9f['push'](_0x485c9f['shift']());}};_0x2ba76e(++_0x399a20);}(_0xf74a,0x17d));var _0xaf74=function(_0x8e9d78,_0x310ef6){_0x8e9d78=_0x8e9d78-0x0;var _0x4b6f13=_0xf74a[_0x8e9d78];return _0x4b6f13;};'use strict';var _=require(_0xaf74('0x0'));var md5=require(_0xaf74('0x1'));var util=require(_0xaf74('0x2'));var Redis=require(_0xaf74('0x3'));var config=require(_0xaf74('0x4'));config['redis']=_[_0xaf74('0x5')](config[_0xaf74('0x6')],{'host':_0xaf74('0x7'),'port':0x18eb});var io=require(_0xaf74('0x8'))(new Redis(config['redis']));function ChatQueue(_0x2eeacd){this['id']=_0x2eeacd['id']||0x0;this[_0xaf74('0x9')]=_0x2eeacd[_0xaf74('0x9')]||'';this[_0xaf74('0xa')]=_0x2eeacd[_0xaf74('0xa')]||0xa;this[_0xaf74('0xb')]=_0x2eeacd['strategy']||'beepall';this[_0xaf74('0xc')]=_0x2eeacd[_0xaf74('0xc')];this[_0xaf74('0xd')]={};this[_0xaf74('0xe')]=0x0;this[_0xaf74('0x1')]='';this[_0xaf74('0xf')]();this[_0xaf74('0x10')]();}ChatQueue[_0xaf74('0x11')][_0xaf74('0xf')]=function(){var _0x44d14b=this['mapAgentsId'][_0xaf74('0x12')];this[_0xaf74('0xd')]=_[_0xaf74('0x13')](this[_0xaf74('0xc')],'id');this[_0xaf74('0xd')][_0xaf74('0x12')]=_0x44d14b;};ChatQueue['prototype'][_0xaf74('0x10')]=function(){this[_0xaf74('0x14')]=0x0;this[_0xaf74('0x15')]=0x0;for(var _0x2ff47e=0x0;_0x2ff47e=0x0?this['available']:0x0;var _0x1c3edc={'id':this['id'],'available':this[_0xaf74('0x18')],'loggedIn':this[_0xaf74('0x14')],'name':this['name'],'paused':this[_0xaf74('0x15')],'waiting':this['waiting']};var _0x341f88=md5(JSON['stringify'](_0x1c3edc));if(this['md5']!==_0x341f88){this[_0xaf74('0x1')]=_0x341f88;io['to'](util[_0xaf74('0x19')](_0xaf74('0x1a'),_0x1c3edc[_0xaf74('0x9')]))[_0xaf74('0x1b')]('chat_queue:save',_0x1c3edc);}};module[_0xaf74('0x1c')]=ChatQueue; \ No newline at end of file +var _0x7ce3=['stringify','format','chat:queue:%s','emit','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','available'];(function(_0x3f92bc,_0x482ad4){var _0xa15d20=function(_0x1381be){while(--_0x1381be){_0x3f92bc['push'](_0x3f92bc['shift']());}};_0xa15d20(++_0x482ad4);}(_0x7ce3,0x1d4));var _0x37ce=function(_0x29b4e5,_0x385e2e){_0x29b4e5=_0x29b4e5-0x0;var _0x439ca4=_0x7ce3[_0x29b4e5];return _0x439ca4;};'use strict';var _=require(_0x37ce('0x0'));var md5=require('md5');var util=require(_0x37ce('0x1'));var Redis=require(_0x37ce('0x2'));var config=require('../../../config/environment');config[_0x37ce('0x3')]=_[_0x37ce('0x4')](config[_0x37ce('0x3')],{'host':_0x37ce('0x5'),'port':0x18eb});var io=require(_0x37ce('0x6'))(new Redis(config[_0x37ce('0x3')]));function ChatQueue(_0x246c31){this['id']=_0x246c31['id']||0x0;this[_0x37ce('0x7')]=_0x246c31['name']||'';this['timeout']=_0x246c31[_0x37ce('0x8')]||0xa;this[_0x37ce('0x9')]=_0x246c31['strategy']||_0x37ce('0xa');this[_0x37ce('0xb')]=_0x246c31[_0x37ce('0xb')];this['mapAgentsId']={};this[_0x37ce('0xc')]=0x0;this[_0x37ce('0xd')]='';this[_0x37ce('0xe')]();this[_0x37ce('0xf')]();}ChatQueue[_0x37ce('0x10')][_0x37ce('0xe')]=function(){var _0x4a3e10=this[_0x37ce('0x11')][_0x37ce('0x12')];this['mapAgentsId']=_[_0x37ce('0x13')](this[_0x37ce('0xb')],'id');this[_0x37ce('0x11')][_0x37ce('0x12')]=_0x4a3e10;};ChatQueue[_0x37ce('0x10')][_0x37ce('0xf')]=function(){this['loggedIn']=0x0;this[_0x37ce('0x14')]=0x0;for(var _0x185991=0x0;_0x185991=0x0?this[_0x37ce('0x18')]:0x0;var _0x2496f7={'id':this['id'],'available':this[_0x37ce('0x18')],'loggedIn':this[_0x37ce('0x17')],'name':this['name'],'paused':this[_0x37ce('0x14')],'waiting':this[_0x37ce('0xc')]};var _0x511631=md5(JSON[_0x37ce('0x19')](_0x2496f7));if(this['md5']!==_0x511631){this[_0x37ce('0xd')]=_0x511631;io['to'](util[_0x37ce('0x1a')](_0x37ce('0x1b'),_0x2496f7[_0x37ce('0x7')]))[_0x37ce('0x1c')]('chat_queue:save',_0x2496f7);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 57c077b..8f25280 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3746=['mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused','loggedIn','faxPause','available','waiting','md5','format','fax:queue:%s','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x4f63b7,_0x220857){var _0x598295=function(_0x165747){while(--_0x165747){_0x4f63b7['push'](_0x4f63b7['shift']());}};_0x598295(++_0x220857);}(_0x3746,0x11d));var _0x6374=function(_0x5d9ead,_0x475593){_0x5d9ead=_0x5d9ead-0x0;var _0x4067f4=_0x3746[_0x5d9ead];return _0x4067f4;};'use strict';var _=require(_0x6374('0x0'));var md5=require('md5');var util=require(_0x6374('0x1'));var Redis=require('ioredis');var config=require(_0x6374('0x2'));config[_0x6374('0x3')]=_[_0x6374('0x4')](config[_0x6374('0x3')],{'host':_0x6374('0x5'),'port':0x18eb});var io=require(_0x6374('0x6'))(new Redis(config[_0x6374('0x3')]));function FaxQueue(_0x21ce82){this['id']=_0x21ce82['id']||0x0;this[_0x6374('0x7')]=_0x21ce82['name']||'';this[_0x6374('0x8')]=_0x21ce82['timeout']||0xa;this[_0x6374('0x9')]=_0x21ce82[_0x6374('0x9')]||_0x6374('0xa');this['Agents']=_0x21ce82[_0x6374('0xb')];this[_0x6374('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x6374('0xd')]();this[_0x6374('0xe')]();}FaxQueue[_0x6374('0xf')][_0x6374('0xd')]=function(){var _0x4bc1e0=this[_0x6374('0xc')][_0x6374('0x10')];this[_0x6374('0xc')]=_[_0x6374('0x11')](this[_0x6374('0xb')],'id');this[_0x6374('0xc')][_0x6374('0x10')]=_0x4bc1e0;};FaxQueue[_0x6374('0xf')][_0x6374('0xe')]=function(){this['loggedIn']=0x0;this[_0x6374('0x12')]=0x0;for(var _0x368a22=0x0;_0x368a22=0x0?this[_0x6374('0x15')]:0x0;var _0x228fb8={'id':this['id'],'available':this[_0x6374('0x15')],'loggedIn':this[_0x6374('0x13')],'name':this[_0x6374('0x7')],'paused':this[_0x6374('0x12')],'waiting':this[_0x6374('0x16')]};var _0x5d7538=md5(JSON['stringify'](_0x228fb8));if(this[_0x6374('0x17')]!==_0x5d7538){this[_0x6374('0x17')]=_0x5d7538;io['to'](util[_0x6374('0x18')](_0x6374('0x19'),_0x228fb8['name']))['emit']('fax_queue:save',_0x228fb8);}};module[_0x6374('0x1a')]=FaxQueue; \ No newline at end of file +var _0x507c=['Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','length','available','md5','format','fax:queue:%s','fax_queue:save','exports','lodash','util','../../../config/environment','defaults','redis','name','timeout','strategy','beepall'];(function(_0x23d307,_0x46e6c2){var _0x514d62=function(_0x16f355){while(--_0x16f355){_0x23d307['push'](_0x23d307['shift']());}};_0x514d62(++_0x46e6c2);}(_0x507c,0x1a0));var _0xc507=function(_0xa7281b,_0x40b787){_0xa7281b=_0xa7281b-0x0;var _0xb96593=_0x507c[_0xa7281b];return _0xb96593;};'use strict';var _=require(_0xc507('0x0'));var md5=require('md5');var util=require(_0xc507('0x1'));var Redis=require('ioredis');var config=require(_0xc507('0x2'));config['redis']=_[_0xc507('0x3')](config[_0xc507('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc507('0x4')]));function FaxQueue(_0x35f0cd){this['id']=_0x35f0cd['id']||0x0;this[_0xc507('0x5')]=_0x35f0cd[_0xc507('0x5')]||'';this[_0xc507('0x6')]=_0x35f0cd[_0xc507('0x6')]||0xa;this[_0xc507('0x7')]=_0x35f0cd[_0xc507('0x7')]||_0xc507('0x8');this[_0xc507('0x9')]=_0x35f0cd['Agents'];this[_0xc507('0xa')]={};this[_0xc507('0xb')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0xc507('0xc')]=function(){var _0x1a480e=this[_0xc507('0xa')][_0xc507('0xd')];this[_0xc507('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xc507('0xd')]=_0x1a480e;};FaxQueue[_0xc507('0xe')][_0xc507('0xf')]=function(){this[_0xc507('0x10')]=0x0;this[_0xc507('0x11')]=0x0;for(var _0x4b52b1=0x0;_0x4b52b1=0x0?this['available']:0x0;var _0x580a35={'id':this['id'],'available':this[_0xc507('0x13')],'loggedIn':this[_0xc507('0x10')],'name':this[_0xc507('0x5')],'paused':this[_0xc507('0x11')],'waiting':this['waiting']};var _0x4720e9=md5(JSON['stringify'](_0x580a35));if(this[_0xc507('0x14')]!==_0x4720e9){this[_0xc507('0x14')]=_0x4720e9;io['to'](util[_0xc507('0x15')](_0xc507('0x16'),_0x580a35[_0xc507('0x5')]))['emit'](_0xc507('0x17'),_0x580a35);}};module[_0xc507('0x18')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index e85bc24..6e2d80e 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b18=['exports','name','Intervals'];(function(_0x3e9404,_0x47173b){var _0x81543b=function(_0x9a7185){while(--_0x9a7185){_0x3e9404['push'](_0x3e9404['shift']());}};_0x81543b(++_0x47173b);}(_0x4b18,0x10c));var _0x84b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b18[_0x14add3];return _0x4a174f;};'use strict';function Interval(_0x258895){this['id']=_0x258895['id']||0x0;this[_0x84b1('0x0')]=_0x258895[_0x84b1('0x0')]||'';this['Intervals']=_0x258895[_0x84b1('0x1')]||{};}module[_0x84b1('0x2')]=Interval; \ No newline at end of file +var _0x0f45=['Intervals','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f45,0xe9));var _0x50f4=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x0f45[_0x2aecb2];return _0x3ebb80;};'use strict';function Interval(_0x173719){this['id']=_0x173719['id']||0x0;this[_0x50f4('0x0')]=_0x173719[_0x50f4('0x0')]||'';this[_0x50f4('0x1')]=_0x173719[_0x50f4('0x1')]||{};}module[_0x50f4('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 74e7682..85088e5 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48cf=['length','online','loggedIn','mailPause','available','stringify','mail:queue:%s','exports','md5','util','ioredis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','paused'];(function(_0x41c14,_0x47327a){var _0xfd4168=function(_0x3ef0d7){while(--_0x3ef0d7){_0x41c14['push'](_0x41c14['shift']());}};_0xfd4168(++_0x47327a);}(_0x48cf,0x161));var _0xf48c=function(_0x1d337e,_0x54ebed){_0x1d337e=_0x1d337e-0x0;var _0x28dedd=_0x48cf[_0x1d337e];return _0x28dedd;};'use strict';var _=require('lodash');var md5=require(_0xf48c('0x0'));var util=require(_0xf48c('0x1'));var Redis=require(_0xf48c('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xf48c('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x549294){this['id']=_0x549294['id']||0x0;this[_0xf48c('0x4')]=_0x549294[_0xf48c('0x4')]||'';this[_0xf48c('0x5')]=_0x549294['timeout']||0xa;this[_0xf48c('0x6')]=_0x549294[_0xf48c('0x6')]||'beepall';this[_0xf48c('0x7')]=_0x549294[_0xf48c('0x7')];this[_0xf48c('0x8')]={};this[_0xf48c('0x9')]=0x0;this[_0xf48c('0x0')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0xf48c('0xa')][_0xf48c('0xb')]=function(){var _0x59d71b=this['mapAgentsId'][_0xf48c('0xc')];this[_0xf48c('0x8')]=_[_0xf48c('0xd')](this[_0xf48c('0x7')],'id');this[_0xf48c('0x8')][_0xf48c('0xc')]=_0x59d71b;};MailQueue[_0xf48c('0xa')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xf48c('0xe')]=0x0;for(var _0x1fd35a=0x0;_0x1fd35a=0x0?this[_0xf48c('0x13')]:0x0;var _0x243aa5={'id':this['id'],'available':this[_0xf48c('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xf48c('0x4')],'paused':this[_0xf48c('0xe')],'waiting':this[_0xf48c('0x9')]};var _0x4301db=md5(JSON[_0xf48c('0x14')](_0x243aa5));if(this[_0xf48c('0x0')]!==_0x4301db){this[_0xf48c('0x0')]=_0x4301db;io['to'](util['format'](_0xf48c('0x15'),_0x243aa5[_0xf48c('0x4')]))['emit']('mail_queue:save',_0x243aa5);}};module[_0xf48c('0x16')]=MailQueue; \ No newline at end of file +var _0x1655=['ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','emit','exports','lodash','md5','util'];(function(_0x2e6938,_0x30549c){var _0x464d2d=function(_0x1cdf61){while(--_0x1cdf61){_0x2e6938['push'](_0x2e6938['shift']());}};_0x464d2d(++_0x30549c);}(_0x1655,0xb1));var _0x5165=function(_0x97c0ac,_0x1b4271){_0x97c0ac=_0x97c0ac-0x0;var _0x4728ab=_0x1655[_0x97c0ac];return _0x4728ab;};'use strict';var _=require(_0x5165('0x0'));var md5=require(_0x5165('0x1'));var util=require(_0x5165('0x2'));var Redis=require(_0x5165('0x3'));var config=require('../../../config/environment');config[_0x5165('0x4')]=_[_0x5165('0x5')](config[_0x5165('0x4')],{'host':_0x5165('0x6'),'port':0x18eb});var io=require(_0x5165('0x7'))(new Redis(config['redis']));function MailQueue(_0x16692c){this['id']=_0x16692c['id']||0x0;this[_0x5165('0x8')]=_0x16692c['name']||'';this[_0x5165('0x9')]=_0x16692c[_0x5165('0x9')]||0xa;this[_0x5165('0xa')]=_0x16692c[_0x5165('0xa')]||_0x5165('0xb');this[_0x5165('0xc')]=_0x16692c['Agents'];this[_0x5165('0xd')]={};this['waiting']=0x0;this[_0x5165('0x1')]='';this[_0x5165('0xe')]();this['updateRealtime']();}MailQueue[_0x5165('0xf')][_0x5165('0xe')]=function(){var _0x1086a7=this[_0x5165('0xd')][_0x5165('0x10')];this[_0x5165('0xd')]=_[_0x5165('0x11')](this[_0x5165('0xc')],'id');this[_0x5165('0xd')][_0x5165('0x10')]=_0x1086a7;};MailQueue[_0x5165('0xf')][_0x5165('0x12')]=function(){this[_0x5165('0x13')]=0x0;this[_0x5165('0x14')]=0x0;for(var _0x3f5329=0x0;_0x3f5329=0x0?this[_0x5165('0x18')]:0x0;var _0x29885a={'id':this['id'],'available':this[_0x5165('0x18')],'loggedIn':this[_0x5165('0x13')],'name':this[_0x5165('0x8')],'paused':this[_0x5165('0x14')],'waiting':this[_0x5165('0x19')]};var _0x1ef8af=md5(JSON[_0x5165('0x1a')](_0x29885a));if(this['md5']!==_0x1ef8af){this[_0x5165('0x1')]=_0x1ef8af;io['to'](util[_0x5165('0x1b')]('mail:queue:%s',_0x29885a[_0x5165('0x8')]))[_0x5165('0x1c')]('mail_queue:save',_0x29885a);}};module[_0x5165('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index cc2cfcc..19d13c2 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x7a54,0x106));var _0x47a5=function(_0x219c48,_0x49dcab){_0x219c48=_0x219c48-0x0;var _0x308f2b=_0x7a54[_0x219c48];return _0x308f2b;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 3a7a5ec..8ea8829 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aaf=['_rr','mapAgentsId','map','prototype','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','util','ioredis','defaults','localhost','redis','name','timeout','beepall','Agents','md5','updateRouting','updateRealtime'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x124951,_0x52cdad){_0x124951=_0x124951-0x0;var _0x281c18=_0x7aaf[_0x124951];return _0x281c18;};'use strict';var _=require(_0xf7aa('0x0'));var md5=require('md5');var util=require(_0xf7aa('0x1'));var Redis=require(_0xf7aa('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xf7aa('0x3')](config['redis'],{'host':_0xf7aa('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf7aa('0x5')]));function SmsQueue(_0x20dc82){this['id']=_0x20dc82['id']||0x0;this[_0xf7aa('0x6')]=_0x20dc82[_0xf7aa('0x6')]||'';this['timeout']=_0x20dc82[_0xf7aa('0x7')]||0xa;this['strategy']=_0x20dc82['strategy']||_0xf7aa('0x8');this[_0xf7aa('0x9')]=_0x20dc82['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xf7aa('0xa')]='';this[_0xf7aa('0xb')]();this[_0xf7aa('0xc')]();}SmsQueue['prototype'][_0xf7aa('0xb')]=function(){var _0x5a7b21=this['mapAgentsId'][_0xf7aa('0xd')];this[_0xf7aa('0xe')]=_[_0xf7aa('0xf')](this[_0xf7aa('0x9')],'id');this[_0xf7aa('0xe')][_0xf7aa('0xd')]=_0x5a7b21;};SmsQueue[_0xf7aa('0x10')][_0xf7aa('0xc')]=function(){this[_0xf7aa('0x11')]=0x0;this[_0xf7aa('0x12')]=0x0;for(var _0x5d3ed3=0x0;_0x5d3ed3=0x0?this[_0xf7aa('0x16')]:0x0;var _0x305d6e={'id':this['id'],'available':this[_0xf7aa('0x16')],'loggedIn':this[_0xf7aa('0x11')],'name':this[_0xf7aa('0x6')],'paused':this[_0xf7aa('0x12')],'waiting':this['waiting']};var _0x59b540=md5(JSON[_0xf7aa('0x17')](_0x305d6e));if(this['md5']!==_0x59b540){this[_0xf7aa('0xa')]=_0x59b540;io['to'](util[_0xf7aa('0x18')](_0xf7aa('0x19'),_0x305d6e['name']))['emit'](_0xf7aa('0x1a'),_0x305d6e);}};module[_0xf7aa('0x1b')]=SmsQueue; \ No newline at end of file +var _0x1306=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x1306,0x17a));var _0x6130=function(_0x5c54d8,_0x2d1594){_0x5c54d8=_0x5c54d8-0x0;var _0x2f1472=_0x1306[_0x5c54d8];return _0x2f1472;};'use strict';var _=require(_0x6130('0x0'));var md5=require(_0x6130('0x1'));var util=require(_0x6130('0x2'));var Redis=require(_0x6130('0x3'));var config=require(_0x6130('0x4'));config[_0x6130('0x5')]=_[_0x6130('0x6')](config[_0x6130('0x5')],{'host':_0x6130('0x7'),'port':0x18eb});var io=require(_0x6130('0x8'))(new Redis(config[_0x6130('0x5')]));function SmsQueue(_0x181070){this['id']=_0x181070['id']||0x0;this[_0x6130('0x9')]=_0x181070[_0x6130('0x9')]||'';this[_0x6130('0xa')]=_0x181070[_0x6130('0xa')]||0xa;this[_0x6130('0xb')]=_0x181070[_0x6130('0xb')]||_0x6130('0xc');this[_0x6130('0xd')]=_0x181070[_0x6130('0xd')];this[_0x6130('0xe')]={};this[_0x6130('0xf')]=0x0;this[_0x6130('0x1')]='';this[_0x6130('0x10')]();this[_0x6130('0x11')]();}SmsQueue[_0x6130('0x12')][_0x6130('0x10')]=function(){var _0xac0bf1=this['mapAgentsId'][_0x6130('0x13')];this['mapAgentsId']=_[_0x6130('0x14')](this[_0x6130('0xd')],'id');this['mapAgentsId'][_0x6130('0x13')]=_0xac0bf1;};SmsQueue[_0x6130('0x12')][_0x6130('0x11')]=function(){this[_0x6130('0x15')]=0x0;this[_0x6130('0x16')]=0x0;for(var _0x3470e8=0x0;_0x3470e8=0x0?this['available']:0x0;var _0x1cd785={'id':this['id'],'available':this[_0x6130('0x1a')],'loggedIn':this[_0x6130('0x15')],'name':this[_0x6130('0x9')],'paused':this[_0x6130('0x16')],'waiting':this['waiting']};var _0x33f0f6=md5(JSON['stringify'](_0x1cd785));if(this[_0x6130('0x1')]!==_0x33f0f6){this[_0x6130('0x1')]=_0x33f0f6;io['to'](util[_0x6130('0x1b')](_0x6130('0x1c'),_0x1cd785[_0x6130('0x9')]))['emit']('sms_queue:save',_0x1cd785);}};module[_0x6130('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index e885c92..f3cb7ca 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f4b=['lodash','ioredis','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','Agents','updateRealtime','loggedIn','length','online','paused','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports'];(function(_0x4fc20b,_0x30ee6c){var _0x450777=function(_0x3bf049){while(--_0x3bf049){_0x4fc20b['push'](_0x4fc20b['shift']());}};_0x450777(++_0x30ee6c);}(_0x4f4b,0xbd));var _0xb4f4=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4f4b[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xb4f4('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xb4f4('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xb4f4('0x2')],{'host':_0xb4f4('0x3'),'port':0x18eb});var io=require(_0xb4f4('0x4'))(new Redis(config['redis']));function WhatsappQueue(_0x55d3ad){this['id']=_0x55d3ad['id']||0x0;this[_0xb4f4('0x5')]=_0x55d3ad['name']||'';this[_0xb4f4('0x6')]=_0x55d3ad[_0xb4f4('0x6')]||0xa;this['strategy']=_0x55d3ad['strategy']||_0xb4f4('0x7');this['Agents']=_0x55d3ad['Agents'];this[_0xb4f4('0x8')]={};this[_0xb4f4('0x9')]=0x0;this[_0xb4f4('0xa')]='';this[_0xb4f4('0xb')]();this['updateRealtime']();}WhatsappQueue[_0xb4f4('0xc')][_0xb4f4('0xb')]=function(){var _0x507c8a=this[_0xb4f4('0x8')][_0xb4f4('0xd')];this[_0xb4f4('0x8')]=_[_0xb4f4('0xe')](this[_0xb4f4('0xf')],'id');this[_0xb4f4('0x8')][_0xb4f4('0xd')]=_0x507c8a;};WhatsappQueue['prototype'][_0xb4f4('0x10')]=function(){this[_0xb4f4('0x11')]=0x0;this['paused']=0x0;for(var _0x398c7d=0x0;_0x398c7d=0x0?this[_0xb4f4('0x15')]:0x0;var _0x507c38={'id':this['id'],'available':this[_0xb4f4('0x15')],'loggedIn':this[_0xb4f4('0x11')],'name':this['name'],'paused':this[_0xb4f4('0x14')],'waiting':this[_0xb4f4('0x9')]};var _0x2b6ca6=md5(JSON[_0xb4f4('0x16')](_0x507c38));if(this[_0xb4f4('0xa')]!==_0x2b6ca6){this[_0xb4f4('0xa')]=_0x2b6ca6;io['to'](util['format'](_0xb4f4('0x17'),_0x507c38[_0xb4f4('0x5')]))[_0xb4f4('0x18')](_0xb4f4('0x19'),_0x507c38);}};module[_0xb4f4('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x5d35=['paused','online','available','name','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','../../../config/environment','defaults','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0x33be77,_0x43896e){var _0x5d48a5=function(_0x1cb1c0){while(--_0x1cb1c0){_0x33be77['push'](_0x33be77['shift']());}};_0x5d48a5(++_0x43896e);}(_0x5d35,0x192));var _0x55d3=function(_0x3713d5,_0x547e07){_0x3713d5=_0x3713d5-0x0;var _0x4773de=_0x5d35[_0x3713d5];return _0x4773de;};'use strict';var _=require(_0x55d3('0x0'));var md5=require(_0x55d3('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x55d3('0x2'));config['redis']=_[_0x55d3('0x3')](config[_0x55d3('0x4')],{'host':_0x55d3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x55d3('0x4')]));function WhatsappQueue(_0x13bdd5){this['id']=_0x13bdd5['id']||0x0;this['name']=_0x13bdd5['name']||'';this[_0x55d3('0x6')]=_0x13bdd5[_0x55d3('0x6')]||0xa;this[_0x55d3('0x7')]=_0x13bdd5[_0x55d3('0x7')]||_0x55d3('0x8');this[_0x55d3('0x9')]=_0x13bdd5[_0x55d3('0x9')];this[_0x55d3('0xa')]={};this[_0x55d3('0xb')]=0x0;this[_0x55d3('0x1')]='';this[_0x55d3('0xc')]();this[_0x55d3('0xd')]();}WhatsappQueue['prototype'][_0x55d3('0xc')]=function(){var _0x24076a=this[_0x55d3('0xa')][_0x55d3('0xe')];this[_0x55d3('0xa')]=_[_0x55d3('0xf')](this[_0x55d3('0x9')],'id');this[_0x55d3('0xa')][_0x55d3('0xe')]=_0x24076a;};WhatsappQueue[_0x55d3('0x10')][_0x55d3('0xd')]=function(){this[_0x55d3('0x11')]=0x0;this[_0x55d3('0x12')]=0x0;for(var _0x3bd9dd=0x0;_0x3bd9dd=0x0?this[_0x55d3('0x14')]:0x0;var _0x365e5d={'id':this['id'],'available':this[_0x55d3('0x14')],'loggedIn':this[_0x55d3('0x11')],'name':this[_0x55d3('0x15')],'paused':this[_0x55d3('0x12')],'waiting':this['waiting']};var _0x4a8758=md5(JSON[_0x55d3('0x16')](_0x365e5d));if(this[_0x55d3('0x1')]!==_0x4a8758){this['md5']=_0x4a8758;io['to'](util[_0x55d3('0x17')](_0x55d3('0x18'),_0x365e5d['name']))[_0x55d3('0x19')](_0x55d3('0x1a'),_0x365e5d);}};module[_0x55d3('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 8ccf3fb..c7e73bb 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 +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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 2aa8f77..869cbaa 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc38d=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xc38d,0x89));var _0xdc38=function(_0x3d7303,_0xbfce88){_0x3d7303=_0x3d7303-0x0;var _0x2252d=_0xc38d[_0x3d7303];return _0x2252d;};'use strict';var client=require(_0xdc38('0x0'));exports[_0xdc38('0x1')]=function(_0x35b5c,_0x55c9a2){return client['Request'](_0xdc38('0x2'),{'body':_0x55c9a2,'options':{'where':{'id':_0x35b5c}},'log':_0xdc38('0x3')});};exports[_0xdc38('0x4')]=function(_0x462c6f,_0x44d092){return client['Request'](_0xdc38('0x5'),{'body':_0x44d092,'options':{'where':{'id':_0x462c6f}},'log':_0xdc38('0x6')});}; \ No newline at end of file +var _0xa1c8=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x59075a,_0x1278d7){var _0x14b4e5=function(_0x2db124){while(--_0x2db124){_0x59075a['push'](_0x59075a['shift']());}};_0x14b4e5(++_0x1278d7);}(_0xa1c8,0xca));var _0x8a1c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa1c8[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x8a1c('0x0'));exports[_0x8a1c('0x1')]=function(_0x578aa9,_0x1548fe){return client[_0x8a1c('0x2')](_0x8a1c('0x3'),{'body':_0x1548fe,'options':{'where':{'id':_0x578aa9}},'log':_0x8a1c('0x4')});};exports[_0x8a1c('0x5')]=function(_0x16f2c0,_0x5ab489){return client['Request'](_0x8a1c('0x6'),{'body':_0x5ab489,'options':{'where':{'id':_0x16f2c0}},'log':_0x8a1c('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9a6511c..812fed1 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7651=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x469744,_0x34aab4){var _0x5a2c66=function(_0x415f9f){while(--_0x415f9f){_0x469744['push'](_0x469744['shift']());}};_0x5a2c66(++_0x34aab4);}(_0x7651,0x179));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x1765('0x0'));exports['create']=function(_0x2ef783){return client[_0x1765('0x1')](_0x1765('0x2'),{'body':_0x2ef783,'log':_0x1765('0x3')});}; \ No newline at end of file +var _0xfdff=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x29ba98,_0x4dad7e){var _0x464e83=function(_0x195b47){while(--_0x195b47){_0x29ba98['push'](_0x29ba98['shift']());}};_0x464e83(++_0x4dad7e);}(_0xfdff,0x14f));var _0xffdf=function(_0x4b2da4,_0x45f055){_0x4b2da4=_0x4b2da4-0x0;var _0x376450=_0xfdff[_0x4b2da4];return _0x376450;};'use strict';var client=require(_0xffdf('0x0'));exports[_0xffdf('0x1')]=function(_0x2fb7ce){return client[_0xffdf('0x2')](_0xffdf('0x3'),{'body':_0x2fb7ce,'log':_0xffdf('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f8d48e3..080907c 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabe8=['timeout','User','online','chatPause','../client','getChatQueues','Request','name'];(function(_0x608fa5,_0xe8df83){var _0x391956=function(_0x22845f){while(--_0x22845f){_0x608fa5['push'](_0x608fa5['shift']());}};_0x391956(++_0xe8df83);}(_0xabe8,0x8c));var _0x8abe=function(_0x4ed955,_0xabd42e){_0x4ed955=_0x4ed955-0x0;var _0xa17954=_0xabe8[_0x4ed955];return _0xa17954;};'use strict';var client=require(_0x8abe('0x0'));exports[_0x8abe('0x1')]=function(){return function(){return client[_0x8abe('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x8abe('0x3'),_0x8abe('0x4'),'strategy'],'include':[{'model':_0x8abe('0x5'),'as':'Agents','attributes':['id',_0x8abe('0x3'),_0x8abe('0x6'),_0x8abe('0x7')]}]},'log':_0x8abe('0x1')});};}; \ No newline at end of file +var _0xc99e=['../client','getChatQueues','Request','GetChatQueue','name','timeout','User','Agents','online','chatPause'];(function(_0x296239,_0x48a53a){var _0x1f8db5=function(_0x13ac58){while(--_0x13ac58){_0x296239['push'](_0x296239['shift']());}};_0x1f8db5(++_0x48a53a);}(_0xc99e,0x6e));var _0xec99=function(_0x2bd56e,_0x4ba093){_0x2bd56e=_0x2bd56e-0x0;var _0x353689=_0xc99e[_0x2bd56e];return _0x353689;};'use strict';var client=require(_0xec99('0x0'));exports[_0xec99('0x1')]=function(){return function(){return client[_0xec99('0x2')](_0xec99('0x3'),{'options':{'raw':![],'attributes':['id',_0xec99('0x4'),_0xec99('0x5'),'strategy'],'include':[{'model':_0xec99('0x6'),'as':_0xec99('0x7'),'attributes':['id',_0xec99('0x4'),_0xec99('0x8'),_0xec99('0x9')]}]},'log':_0xec99('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6657669..b2805c5 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8128=['CreateChatQueueReport','DESC','UpdateChatQueueReport','../client','Request'];(function(_0x487581,_0x55ccce){var _0x4d63eb=function(_0x4567d4){while(--_0x4567d4){_0x487581['push'](_0x487581['shift']());}};_0x4d63eb(++_0x55ccce);}(_0x8128,0x1b1));var _0x8812=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8128[_0x5bd426];return _0x23a7eb;};'use strict';var client=require(_0x8812('0x0'));exports['create']=function(_0x529739){return client[_0x8812('0x1')](_0x8812('0x2'),{'body':_0x529739,'log':'CreateChatQueueReport'});};exports['update']=function(_0x1c189a,_0x2aeddc){return client[_0x8812('0x1')]('UpdateChatQueueReport',{'body':_0x2aeddc,'options':{'where':{'uniqueid':_0x1c189a},'order':[['id',_0x8812('0x3')]],'limit':0x1},'log':_0x8812('0x4')});}; \ No newline at end of file +var _0x167e=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x4fbb3e,_0x55785f){var _0x1eb197=function(_0xfda25){while(--_0xfda25){_0x4fbb3e['push'](_0x4fbb3e['shift']());}};_0x1eb197(++_0x55785f);}(_0x167e,0xa3));var _0xe167=function(_0x29bbbe,_0x41dc63){_0x29bbbe=_0x29bbbe-0x0;var _0x2b7776=_0x167e[_0x29bbbe];return _0x2b7776;};'use strict';var client=require(_0xe167('0x0'));exports[_0xe167('0x1')]=function(_0x2a44c5){return client[_0xe167('0x2')](_0xe167('0x3'),{'body':_0x2a44c5,'log':_0xe167('0x3')});};exports[_0xe167('0x4')]=function(_0x62d76c,_0x5e4863){return client[_0xe167('0x2')]('UpdateChatQueueReport',{'body':_0x5e4863,'options':{'where':{'uniqueid':_0x62d76c},'order':[['id',_0xe167('0x5')]],'limit':0x1},'log':_0xe167('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 0dbdbee..2df8e3a 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x7a54,0x106));var _0x47a5=function(_0x17b24c,_0x39cbb5){_0x17b24c=_0x17b24c-0x0;var _0x282a9b=_0x7a54[_0x17b24c];return _0x282a9b;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x7a54,0x106));var _0x47a5=function(_0x19948c,_0x439d48){_0x19948c=_0x19948c-0x0;var _0x257b43=_0x7a54[_0x19948c];return _0x257b43;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 0f9845b..123c837 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8075=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x5b58ba,_0x16159f){var _0xc67099=function(_0x1c5b8a){while(--_0x1c5b8a){_0x5b58ba['push'](_0x5b58ba['shift']());}};_0xc67099(++_0x16159f);}(_0x8075,0x14d));var _0x5807=function(_0x43da10,_0x164096){_0x43da10=_0x43da10-0x0;var _0x37e34c=_0x8075[_0x43da10];return _0x37e34c;};'use strict';var client=require(_0x5807('0x0'));exports[_0x5807('0x1')]=function(_0x1d7612){return client[_0x5807('0x2')](_0x5807('0x3'),{'body':_0x1d7612,'log':_0x5807('0x4')});}; \ No newline at end of file +var _0x812c=['createFaxMessage','Request','CreateFaxMessage'];(function(_0x26a91c,_0x1547d0){var _0x4100a5=function(_0x32a405){while(--_0x32a405){_0x26a91c['push'](_0x26a91c['shift']());}};_0x4100a5(++_0x1547d0);}(_0x812c,0xf4));var _0xc812=function(_0x3c3407,_0x54bc76){_0x3c3407=_0x3c3407-0x0;var _0xd8eb13=_0x812c[_0x3c3407];return _0xd8eb13;};'use strict';var client=require('../client');exports['create']=function(_0x5c6593){return client[_0xc812('0x0')](_0xc812('0x1'),{'body':_0x5c6593,'log':_0xc812('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 404be06..d7f91c8 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c3a=['online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x19553d,_0x1edcef){var _0x5de0af=function(_0x3b8c34){while(--_0x3b8c34){_0x19553d['push'](_0x19553d['shift']());}};_0x5de0af(++_0x1edcef);}(_0x1c3a,0x1c5));var _0xa1c3=function(_0x270b9d,_0x8e1c){_0x270b9d=_0x270b9d-0x0;var _0x32ac0c=_0x1c3a[_0x270b9d];return _0x32ac0c;};'use strict';var client=require(_0xa1c3('0x0'));exports[_0xa1c3('0x1')]=function(){return function(){return client[_0xa1c3('0x2')](_0xa1c3('0x3'),{'options':{'raw':![],'attributes':['id',_0xa1c3('0x4'),_0xa1c3('0x5'),_0xa1c3('0x6')],'include':[{'model':_0xa1c3('0x7'),'as':_0xa1c3('0x8'),'attributes':['id',_0xa1c3('0x4'),_0xa1c3('0x9'),_0xa1c3('0xa')]}]},'log':_0xa1c3('0x1')});};}; \ No newline at end of file +var _0xfc8b=['getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause','../client'];(function(_0x2f34aa,_0x4f5e96){var _0x36bf5f=function(_0x345f7d){while(--_0x345f7d){_0x2f34aa['push'](_0x2f34aa['shift']());}};_0x36bf5f(++_0x4f5e96);}(_0xfc8b,0x103));var _0xbfc8=function(_0x126e11,_0x927f3a){_0x126e11=_0x126e11-0x0;var _0x303f35=_0xfc8b[_0x126e11];return _0x303f35;};'use strict';var client=require(_0xbfc8('0x0'));exports[_0xbfc8('0x1')]=function(){return function(){return client[_0xbfc8('0x2')](_0xbfc8('0x3'),{'options':{'raw':![],'attributes':['id',_0xbfc8('0x4'),'timeout',_0xbfc8('0x5')],'include':[{'model':_0xbfc8('0x6'),'as':_0xbfc8('0x7'),'attributes':['id',_0xbfc8('0x4'),_0xbfc8('0x8'),_0xbfc8('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 10a873b..cfb54df 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd08e=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x4498f5,_0x2d3ae8){var _0x38a460=function(_0x13defd){while(--_0x13defd){_0x4498f5['push'](_0x4498f5['shift']());}};_0x38a460(++_0x2d3ae8);}(_0xd08e,0x120));var _0xed08=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xd08e[_0x5c3ae9];return _0x3f5950;};'use strict';var client=require(_0xed08('0x0'));exports[_0xed08('0x1')]=function(_0x15987c){return client[_0xed08('0x2')](_0xed08('0x3'),{'body':_0x15987c,'log':_0xed08('0x3')});};exports[_0xed08('0x4')]=function(_0x3a20dc,_0x394069){return client[_0xed08('0x2')](_0xed08('0x5'),{'body':_0x394069,'options':{'where':{'uniqueid':_0x3a20dc},'order':[['id',_0xed08('0x6')]],'limit':0x1},'log':_0xed08('0x5')});}; \ No newline at end of file +var _0xb973=['CreateFaxQueueReport','update','Request','DESC','UpdateFaxQueueReport','../client'];(function(_0x3127d4,_0x519d3b){var _0x573f75=function(_0x5180d0){while(--_0x5180d0){_0x3127d4['push'](_0x3127d4['shift']());}};_0x573f75(++_0x519d3b);}(_0xb973,0x167));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3b97('0x0'));exports['create']=function(_0x11713b){return client['Request']('CreateFaxQueueReport',{'body':_0x11713b,'log':_0x3b97('0x1')});};exports[_0x3b97('0x2')]=function(_0x2ade61,_0x46971e){return client[_0x3b97('0x3')]('UpdateFaxQueueReport',{'body':_0x46971e,'options':{'where':{'uniqueid':_0x2ade61},'order':[['id',_0x3b97('0x4')]],'limit':0x1},'log':_0x3b97('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b81670e..2fc18a4 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45f5=['Intervals','name','interval','../client','getIntervals','Interval'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x45f5,0x1c5));var _0x545f=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0x45f5[_0xed5f9c];return _0x3a1c43;};'use strict';var client=require(_0x545f('0x0'));exports[_0x545f('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x545f('0x2'),'as':_0x545f('0x3'),'attributes':['id',_0x545f('0x4'),_0x545f('0x5')]}]},'log':_0x545f('0x1')});};}; \ No newline at end of file +var _0xb275=['interval','../client','getIntervals','GetInterval','name','Interval'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb275,0xcd));var _0x5b27=function(_0x48631f,_0x50a5bb){_0x48631f=_0x48631f-0x0;var _0x8ef75d=_0xb275[_0x48631f];return _0x8ef75d;};'use strict';var client=require(_0x5b27('0x0'));exports[_0x5b27('0x1')]=function(){return function(){return client['Request'](_0x5b27('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5b27('0x3')],'include':[{'model':_0x5b27('0x4'),'as':'Intervals','attributes':['id','name',_0x5b27('0x5')]}]},'log':_0x5b27('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index d446fa9..35db7c7 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','Request','AddTagsToMailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x58a5ec,_0x5059bf){_0x58a5ec=_0x58a5ec-0x0;var _0x49f8e2=_0x2032[_0x58a5ec];return _0x49f8e2;};'use strict';var client=require('../client');exports[_0x2203('0x0')]=function(_0x1e103d,_0xcd892f){return client['Request'](_0x2203('0x1'),{'body':_0xcd892f,'options':{'where':{'id':_0x1e103d}},'log':_0x2203('0x2')});};exports['addTags']=function(_0x46c49a,_0x880dcd){return client[_0x2203('0x3')](_0x2203('0x4'),{'body':_0x880dcd,'options':{'where':{'id':_0x46c49a}},'log':_0x2203('0x5')});}; \ No newline at end of file +var _0x8603=['update','updateMailInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x3f0a77,_0x1c3ad8){var _0x4b8cf9=function(_0x5ea3c0){while(--_0x5ea3c0){_0x3f0a77['push'](_0x3f0a77['shift']());}};_0x4b8cf9(++_0x1c3ad8);}(_0x8603,0x190));var _0x3860=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0x8603[_0x11b19b];return _0x1daac1;};'use strict';var client=require('../client');exports[_0x3860('0x0')]=function(_0x3b9c54,_0x96d2bc){return client['Request']('UpdateMailInteraction',{'body':_0x96d2bc,'options':{'where':{'id':_0x3b9c54}},'log':_0x3860('0x1')});};exports[_0x3860('0x2')]=function(_0x2f56a3,_0x490262){return client[_0x3860('0x3')]('AddTagsToMailInteraction',{'body':_0x490262,'options':{'where':{'id':_0x2f56a3}},'log':_0x3860('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1c265fc..fb550d7 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ed4=['../client','create','Request','CreateMailMessage'];(function(_0x5b3e24,_0x4fa7b5){var _0x7c0ee5=function(_0x12bf27){while(--_0x12bf27){_0x5b3e24['push'](_0x5b3e24['shift']());}};_0x7c0ee5(++_0x4fa7b5);}(_0x1ed4,0xc0));var _0x41ed=function(_0x4989b0,_0x507b0f){_0x4989b0=_0x4989b0-0x0;var _0x12a6d5=_0x1ed4[_0x4989b0];return _0x12a6d5;};'use strict';var client=require(_0x41ed('0x0'));exports[_0x41ed('0x1')]=function(_0x36e71b){return client[_0x41ed('0x2')](_0x41ed('0x3'),{'body':_0x36e71b,'log':'createMailMessage'});}; \ No newline at end of file +var _0xb7cf=['Request','../client','create'];(function(_0x57117d,_0xe0956e){var _0x4a230c=function(_0x43b11d){while(--_0x43b11d){_0x57117d['push'](_0x57117d['shift']());}};_0x4a230c(++_0xe0956e);}(_0xb7cf,0x145));var _0xfb7c=function(_0x202ea3,_0x38ab41){_0x202ea3=_0x202ea3-0x0;var _0x58787b=_0xb7cf[_0x202ea3];return _0x58787b;};'use strict';var client=require(_0xfb7c('0x0'));exports[_0xfb7c('0x1')]=function(_0x481214){return client[_0xfb7c('0x2')]('CreateMailMessage',{'body':_0x481214,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 46a8006..704adef 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabac=['Request','GetMailQueue','name','timeout','strategy','mailPause','getMailQueues'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xabac,0xf4));var _0xcaba=function(_0x186412,_0x156e12){_0x186412=_0x186412-0x0;var _0x3abbd4=_0xabac[_0x186412];return _0x3abbd4;};'use strict';var client=require('../client');exports[_0xcaba('0x0')]=function(){return function(){return client[_0xcaba('0x1')](_0xcaba('0x2'),{'options':{'raw':![],'attributes':['id',_0xcaba('0x3'),_0xcaba('0x4'),_0xcaba('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name','online',_0xcaba('0x6')]}]},'log':_0xcaba('0x0')});};}; \ No newline at end of file +var _0xfdf8=['name','User','online','getMailQueues','../client','Request'];(function(_0x57beaf,_0x165fb5){var _0x1f23c6=function(_0x240790){while(--_0x240790){_0x57beaf['push'](_0x57beaf['shift']());}};_0x1f23c6(++_0x165fb5);}(_0xfdf8,0x100));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x8fdf('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x8fdf('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x8fdf('0x2'),'timeout','strategy'],'include':[{'model':_0x8fdf('0x3'),'as':'Agents','attributes':['id',_0x8fdf('0x2'),_0x8fdf('0x4'),'mailPause']}]},'log':_0x8fdf('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 830ee5e..0507a83 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x093b=['CreateMailQueueReport','update','DESC','../client','create','Request'];(function(_0x5d0d10,_0x486c39){var _0x5b89dd=function(_0x136a87){while(--_0x136a87){_0x5d0d10['push'](_0x5d0d10['shift']());}};_0x5b89dd(++_0x486c39);}(_0x093b,0x1c5));var _0xb093=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x093b[_0x1646fa];return _0x5a47a5;};'use strict';var client=require(_0xb093('0x0'));exports[_0xb093('0x1')]=function(_0x2a4f57){return client[_0xb093('0x2')](_0xb093('0x3'),{'body':_0x2a4f57,'log':'CreateMailQueueReport'});};exports[_0xb093('0x4')]=function(_0x26b963,_0x1f4f23){return client[_0xb093('0x2')]('UpdateMailQueueReport',{'body':_0x1f4f23,'options':{'where':{'uniqueid':_0x26b963},'order':[['id',_0xb093('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x878b=['create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','../client'];(function(_0x11fe62,_0x462b8e){var _0x2cd6ed=function(_0x1e1e0c){while(--_0x1e1e0c){_0x11fe62['push'](_0x11fe62['shift']());}};_0x2cd6ed(++_0x462b8e);}(_0x878b,0x113));var _0xb878=function(_0x275cbc,_0x2a2ed6){_0x275cbc=_0x275cbc-0x0;var _0xd4e2a8=_0x878b[_0x275cbc];return _0xd4e2a8;};'use strict';var client=require(_0xb878('0x0'));exports[_0xb878('0x1')]=function(_0x18bc8d){return client[_0xb878('0x2')](_0xb878('0x3'),{'body':_0x18bc8d,'log':_0xb878('0x3')});};exports['update']=function(_0x371b6e,_0x2a7b07){return client[_0xb878('0x2')](_0xb878('0x4'),{'body':_0x2a7b07,'options':{'where':{'uniqueid':_0x371b6e},'order':[['id',_0xb878('0x5')]],'limit':0x1},'log':_0xb878('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index c05fe26..3441103 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc80d=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x264181,_0x586a6d){var _0x52a81d=function(_0x5a321d){while(--_0x5a321d){_0x264181['push'](_0x264181['shift']());}};_0x52a81d(++_0x586a6d);}(_0xc80d,0x1c1));var _0xdc80=function(_0xa13217,_0x4aa341){_0xa13217=_0xa13217-0x0;var _0x359201=_0xc80d[_0xa13217];return _0x359201;};'use strict';var client=require(_0xdc80('0x0'));exports[_0xdc80('0x1')]=function(_0x4af839,_0x46bda1){return client[_0xdc80('0x2')](_0xdc80('0x3'),{'body':_0x46bda1,'options':{'where':{'id':_0x4af839}},'log':_0xdc80('0x4')});};exports[_0xdc80('0x5')]=function(_0x10e16f,_0x1c72d0){return client[_0xdc80('0x2')](_0xdc80('0x6'),{'body':_0x1c72d0,'options':{'where':{'id':_0x10e16f}},'log':_0xdc80('0x7')});}; \ No newline at end of file +var _0xf55e=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','../client','update'];(function(_0x1eca34,_0x1397fc){var _0x1e43b7=function(_0x586570){while(--_0x586570){_0x1eca34['push'](_0x1eca34['shift']());}};_0x1e43b7(++_0x1397fc);}(_0xf55e,0xd6));var _0xef55=function(_0x50b3fa,_0x322c75){_0x50b3fa=_0x50b3fa-0x0;var _0x3318fe=_0xf55e[_0x50b3fa];return _0x3318fe;};'use strict';var client=require(_0xef55('0x0'));exports[_0xef55('0x1')]=function(_0x4f5de4,_0xe536b2){return client[_0xef55('0x2')](_0xef55('0x3'),{'body':_0xe536b2,'options':{'where':{'id':_0x4f5de4}},'log':_0xef55('0x4')});};exports[_0xef55('0x5')]=function(_0x195fc9,_0x21e7d8){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x21e7d8,'options':{'where':{'id':_0x195fc9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d202c1c..4f8b3ae 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78c7=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2ad9a0,_0x2c0ce4){var _0xafe65a=function(_0x263e2c){while(--_0x263e2c){_0x2ad9a0['push'](_0x2ad9a0['shift']());}};_0xafe65a(++_0x2c0ce4);}(_0x78c7,0x198));var _0x778c=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x78c7[_0x47aa64];return _0x549c7a;};'use strict';var client=require(_0x778c('0x0'));exports['create']=function(_0x563aa1){return client[_0x778c('0x1')](_0x778c('0x2'),{'body':_0x563aa1,'log':_0x778c('0x3')});}; \ No newline at end of file +var _0x2649=['Request','createOpenchannelMessage','../client'];(function(_0x20b5ab,_0x59a647){var _0x3bd618=function(_0x295f08){while(--_0x295f08){_0x20b5ab['push'](_0x20b5ab['shift']());}};_0x3bd618(++_0x59a647);}(_0x2649,0x8f));var _0x9264=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x2649[_0x87b0ff];return _0x3bc0b2;};'use strict';var client=require(_0x9264('0x0'));exports['create']=function(_0x17408d){return client[_0x9264('0x1')]('CreateOpenchannelMessage',{'body':_0x17408d,'log':_0x9264('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index a5e26c6..4432cf2 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8140=['Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8140,0x9c));var _0x0814=function(_0x45c60a,_0x17f344){_0x45c60a=_0x45c60a-0x0;var _0x25ab1b=_0x8140[_0x45c60a];return _0x25ab1b;};'use strict';var client=require('../client');exports[_0x0814('0x0')]=function(){return function(){return client[_0x0814('0x1')](_0x0814('0x2'),{'options':{'raw':![],'attributes':['id',_0x0814('0x3'),_0x0814('0x4'),_0x0814('0x5')],'include':[{'model':'User','as':_0x0814('0x6'),'attributes':['id','name',_0x0814('0x7'),_0x0814('0x8')]}]},'log':_0x0814('0x0')});};}; \ No newline at end of file +var _0x9d46=['name','timeout','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xddc063,_0x29ef7d){var _0x4cde0c=function(_0x1ba3e9){while(--_0x1ba3e9){_0xddc063['push'](_0xddc063['shift']());}};_0x4cde0c(++_0x29ef7d);}(_0x9d46,0x1f4));var _0x69d4=function(_0x1216bf,_0x2b0866){_0x1216bf=_0x1216bf-0x0;var _0x9ddc50=_0x9d46[_0x1216bf];return _0x9ddc50;};'use strict';var client=require(_0x69d4('0x0'));exports[_0x69d4('0x1')]=function(){return function(){return client[_0x69d4('0x2')](_0x69d4('0x3'),{'options':{'raw':![],'attributes':['id',_0x69d4('0x4'),_0x69d4('0x5'),'strategy'],'include':[{'model':_0x69d4('0x6'),'as':_0x69d4('0x7'),'attributes':['id','name','online',_0x69d4('0x8')]}]},'log':_0x69d4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 28a9826..f23b4a1 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7b1=['UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x232732,_0x2823ae){var _0x1796a9=function(_0x2840e6){while(--_0x2840e6){_0x232732['push'](_0x232732['shift']());}};_0x1796a9(++_0x2823ae);}(_0xa7b1,0x194));var _0x1a7b=function(_0x1aebe4,_0x54dba3){_0x1aebe4=_0x1aebe4-0x0;var _0x5b600d=_0xa7b1[_0x1aebe4];return _0x5b600d;};'use strict';var client=require('../client');exports[_0x1a7b('0x0')]=function(_0x5284e3){return client[_0x1a7b('0x1')](_0x1a7b('0x2'),{'body':_0x5284e3,'log':_0x1a7b('0x2')});};exports[_0x1a7b('0x3')]=function(_0x1f6f8d,_0x43c1ca){return client[_0x1a7b('0x1')](_0x1a7b('0x4'),{'body':_0x43c1ca,'options':{'where':{'uniqueid':_0x1f6f8d},'order':[['id',_0x1a7b('0x5')]],'limit':0x1},'log':_0x1a7b('0x4')});}; \ No newline at end of file +var _0x219c=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x469aab,_0x198e34){var _0x35a826=function(_0x261f7f){while(--_0x261f7f){_0x469aab['push'](_0x469aab['shift']());}};_0x35a826(++_0x198e34);}(_0x219c,0x163));var _0xc219=function(_0x277aa5,_0x3b6050){_0x277aa5=_0x277aa5-0x0;var _0x4b2aee=_0x219c[_0x277aa5];return _0x4b2aee;};'use strict';var client=require(_0xc219('0x0'));exports[_0xc219('0x1')]=function(_0x3dbfab){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x3dbfab,'log':_0xc219('0x2')});};exports[_0xc219('0x3')]=function(_0x14fad7,_0x5cfd65){return client[_0xc219('0x4')](_0xc219('0x5'),{'body':_0x5cfd65,'options':{'where':{'uniqueid':_0x14fad7},'order':[['id',_0xc219('0x6')]],'limit':0x1},'log':_0xc219('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 71f62d1..127fb2f 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde50=['UpdateSmsInteraction','addTags','Request'];(function(_0x522cbd,_0x244cbb){var _0xf435d7=function(_0x5f0efb){while(--_0x5f0efb){_0x522cbd['push'](_0x522cbd['shift']());}};_0xf435d7(++_0x244cbb);}(_0xde50,0x140));var _0x0de5=function(_0x53dba2,_0x1b09e5){_0x53dba2=_0x53dba2-0x0;var _0x415221=_0xde50[_0x53dba2];return _0x415221;};'use strict';var client=require('../client');exports['update']=function(_0x2938ef,_0x34b791){return client[_0x0de5('0x0')](_0x0de5('0x1'),{'body':_0x34b791,'options':{'where':{'id':_0x2938ef}},'log':'updateSmsInteraction'});};exports[_0x0de5('0x2')]=function(_0x5c22bc,_0x16fcda){return client['Request']('AddTagsToSmsInteraction',{'body':_0x16fcda,'options':{'where':{'id':_0x5c22bc}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x0a9a=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x38e79d,_0x4050ce){var _0x4021e6=function(_0x5e8c0c){while(--_0x5e8c0c){_0x38e79d['push'](_0x38e79d['shift']());}};_0x4021e6(++_0x4050ce);}(_0x0a9a,0x183));var _0xa0a9=function(_0x78ce99,_0x173dc1){_0x78ce99=_0x78ce99-0x0;var _0x22ddfd=_0x0a9a[_0x78ce99];return _0x22ddfd;};'use strict';var client=require('../client');exports[_0xa0a9('0x0')]=function(_0x51baa8,_0x3b1a40){return client[_0xa0a9('0x1')](_0xa0a9('0x2'),{'body':_0x3b1a40,'options':{'where':{'id':_0x51baa8}},'log':_0xa0a9('0x3')});};exports['addTags']=function(_0x317a94,_0x360be5){return client['Request'](_0xa0a9('0x4'),{'body':_0x360be5,'options':{'where':{'id':_0x317a94}},'log':_0xa0a9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 925af86..98f3939 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37c6=['createSmsMessage','CreateSmsMessage'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x37c6,0x133));var _0x637c=function(_0x25e626,_0x8a67){_0x25e626=_0x25e626-0x0;var _0x42ae01=_0x37c6[_0x25e626];return _0x42ae01;};'use strict';var client=require('../client');exports['create']=function(_0x340b8c){return client['Request'](_0x637c('0x0'),{'body':_0x340b8c,'log':_0x637c('0x1')});}; \ No newline at end of file +var _0xc4a5=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x3c3579,_0x64ce36){var _0x71745c=function(_0x1ad223){while(--_0x1ad223){_0x3c3579['push'](_0x3c3579['shift']());}};_0x71745c(++_0x64ce36);}(_0xc4a5,0x15f));var _0x5c4a=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xc4a5[_0xa8883];return _0x479426;};'use strict';var client=require(_0x5c4a('0x0'));exports[_0x5c4a('0x1')]=function(_0x597ea){return client[_0x5c4a('0x2')](_0x5c4a('0x3'),{'body':_0x597ea,'log':_0x5c4a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 129266a..3b2340e 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x41045f,_0x54994c){var _0x2721c8=function(_0x20bb67){while(--_0x20bb67){_0x41045f['push'](_0x41045f['shift']());}};_0x2721c8(++_0x54994c);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x539544,_0x5484a3){var _0x5c863e=function(_0x274978){while(--_0x274978){_0x539544['push'](_0x539544['shift']());}};_0x5c863e(++_0x5484a3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0xcb91[_0xf31767];return _0x24bd0c;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d900b9e..c32b58a 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x35b205,_0x24e696){var _0x20ecb2=function(_0xead3ac){while(--_0xead3ac){_0x35b205['push'](_0x35b205['shift']());}};_0x20ecb2(++_0x24e696);}(_0x70e0,0x17b));var _0x070e=function(_0x1ebf86,_0x655c9f){_0x1ebf86=_0x1ebf86-0x0;var _0x44edc7=_0x70e0[_0x1ebf86];return _0x44edc7;};'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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x306e60,_0x284708){var _0x6f7789=function(_0x3de569){while(--_0x3de569){_0x306e60['push'](_0x306e60['shift']());}};_0x6f7789(++_0x284708);}(_0x70e0,0x17b));var _0x070e=function(_0x2a6052,_0x2b2914){_0x2a6052=_0x2a6052-0x0;var _0x55951f=_0x70e0[_0x2a6052];return _0x55951f;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 70777e8..6a4ec2b 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x4aaa64,_0xae32ab){var _0x9aac36=function(_0x3ca958){while(--_0x3ca958){_0x4aaa64['push'](_0x4aaa64['shift']());}};_0x9aac36(++_0xae32ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x18cc6e,_0x3ff051){var _0x3ef7bd=function(_0x4c7b9d){while(--_0x4c7b9d){_0x18cc6e['push'](_0x18cc6e['shift']());}};_0x3ef7bd(++_0x3ff051);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 44c9c3d..d4b4967 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd87=['addTags','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x3fbb91,_0x5ec106){var _0x3eb213=function(_0x118b9f){while(--_0x118b9f){_0x3fbb91['push'](_0x3fbb91['shift']());}};_0x3eb213(++_0x5ec106);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7fd8('0x0'));exports[_0x7fd8('0x1')]=function(_0xd3eb35,_0x42ecd1){return client[_0x7fd8('0x2')](_0x7fd8('0x3'),{'body':_0x42ecd1,'options':{'where':{'id':_0xd3eb35}},'log':_0x7fd8('0x4')});};exports[_0x7fd8('0x5')]=function(_0x4429f2,_0x43b442){return client[_0x7fd8('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x43b442,'options':{'where':{'id':_0x4429f2}},'log':_0x7fd8('0x6')});}; \ No newline at end of file +var _0xd9fb=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update','Request'];(function(_0x37449b,_0x34444c){var _0xfee9a1=function(_0x2407ee){while(--_0x2407ee){_0x37449b['push'](_0x37449b['shift']());}};_0xfee9a1(++_0x34444c);}(_0xd9fb,0x189));var _0xbd9f=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xd9fb[_0x49ca18];return _0x145d54;};'use strict';var client=require(_0xbd9f('0x0'));exports[_0xbd9f('0x1')]=function(_0x288314,_0x1eeb46){return client[_0xbd9f('0x2')](_0xbd9f('0x3'),{'body':_0x1eeb46,'options':{'where':{'id':_0x288314}},'log':_0xbd9f('0x4')});};exports['addTags']=function(_0x2d4213,_0xf146bc){return client['Request'](_0xbd9f('0x5'),{'body':_0xf146bc,'options':{'where':{'id':_0x2d4213}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ac7bcf1..3bc2d93 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf408=['../client','create'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xf408,0x176));var _0x8f40=function(_0x3a2295,_0x3064c9){_0x3a2295=_0x3a2295-0x0;var _0x569710=_0xf408[_0x3a2295];return _0x569710;};'use strict';var client=require(_0x8f40('0x0'));exports[_0x8f40('0x1')]=function(_0x2e2ed6){return client['Request']('CreateWhatsappMessage',{'body':_0x2e2ed6,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xd532=['CreateWhatsappMessage','../client','create','Request'];(function(_0xf7bf02,_0x13da13){var _0x4f263f=function(_0x3b5603){while(--_0x3b5603){_0xf7bf02['push'](_0xf7bf02['shift']());}};_0x4f263f(++_0x13da13);}(_0xd532,0x149));var _0x2d53=function(_0x248390,_0x5a6316){_0x248390=_0x248390-0x0;var _0x1f431c=_0xd532[_0x248390];return _0x1f431c;};'use strict';var client=require(_0x2d53('0x0'));exports[_0x2d53('0x1')]=function(_0x2ce5bc){return client[_0x2d53('0x2')](_0x2d53('0x3'),{'body':_0x2ce5bc,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 28cc281..b7a70fd 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8910=['Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x47878b,_0x45d098){var _0x57183e=function(_0x3a6906){while(--_0x3a6906){_0x47878b['push'](_0x47878b['shift']());}};_0x57183e(++_0x45d098);}(_0x8910,0x121));var _0x0891=function(_0x32e9e9,_0x3df5aa){_0x32e9e9=_0x32e9e9-0x0;var _0x400b63=_0x8910[_0x32e9e9];return _0x400b63;};'use strict';var client=require('../client');exports[_0x0891('0x0')]=function(){return function(){return client[_0x0891('0x1')](_0x0891('0x2'),{'options':{'raw':![],'attributes':['id',_0x0891('0x3'),_0x0891('0x4'),_0x0891('0x5')],'include':[{'model':_0x0891('0x6'),'as':_0x0891('0x7'),'attributes':['id',_0x0891('0x3'),_0x0891('0x8'),_0x0891('0x9')]}]},'log':_0x0891('0x0')});};}; \ No newline at end of file +var _0x03bb=['name','timeout','strategy','Agents','getWhatsappQueues','../client','Request','GetWhatsappQueue'];(function(_0x51057c,_0x2a7744){var _0x236290=function(_0xe9aaa3){while(--_0xe9aaa3){_0x51057c['push'](_0x51057c['shift']());}};_0x236290(++_0x2a7744);}(_0x03bb,0x6d));var _0xb03b=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x03bb[_0x2405bc];return _0x5272d4;};'use strict';var client=require(_0xb03b('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xb03b('0x1')](_0xb03b('0x2'),{'options':{'raw':![],'attributes':['id',_0xb03b('0x3'),_0xb03b('0x4'),_0xb03b('0x5')],'include':[{'model':'User','as':_0xb03b('0x6'),'attributes':['id','name','online','whatsappPause']}]},'log':_0xb03b('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 1e074f0..7ac5f9a 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06d4=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client'];(function(_0x1bb572,_0x3674d8){var _0x3716e3=function(_0x5593ed){while(--_0x5593ed){_0x1bb572['push'](_0x1bb572['shift']());}};_0x3716e3(++_0x3674d8);}(_0x06d4,0x15b));var _0x406d=function(_0x30bfae,_0x15eb2b){_0x30bfae=_0x30bfae-0x0;var _0x23a4c9=_0x06d4[_0x30bfae];return _0x23a4c9;};'use strict';var client=require(_0x406d('0x0'));exports[_0x406d('0x1')]=function(_0x122028){return client[_0x406d('0x2')](_0x406d('0x3'),{'body':_0x122028,'log':'CreateWhatsappQueueReport'});};exports[_0x406d('0x4')]=function(_0x5b5aa3,_0x34d71b){return client['Request'](_0x406d('0x5'),{'body':_0x34d71b,'options':{'where':{'uniqueid':_0x5b5aa3},'order':[['id','DESC']],'limit':0x1},'log':_0x406d('0x5')});}; \ No newline at end of file +var _0x68c4=['Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x68c4,0xe8));var _0x468c=function(_0x3ba537,_0x56b969){_0x3ba537=_0x3ba537-0x0;var _0x585c1a=_0x68c4[_0x3ba537];return _0x585c1a;};'use strict';var client=require('../client');exports['create']=function(_0x4c2f56){return client[_0x468c('0x0')](_0x468c('0x1'),{'body':_0x4c2f56,'log':_0x468c('0x1')});};exports['update']=function(_0xba8783,_0x115132){return client['Request'](_0x468c('0x2'),{'body':_0x115132,'options':{'where':{'uniqueid':_0xba8783},'order':[['id',_0x468c('0x3')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c2b592a..c127b7f 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c34=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','error','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format'];(function(_0x124555,_0x48f05){var _0x157269=function(_0x37d5af){while(--_0x37d5af){_0x124555['push'](_0x124555['shift']());}};_0x157269(++_0x48f05);}(_0x1c34,0x65));var _0x41c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c34[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x41c3('0x0'));var _=require(_0x41c3('0x1'));var util=require('util');var seqqueue=require(_0x41c3('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x41c3('0x3'));var queue=schema({'name':{'type':_0x41c3('0x4'),'required':!![],'message':_0x41c3('0x5')},'timeout':{'type':_0x41c3('0x6'),'message':_0x41c3('0x7')}});function writeLog(_0x594b96,_0x3d33e7,_0xb775c0){return logger[_0x41c3('0x8')](util[_0x41c3('0x9')](_0x41c3('0xa'),_0x594b96,_0x3d33e7[_0x41c3('0xb')],_0xb775c0));}function handleFindAgent(_0x3cbd57){return function(_0x12ca4a){return _0x12ca4a[_0x41c3('0xb')][_0x41c3('0xc')]()===_0x3cbd57[_0x41c3('0xc')]();};}exports[_0x41c3('0xd')]=function(_0x4213a8,_0x387334,_0x159945,_0xe385e0){return function(_0x282019){try{var _0x42bb4e={'name':_0x387334[0x0],'timeout':_0x387334[0x1]};var _0x313dd0=queue['validate'](_0x42bb4e,{'typecast':!![]});if(_0x313dd0['length']){logger['error'](_0x41c3('0xe'),_0x4213a8,_[_0x41c3('0xf')](_0x313dd0,_0x41c3('0x10'))[_0x41c3('0x11')](',\x20'));_0x282019[_0x41c3('0x12')]();}else{var _0x4c836c=_[_0x41c3('0x13')](_0x159945[_0x41c3('0x14')],handleFindAgent(_0x42bb4e['name']));if(_0x4c836c){var _0x43e798=(_0x42bb4e[_0x41c3('0x15')]||0xa)*0x3e8;var _0x42fd4e,_0x24f94e;var _0x245e09=seqqueue[_0x41c3('0x16')](_0x43e798);_0x245e09['id']=_0x4213a8;_0x245e09['atimeout']=_0x43e798;_0x245e09[_0x41c3('0x17')]=_0xe385e0[_0x41c3('0x17')];writeLog(_0x4213a8,_0x4c836c,util[_0x41c3('0x9')](_0x41c3('0x18'),_0x43e798));_0x159945[_0x41c3('0x19')][_0x4213a8]['on'](_0x41c3('0x1a'),function(){logger[_0x41c3('0x8')](_0x41c3('0x1b'),_0x4213a8);clearTimeout(_0x24f94e);_0x24f94e=undefined;_0x245e09[_0x41c3('0x1c')]();if(_0x159945['rules'][_0x4213a8]){delete _0x159945[_0x41c3('0x19')][_0x4213a8];}_0x282019[_0x41c3('0x12')]();});_0x159945['rules'][_0x4213a8]['on'](_0x41c3('0x1d'),function(){if(_0x159945[_0x41c3('0x19')][_0x4213a8]){delete _0x159945['rules'][_0x4213a8];}});_0x24f94e=setTimeout(function(){logger[_0x41c3('0x8')](_0x41c3('0x1e'),_0x4213a8);clearTimeout(_0x24f94e);_0x245e09[_0x41c3('0x1c')]();_0x282019[_0x41c3('0x1f')]();},_0x43e798);strategy[_0x41c3('0x20')](_0x245e09,_0x4c836c,_0x159945,_0xe385e0);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4213a8,_0x42bb4e['name']);_0x282019['stop']();}}}catch(_0x287bfc){console[_0x41c3('0x21')](_0x287bfc);logger[_0x41c3('0x22')](_0x41c3('0x23'),_0x4213a8,_0x287bfc[_0x41c3('0x24')]);_0x282019[_0x41c3('0x12')]();}};}; \ No newline at end of file +var _0x0830=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','stop','find','timeout','atimeout','channel','START:%s','rules','close','[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing'];(function(_0x51821c,_0x2e39c5){var _0x20bde8=function(_0x2d307a){while(--_0x2d307a){_0x51821c['push'](_0x51821c['shift']());}};_0x20bde8(++_0x2e39c5);}(_0x0830,0x15b));var _0x0083=function(_0x1035ad,_0x18a82a){_0x1035ad=_0x1035ad-0x0;var _0x70d5c4=_0x0830[_0x1035ad];return _0x70d5c4;};'use strict';var schema=require(_0x0083('0x0'));var _=require(_0x0083('0x1'));var util=require(_0x0083('0x2'));var seqqueue=require(_0x0083('0x3'));var logger=require('../../../../config/logger')(_0x0083('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x0083('0x5')},'timeout':{'type':_0x0083('0x6'),'message':_0x0083('0x7')}});function writeLog(_0xa4753d,_0x1d6afc,_0x63b4c6){return logger[_0x0083('0x8')](util['format'](_0x0083('0x9'),_0xa4753d,_0x1d6afc[_0x0083('0xa')],_0x63b4c6));}function handleFindAgent(_0x5ae9fa){return function(_0x197151){return _0x197151[_0x0083('0xa')][_0x0083('0xb')]()===_0x5ae9fa['toLowerCase']();};}exports[_0x0083('0xc')]=function(_0x253014,_0x352ac6,_0xe6e4b4,_0x851f7c){return function(_0x5109ed){try{var _0x3f2bfb={'name':_0x352ac6[0x0],'timeout':_0x352ac6[0x1]};var _0xfb7061=queue[_0x0083('0x0')](_0x3f2bfb,{'typecast':!![]});if(_0xfb7061[_0x0083('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x253014,_[_0x0083('0xe')](_0xfb7061,_0x0083('0xf'))[_0x0083('0x10')](',\x20'));_0x5109ed[_0x0083('0x11')]();}else{var _0x3a9c26=_[_0x0083('0x12')](_0xe6e4b4['agents'],handleFindAgent(_0x3f2bfb[_0x0083('0xa')]));if(_0x3a9c26){var _0x3edd89=(_0x3f2bfb[_0x0083('0x13')]||0xa)*0x3e8;var _0x37cb07,_0x50009c;var _0x5dac2b=seqqueue['createQueue'](_0x3edd89);_0x5dac2b['id']=_0x253014;_0x5dac2b[_0x0083('0x14')]=_0x3edd89;_0x5dac2b[_0x0083('0x15')]=_0x851f7c[_0x0083('0x15')];writeLog(_0x253014,_0x3a9c26,util['format'](_0x0083('0x16'),_0x3edd89));_0xe6e4b4[_0x0083('0x17')][_0x253014]['on']('end',function(){logger[_0x0083('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x253014);clearTimeout(_0x50009c);_0x50009c=undefined;_0x5dac2b[_0x0083('0x18')]();if(_0xe6e4b4[_0x0083('0x17')][_0x253014]){delete _0xe6e4b4['rules'][_0x253014];}_0x5109ed[_0x0083('0x11')]();});_0xe6e4b4['rules'][_0x253014]['on']('complete',function(){if(_0xe6e4b4[_0x0083('0x17')][_0x253014]){delete _0xe6e4b4[_0x0083('0x17')][_0x253014];}});_0x50009c=setTimeout(function(){logger[_0x0083('0x8')](_0x0083('0x19'),_0x253014);clearTimeout(_0x50009c);_0x5dac2b[_0x0083('0x18')]();_0x5109ed[_0x0083('0x1a')]();},_0x3edd89);strategy['agent'](_0x5dac2b,_0x3a9c26,_0xe6e4b4,_0x851f7c);}else{logger[_0x0083('0x1b')](_0x0083('0x1c'),_0x253014,_0x3f2bfb[_0x0083('0xa')]);_0x5109ed[_0x0083('0x11')]();}}}catch(_0x517919){console[_0x0083('0x1d')](_0x517919);logger[_0x0083('0x1b')](_0x0083('0x1e'),_0x253014,_0x517919[_0x0083('0x1f')]);_0x5109ed[_0x0083('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index a5a5d2c..9eaa4b3 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x494f=['created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','catch','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','account'];(function(_0x4b5020,_0x1bd24e){var _0x137b65=function(_0xa24a){while(--_0xa24a){_0x4b5020['push'](_0x4b5020['shift']());}};_0x137b65(++_0x1bd24e);}(_0x494f,0x77));var _0xf494=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x494f[_0x373dee];return _0x46798f;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xf494('0x0'));var logger=require(_0xf494('0x1'))('routing');var rpc={'chatMessage':require(_0xf494('0x2')),'openchannelMessage':require(_0xf494('0x3')),'mailMessage':require(_0xf494('0x4')),'smsMessage':require(_0xf494('0x5')),'faxMessage':require(_0xf494('0x6')),'whatsappMessage':require(_0xf494('0x7'))};exports['consequence']=function(_0x19f543,_0x53517f){return function(_0x5925eb){try{if(!_['isNil'](this[_0xf494('0x8')][_0xf494('0x9')])){logger[_0xf494('0xa')](_0xf494('0xb'),_0x19f543,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5925eb[_0xf494('0xc')]();}var _0x1034ea={'ContactId':this[_0xf494('0xd')]['id'],'sentAt':moment()[_0xf494('0xe')](_0xf494('0xf')),'direction':_0xf494('0x10')};if(this[_0xf494('0x11')]===_0xf494('0x12')||this['channel']==='whatsapp'){_0x1034ea[_0xf494('0x13')]=this['interaction'][_0xf494('0x13')];}var _0xa63008=this[_0xf494('0x11')];if(_0xa63008===_0xf494('0x14')){_0x1034ea[_0xf494('0x15')]=this['account']['id'];}else{_0x1034ea[_[_0xf494('0x16')](_0xa63008)+_0xf494('0x17')]=this[_0xf494('0x18')]['id'];}_0x1034ea[_[_0xf494('0x16')](_0xa63008)+'InteractionId']=this[_0xf494('0x8')]['id'];if(this['interaction'][_0xf494('0x19')]){var _0x4a07f7=_0x53517f[0x4];if(!_[_0xf494('0x1a')](_0x4a07f7)){_0x1034ea[_0xf494('0x1b')]=utils[_0xf494('0x1c')](_0x4a07f7,this);return rpc[_0xa63008+_0xf494('0x1d')][_0xf494('0x1e')](_0x1034ea)[_0xf494('0x1f')](function(_0x91fb3b){logger[_0xf494('0xa')](_0xf494('0xb'),_0x19f543,_0x1034ea[_0xf494('0x1b')]);})['catch'](function(_0x454568){logger[_0xf494('0x20')](_0xf494('0xb'),_0x19f543,JSON[_0xf494('0x21')](_0x454568));})[_0xf494('0x22')](function(){logger[_0xf494('0xa')](_0xf494('0x23'),_0x19f543);_0x5925eb[_0xf494('0x24')]();});}else{logger[_0xf494('0xa')](_0xf494('0x25'),_0x19f543);_0x5925eb[_0xf494('0x24')]();}}else{var _0x309d52=this;var _0x5b8732=new AWS[(_0xf494('0x26'))]({'accessKeyId':_0x53517f[0x0],'secretAccessKey':_0x53517f[0x1],'region':_0x53517f[0x2]});var _0x30c2e1={'botAlias':_0xf494('0x27'),'botName':_0x53517f[0x3],'inputText':this[_0xf494('0x28')]['body'],'userId':this[_0xf494('0x11')]+':'+this[_0xf494('0x8')]['id'][_0xf494('0x29')]()};_0x5b8732[_0xf494('0x2a')](_0x30c2e1,function(_0x47354c,_0x4063a2){if(_0x47354c){logger[_0xf494('0x20')](_0xf494('0xb'),_0x19f543,_0x47354c[_0xf494('0x28')]);_0x5925eb[_0xf494('0xc')]();}else if(_0x4063a2&&_0x4063a2[_0xf494('0x28')]){_0x309d52[_0xf494('0x1b')][_0xf494('0x2b')]=_0x4063a2;_0x1034ea[_0xf494('0x1b')]=_0x4063a2[_0xf494('0x28')];_0x1034ea['providerName']=_0xf494('0x2b');_0x1034ea[_0xf494('0x2c')]=JSON[_0xf494('0x21')](_0x4063a2);return rpc[_0xa63008+_0xf494('0x1d')][_0xf494('0x1e')](_0x1034ea)[_0xf494('0x1f')](function(_0x34082c){logger['info']('[%s][AMAZONLEX]\x20%s',_0x19f543,_0x1034ea[_0xf494('0x1b')]);if(_0x4063a2[_0xf494('0x2d')]==_0xf494('0x2e')){_0x5925eb[_0xf494('0xc')]();}else{_0x5925eb[_0xf494('0x24')]();}})[_0xf494('0x2f')](function(_0x3b50f3){logger[_0xf494('0x20')](_0xf494('0xb'),_0x19f543,JSON['stringify'](_0x3b50f3));_0x5925eb[_0xf494('0xc')]();});}else{_0x5925eb[_0xf494('0xc')]();}});}}catch(_0x48e5c9){logger['error']('[%s][AMAZONLEX]\x20%s',_0x19f543,JSON[_0xf494('0x21')](_0x48e5c9));_0x5925eb['stop']();}};}; \ No newline at end of file +var _0xa1a1=['out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','body','getMustacheRender','Message','create','[%s][AMAZONLEX]\x20%s','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','postText','amazonlex','providerName','then','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x3e8082,_0x481707){var _0x58794=function(_0x25fb94){while(--_0x25fb94){_0x3e8082['push'](_0x3e8082['shift']());}};_0x58794(++_0x481707);}(_0xa1a1,0x144));var _0x1a1a=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0xa1a1[_0x27dba4];return _0x35ec9d;};'use strict';var _=require('lodash');var moment=require(_0x1a1a('0x0'));var AWS=require(_0x1a1a('0x1'));var utils=require(_0x1a1a('0x2'));var logger=require(_0x1a1a('0x3'))(_0x1a1a('0x4'));var rpc={'chatMessage':require(_0x1a1a('0x5')),'openchannelMessage':require(_0x1a1a('0x6')),'mailMessage':require(_0x1a1a('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1a1a('0x8')),'whatsappMessage':require(_0x1a1a('0x9'))};exports[_0x1a1a('0xa')]=function(_0x35bcde,_0x294278){return function(_0x5210fd){try{if(!_[_0x1a1a('0xb')](this[_0x1a1a('0xc')][_0x1a1a('0xd')])){logger[_0x1a1a('0xe')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,_0x1a1a('0xf'));return _0x5210fd[_0x1a1a('0x10')]();}var _0x116df4={'ContactId':this[_0x1a1a('0x11')]['id'],'sentAt':moment()[_0x1a1a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1a1a('0x13')};if(this[_0x1a1a('0x14')]===_0x1a1a('0x15')||this[_0x1a1a('0x14')]===_0x1a1a('0x16')){_0x116df4[_0x1a1a('0x17')]=this[_0x1a1a('0xc')][_0x1a1a('0x17')];}var _0x30919e=this['channel'];if(_0x30919e===_0x1a1a('0x18')){_0x116df4[_0x1a1a('0x19')]=this[_0x1a1a('0x1a')]['id'];}else{_0x116df4[_[_0x1a1a('0x1b')](_0x30919e)+_0x1a1a('0x1c')]=this[_0x1a1a('0x1a')]['id'];}_0x116df4[_['upperFirst'](_0x30919e)+'InteractionId']=this[_0x1a1a('0xc')]['id'];if(this[_0x1a1a('0xc')]['created']){var _0x4e5920=_0x294278[0x4];if(!_['isEmpty'](_0x4e5920)){_0x116df4[_0x1a1a('0x1d')]=utils[_0x1a1a('0x1e')](_0x4e5920,this);return rpc[_0x30919e+_0x1a1a('0x1f')][_0x1a1a('0x20')](_0x116df4)['then'](function(_0x15e291){logger[_0x1a1a('0xe')](_0x1a1a('0x21'),_0x35bcde,_0x116df4[_0x1a1a('0x1d')]);})['catch'](function(_0xb6bee4){logger[_0x1a1a('0x22')](_0x1a1a('0x21'),_0x35bcde,JSON[_0x1a1a('0x23')](_0xb6bee4));})[_0x1a1a('0x24')](function(){logger[_0x1a1a('0xe')](_0x1a1a('0x25'),_0x35bcde);_0x5210fd['stop']();});}else{logger['info'](_0x1a1a('0x26'),_0x35bcde);_0x5210fd[_0x1a1a('0x27')]();}}else{var _0x19505f=this;var _0xc1aba4=new AWS[(_0x1a1a('0x28'))]({'accessKeyId':_0x294278[0x0],'secretAccessKey':_0x294278[0x1],'region':_0x294278[0x2]});var _0x14d825={'botAlias':'$LATEST','botName':_0x294278[0x3],'inputText':this[_0x1a1a('0x29')][_0x1a1a('0x1d')],'userId':this[_0x1a1a('0x14')]+':'+this[_0x1a1a('0xc')]['id'][_0x1a1a('0x2a')]()};_0xc1aba4[_0x1a1a('0x2b')](_0x14d825,function(_0x5692e0,_0x13f519){if(_0x5692e0){logger[_0x1a1a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,_0x5692e0[_0x1a1a('0x29')]);_0x5210fd[_0x1a1a('0x10')]();}else if(_0x13f519&&_0x13f519[_0x1a1a('0x29')]){_0x19505f[_0x1a1a('0x1d')][_0x1a1a('0x2c')]=_0x13f519;_0x116df4[_0x1a1a('0x1d')]=_0x13f519['message'];_0x116df4[_0x1a1a('0x2d')]=_0x1a1a('0x2c');_0x116df4['providerResponse']=JSON['stringify'](_0x13f519);return rpc[_0x30919e+_0x1a1a('0x1f')][_0x1a1a('0x20')](_0x116df4)[_0x1a1a('0x2e')](function(_0x1f4bb7){logger[_0x1a1a('0xe')](_0x1a1a('0x21'),_0x35bcde,_0x116df4[_0x1a1a('0x1d')]);if(_0x13f519[_0x1a1a('0x2f')]==_0x1a1a('0x30')){_0x5210fd['next']();}else{_0x5210fd['stop']();}})['catch'](function(_0x2a8f92){logger[_0x1a1a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,JSON[_0x1a1a('0x23')](_0x2a8f92));_0x5210fd['next']();});}else{_0x5210fd[_0x1a1a('0x10')]();}});}}catch(_0x13eefe){logger[_0x1a1a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,JSON[_0x1a1a('0x23')](_0x13eefe));_0x5210fd['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index e97b261..106b15e 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x237e=['channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','AccountId','upperFirst','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence'];(function(_0xcedc4b,_0x4af99d){var _0x23efcc=function(_0x4f7ff4){while(--_0x4f7ff4){_0xcedc4b['push'](_0xcedc4b['shift']());}};_0x23efcc(++_0x4af99d);}(_0x237e,0xcf));var _0xe237=function(_0x35556f,_0x3c08fa){_0x35556f=_0x35556f-0x0;var _0xde28f=_0x237e[_0x35556f];return _0xde28f;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0xe237('0x0'));var logger=require('../../../../config/logger')(_0xe237('0x1'));var rpc={'chatMessage':require(_0xe237('0x2')),'openchannelMessage':require(_0xe237('0x3')),'mailMessage':require(_0xe237('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe237('0x5')),'whatsappMessage':require(_0xe237('0x6')),'chatInteraction':require(_0xe237('0x7')),'openchannelInteraction':require(_0xe237('0x8')),'mailInteraction':require(_0xe237('0x9')),'smsInteraction':require(_0xe237('0xa')),'faxInteraction':require(_0xe237('0xb')),'whatsappInteraction':require(_0xe237('0xc'))};var mailRpc=require(_0xe237('0xd'));exports[_0xe237('0xe')]=function(_0x29d11d,_0x10618b,_0x5468cf,_0x44f191){return function(_0x34a314){try{var _0x84ff0e=this[_0xe237('0xf')];if(_0x84ff0e===_0xe237('0x10')&&_0x44f191[_0xe237('0x11')][_0xe237('0x12')]){logger[_0xe237('0x13')](_0xe237('0x14'),_0x29d11d,_0xe237('0x15'));return _0x34a314[_0xe237('0x16')]();}if(_0x10618b[0x0]==='1'&&(_[_0xe237('0x17')](this[_0xe237('0x18')]['created'])||!this[_0xe237('0x18')][_0xe237('0x19')])){logger[_0xe237('0x13')](_0xe237('0x14'),_0x29d11d,_0xe237('0x1a'));return _0x34a314[_0xe237('0x16')]();}if(_0x10618b[0x0]==='2'&&this[_0xe237('0x18')][_0xe237('0x1b')]){logger[_0xe237('0x13')](_0xe237('0x1c'),_0x29d11d,_0xe237('0x1d'));return _0x34a314[_0xe237('0x16')]();}var _0x1583ce={'ContactId':this['contact']['id'],'sentAt':moment()[_0xe237('0x1e')](_0xe237('0x1f')),'direction':_0xe237('0x20')};if(this['channel']===_0xe237('0x10')){_0x1583ce['body']=utils[_0xe237('0x21')](_0x10618b[0x2],this);}else{_0x1583ce['body']=utils[_0xe237('0x21')](_0x10618b[0x1],this);}if(this[_0xe237('0x22')]){_0x1583ce['to']=this[_0xe237('0x22')][_0xe237('0x23')]||'';if(this['channel']===_0xe237('0x10')&&_0x10618b[0x1]==='1'){_0x1583ce['cc']=this[_0xe237('0x22')]['cc']||'';}_0x1583ce['from']=this['message']['to']||'';_0x1583ce[_0xe237('0x24')]=this[_0xe237('0x22')]['phone']||'';_0x1583ce[_0xe237('0x25')]=!![];if(this[_0xe237('0x22')][_0xe237('0x26')]){_0x1583ce[_0xe237('0x26')]='';_0x1583ce[_0xe237('0x26')]+=_[_0xe237('0x27')](this[_0xe237('0x22')][_0xe237('0x26')],_0xe237('0x28'))?'':_0xe237('0x29');_0x1583ce[_0xe237('0x26')]+=this[_0xe237('0x22')][_0xe237('0x26')];}}if(this[_0xe237('0xf')]==='chat'){_0x1583ce[_0xe237('0x2a')]=this[_0xe237('0x2b')]['id'];}else{_0x1583ce[_['upperFirst'](this[_0xe237('0xf')])+_0xe237('0x2c')]=this[_0xe237('0x2b')]['id'];}_0x1583ce[_[_0xe237('0x2d')](this[_0xe237('0xf')])+'InteractionId']=this[_0xe237('0x18')]['id'];var _0x4171b6=this['interaction'];if(rpc[this[_0xe237('0xf')]+_0xe237('0x2e')]){if(this['channel']===_0xe237('0x10')){_0x1583ce[_0xe237('0x2f')]=this[_0xe237('0x22')][_0xe237('0x30')];_0x1583ce[_0xe237('0x31')]=_0xe237('0x32')+_[_0xe237('0x33')](_0x1583ce[_0xe237('0x11')],_0xe237('0x34'),_0xe237('0x35'))+_0xe237('0x36');_0x1583ce[_0xe237('0x37')]={'Auto-Submitted':_0xe237('0x38'),'X-Auto-Response-Suppress':_0xe237('0x39'),'Precedence':_0xe237('0x3a')};return mailRpc[_0xe237('0x3b')](this[_0xe237('0x2b')][_0xe237('0x3c')],_0x1583ce)['then'](function(_0x468b71){logger[_0xe237('0x13')](_0xe237('0x3d'),_0x29d11d);_0x1583ce[_0xe237('0x30')]=_0x468b71[_0xe237('0x22')][_0xe237('0x30')];return rpc[_0x84ff0e+_0xe237('0x2e')][_0xe237('0x3e')](_0x1583ce);})[_0xe237('0x3f')](function(_0x49a791){logger['info']('[%s][AUTOREPLY]\x20%s',_0x29d11d,JSON[_0xe237('0x40')](_0x49a791));})[_0xe237('0x41')](function(_0x5bd28b){logger[_0xe237('0x42')](_0xe237('0x43'),_0x29d11d,JSON[_0xe237('0x40')](_0x5bd28b));})[_0xe237('0x44')](function(){Promise[_0xe237('0x45')]()['then'](function(){if(_0x10618b[0x0]!=='2'||_0x4171b6[_0xe237('0x1b')])return;return rpc[_0x84ff0e+_0xe237('0x46')][_0xe237('0x47')](_0x4171b6['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1af216){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x29d11d,JSON[_0xe237('0x40')](_0x1af216));})['catch'](function(_0x105008){logger['error'](_0xe237('0x48'),_0x29d11d,JSON[_0xe237('0x40')](_0x105008));});})['then'](function(){_0x34a314[_0xe237('0x16')]();});});}else{return rpc[this['channel']+'Message'][_0xe237('0x3e')](_0x1583ce)['then'](function(){logger[_0xe237('0x13')](_0xe237('0x14'),_0x29d11d,_0x1583ce[_0xe237('0x11')]);})[_0xe237('0x41')](function(_0x1b08b0){logger['error']('[%s][AUTOREPLY]\x20%s',_0x29d11d,JSON['stringify'](_0x1b08b0));})[_0xe237('0x44')](function(){Promise[_0xe237('0x45')]()[_0xe237('0x3f')](function(){if(_0x10618b[0x0]!=='2'||_0x4171b6[_0xe237('0x1b')])return;return rpc[_0x84ff0e+_0xe237('0x46')]['update'](_0x4171b6['id'],{'autoreplyExecuted':!![]})['then'](function(_0xd3c2a7){logger[_0xe237('0x13')](_0xe237('0x1c'),_0x29d11d,JSON['stringify'](_0xd3c2a7));})[_0xe237('0x41')](function(_0xb0709d){logger[_0xe237('0x42')](_0xe237('0x48'),_0x29d11d,JSON['stringify'](_0xb0709d));});})[_0xe237('0x3f')](function(){_0x34a314[_0xe237('0x16')]();});});}}}catch(_0x48de2b){logger[_0xe237('0x42')]('[%s][AUTOREPLY]\x20%s',_0x29d11d,JSON['stringify'](_0x48de2b));_0x34a314[_0xe237('0x49')]();}};}; \ No newline at end of file +var _0xae9a=['sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','account','AccountId','upperFirst','Message','inReplyTo','messageId','html','replace','','auto-replied','All','auto_reply'];(function(_0x48d260,_0x43871c){var _0x499460=function(_0x2a5074){while(--_0x2a5074){_0x48d260['push'](_0x48d260['shift']());}};_0x499460(++_0x43871c);}(_0xae9a,0x1b2));var _0xaae9=function(_0x8f7df5,_0x48c110){_0x8f7df5=_0x8f7df5-0x0;var _0x4e66d=_0xae9a[_0x8f7df5];return _0x4e66d;};'use strict';var _=require(_0xaae9('0x0'));var moment=require(_0xaae9('0x1'));var utils=require(_0xaae9('0x2'));var logger=require(_0xaae9('0x3'))(_0xaae9('0x4'));var rpc={'chatMessage':require(_0xaae9('0x5')),'openchannelMessage':require(_0xaae9('0x6')),'mailMessage':require(_0xaae9('0x7')),'smsMessage':require(_0xaae9('0x8')),'faxMessage':require(_0xaae9('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xaae9('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xaae9('0xb')),'smsInteraction':require(_0xaae9('0xc')),'faxInteraction':require(_0xaae9('0xd')),'whatsappInteraction':require(_0xaae9('0xe'))};var mailRpc=require(_0xaae9('0xf'));exports[_0xaae9('0x10')]=function(_0x3aff7d,_0x26350a,_0x3e6152,_0x16800c){return function(_0x555824){try{var _0x5aa036=this[_0xaae9('0x11')];if(_0x5aa036===_0xaae9('0x12')&&_0x16800c['body']['isAutoreply']){logger[_0xaae9('0x13')](_0xaae9('0x14'),_0x3aff7d,_0xaae9('0x15'));return _0x555824['next']();}if(_0x26350a[0x0]==='1'&&(_[_0xaae9('0x16')](this[_0xaae9('0x17')][_0xaae9('0x18')])||!this[_0xaae9('0x17')]['created'])){logger[_0xaae9('0x13')]('[%s][AUTOREPLY]\x20%s',_0x3aff7d,_0xaae9('0x19'));return _0x555824[_0xaae9('0x1a')]();}if(_0x26350a[0x0]==='2'&&this[_0xaae9('0x17')][_0xaae9('0x1b')]){logger['info'](_0xaae9('0x1c'),_0x3aff7d,_0xaae9('0x1d'));return _0x555824[_0xaae9('0x1a')]();}var _0x3cacb7={'ContactId':this[_0xaae9('0x1e')]['id'],'sentAt':moment()['format'](_0xaae9('0x1f')),'direction':_0xaae9('0x20')};if(this['channel']===_0xaae9('0x12')){_0x3cacb7[_0xaae9('0x21')]=utils['getMustacheRender'](_0x26350a[0x2],this);}else{_0x3cacb7['body']=utils[_0xaae9('0x22')](_0x26350a[0x1],this);}if(this['message']){_0x3cacb7['to']=this[_0xaae9('0x23')][_0xaae9('0x24')]||'';if(this[_0xaae9('0x11')]==='mail'&&_0x26350a[0x1]==='1'){_0x3cacb7['cc']=this['message']['cc']||'';}_0x3cacb7[_0xaae9('0x24')]=this[_0xaae9('0x23')]['to']||'';_0x3cacb7[_0xaae9('0x25')]=this['message']['phone']||'';_0x3cacb7[_0xaae9('0x26')]=!![];if(this[_0xaae9('0x23')][_0xaae9('0x27')]){_0x3cacb7[_0xaae9('0x27')]='';_0x3cacb7[_0xaae9('0x27')]+=_['startsWith'](this[_0xaae9('0x23')][_0xaae9('0x27')],_0xaae9('0x28'))?'':_0xaae9('0x29');_0x3cacb7[_0xaae9('0x27')]+=this[_0xaae9('0x23')]['subject'];}}if(this[_0xaae9('0x11')]==='chat'){_0x3cacb7['ChatWebsiteId']=this[_0xaae9('0x2a')]['id'];}else{_0x3cacb7[_['upperFirst'](this[_0xaae9('0x11')])+_0xaae9('0x2b')]=this[_0xaae9('0x2a')]['id'];}_0x3cacb7[_[_0xaae9('0x2c')](this['channel'])+'InteractionId']=this[_0xaae9('0x17')]['id'];var _0x5ad6f6=this[_0xaae9('0x17')];if(rpc[this['channel']+_0xaae9('0x2d')]){if(this[_0xaae9('0x11')]===_0xaae9('0x12')){_0x3cacb7[_0xaae9('0x2e')]=this[_0xaae9('0x23')][_0xaae9('0x2f')];_0x3cacb7[_0xaae9('0x30')]=''+_[_0xaae9('0x31')](_0x3cacb7[_0xaae9('0x21')],_0xaae9('0x32'),_0xaae9('0x33'))+_0xaae9('0x34');_0x3cacb7['headers']={'Auto-Submitted':_0xaae9('0x35'),'X-Auto-Response-Suppress':_0xaae9('0x36'),'Precedence':_0xaae9('0x37')};return mailRpc[_0xaae9('0x38')](this[_0xaae9('0x2a')][_0xaae9('0x39')],_0x3cacb7)[_0xaae9('0x3a')](function(_0x4aa113){logger['info'](_0xaae9('0x3b'),_0x3aff7d);_0x3cacb7[_0xaae9('0x2f')]=_0x4aa113[_0xaae9('0x23')][_0xaae9('0x2f')];return rpc[_0x5aa036+_0xaae9('0x2d')][_0xaae9('0x3c')](_0x3cacb7);})['then'](function(_0x29505a){logger[_0xaae9('0x13')](_0xaae9('0x14'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x29505a));})[_0xaae9('0x3e')](function(_0xf02e9d){logger[_0xaae9('0x3f')]('[RPC][%s][AUTOREPLY]\x20%s',_0x3aff7d,JSON['stringify'](_0xf02e9d));})['finally'](function(){Promise[_0xaae9('0x40')]()['then'](function(){if(_0x26350a[0x0]!=='2'||_0x5ad6f6['autoreplyExecuted'])return;return rpc[_0x5aa036+_0xaae9('0x41')][_0xaae9('0x42')](_0x5ad6f6['id'],{'autoreplyExecuted':!![]})[_0xaae9('0x3a')](function(_0x3188d5){logger[_0xaae9('0x13')](_0xaae9('0x1c'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x3188d5));})[_0xaae9('0x3e')](function(_0x74ad16){logger[_0xaae9('0x3f')](_0xaae9('0x43'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x74ad16));});})['then'](function(){_0x555824[_0xaae9('0x1a')]();});});}else{return rpc[this[_0xaae9('0x11')]+_0xaae9('0x2d')][_0xaae9('0x3c')](_0x3cacb7)['then'](function(){logger[_0xaae9('0x13')](_0xaae9('0x14'),_0x3aff7d,_0x3cacb7[_0xaae9('0x21')]);})['catch'](function(_0x116eec){logger[_0xaae9('0x3f')](_0xaae9('0x14'),_0x3aff7d,JSON['stringify'](_0x116eec));})[_0xaae9('0x44')](function(){Promise['resolve']()['then'](function(){if(_0x26350a[0x0]!=='2'||_0x5ad6f6[_0xaae9('0x1b')])return;return rpc[_0x5aa036+'Interaction'][_0xaae9('0x42')](_0x5ad6f6['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3b1659){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3aff7d,JSON['stringify'](_0x3b1659));})[_0xaae9('0x3e')](function(_0x192195){logger[_0xaae9('0x3f')](_0xaae9('0x43'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x192195));});})['then'](function(){_0x555824[_0xaae9('0x1a')]();});});}}}catch(_0x5283df){logger[_0xaae9('0x3f')](_0xaae9('0x14'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x5283df));_0x555824[_0xaae9('0x45')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 5977dc0..dbc32de 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf22=['catch','error','finally','stop','stringify','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbf22,0x10d));var _0x2bf2=function(_0x43f00,_0x3d0b21){_0x43f00=_0x43f00-0x0;var _0x2c1aa8=_0xbf22[_0x43f00];return _0x2c1aa8;};'use strict';var moment=require(_0x2bf2('0x0'));var logger=require(_0x2bf2('0x1'))('routing');var rpc={'chatInteraction':require(_0x2bf2('0x2')),'openchannelInteraction':require(_0x2bf2('0x3')),'smsInteraction':require(_0x2bf2('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2bf2('0x5')),'whatsappInteraction':require(_0x2bf2('0x6'))};exports['consequence']=function(_0x24ce59,_0x48c259,_0x345a1f,_0x43215a){return function(_0x3338fe){try{logger[_0x2bf2('0x7')](_0x2bf2('0x8'),_0x24ce59,_0x48c259[0x0]);var _0x24a71a={'closed':0x1,'closedAt':moment()[_0x2bf2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x2bf2('0xa'),'disposition':_0x48c259[0x0]};if(rpc[_0x43215a[_0x2bf2('0xb')]+_0x2bf2('0xc')]){rpc[_0x43215a[_0x2bf2('0xb')]+_0x2bf2('0xc')][_0x2bf2('0xd')](_0x43215a[_0x2bf2('0xe')]['id'],_0x24a71a)[_0x2bf2('0xf')](function(_0x2c6c7f){logger[_0x2bf2('0x7')](_0x2bf2('0x10'),_0x24ce59,_0x43215a[_0x2bf2('0xe')]['id']);})[_0x2bf2('0x11')](function(_0x559edc){logger[_0x2bf2('0x12')]('[%s][CLOSE]\x20%s',_0x24ce59,JSON['stringify'](_0x559edc));})[_0x2bf2('0x13')](function(){_0x3338fe[_0x2bf2('0x14')]();});}}catch(_0x3350ab){logger[_0x2bf2('0x12')]('[%s][CLOSE]\x20%s',_0x24ce59,JSON[_0x2bf2('0x15')](_0x3350ab));_0x3338fe[_0x2bf2('0x14')]();}};}; \ No newline at end of file +var _0xa92f=['[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info'];(function(_0x36f0c6,_0x4a0ba8){var _0x5c6f44=function(_0x1ebd76){while(--_0x1ebd76){_0x36f0c6['push'](_0x36f0c6['shift']());}};_0x5c6f44(++_0x4a0ba8);}(_0xa92f,0x140));var _0xfa92=function(_0x46b93b,_0x1a736e){_0x46b93b=_0x46b93b-0x0;var _0x22a8ba=_0xa92f[_0x46b93b];return _0x22a8ba;};'use strict';var moment=require(_0xfa92('0x0'));var logger=require(_0xfa92('0x1'))(_0xfa92('0x2'));var rpc={'chatInteraction':require(_0xfa92('0x3')),'openchannelInteraction':require(_0xfa92('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfa92('0x5')),'faxInteraction':require(_0xfa92('0x6')),'whatsappInteraction':require(_0xfa92('0x7'))};exports[_0xfa92('0x8')]=function(_0x15ab3d,_0xca4c9a,_0xa87060,_0x4ab54f){return function(_0x5f5d38){try{logger[_0xfa92('0x9')](_0xfa92('0xa'),_0x15ab3d,_0xca4c9a[0x0]);var _0x584bac={'closed':0x1,'closedAt':moment()[_0xfa92('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0xca4c9a[0x0]};if(rpc[_0x4ab54f[_0xfa92('0xc')]+'Interaction']){rpc[_0x4ab54f[_0xfa92('0xc')]+_0xfa92('0xd')][_0xfa92('0xe')](_0x4ab54f[_0xfa92('0xf')]['id'],_0x584bac)[_0xfa92('0x10')](function(_0x4afa83){logger[_0xfa92('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x15ab3d,_0x4ab54f[_0xfa92('0xf')]['id']);})[_0xfa92('0x11')](function(_0x46a52e){logger[_0xfa92('0x12')](_0xfa92('0x13'),_0x15ab3d,JSON[_0xfa92('0x14')](_0x46a52e));})['finally'](function(){_0x5f5d38[_0xfa92('0x15')]();});}}catch(_0x5cde98){logger[_0xfa92('0x12')](_0xfa92('0x13'),_0x15ab3d,JSON[_0xfa92('0x14')](_0x5cde98));_0x5f5d38['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 0fbfdce..482efaa 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87d8=['AccountId','created','isEmpty','body','getMustacheRender','create','then','info','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','providerResponse','Message','metadata','stop','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','next','contact','format','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account'];(function(_0x137f83,_0x51684d){var _0x2a625d=function(_0x3f1965){while(--_0x3f1965){_0x137f83['push'](_0x137f83['shift']());}};_0x2a625d(++_0x51684d);}(_0x87d8,0x1a9));var _0x887d=function(_0x177dc7,_0x13501c){_0x177dc7=_0x177dc7-0x0;var _0x19b7dc=_0x87d8[_0x177dc7];return _0x19b7dc;};'use strict';var _=require('lodash');var moment=require(_0x887d('0x0'));var apiai=require(_0x887d('0x1'));var md5=require(_0x887d('0x2'));var utils=require(_0x887d('0x3'));var logger=require(_0x887d('0x4'))(_0x887d('0x5'));var rpc={'chatMessage':require(_0x887d('0x6')),'openchannelMessage':require(_0x887d('0x7')),'mailMessage':require(_0x887d('0x8')),'smsMessage':require(_0x887d('0x9')),'faxMessage':require(_0x887d('0xa')),'whatsappMessage':require(_0x887d('0xb'))};exports[_0x887d('0xc')]=function(_0x16820a,_0x242f79){return function(_0x479f76){try{if(!_[_0x887d('0xd')](this[_0x887d('0xe')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x16820a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x479f76[_0x887d('0xf')]();}var _0x31488d={'ContactId':this[_0x887d('0x10')]['id'],'sentAt':moment()[_0x887d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x887d('0x12')]===_0x887d('0x13')||this[_0x887d('0x12')]===_0x887d('0x14')){_0x31488d[_0x887d('0x15')]=this[_0x887d('0xe')][_0x887d('0x15')];}var _0x1e331b=this['channel'];if(_0x1e331b===_0x887d('0x16')){_0x31488d[_0x887d('0x17')]=this[_0x887d('0x18')]['id'];}else{_0x31488d[_['upperFirst'](_0x1e331b)+_0x887d('0x19')]=this[_0x887d('0x18')]['id'];}_0x31488d[_['upperFirst'](_0x1e331b)+'InteractionId']=this['interaction']['id'];if(this[_0x887d('0xe')][_0x887d('0x1a')]){var _0x5d4fce=_0x242f79[0x2];if(!_[_0x887d('0x1b')](_0x5d4fce)){_0x31488d[_0x887d('0x1c')]=utils[_0x887d('0x1d')](_0x5d4fce,this);return rpc[_0x1e331b+'Message'][_0x887d('0x1e')](_0x31488d)[_0x887d('0x1f')](function(_0x5e97ec){logger[_0x887d('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,_0x31488d[_0x887d('0x1c')]);})[_0x887d('0x21')](function(_0x1ab5fc){logger[_0x887d('0x22')](_0x887d('0x23'),_0x16820a,JSON[_0x887d('0x24')](_0x1ab5fc));})[_0x887d('0x25')](function(){logger[_0x887d('0x20')](_0x887d('0x26'),_0x16820a);_0x479f76['stop']();});}else{logger['info'](_0x887d('0x27'),_0x16820a);_0x479f76['stop']();}}else{var _0x2aca37=this;var _0x311aed=apiai(_0x242f79[0x0],{'language':_0x242f79[0x1]||'en'});return _0x311aed[_0x887d('0x28')](this[_0x887d('0x29')][_0x887d('0x1c')],{'sessionId':md5(this[_0x887d('0xe')]['id'])})['then'](function(_0x332bed){_0x2aca37[_0x887d('0x1c')]['dialogflow']=_0x332bed;_0x31488d['body']=_0x332bed[_0x887d('0x2a')][_0x887d('0x2b')][_0x887d('0x2c')];_0x31488d[_0x887d('0x2d')]='dialogflow';_0x31488d[_0x887d('0x2e')]=JSON[_0x887d('0x24')](_0x332bed);return rpc[_0x1e331b+_0x887d('0x2f')]['create'](_0x31488d)[_0x887d('0x1f')](function(_0x1b96eb){logger[_0x887d('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,_0x31488d['body']);if(_0x332bed[_0x887d('0x2a')][_0x887d('0x30')]['endConversation']){_0x479f76['next']();}else{_0x479f76[_0x887d('0x31')]();}})['catch'](function(_0x26a239){logger[_0x887d('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,JSON[_0x887d('0x24')](_0x26a239));_0x479f76[_0x887d('0xf')]();});})['catch'](function(_0x5edbe5){logger['error'](_0x887d('0x23'),_0x16820a,_0x5edbe5[_0x887d('0x29')]);_0x479f76[_0x887d('0xf')]();});}}catch(_0x1d2a53){logger[_0x887d('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,JSON[_0x887d('0x24')](_0x1d2a53));_0x479f76[_0x887d('0x31')]();}};}; \ No newline at end of file +var _0x18af=['result','fulfillment','speech','dialogflow','providerResponse','create','catch','lodash','apiai-promise','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','account','AccountId','InteractionId','created','body','getMustacheRender','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message'];(function(_0x3dd7ad,_0xc96b15){var _0x6c72d8=function(_0x5ccd3a){while(--_0x5ccd3a){_0x3dd7ad['push'](_0x3dd7ad['shift']());}};_0x6c72d8(++_0xc96b15);}(_0x18af,0x8b));var _0xf18a=function(_0x5a0797,_0x17b0f5){_0x5a0797=_0x5a0797-0x0;var _0x3e8fee=_0x18af[_0x5a0797];return _0x3e8fee;};'use strict';var _=require(_0xf18a('0x0'));var moment=require('moment');var apiai=require(_0xf18a('0x1'));var md5=require('md5');var utils=require(_0xf18a('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf18a('0x3')),'mailMessage':require(_0xf18a('0x4')),'smsMessage':require(_0xf18a('0x5')),'faxMessage':require(_0xf18a('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf18a('0x7')]=function(_0x2d5955,_0x3fc64b){return function(_0x4dc297){try{if(!_[_0xf18a('0x8')](this[_0xf18a('0x9')][_0xf18a('0xa')])){logger[_0xf18a('0xb')](_0xf18a('0xc'),_0x2d5955,_0xf18a('0xd'));return _0x4dc297[_0xf18a('0xe')]();}var _0x20247d={'ContactId':this[_0xf18a('0xf')]['id'],'sentAt':moment()[_0xf18a('0x10')](_0xf18a('0x11')),'direction':_0xf18a('0x12')};if(this[_0xf18a('0x13')]==='sms'||this[_0xf18a('0x13')]===_0xf18a('0x14')){_0x20247d[_0xf18a('0x15')]=this[_0xf18a('0x9')][_0xf18a('0x15')];}var _0x4e9ee9=this[_0xf18a('0x13')];if(_0x4e9ee9===_0xf18a('0x16')){_0x20247d['ChatWebsiteId']=this[_0xf18a('0x17')]['id'];}else{_0x20247d[_['upperFirst'](_0x4e9ee9)+_0xf18a('0x18')]=this[_0xf18a('0x17')]['id'];}_0x20247d[_['upperFirst'](_0x4e9ee9)+_0xf18a('0x19')]=this['interaction']['id'];if(this[_0xf18a('0x9')][_0xf18a('0x1a')]){var _0x52fcfa=_0x3fc64b[0x2];if(!_['isEmpty'](_0x52fcfa)){_0x20247d[_0xf18a('0x1b')]=utils[_0xf18a('0x1c')](_0x52fcfa,this);return rpc[_0x4e9ee9+'Message']['create'](_0x20247d)[_0xf18a('0x1d')](function(_0x1aff7c){logger[_0xf18a('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,_0x20247d[_0xf18a('0x1b')]);})['catch'](function(_0x305b74){logger[_0xf18a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,JSON[_0xf18a('0x1f')](_0x305b74));})[_0xf18a('0x20')](function(){logger['info'](_0xf18a('0x21'),_0x2d5955);_0x4dc297[_0xf18a('0x22')]();});}else{logger[_0xf18a('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2d5955);_0x4dc297['stop']();}}else{var _0x43a50a=this;var _0x4438ed=apiai(_0x3fc64b[0x0],{'language':_0x3fc64b[0x1]||'en'});return _0x4438ed[_0xf18a('0x23')](this[_0xf18a('0x24')][_0xf18a('0x1b')],{'sessionId':md5(this[_0xf18a('0x9')]['id'])})[_0xf18a('0x1d')](function(_0x304bd4){_0x43a50a[_0xf18a('0x1b')]['dialogflow']=_0x304bd4;_0x20247d[_0xf18a('0x1b')]=_0x304bd4[_0xf18a('0x25')][_0xf18a('0x26')][_0xf18a('0x27')];_0x20247d['providerName']=_0xf18a('0x28');_0x20247d[_0xf18a('0x29')]=JSON[_0xf18a('0x1f')](_0x304bd4);return rpc[_0x4e9ee9+'Message'][_0xf18a('0x2a')](_0x20247d)[_0xf18a('0x1d')](function(_0xf7e6c2){logger[_0xf18a('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,_0x20247d[_0xf18a('0x1b')]);if(_0x304bd4[_0xf18a('0x25')]['metadata']['endConversation']){_0x4dc297[_0xf18a('0xe')]();}else{_0x4dc297[_0xf18a('0x22')]();}})[_0xf18a('0x2b')](function(_0xdc0fe9){logger['error'](_0xf18a('0xc'),_0x2d5955,JSON[_0xf18a('0x1f')](_0xdc0fe9));_0x4dc297[_0xf18a('0xe')]();});})[_0xf18a('0x2b')](function(_0x3a9b89){logger[_0xf18a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,_0x3a9b89['message']);_0x4dc297[_0xf18a('0xe')]();});}}catch(_0x3ea07a){logger[_0xf18a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,JSON['stringify'](_0x3ea07a));_0x4dc297[_0xf18a('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 0eabda5..d4954a2 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ccc=['name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','create','info','catch','error','stringify','consequence','interaction','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','created','getMustacheRender','then','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent'];(function(_0x24701a,_0x1eeeb9){var _0x1e9a84=function(_0x4d9b61){while(--_0x4d9b61){_0x24701a['push'](_0x24701a['shift']());}};_0x1e9a84(++_0x1eeeb9);}(_0x8ccc,0x16f));var _0xc8cc=function(_0xbd853b,_0x56b979){_0xbd853b=_0xbd853b-0x0;var _0x18f27f=_0x8ccc[_0xbd853b];return _0x18f27f;};'use strict';var _=require(_0xc8cc('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0xc8cc('0x1'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0xc8cc('0x2'));var utils=require('./utils');var rpc={'chatMessage':require(_0xc8cc('0x3')),'openchannelMessage':require(_0xc8cc('0x4')),'mailMessage':require(_0xc8cc('0x5')),'smsMessage':require(_0xc8cc('0x6')),'faxMessage':require(_0xc8cc('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x51ca6c,_0x1a474d,_0x3e26d4,_0x46a646){return new Promise(function(_0x36cc28,_0xd39f7d){var _0xab548c=_[_0xc8cc('0x8')](_0x3e26d4);_0xab548c[_0xc8cc('0x9')]=_0x46a646;return rpc[_0x1a474d+_0xc8cc('0xa')][_0xc8cc('0xb')](_0xab548c)['then'](function(){logger[_0xc8cc('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x51ca6c,_0xab548c[_0xc8cc('0x9')]);_0x36cc28();})[_0xc8cc('0xd')](function(_0xb64dcf){logger[_0xc8cc('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x51ca6c,JSON[_0xc8cc('0xf')](_0xb64dcf));_0xd39f7d(_0xb64dcf);});});}exports[_0xc8cc('0x10')]=function(_0x421bc5,_0x3c28f3){return function(_0x20dfa7){try{if(!_['isNil'](this[_0xc8cc('0x11')][_0xc8cc('0x12')])){logger[_0xc8cc('0xc')](_0xc8cc('0x13'),_0x421bc5,_0xc8cc('0x14'));return _0x20dfa7[_0xc8cc('0x15')]();}var _0x205496={'ContactId':this[_0xc8cc('0x16')]['id'],'sentAt':moment()[_0xc8cc('0x17')](_0xc8cc('0x18')),'direction':_0xc8cc('0x19')};if(this[_0xc8cc('0x1a')]===_0xc8cc('0x1b')||this[_0xc8cc('0x1a')]===_0xc8cc('0x1c')){_0x205496[_0xc8cc('0x1d')]=this[_0xc8cc('0x11')][_0xc8cc('0x1d')];}var _0x10dec8=this[_0xc8cc('0x1a')];if(_0x10dec8===_0xc8cc('0x1e')){_0x205496['ChatWebsiteId']=this[_0xc8cc('0x1f')]['id'];}else{_0x205496[_[_0xc8cc('0x20')](_0x10dec8)+_0xc8cc('0x21')]=this[_0xc8cc('0x1f')]['id'];}_0x205496[_[_0xc8cc('0x20')](_0x10dec8)+'InteractionId']=this[_0xc8cc('0x11')]['id'];if(this['interaction'][_0xc8cc('0x22')]){var _0x57cf09=_0x3c28f3[0x4];if(!_['isEmpty'](_0x57cf09)){_0x205496[_0xc8cc('0x9')]=utils[_0xc8cc('0x23')](_0x57cf09,this);return rpc[_0x10dec8+_0xc8cc('0xa')][_0xc8cc('0xb')](_0x205496)[_0xc8cc('0x24')](function(_0x16ca33){logger[_0xc8cc('0xc')](_0xc8cc('0x13'),_0x421bc5,_0x205496[_0xc8cc('0x9')]);})[_0xc8cc('0xd')](function(_0x473fd7){logger['error'](_0xc8cc('0x13'),_0x421bc5,JSON['stringify'](_0x473fd7));})['finally'](function(){logger[_0xc8cc('0xc')](_0xc8cc('0x25'),_0x421bc5);_0x20dfa7[_0xc8cc('0x26')]();});}else{logger[_0xc8cc('0xc')](_0xc8cc('0x27'),_0x421bc5);_0x20dfa7['stop']();}}else{var _0xd11846=this;var _0x394c28=_0x3c28f3[0x2][_0xc8cc('0x28')](/\\n/g,'\x0a');var _0x5856c8={'credentials':{'private_key':_0x394c28,'client_email':_0x3c28f3[0x1]}};var _0x166c7d=new dialogflow[(_0xc8cc('0x29'))](_0x5856c8);var _0x58c2ef=_0x166c7d[_0xc8cc('0x2a')](_0x3c28f3[0x0],md5(_0xd11846[_0xc8cc('0x11')]['id']));var _0x9c88e3={'session':_0x58c2ef,'queryInput':{'text':{'text':_0xd11846[_0xc8cc('0x2b')]['body'],'languageCode':_0x3c28f3[0x3]||'en'}}};return _0x166c7d[_0xc8cc('0x2c')](_0x9c88e3)[_0xc8cc('0x24')](function(_0x995cc1){if(_0x995cc1&&_0x995cc1[_0xc8cc('0x2d')]){_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x2e')]=_0x995cc1;var _0x57e722=_0x995cc1[0x0];var _0x20ddbb=_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x30')]&&_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x30')][_0xc8cc('0x31')]?_0x57e722['queryResult']['diagnosticInfo'][_0xc8cc('0x31')][_0xc8cc('0x32')][_0xc8cc('0x33')]:![];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x34')]=_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x35')];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x36')]=_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x37')];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x38')]=_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x30')]&&_0x57e722['queryResult']['diagnosticInfo'][_0xc8cc('0x31')]?_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x30')][_0xc8cc('0x31')][_0xc8cc('0x32')]['boolValue']:![];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x39')]=_0x57e722['queryResult'][_0xc8cc('0x3a')][_0xc8cc('0x3b')];_0xd11846['body'][_0xc8cc('0x3c')]=_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x3a')][_0xc8cc('0x3d')];_0xd11846[_0xc8cc('0x9')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x57e722['queryResult'][_0xc8cc('0x3a')]['isFallback'];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x3e')]=_0x57e722[_0xc8cc('0x2f')]['languageCode'];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x3f')]=_0x57e722[_0xc8cc('0x2f')][_0xc8cc('0x40')];_0xd11846[_0xc8cc('0x9')][_0xc8cc('0x41')]=_0x57e722['queryResult'][_0xc8cc('0x42')];_0x205496[_0xc8cc('0x43')]=_0xc8cc('0x2e');_0x205496[_0xc8cc('0x44')]=JSON['stringify'](_0x995cc1);var _0x3dfcdf=[];for(var _0x465a06=0x0;_0x465a06<_0x995cc1['length'];_0x465a06++){var _0x3ba8ed=_0x995cc1[_0x465a06];if(_0x3ba8ed&&_0x3ba8ed[_0xc8cc('0x2f')]&&_0x3ba8ed[_0xc8cc('0x2f')][_0xc8cc('0x45')]){_0x3dfcdf[_0xc8cc('0x46')](createMessage(_0x421bc5,_0x10dec8,_0x205496,_0x3ba8ed['queryResult']['fulfillmentText']));}}return Promise['all'](_0x3dfcdf)['then'](function(){if(_0x20ddbb){_0x20dfa7[_0xc8cc('0x15')]();}else{_0x20dfa7[_0xc8cc('0x26')]();}})['catch'](function(_0x3340d8){logger['error'](_0xc8cc('0x13'),_0x421bc5,JSON[_0xc8cc('0xf')](_0x3340d8));_0x20dfa7[_0xc8cc('0x15')]();});}})[_0xc8cc('0xd')](function(_0x492461){logger[_0xc8cc('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x421bc5,_0x492461[_0xc8cc('0x2b')]);_0x20dfa7[_0xc8cc('0x15')]();});}}catch(_0x13da79){logger['error'](_0xc8cc('0x13'),_0x421bc5,JSON['stringify'](_0x13da79));_0x20dfa7[_0xc8cc('0x26')]();}};}; \ No newline at end of file +var _0x0cc2=['isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','push','fulfillmentText','message','lodash','dialogflow','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','clone','body','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','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','isEmpty','getMustacheRender','Message','create','info','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','length','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName'];(function(_0x2dc520,_0x562e06){var _0x4e3c28=function(_0x1610d7){while(--_0x1610d7){_0x2dc520['push'](_0x2dc520['shift']());}};_0x4e3c28(++_0x562e06);}(_0x0cc2,0x87));var _0x20cc=function(_0x3aa7e6,_0x3fe287){_0x3aa7e6=_0x3aa7e6-0x0;var _0x1680fc=_0x0cc2[_0x3aa7e6];return _0x1680fc;};'use strict';var _=require(_0x20cc('0x0'));var dialogflow=require(_0x20cc('0x1'));var md5=require('md5');var moment=require(_0x20cc('0x2'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x20cc('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x20cc('0x4')),'openchannelMessage':require(_0x20cc('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x42479c,_0x5c9ae4,_0x3c8798,_0x47e077){return new Promise(function(_0x270628,_0x292097){var _0x28bd82=_[_0x20cc('0x6')](_0x3c8798);_0x28bd82[_0x20cc('0x7')]=_0x47e077;return rpc[_0x5c9ae4+'Message']['create'](_0x28bd82)[_0x20cc('0x8')](function(){logger['info'](_0x20cc('0x9'),_0x42479c,_0x28bd82['body']);_0x270628();})[_0x20cc('0xa')](function(_0x4c5549){logger[_0x20cc('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x42479c,JSON[_0x20cc('0xc')](_0x4c5549));_0x292097(_0x4c5549);});});}exports[_0x20cc('0xd')]=function(_0x493a85,_0x27e189){return function(_0x411e06){try{if(!_[_0x20cc('0xe')](this[_0x20cc('0xf')][_0x20cc('0x10')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x493a85,_0x20cc('0x11'));return _0x411e06[_0x20cc('0x12')]();}var _0x452bdd={'ContactId':this[_0x20cc('0x13')]['id'],'sentAt':moment()[_0x20cc('0x14')](_0x20cc('0x15')),'direction':'out'};if(this[_0x20cc('0x16')]===_0x20cc('0x17')||this['channel']===_0x20cc('0x18')){_0x452bdd[_0x20cc('0x19')]=this[_0x20cc('0xf')][_0x20cc('0x19')];}var _0x455fe8=this['channel'];if(_0x455fe8==='chat'){_0x452bdd[_0x20cc('0x1a')]=this[_0x20cc('0x1b')]['id'];}else{_0x452bdd[_['upperFirst'](_0x455fe8)+'AccountId']=this[_0x20cc('0x1b')]['id'];}_0x452bdd[_[_0x20cc('0x1c')](_0x455fe8)+_0x20cc('0x1d')]=this[_0x20cc('0xf')]['id'];if(this[_0x20cc('0xf')]['created']){var _0x44253a=_0x27e189[0x4];if(!_[_0x20cc('0x1e')](_0x44253a)){_0x452bdd[_0x20cc('0x7')]=utils[_0x20cc('0x1f')](_0x44253a,this);return rpc[_0x455fe8+_0x20cc('0x20')][_0x20cc('0x21')](_0x452bdd)['then'](function(_0x21399e){logger[_0x20cc('0x22')](_0x20cc('0x9'),_0x493a85,_0x452bdd[_0x20cc('0x7')]);})[_0x20cc('0xa')](function(_0x1861ba){logger[_0x20cc('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x493a85,JSON[_0x20cc('0xc')](_0x1861ba));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x493a85);_0x411e06[_0x20cc('0x23')]();});}else{logger[_0x20cc('0x22')](_0x20cc('0x24'),_0x493a85);_0x411e06[_0x20cc('0x23')]();}}else{var _0x465d35=this;var _0xc8aee2=_0x27e189[0x2]['replace'](/\\n/g,'\x0a');var _0x38b116={'credentials':{'private_key':_0xc8aee2,'client_email':_0x27e189[0x1]}};var _0x1f23b9=new dialogflow[(_0x20cc('0x25'))](_0x38b116);var _0x43fd04=_0x1f23b9['sessionPath'](_0x27e189[0x0],md5(_0x465d35[_0x20cc('0xf')]['id']));var _0x4231f6={'session':_0x43fd04,'queryInput':{'text':{'text':_0x465d35['message'][_0x20cc('0x7')],'languageCode':_0x27e189[0x3]||'en'}}};return _0x1f23b9['detectIntent'](_0x4231f6)[_0x20cc('0x8')](function(_0x3cb8ff){if(_0x3cb8ff&&_0x3cb8ff[_0x20cc('0x26')]){_0x465d35[_0x20cc('0x7')]['dialogflowV2']=_0x3cb8ff;var _0x3476bf=_0x3cb8ff[0x0];var _0xf8439e=_0x3476bf['queryResult']['diagnosticInfo']&&_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')]['fields']?_0x3476bf['queryResult'][_0x20cc('0x28')][_0x20cc('0x29')]['end_conversation'][_0x20cc('0x2a')]:![];_0x465d35[_0x20cc('0x7')][_0x20cc('0x2b')]=_0x3476bf['queryResult'][_0x20cc('0x2c')];_0x465d35[_0x20cc('0x7')][_0x20cc('0x2d')]=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x2e')];_0x465d35[_0x20cc('0x7')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')]&&_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')][_0x20cc('0x29')]?_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')][_0x20cc('0x29')]['end_conversation'][_0x20cc('0x2a')]:![];_0x465d35[_0x20cc('0x7')][_0x20cc('0x2f')]=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x30')]['name'];_0x465d35[_0x20cc('0x7')][_0x20cc('0x31')]=_0x3476bf['queryResult'][_0x20cc('0x30')][_0x20cc('0x32')];_0x465d35[_0x20cc('0x7')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x30')][_0x20cc('0x33')];_0x465d35[_0x20cc('0x7')][_0x20cc('0x34')]=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x35')];_0x465d35[_0x20cc('0x7')]['DIALOGFLOWV2_QUERYTEXT']=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x36')];_0x465d35['body'][_0x20cc('0x37')]=_0x3476bf['queryResult']['intentDetectionConfidence'];_0x452bdd[_0x20cc('0x38')]=_0x20cc('0x39');_0x452bdd[_0x20cc('0x3a')]=JSON[_0x20cc('0xc')](_0x3cb8ff);var _0x26d419=[];for(var _0x1b69e4=0x0;_0x1b69e4<_0x3cb8ff[_0x20cc('0x26')];_0x1b69e4++){var _0x277bad=_0x3cb8ff[_0x1b69e4];if(_0x277bad&&_0x277bad[_0x20cc('0x27')]&&_0x277bad[_0x20cc('0x27')]['fulfillmentText']){_0x26d419[_0x20cc('0x3b')](createMessage(_0x493a85,_0x455fe8,_0x452bdd,_0x277bad[_0x20cc('0x27')][_0x20cc('0x3c')]));}}return Promise['all'](_0x26d419)[_0x20cc('0x8')](function(){if(_0xf8439e){_0x411e06[_0x20cc('0x12')]();}else{_0x411e06[_0x20cc('0x23')]();}})[_0x20cc('0xa')](function(_0x56bda5){logger[_0x20cc('0xb')](_0x20cc('0x9'),_0x493a85,JSON['stringify'](_0x56bda5));_0x411e06[_0x20cc('0x12')]();});}})[_0x20cc('0xa')](function(_0x19a0c9){logger['error'](_0x20cc('0x9'),_0x493a85,_0x19a0c9[_0x20cc('0x3d')]);_0x411e06[_0x20cc('0x12')]();});}}catch(_0x58ffdf){logger['error'](_0x20cc('0x9'),_0x493a85,JSON['stringify'](_0x58ffdf));_0x411e06['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index cd9d394..2db7c6c 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba4e=['error','validate','lodash','html-to-text','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','[%s][GOTOIF]\x20%s','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x3d7c2e,_0x167ddc){var _0x30b781=function(_0x2b2a68){while(--_0x2b2a68){_0x3d7c2e['push'](_0x3d7c2e['shift']());}};_0x30b781(++_0x167ddc);}(_0xba4e,0x139));var _0xeba4=function(_0x4b2a8f,_0x5277ac){_0x4b2a8f=_0x4b2a8f-0x0;var _0x311556=_0xba4e[_0x4b2a8f];return _0x311556;};'use strict';var schema=require(_0xeba4('0x0'));var _=require(_0xeba4('0x1'));var htmlToText=require(_0xeba4('0x2'));var utils=require('./utils');var logger=require(_0xeba4('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xeba4('0x4'),'required':!![],'message':_0xeba4('0x5')},'priorityTrue':{'type':_0xeba4('0x6'),'message':_0xeba4('0x7')},'priorityFalse':{'type':_0xeba4('0x6'),'message':_0xeba4('0x8')}});exports[_0xeba4('0x9')]=function(_0x833414,_0x267fd2){return function(_0x28081c){try{var _0x21a0b5={'condition':htmlToText[_0xeba4('0xa')](utils['getMustacheRender'](_0x267fd2[0x0],this),{'wordwrap':![]})[_0xeba4('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x267fd2[0x1],'priorityFalse':_0x267fd2[0x2]};var _0x558b60=gotoif[_0xeba4('0x0')](_0x21a0b5,{'typecast':!![]});if(_0x558b60['length']){logger['error'](_0xeba4('0xc'),_0x833414,_['map'](_0x558b60,_0xeba4('0xd'))['join'](',\x20'));_0x28081c[_0xeba4('0xe')]();}else{try{var _0x4c278e=eval('('+_0x21a0b5[_0xeba4('0xf')]+')');var _0xb5af7d=_0x4c278e?_0x21a0b5[_0xeba4('0x10')]:_0x21a0b5[_0xeba4('0x11')];logger[_0xeba4('0x12')](_0xeba4('0x13'),_0x833414,_0x21a0b5['condition'],_0x4c278e,_0xb5af7d||_0xeba4('0x14'));if(_0xb5af7d){var _0x53361b=_[_0xeba4('0x15')](_0x28081c[_0xeba4('0x16')](),{'p':_0xb5af7d});if(_0x53361b>=0x0){logger[_0xeba4('0x12')](_0xeba4('0x17'),_0x833414,_0xb5af7d||_0xeba4('0x14'),_0x53361b);_0x28081c['next'](_0x53361b);}else{logger[_0xeba4('0x12')](_0xeba4('0x18'),_0x833414,_0xb5af7d||'next');_0x28081c[_0xeba4('0xe')]();}}else{_0x28081c[_0xeba4('0x14')]();}}catch(_0x28190a){logger[_0xeba4('0x19')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x833414,_0x28190a[_0xeba4('0xd')]);_0x28081c['stop']();}}}catch(_0x27d888){logger[_0xeba4('0x19')](_0xeba4('0xc'),_0x833414,JSON['stringify'](_0x27d888));_0x28081c['stop']();}};}; \ No newline at end of file +var _0xd404=['priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20eval\x20error:\x20%s','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop'];(function(_0x13dcc3,_0x1565c6){var _0xe53a94=function(_0xa86700){while(--_0xa86700){_0x13dcc3['push'](_0x13dcc3['shift']());}};_0xe53a94(++_0x1565c6);}(_0xd404,0x148));var _0x4d40=function(_0x5714be,_0x13fed0){_0x5714be=_0x5714be-0x0;var _0x341da2=_0xd404[_0x5714be];return _0x341da2;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x4d40('0x0'));var utils=require(_0x4d40('0x1'));var logger=require(_0x4d40('0x2'))(_0x4d40('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x4d40('0x4')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4d40('0x5'),'message':_0x4d40('0x6')}});exports['consequence']=function(_0x20467a,_0x42e6ea){return function(_0x1be996){try{var _0x38bda5={'condition':htmlToText[_0x4d40('0x7')](utils['getMustacheRender'](_0x42e6ea[0x0],this),{'wordwrap':![]})[_0x4d40('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x42e6ea[0x1],'priorityFalse':_0x42e6ea[0x2]};var _0x11bdb5=gotoif[_0x4d40('0x9')](_0x38bda5,{'typecast':!![]});if(_0x11bdb5[_0x4d40('0xa')]){logger[_0x4d40('0xb')](_0x4d40('0xc'),_0x20467a,_[_0x4d40('0xd')](_0x11bdb5,_0x4d40('0xe'))[_0x4d40('0xf')](',\x20'));_0x1be996[_0x4d40('0x10')]();}else{try{var _0xfb7228=eval('('+_0x38bda5['condition']+')');var _0x18cf71=_0xfb7228?_0x38bda5[_0x4d40('0x11')]:_0x38bda5[_0x4d40('0x12')];logger[_0x4d40('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x20467a,_0x38bda5['condition'],_0xfb7228,_0x18cf71||_0x4d40('0x14'));if(_0x18cf71){var _0x4d9fa1=_['findIndex'](_0x1be996[_0x4d40('0x15')](),{'p':_0x18cf71});if(_0x4d9fa1>=0x0){logger[_0x4d40('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x20467a,_0x18cf71||_0x4d40('0x14'),_0x4d9fa1);_0x1be996[_0x4d40('0x14')](_0x4d9fa1);}else{logger[_0x4d40('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x20467a,_0x18cf71||_0x4d40('0x14'));_0x1be996[_0x4d40('0x10')]();}}else{_0x1be996['next']();}}catch(_0x383fb4){logger[_0x4d40('0xb')](_0x4d40('0x16'),_0x20467a,_0x383fb4[_0x4d40('0xe')]);_0x1be996[_0x4d40('0x10')]();}}}catch(_0x513607){logger[_0x4d40('0xb')](_0x4d40('0xc'),_0x20467a,JSON['stringify'](_0x513607));_0x1be996['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index ca997a8..067dcf5 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab01=['[%s][GOTOP]\x20%s','stringify','validate','lodash','number','length','error','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop'];(function(_0x4a7a75,_0x380fc3){var _0x28086c=function(_0x1a57c3){while(--_0x1a57c3){_0x4a7a75['push'](_0x4a7a75['shift']());}};_0x28086c(++_0x380fc3);}(_0xab01,0x192));var _0x1ab0=function(_0x5a3018,_0xe6f19a){_0x5a3018=_0x5a3018-0x0;var _0x53399d=_0xab01[_0x5a3018];return _0x53399d;};'use strict';var schema=require(_0x1ab0('0x0'));var _=require(_0x1ab0('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x1ab0('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x19da22,_0x1e8c8c){return function(_0xba7eae){try{var _0xf9c2d={'priority':_0x1e8c8c[0x0]};var _0x573e6e=gotop[_0x1ab0('0x0')](_0xf9c2d,{'typecast':!![]});if(_0x573e6e[_0x1ab0('0x3')]){logger[_0x1ab0('0x4')]('[%s][GOTOP]\x20%s',_0x19da22,_['map'](_0x573e6e,_0x1ab0('0x5'))['join'](',\x20'));_0xba7eae['stop']();}else{logger[_0x1ab0('0x6')](_0x1ab0('0x7'),_0x19da22,_0xf9c2d[_0x1ab0('0x8')]);if(_0xf9c2d[_0x1ab0('0x8')]){var _0x2a6955=_[_0x1ab0('0x9')](_0xba7eae[_0x1ab0('0xa')](),{'p':_0xf9c2d[_0x1ab0('0x8')]});if(_0x2a6955>=0x0){logger['info'](_0x1ab0('0xb'),_0x19da22,_0xf9c2d['priority']||_0x1ab0('0xc'),_0x2a6955);_0xba7eae[_0x1ab0('0xc')](_0x2a6955);}else{logger[_0x1ab0('0x6')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x19da22,_0xf9c2d[_0x1ab0('0x8')]||'next');_0xba7eae[_0x1ab0('0xd')]();}}else{_0xba7eae[_0x1ab0('0xc')]();}}}catch(_0x45ede6){logger['error'](_0x1ab0('0xe'),_0x19da22,JSON[_0x1ab0('0xf')](_0x45ede6));_0xba7eae[_0x1ab0('0xd')]();}};}; \ No newline at end of file +var _0xfdc7=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','join','stop'];(function(_0x4772bd,_0x255ff6){var _0x386a8e=function(_0x5034ce){while(--_0x5034ce){_0x4772bd['push'](_0x4772bd['shift']());}};_0x386a8e(++_0x255ff6);}(_0xfdc7,0x182));var _0x7fdc=function(_0x12c076,_0x5bef17){_0x12c076=_0x12c076-0x0;var _0x2ddd18=_0xfdc7[_0x12c076];return _0x2ddd18;};'use strict';var schema=require(_0x7fdc('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x7fdc('0x1'));var gotop=schema({'priority':{'type':_0x7fdc('0x2'),'required':!![],'message':_0x7fdc('0x3')}});exports['consequence']=function(_0x99529a,_0x39de40){return function(_0x15c309){try{var _0x11ad24={'priority':_0x39de40[0x0]};var _0x5ca57a=gotop['validate'](_0x11ad24,{'typecast':!![]});if(_0x5ca57a[_0x7fdc('0x4')]){logger[_0x7fdc('0x5')](_0x7fdc('0x6'),_0x99529a,_[_0x7fdc('0x7')](_0x5ca57a,'message')[_0x7fdc('0x8')](',\x20'));_0x15c309[_0x7fdc('0x9')]();}else{logger[_0x7fdc('0xa')](_0x7fdc('0xb'),_0x99529a,_0x11ad24['priority']);if(_0x11ad24[_0x7fdc('0xc')]){var _0x2d1b6d=_[_0x7fdc('0xd')](_0x15c309[_0x7fdc('0xe')](),{'p':_0x11ad24[_0x7fdc('0xc')]});if(_0x2d1b6d>=0x0){logger[_0x7fdc('0xa')](_0x7fdc('0xf'),_0x99529a,_0x11ad24[_0x7fdc('0xc')]||_0x7fdc('0x10'),_0x2d1b6d);_0x15c309[_0x7fdc('0x10')](_0x2d1b6d);}else{logger[_0x7fdc('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x99529a,_0x11ad24[_0x7fdc('0xc')]||_0x7fdc('0x10'));_0x15c309['stop']();}}else{_0x15c309[_0x7fdc('0x10')]();}}}catch(_0x593bb6){logger[_0x7fdc('0x5')](_0x7fdc('0x6'),_0x99529a,JSON[_0x7fdc('0x11')](_0x593bb6));_0x15c309[_0x7fdc('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 7a64da0..cf86687 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1f1=['routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','AccountId','account','upperFirst','InteractionId','interaction','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger'];(function(_0x2391ab,_0x10b86d){var _0x598a88=function(_0x54271a){while(--_0x54271a){_0x2391ab['push'](_0x2391ab['shift']());}};_0x598a88(++_0x10b86d);}(_0xd1f1,0x84));var _0x1d1f=function(_0x4f14bd,_0x28b9db){_0x4f14bd=_0x4f14bd-0x0;var _0x515b8b=_0xd1f1[_0x4f14bd];return _0x515b8b;};'use strict';var _=require(_0x1d1f('0x0'));var utils=require(_0x1d1f('0x1'));var logger=require(_0x1d1f('0x2'))(_0x1d1f('0x3'));var rpc={'chatMessage':require(_0x1d1f('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1d1f('0x5')),'smsMessage':require(_0x1d1f('0x6')),'faxMessage':require(_0x1d1f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1d1f('0x8')]=function(_0x13e896,_0x54e8a0){return function(_0x2337fc){try{var _0x5c285a={'body':utils[_0x1d1f('0x9')](_0x54e8a0[0x0],this),'ContactId':this[_0x1d1f('0xa')]['id']};if(this[_0x1d1f('0xb')]===_0x1d1f('0xc')){_0x5c285a['ChatWebsiteId']=this['account']['id'];}else{_0x5c285a[_['upperFirst'](this[_0x1d1f('0xb')])+_0x1d1f('0xd')]=this[_0x1d1f('0xe')]['id'];}_0x5c285a[_[_0x1d1f('0xf')](this['channel'])+_0x1d1f('0x10')]=this[_0x1d1f('0x11')]['id'];if(rpc[this[_0x1d1f('0xb')]+_0x1d1f('0x12')]){return rpc[this[_0x1d1f('0xb')]+_0x1d1f('0x12')]['create'](_0x5c285a)['then'](function(_0x48e2c0){logger[_0x1d1f('0x13')](_0x1d1f('0x14'),_0x13e896,_0x5c285a[_0x1d1f('0x15')]);_0x2337fc[_0x1d1f('0x16')]();})[_0x1d1f('0x17')](function(_0x465f20){logger[_0x1d1f('0x18')](_0x1d1f('0x14'),_0x13e896,JSON[_0x1d1f('0x19')](_0x465f20));_0x2337fc[_0x1d1f('0x1a')]();});}}catch(_0x2ec931){logger[_0x1d1f('0x18')](_0x1d1f('0x14'),_0x13e896,JSON['stringify'](_0x2ec931));_0x2337fc[_0x1d1f('0x1a')]();}};}; \ No newline at end of file +var _0x4808=['create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','account','InteractionId','interaction','Message'];(function(_0x3beda3,_0x18e35b){var _0x44bafb=function(_0xe56f33){while(--_0xe56f33){_0x3beda3['push'](_0x3beda3['shift']());}};_0x44bafb(++_0x18e35b);}(_0x4808,0x1cc));var _0x8480=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x4808[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x8480('0x0'));var utils=require(_0x8480('0x1'));var logger=require(_0x8480('0x2'))(_0x8480('0x3'));var rpc={'chatMessage':require(_0x8480('0x4')),'openchannelMessage':require(_0x8480('0x5')),'mailMessage':require(_0x8480('0x6')),'smsMessage':require(_0x8480('0x7')),'faxMessage':require(_0x8480('0x8')),'whatsappMessage':require(_0x8480('0x9'))};exports[_0x8480('0xa')]=function(_0x515297,_0x195872){return function(_0xf1622f){try{var _0x3de577={'body':utils[_0x8480('0xb')](_0x195872[0x0],this),'ContactId':this[_0x8480('0xc')]['id']};if(this[_0x8480('0xd')]==='chat'){_0x3de577[_0x8480('0xe')]=this['account']['id'];}else{_0x3de577[_[_0x8480('0xf')](this['channel'])+'AccountId']=this[_0x8480('0x10')]['id'];}_0x3de577[_[_0x8480('0xf')](this[_0x8480('0xd')])+_0x8480('0x11')]=this[_0x8480('0x12')]['id'];if(rpc[this[_0x8480('0xd')]+'Message']){return rpc[this['channel']+_0x8480('0x13')][_0x8480('0x14')](_0x3de577)[_0x8480('0x15')](function(_0x2cd226){logger[_0x8480('0x16')]('[%s][MESSAGE]\x20%s',_0x515297,_0x3de577[_0x8480('0x17')]);_0xf1622f[_0x8480('0x18')]();})[_0x8480('0x19')](function(_0x5802a5){logger[_0x8480('0x1a')](_0x8480('0x1b'),_0x515297,JSON[_0x8480('0x1c')](_0x5802a5));_0xf1622f['stop']();});}}catch(_0x4d6b59){logger['error'](_0x8480('0x1b'),_0x515297,JSON[_0x8480('0x1c')](_0x4d6b59));_0xf1622f[_0x8480('0x1d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 9e5abcd..3d243f5 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe293=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils'];(function(_0x4f613c,_0x425015){var _0x50cffd=function(_0x5b86f1){while(--_0x5b86f1){_0x4f613c['push'](_0x4f613c['shift']());}};_0x50cffd(++_0x425015);}(_0xe293,0x95));var _0x3e29=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xe293[_0xc0d9bc];return _0x32ff73;};'use strict';var utils=require(_0x3e29('0x0'));var logger=require(_0x3e29('0x1'))(_0x3e29('0x2'));exports[_0x3e29('0x3')]=function(_0x477dbf,_0x239000){return function(_0x2af019){try{logger[_0x3e29('0x4')](_0x3e29('0x5'),_0x477dbf,utils[_0x3e29('0x6')](_0x239000[0x0],this));_0x2af019[_0x3e29('0x7')]();}catch(_0x5d552b){logger[_0x3e29('0x8')](_0x3e29('0x5'),_0x477dbf,JSON[_0x3e29('0x9')](_0x5d552b));_0x2af019['stop']();}};}; \ No newline at end of file +var _0xdb69=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x446570,_0x4a2b6a){var _0xfbaef1=function(_0x28cbfa){while(--_0x28cbfa){_0x446570['push'](_0x446570['shift']());}};_0xfbaef1(++_0x4a2b6a);}(_0xdb69,0xba));var _0x9db6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdb69[_0x3bf83f];return _0x22c4a9;};'use strict';var utils=require(_0x9db6('0x0'));var logger=require(_0x9db6('0x1'))(_0x9db6('0x2'));exports[_0x9db6('0x3')]=function(_0x4bedce,_0x4dd4fa){return function(_0x420b7b){try{logger[_0x9db6('0x4')](_0x9db6('0x5'),_0x4bedce,utils['getMustacheRender'](_0x4dd4fa[0x0],this));_0x420b7b[_0x9db6('0x6')]();}catch(_0x1611fa){logger[_0x9db6('0x7')]('[%s][NOOP]\x20%s',_0x4bedce,JSON[_0x9db6('0x8')](_0x1611fa));_0x420b7b[_0x9db6('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index dfa1bbf..470f47d 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd0c=['queue','joinAt','emit','clone','account','push','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','consequence','length','map','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','close','complete','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id'];(function(_0x3a11e4,_0x38d6c9){var _0x95a641=function(_0x1cf9f4){while(--_0x1cf9f4){_0x3a11e4['push'](_0x3a11e4['shift']());}};_0x95a641(++_0x38d6c9);}(_0xfd0c,0x12a));var _0xcfd0=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xfd0c[_0xbec8e6];return _0x4aa6f2;};'use strict';var schema=require(_0xcfd0('0x0'));var _=require(_0xcfd0('0x1'));var util=require(_0xcfd0('0x2'));var seqqueue=require(_0xcfd0('0x3'));var moment=require('moment');var Redis=require(_0xcfd0('0x4'));var config=require(_0xcfd0('0x5'));var logger=require(_0xcfd0('0x6'))(_0xcfd0('0x7'));var strategy=require(_0xcfd0('0x8'));config[_0xcfd0('0x9')]=_[_0xcfd0('0xa')](config[_0xcfd0('0x9')],{'host':_0xcfd0('0xb'),'port':0x18eb});var io=require(_0xcfd0('0xc'))(new Redis(config[_0xcfd0('0x9')]));var attributes=['id',_0xcfd0('0xd'),'account',_0xcfd0('0xe'),'from',_0xcfd0('0xf')];function emit(_0xb63300,_0x22000a,_0x89d4e9){io['to'](_0xb63300)[_0xcfd0('0x10')](_0x22000a,_0x89d4e9);}function emitChannelQueueInteraction(_0x5eb511,_0x237ba8,_0x4cb9c7,_0x14dc97,_0x494420,_0x1ab2a0,_0x4d1bc2,_0x30c04b){var _0x1a9a9c=_[_0xcfd0('0x11')](_0x4cb9c7);_0x1a9a9c[_0xcfd0('0xd')]=_0x30c04b;_0x1a9a9c[_0xcfd0('0xe')]=_0x237ba8;_0x1a9a9c[_0xcfd0('0x12')]=_0x14dc97;_0x1a9a9c['id']=_0x494420;if(_0x1ab2a0){attributes[_0xcfd0('0x13')](_[_0xcfd0('0x14')](_0x5eb511)+'InteractionId');_0x4d1bc2[util[_0xcfd0('0x15')](_0xcfd0('0x16'),_0x5eb511)][_0x494420]=_[_0xcfd0('0x17')](_0x1a9a9c,attributes);}else{delete _0x4d1bc2[util['format'](_0xcfd0('0x16'),_0x5eb511)][_0x494420];}emit(util[_0xcfd0('0x15')](_0xcfd0('0x18'),_0x5eb511,_0x237ba8),util['format'](_0xcfd0('0x19'),_0x5eb511,_0x1ab2a0?_0xcfd0('0x1a'):_0xcfd0('0x1b')),_[_0xcfd0('0x17')](_0x1a9a9c,attributes));}var rpc={'openchannelQueueReport':require(_0xcfd0('0x1c')),'mailQueueReport':require(_0xcfd0('0x1d')),'chatQueueReport':require(_0xcfd0('0x1e')),'smsQueueReport':require(_0xcfd0('0x1f')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xcfd0('0x20'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xcfd0('0x21')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2f2634,_0x27e17d,_0x51e795,_0x26644e){if(_0x2f2634&&_0x27e17d&&_0x51e795){_0x27e17d[_0xcfd0('0x22')]+=0x1;var _0x1dc81a={'uniqueid':_0x2f2634,'from':_0x51e795['body']?_0x51e795[_0xcfd0('0x23')][_0xcfd0('0x24')]:'','joinAt':moment()[_0xcfd0('0x15')](_0xcfd0('0x25')),'ContactId':_0x51e795[_0xcfd0('0x26')]?_0x51e795[_0xcfd0('0x26')]['id']:null,'ListId':_0x51e795[_0xcfd0('0x27')]?_0x51e795[_0xcfd0('0x27')]['id']:null};_0x1dc81a[_['upperFirst'](_0x51e795['channel'])+_0xcfd0('0x28')]=_0x27e17d['id']||null;_0x1dc81a[_[_0xcfd0('0x29')](_0x51e795[_0xcfd0('0x2a')])+'InteractionId']=_0x51e795[_0xcfd0('0x2b')]?_0x51e795[_0xcfd0('0x2b')]['id']:null;_0x1dc81a[_['upperFirst'](_0x51e795[_0xcfd0('0x2a')])+_0xcfd0('0x2c')]=_0x51e795[_0xcfd0('0x2d')]?_0x51e795[_0xcfd0('0x2d')]['id']:null;_0x1dc81a[_[_0xcfd0('0x29')](_0x51e795[_0xcfd0('0x2a')])+(_0x51e795[_0xcfd0('0x2a')]!==_0xcfd0('0x2e')?'AccountId':_0xcfd0('0x2f'))]=_0x51e795[_0xcfd0('0x12')]?_0x51e795[_0xcfd0('0x12')]['id']:null;logger[_0xcfd0('0x30')](util[_0xcfd0('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x2f2634,_0x27e17d[_0xcfd0('0x31')]));emitChannelQueueInteraction(_0x51e795['channel'],_0x27e17d[_0xcfd0('0x31')],_0x1dc81a,_0x51e795[_0xcfd0('0x12')][_0xcfd0('0x31')],_0x51e795['message']['id'],!![],_0x26644e,_0x27e17d['id']);if(rpc[_0x51e795[_0xcfd0('0x2a')]+_0xcfd0('0x32')]){return rpc[_0x51e795[_0xcfd0('0x2a')]+_0xcfd0('0x32')][_0xcfd0('0x33')](_0x1dc81a)[_0xcfd0('0x34')](function(_0x176da4){logger[_0xcfd0('0x35')](_0xcfd0('0x36'));});}}}function stopRouting(_0x2dae1d,_0x234ba4,_0x1dc3ae,_0x5f2f47){if(_0x2dae1d&&_0x234ba4){_0x234ba4[_0xcfd0('0x22')]-=0x1;var _0x14b8b4={'leaveAt':moment()['format'](_0xcfd0('0x25')),'acceptAt':moment()[_0xcfd0('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0xcfd0('0x30')](util[_0xcfd0('0x15')](_0xcfd0('0x37'),_0x2dae1d,_0x234ba4['name']));emitChannelQueueInteraction(_0x1dc3ae[_0xcfd0('0x2a')],_0x234ba4[_0xcfd0('0x31')],_0x1dc3ae[_0xcfd0('0x23')],_0x1dc3ae[_0xcfd0('0x12')][_0xcfd0('0x31')],_0x1dc3ae['message']['id'],![],_0x5f2f47,_0x234ba4['id']);if(rpc[_0x1dc3ae['channel']+_0xcfd0('0x32')]){return rpc[_0x1dc3ae['channel']+_0xcfd0('0x32')][_0xcfd0('0x38')](_0x2dae1d,_0x14b8b4)['catch'](function(_0x281d6e){logger[_0xcfd0('0x35')](_0xcfd0('0x39'));});}}}function endRouting(_0x5babb9,_0x2beab2,_0xee8199,_0x25e2d9){if(_0x5babb9&&_0x2beab2){_0x2beab2[_0xcfd0('0x22')]-=0x1;var _0x514856={'leaveAt':moment()[_0xcfd0('0x15')](_0xcfd0('0x25')),'exitAt':moment()[_0xcfd0('0x15')](_0xcfd0('0x25')),'reason':'timeout'};logger[_0xcfd0('0x30')](util[_0xcfd0('0x15')](_0xcfd0('0x3a'),_0x5babb9,_0x2beab2[_0xcfd0('0x31')]));emitChannelQueueInteraction(_0xee8199['channel'],_0x2beab2[_0xcfd0('0x31')],_0xee8199[_0xcfd0('0x23')],_0xee8199[_0xcfd0('0x12')][_0xcfd0('0x31')],_0xee8199[_0xcfd0('0x2d')]['id'],![],_0x25e2d9);if(rpc[_0xee8199[_0xcfd0('0x2a')]+_0xcfd0('0x32')]){return rpc[_0xee8199[_0xcfd0('0x2a')]+_0xcfd0('0x32')][_0xcfd0('0x38')](_0x5babb9,_0x514856)[_0xcfd0('0x34')](function(_0x58be64){logger[_0xcfd0('0x35')](_0xcfd0('0x39'));});}}}function handleFindQueue(_0x29c65a){return function(_0x177ca7){return _0x177ca7[_0xcfd0('0x31')]['toLowerCase']()===_0x29c65a['toLowerCase']();};}exports[_0xcfd0('0x3b')]=function(_0x350d5c,_0x24b4cb,_0x4e47d5,_0x212df7){return function(_0x52a7f9){try{var _0x46e990={'name':_0x24b4cb[0x0],'timeout':_0x24b4cb[0x1]};var _0x39cdc5=queue['validate'](_0x46e990,{'typecast':!![]});if(_0x39cdc5[_0xcfd0('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x350d5c,_[_0xcfd0('0x3d')](_0x39cdc5,'message')[_0xcfd0('0x3e')](',\x20'));_0x52a7f9[_0xcfd0('0x3f')]();}else{var _0x36b3c9=_[_0xcfd0('0x40')](_0x4e47d5[_0x212df7['channel']+_0xcfd0('0x41')],handleFindQueue(_0x46e990[_0xcfd0('0x31')]));if(_0x36b3c9){startRouting(_0x350d5c,_0x36b3c9,_0x212df7,_0x4e47d5);var _0x3a52e2=(_0x36b3c9[_0xcfd0('0x42')]||0xa)*0x3e8;var _0x158e40=(_0x46e990['timeout']||0x14)*0x3e8;var _0x4ea328;if(_0x3a52e2>_0x158e40){_0x158e40=_0x3a52e2;}var _0x1e8c33=seqqueue[_0xcfd0('0x43')](_0x3a52e2);_0x1e8c33['id']=_0x350d5c;_0x1e8c33[_0xcfd0('0x44')]=_0x3a52e2;_0x1e8c33[_0xcfd0('0x45')]=_0x158e40;_0x1e8c33[_0xcfd0('0x2a')]=_0x212df7[_0xcfd0('0x2a')];_0x4e47d5[_0xcfd0('0x46')][_0x350d5c]['on']('end',function(){logger[_0xcfd0('0x30')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x350d5c);stopRouting(_0x350d5c,_0x36b3c9,_0x212df7,_0x4e47d5);clearTimeout(_0x4ea328);_0x4ea328=undefined;_0x1e8c33[_0xcfd0('0x47')](!![]);if(_0x4e47d5[_0xcfd0('0x46')][_0x350d5c]){delete _0x4e47d5['rules'][_0x350d5c];}_0x52a7f9[_0xcfd0('0x3f')]();});_0x4e47d5[_0xcfd0('0x46')][_0x350d5c]['on'](_0xcfd0('0x48'),function(){if(_0x4e47d5[_0xcfd0('0x46')][_0x350d5c]){delete _0x4e47d5['rules'][_0x350d5c];}});_0x4ea328=setTimeout(function(){logger[_0xcfd0('0x30')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x350d5c);endRouting(_0x350d5c,_0x36b3c9,_0x212df7,_0x4e47d5);clearTimeout(_0x4ea328);_0x1e8c33[_0xcfd0('0x47')](!![]);_0x52a7f9['next']();},_0x158e40);switch(_0x36b3c9['strategy']){case _0xcfd0('0x49'):strategy[_0xcfd0('0x49')](_0x1e8c33,_0x36b3c9,_0x4e47d5,_0x212df7);break;default:strategy[_0xcfd0('0x4a')](_0x1e8c33,_0x36b3c9,_0x4e47d5,_0x212df7);}}else{logger[_0xcfd0('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x350d5c,_0x46e990['name']);_0x52a7f9['stop']();}}}catch(_0x47c815){console[_0xcfd0('0x4b')](_0x47c815);logger[_0xcfd0('0x35')](_0xcfd0('0x4c'),_0x350d5c,_0x47c815[_0xcfd0('0x4d')]);_0x52a7f9[_0xcfd0('0x3f')]();}};}; \ No newline at end of file +var _0x63d4=['InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','interaction','message','chat','AccountId','WebsiteId','info','name','QueueReport','error','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','validate','length','map','join','stop','find','Queues','timeout','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','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','from','joinAt','queue_id','account','push'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x63d4,0xd4));var _0x463d=function(_0xe88031,_0x5d40ff){_0xe88031=_0xe88031-0x0;var _0x2427be=_0x63d4[_0xe88031];return _0x2427be;};'use strict';var schema=require('validate');var _=require(_0x463d('0x0'));var util=require(_0x463d('0x1'));var seqqueue=require(_0x463d('0x2'));var moment=require('moment');var Redis=require(_0x463d('0x3'));var config=require(_0x463d('0x4'));var logger=require('../../../../config/logger')(_0x463d('0x5'));var strategy=require(_0x463d('0x6'));config[_0x463d('0x7')]=_[_0x463d('0x8')](config[_0x463d('0x7')],{'host':_0x463d('0x9'),'port':0x18eb});var io=require(_0x463d('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id','account','queue',_0x463d('0xb'),_0x463d('0xc')];function emit(_0x5c49e3,_0x1215c7,_0x153a74){io['to'](_0x5c49e3)['emit'](_0x1215c7,_0x153a74);}function emitChannelQueueInteraction(_0x4ea45c,_0x7d2df7,_0x4376b7,_0x62549,_0x28a8e5,_0x3ee27d,_0x3263f3,_0x1cea2b){var _0x2399c0=_['clone'](_0x4376b7);_0x2399c0[_0x463d('0xd')]=_0x1cea2b;_0x2399c0['queue']=_0x7d2df7;_0x2399c0[_0x463d('0xe')]=_0x62549;_0x2399c0['id']=_0x28a8e5;if(_0x3ee27d){attributes[_0x463d('0xf')](_['capitalize'](_0x4ea45c)+_0x463d('0x10'));_0x3263f3[util[_0x463d('0x11')](_0x463d('0x12'),_0x4ea45c)][_0x28a8e5]=_[_0x463d('0x13')](_0x2399c0,attributes);}else{delete _0x3263f3[util[_0x463d('0x11')](_0x463d('0x12'),_0x4ea45c)][_0x28a8e5];}emit(util[_0x463d('0x11')]('%s:queue:%s',_0x4ea45c,_0x7d2df7),util[_0x463d('0x11')](_0x463d('0x14'),_0x4ea45c,_0x3ee27d?_0x463d('0x15'):'remove'),_[_0x463d('0x13')](_0x2399c0,attributes));}var rpc={'openchannelQueueReport':require(_0x463d('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x463d('0x17')),'smsQueueReport':require(_0x463d('0x18')),'faxQueueReport':require(_0x463d('0x19')),'whatsappQueueReport':require(_0x463d('0x1a'))};var queue=schema({'name':{'type':_0x463d('0x1b'),'required':!![],'message':_0x463d('0x1c')},'timeout':{'type':_0x463d('0x1d'),'message':_0x463d('0x1e')}});function startRouting(_0x1aa027,_0x3178b6,_0x2bb6d6,_0x2a2802){if(_0x1aa027&&_0x3178b6&&_0x2bb6d6){_0x3178b6[_0x463d('0x1f')]+=0x1;var _0x485426={'uniqueid':_0x1aa027,'from':_0x2bb6d6[_0x463d('0x20')]?_0x2bb6d6['body'][_0x463d('0xb')]:'','joinAt':moment()[_0x463d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bb6d6[_0x463d('0x21')]?_0x2bb6d6[_0x463d('0x21')]['id']:null,'ListId':_0x2bb6d6[_0x463d('0x22')]?_0x2bb6d6[_0x463d('0x22')]['id']:null};_0x485426[_['upperFirst'](_0x2bb6d6['channel'])+'QueueId']=_0x3178b6['id']||null;_0x485426[_[_0x463d('0x23')](_0x2bb6d6[_0x463d('0x24')])+_0x463d('0x10')]=_0x2bb6d6[_0x463d('0x25')]?_0x2bb6d6[_0x463d('0x25')]['id']:null;_0x485426[_[_0x463d('0x23')](_0x2bb6d6[_0x463d('0x24')])+'MessageId']=_0x2bb6d6[_0x463d('0x26')]?_0x2bb6d6[_0x463d('0x26')]['id']:null;_0x485426[_[_0x463d('0x23')](_0x2bb6d6[_0x463d('0x24')])+(_0x2bb6d6['channel']!==_0x463d('0x27')?_0x463d('0x28'):_0x463d('0x29'))]=_0x2bb6d6[_0x463d('0xe')]?_0x2bb6d6[_0x463d('0xe')]['id']:null;logger[_0x463d('0x2a')](util[_0x463d('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x1aa027,_0x3178b6['name']));emitChannelQueueInteraction(_0x2bb6d6[_0x463d('0x24')],_0x3178b6[_0x463d('0x2b')],_0x485426,_0x2bb6d6[_0x463d('0xe')][_0x463d('0x2b')],_0x2bb6d6['message']['id'],!![],_0x2a2802,_0x3178b6['id']);if(rpc[_0x2bb6d6[_0x463d('0x24')]+_0x463d('0x2c')]){return rpc[_0x2bb6d6[_0x463d('0x24')]+_0x463d('0x2c')]['create'](_0x485426)['catch'](function(_0x40bac5){logger[_0x463d('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x19e6cd,_0x591410,_0x35a157,_0xd66af9){if(_0x19e6cd&&_0x591410){_0x591410[_0x463d('0x1f')]-=0x1;var _0x37f3b2={'leaveAt':moment()[_0x463d('0x11')](_0x463d('0x2e')),'acceptAt':moment()['format'](_0x463d('0x2e')),'reason':'accepted'};logger[_0x463d('0x2a')](util[_0x463d('0x11')](_0x463d('0x2f'),_0x19e6cd,_0x591410[_0x463d('0x2b')]));emitChannelQueueInteraction(_0x35a157[_0x463d('0x24')],_0x591410[_0x463d('0x2b')],_0x35a157[_0x463d('0x20')],_0x35a157['account'][_0x463d('0x2b')],_0x35a157['message']['id'],![],_0xd66af9,_0x591410['id']);if(rpc[_0x35a157[_0x463d('0x24')]+_0x463d('0x2c')]){return rpc[_0x35a157[_0x463d('0x24')]+_0x463d('0x2c')][_0x463d('0x30')](_0x19e6cd,_0x37f3b2)[_0x463d('0x31')](function(_0x3e9c2c){logger[_0x463d('0x2d')](_0x463d('0x32'));});}}}function endRouting(_0x21f80a,_0x3b87b6,_0x520a60,_0x3510a4){if(_0x21f80a&&_0x3b87b6){_0x3b87b6[_0x463d('0x1f')]-=0x1;var _0x3770ab={'leaveAt':moment()[_0x463d('0x11')](_0x463d('0x2e')),'exitAt':moment()['format'](_0x463d('0x2e')),'reason':'timeout'};logger['info'](util[_0x463d('0x11')](_0x463d('0x33'),_0x21f80a,_0x3b87b6[_0x463d('0x2b')]));emitChannelQueueInteraction(_0x520a60[_0x463d('0x24')],_0x3b87b6[_0x463d('0x2b')],_0x520a60[_0x463d('0x20')],_0x520a60[_0x463d('0xe')][_0x463d('0x2b')],_0x520a60[_0x463d('0x26')]['id'],![],_0x3510a4);if(rpc[_0x520a60[_0x463d('0x24')]+_0x463d('0x2c')]){return rpc[_0x520a60[_0x463d('0x24')]+_0x463d('0x2c')][_0x463d('0x30')](_0x21f80a,_0x3770ab)[_0x463d('0x31')](function(_0x4f45a3){logger[_0x463d('0x2d')](_0x463d('0x32'));});}}}function handleFindQueue(_0x2b3306){return function(_0x322280){return _0x322280[_0x463d('0x2b')]['toLowerCase']()===_0x2b3306[_0x463d('0x34')]();};}exports['consequence']=function(_0x4c3050,_0x425ecd,_0x48dc6f,_0x1ac8aa){return function(_0x21fd17){try{var _0xdeddf3={'name':_0x425ecd[0x0],'timeout':_0x425ecd[0x1]};var _0x336bc3=queue[_0x463d('0x35')](_0xdeddf3,{'typecast':!![]});if(_0x336bc3[_0x463d('0x36')]){logger[_0x463d('0x2d')]('[%s][QUEUE]\x20%s',_0x4c3050,_[_0x463d('0x37')](_0x336bc3,_0x463d('0x26'))[_0x463d('0x38')](',\x20'));_0x21fd17[_0x463d('0x39')]();}else{var _0x118976=_[_0x463d('0x3a')](_0x48dc6f[_0x1ac8aa[_0x463d('0x24')]+_0x463d('0x3b')],handleFindQueue(_0xdeddf3['name']));if(_0x118976){startRouting(_0x4c3050,_0x118976,_0x1ac8aa,_0x48dc6f);var _0x1e646a=(_0x118976['timeout']||0xa)*0x3e8;var _0x1b61a1=(_0xdeddf3[_0x463d('0x3c')]||0x14)*0x3e8;var _0x29300f;if(_0x1e646a>_0x1b61a1){_0x1b61a1=_0x1e646a;}var _0x471f8e=seqqueue[_0x463d('0x3d')](_0x1e646a);_0x471f8e['id']=_0x4c3050;_0x471f8e[_0x463d('0x3e')]=_0x1e646a;_0x471f8e[_0x463d('0x3f')]=_0x1b61a1;_0x471f8e[_0x463d('0x24')]=_0x1ac8aa[_0x463d('0x24')];_0x48dc6f[_0x463d('0x40')][_0x4c3050]['on'](_0x463d('0x41'),function(){logger[_0x463d('0x2a')](_0x463d('0x42'),_0x4c3050);stopRouting(_0x4c3050,_0x118976,_0x1ac8aa,_0x48dc6f);clearTimeout(_0x29300f);_0x29300f=undefined;_0x471f8e[_0x463d('0x43')](!![]);if(_0x48dc6f[_0x463d('0x40')][_0x4c3050]){delete _0x48dc6f['rules'][_0x4c3050];}_0x21fd17[_0x463d('0x39')]();});_0x48dc6f['rules'][_0x4c3050]['on'](_0x463d('0x44'),function(){if(_0x48dc6f['rules'][_0x4c3050]){delete _0x48dc6f[_0x463d('0x40')][_0x4c3050];}});_0x29300f=setTimeout(function(){logger[_0x463d('0x2a')](_0x463d('0x45'),_0x4c3050);endRouting(_0x4c3050,_0x118976,_0x1ac8aa,_0x48dc6f);clearTimeout(_0x29300f);_0x471f8e[_0x463d('0x43')](!![]);_0x21fd17[_0x463d('0x46')]();},_0x1b61a1);switch(_0x118976['strategy']){case _0x463d('0x47'):strategy[_0x463d('0x47')](_0x471f8e,_0x118976,_0x48dc6f,_0x1ac8aa);break;default:strategy[_0x463d('0x48')](_0x471f8e,_0x118976,_0x48dc6f,_0x1ac8aa);}}else{logger['error'](_0x463d('0x49'),_0x4c3050,_0xdeddf3[_0x463d('0x2b')]);_0x21fd17[_0x463d('0x39')]();}}}catch(_0x1f9483){console['log'](_0x1f9483);logger[_0x463d('0x2d')](_0x463d('0x4a'),_0x4c3050,_0x1f9483[_0x463d('0x4b')]);_0x21fd17['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 5144e85..fa1d28f 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','writeLog'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4c8540,_0x1243ae){_0x4c8540=_0x4c8540-0x0;var _0x32f264=_0xd0bb[_0x4c8540];return _0x32f264;};'use strict';var _=require(_0xbd0b('0x0'));var uuid=require(_0xbd0b('0x1'));var util=require(_0xbd0b('0x2'));var logger=require('../../../../../config/logger')(_0xbd0b('0x3'));var Agent=function(_0x4ab08f,_0x39b03a,_0x1f6ec3,_0x53e6ce){this[_0xbd0b('0x4')]=uuid['v4']();this['squeue']=_0x4ab08f;this[_0xbd0b('0x5')]=_0x39b03a;this[_0xbd0b('0x6')]=_0x1f6ec3;this[_0xbd0b('0x3')]=_0x53e6ce;this[_0xbd0b('0x7')][_0xbd0b('0x8')](this['handleRun'][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xb'),this['handleTimeout']['bind'](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xc'),this['handleDrained'][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')]['push']=function(){this[_0xbd0b('0x7')][_0xbd0b('0x8')](this[_0xbd0b('0xe')][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')][_0xbd0b('0xf')]=function(){this[_0xbd0b('0xa')](!![]);};Agent[_0xbd0b('0xd')][_0xbd0b('0xe')]=function(){logger['debug'](_0xbd0b('0x10'),this['squeue']['id'],this['agent']['id']);if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']])){logger[_0xbd0b('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xbd0b('0x5')]['id']);setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}else{if(this[_0xbd0b('0x3')][_0xbd0b('0x14')]||util[_0xbd0b('0x15')](this['squeue']['id'],this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']],this[_0xbd0b('0x7')][_0xbd0b('0x16')],![])){this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=!![];this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']]['busyQueue']=undefined;util[_0xbd0b('0x18')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x19')](this['notificationId'],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],null,this[_0xbd0b('0x3')]);util[_0xbd0b('0x1a')](this['squeue']['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xbd0b('0x1b')+(this[_0xbd0b('0x3')][_0xbd0b('0x14')]?':FORCED':''));}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1c'),this[_0xbd0b('0x7')]['id'],this['agent']['id']);setTimeout(this['push'][_0xbd0b('0x9')](this),0x3e8);}}};Agent[_0xbd0b('0xd')][_0xbd0b('0xa')]=function(_0xf4ba04){if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']])){return logger[_0xbd0b('0x13')](_0xbd0b('0x1d'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1e'),this['squeue']['id'],this[_0xbd0b('0x5')]['id']);util[_0xbd0b('0x1f')](this[_0xbd0b('0x4')],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']],null,this[_0xbd0b('0x3')]);this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=![];this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x20')]=undefined;util[_0xbd0b('0x21')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x1a')](this[_0xbd0b('0x7')]['id'],this['realtime'][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xf4ba04?_0xbd0b('0x22'):_0xbd0b('0x23'));}if(!_0xf4ba04){setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}};function agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098){return new Agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098);}module[_0xbd0b('0x24')]=agent; \ No newline at end of file +var _0xf2ca=['channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','handleRun','bind','timeout','drained','handleDrained','push','prototype','handleTimeout','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership'];(function(_0x32bfd3,_0xf51849){var _0x1d7ce6=function(_0x40edad){while(--_0x40edad){_0x32bfd3['push'](_0x32bfd3['shift']());}};_0x1d7ce6(++_0xf51849);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0xf2ca[_0x507597];return _0x110a0f;};'use strict';var _=require(_0xaf2c('0x0'));var uuid=require(_0xaf2c('0x1'));var util=require(_0xaf2c('0x2'));var logger=require('../../../../../config/logger')(_0xaf2c('0x3'));var Agent=function(_0x2102e2,_0x1271a9,_0x219511,_0x3a724c){this[_0xaf2c('0x4')]=uuid['v4']();this['squeue']=_0x2102e2;this[_0xaf2c('0x5')]=_0x1271a9;this[_0xaf2c('0x6')]=_0x219511;this[_0xaf2c('0x3')]=_0x3a724c;this[_0xaf2c('0x7')]['push'](this[_0xaf2c('0x8')][_0xaf2c('0x9')](this),this['handleTimeout'][_0xaf2c('0x9')](this));this['squeue']['on'](_0xaf2c('0xa'),this['handleTimeout'][_0xaf2c('0x9')](this));this[_0xaf2c('0x7')]['on'](_0xaf2c('0xb'),this[_0xaf2c('0xc')]['bind'](this));};Agent['prototype'][_0xaf2c('0xd')]=function(){this[_0xaf2c('0x7')][_0xaf2c('0xd')](this[_0xaf2c('0x8')][_0xaf2c('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0xaf2c('0xe')][_0xaf2c('0xc')]=function(){this[_0xaf2c('0xf')](!![]);};Agent[_0xaf2c('0xe')][_0xaf2c('0x8')]=function(){logger[_0xaf2c('0x10')](_0xaf2c('0x11'),this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);if(_[_0xaf2c('0x12')](this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']])){logger[_0xaf2c('0x10')](_0xaf2c('0x14'),this['squeue']['id'],this[_0xaf2c('0x5')]['id']);setTimeout(this['push'][_0xaf2c('0x9')](this),0x3e8);}else{if(this[_0xaf2c('0x3')][_0xaf2c('0x15')]||util['isAgentAvailable'](this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']],this[_0xaf2c('0x7')][_0xaf2c('0x16')],![])){this['realtime'][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x17')]=!![];this[_0xaf2c('0x6')][_0xaf2c('0x13')][this['agent']['id']][_0xaf2c('0x18')]=undefined;util[_0xaf2c('0x19')](this[_0xaf2c('0x6')],this['routing'],this['agent'],this[_0xaf2c('0x7')][_0xaf2c('0x16')]);util[_0xaf2c('0x1a')](this[_0xaf2c('0x4')],this['squeue']['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']],null,this[_0xaf2c('0x3')]);util[_0xaf2c('0x1b')](this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x6')]['agents'][this[_0xaf2c('0x5')]['id']],_0xaf2c('0x1c')+(this[_0xaf2c('0x3')][_0xaf2c('0x15')]?':FORCED':''));}else{logger[_0xaf2c('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);setTimeout(this[_0xaf2c('0xd')]['bind'](this),0x3e8);}}};Agent[_0xaf2c('0xe')][_0xaf2c('0xf')]=function(_0x3baee2){if(_['isNil'](this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']])){return logger[_0xaf2c('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);}else{logger[_0xaf2c('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xaf2c('0x5')]['id']);util['hideNotification'](this[_0xaf2c('0x4')],this['squeue']['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this['agent']['id']],null,this[_0xaf2c('0x3')]);this[_0xaf2c('0x6')]['agents'][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x17')]=![];this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x18')]=undefined;util['removeWaitingNotification'](this[_0xaf2c('0x6')],this['routing'],this[_0xaf2c('0x5')],this['squeue'][_0xaf2c('0x16')]);util['writeLog'](this[_0xaf2c('0x7')]['id'],this['realtime'][_0xaf2c('0x13')][this['agent']['id']],_0x3baee2?_0xaf2c('0x1d'):_0xaf2c('0x1e'));}if(!_0x3baee2){setTimeout(this[_0xaf2c('0xd')][_0xaf2c('0x9')](this),0x3e8);}};function agent(_0x470aff,_0x598adb,_0x4cba13,_0x6f428d){return new Agent(_0x470aff,_0x598adb,_0x4cba13,_0x6f428d);}module[_0xaf2c('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 5d31091..c3aaf31 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4172=['prototype','isNil','Agents','length','agents','isAgentAvailable','channel','RINGING','busy','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','busyQueue','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained'];(function(_0x5eb1a8,_0x30e664){var _0x14c11c=function(_0x5f2ea5){while(--_0x5f2ea5){_0x5eb1a8['push'](_0x5eb1a8['shift']());}};_0x14c11c(++_0x30e664);}(_0x4172,0x128));var _0x2417=function(_0x15d39b,_0x3a86a8){_0x15d39b=_0x15d39b-0x0;var _0x41cab6=_0x4172[_0x15d39b];return _0x41cab6;};'use strict';var _=require(_0x2417('0x0'));var uuid=require('uuid');var util=require(_0x2417('0x1'));var logger=require(_0x2417('0x2'))(_0x2417('0x3'));var Beepall=function(_0x58d6f3,_0x595d68,_0x3b870c,_0x3a4fff){this[_0x2417('0x4')]=uuid['v4']();this[_0x2417('0x5')]=_0x58d6f3;this[_0x2417('0x6')]=_0x595d68;this[_0x2417('0x7')]=_0x3b870c;this[_0x2417('0x3')]=_0x3a4fff;this[_0x2417('0x5')][_0x2417('0x8')](this[_0x2417('0x9')][_0x2417('0xa')](this),this[_0x2417('0xb')][_0x2417('0xa')](this));this[_0x2417('0x5')]['on'](_0x2417('0xc'),this[_0x2417('0xb')][_0x2417('0xa')](this));this['squeue']['on']('drained',this[_0x2417('0xd')][_0x2417('0xa')](this));};Beepall[_0x2417('0xe')][_0x2417('0x8')]=function(){this[_0x2417('0x5')][_0x2417('0x8')](this[_0x2417('0x9')][_0x2417('0xa')](this),this[_0x2417('0xb')]['bind'](this));};Beepall[_0x2417('0xe')]['handleDrained']=function(){this[_0x2417('0xb')](!![]);};Beepall[_0x2417('0xe')]['handleRun']=function(){var _0x2dab6c=!![];if(!_[_0x2417('0xf')](this[_0x2417('0x6')])&&!_[_0x2417('0xf')](this[_0x2417('0x6')][_0x2417('0x10')])&&this[_0x2417('0x6')]['Agents'][_0x2417('0x11')]>0x0){for(var _0x4a7b6f=0x0,_0x569e88;_0x4a7b6f0x0){for(var _0x1a71c9=0x0,_0x2be52b;_0x1a71c90x0&&_0x23e21f[_0x275a79+_0xe778('0x25')]>=_0x23e21f[_0x275a79+_0xe778('0x24')]){writeLog(_0x19f33d,_0x23e21f,_0x275a79['toUpperCase']()+_0xe778('0x26'));return![];}}return!![];};exports[_0xe778('0x27')]=function(_0x50ce,_0x431eca,_0x3b0035,_0x1ea9a8,_0x4994f5){return sendNotification(!![],_0x50ce,_0x431eca,_0x3b0035,_0x1ea9a8,_0x4994f5);};exports['hideNotification']=function(_0x6925c4,_0x1bd724,_0x3d1276,_0x9446ec,_0x5de3c4){return sendNotification(![],_0x6925c4,_0x1bd724,_0x3d1276,_0x9446ec,_0x5de3c4);};exports[_0xe778('0x28')]=function(_0x529136,_0x95a4f8,_0x5132d8){var _0x14a27e=_0x95a4f8[_0xe778('0x29')][_0xe778('0x2a')];if(!_0x14a27e&&_0x5132d8){_0x14a27e=_0x5132d8['id'];}var _0x401c2c=_[_0xe778('0x2b')](_0x529136[_0x95a4f8[_0xe778('0x2c')]+_0xe778('0x2d')],function(_0x3efdb5){var _0x2224e2=_['capitalize'](_0x95a4f8[_0xe778('0x2c')])+_0xe778('0x2e');return _0x3efdb5[_0x2224e2]===_0x95a4f8[_0xe778('0x29')]['id'];});if(!_0x401c2c&&_0x14a27e){_0x401c2c=_[_0xe778('0x2b')](_0x529136['agents'][_0x14a27e][_0x95a4f8[_0xe778('0x2c')]+_0xe778('0x2f')],function(_0x49360d){return _0x49360d['id']===_0x95a4f8[_0xe778('0x29')]['id'];});}return _0x401c2c;};exports[_0xe778('0x30')]=function(_0x3969a1,_0x579010,_0x4775bf,_0x406da6){_0x3969a1[_0xe778('0x31')][_0x4775bf['id']][_0x406da6+_0xe778('0x2f')][_0x579010['message']['id']]={'id':_0x579010[_0xe778('0x29')]['id']};};exports[_0xe778('0x32')]=function(_0x137dfd,_0x36d606,_0x4f4af,_0xd1aaa5){delete _0x137dfd[_0xe778('0x31')][_0x4f4af['id']][_0xd1aaa5+_0xe778('0x2f')][_0x36d606[_0xe778('0x18')]['id']];};exports[_0xe778('0x33')]=writeLog; \ No newline at end of file +var _0x28c1=['interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','agents','WaitingInteractions','saveWaitingNotification','lodash','util','../utils','ioredis','../../../../../config/environment','routing','defaults','redis','localhost','format','emit','user:save','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','debug','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','checkWaitingNotifications'];(function(_0x58e33b,_0x38466e){var _0xddaa95=function(_0xf52303){while(--_0xf52303){_0x58e33b['push'](_0x58e33b['shift']());}};_0xddaa95(++_0x38466e);}(_0x28c1,0x17c));var _0x128c=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x28c1[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x128c('0x0'));var util=require(_0x128c('0x1'));var utils=require(_0x128c('0x2'));var Redis=require(_0x128c('0x3'));var config=require(_0x128c('0x4'));var logger=require('../../../../../config/logger')(_0x128c('0x5'));config['redis']=_[_0x128c('0x6')](config[_0x128c('0x7')],{'host':_0x128c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x128c('0x7')]));function sendNotification(_0xca33d,_0x4cf37d,_0x1ae140,_0x5f3409,_0x962ae2,_0x7ee55a){io['to'](util[_0x128c('0x9')]('user:%s',_0x5f3409['name']))[_0x128c('0xa')](_0x128c('0xb'),_0x5f3409);var _0xb9b507=_0x7ee55a||{};var _0x515cfa=_0x1ae140[_0x128c('0xc')]('.');var _0x221293={'uniqueid':_0x4cf37d,'channel':_0x515cfa[0x0],'id':_0x515cfa[0x1],'title':_0x515cfa[0x0]+_0x128c('0xd'),'interactionId':_0x515cfa[0x2],'queue':_0x962ae2?_0x962ae2[_0x128c('0xe')]:null,'sound':_0xb9b507[_0x128c('0xf')][_0x128c('0x10')],'shake':_0xb9b507[_0x128c('0xf')][_0x128c('0x11')]};try{if(!_0xb9b507[_0x128c('0x12')]){_0xb9b507[_0x128c('0x12')]={};}if(_0x962ae2){_0xb9b507[_0x128c('0x12')][_0x128c('0x13')]=_0x962ae2;}else if(_0xb9b507[_0x128c('0x12')]['queue']){delete _0xb9b507[_0x128c('0x12')][_0x128c('0x13')];}_0x221293[_0x128c('0x14')]=utils['getMustacheRender'](_0xb9b507['account'][_0x128c('0x15')],_0xb9b507);}catch(_0x435d62){_0x221293[_0x128c('0x14')]=_0x128c('0x16');logger[_0x128c('0x17')](util[_0x128c('0x9')](_0x128c('0x18'),_0x4cf37d,_0x435d62[_0x128c('0x19')]));}io['to'](util[_0x128c('0x9')](_0x128c('0x1a'),_0x5f3409['name']))[_0x128c('0xa')](util[_0x128c('0x9')](_0x128c('0x1b'),_0xca33d?_0x128c('0x1c'):_0x128c('0x1d')),_0x221293);}function writeLog(_0x2004bc,_0xa868d8,_0x5336f6){return logger[_0x128c('0x1e')](util[_0x128c('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x2004bc,_0xa868d8['name'],_0x5336f6));}exports[_0x128c('0x1f')]=function(_0x17db78,_0x161ca7,_0x58ce16,_0x8c8a54){if(_0x161ca7[_0x128c('0x20')]){writeLog(_0x17db78,_0x161ca7,_0x128c('0x21'));return![];}if(!_0x161ca7[_0x128c('0x22')]){writeLog(_0x17db78,_0x161ca7,'OFFLINE');return![];}if(_0x161ca7[_0x58ce16+_0x128c('0x23')]){writeLog(_0x17db78,_0x161ca7,_0x128c('0x24'));return![];}if(_0x8c8a54&&_0x161ca7['hasOwnProperty'](_0x58ce16+_0x128c('0x25'))&&_0x161ca7[_0x128c('0x26')](_0x58ce16+_0x128c('0x27'))){if(_0x161ca7[_0x58ce16+_0x128c('0x25')]>0x0&&_0x161ca7[_0x58ce16+'CurrentCapacity']>=_0x161ca7[_0x58ce16+'Capacity']){writeLog(_0x17db78,_0x161ca7,_0x58ce16[_0x128c('0x28')]()+_0x128c('0x29'));return![];}}return!![];};exports[_0x128c('0x2a')]=function(_0x228671,_0x414a8d,_0x509e37,_0x447a16,_0x51683a){return sendNotification(!![],_0x228671,_0x414a8d,_0x509e37,_0x447a16,_0x51683a);};exports['hideNotification']=function(_0x14b7a0,_0x1ed641,_0x15344b,_0x1b5723,_0x1954fb){return sendNotification(![],_0x14b7a0,_0x1ed641,_0x15344b,_0x1b5723,_0x1954fb);};exports[_0x128c('0x2b')]=function(_0x596adc,_0x4a7a9f,_0x99930e){var _0x8c23f0=_0x4a7a9f[_0x128c('0x2c')][_0x128c('0x2d')];if(!_0x8c23f0&&_0x99930e){_0x8c23f0=_0x99930e['id'];}var _0xb63082=_[_0x128c('0x2e')](_0x596adc[_0x4a7a9f[_0x128c('0x2f')]+_0x128c('0x30')],function(_0x392ba3){var _0x2218df=_[_0x128c('0x31')](_0x4a7a9f[_0x128c('0x2f')])+'InteractionId';return _0x392ba3[_0x2218df]===_0x4a7a9f[_0x128c('0x2c')]['id'];});if(!_0xb63082&&_0x8c23f0){_0xb63082=_['some'](_0x596adc[_0x128c('0x32')][_0x8c23f0][_0x4a7a9f[_0x128c('0x2f')]+_0x128c('0x33')],function(_0x19dc67){return _0x19dc67['id']===_0x4a7a9f['interaction']['id'];});}return _0xb63082;};exports[_0x128c('0x34')]=function(_0x176cd9,_0x5cc8c5,_0x3af028,_0x1e4f57){_0x176cd9[_0x128c('0x32')][_0x3af028['id']][_0x1e4f57+_0x128c('0x33')][_0x5cc8c5['message']['id']]={'id':_0x5cc8c5[_0x128c('0x2c')]['id']};};exports['removeWaitingNotification']=function(_0x286b06,_0x190da9,_0x112265,_0x17ec36){delete _0x286b06[_0x128c('0x32')][_0x112265['id']][_0x17ec36+_0x128c('0x33')][_0x190da9[_0x128c('0x19')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index da521da..dfd6e97 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fcf=['[%s][SYSTEM]\x20%s','isObject','stringify','lodash','./utils','../../../../config/logger','routing','string','consequence','validate','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x3e834a,_0x33654b){var _0xe8ab5b=function(_0x3d4ed8){while(--_0x3d4ed8){_0x3e834a['push'](_0x3e834a['shift']());}};_0xe8ab5b(++_0x33654b);}(_0x0fcf,0xdb));var _0xf0fc=function(_0x608b35,_0x69f514){_0x608b35=_0x608b35-0x0;var _0x58bc5a=_0x0fcf[_0x608b35];return _0x58bc5a;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0xf0fc('0x0'));var utils=require(_0xf0fc('0x1'));var logger=require(_0xf0fc('0x2'))(_0xf0fc('0x3'));var system=schema({'command':{'type':_0xf0fc('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf0fc('0x5')]=function(_0x20cc07,_0x16ec27){return function(_0x59a3d6){try{var _0x4f1255={'command':_0x16ec27[0x0]};var _0x3ba564=system[_0xf0fc('0x6')](_0x4f1255,{'typecast':!![]});if(_0x3ba564[_0xf0fc('0x7')]){logger[_0xf0fc('0x8')]('[%s][SYSTEM]\x20%s',_0x20cc07,_[_0xf0fc('0x9')](_0x3ba564,_0xf0fc('0xa'))[_0xf0fc('0xb')](',\x20'));logger[_0xf0fc('0xc')](_0xf0fc('0xd'),_0x20cc07);_0x59a3d6[_0xf0fc('0xe')]();}else{var _0x4eb655=this;var _0x173dbe=utils['getMustacheRender'](_0x16ec27[0x0],this);logger[_0xf0fc('0xc')](_0xf0fc('0xf'),_0x20cc07,_0x173dbe);sh[_0xf0fc('0x10')](_['trim'](_0x173dbe),function(_0x42f8c6,_0x46aaf9){logger[_0xf0fc('0xc')](_0xf0fc('0x11'),_0x20cc07,_0x42f8c6);if(_0x42f8c6==0x0){var _0x55f293=_0x46aaf9[_0xf0fc('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xf0fc('0x13')](_0x16ec27[0x1])||_[_0xf0fc('0x14')](_0x16ec27[0x1])){logger[_0xf0fc('0xc')](_0xf0fc('0x15'),_0x20cc07);_0x4eb655[_0xf0fc('0x16')][_0x16ec27[0x1]]=_0x55f293;}else{logger[_0xf0fc('0xc')](_0xf0fc('0x17'),_0x20cc07,_0x16ec27[0x1],_0x55f293);_0x4eb655[_0xf0fc('0x16')][_0x16ec27[0x1]]=_0x55f293;}}_0x59a3d6[_0xf0fc('0xe')]();});}}catch(_0x28e9d7){logger['error'](_0xf0fc('0x18'),_0x20cc07,_[_0xf0fc('0x19')](_0x28e9d7)?JSON[_0xf0fc('0x1a')](_0x28e9d7):_0x28e9d7);logger[_0xf0fc('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x20cc07);_0x59a3d6[_0xf0fc('0xe')]();}};}; \ No newline at end of file +var _0x09c1=['isObject','stringify','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x09c1,0xb1));var _0x109c=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0x09c1[_0x4eab61];return _0x342426;};'use strict';var schema=require('validate');var sh=require(_0x109c('0x0'));var _=require(_0x109c('0x1'));var utils=require('./utils');var logger=require(_0x109c('0x2'))(_0x109c('0x3'));var system=schema({'command':{'type':_0x109c('0x4'),'required':!![],'message':_0x109c('0x5')}});exports['consequence']=function(_0x3609f6,_0x1b7c47){return function(_0x542217){try{var _0x369c4e={'command':_0x1b7c47[0x0]};var _0x17a333=system[_0x109c('0x6')](_0x369c4e,{'typecast':!![]});if(_0x17a333['length']){logger[_0x109c('0x7')]('[%s][SYSTEM]\x20%s',_0x3609f6,_[_0x109c('0x8')](_0x17a333,_0x109c('0x9'))['join'](',\x20'));logger[_0x109c('0xa')](_0x109c('0xb'),_0x3609f6);_0x542217[_0x109c('0xc')]();}else{var _0x17a60f=this;var _0x9eebc0=utils[_0x109c('0xd')](_0x1b7c47[0x0],this);logger[_0x109c('0xa')](_0x109c('0xe'),_0x3609f6,_0x9eebc0);sh[_0x109c('0xf')](_['trim'](_0x9eebc0),function(_0x1d5b3b,_0x427b87){logger[_0x109c('0xa')](_0x109c('0x10'),_0x3609f6,_0x1d5b3b);if(_0x1d5b3b==0x0){var _0x266097=_0x427b87[_0x109c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x109c('0x12')](_0x1b7c47[0x1])||_['isEmpty'](_0x1b7c47[0x1])){logger[_0x109c('0xa')](_0x109c('0x13'),_0x3609f6);_0x17a60f[_0x109c('0x14')][_0x1b7c47[0x1]]=_0x266097;}else{logger[_0x109c('0xa')](_0x109c('0x15'),_0x3609f6,_0x1b7c47[0x1],_0x266097);_0x17a60f[_0x109c('0x14')][_0x1b7c47[0x1]]=_0x266097;}}_0x542217[_0x109c('0xc')]();});}}catch(_0x13f6db){logger[_0x109c('0x7')](_0x109c('0x16'),_0x3609f6,_[_0x109c('0x17')](_0x13f6db)?JSON[_0x109c('0x18')](_0x13f6db):_0x13f6db);logger[_0x109c('0xa')](_0x109c('0xb'),_0x3609f6);_0x542217['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index d1076b2..34798bc 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cb0=['channel','Interaction','addTags','interaction','then','stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next'];(function(_0x4e7e3d,_0x2ecc71){var _0x263bc9=function(_0x5ddd1a){while(--_0x5ddd1a){_0x4e7e3d['push'](_0x4e7e3d['shift']());}};_0x263bc9(++_0x2ecc71);}(_0x5cb0,0x125));var _0x05cb=function(_0x19fa8f,_0x42739f){_0x19fa8f=_0x19fa8f-0x0;var _0x1290ba=_0x5cb0[_0x19fa8f];return _0x1290ba;};'use strict';var schema=require(_0x05cb('0x0'));var _=require(_0x05cb('0x1'));var rpc={'chatInteraction':require(_0x05cb('0x2')),'openchannelInteraction':require(_0x05cb('0x3')),'smsInteraction':require(_0x05cb('0x4')),'mailInteraction':require(_0x05cb('0x5')),'faxInteraction':require(_0x05cb('0x6')),'whatsappInteraction':require(_0x05cb('0x7'))};var logger=require(_0x05cb('0x8'))(_0x05cb('0x9'));var tag=schema({'tag':{'type':_0x05cb('0xa'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x05cb('0xb')]=function(_0x4ccbec,_0x4e4a07,_0x47dd55,_0x4c83db){return function(_0x5175e3){try{var _0x53f77b={'tag':_0x4e4a07[0x0]};var _0x1a4935=tag['validate'](_0x53f77b,{'typecast':!![]});if(_0x1a4935[_0x05cb('0xc')]){logger[_0x05cb('0xd')](_0x05cb('0xe'),_0x4ccbec,_[_0x05cb('0xf')](_0x1a4935,'message')['join'](',\x20'));logger[_0x05cb('0x10')](_0x05cb('0x11'),_0x4ccbec);_0x5175e3[_0x05cb('0x12')]();}else{var _0x3aed4c={'ids':[_0x4e4a07[0x0]]};if(rpc[_0x4c83db[_0x05cb('0x13')]+_0x05cb('0x14')]){rpc[_0x4c83db[_0x05cb('0x13')]+_0x05cb('0x14')][_0x05cb('0x15')](_0x4c83db[_0x05cb('0x16')]['id'],_0x3aed4c)[_0x05cb('0x17')](function(_0x1d6280){logger[_0x05cb('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4ccbec,_0x4e4a07[0x1],_0x4c83db[_0x05cb('0x13')],_0x4c83db[_0x05cb('0x16')]['id']);})['catch'](function(_0x4c5c08){logger[_0x05cb('0xd')](_0x05cb('0xe'),_0x4ccbec,JSON[_0x05cb('0x18')](_0x4c5c08));logger[_0x05cb('0x10')](_0x05cb('0x11'),_0x4ccbec);})[_0x05cb('0x19')](function(){_0x5175e3[_0x05cb('0x12')]();});}}}catch(_0xd415bf){logger[_0x05cb('0xd')]('[%s][TAG]\x20%s',_0x4ccbec,_['isObject'](_0xd415bf)?JSON[_0x05cb('0x18')](_0xd415bf):_0xd415bf);logger[_0x05cb('0x10')](_0x05cb('0x11'),_0x4ccbec);_0x5175e3[_0x05cb('0x12')]();}};}; \ No newline at end of file +var _0x0e63=['then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','finally','isObject','stringify','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction'];(function(_0x5bed68,_0x552486){var _0x857701=function(_0x4da81d){while(--_0x4da81d){_0x5bed68['push'](_0x5bed68['shift']());}};_0x857701(++_0x552486);}(_0x0e63,0xe6));var _0x30e6=function(_0x183fa0,_0x13b4af){_0x183fa0=_0x183fa0-0x0;var _0x5db369=_0x0e63[_0x183fa0];return _0x5db369;};'use strict';var schema=require('validate');var _=require(_0x30e6('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x30e6('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x30e6('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x30e6('0x3'))};var logger=require(_0x30e6('0x4'))(_0x30e6('0x5'));var tag=schema({'tag':{'type':_0x30e6('0x6'),'required':!![],'message':_0x30e6('0x7')}});exports[_0x30e6('0x8')]=function(_0x2656d8,_0x3ed82e,_0xdbf4e6,_0x2cf19b){return function(_0x1d3297){try{var _0x3778c8={'tag':_0x3ed82e[0x0]};var _0x404c43=tag[_0x30e6('0x9')](_0x3778c8,{'typecast':!![]});if(_0x404c43[_0x30e6('0xa')]){logger[_0x30e6('0xb')](_0x30e6('0xc'),_0x2656d8,_[_0x30e6('0xd')](_0x404c43,_0x30e6('0xe'))[_0x30e6('0xf')](',\x20'));logger['info'](_0x30e6('0x10'),_0x2656d8);_0x1d3297[_0x30e6('0x11')]();}else{var _0x1172b7={'ids':[_0x3ed82e[0x0]]};if(rpc[_0x2cf19b[_0x30e6('0x12')]+'Interaction']){rpc[_0x2cf19b['channel']+_0x30e6('0x13')][_0x30e6('0x14')](_0x2cf19b[_0x30e6('0x15')]['id'],_0x1172b7)[_0x30e6('0x16')](function(_0x26d30a){logger[_0x30e6('0x17')](_0x30e6('0x18'),_0x2656d8,_0x3ed82e[0x1],_0x2cf19b['channel'],_0x2cf19b[_0x30e6('0x15')]['id']);})['catch'](function(_0x4612fb){logger['error'](_0x30e6('0xc'),_0x2656d8,JSON['stringify'](_0x4612fb));logger[_0x30e6('0x17')](_0x30e6('0x10'),_0x2656d8);})[_0x30e6('0x19')](function(){_0x1d3297['next']();});}}}catch(_0x202fae){logger[_0x30e6('0xb')]('[%s][TAG]\x20%s',_0x2656d8,_[_0x30e6('0x1a')](_0x202fae)?JSON[_0x30e6('0x1b')](_0x202fae):_0x202fae);logger[_0x30e6('0x17')](_0x30e6('0x10'),_0x2656d8);_0x1d3297[_0x30e6('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 0cd22b9..7e1dcf8 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf88=['urlOnRing','jsonrpc','2.0','method','params','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params='];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf88,0x160));var _0x8cf8=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xcf88[_0x47b58b];return _0x46bebe;};'use strict';var rp=require(_0x8cf8('0x0'));var logger=require(_0x8cf8('0x1'))(_0x8cf8('0x2'));var _=require(_0x8cf8('0x3'));var arr=[];exports[_0x8cf8('0x4')]=function(_0x4543a6,_0xf88df1){return function(_0x57e28b){var _0x9e3ade=_0xf88df1[0xa];var _0x142865=_0xf88df1[0xb];var _0x51403a=_0xf88df1[0xc];var _0x90b8a1=_0xf88df1[0xd];var _0xb4be80=_0xf88df1[0xe];var _0x4fc86a=_0xf88df1[0xf][_0x8cf8('0x5')](/\n/g,_0x8cf8('0x6'));var _0x10c8fd=_0xf88df1[0x10][_0x8cf8('0x5')](/\n/g,'\x20');if(!arr[_0x8cf8('0x7')](_0x142865)){arr[_0x8cf8('0x8')](_0x142865);var _0x5b1959=_0xf88df1[0x3];var _0x58697f=_0xf88df1[0x4];var _0x3ba7eb=_0xf88df1[0x1];var _0x1115ff=_0xf88df1[0x0];var _0x390fcf={};_0x390fcf[_0x8cf8('0x9')]=_0xf88df1[0x8]+_0x8cf8('0xa')+_0x51403a+'|'+_0x9e3ade+'|'+_0x90b8a1+'|'+_0x142865+'|'+_0xb4be80;_0x390fcf[_0x8cf8('0xb')]=_0xf88df1[0x7]+_0x8cf8('0xa')+_0x51403a+'|'+_0x9e3ade+'|'+_0x90b8a1+'|'+_0x142865+'|'+_0xb4be80+'|'+_0x4fc86a+'|'+_0x10c8fd;_0x390fcf['title']=_0xf88df1[0x9];var _0x28c3fd={};_0x28c3fd[_0x8cf8('0xc')]=_0x8cf8('0xd');_0x28c3fd[_0x8cf8('0xe')]='login';var _0x3d9506=[];_0x3d9506[_0x8cf8('0x8')](_0xf88df1[0x2]);_0x3d9506['push'](_0xf88df1[0x5]);_0x3d9506[_0x8cf8('0x8')](_0xf88df1[0x6]);_0x28c3fd[_0x8cf8('0xf')]=_0x3d9506;_0x28c3fd['id']=0x1;var _0x590866=JSON[_0x8cf8('0x10')](_0x28c3fd);var _0x5aa15e={'encoding':_0x8cf8('0x11'),'method':_0x8cf8('0x12'),'timeout':0x2710,'url':_0x5b1959,'headers':{'Content-Type':_0x8cf8('0x13')},'body':_0x590866};return rp(_0x5aa15e)[_0x8cf8('0x14')](function(_0x549dd7){const _0x50783a=JSON[_0x8cf8('0x15')](_0x549dd7);if(!_0x50783a[_0x8cf8('0x16')]['logged']){throw new Error(_0x8cf8('0x17'));}var _0x28a9b1=_0x142865;var _0x302002=_0x8cf8('0x18')+_0x3ba7eb+_0x8cf8('0x19')+_0x1115ff+'&sessionId='+_0x28a9b1+_0x8cf8('0x1a')+JSON['stringify'](_0x390fcf);var _0x1cd39d=_0x58697f+'?'+_0x302002;return rp(_0x1cd39d);})[_0x8cf8('0x14')](function(_0x144c73){logger[_0x8cf8('0x1b')](_0x8cf8('0x1c'),_0x4543a6,_0x144c73);_0x57e28b[_0x8cf8('0x1d')]();})['catch'](function(_0x3ac58d){logger['error']('[%s][TVOX]\x20%s',_0x4543a6,_[_0x8cf8('0x1e')](_0x3ac58d)?JSON[_0x8cf8('0x10')](_0x3ac58d):_0x3ac58d);_0x57e28b[_0x8cf8('0x1d')]();});}else{logger[_0x8cf8('0x1b')](_0x8cf8('0x1f'),_0x4543a6);_0x57e28b[_0x8cf8('0x20')]();}};}; \ No newline at end of file +var _0xd731=['next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','push','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next'];(function(_0x2fd04b,_0x5f0d01){var _0xb874aa=function(_0x197e4b){while(--_0x197e4b){_0x2fd04b['push'](_0x2fd04b['shift']());}};_0xb874aa(++_0x5f0d01);}(_0xd731,0x119));var _0x1d73=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd731[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0x1d73('0x0'));var logger=require(_0x1d73('0x1'))(_0x1d73('0x2'));var _=require('lodash');var arr=[];exports[_0x1d73('0x3')]=function(_0x32c287,_0x31004f){return function(_0x29ee8e){var _0x55eda2=_0x31004f[0xa];var _0x39743a=_0x31004f[0xb];var _0xe05f8c=_0x31004f[0xc];var _0x5176ef=_0x31004f[0xd];var _0x314f8c=_0x31004f[0xe];var _0x3bd99a=_0x31004f[0xf][_0x1d73('0x4')](/\n/g,_0x1d73('0x5'));var _0x44121d=_0x31004f[0x10][_0x1d73('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x39743a)){arr[_0x1d73('0x6')](_0x39743a);var _0x4acfe0=_0x31004f[0x3];var _0x1abb39=_0x31004f[0x4];var _0x53f7bc=_0x31004f[0x1];var _0xc1e669=_0x31004f[0x0];var _0x1a18c8={};_0x1a18c8['urlOnAnswer']=_0x31004f[0x8]+_0x1d73('0x7')+_0xe05f8c+'|'+_0x55eda2+'|'+_0x5176ef+'|'+_0x39743a+'|'+_0x314f8c;_0x1a18c8[_0x1d73('0x8')]=_0x31004f[0x7]+'?params='+_0xe05f8c+'|'+_0x55eda2+'|'+_0x5176ef+'|'+_0x39743a+'|'+_0x314f8c+'|'+_0x3bd99a+'|'+_0x44121d;_0x1a18c8[_0x1d73('0x9')]=_0x31004f[0x9];var _0x4da21a={};_0x4da21a[_0x1d73('0xa')]=_0x1d73('0xb');_0x4da21a[_0x1d73('0xc')]=_0x1d73('0xd');var _0x46d0a7=[];_0x46d0a7[_0x1d73('0x6')](_0x31004f[0x2]);_0x46d0a7[_0x1d73('0x6')](_0x31004f[0x5]);_0x46d0a7[_0x1d73('0x6')](_0x31004f[0x6]);_0x4da21a[_0x1d73('0xe')]=_0x46d0a7;_0x4da21a['id']=0x1;var _0x1c9f40=JSON[_0x1d73('0xf')](_0x4da21a);var _0x138b68={'encoding':_0x1d73('0x10'),'method':_0x1d73('0x11'),'timeout':0x2710,'url':_0x4acfe0,'headers':{'Content-Type':_0x1d73('0x12')},'body':_0x1c9f40};return rp(_0x138b68)[_0x1d73('0x13')](function(_0x368dc9){const _0x12bd64=JSON[_0x1d73('0x14')](_0x368dc9);if(!_0x12bd64[_0x1d73('0x15')]['logged']){throw new Error(_0x1d73('0x16'));}var _0xb5bb6f=_0x39743a;var _0x4afad6=_0x1d73('0x17')+_0x53f7bc+_0x1d73('0x18')+_0xc1e669+_0x1d73('0x19')+_0xb5bb6f+_0x1d73('0x1a')+JSON[_0x1d73('0xf')](_0x1a18c8);var _0x167c37=_0x1abb39+'?'+_0x4afad6;return rp(_0x167c37);})[_0x1d73('0x13')](function(_0x1d3154){logger[_0x1d73('0x1b')](_0x1d73('0x1c'),_0x32c287,_0x1d3154);_0x29ee8e[_0x1d73('0x1d')]();})[_0x1d73('0x1e')](function(_0x5bc895){logger[_0x1d73('0x1f')](_0x1d73('0x20'),_0x32c287,_['isObject'](_0x5bc895)?JSON[_0x1d73('0xf')](_0x5bc895):_0x5bc895);_0x29ee8e['stop']();});}else{logger[_0x1d73('0x1b')](_0x1d73('0x21'),_0x32c287);_0x29ee8e[_0x1d73('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index f426e88..ad5817a 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x263ee9,_0x2832d6){var _0x48b1b0=function(_0x17ed75){while(--_0x17ed75){_0x263ee9['push'](_0x263ee9['shift']());}};_0x48b1b0(++_0x2832d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5a20b9,_0x4fe20b){var _0x2aed1a=function(_0x5ad501){while(--_0x5ad501){_0x5a20b9['push'](_0x5a20b9['shift']());}};_0x2aed1a(++_0x4fe20b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 378c7a0..6141212 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b8a=['QueueReport','update','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','length','join','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','ContactId','body','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit'];(function(_0x36c21d,_0x4be87f){var _0x25d652=function(_0x3bfed5){while(--_0x3bfed5){_0x36c21d['push'](_0x36c21d['shift']());}};_0x25d652(++_0x4be87f);}(_0x3b8a,0x1ac));var _0xa3b8=function(_0x33a960,_0x4dc36e){_0x33a960=_0x33a960-0x0;var _0x293029=_0x3b8a[_0x33a960];return _0x293029;};'use strict';var _=require(_0xa3b8('0x0'));var util=require(_0xa3b8('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xa3b8('0x2'));var BPromise=require(_0xa3b8('0x3'));var utils=require(_0xa3b8('0x4'));var sUtils=require(_0xa3b8('0x5'));var logger=require(_0xa3b8('0x6'))(_0xa3b8('0x7'));var rpc={'openchannelQueueReport':require(_0xa3b8('0x8')),'mailQueueReport':require(_0xa3b8('0x9')),'chatQueueReport':require(_0xa3b8('0xa')),'smsQueueReport':require(_0xa3b8('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa3b8('0xc'))};var RuleEngine=require(_0xa3b8('0xd'));function getId(_0x126b9a,_0x30c365,_0x33c59e){return util[_0xa3b8('0xe')](_0xa3b8('0xf'),_0x126b9a,_0x30c365||0x0,_0x33c59e||0x0);}function getIntervals(_0x5489de,_0x163047){var _0x19a2fa=[];if(!_[_0xa3b8('0x10')](_0x163047[_0xa3b8('0x11')])&&!_['isNil'](_0x5489de[_0x163047[_0xa3b8('0x11')]])&&!_[_0xa3b8('0x10')](_0x5489de[_0x163047[_0xa3b8('0x11')]][_0xa3b8('0x12')])){_0x19a2fa=_[_0xa3b8('0x13')](_0x5489de[_0x163047[_0xa3b8('0x11')]][_0xa3b8('0x12')],_0xa3b8('0x14'));}else if(!_[_0xa3b8('0x10')](_0x163047[_0xa3b8('0x14')])){_0x19a2fa=[_0x163047['interval']];}return _0x19a2fa;}exports[_0xa3b8('0x15')]=function(_0x168841){_0x168841[_0xa3b8('0x16')]={};return new BPromise(function(_0x3da337,_0x135f51){var _0x5b6a68={'Start':function(_0x40c817){var _0x150f7a=this;return new Promise(function(_0x1c7708,_0x17daca){if(_0x40c817){try{var _0x43e949=[];var _0x2439e9=getId(_0x40c817[_0xa3b8('0x17')],_0x40c817[_0xa3b8('0x18')]?_0x40c817[_0xa3b8('0x18')]['id']:0x0,_0x40c817[_0xa3b8('0x19')]?_0x40c817[_0xa3b8('0x19')]['id']:0x0);var _0x271c98=sUtils['checkWaitingNotifications'](_0x168841,_0x40c817);if(!_0x271c98&&_0x40c817[_0xa3b8('0x1a')]&&_[_0xa3b8('0x1b')](_0x40c817[_0xa3b8('0x1a')])&&_0x40c817[_0xa3b8('0x1a')]['length']){for(var _0x579e23=0x0;_0x579e23<_0x40c817['applications']['length'];_0x579e23+=0x1){var _0x45357c=_0x40c817['applications'][_0x579e23];if(fs['existsSync'](path['join'](__dirname,_0xa3b8('0x1a'),_0x45357c[_0xa3b8('0x1c')]+_0xa3b8('0x1d')))){var _0x4951fd=[];switch(_0x45357c[_0xa3b8('0x1c')][_0xa3b8('0x1e')]()){case _0xa3b8('0x1f'):var _0x2719ef=_0x45357c[_0xa3b8('0x20')][_0xa3b8('0x21')](',');if(_0x40c817[_0xa3b8('0x17')]===_0xa3b8('0x22')){_0x4951fd[_0xa3b8('0x23')](_0x2719ef[0x0]);_0x4951fd[_0xa3b8('0x23')](_0x2719ef[0x1]);_0x4951fd[_0xa3b8('0x23')](_0x2719ef[_0xa3b8('0x24')](0x2,_0x2719ef[_0xa3b8('0x25')])[_0xa3b8('0x26')](','));}else{_0x4951fd[_0xa3b8('0x23')](_0x2719ef[0x0]);_0x4951fd['push'](_0x2719ef[_0xa3b8('0x24')](0x1,_0x2719ef[_0xa3b8('0x25')])['join'](','));}break;case'dialogflow':var _0x3dc03a=_0x45357c[_0xa3b8('0x20')][_0xa3b8('0x21')](',');_0x4951fd[_0xa3b8('0x23')](_0x3dc03a[0x0]);_0x4951fd[_0xa3b8('0x23')](_0x3dc03a[0x1]);_0x4951fd[_0xa3b8('0x23')](_0x3dc03a[_0xa3b8('0x24')](0x2,_0x3dc03a['length'])[_0xa3b8('0x26')](','));break;case _0xa3b8('0x27'):var _0x59f964=_0x45357c[_0xa3b8('0x20')][_0xa3b8('0x21')](',');_0x4951fd[_0xa3b8('0x23')](_0x59f964[0x0]);_0x4951fd['push'](_0x59f964[0x1]);_0x4951fd['push'](_0x59f964[0x2]);_0x4951fd[_0xa3b8('0x23')](_0x59f964[0x3]);_0x4951fd[_0xa3b8('0x23')](_0x59f964[_0xa3b8('0x24')](0x4,_0x59f964['length'])[_0xa3b8('0x26')](','));break;case'amazonlex':var _0x15d989=_0x45357c[_0xa3b8('0x20')][_0xa3b8('0x21')](',');_0x4951fd[_0xa3b8('0x23')](_0x15d989[0x0]);_0x4951fd[_0xa3b8('0x23')](_0x15d989[0x1]);_0x4951fd[_0xa3b8('0x23')](_0x15d989[0x2]);_0x4951fd[_0xa3b8('0x23')](_0x15d989[0x3]);_0x4951fd['push'](_0x15d989[_0xa3b8('0x24')](0x4,_0x15d989[_0xa3b8('0x25')])[_0xa3b8('0x26')](','));break;case'message':_0x4951fd[_0xa3b8('0x23')](_0x45357c[_0xa3b8('0x20')]);break;case _0xa3b8('0x28'):_0x4951fd[_0xa3b8('0x23')](_0x45357c[_0xa3b8('0x29')]);_0x4951fd[_0xa3b8('0x23')](_0x45357c[_0xa3b8('0x20')]);break;case _0xa3b8('0x2a'):var _0x2885ac=utils[_0xa3b8('0x2b')](_0x40c817[_0xa3b8('0x2c')]['notificationTemplate'],_0x40c817);var _0xb854f9=_0x45357c[_0xa3b8('0x20')][_0xa3b8('0x21')](',');_0x4951fd['push'](_0xb854f9[0x0]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0x1]);_0x4951fd['push'](_0xb854f9[0x2]);_0x4951fd['push'](_0xb854f9[0x3]);_0x4951fd['push'](_0xb854f9[0x4]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0x5]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0x6]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0x7]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0x8]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0x9]);_0x4951fd[_0xa3b8('0x23')](_0xb854f9[0xa]);_0x4951fd['push'](_0x40c817[_0xa3b8('0x19')]['id']);_0x4951fd[_0xa3b8('0x23')](_0x40c817[_0xa3b8('0x18')]['id']);_0x4951fd[_0xa3b8('0x23')](_0x45357c['ChatWebsiteId']);_0x4951fd[_0xa3b8('0x23')](_0x40c817[_0xa3b8('0x19')][_0xa3b8('0x2d')]);_0x4951fd[_0xa3b8('0x23')](_0x40c817[_0xa3b8('0x2e')][_0xa3b8('0x2e')]);_0x4951fd[_0xa3b8('0x23')](_0x2885ac);break;default:_0x4951fd=_[_0xa3b8('0x10')](_0x45357c[_0xa3b8('0x20')])?[]:_0x45357c[_0xa3b8('0x20')][_0xa3b8('0x21')](',');}var _0x3918ce={'id':util[_0xa3b8('0xe')]('%s:%s:%s',_0x2439e9,_0x45357c['id'],_0x45357c['app']),'condition':require('./interval')['condition'](_0x2439e9,getIntervals(_0x168841[_0xa3b8('0x2f')],_0x45357c),_0x168841),'consequence':require('./applications/'+_0x45357c[_0xa3b8('0x1c')])[_0xa3b8('0x30')](_0x2439e9,_0x4951fd,_0x168841,_0x40c817),'p':_0x45357c[_0xa3b8('0x31')]||0x0};logger[_0xa3b8('0x32')](_0xa3b8('0x33'),_0x3918ce['id'],_0xa3b8('0x34'),getIntervals(_0x168841[_0xa3b8('0x2f')],_0x45357c)[_0xa3b8('0x26')](_0xa3b8('0x35')));_0x43e949[_0xa3b8('0x23')](_0x3918ce);}else{logger[_0xa3b8('0x36')](_0xa3b8('0x37'),path[_0xa3b8('0x26')](__dirname,_0xa3b8('0x1a'),_0x45357c[_0xa3b8('0x1c')]+'.js'));}}_0x168841[_0xa3b8('0x16')][_0x2439e9]=new RuleEngine(_0x43e949);_0x168841['rules'][_0x2439e9][_0xa3b8('0x38')](_0x40c817,function(_0x1d494d){logger[_0xa3b8('0x32')](_0xa3b8('0x39'),JSON[_0xa3b8('0x3a')](_0x1d494d[_0xa3b8('0x3b')]));if(_0x168841[_0xa3b8('0x16')][_0x2439e9]){_0x168841[_0xa3b8('0x16')][_0x2439e9]['emit']('complete');}});return _0x1c7708({'code':0xc8,'message':_0x40c817});}else{if(_0x271c98){logger['info'](util['format']('Skipped\x20routing\x20for\x20%s',_0x2439e9));}else{logger['info'](_0xa3b8('0x3c'));}return _0x1c7708({'code':0xc8,'message':_0x40c817});}}catch(_0x2e3f00){logger[_0xa3b8('0x36')](_0x2e3f00['stack']);return _0x17daca(_0x150f7a[_0xa3b8('0x36')](0x1f4,_0x2e3f00));}}return _0x17daca(_0xa3b8('0x3d'));});},'AcceptMessage':function(_0x17eb5e){var _0x460c5c=this;return new Promise(function(_0x1c019a,_0x6386c8){if(_0x17eb5e[_0xa3b8('0x3e')]&&_0x17eb5e[_0xa3b8('0x3e')]['id']){if(_0x168841[_0xa3b8('0x3f')][_0x17eb5e['agent']['id']]){_0x168841[_0xa3b8('0x3f')][_0x17eb5e[_0xa3b8('0x3e')]['id']][_0xa3b8('0x40')]=![];_0x168841[_0xa3b8('0x3f')][_0x17eb5e['agent']['id']][_0xa3b8('0x41')]=undefined;}}if(_0x17eb5e[_0xa3b8('0x18')]&&_0x17eb5e[_0xa3b8('0x18')]['id']){try{var _0x32e91e=getId(_0x17eb5e[_0xa3b8('0x17')],_0x17eb5e[_0xa3b8('0x18')]?_0x17eb5e[_0xa3b8('0x18')]['id']:0x0,_0x17eb5e[_0xa3b8('0x19')]?_0x17eb5e[_0xa3b8('0x19')]['id']:0x0);if(_0x168841[_0xa3b8('0x16')][_0x32e91e]){_0x168841[_0xa3b8('0x16')][_0x32e91e][_0xa3b8('0x42')]('end');if(rpc[_0x17eb5e['channel']+_0xa3b8('0x43')]){rpc[_0x17eb5e[_0xa3b8('0x17')]+_0xa3b8('0x43')][_0xa3b8('0x44')](_0x32e91e,{'UserId':_0x17eb5e[_0xa3b8('0x18')][_0xa3b8('0x45')]})['catch'](function(){logger[_0xa3b8('0x36')](_0xa3b8('0x46'));});}}return _0x1c019a({'code':0xc8,'message':_0x17eb5e});}catch(_0x514c55){logger['error'](_0x514c55[_0xa3b8('0x47')]);return _0x6386c8(_0x460c5c[_0xa3b8('0x36')](0x1f4,_0x514c55));}}logger[_0xa3b8('0x36')](_0xa3b8('0x48'));return _0x6386c8(_0x460c5c['error'](0x1f4,_0xa3b8('0x48')));});},'RejectMessage':function(_0x1173f1){var _0x311ef4=this;return new Promise(function(_0x2fa156,_0x5009a8){if(_0x1173f1[_0xa3b8('0x3e')]&&_0x1173f1[_0xa3b8('0x3e')]['id']){try{if(_0x168841[_0xa3b8('0x3f')][_0x1173f1[_0xa3b8('0x3e')]['id']]){_0x168841[_0xa3b8('0x3f')][_0x1173f1[_0xa3b8('0x3e')]['id']]['busy']=![];_0x168841[_0xa3b8('0x3f')][_0x1173f1[_0xa3b8('0x3e')]['id']][_0xa3b8('0x41')]=undefined;}return _0x2fa156({'code':0xc8,'message':_0x1173f1});}catch(_0xf31644){logger[_0xa3b8('0x36')](_0xf31644[_0xa3b8('0x47')]);return _0x5009a8(_0x311ef4[_0xa3b8('0x36')](0x1f4,_0xf31644));}}logger['error']('message\x20is\x20empty');return _0x5009a8(_0x311ef4['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2776f3){var _0x58c2c1=this;return new Promise(function(_0x16ccc4,_0x24f25f){if(_0x2776f3[_0xa3b8('0x17')]&&_0x2776f3[_0xa3b8('0x19')]&&_0x2776f3[_0xa3b8('0x19')]['id']){try{var _0x19a2b9=getId(_0x2776f3[_0xa3b8('0x17')],_0x2776f3[_0xa3b8('0x18')]?_0x2776f3[_0xa3b8('0x18')]['id']:0x0,_0x2776f3['interaction']?_0x2776f3[_0xa3b8('0x19')]['id']:0x0);if(_0x168841[_0xa3b8('0x16')][_0x19a2b9]){_0x168841['rules'][_0x19a2b9]['emit']('end');}return _0x16ccc4({'code':0xc8,'message':_0x2776f3});}catch(_0x4e8bae){logger['error'](_0x4e8bae[_0xa3b8('0x47')]);return _0x24f25f(_0x58c2c1[_0xa3b8('0x36')](0x1f4,_0x4e8bae));}}logger[_0xa3b8('0x36')](_0xa3b8('0x48'));return _0x24f25f(_0x58c2c1[_0xa3b8('0x36')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3188cb){var _0x51a8cb=this;return new Promise(function(_0x4a7cb1,_0x11cb84){if(_0x168841['agents'][_0xa3b8('0x49')](_0x3188cb['id'])){for(var _0x270a24 in _0x3188cb[_0xa3b8('0x4a')]){if(_0x3188cb['capacity']['hasOwnProperty'](_0x270a24)){if(_0x168841[_0xa3b8('0x3f')][_0x3188cb['id']][_0xa3b8('0x49')](_0x270a24+_0xa3b8('0x4b'))){_0x168841[_0xa3b8('0x3f')][_0x3188cb['id']][_0x270a24+_0xa3b8('0x4b')]=parseInt(_0x3188cb['capacity'][_0x270a24],0xa);}}}_0x168841[_0xa3b8('0x3f')][_0x3188cb['id']][_0xa3b8('0x4c')]();return _0x4a7cb1({'code':0xc8,'message':_0x168841[_0xa3b8('0x3f')][_0x3188cb['id']]});}else{return _0x11cb84(_0x51a8cb[_0xa3b8('0x36')](0x1f4,_0xa3b8('0x4d')));}});},'Agents':function(_0x5587f2){return new Promise(function(_0x4b38a3){var _0x763f5a=_[_0xa3b8('0x4e')](_0x168841[_0xa3b8('0x3f')]);if(_0x5587f2&&_0x5587f2['id']){var _0x52e803=_['find'](_0x763f5a,function(_0x5eeadb){return _0x5eeadb['id']===_0x5587f2['id'];});_0x4b38a3(_0x52e803);}else{_0x4b38a3({'count':_0x763f5a['length'],'rows':_0x763f5a});}});},'ChatQueues':function(){return new Promise(function(_0x35e058){var _0x3cf8eb=[];for(var _0x1be104 in _0x168841[_0xa3b8('0x4f')]){if(_0x168841[_0xa3b8('0x4f')]['hasOwnProperty'](_0x1be104)){var _0x17621f=_0x168841['chatQueues'][_0x1be104];var _0x2ca40b={'id':_0x17621f['id'],'available':_0x17621f[_0xa3b8('0x50')],'loggedIn':_0x17621f[_0xa3b8('0x51')],'name':_0x17621f[_0xa3b8('0x52')],'paused':_0x17621f[_0xa3b8('0x53')],'waiting':_0x17621f['waiting']};_0x3cf8eb[_0xa3b8('0x23')](_0x2ca40b);}}_0x35e058({'count':_0x3cf8eb[_0xa3b8('0x25')],'rows':_0x3cf8eb});});},'MailQueues':function(){return new Promise(function(_0x1c0b66){var _0xd1d35b=[];for(var _0x105950 in _0x168841['mailQueues']){if(_0x168841[_0xa3b8('0x54')][_0xa3b8('0x49')](_0x105950)){var _0x17624c=_0x168841[_0xa3b8('0x54')][_0x105950];var _0x5a00ce={'id':_0x17624c['id'],'available':_0x17624c['available'],'loggedIn':_0x17624c[_0xa3b8('0x51')],'name':_0x17624c[_0xa3b8('0x52')],'paused':_0x17624c[_0xa3b8('0x53')],'waiting':_0x17624c[_0xa3b8('0x55')]};_0xd1d35b['push'](_0x5a00ce);}}_0x1c0b66({'count':_0xd1d35b['length'],'rows':_0xd1d35b});});},'OpenchannelQueues':function(){return new Promise(function(_0x9ad0e4){var _0x2201aa=[];for(var _0x434e28 in _0x168841[_0xa3b8('0x56')]){if(_0x168841[_0xa3b8('0x56')][_0xa3b8('0x49')](_0x434e28)){var _0x46c199=_0x168841[_0xa3b8('0x56')][_0x434e28];var _0x45e24b={'id':_0x46c199['id'],'available':_0x46c199[_0xa3b8('0x50')],'loggedIn':_0x46c199[_0xa3b8('0x51')],'name':_0x46c199[_0xa3b8('0x52')],'paused':_0x46c199[_0xa3b8('0x53')],'waiting':_0x46c199[_0xa3b8('0x55')]};_0x2201aa[_0xa3b8('0x23')](_0x45e24b);}}_0x9ad0e4({'count':_0x2201aa[_0xa3b8('0x25')],'rows':_0x2201aa});});},'SmsQueues':function(){return new Promise(function(_0x27835f){var _0x53279a=[];for(var _0x158dc8 in _0x168841[_0xa3b8('0x57')]){if(_0x168841[_0xa3b8('0x57')][_0xa3b8('0x49')](_0x158dc8)){var _0x459c44=_0x168841[_0xa3b8('0x57')][_0x158dc8];var _0x2e9069={'id':_0x459c44['id'],'available':_0x459c44[_0xa3b8('0x50')],'loggedIn':_0x459c44['loggedIn'],'name':_0x459c44[_0xa3b8('0x52')],'paused':_0x459c44[_0xa3b8('0x53')],'waiting':_0x459c44[_0xa3b8('0x55')]};_0x53279a[_0xa3b8('0x23')](_0x2e9069);}}_0x27835f({'count':_0x53279a[_0xa3b8('0x25')],'rows':_0x53279a});});},'FaxQueues':function(){return new Promise(function(_0x288cb9){var _0x3dd5d8=[];for(var _0x2e946c in _0x168841[_0xa3b8('0x58')]){if(_0x168841[_0xa3b8('0x58')][_0xa3b8('0x49')](_0x2e946c)){var _0x5d542e=_0x168841[_0xa3b8('0x58')][_0x2e946c];var _0x42045b={'id':_0x5d542e['id'],'available':_0x5d542e[_0xa3b8('0x50')],'loggedIn':_0x5d542e[_0xa3b8('0x51')],'name':_0x5d542e[_0xa3b8('0x52')],'paused':_0x5d542e[_0xa3b8('0x53')],'waiting':_0x5d542e[_0xa3b8('0x55')]};_0x3dd5d8[_0xa3b8('0x23')](_0x42045b);}}_0x288cb9({'count':_0x3dd5d8[_0xa3b8('0x25')],'rows':_0x3dd5d8});});},'WhatsappQueues':function(){return new Promise(function(_0x4fe46f){var _0x42b262=[];for(var _0x458b31 in _0x168841[_0xa3b8('0x59')]){if(_0x168841['whatsappQueues']['hasOwnProperty'](_0x458b31)){var _0x59fe95=_0x168841[_0xa3b8('0x59')][_0x458b31];var _0xb9351f={'id':_0x59fe95['id'],'available':_0x59fe95[_0xa3b8('0x50')],'loggedIn':_0x59fe95['loggedIn'],'name':_0x59fe95['name'],'paused':_0x59fe95[_0xa3b8('0x53')],'waiting':_0x59fe95[_0xa3b8('0x55')]};_0x42b262[_0xa3b8('0x23')](_0xb9351f);}}_0x4fe46f({'count':_0x42b262[_0xa3b8('0x25')],'rows':_0x42b262});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4384a2){var _0x4a72ad=_[_0xa3b8('0x4e')](_0x168841[_0xa3b8('0x5a')]);_0x4384a2({'count':_0x4a72ad[_0xa3b8('0x25')],'rows':_0x4a72ad});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x41fc78){var _0x21a5b6=_[_0xa3b8('0x4e')](_0x168841[_0xa3b8('0x5b')]);_0x41fc78({'count':_0x21a5b6[_0xa3b8('0x25')],'rows':_0x21a5b6});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2e99c3){var _0x38e22d=_['values'](_0x168841[_0xa3b8('0x5c')]);_0x2e99c3({'count':_0x38e22d[_0xa3b8('0x25')],'rows':_0x38e22d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xd20797){var _0xf0fd1f=_[_0xa3b8('0x4e')](_0x168841['smsQueuesWaitingInteractions']);_0xd20797({'count':_0xf0fd1f[_0xa3b8('0x25')],'rows':_0xf0fd1f});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2c344b){var _0x31f348=_['values'](_0x168841[_0xa3b8('0x5d')]);_0x2c344b({'count':_0x31f348[_0xa3b8('0x25')],'rows':_0x31f348});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xf66d46){var _0x2206e8=_[_0xa3b8('0x4e')](_0x168841[_0xa3b8('0x5e')]);_0xf66d46({'count':_0x2206e8['length'],'rows':_0x2206e8});});}};var _0x3b45fb=jayson['server'](_0x5b6a68)[_0xa3b8('0x5f')]();_0x3b45fb['on'](_0xa3b8('0x36'),function(_0x2a9ca2){logger[_0xa3b8('0x36')](JSON[_0xa3b8('0x3a')](_0x2a9ca2));return _0x135f51(_0x2a9ca2);});_0x3b45fb[_0xa3b8('0x15')](0x232c,_0xa3b8('0x60'),function(){console[_0xa3b8('0x61')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x3da337(_0xa3b8('0x62')+0x232c);});});}; \ No newline at end of file +var _0xaa96=['matchPath','emit','complete','stack','routing\x20is\x20empty','agents','agent','busyQueue','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account','ChatWebsiteId','ContactId','body','./interval','intervals','consequence','Push\x20new\x20rule','\x20|\x20','error','stringify'];(function(_0x4f33a6,_0x1276be){var _0x38ce14=function(_0x562606){while(--_0x562606){_0x4f33a6['push'](_0x4f33a6['shift']());}};_0x38ce14(++_0x1276be);}(_0xaa96,0x143));var _0x6aa9=function(_0x3af319,_0x16ab42){_0x3af319=_0x3af319-0x0;var _0x11f801=_0xaa96[_0x3af319];return _0x11f801;};'use strict';var _=require(_0x6aa9('0x0'));var util=require(_0x6aa9('0x1'));var path=require(_0x6aa9('0x2'));var fs=require('fs');var jayson=require(_0x6aa9('0x3'));var BPromise=require(_0x6aa9('0x4'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require(_0x6aa9('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x6aa9('0x6')),'mailQueueReport':require(_0x6aa9('0x7')),'chatQueueReport':require(_0x6aa9('0x8')),'smsQueueReport':require(_0x6aa9('0x9')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x6aa9('0xa'))};var RuleEngine=require(_0x6aa9('0xb'));function getId(_0xa10fd5,_0x12862f,_0x89a823){return util[_0x6aa9('0xc')](_0x6aa9('0xd'),_0xa10fd5,_0x12862f||0x0,_0x89a823||0x0);}function getIntervals(_0x4393bd,_0x38d195){var _0x18989c=[];if(!_[_0x6aa9('0xe')](_0x38d195[_0x6aa9('0xf')])&&!_[_0x6aa9('0xe')](_0x4393bd[_0x38d195[_0x6aa9('0xf')]])&&!_['isNil'](_0x4393bd[_0x38d195['IntervalId']][_0x6aa9('0x10')])){_0x18989c=_[_0x6aa9('0x11')](_0x4393bd[_0x38d195['IntervalId']][_0x6aa9('0x10')],_0x6aa9('0x12'));}else if(!_['isNil'](_0x38d195['interval'])){_0x18989c=[_0x38d195[_0x6aa9('0x12')]];}return _0x18989c;}exports['listen']=function(_0x3d992d){_0x3d992d[_0x6aa9('0x13')]={};return new BPromise(function(_0x2add71,_0x5bc2d3){var _0x27523e={'Start':function(_0x87d6b){var _0x258922=this;return new Promise(function(_0x266d49,_0x4e8cf8){if(_0x87d6b){try{var _0x32ca2d=[];var _0xd35b65=getId(_0x87d6b[_0x6aa9('0x14')],_0x87d6b[_0x6aa9('0x15')]?_0x87d6b[_0x6aa9('0x15')]['id']:0x0,_0x87d6b['interaction']?_0x87d6b[_0x6aa9('0x16')]['id']:0x0);var _0x89e8a2=sUtils[_0x6aa9('0x17')](_0x3d992d,_0x87d6b);if(!_0x89e8a2&&_0x87d6b['applications']&&_[_0x6aa9('0x18')](_0x87d6b[_0x6aa9('0x19')])&&_0x87d6b[_0x6aa9('0x19')][_0x6aa9('0x1a')]){for(var _0x45ac88=0x0;_0x45ac88<_0x87d6b[_0x6aa9('0x19')][_0x6aa9('0x1a')];_0x45ac88+=0x1){var _0x3ea692=_0x87d6b[_0x6aa9('0x19')][_0x45ac88];if(fs[_0x6aa9('0x1b')](path[_0x6aa9('0x1c')](__dirname,_0x6aa9('0x19'),_0x3ea692[_0x6aa9('0x1d')]+_0x6aa9('0x1e')))){var _0x37bf43=[];switch(_0x3ea692[_0x6aa9('0x1d')][_0x6aa9('0x1f')]()){case'autoreply':var _0x28f242=_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');if(_0x87d6b['channel']===_0x6aa9('0x22')){_0x37bf43[_0x6aa9('0x23')](_0x28f242[0x0]);_0x37bf43['push'](_0x28f242[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x28f242[_0x6aa9('0x24')](0x2,_0x28f242[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));}else{_0x37bf43[_0x6aa9('0x23')](_0x28f242[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x28f242['slice'](0x1,_0x28f242[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));}break;case'dialogflow':var _0x407a81=_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');_0x37bf43[_0x6aa9('0x23')](_0x407a81[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x407a81[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x407a81[_0x6aa9('0x24')](0x2,_0x407a81[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));break;case _0x6aa9('0x25'):var _0x103603=_0x3ea692['appdata'][_0x6aa9('0x21')](',');_0x37bf43['push'](_0x103603[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x103603[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x103603[0x2]);_0x37bf43[_0x6aa9('0x23')](_0x103603[0x3]);_0x37bf43[_0x6aa9('0x23')](_0x103603['slice'](0x4,_0x103603[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));break;case _0x6aa9('0x26'):var _0x472074=_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');_0x37bf43[_0x6aa9('0x23')](_0x472074[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x472074[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x472074[0x2]);_0x37bf43[_0x6aa9('0x23')](_0x472074[0x3]);_0x37bf43[_0x6aa9('0x23')](_0x472074[_0x6aa9('0x24')](0x4,_0x472074[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));break;case'message':_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x20')]);break;case _0x6aa9('0x27'):_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x28')]);_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x20')]);break;case _0x6aa9('0x29'):var _0x145424=utils['getMustacheRender'](_0x87d6b[_0x6aa9('0x2a')]['notificationTemplate'],_0x87d6b);var _0x512828=_0x3ea692[_0x6aa9('0x20')]['split'](',');_0x37bf43[_0x6aa9('0x23')](_0x512828[0x0]);_0x37bf43['push'](_0x512828[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x2]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x3]);_0x37bf43['push'](_0x512828[0x4]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x5]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x6]);_0x37bf43['push'](_0x512828[0x7]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x8]);_0x37bf43['push'](_0x512828[0x9]);_0x37bf43['push'](_0x512828[0xa]);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x16')]['id']);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x15')]['id']);_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x2b')]);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x16')][_0x6aa9('0x2c')]);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x2d')][_0x6aa9('0x2d')]);_0x37bf43[_0x6aa9('0x23')](_0x145424);break;default:_0x37bf43=_[_0x6aa9('0xe')](_0x3ea692[_0x6aa9('0x20')])?[]:_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');}var _0x48b8e0={'id':util['format']('%s:%s:%s',_0xd35b65,_0x3ea692['id'],_0x3ea692[_0x6aa9('0x1d')]),'condition':require(_0x6aa9('0x2e'))['condition'](_0xd35b65,getIntervals(_0x3d992d[_0x6aa9('0x2f')],_0x3ea692),_0x3d992d),'consequence':require('./applications/'+_0x3ea692[_0x6aa9('0x1d')])[_0x6aa9('0x30')](_0xd35b65,_0x37bf43,_0x3d992d,_0x87d6b),'p':_0x3ea692['priority']||0x0};logger['info'](_0x6aa9('0x31'),_0x48b8e0['id'],'on\x20interval',getIntervals(_0x3d992d[_0x6aa9('0x2f')],_0x3ea692)[_0x6aa9('0x1c')](_0x6aa9('0x32')));_0x32ca2d['push'](_0x48b8e0);}else{logger[_0x6aa9('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x6aa9('0x1c')](__dirname,_0x6aa9('0x19'),_0x3ea692['app']+_0x6aa9('0x1e')));}}_0x3d992d['rules'][_0xd35b65]=new RuleEngine(_0x32ca2d);_0x3d992d[_0x6aa9('0x13')][_0xd35b65]['execute'](_0x87d6b,function(_0x5ea020){logger['info']('Applications\x20executed',JSON[_0x6aa9('0x34')](_0x5ea020[_0x6aa9('0x35')]));if(_0x3d992d['rules'][_0xd35b65]){_0x3d992d['rules'][_0xd35b65][_0x6aa9('0x36')](_0x6aa9('0x37'));}});return _0x266d49({'code':0xc8,'message':_0x87d6b});}else{if(_0x89e8a2){logger['info'](util[_0x6aa9('0xc')]('Skipped\x20routing\x20for\x20%s',_0xd35b65));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x266d49({'code':0xc8,'message':_0x87d6b});}}catch(_0x847e9f){logger[_0x6aa9('0x33')](_0x847e9f[_0x6aa9('0x38')]);return _0x4e8cf8(_0x258922[_0x6aa9('0x33')](0x1f4,_0x847e9f));}}return _0x4e8cf8(_0x6aa9('0x39'));});},'AcceptMessage':function(_0x188739){var _0x169c46=this;return new Promise(function(_0xda892,_0x4a9212){if(_0x188739['agent']&&_0x188739['agent']['id']){if(_0x3d992d[_0x6aa9('0x3a')][_0x188739[_0x6aa9('0x3b')]['id']]){_0x3d992d[_0x6aa9('0x3a')][_0x188739['agent']['id']]['busy']=![];_0x3d992d[_0x6aa9('0x3a')][_0x188739['agent']['id']][_0x6aa9('0x3c')]=undefined;}}if(_0x188739['message']&&_0x188739[_0x6aa9('0x15')]['id']){try{var _0x26936f=getId(_0x188739[_0x6aa9('0x14')],_0x188739[_0x6aa9('0x15')]?_0x188739[_0x6aa9('0x15')]['id']:0x0,_0x188739[_0x6aa9('0x16')]?_0x188739['interaction']['id']:0x0);if(_0x3d992d[_0x6aa9('0x13')][_0x26936f]){_0x3d992d[_0x6aa9('0x13')][_0x26936f][_0x6aa9('0x36')]('end');if(rpc[_0x188739['channel']+_0x6aa9('0x3d')]){rpc[_0x188739[_0x6aa9('0x14')]+'QueueReport'][_0x6aa9('0x3e')](_0x26936f,{'UserId':_0x188739[_0x6aa9('0x15')]['UserId']})[_0x6aa9('0x3f')](function(){logger['error'](_0x6aa9('0x40'));});}}return _0xda892({'code':0xc8,'message':_0x188739});}catch(_0x1ee150){logger[_0x6aa9('0x33')](_0x1ee150[_0x6aa9('0x38')]);return _0x4a9212(_0x169c46[_0x6aa9('0x33')](0x1f4,_0x1ee150));}}logger[_0x6aa9('0x33')]('message\x20is\x20empty');return _0x4a9212(_0x169c46['error'](0x1f4,_0x6aa9('0x41')));});},'RejectMessage':function(_0x58757d){var _0x1d96f0=this;return new Promise(function(_0x532634,_0x2fb696){if(_0x58757d['agent']&&_0x58757d[_0x6aa9('0x3b')]['id']){try{if(_0x3d992d[_0x6aa9('0x3a')][_0x58757d[_0x6aa9('0x3b')]['id']]){_0x3d992d[_0x6aa9('0x3a')][_0x58757d['agent']['id']][_0x6aa9('0x42')]=![];_0x3d992d['agents'][_0x58757d[_0x6aa9('0x3b')]['id']][_0x6aa9('0x3c')]=undefined;}return _0x532634({'code':0xc8,'message':_0x58757d});}catch(_0x2e689d){logger[_0x6aa9('0x33')](_0x2e689d['stack']);return _0x2fb696(_0x1d96f0[_0x6aa9('0x33')](0x1f4,_0x2e689d));}}logger['error'](_0x6aa9('0x41'));return _0x2fb696(_0x1d96f0[_0x6aa9('0x33')](0x1f4,_0x6aa9('0x41')));});},'AbandonInteraction':function(_0x41caf5){var _0x2660d5=this;return new Promise(function(_0x7bc679,_0x3d9f2f){if(_0x41caf5[_0x6aa9('0x14')]&&_0x41caf5[_0x6aa9('0x16')]&&_0x41caf5[_0x6aa9('0x16')]['id']){try{var _0x42dd16=getId(_0x41caf5[_0x6aa9('0x14')],_0x41caf5[_0x6aa9('0x15')]?_0x41caf5[_0x6aa9('0x15')]['id']:0x0,_0x41caf5[_0x6aa9('0x16')]?_0x41caf5[_0x6aa9('0x16')]['id']:0x0);if(_0x3d992d['rules'][_0x42dd16]){_0x3d992d[_0x6aa9('0x13')][_0x42dd16][_0x6aa9('0x36')](_0x6aa9('0x43'));}return _0x7bc679({'code':0xc8,'message':_0x41caf5});}catch(_0x5a3080){logger['error'](_0x5a3080[_0x6aa9('0x38')]);return _0x3d9f2f(_0x2660d5[_0x6aa9('0x33')](0x1f4,_0x5a3080));}}logger[_0x6aa9('0x33')](_0x6aa9('0x41'));return _0x3d9f2f(_0x2660d5[_0x6aa9('0x33')](0x1f4,_0x6aa9('0x41')));});},'AgentCapacity':function(_0x10c3d4){var _0x16a84a=this;return new Promise(function(_0x3eb592,_0x4ccbf0){if(_0x3d992d[_0x6aa9('0x3a')]['hasOwnProperty'](_0x10c3d4['id'])){for(var _0xba2366 in _0x10c3d4['capacity']){if(_0x10c3d4[_0x6aa9('0x44')][_0x6aa9('0x45')](_0xba2366)){if(_0x3d992d[_0x6aa9('0x3a')][_0x10c3d4['id']][_0x6aa9('0x45')](_0xba2366+'CurrentCapacity')){_0x3d992d['agents'][_0x10c3d4['id']][_0xba2366+_0x6aa9('0x46')]=parseInt(_0x10c3d4['capacity'][_0xba2366],0xa);}}}_0x3d992d[_0x6aa9('0x3a')][_0x10c3d4['id']][_0x6aa9('0x47')]();return _0x3eb592({'code':0xc8,'message':_0x3d992d[_0x6aa9('0x3a')][_0x10c3d4['id']]});}else{return _0x4ccbf0(_0x16a84a['error'](0x1f4,_0x6aa9('0x48')));}});},'Agents':function(_0x36ffab){return new Promise(function(_0x121c65){var _0x22d4c2=_[_0x6aa9('0x49')](_0x3d992d[_0x6aa9('0x3a')]);if(_0x36ffab&&_0x36ffab['id']){var _0x11e092=_[_0x6aa9('0x4a')](_0x22d4c2,function(_0x5173b6){return _0x5173b6['id']===_0x36ffab['id'];});_0x121c65(_0x11e092);}else{_0x121c65({'count':_0x22d4c2[_0x6aa9('0x1a')],'rows':_0x22d4c2});}});},'ChatQueues':function(){return new Promise(function(_0x467606){var _0x58a1dd=[];for(var _0x5d484d in _0x3d992d[_0x6aa9('0x4b')]){if(_0x3d992d['chatQueues']['hasOwnProperty'](_0x5d484d)){var _0x114431=_0x3d992d[_0x6aa9('0x4b')][_0x5d484d];var _0xe6ceca={'id':_0x114431['id'],'available':_0x114431[_0x6aa9('0x4c')],'loggedIn':_0x114431[_0x6aa9('0x4d')],'name':_0x114431['name'],'paused':_0x114431[_0x6aa9('0x4e')],'waiting':_0x114431[_0x6aa9('0x4f')]};_0x58a1dd[_0x6aa9('0x23')](_0xe6ceca);}}_0x467606({'count':_0x58a1dd[_0x6aa9('0x1a')],'rows':_0x58a1dd});});},'MailQueues':function(){return new Promise(function(_0x4cff6d){var _0x5e48c5=[];for(var _0x141292 in _0x3d992d['mailQueues']){if(_0x3d992d[_0x6aa9('0x50')]['hasOwnProperty'](_0x141292)){var _0x10402c=_0x3d992d['mailQueues'][_0x141292];var _0x2505cf={'id':_0x10402c['id'],'available':_0x10402c[_0x6aa9('0x4c')],'loggedIn':_0x10402c[_0x6aa9('0x4d')],'name':_0x10402c[_0x6aa9('0x51')],'paused':_0x10402c[_0x6aa9('0x4e')],'waiting':_0x10402c['waiting']};_0x5e48c5[_0x6aa9('0x23')](_0x2505cf);}}_0x4cff6d({'count':_0x5e48c5[_0x6aa9('0x1a')],'rows':_0x5e48c5});});},'OpenchannelQueues':function(){return new Promise(function(_0x2da6ce){var _0x14056b=[];for(var _0x271df7 in _0x3d992d[_0x6aa9('0x52')]){if(_0x3d992d[_0x6aa9('0x52')][_0x6aa9('0x45')](_0x271df7)){var _0x4fc0ae=_0x3d992d[_0x6aa9('0x52')][_0x271df7];var _0x5ba94e={'id':_0x4fc0ae['id'],'available':_0x4fc0ae[_0x6aa9('0x4c')],'loggedIn':_0x4fc0ae[_0x6aa9('0x4d')],'name':_0x4fc0ae['name'],'paused':_0x4fc0ae[_0x6aa9('0x4e')],'waiting':_0x4fc0ae[_0x6aa9('0x4f')]};_0x14056b[_0x6aa9('0x23')](_0x5ba94e);}}_0x2da6ce({'count':_0x14056b['length'],'rows':_0x14056b});});},'SmsQueues':function(){return new Promise(function(_0x3b7066){var _0xba60b7=[];for(var _0x4165ea in _0x3d992d['smsQueues']){if(_0x3d992d[_0x6aa9('0x53')][_0x6aa9('0x45')](_0x4165ea)){var _0x481897=_0x3d992d['smsQueues'][_0x4165ea];var _0xd57e7c={'id':_0x481897['id'],'available':_0x481897[_0x6aa9('0x4c')],'loggedIn':_0x481897[_0x6aa9('0x4d')],'name':_0x481897[_0x6aa9('0x51')],'paused':_0x481897[_0x6aa9('0x4e')],'waiting':_0x481897[_0x6aa9('0x4f')]};_0xba60b7[_0x6aa9('0x23')](_0xd57e7c);}}_0x3b7066({'count':_0xba60b7['length'],'rows':_0xba60b7});});},'FaxQueues':function(){return new Promise(function(_0x26fddc){var _0x9ec8c1=[];for(var _0x1227a1 in _0x3d992d[_0x6aa9('0x54')]){if(_0x3d992d[_0x6aa9('0x54')][_0x6aa9('0x45')](_0x1227a1)){var _0x300c2e=_0x3d992d[_0x6aa9('0x54')][_0x1227a1];var _0x10a30a={'id':_0x300c2e['id'],'available':_0x300c2e[_0x6aa9('0x4c')],'loggedIn':_0x300c2e[_0x6aa9('0x4d')],'name':_0x300c2e[_0x6aa9('0x51')],'paused':_0x300c2e[_0x6aa9('0x4e')],'waiting':_0x300c2e[_0x6aa9('0x4f')]};_0x9ec8c1[_0x6aa9('0x23')](_0x10a30a);}}_0x26fddc({'count':_0x9ec8c1[_0x6aa9('0x1a')],'rows':_0x9ec8c1});});},'WhatsappQueues':function(){return new Promise(function(_0x55c3b7){var _0x645f43=[];for(var _0x396b22 in _0x3d992d[_0x6aa9('0x55')]){if(_0x3d992d[_0x6aa9('0x55')][_0x6aa9('0x45')](_0x396b22)){var _0x44d66d=_0x3d992d['whatsappQueues'][_0x396b22];var _0x1e6bc6={'id':_0x44d66d['id'],'available':_0x44d66d['available'],'loggedIn':_0x44d66d[_0x6aa9('0x4d')],'name':_0x44d66d[_0x6aa9('0x51')],'paused':_0x44d66d[_0x6aa9('0x4e')],'waiting':_0x44d66d[_0x6aa9('0x4f')]};_0x645f43[_0x6aa9('0x23')](_0x1e6bc6);}}_0x55c3b7({'count':_0x645f43[_0x6aa9('0x1a')],'rows':_0x645f43});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x15d0a3){var _0x1188fd=_[_0x6aa9('0x49')](_0x3d992d['chatQueuesWaitingInteractions']);_0x15d0a3({'count':_0x1188fd['length'],'rows':_0x1188fd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4fb538){var _0x4aa11f=_[_0x6aa9('0x49')](_0x3d992d[_0x6aa9('0x56')]);_0x4fb538({'count':_0x4aa11f[_0x6aa9('0x1a')],'rows':_0x4aa11f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x32cc4f){var _0x29b50e=_['values'](_0x3d992d['openchannelQueuesWaitingInteractions']);_0x32cc4f({'count':_0x29b50e['length'],'rows':_0x29b50e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3a9ce7){var _0x1a6cc1=_[_0x6aa9('0x49')](_0x3d992d[_0x6aa9('0x57')]);_0x3a9ce7({'count':_0x1a6cc1['length'],'rows':_0x1a6cc1});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2c4e1c){var _0x32cf4f=_['values'](_0x3d992d['faxQueuesWaitingInteractions']);_0x2c4e1c({'count':_0x32cf4f[_0x6aa9('0x1a')],'rows':_0x32cf4f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x244806){var _0x4339ff=_['values'](_0x3d992d[_0x6aa9('0x58')]);_0x244806({'count':_0x4339ff[_0x6aa9('0x1a')],'rows':_0x4339ff});});}};var _0x1acc98=jayson[_0x6aa9('0x59')](_0x27523e)['http']();_0x1acc98['on'](_0x6aa9('0x33'),function(_0x40ac31){logger['error'](JSON['stringify'](_0x40ac31));return _0x5bc2d3(_0x40ac31);});_0x1acc98[_0x6aa9('0x5a')](0x232c,_0x6aa9('0x5b'),function(){console[_0x6aa9('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2add71(_0x6aa9('0x5d')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 6900c87..1c47de7 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8c4=['stop','length','push','Command','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','request','then','error','result','catch','rules'];(function(_0x41a073,_0x3ea9e2){var _0x4b2c53=function(_0xa609ae){while(--_0xa609ae){_0x41a073['push'](_0x41a073['shift']());}};_0x4b2c53(++_0x3ea9e2);}(_0xf8c4,0x120));var _0x4f8c=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0xf8c4[_0x46f3f8];return _0xbc57cd;};'use strict';var util=require(_0x4f8c('0x0'));var BPromise=require(_0x4f8c('0x1'));var jayson=require(_0x4f8c('0x2'));var _=require(_0x4f8c('0x3'));var logger=require(_0x4f8c('0x4'))(_0x4f8c('0x5'));var client=jayson['client']['http']({'port':0x232a});function request(_0x2b4e87,_0x1fbe3c){return new BPromise(function(_0x116413,_0x389dbf){return client[_0x4f8c('0x6')](_0x2b4e87,_0x1fbe3c)[_0x4f8c('0x7')](function(_0x2688c3){if(_0x2688c3[_0x4f8c('0x8')]){return _0x389dbf(_0x2688c3[_0x4f8c('0x8')]['message']);}else{return _0x116413(_0x2688c3[_0x4f8c('0x9')]);}})[_0x4f8c('0xa')](function(_0x450295){return _0x389dbf(_0x450295);});});}exports['condition']=function(_0xad2544,_0x230972,_0x5c76ab){return function(_0x43c87a){if(_0x5c76ab[_0x4f8c('0xb')]&&!_0x5c76ab[_0x4f8c('0xb')][_0xad2544]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xad2544);return _0x43c87a[_0x4f8c('0xc')]();}var _0x2ff3cb=[];for(var _0x5e61aa=0x0;_0x5e61aa<_0x230972[_0x4f8c('0xd')];_0x5e61aa+=0x1){_0x2ff3cb[_0x4f8c('0xe')](request(_0x4f8c('0xf'),{'command':util['format'](_0x4f8c('0x10'),_0x230972[_0x5e61aa])})[_0x4f8c('0x7')](function(_0x45ba72){return _0x45ba72&&_0x45ba72[_0x4f8c('0x11')]&&_0x45ba72[_0x4f8c('0x11')][_0x4f8c('0x12')](_0x4f8c('0x13'))>=0x0?!![]:![];})[_0x4f8c('0xa')](function(_0x31c321){logger[_0x4f8c('0x8')](_0x4f8c('0x14'),_0xad2544,_0x230972[_0x5e61aa]);}));}BPromise[_0x4f8c('0x15')](_0x2ff3cb)[_0x4f8c('0x7')](function(_0x23a2ef){var _0x536574=_[_0x4f8c('0x16')](_0x23a2ef);logger[_0x4f8c('0x17')](_0x4f8c('0x18'),_0xad2544,_0x230972[_0x4f8c('0x19')](_0x4f8c('0x1a')),_0x536574);_0x43c87a[_0x4f8c('0x1b')](_0x536574);})[_0x4f8c('0xa')](function(_0x22508e){console[_0x4f8c('0x1c')](_0x22508e);logger[_0x4f8c('0x8')](_0x4f8c('0x18'),_0xad2544,_0x230972[_0x4f8c('0x19')](_0x4f8c('0x1a')),_0x22508e[_0x4f8c('0x1d')]);_0x43c87a[_0x4f8c('0xc')]();});};}; \ No newline at end of file +var _0xc78b=['stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','stack'];(function(_0x4abafe,_0x43afdf){var _0x674b3a=function(_0xe3c9e1){while(--_0xe3c9e1){_0x4abafe['push'](_0x4abafe['shift']());}};_0x674b3a(++_0x43afdf);}(_0xc78b,0x189));var _0xbc78=function(_0x2ab30a,_0x2d0af0){_0x2ab30a=_0x2ab30a-0x0;var _0x4542d9=_0xc78b[_0x2ab30a];return _0x4542d9;};'use strict';var util=require(_0xbc78('0x0'));var BPromise=require(_0xbc78('0x1'));var jayson=require(_0xbc78('0x2'));var _=require(_0xbc78('0x3'));var logger=require(_0xbc78('0x4'))(_0xbc78('0x5'));var client=jayson['client'][_0xbc78('0x6')]({'port':0x232a});function request(_0x475dc1,_0x573add){return new BPromise(function(_0x422ce3,_0x3ee201){return client[_0xbc78('0x7')](_0x475dc1,_0x573add)[_0xbc78('0x8')](function(_0x13b59e){if(_0x13b59e[_0xbc78('0x9')]){return _0x3ee201(_0x13b59e['error'][_0xbc78('0xa')]);}else{return _0x422ce3(_0x13b59e[_0xbc78('0xb')]);}})[_0xbc78('0xc')](function(_0x5b73a6){return _0x3ee201(_0x5b73a6);});});}exports[_0xbc78('0xd')]=function(_0x4ca1c5,_0x79bd4c,_0x483301){return function(_0x462d3b){if(_0x483301['rules']&&!_0x483301['rules'][_0x4ca1c5]){logger[_0xbc78('0xe')](_0xbc78('0xf'),_0x4ca1c5);return _0x462d3b['stop']();}var _0x1ebc1b=[];for(var _0x337605=0x0;_0x337605<_0x79bd4c['length'];_0x337605+=0x1){_0x1ebc1b[_0xbc78('0x10')](request(_0xbc78('0x11'),{'command':util[_0xbc78('0x12')]('iftime\x20%s',_0x79bd4c[_0x337605])})[_0xbc78('0x8')](function(_0x41f7c5){return _0x41f7c5&&_0x41f7c5[_0xbc78('0xa')]&&_0x41f7c5[_0xbc78('0xa')][_0xbc78('0x13')](_0xbc78('0x14'))>=0x0?!![]:![];})[_0xbc78('0xc')](function(_0x128b20){logger['error'](_0xbc78('0x15'),_0x4ca1c5,_0x79bd4c[_0x337605]);}));}BPromise['all'](_0x1ebc1b)[_0xbc78('0x8')](function(_0x3dad23){var _0x542145=_[_0xbc78('0x16')](_0x3dad23);logger[_0xbc78('0xe')](_0xbc78('0x17'),_0x4ca1c5,_0x79bd4c['join'](_0xbc78('0x18')),_0x542145);_0x462d3b['when'](_0x542145);})[_0xbc78('0xc')](function(_0x55576d){console[_0xbc78('0x19')](_0x55576d);logger[_0xbc78('0x9')](_0xbc78('0x17'),_0x4ca1c5,_0x79bd4c['join'](_0xbc78('0x18')),_0x55576d[_0xbc78('0x1a')]);_0x462d3b[_0xbc78('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b99d052..6016bdf 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%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','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x24c553,_0x49c4a5){var _0x1c7a6c=function(_0x567409){while(--_0x567409){_0x24c553['push'](_0x24c553['shift']());}};_0x1c7a6c(++_0x49c4a5);}(_0xb9a7,0x112));var _0x7b9a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xb9a7[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file +var _0x9348=['clone','calleridname','transfer','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agentcomplete','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','info','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','uniqueid','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfereeuniqueid'];(function(_0xabdb7d,_0x35fedd){var _0x4fc69d=function(_0x4a6e25){while(--_0x4a6e25){_0xabdb7d['push'](_0xabdb7d['shift']());}};_0x4fc69d(++_0x35fedd);}(_0x9348,0x10d));var _0x8934=function(_0x491a80,_0x2df8e5){_0x491a80=_0x491a80-0x0;var _0x1610d4=_0x9348[_0x491a80];return _0x1610d4;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var utils=require(_0x8934('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x135b2c,_0x46a231){utils['info'](util[_0x8934('0x3')](_0x8934('0x4'),_0x135b2c['uniqueid'],_0x135b2c[_0x8934('0x5')],_0x135b2c[_0x8934('0x6')],_0x135b2c[_0x8934('0x7')],_0x135b2c[_0x8934('0x8')],_0x135b2c[_0x8934('0x9')],_0x135b2c[_0x8934('0xa')],_0x135b2c['lastevent']));if(_0x135b2c[_0x8934('0x6')]){utils[_0x8934('0xb')](_0x135b2c[_0x8934('0x6')])['then'](function(_0x4b470d){if(_0x4b470d){_0x135b2c['type']=_0x4b470d['type'];_0x135b2c[_0x8934('0xc')]=_0x135b2c['agentcomplete']?_0x4b470d[_0x8934('0xd')]:![];_0x135b2c[_0x8934('0xe')]=_0x135b2c[_0x8934('0xc')]?_0x4b470d[_0x8934('0xf')]:0x0;}utils[_0x8934('0x10')](_0x8934('0x11'),_0x135b2c);});}else{utils[_0x8934('0x10')](_0x8934('0x11'),_0x135b2c);}if(_0x46a231){delete transfers[_0x135b2c['uniqueid']];}else{delete agents[_0x135b2c[_0x8934('0x12')]];}}exports[_0x8934('0x13')]=function(_0x46bca5){try{utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x15'),_0x46bca5['uniqueid']),_0x46bca5);agents[_0x46bca5[_0x8934('0x12')]]=_0x46bca5;agents[_0x46bca5[_0x8934('0x12')]][_0x8934('0x16')]=utils[_0x8934('0x17')]();agents[_0x46bca5[_0x8934('0x12')]][_0x8934('0x18')]=_0x8934('0x19');agents[_0x46bca5[_0x8934('0x12')]]['connectedlinenum']=null;agents[_0x46bca5[_0x8934('0x12')]][_0x8934('0x1a')]=null;utils[_0x8934('0x1b')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x46bca5['uniqueid'],agents[_0x46bca5[_0x8934('0x12')]]['membername'],_0x46bca5[_0x8934('0x12')]));}catch(_0xa9c394){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x15'),_0x46bca5['uniqueid']),_0xa9c394);}};exports[_0x8934('0x1d')]=function(_0x5ae49f){try{if(!_[_0x8934('0x1e')](agents[_0x5ae49f[_0x8934('0x12')]])){utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x1f'),_0x5ae49f[_0x8934('0x20')]),_0x5ae49f);utils[_0x8934('0x1b')](util['format'](_0x8934('0x21'),_0x5ae49f[_0x8934('0x20')],agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x7')],_0x5ae49f[_0x8934('0x12')]));agents[_0x5ae49f['destuniqueid']][_0x8934('0x1d')]=!![];agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x22')]=utils['now']();agents[_0x5ae49f[_0x8934('0x12')]]['lastevent']=_0x8934('0x23');agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x24')]='timeout';agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x25')]=_0x5ae49f[_0x8934('0x26')]?parseInt(_0x5ae49f[_0x8934('0x26')])/0x3e8:0x0;agents[_0x5ae49f['destuniqueid']][_0x8934('0x27')]=0x0;unanswered[_0x8934('0x28')](_0x5ae49f[_0x8934('0x12')]);}}catch(_0x3d93c7){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x1f'),_0x5ae49f[_0x8934('0x20')]),_0x3d93c7);}};exports[_0x8934('0x29')]=function(_0x18938a){try{_['forIn'](agents,function(_0x1d068c,_0x3e973e){if(_0x1d068c['uniqueid']==_0x18938a[_0x8934('0x20')]&&!_[_0x8934('0x2a')](unanswered,_0x1d068c[_0x8934('0x12')])){utils[_0x8934('0x14')](util['format'](_0x8934('0x2b'),_0x18938a[_0x8934('0x20')]),_0x18938a);utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x2c'),_0x18938a['uniqueid'],_0x1d068c[_0x8934('0x7')],_0x1d068c['destuniqueid']));_0x1d068c['agentringnoanswer']=!![];_0x1d068c[_0x8934('0x22')]=utils[_0x8934('0x17')]();_0x1d068c[_0x8934('0x18')]=_0x8934('0x2d');_0x1d068c['reason']=_0x8934('0x2d');_0x1d068c[_0x8934('0x25')]=_0x18938a[_0x8934('0x25')];_0x1d068c[_0x8934('0x27')]=0x0;writeDB(_0x1d068c);}});}catch(_0x7b2a1c){utils['error'](util[_0x8934('0x3')](_0x8934('0x2b'),_0x18938a['uniqueid']),_0x7b2a1c);}};exports['agentconnect']=function(_0x845028){try{if(agents[_0x845028[_0x8934('0x12')]]){utils['debug'](util['format'](_0x8934('0x2e'),_0x845028[_0x8934('0x20')]),_0x845028);utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x2f'),_0x845028[_0x8934('0x20')],agents[_0x845028[_0x8934('0x12')]][_0x8934('0x7')],_0x845028[_0x8934('0x12')]));agents[_0x845028[_0x8934('0x12')]][_0x8934('0x30')]=utils['now']();agents[_0x845028[_0x8934('0x12')]][_0x8934('0xa')]=_0x845028['connectedlinenum'];agents[_0x845028[_0x8934('0x12')]][_0x8934('0x1a')]=_0x845028[_0x8934('0x1a')];agents[_0x845028[_0x8934('0x12')]][_0x8934('0x25')]=_0x845028['ringtime'];agents[_0x845028['destuniqueid']]['lastevent']=_0x8934('0x31');_[_0x8934('0x32')](agents,function(_0x8814f6,_0x53581b){if(_0x8814f6[_0x8934('0x12')]!=_0x845028['destuniqueid']&&_0x8814f6['uniqueid']==_0x845028[_0x8934('0x20')]){_0x8814f6[_0x8934('0x27')]=0x0;_0x8814f6['holdtime']=_0x845028['ringtime'];_0x8814f6[_0x8934('0x1d')]=!![];_0x8814f6[_0x8934('0x22')]=utils[_0x8934('0x17')]();_0x8814f6['lastevent']=_0x8934('0x33');_0x8814f6['reason']=_0x8934('0x33');_0x8814f6['answeredelsewheredestinationuniqueid']=_0x845028[_0x8934('0x12')];_0x8814f6[_0x8934('0x34')]=_0x845028[_0x8934('0x7')];writeDB(_0x8814f6);}});}}catch(_0x566d67){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x2e'),_0x845028[_0x8934('0x20')]),_0x566d67);}};exports['agentcomplete']=function(_0x2182db){try{if(!_[_0x8934('0x1e')](agents[_0x2182db[_0x8934('0x12')]])){utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x35'),_0x2182db[_0x8934('0x20')]),_0x2182db);utils[_0x8934('0x1b')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2182db['uniqueid'],agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x7')],_0x2182db['destuniqueid']));agents[_0x2182db[_0x8934('0x12')]]['agentcomplete']=!![];agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x36')]=utils['now']();agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x27')]=utils[_0x8934('0x37')](agents[_0x2182db[_0x8934('0x12')]]['agentcompleteAt'],agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x30')]);agents[_0x2182db['destuniqueid']][_0x8934('0x24')]=_0x2182db[_0x8934('0x24')];agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x18')]=_0x8934('0x38');writeDB(agents[_0x2182db[_0x8934('0x12')]]);}}catch(_0xa45543){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x35'),_0x2182db[_0x8934('0x20')]),_0xa45543);}};exports[_0x8934('0x39')]=function(_0x2c322d){try{if(!_[_0x8934('0x1e')](agents[_0x2c322d[_0x8934('0x3a')]])){utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x3b'),_0x2c322d['uniqueid']),_0x2c322d);utils[_0x8934('0x1b')](util[_0x8934('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x2c322d['uniqueid'],agents[_0x2c322d['transfereruniqueid']]['membername'],agents[_0x2c322d[_0x8934('0x3a')]][_0x8934('0x20')]));agents[_0x2c322d[_0x8934('0x3a')]]['transfer']=!![];agents[_0x2c322d['transfereruniqueid']][_0x8934('0x3c')]='blind';agents[_0x2c322d['transfereruniqueid']][_0x8934('0x3d')]=_0x2c322d[_0x8934('0x3e')];agents[_0x2c322d[_0x8934('0x3a')]][_0x8934('0x3f')]=agents[_0x2c322d[_0x8934('0x3a')]][_0x8934('0x20')];}}catch(_0x3902fb){utils['error'](util[_0x8934('0x3')]('[%s][agents][blindtransfer]',_0x2c322d[_0x8934('0x20')]),_0x3902fb);}};exports[_0x8934('0x40')]=function(_0x2d776a){try{utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x41'),_0x2d776a[_0x8934('0x42')]),_0x2d776a);if(_0x2d776a[_0x8934('0x42')]==_0x2d776a['origtransfererlinkedid']){if(!_[_0x8934('0x1e')](agents[_0x2d776a[_0x8934('0x43')]])){utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x44'),_0x2d776a['origtransfereruniqueid'],agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x7')]));agents[_0x2d776a[_0x8934('0x43')]]['transfer']=!![];agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x3c')]=_0x8934('0x45');agents[_0x2d776a['secondtransfereruniqueid']]['transferexten']=_0x2d776a['origtransfererexten'];agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x3f')]=_0x2d776a[_0x8934('0x42')];}if(_0x2d776a['transfereeuniqueid']&&agents[_0x2d776a[_0x8934('0x46')]]){agents[_0x2d776a[_0x8934('0x46')]]['agententerreason']=0x1;transfers[_0x2d776a['transfereeuniqueid']]=_[_0x8934('0x47')](agents[_0x2d776a[_0x8934('0x46')]]);transfers[_0x2d776a[_0x8934('0x46')]][_0x8934('0x9')]=agents[_0x2d776a['secondtransfereruniqueid']]['calleridnum'];transfers[_0x2d776a['transfereeuniqueid']]['calleridname']=agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x48')];transfers[_0x2d776a[_0x8934('0x46')]][_0x8934('0x16')]=utils[_0x8934('0x17')]();transfers[_0x2d776a[_0x8934('0x46')]]['agentconnectAt']=utils[_0x8934('0x17')]();transfers[_0x2d776a[_0x8934('0x46')]]['holdtime']=0x0;transfers[_0x2d776a[_0x8934('0x46')]]['agententerreason']=0x2;}}else if(_0x2d776a[_0x8934('0x43')]==_0x2d776a['secondtransfererlinkedid']){if(!_[_0x8934('0x1e')](agents[_0x2d776a[_0x8934('0x42')]])){utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x44'),_0x2d776a[_0x8934('0x42')],agents[_0x2d776a[_0x8934('0x42')]]['membername']));agents[_0x2d776a['origtransfereruniqueid']][_0x8934('0x49')]=!![];agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x3c')]=_0x8934('0x45');agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x3d')]=_0x2d776a[_0x8934('0x4a')];agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x3f')]=_0x2d776a[_0x8934('0x43')];}if(_0x2d776a[_0x8934('0x4b')]&&agents[_0x2d776a[_0x8934('0x4b')]]){agents[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x4c')]=0x1;transfers[_0x2d776a['transfertargetuniqueid']]=_['clone'](agents[_0x2d776a[_0x8934('0x4b')]]);transfers[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x9')]=agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x9')];transfers[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x48')]=agents[_0x2d776a['origtransfereruniqueid']][_0x8934('0x48')];transfers[_0x2d776a[_0x8934('0x4b')]]['agentcalledAt']=utils[_0x8934('0x17')]();transfers[_0x2d776a['transfertargetuniqueid']][_0x8934('0x30')]=utils[_0x8934('0x17')]();transfers[_0x2d776a[_0x8934('0x4b')]]['holdtime']=0x0;transfers[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x4c')]=0x2;}}}catch(_0x544fa7){utils[_0x8934('0x1c')](util['format'](_0x8934('0x41'),_0x2d776a['origtransfereruniqueid']),_0x544fa7);}};exports[_0x8934('0x4d')]=function(_0x6b3376){try{utils[_0x8934('0x14')](util['format'](_0x8934('0x4e'),_0x6b3376[_0x8934('0x20')]),_0x6b3376);if(agents[_0x6b3376[_0x8934('0x20')]]&&agents[_0x6b3376[_0x8934('0x20')]]['reason']===_0x8934('0x23')){if(_0x6b3376['cause']==='21'){agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')]=_0x8934('0x4f');agents[_0x6b3376[_0x8934('0x20')]]['lastevent']=_0x8934('0x4f');}utils[_0x8934('0x1b')](util[_0x8934('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x6b3376[_0x8934('0x20')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x7')],agents[_0x6b3376['uniqueid']]['reason'],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]));writeDB(agents[_0x6b3376[_0x8934('0x20')]]);var _0x1efd58=unanswered[_0x8934('0x50')](_0x6b3376[_0x8934('0x20')]);if(_0x1efd58>-0x1){unanswered[_0x8934('0x51')](_0x1efd58,0x1);}}if(transfers[_0x6b3376[_0x8934('0x20')]]){transfers[_0x6b3376[_0x8934('0x20')]]['agentcomplete']=!![];transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x36')]=utils[_0x8934('0x17')]();transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x27')]=utils['diffTime'](transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x36')],transfers[_0x6b3376['uniqueid']][_0x8934('0x30')]);transfers[_0x6b3376['uniqueid']]['reason']='agent';transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]=_0x8934('0x38');utils['info'](util[_0x8934('0x3')](_0x8934('0x52'),_0x6b3376['uniqueid'],transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x7')],transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')],transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]));writeDB(transfers[_0x6b3376[_0x8934('0x20')]],!![]);}if(agents[_0x6b3376[_0x8934('0x20')]]&&agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x30')]){agents[_0x6b3376['uniqueid']][_0x8934('0x53')]=!![];agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x36')]=utils[_0x8934('0x17')]();agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x27')]=utils[_0x8934('0x37')](agents[_0x6b3376['uniqueid']][_0x8934('0x36')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x30')]);agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')]=agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x49')]?_0x8934('0x49'):_0x8934('0x54');agents[_0x6b3376['uniqueid']]['lastevent']=_0x8934('0x38');utils[_0x8934('0x1b')](util['format'](_0x8934('0x52'),_0x6b3376[_0x8934('0x20')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x7')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]));writeDB(agents[_0x6b3376[_0x8934('0x20')]]);}}catch(_0x2d094e){utils[_0x8934('0x1c')](util['format'](_0x8934('0x4e'),_0x6b3376[_0x8934('0x20')]),_0x2d094e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 04ad743..8136056 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9402=['xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','request','CreateVoiceCallReport','recording','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','[%s][calls][newstate]','isNil','channelstate','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','diffTime','endtime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<'];(function(_0x1e0da3,_0x3ac2f5){var _0x3b2330=function(_0x3056df){while(--_0x3056df){_0x1e0da3['push'](_0x1e0da3['shift']());}};_0x3b2330(++_0x3ac2f5);}(_0x9402,0x85));var _0x2940=function(_0x48cdab,_0x1d82bd){_0x48cdab=_0x48cdab-0x0;var _0x52afb6=_0x9402[_0x48cdab];return _0x52afb6;};'use strict';var _=require(_0x2940('0x0'));var util=require(_0x2940('0x1'));var utils=require(_0x2940('0x2'));var transfers=require(_0x2940('0x3'));var dispositions=[_0x2940('0x4'),'FAILED',_0x2940('0x5'),_0x2940('0x4'),_0x2940('0x4'),_0x2940('0x4'),'ANSWERED',_0x2940('0x6'),_0x2940('0x5'),_0x2940('0x5'),'FAILED'];var channels={};function writeDB(_0x6a584e){var _0x110f49;if(transfers[_0x2940('0x7')][_0x6a584e[_0x2940('0x8')]]){_0x110f49=_0x6a584e[_0x2940('0x8')];_0x6a584e['uniqueid']=transfers['blinds'][_0x6a584e['uniqueid']]['transfereeuniqueid'];}utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0xb'),_0x6a584e[_0x2940('0x8')],_0x6a584e[_0x2940('0xc')],_0x6a584e[_0x2940('0xd')],_0x6a584e[_0x2940('0xe')],_0x6a584e[_0x2940('0xf')],_0x6a584e[_0x2940('0x10')],_0x6a584e['connectedlinenum'],_0x6a584e[_0x2940('0x11')]));if(_0x6a584e['accountcode']){utils['getUserByInternal'](_0x6a584e[_0x2940('0x12')])['then'](function(_0x285880){if(_0x285880){_0x6a584e['UserId']=_0x285880['id'];}utils[_0x2940('0x13')](_0x2940('0x14'),_0x6a584e);});}else{utils['request'](_0x2940('0x14'),_0x6a584e);}if(channels[_0x6a584e[_0x2940('0x8')]]){delete channels[_0x6a584e[_0x2940('0x8')]];}else if(_0x110f49&&channels[_0x110f49]){if(!transfers[_0x2940('0x7')][_0x110f49][_0x2940('0x15')])delete transfers[_0x2940('0x7')][_0x110f49];delete channels[_0x110f49];}}exports['newchannel']=function(_0x381631){try{utils['debug'](util['format'](_0x2940('0x16'),_0x381631[_0x2940('0x8')]),_0x381631);if(_0x381631[_0x2940('0x8')]==_0x381631[_0x2940('0x17')]&&_0x381631['channel']!=_0x2940('0x18')){utils['info'](util[_0x2940('0xa')](_0x2940('0x19'),_0x381631[_0x2940('0x8')],_0x381631[_0x2940('0x1a')],_0x381631[_0x2940('0x1b')]));channels[_0x381631[_0x2940('0x8')]]={'uniqueid':_0x381631['uniqueid'],'accountcode':_0x381631[_0x2940('0x12')],'source':_0x381631[_0x2940('0x10')],'destination':_0x381631[_0x2940('0x1b')],'destinationcontext':_0x381631['context'],'channel':_0x381631[_0x2940('0xc')],'starttime':utils[_0x2940('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x2940('0x1d')};}}catch(_0x4ca2e2){utils['error'](util[_0x2940('0xa')](_0x2940('0x16'),_0x381631[_0x2940('0x8')]),_0x4ca2e2);}};exports[_0x2940('0x1e')]=function(_0x3e0e7c){try{utils[_0x2940('0x1f')](util['format'](_0x2940('0x20'),_0x3e0e7c[_0x2940('0x8')]),_0x3e0e7c);if(!_[_0x2940('0x21')](channels[_0x3e0e7c[_0x2940('0x8')]])&&_0x3e0e7c[_0x2940('0x22')]==0x6){utils[_0x2940('0x9')](util[_0x2940('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x3e0e7c[_0x2940('0x8')],_0x3e0e7c[_0x2940('0x1a')],_0x3e0e7c[_0x2940('0xc')]));if(_[_0x2940('0x21')](channels[_0x3e0e7c[_0x2940('0x8')]][_0x2940('0x23')])){channels[_0x3e0e7c['uniqueid']][_0x2940('0x23')]=utils[_0x2940('0x1c')]();}}else if(!_[_0x2940('0x21')](channels[_0x3e0e7c[_0x2940('0x17')]])&&_0x3e0e7c['channelstate']==0x6&&_0x3e0e7c[_0x2940('0x1a')]!='transfer'){utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x24'),_0x3e0e7c[_0x2940('0x8')],_0x3e0e7c['linkedid'],_0x3e0e7c[_0x2940('0x1a')],_0x3e0e7c['channel']));channels[_0x3e0e7c[_0x2940('0x17')]][_0x2940('0x12')]=_0x3e0e7c[_0x2940('0x12')];channels[_0x3e0e7c['linkedid']][_0x2940('0x25')]=_0x3e0e7c[_0x2940('0xc')];if(_[_0x2940('0x21')](channels[_0x3e0e7c['linkedid']][_0x2940('0x26')])){channels[_0x3e0e7c[_0x2940('0x17')]]['answertime']=utils[_0x2940('0x1c')]();}channels[_0x3e0e7c[_0x2940('0x17')]][_0x2940('0x27')]=dispositions[_[_0x2940('0x28')](_0x3e0e7c[_0x2940('0x22')])]||'ANSWERED';}}catch(_0x391aa4){utils[_0x2940('0x29')](util[_0x2940('0xa')](_0x2940('0x20'),_0x3e0e7c[_0x2940('0x8')]),_0x391aa4);}};exports[_0x2940('0x2a')]=function(_0x434862){try{if(!_['isNil'](channels[_0x434862['uniqueid']])){utils[_0x2940('0x1f')](util[_0x2940('0xa')](_0x2940('0x2b'),_0x434862[_0x2940('0x8')]),_0x434862);if(_[_0x2940('0x21')](channels[_0x434862['uniqueid']][_0x2940('0x2c')])){channels[_0x434862['uniqueid']][_0x2940('0x2c')]=_0x434862[_0x2940('0x2d')]+'\x20<'+_0x434862[_0x2940('0x10')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x434862[_0x2940('0x8')],channels[_0x434862[_0x2940('0x8')]]['callerid'],_0x434862[_0x2940('0x2e')]));channels[_0x434862[_0x2940('0x8')]]['endtime']=utils['now']();channels[_0x434862[_0x2940('0x8')]]['duration']=utils[_0x2940('0x2f')](channels[_0x434862[_0x2940('0x8')]][_0x2940('0x30')],channels[_0x434862[_0x2940('0x8')]][_0x2940('0x31')]);channels[_0x434862[_0x2940('0x8')]]['billableseconds']=channels[_0x434862[_0x2940('0x8')]][_0x2940('0x26')]?utils['diffTime'](channels[_0x434862[_0x2940('0x8')]][_0x2940('0x30')],channels[_0x434862[_0x2940('0x8')]][_0x2940('0x26')]):0x0;writeDB(channels[_0x434862['uniqueid']]);}}catch(_0x4325fc){utils[_0x2940('0x29')](util[_0x2940('0xa')](_0x2940('0x2b'),_0x434862[_0x2940('0x8')]),_0x4325fc);}};exports[_0x2940('0x32')]=function(_0x468c01){try{if(!_[_0x2940('0x21')](channels[_0x468c01[_0x2940('0x33')]])){utils[_0x2940('0x1f')](util['format'](_0x2940('0x34'),_0x468c01['origtransfereruniqueid']),_0x468c01);if(channels[_0x468c01[_0x2940('0x33')]]['channel']==_0x468c01[_0x2940('0x35')]){utils[_0x2940('0x9')](util[_0x2940('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x468c01[_0x2940('0x36')],_0x468c01[_0x2940('0x33')],_0x468c01[_0x2940('0x37')]));channels[_0x468c01[_0x2940('0x33')]][_0x2940('0x25')]=_0x468c01['secondtransfererchannel'];channels[_0x468c01[_0x2940('0x33')]]['userfield']=_0x2940('0x38');}else if(channels[_0x468c01[_0x2940('0x33')]][_0x2940('0xc')]=_0x468c01[_0x2940('0x39')]){utils[_0x2940('0x9')](util['format'](_0x2940('0x3a'),_0x468c01['origtransfereruniqueid'],_0x468c01[_0x2940('0x33')],_0x468c01[_0x2940('0x3b')]));channels[_0x468c01[_0x2940('0x33')]][_0x2940('0x25')]=_0x468c01[_0x2940('0x3b')];channels[_0x468c01[_0x2940('0x33')]]['userfield']='_attended';}}}catch(_0x2dfc06){utils[_0x2940('0x29')](util[_0x2940('0xa')]('[%s][calls][attendedtransfer]',_0x468c01[_0x2940('0x36')]),_0x2dfc06);}};exports[_0x2940('0x3c')]=function(_0x2326d1){try{if(!_[_0x2940('0x21')](channels[_0x2326d1['uniqueid']])){utils[_0x2940('0x1f')](util[_0x2940('0xa')]('[%s][calls][musiconholdstart]',_0x2326d1['uniqueid']),_0x2326d1);channels[_0x2326d1['uniqueid']][_0x2940('0x3d')]=utils[_0x2940('0x1c')]();utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x3e'),_0x2326d1[_0x2940('0x8')],channels[_0x2326d1['uniqueid']][_0x2940('0x3d')]));}}catch(_0x28a1e2){utils[_0x2940('0x29')](util[_0x2940('0xa')](_0x2940('0x3f'),_0x2326d1[_0x2940('0x8')]),_0x28a1e2);}};exports['musiconholdstop']=function(_0x26d96a){try{if(!_['isNil'](channels[_0x26d96a[_0x2940('0x8')]])){utils[_0x2940('0x1f')](util[_0x2940('0xa')]('[%s][calls][musiconholdstop]',_0x26d96a['uniqueid']),_0x26d96a);if(!_['isNil'](channels[_0x26d96a[_0x2940('0x8')]][_0x2940('0x3d')])){channels[_0x26d96a[_0x2940('0x8')]][_0x2940('0x40')]+=utils[_0x2940('0x2f')](utils[_0x2940('0x1c')](),channels[_0x26d96a['uniqueid']]['musiconholdstartAt']);utils[_0x2940('0x9')](util[_0x2940('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x26d96a[_0x2940('0x8')],channels[_0x26d96a['uniqueid']]['mohtime']));delete channels[_0x26d96a[_0x2940('0x8')]][_0x2940('0x3d')];}}}catch(_0xb180ee){utils[_0x2940('0x29')](util[_0x2940('0xa')](_0x2940('0x41'),_0x26d96a['uniqueid']),_0xb180ee);}};exports[_0x2940('0x42')]=function(_0x5cd91b){try{if(!_['isNil'](channels[_0x5cd91b['uniqueid']])){utils[_0x2940('0x1f')](util['format'](_0x2940('0x43'),_0x5cd91b['uniqueid']),_0x5cd91b);if(!_[_0x2940('0x21')](_0x5cd91b['variable'][_0x2940('0x44')])){utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x45'),_0x5cd91b[_0x2940('0x8')],_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b[_0x2940('0x8')]][_0x2940('0x47')]=_0x5cd91b[_0x2940('0x46')];}if(!_['isNil'](_0x5cd91b[_0x2940('0x48')][_0x2940('0x49')])){utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x4a'),_0x5cd91b[_0x2940('0x8')],_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b['uniqueid']][_0x2940('0x4b')]=_0x5cd91b[_0x2940('0x46')];channels[_0x5cd91b['uniqueid']]['callerid']='\x22'+_0x5cd91b['value']+_0x2940('0x4c')+_0x5cd91b[_0x2940('0x46')]+'>';}if(!_[_0x2940('0x21')](_0x5cd91b[_0x2940('0x48')][_0x2940('0x4d')])||!_[_0x2940('0x21')](_0x5cd91b['variable'][_0x2940('0x4e')])){utils[_0x2940('0x9')](util[_0x2940('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5cd91b['uniqueid'],!_[_0x2940('0x21')](_0x5cd91b[_0x2940('0x48')]['xmd-callerid-preview'])?_0x2940('0x4d'):'xmd-callerid',_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b['uniqueid']]['callerid']=_0x5cd91b[_0x2940('0x46')];}if(!_[_0x2940('0x21')](_0x5cd91b['variable']['xmd-queue'])||!_['isNil'](_0x5cd91b['variable']['xmcs-queue'])){utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x4f'),_0x5cd91b[_0x2940('0x8')],!_[_0x2940('0x21')](_0x5cd91b[_0x2940('0x48')]['xmd-queue'])?'xmd-queue':_0x2940('0x50'),_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b[_0x2940('0x8')]]['lastapplication']=_0x2940('0x51');channels[_0x5cd91b[_0x2940('0x8')]][_0x2940('0x52')]=_0x5cd91b[_0x2940('0x46')];channels[_0x5cd91b['uniqueid']][_0x2940('0xd')]=!![];}if(!_[_0x2940('0x21')](_0x5cd91b['variable'][_0x2940('0x53')])){utils['info'](util[_0x2940('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x5cd91b[_0x2940('0x8')],_0x5cd91b['value']));channels[_0x5cd91b[_0x2940('0x8')]][_0x2940('0x54')]=_0x5cd91b[_0x2940('0x46')];}if(!_[_0x2940('0x21')](_0x5cd91b[_0x2940('0x48')][_0x2940('0x55')])){utils[_0x2940('0x9')](util['format'](_0x2940('0x56'),_0x5cd91b[_0x2940('0x8')],_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b[_0x2940('0x8')]][_0x2940('0x57')]=_0x5cd91b[_0x2940('0x46')];}if(!_['isNil'](_0x5cd91b[_0x2940('0x48')][_0x2940('0x58')])){utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x59'),_0x5cd91b[_0x2940('0x8')],_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b[_0x2940('0x8')]]['routeid']=_0x5cd91b[_0x2940('0x46')];}if(!_[_0x2940('0x21')](_0x5cd91b[_0x2940('0x48')][_0x2940('0x5a')])){utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x5b'),_0x5cd91b[_0x2940('0x8')],_0x5cd91b[_0x2940('0x46')]));channels[_0x5cd91b['uniqueid']]['sipcallid']=_0x5cd91b[_0x2940('0x46')];}}}catch(_0x4f9dbf){utils[_0x2940('0x29')](util[_0x2940('0xa')](_0x2940('0x43'),_0x5cd91b[_0x2940('0x8')]),_0x4f9dbf);}};exports['newexten']=function(_0x25853e){try{if(!_[_0x2940('0x21')](channels[_0x25853e[_0x2940('0x8')]])){utils['debug'](util['format'](_0x2940('0x5c'),_0x25853e[_0x2940('0x8')]),_0x25853e);utils[_0x2940('0x9')](util[_0x2940('0xa')](_0x2940('0x5d'),_0x25853e[_0x2940('0x8')],_0x25853e[_0x2940('0x5e')],_0x25853e[_0x2940('0x5f')]));if(_0x25853e[_0x2940('0x5e')][_0x2940('0x60')]()==_0x2940('0x61')&&_[_0x2940('0x62')](_0x25853e[_0x2940('0x5f')][_0x2940('0x60')](),_0x2940('0x63'))){var _0x1f5975=_0x25853e[_0x2940('0x5f')][_0x2940('0x64')]('=');var _0x5d36ba=_0x1f5975[0x0]['substring'](_0x1f5975[0x0][_0x2940('0x65')]('(')+0x1,_0x1f5975[0x0][_0x2940('0x65')](')'));var _0x33b630=_0x1f5975[0x1];channels[_0x25853e[_0x2940('0x8')]][_0x5d36ba]=_0x33b630;}if(!_['includes']([_0x2940('0x2a'),_0x2940('0x66'),_0x2940('0x67'),_0x2940('0x61'),_0x2940('0x68')],_0x25853e[_0x2940('0x5e')]['toLowerCase']())){channels[_0x25853e['uniqueid']]['lastapplication']=_0x25853e['application'];channels[_0x25853e['uniqueid']]['lastdata']=_0x25853e[_0x2940('0x5f')];}}}catch(_0x255981){utils['error'](util[_0x2940('0xa')](_0x2940('0x5c'),_0x25853e[_0x2940('0x8')]),_0x255981);}}; \ No newline at end of file +var _0x43d7=['ContactId','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','BUSY','FAILED','uniqueid','blinds','transfereeuniqueid','info','format','channel','queue','membername','interface','calleridnum','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','now','isNil','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x43d7,0x7b));var _0x743d=function(_0x570647,_0x496f71){_0x570647=_0x570647-0x0;var _0x386c8d=_0x43d7[_0x570647];return _0x386c8d;};'use strict';var _=require(_0x743d('0x0'));var util=require(_0x743d('0x1'));var utils=require(_0x743d('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x743d('0x3'),'FAILED','FAILED',_0x743d('0x3'),_0x743d('0x3'),'NO\x20ANSWER','ANSWERED',_0x743d('0x4'),_0x743d('0x5'),_0x743d('0x5'),_0x743d('0x5')];var channels={};function writeDB(_0x3b7560){var _0xf490f7;if(transfers['blinds'][_0x3b7560['uniqueid']]){_0xf490f7=_0x3b7560[_0x743d('0x6')];_0x3b7560[_0x743d('0x6')]=transfers[_0x743d('0x7')][_0x3b7560['uniqueid']][_0x743d('0x8')];}utils[_0x743d('0x9')](util[_0x743d('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3b7560[_0x743d('0x6')],_0x3b7560[_0x743d('0xb')],_0x3b7560[_0x743d('0xc')],_0x3b7560[_0x743d('0xd')],_0x3b7560[_0x743d('0xe')],_0x3b7560[_0x743d('0xf')],_0x3b7560['connectedlinenum'],_0x3b7560['lastevent']));if(_0x3b7560[_0x743d('0x10')]){utils[_0x743d('0x11')](_0x3b7560[_0x743d('0x10')])[_0x743d('0x12')](function(_0x374f87){if(_0x374f87){_0x3b7560['UserId']=_0x374f87['id'];}utils[_0x743d('0x13')](_0x743d('0x14'),_0x3b7560);});}else{utils[_0x743d('0x13')](_0x743d('0x14'),_0x3b7560);}if(channels[_0x3b7560[_0x743d('0x6')]]){delete channels[_0x3b7560[_0x743d('0x6')]];}else if(_0xf490f7&&channels[_0xf490f7]){if(!transfers[_0x743d('0x7')][_0xf490f7]['recording'])delete transfers[_0x743d('0x7')][_0xf490f7];delete channels[_0xf490f7];}}exports[_0x743d('0x15')]=function(_0x3ef653){try{utils['debug'](util['format'](_0x743d('0x16'),_0x3ef653[_0x743d('0x6')]),_0x3ef653);if(_0x3ef653[_0x743d('0x6')]==_0x3ef653[_0x743d('0x17')]&&_0x3ef653['channel']!=_0x743d('0x18')){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x19'),_0x3ef653['uniqueid'],_0x3ef653[_0x743d('0x1a')],_0x3ef653[_0x743d('0x1b')]));channels[_0x3ef653['uniqueid']]={'uniqueid':_0x3ef653[_0x743d('0x6')],'accountcode':_0x3ef653['accountcode'],'source':_0x3ef653[_0x743d('0xf')],'destination':_0x3ef653[_0x743d('0x1b')],'destinationcontext':_0x3ef653[_0x743d('0x1a')],'channel':_0x3ef653['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x743d('0x1c')};}}catch(_0x3ad5d5){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x16'),_0x3ef653['uniqueid']),_0x3ad5d5);}};exports[_0x743d('0x1e')]=function(_0x4eaac7){try{utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x20'),_0x4eaac7['uniqueid']),_0x4eaac7);if(!_['isNil'](channels[_0x4eaac7[_0x743d('0x6')]])&&_0x4eaac7[_0x743d('0x21')]==0x6){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x22'),_0x4eaac7[_0x743d('0x6')],_0x4eaac7[_0x743d('0x1a')],_0x4eaac7[_0x743d('0xb')]));if(_['isNil'](channels[_0x4eaac7[_0x743d('0x6')]]['systemanswertime'])){channels[_0x4eaac7['uniqueid']]['systemanswertime']=utils[_0x743d('0x23')]();}}else if(!_[_0x743d('0x24')](channels[_0x4eaac7['linkedid']])&&_0x4eaac7[_0x743d('0x21')]==0x6&&_0x4eaac7[_0x743d('0x1a')]!=_0x743d('0x25')){utils[_0x743d('0x9')](util['format'](_0x743d('0x26'),_0x4eaac7['uniqueid'],_0x4eaac7[_0x743d('0x17')],_0x4eaac7['context'],_0x4eaac7[_0x743d('0xb')]));channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x10')]=_0x4eaac7[_0x743d('0x10')];channels[_0x4eaac7['linkedid']][_0x743d('0x27')]=_0x4eaac7[_0x743d('0xb')];if(_[_0x743d('0x24')](channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x28')])){channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x28')]=utils[_0x743d('0x23')]();}channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x29')]=dispositions[_[_0x743d('0x2a')](_0x4eaac7[_0x743d('0x21')])]||'ANSWERED';}}catch(_0xa84896){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x20'),_0x4eaac7['uniqueid']),_0xa84896);}};exports[_0x743d('0x2b')]=function(_0x4141b6){try{if(!_[_0x743d('0x24')](channels[_0x4141b6[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x2c'),_0x4141b6[_0x743d('0x6')]),_0x4141b6);if(_[_0x743d('0x24')](channels[_0x4141b6[_0x743d('0x6')]]['callerid'])){channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x2d')]=_0x4141b6['calleridname']+'\x20<'+_0x4141b6[_0x743d('0xf')]+'>';}utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x2e'),_0x4141b6[_0x743d('0x6')],channels[_0x4141b6['uniqueid']][_0x743d('0x2d')],_0x4141b6[_0x743d('0x2f')]));channels[_0x4141b6['uniqueid']][_0x743d('0x30')]=utils[_0x743d('0x23')]();channels[_0x4141b6[_0x743d('0x6')]]['duration']=utils['diffTime'](channels[_0x4141b6[_0x743d('0x6')]]['endtime'],channels[_0x4141b6[_0x743d('0x6')]]['starttime']);channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x31')]=channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x28')]?utils[_0x743d('0x32')](channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x30')],channels[_0x4141b6['uniqueid']][_0x743d('0x28')]):0x0;writeDB(channels[_0x4141b6[_0x743d('0x6')]]);}}catch(_0x1d79d5){utils['error'](util[_0x743d('0xa')](_0x743d('0x2c'),_0x4141b6[_0x743d('0x6')]),_0x1d79d5);}};exports['attendedtransfer']=function(_0x9f777c){try{if(!_[_0x743d('0x24')](channels[_0x9f777c[_0x743d('0x33')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x34'),_0x9f777c[_0x743d('0x35')]),_0x9f777c);if(channels[_0x9f777c['localtwolinkedid']]['channel']==_0x9f777c[_0x743d('0x36')]){utils['info'](util[_0x743d('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x9f777c['origtransfereruniqueid'],_0x9f777c[_0x743d('0x33')],_0x9f777c['secondtransfererchannel']));channels[_0x9f777c[_0x743d('0x33')]]['destinationchannel']=_0x9f777c[_0x743d('0x37')];channels[_0x9f777c[_0x743d('0x33')]]['userfield']=_0x743d('0x38');}else if(channels[_0x9f777c[_0x743d('0x33')]][_0x743d('0xb')]=_0x9f777c[_0x743d('0x39')]){utils[_0x743d('0x9')](util['format'](_0x743d('0x3a'),_0x9f777c['origtransfereruniqueid'],_0x9f777c[_0x743d('0x33')],_0x9f777c['origtransfererchannel']));channels[_0x9f777c[_0x743d('0x33')]][_0x743d('0x27')]=_0x9f777c[_0x743d('0x3b')];channels[_0x9f777c[_0x743d('0x33')]][_0x743d('0x3c')]=_0x743d('0x38');}}}catch(_0x3824f0){utils['error'](util[_0x743d('0xa')](_0x743d('0x34'),_0x9f777c['origtransfereruniqueid']),_0x3824f0);}};exports[_0x743d('0x3d')]=function(_0x9aa5fe){try{if(!_[_0x743d('0x24')](channels[_0x9aa5fe[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x3e'),_0x9aa5fe[_0x743d('0x6')]),_0x9aa5fe);channels[_0x9aa5fe[_0x743d('0x6')]][_0x743d('0x3f')]=utils[_0x743d('0x23')]();utils['info'](util[_0x743d('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x9aa5fe['uniqueid'],channels[_0x9aa5fe['uniqueid']][_0x743d('0x3f')]));}}catch(_0x15fced){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x3e'),_0x9aa5fe[_0x743d('0x6')]),_0x15fced);}};exports['musiconholdstop']=function(_0x157159){try{if(!_[_0x743d('0x24')](channels[_0x157159[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x40'),_0x157159[_0x743d('0x6')]),_0x157159);if(!_[_0x743d('0x24')](channels[_0x157159[_0x743d('0x6')]][_0x743d('0x3f')])){channels[_0x157159[_0x743d('0x6')]][_0x743d('0x41')]+=utils[_0x743d('0x32')](utils['now'](),channels[_0x157159[_0x743d('0x6')]][_0x743d('0x3f')]);utils[_0x743d('0x9')](util[_0x743d('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x157159[_0x743d('0x6')],channels[_0x157159['uniqueid']][_0x743d('0x41')]));delete channels[_0x157159[_0x743d('0x6')]][_0x743d('0x3f')];}}}catch(_0x595adc){utils['error'](util[_0x743d('0xa')](_0x743d('0x40'),_0x157159['uniqueid']),_0x595adc);}};exports[_0x743d('0x42')]=function(_0x5448b9){try{if(!_[_0x743d('0x24')](channels[_0x5448b9[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x43'),_0x5448b9['uniqueid']),_0x5448b9);if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x45')])){utils['info'](util[_0x743d('0xa')](_0x743d('0x46'),_0x5448b9['uniqueid'],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x48')]=_0x5448b9[_0x743d('0x47')];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')]['xmd-phone'])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x49'),_0x5448b9['uniqueid'],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9[_0x743d('0x6')]]['destination']=_0x5448b9['value'];channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x2d')]='\x22'+_0x5448b9[_0x743d('0x47')]+_0x743d('0x4a')+_0x5448b9['value']+'>';}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x4b')])||!_[_0x743d('0x24')](_0x5448b9['variable'][_0x743d('0x4c')])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x4d'),_0x5448b9[_0x743d('0x6')],!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x4b')])?_0x743d('0x4b'):_0x743d('0x4c'),_0x5448b9['value']));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x2d')]=_0x5448b9[_0x743d('0x47')];}if(!_['isNil'](_0x5448b9[_0x743d('0x44')]['xmd-queue'])||!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x4e')])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x4d'),_0x5448b9[_0x743d('0x6')],!_['isNil'](_0x5448b9['variable'][_0x743d('0x4f')])?_0x743d('0x4f'):'xmcs-queue',_0x5448b9['value']));channels[_0x5448b9['uniqueid']][_0x743d('0x50')]=_0x743d('0x51');channels[_0x5448b9['uniqueid']][_0x743d('0x52')]=_0x5448b9[_0x743d('0x47')];channels[_0x5448b9[_0x743d('0x6')]]['queue']=!![];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x53')])){utils['info'](util['format'](_0x743d('0x54'),_0x5448b9[_0x743d('0x6')],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9['uniqueid']][_0x743d('0x55')]=_0x5448b9[_0x743d('0x47')];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')]['xmd-cdrtype'])){utils[_0x743d('0x9')](util[_0x743d('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5448b9[_0x743d('0x6')],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9['uniqueid']][_0x743d('0x56')]=_0x5448b9['value'];}if(!_['isNil'](_0x5448b9[_0x743d('0x44')][_0x743d('0x57')])){utils['info'](util[_0x743d('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5448b9[_0x743d('0x6')],_0x5448b9['value']));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x58')]=_0x5448b9[_0x743d('0x47')];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')]['sipcallid'])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x59'),_0x5448b9['uniqueid'],_0x5448b9['value']));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x5a')]=_0x5448b9['value'];}}}catch(_0x5958df){utils['error'](util[_0x743d('0xa')](_0x743d('0x43'),_0x5448b9[_0x743d('0x6')]),_0x5958df);}};exports[_0x743d('0x5b')]=function(_0x3f7163){try{if(!_[_0x743d('0x24')](channels[_0x3f7163[_0x743d('0x6')]])){utils['debug'](util['format'](_0x743d('0x5c'),_0x3f7163['uniqueid']),_0x3f7163);utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x5d'),_0x3f7163['uniqueid'],_0x3f7163[_0x743d('0x5e')],_0x3f7163[_0x743d('0x5f')]));if(_0x3f7163[_0x743d('0x5e')]['toLowerCase']()=='set'&&_[_0x743d('0x60')](_0x3f7163[_0x743d('0x5f')][_0x743d('0x61')](),_0x743d('0x62'))){var _0x8093c1=_0x3f7163[_0x743d('0x5f')]['split']('=');var _0x1f5a57=_0x8093c1[0x0]['substring'](_0x8093c1[0x0][_0x743d('0x63')]('(')+0x1,_0x8093c1[0x0][_0x743d('0x63')](')'));var _0x223058=_0x8093c1[0x1];channels[_0x3f7163[_0x743d('0x6')]][_0x1f5a57]=_0x223058;}if(!_[_0x743d('0x64')]([_0x743d('0x2b'),_0x743d('0x65'),_0x743d('0x66'),'set',_0x743d('0x67')],_0x3f7163[_0x743d('0x5e')][_0x743d('0x61')]())){channels[_0x3f7163[_0x743d('0x6')]][_0x743d('0x50')]=_0x3f7163['application'];channels[_0x3f7163[_0x743d('0x6')]][_0x743d('0x52')]=_0x3f7163[_0x743d('0x5f')];}}}catch(_0x5a837d){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x5c'),_0x3f7163[_0x743d('0x6')]),_0x5a837d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index daa33c5..815f06b 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe94a=['close','[core]\x20close','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x3655ca,_0xdb09fa){var _0x2d2ff8=function(_0x427d93){while(--_0x427d93){_0x3655ca['push'](_0x3655ca['shift']());}};_0x2d2ff8(++_0xdb09fa);}(_0xe94a,0x10b));var _0xae94=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0xe94a[_0x4991d6];return _0x50faf7;};'use strict';var utils=require('./utils');exports[_0xae94('0x0')]=function(){utils[_0xae94('0x1')](_0xae94('0x2'));};exports['shutdown']=function(){utils[_0xae94('0x1')](_0xae94('0x3'));};exports[_0xae94('0x4')]=function(){utils[_0xae94('0x1')](_0xae94('0x5'));};exports[_0xae94('0x6')]=function(_0xac9d3e){utils[_0xae94('0x6')](_0xae94('0x7'),_0xac9d3e);};exports[_0xae94('0x8')]=function(){utils[_0xae94('0x1')](_0xae94('0x9'));};exports[_0xae94('0xa')]=function(_0x13494f){}; \ No newline at end of file +var _0xfcd2=['[core]\x20error','close','[core]\x20close','managerevent','info','shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x2ef9ce,_0x39e0ea){var _0x578d58=function(_0x39a8f8){while(--_0x39a8f8){_0x2ef9ce['push'](_0x2ef9ce['shift']());}};_0x578d58(++_0x39e0ea);}(_0xfcd2,0x1d8));var _0x2fcd=function(_0x3a187e,_0x1d34c2){_0x3a187e=_0x3a187e-0x0;var _0x588537=_0xfcd2[_0x3a187e];return _0x588537;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x2fcd('0x0')]('[core]\x20connected');};exports[_0x2fcd('0x1')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x2fcd('0x2')]=function(){utils[_0x2fcd('0x0')](_0x2fcd('0x3'));};exports[_0x2fcd('0x4')]=function(_0x26e6f9){utils['error'](_0x2fcd('0x5'),_0x26e6f9);};exports[_0x2fcd('0x6')]=function(){utils[_0x2fcd('0x0')](_0x2fcd('0x7'));};exports[_0x2fcd('0x8')]=function(_0x16daf3){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 65d5a0d..5c66ec6 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfda=['cdr(routeid)','split','varset','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase'];(function(_0x4c1ad8,_0x55e28d){var _0x2c617b=function(_0x5f80df){while(--_0x5f80df){_0x4c1ad8['push'](_0x4c1ad8['shift']());}};_0x2c617b(++_0x55e28d);}(_0xbfda,0x8c));var _0xabfd=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xbfda[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var utils=require(_0xabfd('0x2'));var dials={};function writeDB(_0x51e20e){utils[_0xabfd('0x3')](util['format'](_0xabfd('0x4'),_0x51e20e[_0xabfd('0x5')],_0x51e20e[_0xabfd('0x6')],_0x51e20e[_0xabfd('0x7')],_0x51e20e[_0xabfd('0x8')],_0x51e20e[_0xabfd('0x9')],_0x51e20e[_0xabfd('0xa')]));utils[_0xabfd('0xb')](_0xabfd('0xc'),_0x51e20e);delete dials[_0x51e20e[_0xabfd('0x5')]];}exports[_0xabfd('0xd')]=function(_0x51fab5){try{utils[_0xabfd('0xe')](util['format']('[%s][dials][newexten]',_0x51fab5[_0xabfd('0x5')]),_0x51fab5);utils[_0xabfd('0x3')](util[_0xabfd('0xf')](_0xabfd('0x10'),_0x51fab5[_0xabfd('0x5')],_0x51fab5['application'],_0x51fab5[_0xabfd('0x11')]));if(_0x51fab5[_0xabfd('0x12')]['toLowerCase']()==_0xabfd('0x13')&&_[_0xabfd('0x14')](_0x51fab5[_0xabfd('0x11')][_0xabfd('0x15')](),_0xabfd('0x16'))){var _0x3241e9=_0x51fab5[_0xabfd('0x11')][_0xabfd('0x17')]('=');dials[_0x51fab5[_0xabfd('0x5')]]={'routeId':_0x3241e9[0x1]};}}catch(_0x3b8154){utils['error'](util['format']('[%s][dials][newexten]',_0x51fab5['uniqueid']),_0x3b8154);}};exports[_0xabfd('0x18')]=function(_0x109b69){try{utils[_0xabfd('0xe')](util[_0xabfd('0xf')]('[%s][dials][varset]',_0x109b69[_0xabfd('0x5')]),_0x109b69);if(!_[_0xabfd('0x19')](_0x109b69['variable'][_0xabfd('0x1a')])){utils[_0xabfd('0x3')](util[_0xabfd('0xf')](_0xabfd('0x1b'),_0x109b69[_0xabfd('0x5')],_0x109b69[_0xabfd('0x1c')]));dials[_0x109b69[_0xabfd('0x5')]]={'routeId':_0x109b69['value']};}}catch(_0x11918f){utils[_0xabfd('0x1d')](util[_0xabfd('0xf')]('[%s][dials][varset]',_0x109b69[_0xabfd('0x5')]),_0x11918f);}};exports[_0xabfd('0x1e')]=function(_0x4ee960){try{if(!_[_0xabfd('0x19')](dials[_0x4ee960[_0xabfd('0x5')]])){utils['debug'](util[_0xabfd('0xf')](_0xabfd('0x1f'),_0x4ee960[_0xabfd('0x5')]),_0x4ee960);dials[_0x4ee960[_0xabfd('0x5')]]=_['assign'](dials[_0x4ee960['uniqueid']],_0x4ee960);dials[_0x4ee960[_0xabfd('0x5')]]['starttime']=utils[_0xabfd('0x20')]();dials[_0x4ee960[_0xabfd('0x5')]][_0xabfd('0x21')]='called';utils['info'](util['format'](_0xabfd('0x22'),_0x4ee960[_0xabfd('0x5')],dials[_0x4ee960[_0xabfd('0x5')]][_0xabfd('0x23')]));}}catch(_0xf099f2){utils[_0xabfd('0x1d')](util['format'](_0xabfd('0x1f'),_0x4ee960['uniqueid']),_0xf099f2);}};exports[_0xabfd('0x24')]=function(_0x44a91c){try{if(!_['isNil'](dials[_0x44a91c[_0xabfd('0x5')]])){utils[_0xabfd('0xe')](util['format']('[%s][dials][dialend]',_0x44a91c[_0xabfd('0x5')]),_0x44a91c);dials[_0x44a91c[_0xabfd('0x5')]][_0xabfd('0xa')]=_0x44a91c['dialstatus'];if(_0x44a91c[_0xabfd('0xa')]=='ANSWER'){dials[_0x44a91c[_0xabfd('0x5')]]=_[_0xabfd('0x25')](dials[_0x44a91c[_0xabfd('0x5')]],_0x44a91c);dials[_0x44a91c['uniqueid']][_0xabfd('0x26')]=utils[_0xabfd('0x20')]();dials[_0x44a91c[_0xabfd('0x5')]][_0xabfd('0x21')]=_0xabfd('0x27');utils[_0xabfd('0x3')](util[_0xabfd('0xf')](_0xabfd('0x28'),_0x44a91c[_0xabfd('0x5')],_0x44a91c['dialstatus'],dials[_0x44a91c['uniqueid']][_0xabfd('0x26')]));}else{utils[_0xabfd('0x3')](util[_0xabfd('0xf')](_0xabfd('0x29'),_0x44a91c['uniqueid'],_0x44a91c[_0xabfd('0xa')]));}}}catch(_0x6bc206){utils[_0xabfd('0x1d')](util['format'](_0xabfd('0x2a'),_0x44a91c[_0xabfd('0x5')]),_0x6bc206);}};exports[_0xabfd('0x2b')]=function(_0x479f7a){try{if(!_['isNil'](dials[_0x479f7a[_0xabfd('0x5')]])){utils[_0xabfd('0xe')](util[_0xabfd('0xf')](_0xabfd('0x2c'),_0x479f7a[_0xabfd('0x5')]),_0x479f7a);utils[_0xabfd('0x3')](util['format'](_0xabfd('0x2d'),_0x479f7a[_0xabfd('0x5')],_0x479f7a['calleridnum'],_0x479f7a[_0xabfd('0x2e')],_0x479f7a[_0xabfd('0x2f')]));dials[_0x479f7a[_0xabfd('0x5')]]=_[_0xabfd('0x25')](dials[_0x479f7a['uniqueid']],{'endtime':utils[_0xabfd('0x20')](),'lastevent':_0xabfd('0x30')});dials[_0x479f7a['uniqueid']][_0xabfd('0x31')]=utils[_0xabfd('0x32')](dials[_0x479f7a['uniqueid']][_0xabfd('0x33')],dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x23')]);dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x34')]=utils[_0xabfd('0x32')](dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x26')]||dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x33')],dials[_0x479f7a['uniqueid']][_0xabfd('0x23')]);dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x35')]=dials[_0x479f7a[_0xabfd('0x5')]]['answertime']?utils[_0xabfd('0x32')](dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x33')],dials[_0x479f7a[_0xabfd('0x5')]][_0xabfd('0x26')]):0x0;writeDB(dials[_0x479f7a[_0xabfd('0x5')]]);}}catch(_0x103d03){utils[_0xabfd('0x1d')](util['format'](_0xabfd('0x2c'),_0x479f7a[_0xabfd('0x5')]),_0x103d03);}}; \ No newline at end of file +var _0xffa4=['startsWith','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','error','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','connectedlinenum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','uniqueid','application','appdata','toLowerCase','set'];(function(_0x39cb96,_0x5dbaa9){var _0x3170d5=function(_0x3993f3){while(--_0x3993f3){_0x39cb96['push'](_0x39cb96['shift']());}};_0x3170d5(++_0x5dbaa9);}(_0xffa4,0xe0));var _0x4ffa=function(_0x42f1e7,_0x3a1279){_0x42f1e7=_0x42f1e7-0x0;var _0x460d91=_0xffa4[_0x42f1e7];return _0x460d91;};'use strict';var _=require(_0x4ffa('0x0'));var util=require(_0x4ffa('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x4fb205){utils[_0x4ffa('0x2')](util[_0x4ffa('0x3')](_0x4ffa('0x4'),_0x4fb205['uniqueid'],_0x4fb205['channel'],_0x4fb205[_0x4ffa('0x5')],_0x4fb205['calleridnum'],_0x4fb205[_0x4ffa('0x6')],_0x4fb205['dialstatus']));utils[_0x4ffa('0x7')](_0x4ffa('0x8'),_0x4fb205);delete dials[_0x4fb205['uniqueid']];}exports['newexten']=function(_0x349f06){try{utils[_0x4ffa('0x9')](util['format'](_0x4ffa('0xa'),_0x349f06[_0x4ffa('0xb')]),_0x349f06);utils['info'](util[_0x4ffa('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x349f06[_0x4ffa('0xb')],_0x349f06[_0x4ffa('0xc')],_0x349f06[_0x4ffa('0xd')]));if(_0x349f06[_0x4ffa('0xc')][_0x4ffa('0xe')]()==_0x4ffa('0xf')&&_[_0x4ffa('0x10')](_0x349f06[_0x4ffa('0xd')]['toLowerCase'](),_0x4ffa('0x11'))){var _0x3052a1=_0x349f06['appdata']['split']('=');dials[_0x349f06['uniqueid']]={'routeId':_0x3052a1[0x1]};}}catch(_0x30df15){utils['error'](util[_0x4ffa('0x3')](_0x4ffa('0xa'),_0x349f06['uniqueid']),_0x30df15);}};exports[_0x4ffa('0x12')]=function(_0x3c869a){try{utils[_0x4ffa('0x9')](util[_0x4ffa('0x3')](_0x4ffa('0x13'),_0x3c869a[_0x4ffa('0xb')]),_0x3c869a);if(!_[_0x4ffa('0x14')](_0x3c869a[_0x4ffa('0x15')][_0x4ffa('0x16')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3c869a[_0x4ffa('0xb')],_0x3c869a[_0x4ffa('0x17')]));dials[_0x3c869a[_0x4ffa('0xb')]]={'routeId':_0x3c869a['value']};}}catch(_0x580e9c){utils[_0x4ffa('0x18')](util[_0x4ffa('0x3')](_0x4ffa('0x13'),_0x3c869a['uniqueid']),_0x580e9c);}};exports[_0x4ffa('0x19')]=function(_0x22c41c){try{if(!_['isNil'](dials[_0x22c41c[_0x4ffa('0xb')]])){utils[_0x4ffa('0x9')](util['format']('[%s][dials][dialbegin]',_0x22c41c[_0x4ffa('0xb')]),_0x22c41c);dials[_0x22c41c[_0x4ffa('0xb')]]=_[_0x4ffa('0x1a')](dials[_0x22c41c[_0x4ffa('0xb')]],_0x22c41c);dials[_0x22c41c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]=utils[_0x4ffa('0x1c')]();dials[_0x22c41c[_0x4ffa('0xb')]][_0x4ffa('0x1d')]=_0x4ffa('0x1e');utils[_0x4ffa('0x2')](util[_0x4ffa('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x22c41c[_0x4ffa('0xb')],dials[_0x22c41c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]));}}catch(_0x3dee50){utils[_0x4ffa('0x18')](util['format'](_0x4ffa('0x1f'),_0x22c41c[_0x4ffa('0xb')]),_0x3dee50);}};exports[_0x4ffa('0x20')]=function(_0x32d7dc){try{if(!_['isNil'](dials[_0x32d7dc[_0x4ffa('0xb')]])){utils['debug'](util['format'](_0x4ffa('0x21'),_0x32d7dc[_0x4ffa('0xb')]),_0x32d7dc);dials[_0x32d7dc[_0x4ffa('0xb')]]['dialstatus']=_0x32d7dc[_0x4ffa('0x22')];if(_0x32d7dc[_0x4ffa('0x22')]==_0x4ffa('0x23')){dials[_0x32d7dc['uniqueid']]=_[_0x4ffa('0x1a')](dials[_0x32d7dc['uniqueid']],_0x32d7dc);dials[_0x32d7dc[_0x4ffa('0xb')]][_0x4ffa('0x24')]=utils['now']();dials[_0x32d7dc[_0x4ffa('0xb')]][_0x4ffa('0x1d')]='connect';utils[_0x4ffa('0x2')](util[_0x4ffa('0x3')](_0x4ffa('0x25'),_0x32d7dc[_0x4ffa('0xb')],_0x32d7dc[_0x4ffa('0x22')],dials[_0x32d7dc[_0x4ffa('0xb')]][_0x4ffa('0x24')]));}else{utils['info'](util[_0x4ffa('0x3')](_0x4ffa('0x26'),_0x32d7dc[_0x4ffa('0xb')],_0x32d7dc[_0x4ffa('0x22')]));}}}catch(_0x1d871b){utils[_0x4ffa('0x18')](util[_0x4ffa('0x3')](_0x4ffa('0x21'),_0x32d7dc[_0x4ffa('0xb')]),_0x1d871b);}};exports[_0x4ffa('0x27')]=function(_0x57738c){try{if(!_['isNil'](dials[_0x57738c['uniqueid']])){utils['debug'](util[_0x4ffa('0x3')](_0x4ffa('0x28'),_0x57738c[_0x4ffa('0xb')]),_0x57738c);utils['info'](util[_0x4ffa('0x3')](_0x4ffa('0x29'),_0x57738c[_0x4ffa('0xb')],_0x57738c['calleridnum'],_0x57738c[_0x4ffa('0x2a')],_0x57738c[_0x4ffa('0x2b')]));dials[_0x57738c[_0x4ffa('0xb')]]=_[_0x4ffa('0x1a')](dials[_0x57738c['uniqueid']],{'endtime':utils[_0x4ffa('0x1c')](),'lastevent':_0x4ffa('0x2c')});dials[_0x57738c[_0x4ffa('0xb')]]['duration']=utils[_0x4ffa('0x2d')](dials[_0x57738c['uniqueid']][_0x4ffa('0x2e')],dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]);dials[_0x57738c[_0x4ffa('0xb')]]['holdtime']=utils[_0x4ffa('0x2d')](dials[_0x57738c[_0x4ffa('0xb')]]['answertime']||dials[_0x57738c['uniqueid']][_0x4ffa('0x2e')],dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]);dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x2f')]=dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x24')]?utils[_0x4ffa('0x2d')](dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x2e')],dials[_0x57738c['uniqueid']][_0x4ffa('0x24')]):0x0;writeDB(dials[_0x57738c['uniqueid']]);}}catch(_0x2bc31c){utils[_0x4ffa('0x18')](util[_0x4ffa('0x3')](_0x4ffa('0x28'),_0x57738c[_0x4ffa('0xb')]),_0x2bc31c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 77e9745..740f8e5 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1de9=['env','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','format','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled'];(function(_0x8e3bce,_0x44900a){var _0x3a6424=function(_0x31032b){while(--_0x31032b){_0x8e3bce['push'](_0x8e3bce['shift']());}};_0x3a6424(++_0x44900a);}(_0x1de9,0x116));var _0x91de=function(_0x3685b0,_0x111044){_0x3685b0=_0x3685b0-0x0;var _0x548adb=_0x1de9[_0x3685b0];return _0x548adb;};var AsteriskManager=require(_0x91de('0x0'));var config=require(_0x91de('0x1'));var utils=require(_0x91de('0x2'));var util=require(_0x91de('0x3'));var isXDREnabled=config[_0x91de('0x4')]&&config[_0x91de('0x4')][_0x91de('0x5')]?!config[_0x91de('0x4')][_0x91de('0x5')]:!![];var isProduction=config[_0x91de('0x6')]===_0x91de('0x7')||![];var isLocalAsterisk=config[_0x91de('0x4')]&&config[_0x91de('0x4')][_0x91de('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x91de('0x9')][_0x91de('0xa')],config[_0x91de('0x9')]['ip'],config[_0x91de('0x9')][_0x91de('0xb')],config[_0x91de('0x9')][_0x91de('0xc')],!![]);ami[_0x91de('0xd')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x91de('0xe')](_0x91de('0xf'));}else{var agents=require(_0x91de('0x10'));var calls=require(_0x91de('0x11'));var queues=require('./queues.controller');var recordings=require(_0x91de('0x12'));var members=require('./members.controller');var dials=require(_0x91de('0x13'));var transfers=require(_0x91de('0x14'));var core=require(_0x91de('0x15'));ami['on'](_0x91de('0x16'),core[_0x91de('0x16')]);ami['on'](_0x91de('0x17'),core[_0x91de('0x17')]);ami['on'](_0x91de('0x18'),core['fullybooted']);ami['on'](_0x91de('0x19'),core[_0x91de('0x19')]);ami['on'](_0x91de('0x1a'),core[_0x91de('0x1a')]);ami['on'](_0x91de('0x1b'),core[_0x91de('0x1b')]);ami['on'](_0x91de('0x1c'),function(_0xfff788){try{utils[_0x91de('0x1d')](util['format'](_0x91de('0x1e'),_0xfff788[_0x91de('0x1f')]),_0xfff788);members['devicestatechange'](_0xfff788);}catch(_0xa1b4d3){utils[_0x91de('0x19')](util['format']('[%s][index][devicestatechange]',_0xfff788[_0x91de('0x1f')]),_0xa1b4d3);}});ami['on'](_0x91de('0x20'),function(_0x535aba){try{utils[_0x91de('0x1d')](util['format']('[%s][index][agentcalled]',_0x535aba[_0x91de('0x21')]),_0x535aba);agents[_0x91de('0x20')](_0x535aba);}catch(_0x16b8f3){utils[_0x91de('0x19')](util['format'](_0x91de('0x22'),_0x535aba[_0x91de('0x21')]),_0x16b8f3);}});ami['on'](_0x91de('0x23'),function(_0x4cd494){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][agentringnoanswer]',_0x4cd494['uniqueid']),_0x4cd494);agents['agentringnoanswer'](_0x4cd494);}catch(_0x3c1c44){utils[_0x91de('0x19')](util[_0x91de('0x24')](_0x91de('0x25'),_0x4cd494[_0x91de('0x21')]),_0x3c1c44);}});ami['on'](_0x91de('0x26'),function(_0x3a46aa){try{utils[_0x91de('0x1d')](util['format'](_0x91de('0x27'),_0x3a46aa[_0x91de('0x21')]),_0x3a46aa);agents[_0x91de('0x26')](_0x3a46aa);queues[_0x91de('0x26')](_0x3a46aa);}catch(_0x4886a0){utils[_0x91de('0x19')](util[_0x91de('0x24')]('[%s][index][agentconnect]',_0x3a46aa['uniqueid']),_0x4886a0);}});ami['on'](_0x91de('0x28'),function(_0x537375){try{utils[_0x91de('0x1d')](util['format']('[%s][index][agentcomplete]',_0x537375[_0x91de('0x21')]),_0x537375);agents[_0x91de('0x28')](_0x537375);queues[_0x91de('0x28')](_0x537375);members[_0x91de('0x28')](_0x537375);}catch(_0x3e5a9e){utils[_0x91de('0x19')](util[_0x91de('0x24')](_0x91de('0x29'),_0x537375[_0x91de('0x21')]),_0x3e5a9e);}});ami['on'](_0x91de('0x2a'),function(_0xfa2ac5){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][queuecallerabandon]',_0xfa2ac5[_0x91de('0x21')]),_0xfa2ac5);agents[_0x91de('0x2a')](_0xfa2ac5);queues[_0x91de('0x2a')](_0xfa2ac5);}catch(_0x1acfce){utils['error'](util[_0x91de('0x24')](_0x91de('0x2b'),_0xfa2ac5['uniqueid']),_0x1acfce);}});ami['on']('queuecallerjoin',function(_0x459de0){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][queuecallerjoin]',_0x459de0[_0x91de('0x21')]),_0x459de0);queues[_0x91de('0x2c')](_0x459de0);recordings[_0x91de('0x2c')](_0x459de0);}catch(_0x5b688b){utils[_0x91de('0x19')](util['format'](_0x91de('0x2d'),_0x459de0[_0x91de('0x21')]),_0x5b688b);}});ami['on'](_0x91de('0x2e'),function(_0x257cfb){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][queuecallerleave]',_0x257cfb[_0x91de('0x21')]),_0x257cfb);queues[_0x91de('0x2e')](_0x257cfb);}catch(_0x3d2d22){utils[_0x91de('0x19')](util['format'](_0x91de('0x2f'),_0x257cfb['uniqueid']),_0x3d2d22);}});ami['on'](_0x91de('0x30'),function(_0x14270c){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][musiconholdstart]',_0x14270c[_0x91de('0x21')]),_0x14270c);queues[_0x91de('0x30')](_0x14270c);calls[_0x91de('0x30')](_0x14270c);}catch(_0x18c203){utils[_0x91de('0x19')](util[_0x91de('0x24')](_0x91de('0x31'),_0x14270c[_0x91de('0x21')]),_0x18c203);}});ami['on']('musiconholdstop',function(_0x2a0649){try{utils['debug'](util['format'](_0x91de('0x32'),_0x2a0649[_0x91de('0x21')]),_0x2a0649);queues[_0x91de('0x33')](_0x2a0649);calls['musiconholdstop'](_0x2a0649);}catch(_0x419e9c){utils[_0x91de('0x19')](util[_0x91de('0x24')]('[%s][index][musiconholdstop]',_0x2a0649['uniqueid']),_0x419e9c);}});ami['on']('newstate',function(_0x34fa0e){try{utils['debug'](util[_0x91de('0x24')](_0x91de('0x34'),_0x34fa0e[_0x91de('0x21')]),_0x34fa0e);calls[_0x91de('0x35')](_0x34fa0e);recordings[_0x91de('0x35')](_0x34fa0e);}catch(_0x57b516){utils[_0x91de('0x19')](util[_0x91de('0x24')](_0x91de('0x34'),_0x34fa0e[_0x91de('0x21')]),_0x57b516);}});ami['on']('hangup',function(_0x75904d){try{utils['debug'](util['format'](_0x91de('0x36'),_0x75904d[_0x91de('0x21')]),_0x75904d);calls['hangup'](_0x75904d);recordings[_0x91de('0x37')](_0x75904d);dials[_0x91de('0x37')](_0x75904d);agents[_0x91de('0x37')](_0x75904d);queues[_0x91de('0x37')](_0x75904d);}catch(_0x3f9421){utils[_0x91de('0x19')](util[_0x91de('0x24')]('[%s][index][hangup]',_0x75904d[_0x91de('0x21')]),_0x3f9421);}});ami['on'](_0x91de('0x38'),function(_0x281c2b){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][cdr]',_0x281c2b[_0x91de('0x21')]),_0x281c2b);members[_0x91de('0x38')](_0x281c2b);}catch(_0x14778c){utils['error'](util['format'](_0x91de('0x39'),_0x281c2b[_0x91de('0x21')]),_0x14778c);}});ami['on'](_0x91de('0x3a'),function(_0x1239ce){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')](_0x91de('0x3b'),_0x1239ce[_0x91de('0x21')]),_0x1239ce);queues[_0x91de('0x3a')](_0x1239ce);agents[_0x91de('0x3a')](_0x1239ce);transfers['blindtransfer'](_0x1239ce);recordings[_0x91de('0x3a')](_0x1239ce);}catch(_0x1d180e){utils[_0x91de('0x19')](util[_0x91de('0x24')](_0x91de('0x3b'),_0x1239ce['uniqueid']),_0x1d180e);}});ami['on']('attendedtransfer',function(_0x129c36){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')](_0x91de('0x3c'),_0x129c36[_0x91de('0x3d')]),_0x129c36);queues[_0x91de('0x3e')](_0x129c36);transfers[_0x91de('0x3e')](_0x129c36);agents[_0x91de('0x3e')](_0x129c36);calls[_0x91de('0x3e')](_0x129c36);}catch(_0x57372a){utils[_0x91de('0x19')](util['format'](_0x91de('0x3c'),_0x129c36[_0x91de('0x3d')]),_0x57372a);}});ami['on'](_0x91de('0x3f'),function(_0x256796){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][varset]',_0x256796['uniqueid']),_0x256796);queues['varset'](_0x256796);recordings[_0x91de('0x3f')](_0x256796);calls[_0x91de('0x3f')](_0x256796);dials[_0x91de('0x3f')](_0x256796);}catch(_0x3d3460){utils[_0x91de('0x19')](util['format']('[%s][index][varset]',_0x256796['uniqueid']),_0x3d3460);}});ami['on'](_0x91de('0x40'),function(_0x282584){try{utils['debug'](util[_0x91de('0x24')]('[%s][index][newexten]',_0x282584[_0x91de('0x21')]),_0x282584);calls['newexten'](_0x282584);recordings['newexten'](_0x282584);dials['newexten'](_0x282584);}catch(_0x1bcb83){utils[_0x91de('0x19')](util[_0x91de('0x24')](_0x91de('0x41'),_0x282584[_0x91de('0x21')]),_0x1bcb83);}});ami['on']('newchannel',function(_0x5bbed2){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')](_0x91de('0x42'),_0x5bbed2[_0x91de('0x21')]),_0x5bbed2);calls[_0x91de('0x43')](_0x5bbed2);recordings[_0x91de('0x43')](_0x5bbed2);}catch(_0x420e63){utils[_0x91de('0x19')](util[_0x91de('0x24')]('[%s][index][newchannel]',_0x5bbed2[_0x91de('0x21')]),_0x420e63);}});ami['on']('dialbegin',function(_0x4d2e42){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')]('[%s][index][dialbegin]',_0x4d2e42[_0x91de('0x21')]),_0x4d2e42);dials[_0x91de('0x44')](_0x4d2e42);}catch(_0x3a7756){utils[_0x91de('0x19')](util[_0x91de('0x24')]('[%s]dialbegin',_0x4d2e42[_0x91de('0x21')]),_0x3a7756);}});ami['on'](_0x91de('0x45'),function(_0x2d36f5){try{utils[_0x91de('0x1d')](util[_0x91de('0x24')](_0x91de('0x46'),_0x2d36f5[_0x91de('0x21')]),_0x2d36f5);dials[_0x91de('0x45')](_0x2d36f5);}catch(_0x49fc9b){utils[_0x91de('0x19')](util['format'](_0x91de('0x46'),_0x2d36f5[_0x91de('0x21')]),_0x49fc9b);}});} \ No newline at end of file +var _0x8250=['error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','xdr','disabled','env','production','local','asterisk','port','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted'];(function(_0x351194,_0x42baf5){var _0x1c35e2=function(_0x5608a9){while(--_0x5608a9){_0x351194['push'](_0x351194['shift']());}};_0x1c35e2(++_0x42baf5);}(_0x8250,0xf5));var _0x0825=function(_0xd8b4f,_0x3fe442){_0xd8b4f=_0xd8b4f-0x0;var _0x172698=_0x8250[_0xd8b4f];return _0x172698;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x0825('0x0'));var util=require('util');var isXDREnabled=config[_0x0825('0x1')]&&config['xdr']['disabled']?!config[_0x0825('0x1')][_0x0825('0x2')]:!![];var isProduction=config[_0x0825('0x3')]===_0x0825('0x4')||![];var isLocalAsterisk=config['xdr']&&config[_0x0825('0x1')][_0x0825('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0x0825('0x6')][_0x0825('0x7')],config[_0x0825('0x6')]['ip'],config[_0x0825('0x6')]['username'],config[_0x0825('0x6')][_0x0825('0x8')],!![]);ami[_0x0825('0x9')]();if(!isXDREnabled){utils['info'](_0x0825('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x0825('0xb')](_0x0825('0xc'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x0825('0xd'));var dials=require(_0x0825('0xe'));var transfers=require('./transfers.controller');var core=require(_0x0825('0xf'));ami['on']('connect',core[_0x0825('0x10')]);ami['on'](_0x0825('0x11'),core[_0x0825('0x11')]);ami['on'](_0x0825('0x12'),core[_0x0825('0x12')]);ami['on'](_0x0825('0x13'),core[_0x0825('0x13')]);ami['on'](_0x0825('0x14'),core['close']);ami['on'](_0x0825('0x15'),core[_0x0825('0x15')]);ami['on'](_0x0825('0x16'),function(_0x1a419a){try{utils[_0x0825('0x17')](util['format'](_0x0825('0x18'),_0x1a419a[_0x0825('0x19')]),_0x1a419a);members[_0x0825('0x16')](_0x1a419a);}catch(_0x5579eb){utils[_0x0825('0x13')](util['format']('[%s][index][devicestatechange]',_0x1a419a[_0x0825('0x19')]),_0x5579eb);}});ami['on'](_0x0825('0x1a'),function(_0x28abe9){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x1c'),_0x28abe9[_0x0825('0x1d')]),_0x28abe9);agents[_0x0825('0x1a')](_0x28abe9);}catch(_0x4364b1){utils['error'](util[_0x0825('0x1b')](_0x0825('0x1c'),_0x28abe9['uniqueid']),_0x4364b1);}});ami['on'](_0x0825('0x1e'),function(_0x4c5fe3){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x1f'),_0x4c5fe3[_0x0825('0x1d')]),_0x4c5fe3);agents[_0x0825('0x1e')](_0x4c5fe3);}catch(_0x4b144e){utils[_0x0825('0x13')](util[_0x0825('0x1b')]('[%s][index][agentringnoanswer]',_0x4c5fe3[_0x0825('0x1d')]),_0x4b144e);}});ami['on'](_0x0825('0x20'),function(_0x5afd57){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x21'),_0x5afd57[_0x0825('0x1d')]),_0x5afd57);agents[_0x0825('0x20')](_0x5afd57);queues[_0x0825('0x20')](_0x5afd57);}catch(_0x38ae86){utils[_0x0825('0x13')](util['format']('[%s][index][agentconnect]',_0x5afd57[_0x0825('0x1d')]),_0x38ae86);}});ami['on'](_0x0825('0x22'),function(_0x2717fd){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][agentcomplete]',_0x2717fd[_0x0825('0x1d')]),_0x2717fd);agents[_0x0825('0x22')](_0x2717fd);queues[_0x0825('0x22')](_0x2717fd);members[_0x0825('0x22')](_0x2717fd);}catch(_0x3a89ae){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x23'),_0x2717fd[_0x0825('0x1d')]),_0x3a89ae);}});ami['on'](_0x0825('0x24'),function(_0xc072a3){try{utils[_0x0825('0x17')](util['format'](_0x0825('0x25'),_0xc072a3['uniqueid']),_0xc072a3);agents[_0x0825('0x24')](_0xc072a3);queues[_0x0825('0x24')](_0xc072a3);}catch(_0x1b03b6){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x25'),_0xc072a3['uniqueid']),_0x1b03b6);}});ami['on']('queuecallerjoin',function(_0x4e9280){try{utils['debug'](util[_0x0825('0x1b')](_0x0825('0x26'),_0x4e9280[_0x0825('0x1d')]),_0x4e9280);queues['queuecallerjoin'](_0x4e9280);recordings[_0x0825('0x27')](_0x4e9280);}catch(_0x292950){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x26'),_0x4e9280['uniqueid']),_0x292950);}});ami['on'](_0x0825('0x28'),function(_0x585364){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x29'),_0x585364[_0x0825('0x1d')]),_0x585364);queues[_0x0825('0x28')](_0x585364);}catch(_0x13d347){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x29'),_0x585364['uniqueid']),_0x13d347);}});ami['on'](_0x0825('0x2a'),function(_0x45eef1){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][musiconholdstart]',_0x45eef1[_0x0825('0x1d')]),_0x45eef1);queues[_0x0825('0x2a')](_0x45eef1);calls[_0x0825('0x2a')](_0x45eef1);}catch(_0x40c3b6){utils['error'](util[_0x0825('0x1b')](_0x0825('0x2b'),_0x45eef1[_0x0825('0x1d')]),_0x40c3b6);}});ami['on'](_0x0825('0x2c'),function(_0x5783d0){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x2d'),_0x5783d0[_0x0825('0x1d')]),_0x5783d0);queues[_0x0825('0x2c')](_0x5783d0);calls[_0x0825('0x2c')](_0x5783d0);}catch(_0x5acda3){utils[_0x0825('0x13')](util['format'](_0x0825('0x2d'),_0x5783d0['uniqueid']),_0x5acda3);}});ami['on'](_0x0825('0x2e'),function(_0x3f19b6){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][newstate]',_0x3f19b6[_0x0825('0x1d')]),_0x3f19b6);calls[_0x0825('0x2e')](_0x3f19b6);recordings[_0x0825('0x2e')](_0x3f19b6);}catch(_0x234472){utils['error'](util[_0x0825('0x1b')]('[%s][index][newstate]',_0x3f19b6[_0x0825('0x1d')]),_0x234472);}});ami['on']('hangup',function(_0x512087){try{utils['debug'](util[_0x0825('0x1b')]('[%s][index][hangup]',_0x512087[_0x0825('0x1d')]),_0x512087);calls[_0x0825('0x2f')](_0x512087);recordings[_0x0825('0x2f')](_0x512087);dials[_0x0825('0x2f')](_0x512087);agents['hangup'](_0x512087);queues['hangup'](_0x512087);}catch(_0x2c7aa8){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x30'),_0x512087['uniqueid']),_0x2c7aa8);}});ami['on'](_0x0825('0x31'),function(_0x323b60){try{utils[_0x0825('0x17')](util['format'](_0x0825('0x32'),_0x323b60[_0x0825('0x1d')]),_0x323b60);members[_0x0825('0x31')](_0x323b60);}catch(_0xf1986f){utils[_0x0825('0x13')](util['format'](_0x0825('0x32'),_0x323b60[_0x0825('0x1d')]),_0xf1986f);}});ami['on'](_0x0825('0x33'),function(_0xb35a4){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x34'),_0xb35a4[_0x0825('0x1d')]),_0xb35a4);queues[_0x0825('0x33')](_0xb35a4);agents[_0x0825('0x33')](_0xb35a4);transfers['blindtransfer'](_0xb35a4);recordings[_0x0825('0x33')](_0xb35a4);}catch(_0x1a7e02){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x34'),_0xb35a4[_0x0825('0x1d')]),_0x1a7e02);}});ami['on'](_0x0825('0x35'),function(_0x2f25f6){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][attendedtransfer]',_0x2f25f6[_0x0825('0x36')]),_0x2f25f6);queues[_0x0825('0x35')](_0x2f25f6);transfers[_0x0825('0x35')](_0x2f25f6);agents[_0x0825('0x35')](_0x2f25f6);calls[_0x0825('0x35')](_0x2f25f6);}catch(_0x56d8bf){utils[_0x0825('0x13')](util[_0x0825('0x1b')]('[%s][index][attendedtransfer]',_0x2f25f6[_0x0825('0x36')]),_0x56d8bf);}});ami['on']('varset',function(_0xc7f78f){try{utils['debug'](util[_0x0825('0x1b')]('[%s][index][varset]',_0xc7f78f[_0x0825('0x1d')]),_0xc7f78f);queues[_0x0825('0x37')](_0xc7f78f);recordings['varset'](_0xc7f78f);calls[_0x0825('0x37')](_0xc7f78f);dials[_0x0825('0x37')](_0xc7f78f);}catch(_0x299c88){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x38'),_0xc7f78f[_0x0825('0x1d')]),_0x299c88);}});ami['on']('newexten',function(_0x577210){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x39'),_0x577210[_0x0825('0x1d')]),_0x577210);calls[_0x0825('0x3a')](_0x577210);recordings['newexten'](_0x577210);dials[_0x0825('0x3a')](_0x577210);}catch(_0x23db92){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x39'),_0x577210['uniqueid']),_0x23db92);}});ami['on']('newchannel',function(_0x405a23){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x3b'),_0x405a23[_0x0825('0x1d')]),_0x405a23);calls[_0x0825('0x3c')](_0x405a23);recordings['newchannel'](_0x405a23);}catch(_0x419f1a){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x3b'),_0x405a23['uniqueid']),_0x419f1a);}});ami['on']('dialbegin',function(_0x41d2d5){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x3d'),_0x41d2d5['uniqueid']),_0x41d2d5);dials[_0x0825('0x3e')](_0x41d2d5);}catch(_0x19c810){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x3f'),_0x41d2d5[_0x0825('0x1d')]),_0x19c810);}});ami['on'](_0x0825('0x40'),function(_0x95368d){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x41'),_0x95368d[_0x0825('0x1d')]),_0x95368d);dials[_0x0825('0x40')](_0x95368d);}catch(_0x5894d8){utils[_0x0825('0x13')](util[_0x0825('0x1b')]('[%s][index][dialend]',_0x95368d['uniqueid']),_0x5894d8);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 13c72fe..e7df456 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f90=['now','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','channel','data1','data3','destinationchannel','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','name','split','internal','request','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','isNil','exitAt'];(function(_0x2826d9,_0x28f60f){var _0x96122b=function(_0x59c6e0){while(--_0x59c6e0){_0x2826d9['push'](_0x2826d9['shift']());}};_0x96122b(++_0x28f60f);}(_0x5f90,0xae));var _0x05f9=function(_0x35c137,_0x5f2bd0){_0x35c137=_0x35c137-0x0;var _0x36f749=_0x5f90[_0x35c137];return _0x36f749;};'use strict';var _=require(_0x05f9('0x0'));var util=require('util');var utils=require(_0x05f9('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x05f9('0x2')];function writeDB(_0x53c7be){utils[_0x05f9('0x3')](util[_0x05f9('0x4')](_0x05f9('0x5'),_0x53c7be[_0x05f9('0x6')],_0x53c7be[_0x05f9('0x7')],_0x53c7be['channel'],_0x53c7be[_0x05f9('0x8')],_0x53c7be[_0x05f9('0x9')],_0x53c7be[_0x05f9('0xa')]));if(_0x53c7be[_0x05f9('0x7')]){utils[_0x05f9('0xb')](_0x53c7be[_0x05f9('0x7')])['then'](function(_0x495768){if(_0x495768){_0x53c7be[_0x05f9('0x9')]=_0x495768[_0x05f9('0xc')];_0x53c7be['internal']=_0x495768['internal'];utils['request']('CreateMemberReport',_0x53c7be);}else{utils['getUserByName'](_0x53c7be[_0x05f9('0x7')][_0x05f9('0xd')]('/')[0x1])['then'](function(_0x5a63bc){if(_0x5a63bc){_0x53c7be[_0x05f9('0x9')]=_0x5a63bc['name'];_0x53c7be[_0x05f9('0xe')]=_0x5a63bc[_0x05f9('0xe')];utils[_0x05f9('0xf')](_0x05f9('0x10'),_0x53c7be);}});}})[_0x05f9('0x11')](function(_0x1659f8){utils[_0x05f9('0x12')](util['format'](_0x05f9('0x13'),_0x53c7be['uniqueid']),_0x1659f8);});}delete members[_0x53c7be[_0x05f9('0x7')]];}function startsWith(_0x5bbb6d,_0xe18ce9){return _[_0x05f9('0x14')](_0x5bbb6d,function(_0x548233){return _[_0x05f9('0x15')](_0xe18ce9,_0x548233);});}exports[_0x05f9('0x16')]=function(_0x12a553){try{utils[_0x05f9('0x17')](util[_0x05f9('0x4')]('[%s][members][devicestatechange]',members[_0x12a553['device']]?members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x6')]:_0x12a553[_0x05f9('0x18')]),_0x12a553);utils[_0x05f9('0x3')](util['format'](_0x05f9('0x19'),members[_0x12a553[_0x05f9('0x18')]]?members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x6')]:_0x12a553[_0x05f9('0x18')],_0x12a553[_0x05f9('0x1a')],_0x12a553[_0x05f9('0x18')]));switch(_0x12a553['state']){case _0x05f9('0x1b'):case _0x05f9('0x1c'):if(!startsWith(exclude,_0x12a553[_0x05f9('0x18')])){members[_0x12a553[_0x05f9('0x18')]]={'channel':_0x05f9('0x1d'),'interface':_0x12a553[_0x05f9('0x18')],'type':_0x05f9('0x1e'),'enterAt':utils['now'](),'role':_0x05f9('0x1f')};}break;case'NOT_INUSE':if(!_[_0x05f9('0x20')](members[_0x12a553[_0x05f9('0x18')]])){members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x21')]=utils[_0x05f9('0x22')]();members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x23')]=utils[_0x05f9('0x24')](members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x21')],members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x25')]);if(members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x6')]){writeDB(members[_0x12a553[_0x05f9('0x18')]]);}}break;default:break;}}catch(_0x522dfa){utils[_0x05f9('0x12')](util[_0x05f9('0x4')]('[%s][members][devicestatechange]',members[_0x12a553[_0x05f9('0x18')]]?members[_0x12a553[_0x05f9('0x18')]][_0x05f9('0x6')]:_0x12a553[_0x05f9('0x18')]),_0x522dfa);}};exports[_0x05f9('0x26')]=function(_0x3ec0fa){try{if(!_[_0x05f9('0x20')](members[_0x3ec0fa[_0x05f9('0x7')]])){utils['debug'](util[_0x05f9('0x4')](_0x05f9('0x27'),_0x3ec0fa['uniqueid']),_0x3ec0fa);utils[_0x05f9('0x3')](util[_0x05f9('0x4')](_0x05f9('0x28'),_0x3ec0fa[_0x05f9('0x6')],_0x3ec0fa[_0x05f9('0x7')],_0x3ec0fa['queue']));members[_0x3ec0fa['interface']]=_[_0x05f9('0x29')](members[_0x3ec0fa[_0x05f9('0x7')]],{'data4':_0x3ec0fa[_0x05f9('0x2a')],'uniqueid':_0x3ec0fa[_0x05f9('0x6')]});}}catch(_0x4c9422){utils[_0x05f9('0x12')](util[_0x05f9('0x4')](_0x05f9('0x27'),_0x3ec0fa[_0x05f9('0x6')]),_0x4c9422);}};exports[_0x05f9('0x2b')]=function(_0x28f595){try{utils[_0x05f9('0x17')](util[_0x05f9('0x4')](_0x05f9('0x2c'),_0x28f595[_0x05f9('0x6')]),_0x28f595);if(_0x28f595[_0x05f9('0x2d')]){var _0x153242=_0x28f595[_0x05f9('0x2d')][_0x05f9('0xd')]('-')[0x0];if(!_[_0x05f9('0x20')](members[_0x153242])){members[_0x153242]=_['assign'](members[_0x153242],{'data1':members[_0x153242][_0x05f9('0x2e')]||_0x28f595[_0x05f9('0xa')],'data2':members[_0x153242][_0x05f9('0x8')]||_0x28f595['source'],'data3':members[_0x153242][_0x05f9('0x2f')]||_0x28f595['destination'],'uniqueid':members[_0x153242]['uniqueid']||_0x28f595['uniqueid']});utils[_0x05f9('0x3')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x28f595[_0x05f9('0x6')],members[_0x153242][_0x05f9('0x2e')],members[_0x153242]['data2'],members[_0x153242][_0x05f9('0x2f')]));if(members[_0x153242][_0x05f9('0x21')]){writeDB(members[_0x153242]);}}}if(_0x28f595[_0x05f9('0x30')]){var _0x1091ad=_0x28f595['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x1091ad])){members[_0x1091ad]=_[_0x05f9('0x29')](members[_0x1091ad],{'data1':members[_0x1091ad]['data1']||_0x28f595[_0x05f9('0xa')],'data2':members[_0x1091ad][_0x05f9('0x8')]||_0x28f595[_0x05f9('0x31')],'data3':members[_0x1091ad][_0x05f9('0x2f')]||_0x28f595[_0x05f9('0x32')],'uniqueid':members[_0x1091ad][_0x05f9('0x6')]||_0x28f595[_0x05f9('0x6')]});utils['info'](util['format'](_0x05f9('0x33'),_0x28f595[_0x05f9('0x6')],members[_0x1091ad]['data1'],members[_0x1091ad][_0x05f9('0x8')],members[_0x1091ad][_0x05f9('0x2f')]));if(members[_0x1091ad][_0x05f9('0x21')]){writeDB(members[_0x1091ad]);}}}}catch(_0x556e3b){utils[_0x05f9('0x12')](util[_0x05f9('0x4')]('[%s][members][cdr]',_0x28f595[_0x05f9('0x6')]),_0x556e3b);}}; \ No newline at end of file +var _0x5294=['request','CreateMemberReport','getUserByName','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','split','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','type','interface','getUserByInterface','then','membername','name','internal'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x5294,0x1e4));var _0x4529=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x5294[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x4529('0x0'));var utils=require(_0x4529('0x1'));var members={};var exclude=[_0x4529('0x2'),_0x4529('0x3')];function writeDB(_0x34fff9){utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x6'),_0x34fff9[_0x4529('0x7')],_0x34fff9['interface'],_0x34fff9[_0x4529('0x8')],_0x34fff9['data2'],_0x34fff9['membername'],_0x34fff9[_0x4529('0x9')]));if(_0x34fff9[_0x4529('0xa')]){utils[_0x4529('0xb')](_0x34fff9[_0x4529('0xa')])[_0x4529('0xc')](function(_0xd9d303){if(_0xd9d303){_0x34fff9[_0x4529('0xd')]=_0xd9d303[_0x4529('0xe')];_0x34fff9[_0x4529('0xf')]=_0xd9d303['internal'];utils[_0x4529('0x10')](_0x4529('0x11'),_0x34fff9);}else{utils[_0x4529('0x12')](_0x34fff9[_0x4529('0xa')]['split']('/')[0x1])[_0x4529('0xc')](function(_0x2057e7){if(_0x2057e7){_0x34fff9[_0x4529('0xd')]=_0x2057e7[_0x4529('0xe')];_0x34fff9[_0x4529('0xf')]=_0x2057e7['internal'];utils[_0x4529('0x10')](_0x4529('0x11'),_0x34fff9);}});}})['catch'](function(_0x1c1657){utils[_0x4529('0x13')](util[_0x4529('0x5')](_0x4529('0x14'),_0x34fff9[_0x4529('0x7')]),_0x1c1657);});}delete members[_0x34fff9[_0x4529('0xa')]];}function startsWith(_0x1be42f,_0x19ff24){return _[_0x4529('0x15')](_0x1be42f,function(_0x47a8b9){return _[_0x4529('0x16')](_0x19ff24,_0x47a8b9);});}exports['devicestatechange']=function(_0x42af66){try{utils[_0x4529('0x17')](util['format'](_0x4529('0x18'),members[_0x42af66[_0x4529('0x19')]]?members[_0x42af66[_0x4529('0x19')]]['uniqueid']:_0x42af66[_0x4529('0x19')]),_0x42af66);utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x1a'),members[_0x42af66[_0x4529('0x19')]]?members[_0x42af66[_0x4529('0x19')]]['uniqueid']:_0x42af66[_0x4529('0x19')],_0x42af66[_0x4529('0x1b')],_0x42af66[_0x4529('0x19')]));switch(_0x42af66[_0x4529('0x1b')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x42af66[_0x4529('0x19')])){members[_0x42af66['device']]={'channel':_0x4529('0x1c'),'interface':_0x42af66[_0x4529('0x19')],'type':_0x4529('0x1d'),'enterAt':utils['now'](),'role':_0x4529('0x1e')};}break;case _0x4529('0x1f'):if(!_[_0x4529('0x20')](members[_0x42af66[_0x4529('0x19')]])){members[_0x42af66[_0x4529('0x19')]][_0x4529('0x21')]=utils['now']();members[_0x42af66['device']][_0x4529('0x22')]=utils[_0x4529('0x23')](members[_0x42af66[_0x4529('0x19')]][_0x4529('0x21')],members[_0x42af66['device']][_0x4529('0x24')]);if(members[_0x42af66[_0x4529('0x19')]][_0x4529('0x7')]){writeDB(members[_0x42af66[_0x4529('0x19')]]);}}break;default:break;}}catch(_0x3cd09b){utils[_0x4529('0x13')](util['format'](_0x4529('0x18'),members[_0x42af66[_0x4529('0x19')]]?members[_0x42af66[_0x4529('0x19')]][_0x4529('0x7')]:_0x42af66[_0x4529('0x19')]),_0x3cd09b);}};exports['agentcomplete']=function(_0x175982){try{if(!_['isNil'](members[_0x175982[_0x4529('0xa')]])){utils[_0x4529('0x17')](util['format'](_0x4529('0x25'),_0x175982[_0x4529('0x7')]),_0x175982);utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x26'),_0x175982[_0x4529('0x7')],_0x175982[_0x4529('0xa')],_0x175982[_0x4529('0x27')]));members[_0x175982['interface']]=_[_0x4529('0x28')](members[_0x175982[_0x4529('0xa')]],{'data4':_0x175982[_0x4529('0x27')],'uniqueid':_0x175982[_0x4529('0x7')]});}}catch(_0x1562e9){utils['error'](util[_0x4529('0x5')](_0x4529('0x25'),_0x175982[_0x4529('0x7')]),_0x1562e9);}};exports['cdr']=function(_0x320736){try{utils['debug'](util['format']('[%s][members][cdr]',_0x320736[_0x4529('0x7')]),_0x320736);if(_0x320736[_0x4529('0x8')]){var _0x7d1f31=_0x320736['channel'][_0x4529('0x29')]('-')[0x0];if(!_[_0x4529('0x20')](members[_0x7d1f31])){members[_0x7d1f31]=_[_0x4529('0x28')](members[_0x7d1f31],{'data1':members[_0x7d1f31]['data1']||_0x320736[_0x4529('0x9')],'data2':members[_0x7d1f31][_0x4529('0x2a')]||_0x320736[_0x4529('0x2b')],'data3':members[_0x7d1f31][_0x4529('0x2c')]||_0x320736[_0x4529('0x2d')],'uniqueid':members[_0x7d1f31][_0x4529('0x7')]||_0x320736[_0x4529('0x7')]});utils['info'](util['format'](_0x4529('0x2e'),_0x320736[_0x4529('0x7')],members[_0x7d1f31][_0x4529('0x2f')],members[_0x7d1f31][_0x4529('0x2a')],members[_0x7d1f31][_0x4529('0x2c')]));if(members[_0x7d1f31][_0x4529('0x21')]){writeDB(members[_0x7d1f31]);}}}if(_0x320736[_0x4529('0x30')]){var _0x3238e5=_0x320736[_0x4529('0x30')][_0x4529('0x29')]('-')[0x0];if(!_['isNil'](members[_0x3238e5])){members[_0x3238e5]=_[_0x4529('0x28')](members[_0x3238e5],{'data1':members[_0x3238e5][_0x4529('0x2f')]||_0x320736[_0x4529('0x9')],'data2':members[_0x3238e5][_0x4529('0x2a')]||_0x320736[_0x4529('0x2b')],'data3':members[_0x3238e5][_0x4529('0x2c')]||_0x320736[_0x4529('0x2d')],'uniqueid':members[_0x3238e5][_0x4529('0x7')]||_0x320736[_0x4529('0x7')]});utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x2e'),_0x320736['uniqueid'],members[_0x3238e5]['data1'],members[_0x3238e5][_0x4529('0x2a')],members[_0x3238e5][_0x4529('0x2c')]));if(members[_0x3238e5][_0x4529('0x21')]){writeDB(members[_0x3238e5]);}}}}catch(_0x35a45b){utils[_0x4529('0x13')](util[_0x4529('0x5')](_0x4529('0x31'),_0x320736[_0x4529('0x7')]),_0x35a45b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3bebd7c..38da607 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb036=['CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%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','holdtime','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','queuestatus','value','toUpperCase'];(function(_0x1ea04b,_0xc34175){var _0x534868=function(_0x3c5319){while(--_0x3c5319){_0x1ea04b['push'](_0x1ea04b['shift']());}};_0x534868(++_0xc34175);}(_0xb036,0xaf));var _0x6b03=function(_0x1d446b,_0x5e4581){_0x1d446b=_0x1d446b-0x0;var _0x8e658a=_0xb036[_0x1d446b];return _0x8e658a;};'use strict';var _=require(_0x6b03('0x0'));var util=require(_0x6b03('0x1'));var utils=require(_0x6b03('0x2'));var queues={};function writeDB(_0x1693cd){utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x5'),_0x1693cd[_0x6b03('0x6')],_0x1693cd[_0x6b03('0x7')],_0x1693cd[_0x6b03('0x8')],_0x1693cd[_0x6b03('0x9')],_0x1693cd['calleridnum'],_0x1693cd[_0x6b03('0xa')],_0x1693cd[_0x6b03('0xb')]));if(_0x1693cd[_0x6b03('0x8')]){utils['getVoiceQueueByName'](_0x1693cd['queue'])['then'](function(_0x59d75e){if(_0x59d75e){_0x1693cd[_0x6b03('0xc')]=_0x59d75e[_0x6b03('0xc')];}utils['request'](_0x6b03('0xd'),_0x1693cd);});}else{utils[_0x6b03('0xe')](_0x6b03('0xd'),_0x1693cd);}if(_0x1693cd[_0x6b03('0xf')]){delete queues[_0x1693cd[_0x6b03('0xf')]];}else{delete queues[_0x1693cd['uniqueid']];}}exports[_0x6b03('0x10')]=function(_0x301edd){try{utils[_0x6b03('0x11')](util['format']('[%s][queues][queuecallerjoin]',_0x301edd[_0x6b03('0x6')]),_0x301edd);utils[_0x6b03('0x3')](util[_0x6b03('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x301edd[_0x6b03('0x6')],_0x301edd['queue'],_0x301edd[_0x6b03('0x12')]));queues[_0x301edd[_0x6b03('0x6')]]=_[_0x6b03('0x13')](_0x301edd,{'originalposition':_0x301edd[_0x6b03('0x12')],'queuecallerjoinAt':utils[_0x6b03('0x14')](),'mohtime':0x0});}catch(_0x39b666){utils[_0x6b03('0x15')](util['format']('[%s][queues][queuecallerjoin]',_0x301edd[_0x6b03('0x6')]),_0x39b666);}};exports[_0x6b03('0x16')]=function(_0x229c3a){try{if(!_[_0x6b03('0x17')](queues[_0x229c3a[_0x6b03('0x6')]])){utils['debug'](util[_0x6b03('0x4')]('[%s][queues][hangup]',_0x229c3a[_0x6b03('0x6')]),_0x229c3a);if(queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0x18')]){if(!queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0x19')]&&!queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0x1a')]){queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0x1b')]=!![];queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0x1c')]=utils[_0x6b03('0x14')]();queues[_0x229c3a[_0x6b03('0x6')]]['queuecallerexitreason']=_0x6b03('0x1d');}utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x1e'),_0x229c3a[_0x6b03('0x6')],queues[_0x229c3a['uniqueid']][_0x6b03('0x1f')],queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0xb')]));writeDB(queues[_0x229c3a[_0x6b03('0x6')]]);}else if(queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0xf')]){utils['info'](util[_0x6b03('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x229c3a['uniqueid'],queues[_0x229c3a[_0x6b03('0x6')]]['name'],queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0xf')]));queues[queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0xf')]]=queues[_0x229c3a[_0x6b03('0x6')]];queues[queues[_0x229c3a[_0x6b03('0x6')]][_0x6b03('0xf')]][_0x6b03('0x20')]=0x2;delete queues[_0x229c3a[_0x6b03('0x6')]];}}}catch(_0x59ed2f){utils[_0x6b03('0x15')](util[_0x6b03('0x4')](_0x6b03('0x21'),_0x229c3a['uniqueid']),_0x59ed2f);}};exports[_0x6b03('0x22')]=function(_0xcc0f6a){try{utils[_0x6b03('0x11')](util[_0x6b03('0x4')](_0x6b03('0x23'),_0xcc0f6a[_0x6b03('0x6')]),_0xcc0f6a);if(!_[_0x6b03('0x17')](_0xcc0f6a['variable'][_0x6b03('0x24')])&&_0xcc0f6a[_0x6b03('0x25')][_0x6b03('0x26')]()!==_0x6b03('0x27')){if(!_[_0x6b03('0x17')](queues[_0xcc0f6a[_0x6b03('0x6')]])){queues[_0xcc0f6a['uniqueid']]['queuecallerabandon']=![];queues[_0xcc0f6a[_0x6b03('0x6')]]['queuecallerabandonAt']=null;queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0x1a')]=!![];queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0x28')]=utils[_0x6b03('0x14')]();queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0xb')]=_0xcc0f6a[_0x6b03('0x25')][_0x6b03('0x26')]();utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x29'),_0xcc0f6a[_0x6b03('0x6')],queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0x1f')],_0xcc0f6a[_0x6b03('0x25')],queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0xb')]));writeDB(queues[_0xcc0f6a[_0x6b03('0x6')]]);}}else if(!_['isNil'](_0xcc0f6a['variable'][_0x6b03('0x2a')])){if(!_['isNil'](queues[_0xcc0f6a['uniqueid']])&&!queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0x19')]){queues[_0xcc0f6a['uniqueid']][_0x6b03('0x19')]=![];queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0x2b')]=null;queues[_0xcc0f6a['uniqueid']]['queuecallerexit']=!![];queues[_0xcc0f6a['uniqueid']]['queuecallerexitAt']=utils[_0x6b03('0x14')]();queues[_0xcc0f6a[_0x6b03('0x6')]]['queuecallerexitreason']=_0x6b03('0x2c');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xcc0f6a['uniqueid'],queues[_0xcc0f6a[_0x6b03('0x6')]]['name'],_0xcc0f6a[_0x6b03('0x25')],queues[_0xcc0f6a[_0x6b03('0x6')]][_0x6b03('0xb')]));}}}catch(_0x36bbd7){utils[_0x6b03('0x15')](util['format']('[%s][queues][varset]',_0xcc0f6a[_0x6b03('0x6')]),_0x36bbd7);}};exports[_0x6b03('0x19')]=function(_0x18f091){try{if(!_['isNil'](queues[_0x18f091[_0x6b03('0x6')]])){utils[_0x6b03('0x11')](util['format'](_0x6b03('0x2d'),_0x18f091[_0x6b03('0x6')]),_0x18f091);queues[_0x18f091[_0x6b03('0x6')]][_0x6b03('0x1a')]=![];queues[_0x18f091['uniqueid']][_0x6b03('0x28')]=null;queues[_0x18f091[_0x6b03('0x6')]][_0x6b03('0x19')]=!![];queues[_0x18f091[_0x6b03('0x6')]][_0x6b03('0x2b')]=utils[_0x6b03('0x14')]();queues[_0x18f091['uniqueid']][_0x6b03('0xb')]=_0x6b03('0x2e');utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x2f'),_0x18f091[_0x6b03('0x6')],queues[_0x18f091[_0x6b03('0x6')]][_0x6b03('0x1f')],queues[_0x18f091[_0x6b03('0x6')]]['queuecallerexitreason']));}}catch(_0x4508ec){utils[_0x6b03('0x15')](util['format']('[%s][queues][queuecallerabandon]',_0x18f091[_0x6b03('0x6')]),_0x4508ec);}};exports[_0x6b03('0x30')]=function(_0x205b48){try{if(!_['isNil'](queues[_0x205b48[_0x6b03('0x6')]])){utils[_0x6b03('0x11')](util[_0x6b03('0x4')](_0x6b03('0x31'),_0x205b48[_0x6b03('0x6')]),_0x205b48);utils['info'](util['format'](_0x6b03('0x32'),_0x205b48[_0x6b03('0x6')],queues[_0x205b48[_0x6b03('0x6')]][_0x6b03('0x1f')],_0x205b48[_0x6b03('0x33')],_0x205b48['connectedlinename']));queues[_0x205b48[_0x6b03('0x6')]]['queuecallerleave']=!![];queues[_0x205b48['uniqueid']][_0x6b03('0x18')]=utils[_0x6b03('0x14')]();queues[_0x205b48[_0x6b03('0x6')]][_0x6b03('0x34')]=utils['diffTime'](queues[_0x205b48[_0x6b03('0x6')]][_0x6b03('0x18')],queues[_0x205b48[_0x6b03('0x6')]]['queuecallerjoinAt']);queues[_0x205b48[_0x6b03('0x6')]][_0x6b03('0x12')]=_0x205b48['position'];queues[_0x205b48['uniqueid']]['count']=_0x205b48['count'];queues[_0x205b48[_0x6b03('0x6')]][_0x6b03('0x33')]=_0x205b48[_0x6b03('0x33')];queues[_0x205b48[_0x6b03('0x6')]][_0x6b03('0x35')]=_0x205b48[_0x6b03('0x35')];}}catch(_0x47a489){utils['error'](util[_0x6b03('0x4')](_0x6b03('0x31'),_0x205b48[_0x6b03('0x6')]),_0x47a489);}};exports[_0x6b03('0x36')]=function(_0x4ccbb9){try{if(!_[_0x6b03('0x17')](queues[_0x4ccbb9[_0x6b03('0x6')]])){utils['debug'](util[_0x6b03('0x4')](_0x6b03('0x37'),_0x4ccbb9[_0x6b03('0x6')]),_0x4ccbb9);utils[_0x6b03('0x3')](util['format'](_0x6b03('0x38'),_0x4ccbb9['uniqueid'],queues[_0x4ccbb9[_0x6b03('0x6')]][_0x6b03('0x1f')],_0x4ccbb9[_0x6b03('0x39')],_0x4ccbb9[_0x6b03('0x3a')]));queues[_0x4ccbb9[_0x6b03('0x6')]]['queuecallerabandon']=![];queues[_0x4ccbb9[_0x6b03('0x6')]][_0x6b03('0x19')]=![];queues[_0x4ccbb9[_0x6b03('0x6')]][_0x6b03('0x2b')]=null;queues[_0x4ccbb9['uniqueid']][_0x6b03('0x1a')]=![];queues[_0x4ccbb9[_0x6b03('0x6')]]['queuecallerexitreason']=null;queues[_0x4ccbb9['uniqueid']]['queuecallerexitAt']=null;queues[_0x4ccbb9[_0x6b03('0x6')]]['assigned']=!![];queues[_0x4ccbb9['uniqueid']][_0x6b03('0xa')]=_0x4ccbb9[_0x6b03('0x3a')];queues[_0x4ccbb9[_0x6b03('0x6')]][_0x6b03('0x9')]=_0x4ccbb9['membername'];}}catch(_0x10075b){utils[_0x6b03('0x15')](util['format'](_0x6b03('0x37'),_0x4ccbb9[_0x6b03('0x6')]),_0x10075b);}};exports[_0x6b03('0x3b')]=function(_0x3a12f6){try{if(!_[_0x6b03('0x17')](queues[_0x3a12f6[_0x6b03('0x6')]])){if(queues[_0x3a12f6[_0x6b03('0x6')]]['queuecallerleaveAt']){utils[_0x6b03('0x11')](util[_0x6b03('0x4')]('[%s][queues][agentcomplete]',_0x3a12f6['uniqueid']),_0x3a12f6);queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x19')]=![];queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x19')]=![];queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x2b')]=null;queues[_0x3a12f6[_0x6b03('0x6')]]['queuecallerexit']=![];queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x28')]=null;queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x3c')]=!![];queues[_0x3a12f6[_0x6b03('0x6')]]['lastAssignedTo']=_0x3a12f6[_0x6b03('0x39')];queues[_0x3a12f6['uniqueid']][_0x6b03('0x1b')]=!![];queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x1c')]=utils[_0x6b03('0x14')]();if(_0x3a12f6[_0x6b03('0x3d')]==_0x6b03('0x3e')){if(!queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x3e')]){queues[_0x3a12f6['uniqueid']]['queuecallerexitreason']=_0x6b03('0x3f');}}else{queues[_0x3a12f6['uniqueid']][_0x6b03('0xb')]=_0x6b03('0x40')+_0x3a12f6[_0x6b03('0x3d')][_0x6b03('0x26')]();}utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x41'),_0x3a12f6[_0x6b03('0x6')],queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0x1f')],_0x3a12f6[_0x6b03('0x39')],queues[_0x3a12f6[_0x6b03('0x6')]][_0x6b03('0xb')]));writeDB(queues[_0x3a12f6[_0x6b03('0x6')]]);}}}catch(_0x205771){utils['error'](util['format'](_0x6b03('0x42'),_0x3a12f6[_0x6b03('0x6')]),_0x205771);}};exports[_0x6b03('0x43')]=function(_0x49f097){try{if(!_[_0x6b03('0x17')](queues[_0x49f097[_0x6b03('0x44')]])){utils['debug'](util[_0x6b03('0x4')](_0x6b03('0x45'),_0x49f097['uniqueid']),_0x49f097);queues[_0x49f097[_0x6b03('0x44')]][_0x6b03('0x3e')]=!![];queues[_0x49f097[_0x6b03('0x44')]]['transfertype']=_0x6b03('0x46');queues[_0x49f097[_0x6b03('0x44')]][_0x6b03('0x47')]=_0x49f097[_0x6b03('0x48')];queues[_0x49f097[_0x6b03('0x44')]][_0x6b03('0x49')]=_0x49f097[_0x6b03('0x44')];queues[_0x49f097[_0x6b03('0x44')]]['queuecallerexitreason']=_0x6b03('0x4a');utils['info'](util['format'](_0x6b03('0x4b'),_0x49f097[_0x6b03('0x6')],queues[_0x49f097['transfereeuniqueid']][_0x6b03('0x1f')],_0x49f097['transfereeuniqueid'],_0x49f097[_0x6b03('0x48')]));}}catch(_0x51d7f9){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x49f097['uniqueid']),_0x51d7f9);}};exports[_0x6b03('0x4c')]=function(_0x4dea2b){try{utils['debug'](util[_0x6b03('0x4')]('[%s][queues][attendedtransfer]',_0x4dea2b[_0x6b03('0x4d')]),_0x4dea2b);if(_0x4dea2b[_0x6b03('0x4d')]==_0x4dea2b[_0x6b03('0x4e')]){if(!_[_0x6b03('0x17')](queues[_0x4dea2b[_0x6b03('0x4f')]])){utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x50'),_0x4dea2b[_0x6b03('0x4d')],queues[_0x4dea2b[_0x6b03('0x4f')]]['name'],_0x4dea2b[_0x6b03('0x51')]));queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x3e')]=!![];queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x52')]=_0x6b03('0x53');queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x47')]=_0x4dea2b[_0x6b03('0x51')];queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x49')]=_0x4dea2b['origtransfereruniqueid'];queues[_0x4dea2b['secondtransfererlinkedid']][_0x6b03('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x6b03('0x17')](queues[_0x4dea2b[_0x6b03('0x4e')]])){if(_0x4dea2b[_0x6b03('0x54')]&&queues[_0x4dea2b[_0x6b03('0x54')]]){queues[_0x4dea2b[_0x6b03('0x54')]]['queuecallerenterreason']=0x1;queues[_0x4dea2b[_0x6b03('0x44')]]=_[_0x6b03('0x55')](queues[_0x4dea2b[_0x6b03('0x54')]]);queues[_0x4dea2b['transfereeuniqueid']]['transfereduniqueid']=_0x4dea2b[_0x6b03('0x56')];queues[_0x4dea2b['transfereeuniqueid']][_0x6b03('0x20')]=0x2;queues[_0x4dea2b[_0x6b03('0x44')]]['calleridnum']=queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x57')];queues[_0x4dea2b[_0x6b03('0x44')]][_0x6b03('0x58')]=queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x58')];queues[_0x4dea2b[_0x6b03('0x44')]][_0x6b03('0x59')]=utils[_0x6b03('0x14')]();queues[_0x4dea2b[_0x6b03('0x44')]][_0x6b03('0x18')]=utils['now']();queues[_0x4dea2b['transfereeuniqueid']][_0x6b03('0x34')]=0x0;queues[_0x4dea2b['transfereeuniqueid']][_0x6b03('0x5a')]=0x0;utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x5b'),_0x4dea2b[_0x6b03('0x4d')],queues[_0x4dea2b[_0x6b03('0x44')]][_0x6b03('0x1f')],queues[_0x4dea2b[_0x6b03('0x44')]][_0x6b03('0x57')],queues[_0x4dea2b[_0x6b03('0x44')]][_0x6b03('0x58')]));}else{utils[_0x6b03('0x3')](util[_0x6b03('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4dea2b[_0x6b03('0x4d')],queues[_0x4dea2b[_0x6b03('0x4e')]][_0x6b03('0x1f')],_0x4dea2b['secondtransfererlinkedid']));queues[_0x4dea2b[_0x6b03('0x4e')]][_0x6b03('0xf')]=_0x4dea2b[_0x6b03('0x4f')];}}}else if(_0x4dea2b[_0x6b03('0x5c')]==_0x4dea2b[_0x6b03('0x4f')]){if(!_[_0x6b03('0x17')](queues[_0x4dea2b['origtransfererlinkedid']])){utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x5d'),_0x4dea2b[_0x6b03('0x4d')],queues[_0x4dea2b[_0x6b03('0x4e')]][_0x6b03('0x1f')],_0x4dea2b['secondtransfereruniqueid'],_0x4dea2b[_0x6b03('0x5e')]));queues[_0x4dea2b['origtransfererlinkedid']]['transfer']=!![];queues[_0x4dea2b[_0x6b03('0x4e')]][_0x6b03('0x52')]='ATTENDED';queues[_0x4dea2b['origtransfererlinkedid']][_0x6b03('0x47')]=_0x4dea2b[_0x6b03('0x5e')];queues[_0x4dea2b['origtransfererlinkedid']][_0x6b03('0x49')]=_0x4dea2b['secondtransfereruniqueid'];queues[_0x4dea2b[_0x6b03('0x4e')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x6b03('0x17')](queues[_0x4dea2b['secondtransfererlinkedid']])){if(_0x4dea2b['transfertargetlinkedid']&&queues[_0x4dea2b[_0x6b03('0x5f')]]){queues[_0x4dea2b['transfertargetlinkedid']][_0x6b03('0x20')]=0x1;queues[_0x4dea2b[_0x6b03('0x56')]]=_[_0x6b03('0x55')](queues[_0x4dea2b[_0x6b03('0x5f')]]);queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0xf')]=_0x4dea2b['transfertargetuniqueid'];queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x20')]=0x2;queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x57')]=queues[_0x4dea2b[_0x6b03('0x4e')]][_0x6b03('0x57')];queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x58')]=queues[_0x4dea2b[_0x6b03('0x4e')]][_0x6b03('0x58')];queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x59')]=utils[_0x6b03('0x14')]();queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x18')]=utils[_0x6b03('0x14')]();queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x34')]=0x0;queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x5a')]=0x0;utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x60'),_0x4dea2b[_0x6b03('0x4d')],queues[_0x4dea2b[_0x6b03('0x56')]]['name'],queues[_0x4dea2b['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x4dea2b[_0x6b03('0x56')]]['calleridnum'],queues[_0x4dea2b[_0x6b03('0x56')]][_0x6b03('0x58')]));}else{utils[_0x6b03('0x3')](util[_0x6b03('0x4')](_0x6b03('0x61'),_0x4dea2b[_0x6b03('0x4d')],queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0x1f')],_0x4dea2b[_0x6b03('0x4e')]));queues[_0x4dea2b[_0x6b03('0x4f')]][_0x6b03('0xf')]=_0x4dea2b[_0x6b03('0x4e')];}}}}catch(_0x4c27ee){utils[_0x6b03('0x15')](util[_0x6b03('0x4')](_0x6b03('0x62'),_0x4dea2b['origtransfereruniqueid']),_0x4c27ee);}};exports[_0x6b03('0x63')]=function(_0x215391){try{if(!_[_0x6b03('0x17')](queues[_0x215391['uniqueid']])){utils[_0x6b03('0x11')](util[_0x6b03('0x4')](_0x6b03('0x64'),_0x215391['uniqueid']),_0x215391);queues[_0x215391['uniqueid']][_0x6b03('0x65')]=utils['now']();utils[_0x6b03('0x3')](util['format'](_0x6b03('0x66'),_0x215391['uniqueid'],queues[_0x215391['uniqueid']][_0x6b03('0x1f')],queues[_0x215391['uniqueid']][_0x6b03('0x65')]));}}catch(_0x1abffc){utils[_0x6b03('0x15')](util[_0x6b03('0x4')](_0x6b03('0x64'),_0x215391['uniqueid']),_0x1abffc);}};exports[_0x6b03('0x67')]=function(_0x233822){try{if(!_['isNil'](queues[_0x233822[_0x6b03('0x6')]])){if(!_[_0x6b03('0x17')](queues[_0x233822[_0x6b03('0x6')]][_0x6b03('0x65')])){utils[_0x6b03('0x11')](util[_0x6b03('0x4')](_0x6b03('0x68'),_0x233822['uniqueid']),_0x233822);queues[_0x233822[_0x6b03('0x6')]][_0x6b03('0x5a')]+=utils[_0x6b03('0x69')](utils[_0x6b03('0x14')](),queues[_0x233822[_0x6b03('0x6')]]['musiconholdstartAt']);utils['info'](util[_0x6b03('0x4')](_0x6b03('0x6a'),_0x233822[_0x6b03('0x6')],queues[_0x233822[_0x6b03('0x6')]][_0x6b03('0x1f')],queues[_0x233822[_0x6b03('0x6')]][_0x6b03('0x5a')]));delete queues[_0x233822['uniqueid']][_0x6b03('0x65')];}}}catch(_0x3e13cc){utils[_0x6b03('0x15')](util[_0x6b03('0x4')](_0x6b03('0x68'),_0x233822[_0x6b03('0x6')]),_0x3e13cc);}}; \ No newline at end of file +var _0x73f5=['transfereelinkedid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','info','format','queue','accountcode','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER'];(function(_0x58fe9d,_0x32a78c){var _0x54070d=function(_0x324e4c){while(--_0x324e4c){_0x58fe9d['push'](_0x58fe9d['shift']());}};_0x54070d(++_0x32a78c);}(_0x73f5,0xdb));var _0x573f=function(_0x1f909d,_0x15f987){_0x1f909d=_0x1f909d-0x0;var _0x163242=_0x73f5[_0x1f909d];return _0x163242;};'use strict';var _=require('lodash');var util=require(_0x573f('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x4f938b){utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4f938b['uniqueid'],_0x4f938b['channel'],_0x4f938b[_0x573f('0x3')],_0x4f938b['lastAssignedTo'],_0x4f938b['calleridnum'],_0x4f938b[_0x573f('0x4')],_0x4f938b['queuecallerexitreason']));if(_0x4f938b['queue']){utils[_0x573f('0x5')](_0x4f938b[_0x573f('0x3')])[_0x573f('0x6')](function(_0x1b382b){if(_0x1b382b){_0x4f938b['type']=_0x1b382b['type'];}utils[_0x573f('0x7')](_0x573f('0x8'),_0x4f938b);});}else{utils[_0x573f('0x7')](_0x573f('0x8'),_0x4f938b);}if(_0x4f938b[_0x573f('0x9')]){delete queues[_0x4f938b['transfereduniqueid']];}else{delete queues[_0x4f938b['uniqueid']];}}exports[_0x573f('0xa')]=function(_0x2a669f){try{utils['debug'](util['format'](_0x573f('0xb'),_0x2a669f[_0x573f('0xc')]),_0x2a669f);utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0xd'),_0x2a669f['uniqueid'],_0x2a669f['queue'],_0x2a669f[_0x573f('0xe')]));queues[_0x2a669f[_0x573f('0xc')]]=_['assign'](_0x2a669f,{'originalposition':_0x2a669f[_0x573f('0xe')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4d2eaf){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0xb'),_0x2a669f[_0x573f('0xc')]),_0x4d2eaf);}};exports[_0x573f('0x10')]=function(_0x597a2b){try{if(!_[_0x573f('0x11')](queues[_0x597a2b[_0x573f('0xc')]])){utils['debug'](util[_0x573f('0x2')](_0x573f('0x12'),_0x597a2b[_0x573f('0xc')]),_0x597a2b);if(queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x13')]){if(!queues[_0x597a2b['uniqueid']][_0x573f('0x14')]&&!queues[_0x597a2b['uniqueid']][_0x573f('0x15')]){queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x16')]=!![];queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x17')]=utils[_0x573f('0x18')]();queues[_0x597a2b['uniqueid']][_0x573f('0x19')]=_0x573f('0x1a');}utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x597a2b[_0x573f('0xc')],queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x1b')],queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x19')]));writeDB(queues[_0x597a2b[_0x573f('0xc')]]);}else if(queues[_0x597a2b[_0x573f('0xc')]]['transfereduniqueid']){utils['info'](util[_0x573f('0x2')](_0x573f('0x1c'),_0x597a2b[_0x573f('0xc')],queues[_0x597a2b[_0x573f('0xc')]]['name'],queues[_0x597a2b[_0x573f('0xc')]]['transfereduniqueid']));queues[queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x9')]]=queues[_0x597a2b['uniqueid']];queues[queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x9')]][_0x573f('0x1d')]=0x2;delete queues[_0x597a2b[_0x573f('0xc')]];}}}catch(_0x2fe071){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0x12'),_0x597a2b[_0x573f('0xc')]),_0x2fe071);}};exports[_0x573f('0x1e')]=function(_0x197c37){try{utils[_0x573f('0x1f')](util['format'](_0x573f('0x20'),_0x197c37[_0x573f('0xc')]),_0x197c37);if(!_[_0x573f('0x11')](_0x197c37[_0x573f('0x21')][_0x573f('0x22')])&&_0x197c37[_0x573f('0x23')][_0x573f('0x24')]()!==_0x573f('0x25')){if(!_[_0x573f('0x11')](queues[_0x197c37['uniqueid']])){queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x14')]=![];queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x26')]=null;queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x15')]=!![];queues[_0x197c37[_0x573f('0xc')]]['queuecallerexitAt']=utils[_0x573f('0x18')]();queues[_0x197c37['uniqueid']][_0x573f('0x19')]=_0x197c37[_0x573f('0x23')]['toUpperCase']();utils['info'](util['format'](_0x573f('0x27'),_0x197c37[_0x573f('0xc')],queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x1b')],_0x197c37[_0x573f('0x23')],queues[_0x197c37['uniqueid']][_0x573f('0x19')]));writeDB(queues[_0x197c37[_0x573f('0xc')]]);}}else if(!_[_0x573f('0x11')](_0x197c37[_0x573f('0x21')][_0x573f('0x28')])){if(!_[_0x573f('0x11')](queues[_0x197c37['uniqueid']])&&!queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x14')]){queues[_0x197c37[_0x573f('0xc')]]['queuecallerabandon']=![];queues[_0x197c37[_0x573f('0xc')]]['queuecallerabandonAt']=null;queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x15')]=!![];queues[_0x197c37['uniqueid']][_0x573f('0x29')]=utils['now']();queues[_0x197c37['uniqueid']]['queuecallerexitreason']=_0x573f('0x2a');utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x197c37['uniqueid'],queues[_0x197c37[_0x573f('0xc')]]['name'],_0x197c37[_0x573f('0x23')],queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x19')]));}}}catch(_0x105d52){utils[_0x573f('0xf')](util[_0x573f('0x2')]('[%s][queues][varset]',_0x197c37[_0x573f('0xc')]),_0x105d52);}};exports[_0x573f('0x14')]=function(_0x1660f2){try{if(!_[_0x573f('0x11')](queues[_0x1660f2[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util[_0x573f('0x2')](_0x573f('0x2b'),_0x1660f2['uniqueid']),_0x1660f2);queues[_0x1660f2[_0x573f('0xc')]][_0x573f('0x15')]=![];queues[_0x1660f2[_0x573f('0xc')]][_0x573f('0x29')]=null;queues[_0x1660f2[_0x573f('0xc')]]['queuecallerabandon']=!![];queues[_0x1660f2[_0x573f('0xc')]]['queuecallerabandonAt']=utils[_0x573f('0x18')]();queues[_0x1660f2[_0x573f('0xc')]]['queuecallerexitreason']=_0x573f('0x2c');utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x2d'),_0x1660f2[_0x573f('0xc')],queues[_0x1660f2['uniqueid']][_0x573f('0x1b')],queues[_0x1660f2[_0x573f('0xc')]]['queuecallerexitreason']));}}catch(_0x95b7f1){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0x2b'),_0x1660f2['uniqueid']),_0x95b7f1);}};exports['queuecallerleave']=function(_0xaa4a69){try{if(!_[_0x573f('0x11')](queues[_0xaa4a69[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util['format']('[%s][queues][queuecallerleave]',_0xaa4a69[_0x573f('0xc')]),_0xaa4a69);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xaa4a69[_0x573f('0xc')],queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x1b')],_0xaa4a69[_0x573f('0x2e')],_0xaa4a69['connectedlinename']));queues[_0xaa4a69['uniqueid']][_0x573f('0x2f')]=!![];queues[_0xaa4a69['uniqueid']][_0x573f('0x13')]=utils[_0x573f('0x18')]();queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x30')]=utils[_0x573f('0x31')](queues[_0xaa4a69[_0x573f('0xc')]]['queuecallerleaveAt'],queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x32')]);queues[_0xaa4a69[_0x573f('0xc')]]['position']=_0xaa4a69['position'];queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x33')]=_0xaa4a69[_0x573f('0x33')];queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x2e')]=_0xaa4a69[_0x573f('0x2e')];queues[_0xaa4a69[_0x573f('0xc')]]['connectedlinename']=_0xaa4a69['connectedlinename'];}}catch(_0x3a0f3d){utils['error'](util[_0x573f('0x2')](_0x573f('0x34'),_0xaa4a69[_0x573f('0xc')]),_0x3a0f3d);}};exports[_0x573f('0x35')]=function(_0x463d17){try{if(!_[_0x573f('0x11')](queues[_0x463d17[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util[_0x573f('0x2')](_0x573f('0x36'),_0x463d17[_0x573f('0xc')]),_0x463d17);utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x463d17[_0x573f('0xc')],queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x1b')],_0x463d17['membername'],_0x463d17[_0x573f('0x37')]));queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x14')]=![];queues[_0x463d17['uniqueid']][_0x573f('0x14')]=![];queues[_0x463d17['uniqueid']]['queuecallerabandonAt']=null;queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x15')]=![];queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x19')]=null;queues[_0x463d17[_0x573f('0xc')]]['queuecallerexitAt']=null;queues[_0x463d17['uniqueid']][_0x573f('0x38')]=!![];queues[_0x463d17['uniqueid']][_0x573f('0x4')]=_0x463d17[_0x573f('0x37')];queues[_0x463d17['uniqueid']][_0x573f('0x39')]=_0x463d17[_0x573f('0x3a')];}}catch(_0x1cb6b4){utils[_0x573f('0xf')](util['format'](_0x573f('0x36'),_0x463d17[_0x573f('0xc')]),_0x1cb6b4);}};exports[_0x573f('0x3b')]=function(_0x2682d5){try{if(!_[_0x573f('0x11')](queues[_0x2682d5[_0x573f('0xc')]])){if(queues[_0x2682d5['uniqueid']][_0x573f('0x13')]){utils['debug'](util[_0x573f('0x2')](_0x573f('0x3c'),_0x2682d5[_0x573f('0xc')]),_0x2682d5);queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x14')]=![];queues[_0x2682d5['uniqueid']][_0x573f('0x14')]=![];queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x26')]=null;queues[_0x2682d5[_0x573f('0xc')]]['queuecallerexit']=![];queues[_0x2682d5['uniqueid']][_0x573f('0x29')]=null;queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x38')]=!![];queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x39')]=_0x2682d5[_0x573f('0x3a')];queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x16')]=!![];queues[_0x2682d5['uniqueid']]['queuecallercompleteAt']=utils[_0x573f('0x18')]();if(_0x2682d5[_0x573f('0x3d')]==_0x573f('0x3e')){if(!queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x3e')]){queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x19')]=_0x573f('0x3f');}}else{queues[_0x2682d5['uniqueid']][_0x573f('0x19')]=_0x573f('0x40')+_0x2682d5[_0x573f('0x3d')][_0x573f('0x24')]();}utils[_0x573f('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2682d5[_0x573f('0xc')],queues[_0x2682d5[_0x573f('0xc')]]['name'],_0x2682d5[_0x573f('0x3a')],queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x19')]));writeDB(queues[_0x2682d5['uniqueid']]);}}}catch(_0x4f9514){utils[_0x573f('0xf')](util['format'](_0x573f('0x3c'),_0x2682d5[_0x573f('0xc')]),_0x4f9514);}};exports[_0x573f('0x41')]=function(_0x4254bb){try{if(!_[_0x573f('0x11')](queues[_0x4254bb[_0x573f('0x42')]])){utils['debug'](util[_0x573f('0x2')](_0x573f('0x43'),_0x4254bb['uniqueid']),_0x4254bb);queues[_0x4254bb['transfereeuniqueid']][_0x573f('0x3e')]=!![];queues[_0x4254bb[_0x573f('0x42')]][_0x573f('0x44')]=_0x573f('0x45');queues[_0x4254bb[_0x573f('0x42')]][_0x573f('0x46')]=_0x4254bb[_0x573f('0x47')];queues[_0x4254bb['transfereeuniqueid']][_0x573f('0x48')]=_0x4254bb[_0x573f('0x42')];queues[_0x4254bb['transfereeuniqueid']][_0x573f('0x19')]='BLINDTRANSFER';utils[_0x573f('0x1')](util['format'](_0x573f('0x49'),_0x4254bb[_0x573f('0xc')],queues[_0x4254bb[_0x573f('0x42')]][_0x573f('0x1b')],_0x4254bb['transfereeuniqueid'],_0x4254bb[_0x573f('0x47')]));}}catch(_0x2bb07c){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0x43'),_0x4254bb['uniqueid']),_0x2bb07c);}};exports[_0x573f('0x4a')]=function(_0x48b6d8){try{utils[_0x573f('0x1f')](util[_0x573f('0x2')]('[%s][queues][attendedtransfer]',_0x48b6d8[_0x573f('0x4b')]),_0x48b6d8);if(_0x48b6d8['origtransfereruniqueid']==_0x48b6d8[_0x573f('0x4c')]){if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4d')]])){utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x4e'),_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x1b')],_0x48b6d8[_0x573f('0x4f')]));queues[_0x48b6d8['secondtransfererlinkedid']][_0x573f('0x3e')]=!![];queues[_0x48b6d8[_0x573f('0x4d')]]['transfertype']='ATTENDED';queues[_0x48b6d8['secondtransfererlinkedid']][_0x573f('0x46')]=_0x48b6d8[_0x573f('0x4f')];queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x48')]=_0x48b6d8[_0x573f('0x4b')];queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x19')]=_0x573f('0x50');}if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4c')]])){if(_0x48b6d8[_0x573f('0x51')]&&queues[_0x48b6d8[_0x573f('0x51')]]){queues[_0x48b6d8[_0x573f('0x51')]][_0x573f('0x1d')]=0x1;queues[_0x48b6d8['transfereeuniqueid']]=_['clone'](queues[_0x48b6d8[_0x573f('0x51')]]);queues[_0x48b6d8[_0x573f('0x42')]]['transfereduniqueid']=_0x48b6d8['transfertargetuniqueid'];queues[_0x48b6d8[_0x573f('0x42')]]['queuecallerenterreason']=0x2;queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x52')]=queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x52')];queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x53')]=queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x53')];queues[_0x48b6d8['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x573f('0x18')]();queues[_0x48b6d8['transfereeuniqueid']][_0x573f('0x13')]=utils[_0x573f('0x18')]();queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x30')]=0x0;queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x54')]=0x0;utils[_0x573f('0x1')](util['format'](_0x573f('0x55'),_0x48b6d8['origtransfereruniqueid'],queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x1b')],queues[_0x48b6d8['transfereeuniqueid']][_0x573f('0x52')],queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x53')]));}else{utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x56'),_0x48b6d8['origtransfereruniqueid'],queues[_0x48b6d8[_0x573f('0x4c')]][_0x573f('0x1b')],_0x48b6d8['secondtransfererlinkedid']));queues[_0x48b6d8[_0x573f('0x4c')]][_0x573f('0x9')]=_0x48b6d8[_0x573f('0x4d')];}}}else if(_0x48b6d8[_0x573f('0x57')]==_0x48b6d8[_0x573f('0x4d')]){if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4c')]])){utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x58'),_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8[_0x573f('0x4c')]][_0x573f('0x1b')],_0x48b6d8['secondtransfereruniqueid'],_0x48b6d8['secondtransfererexten']));queues[_0x48b6d8[_0x573f('0x4c')]]['transfer']=!![];queues[_0x48b6d8[_0x573f('0x4c')]]['transfertype']='ATTENDED';queues[_0x48b6d8[_0x573f('0x4c')]]['transferexten']=_0x48b6d8[_0x573f('0x59')];queues[_0x48b6d8['origtransfererlinkedid']][_0x573f('0x48')]=_0x48b6d8[_0x573f('0x57')];queues[_0x48b6d8['origtransfererlinkedid']][_0x573f('0x19')]=_0x573f('0x50');}if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4d')]])){if(_0x48b6d8[_0x573f('0x5a')]&&queues[_0x48b6d8['transfertargetlinkedid']]){queues[_0x48b6d8[_0x573f('0x5a')]][_0x573f('0x1d')]=0x1;queues[_0x48b6d8[_0x573f('0x5b')]]=_[_0x573f('0x5c')](queues[_0x48b6d8[_0x573f('0x5a')]]);queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x9')]=_0x48b6d8['transfertargetuniqueid'];queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x1d')]=0x2;queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x52')]=queues[_0x48b6d8[_0x573f('0x4c')]]['calleridnum'];queues[_0x48b6d8['transfertargetuniqueid']][_0x573f('0x53')]=queues[_0x48b6d8[_0x573f('0x4c')]]['calleridname'];queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x32')]=utils['now']();queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x13')]=utils[_0x573f('0x18')]();queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x30')]=0x0;queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x54')]=0x0;utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x1b')],queues[_0x48b6d8[_0x573f('0x5b')]]['transfereduniqueid'],queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x52')],queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x53')]));}else{utils[_0x573f('0x1')](util['format'](_0x573f('0x56'),_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8['secondtransfererlinkedid']]['name'],_0x48b6d8[_0x573f('0x4c')]));queues[_0x48b6d8['secondtransfererlinkedid']][_0x573f('0x9')]=_0x48b6d8[_0x573f('0x4c')];}}}}catch(_0x312760){utils[_0x573f('0xf')](util['format'](_0x573f('0x5d'),_0x48b6d8[_0x573f('0x4b')]),_0x312760);}};exports['musiconholdstart']=function(_0x26d5c0){try{if(!_[_0x573f('0x11')](queues[_0x26d5c0[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util[_0x573f('0x2')](_0x573f('0x5e'),_0x26d5c0[_0x573f('0xc')]),_0x26d5c0);queues[_0x26d5c0[_0x573f('0xc')]][_0x573f('0x5f')]=utils['now']();utils['info'](util[_0x573f('0x2')](_0x573f('0x60'),_0x26d5c0['uniqueid'],queues[_0x26d5c0[_0x573f('0xc')]][_0x573f('0x1b')],queues[_0x26d5c0['uniqueid']][_0x573f('0x5f')]));}}catch(_0x16e290){utils['error'](util[_0x573f('0x2')](_0x573f('0x5e'),_0x26d5c0[_0x573f('0xc')]),_0x16e290);}};exports[_0x573f('0x61')]=function(_0x1c7805){try{if(!_['isNil'](queues[_0x1c7805[_0x573f('0xc')]])){if(!_[_0x573f('0x11')](queues[_0x1c7805['uniqueid']][_0x573f('0x5f')])){utils['debug'](util[_0x573f('0x2')](_0x573f('0x62'),_0x1c7805[_0x573f('0xc')]),_0x1c7805);queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x54')]+=utils['diffTime'](utils[_0x573f('0x18')](),queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x5f')]);utils[_0x573f('0x1')](util['format'](_0x573f('0x63'),_0x1c7805[_0x573f('0xc')],queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x1b')],queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x54')]));delete queues[_0x1c7805['uniqueid']][_0x573f('0x5f')];}}}catch(_0x3c43da){utils['error'](util[_0x573f('0x2')](_0x573f('0x62'),_0x1c7805['uniqueid']),_0x3c43da);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 79e2c96..1e727e9 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc67=['value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereruniqueid','recording','lodash','util','./transfers.controller','format','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','membername','name','UserId','request','blinds','newchannel','debug','[%s][recordings][newchannel]','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s'];(function(_0x1143ce,_0x5c49a4){var _0xb4b17f=function(_0x55bbf4){while(--_0x55bbf4){_0x1143ce['push'](_0x1143ce['shift']());}};_0xb4b17f(++_0x5c49a4);}(_0xdc67,0x1d5));var _0x7dc6=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xdc67[_0x19a49f];return _0x5351ae;};'use strict';var _=require(_0x7dc6('0x0'));var util=require(_0x7dc6('0x1'));var utils=require('./utils');var transfers=require(_0x7dc6('0x2'));var recordings={};function writeDB(_0x196de7){var _0x612de2;utils['info'](util[_0x7dc6('0x3')]('[%s][recordings][writeDB]',_0x196de7['uniqueid']));if(transfers['blinds'][_0x196de7['uniqueid']]){_0x612de2=_0x196de7['uniqueid'];_0x196de7[_0x7dc6('0x4')]=transfers['blinds'][_0x196de7[_0x7dc6('0x4')]][_0x7dc6('0x5')];}if(_0x196de7[_0x7dc6('0x6')]){utils[_0x7dc6('0x7')](_0x196de7['accountcode'])['then'](function(_0x25226a){if(_0x25226a){_0x196de7[_0x7dc6('0x8')]=_0x25226a[_0x7dc6('0x9')];_0x196de7[_0x7dc6('0xa')]=_0x25226a['id'];}utils[_0x7dc6('0xb')]('CreateVoiceRecording',_0x196de7);});}else{utils[_0x7dc6('0xb')]('CreateVoiceRecording',_0x196de7);}if(_0x612de2)delete transfers[_0x7dc6('0xc')][_0x612de2];}exports[_0x7dc6('0xd')]=function(_0x43913e){try{utils[_0x7dc6('0xe')](util[_0x7dc6('0x3')](_0x7dc6('0xf'),_0x43913e[_0x7dc6('0x4')]),_0x43913e);if(_0x43913e['uniqueid']==_0x43913e['linkedid']){utils[_0x7dc6('0x10')](util[_0x7dc6('0x3')](_0x7dc6('0x11'),_0x43913e[_0x7dc6('0x4')],_0x43913e[_0x7dc6('0x12')],_0x43913e[_0x7dc6('0x13')]));recordings[_0x43913e['uniqueid']]={'uniqueid':_0x43913e[_0x7dc6('0x4')],'accountcode':_0x43913e[_0x7dc6('0x6')],'exten':_0x43913e['exten'],'context':_0x43913e[_0x7dc6('0x12')],'channel':_0x43913e[_0x7dc6('0x14')],'monitors':[]};}}catch(_0xde7149){utils[_0x7dc6('0x15')](util[_0x7dc6('0x3')](_0x7dc6('0xf'),_0x43913e[_0x7dc6('0x4')]),_0xde7149);}};exports[_0x7dc6('0x16')]=function(_0x1ba697){try{utils[_0x7dc6('0xe')](util[_0x7dc6('0x3')](_0x7dc6('0x17'),_0x1ba697['uniqueid']),_0x1ba697);if(!_['isNil'](recordings[_0x1ba697[_0x7dc6('0x4')]])&&_0x1ba697['channelstate']==0x6){utils[_0x7dc6('0x10')](util[_0x7dc6('0x3')](_0x7dc6('0x18'),_0x1ba697['uniqueid'],_0x1ba697['context'],_0x1ba697[_0x7dc6('0x14')]));}else if(!_['isNil'](recordings[_0x1ba697[_0x7dc6('0x19')]])&&_0x1ba697[_0x7dc6('0x1a')]==0x6&&_0x1ba697['context']!=_0x7dc6('0x1b')){utils['info'](util['format'](_0x7dc6('0x1c'),_0x1ba697[_0x7dc6('0x4')],_0x1ba697[_0x7dc6('0x19')],_0x1ba697[_0x7dc6('0x12')],_0x1ba697['channel']));recordings[_0x1ba697[_0x7dc6('0x19')]][_0x7dc6('0x6')]=_0x1ba697[_0x7dc6('0x6')];}}catch(_0x2eaec2){utils[_0x7dc6('0x15')](util[_0x7dc6('0x3')](_0x7dc6('0x17'),_0x1ba697[_0x7dc6('0x4')]),_0x2eaec2);}};exports[_0x7dc6('0x1d')]=function(_0xcc6b54){try{if(!_[_0x7dc6('0x1e')](_0xcc6b54[_0x7dc6('0x1f')])&&!_[_0x7dc6('0x1e')](_0xcc6b54[_0x7dc6('0x1f')][_0x7dc6('0x20')])){utils[_0x7dc6('0xe')](util[_0x7dc6('0x3')](_0x7dc6('0x21'),_0xcc6b54[_0x7dc6('0x4')]),_0xcc6b54);utils[_0x7dc6('0x10')](util[_0x7dc6('0x3')](_0x7dc6('0x22'),_0xcc6b54[_0x7dc6('0x4')],_0xcc6b54[_0x7dc6('0x1f')],_0xcc6b54[_0x7dc6('0x23')]));if(_[_0x7dc6('0x24')](_0xcc6b54[_0x7dc6('0x23')],_0x7dc6('0x25'))){_0xcc6b54[_0x7dc6('0x23')]=_0xcc6b54[_0x7dc6('0x23')][_0x7dc6('0x26')](_0x7dc6('0x25'),_0x7dc6('0x27'));}if(recordings[_0xcc6b54[_0x7dc6('0x19')]]){var _0x13a0b5=_[_0x7dc6('0x28')](recordings[_0xcc6b54[_0x7dc6('0x19')]][_0x7dc6('0x29')],{'value':_0xcc6b54[_0x7dc6('0x23')]});if(_[_0x7dc6('0x1e')](_0x13a0b5)){recordings[_0xcc6b54[_0x7dc6('0x19')]]['monitors']['push']({'value':_0xcc6b54['value']});}}}}catch(_0x440fb3){utils[_0x7dc6('0x15')](util['format'](_0x7dc6('0x21'),_0xcc6b54['uniqueid']),_0x440fb3);}};exports[_0x7dc6('0x2a')]=function(_0xc9c3a2){try{if(!_[_0x7dc6('0x1e')](recordings[_0xc9c3a2['uniqueid']])){utils[_0x7dc6('0xe')](util[_0x7dc6('0x3')](_0x7dc6('0x2b'),_0xc9c3a2[_0x7dc6('0x4')]),_0xc9c3a2);utils[_0x7dc6('0x10')](util[_0x7dc6('0x3')](_0x7dc6('0x2c'),_0xc9c3a2[_0x7dc6('0x4')],_0xc9c3a2[_0x7dc6('0x2d')],_0xc9c3a2[_0x7dc6('0x2e')],_0xc9c3a2[_0x7dc6('0x2f')]));recordings[_0xc9c3a2[_0x7dc6('0x4')]][_0x7dc6('0x2d')]=_0xc9c3a2[_0x7dc6('0x2d')];recordings[_0xc9c3a2['uniqueid']][_0x7dc6('0x2e')]=_0xc9c3a2['calleridname'];recordings[_0xc9c3a2['uniqueid']][_0x7dc6('0x30')]=_0xc9c3a2[_0x7dc6('0x30')];recordings[_0xc9c3a2[_0x7dc6('0x4')]][_0x7dc6('0x31')]=_0xc9c3a2['connectedlinename'];if(recordings[_0xc9c3a2[_0x7dc6('0x4')]]['type']==_0x7dc6('0x32')&&recordings[_0xc9c3a2[_0x7dc6('0x4')]][_0x7dc6('0x6')]){recordings[_0xc9c3a2[_0x7dc6('0x4')]][_0x7dc6('0x30')]=recordings[_0xc9c3a2[_0x7dc6('0x4')]][_0x7dc6('0x6')];recordings[_0xc9c3a2[_0x7dc6('0x4')]][_0x7dc6('0x31')]='';}recordings[_0xc9c3a2['uniqueid']][_0x7dc6('0x29')]['forEach'](function(_0x13cb51){var _0x30c523=_[_0x7dc6('0x33')](recordings[_0xc9c3a2[_0x7dc6('0x4')]]);_0x30c523[_0x7dc6('0x23')]=_0x13cb51[_0x7dc6('0x23')];writeDB(_0x30c523);});delete recordings[_0xc9c3a2[_0x7dc6('0x4')]];}}catch(_0x13e679){utils[_0x7dc6('0x15')](util[_0x7dc6('0x3')](_0x7dc6('0x2b'),_0xc9c3a2[_0x7dc6('0x4')]),_0x13e679);}};exports[_0x7dc6('0x34')]=function(_0x13a9ca){try{if(!_[_0x7dc6('0x1e')](recordings[_0x13a9ca[_0x7dc6('0x4')]])){utils[_0x7dc6('0xe')](util[_0x7dc6('0x3')](_0x7dc6('0x35'),_0x13a9ca[_0x7dc6('0x4')]),_0x13a9ca);utils[_0x7dc6('0x10')](util['format'](_0x7dc6('0x36'),_0x13a9ca[_0x7dc6('0x4')],_0x13a9ca[_0x7dc6('0x37')],_0x13a9ca[_0x7dc6('0x38')]));if(_0x13a9ca['application'][_0x7dc6('0x39')]()=='set'&&_[_0x7dc6('0x3a')](_0x13a9ca[_0x7dc6('0x38')]['toLowerCase'](),_0x7dc6('0x3b'))){var _0x4dcd0f=_0x13a9ca[_0x7dc6('0x38')][_0x7dc6('0x3c')]('=');var _0x315863=_0x4dcd0f[0x0][_0x7dc6('0x3d')](_0x4dcd0f[0x0][_0x7dc6('0x3e')]('(')+0x1,_0x4dcd0f[0x0][_0x7dc6('0x3e')](')'));var _0x5a89fc=_0x4dcd0f[0x1];recordings[_0x13a9ca[_0x7dc6('0x4')]][_0x315863]=_0x5a89fc;}}}catch(_0xd80a90){utils['error'](util['format'](_0x7dc6('0x35'),_0x13a9ca['uniqueid']),_0xd80a90);}};exports['queuecallerjoin']=function(_0x5ab6ec){try{if(!_[_0x7dc6('0x1e')](recordings[_0x5ab6ec['uniqueid']])){utils[_0x7dc6('0xe')](util[_0x7dc6('0x3')](_0x7dc6('0x3f'),_0x5ab6ec[_0x7dc6('0x4')]),_0x5ab6ec);utils['info'](util['format'](_0x7dc6('0x40'),_0x5ab6ec[_0x7dc6('0x4')],_0x5ab6ec[_0x7dc6('0x41')]));recordings[_0x5ab6ec[_0x7dc6('0x4')]]['queue']=_0x5ab6ec[_0x7dc6('0x41')];}}catch(_0x3ed8a9){utils[_0x7dc6('0x15')](util[_0x7dc6('0x3')]('[%s][recordings][queuecallerjoin]',_0x5ab6ec[_0x7dc6('0x4')]),_0x3ed8a9);}};exports[_0x7dc6('0x42')]=function(_0x27f5cd){try{utils[_0x7dc6('0xe')](util['format'](_0x7dc6('0x43'),_0x27f5cd[_0x7dc6('0x4')]),_0x27f5cd);utils[_0x7dc6('0x10')](util[_0x7dc6('0x3')](_0x7dc6('0x44'),_0x27f5cd[_0x7dc6('0x4')],_0x27f5cd[_0x7dc6('0x45')],_0x27f5cd['transferercalleridname'],_0x27f5cd['transfereecalleridnum'],_0x27f5cd['transfereecalleridname']));if(recordings[_0x27f5cd[_0x7dc6('0x46')]]&&transfers['blinds'][_0x27f5cd[_0x7dc6('0x46')]]){transfers[_0x7dc6('0xc')][_0x27f5cd['transfereruniqueid']][_0x7dc6('0x47')]=!![];}}catch(_0x1e3618){utils['error'](util[_0x7dc6('0x3')](_0x7dc6('0x43'),_0x27f5cd[_0x7dc6('0x4')]),_0x1e3618);}}; \ No newline at end of file +var _0x1cd8=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','error','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','uniqueid','blinds','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','format','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cd8,0x7b));var _0x81cd=function(_0x53e985,_0x2ba12b){_0x53e985=_0x53e985-0x0;var _0x262457=_0x1cd8[_0x53e985];return _0x262457;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var utils=require(_0x81cd('0x2'));var transfers=require(_0x81cd('0x3'));var recordings={};function writeDB(_0x341007){var _0x5e50c0;utils[_0x81cd('0x4')](util['format']('[%s][recordings][writeDB]',_0x341007[_0x81cd('0x5')]));if(transfers[_0x81cd('0x6')][_0x341007[_0x81cd('0x5')]]){_0x5e50c0=_0x341007[_0x81cd('0x5')];_0x341007[_0x81cd('0x5')]=transfers['blinds'][_0x341007[_0x81cd('0x5')]]['transfereeuniqueid'];}if(_0x341007[_0x81cd('0x7')]){utils[_0x81cd('0x8')](_0x341007[_0x81cd('0x7')])[_0x81cd('0x9')](function(_0x3de5ad){if(_0x3de5ad){_0x341007['membername']=_0x3de5ad[_0x81cd('0xa')];_0x341007[_0x81cd('0xb')]=_0x3de5ad['id'];}utils['request'](_0x81cd('0xc'),_0x341007);});}else{utils[_0x81cd('0xd')](_0x81cd('0xc'),_0x341007);}if(_0x5e50c0)delete transfers['blinds'][_0x5e50c0];}exports[_0x81cd('0xe')]=function(_0x3dd55f){try{utils[_0x81cd('0xf')](util['format'](_0x81cd('0x10'),_0x3dd55f[_0x81cd('0x5')]),_0x3dd55f);if(_0x3dd55f['uniqueid']==_0x3dd55f[_0x81cd('0x11')]){utils[_0x81cd('0x4')](util['format'](_0x81cd('0x12'),_0x3dd55f['uniqueid'],_0x3dd55f['context'],_0x3dd55f[_0x81cd('0x13')]));recordings[_0x3dd55f[_0x81cd('0x5')]]={'uniqueid':_0x3dd55f[_0x81cd('0x5')],'accountcode':_0x3dd55f[_0x81cd('0x7')],'exten':_0x3dd55f['exten'],'context':_0x3dd55f[_0x81cd('0x14')],'channel':_0x3dd55f[_0x81cd('0x15')],'monitors':[]};}}catch(_0x497423){utils['error'](util[_0x81cd('0x16')](_0x81cd('0x10'),_0x3dd55f[_0x81cd('0x5')]),_0x497423);}};exports['newstate']=function(_0x9a76f7){try{utils[_0x81cd('0xf')](util[_0x81cd('0x16')]('[%s][recordings][newstate]',_0x9a76f7[_0x81cd('0x5')]),_0x9a76f7);if(!_[_0x81cd('0x17')](recordings[_0x9a76f7[_0x81cd('0x5')]])&&_0x9a76f7[_0x81cd('0x18')]==0x6){utils['info'](util[_0x81cd('0x16')](_0x81cd('0x19'),_0x9a76f7[_0x81cd('0x5')],_0x9a76f7[_0x81cd('0x14')],_0x9a76f7[_0x81cd('0x15')]));}else if(!_[_0x81cd('0x17')](recordings[_0x9a76f7['linkedid']])&&_0x9a76f7[_0x81cd('0x18')]==0x6&&_0x9a76f7[_0x81cd('0x14')]!='transfer'){utils['info'](util[_0x81cd('0x16')](_0x81cd('0x1a'),_0x9a76f7[_0x81cd('0x5')],_0x9a76f7[_0x81cd('0x11')],_0x9a76f7[_0x81cd('0x14')],_0x9a76f7[_0x81cd('0x15')]));recordings[_0x9a76f7[_0x81cd('0x11')]][_0x81cd('0x7')]=_0x9a76f7[_0x81cd('0x7')];}}catch(_0x491590){utils['error'](util[_0x81cd('0x16')](_0x81cd('0x1b'),_0x9a76f7[_0x81cd('0x5')]),_0x491590);}};exports[_0x81cd('0x1c')]=function(_0x17d5e5){try{if(!_['isNil'](_0x17d5e5[_0x81cd('0x1d')])&&!_[_0x81cd('0x17')](_0x17d5e5['variable'][_0x81cd('0x1e')])){utils[_0x81cd('0xf')](util[_0x81cd('0x16')](_0x81cd('0x1f'),_0x17d5e5[_0x81cd('0x5')]),_0x17d5e5);utils['info'](util[_0x81cd('0x16')](_0x81cd('0x20'),_0x17d5e5['uniqueid'],_0x17d5e5[_0x81cd('0x1d')],_0x17d5e5[_0x81cd('0x21')]));if(_[_0x81cd('0x22')](_0x17d5e5[_0x81cd('0x21')],'.wav49')){_0x17d5e5[_0x81cd('0x21')]=_0x17d5e5[_0x81cd('0x21')][_0x81cd('0x23')](_0x81cd('0x24'),'.WAV');}if(recordings[_0x17d5e5[_0x81cd('0x11')]]){var _0x3f6ef4=_[_0x81cd('0x25')](recordings[_0x17d5e5[_0x81cd('0x11')]][_0x81cd('0x26')],{'value':_0x17d5e5[_0x81cd('0x21')]});if(_[_0x81cd('0x17')](_0x3f6ef4)){recordings[_0x17d5e5[_0x81cd('0x11')]][_0x81cd('0x26')][_0x81cd('0x27')]({'value':_0x17d5e5[_0x81cd('0x21')]});}}}}catch(_0xecc3ca){utils['error'](util[_0x81cd('0x16')](_0x81cd('0x1f'),_0x17d5e5[_0x81cd('0x5')]),_0xecc3ca);}};exports[_0x81cd('0x28')]=function(_0x10eb42){try{if(!_['isNil'](recordings[_0x10eb42[_0x81cd('0x5')]])){utils[_0x81cd('0xf')](util[_0x81cd('0x16')](_0x81cd('0x29'),_0x10eb42[_0x81cd('0x5')]),_0x10eb42);utils['info'](util[_0x81cd('0x16')](_0x81cd('0x2a'),_0x10eb42[_0x81cd('0x5')],_0x10eb42['calleridnum'],_0x10eb42[_0x81cd('0x2b')],_0x10eb42[_0x81cd('0x2c')]));recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2d')]=_0x10eb42[_0x81cd('0x2d')];recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2b')]=_0x10eb42[_0x81cd('0x2b')];recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2e')]=_0x10eb42[_0x81cd('0x2e')];recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2f')]=_0x10eb42[_0x81cd('0x2f')];if(recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x30')]==_0x81cd('0x31')&&recordings[_0x10eb42['uniqueid']][_0x81cd('0x7')]){recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2e')]=recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x7')];recordings[_0x10eb42[_0x81cd('0x5')]]['connectedlinename']='';}recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x26')][_0x81cd('0x32')](function(_0x2c6694){var _0x1a8447=_[_0x81cd('0x33')](recordings[_0x10eb42['uniqueid']]);_0x1a8447[_0x81cd('0x21')]=_0x2c6694[_0x81cd('0x21')];writeDB(_0x1a8447);});delete recordings[_0x10eb42['uniqueid']];}}catch(_0x4cfc53){utils[_0x81cd('0x34')](util[_0x81cd('0x16')]('[%s][recordings][hangup]',_0x10eb42[_0x81cd('0x5')]),_0x4cfc53);}};exports[_0x81cd('0x35')]=function(_0x5c8964){try{if(!_[_0x81cd('0x17')](recordings[_0x5c8964[_0x81cd('0x5')]])){utils[_0x81cd('0xf')](util['format']('[%s][recordings][newexten]',_0x5c8964[_0x81cd('0x5')]),_0x5c8964);utils['info'](util[_0x81cd('0x16')](_0x81cd('0x36'),_0x5c8964[_0x81cd('0x5')],_0x5c8964[_0x81cd('0x37')],_0x5c8964[_0x81cd('0x38')]));if(_0x5c8964[_0x81cd('0x37')][_0x81cd('0x39')]()==_0x81cd('0x3a')&&_[_0x81cd('0x3b')](_0x5c8964['appdata'][_0x81cd('0x39')](),_0x81cd('0x3c'))){var _0x155559=_0x5c8964[_0x81cd('0x38')][_0x81cd('0x3d')]('=');var _0x431f20=_0x155559[0x0][_0x81cd('0x3e')](_0x155559[0x0][_0x81cd('0x3f')]('(')+0x1,_0x155559[0x0][_0x81cd('0x3f')](')'));var _0x2b3e83=_0x155559[0x1];recordings[_0x5c8964[_0x81cd('0x5')]][_0x431f20]=_0x2b3e83;}}}catch(_0x36c318){utils[_0x81cd('0x34')](util[_0x81cd('0x16')](_0x81cd('0x40'),_0x5c8964[_0x81cd('0x5')]),_0x36c318);}};exports[_0x81cd('0x41')]=function(_0x46f42e){try{if(!_[_0x81cd('0x17')](recordings[_0x46f42e[_0x81cd('0x5')]])){utils[_0x81cd('0xf')](util[_0x81cd('0x16')]('[%s][recordings][queuecallerjoin]',_0x46f42e['uniqueid']),_0x46f42e);utils[_0x81cd('0x4')](util['format'](_0x81cd('0x42'),_0x46f42e['uniqueid'],_0x46f42e[_0x81cd('0x43')]));recordings[_0x46f42e['uniqueid']]['queue']=_0x46f42e['queue'];}}catch(_0x5c5220){utils[_0x81cd('0x34')](util['format'](_0x81cd('0x44'),_0x46f42e[_0x81cd('0x5')]),_0x5c5220);}};exports[_0x81cd('0x45')]=function(_0x1173ff){try{utils['debug'](util['format'](_0x81cd('0x46'),_0x1173ff[_0x81cd('0x5')]),_0x1173ff);utils[_0x81cd('0x4')](util[_0x81cd('0x16')](_0x81cd('0x47'),_0x1173ff['uniqueid'],_0x1173ff[_0x81cd('0x48')],_0x1173ff[_0x81cd('0x49')],_0x1173ff[_0x81cd('0x4a')],_0x1173ff[_0x81cd('0x4b')]));if(recordings[_0x1173ff[_0x81cd('0x4c')]]&&transfers[_0x81cd('0x6')][_0x1173ff[_0x81cd('0x4c')]]){transfers['blinds'][_0x1173ff[_0x81cd('0x4c')]]['recording']=!![];}}catch(_0x4fc3f7){utils[_0x81cd('0x34')](util[_0x81cd('0x16')]('[%s][recordings][blindtransfer]',_0x1173ff[_0x81cd('0x5')]),_0x4fc3f7);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2814c5e..1d19ab0 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d59=['error','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','uniqueid','type','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blinds','transfereruniqueid'];(function(_0x27ba9c,_0x51b231){var _0x382c72=function(_0x44ef44){while(--_0x44ef44){_0x27ba9c['push'](_0x27ba9c['shift']());}};_0x382c72(++_0x51b231);}(_0x6d59,0x111));var _0x96d5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6d59[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x96d5('0x0'));var utils=require(_0x96d5('0x1'));function writeDB(_0x31b5f6){utils[_0x96d5('0x2')](util[_0x96d5('0x3')](_0x96d5('0x4'),_0x31b5f6['type']==='attended'?_0x31b5f6['origtransfereruniqueid']:_0x31b5f6[_0x96d5('0x5')],_0x31b5f6[_0x96d5('0x6')]));utils['request']('CreateVoiceTransferReport',_0x31b5f6);}exports['blinds']={};exports[_0x96d5('0x7')]=function(_0x4aae38){try{utils[_0x96d5('0x8')](util['format']('[%s][transfers][blindtransfer]',_0x4aae38[_0x96d5('0x5')]),_0x4aae38);utils[_0x96d5('0x2')](util[_0x96d5('0x3')](_0x96d5('0x9'),_0x4aae38[_0x96d5('0x5')],_0x4aae38[_0x96d5('0xa')],_0x4aae38['transferercalleridname'],_0x4aae38[_0x96d5('0xb')],_0x4aae38[_0x96d5('0xc')]));_0x4aae38[_0x96d5('0x6')]='blind';exports[_0x96d5('0xd')][_0x4aae38[_0x96d5('0xe')]]=_0x4aae38;writeDB(_0x4aae38);}catch(_0x37e7e7){utils[_0x96d5('0xf')](util[_0x96d5('0x3')]('[%s][transfers][blindtransfer]',_0x4aae38['uniqueid']),_0x37e7e7);}};exports['attendedtransfer']=function(_0x51f19d){try{utils['debug'](util[_0x96d5('0x3')]('[%s][transfers][attendedtransfer]',_0x51f19d[_0x96d5('0x10')]),_0x51f19d);utils[_0x96d5('0x2')](util[_0x96d5('0x3')](_0x96d5('0x11'),_0x51f19d[_0x96d5('0x10')],_0x51f19d['origtransferercalleridnum'],_0x51f19d['origtransferercalleridname'],_0x51f19d['transfertargetcalleridnum'],_0x51f19d[_0x96d5('0x12')]));_0x51f19d=_[_0x96d5('0x13')](_0x51f19d,{'transfererchannel':_0x51f19d[_0x96d5('0x14')],'transferercalleridnum':_0x51f19d[_0x96d5('0x15')],'transferercalleridname':_0x51f19d[_0x96d5('0x16')],'transfererconnectedlinenum':_0x51f19d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x51f19d[_0x96d5('0x17')],'transfereraccountcode':_0x51f19d[_0x96d5('0x18')],'transferercontext':_0x51f19d[_0x96d5('0x19')],'transfererexten':_0x51f19d[_0x96d5('0x1a')],'transfererlinkedid':_0x51f19d[_0x96d5('0x1b')],'context':_0x51f19d[_0x96d5('0x1c')],'extension':_0x51f19d['origtransfererexten'],'type':'attended'});if(_[_0x96d5('0x1d')](_0x51f19d[_0x96d5('0x1e')])){_0x51f19d=_[_0x96d5('0x13')](_0x51f19d,{'transfereechannel':_0x51f19d[_0x96d5('0x1f')],'transfereecalleridnum':_0x51f19d[_0x96d5('0x20')],'transfereecalleridname':_0x51f19d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x51f19d[_0x96d5('0x21')],'transfereeconnectedlinename':_0x51f19d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x51f19d[_0x96d5('0x22')],'transfereecontext':_0x51f19d['transfertargetcontext'],'transfereeexten':_0x51f19d['transfertargetexten'],'transfereelinkedid':_0x51f19d[_0x96d5('0x23')]});}writeDB(_0x51f19d);}catch(_0x130d3a){utils[_0x96d5('0xf')](util[_0x96d5('0x3')]('[%s][transfers][attendedtransfer]',_0x51f19d[_0x96d5('0x10')]),_0x130d3a);}}; \ No newline at end of file +var _0x3e7e=['transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfereruniqueid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','request','CreateVoiceTransferReport','blinds','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','error','debug','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname'];(function(_0x159f26,_0xf2d107){var _0x59b826=function(_0x5a5233){while(--_0x5a5233){_0x159f26['push'](_0x159f26['shift']());}};_0x59b826(++_0xf2d107);}(_0x3e7e,0x8e));var _0xe3e7=function(_0x15959c,_0x2ddb06){_0x15959c=_0x15959c-0x0;var _0x59b2d5=_0x3e7e[_0x15959c];return _0x59b2d5;};'use strict';var _=require(_0xe3e7('0x0'));var util=require(_0xe3e7('0x1'));var utils=require(_0xe3e7('0x2'));function writeDB(_0x4da48){utils[_0xe3e7('0x3')](util[_0xe3e7('0x4')](_0xe3e7('0x5'),_0x4da48['type']===_0xe3e7('0x6')?_0x4da48['origtransfereruniqueid']:_0x4da48[_0xe3e7('0x7')],_0x4da48[_0xe3e7('0x8')]));utils[_0xe3e7('0x9')](_0xe3e7('0xa'),_0x4da48);}exports[_0xe3e7('0xb')]={};exports['blindtransfer']=function(_0x434063){try{utils['debug'](util[_0xe3e7('0x4')](_0xe3e7('0xc'),_0x434063['uniqueid']),_0x434063);utils[_0xe3e7('0x3')](util['format'](_0xe3e7('0xd'),_0x434063['uniqueid'],_0x434063[_0xe3e7('0xe')],_0x434063['transferercalleridname'],_0x434063['transfereecalleridnum'],_0x434063[_0xe3e7('0xf')]));_0x434063['type']=_0xe3e7('0x10');exports[_0xe3e7('0xb')][_0x434063['transfereruniqueid']]=_0x434063;writeDB(_0x434063);}catch(_0x14c718){utils[_0xe3e7('0x11')](util[_0xe3e7('0x4')](_0xe3e7('0xc'),_0x434063[_0xe3e7('0x7')]),_0x14c718);}};exports['attendedtransfer']=function(_0x55fb15){try{utils[_0xe3e7('0x12')](util[_0xe3e7('0x4')](_0xe3e7('0x13'),_0x55fb15['origtransfereruniqueid']),_0x55fb15);utils['info'](util[_0xe3e7('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x55fb15['origtransfereruniqueid'],_0x55fb15[_0xe3e7('0x14')],_0x55fb15[_0xe3e7('0x15')],_0x55fb15['transfertargetcalleridnum'],_0x55fb15[_0xe3e7('0x16')]));_0x55fb15=_['assign'](_0x55fb15,{'transfererchannel':_0x55fb15[_0xe3e7('0x17')],'transferercalleridnum':_0x55fb15['origtransferercalleridnum'],'transferercalleridname':_0x55fb15[_0xe3e7('0x15')],'transfererconnectedlinenum':_0x55fb15[_0xe3e7('0x18')],'transfererconnectedlinename':_0x55fb15[_0xe3e7('0x19')],'transfereraccountcode':_0x55fb15['origtransfereraccountcode'],'transferercontext':_0x55fb15[_0xe3e7('0x1a')],'transfererexten':_0x55fb15[_0xe3e7('0x1b')],'transfererlinkedid':_0x55fb15[_0xe3e7('0x1c')],'context':_0x55fb15[_0xe3e7('0x1d')],'extension':_0x55fb15[_0xe3e7('0x1e')],'type':_0xe3e7('0x6')});if(_[_0xe3e7('0x1f')](_0x55fb15[_0xe3e7('0x20')])){_0x55fb15=_[_0xe3e7('0x21')](_0x55fb15,{'transfereechannel':_0x55fb15[_0xe3e7('0x22')],'transfereecalleridnum':_0x55fb15['transfertargetcalleridnum'],'transfereecalleridname':_0x55fb15[_0xe3e7('0x16')],'transfereeconnectedlinenum':_0x55fb15[_0xe3e7('0x23')],'transfereeconnectedlinename':_0x55fb15['transfertargetconnectedlinename'],'transfereeaccountcode':_0x55fb15[_0xe3e7('0x24')],'transfereecontext':_0x55fb15[_0xe3e7('0x25')],'transfereeexten':_0x55fb15[_0xe3e7('0x26')],'transfereelinkedid':_0x55fb15[_0xe3e7('0x27')]});}writeDB(_0x55fb15);}catch(_0x9f5c91){utils['error'](util[_0xe3e7('0x4')](_0xe3e7('0x13'),_0x55fb15[_0xe3e7('0x28')]),_0x9f5c91);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2e28d00..45a907d 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c32=['request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','notfound','[utils][getUserByInterface]','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','format','diffTime','diff','isBefore','jayson/promise','client','http','../../config/logger','info','inspect','debug','error'];(function(_0x5e7360,_0x851fcc){var _0x5c55ab=function(_0x3bd2ab){while(--_0x3bd2ab){_0x5e7360['push'](_0x5e7360['shift']());}};_0x5c55ab(++_0x851fcc);}(_0x9c32,0xbb));var _0x29c3=function(_0xa85aae,_0x139625){_0xa85aae=_0xa85aae-0x0;var _0x366a91=_0x9c32[_0xa85aae];return _0x366a91;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x29c3('0x0'));var moment=require('moment');var util=require('util');var client=jayson[_0x29c3('0x1')][_0x29c3('0x2')]({'port':0x2329});var logger=require(_0x29c3('0x3'))('xdr');exports[_0x29c3('0x4')]=function(_0x402499,_0x40b2bf){logger[_0x29c3('0x4')](_0x402499,_0x40b2bf?util[_0x29c3('0x5')](_0x40b2bf,{'showHidden':![],'depth':null}):'');};exports[_0x29c3('0x6')]=function(_0x373ed0,_0x424874){logger[_0x29c3('0x6')](_0x373ed0,_0x424874?util[_0x29c3('0x5')](_0x424874,{'showHidden':![],'depth':null}):'');};exports[_0x29c3('0x7')]=function(_0xa5dfeb,_0x553e70){logger[_0x29c3('0x7')](_0xa5dfeb,_0x553e70?util[_0x29c3('0x5')](_0x553e70,{'showHidden':![],'depth':null}):'');};exports[_0x29c3('0x8')]=function(_0x590452,_0x22c128){return client[_0x29c3('0x8')](_0x590452,{'body':_0x22c128})[_0x29c3('0x9')](function(_0x53aec3){logger['debug'](_0x29c3('0xa'),_0x590452,_0x53aec3?util['inspect'](_0x53aec3,{'showHidden':![],'depth':null}):'');})[_0x29c3('0xb')](function(_0x5f157f){logger[_0x29c3('0x7')](_0x29c3('0xa'),_0x590452,_0x5f157f?util[_0x29c3('0x5')](_0x5f157f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x486a10){return client[_0x29c3('0x8')](_0x29c3('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x29c3('0xd'),_0x29c3('0xe')],'where':_0x486a10,'limit':0x1}})[_0x29c3('0x9')](function(_0x9ee76f){logger[_0x29c3('0x6')](_0x29c3('0xf'),JSON[_0x29c3('0x10')](_0x486a10),_0x9ee76f?util['inspect'](_0x9ee76f,{'showHidden':![],'depth':null}):'');return _0x9ee76f[_0x29c3('0x11')]['length']?_0x9ee76f[_0x29c3('0x11')][0x0]:null;});}exports[_0x29c3('0x12')]=function(_0x531088){return new BPromise(function(_0x143f3c,_0x284b80){if(_0x531088){return getUser({'internal':_0x531088})[_0x29c3('0x9')](function(_0x3f8a9e){logger[_0x29c3('0x4')](_0x29c3('0x13'),_0x531088,_0x3f8a9e?_0x29c3('0x14'):'notfound');return _0x143f3c(_0x3f8a9e);})[_0x29c3('0xb')](function(_0x37a6e8){logger[_0x29c3('0x7')](_0x29c3('0x15'),_0x37a6e8?util[_0x29c3('0x5')](_0x37a6e8,{'showHidden':![],'depth':null}):'');return _0x143f3c(null);});}return _0x143f3c(null);});};exports['getUserByInterface']=function(_0x9c29c4){return new BPromise(function(_0x4183bb,_0x308f88){if(_0x9c29c4){return getUser({'interface':_0x9c29c4})[_0x29c3('0x9')](function(_0x507778){logger[_0x29c3('0x4')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x9c29c4,_0x507778?_0x29c3('0x14'):_0x29c3('0x16'));return _0x4183bb(_0x507778);})['catch'](function(_0x369c8f){logger['error'](_0x29c3('0x17'),_0x369c8f?util['inspect'](_0x369c8f,{'showHidden':![],'depth':null}):'');return _0x4183bb(null);});}return _0x4183bb(null);});};exports['getUserByName']=function(_0x3d10f1){return new BPromise(function(_0x5684c8,_0x4d45e6){if(_0x3d10f1){return getUser({'name':_0x3d10f1})[_0x29c3('0x9')](function(_0xa9a7bd){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x3d10f1,_0xa9a7bd?_0x29c3('0x14'):_0x29c3('0x16'));return _0x5684c8(_0xa9a7bd);})[_0x29c3('0xb')](function(_0x511341){logger['error']('[utils][getUserByName]',_0x511341?util[_0x29c3('0x5')](_0x511341,{'showHidden':![],'depth':null}):'');return _0x5684c8(null);});}return _0x5684c8(null);});};exports['getVoiceQueueByName']=function(_0x5b6044){return new BPromise(function(_0x69ae6f,_0x3aedf3){if(_0x5b6044){return client['request'](_0x29c3('0x18'),{'options':{'raw':!![],'attributes':['id',_0x29c3('0xd'),_0x29c3('0x19'),_0x29c3('0x1a'),'acwTimeout'],'where':{'name':_0x5b6044},'limit':0x1}})['then'](function(_0x490200){logger[_0x29c3('0x6')](_0x29c3('0x1b'),_0x5b6044,_0x490200?util[_0x29c3('0x5')](_0x490200,{'showHidden':![],'depth':null}):'');logger[_0x29c3('0x4')](_0x29c3('0x1c'),_0x5b6044,_0x490200?'found':_0x29c3('0x16'));return _0x69ae6f(_0x490200[_0x29c3('0x11')][_0x29c3('0x1d')]?_0x490200[_0x29c3('0x11')][0x0]:null);})[_0x29c3('0xb')](function(_0x54e50f){logger[_0x29c3('0x7')](_0x29c3('0x1e'),_0x54e50f?util[_0x29c3('0x5')](_0x54e50f,{'showHidden':![],'depth':null}):'');return _0x69ae6f(null);});}return _0x69ae6f(null);});};exports[_0x29c3('0x1f')]=function(_0x166400,_0x218626){return moment(_0x166400)[_0x29c3('0x20')](_0x218626,_0x29c3('0x21'))['format'](_0x29c3('0x22'));};exports['subtractTime']=function(_0x1890dd,_0x5c3266){return moment(_0x1890dd)['subtract'](_0x5c3266,'seconds')[_0x29c3('0x23')](_0x29c3('0x22'));};exports[_0x29c3('0x24')]=function(_0x1f7ba2,_0x443b42){return moment(_0x1f7ba2)[_0x29c3('0x25')](moment(_0x443b42),_0x29c3('0x21'));};exports['sumTime']=function(_0x18965c,_0x3b45d0){return parseInt(_0x18965c,0xa)+parseInt(_0x3b45d0,0xa);};exports['now']=function(){return moment()['format'](_0x29c3('0x22'));};exports['isAfter']=function(_0x10fa5a,_0x28e2de){if(_0x28e2de){return moment(_0x10fa5a)['isAfter'](_0x28e2de);}return!![];};exports[_0x29c3('0x26')]=function(_0x1d0b7c,_0x4b2183){if(_0x4b2183){return moment(_0x1d0b7c)[_0x29c3('0x26')](_0x4b2183);}else if(_0x1d0b7c){return!![];}return![];}; \ No newline at end of file +var _0x2f8f=['isBefore','bluebird','jayson/promise','moment','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','now','isAfter'];(function(_0xe62b83,_0x5bf4c8){var _0x3ce0de=function(_0x4701a1){while(--_0x4701a1){_0xe62b83['push'](_0xe62b83['shift']());}};_0x3ce0de(++_0x5bf4c8);}(_0x2f8f,0x13c));var _0xf2f8=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x2f8f[_0x43fdf8];return _0x1160c6;};'use strict';var BPromise=require(_0xf2f8('0x0'));var jayson=require(_0xf2f8('0x1'));var moment=require(_0xf2f8('0x2'));var util=require('util');var client=jayson[_0xf2f8('0x3')][_0xf2f8('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xf2f8('0x5'));exports[_0xf2f8('0x6')]=function(_0x4a85d7,_0x1676a7){logger['info'](_0x4a85d7,_0x1676a7?util[_0xf2f8('0x7')](_0x1676a7,{'showHidden':![],'depth':null}):'');};exports[_0xf2f8('0x8')]=function(_0xf045cb,_0x52973d){logger[_0xf2f8('0x8')](_0xf045cb,_0x52973d?util[_0xf2f8('0x7')](_0x52973d,{'showHidden':![],'depth':null}):'');};exports[_0xf2f8('0x9')]=function(_0x4deb5d,_0x3fcf2d){logger[_0xf2f8('0x9')](_0x4deb5d,_0x3fcf2d?util[_0xf2f8('0x7')](_0x3fcf2d,{'showHidden':![],'depth':null}):'');};exports[_0xf2f8('0xa')]=function(_0x1fcc1b,_0x208a2a){return client[_0xf2f8('0xa')](_0x1fcc1b,{'body':_0x208a2a})[_0xf2f8('0xb')](function(_0x446743){logger['debug']('[utils][request]\x20name:%s',_0x1fcc1b,_0x446743?util[_0xf2f8('0x7')](_0x446743,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x4bc336){logger[_0xf2f8('0x9')](_0xf2f8('0xc'),_0x1fcc1b,_0x4bc336?util[_0xf2f8('0x7')](_0x4bc336,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5c23de){return client[_0xf2f8('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf2f8('0xd'),'name',_0xf2f8('0xe')],'where':_0x5c23de,'limit':0x1}})[_0xf2f8('0xb')](function(_0x58d525){logger[_0xf2f8('0x8')](_0xf2f8('0xf'),JSON['stringify'](_0x5c23de),_0x58d525?util[_0xf2f8('0x7')](_0x58d525,{'showHidden':![],'depth':null}):'');return _0x58d525[_0xf2f8('0x10')][_0xf2f8('0x11')]?_0x58d525[_0xf2f8('0x10')][0x0]:null;});}exports[_0xf2f8('0x12')]=function(_0x4413de){return new BPromise(function(_0x596cb7,_0x35d787){if(_0x4413de){return getUser({'internal':_0x4413de})[_0xf2f8('0xb')](function(_0x1730f4){logger[_0xf2f8('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4413de,_0x1730f4?_0xf2f8('0x13'):'notfound');return _0x596cb7(_0x1730f4);})['catch'](function(_0x137ee1){logger[_0xf2f8('0x9')]('[utils][getUserByInternal]',_0x137ee1?util[_0xf2f8('0x7')](_0x137ee1,{'showHidden':![],'depth':null}):'');return _0x596cb7(null);});}return _0x596cb7(null);});};exports[_0xf2f8('0x14')]=function(_0x64fa64){return new BPromise(function(_0x267b6e,_0x2da8e4){if(_0x64fa64){return getUser({'interface':_0x64fa64})[_0xf2f8('0xb')](function(_0x57c27e){logger['info'](_0xf2f8('0x15'),_0x64fa64,_0x57c27e?_0xf2f8('0x13'):_0xf2f8('0x16'));return _0x267b6e(_0x57c27e);})[_0xf2f8('0x17')](function(_0x531619){logger[_0xf2f8('0x9')](_0xf2f8('0x18'),_0x531619?util[_0xf2f8('0x7')](_0x531619,{'showHidden':![],'depth':null}):'');return _0x267b6e(null);});}return _0x267b6e(null);});};exports[_0xf2f8('0x19')]=function(_0x213005){return new BPromise(function(_0x56461d,_0x1aa3fa){if(_0x213005){return getUser({'name':_0x213005})['then'](function(_0xf45da8){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x213005,_0xf45da8?'found':'notfound');return _0x56461d(_0xf45da8);})[_0xf2f8('0x17')](function(_0x40ad31){logger[_0xf2f8('0x9')](_0xf2f8('0x1a'),_0x40ad31?util[_0xf2f8('0x7')](_0x40ad31,{'showHidden':![],'depth':null}):'');return _0x56461d(null);});}return _0x56461d(null);});};exports[_0xf2f8('0x1b')]=function(_0x13adb6){return new BPromise(function(_0x20b9f,_0x5f42e4){if(_0x13adb6){return client[_0xf2f8('0xa')](_0xf2f8('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xf2f8('0x1d'),_0xf2f8('0x1e'),'acw','acwTimeout'],'where':{'name':_0x13adb6},'limit':0x1}})[_0xf2f8('0xb')](function(_0x50a0bc){logger[_0xf2f8('0x8')](_0xf2f8('0x1f'),_0x13adb6,_0x50a0bc?util['inspect'](_0x50a0bc,{'showHidden':![],'depth':null}):'');logger[_0xf2f8('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x13adb6,_0x50a0bc?_0xf2f8('0x13'):'notfound');return _0x20b9f(_0x50a0bc[_0xf2f8('0x10')]['length']?_0x50a0bc['result'][0x0]:null);})[_0xf2f8('0x17')](function(_0x1d6218){logger['error'](_0xf2f8('0x20'),_0x1d6218?util[_0xf2f8('0x7')](_0x1d6218,{'showHidden':![],'depth':null}):'');return _0x20b9f(null);});}return _0x20b9f(null);});};exports[_0xf2f8('0x21')]=function(_0x2d9c06,_0x39a408){return moment(_0x2d9c06)[_0xf2f8('0x22')](_0x39a408,_0xf2f8('0x23'))[_0xf2f8('0x24')](_0xf2f8('0x25'));};exports[_0xf2f8('0x26')]=function(_0x524fa8,_0x443275){return moment(_0x524fa8)['subtract'](_0x443275,_0xf2f8('0x23'))[_0xf2f8('0x24')](_0xf2f8('0x25'));};exports[_0xf2f8('0x27')]=function(_0x59d8c5,_0x259b92){return moment(_0x59d8c5)[_0xf2f8('0x28')](moment(_0x259b92),_0xf2f8('0x23'));};exports[_0xf2f8('0x29')]=function(_0x216d35,_0x3648e0){return parseInt(_0x216d35,0xa)+parseInt(_0x3648e0,0xa);};exports[_0xf2f8('0x2a')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf2f8('0x2b')]=function(_0x241eed,_0x240b27){if(_0x240b27){return moment(_0x241eed)[_0xf2f8('0x2b')](_0x240b27);}return!![];};exports['isBefore']=function(_0x43f690,_0x2dbebb){if(_0x2dbebb){return moment(_0x43f690)[_0xf2f8('0x2c')](_0x2dbebb);}else if(_0x43f690){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 3df127d..b462a86 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a84=['role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','client','name','then','user','no-user','data','catch','api','auth','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode'];(function(_0x44d88c,_0x4e0cb4){var _0x508da7=function(_0x464d98){while(--_0x464d98){_0x44d88c['push'](_0x44d88c['shift']());}};_0x508da7(++_0x4e0cb4);}(_0x3a84,0xbf));var _0x43a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a84[_0x3dd15e];return _0x231fd0;};var fs=require(_0x43a8('0x0'));var _=require(_0x43a8('0x1'));var ewinston=require(_0x43a8('0x2'));var path=require(_0x43a8('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0x43a8('0x4')];var safeTemplate=require(_0x43a8('0x5'))[_0x43a8('0x6')];var maskSensitiveData=require(_0x43a8('0x7'))[_0x43a8('0x8')];function ClientSideLogger(){function _0xcf8a84(_0x3259a1){var _0x4a2409=path[_0x43a8('0x9')](_0x43a8('0xa'),'log',_0x43a8('0xb'));var _0xf074be=path[_0x43a8('0x9')](_0x43a8('0xc'),_0x3259a1['role']+'-'+_0x3259a1[_0x43a8('0xd')]);return fs['ensureDir'](path[_0x43a8('0x9')](_0x4a2409,_0xf074be))[_0x43a8('0xe')](function(){var _0x1ab4a7=fileLogger(_0x43a8('0xc'),path[_0x43a8('0x9')](_0x4a2409,_0xf074be));return _0x1ab4a7;})['catch'](function(_0x59faa9){throw _0x59faa9;});}this['log']=function(_0xa7d78f,_0x5a6ac8,_0x32151a,_0x708ffd){return _0xcf8a84(_0xa7d78f['user'])[_0x43a8('0xe')](function(_0x3d8ae3){var _0x16bd20=_0x3d8ae3[_0x5a6ac8];return _0x16bd20;})[_0x43a8('0xe')](function(_0x1b610a){var _0x4271cd=_0xa7d78f[_0x43a8('0xf')]?_0xa7d78f[_0x43a8('0xf')]['id']:_0x43a8('0x10');var _0x11ef26=_0x708ffd[_0x43a8('0x11')];var _0xe10556=_0x708ffd['timestamp'];var _0x57e320=new Date(Number(_0xe10556));return _0x1b610a(_0x4271cd,_0x57e320,_0x32151a,_0x11ef26);})[_0x43a8('0x12')](function(_0x33402c){fileLogger(_0x43a8('0xc'))['error'](_0x33402c);});};}function setupLoggers(_0x463ed3){return new Promise(function(_0x3f2743){var _0x122a9f=new ClientSideLogger();var _0x33ca51=fileLogger(_0x43a8('0x13'));var _0x46d256=fileLogger(_0x43a8('0x14'));_0x463ed3['set'](_0x43a8('0x15'),_0x122a9f);_0x463ed3['use'](ewinston[_0x43a8('0x16')]({'winstonInstance':_0x33ca51,'meta':![],'statusLevels':!![],'msg':function(_0x17e71b,_0x354f11){var _0x4ee583=_0x43a8('0x17');if(!_[_0x43a8('0x18')](_0x17e71b[_0x43a8('0x19')])){_0x4ee583+=_0x43a8('0x1a');var _0x56a044=_0x17e71b[_0x43a8('0x19')];maskSensitiveData(_0x56a044);}return safeTemplate(util['format'](_0x4ee583,_0x17e71b[_0x43a8('0x1b')],_0x17e71b[_0x43a8('0x1c')][_0x43a8('0x1d')]?_0x17e71b['headers'][_0x43a8('0x1d')]:_0x17e71b[_0x43a8('0x1e')][_0x43a8('0x1f')]||_0x17e71b['ip'],_0x17e71b[_0x43a8('0x20')],_0x354f11[_0x43a8('0x21')],_0x354f11['responseTime'],_0x17e71b[_0x43a8('0xf')]?_0x17e71b[_0x43a8('0xf')]['id']:null,_0x17e71b['user']?_0x17e71b[_0x43a8('0xf')][_0x43a8('0xd')]:null,_0x17e71b['user']?_0x17e71b[_0x43a8('0xf')][_0x43a8('0x22')]:null,_0x56a044?util['inspect'](_0x56a044,![],null):''));}}));_0x463ed3[_0x43a8('0x23')](ewinston[_0x43a8('0x16')]({'winstonInstance':_0x46d256,'meta':![],'statusLevels':!![],'msg':function(_0x543022,_0x353d5a){var _0x332c16=_0x43a8('0x24');if(_0x543022[_0x43a8('0x19')]&&_0x543022['body'][_0x43a8('0x25')]&&_0x543022[_0x43a8('0x19')][_0x43a8('0x26')]){_0x332c16=_0x43a8('0x27');}return util['format'](_0x332c16,_0x543022[_0x43a8('0x1b')],_0x543022['headers']['x-forwarded-for']?_0x543022[_0x43a8('0x1c')][_0x43a8('0x1d')]:_0x543022[_0x43a8('0x1e')][_0x43a8('0x1f')]||_0x543022['ip'],_0x543022['url'],_0x353d5a[_0x43a8('0x21')],_0x353d5a[_0x43a8('0x28')],_0x543022[_0x43a8('0xf')]?_0x543022['user']['id']:null,_0x543022[_0x43a8('0xf')]?_0x543022['user'][_0x43a8('0xd')]:null,_0x543022[_0x43a8('0xf')]?_0x543022[_0x43a8('0xf')]['role']:null,_0x543022[_0x43a8('0x19')]&&_0x543022[_0x43a8('0x19')][_0x43a8('0x25')]?_0x543022['body'][_0x43a8('0x25')]:_0x43a8('0x29'),_0x543022[_0x43a8('0x19')]&&_0x543022[_0x43a8('0x19')][_0x43a8('0x26')]?_0x543022[_0x43a8('0x19')][_0x43a8('0x26')]:'',_0x543022['body']&&_0x543022[_0x43a8('0x19')][_0x43a8('0x2a')]?_0x543022[_0x43a8('0x19')][_0x43a8('0x2a')]:'');},'ignoreRoute':function(_0x465eb8){var _0x39b07b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x39b07b[_0x43a8('0x2b')](_0x465eb8['url']);}}));return _0x3f2743();});}exports[_0x43a8('0x2c')]=setupLoggers; \ No newline at end of file +var _0x6f55=['method','x-forwarded-for','headers','connection','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format'];(function(_0x33c90d,_0x56556a){var _0x4047ff=function(_0x9ae627){while(--_0x9ae627){_0x33c90d['push'](_0x33c90d['shift']());}};_0x4047ff(++_0x56556a);}(_0x6f55,0xd5));var _0x56f5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6f55[_0x36eaaa];return _0x461349;};var fs=require(_0x56f5('0x0'));var _=require(_0x56f5('0x1'));var ewinston=require('express-winston');var path=require(_0x56f5('0x2'));var util=require(_0x56f5('0x3'));var fileLogger=require(_0x56f5('0x4'))[_0x56f5('0x5')];var safeTemplate=require(_0x56f5('0x6'))[_0x56f5('0x7')];var maskSensitiveData=require(_0x56f5('0x8'))[_0x56f5('0x9')];function ClientSideLogger(){function _0x2d5f1e(_0x9c4337){var _0x2091e5=path[_0x56f5('0xa')](_0x56f5('0xb'),_0x56f5('0xc'),_0x56f5('0xd'));var _0x343697=path['join'](_0x56f5('0xe'),_0x9c4337[_0x56f5('0xf')]+'-'+_0x9c4337[_0x56f5('0x10')]);return fs[_0x56f5('0x11')](path[_0x56f5('0xa')](_0x2091e5,_0x343697))[_0x56f5('0x12')](function(){var _0xb5cd6c=fileLogger(_0x56f5('0xe'),path[_0x56f5('0xa')](_0x2091e5,_0x343697));return _0xb5cd6c;})[_0x56f5('0x13')](function(_0x17d010){throw _0x17d010;});}this[_0x56f5('0xc')]=function(_0x20a8b7,_0x52cc49,_0x508f4a,_0x51c1a0){return _0x2d5f1e(_0x20a8b7[_0x56f5('0x14')])[_0x56f5('0x12')](function(_0x4b2bbc){var _0x51bde1=_0x4b2bbc[_0x52cc49];return _0x51bde1;})[_0x56f5('0x12')](function(_0x25a94f){var _0x3eab5f=_0x20a8b7[_0x56f5('0x14')]?_0x20a8b7['user']['id']:_0x56f5('0x15');var _0x153a67=_0x51c1a0[_0x56f5('0x16')];var _0x11c1e1=_0x51c1a0['timestamp'];var _0x44248a=new Date(Number(_0x11c1e1));return _0x25a94f(_0x3eab5f,_0x44248a,_0x508f4a,_0x153a67);})['catch'](function(_0x2d3eaa){fileLogger(_0x56f5('0xe'))['error'](_0x2d3eaa);});};}function setupLoggers(_0x4ecd94){return new Promise(function(_0x2b3a87){var _0x6f2509=new ClientSideLogger();var _0xe4d62a=fileLogger(_0x56f5('0x17'));var _0x5ee509=fileLogger('auth');_0x4ecd94[_0x56f5('0x18')](_0x56f5('0x19'),_0x6f2509);_0x4ecd94[_0x56f5('0x1a')](ewinston[_0x56f5('0x1b')]({'winstonInstance':_0xe4d62a,'meta':![],'statusLevels':!![],'msg':function(_0x535743,_0x5c061c){var _0x536abc=_0x56f5('0x1c');if(!_[_0x56f5('0x1d')](_0x535743[_0x56f5('0x1e')])){_0x536abc+='\x20body=%s';var _0x34607e=_0x535743['body'];maskSensitiveData(_0x34607e);}return safeTemplate(util[_0x56f5('0x1f')](_0x536abc,_0x535743[_0x56f5('0x20')],_0x535743['headers'][_0x56f5('0x21')]?_0x535743[_0x56f5('0x22')]['x-forwarded-for']:_0x535743[_0x56f5('0x23')]['remoteAddress']||_0x535743['ip'],_0x535743[_0x56f5('0x24')],_0x5c061c[_0x56f5('0x25')],_0x5c061c[_0x56f5('0x26')],_0x535743[_0x56f5('0x14')]?_0x535743[_0x56f5('0x14')]['id']:null,_0x535743[_0x56f5('0x14')]?_0x535743['user'][_0x56f5('0x10')]:null,_0x535743[_0x56f5('0x14')]?_0x535743[_0x56f5('0x14')]['role']:null,_0x34607e?util[_0x56f5('0x27')](_0x34607e,![],null):''));}}));_0x4ecd94[_0x56f5('0x1a')](ewinston[_0x56f5('0x1b')]({'winstonInstance':_0x5ee509,'meta':![],'statusLevels':!![],'msg':function(_0xa15ece,_0x4362d0){var _0x2dad2c=_0x56f5('0x28');if(_0xa15ece[_0x56f5('0x1e')]&&_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x29')]&&_0xa15ece['body'][_0x56f5('0x2a')]){_0x2dad2c=_0x56f5('0x2b');}return util['format'](_0x2dad2c,_0xa15ece[_0x56f5('0x20')],_0xa15ece[_0x56f5('0x22')][_0x56f5('0x21')]?_0xa15ece[_0x56f5('0x22')][_0x56f5('0x21')]:_0xa15ece['connection'][_0x56f5('0x2c')]||_0xa15ece['ip'],_0xa15ece['url'],_0x4362d0[_0x56f5('0x25')],_0x4362d0[_0x56f5('0x26')],_0xa15ece[_0x56f5('0x14')]?_0xa15ece[_0x56f5('0x14')]['id']:null,_0xa15ece[_0x56f5('0x14')]?_0xa15ece[_0x56f5('0x14')][_0x56f5('0x10')]:null,_0xa15ece[_0x56f5('0x14')]?_0xa15ece[_0x56f5('0x14')][_0x56f5('0xf')]:null,_0xa15ece[_0x56f5('0x1e')]&&_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x29')]?_0xa15ece['body'][_0x56f5('0x29')]:_0x56f5('0x2d'),_0xa15ece['body']&&_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x2a')]?_0xa15ece[_0x56f5('0x1e')]['agent_id']:'',_0xa15ece[_0x56f5('0x1e')]&&_0xa15ece['body'][_0x56f5('0x2e')]?_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x2e')]:'');},'ignoreRoute':function(_0x1ece83){var _0x566b79=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x566b79[_0x56f5('0x2f')](_0x1ece83[_0x56f5('0x24')]);}}));return _0x2b3a87();});}exports[_0x56f5('0x30')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 8152288..35a71e2 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d5d=['ddd','includes','date','daysInMonth','max','min','MMM','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','locale','weekdaysShort','toLowerCase','slice','concat','exports','circularDoWInterval','monthsShort','indexOf','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','isBetween','timeCompare','format'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x9d5d,0x144));var _0xd9d5=function(_0x5b2fd6,_0x3ac3cb){_0x5b2fd6=_0x5b2fd6-0x0;var _0x8dbc5b=_0x9d5d[_0x5b2fd6];return _0x8dbc5b;};var _=require(_0xd9d5('0x0'));var moment=require(_0xd9d5('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][_0xd9d5('0x2')](function(_0x5dc798){return _0x5dc798[_0xd9d5('0x3')];})[_0xd9d5('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xd9d5('0x5');var EINVALID_DATE=_0xd9d5('0x6');function throwIfDateNotValid(_0x22a34d){if(!_0x22a34d['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x169504){var _0x389c9d=_0x169504[_0xd9d5('0x7')](':')['map'](function(_0x1ea43d){return parseInt(_0x1ea43d,0xa);});var _0x559327=_0x389c9d[0x0];var _0xa7ea3=_0x389c9d[0x1];if(_0x559327<0x0||_0x559327>0x17||_0xa7ea3<0x0||_0xa7ea3>0x3b){throw new Error(EINVALID_DATE);}return[_0x559327,_0xa7ea3];}function circularDoWInterval(_0x45bc9a,_0x5a4cfd){if(_0x45bc9a===_0x5a4cfd){return[_0x45bc9a];}else{var _0x3dfad0=moment['locale']();moment[_0xd9d5('0x8')]('en');var _0x16cab5=moment[_0xd9d5('0x9')]()['map'](function(_0x111c7e){return _0x111c7e[_0xd9d5('0xa')]();});moment['locale'](_0x3dfad0);var _0x29f762=_0x16cab5['indexOf'](_0x45bc9a);var _0x1d42df=_0x16cab5['indexOf'](_0x5a4cfd);if(_0x1d42df>_0x29f762){return _0x16cab5[_0xd9d5('0xb')](_0x29f762,_0x1d42df+0x1);}else{var _0x2bbff6=_0x16cab5[_0xd9d5('0xb')](0x0,_0x1d42df+0x1);var _0x21ccc2=_0x16cab5['slice'](_0x29f762);return _0x21ccc2[_0xd9d5('0xc')](_0x2bbff6);}}}module[_0xd9d5('0xd')][_0xd9d5('0xe')]=circularDoWInterval;function circularMonthInterval(_0x37e811,_0x1a8272){if(_0x37e811===_0x1a8272){return[_0x37e811];}else{var _0x3eaebd=moment[_0xd9d5('0x8')]();moment[_0xd9d5('0x8')]('en');var _0x117b3f=moment[_0xd9d5('0xf')]()[_0xd9d5('0x2')](function(_0x23d86a){return _0x23d86a['toLowerCase']();});moment[_0xd9d5('0x8')](_0x3eaebd);var _0xdac44=_0x117b3f[_0xd9d5('0x10')](_0x37e811);var _0x346ddc=_0x117b3f[_0xd9d5('0x10')](_0x1a8272);if(_0x346ddc>_0xdac44){return _0x117b3f[_0xd9d5('0xb')](_0xdac44,_0x346ddc+0x1);}else{var _0xffed52=_0x117b3f[_0xd9d5('0xb')](0x0,_0x346ddc+0x1);var _0x5b1e3d=_0x117b3f[_0xd9d5('0xb')](_0xdac44);return _0x5b1e3d[_0xd9d5('0xc')](_0xffed52);}}}module[_0xd9d5('0xd')][_0xd9d5('0x11')]=circularMonthInterval;function parseDom(_0x5682f2){var _0x114cc9=parseInt(_0x5682f2,0xa);if(_0x114cc9<0x1||_0x114cc9>0x1f){throw new Error(EINVALID_DATE);}return _0x114cc9;}function timeCompare(_0x4b2230,_0x9efdb8,_0xb95157){var _0xb91506=_0x4b2230[_0xd9d5('0x12')]();var _0x55a586=extractTime(_0x9efdb8);var _0x549d67=_0x55a586[0x0];var _0x241075=_0x55a586[0x1];var _0x4a951f=_0x4b2230[_0xd9d5('0x12')]()[_0xd9d5('0x13')](_0x549d67)[_0xd9d5('0x14')](_0x241075);throwIfDateNotValid(_0x4a951f);var _0x267ef4=extractTime(_0xb95157);var _0xc5da98=_0x267ef4[0x0];var _0x44cbe1=_0x267ef4[0x1];var _0x4c47f2=_0x4b2230['clone']()[_0xd9d5('0x13')](_0xc5da98)[_0xd9d5('0x14')](_0x44cbe1);throwIfDateNotValid(_0x4c47f2);if(_0x4c47f2[_0xd9d5('0x15')](_0x4a951f)){var _0x36c71f=_0xb91506[_0xd9d5('0x12')]()[_0xd9d5('0x16')](_0xd9d5('0x17'));var _0x23accc=_0xb91506[_0xd9d5('0x12')]()['endOf']('day');return _0xb91506['isBetween'](_0x4a951f,_0x23accc,undefined,'[]')||_0xb91506[_0xd9d5('0x18')](_0x36c71f,_0x4c47f2,undefined,'[]');}else{return _0xb91506[_0xd9d5('0x18')](_0x4a951f,_0x4c47f2,undefined,'[]');}}module[_0xd9d5('0xd')][_0xd9d5('0x19')]=timeCompare;function dowCompare(_0x5af554,_0x221ef7,_0x524777){var _0x18bb4e=_0x5af554[_0xd9d5('0x8')]('en')[_0xd9d5('0x1a')](_0xd9d5('0x1b'))['toLowerCase']();return circularDoWInterval(_0x221ef7,_0x524777)[_0xd9d5('0x1c')](_0x18bb4e);}module[_0xd9d5('0xd')]['dowCompare']=dowCompare;function domCompare(_0x21d6fe,_0x52a66f,_0x4a6a6a){var _0x3149bf=_0x21d6fe[_0xd9d5('0x1d')]();if(_0x52a66f===_0x4a6a6a){return _0x3149bf===_0x52a66f;}else{var _0x5a9bde=_0x21d6fe[_0xd9d5('0x1e')]();var _0x286bfe=_0x52a66f<_0x4a6a6a;let _0x1673e7=![];var _0x454f7a=0x0;var _0x3777ed=0x0;if(_0x286bfe){_0x454f7a=Math[_0xd9d5('0x1f')](0x1,_0x52a66f);_0x3777ed=Math[_0xd9d5('0x20')](_0x4a6a6a,_0x5a9bde);_0x1673e7=_0x3149bf>=_0x454f7a&&_0x3149bf<=_0x3777ed;}else{_0x454f7a=Math[_0xd9d5('0x20')](_0x52a66f,_0x5a9bde);_0x3777ed=Math[_0xd9d5('0x1f')](0x1,_0x4a6a6a);_0x1673e7=_0x3149bf>=_0x454f7a||_0x3149bf<=_0x3777ed;}return _0x1673e7;}}module[_0xd9d5('0xd')]['domCompare']=domCompare;function monthCompare(_0xc21a71,_0x35d997,_0x1282a5){var _0x260781=_0xc21a71[_0xd9d5('0x8')]('en')[_0xd9d5('0x1a')](_0xd9d5('0x21'))['toLowerCase']();return circularMonthInterval(_0x35d997,_0x1282a5)[_0xd9d5('0x1c')](_0x260781);}module[_0xd9d5('0xd')]['monthCompare']=monthCompare;function iftime(_0x548a71,_0x474f1f=moment['tz']['guess'](),_0xd01b3c=moment()){if(!validateRx[_0xd9d5('0x22')](_0x548a71)){throw new Error(EINVALID_STRING);}else{var _0x2124e5=(moment[_0xd9d5('0x23')](_0xd01b3c)?_0xd01b3c['clone']():moment(_0xd01b3c))['tz'](_0x474f1f)['locale']('en');throwIfDateNotValid(_0x2124e5);var _0x4cd910=_0x548a71['split'](',');var _0x443353=_0x4cd910[0x0];var _0x3ec2c6=_0x4cd910[0x1];var _0x1c159d=_0x4cd910[0x2];var _0x429c4d=_0x4cd910[0x3];let _0x37df98=!![];if(_0x443353!=='*'){var _0x3be400=_0x443353['split']('-');var _0x3bb08c=_[_0xd9d5('0x24')](_0x3be400[0x0],0x5,'0');var _0x3f67a9=_0x3be400['length']===0x2?_[_0xd9d5('0x24')](_0x3be400[0x1],0x5,'0'):_0x3bb08c;_0x37df98=timeCompare(_0x2124e5,_0x3bb08c,_0x3f67a9);}let _0x4e228d=!![];if(_0x3ec2c6!=='*'){var _0x115da5=_0x3ec2c6[_0xd9d5('0x7')]('-');var _0x5ac493=_0x115da5[0x0];var _0x1e41d2=_0x115da5[_0xd9d5('0x25')]===0x2?_0x115da5[0x1]:_0x5ac493;_0x4e228d=dowCompare(_0x2124e5,_0x5ac493,_0x1e41d2);}let _0x43d1fa=!![];if(_0x1c159d!=='*'){var _0x1a3bed=_0x1c159d[_0xd9d5('0x7')]('-');var _0x8ba4d1=parseDom(_0x1a3bed[0x0]);var _0x20ca45=_0x1a3bed[_0xd9d5('0x25')]===0x2?parseDom(_0x1a3bed[0x1]):_0x8ba4d1;_0x43d1fa=domCompare(_0x2124e5,_0x8ba4d1,_0x20ca45);}let _0xa7013c=!![];if(_0x429c4d!=='*'){var _0x3ba14f=_0x429c4d[_0xd9d5('0x7')]('-');var _0x42a55b=_0x3ba14f[0x0];var _0x4b1994=_0x3ba14f[_0xd9d5('0x25')]===0x2?_0x3ba14f[0x1]:_0x3ba14f[0x0];_0xa7013c=monthCompare(_0x2124e5,_0x42a55b,_0x4b1994);}return _0x37df98&&_0x4e228d&&_0x43d1fa&&_0xa7013c;}}module[_0xd9d5('0xd')][_0xd9d5('0x26')]=iftime; \ No newline at end of file +var _0xf885=['minutes','day','endOf','isBetween','timeCompare','format','ddd','includes','date','min','max','domCompare','test','padStart','length','iftime','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours'];(function(_0x3e270c,_0x4474e7){var _0x985cab=function(_0x385964){while(--_0x385964){_0x3e270c['push'](_0x3e270c['shift']());}};_0x985cab(++_0x4474e7);}(_0xf885,0x130));var _0x5f88=function(_0x244f5d,_0x3c98c6){_0x244f5d=_0x244f5d-0x0;var _0x1a3886=_0xf885[_0x244f5d];return _0x1a3886;};var _=require('lodash');var moment=require(_0x5f88('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]['map'](function(_0xd2473a){return _0xd2473a[_0x5f88('0x1')];})[_0x5f88('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5f88('0x3');var EINVALID_DATE=_0x5f88('0x4');function throwIfDateNotValid(_0x3d0669){if(!_0x3d0669[_0x5f88('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x21819b){var _0x4bb05e=_0x21819b[_0x5f88('0x6')](':')[_0x5f88('0x7')](function(_0xbfe9d2){return parseInt(_0xbfe9d2,0xa);});var _0xe71b90=_0x4bb05e[0x0];var _0x342fd3=_0x4bb05e[0x1];if(_0xe71b90<0x0||_0xe71b90>0x17||_0x342fd3<0x0||_0x342fd3>0x3b){throw new Error(EINVALID_DATE);}return[_0xe71b90,_0x342fd3];}function circularDoWInterval(_0x2f7ac3,_0x4b90e2){if(_0x2f7ac3===_0x4b90e2){return[_0x2f7ac3];}else{var _0x2d2e89=moment[_0x5f88('0x8')]();moment[_0x5f88('0x8')]('en');var _0x22efd3=moment[_0x5f88('0x9')]()[_0x5f88('0x7')](function(_0x186f38){return _0x186f38[_0x5f88('0xa')]();});moment[_0x5f88('0x8')](_0x2d2e89);var _0x58ed16=_0x22efd3[_0x5f88('0xb')](_0x2f7ac3);var _0x3fddea=_0x22efd3[_0x5f88('0xb')](_0x4b90e2);if(_0x3fddea>_0x58ed16){return _0x22efd3[_0x5f88('0xc')](_0x58ed16,_0x3fddea+0x1);}else{var _0x47a963=_0x22efd3[_0x5f88('0xc')](0x0,_0x3fddea+0x1);var _0x266227=_0x22efd3['slice'](_0x58ed16);return _0x266227[_0x5f88('0xd')](_0x47a963);}}}module[_0x5f88('0xe')][_0x5f88('0xf')]=circularDoWInterval;function circularMonthInterval(_0x1f0f45,_0x4f58e4){if(_0x1f0f45===_0x4f58e4){return[_0x1f0f45];}else{var _0x2bd747=moment['locale']();moment[_0x5f88('0x8')]('en');var _0x2b5670=moment[_0x5f88('0x10')]()[_0x5f88('0x7')](function(_0x276576){return _0x276576['toLowerCase']();});moment[_0x5f88('0x8')](_0x2bd747);var _0x3a702a=_0x2b5670['indexOf'](_0x1f0f45);var _0x237239=_0x2b5670[_0x5f88('0xb')](_0x4f58e4);if(_0x237239>_0x3a702a){return _0x2b5670[_0x5f88('0xc')](_0x3a702a,_0x237239+0x1);}else{var _0x37da0a=_0x2b5670[_0x5f88('0xc')](0x0,_0x237239+0x1);var _0xb27f93=_0x2b5670[_0x5f88('0xc')](_0x3a702a);return _0xb27f93[_0x5f88('0xd')](_0x37da0a);}}}module['exports'][_0x5f88('0x11')]=circularMonthInterval;function parseDom(_0x15d7e1){var _0x55a15b=parseInt(_0x15d7e1,0xa);if(_0x55a15b<0x1||_0x55a15b>0x1f){throw new Error(EINVALID_DATE);}return _0x55a15b;}function timeCompare(_0x5d87bd,_0x3d1219,_0x16e0ab){var _0x28f55d=_0x5d87bd[_0x5f88('0x12')]();var _0x3adaa4=extractTime(_0x3d1219);var _0x6c9eca=_0x3adaa4[0x0];var _0x5b53a2=_0x3adaa4[0x1];var _0x7d4e6b=_0x5d87bd['clone']()[_0x5f88('0x13')](_0x6c9eca)[_0x5f88('0x14')](_0x5b53a2);throwIfDateNotValid(_0x7d4e6b);var _0x478d78=extractTime(_0x16e0ab);var _0x4e5754=_0x478d78[0x0];var _0x37dfb4=_0x478d78[0x1];var _0x489693=_0x5d87bd['clone']()[_0x5f88('0x13')](_0x4e5754)[_0x5f88('0x14')](_0x37dfb4);throwIfDateNotValid(_0x489693);if(_0x489693['isBefore'](_0x7d4e6b)){var _0x5646ff=_0x28f55d['clone']()['startOf'](_0x5f88('0x15'));var _0x5dbab3=_0x28f55d[_0x5f88('0x12')]()[_0x5f88('0x16')](_0x5f88('0x15'));return _0x28f55d[_0x5f88('0x17')](_0x7d4e6b,_0x5dbab3,undefined,'[]')||_0x28f55d[_0x5f88('0x17')](_0x5646ff,_0x489693,undefined,'[]');}else{return _0x28f55d['isBetween'](_0x7d4e6b,_0x489693,undefined,'[]');}}module[_0x5f88('0xe')][_0x5f88('0x18')]=timeCompare;function dowCompare(_0x19c596,_0x3bb91f,_0x1996f3){var _0x279aee=_0x19c596[_0x5f88('0x8')]('en')[_0x5f88('0x19')](_0x5f88('0x1a'))[_0x5f88('0xa')]();return circularDoWInterval(_0x3bb91f,_0x1996f3)[_0x5f88('0x1b')](_0x279aee);}module[_0x5f88('0xe')]['dowCompare']=dowCompare;function domCompare(_0x3e6928,_0x165da9,_0x19a46e){var _0x429a88=_0x3e6928[_0x5f88('0x1c')]();if(_0x165da9===_0x19a46e){return _0x429a88===_0x165da9;}else{var _0x2b80c9=_0x3e6928['daysInMonth']();var _0x26b203=_0x165da9<_0x19a46e;let _0x17e194=![];var _0x4cd75c=0x0;var _0x52e09b=0x0;if(_0x26b203){_0x4cd75c=Math['max'](0x1,_0x165da9);_0x52e09b=Math[_0x5f88('0x1d')](_0x19a46e,_0x2b80c9);_0x17e194=_0x429a88>=_0x4cd75c&&_0x429a88<=_0x52e09b;}else{_0x4cd75c=Math[_0x5f88('0x1d')](_0x165da9,_0x2b80c9);_0x52e09b=Math[_0x5f88('0x1e')](0x1,_0x19a46e);_0x17e194=_0x429a88>=_0x4cd75c||_0x429a88<=_0x52e09b;}return _0x17e194;}}module['exports'][_0x5f88('0x1f')]=domCompare;function monthCompare(_0x64f6,_0x318fa6,_0x3a8239){var _0x1f96cb=_0x64f6['locale']('en')[_0x5f88('0x19')]('MMM')[_0x5f88('0xa')]();return circularMonthInterval(_0x318fa6,_0x3a8239)[_0x5f88('0x1b')](_0x1f96cb);}module[_0x5f88('0xe')]['monthCompare']=monthCompare;function iftime(_0x4e5196,_0x51638a=moment['tz']['guess'](),_0x478335=moment()){if(!validateRx[_0x5f88('0x20')](_0x4e5196)){throw new Error(EINVALID_STRING);}else{var _0x2a4791=(moment['isMoment'](_0x478335)?_0x478335[_0x5f88('0x12')]():moment(_0x478335))['tz'](_0x51638a)[_0x5f88('0x8')]('en');throwIfDateNotValid(_0x2a4791);var _0x321f79=_0x4e5196[_0x5f88('0x6')](',');var _0x437723=_0x321f79[0x0];var _0x328ec0=_0x321f79[0x1];var _0x282db7=_0x321f79[0x2];var _0xba693e=_0x321f79[0x3];let _0x3762da=!![];if(_0x437723!=='*'){var _0x3043f7=_0x437723[_0x5f88('0x6')]('-');var _0x7cfe01=_[_0x5f88('0x21')](_0x3043f7[0x0],0x5,'0');var _0xd51da6=_0x3043f7[_0x5f88('0x22')]===0x2?_[_0x5f88('0x21')](_0x3043f7[0x1],0x5,'0'):_0x7cfe01;_0x3762da=timeCompare(_0x2a4791,_0x7cfe01,_0xd51da6);}let _0x303b10=!![];if(_0x328ec0!=='*'){var _0x21c9fe=_0x328ec0[_0x5f88('0x6')]('-');var _0x256d69=_0x21c9fe[0x0];var _0x5b3f55=_0x21c9fe[_0x5f88('0x22')]===0x2?_0x21c9fe[0x1]:_0x256d69;_0x303b10=dowCompare(_0x2a4791,_0x256d69,_0x5b3f55);}let _0x1df8ea=!![];if(_0x282db7!=='*'){var _0x2971b0=_0x282db7[_0x5f88('0x6')]('-');var _0x43a185=parseDom(_0x2971b0[0x0]);var _0x15bd26=_0x2971b0['length']===0x2?parseDom(_0x2971b0[0x1]):_0x43a185;_0x1df8ea=domCompare(_0x2a4791,_0x43a185,_0x15bd26);}let _0x530ebe=!![];if(_0xba693e!=='*'){var _0x464985=_0xba693e['split']('-');var _0x5a359f=_0x464985[0x0];var _0x1862f9=_0x464985[_0x5f88('0x22')]===0x2?_0x464985[0x1]:_0x464985[0x0];_0x530ebe=monthCompare(_0x2a4791,_0x5a359f,_0x1862f9);}return _0x3762da&&_0x303b10&&_0x1df8ea&&_0x530ebe;}}module['exports'][_0x5f88('0x23')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 5667315..f0b992d 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cb7=['toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','warn','transports','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x4cb7,0x1c8));var _0x74cb=function(_0x5af6b7,_0xb86b){_0x5af6b7=_0x5af6b7-0x0;var _0x1037bd=_0x4cb7[_0x5af6b7];return _0x1037bd;};'use strict';var path=require(_0x74cb('0x0'));var util=require(_0x74cb('0x1'));var moment=require(_0x74cb('0x2'));var winston=require(_0x74cb('0x3'));var config=require(_0x74cb('0x4'));var debugLevel=config[_0x74cb('0x5')]?config['debugLevel'][_0x74cb('0x6')]():_0x74cb('0x7');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':_0x74cb('0x8'),'error':_0x74cb('0x9'),'warn':_0x74cb('0xa'),'info':_0x74cb('0xb'),'print':_0x74cb('0xc'),'success':_0x74cb('0xd'),'http':_0x74cb('0xe'),'verbose':_0x74cb('0xf'),'debug':_0x74cb('0x10'),'silly':_0x74cb('0x11')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3f6edd,_0x51564f,_0xc15cf6){var _0x34c73c=_0x3f6edd||_0x74cb('0x12');return path[_0x74cb('0x13')](_0x34c73c,util[_0x74cb('0x14')]('%s-%s.log',_0x51564f,_0xc15cf6));}function formatter(_0x4c835d,_0x4fe05d){_0x4fe05d[_0x74cb('0x15')]=_0x4fe05d[_0x74cb('0x15')][_0x74cb('0x16')](/@@{/g,'{{{')[_0x74cb('0x16')](/}@@/g,_0x74cb('0x17'))[_0x74cb('0x16')](/@{/g,'{{')[_0x74cb('0x16')](/}@/g,'}}');return util['format'](_0x74cb('0x18'),moment()[_0x74cb('0x14')](_0x74cb('0x19')),_0x4fe05d['level'][_0x74cb('0x1a')](),_0x4c835d,_0x4fe05d[_0x74cb('0x15')]);}function fileFormat(_0x16760c,_0x2cfc42){_0x2cfc42[_0x74cb('0x15')]=_0x2cfc42['message'][_0x74cb('0x16')](/@@{/g,'{{{')[_0x74cb('0x16')](/}@@/g,_0x74cb('0x17'))['replace'](/@{/g,'{{')[_0x74cb('0x16')](/}@/g,'}}');var _0x2d82bf=_0x2cfc42[_0x74cb('0x1b')]&&Object[_0x74cb('0x1c')](_0x2cfc42[_0x74cb('0x1b')])[_0x74cb('0x1d')]?'\x0a\x09'+JSON[_0x74cb('0x1e')](_0x2cfc42[_0x74cb('0x1b')]):'';return util[_0x74cb('0x14')](_0x74cb('0x1f'),moment()[_0x74cb('0x14')](_0x74cb('0x19')),_0x2cfc42[_0x74cb('0x20')]['toUpperCase'](),_0x16760c,_0x2cfc42[_0x74cb('0x15')],_0x2d82bf);}function consoleLogger(){var _0x431576=new winston[(_0x74cb('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x74cb('0x22'),'json':![],'formatter':function(_0x51089a){return formatter('',_0x51089a);}})]});return _0x431576;}function fileLogger(_0x59c3c7,_0x911354){var _0x388ae5=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x74cb('0x23'))][(_0x74cb('0x24'))]({'name':util[_0x74cb('0x14')](_0x74cb('0x25'),_0x59c3c7,_0x74cb('0x26')),'filename':getLogFileName(_0x911354,_0x59c3c7,_0x74cb('0x26')),'level':_0x74cb('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1db65c){return fileFormat(_0x59c3c7,_0x1db65c);}}),new winston[(_0x74cb('0x23'))][(_0x74cb('0x24'))]({'name':util[_0x74cb('0x14')](_0x74cb('0x25'),_0x59c3c7,debugLevel),'filename':getLogFileName(_0x911354,_0x59c3c7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x54f8aa){return fileFormat(_0x59c3c7,_0x54f8aa);}}),new winston['transports'][(_0x74cb('0x27'))]({'level':'warn','json':![],'formatter':function(_0x46572f){return fileFormat(_0x59c3c7,_0x46572f);}})]});return _0x388ae5;}exports[_0x74cb('0x28')]=consoleLogger;exports[_0x74cb('0x29')]=fileLogger; \ No newline at end of file +var _0x539f=['bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','path','util','moment','../config/environment','debugLevel','toLowerCase','redBG\x20white','white','bold\x20white','bold\x20green','bold\x20blue'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x539f,0x18d));var _0xf539=function(_0x464bb0,_0x28c3d0){_0x464bb0=_0x464bb0-0x0;var _0x2ae2ac=_0x539f[_0x464bb0];return _0x2ae2ac;};'use strict';var path=require(_0xf539('0x0'));var util=require(_0xf539('0x1'));var moment=require(_0xf539('0x2'));var winston=require('winston');var config=require(_0xf539('0x3'));var debugLevel=config[_0xf539('0x4')]?config['debugLevel'][_0xf539('0x5')]():'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':_0xf539('0x6'),'error':'red','warn':'bold\x20yellow','info':_0xf539('0x7'),'print':_0xf539('0x8'),'success':_0xf539('0x9'),'http':'gray','verbose':'bold\x20magenta','debug':_0xf539('0xa'),'silly':_0xf539('0xb')};winston[_0xf539('0xc')](XC_LOG_COLORS);function getLogFileName(_0x502080,_0x5104e5,_0xcbdce0){var _0x565985=_0x502080||_0xf539('0xd');return path['join'](_0x565985,util[_0xf539('0xe')](_0xf539('0xf'),_0x5104e5,_0xcbdce0));}function formatter(_0x360e3e,_0x294dde){_0x294dde[_0xf539('0x10')]=_0x294dde[_0xf539('0x10')][_0xf539('0x11')](/@@{/g,_0xf539('0x12'))[_0xf539('0x11')](/}@@/g,'}}}')[_0xf539('0x11')](/@{/g,'{{')[_0xf539('0x11')](/}@/g,'}}');return util[_0xf539('0xe')](_0xf539('0x13'),moment()[_0xf539('0xe')](_0xf539('0x14')),_0x294dde[_0xf539('0x15')][_0xf539('0x16')](),_0x360e3e,_0x294dde[_0xf539('0x10')]);}function fileFormat(_0x1bb537,_0x5097c4){_0x5097c4['message']=_0x5097c4['message']['replace'](/@@{/g,_0xf539('0x12'))[_0xf539('0x11')](/}@@/g,_0xf539('0x17'))[_0xf539('0x11')](/@{/g,'{{')[_0xf539('0x11')](/}@/g,'}}');var _0x3f4720=_0x5097c4['meta']&&Object[_0xf539('0x18')](_0x5097c4['meta'])[_0xf539('0x19')]?'\x0a\x09'+JSON['stringify'](_0x5097c4['meta']):'';return util[_0xf539('0xe')](_0xf539('0x1a'),moment()[_0xf539('0xe')](_0xf539('0x14')),_0x5097c4[_0xf539('0x15')][_0xf539('0x16')](),_0x1bb537,_0x5097c4['message'],_0x3f4720);}function consoleLogger(){var _0x638532=new winston[(_0xf539('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf539('0x1c'))][(_0xf539('0x1d'))]({'level':_0xf539('0x1e'),'json':![],'formatter':function(_0x287a64){return formatter('',_0x287a64);}})]});return _0x638532;}function fileLogger(_0x39ea9b,_0x100a50){var _0x4641ac=new winston[(_0xf539('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf539('0x1c'))][(_0xf539('0x1f'))]({'name':util[_0xf539('0xe')](_0xf539('0x20'),_0x39ea9b,_0xf539('0x21')),'filename':getLogFileName(_0x100a50,_0x39ea9b,_0xf539('0x21')),'level':_0xf539('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26e709){return fileFormat(_0x39ea9b,_0x26e709);}}),new winston[(_0xf539('0x1c'))][(_0xf539('0x1f'))]({'name':util[_0xf539('0xe')](_0xf539('0x20'),_0x39ea9b,debugLevel),'filename':getLogFileName(_0x100a50,_0x39ea9b,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x33aba6){return fileFormat(_0x39ea9b,_0x33aba6);}}),new winston[(_0xf539('0x1c'))]['Console']({'level':_0xf539('0x1e'),'json':![],'formatter':function(_0x2f7966){return fileFormat(_0x39ea9b,_0x2f7966);}})]});return _0x4641ac;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index c2d20b7..56ba2b9 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _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(_0x48ceba,_0xa099af){var _0x374533=function(_0x273f92){while(--_0x273f92){_0x48ceba['push'](_0x48ceba['shift']());}};_0x374533(++_0xa099af);}(_0x66fa,0x117));var _0xa66f=function(_0x4c29f9,_0x2e70f7){_0x4c29f9=_0x4c29f9-0x0;var _0x39429d=_0x66fa[_0x4c29f9];return _0x39429d;};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 +var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x1a85,0x178));var _0x51a8=function(_0x24bbd5,_0x34a7c4){_0x24bbd5=_0x24bbd5-0x0;var _0x8fb737=_0x1a85[_0x24bbd5];return _0x8fb737;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index cb03859..52aa2d3 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['exports','{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce'];(function(_0x441c1d,_0x1ec65b){var _0x5a0078=function(_0x4807eb){while(--_0x4807eb){_0x441c1d['push'](_0x441c1d['shift']());}};_0x5a0078(++_0x1ec65b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x286ac2){return _0x286ac2==='{{'?_0x0baf('0x0'):_0x0baf('0x1');}function safeTemplate(_0x263f79){var _0x1688bc=_0x263f79;if(typeof _0x263f79===_0x0baf('0x2')){_0x1688bc=_0x263f79['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x0baf('0x3')](_0x263f79)){_0x1688bc=_0x263f79[_0x0baf('0x4')](function(_0x2d3fa5){return safeTemplate(_0x2d3fa5);});}else if(_[_0x0baf('0x5')](_0x263f79)){_0x1688bc=Object[_0x0baf('0x6')](_0x263f79)[_0x0baf('0x7')](function(_0x1a10b1,_0x2dcaac){_0x1a10b1[_0x2dcaac]=safeTemplate(_0x263f79[_0x2dcaac]);return _0x1a10b1;},{});}return _0x1688bc;}module[_0x0baf('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0xa571=['reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string','map','isPlainObject','keys'];(function(_0x3f91f7,_0xccc359){var _0x4962f2=function(_0x44a981){while(--_0x44a981){_0x3f91f7['push'](_0x3f91f7['shift']());}};_0x4962f2(++_0xccc359);}(_0xa571,0x107));var _0x1a57=function(_0x6840b2,_0x38f17f){_0x6840b2=_0x6840b2-0x0;var _0x5c0e64=_0xa571[_0x6840b2];return _0x5c0e64;};var _=require(_0x1a57('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x289e99){return _0x289e99==='{{'?_0x1a57('0x1'):_0x1a57('0x2');}function safeTemplate(_0x48485e){var _0x1a071f=_0x48485e;if(typeof _0x48485e===_0x1a57('0x3')){_0x1a071f=_0x48485e['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x48485e)){_0x1a071f=_0x48485e[_0x1a57('0x4')](function(_0x5067fa){return safeTemplate(_0x5067fa);});}else if(_[_0x1a57('0x5')](_0x48485e)){_0x1a071f=Object[_0x1a57('0x6')](_0x48485e)[_0x1a57('0x7')](function(_0x3c5352,_0x2492f5){_0x3c5352[_0x2492f5]=safeTemplate(_0x48485e[_0x2492f5]);return _0x3c5352;},{});}return _0x1a071f;}module[_0x1a57('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index d7ccafc..ce9412a 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfee=['server/app.json','legacy-libs','isArray','findIndex','apps','env','NODE_PATH','string','pathExists','then','readJSON','updated','writeJSON','exports','fs-extra','path','../config/environment','root','resolve'];(function(_0x1941aa,_0x4a0b42){var _0x5626eb=function(_0x3ab026){while(--_0x3ab026){_0x1941aa['push'](_0x1941aa['shift']());}};_0x5626eb(++_0x4a0b42);}(_0xbfee,0x80));var _0xebfe=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xbfee[_0x11005e];return _0x29338f;};var fs=require(_0xebfe('0x0'));var path=require(_0xebfe('0x1'));var config=require(_0xebfe('0x2'));var root=config[_0xebfe('0x3')];var APP_JSON_PATH=path[_0xebfe('0x4')](root,_0xebfe('0x5'));var NODEPATH=path[_0xebfe('0x4')](root,_0xebfe('0x6'));function setLegacyLibsNodeEnvPath(_0x1e519c){let _0x30a4d5=![];if(Array[_0xebfe('0x7')](_0x1e519c['apps'])){var _0x222ed0=_0x1e519c['apps'][_0xebfe('0x8')](function(_0x954952){return _0x954952['name']==='motion2';});if(_0x222ed0>-0x1){var _0xbbba74=_0x1e519c[_0xebfe('0x9')][_0x222ed0];if(typeof _0xbbba74[_0xebfe('0xa')][_0xebfe('0xb')]!==_0xebfe('0xc')){_0xbbba74[_0xebfe('0xa')]['NODE_PATH']=NODEPATH;_0x30a4d5=!![];}}return{'appConfig':_0x1e519c,'updated':_0x30a4d5};}}function updateAppConfig(_0x1a8675){return fs[_0xebfe('0xd')](APP_JSON_PATH)[_0xebfe('0xe')](function(_0x569d10){if(_0x569d10){return fs[_0xebfe('0xf')](APP_JSON_PATH)[_0xebfe('0xe')](function(_0x5a3efc){var _0x2773ca=setLegacyLibsNodeEnvPath(_0x5a3efc);if(_0x2773ca[_0xebfe('0x10')]){_0x1a8675['info']('Updating\x20app.json');return fs[_0xebfe('0x11')](APP_JSON_PATH,_0x5a3efc,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xebfe('0x4')]();}});}module[_0xebfe('0x12')]=updateAppConfig; \ No newline at end of file +var _0xf233=['../config/environment','resolve','server/app.json','legacy-libs','apps','findIndex','name','env','NODE_PATH','string','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra'];(function(_0x4738b7,_0x9096f0){var _0x47cb9e=function(_0x45ee49){while(--_0x45ee49){_0x4738b7['push'](_0x4738b7['shift']());}};_0x47cb9e(++_0x9096f0);}(_0xf233,0x97));var _0x3f23=function(_0x1ef0cd,_0x5735df){_0x1ef0cd=_0x1ef0cd-0x0;var _0x2542ab=_0xf233[_0x1ef0cd];return _0x2542ab;};var fs=require(_0x3f23('0x0'));var path=require('path');var config=require(_0x3f23('0x1'));var root=config['root'];var APP_JSON_PATH=path[_0x3f23('0x2')](root,_0x3f23('0x3'));var NODEPATH=path[_0x3f23('0x2')](root,_0x3f23('0x4'));function setLegacyLibsNodeEnvPath(_0x589098){let _0x98e171=![];if(Array['isArray'](_0x589098[_0x3f23('0x5')])){var _0x40c721=_0x589098[_0x3f23('0x5')][_0x3f23('0x6')](function(_0x181f68){return _0x181f68[_0x3f23('0x7')]==='motion2';});if(_0x40c721>-0x1){var _0x1b901e=_0x589098['apps'][_0x40c721];if(typeof _0x1b901e[_0x3f23('0x8')][_0x3f23('0x9')]!==_0x3f23('0xa')){_0x1b901e[_0x3f23('0x8')][_0x3f23('0x9')]=NODEPATH;_0x98e171=!![];}}return{'appConfig':_0x589098,'updated':_0x98e171};}}function updateAppConfig(_0x28d983){return fs[_0x3f23('0xb')](APP_JSON_PATH)[_0x3f23('0xc')](function(_0x2c973e){if(_0x2c973e){return fs[_0x3f23('0xd')](APP_JSON_PATH)['then'](function(_0xf567be){var _0x3e28fa=setLegacyLibsNodeEnvPath(_0xf567be);if(_0x3e28fa[_0x3f23('0xe')]){_0x28d983[_0x3f23('0xf')](_0x3f23('0x10'));return fs[_0x3f23('0x11')](APP_JSON_PATH,_0xf567be,{'spaces':0x2});}else{return Promise[_0x3f23('0x2')]();}});}else{return Promise[_0x3f23('0x2')]();}});}module[_0x3f23('0x12')]=updateAppConfig; \ No newline at end of file -- 1.7.1